diff --git a/copilot/js/main.js b/copilot/js/main.js index dac0fae9..d7c98b40 100644 --- a/copilot/js/main.js +++ b/copilot/js/main.js @@ -1,139 +1,79 @@ -"use strict";var _ro=Object.create;var W_e=Object.defineProperty;var Cro=Object.getOwnPropertyDescriptor;var vro=Object.getOwnPropertyNames;var bro=Object.getPrototypeOf,Sro=Object.prototype.hasOwnProperty;var i9r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),o9r=t=>{throw TypeError(t)};var a=(t,e)=>W_e(t,"name",{value:e,configurable:!0});var me=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wi=(t,e)=>{for(var r in e)W_e(t,r,{get:e[r],enumerable:!0})},s9r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vro(e))!Sro.call(t,o)&&o!==r&&W_e(t,o,{get:()=>e[o],enumerable:!(n=Cro(e,o))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?_ro(bro(t)):{},s9r(e||!t||!t.__esModule?W_e(r,"default",{value:t,enumerable:!0}):r,t)),Ca=t=>s9r(W_e({},"__esModule",{value:!0}),t);var swt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&o9r("Object expected");var n,o;r&&(n=e[i9r("asyncDispose")]),n===void 0&&(n=e[i9r("dispose")],r&&(o=n)),typeof n!="function"&&o9r("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},awt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=me(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var p9r,h9r=me(()=>{p();p9r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var m9r,g9r=me(()=>{p();m9r="00000000-0000-0000-0000-000000000000"});var A9r,y9r=me(()=>{p();A9r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function kro(t){return typeof t=="string"&&A9r.test(t)}var C9,z_e=me(()=>{p();y9r();a(kro,"validate");C9=kro});function Pro(t){if(!C9(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var EB,Y_e=me(()=>{p();z_e();a(Pro,"parse");EB=Pro});function JE(t,e=0){return($g[t[e+0]]+$g[t[e+1]]+$g[t[e+2]]+$g[t[e+3]]+"-"+$g[t[e+4]]+$g[t[e+5]]+"-"+$g[t[e+6]]+$g[t[e+7]]+"-"+$g[t[e+8]]+$g[t[e+9]]+"-"+$g[t[e+10]]+$g[t[e+11]]+$g[t[e+12]]+$g[t[e+13]]+$g[t[e+14]]+$g[t[e+15]]).toLowerCase()}function Dro(t,e=0){let r=JE(t,e);if(!C9(r))throw TypeError("Stringified UUID is invalid");return r}var $g,E9r,_B=me(()=>{p();z_e();$g=[];for(let t=0;t<256;++t)$g.push((t+256).toString(16).slice(1));a(JE,"unsafeStringify");a(Dro,"stringify");E9r=Dro});function CB(){return crypto.getRandomValues(Nro)}var Nro,t8e=me(()=>{p();Nro=new Uint8Array(16);a(CB,"rng")});function Mro(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=_9r(t.random??t.rng?.()??CB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=CB();Oro(K_e,s,c),n=_9r(c,K_e.msecs,K_e.nsecs,o?void 0:K_e.clockseq,o?void 0:K_e.node,e,r)}return e??JE(n)}function Oro(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var K_e,r8e,lwt=me(()=>{p();t8e();_B();K_e={};a(Mro,"v1");a(Oro,"updateV1State");a(_9r,"v1Bytes");r8e=Mro});function J_e(t){let e=typeof t=="string"?EB(t):t,r=Bro(e);return typeof t=="string"?JE(r):r}function Bro(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var uwt=me(()=>{p();Y_e();_B();a(J_e,"v1ToV6");a(Bro,"_v1ToV6")});function Lro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,C9r.createHash)("md5").update(t).digest()}var C9r,v9r,b9r=me(()=>{p();C9r=require("node:crypto");a(Lro,"md5");v9r=Lro});function Fro(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return JE(u)}var n8e,i8e,dwt=me(()=>{p();Y_e();_B();a(Fro,"stringToBytes");n8e="6ba7b810-9dad-11d1-80b4-00c04fd430c8",i8e="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Z_e,"v35")});function fwt(t,e,r,n){return Z_e(48,v9r,t,e,r,n)}var S9r,T9r=me(()=>{p();b9r();dwt();a(fwt,"v3");fwt.DNS=n8e;fwt.URL=i8e;S9r=fwt});function Uro(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Qro(t,e,r)}function Qro(t,e,r){t=t||{};let n=t.random??t.rng?.()??CB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return JE(n)}var gr,I9r=me(()=>{p();t8e();_B();a(Uro,"v4");a(Qro,"_v4");gr=Uro});function qro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,x9r.createHash)("sha1").update(t).digest()}var x9r,w9r,R9r=me(()=>{p();x9r=require("node:crypto");a(qro,"sha1");w9r=qro});function pwt(t,e,r,n){return Z_e(80,w9r,t,e,r,n)}var k9r,P9r=me(()=>{p();R9r();dwt();a(pwt,"v5");pwt.DNS=n8e;pwt.URL=i8e;k9r=pwt});function jro(t,e,r){t??={},r??=0;let n=r8e({...t,_v6:!0},new Uint8Array(16));if(n=J_e(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return JE(n)}var D9r,N9r=me(()=>{p();_B();lwt();uwt();a(jro,"v6");D9r=jro});function hwt(t){let e=typeof t=="string"?EB(t):t,r=Hro(e);return typeof t=="string"?JE(r):r}function Hro(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var M9r=me(()=>{p();Y_e();_B();a(hwt,"v6ToV1");a(Hro,"_v6ToV1")});function Gro(t,e,r){let n;if(t)n=O9r(t.random??t.rng?.()??CB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=CB();$ro(mwt,o,s),n=O9r(s,mwt.msecs,mwt.seq,e,r)}return e??JE(n)}function $ro(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function O9r(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var mwt,B9r,L9r=me(()=>{p();t8e();_B();mwt={};a(Gro,"v7");a($ro,"updateV7State");a(O9r,"v7Bytes");B9r=Gro});function Vro(t){if(!C9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var F9r,U9r=me(()=>{p();z_e();a(Vro,"version");F9r=Vro});var yc={};wi(yc,{MAX:()=>p9r,NIL:()=>m9r,parse:()=>EB,stringify:()=>E9r,v1:()=>r8e,v1ToV6:()=>J_e,v3:()=>S9r,v4:()=>gr,v5:()=>k9r,v6:()=>D9r,v6ToV1:()=>hwt,v7:()=>B9r,validate:()=>C9,version:()=>F9r});var Ns=me(()=>{p();h9r();g9r();Y_e();_B();lwt();uwt();T9r();I9r();P9r();N9r();M9r();L9r();z_e();U9r()});var Rm=I(gwt=>{"use strict";p();gwt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};gwt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var q9r=I((dXc,Q9r)=>{p();var v9=require("constants"),Wro=process.cwd,o8e=null,zro=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return o8e||(o8e=Wro.call(process)),o8e};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Awt=process.chdir,process.chdir=function(t){o8e=null,Awt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Awt));var Awt;Q9r.exports=Yro;function Yro(t){v9.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),zro==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,E,_){var v;if(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,v9.O_WRONLY|v9.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,v9.O_WRONLY|v9.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){v9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,v9.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,v9.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(Yro,"patch")});var G9r=I((hXc,H9r)=>{p();var j9r=require("stream").Stream;H9r.exports=Kro;function Kro(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);j9r.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);j9r.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Kro,"legacy")});var V9r=I((AXc,$9r)=>{"use strict";p();$9r.exports=Zro;var Jro=Object.getPrototypeOf||function(t){return t.__proto__};function Zro(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Jro(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a(Zro,"clone")});var hie=I((_Xc,_wt)=>{p();var Jd=require("fs"),Xro=q9r(),eno=G9r(),tno=V9r(),s8e=require("util"),Vg,c8e;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Vg=Symbol.for("graceful-fs.queue"),c8e=Symbol.for("graceful-fs.previous")):(Vg="___graceful-fs.queue",c8e="___graceful-fs.previous");function rno(){}a(rno,"noop");function Y9r(t,e){Object.defineProperty(t,Vg,{get:a(function(){return e},"get")})}a(Y9r,"publishQueue");var qV=rno;s8e.debuglog?qV=s8e.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qV=a(function(){var t=s8e.format.apply(s8e,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t)},"debug"));Jd[Vg]||(W9r=global[Vg]||[],Y9r(Jd,W9r),Jd.close=(function(t){function e(r,n){return t.call(Jd,r,function(o){o||z9r(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,c8e,{value:t}),e})(Jd.close),Jd.closeSync=(function(t){function e(r){t.apply(Jd,arguments),z9r()}return a(e,"closeSync"),Object.defineProperty(e,c8e,{value:t}),e})(Jd.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){qV(Jd[Vg]),require("assert").equal(Jd[Vg].length,0)}));var W9r;global[Vg]||Y9r(global,Jd[Vg]);_wt.exports=ywt(tno(Jd));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Jd.__patched&&(_wt.exports=ywt(Jd),Jd.__patched=!0);function ywt(t){Xro(t),t.gracefulify=ywt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,L){return typeof N=="function"&&(L=N,N=null),B(D,N,L);function B(Q,M,O,q){return e(Q,M,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?pie([B,[Q,M,O],F,q||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(B,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,L,B){return typeof L=="function"&&(B=L,L=null),Q(D,N,L,B);function Q(M,O,q,F,U){return n(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}a(Q,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,L,B){return typeof L=="function"&&(B=L,L=null),Q(D,N,L,B);function Q(M,O,q,F,U){return s(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}a(Q,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,L,B){return typeof L=="function"&&(B=L,L=0),Q(D,N,L,B);function Q(M,O,q,F,U){return l(M,O,q,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}a(Q,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,L){typeof N=="function"&&(L=N,N=null);var B=f.test(process.version)?a(function(O,q,F,U){return d(O,Q(O,q,F,U))},"go$readdir"):a(function(O,q,F,U){return d(O,q,Q(O,q,F,U))},"go$readdir");return B(D,N,L);function Q(M,O,q,F){return function(U,W){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pie([B,[M,O,q],U,F||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof q=="function"&&q.call(this,U,W))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=eno(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;k(D.path,D.flags,D.mode,function(N,L){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;k(D.path,D.flags,D.mode,function(N,L){N?(D.destroy(),D.emit("error",N)):(D.fd=L,D.emit("open",L))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=k;function k(D,N,L,B){return typeof L=="function"&&(B=L,L=null),Q(D,N,L,B);function Q(M,O,q,F,U){return x(M,O,q,function(W,V){W&&(W.code==="EMFILE"||W.code==="ENFILE")?pie([Q,[M,O,q,F],W,U||Date.now(),Date.now()]):typeof F=="function"&&F.apply(this,arguments)})}a(Q,"go$open")}return a(k,"open"),t}a(ywt,"patch");function pie(t){qV("ENQUEUE",t[0].name,t[1]),Jd[Vg].push(t),Ewt()}a(pie,"enqueue");var a8e;function z9r(){for(var t=Date.now(),e=0;e2&&(Jd[Vg][e][3]=t,Jd[Vg][e][4]=t);Ewt()}a(z9r,"resetQueue");function Ewt(){if(clearTimeout(a8e),a8e=void 0,Jd[Vg].length!==0){var t=Jd[Vg].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)qV("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){qV("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(qV("RETRY",e.name,r),e.apply(null,r.concat([o]))):Jd[Vg].push(t)}a8e===void 0&&(a8e=setTimeout(Ewt,0))}}a(Ewt,"retry")});var XE=I(vB=>{"use strict";p();var K9r=Rm().fromCallback,ZE=hie(),nno=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof ZE[t]=="function");Object.assign(vB,ZE);nno.forEach(t=>{vB[t]=K9r(ZE[t])});vB.exists=function(t,e){return typeof e=="function"?ZE.exists(t,e):new Promise(r=>ZE.exists(t,r))};vB.read=function(t,e,r,n,o,s){return typeof s=="function"?ZE.read(t,e,r,n,o,s):new Promise((c,l)=>{ZE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};vB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.write(t,e,...r):new Promise((n,o)=>{ZE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};vB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.readv(t,e,...r):new Promise((n,o)=>{ZE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};vB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?ZE.writev(t,e,...r):new Promise((n,o)=>{ZE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof ZE.realpath.native=="function"?vB.realpath.native=K9r(ZE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var Z9r=I((TXc,J9r)=>{"use strict";p();var ino=require("path");J9r.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(ino.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var rUr=I((wXc,Cwt)=>{"use strict";p();var X9r=XE(),{checkPath:eUr}=Z9r(),tUr=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");Cwt.exports.makeDir=async(t,e)=>(eUr(t),X9r.mkdir(t,{mode:tUr(e),recursive:!0}));Cwt.exports.makeDirSync=(t,e)=>(eUr(t),X9r.mkdirSync(t,{mode:tUr(e),recursive:!0}))});var ok=I((PXc,nUr)=>{"use strict";p();var ono=Rm().fromPromise,{makeDir:sno,makeDirSync:vwt}=rUr(),bwt=ono(sno);nUr.exports={mkdirs:bwt,mkdirsSync:vwt,mkdirp:bwt,mkdirpSync:vwt,ensureDir:bwt,ensureDirSync:vwt}});var b9=I((NXc,oUr)=>{"use strict";p();var ano=Rm().fromPromise,iUr=XE();function cno(t){return iUr.access(t).then(()=>!0).catch(()=>!1)}a(cno,"pathExists");oUr.exports={pathExists:ano(cno),pathExistsSync:iUr.existsSync}});var Swt=I((BXc,sUr)=>{"use strict";p();var mie=XE(),lno=Rm().fromPromise;async function uno(t,e,r){let n=await mie.open(t,"r+"),o=null;try{await mie.futimes(n,e,r)}finally{try{await mie.close(n)}catch(s){o=s}}if(o)throw o}a(uno,"utimesMillis");function dno(t,e,r){let n=mie.openSync(t,"r+");return mie.futimesSync(n,e,r),mie.closeSync(n)}a(dno,"utimesMillisSync");sUr.exports={utimesMillis:lno(uno),utimesMillisSync:dno}});var jV=I((UXc,uUr)=>{"use strict";p();var gie=XE(),km=require("path"),aUr=Rm().fromPromise;function fno(t,e,r){let n=r.dereference?o=>gie.stat(o,{bigint:!0}):o=>gie.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(fno,"getStats");function pno(t,e,r){let n,o=r.dereference?c=>gie.statSync(c,{bigint:!0}):c=>gie.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(pno,"getStatsSync");async function hno(t,e,r,n){let{srcStat:o,destStat:s}=await fno(t,e,n);if(s){if(X_e(o,s)){let c=km.basename(t),l=km.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&Twt(t,e))throw new Error(l8e(t,e,r));return{srcStat:o,destStat:s}}a(hno,"checkPaths");function mno(t,e,r,n){let{srcStat:o,destStat:s}=pno(t,e,n);if(s){if(X_e(o,s)){let c=km.basename(t),l=km.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&Twt(t,e))throw new Error(l8e(t,e,r));return{srcStat:o,destStat:s}}a(mno,"checkPathsSync");async function cUr(t,e,r,n){let o=km.resolve(km.dirname(t)),s=km.resolve(km.dirname(r));if(s===o||s===km.parse(s).root)return;let c;try{c=await gie.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(X_e(e,c))throw new Error(l8e(t,r,n));return cUr(t,e,s,n)}a(cUr,"checkParentPaths");function lUr(t,e,r,n){let o=km.resolve(km.dirname(t)),s=km.resolve(km.dirname(r));if(s===o||s===km.parse(s).root)return;let c;try{c=gie.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(X_e(e,c))throw new Error(l8e(t,r,n));return lUr(t,e,s,n)}a(lUr,"checkParentPathsSync");function X_e(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(X_e,"areIdentical");function Twt(t,e){let r=km.resolve(t).split(km.sep).filter(o=>o),n=km.resolve(e).split(km.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(Twt,"isSrcSubdir");function l8e(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(l8e,"errMsg");uUr.exports={checkPaths:aUr(hno),checkPathsSync:mno,checkParentPaths:aUr(cUr),checkParentPathsSync:lUr,isSrcSubdir:Twt,areIdentical:X_e}});var fUr=I((jXc,dUr)=>{"use strict";p();async function gno(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(gno,"asyncIteratorConcurrentProcess");dUr.exports={asyncIteratorConcurrentProcess:gno}});var AUr=I(($Xc,gUr)=>{"use strict";p();var hy=XE(),eCe=require("path"),{mkdirs:Ano}=ok(),{pathExists:yno}=b9(),{utimesMillis:Eno}=Swt(),tCe=jV(),{asyncIteratorConcurrentProcess:_no}=fUr();async function Cno(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +"use strict";var aro=Object.create;var O_e=Object.defineProperty;var cro=Object.getOwnPropertyDescriptor;var lro=Object.getOwnPropertyNames;var uro=Object.getPrototypeOf,dro=Object.prototype.hasOwnProperty;var B6r=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),L6r=t=>{throw TypeError(t)};var a=(t,e)=>O_e(t,"name",{value:e,configurable:!0});var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xi=(t,e)=>{for(var r in e)O_e(t,r,{get:e[r],enumerable:!0})},F6r=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of lro(e))!dro.call(t,o)&&o!==r&&O_e(t,o,{get:()=>e[o],enumerable:!(n=cro(e,o))||n.enumerable});return t};var fe=(t,e,r)=>(r=t!=null?aro(uro(t)):{},F6r(e||!t||!t.__esModule?O_e(r,"default",{value:t,enumerable:!0}):r,t)),ya=t=>F6r(O_e({},"__esModule",{value:!0}),t);var Vxt=(t,e,r)=>{if(e!=null){typeof e!="object"&&typeof e!="function"&&L6r("Object expected");var n,o;r&&(n=e[B6r("asyncDispose")]),n===void 0&&(n=e[B6r("dispose")],r&&(o=n)),typeof n!="function"&&L6r("Object not disposable"),o&&(n=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),t.push([r,n,e])}else r&&t.push([r]);return e},Wxt=(t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),s=c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e};return s()};var importMetaUrlShim,p=_e(()=>{"use strict";importMetaUrlShim=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:importMetaUrlShim});var W6r,z6r=_e(()=>{p();W6r="ffffffff-ffff-ffff-ffff-ffffffffffff"});var Y6r,K6r=_e(()=>{p();Y6r="00000000-0000-0000-0000-000000000000"});var J6r,Z6r=_e(()=>{p();J6r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function bro(t){return typeof t=="string"&&J6r.test(t)}var p9,B_e=_e(()=>{p();Z6r();a(bro,"validate");p9=bro});function Sro(t){if(!p9(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(t.slice(9,13),16))>>>8,e&255,(e=parseInt(t.slice(14,18),16))>>>8,e&255,(e=parseInt(t.slice(19,23),16))>>>8,e&255,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}var fB,L_e=_e(()=>{p();B_e();a(Sro,"parse");fB=Sro});function zE(t,e=0){return(Vg[t[e+0]]+Vg[t[e+1]]+Vg[t[e+2]]+Vg[t[e+3]]+"-"+Vg[t[e+4]]+Vg[t[e+5]]+"-"+Vg[t[e+6]]+Vg[t[e+7]]+"-"+Vg[t[e+8]]+Vg[t[e+9]]+"-"+Vg[t[e+10]]+Vg[t[e+11]]+Vg[t[e+12]]+Vg[t[e+13]]+Vg[t[e+14]]+Vg[t[e+15]]).toLowerCase()}function Tro(t,e=0){let r=zE(t,e);if(!p9(r))throw TypeError("Stringified UUID is invalid");return r}var Vg,X6r,pB=_e(()=>{p();B_e();Vg=[];for(let t=0;t<256;++t)Vg.push((t+256).toString(16).slice(1));a(zE,"unsafeStringify");a(Tro,"stringify");X6r=Tro});function hB(){return crypto.getRandomValues(Iro)}var Iro,qFe=_e(()=>{p();Iro=new Uint8Array(16);a(hB,"rng")});function xro(t,e,r){let n,o=t?._v6??!1;if(t){let s=Object.keys(t);s.length===1&&s[0]==="_v6"&&(t=void 0)}if(t)n=e9r(t.random??t.rng?.()??hB(),t.msecs,t.nsecs,t.clockseq,t.node,e,r);else{let s=Date.now(),c=hB();wro(F_e,s,c),n=e9r(c,F_e.msecs,F_e.nsecs,o?void 0:F_e.clockseq,o?void 0:F_e.node,e,r)}return e??zE(n)}function wro(t,e,r){return t.msecs??=-1/0,t.nsecs??=0,e===t.msecs?(t.nsecs++,t.nsecs>=1e4&&(t.node=void 0,t.nsecs=0)):e>t.msecs?t.nsecs=0:e= 16");if(!s)s=new Uint8Array(16),c=0;else if(c<0||c+16>s.length)throw new RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);e??=Date.now(),r??=0,n??=(t[8]<<8|t[9])&16383,o??=t.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+r)%4294967296;s[c++]=l>>>24&255,s[c++]=l>>>16&255,s[c++]=l>>>8&255,s[c++]=l&255;let u=e/4294967296*1e4&268435455;s[c++]=u>>>8&255,s[c++]=u&255,s[c++]=u>>>24&15|16,s[c++]=u>>>16&255,s[c++]=n>>>8|128,s[c++]=n&255;for(let d=0;d<6;++d)s[c++]=o[d];return s}var F_e,jFe,Zxt=_e(()=>{p();qFe();pB();F_e={};a(xro,"v1");a(wro,"updateV1State");a(e9r,"v1Bytes");jFe=xro});function U_e(t){let e=typeof t=="string"?fB(t):t,r=Rro(e);return typeof t=="string"?zE(r):r}function Rro(t){return Uint8Array.of((t[6]&15)<<4|t[7]>>4&15,(t[7]&15)<<4|(t[4]&240)>>4,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,(t[1]&15)<<4|(t[2]&240)>>4,96|t[2]&15,t[3],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var Xxt=_e(()=>{p();L_e();pB();a(U_e,"v1ToV6");a(Rro,"_v1ToV6")});function Pro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,t9r.createHash)("md5").update(t).digest()}var t9r,r9r,n9r=_e(()=>{p();t9r=require("node:crypto");a(Pro,"md5");r9r=Pro});function kro(t){t=unescape(encodeURIComponent(t));let e=new Uint8Array(t.length);for(let r=0;ro.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let d=0;d<16;++d)o[s+d]=u[d];return o}return zE(u)}var HFe,GFe,ewt=_e(()=>{p();L_e();pB();a(kro,"stringToBytes");HFe="6ba7b810-9dad-11d1-80b4-00c04fd430c8",GFe="6ba7b811-9dad-11d1-80b4-00c04fd430c8";a(Q_e,"v35")});function twt(t,e,r,n){return Q_e(48,r9r,t,e,r,n)}var i9r,o9r=_e(()=>{p();n9r();ewt();a(twt,"v3");twt.DNS=HFe;twt.URL=GFe;i9r=twt});function Dro(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Nro(t,e,r)}function Nro(t,e,r){t=t||{};let n=t.random??t.rng?.()??hB();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return zE(n)}var ir,s9r=_e(()=>{p();qFe();pB();a(Dro,"v4");a(Nro,"_v4");ir=Dro});function Mro(t){return Array.isArray(t)?t=Buffer.from(t):typeof t=="string"&&(t=Buffer.from(t,"utf8")),(0,a9r.createHash)("sha1").update(t).digest()}var a9r,c9r,l9r=_e(()=>{p();a9r=require("node:crypto");a(Mro,"sha1");c9r=Mro});function rwt(t,e,r,n){return Q_e(80,c9r,t,e,r,n)}var u9r,d9r=_e(()=>{p();l9r();ewt();a(rwt,"v5");rwt.DNS=HFe;rwt.URL=GFe;u9r=rwt});function Oro(t,e,r){t??={},r??=0;let n=jFe({...t,_v6:!0},new Uint8Array(16));if(n=U_e(n),e){if(r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;o++)e[r+o]=n[o];return e}return zE(n)}var f9r,p9r=_e(()=>{p();pB();Zxt();Xxt();a(Oro,"v6");f9r=Oro});function nwt(t){let e=typeof t=="string"?fB(t):t,r=Bro(e);return typeof t=="string"?zE(r):r}function Bro(t){return Uint8Array.of((t[3]&15)<<4|t[4]>>4&15,(t[4]&15)<<4|(t[5]&240)>>4,(t[5]&15)<<4|t[6]&15,t[7],(t[1]&15)<<4|(t[2]&240)>>4,(t[2]&15)<<4|(t[3]&240)>>4,16|(t[0]&240)>>4,(t[0]&15)<<4|(t[1]&240)>>4,t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}var h9r=_e(()=>{p();L_e();pB();a(nwt,"v6ToV1");a(Bro,"_v6ToV1")});function Lro(t,e,r){let n;if(t)n=m9r(t.random??t.rng?.()??hB(),t.msecs,t.seq,e,r);else{let o=Date.now(),s=hB();Fro(iwt,o,s),n=m9r(s,iwt.msecs,iwt.seq,e,r)}return e??zE(n)}function Fro(t,e,r){return t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function m9r(t,e,r,n,o=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),o=0;else if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return e??=Date.now(),r??=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9],n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=e&255,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|t[10]&3,n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}var iwt,g9r,A9r=_e(()=>{p();qFe();pB();iwt={};a(Lro,"v7");a(Fro,"updateV7State");a(m9r,"v7Bytes");g9r=Lro});function Uro(t){if(!p9(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var y9r,E9r=_e(()=>{p();B_e();a(Uro,"version");y9r=Uro});var Ac={};xi(Ac,{MAX:()=>W6r,NIL:()=>Y6r,parse:()=>fB,stringify:()=>X6r,v1:()=>jFe,v1ToV6:()=>U_e,v3:()=>i9r,v4:()=>ir,v5:()=>u9r,v6:()=>f9r,v6ToV1:()=>nwt,v7:()=>g9r,validate:()=>p9,version:()=>y9r});var As=_e(()=>{p();z6r();K6r();L_e();pB();Zxt();Xxt();o9r();s9r();d9r();p9r();h9r();A9r();B_e();E9r()});var km=I(owt=>{"use strict";p();owt.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((o,s)=>o!=null?n(o):r(s)),t.apply(this,e)})},"name",{value:t.name})};owt.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var v9r=I((uJc,_9r)=>{p();var h9=require("constants"),Qro=process.cwd,$Fe=null,qro=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return $Fe||($Fe=Qro.call(process)),$Fe};try{process.cwd()}catch{}typeof process.chdir=="function"&&(swt=process.chdir,process.chdir=function(t){$Fe=null,swt.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,swt));var swt;_9r.exports=jro;function jro(t){h9.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=c(t.chownSync),t.fchownSync=c(t.fchownSync),t.lchownSync=c(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(f,h,m){m&&process.nextTick(m)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(f,h,m,g){g&&process.nextTick(g)},t.lchownSync=function(){}),qro==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(f){function h(m,g,A){var y=Date.now(),E=0;f(m,g,a(function _(v){if(v&&(v.code==="EACCES"||v.code==="EPERM"||v.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){t.stat(g,function(b,T){b&&b.code==="ENOENT"?f(m,g,_):A(v)})},E),E<100&&(E+=10);return}A&&A(v)},"CB"))}return a(h,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(f){function h(m,g,A,y,E,_){var v;if(_&&typeof _=="function"){var b=0;v=a(function(T,w,R){if(T&&T.code==="EAGAIN"&&b<10)return b++,f.call(t,m,g,A,y,E,v);_.apply(this,arguments)},"callback")}return f.call(t,m,g,A,y,E,v)}return a(h,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(h,f),h})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(f){return function(h,m,g,A,y){for(var E=0;;)try{return f.call(t,h,m,g,A,y)}catch(_){if(_.code==="EAGAIN"&&E<10){E++;continue}throw _}}})(t.readSync);function e(f){f.lchmod=function(h,m,g){f.open(h,h9.O_WRONLY|h9.O_SYMLINK,m,function(A,y){if(A){g&&g(A);return}f.fchmod(y,m,function(E){f.close(y,function(_){g&&g(E||_)})})})},f.lchmodSync=function(h,m){var g=f.openSync(h,h9.O_WRONLY|h9.O_SYMLINK,m),A=!0,y;try{y=f.fchmodSync(g,m),A=!1}finally{if(A)try{f.closeSync(g)}catch{}else f.closeSync(g)}return y}}a(e,"patchLchmod");function r(f){h9.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(h,m,g,A){f.open(h,h9.O_SYMLINK,function(y,E){if(y){A&&A(y);return}f.futimes(E,m,g,function(_){f.close(E,function(v){A&&A(_||v)})})})},f.lutimesSync=function(h,m,g){var A=f.openSync(h,h9.O_SYMLINK),y,E=!0;try{y=f.futimesSync(A,m,g),E=!1}finally{if(E)try{f.closeSync(A)}catch{}else f.closeSync(A)}return y}):f.futimes&&(f.lutimes=function(h,m,g,A){A&&process.nextTick(A)},f.lutimesSync=function(){})}a(r,"patchLutimes");function n(f){return f&&function(h,m,g){return f.call(t,h,m,function(A){d(A)&&(A=null),g&&g.apply(this,arguments)})}}a(n,"chmodFix");function o(f){return f&&function(h,m){try{return f.call(t,h,m)}catch(g){if(!d(g))throw g}}}a(o,"chmodFixSync");function s(f){return f&&function(h,m,g,A){return f.call(t,h,m,g,function(y){d(y)&&(y=null),A&&A.apply(this,arguments)})}}a(s,"chownFix");function c(f){return f&&function(h,m,g){try{return f.call(t,h,m,g)}catch(A){if(!d(A))throw A}}}a(c,"chownFixSync");function l(f){return f&&function(h,m,g){typeof m=="function"&&(g=m,m=null);function A(y,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),g&&g.apply(this,arguments)}return a(A,"callback"),m?f.call(t,h,m,A):f.call(t,h,A)}}a(l,"statFix");function u(f){return f&&function(h,m){var g=m?f.call(t,h,m):f.call(t,h);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}a(u,"statFixSync");function d(f){if(!f||f.code==="ENOSYS")return!0;var h=!process.getuid||process.getuid()!==0;return!!(h&&(f.code==="EINVAL"||f.code==="EPERM"))}a(d,"chownErOk")}a(jro,"patch")});var S9r=I((pJc,b9r)=>{p();var C9r=require("stream").Stream;b9r.exports=Hro;function Hro(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);C9r.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var c=Object.keys(o),l=0,u=c.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}t.open(this.path,this.flags,this.mode,function(f,h){if(f){s.emit("error",f),s.readable=!1;return}s.fd=h,s.emit("open",h),s._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);C9r.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var s=Object.keys(o),c=0,l=s.length;c= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Hro,"legacy")});var I9r=I((gJc,T9r)=>{"use strict";p();T9r.exports=$ro;var Gro=Object.getPrototypeOf||function(t){return t.__proto__};function $ro(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Gro(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}a($ro,"clone")});var sie=I((EJc,lwt)=>{p();var Yd=require("fs"),Vro=v9r(),Wro=S9r(),zro=I9r(),VFe=require("util"),Wg,zFe;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Wg=Symbol.for("graceful-fs.queue"),zFe=Symbol.for("graceful-fs.previous")):(Wg="___graceful-fs.queue",zFe="___graceful-fs.previous");function Yro(){}a(Yro,"noop");function R9r(t,e){Object.defineProperty(t,Wg,{get:a(function(){return e},"get")})}a(R9r,"publishQueue");var kV=Yro;VFe.debuglog?kV=VFe.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(kV=a(function(){var t=VFe.format.apply(VFe,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t)},"debug"));Yd[Wg]||(x9r=global[Wg]||[],R9r(Yd,x9r),Yd.close=(function(t){function e(r,n){return t.call(Yd,r,function(o){o||w9r(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,zFe,{value:t}),e})(Yd.close),Yd.closeSync=(function(t){function e(r){t.apply(Yd,arguments),w9r()}return a(e,"closeSync"),Object.defineProperty(e,zFe,{value:t}),e})(Yd.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){kV(Yd[Wg]),require("assert").equal(Yd[Wg].length,0)}));var x9r;global[Wg]||R9r(global,Yd[Wg]);lwt.exports=awt(zro(Yd));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Yd.__patched&&(lwt.exports=awt(Yd),Yd.__patched=!0);function awt(t){Vro(t),t.gracefulify=awt,t.createReadStream=w,t.createWriteStream=R;var e=t.readFile;t.readFile=r;function r(D,N,B){return typeof N=="function"&&(B=N,N=null),L(D,N,B);function L(j,M,O,q){return e(j,M,function(Q){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?oie([L,[j,M,O],Q,q||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}a(L,"go$readFile")}a(r,"readFile");var n=t.writeFile;t.writeFile=o;function o(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return n(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?oie([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$writeFile")}a(o,"writeFile");var s=t.appendFile;s&&(t.appendFile=c);function c(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return s(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?oie([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$appendFile")}a(c,"appendFile");var l=t.copyFile;l&&(t.copyFile=u);function u(D,N,B,L){return typeof B=="function"&&(L=B,B=0),j(D,N,B,L);function j(M,O,q,Q,U){return l(M,O,q,function(z){z&&(z.code==="EMFILE"||z.code==="ENFILE")?oie([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$copyFile")}a(u,"copyFile");var d=t.readdir;t.readdir=h;var f=/^v[0-5]\./;function h(D,N,B){typeof N=="function"&&(B=N,N=null);var L=f.test(process.version)?a(function(O,q,Q,U){return d(O,j(O,q,Q,U))},"go$readdir"):a(function(O,q,Q,U){return d(O,q,j(O,q,Q,U))},"go$readdir");return L(D,N,B);function j(M,O,q,Q){return function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?oie([L,[M,O,q],U,Q||Date.now(),Date.now()]):(z&&z.sort&&z.sort(),typeof q=="function"&&q.call(this,U,z))}}}if(a(h,"readdir"),process.version.substr(0,4)==="v0.8"){var m=Wro(t);_=m.ReadStream,b=m.WriteStream}var g=t.ReadStream;g&&(_.prototype=Object.create(g.prototype),_.prototype.open=v);var A=t.WriteStream;A&&(b.prototype=Object.create(A.prototype),b.prototype.open=T),Object.defineProperty(t,"ReadStream",{get:a(function(){return _},"get"),set:a(function(D){_=D},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:a(function(){return b},"get"),set:a(function(D){b=D},"set"),enumerable:!0,configurable:!0});var y=_;Object.defineProperty(t,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(D){y=D},"set"),enumerable:!0,configurable:!0});var E=b;Object.defineProperty(t,"FileWriteStream",{get:a(function(){return E},"get"),set:a(function(D){E=D},"set"),enumerable:!0,configurable:!0});function _(D,N){return this instanceof _?(g.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}a(_,"ReadStream");function v(){var D=this;P(D.path,D.flags,D.mode,function(N,B){N?(D.autoClose&&D.destroy(),D.emit("error",N)):(D.fd=B,D.emit("open",B),D.read())})}a(v,"ReadStream$open");function b(D,N){return this instanceof b?(A.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}a(b,"WriteStream");function T(){var D=this;P(D.path,D.flags,D.mode,function(N,B){N?(D.destroy(),D.emit("error",N)):(D.fd=B,D.emit("open",B))})}a(T,"WriteStream$open");function w(D,N){return new t.ReadStream(D,N)}a(w,"createReadStream");function R(D,N){return new t.WriteStream(D,N)}a(R,"createWriteStream");var x=t.open;t.open=P;function P(D,N,B,L){return typeof B=="function"&&(L=B,B=null),j(D,N,B,L);function j(M,O,q,Q,U){return x(M,O,q,function(z,W){z&&(z.code==="EMFILE"||z.code==="ENFILE")?oie([j,[M,O,q,Q],z,U||Date.now(),Date.now()]):typeof Q=="function"&&Q.apply(this,arguments)})}a(j,"go$open")}return a(P,"open"),t}a(awt,"patch");function oie(t){kV("ENQUEUE",t[0].name,t[1]),Yd[Wg].push(t),cwt()}a(oie,"enqueue");var WFe;function w9r(){for(var t=Date.now(),e=0;e2&&(Yd[Wg][e][3]=t,Yd[Wg][e][4]=t);cwt()}a(w9r,"resetQueue");function cwt(){if(clearTimeout(WFe),WFe=void 0,Yd[Wg].length!==0){var t=Yd[Wg].shift(),e=t[0],r=t[1],n=t[2],o=t[3],s=t[4];if(o===void 0)kV("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){kV("TIMEOUT",e.name,r);var c=r.pop();typeof c=="function"&&c.call(null,n)}else{var l=Date.now()-s,u=Math.max(s-o,1),d=Math.min(u*1.2,100);l>=d?(kV("RETRY",e.name,r),e.apply(null,r.concat([o]))):Yd[Wg].push(t)}WFe===void 0&&(WFe=setTimeout(cwt,0))}}a(cwt,"retry")});var KE=I(mB=>{"use strict";p();var P9r=km().fromCallback,YE=sie(),Kro=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof YE[t]=="function");Object.assign(mB,YE);Kro.forEach(t=>{mB[t]=P9r(YE[t])});mB.exists=function(t,e){return typeof e=="function"?YE.exists(t,e):new Promise(r=>YE.exists(t,r))};mB.read=function(t,e,r,n,o,s){return typeof s=="function"?YE.read(t,e,r,n,o,s):new Promise((c,l)=>{YE.read(t,e,r,n,o,(u,d,f)=>{if(u)return l(u);c({bytesRead:d,buffer:f})})})};mB.write=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.write(t,e,...r):new Promise((n,o)=>{YE.write(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffer:l})})})};mB.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.readv(t,e,...r):new Promise((n,o)=>{YE.readv(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesRead:c,buffers:l})})})};mB.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?YE.writev(t,e,...r):new Promise((n,o)=>{YE.writev(t,e,...r,(s,c,l)=>{if(s)return o(s);n({bytesWritten:c,buffers:l})})})};typeof YE.realpath.native=="function"?mB.realpath.native=P9r(YE.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var D9r=I((SJc,k9r)=>{"use strict";p();var Jro=require("path");k9r.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Jro.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var B9r=I((xJc,uwt)=>{"use strict";p();var N9r=KE(),{checkPath:M9r}=D9r(),O9r=a(t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode},"getMode");uwt.exports.makeDir=async(t,e)=>(M9r(t),N9r.mkdir(t,{mode:O9r(e),recursive:!0}));uwt.exports.makeDirSync=(t,e)=>(M9r(t),N9r.mkdirSync(t,{mode:O9r(e),recursive:!0}))});var tP=I((PJc,L9r)=>{"use strict";p();var Zro=km().fromPromise,{makeDir:Xro,makeDirSync:dwt}=B9r(),fwt=Zro(Xro);L9r.exports={mkdirs:fwt,mkdirsSync:dwt,mkdirp:fwt,mkdirpSync:dwt,ensureDir:fwt,ensureDirSync:dwt}});var m9=I((DJc,U9r)=>{"use strict";p();var eno=km().fromPromise,F9r=KE();function tno(t){return F9r.access(t).then(()=>!0).catch(()=>!1)}a(tno,"pathExists");U9r.exports={pathExists:eno(tno),pathExistsSync:F9r.existsSync}});var pwt=I((OJc,Q9r)=>{"use strict";p();var aie=KE(),rno=km().fromPromise;async function nno(t,e,r){let n=await aie.open(t,"r+"),o=null;try{await aie.futimes(n,e,r)}finally{try{await aie.close(n)}catch(s){o=s}}if(o)throw o}a(nno,"utimesMillis");function ino(t,e,r){let n=aie.openSync(t,"r+");return aie.futimesSync(n,e,r),aie.closeSync(n)}a(ino,"utimesMillisSync");Q9r.exports={utimesMillis:rno(nno),utimesMillisSync:ino}});var DV=I((FJc,G9r)=>{"use strict";p();var cie=KE(),Dm=require("path"),q9r=km().fromPromise;function ono(t,e,r){let n=r.dereference?o=>cie.stat(o,{bigint:!0}):o=>cie.lstat(o,{bigint:!0});return Promise.all([n(t),n(e).catch(o=>{if(o.code==="ENOENT")return null;throw o})]).then(([o,s])=>({srcStat:o,destStat:s}))}a(ono,"getStats");function sno(t,e,r){let n,o=r.dereference?c=>cie.statSync(c,{bigint:!0}):c=>cie.lstatSync(c,{bigint:!0}),s=o(t);try{n=o(e)}catch(c){if(c.code==="ENOENT")return{srcStat:s,destStat:null};throw c}return{srcStat:s,destStat:n}}a(sno,"getStatsSync");async function ano(t,e,r,n){let{srcStat:o,destStat:s}=await ono(t,e,n);if(s){if(q_e(o,s)){let c=Dm.basename(t),l=Dm.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&hwt(t,e))throw new Error(YFe(t,e,r));return{srcStat:o,destStat:s}}a(ano,"checkPaths");function cno(t,e,r,n){let{srcStat:o,destStat:s}=sno(t,e,n);if(s){if(q_e(o,s)){let c=Dm.basename(t),l=Dm.basename(e);if(r==="move"&&c!==l&&c.toLowerCase()===l.toLowerCase())return{srcStat:o,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(o.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!o.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(o.isDirectory()&&hwt(t,e))throw new Error(YFe(t,e,r));return{srcStat:o,destStat:s}}a(cno,"checkPathsSync");async function j9r(t,e,r,n){let o=Dm.resolve(Dm.dirname(t)),s=Dm.resolve(Dm.dirname(r));if(s===o||s===Dm.parse(s).root)return;let c;try{c=await cie.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(q_e(e,c))throw new Error(YFe(t,r,n));return j9r(t,e,s,n)}a(j9r,"checkParentPaths");function H9r(t,e,r,n){let o=Dm.resolve(Dm.dirname(t)),s=Dm.resolve(Dm.dirname(r));if(s===o||s===Dm.parse(s).root)return;let c;try{c=cie.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(q_e(e,c))throw new Error(YFe(t,r,n));return H9r(t,e,s,n)}a(H9r,"checkParentPathsSync");function q_e(t,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===t.ino&&e.dev===t.dev}a(q_e,"areIdentical");function hwt(t,e){let r=Dm.resolve(t).split(Dm.sep).filter(o=>o),n=Dm.resolve(e).split(Dm.sep).filter(o=>o);return r.every((o,s)=>n[s]===o)}a(hwt,"isSrcSubdir");function YFe(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}a(YFe,"errMsg");G9r.exports={checkPaths:q9r(ano),checkPathsSync:cno,checkParentPaths:q9r(j9r),checkParentPathsSync:H9r,isSrcSubdir:hwt,areIdentical:q_e}});var V9r=I((qJc,$9r)=>{"use strict";p();async function lno(t,e){let r=[];for await(let n of t)r.push(e(n).then(()=>null,o=>o??new Error("unknown error")));await Promise.all(r.map(n=>n.then(o=>{if(o!==null)throw o})))}a(lno,"asyncIteratorConcurrentProcess");$9r.exports={asyncIteratorConcurrentProcess:lno}});var J9r=I((GJc,K9r)=>{"use strict";p();var yy=KE(),j_e=require("path"),{mkdirs:uno}=tP(),{pathExists:dno}=m9(),{utimesMillis:fno}=pwt(),H_e=DV(),{asyncIteratorConcurrentProcess:pno}=V9r();async function hno(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await tCe.checkPaths(t,e,"copy",r);if(await tCe.checkParentPaths(t,n,e,"copy"),!await hUr(t,e,r))return;let c=eCe.dirname(e);await yno(c)||await Ano(c),await mUr(o,t,e,r)}a(Cno,"copy");async function hUr(t,e,r){return r.filter?r.filter(t,e):!0}a(hUr,"runFilter");async function mUr(t,e,r,n){let s=await(n.dereference?hy.stat:hy.lstat)(e);if(s.isDirectory())return Tno(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return vno(s,t,e,r,n);if(s.isSymbolicLink())return Ino(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(mUr,"getStatsAndPerformCopy");async function vno(t,e,r,n,o){if(!e)return pUr(t,r,n,o);if(o.overwrite)return await hy.unlink(n),pUr(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(vno,"onFile");async function pUr(t,e,r,n){if(await hy.copyFile(e,r),n.preserveTimestamps){bno(t.mode)&&await Sno(r,t.mode);let o=await hy.stat(e);await Eno(r,o.atime,o.mtime)}return hy.chmod(r,t.mode)}a(pUr,"copyFile");function bno(t){return(t&128)===0}a(bno,"fileIsNotWritable");function Sno(t,e){return hy.chmod(t,e|128)}a(Sno,"makeFileWritable");async function Tno(t,e,r,n,o){e||await hy.mkdir(n),await _no(await hy.opendir(r),async s=>{let c=eCe.join(r,s.name),l=eCe.join(n,s.name);if(await hUr(c,l,o)){let{destStat:d}=await tCe.checkPaths(c,l,"copy",o);await mUr(d,c,l,o)}}),e||await hy.chmod(n,t.mode)}a(Tno,"onDir");async function Ino(t,e,r,n){let o=await hy.readlink(e);if(n.dereference&&(o=eCe.resolve(process.cwd(),o)),!t)return hy.symlink(o,r);let s=null;try{s=await hy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return hy.symlink(o,r);throw c}if(n.dereference&&(s=eCe.resolve(process.cwd(),s)),o!==s){if(tCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(tCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await hy.unlink(r),hy.symlink(o,r)}a(Ino,"onLink");gUr.exports=Cno});var vUr=I((zXc,CUr)=>{"use strict";p();var e_=hie(),rCe=require("path"),xno=ok().mkdirsSync,wno=Swt().utimesMillisSync,nCe=jV();function Rno(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:o}=await H_e.checkPaths(t,e,"copy",r);if(await H_e.checkParentPaths(t,n,e,"copy"),!await z9r(t,e,r))return;let c=j_e.dirname(e);await dno(c)||await uno(c),await Y9r(o,t,e,r)}a(hno,"copy");async function z9r(t,e,r){return r.filter?r.filter(t,e):!0}a(z9r,"runFilter");async function Y9r(t,e,r,n){let s=await(n.dereference?yy.stat:yy.lstat)(e);if(s.isDirectory())return yno(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return mno(s,t,e,r,n);if(s.isSymbolicLink())return Eno(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(Y9r,"getStatsAndPerformCopy");async function mno(t,e,r,n,o){if(!e)return W9r(t,r,n,o);if(o.overwrite)return await yy.unlink(n),W9r(t,r,n,o);if(o.errorOnExist)throw new Error(`'${n}' already exists`)}a(mno,"onFile");async function W9r(t,e,r,n){if(await yy.copyFile(e,r),n.preserveTimestamps){gno(t.mode)&&await Ano(r,t.mode);let o=await yy.stat(e);await fno(r,o.atime,o.mtime)}return yy.chmod(r,t.mode)}a(W9r,"copyFile");function gno(t){return(t&128)===0}a(gno,"fileIsNotWritable");function Ano(t,e){return yy.chmod(t,e|128)}a(Ano,"makeFileWritable");async function yno(t,e,r,n,o){e||await yy.mkdir(n),await pno(await yy.opendir(r),async s=>{let c=j_e.join(r,s.name),l=j_e.join(n,s.name);if(await z9r(c,l,o)){let{destStat:d}=await H_e.checkPaths(c,l,"copy",o);await Y9r(d,c,l,o)}}),e||await yy.chmod(n,t.mode)}a(yno,"onDir");async function Eno(t,e,r,n){let o=await yy.readlink(e);if(n.dereference&&(o=j_e.resolve(process.cwd(),o)),!t)return yy.symlink(o,r);let s=null;try{s=await yy.readlink(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return yy.symlink(o,r);throw c}if(n.dereference&&(s=j_e.resolve(process.cwd(),s)),o!==s){if(H_e.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(H_e.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return await yy.unlink(r),yy.symlink(o,r)}a(Eno,"onLink");K9r.exports=hno});var rUr=I((WJc,tUr)=>{"use strict";p();var JE=sie(),G_e=require("path"),_no=tP().mkdirsSync,vno=pwt().utimesMillisSync,$_e=DV();function Cno(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:o}=nCe.checkPathsSync(t,e,"copy",r);if(nCe.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=rCe.dirname(e);return e_.existsSync(s)||xno(s),yUr(o,t,e,r)}a(Rno,"copySync");function yUr(t,e,r,n){let s=(n.dereference?e_.statSync:e_.lstatSync)(e);if(s.isDirectory())return Bno(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return kno(s,t,e,r,n);if(s.isSymbolicLink())return Uno(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(yUr,"getStats");function kno(t,e,r,n,o){return e?Pno(t,r,n,o):EUr(t,r,n,o)}a(kno,"onFile");function Pno(t,e,r,n){if(n.overwrite)return e_.unlinkSync(r),EUr(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}a(Pno,"mayCopyFile");function EUr(t,e,r,n){return e_.copyFileSync(e,r),n.preserveTimestamps&&Dno(t.mode,e,r),Iwt(r,t.mode)}a(EUr,"copyFile");function Dno(t,e,r){return Nno(t)&&Mno(r,t),Ono(e,r)}a(Dno,"handleTimestamps");function Nno(t){return(t&128)===0}a(Nno,"fileIsNotWritable");function Mno(t,e){return Iwt(t,e|128)}a(Mno,"makeFileWritable");function Iwt(t,e){return e_.chmodSync(t,e)}a(Iwt,"setDestMode");function Ono(t,e){let r=e_.statSync(t);return wno(e,r.atime,r.mtime)}a(Ono,"setDestTimestamps");function Bno(t,e,r,n,o){return e?_Ur(r,n,o):Lno(t.mode,r,n,o)}a(Bno,"onDir");function Lno(t,e,r,n){return e_.mkdirSync(r),_Ur(e,r,n),Iwt(r,t)}a(Lno,"mkDirAndCopy");function _Ur(t,e,r){let n=e_.opendirSync(t);try{let o;for(;(o=n.readSync())!==null;)Fno(o.name,t,e,r)}finally{n.closeSync()}}a(_Ur,"copyDir");function Fno(t,e,r,n){let o=rCe.join(e,t),s=rCe.join(r,t);if(n.filter&&!n.filter(o,s))return;let{destStat:c}=nCe.checkPathsSync(o,s,"copy",n);return yUr(c,o,s,n)}a(Fno,"copyDirItem");function Uno(t,e,r,n){let o=e_.readlinkSync(e);if(n.dereference&&(o=rCe.resolve(process.cwd(),o)),t){let s;try{s=e_.readlinkSync(r)}catch(c){if(c.code==="EINVAL"||c.code==="UNKNOWN")return e_.symlinkSync(o,r);throw c}if(n.dereference&&(s=rCe.resolve(process.cwd(),s)),o!==s){if(nCe.isSrcSubdir(o,s))throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${s}'.`);if(nCe.isSrcSubdir(s,o))throw new Error(`Cannot overwrite '${s}' with '${o}'.`)}return Qno(o,r)}else return e_.symlinkSync(o,r)}a(Uno,"onLink");function Qno(t,e){return e_.unlinkSync(e),e_.symlinkSync(t,e)}a(Qno,"copyLink");CUr.exports=Rno});var u8e=I((JXc,bUr)=>{"use strict";p();var qno=Rm().fromPromise;bUr.exports={copy:qno(AUr()),copySync:vUr()}});var iCe=I((XXc,TUr)=>{"use strict";p();var SUr=hie(),jno=Rm().fromCallback;function Hno(t,e){SUr.rm(t,{recursive:!0,force:!0},e)}a(Hno,"remove");function Gno(t){SUr.rmSync(t,{recursive:!0,force:!0})}a(Gno,"removeSync");TUr.exports={remove:jno(Hno),removeSync:Gno}});var NUr=I((rel,DUr)=>{"use strict";p();var $no=Rm().fromPromise,wUr=XE(),RUr=require("path"),kUr=ok(),PUr=iCe(),IUr=$no(a(async function(e){let r;try{r=await wUr.readdir(e)}catch{return kUr.mkdirs(e)}return Promise.all(r.map(n=>PUr.remove(RUr.join(e,n))))},"emptyDir"));function xUr(t){let e;try{e=wUr.readdirSync(t)}catch{return kUr.mkdirsSync(t)}e.forEach(r=>{r=RUr.join(t,r),PUr.removeSync(r)})}a(xUr,"emptyDirSync");DUr.exports={emptyDirSync:xUr,emptydirSync:xUr,emptyDir:IUr,emptydir:IUr}});var LUr=I((oel,BUr)=>{"use strict";p();var Vno=Rm().fromPromise,MUr=require("path"),bB=XE(),OUr=ok();async function Wno(t){let e;try{e=await bB.stat(t)}catch{}if(e&&e.isFile())return;let r=MUr.dirname(t),n=null;try{n=await bB.stat(r)}catch(o){if(o.code==="ENOENT"){await OUr.mkdirs(r),await bB.writeFile(t,"");return}else throw o}n.isDirectory()?await bB.writeFile(t,""):await bB.readdir(r)}a(Wno,"createFile");function zno(t){let e;try{e=bB.statSync(t)}catch{}if(e&&e.isFile())return;let r=MUr.dirname(t);try{bB.statSync(r).isDirectory()||bB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")OUr.mkdirsSync(r);else throw n}bB.writeFileSync(t,"")}a(zno,"createFileSync");BUr.exports={createFile:Vno(Wno),createFileSync:zno}});var jUr=I((cel,qUr)=>{"use strict";p();var Yno=Rm().fromPromise,FUr=require("path"),S9=XE(),UUr=ok(),{pathExists:Kno}=b9(),{areIdentical:QUr}=jV();async function Jno(t,e){let r;try{r=await S9.lstat(e)}catch{}let n;try{n=await S9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&QUr(n,r))return;let o=FUr.dirname(e);await Kno(o)||await UUr.mkdirs(o),await S9.link(t,e)}a(Jno,"createLink");function Zno(t,e){let r;try{r=S9.lstatSync(e)}catch{}try{let s=S9.lstatSync(t);if(r&&QUr(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=FUr.dirname(e);return S9.existsSync(n)||UUr.mkdirsSync(n),S9.linkSync(t,e)}a(Zno,"createLinkSync");qUr.exports={createLink:Yno(Jno),createLinkSync:Zno}});var GUr=I((del,HUr)=>{"use strict";p();var T9=require("path"),oCe=XE(),{pathExists:Xno}=b9(),eio=Rm().fromPromise;async function tio(t,e){if(T9.isAbsolute(t)){try{await oCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=T9.dirname(e),n=T9.join(r,t);if(await Xno(n))return{toCwd:n,toDst:t};try{await oCe.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:T9.relative(r,t)}}a(tio,"symlinkPaths");function rio(t,e){if(T9.isAbsolute(t)){if(!oCe.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=T9.dirname(e),n=T9.join(r,t);if(oCe.existsSync(n))return{toCwd:n,toDst:t};if(!oCe.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:T9.relative(r,t)}}a(rio,"symlinkPathsSync");HUr.exports={symlinkPaths:eio(tio),symlinkPathsSync:rio}});var WUr=I((hel,VUr)=>{"use strict";p();var $Ur=XE(),nio=Rm().fromPromise;async function iio(t,e){if(e)return e;let r;try{r=await $Ur.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(iio,"symlinkType");function oio(t,e){if(e)return e;let r;try{r=$Ur.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(oio,"symlinkTypeSync");VUr.exports={symlinkType:nio(iio),symlinkTypeSync:oio}});var KUr=I((Ael,YUr)=>{"use strict";p();var sio=Rm().fromPromise,I9=require("path"),HC=XE(),{mkdirs:aio,mkdirsSync:cio}=ok(),{symlinkPaths:lio,symlinkPathsSync:uio}=GUr(),{symlinkType:dio,symlinkTypeSync:fio}=WUr(),{pathExists:pio}=b9(),{areIdentical:zUr}=jV();async function hio(t,e,r){let n;try{n=await HC.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(I9.isAbsolute(t))l=await HC.stat(t);else{let d=I9.dirname(e),f=I9.join(d,t);try{l=await HC.stat(f)}catch{l=await HC.stat(t)}}let u=await HC.stat(e);if(zUr(l,u))return}let o=await lio(t,e);t=o.toDst;let s=await dio(o.toCwd,r),c=I9.dirname(e);return await pio(c)||await aio(c),HC.symlink(t,e,s)}a(hio,"createSymlink");function mio(t,e,r){let n;try{n=HC.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(I9.isAbsolute(t))l=HC.statSync(t);else{let d=I9.dirname(e),f=I9.join(d,t);try{l=HC.statSync(f)}catch{l=HC.statSync(t)}}let u=HC.statSync(e);if(zUr(l,u))return}let o=uio(t,e);t=o.toDst,r=fio(o.toCwd,r);let s=I9.dirname(e);return HC.existsSync(s)||cio(s),HC.symlinkSync(t,e,r)}a(mio,"createSymlinkSync");YUr.exports={createSymlink:sio(hio),createSymlinkSync:mio}});var i7r=I((_el,n7r)=>{"use strict";p();var{createFile:JUr,createFileSync:ZUr}=LUr(),{createLink:XUr,createLinkSync:e7r}=jUr(),{createSymlink:t7r,createSymlinkSync:r7r}=KUr();n7r.exports={createFile:JUr,createFileSync:ZUr,ensureFile:JUr,ensureFileSync:ZUr,createLink:XUr,createLinkSync:e7r,ensureLink:XUr,ensureLinkSync:e7r,createSymlink:t7r,createSymlinkSync:r7r,ensureSymlink:t7r,ensureSymlinkSync:r7r}});var d8e=I((vel,o7r)=>{p();function gio(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(gio,"stringify");function Aio(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(Aio,"stripBom");o7r.exports={stringify:gio,stripBom:Aio}});var l7r=I((Tel,c7r)=>{p();var Aie;try{Aie=hie()}catch{Aie=require("fs")}var f8e=Rm(),{stringify:s7r,stripBom:a7r}=d8e();async function yio(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Aie,n="throws"in e?e.throws:!0,o=await f8e.fromCallback(r.readFile)(t,e);o=a7r(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(yio,"_readFile");var Eio=f8e.fromPromise(yio);function _io(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Aie,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=a7r(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(_io,"readFileSync");async function Cio(t,e,r={}){let n=r.fs||Aie,o=s7r(e,r);await f8e.fromCallback(n.writeFile)(t,o,r)}a(Cio,"_writeFile");var vio=f8e.fromPromise(Cio);function bio(t,e,r={}){let n=r.fs||Aie,o=s7r(e,r);return n.writeFileSync(t,o,r)}a(bio,"writeFileSync");c7r.exports={readFile:Eio,readFileSync:_io,writeFile:vio,writeFileSync:bio}});var d7r=I((wel,u7r)=>{"use strict";p();var p8e=l7r();u7r.exports={readJson:p8e.readFile,readJsonSync:p8e.readFileSync,writeJson:p8e.writeFile,writeJsonSync:p8e.writeFileSync}});var h8e=I((kel,h7r)=>{"use strict";p();var Sio=Rm().fromPromise,xwt=XE(),f7r=require("path"),p7r=ok(),Tio=b9().pathExists;async function Iio(t,e,r="utf-8"){let n=f7r.dirname(t);return await Tio(n)||await p7r.mkdirs(n),xwt.writeFile(t,e,r)}a(Iio,"outputFile");function xio(t,...e){let r=f7r.dirname(t);xwt.existsSync(r)||p7r.mkdirsSync(r),xwt.writeFileSync(t,...e)}a(xio,"outputFileSync");h7r.exports={outputFile:Sio(Iio),outputFileSync:xio}});var g7r=I((Nel,m7r)=>{"use strict";p();var{stringify:wio}=d8e(),{outputFile:Rio}=h8e();async function kio(t,e,r={}){let n=wio(e,r);await Rio(t,n,r)}a(kio,"outputJson");m7r.exports=kio});var y7r=I((Bel,A7r)=>{"use strict";p();var{stringify:Pio}=d8e(),{outputFileSync:Dio}=h8e();function Nio(t,e,r){let n=Pio(e,r);Dio(t,n,r)}a(Nio,"outputJsonSync");A7r.exports=Nio});var _7r=I((Uel,E7r)=>{"use strict";p();var Mio=Rm().fromPromise,t_=d7r();t_.outputJson=Mio(g7r());t_.outputJsonSync=y7r();t_.outputJSON=t_.outputJson;t_.outputJSONSync=t_.outputJsonSync;t_.writeJSON=t_.writeJson;t_.writeJSONSync=t_.writeJsonSync;t_.readJSON=t_.readJson;t_.readJSONSync=t_.readJsonSync;E7r.exports=t_});var T7r=I((qel,S7r)=>{"use strict";p();var Oio=XE(),C7r=require("path"),{copy:Bio}=u8e(),{remove:b7r}=iCe(),{mkdirp:Lio}=ok(),{pathExists:Fio}=b9(),v7r=jV();async function Uio(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await v7r.checkPaths(t,e,"move",r);await v7r.checkParentPaths(t,o,e,"move");let c=C7r.dirname(e);return C7r.parse(c).root!==c&&await Lio(c),Qio(t,e,n,s)}a(Uio,"move");async function Qio(t,e,r,n){if(!n){if(r)await b7r(e);else if(await Fio(e))throw new Error("dest already exists.")}try{await Oio.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await qio(t,e,r)}}a(Qio,"doRename");async function qio(t,e,r){return await Bio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),b7r(t)}a(qio,"moveAcrossDevice");S7r.exports=Uio});var k7r=I((Gel,R7r)=>{"use strict";p();var x7r=hie(),Rwt=require("path"),jio=u8e().copySync,w7r=iCe().removeSync,Hio=ok().mkdirpSync,I7r=jV();function Gio(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=I7r.checkPathsSync(t,e,"move",r);return I7r.checkParentPathsSync(t,o,e,"move"),$io(e)||Hio(Rwt.dirname(e)),Vio(t,e,n,s)}a(Gio,"moveSync");function $io(t){let e=Rwt.dirname(t);return Rwt.parse(e).root===e}a($io,"isParentRoot");function Vio(t,e,r,n){if(n)return wwt(t,e,r);if(r)return w7r(e),wwt(t,e,r);if(x7r.existsSync(e))throw new Error("dest already exists.");return wwt(t,e,r)}a(Vio,"doRename");function wwt(t,e,r){try{x7r.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Wio(t,e,r)}}a(wwt,"rename");function Wio(t,e,r){return jio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),w7r(t)}a(Wio,"moveAcrossDevice");R7r.exports=Gio});var D7r=I((Wel,P7r)=>{"use strict";p();var zio=Rm().fromPromise;P7r.exports={move:zio(T7r()),moveSync:k7r()}});var M7r=I((Yel,N7r)=>{"use strict";p();N7r.exports={...XE(),...u8e(),...NUr(),...i7r(),..._7r(),...ok(),...D7r(),...h8e(),...b9(),...iCe()}});var g8e=I((Jel,L7r)=>{p();var kwt=require("fs"),m8e=require("path"),sCe=m8e.join,Yio=m8e.dirname,O7r=kwt.accessSync&&function(t){try{kwt.accessSync(t)}catch{return!1}return!0}||kwt.existsSync||m8e.existsSync,B7r={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function Kio(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(B7r).map(function(u){u in t||(t[u]=B7r[u])}),t.module_root||(t.module_root=Jio(__filename)),m8e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var Mno=km().fromPromise;nUr.exports={copy:Mno(J9r()),copySync:rUr()}});var V_e=I((ZJc,oUr)=>{"use strict";p();var iUr=sie(),Ono=km().fromCallback;function Bno(t,e){iUr.rm(t,{recursive:!0,force:!0},e)}a(Bno,"remove");function Lno(t){iUr.rmSync(t,{recursive:!0,force:!0})}a(Lno,"removeSync");oUr.exports={remove:Ono(Bno),removeSync:Lno}});var pUr=I((tZc,fUr)=>{"use strict";p();var Fno=km().fromPromise,cUr=KE(),lUr=require("path"),uUr=tP(),dUr=V_e(),sUr=Fno(a(async function(e){let r;try{r=await cUr.readdir(e)}catch{return uUr.mkdirs(e)}return Promise.all(r.map(n=>dUr.remove(lUr.join(e,n))))},"emptyDir"));function aUr(t){let e;try{e=cUr.readdirSync(t)}catch{return uUr.mkdirsSync(t)}e.forEach(r=>{r=lUr.join(t,r),dUr.removeSync(r)})}a(aUr,"emptyDirSync");fUr.exports={emptyDirSync:aUr,emptydirSync:aUr,emptyDir:sUr,emptydir:sUr}});var AUr=I((iZc,gUr)=>{"use strict";p();var Uno=km().fromPromise,hUr=require("path"),gB=KE(),mUr=tP();async function Qno(t){let e;try{e=await gB.stat(t)}catch{}if(e&&e.isFile())return;let r=hUr.dirname(t),n=null;try{n=await gB.stat(r)}catch(o){if(o.code==="ENOENT"){await mUr.mkdirs(r),await gB.writeFile(t,"");return}else throw o}n.isDirectory()?await gB.writeFile(t,""):await gB.readdir(r)}a(Qno,"createFile");function qno(t){let e;try{e=gB.statSync(t)}catch{}if(e&&e.isFile())return;let r=hUr.dirname(t);try{gB.statSync(r).isDirectory()||gB.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")mUr.mkdirsSync(r);else throw n}gB.writeFileSync(t,"")}a(qno,"createFileSync");gUr.exports={createFile:Uno(Qno),createFileSync:qno}});var CUr=I((aZc,vUr)=>{"use strict";p();var jno=km().fromPromise,yUr=require("path"),g9=KE(),EUr=tP(),{pathExists:Hno}=m9(),{areIdentical:_Ur}=DV();async function Gno(t,e){let r;try{r=await g9.lstat(e)}catch{}let n;try{n=await g9.lstat(t)}catch(c){throw c.message=c.message.replace("lstat","ensureLink"),c}if(r&&_Ur(n,r))return;let o=yUr.dirname(e);await Hno(o)||await EUr.mkdirs(o),await g9.link(t,e)}a(Gno,"createLink");function $no(t,e){let r;try{r=g9.lstatSync(e)}catch{}try{let s=g9.lstatSync(t);if(r&&_Ur(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=yUr.dirname(e);return g9.existsSync(n)||EUr.mkdirsSync(n),g9.linkSync(t,e)}a($no,"createLinkSync");vUr.exports={createLink:jno(Gno),createLinkSync:$no}});var SUr=I((uZc,bUr)=>{"use strict";p();var A9=require("path"),W_e=KE(),{pathExists:Vno}=m9(),Wno=km().fromPromise;async function zno(t,e){if(A9.isAbsolute(t)){try{await W_e.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:t}}let r=A9.dirname(e),n=A9.join(r,t);if(await Vno(n))return{toCwd:n,toDst:t};try{await W_e.lstat(t)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:t,toDst:A9.relative(r,t)}}a(zno,"symlinkPaths");function Yno(t,e){if(A9.isAbsolute(t)){if(!W_e.existsSync(t))throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}let r=A9.dirname(e),n=A9.join(r,t);if(W_e.existsSync(n))return{toCwd:n,toDst:t};if(!W_e.existsSync(t))throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:A9.relative(r,t)}}a(Yno,"symlinkPathsSync");bUr.exports={symlinkPaths:Wno(zno),symlinkPathsSync:Yno}});var xUr=I((pZc,IUr)=>{"use strict";p();var TUr=KE(),Kno=km().fromPromise;async function Jno(t,e){if(e)return e;let r;try{r=await TUr.lstat(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Jno,"symlinkType");function Zno(t,e){if(e)return e;let r;try{r=TUr.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}a(Zno,"symlinkTypeSync");IUr.exports={symlinkType:Kno(Jno),symlinkTypeSync:Zno}});var PUr=I((gZc,RUr)=>{"use strict";p();var Xno=km().fromPromise,y9=require("path"),Qv=KE(),{mkdirs:eio,mkdirsSync:tio}=tP(),{symlinkPaths:rio,symlinkPathsSync:nio}=SUr(),{symlinkType:iio,symlinkTypeSync:oio}=xUr(),{pathExists:sio}=m9(),{areIdentical:wUr}=DV();async function aio(t,e,r){let n;try{n=await Qv.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(y9.isAbsolute(t))l=await Qv.stat(t);else{let d=y9.dirname(e),f=y9.join(d,t);try{l=await Qv.stat(f)}catch{l=await Qv.stat(t)}}let u=await Qv.stat(e);if(wUr(l,u))return}let o=await rio(t,e);t=o.toDst;let s=await iio(o.toCwd,r),c=y9.dirname(e);return await sio(c)||await eio(c),Qv.symlink(t,e,s)}a(aio,"createSymlink");function cio(t,e,r){let n;try{n=Qv.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let l;if(y9.isAbsolute(t))l=Qv.statSync(t);else{let d=y9.dirname(e),f=y9.join(d,t);try{l=Qv.statSync(f)}catch{l=Qv.statSync(t)}}let u=Qv.statSync(e);if(wUr(l,u))return}let o=nio(t,e);t=o.toDst,r=oio(o.toCwd,r);let s=y9.dirname(e);return Qv.existsSync(s)||tio(s),Qv.symlinkSync(t,e,r)}a(cio,"createSymlinkSync");RUr.exports={createSymlink:Xno(aio),createSymlinkSync:cio}});var FUr=I((EZc,LUr)=>{"use strict";p();var{createFile:kUr,createFileSync:DUr}=AUr(),{createLink:NUr,createLinkSync:MUr}=CUr(),{createSymlink:OUr,createSymlinkSync:BUr}=PUr();LUr.exports={createFile:kUr,createFileSync:DUr,ensureFile:kUr,ensureFileSync:DUr,createLink:NUr,createLinkSync:MUr,ensureLink:NUr,ensureLinkSync:MUr,createSymlink:OUr,createSymlinkSync:BUr,ensureSymlink:OUr,ensureSymlinkSync:BUr}});var JFe=I((vZc,UUr)=>{p();function lio(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:o}={}){let s=r?e:"",c=JSON.stringify(t,n,o);if(c===void 0)throw new TypeError(`Converting ${typeof t} value to JSON is not supported`);return c.replace(/\n/g,e)+s}a(lio,"stringify");function uio(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}a(uio,"stripBom");UUr.exports={stringify:lio,stripBom:uio}});var HUr=I((SZc,jUr)=>{p();var lie;try{lie=sie()}catch{lie=require("fs")}var ZFe=km(),{stringify:QUr,stripBom:qUr}=JFe();async function dio(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||lie,n="throws"in e?e.throws:!0,o=await ZFe.fromCallback(r.readFile)(t,e);o=qUr(o);let s;try{s=JSON.parse(o,e?e.reviver:null)}catch(c){if(n)throw c.message=`${t}: ${c.message}`,c;return null}return s}a(dio,"_readFile");var fio=ZFe.fromPromise(dio);function pio(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||lie,n="throws"in e?e.throws:!0;try{let o=r.readFileSync(t,e);return o=qUr(o),JSON.parse(o,e.reviver)}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}}a(pio,"readFileSync");async function hio(t,e,r={}){let n=r.fs||lie,o=QUr(e,r);await ZFe.fromCallback(n.writeFile)(t,o,r)}a(hio,"_writeFile");var mio=ZFe.fromPromise(hio);function gio(t,e,r={}){let n=r.fs||lie,o=QUr(e,r);return n.writeFileSync(t,o,r)}a(gio,"writeFileSync");jUr.exports={readFile:fio,readFileSync:pio,writeFile:mio,writeFileSync:gio}});var $Ur=I((xZc,GUr)=>{"use strict";p();var XFe=HUr();GUr.exports={readJson:XFe.readFile,readJsonSync:XFe.readFileSync,writeJson:XFe.writeFile,writeJsonSync:XFe.writeFileSync}});var e8e=I((RZc,zUr)=>{"use strict";p();var Aio=km().fromPromise,gwt=KE(),VUr=require("path"),WUr=tP(),yio=m9().pathExists;async function Eio(t,e,r="utf-8"){let n=VUr.dirname(t);return await yio(n)||await WUr.mkdirs(n),gwt.writeFile(t,e,r)}a(Eio,"outputFile");function _io(t,...e){let r=VUr.dirname(t);gwt.existsSync(r)||WUr.mkdirsSync(r),gwt.writeFileSync(t,...e)}a(_io,"outputFileSync");zUr.exports={outputFile:Aio(Eio),outputFileSync:_io}});var KUr=I((DZc,YUr)=>{"use strict";p();var{stringify:vio}=JFe(),{outputFile:Cio}=e8e();async function bio(t,e,r={}){let n=vio(e,r);await Cio(t,n,r)}a(bio,"outputJson");YUr.exports=bio});var ZUr=I((OZc,JUr)=>{"use strict";p();var{stringify:Sio}=JFe(),{outputFileSync:Tio}=e8e();function Iio(t,e,r){let n=Sio(e,r);Tio(t,n,r)}a(Iio,"outputJsonSync");JUr.exports=Iio});var e7r=I((FZc,XUr)=>{"use strict";p();var xio=km().fromPromise,ZE=$Ur();ZE.outputJson=xio(KUr());ZE.outputJsonSync=ZUr();ZE.outputJSON=ZE.outputJson;ZE.outputJSONSync=ZE.outputJsonSync;ZE.writeJSON=ZE.writeJson;ZE.writeJSONSync=ZE.writeJsonSync;ZE.readJSON=ZE.readJson;ZE.readJSONSync=ZE.readJsonSync;XUr.exports=ZE});var o7r=I((QZc,i7r)=>{"use strict";p();var wio=KE(),t7r=require("path"),{copy:Rio}=KFe(),{remove:n7r}=V_e(),{mkdirp:Pio}=tP(),{pathExists:kio}=m9(),r7r=DV();async function Dio(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=await r7r.checkPaths(t,e,"move",r);await r7r.checkParentPaths(t,o,e,"move");let c=t7r.dirname(e);return t7r.parse(c).root!==c&&await Pio(c),Nio(t,e,n,s)}a(Dio,"move");async function Nio(t,e,r,n){if(!n){if(r)await n7r(e);else if(await kio(e))throw new Error("dest already exists.")}try{await wio.rename(t,e)}catch(o){if(o.code!=="EXDEV")throw o;await Mio(t,e,r)}}a(Nio,"doRename");async function Mio(t,e,r){return await Rio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),n7r(t)}a(Mio,"moveAcrossDevice");i7r.exports=Dio});var u7r=I((HZc,l7r)=>{"use strict";p();var a7r=sie(),ywt=require("path"),Oio=KFe().copySync,c7r=V_e().removeSync,Bio=tP().mkdirpSync,s7r=DV();function Lio(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:o,isChangingCase:s=!1}=s7r.checkPathsSync(t,e,"move",r);return s7r.checkParentPathsSync(t,o,e,"move"),Fio(e)||Bio(ywt.dirname(e)),Uio(t,e,n,s)}a(Lio,"moveSync");function Fio(t){let e=ywt.dirname(t);return ywt.parse(e).root===e}a(Fio,"isParentRoot");function Uio(t,e,r,n){if(n)return Awt(t,e,r);if(r)return c7r(e),Awt(t,e,r);if(a7r.existsSync(e))throw new Error("dest already exists.");return Awt(t,e,r)}a(Uio,"doRename");function Awt(t,e,r){try{a7r.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return Qio(t,e,r)}}a(Awt,"rename");function Qio(t,e,r){return Oio(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),c7r(t)}a(Qio,"moveAcrossDevice");l7r.exports=Lio});var f7r=I((VZc,d7r)=>{"use strict";p();var qio=km().fromPromise;d7r.exports={move:qio(o7r()),moveSync:u7r()}});var h7r=I((zZc,p7r)=>{"use strict";p();p7r.exports={...KE(),...KFe(),...pUr(),...FUr(),...e7r(),...tP(),...f7r(),...e8e(),...m9(),...V_e()}});var r8e=I((KZc,A7r)=>{p();var Ewt=require("fs"),t8e=require("path"),z_e=t8e.join,jio=t8e.dirname,m7r=Ewt.accessSync&&function(t){try{Ewt.accessSync(t)}catch{return!1}return!0}||Ewt.existsSync||t8e.existsSync,g7r={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","compiled","platform","arch","bindings"]]};function Hio(t){typeof t=="string"?t={bindings:t}:t||(t={}),Object.keys(g7r).map(function(u){u in t||(t[u]=g7r[u])}),t.module_root||(t.module_root=Gio(__filename)),t8e.extname(t.bindings)!=".node"&&(t.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:require,r=[],n=0,o=t.try.length,s,c,l;n{"use strict";p();var Zio=_I&&_I.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xio=_I&&_I.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F7r=_I&&_I.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Zio(e,t,r);return Xio(e,t),e};Object.defineProperty(_I,"__esModule",{value:!0});_I.setDeviceId=_I.getDeviceId=void 0;var A8e=F7r(require("path")),y8e=F7r(M7r()),U7r=process.platform==="win32"?g8e()("windows"):null,eoo="deviceid";function Q7r(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=A8e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??A8e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return A8e.join(t,"Microsoft","DeveloperTools")}a(Q7r,"getDirectory");function Pwt(){return A8e.join(Q7r(),eoo)}a(Pwt,"getDeviceIdFilePath");async function too(){return process.platform==="win32"?U7r?.GetDeviceId():await roo(Pwt())?y8e.readFile(Pwt(),"utf8"):void 0}a(too,"getDeviceId");_I.getDeviceId=too;async function roo(t){try{return await y8e.promises.access(t),!0}catch{return!1}}a(roo,"exists");async function noo(t){process.platform==="win32"?U7r?.SetDeviceId(t):(await y8e.ensureDir(Q7r()),await y8e.writeFile(Pwt(),t,"utf8"))}a(noo,"setDeviceId");_I.setDeviceId=noo});var H7r=I(vN=>{"use strict";p();var ioo=vN&&vN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ooo=vN&&vN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),soo=vN&&vN.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&ioo(e,t,r);return ooo(e,t),e};Object.defineProperty(vN,"__esModule",{value:!0});vN.getDeviceId=void 0;var aoo=(Ns(),Ca(yc)),j7r=soo(q7r());async function coo(){let t;try{t=await j7r.getDeviceId()}catch{}if(t)return t;{let e=(0,aoo.v4)().toLowerCase();return await j7r.setDeviceId(e),e}}a(coo,"getDeviceId");vN.getDeviceId=coo});var G7r=I(HV=>{"use strict";p();var loo=HV&&HV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uoo=HV&&HV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&loo(e,t,r)};Object.defineProperty(HV,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");uoo(H7r(),HV)});var na=I((E8e,$7r)=>{p();(function(t,e){typeof E8e=="object"?$7r.exports=E8e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(E8e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var k=0;k>>2]=b[k>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,k=w/x;_?k=e.ceil(k):k=e.max((k|0)-this._minBufferSize,0);var D=k*R,N=e.min(D*4,w);if(D){for(var L=0;L{p();(function(t,e){typeof _8e=="object"?V7r.exports=_8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(_8e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof C8e=="object"?W7r.exports=C8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(C8e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var K7r=I((v8e,Y7r)=>{p();(function(t,e){typeof v8e=="object"?Y7r.exports=v8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(v8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var x9=I((b8e,J7r)=>{p();(function(t,e){typeof b8e=="object"?J7r.exports=b8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(b8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var X7r=I((S8e,Z7r)=>{p();(function(t,e){typeof S8e=="object"?Z7r.exports=S8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(S8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var w9=I((T8e,eQr)=>{p();(function(t,e){typeof T8e=="object"?eQr.exports=T8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(T8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],k=g[A+5],D=g[A+6],N=g[A+7],L=g[A+8],B=g[A+9],Q=g[A+10],M=g[A+11],O=g[A+12],q=g[A+13],F=g[A+14],U=g[A+15],W=v[0],V=v[1],G=v[2],Y=v[3];W=d(W,V,G,Y,b,7,l[0]),Y=d(Y,W,V,G,T,12,l[1]),G=d(G,Y,W,V,w,17,l[2]),V=d(V,G,Y,W,R,22,l[3]),W=d(W,V,G,Y,x,7,l[4]),Y=d(Y,W,V,G,k,12,l[5]),G=d(G,Y,W,V,D,17,l[6]),V=d(V,G,Y,W,N,22,l[7]),W=d(W,V,G,Y,L,7,l[8]),Y=d(Y,W,V,G,B,12,l[9]),G=d(G,Y,W,V,Q,17,l[10]),V=d(V,G,Y,W,M,22,l[11]),W=d(W,V,G,Y,O,7,l[12]),Y=d(Y,W,V,G,q,12,l[13]),G=d(G,Y,W,V,F,17,l[14]),V=d(V,G,Y,W,U,22,l[15]),W=f(W,V,G,Y,T,5,l[16]),Y=f(Y,W,V,G,D,9,l[17]),G=f(G,Y,W,V,M,14,l[18]),V=f(V,G,Y,W,b,20,l[19]),W=f(W,V,G,Y,k,5,l[20]),Y=f(Y,W,V,G,Q,9,l[21]),G=f(G,Y,W,V,U,14,l[22]),V=f(V,G,Y,W,x,20,l[23]),W=f(W,V,G,Y,B,5,l[24]),Y=f(Y,W,V,G,F,9,l[25]),G=f(G,Y,W,V,R,14,l[26]),V=f(V,G,Y,W,L,20,l[27]),W=f(W,V,G,Y,q,5,l[28]),Y=f(Y,W,V,G,w,9,l[29]),G=f(G,Y,W,V,N,14,l[30]),V=f(V,G,Y,W,O,20,l[31]),W=h(W,V,G,Y,k,4,l[32]),Y=h(Y,W,V,G,L,11,l[33]),G=h(G,Y,W,V,M,16,l[34]),V=h(V,G,Y,W,F,23,l[35]),W=h(W,V,G,Y,T,4,l[36]),Y=h(Y,W,V,G,x,11,l[37]),G=h(G,Y,W,V,N,16,l[38]),V=h(V,G,Y,W,Q,23,l[39]),W=h(W,V,G,Y,q,4,l[40]),Y=h(Y,W,V,G,b,11,l[41]),G=h(G,Y,W,V,R,16,l[42]),V=h(V,G,Y,W,D,23,l[43]),W=h(W,V,G,Y,B,4,l[44]),Y=h(Y,W,V,G,O,11,l[45]),G=h(G,Y,W,V,U,16,l[46]),V=h(V,G,Y,W,w,23,l[47]),W=m(W,V,G,Y,b,6,l[48]),Y=m(Y,W,V,G,N,10,l[49]),G=m(G,Y,W,V,F,15,l[50]),V=m(V,G,Y,W,k,21,l[51]),W=m(W,V,G,Y,O,6,l[52]),Y=m(Y,W,V,G,R,10,l[53]),G=m(G,Y,W,V,Q,15,l[54]),V=m(V,G,Y,W,T,21,l[55]),W=m(W,V,G,Y,L,6,l[56]),Y=m(Y,W,V,G,U,10,l[57]),G=m(G,Y,W,V,D,15,l[58]),V=m(V,G,Y,W,q,21,l[59]),W=m(W,V,G,Y,x,6,l[60]),Y=m(Y,W,V,G,M,10,l[61]),G=m(G,Y,W,V,w,15,l[62]),V=m(V,G,Y,W,B,21,l[63]),v[0]=v[0]+W|0,v[1]=v[1]+V|0,v[2]=v[2]+G|0,v[3]=v[3]+Y|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,E,_,v,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var Nwt=I((I8e,tQr)=>{p();(function(t,e){typeof I8e=="object"?tQr.exports=I8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(I8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var w8e=I((x8e,rQr)=>{p();(function(t,e){typeof x8e=="object"?rQr.exports=x8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(x8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var E=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],E=g[2],_=g[3],v=g[4],b=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],k=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=k+d[R-7]+N+d[R-16]}var L=v&b^~v&T,B=A&y^A&E^y&E,Q=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),O=w+M+L+u[R]+d[R],q=Q+B;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+q|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var iQr=I((R8e,nQr)=>{p();(function(t,e,r){typeof R8e=="object"?nQr.exports=R8e=e(na(),w8e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(R8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var Mwt=I((k8e,oQr)=>{p();(function(t,e,r){typeof k8e=="object"?oQr.exports=k8e=e(na(),aCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(k8e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,k=y.low,D=E.high,N=E.low,L=_.high,B=_.low,Q=v.high,M=v.low,O=b.high,q=b.low,F=T.high,U=T.low,W=w.high,V=w.low,G=R.high,Y=R.low,re=x,j=k,X=D,ie=N,we=L,Ae=B,De=Q,Te=M,Z=O,J=q,z=F,le=U,K=W,ae=V,Me=G,ne=Y,se=0;se<80;se++){var Ie,_e,Re=f[se];if(se<16)_e=Re.high=m[g+se*2]|0,Ie=Re.low=m[g+se*2+1]|0;else{var Je=f[se-15],Xe=Je.high,Ct=Je.low,Ot=(Xe>>>1|Ct<<31)^(Xe>>>8|Ct<<24)^Xe>>>7,$t=(Ct>>>1|Xe<<31)^(Ct>>>8|Xe<<24)^(Ct>>>7|Xe<<25),Gt=f[se-2],Ee=Gt.high,Qe=Gt.low,nt=(Ee>>>19|Qe<<13)^(Ee<<3|Qe>>>29)^Ee>>>6,mt=(Qe>>>19|Ee<<13)^(Qe<<3|Ee>>>29)^(Qe>>>6|Ee<<26),xe=f[se-7],He=xe.high,Ze=xe.low,at=f[se-16],ct=at.high,ut=at.low;Ie=$t+Ze,_e=Ot+He+(Ie>>>0<$t>>>0?1:0),Ie=Ie+mt,_e=_e+nt+(Ie>>>0>>0?1:0),Ie=Ie+ut,_e=_e+ct+(Ie>>>0>>0?1:0),Re.high=_e,Re.low=Ie}var ee=Z&z^~Z&K,pe=J&le^~J&ae,ke=re&X^re&we^X&we,Le=j&ie^j&Ae^ie&Ae,Ve=(re>>>28|j<<4)^(re<<30|j>>>2)^(re<<25|j>>>7),tt=(j>>>28|re<<4)^(j<<30|re>>>2)^(j<<25|re>>>7),vt=(Z>>>14|J<<18)^(Z>>>18|J<<14)^(Z<<23|J>>>9),Nt=(J>>>14|Z<<18)^(J>>>18|Z<<14)^(J<<23|Z>>>9),Vt=d[se],It=Vt.high,Be=Vt.low,oe=ne+Nt,ve=Me+vt+(oe>>>0>>0?1:0),oe=oe+pe,ve=ve+ee+(oe>>>0>>0?1:0),oe=oe+Be,ve=ve+It+(oe>>>0>>0?1:0),oe=oe+Ie,ve=ve+_e+(oe>>>0>>0?1:0),Se=tt+Le,de=Ve+ke+(Se>>>0>>0?1:0);Me=K,ne=ae,K=z,ae=le,z=Z,le=J,J=Te+oe|0,Z=De+ve+(J>>>0>>0?1:0)|0,De=we,Te=Ae,we=X,Ae=ie,X=re,ie=j,j=oe+Se|0,re=ve+de+(j>>>0>>0?1:0)|0}k=y.low=k+j,y.high=x+re+(k>>>0>>0?1:0),N=E.low=N+ie,E.high=D+X+(N>>>0>>0?1:0),B=_.low=B+Ae,_.high=L+we+(B>>>0>>0?1:0),M=v.low=M+Te,v.high=Q+De+(M>>>0>>0?1:0),q=b.low=q+J,b.high=O+Z+(q>>>0>>0?1:0),U=T.low=U+le,T.high=F+z+(U>>>0>>0?1:0),V=w.low=V+ae,w.high=W+K+(V>>>0>>0?1:0),Y=R.low=Y+ne,R.high=G+Me+(Y>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var E=this._hash.toX32();return E},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var aQr=I((P8e,sQr)=>{p();(function(t,e,r){typeof P8e=="object"?sQr.exports=P8e=e(na(),aCe(),Mwt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(P8e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var lQr=I((D8e,cQr)=>{p();(function(t,e,r){typeof D8e=="object"?cQr.exports=D8e=e(na(),aCe()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(D8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var k=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var k=0,D=0,N=0;N<5;N++){var w=E[x+5*N];k^=w.high,D^=w.low}var L=m[x];L.high=k,L.low=D}for(var x=0;x<5;x++)for(var B=m[(x+4)%5],Q=m[(x+1)%5],M=Q.high,O=Q.low,k=B.high^(M<<1|O>>>31),D=B.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=k,w.low^=D}for(var q=1;q<25;q++){var k,D,w=E[q],F=w.high,U=w.low,W=d[q];W<32?(k=F<>>32-W,D=U<>>32-W):(k=U<>>64-W,D=F<>>64-W);var V=m[f[q]];V.high=k,V.low=D}var G=m[0],Y=E[0];G.high=Y.high,G.low=Y.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var q=x+5*N,w=E[q],re=m[q],j=m[(x+1)%5+5*N],X=m[(x+2)%5+5*N];w.high=re.high^~j.high&X.high,w.low=re.low^~j.low&X.low}var w=E[0],ie=h[R];w.high^=ie.high,w.low^=ie.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var dQr=I((N8e,uQr)=>{p();(function(t,e){typeof N8e=="object"?uQr.exports=N8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(N8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,k=T[x];T[x]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var D=this._hash.words,N=h.words,L=m.words,B=l.words,Q=u.words,M=d.words,O=f.words,q,F,U,W,V,G,Y,re,j,X;G=q=D[0],Y=F=D[1],re=U=D[2],j=W=D[3],X=V=D[4];for(var ie,R=0;R<80;R+=1)ie=q+T[w+B[R]]|0,R<16?ie+=A(F,U,W)+N[0]:R<32?ie+=y(F,U,W)+N[1]:R<48?ie+=E(F,U,W)+N[2]:R<64?ie+=_(F,U,W)+N[3]:ie+=v(F,U,W)+N[4],ie=ie|0,ie=b(ie,M[R]),ie=ie+V|0,q=V,V=W,W=b(U,10),U=F,F=ie,ie=G+T[w+Q[R]]|0,R<16?ie+=v(Y,re,j)+L[0]:R<32?ie+=_(Y,re,j)+L[1]:R<48?ie+=E(Y,re,j)+L[2]:R<64?ie+=y(Y,re,j)+L[3]:ie+=A(Y,re,j)+L[4],ie=ie|0,ie=b(ie,O[R]),ie=ie+X|0,G=X,X=j,j=b(re,10),re=Y,Y=ie;ie=D[1]+U+j|0,D[1]=D[2]+W+X|0,D[2]=D[3]+V+G|0,D[3]=D[4]+q+Y|0,D[4]=D[0]+F+re|0,D[0]=ie},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var k=this._hash,D=k.words,N=0;N<5;N++){var L=D[N];D[N]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return k},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var O8e=I((M8e,fQr)=>{p();(function(t,e){typeof M8e=="object"?fQr.exports=M8e=e(na()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(M8e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,E=0;E{p();(function(t,e,r){typeof B8e=="object"?pQr.exports=B8e=e(na(),w8e(),O8e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(B8e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof L8e=="object"?mQr.exports=L8e=e(na(),Nwt(),O8e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(L8e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,E=h.iterations;A.length{p();(function(t,e,r){typeof F8e=="object"?gQr.exports=F8e=e(na(),TB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(F8e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(L,B){return this.create(this._ENC_XFORM_MODE,L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.create(this._DEC_XFORM_MODE,L,B)},"createDecryptor"),init:a(function(L,B,Q){this.cfg=this.cfg.extend(Q),this._xformMode=L,this._key=B,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(L){return this._append(L),this._process()},"process"),finalize:a(function(L){L&&this._append(L);var B=this._doFinalize();return B},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function L(B){return typeof B=="string"?N:x}return a(L,"selectCipherStrategy"),function(B){return{encrypt:a(function(Q,M,O){return L(M).encrypt(B,Q,M,O)},"encrypt"),decrypt:a(function(Q,M,O){return L(M).decrypt(B,Q,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var L=this._process(!0);return L},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(L,B){return this.Encryptor.create(L,B)},"createEncryptor"),createDecryptor:a(function(L,B){return this.Decryptor.create(L,B)},"createDecryptor"),init:a(function(L,B){this._cipher=L,this._iv=B},"init")}),E=A.CBC=(function(){var L=y.extend();L.Encryptor=L.extend({processBlock:a(function(Q,M){var O=this._cipher,q=O.blockSize;B.call(this,Q,M,q),O.encryptBlock(Q,M),this._prevBlock=Q.slice(M,M+q)},"processBlock")}),L.Decryptor=L.extend({processBlock:a(function(Q,M){var O=this._cipher,q=O.blockSize,F=Q.slice(M,M+q);O.decryptBlock(Q,M),B.call(this,Q,M,q),this._prevBlock=F},"processBlock")});function B(Q,M,O){var q,F=this._iv;F?(q=F,this._iv=e):q=this._prevBlock;for(var U=0;U>>2]&255;L.sigBytes-=B},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var L;m.reset.call(this);var B=this.cfg,Q=B.iv,M=B.mode;this._xformMode==this._ENC_XFORM_MODE?L=M.createEncryptor:(L=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,Q&&Q.words):(this._mode=L.call(M,this,Q&&Q.words),this._mode.__creator=L)},"reset"),_doProcessBlock:a(function(L,B){this._mode.processBlock(L,B)},"_doProcessBlock"),_doFinalize:a(function(){var L,B=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(B.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),B.unpad(L)),L},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(L){this.mixIn(L)},"init"),toString:a(function(L){return(L||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(L){var B,Q=L.ciphertext,M=L.salt;return M?B=s.create([1398893684,1701076831]).concat(M).concat(Q):B=Q,B.toString(d)},"stringify"),parse:a(function(L){var B,Q=d.parse(L),M=Q.words;return M[0]==1398893684&&M[1]==1701076831&&(B=s.create(M.slice(2,4)),M.splice(0,4),Q.sigBytes-=16),T.create({ciphertext:Q,salt:B})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(L,B,Q,M){M=this.cfg.extend(M);var O=L.createEncryptor(Q,M),q=O.finalize(B),F=O.cfg;return T.create({ciphertext:q,key:Q,iv:F.iv,algorithm:L,mode:F.mode,padding:F.padding,blockSize:L.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(L,B,Q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=L.createDecryptor(Q,M).finalize(B.ciphertext);return O},"decrypt"),_parse:a(function(L,B){return typeof L=="string"?B.parse(L,this):L},"_parse")}),k=r.kdf={},D=k.OpenSSL={execute:a(function(L,B,Q,M,O){if(M||(M=s.random(64/8)),O)var q=h.create({keySize:B+Q,hasher:O}).compute(L,M);else var q=h.create({keySize:B+Q}).compute(L,M);var F=s.create(q.words.slice(B),Q*4);return q.sigBytes=B*4,T.create({key:q,iv:F,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(L,B,Q,M){M=this.cfg.extend(M);var O=M.kdf.execute(Q,L.keySize,L.ivSize,M.salt,M.hasher);M.iv=O.iv;var q=x.encrypt.call(this,L,B,O.key,M);return q.mixIn(O),q},"encrypt"),decrypt:a(function(L,B,Q,M){M=this.cfg.extend(M),B=this._parse(B,M.format);var O=M.kdf.execute(Q,L.keySize,L.ivSize,B.salt,M.hasher);M.iv=O.iv;var q=x.decrypt.call(this,L,B,O.key,M);return q},"decrypt")})})()})});var yQr=I((U8e,AQr)=>{p();(function(t,e,r){typeof U8e=="object"?AQr.exports=U8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(U8e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof Q8e=="object"?EQr.exports=Q8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Q8e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof q8e=="object"?CQr.exports=q8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(q8e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof j8e=="object"?bQr.exports=j8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(j8e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof H8e=="object"?TQr.exports=H8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(H8e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var wQr=I((G8e,xQr)=>{p();(function(t,e,r){typeof G8e=="object"?xQr.exports=G8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(G8e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var kQr=I(($8e,RQr)=>{p();(function(t,e,r){typeof $8e=="object"?RQr.exports=$8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})($8e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var DQr=I((V8e,PQr)=>{p();(function(t,e,r){typeof V8e=="object"?PQr.exports=V8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(V8e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var MQr=I((W8e,NQr)=>{p();(function(t,e,r){typeof W8e=="object"?NQr.exports=W8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(W8e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var BQr=I((z8e,OQr)=>{p();(function(t,e,r){typeof z8e=="object"?OQr.exports=z8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(z8e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var FQr=I((Y8e,LQr)=>{p();(function(t,e,r){typeof Y8e=="object"?LQr.exports=Y8e=e(na(),w0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Y8e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var QQr=I((K8e,UQr)=>{p();(function(t,e,r){typeof K8e=="object"?UQr.exports=K8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(K8e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[b]=w,c[w]=b;var R=_[b],x=_[R],k=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=k*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[k^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],k=0;k6&&k%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[k/T|0]<<24),x[k]=x[k-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,k){for(var D=this._nRounds,N=_[v]^b[0],L=_[v+1]^b[1],B=_[v+2]^b[2],Q=_[v+3]^b[3],M=4,O=1;O>>24]^w[L>>>16&255]^R[B>>>8&255]^x[Q&255]^b[M++],F=T[L>>>24]^w[B>>>16&255]^R[Q>>>8&255]^x[N&255]^b[M++],U=T[B>>>24]^w[Q>>>16&255]^R[N>>>8&255]^x[L&255]^b[M++],W=T[Q>>>24]^w[N>>>16&255]^R[L>>>8&255]^x[B&255]^b[M++];N=q,L=F,B=U,Q=W}var q=(k[N>>>24]<<24|k[L>>>16&255]<<16|k[B>>>8&255]<<8|k[Q&255])^b[M++],F=(k[L>>>24]<<24|k[B>>>16&255]<<16|k[Q>>>8&255]<<8|k[N&255])^b[M++],U=(k[B>>>24]<<24|k[Q>>>16&255]<<16|k[N>>>8&255]<<8|k[L&255])^b[M++],W=(k[Q>>>24]<<24|k[N>>>16&255]<<16|k[L>>>8&255]<<8|k[B&255])^b[M++];_[v]=q,_[v+1]=F,_[v+2]=U,_[v+3]=W},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var jQr=I((J8e,qQr)=>{p();(function(t,e,r){typeof J8e=="object"?qQr.exports=J8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(J8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var k=this._invSubKeys=[],v=0;v<16;v++)k[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var GQr=I((Z8e,HQr)=>{p();(function(t,e,r){typeof Z8e=="object"?HQr.exports=Z8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(Z8e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var E=h[m];h[m]=h[g],h[g]=E}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var VQr=I((X8e,$Qr)=>{p();(function(t,e,r){typeof X8e=="object"?$Qr.exports=X8e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(X8e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var zQr=I((e6e,WQr)=>{p();(function(t,e,r){typeof e6e=="object"?WQr.exports=e6e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(e6e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var KQr=I((t6e,YQr)=>{p();(function(t,e,r){typeof t6e=="object"?YQr.exports=t6e=e(na(),x9(),w9(),TB(),w0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(t6e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof r6e=="object"?JQr.exports=r6e=e(na(),aCe(),z7r(),K7r(),x9(),X7r(),w9(),Nwt(),w8e(),iQr(),Mwt(),aQr(),lQr(),dQr(),O8e(),hQr(),TB(),w0(),yQr(),_Qr(),vQr(),SQr(),IQr(),wQr(),kQr(),DQr(),MQr(),BQr(),FQr(),QQr(),jQr(),GQr(),VQr(),zQr(),KQr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(r6e,function(t){return t})});var Wie=I(_y=>{"use strict";p();Object.defineProperty(_y,"__esModule",{value:!0});_y.stringArray=_y.array=_y.func=_y.error=_y.number=_y.string=_y.boolean=void 0;function xfo(t){return t===!0||t===!1}a(xfo,"boolean");_y.boolean=xfo;function DHr(t){return typeof t=="string"||t instanceof String}a(DHr,"string");_y.string=DHr;function wfo(t){return typeof t=="number"||t instanceof Number}a(wfo,"number");_y.number=wfo;function Rfo(t){return t instanceof Error}a(Rfo,"error");_y.error=Rfo;function kfo(t){return typeof t=="function"}a(kfo,"func");_y.func=kfo;function NHr(t){return Array.isArray(t)}a(NHr,"array");_y.array=NHr;function Pfo(t){return NHr(t)&&t.every(e=>DHr(e))}a(Pfo,"stringArray");_y.stringArray=Pfo});var okt=I(ui=>{"use strict";p();Object.defineProperty(ui,"__esModule",{value:!0});ui.Message=ui.NotificationType9=ui.NotificationType8=ui.NotificationType7=ui.NotificationType6=ui.NotificationType5=ui.NotificationType4=ui.NotificationType3=ui.NotificationType2=ui.NotificationType1=ui.NotificationType0=ui.NotificationType=ui.RequestType9=ui.RequestType8=ui.RequestType7=ui.RequestType6=ui.RequestType5=ui.RequestType4=ui.RequestType3=ui.RequestType2=ui.RequestType1=ui.RequestType=ui.RequestType0=ui.AbstractMessageSignature=ui.ParameterStructures=ui.ResponseError=ui.ErrorCodes=void 0;var eW=Wie(),ORt;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(ORt||(ui.ErrorCodes=ORt={}));var BRt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=eW.number(e)?e:ORt.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};ui.ResponseError=BRt;var YC=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};ui.ParameterStructures=YC;YC.auto=new YC("auto");YC.byPosition=new YC("byPosition");YC.byName=new YC("byName");var Bu=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return YC.auto}};ui.AbstractMessageSignature=Bu;var LRt=class extends Bu{static{a(this,"RequestType0")}constructor(e){super(e,0)}};ui.RequestType0=LRt;var FRt=class extends Bu{static{a(this,"RequestType")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.RequestType=FRt;var URt=class extends Bu{static{a(this,"RequestType1")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.RequestType1=URt;var QRt=class extends Bu{static{a(this,"RequestType2")}constructor(e){super(e,2)}};ui.RequestType2=QRt;var qRt=class extends Bu{static{a(this,"RequestType3")}constructor(e){super(e,3)}};ui.RequestType3=qRt;var jRt=class extends Bu{static{a(this,"RequestType4")}constructor(e){super(e,4)}};ui.RequestType4=jRt;var HRt=class extends Bu{static{a(this,"RequestType5")}constructor(e){super(e,5)}};ui.RequestType5=HRt;var GRt=class extends Bu{static{a(this,"RequestType6")}constructor(e){super(e,6)}};ui.RequestType6=GRt;var $Rt=class extends Bu{static{a(this,"RequestType7")}constructor(e){super(e,7)}};ui.RequestType7=$Rt;var VRt=class extends Bu{static{a(this,"RequestType8")}constructor(e){super(e,8)}};ui.RequestType8=VRt;var WRt=class extends Bu{static{a(this,"RequestType9")}constructor(e){super(e,9)}};ui.RequestType9=WRt;var zRt=class extends Bu{static{a(this,"NotificationType")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.NotificationType=zRt;var YRt=class extends Bu{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};ui.NotificationType0=YRt;var KRt=class extends Bu{static{a(this,"NotificationType1")}constructor(e,r=YC.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};ui.NotificationType1=KRt;var JRt=class extends Bu{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};ui.NotificationType2=JRt;var ZRt=class extends Bu{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};ui.NotificationType3=ZRt;var XRt=class extends Bu{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};ui.NotificationType4=XRt;var ekt=class extends Bu{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};ui.NotificationType5=ekt;var tkt=class extends Bu{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};ui.NotificationType6=tkt;var rkt=class extends Bu{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};ui.NotificationType7=rkt;var nkt=class extends Bu{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};ui.NotificationType8=nkt;var ikt=class extends Bu{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};ui.NotificationType9=ikt;var MHr;(function(t){function e(o){let s=o;return s&&eW.string(s.method)&&(eW.string(s.id)||eW.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&eW.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(eW.string(s.id)||eW.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(MHr||(ui.Message=MHr={}))});var akt=I(j9=>{"use strict";p();var OHr;Object.defineProperty(j9,"__esModule",{value:!0});j9.LRUCache=j9.LinkedMap=j9.Touch=void 0;var Cy;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Cy||(j9.Touch=Cy={}));var F6e=class{static{a(this,"LinkedMap")}constructor(){this[OHr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Cy.None){let n=this._map.get(e);if(n)return r!==Cy.None&&this.touch(n,r),n.value}set(e,r,n=Cy.None){let o=this._map.get(e);if(o)o.value=r,n!==Cy.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Cy.None:this.addItemLast(o);break;case Cy.First:this.addItemFirst(o);break;case Cy.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[(OHr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Cy.First&&r!==Cy.Last)){if(r===Cy.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Cy.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};j9.LinkedMap=F6e;var skt=class extends F6e{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Cy.AsNew){return super.get(e,r)}peek(e){return super.get(e,Cy.None)}set(e,r){return super.set(e,r,Cy.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};j9.LRUCache=skt});var LHr=I(U6e=>{"use strict";p();Object.defineProperty(U6e,"__esModule",{value:!0});U6e.Disposable=void 0;var BHr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(BHr||(U6e.Disposable=BHr={}))});var H9=I(ukt=>{"use strict";p();Object.defineProperty(ukt,"__esModule",{value:!0});var ckt;function lkt(){if(ckt===void 0)throw new Error("No runtime abstraction layer installed");return ckt}a(lkt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");ckt=r}a(e,"install"),t.install=e})(lkt||(lkt={}));ukt.default=lkt});var Yie=I(zie=>{"use strict";p();Object.defineProperty(zie,"__esModule",{value:!0});zie.Emitter=zie.Event=void 0;var Dfo=H9(),FHr;(function(t){let e={dispose(){}};t.None=function(){return e}})(FHr||(zie.Event=FHr={}));var dkt=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new dkt),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};zie.Emitter=Q6e;Q6e._noop=function(){}});var H6e=I(Kie=>{"use strict";p();Object.defineProperty(Kie,"__esModule",{value:!0});Kie.CancellationTokenSource=Kie.CancellationToken=void 0;var Nfo=H9(),Mfo=Wie(),fkt=Yie(),q6e;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:fkt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:fkt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||Mfo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(q6e||(Kie.CancellationToken=q6e={}));var Ofo=Object.freeze(function(t,e){let r=(0,Nfo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),j6e=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}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?Ofo:(this._emitter||(this._emitter=new fkt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},pkt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new j6e),this._token}cancel(){this._token?this._token.cancel():this._token=q6e.Cancelled}dispose(){this._token?this._token instanceof j6e&&this._token.dispose():this._token=q6e.None}};Kie.CancellationTokenSource=pkt});var UHr=I(Jie=>{"use strict";p();Object.defineProperty(Jie,"__esModule",{value:!0});Jie.SharedArrayReceiverStrategy=Jie.SharedArraySenderStrategy=void 0;var Bfo=H6e(),xCe;(function(t){t.Continue=0,t.Cancelled=1})(xCe||(xCe={}));var hkt=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=xCe.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,xCe.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Jie.SharedArraySenderStrategy=hkt;var mkt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===xCe.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},gkt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new mkt(e)}cancel(){}dispose(){}},Akt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Bfo.CancellationTokenSource:new gkt(r)}};Jie.SharedArrayReceiverStrategy=Akt});var Ekt=I(G6e=>{"use strict";p();Object.defineProperty(G6e,"__esModule",{value:!0});G6e.Semaphore=void 0;var Lfo=H9(),ykt=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Lfo.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};G6e.Semaphore=ykt});var qHr=I(G9=>{"use strict";p();Object.defineProperty(G9,"__esModule",{value:!0});G9.ReadableStreamMessageReader=G9.AbstractMessageReader=G9.MessageReader=void 0;var Ckt=H9(),Zie=Wie(),_kt=Yie(),Ffo=Ekt(),QHr;(function(t){function e(r){let n=r;return n&&Zie.func(n.listen)&&Zie.func(n.dispose)&&Zie.func(n.onError)&&Zie.func(n.onClose)&&Zie.func(n.onPartialMessage)}a(e,"is"),t.is=e})(QHr||(G9.MessageReader=QHr={}));var $6e=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new _kt.Emitter,this.closeEmitter=new _kt.Emitter,this.partialMessageEmitter=new _kt.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Zie.string(e.message)?e.message:"unknown"}`)}};G9.AbstractMessageReader=$6e;var vkt;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,Ckt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(vkt||(vkt={}));var bkt=class extends $6e{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=vkt.fromOptions(r),this.buffer=(0,Ckt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Ffo.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. -${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ckt.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};G9.ReadableStreamMessageReader=bkt});var VHr=I($9=>{"use strict";p();Object.defineProperty($9,"__esModule",{value:!0});$9.WriteableStreamMessageWriter=$9.AbstractMessageWriter=$9.MessageWriter=void 0;var jHr=H9(),wCe=Wie(),Ufo=Ekt(),HHr=Yie(),Qfo="Content-Length: ",GHr=`\r -`,$Hr;(function(t){function e(r){let n=r;return n&&wCe.func(n.dispose)&&wCe.func(n.onClose)&&wCe.func(n.onError)&&wCe.func(n.write)}a(e,"is"),t.is=e})($Hr||($9.MessageWriter=$Hr={}));var V6e=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new HHr.Emitter,this.closeEmitter=new HHr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${wCe.string(e.message)?e.message:"unknown"}`)}};$9.AbstractMessageWriter=V6e;var Skt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,jHr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,jHr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(Skt||(Skt={}));var Tkt=class extends V6e{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=Skt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Ufo.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(Qfo,n.byteLength.toString(),GHr),o.push(GHr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};$9.WriteableStreamMessageWriter=Tkt});var WHr=I(W6e=>{"use strict";p();Object.defineProperty(W6e,"__esModule",{value:!0});W6e.AbstractMessageBuffer=void 0;var qfo=13,jfo=10,Hfo=`\r -`,Ikt=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};W6e.AbstractMessageBuffer=Ikt});var ZHr=I(Mo=>{"use strict";p();Object.defineProperty(Mo,"__esModule",{value:!0});Mo.createMessageConnection=Mo.ConnectionOptions=Mo.MessageStrategy=Mo.CancellationStrategy=Mo.CancellationSenderStrategy=Mo.CancellationReceiverStrategy=Mo.RequestCancellationReceiverStrategy=Mo.IdCancellationReceiverStrategy=Mo.ConnectionStrategy=Mo.ConnectionError=Mo.ConnectionErrors=Mo.LogTraceNotification=Mo.SetTraceNotification=Mo.TraceFormat=Mo.TraceValues=Mo.Trace=Mo.NullLogger=Mo.ProgressType=Mo.ProgressToken=void 0;var zHr=H9(),ef=Wie(),Wi=okt(),YHr=akt(),RCe=Yie(),xkt=H6e(),DCe;(function(t){t.type=new Wi.NotificationType("$/cancelRequest")})(DCe||(DCe={}));var wkt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(wkt||(Mo.ProgressToken=wkt={}));var kCe;(function(t){t.type=new Wi.NotificationType("$/progress")})(kCe||(kCe={}));var Rkt=class{static{a(this,"ProgressType")}constructor(){}};Mo.ProgressType=Rkt;var kkt;(function(t){function e(r){return ef.func(r)}a(e,"is"),t.is=e})(kkt||(kkt={}));Mo.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var Ec;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(Ec||(Mo.Trace=Ec={}));var KHr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(KHr||(Mo.TraceValues=KHr={}));(function(t){function e(n){if(!ef.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(Ec||(Mo.Trace=Ec={}));var P1;(function(t){t.Text="text",t.JSON="json"})(P1||(Mo.TraceFormat=P1={}));(function(t){function e(r){return ef.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(P1||(Mo.TraceFormat=P1={}));var Pkt;(function(t){t.type=new Wi.NotificationType("$/setTrace")})(Pkt||(Mo.SetTraceNotification=Pkt={}));var z6e;(function(t){t.type=new Wi.NotificationType("$/logTrace")})(z6e||(Mo.LogTraceNotification=z6e={}));var PCe;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(PCe||(Mo.ConnectionErrors=PCe={}));var Xie=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};Mo.ConnectionError=Xie;var Dkt;(function(t){function e(r){let n=r;return n&&ef.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(Dkt||(Mo.ConnectionStrategy=Dkt={}));var Y6e;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&ef.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ef.func(n.dispose))}a(e,"is"),t.is=e})(Y6e||(Mo.IdCancellationReceiverStrategy=Y6e={}));var Nkt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&ef.func(n.createCancellationTokenSource)&&(n.dispose===void 0||ef.func(n.dispose))}a(e,"is"),t.is=e})(Nkt||(Mo.RequestCancellationReceiverStrategy=Nkt={}));var K6e;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new xkt.CancellationTokenSource}});function e(r){return Y6e.is(r)||Nkt.is(r)}a(e,"is"),t.is=e})(K6e||(Mo.CancellationReceiverStrategy=K6e={}));var J6e;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(DCe.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&ef.func(n.sendCancellation)&&ef.func(n.cleanup)}a(e,"is"),t.is=e})(J6e||(Mo.CancellationSenderStrategy=J6e={}));var Z6e;(function(t){t.Message=Object.freeze({receiver:K6e.Message,sender:J6e.Message});function e(r){let n=r;return n&&K6e.is(n.receiver)&&J6e.is(n.sender)}a(e,"is"),t.is=e})(Z6e||(Mo.CancellationStrategy=Z6e={}));var X6e;(function(t){function e(r){let n=r;return n&&ef.func(n.handleMessage)}a(e,"is"),t.is=e})(X6e||(Mo.MessageStrategy=X6e={}));var JHr;(function(t){function e(r){let n=r;return n&&(Z6e.is(n.cancellationStrategy)||Dkt.is(n.connectionStrategy)||X6e.is(n.messageStrategy))}a(e,"is"),t.is=e})(JHr||(Mo.ConnectionOptions=JHr={}));var _k;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(_k||(_k={}));function Gfo(t,e,r,n){let o=r!==void 0?r:Mo.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new YHr.LinkedMap,E=new Map,_=new Set,v=new Map,b=Ec.Off,T=P1.Text,w,R=_k.New,x=new RCe.Emitter,k=new RCe.Emitter,D=new RCe.Emitter,N=new RCe.Emitter,L=new RCe.Emitter,B=n&&n.cancellationStrategy?n.cancellationStrategy:Z6e.Message;function Q(Ee){if(Ee===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ee.toString()}a(Q,"createRequestQueueKey");function M(Ee){return Ee===null?"res-unknown-"+(++l).toString():"res-"+Ee.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function q(Ee,Qe){Wi.Message.isRequest(Qe)?Ee.set(Q(Qe.id),Qe):Wi.Message.isResponse(Qe)?Ee.set(M(Qe.id),Qe):Ee.set(O(),Qe)}a(q,"addMessageToQueue");function F(Ee){}a(F,"cancelUndispatched");function U(){return R===_k.Listening}a(U,"isListening");function W(){return R===_k.Closed}a(W,"isClosed");function V(){return R===_k.Disposed}a(V,"isDisposed");function G(){(R===_k.New||R===_k.Listening)&&(R=_k.Closed,k.fire(void 0))}a(G,"closeHandler");function Y(Ee){x.fire([Ee,void 0,void 0])}a(Y,"readErrorHandler");function re(Ee){x.fire(Ee)}a(re,"writeErrorHandler"),t.onClose(G),t.onError(Y),e.onClose(G),e.onError(re);function j(){A||y.size===0||(A=(0,zHr.default)().timer.setImmediate(()=>{A=void 0,ie()}))}a(j,"triggerMessageQueue");function X(Ee){Wi.Message.isRequest(Ee)?Ae(Ee):Wi.Message.isNotification(Ee)?Te(Ee):Wi.Message.isResponse(Ee)?De(Ee):Z(Ee)}a(X,"handleMessage");function ie(){if(y.size===0)return;let Ee=y.shift();try{let Qe=n?.messageStrategy;X6e.is(Qe)?Qe.handleMessage(Ee,X):X(Ee)}finally{j()}}a(ie,"processMessageQueue");let we=a(Ee=>{try{if(Wi.Message.isNotification(Ee)&&Ee.method===DCe.type.method){let Qe=Ee.params.id,nt=Q(Qe),mt=y.get(nt);if(Wi.Message.isRequest(mt)){let He=n?.connectionStrategy,Ze=He&&He.cancelUndispatched?He.cancelUndispatched(mt,F):void 0;if(Ze&&(Ze.error!==void 0||Ze.result!==void 0)){y.delete(nt),v.delete(Qe),Ze.id=mt.id,K(Ze,Ee.method,Date.now()),e.write(Ze).catch(()=>o.error("Sending response for canceled message failed."));return}}let xe=v.get(Qe);if(xe!==void 0){xe.cancel(),Me(Ee);return}else _.add(Qe)}q(y,Ee)}finally{j()}},"callback");function Ae(Ee){if(V())return;function Qe(ct,ut,ee){let pe={jsonrpc:u,id:Ee.id};ct instanceof Wi.ResponseError?pe.error=ct.toJson():pe.result=ct===void 0?null:ct,K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(Qe,"reply");function nt(ct,ut,ee){let pe={jsonrpc:u,id:Ee.id,error:ct.toJson()};K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(nt,"replyError");function mt(ct,ut,ee){ct===void 0&&(ct=null);let pe={jsonrpc:u,id:Ee.id,result:ct};K(pe,ut,ee),e.write(pe).catch(()=>o.error("Sending response failed."))}a(mt,"replySuccess"),ae(Ee);let xe=f.get(Ee.method),He,Ze;xe&&(He=xe.type,Ze=xe.handler);let at=Date.now();if(Ze||d){let ct=Ee.id??String(Date.now()),ut=Y6e.is(B.receiver)?B.receiver.createCancellationTokenSource(ct):B.receiver.createCancellationTokenSource(Ee);Ee.id!==null&&_.has(Ee.id)&&ut.cancel(),Ee.id!==null&&v.set(ct,ut);try{let ee;if(Ze)if(Ee.params===void 0){if(He!==void 0&&He.numberOfParams!==0){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines ${He.numberOfParams} params but received none.`),Ee.method,at);return}ee=Ze(ut.token)}else if(Array.isArray(Ee.params)){if(He!==void 0&&He.parameterStructures===Wi.ParameterStructures.byName){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by name but received parameters by position`),Ee.method,at);return}ee=Ze(...Ee.params,ut.token)}else{if(He!==void 0&&He.parameterStructures===Wi.ParameterStructures.byPosition){nt(new Wi.ResponseError(Wi.ErrorCodes.InvalidParams,`Request ${Ee.method} defines parameters by position but received parameters by name`),Ee.method,at);return}ee=Ze(Ee.params,ut.token)}else d&&(ee=d(Ee.method,Ee.params,ut.token));let pe=ee;ee?pe.then?pe.then(ke=>{v.delete(ct),Qe(ke,Ee.method,at)},ke=>{v.delete(ct),ke instanceof Wi.ResponseError?nt(ke,Ee.method,at):ke&&ef.string(ke.message)?nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${ke.message}`),Ee.method,at):nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,at)}):(v.delete(ct),Qe(ee,Ee.method,at)):(v.delete(ct),mt(ee,Ee.method,at))}catch(ee){v.delete(ct),ee instanceof Wi.ResponseError?Qe(ee,Ee.method,at):ee&&ef.string(ee.message)?nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed with message: ${ee.message}`),Ee.method,at):nt(new Wi.ResponseError(Wi.ErrorCodes.InternalError,`Request ${Ee.method} failed unexpectedly without providing any details.`),Ee.method,at)}}else nt(new Wi.ResponseError(Wi.ErrorCodes.MethodNotFound,`Unhandled method ${Ee.method}`),Ee.method,at)}a(Ae,"handleRequest");function De(Ee){if(!V())if(Ee.id===null)Ee.error?o.error(`Received response message without id: Error is: -${JSON.stringify(Ee.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let Qe=Ee.id,nt=E.get(Qe);if(ne(Ee,nt),nt!==void 0){E.delete(Qe);try{if(Ee.error){let mt=Ee.error;nt.reject(new Wi.ResponseError(mt.code,mt.message,mt.data))}else if(Ee.result!==void 0)nt.resolve(Ee.result);else throw new Error("Should never happen.")}catch(mt){mt.message?o.error(`Response handler '${nt.method}' failed with message: ${mt.message}`):o.error(`Response handler '${nt.method}' failed unexpectedly.`)}}}}a(De,"handleResponse");function Te(Ee){if(V())return;let Qe,nt;if(Ee.method===DCe.type.method){let mt=Ee.params.id;_.delete(mt),Me(Ee);return}else{let mt=m.get(Ee.method);mt&&(nt=mt.handler,Qe=mt.type)}if(nt||h)try{if(Me(Ee),nt)if(Ee.params===void 0)Qe!==void 0&&Qe.numberOfParams!==0&&Qe.parameterStructures!==Wi.ParameterStructures.byName&&o.error(`Notification ${Ee.method} defines ${Qe.numberOfParams} params but received none.`),nt();else if(Array.isArray(Ee.params)){let mt=Ee.params;Ee.method===kCe.type.method&&mt.length===2&&wkt.is(mt[0])?nt({token:mt[0],value:mt[1]}):(Qe!==void 0&&(Qe.parameterStructures===Wi.ParameterStructures.byName&&o.error(`Notification ${Ee.method} defines parameters by name but received parameters by position`),Qe.numberOfParams!==Ee.params.length&&o.error(`Notification ${Ee.method} defines ${Qe.numberOfParams} params but received ${mt.length} arguments`)),nt(...mt))}else Qe!==void 0&&Qe.parameterStructures===Wi.ParameterStructures.byPosition&&o.error(`Notification ${Ee.method} defines parameters by position but received parameters by name`),nt(Ee.params);else h&&h(Ee.method,Ee.params)}catch(mt){mt.message?o.error(`Notification handler '${Ee.method}' failed with message: ${mt.message}`):o.error(`Notification handler '${Ee.method}' failed unexpectedly.`)}else D.fire(Ee)}a(Te,"handleNotification");function Z(Ee){if(!Ee){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: -${JSON.stringify(Ee,null,4)}`);let Qe=Ee;if(ef.string(Qe.id)||ef.number(Qe.id)){let nt=Qe.id,mt=E.get(nt);mt&&mt.reject(new Error("The received response has neither a result nor an error property."))}}a(Z,"handleInvalidMessage");function J(Ee){if(Ee!=null)switch(b){case Ec.Verbose:return JSON.stringify(Ee,null,4);case Ec.Compact:return JSON.stringify(Ee);default:return}}a(J,"stringifyTrace");function z(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&Ee.params&&(Qe=`Params: ${J(Ee.params)} +`)),l.tries=r,l}a(Hio,"bindings");A7r.exports=Hio;function Gio(t){for(var e=jio(t),r;;){if(e==="."&&(e=process.cwd()),m7r(z_e(e,"dist")))return z_e(e,"dist");if(m7r(z_e(e,"compiled")))return e;if(r===e)throw new Error('Could not find module root given file: "'+t+'". Do you have a `dist` or `compiled` directory? ');r=e,e=z_e(e,"..")}}a(Gio,"getRoot")});var v7r=I(gI=>{"use strict";p();var $io=gI&&gI.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vio=gI&&gI.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y7r=gI&&gI.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$io(e,t,r);return Vio(e,t),e};Object.defineProperty(gI,"__esModule",{value:!0});gI.setDeviceId=gI.getDeviceId=void 0;var n8e=y7r(require("path")),i8e=y7r(h7r()),E7r=process.platform==="win32"?r8e()("windows"):null,Wio="deviceid";function _7r(){let t;if(!process.env.HOME)throw new Error("Home directory not found");if(process.platform==="darwin")t=n8e.join(process.env.HOME,"Library","Application Support");else if(process.platform==="linux")t=process.env.XDG_CACHE_HOME??n8e.join(process.env.HOME,".cache");else throw new Error("Unsupported platform");return n8e.join(t,"Microsoft","DeveloperTools")}a(_7r,"getDirectory");function _wt(){return n8e.join(_7r(),Wio)}a(_wt,"getDeviceIdFilePath");async function zio(){return process.platform==="win32"?E7r?.GetDeviceId():await Yio(_wt())?i8e.readFile(_wt(),"utf8"):void 0}a(zio,"getDeviceId");gI.getDeviceId=zio;async function Yio(t){try{return await i8e.promises.access(t),!0}catch{return!1}}a(Yio,"exists");async function Kio(t){process.platform==="win32"?E7r?.SetDeviceId(t):(await i8e.ensureDir(_7r()),await i8e.writeFile(_wt(),t,"utf8"))}a(Kio,"setDeviceId");gI.setDeviceId=Kio});var b7r=I(EN=>{"use strict";p();var Jio=EN&&EN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zio=EN&&EN.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xio=EN&&EN.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Jio(e,t,r);return Zio(e,t),e};Object.defineProperty(EN,"__esModule",{value:!0});EN.getDeviceId=void 0;var eoo=(As(),ya(Ac)),C7r=Xio(v7r());async function too(){let t;try{t=await C7r.getDeviceId()}catch{}if(t)return t;{let e=(0,eoo.v4)().toLowerCase();return await C7r.setDeviceId(e),e}}a(too,"getDeviceId");EN.getDeviceId=too});var S7r=I(NV=>{"use strict";p();var roo=NV&&NV.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),noo=NV&&NV.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&roo(e,t,r)};Object.defineProperty(NV,"__esModule",{value:!0});if(process.platform!=="win32"&&process.platform!=="darwin"&&process.platform!=="linux")throw new Error("Unsupported platform");noo(b7r(),NV)});var ea=I((s8e,T7r)=>{p();(function(t,e){typeof s8e=="object"?T7r.exports=s8e=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(s8e,function(){var t=t||(function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof require=="function")try{n=require("crypto")}catch{}var o=a(function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},"cryptoSecureRandomInt"),s=Object.create||(function(){function _(){}return a(_,"F"),function(v){var b;return _.prototype=v,b=new _,_.prototype=null,b}})(),c={},l=c.lib={},u=l.Base=(function(){return{extend:a(function(_){var v=s(this);return _&&v.mixIn(_),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},"extend"),create:a(function(){var _=this.extend();return _.init.apply(_,arguments),_},"create"),init:a(function(){},"init"),mixIn:a(function(_){for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);_.hasOwnProperty("toString")&&(this.toString=_.toString)},"mixIn"),clone:a(function(){return this.init.prototype.extend(this)},"clone")}})(),d=l.WordArray=u.extend({init:a(function(_,v){_=this.words=_||[],v!=r?this.sigBytes=v:this.sigBytes=_.length*4},"init"),toString:a(function(_){return(_||h).stringify(this)},"toString"),concat:a(function(_){var v=this.words,b=_.words,T=this.sigBytes,w=_.sigBytes;if(this.clamp(),T%4)for(var R=0;R>>2]>>>24-R%4*8&255;v[T+R>>>2]|=x<<24-(T+R)%4*8}else for(var P=0;P>>2]=b[P>>>2];return this.sigBytes+=w,this},"concat"),clamp:a(function(){var _=this.words,v=this.sigBytes;_[v>>>2]&=4294967295<<32-v%4*8,_.length=e.ceil(v/4)},"clamp"),clone:a(function(){var _=u.clone.call(this);return _.words=this.words.slice(0),_},"clone"),random:a(function(_){for(var v=[],b=0;b<_;b+=4)v.push(o());return new d.init(v,_)},"random")}),f=c.enc={},h=f.Hex={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>3]|=parseInt(_.substr(T,2),16)<<24-T%8*4;return new d.init(b,v/2)},"parse")},m=f.Latin1={stringify:a(function(_){for(var v=_.words,b=_.sigBytes,T=[],w=0;w>>2]>>>24-w%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},"stringify"),parse:a(function(_){for(var v=_.length,b=[],T=0;T>>2]|=(_.charCodeAt(T)&255)<<24-T%4*8;return new d.init(b,v)},"parse")},g=f.Utf8={stringify:a(function(_){try{return decodeURIComponent(escape(m.stringify(_)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:a(function(_){return m.parse(unescape(encodeURIComponent(_)))},"parse")},A=l.BufferedBlockAlgorithm=u.extend({reset:a(function(){this._data=new d.init,this._nDataBytes=0},"reset"),_append:a(function(_){typeof _=="string"&&(_=g.parse(_)),this._data.concat(_),this._nDataBytes+=_.sigBytes},"_append"),_process:a(function(_){var v,b=this._data,T=b.words,w=b.sigBytes,R=this.blockSize,x=R*4,P=w/x;_?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var D=P*R,N=e.min(D*4,w);if(D){for(var B=0;B{p();(function(t,e){typeof a8e=="object"?I7r.exports=a8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(a8e,function(t){return(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=r.x64={},l=c.Word=o.extend({init:a(function(d,f){this.high=d,this.low=f},"init")}),u=c.WordArray=o.extend({init:a(function(d,f){d=this.words=d||[],f!=e?this.sigBytes=f:this.sigBytes=d.length*8},"init"),toX32:a(function(){for(var d=this.words,f=d.length,h=[],m=0;m{p();(function(t,e){typeof c8e=="object"?x7r.exports=c8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(c8e,function(t){return(function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,s=n.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],d=0;d>>2]|=c[d]<<24-d%4*8;o.call(this,u,l)}else o.apply(this,arguments)};s.prototype=n}})(),t.lib.WordArray})});var P7r=I((l8e,R7r)=>{p();(function(t,e){typeof l8e=="object"?R7r.exports=l8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(l8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Utf16=o.Utf16BE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535;f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=l.charCodeAt(f)<<16-f%2*16;return n.create(d,u*2)},"parse")};o.Utf16LE={stringify:a(function(l){for(var u=l.words,d=l.sigBytes,f=[],h=0;h>>2]>>>16-h%4*8&65535);f.push(String.fromCharCode(m))}return f.join("")},"stringify"),parse:a(function(l){for(var u=l.length,d=[],f=0;f>>1]|=c(l.charCodeAt(f)<<16-f%2*16);return n.create(d,u*2)},"parse")};function c(l){return l<<8&4278255360|l>>>8&16711935}a(c,"swapEndian")})(),t.enc.Utf16})});var E9=I((u8e,k7r)=>{p();(function(t,e){typeof u8e=="object"?k7r.exports=u8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(u8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64={stringify:a(function(l){var u=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],m=0;m>>2]>>>24-m%4*8&255,A=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,E=g<<16|A<<8|y,_=0;_<4&&m+_*.75>>6*(3-_)&63));var v=f.charAt(64);if(v)for(;h.length%4;)h.push(v);return h.join("")},"stringify"),parse:a(function(l){var u=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64})});var N7r=I((d8e,D7r)=>{p();(function(t,e){typeof d8e=="object"?D7r.exports=d8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(d8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,s=o.Base64url={stringify:a(function(l,u){u===void 0&&(u=!0);var d=l.words,f=l.sigBytes,h=u?this._safe_map:this._map;l.clamp();for(var m=[],g=0;g>>2]>>>24-g%4*8&255,y=d[g+1>>>2]>>>24-(g+1)%4*8&255,E=d[g+2>>>2]>>>24-(g+2)%4*8&255,_=A<<16|y<<8|E,v=0;v<4&&g+v*.75>>6*(3-v)&63));var b=h.charAt(64);if(b)for(;m.length%4;)m.push(b);return m.join("")},"stringify"),parse:a(function(l,u){u===void 0&&(u=!0);var d=l.length,f=u?this._safe_map:this._map,h=this._reverseMap;if(!h){h=this._reverseMap=[];for(var m=0;m>>6-m%4*2,y=g|A;f[h>>>2]|=y<<24-h%4*8,h++}return n.create(f,h)}a(c,"parseLoop")})(),t.enc.Base64url})});var _9=I((f8e,M7r)=>{p();(function(t,e){typeof f8e=="object"?M7r.exports=f8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(f8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[];(function(){for(var g=0;g<64;g++)l[g]=e.abs(e.sin(g+1))*4294967296|0})();var u=c.MD5=s.extend({_doReset:a(function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},"_doReset"),_doProcessBlock:a(function(g,A){for(var y=0;y<16;y++){var E=A+y,_=g[E];g[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}var v=this._hash.words,b=g[A+0],T=g[A+1],w=g[A+2],R=g[A+3],x=g[A+4],P=g[A+5],D=g[A+6],N=g[A+7],B=g[A+8],L=g[A+9],j=g[A+10],M=g[A+11],O=g[A+12],q=g[A+13],Q=g[A+14],U=g[A+15],z=v[0],W=v[1],$=v[2],J=v[3];z=d(z,W,$,J,b,7,l[0]),J=d(J,z,W,$,T,12,l[1]),$=d($,J,z,W,w,17,l[2]),W=d(W,$,J,z,R,22,l[3]),z=d(z,W,$,J,x,7,l[4]),J=d(J,z,W,$,P,12,l[5]),$=d($,J,z,W,D,17,l[6]),W=d(W,$,J,z,N,22,l[7]),z=d(z,W,$,J,B,7,l[8]),J=d(J,z,W,$,L,12,l[9]),$=d($,J,z,W,j,17,l[10]),W=d(W,$,J,z,M,22,l[11]),z=d(z,W,$,J,O,7,l[12]),J=d(J,z,W,$,q,12,l[13]),$=d($,J,z,W,Q,17,l[14]),W=d(W,$,J,z,U,22,l[15]),z=f(z,W,$,J,T,5,l[16]),J=f(J,z,W,$,D,9,l[17]),$=f($,J,z,W,M,14,l[18]),W=f(W,$,J,z,b,20,l[19]),z=f(z,W,$,J,P,5,l[20]),J=f(J,z,W,$,j,9,l[21]),$=f($,J,z,W,U,14,l[22]),W=f(W,$,J,z,x,20,l[23]),z=f(z,W,$,J,L,5,l[24]),J=f(J,z,W,$,Q,9,l[25]),$=f($,J,z,W,R,14,l[26]),W=f(W,$,J,z,B,20,l[27]),z=f(z,W,$,J,q,5,l[28]),J=f(J,z,W,$,w,9,l[29]),$=f($,J,z,W,N,14,l[30]),W=f(W,$,J,z,O,20,l[31]),z=h(z,W,$,J,P,4,l[32]),J=h(J,z,W,$,B,11,l[33]),$=h($,J,z,W,M,16,l[34]),W=h(W,$,J,z,Q,23,l[35]),z=h(z,W,$,J,T,4,l[36]),J=h(J,z,W,$,x,11,l[37]),$=h($,J,z,W,N,16,l[38]),W=h(W,$,J,z,j,23,l[39]),z=h(z,W,$,J,q,4,l[40]),J=h(J,z,W,$,b,11,l[41]),$=h($,J,z,W,R,16,l[42]),W=h(W,$,J,z,D,23,l[43]),z=h(z,W,$,J,L,4,l[44]),J=h(J,z,W,$,O,11,l[45]),$=h($,J,z,W,U,16,l[46]),W=h(W,$,J,z,w,23,l[47]),z=m(z,W,$,J,b,6,l[48]),J=m(J,z,W,$,N,10,l[49]),$=m($,J,z,W,Q,15,l[50]),W=m(W,$,J,z,P,21,l[51]),z=m(z,W,$,J,O,6,l[52]),J=m(J,z,W,$,R,10,l[53]),$=m($,J,z,W,j,15,l[54]),W=m(W,$,J,z,T,21,l[55]),z=m(z,W,$,J,B,6,l[56]),J=m(J,z,W,$,U,10,l[57]),$=m($,J,z,W,D,15,l[58]),W=m(W,$,J,z,q,21,l[59]),z=m(z,W,$,J,x,6,l[60]),J=m(J,z,W,$,M,10,l[61]),$=m($,J,z,W,w,15,l[62]),W=m(W,$,J,z,L,21,l[63]),v[0]=v[0]+z|0,v[1]=v[1]+W|0,v[2]=v[2]+$|0,v[3]=v[3]+J|0},"_doProcessBlock"),_doFinalize:a(function(){var g=this._data,A=g.words,y=this._nDataBytes*8,E=g.sigBytes*8;A[E>>>5]|=128<<24-E%32;var _=e.floor(y/4294967296),v=y;A[(E+64>>>9<<4)+15]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,A[(E+64>>>9<<4)+14]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,g.sigBytes=(A.length+1)*4,this._process();for(var b=this._hash,T=b.words,w=0;w<4;w++){var R=T[w];T[w]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360}return b},"_doFinalize"),clone:a(function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g},"clone")});function d(g,A,y,E,_,v,b){var T=g+(A&y|~A&E)+_+b;return(T<>>32-v)+A}a(d,"FF");function f(g,A,y,E,_,v,b){var T=g+(A&E|y&~E)+_+b;return(T<>>32-v)+A}a(f,"GG");function h(g,A,y,E,_,v,b){var T=g+(A^y^E)+_+b;return(T<>>32-v)+A}a(h,"HH");function m(g,A,y,E,_,v,b){var T=g+(y^(A|~E))+_+b;return(T<>>32-v)+A}a(m,"II"),r.MD5=s._createHelper(u),r.HmacMD5=s._createHmacHelper(u)})(Math),t.MD5})});var bwt=I((p8e,O7r)=>{p();(function(t,e){typeof p8e=="object"?O7r.exports=p8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(p8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,s=e.algo,c=[],l=s.SHA1=o.extend({_doReset:a(function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(u,d){for(var f=this._hash.words,h=f[0],m=f[1],g=f[2],A=f[3],y=f[4],E=0;E<80;E++){if(E<16)c[E]=u[d+E]|0;else{var _=c[E-3]^c[E-8]^c[E-14]^c[E-16];c[E]=_<<1|_>>>31}var v=(h<<5|h>>>27)+y+c[E];E<20?v+=(m&g|~m&A)+1518500249:E<40?v+=(m^g^A)+1859775393:E<60?v+=(m&g|m&A|g&A)-1894007588:v+=(m^g^A)-899497514,y=A,A=g,g=m<<30|m>>>2,m=h,h=v}f[0]=f[0]+h|0,f[1]=f[1]+m|0,f[2]=f[2]+g|0,f[3]=f[3]+A|0,f[4]=f[4]+y|0},"_doProcessBlock"),_doFinalize:a(function(){var u=this._data,d=u.words,f=this._nDataBytes*8,h=u.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,u.sigBytes=d.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u},"clone")});e.SHA1=o._createHelper(l),e.HmacSHA1=o._createHmacHelper(l)})(),t.SHA1})});var m8e=I((h8e,B7r)=>{p();(function(t,e){typeof h8e=="object"?B7r.exports=h8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(h8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=[],u=[];(function(){function h(y){for(var E=e.sqrt(y),_=2;_<=E;_++)if(!(y%_))return!1;return!0}a(h,"isPrime");function m(y){return(y-(y|0))*4294967296|0}a(m,"getFractionalBits");for(var g=2,A=0;A<64;)h(g)&&(A<8&&(l[A]=m(e.pow(g,1/2))),u[A]=m(e.pow(g,1/3)),A++),g++})();var d=[],f=c.SHA256=s.extend({_doReset:a(function(){this._hash=new o.init(l.slice(0))},"_doReset"),_doProcessBlock:a(function(h,m){for(var g=this._hash.words,A=g[0],y=g[1],E=g[2],_=g[3],v=g[4],b=g[5],T=g[6],w=g[7],R=0;R<64;R++){if(R<16)d[R]=h[m+R]|0;else{var x=d[R-15],P=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,D=d[R-2],N=(D<<15|D>>>17)^(D<<13|D>>>19)^D>>>10;d[R]=P+d[R-7]+N+d[R-16]}var B=v&b^~v&T,L=A&y^A&E^y&E,j=(A<<30|A>>>2)^(A<<19|A>>>13)^(A<<10|A>>>22),M=(v<<26|v>>>6)^(v<<21|v>>>11)^(v<<7|v>>>25),O=w+M+B+u[R]+d[R],q=j+L;w=T,T=b,b=v,v=_+O|0,_=E,E=y,y=A,A=O+q|0}g[0]=g[0]+A|0,g[1]=g[1]+y|0,g[2]=g[2]+E|0,g[3]=g[3]+_|0,g[4]=g[4]+v|0,g[5]=g[5]+b|0,g[6]=g[6]+T|0,g[7]=g[7]+w|0},"_doProcessBlock"),_doFinalize:a(function(){var h=this._data,m=h.words,g=this._nDataBytes*8,A=h.sigBytes*8;return m[A>>>5]|=128<<24-A%32,m[(A+64>>>9<<4)+14]=e.floor(g/4294967296),m[(A+64>>>9<<4)+15]=g,h.sigBytes=m.length*4,this._process(),this._hash},"_doFinalize"),clone:a(function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h},"clone")});r.SHA256=s._createHelper(f),r.HmacSHA256=s._createHmacHelper(f)})(Math),t.SHA256})});var F7r=I((g8e,L7r)=>{p();(function(t,e,r){typeof g8e=="object"?L7r.exports=g8e=e(ea(),m8e()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(g8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,s=o.SHA256,c=o.SHA224=s.extend({_doReset:a(function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},"_doReset"),_doFinalize:a(function(){var l=s._doFinalize.call(this);return l.sigBytes-=4,l},"_doFinalize")});e.SHA224=s._createHelper(c),e.HmacSHA224=s._createHmacHelper(c)})(),t.SHA224})});var Swt=I((A8e,U7r)=>{p();(function(t,e,r){typeof A8e=="object"?U7r.exports=A8e=e(ea(),Y_e()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(A8e,function(t){return(function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,s=o.Word,c=o.WordArray,l=e.algo;function u(){return s.create.apply(s,arguments)}a(u,"X64Word_create");var d=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],f=[];(function(){for(var m=0;m<80;m++)f[m]=u()})();var h=l.SHA512=n.extend({_doReset:a(function(){this._hash=new c.init([new s.init(1779033703,4089235720),new s.init(3144134277,2227873595),new s.init(1013904242,4271175723),new s.init(2773480762,1595750129),new s.init(1359893119,2917565137),new s.init(2600822924,725511199),new s.init(528734635,4215389547),new s.init(1541459225,327033209)])},"_doReset"),_doProcessBlock:a(function(m,g){for(var A=this._hash.words,y=A[0],E=A[1],_=A[2],v=A[3],b=A[4],T=A[5],w=A[6],R=A[7],x=y.high,P=y.low,D=E.high,N=E.low,B=_.high,L=_.low,j=v.high,M=v.low,O=b.high,q=b.low,Q=T.high,U=T.low,z=w.high,W=w.low,$=R.high,J=R.low,ne=x,H=P,re=D,ae=N,Oe=B,ve=L,Fe=j,Pe=M,Z=O,ee=q,K=Q,pe=U,X=z,ue=W,qe=$,ie=J,le=0;le<80;le++){var Ne,we,Be=f[le];if(le<16)we=Be.high=m[g+le*2]|0,Ne=Be.low=m[g+le*2+1]|0;else{var tt=f[le-15],st=tt.high,Et=tt.low,kt=(st>>>1|Et<<31)^(st>>>8|Et<<24)^st>>>7,Gt=(Et>>>1|st<<31)^(Et>>>8|st<<24)^(Et>>>7|st<<25),jt=f[le-2],Ie=jt.high,F=jt.low,be=(Ie>>>19|F<<13)^(Ie<<3|F>>>29)^Ie>>>6,Ue=(F>>>19|Ie<<13)^(F<<3|Ie>>>29)^(F>>>6|Ie<<26),de=f[le-7],Se=de.high,Le=de.low,te=f[le-16],Te=te.high,Ge=te.low;Ne=Gt+Le,we=kt+Se+(Ne>>>0>>0?1:0),Ne=Ne+Ue,we=we+be+(Ne>>>0>>0?1:0),Ne=Ne+Ge,we=we+Te+(Ne>>>0>>0?1:0),Be.high=we,Be.low=Ne}var Y=Z&K^~Z&X,se=ee&pe^~ee&ue,he=ne&re^ne&Oe^re&Oe,Ce=H&ae^H&ve^ae&ve,He=(ne>>>28|H<<4)^(ne<<30|H>>>2)^(ne<<25|H>>>7),$e=(H>>>28|ne<<4)^(H<<30|ne>>>2)^(H<<25|ne>>>7),Xe=(Z>>>14|ee<<18)^(Z>>>18|ee<<14)^(Z<<23|ee>>>9),ct=(ee>>>14|Z<<18)^(ee>>>18|Z<<14)^(ee<<23|Z>>>9),bt=d[le],ht=bt.high,We=bt.low,ce=ie+ct,Re=qe+Xe+(ce>>>0>>0?1:0),ce=ce+se,Re=Re+Y+(ce>>>0>>0?1:0),ce=ce+We,Re=Re+ht+(ce>>>0>>0?1:0),ce=ce+Ne,Re=Re+we+(ce>>>0>>0?1:0),Me=$e+Ce,ge=He+he+(Me>>>0<$e>>>0?1:0);qe=X,ie=ue,X=K,ue=pe,K=Z,pe=ee,ee=Pe+ce|0,Z=Fe+Re+(ee>>>0>>0?1:0)|0,Fe=Oe,Pe=ve,Oe=re,ve=ae,re=ne,ae=H,H=ce+Me|0,ne=Re+ge+(H>>>0>>0?1:0)|0}P=y.low=P+H,y.high=x+ne+(P>>>0>>0?1:0),N=E.low=N+ae,E.high=D+re+(N>>>0>>0?1:0),L=_.low=L+ve,_.high=B+Oe+(L>>>0>>0?1:0),M=v.low=M+Pe,v.high=j+Fe+(M>>>0>>0?1:0),q=b.low=q+ee,b.high=O+Z+(q>>>0>>0?1:0),U=T.low=U+pe,T.high=Q+K+(U>>>0>>0?1:0),W=w.low=W+ue,w.high=z+X+(W>>>0>>0?1:0),J=R.low=J+ie,R.high=$+qe+(J>>>0>>0?1:0)},"_doProcessBlock"),_doFinalize:a(function(){var m=this._data,g=m.words,A=this._nDataBytes*8,y=m.sigBytes*8;g[y>>>5]|=128<<24-y%32,g[(y+128>>>10<<5)+30]=Math.floor(A/4294967296),g[(y+128>>>10<<5)+31]=A,m.sigBytes=g.length*4,this._process();var E=this._hash.toX32();return E},"_doFinalize"),clone:a(function(){var m=n.clone.call(this);return m._hash=this._hash.clone(),m},"clone"),blockSize:1024/32});e.SHA512=n._createHelper(h),e.HmacSHA512=n._createHmacHelper(h)})(),t.SHA512})});var q7r=I((y8e,Q7r)=>{p();(function(t,e,r){typeof y8e=="object"?Q7r.exports=y8e=e(ea(),Y_e(),Swt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(y8e,function(t){return(function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,s=e.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:a(function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},"_doReset"),_doFinalize:a(function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u},"_doFinalize")});e.SHA384=c._createHelper(l),e.HmacSHA384=c._createHmacHelper(l)})(),t.SHA384})});var H7r=I((E8e,j7r)=>{p();(function(t,e,r){typeof E8e=="object"?j7r.exports=E8e=e(ea(),Y_e()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(E8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.x64,l=c.Word,u=r.algo,d=[],f=[],h=[];(function(){for(var A=1,y=0,E=0;E<24;E++){d[A+5*y]=(E+1)*(E+2)/2%64;var _=y%5,v=(2*A+3*y)%5;A=_,y=v}for(var A=0;A<5;A++)for(var y=0;y<5;y++)f[A+5*y]=y+(2*A+3*y)%5*5;for(var b=1,T=0;T<24;T++){for(var w=0,R=0,x=0;x<7;x++){if(b&1){var P=(1<>>24)&16711935|(b<<24|b>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var w=E[v];w.high^=T,w.low^=b}for(var R=0;R<24;R++){for(var x=0;x<5;x++){for(var P=0,D=0,N=0;N<5;N++){var w=E[x+5*N];P^=w.high,D^=w.low}var B=m[x];B.high=P,B.low=D}for(var x=0;x<5;x++)for(var L=m[(x+4)%5],j=m[(x+1)%5],M=j.high,O=j.low,P=L.high^(M<<1|O>>>31),D=L.low^(O<<1|M>>>31),N=0;N<5;N++){var w=E[x+5*N];w.high^=P,w.low^=D}for(var q=1;q<25;q++){var P,D,w=E[q],Q=w.high,U=w.low,z=d[q];z<32?(P=Q<>>32-z,D=U<>>32-z):(P=U<>>64-z,D=Q<>>64-z);var W=m[f[q]];W.high=P,W.low=D}var $=m[0],J=E[0];$.high=J.high,$.low=J.low;for(var x=0;x<5;x++)for(var N=0;N<5;N++){var q=x+5*N,w=E[q],ne=m[q],H=m[(x+1)%5+5*N],re=m[(x+2)%5+5*N];w.high=ne.high^~H.high&re.high,w.low=ne.low^~H.low&re.low}var w=E[0],ae=h[R];w.high^=ae.high,w.low^=ae.low}},"_doProcessBlock"),_doFinalize:a(function(){var A=this._data,y=A.words,E=this._nDataBytes*8,_=A.sigBytes*8,v=this.blockSize*32;y[_>>>5]|=1<<24-_%32,y[(e.ceil((_+1)/v)*v>>>5)-1]|=128,A.sigBytes=y.length*4,this._process();for(var b=this._state,T=this.cfg.outputLength/8,w=T/8,R=[],x=0;x>>24)&16711935|(D<<24|D>>>8)&4278255360,N=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360,R.push(N),R.push(D)}return new o.init(R,T)},"_doFinalize"),clone:a(function(){for(var A=s.clone.call(this),y=A._state=this._state.slice(0),E=0;E<25;E++)y[E]=y[E].clone();return A},"clone")});r.SHA3=s._createHelper(g),r.HmacSHA3=s._createHmacHelper(g)})(Math),t.SHA3})});var $7r=I((_8e,G7r)=>{p();(function(t,e){typeof _8e=="object"?G7r.exports=_8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(_8e,function(t){return(function(e){var r=t,n=r.lib,o=n.WordArray,s=n.Hasher,c=r.algo,l=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=o.create([0,1518500249,1859775393,2400959708,2840853838]),m=o.create([1352829926,1548603684,1836072691,2053994217,0]),g=c.RIPEMD160=s.extend({_doReset:a(function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:a(function(T,w){for(var R=0;R<16;R++){var x=w+R,P=T[x];T[x]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var D=this._hash.words,N=h.words,B=m.words,L=l.words,j=u.words,M=d.words,O=f.words,q,Q,U,z,W,$,J,ne,H,re;$=q=D[0],J=Q=D[1],ne=U=D[2],H=z=D[3],re=W=D[4];for(var ae,R=0;R<80;R+=1)ae=q+T[w+L[R]]|0,R<16?ae+=A(Q,U,z)+N[0]:R<32?ae+=y(Q,U,z)+N[1]:R<48?ae+=E(Q,U,z)+N[2]:R<64?ae+=_(Q,U,z)+N[3]:ae+=v(Q,U,z)+N[4],ae=ae|0,ae=b(ae,M[R]),ae=ae+W|0,q=W,W=z,z=b(U,10),U=Q,Q=ae,ae=$+T[w+j[R]]|0,R<16?ae+=v(J,ne,H)+B[0]:R<32?ae+=_(J,ne,H)+B[1]:R<48?ae+=E(J,ne,H)+B[2]:R<64?ae+=y(J,ne,H)+B[3]:ae+=A(J,ne,H)+B[4],ae=ae|0,ae=b(ae,O[R]),ae=ae+re|0,$=re,re=H,H=b(ne,10),ne=J,J=ae;ae=D[1]+U+H|0,D[1]=D[2]+z+re|0,D[2]=D[3]+W+$|0,D[3]=D[4]+q+J|0,D[4]=D[0]+Q+ne|0,D[0]=ae},"_doProcessBlock"),_doFinalize:a(function(){var T=this._data,w=T.words,R=this._nDataBytes*8,x=T.sigBytes*8;w[x>>>5]|=128<<24-x%32,w[(x+64>>>9<<4)+14]=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T.sigBytes=(w.length+1)*4,this._process();for(var P=this._hash,D=P.words,N=0;N<5;N++){var B=D[N];D[N]=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360}return P},"_doFinalize"),clone:a(function(){var T=s.clone.call(this);return T._hash=this._hash.clone(),T},"clone")});function A(T,w,R){return T^w^R}a(A,"f1");function y(T,w,R){return T&w|~T&R}a(y,"f2");function E(T,w,R){return(T|~w)^R}a(E,"f3");function _(T,w,R){return T&R|w&~R}a(_,"f4");function v(T,w,R){return T^(w|~R)}a(v,"f5");function b(T,w){return T<>>32-w}a(b,"rotl"),r.RIPEMD160=s._createHelper(g),r.HmacRIPEMD160=s._createHmacHelper(g)})(Math),t.RIPEMD160})});var C8e=I((v8e,V7r)=>{p();(function(t,e){typeof v8e=="object"?V7r.exports=v8e=e(ea()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(v8e,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,s=o.Utf8,c=e.algo,l=c.HMAC=n.extend({init:a(function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=s.parse(d));var f=u.blockSize,h=f*4;d.sigBytes>h&&(d=u.finalize(d)),d.clamp();for(var m=this._oKey=d.clone(),g=this._iKey=d.clone(),A=m.words,y=g.words,E=0;E{p();(function(t,e,r){typeof b8e=="object"?W7r.exports=b8e=e(ea(),m8e(),C8e()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(b8e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.SHA256,l=s.HMAC,u=s.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:25e4}),init:a(function(d){this.cfg=this.cfg.extend(d)},"init"),compute:a(function(d,f){for(var h=this.cfg,m=l.create(h.hasher,d),g=o.create(),A=o.create([1]),y=g.words,E=A.words,_=h.keySize,v=h.iterations;y.length<_;){var b=m.update(f).finalize(A);m.reset();for(var T=b.words,w=T.length,R=b,x=1;x{p();(function(t,e,r){typeof S8e=="object"?Y7r.exports=S8e=e(ea(),bwt(),C8e()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(S8e,function(t){return(function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,s=e.algo,c=s.MD5,l=s.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:c,iterations:1}),init:a(function(u){this.cfg=this.cfg.extend(u)},"init"),compute:a(function(u,d){for(var f,h=this.cfg,m=h.hasher.create(),g=o.create(),A=g.words,y=h.keySize,E=h.iterations;A.length{p();(function(t,e,r){typeof T8e=="object"?K7r.exports=T8e=e(ea(),yB()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(T8e,function(t){t.lib.Cipher||(function(e){var r=t,n=r.lib,o=n.Base,s=n.WordArray,c=n.BufferedBlockAlgorithm,l=r.enc,u=l.Utf8,d=l.Base64,f=r.algo,h=f.EvpKDF,m=n.Cipher=c.extend({cfg:o.extend(),createEncryptor:a(function(B,L){return this.create(this._ENC_XFORM_MODE,B,L)},"createEncryptor"),createDecryptor:a(function(B,L){return this.create(this._DEC_XFORM_MODE,B,L)},"createDecryptor"),init:a(function(B,L,j){this.cfg=this.cfg.extend(j),this._xformMode=B,this._key=L,this.reset()},"init"),reset:a(function(){c.reset.call(this),this._doReset()},"reset"),process:a(function(B){return this._append(B),this._process()},"process"),finalize:a(function(B){B&&this._append(B);var L=this._doFinalize();return L},"finalize"),keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function B(L){return typeof L=="string"?N:x}return a(B,"selectCipherStrategy"),function(L){return{encrypt:a(function(j,M,O){return B(M).encrypt(L,j,M,O)},"encrypt"),decrypt:a(function(j,M,O){return B(M).decrypt(L,j,M,O)},"decrypt")}}})()}),g=n.StreamCipher=m.extend({_doFinalize:a(function(){var B=this._process(!0);return B},"_doFinalize"),blockSize:1}),A=r.mode={},y=n.BlockCipherMode=o.extend({createEncryptor:a(function(B,L){return this.Encryptor.create(B,L)},"createEncryptor"),createDecryptor:a(function(B,L){return this.Decryptor.create(B,L)},"createDecryptor"),init:a(function(B,L){this._cipher=B,this._iv=L},"init")}),E=A.CBC=(function(){var B=y.extend();B.Encryptor=B.extend({processBlock:a(function(j,M){var O=this._cipher,q=O.blockSize;L.call(this,j,M,q),O.encryptBlock(j,M),this._prevBlock=j.slice(M,M+q)},"processBlock")}),B.Decryptor=B.extend({processBlock:a(function(j,M){var O=this._cipher,q=O.blockSize,Q=j.slice(M,M+q);O.decryptBlock(j,M),L.call(this,j,M,q),this._prevBlock=Q},"processBlock")});function L(j,M,O){var q,Q=this._iv;Q?(q=Q,this._iv=e):q=this._prevBlock;for(var U=0;U>>2]&255;B.sigBytes-=L},"unpad")},b=n.BlockCipher=m.extend({cfg:m.cfg.extend({mode:E,padding:v}),reset:a(function(){var B;m.reset.call(this);var L=this.cfg,j=L.iv,M=L.mode;this._xformMode==this._ENC_XFORM_MODE?B=M.createEncryptor:(B=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==B?this._mode.init(this,j&&j.words):(this._mode=B.call(M,this,j&&j.words),this._mode.__creator=B)},"reset"),_doProcessBlock:a(function(B,L){this._mode.processBlock(B,L)},"_doProcessBlock"),_doFinalize:a(function(){var B,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),B=this._process(!0)):(B=this._process(!0),L.unpad(B)),B},"_doFinalize"),blockSize:128/32}),T=n.CipherParams=o.extend({init:a(function(B){this.mixIn(B)},"init"),toString:a(function(B){return(B||this.formatter).stringify(this)},"toString")}),w=r.format={},R=w.OpenSSL={stringify:a(function(B){var L,j=B.ciphertext,M=B.salt;return M?L=s.create([1398893684,1701076831]).concat(M).concat(j):L=j,L.toString(d)},"stringify"),parse:a(function(B){var L,j=d.parse(B),M=j.words;return M[0]==1398893684&&M[1]==1701076831&&(L=s.create(M.slice(2,4)),M.splice(0,4),j.sigBytes-=16),T.create({ciphertext:j,salt:L})},"parse")},x=n.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:a(function(B,L,j,M){M=this.cfg.extend(M);var O=B.createEncryptor(j,M),q=O.finalize(L),Q=O.cfg;return T.create({ciphertext:q,key:j,iv:Q.iv,algorithm:B,mode:Q.mode,padding:Q.padding,blockSize:B.blockSize,formatter:M.format})},"encrypt"),decrypt:a(function(B,L,j,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var O=B.createDecryptor(j,M).finalize(L.ciphertext);return O},"decrypt"),_parse:a(function(B,L){return typeof B=="string"?L.parse(B,this):B},"_parse")}),P=r.kdf={},D=P.OpenSSL={execute:a(function(B,L,j,M,O){if(M||(M=s.random(64/8)),O)var q=h.create({keySize:L+j,hasher:O}).compute(B,M);else var q=h.create({keySize:L+j}).compute(B,M);var Q=s.create(q.words.slice(L),j*4);return q.sigBytes=L*4,T.create({key:q,iv:Q,salt:M})},"execute")},N=n.PasswordBasedCipher=x.extend({cfg:x.cfg.extend({kdf:D}),encrypt:a(function(B,L,j,M){M=this.cfg.extend(M);var O=M.kdf.execute(j,B.keySize,B.ivSize,M.salt,M.hasher);M.iv=O.iv;var q=x.encrypt.call(this,B,L,O.key,M);return q.mixIn(O),q},"encrypt"),decrypt:a(function(B,L,j,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var O=M.kdf.execute(j,B.keySize,B.ivSize,L.salt,M.hasher);M.iv=O.iv;var q=x.decrypt.call(this,B,L,O.key,M);return q},"decrypt")})})()})});var Z7r=I((I8e,J7r)=>{p();(function(t,e,r){typeof I8e=="object"?J7r.exports=I8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(I8e,function(t){return t.mode.CFB=(function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize;r.call(this,n,o,c,s),this._prevBlock=n.slice(o,o+c)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=n.slice(o,o+c);r.call(this,n,o,c,s),this._prevBlock=l},"processBlock")});function r(n,o,s,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var d=0;d{p();(function(t,e,r){typeof x8e=="object"?X7r.exports=x8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(x8e,function(t){return t.mode.CTR=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var d=u.slice(0);s.encryptBlock(d,0),u[c-1]=u[c-1]+1|0;for(var f=0;f{p();(function(t,e,r){typeof w8e=="object"?tQr.exports=w8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(w8e,function(t){return t.mode.CTRGladman=(function(){var e=t.lib.BlockCipherMode.extend();function r(s){if((s>>24&255)===255){var c=s>>16&255,l=s>>8&255,u=s&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,s=0,s+=c<<16,s+=l<<8,s+=u}else s+=1<<24;return s}a(r,"incWord");function n(s){return(s[0]=r(s[0]))===0&&(s[1]=r(s[1])),s}a(n,"incCounter");var o=e.Encryptor=e.extend({processBlock:a(function(s,c){var l=this._cipher,u=l.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),n(f);var h=f.slice(0);l.encryptBlock(h,0);for(var m=0;m{p();(function(t,e,r){typeof R8e=="object"?nQr.exports=R8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(R8e,function(t){return t.mode.OFB=(function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:a(function(n,o){var s=this._cipher,c=s.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),s.encryptBlock(u,0);for(var d=0;d{p();(function(t,e,r){typeof P8e=="object"?oQr.exports=P8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(P8e,function(t){return t.mode.ECB=(function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:a(function(r,n){this._cipher.encryptBlock(r,n)},"processBlock")}),e.Decryptor=e.extend({processBlock:a(function(r,n){this._cipher.decryptBlock(r,n)},"processBlock")}),e})(),t.mode.ECB})});var cQr=I((k8e,aQr)=>{p();(function(t,e,r){typeof k8e=="object"?aQr.exports=k8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(k8e,function(t){return t.pad.AnsiX923={pad:a(function(e,r){var n=e.sigBytes,o=r*4,s=o-n%o,c=n+s-1;e.clamp(),e.words[c>>>2]|=s<<24-c%4*8,e.sigBytes+=s},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Ansix923})});var uQr=I((D8e,lQr)=>{p();(function(t,e,r){typeof D8e=="object"?lQr.exports=D8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(D8e,function(t){return t.pad.Iso10126={pad:a(function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},"pad"),unpad:a(function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r},"unpad")},t.pad.Iso10126})});var fQr=I((N8e,dQr)=>{p();(function(t,e,r){typeof N8e=="object"?dQr.exports=N8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(N8e,function(t){return t.pad.Iso97971={pad:a(function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},"pad"),unpad:a(function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--},"unpad")},t.pad.Iso97971})});var hQr=I((M8e,pQr)=>{p();(function(t,e,r){typeof M8e=="object"?pQr.exports=M8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(M8e,function(t){return t.pad.ZeroPadding={pad:a(function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},"pad"),unpad:a(function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}},"unpad")},t.pad.ZeroPadding})});var gQr=I((O8e,mQr)=>{p();(function(t,e,r){typeof O8e=="object"?mQr.exports=O8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(O8e,function(t){return t.pad.NoPadding={pad:a(function(){},"pad"),unpad:a(function(){},"unpad")},t.pad.NoPadding})});var yQr=I((B8e,AQr)=>{p();(function(t,e,r){typeof B8e=="object"?AQr.exports=B8e=e(ea(),R0()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(B8e,function(t){return(function(e){var r=t,n=r.lib,o=n.CipherParams,s=r.enc,c=s.Hex,l=r.format,u=l.Hex={stringify:a(function(d){return d.ciphertext.toString(c)},"stringify"),parse:a(function(d){var f=c.parse(d);return o.create({ciphertext:f})},"parse")}})(),t.format.Hex})});var _Qr=I((L8e,EQr)=>{p();(function(t,e,r){typeof L8e=="object"?EQr.exports=L8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(L8e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,s=[],c=[],l=[],u=[],d=[],f=[],h=[],m=[],g=[],A=[];(function(){for(var _=[],v=0;v<256;v++)v<128?_[v]=v<<1:_[v]=v<<1^283;for(var b=0,T=0,v=0;v<256;v++){var w=T^T<<1^T<<2^T<<3^T<<4;w=w>>>8^w&255^99,s[b]=w,c[w]=b;var R=_[b],x=_[R],P=_[x],D=_[w]*257^w*16843008;l[b]=D<<24|D>>>8,u[b]=D<<16|D>>>16,d[b]=D<<8|D>>>24,f[b]=D;var D=P*16843009^x*65537^R*257^b*16843008;h[w]=D<<24|D>>>8,m[w]=D<<16|D>>>16,g[w]=D<<8|D>>>24,A[w]=D,b?(b=R^_[_[_[P^R]]],T^=_[_[T]]):b=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],E=o.AES=n.extend({_doReset:a(function(){var _;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var v=this._keyPriorReset=this._key,b=v.words,T=v.sigBytes/4,w=this._nRounds=T+6,R=(w+1)*4,x=this._keySchedule=[],P=0;P6&&P%T==4&&(_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255]):(_=_<<8|_>>>24,_=s[_>>>24]<<24|s[_>>>16&255]<<16|s[_>>>8&255]<<8|s[_&255],_^=y[P/T|0]<<24),x[P]=x[P-T]^_);for(var D=this._invKeySchedule=[],N=0;N>>24]]^m[s[_>>>16&255]]^g[s[_>>>8&255]]^A[s[_&255]]}}},"_doReset"),encryptBlock:a(function(_,v){this._doCryptBlock(_,v,this._keySchedule,l,u,d,f,s)},"encryptBlock"),decryptBlock:a(function(_,v){var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b,this._doCryptBlock(_,v,this._invKeySchedule,h,m,g,A,c);var b=_[v+1];_[v+1]=_[v+3],_[v+3]=b},"decryptBlock"),_doCryptBlock:a(function(_,v,b,T,w,R,x,P){for(var D=this._nRounds,N=_[v]^b[0],B=_[v+1]^b[1],L=_[v+2]^b[2],j=_[v+3]^b[3],M=4,O=1;O>>24]^w[B>>>16&255]^R[L>>>8&255]^x[j&255]^b[M++],Q=T[B>>>24]^w[L>>>16&255]^R[j>>>8&255]^x[N&255]^b[M++],U=T[L>>>24]^w[j>>>16&255]^R[N>>>8&255]^x[B&255]^b[M++],z=T[j>>>24]^w[N>>>16&255]^R[B>>>8&255]^x[L&255]^b[M++];N=q,B=Q,L=U,j=z}var q=(P[N>>>24]<<24|P[B>>>16&255]<<16|P[L>>>8&255]<<8|P[j&255])^b[M++],Q=(P[B>>>24]<<24|P[L>>>16&255]<<16|P[j>>>8&255]<<8|P[N&255])^b[M++],U=(P[L>>>24]<<24|P[j>>>16&255]<<16|P[N>>>8&255]<<8|P[B&255])^b[M++],z=(P[j>>>24]<<24|P[N>>>16&255]<<16|P[B>>>8&255]<<8|P[L&255])^b[M++];_[v]=q,_[v+1]=Q,_[v+2]=U,_[v+3]=z},"_doCryptBlock"),keySize:256/32});e.AES=n._createHelper(E)})(),t.AES})});var CQr=I((F8e,vQr)=>{p();(function(t,e,r){typeof F8e=="object"?vQr.exports=F8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(F8e,function(t){return(function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,s=e.algo,c=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],l=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=o.extend({_doReset:a(function(){for(var y=this._key,E=y.words,_=[],v=0;v<56;v++){var b=c[v]-1;_[v]=E[b>>>5]>>>31-b%32&1}for(var T=this._subKeys=[],w=0;w<16;w++){for(var R=T[w]=[],x=u[w],v=0;v<24;v++)R[v/6|0]|=_[(l[v]-1+x)%28]<<31-v%6,R[4+(v/6|0)]|=_[28+(l[v+24]-1+x)%28]<<31-v%6;R[0]=R[0]<<1|R[0]>>>31;for(var v=1;v<7;v++)R[v]=R[v]>>>(v-1)*4+3;R[7]=R[7]<<5|R[7]>>>27}for(var P=this._invSubKeys=[],v=0;v<16;v++)P[v]=T[15-v]},"_doReset"),encryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._subKeys)},"encryptBlock"),decryptBlock:a(function(y,E){this._doCryptBlock(y,E,this._invSubKeys)},"decryptBlock"),_doCryptBlock:a(function(y,E,_){this._lBlock=y[E],this._rBlock=y[E+1],m.call(this,4,252645135),m.call(this,16,65535),g.call(this,2,858993459),g.call(this,8,16711935),m.call(this,1,1431655765);for(var v=0;v<16;v++){for(var b=_[v],T=this._lBlock,w=this._rBlock,R=0,x=0;x<8;x++)R|=d[x][((w^b[x])&f[x])>>>0];this._lBlock=w,this._rBlock=T^R}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,m.call(this,1,1431655765),g.call(this,8,16711935),g.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),y[E]=this._lBlock,y[E+1]=this._rBlock},"_doCryptBlock"),keySize:64/32,ivSize:64/32,blockSize:64/32});function m(y,E){var _=(this._lBlock>>>y^this._rBlock)&E;this._rBlock^=_,this._lBlock^=_<>>y^this._lBlock)&E;this._lBlock^=_,this._rBlock^=_<192.");var _=E.slice(0,2),v=E.length<4?E.slice(0,2):E.slice(2,4),b=E.length<6?E.slice(0,2):E.slice(4,6);this._des1=h.createEncryptor(n.create(_)),this._des2=h.createEncryptor(n.create(v)),this._des3=h.createEncryptor(n.create(b))},"_doReset"),encryptBlock:a(function(y,E){this._des1.encryptBlock(y,E),this._des2.decryptBlock(y,E),this._des3.encryptBlock(y,E)},"encryptBlock"),decryptBlock:a(function(y,E){this._des3.decryptBlock(y,E),this._des2.encryptBlock(y,E),this._des1.decryptBlock(y,E)},"decryptBlock"),keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(A)})(),t.TripleDES})});var SQr=I((U8e,bQr)=>{p();(function(t,e,r){typeof U8e=="object"?bQr.exports=U8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(U8e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=o.RC4=n.extend({_doReset:a(function(){for(var u=this._key,d=u.words,f=u.sigBytes,h=this._S=[],m=0;m<256;m++)h[m]=m;for(var m=0,g=0;m<256;m++){var A=m%f,y=d[A>>>2]>>>24-A%4*8&255;g=(g+h[m]+y)%256;var E=h[m];h[m]=h[g],h[g]=E}this._i=this._j=0},"_doReset"),_doProcessBlock:a(function(u,d){u[d]^=c.call(this)},"_doProcessBlock"),keySize:256/32,ivSize:0});function c(){for(var u=this._S,d=this._i,f=this._j,h=0,m=0;m<4;m++){d=(d+1)%256,f=(f+u[d])%256;var g=u[d];u[d]=u[f],u[f]=g,h|=u[(u[d]+u[f])%256]<<24-m*8}return this._i=d,this._j=f,h}a(c,"generateKeystreamWord"),e.RC4=n._createHelper(s);var l=o.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:a(function(){s._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)},"_doReset")});e.RC4Drop=n._createHelper(l)})(),t.RC4})});var IQr=I((Q8e,TQr)=>{p();(function(t,e,r){typeof Q8e=="object"?TQr.exports=Q8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(Q8e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.Rabbit=n.extend({_doReset:a(function(){for(var f=this._key.words,h=this.cfg.iv,m=0;m<4;m++)f[m]=(f[m]<<8|f[m]>>>24)&16711935|(f[m]<<24|f[m]>>>8)&4278255360;var g=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],A=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var m=0;m<4;m++)d.call(this);for(var m=0;m<8;m++)A[m]^=g[m+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;A[0]^=v,A[1]^=T,A[2]^=b,A[3]^=w,A[4]^=v,A[5]^=T,A[6]^=b,A[7]^=w;for(var m=0;m<4;m++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.Rabbit=n._createHelper(u)})(),t.Rabbit})});var wQr=I((q8e,xQr)=>{p();(function(t,e,r){typeof q8e=="object"?xQr.exports=q8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(q8e,function(t){return(function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,s=[],c=[],l=[],u=o.RabbitLegacy=n.extend({_doReset:a(function(){var f=this._key.words,h=this.cfg.iv,m=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],g=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var A=0;A<4;A++)d.call(this);for(var A=0;A<8;A++)g[A]^=m[A+4&7];if(h){var y=h.words,E=y[0],_=y[1],v=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,b=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,T=v>>>16|b&4294901760,w=b<<16|v&65535;g[0]^=v,g[1]^=T,g[2]^=b,g[3]^=w,g[4]^=v,g[5]^=T,g[6]^=b,g[7]^=w;for(var A=0;A<4;A++)d.call(this)}},"_doReset"),_doProcessBlock:a(function(f,h){var m=this._X;d.call(this),s[0]=m[0]^m[5]>>>16^m[3]<<16,s[1]=m[2]^m[7]>>>16^m[5]<<16,s[2]=m[4]^m[1]>>>16^m[7]<<16,s[3]=m[6]^m[3]>>>16^m[1]<<16;for(var g=0;g<4;g++)s[g]=(s[g]<<8|s[g]>>>24)&16711935|(s[g]<<24|s[g]>>>8)&4278255360,f[h+g]^=s[g]},"_doProcessBlock"),blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,m=0;m<8;m++)c[m]=h[m];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var m=0;m<8;m++){var g=f[m]+h[m],A=g&65535,y=g>>>16,E=((A*A>>>17)+A*y>>>15)+y*y,_=((g&4294901760)*g|0)+((g&65535)*g|0);l[m]=E^_}f[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,f[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,f[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,f[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,f[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,f[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,f[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,f[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}a(d,"nextState"),e.RabbitLegacy=n._createHelper(u)})(),t.RabbitLegacy})});var PQr=I((j8e,RQr)=>{p();(function(t,e,r){typeof j8e=="object"?RQr.exports=j8e=e(ea(),E9(),_9(),yB(),R0()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(j8e,function(t){return(function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let s=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function d(A,y){let E=y>>24&255,_=y>>16&255,v=y>>8&255,b=y&255,T=A.sbox[0][E]+A.sbox[1][_];return T=T^A.sbox[2][v],T=T+A.sbox[3][b],T}a(d,"F");function f(A,y,E){let _=y,v=E,b;for(let T=0;T1;--T)_=_^A.pbox[T],v=d(A,_)^v,b=_,_=v,v=b;return b=_,_=v,v=b,v=v^A.pbox[1],_=_^A.pbox[0],{left:_,right:v}}a(h,"BlowFish_Decrypt");function m(A,y,E){for(let w=0;w<4;w++){A.sbox[w]=[];for(let R=0;R<256;R++)A.sbox[w][R]=l[w][R]}let _=0;for(let w=0;w=E&&(_=0);let v=0,b=0,T=0;for(let w=0;w{p();(function(t,e,r){typeof H8e=="object"?kQr.exports=H8e=e(ea(),Y_e(),w7r(),P7r(),E9(),N7r(),_9(),bwt(),m8e(),F7r(),Swt(),q7r(),H7r(),$7r(),C8e(),z7r(),yB(),R0(),Z7r(),eQr(),rQr(),iQr(),sQr(),cQr(),uQr(),fQr(),hQr(),gQr(),yQr(),_Qr(),CQr(),SQr(),IQr(),wQr(),PQr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(H8e,function(t){return t})});var Qie=I(Sy=>{"use strict";p();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.stringArray=Sy.array=Sy.func=Sy.error=Sy.number=Sy.string=Sy.boolean=void 0;function vfo(t){return t===!0||t===!1}a(vfo,"boolean");Sy.boolean=vfo;function fHr(t){return typeof t=="string"||t instanceof String}a(fHr,"string");Sy.string=fHr;function Cfo(t){return typeof t=="number"||t instanceof Number}a(Cfo,"number");Sy.number=Cfo;function bfo(t){return t instanceof Error}a(bfo,"error");Sy.error=bfo;function Sfo(t){return typeof t=="function"}a(Sfo,"func");Sy.func=Sfo;function pHr(t){return Array.isArray(t)}a(pHr,"array");Sy.array=pHr;function Tfo(t){return pHr(t)&&t.every(e=>fHr(e))}a(Tfo,"stringArray");Sy.stringArray=Tfo});var YRt=I(di=>{"use strict";p();Object.defineProperty(di,"__esModule",{value:!0});di.Message=di.NotificationType9=di.NotificationType8=di.NotificationType7=di.NotificationType6=di.NotificationType5=di.NotificationType4=di.NotificationType3=di.NotificationType2=di.NotificationType1=di.NotificationType0=di.NotificationType=di.RequestType9=di.RequestType8=di.RequestType7=di.RequestType6=di.RequestType5=di.RequestType4=di.RequestType3=di.RequestType2=di.RequestType1=di.RequestType=di.RequestType0=di.AbstractMessageSignature=di.ParameterStructures=di.ResponseError=di.ErrorCodes=void 0;var GV=Qie(),TRt;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3})(TRt||(di.ErrorCodes=TRt={}));var IRt=class t extends Error{static{a(this,"ResponseError")}constructor(e,r,n){super(r),this.code=GV.number(e)?e:TRt.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};di.ResponseError=IRt;var Wv=class t{static{a(this,"ParameterStructures")}constructor(e){this.kind=e}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};di.ParameterStructures=Wv;Wv.auto=new Wv("auto");Wv.byPosition=new Wv("byPosition");Wv.byName=new Wv("byName");var Ou=class{static{a(this,"AbstractMessageSignature")}constructor(e,r){this.method=e,this.numberOfParams=r}get parameterStructures(){return Wv.auto}};di.AbstractMessageSignature=Ou;var xRt=class extends Ou{static{a(this,"RequestType0")}constructor(e){super(e,0)}};di.RequestType0=xRt;var wRt=class extends Ou{static{a(this,"RequestType")}constructor(e,r=Wv.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.RequestType=wRt;var RRt=class extends Ou{static{a(this,"RequestType1")}constructor(e,r=Wv.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.RequestType1=RRt;var PRt=class extends Ou{static{a(this,"RequestType2")}constructor(e){super(e,2)}};di.RequestType2=PRt;var kRt=class extends Ou{static{a(this,"RequestType3")}constructor(e){super(e,3)}};di.RequestType3=kRt;var DRt=class extends Ou{static{a(this,"RequestType4")}constructor(e){super(e,4)}};di.RequestType4=DRt;var NRt=class extends Ou{static{a(this,"RequestType5")}constructor(e){super(e,5)}};di.RequestType5=NRt;var MRt=class extends Ou{static{a(this,"RequestType6")}constructor(e){super(e,6)}};di.RequestType6=MRt;var ORt=class extends Ou{static{a(this,"RequestType7")}constructor(e){super(e,7)}};di.RequestType7=ORt;var BRt=class extends Ou{static{a(this,"RequestType8")}constructor(e){super(e,8)}};di.RequestType8=BRt;var LRt=class extends Ou{static{a(this,"RequestType9")}constructor(e){super(e,9)}};di.RequestType9=LRt;var FRt=class extends Ou{static{a(this,"NotificationType")}constructor(e,r=Wv.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.NotificationType=FRt;var URt=class extends Ou{static{a(this,"NotificationType0")}constructor(e){super(e,0)}};di.NotificationType0=URt;var QRt=class extends Ou{static{a(this,"NotificationType1")}constructor(e,r=Wv.auto){super(e,1),this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};di.NotificationType1=QRt;var qRt=class extends Ou{static{a(this,"NotificationType2")}constructor(e){super(e,2)}};di.NotificationType2=qRt;var jRt=class extends Ou{static{a(this,"NotificationType3")}constructor(e){super(e,3)}};di.NotificationType3=jRt;var HRt=class extends Ou{static{a(this,"NotificationType4")}constructor(e){super(e,4)}};di.NotificationType4=HRt;var GRt=class extends Ou{static{a(this,"NotificationType5")}constructor(e){super(e,5)}};di.NotificationType5=GRt;var $Rt=class extends Ou{static{a(this,"NotificationType6")}constructor(e){super(e,6)}};di.NotificationType6=$Rt;var VRt=class extends Ou{static{a(this,"NotificationType7")}constructor(e){super(e,7)}};di.NotificationType7=VRt;var WRt=class extends Ou{static{a(this,"NotificationType8")}constructor(e){super(e,8)}};di.NotificationType8=WRt;var zRt=class extends Ou{static{a(this,"NotificationType9")}constructor(e){super(e,9)}};di.NotificationType9=zRt;var hHr;(function(t){function e(o){let s=o;return s&&GV.string(s.method)&&(GV.string(s.id)||GV.number(s.id))}a(e,"isRequest"),t.isRequest=e;function r(o){let s=o;return s&&GV.string(s.method)&&o.id===void 0}a(r,"isNotification"),t.isNotification=r;function n(o){let s=o;return s&&(s.result!==void 0||!!s.error)&&(GV.string(s.id)||GV.number(s.id)||s.id===null)}a(n,"isResponse"),t.isResponse=n})(hHr||(di.Message=hHr={}))});var JRt=I(O9=>{"use strict";p();var mHr;Object.defineProperty(O9,"__esModule",{value:!0});O9.LRUCache=O9.LinkedMap=O9.Touch=void 0;var Ty;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last})(Ty||(O9.Touch=Ty={}));var T6e=class{static{a(this,"LinkedMap")}constructor(){this[mHr]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=Ty.None){let n=this._map.get(e);if(n)return r!==Ty.None&&this.touch(n,r),n.value}set(e,r,n=Ty.None){let o=this._map.get(e);if(o)o.value=r,n!==Ty.None&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case Ty.None:this.addItemLast(o);break;case Ty.First:this.addItemFirst(o);break;case Ty.Last:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:a(()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}},"next")};return n}[(mHr=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==Ty.First&&r!==Ty.Last)){if(r===Ty.First){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===Ty.Last){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};O9.LinkedMap=T6e;var KRt=class extends T6e{static{a(this,"LRUCache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=Ty.AsNew){return super.get(e,r)}peek(e){return super.get(e,Ty.None)}set(e,r){return super.set(e,r,Ty.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};O9.LRUCache=KRt});var AHr=I(I6e=>{"use strict";p();Object.defineProperty(I6e,"__esModule",{value:!0});I6e.Disposable=void 0;var gHr;(function(t){function e(r){return{dispose:r}}a(e,"create"),t.create=e})(gHr||(I6e.Disposable=gHr={}))});var B9=I(ePt=>{"use strict";p();Object.defineProperty(ePt,"__esModule",{value:!0});var ZRt;function XRt(){if(ZRt===void 0)throw new Error("No runtime abstraction layer installed");return ZRt}a(XRt,"RAL");(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");ZRt=r}a(e,"install"),t.install=e})(XRt||(XRt={}));ePt.default=XRt});var jie=I(qie=>{"use strict";p();Object.defineProperty(qie,"__esModule",{value:!0});qie.Emitter=qie.Event=void 0;var Ifo=B9(),yHr;(function(t){let e={dispose(){}};t.None=function(){return e}})(yHr||(qie.Event=yHr={}));var tPt=class{static{a(this,"CallbackList")}add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:a(()=>this.remove(e,r),"dispose")})}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let o=0,s=this._callbacks.length;o{this._callbacks||(this._callbacks=new tPt),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let o={dispose:a(()=>{this._callbacks&&(this._callbacks.remove(e,r),o.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))},"dispose")};return Array.isArray(n)&&n.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};qie.Emitter=x6e;x6e._noop=function(){}});var P6e=I(Hie=>{"use strict";p();Object.defineProperty(Hie,"__esModule",{value:!0});Hie.CancellationTokenSource=Hie.CancellationToken=void 0;var xfo=B9(),wfo=Qie(),rPt=jie(),w6e;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:rPt.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rPt.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||wfo.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}a(e,"is"),t.is=e})(w6e||(Hie.CancellationToken=w6e={}));var Rfo=Object.freeze(function(t,e){let r=(0,xfo.default)().timer.setTimeout(t.bind(e),0);return{dispose(){r.dispose()}}}),R6e=class{static{a(this,"MutableToken")}constructor(){this._isCancelled=!1}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?Rfo:(this._emitter||(this._emitter=new rPt.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},nPt=class{static{a(this,"CancellationTokenSource")}get token(){return this._token||(this._token=new R6e),this._token}cancel(){this._token?this._token.cancel():this._token=w6e.Cancelled}dispose(){this._token?this._token instanceof R6e&&this._token.dispose():this._token=w6e.None}};Hie.CancellationTokenSource=nPt});var EHr=I(Gie=>{"use strict";p();Object.defineProperty(Gie,"__esModule",{value:!0});Gie.SharedArrayReceiverStrategy=Gie.SharedArraySenderStrategy=void 0;var Pfo=P6e(),mve;(function(t){t.Continue=0,t.Cancelled=1})(mve||(mve={}));var iPt=class{static{a(this,"SharedArraySenderStrategy")}constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=mve.Continue,this.buffers.set(e.id,r),e.$cancellationData=r}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let o=new Int32Array(n,0,1);Atomics.store(o,0,mve.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};Gie.SharedArraySenderStrategy=iPt;var oPt=class{static{a(this,"SharedArrayBufferCancellationToken")}constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===mve.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},sPt=class{static{a(this,"SharedArrayBufferCancellationTokenSource")}constructor(e){this.token=new oPt(e)}cancel(){}dispose(){}},aPt=class{static{a(this,"SharedArrayReceiverStrategy")}constructor(){this.kind="request"}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new Pfo.CancellationTokenSource:new sPt(r)}};Gie.SharedArrayReceiverStrategy=aPt});var lPt=I(k6e=>{"use strict";p();Object.defineProperty(k6e,"__esModule",{value:!0});k6e.Semaphore=void 0;var kfo=B9(),cPt=class{static{a(this,"Semaphore")}constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,kfo.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(r),this.runNext())}catch(r){this._active--,e.reject(r),this.runNext()}}};k6e.Semaphore=cPt});var vHr=I(L9=>{"use strict";p();Object.defineProperty(L9,"__esModule",{value:!0});L9.ReadableStreamMessageReader=L9.AbstractMessageReader=L9.MessageReader=void 0;var dPt=B9(),$ie=Qie(),uPt=jie(),Dfo=lPt(),_Hr;(function(t){function e(r){let n=r;return n&&$ie.func(n.listen)&&$ie.func(n.dispose)&&$ie.func(n.onError)&&$ie.func(n.onClose)&&$ie.func(n.onPartialMessage)}a(e,"is"),t.is=e})(_Hr||(L9.MessageReader=_Hr={}));var D6e=class{static{a(this,"AbstractMessageReader")}constructor(){this.errorEmitter=new uPt.Emitter,this.closeEmitter=new uPt.Emitter,this.partialMessageEmitter=new uPt.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${$ie.string(e.message)?e.message:"unknown"}`)}};L9.AbstractMessageReader=D6e;var fPt;(function(t){function e(r){let n,o,s,c=new Map,l,u=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else{if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,c.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)c.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(l=r.contentTypeDecoder,u.set(l.name,l)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)u.set(d.name,d)}return l===void 0&&(l=(0,dPt.default)().applicationJson.decoder,u.set(l.name,l)),{charset:n,contentDecoder:s,contentDecoders:c,contentTypeDecoder:l,contentTypeDecoders:u}}a(e,"fromOptions"),t.fromOptions=e})(fPt||(fPt={}));var pPt=class extends D6e{static{a(this,"ReadableStreamMessageReader")}constructor(e,r){super(),this.readable=e,this.options=fPt.fromOptions(r),this.buffer=(0,dPt.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new Dfo.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n)});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let o=n.get("content-length");if(!o){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(o);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${o}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,o=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(o)}).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,dPt.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};L9.ReadableStreamMessageReader=pPt});var IHr=I(F9=>{"use strict";p();Object.defineProperty(F9,"__esModule",{value:!0});F9.WriteableStreamMessageWriter=F9.AbstractMessageWriter=F9.MessageWriter=void 0;var CHr=B9(),gve=Qie(),Nfo=lPt(),bHr=jie(),Mfo="Content-Length: ",SHr=`\r +`,THr;(function(t){function e(r){let n=r;return n&&gve.func(n.dispose)&&gve.func(n.onClose)&&gve.func(n.onError)&&gve.func(n.write)}a(e,"is"),t.is=e})(THr||(F9.MessageWriter=THr={}));var N6e=class{static{a(this,"AbstractMessageWriter")}constructor(){this.errorEmitter=new bHr.Emitter,this.closeEmitter=new bHr.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${gve.string(e.message)?e.message:"unknown"}`)}};F9.AbstractMessageWriter=N6e;var hPt;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,CHr.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,CHr.default)().applicationJson.encoder}}a(e,"fromOptions"),t.fromOptions=e})(hPt||(hPt={}));var mPt=class extends N6e{static{a(this,"WriteableStreamMessageWriter")}constructor(e,r){super(),this.writable=e,this.options=hPt.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Nfo.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let o=[];return o.push(Mfo,n.byteLength.toString(),SHr),o.push(SHr),this.doWrite(e,o,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(o){return this.handleError(o,e),Promise.reject(o)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};F9.WriteableStreamMessageWriter=mPt});var xHr=I(M6e=>{"use strict";p();Object.defineProperty(M6e,"__esModule",{value:!0});M6e.AbstractMessageBuffer=void 0;var Ofo=13,Bfo=10,Lfo=`\r +`,gPt=class{static{a(this,"AbstractMessageBuffer")}constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,o=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],c=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,c}let r=this.allocNative(e),n=0,o=0;for(;e>0;){let s=this._chunks[o];if(s.byteLength>e){let c=s.slice(0,e);r.set(c,n),n+=e,this._chunks[o]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};M6e.AbstractMessageBuffer=gPt});var DHr=I(No=>{"use strict";p();Object.defineProperty(No,"__esModule",{value:!0});No.createMessageConnection=No.ConnectionOptions=No.MessageStrategy=No.CancellationStrategy=No.CancellationSenderStrategy=No.CancellationReceiverStrategy=No.RequestCancellationReceiverStrategy=No.IdCancellationReceiverStrategy=No.ConnectionStrategy=No.ConnectionError=No.ConnectionErrors=No.LogTraceNotification=No.SetTraceNotification=No.TraceFormat=No.TraceValues=No.Trace=No.NullLogger=No.ProgressType=No.ProgressToken=void 0;var wHr=B9(),Zd=Qie(),$i=YRt(),RHr=JRt(),Ave=jie(),APt=P6e(),_ve;(function(t){t.type=new $i.NotificationType("$/cancelRequest")})(_ve||(_ve={}));var yPt;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}a(e,"is"),t.is=e})(yPt||(No.ProgressToken=yPt={}));var yve;(function(t){t.type=new $i.NotificationType("$/progress")})(yve||(yve={}));var EPt=class{static{a(this,"ProgressType")}constructor(){}};No.ProgressType=EPt;var _Pt;(function(t){function e(r){return Zd.func(r)}a(e,"is"),t.is=e})(_Pt||(_Pt={}));No.NullLogger=Object.freeze({error:a(()=>{},"error"),warn:a(()=>{},"warn"),info:a(()=>{},"info"),log:a(()=>{},"log")});var yc;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose"})(yc||(No.Trace=yc={}));var PHr;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose"})(PHr||(No.TraceValues=PHr={}));(function(t){function e(n){if(!Zd.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}a(e,"fromString"),t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}a(r,"toString"),t.toString=r})(yc||(No.Trace=yc={}));var S1;(function(t){t.Text="text",t.JSON="json"})(S1||(No.TraceFormat=S1={}));(function(t){function e(r){return Zd.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}a(e,"fromString"),t.fromString=e})(S1||(No.TraceFormat=S1={}));var vPt;(function(t){t.type=new $i.NotificationType("$/setTrace")})(vPt||(No.SetTraceNotification=vPt={}));var O6e;(function(t){t.type=new $i.NotificationType("$/logTrace")})(O6e||(No.LogTraceNotification=O6e={}));var Eve;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening"})(Eve||(No.ConnectionErrors=Eve={}));var Vie=class t extends Error{static{a(this,"ConnectionError")}constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};No.ConnectionError=Vie;var CPt;(function(t){function e(r){let n=r;return n&&Zd.func(n.cancelUndispatched)}a(e,"is"),t.is=e})(CPt||(No.ConnectionStrategy=CPt={}));var B6e;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Zd.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Zd.func(n.dispose))}a(e,"is"),t.is=e})(B6e||(No.IdCancellationReceiverStrategy=B6e={}));var bPt;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Zd.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Zd.func(n.dispose))}a(e,"is"),t.is=e})(bPt||(No.RequestCancellationReceiverStrategy=bPt={}));var L6e;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new APt.CancellationTokenSource}});function e(r){return B6e.is(r)||bPt.is(r)}a(e,"is"),t.is=e})(L6e||(No.CancellationReceiverStrategy=L6e={}));var F6e;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(_ve.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Zd.func(n.sendCancellation)&&Zd.func(n.cleanup)}a(e,"is"),t.is=e})(F6e||(No.CancellationSenderStrategy=F6e={}));var U6e;(function(t){t.Message=Object.freeze({receiver:L6e.Message,sender:F6e.Message});function e(r){let n=r;return n&&L6e.is(n.receiver)&&F6e.is(n.sender)}a(e,"is"),t.is=e})(U6e||(No.CancellationStrategy=U6e={}));var Q6e;(function(t){function e(r){let n=r;return n&&Zd.func(n.handleMessage)}a(e,"is"),t.is=e})(Q6e||(No.MessageStrategy=Q6e={}));var kHr;(function(t){function e(r){let n=r;return n&&(U6e.is(n.cancellationStrategy)||CPt.is(n.connectionStrategy)||Q6e.is(n.messageStrategy))}a(e,"is"),t.is=e})(kHr||(No.ConnectionOptions=kHr={}));var AP;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed"})(AP||(AP={}));function Ffo(t,e,r,n){let o=r!==void 0?r:No.NullLogger,s=0,c=0,l=0,u="2.0",d,f=new Map,h,m=new Map,g=new Map,A,y=new RHr.LinkedMap,E=new Map,_=new Set,v=new Map,b=yc.Off,T=S1.Text,w,R=AP.New,x=new Ave.Emitter,P=new Ave.Emitter,D=new Ave.Emitter,N=new Ave.Emitter,B=new Ave.Emitter,L=n&&n.cancellationStrategy?n.cancellationStrategy:U6e.Message;function j(Ie){if(Ie===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+Ie.toString()}a(j,"createRequestQueueKey");function M(Ie){return Ie===null?"res-unknown-"+(++l).toString():"res-"+Ie.toString()}a(M,"createResponseQueueKey");function O(){return"not-"+(++c).toString()}a(O,"createNotificationQueueKey");function q(Ie,F){$i.Message.isRequest(F)?Ie.set(j(F.id),F):$i.Message.isResponse(F)?Ie.set(M(F.id),F):Ie.set(O(),F)}a(q,"addMessageToQueue");function Q(Ie){}a(Q,"cancelUndispatched");function U(){return R===AP.Listening}a(U,"isListening");function z(){return R===AP.Closed}a(z,"isClosed");function W(){return R===AP.Disposed}a(W,"isDisposed");function $(){(R===AP.New||R===AP.Listening)&&(R=AP.Closed,P.fire(void 0))}a($,"closeHandler");function J(Ie){x.fire([Ie,void 0,void 0])}a(J,"readErrorHandler");function ne(Ie){x.fire(Ie)}a(ne,"writeErrorHandler"),t.onClose($),t.onError(J),e.onClose($),e.onError(ne);function H(){A||y.size===0||(A=(0,wHr.default)().timer.setImmediate(()=>{A=void 0,ae()}))}a(H,"triggerMessageQueue");function re(Ie){$i.Message.isRequest(Ie)?ve(Ie):$i.Message.isNotification(Ie)?Pe(Ie):$i.Message.isResponse(Ie)?Fe(Ie):Z(Ie)}a(re,"handleMessage");function ae(){if(y.size===0)return;let Ie=y.shift();try{let F=n?.messageStrategy;Q6e.is(F)?F.handleMessage(Ie,re):re(Ie)}finally{H()}}a(ae,"processMessageQueue");let Oe=a(Ie=>{try{if($i.Message.isNotification(Ie)&&Ie.method===_ve.type.method){let F=Ie.params.id,be=j(F),Ue=y.get(be);if($i.Message.isRequest(Ue)){let Se=n?.connectionStrategy,Le=Se&&Se.cancelUndispatched?Se.cancelUndispatched(Ue,Q):void 0;if(Le&&(Le.error!==void 0||Le.result!==void 0)){y.delete(be),v.delete(F),Le.id=Ue.id,X(Le,Ie.method,Date.now()),e.write(Le).catch(()=>o.error("Sending response for canceled message failed."));return}}let de=v.get(F);if(de!==void 0){de.cancel(),qe(Ie);return}else _.add(F)}q(y,Ie)}finally{H()}},"callback");function ve(Ie){if(W())return;function F(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id};Te instanceof $i.ResponseError?se.error=Te.toJson():se.result=Te===void 0?null:Te,X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(F,"reply");function be(Te,Ge,Y){let se={jsonrpc:u,id:Ie.id,error:Te.toJson()};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(be,"replyError");function Ue(Te,Ge,Y){Te===void 0&&(Te=null);let se={jsonrpc:u,id:Ie.id,result:Te};X(se,Ge,Y),e.write(se).catch(()=>o.error("Sending response failed."))}a(Ue,"replySuccess"),ue(Ie);let de=f.get(Ie.method),Se,Le;de&&(Se=de.type,Le=de.handler);let te=Date.now();if(Le||d){let Te=Ie.id??String(Date.now()),Ge=B6e.is(L.receiver)?L.receiver.createCancellationTokenSource(Te):L.receiver.createCancellationTokenSource(Ie);Ie.id!==null&&_.has(Ie.id)&&Ge.cancel(),Ie.id!==null&&v.set(Te,Ge);try{let Y;if(Le)if(Ie.params===void 0){if(Se!==void 0&&Se.numberOfParams!==0){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines ${Se.numberOfParams} params but received none.`),Ie.method,te);return}Y=Le(Ge.token)}else if(Array.isArray(Ie.params)){if(Se!==void 0&&Se.parameterStructures===$i.ParameterStructures.byName){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by name but received parameters by position`),Ie.method,te);return}Y=Le(...Ie.params,Ge.token)}else{if(Se!==void 0&&Se.parameterStructures===$i.ParameterStructures.byPosition){be(new $i.ResponseError($i.ErrorCodes.InvalidParams,`Request ${Ie.method} defines parameters by position but received parameters by name`),Ie.method,te);return}Y=Le(Ie.params,Ge.token)}else d&&(Y=d(Ie.method,Ie.params,Ge.token));let se=Y;Y?se.then?se.then(he=>{v.delete(Te),F(he,Ie.method,te)},he=>{v.delete(Te),he instanceof $i.ResponseError?be(he,Ie.method,te):he&&Zd.string(he.message)?be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${he.message}`),Ie.method,te):be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}):(v.delete(Te),F(Y,Ie.method,te)):(v.delete(Te),Ue(Y,Ie.method,te))}catch(Y){v.delete(Te),Y instanceof $i.ResponseError?F(Y,Ie.method,te):Y&&Zd.string(Y.message)?be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed with message: ${Y.message}`),Ie.method,te):be(new $i.ResponseError($i.ErrorCodes.InternalError,`Request ${Ie.method} failed unexpectedly without providing any details.`),Ie.method,te)}}else be(new $i.ResponseError($i.ErrorCodes.MethodNotFound,`Unhandled method ${Ie.method}`),Ie.method,te)}a(ve,"handleRequest");function Fe(Ie){if(!W())if(Ie.id===null)Ie.error?o.error(`Received response message without id: Error is: +${JSON.stringify(Ie.error,void 0,4)}`):o.error("Received response message without id. No further error information provided.");else{let F=Ie.id,be=E.get(F);if(ie(Ie,be),be!==void 0){E.delete(F);try{if(Ie.error){let Ue=Ie.error;be.reject(new $i.ResponseError(Ue.code,Ue.message,Ue.data))}else if(Ie.result!==void 0)be.resolve(Ie.result);else throw new Error("Should never happen.")}catch(Ue){Ue.message?o.error(`Response handler '${be.method}' failed with message: ${Ue.message}`):o.error(`Response handler '${be.method}' failed unexpectedly.`)}}}}a(Fe,"handleResponse");function Pe(Ie){if(W())return;let F,be;if(Ie.method===_ve.type.method){let Ue=Ie.params.id;_.delete(Ue),qe(Ie);return}else{let Ue=m.get(Ie.method);Ue&&(be=Ue.handler,F=Ue.type)}if(be||h)try{if(qe(Ie),be)if(Ie.params===void 0)F!==void 0&&F.numberOfParams!==0&&F.parameterStructures!==$i.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received none.`),be();else if(Array.isArray(Ie.params)){let Ue=Ie.params;Ie.method===yve.type.method&&Ue.length===2&&yPt.is(Ue[0])?be({token:Ue[0],value:Ue[1]}):(F!==void 0&&(F.parameterStructures===$i.ParameterStructures.byName&&o.error(`Notification ${Ie.method} defines parameters by name but received parameters by position`),F.numberOfParams!==Ie.params.length&&o.error(`Notification ${Ie.method} defines ${F.numberOfParams} params but received ${Ue.length} arguments`)),be(...Ue))}else F!==void 0&&F.parameterStructures===$i.ParameterStructures.byPosition&&o.error(`Notification ${Ie.method} defines parameters by position but received parameters by name`),be(Ie.params);else h&&h(Ie.method,Ie.params)}catch(Ue){Ue.message?o.error(`Notification handler '${Ie.method}' failed with message: ${Ue.message}`):o.error(`Notification handler '${Ie.method}' failed unexpectedly.`)}else D.fire(Ie)}a(Pe,"handleNotification");function Z(Ie){if(!Ie){o.error("Received empty message.");return}o.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(Ie,null,4)}`);let F=Ie;if(Zd.string(F.id)||Zd.number(F.id)){let be=F.id,Ue=E.get(be);Ue&&Ue.reject(new Error("The received response has neither a result nor an error property."))}}a(Z,"handleInvalidMessage");function ee(Ie){if(Ie!=null)switch(b){case yc.Verbose:return JSON.stringify(Ie,null,4);case yc.Compact:return JSON.stringify(Ie);default:return}}a(ee,"stringifyTrace");function K(Ie){if(!(b===yc.Off||!w))if(T===S1.Text){let F;(b===yc.Verbose||b===yc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Sending request '${Ee.method} - (${Ee.id})'.`,Qe)}else se("send-request",Ee)}a(z,"traceSendingRequest");function le(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.params?Qe=`Params: ${J(Ee.params)} +`),w.log(`Sending request '${Ie.method} - (${Ie.id})'.`,F)}else le("send-request",Ie)}a(K,"traceSendingRequest");function pe(Ie){if(!(b===yc.Off||!w))if(T===S1.Text){let F;(b===yc.Verbose||b===yc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} -`:Qe=`No parameters provided. +`:F=`No parameters provided. -`),w.log(`Sending notification '${Ee.method}'.`,Qe)}else se("send-notification",Ee)}a(le,"traceSendingNotification");function K(Ee,Qe,nt){if(!(b===Ec.Off||!w))if(T===P1.Text){let mt;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.error&&Ee.error.data?mt=`Error data: ${J(Ee.error.data)} +`),w.log(`Sending notification '${Ie.method}'.`,F)}else le("send-notification",Ie)}a(pe,"traceSendingNotification");function X(Ie,F,be){if(!(b===yc.Off||!w))if(T===S1.Text){let Ue;(b===yc.Verbose||b===yc.Compact)&&(Ie.error&&Ie.error.data?Ue=`Error data: ${ee(Ie.error.data)} -`:Ee.result?mt=`Result: ${J(Ee.result)} +`:Ie.result?Ue=`Result: ${ee(Ie.result)} -`:Ee.error===void 0&&(mt=`No result returned. +`:Ie.error===void 0&&(Ue=`No result returned. -`)),w.log(`Sending response '${Qe} - (${Ee.id})'. Processing request took ${Date.now()-nt}ms`,mt)}else se("send-response",Ee)}a(K,"traceSendingResponse");function ae(Ee){if(!(b===Ec.Off||!w))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&Ee.params&&(Qe=`Params: ${J(Ee.params)} +`)),w.log(`Sending response '${F} - (${Ie.id})'. Processing request took ${Date.now()-be}ms`,Ue)}else le("send-response",Ie)}a(X,"traceSendingResponse");function ue(Ie){if(!(b===yc.Off||!w))if(T===S1.Text){let F;(b===yc.Verbose||b===yc.Compact)&&Ie.params&&(F=`Params: ${ee(Ie.params)} -`),w.log(`Received request '${Ee.method} - (${Ee.id})'.`,Qe)}else se("receive-request",Ee)}a(ae,"traceReceivedRequest");function Me(Ee){if(!(b===Ec.Off||!w||Ee.method===z6e.type.method))if(T===P1.Text){let Qe;(b===Ec.Verbose||b===Ec.Compact)&&(Ee.params?Qe=`Params: ${J(Ee.params)} +`),w.log(`Received request '${Ie.method} - (${Ie.id})'.`,F)}else le("receive-request",Ie)}a(ue,"traceReceivedRequest");function qe(Ie){if(!(b===yc.Off||!w||Ie.method===O6e.type.method))if(T===S1.Text){let F;(b===yc.Verbose||b===yc.Compact)&&(Ie.params?F=`Params: ${ee(Ie.params)} -`:Qe=`No parameters provided. +`:F=`No parameters provided. -`),w.log(`Received notification '${Ee.method}'.`,Qe)}else se("receive-notification",Ee)}a(Me,"traceReceivedNotification");function ne(Ee,Qe){if(!(b===Ec.Off||!w))if(T===P1.Text){let nt;if((b===Ec.Verbose||b===Ec.Compact)&&(Ee.error&&Ee.error.data?nt=`Error data: ${J(Ee.error.data)} +`),w.log(`Received notification '${Ie.method}'.`,F)}else le("receive-notification",Ie)}a(qe,"traceReceivedNotification");function ie(Ie,F){if(!(b===yc.Off||!w))if(T===S1.Text){let be;if((b===yc.Verbose||b===yc.Compact)&&(Ie.error&&Ie.error.data?be=`Error data: ${ee(Ie.error.data)} -`:Ee.result?nt=`Result: ${J(Ee.result)} +`:Ie.result?be=`Result: ${ee(Ie.result)} -`:Ee.error===void 0&&(nt=`No result returned. +`:Ie.error===void 0&&(be=`No result returned. -`)),Qe){let mt=Ee.error?` Request failed: ${Ee.error.message} (${Ee.error.code}).`:"";w.log(`Received response '${Qe.method} - (${Ee.id})' in ${Date.now()-Qe.timerStart}ms.${mt}`,nt)}else w.log(`Received response ${Ee.id} without active response promise.`,nt)}else se("receive-response",Ee)}a(ne,"traceReceivedResponse");function se(Ee,Qe){if(!w||b===Ec.Off)return;let nt={isLSPMessage:!0,type:Ee,message:Qe,timestamp:Date.now()};w.log(nt)}a(se,"logLSPMessage");function Ie(){if(W())throw new Xie(PCe.Closed,"Connection is closed.");if(V())throw new Xie(PCe.Disposed,"Connection is disposed.")}a(Ie,"throwIfClosedOrDisposed");function _e(){if(U())throw new Xie(PCe.AlreadyListening,"Connection is already listening")}a(_e,"throwIfListening");function Re(){if(!U())throw new Error("Call listen() first.")}a(Re,"throwIfNotListening");function Je(Ee){return Ee===void 0?null:Ee}a(Je,"undefinedToNull");function Xe(Ee){if(Ee!==null)return Ee}a(Xe,"nullToUndefined");function Ct(Ee){return Ee!=null&&!Array.isArray(Ee)&&typeof Ee=="object"}a(Ct,"isNamedParam");function Ot(Ee,Qe){switch(Ee){case Wi.ParameterStructures.auto:return Ct(Qe)?Xe(Qe):[Je(Qe)];case Wi.ParameterStructures.byName:if(!Ct(Qe))throw new Error("Received parameters by name but param is not an object literal.");return Xe(Qe);case Wi.ParameterStructures.byPosition:return[Je(Qe)];default:throw new Error(`Unknown parameter structure ${Ee.toString()}`)}}a(Ot,"computeSingleParam");function $t(Ee,Qe){let nt,mt=Ee.numberOfParams;switch(mt){case 0:nt=void 0;break;case 1:nt=Ot(Ee.parameterStructures,Qe[0]);break;default:nt=[];for(let xe=0;xe{Ie();let nt,mt;if(ef.string(Ee)){nt=Ee;let He=Qe[0],Ze=0,at=Wi.ParameterStructures.auto;Wi.ParameterStructures.is(He)&&(Ze=1,at=He);let ct=Qe.length,ut=ct-Ze;switch(ut){case 0:mt=void 0;break;case 1:mt=Ot(at,Qe[Ze]);break;default:if(at===Wi.ParameterStructures.byName)throw new Error(`Received ${ut} parameters for 'by Name' notification parameter structure.`);mt=Qe.slice(Ze,ct).map(ee=>Je(ee));break}}else{let He=Qe;nt=Ee.method,mt=$t(Ee,He)}let xe={jsonrpc:u,method:nt,params:mt};return le(xe),e.write(xe).catch(He=>{throw o.error("Sending notification failed."),He})},"sendNotification"),onNotification:a((Ee,Qe)=>{Ie();let nt;return ef.func(Ee)?h=Ee:Qe&&(ef.string(Ee)?(nt=Ee,m.set(Ee,{type:void 0,handler:Qe})):(nt=Ee.method,m.set(Ee.method,{type:Ee,handler:Qe}))),{dispose:a(()=>{nt!==void 0?m.delete(nt):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ee,Qe,nt)=>{if(g.has(Qe))throw new Error(`Progress handler for token ${Qe} already registered`);return g.set(Qe,nt),{dispose:a(()=>{g.delete(Qe)},"dispose")}},"onProgress"),sendProgress:a((Ee,Qe,nt)=>Gt.sendNotification(kCe.type,{token:Qe,value:nt}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ee,...Qe)=>{Ie(),Re();let nt,mt,xe;if(ef.string(Ee)){nt=Ee;let ct=Qe[0],ut=Qe[Qe.length-1],ee=0,pe=Wi.ParameterStructures.auto;Wi.ParameterStructures.is(ct)&&(ee=1,pe=ct);let ke=Qe.length;xkt.CancellationToken.is(ut)&&(ke=ke-1,xe=ut);let Le=ke-ee;switch(Le){case 0:mt=void 0;break;case 1:mt=Ot(pe,Qe[ee]);break;default:if(pe===Wi.ParameterStructures.byName)throw new Error(`Received ${Le} parameters for 'by Name' request parameter structure.`);mt=Qe.slice(ee,ke).map(Ve=>Je(Ve));break}}else{let ct=Qe;nt=Ee.method,mt=$t(Ee,ct);let ut=Ee.numberOfParams;xe=xkt.CancellationToken.is(ct[ut])?ct[ut]:void 0}let He=s++,Ze;xe&&(Ze=xe.onCancellationRequested(()=>{let ct=B.sender.sendCancellation(Gt,He);return ct===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${He}`),Promise.resolve()):ct.catch(()=>{o.log(`Sending cancellation messages for id ${He} failed`)})}));let at={jsonrpc:u,id:He,method:nt,params:mt};return z(at),typeof B.sender.enableCancellation=="function"&&B.sender.enableCancellation(at),new Promise(async(ct,ut)=>{let ee=a(Le=>{ct(Le),B.sender.cleanup(He),Ze?.dispose()},"resolveWithCleanup"),pe=a(Le=>{ut(Le),B.sender.cleanup(He),Ze?.dispose()},"rejectWithCleanup"),ke={method:nt,timerStart:Date.now(),resolve:ee,reject:pe};try{await e.write(at),E.set(He,ke)}catch(Le){throw o.error("Sending request failed."),ke.reject(new Wi.ResponseError(Wi.ErrorCodes.MessageWriteError,Le.message?Le.message:"Unknown reason")),Le}})},"sendRequest"),onRequest:a((Ee,Qe)=>{Ie();let nt=null;return kkt.is(Ee)?(nt=void 0,d=Ee):ef.string(Ee)?(nt=null,Qe!==void 0&&(nt=Ee,f.set(Ee,{handler:Qe,type:void 0}))):Qe!==void 0&&(nt=Ee.method,f.set(Ee.method,{type:Ee,handler:Qe})),{dispose:a(()=>{nt!==null&&(nt!==void 0?f.delete(nt):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ee,Qe,nt)=>{let mt=!1,xe=P1.Text;nt!==void 0&&(ef.boolean(nt)?mt=nt:(mt=nt.sendNotification||!1,xe=nt.traceFormat||P1.Text)),b=Ee,T=xe,b===Ec.Off?w=void 0:w=Qe,mt&&!W()&&!V()&&await Gt.sendNotification(Pkt.type,{value:Ec.toString(Ee)})},"trace"),onError:x.event,onClose:k.event,onUnhandledNotification:D.event,onDispose:L.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(V())return;R=_k.Disposed,L.fire(void 0);let Ee=new Wi.ResponseError(Wi.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let Qe of E.values())Qe.reject(Ee);E=new Map,v=new Map,_=new Set,y=new YHr.LinkedMap,ef.func(e.dispose)&&e.dispose(),ef.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ie(),_e(),R=_k.Listening,t.listen(we)},"listen"),inspect:a(()=>{(0,zHr.default)().console.log("inspect")},"inspect")};return Gt.onNotification(z6e.type,Ee=>{if(b===Ec.Off||!w)return;let Qe=b===Ec.Verbose||b===Ec.Compact;w.log(Ee.message,Qe?Ee.verbose:void 0)}),Gt.onNotification(kCe.type,Ee=>{let Qe=g.get(Ee.token);Qe?Qe(Ee.value):N.fire(Ee)}),Gt}a(Gfo,"createMessageConnection");Mo.createMessageConnection=Gfo});var e9e=I(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.ProgressType=Mt.ProgressToken=Mt.createMessageConnection=Mt.NullLogger=Mt.ConnectionOptions=Mt.ConnectionStrategy=Mt.AbstractMessageBuffer=Mt.WriteableStreamMessageWriter=Mt.AbstractMessageWriter=Mt.MessageWriter=Mt.ReadableStreamMessageReader=Mt.AbstractMessageReader=Mt.MessageReader=Mt.SharedArrayReceiverStrategy=Mt.SharedArraySenderStrategy=Mt.CancellationToken=Mt.CancellationTokenSource=Mt.Emitter=Mt.Event=Mt.Disposable=Mt.LRUCache=Mt.Touch=Mt.LinkedMap=Mt.ParameterStructures=Mt.NotificationType9=Mt.NotificationType8=Mt.NotificationType7=Mt.NotificationType6=Mt.NotificationType5=Mt.NotificationType4=Mt.NotificationType3=Mt.NotificationType2=Mt.NotificationType1=Mt.NotificationType0=Mt.NotificationType=Mt.ErrorCodes=Mt.ResponseError=Mt.RequestType9=Mt.RequestType8=Mt.RequestType7=Mt.RequestType6=Mt.RequestType5=Mt.RequestType4=Mt.RequestType3=Mt.RequestType2=Mt.RequestType1=Mt.RequestType0=Mt.RequestType=Mt.Message=Mt.RAL=void 0;Mt.MessageStrategy=Mt.CancellationStrategy=Mt.CancellationSenderStrategy=Mt.CancellationReceiverStrategy=Mt.ConnectionError=Mt.ConnectionErrors=Mt.LogTraceNotification=Mt.SetTraceNotification=Mt.TraceFormat=Mt.TraceValues=Mt.Trace=void 0;var ru=okt();Object.defineProperty(Mt,"Message",{enumerable:!0,get:a(function(){return ru.Message},"get")});Object.defineProperty(Mt,"RequestType",{enumerable:!0,get:a(function(){return ru.RequestType},"get")});Object.defineProperty(Mt,"RequestType0",{enumerable:!0,get:a(function(){return ru.RequestType0},"get")});Object.defineProperty(Mt,"RequestType1",{enumerable:!0,get:a(function(){return ru.RequestType1},"get")});Object.defineProperty(Mt,"RequestType2",{enumerable:!0,get:a(function(){return ru.RequestType2},"get")});Object.defineProperty(Mt,"RequestType3",{enumerable:!0,get:a(function(){return ru.RequestType3},"get")});Object.defineProperty(Mt,"RequestType4",{enumerable:!0,get:a(function(){return ru.RequestType4},"get")});Object.defineProperty(Mt,"RequestType5",{enumerable:!0,get:a(function(){return ru.RequestType5},"get")});Object.defineProperty(Mt,"RequestType6",{enumerable:!0,get:a(function(){return ru.RequestType6},"get")});Object.defineProperty(Mt,"RequestType7",{enumerable:!0,get:a(function(){return ru.RequestType7},"get")});Object.defineProperty(Mt,"RequestType8",{enumerable:!0,get:a(function(){return ru.RequestType8},"get")});Object.defineProperty(Mt,"RequestType9",{enumerable:!0,get:a(function(){return ru.RequestType9},"get")});Object.defineProperty(Mt,"ResponseError",{enumerable:!0,get:a(function(){return ru.ResponseError},"get")});Object.defineProperty(Mt,"ErrorCodes",{enumerable:!0,get:a(function(){return ru.ErrorCodes},"get")});Object.defineProperty(Mt,"NotificationType",{enumerable:!0,get:a(function(){return ru.NotificationType},"get")});Object.defineProperty(Mt,"NotificationType0",{enumerable:!0,get:a(function(){return ru.NotificationType0},"get")});Object.defineProperty(Mt,"NotificationType1",{enumerable:!0,get:a(function(){return ru.NotificationType1},"get")});Object.defineProperty(Mt,"NotificationType2",{enumerable:!0,get:a(function(){return ru.NotificationType2},"get")});Object.defineProperty(Mt,"NotificationType3",{enumerable:!0,get:a(function(){return ru.NotificationType3},"get")});Object.defineProperty(Mt,"NotificationType4",{enumerable:!0,get:a(function(){return ru.NotificationType4},"get")});Object.defineProperty(Mt,"NotificationType5",{enumerable:!0,get:a(function(){return ru.NotificationType5},"get")});Object.defineProperty(Mt,"NotificationType6",{enumerable:!0,get:a(function(){return ru.NotificationType6},"get")});Object.defineProperty(Mt,"NotificationType7",{enumerable:!0,get:a(function(){return ru.NotificationType7},"get")});Object.defineProperty(Mt,"NotificationType8",{enumerable:!0,get:a(function(){return ru.NotificationType8},"get")});Object.defineProperty(Mt,"NotificationType9",{enumerable:!0,get:a(function(){return ru.NotificationType9},"get")});Object.defineProperty(Mt,"ParameterStructures",{enumerable:!0,get:a(function(){return ru.ParameterStructures},"get")});var Mkt=akt();Object.defineProperty(Mt,"LinkedMap",{enumerable:!0,get:a(function(){return Mkt.LinkedMap},"get")});Object.defineProperty(Mt,"LRUCache",{enumerable:!0,get:a(function(){return Mkt.LRUCache},"get")});Object.defineProperty(Mt,"Touch",{enumerable:!0,get:a(function(){return Mkt.Touch},"get")});var $fo=LHr();Object.defineProperty(Mt,"Disposable",{enumerable:!0,get:a(function(){return $fo.Disposable},"get")});var XHr=Yie();Object.defineProperty(Mt,"Event",{enumerable:!0,get:a(function(){return XHr.Event},"get")});Object.defineProperty(Mt,"Emitter",{enumerable:!0,get:a(function(){return XHr.Emitter},"get")});var eGr=H6e();Object.defineProperty(Mt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return eGr.CancellationTokenSource},"get")});Object.defineProperty(Mt,"CancellationToken",{enumerable:!0,get:a(function(){return eGr.CancellationToken},"get")});var tGr=UHr();Object.defineProperty(Mt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return tGr.SharedArraySenderStrategy},"get")});Object.defineProperty(Mt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return tGr.SharedArrayReceiverStrategy},"get")});var Okt=qHr();Object.defineProperty(Mt,"MessageReader",{enumerable:!0,get:a(function(){return Okt.MessageReader},"get")});Object.defineProperty(Mt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return Okt.AbstractMessageReader},"get")});Object.defineProperty(Mt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return Okt.ReadableStreamMessageReader},"get")});var Bkt=VHr();Object.defineProperty(Mt,"MessageWriter",{enumerable:!0,get:a(function(){return Bkt.MessageWriter},"get")});Object.defineProperty(Mt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return Bkt.AbstractMessageWriter},"get")});Object.defineProperty(Mt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return Bkt.WriteableStreamMessageWriter},"get")});var Vfo=WHr();Object.defineProperty(Mt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return Vfo.AbstractMessageBuffer},"get")});var Kg=ZHr();Object.defineProperty(Mt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return Kg.ConnectionStrategy},"get")});Object.defineProperty(Mt,"ConnectionOptions",{enumerable:!0,get:a(function(){return Kg.ConnectionOptions},"get")});Object.defineProperty(Mt,"NullLogger",{enumerable:!0,get:a(function(){return Kg.NullLogger},"get")});Object.defineProperty(Mt,"createMessageConnection",{enumerable:!0,get:a(function(){return Kg.createMessageConnection},"get")});Object.defineProperty(Mt,"ProgressToken",{enumerable:!0,get:a(function(){return Kg.ProgressToken},"get")});Object.defineProperty(Mt,"ProgressType",{enumerable:!0,get:a(function(){return Kg.ProgressType},"get")});Object.defineProperty(Mt,"Trace",{enumerable:!0,get:a(function(){return Kg.Trace},"get")});Object.defineProperty(Mt,"TraceValues",{enumerable:!0,get:a(function(){return Kg.TraceValues},"get")});Object.defineProperty(Mt,"TraceFormat",{enumerable:!0,get:a(function(){return Kg.TraceFormat},"get")});Object.defineProperty(Mt,"SetTraceNotification",{enumerable:!0,get:a(function(){return Kg.SetTraceNotification},"get")});Object.defineProperty(Mt,"LogTraceNotification",{enumerable:!0,get:a(function(){return Kg.LogTraceNotification},"get")});Object.defineProperty(Mt,"ConnectionErrors",{enumerable:!0,get:a(function(){return Kg.ConnectionErrors},"get")});Object.defineProperty(Mt,"ConnectionError",{enumerable:!0,get:a(function(){return Kg.ConnectionError},"get")});Object.defineProperty(Mt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationReceiverStrategy},"get")});Object.defineProperty(Mt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationSenderStrategy},"get")});Object.defineProperty(Mt,"CancellationStrategy",{enumerable:!0,get:a(function(){return Kg.CancellationStrategy},"get")});Object.defineProperty(Mt,"MessageStrategy",{enumerable:!0,get:a(function(){return Kg.MessageStrategy},"get")});var Wfo=H9();Mt.RAL=Wfo.default});var iGr=I(Qkt=>{"use strict";p();Object.defineProperty(Qkt,"__esModule",{value:!0});var rGr=require("util"),qB=e9e(),t9e=class t extends qB.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new rGr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};t9e.emptyBuffer=Buffer.allocUnsafe(0);var Lkt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),qB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),qB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),qB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),qB.Disposable.create(()=>this.stream.off("data",e))}},Fkt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),qB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),qB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),qB.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},nGr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new t9e(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new rGr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new Lkt(t),"asReadableStream"),asWritableStream:a(t=>new Fkt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function Ukt(){return nGr}a(Ukt,"RIL");(function(t){function e(){qB.RAL.install(nGr)}a(e,"install"),t.install=e})(Ukt||(Ukt={}));Qkt.default=Ukt});var nW=I(Ta=>{"use strict";p();var zfo=Ta&&Ta.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yfo=Ta&&Ta.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zfo(e,t,r)};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.createMessageConnection=Ta.createServerSocketTransport=Ta.createClientSocketTransport=Ta.createServerPipeTransport=Ta.createClientPipeTransport=Ta.generateRandomPipeName=Ta.StreamMessageWriter=Ta.StreamMessageReader=Ta.SocketMessageWriter=Ta.SocketMessageReader=Ta.PortMessageWriter=Ta.PortMessageReader=Ta.IPCMessageWriter=Ta.IPCMessageReader=void 0;var eoe=iGr();eoe.default.install();var oGr=require("path"),Kfo=require("os"),Jfo=require("crypto"),i9e=require("net"),D1=e9e();Yfo(e9e(),Ta);var qkt=class extends D1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),D1.Disposable.create(()=>this.process.off("message",e))}};Ta.IPCMessageReader=qkt;var jkt=class extends D1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ta.IPCMessageWriter=jkt;var Hkt=class extends D1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new D1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ta.PortMessageReader=Hkt;var Gkt=class extends D1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ta.PortMessageWriter=Gkt;var tW=class extends D1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,eoe.default)().stream.asReadableStream(e),r)}};Ta.SocketMessageReader=tW;var rW=class extends D1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,eoe.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ta.SocketMessageWriter=rW;var r9e=class extends D1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,eoe.default)().stream.asReadableStream(e),r)}};Ta.StreamMessageReader=r9e;var n9e=class extends D1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,eoe.default)().stream.asWritableStream(e),r)}};Ta.StreamMessageWriter=n9e;var sGr=process.env.XDG_RUNTIME_DIR,Zfo=new Map([["linux",107],["darwin",103]]);function Xfo(){let t=(0,Jfo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;sGr?e=oGr.join(sGr,`vscode-ipc-${t}.sock`):e=oGr.join(Kfo.tmpdir(),`vscode-${t}.sock`);let r=Zfo.get(process.platform);return r!==void 0&&e.length>r&&(0,eoe.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Xfo,"generateRandomPipeName");Ta.generateRandomPipeName=Xfo;function epo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,i9e.createServer)(l=>{c.close(),r([new tW(l,e),new rW(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(epo,"createClientPipeTransport");Ta.createClientPipeTransport=epo;function tpo(t,e="utf-8"){let r=(0,i9e.createConnection)(t);return[new tW(r,e),new rW(r,e)]}a(tpo,"createServerPipeTransport");Ta.createServerPipeTransport=tpo;function rpo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,i9e.createServer)(l=>{c.close(),r([new tW(l,e),new rW(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(rpo,"createClientSocketTransport");Ta.createClientSocketTransport=rpo;function npo(t,e="utf-8"){let r=(0,i9e.createConnection)(t,"127.0.0.1");return[new tW(r,e),new rW(r,e)]}a(npo,"createServerSocketTransport");Ta.createServerSocketTransport=npo;function ipo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(ipo,"isReadableStream");function opo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(opo,"isWritableStream");function spo(t,e,r,n){r||(r=D1.NullLogger);let o=ipo(t)?new r9e(t):t,s=opo(e)?new n9e(e):e;return D1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,D1.createMessageConnection)(o,s,r,n)}a(spo,"createMessageConnection");Ta.createMessageConnection=spo});var $kt=I((jEl,aGr)=>{"use strict";p();aGr.exports=nW()});var NCe=I((cGr,o9e)=>{p();(function(t){if(typeof o9e=="object"&&typeof o9e.exports=="object"){var e=t(require,cGr);e!==void 0&&(o9e.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(oe){function ve(Se){return typeof Se=="string"}a(ve,"is"),oe.is=ve})(r||(e.DocumentUri=r={}));var n;(function(oe){function ve(Se){return typeof Se=="string"}a(ve,"is"),oe.is=ve})(n||(e.URI=n={}));var o;(function(oe){oe.MIN_VALUE=-2147483648,oe.MAX_VALUE=2147483647;function ve(Se){return typeof Se=="number"&&oe.MIN_VALUE<=Se&&Se<=oe.MAX_VALUE}a(ve,"is"),oe.is=ve})(o||(e.integer=o={}));var s;(function(oe){oe.MIN_VALUE=0,oe.MAX_VALUE=2147483647;function ve(Se){return typeof Se=="number"&&oe.MIN_VALUE<=Se&&Se<=oe.MAX_VALUE}a(ve,"is"),oe.is=ve})(s||(e.uinteger=s={}));var c;(function(oe){function ve(de,te){return de===Number.MAX_VALUE&&(de=s.MAX_VALUE),te===Number.MAX_VALUE&&(te=s.MAX_VALUE),{line:de,character:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.uinteger(te.line)&&Be.uinteger(te.character)}a(Se,"is"),oe.is=Se})(c||(e.Position=c={}));var l;(function(oe){function ve(de,te,Fe,et){if(Be.uinteger(de)&&Be.uinteger(te)&&Be.uinteger(Fe)&&Be.uinteger(et))return{start:c.create(de,te),end:c.create(Fe,et)};if(c.is(de)&&c.is(te))return{start:de,end:te};throw new Error("Range#create called with invalid arguments[".concat(de,", ").concat(te,", ").concat(Fe,", ").concat(et,"]"))}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&c.is(te.start)&&c.is(te.end)}a(Se,"is"),oe.is=Se})(l||(e.Range=l={}));var u;(function(oe){function ve(de,te){return{uri:de,range:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.range)&&(Be.string(te.uri)||Be.undefined(te.uri))}a(Se,"is"),oe.is=Se})(u||(e.Location=u={}));var d;(function(oe){function ve(de,te,Fe,et){return{targetUri:de,targetRange:te,targetSelectionRange:Fe,originSelectionRange:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.targetRange)&&Be.string(te.targetUri)&&l.is(te.targetSelectionRange)&&(l.is(te.originSelectionRange)||Be.undefined(te.originSelectionRange))}a(Se,"is"),oe.is=Se})(d||(e.LocationLink=d={}));var f;(function(oe){function ve(de,te,Fe,et){return{red:de,green:te,blue:Fe,alpha:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.numberRange(te.red,0,1)&&Be.numberRange(te.green,0,1)&&Be.numberRange(te.blue,0,1)&&Be.numberRange(te.alpha,0,1)}a(Se,"is"),oe.is=Se})(f||(e.Color=f={}));var h;(function(oe){function ve(de,te){return{range:de,color:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&l.is(te.range)&&f.is(te.color)}a(Se,"is"),oe.is=Se})(h||(e.ColorInformation=h={}));var m;(function(oe){function ve(de,te,Fe){return{label:de,textEdit:te,additionalTextEdits:Fe}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.string(te.label)&&(Be.undefined(te.textEdit)||w.is(te))&&(Be.undefined(te.additionalTextEdits)||Be.typedArray(te.additionalTextEdits,w.is))}a(Se,"is"),oe.is=Se})(m||(e.ColorPresentation=m={}));var g;(function(oe){oe.Comment="comment",oe.Imports="imports",oe.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(oe){function ve(de,te,Fe,et,Ht,mr){var or={startLine:de,endLine:te};return Be.defined(Fe)&&(or.startCharacter=Fe),Be.defined(et)&&(or.endCharacter=et),Be.defined(Ht)&&(or.kind=Ht),Be.defined(mr)&&(or.collapsedText=mr),or}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.uinteger(te.startLine)&&Be.uinteger(te.startLine)&&(Be.undefined(te.startCharacter)||Be.uinteger(te.startCharacter))&&(Be.undefined(te.endCharacter)||Be.uinteger(te.endCharacter))&&(Be.undefined(te.kind)||Be.string(te.kind))}a(Se,"is"),oe.is=Se})(A||(e.FoldingRange=A={}));var y;(function(oe){function ve(de,te){return{location:de,message:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&u.is(te.location)&&Be.string(te.message)}a(Se,"is"),oe.is=Se})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(oe){oe.Error=1,oe.Warning=2,oe.Information=3,oe.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(oe){oe.Unnecessary=1,oe.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(oe){function ve(Se){var de=Se;return Be.objectLiteral(de)&&Be.string(de.href)}a(ve,"is"),oe.is=ve})(v||(e.CodeDescription=v={}));var b;(function(oe){function ve(de,te,Fe,et,Ht,mr){var or={range:de,message:te};return Be.defined(Fe)&&(or.severity=Fe),Be.defined(et)&&(or.code=et),Be.defined(Ht)&&(or.source=Ht),Be.defined(mr)&&(or.relatedInformation=mr),or}a(ve,"create"),oe.create=ve;function Se(de){var te,Fe=de;return Be.defined(Fe)&&l.is(Fe.range)&&Be.string(Fe.message)&&(Be.number(Fe.severity)||Be.undefined(Fe.severity))&&(Be.integer(Fe.code)||Be.string(Fe.code)||Be.undefined(Fe.code))&&(Be.undefined(Fe.codeDescription)||Be.string((te=Fe.codeDescription)===null||te===void 0?void 0:te.href))&&(Be.string(Fe.source)||Be.undefined(Fe.source))&&(Be.undefined(Fe.relatedInformation)||Be.typedArray(Fe.relatedInformation,y.is))}a(Se,"is"),oe.is=Se})(b||(e.Diagnostic=b={}));var T;(function(oe){function ve(de,te){for(var Fe=[],et=2;et0&&(Ht.arguments=Fe),Ht}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.title)&&Be.string(te.command)}a(Se,"is"),oe.is=Se})(T||(e.Command=T={}));var w;(function(oe){function ve(Fe,et){return{range:Fe,newText:et}}a(ve,"replace"),oe.replace=ve;function Se(Fe,et){return{range:{start:Fe,end:Fe},newText:et}}a(Se,"insert"),oe.insert=Se;function de(Fe){return{range:Fe,newText:""}}a(de,"del"),oe.del=de;function te(Fe){var et=Fe;return Be.objectLiteral(et)&&Be.string(et.newText)&&l.is(et.range)}a(te,"is"),oe.is=te})(w||(e.TextEdit=w={}));var R;(function(oe){function ve(de,te,Fe){var et={label:de};return te!==void 0&&(et.needsConfirmation=te),Fe!==void 0&&(et.description=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.objectLiteral(te)&&Be.string(te.label)&&(Be.boolean(te.needsConfirmation)||te.needsConfirmation===void 0)&&(Be.string(te.description)||te.description===void 0)}a(Se,"is"),oe.is=Se})(R||(e.ChangeAnnotation=R={}));var x;(function(oe){function ve(Se){var de=Se;return Be.string(de)}a(ve,"is"),oe.is=ve})(x||(e.ChangeAnnotationIdentifier=x={}));var k;(function(oe){function ve(Fe,et,Ht){return{range:Fe,newText:et,annotationId:Ht}}a(ve,"replace"),oe.replace=ve;function Se(Fe,et,Ht){return{range:{start:Fe,end:Fe},newText:et,annotationId:Ht}}a(Se,"insert"),oe.insert=Se;function de(Fe,et){return{range:Fe,newText:"",annotationId:et}}a(de,"del"),oe.del=de;function te(Fe){var et=Fe;return w.is(et)&&(R.is(et.annotationId)||x.is(et.annotationId))}a(te,"is"),oe.is=te})(k||(e.AnnotatedTextEdit=k={}));var D;(function(oe){function ve(de,te){return{textDocument:de,edits:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&W.is(te.textDocument)&&Array.isArray(te.edits)}a(Se,"is"),oe.is=Se})(D||(e.TextDocumentEdit=D={}));var N;(function(oe){function ve(de,te,Fe){var et={kind:"create",uri:de};return te!==void 0&&(te.overwrite!==void 0||te.ignoreIfExists!==void 0)&&(et.options=te),Fe!==void 0&&(et.annotationId=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="create"&&Be.string(te.uri)&&(te.options===void 0||(te.options.overwrite===void 0||Be.boolean(te.options.overwrite))&&(te.options.ignoreIfExists===void 0||Be.boolean(te.options.ignoreIfExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(N||(e.CreateFile=N={}));var L;(function(oe){function ve(de,te,Fe,et){var Ht={kind:"rename",oldUri:de,newUri:te};return Fe!==void 0&&(Fe.overwrite!==void 0||Fe.ignoreIfExists!==void 0)&&(Ht.options=Fe),et!==void 0&&(Ht.annotationId=et),Ht}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="rename"&&Be.string(te.oldUri)&&Be.string(te.newUri)&&(te.options===void 0||(te.options.overwrite===void 0||Be.boolean(te.options.overwrite))&&(te.options.ignoreIfExists===void 0||Be.boolean(te.options.ignoreIfExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(L||(e.RenameFile=L={}));var B;(function(oe){function ve(de,te,Fe){var et={kind:"delete",uri:de};return te!==void 0&&(te.recursive!==void 0||te.ignoreIfNotExists!==void 0)&&(et.options=te),Fe!==void 0&&(et.annotationId=Fe),et}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&te.kind==="delete"&&Be.string(te.uri)&&(te.options===void 0||(te.options.recursive===void 0||Be.boolean(te.options.recursive))&&(te.options.ignoreIfNotExists===void 0||Be.boolean(te.options.ignoreIfNotExists)))&&(te.annotationId===void 0||x.is(te.annotationId))}a(Se,"is"),oe.is=Se})(B||(e.DeleteFile=B={}));var Q;(function(oe){function ve(Se){var de=Se;return de&&(de.changes!==void 0||de.documentChanges!==void 0)&&(de.documentChanges===void 0||de.documentChanges.every(function(te){return Be.string(te.kind)?N.is(te)||L.is(te)||B.is(te):D.is(te)}))}a(ve,"is"),oe.is=ve})(Q||(e.WorkspaceEdit=Q={}));var M=(function(){function oe(ve,Se){this.edits=ve,this.changeAnnotations=Se}return a(oe,"TextEditChangeImpl"),oe.prototype.insert=function(ve,Se,de){var te,Fe;if(de===void 0?te=w.insert(ve,Se):x.is(de)?(Fe=de,te=k.insert(ve,Se,de)):(this.assertChangeAnnotations(this.changeAnnotations),Fe=this.changeAnnotations.manage(de),te=k.insert(ve,Se,Fe)),this.edits.push(te),Fe!==void 0)return Fe},oe.prototype.replace=function(ve,Se,de){var te,Fe;if(de===void 0?te=w.replace(ve,Se):x.is(de)?(Fe=de,te=k.replace(ve,Se,de)):(this.assertChangeAnnotations(this.changeAnnotations),Fe=this.changeAnnotations.manage(de),te=k.replace(ve,Se,Fe)),this.edits.push(te),Fe!==void 0)return Fe},oe.prototype.delete=function(ve,Se){var de,te;if(Se===void 0?de=w.del(ve):x.is(Se)?(te=Se,de=k.del(ve,Se)):(this.assertChangeAnnotations(this.changeAnnotations),te=this.changeAnnotations.manage(Se),de=k.del(ve,te)),this.edits.push(de),te!==void 0)return te},oe.prototype.add=function(ve){this.edits.push(ve)},oe.prototype.all=function(){return this.edits},oe.prototype.clear=function(){this.edits.splice(0,this.edits.length)},oe.prototype.assertChangeAnnotations=function(ve){if(ve===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},oe})(),O=(function(){function oe(ve){this._annotations=ve===void 0?Object.create(null):ve,this._counter=0,this._size=0}return a(oe,"ChangeAnnotations"),oe.prototype.all=function(){return this._annotations},Object.defineProperty(oe.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),oe.prototype.manage=function(ve,Se){var de;if(x.is(ve)?de=ve:(de=this.nextId(),Se=ve),this._annotations[de]!==void 0)throw new Error("Id ".concat(de," is already in use."));if(Se===void 0)throw new Error("No annotation provided for id ".concat(de));return this._annotations[de]=Se,this._size++,de},oe.prototype.nextId=function(){return this._counter++,this._counter.toString()},oe})(),q=(function(){function oe(ve){var Se=this;this._textEditChanges=Object.create(null),ve!==void 0?(this._workspaceEdit=ve,ve.documentChanges?(this._changeAnnotations=new O(ve.changeAnnotations),ve.changeAnnotations=this._changeAnnotations.all(),ve.documentChanges.forEach(function(de){if(D.is(de)){var te=new M(de.edits,Se._changeAnnotations);Se._textEditChanges[de.textDocument.uri]=te}})):ve.changes&&Object.keys(ve.changes).forEach(function(de){var te=new M(ve.changes[de]);Se._textEditChanges[de]=te})):this._workspaceEdit={}}return a(oe,"WorkspaceChange"),Object.defineProperty(oe.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),oe.prototype.getTextEditChange=function(ve){if(W.is(ve)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Se={uri:ve.uri,version:ve.version},de=this._textEditChanges[Se.uri];if(!de){var te=[],Fe={textDocument:Se,edits:te};this._workspaceEdit.documentChanges.push(Fe),de=new M(te,this._changeAnnotations),this._textEditChanges[Se.uri]=de}return de}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var de=this._textEditChanges[ve];if(!de){var te=[];this._workspaceEdit.changes[ve]=te,de=new M(te),this._textEditChanges[ve]=de}return de}},oe.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},oe.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},oe.prototype.createFile=function(ve,Se,de){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var te;R.is(Se)||x.is(Se)?te=Se:de=Se;var Fe,et;if(te===void 0?Fe=N.create(ve,de):(et=x.is(te)?te:this._changeAnnotations.manage(te),Fe=N.create(ve,de,et)),this._workspaceEdit.documentChanges.push(Fe),et!==void 0)return et},oe.prototype.renameFile=function(ve,Se,de,te){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Fe;R.is(de)||x.is(de)?Fe=de:te=de;var et,Ht;if(Fe===void 0?et=L.create(ve,Se,te):(Ht=x.is(Fe)?Fe:this._changeAnnotations.manage(Fe),et=L.create(ve,Se,te,Ht)),this._workspaceEdit.documentChanges.push(et),Ht!==void 0)return Ht},oe.prototype.deleteFile=function(ve,Se,de){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var te;R.is(Se)||x.is(Se)?te=Se:de=Se;var Fe,et;if(te===void 0?Fe=B.create(ve,de):(et=x.is(te)?te:this._changeAnnotations.manage(te),Fe=B.create(ve,de,et)),this._workspaceEdit.documentChanges.push(Fe),et!==void 0)return et},oe})();e.WorkspaceChange=q;var F;(function(oe){function ve(de){return{uri:de}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)}a(Se,"is"),oe.is=Se})(F||(e.TextDocumentIdentifier=F={}));var U;(function(oe){function ve(de,te){return{uri:de,version:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&Be.integer(te.version)}a(Se,"is"),oe.is=Se})(U||(e.VersionedTextDocumentIdentifier=U={}));var W;(function(oe){function ve(de,te){return{uri:de,version:te}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&(te.version===null||Be.integer(te.version))}a(Se,"is"),oe.is=Se})(W||(e.OptionalVersionedTextDocumentIdentifier=W={}));var V;(function(oe){function ve(de,te,Fe,et){return{uri:de,languageId:te,version:Fe,text:et}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return Be.defined(te)&&Be.string(te.uri)&&Be.string(te.languageId)&&Be.integer(te.version)&&Be.string(te.text)}a(Se,"is"),oe.is=Se})(V||(e.TextDocumentItem=V={}));var G;(function(oe){oe.PlainText="plaintext",oe.Markdown="markdown";function ve(Se){var de=Se;return de===oe.PlainText||de===oe.Markdown}a(ve,"is"),oe.is=ve})(G||(e.MarkupKind=G={}));var Y;(function(oe){function ve(Se){var de=Se;return Be.objectLiteral(Se)&&G.is(de.kind)&&Be.string(de.value)}a(ve,"is"),oe.is=ve})(Y||(e.MarkupContent=Y={}));var re;(function(oe){oe.Text=1,oe.Method=2,oe.Function=3,oe.Constructor=4,oe.Field=5,oe.Variable=6,oe.Class=7,oe.Interface=8,oe.Module=9,oe.Property=10,oe.Unit=11,oe.Value=12,oe.Enum=13,oe.Keyword=14,oe.Snippet=15,oe.Color=16,oe.File=17,oe.Reference=18,oe.Folder=19,oe.EnumMember=20,oe.Constant=21,oe.Struct=22,oe.Event=23,oe.Operator=24,oe.TypeParameter=25})(re||(e.CompletionItemKind=re={}));var j;(function(oe){oe.PlainText=1,oe.Snippet=2})(j||(e.InsertTextFormat=j={}));var X;(function(oe){oe.Deprecated=1})(X||(e.CompletionItemTag=X={}));var ie;(function(oe){function ve(de,te,Fe){return{newText:de,insert:te,replace:Fe}}a(ve,"create"),oe.create=ve;function Se(de){var te=de;return te&&Be.string(te.newText)&&l.is(te.insert)&&l.is(te.replace)}a(Se,"is"),oe.is=Se})(ie||(e.InsertReplaceEdit=ie={}));var we;(function(oe){oe.asIs=1,oe.adjustIndentation=2})(we||(e.InsertTextMode=we={}));var Ae;(function(oe){function ve(Se){var de=Se;return de&&(Be.string(de.detail)||de.detail===void 0)&&(Be.string(de.description)||de.description===void 0)}a(ve,"is"),oe.is=ve})(Ae||(e.CompletionItemLabelDetails=Ae={}));var De;(function(oe){function ve(Se){return{label:Se}}a(ve,"create"),oe.create=ve})(De||(e.CompletionItem=De={}));var Te;(function(oe){function ve(Se,de){return{items:Se||[],isIncomplete:!!de}}a(ve,"create"),oe.create=ve})(Te||(e.CompletionList=Te={}));var Z;(function(oe){function ve(de){return de.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(ve,"fromPlainText"),oe.fromPlainText=ve;function Se(de){var te=de;return Be.string(te)||Be.objectLiteral(te)&&Be.string(te.language)&&Be.string(te.value)}a(Se,"is"),oe.is=Se})(Z||(e.MarkedString=Z={}));var J;(function(oe){function ve(Se){var de=Se;return!!de&&Be.objectLiteral(de)&&(Y.is(de.contents)||Z.is(de.contents)||Be.typedArray(de.contents,Z.is))&&(Se.range===void 0||l.is(Se.range))}a(ve,"is"),oe.is=ve})(J||(e.Hover=J={}));var z;(function(oe){function ve(Se,de){return de?{label:Se,documentation:de}:{label:Se}}a(ve,"create"),oe.create=ve})(z||(e.ParameterInformation=z={}));var le;(function(oe){function ve(Se,de){for(var te=[],Fe=2;Fe{Ne();let be,Ue;if(Zd.string(Ie)){be=Ie;let Se=F[0],Le=0,te=$i.ParameterStructures.auto;$i.ParameterStructures.is(Se)&&(Le=1,te=Se);let Te=F.length,Ge=Te-Le;switch(Ge){case 0:Ue=void 0;break;case 1:Ue=kt(te,F[Le]);break;default:if(te===$i.ParameterStructures.byName)throw new Error(`Received ${Ge} parameters for 'by Name' notification parameter structure.`);Ue=F.slice(Le,Te).map(Y=>tt(Y));break}}else{let Se=F;be=Ie.method,Ue=Gt(Ie,Se)}let de={jsonrpc:u,method:be,params:Ue};return pe(de),e.write(de).catch(Se=>{throw o.error("Sending notification failed."),Se})},"sendNotification"),onNotification:a((Ie,F)=>{Ne();let be;return Zd.func(Ie)?h=Ie:F&&(Zd.string(Ie)?(be=Ie,m.set(Ie,{type:void 0,handler:F})):(be=Ie.method,m.set(Ie.method,{type:Ie,handler:F}))),{dispose:a(()=>{be!==void 0?m.delete(be):h=void 0},"dispose")}},"onNotification"),onProgress:a((Ie,F,be)=>{if(g.has(F))throw new Error(`Progress handler for token ${F} already registered`);return g.set(F,be),{dispose:a(()=>{g.delete(F)},"dispose")}},"onProgress"),sendProgress:a((Ie,F,be)=>jt.sendNotification(yve.type,{token:F,value:be}),"sendProgress"),onUnhandledProgress:N.event,sendRequest:a((Ie,...F)=>{Ne(),Be();let be,Ue,de;if(Zd.string(Ie)){be=Ie;let Te=F[0],Ge=F[F.length-1],Y=0,se=$i.ParameterStructures.auto;$i.ParameterStructures.is(Te)&&(Y=1,se=Te);let he=F.length;APt.CancellationToken.is(Ge)&&(he=he-1,de=Ge);let Ce=he-Y;switch(Ce){case 0:Ue=void 0;break;case 1:Ue=kt(se,F[Y]);break;default:if(se===$i.ParameterStructures.byName)throw new Error(`Received ${Ce} parameters for 'by Name' request parameter structure.`);Ue=F.slice(Y,he).map(He=>tt(He));break}}else{let Te=F;be=Ie.method,Ue=Gt(Ie,Te);let Ge=Ie.numberOfParams;de=APt.CancellationToken.is(Te[Ge])?Te[Ge]:void 0}let Se=s++,Le;de&&(Le=de.onCancellationRequested(()=>{let Te=L.sender.sendCancellation(jt,Se);return Te===void 0?(o.log(`Received no promise from cancellation strategy when cancelling id ${Se}`),Promise.resolve()):Te.catch(()=>{o.log(`Sending cancellation messages for id ${Se} failed`)})}));let te={jsonrpc:u,id:Se,method:be,params:Ue};return K(te),typeof L.sender.enableCancellation=="function"&&L.sender.enableCancellation(te),new Promise(async(Te,Ge)=>{let Y=a(Ce=>{Te(Ce),L.sender.cleanup(Se),Le?.dispose()},"resolveWithCleanup"),se=a(Ce=>{Ge(Ce),L.sender.cleanup(Se),Le?.dispose()},"rejectWithCleanup"),he={method:be,timerStart:Date.now(),resolve:Y,reject:se};try{await e.write(te),E.set(Se,he)}catch(Ce){throw o.error("Sending request failed."),he.reject(new $i.ResponseError($i.ErrorCodes.MessageWriteError,Ce.message?Ce.message:"Unknown reason")),Ce}})},"sendRequest"),onRequest:a((Ie,F)=>{Ne();let be=null;return _Pt.is(Ie)?(be=void 0,d=Ie):Zd.string(Ie)?(be=null,F!==void 0&&(be=Ie,f.set(Ie,{handler:F,type:void 0}))):F!==void 0&&(be=Ie.method,f.set(Ie.method,{type:Ie,handler:F})),{dispose:a(()=>{be!==null&&(be!==void 0?f.delete(be):d=void 0)},"dispose")}},"onRequest"),hasPendingResponse:a(()=>E.size>0,"hasPendingResponse"),trace:a(async(Ie,F,be)=>{let Ue=!1,de=S1.Text;be!==void 0&&(Zd.boolean(be)?Ue=be:(Ue=be.sendNotification||!1,de=be.traceFormat||S1.Text)),b=Ie,T=de,b===yc.Off?w=void 0:w=F,Ue&&!z()&&!W()&&await jt.sendNotification(vPt.type,{value:yc.toString(Ie)})},"trace"),onError:x.event,onClose:P.event,onUnhandledNotification:D.event,onDispose:B.event,end:a(()=>{e.end()},"end"),dispose:a(()=>{if(W())return;R=AP.Disposed,B.fire(void 0);let Ie=new $i.ResponseError($i.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let F of E.values())F.reject(Ie);E=new Map,v=new Map,_=new Set,y=new RHr.LinkedMap,Zd.func(e.dispose)&&e.dispose(),Zd.func(t.dispose)&&t.dispose()},"dispose"),listen:a(()=>{Ne(),we(),R=AP.Listening,t.listen(Oe)},"listen"),inspect:a(()=>{(0,wHr.default)().console.log("inspect")},"inspect")};return jt.onNotification(O6e.type,Ie=>{if(b===yc.Off||!w)return;let F=b===yc.Verbose||b===yc.Compact;w.log(Ie.message,F?Ie.verbose:void 0)}),jt.onNotification(yve.type,Ie=>{let F=g.get(Ie.token);F?F(Ie.value):N.fire(Ie)}),jt}a(Ffo,"createMessageConnection");No.createMessageConnection=Ffo});var q6e=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ProgressType=Bt.ProgressToken=Bt.createMessageConnection=Bt.NullLogger=Bt.ConnectionOptions=Bt.ConnectionStrategy=Bt.AbstractMessageBuffer=Bt.WriteableStreamMessageWriter=Bt.AbstractMessageWriter=Bt.MessageWriter=Bt.ReadableStreamMessageReader=Bt.AbstractMessageReader=Bt.MessageReader=Bt.SharedArrayReceiverStrategy=Bt.SharedArraySenderStrategy=Bt.CancellationToken=Bt.CancellationTokenSource=Bt.Emitter=Bt.Event=Bt.Disposable=Bt.LRUCache=Bt.Touch=Bt.LinkedMap=Bt.ParameterStructures=Bt.NotificationType9=Bt.NotificationType8=Bt.NotificationType7=Bt.NotificationType6=Bt.NotificationType5=Bt.NotificationType4=Bt.NotificationType3=Bt.NotificationType2=Bt.NotificationType1=Bt.NotificationType0=Bt.NotificationType=Bt.ErrorCodes=Bt.ResponseError=Bt.RequestType9=Bt.RequestType8=Bt.RequestType7=Bt.RequestType6=Bt.RequestType5=Bt.RequestType4=Bt.RequestType3=Bt.RequestType2=Bt.RequestType1=Bt.RequestType0=Bt.RequestType=Bt.Message=Bt.RAL=void 0;Bt.MessageStrategy=Bt.CancellationStrategy=Bt.CancellationSenderStrategy=Bt.CancellationReceiverStrategy=Bt.ConnectionError=Bt.ConnectionErrors=Bt.LogTraceNotification=Bt.SetTraceNotification=Bt.TraceFormat=Bt.TraceValues=Bt.Trace=void 0;var Xl=YRt();Object.defineProperty(Bt,"Message",{enumerable:!0,get:a(function(){return Xl.Message},"get")});Object.defineProperty(Bt,"RequestType",{enumerable:!0,get:a(function(){return Xl.RequestType},"get")});Object.defineProperty(Bt,"RequestType0",{enumerable:!0,get:a(function(){return Xl.RequestType0},"get")});Object.defineProperty(Bt,"RequestType1",{enumerable:!0,get:a(function(){return Xl.RequestType1},"get")});Object.defineProperty(Bt,"RequestType2",{enumerable:!0,get:a(function(){return Xl.RequestType2},"get")});Object.defineProperty(Bt,"RequestType3",{enumerable:!0,get:a(function(){return Xl.RequestType3},"get")});Object.defineProperty(Bt,"RequestType4",{enumerable:!0,get:a(function(){return Xl.RequestType4},"get")});Object.defineProperty(Bt,"RequestType5",{enumerable:!0,get:a(function(){return Xl.RequestType5},"get")});Object.defineProperty(Bt,"RequestType6",{enumerable:!0,get:a(function(){return Xl.RequestType6},"get")});Object.defineProperty(Bt,"RequestType7",{enumerable:!0,get:a(function(){return Xl.RequestType7},"get")});Object.defineProperty(Bt,"RequestType8",{enumerable:!0,get:a(function(){return Xl.RequestType8},"get")});Object.defineProperty(Bt,"RequestType9",{enumerable:!0,get:a(function(){return Xl.RequestType9},"get")});Object.defineProperty(Bt,"ResponseError",{enumerable:!0,get:a(function(){return Xl.ResponseError},"get")});Object.defineProperty(Bt,"ErrorCodes",{enumerable:!0,get:a(function(){return Xl.ErrorCodes},"get")});Object.defineProperty(Bt,"NotificationType",{enumerable:!0,get:a(function(){return Xl.NotificationType},"get")});Object.defineProperty(Bt,"NotificationType0",{enumerable:!0,get:a(function(){return Xl.NotificationType0},"get")});Object.defineProperty(Bt,"NotificationType1",{enumerable:!0,get:a(function(){return Xl.NotificationType1},"get")});Object.defineProperty(Bt,"NotificationType2",{enumerable:!0,get:a(function(){return Xl.NotificationType2},"get")});Object.defineProperty(Bt,"NotificationType3",{enumerable:!0,get:a(function(){return Xl.NotificationType3},"get")});Object.defineProperty(Bt,"NotificationType4",{enumerable:!0,get:a(function(){return Xl.NotificationType4},"get")});Object.defineProperty(Bt,"NotificationType5",{enumerable:!0,get:a(function(){return Xl.NotificationType5},"get")});Object.defineProperty(Bt,"NotificationType6",{enumerable:!0,get:a(function(){return Xl.NotificationType6},"get")});Object.defineProperty(Bt,"NotificationType7",{enumerable:!0,get:a(function(){return Xl.NotificationType7},"get")});Object.defineProperty(Bt,"NotificationType8",{enumerable:!0,get:a(function(){return Xl.NotificationType8},"get")});Object.defineProperty(Bt,"NotificationType9",{enumerable:!0,get:a(function(){return Xl.NotificationType9},"get")});Object.defineProperty(Bt,"ParameterStructures",{enumerable:!0,get:a(function(){return Xl.ParameterStructures},"get")});var SPt=JRt();Object.defineProperty(Bt,"LinkedMap",{enumerable:!0,get:a(function(){return SPt.LinkedMap},"get")});Object.defineProperty(Bt,"LRUCache",{enumerable:!0,get:a(function(){return SPt.LRUCache},"get")});Object.defineProperty(Bt,"Touch",{enumerable:!0,get:a(function(){return SPt.Touch},"get")});var Ufo=AHr();Object.defineProperty(Bt,"Disposable",{enumerable:!0,get:a(function(){return Ufo.Disposable},"get")});var NHr=jie();Object.defineProperty(Bt,"Event",{enumerable:!0,get:a(function(){return NHr.Event},"get")});Object.defineProperty(Bt,"Emitter",{enumerable:!0,get:a(function(){return NHr.Emitter},"get")});var MHr=P6e();Object.defineProperty(Bt,"CancellationTokenSource",{enumerable:!0,get:a(function(){return MHr.CancellationTokenSource},"get")});Object.defineProperty(Bt,"CancellationToken",{enumerable:!0,get:a(function(){return MHr.CancellationToken},"get")});var OHr=EHr();Object.defineProperty(Bt,"SharedArraySenderStrategy",{enumerable:!0,get:a(function(){return OHr.SharedArraySenderStrategy},"get")});Object.defineProperty(Bt,"SharedArrayReceiverStrategy",{enumerable:!0,get:a(function(){return OHr.SharedArrayReceiverStrategy},"get")});var TPt=vHr();Object.defineProperty(Bt,"MessageReader",{enumerable:!0,get:a(function(){return TPt.MessageReader},"get")});Object.defineProperty(Bt,"AbstractMessageReader",{enumerable:!0,get:a(function(){return TPt.AbstractMessageReader},"get")});Object.defineProperty(Bt,"ReadableStreamMessageReader",{enumerable:!0,get:a(function(){return TPt.ReadableStreamMessageReader},"get")});var IPt=IHr();Object.defineProperty(Bt,"MessageWriter",{enumerable:!0,get:a(function(){return IPt.MessageWriter},"get")});Object.defineProperty(Bt,"AbstractMessageWriter",{enumerable:!0,get:a(function(){return IPt.AbstractMessageWriter},"get")});Object.defineProperty(Bt,"WriteableStreamMessageWriter",{enumerable:!0,get:a(function(){return IPt.WriteableStreamMessageWriter},"get")});var Qfo=xHr();Object.defineProperty(Bt,"AbstractMessageBuffer",{enumerable:!0,get:a(function(){return Qfo.AbstractMessageBuffer},"get")});var Jg=DHr();Object.defineProperty(Bt,"ConnectionStrategy",{enumerable:!0,get:a(function(){return Jg.ConnectionStrategy},"get")});Object.defineProperty(Bt,"ConnectionOptions",{enumerable:!0,get:a(function(){return Jg.ConnectionOptions},"get")});Object.defineProperty(Bt,"NullLogger",{enumerable:!0,get:a(function(){return Jg.NullLogger},"get")});Object.defineProperty(Bt,"createMessageConnection",{enumerable:!0,get:a(function(){return Jg.createMessageConnection},"get")});Object.defineProperty(Bt,"ProgressToken",{enumerable:!0,get:a(function(){return Jg.ProgressToken},"get")});Object.defineProperty(Bt,"ProgressType",{enumerable:!0,get:a(function(){return Jg.ProgressType},"get")});Object.defineProperty(Bt,"Trace",{enumerable:!0,get:a(function(){return Jg.Trace},"get")});Object.defineProperty(Bt,"TraceValues",{enumerable:!0,get:a(function(){return Jg.TraceValues},"get")});Object.defineProperty(Bt,"TraceFormat",{enumerable:!0,get:a(function(){return Jg.TraceFormat},"get")});Object.defineProperty(Bt,"SetTraceNotification",{enumerable:!0,get:a(function(){return Jg.SetTraceNotification},"get")});Object.defineProperty(Bt,"LogTraceNotification",{enumerable:!0,get:a(function(){return Jg.LogTraceNotification},"get")});Object.defineProperty(Bt,"ConnectionErrors",{enumerable:!0,get:a(function(){return Jg.ConnectionErrors},"get")});Object.defineProperty(Bt,"ConnectionError",{enumerable:!0,get:a(function(){return Jg.ConnectionError},"get")});Object.defineProperty(Bt,"CancellationReceiverStrategy",{enumerable:!0,get:a(function(){return Jg.CancellationReceiverStrategy},"get")});Object.defineProperty(Bt,"CancellationSenderStrategy",{enumerable:!0,get:a(function(){return Jg.CancellationSenderStrategy},"get")});Object.defineProperty(Bt,"CancellationStrategy",{enumerable:!0,get:a(function(){return Jg.CancellationStrategy},"get")});Object.defineProperty(Bt,"MessageStrategy",{enumerable:!0,get:a(function(){return Jg.MessageStrategy},"get")});var qfo=B9();Bt.RAL=qfo.default});var FHr=I(PPt=>{"use strict";p();Object.defineProperty(PPt,"__esModule",{value:!0});var BHr=require("util"),NB=q6e(),j6e=class t extends NB.AbstractMessageBuffer{static{a(this,"MessageBuffer")}constructor(e="utf-8"){super(e)}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new BHr.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};j6e.emptyBuffer=Buffer.allocUnsafe(0);var xPt=class{static{a(this,"ReadableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),NB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),NB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),NB.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),NB.Disposable.create(()=>this.stream.off("data",e))}},wPt=class{static{a(this,"WritableStreamWrapper")}constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),NB.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),NB.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),NB.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,o)=>{let s=a(c=>{c==null?n():o(c)},"callback");typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s)})}end(){this.stream.end()}},LHr=Object.freeze({messageBuffer:Object.freeze({create:a(t=>new j6e(t),"create")}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:a((t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}},"encode")}),decoder:Object.freeze({name:"application/json",decode:a((t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new BHr.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}},"decode")})}),stream:Object.freeze({asReadableStream:a(t=>new xPt(t),"asReadableStream"),asWritableStream:a(t=>new wPt(t),"asWritableStream")}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return{dispose:a(()=>clearTimeout(n),"dispose")}},setImmediate(t,...e){let r=setImmediate(t,...e);return{dispose:a(()=>clearImmediate(r),"dispose")}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return{dispose:a(()=>clearInterval(n),"dispose")}}})});function RPt(){return LHr}a(RPt,"RIL");(function(t){function e(){NB.RAL.install(LHr)}a(e,"install"),t.install=e})(RPt||(RPt={}));PPt.default=RPt});var WV=I(Ca=>{"use strict";p();var jfo=Ca&&Ca.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hfo=Ca&&Ca.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jfo(e,t,r)};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createMessageConnection=Ca.createServerSocketTransport=Ca.createClientSocketTransport=Ca.createServerPipeTransport=Ca.createClientPipeTransport=Ca.generateRandomPipeName=Ca.StreamMessageWriter=Ca.StreamMessageReader=Ca.SocketMessageWriter=Ca.SocketMessageReader=Ca.PortMessageWriter=Ca.PortMessageReader=Ca.IPCMessageWriter=Ca.IPCMessageReader=void 0;var Wie=FHr();Wie.default.install();var UHr=require("path"),Gfo=require("os"),$fo=require("crypto"),$6e=require("net"),T1=q6e();Hfo(q6e(),Ca);var kPt=class extends T1.AbstractMessageReader{static{a(this,"IPCMessageReader")}constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose())}listen(e){return this.process.on("message",e),T1.Disposable.create(()=>this.process.off("message",e))}};Ca.IPCMessageReader=kPt;var DPt=class extends T1.AbstractMessageWriter{static{a(this,"IPCMessageWriter")}constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose)}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ca.IPCMessageWriter=DPt;var NPt=class extends T1.AbstractMessageReader{static{a(this,"PortMessageReader")}constructor(e){super(),this.onData=new T1.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r)})}listen(e){return this.onData.event(e)}};Ca.PortMessageReader=NPt;var MPt=class extends T1.AbstractMessageWriter{static{a(this,"PortMessageWriter")}constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){}};Ca.PortMessageWriter=MPt;var $V=class extends T1.ReadableStreamMessageReader{static{a(this,"SocketMessageReader")}constructor(e,r="utf-8"){super((0,Wie.default)().stream.asReadableStream(e),r)}};Ca.SocketMessageReader=$V;var VV=class extends T1.WriteableStreamMessageWriter{static{a(this,"SocketMessageWriter")}constructor(e,r){super((0,Wie.default)().stream.asWritableStream(e),r),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};Ca.SocketMessageWriter=VV;var H6e=class extends T1.ReadableStreamMessageReader{static{a(this,"StreamMessageReader")}constructor(e,r){super((0,Wie.default)().stream.asReadableStream(e),r)}};Ca.StreamMessageReader=H6e;var G6e=class extends T1.WriteableStreamMessageWriter{static{a(this,"StreamMessageWriter")}constructor(e,r){super((0,Wie.default)().stream.asWritableStream(e),r)}};Ca.StreamMessageWriter=G6e;var QHr=process.env.XDG_RUNTIME_DIR,Vfo=new Map([["linux",107],["darwin",103]]);function Wfo(){let t=(0,$fo.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;QHr?e=UHr.join(QHr,`vscode-ipc-${t}.sock`):e=UHr.join(Gfo.tmpdir(),`vscode-${t}.sock`);let r=Vfo.get(process.platform);return r!==void 0&&e.length>r&&(0,Wie.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}a(Wfo,"generateRandomPipeName");Ca.generateRandomPipeName=Wfo;function zfo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,$6e.createServer)(l=>{c.close(),r([new $V(l,e),new VV(l,e)])});c.on("error",s),c.listen(t,()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(zfo,"createClientPipeTransport");Ca.createClientPipeTransport=zfo;function Yfo(t,e="utf-8"){let r=(0,$6e.createConnection)(t);return[new $V(r,e),new VV(r,e)]}a(Yfo,"createServerPipeTransport");Ca.createServerPipeTransport=Yfo;function Kfo(t,e="utf-8"){let r,n=new Promise((o,s)=>{r=o});return new Promise((o,s)=>{let c=(0,$6e.createServer)(l=>{c.close(),r([new $V(l,e),new VV(l,e)])});c.on("error",s),c.listen(t,"127.0.0.1",()=>{c.removeListener("error",s),o({onConnected:a(()=>n,"onConnected")})})})}a(Kfo,"createClientSocketTransport");Ca.createClientSocketTransport=Kfo;function Jfo(t,e="utf-8"){let r=(0,$6e.createConnection)(t,"127.0.0.1");return[new $V(r,e),new VV(r,e)]}a(Jfo,"createServerSocketTransport");Ca.createServerSocketTransport=Jfo;function Zfo(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}a(Zfo,"isReadableStream");function Xfo(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}a(Xfo,"isWritableStream");function epo(t,e,r,n){r||(r=T1.NullLogger);let o=Zfo(t)?new H6e(t):t,s=Xfo(e)?new G6e(e):e;return T1.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,T1.createMessageConnection)(o,s,r,n)}a(epo,"createMessageConnection");Ca.createMessageConnection=epo});var OPt=I((XAl,qHr)=>{"use strict";p();qHr.exports=WV()});var vve=I((jHr,V6e)=>{p();(function(t){if(typeof V6e=="object"&&typeof V6e.exports=="object"){var e=t(require,jHr);e!==void 0&&(V6e.exports=e)}else typeof define=="function"&&define.amd&&define(["require","exports"],t)})(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(ce){function Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(r||(e.DocumentUri=r={}));var n;(function(ce){function Re(Me){return typeof Me=="string"}a(Re,"is"),ce.is=Re})(n||(e.URI=n={}));var o;(function(ce){ce.MIN_VALUE=-2147483648,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(o||(e.integer=o={}));var s;(function(ce){ce.MIN_VALUE=0,ce.MAX_VALUE=2147483647;function Re(Me){return typeof Me=="number"&&ce.MIN_VALUE<=Me&&Me<=ce.MAX_VALUE}a(Re,"is"),ce.is=Re})(s||(e.uinteger=s={}));var c;(function(ce){function Re(ge,oe){return ge===Number.MAX_VALUE&&(ge=s.MAX_VALUE),oe===Number.MAX_VALUE&&(oe=s.MAX_VALUE),{line:ge,character:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&We.uinteger(oe.line)&&We.uinteger(oe.character)}a(Me,"is"),ce.is=Me})(c||(e.Position=c={}));var l;(function(ce){function Re(ge,oe,ze,at){if(We.uinteger(ge)&&We.uinteger(oe)&&We.uinteger(ze)&&We.uinteger(at))return{start:c.create(ge,oe),end:c.create(ze,at)};if(c.is(ge)&&c.is(oe))return{start:ge,end:oe};throw new Error("Range#create called with invalid arguments[".concat(ge,", ").concat(oe,", ").concat(ze,", ").concat(at,"]"))}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&c.is(oe.start)&&c.is(oe.end)}a(Me,"is"),ce.is=Me})(l||(e.Range=l={}));var u;(function(ce){function Re(ge,oe){return{uri:ge,range:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&l.is(oe.range)&&(We.string(oe.uri)||We.undefined(oe.uri))}a(Me,"is"),ce.is=Me})(u||(e.Location=u={}));var d;(function(ce){function Re(ge,oe,ze,at){return{targetUri:ge,targetRange:oe,targetSelectionRange:ze,originSelectionRange:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&l.is(oe.targetRange)&&We.string(oe.targetUri)&&l.is(oe.targetSelectionRange)&&(l.is(oe.originSelectionRange)||We.undefined(oe.originSelectionRange))}a(Me,"is"),ce.is=Me})(d||(e.LocationLink=d={}));var f;(function(ce){function Re(ge,oe,ze,at){return{red:ge,green:oe,blue:ze,alpha:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&We.numberRange(oe.red,0,1)&&We.numberRange(oe.green,0,1)&&We.numberRange(oe.blue,0,1)&&We.numberRange(oe.alpha,0,1)}a(Me,"is"),ce.is=Me})(f||(e.Color=f={}));var h;(function(ce){function Re(ge,oe){return{range:ge,color:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&l.is(oe.range)&&f.is(oe.color)}a(Me,"is"),ce.is=Me})(h||(e.ColorInformation=h={}));var m;(function(ce){function Re(ge,oe,ze){return{label:ge,textEdit:oe,additionalTextEdits:ze}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.undefined(oe.textEdit)||w.is(oe))&&(We.undefined(oe.additionalTextEdits)||We.typedArray(oe.additionalTextEdits,w.is))}a(Me,"is"),ce.is=Me})(m||(e.ColorPresentation=m={}));var g;(function(ce){ce.Comment="comment",ce.Imports="imports",ce.Region="region"})(g||(e.FoldingRangeKind=g={}));var A;(function(ce){function Re(ge,oe,ze,at,$t,gr){var sr={startLine:ge,endLine:oe};return We.defined(ze)&&(sr.startCharacter=ze),We.defined(at)&&(sr.endCharacter=at),We.defined($t)&&(sr.kind=$t),We.defined(gr)&&(sr.collapsedText=gr),sr}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&We.uinteger(oe.startLine)&&We.uinteger(oe.startLine)&&(We.undefined(oe.startCharacter)||We.uinteger(oe.startCharacter))&&(We.undefined(oe.endCharacter)||We.uinteger(oe.endCharacter))&&(We.undefined(oe.kind)||We.string(oe.kind))}a(Me,"is"),ce.is=Me})(A||(e.FoldingRange=A={}));var y;(function(ce){function Re(ge,oe){return{location:ge,message:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&u.is(oe.location)&&We.string(oe.message)}a(Me,"is"),ce.is=Me})(y||(e.DiagnosticRelatedInformation=y={}));var E;(function(ce){ce.Error=1,ce.Warning=2,ce.Information=3,ce.Hint=4})(E||(e.DiagnosticSeverity=E={}));var _;(function(ce){ce.Unnecessary=1,ce.Deprecated=2})(_||(e.DiagnosticTag=_={}));var v;(function(ce){function Re(Me){var ge=Me;return We.objectLiteral(ge)&&We.string(ge.href)}a(Re,"is"),ce.is=Re})(v||(e.CodeDescription=v={}));var b;(function(ce){function Re(ge,oe,ze,at,$t,gr){var sr={range:ge,message:oe};return We.defined(ze)&&(sr.severity=ze),We.defined(at)&&(sr.code=at),We.defined($t)&&(sr.source=$t),We.defined(gr)&&(sr.relatedInformation=gr),sr}a(Re,"create"),ce.create=Re;function Me(ge){var oe,ze=ge;return We.defined(ze)&&l.is(ze.range)&&We.string(ze.message)&&(We.number(ze.severity)||We.undefined(ze.severity))&&(We.integer(ze.code)||We.string(ze.code)||We.undefined(ze.code))&&(We.undefined(ze.codeDescription)||We.string((oe=ze.codeDescription)===null||oe===void 0?void 0:oe.href))&&(We.string(ze.source)||We.undefined(ze.source))&&(We.undefined(ze.relatedInformation)||We.typedArray(ze.relatedInformation,y.is))}a(Me,"is"),ce.is=Me})(b||(e.Diagnostic=b={}));var T;(function(ce){function Re(ge,oe){for(var ze=[],at=2;at0&&($t.arguments=ze),$t}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.title)&&We.string(oe.command)}a(Me,"is"),ce.is=Me})(T||(e.Command=T={}));var w;(function(ce){function Re(ze,at){return{range:ze,newText:at}}a(Re,"replace"),ce.replace=Re;function Me(ze,at){return{range:{start:ze,end:ze},newText:at}}a(Me,"insert"),ce.insert=Me;function ge(ze){return{range:ze,newText:""}}a(ge,"del"),ce.del=ge;function oe(ze){var at=ze;return We.objectLiteral(at)&&We.string(at.newText)&&l.is(at.range)}a(oe,"is"),ce.is=oe})(w||(e.TextEdit=w={}));var R;(function(ce){function Re(ge,oe,ze){var at={label:ge};return oe!==void 0&&(at.needsConfirmation=oe),ze!==void 0&&(at.description=ze),at}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.objectLiteral(oe)&&We.string(oe.label)&&(We.boolean(oe.needsConfirmation)||oe.needsConfirmation===void 0)&&(We.string(oe.description)||oe.description===void 0)}a(Me,"is"),ce.is=Me})(R||(e.ChangeAnnotation=R={}));var x;(function(ce){function Re(Me){var ge=Me;return We.string(ge)}a(Re,"is"),ce.is=Re})(x||(e.ChangeAnnotationIdentifier=x={}));var P;(function(ce){function Re(ze,at,$t){return{range:ze,newText:at,annotationId:$t}}a(Re,"replace"),ce.replace=Re;function Me(ze,at,$t){return{range:{start:ze,end:ze},newText:at,annotationId:$t}}a(Me,"insert"),ce.insert=Me;function ge(ze,at){return{range:ze,newText:"",annotationId:at}}a(ge,"del"),ce.del=ge;function oe(ze){var at=ze;return w.is(at)&&(R.is(at.annotationId)||x.is(at.annotationId))}a(oe,"is"),ce.is=oe})(P||(e.AnnotatedTextEdit=P={}));var D;(function(ce){function Re(ge,oe){return{textDocument:ge,edits:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&z.is(oe.textDocument)&&Array.isArray(oe.edits)}a(Me,"is"),ce.is=Me})(D||(e.TextDocumentEdit=D={}));var N;(function(ce){function Re(ge,oe,ze){var at={kind:"create",uri:ge};return oe!==void 0&&(oe.overwrite!==void 0||oe.ignoreIfExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return oe&&oe.kind==="create"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(N||(e.CreateFile=N={}));var B;(function(ce){function Re(ge,oe,ze,at){var $t={kind:"rename",oldUri:ge,newUri:oe};return ze!==void 0&&(ze.overwrite!==void 0||ze.ignoreIfExists!==void 0)&&($t.options=ze),at!==void 0&&($t.annotationId=at),$t}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return oe&&oe.kind==="rename"&&We.string(oe.oldUri)&&We.string(oe.newUri)&&(oe.options===void 0||(oe.options.overwrite===void 0||We.boolean(oe.options.overwrite))&&(oe.options.ignoreIfExists===void 0||We.boolean(oe.options.ignoreIfExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(B||(e.RenameFile=B={}));var L;(function(ce){function Re(ge,oe,ze){var at={kind:"delete",uri:ge};return oe!==void 0&&(oe.recursive!==void 0||oe.ignoreIfNotExists!==void 0)&&(at.options=oe),ze!==void 0&&(at.annotationId=ze),at}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return oe&&oe.kind==="delete"&&We.string(oe.uri)&&(oe.options===void 0||(oe.options.recursive===void 0||We.boolean(oe.options.recursive))&&(oe.options.ignoreIfNotExists===void 0||We.boolean(oe.options.ignoreIfNotExists)))&&(oe.annotationId===void 0||x.is(oe.annotationId))}a(Me,"is"),ce.is=Me})(L||(e.DeleteFile=L={}));var j;(function(ce){function Re(Me){var ge=Me;return ge&&(ge.changes!==void 0||ge.documentChanges!==void 0)&&(ge.documentChanges===void 0||ge.documentChanges.every(function(oe){return We.string(oe.kind)?N.is(oe)||B.is(oe)||L.is(oe):D.is(oe)}))}a(Re,"is"),ce.is=Re})(j||(e.WorkspaceEdit=j={}));var M=(function(){function ce(Re,Me){this.edits=Re,this.changeAnnotations=Me}return a(ce,"TextEditChangeImpl"),ce.prototype.insert=function(Re,Me,ge){var oe,ze;if(ge===void 0?oe=w.insert(Re,Me):x.is(ge)?(ze=ge,oe=P.insert(Re,Me,ge)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ge),oe=P.insert(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.replace=function(Re,Me,ge){var oe,ze;if(ge===void 0?oe=w.replace(Re,Me):x.is(ge)?(ze=ge,oe=P.replace(Re,Me,ge)):(this.assertChangeAnnotations(this.changeAnnotations),ze=this.changeAnnotations.manage(ge),oe=P.replace(Re,Me,ze)),this.edits.push(oe),ze!==void 0)return ze},ce.prototype.delete=function(Re,Me){var ge,oe;if(Me===void 0?ge=w.del(Re):x.is(Me)?(oe=Me,ge=P.del(Re,Me)):(this.assertChangeAnnotations(this.changeAnnotations),oe=this.changeAnnotations.manage(Me),ge=P.del(Re,oe)),this.edits.push(ge),oe!==void 0)return oe},ce.prototype.add=function(Re){this.edits.push(Re)},ce.prototype.all=function(){return this.edits},ce.prototype.clear=function(){this.edits.splice(0,this.edits.length)},ce.prototype.assertChangeAnnotations=function(Re){if(Re===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},ce})(),O=(function(){function ce(Re){this._annotations=Re===void 0?Object.create(null):Re,this._counter=0,this._size=0}return a(ce,"ChangeAnnotations"),ce.prototype.all=function(){return this._annotations},Object.defineProperty(ce.prototype,"size",{get:a(function(){return this._size},"get"),enumerable:!1,configurable:!0}),ce.prototype.manage=function(Re,Me){var ge;if(x.is(Re)?ge=Re:(ge=this.nextId(),Me=Re),this._annotations[ge]!==void 0)throw new Error("Id ".concat(ge," is already in use."));if(Me===void 0)throw new Error("No annotation provided for id ".concat(ge));return this._annotations[ge]=Me,this._size++,ge},ce.prototype.nextId=function(){return this._counter++,this._counter.toString()},ce})(),q=(function(){function ce(Re){var Me=this;this._textEditChanges=Object.create(null),Re!==void 0?(this._workspaceEdit=Re,Re.documentChanges?(this._changeAnnotations=new O(Re.changeAnnotations),Re.changeAnnotations=this._changeAnnotations.all(),Re.documentChanges.forEach(function(ge){if(D.is(ge)){var oe=new M(ge.edits,Me._changeAnnotations);Me._textEditChanges[ge.textDocument.uri]=oe}})):Re.changes&&Object.keys(Re.changes).forEach(function(ge){var oe=new M(Re.changes[ge]);Me._textEditChanges[ge]=oe})):this._workspaceEdit={}}return a(ce,"WorkspaceChange"),Object.defineProperty(ce.prototype,"edit",{get:a(function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},"get"),enumerable:!1,configurable:!0}),ce.prototype.getTextEditChange=function(Re){if(z.is(Re)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var Me={uri:Re.uri,version:Re.version},ge=this._textEditChanges[Me.uri];if(!ge){var oe=[],ze={textDocument:Me,edits:oe};this._workspaceEdit.documentChanges.push(ze),ge=new M(oe,this._changeAnnotations),this._textEditChanges[Me.uri]=ge}return ge}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var ge=this._textEditChanges[Re];if(!ge){var oe=[];this._workspaceEdit.changes[Re]=oe,ge=new M(oe),this._textEditChanges[Re]=ge}return ge}},ce.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},ce.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},ce.prototype.createFile=function(Re,Me,ge){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ge=Me;var ze,at;if(oe===void 0?ze=N.create(Re,ge):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=N.create(Re,ge,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce.prototype.renameFile=function(Re,Me,ge,oe){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var ze;R.is(ge)||x.is(ge)?ze=ge:oe=ge;var at,$t;if(ze===void 0?at=B.create(Re,Me,oe):($t=x.is(ze)?ze:this._changeAnnotations.manage(ze),at=B.create(Re,Me,oe,$t)),this._workspaceEdit.documentChanges.push(at),$t!==void 0)return $t},ce.prototype.deleteFile=function(Re,Me,ge){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var oe;R.is(Me)||x.is(Me)?oe=Me:ge=Me;var ze,at;if(oe===void 0?ze=L.create(Re,ge):(at=x.is(oe)?oe:this._changeAnnotations.manage(oe),ze=L.create(Re,ge,at)),this._workspaceEdit.documentChanges.push(ze),at!==void 0)return at},ce})();e.WorkspaceChange=q;var Q;(function(ce){function Re(ge){return{uri:ge}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)}a(Me,"is"),ce.is=Me})(Q||(e.TextDocumentIdentifier=Q={}));var U;(function(ce){function Re(ge,oe){return{uri:ge,version:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)&&We.integer(oe.version)}a(Me,"is"),ce.is=Me})(U||(e.VersionedTextDocumentIdentifier=U={}));var z;(function(ce){function Re(ge,oe){return{uri:ge,version:oe}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)&&(oe.version===null||We.integer(oe.version))}a(Me,"is"),ce.is=Me})(z||(e.OptionalVersionedTextDocumentIdentifier=z={}));var W;(function(ce){function Re(ge,oe,ze,at){return{uri:ge,languageId:oe,version:ze,text:at}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return We.defined(oe)&&We.string(oe.uri)&&We.string(oe.languageId)&&We.integer(oe.version)&&We.string(oe.text)}a(Me,"is"),ce.is=Me})(W||(e.TextDocumentItem=W={}));var $;(function(ce){ce.PlainText="plaintext",ce.Markdown="markdown";function Re(Me){var ge=Me;return ge===ce.PlainText||ge===ce.Markdown}a(Re,"is"),ce.is=Re})($||(e.MarkupKind=$={}));var J;(function(ce){function Re(Me){var ge=Me;return We.objectLiteral(Me)&&$.is(ge.kind)&&We.string(ge.value)}a(Re,"is"),ce.is=Re})(J||(e.MarkupContent=J={}));var ne;(function(ce){ce.Text=1,ce.Method=2,ce.Function=3,ce.Constructor=4,ce.Field=5,ce.Variable=6,ce.Class=7,ce.Interface=8,ce.Module=9,ce.Property=10,ce.Unit=11,ce.Value=12,ce.Enum=13,ce.Keyword=14,ce.Snippet=15,ce.Color=16,ce.File=17,ce.Reference=18,ce.Folder=19,ce.EnumMember=20,ce.Constant=21,ce.Struct=22,ce.Event=23,ce.Operator=24,ce.TypeParameter=25})(ne||(e.CompletionItemKind=ne={}));var H;(function(ce){ce.PlainText=1,ce.Snippet=2})(H||(e.InsertTextFormat=H={}));var re;(function(ce){ce.Deprecated=1})(re||(e.CompletionItemTag=re={}));var ae;(function(ce){function Re(ge,oe,ze){return{newText:ge,insert:oe,replace:ze}}a(Re,"create"),ce.create=Re;function Me(ge){var oe=ge;return oe&&We.string(oe.newText)&&l.is(oe.insert)&&l.is(oe.replace)}a(Me,"is"),ce.is=Me})(ae||(e.InsertReplaceEdit=ae={}));var Oe;(function(ce){ce.asIs=1,ce.adjustIndentation=2})(Oe||(e.InsertTextMode=Oe={}));var ve;(function(ce){function Re(Me){var ge=Me;return ge&&(We.string(ge.detail)||ge.detail===void 0)&&(We.string(ge.description)||ge.description===void 0)}a(Re,"is"),ce.is=Re})(ve||(e.CompletionItemLabelDetails=ve={}));var Fe;(function(ce){function Re(Me){return{label:Me}}a(Re,"create"),ce.create=Re})(Fe||(e.CompletionItem=Fe={}));var Pe;(function(ce){function Re(Me,ge){return{items:Me||[],isIncomplete:!!ge}}a(Re,"create"),ce.create=Re})(Pe||(e.CompletionList=Pe={}));var Z;(function(ce){function Re(ge){return ge.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(Re,"fromPlainText"),ce.fromPlainText=Re;function Me(ge){var oe=ge;return We.string(oe)||We.objectLiteral(oe)&&We.string(oe.language)&&We.string(oe.value)}a(Me,"is"),ce.is=Me})(Z||(e.MarkedString=Z={}));var ee;(function(ce){function Re(Me){var ge=Me;return!!ge&&We.objectLiteral(ge)&&(J.is(ge.contents)||Z.is(ge.contents)||We.typedArray(ge.contents,Z.is))&&(Me.range===void 0||l.is(Me.range))}a(Re,"is"),ce.is=Re})(ee||(e.Hover=ee={}));var K;(function(ce){function Re(Me,ge){return ge?{label:Me,documentation:ge}:{label:Me}}a(Re,"create"),ce.create=Re})(K||(e.ParameterInformation=K={}));var pe;(function(ce){function Re(Me,ge){for(var oe=[],ze=2;ze=0;Nr--){var Hr=mr[Nr],Gr=Fe.offsetAt(Hr.range.start),zt=Fe.offsetAt(Hr.range.end);if(zt<=or)Ht=Ht.substring(0,Gr)+Hr.newText+Ht.substring(zt,Ht.length);else throw new Error("Overlapping edit");or=Gr}return Ht}a(de,"applyEdits"),oe.applyEdits=de;function te(Fe,et){if(Fe.length<=1)return Fe;var Ht=Fe.length/2|0,mr=Fe.slice(0,Ht),or=Fe.slice(Ht);te(mr,et),te(or,et);for(var Nr=0,Hr=0,Gr=0;Nr0&&ve.push(Se.length),this._lineOffsets=ve}return this._lineOffsets},oe.prototype.positionAt=function(ve){ve=Math.max(Math.min(ve,this._content.length),0);var Se=this.getLineOffsets(),de=0,te=Se.length;if(te===0)return c.create(0,ve);for(;deve?te=Fe:de=Fe+1}var et=de-1;return c.create(et,ve-Se[et])},oe.prototype.offsetAt=function(ve){var Se=this.getLineOffsets();if(ve.line>=Se.length)return this._content.length;if(ve.line<0)return 0;var de=Se[ve.line],te=ve.line+1"u"}a(de,"undefined"),oe.undefined=de;function te(zt){return zt===!0||zt===!1}a(te,"boolean"),oe.boolean=te;function Fe(zt){return ve.call(zt)==="[object String]"}a(Fe,"string"),oe.string=Fe;function et(zt){return ve.call(zt)==="[object Number]"}a(et,"number"),oe.number=et;function Ht(zt,_r,wm){return ve.call(zt)==="[object Number]"&&_r<=zt&&zt<=wm}a(Ht,"numberRange"),oe.numberRange=Ht;function mr(zt){return ve.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(mr,"integer"),oe.integer=mr;function or(zt){return ve.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(or,"uinteger"),oe.uinteger=or;function Nr(zt){return ve.call(zt)==="[object Function]"}a(Nr,"func"),oe.func=Nr;function Hr(zt){return zt!==null&&typeof zt=="object"}a(Hr,"objectLiteral"),oe.objectLiteral=Hr;function Gr(zt,_r){return Array.isArray(zt)&&zt.every(_r)}a(Gr,"typedArray"),oe.typedArray=Gr})(Be||(Be={}))})});var Sd=I(KC=>{"use strict";p();Object.defineProperty(KC,"__esModule",{value:!0});KC.ProtocolNotificationType=KC.ProtocolNotificationType0=KC.ProtocolRequestType=KC.ProtocolRequestType0=KC.RegistrationType=KC.MessageDirection=void 0;var toe=nW(),lGr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(lGr||(KC.MessageDirection=lGr={}));var Vkt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};KC.RegistrationType=Vkt;var Wkt=class extends toe.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};KC.ProtocolRequestType0=Wkt;var zkt=class extends toe.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,toe.ParameterStructures.byName)}};KC.ProtocolRequestType=zkt;var Ykt=class extends toe.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};KC.ProtocolNotificationType0=Ykt;var Kkt=class extends toe.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,toe.ParameterStructures.byName)}};KC.ProtocolNotificationType=Kkt});var s9e=I(mh=>{"use strict";p();Object.defineProperty(mh,"__esModule",{value:!0});mh.objectLiteral=mh.typedArray=mh.stringArray=mh.array=mh.func=mh.error=mh.number=mh.string=mh.boolean=void 0;function apo(t){return t===!0||t===!1}a(apo,"boolean");mh.boolean=apo;function uGr(t){return typeof t=="string"||t instanceof String}a(uGr,"string");mh.string=uGr;function cpo(t){return typeof t=="number"||t instanceof Number}a(cpo,"number");mh.number=cpo;function lpo(t){return t instanceof Error}a(lpo,"error");mh.error=lpo;function upo(t){return typeof t=="function"}a(upo,"func");mh.func=upo;function dGr(t){return Array.isArray(t)}a(dGr,"array");mh.array=dGr;function dpo(t){return dGr(t)&&t.every(e=>uGr(e))}a(dpo,"stringArray");mh.stringArray=dpo;function fpo(t,e){return Array.isArray(t)&&t.every(e)}a(fpo,"typedArray");mh.typedArray=fpo;function ppo(t){return t!==null&&typeof t=="object"}a(ppo,"objectLiteral");mh.objectLiteral=ppo});var hGr=I(a9e=>{"use strict";p();Object.defineProperty(a9e,"__esModule",{value:!0});a9e.ImplementationRequest=void 0;var fGr=Sd(),pGr;(function(t){t.method="textDocument/implementation",t.messageDirection=fGr.MessageDirection.clientToServer,t.type=new fGr.ProtocolRequestType(t.method)})(pGr||(a9e.ImplementationRequest=pGr={}))});var AGr=I(c9e=>{"use strict";p();Object.defineProperty(c9e,"__esModule",{value:!0});c9e.TypeDefinitionRequest=void 0;var mGr=Sd(),gGr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=mGr.MessageDirection.clientToServer,t.type=new mGr.ProtocolRequestType(t.method)})(gGr||(c9e.TypeDefinitionRequest=gGr={}))});var _Gr=I(roe=>{"use strict";p();Object.defineProperty(roe,"__esModule",{value:!0});roe.DidChangeWorkspaceFoldersNotification=roe.WorkspaceFoldersRequest=void 0;var l9e=Sd(),yGr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=l9e.MessageDirection.serverToClient,t.type=new l9e.ProtocolRequestType0(t.method)})(yGr||(roe.WorkspaceFoldersRequest=yGr={}));var EGr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=l9e.MessageDirection.clientToServer,t.type=new l9e.ProtocolNotificationType(t.method)})(EGr||(roe.DidChangeWorkspaceFoldersNotification=EGr={}))});var bGr=I(u9e=>{"use strict";p();Object.defineProperty(u9e,"__esModule",{value:!0});u9e.ConfigurationRequest=void 0;var CGr=Sd(),vGr;(function(t){t.method="workspace/configuration",t.messageDirection=CGr.MessageDirection.serverToClient,t.type=new CGr.ProtocolRequestType(t.method)})(vGr||(u9e.ConfigurationRequest=vGr={}))});var IGr=I(noe=>{"use strict";p();Object.defineProperty(noe,"__esModule",{value:!0});noe.ColorPresentationRequest=noe.DocumentColorRequest=void 0;var d9e=Sd(),SGr;(function(t){t.method="textDocument/documentColor",t.messageDirection=d9e.MessageDirection.clientToServer,t.type=new d9e.ProtocolRequestType(t.method)})(SGr||(noe.DocumentColorRequest=SGr={}));var TGr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=d9e.MessageDirection.clientToServer,t.type=new d9e.ProtocolRequestType(t.method)})(TGr||(noe.ColorPresentationRequest=TGr={}))});var RGr=I(ioe=>{"use strict";p();Object.defineProperty(ioe,"__esModule",{value:!0});ioe.FoldingRangeRefreshRequest=ioe.FoldingRangeRequest=void 0;var f9e=Sd(),xGr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=f9e.MessageDirection.clientToServer,t.type=new f9e.ProtocolRequestType(t.method)})(xGr||(ioe.FoldingRangeRequest=xGr={}));var wGr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=f9e.MessageDirection.serverToClient,t.type=new f9e.ProtocolRequestType0(t.method)})(wGr||(ioe.FoldingRangeRefreshRequest=wGr={}))});var DGr=I(p9e=>{"use strict";p();Object.defineProperty(p9e,"__esModule",{value:!0});p9e.DeclarationRequest=void 0;var kGr=Sd(),PGr;(function(t){t.method="textDocument/declaration",t.messageDirection=kGr.MessageDirection.clientToServer,t.type=new kGr.ProtocolRequestType(t.method)})(PGr||(p9e.DeclarationRequest=PGr={}))});var OGr=I(h9e=>{"use strict";p();Object.defineProperty(h9e,"__esModule",{value:!0});h9e.SelectionRangeRequest=void 0;var NGr=Sd(),MGr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=NGr.MessageDirection.clientToServer,t.type=new NGr.ProtocolRequestType(t.method)})(MGr||(h9e.SelectionRangeRequest=MGr={}))});var UGr=I(V9=>{"use strict";p();Object.defineProperty(V9,"__esModule",{value:!0});V9.WorkDoneProgressCancelNotification=V9.WorkDoneProgressCreateRequest=V9.WorkDoneProgress=void 0;var hpo=nW(),m9e=Sd(),BGr;(function(t){t.type=new hpo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(BGr||(V9.WorkDoneProgress=BGr={}));var LGr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=m9e.MessageDirection.serverToClient,t.type=new m9e.ProtocolRequestType(t.method)})(LGr||(V9.WorkDoneProgressCreateRequest=LGr={}));var FGr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=m9e.MessageDirection.clientToServer,t.type=new m9e.ProtocolNotificationType(t.method)})(FGr||(V9.WorkDoneProgressCancelNotification=FGr={}))});var HGr=I(W9=>{"use strict";p();Object.defineProperty(W9,"__esModule",{value:!0});W9.CallHierarchyOutgoingCallsRequest=W9.CallHierarchyIncomingCallsRequest=W9.CallHierarchyPrepareRequest=void 0;var ooe=Sd(),QGr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(QGr||(W9.CallHierarchyPrepareRequest=QGr={}));var qGr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(qGr||(W9.CallHierarchyIncomingCallsRequest=qGr={}));var jGr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ooe.MessageDirection.clientToServer,t.type=new ooe.ProtocolRequestType(t.method)})(jGr||(W9.CallHierarchyOutgoingCallsRequest=jGr={}))});var YGr=I(JC=>{"use strict";p();Object.defineProperty(JC,"__esModule",{value:!0});JC.SemanticTokensRefreshRequest=JC.SemanticTokensRangeRequest=JC.SemanticTokensDeltaRequest=JC.SemanticTokensRequest=JC.SemanticTokensRegistrationType=JC.TokenFormat=void 0;var jB=Sd(),GGr;(function(t){t.Relative="relative"})(GGr||(JC.TokenFormat=GGr={}));var MCe;(function(t){t.method="textDocument/semanticTokens",t.type=new jB.RegistrationType(t.method)})(MCe||(JC.SemanticTokensRegistrationType=MCe={}));var $Gr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})($Gr||(JC.SemanticTokensRequest=$Gr={}));var VGr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})(VGr||(JC.SemanticTokensDeltaRequest=VGr={}));var WGr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=jB.MessageDirection.clientToServer,t.type=new jB.ProtocolRequestType(t.method),t.registrationMethod=MCe.method})(WGr||(JC.SemanticTokensRangeRequest=WGr={}));var zGr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=jB.MessageDirection.serverToClient,t.type=new jB.ProtocolRequestType0(t.method)})(zGr||(JC.SemanticTokensRefreshRequest=zGr={}))});var ZGr=I(g9e=>{"use strict";p();Object.defineProperty(g9e,"__esModule",{value:!0});g9e.ShowDocumentRequest=void 0;var KGr=Sd(),JGr;(function(t){t.method="window/showDocument",t.messageDirection=KGr.MessageDirection.serverToClient,t.type=new KGr.ProtocolRequestType(t.method)})(JGr||(g9e.ShowDocumentRequest=JGr={}))});var t$r=I(A9e=>{"use strict";p();Object.defineProperty(A9e,"__esModule",{value:!0});A9e.LinkedEditingRangeRequest=void 0;var XGr=Sd(),e$r;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=XGr.MessageDirection.clientToServer,t.type=new XGr.ProtocolRequestType(t.method)})(e$r||(A9e.LinkedEditingRangeRequest=e$r={}))});var l$r=I(vy=>{"use strict";p();Object.defineProperty(vy,"__esModule",{value:!0});vy.WillDeleteFilesRequest=vy.DidDeleteFilesNotification=vy.DidRenameFilesNotification=vy.WillRenameFilesRequest=vy.DidCreateFilesNotification=vy.WillCreateFilesRequest=vy.FileOperationPatternKind=void 0;var PI=Sd(),r$r;(function(t){t.file="file",t.folder="folder"})(r$r||(vy.FileOperationPatternKind=r$r={}));var n$r;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(n$r||(vy.WillCreateFilesRequest=n$r={}));var i$r;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(i$r||(vy.DidCreateFilesNotification=i$r={}));var o$r;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(o$r||(vy.WillRenameFilesRequest=o$r={}));var s$r;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(s$r||(vy.DidRenameFilesNotification=s$r={}));var a$r;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolNotificationType(t.method)})(a$r||(vy.DidDeleteFilesNotification=a$r={}));var c$r;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=PI.MessageDirection.clientToServer,t.type=new PI.ProtocolRequestType(t.method)})(c$r||(vy.WillDeleteFilesRequest=c$r={}))});var h$r=I(z9=>{"use strict";p();Object.defineProperty(z9,"__esModule",{value:!0});z9.MonikerRequest=z9.MonikerKind=z9.UniquenessLevel=void 0;var u$r=Sd(),d$r;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})(d$r||(z9.UniquenessLevel=d$r={}));var f$r;(function(t){t.$import="import",t.$export="export",t.local="local"})(f$r||(z9.MonikerKind=f$r={}));var p$r;(function(t){t.method="textDocument/moniker",t.messageDirection=u$r.MessageDirection.clientToServer,t.type=new u$r.ProtocolRequestType(t.method)})(p$r||(z9.MonikerRequest=p$r={}))});var y$r=I(Y9=>{"use strict";p();Object.defineProperty(Y9,"__esModule",{value:!0});Y9.TypeHierarchySubtypesRequest=Y9.TypeHierarchySupertypesRequest=Y9.TypeHierarchyPrepareRequest=void 0;var soe=Sd(),m$r;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(m$r||(Y9.TypeHierarchyPrepareRequest=m$r={}));var g$r;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(g$r||(Y9.TypeHierarchySupertypesRequest=g$r={}));var A$r;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=soe.MessageDirection.clientToServer,t.type=new soe.ProtocolRequestType(t.method)})(A$r||(Y9.TypeHierarchySubtypesRequest=A$r={}))});var C$r=I(aoe=>{"use strict";p();Object.defineProperty(aoe,"__esModule",{value:!0});aoe.InlineValueRefreshRequest=aoe.InlineValueRequest=void 0;var y9e=Sd(),E$r;(function(t){t.method="textDocument/inlineValue",t.messageDirection=y9e.MessageDirection.clientToServer,t.type=new y9e.ProtocolRequestType(t.method)})(E$r||(aoe.InlineValueRequest=E$r={}));var _$r;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=y9e.MessageDirection.serverToClient,t.type=new y9e.ProtocolRequestType0(t.method)})(_$r||(aoe.InlineValueRefreshRequest=_$r={}))});var T$r=I(K9=>{"use strict";p();Object.defineProperty(K9,"__esModule",{value:!0});K9.InlayHintRefreshRequest=K9.InlayHintResolveRequest=K9.InlayHintRequest=void 0;var coe=Sd(),v$r;(function(t){t.method="textDocument/inlayHint",t.messageDirection=coe.MessageDirection.clientToServer,t.type=new coe.ProtocolRequestType(t.method)})(v$r||(K9.InlayHintRequest=v$r={}));var b$r;(function(t){t.method="inlayHint/resolve",t.messageDirection=coe.MessageDirection.clientToServer,t.type=new coe.ProtocolRequestType(t.method)})(b$r||(K9.InlayHintResolveRequest=b$r={}));var S$r;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=coe.MessageDirection.serverToClient,t.type=new coe.ProtocolRequestType0(t.method)})(S$r||(K9.InlayHintRefreshRequest=S$r={}))});var D$r=I(DI=>{"use strict";p();Object.defineProperty(DI,"__esModule",{value:!0});DI.DiagnosticRefreshRequest=DI.WorkspaceDiagnosticRequest=DI.DocumentDiagnosticRequest=DI.DocumentDiagnosticReportKind=DI.DiagnosticServerCancellationData=void 0;var P$r=nW(),mpo=s9e(),loe=Sd(),I$r;(function(t){function e(r){let n=r;return n&&mpo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(I$r||(DI.DiagnosticServerCancellationData=I$r={}));var x$r;(function(t){t.Full="full",t.Unchanged="unchanged"})(x$r||(DI.DocumentDiagnosticReportKind=x$r={}));var w$r;(function(t){t.method="textDocument/diagnostic",t.messageDirection=loe.MessageDirection.clientToServer,t.type=new loe.ProtocolRequestType(t.method),t.partialResult=new P$r.ProgressType})(w$r||(DI.DocumentDiagnosticRequest=w$r={}));var R$r;(function(t){t.method="workspace/diagnostic",t.messageDirection=loe.MessageDirection.clientToServer,t.type=new loe.ProtocolRequestType(t.method),t.partialResult=new P$r.ProgressType})(R$r||(DI.WorkspaceDiagnosticRequest=R$r={}));var k$r;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=loe.MessageDirection.serverToClient,t.type=new loe.ProtocolRequestType0(t.method)})(k$r||(DI.DiagnosticRefreshRequest=k$r={}))});var U$r=I(Of=>{"use strict";p();Object.defineProperty(Of,"__esModule",{value:!0});Of.DidCloseNotebookDocumentNotification=Of.DidSaveNotebookDocumentNotification=Of.DidChangeNotebookDocumentNotification=Of.NotebookCellArrayChange=Of.DidOpenNotebookDocumentNotification=Of.NotebookDocumentSyncRegistrationType=Of.NotebookDocument=Of.NotebookCell=Of.ExecutionSummary=Of.NotebookCellKind=void 0;var OCe=NCe(),Ck=s9e(),wN=Sd(),Jkt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(Jkt||(Of.NotebookCellKind=Jkt={}));var Zkt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return Ck.objectLiteral(s)&&OCe.uinteger.is(s.executionOrder)&&(s.success===void 0||Ck.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(Zkt||(Of.ExecutionSummary=Zkt={}));var E9e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return Ck.objectLiteral(c)&&Jkt.is(c.kind)&&OCe.DocumentUri.is(c.document)&&(c.metadata===void 0||Ck.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!Zkt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(_9e,"__esModule",{value:!0});_9e.InlineCompletionRequest=void 0;var Q$r=Sd(),q$r;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=Q$r.MessageDirection.clientToServer,t.type=new Q$r.ProtocolRequestType(t.method)})(q$r||(_9e.InlineCompletionRequest=q$r={}))});var tWr=I(Oe=>{"use strict";p();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.WorkspaceSymbolRequest=Oe.CodeActionResolveRequest=Oe.CodeActionRequest=Oe.DocumentSymbolRequest=Oe.DocumentHighlightRequest=Oe.ReferencesRequest=Oe.DefinitionRequest=Oe.SignatureHelpRequest=Oe.SignatureHelpTriggerKind=Oe.HoverRequest=Oe.CompletionResolveRequest=Oe.CompletionRequest=Oe.CompletionTriggerKind=Oe.PublishDiagnosticsNotification=Oe.WatchKind=Oe.RelativePattern=Oe.FileChangeType=Oe.DidChangeWatchedFilesNotification=Oe.WillSaveTextDocumentWaitUntilRequest=Oe.WillSaveTextDocumentNotification=Oe.TextDocumentSaveReason=Oe.DidSaveTextDocumentNotification=Oe.DidCloseTextDocumentNotification=Oe.DidChangeTextDocumentNotification=Oe.TextDocumentContentChangeEvent=Oe.DidOpenTextDocumentNotification=Oe.TextDocumentSyncKind=Oe.TelemetryEventNotification=Oe.LogMessageNotification=Oe.ShowMessageRequest=Oe.ShowMessageNotification=Oe.MessageType=Oe.DidChangeConfigurationNotification=Oe.ExitNotification=Oe.ShutdownRequest=Oe.InitializedNotification=Oe.InitializeErrorCodes=Oe.InitializeRequest=Oe.WorkDoneProgressOptions=Oe.TextDocumentRegistrationOptions=Oe.StaticRegistrationOptions=Oe.PositionEncodingKind=Oe.FailureHandlingKind=Oe.ResourceOperationKind=Oe.UnregistrationRequest=Oe.RegistrationRequest=Oe.DocumentSelector=Oe.NotebookCellTextDocumentFilter=Oe.NotebookDocumentFilter=Oe.TextDocumentFilter=void 0;Oe.MonikerRequest=Oe.MonikerKind=Oe.UniquenessLevel=Oe.WillDeleteFilesRequest=Oe.DidDeleteFilesNotification=Oe.WillRenameFilesRequest=Oe.DidRenameFilesNotification=Oe.WillCreateFilesRequest=Oe.DidCreateFilesNotification=Oe.FileOperationPatternKind=Oe.LinkedEditingRangeRequest=Oe.ShowDocumentRequest=Oe.SemanticTokensRegistrationType=Oe.SemanticTokensRefreshRequest=Oe.SemanticTokensRangeRequest=Oe.SemanticTokensDeltaRequest=Oe.SemanticTokensRequest=Oe.TokenFormat=Oe.CallHierarchyPrepareRequest=Oe.CallHierarchyOutgoingCallsRequest=Oe.CallHierarchyIncomingCallsRequest=Oe.WorkDoneProgressCancelNotification=Oe.WorkDoneProgressCreateRequest=Oe.WorkDoneProgress=Oe.SelectionRangeRequest=Oe.DeclarationRequest=Oe.FoldingRangeRefreshRequest=Oe.FoldingRangeRequest=Oe.ColorPresentationRequest=Oe.DocumentColorRequest=Oe.ConfigurationRequest=Oe.DidChangeWorkspaceFoldersNotification=Oe.WorkspaceFoldersRequest=Oe.TypeDefinitionRequest=Oe.ImplementationRequest=Oe.ApplyWorkspaceEditRequest=Oe.ExecuteCommandRequest=Oe.PrepareRenameRequest=Oe.RenameRequest=Oe.PrepareSupportDefaultBehavior=Oe.DocumentOnTypeFormattingRequest=Oe.DocumentRangesFormattingRequest=Oe.DocumentRangeFormattingRequest=Oe.DocumentFormattingRequest=Oe.DocumentLinkResolveRequest=Oe.DocumentLinkRequest=Oe.CodeLensRefreshRequest=Oe.CodeLensResolveRequest=Oe.CodeLensRequest=Oe.WorkspaceSymbolResolveRequest=void 0;Oe.InlineCompletionRequest=Oe.DidCloseNotebookDocumentNotification=Oe.DidSaveNotebookDocumentNotification=Oe.DidChangeNotebookDocumentNotification=Oe.NotebookCellArrayChange=Oe.DidOpenNotebookDocumentNotification=Oe.NotebookDocumentSyncRegistrationType=Oe.NotebookDocument=Oe.NotebookCell=Oe.ExecutionSummary=Oe.NotebookCellKind=Oe.DiagnosticRefreshRequest=Oe.WorkspaceDiagnosticRequest=Oe.DocumentDiagnosticRequest=Oe.DocumentDiagnosticReportKind=Oe.DiagnosticServerCancellationData=Oe.InlayHintRefreshRequest=Oe.InlayHintResolveRequest=Oe.InlayHintRequest=Oe.InlineValueRefreshRequest=Oe.InlineValueRequest=Oe.TypeHierarchySupertypesRequest=Oe.TypeHierarchySubtypesRequest=Oe.TypeHierarchyPrepareRequest=void 0;var br=Sd(),H$r=NCe(),Om=s9e(),gpo=hGr();Object.defineProperty(Oe,"ImplementationRequest",{enumerable:!0,get:a(function(){return gpo.ImplementationRequest},"get")});var Apo=AGr();Object.defineProperty(Oe,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return Apo.TypeDefinitionRequest},"get")});var JVr=_Gr();Object.defineProperty(Oe,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return JVr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Oe,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return JVr.DidChangeWorkspaceFoldersNotification},"get")});var ypo=bGr();Object.defineProperty(Oe,"ConfigurationRequest",{enumerable:!0,get:a(function(){return ypo.ConfigurationRequest},"get")});var ZVr=IGr();Object.defineProperty(Oe,"DocumentColorRequest",{enumerable:!0,get:a(function(){return ZVr.DocumentColorRequest},"get")});Object.defineProperty(Oe,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return ZVr.ColorPresentationRequest},"get")});var XVr=RGr();Object.defineProperty(Oe,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return XVr.FoldingRangeRequest},"get")});Object.defineProperty(Oe,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return XVr.FoldingRangeRefreshRequest},"get")});var Epo=DGr();Object.defineProperty(Oe,"DeclarationRequest",{enumerable:!0,get:a(function(){return Epo.DeclarationRequest},"get")});var _po=OGr();Object.defineProperty(Oe,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return _po.SelectionRangeRequest},"get")});var nPt=UGr();Object.defineProperty(Oe,"WorkDoneProgress",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgress},"get")});Object.defineProperty(Oe,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Oe,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return nPt.WorkDoneProgressCancelNotification},"get")});var iPt=HGr();Object.defineProperty(Oe,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Oe,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Oe,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return iPt.CallHierarchyPrepareRequest},"get")});var doe=YGr();Object.defineProperty(Oe,"TokenFormat",{enumerable:!0,get:a(function(){return doe.TokenFormat},"get")});Object.defineProperty(Oe,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRequest},"get")});Object.defineProperty(Oe,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRangeRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return doe.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Oe,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return doe.SemanticTokensRegistrationType},"get")});var Cpo=ZGr();Object.defineProperty(Oe,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return Cpo.ShowDocumentRequest},"get")});var vpo=t$r();Object.defineProperty(Oe,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return vpo.LinkedEditingRangeRequest},"get")});var iW=l$r();Object.defineProperty(Oe,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return iW.FileOperationPatternKind},"get")});Object.defineProperty(Oe,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return iW.DidCreateFilesNotification},"get")});Object.defineProperty(Oe,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return iW.WillCreateFilesRequest},"get")});Object.defineProperty(Oe,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return iW.DidRenameFilesNotification},"get")});Object.defineProperty(Oe,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return iW.WillRenameFilesRequest},"get")});Object.defineProperty(Oe,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return iW.DidDeleteFilesNotification},"get")});Object.defineProperty(Oe,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return iW.WillDeleteFilesRequest},"get")});var oPt=h$r();Object.defineProperty(Oe,"UniquenessLevel",{enumerable:!0,get:a(function(){return oPt.UniquenessLevel},"get")});Object.defineProperty(Oe,"MonikerKind",{enumerable:!0,get:a(function(){return oPt.MonikerKind},"get")});Object.defineProperty(Oe,"MonikerRequest",{enumerable:!0,get:a(function(){return oPt.MonikerRequest},"get")});var sPt=y$r();Object.defineProperty(Oe,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Oe,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Oe,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return sPt.TypeHierarchySupertypesRequest},"get")});var eWr=C$r();Object.defineProperty(Oe,"InlineValueRequest",{enumerable:!0,get:a(function(){return eWr.InlineValueRequest},"get")});Object.defineProperty(Oe,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return eWr.InlineValueRefreshRequest},"get")});var aPt=T$r();Object.defineProperty(Oe,"InlayHintRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintRequest},"get")});Object.defineProperty(Oe,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintResolveRequest},"get")});Object.defineProperty(Oe,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return aPt.InlayHintRefreshRequest},"get")});var BCe=D$r();Object.defineProperty(Oe,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return BCe.DiagnosticServerCancellationData},"get")});Object.defineProperty(Oe,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return BCe.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Oe,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return BCe.DocumentDiagnosticRequest},"get")});Object.defineProperty(Oe,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return BCe.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Oe,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return BCe.DiagnosticRefreshRequest},"get")});var RN=U$r();Object.defineProperty(Oe,"NotebookCellKind",{enumerable:!0,get:a(function(){return RN.NotebookCellKind},"get")});Object.defineProperty(Oe,"ExecutionSummary",{enumerable:!0,get:a(function(){return RN.ExecutionSummary},"get")});Object.defineProperty(Oe,"NotebookCell",{enumerable:!0,get:a(function(){return RN.NotebookCell},"get")});Object.defineProperty(Oe,"NotebookDocument",{enumerable:!0,get:a(function(){return RN.NotebookDocument},"get")});Object.defineProperty(Oe,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return RN.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Oe,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return RN.NotebookCellArrayChange},"get")});Object.defineProperty(Oe,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Oe,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return RN.DidCloseNotebookDocumentNotification},"get")});var bpo=j$r();Object.defineProperty(Oe,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return bpo.InlineCompletionRequest},"get")});var Xkt;(function(t){function e(r){let n=r;return Om.string(n)||Om.string(n.language)||Om.string(n.scheme)||Om.string(n.pattern)}a(e,"is"),t.is=e})(Xkt||(Oe.TextDocumentFilter=Xkt={}));var ePt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebookType)||Om.string(n.scheme)||Om.string(n.pattern))}a(e,"is"),t.is=e})(ePt||(Oe.NotebookDocumentFilter=ePt={}));var tPt;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(Om.string(n.notebook)||ePt.is(n.notebook))&&(n.language===void 0||Om.string(n.language))}a(e,"is"),t.is=e})(tPt||(Oe.NotebookCellTextDocumentFilter=tPt={}));var rPt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Om.string(n)&&!Xkt.is(n)&&!tPt.is(n))return!1;return!0}a(e,"is"),t.is=e})(rPt||(Oe.DocumentSelector=rPt={}));var G$r;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(G$r||(Oe.RegistrationRequest=G$r={}));var $$r;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})($$r||(Oe.UnregistrationRequest=$$r={}));var V$r;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(V$r||(Oe.ResourceOperationKind=V$r={}));var W$r;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(W$r||(Oe.FailureHandlingKind=W$r={}));var z$r;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(z$r||(Oe.PositionEncodingKind=z$r={}));var Y$r;(function(t){function e(r){let n=r;return n&&Om.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(Y$r||(Oe.StaticRegistrationOptions=Y$r={}));var K$r;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||rPt.is(n.documentSelector))}a(e,"is"),t.is=e})(K$r||(Oe.TextDocumentRegistrationOptions=K$r={}));var J$r;(function(t){function e(n){let o=n;return Om.objectLiteral(o)&&(o.workDoneProgress===void 0||Om.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Om.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(J$r||(Oe.WorkDoneProgressOptions=J$r={}));var Z$r;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(Z$r||(Oe.InitializeRequest=Z$r={}));var X$r;(function(t){t.unknownProtocolVersion=1})(X$r||(Oe.InitializeErrorCodes=X$r={}));var eVr;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(eVr||(Oe.InitializedNotification=eVr={}));var tVr;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(tVr||(Oe.ShutdownRequest=tVr={}));var rVr;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(rVr||(Oe.ExitNotification=rVr={}));var nVr;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(nVr||(Oe.DidChangeConfigurationNotification=nVr={}));var iVr;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(iVr||(Oe.MessageType=iVr={}));var oVr;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(oVr||(Oe.ShowMessageNotification=oVr={}));var sVr;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(sVr||(Oe.ShowMessageRequest=sVr={}));var aVr;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(aVr||(Oe.LogMessageNotification=aVr={}));var cVr;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(cVr||(Oe.TelemetryEventNotification=cVr={}));var lVr;(function(t){t.None=0,t.Full=1,t.Incremental=2})(lVr||(Oe.TextDocumentSyncKind=lVr={}));var uVr;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(uVr||(Oe.DidOpenTextDocumentNotification=uVr={}));var dVr;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})(dVr||(Oe.TextDocumentContentChangeEvent=dVr={}));var fVr;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(fVr||(Oe.DidChangeTextDocumentNotification=fVr={}));var pVr;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(pVr||(Oe.DidCloseTextDocumentNotification=pVr={}));var hVr;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(hVr||(Oe.DidSaveTextDocumentNotification=hVr={}));var mVr;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(mVr||(Oe.TextDocumentSaveReason=mVr={}));var gVr;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(gVr||(Oe.WillSaveTextDocumentNotification=gVr={}));var AVr;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(AVr||(Oe.WillSaveTextDocumentWaitUntilRequest=AVr={}));var yVr;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(yVr||(Oe.DidChangeWatchedFilesNotification=yVr={}));var EVr;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(EVr||(Oe.FileChangeType=EVr={}));var _Vr;(function(t){function e(r){let n=r;return Om.objectLiteral(n)&&(H$r.URI.is(n.baseUri)||H$r.WorkspaceFolder.is(n.baseUri))&&Om.string(n.pattern)}a(e,"is"),t.is=e})(_Vr||(Oe.RelativePattern=_Vr={}));var CVr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(CVr||(Oe.WatchKind=CVr={}));var vVr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(vVr||(Oe.PublishDiagnosticsNotification=vVr={}));var bVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(bVr||(Oe.CompletionTriggerKind=bVr={}));var SVr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(SVr||(Oe.CompletionRequest=SVr={}));var TVr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(TVr||(Oe.CompletionResolveRequest=TVr={}));var IVr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(IVr||(Oe.HoverRequest=IVr={}));var xVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(xVr||(Oe.SignatureHelpTriggerKind=xVr={}));var wVr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(wVr||(Oe.SignatureHelpRequest=wVr={}));var RVr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(RVr||(Oe.DefinitionRequest=RVr={}));var kVr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(kVr||(Oe.ReferencesRequest=kVr={}));var PVr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(PVr||(Oe.DocumentHighlightRequest=PVr={}));var DVr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(DVr||(Oe.DocumentSymbolRequest=DVr={}));var NVr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(NVr||(Oe.CodeActionRequest=NVr={}));var MVr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(MVr||(Oe.CodeActionResolveRequest=MVr={}));var OVr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(OVr||(Oe.WorkspaceSymbolRequest=OVr={}));var BVr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(BVr||(Oe.WorkspaceSymbolResolveRequest=BVr={}));var LVr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(LVr||(Oe.CodeLensRequest=LVr={}));var FVr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(FVr||(Oe.CodeLensResolveRequest=FVr={}));var UVr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(UVr||(Oe.CodeLensRefreshRequest=UVr={}));var QVr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(QVr||(Oe.DocumentLinkRequest=QVr={}));var qVr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(qVr||(Oe.DocumentLinkResolveRequest=qVr={}));var jVr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(jVr||(Oe.DocumentFormattingRequest=jVr={}));var HVr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(HVr||(Oe.DocumentRangeFormattingRequest=HVr={}));var GVr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(GVr||(Oe.DocumentRangesFormattingRequest=GVr={}));var $Vr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})($Vr||(Oe.DocumentOnTypeFormattingRequest=$Vr={}));var VVr;(function(t){t.Identifier=1})(VVr||(Oe.PrepareSupportDefaultBehavior=VVr={}));var WVr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(WVr||(Oe.RenameRequest=WVr={}));var zVr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(zVr||(Oe.PrepareRenameRequest=zVr={}));var YVr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(YVr||(Oe.ExecuteCommandRequest=YVr={}));var KVr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(KVr||(Oe.ApplyWorkspaceEditRequest=KVr={}))});var nWr=I(C9e=>{"use strict";p();Object.defineProperty(C9e,"__esModule",{value:!0});C9e.createProtocolConnection=void 0;var rWr=nW();function Spo(t,e,r,n){return rWr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,rWr.createMessageConnection)(t,e,r,n)}a(Spo,"createProtocolConnection");C9e.createProtocolConnection=Spo});var oWr=I(ZC=>{"use strict";p();var Tpo=ZC&&ZC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v9e=ZC&&ZC.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tpo(e,t,r)};Object.defineProperty(ZC,"__esModule",{value:!0});ZC.LSPErrorCodes=ZC.createProtocolConnection=void 0;v9e(nW(),ZC);v9e(NCe(),ZC);v9e(Sd(),ZC);v9e(tWr(),ZC);var Ipo=nWr();Object.defineProperty(ZC,"createProtocolConnection",{enumerable:!0,get:a(function(){return Ipo.createProtocolConnection},"get")});var iWr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(iWr||(ZC.LSPErrorCodes=iWr={}))});var ti=I(kN=>{"use strict";p();var xpo=kN&&kN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sWr=kN&&kN.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xpo(e,t,r)};Object.defineProperty(kN,"__esModule",{value:!0});kN.createProtocolConnection=void 0;var wpo=$kt();sWr($kt(),kN);sWr(oWr(),kN);function Rpo(t,e,r,n){return(0,wpo.createMessageConnection)(t,e,r,n)}a(Rpo,"createProtocolConnection");kN.createProtocolConnection=Rpo});var gMt=I(eqe=>{"use strict";p();Object.defineProperty(eqe,"__esModule",{value:!0});eqe.state=void 0;eqe.state={instrumenterImplementation:void 0}});var Cae=I((Y5t,den)=>{p();var eje=require("buffer"),AM=eje.Buffer;function uen(t,e){for(var r in t)e[r]=t[r]}a(uen,"copyProps");AM.from&&AM.alloc&&AM.allocUnsafe&&AM.allocUnsafeSlow?den.exports=eje:(uen(eje,Y5t),Y5t.Buffer=Fz);function Fz(t,e,r){return AM(t,e,r)}a(Fz,"SafeBuffer");Fz.prototype=Object.create(AM.prototype);uen(AM,Fz);Fz.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return AM(t,e,r)};Fz.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=AM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Fz.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return AM(t)};Fz.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return eje.SlowBuffer(t)}});var K5t=I((SGl,fen)=>{p();var tje=Cae().Buffer,W_o=require("stream"),z_o=require("util");function rje(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=tje.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=tje.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(rje,"DataStream");z_o.inherits(rje,W_o);rje.prototype.write=a(function(e){this.buffer=tje.concat([this.buffer,tje.from(e)]),this.emit("data",e)},"write");rje.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");fen.exports=rje});var hen=I((xGl,pen)=>{"use strict";p();function J5t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(J5t,"getParamSize");var Y_o={ES256:J5t(256),ES384:J5t(384),ES512:J5t(521)};function K_o(t){var e=Y_o[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(K_o,"getParamBytesForAlg");pen.exports=K_o});var Cen=I((kGl,_en)=>{"use strict";p();var nje=Cae().Buffer,gen=hen(),ije=128,Aen=0,J_o=32,Z_o=16,X_o=2,yen=Z_o|J_o|Aen<<6,oje=X_o|Aen<<6;function eCo(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(eCo,"base64Url");function Een(t){if(nje.isBuffer(t))return t;if(typeof t=="string")return nje.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(Een,"signatureAsBuffer");function tCo(t,e){t=Een(t);var r=gen(e),n=r+1,o=t.length,s=0;if(t[s++]!==yen)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(ije|1)&&(c=t[s++]),o-s=ije;return o&&--n,n}a(men,"countPadding");function rCo(t,e){t=Een(t);var r=gen(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=men(t,0,r),s=men(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var D1e=require("buffer").Buffer,Z5t=require("buffer").SlowBuffer;ven.exports=sje;function sje(t,e){if(!D1e.isBuffer(t)||!D1e.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var bae=Cae().Buffer,ax=require("crypto"),Ten=Cen(),Sen=require("util"),oCo=`"%s" is not a valid algorithm. +`,"\r"];var bt;(function(ce){function Re(ze,at,$t,gr){return new ht(ze,at,$t,gr)}a(Re,"create"),ce.create=Re;function Me(ze){var at=ze;return!!(We.defined(at)&&We.string(at.uri)&&(We.undefined(at.languageId)||We.string(at.languageId))&&We.uinteger(at.lineCount)&&We.func(at.getText)&&We.func(at.positionAt)&&We.func(at.offsetAt))}a(Me,"is"),ce.is=Me;function ge(ze,at){for(var $t=ze.getText(),gr=oe(at,function(_r,Pm){var O6r=_r.range.start.line-Pm.range.start.line;return O6r===0?_r.range.start.character-Pm.range.start.character:O6r}),sr=$t.length,Mr=gr.length-1;Mr>=0;Mr--){var Hr=gr[Mr],Gr=ze.offsetAt(Hr.range.start),zt=ze.offsetAt(Hr.range.end);if(zt<=sr)$t=$t.substring(0,Gr)+Hr.newText+$t.substring(zt,$t.length);else throw new Error("Overlapping edit");sr=Gr}return $t}a(ge,"applyEdits"),ce.applyEdits=ge;function oe(ze,at){if(ze.length<=1)return ze;var $t=ze.length/2|0,gr=ze.slice(0,$t),sr=ze.slice($t);oe(gr,at),oe(sr,at);for(var Mr=0,Hr=0,Gr=0;Mr0&&Re.push(Me.length),this._lineOffsets=Re}return this._lineOffsets},ce.prototype.positionAt=function(Re){Re=Math.max(Math.min(Re,this._content.length),0);var Me=this.getLineOffsets(),ge=0,oe=Me.length;if(oe===0)return c.create(0,Re);for(;geRe?oe=ze:ge=ze+1}var at=ge-1;return c.create(at,Re-Me[at])},ce.prototype.offsetAt=function(Re){var Me=this.getLineOffsets();if(Re.line>=Me.length)return this._content.length;if(Re.line<0)return 0;var ge=Me[Re.line],oe=Re.line+1"u"}a(ge,"undefined"),ce.undefined=ge;function oe(zt){return zt===!0||zt===!1}a(oe,"boolean"),ce.boolean=oe;function ze(zt){return Re.call(zt)==="[object String]"}a(ze,"string"),ce.string=ze;function at(zt){return Re.call(zt)==="[object Number]"}a(at,"number"),ce.number=at;function $t(zt,_r,Pm){return Re.call(zt)==="[object Number]"&&_r<=zt&&zt<=Pm}a($t,"numberRange"),ce.numberRange=$t;function gr(zt){return Re.call(zt)==="[object Number]"&&-2147483648<=zt&&zt<=2147483647}a(gr,"integer"),ce.integer=gr;function sr(zt){return Re.call(zt)==="[object Number]"&&0<=zt&&zt<=2147483647}a(sr,"uinteger"),ce.uinteger=sr;function Mr(zt){return Re.call(zt)==="[object Function]"}a(Mr,"func"),ce.func=Mr;function Hr(zt){return zt!==null&&typeof zt=="object"}a(Hr,"objectLiteral"),ce.objectLiteral=Hr;function Gr(zt,_r){return Array.isArray(zt)&&zt.every(_r)}a(Gr,"typedArray"),ce.typedArray=Gr})(We||(We={}))})});var Sd=I(zv=>{"use strict";p();Object.defineProperty(zv,"__esModule",{value:!0});zv.ProtocolNotificationType=zv.ProtocolNotificationType0=zv.ProtocolRequestType=zv.ProtocolRequestType0=zv.RegistrationType=zv.MessageDirection=void 0;var zie=WV(),HHr;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both"})(HHr||(zv.MessageDirection=HHr={}));var BPt=class{static{a(this,"RegistrationType")}constructor(e){this.method=e}};zv.RegistrationType=BPt;var LPt=class extends zie.RequestType0{static{a(this,"ProtocolRequestType0")}constructor(e){super(e)}};zv.ProtocolRequestType0=LPt;var FPt=class extends zie.RequestType{static{a(this,"ProtocolRequestType")}constructor(e){super(e,zie.ParameterStructures.byName)}};zv.ProtocolRequestType=FPt;var UPt=class extends zie.NotificationType0{static{a(this,"ProtocolNotificationType0")}constructor(e){super(e)}};zv.ProtocolNotificationType0=UPt;var QPt=class extends zie.NotificationType{static{a(this,"ProtocolNotificationType")}constructor(e){super(e,zie.ParameterStructures.byName)}};zv.ProtocolNotificationType=QPt});var W6e=I(yh=>{"use strict";p();Object.defineProperty(yh,"__esModule",{value:!0});yh.objectLiteral=yh.typedArray=yh.stringArray=yh.array=yh.func=yh.error=yh.number=yh.string=yh.boolean=void 0;function tpo(t){return t===!0||t===!1}a(tpo,"boolean");yh.boolean=tpo;function GHr(t){return typeof t=="string"||t instanceof String}a(GHr,"string");yh.string=GHr;function rpo(t){return typeof t=="number"||t instanceof Number}a(rpo,"number");yh.number=rpo;function npo(t){return t instanceof Error}a(npo,"error");yh.error=npo;function ipo(t){return typeof t=="function"}a(ipo,"func");yh.func=ipo;function $Hr(t){return Array.isArray(t)}a($Hr,"array");yh.array=$Hr;function opo(t){return $Hr(t)&&t.every(e=>GHr(e))}a(opo,"stringArray");yh.stringArray=opo;function spo(t,e){return Array.isArray(t)&&t.every(e)}a(spo,"typedArray");yh.typedArray=spo;function apo(t){return t!==null&&typeof t=="object"}a(apo,"objectLiteral");yh.objectLiteral=apo});var zHr=I(z6e=>{"use strict";p();Object.defineProperty(z6e,"__esModule",{value:!0});z6e.ImplementationRequest=void 0;var VHr=Sd(),WHr;(function(t){t.method="textDocument/implementation",t.messageDirection=VHr.MessageDirection.clientToServer,t.type=new VHr.ProtocolRequestType(t.method)})(WHr||(z6e.ImplementationRequest=WHr={}))});var JHr=I(Y6e=>{"use strict";p();Object.defineProperty(Y6e,"__esModule",{value:!0});Y6e.TypeDefinitionRequest=void 0;var YHr=Sd(),KHr;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=YHr.MessageDirection.clientToServer,t.type=new YHr.ProtocolRequestType(t.method)})(KHr||(Y6e.TypeDefinitionRequest=KHr={}))});var eGr=I(Yie=>{"use strict";p();Object.defineProperty(Yie,"__esModule",{value:!0});Yie.DidChangeWorkspaceFoldersNotification=Yie.WorkspaceFoldersRequest=void 0;var K6e=Sd(),ZHr;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=K6e.MessageDirection.serverToClient,t.type=new K6e.ProtocolRequestType0(t.method)})(ZHr||(Yie.WorkspaceFoldersRequest=ZHr={}));var XHr;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=K6e.MessageDirection.clientToServer,t.type=new K6e.ProtocolNotificationType(t.method)})(XHr||(Yie.DidChangeWorkspaceFoldersNotification=XHr={}))});var nGr=I(J6e=>{"use strict";p();Object.defineProperty(J6e,"__esModule",{value:!0});J6e.ConfigurationRequest=void 0;var tGr=Sd(),rGr;(function(t){t.method="workspace/configuration",t.messageDirection=tGr.MessageDirection.serverToClient,t.type=new tGr.ProtocolRequestType(t.method)})(rGr||(J6e.ConfigurationRequest=rGr={}))});var sGr=I(Kie=>{"use strict";p();Object.defineProperty(Kie,"__esModule",{value:!0});Kie.ColorPresentationRequest=Kie.DocumentColorRequest=void 0;var Z6e=Sd(),iGr;(function(t){t.method="textDocument/documentColor",t.messageDirection=Z6e.MessageDirection.clientToServer,t.type=new Z6e.ProtocolRequestType(t.method)})(iGr||(Kie.DocumentColorRequest=iGr={}));var oGr;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=Z6e.MessageDirection.clientToServer,t.type=new Z6e.ProtocolRequestType(t.method)})(oGr||(Kie.ColorPresentationRequest=oGr={}))});var lGr=I(Jie=>{"use strict";p();Object.defineProperty(Jie,"__esModule",{value:!0});Jie.FoldingRangeRefreshRequest=Jie.FoldingRangeRequest=void 0;var X6e=Sd(),aGr;(function(t){t.method="textDocument/foldingRange",t.messageDirection=X6e.MessageDirection.clientToServer,t.type=new X6e.ProtocolRequestType(t.method)})(aGr||(Jie.FoldingRangeRequest=aGr={}));var cGr;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=X6e.MessageDirection.serverToClient,t.type=new X6e.ProtocolRequestType0(t.method)})(cGr||(Jie.FoldingRangeRefreshRequest=cGr={}))});var fGr=I(e9e=>{"use strict";p();Object.defineProperty(e9e,"__esModule",{value:!0});e9e.DeclarationRequest=void 0;var uGr=Sd(),dGr;(function(t){t.method="textDocument/declaration",t.messageDirection=uGr.MessageDirection.clientToServer,t.type=new uGr.ProtocolRequestType(t.method)})(dGr||(e9e.DeclarationRequest=dGr={}))});var mGr=I(t9e=>{"use strict";p();Object.defineProperty(t9e,"__esModule",{value:!0});t9e.SelectionRangeRequest=void 0;var pGr=Sd(),hGr;(function(t){t.method="textDocument/selectionRange",t.messageDirection=pGr.MessageDirection.clientToServer,t.type=new pGr.ProtocolRequestType(t.method)})(hGr||(t9e.SelectionRangeRequest=hGr={}))});var EGr=I(U9=>{"use strict";p();Object.defineProperty(U9,"__esModule",{value:!0});U9.WorkDoneProgressCancelNotification=U9.WorkDoneProgressCreateRequest=U9.WorkDoneProgress=void 0;var cpo=WV(),r9e=Sd(),gGr;(function(t){t.type=new cpo.ProgressType;function e(r){return r===t.type}a(e,"is"),t.is=e})(gGr||(U9.WorkDoneProgress=gGr={}));var AGr;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=r9e.MessageDirection.serverToClient,t.type=new r9e.ProtocolRequestType(t.method)})(AGr||(U9.WorkDoneProgressCreateRequest=AGr={}));var yGr;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=r9e.MessageDirection.clientToServer,t.type=new r9e.ProtocolNotificationType(t.method)})(yGr||(U9.WorkDoneProgressCancelNotification=yGr={}))});var bGr=I(Q9=>{"use strict";p();Object.defineProperty(Q9,"__esModule",{value:!0});Q9.CallHierarchyOutgoingCallsRequest=Q9.CallHierarchyIncomingCallsRequest=Q9.CallHierarchyPrepareRequest=void 0;var Zie=Sd(),_Gr;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=Zie.MessageDirection.clientToServer,t.type=new Zie.ProtocolRequestType(t.method)})(_Gr||(Q9.CallHierarchyPrepareRequest=_Gr={}));var vGr;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=Zie.MessageDirection.clientToServer,t.type=new Zie.ProtocolRequestType(t.method)})(vGr||(Q9.CallHierarchyIncomingCallsRequest=vGr={}));var CGr;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=Zie.MessageDirection.clientToServer,t.type=new Zie.ProtocolRequestType(t.method)})(CGr||(Q9.CallHierarchyOutgoingCallsRequest=CGr={}))});var RGr=I(Yv=>{"use strict";p();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.SemanticTokensRefreshRequest=Yv.SemanticTokensRangeRequest=Yv.SemanticTokensDeltaRequest=Yv.SemanticTokensRequest=Yv.SemanticTokensRegistrationType=Yv.TokenFormat=void 0;var MB=Sd(),SGr;(function(t){t.Relative="relative"})(SGr||(Yv.TokenFormat=SGr={}));var Cve;(function(t){t.method="textDocument/semanticTokens",t.type=new MB.RegistrationType(t.method)})(Cve||(Yv.SemanticTokensRegistrationType=Cve={}));var TGr;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=MB.MessageDirection.clientToServer,t.type=new MB.ProtocolRequestType(t.method),t.registrationMethod=Cve.method})(TGr||(Yv.SemanticTokensRequest=TGr={}));var IGr;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=MB.MessageDirection.clientToServer,t.type=new MB.ProtocolRequestType(t.method),t.registrationMethod=Cve.method})(IGr||(Yv.SemanticTokensDeltaRequest=IGr={}));var xGr;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=MB.MessageDirection.clientToServer,t.type=new MB.ProtocolRequestType(t.method),t.registrationMethod=Cve.method})(xGr||(Yv.SemanticTokensRangeRequest=xGr={}));var wGr;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=MB.MessageDirection.serverToClient,t.type=new MB.ProtocolRequestType0(t.method)})(wGr||(Yv.SemanticTokensRefreshRequest=wGr={}))});var DGr=I(n9e=>{"use strict";p();Object.defineProperty(n9e,"__esModule",{value:!0});n9e.ShowDocumentRequest=void 0;var PGr=Sd(),kGr;(function(t){t.method="window/showDocument",t.messageDirection=PGr.MessageDirection.serverToClient,t.type=new PGr.ProtocolRequestType(t.method)})(kGr||(n9e.ShowDocumentRequest=kGr={}))});var OGr=I(i9e=>{"use strict";p();Object.defineProperty(i9e,"__esModule",{value:!0});i9e.LinkedEditingRangeRequest=void 0;var NGr=Sd(),MGr;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=NGr.MessageDirection.clientToServer,t.type=new NGr.ProtocolRequestType(t.method)})(MGr||(i9e.LinkedEditingRangeRequest=MGr={}))});var HGr=I(Iy=>{"use strict";p();Object.defineProperty(Iy,"__esModule",{value:!0});Iy.WillDeleteFilesRequest=Iy.DidDeleteFilesNotification=Iy.DidRenameFilesNotification=Iy.WillRenameFilesRequest=Iy.DidCreateFilesNotification=Iy.WillCreateFilesRequest=Iy.FileOperationPatternKind=void 0;var xI=Sd(),BGr;(function(t){t.file="file",t.folder="folder"})(BGr||(Iy.FileOperationPatternKind=BGr={}));var LGr;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolRequestType(t.method)})(LGr||(Iy.WillCreateFilesRequest=LGr={}));var FGr;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolNotificationType(t.method)})(FGr||(Iy.DidCreateFilesNotification=FGr={}));var UGr;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolRequestType(t.method)})(UGr||(Iy.WillRenameFilesRequest=UGr={}));var QGr;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolNotificationType(t.method)})(QGr||(Iy.DidRenameFilesNotification=QGr={}));var qGr;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolNotificationType(t.method)})(qGr||(Iy.DidDeleteFilesNotification=qGr={}));var jGr;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=xI.MessageDirection.clientToServer,t.type=new xI.ProtocolRequestType(t.method)})(jGr||(Iy.WillDeleteFilesRequest=jGr={}))});var zGr=I(q9=>{"use strict";p();Object.defineProperty(q9,"__esModule",{value:!0});q9.MonikerRequest=q9.MonikerKind=q9.UniquenessLevel=void 0;var GGr=Sd(),$Gr;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global"})($Gr||(q9.UniquenessLevel=$Gr={}));var VGr;(function(t){t.$import="import",t.$export="export",t.local="local"})(VGr||(q9.MonikerKind=VGr={}));var WGr;(function(t){t.method="textDocument/moniker",t.messageDirection=GGr.MessageDirection.clientToServer,t.type=new GGr.ProtocolRequestType(t.method)})(WGr||(q9.MonikerRequest=WGr={}))});var ZGr=I(j9=>{"use strict";p();Object.defineProperty(j9,"__esModule",{value:!0});j9.TypeHierarchySubtypesRequest=j9.TypeHierarchySupertypesRequest=j9.TypeHierarchyPrepareRequest=void 0;var Xie=Sd(),YGr;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=Xie.MessageDirection.clientToServer,t.type=new Xie.ProtocolRequestType(t.method)})(YGr||(j9.TypeHierarchyPrepareRequest=YGr={}));var KGr;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=Xie.MessageDirection.clientToServer,t.type=new Xie.ProtocolRequestType(t.method)})(KGr||(j9.TypeHierarchySupertypesRequest=KGr={}));var JGr;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=Xie.MessageDirection.clientToServer,t.type=new Xie.ProtocolRequestType(t.method)})(JGr||(j9.TypeHierarchySubtypesRequest=JGr={}))});var t$r=I(eoe=>{"use strict";p();Object.defineProperty(eoe,"__esModule",{value:!0});eoe.InlineValueRefreshRequest=eoe.InlineValueRequest=void 0;var o9e=Sd(),XGr;(function(t){t.method="textDocument/inlineValue",t.messageDirection=o9e.MessageDirection.clientToServer,t.type=new o9e.ProtocolRequestType(t.method)})(XGr||(eoe.InlineValueRequest=XGr={}));var e$r;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=o9e.MessageDirection.serverToClient,t.type=new o9e.ProtocolRequestType0(t.method)})(e$r||(eoe.InlineValueRefreshRequest=e$r={}))});var o$r=I(H9=>{"use strict";p();Object.defineProperty(H9,"__esModule",{value:!0});H9.InlayHintRefreshRequest=H9.InlayHintResolveRequest=H9.InlayHintRequest=void 0;var toe=Sd(),r$r;(function(t){t.method="textDocument/inlayHint",t.messageDirection=toe.MessageDirection.clientToServer,t.type=new toe.ProtocolRequestType(t.method)})(r$r||(H9.InlayHintRequest=r$r={}));var n$r;(function(t){t.method="inlayHint/resolve",t.messageDirection=toe.MessageDirection.clientToServer,t.type=new toe.ProtocolRequestType(t.method)})(n$r||(H9.InlayHintResolveRequest=n$r={}));var i$r;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=toe.MessageDirection.serverToClient,t.type=new toe.ProtocolRequestType0(t.method)})(i$r||(H9.InlayHintRefreshRequest=i$r={}))});var f$r=I(wI=>{"use strict";p();Object.defineProperty(wI,"__esModule",{value:!0});wI.DiagnosticRefreshRequest=wI.WorkspaceDiagnosticRequest=wI.DocumentDiagnosticRequest=wI.DocumentDiagnosticReportKind=wI.DiagnosticServerCancellationData=void 0;var d$r=WV(),lpo=W6e(),roe=Sd(),s$r;(function(t){function e(r){let n=r;return n&&lpo.boolean(n.retriggerRequest)}a(e,"is"),t.is=e})(s$r||(wI.DiagnosticServerCancellationData=s$r={}));var a$r;(function(t){t.Full="full",t.Unchanged="unchanged"})(a$r||(wI.DocumentDiagnosticReportKind=a$r={}));var c$r;(function(t){t.method="textDocument/diagnostic",t.messageDirection=roe.MessageDirection.clientToServer,t.type=new roe.ProtocolRequestType(t.method),t.partialResult=new d$r.ProgressType})(c$r||(wI.DocumentDiagnosticRequest=c$r={}));var l$r;(function(t){t.method="workspace/diagnostic",t.messageDirection=roe.MessageDirection.clientToServer,t.type=new roe.ProtocolRequestType(t.method),t.partialResult=new d$r.ProgressType})(l$r||(wI.WorkspaceDiagnosticRequest=l$r={}));var u$r;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=roe.MessageDirection.serverToClient,t.type=new roe.ProtocolRequestType0(t.method)})(u$r||(wI.DiagnosticRefreshRequest=u$r={}))});var E$r=I(Bf=>{"use strict";p();Object.defineProperty(Bf,"__esModule",{value:!0});Bf.DidCloseNotebookDocumentNotification=Bf.DidSaveNotebookDocumentNotification=Bf.DidChangeNotebookDocumentNotification=Bf.NotebookCellArrayChange=Bf.DidOpenNotebookDocumentNotification=Bf.NotebookDocumentSyncRegistrationType=Bf.NotebookDocument=Bf.NotebookCell=Bf.ExecutionSummary=Bf.NotebookCellKind=void 0;var bve=vve(),yP=W6e(),TN=Sd(),qPt;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(qPt||(Bf.NotebookCellKind=qPt={}));var jPt;(function(t){function e(o,s){let c={executionOrder:o};return(s===!0||s===!1)&&(c.success=s),c}a(e,"create"),t.create=e;function r(o){let s=o;return yP.objectLiteral(s)&&bve.uinteger.is(s.executionOrder)&&(s.success===void 0||yP.boolean(s.success))}a(r,"is"),t.is=r;function n(o,s){return o===s?!0:o==null||s===null||s===void 0?!1:o.executionOrder===s.executionOrder&&o.success===s.success}a(n,"equals"),t.equals=n})(jPt||(Bf.ExecutionSummary=jPt={}));var s9e;(function(t){function e(s,c){return{kind:s,document:c}}a(e,"create"),t.create=e;function r(s){let c=s;return yP.objectLiteral(c)&&qPt.is(c.kind)&&bve.DocumentUri.is(c.document)&&(c.metadata===void 0||yP.objectLiteral(c.metadata))}a(r,"is"),t.is=r;function n(s,c){let l=new Set;return s.document!==c.document&&l.add("document"),s.kind!==c.kind&&l.add("kind"),s.executionSummary!==c.executionSummary&&l.add("executionSummary"),(s.metadata!==void 0||c.metadata!==void 0)&&!o(s.metadata,c.metadata)&&l.add("metadata"),(s.executionSummary!==void 0||c.executionSummary!==void 0)&&!jPt.equals(s.executionSummary,c.executionSummary)&&l.add("executionSummary"),l}a(n,"diff"),t.diff=n;function o(s,c){if(s===c)return!0;if(s==null||c===null||c===void 0||typeof s!=typeof c||typeof s!="object")return!1;let l=Array.isArray(s),u=Array.isArray(c);if(l!==u)return!1;if(l&&u){if(s.length!==c.length)return!1;for(let d=0;d{"use strict";p();Object.defineProperty(a9e,"__esModule",{value:!0});a9e.InlineCompletionRequest=void 0;var _$r=Sd(),v$r;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=_$r.MessageDirection.clientToServer,t.type=new _$r.ProtocolRequestType(t.method)})(v$r||(a9e.InlineCompletionRequest=v$r={}))});var OVr=I(Ve=>{"use strict";p();Object.defineProperty(Ve,"__esModule",{value:!0});Ve.WorkspaceSymbolRequest=Ve.CodeActionResolveRequest=Ve.CodeActionRequest=Ve.DocumentSymbolRequest=Ve.DocumentHighlightRequest=Ve.ReferencesRequest=Ve.DefinitionRequest=Ve.SignatureHelpRequest=Ve.SignatureHelpTriggerKind=Ve.HoverRequest=Ve.CompletionResolveRequest=Ve.CompletionRequest=Ve.CompletionTriggerKind=Ve.PublishDiagnosticsNotification=Ve.WatchKind=Ve.RelativePattern=Ve.FileChangeType=Ve.DidChangeWatchedFilesNotification=Ve.WillSaveTextDocumentWaitUntilRequest=Ve.WillSaveTextDocumentNotification=Ve.TextDocumentSaveReason=Ve.DidSaveTextDocumentNotification=Ve.DidCloseTextDocumentNotification=Ve.DidChangeTextDocumentNotification=Ve.TextDocumentContentChangeEvent=Ve.DidOpenTextDocumentNotification=Ve.TextDocumentSyncKind=Ve.TelemetryEventNotification=Ve.LogMessageNotification=Ve.ShowMessageRequest=Ve.ShowMessageNotification=Ve.MessageType=Ve.DidChangeConfigurationNotification=Ve.ExitNotification=Ve.ShutdownRequest=Ve.InitializedNotification=Ve.InitializeErrorCodes=Ve.InitializeRequest=Ve.WorkDoneProgressOptions=Ve.TextDocumentRegistrationOptions=Ve.StaticRegistrationOptions=Ve.PositionEncodingKind=Ve.FailureHandlingKind=Ve.ResourceOperationKind=Ve.UnregistrationRequest=Ve.RegistrationRequest=Ve.DocumentSelector=Ve.NotebookCellTextDocumentFilter=Ve.NotebookDocumentFilter=Ve.TextDocumentFilter=void 0;Ve.MonikerRequest=Ve.MonikerKind=Ve.UniquenessLevel=Ve.WillDeleteFilesRequest=Ve.DidDeleteFilesNotification=Ve.WillRenameFilesRequest=Ve.DidRenameFilesNotification=Ve.WillCreateFilesRequest=Ve.DidCreateFilesNotification=Ve.FileOperationPatternKind=Ve.LinkedEditingRangeRequest=Ve.ShowDocumentRequest=Ve.SemanticTokensRegistrationType=Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.TokenFormat=Ve.CallHierarchyPrepareRequest=Ve.CallHierarchyOutgoingCallsRequest=Ve.CallHierarchyIncomingCallsRequest=Ve.WorkDoneProgressCancelNotification=Ve.WorkDoneProgressCreateRequest=Ve.WorkDoneProgress=Ve.SelectionRangeRequest=Ve.DeclarationRequest=Ve.FoldingRangeRefreshRequest=Ve.FoldingRangeRequest=Ve.ColorPresentationRequest=Ve.DocumentColorRequest=Ve.ConfigurationRequest=Ve.DidChangeWorkspaceFoldersNotification=Ve.WorkspaceFoldersRequest=Ve.TypeDefinitionRequest=Ve.ImplementationRequest=Ve.ApplyWorkspaceEditRequest=Ve.ExecuteCommandRequest=Ve.PrepareRenameRequest=Ve.RenameRequest=Ve.PrepareSupportDefaultBehavior=Ve.DocumentOnTypeFormattingRequest=Ve.DocumentRangesFormattingRequest=Ve.DocumentRangeFormattingRequest=Ve.DocumentFormattingRequest=Ve.DocumentLinkResolveRequest=Ve.DocumentLinkRequest=Ve.CodeLensRefreshRequest=Ve.CodeLensResolveRequest=Ve.CodeLensRequest=Ve.WorkspaceSymbolResolveRequest=void 0;Ve.InlineCompletionRequest=Ve.DidCloseNotebookDocumentNotification=Ve.DidSaveNotebookDocumentNotification=Ve.DidChangeNotebookDocumentNotification=Ve.NotebookCellArrayChange=Ve.DidOpenNotebookDocumentNotification=Ve.NotebookDocumentSyncRegistrationType=Ve.NotebookDocument=Ve.NotebookCell=Ve.ExecutionSummary=Ve.NotebookCellKind=Ve.DiagnosticRefreshRequest=Ve.WorkspaceDiagnosticRequest=Ve.DocumentDiagnosticRequest=Ve.DocumentDiagnosticReportKind=Ve.DiagnosticServerCancellationData=Ve.InlayHintRefreshRequest=Ve.InlayHintResolveRequest=Ve.InlayHintRequest=Ve.InlineValueRefreshRequest=Ve.InlineValueRequest=Ve.TypeHierarchySupertypesRequest=Ve.TypeHierarchySubtypesRequest=Ve.TypeHierarchyPrepareRequest=void 0;var br=Sd(),b$r=vve(),Lm=W6e(),upo=zHr();Object.defineProperty(Ve,"ImplementationRequest",{enumerable:!0,get:a(function(){return upo.ImplementationRequest},"get")});var dpo=JHr();Object.defineProperty(Ve,"TypeDefinitionRequest",{enumerable:!0,get:a(function(){return dpo.TypeDefinitionRequest},"get")});var kVr=eGr();Object.defineProperty(Ve,"WorkspaceFoldersRequest",{enumerable:!0,get:a(function(){return kVr.WorkspaceFoldersRequest},"get")});Object.defineProperty(Ve,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:a(function(){return kVr.DidChangeWorkspaceFoldersNotification},"get")});var fpo=nGr();Object.defineProperty(Ve,"ConfigurationRequest",{enumerable:!0,get:a(function(){return fpo.ConfigurationRequest},"get")});var DVr=sGr();Object.defineProperty(Ve,"DocumentColorRequest",{enumerable:!0,get:a(function(){return DVr.DocumentColorRequest},"get")});Object.defineProperty(Ve,"ColorPresentationRequest",{enumerable:!0,get:a(function(){return DVr.ColorPresentationRequest},"get")});var NVr=lGr();Object.defineProperty(Ve,"FoldingRangeRequest",{enumerable:!0,get:a(function(){return NVr.FoldingRangeRequest},"get")});Object.defineProperty(Ve,"FoldingRangeRefreshRequest",{enumerable:!0,get:a(function(){return NVr.FoldingRangeRefreshRequest},"get")});var ppo=fGr();Object.defineProperty(Ve,"DeclarationRequest",{enumerable:!0,get:a(function(){return ppo.DeclarationRequest},"get")});var hpo=mGr();Object.defineProperty(Ve,"SelectionRangeRequest",{enumerable:!0,get:a(function(){return hpo.SelectionRangeRequest},"get")});var WPt=EGr();Object.defineProperty(Ve,"WorkDoneProgress",{enumerable:!0,get:a(function(){return WPt.WorkDoneProgress},"get")});Object.defineProperty(Ve,"WorkDoneProgressCreateRequest",{enumerable:!0,get:a(function(){return WPt.WorkDoneProgressCreateRequest},"get")});Object.defineProperty(Ve,"WorkDoneProgressCancelNotification",{enumerable:!0,get:a(function(){return WPt.WorkDoneProgressCancelNotification},"get")});var zPt=bGr();Object.defineProperty(Ve,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:a(function(){return zPt.CallHierarchyIncomingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:a(function(){return zPt.CallHierarchyOutgoingCallsRequest},"get")});Object.defineProperty(Ve,"CallHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return zPt.CallHierarchyPrepareRequest},"get")});var ioe=RGr();Object.defineProperty(Ve,"TokenFormat",{enumerable:!0,get:a(function(){return ioe.TokenFormat},"get")});Object.defineProperty(Ve,"SemanticTokensRequest",{enumerable:!0,get:a(function(){return ioe.SemanticTokensRequest},"get")});Object.defineProperty(Ve,"SemanticTokensDeltaRequest",{enumerable:!0,get:a(function(){return ioe.SemanticTokensDeltaRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRangeRequest",{enumerable:!0,get:a(function(){return ioe.SemanticTokensRangeRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRefreshRequest",{enumerable:!0,get:a(function(){return ioe.SemanticTokensRefreshRequest},"get")});Object.defineProperty(Ve,"SemanticTokensRegistrationType",{enumerable:!0,get:a(function(){return ioe.SemanticTokensRegistrationType},"get")});var mpo=DGr();Object.defineProperty(Ve,"ShowDocumentRequest",{enumerable:!0,get:a(function(){return mpo.ShowDocumentRequest},"get")});var gpo=OGr();Object.defineProperty(Ve,"LinkedEditingRangeRequest",{enumerable:!0,get:a(function(){return gpo.LinkedEditingRangeRequest},"get")});var zV=HGr();Object.defineProperty(Ve,"FileOperationPatternKind",{enumerable:!0,get:a(function(){return zV.FileOperationPatternKind},"get")});Object.defineProperty(Ve,"DidCreateFilesNotification",{enumerable:!0,get:a(function(){return zV.DidCreateFilesNotification},"get")});Object.defineProperty(Ve,"WillCreateFilesRequest",{enumerable:!0,get:a(function(){return zV.WillCreateFilesRequest},"get")});Object.defineProperty(Ve,"DidRenameFilesNotification",{enumerable:!0,get:a(function(){return zV.DidRenameFilesNotification},"get")});Object.defineProperty(Ve,"WillRenameFilesRequest",{enumerable:!0,get:a(function(){return zV.WillRenameFilesRequest},"get")});Object.defineProperty(Ve,"DidDeleteFilesNotification",{enumerable:!0,get:a(function(){return zV.DidDeleteFilesNotification},"get")});Object.defineProperty(Ve,"WillDeleteFilesRequest",{enumerable:!0,get:a(function(){return zV.WillDeleteFilesRequest},"get")});var YPt=zGr();Object.defineProperty(Ve,"UniquenessLevel",{enumerable:!0,get:a(function(){return YPt.UniquenessLevel},"get")});Object.defineProperty(Ve,"MonikerKind",{enumerable:!0,get:a(function(){return YPt.MonikerKind},"get")});Object.defineProperty(Ve,"MonikerRequest",{enumerable:!0,get:a(function(){return YPt.MonikerRequest},"get")});var KPt=ZGr();Object.defineProperty(Ve,"TypeHierarchyPrepareRequest",{enumerable:!0,get:a(function(){return KPt.TypeHierarchyPrepareRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySubtypesRequest",{enumerable:!0,get:a(function(){return KPt.TypeHierarchySubtypesRequest},"get")});Object.defineProperty(Ve,"TypeHierarchySupertypesRequest",{enumerable:!0,get:a(function(){return KPt.TypeHierarchySupertypesRequest},"get")});var MVr=t$r();Object.defineProperty(Ve,"InlineValueRequest",{enumerable:!0,get:a(function(){return MVr.InlineValueRequest},"get")});Object.defineProperty(Ve,"InlineValueRefreshRequest",{enumerable:!0,get:a(function(){return MVr.InlineValueRefreshRequest},"get")});var JPt=o$r();Object.defineProperty(Ve,"InlayHintRequest",{enumerable:!0,get:a(function(){return JPt.InlayHintRequest},"get")});Object.defineProperty(Ve,"InlayHintResolveRequest",{enumerable:!0,get:a(function(){return JPt.InlayHintResolveRequest},"get")});Object.defineProperty(Ve,"InlayHintRefreshRequest",{enumerable:!0,get:a(function(){return JPt.InlayHintRefreshRequest},"get")});var Sve=f$r();Object.defineProperty(Ve,"DiagnosticServerCancellationData",{enumerable:!0,get:a(function(){return Sve.DiagnosticServerCancellationData},"get")});Object.defineProperty(Ve,"DocumentDiagnosticReportKind",{enumerable:!0,get:a(function(){return Sve.DocumentDiagnosticReportKind},"get")});Object.defineProperty(Ve,"DocumentDiagnosticRequest",{enumerable:!0,get:a(function(){return Sve.DocumentDiagnosticRequest},"get")});Object.defineProperty(Ve,"WorkspaceDiagnosticRequest",{enumerable:!0,get:a(function(){return Sve.WorkspaceDiagnosticRequest},"get")});Object.defineProperty(Ve,"DiagnosticRefreshRequest",{enumerable:!0,get:a(function(){return Sve.DiagnosticRefreshRequest},"get")});var IN=E$r();Object.defineProperty(Ve,"NotebookCellKind",{enumerable:!0,get:a(function(){return IN.NotebookCellKind},"get")});Object.defineProperty(Ve,"ExecutionSummary",{enumerable:!0,get:a(function(){return IN.ExecutionSummary},"get")});Object.defineProperty(Ve,"NotebookCell",{enumerable:!0,get:a(function(){return IN.NotebookCell},"get")});Object.defineProperty(Ve,"NotebookDocument",{enumerable:!0,get:a(function(){return IN.NotebookDocument},"get")});Object.defineProperty(Ve,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:a(function(){return IN.NotebookDocumentSyncRegistrationType},"get")});Object.defineProperty(Ve,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:a(function(){return IN.DidOpenNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"NotebookCellArrayChange",{enumerable:!0,get:a(function(){return IN.NotebookCellArrayChange},"get")});Object.defineProperty(Ve,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:a(function(){return IN.DidChangeNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:a(function(){return IN.DidSaveNotebookDocumentNotification},"get")});Object.defineProperty(Ve,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:a(function(){return IN.DidCloseNotebookDocumentNotification},"get")});var Apo=C$r();Object.defineProperty(Ve,"InlineCompletionRequest",{enumerable:!0,get:a(function(){return Apo.InlineCompletionRequest},"get")});var HPt;(function(t){function e(r){let n=r;return Lm.string(n)||Lm.string(n.language)||Lm.string(n.scheme)||Lm.string(n.pattern)}a(e,"is"),t.is=e})(HPt||(Ve.TextDocumentFilter=HPt={}));var GPt;(function(t){function e(r){let n=r;return Lm.objectLiteral(n)&&(Lm.string(n.notebookType)||Lm.string(n.scheme)||Lm.string(n.pattern))}a(e,"is"),t.is=e})(GPt||(Ve.NotebookDocumentFilter=GPt={}));var $Pt;(function(t){function e(r){let n=r;return Lm.objectLiteral(n)&&(Lm.string(n.notebook)||GPt.is(n.notebook))&&(n.language===void 0||Lm.string(n.language))}a(e,"is"),t.is=e})($Pt||(Ve.NotebookCellTextDocumentFilter=$Pt={}));var VPt;(function(t){function e(r){if(!Array.isArray(r))return!1;for(let n of r)if(!Lm.string(n)&&!HPt.is(n)&&!$Pt.is(n))return!1;return!0}a(e,"is"),t.is=e})(VPt||(Ve.DocumentSelector=VPt={}));var S$r;(function(t){t.method="client/registerCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(S$r||(Ve.RegistrationRequest=S$r={}));var T$r;(function(t){t.method="client/unregisterCapability",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(T$r||(Ve.UnregistrationRequest=T$r={}));var I$r;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete"})(I$r||(Ve.ResourceOperationKind=I$r={}));var x$r;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo"})(x$r||(Ve.FailureHandlingKind=x$r={}));var w$r;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32"})(w$r||(Ve.PositionEncodingKind=w$r={}));var R$r;(function(t){function e(r){let n=r;return n&&Lm.string(n.id)&&n.id.length>0}a(e,"hasId"),t.hasId=e})(R$r||(Ve.StaticRegistrationOptions=R$r={}));var P$r;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||VPt.is(n.documentSelector))}a(e,"is"),t.is=e})(P$r||(Ve.TextDocumentRegistrationOptions=P$r={}));var k$r;(function(t){function e(n){let o=n;return Lm.objectLiteral(o)&&(o.workDoneProgress===void 0||Lm.boolean(o.workDoneProgress))}a(e,"is"),t.is=e;function r(n){let o=n;return o&&Lm.boolean(o.workDoneProgress)}a(r,"hasWorkDoneProgress"),t.hasWorkDoneProgress=r})(k$r||(Ve.WorkDoneProgressOptions=k$r={}));var D$r;(function(t){t.method="initialize",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(D$r||(Ve.InitializeRequest=D$r={}));var N$r;(function(t){t.unknownProtocolVersion=1})(N$r||(Ve.InitializeErrorCodes=N$r={}));var M$r;(function(t){t.method="initialized",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(M$r||(Ve.InitializedNotification=M$r={}));var O$r;(function(t){t.method="shutdown",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType0(t.method)})(O$r||(Ve.ShutdownRequest=O$r={}));var B$r;(function(t){t.method="exit",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType0(t.method)})(B$r||(Ve.ExitNotification=B$r={}));var L$r;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(L$r||(Ve.DidChangeConfigurationNotification=L$r={}));var F$r;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5})(F$r||(Ve.MessageType=F$r={}));var U$r;(function(t){t.method="window/showMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(U$r||(Ve.ShowMessageNotification=U$r={}));var Q$r;(function(t){t.method="window/showMessageRequest",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType(t.method)})(Q$r||(Ve.ShowMessageRequest=Q$r={}));var q$r;(function(t){t.method="window/logMessage",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(q$r||(Ve.LogMessageNotification=q$r={}));var j$r;(function(t){t.method="telemetry/event",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(j$r||(Ve.TelemetryEventNotification=j$r={}));var H$r;(function(t){t.None=0,t.Full=1,t.Incremental=2})(H$r||(Ve.TextDocumentSyncKind=H$r={}));var G$r;(function(t){t.method="textDocument/didOpen",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(G$r||(Ve.DidOpenTextDocumentNotification=G$r={}));var $$r;(function(t){function e(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range!==void 0&&(o.rangeLength===void 0||typeof o.rangeLength=="number")}a(e,"isIncremental"),t.isIncremental=e;function r(n){let o=n;return o!=null&&typeof o.text=="string"&&o.range===void 0&&o.rangeLength===void 0}a(r,"isFull"),t.isFull=r})($$r||(Ve.TextDocumentContentChangeEvent=$$r={}));var V$r;(function(t){t.method="textDocument/didChange",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(V$r||(Ve.DidChangeTextDocumentNotification=V$r={}));var W$r;(function(t){t.method="textDocument/didClose",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(W$r||(Ve.DidCloseTextDocumentNotification=W$r={}));var z$r;(function(t){t.method="textDocument/didSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(z$r||(Ve.DidSaveTextDocumentNotification=z$r={}));var Y$r;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3})(Y$r||(Ve.TextDocumentSaveReason=Y$r={}));var K$r;(function(t){t.method="textDocument/willSave",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(K$r||(Ve.WillSaveTextDocumentNotification=K$r={}));var J$r;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(J$r||(Ve.WillSaveTextDocumentWaitUntilRequest=J$r={}));var Z$r;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method)})(Z$r||(Ve.DidChangeWatchedFilesNotification=Z$r={}));var X$r;(function(t){t.Created=1,t.Changed=2,t.Deleted=3})(X$r||(Ve.FileChangeType=X$r={}));var eVr;(function(t){function e(r){let n=r;return Lm.objectLiteral(n)&&(b$r.URI.is(n.baseUri)||b$r.WorkspaceFolder.is(n.baseUri))&&Lm.string(n.pattern)}a(e,"is"),t.is=e})(eVr||(Ve.RelativePattern=eVr={}));var tVr;(function(t){t.Create=1,t.Change=2,t.Delete=4})(tVr||(Ve.WatchKind=tVr={}));var rVr;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolNotificationType(t.method)})(rVr||(Ve.PublishDiagnosticsNotification=rVr={}));var nVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3})(nVr||(Ve.CompletionTriggerKind=nVr={}));var iVr;(function(t){t.method="textDocument/completion",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(iVr||(Ve.CompletionRequest=iVr={}));var oVr;(function(t){t.method="completionItem/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(oVr||(Ve.CompletionResolveRequest=oVr={}));var sVr;(function(t){t.method="textDocument/hover",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(sVr||(Ve.HoverRequest=sVr={}));var aVr;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3})(aVr||(Ve.SignatureHelpTriggerKind=aVr={}));var cVr;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(cVr||(Ve.SignatureHelpRequest=cVr={}));var lVr;(function(t){t.method="textDocument/definition",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(lVr||(Ve.DefinitionRequest=lVr={}));var uVr;(function(t){t.method="textDocument/references",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(uVr||(Ve.ReferencesRequest=uVr={}));var dVr;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(dVr||(Ve.DocumentHighlightRequest=dVr={}));var fVr;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(fVr||(Ve.DocumentSymbolRequest=fVr={}));var pVr;(function(t){t.method="textDocument/codeAction",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(pVr||(Ve.CodeActionRequest=pVr={}));var hVr;(function(t){t.method="codeAction/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(hVr||(Ve.CodeActionResolveRequest=hVr={}));var mVr;(function(t){t.method="workspace/symbol",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(mVr||(Ve.WorkspaceSymbolRequest=mVr={}));var gVr;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(gVr||(Ve.WorkspaceSymbolResolveRequest=gVr={}));var AVr;(function(t){t.method="textDocument/codeLens",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(AVr||(Ve.CodeLensRequest=AVr={}));var yVr;(function(t){t.method="codeLens/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(yVr||(Ve.CodeLensResolveRequest=yVr={}));var EVr;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType0(t.method)})(EVr||(Ve.CodeLensRefreshRequest=EVr={}));var _Vr;(function(t){t.method="textDocument/documentLink",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(_Vr||(Ve.DocumentLinkRequest=_Vr={}));var vVr;(function(t){t.method="documentLink/resolve",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(vVr||(Ve.DocumentLinkResolveRequest=vVr={}));var CVr;(function(t){t.method="textDocument/formatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(CVr||(Ve.DocumentFormattingRequest=CVr={}));var bVr;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(bVr||(Ve.DocumentRangeFormattingRequest=bVr={}));var SVr;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(SVr||(Ve.DocumentRangesFormattingRequest=SVr={}));var TVr;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(TVr||(Ve.DocumentOnTypeFormattingRequest=TVr={}));var IVr;(function(t){t.Identifier=1})(IVr||(Ve.PrepareSupportDefaultBehavior=IVr={}));var xVr;(function(t){t.method="textDocument/rename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(xVr||(Ve.RenameRequest=xVr={}));var wVr;(function(t){t.method="textDocument/prepareRename",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(wVr||(Ve.PrepareRenameRequest=wVr={}));var RVr;(function(t){t.method="workspace/executeCommand",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method)})(RVr||(Ve.ExecuteCommandRequest=RVr={}));var PVr;(function(t){t.method="workspace/applyEdit",t.messageDirection=br.MessageDirection.serverToClient,t.type=new br.ProtocolRequestType("workspace/applyEdit")})(PVr||(Ve.ApplyWorkspaceEditRequest=PVr={}))});var LVr=I(c9e=>{"use strict";p();Object.defineProperty(c9e,"__esModule",{value:!0});c9e.createProtocolConnection=void 0;var BVr=WV();function ypo(t,e,r,n){return BVr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0,BVr.createMessageConnection)(t,e,r,n)}a(ypo,"createProtocolConnection");c9e.createProtocolConnection=ypo});var UVr=I(Kv=>{"use strict";p();var Epo=Kv&&Kv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l9e=Kv&&Kv.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Epo(e,t,r)};Object.defineProperty(Kv,"__esModule",{value:!0});Kv.LSPErrorCodes=Kv.createProtocolConnection=void 0;l9e(WV(),Kv);l9e(vve(),Kv);l9e(Sd(),Kv);l9e(OVr(),Kv);var _po=LVr();Object.defineProperty(Kv,"createProtocolConnection",{enumerable:!0,get:a(function(){return _po.createProtocolConnection},"get")});var FVr;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800})(FVr||(Kv.LSPErrorCodes=FVr={}))});var ei=I(xN=>{"use strict";p();var vpo=xN&&xN.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QVr=xN&&xN.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vpo(e,t,r)};Object.defineProperty(xN,"__esModule",{value:!0});xN.createProtocolConnection=void 0;var Cpo=OPt();QVr(OPt(),xN);QVr(UVr(),xN);function bpo(t,e,r,n){return(0,Cpo.createMessageConnection)(t,e,r,n)}a(bpo,"createProtocolConnection");xN.createProtocolConnection=bpo});var iMt=I(QQe=>{"use strict";p();Object.defineProperty(QQe,"__esModule",{value:!0});QQe.state=void 0;QQe.state={instrumenterImplementation:void 0}});var fae=I((L5t,HXr)=>{p();var Qqe=require("buffer"),dM=Qqe.Buffer;function jXr(t,e){for(var r in t)e[r]=t[r]}a(jXr,"copyProps");dM.from&&dM.alloc&&dM.allocUnsafe&&dM.allocUnsafeSlow?HXr.exports=Qqe:(jXr(Qqe,L5t),L5t.Buffer=Rz);function Rz(t,e,r){return dM(t,e,r)}a(Rz,"SafeBuffer");Rz.prototype=Object.create(dM.prototype);jXr(dM,Rz);Rz.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return dM(t,e,r)};Rz.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=dM(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Rz.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return dM(t)};Rz.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Qqe.SlowBuffer(t)}});var F5t=I((Ajl,GXr)=>{p();var qqe=fae().Buffer,Q_o=require("stream"),q_o=require("util");function jqe(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=qqe.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=qqe.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}a(jqe,"DataStream");q_o.inherits(jqe,Q_o);jqe.prototype.write=a(function(e){this.buffer=qqe.concat([this.buffer,qqe.from(e)]),this.emit("data",e)},"write");jqe.prototype.end=a(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");GXr.exports=jqe});var VXr=I((_jl,$Xr)=>{"use strict";p();function U5t(t){var e=(t/8|0)+(t%8===0?0:1);return e}a(U5t,"getParamSize");var j_o={ES256:U5t(256),ES384:U5t(384),ES512:U5t(521)};function H_o(t){var e=j_o[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}a(H_o,"getParamBytesForAlg");$Xr.exports=H_o});var XXr=I((bjl,ZXr)=>{"use strict";p();var Hqe=fae().Buffer,zXr=VXr(),Gqe=128,YXr=0,G_o=32,$_o=16,V_o=2,KXr=$_o|G_o|YXr<<6,$qe=V_o|YXr<<6;function W_o(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(W_o,"base64Url");function JXr(t){if(Hqe.isBuffer(t))return t;if(typeof t=="string")return Hqe.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(JXr,"signatureAsBuffer");function z_o(t,e){t=JXr(t);var r=zXr(e),n=r+1,o=t.length,s=0;if(t[s++]!==KXr)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(Gqe|1)&&(c=t[s++]),o-s=Gqe;return o&&--n,n}a(WXr,"countPadding");function Y_o(t,e){t=JXr(t);var r=zXr(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var o=WXr(t,0,r),s=WXr(t,r,t.length),c=r-o,l=r-s,u=2+c+1+1+l,d=u{"use strict";p();var v1e=require("buffer").Buffer,Q5t=require("buffer").SlowBuffer;een.exports=Vqe;function Vqe(t,e){if(!v1e.isBuffer(t)||!v1e.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n{p();var hae=fae().Buffer,ix=require("crypto"),nen=XXr(),ren=require("util"),Z_o=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,N1e="secret must be a string or buffer",vae="key must be a string or a buffer",sCo="key must be a string, a buffer or an object",e4t=typeof ax.createPublicKey=="function";e4t&&(vae+=" or a KeyObject",N1e+="or a KeyObject");function Ien(t){if(!bae.isBuffer(t)&&typeof t!="string"&&(!e4t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw $k(vae)}a(Ien,"checkIsPublicKey");function xen(t){if(!bae.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw $k(sCo)}a(xen,"checkIsPrivateKey");function aCo(t){if(!bae.isBuffer(t)){if(typeof t=="string")return t;if(!e4t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw $k(N1e)}}a(aCo,"checkIsSecretKey");function t4t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(t4t,"fromBase64");function wen(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var ACo=require("buffer").Buffer;Nen.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||ACo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Uen=I((jGl,Fen)=>{p();var yCo=Cae().Buffer,Men=K5t(),ECo=r4t(),_Co=require("stream"),Oen=n4t(),i4t=require("util");function Ben(t,e){return yCo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Ben,"base64url");function CCo(t,e,r){r=r||"utf8";var n=Ben(Oen(t),"binary"),o=Ben(Oen(e),r);return i4t.format("%s.%s",n,o)}a(CCo,"jwsSecuredInput");function Len(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=ECo(e.alg),c=CCo(e,r,o),l=s.sign(c,n);return i4t.format("%s.%s",c,l)}a(Len,"jwsSign");function aje(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Men(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new Men(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(aje,"SignStream");i4t.inherits(aje,_Co);aje.prototype.sign=a(function(){try{var e=Len({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");aje.sign=Len;Fen.exports=aje});var Yen=I(($Gl,zen)=>{p();var qen=Cae().Buffer,Qen=K5t(),vCo=r4t(),bCo=require("stream"),jen=n4t(),SCo=require("util"),TCo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function ICo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(ICo,"isObject");function xCo(t){if(ICo(t))return t;try{return JSON.parse(t)}catch{return}}a(xCo,"safeJsonParse");function Hen(t){var e=t.split(".",1)[0];return xCo(qen.from(e,"base64").toString("binary"))}a(Hen,"headerFromJWS");function wCo(t){return t.split(".",2).join(".")}a(wCo,"securedInputFromJWS");function Gen(t){return t.split(".")[2]}a(Gen,"signatureFromJWS");function RCo(t,e){e=e||"utf8";var r=t.split(".")[1];return qen.from(r,"base64").toString(e)}a(RCo,"payloadFromJWS");function $en(t){return TCo.test(t)&&!!Hen(t)}a($en,"isValidJws");function Ven(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=jen(t);var o=Gen(t),s=wCo(t),c=vCo(e);return c.verify(s,o,r)}a(Ven,"jwsVerify");function Wen(t,e){if(e=e||{},t=jen(t),!$en(t))return null;var r=Hen(t);if(!r)return null;var n=RCo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Gen(t)}}a(Wen,"jwsDecode");function Sae(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new Qen(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new Qen(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(Sae,"VerifyStream");SCo.inherits(Sae,bCo);Sae.prototype.verify=a(function(){try{var e=Ven(this.signature.buffer,this.algorithm,this.key.buffer),r=Wen(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");Sae.decode=Wen;Sae.isValid=$en;Sae.verify=Ven;zen.exports=Sae});var lje=I(p7=>{p();var Ken=Uen(),cje=Yen(),kCo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];p7.ALGORITHMS=kCo;p7.sign=Ken.sign;p7.verify=cje.verify;p7.decode=cje.decode;p7.isValid=cje.isValid;p7.createSign=a(function(e){return new Ken(e)},"createSign");p7.createVerify=a(function(e){return new cje(e)},"createVerify")});var o4t=I((JGl,Jen)=>{p();var PCo=lje();Jen.exports=function(t,e){e=e||{};var r=PCo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var O1e=I((XGl,Zen)=>{p();var uje=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");uje.prototype=Object.create(Error.prototype);uje.prototype.constructor=uje;Zen.exports=uje});var s4t=I((r$l,etn)=>{p();var Xen=O1e(),dje=a(function(t,e){Xen.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");dje.prototype=Object.create(Xen.prototype);dje.prototype.constructor=dje;etn.exports=dje});var a4t=I((o$l,rtn)=>{p();var ttn=O1e(),fje=a(function(t,e){ttn.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");fje.prototype=Object.create(ttn.prototype);fje.prototype.constructor=fje;rtn.exports=fje});var c4t=I((c$l,ntn)=>{p();var Tae=1e3,Iae=Tae*60,xae=Iae*60,Uz=xae*24,DCo=Uz*7,NCo=Uz*365.25;ntn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return MCo(t);if(r==="number"&&isFinite(t))return e.long?BCo(t):OCo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function MCo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*NCo;case"weeks":case"week":case"w":return r*DCo;case"days":case"day":case"d":return r*Uz;case"hours":case"hour":case"hrs":case"hr":case"h":return r*xae;case"minutes":case"minute":case"mins":case"min":case"m":return r*Iae;case"seconds":case"second":case"secs":case"sec":case"s":return r*Tae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(MCo,"parse");function OCo(t){var e=Math.abs(t);return e>=Uz?Math.round(t/Uz)+"d":e>=xae?Math.round(t/xae)+"h":e>=Iae?Math.round(t/Iae)+"m":e>=Tae?Math.round(t/Tae)+"s":t+"ms"}a(OCo,"fmtShort");function BCo(t){var e=Math.abs(t);return e>=Uz?pje(t,e,Uz,"day"):e>=xae?pje(t,e,xae,"hour"):e>=Iae?pje(t,e,Iae,"minute"):e>=Tae?pje(t,e,Tae,"second"):t+" ms"}a(BCo,"fmtLong");function pje(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(pje,"plural")});var l4t=I((d$l,itn)=>{p();var LCo=c4t();itn.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=LCo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var wae=I((p$l,otn)=>{"use strict";p();var FCo="2.0.0",UCo=Number.MAX_SAFE_INTEGER||9007199254740991,QCo=16,qCo=250,jCo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];otn.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:QCo,MAX_SAFE_BUILD_LENGTH:qCo,MAX_SAFE_INTEGER:UCo,RELEASE_TYPES:jCo,SEMVER_SPEC_VERSION:FCo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var B1e=I((m$l,stn)=>{"use strict";p();var HCo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};stn.exports=HCo});var Rae=I((yM,atn)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:u4t,MAX_SAFE_BUILD_LENGTH:GCo,MAX_LENGTH:$Co}=wae(),VCo=B1e();yM=atn.exports={};var WCo=yM.re=[],zCo=yM.safeRe=[],bn=yM.src=[],YCo=yM.safeSrc=[],Sn=yM.t={},KCo=0,d4t="[a-zA-Z0-9-]",JCo=[["\\s",1],["\\d",$Co],[d4t,GCo]],ZCo=a(t=>{for(let[e,r]of JCo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Lo=a((t,e,r)=>{let n=ZCo(e),o=KCo++;VCo(t,o,e),Sn[t]=o,bn[o]=e,YCo[o]=n,WCo[o]=new RegExp(e,r?"g":void 0),zCo[o]=new RegExp(n,r?"g":void 0)},"createToken");Lo("NUMERICIDENTIFIER","0|[1-9]\\d*");Lo("NUMERICIDENTIFIERLOOSE","\\d+");Lo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d4t}*`);Lo("MAINVERSION",`(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})`);Lo("MAINVERSIONLOOSE",`(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASEIDENTIFIER",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIER]})`);Lo("PRERELEASEIDENTIFIERLOOSE",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Lo("PRERELEASE",`(?:-(${bn[Sn.PRERELEASEIDENTIFIER]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIER]})*))`);Lo("PRERELEASELOOSE",`(?:-?(${bn[Sn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIERLOOSE]})*))`);Lo("BUILDIDENTIFIER",`${d4t}+`);Lo("BUILD",`(?:\\+(${bn[Sn.BUILDIDENTIFIER]}(?:\\.${bn[Sn.BUILDIDENTIFIER]})*))`);Lo("FULLPLAIN",`v?${bn[Sn.MAINVERSION]}${bn[Sn.PRERELEASE]}?${bn[Sn.BUILD]}?`);Lo("FULL",`^${bn[Sn.FULLPLAIN]}$`);Lo("LOOSEPLAIN",`[v=\\s]*${bn[Sn.MAINVERSIONLOOSE]}${bn[Sn.PRERELEASELOOSE]}?${bn[Sn.BUILD]}?`);Lo("LOOSE",`^${bn[Sn.LOOSEPLAIN]}$`);Lo("GTLT","((?:<|>)?=?)");Lo("XRANGEIDENTIFIERLOOSE",`${bn[Sn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Lo("XRANGEIDENTIFIER",`${bn[Sn.NUMERICIDENTIFIER]}|x|X|\\*`);Lo("XRANGEPLAIN",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:${bn[Sn.PRERELEASE]})?${bn[Sn.BUILD]}?)?)?`);Lo("XRANGEPLAINLOOSE",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:${bn[Sn.PRERELEASELOOSE]})?${bn[Sn.BUILD]}?)?)?`);Lo("XRANGE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAIN]}$`);Lo("XRANGELOOSE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${u4t}})(?:\\.(\\d{1,${u4t}}))?(?:\\.(\\d{1,${u4t}}))?`);Lo("COERCE",`${bn[Sn.COERCEPLAIN]}(?:$|[^\\d])`);Lo("COERCEFULL",bn[Sn.COERCEPLAIN]+`(?:${bn[Sn.PRERELEASE]})?(?:${bn[Sn.BUILD]})?(?:$|[^\\d])`);Lo("COERCERTL",bn[Sn.COERCE],!0);Lo("COERCERTLFULL",bn[Sn.COERCEFULL],!0);Lo("LONETILDE","(?:~>?)");Lo("TILDETRIM",`(\\s*)${bn[Sn.LONETILDE]}\\s+`,!0);yM.tildeTrimReplace="$1~";Lo("TILDE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAIN]}$`);Lo("TILDELOOSE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("LONECARET","(?:\\^)");Lo("CARETTRIM",`(\\s*)${bn[Sn.LONECARET]}\\s+`,!0);yM.caretTrimReplace="$1^";Lo("CARET",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAIN]}$`);Lo("CARETLOOSE",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Lo("COMPARATORLOOSE",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]})$|^$`);Lo("COMPARATOR",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.FULLPLAIN]})$|^$`);Lo("COMPARATORTRIM",`(\\s*)${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]}|${bn[Sn.XRANGEPLAIN]})`,!0);yM.comparatorTrimReplace="$1$2$3";Lo("HYPHENRANGE",`^\\s*(${bn[Sn.XRANGEPLAIN]})\\s+-\\s+(${bn[Sn.XRANGEPLAIN]})\\s*$`);Lo("HYPHENRANGELOOSE",`^\\s*(${bn[Sn.XRANGEPLAINLOOSE]})\\s+-\\s+(${bn[Sn.XRANGEPLAINLOOSE]})\\s*$`);Lo("STAR","(<|>)?=?\\s*\\*");Lo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Lo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var hje=I((E$l,ctn)=>{"use strict";p();var XCo=Object.freeze({loose:!0}),evo=Object.freeze({}),tvo=a(t=>t?typeof t!="object"?XCo:t:evo,"parseOptions");ctn.exports=tvo});var f4t=I((v$l,dtn)=>{"use strict";p();var ltn=/^[0-9]+$/,utn=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tutn(e,t),"rcompareIdentifiers");dtn.exports={compareIdentifiers:utn,rcompareIdentifiers:rvo}});var iA=I((T$l,ptn)=>{"use strict";p();var mje=B1e(),{MAX_LENGTH:ftn,MAX_SAFE_INTEGER:gje}=wae(),{safeRe:Aje,t:yje}=Rae(),nvo=hje(),{compareIdentifiers:p4t}=f4t(),h4t=class t{static{a(this,"SemVer")}constructor(e,r){if(r=nvo(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ftn)throw new TypeError(`version is longer than ${ftn} characters`);mje("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?Aje[yje.LOOSE]:Aje[yje.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>gje||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gje||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gje||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(mje("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return p4t(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(mje("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return p4t(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?Aje[yje.PRERELEASELOOSE]:Aje[yje.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];n===!1&&(s=[r]),p4t(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};ptn.exports=h4t});var h7=I((w$l,mtn)=>{"use strict";p();var htn=iA(),ivo=a((t,e,r=!1)=>{if(t instanceof htn)return t;try{return new htn(t,e)}catch(n){if(!r)return null;throw n}},"parse");mtn.exports=ivo});var Atn=I((P$l,gtn)=>{"use strict";p();var ovo=h7(),svo=a((t,e)=>{let r=ovo(t,e);return r?r.version:null},"valid");gtn.exports=svo});var Etn=I((M$l,ytn)=>{"use strict";p();var avo=h7(),cvo=a((t,e)=>{let r=avo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");ytn.exports=cvo});var vtn=I((L$l,Ctn)=>{"use strict";p();var _tn=iA(),lvo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new _tn(t instanceof _tn?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Ctn.exports=lvo});var Ttn=I((Q$l,Stn)=>{"use strict";p();var btn=h7(),uvo=a((t,e)=>{let r=btn(t,null,!0),n=btn(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");Stn.exports=uvo});var xtn=I((H$l,Itn)=>{"use strict";p();var dvo=iA(),fvo=a((t,e)=>new dvo(t,e).major,"major");Itn.exports=fvo});var Rtn=I((V$l,wtn)=>{"use strict";p();var pvo=iA(),hvo=a((t,e)=>new pvo(t,e).minor,"minor");wtn.exports=hvo});var Ptn=I((Y$l,ktn)=>{"use strict";p();var mvo=iA(),gvo=a((t,e)=>new mvo(t,e).patch,"patch");ktn.exports=gvo});var Ntn=I((Z$l,Dtn)=>{"use strict";p();var Avo=h7(),yvo=a((t,e)=>{let r=Avo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");Dtn.exports=yvo});var cx=I((tVl,Otn)=>{"use strict";p();var Mtn=iA(),Evo=a((t,e,r)=>new Mtn(t,r).compare(new Mtn(e,r)),"compare");Otn.exports=Evo});var Ltn=I((iVl,Btn)=>{"use strict";p();var _vo=cx(),Cvo=a((t,e,r)=>_vo(e,t,r),"rcompare");Btn.exports=Cvo});var Utn=I((aVl,Ftn)=>{"use strict";p();var vvo=cx(),bvo=a((t,e)=>vvo(t,e,!0),"compareLoose");Ftn.exports=bvo});var Eje=I((uVl,qtn)=>{"use strict";p();var Qtn=iA(),Svo=a((t,e,r)=>{let n=new Qtn(t,r),o=new Qtn(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");qtn.exports=Svo});var Htn=I((pVl,jtn)=>{"use strict";p();var Tvo=Eje(),Ivo=a((t,e)=>t.sort((r,n)=>Tvo(r,n,e)),"sort");jtn.exports=Ivo});var $tn=I((gVl,Gtn)=>{"use strict";p();var xvo=Eje(),wvo=a((t,e)=>t.sort((r,n)=>xvo(n,r,e)),"rsort");Gtn.exports=wvo});var L1e=I((EVl,Vtn)=>{"use strict";p();var Rvo=cx(),kvo=a((t,e,r)=>Rvo(t,e,r)>0,"gt");Vtn.exports=kvo});var _je=I((vVl,Wtn)=>{"use strict";p();var Pvo=cx(),Dvo=a((t,e,r)=>Pvo(t,e,r)<0,"lt");Wtn.exports=Dvo});var m4t=I((TVl,ztn)=>{"use strict";p();var Nvo=cx(),Mvo=a((t,e,r)=>Nvo(t,e,r)===0,"eq");ztn.exports=Mvo});var g4t=I((wVl,Ytn)=>{"use strict";p();var Ovo=cx(),Bvo=a((t,e,r)=>Ovo(t,e,r)!==0,"neq");Ytn.exports=Bvo});var Cje=I((PVl,Ktn)=>{"use strict";p();var Lvo=cx(),Fvo=a((t,e,r)=>Lvo(t,e,r)>=0,"gte");Ktn.exports=Fvo});var vje=I((MVl,Jtn)=>{"use strict";p();var Uvo=cx(),Qvo=a((t,e,r)=>Uvo(t,e,r)<=0,"lte");Jtn.exports=Qvo});var A4t=I((LVl,Ztn)=>{"use strict";p();var qvo=m4t(),jvo=g4t(),Hvo=L1e(),Gvo=Cje(),$vo=_je(),Vvo=vje(),Wvo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return qvo(t,r,n);case"!=":return jvo(t,r,n);case">":return Hvo(t,r,n);case">=":return Gvo(t,r,n);case"<":return $vo(t,r,n);case"<=":return Vvo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Ztn.exports=Wvo});var ern=I((QVl,Xtn)=>{"use strict";p();var zvo=iA(),Yvo=h7(),{safeRe:bje,t:Sje}=Rae(),Kvo=a((t,e)=>{if(t instanceof zvo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?bje[Sje.COERCEFULL]:bje[Sje.COERCE]);else{let u=e.includePrerelease?bje[Sje.COERCERTLFULL]:bje[Sje.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Yvo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");Xtn.exports=Kvo});var rrn=I((HVl,trn)=>{"use strict";p();var Jvo=h7(),Zvo=wae(),Xvo=iA(),ebo=a((t,e,r)=>{if(!Zvo.RELEASE_TYPES.includes(e))return null;let n=tbo(t,r);return n&&rbo(n,e)},"truncate"),tbo=a((t,e)=>{let r=t instanceof Xvo?t.version:t;return Jvo(r,e)},"cloneInputVersion"),rbo=a((t,e)=>{if(nbo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),nbo=a(t=>t.startsWith("pre"),"isPrerelease");trn.exports=ebo});var irn=I((VVl,nrn)=>{"use strict";p();var y4t=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};nrn.exports=y4t});var lx=I((YVl,crn)=>{"use strict";p();var ibo=/\s+/g,E4t=class t{static{a(this,"Range")}constructor(e,r){if(r=sbo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof _4t)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(ibo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!srn(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&mbo(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(hbo,"");let n=((this.options.includePrerelease&&fbo)|(this.options.loose&&pbo))+":"+e,o=orn.get(n);if(o)return o;let s=this.options.loose,c=s?m_[oA.HYPHENRANGELOOSE]:m_[oA.HYPHENRANGE];e=e.replace(c,Tbo(this.options.includePrerelease)),Gu("hyphen replace",e),e=e.replace(m_[oA.COMPARATORTRIM],lbo),Gu("comparator trim",e),e=e.replace(m_[oA.TILDETRIM],ubo),Gu("tilde trim",e),e=e.replace(m_[oA.CARETTRIM],dbo),Gu("caret trim",e);let l=e.split(" ").map(h=>gbo(h,this.options)).join(" ").split(/\s+/).map(h=>Sbo(h,this.options));s&&(l=l.filter(h=>(Gu("loose invalid filter",h,this.options),!!h.match(m_[oA.COMPARATORLOOSE])))),Gu("range list",l);let u=new Map,d=l.map(h=>new _4t(h,this.options));for(let h of d){if(srn(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return orn.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>arn(n,r)&&e.set.some(o=>arn(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new abo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),mbo=a(t=>t.value==="","isAny"),arn=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),gbo=a((t,e)=>(t=t.replace(m_[oA.BUILD],""),Gu("comp",t,e),t=Ebo(t,e),Gu("caret",t),t=Abo(t,e),Gu("tildes",t),t=Cbo(t,e),Gu("xrange",t),t=bbo(t,e),Gu("stars",t),t),"parseComparator"),g_=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),Abo=a((t,e)=>t.trim().split(/\s+/).map(r=>ybo(r,e)).join(" "),"replaceTildes"),ybo=a((t,e)=>{let r=e.loose?m_[oA.TILDELOOSE]:m_[oA.TILDE];return t.replace(r,(n,o,s,c,l)=>{Gu("tilde",t,n,o,s,c,l);let u;return g_(o)?u="":g_(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:g_(c)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Gu("replaceTilde pr",l),u=`>=${o}.${s}.${c}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${c} <${o}.${+s+1}.0-0`,Gu("tilde return",u),u})},"replaceTilde"),Ebo=a((t,e)=>t.trim().split(/\s+/).map(r=>_bo(r,e)).join(" "),"replaceCarets"),_bo=a((t,e)=>{Gu("caret",t,e);let r=e.loose?m_[oA.CARETLOOSE]:m_[oA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Gu("caret",t,o,s,c,l,u);let d;return g_(s)?d="":g_(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:g_(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Gu("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(Gu("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),Gu("caret return",d),d})},"replaceCaret"),Cbo=a((t,e)=>(Gu("replaceXRanges",t,e),t.split(/\s+/).map(r=>vbo(r,e)).join(" ")),"replaceXRanges"),vbo=a((t,e)=>{t=t.trim();let r=e.loose?m_[oA.XRANGELOOSE]:m_[oA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{Gu("xRange",t,n,o,s,c,l,u);let d=g_(s),f=d||g_(c),h=f||g_(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),Gu("xRange return",n),n})},"replaceXRange"),bbo=a((t,e)=>(Gu("replaceStars",t,e),t.trim().replace(m_[oA.STAR],"")),"replaceStars"),Sbo=a((t,e)=>(Gu("replaceGTE0",t,e),t.trim().replace(m_[e.includePrerelease?oA.GTE0PRE:oA.GTE0],"")),"replaceGTE0"),Tbo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(g_(n)?r="":g_(o)?r=`>=${n}.0.0${t?"-0":""}`:g_(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,g_(d)?u="":g_(f)?u=`<${+d+1}.0.0-0`:g_(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),Ibo=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var F1e=I((ZVl,hrn)=>{"use strict";p();var U1e=Symbol("SemVer ANY"),b4t=class t{static{a(this,"Comparator")}static get ANY(){return U1e}constructor(e,r){if(r=lrn(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),v4t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===U1e?this.value="":this.value=this.operator+this.semver.version,v4t("comp",this)}parse(e){let r=this.options.loose?urn[drn.COMPARATORLOOSE]:urn[drn.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new frn(n[2],this.options.loose):this.semver=U1e}toString(){return this.value}test(e){if(v4t("Comparator.test",e,this.options.loose),this.semver===U1e||e===U1e)return!0;if(typeof e=="string")try{e=new frn(e,this.options)}catch{return!1}return C4t(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new prn(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new prn(this.value,r).test(e.semver):(r=lrn(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||C4t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||C4t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};hrn.exports=b4t;var lrn=hje(),{safeRe:urn,t:drn}=Rae(),C4t=A4t(),v4t=B1e(),frn=iA(),prn=lx()});var Q1e=I((tWl,mrn)=>{"use strict";p();var xbo=lx(),wbo=a((t,e,r)=>{try{e=new xbo(e,r)}catch{return!1}return e.test(t)},"satisfies");mrn.exports=wbo});var Arn=I((iWl,grn)=>{"use strict";p();var Rbo=lx(),kbo=a((t,e)=>new Rbo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");grn.exports=kbo});var Ern=I((aWl,yrn)=>{"use strict";p();var Pbo=iA(),Dbo=lx(),Nbo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Dbo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Pbo(n,r))}),n},"maxSatisfying");yrn.exports=Nbo});var Crn=I((uWl,_rn)=>{"use strict";p();var Mbo=iA(),Obo=lx(),Bbo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Obo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Mbo(n,r))}),n},"minSatisfying");_rn.exports=Bbo});var Srn=I((pWl,brn)=>{"use strict";p();var S4t=iA(),Lbo=lx(),vrn=L1e(),Fbo=a((t,e)=>{t=new Lbo(t,e);let r=new S4t("0.0.0");if(t.test(r)||(r=new S4t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new S4t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||vrn(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||vrn(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");brn.exports=Fbo});var Irn=I((gWl,Trn)=>{"use strict";p();var Ubo=lx(),Qbo=a((t,e)=>{try{return new Ubo(t,e).range||"*"}catch{return null}},"validRange");Trn.exports=Qbo});var Tje=I((EWl,krn)=>{"use strict";p();var qbo=iA(),Rrn=F1e(),{ANY:jbo}=Rrn,Hbo=lx(),Gbo=Q1e(),xrn=L1e(),wrn=_je(),$bo=vje(),Vbo=Cje(),Wbo=a((t,e,r,n)=>{t=new qbo(t,n),e=new Hbo(e,n);let o,s,c,l,u;switch(r){case">":o=xrn,s=$bo,c=wrn,l=">",u=">=";break;case"<":o=wrn,s=Vbo,c=xrn,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gbo(t,e,n))return!1;for(let d=0;d{g.semver===jbo&&(g=new Rrn(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");krn.exports=Wbo});var Drn=I((vWl,Prn)=>{"use strict";p();var zbo=Tje(),Ybo=a((t,e,r)=>zbo(t,e,">",r),"gtr");Prn.exports=Ybo});var Mrn=I((TWl,Nrn)=>{"use strict";p();var Kbo=Tje(),Jbo=a((t,e,r)=>Kbo(t,e,"<",r),"ltr");Nrn.exports=Jbo});var Lrn=I((wWl,Brn)=>{"use strict";p();var Orn=lx(),Zbo=a((t,e,r)=>(t=new Orn(t,r),e=new Orn(e,r),t.intersects(e,r)),"intersects");Brn.exports=Zbo});var Urn=I((PWl,Frn)=>{"use strict";p();var Xbo=Q1e(),e1o=cx();Frn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>e1o(f,h,r));for(let f of c)Xbo(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var Qrn=lx(),x4t=F1e(),{ANY:T4t}=x4t,I4t=Q1e(),w4t=cx(),t1o=a((t,e,r={})=>{if(t===e)return!0;t=new Qrn(t,r),e=new Qrn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=n1o(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),r1o=[new x4t(">=0.0.0-0")],qrn=[new x4t(">=0.0.0")],n1o=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===T4t){if(e.length===1&&e[0].semver===T4t)return!0;r.includePrerelease?t=r1o:t=qrn}if(e.length===1&&e[0].semver===T4t){if(r.includePrerelease)return!0;e=qrn}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=jrn(o,g,r):g.operator==="<"||g.operator==="<="?s=Hrn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=w4t(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!I4t(g,String(o),r)||s&&!I4t(g,String(s),r))return null;for(let A of e)if(!I4t(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=jrn(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=Hrn(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),jrn=a((t,e,r)=>{if(!t)return e;let n=w4t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),Hrn=a((t,e,r)=>{if(!t)return e;let n=w4t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Grn.exports=t1o});var DL=I((BWl,zrn)=>{"use strict";p();var R4t=Rae(),Vrn=wae(),i1o=iA(),Wrn=f4t(),o1o=h7(),s1o=Atn(),a1o=Etn(),c1o=vtn(),l1o=Ttn(),u1o=xtn(),d1o=Rtn(),f1o=Ptn(),p1o=Ntn(),h1o=cx(),m1o=Ltn(),g1o=Utn(),A1o=Eje(),y1o=Htn(),E1o=$tn(),_1o=L1e(),C1o=_je(),v1o=m4t(),b1o=g4t(),S1o=Cje(),T1o=vje(),I1o=A4t(),x1o=ern(),w1o=rrn(),R1o=F1e(),k1o=lx(),P1o=Q1e(),D1o=Arn(),N1o=Ern(),M1o=Crn(),O1o=Srn(),B1o=Irn(),L1o=Tje(),F1o=Drn(),U1o=Mrn(),Q1o=Lrn(),q1o=Urn(),j1o=$rn();zrn.exports={parse:o1o,valid:s1o,clean:a1o,inc:c1o,diff:l1o,major:u1o,minor:d1o,patch:f1o,prerelease:p1o,compare:h1o,rcompare:m1o,compareLoose:g1o,compareBuild:A1o,sort:y1o,rsort:E1o,gt:_1o,lt:C1o,eq:v1o,neq:b1o,gte:S1o,lte:T1o,cmp:I1o,coerce:x1o,truncate:w1o,Comparator:R1o,Range:k1o,satisfies:P1o,toComparators:D1o,maxSatisfying:N1o,minSatisfying:M1o,minVersion:O1o,validRange:B1o,outside:L1o,gtr:F1o,ltr:U1o,intersects:Q1o,simplifyRange:q1o,subset:j1o,SemVer:i1o,re:R4t.re,src:R4t.src,tokens:R4t.t,SEMVER_SPEC_VERSION:Vrn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Vrn.RELEASE_TYPES,compareIdentifiers:Wrn.compareIdentifiers,rcompareIdentifiers:Wrn.rcompareIdentifiers}});var Krn=I((FWl,Yrn)=>{p();var H1o=DL();Yrn.exports=H1o.satisfies(process.version,">=15.7.0")});var Zrn=I((QWl,Jrn)=>{p();var G1o=DL();Jrn.exports=G1o.satisfies(process.version,">=16.9.0")});var k4t=I((jWl,Xrn)=>{p();var $1o=Krn(),V1o=Zrn(),W1o={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},z1o={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Xrn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=W1o[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if($1o)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=z1o[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(V1o){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var P4t=I((GWl,enn)=>{p();var Y1o=DL();enn.exports=Y1o.satisfies(process.version,"^6.12.0 || >=8.0.0")});var nnn=I((VWl,rnn)=>{p();var au=O1e(),K1o=s4t(),tnn=a4t(),J1o=o4t(),Z1o=l4t(),X1o=k4t(),eSo=P4t(),tSo=lje(),{KeyObject:rSo,createSecretKey:nSo,createPublicKey:iSo}=require("crypto"),D4t=["RS256","RS384","RS512"],oSo=["ES256","ES384","ES512"],N4t=["RS256","RS384","RS512"],sSo=["HS256","HS384","HS512"];eSo&&(D4t.splice(D4t.length,0,"PS256","PS384","PS512"),N4t.splice(N4t.length,0,"PS256","PS384","PS512"));rnn.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new au("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new au("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new au("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new au("jwt must be provided"));if(typeof t!="string")return o(new au("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new au("jwt malformed"));let l;try{l=J1o(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new au("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new au("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new au("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new au("jwt signature is required"));if(m&&!h)return o(new au("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new au('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof rSo))try{h=iSo(h)}catch{try{h=nSo(typeof h=="string"?Buffer.from(h):h)}catch{return o(new au("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=sSo:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=N4t:h.asymmetricKeyType==="ec"?r.algorithms=oSo:r.algorithms=D4t),r.algorithms.indexOf(l.header.alg)===-1)return o(new au("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new au(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new au(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{X1o(u.alg,h)}catch(y){return o(y)}let g;try{g=tSo.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new au("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new au("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new K1o("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new au("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new tnn("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new au("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new au("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new au("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new au("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new au("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new au("iat required when maxAge is specified"));let y=Z1o(r.maxAge,A.iat);if(typeof y>"u")return o(new au('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new tnn("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var lnn=I((YWl,cnn)=>{p();var inn=1/0,snn=9007199254740991,aSo=17976931348623157e292,onn=NaN,cSo="[object Arguments]",lSo="[object Function]",uSo="[object GeneratorFunction]",dSo="[object String]",fSo="[object Symbol]",pSo=/^\s+|\s+$/g,hSo=/^[-+]0x[0-9a-f]+$/i,mSo=/^0b[01]+$/i,gSo=/^0o[0-7]+$/i,ASo=/^(?:0|[1-9]\d*)$/,ySo=parseInt;function ESo(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&CSo(t,e,r)>-1}a(NSo,"includes");function MSo(t){return OSo(t)&&O4t.call(t,"callee")&&(!ISo.call(t,"callee")||xje.call(t)==cSo)}a(MSo,"isArguments");var ann=Array.isArray;function B4t(t){return t!=null&&LSo(t.length)&&!BSo(t)}a(B4t,"isArrayLike");function OSo(t){return L4t(t)&&B4t(t)}a(OSo,"isArrayLikeObject");function BSo(t){var e=M4t(t)?xje.call(t):"";return e==lSo||e==uSo}a(BSo,"isFunction");function LSo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=snn}a(LSo,"isLength");function M4t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(M4t,"isObject");function L4t(t){return!!t&&typeof t=="object"}a(L4t,"isObjectLike");function FSo(t){return typeof t=="string"||!ann(t)&&L4t(t)&&xje.call(t)==dSo}a(FSo,"isString");function USo(t){return typeof t=="symbol"||L4t(t)&&xje.call(t)==fSo}a(USo,"isSymbol");function QSo(t){if(!t)return t===0?t:0;if(t=jSo(t),t===inn||t===-inn){var e=t<0?-1:1;return e*aSo}return t===t?t:0}a(QSo,"toFinite");function qSo(t){var e=QSo(t),r=e%1;return e===e?r?e-r:e:0}a(qSo,"toInteger");function jSo(t){if(typeof t=="number")return t;if(USo(t))return onn;if(M4t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=M4t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(pSo,"");var r=mSo.test(t);return r||gSo.test(t)?ySo(t.slice(2),r?2:8):hSo.test(t)?onn:+t}a(jSo,"toNumber");function HSo(t){return B4t(t)?RSo(t):kSo(t)}a(HSo,"keys");function GSo(t){return t?SSo(t,HSo(t)):[]}a(GSo,"values");cnn.exports=NSo});var dnn=I((ZWl,unn)=>{p();var $So="[object Boolean]",VSo=Object.prototype,WSo=VSo.toString;function zSo(t){return t===!0||t===!1||YSo(t)&&WSo.call(t)==$So}a(zSo,"isBoolean");function YSo(t){return!!t&&typeof t=="object"}a(YSo,"isObjectLike");unn.exports=zSo});var gnn=I((tzl,mnn)=>{p();var fnn=1/0,KSo=17976931348623157e292,pnn=NaN,JSo="[object Symbol]",ZSo=/^\s+|\s+$/g,XSo=/^[-+]0x[0-9a-f]+$/i,eTo=/^0b[01]+$/i,tTo=/^0o[0-7]+$/i,rTo=parseInt,nTo=Object.prototype,iTo=nTo.toString;function oTo(t){return typeof t=="number"&&t==lTo(t)}a(oTo,"isInteger");function hnn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(hnn,"isObject");function sTo(t){return!!t&&typeof t=="object"}a(sTo,"isObjectLike");function aTo(t){return typeof t=="symbol"||sTo(t)&&iTo.call(t)==JSo}a(aTo,"isSymbol");function cTo(t){if(!t)return t===0?t:0;if(t=uTo(t),t===fnn||t===-fnn){var e=t<0?-1:1;return e*KSo}return t===t?t:0}a(cTo,"toFinite");function lTo(t){var e=cTo(t),r=e%1;return e===e?r?e-r:e:0}a(lTo,"toInteger");function uTo(t){if(typeof t=="number")return t;if(aTo(t))return pnn;if(hnn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=hnn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(ZSo,"");var r=eTo.test(t);return r||tTo.test(t)?rTo(t.slice(2),r?2:8):XSo.test(t)?pnn:+t}a(uTo,"toNumber");mnn.exports=oTo});var ynn=I((izl,Ann)=>{p();var dTo="[object Number]",fTo=Object.prototype,pTo=fTo.toString;function hTo(t){return!!t&&typeof t=="object"}a(hTo,"isObjectLike");function mTo(t){return typeof t=="number"||hTo(t)&&pTo.call(t)==dTo}a(mTo,"isNumber");Ann.exports=mTo});var vnn=I((azl,Cnn)=>{p();var gTo="[object Object]";function ATo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(ATo,"isHostObject");function yTo(t,e){return function(r){return t(e(r))}}a(yTo,"overArg");var ETo=Function.prototype,Enn=Object.prototype,_nn=ETo.toString,_To=Enn.hasOwnProperty,CTo=_nn.call(Object),vTo=Enn.toString,bTo=yTo(Object.getPrototypeOf,Object);function STo(t){return!!t&&typeof t=="object"}a(STo,"isObjectLike");function TTo(t){if(!STo(t)||vTo.call(t)!=gTo||ATo(t))return!1;var e=bTo(t);if(e===null)return!0;var r=_To.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&_nn.call(r)==CTo}a(TTo,"isPlainObject");Cnn.exports=TTo});var Snn=I((uzl,bnn)=>{p();var ITo="[object String]",xTo=Object.prototype,wTo=xTo.toString,RTo=Array.isArray;function kTo(t){return!!t&&typeof t=="object"}a(kTo,"isObjectLike");function PTo(t){return typeof t=="string"||!RTo(t)&&kTo(t)&&wTo.call(t)==ITo}a(PTo,"isString");bnn.exports=PTo});var Rnn=I((pzl,wnn)=>{p();var DTo="Expected a function",Tnn=1/0,NTo=17976931348623157e292,Inn=NaN,MTo="[object Symbol]",OTo=/^\s+|\s+$/g,BTo=/^[-+]0x[0-9a-f]+$/i,LTo=/^0b[01]+$/i,FTo=/^0o[0-7]+$/i,UTo=parseInt,QTo=Object.prototype,qTo=QTo.toString;function jTo(t,e){var r;if(typeof e!="function")throw new TypeError(DTo);return t=WTo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(jTo,"before");function HTo(t){return jTo(2,t)}a(HTo,"once");function xnn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(xnn,"isObject");function GTo(t){return!!t&&typeof t=="object"}a(GTo,"isObjectLike");function $To(t){return typeof t=="symbol"||GTo(t)&&qTo.call(t)==MTo}a($To,"isSymbol");function VTo(t){if(!t)return t===0?t:0;if(t=zTo(t),t===Tnn||t===-Tnn){var e=t<0?-1:1;return e*NTo}return t===t?t:0}a(VTo,"toFinite");function WTo(t){var e=VTo(t),r=e%1;return e===e?r?e-r:e:0}a(WTo,"toInteger");function zTo(t){if(typeof t=="number")return t;if($To(t))return Inn;if(xnn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xnn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(OTo,"");var r=LTo.test(t);return r||FTo.test(t)?UTo(t.slice(2),r?2:8):BTo.test(t)?Inn:+t}a(zTo,"toNumber");wnn.exports=HTo});var Fnn=I((gzl,Lnn)=>{p();var knn=l4t(),YTo=P4t(),KTo=k4t(),Pnn=lje(),JTo=lnn(),wje=dnn(),Dnn=gnn(),F4t=ynn(),Mnn=vnn(),m7=Snn(),ZTo=Rnn(),{KeyObject:XTo,createSecretKey:eIo,createPrivateKey:tIo}=require("crypto"),Onn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];YTo&&Onn.splice(3,0,"PS256","PS384","PS512");var rIo={expiresIn:{isValid:a(function(t){return Dnn(t)||m7(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return Dnn(t)||m7(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return m7(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:JTo.bind(null,Onn),message:'"algorithm" must be a valid string enum value'},header:{isValid:Mnn,message:'"header" must be an object'},encoding:{isValid:m7,message:'"encoding" must be a string'},issuer:{isValid:m7,message:'"issuer" must be a string'},subject:{isValid:m7,message:'"subject" must be a string'},jwtid:{isValid:m7,message:'"jwtid" must be a string'},noTimestamp:{isValid:wje,message:'"noTimestamp" must be a boolean'},keyid:{isValid:m7,message:'"keyid" must be a string'},mutatePayload:{isValid:wje,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:wje,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:wje,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},nIo={iat:{isValid:F4t,message:'"iat" should be a number of seconds'},exp:{isValid:F4t,message:'"exp" should be a number of seconds'},nbf:{isValid:F4t,message:'"nbf" should be a number of seconds'}};function Bnn(t,e,r,n){if(!Mnn(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a(Bnn,"validate");function iIo(t){return Bnn(rIo,!1,t,"options")}a(iIo,"validateOptions");function oIo(t){return Bnn(nIo,!0,t,"payload")}a(oIo,"validatePayload");var Nnn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},sIo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];Lnn.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof XTo))try{e=tIo(e)}catch{try{e=eIo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{oIo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=sIo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{iIo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{KTo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=knn(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=knn(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Nnn).forEach(function(d){let f=Nnn[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&ZTo(n),Pnn.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=Pnn.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var Qnn=I((Ezl,Unn)=>{p();Unn.exports={decode:o4t(),verify:nnn(),sign:Fnn(),JsonWebTokenError:O1e(),NotBeforeError:s4t(),TokenExpiredError:a4t()}});var mBt=I((pru,Qin)=>{p();function cxo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=c4t(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();lS.formatArgs=uxo;lS.save=dxo;lS.load=fxo;lS.useColors=lxo;lS.storage=pxo();lS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();lS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function lxo(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(lxo,"useColors");function uxo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+oHe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(uxo,"formatArgs");lS.log=console.debug||console.log||(()=>{});function dxo(t){try{t?lS.storage.setItem("debug",t):lS.storage.removeItem("debug")}catch{}}a(dxo,"save");function fxo(){let t;try{t=lS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(fxo,"load");function pxo(){try{return localStorage}catch{}}a(pxo,"localstorage");oHe.exports=mBt()(lS);var{formatters:hxo}=oHe.exports;hxo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Hin=I((yru,jin)=>{"use strict";p();jin.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var mxo=require("os"),Gin=require("tty"),dx=Hin(),{env:jm}=process,y7;dx("no-color")||dx("no-colors")||dx("color=false")||dx("color=never")?y7=0:(dx("color")||dx("colors")||dx("color=true")||dx("color=always"))&&(y7=1);"FORCE_COLOR"in jm&&(jm.FORCE_COLOR==="true"?y7=1:jm.FORCE_COLOR==="false"?y7=0:y7=jm.FORCE_COLOR.length===0?1:Math.min(parseInt(jm.FORCE_COLOR,10),3));function gBt(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(gBt,"translateLevel");function ABt(t,e){if(y7===0)return 0;if(dx("color=16m")||dx("color=full")||dx("color=truecolor"))return 3;if(dx("color=256"))return 2;if(t&&!e&&y7===void 0)return 0;let r=y7||0;if(jm.TERM==="dumb")return r;if(process.platform==="win32"){let n=mxo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in jm)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in jm)||jm.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in jm)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(jm.TEAMCITY_VERSION)?1:0;if(jm.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in jm){let n=parseInt((jm.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(jm.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(jm.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(jm.TERM)||"COLORTERM"in jm?1:r}a(ABt,"supportsColor");function gxo(t){let e=ABt(t,t&&t.isTTY);return gBt(e)}a(gxo,"getSupportLevel");$in.exports={supportsColor:gxo,stdout:gBt(ABt(!0,Gin.isatty(1))),stderr:gBt(ABt(!0,Gin.isatty(2)))}});var Win=I((aA,cHe)=>{p();var Axo=require("tty"),aHe=require("util");aA.init=Sxo;aA.log=Cxo;aA.formatArgs=Exo;aA.save=vxo;aA.load=bxo;aA.useColors=yxo;aA.destroy=aHe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");aA.colors=[6,2,3,4,5,1];try{let t=sHe();t&&(t.stderr||t).level>=2&&(aA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}aA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function yxo(){return"colors"in aA.inspectOpts?!!aA.inspectOpts.colors:Axo.isatty(process.stderr.fd)}a(yxo,"useColors");function Exo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,C1e="secret must be a string or buffer",pae="key must be a string or a buffer",X_o="key must be a string, a buffer or an object",j5t=typeof ix.createPublicKey=="function";j5t&&(pae+=" or a KeyObject",C1e+="or a KeyObject");function ien(t){if(!hae.isBuffer(t)&&typeof t!="string"&&(!j5t||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw jP(pae)}a(ien,"checkIsPublicKey");function oen(t){if(!hae.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw jP(X_o)}a(oen,"checkIsPrivateKey");function evo(t){if(!hae.isBuffer(t)){if(typeof t=="string")return t;if(!j5t||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw jP(C1e)}}a(evo,"checkIsSecretKey");function H5t(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(H5t,"fromBase64");function sen(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r{p();var uvo=require("buffer").Buffer;den.exports=a(function(e){return typeof e=="string"?e:typeof e=="number"||uvo.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var Aen=I((Ojl,gen)=>{p();var dvo=fae().Buffer,fen=F5t(),fvo=G5t(),pvo=require("stream"),pen=$5t(),V5t=require("util");function hen(t,e){return dvo.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(hen,"base64url");function hvo(t,e,r){r=r||"utf8";var n=hen(pen(t),"binary"),o=hen(pen(e),r);return V5t.format("%s.%s",n,o)}a(hvo,"jwsSecuredInput");function men(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,o=t.encoding,s=fvo(e.alg),c=hvo(e,r,o),l=s.sign(c,n);return V5t.format("%s.%s",c,l)}a(men,"jwsSign");function Wqe(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new fen(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new fen(t.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(Wqe,"SignStream");V5t.inherits(Wqe,pvo);Wqe.prototype.sign=a(function(){try{var e=men({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");Wqe.sign=men;gen.exports=Wqe});var xen=I((Fjl,Ien)=>{p();var Een=fae().Buffer,yen=F5t(),mvo=G5t(),gvo=require("stream"),_en=$5t(),Avo=require("util"),yvo=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Evo(t){return Object.prototype.toString.call(t)==="[object Object]"}a(Evo,"isObject");function _vo(t){if(Evo(t))return t;try{return JSON.parse(t)}catch{return}}a(_vo,"safeJsonParse");function ven(t){var e=t.split(".",1)[0];return _vo(Een.from(e,"base64").toString("binary"))}a(ven,"headerFromJWS");function vvo(t){return t.split(".",2).join(".")}a(vvo,"securedInputFromJWS");function Cen(t){return t.split(".")[2]}a(Cen,"signatureFromJWS");function Cvo(t,e){e=e||"utf8";var r=t.split(".")[1];return Een.from(r,"base64").toString(e)}a(Cvo,"payloadFromJWS");function ben(t){return yvo.test(t)&&!!ven(t)}a(ben,"isValidJws");function Sen(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=_en(t);var o=Cen(t),s=vvo(t),c=mvo(e);return c.verify(s,o,r)}a(Sen,"jwsVerify");function Ten(t,e){if(e=e||{},t=_en(t),!ben(t))return null;var r=ven(t);if(!r)return null;var n=Cvo(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:Cen(t)}}a(Ten,"jwsDecode");function mae(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new yen(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new yen(t.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(mae,"VerifyStream");Avo.inherits(mae,gvo);mae.prototype.verify=a(function(){try{var e=Sen(this.signature.buffer,this.algorithm,this.key.buffer),r=Ten(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");mae.decode=Ten;mae.isValid=ben;mae.verify=Sen;Ien.exports=mae});var Yqe=I(c7=>{p();var wen=Aen(),zqe=xen(),bvo=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];c7.ALGORITHMS=bvo;c7.sign=wen.sign;c7.verify=zqe.verify;c7.decode=zqe.decode;c7.isValid=zqe.isValid;c7.createSign=a(function(e){return new wen(e)},"createSign");c7.createVerify=a(function(e){return new zqe(e)},"createVerify")});var W5t=I((Gjl,Ren)=>{p();var Svo=Yqe();Ren.exports=function(t,e){e=e||{};var r=Svo.decode(t,e);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var o=JSON.parse(n);o!==null&&typeof o=="object"&&(n=o)}catch{}return e.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var S1e=I((Vjl,Pen)=>{p();var Kqe=a(function(t,e){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,e&&(this.inner=e)},"JsonWebTokenError");Kqe.prototype=Object.create(Error.prototype);Kqe.prototype.constructor=Kqe;Pen.exports=Kqe});var z5t=I((Yjl,Den)=>{p();var ken=S1e(),Jqe=a(function(t,e){ken.call(this,t),this.name="NotBeforeError",this.date=e},"NotBeforeError");Jqe.prototype=Object.create(ken.prototype);Jqe.prototype.constructor=Jqe;Den.exports=Jqe});var Y5t=I((Zjl,Men)=>{p();var Nen=S1e(),Zqe=a(function(t,e){Nen.call(this,t),this.name="TokenExpiredError",this.expiredAt=e},"TokenExpiredError");Zqe.prototype=Object.create(Nen.prototype);Zqe.prototype.constructor=Zqe;Men.exports=Zqe});var K5t=I((tHl,Oen)=>{p();var gae=1e3,Aae=gae*60,yae=Aae*60,Pz=yae*24,Tvo=Pz*7,Ivo=Pz*365.25;Oen.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return xvo(t);if(r==="number"&&isFinite(t))return e.long?Rvo(t):wvo(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function xvo(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Ivo;case"weeks":case"week":case"w":return r*Tvo;case"days":case"day":case"d":return r*Pz;case"hours":case"hour":case"hrs":case"hr":case"h":return r*yae;case"minutes":case"minute":case"mins":case"min":case"m":return r*Aae;case"seconds":case"second":case"secs":case"sec":case"s":return r*gae;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(xvo,"parse");function wvo(t){var e=Math.abs(t);return e>=Pz?Math.round(t/Pz)+"d":e>=yae?Math.round(t/yae)+"h":e>=Aae?Math.round(t/Aae)+"m":e>=gae?Math.round(t/gae)+"s":t+"ms"}a(wvo,"fmtShort");function Rvo(t){var e=Math.abs(t);return e>=Pz?Xqe(t,e,Pz,"day"):e>=yae?Xqe(t,e,yae,"hour"):e>=Aae?Xqe(t,e,Aae,"minute"):e>=gae?Xqe(t,e,gae,"second"):t+" ms"}a(Rvo,"fmtLong");function Xqe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Xqe,"plural")});var J5t=I((iHl,Ben)=>{p();var Pvo=K5t();Ben.exports=function(t,e){var r=e||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=Pvo(t);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof t=="number"?r+t:void 0}});var Eae=I((sHl,Len)=>{"use strict";p();var kvo="2.0.0",Dvo=Number.MAX_SAFE_INTEGER||9007199254740991,Nvo=16,Mvo=250,Ovo=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Len.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Nvo,MAX_SAFE_BUILD_LENGTH:Mvo,MAX_SAFE_INTEGER:Dvo,RELEASE_TYPES:Ovo,SEMVER_SPEC_VERSION:kvo,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var T1e=I((cHl,Fen)=>{"use strict";p();var Bvo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Fen.exports=Bvo});var _ae=I((fM,Uen)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Z5t,MAX_SAFE_BUILD_LENGTH:Lvo,MAX_LENGTH:Fvo}=Eae(),Uvo=T1e();fM=Uen.exports={};var Qvo=fM.re=[],qvo=fM.safeRe=[],bn=fM.src=[],jvo=fM.safeSrc=[],Sn=fM.t={},Hvo=0,X5t="[a-zA-Z0-9-]",Gvo=[["\\s",1],["\\d",Fvo],[X5t,Lvo]],$vo=a(t=>{for(let[e,r]of Gvo)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},"makeSafeRegex"),Bo=a((t,e,r)=>{let n=$vo(e),o=Hvo++;Uvo(t,o,e),Sn[t]=o,bn[o]=e,jvo[o]=n,Qvo[o]=new RegExp(e,r?"g":void 0),qvo[o]=new RegExp(n,r?"g":void 0)},"createToken");Bo("NUMERICIDENTIFIER","0|[1-9]\\d*");Bo("NUMERICIDENTIFIERLOOSE","\\d+");Bo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${X5t}*`);Bo("MAINVERSION",`(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})\\.(${bn[Sn.NUMERICIDENTIFIER]})`);Bo("MAINVERSIONLOOSE",`(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})\\.(${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Bo("PRERELEASEIDENTIFIER",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIER]})`);Bo("PRERELEASEIDENTIFIERLOOSE",`(?:${bn[Sn.NONNUMERICIDENTIFIER]}|${bn[Sn.NUMERICIDENTIFIERLOOSE]})`);Bo("PRERELEASE",`(?:-(${bn[Sn.PRERELEASEIDENTIFIER]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIER]})*))`);Bo("PRERELEASELOOSE",`(?:-?(${bn[Sn.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${bn[Sn.PRERELEASEIDENTIFIERLOOSE]})*))`);Bo("BUILDIDENTIFIER",`${X5t}+`);Bo("BUILD",`(?:\\+(${bn[Sn.BUILDIDENTIFIER]}(?:\\.${bn[Sn.BUILDIDENTIFIER]})*))`);Bo("FULLPLAIN",`v?${bn[Sn.MAINVERSION]}${bn[Sn.PRERELEASE]}?${bn[Sn.BUILD]}?`);Bo("FULL",`^${bn[Sn.FULLPLAIN]}$`);Bo("LOOSEPLAIN",`[v=\\s]*${bn[Sn.MAINVERSIONLOOSE]}${bn[Sn.PRERELEASELOOSE]}?${bn[Sn.BUILD]}?`);Bo("LOOSE",`^${bn[Sn.LOOSEPLAIN]}$`);Bo("GTLT","((?:<|>)?=?)");Bo("XRANGEIDENTIFIERLOOSE",`${bn[Sn.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Bo("XRANGEIDENTIFIER",`${bn[Sn.NUMERICIDENTIFIER]}|x|X|\\*`);Bo("XRANGEPLAIN",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:\\.(${bn[Sn.XRANGEIDENTIFIER]})(?:${bn[Sn.PRERELEASE]})?${bn[Sn.BUILD]}?)?)?`);Bo("XRANGEPLAINLOOSE",`[v=\\s]*(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:\\.(${bn[Sn.XRANGEIDENTIFIERLOOSE]})(?:${bn[Sn.PRERELEASELOOSE]})?${bn[Sn.BUILD]}?)?)?`);Bo("XRANGE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAIN]}$`);Bo("XRANGELOOSE",`^${bn[Sn.GTLT]}\\s*${bn[Sn.XRANGEPLAINLOOSE]}$`);Bo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Z5t}})(?:\\.(\\d{1,${Z5t}}))?(?:\\.(\\d{1,${Z5t}}))?`);Bo("COERCE",`${bn[Sn.COERCEPLAIN]}(?:$|[^\\d])`);Bo("COERCEFULL",bn[Sn.COERCEPLAIN]+`(?:${bn[Sn.PRERELEASE]})?(?:${bn[Sn.BUILD]})?(?:$|[^\\d])`);Bo("COERCERTL",bn[Sn.COERCE],!0);Bo("COERCERTLFULL",bn[Sn.COERCEFULL],!0);Bo("LONETILDE","(?:~>?)");Bo("TILDETRIM",`(\\s*)${bn[Sn.LONETILDE]}\\s+`,!0);fM.tildeTrimReplace="$1~";Bo("TILDE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAIN]}$`);Bo("TILDELOOSE",`^${bn[Sn.LONETILDE]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Bo("LONECARET","(?:\\^)");Bo("CARETTRIM",`(\\s*)${bn[Sn.LONECARET]}\\s+`,!0);fM.caretTrimReplace="$1^";Bo("CARET",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAIN]}$`);Bo("CARETLOOSE",`^${bn[Sn.LONECARET]}${bn[Sn.XRANGEPLAINLOOSE]}$`);Bo("COMPARATORLOOSE",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]})$|^$`);Bo("COMPARATOR",`^${bn[Sn.GTLT]}\\s*(${bn[Sn.FULLPLAIN]})$|^$`);Bo("COMPARATORTRIM",`(\\s*)${bn[Sn.GTLT]}\\s*(${bn[Sn.LOOSEPLAIN]}|${bn[Sn.XRANGEPLAIN]})`,!0);fM.comparatorTrimReplace="$1$2$3";Bo("HYPHENRANGE",`^\\s*(${bn[Sn.XRANGEPLAIN]})\\s+-\\s+(${bn[Sn.XRANGEPLAIN]})\\s*$`);Bo("HYPHENRANGELOOSE",`^\\s*(${bn[Sn.XRANGEPLAINLOOSE]})\\s+-\\s+(${bn[Sn.XRANGEPLAINLOOSE]})\\s*$`);Bo("STAR","(<|>)?=?\\s*\\*");Bo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Bo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var eje=I((fHl,Qen)=>{"use strict";p();var Vvo=Object.freeze({loose:!0}),Wvo=Object.freeze({}),zvo=a(t=>t?typeof t!="object"?Vvo:t:Wvo,"parseOptions");Qen.exports=zvo});var e4t=I((mHl,Hen)=>{"use strict";p();var qen=/^[0-9]+$/,jen=a((t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tjen(e,t),"rcompareIdentifiers");Hen.exports={compareIdentifiers:jen,rcompareIdentifiers:Yvo}});var oA=I((yHl,$en)=>{"use strict";p();var tje=T1e(),{MAX_LENGTH:Gen,MAX_SAFE_INTEGER:rje}=Eae(),{safeRe:nje,t:ije}=_ae(),Kvo=eje(),{compareIdentifiers:t4t}=e4t(),r4t=class t{static{a(this,"SemVer")}constructor(e,r){if(r=Kvo(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Gen)throw new TypeError(`version is longer than ${Gen} characters`);tje("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?nje[ije.LOOSE]:nje[ije.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>rje||this.major<0)throw new TypeError("Invalid major version");if(this.minor>rje||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>rje||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&se.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],o=e.prerelease[r];if(tje("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return t4t(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(tje("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return t4t(n,o)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let o=`-${r}`.match(this.options.loose?nje[ije.PRERELEASELOOSE]:nje[ije.PRERELEASE]);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let s=[r,o];n===!1&&(s=[r]),t4t(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};$en.exports=r4t});var l7=I((vHl,Wen)=>{"use strict";p();var Ven=oA(),Jvo=a((t,e,r=!1)=>{if(t instanceof Ven)return t;try{return new Ven(t,e)}catch(n){if(!r)return null;throw n}},"parse");Wen.exports=Jvo});var Yen=I((SHl,zen)=>{"use strict";p();var Zvo=l7(),Xvo=a((t,e)=>{let r=Zvo(t,e);return r?r.version:null},"valid");zen.exports=Xvo});var Jen=I((xHl,Ken)=>{"use strict";p();var eCo=l7(),tCo=a((t,e)=>{let r=eCo(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null},"clean");Ken.exports=tCo});var etn=I((PHl,Xen)=>{"use strict";p();var Zen=oA(),rCo=a((t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Zen(t instanceof Zen?t.version:t,r).inc(e,n,o).version}catch{return null}},"inc");Xen.exports=rCo});var ntn=I((NHl,rtn)=>{"use strict";p();var ttn=l7(),nCo=a((t,e)=>{let r=ttn(t,null,!0),n=ttn(e,null,!0),o=r.compare(n);if(o===0)return null;let s=o>0,c=s?r:n,l=s?n:r,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}let f=u?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"},"diff");rtn.exports=nCo});var otn=I((BHl,itn)=>{"use strict";p();var iCo=oA(),oCo=a((t,e)=>new iCo(t,e).major,"major");itn.exports=oCo});var atn=I((UHl,stn)=>{"use strict";p();var sCo=oA(),aCo=a((t,e)=>new sCo(t,e).minor,"minor");stn.exports=aCo});var ltn=I((jHl,ctn)=>{"use strict";p();var cCo=oA(),lCo=a((t,e)=>new cCo(t,e).patch,"patch");ctn.exports=lCo});var dtn=I(($Hl,utn)=>{"use strict";p();var uCo=l7(),dCo=a((t,e)=>{let r=uCo(t,e);return r&&r.prerelease.length?r.prerelease:null},"prerelease");utn.exports=dCo});var ox=I((zHl,ptn)=>{"use strict";p();var ftn=oA(),fCo=a((t,e,r)=>new ftn(t,r).compare(new ftn(e,r)),"compare");ptn.exports=fCo});var mtn=I((JHl,htn)=>{"use strict";p();var pCo=ox(),hCo=a((t,e,r)=>pCo(e,t,r),"rcompare");htn.exports=hCo});var Atn=I((eGl,gtn)=>{"use strict";p();var mCo=ox(),gCo=a((t,e)=>mCo(t,e,!0),"compareLoose");gtn.exports=gCo});var oje=I((nGl,Etn)=>{"use strict";p();var ytn=oA(),ACo=a((t,e,r)=>{let n=new ytn(t,r),o=new ytn(e,r);return n.compare(o)||n.compareBuild(o)},"compareBuild");Etn.exports=ACo});var vtn=I((sGl,_tn)=>{"use strict";p();var yCo=oje(),ECo=a((t,e)=>t.sort((r,n)=>yCo(r,n,e)),"sort");_tn.exports=ECo});var btn=I((lGl,Ctn)=>{"use strict";p();var _Co=oje(),vCo=a((t,e)=>t.sort((r,n)=>_Co(n,r,e)),"rsort");Ctn.exports=vCo});var I1e=I((fGl,Stn)=>{"use strict";p();var CCo=ox(),bCo=a((t,e,r)=>CCo(t,e,r)>0,"gt");Stn.exports=bCo});var sje=I((mGl,Ttn)=>{"use strict";p();var SCo=ox(),TCo=a((t,e,r)=>SCo(t,e,r)<0,"lt");Ttn.exports=TCo});var n4t=I((yGl,Itn)=>{"use strict";p();var ICo=ox(),xCo=a((t,e,r)=>ICo(t,e,r)===0,"eq");Itn.exports=xCo});var i4t=I((vGl,xtn)=>{"use strict";p();var wCo=ox(),RCo=a((t,e,r)=>wCo(t,e,r)!==0,"neq");xtn.exports=RCo});var aje=I((SGl,wtn)=>{"use strict";p();var PCo=ox(),kCo=a((t,e,r)=>PCo(t,e,r)>=0,"gte");wtn.exports=kCo});var cje=I((xGl,Rtn)=>{"use strict";p();var DCo=ox(),NCo=a((t,e,r)=>DCo(t,e,r)<=0,"lte");Rtn.exports=NCo});var o4t=I((PGl,Ptn)=>{"use strict";p();var MCo=n4t(),OCo=i4t(),BCo=I1e(),LCo=aje(),FCo=sje(),UCo=cje(),QCo=a((t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return MCo(t,r,n);case"!=":return OCo(t,r,n);case">":return BCo(t,r,n);case">=":return LCo(t,r,n);case"<":return FCo(t,r,n);case"<=":return UCo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}},"cmp");Ptn.exports=QCo});var Dtn=I((NGl,ktn)=>{"use strict";p();var qCo=oA(),jCo=l7(),{safeRe:lje,t:uje}=_ae(),HCo=a((t,e)=>{if(t instanceof qCo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?lje[uje.COERCEFULL]:lje[uje.COERCE]);else{let u=e.includePrerelease?lje[uje.COERCERTLFULL]:lje[uje.COERCERTL],d;for(;(d=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),u.lastIndex=d.index+d[1].length+d[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",l=e.includePrerelease&&r[6]?`+${r[6]}`:"";return jCo(`${n}.${o}.${s}${c}${l}`,e)},"coerce");ktn.exports=HCo});var Mtn=I((BGl,Ntn)=>{"use strict";p();var GCo=l7(),$Co=Eae(),VCo=oA(),WCo=a((t,e,r)=>{if(!$Co.RELEASE_TYPES.includes(e))return null;let n=zCo(t,r);return n&&YCo(n,e)},"truncate"),zCo=a((t,e)=>{let r=t instanceof VCo?t.version:t;return GCo(r,e)},"cloneInputVersion"),YCo=a((t,e)=>{if(KCo(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},"doTruncation"),KCo=a(t=>t.startsWith("pre"),"isPrerelease");Ntn.exports=WCo});var Btn=I((UGl,Otn)=>{"use strict";p();var s4t=class{static{a(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};Otn.exports=s4t});var sx=I((jGl,Qtn)=>{"use strict";p();var JCo=/\s+/g,a4t=class t{static{a(this,"Range")}constructor(e,r){if(r=XCo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof c4t)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(JCo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(o=>!Ftn(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&cbo(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(abo,"");let n=((this.options.includePrerelease&&obo)|(this.options.loose&&sbo))+":"+e,o=Ltn.get(n);if(o)return o;let s=this.options.loose,c=s?f_[sA.HYPHENRANGELOOSE]:f_[sA.HYPHENRANGE];e=e.replace(c,ybo(this.options.includePrerelease)),Hu("hyphen replace",e),e=e.replace(f_[sA.COMPARATORTRIM],rbo),Hu("comparator trim",e),e=e.replace(f_[sA.TILDETRIM],nbo),Hu("tilde trim",e),e=e.replace(f_[sA.CARETTRIM],ibo),Hu("caret trim",e);let l=e.split(" ").map(h=>lbo(h,this.options)).join(" ").split(/\s+/).map(h=>Abo(h,this.options));s&&(l=l.filter(h=>(Hu("loose invalid filter",h,this.options),!!h.match(f_[sA.COMPARATORLOOSE])))),Hu("range list",l);let u=new Map,d=l.map(h=>new c4t(h,this.options));for(let h of d){if(Ftn(h))return[h];u.set(h.value,h)}u.size>1&&u.has("")&&u.delete("");let f=[...u.values()];return Ltn.set(n,f),f}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>Utn(n,r)&&e.set.some(o=>Utn(o,r)&&n.every(s=>o.every(c=>s.intersects(c,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ebo(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0","isNullSet"),cbo=a(t=>t.value==="","isAny"),Utn=a((t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(s=>o.intersects(s,e)),o=n.pop();return r},"isSatisfiable"),lbo=a((t,e)=>(t=t.replace(f_[sA.BUILD],""),Hu("comp",t,e),t=fbo(t,e),Hu("caret",t),t=ubo(t,e),Hu("tildes",t),t=hbo(t,e),Hu("xrange",t),t=gbo(t,e),Hu("stars",t),t),"parseComparator"),p_=a(t=>!t||t.toLowerCase()==="x"||t==="*","isX"),ubo=a((t,e)=>t.trim().split(/\s+/).map(r=>dbo(r,e)).join(" "),"replaceTildes"),dbo=a((t,e)=>{let r=e.loose?f_[sA.TILDELOOSE]:f_[sA.TILDE];return t.replace(r,(n,o,s,c,l)=>{Hu("tilde",t,n,o,s,c,l);let u;return p_(o)?u="":p_(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:p_(c)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:l?(Hu("replaceTilde pr",l),u=`>=${o}.${s}.${c}-${l} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${c} <${o}.${+s+1}.0-0`,Hu("tilde return",u),u})},"replaceTilde"),fbo=a((t,e)=>t.trim().split(/\s+/).map(r=>pbo(r,e)).join(" "),"replaceCarets"),pbo=a((t,e)=>{Hu("caret",t,e);let r=e.loose?f_[sA.CARETLOOSE]:f_[sA.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{Hu("caret",t,o,s,c,l,u);let d;return p_(s)?d="":p_(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:p_(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?(Hu("replaceCaret pr",u),s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`):(Hu("no pr"),s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`),Hu("caret return",d),d})},"replaceCaret"),hbo=a((t,e)=>(Hu("replaceXRanges",t,e),t.split(/\s+/).map(r=>mbo(r,e)).join(" ")),"replaceXRanges"),mbo=a((t,e)=>{t=t.trim();let r=e.loose?f_[sA.XRANGELOOSE]:f_[sA.XRANGE];return t.replace(r,(n,o,s,c,l,u)=>{Hu("xRange",t,n,o,s,c,l,u);let d=p_(s),f=d||p_(c),h=f||p_(l),m=h;return o==="="&&m&&(o=""),u=e.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),Hu("xRange return",n),n})},"replaceXRange"),gbo=a((t,e)=>(Hu("replaceStars",t,e),t.trim().replace(f_[sA.STAR],"")),"replaceStars"),Abo=a((t,e)=>(Hu("replaceGTE0",t,e),t.trim().replace(f_[e.includePrerelease?sA.GTE0PRE:sA.GTE0],"")),"replaceGTE0"),ybo=a(t=>(e,r,n,o,s,c,l,u,d,f,h,m)=>(p_(n)?r="":p_(o)?r=`>=${n}.0.0${t?"-0":""}`:p_(s)?r=`>=${n}.${o}.0${t?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,p_(d)?u="":p_(f)?u=`<${+d+1}.0.0-0`:p_(h)?u=`<${d}.${+f+1}.0-0`:m?u=`<=${d}.${f}.${h}-${m}`:t?u=`<${d}.${f}.${+h+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),"hyphenReplace"),Ebo=a((t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0},"testSet")});var x1e=I(($Gl,Vtn)=>{"use strict";p();var w1e=Symbol("SemVer ANY"),d4t=class t{static{a(this,"Comparator")}static get ANY(){return w1e}constructor(e,r){if(r=qtn(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u4t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===w1e?this.value="":this.value=this.operator+this.semver.version,u4t("comp",this)}parse(e){let r=this.options.loose?jtn[Htn.COMPARATORLOOSE]:jtn[Htn.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Gtn(n[2],this.options.loose):this.semver=w1e}toString(){return this.value}test(e){if(u4t("Comparator.test",e,this.options.loose),this.semver===w1e||e===w1e)return!0;if(typeof e=="string")try{e=new Gtn(e,this.options)}catch{return!1}return l4t(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new $tn(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new $tn(this.value,r).test(e.semver):(r=qtn(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l4t(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l4t(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Vtn.exports=d4t;var qtn=eje(),{safeRe:jtn,t:Htn}=_ae(),l4t=o4t(),u4t=T1e(),Gtn=oA(),$tn=sx()});var R1e=I((zGl,Wtn)=>{"use strict";p();var _bo=sx(),vbo=a((t,e,r)=>{try{e=new _bo(e,r)}catch{return!1}return e.test(t)},"satisfies");Wtn.exports=vbo});var Ytn=I((JGl,ztn)=>{"use strict";p();var Cbo=sx(),bbo=a((t,e)=>new Cbo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" ")),"toComparators");ztn.exports=bbo});var Jtn=I((e$l,Ktn)=>{"use strict";p();var Sbo=oA(),Tbo=sx(),Ibo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new Tbo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Sbo(n,r))}),n},"maxSatisfying");Ktn.exports=Ibo});var Xtn=I((n$l,Ztn)=>{"use strict";p();var xbo=oA(),wbo=sx(),Rbo=a((t,e,r)=>{let n=null,o=null,s=null;try{s=new wbo(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new xbo(n,r))}),n},"minSatisfying");Ztn.exports=Rbo});var rrn=I((s$l,trn)=>{"use strict";p();var f4t=oA(),Pbo=sx(),ern=I1e(),kbo=a((t,e)=>{t=new Pbo(t,e);let r=new f4t("0.0.0");if(t.test(r)||(r=new f4t("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let l=new f4t(c.semver.version);switch(c.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||ern(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||ern(r,s))&&(r=s)}return r&&t.test(r)?r:null},"minVersion");trn.exports=kbo});var irn=I((l$l,nrn)=>{"use strict";p();var Dbo=sx(),Nbo=a((t,e)=>{try{return new Dbo(t,e).range||"*"}catch{return null}},"validRange");nrn.exports=Nbo});var dje=I((f$l,crn)=>{"use strict";p();var Mbo=oA(),arn=x1e(),{ANY:Obo}=arn,Bbo=sx(),Lbo=R1e(),orn=I1e(),srn=sje(),Fbo=cje(),Ubo=aje(),Qbo=a((t,e,r,n)=>{t=new Mbo(t,n),e=new Bbo(e,n);let o,s,c,l,u;switch(r){case">":o=orn,s=Fbo,c=srn,l=">",u=">=";break;case"<":o=srn,s=Ubo,c=orn,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Lbo(t,e,n))return!1;for(let d=0;d{g.semver===Obo&&(g=new arn(">=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0},"outside");crn.exports=Qbo});var urn=I((m$l,lrn)=>{"use strict";p();var qbo=dje(),jbo=a((t,e,r)=>qbo(t,e,">",r),"gtr");lrn.exports=jbo});var frn=I((y$l,drn)=>{"use strict";p();var Hbo=dje(),Gbo=a((t,e,r)=>Hbo(t,e,"<",r),"ltr");drn.exports=Gbo});var mrn=I((v$l,hrn)=>{"use strict";p();var prn=sx(),$bo=a((t,e,r)=>(t=new prn(t,r),e=new prn(e,r),t.intersects(e,r)),"intersects");hrn.exports=$bo});var Arn=I((S$l,grn)=>{"use strict";p();var Vbo=R1e(),Wbo=ox();grn.exports=(t,e,r)=>{let n=[],o=null,s=null,c=t.sort((f,h)=>Wbo(f,h,r));for(let f of c)Vbo(f,e,r)?(s=f,o||(o=f)):(s&&n.push([o,s]),s=null,o=null);o&&n.push([o,null]);let l=[];for(let[f,h]of n)f===h?l.push(f):!h&&f===c[0]?l.push("*"):h?f===c[0]?l.push(`<=${h}`):l.push(`${f} - ${h}`):l.push(`>=${f}`);let u=l.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";p();var yrn=sx(),m4t=x1e(),{ANY:p4t}=m4t,h4t=R1e(),g4t=ox(),zbo=a((t,e,r={})=>{if(t===e)return!0;t=new yrn(t,r),e=new yrn(e,r);let n=!1;e:for(let o of t.set){for(let s of e.set){let c=Kbo(o,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},"subset"),Ybo=[new m4t(">=0.0.0-0")],Ern=[new m4t(">=0.0.0")],Kbo=a((t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===p4t){if(e.length===1&&e[0].semver===p4t)return!0;r.includePrerelease?t=Ybo:t=Ern}if(e.length===1&&e[0].semver===p4t){if(r.includePrerelease)return!0;e=Ern}let n=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=_rn(o,g,r):g.operator==="<"||g.operator==="<="?s=vrn(s,g,r):n.add(g.semver);if(n.size>1)return null;let c;if(o&&s){if(c=g4t(o.semver,s.semver,r),c>0)return null;if(c===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(o&&!h4t(g,String(o),r)||s&&!h4t(g,String(s),r))return null;for(let A of e)if(!h4t(g,String(A),r))return!1;return!0}let l,u,d,f,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,m=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;h&&h.prerelease.length===1&&s.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator===">"||g.operator===">="){if(l=_rn(o,g,r),l===g&&l!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator==="<"||g.operator==="<="){if(u=vrn(s,g,r),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||o)&&c!==0)return!1}return!(o&&d&&!s&&c!==0||s&&f&&!o&&c!==0||m||h)},"simpleSubset"),_rn=a((t,e,r)=>{if(!t)return e;let n=g4t(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},"higherGT"),vrn=a((t,e,r)=>{if(!t)return e;let n=g4t(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t},"lowerLT");Crn.exports=zbo});var TL=I((R$l,Irn)=>{"use strict";p();var A4t=_ae(),Srn=Eae(),Jbo=oA(),Trn=e4t(),Zbo=l7(),Xbo=Yen(),e1o=Jen(),t1o=etn(),r1o=ntn(),n1o=otn(),i1o=atn(),o1o=ltn(),s1o=dtn(),a1o=ox(),c1o=mtn(),l1o=Atn(),u1o=oje(),d1o=vtn(),f1o=btn(),p1o=I1e(),h1o=sje(),m1o=n4t(),g1o=i4t(),A1o=aje(),y1o=cje(),E1o=o4t(),_1o=Dtn(),v1o=Mtn(),C1o=x1e(),b1o=sx(),S1o=R1e(),T1o=Ytn(),I1o=Jtn(),x1o=Xtn(),w1o=rrn(),R1o=irn(),P1o=dje(),k1o=urn(),D1o=frn(),N1o=mrn(),M1o=Arn(),O1o=brn();Irn.exports={parse:Zbo,valid:Xbo,clean:e1o,inc:t1o,diff:r1o,major:n1o,minor:i1o,patch:o1o,prerelease:s1o,compare:a1o,rcompare:c1o,compareLoose:l1o,compareBuild:u1o,sort:d1o,rsort:f1o,gt:p1o,lt:h1o,eq:m1o,neq:g1o,gte:A1o,lte:y1o,cmp:E1o,coerce:_1o,truncate:v1o,Comparator:C1o,Range:b1o,satisfies:S1o,toComparators:T1o,maxSatisfying:I1o,minSatisfying:x1o,minVersion:w1o,validRange:R1o,outside:P1o,gtr:k1o,ltr:D1o,intersects:N1o,simplifyRange:M1o,subset:O1o,SemVer:Jbo,re:A4t.re,src:A4t.src,tokens:A4t.t,SEMVER_SPEC_VERSION:Srn.SEMVER_SPEC_VERSION,RELEASE_TYPES:Srn.RELEASE_TYPES,compareIdentifiers:Trn.compareIdentifiers,rcompareIdentifiers:Trn.rcompareIdentifiers}});var wrn=I((k$l,xrn)=>{p();var B1o=TL();xrn.exports=B1o.satisfies(process.version,">=15.7.0")});var Prn=I((N$l,Rrn)=>{p();var L1o=TL();Rrn.exports=L1o.satisfies(process.version,">=16.9.0")});var y4t=I((O$l,krn)=>{p();var F1o=wrn(),U1o=Prn(),Q1o={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},q1o={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};krn.exports=function(t,e){if(!t||!e)return;let r=e.asymmetricKeyType;if(!r)return;let n=Q1o[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(F1o)switch(r){case"ec":let o=e.asymmetricKeyDetails.namedCurve,s=q1o[t];if(o!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(U1o){let c=parseInt(t.slice(-3),10),{hashAlgorithm:l,mgf1HashAlgorithm:u,saltLength:d}=e.asymmetricKeyDetails;if(l!==`sha${c}`||u!==l)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(d!==void 0&&d>c>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}}});var E4t=I((L$l,Drn)=>{p();var j1o=TL();Drn.exports=j1o.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Orn=I((U$l,Mrn)=>{p();var iu=S1e(),H1o=z5t(),Nrn=Y5t(),G1o=W5t(),$1o=J5t(),V1o=y4t(),W1o=E4t(),z1o=Yqe(),{KeyObject:Y1o,createSecretKey:K1o,createPublicKey:J1o}=require("crypto"),_4t=["RS256","RS384","RS512"],Z1o=["ES256","ES384","ES512"],v4t=["RS256","RS384","RS512"],X1o=["HS256","HS384","HS512"];W1o&&(_4t.splice(_4t.length,0,"PS256","PS384","PS512"),v4t.splice(v4t.length,0,"PS256","PS384","PS512"));Mrn.exports=function(t,e,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let o;if(n?o=n:o=a(function(f,h){if(f)throw f;return h},"done"),r.clockTimestamp&&typeof r.clockTimestamp!="number")return o(new iu("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return o(new iu("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return o(new iu("allowInvalidAsymmetricKeyTypes must be a boolean"));let s=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return o(new iu("jwt must be provided"));if(typeof t!="string")return o(new iu("jwt must be a string"));let c=t.split(".");if(c.length!==3)return o(new iu("jwt malformed"));let l;try{l=G1o(t,{complete:!0})}catch(f){return o(f)}if(!l)return o(new iu("invalid token"));let u=l.header,d;if(typeof e=="function"){if(!n)return o(new iu("verify must be called asynchronous if secret or public key is provided as a callback"));d=e}else d=a(function(f,h){return h(null,e)},"getSecret");return d(u,function(f,h){if(f)return o(new iu("error in secret or public key callback: "+f.message));let m=c[2].trim()!=="";if(!m&&h)return o(new iu("jwt signature is required"));if(m&&!h)return o(new iu("secret or public key must be provided"));if(!m&&!r.algorithms)return o(new iu('please specify "none" in "algorithms" to verify unsigned tokens'));if(h!=null&&!(h instanceof Y1o))try{h=J1o(h)}catch{try{h=K1o(typeof h=="string"?Buffer.from(h):h)}catch{return o(new iu("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(h.type==="secret"?r.algorithms=X1o:["rsa","rsa-pss"].includes(h.asymmetricKeyType)?r.algorithms=v4t:h.asymmetricKeyType==="ec"?r.algorithms=Z1o:r.algorithms=_4t),r.algorithms.indexOf(l.header.alg)===-1)return o(new iu("invalid algorithm"));if(u.alg.startsWith("HS")&&h.type!=="secret")return o(new iu(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&h.type!=="public")return o(new iu(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{V1o(u.alg,h)}catch(y){return o(y)}let g;try{g=z1o.verify(t,l.header.alg,h)}catch(y){return o(y)}if(!g)return o(new iu("invalid signature"));let A=l.payload;if(typeof A.nbf<"u"&&!r.ignoreNotBefore){if(typeof A.nbf!="number")return o(new iu("invalid nbf value"));if(A.nbf>s+(r.clockTolerance||0))return o(new H1o("jwt not active",new Date(A.nbf*1e3)))}if(typeof A.exp<"u"&&!r.ignoreExpiration){if(typeof A.exp!="number")return o(new iu("invalid exp value"));if(s>=A.exp+(r.clockTolerance||0))return o(new Nrn("jwt expired",new Date(A.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(A.aud)?A.aud:[A.aud]).some(function(v){return y.some(function(b){return b instanceof RegExp?b.test(v):b===v})}))return o(new iu("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&A.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(A.iss)===-1))return o(new iu("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&A.sub!==r.subject)return o(new iu("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&A.jti!==r.jwtid)return o(new iu("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&A.nonce!==r.nonce)return o(new iu("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof A.iat!="number")return o(new iu("iat required when maxAge is specified"));let y=$1o(r.maxAge,A.iat);if(typeof y>"u")return o(new iu('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=y+(r.clockTolerance||0))return o(new Nrn("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=l.signature;return o(null,{header:u,payload:A,signature:y})}return o(null,A)})}});var qrn=I((j$l,Qrn)=>{p();var Brn=1/0,Frn=9007199254740991,eSo=17976931348623157e292,Lrn=NaN,tSo="[object Arguments]",rSo="[object Function]",nSo="[object GeneratorFunction]",iSo="[object String]",oSo="[object Symbol]",sSo=/^\s+|\s+$/g,aSo=/^[-+]0x[0-9a-f]+$/i,cSo=/^0b[01]+$/i,lSo=/^0o[0-7]+$/i,uSo=/^(?:0|[1-9]\d*)$/,dSo=parseInt;function fSo(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r-1&&t%1==0&&t-1:!!o&&hSo(t,e,r)>-1}a(ISo,"includes");function xSo(t){return wSo(t)&&b4t.call(t,"callee")&&(!ESo.call(t,"callee")||pje.call(t)==tSo)}a(xSo,"isArguments");var Urn=Array.isArray;function S4t(t){return t!=null&&PSo(t.length)&&!RSo(t)}a(S4t,"isArrayLike");function wSo(t){return T4t(t)&&S4t(t)}a(wSo,"isArrayLikeObject");function RSo(t){var e=C4t(t)?pje.call(t):"";return e==rSo||e==nSo}a(RSo,"isFunction");function PSo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Frn}a(PSo,"isLength");function C4t(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(C4t,"isObject");function T4t(t){return!!t&&typeof t=="object"}a(T4t,"isObjectLike");function kSo(t){return typeof t=="string"||!Urn(t)&&T4t(t)&&pje.call(t)==iSo}a(kSo,"isString");function DSo(t){return typeof t=="symbol"||T4t(t)&&pje.call(t)==oSo}a(DSo,"isSymbol");function NSo(t){if(!t)return t===0?t:0;if(t=OSo(t),t===Brn||t===-Brn){var e=t<0?-1:1;return e*eSo}return t===t?t:0}a(NSo,"toFinite");function MSo(t){var e=NSo(t),r=e%1;return e===e?r?e-r:e:0}a(MSo,"toInteger");function OSo(t){if(typeof t=="number")return t;if(DSo(t))return Lrn;if(C4t(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=C4t(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(sSo,"");var r=cSo.test(t);return r||lSo.test(t)?dSo(t.slice(2),r?2:8):aSo.test(t)?Lrn:+t}a(OSo,"toNumber");function BSo(t){return S4t(t)?CSo(t):bSo(t)}a(BSo,"keys");function LSo(t){return t?ASo(t,BSo(t)):[]}a(LSo,"values");Qrn.exports=ISo});var Hrn=I(($$l,jrn)=>{p();var FSo="[object Boolean]",USo=Object.prototype,QSo=USo.toString;function qSo(t){return t===!0||t===!1||jSo(t)&&QSo.call(t)==FSo}a(qSo,"isBoolean");function jSo(t){return!!t&&typeof t=="object"}a(jSo,"isObjectLike");jrn.exports=qSo});var zrn=I((z$l,Wrn)=>{p();var Grn=1/0,HSo=17976931348623157e292,$rn=NaN,GSo="[object Symbol]",$So=/^\s+|\s+$/g,VSo=/^[-+]0x[0-9a-f]+$/i,WSo=/^0b[01]+$/i,zSo=/^0o[0-7]+$/i,YSo=parseInt,KSo=Object.prototype,JSo=KSo.toString;function ZSo(t){return typeof t=="number"&&t==rTo(t)}a(ZSo,"isInteger");function Vrn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(Vrn,"isObject");function XSo(t){return!!t&&typeof t=="object"}a(XSo,"isObjectLike");function eTo(t){return typeof t=="symbol"||XSo(t)&&JSo.call(t)==GSo}a(eTo,"isSymbol");function tTo(t){if(!t)return t===0?t:0;if(t=nTo(t),t===Grn||t===-Grn){var e=t<0?-1:1;return e*HSo}return t===t?t:0}a(tTo,"toFinite");function rTo(t){var e=tTo(t),r=e%1;return e===e?r?e-r:e:0}a(rTo,"toInteger");function nTo(t){if(typeof t=="number")return t;if(eTo(t))return $rn;if(Vrn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vrn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace($So,"");var r=WSo.test(t);return r||zSo.test(t)?YSo(t.slice(2),r?2:8):VSo.test(t)?$rn:+t}a(nTo,"toNumber");Wrn.exports=ZSo});var Krn=I((J$l,Yrn)=>{p();var iTo="[object Number]",oTo=Object.prototype,sTo=oTo.toString;function aTo(t){return!!t&&typeof t=="object"}a(aTo,"isObjectLike");function cTo(t){return typeof t=="number"||aTo(t)&&sTo.call(t)==iTo}a(cTo,"isNumber");Yrn.exports=cTo});var enn=I((eVl,Xrn)=>{p();var lTo="[object Object]";function uTo(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}a(uTo,"isHostObject");function dTo(t,e){return function(r){return t(e(r))}}a(dTo,"overArg");var fTo=Function.prototype,Jrn=Object.prototype,Zrn=fTo.toString,pTo=Jrn.hasOwnProperty,hTo=Zrn.call(Object),mTo=Jrn.toString,gTo=dTo(Object.getPrototypeOf,Object);function ATo(t){return!!t&&typeof t=="object"}a(ATo,"isObjectLike");function yTo(t){if(!ATo(t)||mTo.call(t)!=lTo||uTo(t))return!1;var e=gTo(t);if(e===null)return!0;var r=pTo.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Zrn.call(r)==hTo}a(yTo,"isPlainObject");Xrn.exports=yTo});var rnn=I((nVl,tnn)=>{p();var ETo="[object String]",_To=Object.prototype,vTo=_To.toString,CTo=Array.isArray;function bTo(t){return!!t&&typeof t=="object"}a(bTo,"isObjectLike");function STo(t){return typeof t=="string"||!CTo(t)&&bTo(t)&&vTo.call(t)==ETo}a(STo,"isString");tnn.exports=STo});var ann=I((sVl,snn)=>{p();var TTo="Expected a function",nnn=1/0,ITo=17976931348623157e292,inn=NaN,xTo="[object Symbol]",wTo=/^\s+|\s+$/g,RTo=/^[-+]0x[0-9a-f]+$/i,PTo=/^0b[01]+$/i,kTo=/^0o[0-7]+$/i,DTo=parseInt,NTo=Object.prototype,MTo=NTo.toString;function OTo(t,e){var r;if(typeof e!="function")throw new TypeError(TTo);return t=QTo(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}a(OTo,"before");function BTo(t){return OTo(2,t)}a(BTo,"once");function onn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}a(onn,"isObject");function LTo(t){return!!t&&typeof t=="object"}a(LTo,"isObjectLike");function FTo(t){return typeof t=="symbol"||LTo(t)&&MTo.call(t)==xTo}a(FTo,"isSymbol");function UTo(t){if(!t)return t===0?t:0;if(t=qTo(t),t===nnn||t===-nnn){var e=t<0?-1:1;return e*ITo}return t===t?t:0}a(UTo,"toFinite");function QTo(t){var e=UTo(t),r=e%1;return e===e?r?e-r:e:0}a(QTo,"toInteger");function qTo(t){if(typeof t=="number")return t;if(FTo(t))return inn;if(onn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=onn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(wTo,"");var r=PTo.test(t);return r||kTo.test(t)?DTo(t.slice(2),r?2:8):RTo.test(t)?inn:+t}a(qTo,"toNumber");snn.exports=BTo});var gnn=I((lVl,mnn)=>{p();var cnn=J5t(),jTo=E4t(),HTo=y4t(),lnn=Yqe(),GTo=qrn(),hje=Hrn(),unn=zrn(),I4t=Krn(),fnn=enn(),u7=rnn(),$To=ann(),{KeyObject:VTo,createSecretKey:WTo,createPrivateKey:zTo}=require("crypto"),pnn=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];jTo&&pnn.splice(3,0,"PS256","PS384","PS512");var YTo={expiresIn:{isValid:a(function(t){return unn(t)||u7(t)&&t},"isValid"),message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:a(function(t){return unn(t)||u7(t)&&t},"isValid"),message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:a(function(t){return u7(t)||Array.isArray(t)},"isValid"),message:'"audience" must be a string or array'},algorithm:{isValid:GTo.bind(null,pnn),message:'"algorithm" must be a valid string enum value'},header:{isValid:fnn,message:'"header" must be an object'},encoding:{isValid:u7,message:'"encoding" must be a string'},issuer:{isValid:u7,message:'"issuer" must be a string'},subject:{isValid:u7,message:'"subject" must be a string'},jwtid:{isValid:u7,message:'"jwtid" must be a string'},noTimestamp:{isValid:hje,message:'"noTimestamp" must be a boolean'},keyid:{isValid:u7,message:'"keyid" must be a string'},mutatePayload:{isValid:hje,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:hje,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:hje,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},KTo={iat:{isValid:I4t,message:'"iat" should be a number of seconds'},exp:{isValid:I4t,message:'"exp" should be a number of seconds'},nbf:{isValid:I4t,message:'"nbf" should be a number of seconds'}};function hnn(t,e,r,n){if(!fnn(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(o){let s=t[o];if(!s){if(!e)throw new Error('"'+o+'" is not allowed in "'+n+'"');return}if(!s.isValid(r[o]))throw new Error(s.message)})}a(hnn,"validate");function JTo(t){return hnn(YTo,!1,t,"options")}a(JTo,"validateOptions");function ZTo(t){return hnn(KTo,!0,t,"payload")}a(ZTo,"validatePayload");var dnn={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},XTo=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];mnn.exports=function(t,e,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let o=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:r.algorithm||"HS256",typ:o?"JWT":void 0,kid:r.keyid},r.header);function c(d){if(n)return n(d);throw d}if(a(c,"failure"),!e&&r.algorithm!=="none")return c(new Error("secretOrPrivateKey must have a value"));if(e!=null&&!(e instanceof VTo))try{e=zTo(e)}catch{try{e=WTo(typeof e=="string"?Buffer.from(e):e)}catch{return c(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&e.type!=="secret")return c(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(e.type!=="private")return c(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!r.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&e.asymmetricKeyDetails!==void 0&&e.asymmetricKeyDetails.modulusLength<2048)return c(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return c(new Error("payload is required"));if(o){try{ZTo(t)}catch(d){return c(d)}r.mutatePayload||(t=Object.assign({},t))}else{let d=XTo.filter(function(f){return typeof r[f]<"u"});if(d.length>0)return c(new Error("invalid "+d.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof r.expiresIn<"u")return c(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof r.notBefore<"u")return c(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{JTo(r)}catch(d){return c(d)}if(!r.allowInvalidAsymmetricKeyTypes)try{HTo(s.alg,e)}catch(d){return c(d)}let l=t.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete t.iat:o&&(t.iat=l),typeof r.notBefore<"u"){try{t.nbf=cnn(r.notBefore,l)}catch(d){return c(d)}if(typeof t.nbf>"u")return c(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof t=="object"){try{t.exp=cnn(r.expiresIn,l)}catch(d){return c(d)}if(typeof t.exp>"u")return c(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(dnn).forEach(function(d){let f=dnn[d];if(typeof r[d]<"u"){if(typeof t[f]<"u")return c(new Error('Bad "options.'+d+'" option. The payload already has an "'+f+'" property.'));t[f]=r[d]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&$To(n),lnn.createSign({header:s,privateKey:e,payload:t,encoding:u}).once("error",n).once("done",function(d){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,d)});else{let d=lnn.sign({header:s,payload:t,secret:e,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&d.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return d}}});var ynn=I((fVl,Ann)=>{p();Ann.exports={decode:W5t(),verify:Orn(),sign:gnn(),JsonWebTokenError:S1e(),NotBeforeError:z5t(),TokenExpiredError:Y5t()}});var nBt=I((seu,yin)=>{p();function txo(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=o,r.enabled=c,r.humanize=K5t(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h,m=(typeof f=="string"?f:"").split(/[\s,]+/),g=m.length;for(h=0;h"-"+h)].join(",");return r.enable(""),f}a(s,"disable");function c(f){if(f[f.length-1]==="*")return!0;let h,m;for(h=0,m=r.skips.length;h{p();rS.formatArgs=nxo;rS.save=ixo;rS.load=oxo;rS.useColors=rxo;rS.storage=sxo();rS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();rS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function rxo(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(rxo,"useColors");function nxo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+$je.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(nxo,"formatArgs");rS.log=console.debug||console.log||(()=>{});function ixo(t){try{t?rS.storage.setItem("debug",t):rS.storage.removeItem("debug")}catch{}}a(ixo,"save");function oxo(){let t;try{t=rS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(oxo,"load");function sxo(){try{return localStorage}catch{}}a(sxo,"localstorage");$je.exports=nBt()(rS);var{formatters:axo}=$je.exports;axo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vin=I((deu,_in)=>{"use strict";p();_in.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n{"use strict";p();var cxo=require("os"),Cin=require("tty"),cx=vin(),{env:Gm}=process,p7;cx("no-color")||cx("no-colors")||cx("color=false")||cx("color=never")?p7=0:(cx("color")||cx("colors")||cx("color=true")||cx("color=always"))&&(p7=1);"FORCE_COLOR"in Gm&&(Gm.FORCE_COLOR==="true"?p7=1:Gm.FORCE_COLOR==="false"?p7=0:p7=Gm.FORCE_COLOR.length===0?1:Math.min(parseInt(Gm.FORCE_COLOR,10),3));function iBt(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}a(iBt,"translateLevel");function oBt(t,e){if(p7===0)return 0;if(cx("color=16m")||cx("color=full")||cx("color=truecolor"))return 3;if(cx("color=256"))return 2;if(t&&!e&&p7===void 0)return 0;let r=p7||0;if(Gm.TERM==="dumb")return r;if(process.platform==="win32"){let n=cxo.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Gm)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in Gm)||Gm.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in Gm)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Gm.TEAMCITY_VERSION)?1:0;if(Gm.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Gm){let n=parseInt((Gm.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Gm.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Gm.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Gm.TERM)||"COLORTERM"in Gm?1:r}a(oBt,"supportsColor");function lxo(t){let e=oBt(t,t&&t.isTTY);return iBt(e)}a(lxo,"getSupportLevel");bin.exports={supportsColor:lxo,stdout:iBt(oBt(!0,Cin.isatty(1))),stderr:iBt(oBt(!0,Cin.isatty(2)))}});var Tin=I((cA,zje)=>{p();var uxo=require("tty"),Wje=require("util");cA.init=Axo;cA.log=hxo;cA.formatArgs=fxo;cA.save=mxo;cA.load=gxo;cA.useColors=dxo;cA.destroy=Wje.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");cA.colors=[6,2,3,4,5,1];try{let t=Vje();t&&(t.stderr||t).level>=2&&(cA.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}cA.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function dxo(){return"colors"in cA.inspectOpts?!!cA.inspectOpts.colors:uxo.isatty(process.stderr.fd)}a(dxo,"useColors");function fxo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+cHe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=_xo()+e+" "+t[0]}a(Exo,"formatArgs");function _xo(){return aA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(_xo,"getDate");function Cxo(...t){return process.stderr.write(aHe.format(...t)+` -`)}a(Cxo,"log");function vxo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(vxo,"save");function bxo(){return process.env.DEBUG}a(bxo,"load");function Sxo(t){t.inspectOpts={};let e=Object.keys(aA.inspectOpts);for(let r=0;re.trim()).join(" ")};Vin.O=function(t){return this.inspectOpts.colors=this.useColors,aHe.inspect(t,this.inspectOpts)}});var Wk=I((Tru,yBt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?yBt.exports=qin():yBt.exports=Win()});var Kin=I(pv=>{"use strict";p();var Txo=pv&&pv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ixo=pv&&pv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zin=pv&&pv.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Txo(e,t,r);return Ixo(e,t),e};Object.defineProperty(pv,"__esModule",{value:!0});pv.req=pv.json=pv.toBuffer=void 0;var xxo=zin(require("http")),wxo=zin(require("https"));async function Yin(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(Yin,"toBuffer");pv.toBuffer=Yin;async function Rxo(t){let r=(await Yin(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(Rxo,"json");pv.json=Rxo;function kxo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?wxo:xxo).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(kxo,"req");pv.req=kxo});var _Bt=I(uS=>{"use strict";p();var Zin=uS&&uS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pxo=uS&&uS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xin=uS&&uS.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Zin(e,t,r);return Pxo(e,t),e},Dxo=uS&&uS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Zin(e,t,r)};Object.defineProperty(uS,"__esModule",{value:!0});uS.Agent=void 0;var Nxo=Xin(require("net")),Jin=Xin(require("http")),Mxo=require("https");Dxo(Kin(),uS);var vM=Symbol("AgentBaseInternalState"),EBt=class extends Jin.Agent{static{a(this,"Agent")}constructor(e){super(e),this[vM]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` -`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new Nxo.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?Mxo.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof Jin.Agent)return l.addRequest(e,o);this[vM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[vM].currentSocket;if(this[vM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[vM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[vM]&&(this[vM].defaultPort=e)}get protocol(){return this[vM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[vM]&&(this[vM].protocol=e)}};uS.Agent=EBt});var eon=I(Hae=>{"use strict";p();var Oxo=Hae&&Hae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hae,"__esModule",{value:!0});Hae.parseProxyResponse=void 0;var Bxo=Oxo(Wk()),lHe=(0,Bxo.default)("https-proxy-agent:parse-proxy-response");function Lxo(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),lHe("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),lHe("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r +`+s),t.push(o+"m+"+zje.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=pxo()+e+" "+t[0]}a(fxo,"formatArgs");function pxo(){return cA.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(pxo,"getDate");function hxo(...t){return process.stderr.write(Wje.format(...t)+` +`)}a(hxo,"log");function mxo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(mxo,"save");function gxo(){return process.env.DEBUG}a(gxo,"load");function Axo(t){t.inspectOpts={};let e=Object.keys(cA.inspectOpts);for(let r=0;re.trim()).join(" ")};Sin.O=function(t){return this.inspectOpts.colors=this.useColors,Wje.inspect(t,this.inspectOpts)}});var GP=I((yeu,sBt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?sBt.exports=Ein():sBt.exports=Tin()});var win=I(uC=>{"use strict";p();var yxo=uC&&uC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Exo=uC&&uC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Iin=uC&&uC.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&yxo(e,t,r);return Exo(e,t),e};Object.defineProperty(uC,"__esModule",{value:!0});uC.req=uC.json=uC.toBuffer=void 0;var _xo=Iin(require("http")),vxo=Iin(require("https"));async function xin(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}a(xin,"toBuffer");uC.toBuffer=xin;async function Cxo(t){let r=(await xin(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let o=n;throw o.message+=` (input: ${r})`,o}}a(Cxo,"json");uC.json=Cxo;function bxo(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?vxo:_xo).request(t,e),o=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=o.then.bind(o),n}a(bxo,"req");uC.req=bxo});var cBt=I(nS=>{"use strict";p();var Pin=nS&&nS.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sxo=nS&&nS.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kin=nS&&nS.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Pin(e,t,r);return Sxo(e,t),e},Txo=nS&&nS.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pin(e,t,r)};Object.defineProperty(nS,"__esModule",{value:!0});nS.Agent=void 0;var Ixo=kin(require("net")),Rin=kin(require("http")),xxo=require("https");Txo(win(),nS);var gM=Symbol("AgentBaseInternalState"),aBt=class extends Rin.Agent{static{a(this,"Agent")}constructor(e){super(e),this[gM]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(` +`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new Ixo.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],o=n.indexOf(r);o!==-1&&(n.splice(o,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return(typeof e.secureEndpoint=="boolean"?e.secureEndpoint:this.isSecureEndpoint(e))?xxo.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(o),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,o)).then(l=>{if(this.decrementSockets(s,c),l instanceof Rin.Agent)return l.addRequest(e,o);this[gM].currentSocket=l,super.createSocket(e,r,n)},l=>{this.decrementSockets(s,c),n(l)})}createConnection(){let e=this[gM].currentSocket;if(this[gM].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[gM].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[gM]&&(this[gM].defaultPort=e)}get protocol(){return this[gM].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[gM]&&(this[gM].protocol=e)}};nS.Agent=aBt});var Din=I(Mae=>{"use strict";p();var wxo=Mae&&Mae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mae,"__esModule",{value:!0});Mae.parseProxyResponse=void 0;var Rxo=wxo(GP()),Yje=(0,Rxo.default)("https-proxy-agent:parse-proxy-response");function Pxo(t){return new Promise((e,r)=>{let n=0,o=[];function s(){let f=t.read();f?d(f):t.once("readable",s)}a(s,"read");function c(){t.removeListener("end",l),t.removeListener("error",u),t.removeListener("readable",s)}a(c,"cleanup");function l(){c(),Yje("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}a(l,"onend");function u(f){c(),Yje("onerror %o",f),r(f)}a(u,"onerror");function d(f){o.push(f),n+=f.length;let h=Buffer.concat(o,n),m=h.indexOf(`\r \r -`);if(m===-1){lHe("have not received end of HTTP headers yet..."),s();return}let g=h.slice(0,m).toString("ascii").split(`\r -`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}lHe("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(Lxo,"parseProxyResponse");Hae.parseProxyResponse=Lxo});var vBt=I(fx=>{"use strict";p();var Fxo=fx&&fx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Uxo=fx&&fx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),non=fx&&fx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Fxo(e,t,r);return Uxo(e,t),e},ion=fx&&fx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fx,"__esModule",{value:!0});fx.HttpsProxyAgent=void 0;var CBt=non(require("net")),ton=non(require("tls")),Qxo=ion(require("assert")),qxo=ion(Wk()),jxo=_Bt(),Hxo=require("url"),Gxo=eon(),X1e=(0,qxo.default)("https-proxy-agent"),uHe=class extends jxo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new Hxo.URL(e):e,this.proxyHeaders=r?.headers??{},X1e("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?ron(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){X1e("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=ton.connect({...this.connectOpts,servername:m})}else X1e("Creating `net.Socket`: %o",this.connectOpts),o=CBt.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=CBt.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r +`);if(m===-1){Yje("have not received end of HTTP headers yet..."),s();return}let g=h.slice(0,m).toString("ascii").split(`\r +`),A=g.shift();if(!A)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let y=A.split(" "),E=+y[1],_=y.slice(2).join(" "),v={};for(let b of g){if(!b)continue;let T=b.indexOf(":");if(T===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${b}"`));let w=b.slice(0,T).toLowerCase(),R=b.slice(T+1).trimStart(),x=v[w];typeof x=="string"?v[w]=[x,R]:Array.isArray(x)?x.push(R):v[w]=R}Yje("got proxy server response: %o %o",A,v),c(),e({connect:{statusCode:E,statusText:_,headers:v},buffered:h})}a(d,"ondata"),t.on("error",u),t.on("end",l),s()})}a(Pxo,"parseProxyResponse");Mae.parseProxyResponse=Pxo});var uBt=I(lx=>{"use strict";p();var kxo=lx&&lx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Dxo=lx&&lx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Oin=lx&&lx.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&kxo(e,t,r);return Dxo(e,t),e},Bin=lx&&lx.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lx,"__esModule",{value:!0});lx.HttpsProxyAgent=void 0;var lBt=Oin(require("net")),Nin=Oin(require("tls")),Nxo=Bin(require("assert")),Mxo=Bin(GP()),Oxo=cBt(),Bxo=require("url"),Lxo=Din(),j1e=(0,Mxo.default)("https-proxy-agent"),Kje=class extends Oxo.Agent{static{a(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new Bxo.URL(e):e,this.proxyHeaders=r?.headers??{},j1e("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?Min(r,"headers"):null,host:n,port:o}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){j1e("Creating `tls.Socket`: %o",this.connectOpts);let m=this.connectOpts.servername||this.connectOpts.host;o=Nin.connect({...this.connectOpts,servername:m})}else j1e("Creating `net.Socket`: %o",this.connectOpts),o=lBt.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=lBt.isIPv6(r.host)?`[${r.host}]`:r.host,l=`CONNECT ${c}:${r.port} HTTP/1.1\r `;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))l+=`${m}: ${s[m]}\r -`;let u=(0,Gxo.parseProxyResponse)(o);o.write(`${l}\r -`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",$xo),r.secureEndpoint){X1e("Upgrading socket connection to TLS");let m=r.servername||r.host;return ton.connect({...ron(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new CBt.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{X1e("Replaying proxy buffer for failed request"),(0,Qxo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};uHe.protocols=["http","https"];fx.HttpsProxyAgent=uHe;function $xo(t){t.resume()}a($xo,"resume");function ron(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(ron,"omit")});var bBt=I(px=>{"use strict";p();var Vxo=px&&px.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wxo=px&&px.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),son=px&&px.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Vxo(e,t,r);return Wxo(e,t),e},zxo=px&&px.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(px,"__esModule",{value:!0});px.HttpProxyAgent=void 0;var Yxo=son(require("net")),Kxo=son(require("tls")),Jxo=zxo(Wk()),Zxo=require("events"),Xxo=_Bt(),oon=require("url"),Gae=(0,Jxo.default)("http-proxy-agent"),dHe=class extends Xxo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new oon.URL(e):e,this.proxyHeaders=r?.headers??{},Gae("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?ewo(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new oon.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;Gae("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(Gae("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r +`;let u=(0,Lxo.parseProxyResponse)(o);o.write(`${l}\r +`);let{connect:d,buffered:f}=await u;if(e.emit("proxyConnect",d),this.emit("proxyConnect",d,e),d.statusCode===200){if(e.once("socket",Fxo),r.secureEndpoint){j1e("Upgrading socket connection to TLS");let m=r.servername||r.host;return Nin.connect({...Min(r,"host","path","port"),socket:o,servername:m})}return o}o.destroy();let h=new lBt.Socket({writable:!1});return h.readable=!0,e.once("socket",m=>{j1e("Replaying proxy buffer for failed request"),(0,Nxo.default)(m.listenerCount("data")>0),m.push(f),m.push(null)}),h}};Kje.protocols=["http","https"];lx.HttpsProxyAgent=Kje;function Fxo(t){t.resume()}a(Fxo,"resume");function Min(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Min,"omit")});var dBt=I(ux=>{"use strict";p();var Uxo=ux&&ux.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qxo=ux&&ux.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fin=ux&&ux.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Uxo(e,t,r);return Qxo(e,t),e},qxo=ux&&ux.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ux,"__esModule",{value:!0});ux.HttpProxyAgent=void 0;var jxo=Fin(require("net")),Hxo=Fin(require("tls")),Gxo=qxo(GP()),$xo=require("events"),Vxo=cBt(),Lin=require("url"),Oae=(0,Gxo.default)("http-proxy-agent"),Jje=class extends Vxo.Agent{static{a(this,"HttpProxyAgent")}constructor(e,r){super(r),this.proxy=typeof e=="string"?new Lin.URL(e):e,this.proxyHeaders=r?.headers??{},Oae("Creating new HttpProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={...r?Wxo(r,"headers"):null,host:n,port:o}}addRequest(e,r){e._header=null,this.setRequestProps(e,r),super.addRequest(e,r)}setRequestProps(e,r){let{proxy:n}=this,o=r.secureEndpoint?"https:":"http:",s=e.getHeader("host")||"localhost",c=`${o}//${s}`,l=new Lin.URL(e.path,c);r.port!==80&&(l.port=String(r.port)),e.path=String(l);let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders};if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(u)){let f=u[d];f&&e.setHeader(d,f)}}async connect(e,r){e._header=null,e.path.includes("://")||this.setRequestProps(e,r);let n,o;Oae("Regenerating stored HTTP header string for request"),e._implicitHeader(),e.outputData&&e.outputData.length>0&&(Oae("Patching connection write() output buffer with updated header"),n=e.outputData[0].data,o=n.indexOf(`\r \r -`)+4,e.outputData[0].data=e._header+n.substring(o),Gae("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(Gae("Creating `tls.Socket`: %o",this.connectOpts),s=Kxo.connect(this.connectOpts)):(Gae("Creating `net.Socket`: %o",this.connectOpts),s=Yxo.connect(this.connectOpts)),await(0,Zxo.once)(s,"connect"),s}};dHe.protocols=["http","https"];px.HttpProxyAgent=dHe;function ewo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(ewo,"omit")});var E7={};wi(E7,{__addDisposableResource:()=>Oon,__assign:()=>AHe,__asyncDelegator:()=>won,__asyncGenerator:()=>eSe,__asyncValues:()=>_He,__await:()=>dS,__awaiter:()=>von,__classPrivateFieldGet:()=>Don,__classPrivateFieldIn:()=>Mon,__classPrivateFieldSet:()=>Non,__createBinding:()=>EHe,__decorate:()=>mon,__disposeResources:()=>Bon,__esDecorate:()=>Aon,__exportStar:()=>Son,__extends:()=>pon,__generator:()=>bon,__importDefault:()=>Pon,__importStar:()=>kon,__makeTemplateObject:()=>Ron,__metadata:()=>Con,__param:()=>gon,__propKey:()=>Eon,__read:()=>RBt,__rest:()=>hon,__rewriteRelativeImportExtension:()=>Lon,__runInitializers:()=>yon,__setFunctionName:()=>_on,__spread:()=>Ton,__spreadArray:()=>xon,__spreadArrays:()=>Ion,__values:()=>yHe,default:()=>fwo});function pon(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");xBt(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function hon(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function gon(t,e){return function(r,n){e(r,n,t)}}function Aon(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function yon(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function RBt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function Ton(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof dS?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function won(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:dS(t[o](c)),done:!1}:s?s(c):c}:s}}function _He(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof yHe=="function"?yHe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function Ron(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function kon(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=wBt(t),n=0;n{p();xBt=a(function(t,e){return xBt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},xBt(t,e)},"extendStatics");a(pon,"__extends");AHe=a(function(){return AHe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(PHe,"__esModule",{value:!0});PHe.state=void 0;PHe.state={operationRequestMap:new WeakMap}});function pRo(){try{return rLt.default.statSync("/.dockerenv"),!0}catch{return!1}}function hRo(){try{return rLt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function nLt(){return tLt===void 0&&(tLt=pRo()||hRo()),tLt}var rLt,tLt,gsn=me(()=>{p();rLt=ce(require("node:fs"),1);a(pRo,"hasDockerEnv");a(hRo,"hasDockerCGroup");a(nLt,"isDocker")});function zae(){return iLt===void 0&&(iLt=mRo()||nLt()),iLt}var Asn,iLt,mRo,oLt=me(()=>{p();Asn=ce(require("node:fs"),1);gsn();mRo=a(()=>{try{return Asn.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(zae,"isInsideContainer")});var sLt,Esn,_sn,ysn,b7,aLt=me(()=>{p();sLt=ce(require("node:process"),1),Esn=ce(require("node:os"),1),_sn=ce(require("node:fs"),1);oLt();ysn=a(()=>{if(sLt.default.platform!=="linux")return!1;if(Esn.default.release().toLowerCase().includes("microsoft"))return!zae();try{return _sn.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!zae():!1}catch{return!1}},"isWsl"),b7=sLt.default.env.__IS_WSL_TEST__?ysn:ysn()});var cLt,sSe,gRo,ARo,lLt,Csn=me(()=>{p();cLt=ce(require("node:process"),1),sSe=ce(require("node:fs/promises"),1);aLt();aLt();gRo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await sSe.default.access(r,sSe.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await sSe.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),ARo=a(async()=>`${await gRo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),lLt=a(async()=>b7?ARo():`${cLt.default.env.SYSTEMROOT||cLt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function S7(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var vsn=me(()=>{p();a(S7,"defineLazyProperty")});async function uLt(){if(Ssn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await yRo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var bsn,Ssn,Tsn,yRo,Isn=me(()=>{p();bsn=require("node:util"),Ssn=ce(require("node:process"),1),Tsn=require("node:child_process"),yRo=(0,bsn.promisify)(Tsn.execFile);a(uLt,"defaultBrowserId")});async function Rsn(t,{humanReadableOutput:e=!0}={}){if(xsn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await ERo("osascript",["-e",t,r]);return n.trim()}var xsn,wsn,dLt,ERo,ksn=me(()=>{p();xsn=ce(require("node:process"),1),wsn=require("node:util"),dLt=require("node:child_process"),ERo=(0,wsn.promisify)(dLt.execFile);a(Rsn,"runAppleScript")});async function fLt(t){return Rsn(`tell application "Finder" to set app_path to application file id "${t}" as string -tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var Psn=me(()=>{p();ksn();a(fLt,"bundleName")});async function pLt(t=_Ro){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new NHe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=CRo[n];if(!o)throw new NHe(`Unknown browser ID: ${n}`);return o}var Dsn,Nsn,_Ro,CRo,NHe,Msn=me(()=>{p();Dsn=require("node:util"),Nsn=require("node:child_process"),_Ro=(0,Dsn.promisify)(Nsn.execFile),CRo={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},NHe=class extends Error{static{a(this,"UnknownBrowserError")}};a(pLt,"defaultBrowser")});async function hLt(){if(MHe.default.platform==="darwin"){let t=await uLt();return{name:await fLt(t),id:t}}if(MHe.default.platform==="linux"){let{stdout:t}=await vRo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:bRo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(MHe.default.platform==="win32")return pLt();throw new Error("Only macOS, Linux, and Windows are supported")}var Osn,MHe,Bsn,vRo,bRo,Lsn=me(()=>{p();Osn=require("node:util"),MHe=ce(require("node:process"),1),Bsn=require("node:child_process");Isn();Psn();Msn();vRo=(0,Osn.promisify)(Bsn.execFile),bRo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(hLt,"defaultBrowser")});var Gsn={};wi(Gsn,{apps:()=>T7,default:()=>cSe,openApp:()=>xRo});async function TRo(){let t=await lLt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=ALt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await SRo(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function qsn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Usn]:e}=t;if(!e)throw new Error(`${Usn} is not supported`);return e}function BHe({[Yae]:t},{wsl:e}){if(e&&b7)return qsn(e);if(!t)throw new Error(`${Yae} is not supported`);return qsn(t)}var gLt,ALt,yLt,jsn,Hsn,ELt,OHe,SRo,mLt,Fsn,Yae,Usn,Qsn,aSe,IRo,xRo,T7,cSe,LHe=me(()=>{p();gLt=ce(require("node:process"),1),ALt=require("node:buffer"),yLt=ce(require("node:path"),1),jsn=require("node:url"),Hsn=require("node:util"),ELt=ce(require("node:child_process"),1),OHe=ce(require("node:fs/promises"),1);Csn();vsn();Lsn();oLt();SRo=(0,Hsn.promisify)(ELt.default.execFile),mLt=yLt.default.dirname((0,jsn.fileURLToPath)(importMetaUrlShim)),Fsn=yLt.default.join(mLt,"xdg-open"),{platform:Yae,arch:Usn}=gLt.default;a(TRo,"getWindowsDefaultBrowserFromWsl");Qsn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),aSe=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return Qsn(t.app,l=>aSe({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return Qsn(e,l=>aSe({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=b7?await TRo():await hLt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),aSe({...t,app:{name:T7[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Yae==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Yae==="win32"||b7&&!zae()&&!e){n=await lLt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),b7||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=ALt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!mLt||mLt==="/",u=!1;try{await OHe.default.access(Fsn,OHe.constants.X_OK),u=!0}catch{}n=gLt.default.versions.electron??(Yae==="android"||l||!u)?"xdg-open":Fsn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Yae==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=ELt.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),IRo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return aSe({...e,target:t})},"open"),xRo=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return aSe({...e,app:{name:t,arguments:r}})},"openApp");a(qsn,"detectArchBinary");a(BHe,"detectPlatformBinary");T7={};S7(T7,"chrome",()=>BHe({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));S7(T7,"brave",()=>BHe({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));S7(T7,"firefox",()=>BHe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));S7(T7,"edge",()=>BHe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));S7(T7,"browser",()=>"browser");S7(T7,"browserPrivate",()=>"browserPrivate");cSe=IRo});var Ean=I(wM=>{"use strict";p();Object.defineProperty(wM,"__esModule",{value:!0});wM.bytePairEncode=wM.BinaryMap=wM.binaryMapKey=void 0;var nko=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");wM.binaryMapKey=nko;var OLt=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,wM.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,wM.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};wM.BinaryMap=OLt;var xM=new Int32Array(128),E_=new Int32Array(128);function iko(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;xM.length0&&(xM[E_[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(eGe,"__esModule",{value:!0});eGe.makeTextEncoder=void 0;var BLt=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},LLt=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new LLt:new BLt,"makeTextEncoder");eGe.makeTextEncoder=oko});var Can=I(tGe=>{"use strict";p();Object.defineProperty(tGe,"__esModule",{value:!0});tGe.LRUCache=void 0;var FLt=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new ULt(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};tGe.LRUCache=FLt;var ULt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var qLt=I(nGe=>{"use strict";p();Object.defineProperty(nGe,"__esModule",{value:!0});nGe.TikTokenizer=void 0;var rGe=Ean(),sko=_an(),ako=Can();function cko(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(cko,"loadTikTokenBpe");function lko(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(lko,"escapeRegExp");var QLt=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,sko.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new ako.LRUCache(o);let s=typeof e=="string"?cko(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new rGe.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>lko(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,rGe.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,rGe.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let E=0;E=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,rGe.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};nGe.TikTokenizer=QLt});var Pan=I(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.createTokenizer=Ph.createByEncoderName=Ph.createByModelName=Ph.getRegexByModel=Ph.getRegexByEncoder=Ph.getSpecialTokensByModel=Ph.getSpecialTokensByEncoder=Ph.MODEL_TO_ENCODING=void 0;var uko=qLt(),dko=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Ph.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var iGe="<|endoftext|>",van="<|fim_prefix|>",ban="<|fim_middle|>",San="<|fim_suffix|>",Tan="<|endofprompt|>",bSe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",Ian="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",fko=[`[^\r +`)+4,e.outputData[0].data=e._header+n.substring(o),Oae("Output buffer: %o",e.outputData[0].data));let s;return this.proxy.protocol==="https:"?(Oae("Creating `tls.Socket`: %o",this.connectOpts),s=Hxo.connect(this.connectOpts)):(Oae("Creating `net.Socket`: %o",this.connectOpts),s=jxo.connect(this.connectOpts)),await(0,$xo.once)(s,"connect"),s}};Jje.protocols=["http","https"];ux.HttpProxyAgent=Jje;function Wxo(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}a(Wxo,"omit")});var h7={};xi(h7,{__addDisposableResource:()=>pon,__assign:()=>nHe,__asyncDelegator:()=>son,__asyncGenerator:()=>H1e,__asyncValues:()=>sHe,__await:()=>iS,__awaiter:()=>eon,__classPrivateFieldGet:()=>uon,__classPrivateFieldIn:()=>fon,__classPrivateFieldSet:()=>don,__createBinding:()=>oHe,__decorate:()=>Win,__disposeResources:()=>hon,__esDecorate:()=>Yin,__exportStar:()=>ron,__extends:()=>$in,__generator:()=>ton,__importDefault:()=>lon,__importStar:()=>con,__makeTemplateObject:()=>aon,__metadata:()=>Xin,__param:()=>zin,__propKey:()=>Jin,__read:()=>ABt,__rest:()=>Vin,__rewriteRelativeImportExtension:()=>mon,__runInitializers:()=>Kin,__setFunctionName:()=>Zin,__spread:()=>non,__spreadArray:()=>oon,__spreadArrays:()=>ion,__values:()=>iHe,default:()=>owo});function $in(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");mBt(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Vin(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function zin(t,e){return function(r,n){e(r,n,t)}}function Yin(t,e,r,n,o,s){function c(_){if(_!==void 0&&typeof _!="function")throw new TypeError("Function expected");return _}a(c,"accept");for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,f=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),h,m=!1,g=r.length-1;g>=0;g--){var A={};for(var y in n)A[y]=y==="access"?{}:n[y];for(var y in n.access)A.access[y]=n.access[y];A.addInitializer=function(_){if(m)throw new TypeError("Cannot add initializers after decoration has completed");s.push(c(_||null))};var E=(0,r[g])(l==="accessor"?{get:f.get,set:f.set}:f[u],A);if(l==="accessor"){if(E===void 0)continue;if(E===null||typeof E!="object")throw new TypeError("Object expected");(h=c(E.get))&&(f.get=h),(h=c(E.set))&&(f.set=h),(h=c(E.init))&&o.unshift(h)}else(h=c(E))&&(l==="field"?o.unshift(h):f[u]=h)}d&&Object.defineProperty(d,n.name,f),m=!0}function Kin(t,e,r){for(var n=arguments.length>2,o=0;o0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ABt(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}function non(){for(var t=[],e=0;e1||u(g,y)})},A&&(o[g]=A(o[g])))}function u(g,A){try{d(n[g](A))}catch(y){m(s[0][3],y)}}function d(g){g.value instanceof iS?Promise.resolve(g.value.v).then(f,h):m(s[0][2],g)}function f(g){u("next",g)}function h(g){u("throw",g)}function m(g,A){g(A),s.shift(),s.length&&u(s[0][0],s[0][1])}}function son(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,s){e[o]=t[o]?function(c){return(r=!r)?{value:iS(t[o](c)),done:!1}:s?s(c):c}:s}}function sHe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof iHe=="function"?iHe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(c){return new Promise(function(l,u){c=t[s](c),o(l,u,c.done,c.value)})}}function o(s,c,l,u){Promise.resolve(u).then(function(d){s({value:d,done:l})},c)}}function aon(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function con(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=gBt(t),n=0;n{p();mBt=a(function(t,e){return mBt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},mBt(t,e)},"extendStatics");a($in,"__extends");nHe=a(function(){return nHe=Object.assign||a(function(e){for(var r,n=1,o=arguments.length;n{"use strict";p();Object.defineProperty(AHe,"__esModule",{value:!0});AHe.state=void 0;AHe.state={operationRequestMap:new WeakMap}});function sRo(){try{return GBt.default.statSync("/.dockerenv"),!0}catch{return!1}}function aRo(){try{return GBt.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function $Bt(){return HBt===void 0&&(HBt=sRo()||aRo()),HBt}var GBt,HBt,zon=_e(()=>{p();GBt=fe(require("node:fs"),1);a(sRo,"hasDockerEnv");a(aRo,"hasDockerCGroup");a($Bt,"isDocker")});function Uae(){return VBt===void 0&&(VBt=cRo()||$Bt()),VBt}var Yon,VBt,cRo,WBt=_e(()=>{p();Yon=fe(require("node:fs"),1);zon();cRo=a(()=>{try{return Yon.default.statSync("/run/.containerenv"),!0}catch{return!1}},"hasContainerEnv");a(Uae,"isInsideContainer")});var zBt,Jon,Zon,Kon,y7,YBt=_e(()=>{p();zBt=fe(require("node:process"),1),Jon=fe(require("node:os"),1),Zon=fe(require("node:fs"),1);WBt();Kon=a(()=>{if(zBt.default.platform!=="linux")return!1;if(Jon.default.release().toLowerCase().includes("microsoft"))return!Uae();try{return Zon.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Uae():!1}catch{return!1}},"isWsl"),y7=zBt.default.env.__IS_WSL_TEST__?Kon:Kon()});var KBt,Y1e,lRo,uRo,JBt,Xon=_e(()=>{p();KBt=fe(require("node:process"),1),Y1e=fe(require("node:fs/promises"),1);YBt();YBt();lRo=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await Y1e.default.access(r,Y1e.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await Y1e.default.readFile(r,{encoding:"utf8"}),s=/(?.*)/g.exec(o);return s?(e=s.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),uRo=a(async()=>`${await lRo()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,"powerShellPathFromWsl"),JBt=a(async()=>y7?uRo():`${KBt.default.env.SYSTEMROOT||KBt.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,"powerShellPath")});function E7(t,e,r){let n=a(o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),"define");return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var esn=_e(()=>{p();a(E7,"defineLazyProperty")});async function ZBt(){if(rsn.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await dRo("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var tsn,rsn,nsn,dRo,isn=_e(()=>{p();tsn=require("node:util"),rsn=fe(require("node:process"),1),nsn=require("node:child_process"),dRo=(0,tsn.promisify)(nsn.execFile);a(ZBt,"defaultBrowserId")});async function asn(t,{humanReadableOutput:e=!0}={}){if(osn.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await fRo("osascript",["-e",t,r]);return n.trim()}var osn,ssn,XBt,fRo,csn=_e(()=>{p();osn=fe(require("node:process"),1),ssn=require("node:util"),XBt=require("node:child_process"),fRo=(0,ssn.promisify)(XBt.execFile);a(asn,"runAppleScript")});async function eLt(t){return asn(`tell application "Finder" to set app_path to application file id "${t}" as string +tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var lsn=_e(()=>{p();csn();a(eLt,"bundleName")});async function tLt(t=pRo){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?\S+)/.exec(e);if(!r)throw new EHe(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=hRo[n];if(!o)throw new EHe(`Unknown browser ID: ${n}`);return o}var usn,dsn,pRo,hRo,EHe,fsn=_e(()=>{p();usn=require("node:util"),dsn=require("node:child_process"),pRo=(0,usn.promisify)(dsn.execFile),hRo={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},EHe=class extends Error{static{a(this,"UnknownBrowserError")}};a(tLt,"defaultBrowser")});async function rLt(){if(_He.default.platform==="darwin"){let t=await ZBt();return{name:await eLt(t),id:t}}if(_He.default.platform==="linux"){let{stdout:t}=await mRo("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:gRo(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(_He.default.platform==="win32")return tLt();throw new Error("Only macOS, Linux, and Windows are supported")}var psn,_He,hsn,mRo,gRo,msn=_e(()=>{p();psn=require("node:util"),_He=fe(require("node:process"),1),hsn=require("node:child_process");isn();lsn();fsn();mRo=(0,psn.promisify)(hsn.execFile),gRo=a(t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase()),"titleize");a(rLt,"defaultBrowser")});var Csn={};xi(Csn,{apps:()=>_7,default:()=>J1e,openApp:()=>_Ro});async function yRo(){let t=await JBt(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=oLt.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await ARo(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),s={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return s[o]?{id:s[o]}:{}}function Esn(t){if(typeof t=="string"||Array.isArray(t))return t;let{[Asn]:e}=t;if(!e)throw new Error(`${Asn} is not supported`);return e}function CHe({[Qae]:t},{wsl:e}){if(e&&y7)return Esn(e);if(!t)throw new Error(`${Qae} is not supported`);return Esn(t)}var iLt,oLt,sLt,_sn,vsn,aLt,vHe,ARo,nLt,gsn,Qae,Asn,ysn,K1e,ERo,_Ro,_7,J1e,bHe=_e(()=>{p();iLt=fe(require("node:process"),1),oLt=require("node:buffer"),sLt=fe(require("node:path"),1),_sn=require("node:url"),vsn=require("node:util"),aLt=fe(require("node:child_process"),1),vHe=fe(require("node:fs/promises"),1);Xon();esn();msn();WBt();ARo=(0,vsn.promisify)(aLt.default.execFile),nLt=sLt.default.dirname((0,_sn.fileURLToPath)(importMetaUrlShim)),gsn=sLt.default.join(nLt,"xdg-open"),{platform:Qae,arch:Asn}=iLt.default;a(yRo,"getWindowsDefaultBrowserFromWsl");ysn=a(async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},"pTryEach"),K1e=a(async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return ysn(t.app,l=>K1e({...t,app:l}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return ysn(e,l=>K1e({...t,app:{name:l,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let l={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},d=y7?await yRo():await rLt();if(d.id in l){let f=l[d.id];return e==="browserPrivate"&&r.push(u[f]),K1e({...t,app:{name:_7[f],arguments:r}})}throw new Error(`${d.name} is not supported as a default browser`)}let n,o=[],s={};if(Qae==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Qae==="win32"||y7&&!Uae()&&!e){n=await JBt(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),y7||(s.windowsVerbatimArguments=!0);let l=["Start"];t.wait&&l.push("-Wait"),e?(l.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&l.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),l.push("-ArgumentList",r.join(","))),t.target=oLt.Buffer.from(l.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let l=!nLt||nLt==="/",u=!1;try{await vHe.default.access(gsn,vHe.constants.X_OK),u=!0}catch{}n=iLt.default.versions.electron??(Qae==="android"||l||!u)?"xdg-open":gsn}r.length>0&&o.push(...r),t.wait||(s.stdio="ignore",s.detached=!0)}Qae==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let c=aLt.default.spawn(n,o,s);return t.wait?new Promise((l,u)=>{c.once("error",u),c.once("close",d=>{if(!t.allowNonzeroExitCode&&d>0){u(new Error(`Exited with code ${d}`));return}l(c)})}):(c.unref(),c)},"baseOpen"),ERo=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return K1e({...e,target:t})},"open"),_Ro=a((t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return K1e({...e,app:{name:t,arguments:r}})},"openApp");a(Esn,"detectArchBinary");a(CHe,"detectPlatformBinary");_7={};E7(_7,"chrome",()=>CHe({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));E7(_7,"brave",()=>CHe({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));E7(_7,"firefox",()=>CHe({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));E7(_7,"edge",()=>CHe({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));E7(_7,"browser",()=>"browser");E7(_7,"browserPrivate",()=>"browserPrivate");J1e=ERo});var Zsn=I(CM=>{"use strict";p();Object.defineProperty(CM,"__esModule",{value:!0});CM.bytePairEncode=CM.BinaryMap=CM.binaryMapKey=void 0;var KRo=a((t,e,r)=>{let n=r-e,o=16777215>>>Math.max(0,(3-n)*8),s=(t[e+0]|t[e+1]<<8|t[e+2]<<16)&o,c=16777215>>>Math.min(31,Math.max(0,(6-n)*8)),l=(t[e+3]|t[e+4]<<8|t[e+5]<<16)&c;return s+16777216*l},"binaryMapKey");CM.binaryMapKey=KRo;var bLt=class t{static{a(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,r=0,n=e.length){let o=n<6+r,s=(0,CM.binaryMapKey)(e,r,n);return o?this.final.get(s):this.nested.get(s)?.get(e,6+r,n)}set(e,r){let n=(0,CM.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(n,r);return}let s=this.nested.get(n);if(s instanceof t)s.set(e.subarray(6),r);else{let c=new t;c.set(e.subarray(6),r),this.nested.set(n,c)}}};CM.BinaryMap=bLt;var vM=new Int32Array(128),g_=new Int32Array(128);function JRo(t,e,r){if(r===1)return[e.get(t)];let n=2147483647,o=-1;for(;vM.length0&&(vM[g_[o-1]]=c(o-1,1));for(let u=o+1;u{"use strict";p();Object.defineProperty(qHe,"__esModule",{value:!0});qHe.makeTextEncoder=void 0;var SLt=class{static{a(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let r=this.encoder.encode(e);return this.length=r.length,r}},TLt=class{static{a(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new TLt:new SLt,"makeTextEncoder");qHe.makeTextEncoder=ZRo});var ean=I(jHe=>{"use strict";p();Object.defineProperty(jHe,"__esModule",{value:!0});jHe.LRUCache=void 0;var ILt=class{static{a(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let r=this.nodes.get(e);if(r)return this.moveToHead(r),r.value}set(e,r){let n=this.nodes.get(e);if(n)n.value=r,this.moveToHead(n);else{let o=new xLt(e,r);this.nodes.set(e,o),this.addNode(o),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};jHe.LRUCache=ILt;var xLt=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.value=r}}});var RLt=I(GHe=>{"use strict";p();Object.defineProperty(GHe,"__esModule",{value:!0});GHe.TikTokenizer=void 0;var HHe=Zsn(),XRo=Xsn(),ePo=ean();function tPo(t){let e=new Map;try{let o=require("fs").readFileSync(t,"utf-8");return r(o),e}catch(n){throw new Error(`Failed to load from BPE encoder file stream: ${n}`)}function r(n){for(let o of n.split(/[\r\n]+/)){if(o.trim()==="")continue;let s=o.split(" ");if(s.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let c=new Uint8Array(Buffer.from(s[0],"base64")),l=parseInt(s[1]);if(!isNaN(l))e.set(c,l);else throw new Error(`Can't parse ${s[1]} to integer`)}}a(r,"processBpeRanks")}a(tPo,"loadTikTokenBpe");function rPo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(rPo,"escapeRegExp");var wLt=class{static{a(this,"TikTokenizer")}constructor(e,r,n,o=8192){this.textEncoder=(0,XRo.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new ePo.LRUCache(o);let s=typeof e=="string"?tPo(e):e;this.init(s,r,n)}init(e,r,n){this.encoder=new HHe.BinaryMap;for(let[o,s]of e)this.encoder.set(o,s);this.regex=new RegExp(n,"gu"),this.specialTokensRegex=new RegExp(Array.from(r.keys()).map(o=>rPo(o)).join("|")),this.specialTokensEncoder=r,this.decoder=new Map;for(let[o,s]of e)this.decoder.set(s,o);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[o,s]of r)this.specialTokensDecoder.set(s,o)}findNextSpecialToken(e,r,n){let o=r,s=null;if(n&&this.specialTokensRegex)for(;s=e.slice(o).match(this.specialTokensRegex),!(!s||n&&n.includes(s[0]));)o+=s.index+1;let c=s?o+s.index:e.length;return[s,c]}encode(e,r){let n=[],o=0;for(;;){let s,c;if([s,c]=this.findNextSpecialToken(e,o,r),c>o&&this.encodeByIndex(e,n,o,c),s){if(o=o+this.encodeSpecialToken(n,s),o>=e.length)break}else break}return n}encodeSpecialToken(e,r){let n=this.specialTokensEncoder?.get(r[0]);return e.push(n),r.index+r[0].length}encodeByIndex(e,r,n,o){let s,c=e.substring(n,o);for(this.regex.lastIndex=0;s=this.regex.exec(c);){let l=this.cache.get(s[0]);if(l)for(let u of l)r.push(u);else{let u=this.textEncoder.encode(s[0]),d=this.encoder.get(u,0,this.textEncoder.length);if(d!==void 0)r.push(d),this.cache.set(s[0],[d]);else{let f=(0,HHe.bytePairEncode)(u,this.encoder,this.textEncoder.length);for(let h of f)r.push(h);this.cache.set(s[0],f)}}}}encodeTrimSuffixByIndex(e,r,n,o,s,c,l){let u,d=e.substring(n,o);for(this.regex.lastIndex=0;u=this.regex.exec(d);){let f=u[0],h=this.cache.get(f);if(h)if(c+h.length<=s)c+=h.length,l+=f.length,r.push(...h);else{let m=s-c;c+=m,l+=f.length,r.push(...h.slice(0,m));break}else{let m=this.textEncoder.encode(f),g=this.encoder.get(m,0,m.length);if(g!==void 0)if(this.cache.set(f,[g]),c+1<=s)c++,l+=f.length,r.push(g);else break;else{let A=(0,HHe.bytePairEncode)(m,this.encoder,this.textEncoder.length);if(this.cache.set(f,A),c+A.length<=s){c+=A.length,l+=f.length;for(let y of A)r.push(y)}else{let y=s-c;c+=y,l+=f.length;for(let E=0;E=s)break}return{tokenCount:c,encodeLength:l}}encodeTrimSuffix(e,r,n){let o=[],s=0,c=0,l=0;for(;;){let d,f;if([d,f]=this.findNextSpecialToken(e,s,n),f>s){let{tokenCount:h,encodeLength:m}=this.encodeTrimSuffixByIndex(e,o,s,f,r,c,l);if(c=h,l=m,c>=r)break}if(d!==null){if(c++,c<=r&&(s=s+this.encodeSpecialToken(o,d),l+=d[0].length,s>=e.length)||c>=r)break}else break}let u=l===e.length?e:e.slice(0,l);return{tokenIds:o,text:u}}encodeTrimPrefix(e,r,n){let o=[],s=0,c=0,l=0,u=new Map;for(u.set(c,l);;){let m,g;if([m,g]=this.findNextSpecialToken(e,s,n),g>s){let A,y=e.substring(s,g);for(this.regex.lastIndex=0;A=this.regex.exec(y);){let E=A[0],_=this.cache.get(E);if(_)c+=_.length,l+=E.length,o.push(..._),u.set(c,l);else{let v=this.textEncoder.encode(E),b=this.encoder.get(v);if(b!==void 0)this.cache.set(E,[b]),c++,l+=E.length,o.push(b),u.set(c,l);else{let T=(0,HHe.bytePairEncode)(v,this.encoder,this.textEncoder.length);this.cache.set(E,T),c+=T.length,l+=E.length;for(let w of T)o.push(w);u.set(c,l)}}}}if(m!==null){if(s=s+this.encodeSpecialToken(o,m),c++,l+=m[0].length,u.set(c,l),s>=e.length)break}else break}if(c<=r)return{tokenIds:o,text:e};let d=c-r,f=0,h=0;for(let[m,g]of u)if(m>=d){f=m,h=g;break}if(f>r){let m=this.encode(e,n),g=m.slice(m.length-r);return{tokenIds:g,text:this.decode(g)}}return{tokenIds:o.slice(f),text:e.slice(h)}}decode(e){let r=[];for(let n of e){let o=[],s=this.decoder?.get(n);if(s!==void 0)o=Array.from(s);else{let c=this.specialTokensDecoder?.get(n);if(c!==void 0){let l=this.textEncoder.encode(c);o=Array.from(l.subarray(0,this.textEncoder.length))}}r.push(...o)}return this.textDecoder.decode(new Uint8Array(r))}};GHe.TikTokenizer=wLt});var uan=I(Nh=>{"use strict";p();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.createTokenizer=Nh.createByEncoderName=Nh.createByModelName=Nh.getRegexByModel=Nh.getRegexByEncoder=Nh.getSpecialTokensByModel=Nh.getSpecialTokensByEncoder=Nh.MODEL_TO_ENCODING=void 0;var nPo=RLt(),iPo=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Nh.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var $He="<|endoftext|>",tan="<|fim_prefix|>",ran="<|fim_middle|>",nan="<|fim_suffix|>",ian="<|endofprompt|>",uSe="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",oan="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",oPo=[`[^\r \\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,`[^\r -\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,"\\p{N}{1,3}"," ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*","\\s*[\\r\\n]+","\\s+(?!\\S)","\\s+"],xan=fko.join("|");function jLt(t){let e="";if(Ph.MODEL_TO_ENCODING.has(t))e=Ph.MODEL_TO_ENCODING.get(t);else for(let[r,n]of dko)if(t.startsWith(r)){e=n;break}return e}a(jLt,"getEncoderFromModelName");async function pko(t,e){let r=require("fs"),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file from ${t}. Status code: ${n.status}`);let o=await n.text();r.writeFileSync(e,o)}a(pko,"fetchAndSaveFile");function HLt(t){let e=new Map([[iGe,50256]]);switch(t){case"o200k_base":e=new Map([[iGe,199999],[Tan,200018]]);break;case"cl100k_base":e=new Map([[iGe,100257],[van,100258],[ban,100259],[San,100260],[Tan,100276]]);break;case"p50k_edit":e=new Map([[iGe,50256],[van,50281],[ban,50282],[San,50283]]);break;default:break}return e}a(HLt,"getSpecialTokensByEncoder");Ph.getSpecialTokensByEncoder=HLt;function hko(t){let e=jLt(t);return HLt(e)}a(hko,"getSpecialTokensByModel");Ph.getSpecialTokensByModel=hko;function wan(t){switch(t){case"o200k_base":return xan;case"cl100k_base":return Ian;default:break}return bSe}a(wan,"getRegexByEncoder");Ph.getRegexByEncoder=wan;function mko(t){let e=jLt(t);return wan(e)}a(mko,"getRegexByModel");Ph.getRegexByModel=mko;async function gko(t,e=null){return Ran(jLt(t),e)}a(gko,"createByModelName");Ph.createByModelName=gko;async function Ran(t,e=null){let r,n,o=HLt(t);switch(t){case"o200k_base":r=xan,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=Ian,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=bSe,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=bSe,n="https://raw.githubusercontent.com/microsoft/Tokenizer/main/model/gpt2.tiktoken";break;default:throw new Error(`Doesn't support this encoder [${t}]`)}e!==null&&(o=new Map([...o,...e]));let s=require("fs"),c=require("path"),l=c.basename(n),u=c.resolve(__dirname,"..","model");s.existsSync(u)||s.mkdirSync(u,{recursive:!0});let d=c.resolve(u,l);return s.existsSync(d)||(console.log(`Downloading file from ${n}`),await pko(n,d),console.log(`Saved file to ${d}`)),kan(d,o,r)}a(Ran,"createByEncoderName");Ph.createByEncoderName=Ran;function kan(t,e,r,n=8192){return new uko.TikTokenizer(t,e,r,n)}a(kan,"createTokenizer");Ph.createTokenizer=kan});var oGe=I(Dh=>{"use strict";p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.createTokenizer=Dh.createByEncoderName=Dh.createByModelName=Dh.getSpecialTokensByModel=Dh.getSpecialTokensByEncoder=Dh.getRegexByModel=Dh.getRegexByEncoder=Dh.MODEL_TO_ENCODING=Dh.TikTokenizer=void 0;var Ako=qLt();Object.defineProperty(Dh,"TikTokenizer",{enumerable:!0,get:a(function(){return Ako.TikTokenizer},"get")});var x7=Pan();Object.defineProperty(Dh,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return x7.MODEL_TO_ENCODING},"get")});Object.defineProperty(Dh,"getRegexByEncoder",{enumerable:!0,get:a(function(){return x7.getRegexByEncoder},"get")});Object.defineProperty(Dh,"getRegexByModel",{enumerable:!0,get:a(function(){return x7.getRegexByModel},"get")});Object.defineProperty(Dh,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return x7.getSpecialTokensByEncoder},"get")});Object.defineProperty(Dh,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return x7.getSpecialTokensByModel},"get")});Object.defineProperty(Dh,"createByModelName",{enumerable:!0,get:a(function(){return x7.createByModelName},"get")});Object.defineProperty(Dh,"createByEncoderName",{enumerable:!0,get:a(function(){return x7.createByEncoderName},"get")});Object.defineProperty(Dh,"createTokenizer",{enumerable:!0,get:a(function(){return x7.createTokenizer},"get")})});var ZLt=I((K_u,tcn)=>{"use strict";p();tcn.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var ncn=I((X_u,rcn)=>{"use strict";p();var z2o=ZLt();function Y2o(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=z2o(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(Y2o,"parsePath");rcn.exports=Y2o});var lcn=I((rCu,ccn)=>{"use strict";p();var K2o=ncn();function J2o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(J2o,"_interopDefaultLegacy");var Z2o=J2o(K2o);function X2o(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(X2o,"getAugmentedNamespace");var ocn={},eDo="text/plain",tDo="us-ascii",icn=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),rDo=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===tDo)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==eDo)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function nDo(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return rDo(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];icn(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])icn(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(nDo,"normalizeUrl");var iDo=Object.freeze({__proto__:null,default:nDo}),oDo=X2o(iDo);Object.defineProperty(ocn,"__esModule",{value:!0});var sDo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aDo=oDo,cDo=scn(aDo),lDo=Z2o.default,uDo=scn(lDo);function scn(t){return t&&t.__esModule?t:{default:t}}a(scn,"_interopRequireDefault");var acn=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":sDo(r))!=="object"&&(r={stripHash:!1}),e=(0,cDo.default)(e,r));var s=(0,uDo.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");acn.MAX_INPUT_LENGTH=2048;var dDo=ocn.default=acn;ccn.exports=dDo});var fcn=I((oCu,dcn)=>{"use strict";p();var fDo=ZLt();function ucn(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=fDo(t);if(t=t.substring(t.indexOf("://")+3),ucn(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var pDo=lcn(),pcn=fcn();function hDo(t){let e=pDo(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),pcn(e.protocols)||e.protocols.length===0&&pcn(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(hDo,"gitUp");hcn.exports=hDo});var Acn=I((dCu,gcn)=>{"use strict";p();var mDo=mcn();function XLt(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=mDo(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return XLt.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=yDo(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(XLt,"gitUrlParse");XLt.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?gDo(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+ADo(t)+o;default:return t.href}};function gDo(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(gDo,"buildToken");function ADo(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a(ADo,"buildPath");function yDo(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(yDo,"findLongestMatchingSubstring");gcn.exports=XLt});var ice=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var Q=0,M=1;;){var O=t[e++];if(Q+=(O&127)*M,M*=128,!(O&128))break}return Q}a(o,"getLEB");function s(){var Q=o();return e+=Q,UTF8ArrayToString(t,e-Q,Q)}a(s,"getString");function c(Q,M){if(Q)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,k=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":k=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,O=v[2].name;A[y].push(q=>{let F=[],U=[];for(let V of q)V.name===M&&F.push(V.node),V.name===O&&U.push(V.node);let W=a((V,G,Y)=>Y?V.text===G.text:V.text!==G.text,"compare");return D?F.every(V=>U.some(G=>W(V,G,k))):F.some(V=>U.some(G=>W(V,G,k)))})}else{N=v[1].name;let M=v[2].value,O=a(F=>F.text===M,"matches"),q=a(F=>F.text!==M,"doesNotMatch");A[y].push(F=>{let U=[];for(let V of F)V.name===N&&U.push(V.node);let W=k?O:q;return D?U.every(W):U.some(W)})}break;case"any-not-match?":case"not-match?":k=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let L=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let F of M)F.name===N&&O.push(F.node.text);let q=a((F,U)=>U?L.test(F):!L.test(F),"test");return O.length===0?!k:D?O.every(F=>q(F,k)):O.some(F=>q(F,k))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let B=x==="is?"?h:m;B[y]||(B[y]={}),B[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":k=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let O=[];for(let q of M)q.name===N&&O.push(q.node.text);return O.length===0?!k:O.every(q=>Q.includes(q))===k});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. +\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,"\\p{N}{1,3}"," ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*","\\s*[\\r\\n]+","\\s+(?!\\S)","\\s+"],san=oPo.join("|");function PLt(t){let e="";if(Nh.MODEL_TO_ENCODING.has(t))e=Nh.MODEL_TO_ENCODING.get(t);else for(let[r,n]of iPo)if(t.startsWith(r)){e=n;break}return e}a(PLt,"getEncoderFromModelName");async function sPo(t,e){let r=require("fs"),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file from ${t}. Status code: ${n.status}`);let o=await n.text();r.writeFileSync(e,o)}a(sPo,"fetchAndSaveFile");function kLt(t){let e=new Map([[$He,50256]]);switch(t){case"o200k_base":e=new Map([[$He,199999],[ian,200018]]);break;case"cl100k_base":e=new Map([[$He,100257],[tan,100258],[ran,100259],[nan,100260],[ian,100276]]);break;case"p50k_edit":e=new Map([[$He,50256],[tan,50281],[ran,50282],[nan,50283]]);break;default:break}return e}a(kLt,"getSpecialTokensByEncoder");Nh.getSpecialTokensByEncoder=kLt;function aPo(t){let e=PLt(t);return kLt(e)}a(aPo,"getSpecialTokensByModel");Nh.getSpecialTokensByModel=aPo;function aan(t){switch(t){case"o200k_base":return san;case"cl100k_base":return oan;default:break}return uSe}a(aan,"getRegexByEncoder");Nh.getRegexByEncoder=aan;function cPo(t){let e=PLt(t);return aan(e)}a(cPo,"getRegexByModel");Nh.getRegexByModel=cPo;async function lPo(t,e=null){return can(PLt(t),e)}a(lPo,"createByModelName");Nh.createByModelName=lPo;async function can(t,e=null){let r,n,o=kLt(t);switch(t){case"o200k_base":r=san,n="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":r=oan,n="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":r=uSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":r=uSe,n="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":r=uSe,n="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":r=uSe,n="https://raw.githubusercontent.com/microsoft/Tokenizer/main/model/gpt2.tiktoken";break;default:throw new Error(`Doesn't support this encoder [${t}]`)}e!==null&&(o=new Map([...o,...e]));let s=require("fs"),c=require("path"),l=c.basename(n),u=c.resolve(__dirname,"..","model");s.existsSync(u)||s.mkdirSync(u,{recursive:!0});let d=c.resolve(u,l);return s.existsSync(d)||(console.log(`Downloading file from ${n}`),await sPo(n,d),console.log(`Saved file to ${d}`)),lan(d,o,r)}a(can,"createByEncoderName");Nh.createByEncoderName=can;function lan(t,e,r,n=8192){return new nPo.TikTokenizer(t,e,r,n)}a(lan,"createTokenizer");Nh.createTokenizer=lan});var VHe=I(Mh=>{"use strict";p();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.createTokenizer=Mh.createByEncoderName=Mh.createByModelName=Mh.getSpecialTokensByModel=Mh.getSpecialTokensByEncoder=Mh.getRegexByModel=Mh.getRegexByEncoder=Mh.MODEL_TO_ENCODING=Mh.TikTokenizer=void 0;var uPo=RLt();Object.defineProperty(Mh,"TikTokenizer",{enumerable:!0,get:a(function(){return uPo.TikTokenizer},"get")});var C7=uan();Object.defineProperty(Mh,"MODEL_TO_ENCODING",{enumerable:!0,get:a(function(){return C7.MODEL_TO_ENCODING},"get")});Object.defineProperty(Mh,"getRegexByEncoder",{enumerable:!0,get:a(function(){return C7.getRegexByEncoder},"get")});Object.defineProperty(Mh,"getRegexByModel",{enumerable:!0,get:a(function(){return C7.getRegexByModel},"get")});Object.defineProperty(Mh,"getSpecialTokensByEncoder",{enumerable:!0,get:a(function(){return C7.getSpecialTokensByEncoder},"get")});Object.defineProperty(Mh,"getSpecialTokensByModel",{enumerable:!0,get:a(function(){return C7.getSpecialTokensByModel},"get")});Object.defineProperty(Mh,"createByModelName",{enumerable:!0,get:a(function(){return C7.createByModelName},"get")});Object.defineProperty(Mh,"createByEncoderName",{enumerable:!0,get:a(function(){return C7.createByEncoderName},"get")});Object.defineProperty(Mh,"createTokenizer",{enumerable:!0,get:a(function(){return C7.createTokenizer},"get")})});var qLt=I((Hyu,Lan)=>{"use strict";p();Lan.exports=a(function(e,r){r===!0&&(r=0);var n="";if(typeof e=="string")try{n=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(n=e.protocol);var o=n.split(/\:|\+/).filter(Boolean);return typeof r=="number"?o[r]:o},"protocols")});var Uan=I((Vyu,Fan)=>{"use strict";p();var H2o=qLt();function G2o(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=H2o(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}a(G2o,"parsePath");Fan.exports=G2o});var $an=I((Yyu,Gan)=>{"use strict";p();var $2o=Uan();function V2o(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}a(V2o,"_interopDefaultLegacy");var W2o=V2o($2o);function z2o(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=a(function n(){if(this instanceof n){var o=[null];o.push.apply(o,arguments);var s=Function.bind.apply(e,o);return new s}return e.apply(this,arguments)},"a");r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:a(function(){return t[n]},"get")})}),r}a(z2o,"getAugmentedNamespace");var qan={},Y2o="text/plain",K2o="us-ascii",Qan=a((t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),"testParameter"),J2o=a((t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:o,hash:s}=r.groups,c=n.split(";");s=e?"":s;let l=!1;c[c.length-1]==="base64"&&(c.pop(),l=!0);let u=(c.shift()||"").toLowerCase(),f=[...c.map(h=>{let[m,g=""]=h.split("=").map(A=>A.trim());return m==="charset"&&(g=g.toLowerCase(),g===K2o)?"":`${m}${g?`=${g}`:""}`}).filter(Boolean)];return l&&f.push("base64"),(f.length>0||u&&u!==Y2o)&&f.unshift(u),`data:${f.join(";")},${l?o.trim():o}${s?`#${s}`:""}`},"normalizeDataURL");function Z2o(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return J2o(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let o=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&o.protocol==="https:"&&(o.protocol="http:"),e.forceHttps&&o.protocol==="http:"&&(o.protocol="https:"),e.stripAuthentication&&(o.username="",o.password=""),e.stripHash?o.hash="":e.stripTextFragment&&(o.hash=o.hash.replace(/#?:~:text.*?$/i,"")),o.pathname){let c=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,u="";for(;;){let f=c.exec(o.pathname);if(!f)break;let h=f[0],m=f.index,g=o.pathname.slice(l,m);u+=g.replace(/\/{2,}/g,"/"),u+=h,l=m+h.length}let d=o.pathname.slice(l,o.pathname.length);u+=d.replace(/\/{2,}/g,"/"),o.pathname=u}if(o.pathname)try{o.pathname=decodeURI(o.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let c=o.pathname.split("/"),l=c[c.length-1];Qan(l,e.removeDirectoryIndex)&&(c=c.slice(0,-1),o.pathname=c.slice(1).join("/")+"/")}if(o.hostname&&(o.hostname=o.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(o.hostname)&&(o.hostname=o.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let c of[...o.searchParams.keys()])Qan(c,e.removeQueryParameters)&&o.searchParams.delete(c);if(e.removeQueryParameters===!0&&(o.search=""),e.sortQueryParameters){o.searchParams.sort();try{o.search=decodeURIComponent(o.search)}catch{}}e.removeTrailingSlash&&(o.pathname=o.pathname.replace(/\/$/,""));let s=t;return t=o.toString(),!e.removeSingleSlash&&o.pathname==="/"&&!s.endsWith("/")&&o.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}a(Z2o,"normalizeUrl");var X2o=Object.freeze({__proto__:null,default:Z2o}),eDo=z2o(X2o);Object.defineProperty(qan,"__esModule",{value:!0});var tDo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rDo=eDo,nDo=jan(rDo),iDo=W2o.default,oDo=jan(iDo);function jan(t){return t&&t.__esModule?t:{default:t}}a(jan,"_interopRequireDefault");var Han=a(function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=/^(?:([a-zA-Z_][a-zA-Z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:](([\~,\.\w,\-,\_,\/,\s]|%[0-9A-Fa-f]{2})+?(?:\.git|\/)?)$/,o=a(function(u){var d=new Error(u);throw d.subject_url=e,d},"throwErr");(typeof e!="string"||!e.trim())&&o("Invalid url."),e.length>t.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),r&&((typeof r>"u"?"undefined":tDo(r))!=="object"&&(r={stripHash:!1}),e=(0,nDo.default)(e,r));var s=(0,oDo.default)(e);if(s.parse_failed){var c=s.href.match(n);c?(s.protocols=["ssh"],s.protocol="ssh",s.resource=c[2],s.host=c[2],s.user=c[1],s.pathname="/"+c[3],s.parse_failed=!1):o("URL parsing failed.")}return s},"parseUrl");Han.MAX_INPUT_LENGTH=2048;var sDo=qan.default=Han;Gan.exports=sDo});var zan=I((Zyu,Wan)=>{"use strict";p();var aDo=qLt();function Van(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=aDo(t);if(t=t.substring(t.indexOf("://")+3),Van(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";p();var cDo=$an(),Yan=zan();function lDo(t){let e=cDo(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),Yan(e.protocols)||e.protocols.length===0&&Yan(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}a(lDo,"gitUp");Kan.exports=lDo});var Xan=I((iEu,Zan)=>{"use strict";p();var uDo=Jan();function jLt(t,e){if(e=e||[],typeof t!="string")throw new Error("The url must be a string.");if(!e.every(function(v){return typeof v=="string"}))throw new Error("The refs should contain only strings");var r=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;r.test(t)&&(t="https://github.com/"+t);var n=uDo(t),o=n.resource.split("."),s=null;switch(n.toString=function(v){return jLt.stringify(this,v)},n.source=o.length>2?o.slice(1-o.length).join("."):n.source=n.resource,n.git_suffix=/\.git$/.test(n.pathname),n.name=decodeURIComponent((n.pathname||n.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),n.owner=decodeURIComponent(n.user),n.source){case"git.cloudforge.com":n.owner=n.user,n.organization=o[0],n.source="cloudforge.com";break;case"visualstudio.com":if(n.resource==="vs-ssh.visualstudio.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3],n.full_name=s[2]+"/"+s[3]);break}else{s=n.name.split("/"),s.length===2?(n.owner=s[1],n.name=s[1],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name);break}case"dev.azure.com":case"azure.com":if(n.resource==="ssh.dev.azure.com"){s=n.name.split("/"),s.length===4&&(n.organization=s[1],n.owner=s[2],n.name=s[3]);break}else{s=n.name.split("/"),s.length===5?(n.organization=s[0],n.owner=s[1],n.name=s[4],n.full_name="_git/"+n.name):s.length===3?(n.name=s[2],s[0]==="DefaultCollection"?(n.owner=s[2],n.organization=s[0],n.full_name=n.organization+"/_git/"+n.name):(n.owner=s[0],n.full_name=n.owner+"/_git/"+n.name)):s.length===4&&(n.organization=s[0],n.owner=s[1],n.name=s[3],n.full_name=n.organization+"/"+n.owner+"/_git/"+n.name),n.query&&n.query.path&&(n.filepath=n.query.path.replace(/^\/+/g,"")),n.query&&n.query.version&&(n.ref=n.query.version.replace(/^GB/,""));break}default:s=n.name.split("/");var c=s.length-1;if(s.length>=2){var l=s.indexOf("-",2),u=s.indexOf("blob",2),d=s.indexOf("tree",2),f=s.indexOf("commit",2),h=s.indexOf("issues",2),m=s.indexOf("src",2),g=s.indexOf("raw",2),A=s.indexOf("edit",2);c=l>0?l-1:u>0&&d>0?Math.min(u-1,d-1):u>0?u-1:h>0?h-1:d>0?d-1:f>0?f-1:m>0?m-1:g>0?g-1:A>0?A-1:c,n.owner=s.slice(0,c).join("/"),n.name=s[c],f&&h<0&&(n.commit=s[c+2])}n.ref="",n.filepathtype="",n.filepath="";var y=s.length>c&&s[c+1]==="-"?c+1:c;s.length>y+2&&["raw","src","blob","tree","edit"].indexOf(s[y+1])>=0&&(n.filepathtype=s[y+1],n.ref=s[y+2],s.length>y+3&&(n.filepath=s.slice(y+3).join("/"))),n.organization=n.owner;break}n.full_name||(n.full_name=n.owner,n.name&&(n.full_name&&(n.full_name+="/"),n.full_name+=n.name)),n.owner.startsWith("scm/")&&(n.source="bitbucket-server",n.owner=n.owner.replace("scm/",""),n.organization=n.owner,n.full_name=n.owner+"/"+n.name);var E=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,_=E.exec(n.pathname);return _!=null&&(n.source="bitbucket-server",_[1]==="users"?n.owner="~"+_[2]:n.owner=_[2],n.organization=n.owner,n.name=_[3],s=_[4].split("/"),s.length>1&&(["raw","browse"].indexOf(s[1])>=0?(n.filepathtype=s[1],s.length>2&&(n.filepath=s.slice(2).join("/"))):s[1]==="commits"&&s.length>2&&(n.commit=s[2])),n.full_name=n.owner+"/"+n.name,n.query.at?n.ref=n.query.at:n.ref=""),e.length!==0&&n.ref&&(n.ref=pDo(n.href,e)||n.ref,n.filepath=n.href.split(n.ref+"/")[1]),n}a(jLt,"gitUrlParse");jLt.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",n=t.user||"git",o=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+n+"@"+t.resource+r+"/"+t.full_name+o:n+"@"+t.resource+":"+t.full_name+o;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+n+"@"+t.resource+r+"/"+t.full_name+o;case"http":case"https":var s=t.token?dDo(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+s+t.resource+r+"/"+fDo(t)+o;default:return t.href}};function dDo(t){return t.source==="bitbucket.org"?"x-token-auth:"+t.token+"@":t.token+"@"}a(dDo,"buildToken");function fDo(t){if(t.source==="bitbucket-server")return"scm/"+t.full_name;var e=t.full_name.split("/").map(function(r){return encodeURIComponent(r)}).join("/");return e}a(fDo,"buildPath");function pDo(t,e){var r="";return e.forEach(function(n){t.includes(n)&&n.length>r.length&&(r=n)}),r}a(pDo,"findLongestMatchingSubstring");Zan.exports=jLt});var Yae=I((exports,module)=>{p();var Module=typeof Module<"u"?Module:{},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",TreeSitter=(function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{static{a(this,"Parser")}constructor(){this.initialize()}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=a((t,e)=>{throw e},"quit_"),scriptDirectory="";function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs"),nodePath=require("path");scriptDirectory=__dirname+"/",readBinary=a(t=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t);var e=fs.readFileSync(t);return e},"readBinary"),readAsync=a((t,e=!0)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),new Promise((r,n)=>{fs.readFile(t,e?void 0:"utf8",(o,s)=>{o?n(o):r(e?s.buffer:s)})})),"readAsync"),!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=a((t,e)=>{throw process.exitCode=t,e},"quit_")}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:typeof document<"u"&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory.startsWith("blob:")?scriptDirectory="":scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1),ENVIRONMENT_IS_WORKER&&(readBinary=a(t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},"readBinary")),readAsync=a(t=>isFileURI(t)?new Promise((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{(n.status==200||n.status==0&&n.response)&&r(n.response),e(n.status)},n.onerror=e,n.send(null)}):fetch(t,{credentials:"same-origin"}).then(e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url))),"readAsync"));var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var t=wasmMemory.buffer;Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(t),Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=HEAPU16=new Uint16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t)}if(a(updateMemoryViews,"updateMemoryViews"),Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:2147483648/65536})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}a(initRuntime,"initRuntime");function preMain(){callRuntimeCallbacks(__ATMAIN__)}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}a(postRun,"postRun");function addOnPreRun(t){__ATPRERUN__.unshift(t)}a(addOnPreRun,"addOnPreRun");function addOnInit(t){__ATINIT__.unshift(t)}a(addOnInit,"addOnInit");function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}a(addOnPostRun,"addOnPostRun");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}a(getUniqueRunDependency,"getUniqueRunDependency");function addRunDependency(t){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}a(addRunDependency,"addRunDependency");function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}a(removeRunDependency,"removeRunDependency");function abort(t){Module.onAbort?.(t),t="Aborted("+t+")",err(t),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw e}a(abort,"abort");var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=a(t=>t.startsWith(dataURIPrefix),"isDataURI"),isFileURI=a(t=>t.startsWith("file://"),"isFileURI");function findWasmBinary(){var t="tree-sitter.wasm";return isDataURI(t)?t:locateFile(t)}a(findWasmBinary,"findWasmBinary");var wasmBinaryFile;function getBinarySync(t){if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");function getBinaryPromise(t){return wasmBinary?Promise.resolve().then(()=>getBinarySync(t)):readAsync(t).then(e=>new Uint8Array(e),()=>getBinarySync(t))}a(getBinaryPromise,"getBinaryPromise");function instantiateArrayBuffer(t,e,r){return getBinaryPromise(t).then(n=>WebAssembly.instantiate(n,e)).then(r,n=>{err(`failed to asynchronously prepare wasm: ${n}`),abort(n)})}a(instantiateArrayBuffer,"instantiateArrayBuffer");function instantiateAsync(t,e,r,n){return!t&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(e)&&!isFileURI(e)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"?fetch(e,{credentials:"same-origin"}).then(o=>{var s=WebAssembly.instantiateStreaming(o,r);return s.then(n,function(c){return err(`wasm streaming compile failed: ${c}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(e,r,n)})}):instantiateArrayBuffer(e,r,n)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");function createWasm(){var t=getWasmImports();function e(n,o){wasmExports=n.exports,wasmExports=relocateExports(wasmExports,1024);var s=getDylinkMetadata(o);return s.neededDynlibs&&(dynamicLibraries=s.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}a(e,"receiveInstance"),addRunDependency("wasm-instantiate");function r(n){e(n.instance,n.module)}if(a(r,"receiveInstantiationResult"),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(n){return err(`Module.instantiateWasm callback failed with error: ${n}`),!1}return wasmBinaryFile||(wasmBinaryFile=findWasmBinary()),instantiateAsync(wasmBinary,wasmBinaryFile,t,r),{}}a(createWasm,"createWasm");var ASM_CONSTS={};function ExitStatus(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}a(ExitStatus,"ExitStatus");var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(e)||(r.required=!0),r}},LE_HEAP_LOAD_F32=a(t=>HEAP_DATA_VIEW.getFloat32(t,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(t=>HEAP_DATA_VIEW.getFloat64(t,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(t=>HEAP_DATA_VIEW.getInt16(t,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(t=>HEAP_DATA_VIEW.getInt32(t,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_U32=a(t=>HEAP_DATA_VIEW.getUint32(t,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((t,e)=>HEAP_DATA_VIEW.setFloat32(t,e,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((t,e)=>HEAP_DATA_VIEW.setFloat64(t,e,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((t,e)=>HEAP_DATA_VIEW.setInt16(t,e,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((t,e)=>HEAP_DATA_VIEW.setInt32(t,e,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_U32=a((t,e)=>HEAP_DATA_VIEW.setUint32(t,e,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(t=>{for(;t.length>0;)t.shift()(Module)},"callRuntimeCallbacks"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=a((t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,o));for(var s="";e>10,56320|d&1023)}}return s},"UTF8ArrayToString"),getDylinkMetadata=a(t=>{var e=0,r=0;function n(){return t[e++]}a(n,"getU8");function o(){for(var j=0,M=1;;){var O=t[e++];if(j+=(O&127)*M,M*=128,!(O&128))break}return j}a(o,"getLEB");function s(){var j=o();return e+=j,UTF8ArrayToString(t,e-j,j)}a(s,"getString");function c(j,M){if(j)throw new Error(M)}a(c,"failIf");var l="dylink.0";if(t instanceof WebAssembly.Module){var u=WebAssembly.Module.customSections(t,l);u.length===0&&(l="dylink",u=WebAssembly.Module.customSections(t,l)),c(u.length===0,"need dylink section"),t=new Uint8Array(u[0]),r=t.length}else{var d=new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer),f=d[0]==1836278016||d[0]==6386541;c(!f,"need to see wasm magic number"),c(t[8]!==0,"need the dylink section to be first"),e=9;var h=o();r=e+h,l=s()}var m={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(l=="dylink"){m.memorySize=o(),m.memoryAlign=o(),m.tableSize=o(),m.tableAlign=o();for(var g=o(),A=0;A>1)*2);case"i32":return LE_HEAP_LOAD_I32((t>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((t>>2)*4);case"double":return LE_HEAP_LOAD_F64((t>>3)*8);case"*":return LE_HEAP_LOAD_U32((t>>2)*4);default:abort(`invalid type for getValue: ${e}`)}}a(getValue,"getValue");var newDSO=a((t,e,r)=>{var n={refcount:1/0,name:t,exports:r,global:!0};return LDSO.loadedLibsByName[t]=n,e!=null&&(LDSO.loadedLibsByHandle[e]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=a((t,e)=>(HEAPU8.fill(0,t,t+e),t),"zeroMemory"),alignMemory=a((t,e)=>Math.ceil(t/e)*e,"alignMemory"),getMemory=a(t=>{if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+alignMemory(t,16);return ___heap_base=r,GOT.__heap_base.value=r,e},"getMemory"),isInternalSym=a(t=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(t)||t.startsWith("__em_js__"),"isInternalSym"),uleb128Encode=a((t,e)=>{t<128?e.push(t):e.push(t%128|128,t>>7)},"uleb128Encode"),sigToWasmTypes=a(t=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n{var r=t.slice(0,1),n=t.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),uleb128Encode(n.length,e);for(var s=0;s{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(e),t);var r=[1];generateFuncType(e,r);var n=[0,97,115,109,1,0,0,0,1];uleb128Encode(r.length,n),n.push(...r),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n)),s=new WebAssembly.Instance(o,{e:{f:t}}),c=s.exports.f;return c},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=a(t=>{var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e},"getWasmTableEntry"),updateTableMap=a((t,e)=>{if(functionsInTableMap)for(var r=t;r(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(t)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(t){throw t instanceof RangeError?"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.":t}return wasmTable.length-1},"getEmptyTableSlot"),setWasmTableEntry=a((t,e)=>{wasmTable.set(t,e),wasmTableMirror[t]=wasmTable.get(t)},"setWasmTableEntry"),addFunction=a((t,e)=>{var r=getFunctionAddress(t);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,t)}catch(s){if(!(s instanceof TypeError))throw s;var o=convertJsFunctionToWasm(t,e);setWasmTableEntry(n,o)}return functionsInTableMap.set(t,n),n},"addFunction"),updateGOT=a((t,e)=>{for(var r in t)if(!isInternalSym(r)){var n=t[r];r.startsWith("orig$")&&(r=r.split("$")[1],e=!0),GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(e||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((t,e,r)=>{var n={};for(var o in t){var s=t[o];typeof s=="object"&&(s=s.value),typeof s=="number"&&(s+=e),n[o]=s}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(t=>{var e=wasmImports[t];return!(!e||e.stub)},"isSymbolDefined"),dynCallLegacy=a((t,e,r)=>{t=t.replace(/p/g,"i");var n=Module["dynCall_"+t];return n(e,...r)},"dynCallLegacy"),dynCall=a((t,e,r=[])=>{if(t.includes("j"))return dynCallLegacy(t,e,r);var n=getWasmTableEntry(e)(...r);return n},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(t=>__emscripten_stack_restore(t),"stackRestore"),createInvokeFunction=a(t=>(e,...r)=>{var n=stackSave();try{return dynCall(t,e,r)}catch(o){if(stackRestore(n),o!==o+0)throw o;_setThrew(1,0)}},"createInvokeFunction"),resolveGlobalSymbol=a((t,e=!1)=>{var r;return e&&"orig$"+t in wasmImports&&(t="orig$"+t),isSymbolDefined(t)?r=wasmImports[t]:t.startsWith("invoke_")&&(r=wasmImports[t]=createInvokeFunction(t.split("_")[1])),{sym:r,name:t}},"resolveGlobalSymbol"),UTF8ToString=a((t,e)=>t?UTF8ArrayToString(HEAPU8,t,e):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize))}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t).sym;return!e&&localScope&&(e=localScope[t]),e||(e=moduleExports[t]),e}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in wasmImports&&!wasmImports[e].stub)return wasmImports[e];if(!(e in t)){var r;t[e]=(...n)=>(r||=resolveSymbol(e),r(...n))}return t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start ${body};`;moduleExports[name]=eval(func)}a(addEmJs,"addEmJs");for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then(t=>postInstantiation(t.module,t.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags.loadAsync?metadata.neededDynlibs.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(t=>loadDynamicLibrary(t,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((t,e)=>{for(var[r,n]of Object.entries(t)){let o=a(c=>{isSymbolDefined(c)||(wasmImports[c]=n)},"setImport");o(r);let s="__main_argc_argv";r=="main"&&o(s),r==s&&o("main"),r.startsWith("dynCall_")&&!Module.hasOwnProperty(r)&&(Module[r]=n)}},"mergeLibSymbols"),asyncLoad=a((t,e,r,n)=>{var o=n?"":`al ${t}`;readAsync(t).then(s=>{e(new Uint8Array(s)),o&&removeRunDependency(o)},s=>{if(r)r();else throw`Loading data file "${t}" failed.`}),o&&addRunDependency(o)},"asyncLoad");function loadDynamicLibrary(t,e={global:!0,nodelete:!0},r,n){var o=LDSO.loadedLibsByName[t];if(o)return e.global?o.global||(o.global=!0,mergeLibSymbols(o.exports,t)):r&&Object.assign(r,o.exports),e.nodelete&&o.refcount!==1/0&&(o.refcount=1/0),o.refcount++,n&&(LDSO.loadedLibsByHandle[n]=o),e.loadAsync?Promise.resolve(!0):!0;o=newDSO(t,n,"loading"),o.refcount=e.nodelete?1/0:1,o.global=e.global;function s(){if(n){var u=LE_HEAP_LOAD_U32((n+28>>2)*4),d=LE_HEAP_LOAD_U32((n+32>>2)*4);if(u&&d){var f=HEAP8.slice(u,u+d);return e.loadAsync?Promise.resolve(f):f}}var h=locateFile(t);if(e.loadAsync)return new Promise(function(m,g){asyncLoad(h,m,g)});if(!readBinary)throw new Error(`${h}: file not found, and synchronous loading of external files is not available`);return readBinary(h)}a(s,"loadLibData");function c(){return e.loadAsync?s().then(u=>loadWebAssemblyModule(u,e,t,r,n)):loadWebAssemblyModule(s(),e,t,r,n)}a(c,"getExports");function l(u){o.global?mergeLibSymbols(u,t):r&&Object.assign(r,u),o.exports=u}return a(l,"moduleLoaded"),e.loadAsync?c().then(u=>(l(u),!0)):(l(c()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[t,e]of Object.entries(GOT))if(e.value==0){var r=resolveGlobalSymbol(t,!0).sym;if(!r&&!e.required)continue;if(typeof r=="function")e.value=addFunction(r,r.sig);else if(typeof r=="number")e.value=r;else throw new Error(`bad export type for '${t}': ${typeof r}`)}},"reportUndefinedSymbols"),loadDylibs=a(()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((t,e)=>t.then(()=>loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},"loadDylibs"),noExitRuntime=Module.noExitRuntime||!0;function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[t]=e;break;case"i8":HEAP8[t]=e;break;case"i16":LE_HEAP_STORE_I16((t>>1)*2,e);break;case"i32":LE_HEAP_STORE_I32((t>>2)*4,e);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((t>>2)*4,e);break;case"double":LE_HEAP_STORE_F64((t>>3)*8,e);break;case"*":LE_HEAP_STORE_U32((t>>2)*4,e);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>{abort("")},"__abort_js");__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=a(()=>nowIsMonotonic,"__emscripten_get_now_is_monotonic");__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=a((t,e,r)=>HEAPU8.copyWithin(t,e,e+r),"__emscripten_memcpy_js");__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=a(()=>Date.now(),"_emscripten_date_now");_emscripten_date_now.sig="d";var _emscripten_get_now;_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now"),_emscripten_get_now.sig="d";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(t=>{var e=wasmMemory.buffer,r=(t-e.byteLength+65535)/65536;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(t=>{var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return!1;for(var n=a((u,d)=>u+(d-u%d)%d,"alignUp"),o=1;o<=4;o*=2){var s=e*(1+.2/o);s=Math.min(s,t+100663296);var c=Math.min(r,n(Math.max(t,s),65536)),l=growMemory(c);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";var _fd_close=a(t=>52,"_fd_close");_fd_close.sig="ii";var convertI32PairToI53Checked=a((t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+e*4294967296:NaN,"convertI32PairToI53Checked");function _fd_seek(t,e,r,n,o){var s=convertI32PairToI53Checked(e,r);return 70}a(_fd_seek,"_fd_seek"),_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=a((t,e)=>{var r=printCharBuffers[t];e===0||e===10?((t===1?out:err)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)},"printChar"),_fd_write=a((t,e,r,n)=>{for(var o=0,s=0;s>2)*4),l=LE_HEAP_LOAD_U32((e+4>>2)*4);e+=8;for(var u=0;u>2)*4,o),0},"_fd_write");_fd_write.sig="iippp";function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(t,e,r,n,o){let c=currentParseCallback(e,{row:r,column:n});typeof c=="string"?(setValue(o,c.length,"i32"),stringToUTF16(c,t,10240)):setValue(o,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");var runtimeKeepaliveCounter=0,keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(t=>{EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit?.(t),ABORT=!0),quit_(t,new ExitStatus(t))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((t,e)=>{EXITSTATUS=t,_proc_exit(t)},"exitJS"),handleException=a(t=>{if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t)},"handleException"),lengthBytesUTF8=a(t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},"lengthBytesUTF8"),stringToUTF8Array=a((t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,s=r+n-1,c=0;c=55296&&l<=57343){var u=t.charCodeAt(++c);l=65536+((l&1023)<<10)|u&1023}if(l<=127){if(r>=s)break;e[r++]=l}else if(l<=2047){if(r+1>=s)break;e[r++]=192|l>>6,e[r++]=128|l&63}else if(l<=65535){if(r+2>=s)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|l&63}else{if(r+3>=s)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|l&63}}return e[r]=0,r-o},"stringToUTF8Array"),stringToUTF8=a((t,e,r)=>stringToUTF8Array(t,HEAPU8,e,r),"stringToUTF8"),stackAlloc=a(t=>__emscripten_stack_alloc(t),"stackAlloc"),stringToUTF8OnStack=a(t=>{var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8(t,r,e),r},"stringToUTF8OnStack"),stringToUTF16=a((t,e,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=e,o=r>1)*2,c),e+=2}return LE_HEAP_STORE_I16((e>>1)*2,0),e-n},"stringToUTF16"),AsciiToString=a(t=>{for(var e="";;){var r=HEAPU8[t++];if(!r)return e;e+=String.fromCharCode(r)}},"AsciiToString"),wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=a(()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),"___wasm_call_ctors"),___wasm_apply_data_relocs=a(()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),"___wasm_apply_data_relocs"),_malloc=Module._malloc=t=>(_malloc=Module._malloc=wasmExports.malloc)(t),_calloc=Module._calloc=(t,e)=>(_calloc=Module._calloc=wasmExports.calloc)(t,e),_realloc=Module._realloc=(t,e)=>(_realloc=Module._realloc=wasmExports.realloc)(t,e),_free=Module._free=t=>(_free=Module._free=wasmExports.free)(t),_ts_language_symbol_count=Module._ts_language_symbol_count=t=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(t),_ts_language_state_count=Module._ts_language_state_count=t=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(t),_ts_language_version=Module._ts_language_version=t=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(t),_ts_language_field_count=Module._ts_language_field_count=t=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(t),_ts_language_next_state=Module._ts_language_next_state=(t,e,r)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(t,e,r),_ts_language_symbol_name=Module._ts_language_symbol_name=(t,e)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(t,e),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(t,e,r,n)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(t,e,r,n),_strncmp=Module._strncmp=(t,e,r)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(t,e,r),_ts_language_symbol_type=Module._ts_language_symbol_type=(t,e)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(t,e),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(t,e)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(t,e),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(t,e)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(t,e),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=t=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(t),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(t,e)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(t,e),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(t,e,r)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(t,e,r),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=t=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(t),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=t=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(t),_memset=Module._memset=(t,e,r)=>(_memset=Module._memset=wasmExports.memset)(t,e,r),_memcpy=Module._memcpy=(t,e,r)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(t,e,r),_ts_parser_delete=Module._ts_parser_delete=t=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(t),_ts_parser_reset=Module._ts_parser_reset=t=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(t),_ts_parser_set_language=Module._ts_parser_set_language=(t,e)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(t,e),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=t=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(t),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(t,e,r)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(t,e,r),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(t,e,r)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(t,e,r),_memmove=Module._memmove=(t,e,r)=>(_memmove=Module._memmove=wasmExports.memmove)(t,e,r),_memcmp=Module._memcmp=(t,e,r)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(t,e,r),_ts_query_new=Module._ts_query_new=(t,e,r,n,o)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(t,e,r,n,o),_ts_query_delete=Module._ts_query_delete=t=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(t),_iswspace=Module._iswspace=t=>(_iswspace=Module._iswspace=wasmExports.iswspace)(t),_iswalnum=Module._iswalnum=t=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(t),_ts_query_pattern_count=Module._ts_query_pattern_count=t=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(t),_ts_query_capture_count=Module._ts_query_capture_count=t=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(t),_ts_query_string_count=Module._ts_query_string_count=t=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(t),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(t,e,r)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(t,e,r),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(t,e,r)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(t,e,r),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(t,e,r)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(t,e,r),_ts_query_disable_capture=Module._ts_query_disable_capture=(t,e,r)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(t,e,r),_ts_tree_copy=Module._ts_tree_copy=t=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(t),_ts_tree_delete=Module._ts_tree_delete=t=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(t),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(t,e)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(t,e),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(t,e,r,n,o)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(t,e,r,n,o),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=t=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(t),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(t,e)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(t,e),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(t,e)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(t,e),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=t=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(t),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=t=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(t),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=t=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(t),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=t=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(t),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(t,e)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(t,e),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=t=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(t),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=t=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(t),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=t=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(t),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(t,e)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(t,e),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=t=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(t),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=t=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(t),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=t=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(t),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=t=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(t),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=t=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(t),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=t=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(t),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(t,e)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(t,e),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=t=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(t),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=t=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(t),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=t=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(t),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=t=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(t),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=t=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(t),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=t=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(t),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=t=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(t),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=t=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(t),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=t=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(t),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=t=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(t),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=t=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(t),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=t=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(t),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=t=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(t),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=t=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(t),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=t=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(t),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(t,e)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(t,e),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(t,e)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(t,e),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=t=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(t),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=t=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(t),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=t=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(t),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=t=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(t),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=t=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(t),_ts_node_child_wasm=Module._ts_node_child_wasm=(t,e)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(t,e),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(t,e)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(t,e),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(t,e)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(t,e),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=t=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(t),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=t=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(t),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=t=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(t),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=t=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(t),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=t=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(t),_ts_node_parent_wasm=Module._ts_node_parent_wasm=t=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(t),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=t=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(t),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=t=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(t),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=t=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(t),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=t=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(t),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=t=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(t),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=t=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(t),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=t=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(t),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=t=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(t),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=t=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(t),_ts_node_children_wasm=Module._ts_node_children_wasm=t=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(t),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=t=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(t),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(t,e,r,n,o,s,c)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(t,e,r,n,o,s,c),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=t=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(t),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=t=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(t),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=t=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(t),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=t=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(t),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=t=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(t),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=t=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(t),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=t=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(t),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=t=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(t),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(t,e,r,n,o,s,c,l,u,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(t,e,r,n,o,s,c,l,u,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(t,e,r,n,o,s,c,l,u,d),_iswalpha=Module._iswalpha=t=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(t),_iswblank=Module._iswblank=t=>(_iswblank=Module._iswblank=wasmExports.iswblank)(t),_iswdigit=Module._iswdigit=t=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(t),_iswlower=Module._iswlower=t=>(_iswlower=Module._iswlower=wasmExports.iswlower)(t),_iswupper=Module._iswupper=t=>(_iswupper=Module._iswupper=wasmExports.iswupper)(t),_iswxdigit=Module._iswxdigit=t=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(t),_memchr=Module._memchr=(t,e,r)=>(_memchr=Module._memchr=wasmExports.memchr)(t,e,r),_strlen=Module._strlen=t=>(_strlen=Module._strlen=wasmExports.strlen)(t),_strcmp=Module._strcmp=(t,e)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(t,e),_strncat=Module._strncat=(t,e,r)=>(_strncat=Module._strncat=wasmExports.strncat)(t,e,r),_strncpy=Module._strncpy=(t,e,r)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(t,e,r),_towlower=Module._towlower=t=>(_towlower=Module._towlower=wasmExports.towlower)(t),_towupper=Module._towupper=t=>(_towupper=Module._towupper=wasmExports.towupper)(t),_setThrew=a((t,e)=>(_setThrew=wasmExports.setThrew)(t,e),"_setThrew"),__emscripten_stack_restore=a(t=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(t),"__emscripten_stack_restore"),__emscripten_stack_alloc=a(t=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(t),"__emscripten_stack_alloc"),_emscripten_stack_get_current=a(()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),"_emscripten_stack_get_current"),dynCall_jiji=Module.dynCall_jiji=(t,e,r,n,o)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(t,e,r,n,o),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=t=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(t),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(t,e)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(t,e);Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=a(function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t)},"runCaller");function callMain(t=[]){var e=resolveGlobalSymbol("main").sym;if(e){t.unshift(thisProgram);var r=t.length,n=stackAlloc((r+1)*4),o=n;t.forEach(c=>{LE_HEAP_STORE_U32((o>>2)*4,stringToUTF8OnStack(c)),o+=4}),LE_HEAP_STORE_U32((o>>2)*4,0);try{var s=e(r,n);return exitJS(s,!0),s}catch(c){return handleException(c)}}}a(callMain,"callMain");function run(t=arguments_){if(runDependencies>0||(preRun(),runDependencies>0))return;function e(){calledRun||(calledRun=!0,Module.calledRun=!0,!ABORT&&(initRuntime(),preMain(),Module.onRuntimeInitialized?.(),shouldRunNow&&callMain(t),postRun()))}a(e,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}if(a(run,"run"),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static{a(this,"ParserImpl")}static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let r;if(!e)r=0,e=null;else if(e.constructor===Language){r=e[0];let n=C._ts_language_version(r);if(ne.slice(u),"currentParseCallback");else if(typeof e=="function")currentParseCallback=e;else throw new Error("Argument must be a string or a function");this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let o=0,s=0;if(n?.includedRanges){o=n.includedRanges.length,s=C._calloc(o,SIZE_OF_RANGE);let u=s;for(let d=0;d0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let o=r;for(let s=0;s0){let s=n;for(let c=0;c0){let n=r;for(let o=0;o0){let n=r;for(let o=0;o0){let f=u;for(let h=0;h0){if(v[0].type!=="string")throw new Error("Predicates must begin with a literal value");let x=v[0].value,P=!0,D=!0,N;switch(x){case"any-not-eq?":case"not-eq?":P=!1;case"any-eq?":case"eq?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}"`);if(D=!x.startsWith("any-"),v[2].type==="capture"){let M=v[1].name,O=v[2].name;A[y].push(q=>{let Q=[],U=[];for(let W of q)W.name===M&&Q.push(W.node),W.name===O&&U.push(W.node);let z=a((W,$,J)=>J?W.text===$.text:W.text!==$.text,"compare");return D?Q.every(W=>U.some($=>z(W,$,P))):Q.some(W=>U.some($=>z(W,$,P)))})}else{N=v[1].name;let M=v[2].value,O=a(Q=>Q.text===M,"matches"),q=a(Q=>Q.text!==M,"doesNotMatch");A[y].push(Q=>{let U=[];for(let W of Q)W.name===N&&U.push(W.node);let z=P?O:q;return D?U.every(z):U.some(z)})}break;case"any-not-match?":case"not-match?":P=!1;case"any-match?":case"match?":if(v.length!==3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 2, got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);if(v[2].type!=="string")throw new Error(`Second argument of \`#${x}\` predicate must be a string. Got @${v[2].value}.`);N=v[1].name;let B=new RegExp(v[2].value);D=!x.startsWith("any-"),A[y].push(M=>{let O=[];for(let Q of M)Q.name===N&&O.push(Q.node.text);let q=a((Q,U)=>U?B.test(Q):!B.test(Q),"test");return O.length===0?!P:D?O.every(Q=>q(Q,P)):O.some(Q=>q(Q,P))});break;case"set!":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');f[y]||(f[y]={}),f[y][v[1].value]=v[2]?v[2].value:null;break;case"is?":case"is-not?":if(v.length<2||v.length>3)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected 1 or 2. Got ${v.length-1}.`);if(v.some(M=>M.type!=="string"))throw new Error(`Arguments to \`#${x}\` predicate must be a strings.".`);let L=x==="is?"?h:m;L[y]||(L[y]={}),L[y][v[1].value]=v[2]?v[2].value:null;break;case"not-any-of?":P=!1;case"any-of?":if(v.length<2)throw new Error(`Wrong number of arguments to \`#${x}\` predicate. Expected at least 1. Got ${v.length-1}.`);if(v[1].type!=="capture")throw new Error(`First argument of \`#${x}\` predicate must be a capture. Got "${v[1].value}".`);for(let M=2;MM.value);A[y].push(M=>{let O=[];for(let q of M)q.name===N&&O.push(q.node.text);return O.length===0?!P:O.every(q=>j.includes(q))===P});break;default:g[y].push({operator:x,operands:v.slice(1)})}v.length=0}}Object.freeze(f[y]),Object.freeze(h[y]),Object.freeze(m[y])}return C._free(n),new Query(INTERNAL,o,u,A,g,Object.freeze(f),Object.freeze(h),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else{let n=e;if(typeof process<"u"&&process.versions&&process.versions.node){let o=require("fs");r=Promise.resolve(o.readFileSync(n))}else r=fetch(n).then(o=>o.arrayBuffer().then(s=>{if(o.ok)return new Uint8Array(s);{let c=new TextDecoder("utf-8").decode(s);throw new Error(`Language.load failed with status ${o.status}. ${c}`)}}))}return r.then(n=>loadWebAssemblyModule(n,{loadAsync:!0})).then(n=>{let o=Object.keys(n),s=o.find(l=>LANGUAGE_FUNCTION_REGEX.test(l)&&!l.includes("external_scanner_"));s||console.log(`Couldn't find language function in WASM file. Symbols: -${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[_],b=this.setProperties[y];b&&(v.setProperties=b);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var Pln={};wi(Pln,{TextDocument:()=>$L});function W3t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);W3t(n,e),W3t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function SMo(t){let e=kln(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var x$e,$L,z3t=me(()=>{"use strict";p();x$e=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=kln(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=wln(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&Rln(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new x$e(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof x$e)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=W3t(s.map(SMo),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})($L||($L={}));a(W3t,"mergeSort");a(wln,"computeLineOffsets");a(Rln,"isEOL");a(kln,"getWellformedRange");a(SMo,"getWellformedEdit")});var L$e=I(Bh=>{"use strict";p();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.thenable=Bh.typedArray=Bh.stringArray=Bh.array=Bh.func=Bh.error=Bh.number=Bh.string=Bh.boolean=void 0;function wMo(t){return t===!0||t===!1}a(wMo,"boolean");Bh.boolean=wMo;function Hun(t){return typeof t=="string"||t instanceof String}a(Hun,"string");Bh.string=Hun;function RMo(t){return typeof t=="number"||t instanceof Number}a(RMo,"number");Bh.number=RMo;function kMo(t){return t instanceof Error}a(kMo,"error");Bh.error=kMo;function Gun(t){return typeof t=="function"}a(Gun,"func");Bh.func=Gun;function $un(t){return Array.isArray(t)}a($un,"array");Bh.array=$un;function PMo(t){return $un(t)&&t.every(e=>Hun(e))}a(PMo,"stringArray");Bh.stringArray=PMo;function DMo(t,e){return Array.isArray(t)&&t.every(e)}a(DMo,"typedArray");Bh.typedArray=DMo;function NMo(t){return t&&Gun(t.then)}a(NMo,"thenable");Bh.thenable=NMo});var fFt=I(Ax=>{"use strict";p();Object.defineProperty(Ax,"__esModule",{value:!0});Ax.generateUuid=Ax.parse=Ax.isUUID=Ax.v4=Ax.empty=void 0;var tTe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},rTe=class t extends tTe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};rTe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];rTe._timeHighBits=["8","9","a","b"];Ax.empty=new tTe("00000000-0000-0000-0000-000000000000");function Vun(){return new rTe}a(Vun,"v4");Ax.v4=Vun;var MMo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Wun(t){return MMo.test(t)}a(Wun,"isUUID");Ax.isUUID=Wun;function OMo(t){if(!Wun(t))throw new Error("invalid uuid");return new tTe(t)}a(OMo,"parse");Ax.parse=OMo;function BMo(){return Vun().asHex()}a(BMo,"generateUuid");Ax.generateUuid=BMo});var zun=I($7=>{"use strict";p();Object.defineProperty($7,"__esModule",{value:!0});$7.attachPartialResult=$7.ProgressFeature=$7.attachWorkDone=void 0;var G7=ti(),LMo=fFt(),sY=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(G7.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(G7.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(G7.WorkDoneProgress.type,this._token,{kind:"end"})}};sY.Instances=new Map;var F$e=class extends sY{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new G7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},nTe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},U$e=class extends nTe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new G7.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function FMo(t,e){if(e===void 0||e.workDoneToken===void 0)return new nTe;let r=e.workDoneToken;return delete e.workDoneToken,new sY(t,r)}a(FMo,"attachWorkDone");$7.attachWorkDone=FMo;var UMo=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(G7.WorkDoneProgressCancelNotification.type,r=>{let n=sY.Instances.get(r.token);(n instanceof F$e||n instanceof U$e)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new nTe:new sY(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,LMo.generateUuid)();return this.connection.sendRequest(G7.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new F$e(this.connection,e))}else return Promise.resolve(new U$e)}},"ProgressFeature");$7.ProgressFeature=UMo;var pFt;(function(t){t.type=new G7.ProgressType})(pFt||(pFt={}));var hFt=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(pFt.type,this._token,e)}};function QMo(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new hFt(t,r)}a(QMo,"attachPartialResult");$7.attachPartialResult=QMo});var Yun=I(Q$e=>{"use strict";p();Object.defineProperty(Q$e,"__esModule",{value:!0});Q$e.ConfigurationFeature=void 0;var qMo=ti(),jMo=L$e(),HMo=a(t=>class extends t{getConfiguration(e){return e?jMo.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(qMo.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");Q$e.ConfigurationFeature=HMo});var Kun=I(j$e=>{"use strict";p();Object.defineProperty(j$e,"__esModule",{value:!0});j$e.WorkspaceFoldersFeature=void 0;var q$e=ti(),GMo=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new q$e.Emitter,this.connection.onNotification(q$e.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(q$e.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(q$e.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");j$e.WorkspaceFoldersFeature=GMo});var Jun=I(H$e=>{"use strict";p();Object.defineProperty(H$e,"__esModule",{value:!0});H$e.CallHierarchyFeature=void 0;var mFt=ti(),$Mo=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(mFt.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=mFt.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=mFt.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");H$e.CallHierarchyFeature=$Mo});var AFt=I(V7=>{"use strict";p();Object.defineProperty(V7,"__esModule",{value:!0});V7.SemanticTokensBuilder=V7.SemanticTokensDiff=V7.SemanticTokensFeature=void 0;var G$e=ti(),VMo=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(G$e.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=G$e.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=G$e.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=G$e.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");V7.SemanticTokensFeature=VMo;var $$e=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new $$e(this._prevData,this._data).computeDiff()}:this.build()}};V7.SemanticTokensBuilder=gFt});var Zun=I(V$e=>{"use strict";p();Object.defineProperty(V$e,"__esModule",{value:!0});V$e.ShowDocumentFeature=void 0;var WMo=ti(),zMo=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(WMo.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");V$e.ShowDocumentFeature=zMo});var Xun=I(W$e=>{"use strict";p();Object.defineProperty(W$e,"__esModule",{value:!0});W$e.FileOperationsFeature=void 0;var _ce=ti(),YMo=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(_ce.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(_ce.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(_ce.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(_ce.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(_ce.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(_ce.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");W$e.FileOperationsFeature=YMo});var edn=I(z$e=>{"use strict";p();Object.defineProperty(z$e,"__esModule",{value:!0});z$e.LinkedEditingRangeFeature=void 0;var KMo=ti(),JMo=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(KMo.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");z$e.LinkedEditingRangeFeature=JMo});var tdn=I(Y$e=>{"use strict";p();Object.defineProperty(Y$e,"__esModule",{value:!0});Y$e.TypeHierarchyFeature=void 0;var yFt=ti(),ZMo=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(yFt.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=yFt.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=yFt.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");Y$e.TypeHierarchyFeature=ZMo});var ndn=I(K$e=>{"use strict";p();Object.defineProperty(K$e,"__esModule",{value:!0});K$e.InlineValueFeature=void 0;var rdn=ti(),XMo=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(rdn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(rdn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");K$e.InlineValueFeature=XMo});var odn=I(J$e=>{"use strict";p();Object.defineProperty(J$e,"__esModule",{value:!0});J$e.FoldingRangeFeature=void 0;var idn=ti(),eOo=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(idn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=idn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");J$e.FoldingRangeFeature=eOo});var sdn=I(Z$e=>{"use strict";p();Object.defineProperty(Z$e,"__esModule",{value:!0});Z$e.InlayHintFeature=void 0;var EFt=ti(),tOo=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(EFt.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(EFt.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(EFt.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");Z$e.InlayHintFeature=tOo});var adn=I(X$e=>{"use strict";p();Object.defineProperty(X$e,"__esModule",{value:!0});X$e.DiagnosticFeature=void 0;var iTe=ti(),rOo=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(iTe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(iTe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(iTe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(iTe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(iTe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");X$e.DiagnosticFeature=rOo});var CFt=I(eVe=>{"use strict";p();Object.defineProperty(eVe,"__esModule",{value:!0});eVe.TextDocuments=void 0;var aY=ti(),_Ft=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new aY.Emitter,this._onDidOpen=new aY.Emitter,this._onDidClose=new aY.Emitter,this._onDidSave=new aY.Emitter,this._onWillSave=new aY.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=aY.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),aY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};eVe.TextDocuments=_Ft});var bFt=I(Cce=>{"use strict";p();Object.defineProperty(Cce,"__esModule",{value:!0});Cce.NotebookDocuments=Cce.NotebookSyncFeature=void 0;var yx=ti(),cdn=CFt(),nOo=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(yx.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(yx.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(yx.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(yx.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Cce.NotebookSyncFeature=nOo;var tVe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,yx.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,yx.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,yx.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};tVe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var vFt=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof cdn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new cdn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new yx.Emitter,this._onDidChange=new yx.Emitter,this._onDidSave=new yx.Emitter,this._onDidClose=new yx.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new tVe,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),yx.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Cce.NotebookDocuments=vFt});var ldn=I(rVe=>{"use strict";p();Object.defineProperty(rVe,"__esModule",{value:!0});rVe.MonikerFeature=void 0;var iOo=ti(),oOo=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=iOo.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");rVe.MonikerFeature=oOo});var RFt=I(fc=>{"use strict";p();Object.defineProperty(fc,"__esModule",{value:!0});fc.createConnection=fc.combineFeatures=fc.combineNotebooksFeatures=fc.combineLanguagesFeatures=fc.combineWorkspaceFeatures=fc.combineWindowFeatures=fc.combineClientFeatures=fc.combineTracerFeatures=fc.combineTelemetryFeatures=fc.combineConsoleFeatures=fc._NotebooksImpl=fc._LanguagesImpl=fc.BulkUnregistration=fc.BulkRegistration=fc.ErrorMessageTracker=void 0;var Yr=ti(),Ex=L$e(),TFt=fFt(),xo=zun(),sOo=Yun(),aOo=Kun(),cOo=Jun(),lOo=AFt(),uOo=Zun(),dOo=Xun(),fOo=edn(),pOo=tdn(),hOo=ndn(),mOo=odn(),gOo=sdn(),AOo=adn(),yOo=bFt(),EOo=ldn();function SFt(t){if(t!==null)return t}a(SFt,"null2Undefined");var IFt=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};fc.ErrorMessageTracker=IFt;var nVe=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Yr.MessageType.Error,e)}warn(e){this.send(Yr.MessageType.Warning,e)}info(e){this.send(Yr.MessageType.Info,e)}log(e){this.send(Yr.MessageType.Log,e)}debug(e){this.send(Yr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Yr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Yr.RAL)().console.error("Sending log message failed")})}},xFt=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Yr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}showWarningMessage(e,...r){let n={type:Yr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}showInformationMessage(e,...r){let n={type:Yr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Yr.ShowMessageRequest.type,n).then(SFt)}},udn=(0,uOo.ShowDocumentFeature)((0,xo.ProgressFeature)(xFt)),ddn;(function(t){function e(){return new iVe}a(e,"create"),t.create=e})(ddn||(fc.BulkRegistration=ddn={}));var iVe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=Ex.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=TFt.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},fdn;(function(t){function e(){return new oTe(void 0,[])}a(e,"create"),t.create=e})(fdn||(fc.BulkUnregistration=fdn={}));var oTe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Yr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=Ex.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Yr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},oVe=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof iVe?this.registerMany(e):e instanceof oTe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=Ex.string(r)?r:r.method,s=TFt.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Yr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=Ex.string(e)?e:e.method,o=TFt.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Yr.RegistrationRequest.type,s).then(c=>Yr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Yr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Yr.RegistrationRequest.type,r).then(()=>new oTe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},wFt=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Yr.ApplyWorkspaceEditRequest.type,n)}},pdn=(0,dOo.FileOperationsFeature)((0,aOo.WorkspaceFoldersFeature)((0,sOo.ConfigurationFeature)(wFt))),sVe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Yr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Yr.Trace.Off&&this.connection.sendNotification(Yr.LogTraceNotification.type,{message:e,verbose:this._trace===Yr.Trace.Verbose?r:void 0}).catch(()=>{})}},aVe=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Yr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},cVe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};fc._LanguagesImpl=cVe;var hdn=(0,mOo.FoldingRangeFeature)((0,EOo.MonikerFeature)((0,AOo.DiagnosticFeature)((0,gOo.InlayHintFeature)((0,hOo.InlineValueFeature)((0,pOo.TypeHierarchyFeature)((0,fOo.LinkedEditingRangeFeature)((0,lOo.SemanticTokensFeature)((0,cOo.CallHierarchyFeature)(cVe))))))))),lVe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,xo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,xo.attachPartialResult)(this.connection,r)}};fc._NotebooksImpl=lVe;var mdn=(0,yOo.NotebookSyncFeature)(lVe);function gdn(t,e){return function(r){return e(t(r))}}a(gdn,"combineConsoleFeatures");fc.combineConsoleFeatures=gdn;function Adn(t,e){return function(r){return e(t(r))}}a(Adn,"combineTelemetryFeatures");fc.combineTelemetryFeatures=Adn;function ydn(t,e){return function(r){return e(t(r))}}a(ydn,"combineTracerFeatures");fc.combineTracerFeatures=ydn;function Edn(t,e){return function(r){return e(t(r))}}a(Edn,"combineClientFeatures");fc.combineClientFeatures=Edn;function _dn(t,e){return function(r){return e(t(r))}}a(_dn,"combineWindowFeatures");fc.combineWindowFeatures=_dn;function Cdn(t,e){return function(r){return e(t(r))}}a(Cdn,"combineWorkspaceFeatures");fc.combineWorkspaceFeatures=Cdn;function vdn(t,e){return function(r){return e(t(r))}}a(vdn,"combineLanguagesFeatures");fc.combineLanguagesFeatures=vdn;function bdn(t,e){return function(r){return e(t(r))}}a(bdn,"combineNotebooksFeatures");fc.combineNotebooksFeatures=bdn;function _Oo(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,gdn),tracer:r(t.tracer,e.tracer,ydn),telemetry:r(t.telemetry,e.telemetry,Adn),client:r(t.client,e.client,Edn),window:r(t.window,e.window,_dn),workspace:r(t.workspace,e.workspace,Cdn),languages:r(t.languages,e.languages,vdn),notebooks:r(t.notebooks,e.notebooks,bdn)}}a(_Oo,"combineFeatures");fc.combineFeatures=_Oo;function COo(t,e,r){let n=r&&r.console?new(r.console(nVe)):new nVe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(sVe)):new sVe,c=r&&r.telemetry?new(r.telemetry(aVe)):new aVe,l=r&&r.client?new(r.client(oVe)):new oVe,u=r&&r.window?new(r.window(udn)):new udn,d=r&&r.workspace?new(r.workspace(pdn)):new pdn,f=r&&r.languages?new(r.languages(hdn)):new hdn,h=r&&r.notebooks?new(r.notebooks(mdn)):new mdn,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:Ex.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(Ex.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=Ex.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Yr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Yr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Yr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Yr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Yr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Yr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Yr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Yr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Yr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Yr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Yr.HoverRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Yr.CompletionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Yr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Yr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Yr.DeclarationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Yr.DefinitionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Yr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Yr.ImplementationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Yr.ReferencesRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Yr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Yr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Yr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Yr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Yr.CodeActionRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Yr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Yr.CodeLensRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Yr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Yr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Yr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Yr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Yr.RenameRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Yr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Yr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Yr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Yr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Yr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Yr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Yr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),(0,xo.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Yr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,xo.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Yr.InitializeRequest.type,v=>{e.initialize(v),Ex.string(v.trace)&&(s.trace=Yr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Yr.CancellationTokenSource().token,(0,xo.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Yr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=Ex.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None:!Ex.number(R.textDocumentSync)&&!Ex.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=Ex.number(_.__textDocumentSync)?_.__textDocumentSync:Yr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Yr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Yr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Yr.CancellationTokenSource().token)}),o.onNotification(Yr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Yr.SetTraceNotification.type,v=>{s.trace=Yr.Trace.fromString(v.value)}),_}a(COo,"createConnection");fc.createConnection=COo});var Sdn=I(yv=>{"use strict";p();Object.defineProperty(yv,"__esModule",{value:!0});yv.resolveModulePath=yv.FileSystem=yv.resolveGlobalYarnPath=yv.resolveGlobalNodePath=yv.resolve=yv.uriToFilePath=void 0;var vOo=require("url"),oP=require("path"),kFt=require("fs"),MFt=require("child_process");function bOo(t){let e=vOo.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return oP.normalize(r.join("/"))}a(bOo,"uriToFilePath");yv.uriToFilePath=bOo;function PFt(){return process.platform==="win32"}a(PFt,"isWindows");function uVe(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&kFt.existsSync(e)&&(d[o]?d[o]=e+oP.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,MFt.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(uVe,"resolve");yv.resolve=uVe;function DFt(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};PFt()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,MFt.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?PFt()?oP.join(c,"node_modules"):oP.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(DFt,"resolveGlobalNodePath");yv.resolveGlobalNodePath=DFt;function SOo(t){let e="yarn",r={encoding:"utf8"};PFt()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,MFt.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return oP.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(SOo,"resolveGlobalYarnPath");yv.resolveGlobalYarnPath=SOo;var NFt;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!kFt.existsSync(__filename.toUpperCase())||!kFt.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?oP.normalize(s).indexOf(oP.normalize(o))===0:oP.normalize(s).toLowerCase().indexOf(oP.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(NFt||(yv.FileSystem=NFt={}));function TOo(t,e,r,n){return r?(oP.isAbsolute(r)||(r=oP.join(t,r)),uVe(e,r,r,n).then(o=>NFt.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>uVe(e,DFt(n),t,n))):uVe(e,DFt(n),t,n)}a(TOo,"resolveModulePath");yv.resolveModulePath=TOo});var OFt=I((Gku,Tdn)=>{"use strict";p();Tdn.exports=ti()});var Idn=I(dVe=>{"use strict";p();Object.defineProperty(dVe,"__esModule",{value:!0});dVe.InlineCompletionFeature=void 0;var IOo=ti(),xOo=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(IOo.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");dVe.InlineCompletionFeature=xOo});var Rdn=I(Fy=>{"use strict";p();var wOo=Fy&&Fy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wdn=Fy&&Fy.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wOo(e,t,r)};Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ProposedFeatures=Fy.NotebookDocuments=Fy.TextDocuments=Fy.SemanticTokensBuilder=void 0;var ROo=AFt();Object.defineProperty(Fy,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return ROo.SemanticTokensBuilder},"get")});var kOo=Idn();wdn(ti(),Fy);var POo=CFt();Object.defineProperty(Fy,"TextDocuments",{enumerable:!0,get:a(function(){return POo.TextDocuments},"get")});var DOo=bFt();Object.defineProperty(Fy,"NotebookDocuments",{enumerable:!0,get:a(function(){return DOo.NotebookDocuments},"get")});wdn(RFt(),Fy);var xdn;(function(t){t.all={__brand:"features",languages:kOo.InlineCompletionFeature}})(xdn||(Fy.ProposedFeatures=xdn={}))});var Al=I(_x=>{"use strict";p();var NOo=_x&&_x.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ndn=_x&&_x.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NOo(e,t,r)};Object.defineProperty(_x,"__esModule",{value:!0});_x.createConnection=_x.Files=void 0;var kdn=require("node:util"),BFt=L$e(),MOo=RFt(),sTe=Sdn(),cY=OFt();Ndn(OFt(),_x);Ndn(Rdn(),_x);var Pdn;(function(t){t.uriToFilePath=sTe.uriToFilePath,t.resolveGlobalNodePath=sTe.resolveGlobalNodePath,t.resolveGlobalYarnPath=sTe.resolveGlobalYarnPath,t.resolve=sTe.resolve,t.resolveModulePath=sTe.resolveModulePath})(Pdn||(_x.Files=Pdn={}));var Ddn;function fVe(){if(Ddn!==void 0)try{Ddn.end()}catch{}}a(fVe,"endProtocolConnection");var vce=!1,Mdn;function OOo(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(Mdn=setInterval(()=>{try{process.kill(n,0)}catch{fVe(),process.exit(vce?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;BFt.number(e)&&Mdn===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(vce?0:1)}},3e3)},"initialize"),get shutdownReceived(){return vce},set shutdownReceived(t){vce=t},exit:a(t=>{fVe(),process.exit(t)},"exit")};function LOo(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),cY.ConnectionStrategy.is(t)||cY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),FOo(s,c,l,o)}a(LOo,"createConnection");_x.createConnection=LOo;function FOo(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{fVe(),process.exit(vce?0:1)}),u.on("close",()=>{fVe(),process.exit(vce?0:1)})}let l=a(u=>{let d=(0,cY.createProtocolConnection)(t,e,u,r);return o&&UOo(u),d},"connectionFactory");return(0,MOo.createConnection)(l,BOo,n)}a(FOo,"_createConnection");function UOo(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,kdn.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,kdn.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} -${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(UOo,"patchConsole")});var sP=I((rPu,Odn)=>{"use strict";p();Odn.exports=Al()});var pfn=I((W2u,ffn)=>{"use strict";p();ffn.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var dpn=I($0=>{"use strict";p();var y8t=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),U5o=y8t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),Q5o=y8t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),q5o=y8t(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),spn=$0&&$0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),j5o=$0&&$0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),apn=$0&&$0.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:$5o,sync:V5o}=dpn(),{join:W5o,delimiter:z5o,sep:fpn,posix:ppn}=require("path"),hpn=process.platform==="win32",mpn=new RegExp(`[${ppn.sep}${fpn===ppn.sep?"":fpn}]`.replace(/(\\)/g,"\\$1")),Y5o=new RegExp(`^\\.${mpn.source}`),gpn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),Apn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=z5o})=>{let o=t.match(mpn)?[""]:[...hpn?[process.cwd()]:[],...(e||"").split(n)];if(hpn){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),ypn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&Y5o.test(e)?e.slice(0,2):"")+W5o(r,e)},"getPathPart"),Epn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Apn(t,e),s=[];for(let c of r){let l=ypn(c,t);for(let u of n){let d=l+u;if(await $5o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw gpn(t)},"which"),K5o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=Apn(t,e),s=[];for(let c of r){let l=ypn(c,t);for(let u of n){let d=l+u;if(V5o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw gpn(t)},"whichSync");_pn.exports=Epn;Epn.sync=K5o});var STe=I((ABu,n0n)=>{"use strict";p();var Xhn="[^\\\\/]",$3o="(?=.)",e0n="[^/]",Y8t="(?:\\/|$)",t0n="(?:^|\\/)",K8t=`\\.{1,2}${Y8t}`,V3o="(?!\\.)",W3o=`(?!${t0n}${K8t})`,z3o=`(?!\\.{0,1}${Y8t})`,Y3o=`(?!${K8t})`,K3o="[^.\\/]",J3o=`${e0n}*?`,Z3o="/",r0n={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:$3o,QMARK:e0n,END_ANCHOR:Y8t,DOTS_SLASH:K8t,NO_DOT:V3o,NO_DOTS:W3o,NO_DOT_SLASH:z3o,NO_DOTS_SLASH:Y3o,QMARK_NO_DOT:K3o,STAR:J3o,START_ANCHOR:t0n,SEP:Z3o},X3o={...r0n,SLASH_LITERAL:"[\\\\/]",QMARK:Xhn,STAR:`${Xhn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},eFo={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};n0n.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:eFo,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?X3o:r0n}}});var TTe=I(Sv=>{"use strict";p();var{REGEX_BACKSLASH:tFo,REGEX_REMOVE_BACKSLASH:rFo,REGEX_SPECIAL_CHARS:nFo,REGEX_SPECIAL_CHARS_GLOBAL:iFo}=STe();Sv.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Sv.hasRegexChars=t=>nFo.test(t);Sv.isRegexChar=t=>t.length===1&&Sv.hasRegexChars(t);Sv.escapeRegex=t=>t.replace(iFo,"\\$1");Sv.toPosixSlashes=t=>t.replace(tFo,"/");Sv.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Sv.removeBackslashes=t=>t.replace(rFo,e=>e==="\\"?"":e);Sv.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Sv.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Sv.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Sv.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Sv.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var d0n=I((CBu,u0n)=>{"use strict";p();var i0n=TTe(),{CHAR_ASTERISK:J8t,CHAR_AT:oFo,CHAR_BACKWARD_SLASH:ITe,CHAR_COMMA:sFo,CHAR_DOT:Z8t,CHAR_EXCLAMATION_MARK:X8t,CHAR_FORWARD_SLASH:l0n,CHAR_LEFT_CURLY_BRACE:e6t,CHAR_LEFT_PARENTHESES:t6t,CHAR_LEFT_SQUARE_BRACKET:aFo,CHAR_PLUS:cFo,CHAR_QUESTION_MARK:o0n,CHAR_RIGHT_CURLY_BRACE:lFo,CHAR_RIGHT_PARENTHESES:s0n,CHAR_RIGHT_SQUARE_BRACKET:uFo}=STe(),a0n=a(t=>t===l0n||t===ITe,"isPathSeparator"),c0n=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),dFo=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,k,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),L=a(()=>u.charCodeAt(d+1),"peek"),B=a(()=>(x=k,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),Q&&A===!0&&h>0?(Q=u.slice(0,h),O=u.slice(h)):A===!0?(Q="",O=u):Q=u,Q&&Q!==""&&Q!=="/"&&Q!==u&&a0n(Q.charCodeAt(Q.length-1))&&(Q=Q.slice(0,-1)),r.unescape===!0&&(O&&(O=i0n.removeBackslashes(O)),Q&&v===!0&&(Q=i0n.removeBackslashes(Q)));let q={prefix:M,input:t,start:f,base:Q,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(q.maxDepth=0,a0n(k)||c.push(D),q.tokens=c),r.parts===!0||r.tokens===!0){let F;for(let U=0;U{"use strict";p();var xTe=STe(),TS=TTe(),{MAX_LENGTH:lWe,POSIX_REGEX_SOURCE:fFo,REGEX_NON_SPECIAL_CHARS:pFo,REGEX_SPECIAL_CHARS_BACKREF:hFo,REPLACEMENTS:f0n}=xTe,mFo=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>TS.escapeRegex(o)).join("..")}return r},"expandRange"),Uce=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),p0n=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),gFo=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),h0n=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(gFo(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),AFo=a(t=>{let e=t.map(h0n).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),yFo=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=h0n(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?TS.escapeRegex(r[0]):`[${r.map(o=>TS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),EFo=a(t=>{let e=0,r=t.trim(),n=r6t(r);for(;n;)e++,r=n.body.trim(),n=r6t(r);return e},"repeatedExtglobRecursion"),_Fo=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:xTe.DEFAULT_MAX_EXTGLOB_RECURSION,n=p0n(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||AFo(n)))return{risky:!0};for(let o of n){let s=yFo(o);if(s)return{risky:!0,safeOutput:s};if(EFo(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),n6t=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=f0n[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(lWe,r.maxLength):lWe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=xTe.globChars(r.windows),d=xTe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(Ae=>`(${l}(?:(?!${w}${Ae.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,k=r.dot?v:b,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=TS.removePrefix(t,N),o=t.length;let L=[],B=[],Q=[],M=s,O,q=a(()=>N.index===o-1,"eos"),F=N.peek=(Ae=1)=>t[N.index+Ae],U=N.advance=()=>t[++N.index]||"",W=a(()=>t.slice(N.index+1),"remaining"),V=a((Ae="",De=0)=>{N.consumed+=Ae,N.index+=De},"consume"),G=a(Ae=>{N.output+=Ae.output!=null?Ae.output:Ae.value,V(Ae.value)},"append"),Y=a(()=>{let Ae=1;for(;F()==="!"&&(F(2)!=="("||F(3)==="?");)U(),N.start++,Ae++;return Ae%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),re=a(Ae=>{N[Ae]++,Q.push(Ae)},"increment"),j=a(Ae=>{N[Ae]--,Q.pop()},"decrement"),X=a(Ae=>{if(M.type==="globstar"){let De=N.braces>0&&(Ae.type==="comma"||Ae.type==="brace"),Te=Ae.extglob===!0||L.length&&(Ae.type==="pipe"||Ae.type==="paren");Ae.type!=="slash"&&Ae.type!=="paren"&&!De&&!Te&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(L.length&&Ae.type!=="paren"&&(L[L.length-1].inner+=Ae.value),(Ae.value||Ae.output)&&G(Ae),M&&M.type==="text"&&Ae.type==="text"){M.output=(M.output||M.value)+Ae.value,M.value+=Ae.value;return}Ae.prev=M,c.push(Ae),M=Ae},"push"),ie=a((Ae,De)=>{let Te={...d[De],conditions:1,inner:""};Te.prev=M,Te.parens=N.parens,Te.output=N.output,Te.startIndex=N.index,Te.tokensIndex=c.length;let Z=(r.capture?"(":"")+Te.open;re("parens"),X({type:Ae,value:De,output:N.output?"":g}),X({type:"paren",extglob:!0,value:U(),output:Z}),L.push(Te)},"extglobOpen"),we=a(Ae=>{let De=t.slice(Ae.startIndex,N.index+1),Te=t.slice(Ae.startIndex+2,N.index),Z=_Fo(Te,r);if((Ae.type==="plus"||Ae.type==="star")&&Z.risky){let le=Z.safeOutput?(Ae.output?"":g)+(r.capture?`(${Z.safeOutput})`:Z.safeOutput):void 0,K=c[Ae.tokensIndex];K.type="text",K.value=De,K.output=le||TS.escapeRegex(De);for(let ae=Ae.tokensIndex+1;ae1&&Ae.inner.includes("/")&&(le=R(r)),(le!==D||q()||/^\)+$/.test(W()))&&(J=Ae.close=`)$))${le}`),Ae.inner.includes("*")&&(z=W())&&/^\.[^\\/.]+$/.test(z)){let K=n6t(z,{...e,fastpaths:!1}).output;J=Ae.close=`)${K})${le})`}Ae.prev.type==="bos"&&(N.negatedExtglob=!0)}X({type:"paren",extglob:!0,value:O,output:J}),j("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let Ae=!1,De=t.replace(hFo,(Te,Z,J,z,le,K)=>z==="\\"?(Ae=!0,Te):z==="?"?Z?Z+z+(le?v.repeat(le.length):""):K===0?k+(le?v.repeat(le.length):""):v.repeat(J.length):z==="."?f.repeat(J.length):z==="*"?Z?Z+z+(le?D:""):D:Z?Te:`\\${Te}`);return Ae===!0&&(r.unescape===!0?De=De.replace(/\\/g,""):De=De.replace(/\\+/g,Te=>Te.length%2===0?"\\\\":Te?"\\":"")),De===t&&r.contains===!0?(N.output=t,N):(N.output=TS.wrapOutput(De,N,e),N)}for(;!q();){if(O=U(),O==="\0")continue;if(O==="\\"){let Te=F();if(Te==="/"&&r.bash!==!0||Te==="."||Te===";")continue;if(!Te){O+="\\",X({type:"text",value:O});continue}let Z=/^\\+/.exec(W()),J=0;if(Z&&Z[0].length>2&&(J=Z[0].length,N.index+=J,J%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){X({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let Te=M.value.slice(1);if(Te.includes("[")&&(M.posix=!0,Te.includes(":"))){let Z=M.value.lastIndexOf("["),J=M.value.slice(0,Z),z=M.value.slice(Z+2),le=fFo[z];if(le){M.value=J+le,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&F()!==":"||O==="-"&&F()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,G({value:O});continue}if(N.quotes===1&&O!=='"'){O=TS.escapeRegex(O),M.value+=O,G({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&X({type:"text",value:O});continue}if(O==="("){re("parens"),X({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Uce("opening","("));let Te=L[L.length-1];if(Te&&N.parens===Te.parens+1){we(L.pop());continue}X({type:"paren",value:O,output:N.parens?")":"\\)"}),j("parens");continue}if(O==="["){if(r.nobracket===!0||!W().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Uce("closing","]"));O=`\\${O}`}else re("brackets");X({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){X({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Uce("opening","["));X({type:"text",value:O,output:`\\${O}`});continue}j("brackets");let Te=M.value.slice(1);if(M.posix!==!0&&Te[0]==="^"&&!Te.includes("/")&&(O=`/${O}`),M.value+=O,G({value:O}),r.literalBrackets===!1||TS.hasRegexChars(Te))continue;let Z=TS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=Z,M.value=Z;continue}M.value=`(${l}${Z}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){re("braces");let Te={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};B.push(Te),X(Te);continue}if(O==="}"){let Te=B[B.length-1];if(r.nobrace===!0||!Te){X({type:"text",value:O,output:O});continue}let Z=")";if(Te.dots===!0){let J=c.slice(),z=[];for(let le=J.length-1;le>=0&&(c.pop(),J[le].type!=="brace");le--)J[le].type!=="dots"&&z.unshift(J[le].value);Z=mFo(z,r),N.backtrack=!0}if(Te.comma!==!0&&Te.dots!==!0){let J=N.output.slice(0,Te.outputIndex),z=N.tokens.slice(Te.tokensIndex);Te.value=Te.output="\\{",O=Z="\\}",N.output=J;for(let le of z)N.output+=le.output||le.value}X({type:"brace",value:O,output:Z}),j("braces"),B.pop();continue}if(O==="|"){L.length>0&&L[L.length-1].conditions++,X({type:"text",value:O});continue}if(O===","){let Te=O,Z=B[B.length-1];Z&&Q[Q.length-1]==="braces"&&(Z.comma=!0,Te="|"),X({type:"comma",value:O,output:Te});continue}if(O==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}X({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Te=B[B.length-1];M.type="dots",M.output+=O,M.value+=O,Te.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){X({type:"text",value:O,output:f});continue}X({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&F()==="("&&F(2)!=="?"){ie("qmark",O);continue}if(M&&M.type==="paren"){let Z=F(),J=O;(M.value==="("&&!/[!=<:]/.test(Z)||Z==="<"&&!/<([!=]|\w+>)/.test(W()))&&(J=`\\${O}`),X({type:"text",value:O,output:J});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){X({type:"qmark",value:O,output:b});continue}X({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&F()==="("&&(F(2)!=="?"||!/[!=<:]/.test(F(3)))){ie("negate",O);continue}if(r.nonegate!==!0&&N.index===0){Y();continue}}if(O==="+"){if(r.noextglob!==!0&&F()==="("&&F(2)!=="?"){ie("plus",O);continue}if(M&&M.value==="("||r.regex===!1){X({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){X({type:"plus",value:O});continue}X({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&F()==="("&&F(2)!=="?"){X({type:"at",extglob:!0,value:O,output:""});continue}X({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let Te=pFo.exec(W());Te&&(O+=Te[0],N.index+=Te[0].length),X({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,V(O);continue}let Ae=W();if(r.noextglob!==!0&&/^\([^?]/.test(Ae)){ie("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){V(O);continue}let Te=M.prev,Z=Te.prev,J=Te.type==="slash"||Te.type==="bos",z=Z&&(Z.type==="star"||Z.type==="globstar");if(r.bash===!0&&(!J||Ae[0]&&Ae[0]!=="/")){X({type:"star",value:O,output:""});continue}let le=N.braces>0&&(Te.type==="comma"||Te.type==="brace"),K=L.length&&(Te.type==="pipe"||Te.type==="paren");if(!J&&Te.type!=="paren"&&!le&&!K){X({type:"star",value:O,output:""});continue}for(;Ae.slice(0,3)==="/**";){let ae=t[N.index+4];if(ae&&ae!=="/")break;Ae=Ae.slice(3),V("/**",3)}if(Te.type==="bos"&&q()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,V(O);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&!z&&q()){N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=Te.output+M.output,V(O);continue}if(Te.type==="slash"&&Te.prev.type!=="bos"&&Ae[0]==="/"){let ae=Ae[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Te.output+M.output).length),Te.output=`(?:${Te.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ae})`,M.value+=O,N.output+=Te.output+M.output,N.globstar=!0,V(O+U()),X({type:"slash",value:"/",output:""});continue}if(Te.type==="bos"&&Ae[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,V(O+U()),X({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,V(O);continue}let De={type:"star",value:O,output:D};if(r.bash===!0){De.output=".*?",(M.type==="bos"||M.type==="slash")&&(De.output=x+De.output),X(De);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){De.output=O,X(De);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),F()!=="*"&&(N.output+=g,M.output+=g)),X(De)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing","]"));N.output=TS.escapeLast(N.output,"["),j("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing",")"));N.output=TS.escapeLast(N.output,"("),j("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Uce("closing","}"));N.output=TS.escapeLast(N.output,"{"),j("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&X({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let Ae of N.tokens)N.output+=Ae.output!=null?Ae.output:Ae.value,Ae.suffix&&(N.output+=Ae.suffix)}return N},"parse");n6t.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(lWe,r.maxLength):lWe,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=f0n[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=xTe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let k=/^(.*?)\.(\w+)$/.exec(x);if(!k)return;let D=T(k[1]);return D?D+s+k[2]:void 0}}},"create"),w=TS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};m0n.exports=n6t});var E0n=I((xBu,y0n)=>{"use strict";p();var CFo=d0n(),i6t=g0n(),A0n=TTe(),vFo=STe(),bFo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Qp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Qp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=bFo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?Qp.compileRe(t,e):Qp.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=Qp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Qp.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");Qp.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?A0n.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=Qp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Qp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Qp.makeRe(e,r)).test(A0n.basename(t));Qp.isMatch=(t,e,r)=>Qp(e,r)(t);Qp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Qp.parse(r,e)):i6t(t,{...e,fastpaths:!1});Qp.scan=(t,e)=>CFo(t,e);Qp.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=Qp.toRegex(l,e);return n===!0&&(u.state=t),u};Qp.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=i6t.fastpaths(t,e)),o.output||(o=i6t(t,e)),Qp.compileRe(o,e,r,n)};Qp.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Qp.constants=vFo;y0n.exports=Qp});var b0n=I((kBu,v0n)=>{"use strict";p();var _0n=E0n(),SFo=TTe();function C0n(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:SFo.isWindows()}),_0n(t,e,r)}a(C0n,"picomatch");Object.assign(C0n,_0n);v0n.exports=C0n});var T0n=I((NBu,S0n)=>{p();S0n.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var w0n=I((BBu,x0n)=>{p();var TFo=T0n(),I0n={"{":"}","(":")","[":"]"},IFo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=I0n[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),xFo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var OY=require("path"),wFo=b0n(),RFo=w0n();function uWe(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(RFo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=wFo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(OY.resolve(t,o))}return e}a(uWe,"normalizeOptions");R0n.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(OY.resolve(e),OY.resolve(r),uWe(e,n))},getEventsSince(e,r,n){return t.getEventsSince(OY.resolve(e),OY.resolve(r),uWe(e,n))},async subscribe(e,r,n){return e=OY.resolve(e),n=uWe(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(OY.resolve(e),r,uWe(e,n))}})});var P0n=I(wTe=>{"use strict";p();var kFo=require("path"),{createWrapper:PFo}=k0n();function DFo(){return kFo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(DFo,"resolveBindingPath");var NFo=require(DFo()),dWe=PFo(NFo);wTe.writeSnapshot=dWe.writeSnapshot;wTe.getEventsSince=dWe.getEventsSince;wTe.subscribe=dWe.subscribe;wTe.unsubscribe=dWe.unsubscribe});var I_=I(gWe=>{"use strict";p();Object.defineProperty(gWe,"__esModule",{value:!0});gWe.Position=void 0;var c6t=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(AWe,"__esModule",{value:!0});AWe.Range=void 0;var q0n=I_(),l6t=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new q0n.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new q0n.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};AWe.Range=l6t});var Umn=I(W6t=>{"use strict";p();Object.defineProperty(W6t,"__esModule",{value:!0});W6t.assertNever=M8o;function M8o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(M8o,"assertNever")});var qTe=I(n3=>{"use strict";p();Object.defineProperty(n3,"__esModule",{value:!0});n3.ChatCompletionContentPartOpaque=n3.ChatCompletionContentPartKind=n3.ChatRole=void 0;var O8o=Umn(),HWe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(HWe||(n3.ChatRole=HWe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,O8o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(HWe||(n3.ChatRole=HWe={}));var Qmn;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(Qmn||(n3.ChatCompletionContentPartKind=Qmn={}));var qmn;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(qmn||(n3.ChatCompletionContentPartOpaque=qmn={}))});var z6t=I($M=>{"use strict";p();Object.defineProperty($M,"__esModule",{value:!0});$M.BaseTokensPerName=$M.BaseTokensPerMessage=$M.BaseTokensPerCompletion=$M.ChatRole=void 0;var jmn;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(jmn||($M.ChatRole=jmn={}));$M.BaseTokensPerCompletion=3;$M.BaseTokensPerMessage=3;$M.BaseTokensPerName=1});var Vmn=I($We=>{"use strict";p();Object.defineProperty($We,"__esModule",{value:!0});$We.toOpenAiChatMessage=$mn;$We.toOpenAIChatMessages=L8o;var VM=qTe(),GWe=z6t(),B8o=IQ();function Hmn(t){return t.filter(e=>e.type===VM.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Hmn,"onlyStringContent");function Gmn(t){let e=t.map(r=>{if(r.type===VM.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===VM.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===VM.ChatCompletionContentPartKind.Document)return;if(r.type===VM.ChatCompletionContentPartKind.Opaque&&VM.ChatCompletionContentPartOpaque.usableIn(r,B8o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(Gmn,"stringAndImageContent");function $mn(t){switch(t.role){case VM.ChatRole.System:return{role:GWe.ChatRole.System,content:Hmn(t.content),name:t.name};case VM.ChatRole.User:return{role:GWe.ChatRole.User,content:Gmn(t.content),name:t.name};case VM.ChatRole.Assistant:return{role:GWe.ChatRole.Assistant,content:Hmn(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case VM.ChatRole.Tool:return{role:GWe.ChatRole.Tool,content:Gmn(t.content),tool_call_id:t.toolCallId};default:return}}a($mn,"toOpenAiChatMessage");function L8o(t){return t.map($mn).filter(e=>!!e)}a(L8o,"toOpenAIChatMessages")});var zmn=I(zWe=>{"use strict";p();Object.defineProperty(zWe,"__esModule",{value:!0});zWe.toVsCodeChatMessage=Wmn;zWe.toVsCodeChatMessages=F8o;var WWe=qTe();function VWe(t){return t.filter(e=>e.type===WWe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(VWe,"onlyStringContent");var xQ;function Wmn(t){switch(xQ??=require("vscode"),t.role){case WWe.ChatRole.Assistant:let e=xQ.LanguageModelChatMessage.Assistant(VWe(t.content),t.name);return t.toolCalls&&(e.content=[new xQ.LanguageModelTextPart(VWe(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new xQ.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case WWe.ChatRole.User:return xQ.LanguageModelChatMessage.User(VWe(t.content),t.name);case WWe.ChatRole.Tool:{let r=xQ.LanguageModelChatMessage.User("");return r.content=[new xQ.LanguageModelToolResultPart(t.toolCallId,[new xQ.LanguageModelTextPart(VWe(t.content))])],r}default:return}}a(Wmn,"toVsCodeChatMessage");function F8o(t){return t.map(Wmn).filter(e=>!!e)}a(F8o,"toVsCodeChatMessages")});var IQ=I(pP=>{"use strict";p();Object.defineProperty(pP,"__esModule",{value:!0});pP.OutputMode=pP.Raw=pP.OpenAI=void 0;pP.toMode=Y6t;pP.toVSCode=U8o;pP.toOpenAI=Q8o;var Ymn=Vmn(),Kmn=zmn();pP.OpenAI=z6t();pP.Raw=qTe();var jY;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(jY||(pP.OutputMode=jY={}));function Y6t(t,e){switch(t){case jY.Raw:return e;case jY.VSCode:return e instanceof Array?(0,Kmn.toVsCodeChatMessages)(e):(0,Kmn.toVsCodeChatMessage)(e);case jY.OpenAI:return e instanceof Array?(0,Ymn.toOpenAIChatMessages)(e):(0,Ymn.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(Y6t,"toMode");function U8o(t){return Y6t(jY.VSCode,t)}a(U8o,"toVSCode");function Q8o(t){return Y6t(jY.OpenAI,t)}a(Q8o,"toOpenAI")});var K6t=I(jTe=>{"use strict";p();Object.defineProperty(jTe,"__esModule",{value:!0});jTe.jsonRetainedProps=void 0;jTe.forEachNode=Jmn;jTe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Jmn(t,e){if(e(t),t.type===1)for(let r of t.children)Jmn(r,e)}a(Jmn,"forEachNode")});var Zmn=I(J6t=>{"use strict";p();Object.defineProperty(J6t,"__esModule",{value:!0});J6t.once=q8o;function q8o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(q8o,"once")});var t9t=I(Jm=>{"use strict";p();Object.defineProperty(Jm,"__esModule",{value:!0});Jm.BudgetExceededError=Jm.MaterializedChatMessageDocument=Jm.MaterializedChatMessageImage=Jm.MaterializedChatMessageBreakpoint=Jm.MaterializedChatMessageOpaque=Jm.MaterializedChatMessage=Jm.MaterializedChatMessageTextChunk=Jm.GenericMaterializedContainer=void 0;var HY=Zmn(),uA=IQ(),i3=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=RQ(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return agn(e,this.children,r)}allMetadata(){return sgn(this)}findById(e){return e9t(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)j8o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof mP&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof mP||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return X6t(this,e),e}};Jm.GenericMaterializedContainer=i3;var HTe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,HY.once)(async e=>await e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};Jm.MaterializedChatMessageTextChunk=HTe;var mP=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=agn(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return X6t(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return e9t(e,this)}_tokenCount=(0,HY.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,uA.toMode)(e.mode,r))});_upperBound=(0,HY.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,HY.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===uA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===uA.Raw.ChatCompletionContentPartKind.Image||n.type===uA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,uA.toMode)(e.mode,r))});_text=(0,HY.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of ign(this)){if(r instanceof GY||r instanceof $Y||r instanceof wQ){e.push(r);continue}if(r instanceof hP){e.at(-1)instanceof hP?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` -`)&&(e[e.length-1]=o+` -`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:uA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof GY)return{type:uA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cgn(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof $Y)return{type:uA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof wQ)return{type:uA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof hP)return r.part;throw new Error("Unexpected element type")});if(this.role===uA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===uA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===uA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===uA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};Jm.MaterializedChatMessage=mP;var wQ=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&uA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};Jm.MaterializedChatMessageOpaque=wQ;var hP=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};Jm.MaterializedChatMessageBreakpoint=hP;var GY=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,HY.once)(async e=>e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:cgn(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};Jm.MaterializedChatMessageImage=GY;var $Y=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,HY.once)(async e=>e.tokenLength({type:uA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};Jm.MaterializedChatMessageDocument=$Y;function RQ(t){return t instanceof i3||t instanceof mP}a(RQ,"isContainerType");function ngn(t){return t instanceof HTe||t instanceof GY||t instanceof $Y||t instanceof wQ||t instanceof hP}a(ngn,"isContentType");function j8o(t){if(!RQ(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(j8o,"assertContainerOrChatMessage");function*ign(t,e=!1){for(let r of t.children)r instanceof HTe?(yield{content:r,isTextSibling:e},e=!0):r instanceof GY||r instanceof $Y||r instanceof wQ||r instanceof hP?yield{content:r,isTextSibling:!1}:r instanceof wQ?yield{content:r,isTextSibling:!0}:(r&&(yield*ign(r,e)),e=!1)}a(ign,"contentChunks");function H8o(t,e){let r;function n(o,s){if(ngn(o))(!r||o.priorityn instanceof hP):t instanceof i3&&(r=t.children.some(ogn)),Xmn.set(t,r),r}a(ogn,"hasCachePoint");function G8o(t){if(t instanceof mP)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof mP)return!1;return!0}a(G8o,"shouldLookForCachePointInNode");function X6t(t,e){let r;if(t instanceof i3&&t.has(1)){H8o(t,e);return}let n=G8o(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof mP?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};Jm.BudgetExceededError=YWe;function egn(t){if(!RQ(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(egn,"getLowestPriorityAmongChildren");function*sgn(t){yield*t.metadata;for(let e of t.children)RQ(e)?yield*sgn(e):yield*e.metadata}a(sgn,"allMetadata");function agn(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,RQ(r)&&e.push(...r.children)}}a(tgn,"forEachNode");function $8o(t){let e=t;for(;e.parent;)e=e.parent;return e}a($8o,"getRoot");function rgn(t){return t instanceof i3&&t.keepWithId!==void 0}a(rgn,"isKeepWith");var Z6t=new Set;function V8o(t,e){let r=new Set;for(let n of tgn(t))rgn(n)&&!Z6t.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)Z6t.add(n);try{let n=$8o(t);for(let o of tgn(n))rgn(o)&&r.has(o.keepWithId)?GTe(o,e):o instanceof mP&&o.toolCalls&&(o.toolCalls=W8o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&>e(o,e))}finally{for(let n of r)Z6t.delete(n)}}a(V8o,"removeOtherKeepWiths");function e9t(t,e){if(e.id===t)return e;for(let r of e.children)if(RQ(r)){let n=e9t(t,r);if(n)return n}}a(e9t,"findNodeById");function GTe(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),V8o(t,e),r.isEmpty?GTe(r,e):r.onChunksChange())}a(GTe,"removeNode");function cgn(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a(cgn,"getEncodedBase64");function W8o(t,e){for(let r=0;r{"use strict";p();function z8o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(z8o,"_vscpp");function lgn(){throw new Error("This should not be invoked!")}a(lgn,"_vscppf");lgn.isFragment=!0;globalThis.vscpp=z8o;globalThis.vscppf=lgn});var n9t=I(KWe=>{"use strict";p();Object.defineProperty(KWe,"__esModule",{value:!0});KWe.PromptElement=void 0;ugn();var r9t=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};KWe.PromptElement=r9t});var h9t=I(Bs=>{"use strict";p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.LogicalWrapper=Bs.IfEmpty=Bs.AbstractKeepWith=Bs.TokenLimit=Bs.Expandable=Bs.Chunk=Bs.LegacyPrioritization=Bs.ToolResult=Bs.PrioritizedList=Bs.Document=Bs.Image=Bs.TextChunk=Bs.ToolMessage=Bs.AssistantMessage=Bs.UserMessage=Bs.SystemMessage=Bs.BaseChatMessage=void 0;Bs.isChatMessagePromptElement=Y8o;Bs.useKeepWith=X8o;var VTe=wo(),kS=n9t();function Y8o(t){return t instanceof JWe||t instanceof ZWe||t instanceof XWe}a(Y8o,"isChatMessagePromptElement");var VY=class extends kS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.BaseChatMessage=VY;var JWe=class extends VY{static{a(this,"SystemMessage")}constructor(e){e.role=VTe.Raw.ChatRole.System,super(e)}};Bs.SystemMessage=JWe;var ZWe=class extends VY{static{a(this,"UserMessage")}constructor(e){e.role=VTe.Raw.ChatRole.User,super(e)}};Bs.UserMessage=ZWe;var XWe=class extends VY{static{a(this,"AssistantMessage")}constructor(e){e.role=VTe.Raw.ChatRole.Assistant,super(e)}};Bs.AssistantMessage=XWe;var K8o=/\s+/g,i9t=class extends VY{static{a(this,"ToolMessage")}constructor(e){e.role=VTe.Raw.ChatRole.Tool,super(e)}};Bs.ToolMessage=i9t;var eze=class extends kS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?K8o:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` -`:c.push(u)}else u!=null&&(s+=u);let l=await J8o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Bs.TextChunk=eze;async function J8o(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(J8o,"getTextContentBelowBudget");var o9t=class extends kS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Image=o9t;var s9t=class extends kS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Document=s9t;var a9t=class extends kS.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(eze,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Bs.PrioritizedList=a9t;var c9t=class extends kS.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};Bs.ToolResult=c9t;var l9t=class extends kS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.LegacyPrioritization=l9t;var u9t=class extends kS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.Chunk=u9t;var d9t=class extends kS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Bs.Expandable=d9t;var f9t=class extends kS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.TokenLimit=f9t;var tze=class extends kS.PromptElement{static{a(this,"AbstractKeepWith")}};Bs.AbstractKeepWith=tze;var Z8o=0;function X8o(){let t=Z8o++;return class extends tze{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(X8o,"useKeepWith");var p9t=class extends kS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp($Te,null,this.props.alt),vscpp($Te,{flexGrow:1},this.props.children))}};Bs.IfEmpty=p9t;var $Te=class extends kS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Bs.LogicalWrapper=$Te});var fgn=I(WTe=>{"use strict";p();Object.defineProperty(WTe,"__esModule",{value:!0});WTe.localize=e6o;WTe.localize2=t6o;WTe.getConfiguredDefaultLocale=r6o;function dgn(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(dgn,"_format");function e6o(t,e,...r){return dgn(e,r)}a(e6o,"localize");function t6o(t,e,...r){let n=dgn(e,r);return{original:n,value:n}}a(t6o,"localize2");function r6o(t){}a(r6o,"getConfiguredDefaultLocale")});var y9t=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=i6o;Sr.isLittleEndian=o6o;Sr.isBigSurOrNewer=s6o;var pgn=fgn();Sr.LANGUAGE_DEFAULT="en";var KTe=!1,JTe=!1,YTe=!1,Agn=!1,ygn=!1,g9t=!1,Egn=!1,A9t=!1,_gn=!1,Cgn=!1,zTe,rze=Sr.LANGUAGE_DEFAULT,m9t=Sr.LANGUAGE_DEFAULT,vgn,o3,s3=globalThis,PS;typeof s3.vscode<"u"&&typeof s3.vscode.process<"u"?PS=s3.vscode.process:typeof process<"u"&&(PS=process);var bgn=typeof PS?.versions?.electron=="string",n6o=bgn&&PS?.type==="renderer";if(typeof PS=="object"){KTe=PS.platform==="win32",JTe=PS.platform==="darwin",YTe=PS.platform==="linux",Agn=YTe&&!!PS.env.SNAP&&!!PS.env.SNAP_REVISION,Egn=bgn,_gn=!!PS.env.CI||!!PS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,zTe=Sr.LANGUAGE_DEFAULT,rze=Sr.LANGUAGE_DEFAULT;let t=PS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];zTe=e.locale,m9t=e.osLocale,rze=r||Sr.LANGUAGE_DEFAULT,vgn=e._translationsConfigFile}catch{}ygn=!0}else typeof navigator=="object"&&!n6o?(o3=navigator.userAgent,KTe=o3.indexOf("Windows")>=0,JTe=o3.indexOf("Macintosh")>=0,A9t=(o3.indexOf("Macintosh")>=0||o3.indexOf("iPad")>=0||o3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,YTe=o3.indexOf("Linux")>=0,Cgn=o3?.indexOf("Mobi")>=0,g9t=!0,zTe=pgn.getConfiguredDefaultLocale(pgn.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,rze=zTe,m9t=navigator.language):console.error("Unable to resolve platform.");function i6o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(i6o,"PlatformToString");var nze=0;JTe?nze=1:KTe?nze=3:YTe&&(nze=2);Sr.isWindows=KTe;Sr.isMacintosh=JTe;Sr.isLinux=YTe;Sr.isLinuxSnap=Agn;Sr.isNative=ygn;Sr.isElectron=Egn;Sr.isWeb=g9t;Sr.isWebWorker=g9t&&typeof s3.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?s3.origin:void 0;Sr.isIOS=A9t;Sr.isMobile=Cgn;Sr.isCI=_gn;Sr.platform=nze;Sr.userAgent=o3;Sr.language=rze;var hgn;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(hgn||(Sr.Language=hgn={}));Sr.locale=zTe;Sr.platformLocale=m9t;Sr.translationsConfigFile=vgn;Sr.setTimeout0IsFaster=typeof s3.postMessage=="function"&&!s3.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];s3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),s3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=JTe||A9t?2:KTe?1:3;var mgn=!0,ggn=!1;function o6o(){if(!ggn){ggn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,mgn=new Uint16Array(t.buffer)[0]===513}return mgn}a(o6o,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function s6o(t){return parseFloat(t)>=20}a(s6o,"isBigSurOrNewer")});var Tgn=I(WM=>{"use strict";p();Object.defineProperty(WM,"__esModule",{value:!0});WM.arch=WM.platform=WM.env=WM.cwd=void 0;var Sgn=y9t(),WY,E9t=globalThis.vscode;if(typeof E9t<"u"&&typeof E9t.process<"u"){let t=E9t.process;WY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?WY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:WY={get platform(){return Sgn.isWindows?"win32":Sgn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};WM.cwd=WY.cwd;WM.env=WY.env;WM.platform=WY.platform;WM.arch=WY.arch});var xgn=I(hn=>{"use strict";p();Object.defineProperty(hn,"__esModule",{value:!0});hn.delimiter=hn.sep=hn.toNamespacedPath=hn.parse=hn.format=hn.extname=hn.basename=hn.dirname=hn.relative=hn.resolve=hn.join=hn.isAbsolute=hn.normalize=hn.posix=hn.win32=void 0;var Zce=Tgn(),a6o=65,c6o=97,l6o=90,u6o=122,DQ=46,Zm=47,Tv=92,kQ=58,d6o=63,ize=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function f6o(t,e){if(t===null||typeof t!="object")throw new ize(e,"Object",t)}a(f6o,"validateObject");function Wf(t,e){if(typeof t!="string")throw new ize(e,"string",t)}a(Wf,"validateString");var Iv=Zce.platform==="win32";function Xo(t){return t===Zm||t===Tv}a(Xo,"isPathSeparator");function _9t(t){return t===Zm}a(_9t,"isPosixPathSeparator");function PQ(t){return t>=a6o&&t<=l6o||t>=c6o&&t<=u6o}a(PQ,"isWindowsDeviceRoot");function oze(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===DQ&&l!==-1?++l:l=-1}return o}a(oze,"normalizeString");function Ign(t,e){f6o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(Ign,"_format");hn.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Wf(s,"path"),s.length===0)continue}else e.length===0?s=Zce.cwd():(s=Zce.env[`=${e}`]||Zce.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Tv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Xo(f)&&(l=1,d=!0);else if(Xo(f))if(d=!0,Xo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Xo(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=oze(r,!n,"\\",Xo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return _9t(s)?"\\":t;if(Xo(s))if(o=!0,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Xo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Wf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Xo(r)||e>2&&PQ(r)&&t.charCodeAt(1)===kQ&&Xo(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Xo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Xo(r.charCodeAt(1))&&(++o,s>2&&(Xo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return hn.win32.normalize(e)},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e)return"";let r=hn.win32.resolve(t),n=hn.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===Tv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Tv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Tv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Tv?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===Tv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Tv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=hn.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Tv){if(e.charCodeAt(1)===Tv){let r=e.charCodeAt(2);if(r!==d6o&&r!==DQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(PQ(e.charCodeAt(0))&&e.charCodeAt(1)===kQ&&e.charCodeAt(2)===Tv)return`\\\\?\\${e}`;return t},dirname(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Xo(o)?t:".";if(Xo(o)){if(r=n=1,Xo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Xo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Xo(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Wf(e,"ext"),Wf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&PQ(t.charCodeAt(0))&&t.charCodeAt(1)===kQ&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Xo(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Xo(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Wf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===kQ&&PQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Xo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===DQ?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:Ign.bind(null,"\\"),parse(t){Wf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Xo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Xo(o)){if(n=1,Xo(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Xo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===DQ?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var p6o=(()=>{if(Iv){let t=/\\/g;return()=>{let e=Zce.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Zce.cwd()})();hn.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:p6o();Wf(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Zm)}return e=oze(e,!r,"/",_9t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Zm,r=t.charCodeAt(t.length-1)===Zm;return t=oze(t,!e,"/",_9t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Wf(t,"path"),t.length>0&&t.charCodeAt(0)===Zm},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":hn.posix.normalize(e)},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e||(t=hn.posix.resolve(t),e=hn.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Zm)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Zm?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Zm)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Zm,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Zm){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Wf(e,"ext"),Wf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Zm){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Zm){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Wf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===Zm){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===DQ?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:Ign.bind(null,"/"),parse(t){Wf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Zm,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Zm){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===DQ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};hn.posix.win32=hn.win32.win32=hn.win32;hn.posix.posix=hn.win32.posix=hn.posix;hn.normalize=Iv?hn.win32.normalize:hn.posix.normalize;hn.isAbsolute=Iv?hn.win32.isAbsolute:hn.posix.isAbsolute;hn.join=Iv?hn.win32.join:hn.posix.join;hn.resolve=Iv?hn.win32.resolve:hn.posix.resolve;hn.relative=Iv?hn.win32.relative:hn.posix.relative;hn.dirname=Iv?hn.win32.dirname:hn.posix.dirname;hn.basename=Iv?hn.win32.basename:hn.posix.basename;hn.extname=Iv?hn.win32.extname:hn.posix.extname;hn.format=Iv?hn.win32.format:hn.posix.format;hn.parse=Iv?hn.win32.parse:hn.posix.parse;hn.toNamespacedPath=Iv?hn.win32.toNamespacedPath:hn.posix.toNamespacedPath;hn.sep=Iv?hn.win32.sep:hn.posix.sep;hn.delimiter=Iv?hn.win32.delimiter:hn.posix.delimiter});var Mgn=I(Xce=>{"use strict";p();Object.defineProperty(Xce,"__esModule",{value:!0});Xce.URI=void 0;Xce.isUriComponents=C6o;Xce.uriToFsPath=lze;var wgn=xgn(),aze=y9t(),h6o=/^\w[\w\d+.-]*$/,m6o=/^\//,g6o=/^\/\//;function A6o(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!h6o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!m6o.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(g6o.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(A6o,"_validateUri");function y6o(t,e){return!t&&!e?"file":t}a(y6o,"_schemeFix");function E6o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==gP&&(e=gP+e):e=gP;break}return e}a(E6o,"_referenceResolution");var Fl="",gP="/",_6o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,cze=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Fl,this.authority=e.authority||Fl,this.path=e.path||Fl,this.query=e.query||Fl,this.fragment=e.fragment||Fl):(this.scheme=y6o(e,c),this.authority=r||Fl,this.path=E6o(this.scheme,n||Fl),this.query=o||Fl,this.fragment=s||Fl,A6o(this,c))}get fsPath(){return lze(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Fl),n===void 0?n=this.authority:n===null&&(n=Fl),o===void 0?o=this.path:o===null&&(o=Fl),s===void 0?s=this.query:s===null&&(s=Fl),c===void 0?c=this.fragment:c===null&&(c=Fl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new NQ(r,n,o,s,c)}static parse(e,r=!1){let n=_6o.exec(e);return n?new NQ(n[2]||Fl,sze(n[4]||Fl),sze(n[5]||Fl),sze(n[7]||Fl),sze(n[9]||Fl),r):new NQ(Fl,Fl,Fl,Fl,Fl)}static file(e){let r=Fl;if(aze.isWindows&&(e=e.replace(/\\/g,gP)),e[0]===gP&&e[1]===gP){let n=e.indexOf(gP,2);n===-1?(r=e.substring(2),e=gP):(r=e.substring(2,n),e=e.substring(n)||gP)}return new NQ("file",r,e,Fl,Fl)}static from(e,r){return new NQ(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return aze.isWindows&&e.scheme==="file"?n=t.file(wgn.win32.join(lze(e,!0),...r)).path:n=wgn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return C9t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new NQ(e);return r._formatted=e.external??null,r._fsPath=e._sep===Pgn?e.fsPath??null:null,r}}else return e}};Xce.URI=cze;function C6o(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(C6o,"isUriComponents");var Pgn=aze.isWindows?1:void 0,NQ=class extends cze{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=lze(this,!1)),this._fsPath}toString(e=!1){return e?C9t(this,!0):(this._formatted||(this._formatted=C9t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=Pgn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},Dgn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Rgn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=Dgn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(Rgn,"encodeURIComponentFast");function v6o(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,aze.isWindows&&(r=r.replace(/\//g,"\\")),r}a(lze,"uriToFsPath");function C9t(t,e){let r=e?v6o:Rgn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=gP,n+=gP),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:Rgn(u,!1,!1)),n}a(C9t,"_asFormatted");function Ngn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Ngn(t.substr(3)):t}}a(Ngn,"decodeURIComponentGraceful");var kgn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function sze(t){return t.match(kgn)?t.replace(kgn,e=>Ngn(e)):t}a(sze,"percentDecode")});var S9t=I(MQ=>{"use strict";p();Object.defineProperty(MQ,"__esModule",{value:!0});MQ.PromptReference=MQ.ChatResponseReferencePartStatusKind=MQ.PromptMetadata=void 0;var ZTe=Mgn(),v9t=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};MQ.PromptMetadata=v9t;var Ogn;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(Ogn||(MQ.ChatResponseReferencePartStatusKind=Ogn={}));var b9t=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?ZTe.URI.from(n):{uri:ZTe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?ZTe.URI.from(e.iconPath):"light"in e.iconPath?{light:ZTe.URI.from(e.iconPath.light),dark:ZTe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};MQ.PromptReference=b9t});var D9t=I(ele=>{"use strict";p();Object.defineProperty(ele,"__esModule",{value:!0});ele.PromptRenderer=ele.MetadataMap=void 0;var b6o=K6t(),OQ=t9t(),YY=IQ(),kd=h9t(),P9t=S9t(),dze;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(dze||(ele.MetadataMap=dze={}));var T9t=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new hze(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=Ugn(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof kd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:YY.Raw.ChatCompletionContentPartKind.Text,text:b}:b,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((E,_)=>({id:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await Lgn(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await Lgn(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new zY(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof kd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=Fgn(o),u=new zY(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await S6o(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new zY(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,YY.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new zY(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof zM))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(mze),h=o.map(m=>{if(!(m instanceof zM)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(mze);return{metadata:dze.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof OQ.BudgetExceededError&&(m.metadata=dze.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof kd.Expandable))throw new Error("unreachable: expected growable");let l=new hze(null,0,s.elem.id),u=new zY(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:YY.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===kd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},fze(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new zM(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` -`);else if(l.name==="references")for(let u of l.props.value)c.push(new zM(u));else this._handleIntrinsic(e,l.name,l.props,fze(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};ele.PromptRenderer=T9t;async function S6o(t,e,r,n){let o=0;if((0,kd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,YY.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:YY.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(S6o,"computeTokensConsumedByLiterals");function Fgn(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new w9t(String(t))):T6o(t)?fze(t.children,e):I6o(t)?fze(t,e):typeof t.ctor=="string"?e.push(new I9t(t.ctor,t.props,t.children)):e.push(new x9t(t.ctor,t.props,t.children)),e)}a(Fgn,"flattenAndReduce");function fze(t,e=[]){for(let r of t)Fgn(r,e);return e}a(fze,"flattenAndReduceArr");var I9t=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},x9t=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},w9t=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},pze=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new OQ.MaterializedChatMessageOpaque(e,{type:YY.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},zY=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},hze=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new zM(P9t.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return XTe.fromJSON(o,c,s);case 3:return pze.fromJSON(o,c,s);default:}}).filter(mze),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new kd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,kd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new kd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new kd.Image(r.props);break;case 4:o._obj=new kd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof kd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof kd.Chunk&&(this._objFlags|=2),this._obj instanceof kd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new XTe(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new XTe(this,r,` -`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new pze(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(mze),props:{},references:this._metadata.filter(r=>r instanceof zM).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=uze(this._obj.props,b6o.jsonRetainedProps)),this._obj instanceof kd.BaseChatMessage)e.ctor=1,Object.assign(e.props,uze(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof kd.Image)return{...e,ctor:3,props:{...e.props,...uze(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof kd.Document)return{...e,ctor:4,props:{...e.props,...uze(this._obj.props,["data","mediaType"])}};this._obj instanceof kd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof kd.Image)return new OQ.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof kd.Document)return new OQ.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof kd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new OQ.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof kd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof kd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new OQ.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof kd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof kd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new R9t({type:YY.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},R9t=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new OQ.MaterializedChatMessageBreakpoint(e,this.part)}},XTe=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new zM(P9t.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new OQ.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof zM).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function T6o(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(T6o,"isFragmentCtor");function mze(t){return t!==void 0}a(mze,"isDefined");var k9t=class extends P9t.PromptMetadata{static{a(this,"InternalMetadata")}},zM=class extends k9t{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function I6o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(I6o,"isIterable");function uze(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(uze,"pickProps");function Ugn(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(Ugn,"atPath");var Bgn=new WeakSet;async function Lgn(t,e){try{return await e()}catch(r){throw r instanceof Error&&!Bgn.has(r)&&r.constructor.name!=="CancellationError"&&(Bgn.add(r),r.message+=` (at tsx element ${Ugn(t.path)})`),r}}a(Lgn,"annotateError")});var Qgn=I(gze=>{"use strict";p();Object.defineProperty(gze,"__esModule",{value:!0});gze.VSCodeTokenizer=void 0;var N9t=IQ(),M9t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=N9t.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==N9t.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===N9t.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};gze.VSCodeTokenizer=M9t});var qgn=I(tle=>{"use strict";p();Object.defineProperty(tle,"__esModule",{value:!0});tle.tracerCss=tle.tracerSrc=void 0;tle.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';tle.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} -`});var Vgn=I(yze=>{"use strict";p();Object.defineProperty(yze,"__esModule",{value:!0});yze.HTMLTracer=void 0;var jgn=qgn(),BQ=t9t(),x6o=IQ(),O9t=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return B9t.create({epochs:this.epochs,traceData:Ggn(this.traceData)})}serveRouter(e){return new Aze({baseAddress:e,epochs:this.epochs,traceData:Ggn(this.traceData)})}};yze.HTMLTracer=O9t;var Aze=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` - - - `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await Hgn(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},B9t=class t extends Aze{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function Hgn(t,e){return{container:await $gn(t,e.container,!1),removed:e.removed,budget:e.budget}}a(Hgn,"serializeRenderData");async function $gn(t,e,r){let n={metadata:e.metadata.map(R6o),priority:e.priority};if(e instanceof BQ.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof BQ.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof BQ.MaterializedChatMessageOpaque||e instanceof BQ.MaterializedChatMessageBreakpoint||e instanceof BQ.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>$gn(t,s,r||e instanceof BQ.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof BQ.GenericMaterializedContainer)return{...o,type:0};if(e instanceof BQ.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:x6o.Raw.ChatRole.display(e.role),text:s}}}w6o(e)}a($gn,"serializeMaterialized");function w6o(t){throw new Error("unreachable")}a(w6o,"assertNever");function R6o(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(R6o,"serializeMetadata");var Ggn=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var zgn=I(Wgn=>{"use strict";p();Object.defineProperty(Wgn,"__esModule",{value:!0})});var Kgn=I(Ygn=>{"use strict";p();Object.defineProperty(Ygn,"__esModule",{value:!0})});var Zgn=I(Jgn=>{"use strict";p();Object.defineProperty(Jgn,"__esModule",{value:!0})});var wo=I(Wu=>{"use strict";p();var k6o=Wu&&Wu.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KY=Wu&&Wu.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k6o(e,t,r)};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.contentType=Wu.PromptRenderer=Wu.MetadataMap=Wu.PromptElement=Wu.JSONTree=void 0;Wu.renderPrompt=N6o;Wu.renderElementJSON=M6o;var L9t=IQ(),Xgn=D9t(),P6o=Qgn();KY(Vgn(),Wu);Wu.JSONTree=K6t();KY(IQ(),Wu);KY(h9t(),Wu);KY(S9t(),Wu);KY(zgn(),Wu);KY(Kgn(),Wu);KY(Zgn(),Wu);var D6o=n9t();Object.defineProperty(Wu,"PromptElement",{enumerable:!0,get:a(function(){return D6o.PromptElement},"get")});var eAn=D9t();Object.defineProperty(Wu,"MetadataMap",{enumerable:!0,get:a(function(){return eAn.MetadataMap},"get")});Object.defineProperty(Wu,"PromptRenderer",{enumerable:!0,get:a(function(){return eAn.PromptRenderer},"get")});async function N6o(t,e,r,n,o,s,c=L9t.OutputMode.VSCode){let l="countTokens"in n?new P6o.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new Xgn.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(N6o,"renderPrompt");Wu.contentType="application/vnd.codechat.prompt+json.1";function M6o(t,e,r,n){return new Xgn.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:L9t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===L9t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(M6o,"renderElementJSON")});var uEn=I((wJu,AIe)=>{"use strict";p();var kYe=a(function(){},"NullObject");kYe.prototype=Object.create(null);var wYe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,RYe=/\\([\v\u0020-\u00ff])/gu,aEn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,sK={type:"",parameters:new kYe};Object.freeze(sK.parameters);Object.freeze(sK);function cEn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(aEn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new kYe};if(e===-1)return n;let o,s,c;for(wYe.lastIndex=e;s=wYe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),RYe.test(c)&&(c=c.replace(RYe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(cEn,"parse");function lEn(t){if(typeof t!="string")return sK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(aEn.test(r)===!1)return sK;let n={type:r.toLowerCase(),parameters:new kYe};if(e===-1)return n;let o,s,c;for(wYe.lastIndex=e;s=wYe.exec(t);){if(s.index!==e)return sK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),RYe.test(c)&&(c=c.replace(RYe,"$1"))),n.parameters[o]=c}return e!==t.length?sK:n}a(lEn,"safeParse");AIe.exports.default={parse:cEn,safeParse:lEn};AIe.exports.parse=cEn;AIe.exports.safeParse=lEn;AIe.exports.defaultContentType=sK});var KEn=I(g7t=>{"use strict";p();Object.defineProperty(g7t,"__esModule",{value:!0});g7t.workerFile=` -const { parentPort } = require('worker_threads') - -parentPort.on('message', async worker => { - const response = { - error: null, - data: null - } - - try { - eval(worker) - // __executor__ is defined in worker - response.data = await __executor__() - parentPort.postMessage(response) - } catch (err) { - response.data = null - response.error = { - message: err.message, - stack: err.stack - } - - try { - parentPort.postMessage(response) - } catch (err) { - console.error(err) - } - } -}) -`});var r_n=I(y7t=>{"use strict";p();Object.defineProperty(y7t,"__esModule",{value:!0});var JEn=require("worker_threads"),rQo=require("v8"),nQo=require("os"),ZEn=KEn(),$Ye="ready",XEn="spawning",iQo="busy",VYe="off",e_n=nQo.cpus().length,t_n=process.version.replace("v","").split("."),oQo=parseInt(t_n[0]),sQo=parseInt(t_n[1]),A7t=class{static{a(this,"WorkerPool")}constructor(){this.maxWorkers=e_n,this.taskQueue=[],this.workers=[]}resurrect(e){let r=new JEn.Worker(ZEn.workerFile,{eval:!0});e.status=XEn,e.worker=r,r.once("online",()=>process.nextTick(()=>{e.status=$Ye,r.removeAllListeners(),this.tick()})),r.once("error",n=>{console.error(n),e.status=VYe,r.removeAllListeners(),this.tick()})}tick(){if(this.workers.filter(({status:u})=>u===VYe).forEach(u=>this.resurrect(u)),this.taskQueue.length===0)return;let e;for(let u=0;u"u")return;let r=this.taskQueue.shift();e.status=iQo;let{worker:n}=e,{handler:o,config:s,resolve:c,reject:l}=r;try{let u="";for(let m in s.ctx){if(!s.ctx.hasOwnProperty(m))continue;let g;switch(typeof s.ctx[m]){case"string":g=`'${s.ctx[m]}'`;break;case"object":g=JSON.stringify(s.ctx[m]);break;default:g=s.ctx[m]}u+=`let ${m} = ${g} -`}let d=rQo.serialize(s.data),f=JSON.stringify(d),h=` - async function __executor__() { - const v8 = require('v8') - ${u} - const dataParsed = JSON.parse('${f}') - const dataBuffer = Buffer.from(dataParsed.data) - const dataDeserialized = v8.deserialize(dataBuffer) - return await (${o.toString()})(dataDeserialized) - } - `;n.once("message",m=>{if(this.free(n),typeof m.error>"u"||m.error===null)return c(m.data);let g=new Error(m.error.message);g.stack=m.error.stack,l(g)}),n.once("error",m=>{e.status=VYe,l(m),this.tick()}),n.postMessage(h)}catch(u){this.free(n),l(u)}}enqueue({handler:e,config:r,resolve:n,reject:o}){this.taskQueue.push({handler:e,config:r,resolve:n,reject:o}),this.tick()}free(e){for(let r=0;r0?e.maxWorkers:e_n,this.maxWorkers>10&&console.warn(`Worker pool has more than 10 workers. -You should also increase the Max Listeners of Node.js (https://nodejs.org/docs/latest/api/events.html#events_emitter_setmaxlisteners_n) -Otherwise, limit them with start({maxWorkers: 10})`),new Promise((r,n)=>{let o=0,s=0;for(let c=0;c()=>{process.nextTick(()=>{this.workers[u].status=$Ye,this.workers[u].worker.removeAllListeners(),o++,o>0&&o+s===this.maxWorkers&&r()})})(c)),l.once("error",(u=>d=>{this.workers[u].status=VYe,this.workers[u].worker.removeAllListeners(),s++,s===this.maxWorkers&&n(d)})(c))}})}async teardown(){if(oQo>=12&&sQo>=5){let e=[];for(let{worker:r}of this.workers)e.push(r.terminate());await Promise.all(e),this.workers=[]}else await new Promise(r=>{let n=0;for(let o=0;o{n++,n===this.workers.length&&(this.workers=[],r())})})}};y7t.default=new A7t});var WYe=I(lK=>{"use strict";p();var aQo=lK&&lK.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lK,"__esModule",{value:!0});var vIe=aQo(r_n()),cQo=`job needs a function. -Try with: -> job(() => {...}, config)`,lQo=`job needs an object as ctx. -Try with: -> job(() => {...}, {ctx: {...}})`;function uQo(t,e={ctx:{},data:{}}){return new Promise((r,n)=>{if(typeof t!="function")return n(new Error(cQo));if(e.ctx=e.ctx||{},e.data=e.data||{},typeof e.ctx!="object")return n(new Error(lQo));vIe.default.enqueue({handler:t,config:e,resolve:r,reject:n})})}a(uQo,"job");lK.job=uQo;lK.stop=vIe.default.teardown.bind(vIe.default);lK.start=vIe.default.setup.bind(vIe.default)});var ZQ=I(ig=>{"use strict";p();Object.defineProperty(ig,"__esModule",{value:!0});ig.MonotonousArray=void 0;ig.findLast=BQo;ig.findLastIdx=m_n;ig.findFirst=LQo;ig.findFirstIdx=g_n;ig.findLastMonotonous=FQo;ig.findLastIdxMonotonous=M7t;ig.findFirstMonotonous=UQo;ig.findFirstIdxMonotonousOrArrLen=O7t;ig.findFirstIdxMonotonous=QQo;ig.findFirstMax=A_n;ig.findLastMax=qQo;ig.findFirstMin=jQo;ig.findMaxIdx=HQo;ig.mapFindFirst=GQo;function BQo(t,e,r=t.length-1){let n=m_n(t,e,r);if(n!==-1)return t[n]}a(BQo,"findLast");function m_n(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(m_n,"findLastIdx");function LQo(t,e,r=0){let n=g_n(t,e,r);if(n!==-1)return t[n]}a(LQo,"findFirst");function g_n(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(A_n,"findFirstMax");function qQo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(qQo,"findLastMax");function jQo(t,e){return A_n(t,(r,n)=>-e(r,n))}a(jQo,"findFirstMin");function HQo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(HQo,"findMaxIdx");function GQo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(GQo,"mapFindFirst")});var Ts=I(Ro=>{"use strict";p();Object.defineProperty(Ro,"__esModule",{value:!0});Ro.BugIndicatingError=Ro.ErrorNoTelemetry=Ro.ExpectedError=Ro.NotSupportedError=Ro.NotImplementedError=Ro.ReadonlyError=Ro.PendingMigrationError=Ro.CancellationError=Ro.canceledName=Ro.errorHandler=Ro.ErrorHandler=void 0;Ro.setUnexpectedErrorHandler=$Qo;Ro.isSigPipeError=VQo;Ro.onBugIndicatingError=WQo;Ro.onUnexpectedError=zQo;Ro.onUnexpectedExternalError=YQo;Ro.transformErrorForSerialization=y_n;Ro.transformErrorFromSerialization=E_n;Ro.isCancellationError=j7t;Ro.canceled=KQo;Ro.illegalArgument=JQo;Ro.illegalState=ZQo;Ro.getErrorMessage=XQo;var lKe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?dK.isErrorNoTelemetry(e)?new dK(e.message+` +${JSON.stringify(o,null,2)}`);let c=n[s]();return new Language(INTERNAL,c)})}}class LookaheadIterable{static{a(this,"LookaheadIterable")}constructor(e,r,n){assertInternal(e),this[0]=r,this.language=n}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,r){return C._ts_lookahead_iterator_reset(this[0],e[0],r)?(this.language=e,!0):!1}[Symbol.iterator](){let e=this;return{next(){return C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:""}}}}}class Query{static{a(this,"Query")}constructor(e,r,n,o,s,c,l,u){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=o,this.predicates=s,this.setProperties=c,this.assertedProperties=l,this.refutedProperties=u,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=new Array(u);this.exceededMatchLimit=!!f;let m=0,g=d;for(let A=0;Av(_))){h[m]={pattern:y,captures:_};let v=this.setProperties[y];v&&(h[m].setProperties=v);let b=this.assertedProperties[y];b&&(h[m].assertedProperties=b);let T=this.refutedProperties[y];T&&(h[m].refutedProperties=T),m++}}return h.length=m,C._free(d),h}captures(e,{startPosition:r=ZERO_POINT,endPosition:n=ZERO_POINT,startIndex:o=0,endIndex:s=0,matchLimit:c=4294967295,maxStartDepth:l=4294967295}={}){if(typeof c!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,o,s,c,l);let u=getValue(TRANSFER_BUFFER,"i32"),d=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),h=[];this.exceededMatchLimit=!!f;let m=[],g=d;for(let A=0;Av(m))){let v=m[_],b=this.setProperties[y];b&&(v.setProperties=b);let T=this.assertedProperties[y];T&&(v.assertedProperties=T);let w=this.refutedProperties[y];w&&(v.refutedProperties=w),h.push(v)}}return C._free(d),h}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){let r=lengthBytesUTF8(e),n=C._malloc(r+1);stringToUTF8(e,n,r+1),C._ts_query_disable_capture(this[0],n,r),C._free(n)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,o=t.textCallback(e,null,r);for(e+=o.length;e0)e+=s.length,o+=s;else break}return e>r&&(o=o.slice(0,n)),o}a(getText,"getText");function unmarshalCaptures(t,e,r,n){for(let o=0,s=n.length;o>>0,column:getValue(t+SIZE_OF_INT,"i32")>>>0}}a(unmarshalPoint,"unmarshalPoint");function marshalRange(t,e){marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.endPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,"i32"),t+=SIZE_OF_INT,setValue(t,e.endIndex,"i32"),t+=SIZE_OF_INT}a(marshalRange,"marshalRange");function unmarshalRange(t){let e={};return e.startPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.endPosition=unmarshalPoint(t),t+=SIZE_OF_POINT,e.startIndex=getValue(t,"i32")>>>0,t+=SIZE_OF_INT,e.endIndex=getValue(t,"i32")>>>0,e}a(unmarshalRange,"unmarshalRange");function marshalEdit(t){let e=TRANSFER_BUFFER;marshalPoint(e,t.startPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.oldEndPosition),e+=SIZE_OF_POINT,marshalPoint(e,t.newEndPosition),e+=SIZE_OF_POINT,setValue(e,t.startIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.oldEndIndex,"i32"),e+=SIZE_OF_INT,setValue(e,t.newEndIndex,"i32"),e+=SIZE_OF_INT}a(marshalEdit,"marshalEdit");for(let t of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,t,{value:ParserImpl.prototype[t],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}}))}}return Parser})();typeof exports=="object"&&(module.exports=TreeSitter)});var ycn=I((w_u,Acn)=>{"use strict";p();var JDo=require("path"),ZDo=JDo.join(__dirname,"compiled",process.platform,process.arch,"keytar.node");Acn.exports=require(ZDo)});var BL=I(vGe=>{"use strict";p();Object.defineProperty(vGe,"__esModule",{value:!0});vGe.Lazy=void 0;var x7;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(x7||(x7={}));var m3t=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=x7.Uninitialized}get hasValue(){return this._state===x7.Completed}get value(){if(this._state===x7.Uninitialized){this._state=x7.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=x7.Completed}}else if(this._state===x7.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};vGe.Lazy=m3t});var bs=I(To=>{"use strict";p();Object.defineProperty(To,"__esModule",{value:!0});To.BugIndicatingError=To.ErrorNoTelemetry=To.ExpectedError=To.NotSupportedError=To.NotImplementedError=To.ReadonlyError=To.PendingMigrationError=To.CancellationError=To.canceledName=To.errorHandler=To.ErrorHandler=void 0;To.setUnexpectedErrorHandler=dNo;To.isSigPipeError=fNo;To.onBugIndicatingError=pNo;To.onUnexpectedError=hNo;To.onUnexpectedExternalError=mNo;To.transformErrorForSerialization=Ocn;To.transformErrorFromSerialization=Bcn;To.isCancellationError=C3t;To.canceled=gNo;To.illegalArgument=ANo;To.illegalState=yNo;To.getErrorMessage=ENo;var CGe=class{static{a(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Vz.isErrorNoTelemetry(e)?new Vz(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(r=>{r(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)}};Ro.ErrorHandler=lKe;Ro.errorHandler=new lKe;function $Qo(t){Ro.errorHandler.setUnexpectedErrorHandler(t)}a($Qo,"setUnexpectedErrorHandler");function VQo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(VQo,"isSigPipeError");function WQo(t){Ro.errorHandler.onUnexpectedError(t)}a(WQo,"onBugIndicatingError");function zQo(t){j7t(t)||Ro.errorHandler.onUnexpectedError(t)}a(zQo,"onUnexpectedError");function YQo(t){j7t(t)||Ro.errorHandler.onUnexpectedExternalError(t)}a(YQo,"onUnexpectedExternalError");function y_n(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:dK.isErrorNoTelemetry(t),cause:n?y_n(n):void 0,code:t.code}}return t}a(y_n,"transformErrorForSerialization");function E_n(t){let e;return t.noTelemetry?e=new dK:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=E_n(t.cause)),e}a(E_n,"transformErrorFromSerialization");Ro.canceledName="Canceled";function j7t(t){return t instanceof uKe?!0:t instanceof Error&&t.name===Ro.canceledName&&t.message===Ro.canceledName}a(j7t,"isCancellationError");var uKe=class extends Error{static{a(this,"CancellationError")}constructor(){super(Ro.canceledName),this.name=this.message}};Ro.CancellationError=uKe;var B7t=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};Ro.PendingMigrationError=B7t;function KQo(){let t=new Error(Ro.canceledName);return t.name=t.message,t}a(KQo,"canceled");function JQo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(JQo,"illegalArgument");function ZQo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(ZQo,"illegalState");var L7t=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};Ro.ReadonlyError=L7t;function XQo(t){return t?t.message?t.message:t.stack?t.stack.split(` -`)[0]:String(t):"Error"}a(XQo,"getErrorMessage");var F7t=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};Ro.NotImplementedError=F7t;var U7t=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};Ro.NotSupportedError=U7t;var Q7t=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};Ro.ExpectedError=Q7t;var dK=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};Ro.ErrorNoTelemetry=dK;var q7t=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};Ro.BugIndicatingError=q7t});var El=I($n=>{"use strict";p();Object.defineProperty($n,"__esModule",{value:!0});$n.Permutation=$n.CallbackIterable=$n.ArrayQueue=$n.booleanComparator=$n.numberComparator=$n.CompareResult=void 0;$n.tail=rqo;$n.equals=nqo;$n.removeFastWithoutKeepingOrder=iqo;$n.binarySearch=oqo;$n.binarySearch2=__n;$n.quickSelect=H7t;$n.groupBy=sqo;$n.groupAdjacentBy=aqo;$n.forEachAdjacent=cqo;$n.forEachWithNeighbors=lqo;$n.concatArrays=uqo;$n.sortedDiff=C_n;$n.delta=dqo;$n.top=fqo;$n.topAsync=pqo;$n.coalesce=hqo;$n.coalesceInPlace=mqo;$n.move=gqo;$n.isFalsyOrEmpty=Aqo;$n.isNonEmptyArray=yqo;$n.distinct=Eqo;$n.uniqueFilter=_qo;$n.commonPrefixLength=Cqo;$n.range=vqo;$n.index=bqo;$n.insert=Sqo;$n.remove=b_n;$n.arrayInsert=Tqo;$n.shuffle=Iqo;$n.pushToStart=xqo;$n.pushToEnd=wqo;$n.pushMany=Rqo;$n.mapArrayOrNot=kqo;$n.mapFilter=Pqo;$n.withoutDuplicates=Dqo;$n.asArray=Nqo;$n.getRandomElement=Mqo;$n.insertInto=S_n;$n.splice=Oqo;$n.compareBy=Bqo;$n.tieBreakComparators=Lqo;$n.reverseOrder=Qqo;$n.compareUndefinedSmallest=qqo;$n.findAsync=jqo;$n.sum=Hqo;$n.sumBy=Gqo;var eqo=ZQ(),tqo=Ts();function rqo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(rqo,"tail");function nqo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(oqo,"binarySearch");function __n(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(__n,"binarySearch2");function H7t(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(C_n,"sortedDiff");function dqo(t,e,r){let n=C_n(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(dqo,"delta");function fqo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return v_n(t,e,n,r,t.length),n}a(fqo,"top");function pqo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new tqo.CancellationError;v_n(t,e,u,d,f)}return u})().then(s,c)})}a(pqo,"topAsync");function v_n(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(v_n,"topStep");function hqo(t){return t.filter(e=>!!e)}a(hqo,"coalesce");function mqo(t){let e=0;for(let r=0;r0}a(yqo,"isNonEmptyArray");function Eqo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a(Eqo,"distinct");function _qo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(_qo,"uniqueFilter");function Cqo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(vqo,"range");function bqo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(bqo,"index");function Sqo(t,e){return t.push(e),()=>b_n(t,e)}a(Sqo,"insert");function b_n(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(b_n,"remove");function Tqo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(Tqo,"arrayInsert");function Iqo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(Iqo,"shuffle");function xqo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(xqo,"pushToStart");function wqo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(wqo,"pushToEnd");function Rqo(t,e){for(let r of e)t.push(r)}a(Rqo,"pushMany");function kqo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(kqo,"mapArrayOrNot");function Pqo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(Pqo,"mapFilter");function Dqo(t){let e=new Set(t);return Array.from(e)}a(Dqo,"withoutDuplicates");function Nqo(t){return Array.isArray(t)?t:[t]}a(Nqo,"asArray");function Mqo(t){return t[Math.floor(Math.random()*t.length)]}a(Mqo,"getRandomElement");function S_n(t,e,r){let n=T_n(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(XQ||($n.CompareResult=XQ={}));function Bqo(t,e){return(r,n)=>e(t(r),t(n))}a(Bqo,"compareBy");function Lqo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!XQ.isNeitherLessOrGreaterThan(o))return o}return XQ.neitherLessOrGreaterThan}}a(Lqo,"tieBreakComparators");var Fqo=a((t,e)=>t-e,"numberComparator");$n.numberComparator=Fqo;var Uqo=a((t,e)=>(0,$n.numberComparator)(t?1:0,e?1:0),"booleanComparator");$n.booleanComparator=Uqo;function Qqo(t){return(e,r)=>-t(e,r)}a(Qqo,"reverseOrder");function qqo(t){return(e,r)=>e===void 0?r===void 0?XQ.neitherLessOrGreaterThan:XQ.lessThan:r===void 0?XQ.greaterThan:t(e,r)}a(qqo,"compareUndefinedSmallest");var G7t=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};$n.ArrayQueue=G7t;var $7t=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||XQ.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};$n.CallbackIterable=$7t;var V7t=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(jqo,"findAsync");function Hqo(t){return t.reduce((e,r)=>e+r,0)}a(Hqo,"sum");function Gqo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(Gqo,"sumBy")});var Y7t=I(f3=>{"use strict";p();var x_n;Object.defineProperty(f3,"__esModule",{value:!0});f3.SetWithKey=void 0;f3.groupBy=Wqo;f3.groupByMap=zqo;f3.diffSets=Yqo;f3.diffMaps=Kqo;f3.intersection=Jqo;function Wqo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(Wqo,"groupBy");function zqo(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(zqo,"groupByMap");function Yqo(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(Yqo,"diffSets");function Kqo(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(Kqo,"diffMaps");function Jqo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(Jqo,"intersection");var z7t=class{static{a(this,"SetWithKey")}static{x_n=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[x_n]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};f3.SetWithKey=z7t});var J7t=I(K7t=>{"use strict";p();Object.defineProperty(K7t,"__esModule",{value:!0});K7t.createSingleCallFunction=Zqo;function Zqo(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(Zqo,"createSingleCallFunction")});var bP=I(Dd=>{"use strict";p();var w_n,R_n,k_n;Object.defineProperty(Dd,"__esModule",{value:!0});Dd.NKeyMap=Dd.SetMap=Dd.BidirectionalMap=Dd.CounterSet=Dd.MRUCache=Dd.LRUCache=Dd.LinkedMap=Dd.ResourceSet=Dd.ResourceMap=void 0;Dd.getOrSet=Xqo;Dd.mapToString=ejo;Dd.setToString=tjo;Dd.mapsStrictEqualIgnoreOrder=njo;function Xqo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(Xqo,"getOrSet");function ejo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(ejo,"mapToString");function tjo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(tjo,"setToString");var Z7t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function rjo(t){return Array.isArray(t)}a(rjo,"isEntries");var DIe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[w_n]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(rjo(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new Z7t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(w_n=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};Dd.ResourceMap=DIe;var X7t=class{static{a(this,"ResourceSet")}constructor(e,r){this[R_n]="ResourceSet",!e||typeof e=="function"?this._map=new DIe(e):(this._map=new DIe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(R_n=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};Dd.ResourceSet=X7t;var dKe=class{static{a(this,"LinkedMap")}constructor(){this[k_n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(k_n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};Dd.LinkedMap=dKe;var fKe=class extends dKe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},eQt=class extends fKe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};Dd.LRUCache=eQt;var tQt=class extends fKe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};Dd.MRUCache=tQt;var rQt=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};Dd.CounterSet=rQt;var nQt=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};Dd.BidirectionalMap=nQt;var iQt=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};Dd.SetMap=iQt;function njo(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(njo,"mapsStrictEqualIgnoreOrder");var oQt=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(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)}};To.ErrorHandler=CGe;To.errorHandler=new CGe;function dNo(t){To.errorHandler.setUnexpectedErrorHandler(t)}a(dNo,"setUnexpectedErrorHandler");function fNo(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}a(fNo,"isSigPipeError");function pNo(t){To.errorHandler.onUnexpectedError(t)}a(pNo,"onBugIndicatingError");function hNo(t){C3t(t)||To.errorHandler.onUnexpectedError(t)}a(hNo,"onUnexpectedError");function mNo(t){C3t(t)||To.errorHandler.onUnexpectedExternalError(t)}a(mNo,"onUnexpectedExternalError");function Ocn(t){if(t instanceof Error){let{name:e,message:r,cause:n}=t,o=t.stacktrace||t.stack;return{$isError:!0,name:e,message:r,stack:o,noTelemetry:Vz.isErrorNoTelemetry(t),cause:n?Ocn(n):void 0,code:t.code}}return t}a(Ocn,"transformErrorForSerialization");function Bcn(t){let e;return t.noTelemetry?e=new Vz:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=Bcn(t.cause)),e}a(Bcn,"transformErrorFromSerialization");To.canceledName="Canceled";function C3t(t){return t instanceof bGe?!0:t instanceof Error&&t.name===To.canceledName&&t.message===To.canceledName}a(C3t,"isCancellationError");var bGe=class extends Error{static{a(this,"CancellationError")}constructor(){super(To.canceledName),this.name=this.message}};To.CancellationError=bGe;var g3t=class t extends Error{static{a(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};To.PendingMigrationError=g3t;function gNo(){let t=new Error(To.canceledName);return t.name=t.message,t}a(gNo,"canceled");function ANo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}a(ANo,"illegalArgument");function yNo(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}a(yNo,"illegalState");var A3t=class extends TypeError{static{a(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};To.ReadonlyError=A3t;function ENo(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}a(ENo,"getErrorMessage");var y3t=class extends Error{static{a(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};To.NotImplementedError=y3t;var E3t=class extends Error{static{a(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};To.NotSupportedError=E3t;var _3t=class extends Error{static{a(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};To.ExpectedError=_3t;var Vz=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};To.ErrorNoTelemetry=Vz;var v3t=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};To.BugIndicatingError=v3t});var w7=I(Wm=>{"use strict";p();Object.defineProperty(Wm,"__esModule",{value:!0});Wm.MonotonousArray=void 0;Wm.findLast=_No;Wm.findLastIdx=Lcn;Wm.findFirst=vNo;Wm.findFirstIdx=Fcn;Wm.findLastMonotonous=CNo;Wm.findLastIdxMonotonous=S3t;Wm.findFirstMonotonous=bNo;Wm.findFirstIdxMonotonousOrArrLen=T3t;Wm.findFirstIdxMonotonous=SNo;Wm.findFirstMax=Ucn;Wm.findLastMax=TNo;Wm.findFirstMin=INo;Wm.findMaxIdx=xNo;Wm.mapFindFirst=wNo;function _No(t,e,r=t.length-1){let n=Lcn(t,e,r);if(n!==-1)return t[n]}a(_No,"findLast");function Lcn(t,e,r=t.length-1){for(let n=r;n>=0;n--){let o=t[n];if(e(o,n))return n}return-1}a(Lcn,"findLastIdx");function vNo(t,e,r=0){let n=Fcn(t,e,r);if(n!==-1)return t[n]}a(vNo,"findFirst");function Fcn(t,e,r=0){for(let n=r;n0&&(r=o)}return r}a(Ucn,"findFirstMax");function TNo(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n=0&&(r=o)}return r}a(TNo,"findLastMax");function INo(t,e){return Ucn(t,(r,n)=>-e(r,n))}a(INo,"findFirstMin");function xNo(t,e){if(t.length===0)return-1;let r=0;for(let n=1;n0&&(r=n)}return r}a(xNo,"findMaxIdx");function wNo(t,e){for(let r of t){let n=e(r);if(n!==void 0)return n}}a(wNo,"mapFindFirst")});var ml=I(Vn=>{"use strict";p();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.Permutation=Vn.CallbackIterable=Vn.ArrayQueue=Vn.booleanComparator=Vn.numberComparator=Vn.CompareResult=void 0;Vn.tail=kNo;Vn.equals=DNo;Vn.removeFastWithoutKeepingOrder=NNo;Vn.binarySearch=MNo;Vn.binarySearch2=Qcn;Vn.quickSelect=I3t;Vn.groupBy=ONo;Vn.groupAdjacentBy=BNo;Vn.forEachAdjacent=LNo;Vn.forEachWithNeighbors=FNo;Vn.concatArrays=UNo;Vn.sortedDiff=qcn;Vn.delta=QNo;Vn.top=qNo;Vn.topAsync=jNo;Vn.coalesce=HNo;Vn.coalesceInPlace=GNo;Vn.move=$No;Vn.isFalsyOrEmpty=VNo;Vn.isNonEmptyArray=WNo;Vn.distinct=zNo;Vn.uniqueFilter=YNo;Vn.commonPrefixLength=KNo;Vn.range=JNo;Vn.index=ZNo;Vn.insert=XNo;Vn.remove=Hcn;Vn.arrayInsert=eMo;Vn.shuffle=tMo;Vn.pushToStart=rMo;Vn.pushToEnd=nMo;Vn.pushMany=iMo;Vn.mapArrayOrNot=oMo;Vn.mapFilter=sMo;Vn.withoutDuplicates=aMo;Vn.asArray=cMo;Vn.getRandomElement=lMo;Vn.insertInto=Gcn;Vn.splice=uMo;Vn.compareBy=dMo;Vn.tieBreakComparators=fMo;Vn.reverseOrder=mMo;Vn.compareUndefinedSmallest=gMo;Vn.findAsync=AMo;Vn.sum=yMo;Vn.sumBy=EMo;var RNo=w7(),PNo=bs();function kNo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}a(kNo,"tail");function DNo(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;nr(t[n],e))}a(MNo,"binarySearch");function Qcn(t,e){let r=0,n=t-1;for(;r<=n;){let o=(r+n)/2|0,s=e(o);if(s<0)r=o+1;else if(s>0)n=o-1;else return o}return-(r+1)}a(Qcn,"binarySearch2");function I3t(t,e,r){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let n=e[Math.floor(e.length*Math.random())],o=[],s=[],c=[];for(let l of e){let u=r(l,n);u<0?o.push(l):u>0?s.push(l):c.push(l)}return t0&&(o(s,0,[u]),c+=1)}return n}a(qcn,"sortedDiff");function QNo(t,e,r){let n=qcn(t,e,r),o=[],s=[];for(let c of n)o.push(...t.slice(c.start,c.start+c.deleteCount)),s.push(...c.toInsert);return{removed:o,added:s}}a(QNo,"delta");function qNo(t,e,r){if(r===0)return[];let n=t.slice(0,r).sort(e);return jcn(t,e,n,r,t.length),n}a(qNo,"top");function jNo(t,e,r,n,o){return r===0?Promise.resolve([]):new Promise((s,c)=>{(async()=>{let l=t.length,u=t.slice(0,r).sort(e);for(let d=r,f=Math.min(r+n,l);dr&&await new Promise(h=>setTimeout(h)),o&&o.isCancellationRequested)throw new PNo.CancellationError;jcn(t,e,u,d,f)}return u})().then(s,c)})}a(jNo,"topAsync");function jcn(t,e,r,n,o){for(let s=r.length;ne(c,u)<0);r.splice(l,0,c)}}}a(jcn,"topStep");function HNo(t){return t.filter(e=>!!e)}a(HNo,"coalesce");function GNo(t){let e=0;for(let r=0;r0}a(WNo,"isNonEmptyArray");function zNo(t,e=r=>r){let r=new Set;return t.filter(n=>{let o=e(n);return r.has(o)?!1:(r.add(o),!0)})}a(zNo,"distinct");function YNo(t){let e=new Set;return r=>{let n=t(r);return e.has(n)?!1:(e.add(n),!0)}}a(YNo,"uniqueFilter");function KNo(t,e,r=(n,o)=>n===o){let n=0;for(let o=0,s=Math.min(t.length,e.length);oe;o--)n.push(o);return n}a(JNo,"range");function ZNo(t,e,r){return t.reduce((n,o)=>(n[e(o)]=r?r(o):o,n),Object.create(null))}a(ZNo,"index");function XNo(t,e){return t.push(e),()=>Hcn(t,e)}a(XNo,"insert");function Hcn(t,e){let r=t.indexOf(e);if(r>-1)return t.splice(r,1),e}a(Hcn,"remove");function eMo(t,e,r){let n=t.slice(0,e),o=t.slice(e);return n.concat(r,o)}a(eMo,"arrayInsert");function tMo(t,e){let r;if(typeof e=="number"){let n=e;r=a(()=>{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(tMo,"shuffle");function rMo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.unshift(e))}a(rMo,"pushToStart");function nMo(t,e){let r=t.indexOf(e);r>-1&&(t.splice(r,1),t.push(e))}a(nMo,"pushToEnd");function iMo(t,e){for(let r of e)t.push(r)}a(iMo,"pushMany");function oMo(t,e){return Array.isArray(t)?t.map(e):e(t)}a(oMo,"mapArrayOrNot");function sMo(t,e){let r=[];for(let n of t){let o=e(n);o!==void 0&&r.push(o)}return r}a(sMo,"mapFilter");function aMo(t){let e=new Set(t);return Array.from(e)}a(aMo,"withoutDuplicates");function cMo(t){return Array.isArray(t)?t:[t]}a(cMo,"asArray");function lMo(t){return t[Math.floor(Math.random()*t.length)]}a(lMo,"getRandomElement");function Gcn(t,e,r){let n=$cn(t,e),o=t.length,s=r.length;t.length=o+s;for(let c=o-1;c>=n;c--)t[c+s]=t[c];for(let c=0;c0}a(n,"isGreaterThan"),t.isGreaterThan=n;function o(s){return s===0}a(o,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=o,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(R7||(Vn.CompareResult=R7={}));function dMo(t,e){return(r,n)=>e(t(r),t(n))}a(dMo,"compareBy");function fMo(...t){return(e,r)=>{for(let n of t){let o=n(e,r);if(!R7.isNeitherLessOrGreaterThan(o))return o}return R7.neitherLessOrGreaterThan}}a(fMo,"tieBreakComparators");var pMo=a((t,e)=>t-e,"numberComparator");Vn.numberComparator=pMo;var hMo=a((t,e)=>(0,Vn.numberComparator)(t?1:0,e?1:0),"booleanComparator");Vn.booleanComparator=hMo;function mMo(t){return(e,r)=>-t(e,r)}a(mMo,"reverseOrder");function gMo(t){return(e,r)=>e===void 0?r===void 0?R7.neitherLessOrGreaterThan:R7.lessThan:r===void 0?R7.greaterThan:t(e,r)}a(gMo,"compareUndefinedSmallest");var x3t=class{static{a(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let r=this.firstIdx;for(;r=0&&e(this.items[r]);)r--;let n=r===this.lastIdx?null:this.items.slice(r+1,this.lastIdx+1);return this.lastIdx=r,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let r=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,r}};Vn.ArrayQueue=x3t;var w3t=class t{static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||R7.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};Vn.CallbackIterable=w3t;var R3t=class t{static{a(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,r){let n=Array.from(e.keys()).sort((o,s)=>r(e[o],e[s]));return new t(n)}apply(e){return e.map((r,n)=>e[this._indexMap[n]])}inverse(){let e=this._indexMap.slice();for(let r=0;r({element:n,ok:await e(n,o)})))).find(n=>n.ok)?.element}a(AMo,"findAsync");function yMo(t){return t.reduce((e,r)=>e+r,0)}a(yMo,"sum");function EMo(t,e){return t.reduce((r,n)=>r+e(n),0)}a(EMo,"sumBy")});var k3t=I(LL=>{"use strict";p();var Vcn;Object.defineProperty(LL,"__esModule",{value:!0});LL.SetWithKey=void 0;LL.groupBy=_Mo;LL.groupByMap=vMo;LL.diffSets=CMo;LL.diffMaps=bMo;LL.intersection=SMo;function _Mo(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(_Mo,"groupBy");function vMo(t,e){let r=new Map;for(let n of t){let o=e(n),s=r.get(o);s||(s=[],r.set(o,s)),s.push(n)}return r}a(vMo,"groupByMap");function CMo(t,e){let r=[],n=[];for(let o of t)e.has(o)||r.push(o);for(let o of e)t.has(o)||n.push(o);return{removed:r,added:n}}a(CMo,"diffSets");function bMo(t,e){let r=[],n=[];for(let[o,s]of t)e.has(o)||r.push(s);for(let[o,s]of e)t.has(o)||n.push(s);return{removed:r,added:n}}a(bMo,"diffMaps");function SMo(t,e){let r=new Set;for(let n of e)t.has(n)&&r.add(n);return r}a(SMo,"intersection");var P3t=class{static{a(this,"SetWithKey")}static{Vcn=Symbol.toStringTag}constructor(e,r){this.toKey=r,this._map=new Map,this[Vcn]="SetWithKey";for(let n of e)this.add(n)}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[Symbol.iterator](){return this.values()}};LL.SetWithKey=P3t});var XP=I(xd=>{"use strict";p();var Wcn,zcn,Ycn;Object.defineProperty(xd,"__esModule",{value:!0});xd.NKeyMap=xd.SetMap=xd.BidirectionalMap=xd.CounterSet=xd.MRUCache=xd.LRUCache=xd.LinkedMap=xd.ResourceSet=xd.ResourceMap=void 0;xd.getOrSet=TMo;xd.mapToString=IMo;xd.setToString=xMo;xd.mapsStrictEqualIgnoreOrder=RMo;function TMo(t,e,r){let n=t.get(e);return n===void 0&&(n=r,t.set(e,n)),n}a(TMo,"getOrSet");function IMo(t){let e=[];return t.forEach((r,n)=>{e.push(`${n} => ${r}`)}),`Map(${t.size}) {${e.join(", ")}}`}a(IMo,"mapToString");function xMo(t){let e=[];return t.forEach(r=>{e.push(r)}),`Set(${t.size}) {${e.join(", ")}}`}a(xMo,"setToString");var D3t=class{static{a(this,"ResourceMapEntry")}constructor(e,r){this.uri=e,this.value=r}};function wMo(t){return Array.isArray(t)}a(wMo,"isEntries");var xSe=class t{static{a(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,r){if(this[Wcn]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=r??t.defaultToKey;else if(wMo(e)){this.map=new Map,this.toKey=r??t.defaultToKey;for(let[n,o]of e)this.set(n,o)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,r){return this.map.set(this.toKey(e),new D3t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Wcn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};xd.ResourceMap=xSe;var N3t=class{static{a(this,"ResourceSet")}constructor(e,r){this[zcn]="ResourceSet",!e||typeof e=="function"?this._map=new xSe(e):(this._map=new xSe(r),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(zcn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};xd.ResourceSet=N3t;var SGe=class{static{a(this,"LinkedMap")}constructor(){this[Ycn]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(Ycn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}};xd.LinkedMap=SGe;var TGe=class extends SGe{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},M3t=class extends TGe{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};xd.LRUCache=M3t;var O3t=class extends TGe{static{a(this,"MRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimNew(e)}set(e,r){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,r),this}};xd.MRUCache=O3t;var B3t=class{static{a(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let r=this.map.get(e)||0;return r===0?!1:(r--,r===0?this.map.delete(e):this.map.set(e,r),!0)}has(e){return this.map.has(e)}};xd.CounterSet=B3t;var L3t=class{static{a(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[r,n]of e)this.set(r,n)}clear(){this._m1.clear(),this._m2.clear()}set(e,r){this._m1.set(e,r),this._m2.set(r,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let r=this._m1.get(e);return r===void 0?!1:(this._m1.delete(e),this._m2.delete(r),!0)}forEach(e,r){this._m1.forEach((n,o)=>{e.call(r,n,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};xd.BidirectionalMap=L3t;var F3t=class{static{a(this,"SetMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};xd.SetMap=F3t;function RMo(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[r,n]of t)if(!e.has(r)||e.get(r)!==n)return!1;for(let[r]of e)if(!t.has(r))return!1;return!0}a(RMo,"mapsStrictEqualIgnoreOrder");var U3t=class{static{a(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...r){let n=this._data;for(let o=0;o{let o="";for(let[s,c]of r)o+=`${" ".repeat(n)}${s}: `,c instanceof Map?o+=` `+e(c,n+1):o+=`${c} -`;return o},"printMap");return e(this._data,0)}};Dd.NKeyMap=oQt});var Yu=I(p3=>{"use strict";p();Object.defineProperty(p3,"__esModule",{value:!0});p3.ok=ijo;p3.assertNever=ojo;p3.softAssertNever=sjo;p3.assert=ajo;p3.softAssert=cjo;p3.assertFn=ljo;p3.checkAdjacentItems=ujo;var NIe=Ts();function ijo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(ijo,"ok");function ojo(t,e="Unreachable"){throw new Error(e)}a(ojo,"assertNever");function sjo(t){}a(sjo,"softAssertNever");function ajo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new NIe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(ajo,"assert");function cjo(t,e="Soft Assertion Failed"){t||(0,NIe.onUnexpectedError)(new NIe.BugIndicatingError(e))}a(cjo,"softAssert");function ljo(t){if(!t()){debugger;t(),(0,NIe.onUnexpectedError)(new NIe.BugIndicatingError("Assertion Failed"))}}a(ljo,"assertFn");function ujo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(_l,"__esModule",{value:!0});_l.isOneOf=void 0;_l.isString=sQt;_l.isStringArray=fjo;_l.isArrayOf=P_n;_l.isObject=D_n;_l.isTypedArray=pjo;_l.isNumber=hjo;_l.isIterable=mjo;_l.isAsyncIterable=gjo;_l.isBoolean=Ajo;_l.isUndefined=N_n;_l.isDefined=yjo;_l.isUndefinedOrNull=pKe;_l.assertType=Ejo;_l.assertReturnsDefined=_jo;_l.assertDefined=Cjo;_l.assertReturnsAllDefined=vjo;_l.typeCheck=Sjo;_l.isEmptyObject=Ijo;_l.isFunction=aQt;_l.areFunctions=xjo;_l.validateConstraints=wjo;_l.validateConstraint=M_n;_l.upcast=Rjo;_l.hasKey=kjo;var djo=Yu();function sQt(t){return typeof t=="string"}a(sQt,"isString");function fjo(t){return P_n(t,sQt)}a(fjo,"isStringArray");function P_n(t,e){return Array.isArray(t)&&t.every(e)}a(P_n,"isArrayOf");function D_n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(D_n,"isObject");function pjo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(pjo,"isTypedArray");function hjo(t){return typeof t=="number"&&!isNaN(t)}a(hjo,"isNumber");function mjo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(mjo,"isIterable");function gjo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(gjo,"isAsyncIterable");function Ajo(t){return t===!0||t===!1}a(Ajo,"isBoolean");function N_n(t){return typeof t>"u"}a(N_n,"isUndefined");function yjo(t){return!pKe(t)}a(yjo,"isDefined");function pKe(t){return N_n(t)||t===null}a(pKe,"isUndefinedOrNull");function Ejo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(Ejo,"assertType");function _jo(t){return(0,djo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(_jo,"assertReturnsDefined");function Cjo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(Cjo,"assertDefined");function vjo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");_l.isOneOf=bjo;function Sjo(t){}a(Sjo,"typeCheck");var Tjo=Object.prototype.hasOwnProperty;function Ijo(t){if(!D_n(t))return!1;for(let e in t)if(Tjo.call(t,e))return!1;return!0}a(Ijo,"isEmptyObject");function aQt(t){return typeof t=="function"}a(aQt,"isFunction");function xjo(...t){return t.length>0&&t.every(aQt)}a(xjo,"areFunctions");function wjo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(hKe,"__esModule",{value:!0});hKe.Iterable=void 0;var Pjo=BS(),O_n;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let k=x.length-1;k>=0;k--)yield x[k]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,k){let D=0;for(let N of x)if(k(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,k){let D=0;for(let N of x)if(!k(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,k){for(let D of x)if(k(D))return D}a(m,"find"),t.find=m;function*g(x,k){for(let D of x)k(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,k){let D=0;for(let N of x)yield k(N,D++)}a(A,"map"),t.map=A;function*y(x,k){let D=0;for(let N of x)yield*k(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let k of x)(0,Pjo.isIterable)(k)?yield*k:yield k}a(E,"concat"),t.concat=E;function _(x,k,D){let N=D;for(let L of x)N=k(N,L);return N}a(_,"reduce"),t.reduce=_;function v(x){let k=0;for(let D of x)k++;return k}a(v,"length"),t.length=v;function*b(x,k,D=x.length){for(k<-x.length&&(k=0),k<0&&(k+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);k{"use strict";p();Object.defineProperty(cs,"__esModule",{value:!0});cs.DisposableResourceMap=cs.DisposableSet=cs.DisposableMap=cs.ImmortalReference=cs.AsyncReferenceCollection=cs.ReferenceCollection=cs.RefCountedDisposable=cs.MandatoryMutableDisposable=cs.MutableDisposable=cs.Disposable=cs.DisposableStore=cs.DisposableTracker=cs.GCBasedDisposableTracker=void 0;cs.setDisposableTracker=U_n;cs.trackDisposable=pK;cs.markAsDisposed=hK;cs.markAsSingleton=Ljo;cs.isDisposable=Q_n;cs.dispose=OIe;cs.disposeIfDisposable=Fjo;cs.combinedDisposable=Ujo;cs.toDisposable=EQt;cs.disposeOnReturn=Qjo;cs.thenIfNotDisposed=qjo;cs.thenRegisterOrDispose=jjo;var B_n=El(),Djo=Y7t(),F_n=bP(),Njo=J7t(),Mjo=cQt(),L_n=Ts(),Ojo=!1,fK=null,lQt=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};cs.GCBasedDisposableTracker=lQt;var uQt=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` -`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new F_n.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort((0,B_n.compareBy)(u=>u.idx,B_n.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;h{"use strict";p();Object.defineProperty(Q3t,"__esModule",{value:!0});Q3t.createSingleCallFunction=PMo;function PMo(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(PMo,"createSingleCallFunction")});var Gu=I(FL=>{"use strict";p();Object.defineProperty(FL,"__esModule",{value:!0});FL.ok=kMo;FL.assertNever=DMo;FL.softAssertNever=NMo;FL.assert=MMo;FL.softAssert=OMo;FL.assertFn=BMo;FL.checkAdjacentItems=LMo;var wSe=bs();function kMo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}a(kMo,"ok");function DMo(t,e="Unreachable"){throw new Error(e)}a(DMo,"assertNever");function NMo(t){}a(NMo,"softAssertNever");function MMo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new wSe.BugIndicatingError(`Assertion Failed: ${e}`):e}a(MMo,"assert");function OMo(t,e="Soft Assertion Failed"){t||(0,wSe.onUnexpectedError)(new wSe.BugIndicatingError(e))}a(OMo,"softAssert");function BMo(t){if(!t()){debugger;t(),(0,wSe.onUnexpectedError)(new wSe.BugIndicatingError("Assertion Failed"))}}a(BMo,"assertFn");function LMo(t,e){let r=0;for(;r{"use strict";p();Object.defineProperty(gl,"__esModule",{value:!0});gl.isOneOf=void 0;gl.isString=j3t;gl.isStringArray=UMo;gl.isArrayOf=Kcn;gl.isObject=Jcn;gl.isTypedArray=QMo;gl.isNumber=qMo;gl.isIterable=jMo;gl.isAsyncIterable=HMo;gl.isBoolean=GMo;gl.isUndefined=Zcn;gl.isDefined=$Mo;gl.isUndefinedOrNull=IGe;gl.assertType=VMo;gl.assertReturnsDefined=WMo;gl.assertDefined=zMo;gl.assertReturnsAllDefined=YMo;gl.typeCheck=JMo;gl.isEmptyObject=XMo;gl.isFunction=H3t;gl.areFunctions=eOo;gl.validateConstraints=tOo;gl.validateConstraint=Xcn;gl.upcast=rOo;gl.hasKey=nOo;var FMo=Gu();function j3t(t){return typeof t=="string"}a(j3t,"isString");function UMo(t){return Kcn(t,j3t)}a(UMo,"isStringArray");function Kcn(t,e){return Array.isArray(t)&&t.every(e)}a(Kcn,"isArrayOf");function Jcn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Jcn,"isObject");function QMo(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}a(QMo,"isTypedArray");function qMo(t){return typeof t=="number"&&!isNaN(t)}a(qMo,"isNumber");function jMo(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(jMo,"isIterable");function HMo(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}a(HMo,"isAsyncIterable");function GMo(t){return t===!0||t===!1}a(GMo,"isBoolean");function Zcn(t){return typeof t>"u"}a(Zcn,"isUndefined");function $Mo(t){return!IGe(t)}a($Mo,"isDefined");function IGe(t){return Zcn(t)||t===null}a(IGe,"isUndefinedOrNull");function VMo(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}a(VMo,"assertType");function WMo(t){return(0,FMo.assert)(t!=null,"Argument is `undefined` or `null`."),t}a(WMo,"assertReturnsDefined");function zMo(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}a(zMo,"assertDefined");function YMo(...t){let e=[];for(let r=0;re.includes(t),"isOneOf");gl.isOneOf=KMo;function JMo(t){}a(JMo,"typeCheck");var ZMo=Object.prototype.hasOwnProperty;function XMo(t){if(!Jcn(t))return!1;for(let e in t)if(ZMo.call(t,e))return!1;return!0}a(XMo,"isEmptyObject");function H3t(t){return typeof t=="function"}a(H3t,"isFunction");function eOo(...t){return t.length>0&&t.every(H3t)}a(eOo,"areFunctions");function tOo(t,e){let r=Math.min(t.length,e.length);for(let n=0;n{"use strict";p();Object.defineProperty(xGe,"__esModule",{value:!0});xGe.Iterable=void 0;var iOo=dS(),eln;(function(t){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}a(e,"is"),t.is=e;let r=Object.freeze([]);function n(){return r}a(n,"empty"),t.empty=n;function*o(x){yield x}a(o,"single"),t.single=o;function s(x){return e(x)?x:o(x)}a(s,"wrap"),t.wrap=s;function c(x){return x??r}a(c,"from"),t.from=c;function*l(x){for(let P=x.length-1;P>=0;P--)yield x[P]}a(l,"reverse"),t.reverse=l;function u(x){return!x||x[Symbol.iterator]().next().done===!0}a(u,"isEmpty"),t.isEmpty=u;function d(x){return x[Symbol.iterator]().next().value}a(d,"first"),t.first=d;function f(x,P){let D=0;for(let N of x)if(P(N,D++))return!0;return!1}a(f,"some"),t.some=f;function h(x,P){let D=0;for(let N of x)if(!P(N,D++))return!1;return!0}a(h,"every"),t.every=h;function m(x,P){for(let D of x)if(P(D))return D}a(m,"find"),t.find=m;function*g(x,P){for(let D of x)P(D)&&(yield D)}a(g,"filter"),t.filter=g;function*A(x,P){let D=0;for(let N of x)yield P(N,D++)}a(A,"map"),t.map=A;function*y(x,P){let D=0;for(let N of x)yield*P(N,D++)}a(y,"flatMap"),t.flatMap=y;function*E(...x){for(let P of x)(0,iOo.isIterable)(P)?yield*P:yield P}a(E,"concat"),t.concat=E;function _(x,P,D){let N=D;for(let B of x)N=P(N,B);return N}a(_,"reduce"),t.reduce=_;function v(x){let P=0;for(let D of x)P++;return P}a(v,"length"),t.length=v;function*b(x,P,D=x.length){for(P<-x.length&&(P=0),P<0&&(P+=x.length),D<0?D+=x.length:D>x.length&&(D=x.length);P{"use strict";p();Object.defineProperty(as,"__esModule",{value:!0});as.DisposableResourceMap=as.DisposableSet=as.DisposableMap=as.ImmortalReference=as.AsyncReferenceCollection=as.ReferenceCollection=as.RefCountedDisposable=as.MandatoryMutableDisposable=as.MutableDisposable=as.Disposable=as.DisposableStore=as.DisposableTracker=as.GCBasedDisposableTracker=void 0;as.setDisposableTracker=iln;as.trackDisposable=zz;as.markAsDisposed=Yz;as.markAsSingleton=uOo;as.isDisposable=oln;as.dispose=PSe;as.disposeIfDisposable=dOo;as.combinedDisposable=fOo;as.toDisposable=tFt;as.disposeOnReturn=pOo;as.thenIfNotDisposed=hOo;as.thenRegisterOrDispose=mOo;var tln=ml(),oOo=k3t(),nln=XP(),sOo=q3t(),aOo=G3t(),rln=bs(),cOo=!1,Wz=null,$3t=class{static{a(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let r=new Error("CREATED via:").stack;this._registry.register(e,r,e)}setParent(e,r){r?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};as.GCBasedDisposableTracker=$3t;var V3t=class t{static{a(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new nln.SetMap;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`),u)}n.sort((0,tln.compareBy)(u=>u.idx,tln.numberComparator));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=(0,oOo.groupBy)([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))_&&f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -146,129 +86,158 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};cs.DisposableTracker=uQt;function U_n(t){fK=t}a(U_n,"setDisposableTracker");if(Ojo){let t="__is_disposable_tracked__";U_n(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==yle.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==yle.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function pK(t){return fK?.trackDisposable(t),t}a(pK,"trackDisposable");function hK(t){fK?.markAsDisposed(t)}a(hK,"markAsDisposed");function h3(t,e){fK?.setParent(t,e)}a(h3,"setParentOfDisposable");function Bjo(t,e){if(fK)for(let r of t)fK.setParent(r,e)}a(Bjo,"setParentOfDisposables");function Ljo(t){return fK?.markAsSingleton(t),t}a(Ljo,"markAsSingleton");function Q_n(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(Q_n,"isDisposable");function OIe(t){if(Mjo.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(OIe,"dispose");function Fjo(t){for(let e of t)Q_n(e)&&e.dispose();return[]}a(Fjo,"disposeIfDisposable");function Ujo(...t){let e=EQt(()=>OIe(t));return Bjo(t,e),e}a(Ujo,"combinedDisposable");var dQt=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,pK(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,hK(this),this._fn()}}};function EQt(t){return new dQt(t)}a(EQt,"toDisposable");var MIe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,pK(this)}dispose(){this._isDisposed||(hK(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{OIe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===yle.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return h3(e,this),this._isDisposed?t.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&h3(e,null)}assertNotDisposed(){this._isDisposed&&(0,L_n.onUnexpectedError)(new L_n.BugIndicatingError("Object disposed"))}};cs.DisposableStore=MIe;var yle=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new MIe,pK(this),h3(this._store,this)}dispose(){hK(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};cs.Disposable=yle;var mKe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,pK(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&h3(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,hK(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&h3(e,null),e}};cs.MutableDisposable=mKe;var fQt=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new mKe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};cs.MandatoryMutableDisposable=fQt;var pQt=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};cs.RefCountedDisposable=pQt;var hQt=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,Njo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};cs.ReferenceCollection=hQt;var mQt=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};cs.AsyncReferenceCollection=mQt;var gQt=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};cs.ImmortalReference=gQt;function Qjo(t){let e=new MIe;try{t(e)}finally{e.dispose()}}a(Qjo,"disposeOnReturn");var gKe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,pK(this)}dispose(){hK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{OIe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),h3(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&h3(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};cs.DisposableMap=gKe;var AQt=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,pK(this)}dispose(){hK(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{OIe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),h3(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return h3(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};cs.DisposableSet=AQt;function qjo(t,e){let r=!1;return t.then(n=>{r||e(n)}),EQt(()=>{r=!0})}a(qjo,"thenIfNotDisposed");function jjo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(jjo,"thenRegisterOrDispose");var yQt=class extends gKe{static{a(this,"DisposableResourceMap")}constructor(){super(new F_n.ResourceMap)}};cs.DisposableResourceMap=yQt});var Ele=I(AKe=>{"use strict";p();Object.defineProperty(AKe,"__esModule",{value:!0});AKe.LinkedList=void 0;var du=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},_Qt=class{static{a(this,"LinkedList")}constructor(){this._first=du.Undefined,this._last=du.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===du.Undefined}clear(){let e=this._first;for(;e!==du.Undefined;){let r=e.next;e.prev=du.Undefined,e.next=du.Undefined,e=r}this._first=du.Undefined,this._last=du.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new du(e);if(this._first===du.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==du.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==du.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==du.Undefined)return this._last.element}_remove(e){if(e.prev!==du.Undefined&&e.next!==du.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===du.Undefined&&e.next===du.Undefined?(this._first=du.Undefined,this._last=du.Undefined):e.next===du.Undefined?(this._last=this._last.prev,this._last.next=du.Undefined):e.prev===du.Undefined&&(this._first=this._first.next,this._first.prev=du.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==du.Undefined;)yield e.element,e=e.next}};AKe.LinkedList=_Qt});var G_n=I(_le=>{"use strict";p();Object.defineProperty(_le,"__esModule",{value:!0});_le.getNLSMessages=q_n;_le.getNLSLanguage=j_n;_le.localize=Gjo;_le.localize2=$jo;function q_n(){return globalThis._VSCODE_NLS_MESSAGES}a(q_n,"getNLSMessages");function j_n(){return globalThis._VSCODE_NLS_LANGUAGE}a(j_n,"getNLSLanguage");var Hjo=j_n()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function yKe(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),Hjo&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(yKe,"_format");function Gjo(t,e,...r){return yKe(typeof t=="number"?H_n(t,e):e,r)}a(Gjo,"localize");function H_n(t,e){let r=q_n()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(H_n,"lookupMessage");function $jo(t,e,...r){let n;typeof t=="number"?n=H_n(t,e):n=e;let o=yKe(n,r);return{value:o,original:e===n?o:yKe(e,r)}}a($jo,"localize2")});var eq=I(fr=>{"use strict";p();var Vjo=fr&&fr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wjo=fr&&fr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),zjo=fr&&fr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,UIe=m3.indexOf("Macintosh")>=0,bQt=(m3.indexOf("Macintosh")>=0||m3.indexOf("iPad")>=0||m3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,LIe=m3.indexOf("Linux")>=0,Z_n=m3?.indexOf("Mobi")>=0,vQt=!0,EKe=Yjo.getNLSLanguage()||fr.LANGUAGE_DEFAULT,BIe=navigator.language.toLowerCase(),CQt=BIe):console.error("Unable to resolve platform.");function Jjo(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(Jjo,"PlatformToString");var _Ke=0;UIe?_Ke=1:FIe?_Ke=3:LIe&&(_Ke=2);fr.isWindows=FIe;fr.isMacintosh=UIe;fr.isLinux=LIe;fr.isLinuxSnap=z_n;fr.isNative=Y_n;fr.isElectron=K_n;fr.isWeb=vQt;fr.isWebWorker=vQt&&typeof g3.importScripts=="function";fr.webWorkerOrigin=fr.isWebWorker?g3.origin:void 0;fr.isIOS=bQt;fr.isMobile=Z_n;fr.isCI=J_n;fr.platform=_Ke;fr.userAgent=m3;fr.language=EKe;var $_n;(function(t){function e(){return fr.language}a(e,"value"),t.value=e;function r(){return fr.language.length===2?fr.language==="en":fr.language.length>=3?fr.language[0]==="e"&&fr.language[1]==="n"&&fr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return fr.language==="en"}a(n,"isDefault"),t.isDefault=n})($_n||(fr.Language=$_n={}));fr.locale=BIe;fr.platformLocale=CQt;fr.translationsConfigFile=X_n;fr.setTimeout0IsFaster=typeof g3.postMessage=="function"&&!g3.importScripts;fr.setTimeout0=(()=>{if(fr.setTimeout0IsFaster){let t=[];g3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),g3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();fr.OS=UIe||bQt?2:FIe?1:3;var V_n=!0,W_n=!1;function Zjo(){if(!W_n){W_n=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,V_n=new Uint16Array(t.buffer)[0]===513}return V_n}a(Zjo,"isLittleEndian");fr.isChrome=!!(fr.userAgent&&fr.userAgent.indexOf("Chrome")>=0);fr.isFirefox=!!(fr.userAgent&&fr.userAgent.indexOf("Firefox")>=0);fr.isSafari=!!(!fr.isChrome&&fr.userAgent&&fr.userAgent.indexOf("Safari")>=0);fr.isEdge=!!(fr.userAgent&&fr.userAgent.indexOf("Edg/")>=0);fr.isAndroid=!!(fr.userAgent&&fr.userAgent.indexOf("Android")>=0);function Xjo(t){return parseFloat(t)>=25}a(Xjo,"isTahoeOrNewer")});var QIe=I(aO=>{"use strict";p();Object.defineProperty(aO,"__esModule",{value:!0});aO.arch=aO.platform=aO.env=aO.cwd=void 0;var tCn=eq(),mK,SQt=globalThis.vscode;if(typeof SQt<"u"&&typeof SQt.process<"u"){let t=SQt.process;mK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?mK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:mK={get platform(){return tCn.isWindows?"win32":tCn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};aO.cwd=mK.cwd;aO.env=mK.env;aO.platform=mK.platform;aO.arch=mK.arch});var cO=I(CKe=>{"use strict";p();Object.defineProperty(CKe,"__esModule",{value:!0});CKe.StopWatch=void 0;var eHo=globalThis.performance.now.bind(globalThis.performance),TQt=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:eHo,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}};CKe.StopWatch=TQt});var Sc=I(ja=>{"use strict";p();Object.defineProperty(ja,"__esModule",{value:!0});ja.ValueWithChangeEvent=ja.Relay=ja.EventBufferer=ja.DynamicListEventMultiplexer=ja.EventMultiplexer=ja.MicrotaskEmitter=ja.DebounceEmitter=ja.PauseableEmitter=ja.AsyncEmitter=ja.createEventDeliveryQueue=ja.Emitter=ja.ListenerRefusalError=ja.ListenerLeakError=ja.EventProfiling=ja.Event=void 0;ja.setGlobalLeakWarningThreshold=aHo;ja.trackSetChanges=dHo;var tHo=Y7t(),qIe=Ts(),rHo=J7t(),Nv=ko(),sCn=Ele(),nHo=QIe(),iHo=cO(),rCn=!1,oHo=!1,sHo=100,nCn=6e4;function iCn(){return!!nHo.env.VSCODE_DEV}a(iCn,"_isBufferLeakWarningEnabled");var vKe;(function(t){t.None=()=>Nv.Disposable.None;function e(M){if(oHo){let{onDidAddListener:O}=M,q=vle.create(),F=0;M.onDidAddListener=()=>{++F===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,q){return g(M,()=>{},0,void 0,O??!0,void 0,q)}a(r,"defer"),t.defer=r;function n(M){return(O,q=null,F)=>{let U=!1,W;return W=M(V=>{if(!U)return W?W.dispose():U=!0,O.call(q,V)},null,F),U&&W.dispose(),W}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,q){return h((F,U=null,W)=>M(V=>F.call(U,O(V)),null,W),q)}a(s,"map"),t.map=s;function c(M,O,q){return h((F,U=null,W)=>M(V=>{O(V),F.call(U,V)},null,W),q)}a(c,"forEach"),t.forEach=c;function l(M,O,q){return h((F,U=null,W)=>M(V=>O(V)&&F.call(U,V),null,W),q)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,q=null,F)=>{let U=(0,Nv.combinedDisposable)(...M.map(W=>W(V=>O.call(q,V))));return m(U,F)}}a(d,"any"),t.any=d;function f(M,O,q,F){let U=q;return s(M,W=>(U=O(U,W),U),F)}a(f,"reduce"),t.reduce=f;function h(M,O){let q,F={onWillAddFirstListener(){q=M(U.fire,U)},onDidRemoveLastListener(){q?.dispose()}};O||e(F);let U=new Yy(F);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,q=100,F=!1,U=!1,W,V){let G,Y,re,j=0,X,ie={leakWarningThreshold:W,onWillAddFirstListener(){G=M(Ae=>{j++,Y=O(Y,Ae),F&&!re&&(we.fire(Y),Y=void 0),X=a(()=>{let De=Y;Y=void 0,re=void 0,(!F||j>1)&&we.fire(De),j=0},"doFire"),typeof q=="number"?(re&&clearTimeout(re),re=setTimeout(X,q)):re===void 0&&(re=null,queueMicrotask(X))})},onWillRemoveListener(){U&&j>0&&X?.()},onDidRemoveLastListener(){X=void 0,G.dispose()}};V||e(ie);let we=new Yy(ie);return V?.add(we),we.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,q,F){return t.debounce(M,(U,W)=>U?(U.push(W),U):[W],O,void 0,q??!0,void 0,F)}a(A,"accumulate"),t.accumulate=A;function y(M,O,q=100,F=!0,U=!0,W,V){let G,Y,re,j=0,X={leakWarningThreshold:W,onWillAddFirstListener(){G=M(we=>{j++,Y=O(Y,we),re===void 0&&(F&&(ie.fire(Y),Y=void 0,j=0),typeof q=="number"?re=setTimeout(()=>{U&&j>0&&ie.fire(Y),Y=void 0,re=void 0,j=0},q):(re=0,queueMicrotask(()=>{U&&j>0&&ie.fire(Y),Y=void 0,re=void 0,j=0})))})},onDidRemoveLastListener(){G.dispose()}};V||e(X);let ie=new Yy(X);return V?.add(ie),ie.event}a(y,"throttle"),t.throttle=y;function E(M,O=(F,U)=>F===U,q){let F=!0,U;return l(M,W=>{let V=F||!O(W,U);return F=!1,U=W,V},q)}a(E,"latch"),t.latch=E;function _(M,O,q){return[t.filter(M,O,q),t.filter(M,F=>!O(F),q)]}a(_,"split"),t.split=_;function v(M,O,q=!1,F=[],U){let W=F.slice(),V;iCn()&&(V={stack:vle.create(),timerId:setTimeout(()=>{W&&W.length>0&&V&&!V.warned&&(V.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${W.length} events buffered for ${nCn/1e3}s without being consumed. Buffered here:`),V.stack.print())},nCn),warned:!1},U&&U.add((0,Nv.toDisposable)(()=>clearTimeout(V.timerId))));let G=a(()=>{V&&clearTimeout(V.timerId)},"clearLeakWarningTimer"),Y=M(X=>{W?(W.push(X),iCn()&&V&&!V.warned&&W.length>=sHo&&(V.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${W.length} events buffered without being consumed. Buffered here:`),V.stack.print())):j.fire(X)});U&&U.add(Y);let re=a(()=>{W?.forEach(X=>j.fire(X)),W=null,G()},"flush"),j=new Yy({onWillAddFirstListener(){Y||(Y=M(X=>j.fire(X)),U&&U.add(Y))},onDidAddFirstListener(){W&&(q?setTimeout(re):re())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null,G()}});return U&&U.add(j),j.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((F,U,W)=>{let V=O(new w);return M(function(G){let Y=V.evaluate(G);Y!==T&&F.call(U,Y)},void 0,W)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:T),this}reduce(O,q){let F=q;return this.steps.push(U=>(F=O(F,U),F)),this}latch(O=(q,F)=>q===F){let q=!0,F;return this.steps.push(U=>{let W=q||!O(U,F);return q=!1,F=U,W?U:T}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===T)break;return O}}function R(M,O,q=F=>F){let F=a((...G)=>V.fire(q(...G)),"fn"),U=a(()=>M.on(O,F),"onFirstListenerAdd"),W=a(()=>M.removeListener(O,F),"onLastListenerRemove"),V=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:W});return V.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,q=F=>F){let F=a((...G)=>V.fire(q(...G)),"fn"),U=a(()=>M.addEventListener(O,F),"onFirstListenerAdd"),W=a(()=>M.removeEventListener(O,F),"onLastListenerRemove"),V=new Yy({onWillAddFirstListener:U,onDidRemoveLastListener:W});return V.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function k(M,O){let q,F,U=new Promise(W=>{F=n(M)(W),OQt(F,O),q=a(()=>{oCn(F,O)},"cancelRef")});return U.cancel=q,O&&U.finally(()=>oCn(F,O)),U}a(k,"toPromise"),t.toPromise=k;function D(M,O){return M(q=>O.fire(q))}a(D,"forward"),t.forward=D;function N(M,O,q){return O(q),M(F=>O(F))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class L{static{a(this,"EmitterObserver")}constructor(O,q){this._observable=O,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};q||e(F),this.emitter=new Yy(F),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(M,O){return new L(M,O).emitter.event}a(B,"fromObservable"),t.fromObservable=B;function Q(M){return(O,q,F)=>{let U=0,W=!1,V={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),W&&(W=!1,O.call(q)))},handlePossibleChange(){},handleChange(){W=!0}};M.addObserver(V),M.reportChanges();let G={dispose(){M.removeObserver(V)}};return OQt(G,F),G}}a(Q,"fromObservableLight"),t.fromObservableLight=Q})(vKe||(ja.Event=vKe={}));var bKe=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new iHo.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};ja.EventProfiling=bKe;var jIe=-1;function aHo(t){let e=jIe;return jIe=t,{dispose(){jIe=e}}}a(aHo,"setGlobalLeakWarningThreshold");var IQt=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new HIe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==ice.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==ice.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function zz(t){return Wz?.trackDisposable(t),t}a(zz,"trackDisposable");function Yz(t){Wz?.markAsDisposed(t)}a(Yz,"markAsDisposed");function UL(t,e){Wz?.setParent(t,e)}a(UL,"setParentOfDisposable");function lOo(t,e){if(Wz)for(let r of t)Wz.setParent(r,e)}a(lOo,"setParentOfDisposables");function uOo(t){return Wz?.markAsSingleton(t),t}a(uOo,"markAsSingleton");function oln(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}a(oln,"isDisposable");function PSe(t){if(aOo.Iterable.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(PSe,"dispose");function dOo(t){for(let e of t)oln(e)&&e.dispose();return[]}a(dOo,"disposeIfDisposable");function fOo(...t){let e=tFt(()=>PSe(t));return lOo(t,e),e}a(fOo,"combinedDisposable");var W3t=class{static{a(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,zz(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Yz(this),this._fn()}}};function tFt(t){return new W3t(t)}a(tFt,"toDisposable");var RSe=class t{static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,zz(this)}dispose(){this._isDisposed||(Yz(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{PSe(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===ice.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return UL(e,this),this._isDisposed?t.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&UL(e,null)}assertNotDisposed(){this._isDisposed&&(0,rln.onUnexpectedError)(new rln.BugIndicatingError("Object disposed"))}};as.DisposableStore=RSe;var ice=class{static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new RSe,zz(this),UL(this._store,this)}dispose(){Yz(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};as.Disposable=ice;var wGe=class{static{a(this,"MutableDisposable")}constructor(){this._isDisposed=!1,zz(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&UL(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Yz(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&UL(e,null),e}};as.MutableDisposable=wGe;var z3t=class{static{a(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new wGe,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};as.MandatoryMutableDisposable=z3t;var Y3t=class{static{a(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};as.RefCountedDisposable=Y3t;var K3t=class{static{a(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...r){let n=this.references.get(e);n||(n={counter:0,object:this.createReferencedObject(e,...r)},this.references.set(e,n));let{object:o}=n,s=(0,sOo.createSingleCallFunction)(()=>{--n.counter===0&&(this.destroyReferencedObject(e,n.object),this.references.delete(e))});return n.counter++,{object:o,dispose:s}}};as.ReferenceCollection=K3t;var J3t=class{static{a(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...r){let n=this.referenceCollection.acquire(e,...r);try{return{object:await n.object,dispose:a(()=>n.dispose(),"dispose")}}catch(o){throw n.dispose(),o}}};as.AsyncReferenceCollection=J3t;var Z3t=class{static{a(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};as.ImmortalReference=Z3t;function pOo(t){let e=new RSe;try{t(e)}finally{e.dispose()}}a(pOo,"disposeOnReturn");var RGe=class{static{a(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,zz(this)}dispose(){Yz(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{PSe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,r,n=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),n||this._store.get(e)?.dispose(),this._store.set(e,r),UL(r,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let r=this._store.get(e);return r&&UL(r,null),this._store.delete(e),r}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};as.DisposableMap=RGe;var X3t=class{static{a(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,zz(this)}dispose(){Yz(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{PSe(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),UL(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return UL(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};as.DisposableSet=X3t;function hOo(t,e){let r=!1;return t.then(n=>{r||e(n)}),tFt(()=>{r=!0})}a(hOo,"thenIfNotDisposed");function mOo(t,e){return t.then(r=>(e.isDisposed?r.dispose():e.add(r),r))}a(mOo,"thenRegisterOrDispose");var eFt=class extends RGe{static{a(this,"DisposableResourceMap")}constructor(){super(new nln.ResourceMap)}};as.DisposableResourceMap=eFt});var aln=I(uA=>{"use strict";p();Object.defineProperty(uA,"__esModule",{value:!0});uA.isReadable=AOo;uA.isReadableStream=sln;uA.isReadableBufferedStream=yOo;uA.newWriteableStream=kSe;uA.consumeReadable=EOo;uA.peekReadable=_Oo;uA.consumeStream=vOo;uA.listenStream=kGe;uA.peekStream=COo;uA.toStream=bOo;uA.emptyStream=SOo;uA.toReadable=TOo;uA.transform=IOo;uA.prefixedReadable=xOo;uA.prefixedStream=wOo;var gOo=bs(),PGe=Io();function AOo(t){let e=t;return e?typeof e.read=="function":!1}a(AOo,"isReadable");function sln(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(sln,"isReadableStream");function yOo(t){let e=t;return e?sln(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a(yOo,"isReadableBufferedStream");function kSe(t,e){return new rFt(t,e)}a(kSe,"newWriteableStream");var rFt=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,gOo.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function EOo(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(EOo,"consumeReadable");function _Oo(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(_Oo,"peekReadable");function vOo(t,e){return new Promise((r,n)=>{let o=[];kGe(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(vOo,"consumeStream");function kGe(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(kGe,"listenStream");function COo(t,e){return new Promise((r,n)=>{let o=new PGe.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,PGe.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,PGe.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,PGe.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(COo,"peekStream");function bOo(t,e){let r=kSe(e);return r.end(t),r}a(bOo,"toStream");function SOo(){let t=kSe(()=>{throw new Error("not supported")});return t.end(),t}a(SOo,"emptyStream");function TOo(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(TOo,"toReadable");function IOo(t,e,r){let n=kSe(r);return kGe(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a(IOo,"transform");function xOo(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(xOo,"prefixedReadable");function wOo(t,e,r){let n=!1,o=kSe(r);return kGe(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a(wOo,"prefixedStream")});var k7=I(dc=>{"use strict";p();var ROo=dc&&dc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),POo=dc&&dc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kOo=dc&&dc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),nFt,iFt,Uy=class t{static{a(this,"VSBuffer")}static alloc(e){return DSe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return DSe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&DSe?new t(Buffer.from(e)):(nFt||(nFt=new TextEncoder),new t(nFt.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};dc.VSBuffer=Uy;function uln(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=NOo.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(MOo,"readUInt16LE");function OOo(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(OOo,"writeUInt16LE");function dln(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(dln,"readUInt32BE");function fln(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(fln,"writeUInt32BE");function pln(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(pln,"readUInt32LE");function hln(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(hln,"writeUInt32LE");function mln(t,e){return t[e]}a(mln,"readUInt8");function gln(t,e,r){t[r]=e}a(gln,"writeUInt8");function BOo(t){return P7.consumeReadable(t,e=>Uy.concat(e))}a(BOo,"readableToBuffer");function LOo(t){return P7.toReadable(t)}a(LOo,"bufferToReadable");function Aln(t){return P7.consumeStream(t,e=>Uy.concat(e))}a(Aln,"streamToBuffer");async function FOo(t){return t.ended?Uy.concat(t.buffer):Uy.concat([...t.buffer,await Aln(t.stream)])}a(FOo,"bufferedStreamToBuffer");function UOo(t){return P7.toStream(t,e=>Uy.concat(e))}a(UOo,"bufferToStream");function QOo(t){return P7.transform(t,{data:a(e=>typeof e=="string"?Uy.fromString(e):Uy.wrap(e),"data")},e=>Uy.concat(e))}a(QOo,"streamToBufferReadableStream");function qOo(t){return P7.newWriteableStream(e=>Uy.concat(e),t)}a(qOo,"newWriteableBufferStream");function jOo(t,e){return P7.prefixedReadable(t,e,r=>Uy.concat(r))}a(jOo,"prefixedBufferReadable");function HOo(t,e){return P7.prefixedStream(t,e,r=>Uy.concat(r))}a(HOo,"prefixedBufferStream");function GOo(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return Uy.wrap(o).slice(0,c)}a(GOo,"decodeBase64");var $Oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",VOo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function WOo({buffer:t},e=!0,r=!1){let n=r?VOo:$Oo,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(WOo,"encodeBase64");var cln="0123456789abcdef";function zOo({buffer:t}){let e="";for(let r=0;r>>4],e+=cln[n&15]}return e}a(zOo,"encodeHex");function YOo(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=lln(t,r++)<<4|lln(t,r++);return Uy.wrap(e)}a(YOo,"decodeHex");function lln(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(lln,"decodeHexChar")});var yln=I(DGe=>{"use strict";p();Object.defineProperty(DGe,"__esModule",{value:!0});DGe.readVariableLengthQuantity=JOo;DGe.writeVariableLengthQuantity=ZOo;var KOo=k7();function JOo(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return KOo.VSBuffer.fromByteArray(e)}a(ZOo,"writeVariableLengthQuantity")});var oFt=I(NGe=>{"use strict";p();Object.defineProperty(NGe,"__esModule",{value:!0});NGe.parseTikTokenBinary=void 0;var XOo=require("fs"),e5o=yln(),t5o=k7(),r5o=a(t=>{let e=(0,XOo.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(MGe,"__esModule",{value:!0});MGe.CopilotPromptLoadFailure=void 0;var sFt=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};MGe.CopilotPromptLoadFailure=sFt});var cFt=I(px=>{"use strict";p();var n5o=px&&px.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),i5o=px&&px.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o5o=px&&px.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(hx,"__esModule",{value:!0});hx.initializeTokenizers=hx.ApproximateTokenizer=hx.TTokenizer=hx.TokenizerName=void 0;hx.getTokenizer=p5o;var lFt=VHe(),l5o=oFt(),u5o=aFt(),d5o=cFt(),Jz;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(Jz||(hx.TokenizerName=Jz={}));var vln=new Map;var oce=null;function f5o(t){oce=t}a(f5o,"setExternalTokenizerProvider");hx.setExternalTokenizerProvider=f5o;function p5o(t=Jz.o200k){if(oce)return oce.getTokenizer(t);let e=vln.get(t);return e!==void 0||(e=vln.get(Jz.o200k),e!==void 0)?e:new OGe}a(p5o,"getTokenizer");var dFt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,lFt.createTokenizer)((0,l5o.parseTikTokenBinary)((0,d5o.locateFile)(`${e}.tiktoken`)),(0,lFt.getSpecialTokensByEncoder)(e),(0,lFt.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new u5o.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-uFt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-uFt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?h5o[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`)return n;let o=n.indexOf(` +`);return n.substring(o+1)}};hx.ApproximateTokenizer=OGe;hx.initializeTokenizers={then(t,e){return(oce&&typeof oce.ensureLoaded=="function"?oce.ensureLoaded():Promise.resolve()).then(t,e)},catch(t){return this.then(void 0,t)},finally(t){return this.then(e=>(t&&t(),e),e=>{throw t&&t(),e})}}});var Cln=I(pFt=>{"use strict";p();Object.defineProperty(pFt,"__esModule",{value:!0});pFt.assertNever=m5o;function m5o(t,e=`unexpected value ${t}`){throw new Error(`Unreachable: ${e}`)}a(m5o,"assertNever")});var NSe=I(QL=>{"use strict";p();Object.defineProperty(QL,"__esModule",{value:!0});QL.ChatCompletionContentPartOpaque=QL.ChatCompletionContentPartKind=QL.ChatRole=void 0;var g5o=Cln(),BGe;(function(t){t[t.System=0]="System",t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.Tool=3]="Tool"})(BGe||(QL.ChatRole=BGe={}));(function(t){function e(r){switch(r){case t.System:return"system";case t.User:return"user";case t.Assistant:return"assistant";case t.Tool:return"tool";default:(0,g5o.assertNever)(r,`unknown chat role ${r}}`)}}a(e,"display"),t.display=e})(BGe||(QL.ChatRole=BGe={}));var bln;(function(t){t[t.Image=0]="Image",t[t.Text=1]="Text",t[t.Opaque=2]="Opaque",t[t.CacheBreakpoint=3]="CacheBreakpoint",t[t.Document=4]="Document"})(bln||(QL.ChatCompletionContentPartKind=bln={}));var Sln;(function(t){function e(r,n){return!r.scope||(r.scope&n)!==0}a(e,"usableIn"),t.usableIn=e})(Sln||(QL.ChatCompletionContentPartOpaque=Sln={}))});var hFt=I(xM=>{"use strict";p();Object.defineProperty(xM,"__esModule",{value:!0});xM.BaseTokensPerName=xM.BaseTokensPerMessage=xM.BaseTokensPerCompletion=xM.ChatRole=void 0;var Tln;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(Tln||(xM.ChatRole=Tln={}));xM.BaseTokensPerCompletion=3;xM.BaseTokensPerMessage=3;xM.BaseTokensPerName=1});var Rln=I(FGe=>{"use strict";p();Object.defineProperty(FGe,"__esModule",{value:!0});FGe.toOpenAiChatMessage=wln;FGe.toOpenAIChatMessages=y5o;var wM=NSe(),LGe=hFt(),A5o=D7();function Iln(t){return t.filter(e=>e.type===wM.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(Iln,"onlyStringContent");function xln(t){let e=t.map(r=>{if(r.type===wM.ChatCompletionContentPartKind.Text)return{type:"text",text:r.text};if(r.type===wM.ChatCompletionContentPartKind.Image)return{image_url:r.imageUrl,type:"image_url"};if(r.type===wM.ChatCompletionContentPartKind.Document)return;if(r.type===wM.ChatCompletionContentPartKind.Opaque&&wM.ChatCompletionContentPartOpaque.usableIn(r,A5o.OutputMode.OpenAI))return r.value}).filter(r=>!!r);return e.every(r=>r.type==="text")?e.map(r=>r.text).join(""):e}a(xln,"stringAndImageContent");function wln(t){switch(t.role){case wM.ChatRole.System:return{role:LGe.ChatRole.System,content:Iln(t.content),name:t.name};case wM.ChatRole.User:return{role:LGe.ChatRole.User,content:xln(t.content),name:t.name};case wM.ChatRole.Assistant:return{role:LGe.ChatRole.Assistant,content:Iln(t.content),name:t.name,tool_calls:t.toolCalls?.map(e=>({id:e.id,function:e.function,type:"function"}))};case wM.ChatRole.Tool:return{role:LGe.ChatRole.Tool,content:xln(t.content),tool_call_id:t.toolCallId};default:return}}a(wln,"toOpenAiChatMessage");function y5o(t){return t.map(wln).filter(e=>!!e)}a(y5o,"toOpenAIChatMessages")});var kln=I(qGe=>{"use strict";p();Object.defineProperty(qGe,"__esModule",{value:!0});qGe.toVsCodeChatMessage=Pln;qGe.toVsCodeChatMessages=E5o;var QGe=NSe();function UGe(t){return t.filter(e=>e.type===QGe.ChatCompletionContentPartKind.Text).map(e=>e.text).join("")}a(UGe,"onlyStringContent");var N7;function Pln(t){switch(N7??=require("vscode"),t.role){case QGe.ChatRole.Assistant:let e=N7.LanguageModelChatMessage.Assistant(UGe(t.content),t.name);return t.toolCalls&&(e.content=[new N7.LanguageModelTextPart(UGe(t.content)),...t.toolCalls.map(r=>{let n;try{n=JSON.parse(r.function.arguments)}catch{throw new Error("Invalid JSON in tool call arguments for tool call: "+r.id)}return new N7.LanguageModelToolCallPart(r.id,r.function.name,n)})]),e;case QGe.ChatRole.User:return N7.LanguageModelChatMessage.User(UGe(t.content),t.name);case QGe.ChatRole.Tool:{let r=N7.LanguageModelChatMessage.User("");return r.content=[new N7.LanguageModelToolResultPart(t.toolCallId,[new N7.LanguageModelTextPart(UGe(t.content))])],r}default:return}}a(Pln,"toVsCodeChatMessage");function E5o(t){return t.map(Pln).filter(e=>!!e)}a(E5o,"toVsCodeChatMessages")});var D7=I(ek=>{"use strict";p();Object.defineProperty(ek,"__esModule",{value:!0});ek.OutputMode=ek.Raw=ek.OpenAI=void 0;ek.toMode=mFt;ek.toVSCode=_5o;ek.toOpenAI=v5o;var Dln=Rln(),Nln=kln();ek.OpenAI=hFt();ek.Raw=NSe();var Zz;(function(t){t[t.Raw=1]="Raw",t[t.OpenAI=2]="OpenAI",t[t.VSCode=4]="VSCode"})(Zz||(ek.OutputMode=Zz={}));function mFt(t,e){switch(t){case Zz.Raw:return e;case Zz.VSCode:return e instanceof Array?(0,Nln.toVsCodeChatMessages)(e):(0,Nln.toVsCodeChatMessage)(e);case Zz.OpenAI:return e instanceof Array?(0,Dln.toOpenAIChatMessages)(e):(0,Dln.toOpenAiChatMessage)(e);default:throw new Error(`Unknown output mode: ${t}`)}}a(mFt,"toMode");function _5o(t){return mFt(Zz.VSCode,t)}a(_5o,"toVSCode");function v5o(t){return mFt(Zz.OpenAI,t)}a(v5o,"toOpenAI")});var gFt=I(MSe=>{"use strict";p();Object.defineProperty(MSe,"__esModule",{value:!0});MSe.jsonRetainedProps=void 0;MSe.forEachNode=Mln;MSe.jsonRetainedProps=Object.keys({flexBasis:1,flexGrow:1,flexReserve:1,passPriority:1,priority:1});function Mln(t,e){if(e(t),t.type===1)for(let r of t.children)Mln(r,e)}a(Mln,"forEachNode")});var Oln=I(AFt=>{"use strict";p();Object.defineProperty(AFt,"__esModule",{value:!0});AFt.once=C5o;function C5o(t){let e,r=!1,n=a(((...o)=>(r||(e=t(...o),r=!0),e)),"wrappedFunction");return n.clear=()=>{r=!1},n}a(C5o,"once")});var vFt=I(zm=>{"use strict";p();Object.defineProperty(zm,"__esModule",{value:!0});zm.BudgetExceededError=zm.MaterializedChatMessageDocument=zm.MaterializedChatMessageImage=zm.MaterializedChatMessageBreakpoint=zm.MaterializedChatMessageOpaque=zm.MaterializedChatMessage=zm.MaterializedChatMessageTextChunk=zm.GenericMaterializedContainer=void 0;var Xz=Oln(),dA=D7(),qL=class t{static{a(this,"GenericMaterializedContainer")}parent;id;name;priority;metadata;flags;children;keepWithId;constructor(e,r,n,o,s,c,l){if(this.parent=e,this.id=r,this.name=n,this.priority=o,this.metadata=c,this.flags=l,this.children=s(this),l&8){if(this.children.length!==2)throw new Error("Invalid number of children for EmptyAlternate flag");let[u,d]=this.children;d.isEmpty?this.children=[u]:this.children=[d]}}has(e){return!!(this.flags&e)}async tokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=O7(n)?await n.tokenCount(e):await n.upperBoundTokenCount(e);r+=o})),r}async upperBoundTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r}replaceNode(e,r){return Gln(e,this.children,r)}allMetadata(){return Hln(this)}findById(e){return _Ft(e,this)}get isEmpty(){return!this.children.some(e=>!e.isEmpty)}onChunksChange(){this.parent?.onChunksChange()}*toChatMessages(){for(let e of this.children)b5o(e),e instanceof t?yield*e.toChatMessages():!e.isEmpty&&e instanceof rk&&(yield e.toChatMessage())}async baseMessageTokenCount(e){let r=0;return await Promise.all(this.children.map(async n=>{if(n instanceof rk||n instanceof t){let o=await n.baseMessageTokenCount(e);r+=o}})),r}removeLowestPriorityChild(){let e=[];return EFt(this,e),e}};zm.GenericMaterializedContainer=qL;var OSe=class{static{a(this,"MaterializedChatMessageTextChunk")}parent;text;priority;metadata;lineBreakBefore;constructor(e,r,n,o=[],s){this.parent=e,this.text=r,this.priority=n,this.metadata=o,this.lineBreakBefore=s}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,Xz.once)(async e=>await e.tokenLength({type:dA.Raw.ChatCompletionContentPartKind.Text,text:this.text})+(this.lineBreakBefore!==0?1:0));get isEmpty(){return!/\S/.test(this.text)}};zm.MaterializedChatMessageTextChunk=OSe;var rk=class{static{a(this,"MaterializedChatMessage")}parent;id;role;name;toolCalls;toolCallId;priority;metadata;children;constructor(e,r,n,o,s,c,l,u,d){this.parent=e,this.id=r,this.role=n,this.name=o,this.toolCalls=s,this.toolCallId=c,this.priority=l,this.metadata=u,this.children=d(this)}async tokenCount(e){return this._tokenCount(e)}async upperBoundTokenCount(e){return this._upperBound(e)}get text(){return this._text()}get isEmpty(){return!this.toolCalls?.length&&!this.children.some(e=>!e.isEmpty)}replaceNode(e,r){let n=Gln(e,this.children,r);return n&&this.onChunksChange(),n}removeLowestPriorityChild(){let e=[];return EFt(this,e),e}onChunksChange(){this._tokenCount.clear(),this._upperBound.clear(),this._text.clear(),this.parent?.onChunksChange()}findById(e){return _Ft(e,this)}_tokenCount=(0,Xz.once)(async e=>{let r=this.toChatMessage();return e.countMessageTokens((0,dA.toMode)(e.mode,r))});_upperBound=(0,Xz.once)(async e=>{let r=await this.baseMessageTokenCount(e);return await Promise.all(this.children.map(async n=>{let o=await n.upperBoundTokenCount(e);r+=o})),r});baseMessageTokenCount=(0,Xz.once)(e=>{let r=this.toChatMessage();return r.content=r.content.map(n=>n.type===dA.Raw.ChatCompletionContentPartKind.Text?{...n,text:""}:n.type===dA.Raw.ChatCompletionContentPartKind.Image||n.type===dA.Raw.ChatCompletionContentPartKind.Document?void 0:n).filter(n=>!!n),e.countMessageTokens((0,dA.toMode)(e.mode,r))});_text=(0,Xz.once)(()=>{let e=[];for(let{content:r,isTextSibling:n}of qln(this)){if(r instanceof eY||r instanceof tY||r instanceof M7){e.push(r);continue}if(r instanceof tk){e.at(-1)instanceof tk?e[e.length-1]=r:e.push(r);continue}if(r.lineBreakBefore===1||r.lineBreakBefore===2&&!n){let o=e[e.length-1];typeof o=="string"&&o&&!o.endsWith(` +`)&&(e[e.length-1]=o+` +`)}typeof e[e.length-1]=="string"?e[e.length-1]+=r.text:e.push(r.text)}return e});toChatMessage(){let e=this.text.map(r=>{if(typeof r=="string")return{type:dA.Raw.ChatCompletionContentPartKind.Text,text:r};if(r instanceof eY)return{type:dA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:$ln(r.src),detail:r.detail,...r.mimeType?{mediaType:r.mimeType}:{}}};if(r instanceof tY)return{type:dA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:r.data,mediaType:r.mediaType}};if(r instanceof M7)return{type:dA.Raw.ChatCompletionContentPartKind.Opaque,value:r.value};if(r instanceof tk)return r.part;throw new Error("Unexpected element type")});if(this.role===dA.Raw.ChatRole.System)return{role:this.role,content:e,...this.name?{name:this.name}:{}};if(this.role===dA.Raw.ChatRole.Assistant){let r={role:this.role,content:e};return this.name&&(r.name=this.name),this.toolCalls?.length&&(r.toolCalls=this.toolCalls.map(n=>({function:n.function,id:n.id,type:n.type}))),r}else return this.role===dA.Raw.ChatRole.User?{role:this.role,content:e,...this.name?{name:this.name}:{}}:this.role===dA.Raw.ChatRole.Tool?{role:this.role,content:e,toolCallId:this.toolCallId}:{role:this.role,content:e,name:this.name}}};zm.MaterializedChatMessage=rk;var M7=class{static{a(this,"MaterializedChatMessageOpaque")}parent;part;priority;metadata=[];get value(){return this.part.value}constructor(e,r,n=Number.MAX_SAFE_INTEGER){this.parent=e,this.part=r,this.priority=n}upperBoundTokenCount(e){return this.part.tokenUsage&&dA.Raw.ChatCompletionContentPartOpaque.usableIn(this.part,e.mode)?this.part.tokenUsage:0}isEmpty=!1};zm.MaterializedChatMessageOpaque=M7;var tk=class{static{a(this,"MaterializedChatMessageBreakpoint")}parent;part;metadata=[];priority=Number.MAX_SAFE_INTEGER;constructor(e,r){this.parent=e,this.part=r}upperBoundTokenCount(e){return 0}isEmpty=!1};zm.MaterializedChatMessageBreakpoint=tk;var eY=class{static{a(this,"MaterializedChatMessageImage")}parent;id;src;priority;metadata;lineBreakBefore;detail;mimeType;constructor(e,r,n,o,s=[],c,l,u){this.parent=e,this.id=r,this.src=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c,this.detail=l,this.mimeType=u}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,Xz.once)(async e=>e.tokenLength({type:dA.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:$ln(this.src),detail:this.detail,mediaType:this.mimeType}}));isEmpty=!1};zm.MaterializedChatMessageImage=eY;var tY=class{static{a(this,"MaterializedChatMessageDocument")}parent;id;data;mediaType;priority;metadata;lineBreakBefore;constructor(e,r,n,o,s,c=[],l){this.parent=e,this.id=r,this.data=n,this.mediaType=o,this.priority=s,this.metadata=c,this.lineBreakBefore=l}upperBoundTokenCount(e){return this._upperBound(e)}_upperBound=(0,Xz.once)(async e=>e.tokenLength({type:dA.Raw.ChatCompletionContentPartKind.Document,documentData:{data:this.data,mediaType:this.mediaType}}));isEmpty=!1};zm.MaterializedChatMessageDocument=tY;function O7(t){return t instanceof qL||t instanceof rk}a(O7,"isContainerType");function Qln(t){return t instanceof OSe||t instanceof eY||t instanceof tY||t instanceof M7||t instanceof tk}a(Qln,"isContentType");function b5o(t){if(!O7(t))throw new Error(`Cannot have a text node outside a ChatMessage. Text: "${t.text}"`)}a(b5o,"assertContainerOrChatMessage");function*qln(t,e=!1){for(let r of t.children)r instanceof OSe?(yield{content:r,isTextSibling:e},e=!0):r instanceof eY||r instanceof tY||r instanceof M7||r instanceof tk?yield{content:r,isTextSibling:!1}:r instanceof M7?yield{content:r,isTextSibling:!0}:(r&&(yield*qln(r,e)),e=!1)}a(qln,"contentChunks");function S5o(t,e){let r;function n(o,s){if(Qln(o))(!r||o.priorityn instanceof tk):t instanceof qL&&(r=t.children.some(jln)),Bln.set(t,r),r}a(jln,"hasCachePoint");function T5o(t){if(t instanceof rk)return!0;for(let e=t.parent;e;e=e.parent)if(e instanceof rk)return!1;return!0}a(T5o,"shouldLookForCachePointInNode");function EFt(t,e){let r;if(t instanceof qL&&t.has(1)){S5o(t,e);return}let n=T5o(t),o=t.children.map((s,c)=>({chain:[t],index:c}));for(let s=0;s({chain:d,index:h})))}else if(!r||u.priorityo instanceof rk?o.role:o.name||"(anonymous)");super(`No lowest priority node found (path: ${n.join(" -> ")})`)}};zm.BudgetExceededError=jGe;function Lln(t){if(!O7(t))return-1;let e=Number.MAX_SAFE_INTEGER;for(let r of t.children)e=Math.min(e,r.priority);return e}a(Lln,"getLowestPriorityAmongChildren");function*Hln(t){yield*t.metadata;for(let e of t.children)O7(e)?yield*Hln(e):yield*e.metadata}a(Hln,"allMetadata");function Gln(t,e,r){for(let n=0;n0;){let r=e.pop();yield r,O7(r)&&e.push(...r.children)}}a(Fln,"forEachNode");function I5o(t){let e=t;for(;e.parent;)e=e.parent;return e}a(I5o,"getRoot");function Uln(t){return t instanceof qL&&t.keepWithId!==void 0}a(Uln,"isKeepWith");var yFt=new Set;function x5o(t,e){let r=new Set;for(let n of Fln(t))Uln(n)&&!yFt.has(n.keepWithId)&&r.add(n.keepWithId);if(r.size===0)return!1;for(let n of r)yFt.add(n);try{let n=I5o(t);for(let o of Fln(n))Uln(o)&&r.has(o.keepWithId)?BSe(o,e):o instanceof rk&&o.toolCalls&&(o.toolCalls=w5o(o.toolCalls,s=>!(s.keepWith&&r.has(s.keepWith.id))),o.isEmpty&&BSe(o,e))}finally{for(let n of r)yFt.delete(n)}}a(x5o,"removeOtherKeepWiths");function _Ft(t,e){if(e.id===t)return e;for(let r of e.children)if(O7(r)){let n=_Ft(t,r);if(n)return n}}a(_Ft,"findNodeById");function BSe(t,e){let r=t.parent;if(!r)return;let n=r.children.indexOf(t);n!==-1&&(r.children.splice(n,1),e.push(t),x5o(t,e),r.isEmpty?BSe(r,e):r.onChunksChange())}a(BSe,"removeNode");function $ln(t){let e={"/9j/":"image/jpeg",iVBOR:"image/png",R0lGOD:"image/gif",UklGR:"image/webp"};for(let r of Object.keys(e))if(t.startsWith(r))return`data:${e[r]};base64,${t}`;return t}a($ln,"getEncodedBase64");function w5o(t,e){for(let r=0;r{"use strict";p();function R5o(t,e,...r){return{ctor:t,props:e,children:r.flat()}}a(R5o,"_vscpp");function Vln(){throw new Error("This should not be invoked!")}a(Vln,"_vscppf");Vln.isFragment=!0;globalThis.vscpp=R5o;globalThis.vscppf=Vln});var bFt=I(HGe=>{"use strict";p();Object.defineProperty(HGe,"__esModule",{value:!0});HGe.PromptElement=void 0;Wln();var CFt=class{static{a(this,"PromptElement")}props;get priority(){return this.props.priority??Number.MAX_SAFE_INTEGER}get insertLineBreakBefore(){return!0}constructor(e){this.props=e}};HGe.PromptElement=CFt});var MFt=I(Ns=>{"use strict";p();Object.defineProperty(Ns,"__esModule",{value:!0});Ns.LogicalWrapper=Ns.IfEmpty=Ns.AbstractKeepWith=Ns.TokenLimit=Ns.Expandable=Ns.Chunk=Ns.LegacyPrioritization=Ns.ToolResult=Ns.PrioritizedList=Ns.Document=Ns.Image=Ns.TextChunk=Ns.ToolMessage=Ns.AssistantMessage=Ns.UserMessage=Ns.SystemMessage=Ns.BaseChatMessage=void 0;Ns.isChatMessagePromptElement=P5o;Ns.useKeepWith=M5o;var FSe=xo(),fS=bFt();function P5o(t){return t instanceof GGe||t instanceof $Ge||t instanceof VGe}a(P5o,"isChatMessagePromptElement");var rY=class extends fS.PromptElement{static{a(this,"BaseChatMessage")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.BaseChatMessage=rY;var GGe=class extends rY{static{a(this,"SystemMessage")}constructor(e){e.role=FSe.Raw.ChatRole.System,super(e)}};Ns.SystemMessage=GGe;var $Ge=class extends rY{static{a(this,"UserMessage")}constructor(e){e.role=FSe.Raw.ChatRole.User,super(e)}};Ns.UserMessage=$Ge;var VGe=class extends rY{static{a(this,"AssistantMessage")}constructor(e){e.role=FSe.Raw.ChatRole.Assistant,super(e)}};Ns.AssistantMessage=VGe;var k5o=/\s+/g,SFt=class extends rY{static{a(this,"ToolMessage")}constructor(e){e.role=FSe.Raw.ChatRole.Tool,super(e)}};Ns.ToolMessage=SFt;var WGe=class extends fS.PromptElement{static{a(this,"TextChunk")}async prepare(e,r,n){let o=this.props.breakOnWhitespace?k5o:this.props.breakOn;if(!o)return vscpp(vscppf,null,this.props.children);let s="",c=[];for(let u of this.props.children||[])if(u&&typeof u=="object"){if(typeof u.ctor!="string")throw new Error("TextChunk children must be text literals or intrinsic attributes.");u.ctor==="br"?s+=` +`:c.push(u)}else u!=null&&(s+=u);let l=await D5o(e,o,s,n);return vscpp(vscppf,null,c,l)}render(e){return e}};Ns.TextChunk=WGe;async function D5o(t,e,r,n){if(e instanceof RegExp){if(!e.global)throw new Error(`\`breakOn\` expression must have the global flag set (got ${e})`);e.lastIndex=0}let o="",s=-1;for(;st.tokenBudget)return o;o=l,s=c}return o}a(D5o,"getTextContentBelowBudget");var TFt=class extends fS.PromptElement{static{a(this,"Image")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Image=TFt;var IFt=class extends fS.PromptElement{static{a(this,"Document")}constructor(e){super(e)}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Document=IFt;var xFt=class extends fS.PromptElement{static{a(this,"PrioritizedList")}render(){let{children:e,priority:r=0,descending:n}=this.props;if(e)return vscpp(vscppf,null,e.map((o,s)=>{if(!o)return;let c=n?r-s:r-e.length+s;return typeof o!="object"?vscpp(WGe,{priority:c},o):(o.props??={},o.props.priority=c,o)}))}};Ns.PrioritizedList=xFt;var wFt=class extends fS.PromptElement{static{a(this,"ToolResult")}render(){return vscpp(vscppf,null,this.props.data.content.map(e=>{if(e&&typeof e.value=="string")return e.value;if(e&&e.value&&typeof e.value.node=="object")return vscpp("elementJSON",{data:e.value})}))}};Ns.ToolResult=wFt;var RFt=class extends fS.PromptElement{static{a(this,"LegacyPrioritization")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.LegacyPrioritization=RFt;var PFt=class extends fS.PromptElement{static{a(this,"Chunk")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.Chunk=PFt;var kFt=class extends fS.PromptElement{static{a(this,"Expandable")}async render(e,r){return vscpp(vscppf,null,await this.props.value(r))}};Ns.Expandable=kFt;var DFt=class extends fS.PromptElement{static{a(this,"TokenLimit")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.TokenLimit=DFt;var zGe=class extends fS.PromptElement{static{a(this,"AbstractKeepWith")}};Ns.AbstractKeepWith=zGe;var N5o=0;function M5o(){let t=N5o++;return class extends zGe{static{a(this,"KeepWith")}static id=t;id=t;render(){return vscpp(vscppf,null,this.props.children)}}}a(M5o,"useKeepWith");var NFt=class extends fS.PromptElement{static{a(this,"IfEmpty")}render(){return vscpp(vscppf,null,vscpp(LSe,null,this.props.alt),vscpp(LSe,{flexGrow:1},this.props.children))}};Ns.IfEmpty=NFt;var LSe=class extends fS.PromptElement{static{a(this,"LogicalWrapper")}render(){return vscpp(vscppf,null,this.props.children)}};Ns.LogicalWrapper=LSe});var Yln=I(USe=>{"use strict";p();Object.defineProperty(USe,"__esModule",{value:!0});USe.localize=O5o;USe.localize2=B5o;USe.getConfiguredDefaultLocale=L5o;function zln(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,function(n,o){let s=o[0];return typeof e[s]<"u"?e[s]:n}),r}a(zln,"_format");function O5o(t,e,...r){return zln(e,r)}a(O5o,"localize");function B5o(t,e,...r){let n=zln(e,r);return{original:n,value:n}}a(B5o,"localize2");function L5o(t){}a(L5o,"getConfiguredDefaultLocale")});var FFt=I(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isAndroid=Sr.isEdge=Sr.isSafari=Sr.isFirefox=Sr.isChrome=Sr.OS=Sr.setTimeout0=Sr.setTimeout0IsFaster=Sr.translationsConfigFile=Sr.platformLocale=Sr.locale=Sr.Language=Sr.language=Sr.userAgent=Sr.platform=Sr.isCI=Sr.isMobile=Sr.isIOS=Sr.webWorkerOrigin=Sr.isWebWorker=Sr.isWeb=Sr.isElectron=Sr.isNative=Sr.isLinuxSnap=Sr.isLinux=Sr.isMacintosh=Sr.isWindows=Sr.LANGUAGE_DEFAULT=void 0;Sr.PlatformToString=U5o;Sr.isLittleEndian=Q5o;Sr.isBigSurOrNewer=q5o;var Kln=Yln();Sr.LANGUAGE_DEFAULT="en";var jSe=!1,HSe=!1,qSe=!1,eun=!1,tun=!1,BFt=!1,nun=!1,LFt=!1,iun=!1,oun=!1,QSe,YGe=Sr.LANGUAGE_DEFAULT,OFt=Sr.LANGUAGE_DEFAULT,sun,jL,HL=globalThis,pS;typeof HL.vscode<"u"&&typeof HL.vscode.process<"u"?pS=HL.vscode.process:typeof process<"u"&&(pS=process);var aun=typeof pS?.versions?.electron=="string",F5o=aun&&pS?.type==="renderer";if(typeof pS=="object"){jSe=pS.platform==="win32",HSe=pS.platform==="darwin",qSe=pS.platform==="linux",eun=qSe&&!!pS.env.SNAP&&!!pS.env.SNAP_REVISION,nun=aun,iun=!!pS.env.CI||!!pS.env.BUILD_ARTIFACTSTAGINGDIRECTORY,QSe=Sr.LANGUAGE_DEFAULT,YGe=Sr.LANGUAGE_DEFAULT;let t=pS.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t),r=e.availableLanguages["*"];QSe=e.locale,OFt=e.osLocale,YGe=r||Sr.LANGUAGE_DEFAULT,sun=e._translationsConfigFile}catch{}tun=!0}else typeof navigator=="object"&&!F5o?(jL=navigator.userAgent,jSe=jL.indexOf("Windows")>=0,HSe=jL.indexOf("Macintosh")>=0,LFt=(jL.indexOf("Macintosh")>=0||jL.indexOf("iPad")>=0||jL.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,qSe=jL.indexOf("Linux")>=0,oun=jL?.indexOf("Mobi")>=0,BFt=!0,QSe=Kln.getConfiguredDefaultLocale(Kln.localize({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"))||Sr.LANGUAGE_DEFAULT,YGe=QSe,OFt=navigator.language):console.error("Unable to resolve platform.");function U5o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(U5o,"PlatformToString");var KGe=0;HSe?KGe=1:jSe?KGe=3:qSe&&(KGe=2);Sr.isWindows=jSe;Sr.isMacintosh=HSe;Sr.isLinux=qSe;Sr.isLinuxSnap=eun;Sr.isNative=tun;Sr.isElectron=nun;Sr.isWeb=BFt;Sr.isWebWorker=BFt&&typeof HL.importScripts=="function";Sr.webWorkerOrigin=Sr.isWebWorker?HL.origin:void 0;Sr.isIOS=LFt;Sr.isMobile=oun;Sr.isCI=iun;Sr.platform=KGe;Sr.userAgent=jL;Sr.language=YGe;var Jln;(function(t){function e(){return Sr.language}a(e,"value"),t.value=e;function r(){return Sr.language.length===2?Sr.language==="en":Sr.language.length>=3?Sr.language[0]==="e"&&Sr.language[1]==="n"&&Sr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return Sr.language==="en"}a(n,"isDefault"),t.isDefault=n})(Jln||(Sr.Language=Jln={}));Sr.locale=QSe;Sr.platformLocale=OFt;Sr.translationsConfigFile=sun;Sr.setTimeout0IsFaster=typeof HL.postMessage=="function"&&!HL.importScripts;Sr.setTimeout0=(()=>{if(Sr.setTimeout0IsFaster){let t=[];HL.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),HL.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();Sr.OS=HSe||LFt?2:jSe?1:3;var Zln=!0,Xln=!1;function Q5o(){if(!Xln){Xln=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,Zln=new Uint16Array(t.buffer)[0]===513}return Zln}a(Q5o,"isLittleEndian");Sr.isChrome=!!(Sr.userAgent&&Sr.userAgent.indexOf("Chrome")>=0);Sr.isFirefox=!!(Sr.userAgent&&Sr.userAgent.indexOf("Firefox")>=0);Sr.isSafari=!!(!Sr.isChrome&&Sr.userAgent&&Sr.userAgent.indexOf("Safari")>=0);Sr.isEdge=!!(Sr.userAgent&&Sr.userAgent.indexOf("Edg/")>=0);Sr.isAndroid=!!(Sr.userAgent&&Sr.userAgent.indexOf("Android")>=0);function q5o(t){return parseFloat(t)>=20}a(q5o,"isBigSurOrNewer")});var lun=I(RM=>{"use strict";p();Object.defineProperty(RM,"__esModule",{value:!0});RM.arch=RM.platform=RM.env=RM.cwd=void 0;var cun=FFt(),nY,UFt=globalThis.vscode;if(typeof UFt<"u"&&typeof UFt.process<"u"){let t=UFt.process;nY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"?nY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:nY={get platform(){return cun.isWindows?"win32":cun.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};RM.cwd=nY.cwd;RM.env=nY.env;RM.platform=nY.platform;RM.arch=nY.arch});var dun=I(pn=>{"use strict";p();Object.defineProperty(pn,"__esModule",{value:!0});pn.delimiter=pn.sep=pn.toNamespacedPath=pn.parse=pn.format=pn.extname=pn.basename=pn.dirname=pn.relative=pn.resolve=pn.join=pn.isAbsolute=pn.normalize=pn.posix=pn.win32=void 0;var sce=lun(),j5o=65,H5o=97,G5o=90,$5o=122,F7=46,Ym=47,pC=92,B7=58,V5o=63,JGe=class extends Error{static{a(this,"ErrorInvalidArgType")}code;constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function W5o(t,e){if(t===null||typeof t!="object")throw new JGe(e,"Object",t)}a(W5o,"validateObject");function Vf(t,e){if(typeof t!="string")throw new JGe(e,"string",t)}a(Vf,"validateString");var hC=sce.platform==="win32";function Jo(t){return t===Ym||t===pC}a(Jo,"isPathSeparator");function QFt(t){return t===Ym}a(QFt,"isPosixPathSeparator");function L7(t){return t>=j5o&&t<=G5o||t>=H5o&&t<=$5o}a(L7,"isWindowsDeviceRoot");function ZGe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===F7&&l!==-1?++l:l=-1}return o}a(ZGe,"normalizeString");function uun(t,e){W5o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${e.ext||""}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(uun,"_format");pn.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Vf(s,"path"),s.length===0)continue}else e.length===0?s=sce.cwd():(s=sce.env[`=${e}`]||sce.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===pC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Jo(f)&&(l=1,d=!0);else if(Jo(f))if(d=!0,Jo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Jo(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=ZGe(r,!n,"\\",Jo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Vf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return QFt(s)?"\\":t;if(Jo(s))if(o=!0,Jo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Jo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Jo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Vf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Jo(r)||e>2&&L7(r)&&t.charCodeAt(1)===B7&&Jo(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Jo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Jo(r.charCodeAt(1))&&(++o,s>2&&(Jo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return pn.win32.normalize(e)},relative(t,e){if(Vf(t,"from"),Vf(e,"to"),t===e)return"";let r=pn.win32.resolve(t),n=pn.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===pC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===pC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===pC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===pC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===pC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===pC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=pn.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===pC){if(e.charCodeAt(1)===pC){let r=e.charCodeAt(2);if(r!==V5o&&r!==F7)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(L7(e.charCodeAt(0))&&e.charCodeAt(1)===B7&&e.charCodeAt(2)===pC)return`\\\\?\\${e}`;return t},dirname(t){Vf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Jo(o)?t:".";if(Jo(o)){if(r=n=1,Jo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Jo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Jo(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Vf(e,"ext"),Vf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&L7(t.charCodeAt(0))&&t.charCodeAt(1)===B7&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Jo(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Jo(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Vf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===B7&&L7(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Jo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===F7?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:uun.bind(null,"\\"),parse(t){Vf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Jo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Jo(o)){if(n=1,Jo(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Jo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===F7?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var z5o=(()=>{if(hC){let t=/\\/g;return()=>{let e=sce.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>sce.cwd()})();pn.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:z5o();Vf(o,"path"),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Ym)}return e=ZGe(e,!r,"/",QFt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Vf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Ym,r=t.charCodeAt(t.length-1)===Ym;return t=ZGe(t,!e,"/",QFt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Vf(t,"path"),t.length>0&&t.charCodeAt(0)===Ym},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":pn.posix.normalize(e)},relative(t,e){if(Vf(t,"from"),Vf(e,"to"),t===e||(t=pn.posix.resolve(t),e=pn.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Ym)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Ym?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Ym)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Vf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Ym,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Ym){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Vf(e,"ext"),Vf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Ym){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Ym){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Vf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===Ym){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===F7?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:uun.bind(null,"/"),parse(t){Vf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Ym,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Ym){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===F7?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};pn.posix.win32=pn.win32.win32=pn.win32;pn.posix.posix=pn.win32.posix=pn.posix;pn.normalize=hC?pn.win32.normalize:pn.posix.normalize;pn.isAbsolute=hC?pn.win32.isAbsolute:pn.posix.isAbsolute;pn.join=hC?pn.win32.join:pn.posix.join;pn.resolve=hC?pn.win32.resolve:pn.posix.resolve;pn.relative=hC?pn.win32.relative:pn.posix.relative;pn.dirname=hC?pn.win32.dirname:pn.posix.dirname;pn.basename=hC?pn.win32.basename:pn.posix.basename;pn.extname=hC?pn.win32.extname:pn.posix.extname;pn.format=hC?pn.win32.format:pn.posix.format;pn.parse=hC?pn.win32.parse:pn.posix.parse;pn.toNamespacedPath=hC?pn.win32.toNamespacedPath:pn.posix.toNamespacedPath;pn.sep=hC?pn.win32.sep:pn.posix.sep;pn.delimiter=hC?pn.win32.delimiter:pn.posix.delimiter});var yun=I(ace=>{"use strict";p();Object.defineProperty(ace,"__esModule",{value:!0});ace.URI=void 0;ace.isUriComponents=r4o;ace.uriToFsPath=r$e;var fun=dun(),e$e=FFt(),Y5o=/^\w[\w\d+.-]*$/,K5o=/^\//,J5o=/^\/\//;function Z5o(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!Y5o.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!K5o.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(J5o.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(Z5o,"_validateUri");function X5o(t,e){return!t&&!e?"file":t}a(X5o,"_schemeFix");function e4o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==nk&&(e=nk+e):e=nk;break}return e}a(e4o,"_referenceResolution");var Ol="",nk="/",t4o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,t$e=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}scheme;authority;path;query;fragment;constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Ol,this.authority=e.authority||Ol,this.path=e.path||Ol,this.query=e.query||Ol,this.fragment=e.fragment||Ol):(this.scheme=X5o(e,c),this.authority=r||Ol,this.path=e4o(this.scheme,n||Ol),this.query=o||Ol,this.fragment=s||Ol,Z5o(this,c))}get fsPath(){return r$e(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Ol),n===void 0?n=this.authority:n===null&&(n=Ol),o===void 0?o=this.path:o===null&&(o=Ol),s===void 0?s=this.query:s===null&&(s=Ol),c===void 0?c=this.fragment:c===null&&(c=Ol),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new U7(r,n,o,s,c)}static parse(e,r=!1){let n=t4o.exec(e);return n?new U7(n[2]||Ol,XGe(n[4]||Ol),XGe(n[5]||Ol),XGe(n[7]||Ol),XGe(n[9]||Ol),r):new U7(Ol,Ol,Ol,Ol,Ol)}static file(e){let r=Ol;if(e$e.isWindows&&(e=e.replace(/\\/g,nk)),e[0]===nk&&e[1]===nk){let n=e.indexOf(nk,2);n===-1?(r=e.substring(2),e=nk):(r=e.substring(2,n),e=e.substring(n)||nk)}return new U7("file",r,e,Ol,Ol)}static from(e,r){return new U7(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let n;return e$e.isWindows&&e.scheme==="file"?n=t.file(fun.win32.join(r$e(e,!0),...r)).path:n=fun.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return qFt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new U7(e);return r._formatted=e.external??null,r._fsPath=e._sep===mun?e.fsPath??null:null,r}}else return e}};ace.URI=t$e;function r4o(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(r4o,"isUriComponents");var mun=e$e.isWindows?1:void 0,U7=class extends t$e{static{a(this,"Uri")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=r$e(this,!1)),this._fsPath}toString(e=!1){return e?qFt(this,!0):(this._formatted||(this._formatted=qFt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=mun),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},gun={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function pun(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=gun[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(pun,"encodeURIComponentFast");function n4o(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,e$e.isWindows&&(r=r.replace(/\//g,"\\")),r}a(r$e,"uriToFsPath");function qFt(t,e){let r=e?n4o:pun,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=nk,n+=nk),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:pun(u,!1,!1)),n}a(qFt,"_asFormatted");function Aun(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Aun(t.substr(3)):t}}a(Aun,"decodeURIComponentGraceful");var hun=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function XGe(t){return t.match(hun)?t.replace(hun,e=>Aun(e)):t}a(XGe,"percentDecode")});var GFt=I(Q7=>{"use strict";p();Object.defineProperty(Q7,"__esModule",{value:!0});Q7.PromptReference=Q7.ChatResponseReferencePartStatusKind=Q7.PromptMetadata=void 0;var GSe=yun(),jFt=class{static{a(this,"PromptMetadata")}_marker;toString(){return Object.getPrototypeOf(this).constructor.name}};Q7.PromptMetadata=jFt;var Eun;(function(t){t[t.Complete=1]="Complete",t[t.Partial=2]="Partial",t[t.Omitted=3]="Omitted"})(Eun||(Q7.ChatResponseReferencePartStatusKind=Eun={}));var HFt=class t{static{a(this,"PromptReference")}anchor;iconPath;options;static fromJSON(e){let r=a(n=>"scheme"in n?GSe.URI.from(n):{uri:GSe.URI.from(n.uri),range:n.range},"uriOrLocation");return new t("variableName"in e.anchor?{variableName:e.anchor.variableName,value:e.anchor.value&&r(e.anchor.value)}:r(e.anchor),e.iconPath&&("scheme"in e.iconPath?GSe.URI.from(e.iconPath):"light"in e.iconPath?{light:GSe.URI.from(e.iconPath.light),dark:GSe.URI.from(e.iconPath.dark)}:e.iconPath),e.options)}constructor(e,r,n){this.anchor=e,this.iconPath=r,this.options=n}toJSON(){return{anchor:this.anchor,iconPath:this.iconPath,options:this.options}}};Q7.PromptReference=HFt});var ZFt=I(cce=>{"use strict";p();Object.defineProperty(cce,"__esModule",{value:!0});cce.PromptRenderer=cce.MetadataMap=void 0;var i4o=gFt(),q7=vFt(),oY=D7(),wd=MFt(),JFt=GFt(),i$e;(function(t){t.empty={get:a(()=>{},"get"),getAll:a(()=>[],"getAll")},t.from=e=>({get:a(r=>e.find(n=>n instanceof r),"get"),getAll:a(r=>e.filter(n=>n instanceof r),"getAll")})})(i$e||(cce.MetadataMap=i$e={}));var $Ft=class{static{a(this,"PromptRenderer")}_endpoint;_ctor;_props;_tokenizer;_usedContext=[];_ignoredFiles=[];_growables=[];_root=new a$e(null,0);_tokenLimits=[];tracer=void 0;constructor(e,r,n,o){this._endpoint=e,this._ctor=r,this._props=n,this._tokenizer=o}getIgnoredFiles(){return Array.from(new Set(this._ignoredFiles))}getUsedContext(){return this._usedContext}createElement(e){return new e.ctor(e.props)}async _processPromptPieces(e,r,n,o){let s=new Map;for(let[u,d]of r.entries()){if(Array.isArray(d.children)&&(d.props=d.props??{},d.props.children=d.children),!d.ctor){let A=bun(d.path);throw new Error(`Invalid ChatMessage child! Child must be a TSX component that extends PromptElement at ${A}`)}let f=this.createElement(d),h;f instanceof wd.TokenLimit&&(h=d.props.max,this._tokenLimits.push({limit:h,id:d.node.id})),d.node.setObj(f);let m=d.props.flexGrow??1/0,g=s.get(m);g||(g=[],s.set(m,g)),g.push({element:d,promptElementInstance:f,tokenLimit:h})}if(s.size===0)return;let c=[...s.entries()].sort(([u],[d])=>d-u).map(([u,d])=>d),l=a(u=>{let d=0;for(let f=u+1;f{if(E.tokenLimit===void 0)return!1;let _=E.element.props.flexBasis??1,v=_/h;return Math.floor(e.remainingTokenBudget*v){let v=(E.element.props.flexBasis??1)/h;return{tokenBudget:g[_]?E.tokenLimit:Math.floor((e.remainingTokenBudget-m)*v),endpoint:e.endpoint,countTokens:a((b,T)=>this._tokenizer.tokenLength(typeof b=="string"?{type:oY.Raw.ChatCompletionContentPartKind.Text,text:b}:b,T),"countTokens")}});e.consume(-f),this.tracer?.addRenderEpoch?.({inNode:d[0].element.node.parent?.id,flexValue:d[0].element.props.flexGrow??0,tokenBudget:e.remainingTokenBudget,reservedTokens:f,elements:d.map((E,_)=>({id:E.element.node.id,tokenBudget:A[_].tokenBudget}))}),await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=await vun(E,()=>_.prepare?.(A[v],n,o));E.node.setState(b)}));let y=await Promise.all(d.map(async({element:E,promptElementInstance:_},v)=>{let b=A[v];return await vun(E,()=>_.render(E.node.getState(),b,n,o))}));for(let[E,{element:_,promptElementInstance:v}]of d.entries()){let b=A[E],T=y[E];if(!T)continue;let w=await this._processPromptRenderPiece(new iY(b.tokenBudget,this._endpoint),_,v,T,n,o);v instanceof wd.Expandable&&this._growables.push({initialConsume:w,elem:_.node}),e.consume(w)}}}async _processPromptRenderPiece(e,r,n,o,s,c){let l=Cun(o),u=new iY(e.tokenBudget,this._endpoint),{tokensConsumed:d}=await o4o(this._tokenizer,r,n,l);return u.consume(d),await this._handlePromptChildren(r,l,u,s,c),u.consumed}async renderElementJSON(e){return await this._processPromptPieces(new iY(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],void 0,e),{node:this._root.toJSON()}}async render(e,r){let n=await this.renderRaw(e,r);return{...n,messages:(0,oY.toMode)(this._tokenizer.mode,n.messages)}}async renderRaw(e,r){await this._processPromptPieces(new iY(this._endpoint.modelMaxPromptTokens,this._endpoint),[{node:this._root,ctor:this._ctor,props:this._props,children:[],path:[this._ctor]}],e,r);let{container:n,allMetadata:o,removed:s}=await this._getFinalElementTree(this._endpoint.modelMaxPromptTokens,r);this.tracer?.didMaterializeTree?.({budget:this._endpoint.modelMaxPromptTokens,renderedTree:{container:n,removed:s,budget:this._endpoint.modelMaxPromptTokens},tokenizer:this._tokenizer,renderTree:a(m=>this._getFinalElementTree(m,void 0).then(g=>({...g,budget:m})),"renderTree")});let c=[...n.toChatMessages()],l=await n.tokenCount(this._tokenizer),u=[...n.allMetadata()],d=new Set,f=u.map(m=>{if(!(m instanceof PM))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(c$e),h=o.map(m=>{if(!(m instanceof PM)||u.includes(m))return;let g=m.reference,A="variableName"in g.anchor;if(A&&!d.has(g.anchor.variableName))return d.add(g.anchor.variableName),g;if(!A)return g}).filter(c$e);return{metadata:i$e.from(u),messages:c,hasIgnoredFiles:this._ignoredFiles.length>0,tokenCount:l,references:f,omittedReferences:h}}async _getFinalElementTree(e,r){let n=this._root.materialize(),o=[...n.toChatMessages()],s=[...n.allMetadata()],c=[{limit:e,id:this._root.id},...this._tokenLimits],l=0;for(let u=c.length-1;u>=0;u--){let d=c[u];if(d.limit>e)continue;let f=n.findById(d.id);if(!f)continue;let h=await f.tokenCount(this._tokenizer);if(!(hd.limit;){let g=await f.baseMessageTokenCount(this._tokenizer);do for(let A of f.removeLowestPriorityChild()){l++;let y=A.upperBoundTokenCount(this._tokenizer);m-=(typeof y=="number"?y:await y)*1.25}while(m-g>d.limit);m=await f.tokenCount(this._tokenizer)}}catch(m){throw m instanceof q7.BudgetExceededError&&(m.metadata=i$e.from([...n.allMetadata()]),m.messages=o),m}}return{container:n,allMetadata:s,removed:l}}async _grow(e,r,n,o){if(!this._growables.length)return!1;for(let s of this._growables){if(!e.findById(s.elem.id))continue;let c=s.elem.getObj();if(!(c instanceof wd.Expandable))throw new Error("unreachable: expected growable");let l=new a$e(null,0,s.elem.id),u=new iY(n-r+s.initialConsume,this._endpoint),d=await this._processPromptRenderPiece(u,{node:l,ctor:this._ctor,props:{},children:[],path:[this._ctor]},c,await c.render(void 0,{tokenBudget:u.tokenBudget,endpoint:this._endpoint,countTokens:a((m,g)=>this._tokenizer.tokenLength(typeof m=="string"?{type:oY.Raw.ChatCompletionContentPartKind.Text,text:m}:m,g),"countTokens")}),void 0,o),f=l.materialize();if(!e.replaceNode(s.elem.id,f))throw new Error("unreachable: could not find old element to replace");if(r-=s.initialConsume,r+=d,r>=n)break}return!0}_handlePromptChildren(e,r,n,o,s){if(e.ctor===wd.TextChunk){this._handleExtrinsicTextChunkChildren(e.node,e.node,e.props,r);return}let c=[];for(let l of r){if(l.kind==="literal"){e.node.appendStringChild(l.value,e.props.priority??Number.MAX_SAFE_INTEGER);continue}if(l.kind==="intrinsic"){this._handleIntrinsic(e.node,l.name,{priority:e.props.priority??Number.MAX_SAFE_INTEGER,...l.props},o$e(l.children));continue}let u=e.node.createChild();c.push({node:u,ctor:l.ctor,props:l.props,children:l.children,path:[...e.path,l.ctor]})}return this._processPromptPieces(n,c,o,s)}_handleIntrinsic(e,r,n,o,s){switch(r){case"meta":return this._handleIntrinsicMeta(e,n,o);case"br":return this._handleIntrinsicLineBreak(e,n,o,n.priority,s);case"usedContext":return this._handleIntrinsicUsedContext(e,n,o);case"references":return this._handleIntrinsicReferences(e,n,o);case"ignoredFiles":return this._handleIntrinsicIgnoredFiles(e,n,o);case"elementJSON":return this._handleIntrinsicElementJSON(e,n.data);case"cacheBreakpoint":return this._handleIntrinsicCacheBreakpoint(e,n,o,s);case"opaque":return this._handleIntrinsicOpaque(e,n,s)}throw new Error(`Unknown intrinsic element ${r}!`)}_handleIntrinsicCacheBreakpoint(e,r,n,o){if(n.length>0)throw new Error(" must not have children!");e.addCacheBreakpoint(r,o)}_handleIntrinsicMeta(e,r,n){if(n.length>0)throw new Error(" must not have children!");r.local?e.addMetadata(r.value):this._root.addMetadata(r.value)}_handleIntrinsicLineBreak(e,r,n,o,s){if(n.length>0)throw new Error("
must not have children!");e.appendLineBreak(o??Number.MAX_SAFE_INTEGER,s)}_handleIntrinsicOpaque(e,r,n){e.appendOpaque(r.value,r.tokenUsage,r.priority,n)}_handleIntrinsicElementJSON(e,r){let n=e.appendPieceJSON(r.node);if(this.tracer?.includeInEpoch)for(let o of n.elements())this.tracer.includeInEpoch({id:o.id,tokenBudget:0})}_handleIntrinsicUsedContext(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._usedContext.push(...r.value)}_handleIntrinsicReferences(e,r,n){if(n.length>0)throw new Error(" must not have children!");for(let o of r.value)e.addMetadata(new PM(o))}_handleIntrinsicIgnoredFiles(e,r,n){if(n.length>0)throw new Error(" must not have children!");this._ignoredFiles.push(...r.value)}_handleExtrinsicTextChunkChildren(e,r,n,o){let s=[],c=[];for(let l of o){if(l.kind==="extrinsic")throw new Error("TextChunk cannot have extrinsic children!");if(l.kind==="literal"&&s.push(l.value),l.kind==="intrinsic")if(l.name==="br")s.push(` +`);else if(l.name==="references")for(let u of l.props.value)c.push(new PM(u));else this._handleIntrinsic(e,l.name,l.props,o$e(l.children),r.childIndex)}e.appendStringChild(s.join(""),n?.priority??Number.MAX_SAFE_INTEGER,c,r.childIndex,!0)}};cce.PromptRenderer=$Ft;async function o4o(t,e,r,n){let o=0;if((0,wd.isChatMessagePromptElement)(r)){let s={role:e.props.role,content:[],...e.props.name?{name:e.props.name}:void 0,...e.props.toolCalls?{toolCalls:e.props.toolCalls}:void 0,...e.props.toolCallId?{toolCallId:e.props.toolCallId}:void 0};o+=await t.countMessageTokens((0,oY.toMode)(t.mode,s))}for(let s of n)s.kind==="literal"&&(o+=await t.tokenLength({type:oY.Raw.ChatCompletionContentPartKind.Text,text:s.value}));return{tokensConsumed:o}}a(o4o,"computeTokensConsumedByLiterals");function Cun(t,e=[]){return typeof t>"u"||typeof t=="boolean"?[]:(typeof t=="string"||typeof t=="number"?e.push(new zFt(String(t))):s4o(t)?o$e(t.children,e):a4o(t)?o$e(t,e):typeof t.ctor=="string"?e.push(new VFt(t.ctor,t.props,t.children)):e.push(new WFt(t.ctor,t.props,t.children)),e)}a(Cun,"flattenAndReduce");function o$e(t,e=[]){for(let r of t)Cun(r,e);return e}a(o$e,"flattenAndReduceArr");var VFt=class{static{a(this,"IntrinsicPromptPiece")}name;props;children;kind="intrinsic";constructor(e,r,n){this.name=e,this.props=r,this.children=n}},WFt=class{static{a(this,"ExtrinsicPromptPiece")}ctor;props;children;kind="extrinsic";constructor(e,r,n){this.ctor=e,this.props=r,this.children=n}},zFt=class{static{a(this,"LiteralPromptPiece")}value;priority;kind="literal";constructor(e,r){this.value=e,this.priority=r}},s$e=class t{static{a(this,"PromptOpaque")}parent;childIndex;value;tokenUsage;priority;static fromJSON(e,r,n){return new t(e,r,n.value,n.tokenUsage,n.priority)}kind=2;constructor(e,r,n,o,s){this.parent=e,this.childIndex=r,this.value=n,this.tokenUsage=o,this.priority=s}materialize(e){return new q7.MaterializedChatMessageOpaque(e,{type:oY.Raw.ChatCompletionContentPartKind.Opaque,value:this.value,tokenUsage:this.tokenUsage},this.priority)}toJSON(){return{type:3,value:this.value,tokenUsage:this.tokenUsage,priority:this.priority}}},iY=class{static{a(this,"PromptSizingContext")}tokenBudget;endpoint;_consumed=0;constructor(e,r){this.tokenBudget=e,this.endpoint=r}get consumed(){return this._consumed>this.tokenBudget?this.tokenBudget:this._consumed}get remainingTokenBudget(){return Math.max(0,this.tokenBudget-this._consumed)}consume(e){this._consumed+=e}},a$e=class t{static{a(this,"PromptTreeElement")}parent;childIndex;id;static _nextId=0;static fromJSON(e,r,n){let o=new t(null,e);switch(o._metadata=r.references?.map(s=>new PM(JFt.PromptReference.fromJSON(s)))??[],o._children=r.children.map((s,c)=>{switch(s.type){case 1:return t.fromJSON(c,s,n);case 2:return $Se.fromJSON(o,c,s);case 3:return s$e.fromJSON(o,c,s);default:}}).filter(c$e),r.ctor){case 1:o._objFlags=r.flags??0,o._obj=new wd.BaseChatMessage(r.props);break;case 2:{if(r.keepWithId!==void 0){let s=n.get(r.keepWithId);s||(s=(0,wd.useKeepWith)(),n.set(r.keepWithId,s)),o._obj=new s(r.props||{})}else o._obj=new wd.LogicalWrapper(r.props||{});o._objFlags=r.flags??0;break}case 3:o._obj=new wd.Image(r.props);break;case 4:o._obj=new wd.Document(r.props);break;default:}return o}kind=1;_obj=null;_state=void 0;_children=[];_metadata=[];_objFlags=0;constructor(e=null,r,n=t._nextId++){this.parent=e,this.childIndex=r,this.id=n}setObj(e){this._obj=e,this._obj instanceof wd.LegacyPrioritization&&(this._objFlags|=1),this._obj instanceof wd.Chunk&&(this._objFlags|=2),this._obj instanceof wd.IfEmpty&&(this._objFlags|=8),this._obj.props.passPriority&&(this._objFlags|=4)}getObj(){return this._obj}setState(e){this._state=e}getState(){return this._state}createChild(){let e=new t(this,this._children.length);return this._children.push(e),e}appendPieceJSON(e){let r=t.fromJSON(this._children.length,e,new Map);return this._children.push(r),r}appendStringChild(e,r,n,o=this._children.length,s=!1){this._children.push(new $Se(this,o,e,r,n,s))}appendLineBreak(e,r=this._children.length){this._children.push(new $Se(this,r,` +`,e))}appendOpaque(e,r,n,o=this._children.length){this._children.push(new s$e(this,o,e,r,n))}toJSON(){let e={type:1,ctor:2,ctorName:this._obj?.constructor.name,children:this._children.slice().sort((r,n)=>r.childIndex-n.childIndex).map(r=>r.toJSON()).filter(c$e),props:{},references:this._metadata.filter(r=>r instanceof PM).map(r=>r.reference.toJSON())};if(this._obj&&(e.props=n$e(this._obj.props,i4o.jsonRetainedProps)),this._obj instanceof wd.BaseChatMessage)e.ctor=1,Object.assign(e.props,n$e(this._obj.props,["role","name","toolCalls","toolCallId"]));else{if(this._obj instanceof wd.Image)return{...e,ctor:3,props:{...e.props,...n$e(this._obj.props,["src","detail","mimeType"])}};if(this._obj instanceof wd.Document)return{...e,ctor:4,props:{...e.props,...n$e(this._obj.props,["data","mediaType"])}};this._obj instanceof wd.AbstractKeepWith&&(e.keepWithId=this._obj.id)}return this._objFlags!==0&&(e.flags=this._objFlags),e}materialize(e){if(this._children.sort((r,n)=>r.childIndex-n.childIndex),this._obj instanceof wd.Image)return new q7.MaterializedChatMessageImage(e,this.id,this._obj.props.src,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0,this._obj.props.detail??void 0,this._obj.props.mimeType??void 0);if(this._obj instanceof wd.Document)return new q7.MaterializedChatMessageDocument(e,this.id,this._obj.props.data,this._obj.props.mediaType,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,0);if(this._obj instanceof wd.BaseChatMessage){if(this._obj.props.role===void 0||typeof this._obj.props.role!="number")throw new Error("Invalid ChatMessage!");return new q7.MaterializedChatMessage(e,this.id,this._obj.props.role,this._obj.props.name,this._obj instanceof wd.AssistantMessage?this._obj.props.toolCalls:void 0,this._obj instanceof wd.ToolMessage?this._obj.props.toolCallId:void 0,this._obj.props.priority??Number.MAX_SAFE_INTEGER,this._metadata,r=>this._children.map(n=>n.materialize(r)))}else{let r=new q7.GenericMaterializedContainer(e,this.id,this._obj?.constructor.name,this._obj?.props.priority??(this._obj?.props.passPriority?0:Number.MAX_SAFE_INTEGER),n=>this._children.map(o=>o.materialize(n)),this._metadata,this._objFlags);return this._obj instanceof wd.AbstractKeepWith&&(r.keepWithId=this._obj.id),r}}addMetadata(e){this._metadata.push(e)}addCacheBreakpoint(e,r=this._children.length){if(!(this._obj instanceof wd.BaseChatMessage))throw new Error("Cache breakpoints may only be direct children of chat messages");this._children.push(new YFt({type:oY.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:e.type},r))}*elements(){yield this;for(let e of this._children)e instanceof t&&(yield*e.elements())}},YFt=class{static{a(this,"PromptCacheBreakpoint")}part;childIndex;constructor(e,r){this.part=e,this.childIndex=r}toJSON(){}materialize(e){return new q7.MaterializedChatMessageBreakpoint(e,this.part)}},$Se=class t{static{a(this,"PromptText")}parent;childIndex;text;priority;metadata;lineBreakBefore;static fromJSON(e,r,n){return new t(e,r,n.text,n.priority,n.references?.map(o=>new PM(JFt.PromptReference.fromJSON(o))),n.lineBreakBefore)}kind=2;constructor(e,r,n,o,s,c=!1){this.parent=e,this.childIndex=r,this.text=n,this.priority=o,this.metadata=s,this.lineBreakBefore=c}materialize(e){let r=this.lineBreakBefore?1:this.childIndex===0?2:0;return new q7.MaterializedChatMessageTextChunk(e,this.text,this.priority??Number.MAX_SAFE_INTEGER,this.metadata||[],r)}toJSON(){return{type:2,priority:this.priority,text:this.text,references:this.metadata?.filter(e=>e instanceof PM).map(e=>e.reference.toJSON()),lineBreakBefore:this.lineBreakBefore}}};function s4o(t){return(typeof t.ctor=="function"&&t.ctor.isFragment)??!1}a(s4o,"isFragmentCtor");function c$e(t){return t!==void 0}a(c$e,"isDefined");var KFt=class extends JFt.PromptMetadata{static{a(this,"InternalMetadata")}},PM=class extends KFt{static{a(this,"ReferenceMetadata")}reference;constructor(e){super(),this.reference=e}};function a4o(t){return!!t&&typeof t[Symbol.iterator]=="function"}a(a4o,"isIterable");function n$e(t,e){let r={};for(let n of e)t.hasOwnProperty(n)&&(r[n]=t[n]);return r}a(n$e,"pickProps");function bun(t){return t.map(e=>typeof e=="string"?e:e?e.name||"":String(e)).join(" > ")}a(bun,"atPath");var _un=new WeakSet;async function vun(t,e){try{return await e()}catch(r){throw r instanceof Error&&!_un.has(r)&&r.constructor.name!=="CancellationError"&&(_un.add(r),r.message+=` (at tsx element ${bun(t.path)})`),r}}a(vun,"annotateError")});var Sun=I(l$e=>{"use strict";p();Object.defineProperty(l$e,"__esModule",{value:!0});l$e.VSCodeTokenizer=void 0;var XFt=D7(),e8t=class{static{a(this,"VSCodeTokenizer")}countTokens;mode=XFt.OutputMode.VSCode;constructor(e,r){if(this.countTokens=e,r!==XFt.OutputMode.VSCode)throw new Error("`mode` must be set to vscode when using vscode.LanguageModelChat as the tokenizer")}async tokenLength(e,r){return e.type===XFt.Raw.ChatCompletionContentPartKind.Text?this.countTokens(e.text,r):Promise.resolve(0)}async countMessageTokens(e){return this.countTokens(e)}};l$e.VSCodeTokenizer=e8t});var Tun=I(lce=>{"use strict";p();Object.defineProperty(lce,"__esModule",{value:!0});lce.tracerCss=lce.tracerSrc=void 0;lce.tracerSrc='"use strict";(()=>{var $,m,se,Ue,w,re,le,q,X,G,K,Ae,D={},ce=[],Re=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,J=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function ue(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function l(t,e,n){var o,r,_,c={};for(_ in e)_=="key"?o=e[_]:_=="ref"?r=e[_]:c[_]=e[_];if(arguments.length>2&&(c.children=arguments.length>3?$.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(_ in t.defaultProps)c[_]===void 0&&(c[_]=t.defaultProps[_]);return R(t,c,o,r,null)}function R(t,e,n,o,r){var _={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:r??++se,__i:-1,__u:0};return r==null&&m.vnode!=null&&m.vnode(_),_}function N(t){return t.children}function B(t,e){this.props=t,this.context=e}function I(t,e){if(e==null)return t.__?I(t.__,t.__i+1):null;for(var n;ee&&w.sort(q));O.__r=0}function pe(t,e,n,o,r,_,c,a,u,s,p){var i,f,d,b,x,C=o&&o.__k||ce,h=e.length;for(n.__d=u,Be(n,e,C),u=n.__d,i=0;i0?R(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r).__=t,r.__b=t.__b+1,_=null,(a=r.__i=Oe(r,n,c,p))!==-1&&(p--,(_=n[a])&&(_.__u|=131072)),_==null||_.__v===null?(a==-1&&i--,typeof r.type!="function"&&(r.__u|=65536)):a!==c&&(a==c-1?i--:a==c+1?i++:(a>c?i--:i++,r.__u|=65536))):r=t.__k[o]=null;if(p)for(o=0;o(u!=null&&(131072&u.__u)==0?1:0))for(;c>=0||a=0){if((u=e[c])&&(131072&u.__u)==0&&r==u.key&&_===u.type)return c;c--}if(a=n.__.length&&n.__.push({}),n.__[t]}function S(t){return V=1,Ve(Ne,t)}function Ve(t,e,n){var o=te(L++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):Ne(void 0,e),function(a){var u=o.__N?o.__N[0]:o.__[0],s=o.t(u,a);u!==s&&(o.__N=[s,o.__[1]],o.__c.setState({}))}],o.__c=g,!g.u)){var r=function(a,u,s){if(!o.__c.__H)return!0;var p=o.__c.__H.__.filter(function(f){return!!f.__c});if(p.every(function(f){return!f.__N}))return!_||_.call(this,a,u,s);var i=!1;return p.forEach(function(f){if(f.__N){var d=f.__[0];f.__=f.__N,f.__N=void 0,d!==f.__[0]&&(i=!0)}}),!(!i&&o.__c.props===a)&&(!_||_.call(this,a,u,s))};g.u=!0;var _=g.shouldComponentUpdate,c=g.componentWillUpdate;g.componentWillUpdate=function(a,u,s){if(this.__e){var p=_;_=void 0,r(a,u,s),_=p}c&&c.call(this,a,u,s)},g.shouldComponentUpdate=r}return o.__N||o.__}function Se(t,e){var n=te(L++,3);!y.__s&&Ie(n.__H,e)&&(n.__=t,n.i=e,g.__H.__h.push(n))}function we(t){return V=5,je(function(){return{current:t}},[])}function je(t,e){var n=te(L++,7);return Ie(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function qe(){for(var t;t=Ee.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ee),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){g=null,be&&be(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Te&&Te(t,e)},y.__r=function(t){ye&&ye(t),L=0;var e=(g=t.__c).__H;e&&(Z===g?(e.__h=[],g.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ee),e.__h=[],L=0)),Z=g},y.diffed=function(t){Ce&&Ce(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ee.push(e)!==1&&ge===y.requestAnimationFrame||((ge=y.requestAnimationFrame)||Ge)(qe)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Z=g=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(o){return!o.__||ee(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],y.__e(o,n.__v)}}),xe&&xe(t,e)},y.unmount=function(t){ke&&ke(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{W(o)}catch(r){e=r}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Me=typeof requestAnimationFrame=="function";function Ge(t){var e,n=function(){clearTimeout(o),Me&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Me&&(e=requestAnimationFrame(n))}function W(t){var e=g,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),g=e}function ee(t){var e=g;t.__c=t.__(),g=e}function Ie(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function Ne(t,e){return typeof e=="function"?e(t):e}function He(t,e){let n=we(void 0),o=(...r)=>{n.current&&clearTimeout(n.current),n.current=window.setTimeout(()=>{t(...r)},e)};return Se(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}var Ke=new Intl.NumberFormat("en-US"),T=({value:t})=>l(N,null,Ke.format(t));var ne=[{bg:"#c1e7ff",fg:"#000"},{bg:"#abd2ec",fg:"#000"},{bg:"#94bed9",fg:"#000"},{bg:"#7faac6",fg:"#000"},{bg:"#6996b3",fg:"#fff"},{bg:"#5383a1",fg:"#fff"},{bg:"#3d708f",fg:"#fff"},{bg:"#255e7e",fg:"#fff"}],Xe=({scoreBy:t,nodes:e,epoch:n})=>{if(e.length===0)return null;let o=t;if(t.field!=="tokens"){let r=e[0][t.field],_=e[0][t.field];for(let c=1;cr.type===2?l(Je,{scoreBy:o,key:_,node:r}):l(Le,{scoreBy:o,key:_,node:r,epoch:n})))},Fe=({node:t})=>l("div",{className:"node-stats"},"Used Tokens: ",l(T,{value:t.tokens})," / ","Priority:"," ",t.priority===Number.MAX_SAFE_INTEGER?"MAX":l(T,{value:t.priority})),De=({scoreBy:t,node:e,children:n,...o})=>{let r=0;if(t.max!==t.min){let _=(e[t.field]-t.min)/(t.max-t.min);r=Math.round((ne.length-1)*_)}return l("div",{...o,className:`node ${o.className||""}`,style:{backgroundColor:ne[r].bg,color:ne[r].fg}},n)},Je=({scoreBy:t,node:e})=>l(De,{node:e,scoreBy:t,tabIndex:0,className:"node-text"},l(Fe,{node:e}),l("div",{className:"node-content"},e.value)),Le=({scoreBy:t,node:e,epoch:n})=>{let[o,r]=S(!1),_=EPOCHS.findIndex(i=>i.elements.some(f=>f.id===e.id));if(_===void 0)throw new Error(`epoch not found for ${e.id}`);let c=EPOCHS[_],a=EPOCHS.at(n),u=c.elements.find(i=>i.id===e.id).tokenBudget,s=e.type===1?e.name||e.role.slice(0,1).toUpperCase()+e.role.slice(1)+"Message":e.name,p=_===n?"new-in-epoch":n<_?"before-epoch":"";return l(De,{node:e,scoreBy:t,className:p},l(Fe,{node:e}),l("div",{className:"node-content node-toggler",onClick:()=>r(i=>!i)},l("span",null,a?.inNode===e.id?"\\u{1F3C3} ":"",`<${s}>`),l("span",{className:"indicator"},o?"[+]":"[-]")),n===_&&l("div",{className:"node-stats"},"Token Budget: ",l(T,{value:u})),a?.inNode===e.id&&l("div",{className:"node-stats"},"Rendering flexGrow=",a.flexValue,l("br",null),l("br",null),"Splitting"," ",a.reservedTokens?`${a.tokenBudget} - ${a.reservedTokens} (reserved) = `:"",l(T,{value:a.tokenBudget})," tokens among ",a.elements.length," ","elements"),!o&&l(Xe,{nodes:e.children,scoreBy:t,epoch:n}))},Pe=({scoreBy:t,node:e,epoch:n})=>{let o;return t==="tokens"?o={field:"tokens",max:e.tokens,min:0}:o={field:"priority",max:e.priority,min:e.priority},l(Le,{scoreBy:o,node:e,epoch:n})};var ze=({label:t,value:e,onChange:n,min:o,max:r})=>{let _=a=>{n(a.target.valueAsNumber)},c=`number-slider-${Math.random()}`;return l("div",{className:"controls-slider"},l("label",{htmlFor:c},t),l("input",{id:c,type:"range",min:o,max:r,value:e,onInput:_}),l("input",{type:"number",min:o,value:e,onInput:_,onChange:_}))},Qe=({scoreBy:t,onScoreByChange:e})=>{let n=o=>{let r=o.target.value;e(r)};return l("div",{className:"controls-scoreby"},"Visualize by",l("label",null,l("input",{type:"radio",name:"scoreBy",value:"tokens",checked:t==="tokens",onChange:n}),"Tokens"),l("label",null,l("input",{type:"radio",name:"scoreBy",value:"priority",checked:t==="priority",onChange:n}),"Priority"))},Ye=()=>{let[t,e]=S(DEFAULT_TOKENS),[n,o]=S(EPOCHS.length),[r,_]=S(DEFAULT_MODEL),[c,a]=S("tokens"),[u,s]=S("epoch"),p=He(async f=>{if(f===DEFAULT_TOKENS)return DEFAULT_MODEL;let b=await(await fetch(`${SERVER_ADDRESS}regen?n=${f}`)).json();_(b)},100),i=f=>{e(f),p(f),o(EPOCHS.length)};return l("div",{className:"app"},l("div",{className:"controls"},l("div",{className:"tabs"},l("div",{className:`tab ${u==="epoch"?"active":""}`,onClick:()=>s("epoch")},"View Order"),l("div",{className:`tab ${u==="tokens"?"active":""}`,onClick:()=>s("tokens")},"Change Token Budget")),l("div",{className:`tab-content ${u==="epoch"?"active":""}`},l(ze,{label:"Render Epoch",value:n,onChange:o,min:0,max:EPOCHS.length})),l("div",{className:`tab-content ${u==="tokens"?"active":""}`},l(ze,{label:"Token Budget",value:t,onChange:i,min:0,max:DEFAULT_TOKENS*2}))),l("div",{className:"control-description"},u==="tokens"?l("p",null,"Token changes here will prune elements and re-render Expandable ones, but the entire prompt is not being re-rendered"):l("p",null,"Changing the render epoch lets you see the order in which elements are rendered and how the token budget is allocated."),l("div",{className:"controls-stats"},l("span",null,"Used ",l(T,{value:r.container.tokens}),"/",l(T,{value:r.budget})," tokens"),l("span",null,"Removed ",l(T,{value:r.removed})," nodes"),l(Qe,{scoreBy:c,onScoreByChange:a}))),l(Pe,{node:r.container,scoreBy:c,epoch:n}))};ve(l(Ye,null),document.body);})();\n';lce.tracerCss=`body{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,system-ui,Ubuntu,Droid Sans,sans-serif;background:#fff;margin:0}.render-pass{border-left:2px solid #ccc;&:hover{border-left-color:#000}}.literals li{white-space:pre;font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace}.render-flex,.render-element{padding-left:10px}.node{border:1px solid rgba(255,255,255,.5);margin:3px 10px;padding:3px 10px;border-radius:4px;width:fit-content;&.new-in-epoch{box-shadow:0 0 3px 2px red}&.before-epoch{pointer-events:none;filter:grayscale(1);color:#777!important;.node{color:#777!important}}&:last-child{margin-bottom:0}}.node-content{font-weight:700}.node-children{margin-left:20px;border-left:2px dashed rgba(255,255,255,.5);padding-left:10px}.node-toggler{cursor:pointer;display:flex;align-items:center;justify-content:space-between;.indicator{font-size:.7em}}.node-text{width:400px;&:focus,&:focus-within{outline:1px solid orange;.node-content{white-space:normal}}.node-content{font-weight:400;font-size:.8em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}}.node-stats{font-family:SF Mono,Monaco,Menlo,Consolas,Ubuntu Mono,Liberation Mono,DejaVu Sans Mono,Courier New,monospace;font-size:.8em}.control-description{padding:10px;p{font-size:.9em;max-width:500px;margin-top:0}}.controls{display:flex;flex-direction:column;gap:10px;position:sticky;top:0;padding:10px;background:#fff;border-bottom:1px solid #ccc;z-index:1}.controls-slider{display:flex;align-items:center;gap:10px}.controls-stats{display:flex;gap:20px;list-style:none;padding:0;margin-top:0}.controls-scoreby{display:flex;gap:10px}.tabs{display:flex;border-bottom:1px solid #ccc;margin-bottom:10px}.tab{padding:10px;cursor:pointer;border:1px solid transparent;border-bottom:none}.tab.active{border-color:#ccc;border-bottom:1px solid #fff;background-color:#f9f9f9}.tab-content{display:none}.tab-content.active{display:block} +`});var Pun=I(d$e=>{"use strict";p();Object.defineProperty(d$e,"__esModule",{value:!0});d$e.HTMLTracer=void 0;var Iun=Tun(),j7=vFt(),c4o=D7(),t8t=class{static{a(this,"HTMLTracer")}traceData;epochs=[];addRenderEpoch(e){this.epochs.push(e)}includeInEpoch(e){this.epochs[this.epochs.length-1].elements.push(e)}didMaterializeTree(e){this.traceData=e}async serveHTML(){return r8t.create({epochs:this.epochs,traceData:wun(this.traceData)})}serveRouter(e){return new u$e({baseAddress:e,epochs:this.epochs,traceData:wun(this.traceData)})}};d$e.HTMLTracer=t8t;var u$e=class{static{a(this,"RequestRouter")}opts;serverToken=crypto.randomUUID();constructor(e){this.opts=e}route(e,r){let n=e,o=r,s=new URL(n.url||"/","http://localhost"),c=`/${this.serverToken}`;switch(s.pathname){case c:case`${c}/`:this.onRoot(s,n,o);break;case`${c}/regen`:this.onRegen(s,n,o);break;default:return!1}return!0}get address(){return this.opts.baseAddress+"/"+this.serverToken}async getHTML(){let{traceData:e,epochs:r}=this.opts;return` + + + `}async onRegen(e,r,n){let{traceData:o}=this.opts,s=Number(e.searchParams.get("n")||o.budget),c=await o.renderTree(s),l=await xun(o.tokenizer,c),u=JSON.stringify(l);n.setHeader("Content-Type","application/json"),n.setHeader("Content-Length",Buffer.byteLength(u)),n.end(u)}onRoot(e,r,n){this.getHTML().then(o=>{n.setHeader("Content-Type","text/html"),n.setHeader("Content-Length",Buffer.byteLength(o)),n.end(o)})}},r8t=class t extends u$e{static{a(this,"RequestServer")}server;static async create(e){let{createServer:r}=await Promise.resolve().then(()=>require("http")),n=r((c,l)=>{try{s.route(c,l)||(l.statusCode=404,l.end("Not Found"))}catch(u){l.statusCode=500,l.end(String(u))}}),o=await new Promise((c,l)=>{n.listen(0,"127.0.0.1",()=>c(n.address().port)).on("error",l)}),s=new t({...e,baseAddress:`http://127.0.0.1:${o}`},n);return s}constructor(e,r){super(e),this.server=r}dispose(){this.server.closeAllConnections(),this.server.close()}};async function xun(t,e){return{container:await Run(t,e.container,!1),removed:e.removed,budget:e.budget}}a(xun,"serializeRenderData");async function Run(t,e,r){let n={metadata:e.metadata.map(u4o),priority:e.priority};if(e instanceof j7.MaterializedChatMessageTextChunk)return{...n,type:2,value:e.text,tokens:await e.upperBoundTokenCount(t)};if(e instanceof j7.MaterializedChatMessageImage)return{...n,name:e.id.toString(),id:e.id,type:3,value:e.src,tokens:await e.upperBoundTokenCount(t)};if(e instanceof j7.MaterializedChatMessageOpaque||e instanceof j7.MaterializedChatMessageBreakpoint||e instanceof j7.MaterializedChatMessageDocument)return;{let o={...n,id:e.id,name:e.name,children:(await Promise.all(e.children.map(s=>Run(t,s,r||e instanceof j7.MaterializedChatMessage)))).filter(s=>!!s),tokens:r?await e.upperBoundTokenCount(t):await e.tokenCount(t)};if(e instanceof j7.GenericMaterializedContainer)return{...o,type:0};if(e instanceof j7.MaterializedChatMessage){let s=e.text.filter(c=>typeof c=="string").join("").trim();return{...o,type:1,role:c4o.Raw.ChatRole.display(e.role),text:s}}}l4o(e)}a(Run,"serializeMaterialized");function l4o(t){throw new Error("unreachable")}a(l4o,"assertNever");function u4o(t){return{name:t.constructor.name,value:JSON.stringify(t)}}a(u4o,"serializeMetadata");var wun=a(t=>{if(t===void 0)throw new Error("Prompt must be rendered before calling HTMLTRacer.serveHTML");return t},"mustGet")});var Dun=I(kun=>{"use strict";p();Object.defineProperty(kun,"__esModule",{value:!0})});var Mun=I(Nun=>{"use strict";p();Object.defineProperty(Nun,"__esModule",{value:!0})});var Lun=I(Oun=>{"use strict";p();Object.defineProperty(Oun,"__esModule",{value:!0})});var xo=I($u=>{"use strict";p();var d4o=$u&&$u.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sY=$u&&$u.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&d4o(e,t,r)};Object.defineProperty($u,"__esModule",{value:!0});$u.contentType=$u.PromptRenderer=$u.MetadataMap=$u.PromptElement=$u.JSONTree=void 0;$u.renderPrompt=h4o;$u.renderElementJSON=m4o;var n8t=D7(),Fun=ZFt(),f4o=Sun();sY(Pun(),$u);$u.JSONTree=gFt();sY(D7(),$u);sY(MFt(),$u);sY(GFt(),$u);sY(Dun(),$u);sY(Mun(),$u);sY(Lun(),$u);var p4o=bFt();Object.defineProperty($u,"PromptElement",{enumerable:!0,get:a(function(){return p4o.PromptElement},"get")});var Uun=ZFt();Object.defineProperty($u,"MetadataMap",{enumerable:!0,get:a(function(){return Uun.MetadataMap},"get")});Object.defineProperty($u,"PromptRenderer",{enumerable:!0,get:a(function(){return Uun.PromptRenderer},"get")});async function h4o(t,e,r,n,o,s,c=n8t.OutputMode.VSCode){let l="countTokens"in n?new f4o.VSCodeTokenizer((h,m)=>n.countTokens(h,m),c):n,u=new Fun.PromptRenderer(r,t,e,l),d=await u.render(o,s),f=u.getUsedContext();return{...d,usedContext:f}}a(h4o,"renderPrompt");$u.contentType="application/vnd.codechat.prompt+json.1";function m4o(t,e,r,n){return new Fun.PromptRenderer({modelMaxPromptTokens:r?.tokenBudget??Number.MAX_SAFE_INTEGER},t,e,{mode:n8t.OutputMode.Raw,countMessageTokens(s){throw new Error("Tools may only return text, not messages.")},tokenLength(s,c){return s.type===n8t.Raw.ChatCompletionContentPartKind.Text?Promise.resolve(r?.countTokens(s.text,c)??Promise.resolve(1)):Promise.resolve(1)}}).renderElementJSON(n)}a(m4o,"renderElementJSON")});var o8t=I(uce=>{"use strict";p();Object.defineProperty(uce,"__esModule",{value:!0});uce.DisposablesLRUCache=uce.LRUCache=void 0;var VSe=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},f$e=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new VSe("",null),this._tail=new VSe("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new VSe(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};uce.LRUCache=f$e;var i8t=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new f$e(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};uce.DisposablesLRUCache=i8t});var a8t=I(kM=>{"use strict";p();Object.defineProperty(kM,"__esModule",{value:!0});kM.getImageDimensions=g4o;kM.getImageDimensionsFromBytes=A4o;kM.getPngDimensions=Qun;kM.getGifDimensions=qun;kM.getJpegDimensions=jun;kM.getWebPDimensions=Vun;kM.getMimeType=Yun;kM.extractImageAttributes=_4o;function g4o(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(Yun(e)){case"image/png":return Qun(e);case"image/gif":return qun(e);case"image/jpeg":case"image/jpg":return jun(e);case"image/webp":return Vun(e);default:throw new Error("Unsupported image format")}}a(g4o,"getImageDimensions");function A4o(t,e){switch(y4o(e)){case"image/png":return Hun(t);case"image/gif":return Gun(t);case"image/jpeg":case"image/jpg":return $un(t);case"image/webp":return Wun(t);default:throw new Error("Unsupported image format")}}a(A4o,"getImageDimensionsFromBytes");function Qun(t){return Hun(p$e(t.slice(0,50)))}a(Qun,"getPngDimensions");function qun(t){return Gun(p$e(t.slice(0,50)))}a(qun,"getGifDimensions");function jun(t){return $un(p$e(t))}a(jun,"getJpegDimensions");function Hun(t){if(!zun(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(Hun,"getPngDimensionsFromBytes");function Gun(t){if(!s8t(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(Gun,"getGifDimensionsFromBytes");function $un(t){if(!zun(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a($un,"getJpegDimensionsFromBytes");function Vun(t){return Wun(p$e(t))}a(Vun,"getWebPDimensions");function Wun(t){if(!s8t(t,0,"RIFF")||!s8t(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=E4o(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(Wun,"getWebPDimensionsFromBytes");function y4o(t){return t?.toLowerCase().split(";")[0].trim()}a(y4o,"normalizeMimeType");function p$e(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(p$e,"base64ToBytes");function zun(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(H7,"__esModule",{value:!0});H7.IInstantiationService=H7._util=void 0;H7.createDecorator=Kun;H7.refineServiceDecorator=C4o;var GL;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(GL||(H7._util=GL={}));H7.IInstantiationService=Kun("instantiationService");function v4o(t,e,r){e[GL.DI_TARGET]===e?e[GL.DI_DEPENDENCIES].push({id:t,index:r}):(e[GL.DI_DEPENDENCIES]=[{id:t,index:r}],e[GL.DI_TARGET]=e)}a(v4o,"storeServiceDependency");function Kun(t){if(GL.serviceIds.has(t))return GL.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");v4o(e,r,o)},"id");return e.toString=()=>t,GL.serviceIds.set(t,e),e}a(Kun,"createDecorator");function C4o(t){return t}a(C4o,"refineServiceDecorator")});var dce=I(h$e=>{"use strict";p();Object.defineProperty(h$e,"__esModule",{value:!0});h$e.LinkedList=void 0;var ou=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},c8t=class{static{a(this,"LinkedList")}constructor(){this._first=ou.Undefined,this._last=ou.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ou.Undefined}clear(){let e=this._first;for(;e!==ou.Undefined;){let r=e.next;e.prev=ou.Undefined,e.next=ou.Undefined,e=r}this._first=ou.Undefined,this._last=ou.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,r){let n=new ou(e);if(this._first===ou.Undefined)this._first=n,this._last=n;else if(r){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let o=!1;return()=>{o||(o=!0,this._remove(n))}}shift(){if(this._first!==ou.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ou.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==ou.Undefined)return this._last.element}_remove(e){if(e.prev!==ou.Undefined&&e.next!==ou.Undefined){let r=e.prev;r.next=e.next,e.next.prev=r}else e.prev===ou.Undefined&&e.next===ou.Undefined?(this._first=ou.Undefined,this._last=ou.Undefined):e.next===ou.Undefined?(this._last=this._last.prev,this._last.next=ou.Undefined):e.prev===ou.Undefined&&(this._first=this._first.next,this._first.prev=ou.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ou.Undefined;)yield e.element,e=e.next}};h$e.LinkedList=c8t});var edn=I(fce=>{"use strict";p();Object.defineProperty(fce,"__esModule",{value:!0});fce.getNLSMessages=Jun;fce.getNLSLanguage=Zun;fce.localize=S4o;fce.localize2=T4o;function Jun(){return globalThis._VSCODE_NLS_MESSAGES}a(Jun,"getNLSMessages");function Zun(){return globalThis._VSCODE_NLS_LANGUAGE}a(Zun,"getNLSLanguage");var b4o=Zun()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function m$e(t,e){let r;return e.length===0?r=t:r=t.replace(/\{(\d+)\}/g,(n,o)=>{let s=o[0],c=e[s],l=n;return typeof c=="string"?l=c:(typeof c=="number"||typeof c=="boolean"||c===void 0||c===null)&&(l=String(c)),l}),b4o&&(r="\uFF3B"+r.replace(/[aouei]/g,"$&$&")+"\uFF3D"),r}a(m$e,"_format");function S4o(t,e,...r){return m$e(typeof t=="number"?Xun(t,e):e,r)}a(S4o,"localize");function Xun(t,e){let r=Jun()?.[t];if(typeof r!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return r}a(Xun,"lookupMessage");function T4o(t,e,...r){let n;typeof t=="number"?n=Xun(t,e):n=e;let o=m$e(n,r);return{value:o,original:e===n?o:m$e(e,r)}}a(T4o,"localize2")});var G7=I(pr=>{"use strict";p();var I4o=pr&&pr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x4o=pr&&pr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w4o=pr&&pr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0,KSe=$L.indexOf("Macintosh")>=0,d8t=($L.indexOf("Macintosh")>=0||$L.indexOf("iPad")>=0||$L.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,zSe=$L.indexOf("Linux")>=0,cdn=$L?.indexOf("Mobi")>=0,u8t=!0,g$e=R4o.getNLSLanguage()||pr.LANGUAGE_DEFAULT,WSe=navigator.language.toLowerCase(),l8t=WSe):console.error("Unable to resolve platform.");function k4o(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}a(k4o,"PlatformToString");var A$e=0;KSe?A$e=1:YSe?A$e=3:zSe&&(A$e=2);pr.isWindows=YSe;pr.isMacintosh=KSe;pr.isLinux=zSe;pr.isLinuxSnap=idn;pr.isNative=odn;pr.isElectron=sdn;pr.isWeb=u8t;pr.isWebWorker=u8t&&typeof VL.importScripts=="function";pr.webWorkerOrigin=pr.isWebWorker?VL.origin:void 0;pr.isIOS=d8t;pr.isMobile=cdn;pr.isCI=adn;pr.platform=A$e;pr.userAgent=$L;pr.language=g$e;var tdn;(function(t){function e(){return pr.language}a(e,"value"),t.value=e;function r(){return pr.language.length===2?pr.language==="en":pr.language.length>=3?pr.language[0]==="e"&&pr.language[1]==="n"&&pr.language[2]==="-":!1}a(r,"isDefaultVariant"),t.isDefaultVariant=r;function n(){return pr.language==="en"}a(n,"isDefault"),t.isDefault=n})(tdn||(pr.Language=tdn={}));pr.locale=WSe;pr.platformLocale=l8t;pr.translationsConfigFile=ldn;pr.setTimeout0IsFaster=typeof VL.postMessage=="function"&&!VL.importScripts;pr.setTimeout0=(()=>{if(pr.setTimeout0IsFaster){let t=[];VL.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),VL.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();pr.OS=KSe||d8t?2:YSe?1:3;var rdn=!0,ndn=!1;function D4o(){if(!ndn){ndn=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,rdn=new Uint16Array(t.buffer)[0]===513}return rdn}a(D4o,"isLittleEndian");pr.isChrome=!!(pr.userAgent&&pr.userAgent.indexOf("Chrome")>=0);pr.isFirefox=!!(pr.userAgent&&pr.userAgent.indexOf("Firefox")>=0);pr.isSafari=!!(!pr.isChrome&&pr.userAgent&&pr.userAgent.indexOf("Safari")>=0);pr.isEdge=!!(pr.userAgent&&pr.userAgent.indexOf("Edg/")>=0);pr.isAndroid=!!(pr.userAgent&&pr.userAgent.indexOf("Android")>=0);function N4o(t){return parseFloat(t)>=25}a(N4o,"isTahoeOrNewer")});var JSe=I(DM=>{"use strict";p();Object.defineProperty(DM,"__esModule",{value:!0});DM.arch=DM.platform=DM.env=DM.cwd=void 0;var ddn=G7(),aY,f8t=globalThis.vscode;if(typeof f8t<"u"&&typeof f8t.process<"u"){let t=f8t.process;aY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?aY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:aY={get platform(){return ddn.isWindows?"win32":ddn.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};DM.cwd=aY.cwd;DM.env=aY.env;DM.platform=aY.platform;DM.arch=aY.arch});var NM=I(y$e=>{"use strict";p();Object.defineProperty(y$e,"__esModule",{value:!0});y$e.StopWatch=void 0;var M4o=globalThis.performance.now.bind(globalThis.performance),p8t=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:M4o,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}};y$e.StopWatch=p8t});var _c=I(qa=>{"use strict";p();Object.defineProperty(qa,"__esModule",{value:!0});qa.ValueWithChangeEvent=qa.Relay=qa.EventBufferer=qa.DynamicListEventMultiplexer=qa.EventMultiplexer=qa.MicrotaskEmitter=qa.DebounceEmitter=qa.PauseableEmitter=qa.AsyncEmitter=qa.createEventDeliveryQueue=qa.Emitter=qa.ListenerRefusalError=qa.ListenerLeakError=qa.EventProfiling=qa.Event=void 0;qa.setGlobalLeakWarningThreshold=q4o;qa.trackSetChanges=$4o;var O4o=k3t(),ZSe=bs(),B4o=q3t(),gC=Io(),gdn=dce(),L4o=JSe(),F4o=NM(),fdn=!1,U4o=!1,Q4o=100,pdn=6e4;function hdn(){return!!L4o.env.VSCODE_DEV}a(hdn,"_isBufferLeakWarningEnabled");var E$e;(function(t){t.None=()=>gC.Disposable.None;function e(M){if(U4o){let{onDidAddListener:O}=M,q=hce.create(),Q=0;M.onDidAddListener=()=>{++Q===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),q.print()),O?.()}}}a(e,"_addLeakageTraceLogic");function r(M,O,q){return g(M,()=>{},0,void 0,O??!0,void 0,q)}a(r,"defer"),t.defer=r;function n(M){return(O,q=null,Q)=>{let U=!1,z;return z=M(W=>{if(!U)return z?z.dispose():U=!0,O.call(q,W)},null,Q),U&&z.dispose(),z}}a(n,"once"),t.once=n;function o(M,O){return t.once(t.filter(M,O))}a(o,"onceIf"),t.onceIf=o;function s(M,O,q){return h((Q,U=null,z)=>M(W=>Q.call(U,O(W)),null,z),q)}a(s,"map"),t.map=s;function c(M,O,q){return h((Q,U=null,z)=>M(W=>{O(W),Q.call(U,W)},null,z),q)}a(c,"forEach"),t.forEach=c;function l(M,O,q){return h((Q,U=null,z)=>M(W=>O(W)&&Q.call(U,W),null,z),q)}a(l,"filter"),t.filter=l;function u(M){return M}a(u,"signal"),t.signal=u;function d(...M){return(O,q=null,Q)=>{let U=(0,gC.combinedDisposable)(...M.map(z=>z(W=>O.call(q,W))));return m(U,Q)}}a(d,"any"),t.any=d;function f(M,O,q,Q){let U=q;return s(M,z=>(U=O(U,z),U),Q)}a(f,"reduce"),t.reduce=f;function h(M,O){let q,Q={onWillAddFirstListener(){q=M(U.fire,U)},onDidRemoveLastListener(){q?.dispose()}};O||e(Q);let U=new Qy(Q);return O?.add(U),U.event}a(h,"snapshot");function m(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}a(m,"addAndReturnDisposable");function g(M,O,q=100,Q=!1,U=!1,z,W){let $,J,ne,H=0,re,ae={leakWarningThreshold:z,onWillAddFirstListener(){$=M(ve=>{H++,J=O(J,ve),Q&&!ne&&(Oe.fire(J),J=void 0),re=a(()=>{let Fe=J;J=void 0,ne=void 0,(!Q||H>1)&&Oe.fire(Fe),H=0},"doFire"),typeof q=="number"?(ne&&clearTimeout(ne),ne=setTimeout(re,q)):ne===void 0&&(ne=null,queueMicrotask(re))})},onWillRemoveListener(){U&&H>0&&re?.()},onDidRemoveLastListener(){re=void 0,$.dispose()}};W||e(ae);let Oe=new Qy(ae);return W?.add(Oe),Oe.event}a(g,"debounce"),t.debounce=g;function A(M,O=0,q,Q){return t.debounce(M,(U,z)=>U?(U.push(z),U):[z],O,void 0,q??!0,void 0,Q)}a(A,"accumulate"),t.accumulate=A;function y(M,O,q=100,Q=!0,U=!0,z,W){let $,J,ne,H=0,re={leakWarningThreshold:z,onWillAddFirstListener(){$=M(Oe=>{H++,J=O(J,Oe),ne===void 0&&(Q&&(ae.fire(J),J=void 0,H=0),typeof q=="number"?ne=setTimeout(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0},q):(ne=0,queueMicrotask(()=>{U&&H>0&&ae.fire(J),J=void 0,ne=void 0,H=0})))})},onDidRemoveLastListener(){$.dispose()}};W||e(re);let ae=new Qy(re);return W?.add(ae),ae.event}a(y,"throttle"),t.throttle=y;function E(M,O=(Q,U)=>Q===U,q){let Q=!0,U;return l(M,z=>{let W=Q||!O(z,U);return Q=!1,U=z,W},q)}a(E,"latch"),t.latch=E;function _(M,O,q){return[t.filter(M,O,q),t.filter(M,Q=>!O(Q),q)]}a(_,"split"),t.split=_;function v(M,O,q=!1,Q=[],U){let z=Q.slice(),W;hdn()&&(W={stack:hce.create(),timerId:setTimeout(()=>{z&&z.length>0&&W&&!W.warned&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered for ${pdn/1e3}s without being consumed. Buffered here:`),W.stack.print())},pdn),warned:!1},U&&U.add((0,gC.toDisposable)(()=>clearTimeout(W.timerId))));let $=a(()=>{W&&clearTimeout(W.timerId)},"clearLeakWarningTimer"),J=M(re=>{z?(z.push(re),hdn()&&W&&!W.warned&&z.length>=Q4o&&(W.warned=!0,console.warn(`[Event.buffer][${O}] potential LEAK detected: ${z.length} events buffered without being consumed. Buffered here:`),W.stack.print())):H.fire(re)});U&&U.add(J);let ne=a(()=>{z?.forEach(re=>H.fire(re)),z=null,$()},"flush"),H=new Qy({onWillAddFirstListener(){J||(J=M(re=>H.fire(re)),U&&U.add(J))},onDidAddFirstListener(){z&&(q?setTimeout(ne):ne())},onDidRemoveLastListener(){J&&J.dispose(),J=null,$()}});return U&&U.add(H),H.event}a(v,"buffer"),t.buffer=v;function b(M,O){return a((Q,U,z)=>{let W=O(new w);return M(function($){let J=W.evaluate($);J!==T&&Q.call(U,J)},void 0,z)},"fn")}a(b,"chain"),t.chain=b;let T=Symbol("HaltChainable");class w{static{a(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(q=>(O(q),q)),this}filter(O){return this.steps.push(q=>O(q)?q:T),this}reduce(O,q){let Q=q;return this.steps.push(U=>(Q=O(Q,U),Q)),this}latch(O=(q,Q)=>q===Q){let q=!0,Q;return this.steps.push(U=>{let z=q||!O(U,Q);return q=!1,Q=U,z?U:T}),this}evaluate(O){for(let q of this.steps)if(O=q(O),O===T)break;return O}}function R(M,O,q=Q=>Q){let Q=a((...$)=>W.fire(q(...$)),"fn"),U=a(()=>M.on(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeListener(O,Q),"onLastListenerRemove"),W=new Qy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return W.event}a(R,"fromNodeEventEmitter"),t.fromNodeEventEmitter=R;function x(M,O,q=Q=>Q){let Q=a((...$)=>W.fire(q(...$)),"fn"),U=a(()=>M.addEventListener(O,Q),"onFirstListenerAdd"),z=a(()=>M.removeEventListener(O,Q),"onLastListenerRemove"),W=new Qy({onWillAddFirstListener:U,onDidRemoveLastListener:z});return W.event}a(x,"fromDOMEventEmitter"),t.fromDOMEventEmitter=x;function P(M,O){let q,Q,U=new Promise(z=>{Q=n(M)(z),b8t(Q,O),q=a(()=>{mdn(Q,O)},"cancelRef")});return U.cancel=q,O&&U.finally(()=>mdn(Q,O)),U}a(P,"toPromise"),t.toPromise=P;function D(M,O){return M(q=>O.fire(q))}a(D,"forward"),t.forward=D;function N(M,O,q){return O(q),M(Q=>O(Q))}a(N,"runAndSubscribe"),t.runAndSubscribe=N;class B{static{a(this,"EmitterObserver")}constructor(O,q){this._observable=O,this._counter=0,this._hasChanged=!1;let Q={onWillAddFirstListener:a(()=>{O.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{O.removeObserver(this)},"onDidRemoveLastListener")};q||e(Q),this.emitter=new Qy(Q),q&&q.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,q){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function L(M,O){return new B(M,O).emitter.event}a(L,"fromObservable"),t.fromObservable=L;function j(M){return(O,q,Q)=>{let U=0,z=!1,W={beginUpdate(){U++},endUpdate(){U--,U===0&&(M.reportChanges(),z&&(z=!1,O.call(q)))},handlePossibleChange(){},handleChange(){z=!0}};M.addObserver(W),M.reportChanges();let $={dispose(){M.removeObserver(W)}};return b8t($,Q),$}}a(j,"fromObservableLight"),t.fromObservableLight=j})(E$e||(qa.Event=E$e={}));var _$e=class t{static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new F4o.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};qa.EventProfiling=_$e;var XSe=-1;function q4o(t){let e=XSe;return XSe=t,{dispose(){XSe=e}}}a(q4o,"setGlobalLeakWarningThreshold");var h8t=class t{static{a(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r.3?"dominated":"popular",f=new eTe(d,u,s,r,l);this._errorHandler(f)}return()=>{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof Cle)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new IQt(e?.onListenerError??qIe.onUnexpectedError,this._options?.leakWarningThreshold??jIe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new bKe(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(rCn){let e=this._listeners;queueMicrotask(()=>{aCn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new SKe(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||qIe.onUnexpectedError)(h),Nv.Disposable.None}if(this._disposed)return Nv.Disposable.None;r&&(e=e.bind(r));let o=new Cle(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=vle.create(),s=this._leakageMon.check(o.stack,this._size+1)),rCn&&(o.stack=c??vle.create()),this._listeners?this._listeners instanceof Cle?(this._deliveryQueue??=new TKe,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,Nv.toDisposable)(()=>{s?.(),this._removeListener(o)});return OQt(l,n),l},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 r=this._listeners,n=r.indexOf(e);if(n===-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--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*lHo<=r.length){let s=0;for(let c=0;c0}};ja.Emitter=Yy;var uHo=a(()=>new TKe,"createEventDeliveryQueue");ja.createEventDeliveryQueue=uHo;var TKe=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},xQt=class extends Yy{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new sCn.LinkedList),aCn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,qIe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,qIe.onUnexpectedError)(d.reason)})}}};ja.AsyncEmitter=xQt;var IKe=class extends Yy{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new sCn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};ja.PauseableEmitter=IKe;var wQt=class extends IKe{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};ja.DebounceEmitter=wQt;var RQt=class extends Yy{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};ja.MicrotaskEmitter=RQt;var xKe=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Yy({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,Nv.toDisposable)((0,rHo.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};ja.EventMultiplexer=xKe;var kQt=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new Nv.DisposableStore;let s=this._store.add(new xKe),c=this._store.add(new Nv.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};ja.DynamicListEventMultiplexer=kQt;var PQt=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};ja.EventBufferer=PQt;var DQt=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=vKe.None,this.inputEventListener=Nv.Disposable.None,this.emitter=new Yy({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};ja.Relay=DQt;var NQt=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new MQt(e)}constructor(e){this._value=e,this._onDidChange=new Yy,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};ja.ValueWithChangeEvent=NQt;var MQt=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=vKe.None}};function dHo(t,e,r){let n=new Nv.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new Nv.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,tHo.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a(dHo,"trackSetChanges");function OQt(t,e){e instanceof Nv.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(OQt,"addToDisposables");function oCn(t,e){if(e instanceof Nv.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(oCn,"disposeAndRemove")});var SP=I(A3=>{"use strict";p();Object.defineProperty(A3,"__esModule",{value:!0});A3.CancellationTokenPool=A3.CancellationTokenSource=A3.CancellationToken=void 0;A3.cancelOnDispose=pHo;var cCn=Sc(),fHo=ko(),lCn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),wKe;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof ble?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:cCn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:lCn})})(wKe||(A3.CancellationToken=wKe={}));var ble=class{static{a(this,"MutableToken")}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?lCn:(this._emitter||(this._emitter=new cCn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},GIe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new ble),this._token}cancel(){this._token?this._token instanceof ble&&this._token.cancel():this._token=wKe.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof ble&&this._token.dispose():this._token=wKe.None}};A3.CancellationTokenSource=GIe;function pHo(t){let e=new GIe;return t.add({dispose(){e.cancel()}}),e.token}a(pHo,"cancelOnDispose");var BQt=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new GIe,this._listeners=new fHo.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};A3.CancellationTokenPool=BQt});var hA=I(Kr=>{"use strict";p();var hHo=Kr&&Kr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mHo=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),gHo=Kr&&Kr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=AHo&&t<=EHo||t>=yHo&&t<=_Ho}a(E3,"isWindowsDeviceRoot");function kKe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===gK&&l!==-1?++l:l=-1}return o}a(kKe,"normalizeString");function bHo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(bHo,"formatExt");function uCn(t,e){vHo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${bHo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(uCn,"_format");Kr.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Jf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=Sle.cwd():(s=Sle.env[`=${e}`]||Sle.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===Mv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)zo(f)&&(l=1,d=!0);else if(zo(f))if(d=!0,zo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&zo(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=kKe(r,!n,"\\",zo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Jf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return LQt(s)?"\\":t;if(zo(s))if(o=!0,zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&zo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&zo(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&E3(c.charCodeAt(0))&&c.charCodeAt(1)===y3)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||zo(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Jf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return zo(r)||e>2&&E3(r)&&t.charCodeAt(1)===y3&&zo(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&zo(r.charCodeAt(0))){++o;let s=r.length;s>1&&zo(r.charCodeAt(1))&&(++o,s>2&&(zo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Kr.win32.normalize(e)},relative(t,e){if(Jf(t,"from"),Jf(e,"to"),t===e)return"";let r=Kr.win32.resolve(t),n=Kr.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===Mv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===Mv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===Mv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===Mv?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===Mv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===Mv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Kr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===Mv){if(e.charCodeAt(1)===Mv){let r=e.charCodeAt(2);if(r!==CHo&&r!==gK)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(E3(e.charCodeAt(0))&&e.charCodeAt(1)===y3&&e.charCodeAt(2)===Mv)return`\\\\?\\${e}`;return e},dirname(t){Jf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return zo(o)?t:".";if(zo(o)){if(r=n=1,zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&zo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(zo(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Jf(e,"suffix"),Jf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&E3(t.charCodeAt(0))&&t.charCodeAt(1)===y3&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(zo(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(zo(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Jf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===y3&&E3(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(zo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===gK?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:uCn.bind(null,"\\"),parse(t){Jf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return zo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(zo(o)){if(n=1,zo(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),zo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===gK?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var SHo=(()=>{if(Ov){let t=/\\/g;return()=>{let e=Sle.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>Sle.cwd()})();Kr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Jf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===og)}if(!r){let n=SHo();e=`${n}/${e}`,r=n.charCodeAt(0)===og}return e=kKe(e,!r,"/",LQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Jf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=t.charCodeAt(t.length-1)===og;return t=kKe(t,!e,"/",LQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Jf(t,"path"),t.length>0&&t.charCodeAt(0)===og},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Kr.posix.normalize(e.join("/"))},relative(t,e){if(Jf(t,"from"),Jf(e,"to"),t===e||(t=Kr.posix.resolve(t),e=Kr.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===og)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===og?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===og)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Jf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===og,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===og){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Jf(e,"suffix"),Jf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===og){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===og){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Jf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:uCn.bind(null,"/"),parse(t){Jf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===og,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===og){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===gK?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Kr.posix.win32=Kr.win32.win32=Kr.win32;Kr.posix.posix=Kr.win32.posix=Kr.posix;Kr.normalize=Ov?Kr.win32.normalize:Kr.posix.normalize;Kr.isAbsolute=Ov?Kr.win32.isAbsolute:Kr.posix.isAbsolute;Kr.join=Ov?Kr.win32.join:Kr.posix.join;Kr.resolve=Ov?Kr.win32.resolve:Kr.posix.resolve;Kr.relative=Ov?Kr.win32.relative:Kr.posix.relative;Kr.dirname=Ov?Kr.win32.dirname:Kr.posix.dirname;Kr.basename=Ov?Kr.win32.basename:Kr.posix.basename;Kr.extname=Ov?Kr.win32.extname:Kr.posix.extname;Kr.format=Ov?Kr.win32.format:Kr.posix.format;Kr.parse=Ov?Kr.win32.parse:Kr.posix.parse;Kr.toNamespacedPath=Ov?Kr.win32.toNamespacedPath:Kr.posix.toNamespacedPath;Kr.sep=Ov?Kr.win32.sep:Kr.posix.sep;Kr.delimiter=Ov?Kr.win32.delimiter:Kr.posix.delimiter});var DKe=I(TP=>{"use strict";p();Object.defineProperty(TP,"__esModule",{value:!0});TP.WeakCachedFunction=TP.CachedFunction=TP.LRUCachedFunction=TP.Cache=void 0;TP.identity=PKe;var THo=SP(),FQt=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new THo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};TP.Cache=FQt;function PKe(t){return t}a(PKe,"identity");var UQt=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=PKe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};TP.LRUCachedFunction=UQt;var QQt=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=PKe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};TP.CachedFunction=QQt;var qQt=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=PKe):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};TP.WeakCachedFunction=qQt});var _3=I(NKe=>{"use strict";p();Object.defineProperty(NKe,"__esModule",{value:!0});NKe.Lazy=void 0;var tq;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(tq||(tq={}));var jQt=class{static{a(this,"Lazy")}constructor(e){this.executor=e,this._state=tq.Uninitialized}get hasValue(){return this._state===tq.Completed}get value(){if(this._state===tq.Uninitialized){this._state=tq.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=tq.Completed}}else if(this._state===tq.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};NKe.Lazy=jQt});var Gh=I(Rr=>{"use strict";p();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.Ellipsis=Rr.InvisibleCharacters=Rr.AmbiguousCharacters=Rr.noBreakWhitespace=Rr.UTF8_BOM_CHARACTER=Rr.UNUSUAL_LINE_TERMINATORS=Rr.GraphemeIterator=Rr.CodePointIterator=void 0;Rr.isFalsyOrWhitespace=xHo;Rr.format=RHo;Rr.format2=PHo;Rr.htmlAttributeEncodeValue=DHo;Rr.escape=NHo;Rr.escapeRegExpCharacters=pCn;Rr.count=MHo;Rr.truncate=OHo;Rr.truncateMiddle=BHo;Rr.trim=LHo;Rr.ltrim=hCn;Rr.rtrim=mCn;Rr.convertSimple2RegExpPattern=FHo;Rr.createRegExp=UHo;Rr.regExpLeadsToEndlessLoop=QHo;Rr.joinStrings=qHo;Rr.splitLines=jHo;Rr.splitLinesIncludeSeparators=HHo;Rr.indexOfPattern=GHo;Rr.firstNonWhitespaceIndex=gCn;Rr.getLeadingWhitespace=$Ho;Rr.lastNonWhitespaceIndex=VHo;Rr.getIndentationLength=WHo;Rr.replaceAsync=zHo;Rr.compare=YHo;Rr.compareSubstring=ACn;Rr.compareIgnoreCase=KHo;Rr.compareSubstringIgnoreCase=VIe;Rr.isAsciiDigit=JHo;Rr.isLowerAsciiLetter=GQt;Rr.isUpperAsciiLetter=ZHo;Rr.equalsIgnoreCase=yCn;Rr.equals=XHo;Rr.startsWithIgnoreCase=eGo;Rr.endsWithIgnoreCase=tGo;Rr.commonPrefixLength=rGo;Rr.commonSuffixLength=nGo;Rr.isHighSurrogate=WQt;Rr.isLowSurrogate=MKe;Rr.computeCodePoint=zQt;Rr.getNextCodePoint=ECn;Rr.nextCharLength=_Cn;Rr.prevCharLength=CCn;Rr.getCharContainingOffset=oGo;Rr.charCount=sGo;Rr.containsRTL=cGo;Rr.isBasicASCII=uGo;Rr.containsUnusualLineTerminators=dGo;Rr.isFullWidthCharacter=fGo;Rr.isEmojiImprecise=vCn;Rr.lcut=pGo;Rr.rcut=hGo;Rr.forAnsiStringParts=yGo;Rr.removeAnsiEscapeCodes=SCn;Rr.removeAnsiEscapeCodesFromPrompt=_Go;Rr.startsWithUTF8BOM=TCn;Rr.stripUTF8BOM=CGo;Rr.fuzzyContains=vGo;Rr.containsUppercaseCharacter=bGo;Rr.uppercaseFirstLetter=SGo;Rr.getNLines=TGo;Rr.singleLetterHash=IGo;Rr.getGraphemeBreakType=xGo;Rr.getLeftDeleteOffset=RGo;Rr.multibyteAwareBtoa=NGo;var IHo=DKe(),dCn=_3();function xHo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(xHo,"isFalsyOrWhitespace");var wHo=/{(\d+)}/g;function RHo(t,...e){return e.length===0?t:t.replace(wHo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(RHo,"format");var kHo=/{([^}]+)}/g;function PHo(t,e){return Object.keys(e).length===0?t:t.replace(kHo,(r,n)=>e[n]??r)}a(PHo,"format2");function DHo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(DHo,"htmlAttributeEncodeValue");function NHo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(NHo,"escape");function pCn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(pCn,"escapeRegExpCharacters");function MHo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(MHo,"count");function OHo(t,e,r=Rr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(OHo,"truncate");function BHo(t,e,r=Rr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(BHo,"truncateMiddle");function LHo(t,e=" "){let r=hCn(t,e);return mCn(r,e)}a(LHo,"trim");function hCn(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(mCn,"rtrim");function FHo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(FHo,"convertSimple2RegExpPattern");function UHo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=pCn(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a(UHo,"createRegExp");function QHo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(QHo,"regExpLeadsToEndlessLoop");function qHo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(qHo,"joinStrings");function jHo(t){return t.split(/\r\n|\r|\n/)}a(jHo,"splitLines");function HHo(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(VHo,"lastNonWhitespaceIndex");function WHo(t){let e=gCn(t);return e===-1?t.length:e}a(WHo,"getIndentationLength");function zHo(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(zHo,"replaceAsync");function YHo(t,e){return te?1:0}a(YHo,"compare");function ACn(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(ACn,"compareSubstring");function KHo(t,e){return VIe(t,e,0,t.length,0,e.length)}a(KHo,"compareIgnoreCase");function VIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return ACn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);GQt(u)&&(u-=32),GQt(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(VIe,"compareSubstringIgnoreCase");function JHo(t){return t>=48&&t<=57}a(JHo,"isAsciiDigit");function GQt(t){return t>=97&&t<=122}a(GQt,"isLowerAsciiLetter");function ZHo(t){return t>=65&&t<=90}a(ZHo,"isUpperAsciiLetter");function yCn(t,e){return t.length===e.length&&VIe(t,e)===0}a(yCn,"equalsIgnoreCase");function XHo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&yCn(t,e)}a(XHo,"equals");function eGo(t,e){let r=e.length;return r<=t.length&&VIe(t,e,0,r)===0}a(eGo,"startsWithIgnoreCase");function tGo(t,e){let r=t.length,n=r-e.length;return n>=0&&VIe(t,e,n,r)===0}a(tGo,"endsWithIgnoreCase");function rGo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(WQt(n))return zQt(n,r)}return r}a(iGo,"getPrevCodePoint");var Tle=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=iGo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=ECn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};Rr.CodePointIterator=Tle;var Ile=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new Tle(e,r)}nextGraphemeLength(){let e=$Ie.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(fCn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=$Ie.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(fCn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};Rr.GraphemeIterator=Ile;function _Cn(t,e){return new Ile(t,e).nextGraphemeLength()}a(_Cn,"nextCharLength");function CCn(t,e){return new Ile(t,e).prevGraphemeLength()}a(CCn,"prevCharLength");function oGo(t,e){e>0&&MKe(t.charCodeAt(e))&&e--;let r=e+_Cn(t,e);return[r-CCn(t,r),r]}a(oGo,"getCharContainingOffset");function sGo(t){let e=new Ile(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(sGo,"charCount");var HQt;function aGo(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(aGo,"makeContainsRtl");function cGo(t){return HQt||(HQt=aGo()),HQt.test(t)}a(cGo,"containsRTL");var lGo=/^[\t\n\r\x20-\x7E]*$/;function uGo(t){return lGo.test(t)}a(uGo,"isBasicASCII");Rr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function dGo(t){return Rr.UNUSUAL_LINE_TERMINATORS.test(t)}a(dGo,"containsUnusualLineTerminators");function fGo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(fGo,"isFullWidthCharacter");function vCn(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a(vCn,"isEmojiImprecise");function pGo(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,gGo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,AGo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,bCn=new RegExp("(?:"+[mGo.source,gGo.source,AGo.source].join("|")+")","g");function*yGo(t){let e=0;for(let r of t.matchAll(bCn))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(yGo,"forAnsiStringParts");function SCn(t){return t&&(t=t.replace(bCn,"")),t}a(SCn,"removeAnsiEscapeCodes");var EGo=/\\\[.*?\\\]/g;function _Go(t){return SCn(t).replace(EGo,"")}a(_Go,"removeAnsiEscapeCodesFromPrompt");Rr.UTF8_BOM_CHARACTER="\uFEFF";function TCn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(TCn,"startsWithUTF8BOM");function CGo(t){return TCn(t)?t.substr(1):t}a(CGo,"stripUTF8BOM");function vGo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(TGo,"getNLines");function IGo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(IGo,"singleLetterHash");function xGo(t){return $Ie.getInstance().getGraphemeBreakType(t)}a(xGo,"getGraphemeBreakType");function fCn(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(fCn,"breakBetweenGraphemeBreakType");var $Ie=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=wGo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function wGo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(wGo,"getGraphemeBreakRawData");function RGo(t,e){if(t===0)return 0;let r=kGo(t,e);if(r!==void 0)return r;let n=new Tle(e,t);return n.prevCodePoint(),n.offset}a(RGo,"getLeftDeleteOffset");function kGo(t,e){let r=new Tle(e,t),n=r.prevCodePoint();for(;PGo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!vCn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(kGo,"getOffsetBeforeLastEmojiComponent");function PGo(t){return 127995<=t&&t<=127999}a(PGo,"isEmojiModifier");Rr.noBreakWhitespace="\xA0";var $Qt=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new dCn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new IHo.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new dCn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty(K0,"__esModule",{value:!0});K0.isPathSeparator=C3;K0.toSlashes=ICn;K0.toPosixPath=OGo;K0.getRoot=BGo;K0.isUNC=LGo;K0.isValidBasename=qGo;K0.isEqual=jGo;K0.isEqualOrParent=HGo;K0.isWindowsDriveLetter=YQt;K0.sanitizeFilePath=GGo;K0.removeTrailingPathSeparator=xCn;K0.isRootOrDriveLetter=$Go;K0.hasDriveLetter=KQt;K0.getDriveLetter=VGo;K0.indexOfPath=WGo;K0.parseLineAndColumnAware=zGo;K0.randomPath=JGo;var Bv=hA(),rq=eq(),OKe=Gh(),MGo=BS();function C3(t){return t===47||t===92}a(C3,"isPathSeparator");function ICn(t){return t.replace(/[\\/]/g,Bv.posix.sep)}a(ICn,"toSlashes");function OGo(t){return t.indexOf("/")===-1&&(t=ICn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(OGo,"toPosixPath");function BGo(t,e=Bv.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(C3(n)){if(C3(t.charCodeAt(1))&&!C3(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,UGo=/[/]/g,QGo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function qGo(t,e=rq.isWindows){let r=e?FGo:UGo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&QGo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(qGo,"isValidBasename");function jGo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,OKe.equalsIgnoreCase)(t,e)}a(jGo,"isEqual");function HGo(t,e,r,n=Bv.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(r){if(!(0,OKe.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(HGo,"isEqualOrParent");function YQt(t){return t>=65&&t<=90||t>=97&&t<=122}a(YQt,"isWindowsDriveLetter");function GGo(t,e){return rq.isWindows&&t.endsWith(":")&&(t+=Bv.sep),(0,Bv.isAbsolute)(t)||(t=(0,Bv.join)(e,t)),t=(0,Bv.normalize)(t),xCn(t)}a(GGo,"sanitizeFilePath");function xCn(t){return rq.isWindows?(t=(0,OKe.rtrim)(t,Bv.sep),t.endsWith(":")&&(t+=Bv.sep)):(t=(0,OKe.rtrim)(t,Bv.sep),t||(t=Bv.sep)),t}a(xCn,"removeTrailingPathSeparator");function $Go(t){let e=(0,Bv.normalize)(t);return rq.isWindows?t.length>3?!1:KQt(e)&&(t.length===2||e.charCodeAt(2)===92):e===Bv.posix.sep}a($Go,"isRootOrDriveLetter");function KQt(t,e=rq.isWindows){return e?YQt(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(KQt,"hasDriveLetter");function VGo(t,e=rq.isWindows){return KQt(t,e)?t[0]:void 0}a(VGo,"getDriveLetter");function WGo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(WGo,"indexOfPath");function zGo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,MGo.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(zGo,"parseLineAndColumnAware");var YGo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",KGo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function JGo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var ZGo=Fx&&Fx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XGo=Fx&&Fx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e$o=Fx&&Fx.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!r$o.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(n$o.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(i$o,"_validateUri");function o$o(t,e){return!t&&!e?"file":t}a(o$o,"_schemeFix");function s$o(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==IP&&(e=IP+e):e=IP;break}return e}a(s$o,"_referenceResolution");var Ul="",IP="/",a$o=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,FKe=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Ul,this.authority=e.authority||Ul,this.path=e.path||Ul,this.query=e.query||Ul,this.fragment=e.fragment||Ul):(this.scheme=o$o(e,c),this.authority=r||Ul,this.path=s$o(this.scheme,n||Ul),this.query=o||Ul,this.fragment=s||Ul,i$o(this,c))}get fsPath(){return UKe(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Ul),n===void 0?n=this.authority:n===null&&(n=Ul),o===void 0?o=this.path:o===null&&(o=Ul),s===void 0?s=this.query:s===null&&(s=Ul),c===void 0?c=this.fragment:c===null&&(c=Ul),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new nq(r,n,o,s,c)}static parse(e,r=!1){let n=a$o.exec(e);return n?new nq(n[2]||Ul,BKe(n[4]||Ul),BKe(n[5]||Ul),BKe(n[7]||Ul),BKe(n[9]||Ul),r):new nq(Ul,Ul,Ul,Ul,Ul)}static file(e){let r=Ul;if(LKe.isWindows&&(e=e.replace(/\\/g,IP)),e[0]===IP&&e[1]===IP){let n=e.indexOf(IP,2);n===-1?(r=e.substring(2),e=IP):(r=e.substring(2,n),e=e.substring(n)||IP)}return new nq("file",r,e,Ul,Ul)}static from(e,r){return new nq(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return LKe.isWindows&&e.scheme==="file"?n=t.file(wCn.win32.join(UKe(e,!0),...r)).path:n=wCn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return ZQt(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new nq(e);return r._formatted=e.external??null,r._fsPath=e._sep===PCn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};Fx.URI=FKe;function c$o(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(c$o,"isUriComponents");var PCn=LKe.isWindows?1:void 0,nq=class extends FKe{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=UKe(this,!1)),this._fsPath}toString(e=!1){return e?ZQt(this,!0):(this._formatted||(this._formatted=ZQt(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=PCn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},DCn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function RCn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=DCn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(RCn,"encodeURIComponentFast");function l$o(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,LKe.isWindows&&(r=r.replace(/\//g,"\\")),r}a(UKe,"uriToFsPath");function ZQt(t,e){let r=e?l$o:RCn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=IP,n+=IP),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:RCn(u,!1,!1)),n}a(ZQt,"_asFormatted");function NCn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+NCn(t.substr(3)):t}}a(NCn,"decodeURIComponentGraceful");var kCn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function BKe(t){return t.match(kCn)?t.replace(kCn,e=>NCn(e)):t}a(BKe,"percentDecode")});var yK=I(ls=>{"use strict";p();var u$o=ls&&ls.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d$o=ls&&ls.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nqt=ls&&ls.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oBCn(t,r))}a(p$o,"matchesSomeScheme");ls.connectionTokenCookieName="vscode-tkn";ls.connectionTokenQueryName="tkn";var tqt=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=eqt.posix.join(r??"/",LCn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return eqt.posix.join(this._serverRootPath,lO.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return f$o.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${ls.connectionTokenQueryName}=${encodeURIComponent(s)}`),AK.URI.from({scheme:XQt.isWeb?this._preferredWebSchema:lO.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};ls.RemoteAuthorities=new tqt;function LCn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(LCn,"getServerProductSegment");ls.builtinExtensionsPath="vs/../../extensions";ls.nodeModulesPath="vs/../../node_modules";ls.nodeModulesAsarPath="vs/../../node_modules.asar";ls.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";ls.VSCODE_AUTHORITY="vscode-app";var rqt=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=ls.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===lO.vscodeRemote?ls.RemoteAuthorities.rewrite(e):e.scheme===lO.file&&(XQt.isNative||XQt.webWorkerOrigin===`${lO.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:lO.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===lO.vscodeFileResource?e.with({scheme:lO.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(AK.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return AK.URI.joinPath(AK.URI.parse(r,!0),e);let n=eqt.join(r,e);return AK.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};ls.FileAccess=new rqt;ls.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});ls.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var OCn;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:AK.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})(OCn||(ls.COI=OCn={}))});var xP=I(yr=>{"use strict";p();var h$o=yr&&yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),m$o=yr&&yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QCn=yr&&yr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oxle.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=N_.sep){return(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=N_.sep){let n=!1;if(e.scheme===iq.Schemas.file){let o=uO(e);n=o!==void 0&&o.length===xle.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,yr.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};yr.ExtUri=wle;yr.extUri=new wle(()=>!1);yr.extUriBiasedIgnorePathCase=new wle(t=>t.scheme===iq.Schemas.file?!qCn.isLinux:!0);yr.extUriIgnorePathCase=new wle(t=>!0);yr.isEqual=yr.extUri.isEqual.bind(yr.extUri);yr.isEqualOrParent=yr.extUri.isEqualOrParent.bind(yr.extUri);yr.getComparisonKey=yr.extUri.getComparisonKey.bind(yr.extUri);yr.basenameOrAuthority=yr.extUri.basenameOrAuthority.bind(yr.extUri);yr.basename=yr.extUri.basename.bind(yr.extUri);yr.extname=yr.extUri.extname.bind(yr.extUri);yr.dirname=yr.extUri.dirname.bind(yr.extUri);yr.joinPath=yr.extUri.joinPath.bind(yr.extUri);yr.normalizePath=yr.extUri.normalizePath.bind(yr.extUri);yr.relativePath=yr.extUri.relativePath.bind(yr.extUri);yr.resolvePath=yr.extUri.resolvePath.bind(yr.extUri);yr.isAbsolutePath=yr.extUri.isAbsolutePath.bind(yr.extUri);yr.isEqualAuthority=yr.extUri.isEqualAuthority.bind(yr.extUri);yr.hasTrailingPathSeparator=yr.extUri.hasTrailingPathSeparator.bind(yr.extUri);yr.removeTrailingPathSeparator=yr.extUri.removeTrailingPathSeparator.bind(yr.extUri);yr.addTrailingPathSeparator=yr.extUri.addTrailingPathSeparator.bind(yr.extUri);function g$o(t,e){let r=[];for(let n=0;nc===n?!1:(0,yr.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(g$o,"distinctParents");var UCn;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(UCn||(yr.DataUri=UCn={}));function A$o(t,e,r){if(e){let n=t.path;return n&&n[0]!==N_.posix.sep&&(n=N_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(A$o,"toLocalResource")});var jCn=I(QKe=>{"use strict";p();Object.defineProperty(QKe,"__esModule",{value:!0});QKe.MicrotaskDelay=void 0;QKe.MicrotaskDelay=Symbol("MicrotaskDelay")});var Xc=I(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AsyncReader=Yt.AsyncReaderEndOfStream=Yt.CancelableAsyncIterableProducer=Yt.AsyncIterableProducer=Yt.AsyncIterableSource=Yt.AsyncIterableObject=Yt.LazyStatefulPromise=Yt.StatefulPromise=Yt.Promises=Yt.DeferredPromise=Yt.IntervalCounter=Yt.TaskSequentializer=Yt.GlobalIdleValue=Yt.AbstractIdleValue=Yt._runWhenIdle=Yt.runWhenGlobalIdle=Yt.ThrottledWorker=Yt.RunOnceWorker=Yt.ProcessTimeRunOnceScheduler=Yt.RunOnceScheduler=Yt.IntervalTimer=Yt.TimeoutTimer=Yt.TaskQueue=Yt.ResourceQueue=Yt.LimitedQueue=Yt.Queue=Yt.Limiter=Yt.AutoOpenBarrier=Yt.Barrier=Yt.ThrottledDelayer=Yt.Delayer=Yt.SequencerByKey=Yt.Sequencer=Yt.Throttler=void 0;Yt.isThenable=$Cn;Yt.createCancelablePromise=VCn;Yt.raceCancellation=WCn;Yt.raceCancellationError=C$o;Yt.rejectIfNotCanceled=v$o;Yt.notCancellablePromise=b$o;Yt.raceCancellablePromises=S$o;Yt.raceTimeout=zCn;Yt.asPromise=T$o;Yt.promiseWithResolvers=YCn;Yt.timeout=bqt;Yt.disposableTimeout=w$o;Yt.sequence=R$o;Yt.first=k$o;Yt.firstParallel=P$o;Yt.installFakeRunWhenIdle=D$o;Yt.retry=N$o;Yt.createCancelableAsyncIterableProducer=M$o;Yt.cancellableIterable=O$o;Yt.createTimeout=B$o;var vqt=SP(),M_=Ts(),zIe=Sc(),oq=ko(),HCn=xP(),y$o=eq(),E$o=jCn(),_$o=_3();function $Cn(t){return!!t&&typeof t.then=="function"}a($Cn,"isThenable");function VCn(t){let e=new vqt.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new M_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,oq.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(VCn,"createCancelablePromise");function WCn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(WCn,"raceCancellation");function C$o(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new M_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(C$o,"raceCancellationError");function v$o(t){if(!(0,M_.isCancellationError)(t))return Promise.reject(t)}a(v$o,"rejectIfNotCanceled");function b$o(t){return new Promise((e,r)=>{t.then(e,r)})}a(b$o,"notCancellablePromise");function S$o(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(S$o,"raceCancellablePromises");function zCn(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(zCn,"raceTimeout");function T$o(t){return new Promise((e,r)=>{let n=t();$Cn(n)?n.then(e,r):e(n)})}a(T$o,"asPromise");function YCn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(YCn,"promiseWithResolvers");var qKe=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new vqt.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Yt.Throttler=qKe;var iqt=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=iqt;var oqt=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Yt.SequencerByKey=oqt;var I$o=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),x$o=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),jKe=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===E$o.MicrotaskDelay?x$o(n):I$o(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new M_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=jKe;var sqt=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new jKe(e),this.throttler=new qKe}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Yt.ThrottledDelayer=sqt;var HKe=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Yt.Barrier=HKe;var aqt=class extends HKe{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=aqt;function bqt(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new M_.CancellationError)})}):VCn(r=>bqt(t,r))}a(bqt,"timeout");function w$o(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,oq.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(w$o,"disposableTimeout");function R$o(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(k$o,"first");function P$o(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(P$o,"firstParallel");var GKe=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new zIe.Emitter}whenIdle(){return this.size>0?zIe.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Yt.Limiter=GKe;var $Ke=class extends GKe{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=$Ke;var cqt=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new WKe,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Yt.LimitedQueue=cqt;var lqt=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new v3;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=HCn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=HCn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new $Ke;let c=this.drainListenerCount++,l=zIe.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new oq.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Yt.ResourceQueue=lqt;var uqt=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new v3;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new v3;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new M_.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new M_.CancellationError)}};Yt.TaskQueue=uqt;var dqt=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new M_.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new M_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=dqt;var fqt=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new M_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,oq.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=fqt;var YIe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Yt.RunOnceScheduler=YIe;var pqt=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Yt.ProcessTimeRunOnceScheduler=pqt;var hqt=class extends YIe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Yt.RunOnceWorker=hqt;var mqt=class extends oq.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new oq.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new YIe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=mqt;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,y$o.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Yt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Yt.runWhenGlobalIdle=(e,r)=>(0,Yt._runWhenIdle)(globalThis,e,r)})();function D$o(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,oq.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(D$o,"installFakeRunWhenIdle");var VKe=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Yt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Yt.AbstractIdleValue=VKe;var gqt=class extends VKe{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=gqt;async function N$o(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=YCn();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Yt.TaskSequentializer=WKe;var Aqt=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Yt.IntervalCounter=Aqt;var v3=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new M_.CancellationError)}};Yt.DeferredPromise=v3;var GCn;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(GCn||(Yt.Promises=GCn={}));var zKe=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new M_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=zKe;var yqt=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new _$o.Lazy(()=>new zKe(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=yqt;var YKe=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new zIe.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yt.AsyncIterableObject=YKe;function M$o(t){let e=new vqt.CancellationTokenSource,r=t(e.token);return new JKe(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new M_.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a(M$o,"createCancelableAsyncIterableProducer");var Eqt=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new v3,this._asyncIterable=new YKe(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Yt.AsyncIterableSource=Eqt;function O$o(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await WCn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(O$o,"cancellableIterable");var _qt=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new M_.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new v3;return this._unsatisfiedConsumers.push(e),e.p}}},KKe=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new _qt,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new v3,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Yt.AsyncIterableProducer=KKe;var JKe=class extends KKe{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=JKe;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var Cqt=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Yt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Yt.AsyncReaderEndOfStream;throw new M_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await zCn(this._extendBuffer(),e),this._atEnd)return Yt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Yt.AsyncReader=Cqt;function B$o(t,e){let r=setTimeout(e,t);return(0,oq.toDisposable)(()=>clearTimeout(r))}a(B$o,"createTimeout")});var nvn=I(LS=>{"use strict";p();var q$o=LS&&LS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(LS,"__esModule",{value:!0});var j$o=require("fs"),H$o=q$o(Wk()),kle=H$o.default("@kwsites/file-exists");function G$o(t,e,r){kle("checking %s",t);try{let n=j$o.statSync(t);return n.isFile()&&e?(kle("[OK] path represents a file"),!0):n.isDirectory()&&r?(kle("[OK] path represents a directory"),!0):(kle("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return kle("[FAIL] path is not accessible: %o",n),!1;throw kle("[FATAL] %o",n),n}}a(G$o,"check");function $$o(t,e=LS.READABLE){return G$o(t,(e&LS.FILE)>0,(e&LS.FOLDER)>0)}a($$o,"exists");LS.exists=$$o;LS.FILE=1;LS.FOLDER=2;LS.READABLE=LS.FILE+LS.FOLDER});var ivn=I(nJe=>{"use strict";p();function V$o(t){for(var e in t)nJe.hasOwnProperty(e)||(nJe[e]=t[e])}a(V$o,"__export");Object.defineProperty(nJe,"__esModule",{value:!0});V$o(nvn())});var svn=I((nud,ovn)=>{p();var Nle=1e3,Mle=Nle*60,Ole=Mle*60,EK=Ole*24,W$o=EK*7,z$o=EK*365.25;ovn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Y$o(t);if(r==="number"&&isFinite(t))return e.long?J$o(t):K$o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Y$o(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*z$o;case"weeks":case"week":case"w":return r*W$o;case"days":case"day":case"d":return r*EK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ole;case"minutes":case"minute":case"mins":case"min":case"m":return r*Mle;case"seconds":case"second":case"secs":case"sec":case"s":return r*Nle;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(Y$o,"parse");function K$o(t){var e=Math.abs(t);return e>=EK?Math.round(t/EK)+"d":e>=Ole?Math.round(t/Ole)+"h":e>=Mle?Math.round(t/Mle)+"m":e>=Nle?Math.round(t/Nle)+"s":t+"ms"}a(K$o,"fmtShort");function J$o(t){var e=Math.abs(t);return e>=EK?iJe(t,e,EK,"day"):e>=Ole?iJe(t,e,Ole,"hour"):e>=Mle?iJe(t,e,Mle,"minute"):e>=Nle?iJe(t,e,Nle,"second"):t+" ms"}a(J$o,"fmtLong");function iJe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(iJe,"plural")});var xqt=I((sud,avn)=>{p();function Z$o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=svn(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(Z$o,"setup");avn.exports=Z$o});var cvn=I((FS,oJe)=>{p();FS.formatArgs=eVo;FS.save=tVo;FS.load=rVo;FS.useColors=X$o;FS.storage=nVo();FS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();FS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function X$o(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(X$o,"useColors");function eVo(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+oJe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(eVo,"formatArgs");FS.log=console.debug||console.log||(()=>{});function tVo(t){try{t?FS.storage.setItem("debug",t):FS.storage.removeItem("debug")}catch{}}a(tVo,"save");function rVo(){let t;try{t=FS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(rVo,"load");function nVo(){try{return localStorage}catch{}}a(nVo,"localstorage");oJe.exports=xqt()(FS);var{formatters:iVo}=oJe.exports;iVo.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var uvn=I((sg,aJe)=>{p();var oVo=require("tty"),sJe=require("util");sg.init=fVo;sg.log=lVo;sg.formatArgs=aVo;sg.save=uVo;sg.load=dVo;sg.useColors=sVo;sg.destroy=sJe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");sg.colors=[6,2,3,4,5,1];try{let t=sHe();t&&(t.stderr||t).level>=2&&(sg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}sg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function sVo(){return"colors"in sg.inspectOpts?!!sg.inspectOpts.colors:oVo.isatty(process.stderr.fd)}a(sVo,"useColors");function aVo(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`))}},eTe=class t extends Error{static{a(this,"ListenerLeakError")}constructor(e,r,n,o,s){super(s?`[${s}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name="ListenerLeakError",this.kind=e,this.listenerCount=o,this.details=r,this.stack=n}static is(e){return e instanceof t||e instanceof Error&&typeof e.kind=="string"&&typeof e.listenerCount=="number"}};qa.ListenerLeakError=eTe;var v$e=class extends eTe{static{a(this,"ListenerRefusalError")}constructor(e,r,n,o,s){super(e,r,n,o,s),this.name="ListenerRefusalError"}};qa.ListenerRefusalError=v$e;var j4o=0,pce=class{static{a(this,"UniqueContainer")}constructor(e){this.value=e,this.id=j4o++}},H4o=2,Adn=a((t,e)=>{if(t instanceof pce)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new h8t(e?.onListenerError??ZSe.onUnexpectedError,this._options?.leakWarningThreshold??XSe,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new _$e(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(fdn){let e=this._listeners;queueMicrotask(()=>{Adn(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=d[1]/this._size>.3?"dominated":"popular",h=new v$e(f,`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||ZSe.onUnexpectedError)(h),gC.Disposable.None}if(this._disposed)return gC.Disposable.None;r&&(e=e.bind(r));let o=new pce(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=hce.create(),s=this._leakageMon.check(o.stack,this._size+1)),fdn&&(o.stack=c??hce.create()),this._listeners?this._listeners instanceof pce?(this._deliveryQueue??=new C$e,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=(0,gC.toDisposable)(()=>{s?.(),this._removeListener(o)});return b8t(l,n),l},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 r=this._listeners,n=r.indexOf(e);if(n===-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--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*H4o<=r.length){let s=0;for(let c=0;c0}};qa.Emitter=Qy;var G4o=a(()=>new C$e,"createEventDeliveryQueue");qa.createEventDeliveryQueue=G4o;var C$e=class{static{a(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},m8t=class extends Qy{static{a(this,"AsyncEmitter")}async fireAsync(e,r,n){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new gdn.LinkedList),Adn(this._listeners,o=>this._asyncDeliveryQueue.push([o.value,e]));this._asyncDeliveryQueue.size>0&&!r.isCancellationRequested;){let[o,s]=this._asyncDeliveryQueue.shift(),c=[],l={...s,token:r,waitUntil:a(u=>{if(Object.isFrozen(c))throw new Error("waitUntil can NOT be called asynchronous");n&&(u=n(u,o)),c.push(u)},"waitUntil")};try{o(l)}catch(u){(0,ZSe.onUnexpectedError)(u);continue}Object.freeze(c),await Promise.allSettled(c).then(u=>{for(let d of u)d.status==="rejected"&&(0,ZSe.onUnexpectedError)(d.reason)})}}};qa.AsyncEmitter=m8t;var b$e=class extends Qy{static{a(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new gdn.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};qa.PauseableEmitter=b$e;var g8t=class extends b$e{static{a(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};qa.DebounceEmitter=g8t;var A8t=class extends Qy{static{a(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(r=>super.fire(r)),this._queuedEvents=[]}))}};qa.MicrotaskEmitter=A8t;var S$e=class{static{a(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new Qy({onWillAddFirstListener:a(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let r={event:e,listener:null};this.events.push(r),this.hasListeners&&this.hook(r);let n=a(()=>{this.hasListeners&&this.unhook(r);let o=this.events.indexOf(r);this.events.splice(o,1)},"dispose");return(0,gC.toDisposable)((0,B4o.createSingleCallFunction)(n))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(r=>this.emitter.fire(r))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};qa.EventMultiplexer=S$e;var y8t=class{static{a(this,"DynamicListEventMultiplexer")}constructor(e,r,n,o){this._store=new gC.DisposableStore;let s=this._store.add(new S$e),c=this._store.add(new gC.DisposableMap);function l(u){c.set(u,s.add(o(u)))}a(l,"addItem");for(let u of e)l(u);this._store.add(r(u=>{l(u)})),this._store.add(n(u=>{c.deleteAndDispose(u)})),this.event=s.event}dispose(){this._store.dispose()}};qa.DynamicListEventMultiplexer=y8t;var E8t=class{static{a(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,r,n){return(o,s,c)=>e(l=>{let u=this.data[this.data.length-1];if(!r){u?u.buffers.push(()=>o.call(s,l)):o.call(s,l);return}let d=u;if(!d){o.call(s,r(n,l));return}d.items??=[],d.items.push(l),d.buffers.length===0&&u.buffers.push(()=>{d.reducedResult??=n?d.items.reduce(r,n):d.items.reduce(r),o.call(s,d.reducedResult)})},void 0,c)}bufferEvents(e){let r={buffers:new Array};this.data.push(r);let n=e();return this.data.pop(),r.buffers.forEach(o=>o()),n}};qa.EventBufferer=E8t;var _8t=class{static{a(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=E$e.None,this.inputEventListener=gC.Disposable.None,this.emitter=new Qy({onDidAddFirstListener:a(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:a(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};qa.Relay=_8t;var v8t=class{static{a(this,"ValueWithChangeEvent")}static const(e){return new C8t(e)}constructor(e){this._value=e,this._onDidChange=new Qy,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};qa.ValueWithChangeEvent=v8t;var C8t=class{static{a(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=E$e.None}};function $4o(t,e,r){let n=new gC.DisposableMap,o=new Set(t());for(let c of o)n.set(c,r(c));let s=new gC.DisposableStore;return s.add(e(()=>{let c=t(),l=(0,O4o.diffSets)(o,c);for(let u of l.removed)n.deleteAndDispose(u);for(let u of l.added)n.set(u,r(u));o=new Set(c)})),s.add(n),s}a($4o,"trackSetChanges");function b8t(t,e){e instanceof gC.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}a(b8t,"addToDisposables");function mdn(t,e){if(e instanceof gC.DisposableStore)e.delete(t);else if(Array.isArray(e)){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}t.dispose()}a(mdn,"disposeAndRemove")});var ik=I(WL=>{"use strict";p();Object.defineProperty(WL,"__esModule",{value:!0});WL.CancellationTokenPool=WL.CancellationTokenSource=WL.CancellationToken=void 0;WL.cancelOnDispose=W4o;var ydn=_c(),V4o=Io(),Edn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),T$e;(function(t){function e(r){return r===t.None||r===t.Cancelled||r instanceof mce?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}a(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ydn.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Edn})})(T$e||(WL.CancellationToken=T$e={}));var mce=class{static{a(this,"MutableToken")}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?Edn:(this._emitter||(this._emitter=new ydn.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},tTe=class{static{a(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new mce),this._token}cancel(){this._token?this._token instanceof mce&&this._token.cancel():this._token=T$e.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof mce&&this._token.dispose():this._token=T$e.None}};WL.CancellationTokenSource=tTe;function W4o(t){let e=new tTe;return t.add({dispose(){e.cancel()}}),e.token}a(W4o,"cancelOnDispose");var S8t=class{static{a(this,"CancellationTokenPool")}constructor(){this._source=new tTe,this._listeners=new V4o.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let r=e.onCancellationRequested(()=>{r.dispose(),this._cancelled++,this._check()});this._listeners.add(r)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};WL.CancellationTokenPool=S8t});var fA=I(Yr=>{"use strict";p();var z4o=Yr&&Yr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Y4o=Yr&&Yr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K4o=Yr&&Yr.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=J4o&&t<=X4o||t>=Z4o&&t<=eBo}a(YL,"isWindowsDeviceRoot");function x$e(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===cY&&l!==-1?++l:l=-1}return o}a(x$e,"normalizeString");function nBo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(nBo,"formatExt");function _dn(t,e){rBo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${nBo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(_dn,"_format");Yr.win32={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Wf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=gce.cwd():(s=gce.env[`=${e}`]||gce.cwd(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===AC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Ho(f)&&(l=1,d=!0);else if(Ho(f))if(d=!0,Ho(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Ho(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=x$e(r,!n,"\\",Ho),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return T8t(s)?"\\":t;if(Ho(s))if(o=!0,Ho(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ho(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Ho(t.charCodeAt(e-1))&&(c+="\\"),!o&&n===void 0&&t.includes(":")){if(c.length>=2&&YL(c.charCodeAt(0))&&c.charCodeAt(1)===zL)return`.\\${c}`;let l=t.indexOf(":");do if(l===e-1||Ho(t.charCodeAt(l+1)))return`.\\${c}`;while((l=t.indexOf(":",l+1))!==-1)}return n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Wf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Ho(r)||e>2&&YL(r)&&t.charCodeAt(1)===zL&&Ho(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Ho(r.charCodeAt(0))){++o;let s=r.length;s>1&&Ho(r.charCodeAt(1))&&(++o,s>2&&(Ho(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Yr.win32.normalize(e)},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e)return"";let r=Yr.win32.resolve(t),n=Yr.win32.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";if(r.length!==t.length||n.length!==e.length){let A=r.split("\\"),y=n.split("\\");A[A.length-1]===""&&A.pop(),y[y.length-1]===""&&y.pop();let E=A.length,_=y.length,v=E<_?E:_,b;for(b=0;bv?y.slice(b).join("\\"):E>v?"..\\".repeat(E-1-b)+"..":"":"..\\".repeat(E-b)+y.slice(b).join("\\")}let o=0;for(;oo&&t.charCodeAt(s-1)===AC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===AC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===AC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===AC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===AC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===AC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Yr.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===AC){if(e.charCodeAt(1)===AC){let r=e.charCodeAt(2);if(r!==tBo&&r!==cY)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(YL(e.charCodeAt(0))&&e.charCodeAt(1)===zL&&e.charCodeAt(2)===AC)return`\\\\?\\${e}`;return e},dirname(t){Wf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Ho(o)?t:".";if(Ho(o)){if(r=n=1,Ho(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Ho(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Ho(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Wf(e,"suffix"),Wf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&YL(t.charCodeAt(0))&&t.charCodeAt(1)===zL&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Ho(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Ho(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Wf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===zL&&YL(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Ho(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===cY?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:_dn.bind(null,"\\"),parse(t){Wf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Ho(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Ho(o)){if(n=1,Ho(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Ho(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===cY?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var iBo=(()=>{if(yC){let t=/\\/g;return()=>{let e=gce.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>gce.cwd()})();Yr.posix={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=0&&!r;n--){let o=t[n];Wf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===Km)}if(!r){let n=iBo();e=`${n}/${e}`,r=n.charCodeAt(0)===Km}return e=x$e(e,!r,"/",T8t),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Km,r=t.charCodeAt(t.length-1)===Km;return t=x$e(t,!e,"/",T8t),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Wf(t,"path"),t.length>0&&t.charCodeAt(0)===Km},join(...t){if(t.length===0)return".";let e=[];for(let r=0;r0&&e.push(n)}return e.length===0?".":Yr.posix.normalize(e.join("/"))},relative(t,e){if(Wf(t,"from"),Wf(e,"to"),t===e||(t=Yr.posix.resolve(t),e=Yr.posix.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===Km)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===Km?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===Km)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Wf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Km,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===Km){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Wf(e,"suffix"),Wf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===Km){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===Km){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Wf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t[c];if(l==="/"){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l==="."?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:_dn.bind(null,"/"),parse(t){Wf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===Km,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===Km){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===cY?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Yr.posix.win32=Yr.win32.win32=Yr.win32;Yr.posix.posix=Yr.win32.posix=Yr.posix;Yr.normalize=yC?Yr.win32.normalize:Yr.posix.normalize;Yr.isAbsolute=yC?Yr.win32.isAbsolute:Yr.posix.isAbsolute;Yr.join=yC?Yr.win32.join:Yr.posix.join;Yr.resolve=yC?Yr.win32.resolve:Yr.posix.resolve;Yr.relative=yC?Yr.win32.relative:Yr.posix.relative;Yr.dirname=yC?Yr.win32.dirname:Yr.posix.dirname;Yr.basename=yC?Yr.win32.basename:Yr.posix.basename;Yr.extname=yC?Yr.win32.extname:Yr.posix.extname;Yr.format=yC?Yr.win32.format:Yr.posix.format;Yr.parse=yC?Yr.win32.parse:Yr.posix.parse;Yr.toNamespacedPath=yC?Yr.win32.toNamespacedPath:Yr.posix.toNamespacedPath;Yr.sep=yC?Yr.win32.sep:Yr.posix.sep;Yr.delimiter=yC?Yr.win32.delimiter:Yr.posix.delimiter});var R$e=I(ok=>{"use strict";p();Object.defineProperty(ok,"__esModule",{value:!0});ok.WeakCachedFunction=ok.CachedFunction=ok.LRUCachedFunction=ok.Cache=void 0;ok.identity=w$e;var oBo=ik(),I8t=class{static{a(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new oBo.CancellationTokenSource,r=this.task(e.token);return this.result={promise:r,dispose:a(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};ok.Cache=I8t;function w$e(t){return t}a(w$e,"identity");var x8t=class{static{a(this,"LRUCachedFunction")}constructor(e,r){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=w$e):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};ok.LRUCachedFunction=x8t;var w8t=class{static{a(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,r){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=w$e):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map2.has(r))return this._map2.get(r);let n=this._fn(e);return this._map.set(e,n),this._map2.set(r,n),n}};ok.CachedFunction=w8t;var R8t=class{static{a(this,"WeakCachedFunction")}constructor(e,r){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=w$e):(this._fn=r,this._computeKey=e.getCacheKey)}get(e){let r=this._computeKey(e);if(this._map.has(r))return this._map.get(r);let n=this._fn(e);return this._map.set(r,n),n}};ok.WeakCachedFunction=R8t});var Oh=I(wr=>{"use strict";p();Object.defineProperty(wr,"__esModule",{value:!0});wr.Ellipsis=wr.InvisibleCharacters=wr.AmbiguousCharacters=wr.noBreakWhitespace=wr.UTF8_BOM_CHARACTER=wr.UNUSUAL_LINE_TERMINATORS=wr.GraphemeIterator=wr.CodePointIterator=void 0;wr.isFalsyOrWhitespace=aBo;wr.format=lBo;wr.format2=dBo;wr.htmlAttributeEncodeValue=fBo;wr.escape=pBo;wr.escapeRegExpCharacters=bdn;wr.count=hBo;wr.truncate=mBo;wr.truncateMiddle=gBo;wr.trim=ABo;wr.ltrim=Sdn;wr.rtrim=Tdn;wr.convertSimple2RegExpPattern=yBo;wr.createRegExp=EBo;wr.regExpLeadsToEndlessLoop=_Bo;wr.joinStrings=vBo;wr.splitLines=CBo;wr.splitLinesIncludeSeparators=bBo;wr.indexOfPattern=SBo;wr.firstNonWhitespaceIndex=Idn;wr.getLeadingWhitespace=TBo;wr.lastNonWhitespaceIndex=IBo;wr.getIndentationLength=xBo;wr.replaceAsync=wBo;wr.compare=RBo;wr.compareSubstring=xdn;wr.compareIgnoreCase=PBo;wr.compareSubstringIgnoreCase=nTe;wr.isAsciiDigit=kBo;wr.isLowerAsciiLetter=k8t;wr.isUpperAsciiLetter=DBo;wr.equalsIgnoreCase=wdn;wr.equals=NBo;wr.startsWithIgnoreCase=MBo;wr.endsWithIgnoreCase=OBo;wr.commonPrefixLength=BBo;wr.commonSuffixLength=LBo;wr.isHighSurrogate=M8t;wr.isLowSurrogate=P$e;wr.computeCodePoint=O8t;wr.getNextCodePoint=Rdn;wr.nextCharLength=Pdn;wr.prevCharLength=kdn;wr.getCharContainingOffset=UBo;wr.charCount=QBo;wr.containsRTL=jBo;wr.isBasicASCII=GBo;wr.containsUnusualLineTerminators=$Bo;wr.isFullWidthCharacter=VBo;wr.isEmojiImprecise=Ddn;wr.lcut=WBo;wr.rcut=zBo;wr.forAnsiStringParts=ZBo;wr.removeAnsiEscapeCodes=Mdn;wr.removeAnsiEscapeCodesFromPrompt=eLo;wr.startsWithUTF8BOM=Odn;wr.stripUTF8BOM=tLo;wr.fuzzyContains=rLo;wr.containsUppercaseCharacter=nLo;wr.uppercaseFirstLetter=iLo;wr.getNLines=oLo;wr.singleLetterHash=sLo;wr.getGraphemeBreakType=aLo;wr.getLeftDeleteOffset=lLo;wr.multibyteAwareBtoa=pLo;var sBo=R$e(),vdn=BL();function aBo(t){return!t||typeof t!="string"?!0:t.trim().length===0}a(aBo,"isFalsyOrWhitespace");var cBo=/{(\d+)}/g;function lBo(t,...e){return e.length===0?t:t.replace(cBo,function(r,n){let o=parseInt(n,10);return isNaN(o)||o<0||o>=e.length?r:e[o]})}a(lBo,"format");var uBo=/{([^}]+)}/g;function dBo(t,e){return Object.keys(e).length===0?t:t.replace(uBo,(r,n)=>e[n]??r)}a(dBo,"format2");function fBo(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}a(fBo,"htmlAttributeEncodeValue");function pBo(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}a(pBo,"escape");function bdn(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(bdn,"escapeRegExpCharacters");function hBo(t,e){let r=0,n=t.indexOf(e);for(;n!==-1;)r++,n=t.indexOf(e,n+e.length);return r}a(hBo,"count");function mBo(t,e,r=wr.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${r}`}a(mBo,"truncate");function gBo(t,e,r=wr.Ellipsis){if(t.length<=e)return t;let n=Math.ceil(e/2)-r.length/2,o=Math.floor(e/2)-r.length/2;return`${t.substr(0,n)}${r}${t.substr(t.length-o)}`}a(gBo,"truncateMiddle");function ABo(t,e=" "){let r=Sdn(t,e);return Tdn(r,e)}a(ABo,"trim");function Sdn(t,e){if(!t||!e)return t;let r=e.length,n=0;if(r===1){let o=e.charCodeAt(0);for(;n0&&t.charCodeAt(s-1)===c;)s--;return t.substring(0,s)}let o=n;for(;o>0&&t.endsWith(e,o);)o-=r;return t.substring(0,o)}a(Tdn,"rtrim");function yBo(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}a(yBo,"convertSimple2RegExpPattern");function EBo(t,e,r={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=bdn(t)),r.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let n="";return r.global&&(n+="g"),r.matchCase||(n+="i"),r.multiline&&(n+="m"),r.unicode&&(n+="u"),new RegExp(t,n)}a(EBo,"createRegExp");function _Bo(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}a(_Bo,"regExpLeadsToEndlessLoop");function vBo(t,e){return t.filter(r=>r!=null&&r!==!1).join(e)}a(vBo,"joinStrings");function CBo(t){return t.split(/\r\n|\r|\n/)}a(CBo,"splitLines");function bBo(t){let e=[],r=t.split(/(\r\n|\r|\n)/);for(let n=0;n=0;r--){let n=t.charCodeAt(r);if(n!==32&&n!==9)return r}return-1}a(IBo,"lastNonWhitespaceIndex");function xBo(t){let e=Idn(t);return e===-1?t.length:e}a(xBo,"getIndentationLength");function wBo(t,e,r){let n=[],o=0;for(let s of t.matchAll(e)){if(n.push(t.slice(o,s.index)),s.index===void 0)throw new Error("match.index should be defined");o=s.index+s[0].length,n.push(r(s[0],...s.slice(1),s.index,t,s.groups))}return n.push(t.slice(o)),Promise.all(n).then(s=>s.join(""))}a(wBo,"replaceAsync");function RBo(t,e){return te?1:0}a(RBo,"compare");function xdn(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(xdn,"compareSubstring");function PBo(t,e){return nTe(t,e,0,t.length,0,e.length)}a(PBo,"compareIgnoreCase");function nTe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return xdn(t.toLowerCase(),e.toLowerCase(),r,n,o,s);k8t(u)&&(u-=32),k8t(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(nTe,"compareSubstringIgnoreCase");function kBo(t){return t>=48&&t<=57}a(kBo,"isAsciiDigit");function k8t(t){return t>=97&&t<=122}a(k8t,"isLowerAsciiLetter");function DBo(t){return t>=65&&t<=90}a(DBo,"isUpperAsciiLetter");function wdn(t,e){return t.length===e.length&&nTe(t,e)===0}a(wdn,"equalsIgnoreCase");function NBo(t,e,r){return t===e||!!r&&t!==void 0&&e!==void 0&&wdn(t,e)}a(NBo,"equals");function MBo(t,e){let r=e.length;return r<=t.length&&nTe(t,e,0,r)===0}a(MBo,"startsWithIgnoreCase");function OBo(t,e){let r=t.length,n=r-e.length;return n>=0&&nTe(t,e,n,r)===0}a(OBo,"endsWithIgnoreCase");function BBo(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n1){let n=t.charCodeAt(e-2);if(M8t(n))return O8t(n,r)}return r}a(FBo,"getPrevCodePoint");var Ace=class{static{a(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,r=0){this._str=e,this._len=e.length,this._offset=r}setOffset(e){this._offset=e}prevCodePoint(){let e=FBo(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=Rdn(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};wr.CodePointIterator=Ace;var yce=class{static{a(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,r=0){this._iterator=new Ace(e,r)}nextGraphemeLength(){let e=rTe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.nextCodePoint());for(;!r.eol();){let s=r.offset,c=e.getGraphemeBreakType(r.nextCodePoint());if(Cdn(o,c)){r.setOffset(s);break}o=c}return r.offset-n}prevGraphemeLength(){let e=rTe.getInstance(),r=this._iterator,n=r.offset,o=e.getGraphemeBreakType(r.prevCodePoint());for(;r.offset>0;){let s=r.offset,c=e.getGraphemeBreakType(r.prevCodePoint());if(Cdn(c,o)){r.setOffset(s);break}o=c}return n-r.offset}eol(){return this._iterator.eol()}};wr.GraphemeIterator=yce;function Pdn(t,e){return new yce(t,e).nextGraphemeLength()}a(Pdn,"nextCharLength");function kdn(t,e){return new yce(t,e).prevGraphemeLength()}a(kdn,"prevCharLength");function UBo(t,e){e>0&&P$e(t.charCodeAt(e))&&e--;let r=e+Pdn(t,e);return[r-kdn(t,r),r]}a(UBo,"getCharContainingOffset");function QBo(t){let e=new yce(t),r=0;for(;!e.eol();)r++,e.nextGraphemeLength();return r}a(QBo,"charCount");var P8t;function qBo(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}a(qBo,"makeContainsRtl");function jBo(t){return P8t||(P8t=qBo()),P8t.test(t)}a(jBo,"containsRTL");var HBo=/^[\t\n\r\x20-\x7E]*$/;function GBo(t){return HBo.test(t)}a(GBo,"isBasicASCII");wr.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function $Bo(t){return wr.UNUSUAL_LINE_TERMINATORS.test(t)}a($Bo,"containsUnusualLineTerminators");function VBo(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}a(VBo,"isFullWidthCharacter");function Ddn(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}a(Ddn,"isEmojiImprecise");function WBo(t,e,r=""){let n=t.trimStart();if(n.lengthe){c=!0;break}s=o.lastIndex,o.lastIndex+=1}if(!c)return n;if(s===0)return r;let l=n.substring(0,s).trimEnd();return l.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,KBo=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,JBo=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,Ndn=new RegExp("(?:"+[YBo.source,KBo.source,JBo.source].join("|")+")","g");function*ZBo(t){let e=0;for(let r of t.matchAll(Ndn))e!==r.index&&(yield{isCode:!1,str:t.substring(e,r.index)}),yield{isCode:!0,str:r[0]},e=r.index+r[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}a(ZBo,"forAnsiStringParts");function Mdn(t){return t&&(t=t.replace(Ndn,"")),t}a(Mdn,"removeAnsiEscapeCodes");var XBo=/\\\[.*?\\\]/g;function eLo(t){return Mdn(t).replace(XBo,"")}a(eLo,"removeAnsiEscapeCodesFromPrompt");wr.UTF8_BOM_CHARACTER="\uFEFF";function Odn(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}a(Odn,"startsWithUTF8BOM");function tLo(t){return Odn(t)?t.substr(1):t}a(tLo,"stripUTF8BOM");function rLo(t,e){if(!t||!e||t.length0&&r>=0);return r===-1?t:(t[r-1]==="\r"&&r--,t.substr(0,r))}a(oLo,"getNLines");function sLo(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}a(sLo,"singleLetterHash");function aLo(t){return rTe.getInstance().getGraphemeBreakType(t)}a(aLo,"getGraphemeBreakType");function Cdn(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}a(Cdn,"breakBetweenGraphemeBreakType");var rTe=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=cLo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function cLo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(cLo,"getGraphemeBreakRawData");function lLo(t,e){if(t===0)return 0;let r=uLo(t,e);if(r!==void 0)return r;let n=new Ace(e,t);return n.prevCodePoint(),n.offset}a(lLo,"getLeftDeleteOffset");function uLo(t,e){let r=new Ace(e,t),n=r.prevCodePoint();for(;dLo(n)||n===65039||n===8419;){if(r.offset===0)return;n=r.prevCodePoint()}if(!Ddn(n))return;let o=r.offset;return o>0&&r.prevCodePoint()===8205&&(o=r.offset),o}a(uLo,"getOffsetBeforeLastEmojiComponent");function dLo(t){return 127995<=t&&t<=127999}a(dLo,"isEmojiModifier");wr.noBreakWhitespace="\xA0";var D8t=class t{static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new vdn.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new sBo.LRUCachedFunction(e=>{let r=e.split(",");function n(h){let m=new Map;for(let g=0;g!h.startsWith("_")&&Object.hasOwn(c,h));l.length===0&&(l=["_default"]);let u;for(let h of l){let m=n(c[h]);u=s(u,m)}let d=n(c._common),f=o(d,u);return new t(f)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new vdn.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;r{"use strict";p();Object.defineProperty($0,"__esModule",{value:!0});$0.isPathSeparator=KL;$0.toSlashes=Bdn;$0.toPosixPath=mLo;$0.getRoot=gLo;$0.isUNC=ALo;$0.isValidBasename=vLo;$0.isEqual=CLo;$0.isEqualOrParent=bLo;$0.isWindowsDriveLetter=B8t;$0.sanitizeFilePath=SLo;$0.removeTrailingPathSeparator=Ldn;$0.isRootOrDriveLetter=TLo;$0.hasDriveLetter=L8t;$0.getDriveLetter=ILo;$0.indexOfPath=xLo;$0.parseLineAndColumnAware=wLo;$0.randomPath=kLo;var EC=fA(),$7=G7(),k$e=Oh(),hLo=dS();function KL(t){return t===47||t===92}a(KL,"isPathSeparator");function Bdn(t){return t.replace(/[\\/]/g,EC.posix.sep)}a(Bdn,"toSlashes");function mLo(t){return t.indexOf("/")===-1&&(t=Bdn(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}a(mLo,"toPosixPath");function gLo(t,e=EC.posix.sep){if(!t)return"";let r=t.length,n=t.charCodeAt(0);if(KL(n)){if(KL(t.charCodeAt(1))&&!KL(t.charCodeAt(2))){let s=3,c=s;for(;s\|]/g,ELo=/[/]/g,_Lo=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function vLo(t,e=$7.isWindows){let r=e?yLo:ELo;return!(!t||t.length===0||/^\s+$/.test(t)||(r.lastIndex=0,r.test(t))||e&&_Lo.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}a(vLo,"isValidBasename");function CLo(t,e,r){let n=t===e;return!r||n?n:!t||!e?!1:(0,k$e.equalsIgnoreCase)(t,e)}a(CLo,"isEqual");function bLo(t,e,r,n=EC.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(r){if(!(0,k$e.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(bLo,"isEqualOrParent");function B8t(t){return t>=65&&t<=90||t>=97&&t<=122}a(B8t,"isWindowsDriveLetter");function SLo(t,e){return $7.isWindows&&t.endsWith(":")&&(t+=EC.sep),(0,EC.isAbsolute)(t)||(t=(0,EC.join)(e,t)),t=(0,EC.normalize)(t),Ldn(t)}a(SLo,"sanitizeFilePath");function Ldn(t){return $7.isWindows?(t=(0,k$e.rtrim)(t,EC.sep),t.endsWith(":")&&(t+=EC.sep)):(t=(0,k$e.rtrim)(t,EC.sep),t||(t=EC.sep)),t}a(Ldn,"removeTrailingPathSeparator");function TLo(t){let e=(0,EC.normalize)(t);return $7.isWindows?t.length>3?!1:L8t(e)&&(t.length===2||e.charCodeAt(2)===92):e===EC.posix.sep}a(TLo,"isRootOrDriveLetter");function L8t(t,e=$7.isWindows){return e?B8t(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}a(L8t,"hasDriveLetter");function ILo(t,e=$7.isWindows){return L8t(t,e)?t[0]:void 0}a(ILo,"getDriveLetter");function xLo(t,e,r){return e.length>t.length?-1:t===e?0:(r&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}a(xLo,"indexOfPath");function wLo(t){let e=t.split(":"),r,n,o;for(let s of e){let c=Number(s);(0,hLo.isNumber)(c)?n===void 0?n=c:o===void 0&&(o=c):r=r?[r,s].join(":"):s}if(!r)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:r,line:n!==void 0?n:void 0,column:o!==void 0?o:n!==void 0?1:void 0}}a(wLo,"parseLineAndColumnAware");var RLo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",PLo="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function kLo(t,e,r=8){let n="";for(let s=0;s{"use strict";p();var DLo=mx&&mx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NLo=mx&&mx.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),MLo=mx&&mx.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?` Found '${r[0][0]}' at index ${r[0].index} (${r.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${n} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!BLo.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(LLo.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(FLo,"_validateUri");function ULo(t,e){return!t&&!e?"file":t}a(ULo,"_schemeFix");function QLo(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==sk&&(e=sk+e):e=sk;break}return e}a(QLo,"_referenceResolution");var Bl="",sk="/",qLo=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,M$e=class t{static{a(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,r,n,o,s,c=!1){typeof e=="object"?(this.scheme=e.scheme||Bl,this.authority=e.authority||Bl,this.path=e.path||Bl,this.query=e.query||Bl,this.fragment=e.fragment||Bl):(this.scheme=ULo(e,c),this.authority=r||Bl,this.path=QLo(this.scheme,n||Bl),this.query=o||Bl,this.fragment=s||Bl,FLo(this,c))}get fsPath(){return O$e(this,!1)}with(e){if(!e)return this;let{scheme:r,authority:n,path:o,query:s,fragment:c}=e;return r===void 0?r=this.scheme:r===null&&(r=Bl),n===void 0?n=this.authority:n===null&&(n=Bl),o===void 0?o=this.path:o===null&&(o=Bl),s===void 0?s=this.query:s===null&&(s=Bl),c===void 0?c=this.fragment:c===null&&(c=Bl),r===this.scheme&&n===this.authority&&o===this.path&&s===this.query&&c===this.fragment?this:new V7(r,n,o,s,c)}static parse(e,r=!1){let n=qLo.exec(e);return n?new V7(n[2]||Bl,D$e(n[4]||Bl),D$e(n[5]||Bl),D$e(n[7]||Bl),D$e(n[9]||Bl),r):new V7(Bl,Bl,Bl,Bl,Bl)}static file(e){let r=Bl;if(N$e.isWindows&&(e=e.replace(/\\/g,sk)),e[0]===sk&&e[1]===sk){let n=e.indexOf(sk,2);n===-1?(r=e.substring(2),e=sk):(r=e.substring(2,n),e=e.substring(n)||sk)}return new V7("file",r,e,Bl,Bl)}static from(e,r){return new V7(e.scheme,e.authority,e.path,e.query,e.fragment,r)}static joinPath(e,...r){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let n;return N$e.isWindows&&e.scheme==="file"?n=t.file(Fdn.win32.join(O$e(e,!0),...r)).path:n=Fdn.posix.join(e.path,...r),e.with({path:n})}toString(e=!1){return U8t(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let r=new V7(e);return r._formatted=e.external??null,r._fsPath=e._sep===qdn?e.fsPath??null:null,r}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};mx.URI=M$e;function jLo(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}a(jLo,"isUriComponents");var qdn=N$e.isWindows?1:void 0,V7=class extends M$e{static{a(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=O$e(this,!1)),this._fsPath}toString(e=!1){return e?U8t(this,!0):(this._formatted||(this._formatted=U8t(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=qdn),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},jdn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Udn(t,e,r){let n,o=-1;for(let s=0;s=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45||c===46||c===95||c===126||e&&c===47||r&&c===91||r&&c===93||r&&c===58)o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n!==void 0&&(n+=t.charAt(s));else{n===void 0&&(n=t.substr(0,s));let l=jdn[c];l!==void 0?(o!==-1&&(n+=encodeURIComponent(t.substring(o,s)),o=-1),n+=l):o===-1&&(o=s)}}return o!==-1&&(n+=encodeURIComponent(t.substring(o))),n!==void 0?n:t}a(Udn,"encodeURIComponentFast");function HLo(t){let e;for(let r=0;r1&&t.scheme==="file"?r=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?r=t.path.substr(1):r=t.path[1].toLowerCase()+t.path.substr(2):r=t.path,N$e.isWindows&&(r=r.replace(/\//g,"\\")),r}a(O$e,"uriToFsPath");function U8t(t,e){let r=e?HLo:Udn,n="",{scheme:o,authority:s,path:c,query:l,fragment:u}=t;if(o&&(n+=o,n+=":"),(s||o==="file")&&(n+=sk,n+=sk),s){let d=s.indexOf("@");if(d!==-1){let f=s.substr(0,d);s=s.substr(d+1),d=f.lastIndexOf(":"),d===-1?n+=r(f,!1,!1):(n+=r(f.substr(0,d),!1,!1),n+=":",n+=r(f.substr(d+1),!1,!0)),n+="@"}s=s.toLowerCase(),d=s.lastIndexOf(":"),d===-1?n+=r(s,!1,!0):(n+=r(s.substr(0,d),!1,!0),n+=s.substr(d))}if(c){if(c.length>=3&&c.charCodeAt(0)===47&&c.charCodeAt(2)===58){let d=c.charCodeAt(1);d>=65&&d<=90&&(c=`/${String.fromCharCode(d+32)}:${c.substr(3)}`)}else if(c.length>=2&&c.charCodeAt(1)===58){let d=c.charCodeAt(0);d>=65&&d<=90&&(c=`${String.fromCharCode(d+32)}:${c.substr(2)}`)}n+=r(c,!0,!1)}return l&&(n+="?",n+=r(l,!1,!1)),u&&(n+="#",n+=e?u:Udn(u,!1,!1)),n}a(U8t,"_asFormatted");function Hdn(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Hdn(t.substr(3)):t}}a(Hdn,"decodeURIComponentGraceful");var Qdn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function D$e(t){return t.match(Qdn)?t.replace(Qdn,e=>Hdn(e)):t}a(D$e,"percentDecode")});var uY=I(cs=>{"use strict";p();var GLo=cs&&cs.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Lo=cs&&cs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G8t=cs&&cs.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oVdn(t,r))}a(WLo,"matchesSomeScheme");cs.connectionTokenCookieName="vscode-tkn";cs.connectionTokenQueryName="tkn";var j8t=class{static{a(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,r){this._serverRootPath=q8t.posix.join(r??"/",Wdn(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return q8t.posix.join(this._serverRootPath,MM.vscodeRemoteResource)}set(e,r,n){this._hosts[e]=r,this._ports[e]=n}setConnectionToken(e,r){this._connectionTokens[e]=r}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(l){return VLo.onUnexpectedExternalError(l),e}let r=e.authority,n=this._hosts[r];n&&n.indexOf(":")!==-1&&n.indexOf("[")===-1&&(n=`[${n}]`);let o=this._ports[r],s=this._connectionTokens[r],c=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(c+=`&${cs.connectionTokenQueryName}=${encodeURIComponent(s)}`),lY.URI.from({scheme:Q8t.isWeb?this._preferredWebSchema:MM.vscodeRemoteResource,authority:`${n}:${o}`,path:this._remoteResourcesPath,query:c})}};cs.RemoteAuthorities=new j8t;function Wdn(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}a(Wdn,"getServerProductSegment");cs.builtinExtensionsPath="vs/../../extensions";cs.nodeModulesPath="vs/../../node_modules";cs.nodeModulesAsarPath="vs/../../node_modules.asar";cs.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";cs.VSCODE_AUTHORITY="vscode-app";var H8t=class t{static{a(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=cs.VSCODE_AUTHORITY}asBrowserUri(e){let r=this.toUri(e);return this.uriToBrowserUri(r)}uriToBrowserUri(e){return e.scheme===MM.vscodeRemote?cs.RemoteAuthorities.rewrite(e):e.scheme===MM.file&&(Q8t.isNative||Q8t.webWorkerOrigin===`${MM.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:MM.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let r=this.toUri(e);return this.uriToFileUri(r)}uriToFileUri(e){return e.scheme===MM.vscodeFileResource?e.with({scheme:MM.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(lY.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let r=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(r))return lY.URI.joinPath(lY.URI.parse(r,!0),e);let n=q8t.join(r,e);return lY.URI.file(n)}throw new Error("Cannot determine URI for module id!")}};cs.FileAccess=new H8t;cs.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});cs.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var $dn;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let r="vscode-coi";function n(s){let c;typeof s=="string"?c=new URL(s).searchParams:s instanceof URL?c=s.searchParams:lY.URI.isUri(s)&&(c=new URL(s.toString(!0)).searchParams);let l=c?.get(r);if(l)return e.get(l)}a(n,"getHeadersFromQuery"),t.getHeadersFromQuery=n;function o(s,c,l){if(!globalThis.crossOriginIsolated)return;let u=c&&l?"3":l?"2":"1";s instanceof URLSearchParams?s.set(r,u):s[r]=u}a(o,"addSearchParam"),t.addSearchParam=o})($dn||(cs.COI=$dn={}))});var ak=I(Ar=>{"use strict";p();var zLo=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YLo=Ar&&Ar.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Kdn=Ar&&Ar.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oEce.getRoot(n).length&&n[n.length-1]===r}else{let n=e.path;return n.length>1&&n.charCodeAt(n.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,r=y_.sep){return(0,Ar.hasTrailingPathSeparator)(e,r)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,r=y_.sep){let n=!1;if(e.scheme===W7.Schemas.file){let o=OM(e);n=o!==void 0&&o.length===Ece.getRoot(o).length&&o[o.length-1]===r}else{r="/";let o=e.path;n=o.length===1&&o.charCodeAt(o.length-1)===47}return!n&&!(0,Ar.hasTrailingPathSeparator)(e,r)?e.with({path:e.path+"/"}):e}};Ar.ExtUri=_ce;Ar.extUri=new _ce(()=>!1);Ar.extUriBiasedIgnorePathCase=new _ce(t=>t.scheme===W7.Schemas.file?!Jdn.isLinux:!0);Ar.extUriIgnorePathCase=new _ce(t=>!0);Ar.isEqual=Ar.extUri.isEqual.bind(Ar.extUri);Ar.isEqualOrParent=Ar.extUri.isEqualOrParent.bind(Ar.extUri);Ar.getComparisonKey=Ar.extUri.getComparisonKey.bind(Ar.extUri);Ar.basenameOrAuthority=Ar.extUri.basenameOrAuthority.bind(Ar.extUri);Ar.basename=Ar.extUri.basename.bind(Ar.extUri);Ar.extname=Ar.extUri.extname.bind(Ar.extUri);Ar.dirname=Ar.extUri.dirname.bind(Ar.extUri);Ar.joinPath=Ar.extUri.joinPath.bind(Ar.extUri);Ar.normalizePath=Ar.extUri.normalizePath.bind(Ar.extUri);Ar.relativePath=Ar.extUri.relativePath.bind(Ar.extUri);Ar.resolvePath=Ar.extUri.resolvePath.bind(Ar.extUri);Ar.isAbsolutePath=Ar.extUri.isAbsolutePath.bind(Ar.extUri);Ar.isEqualAuthority=Ar.extUri.isEqualAuthority.bind(Ar.extUri);Ar.hasTrailingPathSeparator=Ar.extUri.hasTrailingPathSeparator.bind(Ar.extUri);Ar.removeTrailingPathSeparator=Ar.extUri.removeTrailingPathSeparator.bind(Ar.extUri);Ar.addTrailingPathSeparator=Ar.extUri.addTrailingPathSeparator.bind(Ar.extUri);function KLo(t,e){let r=[];for(let n=0;nc===n?!1:(0,Ar.isEqualOrParent)(o,e(s)))||r.push(t[n])}return r}a(KLo,"distinctParents");var Ydn;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(r){let n=new Map;r.path.substring(r.path.indexOf(";")+1,r.path.lastIndexOf(";")).split(";").forEach(c=>{let[l,u]=c.split(":");l&&u&&n.set(l,u)});let s=r.path.substring(0,r.path.indexOf(";"));return s&&n.set(t.META_DATA_MIME,s),n}a(e,"parseMetaData"),t.parseMetaData=e})(Ydn||(Ar.DataUri=Ydn={}));function JLo(t,e,r){if(e){let n=t.path;return n&&n[0]!==y_.posix.sep&&(n=y_.posix.sep+n),t.with({scheme:r,authority:e,path:n})}return t.with({scheme:r})}a(JLo,"toLocalResource")});var Zdn=I(B$e=>{"use strict";p();Object.defineProperty(B$e,"__esModule",{value:!0});B$e.MicrotaskDelay=void 0;B$e.MicrotaskDelay=Symbol("MicrotaskDelay")});var zc=I(Yt=>{"use strict";p();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AsyncReader=Yt.AsyncReaderEndOfStream=Yt.CancelableAsyncIterableProducer=Yt.AsyncIterableProducer=Yt.AsyncIterableSource=Yt.AsyncIterableObject=Yt.LazyStatefulPromise=Yt.StatefulPromise=Yt.Promises=Yt.DeferredPromise=Yt.IntervalCounter=Yt.TaskSequentializer=Yt.GlobalIdleValue=Yt.AbstractIdleValue=Yt._runWhenIdle=Yt.runWhenGlobalIdle=Yt.ThrottledWorker=Yt.RunOnceWorker=Yt.ProcessTimeRunOnceScheduler=Yt.RunOnceScheduler=Yt.IntervalTimer=Yt.TimeoutTimer=Yt.TaskQueue=Yt.ResourceQueue=Yt.LimitedQueue=Yt.Queue=Yt.Limiter=Yt.AutoOpenBarrier=Yt.Barrier=Yt.ThrottledDelayer=Yt.Delayer=Yt.SequencerByKey=Yt.Sequencer=Yt.Throttler=void 0;Yt.isThenable=tfn;Yt.createCancelablePromise=rfn;Yt.raceCancellation=nfn;Yt.raceCancellationError=t3o;Yt.rejectIfNotCanceled=r3o;Yt.notCancellablePromise=n3o;Yt.raceCancellablePromises=i3o;Yt.raceTimeout=ifn;Yt.asPromise=o3o;Yt.promiseWithResolvers=ofn;Yt.timeout=u6t;Yt.disposableTimeout=c3o;Yt.sequence=l3o;Yt.first=u3o;Yt.firstParallel=d3o;Yt.installFakeRunWhenIdle=f3o;Yt.retry=p3o;Yt.createCancelableAsyncIterableProducer=h3o;Yt.cancellableIterable=m3o;Yt.createTimeout=g3o;var l6t=ik(),E_=bs(),oTe=_c(),z7=Io(),Xdn=ak(),ZLo=G7(),XLo=Zdn(),e3o=BL();function tfn(t){return!!t&&typeof t.then=="function"}a(tfn,"isThenable");function rfn(t){let e=new l6t.CancellationTokenSource,r=t(e.token),n=!1,o=new Promise((s,c)=>{let l=e.token.onCancellationRequested(()=>{n=!0,l.dispose(),c(new E_.CancellationError)});Promise.resolve(r).then(u=>{l.dispose(),e.dispose(),n?(0,z7.isDisposable)(u)&&u.dispose():s(u)},u=>{l.dispose(),e.dispose(),c(u)})});return new class{cancel(){e.cancel(),e.dispose()}then(s,c){return o.then(s,c)}catch(s){return this.then(void 0,s)}finally(s){return o.finally(s)}}}a(rfn,"createCancelablePromise");function nfn(t,e,r){return new Promise((n,o)=>{let s=e.onCancellationRequested(()=>{s.dispose(),n(r)});t.then(n,o).finally(()=>s.dispose())})}a(nfn,"raceCancellation");function t3o(t,e){return new Promise((r,n)=>{let o=e.onCancellationRequested(()=>{o.dispose(),n(new E_.CancellationError)});t.then(r,n).finally(()=>o.dispose())})}a(t3o,"raceCancellationError");function r3o(t){if(!(0,E_.isCancellationError)(t))return Promise.reject(t)}a(r3o,"rejectIfNotCanceled");function n3o(t){return new Promise((e,r)=>{t.then(e,r)})}a(n3o,"notCancellablePromise");function i3o(t){let e=-1,r=t.map((o,s)=>o.then(c=>(e=s,c))),n=Promise.race(r);return n.cancel=()=>{t.forEach((o,s)=>{s!==e&&o.cancel&&o.cancel()})},n.finally(()=>{n.cancel()}),n}a(i3o,"raceCancellablePromises");function ifn(t,e,r){let n,o=setTimeout(()=>{n?.(void 0),r?.()},e);return Promise.race([t.finally(()=>clearTimeout(o)),new Promise(s=>n=s)])}a(ifn,"raceTimeout");function o3o(t){return new Promise((e,r)=>{let n=t();tfn(n)?n.then(e,r):e(n)})}a(o3o,"asPromise");function ofn(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(ofn,"promiseWithResolvers");var L$e=class{static{a(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new l6t.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let r=a(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let n=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,n},"onComplete");this.queuedPromise=new Promise(n=>{this.activePromise.then(r,r).then(n)})}return new Promise((r,n)=>{this.queuedPromise.then(r,n)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((r,n)=>{this.activePromise.then(o=>{this.activePromise=null,r(o)},o=>{this.activePromise=null,n(o)})})}dispose(){this.cancellationTokenSource.cancel()}};Yt.Throttler=L$e;var $8t=class{static{a(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};Yt.Sequencer=$8t;var V8t=class{static{a(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};Yt.SequencerByKey=V8t;var s3o=a((t,e)=>{let r=!0,n=setTimeout(()=>{r=!1,e()},t);return{isTriggered:a(()=>r,"isTriggered"),dispose:a(()=>{clearTimeout(n),r=!1},"dispose")}},"timeoutDeferred"),a3o=a(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:a(()=>e,"isTriggered"),dispose:a(()=>{e=!1},"dispose")}},"microtaskDeferred"),F$e=class{static{a(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,r=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((o,s)=>{this.doResolve=o,this.doReject=s}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let o=this.task;return this.task=null,o()}}));let n=a(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=r===XLo.MicrotaskDelay?a3o(n):s3o(r,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new E_.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};Yt.Delayer=F$e;var W8t=class{static{a(this,"ThrottledDelayer")}constructor(e){this.delayer=new F$e(e),this.throttler=new L$e}trigger(e,r){return this.delayer.trigger(()=>this.throttler.queue(e),r)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};Yt.ThrottledDelayer=W8t;var U$e=class{static{a(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,r)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};Yt.Barrier=U$e;var z8t=class extends U$e{static{a(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};Yt.AutoOpenBarrier=z8t;function u6t(t,e){return e?new Promise((r,n)=>{let o=setTimeout(()=>{s.dispose(),r()},t),s=e.onCancellationRequested(()=>{clearTimeout(o),s.dispose(),n(new E_.CancellationError)})}):rfn(r=>u6t(t,r))}a(u6t,"timeout");function c3o(t,e=0,r){let n=setTimeout(()=>{t(),r&&o.dispose()},e),o=(0,z7.toDisposable)(()=>{clearTimeout(n),r?.delete(o)});return r?.add(o),o}a(c3o,"disposableTimeout");function l3o(t){let e=[],r=0,n=t.length;function o(){return r!!n,r=null){let n=0,o=t.length,s=a(()=>{if(n>=o)return Promise.resolve(r);let c=t[n++];return Promise.resolve(c()).then(u=>e(u)?Promise.resolve(u):s())},"loop");return s()}a(u3o,"first");function d3o(t,e=n=>!!n,r=null){if(t.length===0)return Promise.resolve(r);let n=t.length,o=a(()=>{n=-1;for(let s of t)s.cancel?.()},"finish");return new Promise((s,c)=>{for(let l of t)l.then(u=>{--n>=0&&e(u)?(o(),s(u)):n===0&&s(r)}).catch(u=>{--n>=0&&(o(),c(u))})})}a(d3o,"firstParallel");var Q$e=class{static{a(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new oTe.Emitter}whenIdle(){return this.size>0?oTe.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((r,n)=>{this.outstandingPromises.push({factory:e,c:r,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};Yt.Limiter=Q$e;var q$e=class extends Q$e{static{a(this,"Queue")}constructor(){super(1)}};Yt.Queue=q$e;var Y8t=class{static{a(this,"LimitedQueue")}constructor(){this.sequentializer=new H$e,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};Yt.LimitedQueue=Y8t;var K8t=class{static{a(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new JL;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,r=Xdn.extUri){let n=r.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,r,n=Xdn.extUri){let o=n.getComparisonKey(e),s=this.queues.get(o);if(!s){s=new q$e;let c=this.drainListenerCount++,l=oTe.Event.once(s.onDrained)(()=>{s?.dispose(),this.queues.delete(o),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(c),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new z7.DisposableMap),this.drainListeners.set(c,l),this.queues.set(o,s)}return s.queue(r)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};Yt.ResourceQueue=K8t;var J8t=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new JL;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new JL;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new E_.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new E_.CancellationError)}};Yt.TaskQueue=J8t;var Z8t=class{static{a(this,"TimeoutTimer")}constructor(e,r){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,r){if(this._isDisposed)throw new E_.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new E_.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},r))}};Yt.TimeoutTimer=Z8t;var X8t=class{static{a(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,r,n=globalThis){if(this.isDisposed)throw new E_.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let o=n.setInterval(()=>{e()},r);this.disposable=(0,z7.toDisposable)(()=>{n.clearInterval(o),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};Yt.IntervalTimer=X8t;var sTe=class{static{a(this,"RunOnceScheduler")}constructor(e,r){this.timeoutToken=void 0,this.runner=e,this.timeout=r,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};Yt.RunOnceScheduler=sTe;var e6t=class{static{a(this,"ProcessTimeRunOnceScheduler")}constructor(e,r){r%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${r}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=r,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};Yt.ProcessTimeRunOnceScheduler=e6t;var t6t=class extends sTe{static{a(this,"RunOnceWorker")}constructor(e,r){super(e,r),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};Yt.RunOnceWorker=t6t;var r6t=class extends z7.Disposable{static{a(this,"ThrottledWorker")}constructor(e,r){super(),this.options=e,this.handler=r,this.pendingWork=[],this.throttler=this._register(new z7.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let n of e)this.pendingWork.push(n);let r=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||r>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-r,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new sTe(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};Yt.ThrottledWorker=r6t;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?Yt._runWhenIdle=(e,r,n)=>{(0,ZLo.setTimeout0)(()=>{if(o)return;let s=Date.now()+15;r(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let o=!1;return{dispose(){o||(o=!0)}}}:Yt._runWhenIdle=(e,r,n)=>{let o=e.requestIdleCallback(r,typeof n=="number"?{timeout:n}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(o))}}},Yt.runWhenGlobalIdle=(e,r)=>(0,Yt._runWhenIdle)(globalThis,e,r)})();function f3o(t){let e=Yt._runWhenIdle,r=Yt.runWhenGlobalIdle;return Yt._runWhenIdle=t,Yt.runWhenGlobalIdle=(n,o)=>t(globalThis,n,o),(0,z7.toDisposable)(()=>{Yt._runWhenIdle=e,Yt.runWhenGlobalIdle=r})}a(f3o,"installFakeRunWhenIdle");var j$e=class{static{a(this,"AbstractIdleValue")}constructor(e,r){this._didRun=!1,this._executor=()=>{try{this._value=r()}catch(n){this._error=n}finally{this._didRun=!0}},this._handle=(0,Yt._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};Yt.AbstractIdleValue=j$e;var n6t=class extends j$e{static{a(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};Yt.GlobalIdleValue=n6t;async function p3o(t,e,r){let n;for(let o=0;on?.(),"cancel"),promise:r},r.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),r}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:r,resolve:n,reject:o}=ofn();this._queued={run:e,promise:r,promiseResolve:n,promiseReject:o}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};Yt.TaskSequentializer=H$e;var i6t=class{static{a(this,"IntervalCounter")}constructor(e,r=()=>Date.now()){this.interval=e,this.nowFn=r,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};Yt.IntervalCounter=i6t;var JL=class t{static{a(this,"DeferredPromise")}static fromPromise(e){let r=new t;return r.settleWith(e),r}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,r)=>{this.completeCallback=e,this.errorCallback=r})}complete(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.completeCallback(e),this.outcome={outcome:0,value:e},r()})}error(e){return this.isSettled?Promise.resolve():new Promise(r=>{this.errorCallback(e),this.outcome={outcome:1,value:e},r()})}settleWith(e){return e.then(r=>this.complete(r),r=>this.error(r))}cancel(){return this.error(new E_.CancellationError)}};Yt.DeferredPromise=JL;var efn;(function(t){async function e(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}a(e,"settled"),t.settled=e;function r(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}a(r,"withAsyncBody"),t.withAsyncBody=r})(efn||(Yt.Promises=efn={}));var G$e=class{static{a(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(r=>(this._value=r,this._isResolved=!0,r),r=>{throw this._error=r,this._isResolved=!0,r})}requireValue(){if(!this._isResolved)throw new E_.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};Yt.StatefulPromise=G$e;var o6t=class{static{a(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new e3o.Lazy(()=>new G$e(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};Yt.LazyStatefulPromise=o6t;var $$e=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new oTe.Emitter,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Yt.AsyncIterableObject=$$e;function h3o(t){let e=new l6t.CancellationTokenSource,r=t(e.token);return new W$e(e,async n=>{let o=e.token.onCancellationRequested(()=>{o.dispose(),e.dispose(),n.reject(new E_.CancellationError)});try{for await(let s of r){if(e.token.isCancellationRequested)return;n.emitOne(s)}o.dispose(),e.dispose()}catch(s){o.dispose(),e.dispose(),n.reject(s)}})}a(h3o,"createCancelableAsyncIterableProducer");var s6t=class{static{a(this,"AsyncIterableSource")}constructor(e){this._deferred=new JL,this._asyncIterable=new $$e(o=>{if(r){o.reject(r);return}return n&&o.emitMany(n),this._errorFn=s=>o.reject(s),this._emitOneFn=s=>o.emitOne(s),this._emitManyFn=s=>o.emitMany(s),this._deferred.p},e);let r,n;this._errorFn=o=>{r||(r=o)},this._emitOneFn=o=>{n||(n=[]),n.push(o)},this._emitManyFn=o=>{n?o.forEach(s=>n.push(s)):n=o.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};Yt.AsyncIterableSource=s6t;function m3o(t,e){let r=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await nfn(r.next(),e)||{done:!0,value:void 0}},throw:r.throw?.bind(r),return:r.return?.bind(r),[Symbol.asyncIterator](){return this}}}a(m3o,"cancellableIterable");var a6t=class{static{a(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let r=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(r,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let r of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(r,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new E_.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,r){r.ok?e.complete(r.value):e.error(r.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new JL;return this._unsatisfiedConsumers.push(e),e.p}}},V$e=class t{static{a(this,"AsyncIterableProducer")}constructor(e,r){this._onReturn=r,this._producerConsumer=new a6t,this._iterator={next:a(()=>this._producerConsumer.consume(),"next"),return:a(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:a(async n=>(this._finishError(n),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let n=e({emitOne:a(o=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}}),"emitOne"),emitMany:a(o=>{for(let s of o)this._producerConsumer.produce({ok:!0,value:{done:!1,value:s}})},"emitMany"),reject:a(o=>this._finishError(o),"reject")});if(!this._producerConsumer.hasFinalValue)try{await n,this._finishOk()}catch(o){this._finishError(o)}})}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}static tee(e){let r,n,o=new JL,s=a(async()=>{if(!(!r||!n))try{for await(let u of e)r.emitOne(u),n.emitOne(u)}catch(u){r.reject(u),n.reject(u)}finally{o.complete()}},"start"),c=new t(async u=>(r=u,s(),o.p)),l=new t(async u=>(n=u,s(),o.p));return[c,l]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};Yt.AsyncIterableProducer=V$e;var W$e=class extends V$e{static{a(this,"CancelableAsyncIterableProducer")}constructor(e,r){super(r),this._source=e}cancel(){this._source.cancel()}};Yt.CancelableAsyncIterableProducer=W$e;Yt.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var c6t=class{static{a(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,r){do{let n=await this.peek();if(n===Yt.AsyncReaderEndOfStream||!e(n))break;await this.read(),await r(n)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?Yt.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return Yt.AsyncReaderEndOfStream;throw new E_.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await ifn(this._extendBuffer(),e),this._atEnd)return Yt.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:r}=await this._source.next();this._extendBufferPromise=void 0,r?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};Yt.AsyncReader=c6t;function g3o(t,e){let r=setTimeout(e,t);return(0,z7.toDisposable)(()=>clearTimeout(r))}a(g3o,"createTimeout")});var Y$e=I(z$e=>{"use strict";p();Object.defineProperty(z$e,"__esModule",{value:!0});z$e.SyncDescriptor=void 0;var d6t=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};z$e.SyncDescriptor=d6t});var sfn=I(vce=>{"use strict";p();Object.defineProperty(vce,"__esModule",{value:!0});vce.Graph=vce.Node=void 0;var K$e=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};vce.Node=K$e;var f6t=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new K$e(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} + (-> incoming)[${[...n.incoming.keys()].join(", ")}] + (outgoing ->)[${[...n.outgoing.keys()].join(",")}] +`);return e.join(` +`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};vce.Graph=f6t});var h6t=I(J$e=>{"use strict";p();Object.defineProperty(J$e,"__esModule",{value:!0});J$e.ServiceCollection=void 0;var p6t=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};J$e.ServiceCollection=p6t});var cfn=I(Sce=>{"use strict";p();Object.defineProperty(Sce,"__esModule",{value:!0});Sce.Trace=Sce.InstantiationService=void 0;var A3o=zc(),y3o=bs(),m6t=Io(),Cce=Y$e(),afn=sfn(),g6t=Ms(),E3o=h6t(),_3o=dce(),v3o=!1,Z$e=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}},A6t=class t{static{a(this,"InstantiationService")}constructor(e=new E3o.ServiceCollection,r=!1,n,o=v3o){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(g6t.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new afn.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,m6t.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,m6t.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=bce.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,y3o.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof Cce.SyncDescriptor?(n=bce.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=bce.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=g6t._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof Cce.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof Cce.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new afn.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new Z$e(o);for(let d of g6t._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof Cce.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new Z$e(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Cce.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof Cce.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new A3o.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new _3o.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,m6t.toDisposable)(()=>{T(),b.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};Sce.InstantiationService=A6t;var bce=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` +`).slice(3,4).join(` +`)):t._None}static traceCreation(e,r){return e?new t(1,r.name):t._None}static{this._totals=0}constructor(e,r){this.type=e,this.name=r,this._start=Date.now(),this._dep=[]}branch(e,r){let n=new t(3,e.toString());return this._dep.push([e,r,n]),n}stop(){let e=Date.now()-this._start;t._totals+=e;let r=!1;function n(s,c){let l=[],u=new Array(s+1).join(" ");for(let[d,f,h]of c._dep)if(f&&h){r=!0,l.push(`${u}CREATES -> ${d}`);let m=n(s+1,h);m&&l.push(m)}else l.push(`${u}uses -> ${d}`);return l.join(` +`)}a(n,"printChild");let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${t._totals.toFixed(2)}ms)`];(e>2||r)&&t.all.add(o.join(` +`))}};Sce.Trace=bce});var tn=I(Tce=>{"use strict";p();Object.defineProperty(Tce,"__esModule",{value:!0});Tce.InstantiationServiceBuilder=Tce.createServiceIdentifier=void 0;var C3o=Ms();Object.defineProperty(Tce,"createServiceIdentifier",{enumerable:!0,get:a(function(){return C3o.createDecorator},"get")});var b3o=cfn(),lfn=h6t(),y6t=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new lfn.ServiceCollection(...e):e??new lfn.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new b3o.InstantiationService(this._collection,!0)}};Tce.InstantiationServiceBuilder=y6t});var Ice=I(X$e=>{"use strict";p();Object.defineProperty(X$e,"__esModule",{value:!0});X$e.TokenizerType=void 0;var ufn;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(ufn||(X$e.TokenizerType=ufn={}))});var _6t=I(dY=>{"use strict";p();Object.defineProperty(dY,"__esModule",{value:!0});dY.WorkerWithRpcProxy=dY.RcpResponseHandler=void 0;dY.createRpcProxy=dfn;var S3o=require("worker_threads"),eVe=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};dY.RcpResponseHandler=eVe;function dfn(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(dfn,"createRpcProxy");var E6t=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new eVe,this.worker=new S3o.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=dfn((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};dY.WorkerWithRpcProxy=E6t});var Y7=I(xce=>{"use strict";p();Object.defineProperty(xce,"__esModule",{value:!0});xce.CopilotTokenStore=xce.ICopilotTokenStore=void 0;var T3o=tn(),I3o=_c(),x3o=Io();xce.ICopilotTokenStore=(0,T3o.createServiceIdentifier)("ICopilotTokenStore");var v6t=class extends x3o.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new I3o.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};xce.CopilotTokenStore=v6t});var Bh=I(pA=>{"use strict";p();var w3o=pA&&pA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},R3o=pA&&pA.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(pA,"__esModule",{value:!0});pA.TelemetryTrustedValue=pA.ITelemetryService=pA.TelemetryUserConfigImpl=pA.ITelemetryUserConfig=void 0;pA.createTrackingIdGetter=k3o;pA.multiplexProperties=N3o;var ffn=tn(),P3o=Y7();pA.ITelemetryUserConfig=(0,ffn.createServiceIdentifier)("ITelemetryUserConfig");var C6t=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};pA.TelemetryUserConfigImpl=C6t;pA.TelemetryUserConfigImpl=C6t=w3o([R3o(2,P3o.ICopilotTokenStore)],C6t);function k3o(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(k3o,"createTrackingIdGetter");pA.ITelemetryService=(0,ffn.createServiceIdentifier)("ITelemetryService");var b6t=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};pA.TelemetryTrustedValue=b6t;var aTe=8192,D3o=50;function N3o(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>aTe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+aTe;o{"use strict";p();Object.defineProperty(gx,"__esModule",{value:!0});gx.SlidingWindowAverage=gx.MovingAverage=gx.Counter=void 0;gx.clamp=O3o;gx.rot=B3o;gx.isPointWithinTriangle=L3o;gx.randomChance=F3o;var M3o=Gu();function O3o(t,e,r){return Math.min(Math.max(t,e),r)}a(O3o,"clamp");function B3o(t,e){return(e+t%e)%e}a(B3o,"rot");var S6t=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};gx.Counter=S6t;var T6t=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};gx.MovingAverage=T6t;var I6t=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(L3o,"isPointWithinTriangle");function F3o(t){return(0,M3o.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(rVe,"__esModule",{value:!0});rVe.TikTokenImpl=void 0;var x6t=VHe(),tVe=pfn(),U3o=NM(),Q3o=oFt(),w6t=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new tVe.MovingAverage,textLength:new tVe.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?Q3o.parseTikTokenBinary:c=>c;return this._values.push((0,x6t.createTokenizer)(s(e),(0,x6t.getSpecialTokensByEncoder)(r),(0,x6t.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=U3o.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new tVe.MovingAverage,this._stats.textLength=new tVe.MovingAverage,this._stats.callCount=0,r}};rVe.TikTokenImpl=w6t});var J7=I(cf=>{p();var nVe=null;function q3o(t){nVe=t}a(q3o,"setExternalNativeTokenizerProvider");cf.setExternalNativeTokenizerProvider=q3o;var Afn=cf&&cf.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yfn=cf&&cf.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(cf,"__esModule",{value:!0});cf.TokenizerProvider=cf.BaseTokensPerName=cf.BaseTokensPerMessage=cf.BaseTokensPerCompletion=cf.ITokenizerProvider=void 0;cf.calculateImageTokenCost=D6t;cf.estimateDocumentTokenCost=_fn;var K7=xo(),j3o=o8t(),H3o=a8t(),G3o=tn(),mfn=Ice(),$3o=_6t(),V3o=Gu(),gfn=BL(),R6t=Io(),iVe=fA(),Efn=Bh(),P6t=hfn();cf.ITokenizerProvider=(0,G3o.createServiceIdentifier)("ITokenizerProvider");cf.BaseTokensPerCompletion=3;cf.BaseTokensPerMessage=3;cf.BaseTokensPerName=1;var k6t=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new gfn.Lazy(()=>new oVe(e,(0,iVe.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new gfn.Lazy(()=>new oVe(e,(0,iVe.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case mfn.TokenizerType.CL100K:return this._cl100kTokenizer.value;case mfn.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};cf.TokenizerProvider=k6t;cf.TokenizerProvider=k6t=Afn([yfn(1,Efn.ITelemetryService)],k6t);var oVe=class extends R6t.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new j3o.LRUCache(5e3),this.baseTokensPerMessage=cf.BaseTokensPerMessage,this.baseTokensPerName=cf.BaseTokensPerName,this.mode=K7.OutputMode.Raw}async countMessagesTokens(e){let r=cf.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case K7.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case K7.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case K7.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return D6t(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case K7.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case K7.Raw.ChatCompletionContentPartKind.Document:return _fn(e.documentData.data);default:(0,V3o.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,K7.toMode)(K7.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=D6t(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){if(nVe)try{await nVe.ensureLoaded(this._encoderName);let r=nVe.getEncoder(this._encoderName);if(r)return{encode:a(async(n,o)=>r.encode(n,o),"encode")};console.error("[chat-lib-tokenizer] host provider returned no encoder for "+this._encoderName+", falling back to own BPE load")}catch(r){console.error("[chat-lib-tokenizer] host delegate failed: "+r+", falling back to own BPE load")}let e=(0,iVe.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,iVe.join)(__dirname,"tikTokenizerWorker.js"),n=new $3o.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,R6t.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=P6t.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,R6t.toDisposable)(()=>{P6t.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>P6t.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};oVe=Afn([yfn(3,Efn.ITelemetryService)],oVe);function D6t(t,e){let{width:r,height:n}=(0,H3o.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(D6t,"calculateImageTokenCost");function _fn(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(_fn,"estimateDocumentTokenCost")});var vpn={};xi(vpn,{TextDocument:()=>e3});function l9t(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),o=t.slice(r);l9t(n,e),l9t(o,e);let s=0,c=0,l=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function h8o(t){let e=_pn(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var rWe,e3,u9t=_e(()=>{"use strict";p();rWe=class t{static{a(this,"FullTextDocument")}constructor(e,r,n,o){this._uri=e,this._languageId=r,this._version=n,this._content=o,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let o=_pn(n.range),s=this.offsetAt(o.start),c=this.offsetAt(o.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(c,this._content.length);let l=Math.max(o.start.line,0),u=Math.max(o.end.line,0),d=this._lineOffsets,f=ypn(n.text,!1,s);if(u-l===f.length)for(let m=0,g=f.length;me?o=c:n=c+1}let s=n-1;return e=this.ensureBeforeEOL(e,r[s]),{line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line];if(e.character<=0)return n;let o=e.line+1r&&Epn(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){let r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}};(function(t){function e(o,s,c,l){return new rWe(o,s,c,l)}a(e,"create"),t.create=e;function r(o,s,c){if(o instanceof rWe)return o.update(s,c),o;throw new Error("TextDocument.update: document must be created by TextDocument.create")}a(r,"update"),t.update=r;function n(o,s){let c=o.getText(),l=l9t(s.map(h8o),(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),u=0,d=[];for(let f of l){let h=o.offsetAt(f.range.start);if(hu&&d.push(c.substring(u,h)),f.newText.length&&d.push(f.newText),u=o.offsetAt(f.range.end)}return d.push(c.substr(u)),d.join("")}a(n,"applyEdits"),t.applyEdits=n})(e3||(e3={}));a(l9t,"mergeSort");a(ypn,"computeLineOffsets");a(Epn,"isEOL");a(_pn,"getWellformedRange");a(h8o,"getWellformedEdit")});var fWe=I(Qh=>{"use strict";p();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.thenable=Qh.typedArray=Qh.stringArray=Qh.array=Qh.func=Qh.error=Qh.number=Qh.string=Qh.boolean=void 0;function y8o(t){return t===!0||t===!1}a(y8o,"boolean");Qh.boolean=y8o;function khn(t){return typeof t=="string"||t instanceof String}a(khn,"string");Qh.string=khn;function E8o(t){return typeof t=="number"||t instanceof Number}a(E8o,"number");Qh.number=E8o;function _8o(t){return t instanceof Error}a(_8o,"error");Qh.error=_8o;function Dhn(t){return typeof t=="function"}a(Dhn,"func");Qh.func=Dhn;function Nhn(t){return Array.isArray(t)}a(Nhn,"array");Qh.array=Nhn;function v8o(t){return Nhn(t)&&t.every(e=>khn(e))}a(v8o,"stringArray");Qh.stringArray=v8o;function C8o(t,e){return Array.isArray(t)&&t.every(e)}a(C8o,"typedArray");Qh.typedArray=C8o;function b8o(t){return t&&Dhn(t.then)}a(b8o,"thenable");Qh.thenable=b8o});var w9t=I(yx=>{"use strict";p();Object.defineProperty(yx,"__esModule",{value:!0});yx.generateUuid=yx.parse=yx.isUUID=yx.v4=yx.empty=void 0;var STe=class{static{a(this,"ValueUUID")}constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},TTe=class t extends STe{static{a(this,"V4UUID")}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""))}};TTe._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];TTe._timeHighBits=["8","9","a","b"];yx.empty=new STe("00000000-0000-0000-0000-000000000000");function Mhn(){return new TTe}a(Mhn,"v4");yx.v4=Mhn;var S8o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Ohn(t){return S8o.test(t)}a(Ohn,"isUUID");yx.isUUID=Ohn;function T8o(t){if(!Ohn(t))throw new Error("invalid uuid");return new STe(t)}a(T8o,"parse");yx.parse=T8o;function I8o(){return Mhn().asHex()}a(I8o,"generateUuid");yx.generateUuid=I8o});var Bhn=I(uQ=>{"use strict";p();Object.defineProperty(uQ,"__esModule",{value:!0});uQ.attachPartialResult=uQ.ProgressFeature=uQ.attachWorkDone=void 0;var lQ=ei(),x8o=w9t(),_Y=class t{static{a(this,"WorkDoneProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this)}begin(e,r,n,o){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:o};this._connection.sendProgress(lQ.WorkDoneProgress.type,this._token,s)}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(lQ.WorkDoneProgress.type,this._token,n)}done(){t.Instances.delete(this._token),this._connection.sendProgress(lQ.WorkDoneProgress.type,this._token,{kind:"end"})}};_Y.Instances=new Map;var pWe=class extends _Y{static{a(this,"WorkDoneProgressServerReporterImpl")}constructor(e,r){super(e,r),this._source=new lQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},ITe=class{static{a(this,"NullProgressReporter")}constructor(){}begin(){}report(){}done(){}},hWe=class extends ITe{static{a(this,"NullProgressServerReporter")}constructor(){super(),this._source=new lQ.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};function w8o(t,e){if(e===void 0||e.workDoneToken===void 0)return new ITe;let r=e.workDoneToken;return delete e.workDoneToken,new _Y(t,r)}a(w8o,"attachWorkDone");uQ.attachWorkDone=w8o;var R8o=a(t=>class extends t{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(lQ.WorkDoneProgressCancelNotification.type,r=>{let n=_Y.Instances.get(r.token);(n instanceof pWe||n instanceof hWe)&&n.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new ITe:new _Y(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,x8o.generateUuid)();return this.connection.sendRequest(lQ.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new pWe(this.connection,e))}else return Promise.resolve(new hWe)}},"ProgressFeature");uQ.ProgressFeature=R8o;var R9t;(function(t){t.type=new lQ.ProgressType})(R9t||(R9t={}));var P9t=class{static{a(this,"ResultProgressReporterImpl")}constructor(e,r){this._connection=e,this._token=r}report(e){this._connection.sendProgress(R9t.type,this._token,e)}};function P8o(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new P9t(t,r)}a(P8o,"attachPartialResult");uQ.attachPartialResult=P8o});var Lhn=I(mWe=>{"use strict";p();Object.defineProperty(mWe,"__esModule",{value:!0});mWe.ConfigurationFeature=void 0;var k8o=ei(),D8o=fWe(),N8o=a(t=>class extends t{getConfiguration(e){return e?D8o.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(k8o.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}},"ConfigurationFeature");mWe.ConfigurationFeature=N8o});var Fhn=I(AWe=>{"use strict";p();Object.defineProperty(AWe,"__esModule",{value:!0});AWe.WorkspaceFoldersFeature=void 0;var gWe=ei(),M8o=a(t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new gWe.Emitter,this.connection.onNotification(gWe.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string"}getWorkspaceFolders(){return this.connection.sendRequest(gWe.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(gWe.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}},"WorkspaceFoldersFeature");AWe.WorkspaceFoldersFeature=M8o});var Uhn=I(yWe=>{"use strict";p();Object.defineProperty(yWe,"__esModule",{value:!0});yWe.CallHierarchyFeature=void 0;var k9t=ei(),O8o=a(t=>class extends t{get callHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(k9t.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onIncomingCalls:a(e=>{let r=k9t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onIncomingCalls"),onOutgoingCalls:a(e=>{let r=k9t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onOutgoingCalls")}}},"CallHierarchyFeature");yWe.CallHierarchyFeature=O8o});var N9t=I(dQ=>{"use strict";p();Object.defineProperty(dQ,"__esModule",{value:!0});dQ.SemanticTokensBuilder=dQ.SemanticTokensDiff=dQ.SemanticTokensFeature=void 0;var EWe=ei(),B8o=a(t=>class extends t{get semanticTokens(){return{refresh:a(()=>this.connection.sendRequest(EWe.SemanticTokensRefreshRequest.type),"refresh"),on:a(e=>{let r=EWe.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on"),onDelta:a(e=>{let r=EWe.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onDelta"),onRange:a(e=>{let r=EWe.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onRange")}}},"SemanticTokensFeature");dQ.SemanticTokensFeature=B8o;var _We=class{static{a(this,"SemanticTokensDiff")}constructor(e,r){this.originalSequence=e,this.modifiedSequence=r}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[o]===this.modifiedSequence[s];)o--,s--;(o0&&(c-=this._prevLine,c===0&&(l-=this._prevChar)),this._data[this._dataLen++]=c,this._data[this._dataLen++]=l,this._data[this._dataLen++]=n,this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new _We(this._prevData,this._data).computeDiff()}:this.build()}};dQ.SemanticTokensBuilder=D9t});var Qhn=I(vWe=>{"use strict";p();Object.defineProperty(vWe,"__esModule",{value:!0});vWe.ShowDocumentFeature=void 0;var L8o=ei(),F8o=a(t=>class extends t{showDocument(e){return this.connection.sendRequest(L8o.ShowDocumentRequest.type,e)}},"ShowDocumentFeature");vWe.ShowDocumentFeature=F8o});var qhn=I(CWe=>{"use strict";p();Object.defineProperty(CWe,"__esModule",{value:!0});CWe.FileOperationsFeature=void 0;var Lce=ei(),U8o=a(t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(Lce.DidCreateFilesNotification.type,r=>{e(r)})}onDidRenameFiles(e){return this.connection.onNotification(Lce.DidRenameFilesNotification.type,r=>{e(r)})}onDidDeleteFiles(e){return this.connection.onNotification(Lce.DidDeleteFilesNotification.type,r=>{e(r)})}onWillCreateFiles(e){return this.connection.onRequest(Lce.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(Lce.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(Lce.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}},"FileOperationsFeature");CWe.FileOperationsFeature=U8o});var jhn=I(bWe=>{"use strict";p();Object.defineProperty(bWe,"__esModule",{value:!0});bWe.LinkedEditingRangeFeature=void 0;var Q8o=ei(),q8o=a(t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(Q8o.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}},"LinkedEditingRangeFeature");bWe.LinkedEditingRangeFeature=q8o});var Hhn=I(SWe=>{"use strict";p();Object.defineProperty(SWe,"__esModule",{value:!0});SWe.TypeHierarchyFeature=void 0;var M9t=ei(),j8o=a(t=>class extends t{get typeHierarchy(){return{onPrepare:a(e=>this.connection.onRequest(M9t.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),"onPrepare"),onSupertypes:a(e=>{let r=M9t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSupertypes"),onSubtypes:a(e=>{let r=M9t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"onSubtypes")}}},"TypeHierarchyFeature");SWe.TypeHierarchyFeature=j8o});var $hn=I(TWe=>{"use strict";p();Object.defineProperty(TWe,"__esModule",{value:!0});TWe.InlineValueFeature=void 0;var Ghn=ei(),H8o=a(t=>class extends t{get inlineValue(){return{refresh:a(()=>this.connection.sendRequest(Ghn.InlineValueRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(Ghn.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineValueFeature");TWe.InlineValueFeature=H8o});var Whn=I(IWe=>{"use strict";p();Object.defineProperty(IWe,"__esModule",{value:!0});IWe.FoldingRangeFeature=void 0;var Vhn=ei(),G8o=a(t=>class extends t{get foldingRange(){return{refresh:a(()=>this.connection.sendRequest(Vhn.FoldingRangeRefreshRequest.type),"refresh"),on:a(e=>{let r=Vhn.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"FoldingRangeFeature");IWe.FoldingRangeFeature=G8o});var zhn=I(xWe=>{"use strict";p();Object.defineProperty(xWe,"__esModule",{value:!0});xWe.InlayHintFeature=void 0;var O9t=ei(),$8o=a(t=>class extends t{get inlayHint(){return{refresh:a(()=>this.connection.sendRequest(O9t.InlayHintRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(O9t.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on"),resolve:a(e=>this.connection.onRequest(O9t.InlayHintResolveRequest.type,(r,n)=>e(r,n)),"resolve")}}},"InlayHintFeature");xWe.InlayHintFeature=$8o});var Yhn=I(wWe=>{"use strict";p();Object.defineProperty(wWe,"__esModule",{value:!0});wWe.DiagnosticFeature=void 0;var xTe=ei(),V8o=a(t=>class extends t{get diagnostics(){return{refresh:a(()=>this.connection.sendRequest(xTe.DiagnosticRefreshRequest.type),"refresh"),on:a(e=>this.connection.onRequest(xTe.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(xTe.DocumentDiagnosticRequest.partialResult,r))),"on"),onWorkspace:a(e=>this.connection.onRequest(xTe.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(xTe.WorkspaceDiagnosticRequest.partialResult,r))),"onWorkspace")}}},"DiagnosticFeature");wWe.DiagnosticFeature=V8o});var L9t=I(RWe=>{"use strict";p();Object.defineProperty(RWe,"__esModule",{value:!0});RWe.TextDocuments=void 0;var vY=ei(),B9t=class{static{a(this,"TextDocuments")}constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new vY.Emitter,this._onDidOpen=new vY.Emitter,this._onDidClose=new vY.Emitter,this._onDidSave=new vY.Emitter,this._onWillSave=new vY.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=vY.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,s);let c=Object.freeze({document:s});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),r.push(e.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=this._syncedDocuments.get(o.uri);l!==void 0&&(l=this._configuration.update(l,s,c),this._syncedDocuments.set(o.uri,l),this._onDidChangeContent.fire(Object.freeze({document:l})))})),r.push(e.onDidCloseTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),r.push(e.onWillSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:n.reason}))})),r.push(e.onWillSaveTextDocumentWaitUntil((n,o)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),o):[]})),r.push(e.onDidSaveTextDocument(n=>{let o=this._syncedDocuments.get(n.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),vY.Disposable.create(()=>{r.forEach(n=>n.dispose())})}};RWe.TextDocuments=B9t});var U9t=I(Fce=>{"use strict";p();Object.defineProperty(Fce,"__esModule",{value:!0});Fce.NotebookDocuments=Fce.NotebookSyncFeature=void 0;var Ex=ei(),Khn=L9t(),W8o=a(t=>class extends t{get synchronization(){return{onDidOpenNotebookDocument:a(e=>this.connection.onNotification(Ex.DidOpenNotebookDocumentNotification.type,r=>{e(r)}),"onDidOpenNotebookDocument"),onDidChangeNotebookDocument:a(e=>this.connection.onNotification(Ex.DidChangeNotebookDocumentNotification.type,r=>{e(r)}),"onDidChangeNotebookDocument"),onDidSaveNotebookDocument:a(e=>this.connection.onNotification(Ex.DidSaveNotebookDocumentNotification.type,r=>{e(r)}),"onDidSaveNotebookDocument"),onDidCloseNotebookDocument:a(e=>this.connection.onNotification(Ex.DidCloseNotebookDocumentNotification.type,r=>{e(r)}),"onDidCloseNotebookDocument")}}},"NotebookSyncFeature");Fce.NotebookSyncFeature=W8o;var PWe=class t{static{a(this,"CellTextDocumentConnection")}onDidOpenTextDocument(e){return this.openHandler=e,Ex.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ex.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ex.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};PWe.NULL_DISPOSE=Object.freeze({dispose:a(()=>{},"dispose")});var F9t=class{static{a(this,"NotebookDocuments")}constructor(e){e instanceof Khn.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Khn.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ex.Emitter,this._onDidChange=new Ex.Emitter,this._onDidSave=new Ex.Emitter,this._onDidClose=new Ex.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new PWe,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(o=>{this.notebookDocuments.set(o.notebookDocument.uri,o.notebookDocument);for(let s of o.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(o.notebookDocument),this._onDidOpen.fire(o.notebookDocument)})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s===void 0)return;s.version=o.notebookDocument.version;let c=s.metadata,l=!1,u=o.change;u.metadata!==void 0&&(l=!0,s.metadata=u.metadata);let d=[],f=[],h=[],m=[];if(u.cells!==void 0){let _=u.cells;if(_.structure!==void 0){let v=_.structure.array;if(s.cells.splice(v.start,v.deleteCount,...v.cells!==void 0?v.cells:[]),_.structure.didOpen!==void 0)for(let b of _.structure.didOpen)r.openTextDocument({textDocument:b}),d.push(b.uri);if(_.structure.didClose)for(let b of _.structure.didClose)r.closeTextDocument({textDocument:b}),f.push(b.uri)}if(_.data!==void 0){let v=new Map(_.data.map(b=>[b.document,b]));for(let b=0;b<=s.cells.length;b++){let T=v.get(s.cells[b].document);if(T!==void 0){let w=s.cells.splice(b,1,T);if(h.push({old:w[0],new:T}),v.delete(T.document),v.size===0)break}}}if(_.textContent!==void 0)for(let v of _.textContent)r.changeTextDocument({textDocument:v.document,contentChanges:v.changes}),m.push(v.document.uri)}this.updateCellMap(s);let g={notebookDocument:s};l&&(g.metadata={old:c,new:s.metadata});let A=[];for(let _ of d)A.push(this.getNotebookCell(_));let y=[];for(let _ of f)y.push(this.getNotebookCell(_));let E=[];for(let _ of m)E.push(this.getNotebookCell(_));(A.length>0||y.length>0||h.length>0||E.length>0)&&(g.cells={added:A,removed:y,changed:{data:h,textContent:E}}),(g.metadata!==void 0||g.cells!==void 0)&&this._onDidChange.fire(g)})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(o=>{let s=this.notebookDocuments.get(o.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let c of o.cellTextDocuments)r.closeTextDocument({textDocument:c});this.notebookDocuments.delete(o.notebookDocument.uri);for(let c of s.cells)this.notebookCellMap.delete(c.document)}})),Ex.Disposable.create(()=>{n.forEach(o=>o.dispose())})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e])}};Fce.NotebookDocuments=F9t});var Jhn=I(kWe=>{"use strict";p();Object.defineProperty(kWe,"__esModule",{value:!0});kWe.MonikerFeature=void 0;var z8o=ei(),Y8o=a(t=>class extends t{get moniker(){return{on:a(e=>{let r=z8o.MonikerRequest.type;return this.connection.onRequest(r,(n,o)=>e(n,o,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},"on")}}},"MonikerFeature");kWe.MonikerFeature=Y8o});var $9t=I(fc=>{"use strict";p();Object.defineProperty(fc,"__esModule",{value:!0});fc.createConnection=fc.combineFeatures=fc.combineNotebooksFeatures=fc.combineLanguagesFeatures=fc.combineWorkspaceFeatures=fc.combineWindowFeatures=fc.combineClientFeatures=fc.combineTracerFeatures=fc.combineTelemetryFeatures=fc.combineConsoleFeatures=fc._NotebooksImpl=fc._LanguagesImpl=fc.BulkUnregistration=fc.BulkRegistration=fc.ErrorMessageTracker=void 0;var Kr=ei(),_x=fWe(),q9t=w9t(),wo=Bhn(),K8o=Lhn(),J8o=Fhn(),Z8o=Uhn(),X8o=N9t(),e6o=Qhn(),t6o=qhn(),r6o=jhn(),n6o=Hhn(),i6o=$hn(),o6o=Whn(),s6o=zhn(),a6o=Yhn(),c6o=U9t(),l6o=Jhn();function Q9t(t){if(t!==null)return t}a(Q9t,"null2Undefined");var j9t=class{static{a(this,"ErrorMessageTracker")}constructor(){this._messages=Object.create(null)}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r)})}};fc.ErrorMessageTracker=j9t;var DWe=class{static{a(this,"RemoteConsoleImpl")}constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(Kr.MessageType.Error,e)}warn(e){this.send(Kr.MessageType.Warning,e)}info(e){this.send(Kr.MessageType.Info,e)}log(e){this.send(Kr.MessageType.Log,e)}debug(e){this.send(Kr.MessageType.Debug,e)}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(Kr.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0,Kr.RAL)().console.error("Sending log message failed")})}},H9t=class{static{a(this,"_RemoteWindowImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:Kr.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(Q9t)}showWarningMessage(e,...r){let n={type:Kr.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(Q9t)}showInformationMessage(e,...r){let n={type:Kr.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(Kr.ShowMessageRequest.type,n).then(Q9t)}},Zhn=(0,e6o.ShowDocumentFeature)((0,wo.ProgressFeature)(H9t)),Xhn;(function(t){function e(){return new NWe}a(e,"create"),t.create=e})(Xhn||(fc.BulkRegistration=Xhn={}));var NWe=class{static{a(this,"BulkRegistrationImpl")}constructor(){this._registrations=[],this._registered=new Set}add(e,r){let n=_x.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let o=q9t.generateUuid();this._registrations.push({id:o,method:n,registerOptions:r||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}},e0n;(function(t){function e(){return new wTe(void 0,[])}a(e,"create"),t.create=e})(e0n||(fc.BulkUnregistration=e0n={}));var wTe=class{static{a(this,"BulkUnregistrationImpl")}constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(Kr.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(e){let r=_x.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return!1;let o={unregisterations:[n]};return this._connection.sendRequest(Kr.UnregistrationRequest.type,o).then(()=>{this._unregistrations.delete(r)},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)}),!0}},MWe=class{static{a(this,"RemoteClientImpl")}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof NWe?this.registerMany(e):e instanceof wTe?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let o=_x.string(r)?r:r.method,s=q9t.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(Kr.RegistrationRequest.type,c).then(l=>(e.add({id:s,method:o}),e),l=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(l)))}registerSingle2(e,r){let n=_x.string(e)?e:e.method,o=q9t.generateUuid(),s={registrations:[{id:o,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(Kr.RegistrationRequest.type,s).then(c=>Kr.Disposable.create(()=>{this.unregisterSingle(o,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),c=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(c)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(Kr.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(Kr.RegistrationRequest.type,r).then(()=>new wTe(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},G9t=class{static{a(this,"_RemoteWorkspaceImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(o){return o&&!!o.edit}a(r,"isApplyWorkspaceEditParams");let n=r(e)?e:{edit:e};return this.connection.sendRequest(Kr.ApplyWorkspaceEditRequest.type,n)}},t0n=(0,t6o.FileOperationsFeature)((0,J8o.WorkspaceFoldersFeature)((0,K8o.ConfigurationFeature)(G9t))),OWe=class{static{a(this,"TracerImpl")}constructor(){this._trace=Kr.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,r){this._trace!==Kr.Trace.Off&&this.connection.sendNotification(Kr.LogTraceNotification.type,{message:e,verbose:this._trace===Kr.Trace.Verbose?r:void 0}).catch(()=>{})}},BWe=class{static{a(this,"TelemetryImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(Kr.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}},LWe=class{static{a(this,"_LanguagesImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,wo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,wo.attachPartialResult)(this.connection,r)}};fc._LanguagesImpl=LWe;var r0n=(0,o6o.FoldingRangeFeature)((0,l6o.MonikerFeature)((0,a6o.DiagnosticFeature)((0,s6o.InlayHintFeature)((0,i6o.InlineValueFeature)((0,n6o.TypeHierarchyFeature)((0,r6o.LinkedEditingRangeFeature)((0,X8o.SemanticTokensFeature)((0,Z8o.CallHierarchyFeature)(LWe))))))))),FWe=class{static{a(this,"_NotebooksImpl")}constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,wo.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return(0,wo.attachPartialResult)(this.connection,r)}};fc._NotebooksImpl=FWe;var n0n=(0,c6o.NotebookSyncFeature)(FWe);function i0n(t,e){return function(r){return e(t(r))}}a(i0n,"combineConsoleFeatures");fc.combineConsoleFeatures=i0n;function o0n(t,e){return function(r){return e(t(r))}}a(o0n,"combineTelemetryFeatures");fc.combineTelemetryFeatures=o0n;function s0n(t,e){return function(r){return e(t(r))}}a(s0n,"combineTracerFeatures");fc.combineTracerFeatures=s0n;function a0n(t,e){return function(r){return e(t(r))}}a(a0n,"combineClientFeatures");fc.combineClientFeatures=a0n;function c0n(t,e){return function(r){return e(t(r))}}a(c0n,"combineWindowFeatures");fc.combineWindowFeatures=c0n;function l0n(t,e){return function(r){return e(t(r))}}a(l0n,"combineWorkspaceFeatures");fc.combineWorkspaceFeatures=l0n;function u0n(t,e){return function(r){return e(t(r))}}a(u0n,"combineLanguagesFeatures");fc.combineLanguagesFeatures=u0n;function d0n(t,e){return function(r){return e(t(r))}}a(d0n,"combineNotebooksFeatures");fc.combineNotebooksFeatures=d0n;function u6o(t,e){function r(o,s,c){return o&&s?c(o,s):o||s}return a(r,"combine"),{__brand:"features",console:r(t.console,e.console,i0n),tracer:r(t.tracer,e.tracer,s0n),telemetry:r(t.telemetry,e.telemetry,o0n),client:r(t.client,e.client,a0n),window:r(t.window,e.window,c0n),workspace:r(t.workspace,e.workspace,l0n),languages:r(t.languages,e.languages,u0n),notebooks:r(t.notebooks,e.notebooks,d0n)}}a(u6o,"combineFeatures");fc.combineFeatures=u6o;function d6o(t,e,r){let n=r&&r.console?new(r.console(DWe)):new DWe,o=t(n);n.rawAttach(o);let s=r&&r.tracer?new(r.tracer(OWe)):new OWe,c=r&&r.telemetry?new(r.telemetry(BWe)):new BWe,l=r&&r.client?new(r.client(MWe)):new MWe,u=r&&r.window?new(r.window(Zhn)):new Zhn,d=r&&r.workspace?new(r.workspace(t0n)):new t0n,f=r&&r.languages?new(r.languages(r0n)):new r0n,h=r&&r.notebooks?new(r.notebooks(n0n)):new n0n,m=[n,s,c,l,u,d,f,h];function g(v){return v instanceof Promise?v:_x.thenable(v)?new Promise((b,T)=>{v.then(w=>b(w),w=>T(w))}):Promise.resolve(v)}a(g,"asPromise");let A,y,E,_={listen:a(()=>o.listen(),"listen"),sendRequest:a((v,...b)=>o.sendRequest(_x.string(v)?v:v.method,...b),"sendRequest"),onRequest:a((v,b)=>o.onRequest(v,b),"onRequest"),sendNotification:a((v,b)=>{let T=_x.string(v)?v:v.method;return o.sendNotification(T,b)},"sendNotification"),onNotification:a((v,b)=>o.onNotification(v,b),"onNotification"),onProgress:o.onProgress,sendProgress:o.sendProgress,onInitialize:a(v=>(y=v,{dispose:a(()=>{y=void 0},"dispose")}),"onInitialize"),onInitialized:a(v=>o.onNotification(Kr.InitializedNotification.type,v),"onInitialized"),onShutdown:a(v=>(A=v,{dispose:a(()=>{A=void 0},"dispose")}),"onShutdown"),onExit:a(v=>(E=v,{dispose:a(()=>{E=void 0},"dispose")}),"onExit"),get console(){return n},get telemetry(){return c},get tracer(){return s},get client(){return l},get window(){return u},get workspace(){return d},get languages(){return f},get notebooks(){return h},onDidChangeConfiguration:a(v=>o.onNotification(Kr.DidChangeConfigurationNotification.type,v),"onDidChangeConfiguration"),onDidChangeWatchedFiles:a(v=>o.onNotification(Kr.DidChangeWatchedFilesNotification.type,v),"onDidChangeWatchedFiles"),__textDocumentSync:void 0,onDidOpenTextDocument:a(v=>o.onNotification(Kr.DidOpenTextDocumentNotification.type,v),"onDidOpenTextDocument"),onDidChangeTextDocument:a(v=>o.onNotification(Kr.DidChangeTextDocumentNotification.type,v),"onDidChangeTextDocument"),onDidCloseTextDocument:a(v=>o.onNotification(Kr.DidCloseTextDocumentNotification.type,v),"onDidCloseTextDocument"),onWillSaveTextDocument:a(v=>o.onNotification(Kr.WillSaveTextDocumentNotification.type,v),"onWillSaveTextDocument"),onWillSaveTextDocumentWaitUntil:a(v=>o.onRequest(Kr.WillSaveTextDocumentWaitUntilRequest.type,v),"onWillSaveTextDocumentWaitUntil"),onDidSaveTextDocument:a(v=>o.onNotification(Kr.DidSaveTextDocumentNotification.type,v),"onDidSaveTextDocument"),sendDiagnostics:a(v=>o.sendNotification(Kr.PublishDiagnosticsNotification.type,v),"sendDiagnostics"),onHover:a(v=>o.onRequest(Kr.HoverRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onHover"),onCompletion:a(v=>o.onRequest(Kr.CompletionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCompletion"),onCompletionResolve:a(v=>o.onRequest(Kr.CompletionResolveRequest.type,v),"onCompletionResolve"),onSignatureHelp:a(v=>o.onRequest(Kr.SignatureHelpRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onSignatureHelp"),onDeclaration:a(v=>o.onRequest(Kr.DeclarationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDeclaration"),onDefinition:a(v=>o.onRequest(Kr.DefinitionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDefinition"),onTypeDefinition:a(v=>o.onRequest(Kr.TypeDefinitionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onTypeDefinition"),onImplementation:a(v=>o.onRequest(Kr.ImplementationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onImplementation"),onReferences:a(v=>o.onRequest(Kr.ReferencesRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onReferences"),onDocumentHighlight:a(v=>o.onRequest(Kr.DocumentHighlightRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentHighlight"),onDocumentSymbol:a(v=>o.onRequest(Kr.DocumentSymbolRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentSymbol"),onWorkspaceSymbol:a(v=>o.onRequest(Kr.WorkspaceSymbolRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onWorkspaceSymbol"),onWorkspaceSymbolResolve:a(v=>o.onRequest(Kr.WorkspaceSymbolResolveRequest.type,v),"onWorkspaceSymbolResolve"),onCodeAction:a(v=>o.onRequest(Kr.CodeActionRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCodeAction"),onCodeActionResolve:a(v=>o.onRequest(Kr.CodeActionResolveRequest.type,(b,T)=>v(b,T)),"onCodeActionResolve"),onCodeLens:a(v=>o.onRequest(Kr.CodeLensRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onCodeLens"),onCodeLensResolve:a(v=>o.onRequest(Kr.CodeLensResolveRequest.type,(b,T)=>v(b,T)),"onCodeLensResolve"),onDocumentFormatting:a(v=>o.onRequest(Kr.DocumentFormattingRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onDocumentFormatting"),onDocumentRangeFormatting:a(v=>o.onRequest(Kr.DocumentRangeFormattingRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onDocumentRangeFormatting"),onDocumentOnTypeFormatting:a(v=>o.onRequest(Kr.DocumentOnTypeFormattingRequest.type,(b,T)=>v(b,T)),"onDocumentOnTypeFormatting"),onRenameRequest:a(v=>o.onRequest(Kr.RenameRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onRenameRequest"),onPrepareRename:a(v=>o.onRequest(Kr.PrepareRenameRequest.type,(b,T)=>v(b,T)),"onPrepareRename"),onDocumentLinks:a(v=>o.onRequest(Kr.DocumentLinkRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentLinks"),onDocumentLinkResolve:a(v=>o.onRequest(Kr.DocumentLinkResolveRequest.type,(b,T)=>v(b,T)),"onDocumentLinkResolve"),onDocumentColor:a(v=>o.onRequest(Kr.DocumentColorRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onDocumentColor"),onColorPresentation:a(v=>o.onRequest(Kr.ColorPresentationRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onColorPresentation"),onFoldingRanges:a(v=>o.onRequest(Kr.FoldingRangeRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onFoldingRanges"),onSelectionRanges:a(v=>o.onRequest(Kr.SelectionRangeRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),(0,wo.attachPartialResult)(o,b))),"onSelectionRanges"),onExecuteCommand:a(v=>o.onRequest(Kr.ExecuteCommandRequest.type,(b,T)=>v(b,T,(0,wo.attachWorkDone)(o,b),void 0)),"onExecuteCommand"),dispose:a(()=>o.dispose(),"dispose")};for(let v of m)v.attach(_);return o.onRequest(Kr.InitializeRequest.type,v=>{e.initialize(v),_x.string(v.trace)&&(s.trace=Kr.Trace.fromString(v.trace));for(let b of m)b.initialize(v.capabilities);if(y){let b=y(v,new Kr.CancellationTokenSource().token,(0,wo.attachWorkDone)(o,v),void 0);return g(b).then(T=>{if(T instanceof Kr.ResponseError)return T;let w=T;w||(w={capabilities:{}});let R=w.capabilities;R||(R={},w.capabilities=R),R.textDocumentSync===void 0||R.textDocumentSync===null?R.textDocumentSync=_x.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None:!_x.number(R.textDocumentSync)&&!_x.number(R.textDocumentSync.change)&&(R.textDocumentSync.change=_x.number(_.__textDocumentSync)?_.__textDocumentSync:Kr.TextDocumentSyncKind.None);for(let x of m)x.fillServerCapabilities(R);return w})}else{let b={capabilities:{textDocumentSync:Kr.TextDocumentSyncKind.None}};for(let T of m)T.fillServerCapabilities(b.capabilities);return b}}),o.onRequest(Kr.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,A)return A(new Kr.CancellationTokenSource().token)}),o.onNotification(Kr.ExitNotification.type,()=>{try{E&&E()}finally{e.shutdownReceived?e.exit(0):e.exit(1)}}),o.onNotification(Kr.SetTraceNotification.type,v=>{s.trace=Kr.Trace.fromString(v.value)}),_}a(d6o,"createConnection");fc.createConnection=d6o});var f0n=I(CC=>{"use strict";p();Object.defineProperty(CC,"__esModule",{value:!0});CC.resolveModulePath=CC.FileSystem=CC.resolveGlobalYarnPath=CC.resolveGlobalNodePath=CC.resolve=CC.uriToFilePath=void 0;var f6o=require("url"),dk=require("path"),V9t=require("fs"),K9t=require("child_process");function p6o(t){let e=f6o.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,o=r.length;n1){let s=r[0],c=r[1];s.length===0&&c.length>1&&c[1]===":"&&r.shift()}return dk.normalize(r.join("/"))}a(p6o,"uriToFilePath");CC.uriToFilePath=p6o;function W9t(){return process.platform==="win32"}a(W9t,"isWindows");function UWe(t,e,r,n){let o="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(f=>d[f]=u[f]),e&&V9t.existsSync(e)&&(d[o]?d[o]=e+dk.delimiter+d[o]:d[o]=e,n&&n(`NODE_PATH value is: ${d[o]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let f=(0,K9t.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(f.pid===void 0){l(new Error(`Starting process to resolve node module ${t} failed`));return}f.on("error",m=>{l(m)}),f.on("message",m=>{m.c==="r"&&(f.send({c:"e"}),m.s?c(m.r):l(new Error(`Failed to resolve module: ${t}`)))});let h={c:"rs",a:t};f.send(h)}catch(f){l(f)}})}a(UWe,"resolve");CC.resolve=UWe;function z9t(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};W9t()&&(e="npm.cmd",n.shell=!0);let o=a(()=>{},"handler");try{process.on("SIGPIPE",o);let s=(0,K9t.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let c=s.trim();return t&&t(`'npm config get prefix' value is: ${c}`),c.length>0?W9t()?dk.join(c,"node_modules"):dk.join(c,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",o)}}a(z9t,"resolveGlobalNodePath");CC.resolveGlobalNodePath=z9t;function h6o(t){let e="yarn",r={encoding:"utf8"};W9t()&&(e="yarn.cmd",r.shell=!0);let n=a(()=>{},"handler");try{process.on("SIGPIPE",n);let o=(0,K9t.spawnSync)(e,["global","dir","--json"],r),s=o.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),o.stderr&&t(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let l of c)try{let u=JSON.parse(l);if(u.type==="log")return dk.join(u.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n)}}a(h6o,"resolveGlobalYarnPath");CC.resolveGlobalYarnPath=h6o;var Y9t;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!V9t.existsSync(__filename.toUpperCase())||!V9t.existsSync(__filename.toLowerCase())),e}a(r,"isCaseSensitive"),t.isCaseSensitive=r;function n(o,s){return r()?dk.normalize(s).indexOf(dk.normalize(o))===0:dk.normalize(s).toLowerCase().indexOf(dk.normalize(o).toLowerCase())===0}a(n,"isParent"),t.isParent=n})(Y9t||(CC.FileSystem=Y9t={}));function m6o(t,e,r,n){return r?(dk.isAbsolute(r)||(r=dk.join(t,r)),UWe(e,r,r,n).then(o=>Y9t.isParent(r,o)?o:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,o=>UWe(e,z9t(n),t,n))):UWe(e,z9t(n),t,n)}a(m6o,"resolveModulePath");CC.resolveModulePath=m6o});var J9t=I((jDu,p0n)=>{"use strict";p();p0n.exports=ei()});var h0n=I(QWe=>{"use strict";p();Object.defineProperty(QWe,"__esModule",{value:!0});QWe.InlineCompletionFeature=void 0;var g6o=ei(),A6o=a(t=>class extends t{get inlineCompletion(){return{on:a(e=>this.connection.onRequest(g6o.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),"on")}}},"InlineCompletionFeature");QWe.InlineCompletionFeature=A6o});var A0n=I(Gy=>{"use strict";p();var y6o=Gy&&Gy.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g0n=Gy&&Gy.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y6o(e,t,r)};Object.defineProperty(Gy,"__esModule",{value:!0});Gy.ProposedFeatures=Gy.NotebookDocuments=Gy.TextDocuments=Gy.SemanticTokensBuilder=void 0;var E6o=N9t();Object.defineProperty(Gy,"SemanticTokensBuilder",{enumerable:!0,get:a(function(){return E6o.SemanticTokensBuilder},"get")});var _6o=h0n();g0n(ei(),Gy);var v6o=L9t();Object.defineProperty(Gy,"TextDocuments",{enumerable:!0,get:a(function(){return v6o.TextDocuments},"get")});var C6o=U9t();Object.defineProperty(Gy,"NotebookDocuments",{enumerable:!0,get:a(function(){return C6o.NotebookDocuments},"get")});g0n($9t(),Gy);var m0n;(function(t){t.all={__brand:"features",languages:_6o.InlineCompletionFeature}})(m0n||(Gy.ProposedFeatures=m0n={}))});var Al=I(vx=>{"use strict";p();var b6o=vx&&vx.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v0n=vx&&vx.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b6o(e,t,r)};Object.defineProperty(vx,"__esModule",{value:!0});vx.createConnection=vx.Files=void 0;var y0n=require("node:util"),Z9t=fWe(),S6o=$9t(),RTe=f0n(),CY=J9t();v0n(J9t(),vx);v0n(A0n(),vx);var E0n;(function(t){t.uriToFilePath=RTe.uriToFilePath,t.resolveGlobalNodePath=RTe.resolveGlobalNodePath,t.resolveGlobalYarnPath=RTe.resolveGlobalYarnPath,t.resolve=RTe.resolve,t.resolveModulePath=RTe.resolveModulePath})(E0n||(vx.Files=E0n={}));var _0n;function qWe(){if(_0n!==void 0)try{_0n.end()}catch{}}a(qWe,"endProtocolConnection");var Uce=!1,C0n;function T6o(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(C0n=setInterval(()=>{try{process.kill(n,0)}catch{qWe(),process.exit(Uce?0:1)}},3e3))}catch{}}a(e,"runTimer");for(let r=2;r{let e=t.processId;Z9t.number(e)&&C0n===void 0&&setInterval(()=>{try{process.kill(e,0)}catch{process.exit(Uce?0:1)}},3e3)},"initialize"),get shutdownReceived(){return Uce},set shutdownReceived(t){Uce=t},exit:a(t=>{qWe(),process.exit(t)},"exit")};function x6o(t,e,r,n){let o,s,c,l;return t!==void 0&&t.__brand==="features"&&(o=t,t=e,e=r,r=n),CY.ConnectionStrategy.is(t)||CY.ConnectionOptions.is(t)?l=t:(s=t,c=e,l=r),w6o(s,c,l,o)}a(x6o,"createConnection");vx.createConnection=x6o;function w6o(t,e,r,n){let o=!1;if(!t&&!e&&process.argv.length>2){let u,d,f=process.argv.slice(2);for(let h=0;h{qWe(),process.exit(Uce?0:1)}),u.on("close",()=>{qWe(),process.exit(Uce?0:1)})}let l=a(u=>{let d=(0,CY.createProtocolConnection)(t,e,u,r);return o&&R6o(u),d},"connectionFactory");return(0,S6o.createConnection)(l,I6o,n)}a(w6o,"_createConnection");function R6o(t){function e(n){return n.map(o=>typeof o=="string"?o:(0,y0n.inspect)(o)).join(" ")}a(e,"serialize");let r=new Map;console.assert=a(function(o,...s){if(!o)if(s.length===0)t.error("Assertion failed");else{let[c,...l]=s;t.error(`Assertion failed: ${c} ${e(l)}`)}},"assert"),console.count=a(function(o="default"){let s=String(o),c=r.get(s)??0;c+=1,r.set(s,c),t.log(`${s}: ${s}`)},"count"),console.countReset=a(function(o){o===void 0?r.clear():r.delete(String(o))},"countReset"),console.debug=a(function(...o){t.log(e(o))},"debug"),console.dir=a(function(o,s){t.log((0,y0n.inspect)(o,s))},"dir"),console.log=a(function(...o){t.log(e(o))},"log"),console.error=a(function(...o){t.error(e(o))},"error"),console.trace=a(function(...o){let s=new Error().stack.replace(/(.+\n){2}/,""),c="Trace";o.length!==0&&(c+=`: ${e(o)}`),t.log(`${c} +${s}`)},"trace"),console.warn=a(function(...o){t.warn(e(o))},"warn")}a(R6o,"patchConsole")});var fk=I((eNu,b0n)=>{"use strict";p();b0n.exports=Al()});var tmn=I(($Mu,emn)=>{"use strict";p();emn.exports=a(function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var r=Error.prepareStackTrace;Error.prepareStackTrace=function(o,s){return s};var n=new Error().stack;if(Error.prepareStackTrace=r,n!==null&&typeof n=="object")return n[e]?n[e].getFileName():void 0},"getCallerFile")});var Xmn=I(W0=>{"use strict";p();var MUt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"a"),R9o=MUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=a(async(l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s(await(0,r.stat)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"q");t.isexe=n;var o=a((l,u={})=>{let{ignoreErrors:d=!1}=u;try{return s((0,e.statSync)(l),u)}catch(f){let h=f;if(d||h.code==="EACCES")return!1;throw h}},"m");t.sync=o;var s=a((l,u)=>l.isFile()&&c(l,u),"d"),c=a((l,u)=>{let d=u.uid??process.getuid?.(),f=u.groups??process.getgroups?.()??[],h=u.gid??process.getgid?.()??f[0];if(d===void 0||h===void 0)throw new Error("cannot get uid or gid");let m=new Set([h,...f]),g=l.mode,A=l.uid,y=l.gid,E=parseInt("100",8),_=parseInt("010",8),v=parseInt("001",8),b=E|_;return!!(g&v||g&_&&m.has(y)||g&E&&A===d||g&b&&d===0)},"A")}),P9o=MUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=void 0;var e=require("node:fs"),r=require("node:fs/promises"),n=require("node:path"),o=a(async(u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l(await(0,r.stat)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"F");t.isexe=o;var s=a((u,d={})=>{let{ignoreErrors:f=!1}=d;try{return l((0,e.statSync)(u),u,d)}catch(h){let m=h;if(f||m.code==="EACCES")return!1;throw m}},"L");t.sync=s;var c=a((u,d)=>{let{pathExt:f=process.env.PATHEXT||""}=d,h=f.split(n.delimiter);if(h.indexOf("")!==-1)return!0;for(let m of h){let g=m.toLowerCase(),A=u.substring(u.length-g.length).toLowerCase();if(g&&A===g)return!0}return!1},"B"),l=a((u,d,f)=>u.isFile()&&c(d,f),"y")}),k9o=MUt(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})}),zmn=W0&&W0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D9o=W0&&W0.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Ymn=W0&&W0.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"t");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{p();var{isexe:O9o,sync:B9o}=Xmn(),{join:L9o,delimiter:F9o,sep:egn,posix:tgn}=require("path"),rgn=process.platform==="win32",ngn=new RegExp(`[${tgn.sep}${egn===tgn.sep?"":egn}]`.replace(/(\\)/g,"\\$1")),U9o=new RegExp(`^\\.${ngn.source}`),ign=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),ogn=a((t,{path:e=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:n=F9o})=>{let o=t.match(ngn)?[""]:[...rgn?[process.cwd()]:[],...(e||"").split(n)];if(rgn){let s=r||[".EXE",".CMD",".BAT",".COM"].join(n),c=s.split(n).flatMap(l=>[l,l.toLowerCase()]);return t.includes(".")&&c[0]!==""&&c.unshift(""),{pathEnv:o,pathExt:c,pathExtExe:s}}return{pathEnv:o,pathExt:[""]}},"getPathInfo"),sgn=a((t,e)=>{let r=/^".*"$/.test(t)?t.slice(1,-1):t;return(!r&&U9o.test(e)?e.slice(0,2):"")+L9o(r,e)},"getPathPart"),agn=a(async(t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=ogn(t,e),s=[];for(let c of r){let l=sgn(c,t);for(let u of n){let d=l+u;if(await O9o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw ign(t)},"which"),Q9o=a((t,e={})=>{let{pathEnv:r,pathExt:n,pathExtExe:o}=ogn(t,e),s=[];for(let c of r){let l=sgn(c,t);for(let u of n){let d=l+u;if(B9o(d,{pathExt:o,ignoreErrors:!0})){if(!e.all)return d;s.push(d)}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw ign(t)},"whichSync");cgn.exports=agn;agn.sync=Q9o});var GTe=I((SFu,bAn)=>{"use strict";p();var EAn="[^\\\\/]",b7o="(?=.)",_An="[^/]",XUt="(?:\\/|$)",vAn="(?:^|\\/)",e7t=`\\.{1,2}${XUt}`,S7o="(?!\\.)",T7o=`(?!${vAn}${e7t})`,I7o=`(?!\\.{0,1}${XUt})`,x7o=`(?!${e7t})`,w7o="[^.\\/]",R7o=`${_An}*?`,P7o="/",CAn={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:b7o,QMARK:_An,END_ANCHOR:XUt,DOTS_SLASH:e7t,NO_DOT:S7o,NO_DOTS:T7o,NO_DOT_SLASH:I7o,NO_DOTS_SLASH:x7o,QMARK_NO_DOT:w7o,STAR:R7o,START_ANCHOR:vAn,SEP:P7o},k7o={...CAn,SLASH_LITERAL:"[\\\\/]",QMARK:EAn,STAR:`${EAn}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},D7o={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};bAn.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:D7o,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?k7o:CAn}}});var $Te=I(IC=>{"use strict";p();var{REGEX_BACKSLASH:N7o,REGEX_REMOVE_BACKSLASH:M7o,REGEX_SPECIAL_CHARS:O7o,REGEX_SPECIAL_CHARS_GLOBAL:B7o}=GTe();IC.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);IC.hasRegexChars=t=>O7o.test(t);IC.isRegexChar=t=>t.length===1&&IC.hasRegexChars(t);IC.escapeRegex=t=>t.replace(B7o,"\\$1");IC.toPosixSlashes=t=>t.replace(N7o,"/");IC.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};IC.removeBackslashes=t=>t.replace(M7o,e=>e==="\\"?"":e);IC.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?IC.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};IC.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};IC.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};IC.basename=(t,{windows:e}={})=>{let r=t.split(e?/[\\/]/:"/"),n=r[r.length-1];return n===""?r[r.length-2]:n}});var kAn=I((wFu,PAn)=>{"use strict";p();var SAn=$Te(),{CHAR_ASTERISK:t7t,CHAR_AT:L7o,CHAR_BACKWARD_SLASH:VTe,CHAR_COMMA:F7o,CHAR_DOT:r7t,CHAR_EXCLAMATION_MARK:n7t,CHAR_FORWARD_SLASH:RAn,CHAR_LEFT_CURLY_BRACE:i7t,CHAR_LEFT_PARENTHESES:o7t,CHAR_LEFT_SQUARE_BRACKET:U7o,CHAR_PLUS:Q7o,CHAR_QUESTION_MARK:TAn,CHAR_RIGHT_CURLY_BRACE:q7o,CHAR_RIGHT_PARENTHESES:IAn,CHAR_RIGHT_SQUARE_BRACKET:j7o}=GTe(),xAn=a(t=>t===RAn||t===VTe,"isPathSeparator"),wAn=a(t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},"depth"),H7o=a((t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,s=[],c=[],l=[],u=t,d=-1,f=0,h=0,m=!1,g=!1,A=!1,y=!1,E=!1,_=!1,v=!1,b=!1,T=!1,w=!1,R=0,x,P,D={value:"",depth:0,isGlob:!1},N=a(()=>d>=n,"eos"),B=a(()=>u.charCodeAt(d+1),"peek"),L=a(()=>(x=P,u.charCodeAt(++d)),"advance");for(;d0&&(M=u.slice(0,f),u=u.slice(f),h-=f),j&&A===!0&&h>0?(j=u.slice(0,h),O=u.slice(h)):A===!0?(j="",O=u):j=u,j&&j!==""&&j!=="/"&&j!==u&&xAn(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),r.unescape===!0&&(O&&(O=SAn.removeBackslashes(O)),j&&v===!0&&(j=SAn.removeBackslashes(j)));let q={prefix:M,input:t,start:f,base:j,glob:O,isBrace:m,isBracket:g,isGlob:A,isExtglob:y,isGlobstar:E,negated:b,negatedExtglob:T};if(r.tokens===!0&&(q.maxDepth=0,xAn(P)||c.push(D),q.tokens=c),r.parts===!0||r.tokens===!0){let Q;for(let U=0;U{"use strict";p();var WTe=GTe(),bS=$Te(),{MAX_LENGTH:Dze,POSIX_REGEX_SOURCE:G7o,REGEX_NON_SPECIAL_CHARS:$7o,REGEX_SPECIAL_CHARS_BACKREF:V7o,REPLACEMENTS:DAn}=WTe,W7o=a((t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>bS.escapeRegex(o)).join("..")}return r},"expandRange"),Zce=a((t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,"syntaxError"),NAn=a(t=>{let e=[],r=0,n=0,o=0,s="",c=!1;for(let l of t){if(c===!0){s+=l,c=!1;continue}if(l==="\\"){s+=l,c=!0;continue}if(l==='"'){o=o===1?0:1,s+=l;continue}if(o===0){if(l==="[")r++;else if(l==="]"&&r>0)r--;else if(r===0){if(l==="(")n++;else if(l===")"&&n>0)n--;else if(l==="|"&&n===0){e.push(s),s="";continue}}}s+=l}return e.push(s),e},"splitTopLevel"),z7o=a(t=>{let e=!1;for(let r of t){if(e===!0){e=!1;continue}if(r==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},"isPlainBranch"),MAn=a(t=>{let e=t.trim(),r=!0;for(;r===!0;)r=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),r=!0);if(z7o(e))return e.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),Y7o=a(t=>{let e=t.map(MAn).filter(Boolean);for(let r=0;r{if(t[0]!=="+"&&t[0]!=="*"||t[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let c=1;c0){r--;continue}if(!(r>0)){if(l==="("){n++;continue}if(l===")"&&(n--,n===0))return e===!0&&c!==t.length-1?void 0:{type:t[0],body:t.slice(2,c),end:c}}}}},"parseRepeatedExtglob"),K7o=a(t=>{let e=0,r=[];for(;el.trim());if(s.length!==1)return;let c=MAn(s[0]);if(!c||c.length!==1)return;r.push(c),e+=o.end+1}return r.length<1?void 0:`${r.length===1?bS.escapeRegex(r[0]):`[${r.map(o=>bS.escapeRegex(o)).join("")}]`}*`},"getStarExtglobSequenceOutput"),J7o=a(t=>{let e=0,r=t.trim(),n=s7t(r);for(;n;)e++,r=n.body.trim(),n=s7t(r);return e},"repeatedExtglobRecursion"),Z7o=a((t,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let r=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:WTe.DEFAULT_MAX_EXTGLOB_RECURSION,n=NAn(t).map(o=>o.trim());if(n.length>1&&(n.some(o=>o==="")||n.some(o=>/^[*?]+$/.test(o))||Y7o(n)))return{risky:!0};for(let o of n){let s=K7o(o);if(s)return{risky:!0,safeOutput:s};if(J7o(o)>r)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),a7t=a((t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=DAn[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},c=[s],l=r.capture?"":"?:",u=WTe.globChars(r.windows),d=WTe.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:m,ONE_CHAR:g,DOTS_SLASH:A,NO_DOT:y,NO_DOT_SLASH:E,NO_DOTS_SLASH:_,QMARK:v,QMARK_NO_DOT:b,STAR:T,START_ANCHOR:w}=u,R=a(ve=>`(${l}(?:(?!${w}${ve.dot?A:f}).)*?)`,"globstar"),x=r.dot?"":y,P=r.dot?v:b,D=r.bash===!0?R(r):T;r.capture&&(D=`(${D})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:c};t=bS.removePrefix(t,N),o=t.length;let B=[],L=[],j=[],M=s,O,q=a(()=>N.index===o-1,"eos"),Q=N.peek=(ve=1)=>t[N.index+ve],U=N.advance=()=>t[++N.index]||"",z=a(()=>t.slice(N.index+1),"remaining"),W=a((ve="",Fe=0)=>{N.consumed+=ve,N.index+=Fe},"consume"),$=a(ve=>{N.output+=ve.output!=null?ve.output:ve.value,W(ve.value)},"append"),J=a(()=>{let ve=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)U(),N.start++,ve++;return ve%2===0?!1:(N.negated=!0,N.start++,!0)},"negate"),ne=a(ve=>{N[ve]++,j.push(ve)},"increment"),H=a(ve=>{N[ve]--,j.pop()},"decrement"),re=a(ve=>{if(M.type==="globstar"){let Fe=N.braces>0&&(ve.type==="comma"||ve.type==="brace"),Pe=ve.extglob===!0||B.length&&(ve.type==="pipe"||ve.type==="paren");ve.type!=="slash"&&ve.type!=="paren"&&!Fe&&!Pe&&(N.output=N.output.slice(0,-M.output.length),M.type="star",M.value="*",M.output=D,N.output+=M.output)}if(B.length&&ve.type!=="paren"&&(B[B.length-1].inner+=ve.value),(ve.value||ve.output)&&$(ve),M&&M.type==="text"&&ve.type==="text"){M.output=(M.output||M.value)+ve.value,M.value+=ve.value;return}ve.prev=M,c.push(ve),M=ve},"push"),ae=a((ve,Fe)=>{let Pe={...d[Fe],conditions:1,inner:""};Pe.prev=M,Pe.parens=N.parens,Pe.output=N.output,Pe.startIndex=N.index,Pe.tokensIndex=c.length;let Z=(r.capture?"(":"")+Pe.open;ne("parens"),re({type:ve,value:Fe,output:N.output?"":g}),re({type:"paren",extglob:!0,value:U(),output:Z}),B.push(Pe)},"extglobOpen"),Oe=a(ve=>{let Fe=t.slice(ve.startIndex,N.index+1),Pe=t.slice(ve.startIndex+2,N.index),Z=Z7o(Pe,r);if((ve.type==="plus"||ve.type==="star")&&Z.risky){let pe=Z.safeOutput?(ve.output?"":g)+(r.capture?`(${Z.safeOutput})`:Z.safeOutput):void 0,X=c[ve.tokensIndex];X.type="text",X.value=Fe,X.output=pe||bS.escapeRegex(Fe);for(let ue=ve.tokensIndex+1;ue1&&ve.inner.includes("/")&&(pe=R(r)),(pe!==D||q()||/^\)+$/.test(z()))&&(ee=ve.close=`)$))${pe}`),ve.inner.includes("*")&&(K=z())&&/^\.[^\\/.]+$/.test(K)){let X=a7t(K,{...e,fastpaths:!1}).output;ee=ve.close=`)${X})${pe})`}ve.prev.type==="bos"&&(N.negatedExtglob=!0)}re({type:"paren",extglob:!0,value:O,output:ee}),H("parens")},"extglobClose");if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ve=!1,Fe=t.replace(V7o,(Pe,Z,ee,K,pe,X)=>K==="\\"?(ve=!0,Pe):K==="?"?Z?Z+K+(pe?v.repeat(pe.length):""):X===0?P+(pe?v.repeat(pe.length):""):v.repeat(ee.length):K==="."?f.repeat(ee.length):K==="*"?Z?Z+K+(pe?D:""):D:Z?Pe:`\\${Pe}`);return ve===!0&&(r.unescape===!0?Fe=Fe.replace(/\\/g,""):Fe=Fe.replace(/\\+/g,Pe=>Pe.length%2===0?"\\\\":Pe?"\\":"")),Fe===t&&r.contains===!0?(N.output=t,N):(N.output=bS.wrapOutput(Fe,N,e),N)}for(;!q();){if(O=U(),O==="\0")continue;if(O==="\\"){let Pe=Q();if(Pe==="/"&&r.bash!==!0||Pe==="."||Pe===";")continue;if(!Pe){O+="\\",re({type:"text",value:O});continue}let Z=/^\\+/.exec(z()),ee=0;if(Z&&Z[0].length>2&&(ee=Z[0].length,N.index+=ee,ee%2!==0&&(O+="\\")),r.unescape===!0?O=U():O+=U(),N.brackets===0){re({type:"text",value:O});continue}}if(N.brackets>0&&(O!=="]"||M.value==="["||M.value==="[^")){if(r.posix!==!1&&O===":"){let Pe=M.value.slice(1);if(Pe.includes("[")&&(M.posix=!0,Pe.includes(":"))){let Z=M.value.lastIndexOf("["),ee=M.value.slice(0,Z),K=M.value.slice(Z+2),pe=G7o[K];if(pe){M.value=ee+pe,N.backtrack=!0,U(),!s.output&&c.indexOf(M)===1&&(s.output=g);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(M.value==="["||M.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&M.value==="["&&(O="^"),M.value+=O,$({value:O});continue}if(N.quotes===1&&O!=='"'){O=bS.escapeRegex(O),M.value+=O,$({value:O});continue}if(O==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&re({type:"text",value:O});continue}if(O==="("){ne("parens"),re({type:"paren",value:O});continue}if(O===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Zce("opening","("));let Pe=B[B.length-1];if(Pe&&N.parens===Pe.parens+1){Oe(B.pop());continue}re({type:"paren",value:O,output:N.parens?")":"\\)"}),H("parens");continue}if(O==="["){if(r.nobracket===!0||!z().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Zce("closing","]"));O=`\\${O}`}else ne("brackets");re({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||M&&M.type==="bracket"&&M.value.length===1){re({type:"text",value:O,output:`\\${O}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Zce("opening","["));re({type:"text",value:O,output:`\\${O}`});continue}H("brackets");let Pe=M.value.slice(1);if(M.posix!==!0&&Pe[0]==="^"&&!Pe.includes("/")&&(O=`/${O}`),M.value+=O,$({value:O}),r.literalBrackets===!1||bS.hasRegexChars(Pe))continue;let Z=bS.escapeRegex(M.value);if(N.output=N.output.slice(0,-M.value.length),r.literalBrackets===!0){N.output+=Z,M.value=Z;continue}M.value=`(${l}${Z}|${M.value})`,N.output+=M.value;continue}if(O==="{"&&r.nobrace!==!0){ne("braces");let Pe={type:"brace",value:O,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};L.push(Pe),re(Pe);continue}if(O==="}"){let Pe=L[L.length-1];if(r.nobrace===!0||!Pe){re({type:"text",value:O,output:O});continue}let Z=")";if(Pe.dots===!0){let ee=c.slice(),K=[];for(let pe=ee.length-1;pe>=0&&(c.pop(),ee[pe].type!=="brace");pe--)ee[pe].type!=="dots"&&K.unshift(ee[pe].value);Z=W7o(K,r),N.backtrack=!0}if(Pe.comma!==!0&&Pe.dots!==!0){let ee=N.output.slice(0,Pe.outputIndex),K=N.tokens.slice(Pe.tokensIndex);Pe.value=Pe.output="\\{",O=Z="\\}",N.output=ee;for(let pe of K)N.output+=pe.output||pe.value}re({type:"brace",value:O,output:Z}),H("braces"),L.pop();continue}if(O==="|"){B.length>0&&B[B.length-1].conditions++,re({type:"text",value:O});continue}if(O===","){let Pe=O,Z=L[L.length-1];Z&&j[j.length-1]==="braces"&&(Z.comma=!0,Pe="|"),re({type:"comma",value:O,output:Pe});continue}if(O==="/"){if(M.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",c.pop(),M=s;continue}re({type:"slash",value:O,output:m});continue}if(O==="."){if(N.braces>0&&M.type==="dot"){M.value==="."&&(M.output=f);let Pe=L[L.length-1];M.type="dots",M.output+=O,M.value+=O,Pe.dots=!0;continue}if(N.braces+N.parens===0&&M.type!=="bos"&&M.type!=="slash"){re({type:"text",value:O,output:f});continue}re({type:"dot",value:O,output:f});continue}if(O==="?"){if(!(M&&M.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ae("qmark",O);continue}if(M&&M.type==="paren"){let Z=Q(),ee=O;(M.value==="("&&!/[!=<:]/.test(Z)||Z==="<"&&!/<([!=]|\w+>)/.test(z()))&&(ee=`\\${O}`),re({type:"text",value:O,output:ee});continue}if(r.dot!==!0&&(M.type==="slash"||M.type==="bos")){re({type:"qmark",value:O,output:b});continue}re({type:"qmark",value:O,output:v});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){ae("negate",O);continue}if(r.nonegate!==!0&&N.index===0){J();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ae("plus",O);continue}if(M&&M.value==="("||r.regex===!1){re({type:"plus",value:O,output:h});continue}if(M&&(M.type==="bracket"||M.type==="paren"||M.type==="brace")||N.parens>0){re({type:"plus",value:O});continue}re({type:"plus",value:h});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){re({type:"at",extglob:!0,value:O,output:""});continue}re({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let Pe=$7o.exec(z());Pe&&(O+=Pe[0],N.index+=Pe[0].length),re({type:"text",value:O});continue}if(M&&(M.type==="globstar"||M.star===!0)){M.type="star",M.star=!0,M.value+=O,M.output=D,N.backtrack=!0,N.globstar=!0,W(O);continue}let ve=z();if(r.noextglob!==!0&&/^\([^?]/.test(ve)){ae("star",O);continue}if(M.type==="star"){if(r.noglobstar===!0){W(O);continue}let Pe=M.prev,Z=Pe.prev,ee=Pe.type==="slash"||Pe.type==="bos",K=Z&&(Z.type==="star"||Z.type==="globstar");if(r.bash===!0&&(!ee||ve[0]&&ve[0]!=="/")){re({type:"star",value:O,output:""});continue}let pe=N.braces>0&&(Pe.type==="comma"||Pe.type==="brace"),X=B.length&&(Pe.type==="pipe"||Pe.type==="paren");if(!ee&&Pe.type!=="paren"&&!pe&&!X){re({type:"star",value:O,output:""});continue}for(;ve.slice(0,3)==="/**";){let ue=t[N.index+4];if(ue&&ue!=="/")break;ve=ve.slice(3),W("/**",3)}if(Pe.type==="bos"&&q()){M.type="globstar",M.value+=O,M.output=R(r),N.output=M.output,N.globstar=!0,W(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&!K&&q()){N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=R(r)+(r.strictSlashes?")":"|$)"),M.value+=O,N.globstar=!0,N.output+=Pe.output+M.output,W(O);continue}if(Pe.type==="slash"&&Pe.prev.type!=="bos"&&ve[0]==="/"){let ue=ve[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(Pe.output+M.output).length),Pe.output=`(?:${Pe.output}`,M.type="globstar",M.output=`${R(r)}${m}|${m}${ue})`,M.value+=O,N.output+=Pe.output+M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}if(Pe.type==="bos"&&ve[0]==="/"){M.type="globstar",M.value+=O,M.output=`(?:^|${m}|${R(r)}${m})`,N.output=M.output,N.globstar=!0,W(O+U()),re({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-M.output.length),M.type="globstar",M.output=R(r),M.value+=O,N.output+=M.output,N.globstar=!0,W(O);continue}let Fe={type:"star",value:O,output:D};if(r.bash===!0){Fe.output=".*?",(M.type==="bos"||M.type==="slash")&&(Fe.output=x+Fe.output),re(Fe);continue}if(M&&(M.type==="bracket"||M.type==="paren")&&r.regex===!0){Fe.output=O,re(Fe);continue}(N.index===N.start||M.type==="slash"||M.type==="dot")&&(M.type==="dot"?(N.output+=E,M.output+=E):r.dot===!0?(N.output+=_,M.output+=_):(N.output+=x,M.output+=x),Q()!=="*"&&(N.output+=g,M.output+=g)),re(Fe)}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zce("closing","]"));N.output=bS.escapeLast(N.output,"["),H("brackets")}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zce("closing",")"));N.output=bS.escapeLast(N.output,"("),H("parens")}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Zce("closing","}"));N.output=bS.escapeLast(N.output,"{"),H("braces")}if(r.strictSlashes!==!0&&(M.type==="star"||M.type==="bracket")&&re({type:"maybe_slash",value:"",output:`${m}?`}),N.backtrack===!0){N.output="";for(let ve of N.tokens)N.output+=ve.output!=null?ve.output:ve.value,ve.suffix&&(N.output+=ve.suffix)}return N},"parse");a7t.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Dze,r.maxLength):Dze,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=DAn[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,DOTS_SLASH:u,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:m,START_ANCHOR:g}=WTe.globChars(r.windows),A=r.dot?f:d,y=r.dot?h:d,E=r.capture?"":"?:",_={negated:!1,prefix:""},v=r.bash===!0?".*?":m;r.capture&&(v=`(${v})`);let b=a(x=>x.noglobstar===!0?v:`(${E}(?:(?!${g}${x.dot?u:s}).)*?)`,"globstar"),T=a(x=>{switch(x){case"*":return`${A}${l}${v}`;case".*":return`${s}${l}${v}`;case"*.*":return`${A}${v}${s}${l}${v}`;case"*/*":return`${A}${v}${c}${l}${y}${v}`;case"**":return A+b(r);case"**/*":return`(?:${A}${b(r)}${c})?${y}${l}${v}`;case"**/*.*":return`(?:${A}${b(r)}${c})?${y}${v}${s}${l}${v}`;case"**/.*":return`(?:${A}${b(r)}${c})?${s}${l}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(x);if(!P)return;let D=T(P[1]);return D?D+s+P[2]:void 0}}},"create"),w=bS.removePrefix(t,_),R=T(w);return R&&r.strictSlashes!==!0&&(R+=`${c}?`),R};OAn.exports=a7t});var UAn=I((MFu,FAn)=>{"use strict";p();var X7o=kAn(),c7t=BAn(),LAn=$Te(),eQo=GTe(),tQo=a(t=>t&&typeof t=="object"&&!Array.isArray(t),"isObject"),Hp=a((t,e,r=!1)=>{if(Array.isArray(t)){let f=t.map(m=>Hp(m,e,r));return a(m=>{for(let g of f){let A=g(m);if(A)return A}return!1},"arrayMatcher")}let n=tQo(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,c=n?Hp.compileRe(t,e):Hp.makeRe(t,e,!1,!0),l=c.state;delete c.state;let u=a(()=>!1,"isIgnored");if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};u=Hp(o.ignore,f,r)}let d=a((f,h=!1)=>{let{isMatch:m,match:g,output:A}=Hp.test(f,c,e,{glob:t,posix:s}),y={glob:t,state:l,regex:c,posix:s,input:f,output:A,match:g,isMatch:m};return typeof o.onResult=="function"&&o.onResult(y),m===!1?(y.isMatch=!1,h?y:!1):u(f)?(typeof o.onIgnore=="function"&&o.onIgnore(y),y.isMatch=!1,h?y:!1):(typeof o.onMatch=="function"&&o.onMatch(y),h?y:!0)},"matcher");return r&&(d.state=l),d},"picomatch");Hp.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},c=s.format||(o?LAn.toPosixSlashes:null),l=t===n,u=l&&c?c(t):t;return l===!1&&(u=c?c(t):t,l=u===n),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=Hp.matchBase(t,e,r,o):l=e.exec(u)),{isMatch:!!l,match:l,output:u}};Hp.matchBase=(t,e,r)=>(e instanceof RegExp?e:Hp.makeRe(e,r)).test(LAn.basename(t));Hp.isMatch=(t,e,r)=>Hp(e,r)(t);Hp.parse=(t,e)=>Array.isArray(t)?t.map(r=>Hp.parse(r,e)):c7t(t,{...e,fastpaths:!1});Hp.scan=(t,e)=>X7o(t,e);Hp.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},s=o.contains?"":"^",c=o.contains?"":"$",l=`${s}(?:${t.output})${c}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let u=Hp.toRegex(l,e);return n===!0&&(u.state=t),u};Hp.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=c7t.fastpaths(t,e)),o.output||(o=c7t(t,e)),Hp.compileRe(o,e,r,n)};Hp.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Hp.constants=eQo;FAn.exports=Hp});var HAn=I((LFu,jAn)=>{"use strict";p();var QAn=UAn(),rQo=$Te();function qAn(t,e,r=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:rQo.isWindows()}),QAn(t,e,r)}a(qAn,"picomatch");Object.assign(qAn,QAn);jAn.exports=qAn});var $An=I((QFu,GAn)=>{p();GAn.exports=a(function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1},"isExtglob")});var zAn=I((HFu,WAn)=>{p();var nQo=$An(),VAn={"{":"}","(":")","[":"]"},iQo=a(function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,o=-2,s=-2,c=-2;ee&&(c===-1||c>n||(c=t.indexOf("\\",e),c===-1||c>n)))||o!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(o=t.indexOf("}",e),o>e&&(c=t.indexOf("\\",e),c===-1||c>o))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(c=t.indexOf("\\",e),c===-1||c>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(c=t.indexOf("\\",r),c===-1||c>s))))return!0;if(t[e]==="\\"){var l=t[e+1];e+=2;var u=VAn[l];if(u){var d=t.indexOf(u,e);d!==-1&&(e=d+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),oQo=a(function(t){if(t[0]==="!")return!0;for(var e=0;e{p();var WY=require("path"),sQo=HAn(),aQo=zAn();function Nze(t,e={}){let{ignore:r,...n}=e;if(Array.isArray(r)){e={...n};for(let o of r)if(aQo(o)){e.ignoreGlobs||(e.ignoreGlobs=[]);let s=sQo.makeRe(o,{dot:!0,windows:process.platform==="win32"});e.ignoreGlobs.push(s.source)}else e.ignorePaths||(e.ignorePaths=[]),e.ignorePaths.push(WY.resolve(t,o))}return e}a(Nze,"normalizeOptions");YAn.createWrapper=t=>({writeSnapshot(e,r,n){return t.writeSnapshot(WY.resolve(e),WY.resolve(r),Nze(e,n))},getEventsSince(e,r,n){return t.getEventsSince(WY.resolve(e),WY.resolve(r),Nze(e,n))},async subscribe(e,r,n){return e=WY.resolve(e),n=Nze(e,n),await t.subscribe(e,r,n),{unsubscribe(){return t.unsubscribe(e,r,n)}}},unsubscribe(e,r,n){return t.unsubscribe(WY.resolve(e),r,Nze(e,n))}})});var JAn=I(zTe=>{"use strict";p();var cQo=require("path"),{createWrapper:lQo}=KAn();function uQo(){return cQo.join(__dirname,"compiled",process.platform,process.arch,"watcher.node")}a(uQo,"resolveBindingPath");var dQo=require(uQo()),Mze=lQo(dQo);zTe.writeSnapshot=Mze.writeSnapshot;zTe.getEventsSince=Mze.getEventsSince;zTe.subscribe=Mze.subscribe;zTe.unsubscribe=Mze.unsubscribe});var T_=I(Qze=>{"use strict";p();Object.defineProperty(Qze,"__esModule",{value:!0});Qze.Position=void 0;var f7t=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+r))}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumber{"use strict";p();Object.defineProperty(qze,"__esModule",{value:!0});qze.Range=void 0;var ayn=T_(),p7t=class t{static{a(this,"Range")}constructor(e,r,n,o){e>n||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new ayn.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new ayn.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};qze.Range=p7t});var mvn=I((TXu,TIe)=>{"use strict";p();var SKe=a(function(){},"NullObject");SKe.prototype=Object.create(null);var CKe=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,bKe=/\\([\v\u0020-\u00ff])/gu,fvn=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,lK={type:"",parameters:new SKe};Object.freeze(lK.parameters);Object.freeze(lK);function pvn(t){if(typeof t!="string")throw new TypeError("argument header is required and must be a string");let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(fvn.test(r)===!1)throw new TypeError("invalid media type");let n={type:r.toLowerCase(),parameters:new SKe};if(e===-1)return n;let o,s,c;for(CKe.lastIndex=e;s=CKe.exec(t);){if(s.index!==e)throw new TypeError("invalid parameter format");e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),bKe.test(c)&&(c=c.replace(bKe,"$1"))),n.parameters[o]=c}if(e!==t.length)throw new TypeError("invalid parameter format");return n}a(pvn,"parse");function hvn(t){if(typeof t!="string")return lK;let e=t.indexOf(";"),r=e!==-1?t.slice(0,e).trim():t.trim();if(fvn.test(r)===!1)return lK;let n={type:r.toLowerCase(),parameters:new SKe};if(e===-1)return n;let o,s,c;for(CKe.lastIndex=e;s=CKe.exec(t);){if(s.index!==e)return lK;e+=s[0].length,o=s[1].toLowerCase(),c=s[2],c[0]==='"'&&(c=c.slice(1,c.length-1),bKe.test(c)&&(c=c.replace(bKe,"$1"))),n.parameters[o]=c}return e!==t.length?lK:n}a(hvn,"safeParse");TIe.exports.default={parse:pvn,safeParse:hvn};TIe.exports.parse=pvn;TIe.exports.safeParse=hvn;TIe.exports.defaultContentType=lK});var gCn=I(kS=>{"use strict";p();var VGo=kS&&kS.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kS,"__esModule",{value:!0});var WGo=require("fs"),zGo=VGo(GP()),xle=zGo.default("@kwsites/file-exists");function YGo(t,e,r){xle("checking %s",t);try{let n=WGo.statSync(t);return n.isFile()&&e?(xle("[OK] path represents a file"),!0):n.isDirectory()&&r?(xle("[OK] path represents a directory"),!0):(xle("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return xle("[FAIL] path is not accessible: %o",n),!1;throw xle("[FATAL] %o",n),n}}a(YGo,"check");function KGo(t,e=kS.READABLE){return YGo(t,(e&kS.FILE)>0,(e&kS.FOLDER)>0)}a(KGo,"exists");kS.exists=KGo;kS.FILE=1;kS.FOLDER=2;kS.READABLE=kS.FILE+kS.FOLDER});var ACn=I(XKe=>{"use strict";p();function JGo(t){for(var e in t)XKe.hasOwnProperty(e)||(XKe[e]=t[e])}a(JGo,"__export");Object.defineProperty(XKe,"__esModule",{value:!0});JGo(gCn())});var ECn=I((dcd,yCn)=>{p();var Ple=1e3,kle=Ple*60,Dle=kle*60,pK=Dle*24,ZGo=pK*7,XGo=pK*365.25;yCn.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return e$o(t);if(r==="number"&&isFinite(t))return e.long?r$o(t):t$o(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function e$o(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*XGo;case"weeks":case"week":case"w":return r*ZGo;case"days":case"day":case"d":return r*pK;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Dle;case"minutes":case"minute":case"mins":case"min":case"m":return r*kle;case"seconds":case"second":case"secs":case"sec":case"s":return r*Ple;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(e$o,"parse");function t$o(t){var e=Math.abs(t);return e>=pK?Math.round(t/pK)+"d":e>=Dle?Math.round(t/Dle)+"h":e>=kle?Math.round(t/kle)+"m":e>=Ple?Math.round(t/Ple)+"s":t+"ms"}a(t$o,"fmtShort");function r$o(t){var e=Math.abs(t);return e>=pK?eJe(t,e,pK,"day"):e>=Dle?eJe(t,e,Dle,"hour"):e>=kle?eJe(t,e,kle,"minute"):e>=Ple?eJe(t,e,Ple,"second"):t+" ms"}a(r$o,"fmtLong");function eJe(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(eJe,"plural")});var Fqt=I((hcd,_Cn)=>{p();function n$o(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=ECn(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(n$o,"setup");_Cn.exports=n$o});var vCn=I((DS,tJe)=>{p();DS.formatArgs=o$o;DS.save=s$o;DS.load=a$o;DS.useColors=i$o;DS.storage=c$o();DS.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();DS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function i$o(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(i$o,"useColors");function o$o(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+tJe.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(o$o,"formatArgs");DS.log=console.debug||console.log||(()=>{});function s$o(t){try{t?DS.storage.setItem("debug",t):DS.storage.removeItem("debug")}catch{}}a(s$o,"save");function a$o(){let t;try{t=DS.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(a$o,"load");function c$o(){try{return localStorage}catch{}}a(c$o,"localstorage");tJe.exports=Fqt()(DS);var{formatters:l$o}=tJe.exports;l$o.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var bCn=I((og,nJe)=>{p();var u$o=require("tty"),rJe=require("util");og.init=A$o;og.log=h$o;og.formatArgs=f$o;og.save=m$o;og.load=g$o;og.useColors=d$o;og.destroy=rJe.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");og.colors=[6,2,3,4,5,1];try{let t=Vje();t&&(t.stderr||t).level>=2&&(og.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}og.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function d$o(){return"colors"in og.inspectOpts?!!og.inspectOpts.colors:u$o.isatty(process.stderr.fd)}a(d$o,"useColors");function f$o(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+aJe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=cVo()+e+" "+t[0]}a(aVo,"formatArgs");function cVo(){return sg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(cVo,"getDate");function lVo(...t){return process.stderr.write(sJe.formatWithOptions(sg.inspectOpts,...t)+` -`)}a(lVo,"log");function uVo(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(uVo,"save");function dVo(){return process.env.DEBUG}a(dVo,"load");function fVo(t){t.inspectOpts={};let e=Object.keys(sg.inspectOpts);for(let r=0;re.trim()).join(" ")};lvn.O=function(t){return this.inspectOpts.colors=this.useColors,sJe.inspect(t,this.inspectOpts)}});var dvn=I((pud,wqt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?wqt.exports=cvn():wqt.exports=uvn()});var kqt=I(_K=>{"use strict";p();Object.defineProperty(_K,"__esModule",{value:!0});_K.createDeferred=_K.deferred=void 0;function Rqt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(Rqt,"deferred");_K.deferred=Rqt;_K.createDeferred=Rqt;_K.default=Rqt});var MJe=I(QS=>{"use strict";p();Object.defineProperty(QS,"__esModule",{value:!0});QS.deepClone=pSn;QS.deepFreeze=YYo;QS.cloneAndChange=KYo;QS.mixin=mSn;QS.equals=cxe;QS.safeStringify=JYo;QS.stableStringify=ZYo;QS.distinct=XYo;QS.getCaseInsensitive=eKo;QS.filter=tKo;QS.mapValues=rKo;var lq=BS();function pSn(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?pSn(n):n}),e}a(pSn,"deepClone");function YYo(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(hSn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,lq.isTypedArray)(o)&&e.push(o)}}return t}a(YYo,"deepFreeze");var hSn=Object.prototype.hasOwnProperty;function KYo(t,e){return kjt(t,e,new Set)}a(KYo,"cloneAndChange");function kjt(t,e,r){if((0,lq.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push(kjt(s,e,r));return o}if((0,lq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)hSn.call(t,s)&&(o[s]=kjt(t[s],e,r));return r.delete(t),o}return t}a(kjt,"_cloneAndChange");function mSn(t,e,r=!0){return(0,lq.isObject)(t)?((0,lq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,lq.isObject)(t[n])&&(0,lq.isObject)(e[n])?mSn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(mSn,"mixin");function cxe(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,lq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(JYo,"safeStringify");function ZYo(t){if(t===void 0)return"undefined";try{return Pjt(t,new WeakSet)}catch{return""}}a(ZYo,"stableStringify");function Pjt(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>Pjt(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+Pjt(s,e))}return"{"+n.join(",")+"}"}a(Pjt,"_stableStringify");function XYo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];cxe(s,c)||(r[o]=c)}),r}a(XYo,"distinct");function eKo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(eKo,"getCaseInsensitive");function tKo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(tKo,"filter");function rKo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(rKo,"mapValues")});var L_=I(OJe=>{"use strict";p();Object.defineProperty(OJe,"__esModule",{value:!0});OJe.ErrorUtils=void 0;var nKo=MJe(),gSn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,nKo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(gSn||(OJe.ErrorUtils=gSn={}))});var Gx=I(BJe=>{"use strict";p();Object.defineProperty(BJe,"__esModule",{value:!0});BJe.Result=void 0;var Djt=L_(),ASn;(function(t){function e(c){return new Njt(c)}a(e,"ok"),t.ok=e;function r(c){return new Mjt(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(Djt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(Djt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(ASn||(BJe.Result=ASn={}));var Njt=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},Mjt=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:Djt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Od=I((Q$d,wRn)=>{p();wRn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var mc=I((j$d,XRn)=>{"use strict";p();var RRn=Symbol.for("undici.error.UND_ERR"),Bd=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[RRn]===!0}[RRn]=!0},kRn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),NKt=class extends Bd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[kRn]===!0}[kRn]=!0},PRn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),MKt=class extends Bd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[PRn]===!0}[PRn]=!0},DRn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),OKt=class extends Bd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[DRn]===!0}[DRn]=!0},NRn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),BKt=class extends Bd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[NRn]===!0}[NRn]=!0},MRn=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),LKt=class extends Bd{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[MRn]===!0}[MRn]=!0},ORn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),FKt=class extends Bd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[ORn]===!0}[ORn]=!0},BRn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),UKt=class extends Bd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[BRn]===!0}[BRn]=!0},LRn=Symbol.for("undici.error.UND_ERR_ABORT"),vtt=class extends Bd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[LRn]===!0}[LRn]=!0},FRn=Symbol.for("undici.error.UND_ERR_ABORTED"),QKt=class extends vtt{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[FRn]===!0}[FRn]=!0},URn=Symbol.for("undici.error.UND_ERR_INFO"),qKt=class extends Bd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[URn]===!0}[URn]=!0},QRn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),jKt=class extends Bd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[QRn]===!0}[QRn]=!0},qRn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),HKt=class extends Bd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[qRn]===!0}[qRn]=!0},jRn=Symbol.for("undici.error.UND_ERR_DESTROYED"),GKt=class extends Bd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[jRn]===!0}[jRn]=!0},HRn=Symbol.for("undici.error.UND_ERR_CLOSED"),$Kt=class extends Bd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[HRn]===!0}[HRn]=!0},GRn=Symbol.for("undici.error.UND_ERR_SOCKET"),VKt=class extends Bd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[GRn]===!0}[GRn]=!0},$Rn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),WKt=class extends Bd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[$Rn]===!0}[$Rn]=!0},VRn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),zKt=class extends Bd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[VRn]===!0}[VRn]=!0},WRn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),YKt=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[WRn]===!0}[WRn]=!0},zRn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),KKt=class extends Bd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[zRn]===!0}[zRn]=!0},YRn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),JKt=class extends Bd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[YRn]===!0}[YRn]=!0},KRn=Symbol.for("undici.error.UND_ERR_RESPONSE"),ZKt=class extends Bd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[KRn]===!0}[KRn]=!0},JRn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),XKt=class extends Bd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[JRn]===!0}[JRn]=!0},ZRn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),eJt=class extends Bd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[ZRn]===!0}get[ZRn](){return!0}};XRn.exports={AbortError:vtt,HTTPParserError:YKt,UndiciError:Bd,HeadersTimeoutError:MKt,HeadersOverflowError:OKt,BodyTimeoutError:BKt,RequestContentLengthMismatchError:jKt,ConnectTimeoutError:NKt,ResponseStatusCodeError:LKt,InvalidArgumentError:FKt,InvalidReturnValueError:UKt,RequestAbortedError:QKt,ClientDestroyedError:GKt,ClientClosedError:$Kt,InformationalError:qKt,SocketError:VKt,NotSupportedError:WKt,ResponseContentLengthMismatchError:HKt,BalancedPoolMissingUpstreamError:zKt,ResponseExceededMaxSizeError:KKt,RequestRetryError:JKt,ResponseError:ZKt,SecureProxyConnectionError:XKt,MessageSizeExceededError:eJt}});var Stt=I(($$d,ekn)=>{"use strict";p();var btt={},tJt=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:tkn,headerNameLowerCasedRecord:qss}=Stt(),rJt=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var Pwe=require("node:assert"),{kDestroyed:skn,kBodyUsed:que,kListeners:nJt,kBody:okn}=Od(),{IncomingMessage:jss}=require("node:http"),wtt=require("node:stream"),Hss=require("node:net"),{Blob:Gss}=require("node:buffer"),$ss=require("node:util"),{stringify:Vss}=require("node:querystring"),{EventEmitter:Wss}=require("node:events"),{InvalidArgumentError:fg}=mc(),{headerNameLowerCasedRecord:zss}=Stt(),{tree:akn}=ikn(),[Yss,Kss]=process.versions.node.split(".").map(t=>Number(t)),xtt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[okn]=e,this[que]=!1}async*[Symbol.asyncIterator](){Pwe(!this[que],"disturbed"),this[que]=!0,yield*this[okn]}};function Jss(t){return Rtt(t)?(fkn(t)===0&&t.on("data",function(){Pwe(!1)}),typeof t.readableDidRead!="boolean"&&(t[que]=!1,Wss.prototype.on.call(t,"data",function(){this[que]=!0})),t):t&&typeof t.pipeTo=="function"?new xtt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&dkn(t)?new xtt(t):t}a(Jss,"wrapRequestBody");function Zss(){}a(Zss,"nop");function Rtt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(Rtt,"isStream");function ckn(t){if(t===null)return!1;if(t instanceof Gss)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(ckn,"isBlobLike");function Xss(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Vss(e);return r&&(t+="?"+r),t}a(Xss,"buildURL");function lkn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(lkn,"isValidPort");function Itt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(Itt,"isHttpOrHttpsPrefixed");function ukn(t){if(typeof t=="string"){if(t=new URL(t),!Itt(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new fg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&lkn(t.port)===!1)throw new fg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new fg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new fg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new fg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new fg("Invalid URL origin: the origin must be a string or null/undefined.");if(!Itt(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!Itt(t.origin||t.protocol))throw new fg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(ukn,"parseURL");function eas(t){if(t=ukn(t),t.pathname!=="/"||t.search||t.hash)throw new fg("invalid url");return t}a(eas,"parseOrigin");function tas(t){if(t[0]==="["){let r=t.indexOf("]");return Pwe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(tas,"getHostname");function ras(t){if(!t)return null;Pwe(typeof t=="string");let e=tas(t);return Hss.isIP(e)?"":e}a(ras,"getServerName");function nas(t){return JSON.parse(JSON.stringify(t))}a(nas,"deepClone");function ias(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(ias,"isAsyncIterable");function dkn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(dkn,"isIterable");function fkn(t){if(t==null)return 0;if(Rtt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(ckn(t))return t.size!=null?t.size:null;if(mkn(t))return t.byteLength}return null}a(fkn,"bodyLength");function pkn(t){return t&&!!(t.destroyed||t[skn]||wtt.isDestroyed?.(t))}a(pkn,"isDestroyed");function oas(t,e){t==null||!Rtt(t)||pkn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===jss&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[skn]=!0))}a(oas,"destroy");var sas=/timeout=(\d+)/;function aas(t){let e=t.toString().match(sas);return e?parseInt(e[1],10)*1e3:null}a(aas,"parseKeepAliveTimeout");function hkn(t){return typeof t=="string"?zss[t]??t.toLowerCase():akn.lookup(t)??t.toString("latin1").toLowerCase()}a(hkn,"headerNameToString");function cas(t){return akn.lookup(t)??t.toString("latin1").toLowerCase()}a(cas,"bufferToLowerCasedHeaderName");function las(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(las,"parseHeaders");function uas(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(gas,"ReadableStreamFrom");function Aas(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(Aas,"isFormDataLike");function yas(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(yas,"addAbortListener");var Eas=typeof String.prototype.toWellFormed=="function",_as=typeof String.prototype.isWellFormed=="function";function gkn(t){return Eas?`${t}`.toWellFormed():$ss.toUSVString(t)}a(gkn,"toUSVString");function Cas(t){return _as?`${t}`.isWellFormed():gkn(t)===`${t}`}a(Cas,"isUSVString");function Akn(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(Akn,"isTokenCharCode");function vas(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Fc=require("node:diagnostics_channel"),sJt=require("node:util"),ktt=sJt.debuglog("undici"),oJt=sJt.debuglog("fetch"),nJ=sJt.debuglog("websocket"),Ckn=!1,Ras={beforeConnect:Fc.channel("undici:client:beforeConnect"),connected:Fc.channel("undici:client:connected"),connectError:Fc.channel("undici:client:connectError"),sendHeaders:Fc.channel("undici:client:sendHeaders"),create:Fc.channel("undici:request:create"),bodySent:Fc.channel("undici:request:bodySent"),headers:Fc.channel("undici:request:headers"),trailers:Fc.channel("undici:request:trailers"),error:Fc.channel("undici:request:error"),open:Fc.channel("undici:websocket:open"),close:Fc.channel("undici:websocket:close"),socketError:Fc.channel("undici:websocket:socket_error"),ping:Fc.channel("undici:websocket:ping"),pong:Fc.channel("undici:websocket:pong")};if(ktt.enabled||oJt.enabled){let t=oJt.enabled?oJt:ktt;Fc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Fc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Fc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),Fc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),Fc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),Fc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),Fc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),Ckn=!0}if(nJ.enabled){if(!Ckn){let t=ktt.enabled?ktt:nJ;Fc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Fc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Fc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),Fc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}Fc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;nJ("connection opened %s%s",e,r?`:${r}`:"")}),Fc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;nJ("closed connection to %s - %s %s",e.url,r,n)}),Fc.channel("undici:websocket:socket_error").subscribe(t=>{nJ("connection errored - %s",t.message)}),Fc.channel("undici:websocket:ping").subscribe(t=>{nJ("ping received")}),Fc.channel("undici:websocket:pong").subscribe(t=>{nJ("pong received")})}vkn.exports={channels:Ras}});var Ikn=I((tVd,Tkn)=>{"use strict";p();var{InvalidArgumentError:Au,NotSupportedError:kas}=mc(),W3=require("node:assert"),{isValidHTTPToken:Skn,isValidHeaderValue:aJt,isStream:Pas,destroy:Das,isBuffer:Nas,isFormDataLike:Mas,isIterable:Oas,isBlobLike:Bas,buildURL:Las,validateHandler:Fas,getServerName:Uas,normalizedMethodRecords:Qas}=Ls(),{channels:kO}=jue(),{headerNameLowerCasedRecord:bkn}=Stt(),qas=/[^\u0021-\u00ff]/,Xx=Symbol("handler"),cJt=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},E){if(typeof r!="string")throw new Au("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Au("path must be an absolute URL or start with a slash");if(qas.test(r))throw new Au("invalid request path");if(typeof n!="string")throw new Au("method must be a string");if(Qas[n]===void 0&&!Skn(n))throw new Au("invalid request method");if(d&&typeof d!="string")throw new Au("upgrade must be a string");if(d&&!aJt(d))throw new Au("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Au("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Au("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Au("invalid reset");if(A!=null&&typeof A!="boolean")throw new Au("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(Pas(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){Das(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(Nas(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Mas(o)||Oas(o)||Bas(o))this.body=o;else throw new Au("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?Las(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new Au("headers array must be even");for(let _=0;_{"use strict";p();var jas=require("node:events"),Dtt=class extends jas{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new lJt(this,n)}},lJt=class extends Dtt{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};xkn.exports=Dtt});var Vue=I((aVd,wkn)=>{"use strict";p();var Has=Dwe(),{ClientDestroyedError:uJt,ClientClosedError:Gas,InvalidArgumentError:Hue}=mc(),{kDestroy:$as,kClose:Vas,kClosed:Nwe,kDestroyed:Gue,kDispatch:dJt,kInterceptors:iJ}=Od(),z3=Symbol("onDestroyed"),$ue=Symbol("onClosed"),Ntt=Symbol("Intercepted Dispatch"),fJt=class extends Has{static{a(this,"DispatcherBase")}constructor(){super(),this[Gue]=!1,this[z3]=null,this[Nwe]=!1,this[$ue]=[]}get destroyed(){return this[Gue]}get closed(){return this[Nwe]}get interceptors(){return this[iJ]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[iJ][r]!="function")throw new Hue("interceptor must be an function")}this[iJ]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new Hue("invalid callback");if(this[Gue]){queueMicrotask(()=>e(new uJt,null));return}if(this[Nwe]){this[$ue]?this[$ue].push(e):queueMicrotask(()=>e(null,null));return}this[Nwe]=!0,this[$ue].push(e);let r=a(()=>{let n=this[$ue];this[$ue]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new Hue("invalid callback");if(this[Gue]){this[z3]?this[z3].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new uJt),this[Gue]=!0,this[z3]=this[z3]||[],this[z3].push(r);let n=a(()=>{let o=this[z3];this[z3]=null;for(let s=0;s{queueMicrotask(n)})}[Ntt](e,r){if(!this[iJ]||this[iJ].length===0)return this[Ntt]=this[dJt],this[dJt](e,r);let n=this[dJt].bind(this);for(let o=this[iJ].length-1;o>=0;o--)n=this[iJ][o](n);return this[Ntt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Hue("handler must be an object");try{if(!e||typeof e!="object")throw new Hue("opts must be an object.");if(this[Gue]||this[z3])throw new uJt;if(this[Nwe])throw new Gas;return this[Ntt](e,r)}catch(n){if(typeof r.onError!="function")throw new Hue("invalid onError method");return r.onError(n),!1}}};wkn.exports=fJt});var EJt=I((uVd,Dkn)=>{"use strict";p();var Wue=0,pJt=1e3,hJt=(pJt>>1)-1,Y3,mJt=Symbol("kFastTimer"),K3=[],gJt=-2,AJt=-1,kkn=0,Rkn=1;function yJt(){Wue+=hJt;let t=0,e=K3.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=AJt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===AJt?(r._state=gJt,--e!==0&&(K3[t]=K3[e])):++t}K3.length=e,K3.length!==0&&Pkn()}a(yJt,"onTick");function Pkn(){Y3?Y3.refresh():(clearTimeout(Y3),Y3=setTimeout(yJt,hJt),Y3.unref&&Y3.unref())}a(Pkn,"refreshTimeout");var Mtt=class{static{a(this,"FastTimer")}[mJt]=!0;_state=gJt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===gJt&&K3.push(this),(!Y3||K3.length===1)&&Pkn(),this._state=kkn}clear(){this._state=AJt,this._idleStart=-1}};Dkn.exports={setTimeout(t,e,r){return e<=pJt?setTimeout(t,e,r):new Mtt(t,e,r)},clearTimeout(t){t[mJt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Mtt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Wue},tick(t=0){Wue+=t-pJt+1,yJt(),yJt()},reset(){Wue=0,K3.length=0,clearTimeout(Y3),Y3=null},kFastTimer:mJt}});var Mwe=I((mVd,Lkn)=>{"use strict";p();var Was=require("node:net"),Nkn=require("node:assert"),Bkn=Ls(),{InvalidArgumentError:zas,ConnectTimeoutError:Yas}=mc(),Ott=EJt();function Mkn(){}a(Mkn,"noop");var _Jt,CJt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?CJt=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function Kas({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new zas("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new CJt(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},E){let _;if(h==="https:"){_Jt||(_Jt=require("node:tls")),g=g||c.servername||Bkn.getServerName(f)||null;let b=g||d;Nkn(b);let T=o||l.get(b)||null;m=m||443,_=_Jt.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),_.on("session",function(w){l.set(b,w)})}else Nkn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Was.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=Jas(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(Kas,"buildConnector");var Jas=process.platform==="win32"?(t,e)=>{if(!e.timeout)return Mkn;let r=null,n=null,o=Ott.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>Okn(t.deref(),e))})},e.timeout);return()=>{Ott.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return Mkn;let r=null,n=Ott.setFastTimeout(()=>{r=setImmediate(()=>{Okn(t.deref(),e)})},e.timeout);return()=>{Ott.clearFastTimeout(n),clearImmediate(r)}};function Okn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,Bkn.destroy(t,new Yas(r))}a(Okn,"onConnectTimeout");Lkn.exports=Kas});var Fkn=I(Btt=>{"use strict";p();Object.defineProperty(Btt,"__esModule",{value:!0});Btt.enumToMap=void 0;function Zas(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Zas,"enumToMap");Btt.enumToMap=Zas});var Ukn=I(kr=>{"use strict";p();Object.defineProperty(kr,"__esModule",{value:!0});kr.SPECIAL_HEADERS=kr.HEADER_STATE=kr.MINOR=kr.MAJOR=kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS=kr.TOKEN=kr.STRICT_TOKEN=kr.HEX=kr.URL_CHAR=kr.STRICT_URL_CHAR=kr.USERINFO_CHARS=kr.MARK=kr.ALPHANUM=kr.NUM=kr.HEX_MAP=kr.NUM_MAP=kr.ALPHA=kr.FINISH=kr.H_METHOD_MAP=kr.METHOD_MAP=kr.METHODS_RTSP=kr.METHODS_ICE=kr.METHODS_HTTP=kr.METHODS=kr.LENIENT_FLAGS=kr.FLAGS=kr.TYPE=kr.ERROR=void 0;var Xas=Fkn(),ecs;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(ecs=kr.ERROR||(kr.ERROR={}));var tcs;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(tcs=kr.TYPE||(kr.TYPE={}));var rcs;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(rcs=kr.FLAGS||(kr.FLAGS={}));var ncs;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})(ncs=kr.LENIENT_FLAGS||(kr.LENIENT_FLAGS={}));var Di;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(Di=kr.METHODS||(kr.METHODS={}));kr.METHODS_HTTP=[Di.DELETE,Di.GET,Di.HEAD,Di.POST,Di.PUT,Di.CONNECT,Di.OPTIONS,Di.TRACE,Di.COPY,Di.LOCK,Di.MKCOL,Di.MOVE,Di.PROPFIND,Di.PROPPATCH,Di.SEARCH,Di.UNLOCK,Di.BIND,Di.REBIND,Di.UNBIND,Di.ACL,Di.REPORT,Di.MKACTIVITY,Di.CHECKOUT,Di.MERGE,Di["M-SEARCH"],Di.NOTIFY,Di.SUBSCRIBE,Di.UNSUBSCRIBE,Di.PATCH,Di.PURGE,Di.MKCALENDAR,Di.LINK,Di.UNLINK,Di.PRI,Di.SOURCE];kr.METHODS_ICE=[Di.SOURCE];kr.METHODS_RTSP=[Di.OPTIONS,Di.DESCRIBE,Di.ANNOUNCE,Di.SETUP,Di.PLAY,Di.PAUSE,Di.TEARDOWN,Di.GET_PARAMETER,Di.SET_PARAMETER,Di.REDIRECT,Di.RECORD,Di.FLUSH,Di.GET,Di.POST];kr.METHOD_MAP=Xas.enumToMap(Di);kr.H_METHOD_MAP={};Object.keys(kr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(kr.H_METHOD_MAP[t]=kr.METHOD_MAP[t])});var ics;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(ics=kr.FINISH||(kr.FINISH={}));kr.ALPHA=[];for(let t=65;t<=90;t++)kr.ALPHA.push(String.fromCharCode(t)),kr.ALPHA.push(String.fromCharCode(t+32));kr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};kr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};kr.NUM=["0","1","2","3","4","5","6","7","8","9"];kr.ALPHANUM=kr.ALPHA.concat(kr.NUM);kr.MARK=["-","_",".","!","~","*","'","(",")"];kr.USERINFO_CHARS=kr.ALPHANUM.concat(kr.MARK).concat(["%",";",":","&","=","+","$",","]);kr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(kr.ALPHANUM);kr.URL_CHAR=kr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)kr.URL_CHAR.push(t);kr.HEX=kr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);kr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(kr.ALPHANUM);kr.TOKEN=kr.STRICT_TOKEN.concat([" "]);kr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&kr.HEADER_CHARS.push(t);kr.CONNECTION_TOKEN_CHARS=kr.HEADER_CHARS.filter(t=>t!==44);kr.MAJOR=kr.NUM_MAP;kr.MINOR=kr.MAJOR;var zue;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(zue=kr.HEADER_STATE||(kr.HEADER_STATE={}));kr.SPECIAL_HEADERS={connection:zue.CONNECTION,"content-length":zue.CONTENT_LENGTH,"proxy-connection":zue.CONNECTION,"transfer-encoding":zue.TRANSFER_ENCODING,upgrade:zue.UPGRADE}});var vJt=I((bVd,Qkn)=>{"use strict";p();var{Buffer:ocs}=require("node:buffer");Qkn.exports=ocs.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var jkn=I((TVd,qkn)=>{"use strict";p();var{Buffer:scs}=require("node:buffer");qkn.exports=scs.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var Owe=I((xVd,Kkn)=>{"use strict";p();var Hkn=["GET","HEAD","POST"],acs=new Set(Hkn),ccs=[101,204,205,304],Gkn=[301,302,303,307,308],lcs=new Set(Gkn),$kn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],ucs=new Set($kn),Vkn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],dcs=new Set(Vkn),fcs=["follow","manual","error"],Wkn=["GET","HEAD","OPTIONS","TRACE"],pcs=new Set(Wkn),hcs=["navigate","same-origin","no-cors","cors"],mcs=["omit","same-origin","include"],gcs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],Acs=["content-encoding","content-language","content-location","content-type","content-length"],ycs=["half"],zkn=["CONNECT","TRACE","TRACK"],Ecs=new Set(zkn),Ykn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],_cs=new Set(Ykn);Kkn.exports={subresource:Ykn,forbiddenMethods:zkn,requestBodyHeader:Acs,referrerPolicy:Vkn,requestRedirect:fcs,requestMode:hcs,requestCredentials:mcs,requestCache:gcs,redirectStatus:Gkn,corsSafeListedMethods:Hkn,nullBodyStatus:ccs,safeMethods:Wkn,badPorts:$kn,requestDuplex:ycs,subresourceSet:_cs,badPortsSet:ucs,redirectStatusSet:lcs,corsSafeListedMethodsSet:acs,safeMethodsSet:pcs,forbiddenMethodsSet:Ecs,referrerPolicySet:dcs}});var SJt=I((RVd,Jkn)=>{"use strict";p();var bJt=Symbol.for("undici.globalOrigin.1");function Ccs(){return globalThis[bJt]}a(Ccs,"getGlobalOrigin");function vcs(t){if(t===void 0){Object.defineProperty(globalThis,bJt,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,bJt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(vcs,"setGlobalOrigin");Jkn.exports={getGlobalOrigin:Ccs,setGlobalOrigin:vcs}});var Gv=I((DVd,iPn)=>{"use strict";p();var Ftt=require("node:assert"),bcs=new TextEncoder,Bwe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,Scs=/[\u000A\u000D\u0009\u0020]/,Tcs=/[\u0009\u000A\u000C\u000D\u0020]/g,Ics=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function xcs(t){Ftt(t.protocol==="data:");let e=ePn(t,!0);e=e.slice(5);let r={position:0},n=Yue(",",e,r),o=n.length;if(n=Ncs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=tPn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=nPn(c);if(c=Rcs(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=TJt(n);return l==="failure"&&(l=TJt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(xcs,"dataURLProcessor");function ePn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(ePn,"URLSerializer");function Utt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(Zkn,"isHexCharByte");function Xkn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(Xkn,"hexByteToNumber");function wcs(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=Yue(";",t,e);if(n=Ltt(n,!1,!0),n.length===0||!Bwe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionScs.test(d),t,e);let l=Utt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=rPn(t,e,!0),Yue(";",t,e);else if(u=Yue(";",t,e),u=Ltt(u,!1,!0),u.length===0)continue;l.length!==0&&Bwe.test(l)&&(u.length===0||Ics.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(TJt,"parseMIMEType");function Rcs(t){t=t.replace(Tcs,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(Rcs,"forgivingBase64");function rPn(t,e,r){let n=e.position,o="";for(Ftt(t[e.position]==='"'),e.position++;o+=Utt(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{Ftt(s==='"');break}}return r?o:t.slice(n,e.position)}a(rPn,"collectAnHTTPQuotedString");function kcs(t){Ftt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",Bwe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(kcs,"serializeAMimeType");function Pcs(t){return t===13||t===10||t===9||t===32}a(Pcs,"isHTTPWhiteSpace");function Ltt(t,e=!0,r=!0){return IJt(t,e,r,Pcs)}a(Ltt,"removeHTTPWhitespace");function Dcs(t){return t===13||t===10||t===9||t===12||t===32}a(Dcs,"isASCIIWhitespace");function Ncs(t,e=!0,r=!0){return IJt(t,e,r,Dcs)}a(Ncs,"removeASCIIWhitespace");function IJt(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(IJt,"removeChars");function nPn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(nPn,"isomorphicDecode");function Mcs(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Mcs,"minimizeSupportedMimeType");iPn.exports={dataURLProcessor:xcs,URLSerializer:ePn,collectASequenceOfCodePoints:Utt,collectASequenceOfCodePointsFast:Yue,stringPercentDecode:tPn,parseMIMEType:TJt,collectAnHTTPQuotedString:rPn,serializeAMimeType:kcs,removeChars:IJt,removeHTTPWhitespace:Ltt,minimizeSupportedMimeType:Mcs,HTTP_TOKEN_CODEPOINTS:Bwe,isomorphicDecode:nPn}});var bA=I((OVd,oPn)=>{"use strict";p();var{types:PO,inspect:Ocs}=require("node:util"),{markAsUncloneable:Bcs}=require("node:worker_threads"),{toUSVString:Lcs}=Ls(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return Ocs(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Er.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!PO.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Er.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Er.converters.USVString=Lcs;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!PO.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&PO.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!PO.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&PO.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!PO.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&PO.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(PO.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(PO.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(PO.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);oPn.exports={webidl:Er}});var $S=I((LVd,EPn)=>{"use strict";p();var{Transform:Fcs}=require("node:stream"),sPn=require("node:zlib"),{redirectStatusSet:Ucs,referrerPolicySet:Qcs,badPortsSet:qcs}=Owe(),{getGlobalOrigin:aPn}=SJt(),{collectASequenceOfCodePoints:oJ,collectAnHTTPQuotedString:jcs,removeChars:Hcs,parseMIMEType:Gcs}=Gv(),{performance:$cs}=require("node:perf_hooks"),{isBlobLike:Vcs,ReadableStreamFrom:Wcs,isValidHTTPToken:cPn,normalizedMethodRecordsBase:zcs}=Ls(),sJ=require("node:assert"),{isUint8Array:Ycs}=require("node:util/types"),{webidl:Lwe}=bA(),lPn=[],qtt;try{qtt=require("node:crypto");let t=["sha256","sha384","sha512"];lPn=qtt.getHashes().filter(e=>t.includes(e))}catch{}function uPn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(uPn,"responseURL");function Kcs(t,e){if(!Ucs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&fPn(r)&&(dPn(r)||(r=Jcs(r)),r=new URL(r,uPn(t))),r&&!r.hash&&(r.hash=e),r}a(Kcs,"responseLocationURL");function dPn(t){for(let e=0;e126||r<32)return!1}return!0}a(dPn,"isValidEncodedURL");function Jcs(t){return Buffer.from(t,"binary").toString("utf8")}a(Jcs,"normalizeBinaryStringToUtf8");function Uwe(t){return t.urlList[t.urlList.length-1]}a(Uwe,"requestCurrentURL");function Zcs(t){let e=Uwe(t);return APn(e)&&qcs.has(e.port)?"blocked":"allowed"}a(Zcs,"requestBadPort");function Xcs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(Xcs,"isErrorLike");function els(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(els,"isValidReasonPhrase");var tls=cPn;function fPn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(fPn,"isValidHeaderValue");function rls(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(Qcs.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(rls,"setRequestReferrerPolicyOnRedirect");function nls(){return"allowed"}a(nls,"crossOriginResourcePolicyCheck");function ils(){return"success"}a(ils,"corsCheck");function ols(){return"success"}a(ols,"TAOCheck");function sls(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(sls,"appendFetchMetadata");function als(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&wJt(t.origin)&&!wJt(Uwe(t))&&(e=null);break;case"same-origin":jtt(t,Uwe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(als,"appendRequestOriginHeader");function Kue(t,e){return t}a(Kue,"coarsenTime");function cls(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=jtt(t,n),c=Fwe(n)&&!Fwe(t.url);switch(e){case"origin":return o??xJt(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=Uwe(t);return jtt(n,l)?n:Fwe(n)&&!Fwe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(fls,"determineRequestsReferrer");function xJt(t,e){return sJ(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(xJt,"stripURLForReferrer");function Fwe(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(Fwe,"isURLPotentiallyTrustworthy");function pls(t,e){if(qtt===void 0)return!0;let r=hPn(e);if(r==="no metadata"||r.length===0)return!0;let n=mls(r),o=gls(r,n);for(let s of o){let c=s.algo,l=s.hash,u=qtt.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),Als(u,l))return!0}return!1}a(pls,"bytesMatch");var hls=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function hPn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=hls.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();lPn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(hPn,"parseMetadata");function mls(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(Els,"createDeferredPromise");function _ls(t){return t.controller.state==="aborted"}a(_ls,"isAborted");function Cls(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(Cls,"isCancelled");function vls(t){return zcs[t.toLowerCase()]??t}a(vls,"normalizeMethod");function bls(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return sJ(typeof e=="string"),e}a(bls,"serializeJavascriptValueToJSONString");var Sls=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function mPn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,Sls),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(mPn,"createIterator");function Tls(t,e,r,n=0,o=1){let s=mPn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Lwe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Lwe.brandCheck(this,e),Lwe.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(Tls,"iteratorMixin");async function Ils(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await gPn(s))}catch(c){o(c)}}a(Ils,"fullyReadBody");function xls(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(xls,"isReadableStreamLike");function wls(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(wls,"readableStreamClose");var Rls=/[^\x00-\xFF]/;function Qtt(t){return sJ(!Rls.test(t)),t}a(Qtt,"isomorphicEncode");async function gPn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Ycs(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(gPn,"readAllBytes");function kls(t){sJ("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(kls,"urlIsLocal");function wJt(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(wJt,"urlHasHttpsScheme");function APn(t){sJ("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(APn,"urlIsHttpHttpsScheme");function Pls(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&oJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&oJ(u=>u===" "||u===" ",r,n);let o=oJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&oJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&oJ(u=>u===" "||u===" ",r,n);let c=oJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(Pls,"simpleRangeHeaderValue");function Dls(t,e,r){let n="bytes ";return n+=Qtt(`${t}`),n+="-",n+=Qtt(`${e}`),n+="/",n+=Qtt(`${r}`),n}a(Dls,"buildContentRange");var RJt=class extends Fcs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?sPn.createInflate(this.#e):sPn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function Nls(t){return new RJt(t)}a(Nls,"createInflate");function Mls(t){let e=null,r=null,n=null,o=yPn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Gcs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Mls,"extractMimeType");function Ols(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(Ols,"gettingDecodingSplitting");function yPn(t,e){let r=e.get(t,!0);return r===null?null:Ols(r)}a(yPn,"getDecodeSplit");var Bls=new TextDecoder;function Lls(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Bls.decode(t))}a(Lls,"utf8DecodeBytes");var kJt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return aPn()}get origin(){return this.baseUrl?.origin}policyContainer=pPn()},PJt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new kJt},Fls=new PJt;EPn.exports={isAborted:_ls,isCancelled:Cls,isValidEncodedURL:dPn,createDeferredPromise:Els,ReadableStreamFrom:Wcs,tryUpgradeRequestToAPotentiallyTrustworthyURL:yls,clampAndCoarsenConnectionTimingInfo:cls,coarsenedSharedCurrentTime:lls,determineRequestsReferrer:fls,makePolicyContainer:pPn,clonePolicyContainer:dls,appendFetchMetadata:sls,appendRequestOriginHeader:als,TAOCheck:ols,corsCheck:ils,crossOriginResourcePolicyCheck:nls,createOpaqueTimingInfo:uls,setRequestReferrerPolicyOnRedirect:rls,isValidHTTPToken:cPn,requestBadPort:Zcs,requestCurrentURL:Uwe,responseURL:uPn,responseLocationURL:Kcs,isBlobLike:Vcs,isURLPotentiallyTrustworthy:Fwe,isValidReasonPhrase:els,sameOrigin:jtt,normalizeMethod:vls,serializeJavascriptValueToJSONString:bls,iteratorMixin:Tls,createIterator:mPn,isValidHeaderName:tls,isValidHeaderValue:fPn,isErrorLike:Xcs,fullyReadBody:Ils,bytesMatch:pls,isReadableStreamLike:xls,readableStreamClose:wls,isomorphicEncode:Qtt,urlIsLocal:kls,urlHasHttpsScheme:wJt,urlIsHttpHttpsScheme:APn,readAllBytes:gPn,simpleRangeHeaderValue:Pls,buildContentRange:Dls,parseMetadata:hPn,createInflate:Nls,extractMimeType:Mls,getDecodeSplit:yPn,utf8DecodeBytes:Lls,environmentSettingsObject:Fls}});var kq=I((QVd,_Pn)=>{"use strict";p();_Pn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var NJt=I((jVd,CPn)=>{"use strict";p();var{Blob:Uls,File:Qls}=require("node:buffer"),{kState:J3}=kq(),{webidl:DO}=bA(),DJt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[J3]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return DO.brandCheck(this,t),this[J3].blobLike.stream(...e)}arrayBuffer(...e){return DO.brandCheck(this,t),this[J3].blobLike.arrayBuffer(...e)}slice(...e){return DO.brandCheck(this,t),this[J3].blobLike.slice(...e)}text(...e){return DO.brandCheck(this,t),this[J3].blobLike.text(...e)}get size(){return DO.brandCheck(this,t),this[J3].blobLike.size}get type(){return DO.brandCheck(this,t),this[J3].blobLike.type}get name(){return DO.brandCheck(this,t),this[J3].name}get lastModified(){return DO.brandCheck(this,t),this[J3].lastModified}get[Symbol.toStringTag](){return"File"}};DO.converters.Blob=DO.interfaceConverter(Uls);function qls(t){return t instanceof Qls||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(qls,"isFileLike");CPn.exports={FileLike:DJt,isFileLike:qls}});var qwe=I(($Vd,IPn)=>{"use strict";p();var{isBlobLike:Htt,iteratorMixin:jls}=$S(),{kState:q_}=kq(),{kEnumerableProperty:Jue}=Ls(),{FileLike:vPn,isFileLike:Hls}=NJt(),{webidl:yu}=bA(),{File:TPn}=require("node:buffer"),bPn=require("node:util"),SPn=globalThis.File??TPn,Qwe=class t{static{a(this,"FormData")}constructor(e){if(yu.util.markAsUncloneable(this),e!==void 0)throw yu.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[q_]=[]}append(e,r,n=void 0){yu.brandCheck(this,t);let o="FormData.append";if(yu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Htt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=yu.converters.USVString(e,o,"name"),r=Htt(r)?yu.converters.Blob(r,o,"value",{strict:!1}):yu.converters.USVString(r,o,"value"),n=arguments.length===3?yu.converters.USVString(n,o,"filename"):void 0;let s=MJt(e,r,n);this[q_].push(s)}delete(e){yu.brandCheck(this,t);let r="FormData.delete";yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_]=this[q_].filter(n=>n.name!==e)}get(e){yu.brandCheck(this,t);let r="FormData.get";yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name");let n=this[q_].findIndex(o=>o.name===e);return n===-1?null:this[q_][n].value}getAll(e){yu.brandCheck(this,t);let r="FormData.getAll";return yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_].filter(n=>n.name===e).map(n=>n.value)}has(e){yu.brandCheck(this,t);let r="FormData.has";return yu.argumentLengthCheck(arguments,1,r),e=yu.converters.USVString(e,r,"name"),this[q_].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){yu.brandCheck(this,t);let o="FormData.set";if(yu.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Htt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=yu.converters.USVString(e,o,"name"),r=Htt(r)?yu.converters.Blob(r,o,"name",{strict:!1}):yu.converters.USVString(r,o,"name"),n=arguments.length===3?yu.converters.USVString(n,o,"name"):void 0;let s=MJt(e,r,n),c=this[q_].findIndex(l=>l.name===e);c!==-1?this[q_]=[...this[q_].slice(0,c),s,...this[q_].slice(c+1).filter(l=>l.name!==e)]:this[q_].push(s)}[bPn.inspect.custom](e,r){let n=this[q_].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=bPn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};jls("FormData",Qwe,q_,"name","value");Object.defineProperties(Qwe.prototype,{append:Jue,delete:Jue,get:Jue,getAll:Jue,has:Jue,set:Jue,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function MJt(t,e,r){if(typeof e!="string"){if(Hls(e)||(e=e instanceof Blob?new SPn([e],"blob",{type:e.type}):new vPn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof TPn?new SPn([e],r,n):new vPn(e,r,n)}}return{name:t,value:e}}a(MJt,"makeEntry");IPn.exports={FormData:Qwe,makeEntry:MJt}});var DPn=I((zVd,PPn)=>{"use strict";p();var{isUSVString:xPn,bufferToLowerCasedHeaderName:Gls}=Ls(),{utf8DecodeBytes:$ls}=$S(),{HTTP_TOKEN_CODEPOINTS:Vls,isomorphicDecode:wPn}=Gv(),{isFileLike:Wls}=NJt(),{makeEntry:zls}=qwe(),Gtt=require("node:assert"),{File:Yls}=require("node:buffer"),Kls=globalThis.File??Yls,Jls=Buffer.from('form-data; name="'),RPn=Buffer.from("; filename"),Zls=Buffer.from("--"),Xls=Buffer.from(`--\r -`);function eus(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(tus,"validateBoundary");function rus(t,e){Gtt(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&$tt(t,Zls,s)||s.position===t.length-4&&$tt(t,Xls,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=nus(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",eus(f)||(f=""),g=new Kls([m],d,{type:f})):g=$ls(Buffer.from(m)),Gtt(xPn(u)),Gtt(typeof g=="string"&&xPn(g)||Wls(g)),o.push(zls(u,g,d))}}a(rus,"multipartFormDataParser");function nus(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=Zue(l=>l!==10&&l!==13&&l!==58,t,e);if(c=OJt(c,!0,!0,l=>l===9||l===32),!Vls.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,Zue(l=>l===32||l===9,t,e),Gls(c)){case"content-disposition":{if(r=n=null,!$tt(t,Jls,e)||(e.position+=17,r=kPn(t,e),r===null))return"failure";if($tt(t,RPn,e)){let l=e.position+RPn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=kPn(t,e),n===null))return"failure"}break}case"content-type":{let l=Zue(u=>u!==10&&u!==13,t,e);l=OJt(l,!1,!0,u=>u===9||u===32),o=wPn(l);break}case"content-transfer-encoding":{let l=Zue(u=>u!==10&&u!==13,t,e);l=OJt(l,!1,!0,u=>u===9||u===32),s=wPn(l);break}default:Zue(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a(nus,"parseMultipartFormDataHeaders");function kPn(t,e){Gtt(t[e.position-1]===34);let r=Zue(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(kPn,"parseMultipartFormDataName");function Zue(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(OJt,"removeChars");function $tt(t,e,r){if(t.length{"use strict";p();var jwe=Ls(),{ReadableStreamFrom:ius,isBlobLike:NPn,isReadableStreamLike:ous,readableStreamClose:sus,createDeferredPromise:aus,fullyReadBody:cus,extractMimeType:lus,utf8DecodeBytes:BPn}=$S(),{FormData:MPn}=qwe(),{kState:ede}=kq(),{webidl:uus}=bA(),{Blob:dus}=require("node:buffer"),BJt=require("node:assert"),{isErrored:LPn,isDisturbed:fus}=require("node:stream"),{isArrayBuffer:pus}=require("node:util/types"),{serializeAMimeType:hus}=Gv(),{multipartFormDataParser:mus}=DPn(),LJt;try{let t=require("node:crypto");LJt=a(e=>t.randomInt(0,e),"random")}catch{LJt=a(t=>Math.floor(Math.random(t)),"random")}var Vtt=new TextEncoder;function gus(){}a(gus,"noop");var FPn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,UPn;FPn&&(UPn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!fus(e)&&!LPn(e)&&e.cancel("Response object has been garbage collected").catch(gus)}));function QPn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:NPn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Vtt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>sus(u))},start(){},type:"bytes"}),BJt(ous(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(pus(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(jwe.isFormDataLike(t)){let u=`----formdata-undici-0${`${LJt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r +`+s),t.push(o+"m+"+nJe.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=p$o()+e+" "+t[0]}a(f$o,"formatArgs");function p$o(){return og.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(p$o,"getDate");function h$o(...t){return process.stderr.write(rJe.formatWithOptions(og.inspectOpts,...t)+` +`)}a(h$o,"log");function m$o(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(m$o,"save");function g$o(){return process.env.DEBUG}a(g$o,"load");function A$o(t){t.inspectOpts={};let e=Object.keys(og.inspectOpts);for(let r=0;re.trim()).join(" ")};CCn.O=function(t){return this.inspectOpts.colors=this.useColors,rJe.inspect(t,this.inspectOpts)}});var SCn=I((vcd,Uqt)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Uqt.exports=vCn():Uqt.exports=bCn()});var qqt=I(hK=>{"use strict";p();Object.defineProperty(hK,"__esModule",{value:!0});hK.createDeferred=hK.deferred=void 0;function Qqt(){let t,e,r="pending";return{promise:new Promise((o,s)=>{t=o,e=s}),done(o){r==="pending"&&(r="resolved",t(o))},fail(o){r==="pending"&&(r="rejected",e(o))},get fulfilled(){return r!=="pending"},get status(){return r}}}a(Qqt,"deferred");hK.deferred=Qqt;hK.createDeferred=Qqt;hK.default=Qqt});var PJe=I(MS=>{"use strict";p();Object.defineProperty(MS,"__esModule",{value:!0});MS.deepClone=ISn;MS.deepFreeze=tYo;MS.cloneAndChange=rYo;MS.mixin=wSn;MS.equals=YIe;MS.safeStringify=nYo;MS.stableStringify=iYo;MS.distinct=oYo;MS.getCaseInsensitive=sYo;MS.filter=aYo;MS.mapValues=cYo;var nq=dS();function ISn(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;let e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([r,n])=>{e[r]=n&&typeof n=="object"?ISn(n):n}),e}a(ISn,"deepClone");function tYo(t){if(!t||typeof t!="object")return t;let e=[t];for(;e.length>0;){let r=e.shift();Object.freeze(r);for(let n in r)if(xSn.call(r,n)){let o=r[n];typeof o=="object"&&!Object.isFrozen(o)&&!(0,nq.isTypedArray)(o)&&e.push(o)}}return t}a(tYo,"deepFreeze");var xSn=Object.prototype.hasOwnProperty;function rYo(t,e){return jjt(t,e,new Set)}a(rYo,"cloneAndChange");function jjt(t,e,r){if((0,nq.isUndefinedOrNull)(t))return t;let n=e(t);if(typeof n<"u")return n;if(Array.isArray(t)){let o=[];for(let s of t)o.push(jjt(s,e,r));return o}if((0,nq.isObject)(t)){if(r.has(t))throw new Error("Cannot clone recursive data-structure");r.add(t);let o={};for(let s in t)xSn.call(t,s)&&(o[s]=jjt(t[s],e,r));return r.delete(t),o}return t}a(jjt,"_cloneAndChange");function wSn(t,e,r=!0){return(0,nq.isObject)(t)?((0,nq.isObject)(e)&&Object.keys(e).forEach(n=>{n in t?r&&((0,nq.isObject)(t[n])&&(0,nq.isObject)(e[n])?wSn(t[n],e[n],r):t[n]=e[n]):t[n]=e[n]}),t):e}a(wSn,"mixin");function YIe(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r,n;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(r=0;r{if((0,nq.isObject)(n)||Array.isArray(n)){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`[BigInt ${n.toString()}]`:n})}a(nYo,"safeStringify");function iYo(t){if(t===void 0)return"undefined";try{return Hjt(t,new WeakSet)}catch{return""}}a(iYo,"stableStringify");function Hjt(t,e){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(e.has(t))return'"[Circular]"';if(e.add(t),Array.isArray(t))return"["+t.map(o=>Hjt(o,e)).join(",")+"]";let r=Object.keys(t).sort(),n=[];for(let o of r){let s=t[o];s!==void 0&&n.push(JSON.stringify(o)+":"+Hjt(s,e))}return"{"+n.join(",")+"}"}a(Hjt,"_stableStringify");function oYo(t,e){let r=Object.create(null);return!t||!e||Object.keys(e).forEach(o=>{let s=t[o],c=e[o];YIe(s,c)||(r[o]=c)}),r}a(oYo,"distinct");function sYo(t,e){let r=e.toLowerCase(),n=Object.keys(t).find(o=>o.toLowerCase()===r);return n?t[n]:t[e]}a(sYo,"getCaseInsensitive");function aYo(t,e){let r=Object.create(null);for(let[n,o]of Object.entries(t))e(n,o)&&(r[n]=o);return r}a(aYo,"filter");function cYo(t,e){let r={};for(let[n,o]of Object.entries(t))r[n]=e(o,n);return r}a(cYo,"mapValues")});var O_=I(kJe=>{"use strict";p();Object.defineProperty(kJe,"__esModule",{value:!0});kJe.ErrorUtils=void 0;var lYo=PJe(),RSn;(function(t){function e(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error(`An unexpected error occurred: ${(0,lYo.safeStringify)(n)}`)}a(e,"fromUnknown"),t.fromUnknown=e;function r(n){return n.stack?n.stack:n.message}a(r,"toString"),t.toString=r})(RSn||(kJe.ErrorUtils=RSn={}))});var Hx=I(DJe=>{"use strict";p();Object.defineProperty(DJe,"__esModule",{value:!0});DJe.Result=void 0;var Gjt=O_(),PSn;(function(t){function e(c){return new $jt(c)}a(e,"ok"),t.ok=e;function r(c){return new Vjt(c)}a(r,"error"),t.error=r;function n(c){return t.error(new Error(c))}a(n,"fromString"),t.fromString=n;function o(c){try{return t.ok(c())}catch(l){return t.error(Gjt.ErrorUtils.fromUnknown(l))}}a(o,"tryWith"),t.tryWith=o;async function s(c){try{return t.ok(await c())}catch(l){return t.error(Gjt.ErrorUtils.fromUnknown(l))}}a(s,"tryWithAsync"),t.tryWithAsync=s})(PSn||(DJe.Result=PSn={}));var $jt=class t{static{a(this,"ResultOk")}constructor(e){this.val=e}map(e){return new t(e(this.val))}mapError(e){return this}flatMap(e){return e(this.val)}unwrap(){return this.val}unwrapOr(e){return this.val}isOk(){return!0}isError(){return!1}},Vjt=class t{static{a(this,"ResultError")}constructor(e){this.err=e}map(e){return this}mapError(e){return new t(e(this.err))}flatMap(e){return this}unwrap(){throw this.err instanceof Error?this.err:Gjt.ErrorUtils.fromUnknown(this.err)}unwrapOr(e){return e}isOk(){return!1}isError(){return!0}}});var Nd=I((AHd,kRn)=>{p();kRn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kInterceptors:Symbol("dispatch interceptors"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent")}});var mc=I((EHd,rPn)=>{"use strict";p();var DRn=Symbol.for("undici.error.UND_ERR"),Md=class extends Error{static{a(this,"UndiciError")}constructor(e){super(e),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[DRn]===!0}[DRn]=!0},NRn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),UKt=class extends Md{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[NRn]===!0}[NRn]=!0},MRn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),QKt=class extends Md{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[MRn]===!0}[MRn]=!0},ORn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),qKt=class extends Md{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[ORn]===!0}[ORn]=!0},BRn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),jKt=class extends Md{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[BRn]===!0}[BRn]=!0},LRn=Symbol.for("undici.error.UND_ERR_RESPONSE_STATUS_CODE"),HKt=class extends Md{static{a(this,"ResponseStatusCodeError")}constructor(e,r,n,o){super(e),this.name="ResponseStatusCodeError",this.message=e||"Response Status Code Error",this.code="UND_ERR_RESPONSE_STATUS_CODE",this.body=o,this.status=r,this.statusCode=r,this.headers=n}static[Symbol.hasInstance](e){return e&&e[LRn]===!0}[LRn]=!0},FRn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),GKt=class extends Md{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[FRn]===!0}[FRn]=!0},URn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),$Kt=class extends Md{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[URn]===!0}[URn]=!0},QRn=Symbol.for("undici.error.UND_ERR_ABORT"),gtt=class extends Md{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[QRn]===!0}[QRn]=!0},qRn=Symbol.for("undici.error.UND_ERR_ABORTED"),VKt=class extends gtt{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[qRn]===!0}[qRn]=!0},jRn=Symbol.for("undici.error.UND_ERR_INFO"),WKt=class extends Md{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[jRn]===!0}[jRn]=!0},HRn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),zKt=class extends Md{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[HRn]===!0}[HRn]=!0},GRn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),YKt=class extends Md{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[GRn]===!0}[GRn]=!0},$Rn=Symbol.for("undici.error.UND_ERR_DESTROYED"),KKt=class extends Md{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[$Rn]===!0}[$Rn]=!0},VRn=Symbol.for("undici.error.UND_ERR_CLOSED"),JKt=class extends Md{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[VRn]===!0}[VRn]=!0},WRn=Symbol.for("undici.error.UND_ERR_SOCKET"),ZKt=class extends Md{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[WRn]===!0}[WRn]=!0},zRn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),XKt=class extends Md{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[zRn]===!0}[zRn]=!0},YRn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),eJt=class extends Md{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[YRn]===!0}[YRn]=!0},KRn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),tJt=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[KRn]===!0}[KRn]=!0},JRn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),rJt=class extends Md{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[JRn]===!0}[JRn]=!0},ZRn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),nJt=class extends Md{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[ZRn]===!0}[ZRn]=!0},XRn=Symbol.for("undici.error.UND_ERR_RESPONSE"),iJt=class extends Md{static{a(this,"ResponseError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[XRn]===!0}[XRn]=!0},ePn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),oJt=class extends Md{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n){super(r,{cause:e,...n??{}}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[ePn]===!0}[ePn]=!0},tPn=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),sJt=class extends Md{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[tPn]===!0}get[tPn](){return!0}};rPn.exports={AbortError:gtt,HTTPParserError:tJt,UndiciError:Md,HeadersTimeoutError:QKt,HeadersOverflowError:qKt,BodyTimeoutError:jKt,RequestContentLengthMismatchError:zKt,ConnectTimeoutError:UKt,ResponseStatusCodeError:HKt,InvalidArgumentError:GKt,InvalidReturnValueError:$Kt,RequestAbortedError:VKt,ClientDestroyedError:KKt,ClientClosedError:JKt,InformationalError:WKt,SocketError:ZKt,NotSupportedError:XKt,ResponseContentLengthMismatchError:YKt,BalancedPoolMissingUpstreamError:eJt,ResponseExceededMaxSizeError:rJt,RequestRetryError:nJt,ResponseError:iJt,SecureProxyConnectionError:oJt,MessageSizeExceededError:sJt}});var ytt=I((CHd,nPn)=>{"use strict";p();var Att={},aJt=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"];for(let t=0;t{"use strict";p();var{wellknownHeaderNames:iPn,headerNameLowerCasedRecord:Ros}=ytt(),cJt=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var ywe=require("node:assert"),{kDestroyed:lPn,kBodyUsed:Lue,kListeners:lJt,kBody:cPn}=Nd(),{IncomingMessage:Pos}=require("node:http"),Ctt=require("node:stream"),kos=require("node:net"),{Blob:Dos}=require("node:buffer"),Nos=require("node:util"),{stringify:Mos}=require("node:querystring"),{EventEmitter:Oos}=require("node:events"),{InvalidArgumentError:dg}=mc(),{headerNameLowerCasedRecord:Bos}=ytt(),{tree:uPn}=aPn(),[Los,Fos]=process.versions.node.split(".").map(t=>Number(t)),vtt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[cPn]=e,this[Lue]=!1}async*[Symbol.asyncIterator](){ywe(!this[Lue],"disturbed"),this[Lue]=!0,yield*this[cPn]}};function Uos(t){return btt(t)?(mPn(t)===0&&t.on("data",function(){ywe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Lue]=!1,Oos.prototype.on.call(t,"data",function(){this[Lue]=!0})),t):t&&typeof t.pipeTo=="function"?new vtt(t):t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&hPn(t)?new vtt(t):t}a(Uos,"wrapRequestBody");function Qos(){}a(Qos,"nop");function btt(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(btt,"isStream");function dPn(t){if(t===null)return!1;if(t instanceof Dos)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(dPn,"isBlobLike");function qos(t,e){if(t.includes("?")||t.includes("#"))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Mos(e);return r&&(t+="?"+r),t}a(qos,"buildURL");function fPn(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(fPn,"isValidPort");function _tt(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(_tt,"isHttpOrHttpsPrefixed");function pPn(t){if(typeof t=="string"){if(t=new URL(t),!_tt(t.origin||t.protocol))throw new dg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new dg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&fPn(t.port)===!1)throw new dg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new dg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new dg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new dg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new dg("Invalid URL origin: the origin must be a string or null/undefined.");if(!_tt(t.origin||t.protocol))throw new dg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!_tt(t.origin||t.protocol))throw new dg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(pPn,"parseURL");function jos(t){if(t=pPn(t),t.pathname!=="/"||t.search||t.hash)throw new dg("invalid url");return t}a(jos,"parseOrigin");function Hos(t){if(t[0]==="["){let r=t.indexOf("]");return ywe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Hos,"getHostname");function Gos(t){if(!t)return null;ywe(typeof t=="string");let e=Hos(t);return kos.isIP(e)?"":e}a(Gos,"getServerName");function $os(t){return JSON.parse(JSON.stringify(t))}a($os,"deepClone");function Vos(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Vos,"isAsyncIterable");function hPn(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(hPn,"isIterable");function mPn(t){if(t==null)return 0;if(btt(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(dPn(t))return t.size!=null?t.size:null;if(yPn(t))return t.byteLength}return null}a(mPn,"bodyLength");function gPn(t){return t&&!!(t.destroyed||t[lPn]||Ctt.isDestroyed?.(t))}a(gPn,"isDestroyed");function Wos(t,e){t==null||!btt(t)||gPn(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Pos&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[lPn]=!0))}a(Wos,"destroy");var zos=/timeout=(\d+)/;function Yos(t){let e=t.toString().match(zos);return e?parseInt(e[1],10)*1e3:null}a(Yos,"parseKeepAliveTimeout");function APn(t){return typeof t=="string"?Bos[t]??t.toLowerCase():uPn.lookup(t)??t.toString("latin1").toLowerCase()}a(APn,"headerNameToString");function Kos(t){return uPn.lookup(t)??t.toString("latin1").toLowerCase()}a(Kos,"bufferToLowerCasedHeaderName");function Jos(t,e){e===void 0&&(e={});for(let r=0;rc.toString("utf8")):s.toString("utf8")}}return"content-length"in e&&"content-disposition"in e&&(e["content-disposition"]=Buffer.from(e["content-disposition"]).toString("latin1")),e}a(Jos,"parseHeaders");function Zos(t){let e=t.length,r=new Array(e),n=!1,o=-1,s,c,l=0;for(let u=0;u{r.close(),r.byobRequest?.respond(0)});else{let s=Buffer.isBuffer(o)?o:Buffer.from(o);s.byteLength&&r.enqueue(new Uint8Array(s))}return r.desiredSize>0},async cancel(r){await e.return()},type:"bytes"})}a(iss,"ReadableStreamFrom");function oss(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(oss,"isFormDataLike");function sss(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.addListener("abort",e),()=>t.removeListener("abort",e))}a(sss,"addAbortListener");var ass=typeof String.prototype.toWellFormed=="function",css=typeof String.prototype.isWellFormed=="function";function EPn(t){return ass?`${t}`.toWellFormed():Nos.toUSVString(t)}a(EPn,"toUSVString");function lss(t){return css?`${t}`.isWellFormed():EPn(t)===`${t}`}a(lss,"isUSVString");function _Pn(t){switch(t){case 34:case 40:case 41:case 44:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 123:case 125:return!1;default:return t>=33&&t<=126}}a(_Pn,"isTokenCharCode");function uss(t){if(t.length===0)return!1;for(let e=0;e{"use strict";p();var Oc=require("node:diagnostics_channel"),fJt=require("node:util"),Stt=fJt.debuglog("undici"),dJt=fJt.debuglog("fetch"),YK=fJt.debuglog("websocket"),SPn=!1,Ass={beforeConnect:Oc.channel("undici:client:beforeConnect"),connected:Oc.channel("undici:client:connected"),connectError:Oc.channel("undici:client:connectError"),sendHeaders:Oc.channel("undici:client:sendHeaders"),create:Oc.channel("undici:request:create"),bodySent:Oc.channel("undici:request:bodySent"),headers:Oc.channel("undici:request:headers"),trailers:Oc.channel("undici:request:trailers"),error:Oc.channel("undici:request:error"),open:Oc.channel("undici:websocket:open"),close:Oc.channel("undici:websocket:close"),socketError:Oc.channel("undici:websocket:socket_error"),ping:Oc.channel("undici:websocket:ping"),pong:Oc.channel("undici:websocket:pong")};if(Stt.enabled||dJt.enabled){let t=dJt.enabled?dJt:Stt;Oc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Oc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s using %s%s",`${s}${o?`:${o}`:""}`,n,r)}),Oc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s using %s%s errored - %s",`${s}${o?`:${o}`:""}`,n,r,c.message)}),Oc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)}),Oc.channel("undici:request:headers").subscribe(e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s/%s - HTTP %d",r,o,n,s)}),Oc.channel("undici:request:trailers").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s/%s",r,o,n)}),Oc.channel("undici:request:error").subscribe(e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s/%s errored - %s",r,o,n,s.message)}),SPn=!0}if(YK.enabled){if(!SPn){let t=Stt.enabled?Stt:YK;Oc.channel("undici:client:beforeConnect").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Oc.channel("undici:client:connected").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),Oc.channel("undici:client:connectError").subscribe(e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),Oc.channel("undici:client:sendHeaders").subscribe(e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s/%s",r,o,n)})}Oc.channel("undici:websocket:open").subscribe(t=>{let{address:{address:e,port:r}}=t;YK("connection opened %s%s",e,r?`:${r}`:"")}),Oc.channel("undici:websocket:close").subscribe(t=>{let{websocket:e,code:r,reason:n}=t;YK("closed connection to %s - %s %s",e.url,r,n)}),Oc.channel("undici:websocket:socket_error").subscribe(t=>{YK("connection errored - %s",t.message)}),Oc.channel("undici:websocket:ping").subscribe(t=>{YK("ping received")}),Oc.channel("undici:websocket:pong").subscribe(t=>{YK("pong received")})}TPn.exports={channels:Ass}});var RPn=I((DHd,wPn)=>{"use strict";p();var{InvalidArgumentError:gu,NotSupportedError:yss}=mc(),q3=require("node:assert"),{isValidHTTPToken:xPn,isValidHeaderValue:pJt,isStream:Ess,destroy:_ss,isBuffer:vss,isFormDataLike:Css,isIterable:bss,isBlobLike:Sss,buildURL:Tss,validateHandler:Iss,getServerName:xss,normalizedMethodRecords:wss}=Os(),{channels:SO}=Fue(),{headerNameLowerCasedRecord:IPn}=ytt(),Rss=/[^\u0021-\u00ff]/,Zx=Symbol("handler"),hJt=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,throwOnError:g,expectContinue:A,servername:y},E){if(typeof r!="string")throw new gu("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new gu("path must be an absolute URL or start with a slash");if(Rss.test(r))throw new gu("invalid request path");if(typeof n!="string")throw new gu("method must be a string");if(wss[n]===void 0&&!xPn(n))throw new gu("invalid request method");if(d&&typeof d!="string")throw new gu("upgrade must be a string");if(d&&!pJt(d))throw new gu("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new gu("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new gu("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new gu("invalid reset");if(A!=null&&typeof A!="boolean")throw new gu("invalid expectContinue");if(this.headersTimeout=f,this.bodyTimeout=h,this.throwOnError=g===!0,this.method=n,this.abort=null,o==null)this.body=null;else if(Ess(o)){this.body=o;let _=this.body._readableState;(!_||!_.autoDestroy)&&(this.endHandler=a(function(){_ss(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=v=>{this.abort?this.abort(v):this.error=v},this.body.on("error",this.errorHandler)}else if(vss(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Css(o)||bss(o)||Sss(o))this.body=o;else throw new gu("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?Tss(r,c):r,this.origin=e,this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??!1,this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=A??!1,Array.isArray(s)){if(s.length%2!==0)throw new gu("headers array must be even");for(let _=0;_{"use strict";p();var Pss=require("node:events"),Itt=class extends Pss{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new mJt(this,n)}},mJt=class extends Itt{static{a(this,"ComposedDispatcher")}#e=null;#t=null;constructor(e,r){super(),this.#e=e,this.#t=r}dispatch(...e){this.#t(...e)}close(...e){return this.#e.close(...e)}destroy(...e){return this.#e.destroy(...e)}};PPn.exports=Itt});var jue=I((FHd,kPn)=>{"use strict";p();var kss=Ewe(),{ClientDestroyedError:gJt,ClientClosedError:Dss,InvalidArgumentError:Uue}=mc(),{kDestroy:Nss,kClose:Mss,kClosed:_we,kDestroyed:Que,kDispatch:AJt,kInterceptors:KK}=Nd(),j3=Symbol("onDestroyed"),que=Symbol("onClosed"),xtt=Symbol("Intercepted Dispatch"),yJt=class extends kss{static{a(this,"DispatcherBase")}constructor(){super(),this[Que]=!1,this[j3]=null,this[_we]=!1,this[que]=[]}get destroyed(){return this[Que]}get closed(){return this[_we]}get interceptors(){return this[KK]}set interceptors(e){if(e){for(let r=e.length-1;r>=0;r--)if(typeof this[KK][r]!="function")throw new Uue("interceptor must be an function")}this[KK]=e}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new Uue("invalid callback");if(this[Que]){queueMicrotask(()=>e(new gJt,null));return}if(this[_we]){this[que]?this[que].push(e):queueMicrotask(()=>e(null,null));return}this[_we]=!0,this[que].push(e);let r=a(()=>{let n=this[que];this[que]=null;for(let o=0;othis.destroy()).then(()=>{queueMicrotask(r)})}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new Uue("invalid callback");if(this[Que]){this[j3]?this[j3].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new gJt),this[Que]=!0,this[j3]=this[j3]||[],this[j3].push(r);let n=a(()=>{let o=this[j3];this[j3]=null;for(let s=0;s{queueMicrotask(n)})}[xtt](e,r){if(!this[KK]||this[KK].length===0)return this[xtt]=this[AJt],this[AJt](e,r);let n=this[AJt].bind(this);for(let o=this[KK].length-1;o>=0;o--)n=this[KK][o](n);return this[xtt]=n,n(e,r)}dispatch(e,r){if(!r||typeof r!="object")throw new Uue("handler must be an object");try{if(!e||typeof e!="object")throw new Uue("opts must be an object.");if(this[Que]||this[j3])throw new gJt;if(this[_we])throw new Dss;return this[xtt](e,r)}catch(n){if(typeof r.onError!="function")throw new Uue("invalid onError method");return r.onError(n),!1}}};kPn.exports=yJt});var TJt=I((qHd,OPn)=>{"use strict";p();var Hue=0,EJt=1e3,_Jt=(EJt>>1)-1,H3,vJt=Symbol("kFastTimer"),G3=[],CJt=-2,bJt=-1,NPn=0,DPn=1;function SJt(){Hue+=_Jt;let t=0,e=G3.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=bJt,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===bJt?(r._state=CJt,--e!==0&&(G3[t]=G3[e])):++t}G3.length=e,G3.length!==0&&MPn()}a(SJt,"onTick");function MPn(){H3?H3.refresh():(clearTimeout(H3),H3=setTimeout(SJt,_Jt),H3.unref&&H3.unref())}a(MPn,"refreshTimeout");var wtt=class{static{a(this,"FastTimer")}[vJt]=!0;_state=CJt;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===CJt&&G3.push(this),(!H3||G3.length===1)&&MPn(),this._state=NPn}clear(){this._state=bJt,this._idleStart=-1}};OPn.exports={setTimeout(t,e,r){return e<=EJt?setTimeout(t,e,r):new wtt(t,e,r)},clearTimeout(t){t[vJt]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new wtt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Hue},tick(t=0){Hue+=t-EJt+1,SJt(),SJt()},reset(){Hue=0,G3.length=0,clearTimeout(H3),H3=null},kFastTimer:vJt}});var vwe=I((VHd,QPn)=>{"use strict";p();var Oss=require("node:net"),BPn=require("node:assert"),UPn=Os(),{InvalidArgumentError:Bss,ConnectTimeoutError:Lss}=mc(),Rtt=TJt();function LPn(){}a(LPn,"noop");var IJt,xJt;global.FinalizationRegistry&&!(process.env.NODE_V8_COVERAGE||process.env.UNDICI_NO_FG)?xJt=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new global.FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){let{value:n}=this._sessionCache.keys().next();this._sessionCache.delete(n)}this._sessionCache.set(e,r)}}};function Fss({allowH2:t,maxCachedSessions:e,socketPath:r,timeout:n,session:o,...s}){if(e!=null&&(!Number.isInteger(e)||e<0))throw new Bss("maxCachedSessions must be a positive integer or zero");let c={path:r,...s},l=new xJt(e??100);return n=n??1e4,t=t??!1,a(function({hostname:d,host:f,protocol:h,port:m,servername:g,localAddress:A,httpSocket:y},E){let _;if(h==="https:"){IJt||(IJt=require("node:tls")),g=g||c.servername||UPn.getServerName(f)||null;let b=g||d;BPn(b);let T=o||l.get(b)||null;m=m||443,_=IJt.connect({highWaterMark:16384,...c,servername:g,session:T,localAddress:A,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:y,port:m,host:d}),_.on("session",function(w){l.set(b,w)})}else BPn(!y,"httpSocket can only be sent on TLS update"),m=m||80,_=Oss.connect({highWaterMark:64*1024,...c,localAddress:A,port:m,host:d});if(c.keepAlive==null||c.keepAlive){let b=c.keepAliveInitialDelay===void 0?6e4:c.keepAliveInitialDelay;_.setKeepAlive(!0,b)}let v=Uss(new WeakRef(_),{timeout:n,hostname:d,port:m});return _.setNoDelay(!0).once(h==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(v),E){let b=E;E=null,b(null,this)}}).on("error",function(b){if(queueMicrotask(v),E){let T=E;E=null,T(b)}}),_},"connect")}a(Fss,"buildConnector");var Uss=process.platform==="win32"?(t,e)=>{if(!e.timeout)return LPn;let r=null,n=null,o=Rtt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>FPn(t.deref(),e))})},e.timeout);return()=>{Rtt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return LPn;let r=null,n=Rtt.setFastTimeout(()=>{r=setImmediate(()=>{FPn(t.deref(),e)})},e.timeout);return()=>{Rtt.clearFastTimeout(n),clearImmediate(r)}};function FPn(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,UPn.destroy(t,new Lss(r))}a(FPn,"onConnectTimeout");QPn.exports=Fss});var qPn=I(Ptt=>{"use strict";p();Object.defineProperty(Ptt,"__esModule",{value:!0});Ptt.enumToMap=void 0;function Qss(t){let e={};return Object.keys(t).forEach(r=>{let n=t[r];typeof n=="number"&&(e[r]=n)}),e}a(Qss,"enumToMap");Ptt.enumToMap=Qss});var jPn=I(Pr=>{"use strict";p();Object.defineProperty(Pr,"__esModule",{value:!0});Pr.SPECIAL_HEADERS=Pr.HEADER_STATE=Pr.MINOR=Pr.MAJOR=Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS=Pr.TOKEN=Pr.STRICT_TOKEN=Pr.HEX=Pr.URL_CHAR=Pr.STRICT_URL_CHAR=Pr.USERINFO_CHARS=Pr.MARK=Pr.ALPHANUM=Pr.NUM=Pr.HEX_MAP=Pr.NUM_MAP=Pr.ALPHA=Pr.FINISH=Pr.H_METHOD_MAP=Pr.METHOD_MAP=Pr.METHODS_RTSP=Pr.METHODS_ICE=Pr.METHODS_HTTP=Pr.METHODS=Pr.LENIENT_FLAGS=Pr.FLAGS=Pr.TYPE=Pr.ERROR=void 0;var qss=qPn(),jss;(function(t){t[t.OK=0]="OK",t[t.INTERNAL=1]="INTERNAL",t[t.STRICT=2]="STRICT",t[t.LF_EXPECTED=3]="LF_EXPECTED",t[t.UNEXPECTED_CONTENT_LENGTH=4]="UNEXPECTED_CONTENT_LENGTH",t[t.CLOSED_CONNECTION=5]="CLOSED_CONNECTION",t[t.INVALID_METHOD=6]="INVALID_METHOD",t[t.INVALID_URL=7]="INVALID_URL",t[t.INVALID_CONSTANT=8]="INVALID_CONSTANT",t[t.INVALID_VERSION=9]="INVALID_VERSION",t[t.INVALID_HEADER_TOKEN=10]="INVALID_HEADER_TOKEN",t[t.INVALID_CONTENT_LENGTH=11]="INVALID_CONTENT_LENGTH",t[t.INVALID_CHUNK_SIZE=12]="INVALID_CHUNK_SIZE",t[t.INVALID_STATUS=13]="INVALID_STATUS",t[t.INVALID_EOF_STATE=14]="INVALID_EOF_STATE",t[t.INVALID_TRANSFER_ENCODING=15]="INVALID_TRANSFER_ENCODING",t[t.CB_MESSAGE_BEGIN=16]="CB_MESSAGE_BEGIN",t[t.CB_HEADERS_COMPLETE=17]="CB_HEADERS_COMPLETE",t[t.CB_MESSAGE_COMPLETE=18]="CB_MESSAGE_COMPLETE",t[t.CB_CHUNK_HEADER=19]="CB_CHUNK_HEADER",t[t.CB_CHUNK_COMPLETE=20]="CB_CHUNK_COMPLETE",t[t.PAUSED=21]="PAUSED",t[t.PAUSED_UPGRADE=22]="PAUSED_UPGRADE",t[t.PAUSED_H2_UPGRADE=23]="PAUSED_H2_UPGRADE",t[t.USER=24]="USER"})(jss=Pr.ERROR||(Pr.ERROR={}));var Hss;(function(t){t[t.BOTH=0]="BOTH",t[t.REQUEST=1]="REQUEST",t[t.RESPONSE=2]="RESPONSE"})(Hss=Pr.TYPE||(Pr.TYPE={}));var Gss;(function(t){t[t.CONNECTION_KEEP_ALIVE=1]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=2]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=4]="CONNECTION_UPGRADE",t[t.CHUNKED=8]="CHUNKED",t[t.UPGRADE=16]="UPGRADE",t[t.CONTENT_LENGTH=32]="CONTENT_LENGTH",t[t.SKIPBODY=64]="SKIPBODY",t[t.TRAILING=128]="TRAILING",t[t.TRANSFER_ENCODING=512]="TRANSFER_ENCODING"})(Gss=Pr.FLAGS||(Pr.FLAGS={}));var $ss;(function(t){t[t.HEADERS=1]="HEADERS",t[t.CHUNKED_LENGTH=2]="CHUNKED_LENGTH",t[t.KEEP_ALIVE=4]="KEEP_ALIVE"})($ss=Pr.LENIENT_FLAGS||(Pr.LENIENT_FLAGS={}));var ki;(function(t){t[t.DELETE=0]="DELETE",t[t.GET=1]="GET",t[t.HEAD=2]="HEAD",t[t.POST=3]="POST",t[t.PUT=4]="PUT",t[t.CONNECT=5]="CONNECT",t[t.OPTIONS=6]="OPTIONS",t[t.TRACE=7]="TRACE",t[t.COPY=8]="COPY",t[t.LOCK=9]="LOCK",t[t.MKCOL=10]="MKCOL",t[t.MOVE=11]="MOVE",t[t.PROPFIND=12]="PROPFIND",t[t.PROPPATCH=13]="PROPPATCH",t[t.SEARCH=14]="SEARCH",t[t.UNLOCK=15]="UNLOCK",t[t.BIND=16]="BIND",t[t.REBIND=17]="REBIND",t[t.UNBIND=18]="UNBIND",t[t.ACL=19]="ACL",t[t.REPORT=20]="REPORT",t[t.MKACTIVITY=21]="MKACTIVITY",t[t.CHECKOUT=22]="CHECKOUT",t[t.MERGE=23]="MERGE",t[t["M-SEARCH"]=24]="M-SEARCH",t[t.NOTIFY=25]="NOTIFY",t[t.SUBSCRIBE=26]="SUBSCRIBE",t[t.UNSUBSCRIBE=27]="UNSUBSCRIBE",t[t.PATCH=28]="PATCH",t[t.PURGE=29]="PURGE",t[t.MKCALENDAR=30]="MKCALENDAR",t[t.LINK=31]="LINK",t[t.UNLINK=32]="UNLINK",t[t.SOURCE=33]="SOURCE",t[t.PRI=34]="PRI",t[t.DESCRIBE=35]="DESCRIBE",t[t.ANNOUNCE=36]="ANNOUNCE",t[t.SETUP=37]="SETUP",t[t.PLAY=38]="PLAY",t[t.PAUSE=39]="PAUSE",t[t.TEARDOWN=40]="TEARDOWN",t[t.GET_PARAMETER=41]="GET_PARAMETER",t[t.SET_PARAMETER=42]="SET_PARAMETER",t[t.REDIRECT=43]="REDIRECT",t[t.RECORD=44]="RECORD",t[t.FLUSH=45]="FLUSH"})(ki=Pr.METHODS||(Pr.METHODS={}));Pr.METHODS_HTTP=[ki.DELETE,ki.GET,ki.HEAD,ki.POST,ki.PUT,ki.CONNECT,ki.OPTIONS,ki.TRACE,ki.COPY,ki.LOCK,ki.MKCOL,ki.MOVE,ki.PROPFIND,ki.PROPPATCH,ki.SEARCH,ki.UNLOCK,ki.BIND,ki.REBIND,ki.UNBIND,ki.ACL,ki.REPORT,ki.MKACTIVITY,ki.CHECKOUT,ki.MERGE,ki["M-SEARCH"],ki.NOTIFY,ki.SUBSCRIBE,ki.UNSUBSCRIBE,ki.PATCH,ki.PURGE,ki.MKCALENDAR,ki.LINK,ki.UNLINK,ki.PRI,ki.SOURCE];Pr.METHODS_ICE=[ki.SOURCE];Pr.METHODS_RTSP=[ki.OPTIONS,ki.DESCRIBE,ki.ANNOUNCE,ki.SETUP,ki.PLAY,ki.PAUSE,ki.TEARDOWN,ki.GET_PARAMETER,ki.SET_PARAMETER,ki.REDIRECT,ki.RECORD,ki.FLUSH,ki.GET,ki.POST];Pr.METHOD_MAP=qss.enumToMap(ki);Pr.H_METHOD_MAP={};Object.keys(Pr.METHOD_MAP).forEach(t=>{/^H/.test(t)&&(Pr.H_METHOD_MAP[t]=Pr.METHOD_MAP[t])});var Vss;(function(t){t[t.SAFE=0]="SAFE",t[t.SAFE_WITH_CB=1]="SAFE_WITH_CB",t[t.UNSAFE=2]="UNSAFE"})(Vss=Pr.FINISH||(Pr.FINISH={}));Pr.ALPHA=[];for(let t=65;t<=90;t++)Pr.ALPHA.push(String.fromCharCode(t)),Pr.ALPHA.push(String.fromCharCode(t+32));Pr.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pr.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Pr.NUM=["0","1","2","3","4","5","6","7","8","9"];Pr.ALPHANUM=Pr.ALPHA.concat(Pr.NUM);Pr.MARK=["-","_",".","!","~","*","'","(",")"];Pr.USERINFO_CHARS=Pr.ALPHANUM.concat(Pr.MARK).concat(["%",";",":","&","=","+","$",","]);Pr.STRICT_URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pr.ALPHANUM);Pr.URL_CHAR=Pr.STRICT_URL_CHAR.concat([" ","\f"]);for(let t=128;t<=255;t++)Pr.URL_CHAR.push(t);Pr.HEX=Pr.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pr.STRICT_TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pr.ALPHANUM);Pr.TOKEN=Pr.STRICT_TOKEN.concat([" "]);Pr.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pr.HEADER_CHARS.push(t);Pr.CONNECTION_TOKEN_CHARS=Pr.HEADER_CHARS.filter(t=>t!==44);Pr.MAJOR=Pr.NUM_MAP;Pr.MINOR=Pr.MAJOR;var Gue;(function(t){t[t.GENERAL=0]="GENERAL",t[t.CONNECTION=1]="CONNECTION",t[t.CONTENT_LENGTH=2]="CONTENT_LENGTH",t[t.TRANSFER_ENCODING=3]="TRANSFER_ENCODING",t[t.UPGRADE=4]="UPGRADE",t[t.CONNECTION_KEEP_ALIVE=5]="CONNECTION_KEEP_ALIVE",t[t.CONNECTION_CLOSE=6]="CONNECTION_CLOSE",t[t.CONNECTION_UPGRADE=7]="CONNECTION_UPGRADE",t[t.TRANSFER_ENCODING_CHUNKED=8]="TRANSFER_ENCODING_CHUNKED"})(Gue=Pr.HEADER_STATE||(Pr.HEADER_STATE={}));Pr.SPECIAL_HEADERS={connection:Gue.CONNECTION,"content-length":Gue.CONTENT_LENGTH,"proxy-connection":Gue.CONNECTION,"transfer-encoding":Gue.TRANSFER_ENCODING,upgrade:Gue.UPGRADE}});var wJt=I((eGd,HPn)=>{"use strict";p();var{Buffer:Wss}=require("node:buffer");HPn.exports=Wss.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK07MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtXACAAQRhqQgA3AwAgAEIANwMAIABBOGpCADcDACAAQTBqQgA3AwAgAEEoakIANwMAIABBIGpCADcDACAAQRBqQgA3AwAgAEEIakIANwMAIABB3QE2AhwLBgAgABAyC5otAQt/IwBBEGsiCiQAQaTQACgCACIJRQRAQeTTACgCACIFRQRAQfDTAEJ/NwIAQejTAEKAgISAgIDAADcCAEHk0wAgCkEIakFwcUHYqtWqBXMiBTYCAEH40wBBADYCAEHI0wBBADYCAAtBzNMAQYDUBDYCAEGc0ABBgNQENgIAQbDQACAFNgIAQazQAEF/NgIAQdDTAEGArAM2AgADQCABQcjQAGogAUG80ABqIgI2AgAgAiABQbTQAGoiAzYCACABQcDQAGogAzYCACABQdDQAGogAUHE0ABqIgM2AgAgAyACNgIAIAFB2NAAaiABQczQAGoiAjYCACACIAM2AgAgAUHU0ABqIAI2AgAgAUEgaiIBQYACRw0AC0GM1ARBwasDNgIAQajQAEH00wAoAgA2AgBBmNAAQcCrAzYCAEGk0ABBiNQENgIAQcz/B0E4NgIAQYjUBCEJCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFNBEBBjNAAKAIAIgZBECAAQRNqQXBxIABBC0kbIgRBA3YiAHYiAUEDcQRAAkAgAUEBcSAAckEBcyICQQN0IgBBtNAAaiIBIABBvNAAaigCACIAKAIIIgNGBEBBjNAAIAZBfiACd3E2AgAMAQsgASADNgIIIAMgATYCDAsgAEEIaiEBIAAgAkEDdCICQQNyNgIEIAAgAmoiACAAKAIEQQFyNgIEDBELQZTQACgCACIIIARPDQEgAQRAAkBBAiAAdCICQQAgAmtyIAEgAHRxaCIAQQN0IgJBtNAAaiIBIAJBvNAAaigCACICKAIIIgNGBEBBjNAAIAZBfiAAd3EiBjYCAAwBCyABIAM2AgggAyABNgIMCyACIARBA3I2AgQgAEEDdCIAIARrIQUgACACaiAFNgIAIAIgBGoiBCAFQQFyNgIEIAgEQCAIQXhxQbTQAGohAEGg0AAoAgAhAwJ/QQEgCEEDdnQiASAGcUUEQEGM0AAgASAGcjYCACAADAELIAAoAggLIgEgAzYCDCAAIAM2AgggAyAANgIMIAMgATYCCAsgAkEIaiEBQaDQACAENgIAQZTQACAFNgIADBELQZDQACgCACILRQ0BIAtoQQJ0QbzSAGooAgAiACgCBEF4cSAEayEFIAAhAgNAAkAgAigCECIBRQRAIAJBFGooAgAiAUUNAQsgASgCBEF4cSAEayIDIAVJIQIgAyAFIAIbIQUgASAAIAIbIQAgASECDAELCyAAKAIYIQkgACgCDCIDIABHBEBBnNAAKAIAGiADIAAoAggiATYCCCABIAM2AgwMEAsgAEEUaiICKAIAIgFFBEAgACgCECIBRQ0DIABBEGohAgsDQCACIQcgASIDQRRqIgIoAgAiAQ0AIANBEGohAiADKAIQIgENAAsgB0EANgIADA8LQX8hBCAAQb9/Sw0AIABBE2oiAUFwcSEEQZDQACgCACIIRQ0AQQAgBGshBQJAAkACQAJ/QQAgBEGAAkkNABpBHyAEQf///wdLDQAaIARBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmoLIgZBAnRBvNIAaigCACICRQRAQQAhAUEAIQMMAQtBACEBIARBGSAGQQF2a0EAIAZBH0cbdCEAQQAhAwNAAkAgAigCBEF4cSAEayIHIAVPDQAgAiEDIAciBQ0AQQAhBSACIQEMAwsgASACQRRqKAIAIgcgByACIABBHXZBBHFqQRBqKAIAIgJGGyABIAcbIQEgAEEBdCEAIAINAAsLIAEgA3JFBEBBACEDQQIgBnQiAEEAIABrciAIcSIARQ0DIABoQQJ0QbzSAGooAgAhAQsgAUUNAQsDQCABKAIEQXhxIARrIgIgBUkhACACIAUgABshBSABIAMgABshAyABKAIQIgAEfyAABSABQRRqKAIACyIBDQALCyADRQ0AIAVBlNAAKAIAIARrTw0AIAMoAhghByADIAMoAgwiAEcEQEGc0AAoAgAaIAAgAygCCCIBNgIIIAEgADYCDAwOCyADQRRqIgIoAgAiAUUEQCADKAIQIgFFDQMgA0EQaiECCwNAIAIhBiABIgBBFGoiAigCACIBDQAgAEEQaiECIAAoAhAiAQ0ACyAGQQA2AgAMDQtBlNAAKAIAIgMgBE8EQEGg0AAoAgAhAQJAIAMgBGsiAkEQTwRAIAEgBGoiACACQQFyNgIEIAEgA2ogAjYCACABIARBA3I2AgQMAQsgASADQQNyNgIEIAEgA2oiACAAKAIEQQFyNgIEQQAhAEEAIQILQZTQACACNgIAQaDQACAANgIAIAFBCGohAQwPC0GY0AAoAgAiAyAESwRAIAQgCWoiACADIARrIgFBAXI2AgRBpNAAIAA2AgBBmNAAIAE2AgAgCSAEQQNyNgIEIAlBCGohAQwPC0EAIQEgBAJ/QeTTACgCAARAQezTACgCAAwBC0Hw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBDGpBcHFB2KrVqgVzNgIAQfjTAEEANgIAQcjTAEEANgIAQYCABAsiACAEQccAaiIFaiIGQQAgAGsiB3EiAk8EQEH80wBBMDYCAAwPCwJAQcTTACgCACIBRQ0AQbzTACgCACIIIAJqIQAgACABTSAAIAhLcQ0AQQAhAUH80wBBMDYCAAwPC0HI0wAtAABBBHENBAJAAkAgCQRAQczTACEBA0AgASgCACIAIAlNBEAgACABKAIEaiAJSw0DCyABKAIIIgENAAsLQQAQMyIAQX9GDQUgAiEGQejTACgCACIBQQFrIgMgAHEEQCACIABrIAAgA2pBACABa3FqIQYLIAQgBk8NBSAGQf7///8HSw0FQcTTACgCACIDBEBBvNMAKAIAIgcgBmohASABIAdNDQYgASADSw0GCyAGEDMiASAARw0BDAcLIAYgA2sgB3EiBkH+////B0sNBCAGEDMhACAAIAEoAgAgASgCBGpGDQMgACEBCwJAIAYgBEHIAGpPDQAgAUF/Rg0AQezTACgCACIAIAUgBmtqQQAgAGtxIgBB/v///wdLBEAgASEADAcLIAAQM0F/RwRAIAAgBmohBiABIQAMBwtBACAGaxAzGgwECyABIgBBf0cNBQwDC0EAIQMMDAtBACEADAoLIABBf0cNAgtByNMAQcjTACgCAEEEcjYCAAsgAkH+////B0sNASACEDMhAEEAEDMhASAAQX9GDQEgAUF/Rg0BIAAgAU8NASABIABrIgYgBEE4ak0NAQtBvNMAQbzTACgCACAGaiIBNgIAQcDTACgCACABSQRAQcDTACABNgIACwJAAkACQEGk0AAoAgAiAgRAQczTACEBA0AgACABKAIAIgMgASgCBCIFakYNAiABKAIIIgENAAsMAgtBnNAAKAIAIgFBAEcgACABT3FFBEBBnNAAIAA2AgALQQAhAUHQ0wAgBjYCAEHM0wAgADYCAEGs0ABBfzYCAEGw0ABB5NMAKAIANgIAQdjTAEEANgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBeCAAa0EPcSIBIABqIgIgBkE4ayIDIAFrIgFBAXI2AgRBqNAAQfTTACgCADYCAEGY0AAgATYCAEGk0AAgAjYCACAAIANqQTg2AgQMAgsgACACTQ0AIAIgA0kNACABKAIMQQhxDQBBeCACa0EPcSIAIAJqIgNBmNAAKAIAIAZqIgcgAGsiAEEBcjYCBCABIAUgBmo2AgRBqNAAQfTTACgCADYCAEGY0AAgADYCAEGk0AAgAzYCACACIAdqQTg2AgQMAQsgAEGc0AAoAgBJBEBBnNAAIAA2AgALIAAgBmohA0HM0wAhAQJAAkACQANAIAMgASgCAEcEQCABKAIIIgENAQwCCwsgAS0ADEEIcUUNAQtBzNMAIQEDQCABKAIAIgMgAk0EQCADIAEoAgRqIgUgAksNAwsgASgCCCEBDAALAAsgASAANgIAIAEgASgCBCAGajYCBCAAQXggAGtBD3FqIgkgBEEDcjYCBCADQXggA2tBD3FqIgYgBCAJaiIEayEBIAIgBkYEQEGk0AAgBDYCAEGY0ABBmNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEDAgLQaDQACgCACAGRgRAQaDQACAENgIAQZTQAEGU0AAoAgAgAWoiADYCACAEIABBAXI2AgQgACAEaiAANgIADAgLIAYoAgQiBUEDcUEBRw0GIAVBeHEhCCAFQf8BTQRAIAVBA3YhAyAGKAIIIgAgBigCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBwsgAiAANgIIIAAgAjYCDAwGCyAGKAIYIQcgBiAGKAIMIgBHBEAgACAGKAIIIgI2AgggAiAANgIMDAULIAZBFGoiAigCACIFRQRAIAYoAhAiBUUNBCAGQRBqIQILA0AgAiEDIAUiAEEUaiICKAIAIgUNACAAQRBqIQIgACgCECIFDQALIANBADYCAAwEC0F4IABrQQ9xIgEgAGoiByAGQThrIgMgAWsiAUEBcjYCBCAAIANqQTg2AgQgAiAFQTcgBWtBD3FqQT9rIgMgAyACQRBqSRsiA0EjNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAc2AgAgA0EQakHU0wApAgA3AgAgA0HM0wApAgA3AghB1NMAIANBCGo2AgBB0NMAIAY2AgBBzNMAIAA2AgBB2NMAQQA2AgAgA0EkaiEBA0AgAUEHNgIAIAUgAUEEaiIBSw0ACyACIANGDQAgAyADKAIEQX5xNgIEIAMgAyACayIFNgIAIAIgBUEBcjYCBCAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIDcUUEQEGM0AAgASADcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEGQ0AAoAgAiA0EBIAF0IgZxRQRAIAAgAjYCAEGQ0AAgAyAGcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQMCQANAIAMiACgCBEF4cSAFRg0BIAFBHXYhAyABQQF0IQEgACADQQRxakEQaiIGKAIAIgMNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAtBmNAAKAIAIgEgBE0NAEGk0AAoAgAiACAEaiICIAEgBGsiAUEBcjYCBEGY0AAgATYCAEGk0AAgAjYCACAAIARBA3I2AgQgAEEIaiEBDAgLQQAhAUH80wBBMDYCAAwHC0EAIQALIAdFDQACQCAGKAIcIgJBAnRBvNIAaiIDKAIAIAZGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAdBEEEUIAcoAhAgBkYbaiAANgIAIABFDQELIAAgBzYCGCAGKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAGQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAIaiEBIAYgCGoiBigCBCEFCyAGIAVBfnE2AgQgASAEaiABNgIAIAQgAUEBcjYCBCABQf8BTQRAIAFBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASABQQN2dCIBcUUEQEGM0AAgASACcjYCACAADAELIAAoAggLIgEgBDYCDCAAIAQ2AgggBCAANgIMIAQgATYCCAwBC0EfIQUgAUH///8HTQRAIAFBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohBQsgBCAFNgIcIARCADcCECAFQQJ0QbzSAGohAEGQ0AAoAgAiAkEBIAV0IgNxRQRAIAAgBDYCAEGQ0AAgAiADcjYCACAEIAA2AhggBCAENgIIIAQgBDYCDAwBCyABQRkgBUEBdmtBACAFQR9HG3QhBSAAKAIAIQACQANAIAAiAigCBEF4cSABRg0BIAVBHXYhACAFQQF0IQUgAiAAQQRxakEQaiIDKAIAIgANAAsgAyAENgIAIAQgAjYCGCAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgCUEIaiEBDAILAkAgB0UNAAJAIAMoAhwiAUECdEG80gBqIgIoAgAgA0YEQCACIAA2AgAgAA0BQZDQACAIQX4gAXdxIgg2AgAMAgsgB0EQQRQgBygCECADRhtqIAA2AgAgAEUNAQsgACAHNgIYIAMoAhAiAQRAIAAgATYCECABIAA2AhgLIANBFGooAgAiAUUNACAAQRRqIAE2AgAgASAANgIYCwJAIAVBD00EQCADIAQgBWoiAEEDcjYCBCAAIANqIgAgACgCBEEBcjYCBAwBCyADIARqIgIgBUEBcjYCBCADIARBA3I2AgQgAiAFaiAFNgIAIAVB/wFNBEAgBUF4cUG00ABqIQACf0GM0AAoAgAiAUEBIAVBA3Z0IgVxRQRAQYzQACABIAVyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRBvNIAaiEAQQEgAXQiBCAIcUUEQCAAIAI2AgBBkNAAIAQgCHI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEEAkADQCAEIgAoAgRBeHEgBUYNASABQR12IQQgAUEBdCEBIAAgBEEEcWpBEGoiBigCACIEDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLIANBCGohAQwBCwJAIAlFDQACQCAAKAIcIgFBAnRBvNIAaiICKAIAIABGBEAgAiADNgIAIAMNAUGQ0AAgC0F+IAF3cTYCAAwCCyAJQRBBFCAJKAIQIABGG2ogAzYCACADRQ0BCyADIAk2AhggACgCECIBBEAgAyABNgIQIAEgAzYCGAsgAEEUaigCACIBRQ0AIANBFGogATYCACABIAM2AhgLAkAgBUEPTQRAIAAgBCAFaiIBQQNyNgIEIAAgAWoiASABKAIEQQFyNgIEDAELIAAgBGoiByAFQQFyNgIEIAAgBEEDcjYCBCAFIAdqIAU2AgAgCARAIAhBeHFBtNAAaiEBQaDQACgCACEDAn9BASAIQQN2dCICIAZxRQRAQYzQACACIAZyNgIAIAEMAQsgASgCCAsiAiADNgIMIAEgAzYCCCADIAE2AgwgAyACNgIIC0Gg0AAgBzYCAEGU0AAgBTYCAAsgAEEIaiEBCyAKQRBqJAAgAQtDACAARQRAPwBBEHQPCwJAIABB//8DcQ0AIABBAEgNACAAQRB2QAAiAEF/RgRAQfzTAEEwNgIAQX8PCyAAQRB0DwsACwvcPyIAQYAICwkBAAAAAgAAAAMAQZQICwUEAAAABQBBpAgLCQYAAAAHAAAACABB3AgLii1JbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AFJlc3BvbnNlIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zAFVzZXIgY2FsbGJhY2sgZXJyb3IAYG9uX3Jlc2V0YCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfaGVhZGVyYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9iZWdpbmAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3N0YXR1c19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3ZlcnNpb25fY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl91cmxfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXRob2RfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfZmllbGRfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fbmFtZWAgY2FsbGJhY2sgZXJyb3IAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzZXJ2ZXIASW52YWxpZCBoZWFkZXIgdmFsdWUgY2hhcgBJbnZhbGlkIGhlYWRlciBmaWVsZCBjaGFyAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdmVyc2lvbgBJbnZhbGlkIG1pbm9yIHZlcnNpb24ASW52YWxpZCBtYWpvciB2ZXJzaW9uAEV4cGVjdGVkIHNwYWNlIGFmdGVyIHZlcnNpb24ARXhwZWN0ZWQgQ1JMRiBhZnRlciB2ZXJzaW9uAEludmFsaWQgSFRUUCB2ZXJzaW9uAEludmFsaWQgaGVhZGVyIHRva2VuAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fdXJsAEludmFsaWQgY2hhcmFjdGVycyBpbiB1cmwAVW5leHBlY3RlZCBzdGFydCBjaGFyIGluIHVybABEb3VibGUgQCBpbiB1cmwARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgARHVwbGljYXRlIENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhciBpbiB1cmwgcGF0aABDb250ZW50LUxlbmd0aCBjYW4ndCBiZSBwcmVzZW50IHdpdGggVHJhbnNmZXItRW5jb2RpbmcASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgc2l6ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl92YWx1ZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlZCB2YWx1ZQBQYXVzZWQgYnkgb25faGVhZGVyc19jb21wbGV0ZQBJbnZhbGlkIEVPRiBzdGF0ZQBvbl9yZXNldCBwYXVzZQBvbl9jaHVua19oZWFkZXIgcGF1c2UAb25fbWVzc2FnZV9iZWdpbiBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fdmFsdWUgcGF1c2UAb25fc3RhdHVzX2NvbXBsZXRlIHBhdXNlAG9uX3ZlcnNpb25fY29tcGxldGUgcGF1c2UAb25fdXJsX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl92YWx1ZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXNzYWdlX2NvbXBsZXRlIHBhdXNlAG9uX21ldGhvZF9jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfZmllbGRfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUgcGF1c2UAVW5leHBlY3RlZCBzcGFjZSBhZnRlciBzdGFydCBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAFBhdXNlIG9uIENPTk5FQ1QvVXBncmFkZQBQYXVzZSBvbiBQUkkvVXBncmFkZQBFeHBlY3RlZCBIVFRQLzIgQ29ubmVjdGlvbiBQcmVmYWNlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fbWV0aG9kAEV4cGVjdGVkIHNwYWNlIGFmdGVyIG1ldGhvZABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2hlYWRlcl9maWVsZABQYXVzZWQASW52YWxpZCB3b3JkIGVuY291bnRlcmVkAEludmFsaWQgbWV0aG9kIGVuY291bnRlcmVkAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2NoZW1hAFJlcXVlc3QgaGFzIGludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYABTV0lUQ0hfUFJPWFkAVVNFX1BST1hZAE1LQUNUSVZJVFkAVU5QUk9DRVNTQUJMRV9FTlRJVFkAQ09QWQBNT1ZFRF9QRVJNQU5FTlRMWQBUT09fRUFSTFkATk9USUZZAEZBSUxFRF9ERVBFTkRFTkNZAEJBRF9HQVRFV0FZAFBMQVkAUFVUAENIRUNLT1VUAEdBVEVXQVlfVElNRU9VVABSRVFVRVNUX1RJTUVPVVQATkVUV09SS19DT05ORUNUX1RJTUVPVVQAQ09OTkVDVElPTl9USU1FT1VUAExPR0lOX1RJTUVPVVQATkVUV09SS19SRUFEX1RJTUVPVVQAUE9TVABNSVNESVJFQ1RFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX0xPQURfQkFMQU5DRURfUkVRVUVTVABCQURfUkVRVUVTVABIVFRQX1JFUVVFU1RfU0VOVF9UT19IVFRQU19QT1JUAFJFUE9SVABJTV9BX1RFQVBPVABSRVNFVF9DT05URU5UAE5PX0NPTlRFTlQAUEFSVElBTF9DT05URU5UAEhQRV9JTlZBTElEX0NPTlNUQU5UAEhQRV9DQl9SRVNFVABHRVQASFBFX1NUUklDVABDT05GTElDVABURU1QT1JBUllfUkVESVJFQ1QAUEVSTUFORU5UX1JFRElSRUNUAENPTk5FQ1QATVVMVElfU1RBVFVTAEhQRV9JTlZBTElEX1NUQVRVUwBUT09fTUFOWV9SRVFVRVNUUwBFQVJMWV9ISU5UUwBVTkFWQUlMQUJMRV9GT1JfTEVHQUxfUkVBU09OUwBPUFRJT05TAFNXSVRDSElOR19QUk9UT0NPTFMAVkFSSUFOVF9BTFNPX05FR09USUFURVMATVVMVElQTEVfQ0hPSUNFUwBJTlRFUk5BTF9TRVJWRVJfRVJST1IAV0VCX1NFUlZFUl9VTktOT1dOX0VSUk9SAFJBSUxHVU5fRVJST1IASURFTlRJVFlfUFJPVklERVJfQVVUSEVOVElDQVRJT05fRVJST1IAU1NMX0NFUlRJRklDQVRFX0VSUk9SAElOVkFMSURfWF9GT1JXQVJERURfRk9SAFNFVF9QQVJBTUVURVIAR0VUX1BBUkFNRVRFUgBIUEVfVVNFUgBTRUVfT1RIRVIASFBFX0NCX0NIVU5LX0hFQURFUgBNS0NBTEVOREFSAFNFVFVQAFdFQl9TRVJWRVJfSVNfRE9XTgBURUFSRE9XTgBIUEVfQ0xPU0VEX0NPTk5FQ1RJT04ASEVVUklTVElDX0VYUElSQVRJT04ARElTQ09OTkVDVEVEX09QRVJBVElPTgBOT05fQVVUSE9SSVRBVElWRV9JTkZPUk1BVElPTgBIUEVfSU5WQUxJRF9WRVJTSU9OAEhQRV9DQl9NRVNTQUdFX0JFR0lOAFNJVEVfSVNfRlJPWkVOAEhQRV9JTlZBTElEX0hFQURFUl9UT0tFTgBJTlZBTElEX1RPS0VOAEZPUkJJRERFTgBFTkhBTkNFX1lPVVJfQ0FMTQBIUEVfSU5WQUxJRF9VUkwAQkxPQ0tFRF9CWV9QQVJFTlRBTF9DT05UUk9MAE1LQ09MAEFDTABIUEVfSU5URVJOQUwAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRV9VTk9GRklDSUFMAEhQRV9PSwBVTkxJTksAVU5MT0NLAFBSSQBSRVRSWV9XSVRIAEhQRV9JTlZBTElEX0NPTlRFTlRfTEVOR1RIAEhQRV9VTkVYUEVDVEVEX0NPTlRFTlRfTEVOR1RIAEZMVVNIAFBST1BQQVRDSABNLVNFQVJDSABVUklfVE9PX0xPTkcAUFJPQ0VTU0lORwBNSVNDRUxMQU5FT1VTX1BFUlNJU1RFTlRfV0FSTklORwBNSVNDRUxMQU5FT1VTX1dBUk5JTkcASFBFX0lOVkFMSURfVFJBTlNGRVJfRU5DT0RJTkcARXhwZWN0ZWQgQ1JMRgBIUEVfSU5WQUxJRF9DSFVOS19TSVpFAE1PVkUAQ09OVElOVUUASFBFX0NCX1NUQVRVU19DT01QTEVURQBIUEVfQ0JfSEVBREVSU19DT01QTEVURQBIUEVfQ0JfVkVSU0lPTl9DT01QTEVURQBIUEVfQ0JfVVJMX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8AAF4TAAAmEwAAMBAAAPAXAACdEwAAFRIAADkXAADwEgAAChAAAHUSAACtEgAAghMAAE8UAAB/EAAAoBUAACMUAACJEgAAixQAAE0VAADUEQAAzxQAABAYAADJFgAA3BYAAMERAADgFwAAuxQAAHQUAAB8FQAA5RQAAAgXAAAfEAAAZRUAAKMUAAAoFQAAAhUAAJkVAAAsEAAAixkAAE8PAADUDgAAahAAAM4QAAACFwAAiQ4AAG4TAAAcEwAAZhQAAFYXAADBEwAAzRMAAGwTAABoFwAAZhcAAF8XAAAiEwAAzg8AAGkOAADYDgAAYxYAAMsTAACqDgAAKBcAACYXAADFEwAAXRYAAOgRAABnEwAAZRMAAPIWAABzEwAAHRcAAPkWAADzEQAAzw4AAM4VAAAMEgAAsxEAAKURAABhEAAAMhcAALsTAEH5NQsBAQBBkDYL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB/TcLAQEAQZE4C14CAwICAgICAAACAgACAgACAgICAgICAgICAAQAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEH9OQsBAQBBkToLXgIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAQfA7Cw1sb3NlZWVwLWFsaXZlAEGJPAsBAQBBoDwL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBiT4LAQEAQaA+C+cBAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAEGwwAALXwEBAAEBAQEBAAABAQABAQABAQEBAQEBAQEBAAAAAAAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAEGQwgALIWVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgBBwMIACy1yYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AQfnCAAsFAQIAAQMAQZDDAAvgAQQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH5xAALBQECAAEDAEGQxQAL4AEEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cYACwQBAAABAEGRxwAL3wEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAEH6yAALBAEAAAIAQZDJAAtfAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAQfrKAAsEAQAAAQBBkMsACwEBAEGqywALQQIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAEH6zAALBAEAAAEAQZDNAAsBAQBBms0ACwYCAAAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv","base64")});var $Pn=I((rGd,GPn)=>{"use strict";p();var{Buffer:zss}=require("node:buffer");GPn.exports=zss.from("AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmFkZQASDGxsaHR0cF9yZXNldAATDmxsaHR0cF9leGVjdXRlABQUbGxodHRwX3NldHRpbmdzX2luaXQAFQ1sbGh0dHBfZmluaXNoABYMbGxodHRwX3BhdXNlABcNbGxodHRwX3Jlc3VtZQAYG2xsaHR0cF9yZXN1bWVfYWZ0ZXJfdXBncmFkZQAZEGxsaHR0cF9nZXRfZXJybm8AGhdsbGh0dHBfZ2V0X2Vycm9yX3JlYXNvbgAbF2xsaHR0cF9zZXRfZXJyb3JfcmVhc29uABwUbGxodHRwX2dldF9lcnJvcl9wb3MAHRFsbGh0dHBfZXJybm9fbmFtZQAeEmxsaHR0cF9tZXRob2RfbmFtZQAfEmxsaHR0cF9zdGF0dXNfbmFtZQAgGmxsaHR0cF9zZXRfbGVuaWVudF9oZWFkZXJzACEhbGxodHRwX3NldF9sZW5pZW50X2NodW5rZWRfbGVuZ3RoACIdbGxodHRwX3NldF9sZW5pZW50X2tlZXBfYWxpdmUAIyRsbGh0dHBfc2V0X2xlbmllbnRfdHJhbnNmZXJfZW5jb2RpbmcAJBhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YALgkXAQBBAQsRAQIDBAUKBgcrLSwqKSglJyYK77MCLBYAQYjQACgCAARAAAtBiNAAQQE2AgALFAAgABAwIAAgAjYCOCAAIAE6ACgLFAAgACAALwEyIAAtAC4gABAvEAALHgEBf0HAABAyIgEQMCABQYAINgI4IAEgADoAKCABC48MAQd/AkAgAEUNACAAQQhrIgEgAEEEaygCACIAQXhxIgRqIQUCQCAAQQFxDQAgAEEDcUUNASABIAEoAgAiAGsiAUGc0AAoAgBJDQEgACAEaiEEAkACQEGg0AAoAgAgAUcEQCAAQf8BTQRAIABBA3YhAyABKAIIIgAgASgCDCICRgRAQYzQAEGM0AAoAgBBfiADd3E2AgAMBQsgAiAANgIIIAAgAjYCDAwECyABKAIYIQYgASABKAIMIgBHBEAgACABKAIIIgI2AgggAiAANgIMDAMLIAFBFGoiAygCACICRQRAIAEoAhAiAkUNAiABQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFKAIEIgBBA3FBA0cNAiAFIABBfnE2AgRBlNAAIAQ2AgAgBSAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCABKAIcIgJBAnRBvNIAaiIDKAIAIAFGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgAUYbaiAANgIAIABFDQELIAAgBjYCGCABKAIQIgIEQCAAIAI2AhAgAiAANgIYCyABQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAFTw0AIAUoAgQiAEEBcUUNAAJAAkACQAJAIABBAnFFBEBBpNAAKAIAIAVGBEBBpNAAIAE2AgBBmNAAQZjQACgCACAEaiIANgIAIAEgAEEBcjYCBCABQaDQACgCAEcNBkGU0ABBADYCAEGg0ABBADYCAAwGC0Gg0AAoAgAgBUYEQEGg0AAgATYCAEGU0ABBlNAAKAIAIARqIgA2AgAgASAAQQFyNgIEIAAgAWogADYCAAwGCyAAQXhxIARqIQQgAEH/AU0EQCAAQQN2IQMgBSgCCCIAIAUoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgBSgCGCEGIAUgBSgCDCIARwRAQZzQACgCABogACAFKAIIIgI2AgggAiAANgIMDAMLIAVBFGoiAygCACICRQRAIAUoAhAiAkUNAiAFQRBqIQMLA0AgAyEHIAIiAEEUaiIDKAIAIgINACAAQRBqIQMgACgCECICDQALIAdBADYCAAwCCyAFIABBfnE2AgQgASAEaiAENgIAIAEgBEEBcjYCBAwDC0EAIQALIAZFDQACQCAFKAIcIgJBAnRBvNIAaiIDKAIAIAVGBEAgAyAANgIAIAANAUGQ0ABBkNAAKAIAQX4gAndxNgIADAILIAZBEEEUIAYoAhAgBUYbaiAANgIAIABFDQELIAAgBjYCGCAFKAIQIgIEQCAAIAI2AhAgAiAANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIoAhwiA0EBaw7dAdoBAdkBAgMEBQYHCAkKCwwNDtgBDxDXARES1gETFBUWFxgZGhvgAd8BHB0e1QEfICEiIyQl1AEmJygpKiss0wHSAS0u0QHQAS8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRtsBR0hJSs8BzgFLzQFMzAFNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBywHKAbgByQG5AcgBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgEA3AELQQAMxgELQQ4MxQELQQ0MxAELQQ8MwwELQRAMwgELQRMMwQELQRQMwAELQRUMvwELQRYMvgELQRgMvQELQRkMvAELQRoMuwELQRsMugELQRwMuQELQR0MuAELQQgMtwELQR4MtgELQSAMtQELQR8MtAELQQcMswELQSEMsgELQSIMsQELQSMMsAELQSQMrwELQRIMrgELQREMrQELQSUMrAELQSYMqwELQScMqgELQSgMqQELQcMBDKgBC0EqDKcBC0ErDKYBC0EsDKUBC0EtDKQBC0EuDKMBC0EvDKIBC0HEAQyhAQtBMAygAQtBNAyfAQtBDAyeAQtBMQydAQtBMgycAQtBMwybAQtBOQyaAQtBNQyZAQtBxQEMmAELQQsMlwELQToMlgELQTYMlQELQQoMlAELQTcMkwELQTgMkgELQTwMkQELQTsMkAELQT0MjwELQQkMjgELQSkMjQELQT4MjAELQT8MiwELQcAADIoBC0HBAAyJAQtBwgAMiAELQcMADIcBC0HEAAyGAQtBxQAMhQELQcYADIQBC0EXDIMBC0HHAAyCAQtByAAMgQELQckADIABC0HKAAx/C0HLAAx+C0HNAAx9C0HMAAx8C0HOAAx7C0HPAAx6C0HQAAx5C0HRAAx4C0HSAAx3C0HTAAx2C0HUAAx1C0HWAAx0C0HVAAxzC0EGDHILQdcADHELQQUMcAtB2AAMbwtBBAxuC0HZAAxtC0HaAAxsC0HbAAxrC0HcAAxqC0EDDGkLQd0ADGgLQd4ADGcLQd8ADGYLQeEADGULQeAADGQLQeIADGMLQeMADGILQQIMYQtB5AAMYAtB5QAMXwtB5gAMXgtB5wAMXQtB6AAMXAtB6QAMWwtB6gAMWgtB6wAMWQtB7AAMWAtB7QAMVwtB7gAMVgtB7wAMVQtB8AAMVAtB8QAMUwtB8gAMUgtB8wAMUQtB9AAMUAtB9QAMTwtB9gAMTgtB9wAMTQtB+AAMTAtB+QAMSwtB+gAMSgtB+wAMSQtB/AAMSAtB/QAMRwtB/gAMRgtB/wAMRQtBgAEMRAtBgQEMQwtBggEMQgtBgwEMQQtBhAEMQAtBhQEMPwtBhgEMPgtBhwEMPQtBiAEMPAtBiQEMOwtBigEMOgtBiwEMOQtBjAEMOAtBjQEMNwtBjgEMNgtBjwEMNQtBkAEMNAtBkQEMMwtBkgEMMgtBkwEMMQtBlAEMMAtBlQEMLwtBlgEMLgtBlwEMLQtBmAEMLAtBmQEMKwtBmgEMKgtBmwEMKQtBnAEMKAtBnQEMJwtBngEMJgtBnwEMJQtBoAEMJAtBoQEMIwtBogEMIgtBowEMIQtBpAEMIAtBpQEMHwtBpgEMHgtBpwEMHQtBqAEMHAtBqQEMGwtBqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDsYBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHyAhIyUmKCorLC8wMTIzNDU2Nzk6Ozw9lANAQkRFRklLTk9QUVJTVFVWWFpbXF1eX2BhYmNkZWZnaGpsb3Bxc3V2eHl6e3x/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcsBzAHNAc4BzwGKA4kDiAOHA4QDgwOAA/sC+gL5AvgC9wL0AvMC8gLLAsECsALZAQsgASAERw3wAkHdASEDDLMDCyABIARHDcgBQcMBIQMMsgMLIAEgBEcNe0H3ACEDDLEDCyABIARHDXBB7wAhAwywAwsgASAERw1pQeoAIQMMrwMLIAEgBEcNZUHoACEDDK4DCyABIARHDWJB5gAhAwytAwsgASAERw0aQRghAwysAwsgASAERw0VQRIhAwyrAwsgASAERw1CQcUAIQMMqgMLIAEgBEcNNEE/IQMMqQMLIAEgBEcNMkE8IQMMqAMLIAEgBEcNK0ExIQMMpwMLIAItAC5BAUYNnwMMwQILQQAhAAJAAkACQCACLQAqRQ0AIAItACtFDQAgAi8BMCIDQQJxRQ0BDAILIAIvATAiA0EBcUUNAQtBASEAIAItAChBAUYNACACLwEyIgVB5ABrQeQASQ0AIAVBzAFGDQAgBUGwAkYNACADQcAAcQ0AQQAhACADQYgEcUGABEYNACADQShxQQBHIQALIAJBADsBMCACQQA6AC8gAEUN3wIgAkIANwMgDOACC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAARQ3MASAAQRVHDd0CIAJBBDYCHCACIAE2AhQgAkGwGDYCECACQRU2AgxBACEDDKQDCyABIARGBEBBBiEDDKQDCyABQQFqIQFBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAA3ZAgwcCyACQgA3AyBBEiEDDIkDCyABIARHDRZBHSEDDKEDCyABIARHBEAgAUEBaiEBQRAhAwyIAwtBByEDDKADCyACIAIpAyAiCiAEIAFrrSILfSIMQgAgCiAMWhs3AyAgCiALWA3UAkEIIQMMnwMLIAEgBEcEQCACQQk2AgggAiABNgIEQRQhAwyGAwtBCSEDDJ4DCyACKQMgQgBSDccBIAIgAi8BMEGAAXI7ATAMQgsgASAERw0/QdAAIQMMnAMLIAEgBEYEQEELIQMMnAMLIAFBAWohAUEAIQACQCACKAI4IgNFDQAgAygCUCIDRQ0AIAIgAxEAACEACyAADc8CDMYBC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ3GASAAQRVHDc0CIAJBCzYCHCACIAE2AhQgAkGCGTYCECACQRU2AgxBACEDDJoDC0EAIQACQCACKAI4IgNFDQAgAygCSCIDRQ0AIAIgAxEAACEACyAARQ0MIABBFUcNygIgAkEaNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMmQMLQQAhAAJAIAIoAjgiA0UNACADKAJMIgNFDQAgAiADEQAAIQALIABFDcQBIABBFUcNxwIgAkELNgIcIAIgATYCFCACQZEXNgIQIAJBFTYCDEEAIQMMmAMLIAEgBEYEQEEPIQMMmAMLIAEtAAAiAEE7Rg0HIABBDUcNxAIgAUEBaiEBDMMBC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3DASAAQRVHDcICIAJBDzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJYDCwNAIAEtAABB8DVqLQAAIgBBAUcEQCAAQQJHDcECIAIoAgQhAEEAIQMgAkEANgIEIAIgACABQQFqIgEQLSIADcICDMUBCyAEIAFBAWoiAUcNAAtBEiEDDJUDC0EAIQACQCACKAI4IgNFDQAgAygCTCIDRQ0AIAIgAxEAACEACyAARQ3FASAAQRVHDb0CIAJBGzYCHCACIAE2AhQgAkGRFzYCECACQRU2AgxBACEDDJQDCyABIARGBEBBFiEDDJQDCyACQQo2AgggAiABNgIEQQAhAAJAIAIoAjgiA0UNACADKAJIIgNFDQAgAiADEQAAIQALIABFDcIBIABBFUcNuQIgAkEVNgIcIAIgATYCFCACQYIZNgIQIAJBFTYCDEEAIQMMkwMLIAEgBEcEQANAIAEtAABB8DdqLQAAIgBBAkcEQAJAIABBAWsOBMQCvQIAvgK9AgsgAUEBaiEBQQghAwz8AgsgBCABQQFqIgFHDQALQRUhAwyTAwtBFSEDDJIDCwNAIAEtAABB8DlqLQAAIgBBAkcEQCAAQQFrDgTFArcCwwK4ArcCCyAEIAFBAWoiAUcNAAtBGCEDDJEDCyABIARHBEAgAkELNgIIIAIgATYCBEEHIQMM+AILQRkhAwyQAwsgAUEBaiEBDAILIAEgBEYEQEEaIQMMjwMLAkAgAS0AAEENaw4UtQG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwG/Ab8BvwEAvwELQQAhAyACQQA2AhwgAkGvCzYCECACQQI2AgwgAiABQQFqNgIUDI4DCyABIARGBEBBGyEDDI4DCyABLQAAIgBBO0cEQCAAQQ1HDbECIAFBAWohAQy6AQsgAUEBaiEBC0EiIQMM8wILIAEgBEYEQEEcIQMMjAMLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43wQLAAgABAgMEBQYH0AHQAdAB0AHQAdAB0AEICQoLDA3QAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdABDg8QERIT0AELQgIhCgzAAgtCAyEKDL8CC0IEIQoMvgILQgUhCgy9AgtCBiEKDLwCC0IHIQoMuwILQgghCgy6AgtCCSEKDLkCC0IKIQoMuAILQgshCgy3AgtCDCEKDLYCC0INIQoMtQILQg4hCgy0AgtCDyEKDLMCC0IKIQoMsgILQgshCgyxAgtCDCEKDLACC0INIQoMrwILQg4hCgyuAgtCDyEKDK0CC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsON8ACvwIAAQIDBAUGB74CvgK+Ar4CvgK+Ar4CCAkKCwwNvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ar4CvgK+Ag4PEBESE74CC0ICIQoMvwILQgMhCgy+AgtCBCEKDL0CC0IFIQoMvAILQgYhCgy7AgtCByEKDLoCC0IIIQoMuQILQgkhCgy4AgtCCiEKDLcCC0ILIQoMtgILQgwhCgy1AgtCDSEKDLQCC0IOIQoMswILQg8hCgyyAgtCCiEKDLECC0ILIQoMsAILQgwhCgyvAgtCDSEKDK4CC0IOIQoMrQILQg8hCgysAgsgAiACKQMgIgogBCABa60iC30iDEIAIAogDFobNwMgIAogC1gNpwJBHyEDDIkDCyABIARHBEAgAkEJNgIIIAIgATYCBEElIQMM8AILQSAhAwyIAwtBASEFIAIvATAiA0EIcUUEQCACKQMgQgBSIQULAkAgAi0ALgRAQQEhACACLQApQQVGDQEgA0HAAHFFIAVxRQ0BC0EAIQAgA0HAAHENAEECIQAgA0EIcQ0AIANBgARxBEACQCACLQAoQQFHDQAgAi0ALUEKcQ0AQQUhAAwCC0EEIQAMAQsgA0EgcUUEQAJAIAItAChBAUYNACACLwEyIgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNAEEEIQAgA0EocUUNAiADQYgEcUGABEYNAgtBACEADAELQQBBAyACKQMgUBshAAsgAEEBaw4FvgIAsAEBpAKhAgtBESEDDO0CCyACQQE6AC8MhAMLIAEgBEcNnQJBJCEDDIQDCyABIARHDRxBxgAhAwyDAwtBACEAAkAgAigCOCIDRQ0AIAMoAkQiA0UNACACIAMRAAAhAAsgAEUNJyAAQRVHDZgCIAJB0AA2AhwgAiABNgIUIAJBkRg2AhAgAkEVNgIMQQAhAwyCAwsgASAERgRAQSghAwyCAwtBACEDIAJBADYCBCACQQw2AgggAiABIAEQKiIARQ2UAiACQSc2AhwgAiABNgIUIAIgADYCDAyBAwsgASAERgRAQSkhAwyBAwsgAS0AACIAQSBGDRMgAEEJRw2VAiABQQFqIQEMFAsgASAERwRAIAFBAWohAQwWC0EqIQMM/wILIAEgBEYEQEErIQMM/wILIAEtAAAiAEEJRyAAQSBHcQ2QAiACLQAsQQhHDd0CIAJBADoALAzdAgsgASAERgRAQSwhAwz+AgsgAS0AAEEKRw2OAiABQQFqIQEMsAELIAEgBEcNigJBLyEDDPwCCwNAIAEtAAAiAEEgRwRAIABBCmsOBIQCiAKIAoQChgILIAQgAUEBaiIBRw0AC0ExIQMM+wILQTIhAyABIARGDfoCIAIoAgAiACAEIAFraiEHIAEgAGtBA2ohBgJAA0AgAEHwO2otAAAgAS0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAEEDRgRAQQYhAQziAgsgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAc2AgAM+wILIAJBADYCAAyGAgtBMyEDIAQgASIARg35AiAEIAFrIAIoAgAiAWohByAAIAFrQQhqIQYCQANAIAFB9DtqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBCEYEQEEFIQEM4QILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPoCCyACQQA2AgAgACEBDIUCC0E0IQMgBCABIgBGDfgCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgJAA0AgAUHQwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEM4AILIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADPkCCyACQQA2AgAgACEBDIQCCyABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRg0JDIECCyAEIAFBAWoiAUcNAAtBMCEDDPgCC0EwIQMM9wILIAEgBEcEQANAIAEtAAAiAEEgRwRAIABBCmsOBP8B/gH+Af8B/gELIAQgAUEBaiIBRw0AC0E4IQMM9wILQTghAwz2AgsDQCABLQAAIgBBIEcgAEEJR3EN9gEgBCABQQFqIgFHDQALQTwhAwz1AgsDQCABLQAAIgBBIEcEQAJAIABBCmsOBPkBBAT5AQALIABBLEYN9QEMAwsgBCABQQFqIgFHDQALQT8hAwz0AgtBwAAhAyABIARGDfMCIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAEGAQGstAAAgAS0AAEEgckcNASAAQQZGDdsCIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPQCCyACQQA2AgALQTYhAwzZAgsgASAERgRAQcEAIQMM8gILIAJBDDYCCCACIAE2AgQgAi0ALEEBaw4E+wHuAewB6wHUAgsgAUEBaiEBDPoBCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIQMM3AILIAFBAWohAUEyIQMM2wILIAFBAWohAUEzIQMM2gILDP4BCyAEIAFBAWoiAUcNAAtBNSEDDPACC0E1IQMM7wILIAEgBEcEQANAIAEtAABBgDxqLQAAQQFHDfcBIAQgAUEBaiIBRw0AC0E9IQMM7wILQT0hAwzuAgtBACEAAkAgAigCOCIDRQ0AIAMoAkAiA0UNACACIAMRAAAhAAsgAEUNASAAQRVHDeYBIAJBwgA2AhwgAiABNgIUIAJB4xg2AhAgAkEVNgIMQQAhAwztAgsgAUEBaiEBC0E8IQMM0gILIAEgBEYEQEHCACEDDOsCCwJAA0ACQCABLQAAQQlrDhgAAswCzALRAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAswCzALMAgDMAgsgBCABQQFqIgFHDQALQcIAIQMM6wILIAFBAWohASACLQAtQQFxRQ3+AQtBLCEDDNACCyABIARHDd4BQcQAIQMM6AILA0AgAS0AAEGQwABqLQAAQQFHDZwBIAQgAUEBaiIBRw0AC0HFACEDDOcCCyABLQAAIgBBIEYN/gEgAEE6Rw3AAiACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgAN3gEM3QELQccAIQMgBCABIgBGDeUCIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFBkMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvwIgAUEFRg3CAiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzlAgtByAAhAyAEIAEiAEYN5AIgBCABayACKAIAIgFqIQcgACABa0EJaiEGA0AgAUGWwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw2+AkECIAFBCUYNwgIaIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOQCCyABIARGBEBByQAhAwzkAgsCQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQe4Aaw4HAL8CvwK/Ar8CvwIBvwILIAFBAWohAUE+IQMMywILIAFBAWohAUE/IQMMygILQcoAIQMgBCABIgBGDeICIAQgAWsgAigCACIBaiEGIAAgAWtBAWohBwNAIAFBoMIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNvAIgAUEBRg2+AiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBjYCAAziAgtBywAhAyAEIAEiAEYN4QIgBCABayACKAIAIgFqIQcgACABa0EOaiEGA0AgAUGiwgBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw27AiABQQ5GDb4CIAFBAWohASAEIABBAWoiAEcNAAsgAiAHNgIADOECC0HMACEDIAQgASIARg3gAiAEIAFrIAIoAgAiAWohByAAIAFrQQ9qIQYDQCABQcDCAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDboCQQMgAUEPRg2+AhogAUEBaiEBIAQgAEEBaiIARw0ACyACIAc2AgAM4AILQc0AIQMgBCABIgBGDd8CIAQgAWsgAigCACIBaiEHIAAgAWtBBWohBgNAIAFB0MIAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNuQJBBCABQQVGDb0CGiABQQFqIQEgBCAAQQFqIgBHDQALIAIgBzYCAAzfAgsgASAERgRAQc4AIQMM3wILAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAvAK8ArwCvAK8ArwCvAK8ArwCvAK8ArwCAbwCvAK8AgIDvAILIAFBAWohAUHBACEDDMgCCyABQQFqIQFBwgAhAwzHAgsgAUEBaiEBQcMAIQMMxgILIAFBAWohAUHEACEDDMUCCyABIARHBEAgAkENNgIIIAIgATYCBEHFACEDDMUCC0HPACEDDN0CCwJAAkAgAS0AAEEKaw4EAZABkAEAkAELIAFBAWohAQtBKCEDDMMCCyABIARGBEBB0QAhAwzcAgsgAS0AAEEgRw0AIAFBAWohASACLQAtQQFxRQ3QAQtBFyEDDMECCyABIARHDcsBQdIAIQMM2QILQdMAIQMgASAERg3YAiACKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABB1sIAai0AAEcNxwEgAEEBRg3KASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBjYCAAzYAgsgASAERgRAQdUAIQMM2AILIAEtAABBCkcNwgEgAUEBaiEBDMoBCyABIARGBEBB1gAhAwzXAgsCQAJAIAEtAABBCmsOBADDAcMBAcMBCyABQQFqIQEMygELIAFBAWohAUHKACEDDL0CC0EAIQACQCACKAI4IgNFDQAgAygCPCIDRQ0AIAIgAxEAACEACyAADb8BQc0AIQMMvAILIAItAClBIkYNzwIMiQELIAQgASIFRgRAQdsAIQMM1AILQQAhAEEBIQFBASEGQQAhAwJAAn8CQAJAAkACQAJAAkACQCAFLQAAQTBrDgrFAcQBAAECAwQFBgjDAQtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshA0EAIQFBACEGDL0BC0EJIQNBASEAQQAhAUEAIQYMvAELIAEgBEYEQEHdACEDDNMCCyABLQAAQS5HDbgBIAFBAWohAQyIAQsgASAERw22AUHfACEDDNECCyABIARHBEAgAkEONgIIIAIgATYCBEHQACEDDLgCC0HgACEDDNACC0HhACEDIAEgBEYNzwIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGA0AgAS0AACAAQeLCAGotAABHDbEBIABBA0YNswEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMzwILQeIAIQMgASAERg3OAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYDQCABLQAAIABB5sIAai0AAEcNsAEgAEECRg2vASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAzOAgtB4wAhAyABIARGDc0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgNAIAEtAAAgAEHpwgBqLQAARw2vASAAQQNGDa0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADM0CCyABIARGBEBB5QAhAwzNAgsgAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANqgFB1gAhAwyzAgsgASAERwRAA0AgAS0AACIAQSBHBEACQAJAAkAgAEHIAGsOCwABswGzAbMBswGzAbMBswGzAQKzAQsgAUEBaiEBQdIAIQMMtwILIAFBAWohAUHTACEDDLYCCyABQQFqIQFB1AAhAwy1AgsgBCABQQFqIgFHDQALQeQAIQMMzAILQeQAIQMMywILA0AgAS0AAEHwwgBqLQAAIgBBAUcEQCAAQQJrDgOnAaYBpQGkAQsgBCABQQFqIgFHDQALQeYAIQMMygILIAFBAWogASAERw0CGkHnACEDDMkCCwNAIAEtAABB8MQAai0AACIAQQFHBEACQCAAQQJrDgSiAaEBoAEAnwELQdcAIQMMsQILIAQgAUEBaiIBRw0AC0HoACEDDMgCCyABIARGBEBB6QAhAwzIAgsCQCABLQAAIgBBCmsOGrcBmwGbAbQBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBmwGbAZsBpAGbAZsBAJkBCyABQQFqCyEBQQYhAwytAgsDQCABLQAAQfDGAGotAABBAUcNfSAEIAFBAWoiAUcNAAtB6gAhAwzFAgsgAUEBaiABIARHDQIaQesAIQMMxAILIAEgBEYEQEHsACEDDMQCCyABQQFqDAELIAEgBEYEQEHtACEDDMMCCyABQQFqCyEBQQQhAwyoAgsgASAERgRAQe4AIQMMwQILAkACQAJAIAEtAABB8MgAai0AAEEBaw4HkAGPAY4BAHwBAo0BCyABQQFqIQEMCwsgAUEBagyTAQtBACEDIAJBADYCHCACQZsSNgIQIAJBBzYCDCACIAFBAWo2AhQMwAILAkADQCABLQAAQfDIAGotAAAiAEEERwRAAkACQCAAQQFrDgeUAZMBkgGNAQAEAY0BC0HaACEDDKoCCyABQQFqIQFB3AAhAwypAgsgBCABQQFqIgFHDQALQe8AIQMMwAILIAFBAWoMkQELIAQgASIARgRAQfAAIQMMvwILIAAtAABBL0cNASAAQQFqIQEMBwsgBCABIgBGBEBB8QAhAwy+AgsgAC0AACIBQS9GBEAgAEEBaiEBQd0AIQMMpQILIAFBCmsiA0EWSw0AIAAhAUEBIAN0QYmAgAJxDfkBC0EAIQMgAkEANgIcIAIgADYCFCACQYwcNgIQIAJBBzYCDAy8AgsgASAERwRAIAFBAWohAUHeACEDDKMCC0HyACEDDLsCCyABIARGBEBB9AAhAwy7AgsCQCABLQAAQfDMAGotAABBAWsOA/cBcwCCAQtB4QAhAwyhAgsgASAERwRAA0AgAS0AAEHwygBqLQAAIgBBA0cEQAJAIABBAWsOAvkBAIUBC0HfACEDDKMCCyAEIAFBAWoiAUcNAAtB8wAhAwy6AgtB8wAhAwy5AgsgASAERwRAIAJBDzYCCCACIAE2AgRB4AAhAwygAgtB9QAhAwy4AgsgASAERgRAQfYAIQMMuAILIAJBDzYCCCACIAE2AgQLQQMhAwydAgsDQCABLQAAQSBHDY4CIAQgAUEBaiIBRw0AC0H3ACEDDLUCCyABIARGBEBB+AAhAwy1AgsgAS0AAEEgRw16IAFBAWohAQxbC0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAADXgMgAILIAEgBEYEQEH6ACEDDLMCCyABLQAAQcwARw10IAFBAWohAUETDHYLQfsAIQMgASAERg2xAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYDQCABLQAAIABB8M4Aai0AAEcNcyAAQQVGDXUgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMsQILIAEgBEYEQEH8ACEDDLECCwJAAkAgAS0AAEHDAGsODAB0dHR0dHR0dHR0AXQLIAFBAWohAUHmACEDDJgCCyABQQFqIQFB5wAhAwyXAgtB/QAhAyABIARGDa8CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDXIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADLACCyACQQA2AgAgBkEBaiEBQRAMcwtB/gAhAyABIARGDa4CIAIoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQfbOAGotAABHDXEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK8CCyACQQA2AgAgBkEBaiEBQRYMcgtB/wAhAyABIARGDa0CIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQfzOAGotAABHDXAgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADK4CCyACQQA2AgAgBkEBaiEBQQUMcQsgASAERgRAQYABIQMMrQILIAEtAABB2QBHDW4gAUEBaiEBQQgMcAsgASAERgRAQYEBIQMMrAILAkACQCABLQAAQc4Aaw4DAG8BbwsgAUEBaiEBQesAIQMMkwILIAFBAWohAUHsACEDDJICCyABIARGBEBBggEhAwyrAgsCQAJAIAEtAABByABrDggAbm5ubm5uAW4LIAFBAWohAUHqACEDDJICCyABQQFqIQFB7QAhAwyRAgtBgwEhAyABIARGDakCIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQYDPAGotAABHDWwgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKoCCyACQQA2AgAgBkEBaiEBQQAMbQtBhAEhAyABIARGDagCIAIoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQYPPAGotAABHDWsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADKkCCyACQQA2AgAgBkEBaiEBQSMMbAsgASAERgRAQYUBIQMMqAILAkACQCABLQAAQcwAaw4IAGtra2trawFrCyABQQFqIQFB7wAhAwyPAgsgAUEBaiEBQfAAIQMMjgILIAEgBEYEQEGGASEDDKcCCyABLQAAQcUARw1oIAFBAWohAQxgC0GHASEDIAEgBEYNpQIgAigCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBiM8Aai0AAEcNaCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpgILIAJBADYCACAGQQFqIQFBLQxpC0GIASEDIAEgBEYNpAIgAigCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABB0M8Aai0AAEcNZyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMpQILIAJBADYCACAGQQFqIQFBKQxoCyABIARGBEBBiQEhAwykAgtBASABLQAAQd8ARw1nGiABQQFqIQEMXgtBigEhAyABIARGDaICIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgNAIAEtAAAgAEGMzwBqLQAARw1kIABBAUYN+gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw1bIAFBAWohAUEKDF0LIAEgBEYEQEGUASEDDJkCCwJAAkAgAS0AAEHBAGsODwBcXFxcXFxcXFxcXFxcAVwLIAFBAWohAUH+ACEDDIACCyABQQFqIQFB/wAhAwz/AQsgASAERgRAQZUBIQMMmAILAkACQCABLQAAQcEAaw4DAFsBWwsgAUEBaiEBQf0AIQMM/wELIAFBAWohAUGAASEDDP4BC0GWASEDIAEgBEYNlgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBp88Aai0AAEcNWSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlwILIAJBADYCACAGQQFqIQFBCwxaCyABIARGBEBBlwEhAwyWAgsCQAJAAkACQCABLQAAQS1rDiMAW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1sBW1tbW1sCW1tbA1sLIAFBAWohAUH7ACEDDP8BCyABQQFqIQFB/AAhAwz+AQsgAUEBaiEBQYEBIQMM/QELIAFBAWohAUGCASEDDPwBC0GYASEDIAEgBEYNlAIgAigCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABBqc8Aai0AAEcNVyAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlQILIAJBADYCACAGQQFqIQFBGQxYC0GZASEDIAEgBEYNkwIgAigCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBrs8Aai0AAEcNViAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMlAILIAJBADYCACAGQQFqIQFBBgxXC0GaASEDIAEgBEYNkgIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBtM8Aai0AAEcNVSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkwILIAJBADYCACAGQQFqIQFBHAxWC0GbASEDIAEgBEYNkQIgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBts8Aai0AAEcNVCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMkgILIAJBADYCACAGQQFqIQFBJwxVCyABIARGBEBBnAEhAwyRAgsCQAJAIAEtAABB1ABrDgIAAVQLIAFBAWohAUGGASEDDPgBCyABQQFqIQFBhwEhAwz3AQtBnQEhAyABIARGDY8CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjPAGotAABHDVIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADJACCyACQQA2AgAgBkEBaiEBQSYMUwtBngEhAyABIARGDY4CIAIoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbrPAGotAABHDVEgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI8CCyACQQA2AgAgBkEBaiEBQQMMUgtBnwEhAyABIARGDY0CIAIoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQe3PAGotAABHDVAgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI4CCyACQQA2AgAgBkEBaiEBQQwMUQtBoAEhAyABIARGDYwCIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQbzPAGotAABHDU8gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADI0CCyACQQA2AgAgBkEBaiEBQQ0MUAsgASAERgRAQaEBIQMMjAILAkACQCABLQAAQcYAaw4LAE9PT09PT09PTwFPCyABQQFqIQFBiwEhAwzzAQsgAUEBaiEBQYwBIQMM8gELIAEgBEYEQEGiASEDDIsCCyABLQAAQdAARw1MIAFBAWohAQxGCyABIARGBEBBowEhAwyKAgsCQAJAIAEtAABByQBrDgcBTU1NTU0ATQsgAUEBaiEBQY4BIQMM8QELIAFBAWohAUEiDE0LQaQBIQMgASAERg2IAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHAzwBqLQAARw1LIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyJAgsgAkEANgIAIAZBAWohAUEdDEwLIAEgBEYEQEGlASEDDIgCCwJAAkAgAS0AAEHSAGsOAwBLAUsLIAFBAWohAUGQASEDDO8BCyABQQFqIQFBBAxLCyABIARGBEBBpgEhAwyHAgsCQAJAAkACQAJAIAEtAABBwQBrDhUATU1NTU1NTU1NTQFNTQJNTQNNTQRNCyABQQFqIQFBiAEhAwzxAQsgAUEBaiEBQYkBIQMM8AELIAFBAWohAUGKASEDDO8BCyABQQFqIQFBjwEhAwzuAQsgAUEBaiEBQZEBIQMM7QELQacBIQMgASAERg2FAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHtzwBqLQAARw1IIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyGAgsgAkEANgIAIAZBAWohAUERDEkLQagBIQMgASAERg2EAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHCzwBqLQAARw1HIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyFAgsgAkEANgIAIAZBAWohAUEsDEgLQakBIQMgASAERg2DAiACKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHFzwBqLQAARw1GIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyEAgsgAkEANgIAIAZBAWohAUErDEcLQaoBIQMgASAERg2CAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHKzwBqLQAARw1FIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyDAgsgAkEANgIAIAZBAWohAUEUDEYLIAEgBEYEQEGrASEDDIICCwJAAkACQAJAIAEtAABBwgBrDg8AAQJHR0dHR0dHR0dHRwNHCyABQQFqIQFBkwEhAwzrAQsgAUEBaiEBQZQBIQMM6gELIAFBAWohAUGVASEDDOkBCyABQQFqIQFBlgEhAwzoAQsgASAERgRAQawBIQMMgQILIAEtAABBxQBHDUIgAUEBaiEBDD0LQa0BIQMgASAERg3/ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHNzwBqLQAARw1CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyAAgsgAkEANgIAIAZBAWohAUEODEMLIAEgBEYEQEGuASEDDP8BCyABLQAAQdAARw1AIAFBAWohAUElDEILQa8BIQMgASAERg39ASACKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEHQzwBqLQAARw1AIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz+AQsgAkEANgIAIAZBAWohAUEqDEELIAEgBEYEQEGwASEDDP0BCwJAAkAgAS0AAEHVAGsOCwBAQEBAQEBAQEABQAsgAUEBaiEBQZoBIQMM5AELIAFBAWohAUGbASEDDOMBCyABIARGBEBBsQEhAwz8AQsCQAJAIAEtAABBwQBrDhQAPz8/Pz8/Pz8/Pz8/Pz8/Pz8/AT8LIAFBAWohAUGZASEDDOMBCyABQQFqIQFBnAEhAwziAQtBsgEhAyABIARGDfoBIAIoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQdnPAGotAABHDT0gAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPsBCyACQQA2AgAgBkEBaiEBQSEMPgtBswEhAyABIARGDfkBIAIoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQd3PAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAiAFNgIADPoBCyACQQA2AgAgBkEBaiEBQRoMPQsgASAERgRAQbQBIQMM+QELAkACQAJAIAEtAABBxQBrDhEAPT09PT09PT09AT09PT09Aj0LIAFBAWohAUGdASEDDOEBCyABQQFqIQFBngEhAwzgAQsgAUEBaiEBQZ8BIQMM3wELQbUBIQMgASAERg33ASACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHkzwBqLQAARw06IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz4AQsgAkEANgIAIAZBAWohAUEoDDsLQbYBIQMgASAERg32ASACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHqzwBqLQAARw05IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAz3AQsgAkEANgIAIAZBAWohAUEHDDoLIAEgBEYEQEG3ASEDDPYBCwJAAkAgAS0AAEHFAGsODgA5OTk5OTk5OTk5OTkBOQsgAUEBaiEBQaEBIQMM3QELIAFBAWohAUGiASEDDNwBC0G4ASEDIAEgBEYN9AEgAigCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB7c8Aai0AAEcNNyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9QELIAJBADYCACAGQQFqIQFBEgw4C0G5ASEDIAEgBEYN8wEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8M8Aai0AAEcNNiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM9AELIAJBADYCACAGQQFqIQFBIAw3C0G6ASEDIAEgBEYN8gEgAigCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8s8Aai0AAEcNNSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8wELIAJBADYCACAGQQFqIQFBDww2CyABIARGBEBBuwEhAwzyAQsCQAJAIAEtAABByQBrDgcANTU1NTUBNQsgAUEBaiEBQaUBIQMM2QELIAFBAWohAUGmASEDDNgBC0G8ASEDIAEgBEYN8AEgAigCACIAIAQgAWtqIQUgASAAa0EHaiEGAkADQCABLQAAIABB9M8Aai0AAEcNMyAAQQdGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAM8QELIAJBADYCACAGQQFqIQFBGww0CyABIARGBEBBvQEhAwzwAQsCQAJAAkAgAS0AAEHCAGsOEgA0NDQ0NDQ0NDQBNDQ0NDQ0AjQLIAFBAWohAUGkASEDDNgBCyABQQFqIQFBpwEhAwzXAQsgAUEBaiEBQagBIQMM1gELIAEgBEYEQEG+ASEDDO8BCyABLQAAQc4ARw0wIAFBAWohAQwsCyABIARGBEBBvwEhAwzuAQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQcEAaw4VAAECAz8EBQY/Pz8HCAkKCz8MDQ4PPwsgAUEBaiEBQegAIQMM4wELIAFBAWohAUHpACEDDOIBCyABQQFqIQFB7gAhAwzhAQsgAUEBaiEBQfIAIQMM4AELIAFBAWohAUHzACEDDN8BCyABQQFqIQFB9gAhAwzeAQsgAUEBaiEBQfcAIQMM3QELIAFBAWohAUH6ACEDDNwBCyABQQFqIQFBgwEhAwzbAQsgAUEBaiEBQYQBIQMM2gELIAFBAWohAUGFASEDDNkBCyABQQFqIQFBkgEhAwzYAQsgAUEBaiEBQZgBIQMM1wELIAFBAWohAUGgASEDDNYBCyABQQFqIQFBowEhAwzVAQsgAUEBaiEBQaoBIQMM1AELIAEgBEcEQCACQRA2AgggAiABNgIEQasBIQMM1AELQcABIQMM7AELQQAhAAJAIAIoAjgiA0UNACADKAI0IgNFDQAgAiADEQAAIQALIABFDV4gAEEVRw0HIAJB0QA2AhwgAiABNgIUIAJBsBc2AhAgAkEVNgIMQQAhAwzrAQsgAUEBaiABIARHDQgaQcIBIQMM6gELA0ACQCABLQAAQQprDgQIAAALAAsgBCABQQFqIgFHDQALQcMBIQMM6QELIAEgBEcEQCACQRE2AgggAiABNgIEQQEhAwzQAQtBxAEhAwzoAQsgASAERgRAQcUBIQMM6AELAkACQCABLQAAQQprDgQBKCgAKAsgAUEBagwJCyABQQFqDAULIAEgBEYEQEHGASEDDOcBCwJAAkAgAS0AAEEKaw4XAQsLAQsLCwsLCwsLCwsLCwsLCwsLCwALCyABQQFqIQELQbABIQMMzQELIAEgBEYEQEHIASEDDOYBCyABLQAAQSBHDQkgAkEAOwEyIAFBAWohAUGzASEDDMwBCwNAIAEhAAJAIAEgBEcEQCABLQAAQTBrQf8BcSIDQQpJDQEMJwtBxwEhAwzmAQsCQCACLwEyIgFBmTNLDQAgAiABQQpsIgU7ATIgBUH+/wNxIANB//8Dc0sNACAAQQFqIQEgAiADIAVqIgM7ATIgA0H//wNxQegHSQ0BCwtBACEDIAJBADYCHCACQcEJNgIQIAJBDTYCDCACIABBAWo2AhQM5AELIAJBADYCHCACIAE2AhQgAkHwDDYCECACQRs2AgxBACEDDOMBCyACKAIEIQAgAkEANgIEIAIgACABECYiAA0BIAFBAWoLIQFBrQEhAwzIAQsgAkHBATYCHCACIAA2AgwgAiABQQFqNgIUQQAhAwzgAQsgAigCBCEAIAJBADYCBCACIAAgARAmIgANASABQQFqCyEBQa4BIQMMxQELIAJBwgE2AhwgAiAANgIMIAIgAUEBajYCFEEAIQMM3QELIAJBADYCHCACIAE2AhQgAkGXCzYCECACQQ02AgxBACEDDNwBCyACQQA2AhwgAiABNgIUIAJB4xA2AhAgAkEJNgIMQQAhAwzbAQsgAkECOgAoDKwBC0EAIQMgAkEANgIcIAJBrws2AhAgAkECNgIMIAIgAUEBajYCFAzZAQtBAiEDDL8BC0ENIQMMvgELQSYhAwy9AQtBFSEDDLwBC0EWIQMMuwELQRghAwy6AQtBHCEDDLkBC0EdIQMMuAELQSAhAwy3AQtBISEDDLYBC0EjIQMMtQELQcYAIQMMtAELQS4hAwyzAQtBPSEDDLIBC0HLACEDDLEBC0HOACEDDLABC0HYACEDDK8BC0HZACEDDK4BC0HbACEDDK0BC0HxACEDDKwBC0H0ACEDDKsBC0GNASEDDKoBC0GXASEDDKkBC0GpASEDDKgBC0GvASEDDKcBC0GxASEDDKYBCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB8Rs2AhAgAkEGNgIMDL0BCyACQQA2AgAgBkEBaiEBQSQLOgApIAIoAgQhACACQQA2AgQgAiAAIAEQJyIARQRAQeUAIQMMowELIAJB+QA2AhwgAiABNgIUIAIgADYCDEEAIQMMuwELIABBFUcEQCACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwy7AQsgAkH4ADYCHCACIAE2AhQgAkHKGDYCECACQRU2AgxBACEDDLoBCyACQQA2AhwgAiABNgIUIAJBjhs2AhAgAkEGNgIMQQAhAwy5AQsgAkEANgIcIAIgATYCFCACQf4RNgIQIAJBBzYCDEEAIQMMuAELIAJBADYCHCACIAE2AhQgAkGMHDYCECACQQc2AgxBACEDDLcBCyACQQA2AhwgAiABNgIUIAJBww82AhAgAkEHNgIMQQAhAwy2AQsgAkEANgIcIAIgATYCFCACQcMPNgIQIAJBBzYCDEEAIQMMtQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0RIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMtAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0gIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMswELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0iIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMsgELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0OIAJB5QA2AhwgAiABNgIUIAIgADYCDEEAIQMMsQELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0dIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMsAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0fIAJB0gA2AhwgAiABNgIUIAIgADYCDEEAIQMMrwELIABBP0cNASABQQFqCyEBQQUhAwyUAQtBACEDIAJBADYCHCACIAE2AhQgAkH9EjYCECACQQc2AgwMrAELIAJBADYCHCACIAE2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQFqIQFBzwAhAwyCAQsgAigCBCEAIAJBADYCBCACIAAgARAoIgBFDYYBIAJB3gA2AhwgAiABNgIUIAIgADYCDEEAIQMMmgELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ2GASACQdwANgIcIAIgATYCFCACIAA2AgxBACEDDJkBCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMhwELIAJB2gA2AhwgAiAFNgIUIAIgADYCDAyYAQtBACEBQQEhAwsgAiADOgArIAVBAWohAwJAAkACQCACLQAtQRBxDQACQAJAAkAgAi0AKg4DAQACBAsgBkUNAwwCCyAADQEMAgsgAUUNAQsgAigCBCEAIAJBADYCBCACIAAgAxAoIgBFBEAgAyEBDAILIAJB2AA2AhwgAiADNgIUIAIgADYCDEEAIQMMmAELIAIoAgQhACACQQA2AgQgAiAAIAMQKCIARQRAIAMhAQyHAQsgAkHZADYCHCACIAM2AhQgAiAANgIMQQAhAwyXAQtBzAAhAwx9CyAAQRVHBEAgAkEANgIcIAIgATYCFCACQZQNNgIQIAJBITYCDEEAIQMMlgELIAJB1wA2AhwgAiABNgIUIAJByRc2AhAgAkEVNgIMQQAhAwyVAQtBACEDIAJBADYCHCACIAE2AhQgAkGAETYCECACQQk2AgwMlAELIAIoAgQhACACQQA2AgQgAiAAIAEQJSIARQ0AIAJB0wA2AhwgAiABNgIUIAIgADYCDEEAIQMMkwELQckAIQMMeQsgAkEANgIcIAIgATYCFCACQcEoNgIQIAJBBzYCDCACQQA2AgBBACEDDJEBCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAlIgBFDQAgAkHSADYCHCACIAE2AhQgAiAANgIMDJABC0HIACEDDHYLIAJBADYCACAFIQELIAJBgBI7ASogAUEBaiEBQQAhAAJAIAIoAjgiA0UNACADKAIwIgNFDQAgAiADEQAAIQALIAANAQtBxwAhAwxzCyAAQRVGBEAgAkHRADYCHCACIAE2AhQgAkHjFzYCECACQRU2AgxBACEDDIwBC0EAIQMgAkEANgIcIAIgATYCFCACQbkNNgIQIAJBGjYCDAyLAQtBACEDIAJBADYCHCACIAE2AhQgAkGgGTYCECACQR42AgwMigELIAEtAABBOkYEQCACKAIEIQBBACEDIAJBADYCBCACIAAgARApIgBFDQEgAkHDADYCHCACIAA2AgwgAiABQQFqNgIUDIoBC0EAIQMgAkEANgIcIAIgATYCFCACQbERNgIQIAJBCjYCDAyJAQsgAUEBaiEBQTshAwxvCyACQcMANgIcIAIgADYCDCACIAFBAWo2AhQMhwELQQAhAyACQQA2AhwgAiABNgIUIAJB8A42AhAgAkEcNgIMDIYBCyACIAIvATBBEHI7ATAMZgsCQCACLwEwIgBBCHFFDQAgAi0AKEEBRw0AIAItAC1BCHFFDQMLIAIgAEH3+wNxQYAEcjsBMAwECyABIARHBEACQANAIAEtAABBMGsiAEH/AXFBCk8EQEE1IQMMbgsgAikDICIKQpmz5syZs+bMGVYNASACIApCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAIgCiALfDcDICAEIAFBAWoiAUcNAAtBOSEDDIUBCyACKAIEIQBBACEDIAJBADYCBCACIAAgAUEBaiIBECoiAA0MDHcLQTkhAwyDAQsgAi0AMEEgcQ0GQcUBIQMMaQtBACEDIAJBADYCBCACIAEgARAqIgBFDQQgAkE6NgIcIAIgADYCDCACIAFBAWo2AhQMgQELIAItAChBAUcNACACLQAtQQhxRQ0BC0E3IQMMZgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIABEAgAkE7NgIcIAIgADYCDCACIAFBAWo2AhQMfwsgAUEBaiEBDG4LIAJBCDoALAwECyABQQFqIQEMbQtBACEDIAJBADYCHCACIAE2AhQgAkHkEjYCECACQQQ2AgwMewsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ1sIAJBNzYCHCACIAE2AhQgAiAANgIMDHoLIAIgAi8BMEEgcjsBMAtBMCEDDF8LIAJBNjYCHCACIAE2AhQgAiAANgIMDHcLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCACLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIAJBAToALCACIAIvATAgAXI7ATAgACEBDAELIAIgAi8BMEEIcjsBMCAAIQELQTkhAwxcCyACQQA6ACwLQTQhAwxaCyABIARGBEBBLSEDDHMLAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0EtIQMMdAsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIARQ0CIAJBLDYCHCACIAE2AhQgAiAANgIMDHMLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAS0AAEENRgRAIAIoAgQhAEEAIQMgAkEANgIEIAIgACABECoiAEUEQCABQQFqIQEMAgsgAkEsNgIcIAIgADYCDCACIAFBAWo2AhQMcgsgAi0ALUEBcQRAQcQBIQMMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKiIADQEMZQtBLyEDDFcLIAJBLjYCHCACIAE2AhQgAiAANgIMDG8LQQAhAyACQQA2AhwgAiABNgIUIAJB8BQ2AhAgAkEDNgIMDG4LQQEhAwJAAkACQAJAIAItACxBBWsOBAMBAgAECyACIAIvATBBCHI7ATAMAwtBAiEDDAELQQQhAwsgAkEBOgAsIAIgAi8BMCADcjsBMAtBKiEDDFMLQQAhAyACQQA2AhwgAiABNgIUIAJB4Q82AhAgAkEKNgIMDGsLQQEhAwJAAkACQAJAAkACQCACLQAsQQJrDgcFBAQDAQIABAsgAiACLwEwQQhyOwEwDAMLQQIhAwwBC0EEIQMLIAJBAToALCACIAIvATAgA3I7ATALQSshAwxSC0EAIQMgAkEANgIcIAIgATYCFCACQasSNgIQIAJBCzYCDAxqC0EAIQMgAkEANgIcIAIgATYCFCACQf0NNgIQIAJBHTYCDAxpCyABIARHBEADQCABLQAAQSBHDUggBCABQQFqIgFHDQALQSUhAwxpC0ElIQMMaAsgAi0ALUEBcQRAQcMBIQMMTwsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQKSIABEAgAkEmNgIcIAIgADYCDCACIAFBAWo2AhQMaAsgAUEBaiEBDFwLIAFBAWohASACLwEwIgBBgAFxBEBBACEAAkAgAigCOCIDRQ0AIAMoAlQiA0UNACACIAMRAAAhAAsgAEUNBiAAQRVHDR8gAkEFNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMZwsCQCAAQaAEcUGgBEcNACACLQAtQQJxDQBBACEDIAJBADYCHCACIAE2AhQgAkGWEzYCECACQQQ2AgwMZwsgAgJ/IAIvATBBFHFBFEYEQEEBIAItAChBAUYNARogAi8BMkHlAEYMAQsgAi0AKUEFRgs6AC5BACEAAkAgAigCOCIDRQ0AIAMoAiQiA0UNACACIAMRAAAhAAsCQAJAAkACQAJAIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyACQQE6AC4LIAIgAi8BMEHAAHI7ATALQSchAwxPCyACQSM2AhwgAiABNgIUIAJBpRY2AhAgAkEVNgIMQQAhAwxnC0EAIQMgAkEANgIcIAIgATYCFCACQdULNgIQIAJBETYCDAxmC0EAIQACQCACKAI4IgNFDQAgAygCLCIDRQ0AIAIgAxEAACEACyAADQELQQ4hAwxLCyAAQRVGBEAgAkECNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMZAtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMYwtBACEDIAJBADYCHCACIAE2AhQgAkGqHDYCECACQQ82AgwMYgsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEgCqdqIgEQKyIARQ0AIAJBBTYCHCACIAE2AhQgAiAANgIMDGELQQ8hAwxHC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxfC0IBIQoLIAFBAWohAQJAIAIpAyAiC0L//////////w9YBEAgAiALQgSGIAqENwMgDAELQQAhAyACQQA2AhwgAiABNgIUIAJBrQk2AhAgAkEMNgIMDF4LQSQhAwxEC0EAIQMgAkEANgIcIAIgATYCFCACQc0TNgIQIAJBDDYCDAxcCyACKAIEIQBBACEDIAJBADYCBCACIAAgARAsIgBFBEAgAUEBaiEBDFILIAJBFzYCHCACIAA2AgwgAiABQQFqNgIUDFsLIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQRY2AhwgAiAANgIMIAIgAUEBajYCFAxbC0EfIQMMQQtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMWQsgAigCBCEAQQAhAyACQQA2AgQgAiAAIAEQLSIARQRAIAFBAWohAQxQCyACQRQ2AhwgAiAANgIMIAIgAUEBajYCFAxYCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABEC0iAEUEQCABQQFqIQEMAQsgAkETNgIcIAIgADYCDCACIAFBAWo2AhQMWAtBHiEDDD4LQQAhAyACQQA2AhwgAiABNgIUIAJBxgw2AhAgAkEjNgIMDFYLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABEC0iAEUEQCABQQFqIQEMTgsgAkERNgIcIAIgADYCDCACIAFBAWo2AhQMVQsgAkEQNgIcIAIgATYCFCACIAA2AgwMVAtBACEDIAJBADYCHCACIAE2AhQgAkHGDDYCECACQSM2AgwMUwtBACEDIAJBADYCHCACIAE2AhQgAkHAFTYCECACQQI2AgwMUgsgAigCBCEAQQAhAyACQQA2AgQCQCACIAAgARAtIgBFBEAgAUEBaiEBDAELIAJBDjYCHCACIAA2AgwgAiABQQFqNgIUDFILQRshAww4C0EAIQMgAkEANgIcIAIgATYCFCACQcYMNgIQIAJBIzYCDAxQCyACKAIEIQBBACEDIAJBADYCBAJAIAIgACABECwiAEUEQCABQQFqIQEMAQsgAkENNgIcIAIgADYCDCACIAFBAWo2AhQMUAtBGiEDDDYLQQAhAyACQQA2AhwgAiABNgIUIAJBmg82AhAgAkEiNgIMDE4LIAIoAgQhAEEAIQMgAkEANgIEAkAgAiAAIAEQLCIARQRAIAFBAWohAQwBCyACQQw2AhwgAiAANgIMIAIgAUEBajYCFAxOC0EZIQMMNAtBACEDIAJBADYCHCACIAE2AhQgAkGaDzYCECACQSI2AgwMTAsgAEEVRwRAQQAhAyACQQA2AhwgAiABNgIUIAJBgww2AhAgAkETNgIMDEwLIAJBCjYCHCACIAE2AhQgAkHkFjYCECACQRU2AgxBACEDDEsLIAIoAgQhAEEAIQMgAkEANgIEIAIgACABIAqnaiIBECsiAARAIAJBBzYCHCACIAE2AhQgAiAANgIMDEsLQRMhAwwxCyAAQRVHBEBBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMSgsgAkEeNgIcIAIgATYCFCACQfkXNgIQIAJBFTYCDEEAIQMMSQtBACEAAkAgAigCOCIDRQ0AIAMoAiwiA0UNACACIAMRAAAhAAsgAEUNQSAAQRVGBEAgAkEDNgIcIAIgATYCFCACQbAYNgIQIAJBFTYCDEEAIQMMSQtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMSAtBACEDIAJBADYCHCACIAE2AhQgAkHaDTYCECACQRQ2AgwMRwtBACEDIAJBADYCHCACIAE2AhQgAkGnDjYCECACQRI2AgwMRgsgAkEAOgAvIAItAC1BBHFFDT8LIAJBADoALyACQQE6ADRBACEDDCsLQQAhAyACQQA2AhwgAkHkETYCECACQQc2AgwgAiABQQFqNgIUDEMLAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB3QEhAwxDCwJAAkAgAi0ANEEBRw0AQQAhAAJAIAIoAjgiA0UNACADKAJYIgNFDQAgAiADEQAAIQALIABFDQAgAEEVRw0BIAJB3AE2AhwgAiABNgIUIAJB1RY2AhAgAkEVNgIMQQAhAwxEC0HBASEDDCoLIAJBADYCHCACIAE2AhQgAkHpCzYCECACQR82AgxBACEDDEILAkACQCACLQAoQQFrDgIEAQALQcABIQMMKQtBuQEhAwwoCyACQQI6AC9BACEAAkAgAigCOCIDRQ0AIAMoAgAiA0UNACACIAMRAAAhAAsgAEUEQEHCASEDDCgLIABBFUcEQCACQQA2AhwgAiABNgIUIAJBpAw2AhAgAkEQNgIMQQAhAwxBCyACQdsBNgIcIAIgATYCFCACQfoWNgIQIAJBFTYCDEEAIQMMQAsgASAERgRAQdoBIQMMQAsgAS0AAEHIAEYNASACQQE6ACgLQawBIQMMJQtBvwEhAwwkCyABIARHBEAgAkEQNgIIIAIgATYCBEG+ASEDDCQLQdkBIQMMPAsgASAERgRAQdgBIQMMPAsgAS0AAEHIAEcNBCABQQFqIQFBvQEhAwwiCyABIARGBEBB1wEhAww7CwJAAkAgAS0AAEHFAGsOEAAFBQUFBQUFBQUFBQUFBQEFCyABQQFqIQFBuwEhAwwiCyABQQFqIQFBvAEhAwwhC0HWASEDIAEgBEYNOSACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGD0ABqLQAARw0DIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw6CyACKAIEIQAgAkIANwMAIAIgACAGQQFqIgEQJyIARQRAQcYBIQMMIQsgAkHVATYCHCACIAE2AhQgAiAANgIMQQAhAww5C0HUASEDIAEgBEYNOCACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGB0ABqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAw5CyACQYEEOwEoIAIoAgQhACACQgA3AwAgAiAAIAZBAWoiARAnIgANAwwCCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJB2Bs2AhAgAkEINgIMDDYLQboBIQMMHAsgAkHTATYCHCACIAE2AhQgAiAANgIMQQAhAww0C0EAIQACQCACKAI4IgNFDQAgAygCOCIDRQ0AIAIgAxEAACEACyAARQ0AIABBFUYNASACQQA2AhwgAiABNgIUIAJBzA42AhAgAkEgNgIMQQAhAwwzC0HkACEDDBkLIAJB+AA2AhwgAiABNgIUIAJByhg2AhAgAkEVNgIMQQAhAwwxC0HSASEDIAQgASIARg0wIAQgAWsgAigCACIBaiEFIAAgAWtBBGohBgJAA0AgAC0AACABQfzPAGotAABHDQEgAUEERg0DIAFBAWohASAEIABBAWoiAEcNAAsgAiAFNgIADDELIAJBADYCHCACIAA2AhQgAkGQMzYCECACQQg2AgwgAkEANgIAQQAhAwwwCyABIARHBEAgAkEONgIIIAIgATYCBEG3ASEDDBcLQdEBIQMMLwsgAkEANgIAIAZBAWohAQtBuAEhAwwUCyABIARGBEBB0AEhAwwtCyABLQAAQTBrIgBB/wFxQQpJBEAgAiAAOgAqIAFBAWohAUG2ASEDDBQLIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0UIAJBzwE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAsgASAERgRAQc4BIQMMLAsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAIoAgQhACACQQA2AgQgAiAAIAEQKCIARQ0VIAJBzQE2AhwgAiABNgIUIAIgADYCDEEAIQMMLAtBtQEhAwwSCyAEIAEiBUYEQEHMASEDDCsLQQAhAEEBIQFBASEGQQAhAwJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAUtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyEDQQAhAUEAIQYMAgtBCSEDQQEhAEEAIQFBACEGDAELQQAhAUEBIQMLIAIgAzoAKyAFQQFqIQMCQAJAIAItAC1BEHENAAJAAkACQCACLQAqDgMBAAIECyAGRQ0DDAILIAANAQwCCyABRQ0BCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMAwsgAkHJATYCHCACIAM2AhQgAiAANgIMQQAhAwwtCyACKAIEIQAgAkEANgIEIAIgACADECgiAEUEQCADIQEMGAsgAkHKATYCHCACIAM2AhQgAiAANgIMQQAhAwwsCyACKAIEIQAgAkEANgIEIAIgACAFECgiAEUEQCAFIQEMFgsgAkHLATYCHCACIAU2AhQgAiAANgIMDCsLQbQBIQMMEQtBACEAAkAgAigCOCIDRQ0AIAMoAjwiA0UNACACIAMRAAAhAAsCQCAABEAgAEEVRg0BIAJBADYCHCACIAE2AhQgAkGUDTYCECACQSE2AgxBACEDDCsLQbIBIQMMEQsgAkHIATYCHCACIAE2AhQgAkHJFzYCECACQRU2AgxBACEDDCkLIAJBADYCACAGQQFqIQFB9QAhAwwPCyACLQApQQVGBEBB4wAhAwwPC0HiACEDDA4LIAAhASACQQA2AgALIAJBADoALEEJIQMMDAsgAkEANgIAIAdBAWohAUHAACEDDAsLQQELOgAsIAJBADYCACAGQQFqIQELQSkhAwwIC0E4IQMMBwsCQCABIARHBEADQCABLQAAQYA+ai0AACIAQQFHBEAgAEECRw0DIAFBAWohAQwFCyAEIAFBAWoiAUcNAAtBPiEDDCELQT4hAwwgCwsgAkEAOgAsDAELQQshAwwEC0E6IQMMAwsgAUEBaiEBQS0hAwwCCyACIAE6ACwgAkEANgIAIAZBAWohAUEMIQMMAQsgAkEANgIAIAZBAWohAUEKIQMMAAsAC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwXC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwWC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwVC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwUC0EAIQMgAkEANgIcIAIgATYCFCACQc0QNgIQIAJBCTYCDAwTC0EAIQMgAkEANgIcIAIgATYCFCACQekKNgIQIAJBCTYCDAwSC0EAIQMgAkEANgIcIAIgATYCFCACQbcQNgIQIAJBCTYCDAwRC0EAIQMgAkEANgIcIAIgATYCFCACQZwRNgIQIAJBCTYCDAwQC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwPC0EAIQMgAkEANgIcIAIgATYCFCACQZcVNgIQIAJBDzYCDAwOC0EAIQMgAkEANgIcIAIgATYCFCACQcASNgIQIAJBCzYCDAwNC0EAIQMgAkEANgIcIAIgATYCFCACQZUJNgIQIAJBCzYCDAwMC0EAIQMgAkEANgIcIAIgATYCFCACQeEPNgIQIAJBCjYCDAwLC0EAIQMgAkEANgIcIAIgATYCFCACQfsPNgIQIAJBCjYCDAwKC0EAIQMgAkEANgIcIAIgATYCFCACQfEZNgIQIAJBAjYCDAwJC0EAIQMgAkEANgIcIAIgATYCFCACQcQUNgIQIAJBAjYCDAwIC0EAIQMgAkEANgIcIAIgATYCFCACQfIVNgIQIAJBAjYCDAwHCyACQQI2AhwgAiABNgIUIAJBnBo2AhAgAkEWNgIMQQAhAwwGC0EBIQMMBQtB1AAhAyABIARGDQQgCEEIaiEJIAIoAgAhBQJAAkAgASAERwRAIAVB2MIAaiEHIAQgBWogAWshACAFQX9zQQpqIgUgAWohBgNAIAEtAAAgBy0AAEcEQEECIQcMAwsgBUUEQEEAIQcgBiEBDAMLIAVBAWshBSAHQQFqIQcgBCABQQFqIgFHDQALIAAhBSAEIQELIAlBATYCACACIAU2AgAMAQsgAkEANgIAIAkgBzYCAAsgCSABNgIEIAgoAgwhACAIKAIIDgMBBAIACwALIAJBADYCHCACQbUaNgIQIAJBFzYCDCACIABBAWo2AhRBACEDDAILIAJBADYCHCACIAA2AhQgAkHKGjYCECACQQk2AgxBACEDDAELIAEgBEYEQEEiIQMMAQsgAkEJNgIIIAIgATYCBEEhIQMLIAhBEGokACADRQRAIAIoAgwhAAwBCyACIAM2AhxBACEAIAIoAgQiAUUNACACIAEgBCACKAIIEQEAIgFFDQAgAiAENgIUIAIgATYCDCABIQALIAALvgIBAn8gAEEAOgAAIABB3ABqIgFBAWtBADoAACAAQQA6AAIgAEEAOgABIAFBA2tBADoAACABQQJrQQA6AAAgAEEAOgADIAFBBGtBADoAAEEAIABrQQNxIgEgAGoiAEEANgIAQdwAIAFrQXxxIgIgAGoiAUEEa0EANgIAAkAgAkEJSQ0AIABBADYCCCAAQQA2AgQgAUEIa0EANgIAIAFBDGtBADYCACACQRlJDQAgAEEANgIYIABBADYCFCAAQQA2AhAgAEEANgIMIAFBEGtBADYCACABQRRrQQA2AgAgAUEYa0EANgIAIAFBHGtBADYCACACIABBBHFBGHIiAmsiAUEgSQ0AIAAgAmohAANAIABCADcDGCAAQgA3AxAgAEIANwMIIABCADcDACAAQSBqIQAgAUEgayIBQR9LDQALCwtWAQF/AkAgACgCDA0AAkACQAJAAkAgAC0ALw4DAQADAgsgACgCOCIBRQ0AIAEoAiwiAUUNACAAIAERAAAiAQ0DC0EADwsACyAAQcMWNgIQQQ4hAQsgAQsaACAAKAIMRQRAIABB0Rs2AhAgAEEVNgIMCwsUACAAKAIMQRVGBEAgAEEANgIMCwsUACAAKAIMQRZGBEAgAEEANgIMCwsHACAAKAIMCwcAIAAoAhALCQAgACABNgIQCwcAIAAoAhQLFwAgAEEkTwRAAAsgAEECdEGgM2ooAgALFwAgAEEuTwRAAAsgAEECdEGwNGooAgALvwkBAX9B6yghAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HhJw8LQaQhDwtByywPC0H+MQ8LQcAkDwtBqyQPC0GNKA8LQeImDwtBgDAPC0G5Lw8LQdckDwtB7x8PC0HhHw8LQfofDwtB8iAPC0GoLw8LQa4yDwtBiDAPC0HsJw8LQYIiDwtBjh0PC0HQLg8LQcojDwtBxTIPC0HfHA8LQdIcDwtBxCAPC0HXIA8LQaIfDwtB7S4PC0GrMA8LQdQlDwtBzC4PC0H6Lg8LQfwrDwtB0jAPC0HxHQ8LQbsgDwtB9ysPC0GQMQ8LQdcxDwtBoi0PC0HUJw8LQeArDwtBnywPC0HrMQ8LQdUfDwtByjEPC0HeJQ8LQdQeDwtB9BwPC0GnMg8LQbEdDwtBoB0PC0G5MQ8LQbwwDwtBkiEPC0GzJg8LQeksDwtBrB4PC0HUKw8LQfcmDwtBgCYPC0GwIQ8LQf4eDwtBjSMPC0GJLQ8LQfciDwtBoDEPC0GuHw8LQcYlDwtB6B4PC0GTIg8LQcIvDwtBwx0PC0GLLA8LQeEdDwtBjS8PC0HqIQ8LQbQtDwtB0i8PC0HfMg8LQdIyDwtB8DAPC0GpIg8LQfkjDwtBmR4PC0G1LA8LQZswDwtBkjIPC0G2Kw8LQcIiDwtB+DIPC0GeJQ8LQdAiDwtBuh4PC0GBHg8LAAtB1iEhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCz4BAn8CQCAAKAI4IgNFDQAgAygCBCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBxhE2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCCCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9go2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCDCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7Ro2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCECIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlRA2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCFCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBqhs2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCGCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB7RM2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCKCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABB9gg2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCHCIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBwhk2AhBBGCEECyAECz4BAn8CQCAAKAI4IgNFDQAgAygCICIDRQ0AIAAgASACIAFrIAMRAQAiBEF/Rw0AIABBlBQ2AhBBGCEECyAEC1kBAn8CQCAALQAoQQFGDQAgAC8BMiIBQeQAa0HkAEkNACABQcwBRg0AIAFBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhAiAAQYgEcUGABEYNACAAQShxRSECCyACC4wBAQJ/AkACQAJAIAAtACpFDQAgAC0AK0UNACAALwEwIgFBAnFFDQEMAgsgAC8BMCIBQQFxRQ0BC0EBIQIgAC0AKEEBRg0AIAAvATIiAEHkAGtB5ABJDQAgAEHMAUYNACAAQbACRg0AIAFBwABxDQBBACECIAFBiARxQYAERg0AIAFBKHFBAEchAgsgAgtzACAAQRBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAA/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQTBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQSBq/QwAAAAAAAAAAAAAAAAAAAAA/QsDACAAQd0BNgIcCwYAIAAQMguaLQELfyMAQRBrIgokAEGk0AAoAgAiCUUEQEHk0wAoAgAiBUUEQEHw0wBCfzcCAEHo0wBCgICEgICAwAA3AgBB5NMAIApBCGpBcHFB2KrVqgVzIgU2AgBB+NMAQQA2AgBByNMAQQA2AgALQczTAEGA1AQ2AgBBnNAAQYDUBDYCAEGw0AAgBTYCAEGs0ABBfzYCAEHQ0wBBgKwDNgIAA0AgAUHI0ABqIAFBvNAAaiICNgIAIAIgAUG00ABqIgM2AgAgAUHA0ABqIAM2AgAgAUHQ0ABqIAFBxNAAaiIDNgIAIAMgAjYCACABQdjQAGogAUHM0ABqIgI2AgAgAiADNgIAIAFB1NAAaiACNgIAIAFBIGoiAUGAAkcNAAtBjNQEQcGrAzYCAEGo0ABB9NMAKAIANgIAQZjQAEHAqwM2AgBBpNAAQYjUBDYCAEHM/wdBODYCAEGI1AQhCQsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQewBTQRAQYzQACgCACIGQRAgAEETakFwcSAAQQtJGyIEQQN2IgB2IgFBA3EEQAJAIAFBAXEgAHJBAXMiAkEDdCIAQbTQAGoiASAAQbzQAGooAgAiACgCCCIDRgRAQYzQACAGQX4gAndxNgIADAELIAEgAzYCCCADIAE2AgwLIABBCGohASAAIAJBA3QiAkEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwRC0GU0AAoAgAiCCAETw0BIAEEQAJAQQIgAHQiAkEAIAJrciABIAB0cWgiAEEDdCICQbTQAGoiASACQbzQAGooAgAiAigCCCIDRgRAQYzQACAGQX4gAHdxIgY2AgAMAQsgASADNgIIIAMgATYCDAsgAiAEQQNyNgIEIABBA3QiACAEayEFIAAgAmogBTYCACACIARqIgQgBUEBcjYCBCAIBEAgCEF4cUG00ABqIQBBoNAAKAIAIQMCf0EBIAhBA3Z0IgEgBnFFBEBBjNAAIAEgBnI2AgAgAAwBCyAAKAIICyIBIAM2AgwgACADNgIIIAMgADYCDCADIAE2AggLIAJBCGohAUGg0AAgBDYCAEGU0AAgBTYCAAwRC0GQ0AAoAgAiC0UNASALaEECdEG80gBqKAIAIgAoAgRBeHEgBGshBSAAIQIDQAJAIAIoAhAiAUUEQCACQRRqKAIAIgFFDQELIAEoAgRBeHEgBGsiAyAFSSECIAMgBSACGyEFIAEgACACGyEAIAEhAgwBCwsgACgCGCEJIAAoAgwiAyAARwRAQZzQACgCABogAyAAKAIIIgE2AgggASADNgIMDBALIABBFGoiAigCACIBRQRAIAAoAhAiAUUNAyAAQRBqIQILA0AgAiEHIAEiA0EUaiICKAIAIgENACADQRBqIQIgAygCECIBDQALIAdBADYCAAwPC0F/IQQgAEG/f0sNACAAQRNqIgFBcHEhBEGQ0AAoAgAiCEUNAEEAIARrIQUCQAJAAkACf0EAIARBgAJJDQAaQR8gBEH///8HSw0AGiAEQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qCyIGQQJ0QbzSAGooAgAiAkUEQEEAIQFBACEDDAELQQAhASAEQRkgBkEBdmtBACAGQR9HG3QhAEEAIQMDQAJAIAIoAgRBeHEgBGsiByAFTw0AIAIhAyAHIgUNAEEAIQUgAiEBDAMLIAEgAkEUaigCACIHIAcgAiAAQR12QQRxakEQaigCACICRhsgASAHGyEBIABBAXQhACACDQALCyABIANyRQRAQQAhA0ECIAZ0IgBBACAAa3IgCHEiAEUNAyAAaEECdEG80gBqKAIAIQELIAFFDQELA0AgASgCBEF4cSAEayICIAVJIQAgAiAFIAAbIQUgASADIAAbIQMgASgCECIABH8gAAUgAUEUaigCAAsiAQ0ACwsgA0UNACAFQZTQACgCACAEa08NACADKAIYIQcgAyADKAIMIgBHBEBBnNAAKAIAGiAAIAMoAggiATYCCCABIAA2AgwMDgsgA0EUaiICKAIAIgFFBEAgAygCECIBRQ0DIANBEGohAgsDQCACIQYgASIAQRRqIgIoAgAiAQ0AIABBEGohAiAAKAIQIgENAAsgBkEANgIADA0LQZTQACgCACIDIARPBEBBoNAAKAIAIQECQCADIARrIgJBEE8EQCABIARqIgAgAkEBcjYCBCABIANqIAI2AgAgASAEQQNyNgIEDAELIAEgA0EDcjYCBCABIANqIgAgACgCBEEBcjYCBEEAIQBBACECC0GU0AAgAjYCAEGg0AAgADYCACABQQhqIQEMDwtBmNAAKAIAIgMgBEsEQCAEIAlqIgAgAyAEayIBQQFyNgIEQaTQACAANgIAQZjQACABNgIAIAkgBEEDcjYCBCAJQQhqIQEMDwtBACEBIAQCf0Hk0wAoAgAEQEHs0wAoAgAMAQtB8NMAQn83AgBB6NMAQoCAhICAgMAANwIAQeTTACAKQQxqQXBxQdiq1aoFczYCAEH40wBBADYCAEHI0wBBADYCAEGAgAQLIgAgBEHHAGoiBWoiBkEAIABrIgdxIgJPBEBB/NMAQTA2AgAMDwsCQEHE0wAoAgAiAUUNAEG80wAoAgAiCCACaiEAIAAgAU0gACAIS3ENAEEAIQFB/NMAQTA2AgAMDwtByNMALQAAQQRxDQQCQAJAIAkEQEHM0wAhAQNAIAEoAgAiACAJTQRAIAAgASgCBGogCUsNAwsgASgCCCIBDQALC0EAEDMiAEF/Rg0FIAIhBkHo0wAoAgAiAUEBayIDIABxBEAgAiAAayAAIANqQQAgAWtxaiEGCyAEIAZPDQUgBkH+////B0sNBUHE0wAoAgAiAwRAQbzTACgCACIHIAZqIQEgASAHTQ0GIAEgA0sNBgsgBhAzIgEgAEcNAQwHCyAGIANrIAdxIgZB/v///wdLDQQgBhAzIQAgACABKAIAIAEoAgRqRg0DIAAhAQsCQCAGIARByABqTw0AIAFBf0YNAEHs0wAoAgAiACAFIAZrakEAIABrcSIAQf7///8HSwRAIAEhAAwHCyAAEDNBf0cEQCAAIAZqIQYgASEADAcLQQAgBmsQMxoMBAsgASIAQX9HDQUMAwtBACEDDAwLQQAhAAwKCyAAQX9HDQILQcjTAEHI0wAoAgBBBHI2AgALIAJB/v///wdLDQEgAhAzIQBBABAzIQEgAEF/Rg0BIAFBf0YNASAAIAFPDQEgASAAayIGIARBOGpNDQELQbzTAEG80wAoAgAgBmoiATYCAEHA0wAoAgAgAUkEQEHA0wAgATYCAAsCQAJAAkBBpNAAKAIAIgIEQEHM0wAhAQNAIAAgASgCACIDIAEoAgQiBWpGDQIgASgCCCIBDQALDAILQZzQACgCACIBQQBHIAAgAU9xRQRAQZzQACAANgIAC0EAIQFB0NMAIAY2AgBBzNMAIAA2AgBBrNAAQX82AgBBsNAAQeTTACgCADYCAEHY0wBBADYCAANAIAFByNAAaiABQbzQAGoiAjYCACACIAFBtNAAaiIDNgIAIAFBwNAAaiADNgIAIAFB0NAAaiABQcTQAGoiAzYCACADIAI2AgAgAUHY0ABqIAFBzNAAaiICNgIAIAIgAzYCACABQdTQAGogAjYCACABQSBqIgFBgAJHDQALQXggAGtBD3EiASAAaiICIAZBOGsiAyABayIBQQFyNgIEQajQAEH00wAoAgA2AgBBmNAAIAE2AgBBpNAAIAI2AgAgACADakE4NgIEDAILIAAgAk0NACACIANJDQAgASgCDEEIcQ0AQXggAmtBD3EiACACaiIDQZjQACgCACAGaiIHIABrIgBBAXI2AgQgASAFIAZqNgIEQajQAEH00wAoAgA2AgBBmNAAIAA2AgBBpNAAIAM2AgAgAiAHakE4NgIEDAELIABBnNAAKAIASQRAQZzQACAANgIACyAAIAZqIQNBzNMAIQECQAJAAkADQCADIAEoAgBHBEAgASgCCCIBDQEMAgsLIAEtAAxBCHFFDQELQczTACEBA0AgASgCACIDIAJNBEAgAyABKAIEaiIFIAJLDQMLIAEoAgghAQwACwALIAEgADYCACABIAEoAgQgBmo2AgQgAEF4IABrQQ9xaiIJIARBA3I2AgQgA0F4IANrQQ9xaiIGIAQgCWoiBGshASACIAZGBEBBpNAAIAQ2AgBBmNAAQZjQACgCACABaiIANgIAIAQgAEEBcjYCBAwIC0Gg0AAoAgAgBkYEQEGg0AAgBDYCAEGU0ABBlNAAKAIAIAFqIgA2AgAgBCAAQQFyNgIEIAAgBGogADYCAAwICyAGKAIEIgVBA3FBAUcNBiAFQXhxIQggBUH/AU0EQCAFQQN2IQMgBigCCCIAIAYoAgwiAkYEQEGM0ABBjNAAKAIAQX4gA3dxNgIADAcLIAIgADYCCCAAIAI2AgwMBgsgBigCGCEHIAYgBigCDCIARwRAIAAgBigCCCICNgIIIAIgADYCDAwFCyAGQRRqIgIoAgAiBUUEQCAGKAIQIgVFDQQgBkEQaiECCwNAIAIhAyAFIgBBFGoiAigCACIFDQAgAEEQaiECIAAoAhAiBQ0ACyADQQA2AgAMBAtBeCAAa0EPcSIBIABqIgcgBkE4ayIDIAFrIgFBAXI2AgQgACADakE4NgIEIAIgBUE3IAVrQQ9xakE/ayIDIAMgAkEQakkbIgNBIzYCBEGo0ABB9NMAKAIANgIAQZjQACABNgIAQaTQACAHNgIAIANBEGpB1NMAKQIANwIAIANBzNMAKQIANwIIQdTTACADQQhqNgIAQdDTACAGNgIAQczTACAANgIAQdjTAEEANgIAIANBJGohAQNAIAFBBzYCACAFIAFBBGoiAUsNAAsgAiADRg0AIAMgAygCBEF+cTYCBCADIAMgAmsiBTYCACACIAVBAXI2AgQgBUH/AU0EQCAFQXhxQbTQAGohAAJ/QYzQACgCACIBQQEgBUEDdnQiA3FFBEBBjNAAIAEgA3I2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEG80gBqIQBBkNAAKAIAIgNBASABdCIGcUUEQCAAIAI2AgBBkNAAIAMgBnI2AgAgAiAANgIYIAIgAjYCCCACIAI2AgwMAQsgBUEZIAFBAXZrQQAgAUEfRxt0IQEgACgCACEDAkADQCADIgAoAgRBeHEgBUYNASABQR12IQMgAUEBdCEBIAAgA0EEcWpBEGoiBigCACIDDQALIAYgAjYCACACIAA2AhggAiACNgIMIAIgAjYCCAwBCyAAKAIIIgEgAjYCDCAAIAI2AgggAkEANgIYIAIgADYCDCACIAE2AggLQZjQACgCACIBIARNDQBBpNAAKAIAIgAgBGoiAiABIARrIgFBAXI2AgRBmNAAIAE2AgBBpNAAIAI2AgAgACAEQQNyNgIEIABBCGohAQwIC0EAIQFB/NMAQTA2AgAMBwtBACEACyAHRQ0AAkAgBigCHCICQQJ0QbzSAGoiAygCACAGRgRAIAMgADYCACAADQFBkNAAQZDQACgCAEF+IAJ3cTYCAAwCCyAHQRBBFCAHKAIQIAZGG2ogADYCACAARQ0BCyAAIAc2AhggBigCECICBEAgACACNgIQIAIgADYCGAsgBkEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgCGohASAGIAhqIgYoAgQhBQsgBiAFQX5xNgIEIAEgBGogATYCACAEIAFBAXI2AgQgAUH/AU0EQCABQXhxQbTQAGohAAJ/QYzQACgCACICQQEgAUEDdnQiAXFFBEBBjNAAIAEgAnI2AgAgAAwBCyAAKAIICyIBIAQ2AgwgACAENgIIIAQgADYCDCAEIAE2AggMAQtBHyEFIAFB////B00EQCABQSYgAUEIdmciAGt2QQFxIABBAXRrQT5qIQULIAQgBTYCHCAEQgA3AhAgBUECdEG80gBqIQBBkNAAKAIAIgJBASAFdCIDcUUEQCAAIAQ2AgBBkNAAIAIgA3I2AgAgBCAANgIYIAQgBDYCCCAEIAQ2AgwMAQsgAUEZIAVBAXZrQQAgBUEfRxt0IQUgACgCACEAAkADQCAAIgIoAgRBeHEgAUYNASAFQR12IQAgBUEBdCEFIAIgAEEEcWpBEGoiAygCACIADQALIAMgBDYCACAEIAI2AhggBCAENgIMIAQgBDYCCAwBCyACKAIIIgAgBDYCDCACIAQ2AgggBEEANgIYIAQgAjYCDCAEIAA2AggLIAlBCGohAQwCCwJAIAdFDQACQCADKAIcIgFBAnRBvNIAaiICKAIAIANGBEAgAiAANgIAIAANAUGQ0AAgCEF+IAF3cSIINgIADAILIAdBEEEUIAcoAhAgA0YbaiAANgIAIABFDQELIAAgBzYCGCADKAIQIgEEQCAAIAE2AhAgASAANgIYCyADQRRqKAIAIgFFDQAgAEEUaiABNgIAIAEgADYCGAsCQCAFQQ9NBEAgAyAEIAVqIgBBA3I2AgQgACADaiIAIAAoAgRBAXI2AgQMAQsgAyAEaiICIAVBAXI2AgQgAyAEQQNyNgIEIAIgBWogBTYCACAFQf8BTQRAIAVBeHFBtNAAaiEAAn9BjNAAKAIAIgFBASAFQQN2dCIFcUUEQEGM0AAgASAFcjYCACAADAELIAAoAggLIgEgAjYCDCAAIAI2AgggAiAANgIMIAIgATYCCAwBC0EfIQEgBUH///8HTQRAIAVBJiAFQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAQsgAiABNgIcIAJCADcCECABQQJ0QbzSAGohAEEBIAF0IgQgCHFFBEAgACACNgIAQZDQACAEIAhyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhBAJAA0AgBCIAKAIEQXhxIAVGDQEgAUEddiEEIAFBAXQhASAAIARBBHFqQRBqIgYoAgAiBA0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIICyADQQhqIQEMAQsCQCAJRQ0AAkAgACgCHCIBQQJ0QbzSAGoiAigCACAARgRAIAIgAzYCACADDQFBkNAAIAtBfiABd3E2AgAMAgsgCUEQQRQgCSgCECAARhtqIAM2AgAgA0UNAQsgAyAJNgIYIAAoAhAiAQRAIAMgATYCECABIAM2AhgLIABBFGooAgAiAUUNACADQRRqIAE2AgAgASADNgIYCwJAIAVBD00EQCAAIAQgBWoiAUEDcjYCBCAAIAFqIgEgASgCBEEBcjYCBAwBCyAAIARqIgcgBUEBcjYCBCAAIARBA3I2AgQgBSAHaiAFNgIAIAgEQCAIQXhxQbTQAGohAUGg0AAoAgAhAwJ/QQEgCEEDdnQiAiAGcUUEQEGM0AAgAiAGcjYCACABDAELIAEoAggLIgIgAzYCDCABIAM2AgggAyABNgIMIAMgAjYCCAtBoNAAIAc2AgBBlNAAIAU2AgALIABBCGohAQsgCkEQaiQAIAELQwAgAEUEQD8AQRB0DwsCQCAAQf//A3ENACAAQQBIDQAgAEEQdkAAIgBBf0YEQEH80wBBMDYCAEF/DwsgAEEQdA8LAAsL3D8iAEGACAsJAQAAAAIAAAADAEGUCAsFBAAAAAUAQaQICwkGAAAABwAAAAgAQdwIC4otSW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwBB+TULAQEAQZA2C+ABAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQf03CwEBAEGROAteAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgBB/TkLAQEAQZE6C14CAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAEHwOwsNbG9zZWVlcC1hbGl2ZQBBiTwLAQEAQaA8C+ABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQYk+CwEBAEGgPgvnAQEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZABBsMAAC18BAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBBkMIACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQcDCAAstcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQoNClNNDQoNClRUUC9DRS9UU1AvAEH5wgALBQECAAEDAEGQwwAL4AEEAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+cQACwUBAgABAwBBkMUAC+ABBAEBBQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAQfnGAAsEAQAAAQBBkccAC98BAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBB+sgACwQBAAACAEGQyQALXwMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==","base64")});var Cwe=I((iGd,XPn)=>{"use strict";p();var VPn=["GET","HEAD","POST"],Yss=new Set(VPn),Kss=[101,204,205,304],WPn=[301,302,303,307,308],Jss=new Set(WPn),zPn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],Zss=new Set(zPn),YPn=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],Xss=new Set(YPn),eas=["follow","manual","error"],KPn=["GET","HEAD","OPTIONS","TRACE"],tas=new Set(KPn),ras=["navigate","same-origin","no-cors","cors"],nas=["omit","same-origin","include"],ias=["default","no-store","reload","no-cache","force-cache","only-if-cached"],oas=["content-encoding","content-language","content-location","content-type","content-length"],sas=["half"],JPn=["CONNECT","TRACE","TRACK"],aas=new Set(JPn),ZPn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],cas=new Set(ZPn);XPn.exports={subresource:ZPn,forbiddenMethods:JPn,requestBodyHeader:oas,referrerPolicy:YPn,requestRedirect:eas,requestMode:ras,requestCredentials:nas,requestCache:ias,redirectStatus:WPn,corsSafeListedMethods:VPn,nullBodyStatus:Kss,safeMethods:KPn,badPorts:zPn,requestDuplex:sas,subresourceSet:cas,badPortsSet:Zss,redirectStatusSet:Jss,corsSafeListedMethodsSet:Yss,safeMethodsSet:tas,forbiddenMethodsSet:aas,referrerPolicySet:Xss}});var PJt=I((sGd,ekn)=>{"use strict";p();var RJt=Symbol.for("undici.globalOrigin.1");function las(){return globalThis[RJt]}a(las,"getGlobalOrigin");function uas(t){if(t===void 0){Object.defineProperty(globalThis,RJt,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,RJt,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(uas,"setGlobalOrigin");ekn.exports={getGlobalOrigin:las,setGlobalOrigin:uas}});var UC=I((lGd,akn)=>{"use strict";p();var Dtt=require("node:assert"),das=new TextEncoder,bwe=/^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/,fas=/[\u000A\u000D\u0009\u0020]/,pas=/[\u0009\u000A\u000C\u000D\u0020]/g,has=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function mas(t){Dtt(t.protocol==="data:");let e=nkn(t,!0);e=e.slice(5);let r={position:0},n=$ue(",",e,r),o=n.length;if(n=vas(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=ikn(s);if(/;(\u0020){0,}base64$/i.test(n)){let u=skn(c);if(c=Aas(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020)+$/,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=kJt(n);return l==="failure"&&(l=kJt("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(mas,"dataURLProcessor");function nkn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(nkn,"URLSerializer");function Ntt(t,e,r){let n="";for(;r.position=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(tkn,"isHexCharByte");function rkn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(rkn,"hexByteToNumber");function gas(t){let e=t.length,r=new Uint8Array(e),n=0;for(let o=0;ot.length)return"failure";e.position++;let n=$ue(";",t,e);if(n=ktt(n,!1,!0),n.length===0||!bwe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionfas.test(d),t,e);let l=Ntt(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.positiont.length)break;let u=null;if(t[e.position]==='"')u=okn(t,e,!0),$ue(";",t,e);else if(u=$ue(";",t,e),u=ktt(u,!1,!0),u.length===0)continue;l.length!==0&&bwe.test(l)&&(u.length===0||has.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(kJt,"parseMIMEType");function Aas(t){t=t.replace(pas,"");let e=t.length;if(e%4===0&&t.charCodeAt(e-1)===61&&(--e,t.charCodeAt(e-1)===61&&--e),e%4===1||/[^+/0-9A-Za-z]/.test(t.length===e?t:t.substring(0,e)))return"failure";let r=Buffer.from(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}a(Aas,"forgivingBase64");function okn(t,e,r){let n=e.position,o="";for(Dtt(t[e.position]==='"'),e.position++;o+=Ntt(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{Dtt(s==='"');break}}return r?o:t.slice(n,e.position)}a(okn,"collectAnHTTPQuotedString");function yas(t){Dtt(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",bwe.test(s)||(s=s.replace(/(\\|")/g,"\\$1"),s='"'+s,s+='"'),n+=s;return n}a(yas,"serializeAMimeType");function Eas(t){return t===13||t===10||t===9||t===32}a(Eas,"isHTTPWhiteSpace");function ktt(t,e=!0,r=!0){return DJt(t,e,r,Eas)}a(ktt,"removeHTTPWhitespace");function _as(t){return t===13||t===10||t===9||t===12||t===32}a(_as,"isASCIIWhitespace");function vas(t,e=!0,r=!0){return DJt(t,e,r,_as)}a(vas,"removeASCIIWhitespace");function DJt(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(DJt,"removeChars");function skn(t){let e=t.length;if(65535>e)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(skn,"isomorphicDecode");function Cas(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(Cas,"minimizeSupportedMimeType");akn.exports={dataURLProcessor:mas,URLSerializer:nkn,collectASequenceOfCodePoints:Ntt,collectASequenceOfCodePointsFast:$ue,stringPercentDecode:ikn,parseMIMEType:kJt,collectAnHTTPQuotedString:okn,serializeAMimeType:yas,removeChars:DJt,removeHTTPWhitespace:ktt,minimizeSupportedMimeType:Cas,HTTP_TOKEN_CODEPOINTS:bwe,isomorphicDecode:skn}});var IA=I((fGd,ckn)=>{"use strict";p();var{types:TO,inspect:bas}=require("node:util"),{markAsUncloneable:Sas}=require("node:worker_threads"),{toUSVString:Tas}=Os(),Er={};Er.converters={};Er.util={};Er.errors={};Er.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};Er.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return Er.errors.exception({header:t.prefix,message:r})};Er.errors.invalidArgument=function(t){return Er.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};Er.brandCheck=function(t,e,r){if(r?.strict!==!1){if(!(t instanceof e)){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}else if(t?.[Symbol.toStringTag]!==e.prototype[Symbol.toStringTag]){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}};Er.argumentLengthCheck=function({length:t},e,r){if(t{});Er.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=Math.pow(-2,e)-1,o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),n?.enforceRange===!0){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw Er.errors.exception({header:"Integer conversion",message:`Could not convert ${Er.util.Stringify(t)} to an integer.`});if(c=Er.util.IntegerPart(c),co)throw Er.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&n?.clamp===!0?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=Er.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e)-1?c-Math.pow(2,e):c)};Er.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};Er.util.Stringify=function(t){switch(Er.util.Type(t)){case"Symbol":return`Symbol(${t.description})`;case"Object":return bas(t);case"String":return`"${t}"`;default:return`${t}`}};Er.sequenceConverter=function(t){return(e,r,n,o)=>{if(Er.util.Type(e)!=="Object")throw Er.errors.exception({header:r,message:`${n} (${Er.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw Er.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};Er.recordConverter=function(t,e){return(r,n,o)=>{if(Er.util.Type(r)!=="Object")throw Er.errors.exception({header:n,message:`${o} ("${Er.util.Type(r)}") is not an Object.`});let s={};if(!TO.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=t(u,n,o),f=e(r[u],n,o);s[d]=f}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};Er.interfaceConverter=function(t){return(e,r,n,o)=>{if(o?.strict!==!1&&!(e instanceof t))throw Er.errors.exception({header:r,message:`Expected ${n} ("${Er.util.Stringify(e)}") to be an instance of ${t.name}.`});return e}};Er.dictionaryConverter=function(t){return(e,r,n)=>{let o=Er.util.Type(e),s={};if(o==="Null"||o==="Undefined")return s;if(o!=="Object")throw Er.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let c of t){let{key:l,defaultValue:u,required:d,converter:f}=c;if(d===!0&&!Object.hasOwn(e,l))throw Er.errors.exception({header:r,message:`Missing required key "${l}".`});let h=e[l],m=Object.hasOwn(c,"defaultValue");if(m&&h!==null&&(h??=u()),d||m||h!==void 0){if(h=f(h,r,`${n}.${l}`),c.allowedValues&&!c.allowedValues.includes(h))throw Er.errors.exception({header:r,message:`${h} is not an accepted type. Expected one of ${c.allowedValues.join(", ")}.`});s[l]=h}}return s}};Er.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};Er.converters.DOMString=function(t,e,r,n){if(t===null&&n?.legacyNullToEmptyString)return"";if(typeof t=="symbol")throw Er.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};Er.converters.ByteString=function(t,e,r){let n=Er.converters.DOMString(t,e,r);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};Er.converters.USVString=Tas;Er.converters.boolean=function(t){return!!t};Er.converters.any=function(t){return t};Er.converters["long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"signed",void 0,e,r)};Er.converters["unsigned long long"]=function(t,e,r){return Er.util.ConvertToInt(t,64,"unsigned",void 0,e,r)};Er.converters["unsigned long"]=function(t,e,r){return Er.util.ConvertToInt(t,32,"unsigned",void 0,e,r)};Er.converters["unsigned short"]=function(t,e,r,n){return Er.util.ConvertToInt(t,16,"unsigned",n,e,r)};Er.converters.ArrayBuffer=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!TO.isAnyArrayBuffer(t))throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(n?.allowShared===!1&&TO.isSharedArrayBuffer(t))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.resizable||t.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.TypedArray=function(t,e,r,n,o){if(Er.util.Type(t)!=="Object"||!TO.isTypedArray(t)||t.constructor.name!==e.name)throw Er.errors.conversionFailed({prefix:r,argument:`${n} ("${Er.util.Stringify(t)}")`,types:[e.name]});if(o?.allowShared===!1&&TO.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.DataView=function(t,e,r,n){if(Er.util.Type(t)!=="Object"||!TO.isDataView(t))throw Er.errors.exception({header:e,message:`${r} is not a DataView.`});if(n?.allowShared===!1&&TO.isSharedArrayBuffer(t.buffer))throw Er.errors.exception({header:"ArrayBuffer",message:"SharedArrayBuffer is not allowed."});if(t.buffer.resizable||t.buffer.growable)throw Er.errors.exception({header:"ArrayBuffer",message:"Received a resizable ArrayBuffer."});return t};Er.converters.BufferSource=function(t,e,r,n){if(TO.isAnyArrayBuffer(t))return Er.converters.ArrayBuffer(t,e,r,{...n,allowShared:!1});if(TO.isTypedArray(t))return Er.converters.TypedArray(t,t.constructor,e,r,{...n,allowShared:!1});if(TO.isDataView(t))return Er.converters.DataView(t,e,r,{...n,allowShared:!1});throw Er.errors.conversionFailed({prefix:e,argument:`${r} ("${Er.util.Stringify(t)}")`,types:["BufferSource"]})};Er.converters["sequence"]=Er.sequenceConverter(Er.converters.ByteString);Er.converters["sequence>"]=Er.sequenceConverter(Er.converters["sequence"]);Er.converters["record"]=Er.recordConverter(Er.converters.ByteString,Er.converters.ByteString);ckn.exports={webidl:Er}});var US=I((hGd,Ckn)=>{"use strict";p();var{Transform:Ias}=require("node:stream"),lkn=require("node:zlib"),{redirectStatusSet:xas,referrerPolicySet:was,badPortsSet:Ras}=Cwe(),{getGlobalOrigin:ukn}=PJt(),{collectASequenceOfCodePoints:JK,collectAnHTTPQuotedString:Pas,removeChars:kas,parseMIMEType:Das}=UC(),{performance:Nas}=require("node:perf_hooks"),{isBlobLike:Mas,ReadableStreamFrom:Oas,isValidHTTPToken:dkn,normalizedMethodRecordsBase:Bas}=Os(),ZK=require("node:assert"),{isUint8Array:Las}=require("node:util/types"),{webidl:Swe}=IA(),fkn=[],Ott;try{Ott=require("node:crypto");let t=["sha256","sha384","sha512"];fkn=Ott.getHashes().filter(e=>t.includes(e))}catch{}function pkn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(pkn,"responseURL");function Fas(t,e){if(!xas.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&mkn(r)&&(hkn(r)||(r=Uas(r)),r=new URL(r,pkn(t))),r&&!r.hash&&(r.hash=e),r}a(Fas,"responseLocationURL");function hkn(t){for(let e=0;e126||r<32)return!1}return!0}a(hkn,"isValidEncodedURL");function Uas(t){return Buffer.from(t,"binary").toString("utf8")}a(Uas,"normalizeBinaryStringToUtf8");function Iwe(t){return t.urlList[t.urlList.length-1]}a(Iwe,"requestCurrentURL");function Qas(t){let e=Iwe(t);return _kn(e)&&Ras.has(e.port)?"blocked":"allowed"}a(Qas,"requestBadPort");function qas(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(qas,"isErrorLike");function jas(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(jas,"isValidReasonPhrase");var Has=dkn;function mkn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(mkn,"isValidHeaderValue");function Gas(t,e){let{headersList:r}=e,n=(r.get("referrer-policy",!0)??"").split(","),o="";if(n.length>0)for(let s=n.length;s!==0;s--){let c=n[s-1].trim();if(was.has(c)){o=c;break}}o!==""&&(t.referrerPolicy=o)}a(Gas,"setRequestReferrerPolicyOnRedirect");function $as(){return"allowed"}a($as,"crossOriginResourcePolicyCheck");function Vas(){return"success"}a(Vas,"corsCheck");function Was(){return"success"}a(Was,"TAOCheck");function zas(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(zas,"appendFetchMetadata");function Yas(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&MJt(t.origin)&&!MJt(Iwe(t))&&(e=null);break;case"same-origin":Btt(t,Iwe(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(Yas,"appendRequestOriginHeader");function Vue(t,e){return t}a(Vue,"coarsenTime");function Kas(t,e,r){return!t?.startTime||t.startTime4096&&(n=o);let s=Btt(t,n),c=Twe(n)&&!Twe(t.url);switch(e){case"origin":return o??NJt(r,!0);case"unsafe-url":return n;case"same-origin":return s?o:"no-referrer";case"origin-when-cross-origin":return s?n:o;case"strict-origin-when-cross-origin":{let l=Iwe(t);return Btt(n,l)?n:Twe(n)&&!Twe(l)?"no-referrer":o}default:return c?"no-referrer":o}}a(ecs,"determineRequestsReferrer");function NJt(t,e){return ZK(t instanceof URL),t=new URL(t),t.protocol==="file:"||t.protocol==="about:"||t.protocol==="blank:"?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}a(NJt,"stripURLForReferrer");function Twe(t){if(!(t instanceof URL))return!1;if(t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="file:")return!0;return e(t.origin);function e(r){if(r==null||r==="null")return!1;let n=new URL(r);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}a(Twe,"isURLPotentiallyTrustworthy");function tcs(t,e){if(Ott===void 0)return!0;let r=Akn(e);if(r==="no metadata"||r.length===0)return!0;let n=ncs(r),o=ics(r,n);for(let s of o){let c=s.algo,l=s.hash,u=Ott.createHash(c).update(t).digest("base64");if(u[u.length-1]==="="&&(u[u.length-2]==="="?u=u.slice(0,-2):u=u.slice(0,-1)),ocs(u,l))return!0}return!1}a(tcs,"bytesMatch");var rcs=/(?sha256|sha384|sha512)-((?[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function Akn(t){let e=[],r=!0;for(let n of t.split(" ")){r=!1;let o=rcs.exec(n);if(o===null||o.groups===void 0||o.groups.algo===void 0)continue;let s=o.groups.algo.toLowerCase();fkn.includes(s)&&e.push(o.groups)}return r===!0?"no metadata":e}a(Akn,"parseMetadata");function ncs(t){let e=t[0].algo;if(e[3]==="5")return e;for(let r=1;r{t=n,e=o}),resolve:t,reject:e}}a(acs,"createDeferredPromise");function ccs(t){return t.controller.state==="aborted"}a(ccs,"isAborted");function lcs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(lcs,"isCancelled");function ucs(t){return Bas[t.toLowerCase()]??t}a(ucs,"normalizeMethod");function dcs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return ZK(typeof e=="string"),e}a(dcs,"serializeJavascriptValueToJSONString");var fcs=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function ykn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=this.#e[e],u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,fcs),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(ykn,"createIterator");function pcs(t,e,r,n=0,o=1){let s=ykn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Swe.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Swe.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return Swe.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(Swe.brandCheck(this,e),Swe.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(pcs,"iteratorMixin");async function hcs(t,e,r){let n=e,o=r,s;try{s=t.stream.getReader()}catch(c){o(c);return}try{n(await Ekn(s))}catch(c){o(c)}}a(hcs,"fullyReadBody");function mcs(t){return t instanceof ReadableStream||t[Symbol.toStringTag]==="ReadableStream"&&typeof t.tee=="function"}a(mcs,"isReadableStreamLike");function gcs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(gcs,"readableStreamClose");var Acs=/[^\x00-\xFF]/;function Mtt(t){return ZK(!Acs.test(t)),t}a(Mtt,"isomorphicEncode");async function Ekn(t){let e=[],r=0;for(;;){let{done:n,value:o}=await t.read();if(n)return Buffer.concat(e,r);if(!Las(o))throw new TypeError("Received non-Uint8Array chunk");e.push(o),r+=o.length}}a(Ekn,"readAllBytes");function ycs(t){ZK("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(ycs,"urlIsLocal");function MJt(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(MJt,"urlHasHttpsScheme");function _kn(t){ZK("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(_kn,"urlIsHttpHttpsScheme");function Ecs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&JK(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&JK(u=>u===" "||u===" ",r,n);let o=JK(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&JK(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&JK(u=>u===" "||u===" ",r,n);let c=JK(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(Ecs,"simpleRangeHeaderValue");function _cs(t,e,r){let n="bytes ";return n+=Mtt(`${t}`),n+="-",n+=Mtt(`${e}`),n+="/",n+=Mtt(`${r}`),n}a(_cs,"buildContentRange");var OJt=class extends Ias{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?lkn.createInflate(this.#e):lkn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function vcs(t){return new OJt(t)}a(vcs,"createInflate");function Ccs(t){let e=null,r=null,n=null,o=vkn("content-type",t);if(o===null)return"failure";for(let s of o){let c=Das(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Ccs,"extractMimeType");function bcs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(bcs,"gettingDecodingSplitting");function vkn(t,e){let r=e.get(t,!0);return r===null?null:bcs(r)}a(vkn,"getDecodeSplit");var Scs=new TextDecoder;function Tcs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),Scs.decode(t))}a(Tcs,"utf8DecodeBytes");var BJt=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return ukn()}get origin(){return this.baseUrl?.origin}policyContainer=gkn()},LJt=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new BJt},Ics=new LJt;Ckn.exports={isAborted:ccs,isCancelled:lcs,isValidEncodedURL:hkn,createDeferredPromise:acs,ReadableStreamFrom:Oas,tryUpgradeRequestToAPotentiallyTrustworthyURL:scs,clampAndCoarsenConnectionTimingInfo:Kas,coarsenedSharedCurrentTime:Jas,determineRequestsReferrer:ecs,makePolicyContainer:gkn,clonePolicyContainer:Xas,appendFetchMetadata:zas,appendRequestOriginHeader:Yas,TAOCheck:Was,corsCheck:Vas,crossOriginResourcePolicyCheck:$as,createOpaqueTimingInfo:Zas,setRequestReferrerPolicyOnRedirect:Gas,isValidHTTPToken:dkn,requestBadPort:Qas,requestCurrentURL:Iwe,responseURL:pkn,responseLocationURL:Fas,isBlobLike:Mas,isURLPotentiallyTrustworthy:Twe,isValidReasonPhrase:jas,sameOrigin:Btt,normalizeMethod:ucs,serializeJavascriptValueToJSONString:dcs,iteratorMixin:pcs,createIterator:ykn,isValidHeaderName:Has,isValidHeaderValue:mkn,isErrorLike:qas,fullyReadBody:hcs,bytesMatch:tcs,isReadableStreamLike:mcs,readableStreamClose:gcs,isomorphicEncode:Mtt,urlIsLocal:ycs,urlHasHttpsScheme:MJt,urlIsHttpHttpsScheme:_kn,readAllBytes:Ekn,simpleRangeHeaderValue:Ecs,buildContentRange:_cs,parseMetadata:Akn,createInflate:vcs,extractMimeType:Ccs,getDecodeSplit:vkn,utf8DecodeBytes:Tcs,environmentSettingsObject:Ics}});var Sq=I((AGd,bkn)=>{"use strict";p();bkn.exports={kUrl:Symbol("url"),kHeaders:Symbol("headers"),kSignal:Symbol("signal"),kState:Symbol("state"),kDispatcher:Symbol("dispatcher")}});var UJt=I((EGd,Skn)=>{"use strict";p();var{Blob:xcs,File:wcs}=require("node:buffer"),{kState:$3}=Sq(),{webidl:IO}=IA(),FJt=class t{static{a(this,"FileLike")}constructor(e,r,n={}){let o=r,s=n.type,c=n.lastModified??Date.now();this[$3]={blobLike:e,name:o,type:s,lastModified:c}}stream(...e){return IO.brandCheck(this,t),this[$3].blobLike.stream(...e)}arrayBuffer(...e){return IO.brandCheck(this,t),this[$3].blobLike.arrayBuffer(...e)}slice(...e){return IO.brandCheck(this,t),this[$3].blobLike.slice(...e)}text(...e){return IO.brandCheck(this,t),this[$3].blobLike.text(...e)}get size(){return IO.brandCheck(this,t),this[$3].blobLike.size}get type(){return IO.brandCheck(this,t),this[$3].blobLike.type}get name(){return IO.brandCheck(this,t),this[$3].name}get lastModified(){return IO.brandCheck(this,t),this[$3].lastModified}get[Symbol.toStringTag](){return"File"}};IO.converters.Blob=IO.interfaceConverter(xcs);function Rcs(t){return t instanceof wcs||t&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&t[Symbol.toStringTag]==="File"}a(Rcs,"isFileLike");Skn.exports={FileLike:FJt,isFileLike:Rcs}});var wwe=I((CGd,Rkn)=>{"use strict";p();var{isBlobLike:Ltt,iteratorMixin:Pcs}=US(),{kState:U_}=Sq(),{kEnumerableProperty:Wue}=Os(),{FileLike:Tkn,isFileLike:kcs}=UJt(),{webidl:Au}=IA(),{File:wkn}=require("node:buffer"),Ikn=require("node:util"),xkn=globalThis.File??wkn,xwe=class t{static{a(this,"FormData")}constructor(e){if(Au.util.markAsUncloneable(this),e!==void 0)throw Au.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[U_]=[]}append(e,r,n=void 0){Au.brandCheck(this,t);let o="FormData.append";if(Au.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Ltt(r))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");e=Au.converters.USVString(e,o,"name"),r=Ltt(r)?Au.converters.Blob(r,o,"value",{strict:!1}):Au.converters.USVString(r,o,"value"),n=arguments.length===3?Au.converters.USVString(n,o,"filename"):void 0;let s=QJt(e,r,n);this[U_].push(s)}delete(e){Au.brandCheck(this,t);let r="FormData.delete";Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[U_]=this[U_].filter(n=>n.name!==e)}get(e){Au.brandCheck(this,t);let r="FormData.get";Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name");let n=this[U_].findIndex(o=>o.name===e);return n===-1?null:this[U_][n].value}getAll(e){Au.brandCheck(this,t);let r="FormData.getAll";return Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[U_].filter(n=>n.name===e).map(n=>n.value)}has(e){Au.brandCheck(this,t);let r="FormData.has";return Au.argumentLengthCheck(arguments,1,r),e=Au.converters.USVString(e,r,"name"),this[U_].findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Au.brandCheck(this,t);let o="FormData.set";if(Au.argumentLengthCheck(arguments,2,o),arguments.length===3&&!Ltt(r))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");e=Au.converters.USVString(e,o,"name"),r=Ltt(r)?Au.converters.Blob(r,o,"name",{strict:!1}):Au.converters.USVString(r,o,"name"),n=arguments.length===3?Au.converters.USVString(n,o,"name"):void 0;let s=QJt(e,r,n),c=this[U_].findIndex(l=>l.name===e);c!==-1?this[U_]=[...this[U_].slice(0,c),s,...this[U_].slice(c+1).filter(l=>l.name!==e)]:this[U_].push(s)}[Ikn.inspect.custom](e,r){let n=this[U_].reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=Ikn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}};Pcs("FormData",xwe,U_,"name","value");Object.defineProperties(xwe.prototype,{append:Wue,delete:Wue,get:Wue,getAll:Wue,has:Wue,set:Wue,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function QJt(t,e,r){if(typeof e!="string"){if(kcs(e)||(e=e instanceof Blob?new xkn([e],"blob",{type:e.type}):new Tkn(e,"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=e instanceof wkn?new xkn([e],r,n):new Tkn(e,r,n)}}return{name:t,value:e}}a(QJt,"makeEntry");Rkn.exports={FormData:xwe,makeEntry:QJt}});var Okn=I((TGd,Mkn)=>{"use strict";p();var{isUSVString:Pkn,bufferToLowerCasedHeaderName:Dcs}=Os(),{utf8DecodeBytes:Ncs}=US(),{HTTP_TOKEN_CODEPOINTS:Mcs,isomorphicDecode:kkn}=UC(),{isFileLike:Ocs}=UJt(),{makeEntry:Bcs}=wwe(),Ftt=require("node:assert"),{File:Lcs}=require("node:buffer"),Fcs=globalThis.File??Lcs,Ucs=Buffer.from('form-data; name="'),Dkn=Buffer.from("; filename"),Qcs=Buffer.from("--"),qcs=Buffer.from(`--\r +`);function jcs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(Hcs,"validateBoundary");function Gcs(t,e){Ftt(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)return"failure";let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0};for(;t[s.position]===13&&t[s.position+1]===10;)s.position+=2;let c=t.length;for(;t[c-1]===10&&t[c-2]===13;)c-=2;for(c!==t.length&&(t=t.subarray(0,c));;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===t.length-2&&Utt(t,Qcs,s)||s.position===t.length-4&&Utt(t,qcs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let l=$cs(t,s);if(l==="failure")return"failure";let{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)return"failure";m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)return"failure";s.position+=2;let g;d!==null?(f??="text/plain",jcs(f)||(f=""),g=new Fcs([m],d,{type:f})):g=Ncs(Buffer.from(m)),Ftt(Pkn(u)),Ftt(typeof g=="string"&&Pkn(g)||Ocs(g)),o.push(Bcs(u,g,d))}}a(Gcs,"multipartFormDataParser");function $cs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10)return r===null?"failure":{name:r,filename:n,contentType:o,encoding:s};let c=zue(l=>l!==10&&l!==13&&l!==58,t,e);if(c=qJt(c,!0,!0,l=>l===9||l===32),!Mcs.test(c.toString())||t[e.position]!==58)return"failure";switch(e.position++,zue(l=>l===32||l===9,t,e),Dcs(c)){case"content-disposition":{if(r=n=null,!Utt(t,Ucs,e)||(e.position+=17,r=Nkn(t,e),r===null))return"failure";if(Utt(t,Dkn,e)){let l=e.position+Dkn.length;if(t[l]===42&&(e.position+=1,l+=1),t[l]!==61||t[l+1]!==34||(e.position+=12,n=Nkn(t,e),n===null))return"failure"}break}case"content-type":{let l=zue(u=>u!==10&&u!==13,t,e);l=qJt(l,!1,!0,u=>u===9||u===32),o=kkn(l);break}case"content-transfer-encoding":{let l=zue(u=>u!==10&&u!==13,t,e);l=qJt(l,!1,!0,u=>u===9||u===32),s=kkn(l);break}default:zue(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13&&t[e.position+1]!==10)return"failure";e.position+=2}}a($cs,"parseMultipartFormDataHeaders");function Nkn(t,e){Ftt(t[e.position-1]===34);let r=zue(n=>n!==10&&n!==13&&n!==34,t,e);return t[e.position]!==34?null:(e.position++,r=new TextDecoder().decode(r).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),r)}a(Nkn,"parseMultipartFormDataName");function zue(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(qJt,"removeChars");function Utt(t,e,r){if(t.length{"use strict";p();var Rwe=Os(),{ReadableStreamFrom:Vcs,isBlobLike:Bkn,isReadableStreamLike:Wcs,readableStreamClose:zcs,createDeferredPromise:Ycs,fullyReadBody:Kcs,extractMimeType:Jcs,utf8DecodeBytes:Ukn}=US(),{FormData:Lkn}=wwe(),{kState:Kue}=Sq(),{webidl:Zcs}=IA(),{Blob:Xcs}=require("node:buffer"),jJt=require("node:assert"),{isErrored:Qkn,isDisturbed:els}=require("node:stream"),{isArrayBuffer:tls}=require("node:util/types"),{serializeAMimeType:rls}=UC(),{multipartFormDataParser:nls}=Okn(),HJt;try{let t=require("node:crypto");HJt=a(e=>t.randomInt(0,e),"random")}catch{HJt=a(t=>Math.floor(Math.random(t)),"random")}var Qtt=new TextEncoder;function ils(){}a(ils,"noop");var qkn=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,jkn;qkn&&(jkn=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!els(e)&&!Qkn(e)&&e.cancel("Response object has been garbage collected").catch(ils)}));function Hkn(t,e=!1){let r=null;t instanceof ReadableStream?r=t:Bkn(t)?r=t.stream():r=new ReadableStream({async pull(u){let d=typeof o=="string"?Qtt.encode(o):o;d.byteLength&&u.enqueue(d),queueMicrotask(()=>zcs(u))},start(){},type:"bytes"}),jJt(Wcs(r));let n=null,o=null,s=null,c=null;if(typeof t=="string")o=t,c="text/plain;charset=UTF-8";else if(t instanceof URLSearchParams)o=t.toString(),c="application/x-www-form-urlencoded;charset=UTF-8";else if(tls(t))o=new Uint8Array(t.slice());else if(ArrayBuffer.isView(t))o=new Uint8Array(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength));else if(Rwe.isFormDataLike(t)){let u=`----formdata-undici-0${`${HJt(1e11)}`.padStart(11,"0")}`,d=`--${u}\r Content-Disposition: form-data`;let f=a(E=>E.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"escape"),h=a(E=>E.replace(/\r?\n|\r/g,`\r -`),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[E,_]of t)if(typeof _=="string"){let v=Vtt.encode(d+`; name="${f(h(E))}"\r +`),"normalizeLinefeeds"),m=[],g=new Uint8Array([13,10]);s=0;let A=!1;for(let[E,_]of t)if(typeof _=="string"){let v=Qtt.encode(d+`; name="${f(h(E))}"\r \r ${h(_)}\r -`);m.push(v),s+=v.byteLength}else{let v=Vtt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r +`);m.push(v),s+=v.byteLength}else{let v=Qtt.encode(`${d}; name="${f(h(E))}"`+(_.name?`; filename="${f(_.name)}"`:"")+`\r Content-Type: ${_.type||"application/octet-stream"}\r \r -`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=Vtt.encode(`--${u}--\r -`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(NPn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(jwe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:ius(t)}if((typeof o=="string"||jwe.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!LPn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(QPn,"extractBody");function Aus(t,e=!1){return t instanceof ReadableStream&&(BJt(!jwe.isDisturbed(t),"The body has already been consumed."),BJt(!t.locked,"The stream is locked.")),QPn(t,e)}a(Aus,"safelyExtractBody");function yus(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(yus,"cloneBody");function Eus(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(Eus,"throwIfAborted");function _us(t){return{blob(){return Xue(this,r=>{let n=OPn(this);return n===null?n="":n&&(n=hus(n)),new dus([r],{type:n})},t)},arrayBuffer(){return Xue(this,r=>new Uint8Array(r).buffer,t)},text(){return Xue(this,BPn,t)},json(){return Xue(this,vus,t)},formData(){return Xue(this,r=>{let n=OPn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=mus(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new MPn;return s[ede]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new MPn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return Xue(this,r=>new Uint8Array(r),t)}}}a(_us,"bodyMixinMethods");function Cus(t){Object.assign(t.prototype,_us(t))}a(Cus,"mixinBody");async function Xue(t,e,r){if(uus.brandCheck(t,r),qPn(t))throw new TypeError("Body is unusable: Body has already been read");Eus(t[ede]);let n=aus(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[ede].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await cus(t[ede].body,s,o),n.promise)}a(Xue,"consumeBody");function qPn(t){let e=t[ede].body;return e!=null&&(e.stream.locked||jwe.isDisturbed(e.stream))}a(qPn,"bodyUnusable");function vus(t){return JSON.parse(BPn(t))}a(vus,"parseJSONFromBytes");function OPn(t){let e=t[ede].headersList,r=lus(e);return r==="failure"?null:r}a(OPn,"bodyMimeType");jPn.exports={extractBody:QPn,safelyExtractBody:Aus,cloneBody:yus,mixinBody:Cus,streamRegistry:UPn,hasFinalizationRegistry:FPn,bodyUnusable:qPn}});var XPn=I((eWd,ZPn)=>{"use strict";p();var Gi=require("node:assert"),yo=Ls(),{channels:HPn}=jue(),FJt=EJt(),{RequestContentLengthMismatchError:aJ,ResponseContentLengthMismatchError:bus,RequestAbortedError:YPn,HeadersTimeoutError:Sus,HeadersOverflowError:Tus,SocketError:Ztt,InformationalError:rde,BodyTimeoutError:Ius,HTTPParserError:xus,ResponseExceededMaxSizeError:wus}=mc(),{kUrl:KPn,kReset:$v,kClient:jJt,kParser:ep,kBlocking:$we,kRunning:rE,kPending:Rus,kSize:GPn,kWriting:Dq,kQueue:BP,kNoRef:Hwe,kKeepAliveDefaultTimeout:kus,kHostHeader:Pus,kPendingIdx:Dus,kRunningIdx:ew,kError:tw,kPipelining:Ktt,kSocket:nde,kKeepAliveTimeoutValue:Xtt,kMaxHeadersSize:UJt,kKeepAliveMaxTimeout:Nus,kKeepAliveTimeoutThreshold:Mus,kHeadersTimeout:Ous,kBodyTimeout:Bus,kStrictContentLength:HJt,kMaxRequests:$Pn,kCounter:Lus,kMaxResponseSize:Fus,kOnError:Uus,kResume:Pq,kHTTPContext:JPn}=Od(),NO=Ukn(),Qus=Buffer.alloc(0),Wtt=Buffer[Symbol.species],ztt=yo.addListener,qus=yo.removeAllListeners,QJt;async function jus(){let t=process.env.JEST_WORKER_ID?vJt():void 0,e;try{e=await WebAssembly.compile(jkn())}catch{e=await WebAssembly.compile(t||vJt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onStatus(new Wtt(MO.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(Gi(tm.ptr===r),tm.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onHeaderField(new Wtt(MO.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onHeaderValue(new Wtt(MO.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(Gi(tm.ptr===r),tm.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{Gi(tm.ptr===r);let s=n-OO+MO.byteOffset;return tm.onBody(new Wtt(MO.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(Gi(tm.ptr===r),tm.onMessageComplete()||0),"wasm_on_message_complete")}})}a(jus,"lazyllhttp");var qJt=null,GJt=jus();GJt.catch();var tm=null,MO=null,Ytt=0,OO=null,Hus=0,Gwe=1,ide=2|Gwe,Jtt=4|Gwe,$Jt=8|Hus,VJt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){Gi(Number.isFinite(e[UJt])&&e[UJt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(NO.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[UJt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Fus]}setTimeout(e,r){e!==this.timeoutValue||r&Gwe^this.timeoutType&Gwe?(this.timeout&&(FJt.clearTimeout(this.timeout),this.timeout=null),e&&(r&Gwe?this.timeout=FJt.setFastTimeout(VPn,e,new WeakRef(this)):(this.timeout=setTimeout(VPn,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Gi(this.ptr!=null),Gi(tm==null),this.llhttp.llhttp_resume(this.ptr),Gi(this.timeoutType===Jtt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||Qus),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Gi(this.ptr!=null),Gi(tm==null),Gi(!this.paused);let{socket:r,llhttp:n}=this;e.length>Ytt&&(OO&&n.free(OO),Ytt=Math.ceil(e.length/4096)*4096,OO=n.malloc(Ytt)),new Uint8Array(n.memory.buffer,OO,Ytt).set(e);try{let o;try{MO=e,tm=this,o=n.llhttp_execute(this.ptr,OO,e.length)}catch(c){throw c}finally{tm=null,MO=null}let s=n.llhttp_get_error_pos(this.ptr)-OO;if(o===NO.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===NO.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==NO.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new xus(l,NO.ERROR[o],e.slice(s))}}catch(o){yo.destroy(r,o)}}destroy(){Gi(this.ptr!=null),Gi(tm==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&FJt.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[BP][r[ew]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=yo.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&yo.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&yo.destroy(this.socket,new Tus)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Gi(r),Gi(n[nde]===o),Gi(!o.destroyed),Gi(!this.paused),Gi((s.length&1)===0);let l=n[BP][n[ew]];Gi(l),Gi(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[ep].destroy(),o[ep]=null,o[jJt]=null,o[tw]=null,qus(o),n[nde]=null,n[JPn]=null,n[BP][n[ew]++]=null,n.emit("disconnect",n[KPn],[n],new rde("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){yo.destroy(o,u)}n[Pq]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[BP][o[ew]];if(!u)return-1;if(Gi(!this.upgrade),Gi(this.statusCode<200),e===100)return yo.destroy(s,new Ztt("bad response",yo.getSocketInfo(s))),-1;if(r&&!u.upgrade)return yo.destroy(s,new Ztt("bad upgrade",yo.getSocketInfo(s))),-1;if(Gi(this.timeoutType===ide),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[$v]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Bus];this.setTimeout(f,Jtt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Gi(o[rE]===1),this.upgrade=!0,2;if(r)return Gi(o[rE]===1),this.upgrade=!0,2;if(Gi((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Ktt]){let f=this.keepAlive?yo.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Mus],o[Nus]);h<=0?s[$v]=!0:o[Xtt]=h}else o[Xtt]=o[kus]}else s[$v]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[$we]&&(s[$we]=!1,o[Pq]()),d?NO.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[BP][r[ew]];if(Gi(c),Gi(this.timeoutType===Jtt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Gi(o>=200),s>-1&&this.bytesRead+e.length>s)return yo.destroy(n,new wus),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return NO.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;Gi(n>=100),Gi((this.headers.length&1)===0);let d=e[BP][e[ew]];if(Gi(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return yo.destroy(r,new bus),-1;if(d.onComplete(s),e[BP][e[ew]++]=null,r[Dq])return Gi(e[rE]===0),yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED;if(u){if(r[$v]&&e[rE]===0)return yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED;e[Ktt]==null||e[Ktt]===1?setImmediate(()=>e[Pq]()):e[Pq]()}else return yo.destroy(r,new rde("reset")),NO.ERROR.PAUSED}}};function VPn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===ide?(!e[Dq]||e.writableNeedDrain||n[rE]>1)&&(Gi(!o,"cannot be paused while waiting for headers"),yo.destroy(e,new Sus)):r===Jtt?o||yo.destroy(e,new Ius):r===$Jt&&(Gi(n[rE]===0&&n[Xtt]),yo.destroy(e,new rde("socket idle timeout")))}a(VPn,"onParserTimeout");async function Gus(t,e){t[nde]=e,qJt||(qJt=await GJt,GJt=null),e[Hwe]=!1,e[Dq]=!1,e[$v]=!1,e[$we]=!1,e[ep]=new VJt(t,e,qJt),ztt(e,"error",function(n){Gi(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[ep];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[tw]=n,this[jJt][Uus](n)}),ztt(e,"readable",function(){let n=this[ep];n&&n.readMore()}),ztt(e,"end",function(){let n=this[ep];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}yo.destroy(this,new Ztt("other side closed",yo.getSocketInfo(this)))}),ztt(e,"close",function(){let n=this[jJt],o=this[ep];o&&(!this[tw]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[ep].destroy(),this[ep]=null);let s=this[tw]||new Ztt("closed",yo.getSocketInfo(this));if(n[nde]=null,n[JPn]=null,n.destroyed){Gi(n[Rus]===0);let c=n[BP].splice(n[ew]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[BP][n[ew]];n[BP][n[ew]++]=null,yo.errorRequest(n,c,s)}n[Dus]=n[ew],Gi(n[rE]===0),n.emit("disconnect",n[KPn],[n],s),n[Pq]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Wus(t,...n)},resume(){$us(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[Dq]||e[$v]||e[$we]||n&&(t[rE]>0&&!n.idempotent||t[rE]>0&&(n.upgrade||n.method==="CONNECT")||t[rE]>0&&yo.bodyLength(n.body)!==0&&(yo.isStream(n.body)||yo.isAsyncIterable(n.body)||yo.isFormDataLike(n.body))))}}}a(Gus,"connectH1");function $us(t){let e=t[nde];if(e&&!e.destroyed){if(t[GPn]===0?!e[Hwe]&&e.unref&&(e.unref(),e[Hwe]=!0):e[Hwe]&&e.ref&&(e.ref(),e[Hwe]=!1),t[GPn]===0)e[ep].timeoutType!==$Jt&&e[ep].setTimeout(t[Xtt],$Jt);else if(t[rE]>0&&e[ep].statusCode<200&&e[ep].timeoutType!==ide){let r=t[BP][t[ew]],n=r.headersTimeout!=null?r.headersTimeout:t[Ous];e[ep].setTimeout(n,ide)}}}a($us,"resumeH1");function Vus(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Vus,"shouldSendContentLength");function Wus(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(yo.isFormDataLike(u)){QJt||(QJt=tde().extractBody);let[E,_]=QJt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else yo.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=yo.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),Vus(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[HJt])return yo.errorRequest(t,e,new aJ),!1;process.emitWarning(new aJ)}let g=t[nde],A=a(E=>{e.aborted||e.completed||(yo.errorRequest(t,e,E||new YPn),yo.destroy(u),yo.destroy(g,new rde("aborted")))},"abort");try{e.onConnect(A)}catch(E){yo.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[$v]=!0),(s||r==="CONNECT")&&(g[$v]=!0),l!=null&&(g[$v]=l),t[$Pn]&&g[Lus]++>=t[$Pn]&&(g[$v]=!0),c&&(g[$we]=!0);let y=`${r} ${n} HTTP/1.1\r +`);m.push(v,_,g),typeof _.size=="number"?s+=v.byteLength+_.size+g.byteLength:A=!0}let y=Qtt.encode(`--${u}--\r +`);m.push(y),s+=y.byteLength,A&&(s=null),o=t,n=a(async function*(){for(let E of m)E.stream?yield*E.stream():yield E},"action"),c=`multipart/form-data; boundary=${u}`}else if(Bkn(t))o=t,s=t.size,t.type&&(c=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Rwe.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=t instanceof ReadableStream?t:Vcs(t)}if((typeof o=="string"||Rwe.isBuffer(o))&&(s=Buffer.byteLength(o)),n!=null){let u;r=new ReadableStream({async start(){u=n(t)[Symbol.asyncIterator]()},async pull(d){let{value:f,done:h}=await u.next();if(h)queueMicrotask(()=>{d.close(),d.byobRequest?.respond(0)});else if(!Qkn(r)){let m=new Uint8Array(f);m.byteLength&&d.enqueue(m)}return d.desiredSize>0},async cancel(d){await u.return()},type:"bytes"})}return[{stream:r,source:o,length:s},c]}a(Hkn,"extractBody");function ols(t,e=!1){return t instanceof ReadableStream&&(jJt(!Rwe.isDisturbed(t),"The body has already been consumed."),jJt(!t.locked,"The stream is locked.")),Hkn(t,e)}a(ols,"safelyExtractBody");function sls(t,e){let[r,n]=e.stream.tee();return e.stream=r,{stream:n,length:e.length,source:e.source}}a(sls,"cloneBody");function als(t){if(t.aborted)throw new DOMException("The operation was aborted.","AbortError")}a(als,"throwIfAborted");function cls(t){return{blob(){return Yue(this,r=>{let n=Fkn(this);return n===null?n="":n&&(n=rls(n)),new Xcs([r],{type:n})},t)},arrayBuffer(){return Yue(this,r=>new Uint8Array(r).buffer,t)},text(){return Yue(this,Ukn,t)},json(){return Yue(this,uls,t)},formData(){return Yue(this,r=>{let n=Fkn(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let o=nls(r,n);if(o==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new Lkn;return s[Kue]=o,s}case"application/x-www-form-urlencoded":{let o=new URLSearchParams(r.toString()),s=new Lkn;for(let[c,l]of o)s.append(c,l);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t)},bytes(){return Yue(this,r=>new Uint8Array(r),t)}}}a(cls,"bodyMixinMethods");function lls(t){Object.assign(t.prototype,cls(t))}a(lls,"mixinBody");async function Yue(t,e,r){if(Zcs.brandCheck(t,r),Gkn(t))throw new TypeError("Body is unusable: Body has already been read");als(t[Kue]);let n=Ycs(),o=a(c=>n.reject(c),"errorSteps"),s=a(c=>{try{n.resolve(e(c))}catch(l){o(l)}},"successSteps");return t[Kue].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Kcs(t[Kue].body,s,o),n.promise)}a(Yue,"consumeBody");function Gkn(t){let e=t[Kue].body;return e!=null&&(e.stream.locked||Rwe.isDisturbed(e.stream))}a(Gkn,"bodyUnusable");function uls(t){return JSON.parse(Ukn(t))}a(uls,"parseJSONFromBytes");function Fkn(t){let e=t[Kue].headersList,r=Jcs(e);return r==="failure"?null:r}a(Fkn,"bodyMimeType");$kn.exports={extractBody:Hkn,safelyExtractBody:ols,cloneBody:sls,mixinBody:lls,streamRegistry:jkn,hasFinalizationRegistry:qkn,bodyUnusable:Gkn}});var r2n=I((kGd,t2n)=>{"use strict";p();var ji=require("node:assert"),Ao=Os(),{channels:Vkn}=Fue(),GJt=TJt(),{RequestContentLengthMismatchError:XK,ResponseContentLengthMismatchError:dls,RequestAbortedError:Zkn,HeadersTimeoutError:fls,HeadersOverflowError:pls,SocketError:Vtt,InformationalError:Zue,BodyTimeoutError:hls,HTTPParserError:mls,ResponseExceededMaxSizeError:gls}=mc(),{kUrl:Xkn,kReset:QC,kClient:zJt,kParser:ip,kBlocking:Dwe,kRunning:nE,kPending:Als,kSize:Wkn,kWriting:Iq,kQueue:Mk,kNoRef:Pwe,kKeepAliveDefaultTimeout:yls,kHostHeader:Els,kPendingIdx:_ls,kRunningIdx:Xx,kError:ew,kPipelining:Gtt,kSocket:Xue,kKeepAliveTimeoutValue:Wtt,kMaxHeadersSize:$Jt,kKeepAliveMaxTimeout:vls,kKeepAliveTimeoutThreshold:Cls,kHeadersTimeout:bls,kBodyTimeout:Sls,kStrictContentLength:YJt,kMaxRequests:zkn,kCounter:Tls,kMaxResponseSize:Ils,kOnError:xls,kResume:Tq,kHTTPContext:e2n}=Nd(),xO=jPn(),wls=Buffer.alloc(0),qtt=Buffer[Symbol.species],jtt=Ao.addListener,Rls=Ao.removeAllListeners,VJt;async function Pls(){let t=process.env.JEST_WORKER_ID?wJt():void 0,e;try{e=await WebAssembly.compile($Pn())}catch{e=await WebAssembly.compile(t||wJt())}return await WebAssembly.instantiate(e,{env:{wasm_on_url:a((r,n,o)=>0,"wasm_on_url"),wasm_on_status:a((r,n,o)=>{ji(nm.ptr===r);let s=n-RO+wO.byteOffset;return nm.onStatus(new qtt(wO.buffer,s,o))||0},"wasm_on_status"),wasm_on_message_begin:a(r=>(ji(nm.ptr===r),nm.onMessageBegin()||0),"wasm_on_message_begin"),wasm_on_header_field:a((r,n,o)=>{ji(nm.ptr===r);let s=n-RO+wO.byteOffset;return nm.onHeaderField(new qtt(wO.buffer,s,o))||0},"wasm_on_header_field"),wasm_on_header_value:a((r,n,o)=>{ji(nm.ptr===r);let s=n-RO+wO.byteOffset;return nm.onHeaderValue(new qtt(wO.buffer,s,o))||0},"wasm_on_header_value"),wasm_on_headers_complete:a((r,n,o,s)=>(ji(nm.ptr===r),nm.onHeadersComplete(n,!!o,!!s)||0),"wasm_on_headers_complete"),wasm_on_body:a((r,n,o)=>{ji(nm.ptr===r);let s=n-RO+wO.byteOffset;return nm.onBody(new qtt(wO.buffer,s,o))||0},"wasm_on_body"),wasm_on_message_complete:a(r=>(ji(nm.ptr===r),nm.onMessageComplete()||0),"wasm_on_message_complete")}})}a(Pls,"lazyllhttp");var WJt=null,KJt=Pls();KJt.catch();var nm=null,wO=null,Htt=0,RO=null,kls=0,kwe=1,ede=2|kwe,$tt=4|kwe,JJt=8|kls,ZJt=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){ji(Number.isFinite(e[$Jt])&&e[$Jt]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(xO.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[$Jt],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[Ils]}setTimeout(e,r){e!==this.timeoutValue||r&kwe^this.timeoutType&kwe?(this.timeout&&(GJt.clearTimeout(this.timeout),this.timeout=null),e&&(r&kwe?this.timeout=GJt.setFastTimeout(Ykn,e,new WeakRef(this)):(this.timeout=setTimeout(Ykn,e,new WeakRef(this)),this.timeout.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(ji(this.ptr!=null),ji(nm==null),this.llhttp.llhttp_resume(this.ptr),ji(this.timeoutType===$tt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||wls),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){ji(this.ptr!=null),ji(nm==null),ji(!this.paused);let{socket:r,llhttp:n}=this;e.length>Htt&&(RO&&n.free(RO),Htt=Math.ceil(e.length/4096)*4096,RO=n.malloc(Htt)),new Uint8Array(n.memory.buffer,RO,Htt).set(e);try{let o;try{wO=e,nm=this,o=n.llhttp_execute(this.ptr,RO,e.length)}catch(c){throw c}finally{nm=null,wO=null}let s=n.llhttp_get_error_pos(this.ptr)-RO;if(o===xO.ERROR.PAUSED_UPGRADE)this.onUpgrade(e.slice(s));else if(o===xO.ERROR.PAUSED)this.paused=!0,r.unshift(e.slice(s));else if(o!==xO.ERROR.OK){let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}throw new mls(l,xO.ERROR[o],e.slice(s))}}catch(o){Ao.destroy(r,o)}}destroy(){ji(this.ptr!=null),ji(nm==null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&GJt.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){this.statusText=e.toString()}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[Mk][r[Xx]];if(!n)return-1;n.onResponseStarted()}onHeaderField(e){let r=this.headers.length;(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length)}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ao.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ao.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());this.trackHeader(e.length)}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ao.destroy(this.socket,new pls)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;ji(r),ji(n[Xue]===o),ji(!o.destroyed),ji(!this.paused),ji((s.length&1)===0);let l=n[Mk][n[Xx]];ji(l),ji(l.upgrade||l.method==="CONNECT"),this.statusCode=null,this.statusText="",this.shouldKeepAlive=null,this.headers=[],this.headersSize=0,o.unshift(e),o[ip].destroy(),o[ip]=null,o[zJt]=null,o[ew]=null,Rls(o),n[Xue]=null,n[e2n]=null,n[Mk][n[Xx]++]=null,n.emit("disconnect",n[Xkn],[n],new Zue("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ao.destroy(o,u)}n[Tq]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[Mk][o[Xx]];if(!u)return-1;if(ji(!this.upgrade),ji(this.statusCode<200),e===100)return Ao.destroy(s,new Vtt("bad response",Ao.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ao.destroy(s,new Vtt("bad upgrade",Ao.getSocketInfo(s))),-1;if(ji(this.timeoutType===ede),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[QC]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[Sls];this.setTimeout(f,$tt)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return ji(o[nE]===1),this.upgrade=!0,2;if(r)return ji(o[nE]===1),this.upgrade=!0,2;if(ji((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[Gtt]){let f=this.keepAlive?Ao.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[Cls],o[vls]);h<=0?s[QC]=!0:o[Wtt]=h}else o[Wtt]=o[yls]}else s[QC]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[Dwe]&&(s[Dwe]=!1,o[Tq]()),d?xO.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[Mk][r[Xx]];if(ji(c),ji(this.timeoutType===$tt),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),ji(o>=200),s>-1&&this.bytesRead+e.length>s)return Ao.destroy(n,new gls),-1;if(this.bytesRead+=e.length,c.onData(e)===!1)return xO.ERROR.PAUSED}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return;ji(n>=100),ji((this.headers.length&1)===0);let d=e[Mk][e[Xx]];if(ji(d),this.statusCode=null,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,!(n<200)){if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ao.destroy(r,new dls),-1;if(d.onComplete(s),e[Mk][e[Xx]++]=null,r[Iq])return ji(e[nE]===0),Ao.destroy(r,new Zue("reset")),xO.ERROR.PAUSED;if(u){if(r[QC]&&e[nE]===0)return Ao.destroy(r,new Zue("reset")),xO.ERROR.PAUSED;e[Gtt]==null||e[Gtt]===1?setImmediate(()=>e[Tq]()):e[Tq]()}else return Ao.destroy(r,new Zue("reset")),xO.ERROR.PAUSED}}};function Ykn(t){let{socket:e,timeoutType:r,client:n,paused:o}=t.deref();r===ede?(!e[Iq]||e.writableNeedDrain||n[nE]>1)&&(ji(!o,"cannot be paused while waiting for headers"),Ao.destroy(e,new fls)):r===$tt?o||Ao.destroy(e,new hls):r===JJt&&(ji(n[nE]===0&&n[Wtt]),Ao.destroy(e,new Zue("socket idle timeout")))}a(Ykn,"onParserTimeout");async function Dls(t,e){t[Xue]=e,WJt||(WJt=await KJt,KJt=null),e[Pwe]=!1,e[Iq]=!1,e[QC]=!1,e[Dwe]=!1,e[ip]=new ZJt(t,e,WJt),jtt(e,"error",function(n){ji(n.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let o=this[ip];if(n.code==="ECONNRESET"&&o.statusCode&&!o.shouldKeepAlive){o.onMessageComplete();return}this[ew]=n,this[zJt][xls](n)}),jtt(e,"readable",function(){let n=this[ip];n&&n.readMore()}),jtt(e,"end",function(){let n=this[ip];if(n.statusCode&&!n.shouldKeepAlive){n.onMessageComplete();return}Ao.destroy(this,new Vtt("other side closed",Ao.getSocketInfo(this)))}),jtt(e,"close",function(){let n=this[zJt],o=this[ip];o&&(!this[ew]&&o.statusCode&&!o.shouldKeepAlive&&o.onMessageComplete(),this[ip].destroy(),this[ip]=null);let s=this[ew]||new Vtt("closed",Ao.getSocketInfo(this));if(n[Xue]=null,n[e2n]=null,n.destroyed){ji(n[Als]===0);let c=n[Mk].splice(n[Xx]);for(let l=0;l0&&s.code!=="UND_ERR_INFO"){let c=n[Mk][n[Xx]];n[Mk][n[Xx]++]=null,Ao.errorRequest(n,c,s)}n[_ls]=n[Xx],ji(n[nE]===0),n.emit("disconnect",n[Xkn],[n],s),n[Tq]()});let r=!1;return e.on("close",()=>{r=!0}),{version:"h1",defaultPipelining:1,write(...n){return Ols(t,...n)},resume(){Nls(t)},destroy(n,o){r?queueMicrotask(o):e.destroy(n).on("close",o)},get destroyed(){return e.destroyed},busy(n){return!!(e[Iq]||e[QC]||e[Dwe]||n&&(t[nE]>0&&!n.idempotent||t[nE]>0&&(n.upgrade||n.method==="CONNECT")||t[nE]>0&&Ao.bodyLength(n.body)!==0&&(Ao.isStream(n.body)||Ao.isAsyncIterable(n.body)||Ao.isFormDataLike(n.body))))}}}a(Dls,"connectH1");function Nls(t){let e=t[Xue];if(e&&!e.destroyed){if(t[Wkn]===0?!e[Pwe]&&e.unref&&(e.unref(),e[Pwe]=!0):e[Pwe]&&e.ref&&(e.ref(),e[Pwe]=!1),t[Wkn]===0)e[ip].timeoutType!==JJt&&e[ip].setTimeout(t[Wtt],JJt);else if(t[nE]>0&&e[ip].statusCode<200&&e[ip].timeoutType!==ede){let r=t[Mk][t[Xx]],n=r.headersTimeout!=null?r.headersTimeout:t[bls];e[ip].setTimeout(n,ede)}}}a(Nls,"resumeH1");function Mls(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(Mls,"shouldSendContentLength");function Ols(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ao.isFormDataLike(u)){VJt||(VJt=Jue().extractBody);let[E,_]=VJt(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ao.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ao.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),Mls(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[YJt])return Ao.errorRequest(t,e,new XK),!1;process.emitWarning(new XK)}let g=t[Xue],A=a(E=>{e.aborted||e.completed||(Ao.errorRequest(t,e,E||new Zkn),Ao.destroy(u),Ao.destroy(g,new Zue("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ao.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[QC]=!0),(s||r==="CONNECT")&&(g[QC]=!0),l!=null&&(g[QC]=l),t[zkn]&&g[Tls]++>=t[zkn]&&(g[QC]=!0),c&&(g[Dwe]=!0);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[Pus],s?y+=`connection: upgrade\r +`:y+=t[Els],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[Ktt]&&!g[$v]?y+=`connection: keep-alive\r +`:t[Gtt]&&!g[QC]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new YPn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Gi(o.destroyed||o[Dq]&&r[rE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?yo.destroy(e,A):yo.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(zus,"writeStream");function WPn(t,e,r,n,o,s,c,l){try{e?yo.isBuffer(e)&&(Gi(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return Vkn.sendHeaders.hasSubscribers&&Vkn.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?Kkn(A,null,t,e,g,f,y,h):Ao.isBuffer(u)?Kkn(A,u,t,e,g,f,y,h):Ao.isBlobLike(u)?typeof u.stream=="function"?Jkn(A,u.stream(),t,e,g,f,y,h):Lls(A,u,t,e,g,f,y,h):Ao.isStream(u)?Bls(A,u,t,e,g,f,y,h):Ao.isIterable(u)?Jkn(A,u,t,e,g,f,y,h):ji(!1),!0}a(Ols,"writeH1");function Bls(t,e,r,n,o,s,c,l){ji(s!==0||r[nE]===0,"stream body cannot be pipelined");let u=!1,d=new ztt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Ao.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new Zkn;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,ji(o.destroyed||o[Iq]&&r[nE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ao.destroy(e,A):Ao.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(()=>g(e.errored)):(e.endEmitted??e.readableEnded)&&setImmediate(()=>g(null)),(e.closeEmitted??e.closed)&&setImmediate(m)}a(Bls,"writeStream");function Kkn(t,e,r,n,o,s,c,l){try{e?Ao.isBuffer(e)&&(ji(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[$v]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[QC]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Gi(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[Pq]()}catch(u){t(u)}}a(WPn,"writeBuffer");async function Yus(t,e,r,n,o,s,c,l){Gi(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new aJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1"):(ji(s===null,"no body must not have content length"),o.write(`${c}\r +`,"latin1")),n.onRequestSent(),r[Tq]()}catch(u){t(u)}}a(Kkn,"writeBuffer");async function Lls(t,e,r,n,o,s,c,l){ji(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new XK;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[$v]=!0),r[Pq]()}catch(u){t(u)}}a(Yus,"writeBlob");async function zPn(t,e,r,n,o,s,c,l){Gi(s!==0||r[rE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Gi(u===null),o[tw]?g(o[tw]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new ert({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[tw])throw o[tw];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(zPn,"writeIterable");var ert=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[Dq]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[tw])throw r[tw];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[HJt])throw new aJ;process.emitWarning(new aJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[$v]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[QC]=!0),r[Tq]()}catch(u){t(u)}}a(Lls,"writeBlob");async function Jkn(t,e,r,n,o,s,c,l){ji(s!==0||r[nE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{ji(u===null),o[ew]?g(o[ew]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new ztt({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[ew])throw o[ew];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(Jkn,"writeIterable");var ztt=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[Iq]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[ew])throw r[ew];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[YJt])throw new XK;process.emitWarning(new XK)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[QC]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[ep].timeout&&r[ep].timeoutType===ide&&r[ep].timeout.refresh&&r[ep].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Dq]=!1,e[tw])throw e[tw];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[ip].timeout&&r[ip].timeoutType===ede&&r[ip].timeout.refresh&&r[ip].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[Iq]=!1,e[ew])throw e[ew];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[HJt])throw new aJ;process.emitWarning(new aJ)}e[ep].timeout&&e[ep].timeoutType===ide&&e[ep].timeout.refresh&&e[ep].timeout.refresh(),n[Pq]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Dq]=!1,e&&(Gi(n[rE]<=1,"pipeline should only contain this request"),o(e))}};ZPn.exports=Gus});var a2n=I((nWd,s2n)=>{"use strict";p();var rw=require("node:assert"),{pipeline:Kus}=require("node:stream"),ua=Ls(),{RequestContentLengthMismatchError:WJt,RequestAbortedError:e2n,SocketError:Vwe,InformationalError:zJt}=mc(),{kUrl:trt,kReset:nrt,kClient:ode,kRunning:irt,kPending:Jus,kQueue:Nq,kPendingIdx:YJt,kRunningIdx:LP,kError:UP,kSocket:pg,kStrictContentLength:Zus,kOnError:KJt,kMaxConcurrentStreams:o2n,kHTTP2Session:FP,kResume:Mq,kSize:Xus,kHTTPContext:eds}=Od(),Z3=Symbol("open streams"),t2n,r2n=!1,rrt;try{rrt=require("node:http2")}catch{rrt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:tds,HTTP2_HEADER_METHOD:rds,HTTP2_HEADER_PATH:nds,HTTP2_HEADER_SCHEME:ids,HTTP2_HEADER_CONTENT_LENGTH:ods,HTTP2_HEADER_EXPECT:sds,HTTP2_HEADER_STATUS:ads}}=rrt;function cds(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(cds,"parseH2Headers");async function lds(t,e){t[pg]=e,r2n||(r2n=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=rrt.connect(t[trt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[o2n]});r[Z3]=0,r[ode]=t,r[pg]=e,ua.addListener(r,"error",dds),ua.addListener(r,"frameError",fds),ua.addListener(r,"end",pds),ua.addListener(r,"goaway",hds),ua.addListener(r,"close",function(){let{[ode]:o}=this,{[pg]:s}=o,c=this[pg][UP]||this[UP]||new Vwe("closed",ua.getSocketInfo(s));if(o[FP]=null,o.destroyed){rw(o[Jus]===0);let l=o[Nq].splice(o[LP]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return gds(t,...o)},resume(){uds(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(lds,"connectH2");function uds(t){let e=t[pg];e?.destroyed===!1&&(t[Xus]===0&&t[o2n]===0?(e.unref(),t[FP].unref()):(e.ref(),t[FP].ref()))}a(uds,"resumeH2");function dds(t){rw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[pg][UP]=t,this[ode][KJt](t)}a(dds,"onHttp2SessionError");function fds(t,e,r){if(r===0){let n=new zJt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[pg][UP]=n,this[ode][KJt](n)}}a(fds,"onHttp2FrameError");function pds(){let t=new Vwe("other side closed",ua.getSocketInfo(this[pg]));this.destroy(t),ua.destroy(this[pg],t)}a(pds,"onHttp2SessionEnd");function hds(t){let e=this[UP]||new Vwe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ua.getSocketInfo(this)),r=this[ode];if(r[pg]=null,r[eds]=null,this[FP]!=null&&(this[FP].destroy(e),this[FP]=null),ua.destroy(this[pg],e),r[LP]{e.aborted||e.completed||(T=T||new e2n,ua.errorRequest(t,e,T),m!=null&&ua.destroy(m,T),ua.destroy(f,T),t[Nq][t[LP]++]=null,t[Mq]())},"abort");try{e.onConnect(y)}catch(T){ua.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[Z3],t[Nq][t[LP]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[Z3],t[Nq][t[LP]++]=null}),m.once("close",()=>{r[Z3]-=1,r[Z3]===0&&r.unref()}),!0;h[nds]=o,h[ids]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=ua.bodyLength(f);if(ua.isFormDataLike(f)){t2n??=tde().extractBody;let[T,w]=t2n(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),mds(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Zus])return ua.errorRequest(t,e,new WJt),!1;process.emitWarning(new WJt)}_!=null&&(rw(f,"no body must not have content length"),h[ods]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[sds]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[Z3],m.once("response",T=>{let{[ads]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new e2n;ua.errorRequest(t,e,x),ua.destroy(m,x);return}e.onHeaders(Number(w),cds(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[Z3]===0&&r.unref(),y(new zJt("HTTP/2: stream half-closed (remote)")),t[Nq][t[LP]++]=null,t[YJt]=t[LP],t[Mq]()}),m.once("close",()=>{r[Z3]-=1,r[Z3]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new zJt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?n2n(y,m,null,t,e,t[pg],_,E):ua.isBuffer(f)?n2n(y,m,f,t,e,t[pg],_,E):ua.isBlobLike(f)?typeof f.stream=="function"?i2n(y,m,f.stream(),t,e,t[pg],_,E):yds(y,m,f,t,e,t[pg],_,E):ua.isStream(f)?Ads(y,t[pg],E,m,f,t,e,_):ua.isIterable(f)?i2n(y,m,f,t,e,t[pg],_,E):rw(!1)}a(b,"writeBodyH2")}a(gds,"writeH2");function n2n(t,e,r,n,o,s,c,l){try{r!=null&&ua.isBuffer(r)&&(rw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[nrt]=!0),o.onRequestSent(),n[Mq]()}catch(u){t(u)}}a(n2n,"writeBuffer");function Ads(t,e,r,n,o,s,c,l){rw(l!==0||s[irt]===0,"stream body cannot be pipelined");let u=Kus(o,n,f=>{f?(ua.destroy(u,f),t(f)):(ua.removeAllListeners(u),c.onRequestSent(),r||(e[nrt]=!0),s[Mq]())});ua.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(Ads,"writeStream");async function yds(t,e,r,n,o,s,c,l){rw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new WJt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[nrt]=!0),n[Mq]()}catch(u){t(u)}}a(yds,"writeBlob");async function i2n(t,e,r,n,o,s,c,l){rw(c!==0||n[irt]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{rw(u===null),s[UP]?m(s[UP]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[UP])throw s[UP];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[nrt]=!0),n[Mq]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(i2n,"writeIterable");s2n.exports=lds});var srt=I((sWd,u2n)=>{"use strict";p();var BO=Ls(),{kBodyUsed:Wwe}=Od(),ZJt=require("node:assert"),{InvalidArgumentError:Eds}=mc(),_ds=require("node:events"),Cds=[300,301,302,303,307,308],c2n=Symbol("body"),ort=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[c2n]=e,this[Wwe]=!1}async*[Symbol.asyncIterator](){ZJt(!this[Wwe],"disturbed"),this[Wwe]=!0,yield*this[c2n]}},JJt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Eds("maxRedirections must be a positive number");BO.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,BO.isStream(this.opts.body)?(BO.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){ZJt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Wwe]=!1,_ds.prototype.on.call(this.opts.body,"data",function(){this[Wwe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new ort(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&BO.isIterable(this.opts.body)&&(this.opts.body=new ort(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||BO.isDisturbed(this.opts.body)?null:vds(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=BO.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=bds(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function vds(t,e){if(Cds.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var Sds=srt();function Tds({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new Sds(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(Tds,"createRedirectInterceptor");d2n.exports=Tds});var cde=I((fWd,C2n)=>{"use strict";p();var X3=require("node:assert"),A2n=require("node:net"),Ids=require("node:http"),cJ=Ls(),{channels:sde}=jue(),xds=Ikn(),wds=Vue(),{InvalidArgumentError:zp,InformationalError:Rds,ClientDestroyedError:kds}=mc(),Pds=Mwe(),{kUrl:LO,kServerName:Oq,kClient:Dds,kBusy:XJt,kConnect:Nds,kResuming:lJ,kRunning:Zwe,kPending:Xwe,kSize:Jwe,kQueue:QP,kConnected:Mds,kConnecting:ade,kNeedDrain:Lq,kKeepAliveDefaultTimeout:f2n,kHostHeader:Ods,kPendingIdx:qP,kRunningIdx:eF,kError:Bds,kPipelining:crt,kKeepAliveTimeoutValue:Lds,kMaxHeadersSize:Fds,kKeepAliveMaxTimeout:Uds,kKeepAliveTimeoutThreshold:Qds,kHeadersTimeout:qds,kBodyTimeout:jds,kStrictContentLength:Hds,kConnector:zwe,kMaxRedirections:Gds,kMaxRequests:eZt,kCounter:$ds,kClose:Vds,kDestroy:Wds,kDispatch:zds,kInterceptors:p2n,kLocalAddress:Ywe,kMaxResponseSize:Yds,kOnError:Kds,kHTTPContext:Yp,kMaxConcurrentStreams:Jds,kResume:Kwe}=Od(),Zds=XPn(),Xds=a2n(),h2n=!1,Bq=Symbol("kClosedResolve"),m2n=a(()=>{},"noop");function y2n(t){return t[crt]??t[Yp]?.defaultPipelining??1}a(y2n,"getPipelining");var tZt=class extends wds{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:k,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:L,allowH2:B}={}){if(super(),f!==void 0)throw new zp("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new zp("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new zp("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new zp("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new zp("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new zp("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new zp("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new zp("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new zp("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new zp("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new zp("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new zp("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new zp("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new zp("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new zp("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new zp("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||A2n.isIP(x)===0))throw new zp("localAddress must be valid string IP address");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new zp("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new zp("autoSelectFamilyAttemptTimeout must be a positive number");if(B!=null&&typeof B!="boolean")throw new zp("allowH2 must be a valid boolean value");if(L!=null&&(typeof L!="number"||L<1))throw new zp("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Pds({..._,maxCachedSessions:b,allowH2:B,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[p2n]=r.Client,h2n||(h2n=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[p2n]=[efs({maxRedirections:T})],this[LO]=cJ.parseOrigin(e),this[zwe]=w,this[crt]=E??1,this[Fds]=n||Ids.maxHeaderSize,this[f2n]=h??4e3,this[Uds]=g??6e5,this[Qds]=A??2e3,this[Lds]=this[f2n],this[Oq]=null,this[Ywe]=x??null,this[lJ]=0,this[Lq]=0,this[Ods]=`host: ${this[LO].hostname}${this[LO].port?`:${this[LO].port}`:""}\r -`,this[jds]=u??3e5,this[qds]=o??3e5,this[Hds]=v??!0,this[Gds]=T,this[eZt]=R,this[Bq]=null,this[Yds]=k>-1?k:-1,this[Jds]=L??100,this[Yp]=null,this[QP]=[],this[eF]=0,this[qP]=0,this[Kwe]=Q=>rZt(this,Q),this[Kds]=Q=>E2n(this,Q)}get pipelining(){return this[crt]}set pipelining(e){this[crt]=e,this[Kwe](!0)}get[Xwe](){return this[QP].length-this[qP]}get[Zwe](){return this[qP]-this[eF]}get[Jwe](){return this[QP].length-this[eF]}get[Mds](){return!!this[Yp]&&!this[ade]&&!this[Yp].destroyed}get[XJt](){return!!(this[Yp]?.busy(null)||this[Jwe]>=(y2n(this)||1)||this[Xwe]>0)}[Nds](e){_2n(this),this.once("connect",e)}[zds](e,r){let n=e.origin||this[LO].origin,o=new xds(n,e,r);return this[QP].push(o),this[lJ]||(cJ.bodyLength(o.body)==null&&cJ.isIterable(o.body)?(this[lJ]=1,queueMicrotask(()=>rZt(this))):this[Kwe](!0)),this[lJ]&&this[Lq]!==2&&this[XJt]&&(this[Lq]=2),this[Lq]<2}async[Vds](){return new Promise(e=>{this[Jwe]?this[Bq]=e:e(null)})}async[Wds](e){return new Promise(r=>{let n=this[QP].splice(this[qP]);for(let s=0;s{this[Bq]&&(this[Bq](),this[Bq]=null),r(null)},"callback");this[Yp]?(this[Yp].destroy(e,o),this[Yp]=null):queueMicrotask(o),this[Kwe]()})}},efs=art();function E2n(t,e){if(t[Zwe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){X3(t[qP]===t[eF]);let r=t[QP].splice(t[eF]);for(let n=0;n{t[zwe]({host:e,hostname:r,protocol:n,port:o,servername:t[Oq],localAddress:t[Ywe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){cJ.destroy(s.on("error",m2n),new kds);return}X3(s);try{t[Yp]=s.alpnProtocol==="h2"?await Xds(t,s):await Zds(t,s)}catch(c){throw s.destroy().on("error",m2n),c}t[ade]=!1,s[$ds]=0,s[eZt]=t[eZt],s[Dds]=t,s[Bds]=null,sde.connected.hasSubscribers&&sde.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Yp]?.version,servername:t[Oq],localAddress:t[Ywe]},connector:t[zwe],socket:s}),t.emit("connect",t[LO],[t])}catch(s){if(t.destroyed)return;if(t[ade]=!1,sde.connectError.hasSubscribers&&sde.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Yp]?.version,servername:t[Oq],localAddress:t[Ywe]},connector:t[zwe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(X3(t[Zwe]===0);t[Xwe]>0&&t[QP][t[qP]].servername===t[Oq];){let c=t[QP][t[qP]++];cJ.errorRequest(t,c,s)}else E2n(t,s);t.emit("connectionError",t[LO],[t],s)}t[Kwe]()}a(_2n,"connect");function g2n(t){t[Lq]=0,t.emit("drain",t[LO],[t])}a(g2n,"emitDrain");function rZt(t,e){t[lJ]!==2&&(t[lJ]=2,tfs(t,e),t[lJ]=0,t[eF]>256&&(t[QP].splice(0,t[eF]),t[qP]-=t[eF],t[eF]=0))}a(rZt,"resume");function tfs(t,e){for(;;){if(t.destroyed){X3(t[Xwe]===0);return}if(t[Bq]&&!t[Jwe]){t[Bq](),t[Bq]=null;return}if(t[Yp]&&t[Yp].resume(),t[XJt])t[Lq]=2;else if(t[Lq]===2){e?(t[Lq]=1,queueMicrotask(()=>g2n(t))):g2n(t);continue}if(t[Xwe]===0||t[Zwe]>=(y2n(t)||1))return;let r=t[QP][t[qP]];if(t[LO].protocol==="https:"&&t[Oq]!==r.servername){if(t[Zwe]>0)return;t[Oq]=r.servername,t[Yp]?.destroy(new Rds("servername changed"),()=>{t[Yp]=null,rZt(t)})}if(t[ade])return;if(!t[Yp]){_2n(t);return}if(t[Yp].destroyed||t[Yp].busy(r))return;!r.aborted&&t[Yp].write(r)?t[qP]++:t[QP].splice(t[qP],1)}}a(tfs,"_resume");C2n.exports=tZt});var nZt=I((gWd,v2n)=>{"use strict";p();var lrt=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};v2n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new lrt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new lrt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var S2n=I((EWd,b2n)=>{p();var{kFree:rfs,kConnected:nfs,kPending:ifs,kQueued:ofs,kRunning:sfs,kSize:afs}=Od(),uJ=Symbol("pool"),iZt=class{static{a(this,"PoolStats")}constructor(e){this[uJ]=e}get connected(){return this[uJ][nfs]}get free(){return this[uJ][rfs]}get pending(){return this[uJ][ifs]}get queued(){return this[uJ][ofs]}get running(){return this[uJ][sfs]}get size(){return this[uJ][afs]}};b2n.exports=iZt});var uZt=I((vWd,M2n)=>{"use strict";p();var cfs=Vue(),lfs=nZt(),{kConnected:oZt,kSize:T2n,kRunning:I2n,kPending:x2n,kQueued:eRe,kBusy:ufs,kFree:dfs,kUrl:ffs,kClose:pfs,kDestroy:hfs,kDispatch:mfs}=Od(),gfs=S2n(),Vv=Symbol("clients"),j_=Symbol("needDrain"),tRe=Symbol("queue"),sZt=Symbol("closed resolve"),aZt=Symbol("onDrain"),w2n=Symbol("onConnect"),R2n=Symbol("onDisconnect"),k2n=Symbol("onConnectionError"),cZt=Symbol("get dispatcher"),D2n=Symbol("add client"),N2n=Symbol("remove client"),P2n=Symbol("stats"),lZt=class extends cfs{static{a(this,"PoolBase")}constructor(){super(),this[tRe]=new lfs,this[Vv]=[],this[eRe]=0;let e=this;this[aZt]=a(function(n,o){let s=e[tRe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[eRe]--,c=!this.dispatch(l.opts,l.handler)}this[j_]=c,!this[j_]&&e[j_]&&(e[j_]=!1,e.emit("drain",n,[e,...o])),e[sZt]&&s.isEmpty()&&Promise.all(e[Vv].map(l=>l.close())).then(e[sZt])},"onDrain"),this[w2n]=(r,n)=>{e.emit("connect",r,[e,...n])},this[R2n]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[k2n]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[P2n]=new gfs(this)}get[ufs](){return this[j_]}get[oZt](){return this[Vv].filter(e=>e[oZt]).length}get[dfs](){return this[Vv].filter(e=>e[oZt]&&!e[j_]).length}get[x2n](){let e=this[eRe];for(let{[x2n]:r}of this[Vv])e+=r;return e}get[I2n](){let e=0;for(let{[I2n]:r}of this[Vv])e+=r;return e}get[T2n](){let e=this[eRe];for(let{[T2n]:r}of this[Vv])e+=r;return e}get stats(){return this[P2n]}async[pfs](){this[tRe].isEmpty()?await Promise.all(this[Vv].map(e=>e.close())):await new Promise(e=>{this[sZt]=e})}async[hfs](e){for(;;){let r=this[tRe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[Vv].map(r=>r.destroy(e)))}[mfs](e,r){let n=this[cZt]();return n?n.dispatch(e,r)||(n[j_]=!0,this[j_]=!this[cZt]()):(this[j_]=!0,this[tRe].push({opts:e,handler:r}),this[eRe]++),!this[j_]}[D2n](e){return e.on("drain",this[aZt]).on("connect",this[w2n]).on("disconnect",this[R2n]).on("connectionError",this[k2n]),this[Vv].push(e),this[j_]&&queueMicrotask(()=>{this[j_]&&this[aZt](e[ffs],[this,e])}),this}[N2n](e){e.close(()=>{let r=this[Vv].indexOf(e);r!==-1&&this[Vv].splice(r,1)}),this[j_]=this[Vv].some(r=>!r[j_]&&r.closed!==!0&&r.destroyed!==!0)}};M2n.exports={PoolBase:lZt,kClients:Vv,kNeedDrain:j_,kAddClient:D2n,kRemoveClient:N2n,kGetDispatcher:cZt}});var lde=I((TWd,F2n)=>{"use strict";p();var{PoolBase:Afs,kClients:urt,kNeedDrain:yfs,kAddClient:Efs,kGetDispatcher:_fs}=uZt(),Cfs=cde(),{InvalidArgumentError:dZt}=mc(),O2n=Ls(),{kUrl:B2n,kInterceptors:vfs}=Od(),bfs=Mwe(),fZt=Symbol("options"),pZt=Symbol("connections"),L2n=Symbol("factory");function Sfs(t,e){return new Cfs(t,e)}a(Sfs,"defaultFactory");var hZt=class extends Afs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Sfs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new dZt("invalid connections");if(typeof n!="function")throw new dZt("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new dZt("connect must be a function or an object");typeof o!="function"&&(o=bfs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[vfs]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[pZt]=r||null,this[B2n]=O2n.parseOrigin(e),this[fZt]={...O2n.deepClone(m),connect:o,allowH2:h},this[fZt].interceptors=m.interceptors?{...m.interceptors}:void 0,this[L2n]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[urt].indexOf(E);_!==-1&&this[urt].splice(_,1)}})}[_fs](){for(let e of this[urt])if(!e[yfs])return e;if(!this[pZt]||this[urt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:Tfs,InvalidArgumentError:Ifs}=mc(),{PoolBase:xfs,kClients:nE,kNeedDrain:rRe,kAddClient:wfs,kRemoveClient:Rfs,kGetDispatcher:kfs}=uZt(),Pfs=lde(),{kUrl:mZt,kInterceptors:Dfs}=Od(),{parseOrigin:U2n}=Ls(),Q2n=Symbol("factory"),drt=Symbol("options"),q2n=Symbol("kGreatestCommonDivisor"),dJ=Symbol("kCurrentWeight"),fJ=Symbol("kIndex"),nw=Symbol("kWeight"),frt=Symbol("kMaxWeightPerServer"),prt=Symbol("kErrorPenalty");function Nfs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Nfs,"getGreatestCommonDivisor");function Mfs(t,e){return new Pfs(t,e)}a(Mfs,"defaultFactory");var gZt=class extends xfs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Mfs,...n}={}){if(super(),this[drt]=n,this[fJ]=-1,this[dJ]=0,this[frt]=this[drt].maxWeightPerServer||100,this[prt]=this[drt].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new Ifs("factory must be a function.");this[Dfs]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[Q2n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=U2n(e).origin;if(this[nE].find(o=>o[mZt].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[Q2n](r,Object.assign({},this[drt]));this[wfs](n),n.on("connect",()=>{n[nw]=Math.min(this[frt],n[nw]+this[prt])}),n.on("connectionError",()=>{n[nw]=Math.max(1,n[nw]-this[prt]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[nw]=Math.max(1,n[nw]-this[prt]),this._updateBalancedPoolStats())});for(let o of this[nE])o[nw]=this[frt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[mZt].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Rfs](n),this}get upstreams(){return this[nE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[mZt].origin)}[kfs](){if(this[nE].length===0)throw new Tfs;if(!this[nE].find(s=>!s[rRe]&&s.closed!==!0&&s.destroyed!==!0)||this[nE].map(s=>s[rRe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[nE].findIndex(s=>!s[rRe]);for(;n++this[nE][o][nw]&&!s[rRe]&&(o=this[fJ]),this[fJ]===0&&(this[dJ]=this[dJ]-this[q2n],this[dJ]<=0&&(this[dJ]=this[frt])),s[nw]>=this[dJ]&&!s[rRe])return s}return this[dJ]=this[nE][o][nw],this[fJ]=o,this[nE][o]}};j2n.exports=gZt});var ude=I((PWd,K2n)=>{"use strict";p();var{InvalidArgumentError:hrt}=mc(),{kClients:Fq,kRunning:G2n,kClose:Ofs,kDestroy:Bfs,kDispatch:Lfs,kInterceptors:Ffs}=Od(),Ufs=Vue(),Qfs=lde(),qfs=cde(),jfs=Ls(),Hfs=art(),$2n=Symbol("onConnect"),V2n=Symbol("onDisconnect"),W2n=Symbol("onConnectionError"),Gfs=Symbol("maxRedirections"),z2n=Symbol("onDrain"),Y2n=Symbol("factory"),AZt=Symbol("options");function $fs(t,e){return e&&e.connections===1?new qfs(t,e):new Qfs(t,e)}a($fs,"defaultFactory");var yZt=class extends Ufs{static{a(this,"Agent")}constructor({factory:e=$fs,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new hrt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new hrt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new hrt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Ffs]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[Hfs({maxRedirections:r})],this[AZt]={...jfs.deepClone(o),connect:n},this[AZt].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Gfs]=r,this[Y2n]=e,this[Fq]=new Map,this[z2n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[$2n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[V2n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[W2n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[G2n](){let e=0;for(let r of this[Fq].values())e+=r[G2n];return e}[Lfs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new hrt("opts.origin must be a non-empty string or URL.");let o=this[Fq].get(n);return o||(o=this[Y2n](e.origin,this[AZt]).on("drain",this[z2n]).on("connect",this[$2n]).on("disconnect",this[V2n]).on("connectionError",this[W2n]),this[Fq].set(n,o)),o.dispatch(e,r)}async[Ofs](){let e=[];for(let r of this[Fq].values())e.push(r.close());this[Fq].clear(),await Promise.all(e)}async[Bfs](e){let r=[];for(let n of this[Fq].values())r.push(n.destroy(e));this[Fq].clear(),await Promise.all(r)}};K2n.exports=yZt});var bZt=I((MWd,aDn)=>{"use strict";p();var{kProxy:EZt,kClose:rDn,kDestroy:nDn,kDispatch:J2n,kInterceptors:Vfs}=Od(),{URL:pJ}=require("node:url"),Wfs=ude(),iDn=lde(),oDn=Vue(),{InvalidArgumentError:dde,RequestAbortedError:zfs,SecureProxyConnectionError:Yfs}=mc(),Z2n=Mwe(),sDn=cde(),mrt=Symbol("proxy agent"),grt=Symbol("proxy client"),Uq=Symbol("proxy headers"),_Zt=Symbol("request tls settings"),X2n=Symbol("proxy tls settings"),eDn=Symbol("connect endpoint function"),tDn=Symbol("tunnel proxy");function Kfs(t){return t==="https:"?443:80}a(Kfs,"defaultProtocolPort");function Jfs(t,e){return new iDn(t,e)}a(Jfs,"defaultFactory");var Zfs=a(()=>{},"noop");function Xfs(t,e){return e.connections===1?new sDn(t,e):new iDn(t,e)}a(Xfs,"defaultAgentFactory");var CZt=class extends oDn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new dde("Proxy URL is mandatory");this[Uq]=r,o?this.#e=o(e,{connect:n}):this.#e=new sDn(e,{connect:n})}[J2n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new dde("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new pJ(o);c.host=l}return e.headers={...this[Uq],...c},this.#e[J2n](e,r)}async[rDn](){return this.#e.close()}async[nDn](e){return this.#e.destroy(e)}},vZt=class extends oDn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof pJ)&&!e.uri)throw new dde("Proxy uri is mandatory");let{clientFactory:r=Jfs}=e;if(typeof r!="function")throw new dde("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[EZt]={uri:s,protocol:u},this[Vfs]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[_Zt]=e.requestTls,this[X2n]=e.proxyTls,this[Uq]=e.headers||{},this[tDn]=n,e.auth&&e.token)throw new dde("opts.auth cannot be used in combination with opts.token");e.auth?this[Uq]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Uq]["proxy-authorization"]=e.token:d&&f&&(this[Uq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=Z2n({...e.proxyTls});this[eDn]=Z2n({...e.requestTls});let g=e.factory||Xfs,A=a((y,E)=>{let{protocol:_}=new pJ(y);return!this[tDn]&&_==="http:"&&this[EZt].protocol==="http:"?new CZt(this[EZt].uri,{headers:this[Uq],connect:m,factory:g}):g(y,E)},"factory");this[grt]=r(o,{connect:m}),this[mrt]=new Wfs({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${Kfs(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[grt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[Uq],host:y.host},servername:this[X2n]?.servername||h});if(b!==200&&(v.on("error",Zfs).destroy(),E(new zfs(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[_Zt]?T=this[_Zt].servername:T=y.servername,this[eDn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Yfs(v)):E(v)}},"connect")})}dispatch(e,r){let n=eps(e.headers);if(tps(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new pJ(e.origin);n.host=o}return this[mrt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new pJ(e):e instanceof pJ?e:new pJ(e.uri)}async[rDn](){await this[mrt].close(),await this[grt].close()}async[nDn](){await this[mrt].destroy(),await this[grt].destroy()}};function eps(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new dde("Proxy-Authorization should be sent in ProxyAgent constructor")}a(tps,"throwIfProxyAuthIsSent");aDn.exports=vZt});var pDn=I((LWd,fDn)=>{"use strict";p();var rps=Vue(),{kClose:nps,kDestroy:ips,kClosed:cDn,kDestroyed:lDn,kDispatch:ops,kNoProxyAgent:nRe,kHttpProxyAgent:Qq,kHttpsProxyAgent:hJ}=Od(),uDn=bZt(),sps=ude(),aps={"http:":80,"https:":443},dDn=!1,SZt=class extends rps{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,dDn||(dDn=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[nRe]=new sps(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Qq]=new uDn({...s,uri:c}):this[Qq]=this[nRe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[hJ]=new uDn({...s,uri:l}):this[hJ]=this[Qq],this.#o()}[ops](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[nps](){await this[nRe].close(),this[Qq][cDn]||await this[Qq].close(),this[hJ][cDn]||await this[hJ].close()}async[ips](e){await this[nRe].destroy(e),this[Qq][lDn]||await this[Qq].destroy(e),this[hJ][lDn]||await this[hJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||aps[r]||0,this.#i(n,o)?r==="https:"?this[hJ]:this[Qq]:this[nRe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var fde=require("node:assert"),{kRetryHandlerDefaultRetry:hDn}=Od(),{RequestRetryError:iRe}=mc(),{isDisturbed:mDn,parseHeaders:cps,parseRangeHeader:gDn,wrapRequestBody:lps}=Ls();function ups(t){let e=Date.now();return new Date(t).getTime()-e}a(ups,"calculateRetryAfterHeader");var TZt=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:lps(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[hDn],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[hDn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?ups(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=cps(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new iRe("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new iRe("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=gDn(s["content-range"]);if(!l)return this.abort(new iRe("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new iRe("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return fde(this.start===u,"content-range mismatch"),fde(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=gDn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;fde(u!=null&&Number.isFinite(u),"content-range mismatch"),fde(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return fde(Number.isFinite(this.start)),fde(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new iRe("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||mDn(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||mDn(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};ADn.exports=TZt});var EDn=I((HWd,yDn)=>{"use strict";p();var dps=Dwe(),fps=Art(),IZt=class extends dps{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new fps({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};yDn.exports=IZt});var DZt=I((VWd,wDn)=>{"use strict";p();var SDn=require("node:assert"),{Readable:pps}=require("node:stream"),{RequestAbortedError:TDn,NotSupportedError:hps,InvalidArgumentError:mps,AbortError:xZt}=mc(),IDn=Ls(),{ReadableStreamFrom:gps}=Ls(),VS=Symbol("kConsume"),oRe=Symbol("kReading"),qq=Symbol("kBody"),_Dn=Symbol("kAbort"),xDn=Symbol("kContentType"),CDn=Symbol("kContentLength"),Aps=a(()=>{},"noop"),wZt=class extends pps{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[_Dn]=r,this[VS]=null,this[qq]=null,this[xDn]=n,this[CDn]=o,this[oRe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new TDn),e&&this[_Dn](),super.destroy(e)}_destroy(e,r){this[oRe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[oRe]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[oRe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[VS]&&e!==null?(kZt(this[VS],e),this[oRe]?super.push(e):!0):super.push(e)}async text(){return sRe(this,"text")}async json(){return sRe(this,"json")}async blob(){return sRe(this,"blob")}async bytes(){return sRe(this,"bytes")}async arrayBuffer(){return sRe(this,"arrayBuffer")}async formData(){throw new hps}get bodyUsed(){return IDn.isDisturbed(this)}get body(){return this[qq]||(this[qq]=gps(this),this[VS]&&(this[qq].getReader(),SDn(this[qq].locked))),this[qq]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new mps("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[CDn]>r&&this.destroy(new xZt);let c=a(()=>{this.destroy(n.reason??new xZt)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new xZt):o(null)}).on("error",Aps).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function yps(t){return t[qq]&&t[qq].locked===!0||t[VS]}a(yps,"isLocked");function Eps(t){return IDn.isDisturbed(t)||yps(t)}a(Eps,"isUnusable");async function sRe(t,e){return SDn(!t[VS]),new Promise((r,n)=>{if(Eps(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[VS]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){PZt(this[VS],o)}).on("close",function(){this[VS].body!==null&&PZt(this[VS],new TDn)}),_ps(t[VS])})})}a(sRe,"consume");function _ps(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(RZt,"chunksDecode");function vDn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var Cps=require("node:assert"),{ResponseStatusCodeError:RDn}=mc(),{chunksDecode:kDn}=DZt(),vps=128*1024;async function bps({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){Cps(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>vps){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new RDn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{PDn(r)?f=JSON.parse(kDn(c,l)):DDn(r)&&(f=kDn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new RDn(u,n,s,f)))}a(bps,"getResolveErrorBodyCallback");var PDn=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),DDn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");NDn.exports={getResolveErrorBodyCallback:bps,isContentTypeApplicationJson:PDn,isContentTypeText:DDn}});var BDn=I((ZWd,MZt)=>{"use strict";p();var Sps=require("node:assert"),{Readable:Tps}=DZt(),{InvalidArgumentError:pde,RequestAbortedError:MDn}=mc(),WS=Ls(),{getResolveErrorBodyCallback:Ips}=NZt(),{AsyncResource:xps}=require("node:async_hooks"),yrt=class extends xps{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new pde("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new pde("invalid callback");if(f&&(typeof f!="number"||f<0))throw new pde("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new pde("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new pde("invalid method");if(l&&typeof l!="function")throw new pde("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw WS.isStream(c)&&WS.destroy(c.on("error",WS.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,WS.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new MDn:this.removeAbortListener=WS.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new MDn,this.res?WS.destroy(this.res.on("error",WS.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}Sps(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?WS.parseRawHeaders(r):WS.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?WS.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new Tps({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(Ips,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){WS.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{WS.destroy(r,e)})),o&&(this.body=null,WS.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function ODn(t,e){if(e===void 0)return new Promise((r,n)=>{ODn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new yrt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(ODn,"request");MZt.exports=ODn;MZt.exports.RequestHandler=yrt});var aRe=I((tzd,UDn)=>{p();var{addAbortListener:wps}=Ls(),{RequestAbortedError:Rps}=mc(),hde=Symbol("kListener"),FO=Symbol("kSignal");function LDn(t){t.abort?t.abort(t[FO]?.reason):t.reason=t[FO]?.reason??new Rps,FDn(t)}a(LDn,"abort");function kps(t,e){if(t.reason=null,t[FO]=null,t[hde]=null,!!e){if(e.aborted){LDn(t);return}t[FO]=e,t[hde]=()=>{LDn(t)},wps(t[FO],t[hde])}}a(kps,"addSignal");function FDn(t){t[FO]&&("removeEventListener"in t[FO]?t[FO].removeEventListener("abort",t[hde]):t[FO].removeListener("abort",t[hde]),t[FO]=null,t[hde]=null)}a(FDn,"removeSignal");UDn.exports={addSignal:kps,removeSignal:FDn}});var HDn=I((izd,jDn)=>{"use strict";p();var Pps=require("node:assert"),{finished:Dps,PassThrough:Nps}=require("node:stream"),{InvalidArgumentError:mde,InvalidReturnValueError:Mps}=mc(),jP=Ls(),{getResolveErrorBodyCallback:Ops}=NZt(),{AsyncResource:Bps}=require("node:async_hooks"),{addSignal:Lps,removeSignal:QDn}=aRe(),OZt=class extends Bps{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new mde("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new mde("invalid callback");if(typeof r!="function")throw new mde("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new mde("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new mde("invalid method");if(u&&typeof u!="function")throw new mde("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw jP.isStream(l)&&jP.destroy(l.on("error",jP.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,jP.isStream(l)&&l.on("error",h=>{this.onError(h)}),Lps(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}Pps(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?jP.parseRawHeaders(r):jP.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?jP.parseHeaders(r):f)["content-type"];h=new Nps,this.callback=null,this.runInAsyncScope(Ops,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new Mps("expected Writable");Dps(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&jP.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;QDn(this),r&&(this.trailers=jP.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;QDn(this),this.factory=null,r?(this.res=null,jP.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,jP.destroy(s,e))}};function qDn(t,e,r){if(r===void 0)return new Promise((n,o)=>{qDn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new OZt(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(qDn,"stream");jDn.exports=qDn});var WDn=I((azd,VDn)=>{"use strict";p();var{Readable:$Dn,Duplex:Fps,PassThrough:Ups}=require("node:stream"),{InvalidArgumentError:cRe,InvalidReturnValueError:Qps,RequestAbortedError:BZt}=mc(),iw=Ls(),{AsyncResource:qps}=require("node:async_hooks"),{addSignal:jps,removeSignal:Hps}=aRe(),GDn=require("node:assert"),gde=Symbol("resume"),LZt=class extends $Dn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[gde]=null}_read(){let{[gde]:e}=this;e&&(this[gde]=null,e())}_destroy(e,r){this._read(),r(e)}},FZt=class extends $Dn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[gde]=e}_read(){this[gde]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new BZt),r(e)}},UZt=class extends qps{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new cRe("invalid opts");if(typeof r!="function")throw new cRe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new cRe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new cRe("invalid method");if(c&&typeof c!="function")throw new cRe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new LZt().on("error",iw.nop),this.ret=new Fps({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[gde]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new BZt),A&&u&&A(),iw.destroy(f,u),iw.destroy(h,u),iw.destroy(m,u),Hps(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,jps(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}GDn(!o,"pipeline cannot be retried"),GDn(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?iw.parseRawHeaders(r):iw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new FZt(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?iw.parseRawHeaders(r):iw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",iw.nop),u}if(!l||typeof l.on!="function")throw new Qps("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;iw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||iw.destroy(u,new BZt)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,iw.destroy(r,e)}};function Gps(t,e){try{let r=new UZt(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new Ups().destroy(r)}}a(Gps,"pipeline");VDn.exports=Gps});var XDn=I((uzd,ZDn)=>{"use strict";p();var{InvalidArgumentError:QZt,SocketError:$ps}=mc(),{AsyncResource:Vps}=require("node:async_hooks"),zDn=Ls(),{addSignal:Wps,removeSignal:YDn}=aRe(),KDn=require("node:assert"),qZt=class extends Vps{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new QZt("invalid opts");if(typeof r!="function")throw new QZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new QZt("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,Wps(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}KDn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new $ps("bad upgrade",null)}onUpgrade(e,r,n){KDn(e===101);let{callback:o,opaque:s,context:c}=this;YDn(this),this.callback=null;let l=this.responseHeaders==="raw"?zDn.parseRawHeaders(r):zDn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;YDn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function JDn(t,e){if(e===void 0)return new Promise((r,n)=>{JDn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new qZt(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(JDn,"upgrade");ZDn.exports=JDn});var iNn=I((pzd,nNn)=>{"use strict";p();var zps=require("node:assert"),{AsyncResource:Yps}=require("node:async_hooks"),{InvalidArgumentError:jZt,SocketError:Kps}=mc(),eNn=Ls(),{addSignal:Jps,removeSignal:tNn}=aRe(),HZt=class extends Yps{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new jZt("invalid opts");if(typeof r!="function")throw new jZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new jZt("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,Jps(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}zps(this.callback),this.abort=e,this.context=r}onHeaders(){throw new Kps("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;tNn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?eNn.parseRawHeaders(r):eNn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;tNn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function rNn(t,e){if(e===void 0)return new Promise((r,n)=>{rNn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new HZt(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(rNn,"connect");nNn.exports=rNn});var oNn=I((gzd,Ade)=>{"use strict";p();Ade.exports.request=BDn();Ade.exports.stream=HDn();Ade.exports.pipeline=WDn();Ade.exports.upgrade=XDn();Ade.exports.connect=iNn()});var $Zt=I((yzd,aNn)=>{"use strict";p();var{UndiciError:Zps}=mc(),sNn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),GZt=class t extends Zps{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[sNn]===!0}[sNn]=!0};aNn.exports={MockNotMatchedError:GZt}});var yde=I((Czd,cNn)=>{"use strict";p();cNn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var lRe=I((bzd,ENn)=>{"use strict";p();var{MockNotMatchedError:mJ}=$Zt(),{kDispatches:Ert,kMockAgent:Xps,kOriginalDispatch:ehs,kOrigin:ths,kGetNetConnect:rhs}=yde(),{buildURL:nhs}=Ls(),{STATUS_CODES:ihs}=require("node:http"),{types:{isPromise:ohs}}=require("node:util");function tF(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(tF,"matchValue");function uNn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(uNn,"lowerCaseEntries");function dNn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=dNn(e,r);if(!tF(n,o))return!1}return!0}a(fNn,"matchHeaders");function lNn(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(lNn,"safeUrl");function shs(t,{path:e,method:r,body:n,headers:o}){let s=tF(t.path,e),c=tF(t.method,r),l=typeof t.body<"u"?tF(t.body,n):!0,u=fNn(t,o);return s&&c&&l&&u}a(shs,"matchKey");function pNn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(pNn,"getResponseData");function hNn(t,e){let r=e.query?nhs(e.path,e.query):e.path,n=typeof r=="string"?lNn(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>tF(lNn(s),n));if(o.length===0)throw new mJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>tF(s,e.method)),o.length===0)throw new mJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?tF(s,e.body):!0),o.length===0)throw new mJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>fNn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new mJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(hNn,"getMockDispatch");function ahs(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(ahs,"addMockDispatch");function VZt(t,e){let r=t.findIndex(n=>n.consumed?shs(n,e):!1);r!==-1&&t.splice(r,1)}a(VZt,"deleteMockDispatch");function mNn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(mNn,"buildKey");function WZt(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[Ert])},d):g(this[Ert]);function g(y,E=s){let _=Array.isArray(t.headers)?zZt(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(ohs(v)){v.then(R=>g(y,R));return}let b=pNn(v),T=WZt(c),w=WZt(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,gNn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),VZt(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(ANn,"mockDispatch");function lhs(){let t=this[Xps],e=this[ths],r=this[ehs];return a(function(o,s){if(t.isMockActive)try{ANn.call(this,o,s)}catch(c){if(c instanceof mJ){let l=t[rhs]();if(l===!1)throw new mJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(yNn(l,e))r.call(this,o,s);else throw new mJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(lhs,"buildMockDispatch");function yNn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>tF(n,r.host)))}a(yNn,"checkNetConnect");function uhs(t){if(t){let{agent:e,...r}=t;return r}}a(uhs,"buildMockOptions");ENn.exports={getResponseData:pNn,getMockDispatch:hNn,addMockDispatch:ahs,deleteMockDispatch:VZt,buildKey:mNn,generateKeyValues:WZt,matchValue:tF,getResponse:chs,getStatusText:gNn,mockDispatch:ANn,buildMockDispatch:lhs,checkNetConnect:yNn,buildMockOptions:uhs,getHeaderByName:dNn,buildHeadersFromArray:zZt}});var tXt=I((Izd,eXt)=>{"use strict";p();var{getResponseData:dhs,buildKey:fhs,addMockDispatch:YZt}=lRe(),{kDispatches:_rt,kDispatchKey:Crt,kDefaultHeaders:KZt,kDefaultTrailers:JZt,kContentLength:ZZt,kMockDispatch:vrt}=yde(),{InvalidArgumentError:UO}=mc(),{buildURL:phs}=Ls(),Ede=class{static{a(this,"MockScope")}constructor(e){this[vrt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new UO("waitInMs must be a valid integer > 0");return this[vrt].delay=e,this}persist(){return this[vrt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new UO("repeatTimes must be a valid integer > 0");return this[vrt].times=e,this}},XZt=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new UO("opts must be an object");if(typeof e.path>"u")throw new UO("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=phs(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[Crt]=fhs(e),this[_rt]=r,this[KZt]={},this[JZt]={},this[ZZt]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=dhs(r),s=this[ZZt]?{"content-length":o.length}:{},c={...this[KZt],...s,...n.headers},l={...this[JZt],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new UO("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new UO("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new UO("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=YZt(this[_rt],this[Crt],s);return new Ede(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=YZt(this[_rt],this[Crt],n);return new Ede(o)}replyWithError(e){if(typeof e>"u")throw new UO("error must be defined");let r=YZt(this[_rt],this[Crt],{error:e});return new Ede(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new UO("headers must be defined");return this[KZt]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new UO("trailers must be defined");return this[JZt]=e,this}replyContentLength(){return this[ZZt]=!0,this}};eXt.exports.MockInterceptor=XZt;eXt.exports.MockScope=Ede});var iXt=I((Rzd,INn)=>{"use strict";p();var{promisify:hhs}=require("node:util"),mhs=cde(),{buildMockDispatch:ghs}=lRe(),{kDispatches:_Nn,kMockAgent:CNn,kClose:vNn,kOriginalClose:bNn,kOrigin:SNn,kOriginalDispatch:Ahs,kConnected:rXt}=yde(),{MockInterceptor:yhs}=tXt(),TNn=Od(),{InvalidArgumentError:Ehs}=mc(),nXt=class extends mhs{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Ehs("Argument opts.agent must implement Agent");this[CNn]=r.agent,this[SNn]=e,this[_Nn]=[],this[rXt]=1,this[Ahs]=this.dispatch,this[bNn]=this.close.bind(this),this.dispatch=ghs.call(this),this.close=this[vNn]}get[TNn.kConnected](){return this[rXt]}intercept(e){return new yhs(e,this[_Nn])}async[vNn](){await hhs(this[bNn])(),this[rXt]=0,this[CNn][TNn.kClients].delete(this[SNn])}};INn.exports=nXt});var aXt=I((Dzd,NNn)=>{"use strict";p();var{promisify:_hs}=require("node:util"),Chs=lde(),{buildMockDispatch:vhs}=lRe(),{kDispatches:xNn,kMockAgent:wNn,kClose:RNn,kOriginalClose:kNn,kOrigin:PNn,kOriginalDispatch:bhs,kConnected:oXt}=yde(),{MockInterceptor:Shs}=tXt(),DNn=Od(),{InvalidArgumentError:Ths}=mc(),sXt=class extends Chs{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new Ths("Argument opts.agent must implement Agent");this[wNn]=r.agent,this[PNn]=e,this[xNn]=[],this[oXt]=1,this[bhs]=this.dispatch,this[kNn]=this.close.bind(this),this.dispatch=vhs.call(this),this.close=this[RNn]}get[DNn.kConnected](){return this[oXt]}intercept(e){return new Shs(e,this[xNn])}async[RNn](){await _hs(this[kNn])(),this[oXt]=0,this[wNn][DNn.kClients].delete(this[PNn])}};NNn.exports=sXt});var ONn=I((Bzd,MNn)=>{"use strict";p();var Ihs={pronoun:"it",is:"is",was:"was",this:"this"},xhs={pronoun:"they",is:"are",was:"were",this:"these"};MNn.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?Ihs:xhs,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var LNn=I((Qzd,BNn)=>{"use strict";p();var{Transform:whs}=require("node:stream"),{Console:Rhs}=require("node:console"),khs=process.versions.icu?"\u2705":"Y ",Phs=process.versions.icu?"\u274C":"N ";BNn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new whs({transform(r,n,o){o(null,r)}}),this.logger=new Rhs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?khs:Phs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var qNn=I((Hzd,QNn)=>{"use strict";p();var{kClients:gJ}=Od(),Dhs=ude(),{kAgent:cXt,kMockAgentSet:brt,kMockAgentGet:FNn,kDispatches:lXt,kIsMockActive:Srt,kNetConnect:AJ,kGetNetConnect:Nhs,kOptions:Trt,kFactory:Irt}=yde(),Mhs=iXt(),Ohs=aXt(),{matchValue:Bhs,buildMockOptions:Lhs}=lRe(),{InvalidArgumentError:UNn,UndiciError:Fhs}=mc(),Uhs=Dwe(),Qhs=ONn(),qhs=LNn(),uXt=class extends Uhs{static{a(this,"MockAgent")}constructor(e){if(super(e),this[AJ]=!0,this[Srt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new UNn("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new Dhs(e);this[cXt]=r,this[gJ]=r[gJ],this[Trt]=Lhs(e)}get(e){let r=this[FNn](e);return r||(r=this[Irt](e),this[brt](e,r)),r}dispatch(e,r){return this.get(e.origin),this[cXt].dispatch(e,r)}async close(){await this[cXt].close(),this[gJ].clear()}deactivate(){this[Srt]=!1}activate(){this[Srt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[AJ])?this[AJ].push(e):this[AJ]=[e];else if(typeof e>"u")this[AJ]=!0;else throw new UNn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[AJ]=!1}get isMockActive(){return this[Srt]}[brt](e,r){this[gJ].set(e,r)}[Irt](e){let r=Object.assign({agent:this},this[Trt]);return this[Trt]&&this[Trt].connections===1?new Mhs(e,r):new Ohs(e,r)}[FNn](e){let r=this[gJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[Irt]("http://localhost:9999");return this[brt](e,n),n}for(let[n,o]of Array.from(this[gJ]))if(o&&typeof n!="string"&&Bhs(n,e)){let s=this[Irt](e);return this[brt](e,s),s[lXt]=o[lXt],s}}[Nhs](){return this[AJ]}pendingInterceptors(){let e=this[gJ];return Array.from(e.entries()).flatMap(([r,n])=>n[lXt].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new qhs}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new Qhs("interceptor","interceptors").pluralize(r.length);throw new Fhs(` +`,"latin1"),r!==null&&o!==r){if(n[YJt])throw new XK;process.emitWarning(new XK)}e[ip].timeout&&e[ip].timeoutType===ede&&e[ip].timeout.refresh&&e[ip].timeout.refresh(),n[Tq]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[Iq]=!1,e&&(ji(n[nE]<=1,"pipeline should only contain this request"),o(e))}};t2n.exports=Dls});var u2n=I((MGd,l2n)=>{"use strict";p();var tw=require("node:assert"),{pipeline:Fls}=require("node:stream"),aa=Os(),{RequestContentLengthMismatchError:XJt,RequestAbortedError:n2n,SocketError:Nwe,InformationalError:eZt}=mc(),{kUrl:Ytt,kReset:Jtt,kClient:tde,kRunning:Ztt,kPending:Uls,kQueue:xq,kPendingIdx:tZt,kRunningIdx:Ok,kError:Lk,kSocket:fg,kStrictContentLength:Qls,kOnError:rZt,kMaxConcurrentStreams:c2n,kHTTP2Session:Bk,kResume:wq,kSize:qls,kHTTPContext:jls}=Nd(),V3=Symbol("open streams"),i2n,o2n=!1,Ktt;try{Ktt=require("node:http2")}catch{Ktt={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:Hls,HTTP2_HEADER_METHOD:Gls,HTTP2_HEADER_PATH:$ls,HTTP2_HEADER_SCHEME:Vls,HTTP2_HEADER_CONTENT_LENGTH:Wls,HTTP2_HEADER_EXPECT:zls,HTTP2_HEADER_STATUS:Yls}}=Ktt;function Kls(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Kls,"parseH2Headers");async function Jls(t,e){t[fg]=e,o2n||(o2n=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let r=Ktt.connect(t[Ytt],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[c2n]});r[V3]=0,r[tde]=t,r[fg]=e,aa.addListener(r,"error",Xls),aa.addListener(r,"frameError",eus),aa.addListener(r,"end",tus),aa.addListener(r,"goaway",rus),aa.addListener(r,"close",function(){let{[tde]:o}=this,{[fg]:s}=o,c=this[fg][Lk]||this[Lk]||new Nwe("closed",aa.getSocketInfo(s));if(o[Bk]=null,o.destroyed){tw(o[Uls]===0);let l=o[xq].splice(o[Ok]);for(let u=0;u{n=!0}),{version:"h2",defaultPipelining:1/0,write(...o){return ius(t,...o)},resume(){Zls(t)},destroy(o,s){n?queueMicrotask(s):e.destroy(o).on("close",s)},get destroyed(){return e.destroyed},busy(){return!1}}}a(Jls,"connectH2");function Zls(t){let e=t[fg];e?.destroyed===!1&&(t[qls]===0&&t[c2n]===0?(e.unref(),t[Bk].unref()):(e.ref(),t[Bk].ref()))}a(Zls,"resumeH2");function Xls(t){tw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[fg][Lk]=t,this[tde][rZt](t)}a(Xls,"onHttp2SessionError");function eus(t,e,r){if(r===0){let n=new eZt(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[fg][Lk]=n,this[tde][rZt](n)}}a(eus,"onHttp2FrameError");function tus(){let t=new Nwe("other side closed",aa.getSocketInfo(this[fg]));this.destroy(t),aa.destroy(this[fg],t)}a(tus,"onHttp2SessionEnd");function rus(t){let e=this[Lk]||new Nwe(`HTTP/2: "GOAWAY" frame received with code ${t}`,aa.getSocketInfo(this)),r=this[tde];if(r[fg]=null,r[jls]=null,this[Bk]!=null&&(this[Bk].destroy(e),this[Bk]=null),aa.destroy(this[fg],e),r[Ok]{e.aborted||e.completed||(T=T||new n2n,aa.errorRequest(t,e,T),m!=null&&aa.destroy(m,T),aa.destroy(f,T),t[xq][t[Ok]++]=null,t[wq]())},"abort");try{e.onConnect(y)}catch(T){aa.errorRequest(t,e,T)}if(e.aborted)return!1;if(n==="CONNECT")return r.ref(),m=r.request(h,{endStream:!1,signal:u}),m.id&&!m.pending?(e.onUpgrade(null,null,m),++r[V3],t[xq][t[Ok]++]=null):m.once("ready",()=>{e.onUpgrade(null,null,m),++r[V3],t[xq][t[Ok]++]=null}),m.once("close",()=>{r[V3]-=1,r[V3]===0&&r.unref()}),!0;h[$ls]=o,h[Vls]="https";let E=n==="PUT"||n==="POST"||n==="PATCH";f&&typeof f.read=="function"&&f.read(0);let _=aa.bodyLength(f);if(aa.isFormDataLike(f)){i2n??=Jue().extractBody;let[T,w]=i2n(f);h["content-type"]=w,f=T.stream,_=T.length}if(_==null&&(_=e.contentLength),(_===0||!E)&&(_=null),nus(n)&&_>0&&e.contentLength!=null&&e.contentLength!==_){if(t[Qls])return aa.errorRequest(t,e,new XJt),!1;process.emitWarning(new XJt)}_!=null&&(tw(f,"no body must not have content length"),h[Wls]=`${_}`),r.ref();let v=n==="GET"||n==="HEAD"||f===null;return l?(h[zls]="100-continue",m=r.request(h,{endStream:v,signal:u}),m.once("continue",b)):(m=r.request(h,{endStream:v,signal:u}),b()),++r[V3],m.once("response",T=>{let{[Yls]:w,...R}=T;if(e.onResponseStarted(),e.aborted){let x=new n2n;aa.errorRequest(t,e,x),aa.destroy(m,x);return}e.onHeaders(Number(w),Kls(R),m.resume.bind(m),"")===!1&&m.pause(),m.on("data",x=>{e.onData(x)===!1&&m.pause()})}),m.once("end",()=>{(m.state?.state==null||m.state.state<6)&&e.onComplete([]),r[V3]===0&&r.unref(),y(new eZt("HTTP/2: stream half-closed (remote)")),t[xq][t[Ok]++]=null,t[tZt]=t[Ok],t[wq]()}),m.once("close",()=>{r[V3]-=1,r[V3]===0&&r.unref()}),m.once("error",function(T){y(T)}),m.once("frameError",(T,w)=>{y(new eZt(`HTTP/2: "frameError" received - type ${T}, code ${w}`))}),!0;function b(){!f||_===0?s2n(y,m,null,t,e,t[fg],_,E):aa.isBuffer(f)?s2n(y,m,f,t,e,t[fg],_,E):aa.isBlobLike(f)?typeof f.stream=="function"?a2n(y,m,f.stream(),t,e,t[fg],_,E):sus(y,m,f,t,e,t[fg],_,E):aa.isStream(f)?ous(y,t[fg],E,m,f,t,e,_):aa.isIterable(f)?a2n(y,m,f,t,e,t[fg],_,E):tw(!1)}a(b,"writeBodyH2")}a(ius,"writeH2");function s2n(t,e,r,n,o,s,c,l){try{r!=null&&aa.isBuffer(r)&&(tw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Jtt]=!0),o.onRequestSent(),n[wq]()}catch(u){t(u)}}a(s2n,"writeBuffer");function ous(t,e,r,n,o,s,c,l){tw(l!==0||s[Ztt]===0,"stream body cannot be pipelined");let u=Fls(o,n,f=>{f?(aa.destroy(u,f),t(f)):(aa.removeAllListeners(u),c.onRequestSent(),r||(e[Jtt]=!0),s[wq]())});aa.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(ous,"writeStream");async function sus(t,e,r,n,o,s,c,l){tw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new XJt;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Jtt]=!0),n[wq]()}catch(u){t(u)}}a(sus,"writeBlob");async function a2n(t,e,r,n,o,s,c,l){tw(c!==0||n[Ztt]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{tw(u===null),s[Lk]?m(s[Lk]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[Lk])throw s[Lk];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Jtt]=!0),n[wq]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(a2n,"writeIterable");l2n.exports=Jls});var ert=I((LGd,p2n)=>{"use strict";p();var PO=Os(),{kBodyUsed:Mwe}=Nd(),iZt=require("node:assert"),{InvalidArgumentError:aus}=mc(),cus=require("node:events"),lus=[300,301,302,303,307,308],d2n=Symbol("body"),Xtt=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[d2n]=e,this[Mwe]=!1}async*[Symbol.asyncIterator](){iZt(!this[Mwe],"disturbed"),this[Mwe]=!0,yield*this[d2n]}},nZt=class{static{a(this,"RedirectHandler")}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new aus("maxRedirections must be a positive number");PO.validateHandler(o,n.method,n.upgrade),this.dispatch=e,this.location=null,this.abort=null,this.opts={...n,maxRedirections:0},this.maxRedirections=r,this.handler=o,this.history=[],this.redirectionLimitReached=!1,PO.isStream(this.opts.body)?(PO.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){iZt(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Mwe]=!1,cus.prototype.on.call(this.opts.body,"data",function(){this[Mwe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new Xtt(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&PO.isIterable(this.opts.body)&&(this.opts.body=new Xtt(this.opts.body))}onConnect(e){this.abort=e,this.handler.onConnect(e,{history:this.history})}onUpgrade(e,r,n){this.handler.onUpgrade(e,r,n)}onError(e){this.handler.onError(e)}onHeaders(e,r,n,o){if(this.location=this.history.length>=this.maxRedirections||PO.isDisturbed(this.opts.body)?null:uus(e,r),this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections){this.request&&this.request.abort(new Error("max redirects")),this.redirectionLimitReached=!0,this.abort(new Error("max redirects"));return}if(this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location)return this.handler.onHeaders(e,r,n,o);let{origin:s,pathname:c,search:l}=PO.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c;this.opts.headers=dus(this.opts.headers,e===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.maxRedirections=0,this.opts.query=null,e===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",this.opts.body=null)}onData(e){if(!this.location)return this.handler.onData(e)}onComplete(e){this.location?(this.location=null,this.abort=null,this.dispatch(this.opts,this)):this.handler.onComplete(e)}onBodySent(e){this.handler.onBodySent&&this.handler.onBodySent(e)}};function uus(t,e){if(lus.indexOf(t)===-1)return null;for(let r=0;r{"use strict";p();var fus=ert();function pus({maxRedirections:t}){return e=>a(function(n,o){let{maxRedirections:s=t}=n;if(!s)return e(n,o);let c=new fus(e,s,n,o);return n={...n,maxRedirections:0},e(n,c)},"Intercept")}a(pus,"createRedirectInterceptor");h2n.exports=pus});var ide=I((HGd,S2n)=>{"use strict";p();var W3=require("node:assert"),_2n=require("node:net"),hus=require("node:http"),eJ=Os(),{channels:rde}=Fue(),mus=RPn(),gus=jue(),{InvalidArgumentError:Jp,InformationalError:Aus,ClientDestroyedError:yus}=mc(),Eus=vwe(),{kUrl:kO,kServerName:Rq,kClient:_us,kBusy:oZt,kConnect:vus,kResuming:tJ,kRunning:Uwe,kPending:Qwe,kSize:Fwe,kQueue:Fk,kConnected:Cus,kConnecting:nde,kNeedDrain:kq,kKeepAliveDefaultTimeout:m2n,kHostHeader:bus,kPendingIdx:Uk,kRunningIdx:z3,kError:Sus,kPipelining:rrt,kKeepAliveTimeoutValue:Tus,kMaxHeadersSize:Ius,kKeepAliveMaxTimeout:xus,kKeepAliveTimeoutThreshold:wus,kHeadersTimeout:Rus,kBodyTimeout:Pus,kStrictContentLength:kus,kConnector:Owe,kMaxRedirections:Dus,kMaxRequests:sZt,kCounter:Nus,kClose:Mus,kDestroy:Ous,kDispatch:Bus,kInterceptors:g2n,kLocalAddress:Bwe,kMaxResponseSize:Lus,kOnError:Fus,kHTTPContext:Zp,kMaxConcurrentStreams:Uus,kResume:Lwe}=Nd(),Qus=r2n(),qus=u2n(),A2n=!1,Pq=Symbol("kClosedResolve"),y2n=a(()=>{},"noop");function v2n(t){return t[rrt]??t[Zp]?.defaultPipelining??1}a(v2n,"getPipelining");var aZt=class extends gus{static{a(this,"Client")}constructor(e,{interceptors:r,maxHeaderSize:n,headersTimeout:o,socketTimeout:s,requestTimeout:c,connectTimeout:l,bodyTimeout:u,idleTimeout:d,keepAlive:f,keepAliveTimeout:h,maxKeepAliveTimeout:m,keepAliveMaxTimeout:g,keepAliveTimeoutThreshold:A,socketPath:y,pipelining:E,tls:_,strictContentLength:v,maxCachedSessions:b,maxRedirections:T,connect:w,maxRequestsPerClient:R,localAddress:x,maxResponseSize:P,autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N,maxConcurrentStreams:B,allowH2:L}={}){if(super(),f!==void 0)throw new Jp("unsupported keepAlive, use pipelining=0 instead");if(s!==void 0)throw new Jp("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(c!==void 0)throw new Jp("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(d!==void 0)throw new Jp("unsupported idleTimeout, use keepAliveTimeout instead");if(m!==void 0)throw new Jp("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(n!=null&&!Number.isFinite(n))throw new Jp("invalid maxHeaderSize");if(y!=null&&typeof y!="string")throw new Jp("invalid socketPath");if(l!=null&&(!Number.isFinite(l)||l<0))throw new Jp("invalid connectTimeout");if(h!=null&&(!Number.isFinite(h)||h<=0))throw new Jp("invalid keepAliveTimeout");if(g!=null&&(!Number.isFinite(g)||g<=0))throw new Jp("invalid keepAliveMaxTimeout");if(A!=null&&!Number.isFinite(A))throw new Jp("invalid keepAliveTimeoutThreshold");if(o!=null&&(!Number.isInteger(o)||o<0))throw new Jp("headersTimeout must be a positive integer or zero");if(u!=null&&(!Number.isInteger(u)||u<0))throw new Jp("bodyTimeout must be a positive integer or zero");if(w!=null&&typeof w!="function"&&typeof w!="object")throw new Jp("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new Jp("maxRedirections must be a positive number");if(R!=null&&(!Number.isInteger(R)||R<0))throw new Jp("maxRequestsPerClient must be a positive number");if(x!=null&&(typeof x!="string"||_2n.isIP(x)===0))throw new Jp("localAddress must be valid string IP address");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new Jp("maxResponseSize must be a positive number");if(N!=null&&(!Number.isInteger(N)||N<-1))throw new Jp("autoSelectFamilyAttemptTimeout must be a positive number");if(L!=null&&typeof L!="boolean")throw new Jp("allowH2 must be a valid boolean value");if(B!=null&&(typeof B!="number"||B<1))throw new Jp("maxConcurrentStreams must be a positive integer, greater than 0");typeof w!="function"&&(w=Eus({..._,maxCachedSessions:b,allowH2:L,socketPath:y,timeout:l,...D?{autoSelectFamily:D,autoSelectFamilyAttemptTimeout:N}:void 0,...w})),r?.Client&&Array.isArray(r.Client)?(this[g2n]=r.Client,A2n||(A2n=!0,process.emitWarning("Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.",{code:"UNDICI-CLIENT-INTERCEPTOR-DEPRECATED"}))):this[g2n]=[jus({maxRedirections:T})],this[kO]=eJ.parseOrigin(e),this[Owe]=w,this[rrt]=E??1,this[Ius]=n||hus.maxHeaderSize,this[m2n]=h??4e3,this[xus]=g??6e5,this[wus]=A??2e3,this[Tus]=this[m2n],this[Rq]=null,this[Bwe]=x??null,this[tJ]=0,this[kq]=0,this[bus]=`host: ${this[kO].hostname}${this[kO].port?`:${this[kO].port}`:""}\r +`,this[Pus]=u??3e5,this[Rus]=o??3e5,this[kus]=v??!0,this[Dus]=T,this[sZt]=R,this[Pq]=null,this[Lus]=P>-1?P:-1,this[Uus]=B??100,this[Zp]=null,this[Fk]=[],this[z3]=0,this[Uk]=0,this[Lwe]=j=>cZt(this,j),this[Fus]=j=>C2n(this,j)}get pipelining(){return this[rrt]}set pipelining(e){this[rrt]=e,this[Lwe](!0)}get[Qwe](){return this[Fk].length-this[Uk]}get[Uwe](){return this[Uk]-this[z3]}get[Fwe](){return this[Fk].length-this[z3]}get[Cus](){return!!this[Zp]&&!this[nde]&&!this[Zp].destroyed}get[oZt](){return!!(this[Zp]?.busy(null)||this[Fwe]>=(v2n(this)||1)||this[Qwe]>0)}[vus](e){b2n(this),this.once("connect",e)}[Bus](e,r){let n=e.origin||this[kO].origin,o=new mus(n,e,r);return this[Fk].push(o),this[tJ]||(eJ.bodyLength(o.body)==null&&eJ.isIterable(o.body)?(this[tJ]=1,queueMicrotask(()=>cZt(this))):this[Lwe](!0)),this[tJ]&&this[kq]!==2&&this[oZt]&&(this[kq]=2),this[kq]<2}async[Mus](){return new Promise(e=>{this[Fwe]?this[Pq]=e:e(null)})}async[Ous](e){return new Promise(r=>{let n=this[Fk].splice(this[Uk]);for(let s=0;s{this[Pq]&&(this[Pq](),this[Pq]=null),r(null)},"callback");this[Zp]?(this[Zp].destroy(e,o),this[Zp]=null):queueMicrotask(o),this[Lwe]()})}},jus=trt();function C2n(t,e){if(t[Uwe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){W3(t[Uk]===t[z3]);let r=t[Fk].splice(t[z3]);for(let n=0;n{t[Owe]({host:e,hostname:r,protocol:n,port:o,servername:t[Rq],localAddress:t[Bwe]},(u,d)=>{u?l(u):c(d)})});if(t.destroyed){eJ.destroy(s.on("error",y2n),new yus);return}W3(s);try{t[Zp]=s.alpnProtocol==="h2"?await qus(t,s):await Qus(t,s)}catch(c){throw s.destroy().on("error",y2n),c}t[nde]=!1,s[Nus]=0,s[sZt]=t[sZt],s[_us]=t,s[Sus]=null,rde.connected.hasSubscribers&&rde.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Zp]?.version,servername:t[Rq],localAddress:t[Bwe]},connector:t[Owe],socket:s}),t.emit("connect",t[kO],[t])}catch(s){if(t.destroyed)return;if(t[nde]=!1,rde.connectError.hasSubscribers&&rde.connectError.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Zp]?.version,servername:t[Rq],localAddress:t[Bwe]},connector:t[Owe],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(W3(t[Uwe]===0);t[Qwe]>0&&t[Fk][t[Uk]].servername===t[Rq];){let c=t[Fk][t[Uk]++];eJ.errorRequest(t,c,s)}else C2n(t,s);t.emit("connectionError",t[kO],[t],s)}t[Lwe]()}a(b2n,"connect");function E2n(t){t[kq]=0,t.emit("drain",t[kO],[t])}a(E2n,"emitDrain");function cZt(t,e){t[tJ]!==2&&(t[tJ]=2,Hus(t,e),t[tJ]=0,t[z3]>256&&(t[Fk].splice(0,t[z3]),t[Uk]-=t[z3],t[z3]=0))}a(cZt,"resume");function Hus(t,e){for(;;){if(t.destroyed){W3(t[Qwe]===0);return}if(t[Pq]&&!t[Fwe]){t[Pq](),t[Pq]=null;return}if(t[Zp]&&t[Zp].resume(),t[oZt])t[kq]=2;else if(t[kq]===2){e?(t[kq]=1,queueMicrotask(()=>E2n(t))):E2n(t);continue}if(t[Qwe]===0||t[Uwe]>=(v2n(t)||1))return;let r=t[Fk][t[Uk]];if(t[kO].protocol==="https:"&&t[Rq]!==r.servername){if(t[Uwe]>0)return;t[Rq]=r.servername,t[Zp]?.destroy(new Aus("servername changed"),()=>{t[Zp]=null,cZt(t)})}if(t[nde])return;if(!t[Zp]){b2n(t);return}if(t[Zp].destroyed||t[Zp].busy(r))return;!r.aborted&&t[Zp].write(r)?t[Uk]++:t[Fk].splice(t[Uk],1)}}a(Hus,"_resume");S2n.exports=aZt});var lZt=I((WGd,T2n)=>{"use strict";p();var nrt=class{static{a(this,"FixedCircularBuffer")}constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};T2n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new nrt}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new nrt),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next),r}}});var x2n=I((KGd,I2n)=>{p();var{kFree:Gus,kConnected:$us,kPending:Vus,kQueued:Wus,kRunning:zus,kSize:Yus}=Nd(),rJ=Symbol("pool"),uZt=class{static{a(this,"PoolStats")}constructor(e){this[rJ]=e}get connected(){return this[rJ][$us]}get free(){return this[rJ][Gus]}get pending(){return this[rJ][Vus]}get queued(){return this[rJ][Wus]}get running(){return this[rJ][zus]}get size(){return this[rJ][Yus]}};I2n.exports=uZt});var gZt=I((XGd,L2n)=>{"use strict";p();var Kus=jue(),Jus=lZt(),{kConnected:dZt,kSize:w2n,kRunning:R2n,kPending:P2n,kQueued:qwe,kBusy:Zus,kFree:Xus,kUrl:eds,kClose:tds,kDestroy:rds,kDispatch:nds}=Nd(),ids=x2n(),qC=Symbol("clients"),Q_=Symbol("needDrain"),jwe=Symbol("queue"),fZt=Symbol("closed resolve"),pZt=Symbol("onDrain"),k2n=Symbol("onConnect"),D2n=Symbol("onDisconnect"),N2n=Symbol("onConnectionError"),hZt=Symbol("get dispatcher"),O2n=Symbol("add client"),B2n=Symbol("remove client"),M2n=Symbol("stats"),mZt=class extends Kus{static{a(this,"PoolBase")}constructor(){super(),this[jwe]=new Jus,this[qC]=[],this[qwe]=0;let e=this;this[pZt]=a(function(n,o){let s=e[jwe],c=!1;for(;!c;){let l=s.shift();if(!l)break;e[qwe]--,c=!this.dispatch(l.opts,l.handler)}this[Q_]=c,!this[Q_]&&e[Q_]&&(e[Q_]=!1,e.emit("drain",n,[e,...o])),e[fZt]&&s.isEmpty()&&Promise.all(e[qC].map(l=>l.close())).then(e[fZt])},"onDrain"),this[k2n]=(r,n)=>{e.emit("connect",r,[e,...n])},this[D2n]=(r,n,o)=>{e.emit("disconnect",r,[e,...n],o)},this[N2n]=(r,n,o)=>{e.emit("connectionError",r,[e,...n],o)},this[M2n]=new ids(this)}get[Zus](){return this[Q_]}get[dZt](){return this[qC].filter(e=>e[dZt]).length}get[Xus](){return this[qC].filter(e=>e[dZt]&&!e[Q_]).length}get[P2n](){let e=this[qwe];for(let{[P2n]:r}of this[qC])e+=r;return e}get[R2n](){let e=0;for(let{[R2n]:r}of this[qC])e+=r;return e}get[w2n](){let e=this[qwe];for(let{[w2n]:r}of this[qC])e+=r;return e}get stats(){return this[M2n]}async[tds](){this[jwe].isEmpty()?await Promise.all(this[qC].map(e=>e.close())):await new Promise(e=>{this[fZt]=e})}async[rds](e){for(;;){let r=this[jwe].shift();if(!r)break;r.handler.onError(e)}await Promise.all(this[qC].map(r=>r.destroy(e)))}[nds](e,r){let n=this[hZt]();return n?n.dispatch(e,r)||(n[Q_]=!0,this[Q_]=!this[hZt]()):(this[Q_]=!0,this[jwe].push({opts:e,handler:r}),this[qwe]++),!this[Q_]}[O2n](e){return e.on("drain",this[pZt]).on("connect",this[k2n]).on("disconnect",this[D2n]).on("connectionError",this[N2n]),this[qC].push(e),this[Q_]&&queueMicrotask(()=>{this[Q_]&&this[pZt](e[eds],[this,e])}),this}[B2n](e){e.close(()=>{let r=this[qC].indexOf(e);r!==-1&&this[qC].splice(r,1)}),this[Q_]=this[qC].some(r=>!r[Q_]&&r.closed!==!0&&r.destroyed!==!0)}};L2n.exports={PoolBase:mZt,kClients:qC,kNeedDrain:Q_,kAddClient:O2n,kRemoveClient:B2n,kGetDispatcher:hZt}});var ode=I((r$d,q2n)=>{"use strict";p();var{PoolBase:ods,kClients:irt,kNeedDrain:sds,kAddClient:ads,kGetDispatcher:cds}=gZt(),lds=ide(),{InvalidArgumentError:AZt}=mc(),F2n=Os(),{kUrl:U2n,kInterceptors:uds}=Nd(),dds=vwe(),yZt=Symbol("options"),EZt=Symbol("connections"),Q2n=Symbol("factory");function fds(t,e){return new lds(t,e)}a(fds,"defaultFactory");var _Zt=class extends ods{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=fds,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,...m}={}){if(super(),r!=null&&(!Number.isFinite(r)||r<0))throw new AZt("invalid connections");if(typeof n!="function")throw new AZt("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new AZt("connect must be a function or an object");typeof o!="function"&&(o=dds({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...d?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),this[uds]=m.interceptors?.Pool&&Array.isArray(m.interceptors.Pool)?m.interceptors.Pool:[],this[EZt]=r||null,this[U2n]=F2n.parseOrigin(e),this[yZt]={...F2n.deepClone(m),connect:o,allowH2:h},this[yZt].interceptors=m.interceptors?{...m.interceptors}:void 0,this[Q2n]=n,this.on("connectionError",(g,A,y)=>{for(let E of A){let _=this[irt].indexOf(E);_!==-1&&this[irt].splice(_,1)}})}[cds](){for(let e of this[irt])if(!e[sds])return e;if(!this[EZt]||this[irt].length{"use strict";p();var{BalancedPoolMissingUpstreamError:pds,InvalidArgumentError:hds}=mc(),{PoolBase:mds,kClients:iE,kNeedDrain:Hwe,kAddClient:gds,kRemoveClient:Ads,kGetDispatcher:yds}=gZt(),Eds=ode(),{kUrl:vZt,kInterceptors:_ds}=Nd(),{parseOrigin:j2n}=Os(),H2n=Symbol("factory"),ort=Symbol("options"),G2n=Symbol("kGreatestCommonDivisor"),nJ=Symbol("kCurrentWeight"),iJ=Symbol("kIndex"),rw=Symbol("kWeight"),srt=Symbol("kMaxWeightPerServer"),art=Symbol("kErrorPenalty");function vds(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(vds,"getGreatestCommonDivisor");function Cds(t,e){return new Eds(t,e)}a(Cds,"defaultFactory");var CZt=class extends mds{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Cds,...n}={}){if(super(),this[ort]=n,this[iJ]=-1,this[nJ]=0,this[srt]=this[ort].maxWeightPerServer||100,this[art]=this[ort].errorPenalty||15,Array.isArray(e)||(e=[e]),typeof r!="function")throw new hds("factory must be a function.");this[_ds]=n.interceptors?.BalancedPool&&Array.isArray(n.interceptors.BalancedPool)?n.interceptors.BalancedPool:[],this[H2n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=j2n(e).origin;if(this[iE].find(o=>o[vZt].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[H2n](r,Object.assign({},this[ort]));this[gds](n),n.on("connect",()=>{n[rw]=Math.min(this[srt],n[rw]+this[art])}),n.on("connectionError",()=>{n[rw]=Math.max(1,n[rw]-this[art]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[rw]=Math.max(1,n[rw]-this[art]),this._updateBalancedPoolStats())});for(let o of this[iE])o[rw]=this[srt];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[vZt].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Ads](n),this}get upstreams(){return this[iE].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[vZt].origin)}[yds](){if(this[iE].length===0)throw new pds;if(!this[iE].find(s=>!s[Hwe]&&s.closed!==!0&&s.destroyed!==!0)||this[iE].map(s=>s[Hwe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[iE].findIndex(s=>!s[Hwe]);for(;n++this[iE][o][rw]&&!s[Hwe]&&(o=this[iJ]),this[iJ]===0&&(this[nJ]=this[nJ]-this[G2n],this[nJ]<=0&&(this[nJ]=this[srt])),s[rw]>=this[nJ]&&!s[Hwe])return s}return this[nJ]=this[iE][o][rw],this[iJ]=o,this[iE][o]}};$2n.exports=CZt});var sde=I((c$d,X2n)=>{"use strict";p();var{InvalidArgumentError:crt}=mc(),{kClients:Dq,kRunning:W2n,kClose:bds,kDestroy:Sds,kDispatch:Tds,kInterceptors:Ids}=Nd(),xds=jue(),wds=ode(),Rds=ide(),Pds=Os(),kds=trt(),z2n=Symbol("onConnect"),Y2n=Symbol("onDisconnect"),K2n=Symbol("onConnectionError"),Dds=Symbol("maxRedirections"),J2n=Symbol("onDrain"),Z2n=Symbol("factory"),bZt=Symbol("options");function Nds(t,e){return e&&e.connections===1?new Rds(t,e):new wds(t,e)}a(Nds,"defaultFactory");var SZt=class extends xds{static{a(this,"Agent")}constructor({factory:e=Nds,maxRedirections:r=0,connect:n,...o}={}){if(super(),typeof e!="function")throw new crt("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new crt("connect must be a function or an object");if(!Number.isInteger(r)||r<0)throw new crt("maxRedirections must be a positive number");n&&typeof n!="function"&&(n={...n}),this[Ids]=o.interceptors?.Agent&&Array.isArray(o.interceptors.Agent)?o.interceptors.Agent:[kds({maxRedirections:r})],this[bZt]={...Pds.deepClone(o),connect:n},this[bZt].interceptors=o.interceptors?{...o.interceptors}:void 0,this[Dds]=r,this[Z2n]=e,this[Dq]=new Map,this[J2n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[z2n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[Y2n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[K2n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[W2n](){let e=0;for(let r of this[Dq].values())e+=r[W2n];return e}[Tds](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new crt("opts.origin must be a non-empty string or URL.");let o=this[Dq].get(n);return o||(o=this[Z2n](e.origin,this[bZt]).on("drain",this[J2n]).on("connect",this[z2n]).on("disconnect",this[Y2n]).on("connectionError",this[K2n]),this[Dq].set(n,o)),o.dispatch(e,r)}async[bds](){let e=[];for(let r of this[Dq].values())e.push(r.close());this[Dq].clear(),await Promise.all(e)}async[Sds](e){let r=[];for(let n of this[Dq].values())r.push(n.destroy(e));this[Dq].clear(),await Promise.all(r)}};X2n.exports=SZt});var RZt=I((d$d,uDn)=>{"use strict";p();var{kProxy:TZt,kClose:oDn,kDestroy:sDn,kDispatch:eDn,kInterceptors:Mds}=Nd(),{URL:oJ}=require("node:url"),Ods=sde(),aDn=ode(),cDn=jue(),{InvalidArgumentError:ade,RequestAbortedError:Bds,SecureProxyConnectionError:Lds}=mc(),tDn=vwe(),lDn=ide(),lrt=Symbol("proxy agent"),urt=Symbol("proxy client"),Nq=Symbol("proxy headers"),IZt=Symbol("request tls settings"),rDn=Symbol("proxy tls settings"),nDn=Symbol("connect endpoint function"),iDn=Symbol("tunnel proxy");function Fds(t){return t==="https:"?443:80}a(Fds,"defaultProtocolPort");function Uds(t,e){return new aDn(t,e)}a(Uds,"defaultFactory");var Qds=a(()=>{},"noop");function qds(t,e){return e.connections===1?new lDn(t,e):new aDn(t,e)}a(qds,"defaultAgentFactory");var xZt=class extends cDn{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(super(),!e)throw new ade("Proxy URL is mandatory");this[Nq]=r,o?this.#e=o(e,{connect:n}):this.#e=new lDn(e,{connect:n})}[eDn](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new ade("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new oJ(o);c.host=l}return e.headers={...this[Nq],...c},this.#e[eDn](e,r)}async[oDn](){return this.#e.close()}async[sDn](e){return this.#e.destroy(e)}},wZt=class extends cDn{static{a(this,"ProxyAgent")}constructor(e){if(super(),!e||typeof e=="object"&&!(e instanceof oJ)&&!e.uri)throw new ade("Proxy uri is mandatory");let{clientFactory:r=Uds}=e;if(typeof r!="function")throw new ade("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e,o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[TZt]={uri:s,protocol:u},this[Mds]=e.interceptors?.ProxyAgent&&Array.isArray(e.interceptors.ProxyAgent)?e.interceptors.ProxyAgent:[],this[IZt]=e.requestTls,this[rDn]=e.proxyTls,this[Nq]=e.headers||{},this[iDn]=n,e.auth&&e.token)throw new ade("opts.auth cannot be used in combination with opts.token");e.auth?this[Nq]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[Nq]["proxy-authorization"]=e.token:d&&f&&(this[Nq]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=tDn({...e.proxyTls});this[nDn]=tDn({...e.requestTls});let g=e.factory||qds,A=a((y,E)=>{let{protocol:_}=new oJ(y);return!this[iDn]&&_==="http:"&&this[TZt].protocol==="http:"?new xZt(this[TZt].uri,{headers:this[Nq],connect:m,factory:g}):g(y,E)},"factory");this[urt]=r(o,{connect:m}),this[lrt]=new Ods({...e,factory:A,connect:a(async(y,E)=>{let _=y.host;y.port||(_+=`:${Fds(y.protocol)}`);try{let{socket:v,statusCode:b}=await this[urt].connect({origin:c,port:l,path:_,signal:y.signal,headers:{...this[Nq],host:y.host},servername:this[rDn]?.servername||h});if(b!==200&&(v.on("error",Qds).destroy(),E(new Bds(`Proxy response (${b}) !== 200 when HTTP Tunneling`))),y.protocol!=="https:"){E(null,v);return}let T;this[IZt]?T=this[IZt].servername:T=y.servername,this[nDn]({...y,servername:T,httpSocket:v},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Lds(v)):E(v)}},"connect")})}dispatch(e,r){let n=jds(e.headers);if(Hds(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new oJ(e.origin);n.host=o}return this[lrt].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new oJ(e):e instanceof oJ?e:new oJ(e.uri)}async[oDn](){await this[lrt].close(),await this[urt].close()}async[sDn](){await this[lrt].destroy(),await this[urt].destroy()}};function jds(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new ade("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Hds,"throwIfProxyAuthIsSent");uDn.exports=wZt});var gDn=I((h$d,mDn)=>{"use strict";p();var Gds=jue(),{kClose:$ds,kDestroy:Vds,kClosed:dDn,kDestroyed:fDn,kDispatch:Wds,kNoProxyAgent:Gwe,kHttpProxyAgent:Mq,kHttpsProxyAgent:sJ}=Nd(),pDn=RZt(),zds=sde(),Yds={"http:":80,"https:":443},hDn=!1,PZt=class extends Gds{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e,hDn||(hDn=!0,process.emitWarning("EnvHttpProxyAgent is experimental, expect them to change at any time.",{code:"UNDICI-EHPA"}));let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[Gwe]=new zds(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Mq]=new pDn({...s,uri:c}):this[Mq]=this[Gwe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[sJ]=new pDn({...s,uri:l}):this[sJ]=this[Mq],this.#o()}[Wds](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}async[$ds](){await this[Gwe].close(),this[Mq][dDn]||await this[Mq].close(),this[sJ][dDn]||await this[sJ].close()}async[Vds](e){await this[Gwe].destroy(e),this[Mq][fDn]||await this[Mq].destroy(e),this[sJ][fDn]||await this[sJ].destroy(e)}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Yds[r]||0,this.#i(n,o)?r==="https:"?this[sJ]:this[Mq]:this[Gwe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var cde=require("node:assert"),{kRetryHandlerDefaultRetry:ADn}=Nd(),{RequestRetryError:$we}=mc(),{isDisturbed:yDn,parseHeaders:Kds,parseRangeHeader:EDn,wrapRequestBody:Jds}=Os();function Zds(t){let e=Date.now();return new Date(t).getTime()-e}a(Zds,"calculateRetryAfterHeader");var kZt=class t{static{a(this,"RetryHandler")}constructor(e,r){let{retryOptions:n,...o}=e,{retry:s,maxRetries:c,maxTimeout:l,minTimeout:u,timeoutFactor:d,methods:f,errorCodes:h,retryAfter:m,statusCodes:g}=n??{};this.dispatch=r.dispatch,this.handler=r.handler,this.opts={...o,body:Jds(e.body)},this.abort=null,this.aborted=!1,this.retryOpts={retry:s??t[ADn],retryAfter:m??!0,maxTimeout:l??30*1e3,minTimeout:u??500,timeoutFactor:d??2,maxRetries:c??5,methods:f??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:g??[500,502,503,504,429],errorCodes:h??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(A=>{this.aborted=!0,this.abort?this.abort(A):this.reason=A})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(e,r,n){this.handler.onUpgrade&&this.handler.onUpgrade(e,r,n)}onConnect(e){this.aborted?e(this.reason):this.abort=e}onBodySent(e){if(this.handler.onBodySent)return this.handler.onBodySent(e)}static[ADn](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?Zds(v):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onHeaders(e,r,n,o){let s=Kds(r);if(this.retryCount+=1,e>=300)return this.retryOpts.statusCodes.includes(e)===!1?this.handler.onHeaders(e,r,n,o):(this.abort(new $we("Request failed",e,{headers:s,data:{count:this.retryCount}})),!1);if(this.resume!=null){if(this.resume=null,e!==206&&(this.start>0||e!==200))return this.abort(new $we("server does not support the range header and the payload was partially consumed",e,{headers:s,data:{count:this.retryCount}})),!1;let l=EDn(s["content-range"]);if(!l)return this.abort(new $we("Content-Range mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;if(this.etag!=null&&this.etag!==s.etag)return this.abort(new $we("ETag mismatch",e,{headers:s,data:{count:this.retryCount}})),!1;let{start:u,size:d,end:f=d-1}=l;return cde(this.start===u,"content-range mismatch"),cde(this.end==null||this.end===f,"content-range mismatch"),this.resume=n,!0}if(this.end==null){if(e===206){let l=EDn(s["content-range"]);if(l==null)return this.handler.onHeaders(e,r,n,o);let{start:u,size:d,end:f=d-1}=l;cde(u!=null&&Number.isFinite(u),"content-range mismatch"),cde(f!=null&&Number.isFinite(f),"invalid content-length"),this.start=u,this.end=f}if(this.end==null){let l=s["content-length"];this.end=l!=null?Number(l)-1:null}return cde(Number.isFinite(this.start)),cde(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=n,this.etag=s.etag!=null?s.etag:null,this.etag!=null&&this.etag.startsWith("W/")&&(this.etag=null),this.handler.onHeaders(e,r,n,o)}let c=new $we("Request failed",e,{headers:s,data:{count:this.retryCount}});return this.abort(c),!1}onData(e){return this.start+=e.length,this.handler.onData(e)}onComplete(e){return this.retryCount=0,this.handler.onComplete(e)}onError(e){if(this.aborted||yDn(this.opts.body))return this.handler.onError(e);this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(e,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},r.bind(this));function r(n){if(n!=null||this.aborted||yDn(this.opts.body))return this.handler.onError(n);if(this.start!==0){let o={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(o["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...o}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(o){this.handler.onError(o)}}a(r,"onRetry")}};_Dn.exports=kZt});var CDn=I((_$d,vDn)=>{"use strict";p();var Xds=Ewe(),efs=drt(),DZt=class extends Xds{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new efs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};vDn.exports=DZt});var FZt=I((b$d,kDn)=>{"use strict";p();var xDn=require("node:assert"),{Readable:tfs}=require("node:stream"),{RequestAbortedError:wDn,NotSupportedError:rfs,InvalidArgumentError:nfs,AbortError:NZt}=mc(),RDn=Os(),{ReadableStreamFrom:ifs}=Os(),QS=Symbol("kConsume"),Vwe=Symbol("kReading"),Oq=Symbol("kBody"),bDn=Symbol("kAbort"),PDn=Symbol("kContentType"),SDn=Symbol("kContentLength"),ofs=a(()=>{},"noop"),MZt=class extends tfs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[bDn]=r,this[QS]=null,this[Oq]=null,this[PDn]=n,this[SDn]=o,this[Vwe]=!1}destroy(e){return!e&&!this._readableState.endEmitted&&(e=new wDn),e&&this[bDn](),super.destroy(e)}_destroy(e,r){this[Vwe]?r(e):setImmediate(()=>{r(e)})}on(e,...r){return(e==="data"||e==="readable")&&(this[Vwe]=!0),super.on(e,...r)}addListener(e,...r){return this.on(e,...r)}off(e,...r){let n=super.off(e,...r);return(e==="data"||e==="readable")&&(this[Vwe]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,...r){return this.off(e,...r)}push(e){return this[QS]&&e!==null?(BZt(this[QS],e),this[Vwe]?super.push(e):!0):super.push(e)}async text(){return Wwe(this,"text")}async json(){return Wwe(this,"json")}async blob(){return Wwe(this,"blob")}async bytes(){return Wwe(this,"bytes")}async arrayBuffer(){return Wwe(this,"arrayBuffer")}async formData(){throw new rfs}get bodyUsed(){return RDn.isDisturbed(this)}get body(){return this[Oq]||(this[Oq]=ifs(this),this[QS]&&(this[Oq].getReader(),xDn(this[Oq].locked))),this[Oq]}async dump(e){let r=Number.isFinite(e?.limit)?e.limit:131072,n=e?.signal;if(n!=null&&(typeof n!="object"||!("aborted"in n)))throw new nfs("signal must be an AbortSignal");return n?.throwIfAborted(),this._readableState.closeEmitted?null:await new Promise((o,s)=>{this[SDn]>r&&this.destroy(new NZt);let c=a(()=>{this.destroy(n.reason??new NZt)},"onAbort");n?.addEventListener("abort",c),this.on("close",function(){n?.removeEventListener("abort",c),n?.aborted?s(n.reason??new NZt):o(null)}).on("error",ofs).on("data",function(l){r-=l.length,r<=0&&this.destroy()}).resume()})}};function sfs(t){return t[Oq]&&t[Oq].locked===!0||t[QS]}a(sfs,"isLocked");function afs(t){return RDn.isDisturbed(t)||sfs(t)}a(afs,"isUnusable");async function Wwe(t,e){return xDn(!t[QS]),new Promise((r,n)=>{if(afs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",s=>{n(s)}).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[QS]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){LZt(this[QS],o)}).on("close",function(){this[QS].body!==null&&LZt(this[QS],new wDn)}),cfs(t[QS])})})}a(Wwe,"consume");function cfs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&r[0]===239&&r[1]===187&&r[2]===191?3:0;return r.utf8Slice(o,n)}a(OZt,"chunksDecode");function TDn(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{p();var lfs=require("node:assert"),{ResponseStatusCodeError:DDn}=mc(),{chunksDecode:NDn}=FZt(),ufs=128*1024;async function dfs({callback:t,body:e,contentType:r,statusCode:n,statusMessage:o,headers:s}){lfs(e);let c=[],l=0;try{for await(let h of e)if(c.push(h),l+=h.length,l>ufs){c=[],l=0;break}}catch{c=[],l=0}let u=`Response status code ${n}${o?`: ${o}`:""}`;if(n===204||!r||!l){queueMicrotask(()=>t(new DDn(u,n,s)));return}let d=Error.stackTraceLimit;Error.stackTraceLimit=0;let f;try{MDn(r)?f=JSON.parse(NDn(c,l)):ODn(r)&&(f=NDn(c,l))}catch{}finally{Error.stackTraceLimit=d}queueMicrotask(()=>t(new DDn(u,n,s,f)))}a(dfs,"getResolveErrorBodyCallback");var MDn=a(t=>t.length>15&&t[11]==="/"&&t[0]==="a"&&t[1]==="p"&&t[2]==="p"&&t[3]==="l"&&t[4]==="i"&&t[5]==="c"&&t[6]==="a"&&t[7]==="t"&&t[8]==="i"&&t[9]==="o"&&t[10]==="n"&&t[12]==="j"&&t[13]==="s"&&t[14]==="o"&&t[15]==="n","isContentTypeApplicationJson"),ODn=a(t=>t.length>4&&t[4]==="/"&&t[0]==="t"&&t[1]==="e"&&t[2]==="x"&&t[3]==="t","isContentTypeText");BDn.exports={getResolveErrorBodyCallback:dfs,isContentTypeApplicationJson:MDn,isContentTypeText:ODn}});var UDn=I((R$d,QZt)=>{"use strict";p();var ffs=require("node:assert"),{Readable:pfs}=FZt(),{InvalidArgumentError:lde,RequestAbortedError:LDn}=mc(),qS=Os(),{getResolveErrorBodyCallback:hfs}=UZt(),{AsyncResource:mfs}=require("node:async_hooks"),frt=class extends mfs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new lde("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,throwOnError:d,highWaterMark:f}=e;try{if(typeof r!="function")throw new lde("invalid callback");if(f&&(typeof f!="number"||f<0))throw new lde("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new lde("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new lde("invalid method");if(l&&typeof l!="function")throw new lde("invalid onInfo callback");super("UNDICI_REQUEST")}catch(h){throw qS.isStream(c)&&qS.destroy(c.on("error",qS.nop),h),h}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.throwOnError=d,this.highWaterMark=f,this.signal=n,this.reason=null,this.removeAbortListener=null,qS.isStream(c)&&c.on("error",h=>{this.onError(h)}),this.signal&&(this.signal.aborted?this.reason=this.signal.reason??new LDn:this.removeAbortListener=qS.addAbortListener(this.signal,()=>{this.reason=this.signal.reason??new LDn,this.res?qS.destroy(this.res.on("error",qS.nop),this.reason):this.abort&&this.abort(this.reason),this.removeAbortListener&&(this.res?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}))}onConnect(e,r){if(this.reason){e(this.reason);return}ffs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?qS.parseRawHeaders(r):qS.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?qS.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new pfs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});this.removeAbortListener&&y.on("close",this.removeAbortListener),this.callback=null,this.res=y,s!==null&&(this.throwOnError&&e>=400?this.runInAsyncScope(hfs,null,{callback:s,body:y,contentType:g,statusCode:e,statusMessage:o,headers:h}):this.runInAsyncScope(s,null,null,{statusCode:e,headers:h,trailers:this.trailers,opaque:c,body:y,context:u}))}onData(e){return this.res.push(e)}onComplete(e){qS.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{qS.destroy(r,e)})),o&&(this.body=null,qS.destroy(o,e)),this.removeAbortListener&&(r?.off("close",this.removeAbortListener),this.removeAbortListener(),this.removeAbortListener=null)}};function FDn(t,e){if(e===void 0)return new Promise((r,n)=>{FDn.call(this,t,(o,s)=>o?n(o):r(s))});try{this.dispatch(t,new frt(t,e))}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(FDn,"request");QZt.exports=FDn;QZt.exports.RequestHandler=frt});var zwe=I((D$d,jDn)=>{p();var{addAbortListener:gfs}=Os(),{RequestAbortedError:Afs}=mc(),ude=Symbol("kListener"),DO=Symbol("kSignal");function QDn(t){t.abort?t.abort(t[DO]?.reason):t.reason=t[DO]?.reason??new Afs,qDn(t)}a(QDn,"abort");function yfs(t,e){if(t.reason=null,t[DO]=null,t[ude]=null,!!e){if(e.aborted){QDn(t);return}t[DO]=e,t[ude]=()=>{QDn(t)},gfs(t[DO],t[ude])}}a(yfs,"addSignal");function qDn(t){t[DO]&&("removeEventListener"in t[DO]?t[DO].removeEventListener("abort",t[ude]):t[DO].removeListener("abort",t[ude]),t[DO]=null,t[ude]=null)}a(qDn,"removeSignal");jDn.exports={addSignal:yfs,removeSignal:qDn}});var VDn=I((O$d,$Dn)=>{"use strict";p();var Efs=require("node:assert"),{finished:_fs,PassThrough:vfs}=require("node:stream"),{InvalidArgumentError:dde,InvalidReturnValueError:Cfs}=mc(),Qk=Os(),{getResolveErrorBodyCallback:bfs}=UZt(),{AsyncResource:Sfs}=require("node:async_hooks"),{addSignal:Tfs,removeSignal:HDn}=zwe(),qZt=class extends Sfs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new dde("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d,throwOnError:f}=e;try{if(typeof n!="function")throw new dde("invalid callback");if(typeof r!="function")throw new dde("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new dde("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new dde("invalid method");if(u&&typeof u!="function")throw new dde("invalid onInfo callback");super("UNDICI_STREAM")}catch(h){throw Qk.isStream(l)&&Qk.destroy(l.on("error",Qk.nop),h),h}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,this.throwOnError=f||!1,Qk.isStream(l)&&l.on("error",h=>{this.onError(h)}),Tfs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}Efs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,callback:u,responseHeaders:d}=this,f=d==="raw"?Qk.parseRawHeaders(r):Qk.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:f});return}this.factory=null;let h;if(this.throwOnError&&e>=400){let A=(d==="raw"?Qk.parseHeaders(r):f)["content-type"];h=new vfs,this.callback=null,this.runInAsyncScope(bfs,null,{callback:u,body:h,contentType:A,statusCode:e,statusMessage:o,headers:f})}else{if(s===null)return;if(h=this.runInAsyncScope(s,null,{statusCode:e,headers:f,opaque:c,context:l}),!h||typeof h.write!="function"||typeof h.end!="function"||typeof h.on!="function")throw new Cfs("expected Writable");_fs(h,{readable:!1},g=>{let{callback:A,res:y,opaque:E,trailers:_,abort:v}=this;this.res=null,(g||!y.readable)&&Qk.destroy(y,g),this.callback=null,this.runInAsyncScope(A,null,g||null,{opaque:E,trailers:_}),g&&v()})}return h.on("drain",n),this.res=h,(h.writableNeedDrain!==void 0?h.writableNeedDrain:h._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;HDn(this),r&&(this.trailers=Qk.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;HDn(this),this.factory=null,r?(this.res=null,Qk.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,Qk.destroy(s,e))}};function GDn(t,e,r){if(r===void 0)return new Promise((n,o)=>{GDn.call(this,t,e,(s,c)=>s?o(s):n(c))});try{this.dispatch(t,new qZt(t,e,r))}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(GDn,"stream");$Dn.exports=GDn});var KDn=I((F$d,YDn)=>{"use strict";p();var{Readable:zDn,Duplex:Ifs,PassThrough:xfs}=require("node:stream"),{InvalidArgumentError:Ywe,InvalidReturnValueError:wfs,RequestAbortedError:jZt}=mc(),nw=Os(),{AsyncResource:Rfs}=require("node:async_hooks"),{addSignal:Pfs,removeSignal:kfs}=zwe(),WDn=require("node:assert"),fde=Symbol("resume"),HZt=class extends zDn{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[fde]=null}_read(){let{[fde]:e}=this;e&&(this[fde]=null,e())}_destroy(e,r){this._read(),r(e)}},GZt=class extends zDn{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[fde]=e}_read(){this[fde]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new jZt),r(e)}},$Zt=class extends Rfs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Ywe("invalid opts");if(typeof r!="function")throw new Ywe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Ywe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Ywe("invalid method");if(c&&typeof c!="function")throw new Ywe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new HZt().on("error",nw.nop),this.ret=new Ifs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[fde]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new jZt),A&&u&&A(),nw.destroy(f,u),nw.destroy(h,u),nw.destroy(m,u),kfs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,Pfs(this,n)}onConnect(e,r){let{ret:n,res:o}=this;if(this.reason){e(this.reason);return}WDn(!o,"pipeline cannot be retried"),WDn(!n.destroyed),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?nw.parseRawHeaders(r):nw.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new GZt(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?nw.parseRawHeaders(r):nw.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",nw.nop),u}if(!l||typeof l.on!="function")throw new wfs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;nw.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||nw.destroy(u,new jZt)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,nw.destroy(r,e)}};function Dfs(t,e){try{let r=new $Zt(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new xfs().destroy(r)}}a(Dfs,"pipeline");YDn.exports=Dfs});var rNn=I((q$d,tNn)=>{"use strict";p();var{InvalidArgumentError:VZt,SocketError:Nfs}=mc(),{AsyncResource:Mfs}=require("node:async_hooks"),JDn=Os(),{addSignal:Ofs,removeSignal:ZDn}=zwe(),XDn=require("node:assert"),WZt=class extends Mfs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new VZt("invalid opts");if(typeof r!="function")throw new VZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new VZt("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,Ofs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}XDn(this.callback),this.abort=e,this.context=null}onHeaders(){throw new Nfs("bad upgrade",null)}onUpgrade(e,r,n){XDn(e===101);let{callback:o,opaque:s,context:c}=this;ZDn(this),this.callback=null;let l=this.responseHeaders==="raw"?JDn.parseRawHeaders(r):JDn.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;ZDn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function eNn(t,e){if(e===void 0)return new Promise((r,n)=>{eNn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new WZt(t,e);this.dispatch({...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(eNn,"upgrade");tNn.exports=eNn});var aNn=I((G$d,sNn)=>{"use strict";p();var Bfs=require("node:assert"),{AsyncResource:Lfs}=require("node:async_hooks"),{InvalidArgumentError:zZt,SocketError:Ffs}=mc(),nNn=Os(),{addSignal:Ufs,removeSignal:iNn}=zwe(),YZt=class extends Lfs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new zZt("invalid opts");if(typeof r!="function")throw new zZt("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new zZt("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,Ufs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}Bfs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new Ffs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;iNn(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?nNn.parseRawHeaders(r):nNn.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;iNn(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function oNn(t,e){if(e===void 0)return new Promise((r,n)=>{oNn.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new YZt(t,e);this.dispatch({...t,method:"CONNECT"},r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(oNn,"connect");sNn.exports=oNn});var cNn=I((W$d,pde)=>{"use strict";p();pde.exports.request=UDn();pde.exports.stream=VDn();pde.exports.pipeline=KDn();pde.exports.upgrade=rNn();pde.exports.connect=aNn()});var JZt=I((Y$d,uNn)=>{"use strict";p();var{UndiciError:Qfs}=mc(),lNn=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),KZt=class t extends Qfs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),Error.captureStackTrace(this,t),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[lNn]===!0}[lNn]=!0};uNn.exports={MockNotMatchedError:KZt}});var hde=I((Z$d,dNn)=>{"use strict";p();dNn.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected")}});var Kwe=I((eVd,CNn)=>{"use strict";p();var{MockNotMatchedError:aJ}=JZt(),{kDispatches:prt,kMockAgent:qfs,kOriginalDispatch:jfs,kOrigin:Hfs,kGetNetConnect:Gfs}=hde(),{buildURL:$fs}=Os(),{STATUS_CODES:Vfs}=require("node:http"),{types:{isPromise:Wfs}}=require("node:util");function Y3(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(Y3,"matchValue");function pNn(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(pNn,"lowerCaseEntries");function hNn(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=hNn(e,r);if(!Y3(n,o))return!1}return!0}a(mNn,"matchHeaders");function fNn(t){if(typeof t!="string")return t;let e=t.split("?");if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(fNn,"safeUrl");function zfs(t,{path:e,method:r,body:n,headers:o}){let s=Y3(t.path,e),c=Y3(t.method,r),l=typeof t.body<"u"?Y3(t.body,n):!0,u=mNn(t,o);return s&&c&&l&&u}a(zfs,"matchKey");function gNn(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t.toString()}a(gNn,"getResponseData");function ANn(t,e){let r=e.query?$fs(e.path,e.query):e.path,n=typeof r=="string"?fNn(r):r,o=t.filter(({consumed:s})=>!s).filter(({path:s})=>Y3(fNn(s),n));if(o.length===0)throw new aJ(`Mock dispatch not matched for path '${n}'`);if(o=o.filter(({method:s})=>Y3(s,e.method)),o.length===0)throw new aJ(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(o=o.filter(({body:s})=>typeof s<"u"?Y3(s,e.body):!0),o.length===0)throw new aJ(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(o=o.filter(s=>mNn(s,e.headers)),o.length===0){let s=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new aJ(`Mock dispatch not matched for headers '${s}' on path '${n}'`)}return o[0]}a(ANn,"getMockDispatch");function Yfs(t,e,r){let n={timesInvoked:0,times:1,persist:!1,consumed:!1},o=typeof r=="function"?{callback:r}:{...r},s={...n,...e,pending:!0,data:{error:null,...o}};return t.push(s),s}a(Yfs,"addMockDispatch");function ZZt(t,e){let r=t.findIndex(n=>n.consumed?zfs(n,e):!1);r!==-1&&t.splice(r,1)}a(ZZt,"deleteMockDispatch");function yNn(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(yNn,"buildKey");function XZt(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?setTimeout(()=>{g(this[prt])},d):g(this[prt]);function g(y,E=s){let _=Array.isArray(t.headers)?eXt(t.headers):t.headers,v=typeof E=="function"?E({...t,headers:_}):E;if(Wfs(v)){v.then(R=>g(y,R));return}let b=gNn(v),T=XZt(c),w=XZt(l);e.onConnect?.(R=>e.onError(R),null),e.onHeaders?.(o,T,A,ENn(o)),e.onData?.(Buffer.from(b)),e.onComplete?.(w),ZZt(y,r)}a(g,"handleReply");function A(){}return a(A,"resume"),!0}a(_Nn,"mockDispatch");function Jfs(){let t=this[qfs],e=this[Hfs],r=this[jfs];return a(function(o,s){if(t.isMockActive)try{_Nn.call(this,o,s)}catch(c){if(c instanceof aJ){let l=t[Gfs]();if(l===!1)throw new aJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)`);if(vNn(l,e))r.call(this,o,s);else throw new aJ(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)`)}else throw c}else r.call(this,o,s)},"dispatch")}a(Jfs,"buildMockDispatch");function vNn(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>Y3(n,r.host)))}a(vNn,"checkNetConnect");function Zfs(t){if(t){let{agent:e,...r}=t;return r}}a(Zfs,"buildMockOptions");CNn.exports={getResponseData:gNn,getMockDispatch:ANn,addMockDispatch:Yfs,deleteMockDispatch:ZZt,buildKey:yNn,generateKeyValues:XZt,matchValue:Y3,getResponse:Kfs,getStatusText:ENn,mockDispatch:_Nn,buildMockDispatch:Jfs,checkNetConnect:vNn,buildMockOptions:Zfs,getHeaderByName:hNn,buildHeadersFromArray:eXt}});var aXt=I((nVd,sXt)=>{"use strict";p();var{getResponseData:Xfs,buildKey:eps,addMockDispatch:tXt}=Kwe(),{kDispatches:hrt,kDispatchKey:mrt,kDefaultHeaders:rXt,kDefaultTrailers:nXt,kContentLength:iXt,kMockDispatch:grt}=hde(),{InvalidArgumentError:NO}=mc(),{buildURL:tps}=Os(),mde=class{static{a(this,"MockScope")}constructor(e){this[grt]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new NO("waitInMs must be a valid integer > 0");return this[grt].delay=e,this}persist(){return this[grt].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new NO("repeatTimes must be a valid integer > 0");return this[grt].times=e,this}},oXt=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new NO("opts must be an object");if(typeof e.path>"u")throw new NO("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=tps(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[mrt]=eps(e),this[hrt]=r,this[rXt]={},this[nXt]={},this[iXt]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=Xfs(r),s=this[iXt]?{"content-length":o.length}:{},c={...this[rXt],...s,...n.headers},l={...this[nXt],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new NO("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new NO("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new NO("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=tXt(this[hrt],this[mrt],s);return new mde(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=tXt(this[hrt],this[mrt],n);return new mde(o)}replyWithError(e){if(typeof e>"u")throw new NO("error must be defined");let r=tXt(this[hrt],this[mrt],{error:e});return new mde(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new NO("headers must be defined");return this[rXt]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new NO("trailers must be defined");return this[nXt]=e,this}replyContentLength(){return this[iXt]=!0,this}};sXt.exports.MockInterceptor=oXt;sXt.exports.MockScope=mde});var uXt=I((sVd,RNn)=>{"use strict";p();var{promisify:rps}=require("node:util"),nps=ide(),{buildMockDispatch:ips}=Kwe(),{kDispatches:bNn,kMockAgent:SNn,kClose:TNn,kOriginalClose:INn,kOrigin:xNn,kOriginalDispatch:ops,kConnected:cXt}=hde(),{MockInterceptor:sps}=aXt(),wNn=Nd(),{InvalidArgumentError:aps}=mc(),lXt=class extends nps{static{a(this,"MockClient")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new aps("Argument opts.agent must implement Agent");this[SNn]=r.agent,this[xNn]=e,this[bNn]=[],this[cXt]=1,this[ops]=this.dispatch,this[INn]=this.close.bind(this),this.dispatch=ips.call(this),this.close=this[TNn]}get[wNn.kConnected](){return this[cXt]}intercept(e){return new sps(e,this[bNn])}async[TNn](){await rps(this[INn])(),this[cXt]=0,this[SNn][wNn.kClients].delete(this[xNn])}};RNn.exports=lXt});var pXt=I((lVd,BNn)=>{"use strict";p();var{promisify:cps}=require("node:util"),lps=ode(),{buildMockDispatch:ups}=Kwe(),{kDispatches:PNn,kMockAgent:kNn,kClose:DNn,kOriginalClose:NNn,kOrigin:MNn,kOriginalDispatch:dps,kConnected:dXt}=hde(),{MockInterceptor:fps}=aXt(),ONn=Nd(),{InvalidArgumentError:pps}=mc(),fXt=class extends lps{static{a(this,"MockPool")}constructor(e,r){if(super(e,r),!r||!r.agent||typeof r.agent.dispatch!="function")throw new pps("Argument opts.agent must implement Agent");this[kNn]=r.agent,this[MNn]=e,this[PNn]=[],this[dXt]=1,this[dps]=this.dispatch,this[NNn]=this.close.bind(this),this.dispatch=ups.call(this),this.close=this[DNn]}get[ONn.kConnected](){return this[dXt]}intercept(e){return new fps(e,this[PNn])}async[DNn](){await cps(this[NNn])(),this[dXt]=0,this[kNn][ONn.kClients].delete(this[MNn])}};BNn.exports=fXt});var FNn=I((pVd,LNn)=>{"use strict";p();var hps={pronoun:"it",is:"is",was:"was",this:"this"},mps={pronoun:"they",is:"are",was:"were",this:"these"};LNn.exports=class{static{a(this,"Pluralizer")}constructor(e,r){this.singular=e,this.plural=r}pluralize(e){let r=e===1,n=r?hps:mps,o=r?this.singular:this.plural;return{...n,count:e,noun:o}}}});var QNn=I((AVd,UNn)=>{"use strict";p();var{Transform:gps}=require("node:stream"),{Console:Aps}=require("node:console"),yps=process.versions.icu?"\u2705":"Y ",Eps=process.versions.icu?"\u274C":"N ";UNn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new gps({transform(r,n,o){o(null,r)}}),this.logger=new Aps({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?yps:Eps,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var GNn=I((_Vd,HNn)=>{"use strict";p();var{kClients:cJ}=Nd(),_ps=sde(),{kAgent:hXt,kMockAgentSet:Art,kMockAgentGet:qNn,kDispatches:mXt,kIsMockActive:yrt,kNetConnect:lJ,kGetNetConnect:vps,kOptions:Ert,kFactory:_rt}=hde(),Cps=uXt(),bps=pXt(),{matchValue:Sps,buildMockOptions:Tps}=Kwe(),{InvalidArgumentError:jNn,UndiciError:Ips}=mc(),xps=Ewe(),wps=FNn(),Rps=QNn(),gXt=class extends xps{static{a(this,"MockAgent")}constructor(e){if(super(e),this[lJ]=!0,this[yrt]=!0,e?.agent&&typeof e.agent.dispatch!="function")throw new jNn("Argument opts.agent must implement Agent");let r=e?.agent?e.agent:new _ps(e);this[hXt]=r,this[cJ]=r[cJ],this[Ert]=Tps(e)}get(e){let r=this[qNn](e);return r||(r=this[_rt](e),this[Art](e,r)),r}dispatch(e,r){return this.get(e.origin),this[hXt].dispatch(e,r)}async close(){await this[hXt].close(),this[cJ].clear()}deactivate(){this[yrt]=!1}activate(){this[yrt]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[lJ])?this[lJ].push(e):this[lJ]=[e];else if(typeof e>"u")this[lJ]=!0;else throw new jNn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[lJ]=!1}get isMockActive(){return this[yrt]}[Art](e,r){this[cJ].set(e,r)}[_rt](e){let r=Object.assign({agent:this},this[Ert]);return this[Ert]&&this[Ert].connections===1?new Cps(e,r):new bps(e,r)}[qNn](e){let r=this[cJ].get(e);if(r)return r;if(typeof e!="string"){let n=this[_rt]("http://localhost:9999");return this[Art](e,n),n}for(let[n,o]of Array.from(this[cJ]))if(o&&typeof n!="string"&&Sps(n,e)){let s=this[_rt](e);return this[Art](e,s),s[mXt]=o[mXt],s}}[vps](){return this[lJ]}pendingInterceptors(){let e=this[cJ];return Array.from(e.entries()).flatMap(([r,n])=>n[mXt].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Rps}={}){let r=this.pendingInterceptors();if(r.length===0)return;let n=new wps("interceptor","interceptors").pluralize(r.length);throw new Ips(` ${n.count} ${n.noun} ${n.is} pending: ${e.format(r)} -`.trim())}};QNn.exports=uXt});var xrt=I((Vzd,$Nn)=>{"use strict";p();var jNn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:jhs}=mc(),Hhs=ude();GNn()===void 0&&HNn(new Hhs);function HNn(t){if(!t||typeof t.dispatch!="function")throw new jhs("Argument agent must implement Agent");Object.defineProperty(globalThis,jNn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(HNn,"setGlobalDispatcher");function GNn(){return globalThis[jNn]}a(GNn,"getGlobalDispatcher");$Nn.exports={setGlobalDispatcher:HNn,getGlobalDispatcher:GNn}});var wrt=I((Kzd,VNn)=>{"use strict";p();VNn.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var zNn=I((Xzd,WNn)=>{"use strict";p();var Ghs=srt();WNn.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new Ghs(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var KNn=I((rYd,YNn)=>{"use strict";p();var $hs=Art();YNn.exports=t=>e=>a(function(n,o){return e(n,new $hs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var ZNn=I((oYd,JNn)=>{"use strict";p();var Vhs=Ls(),{InvalidArgumentError:Whs,RequestAbortedError:zhs}=mc(),Yhs=wrt(),dXt=class extends Yhs{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new Whs("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=Vhs.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new zhs(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function Khs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new dXt({maxSize:s},o);return e(n,c)},"Intercept")}a(Khs,"createDumpInterceptor");JNn.exports=Khs});var tMn=I((cYd,eMn)=>{"use strict";p();var{isIP:Jhs}=require("node:net"),{lookup:Zhs}=require("node:dns"),Xhs=wrt(),{InvalidArgumentError:_de,InformationalError:e0s}=mc(),XNn=Math.pow(2,31)-1,fXt=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new e0s("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){Zhs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===XNn?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===XNn?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new pXt(this,e,r)}},pXt=class extends Xhs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};eMn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new _de("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new _de("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new _de("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new _de("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new _de("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new _de("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new fXt(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return Jhs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var yJ=I((dYd,cMn)=>{"use strict";p();var{kConstruct:t0s}=Od(),{kEnumerableProperty:Cde}=Ls(),{iteratorMixin:r0s,isValidHeaderName:uRe,isValidHeaderValue:nMn}=$S(),{webidl:Ha}=bA(),hXt=require("node:assert"),Rrt=require("node:util"),Kh=Symbol("headers map"),zS=Symbol("headers map sorted");function rMn(t){return t===10||t===13||t===9||t===32}a(rMn,"isHTTPWhiteSpaceCharCode");function iMn(t){let e=0,r=t.length;for(;r>e&&rMn(t.charCodeAt(r-1));)--r;for(;r>e&&rMn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(iMn,"headerValueNormalize");function oMn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(oMn,"fill");function mXt(t,e,r){if(r=iMn(r),uRe(e)){if(!nMn(r))throw Ha.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(aMn(t)==="immutable")throw new TypeError("immutable");return gXt(t).append(e,r,!1)}a(mXt,"appendHeader");function sMn(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[Kh])r[n++]=[o,s],hXt(s!==null);return r.sort(sMn)}}},HP=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){Ha.util.markAsUncloneable(this),e!==t0s&&(this.#t=new krt,this.#e="none",e!==void 0&&(e=Ha.converters.HeadersInit(e,"Headers contructor","init"),oMn(this,e)))}append(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),mXt(this,e,r)}delete(e){if(Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.delete"),e=Ha.converters.ByteString(e,"Headers.delete","name"),!uRe(e))throw Ha.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=Ha.converters.ByteString(e,r,"name"),!uRe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=Ha.converters.ByteString(e,r,"name"),!uRe(e))throw Ha.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){Ha.brandCheck(this,t),Ha.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=Ha.converters.ByteString(e,n,"name"),r=Ha.converters.ByteString(r,n,"value"),r=iMn(r),uRe(e)){if(!nMn(r))throw Ha.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw Ha.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){Ha.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[zS](){if(this.#t[zS])return this.#t[zS];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[zS]=r;for(let o=0;o>"](t,e,r,n.bind(t)):Ha.converters["record"](t,e,r)}throw Ha.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};cMn.exports={fill:oMn,compareHeaderName:sMn,Headers:HP,HeadersList:krt,getHeadersGuard:aMn,setHeadersGuard:n0s,setHeadersList:i0s,getHeadersList:gXt}});var fRe=I((hYd,_Mn)=>{"use strict";p();var{Headers:hMn,HeadersList:lMn,fill:o0s,getHeadersGuard:s0s,setHeadersGuard:mMn,setHeadersList:gMn}=yJ(),{extractBody:uMn,cloneBody:a0s,mixinBody:c0s,hasFinalizationRegistry:AMn,streamRegistry:yMn,bodyUnusable:l0s}=tde(),AXt=Ls(),dMn=require("node:util"),{kEnumerableProperty:YS}=AXt,{isValidReasonPhrase:u0s,isCancelled:d0s,isAborted:f0s,isBlobLike:p0s,serializeJavascriptValueToJSONString:h0s,isErrorLike:m0s,isomorphicEncode:g0s,environmentSettingsObject:A0s}=$S(),{redirectStatusSet:y0s,nullBodyStatus:E0s}=Owe(),{kState:Ld,kHeaders:rF}=kq(),{webidl:ts}=bA(),{FormData:_0s}=qwe(),{URLSerializer:fMn}=Gv(),{kConstruct:Drt}=Od(),yXt=require("node:assert"),{types:C0s}=require("node:util"),v0s=new TextEncoder("utf-8"),EJ=class t{static{a(this,"Response")}static error(){return dRe(Nrt(),"immutable")}static json(e,r={}){ts.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=ts.converters.ResponseInit(r));let n=v0s.encode(h0s(e)),o=uMn(n),s=dRe(vde({}),"response");return pMn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){ts.argumentLengthCheck(arguments,1,"Response.redirect"),e=ts.converters.USVString(e),r=ts.converters["unsigned short"](r);let n;try{n=new URL(e,A0s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!y0s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=dRe(vde({}),"immutable");o[Ld].status=r;let s=g0s(fMn(n));return o[Ld].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(ts.util.markAsUncloneable(this),e===Drt)return;e!==null&&(e=ts.converters.BodyInit(e)),r=ts.converters.ResponseInit(r),this[Ld]=vde({}),this[rF]=new hMn(Drt),mMn(this[rF],"response"),gMn(this[rF],this[Ld].headersList);let n=null;if(e!=null){let[o,s]=uMn(e);n={body:o,type:s}}pMn(this,r,n)}get type(){return ts.brandCheck(this,t),this[Ld].type}get url(){ts.brandCheck(this,t);let e=this[Ld].urlList,r=e[e.length-1]??null;return r===null?"":fMn(r,!0)}get redirected(){return ts.brandCheck(this,t),this[Ld].urlList.length>1}get status(){return ts.brandCheck(this,t),this[Ld].status}get ok(){return ts.brandCheck(this,t),this[Ld].status>=200&&this[Ld].status<=299}get statusText(){return ts.brandCheck(this,t),this[Ld].statusText}get headers(){return ts.brandCheck(this,t),this[rF]}get body(){return ts.brandCheck(this,t),this[Ld].body?this[Ld].body.stream:null}get bodyUsed(){return ts.brandCheck(this,t),!!this[Ld].body&&AXt.isDisturbed(this[Ld].body.stream)}clone(){if(ts.brandCheck(this,t),l0s(this))throw ts.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=EXt(this[Ld]);return AMn&&this[Ld].body?.stream&&yMn.register(this,new WeakRef(this[Ld].body.stream)),dRe(e,s0s(this[rF]))}[dMn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${dMn.formatWithOptions(r,n)}`}};c0s(EJ);Object.defineProperties(EJ.prototype,{type:YS,url:YS,status:YS,ok:YS,redirected:YS,statusText:YS,headers:YS,clone:YS,body:YS,bodyUsed:YS,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(EJ,{json:YS,redirect:YS,error:YS});function EXt(t){if(t.internalResponse)return EMn(EXt(t.internalResponse),t.type);let e=vde({...t,body:null});return t.body!=null&&(e.body=a0s(e,t.body)),e}a(EXt,"cloneResponse");function vde(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new lMn(t?.headersList):new lMn,urlList:t?.urlList?[...t.urlList]:[]}}a(vde,"makeResponse");function Nrt(t){let e=m0s(t);return vde({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(Nrt,"makeNetworkError");function b0s(t){return t.type==="error"&&t.status===0}a(b0s,"isNetworkError");function Prt(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return yXt(!(n in e)),r[n]=o,!0}})}a(Prt,"makeFilteredResponse");function EMn(t,e){if(e==="basic")return Prt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Prt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Prt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Prt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});yXt(!1)}a(EMn,"filterResponse");function S0s(t,e=null){return yXt(d0s(t)),f0s(t)?Nrt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):Nrt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(S0s,"makeAppropriateNetworkError");function pMn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!u0s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Ld].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Ld].statusText=e.statusText),"headers"in e&&e.headers!=null&&o0s(t[rF],e.headers),r){if(E0s.includes(t.status))throw ts.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Ld].body=r.body,r.type!=null&&!t[Ld].headersList.contains("content-type",!0)&&t[Ld].headersList.append("content-type",r.type,!0)}}a(pMn,"initializeResponse");function dRe(t,e){let r=new EJ(Drt);return r[Ld]=t,r[rF]=new hMn(Drt),gMn(r[rF],t.headersList),mMn(r[rF],e),AMn&&t.body?.stream&&yMn.register(r,new WeakRef(t.body.stream)),r}a(dRe,"fromInnerResponse");ts.converters.ReadableStream=ts.interfaceConverter(ReadableStream);ts.converters.FormData=ts.interfaceConverter(_0s);ts.converters.URLSearchParams=ts.interfaceConverter(URLSearchParams);ts.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?ts.converters.USVString(t,e,r):p0s(t)?ts.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||C0s.isArrayBuffer(t)?ts.converters.BufferSource(t,e,r):AXt.isFormDataLike(t)?ts.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?ts.converters.URLSearchParams(t,e,r):ts.converters.DOMString(t,e,r)};ts.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?ts.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:ts.converters.XMLHttpRequestBodyInit(t,e,r)};ts.converters.ResponseInit=ts.dictionaryConverter([{key:"status",converter:ts.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:ts.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:ts.converters.HeadersInit}]);_Mn.exports={isNetworkError:b0s,makeNetworkError:Nrt,makeResponse:vde,makeAppropriateNetworkError:S0s,filterResponse:EMn,Response:EJ,cloneResponse:EXt,fromInnerResponse:dRe}});var SMn=I((AYd,bMn)=>{"use strict";p();var{kConnected:CMn,kSize:vMn}=Od(),_Xt=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[CMn]===0&&this.value[vMn]===0?void 0:this.value}},CXt=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[CMn]===0&&e[vMn]===0&&this.finalizer(r)})}unregister(e){}};bMn.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:_Xt,FinalizationRegistry:CXt}):{WeakRef,FinalizationRegistry}}});var bde=I((_Yd,UMn)=>{"use strict";p();var{extractBody:T0s,mixinBody:I0s,cloneBody:x0s,bodyUnusable:TMn}=tde(),{Headers:MMn,fill:w0s,HeadersList:Lrt,setHeadersGuard:bXt,getHeadersGuard:R0s,setHeadersList:OMn,getHeadersList:IMn}=yJ(),{FinalizationRegistry:k0s}=SMn()(),Ort=Ls(),xMn=require("node:util"),{isValidHTTPToken:P0s,sameOrigin:wMn,environmentSettingsObject:Mrt}=$S(),{forbiddenMethodsSet:D0s,corsSafeListedMethodsSet:N0s,referrerPolicy:M0s,requestRedirect:O0s,requestMode:B0s,requestCredentials:L0s,requestCache:F0s,requestDuplex:U0s}=Owe(),{kEnumerableProperty:Jh,normalizedMethodRecordsBase:Q0s,normalizedMethodRecords:q0s}=Ort,{kHeaders:KS,kSignal:Brt,kState:Xu,kDispatcher:vXt}=kq(),{webidl:$i}=bA(),{URLSerializer:j0s}=Gv(),{kConstruct:Frt}=Od(),H0s=require("node:assert"),{getMaxListeners:RMn,setMaxListeners:kMn,getEventListeners:G0s,defaultMaxListeners:PMn}=require("node:events"),$0s=Symbol("abortController"),BMn=new k0s(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Urt=new WeakMap;function DMn(t){return e;function e(){let r=t.deref();if(r!==void 0){BMn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Urt.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Urt.delete(r.signal)}}}}a(DMn,"buildAbort");var NMn=!1,jq=class t{static{a(this,"Request")}constructor(e,r={}){if($i.util.markAsUncloneable(this),e===Frt)return;let n="Request constructor";$i.argumentLengthCheck(arguments,1,n),e=$i.converters.RequestInfo(e,n,"input"),r=$i.converters.RequestInit(r,n,"init");let o=null,s=null,c=Mrt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[vXt]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=Qrt({urlList:[_]}),s="cors"}else this[vXt]=r.dispatcher||e[vXt],H0s(e instanceof t),o=e[Xu],l=e[Brt];let u=Mrt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&wMn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=Qrt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:Mrt.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!wMn(v,Mrt.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw $i.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=q0s[_];if(v!==void 0)o.method=v;else{if(!P0s(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(D0s.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=Q0s[b]??_,o.method=_}!NMn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),NMn=!0)}r.signal!==void 0&&(l=r.signal),this[Xu]=o;let m=new AbortController;if(this[Brt]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[$0s]=m;let _=new WeakRef(m),v=DMn(_);try{(typeof RMn=="function"&&RMn(l)===PMn||G0s(l,"abort").length>=PMn)&&kMn(1500,l)}catch{}Ort.addAbortListener(l,v),BMn.register(m,{signal:l,abort:v},v)}}if(this[KS]=new MMn(Frt),OMn(this[KS],o.headersList),bXt(this[KS],"request"),h==="no-cors"){if(!N0s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);bXt(this[KS],"request-no-cors")}if(f){let _=IMn(this[KS]),v=r.headers!==void 0?r.headers:new Lrt(_);if(_.clear(),v instanceof Lrt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else w0s(this[KS],v)}let g=e instanceof t?e[Xu].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=T0s(r.body,o.keepalive);A=_,v&&!IMn(this[KS]).contains("content-type",!0)&&this[KS].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(TMn(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[Xu].body=E}get method(){return $i.brandCheck(this,t),this[Xu].method}get url(){return $i.brandCheck(this,t),j0s(this[Xu].url)}get headers(){return $i.brandCheck(this,t),this[KS]}get destination(){return $i.brandCheck(this,t),this[Xu].destination}get referrer(){return $i.brandCheck(this,t),this[Xu].referrer==="no-referrer"?"":this[Xu].referrer==="client"?"about:client":this[Xu].referrer.toString()}get referrerPolicy(){return $i.brandCheck(this,t),this[Xu].referrerPolicy}get mode(){return $i.brandCheck(this,t),this[Xu].mode}get credentials(){return this[Xu].credentials}get cache(){return $i.brandCheck(this,t),this[Xu].cache}get redirect(){return $i.brandCheck(this,t),this[Xu].redirect}get integrity(){return $i.brandCheck(this,t),this[Xu].integrity}get keepalive(){return $i.brandCheck(this,t),this[Xu].keepalive}get isReloadNavigation(){return $i.brandCheck(this,t),this[Xu].reloadNavigation}get isHistoryNavigation(){return $i.brandCheck(this,t),this[Xu].historyNavigation}get signal(){return $i.brandCheck(this,t),this[Brt]}get body(){return $i.brandCheck(this,t),this[Xu].body?this[Xu].body.stream:null}get bodyUsed(){return $i.brandCheck(this,t),!!this[Xu].body&&Ort.isDisturbed(this[Xu].body.stream)}get duplex(){return $i.brandCheck(this,t),"half"}clone(){if($i.brandCheck(this,t),TMn(this))throw new TypeError("unusable");let e=LMn(this[Xu]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Urt.get(this.signal);n===void 0&&(n=new Set,Urt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Ort.addAbortListener(r.signal,DMn(o))}return FMn(e,r.signal,R0s(this[KS]))}[xMn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${xMn.formatWithOptions(r,n)}`}};I0s(jq);function Qrt(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Lrt(t.headersList):new Lrt}}a(Qrt,"makeRequest");function LMn(t){let e=Qrt({...t,body:null});return t.body!=null&&(e.body=x0s(e,t.body)),e}a(LMn,"cloneRequest");function FMn(t,e,r){let n=new jq(Frt);return n[Xu]=t,n[Brt]=e,n[KS]=new MMn(Frt),OMn(n[KS],t.headersList),bXt(n[KS],r),n}a(FMn,"fromInnerRequest");Object.defineProperties(jq.prototype,{method:Jh,url:Jh,headers:Jh,redirect:Jh,clone:Jh,signal:Jh,duplex:Jh,destination:Jh,body:Jh,bodyUsed:Jh,isHistoryNavigation:Jh,isReloadNavigation:Jh,keepalive:Jh,integrity:Jh,cache:Jh,credentials:Jh,attribute:Jh,referrerPolicy:Jh,referrer:Jh,mode:Jh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});$i.converters.Request=$i.interfaceConverter(jq);$i.converters.RequestInfo=function(t,e,r){return typeof t=="string"?$i.converters.USVString(t,e,r):t instanceof jq?$i.converters.Request(t,e,r):$i.converters.USVString(t,e,r)};$i.converters.AbortSignal=$i.interfaceConverter(AbortSignal);$i.converters.RequestInit=$i.dictionaryConverter([{key:"method",converter:$i.converters.ByteString},{key:"headers",converter:$i.converters.HeadersInit},{key:"body",converter:$i.nullableConverter($i.converters.BodyInit)},{key:"referrer",converter:$i.converters.USVString},{key:"referrerPolicy",converter:$i.converters.DOMString,allowedValues:M0s},{key:"mode",converter:$i.converters.DOMString,allowedValues:B0s},{key:"credentials",converter:$i.converters.DOMString,allowedValues:L0s},{key:"cache",converter:$i.converters.DOMString,allowedValues:F0s},{key:"redirect",converter:$i.converters.DOMString,allowedValues:O0s},{key:"integrity",converter:$i.converters.DOMString},{key:"keepalive",converter:$i.converters.boolean},{key:"signal",converter:$i.nullableConverter(t=>$i.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:$i.converters.any},{key:"duplex",converter:$i.converters.DOMString,allowedValues:U0s},{key:"dispatcher",converter:$i.converters.any}]);UMn.exports={Request:jq,makeRequest:Qrt,fromInnerRequest:FMn,cloneRequest:LMn}});var hRe=I((bYd,eOn)=>{"use strict";p();var{makeNetworkError:rl,makeAppropriateNetworkError:qrt,filterResponse:SXt,makeResponse:jrt,fromInnerResponse:V0s}=fRe(),{HeadersList:QMn}=yJ(),{Request:W0s,cloneRequest:z0s}=bde(),Hq=require("node:zlib"),{bytesMatch:Y0s,makePolicyContainer:K0s,clonePolicyContainer:J0s,requestBadPort:Z0s,TAOCheck:X0s,appendRequestOriginHeader:ems,responseLocationURL:tms,requestCurrentURL:QO,setRequestReferrerPolicyOnRedirect:rms,tryUpgradeRequestToAPotentiallyTrustworthyURL:nms,createOpaqueTimingInfo:RXt,appendFetchMetadata:ims,corsCheck:oms,crossOriginResourcePolicyCheck:sms,determineRequestsReferrer:ams,coarsenedSharedCurrentTime:pRe,createDeferredPromise:cms,isBlobLike:lms,sameOrigin:wXt,isCancelled:_J,isAborted:qMn,isErrorLike:ums,fullyReadBody:dms,readableStreamClose:fms,isomorphicEncode:Hrt,urlIsLocal:pms,urlIsHttpHttpsScheme:kXt,urlHasHttpsScheme:hms,clampAndCoarsenConnectionTimingInfo:mms,simpleRangeHeaderValue:gms,buildContentRange:Ams,createInflate:yms,extractMimeType:Ems}=$S(),{kState:$Mn,kDispatcher:_ms}=kq(),CJ=require("node:assert"),{safelyExtractBody:PXt,extractBody:jMn}=tde(),{redirectStatusSet:VMn,nullBodyStatus:WMn,safeMethodsSet:Cms,requestBodyHeader:vms,subresourceSet:bms}=Owe(),Sms=require("node:events"),{Readable:Tms,pipeline:Ims,finished:xms}=require("node:stream"),{addAbortListener:wms,isErrored:Rms,isReadable:Grt,bufferToLowerCasedHeaderName:HMn}=Ls(),{dataURLProcessor:kms,serializeAMimeType:Pms,minimizeSupportedMimeType:Dms}=Gv(),{getGlobalDispatcher:Nms}=xrt(),{webidl:Mms}=bA(),{STATUS_CODES:Oms}=require("node:http"),Bms=["GET","HEAD"],Lms=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",TXt,$rt=class extends Sms{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function Fms(t){zMn(t,"fetch")}a(Fms,"handleFetchDone");function Ums(t,e=void 0){Mms.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=cms(),n;try{n=new W0s(t,e)}catch(f){return r.reject(f),r.promise}let o=n[$Mn];if(n.signal.aborted)return IXt(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return wms(n.signal,()=>{l=!0,CJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();IXt(r,o,f,n.signal.reason)}),u=KMn({request:o,processResponseEndOfBody:Fms,processResponse:a(f=>{if(!l){if(f.aborted){IXt(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(V0s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[_ms]}),r.promise}a(Ums,"fetch");function zMn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;kXt(r)&&n!==null&&(t.timingAllowPassed||(n=RXt({startTime:n.startTime}),o=""),n.endTime=pRe(),t.timingInfo=n,YMn(n,r.href,e,globalThis,o))}a(zMn,"finalizeAndReportTiming");var YMn=performance.markResourceTiming;function IXt(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Grt(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[$Mn];o.body!=null&&Grt(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(IXt,"abortFetch");function KMn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=Nms()}){CJ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=pRe(d),h=RXt({startTime:f}),m={controller:new $rt(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return CJ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=J0s(t.client.policyContainer):t.policyContainer=K0s()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,bms.has(t.destination),JMn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(KMn,"fetching");async function JMn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!pms(QO(r))&&(n=rl("local URLs only")),nms(r),Z0s(r)==="blocked"&&(n=rl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=ams(r)),n===null&&(n=await(async()=>{let s=QO(r);return wXt(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await GMn(t)):r.mode==="same-origin"?rl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?rl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await GMn(t)):kXt(QO(r))?(r.responseTainting="cors",await ZMn(t)):rl("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=SXt(n,"basic"):r.responseTainting==="cors"?n=SXt(n,"cors"):r.responseTainting==="opaque"?n=SXt(n,"opaque"):CJ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=rl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||WMn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>xXt(t,rl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!Y0s(l,r.integrity)){s("integrity mismatch");return}n.body=PXt(l)[0],xXt(t,n)},"processBody");await dms(n.body,c,s)}else xXt(t,n)}a(JMn,"mainFetch");function GMn(t){if(_J(t)&&t.request.redirectCount===0)return Promise.resolve(qrt(t));let{request:e}=t,{protocol:r}=QO(e);switch(r){case"about:":return Promise.resolve(rl("about scheme is not supported"));case"blob:":{TXt||(TXt=require("node:buffer").resolveObjectURL);let n=QO(e);if(n.search.length!==0)return Promise.resolve(rl("NetworkError when attempting to fetch resource."));let o=TXt(n.toString());if(e.method!=="GET"||!lms(o))return Promise.resolve(rl("invalid method"));let s=jrt(),c=o.size,l=Hrt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=gms(d,!0);if(f==="failure")return Promise.resolve(rl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(rl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=jMn(g);s.body=A[0];let y=Hrt(`${g.size}`),E=Ams(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=jMn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=QO(e),o=kms(n);if(o==="failure")return Promise.resolve(rl("failed to fetch the data URL"));let s=Pms(o.mimeType);return Promise.resolve(jrt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:PXt(o.body)[0]}))}case"file:":return Promise.resolve(rl("not implemented... yet..."));case"http:":case"https:":return ZMn(t).catch(n=>rl(n));default:return Promise.resolve(rl("unknown scheme"))}}a(GMn,"schemeFetch");function Qms(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(Qms,"finalizeResponse");function xXt(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=RXt(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=Ems(e.headersList);f!=="failure"&&(u.contentType=Dms(f))}t.request.initiatorType!=null&&YMn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():xms(o.body.stream,()=>{n()})}a(xXt,"fetchFinale");async function ZMn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await XMn(t),e.responseTainting==="cors"&&oms(e,r)==="failure")return rl("cors failure");X0s(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&sms(e.origin,e.client,e.destination,n)==="blocked"?rl("blocked"):(VMn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=rl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await qms(t,r):CJ(!1)),r.timingInfo=o,r)}a(ZMn,"httpFetch");function qms(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=tms(n,QO(r).hash),o==null)return e}catch(c){return Promise.resolve(rl(c))}if(!kXt(o))return Promise.resolve(rl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(rl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!wXt(r,o))return Promise.resolve(rl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(rl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(rl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!Bms.includes(r.method)){r.method="GET",r.body=null;for(let c of vms)r.headersList.delete(c)}wXt(QO(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(CJ(r.body.source!=null),r.body=PXt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=pRe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),rms(r,n),JMn(t,!0)}a(qms,"httpRedirectFetch");async function XMn(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=z0s(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Hrt(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Hrt(s.referrer.href),!0),ems(s),ims(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",Lms),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(hms(QO(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return rl("only if cached");let m=await jms(o,d,r);!Cms.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?rl():_J(t)?qrt(t):rl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(_J(t))return qrt(t);t.controller.connection.destroy(),c=await XMn(t,e,!0)}return c}a(XMn,"httpNetworkOrCacheFetch");async function jms(t,e=!1,r=!1){CJ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){_J(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{_J(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{_J(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=jrt({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=jrt({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),qrt(t,A)):rl(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{_J(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(qMn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){fms(t.controller.controller),Qms(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),Rms(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){qMn(t)?(o.aborted=!0,Grt(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Grt(h)&&t.controller.controller.error(new TypeError("terminated",{cause:ums(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=QO(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=mms(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=pRe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=pRe(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",k=new QMn;for(let B=0;BM)return v(new Error(`too many content-encodings in response: ${Q.length}, maximum allowed is ${M}`)),!0;for(let O=Q.length-1;O>=0;--O){let q=Q[O].trim();if(q==="x-gzip"||q==="gzip")D.push(Hq.createGunzip({flush:Hq.constants.Z_SYNC_FLUSH,finishFlush:Hq.constants.Z_SYNC_FLUSH}));else if(q==="deflate")D.push(yms({flush:Hq.constants.Z_SYNC_FLUSH,finishFlush:Hq.constants.Z_SYNC_FLUSH}));else if(q==="br")D.push(Hq.createBrotliDecompress({flush:Hq.constants.BROTLI_OPERATION_FLUSH,finishFlush:Hq.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let L=this.onError.bind(this);return _({status:b,statusText:R,headersList:k,body:D.length?Ims(this.body,...D,B=>{B&&this.onError(B)}).on("error",L):this.body.on("error",L)}),!0},onData(b){if(t.controller.dump)return;let T=b;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new QMn;for(let x=0;x{"use strict";p();tOn.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var nOn=I((wYd,rOn)=>{"use strict";p();var{webidl:JS}=bA(),Vrt=Symbol("ProgressEvent state"),NXt=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=JS.converters.DOMString(e,"ProgressEvent constructor","type"),r=JS.converters.ProgressEventInit(r??{}),super(e,r),this[Vrt]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return JS.brandCheck(this,t),this[Vrt].lengthComputable}get loaded(){return JS.brandCheck(this,t),this[Vrt].loaded}get total(){return JS.brandCheck(this,t),this[Vrt].total}};JS.converters.ProgressEventInit=JS.dictionaryConverter([{key:"lengthComputable",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:JS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:JS.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:JS.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);rOn.exports={ProgressEvent:NXt}});var oOn=I((PYd,iOn)=>{"use strict";p();function Hms(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(Hms,"getEncoding");iOn.exports={getEncoding:Hms}});var pOn=I((MYd,fOn)=>{"use strict";p();var{kState:Sde,kError:MXt,kResult:sOn,kAborted:mRe,kLastProgressEventFired:OXt}=DXt(),{ProgressEvent:Gms}=nOn(),{getEncoding:aOn}=oOn(),{serializeAMimeType:$ms,parseMIMEType:cOn}=Gv(),{types:Vms}=require("node:util"),{StringDecoder:lOn}=require("string_decoder"),{btoa:uOn}=require("node:buffer"),Wms={enumerable:!0,writable:!1,configurable:!1};function zms(t,e,r,n){if(t[Sde]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[Sde]="loading",t[sOn]=null,t[MXt]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[mRe];)try{let{done:d,value:f}=await l;if(u&&!t[mRe]&&queueMicrotask(()=>{Gq("loadstart",t)}),u=!1,!d&&Vms.isUint8Array(f))c.push(f),(t[OXt]===void 0||Date.now()-t[OXt]>=50)&&!t[mRe]&&(t[OXt]=Date.now(),queueMicrotask(()=>{Gq("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[Sde]="done";try{let h=Yms(c,r,e.type,n);if(t[mRe])return;t[sOn]=h,Gq("load",t)}catch(h){t[MXt]=h,Gq("error",t)}t[Sde]!=="loading"&&Gq("loadend",t)});break}}catch(d){if(t[mRe])return;queueMicrotask(()=>{t[Sde]="done",t[MXt]=d,Gq("error",t),t[Sde]!=="loading"&&Gq("loadend",t)});break}})()}a(zms,"readOperation");function Gq(t,e){let r=new Gms(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Gq,"fireAProgressEvent");function Yms(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=cOn(r||"application/octet-stream");s!=="failure"&&(o+=$ms(s)),o+=";base64,";let c=new lOn("latin1");for(let l of t)o+=uOn(c.write(l));return o+=uOn(c.end()),o}case"Text":{let o="failure";if(n&&(o=aOn(n)),o==="failure"&&r){let s=cOn(r);s!=="failure"&&(o=aOn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),Kms(t,o)}case"ArrayBuffer":return dOn(t).buffer;case"BinaryString":{let o="",s=new lOn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(Yms,"packageData");function Kms(t,e){let r=dOn(t),n=Jms(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(Kms,"decode");function Jms(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(Jms,"BOMSniffing");function dOn(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(dOn,"combineByteSequences");fOn.exports={staticPropertyDescriptors:Wms,readOperation:zms,fireAProgressEvent:Gq}});var AOn=I((LYd,gOn)=>{"use strict";p();var{staticPropertyDescriptors:Tde,readOperation:Wrt,fireAProgressEvent:hOn}=pOn(),{kState:vJ,kError:mOn,kResult:zrt,kEvents:Ic,kAborted:Zms}=DXt(),{webidl:bl}=bA(),{kEnumerableProperty:Wv}=Ls(),GP=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[vJ]="empty",this[zrt]=null,this[mOn]=null,this[Ic]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"ArrayBuffer")}readAsBinaryString(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"BinaryString")}readAsText(e,r=void 0){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=bl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=bl.converters.DOMString(r,"FileReader.readAsText","encoding")),Wrt(this,e,"Text",r)}readAsDataURL(e){bl.brandCheck(this,t),bl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=bl.converters.Blob(e,{strict:!1}),Wrt(this,e,"DataURL")}abort(){if(this[vJ]==="empty"||this[vJ]==="done"){this[zrt]=null;return}this[vJ]==="loading"&&(this[vJ]="done",this[zrt]=null),this[Zms]=!0,hOn("abort",this),this[vJ]!=="loading"&&hOn("loadend",this)}get readyState(){switch(bl.brandCheck(this,t),this[vJ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return bl.brandCheck(this,t),this[zrt]}get error(){return bl.brandCheck(this,t),this[mOn]}get onloadend(){return bl.brandCheck(this,t),this[Ic].loadend}set onloadend(e){bl.brandCheck(this,t),this[Ic].loadend&&this.removeEventListener("loadend",this[Ic].loadend),typeof e=="function"?(this[Ic].loadend=e,this.addEventListener("loadend",e)):this[Ic].loadend=null}get onerror(){return bl.brandCheck(this,t),this[Ic].error}set onerror(e){bl.brandCheck(this,t),this[Ic].error&&this.removeEventListener("error",this[Ic].error),typeof e=="function"?(this[Ic].error=e,this.addEventListener("error",e)):this[Ic].error=null}get onloadstart(){return bl.brandCheck(this,t),this[Ic].loadstart}set onloadstart(e){bl.brandCheck(this,t),this[Ic].loadstart&&this.removeEventListener("loadstart",this[Ic].loadstart),typeof e=="function"?(this[Ic].loadstart=e,this.addEventListener("loadstart",e)):this[Ic].loadstart=null}get onprogress(){return bl.brandCheck(this,t),this[Ic].progress}set onprogress(e){bl.brandCheck(this,t),this[Ic].progress&&this.removeEventListener("progress",this[Ic].progress),typeof e=="function"?(this[Ic].progress=e,this.addEventListener("progress",e)):this[Ic].progress=null}get onload(){return bl.brandCheck(this,t),this[Ic].load}set onload(e){bl.brandCheck(this,t),this[Ic].load&&this.removeEventListener("load",this[Ic].load),typeof e=="function"?(this[Ic].load=e,this.addEventListener("load",e)):this[Ic].load=null}get onabort(){return bl.brandCheck(this,t),this[Ic].abort}set onabort(e){bl.brandCheck(this,t),this[Ic].abort&&this.removeEventListener("abort",this[Ic].abort),typeof e=="function"?(this[Ic].abort=e,this.addEventListener("abort",e)):this[Ic].abort=null}};GP.EMPTY=GP.prototype.EMPTY=0;GP.LOADING=GP.prototype.LOADING=1;GP.DONE=GP.prototype.DONE=2;Object.defineProperties(GP.prototype,{EMPTY:Tde,LOADING:Tde,DONE:Tde,readAsArrayBuffer:Wv,readAsBinaryString:Wv,readAsText:Wv,readAsDataURL:Wv,abort:Wv,readyState:Wv,result:Wv,error:Wv,onloadstart:Wv,onprogress:Wv,onload:Wv,onabort:Wv,onerror:Wv,onloadend:Wv,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(GP,{EMPTY:Tde,LOADING:Tde,DONE:Tde});gOn.exports={FileReader:GP}});var Yrt=I((QYd,yOn)=>{"use strict";p();yOn.exports={kConstruct:Od().kConstruct}});var COn=I((jYd,_On)=>{"use strict";p();var Xms=require("node:assert"),{URLSerializer:EOn}=Gv(),{isValidHeaderName:egs}=$S();function tgs(t,e,r=!1){let n=EOn(t,r),o=EOn(e,r);return n===o}a(tgs,"urlEquals");function rgs(t){Xms(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),egs(r)&&e.push(r);return e}a(rgs,"getFieldValues");_On.exports={urlEquals:tgs,getFieldValues:rgs}});var SOn=I(($Yd,bOn)=>{"use strict";p();var{kConstruct:ngs}=Yrt(),{urlEquals:igs,getFieldValues:BXt}=COn(),{kEnumerableProperty:bJ,isDisturbed:ogs}=Ls(),{webidl:Ei}=bA(),{Response:sgs,cloneResponse:ags,fromInnerResponse:cgs}=fRe(),{Request:nF,fromInnerRequest:lgs}=bde(),{kState:$P}=kq(),{fetching:ugs}=hRe(),{urlIsHttpHttpsScheme:Krt,createDeferredPromise:Ide,readAllBytes:dgs}=$S(),LXt=require("node:assert"),Jrt=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==ngs&&Ei.illegalConstructor(),Ei.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Ei.brandCheck(this,t);let n="Cache.match";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Ei.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Ei.brandCheck(this,t);let r="Cache.add";Ei.argumentLengthCheck(arguments,1,r),e=Ei.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){Ei.brandCheck(this,t);let r="Cache.addAll";Ei.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Ei.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Ei.converters.RequestInfo(m),typeof m=="string")continue;let g=m[$P];if(!Krt(g.url)||g.method!=="GET")throw Ei.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new nF(m)[$P];if(!Krt(g.url))throw Ei.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Ide();s.push(ugs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Ei.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=BXt(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Ei.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Ide(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Ei.brandCheck(this,t);let n="Cache.put";Ei.argumentLengthCheck(arguments,2,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.Response(r,n,"response");let o=null;if(e instanceof nF?o=e[$P]:o=new nF(e)[$P],!Krt(o.url)||o.method!=="GET")throw Ei.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[$P];if(s.status===206)throw Ei.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=BXt(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Ei.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(ogs(s.body.stream)||s.body.stream.locked))throw Ei.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=ags(s),l=Ide();if(s.body!=null){let A=s.body.stream.getReader();dgs(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Ide(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Ei.brandCheck(this,t);let n="Cache.delete";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return!1}else LXt(typeof e=="string"),o=new nF(e)[$P];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Ide(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Ei.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new nF(e)[$P]);let s=Ide(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=lgs(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);LXt(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Krt(u.url))throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);LXt(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!igs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=BXt(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof nF){if(o=e[$P],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new nF(e)[$P]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=cgs(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Jrt.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:bJ,matchAll:bJ,add:bJ,addAll:bJ,put:bJ,delete:bJ,keys:bJ});var vOn=[{key:"ignoreSearch",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Ei.converters.CacheQueryOptions=Ei.dictionaryConverter(vOn);Ei.converters.MultiCacheQueryOptions=Ei.dictionaryConverter([...vOn,{key:"cacheName",converter:Ei.converters.DOMString}]);Ei.converters.Response=Ei.interfaceConverter(sgs);Ei.converters["sequence"]=Ei.sequenceConverter(Ei.converters.RequestInfo);bOn.exports={Cache:Jrt}});var IOn=I((zYd,TOn)=>{"use strict";p();var{kConstruct:gRe}=Yrt(),{Cache:Zrt}=SOn(),{webidl:iE}=bA(),{kEnumerableProperty:ARe}=Ls(),Xrt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==gRe&&iE.illegalConstructor(),iE.util.markAsUncloneable(this)}async match(e,r={}){if(iE.brandCheck(this,t),iE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=iE.converters.RequestInfo(e),r=iE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Zrt(gRe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Zrt(gRe,n).match(e,r);if(s!==void 0)return s}}async has(e){iE.brandCheck(this,t);let r="CacheStorage.has";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){iE.brandCheck(this,t);let r="CacheStorage.open";if(iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Zrt(gRe,o)}let n=[];return this.#e.set(e,n),new Zrt(gRe,n)}async delete(e){iE.brandCheck(this,t);let r="CacheStorage.delete";return iE.argumentLengthCheck(arguments,1,r),e=iE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return iE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Xrt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:ARe,has:ARe,open:ARe,delete:ARe,keys:ARe});TOn.exports={CacheStorage:Xrt}});var wOn=I((JYd,xOn)=>{"use strict";p();xOn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var FXt=I((XYd,NOn)=>{"use strict";p();function fgs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(fgs,"isCTLExcludingHtab");function ROn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(ROn,"validateCookieName");function kOn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(kOn,"validateCookieValue");function POn(t){for(let e=0;ee.toString().padStart(2,"0"));function DOn(t){return typeof t=="number"&&(t=new Date(t)),`${hgs[t.getUTCDay()]}, ${ent[t.getUTCDate()]} ${mgs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${ent[t.getUTCHours()]}:${ent[t.getUTCMinutes()]}:${ent[t.getUTCSeconds()]} GMT`}a(DOn,"toIMFDate");function ggs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(ggs,"validateCookieMaxAge");function Ags(t){if(t.name.length===0)return null;ROn(t.name),kOn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(ggs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(pgs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(POn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${DOn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(Ags,"stringify");NOn.exports={isCTLExcludingHtab:fgs,validateCookieName:ROn,validateCookiePath:POn,validateCookieValue:kOn,toIMFDate:DOn,stringify:Ags}});var OOn=I((rKd,MOn)=>{"use strict";p();var{maxNameValuePairSize:ygs,maxAttributeValueSize:Egs}=wOn(),{isCTLExcludingHtab:_gs}=FXt(),{collectASequenceOfCodePointsFast:tnt}=Gv(),Cgs=require("node:assert");function vgs(t){if(_gs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=tnt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=tnt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>ygs?null:{name:n,value:o,...xde(r)}}a(vgs,"parseSetCookie");function xde(t,e={}){if(t.length===0)return e;Cgs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=tnt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=tnt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>Egs)return xde(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return xde(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return xde(t,e)}a(xde,"parseUnparsedAttributes");MOn.exports={parseSetCookie:vgs,parseUnparsedAttributes:xde}});var FOn=I((oKd,LOn)=>{"use strict";p();var{parseSetCookie:bgs}=OOn(),{stringify:Sgs}=FXt(),{webidl:da}=bA(),{Headers:rnt}=yJ();function Tgs(t){da.argumentLengthCheck(arguments,1,"getCookies"),da.brandCheck(t,rnt,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(Tgs,"getCookies");function Igs(t,e,r){da.brandCheck(t,rnt,{strict:!1});let n="deleteCookie";da.argumentLengthCheck(arguments,2,n),e=da.converters.DOMString(e,n,"name"),r=da.converters.DeleteCookieAttributes(r),BOn(t,{name:e,value:"",expires:new Date(0),...r})}a(Igs,"deleteCookie");function xgs(t){da.argumentLengthCheck(arguments,1,"getSetCookies"),da.brandCheck(t,rnt,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>bgs(r)):[]}a(xgs,"getSetCookies");function BOn(t,e){da.argumentLengthCheck(arguments,2,"setCookie"),da.brandCheck(t,rnt,{strict:!1}),e=da.converters.Cookie(e);let r=Sgs(e);r&&t.append("Set-Cookie",r)}a(BOn,"setCookie");da.converters.DeleteCookieAttributes=da.dictionaryConverter([{converter:da.nullableConverter(da.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);da.converters.Cookie=da.dictionaryConverter([{converter:da.converters.DOMString,key:"name"},{converter:da.converters.DOMString,key:"value"},{converter:da.nullableConverter(t=>typeof t=="number"?da.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:da.nullableConverter(da.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:da.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:da.sequenceConverter(da.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);LOn.exports={getCookies:Tgs,deleteCookie:Igs,getSetCookies:xgs,setCookie:BOn}});var Rde=I((cKd,QOn)=>{"use strict";p();var{webidl:fi}=bA(),{kEnumerableProperty:zv}=Ls(),{kConstruct:UOn}=Od(),{MessagePort:wgs}=require("node:worker_threads"),wde=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===UOn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return fi.brandCheck(this,t),fi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(UOn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:Rgs}=wde;delete wde.createFastMessageEvent;var nnt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},int=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(wde.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:zv,origin:zv,lastEventId:zv,source:zv,ports:zv,initMessageEvent:zv});Object.defineProperties(nnt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:zv,code:zv,wasClean:zv});Object.defineProperties(int.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:zv,filename:zv,lineno:zv,colno:zv,error:zv});fi.converters.MessagePort=fi.interfaceConverter(wgs);fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var UXt=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...UXt,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...UXt,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...UXt,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);QOn.exports={MessageEvent:wde,CloseEvent:nnt,ErrorEvent:int,createFastMessageEvent:Rgs}});var SJ=I((dKd,qOn)=>{"use strict";p();var kgs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",Pgs={enumerable:!0,writable:!1,configurable:!1},Dgs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Ngs={NOT_SENT:0,PROCESSING:1,SENT:2},Mgs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},Ogs=2**16-1,Bgs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Lgs=Buffer.allocUnsafe(0),Fgs={string:1,typedArray:2,arrayBuffer:3,blob:4};qOn.exports={uid:kgs,sentCloseFrameState:Ngs,staticPropertyDescriptors:Pgs,states:Dgs,opcodes:Mgs,maxUnsigned16Bit:Ogs,parserStates:Bgs,emptyBuffer:Lgs,sendHints:Fgs}});var yRe=I((pKd,jOn)=>{"use strict";p();jOn.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var CRe=I((mKd,JOn)=>{"use strict";p();var{kReadyState:ERe,kController:Ugs,kResponse:Qgs,kBinaryType:qgs,kWebSocketURL:jgs}=yRe(),{states:_Re,opcodes:$q}=SJ(),{ErrorEvent:Hgs,createFastMessageEvent:Ggs}=Rde(),{isUtf8:$gs}=require("node:buffer"),{collectASequenceOfCodePointsFast:Vgs,removeHTTPWhitespace:HOn}=Gv();function Wgs(t){return t[ERe]===_Re.CONNECTING}a(Wgs,"isConnecting");function zgs(t){return t[ERe]===_Re.OPEN}a(zgs,"isEstablished");function Ygs(t){return t[ERe]===_Re.CLOSING}a(Ygs,"isClosing");function Kgs(t){return t[ERe]===_Re.CLOSED}a(Kgs,"isClosed");function QXt(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(QXt,"fireEvent");function Jgs(t,e,r){if(t[ERe]!==_Re.OPEN)return;let n;if(e===$q.TEXT)try{n=KOn(r)}catch{$On(t,"Received invalid UTF-8 in text frame.");return}else e===$q.BINARY&&(t[qgs]==="blob"?n=new Blob([r]):n=Zgs(r));QXt("message",t,Ggs,{origin:t[jgs].origin,data:n})}a(Jgs,"websocketMessageReceived");function Zgs(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(Zgs,"toArrayBuffer");function Xgs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(Xgs,"isValidSubprotocol");function eAs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(eAs,"isValidStatusCode");function $On(t,e){let{[Ugs]:r,[Qgs]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&QXt("error",t,(o,s)=>new Hgs(o,s),{error:new Error(e),message:e})}a($On,"failWebsocketConnection");function VOn(t){return t===$q.CLOSE||t===$q.PING||t===$q.PONG}a(VOn,"isControlFrame");function WOn(t){return t===$q.CONTINUATION}a(WOn,"isContinuationFrame");function zOn(t){return t===$q.TEXT||t===$q.BINARY}a(zOn,"isTextBinaryFrame");function tAs(t){return zOn(t)||WOn(t)||VOn(t)}a(tAs,"isValidOpcode");function rAs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(nAs,"isValidClientWindowBits");var YOn=typeof process.versions.icu=="string",GOn=YOn?new TextDecoder("utf-8",{fatal:!0}):void 0,KOn=YOn?GOn.decode.bind(GOn):function(t){if($gs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};JOn.exports={isConnecting:Wgs,isEstablished:zgs,isClosing:Ygs,isClosed:Kgs,fireEvent:QXt,isValidSubprotocol:Xgs,isValidStatusCode:eAs,failWebsocketConnection:$On,websocketMessageReceived:Jgs,utf8Decode:KOn,isControlFrame:VOn,isContinuationFrame:WOn,isTextBinaryFrame:zOn,isValidOpcode:tAs,parseExtensions:rAs,isValidClientWindowBits:nAs}});var snt=I((yKd,ZOn)=>{"use strict";p();var{maxUnsigned16Bit:iAs}=SJ(),ont=16386,qXt,vRe=null,kde=ont;try{qXt=require("node:crypto")}catch{qXt={randomFillSync:a(function(e,r,n){for(let o=0;oiAs?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:sAs,states:bRe,sentCloseFrameState:ant,emptyBuffer:aAs,opcodes:cAs}=SJ(),{kReadyState:SRe,kSentClose:cnt,kByteParser:e5n,kReceivedClose:XOn,kResponse:t5n}=yRe(),{fireEvent:lAs,failWebsocketConnection:Vq,isClosing:uAs,isClosed:dAs,isEstablished:fAs,parseExtensions:pAs}=CRe(),{channels:Pde}=jue(),{CloseEvent:hAs}=Rde(),{makeRequest:mAs}=bde(),{fetching:gAs}=hRe(),{Headers:AAs,getHeadersList:yAs}=yJ(),{getDecodeSplit:EAs}=$S(),{WebsocketFrameSend:_As}=snt(),HXt;try{HXt=require("node:crypto")}catch{}function CAs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=mAs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=yAs(new AAs(s.headers));l.headersList=h}let u=HXt.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),gAs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Vq(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Vq(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Vq(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Vq(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=HXt.createHash("sha1").update(u+sAs).digest("base64");if(m!==g){Vq(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=pAs(A),!y.has("permessage-deflate"))){Vq(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!EAs("sec-websocket-protocol",l.headersList).includes(E)){Vq(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",r5n),h.socket.on("close",n5n),h.socket.on("error",i5n),Pde.open.hasSubscribers&&Pde.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(CAs,"establishWebSocketConnection");function vAs(t,e,r,n){if(!(uAs(t)||dAs(t)))if(!fAs(t))Vq(t,"Connection was closed before it was established."),t[SRe]=bRe.CLOSING;else if(t[cnt]===ant.NOT_SENT){t[cnt]=ant.PROCESSING;let o=new _As;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=aAs,t[t5n].socket.write(o.createFrame(cAs.CLOSE)),t[cnt]=ant.SENT,t[SRe]=bRe.CLOSING}else t[SRe]=bRe.CLOSING}a(vAs,"closeWebSocketConnection");function r5n(t){this.ws[e5n].write(t)||this.pause()}a(r5n,"onSocketData");function n5n(){let{ws:t}=this,{[t5n]:e}=t;e.socket.off("data",r5n),e.socket.off("close",n5n),e.socket.off("error",i5n);let r=t[cnt]===ant.SENT&&t[XOn],n=1005,o="",s=t[e5n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[XOn]||(n=1006),t[SRe]=bRe.CLOSED,lAs("close",t,(c,l)=>new hAs(c,l),{wasClean:r,code:n,reason:o}),Pde.close.hasSubscribers&&Pde.close.publish({websocket:t,code:n,reason:o})}a(n5n,"onSocketClose");function i5n(t){let{ws:e}=this;e[SRe]=bRe.CLOSING,Pde.socketError.hasSubscribers&&Pde.socketError.publish(t),this.destroy()}a(i5n,"onSocketError");o5n.exports={establishWebSocketConnection:CAs,closeWebSocketConnection:vAs}});var c5n=I((SKd,a5n)=>{"use strict";p();var{createInflateRaw:bAs,Z_DEFAULT_WINDOWBITS:SAs}=require("node:zlib"),{isValidClientWindowBits:TAs}=CRe(),{MessageSizeExceededError:s5n}=mc(),IAs=Buffer.from([0,0,255,255]),lnt=Symbol("kBuffer"),TRe=Symbol("kLength"),xAs=4*1024*1024,$Xt=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new s5n);return}if(!this.#e){let o=SAs;if(this.#t.serverMaxWindowBits){if(!TAs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=bAs({windowBits:o})}catch(s){n(s);return}this.#e[lnt]=[],this.#e[TRe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[TRe]+=s.length,this.#e[TRe]>xAs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new s5n)}return}this.#e[lnt].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(IAs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[lnt],this.#e[TRe]);this.#e[lnt].length=0,this.#e[TRe]=0,this.#n=null,n(null,o)})}};a5n.exports={PerMessageDeflate:$Xt}});var y5n=I((xKd,A5n)=>{"use strict";p();var{Writable:wAs}=require("node:stream"),RAs=require("node:assert"),{parserStates:Yv,opcodes:Dde,states:kAs,emptyBuffer:l5n,sentCloseFrameState:u5n}=SJ(),{kReadyState:PAs,kSentClose:d5n,kResponse:f5n,kReceivedClose:p5n}=yRe(),{channels:unt}=jue(),{isValidStatusCode:DAs,isValidOpcode:NAs,failWebsocketConnection:ZS,websocketMessageReceived:h5n,utf8Decode:MAs,isControlFrame:m5n,isTextBinaryFrame:VXt,isContinuationFrame:OAs}=CRe(),{WebsocketFrameSend:g5n}=snt(),{closeWebSocketConnection:BAs}=GXt(),{PerMessageDeflate:LAs}=c5n(),WXt=class extends wAs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=Yv.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new LAs(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===Yv.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Dde.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!NAs(o))return ZS(this.ws,"Invalid opcode received"),e();if(s)return ZS(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){ZS(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){ZS(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!VXt(o)){ZS(this.ws,"Invalid frame type was fragmented.");return}if(VXt(o)&&this.#o.length>0){ZS(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){ZS(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&m5n(o)){ZS(this.ws,"Control frame either too large or fragmented");return}if(OAs(o)&&this.#o.length===0&&!this.#i.compressed){ZS(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=Yv.READ_DATA):l===126?this.#n=Yv.PAYLOADLENGTH_16:l===127&&(this.#n=Yv.PAYLOADLENGTH_64),VXt(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===Yv.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=Yv.READ_DATA}else if(this.#n===Yv.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){ZS(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=Yv.READ_DATA}else if(this.#n===Yv.READ_DATA){if(this.#t{if(n){ZS(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=Yv.INFO,this.#r=!0,this.run(e);return}h5n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=Yv.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);h5n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=Yv.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return l5n;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){RAs(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!DAs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=MAs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===Dde.CLOSE){if(n===1)return ZS(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return BAs(this.ws,o,s,s.length),ZS(this.ws,s),!1}if(this.ws[d5n]!==u5n.SENT){let o=l5n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new g5n(o);this.ws[f5n].socket.write(s.createFrame(Dde.CLOSE),c=>{c||(this.ws[d5n]=u5n.SENT)})}return this.ws[PAs]=kAs.CLOSING,this.ws[p5n]=!0,!1}else if(r===Dde.PING){if(!this.ws[p5n]){let o=new g5n(e);this.ws[f5n].socket.write(o.createFrame(Dde.PONG)),unt.ping.hasSubscribers&&unt.ping.publish({payload:e})}}else r===Dde.PONG&&unt.pong.hasSubscribers&&unt.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};A5n.exports={ByteParser:WXt}});var b5n=I((kKd,v5n)=>{"use strict";p();var{WebsocketFrameSend:FAs}=snt(),{opcodes:E5n,sendHints:Nde}=SJ(),UAs=nZt(),_5n=Buffer[Symbol.species],zXt=class{static{a(this,"SendQueue")}#e=new UAs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Nde.blob){let s=C5n(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=C5n(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function C5n(t,e){return new FAs(QAs(t,e)).createFrame(e===Nde.string?E5n.TEXT:E5n.BINARY)}a(C5n,"createFrame");function QAs(t,e){switch(e){case Nde.string:return Buffer.from(t);case Nde.arrayBuffer:case Nde.blob:return new _5n(t);case Nde.typedArray:return new _5n(t.buffer,t.byteOffset,t.byteLength)}}a(QAs,"toBuffer");v5n.exports={SendQueue:zXt}});var D5n=I((NKd,P5n)=>{"use strict";p();var{webidl:so}=bA(),{URLSerializer:qAs}=Gv(),{environmentSettingsObject:S5n}=$S(),{staticPropertyDescriptors:Wq,states:IRe,sentCloseFrameState:jAs,sendHints:dnt}=SJ(),{kWebSocketURL:T5n,kReadyState:YXt,kController:HAs,kBinaryType:fnt,kResponse:I5n,kSentClose:GAs,kByteParser:$As}=yRe(),{isConnecting:VAs,isEstablished:WAs,isClosing:zAs,isValidSubprotocol:YAs,fireEvent:x5n}=CRe(),{establishWebSocketConnection:KAs,closeWebSocketConnection:w5n}=GXt(),{ByteParser:JAs}=y5n(),{kEnumerableProperty:ow,isBlobLike:R5n}=Ls(),{getGlobalDispatcher:ZAs}=xrt(),{types:k5n}=require("node:util"),{ErrorEvent:XAs,CloseEvent:eys}=Rde(),{SendQueue:tys}=b5n(),XS=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),so.util.markAsUncloneable(this);let n="WebSocket constructor";so.argumentLengthCheck(arguments,1,n);let o=so.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=so.converters.USVString(e,n,"url"),r=o.protocols;let s=S5n.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>YAs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[T5n]=new URL(c.href);let l=S5n.settingsObject;this[HAs]=KAs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[YXt]=t.CONNECTING,this[GAs]=jAs.NOT_SENT,this[fnt]="blob"}close(e=void 0,r=void 0){so.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=so.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=so.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");w5n(this,e,r,o)}send(e){so.brandCheck(this,t);let r="WebSocket.send";if(so.argumentLengthCheck(arguments,1,r),e=so.converters.WebSocketSendData(e,r,"data"),VAs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!WAs(this)||zAs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},dnt.string)}else k5n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},dnt.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},dnt.typedArray)):R5n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},dnt.blob))}get readyState(){return so.brandCheck(this,t),this[YXt]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),qAs(this[T5n])}get extensions(){return so.brandCheck(this,t),this.#n}get protocol(){return so.brandCheck(this,t),this.#r}get onopen(){return so.brandCheck(this,t),this.#e.open}set onopen(e){so.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return so.brandCheck(this,t),this.#e.error}set onerror(e){so.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return so.brandCheck(this,t),this.#e.close}set onclose(e){so.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return so.brandCheck(this,t),this.#e.message}set onmessage(e){so.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return so.brandCheck(this,t),this[fnt]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[fnt]="blob":this[fnt]=e}#o(e,r){this[I5n]=e;let n=new JAs(this,r);n.on("drain",rys),n.on("error",nys.bind(this)),e.socket.ws=this,this[$As]=n,this.#i=new tys(e.socket),this[YXt]=IRe.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),x5n("open",this)}};XS.CONNECTING=XS.prototype.CONNECTING=IRe.CONNECTING;XS.OPEN=XS.prototype.OPEN=IRe.OPEN;XS.CLOSING=XS.prototype.CLOSING=IRe.CLOSING;XS.CLOSED=XS.prototype.CLOSED=IRe.CLOSED;Object.defineProperties(XS.prototype,{CONNECTING:Wq,OPEN:Wq,CLOSING:Wq,CLOSED:Wq,url:ow,readyState:ow,bufferedAmount:ow,onopen:ow,onerror:ow,onclose:ow,close:ow,onmessage:ow,binaryType:ow,send:ow,extensions:ow,protocol:ow,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(XS,{CONNECTING:Wq,OPEN:Wq,CLOSING:Wq,CLOSED:Wq});so.converters["sequence"]=so.sequenceConverter(so.converters.DOMString);so.converters["DOMString or sequence"]=function(t,e,r){return so.util.Type(t)==="Object"&&Symbol.iterator in t?so.converters["sequence"](t):so.converters.DOMString(t,e,r)};so.converters.WebSocketInit=so.dictionaryConverter([{key:"protocols",converter:so.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:so.converters.any,defaultValue:a(()=>ZAs(),"defaultValue")},{key:"headers",converter:so.nullableConverter(so.converters.HeadersInit)}]);so.converters["DOMString or sequence or WebSocketInit"]=function(t){return so.util.Type(t)==="Object"&&!(Symbol.iterator in t)?so.converters.WebSocketInit(t):{protocols:so.converters["DOMString or sequence"](t)}};so.converters.WebSocketSendData=function(t){if(so.util.Type(t)==="Object"){if(R5n(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||k5n.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function rys(){this.ws[I5n].socket.resume()}a(rys,"onParserDrain");function nys(t){let e,r;t instanceof eys?(e=t.reason,r=t.code):e=t.message,x5n("error",this,()=>new XAs("error",{error:t,message:e})),w5n(this,r)}a(nys,"onParserError");P5n.exports={WebSocket:XS}});var KXt=I((BKd,N5n)=>{"use strict";p();function iys(t){return t.indexOf("\0")===-1}a(iys,"isValidLastEventId");function oys(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(oys,"isASCIINumber");function sys(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(sys,"delay");N5n.exports={isValidLastEventId:iys,isASCIINumber:oys,delay:sys}});var L5n=I((UKd,B5n)=>{"use strict";p();var{Transform:ays}=require("node:stream"),{isASCIINumber:M5n,isValidLastEventId:O5n}=KXt(),iF=[239,187,191],JXt=10,pnt=13,cys=58,lys=32,ZXt=class extends ays{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===iF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]&&this.buffer[2]===iF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===iF[0]&&this.buffer[1]===iF[1]&&this.buffer[2]===iF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&M5n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&O5n(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};B5n.exports={EventSourceStream:ZXt}});var $5n=I((jKd,G5n)=>{"use strict";p();var{pipeline:uys}=require("node:stream"),{fetching:dys}=hRe(),{makeRequest:fys}=bde(),{webidl:oF}=bA(),{EventSourceStream:pys}=L5n(),{parseMIMEType:hys}=Gv(),{createFastMessageEvent:mys}=Rde(),{isNetworkError:F5n}=fRe(),{delay:gys}=KXt(),{kEnumerableProperty:TJ}=Ls(),{environmentSettingsObject:U5n}=$S(),Q5n=!1,q5n=3e3,xRe=0,j5n=1,wRe=2,Ays="anonymous",yys="use-credentials",Mde=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=xRe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),oF.util.markAsUncloneable(this);let n="EventSource constructor";oF.argumentLengthCheck(arguments,1,n),Q5n||(Q5n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=oF.converters.USVString(e,n,"url"),r=oF.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:q5n};let o=U5n,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=Ays;r.withCredentials&&(c=yys,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=U5n.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=fys(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===wRe)return;this.#n=xRe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{F5n(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(F5n(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?hys(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=j5n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new pys({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(mys(u.type,u.options))},"push")});uys(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=dys(e)}async#u(){this.#n!==wRe&&(this.#n=xRe,this.dispatchEvent(new Event("error")),await gys(this.#a.reconnectionTime),this.#n===xRe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){oF.brandCheck(this,t),this.#n!==wRe&&(this.#n=wRe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},H5n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:xRe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:j5n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:wRe,writable:!1}};Object.defineProperties(Mde,H5n);Object.defineProperties(Mde.prototype,H5n);Object.defineProperties(Mde.prototype,{close:TJ,onerror:TJ,onmessage:TJ,onopen:TJ,readyState:TJ,url:TJ,withCredentials:TJ});oF.converters.EventSourceInitDict=oF.dictionaryConverter([{key:"withCredentials",converter:oF.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:oF.converters.any}]);G5n.exports={EventSource:Mde,defaultReconnectionTime:q5n}});var Y5n=I(($Kd,Ki)=>{"use strict";p();var Eys=cde(),V5n=Dwe(),_ys=lde(),Cys=H2n(),vys=ude(),bys=bZt(),Sys=pDn(),Tys=EDn(),W5n=mc(),mnt=Ls(),{InvalidArgumentError:hnt}=W5n,Ode=oNn(),Iys=Mwe(),xys=iXt(),wys=qNn(),Rys=aXt(),kys=$Zt(),Pys=Art(),{getGlobalDispatcher:z5n,setGlobalDispatcher:Dys}=xrt(),Nys=wrt(),Mys=srt(),Oys=art();Object.assign(V5n.prototype,Ode);Ki.exports.Dispatcher=V5n;Ki.exports.Client=Eys;Ki.exports.Pool=_ys;Ki.exports.BalancedPool=Cys;Ki.exports.Agent=vys;Ki.exports.ProxyAgent=bys;Ki.exports.EnvHttpProxyAgent=Sys;Ki.exports.RetryAgent=Tys;Ki.exports.RetryHandler=Pys;Ki.exports.DecoratorHandler=Nys;Ki.exports.RedirectHandler=Mys;Ki.exports.createRedirectInterceptor=Oys;Ki.exports.interceptors={redirect:zNn(),retry:KNn(),dump:ZNn(),dns:tMn()};Ki.exports.buildConnector=Iys;Ki.exports.errors=W5n;Ki.exports.util={parseHeaders:mnt.parseHeaders,headerNameToString:mnt.headerNameToString};function RRe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new hnt("invalid url");if(r!=null&&typeof r!="object")throw new hnt("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new hnt("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(mnt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=mnt.parseURL(e);let{agent:o,dispatcher:s=z5n()}=r;if(o)throw new hnt("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(RRe,"makeDispatcher");Ki.exports.setGlobalDispatcher=Dys;Ki.exports.getGlobalDispatcher=z5n;var Bys=hRe().fetch;Ki.exports.fetch=a(async function(e,r=void 0){try{return await Bys(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");Ki.exports.Headers=yJ().Headers;Ki.exports.Response=fRe().Response;Ki.exports.Request=bde().Request;Ki.exports.FormData=qwe().FormData;Ki.exports.File=globalThis.File??require("node:buffer").File;Ki.exports.FileReader=AOn().FileReader;var{setGlobalOrigin:Lys,getGlobalOrigin:Fys}=SJt();Ki.exports.setGlobalOrigin=Lys;Ki.exports.getGlobalOrigin=Fys;var{CacheStorage:Uys}=IOn(),{kConstruct:Qys}=Yrt();Ki.exports.caches=new Uys(Qys);var{deleteCookie:qys,getCookies:jys,getSetCookies:Hys,setCookie:Gys}=FOn();Ki.exports.deleteCookie=qys;Ki.exports.getCookies=jys;Ki.exports.getSetCookies=Hys;Ki.exports.setCookie=Gys;var{parseMIMEType:$ys,serializeAMimeType:Vys}=Gv();Ki.exports.parseMIMEType=$ys;Ki.exports.serializeAMimeType=Vys;var{CloseEvent:Wys,ErrorEvent:zys,MessageEvent:Yys}=Rde();Ki.exports.WebSocket=D5n().WebSocket;Ki.exports.CloseEvent=Wys;Ki.exports.ErrorEvent=zys;Ki.exports.MessageEvent=Yys;Ki.exports.request=RRe(Ode.request);Ki.exports.stream=RRe(Ode.stream);Ki.exports.pipeline=RRe(Ode.pipeline);Ki.exports.connect=RRe(Ode.connect);Ki.exports.upgrade=RRe(Ode.upgrade);Ki.exports.MockClient=xys;Ki.exports.MockPool=Rys;Ki.exports.MockAgent=wys;Ki.exports.mockErrors=kys;var{EventSource:Kys}=$5n();Ki.exports.EventSource=Kys});var ds=I((zKd,K5n)=>{p();K5n.exports={options:{usePureJavaScript:!1}}});var X5n=I((KKd,Z5n)=>{p();var XXt={};Z5n.exports=XXt;var J5n={};XXt.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=Jys(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r -`)}return n};XXt.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=J5n[e];if(!r){r=J5n[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(Jys,"_encodeWithByteBuffer")});var ic=I((XKd,n4n)=>{p();var e4n=ds(),t4n=X5n(),We=n4n.exports=e4n.util=e4n.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){We.nextTick=process.nextTick,typeof setImmediate=="function"?We.setImmediate=setImmediate:We.setImmediate=We.nextTick;return}if(typeof setImmediate=="function"){We.setImmediate=function(){return setImmediate.apply(void 0,arguments)},We.nextTick=function(l){return setImmediate(l)};return}if(We.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];We.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=We.setImmediate;We.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}We.nextTick=We.setImmediate})();We.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;We.globalScope=(function(){return We.isNodejs?global:typeof self>"u"?window:self})();We.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};We.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};We.isArrayBufferView=function(t){return t&&We.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function kRe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(kRe,"_checkBitsParam");We.ByteBuffer=eer;function eer(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(We.isArrayBuffer(t)||We.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rZys&&(this.data.substr(0,1),this._constructedStringLength=0)};We.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};We.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};We.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};We.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};We.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};We.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(We.encodeUtf8(t))};We.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};We.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};We.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};We.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};We.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};We.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};We.ByteStringBuffer.prototype.putInt=function(t,e){kRe(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};We.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};We.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};We.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};We.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};We.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};We.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};We.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};We.ByteStringBuffer.prototype.copy=function(){var t=We.createBuffer(this.data);return t.read=this.read,t};We.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};We.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};We.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};We.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};We.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};We.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};We.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};We.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};We.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};We.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};We.DataBuffer.prototype.putInt=function(t,e){kRe(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};We.DataBuffer.prototype.putSignedInt=function(t,e){return kRe(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};We.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};We.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};We.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};We.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};We.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};We.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};We.DataBuffer.prototype.copy=function(){return new We.DataBuffer(this)};We.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};We.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};We.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};We.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};We.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};We.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var zq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Yq=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],r4n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";We.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=zq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=zq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":zq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};We.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};We.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};We.decodeUtf8=function(t){return decodeURIComponent(escape(t))};We.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:t4n.encode,decode:t4n.decode}};We.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};We.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=zq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=zq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":zq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r -`,r=r.substr(e));return n+=r,n};We.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};We.binary.base58.encode=function(t,e){return We.binary.baseN.encode(t,r4n,e)};We.binary.base58.decode=function(t,e){return We.binary.baseN.decode(t,r4n,e)};We.text={utf8:{},utf16:{}};We.text.utf8.encode=function(t,e,r){t=We.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");We.setItem=function(t,e,r,n,o){gnt(eEs,arguments,o)};We.getItem=function(t,e,r,n){return gnt(tEs,arguments,n)};We.removeItem=function(t,e,r,n){gnt(rEs,arguments,n)};We.clearItems=function(t,e,r){gnt(nEs,arguments,r)};We.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};We.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};We.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};We.formatSize=function(t){return t>=1073741824?t=We.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=We.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=We.formatNumber(t/1024,0)+" KiB":t=We.formatNumber(t,0)+" bytes",t};We.bytesFromIP=function(t){return t.indexOf(".")!==-1?We.bytesFromIPv4(t):t.indexOf(":")!==-1?We.bytesFromIPv6(t):null};We.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=We.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};We.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in We&&!t.update)return e(null,We.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return We.cores=navigator.hardwareConcurrency,e(null,We.cores);if(typeof Worker>"u")return We.cores=1,e(null,We.cores);if(typeof Blob>"u")return We.cores=2,e(null,We.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var hg=ds();ic();i4n.exports=hg.cipher=hg.cipher||{};hg.cipher.algorithms=hg.cipher.algorithms||{};hg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};hg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=hg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new hg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};hg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),hg.cipher.algorithms[t]=e};hg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in hg.cipher.algorithms?hg.cipher.algorithms[t]:null};var ner=hg.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};ner.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=hg.util.createBuffer(),this.output=t.output||hg.util.createBuffer(),this.mode.start(e)};ner.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};ner.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var oer=I((iJd,o4n)=>{p();var mg=ds();ic();mg.cipher=mg.cipher||{};var Ys=o4n.exports=mg.cipher.modes=mg.cipher.modes||{};Ys.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ys.ecb.prototype.start=function(t){};Ys.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Ys.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Ys.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=ynt(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Ys.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Ys.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=mg.util.createBuffer(),this._partialBytes=0};Ys.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=mg.util.createBuffer(),this._partialBytes=0};Ys.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Ys.ofb.prototype.decrypt=Ys.ofb.prototype.encrypt;Ys.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=mg.util.createBuffer(),this._partialBytes=0};Ys.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=ynt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Ys.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}Ent(this._inBlock)};Ys.ctr.prototype.decrypt=Ys.ctr.prototype.encrypt;Ys.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=mg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Ys.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=mg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=mg.util.createBuffer(t.additionalData):r=mg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=mg.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(ier(n*8)))}this._inBlock=this._j0.slice(0),Ent(this._inBlock),this._partialBytes=0,r=mg.util.createBuffer(r),this._aDataLength=ier(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};Ys.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),Ent(this._inBlock)};Ys.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),Ent(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Ys.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Ys.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Ys.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=mg.util.createBuffer();for(var n=0;n{p();var Eu=ds();Ant();oer();ic();l4n.exports=Eu.aes=Eu.aes||{};Eu.aes.startEncrypting=function(t,e,r,n){var o=_nt({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};Eu.aes.createEncryptionCipher=function(t,e){return _nt({key:t,output:null,decrypt:!1,mode:e})};Eu.aes.startDecrypting=function(t,e,r,n){var o=_nt({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};Eu.aes.createDecryptionCipher=function(t,e){return _nt({key:t,output:null,decrypt:!0,mode:e})};Eu.aes.Algorithm=function(t,e){cer||a4n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return aer(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return aer(r._w,n,o,!0)},"decrypt")}}),r._init=!1};Eu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Eu.util.createBuffer(e);else if(Eu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=Eu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,H_[r]=l,ser[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)IJ[h][r]=d,VP[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(a4n,"initialize");function c4n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Bde*c,u=s;u>>16&255]<<24^H_[n>>>8&255]<<16^H_[n&255]<<8^H_[n>>>24]^s4n[o]<<24,o++):s>6&&u%s===4&&(n=H_[n>>>24]<<24^H_[n>>>16&255]<<16^H_[n>>>8&255]<<8^H_[n&255]),r[u]=r[u-s]^n;if(e){var d,f=VP[0],h=VP[1],m=VP[2],g=VP[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Bde;u>>24]]^h[H_[d>>>16&255]]^m[H_[d>>>8&255]]^g[H_[d&255]];r=A}return r}a(c4n,"_expandKey");function aer(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=VP[0],c=VP[1],l=VP[2],u=VP[3],d=ser):(s=IJ[0],c=IJ[1],l=IJ[2],u=IJ[3],d=H_);var f,h,m,g,A,y,E;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++_],E=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(aer,"_updateBlock");function _nt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=Eu.cipher.createDecipher(r,t.key):n=Eu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Eu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(_nt,"_createCipher")});var Jq=I((uJd,u4n)=>{p();var PRe=ds();PRe.pki=PRe.pki||{};var ler=u4n.exports=PRe.pki.oids=PRe.oids=PRe.oids||{};function rr(t,e){ler[t]=e,ler[e]=t}a(rr,"_IN");function Uc(t,e){ler[t]=e}a(Uc,"_I_");rr("1.2.840.113549.1.1.1","rsaEncryption");rr("1.2.840.113549.1.1.4","md5WithRSAEncryption");rr("1.2.840.113549.1.1.5","sha1WithRSAEncryption");rr("1.2.840.113549.1.1.7","RSAES-OAEP");rr("1.2.840.113549.1.1.8","mgf1");rr("1.2.840.113549.1.1.9","pSpecified");rr("1.2.840.113549.1.1.10","RSASSA-PSS");rr("1.2.840.113549.1.1.11","sha256WithRSAEncryption");rr("1.2.840.113549.1.1.12","sha384WithRSAEncryption");rr("1.2.840.113549.1.1.13","sha512WithRSAEncryption");rr("1.3.101.112","EdDSA25519");rr("1.2.840.10040.4.3","dsa-with-sha1");rr("1.3.14.3.2.7","desCBC");rr("1.3.14.3.2.26","sha1");rr("1.3.14.3.2.29","sha1WithRSASignature");rr("2.16.840.1.101.3.4.2.1","sha256");rr("2.16.840.1.101.3.4.2.2","sha384");rr("2.16.840.1.101.3.4.2.3","sha512");rr("2.16.840.1.101.3.4.2.4","sha224");rr("2.16.840.1.101.3.4.2.5","sha512-224");rr("2.16.840.1.101.3.4.2.6","sha512-256");rr("1.2.840.113549.2.2","md2");rr("1.2.840.113549.2.5","md5");rr("1.2.840.113549.1.7.1","data");rr("1.2.840.113549.1.7.2","signedData");rr("1.2.840.113549.1.7.3","envelopedData");rr("1.2.840.113549.1.7.4","signedAndEnvelopedData");rr("1.2.840.113549.1.7.5","digestedData");rr("1.2.840.113549.1.7.6","encryptedData");rr("1.2.840.113549.1.9.1","emailAddress");rr("1.2.840.113549.1.9.2","unstructuredName");rr("1.2.840.113549.1.9.3","contentType");rr("1.2.840.113549.1.9.4","messageDigest");rr("1.2.840.113549.1.9.5","signingTime");rr("1.2.840.113549.1.9.6","counterSignature");rr("1.2.840.113549.1.9.7","challengePassword");rr("1.2.840.113549.1.9.8","unstructuredAddress");rr("1.2.840.113549.1.9.14","extensionRequest");rr("1.2.840.113549.1.9.20","friendlyName");rr("1.2.840.113549.1.9.21","localKeyId");rr("1.2.840.113549.1.9.22.1","x509Certificate");rr("1.2.840.113549.1.12.10.1.1","keyBag");rr("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");rr("1.2.840.113549.1.12.10.1.3","certBag");rr("1.2.840.113549.1.12.10.1.4","crlBag");rr("1.2.840.113549.1.12.10.1.5","secretBag");rr("1.2.840.113549.1.12.10.1.6","safeContentsBag");rr("1.2.840.113549.1.5.13","pkcs5PBES2");rr("1.2.840.113549.1.5.12","pkcs5PBKDF2");rr("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");rr("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");rr("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");rr("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");rr("1.2.840.113549.2.7","hmacWithSHA1");rr("1.2.840.113549.2.8","hmacWithSHA224");rr("1.2.840.113549.2.9","hmacWithSHA256");rr("1.2.840.113549.2.10","hmacWithSHA384");rr("1.2.840.113549.2.11","hmacWithSHA512");rr("1.2.840.113549.3.7","des-EDE3-CBC");rr("2.16.840.1.101.3.4.1.2","aes128-CBC");rr("2.16.840.1.101.3.4.1.22","aes192-CBC");rr("2.16.840.1.101.3.4.1.42","aes256-CBC");rr("2.5.4.3","commonName");rr("2.5.4.4","surname");rr("2.5.4.5","serialNumber");rr("2.5.4.6","countryName");rr("2.5.4.7","localityName");rr("2.5.4.8","stateOrProvinceName");rr("2.5.4.9","streetAddress");rr("2.5.4.10","organizationName");rr("2.5.4.11","organizationalUnitName");rr("2.5.4.12","title");rr("2.5.4.13","description");rr("2.5.4.15","businessCategory");rr("2.5.4.17","postalCode");rr("2.5.4.42","givenName");rr("2.5.4.65","pseudonym");rr("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");rr("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");rr("2.16.840.1.113730.1.1","nsCertType");rr("2.16.840.1.113730.1.13","nsComment");Uc("2.5.29.1","authorityKeyIdentifier");Uc("2.5.29.2","keyAttributes");Uc("2.5.29.3","certificatePolicies");Uc("2.5.29.4","keyUsageRestriction");Uc("2.5.29.5","policyMapping");Uc("2.5.29.6","subtreesConstraint");Uc("2.5.29.7","subjectAltName");Uc("2.5.29.8","issuerAltName");Uc("2.5.29.9","subjectDirectoryAttributes");Uc("2.5.29.10","basicConstraints");Uc("2.5.29.11","nameConstraints");Uc("2.5.29.12","policyConstraints");Uc("2.5.29.13","basicConstraints");rr("2.5.29.14","subjectKeyIdentifier");rr("2.5.29.15","keyUsage");Uc("2.5.29.16","privateKeyUsagePeriod");rr("2.5.29.17","subjectAltName");rr("2.5.29.18","issuerAltName");rr("2.5.29.19","basicConstraints");Uc("2.5.29.20","cRLNumber");Uc("2.5.29.21","cRLReason");Uc("2.5.29.22","expirationDate");Uc("2.5.29.23","instructionCode");Uc("2.5.29.24","invalidityDate");Uc("2.5.29.25","cRLDistributionPoints");Uc("2.5.29.26","issuingDistributionPoint");Uc("2.5.29.27","deltaCRLIndicator");Uc("2.5.29.28","issuingDistributionPoint");Uc("2.5.29.29","certificateIssuer");Uc("2.5.29.30","nameConstraints");rr("2.5.29.31","cRLDistributionPoints");rr("2.5.29.32","certificatePolicies");Uc("2.5.29.33","policyMappings");Uc("2.5.29.34","policyConstraints");rr("2.5.29.35","authorityKeyIdentifier");Uc("2.5.29.36","policyConstraints");rr("2.5.29.37","extKeyUsage");Uc("2.5.29.46","freshestCRL");Uc("2.5.29.54","inhibitAnyPolicy");rr("1.3.6.1.4.1.11129.2.4.2","timestampList");rr("1.3.6.1.5.5.7.1.1","authorityInfoAccess");rr("1.3.6.1.5.5.7.3.1","serverAuth");rr("1.3.6.1.5.5.7.3.2","clientAuth");rr("1.3.6.1.5.5.7.3.3","codeSigning");rr("1.3.6.1.5.5.7.3.4","emailProtection");rr("1.3.6.1.5.5.7.3.8","timeStamping")});var WP=I((pJd,f4n)=>{p();var ed=ds();ic();Jq();var tn=f4n.exports=ed.asn1=ed.asn1||{};tn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};tn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};tn.maxDepth=256;tn.create=function(t,e,r,n,o){if(ed.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(DRe,"_checkBufferLength");var iEs=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;DRe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");tn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=tn.maxDepth),typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.length(),n=Cnt(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function Cnt(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;DRe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=iEs(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(DRe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(Cnt(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(Cnt(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===tn.Class.UNIVERSAL&&l===tn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===tn.Type.BITSTRING&&(DRe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=Cnt(t,e,r+1,E),v=o-t.length();e-=v,l==tn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===tn.Class.UNIVERSAL||b===tn.Class.CONTEXT_SPECIFIC)&&(f=[_])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===tn.Type.BMPSTRING)for(f="";u>0;u-=2)DRe(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return tn.create(c,l,m,f,T)}a(Cnt,"_fromDer");tn.toDer=function(t){var e=ed.util.createBuffer(),r=t.tagClass|t.type,n=ed.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=tn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};tn.oidToDer=function(t){var e=t.split("."),r=ed.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};tn.derToOid=function(t){var e;typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};tn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};tn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};tn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};tn.derToInteger=function(t){typeof t=="string"&&(t=ed.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};tn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&ed.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` -`);for(var o="",s=0;s{"use strict";p();var $Nn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:Pps}=mc(),kps=sde();WNn()===void 0&&VNn(new kps);function VNn(t){if(!t||typeof t.dispatch!="function")throw new Pps("Argument agent must implement Agent");Object.defineProperty(globalThis,$Nn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(VNn,"setGlobalDispatcher");function WNn(){return globalThis[$Nn]}a(WNn,"getGlobalDispatcher");zNn.exports={setGlobalDispatcher:VNn,getGlobalDispatcher:WNn}});var Crt=I((xVd,YNn)=>{"use strict";p();YNn.exports=class{static{a(this,"DecoratorHandler")}#e;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=e}onConnect(...e){return this.#e.onConnect?.(...e)}onError(...e){return this.#e.onError?.(...e)}onUpgrade(...e){return this.#e.onUpgrade?.(...e)}onResponseStarted(...e){return this.#e.onResponseStarted?.(...e)}onHeaders(...e){return this.#e.onHeaders?.(...e)}onData(...e){return this.#e.onData?.(...e)}onComplete(...e){return this.#e.onComplete?.(...e)}onBodySent(...e){return this.#e.onBodySent?.(...e)}}});var JNn=I((PVd,KNn)=>{"use strict";p();var Dps=ert();KNn.exports=t=>{let e=t?.maxRedirections;return r=>a(function(o,s){let{maxRedirections:c=e,...l}=o;if(!c)return r(o,s);let u=new Dps(r,c,o,s);return r(l,u)},"redirectInterceptor")}});var XNn=I((NVd,ZNn)=>{"use strict";p();var Nps=drt();ZNn.exports=t=>e=>a(function(n,o){return e(n,new Nps({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var tMn=I((BVd,eMn)=>{"use strict";p();var Mps=Os(),{InvalidArgumentError:Ops,RequestAbortedError:Bps}=mc(),Lps=Crt(),AXt=class extends Lps{static{a(this,"DumpHandler")}#e=1024*1024;#t=null;#r=!1;#n=!1;#i=0;#o=null;#s=null;constructor({maxSize:e},r){if(super(r),e!=null&&(!Number.isFinite(e)||e<1))throw new Ops("maxSize must be a number greater than 0");this.#e=e??this.#e,this.#s=r}onConnect(e){this.#t=e,this.#s.onConnect(this.#a.bind(this))}#a(e){this.#n=!0,this.#o=e}onHeaders(e,r,n,o){let c=Mps.parseHeaders(r)["content-length"];if(c!=null&&c>this.#e)throw new Bps(`Response size (${c}) larger than maxSize (${this.#e})`);return this.#n?!0:this.#s.onHeaders(e,r,n,o)}onError(e){this.#r||(e=this.#o??e,this.#s.onError(e))}onData(e){return this.#i=this.#i+e.length,this.#i>=this.#e&&(this.#r=!0,this.#n?this.#s.onError(this.#o):this.#s.onComplete([])),!0}onComplete(e){if(!this.#r){if(this.#n){this.#s.onError(this.reason);return}this.#s.onComplete(e)}}};function Fps({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new AXt({maxSize:s},o);return e(n,c)},"Intercept")}a(Fps,"createDumpInterceptor");eMn.exports=Fps});var iMn=I((UVd,nMn)=>{"use strict";p();var{isIP:Ups}=require("node:net"),{lookup:Qps}=require("node:dns"),qps=Crt(),{InvalidArgumentError:gde,InformationalError:jps}=mc(),rMn=Math.pow(2,31)-1,yXt=class{static{a(this,"DNSInstance")}#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#n,this.pick=e.pick??this.#i}get full(){return this.#r.size===this.#t}runLookup(e,r,n){let o=this.#r.get(e.hostname);if(o==null&&this.full){n(null,e.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new jps("No DNS entries found"));return}this.setRecords(e,l);let u=this.#r.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`)});else{let c=this.pick(e,o,s.affinity);if(c==null){this.#r.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)}}#n(e,r,n){Qps(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#i(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===rMn?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===rMn?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}};for(let s of r){s.timestamp=n,typeof s.ttl=="number"?s.ttl=Math.min(s.ttl,this.#e):s.ttl=this.#e;let c=o.records[s.family]??{ips:[]};c.ips.push(s),o.records[s.family]=c}this.#r.set(e.hostname,o)}getHandler(e,r){return new EXt(this,e,r)}},EXt=class extends qps{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;constructor(e,{origin:r,handler:n,dispatch:o},s){super(n),this.#i=r,this.#n=n,this.#t={...s},this.#e=e,this.#r=o}onError(e){switch(e.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#i,this.#t,(r,n)=>{if(r)return this.#n.onError(r);let o={...this.#t,origin:n};this.#r(o,this)});return}this.#n.onError(e);return}case"ENOTFOUND":this.#e.deleteRecord(this.#i);default:this.#n.onError(e);break}}};nMn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new gde("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new gde("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new gde("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new gde("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new gde("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new gde("Invalid pick. Must be a function");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0},o=new yXt(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return Ups(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onError(f);let m=null;m={...l,servername:d.hostname,origin:h,headers:{host:d.hostname,...l.headers}},s(m,o.getHandler({origin:d,dispatch:s,handler:u},l))}),!0)},"dnsInterceptor")}});var uJ=I((jVd,dMn)=>{"use strict";p();var{kConstruct:Hps}=Nd(),{kEnumerableProperty:Ade}=Os(),{iteratorMixin:Gps,isValidHeaderName:Jwe,isValidHeaderValue:sMn}=US(),{webidl:ja}=IA(),_Xt=require("node:assert"),brt=require("node:util"),Zh=Symbol("headers map"),jS=Symbol("headers map sorted");function oMn(t){return t===10||t===13||t===9||t===32}a(oMn,"isHTTPWhiteSpaceCharCode");function aMn(t){let e=0,r=t.length;for(;r>e&&oMn(t.charCodeAt(r-1));)--r;for(;r>e&&oMn(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(aMn,"headerValueNormalize");function cMn(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(cMn,"fill");function vXt(t,e,r){if(r=aMn(r),Jwe(e)){if(!sMn(r))throw ja.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ja.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(uMn(t)==="immutable")throw new TypeError("immutable");return CXt(t).append(e,r,!1)}a(vXt,"appendHeader");function lMn(t,e){return t[0]>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this[Zh])r[n++]=[o,s],_Xt(s!==null);return r.sort(lMn)}}},qk=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ja.util.markAsUncloneable(this),e!==Hps&&(this.#t=new Srt,this.#e="none",e!==void 0&&(e=ja.converters.HeadersInit(e,"Headers contructor","init"),cMn(this,e)))}append(e,r){ja.brandCheck(this,t),ja.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ja.converters.ByteString(e,n,"name"),r=ja.converters.ByteString(r,n,"value"),vXt(this,e,r)}delete(e){if(ja.brandCheck(this,t),ja.argumentLengthCheck(arguments,1,"Headers.delete"),e=ja.converters.ByteString(e,"Headers.delete","name"),!Jwe(e))throw ja.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){ja.brandCheck(this,t),ja.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ja.converters.ByteString(e,r,"name"),!Jwe(e))throw ja.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ja.brandCheck(this,t),ja.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ja.converters.ByteString(e,r,"name"),!Jwe(e))throw ja.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ja.brandCheck(this,t),ja.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ja.converters.ByteString(e,n,"name"),r=ja.converters.ByteString(r,n,"value"),r=aMn(r),Jwe(e)){if(!sMn(r))throw ja.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ja.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ja.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}get[jS](){if(this.#t[jS])return this.#t[jS];let e=[],r=this.#t.toSortedArray(),n=this.#t.cookies;if(n===null||n.length===1)return this.#t[jS]=r;for(let o=0;o>"](t,e,r,n.bind(t)):ja.converters["record"](t,e,r)}throw ja.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};dMn.exports={fill:cMn,compareHeaderName:lMn,Headers:qk,HeadersList:Srt,getHeadersGuard:uMn,setHeadersGuard:$ps,setHeadersList:Vps,getHeadersList:CXt}});var Xwe=I(($Vd,bMn)=>{"use strict";p();var{Headers:AMn,HeadersList:fMn,fill:Wps,getHeadersGuard:zps,setHeadersGuard:yMn,setHeadersList:EMn}=uJ(),{extractBody:pMn,cloneBody:Yps,mixinBody:Kps,hasFinalizationRegistry:_Mn,streamRegistry:vMn,bodyUnusable:Jps}=Jue(),bXt=Os(),hMn=require("node:util"),{kEnumerableProperty:HS}=bXt,{isValidReasonPhrase:Zps,isCancelled:Xps,isAborted:ehs,isBlobLike:ths,serializeJavascriptValueToJSONString:rhs,isErrorLike:nhs,isomorphicEncode:ihs,environmentSettingsObject:ohs}=US(),{redirectStatusSet:shs,nullBodyStatus:ahs}=Cwe(),{kState:Od,kHeaders:K3}=Sq(),{webidl:Xo}=IA(),{FormData:chs}=wwe(),{URLSerializer:mMn}=UC(),{kConstruct:Irt}=Nd(),SXt=require("node:assert"),{types:lhs}=require("node:util"),uhs=new TextEncoder("utf-8"),dJ=class t{static{a(this,"Response")}static error(){return Zwe(xrt(),"immutable")}static json(e,r={}){Xo.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Xo.converters.ResponseInit(r));let n=uhs.encode(rhs(e)),o=pMn(n),s=Zwe(yde({}),"response");return gMn(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Xo.argumentLengthCheck(arguments,1,"Response.redirect"),e=Xo.converters.USVString(e),r=Xo.converters["unsigned short"](r);let n;try{n=new URL(e,ohs.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!shs.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Zwe(yde({}),"immutable");o[Od].status=r;let s=ihs(mMn(n));return o[Od].headersList.append("location",s,!0),o}constructor(e=null,r={}){if(Xo.util.markAsUncloneable(this),e===Irt)return;e!==null&&(e=Xo.converters.BodyInit(e)),r=Xo.converters.ResponseInit(r),this[Od]=yde({}),this[K3]=new AMn(Irt),yMn(this[K3],"response"),EMn(this[K3],this[Od].headersList);let n=null;if(e!=null){let[o,s]=pMn(e);n={body:o,type:s}}gMn(this,r,n)}get type(){return Xo.brandCheck(this,t),this[Od].type}get url(){Xo.brandCheck(this,t);let e=this[Od].urlList,r=e[e.length-1]??null;return r===null?"":mMn(r,!0)}get redirected(){return Xo.brandCheck(this,t),this[Od].urlList.length>1}get status(){return Xo.brandCheck(this,t),this[Od].status}get ok(){return Xo.brandCheck(this,t),this[Od].status>=200&&this[Od].status<=299}get statusText(){return Xo.brandCheck(this,t),this[Od].statusText}get headers(){return Xo.brandCheck(this,t),this[K3]}get body(){return Xo.brandCheck(this,t),this[Od].body?this[Od].body.stream:null}get bodyUsed(){return Xo.brandCheck(this,t),!!this[Od].body&&bXt.isDisturbed(this[Od].body.stream)}clone(){if(Xo.brandCheck(this,t),Jps(this))throw Xo.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=TXt(this[Od]);return _Mn&&this[Od].body?.stream&&vMn.register(this,new WeakRef(this[Od].body.stream)),Zwe(e,zps(this[K3]))}[hMn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${hMn.formatWithOptions(r,n)}`}};Kps(dJ);Object.defineProperties(dJ.prototype,{type:HS,url:HS,status:HS,ok:HS,redirected:HS,statusText:HS,headers:HS,clone:HS,body:HS,bodyUsed:HS,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(dJ,{json:HS,redirect:HS,error:HS});function TXt(t){if(t.internalResponse)return CMn(TXt(t.internalResponse),t.type);let e=yde({...t,body:null});return t.body!=null&&(e.body=Yps(e,t.body)),e}a(TXt,"cloneResponse");function yde(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new fMn(t?.headersList):new fMn,urlList:t?.urlList?[...t.urlList]:[]}}a(yde,"makeResponse");function xrt(t){let e=nhs(t);return yde({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(xrt,"makeNetworkError");function dhs(t){return t.type==="error"&&t.status===0}a(dhs,"isNetworkError");function Trt(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return SXt(!(n in e)),r[n]=o,!0}})}a(Trt,"makeFilteredResponse");function CMn(t,e){if(e==="basic")return Trt(t,{type:"basic",headersList:t.headersList});if(e==="cors")return Trt(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return Trt(t,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(e==="opaqueredirect")return Trt(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});SXt(!1)}a(CMn,"filterResponse");function fhs(t,e=null){return SXt(Xps(t)),ehs(t)?xrt(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):xrt(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(fhs,"makeAppropriateNetworkError");function gMn(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Zps(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(t[Od].status=e.status),"statusText"in e&&e.statusText!=null&&(t[Od].statusText=e.statusText),"headers"in e&&e.headers!=null&&Wps(t[K3],e.headers),r){if(ahs.includes(t.status))throw Xo.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});t[Od].body=r.body,r.type!=null&&!t[Od].headersList.contains("content-type",!0)&&t[Od].headersList.append("content-type",r.type,!0)}}a(gMn,"initializeResponse");function Zwe(t,e){let r=new dJ(Irt);return r[Od]=t,r[K3]=new AMn(Irt),EMn(r[K3],t.headersList),yMn(r[K3],e),_Mn&&t.body?.stream&&vMn.register(r,new WeakRef(t.body.stream)),r}a(Zwe,"fromInnerResponse");Xo.converters.ReadableStream=Xo.interfaceConverter(ReadableStream);Xo.converters.FormData=Xo.interfaceConverter(chs);Xo.converters.URLSearchParams=Xo.interfaceConverter(URLSearchParams);Xo.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Xo.converters.USVString(t,e,r):ths(t)?Xo.converters.Blob(t,e,r,{strict:!1}):ArrayBuffer.isView(t)||lhs.isArrayBuffer(t)?Xo.converters.BufferSource(t,e,r):bXt.isFormDataLike(t)?Xo.converters.FormData(t,e,r,{strict:!1}):t instanceof URLSearchParams?Xo.converters.URLSearchParams(t,e,r):Xo.converters.DOMString(t,e,r)};Xo.converters.BodyInit=function(t,e,r){return t instanceof ReadableStream?Xo.converters.ReadableStream(t,e,r):t?.[Symbol.asyncIterator]?t:Xo.converters.XMLHttpRequestBodyInit(t,e,r)};Xo.converters.ResponseInit=Xo.dictionaryConverter([{key:"status",converter:Xo.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Xo.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Xo.converters.HeadersInit}]);bMn.exports={isNetworkError:dhs,makeNetworkError:xrt,makeResponse:yde,makeAppropriateNetworkError:fhs,filterResponse:CMn,Response:dJ,cloneResponse:TXt,fromInnerResponse:Zwe}});var xMn=I((zVd,IMn)=>{"use strict";p();var{kConnected:SMn,kSize:TMn}=Nd(),IXt=class{static{a(this,"CompatWeakRef")}constructor(e){this.value=e}deref(){return this.value[SMn]===0&&this.value[TMn]===0?void 0:this.value}},xXt=class{static{a(this,"CompatFinalizer")}constructor(e){this.finalizer=e}register(e,r){e.on&&e.on("disconnect",()=>{e[SMn]===0&&e[TMn]===0&&this.finalizer(r)})}unregister(e){}};IMn.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:IXt,FinalizationRegistry:xXt}):{WeakRef,FinalizationRegistry}}});var Ede=I((JVd,jMn)=>{"use strict";p();var{extractBody:phs,mixinBody:hhs,cloneBody:mhs,bodyUnusable:wMn}=Jue(),{Headers:LMn,fill:ghs,HeadersList:krt,setHeadersGuard:RXt,getHeadersGuard:Ahs,setHeadersList:FMn,getHeadersList:RMn}=uJ(),{FinalizationRegistry:yhs}=xMn()(),Rrt=Os(),PMn=require("node:util"),{isValidHTTPToken:Ehs,sameOrigin:kMn,environmentSettingsObject:wrt}=US(),{forbiddenMethodsSet:_hs,corsSafeListedMethodsSet:vhs,referrerPolicy:Chs,requestRedirect:bhs,requestMode:Shs,requestCredentials:Ths,requestCache:Ihs,requestDuplex:xhs}=Cwe(),{kEnumerableProperty:Xh,normalizedMethodRecordsBase:whs,normalizedMethodRecords:Rhs}=Rrt,{kHeaders:GS,kSignal:Prt,kState:Xu,kDispatcher:wXt}=Sq(),{webidl:Hi}=IA(),{URLSerializer:Phs}=UC(),{kConstruct:Drt}=Nd(),khs=require("node:assert"),{getMaxListeners:DMn,setMaxListeners:NMn,getEventListeners:Dhs,defaultMaxListeners:MMn}=require("node:events"),Nhs=Symbol("abortController"),UMn=new yhs(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Nrt=new WeakMap;function OMn(t){return e;function e(){let r=t.deref();if(r!==void 0){UMn.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Nrt.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Nrt.delete(r.signal)}}}}a(OMn,"buildAbort");var BMn=!1,Bq=class t{static{a(this,"Request")}constructor(e,r={}){if(Hi.util.markAsUncloneable(this),e===Drt)return;let n="Request constructor";Hi.argumentLengthCheck(arguments,1,n),e=Hi.converters.RequestInfo(e,n,"input"),r=Hi.converters.RequestInit(r,n,"init");let o=null,s=null,c=wrt.settingsObject.baseUrl,l=null;if(typeof e=="string"){this[wXt]=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=Mrt({urlList:[_]}),s="cors"}else this[wXt]=r.dispatcher||e[wXt],khs(e instanceof t),o=e[Xu],l=e[Prt];let u=wrt.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&kMn(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=Mrt({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:wrt.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!kMn(v,wrt.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Hi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=Rhs[_];if(v!==void 0)o.method=v;else{if(!Ehs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(_hs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=whs[b]??_,o.method=_}!BMn&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),BMn=!0)}r.signal!==void 0&&(l=r.signal),this[Xu]=o;let m=new AbortController;if(this[Prt]=m.signal,l!=null){if(!l||typeof l.aborted!="boolean"||typeof l.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(l.aborted)m.abort(l.reason);else{this[Nhs]=m;let _=new WeakRef(m),v=OMn(_);try{(typeof DMn=="function"&&DMn(l)===MMn||Dhs(l,"abort").length>=MMn)&&NMn(1500,l)}catch{}Rrt.addAbortListener(l,v),UMn.register(m,{signal:l,abort:v},v)}}if(this[GS]=new LMn(Drt),FMn(this[GS],o.headersList),RXt(this[GS],"request"),h==="no-cors"){if(!vhs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);RXt(this[GS],"request-no-cors")}if(f){let _=RMn(this[GS]),v=r.headers!==void 0?r.headers:new krt(_);if(_.clear(),v instanceof krt){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else ghs(this[GS],v)}let g=e instanceof t?e[Xu].body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=phs(r.body,o.keepalive);A=_,v&&!RMn(this[GS]).contains("content-type",!0)&&this[GS].append("content-type",v)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(wMn(e))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this[Xu].body=E}get method(){return Hi.brandCheck(this,t),this[Xu].method}get url(){return Hi.brandCheck(this,t),Phs(this[Xu].url)}get headers(){return Hi.brandCheck(this,t),this[GS]}get destination(){return Hi.brandCheck(this,t),this[Xu].destination}get referrer(){return Hi.brandCheck(this,t),this[Xu].referrer==="no-referrer"?"":this[Xu].referrer==="client"?"about:client":this[Xu].referrer.toString()}get referrerPolicy(){return Hi.brandCheck(this,t),this[Xu].referrerPolicy}get mode(){return Hi.brandCheck(this,t),this[Xu].mode}get credentials(){return this[Xu].credentials}get cache(){return Hi.brandCheck(this,t),this[Xu].cache}get redirect(){return Hi.brandCheck(this,t),this[Xu].redirect}get integrity(){return Hi.brandCheck(this,t),this[Xu].integrity}get keepalive(){return Hi.brandCheck(this,t),this[Xu].keepalive}get isReloadNavigation(){return Hi.brandCheck(this,t),this[Xu].reloadNavigation}get isHistoryNavigation(){return Hi.brandCheck(this,t),this[Xu].historyNavigation}get signal(){return Hi.brandCheck(this,t),this[Prt]}get body(){return Hi.brandCheck(this,t),this[Xu].body?this[Xu].body.stream:null}get bodyUsed(){return Hi.brandCheck(this,t),!!this[Xu].body&&Rrt.isDisturbed(this[Xu].body.stream)}get duplex(){return Hi.brandCheck(this,t),"half"}clone(){if(Hi.brandCheck(this,t),wMn(this))throw new TypeError("unusable");let e=QMn(this[Xu]),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Nrt.get(this.signal);n===void 0&&(n=new Set,Nrt.set(this.signal,n));let o=new WeakRef(r);n.add(o),Rrt.addAbortListener(r.signal,OMn(o))}return qMn(e,r.signal,Ahs(this[GS]))}[PMn.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${PMn.formatWithOptions(r,n)}`}};hhs(Bq);function Mrt(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new krt(t.headersList):new krt}}a(Mrt,"makeRequest");function QMn(t){let e=Mrt({...t,body:null});return t.body!=null&&(e.body=mhs(e,t.body)),e}a(QMn,"cloneRequest");function qMn(t,e,r){let n=new Bq(Drt);return n[Xu]=t,n[Prt]=e,n[GS]=new LMn(Drt),FMn(n[GS],t.headersList),RXt(n[GS],r),n}a(qMn,"fromInnerRequest");Object.defineProperties(Bq.prototype,{method:Xh,url:Xh,headers:Xh,redirect:Xh,clone:Xh,signal:Xh,duplex:Xh,destination:Xh,body:Xh,bodyUsed:Xh,isHistoryNavigation:Xh,isReloadNavigation:Xh,keepalive:Xh,integrity:Xh,cache:Xh,credentials:Xh,attribute:Xh,referrerPolicy:Xh,referrer:Xh,mode:Xh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Hi.converters.Request=Hi.interfaceConverter(Bq);Hi.converters.RequestInfo=function(t,e,r){return typeof t=="string"?Hi.converters.USVString(t,e,r):t instanceof Bq?Hi.converters.Request(t,e,r):Hi.converters.USVString(t,e,r)};Hi.converters.AbortSignal=Hi.interfaceConverter(AbortSignal);Hi.converters.RequestInit=Hi.dictionaryConverter([{key:"method",converter:Hi.converters.ByteString},{key:"headers",converter:Hi.converters.HeadersInit},{key:"body",converter:Hi.nullableConverter(Hi.converters.BodyInit)},{key:"referrer",converter:Hi.converters.USVString},{key:"referrerPolicy",converter:Hi.converters.DOMString,allowedValues:Chs},{key:"mode",converter:Hi.converters.DOMString,allowedValues:Shs},{key:"credentials",converter:Hi.converters.DOMString,allowedValues:Ths},{key:"cache",converter:Hi.converters.DOMString,allowedValues:Ihs},{key:"redirect",converter:Hi.converters.DOMString,allowedValues:bhs},{key:"integrity",converter:Hi.converters.DOMString},{key:"keepalive",converter:Hi.converters.boolean},{key:"signal",converter:Hi.nullableConverter(t=>Hi.converters.AbortSignal(t,"RequestInit","signal",{strict:!1}))},{key:"window",converter:Hi.converters.any},{key:"duplex",converter:Hi.converters.DOMString,allowedValues:xhs},{key:"dispatcher",converter:Hi.converters.any}]);jMn.exports={Request:Bq,makeRequest:Mrt,fromInnerRequest:qMn,cloneRequest:QMn}});var tRe=I((eWd,nOn)=>{"use strict";p();var{makeNetworkError:el,makeAppropriateNetworkError:Ort,filterResponse:PXt,makeResponse:Brt,fromInnerResponse:Mhs}=Xwe(),{HeadersList:HMn}=uJ(),{Request:Ohs,cloneRequest:Bhs}=Ede(),Lq=require("node:zlib"),{bytesMatch:Lhs,makePolicyContainer:Fhs,clonePolicyContainer:Uhs,requestBadPort:Qhs,TAOCheck:qhs,appendRequestOriginHeader:jhs,responseLocationURL:Hhs,requestCurrentURL:MO,setRequestReferrerPolicyOnRedirect:Ghs,tryUpgradeRequestToAPotentiallyTrustworthyURL:$hs,createOpaqueTimingInfo:OXt,appendFetchMetadata:Vhs,corsCheck:Whs,crossOriginResourcePolicyCheck:zhs,determineRequestsReferrer:Yhs,coarsenedSharedCurrentTime:eRe,createDeferredPromise:Khs,isBlobLike:Jhs,sameOrigin:MXt,isCancelled:fJ,isAborted:GMn,isErrorLike:Zhs,fullyReadBody:Xhs,readableStreamClose:e0s,isomorphicEncode:Lrt,urlIsLocal:t0s,urlIsHttpHttpsScheme:BXt,urlHasHttpsScheme:r0s,clampAndCoarsenConnectionTimingInfo:n0s,simpleRangeHeaderValue:i0s,buildContentRange:o0s,createInflate:s0s,extractMimeType:a0s}=US(),{kState:zMn,kDispatcher:c0s}=Sq(),pJ=require("node:assert"),{safelyExtractBody:LXt,extractBody:$Mn}=Jue(),{redirectStatusSet:YMn,nullBodyStatus:KMn,safeMethodsSet:l0s,requestBodyHeader:u0s,subresourceSet:d0s}=Cwe(),f0s=require("node:events"),{Readable:p0s,pipeline:h0s,finished:m0s}=require("node:stream"),{addAbortListener:g0s,isErrored:A0s,isReadable:Frt,bufferToLowerCasedHeaderName:VMn}=Os(),{dataURLProcessor:y0s,serializeAMimeType:E0s,minimizeSupportedMimeType:_0s}=UC(),{getGlobalDispatcher:v0s}=vrt(),{webidl:C0s}=IA(),{STATUS_CODES:b0s}=require("node:http"),S0s=["GET","HEAD"],T0s=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",kXt,Urt=class extends f0s{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function I0s(t){JMn(t,"fetch")}a(I0s,"handleFetchDone");function x0s(t,e=void 0){C0s.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=Khs(),n;try{n=new Ohs(t,e)}catch(f){return r.reject(f),r.promise}let o=n[zMn];if(n.signal.aborted)return DXt(r,o,null,n.signal.reason),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return g0s(n.signal,()=>{l=!0,pJ(u!=null),u.abort(n.signal.reason);let f=c?.deref();DXt(r,o,f,n.signal.reason)}),u=XMn({request:o,processResponseEndOfBody:I0s,processResponse:a(f=>{if(!l){if(f.aborted){DXt(r,o,c,u.serializedAbortReason);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(Mhs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:n[c0s]}),r.promise}a(x0s,"fetch");function JMn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;BXt(r)&&n!==null&&(t.timingAllowPassed||(n=OXt({startTime:n.startTime}),o=""),n.endTime=eRe(),t.timingInfo=n,ZMn(n,r.href,e,globalThis,o))}a(JMn,"finalizeAndReportTiming");var ZMn=performance.markResourceTiming;function DXt(t,e,r,n){if(t&&t.reject(n),e.body!=null&&Frt(e.body?.stream)&&e.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s}),r==null)return;let o=r[zMn];o.body!=null&&Frt(o.body?.stream)&&o.body.stream.cancel(n).catch(s=>{if(s.code!=="ERR_INVALID_STATE")throw s})}a(DXt,"abortFetch");function XMn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=v0s()}){pJ(l);let u=null,d=!1;t.client!=null&&(u=t.client.globalObject,d=t.client.crossOriginIsolatedCapability);let f=eRe(d),h=OXt({startTime:f}),m={controller:new Urt(l),request:t,timingInfo:h,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:u,crossOriginIsolatedCapability:d};return pJ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=Uhs(t.client.policyContainer):t.policyContainer=Fhs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,d0s.has(t.destination),eOn(m).catch(g=>{m.controller.terminate(g)}),m.controller}a(XMn,"fetching");async function eOn(t,e=!1){let r=t.request,n=null;if(r.localURLsOnly&&!t0s(MO(r))&&(n=el("local URLs only")),$hs(r),Qhs(r)==="blocked"&&(n=el("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=Yhs(r)),n===null&&(n=await(async()=>{let s=MO(r);return MXt(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",await WMn(t)):r.mode==="same-origin"?el('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?el('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",await WMn(t)):BXt(MO(r))?(r.responseTainting="cors",await tOn(t)):el("URL scheme must be a HTTP(S) scheme")})()),e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=PXt(n,"basic"):r.responseTainting==="cors"?n=PXt(n,"cors"):r.responseTainting==="opaque"?n=PXt(n,"opaque"):pJ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=el()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||KMn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>NXt(t,el(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!Lhs(l,r.integrity)){s("integrity mismatch");return}n.body=LXt(l)[0],NXt(t,n)},"processBody");await Xhs(n.body,c,s)}else NXt(t,n)}a(eOn,"mainFetch");function WMn(t){if(fJ(t)&&t.request.redirectCount===0)return Promise.resolve(Ort(t));let{request:e}=t,{protocol:r}=MO(e);switch(r){case"about:":return Promise.resolve(el("about scheme is not supported"));case"blob:":{kXt||(kXt=require("node:buffer").resolveObjectURL);let n=MO(e);if(n.search.length!==0)return Promise.resolve(el("NetworkError when attempting to fetch resource."));let o=kXt(n.toString());if(e.method!=="GET"||!Jhs(o))return Promise.resolve(el("invalid method"));let s=Brt(),c=o.size,l=Lrt(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=i0s(d,!0);if(f==="failure")return Promise.resolve(el("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(el("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m,u),A=$Mn(g);s.body=A[0];let y=Lrt(`${g.size}`),E=o0s(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=$Mn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=MO(e),o=y0s(n);if(o==="failure")return Promise.resolve(el("failed to fetch the data URL"));let s=E0s(o.mimeType);return Promise.resolve(Brt({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:LXt(o.body)[0]}))}case"file:":return Promise.resolve(el("not implemented... yet..."));case"http:":case"https:":return tOn(t).catch(n=>el(n));default:return Promise.resolve(el("unknown scheme"))}}a(WMn,"schemeFetch");function w0s(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(w0s,"finalizeResponse");function NXt(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(t.request.url.protocol!=="https:")return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=OXt(r),l="");let d=0;if(t.request.mode!=="navigator"||!e.hasCrossOriginRedirects){d=e.status;let f=a0s(e.headersList);f!=="failure"&&(u.contentType=_0s(f))}t.request.initiatorType!=null&&ZMn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():m0s(o.body.stream,()=>{n()})}a(NXt,"fetchFinale");async function tOn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await rOn(t),e.responseTainting==="cors"&&Whs(e,r)==="failure")return el("cors failure");qhs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&zhs(e.origin,e.client,e.destination,n)==="blocked"?el("blocked"):(YMn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=el("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await R0s(t,r):pJ(!1)),r.timingInfo=o,r)}a(tOn,"httpFetch");function R0s(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=Hhs(n,MO(r).hash),o==null)return e}catch(c){return Promise.resolve(el(c))}if(!BXt(o))return Promise.resolve(el("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(el("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!MXt(r,o))return Promise.resolve(el('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(el('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(el());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!S0s.includes(r.method)){r.method="GET",r.body=null;for(let c of u0s)r.headersList.delete(c)}MXt(MO(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(pJ(r.body.source!=null),r.body=LXt(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=eRe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),Ghs(r,n),eOn(t,!0)}a(R0s,"httpRedirectFetch");async function rOn(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=Bhs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Lrt(`${f}`)),h!=null&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,s.referrer instanceof URL&&s.headersList.append("referer",Lrt(s.referrer.href),!0),jhs(s),Vhs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",T0s),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(r0s(MO(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return el("only if cached");let m=await P0s(o,d,r);!l0s.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===407)return n.window==="no-window"?el():fJ(t)?Ort(t):el("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(fJ(t))return Ort(t);t.controller.connection.destroy(),c=await rOn(t,e,!0)}return c}a(rOn,"httpNetworkOrCacheFetch");async function P0s(t,e=!1,r=!1){pJ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){fJ(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{fJ(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{fJ(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=Brt({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Brt({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),Ort(t,A)):el(A)}let d=a(async()=>{await t.controller.resume()},"pullAlgorithm"),f=a(A=>{fJ(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({async start(A){t.controller.controller=A},async pull(A){await d(A)},async cancel(A){await f(A)},type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.onAborted=m,t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(GMn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){e0s(t.controller.controller),w0s(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),A0s(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){GMn(t)?(o.aborted=!0,Frt(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):Frt(h)&&t.controller.controller.error(new TypeError("terminated",{cause:Zhs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=MO(n),E=t.controller.dispatcher;return new Promise((_,v)=>E.dispatch({path:y.pathname+y.search,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(b){let{connection:T}=t.controller;s.finalConnectionTimingInfo=n0s(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),T.destroyed?b(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",b),this.abort=T.abort=b),s.finalNetworkRequestStartTime=eRe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=eRe(t.crossOriginIsolatedCapability)},onHeaders(b,T,w,R){if(b<200)return;let x="",P=new HMn;for(let L=0;LM)return v(new Error(`too many content-encodings in response: ${j.length}, maximum allowed is ${M}`)),!0;for(let O=j.length-1;O>=0;--O){let q=j[O].trim();if(q==="x-gzip"||q==="gzip")D.push(Lq.createGunzip({flush:Lq.constants.Z_SYNC_FLUSH,finishFlush:Lq.constants.Z_SYNC_FLUSH}));else if(q==="deflate")D.push(s0s({flush:Lq.constants.Z_SYNC_FLUSH,finishFlush:Lq.constants.Z_SYNC_FLUSH}));else if(q==="br")D.push(Lq.createBrotliDecompress({flush:Lq.constants.BROTLI_OPERATION_FLUSH,finishFlush:Lq.constants.BROTLI_OPERATION_FLUSH}));else{D.length=0;break}}}let B=this.onError.bind(this);return _({status:b,statusText:R,headersList:P,body:D.length?h0s(this.body,...D,L=>{L&&this.onError(L)}).on("error",B):this.body.on("error",B)}),!0},onData(b){if(t.controller.dump)return;let T=b;return s.encodedBodySize+=T.byteLength,this.body.push(T)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.onAborted&&t.controller.off("terminated",t.controller.onAborted),t.controller.ended=!0,this.body.push(null)},onError(b){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(b),t.controller.terminate(b),v(b)},onUpgrade(b,T,w){if(b!==101)return;let R=new HMn;for(let x=0;x{"use strict";p();iOn.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var sOn=I((oWd,oOn)=>{"use strict";p();var{webidl:$S}=IA(),Qrt=Symbol("ProgressEvent state"),UXt=class t extends Event{static{a(this,"ProgressEvent")}constructor(e,r={}){e=$S.converters.DOMString(e,"ProgressEvent constructor","type"),r=$S.converters.ProgressEventInit(r??{}),super(e,r),this[Qrt]={lengthComputable:r.lengthComputable,loaded:r.loaded,total:r.total}}get lengthComputable(){return $S.brandCheck(this,t),this[Qrt].lengthComputable}get loaded(){return $S.brandCheck(this,t),this[Qrt].loaded}get total(){return $S.brandCheck(this,t),this[Qrt].total}};$S.converters.ProgressEventInit=$S.dictionaryConverter([{key:"lengthComputable",converter:$S.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"loaded",converter:$S.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"total",converter:$S.converters["unsigned long long"],defaultValue:a(()=>0,"defaultValue")},{key:"bubbles",converter:$S.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:$S.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:$S.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}]);oOn.exports={ProgressEvent:UXt}});var cOn=I((cWd,aOn)=>{"use strict";p();function k0s(t){if(!t)return"failure";switch(t.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}a(k0s,"getEncoding");aOn.exports={getEncoding:k0s}});var gOn=I((dWd,mOn)=>{"use strict";p();var{kState:_de,kError:QXt,kResult:lOn,kAborted:rRe,kLastProgressEventFired:qXt}=FXt(),{ProgressEvent:D0s}=sOn(),{getEncoding:uOn}=cOn(),{serializeAMimeType:N0s,parseMIMEType:dOn}=UC(),{types:M0s}=require("node:util"),{StringDecoder:fOn}=require("string_decoder"),{btoa:pOn}=require("node:buffer"),O0s={enumerable:!0,writable:!1,configurable:!1};function B0s(t,e,r,n){if(t[_de]==="loading")throw new DOMException("Invalid state","InvalidStateError");t[_de]="loading",t[lOn]=null,t[QXt]=null;let s=e.stream().getReader(),c=[],l=s.read(),u=!0;(async()=>{for(;!t[rRe];)try{let{done:d,value:f}=await l;if(u&&!t[rRe]&&queueMicrotask(()=>{Fq("loadstart",t)}),u=!1,!d&&M0s.isUint8Array(f))c.push(f),(t[qXt]===void 0||Date.now()-t[qXt]>=50)&&!t[rRe]&&(t[qXt]=Date.now(),queueMicrotask(()=>{Fq("progress",t)})),l=s.read();else if(d){queueMicrotask(()=>{t[_de]="done";try{let h=L0s(c,r,e.type,n);if(t[rRe])return;t[lOn]=h,Fq("load",t)}catch(h){t[QXt]=h,Fq("error",t)}t[_de]!=="loading"&&Fq("loadend",t)});break}}catch(d){if(t[rRe])return;queueMicrotask(()=>{t[_de]="done",t[QXt]=d,Fq("error",t),t[_de]!=="loading"&&Fq("loadend",t)});break}})()}a(B0s,"readOperation");function Fq(t,e){let r=new D0s(t,{bubbles:!1,cancelable:!1});e.dispatchEvent(r)}a(Fq,"fireAProgressEvent");function L0s(t,e,r,n){switch(e){case"DataURL":{let o="data:",s=dOn(r||"application/octet-stream");s!=="failure"&&(o+=N0s(s)),o+=";base64,";let c=new fOn("latin1");for(let l of t)o+=pOn(c.write(l));return o+=pOn(c.end()),o}case"Text":{let o="failure";if(n&&(o=uOn(n)),o==="failure"&&r){let s=dOn(r);s!=="failure"&&(o=uOn(s.parameters.get("charset")))}return o==="failure"&&(o="UTF-8"),F0s(t,o)}case"ArrayBuffer":return hOn(t).buffer;case"BinaryString":{let o="",s=new fOn("latin1");for(let c of t)o+=s.write(c);return o+=s.end(),o}}}a(L0s,"packageData");function F0s(t,e){let r=hOn(t),n=U0s(r),o=0;n!==null&&(e=n,o=n==="UTF-8"?3:2);let s=r.slice(o);return new TextDecoder(e).decode(s)}a(F0s,"decode");function U0s(t){let[e,r,n]=t;return e===239&&r===187&&n===191?"UTF-8":e===254&&r===255?"UTF-16BE":e===255&&r===254?"UTF-16LE":null}a(U0s,"BOMSniffing");function hOn(t){let e=t.reduce((n,o)=>n+o.byteLength,0),r=0;return t.reduce((n,o)=>(n.set(o,r),r+=o.byteLength,n),new Uint8Array(e))}a(hOn,"combineByteSequences");mOn.exports={staticPropertyDescriptors:O0s,readOperation:B0s,fireAProgressEvent:Fq}});var _On=I((hWd,EOn)=>{"use strict";p();var{staticPropertyDescriptors:vde,readOperation:qrt,fireAProgressEvent:AOn}=gOn(),{kState:hJ,kError:yOn,kResult:jrt,kEvents:Sc,kAborted:Q0s}=FXt(),{webidl:vl}=IA(),{kEnumerableProperty:jC}=Os(),jk=class t extends EventTarget{static{a(this,"FileReader")}constructor(){super(),this[hJ]="empty",this[jrt]=null,this[yOn]=null,this[Sc]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),e=vl.converters.Blob(e,{strict:!1}),qrt(this,e,"ArrayBuffer")}readAsBinaryString(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),e=vl.converters.Blob(e,{strict:!1}),qrt(this,e,"BinaryString")}readAsText(e,r=void 0){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsText"),e=vl.converters.Blob(e,{strict:!1}),r!==void 0&&(r=vl.converters.DOMString(r,"FileReader.readAsText","encoding")),qrt(this,e,"Text",r)}readAsDataURL(e){vl.brandCheck(this,t),vl.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),e=vl.converters.Blob(e,{strict:!1}),qrt(this,e,"DataURL")}abort(){if(this[hJ]==="empty"||this[hJ]==="done"){this[jrt]=null;return}this[hJ]==="loading"&&(this[hJ]="done",this[jrt]=null),this[Q0s]=!0,AOn("abort",this),this[hJ]!=="loading"&&AOn("loadend",this)}get readyState(){switch(vl.brandCheck(this,t),this[hJ]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return vl.brandCheck(this,t),this[jrt]}get error(){return vl.brandCheck(this,t),this[yOn]}get onloadend(){return vl.brandCheck(this,t),this[Sc].loadend}set onloadend(e){vl.brandCheck(this,t),this[Sc].loadend&&this.removeEventListener("loadend",this[Sc].loadend),typeof e=="function"?(this[Sc].loadend=e,this.addEventListener("loadend",e)):this[Sc].loadend=null}get onerror(){return vl.brandCheck(this,t),this[Sc].error}set onerror(e){vl.brandCheck(this,t),this[Sc].error&&this.removeEventListener("error",this[Sc].error),typeof e=="function"?(this[Sc].error=e,this.addEventListener("error",e)):this[Sc].error=null}get onloadstart(){return vl.brandCheck(this,t),this[Sc].loadstart}set onloadstart(e){vl.brandCheck(this,t),this[Sc].loadstart&&this.removeEventListener("loadstart",this[Sc].loadstart),typeof e=="function"?(this[Sc].loadstart=e,this.addEventListener("loadstart",e)):this[Sc].loadstart=null}get onprogress(){return vl.brandCheck(this,t),this[Sc].progress}set onprogress(e){vl.brandCheck(this,t),this[Sc].progress&&this.removeEventListener("progress",this[Sc].progress),typeof e=="function"?(this[Sc].progress=e,this.addEventListener("progress",e)):this[Sc].progress=null}get onload(){return vl.brandCheck(this,t),this[Sc].load}set onload(e){vl.brandCheck(this,t),this[Sc].load&&this.removeEventListener("load",this[Sc].load),typeof e=="function"?(this[Sc].load=e,this.addEventListener("load",e)):this[Sc].load=null}get onabort(){return vl.brandCheck(this,t),this[Sc].abort}set onabort(e){vl.brandCheck(this,t),this[Sc].abort&&this.removeEventListener("abort",this[Sc].abort),typeof e=="function"?(this[Sc].abort=e,this.addEventListener("abort",e)):this[Sc].abort=null}};jk.EMPTY=jk.prototype.EMPTY=0;jk.LOADING=jk.prototype.LOADING=1;jk.DONE=jk.prototype.DONE=2;Object.defineProperties(jk.prototype,{EMPTY:vde,LOADING:vde,DONE:vde,readAsArrayBuffer:jC,readAsBinaryString:jC,readAsText:jC,readAsDataURL:jC,abort:jC,readyState:jC,result:jC,error:jC,onloadstart:jC,onprogress:jC,onload:jC,onabort:jC,onerror:jC,onloadend:jC,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(jk,{EMPTY:vde,LOADING:vde,DONE:vde});EOn.exports={FileReader:jk}});var Hrt=I((AWd,vOn)=>{"use strict";p();vOn.exports={kConstruct:Nd().kConstruct}});var SOn=I((EWd,bOn)=>{"use strict";p();var q0s=require("node:assert"),{URLSerializer:COn}=UC(),{isValidHeaderName:j0s}=US();function H0s(t,e,r=!1){let n=COn(t,r),o=COn(e,r);return n===o}a(H0s,"urlEquals");function G0s(t){q0s(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),j0s(r)&&e.push(r);return e}a(G0s,"getFieldValues");bOn.exports={urlEquals:H0s,getFieldValues:G0s}});var xOn=I((CWd,IOn)=>{"use strict";p();var{kConstruct:$0s}=Hrt(),{urlEquals:V0s,getFieldValues:jXt}=SOn(),{kEnumerableProperty:mJ,isDisturbed:W0s}=Os(),{webidl:Ei}=IA(),{Response:z0s,cloneResponse:Y0s,fromInnerResponse:K0s}=Xwe(),{Request:J3,fromInnerRequest:J0s}=Ede(),{kState:Hk}=Sq(),{fetching:Z0s}=tRe(),{urlIsHttpHttpsScheme:Grt,createDeferredPromise:Cde,readAllBytes:X0s}=US(),HXt=require("node:assert"),$rt=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==$0s&&Ei.illegalConstructor(),Ei.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Ei.brandCheck(this,t);let n="Cache.match";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Ei.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Ei.brandCheck(this,t);let r="Cache.add";Ei.argumentLengthCheck(arguments,1,r),e=Ei.converters.RequestInfo(e,r,"request");let n=[e];return await this.addAll(n)}async addAll(e){Ei.brandCheck(this,t);let r="Cache.addAll";Ei.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Ei.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Ei.converters.RequestInfo(m),typeof m=="string")continue;let g=m[Hk];if(!Grt(g.url)||g.method!=="GET")throw Ei.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=new J3(m)[Hk];if(!Grt(g.url))throw Ei.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Cde();s.push(Z0s({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Ei.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=jXt(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Ei.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Cde(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Ei.brandCheck(this,t);let n="Cache.put";Ei.argumentLengthCheck(arguments,2,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.Response(r,n,"response");let o=null;if(e instanceof J3?o=e[Hk]:o=new J3(e)[Hk],!Grt(o.url)||o.method!=="GET")throw Ei.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=r[Hk];if(s.status===206)throw Ei.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=jXt(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Ei.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(W0s(s.body.stream)||s.body.stream.locked))throw Ei.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=Y0s(s),l=Cde();if(s.body!=null){let A=s.body.stream.getReader();X0s(A).then(l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Cde(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Ei.brandCheck(this,t);let n="Cache.delete";Ei.argumentLengthCheck(arguments,1,n),e=Ei.converters.RequestInfo(e,n,"request"),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e instanceof J3){if(o=e[Hk],o.method!=="GET"&&!r.ignoreMethod)return!1}else HXt(typeof e=="string"),o=new J3(e)[Hk];let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Cde(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Ei.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Ei.converters.RequestInfo(e,n,"request")),r=Ei.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(e instanceof J3){if(o=e[Hk],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new J3(e)[Hk]);let s=Cde(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=J0s(u,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);HXt(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!Grt(u.url))throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Ei.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);HXt(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!V0s(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=jXt(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(e instanceof J3){if(o=e[Hk],o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=new J3(e)[Hk]);let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=K0s(l,"immutable");if(c.push(u.clone()),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties($rt.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:mJ,matchAll:mJ,add:mJ,addAll:mJ,put:mJ,delete:mJ,keys:mJ});var TOn=[{key:"ignoreSearch",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Ei.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Ei.converters.CacheQueryOptions=Ei.dictionaryConverter(TOn);Ei.converters.MultiCacheQueryOptions=Ei.dictionaryConverter([...TOn,{key:"cacheName",converter:Ei.converters.DOMString}]);Ei.converters.Response=Ei.interfaceConverter(z0s);Ei.converters["sequence"]=Ei.sequenceConverter(Ei.converters.RequestInfo);IOn.exports={Cache:$rt}});var ROn=I((TWd,wOn)=>{"use strict";p();var{kConstruct:nRe}=Hrt(),{Cache:Vrt}=xOn(),{webidl:oE}=IA(),{kEnumerableProperty:iRe}=Os(),Wrt=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==nRe&&oE.illegalConstructor(),oE.util.markAsUncloneable(this)}async match(e,r={}){if(oE.brandCheck(this,t),oE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=oE.converters.RequestInfo(e),r=oE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Vrt(nRe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Vrt(nRe,n).match(e,r);if(s!==void 0)return s}}async has(e){oE.brandCheck(this,t);let r="CacheStorage.has";return oE.argumentLengthCheck(arguments,1,r),e=oE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){oE.brandCheck(this,t);let r="CacheStorage.open";if(oE.argumentLengthCheck(arguments,1,r),e=oE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Vrt(nRe,o)}let n=[];return this.#e.set(e,n),new Vrt(nRe,n)}async delete(e){oE.brandCheck(this,t);let r="CacheStorage.delete";return oE.argumentLengthCheck(arguments,1,r),e=oE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return oE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Wrt.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:iRe,has:iRe,open:iRe,delete:iRe,keys:iRe});wOn.exports={CacheStorage:Wrt}});var kOn=I((wWd,POn)=>{"use strict";p();POn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var GXt=I((PWd,BOn)=>{"use strict";p();function ems(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(ems,"isCTLExcludingHtab");function DOn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(DOn,"validateCookieName");function NOn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(NOn,"validateCookieValue");function MOn(t){for(let e=0;ee.toString().padStart(2,"0"));function OOn(t){return typeof t=="number"&&(t=new Date(t)),`${rms[t.getUTCDay()]}, ${zrt[t.getUTCDate()]} ${nms[t.getUTCMonth()]} ${t.getUTCFullYear()} ${zrt[t.getUTCHours()]}:${zrt[t.getUTCMinutes()]}:${zrt[t.getUTCSeconds()]} GMT`}a(OOn,"toIMFDate");function ims(t){if(t<0)throw new Error("Invalid cookie max-age")}a(ims,"validateCookieMaxAge");function oms(t){if(t.name.length===0)return null;DOn(t.name),NOn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(ims(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(tms(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(MOn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${OOn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(oms,"stringify");BOn.exports={isCTLExcludingHtab:ems,validateCookieName:DOn,validateCookiePath:MOn,validateCookieValue:NOn,toIMFDate:OOn,stringify:oms}});var FOn=I((NWd,LOn)=>{"use strict";p();var{maxNameValuePairSize:sms,maxAttributeValueSize:ams}=kOn(),{isCTLExcludingHtab:cms}=GXt(),{collectASequenceOfCodePointsFast:Yrt}=UC(),lms=require("node:assert");function ums(t){if(cms(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Yrt(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Yrt("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>sms?null:{name:n,value:o,...bde(r)}}a(ums,"parseSetCookie");function bde(t,e={}){if(t.length===0)return e;lms(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Yrt(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Yrt("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>ams)return bde(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return bde(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return bde(t,e)}a(bde,"parseUnparsedAttributes");LOn.exports={parseSetCookie:ums,parseUnparsedAttributes:bde}});var qOn=I((BWd,QOn)=>{"use strict";p();var{parseSetCookie:dms}=FOn(),{stringify:fms}=GXt(),{webidl:ca}=IA(),{Headers:Krt}=uJ();function pms(t){ca.argumentLengthCheck(arguments,1,"getCookies"),ca.brandCheck(t,Krt,{strict:!1});let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(pms,"getCookies");function hms(t,e,r){ca.brandCheck(t,Krt,{strict:!1});let n="deleteCookie";ca.argumentLengthCheck(arguments,2,n),e=ca.converters.DOMString(e,n,"name"),r=ca.converters.DeleteCookieAttributes(r),UOn(t,{name:e,value:"",expires:new Date(0),...r})}a(hms,"deleteCookie");function mms(t){ca.argumentLengthCheck(arguments,1,"getSetCookies"),ca.brandCheck(t,Krt,{strict:!1});let e=t.getSetCookie();return e?e.map(r=>dms(r)):[]}a(mms,"getSetCookies");function UOn(t,e){ca.argumentLengthCheck(arguments,2,"setCookie"),ca.brandCheck(t,Krt,{strict:!1}),e=ca.converters.Cookie(e);let r=fms(e);r&&t.append("Set-Cookie",r)}a(UOn,"setCookie");ca.converters.DeleteCookieAttributes=ca.dictionaryConverter([{converter:ca.nullableConverter(ca.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);ca.converters.Cookie=ca.dictionaryConverter([{converter:ca.converters.DOMString,key:"name"},{converter:ca.converters.DOMString,key:"value"},{converter:ca.nullableConverter(t=>typeof t=="number"?ca.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:ca.nullableConverter(ca.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:ca.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:ca.sequenceConverter(ca.converters.DOMString),key:"unparsed",defaultValue:a(()=>new Array(0),"defaultValue")}]);QOn.exports={getCookies:pms,deleteCookie:hms,getSetCookies:mms,setCookie:UOn}});var Tde=I((UWd,HOn)=>{"use strict";p();var{webidl:fi}=IA(),{kEnumerableProperty:HC}=Os(),{kConstruct:jOn}=Nd(),{MessagePort:gms}=require("node:worker_threads"),Sde=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===jOn){super(arguments[1],arguments[2]),fi.util.markAsUncloneable(this);return}let n="MessageEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get data(){return fi.brandCheck(this,t),this.#e.data}get origin(){return fi.brandCheck(this,t),this.#e.origin}get lastEventId(){return fi.brandCheck(this,t),this.#e.lastEventId}get source(){return fi.brandCheck(this,t),this.#e.source}get ports(){return fi.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return fi.brandCheck(this,t),fi.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(jOn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:Ams}=Sde;delete Sde.createFastMessageEvent;var Jrt=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";fi.argumentLengthCheck(arguments,1,n),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.CloseEventInit(r),super(e,r),this.#e=r,fi.util.markAsUncloneable(this)}get wasClean(){return fi.brandCheck(this,t),this.#e.wasClean}get code(){return fi.brandCheck(this,t),this.#e.code}get reason(){return fi.brandCheck(this,t),this.#e.reason}},Zrt=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";fi.argumentLengthCheck(arguments,1,n),super(e,r),fi.util.markAsUncloneable(this),e=fi.converters.DOMString(e,n,"type"),r=fi.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return fi.brandCheck(this,t),this.#e.message}get filename(){return fi.brandCheck(this,t),this.#e.filename}get lineno(){return fi.brandCheck(this,t),this.#e.lineno}get colno(){return fi.brandCheck(this,t),this.#e.colno}get error(){return fi.brandCheck(this,t),this.#e.error}};Object.defineProperties(Sde.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:HC,origin:HC,lastEventId:HC,source:HC,ports:HC,initMessageEvent:HC});Object.defineProperties(Jrt.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:HC,code:HC,wasClean:HC});Object.defineProperties(Zrt.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:HC,filename:HC,lineno:HC,colno:HC,error:HC});fi.converters.MessagePort=fi.interfaceConverter(gms);fi.converters["sequence"]=fi.sequenceConverter(fi.converters.MessagePort);var $Xt=[{key:"bubbles",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];fi.converters.MessageEventInit=fi.dictionaryConverter([...$Xt,{key:"data",converter:fi.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:fi.nullableConverter(fi.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:fi.converters["sequence"],defaultValue:a(()=>new Array(0),"defaultValue")}]);fi.converters.CloseEventInit=fi.dictionaryConverter([...$Xt,{key:"wasClean",converter:fi.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:fi.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);fi.converters.ErrorEventInit=fi.dictionaryConverter([...$Xt,{key:"message",converter:fi.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:fi.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:fi.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:fi.converters.any}]);HOn.exports={MessageEvent:Sde,CloseEvent:Jrt,ErrorEvent:Zrt,createFastMessageEvent:Ams}});var gJ=I((jWd,GOn)=>{"use strict";p();var yms="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",Ems={enumerable:!0,writable:!1,configurable:!1},_ms={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},vms={NOT_SENT:0,PROCESSING:1,SENT:2},Cms={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},bms=2**16-1,Sms={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},Tms=Buffer.allocUnsafe(0),Ims={string:1,typedArray:2,arrayBuffer:3,blob:4};GOn.exports={uid:yms,sentCloseFrameState:vms,staticPropertyDescriptors:Ems,states:_ms,opcodes:Cms,maxUnsigned16Bit:bms,parserStates:Sms,emptyBuffer:Tms,sendHints:Ims}});var oRe=I((GWd,$On)=>{"use strict";p();$On.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var cRe=I((VWd,e5n)=>{"use strict";p();var{kReadyState:sRe,kController:xms,kResponse:wms,kBinaryType:Rms,kWebSocketURL:Pms}=oRe(),{states:aRe,opcodes:Uq}=gJ(),{ErrorEvent:kms,createFastMessageEvent:Dms}=Tde(),{isUtf8:Nms}=require("node:buffer"),{collectASequenceOfCodePointsFast:Mms,removeHTTPWhitespace:VOn}=UC();function Oms(t){return t[sRe]===aRe.CONNECTING}a(Oms,"isConnecting");function Bms(t){return t[sRe]===aRe.OPEN}a(Bms,"isEstablished");function Lms(t){return t[sRe]===aRe.CLOSING}a(Lms,"isClosing");function Fms(t){return t[sRe]===aRe.CLOSED}a(Fms,"isClosed");function VXt(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(VXt,"fireEvent");function Ums(t,e,r){if(t[sRe]!==aRe.OPEN)return;let n;if(e===Uq.TEXT)try{n=XOn(r)}catch{zOn(t,"Received invalid UTF-8 in text frame.");return}else e===Uq.BINARY&&(t[Rms]==="blob"?n=new Blob([r]):n=Qms(r));VXt("message",t,Dms,{origin:t[Pms].origin,data:n})}a(Ums,"websocketMessageReceived");function Qms(t){return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}a(Qms,"toArrayBuffer");function qms(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(qms,"isValidSubprotocol");function jms(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(jms,"isValidStatusCode");function zOn(t,e){let{[xms]:r,[wms]:n}=t;r.abort(),n?.socket&&!n.socket.destroyed&&n.socket.destroy(),e&&VXt("error",t,(o,s)=>new kms(o,s),{error:new Error(e),message:e})}a(zOn,"failWebsocketConnection");function YOn(t){return t===Uq.CLOSE||t===Uq.PING||t===Uq.PONG}a(YOn,"isControlFrame");function KOn(t){return t===Uq.CONTINUATION}a(KOn,"isContinuationFrame");function JOn(t){return t===Uq.TEXT||t===Uq.BINARY}a(JOn,"isTextBinaryFrame");function Hms(t){return JOn(t)||KOn(t)||YOn(t)}a(Hms,"isValidOpcode");function Gms(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a($ms,"isValidClientWindowBits");var ZOn=typeof process.versions.icu=="string",WOn=ZOn?new TextDecoder("utf-8",{fatal:!0}):void 0,XOn=ZOn?WOn.decode.bind(WOn):function(t){if(Nms(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};e5n.exports={isConnecting:Oms,isEstablished:Bms,isClosing:Lms,isClosed:Fms,fireEvent:VXt,isValidSubprotocol:qms,isValidStatusCode:jms,failWebsocketConnection:zOn,websocketMessageReceived:Ums,utf8Decode:XOn,isControlFrame:YOn,isContinuationFrame:KOn,isTextBinaryFrame:JOn,isValidOpcode:Hms,parseExtensions:Gms,isValidClientWindowBits:$ms}});var ent=I((YWd,t5n)=>{"use strict";p();var{maxUnsigned16Bit:Vms}=gJ(),Xrt=16386,WXt,lRe=null,Ide=Xrt;try{WXt=require("node:crypto")}catch{WXt={randomFillSync:a(function(e,r,n){for(let o=0;oVms?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;u{"use strict";p();var{uid:zms,states:uRe,sentCloseFrameState:tnt,emptyBuffer:Yms,opcodes:Kms}=gJ(),{kReadyState:dRe,kSentClose:rnt,kByteParser:n5n,kReceivedClose:r5n,kResponse:i5n}=oRe(),{fireEvent:Jms,failWebsocketConnection:Qq,isClosing:Zms,isClosed:Xms,isEstablished:egs,parseExtensions:tgs}=cRe(),{channels:xde}=Fue(),{CloseEvent:rgs}=Tde(),{makeRequest:ngs}=Ede(),{fetching:igs}=tRe(),{Headers:ogs,getHeadersList:sgs}=uJ(),{getDecodeSplit:ags}=US(),{WebsocketFrameSend:cgs}=ent(),YXt;try{YXt=require("node:crypto")}catch{}function lgs(t,e,r,n,o,s){let c=t;c.protocol=t.protocol==="ws:"?"http:":"https:";let l=ngs({urlList:[c],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(s.headers){let h=sgs(new ogs(s.headers));l.headersList=h}let u=YXt.randomBytes(16).toString("base64");l.headersList.append("sec-websocket-key",u),l.headersList.append("sec-websocket-version","13");for(let h of e)l.headersList.append("sec-websocket-protocol",h);return l.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),igs({request:l,useParallelQueue:!0,dispatcher:s.dispatcher,processResponse(h){if(h.type==="error"||h.status!==101){Qq(n,"Received network error or non-101 status code.");return}if(e.length!==0&&!h.headersList.get("Sec-WebSocket-Protocol")){Qq(n,"Server did not respond with sent protocols.");return}if(h.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Qq(n,'Server did not set Upgrade header to "websocket".');return}if(h.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Qq(n,'Server did not set Connection header to "upgrade".');return}let m=h.headersList.get("Sec-WebSocket-Accept"),g=YXt.createHash("sha1").update(u+zms).digest("base64");if(m!==g){Qq(n,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let A=h.headersList.get("Sec-WebSocket-Extensions"),y;if(A!==null&&(y=tgs(A),!y.has("permessage-deflate"))){Qq(n,"Sec-WebSocket-Extensions header does not match.");return}let E=h.headersList.get("Sec-WebSocket-Protocol");if(E!==null&&!ags("sec-websocket-protocol",l.headersList).includes(E)){Qq(n,"Protocol was not set in the opening handshake.");return}h.socket.on("data",o5n),h.socket.on("close",s5n),h.socket.on("error",a5n),xde.open.hasSubscribers&&xde.open.publish({address:h.socket.address(),protocol:E,extensions:A}),o(h,y)}})}a(lgs,"establishWebSocketConnection");function ugs(t,e,r,n){if(!(Zms(t)||Xms(t)))if(!egs(t))Qq(t,"Connection was closed before it was established."),t[dRe]=uRe.CLOSING;else if(t[rnt]===tnt.NOT_SENT){t[rnt]=tnt.PROCESSING;let o=new cgs;e!==void 0&&r===void 0?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==void 0&&r!==void 0?(o.frameData=Buffer.allocUnsafe(2+n),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=Yms,t[i5n].socket.write(o.createFrame(Kms.CLOSE)),t[rnt]=tnt.SENT,t[dRe]=uRe.CLOSING}else t[dRe]=uRe.CLOSING}a(ugs,"closeWebSocketConnection");function o5n(t){this.ws[n5n].write(t)||this.pause()}a(o5n,"onSocketData");function s5n(){let{ws:t}=this,{[i5n]:e}=t;e.socket.off("data",o5n),e.socket.off("close",s5n),e.socket.off("error",a5n);let r=t[rnt]===tnt.SENT&&t[r5n],n=1005,o="",s=t[n5n].closingInfo;s&&!s.error?(n=s.code??1005,o=s.reason):t[r5n]||(n=1006),t[dRe]=uRe.CLOSED,Jms("close",t,(c,l)=>new rgs(c,l),{wasClean:r,code:n,reason:o}),xde.close.hasSubscribers&&xde.close.publish({websocket:t,code:n,reason:o})}a(s5n,"onSocketClose");function a5n(t){let{ws:e}=this;e[dRe]=uRe.CLOSING,xde.socketError.hasSubscribers&&xde.socketError.publish(t),this.destroy()}a(a5n,"onSocketError");c5n.exports={establishWebSocketConnection:lgs,closeWebSocketConnection:ugs}});var d5n=I((tzd,u5n)=>{"use strict";p();var{createInflateRaw:dgs,Z_DEFAULT_WINDOWBITS:fgs}=require("node:zlib"),{isValidClientWindowBits:pgs}=cRe(),{MessageSizeExceededError:l5n}=mc(),hgs=Buffer.from([0,0,255,255]),nnt=Symbol("kBuffer"),fRe=Symbol("kLength"),mgs=4*1024*1024,JXt=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new l5n);return}if(!this.#e){let o=fgs;if(this.#t.serverMaxWindowBits){if(!pgs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=dgs({windowBits:o})}catch(s){n(s);return}this.#e[nnt]=[],this.#e[fRe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[fRe]+=s.length,this.#e[fRe]>mgs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new l5n)}return}this.#e[nnt].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(hgs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[nnt],this.#e[fRe]);this.#e[nnt].length=0,this.#e[fRe]=0,this.#n=null,n(null,o)})}};u5n.exports={PerMessageDeflate:JXt}});var v5n=I((izd,_5n)=>{"use strict";p();var{Writable:ggs}=require("node:stream"),Ags=require("node:assert"),{parserStates:GC,opcodes:wde,states:ygs,emptyBuffer:f5n,sentCloseFrameState:p5n}=gJ(),{kReadyState:Egs,kSentClose:h5n,kResponse:m5n,kReceivedClose:g5n}=oRe(),{channels:int}=Fue(),{isValidStatusCode:_gs,isValidOpcode:vgs,failWebsocketConnection:VS,websocketMessageReceived:A5n,utf8Decode:Cgs,isControlFrame:y5n,isTextBinaryFrame:ZXt,isContinuationFrame:bgs}=cRe(),{WebsocketFrameSend:E5n}=ent(),{closeWebSocketConnection:Sgs}=KXt(),{PerMessageDeflate:Tgs}=d5n(),XXt=class extends ggs{static{a(this,"ByteParser")}#e=[];#t=0;#r=!1;#n=GC.INFO;#i={};#o=[];#s;constructor(e,r){super(),this.ws=e,this.#s=r??new Map,this.#s.has("permessage-deflate")&&this.#s.set("permessage-deflate",new Tgs(r))}_write(e,r,n){this.#e.push(e),this.#t+=e.length,this.#r=!0,this.run(n)}run(e){for(;this.#r;)if(this.#n===GC.INFO){if(this.#t<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==wde.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!vgs(o))return VS(this.ws,"Invalid opcode received"),e();if(s)return VS(this.ws,"Frame cannot be masked"),e();if(u!==0&&!this.#s.has("permessage-deflate")){VS(this.ws,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){VS(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!ZXt(o)){VS(this.ws,"Invalid frame type was fragmented.");return}if(ZXt(o)&&this.#o.length>0){VS(this.ws,"Expected continuation frame");return}if(this.#i.fragmented&&c){VS(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&y5n(o)){VS(this.ws,"Control frame either too large or fragmented");return}if(bgs(o)&&this.#o.length===0&&!this.#i.compressed){VS(this.ws,"Unexpected continuation frame");return}l<=125?(this.#i.payloadLength=l,this.#n=GC.READ_DATA):l===126?this.#n=GC.PAYLOADLENGTH_16:l===127&&(this.#n=GC.PAYLOADLENGTH_64),ZXt(o)&&(this.#i.binaryType=o,this.#i.compressed=u!==0),this.#i.opcode=o,this.#i.masked=s,this.#i.fin=n,this.#i.fragmented=c}else if(this.#n===GC.PAYLOADLENGTH_16){if(this.#t<2)return e();let r=this.consume(2);this.#i.payloadLength=r.readUInt16BE(0),this.#n=GC.READ_DATA}else if(this.#n===GC.PAYLOADLENGTH_64){if(this.#t<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){VS(this.ws,"Received payload length > 2^31 bytes.");return}this.#i.payloadLength=o,this.#n=GC.READ_DATA}else if(this.#n===GC.READ_DATA){if(this.#t{if(n){VS(this.ws,n.message);return}if(this.#o.push(o),!this.#i.fin){this.#n=GC.INFO,this.#r=!0,this.run(e);return}A5n(this.ws,this.#i.binaryType,Buffer.concat(this.#o)),this.#r=!0,this.#n=GC.INFO,this.#o.length=0,this.run(e)}),this.#r=!1;break}else{if(this.#o.push(r),!this.#i.fragmented&&this.#i.fin){let n=Buffer.concat(this.#o);A5n(this.ws,this.#i.binaryType,n),this.#o.length=0}this.#n=GC.INFO}}}consume(e){if(e>this.#t)throw new Error("Called consume() before buffers satiated.");if(e===0)return f5n;if(this.#e[0].length===e)return this.#t-=this.#e[0].length,this.#e.shift();let r=Buffer.allocUnsafe(e),n=0;for(;n!==e;){let o=this.#e[0],{length:s}=o;if(s+n===e){r.set(this.#e.shift(),n);break}else if(s+n>e){r.set(o.subarray(0,e-n),n),this.#e[0]=o.subarray(e-n);break}else r.set(this.#e.shift(),n),n+=o.length}return this.#t-=e,r}parseCloseBody(e){Ags(e.length!==1);let r;if(e.length>=2&&(r=e.readUInt16BE(0)),r!==void 0&&!_gs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=Cgs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#i;if(r===wde.CLOSE){if(n===1)return VS(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#i.closeInfo=this.parseCloseBody(e),this.#i.closeInfo.error){let{code:o,reason:s}=this.#i.closeInfo;return Sgs(this.ws,o,s,s.length),VS(this.ws,s),!1}if(this.ws[h5n]!==p5n.SENT){let o=f5n;this.#i.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#i.closeInfo.code,0));let s=new E5n(o);this.ws[m5n].socket.write(s.createFrame(wde.CLOSE),c=>{c||(this.ws[h5n]=p5n.SENT)})}return this.ws[Egs]=ygs.CLOSING,this.ws[g5n]=!0,!1}else if(r===wde.PING){if(!this.ws[g5n]){let o=new E5n(e);this.ws[m5n].socket.write(o.createFrame(wde.PONG)),int.ping.hasSubscribers&&int.ping.publish({payload:e})}}else r===wde.PONG&&int.pong.hasSubscribers&&int.pong.publish({payload:e});return!0}get closingInfo(){return this.#i.closeInfo}};_5n.exports={ByteParser:XXt}});var I5n=I((azd,T5n)=>{"use strict";p();var{WebsocketFrameSend:Igs}=ent(),{opcodes:C5n,sendHints:Rde}=gJ(),xgs=lZt(),b5n=Buffer[Symbol.species],eer=class{static{a(this,"SendQueue")}#e=new xgs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==Rde.blob){let s=S5n(e,n);if(!this.#t)this.#r.write(s,r);else{let c={promise:null,callback:r,frame:s};this.#e.push(c)}return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=S5n(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function S5n(t,e){return new Igs(wgs(t,e)).createFrame(e===Rde.string?C5n.TEXT:C5n.BINARY)}a(S5n,"createFrame");function wgs(t,e){switch(e){case Rde.string:return Buffer.from(t);case Rde.arrayBuffer:case Rde.blob:return new b5n(t);case Rde.typedArray:return new b5n(t.buffer,t.byteOffset,t.byteLength)}}a(wgs,"toBuffer");T5n.exports={SendQueue:eer}});var O5n=I((uzd,M5n)=>{"use strict";p();var{webidl:so}=IA(),{URLSerializer:Rgs}=UC(),{environmentSettingsObject:x5n}=US(),{staticPropertyDescriptors:qq,states:pRe,sentCloseFrameState:Pgs,sendHints:ont}=gJ(),{kWebSocketURL:w5n,kReadyState:ter,kController:kgs,kBinaryType:snt,kResponse:R5n,kSentClose:Dgs,kByteParser:Ngs}=oRe(),{isConnecting:Mgs,isEstablished:Ogs,isClosing:Bgs,isValidSubprotocol:Lgs,fireEvent:P5n}=cRe(),{establishWebSocketConnection:Fgs,closeWebSocketConnection:k5n}=KXt(),{ByteParser:Ugs}=v5n(),{kEnumerableProperty:iw,isBlobLike:D5n}=Os(),{getGlobalDispatcher:Qgs}=vrt(),{types:N5n}=require("node:util"),{ErrorEvent:qgs,CloseEvent:jgs}=Tde(),{SendQueue:Hgs}=I5n(),WS=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;constructor(e,r=[]){super(),so.util.markAsUncloneable(this);let n="WebSocket constructor";so.argumentLengthCheck(arguments,1,n);let o=so.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=so.converters.USVString(e,n,"url"),r=o.protocols;let s=x5n.settingsObject.baseUrl,c;try{c=new URL(e,s)}catch(u){throw new DOMException(u,"SyntaxError")}if(c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),c.protocol!=="ws:"&&c.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${c.protocol}`,"SyntaxError");if(c.hash||c.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>Lgs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[w5n]=new URL(c.href);let l=x5n.settingsObject;this[kgs]=Fgs(c,r,l,this,(u,d)=>this.#o(u,d),o),this[ter]=t.CONNECTING,this[Dgs]=Pgs.NOT_SENT,this[snt]="blob"}close(e=void 0,r=void 0){so.brandCheck(this,t);let n="WebSocket.close";if(e!==void 0&&(e=so.converters["unsigned short"](e,n,"code",{clamp:!0})),r!==void 0&&(r=so.converters.USVString(r,n,"reason")),e!==void 0&&e!==1e3&&(e<3e3||e>4999))throw new DOMException("invalid code","InvalidAccessError");let o=0;if(r!==void 0&&(o=Buffer.byteLength(r),o>123))throw new DOMException(`Reason must be less than 123 bytes; received ${o}`,"SyntaxError");k5n(this,e,r,o)}send(e){so.brandCheck(this,t);let r="WebSocket.send";if(so.argumentLengthCheck(arguments,1,r),e=so.converters.WebSocketSendData(e,r,"data"),Mgs(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Ogs(this)||Bgs(this)))if(typeof e=="string"){let n=Buffer.byteLength(e);this.#t+=n,this.#i.add(e,()=>{this.#t-=n},ont.string)}else N5n.isArrayBuffer(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},ont.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},ont.typedArray)):D5n(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},ont.blob))}get readyState(){return so.brandCheck(this,t),this[ter]}get bufferedAmount(){return so.brandCheck(this,t),this.#t}get url(){return so.brandCheck(this,t),Rgs(this[w5n])}get extensions(){return so.brandCheck(this,t),this.#n}get protocol(){return so.brandCheck(this,t),this.#r}get onopen(){return so.brandCheck(this,t),this.#e.open}set onopen(e){so.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onerror(){return so.brandCheck(this,t),this.#e.error}set onerror(e){so.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}get onclose(){return so.brandCheck(this,t),this.#e.close}set onclose(e){so.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof e=="function"?(this.#e.close=e,this.addEventListener("close",e)):this.#e.close=null}get onmessage(){return so.brandCheck(this,t),this.#e.message}set onmessage(e){so.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get binaryType(){return so.brandCheck(this,t),this[snt]}set binaryType(e){so.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this[snt]="blob":this[snt]=e}#o(e,r){this[R5n]=e;let n=new Ugs(this,r);n.on("drain",Ggs),n.on("error",$gs.bind(this)),e.socket.ws=this,this[Ngs]=n,this.#i=new Hgs(e.socket),this[ter]=pRe.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");s!==null&&(this.#r=s),P5n("open",this)}};WS.CONNECTING=WS.prototype.CONNECTING=pRe.CONNECTING;WS.OPEN=WS.prototype.OPEN=pRe.OPEN;WS.CLOSING=WS.prototype.CLOSING=pRe.CLOSING;WS.CLOSED=WS.prototype.CLOSED=pRe.CLOSED;Object.defineProperties(WS.prototype,{CONNECTING:qq,OPEN:qq,CLOSING:qq,CLOSED:qq,url:iw,readyState:iw,bufferedAmount:iw,onopen:iw,onerror:iw,onclose:iw,close:iw,onmessage:iw,binaryType:iw,send:iw,extensions:iw,protocol:iw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(WS,{CONNECTING:qq,OPEN:qq,CLOSING:qq,CLOSED:qq});so.converters["sequence"]=so.sequenceConverter(so.converters.DOMString);so.converters["DOMString or sequence"]=function(t,e,r){return so.util.Type(t)==="Object"&&Symbol.iterator in t?so.converters["sequence"](t):so.converters.DOMString(t,e,r)};so.converters.WebSocketInit=so.dictionaryConverter([{key:"protocols",converter:so.converters["DOMString or sequence"],defaultValue:a(()=>new Array(0),"defaultValue")},{key:"dispatcher",converter:so.converters.any,defaultValue:a(()=>Qgs(),"defaultValue")},{key:"headers",converter:so.nullableConverter(so.converters.HeadersInit)}]);so.converters["DOMString or sequence or WebSocketInit"]=function(t){return so.util.Type(t)==="Object"&&!(Symbol.iterator in t)?so.converters.WebSocketInit(t):{protocols:so.converters["DOMString or sequence"](t)}};so.converters.WebSocketSendData=function(t){if(so.util.Type(t)==="Object"){if(D5n(t))return so.converters.Blob(t,{strict:!1});if(ArrayBuffer.isView(t)||N5n.isArrayBuffer(t))return so.converters.BufferSource(t)}return so.converters.USVString(t)};function Ggs(){this.ws[R5n].socket.resume()}a(Ggs,"onParserDrain");function $gs(t){let e,r;t instanceof jgs?(e=t.reason,r=t.code):e=t.message,P5n("error",this,()=>new qgs("error",{error:t,message:e})),k5n(this,r)}a($gs,"onParserError");M5n.exports={WebSocket:WS}});var rer=I((pzd,B5n)=>{"use strict";p();function Vgs(t){return t.indexOf("\0")===-1}a(Vgs,"isValidLastEventId");function Wgs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(Wgs,"isASCIINumber");function zgs(t){return new Promise(e=>{setTimeout(e,t).unref()})}a(zgs,"delay");B5n.exports={isValidLastEventId:Vgs,isASCIINumber:Wgs,delay:zgs}});var Q5n=I((gzd,U5n)=>{"use strict";p();var{Transform:Ygs}=require("node:stream"),{isASCIINumber:L5n,isValidLastEventId:F5n}=rer(),Z3=[239,187,191],ner=10,ant=13,Kgs=58,Jgs=32,ier=class extends Ygs{static{a(this,"EventSourceStream")}state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===Z3[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===Z3[0]&&this.buffer[1]===Z3[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===Z3[0]&&this.buffer[1]===Z3[1]&&this.buffer[2]===Z3[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===Z3[0]&&this.buffer[1]===Z3[1]&&this.buffer[2]===Z3[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&L5n(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id&&F5n(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};U5n.exports={EventSourceStream:ier}});var z5n=I((Ezd,W5n)=>{"use strict";p();var{pipeline:Zgs}=require("node:stream"),{fetching:Xgs}=tRe(),{makeRequest:eAs}=Ede(),{webidl:X3}=IA(),{EventSourceStream:tAs}=Q5n(),{parseMIMEType:rAs}=UC(),{createFastMessageEvent:nAs}=Tde(),{isNetworkError:q5n}=Xwe(),{delay:iAs}=rer(),{kEnumerableProperty:AJ}=Os(),{environmentSettingsObject:j5n}=US(),H5n=!1,G5n=3e3,hRe=0,$5n=1,mRe=2,oAs="anonymous",sAs="use-credentials",Pde=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t=null;#r=!1;#n=hRe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),X3.util.markAsUncloneable(this);let n="EventSource constructor";X3.argumentLengthCheck(arguments,1,n),H5n||(H5n=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=X3.converters.USVString(e,n,"url"),r=X3.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.dispatcher,this.#a={lastEventId:"",reconnectionTime:G5n};let o=j5n,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=oAs;r.withCredentials&&(c=sAs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=j5n.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=eAs(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===mRe)return;this.#n=hRe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{q5n(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(q5n(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?rAs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=$5n,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new tAs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(nAs(u.type,u.options))},"push")});Zgs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=Xgs(e)}async#u(){this.#n!==mRe&&(this.#n=hRe,this.dispatchEvent(new Event("error")),await iAs(this.#a.reconnectionTime),this.#n===hRe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){X3.brandCheck(this,t),this.#n!==mRe&&(this.#n=mRe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof e=="function"?(this.#e.open=e,this.addEventListener("open",e)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof e=="function"?(this.#e.message=e,this.addEventListener("message",e)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof e=="function"?(this.#e.error=e,this.addEventListener("error",e)):this.#e.error=null}},V5n={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:hRe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:$5n,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:mRe,writable:!1}};Object.defineProperties(Pde,V5n);Object.defineProperties(Pde.prototype,V5n);Object.defineProperties(Pde.prototype,{close:AJ,onerror:AJ,onmessage:AJ,onopen:AJ,readyState:AJ,url:AJ,withCredentials:AJ});X3.converters.EventSourceInitDict=X3.dictionaryConverter([{key:"withCredentials",converter:X3.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:X3.converters.any}]);W5n.exports={EventSource:Pde,defaultReconnectionTime:G5n}});var Z5n=I((Czd,zi)=>{"use strict";p();var aAs=ide(),Y5n=Ewe(),cAs=ode(),lAs=V2n(),uAs=sde(),dAs=RZt(),fAs=gDn(),pAs=CDn(),K5n=mc(),lnt=Os(),{InvalidArgumentError:cnt}=K5n,kde=cNn(),hAs=vwe(),mAs=uXt(),gAs=GNn(),AAs=pXt(),yAs=JZt(),EAs=drt(),{getGlobalDispatcher:J5n,setGlobalDispatcher:_As}=vrt(),vAs=Crt(),CAs=ert(),bAs=trt();Object.assign(Y5n.prototype,kde);zi.exports.Dispatcher=Y5n;zi.exports.Client=aAs;zi.exports.Pool=cAs;zi.exports.BalancedPool=lAs;zi.exports.Agent=uAs;zi.exports.ProxyAgent=dAs;zi.exports.EnvHttpProxyAgent=fAs;zi.exports.RetryAgent=pAs;zi.exports.RetryHandler=EAs;zi.exports.DecoratorHandler=vAs;zi.exports.RedirectHandler=CAs;zi.exports.createRedirectInterceptor=bAs;zi.exports.interceptors={redirect:JNn(),retry:XNn(),dump:tMn(),dns:iMn()};zi.exports.buildConnector=hAs;zi.exports.errors=K5n;zi.exports.util={parseHeaders:lnt.parseHeaders,headerNameToString:lnt.headerNameToString};function gRe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new cnt("invalid url");if(r!=null&&typeof r!="object")throw new cnt("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new cnt("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(lnt.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=lnt.parseURL(e);let{agent:o,dispatcher:s=J5n()}=r;if(o)throw new cnt("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(gRe,"makeDispatcher");zi.exports.setGlobalDispatcher=_As;zi.exports.getGlobalDispatcher=J5n;var SAs=tRe().fetch;zi.exports.fetch=a(async function(e,r=void 0){try{return await SAs(e,r)}catch(n){throw n&&typeof n=="object"&&Error.captureStackTrace(n),n}},"fetch");zi.exports.Headers=uJ().Headers;zi.exports.Response=Xwe().Response;zi.exports.Request=Ede().Request;zi.exports.FormData=wwe().FormData;zi.exports.File=globalThis.File??require("node:buffer").File;zi.exports.FileReader=_On().FileReader;var{setGlobalOrigin:TAs,getGlobalOrigin:IAs}=PJt();zi.exports.setGlobalOrigin=TAs;zi.exports.getGlobalOrigin=IAs;var{CacheStorage:xAs}=ROn(),{kConstruct:wAs}=Hrt();zi.exports.caches=new xAs(wAs);var{deleteCookie:RAs,getCookies:PAs,getSetCookies:kAs,setCookie:DAs}=qOn();zi.exports.deleteCookie=RAs;zi.exports.getCookies=PAs;zi.exports.getSetCookies=kAs;zi.exports.setCookie=DAs;var{parseMIMEType:NAs,serializeAMimeType:MAs}=UC();zi.exports.parseMIMEType=NAs;zi.exports.serializeAMimeType=MAs;var{CloseEvent:OAs,ErrorEvent:BAs,MessageEvent:LAs}=Tde();zi.exports.WebSocket=O5n().WebSocket;zi.exports.CloseEvent=OAs;zi.exports.ErrorEvent=BAs;zi.exports.MessageEvent=LAs;zi.exports.request=gRe(kde.request);zi.exports.stream=gRe(kde.stream);zi.exports.pipeline=gRe(kde.pipeline);zi.exports.connect=gRe(kde.connect);zi.exports.upgrade=gRe(kde.upgrade);zi.exports.MockClient=mAs;zi.exports.MockPool=AAs;zi.exports.MockAgent=gAs;zi.exports.mockErrors=yAs;var{EventSource:FAs}=z5n();zi.exports.EventSource=FAs});var us=I((Tzd,X5n)=>{p();X5n.exports={options:{usePureJavaScript:!1}}});var r4n=I((xzd,t4n)=>{p();var oer={};t4n.exports=oer;var e4n={};oer.encode=function(t,e,r){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(t instanceof Uint8Array))n=UAs(t,e);else{var o=0,s=e.length,c=e.charAt(0),l=[0];for(o=0;o0;)l.push(d%s),d=d/s|0}for(o=0;t[o]===0&&o=0;--o)n+=e[l[o]]}if(r){var f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r +`)}return n};oer.decode=function(t,e){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var r=e4n[e];if(!r){r=e4n[e]=[];for(var n=0;n>=8;for(;d>0;)c.push(d&255),d>>=8}for(var f=0;t[f]===s&&f0;)s.push(l%n),l=l/n|0}var u="";for(r=0;t.at(r)===0&&r=0;--r)u+=e[s[r]];return u}a(UAs,"_encodeWithByteBuffer")});var ic=I((Pzd,s4n)=>{p();var n4n=us(),i4n=r4n(),rt=s4n.exports=n4n.util=n4n.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){rt.nextTick=process.nextTick,typeof setImmediate=="function"?rt.setImmediate=setImmediate:rt.setImmediate=rt.nextTick;return}if(typeof setImmediate=="function"){rt.setImmediate=function(){return setImmediate.apply(void 0,arguments)},rt.nextTick=function(l){return setImmediate(l)};return}if(rt.setImmediate=function(l){setTimeout(l,0)},typeof window<"u"&&typeof window.postMessage=="function"){let l=function(u){if(u.source===window&&u.data===t){u.stopPropagation();var d=e.slice();e.length=0,d.forEach(function(f){f()})}};var c=l;a(l,"handler");var t="forge.setImmediate",e=[];rt.setImmediate=function(u){e.push(u),e.length===1&&window.postMessage(t,"*")},window.addEventListener("message",l,!0)}if(typeof MutationObserver<"u"){var r=Date.now(),n=!0,o=document.createElement("div"),e=[];new MutationObserver(function(){var u=e.slice();e.length=0,u.forEach(function(d){d()})}).observe(o,{attributes:!0});var s=rt.setImmediate;rt.setImmediate=function(u){Date.now()-r>15?(r=Date.now(),s(u)):(e.push(u),e.length===1&&o.setAttribute("a",n=!n))}}rt.nextTick=rt.setImmediate})();rt.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;rt.globalScope=(function(){return rt.isNodejs?global:typeof self>"u"?window:self})();rt.isArray=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};rt.isArrayBuffer=function(t){return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer};rt.isArrayBufferView=function(t){return t&&rt.isArrayBuffer(t.buffer)&&t.byteLength!==void 0};function ARe(t){if(!(t===8||t===16||t===24||t===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}a(ARe,"_checkBitsParam");rt.ByteBuffer=ser;function ser(t){if(this.data="",this.read=0,typeof t=="string")this.data=t;else if(rt.isArrayBuffer(t)||rt.isArrayBufferView(t))if(typeof Buffer<"u"&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var r=0;rQAs&&(this.data.substr(0,1),this._constructedStringLength=0)};rt.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};rt.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};rt.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))};rt.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this};rt.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this};rt.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(rt.encodeUtf8(t))};rt.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};rt.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};rt.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255))};rt.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255))};rt.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))};rt.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(t&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))};rt.ByteStringBuffer.prototype.putInt=function(t,e){ARe(e);var r="";do e-=8,r+=String.fromCharCode(t>>e&255);while(e>0);return this.putBytes(r)};rt.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e};rt.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};rt.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};rt.ByteStringBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};rt.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)};rt.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this};rt.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};rt.ByteStringBuffer.prototype.copy=function(){var t=rt.createBuffer(this.data);return t.read=this.read,t};rt.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};rt.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};rt.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this};rt.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this};rt.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this};rt.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this};rt.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this};rt.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this};rt.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this};rt.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this};rt.DataBuffer.prototype.putInt=function(t,e){ARe(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,t>>e&255);while(e>0);return this};rt.DataBuffer.prototype.putSignedInt=function(t,e){return ARe(e),this.accommodate(e/8),t<0&&(t+=2<0);return e};rt.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e};rt.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):t===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};rt.DataBuffer.prototype.bytes=function(t){return typeof t>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+t)};rt.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)};rt.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this};rt.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};rt.DataBuffer.prototype.copy=function(){return new rt.DataBuffer(this)};rt.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};rt.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};rt.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this};rt.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)e&1&&(r+=t),e>>>=1,e>0&&(t+=t);return r};rt.xorBytes=function(t,e,r){for(var n="",o="",s="",c=0,l=0;r>0;--r,++c)o=t.charCodeAt(c)^e.charCodeAt(c),l>=10&&(n+=s,s="",l=0),s+=String.fromCharCode(o),++l;return n+=s,n};rt.hexToBytes=function(t){var e="",r=0;for(t.length&!0&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(t&255)};var jq="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Hq=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],o4n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";rt.encode64=function(t,e){for(var r="",n="",o,s,c,l=0;l>2),r+=jq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=jq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":jq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};rt.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,o,s,c=0;c>4),o!==64&&(e+=String.fromCharCode((n&15)<<4|o>>2),s!==64&&(e+=String.fromCharCode((o&3)<<6|s)));return e};rt.encodeUtf8=function(t){return unescape(encodeURIComponent(t))};rt.decodeUtf8=function(t){return decodeURIComponent(escape(t))};rt.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i4n.encode,decode:i4n.decode}};rt.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)};rt.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s>2),r+=jq.charAt((o&3)<<4|s>>4),isNaN(s)?r+="==":(r+=jq.charAt((s&15)<<2|c>>6),r+=isNaN(c)?"=":jq.charAt(c&63)),e&&r.length>e&&(n+=r.substr(0,e)+`\r +`,r=r.substr(e));return n+=r,n};rt.binary.base64.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/4)*3)),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),r=r||0;for(var o,s,c,l,u=0,d=r;u>4,c!==64&&(n[d++]=(s&15)<<4|c>>2,l!==64&&(n[d++]=(c&3)<<6|l));return e?d-r:n.subarray(0,d)};rt.binary.base58.encode=function(t,e){return rt.binary.baseN.encode(t,o4n,e)};rt.binary.base58.decode=function(t,e){return rt.binary.baseN.decode(t,o4n,e)};rt.text={utf8:{},utf16:{}};rt.text.utf8.encode=function(t,e,r){t=rt.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length)),r=r||0;for(var o=r,s=0;s"u"&&(r=["web","flash"]);var o,s=!1,c=null;for(var l in r){o=r[l];try{if(o==="flash"||o==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=t.apply(this,e),s=o==="flash"}(o==="web"||o==="both")&&(e[0]=localStorage,n=t.apply(this,e),s=!0)}catch(u){c=u}if(s)break}if(!s)throw c;return n},"_callStorageFunction");rt.setItem=function(t,e,r,n,o){unt(jAs,arguments,o)};rt.getItem=function(t,e,r,n){return unt(HAs,arguments,n)};rt.removeItem=function(t,e,r,n){unt(GAs,arguments,n)};rt.clearItems=function(t,e,r){unt($As,arguments,r)};rt.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0};rt.format=function(t){for(var e=/%./g,r,n,o=0,s=[],c=0;r=e.exec(t);){n=t.substring(c,e.lastIndex-2),n.length>0&&s.push(n),c=e.lastIndex;var l=r[0][1];switch(l){case"s":case"o":o");break;case"%":s.push("%");break;default:s.push("<%"+l+"?>")}}return s.push(t.substring(c)),s.join("")};rt.formatNumber=function(t,e,r,n){var o=t,s=isNaN(e=Math.abs(e))?2:e,c=r===void 0?",":r,l=n===void 0?".":n,u=o<0?"-":"",d=parseInt(o=Math.abs(+o||0).toFixed(s),10)+"",f=d.length>3?d.length%3:0;return u+(f?d.substr(0,f)+l:"")+d.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+l)+(s?c+Math.abs(o-d).toFixed(s).slice(2):"")};rt.formatSize=function(t){return t>=1073741824?t=rt.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?t=rt.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?t=rt.formatNumber(t/1024,0)+" KiB":t=rt.formatNumber(t,0)+" bytes",t};rt.bytesFromIP=function(t){return t.indexOf(".")!==-1?rt.bytesFromIPv4(t):t.indexOf(":")!==-1?rt.bytesFromIPv6(t):null};rt.bytesFromIPv4=function(t){if(t=t.split("."),t.length!==4)return null;for(var e=rt.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1))}e.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(e.splice(u.start,u.end-u.start+1,""),u.start===0&&e.unshift(""),u.end===7&&e.push(""))}return e.join(":")};rt.estimateCores=function(t,e){if(typeof t=="function"&&(e=t,t={}),t=t||{},"cores"in rt&&!t.update)return e(null,rt.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return rt.cores=navigator.hardwareConcurrency,e(null,rt.cores);if(typeof Worker>"u")return rt.cores=1,e(null,rt.cores);if(typeof Blob>"u")return rt.cores=2,e(null,rt.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(c){for(var l=Date.now(),u=l+4;Date.now()g.st&&f.stf.st&&g.st{p();var pg=us();ic();a4n.exports=pg.cipher=pg.cipher||{};pg.cipher.algorithms=pg.cipher.algorithms||{};pg.cipher.createCipher=function(t,e){var r=t;if(typeof r=="string"&&(r=pg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new pg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})};pg.cipher.createDecipher=function(t,e){var r=t;if(typeof r=="string"&&(r=pg.cipher.getAlgorithm(r),r&&(r=r())),!r)throw new Error("Unsupported algorithm: "+t);return new pg.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})};pg.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),pg.cipher.algorithms[t]=e};pg.cipher.getAlgorithm=function(t){return t=t.toUpperCase(),t in pg.cipher.algorithms?pg.cipher.algorithms[t]:null};var ler=pg.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};ler.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=pg.util.createBuffer(),this.output=t.output||pg.util.createBuffer(),this.mode.start(e)};ler.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};ler.prototype.finish=function(t){t&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(r){return t(this.blockSize,r,!1)},this.mode.unpad=function(r){return t(this.blockSize,r,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var der=I((Ozd,c4n)=>{p();var hg=us();ic();hg.cipher=hg.cipher||{};var Vs=c4n.exports=hg.cipher.modes=hg.cipher.modes||{};Vs.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Vs.ecb.prototype.start=function(t){};Vs.ecb.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Vs.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Vs.cbc.prototype.start=function(t){if(t.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in t)this._iv=fnt(t.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Vs.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return n>this.blockSize<<2?!1:(t.truncate(n),!0)};Vs.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=hg.util.createBuffer(),this._partialBytes=0};Vs.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=fnt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Vs.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Vs.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Vs.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=hg.util.createBuffer(),this._partialBytes=0};Vs.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=fnt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Vs.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(t.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0)t.read-=this.blockSize;else for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Vs.ofb.prototype.decrypt=Vs.ofb.prototype.encrypt;Vs.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=hg.util.createBuffer(),this._partialBytes=0};Vs.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=fnt(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Vs.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}pnt(this._inBlock)};Vs.ctr.prototype.decrypt=Vs.ctr.prototype.encrypt;Vs.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=hg.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Vs.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e=hg.util.createBuffer(t.iv);this._cipherLength=0;var r;if("additionalData"in t?r=hg.util.createBuffer(t.additionalData):r=hg.util.createBuffer(),"tagLength"in t?this._tagLength=t.tagLength:this._tagLength=128,this._tag=null,t.decrypt&&(this._tag=hg.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(uer(n*8)))}this._inBlock=this._j0.slice(0),pnt(this._inBlock),this._partialBytes=0,r=hg.util.createBuffer(r),this._aDataLength=uer(r.length()*8);var o=r.length()%this.blockSize;for(o&&r.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];r.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()])};Vs.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var o=0;o0&&(s=this.blockSize-s),this._partialOutput.clear();for(var o=0;o0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),pnt(this._inBlock)};Vs.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),pnt(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)e[n]=t[n]>>>1|(t[n-1]&1)<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)};Vs.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=r/8|0,o=t[n]>>>(7-r%8)*4&15,s=this._m[r][o];e[0]^=s[0],e[1]^=s[1],e[2]^=s[2],e[3]^=s[3]}return e};Vs.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)};Vs.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,o=16*r,s=new Array(o),c=0;c>>1,o=new Array(r);o[n]=t.slice(0);for(var s=n>>>1;s>0;)this.pow(o[2*s],o[s]=[]),s>>=1;for(s=2;s4){var r=t;t=hg.util.createBuffer();for(var n=0;n{p();var yu=us();dnt();der();ic();f4n.exports=yu.aes=yu.aes||{};yu.aes.startEncrypting=function(t,e,r,n){var o=hnt({key:t,output:r,decrypt:!1,mode:n});return o.start(e),o};yu.aes.createEncryptionCipher=function(t,e){return hnt({key:t,output:null,decrypt:!1,mode:e})};yu.aes.startDecrypting=function(t,e,r,n){var o=hnt({key:t,output:r,decrypt:!0,mode:n});return o.start(e),o};yu.aes.createDecryptionCipher=function(t,e){return hnt({key:t,output:null,decrypt:!0,mode:e})};yu.aes.Algorithm=function(t,e){her||u4n();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:a(function(n,o){return per(r._w,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return per(r._w,n,o,!0)},"decrypt")}}),r._init=!1};yu.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e=t.key,r;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=yu.util.createBuffer(e);else if(yu.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){r=e,e=yu.util.createBuffer();for(var n=0;n>>2;for(var n=0;n>8^l&255^99,q_[r]=l,fer[l]=r,u=t[l],o=t[r],s=t[o],c=t[s],d=u<<24^l<<16^l<<8^(l^u),f=(o^s^c)<<24^(r^c)<<16^(r^s^c)<<8^(r^o^c);for(var h=0;h<4;++h)yJ[h][r]=d,Gk[h][l]=f,d=d<<24|d>>>8,f=f<<24|f>>>8;r===0?r=n=1:(r=o^t[t[t[o^c]]],n^=t[t[n]])}}a(u4n,"initialize");function d4n(t,e){for(var r=t.slice(0),n,o=1,s=r.length,c=s+6+1,l=Dde*c,u=s;u>>16&255]<<24^q_[n>>>8&255]<<16^q_[n&255]<<8^q_[n>>>24]^l4n[o]<<24,o++):s>6&&u%s===4&&(n=q_[n>>>24]<<24^q_[n>>>16&255]<<16^q_[n>>>8&255]<<8^q_[n&255]),r[u]=r[u-s]^n;if(e){var d,f=Gk[0],h=Gk[1],m=Gk[2],g=Gk[3],A=r.slice(0);l=r.length;for(var u=0,y=l-Dde;u>>24]]^h[q_[d>>>16&255]]^m[q_[d>>>8&255]]^g[q_[d&255]];r=A}return r}a(d4n,"_expandKey");function per(t,e,r,n){var o=t.length/4-1,s,c,l,u,d;n?(s=Gk[0],c=Gk[1],l=Gk[2],u=Gk[3],d=fer):(s=yJ[0],c=yJ[1],l=yJ[2],u=yJ[3],d=q_);var f,h,m,g,A,y,E;f=e[0]^t[0],h=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,v=1;v>>24]^c[h>>>16&255]^l[m>>>8&255]^u[g&255]^t[++_],y=s[h>>>24]^c[m>>>16&255]^l[g>>>8&255]^u[f&255]^t[++_],E=s[m>>>24]^c[g>>>16&255]^l[f>>>8&255]^u[h&255]^t[++_],g=s[g>>>24]^c[f>>>16&255]^l[h>>>8&255]^u[m&255]^t[++_],f=A,h=y,m=E;r[0]=d[f>>>24]<<24^d[h>>>16&255]<<16^d[m>>>8&255]<<8^d[g&255]^t[++_],r[n?3:1]=d[h>>>24]<<24^d[m>>>16&255]<<16^d[g>>>8&255]<<8^d[f&255]^t[++_],r[2]=d[m>>>24]<<24^d[g>>>16&255]<<16^d[f>>>8&255]<<8^d[h&255]^t[++_],r[n?1:3]=d[g>>>24]<<24^d[f>>>16&255]<<16^d[h>>>8&255]<<8^d[m&255]^t[++_]}a(per,"_updateBlock");function hnt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="AES-"+e,n;t.decrypt?n=yu.cipher.createDecipher(r,t.key):n=yu.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof yu.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(hnt,"_createCipher")});var $q=I((qzd,p4n)=>{p();var yRe=us();yRe.pki=yRe.pki||{};var mer=p4n.exports=yRe.pki.oids=yRe.oids=yRe.oids||{};function rr(t,e){mer[t]=e,mer[e]=t}a(rr,"_IN");function Bc(t,e){mer[t]=e}a(Bc,"_I_");rr("1.2.840.113549.1.1.1","rsaEncryption");rr("1.2.840.113549.1.1.4","md5WithRSAEncryption");rr("1.2.840.113549.1.1.5","sha1WithRSAEncryption");rr("1.2.840.113549.1.1.7","RSAES-OAEP");rr("1.2.840.113549.1.1.8","mgf1");rr("1.2.840.113549.1.1.9","pSpecified");rr("1.2.840.113549.1.1.10","RSASSA-PSS");rr("1.2.840.113549.1.1.11","sha256WithRSAEncryption");rr("1.2.840.113549.1.1.12","sha384WithRSAEncryption");rr("1.2.840.113549.1.1.13","sha512WithRSAEncryption");rr("1.3.101.112","EdDSA25519");rr("1.2.840.10040.4.3","dsa-with-sha1");rr("1.3.14.3.2.7","desCBC");rr("1.3.14.3.2.26","sha1");rr("1.3.14.3.2.29","sha1WithRSASignature");rr("2.16.840.1.101.3.4.2.1","sha256");rr("2.16.840.1.101.3.4.2.2","sha384");rr("2.16.840.1.101.3.4.2.3","sha512");rr("2.16.840.1.101.3.4.2.4","sha224");rr("2.16.840.1.101.3.4.2.5","sha512-224");rr("2.16.840.1.101.3.4.2.6","sha512-256");rr("1.2.840.113549.2.2","md2");rr("1.2.840.113549.2.5","md5");rr("1.2.840.113549.1.7.1","data");rr("1.2.840.113549.1.7.2","signedData");rr("1.2.840.113549.1.7.3","envelopedData");rr("1.2.840.113549.1.7.4","signedAndEnvelopedData");rr("1.2.840.113549.1.7.5","digestedData");rr("1.2.840.113549.1.7.6","encryptedData");rr("1.2.840.113549.1.9.1","emailAddress");rr("1.2.840.113549.1.9.2","unstructuredName");rr("1.2.840.113549.1.9.3","contentType");rr("1.2.840.113549.1.9.4","messageDigest");rr("1.2.840.113549.1.9.5","signingTime");rr("1.2.840.113549.1.9.6","counterSignature");rr("1.2.840.113549.1.9.7","challengePassword");rr("1.2.840.113549.1.9.8","unstructuredAddress");rr("1.2.840.113549.1.9.14","extensionRequest");rr("1.2.840.113549.1.9.20","friendlyName");rr("1.2.840.113549.1.9.21","localKeyId");rr("1.2.840.113549.1.9.22.1","x509Certificate");rr("1.2.840.113549.1.12.10.1.1","keyBag");rr("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");rr("1.2.840.113549.1.12.10.1.3","certBag");rr("1.2.840.113549.1.12.10.1.4","crlBag");rr("1.2.840.113549.1.12.10.1.5","secretBag");rr("1.2.840.113549.1.12.10.1.6","safeContentsBag");rr("1.2.840.113549.1.5.13","pkcs5PBES2");rr("1.2.840.113549.1.5.12","pkcs5PBKDF2");rr("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");rr("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");rr("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");rr("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");rr("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");rr("1.2.840.113549.2.7","hmacWithSHA1");rr("1.2.840.113549.2.8","hmacWithSHA224");rr("1.2.840.113549.2.9","hmacWithSHA256");rr("1.2.840.113549.2.10","hmacWithSHA384");rr("1.2.840.113549.2.11","hmacWithSHA512");rr("1.2.840.113549.3.7","des-EDE3-CBC");rr("2.16.840.1.101.3.4.1.2","aes128-CBC");rr("2.16.840.1.101.3.4.1.22","aes192-CBC");rr("2.16.840.1.101.3.4.1.42","aes256-CBC");rr("2.5.4.3","commonName");rr("2.5.4.4","surname");rr("2.5.4.5","serialNumber");rr("2.5.4.6","countryName");rr("2.5.4.7","localityName");rr("2.5.4.8","stateOrProvinceName");rr("2.5.4.9","streetAddress");rr("2.5.4.10","organizationName");rr("2.5.4.11","organizationalUnitName");rr("2.5.4.12","title");rr("2.5.4.13","description");rr("2.5.4.15","businessCategory");rr("2.5.4.17","postalCode");rr("2.5.4.42","givenName");rr("2.5.4.65","pseudonym");rr("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");rr("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");rr("2.16.840.1.113730.1.1","nsCertType");rr("2.16.840.1.113730.1.13","nsComment");Bc("2.5.29.1","authorityKeyIdentifier");Bc("2.5.29.2","keyAttributes");Bc("2.5.29.3","certificatePolicies");Bc("2.5.29.4","keyUsageRestriction");Bc("2.5.29.5","policyMapping");Bc("2.5.29.6","subtreesConstraint");Bc("2.5.29.7","subjectAltName");Bc("2.5.29.8","issuerAltName");Bc("2.5.29.9","subjectDirectoryAttributes");Bc("2.5.29.10","basicConstraints");Bc("2.5.29.11","nameConstraints");Bc("2.5.29.12","policyConstraints");Bc("2.5.29.13","basicConstraints");rr("2.5.29.14","subjectKeyIdentifier");rr("2.5.29.15","keyUsage");Bc("2.5.29.16","privateKeyUsagePeriod");rr("2.5.29.17","subjectAltName");rr("2.5.29.18","issuerAltName");rr("2.5.29.19","basicConstraints");Bc("2.5.29.20","cRLNumber");Bc("2.5.29.21","cRLReason");Bc("2.5.29.22","expirationDate");Bc("2.5.29.23","instructionCode");Bc("2.5.29.24","invalidityDate");Bc("2.5.29.25","cRLDistributionPoints");Bc("2.5.29.26","issuingDistributionPoint");Bc("2.5.29.27","deltaCRLIndicator");Bc("2.5.29.28","issuingDistributionPoint");Bc("2.5.29.29","certificateIssuer");Bc("2.5.29.30","nameConstraints");rr("2.5.29.31","cRLDistributionPoints");rr("2.5.29.32","certificatePolicies");Bc("2.5.29.33","policyMappings");Bc("2.5.29.34","policyConstraints");rr("2.5.29.35","authorityKeyIdentifier");Bc("2.5.29.36","policyConstraints");rr("2.5.29.37","extKeyUsage");Bc("2.5.29.46","freshestCRL");Bc("2.5.29.54","inhibitAnyPolicy");rr("1.3.6.1.4.1.11129.2.4.2","timestampList");rr("1.3.6.1.5.5.7.1.1","authorityInfoAccess");rr("1.3.6.1.5.5.7.3.1","serverAuth");rr("1.3.6.1.5.5.7.3.2","clientAuth");rr("1.3.6.1.5.5.7.3.3","codeSigning");rr("1.3.6.1.5.5.7.3.4","emailProtection");rr("1.3.6.1.5.5.7.3.8","timeStamping")});var $k=I((Gzd,m4n)=>{p();var ed=us();ic();$q();var rn=m4n.exports=ed.asn1=ed.asn1||{};rn.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};rn.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};rn.maxDepth=256;rn.create=function(t,e,r,n,o){if(ed.util.isArray(n)){for(var s=[],c=0;ce){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}a(ERe,"_checkBufferLength");var VAs=a(function(t,e){var r=t.getByte();if(e--,r!==128){var n,o=r&128;if(!o)n=r;else{var s=r&127;ERe(t,e,s),n=t.getInt(s<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");rn.fromDer=function(t,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"maxDepth"in e||(e.maxDepth=rn.maxDepth),typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.length(),n=mnt(t,t.length(),0,e);if(e.parseAllBytes&&t.length()!==0){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=t.length(),o}return n};function mnt(t,e,r,n){if(r>=n.maxDepth)throw new Error("ASN.1 parsing error: Max depth exceeded.");var o;ERe(t,e,2);var s=t.getByte();e--;var c=s&192,l=s&31;o=t.length();var u=VAs(t,e);if(e-=o-t.length(),u!==void 0&&u>e){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=t.length(),d.remaining=e,d.requested=u,d}u=e}var f,h,m=(s&32)===32;if(m)if(f=[],u===void 0)for(;;){if(ERe(t,e,2),t.bytes(2)==="\0\0"){t.getBytes(2),e-=2;break}o=t.length(),f.push(mnt(t,e,r+1,n)),e-=o-t.length()}else for(;u>0;)o=t.length(),f.push(mnt(t,u,r+1,n)),e-=o-t.length(),u-=o-t.length();if(f===void 0&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&(h=t.bytes(u)),f===void 0&&n.decodeBitStrings&&c===rn.Class.UNIVERSAL&&l===rn.Type.BITSTRING&&u>1){var g=t.read,A=e,y=0;if(l===rn.Type.BITSTRING&&(ERe(t,e,1),y=t.getByte(),e--),y===0)try{o=t.length();var E={strict:!0,decodeBitStrings:!0},_=mnt(t,e,r+1,E),v=o-t.length();e-=v,l==rn.Type.BITSTRING&&v++;var b=_.tagClass;v===u&&(b===rn.Class.UNIVERSAL||b===rn.Class.CONTEXT_SPECIFIC)&&(f=[_])}catch{}f===void 0&&(t.read=g,e=A)}if(f===void 0){if(u===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");u=e}if(l===rn.Type.BMPSTRING)for(f="";u>0;u-=2)ERe(t,e,2),f+=String.fromCharCode(t.getInt16()),e-=2;else f=t.getBytes(u),e-=u}var T=h===void 0?null:{bitStringContents:h};return rn.create(c,l,m,f,T)}a(mnt,"_fromDer");rn.toDer=function(t){var e=ed.util.createBuffer(),r=t.tagClass|t.type,n=ed.util.createBuffer(),o=!1;if("bitStringContents"in t&&(o=!0,t.original&&(o=rn.equals(t,t.original))),o)n.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:n.putByte(0);for(var s=0;s1&&(t.value.charCodeAt(0)===0&&(t.value.charCodeAt(1)&128)===0||t.value.charCodeAt(0)===255&&(t.value.charCodeAt(1)&128)===128)?n.putBytes(t.value.substr(1)):n.putBytes(t.value);if(e.putByte(r),n.length()<=127)e.putByte(n.length()&127);else{var c=n.length(),l="";do l+=String.fromCharCode(c&255),c=c>>>8;while(c>0);e.putByte(l.length|128);for(var s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(n),e};rn.oidToDer=function(t){var e=t.split("."),r=ed.util.createBuffer();r.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,o,s,c,l=2;l4294967295)throw new Error("OID value too large; max is 32-bits.");do c=s&127,s=s>>>7,n||(c|=128),o.push(c),n=!1;while(s>0);for(var u=o.length-1;u>=0;--u)r.putByte(o[u])}return r};rn.derToOid=function(t){var e;typeof t=="string"&&(t=ed.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var n=0;t.length()>0;){if(n>70368744177663)throw new Error("OID value too large; max is 53-bits.");r=t.getByte(),n=n*128,r&128?n+=r&127:(e+="."+(n+r),n=0)}return e};rn.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,o=parseInt(t.substr(4,2),10),s=parseInt(t.substr(6,2),10),c=parseInt(t.substr(8,2),10),l=0;if(t.length>11){var u=t.charAt(10),d=10;u!=="+"&&u!=="-"&&(l=parseInt(t.substr(10,2),10),d+=2)}if(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,0),d&&(u=t.charAt(d),u==="+"||u==="-")){var f=parseInt(t.substr(d+1,2),10),h=parseInt(t.substr(d+4,2),10),m=f*60+h;m*=6e4,u==="+"?e.setTime(+e-m):e.setTime(+e+m)}return e};rn.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,o=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),c=parseInt(t.substr(10,2),10),l=parseInt(t.substr(12,2),10),u=0,d=0,f=!1;t.charAt(t.length-1)==="Z"&&(f=!0);var h=t.length-5,m=t.charAt(h);if(m==="+"||m==="-"){var g=parseInt(t.substr(h+1,2),10),A=parseInt(t.substr(h+4,2),10);d=g*60+A,d*=6e4,m==="+"&&(d*=-1),f=!0}return t.charAt(14)==="."&&(u=parseFloat(t.substr(14),10)*1e3),f?(e.setUTCFullYear(r,n,o),e.setUTCHours(s,c,l,u),e.setTime(+e+d)):(e.setFullYear(r,n,o),e.setHours(s,c,l,u)),e};rn.dateToUtcTime=function(t){if(typeof t=="string")return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r};rn.derToInteger=function(t){typeof t=="string"&&(t=ed.util.createBuffer(t));var e=t.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)};rn.validate=function(t,e,r,n){var o=!1;if((t.tagClass===e.tagClass||typeof e.tagClass>"u")&&(t.type===e.type||typeof e.type>"u"))if(t.constructed===e.constructed||typeof e.constructed>"u"){if(o=!0,e.value&&ed.util.isArray(e.value))for(var s=0,c=0;o&&c0&&(n+=` +`);for(var o="",s=0;s1?n+="0x"+ed.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===tn.Type.OCTETSTRING)d4n.test(t.value)||(n+="("+t.value+") "),n+="0x"+ed.util.bytesToHex(t.value);else if(t.type===tn.Type.UTF8)try{n+=ed.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ed.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===tn.Type.PRINTABLESTRING||t.type===tn.Type.IA5String?n+=t.value:d4n.test(t.value)?n+="0x"+ed.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var qO=I((gJd,p4n)=>{p();var vnt=ds();p4n.exports=vnt.md=vnt.md||{};vnt.md.algorithms=vnt.md.algorithms||{}});var Fde=I((yJd,h4n)=>{p();var sF=ds();qO();ic();var oEs=h4n.exports=sF.hmac=sF.hmac||{};oEs.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in sF.md.algorithms)e=sF.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=sF.util.createBuffer(c);else if(sF.util.isArray(c)){var l=c;c=sF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=sF.util.createBuffer(),n=sF.util.createBuffer(),d=c.length();for(var u=0;u{p();var jO=ds();qO();ic();var g4n=y4n.exports=jO.md5=jO.md5||{};jO.md.md5=jO.md.algorithms.md5=g4n;g4n.create=function(){A4n||sEs();var t=null,e=jO.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),m4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=jO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(uer.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};m4n(f,r,o);var h=jO.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var uer=null,bnt=null,NRe=null,Ude=null,A4n=!1;function sEs(){uer="\x80",uer+=jO.util.fillString("\0",64),bnt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],NRe=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],Ude=new Array(64);for(var t=0;t<64;++t)Ude[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);A4n=!0}a(sEs,"_init");function m4n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+Ude[f]+e[f],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+Ude[f]+e[bnt[f]],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+Ude[f]+e[bnt[f]],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+Ude[f]+e[bnt[f]],d=NRe[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(m4n,"_update")});var xJ=I((bJd,_4n)=>{p();var Int=ds();ic();var E4n=_4n.exports=Int.pem=Int.pem||{};E4n.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r -`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Tnt(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Tnt(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Tnt(n)),t.headers)for(var o=0;o1?n+="0x"+ed.util.bytesToHex(t.value.slice(1)):n+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);d==1?n+=" (1 unused bit shown)":d>1&&(n+=" ("+d+" unused bits shown)")}}else if(t.type===rn.Type.OCTETSTRING)h4n.test(t.value)||(n+="("+t.value+") "),n+="0x"+ed.util.bytesToHex(t.value);else if(t.type===rn.Type.UTF8)try{n+=ed.util.decodeUtf8(t.value)}catch(f){if(f.message==="URI malformed")n+="0x"+ed.util.bytesToHex(t.value)+" (malformed UTF8)";else throw f}else t.type===rn.Type.PRINTABLESTRING||t.type===rn.Type.IA5String?n+=t.value:h4n.test(t.value)?n+="0x"+ed.util.bytesToHex(t.value):t.value.length===0?n+="[null]":n+=t.value}return n}});var OO=I((Wzd,g4n)=>{p();var gnt=us();g4n.exports=gnt.md=gnt.md||{};gnt.md.algorithms=gnt.md.algorithms||{}});var Mde=I((Yzd,A4n)=>{p();var eF=us();OO();ic();var WAs=A4n.exports=eF.hmac=eF.hmac||{};WAs.create=function(){var t=null,e=null,r=null,n=null,o={};return o.start=function(s,c){if(s!==null)if(typeof s=="string")if(s=s.toLowerCase(),s in eF.md.algorithms)e=eF.md.algorithms[s].create();else throw new Error('Unknown hash algorithm "'+s+'"');else e=s;if(c===null)c=t;else{if(typeof c=="string")c=eF.util.createBuffer(c);else if(eF.util.isArray(c)){var l=c;c=eF.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(c.bytes()),c=e.digest()),r=eF.util.createBuffer(),n=eF.util.createBuffer(),d=c.length();for(var u=0;u{p();var BO=us();OO();ic();var E4n=v4n.exports=BO.md5=BO.md5||{};BO.md.md5=BO.md.algorithms.md5=E4n;E4n.create=function(){_4n||zAs();var t=null,e=BO.util.createBuffer(),r=new Array(16),n={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),y4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=BO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(ger.substr(0,n.blockLength-c));for(var l,u=0,d=n.fullMessageLength.length-1;d>=0;--d)l=n.fullMessageLength[d]*8+u,u=l/4294967296>>>0,o.putInt32Le(l>>>0);var f={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};y4n(f,r,o);var h=BO.util.createBuffer();return h.putInt32Le(f.h0),h.putInt32Le(f.h1),h.putInt32Le(f.h2),h.putInt32Le(f.h3),h},n};var ger=null,Ant=null,_Re=null,Ode=null,_4n=!1;function zAs(){ger="\x80",ger+=BO.util.fillString("\0",64),Ant=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],_Re=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],Ode=new Array(64);for(var t=0;t<64;++t)Ode[t]=Math.floor(Math.abs(Math.sin(t+1))*4294967296);_4n=!0}a(zAs,"_init");function y4n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,f=0;f<16;++f)e[f]=r.getInt32Le(),u=l^s&(c^l),n=o+u+Ode[f]+e[f],d=_Re[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<32;++f)u=c^l&(s^c),n=o+u+Ode[f]+e[Ant[f]],d=_Re[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<48;++f)u=s^c^l,n=o+u+Ode[f]+e[Ant[f]],d=_Re[f],o=l,l=c,c=s,s+=n<>>32-d;for(;f<64;++f)u=c^(s|~l),n=o+u+Ode[f]+e[Ant[f]],d=_Re[f],o=l,l=c,c=s,s+=n<>>32-d;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,h-=64}}a(y4n,"_update")});var EJ=I((eYd,b4n)=>{p();var _nt=us();ic();var C4n=b4n.exports=_nt.pem=_nt.pem||{};C4n.encode=function(t,e){e=e||{};var r="-----BEGIN "+t.type+`-----\r +`,n;if(t.procType&&(n={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]},r+=Ent(n)),t.contentDomain&&(n={name:"Content-Domain",values:[t.contentDomain]},r+=Ent(n)),t.dekInfo&&(n={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&n.values.push(t.dekInfo.parameters),r+=Ent(n)),t.headers)for(var o=0;o65&&c!==-1){var l=e[c];l===","?(++c,e=e.substr(0,c)+`\r `+e.substr(c)):e=e.substr(0,c)+`\r -`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(Tnt,"foldHeader");function aEs(t){return t.replace(/^\s+/,"")}a(aEs,"ltrim")});var MRe=I((IJd,v4n)=>{p();var Fd=ds();Ant();oer();ic();v4n.exports=Fd.des=Fd.des||{};Fd.des.startEncrypting=function(t,e,r,n){var o=xnt({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Fd.des.createEncryptionCipher=function(t,e){return xnt({key:t,output:null,decrypt:!1,mode:e})};Fd.des.startDecrypting=function(t,e,r,n){var o=xnt({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Fd.des.createDecryptionCipher=function(t,e){return xnt({key:t,output:null,decrypt:!0,mode:e})};Fd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return C4n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return C4n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Fd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Fd.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=gEs(e),this._init=!0}};HO("DES-ECB",Fd.cipher.modes.ecb);HO("DES-CBC",Fd.cipher.modes.cbc);HO("DES-CFB",Fd.cipher.modes.cfb);HO("DES-OFB",Fd.cipher.modes.ofb);HO("DES-CTR",Fd.cipher.modes.ctr);HO("3DES-ECB",Fd.cipher.modes.ecb);HO("3DES-CBC",Fd.cipher.modes.cbc);HO("3DES-CFB",Fd.cipher.modes.cfb);HO("3DES-OFB",Fd.cipher.modes.ofb);HO("3DES-CTR",Fd.cipher.modes.ctr);function HO(t,e){var r=a(function(){return new Fd.des.Algorithm(t,e)},"factory");Fd.cipher.registerAlgorithm(t,r)}a(HO,"registerAlgorithm");var cEs=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],lEs=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],uEs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],dEs=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],fEs=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],pEs=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],hEs=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],mEs=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function gEs(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,E=[],_=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var k=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];b=(D>>>16^k)&65535,E[v++]=k^b,E[v++]=D^b<<16}}return E}a(gEs,"_createKeys");function C4n(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(lEs[g>>>24&63]|dEs[g>>>16&63]|pEs[g>>>8&63]|mEs[g&63]|cEs[A>>>24&63]|uEs[A>>>16&63]|fEs[A>>>8&63]|hEs[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(C4n,"_updateBlock");function xnt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Fd.cipher.createDecipher(r,t.key):n=Fd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Fd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(xnt,"_createCipher")});var wnt=I((RJd,b4n)=>{p();var G_=ds();Fde();qO();ic();var AEs=G_.pkcs5=G_.pkcs5||{},aF;G_.util.isNodejs&&!G_.options.usePureJavaScript&&(aF=require("crypto"));b4n.exports=G_.pbkdf2=AEs.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),G_.util.isNodejs&&!G_.options.usePureJavaScript&&aF.pbkdf2&&(o===null||typeof o!="object")&&(aF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?aF.pbkdf2Sync.length===4?aF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):aF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):aF.pbkdf2Sync.length===4?aF.pbkdf2Sync(t,e,r,n).toString("binary"):aF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in G_.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=G_.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=G_.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(G_.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=G_.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(G_.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=G_.util.xorBytes(m,g,c),A=g,++E,G_.util.setImmediate(v);h+=y{p();var GO=ds();qO();ic();var T4n=w4n.exports=GO.sha256=GO.sha256||{};GO.md.sha256=GO.md.algorithms.sha256=T4n;T4n.create=function(){I4n||yEs();var t=null,e=GO.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),S4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=GO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(der.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};S4n(h,r,o);var m=GO.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var der=null,I4n=!1,x4n=null;function yEs(){der="\x80",der+=GO.util.fillString("\0",64),x4n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],I4n=!0}a(yEs,"_init");function S4n(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+x4n[d]+e[d],o=s+u,_=E,E=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+E|0,t.h7=t.h7+_|0,v-=64}}a(S4n,"_update")});var per=I((OJd,R4n)=>{p();var $O=ds();ic();var Rnt=null;$O.util.isNodejs&&!$O.options.usePureJavaScript&&!process.versions["node-webkit"]&&(Rnt=require("crypto"));var EEs=R4n.exports=$O.prng=$O.prng||{};EEs.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=$O.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return $O.util.nextTick(function(){s(E)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),$O.util.setImmediate(E)}a(E,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=$O.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=$O.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=$O.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),Rnt?(e.seedFile=function(d,f){Rnt.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return Rnt.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var sw=I((FJd,her)=>{p();var gg=ds();Kq();fer();per();ic();(function(){if(gg.random&&gg.random.getBytes){her.exports=gg.random;return}(function(t){var e={},r=new Array(4),n=gg.util.createBuffer();e.formatKey=function(h){var m=gg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),gg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=gg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return gg.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=gg.md.sha256;function o(){var h=gg.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=gg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),gg.options.usePureJavaScript||!gg.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!gg.random)gg.random=s;else for(var f in s)gg.random[f]=s[f];gg.random.createInstance=o,her.exports=gg.random})(typeof jQuery<"u"?jQuery:null)})()});var ger=I((qJd,D4n)=>{p();var Kv=ds();ic();var mer=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],k4n=[1,2,3,5],_Es=a(function(t,e){return t<>16-e},"rol"),CEs=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");D4n.exports=Kv.rc2=Kv.rc2||{};Kv.rc2.expandKey=function(t,e){typeof t=="string"&&(t=Kv.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(mer[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,mer[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,mer[r.at(l+1)^r.at(l+s)]);return r};var P4n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=Kv.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=_Es(A[d],k4n[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=CEs(A[d],k4n[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");Kv.rc2.startEncrypting=function(t,e,r){var n=Kv.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};Kv.rc2.createEncryptionCipher=function(t,e){return P4n(t,e,!0)};Kv.rc2.startDecrypting=function(t,e,r){var n=Kv.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};Kv.rc2.createDecryptionCipher=function(t,e){return P4n(t,e,!1)}});var BRe=I((GJd,Q4n)=>{p();var Aer=ds();Q4n.exports=Aer.jsbn=Aer.jsbn||{};var cF,vEs=0xdeadbeefcafe,N4n=(vEs&16777215)==15715070;function Wt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(Wt,"BigInteger");Aer.jsbn.BigInteger=Wt;function Ga(){return new Wt(null)}a(Ga,"nbi");function bEs(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(bEs,"am1");function SEs(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(SEs,"am2");function M4n(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a(M4n,"am3");typeof navigator>"u"?(Wt.prototype.am=M4n,cF=28):N4n&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=SEs,cF=30):N4n&&navigator.appName!="Netscape"?(Wt.prototype.am=bEs,cF=26):(Wt.prototype.am=M4n,cF=28);Wt.prototype.DB=cF;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(IEs,"bnpCopyTo");function xEs(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(xEs,"bnpFromInt");function Zq(t){var e=Ga();return e.fromInt(t),e}a(Zq,"nbv");function wEs(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:B4n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(REs,"bnpClamp");function kEs(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=O4n(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=O4n(n));return o?s:"0"}a(kEs,"bnToString");function PEs(){var t=Ga();return Wt.ZERO.subTo(this,t),t}a(PEs,"bnNegate");function DEs(){return this.s<0?this.negate():this}a(DEs,"bnAbs");function NEs(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(NEs,"bnCompareTo");function Pnt(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a(Pnt,"nbits");function MEs(){return this.t<=0?0:this.DB*(this.t-1)+Pnt(this.data[this.t-1]^this.s&this.DM)}a(MEs,"bnBitLength");function OEs(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(OEs,"bnpDLShiftTo");function BEs(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(LEs,"bnpLShiftTo");function FEs(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(UEs,"bnpSubTo");function QEs(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(qEs,"bnpSquareTo");function jEs(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(_,r)),Wt.ONE.dlShiftTo(d,_),_.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,E,0,d))0&&r.rShiftTo(u,r),c<0&&Wt.ZERO.subTo(r,r)}}}a(jEs,"bnpDivRemTo");function HEs(t){var e=Ga();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(HEs,"bnMod");function wJ(t){this.m=t}a(wJ,"Classic");function GEs(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(GEs,"cConvert");function $Es(t){return t}a($Es,"cRevert");function VEs(t){t.divRemTo(this.m,null,t)}a(VEs,"cReduce");function WEs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(WEs,"cMulTo");function zEs(t,e){t.squareTo(e),this.reduce(e)}a(zEs,"cSqrTo");wJ.prototype.convert=GEs;wJ.prototype.revert=$Es;wJ.prototype.reduce=VEs;wJ.prototype.mulTo=WEs;wJ.prototype.sqrTo=zEs;function YEs(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(YEs,"bnpInvDigit");function RJ(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(KEs,"montConvert");function JEs(t){var e=Ga();return t.copyTo(e),this.reduce(e),e}a(JEs,"montRevert");function ZEs(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(ZEs,"montReduce");function XEs(t,e){t.squareTo(e),this.reduce(e)}a(XEs,"montSqrTo");function e_s(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(e_s,"montMulTo");RJ.prototype.convert=KEs;RJ.prototype.revert=JEs;RJ.prototype.reduce=ZEs;RJ.prototype.mulTo=e_s;RJ.prototype.sqrTo=XEs;function t_s(){return(this.t>0?this.data[0]&1:this.s)==0}a(t_s,"bnpIsEven");function r_s(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=Ga(),n=Ga(),o=e.convert(this),s=Pnt(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(r_s,"bnpExp");function n_s(t,e){var r;return t<256||e.isEven()?r=new wJ(e):r=new RJ(e),this.exp(t,r)}a(n_s,"bnModPowInt");Wt.prototype.copyTo=IEs;Wt.prototype.fromInt=xEs;Wt.prototype.fromString=wEs;Wt.prototype.clamp=REs;Wt.prototype.dlShiftTo=OEs;Wt.prototype.drShiftTo=BEs;Wt.prototype.lShiftTo=LEs;Wt.prototype.rShiftTo=FEs;Wt.prototype.subTo=UEs;Wt.prototype.multiplyTo=QEs;Wt.prototype.squareTo=qEs;Wt.prototype.divRemTo=jEs;Wt.prototype.invDigit=YEs;Wt.prototype.isEven=t_s;Wt.prototype.exp=r_s;Wt.prototype.toString=kEs;Wt.prototype.negate=PEs;Wt.prototype.abs=DEs;Wt.prototype.compareTo=NEs;Wt.prototype.bitLength=MEs;Wt.prototype.mod=HEs;Wt.prototype.modPowInt=n_s;Wt.ZERO=Zq(0);Wt.ONE=Zq(1);function i_s(){var t=Ga();return this.copyTo(t),t}a(i_s,"bnClone");function o_s(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(s_s,"bnByteValue");function a_s(){return this.t==0?this.s:this.data[0]<<16>>16}a(a_s,"bnShortValue");function c_s(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(c_s,"bnpChunkSize");function l_s(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(l_s,"bnSigNum");function u_s(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Zq(r),o=Ga(),s=Ga(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(u_s,"bnpToRadix");function d_s(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&Wt.ZERO.subTo(this,this)}a(d_s,"bnpFromRadix");function f_s(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Wt.ONE.shiftLeft(t-1),Eer,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Wt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(p_s,"bnToByteArray");function h_s(t){return this.compareTo(t)==0}a(h_s,"bnEquals");function m_s(t){return this.compareTo(t)<0?this:t}a(m_s,"bnMin");function g_s(t){return this.compareTo(t)>0?this:t}a(g_s,"bnMax");function A_s(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(I_s,"lbit");function x_s(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(O_s,"bnpAddTo");function B_s(t){var e=Ga();return this.addTo(t,e),e}a(B_s,"bnAdd");function L_s(t){var e=Ga();return this.subTo(t,e),e}a(L_s,"bnSubtract");function F_s(t){var e=Ga();return this.multiplyTo(t,e),e}a(F_s,"bnMultiply");function U_s(){var t=Ga();return this.squareTo(t),t}a(U_s,"bnSquare");function Q_s(t){var e=Ga();return this.divRemTo(t,e,null),e}a(Q_s,"bnDivide");function q_s(t){var e=Ga();return this.divRemTo(t,null,e),e}a(q_s,"bnRemainder");function j_s(t){var e=Ga(),r=Ga();return this.divRemTo(t,e,r),new Array(e,r)}a(j_s,"bnDivideAndRemainder");function H_s(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(H_s,"bnpDMultiply");function G_s(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(G_s,"bnpDAddOffset");function ORe(){}a(ORe,"NullExp");function U4n(t){return t}a(U4n,"nNop");function $_s(t,e,r){t.multiplyTo(e,r)}a($_s,"nMulTo");function V_s(t,e){t.squareTo(e)}a(V_s,"nSqrTo");ORe.prototype.convert=U4n;ORe.prototype.revert=U4n;ORe.prototype.mulTo=$_s;ORe.prototype.sqrTo=V_s;function W_s(t){return this.exp(t,new ORe)}a(W_s,"bnPow");function z_s(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ga();return t.copyTo(e),this.reduce(e),e}a(K_s,"barrettConvert");function J_s(t){return t}a(J_s,"barrettRevert");function Z_s(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(Z_s,"barrettReduce");function X_s(t,e){t.squareTo(e),this.reduce(e)}a(X_s,"barrettSqrTo");function eCs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(eCs,"barrettMulTo");qde.prototype.convert=K_s;qde.prototype.revert=J_s;qde.prototype.reduce=Z_s;qde.prototype.mulTo=eCs;qde.prototype.sqrTo=X_s;function tCs(t,e){var r=t.bitLength(),n,o=Zq(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new wJ(e):e.isEven()?s=new qde(e):s=new RJ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Ga();for(s.sqrTo(c[1],f);l<=d;)c[l]=Ga(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Ga(),y;for(r=Pnt(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(rCs,"bnGCD");function nCs(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a(nCs,"bnpModInt");function iCs(t){if(this.signum()==0)return Wt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Wt.ZERO;for(var r=t.clone(),n=this.clone(),o=Zq(1),s=Zq(0),c=Zq(0),l=Zq(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(Wt.ONE)!=0)return Wt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(iCs,"bnModInverse");var zP=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],oCs=(1<<26)/zP[zP.length-1];function sCs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=zP[zP.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(Wt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var VO=ds();qO();ic();var j4n=G4n.exports=VO.sha1=VO.sha1||{};VO.md.sha1=VO.md.algorithms.sha1=j4n;j4n.create=function(){H4n||lCs();var t=null,e=VO.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),q4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=VO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(_er.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};q4n(h,r,o);var m=VO.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var _er=null,H4n=!1;function lCs(){_er="\x80",_er+=VO.util.fillString("\0",64),H4n=!0}a(lCs,"_init");function q4n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(q4n,"_update")});var Cer=I((KJd,V4n)=>{p();var WO=ds();ic();sw();jde();var $4n=V4n.exports=WO.pkcs1=WO.pkcs1||{};$4n.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=WO.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(Dnt,"rsa_mgf1")});var ber=I((XJd,ver)=>{p();var Xq=ds();ic();BRe();sw();(function(){if(Xq.prime){ver.exports=Xq.prime;return}var t=ver.exports=Xq.prime=Xq.prime||{},e=Xq.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||Xq.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return Xq.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var Q=y.toString(16);N.target.postMessage({hex:Q,workLoad:_}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var LRe=I((rZd,X4n)=>{p();var _i=ds();WP();BRe();Jq();Cer();ber();sw();ic();typeof $a>"u"&&($a=_i.jsbn.BigInteger);var $a,Ser=_i.util.isNodejs?require("crypto"):null,lt=_i.asn1,cw=_i.util;_i.pki=_i.pki||{};X4n.exports=_i.pki.rsa=_i.rsa=_i.rsa||{};var Qo=_i.pki,uCs=[6,4,2,4,2,4,6,2],dCs={name:"PrivateKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},fCs={name:"RSAPrivateKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},pCs={name:"RSAPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:lt.Class.UNIVERSAL,type:lt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},hCs=_i.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},mCs={name:"DigestInfo",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:lt.Class.UNIVERSAL,type:lt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:lt.Class.UNIVERSAL,type:lt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:lt.Class.UNIVERSAL,type:lt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},gCs=a(function(t){var e;if(t.algorithm in Qo.oids)e=Qo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=lt.oidToDer(e).getBytes(),o=lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[]),s=lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[]);s.value.push(lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,n)),s.value.push(lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,""));var c=lt.create(lt.Class.UNIVERSAL,lt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),lt.toDer(o).getBytes()},"emsaPkcs1v15encode"),J4n=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract($a.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract($a.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new $a(_i.util.bytesToHex(_i.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals($a.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");Qo.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=Z4n(t,e,r)):(o=_i.util.createBuffer(),o.putBytes(t));for(var c=new $a(o.toHex(),16),l=J4n(c,e,n),u=l.toString(16),d=_i.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.util.hexToBytes(u)),d.getBytes()};Qo.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new $a(_i.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=J4n(c,e,r),u=l.toString(16),d=_i.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.util.hexToBytes(u)),n!==!1?Nnt(d.getBytes(),e,r):d.getBytes()};Qo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||_i.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};Qo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new $a(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(yCs(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(uCs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo($a.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:Qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:Qo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};Qo.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!_i.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(W4n("generateKeyPair"))return Ser.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:Qo.privateKeyFromPem(d),publicKey:Qo.publicKeyFromPem(u)})});if(z4n("generateKey")&&z4n("exportKey"))return cw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:K4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return cw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=Qo.privateKeyFromAsn1(lt.fromDer(_i.util.createBuffer(l)));n(null,{privateKey:u,publicKey:Qo.setRsaPublicKey(u.n,u.e)})}});if(Y4n("generateKey")&&Y4n("exportKey")){var o=cw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:K4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=cw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=Qo.privateKeyFromAsn1(lt.fromDer(_i.util.createBuffer(h)));n(null,{privateKey:m,publicKey:Qo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(W4n("generateKeyPairSync")){var s=Ser.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Qo.privateKeyFromPem(s.privateKey),publicKey:Qo.publicKeyFromPem(s.publicKey)}}}var c=Qo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Qo.rsa.stepKeyPairGenerationState(c,0),c.keys;ACs(c,r,n)};Qo.setRsaPublicKey=Qo.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return Z4n(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return _i.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return Qo.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=Nnt(d,r,!0,void 0,c);var f=lt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!lt.validate(f,mCs,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=lt.derToOid(h.algorithmIdentifier);if(!(A===_i.oids.md2||A===_i.oids.md5||A===_i.oids.sha1||A===_i.oids.sha224||A===_i.oids.sha256||A===_i.oids.sha384||A===_i.oids.sha512||A===_i.oids["sha512-224"]||A===_i.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===_i.oids.md2||A===_i.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=Nnt(d,r,!0,void 0,c),u===d},"verify")});var l=Qo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};Qo.setRsaPrivateKey=Qo.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=Qo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:Nnt};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return _i.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:gCs},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return Qo.rsa.encrypt(m,u,h)},u};Qo.wrapRsaPrivateKey=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,lt.integerToDer(0).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,lt.oidToDer(Qo.oids.rsaEncryption).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,"")]),lt.create(lt.Class.UNIVERSAL,lt.Type.OCTETSTRING,!1,lt.toDer(t).getBytes())])};Qo.privateKeyFromAsn1=function(t){var e={},r=[];if(lt.validate(t,dCs,e,r)&&(t=lt.fromDer(_i.util.createBuffer(e.privateKey))),e={},r=[],!lt.validate(t,fCs,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=_i.util.createBuffer(e.privateKeyModulus).toHex(),s=_i.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=_i.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=_i.util.createBuffer(e.privateKeyPrime1).toHex(),u=_i.util.createBuffer(e.privateKeyPrime2).toHex(),d=_i.util.createBuffer(e.privateKeyExponent1).toHex(),f=_i.util.createBuffer(e.privateKeyExponent2).toHex(),h=_i.util.createBuffer(e.privateKeyCoefficient).toHex(),Qo.setRsaPrivateKey(new $a(o,16),new $a(s,16),new $a(c,16),new $a(l,16),new $a(u,16),new $a(d,16),new $a(f,16),new $a(h,16))};Qo.privateKeyToAsn1=Qo.privateKeyToRSAPrivateKey=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,lt.integerToDer(0).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.n)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.e)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.d)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.p)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.q)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.dP)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.dQ)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.qInv))])};Qo.publicKeyFromAsn1=function(t){var e={},r=[];if(lt.validate(t,hCs,e,r)){var n=lt.derToOid(e.publicKeyOid);if(n!==Qo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!lt.validate(t,pCs,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=_i.util.createBuffer(e.publicKeyModulus).toHex(),c=_i.util.createBuffer(e.publicKeyExponent).toHex();return Qo.setRsaPublicKey(new $a(s,16),new $a(c,16))};Qo.publicKeyToAsn1=Qo.publicKeyToSubjectPublicKeyInfo=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.OID,!1,lt.oidToDer(Qo.oids.rsaEncryption).getBytes()),lt.create(lt.Class.UNIVERSAL,lt.Type.NULL,!1,"")]),lt.create(lt.Class.UNIVERSAL,lt.Type.BITSTRING,!1,[Qo.publicKeyToRSAPublicKey(t)])])};Qo.publicKeyToRSAPublicKey=function(t){return lt.create(lt.Class.UNIVERSAL,lt.Type.SEQUENCE,!0,[lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.n)),lt.create(lt.Class.UNIVERSAL,lt.Type.INTEGER,!1,zO(t.e))])};function Z4n(t,e,r){var n=_i.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=_i.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(Nnt,"_decodePkcs1_v1_5");function ACs(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){_i.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.p=null,o();return}if(t.q.subtract($a.ONE).gcd(t.e).compareTo($a.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract($a.ONE),t.q1=t.q.subtract($a.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo($a.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:Qo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:Qo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(ACs,"_generateKeyPair");function zO(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=_i.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(zO,"_bnToBytes");function yCs(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(yCs,"_getMillerRabinTests");function W4n(t){return _i.util.isNodejs&&typeof Ser[t]=="function"}a(W4n,"_detectNodeCrypto");function z4n(t){return typeof cw.globalScope<"u"&&typeof cw.globalScope.crypto=="object"&&typeof cw.globalScope.crypto.subtle=="object"&&typeof cw.globalScope.crypto.subtle[t]=="function"}a(z4n,"_detectSubtleCrypto");function Y4n(t){return typeof cw.globalScope<"u"&&typeof cw.globalScope.msCrypto=="object"&&typeof cw.globalScope.msCrypto.subtle=="object"&&typeof cw.globalScope.msCrypto.subtle[t]=="function"}a(Y4n,"_detectSubtleMsCrypto");function K4n(t){for(var e=_i.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var An=ds();Kq();WP();MRe();qO();Jq();wnt();xJ();sw();ger();LRe();ic();typeof eBn>"u"&&(eBn=An.jsbn.BigInteger);var eBn,Rt=An.asn1,rs=An.pki=An.pki||{};iBn.exports=rs.pbe=An.pbe=An.pbe||{};var kJ=rs.oids,ECs={name:"EncryptedPrivateKeyInfo",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},_Cs={name:"PBES2Algorithms",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},CCs={name:"pkcs-12PbeParams",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Rt.Class.UNIVERSAL,type:Rt.Type.INTEGER,constructed:!1,capture:"iterations"}]};rs.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=An.random.getBytesSync(r.saltSize),o=r.count,s=Rt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=kJ["aes128-CBC"],h=An.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=kJ["aes192-CBC"],h=An.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=kJ["aes256-CBC"],h=An.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=kJ.desCBC,h=An.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=nBn(g),y=An.pkcs5.pbkdf2(e,n,o,c,A),E=An.random.getBytesSync(d),_=h(y);_.start(E),_.update(Rt.toDer(t)),_.finish(),u=_.output.getBytes();var v=vCs(n,s,c,g);l=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ.pkcs5PBES2).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ.pkcs5PBKDF2).getBytes()),v]),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(f).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new An.util.ByteBuffer(n),y=rs.pbe.generatePkcs12Key(e,b,1,o,c),E=rs.pbe.generatePkcs12Key(e,b,2,o,c),_=An.des.createEncryptionCipher(y);_.start(E),_.update(Rt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OID,!1,Rt.oidToDer(kJ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,n),Rt.create(Rt.Class.UNIVERSAL,Rt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Rt.create(Rt.Class.UNIVERSAL,Rt.Type.SEQUENCE,!0,[l,Rt.create(Rt.Class.UNIVERSAL,Rt.Type.OCTETSTRING,!1,u)]);return T};rs.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Rt.validate(t,ECs,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Rt.derToOid(n.encryptionOid),l=rs.pbe.getCipher(c,n.encryptionParams,e),u=An.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Rt.fromDer(l.output)),r};rs.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Rt.toDer(t).getBytes()};return An.pem.encode(r,{maxline:e})};rs.encryptedPrivateKeyFromPem=function(t){var e=An.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Rt.fromDer(e.body)};rs.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=rs.wrapRsaPrivateKey(rs.privateKeyToAsn1(t));return n=rs.encryptPrivateKeyInfo(n,e,r),rs.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=An.random.getBytesSync(16),l=An.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=An.random.getBytesSync(8),l=An.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=An.random.getBytesSync(8),l=An.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=An.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Rt.toDer(rs.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:An.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return An.pem.encode(h)};rs.decryptRsaPrivateKey=function(t,e){var r=null,n=An.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=An.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=An.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=An.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=An.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=An.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return An.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return An.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return An.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=An.util.hexToBytes(n.dekInfo.parameters),u=An.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(An.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=rs.decryptPrivateKeyInfo(Rt.fromDer(r),e):r=Rt.fromDer(r),r!==null&&(r=rs.privateKeyFromAsn1(r)),r};rs.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in An.md))throw new Error('"sha1" hash algorithm unavailable.');s=An.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new An.util.ByteBuffer,h=new An.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)B=B>>8,B+=k.at(l)+L.at(l),L.setAt(l,B&255);N.putBuffer(L)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};rs.pbe.getCipher=function(t,e,r){switch(t){case rs.oids.pkcs5PBES2:return rs.pbe.getCipherForPBES2(t,e,r);case rs.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case rs.oids["pbewithSHAAnd40BitRC2-CBC"]:return rs.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};rs.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Rt.validate(e,_Cs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Rt.derToOid(n.kdfOid),t!==rs.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Rt.derToOid(n.encOid),t!==rs.oids["aes128-CBC"]&&t!==rs.oids["aes192-CBC"]&&t!==rs.oids["aes256-CBC"]&&t!==rs.oids["des-EDE3-CBC"]&&t!==rs.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=An.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(rs.oids[t]){case"aes128-CBC":u=16,d=An.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=An.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=An.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=An.des.createDecryptionCipher;break;case"desCBC":u=8,d=An.des.createDecryptionCipher;break}var f=rBn(n.prfOid),h=An.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};rs.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Rt.validate(e,CCs,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=An.util.createBuffer(n.salt),l=An.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case rs.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=An.des.startDecrypting;break;case rs.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=An.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=rBn(n.prfOid),m=rs.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=rs.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};rs.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in An.md))throw new Error('"md5" hash algorithm unavailable.');n=An.md.md5.create()}e===null&&(e="");for(var o=[tBn(n,t+e)],s=16,c=1;s{p();var Hde=ds();WP();ic();var dn=Hde.asn1,Gde=aBn.exports=Hde.pkcs7asn1=Hde.pkcs7asn1||{};Hde.pkcs7=Hde.pkcs7||{};Hde.pkcs7.asn1=Gde;var oBn={name:"ContentInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Gde.contentInfoValidator=oBn;var sBn={name:"EncryptedContentInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Gde.envelopedDataValidator={name:"EnvelopedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(sBn)};Gde.encryptedDataValidator={name:"EncryptedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"}].concat(sBn)};var bCs={name:"SignerInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:dn.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Gde.signedDataValidator={name:"SignedData",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},oBn,{name:"SignedData.Certificates",tagClass:dn.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:dn.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SET,capture:"signerInfos",optional:!0,value:[bCs]}]};Gde.recipientInfoValidator={name:"RecipientInfo",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:dn.Class.UNIVERSAL,type:dn.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:dn.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:dn.Class.UNIVERSAL,type:dn.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var xer=I((uZd,cBn)=>{p();var PJ=ds();ic();PJ.mgf=PJ.mgf||{};var SCs=cBn.exports=PJ.mgf.mgf1=PJ.mgf1=PJ.mgf1||{};SCs.create=function(t){var e={generate:a(function(r,n){for(var o=new PJ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var Mnt=ds();xer();lBn.exports=Mnt.mgf=Mnt.mgf||{};Mnt.mgf.mgf1=Mnt.mgf1});var Ont=I((mZd,dBn)=>{p();var DJ=ds();sw();ic();var TCs=dBn.exports=DJ.pss=DJ.pss||{};TCs.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=DJ.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||DJ.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+E+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var Ci=ds();Kq();WP();MRe();qO();uBn();Jq();xJ();Ont();LRe();ic();var ue=Ci.asn1,Pr=gBn.exports=Ci.pki=Ci.pki||{},Va=Pr.oids,tp={};tp.CN=Va.commonName;tp.commonName="CN";tp.C=Va.countryName;tp.countryName="C";tp.L=Va.localityName;tp.localityName="L";tp.ST=Va.stateOrProvinceName;tp.stateOrProvinceName="ST";tp.O=Va.organizationName;tp.organizationName="O";tp.OU=Va.organizationalUnitName;tp.organizationalUnitName="OU";tp.E=Va.emailAddress;tp.emailAddress="E";var pBn=Ci.pki.rsa.publicKeyValidator,ICs={name:"Certificate",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:ue.Class.UNIVERSAL,type:ue.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},pBn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:ue.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:ue.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:ue.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},xCs={name:"rsapss",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:ue.Class.UNIVERSAL,type:ue.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:ue.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:ue.Class.UNIVERSAL,type:ue.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:ue.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:ue.Class.UNIVERSAL,type:ue.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:ue.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:ue.Class.UNIVERSAL,type:ue.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},wCs={name:"CertificationRequestInfo",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:ue.Class.UNIVERSAL,type:ue.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},pBn,{name:"CertificationRequestInfo.attributes",tagClass:ue.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SET,constructed:!0}]}]}]},RCs={name:"CertificationRequest",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[wCs,{name:"CertificationRequest.signatureAlgorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:ue.Class.UNIVERSAL,type:ue.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:ue.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:ue.Class.UNIVERSAL,type:ue.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};Pr.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=Lnt({signatureOid:c.signatureOid,type:"certificate"});var d=ue.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=Ci.md.sha1.create(),h=ue.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return ej(c.issuer,A)},c.issuer.addField=function(A){lw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=Pr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=Ci.md.sha1.create(),g=ue.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return ej(c.subject,A)},c.subject.addField=function(A){lw([A]),c.subject.attributes.push(A)},c.subject.attributes=Pr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=Pr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=Pr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};Pr.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=ue.fromDer(e.value);r.value.length>0&&r.value[0].type===ue.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===ue.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=ue.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=ue.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=ue.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in Pr.oids?e.name=Pr.oids[e.type]:e.shortName&&e.shortName in tp&&(e.name=Pr.oids[tp[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in Pr.oids)e.type=Pr.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in tp&&(e.shortName=tp[e.name]),e.type===Va.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=ue.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(lw,"_fillMissingFields");function mBn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in Pr.oids&&(t.name=Pr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in Pr.oids)t.id=Pr.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(ue.create(ue.Class.UNIVERSAL,ue.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in Va?l.push(ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(Va[u]).getBytes())):u.indexOf(".")!==-1&&l.push(ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[ue.create(ue.Class.CONTEXT_SPECIFIC,4,!0,[$de(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=Ci.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(ue.create(ue.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]),E=ue.create(ue.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(mBn,"_fillMissingExtensionFields");function wer(t,e){if(t===Va["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,0,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.hash.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,1,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.mgf.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(e.mgf.hash.algorithmOid).getBytes()),ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(ue.create(ue.Class.CONTEXT_SPECIFIC,2,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(e.saltLength).getBytes())])),ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,r)}else return ue.create(ue.Class.UNIVERSAL,ue.Type.NULL,!1,"")}a(wer,"_signatureParametersToAsn1");function kCs(t){var e=ue.create(ue.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=PCs&&t0&&n.value.push(Pr.certificateExtensionsToAsn1(t.extensions)),n};Pr.getCertificationRequestInfo=function(t){var e=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.INTEGER,!1,ue.integerToDer(t.version).getBytes()),$de(t.subject),Pr.publicKeyToAsn1(t.publicKey),kCs(t)]);return e};Pr.distinguishedNameToAsn1=function(t){return $de(t)};Pr.certificateToAsn1=function(t){var e=t.tbsCertificate||Pr.getTBSCertificate(t);return ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[e,ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[ue.create(ue.Class.UNIVERSAL,ue.Type.OID,!1,ue.oidToDer(t.signatureOid).getBytes()),wer(t.signatureOid,t.signatureParameters)]),ue.create(ue.Class.UNIVERSAL,ue.Type.BITSTRING,!1,"\0"+t.signature)])};Pr.certificateExtensionsToAsn1=function(t){var e=ue.create(ue.Class.CONTEXT_SPECIFIC,3,!0,[]),r=ue.create(ue.Class.UNIVERSAL,ue.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:Pr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;Ci.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:Pr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:Pr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:Pr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:Pr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:Pr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!Ci.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var ker=I((_Zd,yBn)=>{p();var _u=ds();WP();Fde();Jq();Ier();Ter();sw();LRe();jde();ic();Fnt();var Ue=_u.asn1,Ks=_u.pki,URe=yBn.exports=_u.pkcs12=_u.pkcs12||{},ABn={name:"ContentInfo",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},NCs={name:"PFX",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.INTEGER,constructed:!1,capture:"version"},ABn,{name:"PFX.macData",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ue.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},MCs={name:"SafeBag",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},OCs={name:"Attribute",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SET,constructed:!0,capture:"values"}]},BCs={name:"CertBag",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ue.Class.UNIVERSAL,type:Ue.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ue.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ue.Class.UNIVERSAL,type:Ue.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function FRe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(FRe,"_getBagsByAttribute");URe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ue.validate(t,NCs,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=_u.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=FRe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=FRe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=FRe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return FRe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return FRe(c.safeContents,"localKeyId",E,_)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Ue.derToOid(n.contentType)!==Ks.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ue.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ue.Class.UNIVERSAL||l.type!==Ue.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Rer(l),n.mac){var u=null,d=0,f=Ue.derToOid(n.macAlgorithm);switch(f){case Ks.oids.sha1:u=_u.md.sha1.create(),d=20;break;case Ks.oids.sha256:u=_u.md.sha256.create(),d=32;break;case Ks.oids.sha384:u=_u.md.sha384.create(),d=48;break;case Ks.oids.sha512:u=_u.md.sha512.create(),d=64;break;case Ks.oids.md5:u=_u.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new _u.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(_u.util.bytesToHex(n.macIterations),16):1,g=URe.generateKey(r,h,3,m,d,u),A=_u.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return LCs(c,l.value,e,r),c};function Rer(t){if(t.composed||t.constructed){for(var e=_u.util.createBuffer(),r=0;r0&&(s=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SET,!0,u));var d=[],f=[];e!==null&&(_u.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,h),_=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=Ks.wrapRsaPrivateKey(Ks.privateKeyToAsn1(t));r===null?v=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.keyBag).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.pkcs8ShroudedKeyBag).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ks.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[v]),w=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(T).getBytes())])]);d.push(w)}var R=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=_u.md.sha1.create(),k=new _u.util.ByteBuffer(_u.random.getBytes(n.saltSize)),D=n.count,t=URe.generateKey(r,k,3,D,20),N=_u.hmac.create();N.start(l,t),N.update(Ue.toDer(R).getBytes());var L=N.getMac();x=Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.sha1).getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.NULL,!1,"")]),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,L.getBytes())]),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,k.getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.INTEGER,!1,Ue.integerToDer(D).getBytes())])}return Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.INTEGER,!1,Ue.integerToDer(3).getBytes()),Ue.create(Ue.Class.UNIVERSAL,Ue.Type.SEQUENCE,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OID,!1,Ue.oidToDer(Ks.oids.data).getBytes()),Ue.create(Ue.Class.CONTEXT_SPECIFIC,0,!0,[Ue.create(Ue.Class.UNIVERSAL,Ue.Type.OCTETSTRING,!1,Ue.toDer(R).getBytes())])]),x])};URe.generateKey=_u.pbe.generatePkcs12Key});var Der=I((bZd,EBn)=>{p();var tj=ds();WP();Jq();Ter();xJ();wnt();ker();Ont();LRe();ic();Fnt();var Per=tj.asn1,Vde=EBn.exports=tj.pki=tj.pki||{};Vde.pemToDer=function(t){var e=tj.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return tj.util.createBuffer(e.body)};Vde.privateKeyFromPem=function(t){var e=tj.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=Per.fromDer(e.body);return Vde.privateKeyFromAsn1(n)};Vde.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Per.toDer(Vde.privateKeyToAsn1(t)).getBytes()};return tj.pem.encode(r,{maxline:e})};Vde.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Per.toDer(t).getBytes()};return tj.pem.encode(r,{maxline:e})}});var Fer=I((TZd,xBn)=>{p();var Kt=ds();WP();Fde();Snt();xJ();Der();sw();jde();ic();var jnt=a(function(t,e,r,n){var o=Kt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Kt.util.createBuffer(),f=Kt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Kt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(he.queue(t,he.createAlert(t,{level:he.Alert.Level.warning,description:he.Alert.Description.no_renegotiation})),he.flush(t)),t.process()};he.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===he.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Kt.util.createBuffer(s.getBytes(32)),session_id:eT(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=eT(s,2),n.compression_methods=eT(s,1)),c=r-(c-s.length()),c>0){for(var l=eT(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:eT(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(eT(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=he.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=he.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=he.CompressionMethod.none}return n};he.createSecurityParameters=function(t,e){var r=t.entity===he.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:he.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:he.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};he.handleServerHello=function(t,e,r){var n=he.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=vBn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=$Cs,t.session.resuming=!1,he.createSecurityParameters(t,n)),t.session.id=o,t.process()}};he.handleClientHello=function(t,e,r){var n=he.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Kt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l0;)s=eT(o.certificate_list,3),c=Kt.asn1.fromDer(s),s=Kt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.bad_certificate}})}var u=t.entity===he.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?_Bn:Oer:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],he.verifyCertificateChain(t,l)&&(t.expect=u?_Bn:Oer)),t.process()};he.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.unsupported_certificate}});t.expect=VCs,t.process()};he.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:eT(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Kt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Kt.random.getBytes(48)}t.expect=Ber,t.session.clientCertificate!==null&&(t.expect=XCs),t.process()};he.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:eT(n,1),certificate_authorities:eT(n,2)};t.session.certificateRequest=o,t.expect=WCs,t.process()};he.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:eT(n,2).getBytes()},c=Kt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.handshake_failure}})}t.expect=Ber,t.process()};he.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Kt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=he.createRecord(t,{type:he.ContentType.handshake,data:he.createCertificate(t)}),he.queue(t,e)),e=he.createRecord(t,{type:he.ContentType.handshake,data:he.createClientKeyExchange(t)}),he.queue(t,e),t.expect=KCs;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&he.queue(l,he.createRecord(l,{type:he.ContentType.handshake,data:he.createCertificateVerify(l,u)})),he.queue(l,he.createRecord(l,{type:he.ContentType.change_cipher_spec,data:he.createChangeCipherSpec()})),l.state.pending=he.createConnectionState(l),l.state.current.write=l.state.pending.write,he.queue(l,he.createRecord(l,{type:he.ContentType.handshake,data:he.createFinished(l)})),l.expect=vBn,he.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);he.getClientSignature(t,c)};he.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.illegal_parameter}});var r=t.entity===he.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=he.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?zCs:evs,t.process()};he.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Kt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===he.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=jnt;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(he.queue(t,he.createRecord(t,{type:he.ContentType.change_cipher_spec,data:he.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,he.queue(t,he.createRecord(t,{type:he.ContentType.handshake,data:he.createFinished(t)}))),t.expect=c?YCs:tvs,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,he.flush(t),t.isConnected=!0,t.connected(t),t.process()};he.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case he.Alert.Description.close_notify:o="Connection closed.";break;case he.Alert.Description.unexpected_message:o="Unexpected message.";break;case he.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case he.Alert.Description.decryption_failed:o="Decryption failed.";break;case he.Alert.Description.record_overflow:o="Record overflow.";break;case he.Alert.Description.decompression_failure:o="Decompression failed.";break;case he.Alert.Description.handshake_failure:o="Handshake failure.";break;case he.Alert.Description.bad_certificate:o="Bad certificate.";break;case he.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case he.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case he.Alert.Description.certificate_expired:o="Certificate expired.";break;case he.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case he.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case he.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case he.Alert.Description.access_denied:o="Access denied.";break;case he.Alert.Description.decode_error:o="Decode error.";break;case he.Alert.Description.decrypt_error:o="Decrypt error.";break;case he.Alert.Description.export_restriction:o="Export restriction.";break;case he.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case he.Alert.Description.insufficient_security:o="Insufficient security.";break;case he.Alert.Description.internal_error:o="Internal error.";break;case he.Alert.Description.user_canceled:o="User canceled.";break;case he.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===he.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===he.ConnectionEnd.client?"server":"client",alert:n}),t.process()};he.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Kt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in qnt[t.entity][t.expect]?(t.entity===he.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()}),n!==he.HandshakeType.hello_request&&n!==he.HandshakeType.certificate_verify&&n!==he.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),qnt[t.entity][t.expect][n](t,e,o)):he.handleUnexpected(t,e)};he.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};he.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===he.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();he.queue(t,he.createRecord(t,{type:he.ContentType.heartbeat,data:he.createHeartbeat(he.HeartbeatMessageType.heartbeat_response,s)})),he.flush(t)}else if(n===he.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var GCs=0,$Cs=1,_Bn=2,VCs=3,WCs=4,vBn=5,zCs=6,YCs=7,KCs=8,JCs=0,ZCs=1,Oer=2,XCs=3,Ber=4,evs=5,tvs=6,fe=he.handleUnexpected,bBn=he.handleChangeCipherSpec,SA=he.handleAlert,$_=he.handleHandshake,SBn=he.handleApplicationData,TA=he.handleHeartbeat,Ler=[];Ler[he.ConnectionEnd.client]=[[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[bBn,SA,fe,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,SBn,TA],[fe,SA,$_,fe,TA]];Ler[he.ConnectionEnd.server]=[[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,fe,TA],[bBn,SA,fe,fe,TA],[fe,SA,$_,fe,TA],[fe,SA,$_,SBn,TA],[fe,SA,$_,fe,TA]];var rj=he.handleHelloRequest,rvs=he.handleServerHello,TBn=he.handleCertificate,CBn=he.handleServerKeyExchange,Ner=he.handleCertificateRequest,Unt=he.handleServerHelloDone,IBn=he.handleFinished,qnt=[];qnt[he.ConnectionEnd.client]=[[fe,fe,rvs,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,TBn,CBn,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,CBn,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,Ner,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,Unt,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,IBn],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[rj,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe]];var nvs=he.handleClientHello,ivs=he.handleClientKeyExchange,ovs=he.handleCertificateVerify;qnt[he.ConnectionEnd.server]=[[fe,nvs,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,TBn,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,ivs,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,ovs,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,IBn],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe],[fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe,fe]];he.generateKeys=function(t,e){var r=jnt,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===he.Versions.TLS_1_0.major&&t.version.minor===he.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};he.createConnectionState=function(t){var e=t.entity===he.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=he.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case he.CompressionMethod.none:break;case he.CompressionMethod.deflate:n.read.compressFunction=HCs,n.write.compressFunction=jCs;break;default:throw new Error("Unsupported compression algorithm.")}}return n};he.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Kt.util.createBuffer();return r.putInt32(e),r.putBytes(Kt.random.getBytes(28)),r};he.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};he.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),he.createRecord(t,{type:he.ContentType.alert,data:r})};he.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Kt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Kt.util.createBuffer();return A.putByte(he.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),uw(A,1,Kt.util.createBuffer(m)),uw(A,2,e),uw(A,1,s),h>0&&uw(A,2,l),A};he.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(he.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),uw(n,1,Kt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};he.createCertificate=function(t){var e=t.entity===he.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Kt.util.createBuffer();if(r!==null)try{Kt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(he.HandshakeType.server_key_exchange),r.putInt24(e)),r};he.getClientSignature=function(t,e){var r=Kt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Kt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};he.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(he.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};he.createCertificateRequest=function(t){var e=Kt.util.createBuffer();e.putByte(1);var r=Kt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Kt.pki.distinguishedNameToAsn1(o.subject),c=Kt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Kt.util.createBuffer();return u.putByte(he.HandshakeType.certificate_request),u.putInt24(l),uw(u,1,e),uw(u,2,r),u};he.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(he.HandshakeType.server_hello_done),e.putInt24(0),e};he.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};he.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===he.ConnectionEnd.client,n=t.session.sp,o=12,s=jnt,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(he.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};he.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Kt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Kt.random.getBytes(s)),n};he.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===he.ContentType.handshake||e.type===he.ContentType.alert||e.type===he.ContentType.change_cipher_spec))){if(e.type===he.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=he.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>he.MaxFragment;)n.push(he.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,he.MaxFragment))})),o=o.slice(he.MaxFragment);o.length>0&&n.push(he.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Kt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};he.createConnection=function(t){var e=null;t.caStore?Kt.util.isArray(t.caStore)?e=Kt.pki.createCaStore(t.caStore):e=t.caStore:e=Kt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in he.CipherSuites)r.push(he.CipherSuites[n])}var o=t.server?he.ConnectionEnd.server:he.ConnectionEnd.client,s=t.sessionCache?he.createSessionCache(t.sessionCache):null,c={version:{major:he.Version.major,minor:he.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Kt.util.createBuffer(),tlsData:Kt.util.createBuffer(),data:Kt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===he.ConnectionEnd.client?"client":"server"),h.send&&(he.queue(f,he.createAlert(f,h.alert)),he.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:he.Version.major,minor:he.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===he.ConnectionEnd.client?GCs:JCs,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=he.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-he.ContentType.change_cipher_spec,g=Ler[f.entity][f.expect];m in g?g[m](f,h):he.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Kt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:he.Alert.Level.fatal,description:he.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=he.createRandom().getBytes(),c.open=!0,he.queue(c,he.createRecord(c,{type:he.ContentType.handshake,data:he.createClientHello(c)})),he.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return he.queue(c,he.createRecord(c,{type:he.ContentType.application_data,data:Kt.util.createBuffer(f)})),he.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Kt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,he.queue(c,he.createRecord(c,{type:he.ContentType.heartbeat,data:he.createHeartbeat(he.HeartbeatMessageType.heartbeat_request,f,h)})),he.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,he.queue(c,he.createAlert(c,{level:he.Alert.Level.warning,description:he.Alert.Description.close_notify})),he.flush(c)),c.closed(c)),c.reset(f)},c};xBn.exports=Kt.tls=Kt.tls||{};for(Qnt in he)typeof he[Qnt]!="function"&&(Kt.tls[Qnt]=he[Qnt]);var Qnt;Kt.tls.prf_tls1=jnt;Kt.tls.hmac_sha1=qCs;Kt.tls.createSessionCache=he.createSessionCache;Kt.tls.createConnection=he.createConnection});var kBn=I((wZd,RBn)=>{p();var nj=ds();Kq();Fer();var dw=RBn.exports=nj.tls;dw.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=dw.BulkCipherAlgorithm.aes,t.cipher_type=dw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:wBn};dw.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=dw.BulkCipherAlgorithm.aes,t.cipher_type=dw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=dw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:wBn};function wBn(t,e,r){var n=e.entity===nj.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:nj.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:nj.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=uvs,t.write.cipherFunction=avs,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=dw.hmac_sha1}a(wBn,"initConnectionState");function avs(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===dw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=nj.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=dw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(cvs)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(avs,"encrypt_aes_cbc_sha1");function cvs(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(cvs,"encrypt_aes_cbc_sha1_padding");function lvs(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=nj.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=dvs(e.macKey,c,u)&&r,r}a(uvs,"decrypt_aes_cbc_sha1");function dvs(t,e,r){var n=nj.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(dvs,"compareMacs")});var qer=I((PZd,MBn)=>{p();var td=ds();qO();ic();var QRe=MBn.exports=td.sha512=td.sha512||{};td.md.sha512=td.md.algorithms.sha512=QRe;var DBn=td.sha384=td.sha512.sha384=td.sha512.sha384||{};DBn.create=function(){return QRe.create("SHA-384")};td.md.sha384=td.md.algorithms.sha384=DBn;td.sha512.sha256=td.sha512.sha256||{create:a(function(){return QRe.create("SHA-512/256")},"create")};td.md["sha512/256"]=td.md.algorithms["sha512/256"]=td.sha512.sha256;td.sha512.sha224=td.sha512.sha224||{create:a(function(){return QRe.create("SHA-512/224")},"create")};td.md["sha512/224"]=td.md.algorithms["sha512/224"]=td.sha512.sha224;QRe.create=function(t){if(NBn||fvs(),typeof t>"u"&&(t="SHA-512"),!(t in NJ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=NJ[t],r=null,n=td.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),PBn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=td.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes(Uer.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],q=U[0],F=U[1],n=((q>>>19|F<<13)^(F>>>29|q<<3)^q>>>6)>>>0,o=((q<<13|F>>>19)^(F<<3|q>>>29)^(q<<26|F>>>6))>>>0,V=e[O-15],q=V[0],F=V[1],s=((q>>>1|F<<31)^(q>>>8|F<<24)^q>>>7)>>>0,c=((q<<31|F>>>1)^(q<<24|F>>>8)^(q<<25|F>>>7))>>>0,W=e[O-7],G=e[O-16],F=o+W[1]+c+G[1],e[O][0]=n+W[0]+s+G[0]+(F/4294967296>>>0)>>>0,e[O][1]=F>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],k=t[4][1],D=t[5][0],N=t[5][1],L=t[6][0],B=t[6][1],Q=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|k<<18)^(x>>>18|k<<14)^(k>>>9|x<<23))>>>0,f=((x<<18|k>>>14)^(x<<14|k>>>18)^(k<<23|x>>>9))>>>0,h=(L^x&(D^L))>>>0,m=(B^k&(N^B))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,F=M+f+m+Qer[O][1]+e[O][1],n=Q+d+h+Qer[O][0]+e[O][0]+(F/4294967296>>>0)>>>0,o=F>>>0,F=u+A,s=l+g+(F/4294967296>>>0)>>>0,c=F>>>0,Q=L,M=B,L=D,B=N,D=x,N=k,F=R+o,x=w+n+(F/4294967296>>>0)>>>0,k=F>>>0,w=b,R=T,b=_,T=v,_=y,v=E,F=o+c,y=n+s+(F/4294967296>>>0)>>>0,E=F>>>0;F=t[0][1]+E,t[0][0]=t[0][0]+y+(F/4294967296>>>0)>>>0,t[0][1]=F>>>0,F=t[1][1]+v,t[1][0]=t[1][0]+_+(F/4294967296>>>0)>>>0,t[1][1]=F>>>0,F=t[2][1]+T,t[2][0]=t[2][0]+b+(F/4294967296>>>0)>>>0,t[2][1]=F>>>0,F=t[3][1]+R,t[3][0]=t[3][0]+w+(F/4294967296>>>0)>>>0,t[3][1]=F>>>0,F=t[4][1]+k,t[4][0]=t[4][0]+x+(F/4294967296>>>0)>>>0,t[4][1]=F>>>0,F=t[5][1]+N,t[5][0]=t[5][0]+D+(F/4294967296>>>0)>>>0,t[5][1]=F>>>0,F=t[6][1]+B,t[6][0]=t[6][0]+L+(F/4294967296>>>0)>>>0,t[6][1]=F>>>0,F=t[7][1]+M,t[7][0]=t[7][0]+Q+(F/4294967296>>>0)>>>0,t[7][1]=F>>>0,Y-=128}}a(PBn,"_update")});var OBn=I(jer=>{p();var pvs=ds();WP();var Ag=pvs.asn1;jer.privateKeyValidator={name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};jer.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:Ag.Class.UNIVERSAL,type:Ag.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var zBn=I((BZd,WBn)=>{p();var IA=ds();BRe();sw();qer();ic();var qBn=OBn(),hvs=qBn.publicKeyValidator,mvs=qBn.privateKeyValidator;typeof BBn>"u"&&(BBn=IA.jsbn.BigInteger);var BBn,Ger=IA.util.ByteBuffer,Jv=typeof Buffer>"u"?Uint8Array:Buffer;IA.pki=IA.pki||{};WBn.exports=IA.pki.ed25519=IA.ed25519=IA.ed25519||{};var Js=IA.ed25519;Js.constants={};Js.constants.PUBLIC_KEY_BYTE_LENGTH=32;Js.constants.PRIVATE_KEY_BYTE_LENGTH=64;Js.constants.SEED_BYTE_LENGTH=32;Js.constants.SIGN_BYTE_LENGTH=64;Js.constants.HASH_BYTE_LENGTH=64;Js.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=IA.random.getBytesSync(Js.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==Js.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+Js.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=lF({message:e,encoding:"binary"});for(var r=new Jv(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=new Jv(Js.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return Evs(r,n),{publicKey:r,privateKey:n}};Js.privateKeyFromAsn1=function(t){var e={},r=[],n=IA.asn1.validate(t,mvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=IA.asn1.derToOid(e.privateKeyOid),c=IA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=lF({message:IA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};Js.publicKeyFromAsn1=function(t){var e={},r=[],n=IA.asn1.validate(t,hvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=IA.asn1.derToOid(e.publicKeyOid),c=IA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==Js.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return lF({message:l,encoding:"binary"})};Js.publicKeyFromPrivateKey=function(t){t=t||{};var e=lF({message:t.privateKey,encoding:"binary"});if(e.length!==Js.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+Js.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new Jv(Js.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function lF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof Jv)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new Ger(e,r)}else if(!(e instanceof Ger))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new Jv(e.length()),o=0;o=0;--r){if(t[e+r]qRe[r])return!1}return!1}a(vvs,"_isCanonicalSignatureScalar");function jBn(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*qRe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*qRe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a(jBn,"modL");function Ver(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;jBn(t,e)}a(Ver,"reduce");function Wer(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi(),d=Vi(),f=Vi();zde(r,t[1],t[0]),zde(f,e[1],e[0]),jl(r,r,f),Wde(n,t[0],t[1]),Wde(f,e[0],e[1]),jl(n,n,f),jl(o,t[3],e[3]),jl(o,o,Avs),jl(s,t[2],e[2]),Wde(s,s,s),zde(c,n,r),zde(l,s,o),Wde(u,s,o),Wde(d,n,r),jl(t[0],c,l),jl(t[1],d,u),jl(t[2],u,l),jl(t[3],c,d)}a(Wer,"add");function UBn(t,e,r){for(var n=0;n<4;++n)VBn(t[n],e[n],r)}a(UBn,"cswap");function zer(t,e){var r=Vi(),n=Vi(),o=Vi();xvs(o,e[2]),jl(r,e[0],o),jl(n,e[1],o),Gnt(t,n),t[31]^=GBn(r)<<7}a(zer,"pack");function Gnt(t,e){var r,n,o,s=Vi(),c=Vi();for(r=0;r<16;++r)c[r]=e[r];for(Her(c),Her(c),Her(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,VBn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Gnt,"pack25519");function bvs(t,e){var r=Vi(),n=Vi(),o=Vi(),s=Vi(),c=Vi(),l=Vi(),u=Vi();return ij(t[2],Hnt),Svs(t[1],e),MJ(o,t[1]),jl(s,o,gvs),zde(o,o,t[2]),Wde(s,t[2],s),MJ(c,s),MJ(l,c),jl(u,l,c),jl(r,u,o),jl(r,r,s),Tvs(r,r),jl(r,r,o),jl(r,r,s),jl(r,r,s),jl(t[0],r,s),MJ(n,t[0]),jl(n,n,s),QBn(n,o)&&jl(t[0],t[0],yvs),MJ(n,t[0]),jl(n,n,s),QBn(n,o)?-1:(GBn(t[0])===e[31]>>7&&zde(t[0],$er,t[0]),jl(t[3],t[0],t[1]),0)}a(bvs,"unpackneg");function Svs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(Svs,"unpack25519");function Tvs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)MJ(r,r),n!==1&&jl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(Tvs,"pow2523");function QBn(t,e){var r=new Jv(32),n=new Jv(32);return Gnt(r,t),Gnt(n,e),HBn(r,0,n,0)}a(QBn,"neq25519");function HBn(t,e,r,n){return Ivs(t,e,r,n,32)}a(HBn,"crypto_verify_32");function Ivs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(Ivs,"vn");function GBn(t){var e=new Jv(32);return Gnt(e,t),e[0]&1}a(GBn,"par25519");function $Bn(t,e,r){var n,o;for(ij(t[0],$er),ij(t[1],Hnt),ij(t[2],Hnt),ij(t[3],$er),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,UBn(t,e,n),Wer(e,t),Wer(t,t),UBn(t,e,n)}a($Bn,"scalarmult");function Yer(t,e){var r=[Vi(),Vi(),Vi(),Vi()];ij(r[0],LBn),ij(r[1],FBn),ij(r[2],Hnt),jl(r[3],LBn,FBn),$Bn(t,r,e)}a(Yer,"scalarbase");function ij(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(ij,"set25519");function xvs(t,e){var r=Vi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)MJ(r,r),n!==2&&n!==4&&jl(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(xvs,"inv25519");function Her(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(Her,"car25519");function VBn(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(VBn,"sel25519");function Vi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var tT=ds();ic();sw();BRe();JBn.exports=tT.kem=tT.kem||{};var YBn=tT.jsbn.BigInteger;tT.kem.rsa={};tT.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||tT.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new YBn(tT.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(YBn.ONE)<=0);l=tT.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=tT.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};tT.kem.kdf1=function(t,e){KBn(this,t,0,e||t.digestLength)};tT.kem.kdf2=function(t,e){KBn(this,t,1,e||t.digestLength)};function KBn(t,e,r,n){t.generate=function(o,s){for(var c=new tT.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new tT.util.ByteBuffer,d=r;d{p();var fa=ds();ic();tLn.exports=fa.log=fa.log||{};fa.log.levels=["none","error","warning","info","debug","verbose","max"];var $nt={},Zer=[],GRe=null;fa.log.LEVEL_LOCKED=2;fa.log.NO_LEVEL_CHECK=4;fa.log.INTERPOLATE=8;for(YO=0;YO"u"||e?t.flags|=fa.log.LEVEL_LOCKED:t.flags&=~fa.log.LEVEL_LOCKED};fa.log.addLogger=function(t){Zer.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(XBn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},$Re=a(function(t,e){fa.log.prepareStandard(e);var r=XBn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),Yde=fa.log.makeLogger($Re)):($Re=a(function(e,r){fa.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),Yde=fa.log.makeLogger($Re)),fa.log.setLevel(Yde,"debug"),fa.log.addLogger(Yde),GRe=Yde):console={log:a(function(){},"log")};var Yde,XBn,$Re;GRe!==null&&typeof window<"u"&&window.location&&(HRe=new URL(window.location.href).searchParams,HRe.has("console.level")&&fa.log.setLevel(GRe,HRe.get("console.level").slice(-1)[0]),HRe.has("console.lock")&&(eLn=HRe.get("console.lock").slice(-1)[0],eLn=="true"&&fa.log.lock(GRe)));var HRe,eLn;fa.log.consoleLogger=GRe});var iLn=I(($Zd,nLn)=>{p();nLn.exports=qO();Snt();jde();fer();qer()});var aLn=I((WZd,sLn)=>{p();var Zr=ds();Kq();WP();MRe();Jq();xJ();Ier();sw();ic();Fnt();var Ge=Zr.asn1,V_=sLn.exports=Zr.pkcs7=Zr.pkcs7||{};V_.messageFromPem=function(t){var e=Zr.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=Ge.fromDer(e.body);return V_.messageFromAsn1(n)};V_.messageToPem=function(t,e){var r={type:"PKCS7",body:Ge.toDer(t.toAsn1()).getBytes()};return Zr.pem.encode(r,{maxline:e})};V_.messageFromAsn1=function(t){var e={},r=[];if(!Ge.validate(t,V_.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=Ge.derToOid(e.contentType),s;switch(o){case Zr.pki.oids.envelopedData:s=V_.createEnvelopedData();break;case Zr.pki.oids.encryptedData:s=V_.createEncryptedData();break;case Zr.pki.oids.signedData:s=V_.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};V_.createSignedData=function(){var t=null;return t={type:Zr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(etr(t,n,V_.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(Ge.create(Ge.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Ge.create(Ge.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Ge.create(Ge.Class.UNIVERSAL,Ge.Type.SET,!0,t.signerInfos)),Ge.create(Ge.Class.UNIVERSAL,Ge.Type.SEQUENCE,!0,[Ge.create(Ge.Class.UNIVERSAL,Ge.Type.OID,!1,Ge.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=Zr.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=Zr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Zr.pki.oids.sha1;switch(u){case Zr.pki.oids.sha1:case Zr.pki.oids.sha256:case Zr.pki.oids.sha384:case Zr.pki.oids.sha512:case Zr.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=Ge.create(Ge.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var Zh=ds();Kq();Fde();Snt();jde();ic();var Wnt=cLn.exports=Zh.ssh=Zh.ssh||{};Wnt.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r +`+l+e.substr(c+1),s=o-c-1,c=-1,++o}else(e[o]===" "||e[o]===" "||e[o]===",")&&(c=o);return e}a(Ent,"foldHeader");function YAs(t){return t.replace(/^\s+/,"")}a(YAs,"ltrim")});var vRe=I((nYd,T4n)=>{p();var Bd=us();dnt();der();ic();T4n.exports=Bd.des=Bd.des||{};Bd.des.startEncrypting=function(t,e,r,n){var o=vnt({key:t,output:r,decrypt:!1,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Bd.des.createEncryptionCipher=function(t,e){return vnt({key:t,output:null,decrypt:!1,mode:e})};Bd.des.startDecrypting=function(t,e,r,n){var o=vnt({key:t,output:r,decrypt:!0,mode:n||(e===null?"ECB":"CBC")});return o.start(e),o};Bd.des.createDecryptionCipher=function(t,e){return vnt({key:t,output:null,decrypt:!0,mode:e})};Bd.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:a(function(n,o){return S4n(r._keys,n,o,!1)},"encrypt"),decrypt:a(function(n,o){return S4n(r._keys,n,o,!0)},"decrypt")}}),r._init=!1};Bd.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=Bd.util.createBuffer(t.key);if(this.name.indexOf("3DES")===0&&e.length()!==24)throw new Error("Invalid Triple-DES key size: "+e.length()*8);this._keys=iys(e),this._init=!0}};LO("DES-ECB",Bd.cipher.modes.ecb);LO("DES-CBC",Bd.cipher.modes.cbc);LO("DES-CFB",Bd.cipher.modes.cfb);LO("DES-OFB",Bd.cipher.modes.ofb);LO("DES-CTR",Bd.cipher.modes.ctr);LO("3DES-ECB",Bd.cipher.modes.ecb);LO("3DES-CBC",Bd.cipher.modes.cbc);LO("3DES-CFB",Bd.cipher.modes.cfb);LO("3DES-OFB",Bd.cipher.modes.ofb);LO("3DES-CTR",Bd.cipher.modes.ctr);function LO(t,e){var r=a(function(){return new Bd.des.Algorithm(t,e)},"factory");Bd.cipher.registerAlgorithm(t,r)}a(LO,"registerAlgorithm");var KAs=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],JAs=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],ZAs=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],XAs=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],eys=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],tys=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],rys=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],nys=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function iys(t){for(var e=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],r=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],c=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],d=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],m=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],g=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],A=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,E=[],_=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,b,T=0;T>>4^R)&252645135,R^=b,w^=b<<4,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>2^R)&858993459,R^=b,w^=b<<2,b=(R>>>-16^w)&65535,w^=b,R^=b<<-16,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=(R>>>8^w)&16711935,w^=b,R^=b<<8,b=(w>>>1^R)&1431655765,R^=b,w^=b<<1,b=w<<8|R>>>20&240,w=R<<24|R<<8&16711680|R>>>8&65280|R>>>24&240,R=b;for(var x=0;x<_.length;++x){_[x]?(w=w<<2|w>>>26,R=R<<2|R>>>26):(w=w<<1|w>>>27,R=R<<1|R>>>27),w&=-15,R&=-15;var P=e[w>>>28]|r[w>>>24&15]|n[w>>>20&15]|o[w>>>16&15]|s[w>>>12&15]|c[w>>>8&15]|l[w>>>4&15],D=u[R>>>28]|d[R>>>24&15]|f[R>>>20&15]|h[R>>>16&15]|m[R>>>12&15]|g[R>>>8&15]|A[R>>>4&15];b=(D>>>16^P)&65535,E[v++]=P^b,E[v++]=D^b<<16}}return E}a(iys,"_createKeys");function S4n(t,e,r,n){var o=t.length===32?3:9,s;o===3?s=n?[30,-2,-2]:[0,32,2]:s=n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var c,l=e[0],u=e[1];c=(l>>>4^u)&252645135,u^=c,l^=c<<4,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,l=l<<1|l>>>31,u=u<<1|u>>>31;for(var d=0;d>>4|u<<28)^t[m+1];c=l,l=u,u=c^(JAs[g>>>24&63]|XAs[g>>>16&63]|tys[g>>>8&63]|nys[g&63]|KAs[A>>>24&63]|ZAs[A>>>16&63]|eys[A>>>8&63]|rys[A&63])}c=l,l=u,u=c}l=l>>>1|l<<31,u=u>>>1|u<<31,c=(l>>>1^u)&1431655765,u^=c,l^=c<<1,c=(u>>>8^l)&16711935,l^=c,u^=c<<8,c=(u>>>2^l)&858993459,l^=c,u^=c<<2,c=(l>>>16^u)&65535,u^=c,l^=c<<16,c=(l>>>4^u)&252645135,u^=c,l^=c<<4,r[0]=l,r[1]=u}a(S4n,"_updateBlock");function vnt(t){t=t||{};var e=(t.mode||"CBC").toUpperCase(),r="DES-"+e,n;t.decrypt?n=Bd.cipher.createDecipher(r,t.key):n=Bd.cipher.createCipher(r,t.key);var o=n.start;return n.start=function(s,c){var l=null;c instanceof Bd.util.ByteBuffer&&(l=c,c={}),c=c||{},c.output=l,c.iv=s,o.call(n,c)},n}a(vnt,"_createCipher")});var Cnt=I((sYd,I4n)=>{p();var j_=us();Mde();OO();ic();var oys=j_.pkcs5=j_.pkcs5||{},tF;j_.util.isNodejs&&!j_.options.usePureJavaScript&&(tF=require("crypto"));I4n.exports=j_.pbkdf2=oys.pbkdf2=function(t,e,r,n,o,s){if(typeof o=="function"&&(s=o,o=null),j_.util.isNodejs&&!j_.options.usePureJavaScript&&tF.pbkdf2&&(o===null||typeof o!="object")&&(tF.pbkdf2Sync.length>4||!o||o==="sha1"))return typeof o!="string"&&(o="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),s?tF.pbkdf2Sync.length===4?tF.pbkdf2(t,e,r,n,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):tF.pbkdf2(t,e,r,n,o,function(b,T){if(b)return s(b);s(null,T.toString("binary"))}):tF.pbkdf2Sync.length===4?tF.pbkdf2Sync(t,e,r,n).toString("binary"):tF.pbkdf2Sync(t,e,r,n,o).toString("binary");if((typeof o>"u"||o===null)&&(o="sha1"),typeof o=="string"){if(!(o in j_.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=j_.md[o].create()}var c=o.digestLength;if(n>4294967295*c){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var u=Math.ceil(n/c),d=n-(u-1)*c,f=j_.hmac.create();f.start(o,t);var h="",m,g,A;if(!s){for(var y=1;y<=u;++y){f.start(null,null),f.update(e),f.update(j_.util.int32ToBytes(y)),m=A=f.digest().getBytes();for(var E=2;E<=r;++E)f.start(null,null),f.update(A),g=f.digest().getBytes(),m=j_.util.xorBytes(m,g,c),A=g;h+=yu)return s(null,h);f.start(null,null),f.update(e),f.update(j_.util.int32ToBytes(y)),m=A=f.digest().getBytes(),E=2,v()}a(_,"outer");function v(){if(E<=r)return f.start(null,null),f.update(A),g=f.digest().getBytes(),m=j_.util.xorBytes(m,g,c),A=g,++E,j_.util.setImmediate(v);h+=y{p();var FO=us();OO();ic();var w4n=k4n.exports=FO.sha256=FO.sha256||{};FO.md.sha256=FO.md.algorithms.sha256=w4n;w4n.create=function(){R4n||sys();var t=null,e=FO.util.createBuffer(),r=new Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),x4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=FO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Aer.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};x4n(h,r,o);var m=FO.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m.putInt32(h.h5),m.putInt32(h.h6),m.putInt32(h.h7),m},n};var Aer=null,R4n=!1,P4n=null;function sys(){Aer="\x80",Aer+=FO.util.fillString("\0",64),P4n=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],R4n=!0}a(sys,"_init");function x4n(t,e,r){for(var n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v=r.length();v>=64;){for(d=0;d<16;++d)e[d]=r.getInt32();for(;d<64;++d)n=e[d-2],n=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=e[d-15],o=(o>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,e[d]=n+e[d-7]+o+e[d-16]|0;for(f=t.h0,h=t.h1,m=t.h2,g=t.h3,A=t.h4,y=t.h5,E=t.h6,_=t.h7,d=0;d<64;++d)c=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),l=E^A&(y^E),s=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),u=f&h|m&(f^h),n=_+c+l+P4n[d]+e[d],o=s+u,_=E,E=y,y=A,A=g+n>>>0,g=m,m=h,h=f,f=n+o>>>0;t.h0=t.h0+f|0,t.h1=t.h1+h|0,t.h2=t.h2+m|0,t.h3=t.h3+g|0,t.h4=t.h4+A|0,t.h5=t.h5+y|0,t.h6=t.h6+E|0,t.h7=t.h7+_|0,v-=64}}a(x4n,"_update")});var Eer=I((fYd,D4n)=>{p();var UO=us();ic();var bnt=null;UO.util.isNodejs&&!UO.options.usePureJavaScript&&!process.versions["node-webkit"]&&(bnt=require("crypto"));var ays=D4n.exports=UO.prng=UO.prng||{};ays.create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,n=new Array(32),o=0;o<32;++o)n[o]=r.create();e.pools=n,e.pool=0,e.generate=function(d,f){if(!f)return e.generateSync(d);var h=e.plugin.cipher,m=e.plugin.increment,g=e.plugin.formatKey,A=e.plugin.formatSeed,y=UO.util.createBuffer();e.key=null,E();function E(_){if(_)return f(_);if(y.length()>=d)return f(null,y.getBytes(d));if(e.generated>1048575&&(e.key=null),e.key===null)return UO.util.nextTick(function(){s(E)});var v=h(e.key,e.seed);e.generated+=v.length,y.putBytes(v),e.key=g(h(e.key,m(e.seed))),e.seed=A(h(e.key,e.seed)),UO.util.setImmediate(E)}a(E,"generate")},e.generateSync=function(d){var f=e.plugin.cipher,h=e.plugin.increment,m=e.plugin.formatKey,g=e.plugin.formatSeed;e.key=null;for(var A=UO.util.createBuffer();A.length()1048575&&(e.key=null),e.key===null&&c();var y=f(e.key,e.seed);e.generated+=y.length,A.putBytes(y),e.key=m(f(e.key,h(e.seed))),e.seed=g(f(e.key,e.seed))}return A.getBytes(d)};function s(d){if(e.pools[0].messageLength>=32)return l(),d();var f=32-e.pools[0].messageLength<<5;e.seedFile(f,function(h,m){if(h)return d(h);e.collect(m),l(),d()})}a(s,"_reseed");function c(){if(e.pools[0].messageLength>=32)return l();var d=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(d)),l()}a(c,"_reseedSync");function l(){e.reseeds=e.reseeds===4294967295?0:e.reseeds+1;var d=e.plugin.md.create();d.update(e.keyBytes);for(var f=1,h=0;h<32;++h)e.reseeds%f===0&&(d.update(e.pools[h].digest().getBytes()),e.pools[h].start()),f=f<<1;e.keyBytes=d.digest().getBytes(),d.start(),d.update(e.keyBytes);var m=d.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(m),e.generated=0}a(l,"_seed");function u(d){var f=null,h=UO.util.globalScope,m=h.crypto||h.msCrypto;m&&m.getRandomValues&&(f=a(function(w){return m.getRandomValues(w)},"getRandomValues"));var g=UO.util.createBuffer();if(f)for(;g.length()>16),v+=(_&32767)<<16,v+=_>>15,v=(v&2147483647)+(v>>31),T=v&4294967295;for(var E=0;E<3;++E)b=T>>>(E<<3),b^=Math.floor(Math.random()*256),g.putByte(b&255)}return g.getBytes(d)}return a(u,"defaultSeedFile"),bnt?(e.seedFile=function(d,f){bnt.randomBytes(d,function(h,m){if(h)return f(h);f(null,m.toString())})},e.seedFileSync=function(d){return bnt.randomBytes(d).toString()}):(e.seedFile=function(d,f){try{f(null,u(d))}catch(h){f(h)}},e.seedFileSync=u),e.collect=function(d){for(var f=d.length,h=0;h>m&255);e.collect(h)},e.registerWorker=function(d){if(d===self)e.seedFile=function(h,m){function g(A){var y=A.data;y.forge&&y.forge.prng&&(self.removeEventListener("message",g),m(y.forge.prng.err,y.forge.prng.bytes))}a(g,"listener"),self.addEventListener("message",g),self.postMessage({forge:{prng:{needed:h}}})};else{var f=a(function(h){var m=h.data;m.forge&&m.forge.prng&&e.seedFile(m.forge.prng.needed,function(g,A){d.postMessage({forge:{prng:{err:g,bytes:A}}})})},"listener");d.addEventListener("message",f)}},e}});var ow=I((mYd,_er)=>{p();var mg=us();Gq();yer();Eer();ic();(function(){if(mg.random&&mg.random.getBytes){_er.exports=mg.random;return}(function(t){var e={},r=new Array(4),n=mg.util.createBuffer();e.formatKey=function(h){var m=mg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),mg.aes._expandKey(h,!1)},e.formatSeed=function(h){var m=mg.util.createBuffer(h);return h=new Array(4),h[0]=m.getInt32(),h[1]=m.getInt32(),h[2]=m.getInt32(),h[3]=m.getInt32(),h},e.cipher=function(h,m){return mg.aes._updateBlock(h,m,r,!1),n.putInt32(r[0]),n.putInt32(r[1]),n.putInt32(r[2]),n.putInt32(r[3]),n.getBytes()},e.increment=function(h){return++h[3],h},e.md=mg.md.sha256;function o(){var h=mg.prng.create(e);return h.getBytes=function(m,g){return h.generate(m,g)},h.getBytesSync=function(m){return h.generate(m)},h}a(o,"spawnPrng");var s=o(),c=null,l=mg.util.globalScope,u=l.crypto||l.msCrypto;if(u&&u.getRandomValues&&(c=a(function(h){return u.getRandomValues(h)},"getRandomValues")),mg.options.usePureJavaScript||!mg.util.isNodejs&&!c){if(typeof window>"u"||window.document,s.collectInt(+new Date,32),typeof navigator<"u"){var d="";for(var f in navigator)try{typeof navigator[f]=="string"&&(d+=navigator[f])}catch{}s.collect(d),d=null}t&&(t().mousemove(function(h){s.collectInt(h.clientX,16),s.collectInt(h.clientY,16)}),t().keypress(function(h){s.collectInt(h.charCode,8)}))}if(!mg.random)mg.random=s;else for(var f in s)mg.random[f]=s[f];mg.random.createInstance=o,_er.exports=mg.random})(typeof jQuery<"u"?jQuery:null)})()});var Cer=I((yYd,O4n)=>{p();var $C=us();ic();var ver=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],N4n=[1,2,3,5],cys=a(function(t,e){return t<>16-e},"rol"),lys=a(function(t,e){return(t&65535)>>e|t<<16-e&65535},"ror");O4n.exports=$C.rc2=$C.rc2||{};$C.rc2.expandKey=function(t,e){typeof t=="string"&&(t=$C.util.createBuffer(t)),e=e||128;var r=t,n=t.length(),o=e,s=Math.ceil(o/8),c=255>>(o&7),l;for(l=n;l<128;l++)r.putByte(ver[r.at(l-1)+r.at(l-n)&255]);for(r.setAt(128-s,ver[r.at(128-s)&c]),l=127-s;l>=0;l--)r.setAt(l,ver[r.at(l+1)^r.at(l+s)]);return r};var M4n=a(function(t,e,r){var n=!1,o=null,s=null,c=null,l,u,d,f,h=[];for(t=$C.rc2.expandKey(t,e),d=0;d<64;d++)h.push(t.getInt16Le());r?(l=a(function(A){for(d=0;d<4;d++)A[d]+=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),A[d]=cys(A[d],N4n[d]),f++},"mixRound"),u=a(function(A){for(d=0;d<4;d++)A[d]+=h[A[(d+3)%4]&63]},"mashRound")):(l=a(function(A){for(d=3;d>=0;d--)A[d]=lys(A[d],N4n[d]),A[d]-=h[f]+(A[(d+3)%4]&A[(d+2)%4])+(~A[(d+3)%4]&A[(d+1)%4]),f--},"mixRound"),u=a(function(A){for(d=3;d>=0;d--)A[d]-=h[A[(d+3)%4]&63]},"mashRound"));var m=a(function(A){var y=[];for(d=0;d<4;d++){var E=o.getInt16Le();c!==null&&(r?E^=c.getInt16Le():c.putInt16Le(E)),y.push(E&65535)}f=r?0:63;for(var _=0;_=8;)m([[5,l],[1,u],[6,l],[1,u],[5,l]])},"update"),finish:a(function(A){var y=!0;if(r)if(A)y=A(8,o,!r);else{var E=o.length()===8?8:8-o.length();o.fillWithByte(E,E)}if(y&&(n=!0,g.update()),!r&&(y=o.length()===0,y))if(A)y=A(8,s,!r);else{var _=s.length(),v=s.at(_-1);v>_?y=!1:s.truncate(v)}return y},"finish")},g},"createCipher");$C.rc2.startEncrypting=function(t,e,r){var n=$C.rc2.createEncryptionCipher(t,128);return n.start(e,r),n};$C.rc2.createEncryptionCipher=function(t,e){return M4n(t,e,!0)};$C.rc2.startDecrypting=function(t,e,r){var n=$C.rc2.createDecryptionCipher(t,128);return n.start(e,r),n};$C.rc2.createDecryptionCipher=function(t,e){return M4n(t,e,!1)}});var bRe=I((vYd,H4n)=>{p();var ber=us();H4n.exports=ber.jsbn=ber.jsbn||{};var rF,uys=0xdeadbeefcafe,B4n=(uys&16777215)==15715070;function Wt(t,e,r){this.data=[],t!=null&&(typeof t=="number"?this.fromNumber(t,e,r):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}a(Wt,"BigInteger");ber.jsbn.BigInteger=Wt;function Ha(){return new Wt(null)}a(Ha,"nbi");function dys(t,e,r,n,o,s){for(;--s>=0;){var c=e*this.data[t++]+r.data[n]+o;o=Math.floor(c/67108864),r.data[n++]=c&67108863}return o}a(dys,"am1");function fys(t,e,r,n,o,s){for(var c=e&32767,l=e>>15;--s>=0;){var u=this.data[t]&32767,d=this.data[t++]>>15,f=l*u+d*c;u=c*u+((f&32767)<<15)+r.data[n]+(o&1073741823),o=(u>>>30)+(f>>>15)+l*d+(o>>>30),r.data[n++]=u&1073741823}return o}a(fys,"am2");function L4n(t,e,r,n,o,s){for(var c=e&16383,l=e>>14;--s>=0;){var u=this.data[t]&16383,d=this.data[t++]>>14,f=l*u+d*c;u=c*u+((f&16383)<<14)+r.data[n]+o,o=(u>>28)+(f>>14)+l*d,r.data[n++]=u&268435455}return o}a(L4n,"am3");typeof navigator>"u"?(Wt.prototype.am=L4n,rF=28):B4n&&navigator.appName=="Microsoft Internet Explorer"?(Wt.prototype.am=fys,rF=30):B4n&&navigator.appName!="Netscape"?(Wt.prototype.am=dys,rF=26):(Wt.prototype.am=L4n,rF=28);Wt.prototype.DB=rF;Wt.prototype.DM=(1<=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s}a(hys,"bnpCopyTo");function mys(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0}a(mys,"bnpFromInt");function Vq(t){var e=Ha();return e.fromInt(t),e}a(Vq,"nbv");function gys(t,e){var r;if(e==16)r=4;else if(e==8)r=3;else if(e==256)r=8;else if(e==2)r=1;else if(e==32)r=5;else if(e==4)r=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,o=!1,s=0;--n>=0;){var c=r==8?t[n]&255:U4n(t,n);if(c<0){t.charAt(n)=="-"&&(o=!0);continue}o=!1,s==0?this.data[this.t++]=c:s+r>this.DB?(this.data[this.t-1]|=(c&(1<>this.DB-s):this.data[this.t-1]|=c<=this.DB&&(s-=this.DB)}r==8&&(t[0]&128)!=0&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t}a(Ays,"bnpClamp");function yys(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var r=(1<0)for(l>l)>0&&(o=!0,s=F4n(n));c>=0;)l>(l+=this.DB-e)):(n=this.data[c]>>(l-=e)&r,l<=0&&(l+=this.DB,--c)),n>0&&(o=!0),o&&(s+=F4n(n));return o?s:"0"}a(yys,"bnToString");function Eys(){var t=Ha();return Wt.ZERO.subTo(this,t),t}a(Eys,"bnNegate");function _ys(){return this.s<0?this.negate():this}a(_ys,"bnAbs");function vys(t){var e=this.s-t.s;if(e!=0)return e;var r=this.t;if(e=r-t.t,e!=0)return this.s<0?-e:e;for(;--r>=0;)if((e=this.data[r]-t.data[r])!=0)return e;return 0}a(vys,"bnCompareTo");function Tnt(t){var e=1,r;return(r=t>>>16)!=0&&(t=r,e+=16),(r=t>>8)!=0&&(t=r,e+=8),(r=t>>4)!=0&&(t=r,e+=4),(r=t>>2)!=0&&(t=r,e+=2),(r=t>>1)!=0&&(t=r,e+=1),e}a(Tnt,"nbits");function Cys(){return this.t<=0?0:this.DB*(this.t-1)+Tnt(this.data[this.t-1]^this.s&this.DM)}a(Cys,"bnBitLength");function bys(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s}a(bys,"bnpDLShiftTo");function Sys(t,e){for(var r=t;r=0;--l)e.data[l+s+1]=this.data[l]>>n|c,c=(this.data[l]&o)<=0;--l)e.data[l]=0;e.data[s]=c,e.t=this.t+s+1,e.s=this.s,e.clamp()}a(Tys,"bnpLShiftTo");function Iys(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var n=t%this.DB,o=this.DB-n,s=(1<>n;for(var c=r+1;c>n;n>0&&(e.data[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()}a(xys,"bnpSubTo");function wys(t,e){var r=this.abs(),n=t.abs(),o=r.t;for(e.t=o+n.t;--o>=0;)e.data[o]=0;for(o=0;o=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()}a(Rys,"bnpSquareTo");function Pys(t,e,r){var n=t.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(u,s),o.lShiftTo(u,r)):(n.copyTo(s),o.copyTo(r));var d=s.t,f=s.data[d-1];if(f!=0){var h=f*(1<1?s.data[d-2]>>this.F2:0),m=this.FV/h,g=(1<=0&&(r.data[r.t++]=1,r.subTo(_,r)),Wt.ONE.dlShiftTo(d,_),_.subTo(s,s);s.t=0;){var v=r.data[--y]==f?this.DM:Math.floor(r.data[y]*m+(r.data[y-1]+A)*g);if((r.data[y]+=s.am(0,v,r,E,0,d))0&&r.rShiftTo(u,r),c<0&&Wt.ZERO.subTo(r,r)}}}a(Pys,"bnpDivRemTo");function kys(t){var e=Ha();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(Wt.ZERO)>0&&t.subTo(e,e),e}a(kys,"bnMod");function _J(t){this.m=t}a(_J,"Classic");function Dys(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}a(Dys,"cConvert");function Nys(t){return t}a(Nys,"cRevert");function Mys(t){t.divRemTo(this.m,null,t)}a(Mys,"cReduce");function Oys(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(Oys,"cMulTo");function Bys(t,e){t.squareTo(e),this.reduce(e)}a(Bys,"cSqrTo");_J.prototype.convert=Dys;_J.prototype.revert=Nys;_J.prototype.reduce=Mys;_J.prototype.mulTo=Oys;_J.prototype.sqrTo=Bys;function Lys(){if(this.t<1)return 0;var t=this.data[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}a(Lys,"bnpInvDigit");function vJ(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e}a(Fys,"montConvert");function Uys(t){var e=Ha();return t.copyTo(e),this.reduce(e),e}a(Uys,"montRevert");function Qys(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}a(Qys,"montReduce");function qys(t,e){t.squareTo(e),this.reduce(e)}a(qys,"montSqrTo");function jys(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(jys,"montMulTo");vJ.prototype.convert=Fys;vJ.prototype.revert=Uys;vJ.prototype.reduce=Qys;vJ.prototype.mulTo=jys;vJ.prototype.sqrTo=qys;function Hys(){return(this.t>0?this.data[0]&1:this.s)==0}a(Hys,"bnpIsEven");function Gys(t,e){if(t>4294967295||t<1)return Wt.ONE;var r=Ha(),n=Ha(),o=e.convert(this),s=Tnt(t)-1;for(o.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,o,r);else{var c=r;r=n,n=c}return e.revert(r)}a(Gys,"bnpExp");function $ys(t,e){var r;return t<256||e.isEven()?r=new _J(e):r=new vJ(e),this.exp(t,r)}a($ys,"bnModPowInt");Wt.prototype.copyTo=hys;Wt.prototype.fromInt=mys;Wt.prototype.fromString=gys;Wt.prototype.clamp=Ays;Wt.prototype.dlShiftTo=bys;Wt.prototype.drShiftTo=Sys;Wt.prototype.lShiftTo=Tys;Wt.prototype.rShiftTo=Iys;Wt.prototype.subTo=xys;Wt.prototype.multiplyTo=wys;Wt.prototype.squareTo=Rys;Wt.prototype.divRemTo=Pys;Wt.prototype.invDigit=Lys;Wt.prototype.isEven=Hys;Wt.prototype.exp=Gys;Wt.prototype.toString=yys;Wt.prototype.negate=Eys;Wt.prototype.abs=_ys;Wt.prototype.compareTo=vys;Wt.prototype.bitLength=Cys;Wt.prototype.mod=kys;Wt.prototype.modPowInt=$ys;Wt.ZERO=Vq(0);Wt.ONE=Vq(1);function Vys(){var t=Ha();return this.copyTo(t),t}a(Vys,"bnClone");function Wys(){if(this.s<0){if(this.t==1)return this.data[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this.data[0];if(this.t==0)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24}a(zys,"bnByteValue");function Yys(){return this.t==0?this.s:this.data[0]<<16>>16}a(Yys,"bnShortValue");function Kys(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}a(Kys,"bnpChunkSize");function Jys(){return this.s<0?-1:this.t<=0||this.t==1&&this.data[0]<=0?0:1}a(Jys,"bnSigNum");function Zys(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=Vq(r),o=Ha(),s=Ha(),c="";for(this.divRemTo(n,o,s);o.signum()>0;)c=(r+s.intValue()).toString(t).substr(1)+c,o.divRemTo(n,o,s);return s.intValue().toString(t)+c}a(Zys,"bnpToRadix");function Xys(t,e){this.fromInt(0),e==null&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),o=!1,s=0,c=0,l=0;l=r&&(this.dMultiply(n),this.dAddOffset(c,0),s=0,c=0)}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(c,0)),o&&Wt.ZERO.subTo(this,this)}a(Xys,"bnpFromRadix");function eEs(t,e,r){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(Wt.ONE.shiftLeft(t-1),Ter,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(Wt.ONE.shiftLeft(t-1),this);else{var n=new Array,o=t&7;n.length=(t>>3)+1,e.nextBytes(n),o>0?n[0]&=(1<0)for(r>r)!=(this.s&this.DM)>>r&&(e[o++]=n|this.s<=0;)r<8?(n=(this.data[t]&(1<>(r+=this.DB-8)):(n=this.data[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),(n&128)!=0&&(n|=-256),o==0&&(this.s&128)!=(n&128)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e}a(tEs,"bnToByteArray");function rEs(t){return this.compareTo(t)==0}a(rEs,"bnEquals");function nEs(t){return this.compareTo(t)<0?this:t}a(nEs,"bnMin");function iEs(t){return this.compareTo(t)>0?this:t}a(iEs,"bnMax");function oEs(t,e,r){var n,o,s=Math.min(t.t,this.t);for(n=0;n>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}a(hEs,"lbit");function mEs(){for(var t=0;t=this.t?this.s!=0:(this.data[e]&1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()}a(bEs,"bnpAddTo");function SEs(t){var e=Ha();return this.addTo(t,e),e}a(SEs,"bnAdd");function TEs(t){var e=Ha();return this.subTo(t,e),e}a(TEs,"bnSubtract");function IEs(t){var e=Ha();return this.multiplyTo(t,e),e}a(IEs,"bnMultiply");function xEs(){var t=Ha();return this.squareTo(t),t}a(xEs,"bnSquare");function wEs(t){var e=Ha();return this.divRemTo(t,e,null),e}a(wEs,"bnDivide");function REs(t){var e=Ha();return this.divRemTo(t,null,e),e}a(REs,"bnRemainder");function PEs(t){var e=Ha(),r=Ha();return this.divRemTo(t,e,r),new Array(e,r)}a(PEs,"bnDivideAndRemainder");function kEs(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}a(kEs,"bnpDMultiply");function DEs(t,e){if(t!=0){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}}a(DEs,"bnpDAddOffset");function CRe(){}a(CRe,"NullExp");function j4n(t){return t}a(j4n,"nNop");function NEs(t,e,r){t.multiplyTo(e,r)}a(NEs,"nMulTo");function MEs(t,e){t.squareTo(e)}a(MEs,"nSqrTo");CRe.prototype.convert=j4n;CRe.prototype.revert=j4n;CRe.prototype.mulTo=NEs;CRe.prototype.sqrTo=MEs;function OEs(t){return this.exp(t,new CRe)}a(OEs,"bnPow");function BEs(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r.data[--n]=0;var o;for(o=r.t-this.t;n=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=Ha();return t.copyTo(e),this.reduce(e),e}a(FEs,"barrettConvert");function UEs(t){return t}a(UEs,"barrettRevert");function QEs(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}a(QEs,"barrettReduce");function qEs(t,e){t.squareTo(e),this.reduce(e)}a(qEs,"barrettSqrTo");function jEs(t,e,r){t.multiplyTo(e,r),this.reduce(r)}a(jEs,"barrettMulTo");Lde.prototype.convert=FEs;Lde.prototype.revert=UEs;Lde.prototype.reduce=QEs;Lde.prototype.mulTo=jEs;Lde.prototype.sqrTo=qEs;function HEs(t,e){var r=t.bitLength(),n,o=Vq(1),s;if(r<=0)return o;r<18?n=1:r<48?n=3:r<144?n=4:r<768?n=5:n=6,r<8?s=new _J(e):e.isEven()?s=new Lde(e):s=new vJ(e);var c=new Array,l=3,u=n-1,d=(1<1){var f=Ha();for(s.sqrTo(c[1],f);l<=d;)c[l]=Ha(),s.mulTo(f,c[l-2],c[l]),l+=2}var h=t.t-1,m,g=!0,A=Ha(),y;for(r=Tnt(t.data[h])-1;h>=0;){for(r>=u?m=t.data[h]>>r-u&d:(m=(t.data[h]&(1<0&&(m|=t.data[h-1]>>this.DB+r-u)),l=n;(m&1)==0;)m>>=1,--l;if((r-=l)<0&&(r+=this.DB,--h),g)c[m].copyTo(o),g=!1;else{for(;l>1;)s.sqrTo(o,A),s.sqrTo(A,o),l-=2;l>0?s.sqrTo(o,A):(y=o,o=A,A=y),s.mulTo(A,c[m],o)}for(;h>=0&&(t.data[h]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}a(GEs,"bnGCD");function $Es(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(e==0)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r}a($Es,"bnpModInt");function VEs(t){if(this.signum()==0)return Wt.ZERO;var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return Wt.ZERO;for(var r=t.clone(),n=this.clone(),o=Vq(1),s=Vq(0),c=Vq(0),l=Vq(1);r.signum()!=0;){for(;r.isEven();)r.rShiftTo(1,r),e?((!o.isEven()||!s.isEven())&&(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?((!c.isEven()||!l.isEven())&&(c.addTo(this,c),l.subTo(t,l)),c.rShiftTo(1,c)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(n)>=0?(r.subTo(n,r),e&&o.subTo(c,o),s.subTo(l,s)):(n.subTo(r,n),e&&c.subTo(o,c),l.subTo(s,l))}if(n.compareTo(Wt.ONE)!=0)return Wt.ZERO;if(l.compareTo(t)>=0)return l.subtract(t);if(l.signum()<0)l.addTo(t,l);else return l;return l.signum()<0?l.add(t):l}a(VEs,"bnModInverse");var Vk=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],WEs=(1<<26)/Vk[Vk.length-1];function zEs(t){var e,r=this.abs();if(r.t==1&&r.data[0]<=Vk[Vk.length-1]){for(e=0;e=0);var l=s.modPow(n,this);if(l.compareTo(Wt.ONE)!=0&&l.compareTo(e)!=0){for(var u=1;u++{p();var QO=us();OO();ic();var $4n=W4n.exports=QO.sha1=QO.sha1||{};QO.md.sha1=QO.md.algorithms.sha1=$4n;$4n.create=function(){V4n||JEs();var t=null,e=QO.util.createBuffer(),r=new Array(80),n={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8};return n.start=function(){n.messageLength=0,n.fullMessageLength=n.messageLength64=[];for(var o=n.messageLengthSize/4,s=0;s>>0,c>>>0];for(var l=n.fullMessageLength.length-1;l>=0;--l)n.fullMessageLength[l]+=c[1],c[1]=c[0]+(n.fullMessageLength[l]/4294967296>>>0),n.fullMessageLength[l]=n.fullMessageLength[l]>>>0,c[0]=c[1]/4294967296>>>0;return e.putBytes(o),G4n(t,r,e),(e.read>2048||e.length()===0)&&e.compact(),n},n.digest=function(){var o=QO.util.createBuffer();o.putBytes(e.bytes());var s=n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize,c=s&n.blockLength-1;o.putBytes(Ier.substr(0,n.blockLength-c));for(var l,u,d=n.fullMessageLength[0]*8,f=0;f>>0,d+=u,o.putInt32(d>>>0),d=l>>>0;o.putInt32(d);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};G4n(h,r,o);var m=QO.util.createBuffer();return m.putInt32(h.h0),m.putInt32(h.h1),m.putInt32(h.h2),m.putInt32(h.h3),m.putInt32(h.h4),m},n};var Ier=null,V4n=!1;function JEs(){Ier="\x80",Ier+=QO.util.fillString("\0",64),V4n=!0}a(JEs,"_init");function G4n(t,e,r){for(var n,o,s,c,l,u,d,f,h=r.length();h>=64;){for(o=t.h0,s=t.h1,c=t.h2,l=t.h3,u=t.h4,f=0;f<16;++f)n=r.getInt32(),e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<20;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=l^s&(c^l),n=(o<<5|o>>>27)+d+u+1518500249+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<32;++f)n=e[f-3]^e[f-8]^e[f-14]^e[f-16],n=n<<1|n>>>31,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<40;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+1859775393+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<60;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s&c|l&(s^c),n=(o<<5|o>>>27)+d+u+2400959708+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;for(;f<80;++f)n=e[f-6]^e[f-16]^e[f-28]^e[f-32],n=n<<2|n>>>30,e[f]=n,d=s^c^l,n=(o<<5|o>>>27)+d+u+3395469782+n,u=l,l=c,c=(s<<30|s>>>2)>>>0,s=o,o=n;t.h0=t.h0+o|0,t.h1=t.h1+s|0,t.h2=t.h2+c|0,t.h3=t.h3+l|0,t.h4=t.h4+u|0,h-=64}}a(G4n,"_update")});var xer=I((xYd,Y4n)=>{p();var qO=us();ic();ow();Fde();var z4n=Y4n.exports=qO.pkcs1=qO.pkcs1||{};z4n.encode_rsa_oaep=function(t,e,r){var n,o,s,c;typeof r=="string"?(n=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(n=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),s?s.start():s=qO.md.sha1.create(),c||(c=s);var l=Math.ceil(t.n.bitLength()/8),u=l-2*s.digestLength-2;if(e.length>u){var d=new Error("RSAES-OAEP input message length is too long.");throw d.length=e.length,d.maxLength=u,d}n||(n=""),s.update(n,"raw");for(var f=s.digest(),h="",m=u-e.length,g=0;g>24&255,s>>16&255,s>>8&255,s&255);r.start(),r.update(t+c),n+=r.digest().getBytes()}return n.substring(0,e)}a(Int,"rsa_mgf1")});var Rer=I((PYd,wer)=>{p();var Wq=us();ic();bRe();ow();(function(){if(Wq.prime){wer.exports=Wq.prime;return}var t=wer.exports=Wq.prime=Wq.prime||{},e=Wq.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],n=new e(null);n.fromInt(30);var o=a(function(h,m){return h|m},"op_or");t.generateProbablePrime=function(h,m,g){typeof m=="function"&&(g=m,m={}),m=m||{};var A=m.algorithm||"PRIMEINC";typeof A=="string"&&(A={name:A}),A.options=A.options||{};var y=m.prng||Wq.random,E={nextBytes:a(function(_){for(var v=y.getBytesSync(_.length),b=0;b<_.length;++b)_[b]=v.charCodeAt(b)},"nextBytes")};if(A.name==="PRIMEINC")return s(h,E,A.options,g);throw new Error("Invalid prime generation algorithm: "+A.name)};function s(h,m,g,A){return"workers"in g?u(h,m,g,A):c(h,m,g,A)}a(s,"primeincFindPrime");function c(h,m,g,A){var y=d(h,m),E=0,_=f(y.bitLength());"millerRabinTests"in g&&(_=g.millerRabinTests);var v=10;"maxBlockTime"in g&&(v=g.maxBlockTime),l(y,h,m,E,_,v,A)}a(c,"primeincFindPrimeWithoutWorkers");function l(h,m,g,A,y,E,_){var v=+new Date;do{if(h.bitLength()>m&&(h=d(m,g)),h.isProbablePrime(y))return _(null,h);h.dAddOffset(r[A++%8],0)}while(E<0||+new Date-v"u")return c(h,m,g,A);var y=d(h,m),E=g.workers,_=g.workLoad||100,v=_*30/8,b=g.workerScript||"forge/prime.worker.js";if(E===-1)return Wq.util.estimateCores(function(w,R){w&&(R=2),E=R-1,T()});T();function T(){E=Math.max(1,E);for(var w=[],R=0;Rh&&(y=d(h,m));var j=y.toString(16);N.target.postMessage({hex:j,workLoad:_}),y.dAddOffset(v,0)}}a(D,"workerMessage")}a(T,"generate")}a(u,"primeincFindPrimeWithWorkers");function d(h,m){var g=new e(h,m),A=h-1;return g.testBit(A)||g.bitwiseTo(e.ONE.shiftLeft(A),o,g),g.dAddOffset(31-g.mod(n).byteValue(),0),g}a(d,"generateRandom");function f(h){return h<=100?27:h<=150?18:h<=200?15:h<=250?12:h<=300?9:h<=350?8:h<=400?7:h<=500?6:h<=600?5:h<=800?4:h<=1250?3:2}a(f,"getMillerRabinTests")})()});var SRe=I((NYd,rBn)=>{p();var _i=us();$k();bRe();$q();xer();Rer();ow();ic();typeof Ga>"u"&&(Ga=_i.jsbn.BigInteger);var Ga,Per=_i.util.isNodejs?require("crypto"):null,pt=_i.asn1,aw=_i.util;_i.pki=_i.pki||{};rBn.exports=_i.pki.rsa=_i.rsa=_i.rsa||{};var Lo=_i.pki,ZEs=[6,4,2,4,2,4,6,2],XEs={name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},e_s={name:"RSAPrivateKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},t_s={name:"RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:pt.Class.UNIVERSAL,type:pt.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},r_s=_i.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},n_s={name:"DigestInfo",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:pt.Class.UNIVERSAL,type:pt.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:pt.Class.UNIVERSAL,type:pt.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:pt.Class.UNIVERSAL,type:pt.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},i_s=a(function(t){var e;if(t.algorithm in Lo.oids)e=Lo.oids[t.algorithm];else{var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}var n=pt.oidToDer(e).getBytes(),o=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]),s=pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[]);s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,n)),s.value.push(pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,""));var c=pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,t.digest().getBytes());return o.value.push(s),o.value.push(c),pt.toDer(o).getBytes()},"emsaPkcs1v15encode"),eBn=a(function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);e.dP||(e.dP=e.d.mod(e.p.subtract(Ga.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(Ga.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));var n;do n=new Ga(_i.util.bytesToHex(_i.random.getBytes(e.n.bitLength()/8)),16);while(n.compareTo(e.n)>=0||!n.gcd(e.n).equals(Ga.ONE));t=t.multiply(n.modPow(e.e,e.n)).mod(e.n);for(var o=t.mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);o.compareTo(s)<0;)o=o.add(e.p);var c=o.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return c=c.multiply(n.modInverse(e.n)).mod(e.n),c},"_modPow");Lo.rsa.encrypt=function(t,e,r){var n=r,o,s=Math.ceil(e.n.bitLength()/8);r!==!1&&r!==!0?(n=r===2,o=tBn(t,e,r)):(o=_i.util.createBuffer(),o.putBytes(t));for(var c=new Ga(o.toHex(),16),l=eBn(c,e,n),u=l.toString(16),d=_i.util.createBuffer(),f=s-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.util.hexToBytes(u)),d.getBytes()};Lo.rsa.decrypt=function(t,e,r,n){var o=Math.ceil(e.n.bitLength()/8);if(t.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=o,s}var c=new Ga(_i.util.createBuffer(t).toHex(),16);if(c.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=eBn(c,e,r),u=l.toString(16),d=_i.util.createBuffer(),f=o-Math.ceil(u.length/2);f>0;)d.putByte(0),--f;return d.putBytes(_i.util.hexToBytes(u)),n!==!1?xnt(d.getBytes(),e,r):d.getBytes()};Lo.rsa.createKeyPairGenerationState=function(t,e,r){typeof t=="string"&&(t=parseInt(t,10)),t=t||2048,r=r||{};var n=r.prng||_i.random,o={nextBytes:a(function(l){for(var u=n.getBytesSync(l.length),d=0;d>1,pBits:t-(t>>1),pqState:0,num:null,keys:null},c.e.fromInt(c.eInt);else throw new Error("Invalid key generation algorithm: "+s);return c};Lo.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new Ga(null);r.fromInt(30);for(var n=0,o=a(function(h,m){return h|m},"op_or"),s=+new Date,c,l=0;t.keys===null&&(e<=0||lu?t.pqState=0:t.num.isProbablePrime(s_s(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(ZEs[n++%8],0):t.pqState===2?t.pqState=t.num.subtract(Ga.ONE).gcd(t.e).compareTo(Ga.ONE)===0?3:0:t.pqState===3&&(t.pqState=0,t.p===null?t.p=t.num:t.q=t.num,t.p!==null&&t.q!==null&&++t.state,t.num=null)}else if(t.state===1)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(t.state===2)t.p1=t.p.subtract(Ga.ONE),t.q1=t.q.subtract(Ga.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(t.state===3)t.phi.gcd(t.e).compareTo(Ga.ONE)===0?++t.state:(t.p=null,t.q=null,t.state=0);else if(t.state===4)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(t.state===5){var f=t.e.modInverse(t.phi);t.keys={privateKey:Lo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:Lo.rsa.setPublicKey(t.n,t.e)}}c=+new Date,l+=c-s,s=c}return t.keys!==null};Lo.rsa.generateKeyPair=function(t,e,r,n){if(arguments.length===1?typeof t=="object"?(r=t,t=void 0):typeof t=="function"&&(n=t,t=void 0):arguments.length===2?typeof t=="number"?typeof e=="function"?(n=e,e=void 0):typeof e!="number"&&(r=e,e=void 0):(r=t,n=e,t=void 0,e=void 0):arguments.length===3&&(typeof e=="number"?typeof r=="function"&&(n=r,r=void 0):(n=r,r=e,e=void 0)),r=r||{},t===void 0&&(t=r.bits||2048),e===void 0&&(e=r.e||65537),!_i.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(e===65537||e===3)){if(n){if(K4n("generateKeyPair"))return Per.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(l,u,d){if(l)return n(l);n(null,{privateKey:Lo.privateKeyFromPem(d),publicKey:Lo.publicKeyFromPem(u)})});if(J4n("generateKey")&&J4n("exportKey"))return aw.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:X4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(l){return aw.globalScope.crypto.subtle.exportKey("pkcs8",l.privateKey)}).then(void 0,function(l){n(l)}).then(function(l){if(l){var u=Lo.privateKeyFromAsn1(pt.fromDer(_i.util.createBuffer(l)));n(null,{privateKey:u,publicKey:Lo.setRsaPublicKey(u.n,u.e)})}});if(Z4n("generateKey")&&Z4n("exportKey")){var o=aw.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:X4n(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);o.oncomplete=function(l){var u=l.target.result,d=aw.globalScope.msCrypto.subtle.exportKey("pkcs8",u.privateKey);d.oncomplete=function(f){var h=f.target.result,m=Lo.privateKeyFromAsn1(pt.fromDer(_i.util.createBuffer(h)));n(null,{privateKey:m,publicKey:Lo.setRsaPublicKey(m.n,m.e)})},d.onerror=function(f){n(f)}},o.onerror=function(l){n(l)};return}}else if(K4n("generateKeyPairSync")){var s=Per.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:Lo.privateKeyFromPem(s.privateKey),publicKey:Lo.publicKeyFromPem(s.publicKey)}}}var c=Lo.rsa.createKeyPairGenerationState(t,e,r);if(!n)return Lo.rsa.stepKeyPairGenerationState(c,0),c.keys;o_s(c,r,n)};Lo.setRsaPublicKey=Lo.rsa.setPublicKey=function(t,e){var r={n:t,e};return r.encrypt=function(n,o,s){if(typeof o=="string"?o=o.toUpperCase():o===void 0&&(o="RSAES-PKCS1-V1_5"),o==="RSAES-PKCS1-V1_5")o={encode:a(function(l,u,d){return tBn(l,u,2).getBytes()},"encode")};else if(o==="RSA-OAEP"||o==="RSAES-OAEP")o={encode:a(function(l,u){return _i.pkcs1.encode_rsa_oaep(u,l,s)},"encode")};else if(["RAW","NONE","NULL",null].indexOf(o)!==-1)o={encode:a(function(l){return l},"encode")};else if(typeof o=="string")throw new Error('Unsupported encryption scheme: "'+o+'".');var c=o.encode(n,r,!0);return Lo.rsa.encrypt(c,r,!0)},r.verify=function(n,o,s,c){typeof s=="string"?s=s.toUpperCase():s===void 0&&(s="RSASSA-PKCS1-V1_5"),c===void 0&&(c={_parseAllDigestBytes:!0,_skipPaddingChecks:!1}),"_parseAllDigestBytes"in c||(c._parseAllDigestBytes=!0),"_skipPaddingChecks"in c||(c._skipPaddingChecks=!1),s==="RSASSA-PKCS1-V1_5"?s={verify:a(function(u,d){d=xnt(d,r,!0,void 0,c);var f=pt.fromDer(d,{parseAllBytes:c._parseAllDigestBytes}),h={},m=[];if(!pt.validate(f,n_s,h,m)||f.value.length!==2){var g=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.");throw g.errors=m,g}var A=pt.derToOid(h.algorithmIdentifier);if(!(A===_i.oids.md2||A===_i.oids.md5||A===_i.oids.sha1||A===_i.oids.sha224||A===_i.oids.sha256||A===_i.oids.sha384||A===_i.oids.sha512||A===_i.oids["sha512-224"]||A===_i.oids["sha512-256"])){var g=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.");throw g.oid=A,g}if((A===_i.oids.md2||A===_i.oids.md5)&&!("parameters"in h))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters.");return u===h.digest},"verify")}:(s==="NONE"||s==="NULL"||s===null)&&(s={verify:a(function(u,d){return d=xnt(d,r,!0,void 0,c),u===d},"verify")});var l=Lo.rsa.decrypt(o,r,!0,!1);return s.verify(n,l,r.n.bitLength())},r};Lo.setRsaPrivateKey=Lo.rsa.setPrivateKey=function(t,e,r,n,o,s,c,l){var u={n:t,e,d:r,p:n,q:o,dP:s,dQ:c,qInv:l};return u.decrypt=function(d,f,h){typeof f=="string"?f=f.toUpperCase():f===void 0&&(f="RSAES-PKCS1-V1_5");var m=Lo.rsa.decrypt(d,u,!1,!1);if(f==="RSAES-PKCS1-V1_5")f={decode:xnt};else if(f==="RSA-OAEP"||f==="RSAES-OAEP")f={decode:a(function(g,A){return _i.pkcs1.decode_rsa_oaep(A,g,h)},"decode")};else if(["RAW","NONE","NULL",null].indexOf(f)!==-1)f={decode:a(function(g){return g},"decode")};else throw new Error('Unsupported encryption scheme: "'+f+'".');return f.decode(m,u,!1)},u.sign=function(d,f){var h=!1;typeof f=="string"&&(f=f.toUpperCase()),f===void 0||f==="RSASSA-PKCS1-V1_5"?(f={encode:i_s},h=1):(f==="NONE"||f==="NULL"||f===null)&&(f={encode:a(function(){return d},"encode")},h=1);var m=f.encode(d,u.n.bitLength());return Lo.rsa.encrypt(m,u,h)},u};Lo.wrapRsaPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(Lo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.OCTETSTRING,!1,pt.toDer(t).getBytes())])};Lo.privateKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,XEs,e,r)&&(t=pt.fromDer(_i.util.createBuffer(e.privateKey))),e={},r=[],!pt.validate(t,e_s,e,r)){var n=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw n.errors=r,n}var o,s,c,l,u,d,f,h;return o=_i.util.createBuffer(e.privateKeyModulus).toHex(),s=_i.util.createBuffer(e.privateKeyPublicExponent).toHex(),c=_i.util.createBuffer(e.privateKeyPrivateExponent).toHex(),l=_i.util.createBuffer(e.privateKeyPrime1).toHex(),u=_i.util.createBuffer(e.privateKeyPrime2).toHex(),d=_i.util.createBuffer(e.privateKeyExponent1).toHex(),f=_i.util.createBuffer(e.privateKeyExponent2).toHex(),h=_i.util.createBuffer(e.privateKeyCoefficient).toHex(),Lo.setRsaPrivateKey(new Ga(o,16),new Ga(s,16),new Ga(c,16),new Ga(l,16),new Ga(u,16),new Ga(d,16),new Ga(f,16),new Ga(h,16))};Lo.privateKeyToAsn1=Lo.privateKeyToRSAPrivateKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,pt.integerToDer(0).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.e)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.d)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.p)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.q)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.dP)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.dQ)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.qInv))])};Lo.publicKeyFromAsn1=function(t){var e={},r=[];if(pt.validate(t,r_s,e,r)){var n=pt.derToOid(e.publicKeyOid);if(n!==Lo.oids.rsaEncryption){var o=new Error("Cannot read public key. Unknown OID.");throw o.oid=n,o}t=e.rsaPublicKey}if(r=[],!pt.validate(t,t_s,e,r)){var o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");throw o.errors=r,o}var s=_i.util.createBuffer(e.publicKeyModulus).toHex(),c=_i.util.createBuffer(e.publicKeyExponent).toHex();return Lo.setRsaPublicKey(new Ga(s,16),new Ga(c,16))};Lo.publicKeyToAsn1=Lo.publicKeyToSubjectPublicKeyInfo=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.OID,!1,pt.oidToDer(Lo.oids.rsaEncryption).getBytes()),pt.create(pt.Class.UNIVERSAL,pt.Type.NULL,!1,"")]),pt.create(pt.Class.UNIVERSAL,pt.Type.BITSTRING,!1,[Lo.publicKeyToRSAPublicKey(t)])])};Lo.publicKeyToRSAPublicKey=function(t){return pt.create(pt.Class.UNIVERSAL,pt.Type.SEQUENCE,!0,[pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.n)),pt.create(pt.Class.UNIVERSAL,pt.Type.INTEGER,!1,jO(t.e))])};function tBn(t,e,r){var n=_i.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=o-11,s}n.putByte(0),n.putByte(r);var c=o-3-t.length,l;if(r===0||r===1){l=r===0?0:255;for(var u=0;u0;){for(var d=0,f=_i.random.getBytes(c),u=0;u"u")throw new Error("Encryption block is invalid.");var d=0;if(u===0){d=s-3-n;for(var f=0;f1;){if(c.getByte()!==255){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}else if(u===2){for(d=0;c.length()>1;){if(c.getByte()===0){--c.read;break}++d}if(d<8&&!(o&&o._skipPaddingChecks))throw new Error("Encryption block is invalid.")}var h=c.getByte();if(h!==0||d!==s-3-c.length())throw new Error("Encryption block is invalid.");return c.getBytes()}a(xnt,"_decodePkcs1_v1_5");function o_s(t,e,r){typeof e=="function"&&(r=e,e={}),e=e||{};var n={algorithm:{name:e.algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(n.prng=e.prng),o();function o(){s(t.pBits,function(l,u){if(l)return r(l);if(t.p=u,t.q!==null)return c(l,t.q);s(t.qBits,c)})}a(o,"generate");function s(l,u){_i.prime.generateProbablePrime(l,n,u)}a(s,"getPrime");function c(l,u){if(l)return r(l);if(t.q=u,t.p.compareTo(t.q)<0){var d=t.p;t.p=t.q,t.q=d}if(t.p.subtract(Ga.ONE).gcd(t.e).compareTo(Ga.ONE)!==0){t.p=null,o();return}if(t.q.subtract(Ga.ONE).gcd(t.e).compareTo(Ga.ONE)!==0){t.q=null,s(t.qBits,c);return}if(t.p1=t.p.subtract(Ga.ONE),t.q1=t.q.subtract(Ga.ONE),t.phi=t.p1.multiply(t.q1),t.phi.gcd(t.e).compareTo(Ga.ONE)!==0){t.p=t.q=null,o();return}if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits){t.q=null,s(t.qBits,c);return}var f=t.e.modInverse(t.phi);t.keys={privateKey:Lo.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:Lo.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}a(c,"finish")}a(o_s,"_generateKeyPair");function jO(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=_i.util.hexToBytes(e);return r.length>1&&(r.charCodeAt(0)===0&&(r.charCodeAt(1)&128)===0||r.charCodeAt(0)===255&&(r.charCodeAt(1)&128)===128)?r.substr(1):r}a(jO,"_bnToBytes");function s_s(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}a(s_s,"_getMillerRabinTests");function K4n(t){return _i.util.isNodejs&&typeof Per[t]=="function"}a(K4n,"_detectNodeCrypto");function J4n(t){return typeof aw.globalScope<"u"&&typeof aw.globalScope.crypto=="object"&&typeof aw.globalScope.crypto.subtle=="object"&&typeof aw.globalScope.crypto.subtle[t]=="function"}a(J4n,"_detectSubtleCrypto");function Z4n(t){return typeof aw.globalScope<"u"&&typeof aw.globalScope.msCrypto=="object"&&typeof aw.globalScope.msCrypto.subtle=="object"&&typeof aw.globalScope.msCrypto.subtle[t]=="function"}a(Z4n,"_detectSubtleMsCrypto");function X4n(t){for(var e=_i.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),n=0;n{p();var gn=us();Gq();$k();vRe();OO();$q();Cnt();EJ();ow();Cer();SRe();ic();typeof nBn>"u"&&(nBn=gn.jsbn.BigInteger);var nBn,Dt=gn.asn1,es=gn.pki=gn.pki||{};aBn.exports=es.pbe=gn.pbe=gn.pbe||{};var CJ=es.oids,a_s={name:"EncryptedPrivateKeyInfo",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c_s={name:"PBES2Algorithms",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l_s={name:"pkcs-12PbeParams",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:Dt.Class.UNIVERSAL,type:Dt.Type.INTEGER,constructed:!1,capture:"iterations"}]};es.encryptPrivateKeyInfo=function(t,e,r){r=r||{},r.saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var n=gn.random.getBytesSync(r.saltSize),o=r.count,s=Dt.integerToDer(o),c,l,u;if(r.algorithm.indexOf("aes")===0||r.algorithm==="des"){var d,f,h;switch(r.algorithm){case"aes128":c=16,d=16,f=CJ["aes128-CBC"],h=gn.aes.createEncryptionCipher;break;case"aes192":c=24,d=16,f=CJ["aes192-CBC"],h=gn.aes.createEncryptionCipher;break;case"aes256":c=32,d=16,f=CJ["aes256-CBC"],h=gn.aes.createEncryptionCipher;break;case"des":c=8,d=8,f=CJ.desCBC,h=gn.des.createEncryptionCipher;break;default:var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),A=sBn(g),y=gn.pkcs5.pbkdf2(e,n,o,c,A),E=gn.random.getBytesSync(d),_=h(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes();var v=u_s(n,s,c,g);l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(CJ.pkcs5PBES2).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(CJ.pkcs5PBKDF2).getBytes()),v]),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(f).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,E)])])])}else if(r.algorithm==="3des"){c=24;var b=new gn.util.ByteBuffer(n),y=es.pbe.generatePkcs12Key(e,b,1,o,c),E=es.pbe.generatePkcs12Key(e,b,2,o,c),_=gn.des.createEncryptionCipher(y);_.start(E),_.update(Dt.toDer(t)),_.finish(),u=_.output.getBytes(),l=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OID,!1,Dt.oidToDer(CJ["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,n),Dt.create(Dt.Class.UNIVERSAL,Dt.Type.INTEGER,!1,s.getBytes())])])}else{var m=new Error("Cannot encrypt private key. Unknown encryption algorithm.");throw m.algorithm=r.algorithm,m}var T=Dt.create(Dt.Class.UNIVERSAL,Dt.Type.SEQUENCE,!0,[l,Dt.create(Dt.Class.UNIVERSAL,Dt.Type.OCTETSTRING,!1,u)]);return T};es.decryptPrivateKeyInfo=function(t,e){var r=null,n={},o=[];if(!Dt.validate(t,a_s,n,o)){var s=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=Dt.derToOid(n.encryptionOid),l=es.pbe.getCipher(c,n.encryptionParams,e),u=gn.util.createBuffer(n.encryptedData);return l.update(u),l.finish()&&(r=Dt.fromDer(l.output)),r};es.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:Dt.toDer(t).getBytes()};return gn.pem.encode(r,{maxline:e})};es.encryptedPrivateKeyFromPem=function(t){var e=gn.pem.decode(t)[0];if(e.type!=="ENCRYPTED PRIVATE KEY"){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return Dt.fromDer(e.body)};es.encryptRsaPrivateKey=function(t,e,r){if(r=r||{},!r.legacy){var n=es.wrapRsaPrivateKey(es.privateKeyToAsn1(t));return n=es.encryptPrivateKeyInfo(n,e,r),es.encryptedPrivateKeyToPem(n)}var o,s,c,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,s=gn.random.getBytesSync(16),l=gn.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,s=gn.random.getBytesSync(8),l=gn.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,s=gn.random.getBytesSync(8),l=gn.des.createEncryptionCipher;break;default:var u=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw u.algorithm=r.algorithm,u}var d=gn.pbe.opensslDeriveBytes(e,s.substr(0,8),c),f=l(d);f.start(s),f.update(Dt.toDer(es.privateKeyToAsn1(t))),f.finish();var h={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:gn.util.bytesToHex(s).toUpperCase()},body:f.output.getBytes()};return gn.pem.encode(h)};es.decryptRsaPrivateKey=function(t,e){var r=null,n=gn.pem.decode(t)[0];if(n.type!=="ENCRYPTED PRIVATE KEY"&&n.type!=="PRIVATE KEY"&&n.type!=="RSA PRIVATE KEY"){var o=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');throw o.headerType=o,o}if(n.procType&&n.procType.type==="ENCRYPTED"){var s,c;switch(n.dekInfo.algorithm){case"DES-CBC":s=8,c=gn.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,c=gn.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,c=gn.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,c=gn.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,c=gn.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,c=a(function(h){return gn.rc2.createDecryptionCipher(h,40)},"cipherFn");break;case"RC2-64-CBC":s=8,c=a(function(h){return gn.rc2.createDecryptionCipher(h,64)},"cipherFn");break;case"RC2-128-CBC":s=16,c=a(function(h){return gn.rc2.createDecryptionCipher(h,128)},"cipherFn");break;default:var o=new Error('Could not decrypt private key; unsupported encryption algorithm "'+n.dekInfo.algorithm+'".');throw o.algorithm=n.dekInfo.algorithm,o}var l=gn.util.hexToBytes(n.dekInfo.parameters),u=gn.pbe.opensslDeriveBytes(e,l.substr(0,8),s),d=c(u);if(d.start(l),d.update(gn.util.createBuffer(n.body)),d.finish())r=d.output.getBytes();else return r}else r=n.body;return n.type==="ENCRYPTED PRIVATE KEY"?r=es.decryptPrivateKeyInfo(Dt.fromDer(r),e):r=Dt.fromDer(r),r!==null&&(r=es.privateKeyFromAsn1(r)),r};es.pbe.generatePkcs12Key=function(t,e,r,n,o,s){var c,l;if(typeof s>"u"||s===null){if(!("sha1"in gn.md))throw new Error('"sha1" hash algorithm unavailable.');s=gn.md.sha1.create()}var u=s.digestLength,d=s.blockLength,f=new gn.util.ByteBuffer,h=new gn.util.ByteBuffer;if(t!=null){for(l=0;l=0;l--)L=L>>8,L+=P.at(l)+B.at(l),B.setAt(l,L&255);N.putBuffer(B)}b=N,f.putBuffer(R)}return f.truncate(f.length()-o),f};es.pbe.getCipher=function(t,e,r){switch(t){case es.oids.pkcs5PBES2:return es.pbe.getCipherForPBES2(t,e,r);case es.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case es.oids["pbewithSHAAnd40BitRC2-CBC"]:return es.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}};es.pbe.getCipherForPBES2=function(t,e,r){var n={},o=[];if(!Dt.validate(e,c_s,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}if(t=Dt.derToOid(n.kdfOid),t!==es.oids.pkcs5PBKDF2){var s=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");throw s.oid=t,s.supportedOids=["pkcs5PBKDF2"],s}if(t=Dt.derToOid(n.encOid),t!==es.oids["aes128-CBC"]&&t!==es.oids["aes192-CBC"]&&t!==es.oids["aes256-CBC"]&&t!==es.oids["des-EDE3-CBC"]&&t!==es.oids.desCBC){var s=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");throw s.oid=t,s.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],s}var c=n.kdfSalt,l=gn.util.createBuffer(n.kdfIterationCount);l=l.getInt(l.length()<<3);var u,d;switch(es.oids[t]){case"aes128-CBC":u=16,d=gn.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,d=gn.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,d=gn.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,d=gn.des.createDecryptionCipher;break;case"desCBC":u=8,d=gn.des.createDecryptionCipher;break}var f=oBn(n.prfOid),h=gn.pkcs5.pbkdf2(r,c,l,u,f),m=n.encIv,g=d(h);return g.start(m),g};es.pbe.getCipherForPKCS12PBE=function(t,e,r){var n={},o=[];if(!Dt.validate(e,l_s,n,o)){var s=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw s.errors=o,s}var c=gn.util.createBuffer(n.salt),l=gn.util.createBuffer(n.iterations);l=l.getInt(l.length()<<3);var u,d,f;switch(t){case es.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,d=8,f=gn.des.startDecrypting;break;case es.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,d=8,f=a(function(y,E){var _=gn.rc2.createDecryptionCipher(y,40);return _.start(E,null),_},"cipherFn");break;default:var s=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");throw s.oid=t,s}var h=oBn(n.prfOid),m=es.pbe.generatePkcs12Key(r,c,1,l,u,h);h.start();var g=es.pbe.generatePkcs12Key(r,c,2,l,d,h);return f(m,g)};es.pbe.opensslDeriveBytes=function(t,e,r,n){if(typeof n>"u"||n===null){if(!("md5"in gn.md))throw new Error('"md5" hash algorithm unavailable.');n=gn.md.md5.create()}e===null&&(e="");for(var o=[iBn(n,t+e)],s=16,c=1;s{p();var Ude=us();$k();ic();var un=Ude.asn1,Qde=uBn.exports=Ude.pkcs7asn1=Ude.pkcs7asn1||{};Ude.pkcs7=Ude.pkcs7||{};Ude.pkcs7.asn1=Qde;var cBn={name:"ContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};Qde.contentInfoValidator=cBn;var lBn={name:"EncryptedContentInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};Qde.envelopedDataValidator={name:"EnvelopedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(lBn)};Qde.encryptedDataValidator={name:"EncryptedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"}].concat(lBn)};var d_s={name:"SignerInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};Qde.signedDataValidator={name:"SignedData",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},cBn,{name:"SignedData.Certificates",tagClass:un.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:un.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:un.Class.UNIVERSAL,type:un.Type.SET,capture:"signerInfos",optional:!0,value:[d_s]}]};Qde.recipientInfoValidator={name:"RecipientInfo",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:un.Class.UNIVERSAL,type:un.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:un.Class.UNIVERSAL,type:un.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:un.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:un.Class.UNIVERSAL,type:un.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}});var Ner=I((qYd,dBn)=>{p();var bJ=us();ic();bJ.mgf=bJ.mgf||{};var f_s=dBn.exports=bJ.mgf.mgf1=bJ.mgf1=bJ.mgf1||{};f_s.create=function(t){var e={generate:a(function(r,n){for(var o=new bJ.util.ByteBuffer,s=Math.ceil(n/t.digestLength),c=0;c{p();var wnt=us();Ner();fBn.exports=wnt.mgf=wnt.mgf||{};wnt.mgf.mgf1=wnt.mgf1});var Rnt=I((VYd,hBn)=>{p();var SJ=us();ow();ic();var p_s=hBn.exports=SJ.pss=SJ.pss||{};p_s.create=function(t){arguments.length===3&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e=t.md,r=t.mgf,n=e.digestLength,o=t.salt||null;typeof o=="string"&&(o=SJ.util.createBuffer(o));var s;if("saltLength"in t)s=t.saltLength;else if(o!==null)s=o.length();else throw new Error("Salt length not specified or specific salt not given.");if(o!==null&&o.length()!==s)throw new Error("Given salt length does not match length of given salt.");var c=t.prng||SJ.random,l={};return l.encode=function(u,d){var f,h=d-1,m=Math.ceil(h/8),g=u.digest().getBytes();if(m>8*m-h&255;return w=String.fromCharCode(w.charCodeAt(0)&~R)+w.substr(1),w+E+"\xBC"},l.verify=function(u,d,f){var h,m=f-1,g=Math.ceil(m/8);if(d=d.substr(-g),g>8*g-m&255;if((y.charCodeAt(0)&_)!==0)throw new Error("Bits beyond keysize not zero as expected.");var v=r.generate(E,A),b="";for(h=0;h{p();var vi=us();Gq();$k();vRe();OO();pBn();$q();EJ();Rnt();SRe();ic();var me=vi.asn1,kr=EBn.exports=vi.pki=vi.pki||{},$a=kr.oids,op={};op.CN=$a.commonName;op.commonName="CN";op.C=$a.countryName;op.countryName="C";op.L=$a.localityName;op.localityName="L";op.ST=$a.stateOrProvinceName;op.stateOrProvinceName="ST";op.O=$a.organizationName;op.organizationName="O";op.OU=$a.organizationalUnitName;op.organizationalUnitName="OU";op.E=$a.emailAddress;op.emailAddress="E";var gBn=vi.pki.rsa.publicKeyValidator,h_s={name:"Certificate",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:me.Class.UNIVERSAL,type:me.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:me.Class.UNIVERSAL,type:me.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:me.Class.UNIVERSAL,type:me.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:me.Class.UNIVERSAL,type:me.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},gBn,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:me.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:me.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},m_s={name:"rsapss",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:me.Class.UNIVERSAL,type:me.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:me.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:me.Class.UNIVERSAL,type:me.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:me.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:me.Class.UNIVERSAL,type:me.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:me.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:me.Class.UNIVERSAL,type:me.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},g_s={name:"CertificationRequestInfo",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:me.Class.UNIVERSAL,type:me.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},gBn,{name:"CertificationRequestInfo.attributes",tagClass:me.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:me.Class.UNIVERSAL,type:me.Type.SET,constructed:!0}]}]}]},A_s={name:"CertificationRequest",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[g_s,{name:"CertificationRequest.signatureAlgorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:me.Class.UNIVERSAL,type:me.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:me.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:me.Class.UNIVERSAL,type:me.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};kr.RDNAttributesAsArray=function(t,e){for(var r=[],n,o,s,c=0;c2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(u.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=u[0],c.validity.notAfter=u[1],c.tbsCertificate=r.tbsCertificate,e){c.md=knt({signatureOid:c.signatureOid,type:"certificate"});var d=me.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var f=vi.md.sha1.create(),h=me.toDer(r.certIssuer);f.update(h.getBytes()),c.issuer.getField=function(A){return zq(c.issuer,A)},c.issuer.addField=function(A){cw([A]),c.issuer.attributes.push(A)},c.issuer.attributes=kr.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=f.digest().toHex();var m=vi.md.sha1.create(),g=me.toDer(r.certSubject);return m.update(g.getBytes()),c.subject.getField=function(A){return zq(c.subject,A)},c.subject.addField=function(A){cw([A]),c.subject.attributes.push(A)},c.subject.attributes=kr.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=m.digest().toHex(),r.certExtensions?c.extensions=kr.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=kr.publicKeyFromAsn1(r.subjectPublicKeyInfo),c};kr.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(n=r.value.charCodeAt(1),o=r.value.length>2?r.value.charCodeAt(2):0),e.digitalSignature=(n&128)===128,e.nonRepudiation=(n&64)===64,e.keyEncipherment=(n&32)===32,e.dataEncipherment=(n&16)===16,e.keyAgreement=(n&8)===8,e.keyCertSign=(n&4)===4,e.cRLSign=(n&2)===2,e.encipherOnly=(n&1)===1,e.decipherOnly=(o&128)===128}else if(e.name==="basicConstraints"){var r=me.fromDer(e.value);r.value.length>0&&r.value[0].type===me.Type.BOOLEAN?e.cA=r.value[0].value.charCodeAt(0)!==0:e.cA=!1;var s=null;r.value.length>0&&r.value[0].type===me.Type.INTEGER?s=r.value[0].value:r.value.length>1&&(s=r.value[1].value),s!==null&&(e.pathLenConstraint=me.derToInteger(s))}else if(e.name==="extKeyUsage")for(var r=me.fromDer(e.value),c=0;c1&&(n=r.value.charCodeAt(1)),e.client=(n&128)===128,e.server=(n&64)===64,e.email=(n&32)===32,e.objsign=(n&16)===16,e.reserved=(n&8)===8,e.sslCA=(n&4)===4,e.emailCA=(n&2)===2,e.objCA=(n&1)===1}else if(e.name==="subjectAltName"||e.name==="issuerAltName"){e.altNames=[];for(var u,r=me.fromDer(e.value),d=0;d"u"&&(e.type&&e.type in kr.oids?e.name=kr.oids[e.type]:e.shortName&&e.shortName in op&&(e.name=kr.oids[op[e.shortName]])),typeof e.type>"u")if(e.name&&e.name in kr.oids)e.type=kr.oids[e.name];else{var n=new Error("Attribute type not specified.");throw n.attribute=e,n}if(typeof e.shortName>"u"&&e.name&&e.name in op&&(e.shortName=op[e.name]),e.type===$a.extensionRequest&&(e.valueConstructed=!0,e.valueTagClass=me.Type.SEQUENCE,!e.value&&e.extensions)){e.value=[];for(var o=0;o"u"){var n=new Error("Attribute value not specified.");throw n.attribute=e,n}}}a(cw,"_fillMissingFields");function yBn(t,e){if(e=e||{},typeof t.name>"u"&&t.id&&t.id in kr.oids&&(t.name=kr.oids[t.id]),typeof t.id>"u")if(t.name&&t.name in kr.oids)t.id=kr.oids[t.name];else{var r=new Error("Extension ID not specified.");throw r.extension=t,r}if(typeof t.value<"u")return t;if(t.name==="keyUsage"){var n=0,o=0,s=0;t.digitalSignature&&(o|=128,n=7),t.nonRepudiation&&(o|=64,n=6),t.keyEncipherment&&(o|=32,n=5),t.dataEncipherment&&(o|=16,n=4),t.keyAgreement&&(o|=8,n=3),t.keyCertSign&&(o|=4,n=2),t.cRLSign&&(o|=2,n=1),t.encipherOnly&&(o|=1,n=0),t.decipherOnly&&(s|=128,n=7);var c=String.fromCharCode(n);s!==0?c+=String.fromCharCode(o)+String.fromCharCode(s):o!==0&&(c+=String.fromCharCode(o)),t.value=me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,c)}else if(t.name==="basicConstraints")t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]),t.cA&&t.value.value.push(me.create(me.Class.UNIVERSAL,me.Type.BOOLEAN,!1,"\xFF")),"pathLenConstraint"in t&&t.value.value.push(me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(t.pathLenConstraint).getBytes()));else if(t.name==="extKeyUsage"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);var l=t.value.value;for(var u in t)t[u]===!0&&(u in $a?l.push(me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer($a[u]).getBytes())):u.indexOf(".")!==-1&&l.push(me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(u).getBytes())))}else if(t.name==="nsCertType"){var n=0,o=0;t.client&&(o|=128,n=7),t.server&&(o|=64,n=6),t.email&&(o|=32,n=5),t.objsign&&(o|=16,n=4),t.reserved&&(o|=8,n=3),t.sslCA&&(o|=4,n=2),t.emailCA&&(o|=2,n=1),t.objCA&&(o|=1,n=0);var c=String.fromCharCode(n);o!==0&&(c+=String.fromCharCode(o)),t.value=me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,c)}else if(t.name==="subjectAltName"||t.name==="issuerAltName"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);for(var d,f=0;f128)throw new Error('Invalid "nsComment" content.');t.value=me.create(me.Class.UNIVERSAL,me.Type.IA5STRING,!1,t.comment)}else if(t.name==="subjectKeyIdentifier"&&e.cert){var h=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=h.toHex(),t.value=me.create(me.Class.UNIVERSAL,me.Type.OCTETSTRING,!1,h.getBytes())}else if(t.name==="authorityKeyIdentifier"&&e.cert){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);var l=t.value.value;if(t.keyIdentifier){var m=t.keyIdentifier===!0?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;l.push(me.create(me.Class.CONTEXT_SPECIFIC,0,!1,m))}if(t.authorityCertIssuer){var g=[me.create(me.Class.CONTEXT_SPECIFIC,4,!0,[qde(t.authorityCertIssuer===!0?e.cert.issuer:t.authorityCertIssuer)])];l.push(me.create(me.Class.CONTEXT_SPECIFIC,1,!0,g))}if(t.serialNumber){var A=vi.util.hexToBytes(t.serialNumber===!0?e.cert.serialNumber:t.serialNumber);l.push(me.create(me.Class.CONTEXT_SPECIFIC,2,!1,A))}}else if(t.name==="cRLDistributionPoints"){t.value=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);for(var l=t.value.value,y=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]),E=me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[]),d,f=0;f"u"){var r=new Error("Extension value not specified.");throw r.extension=t,r}return t}a(yBn,"_fillMissingExtensionFields");function Mer(t,e){if(t===$a["RSASSA-PSS"]){var r=[];return e.hash.algorithmOid!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.hash.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")])])),e.mgf.algorithmOid!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,1,!0,[me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.mgf.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(e.mgf.hash.algorithmOid).getBytes()),me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")])])])),e.saltLength!==void 0&&r.push(me.create(me.Class.CONTEXT_SPECIFIC,2,!0,[me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(e.saltLength).getBytes())])),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,r)}else return me.create(me.Class.UNIVERSAL,me.Type.NULL,!1,"")}a(Mer,"_signatureParametersToAsn1");function y_s(t){var e=me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[]);if(t.attributes.length===0)return e;for(var r=t.attributes,n=0;n=E_s&&t<__s?me.create(me.Class.UNIVERSAL,me.Type.UTCTIME,!1,me.dateToUtcTime(t)):me.create(me.Class.UNIVERSAL,me.Type.GENERALIZEDTIME,!1,me.dateToGeneralizedTime(t))}a(mBn,"_dateToAsn1");kr.getTBSCertificate=function(t){var e=mBn(t.validity.notBefore),r=mBn(t.validity.notAfter),n=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.CONTEXT_SPECIFIC,0,!0,[me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(t.version).getBytes())]),me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,vi.util.hexToBytes(t.serialNumber)),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(t.siginfo.algorithmOid).getBytes()),Mer(t.siginfo.algorithmOid,t.siginfo.parameters)]),qde(t.issuer),me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[e,r]),qde(t.subject),kr.publicKeyToAsn1(t.publicKey)]);return t.issuer.uniqueId&&n.value.push(me.create(me.Class.CONTEXT_SPECIFIC,1,!0,[me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,"\0"+t.issuer.uniqueId)])),t.subject.uniqueId&&n.value.push(me.create(me.Class.CONTEXT_SPECIFIC,2,!0,[me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,"\0"+t.subject.uniqueId)])),t.extensions.length>0&&n.value.push(kr.certificateExtensionsToAsn1(t.extensions)),n};kr.getCertificationRequestInfo=function(t){var e=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.INTEGER,!1,me.integerToDer(t.version).getBytes()),qde(t.subject),kr.publicKeyToAsn1(t.publicKey),y_s(t)]);return e};kr.distinguishedNameToAsn1=function(t){return qde(t)};kr.certificateToAsn1=function(t){var e=t.tbsCertificate||kr.getTBSCertificate(t);return me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[e,me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[me.create(me.Class.UNIVERSAL,me.Type.OID,!1,me.oidToDer(t.signatureOid).getBytes()),Mer(t.signatureOid,t.signatureParameters)]),me.create(me.Class.UNIVERSAL,me.Type.BITSTRING,!1,"\0"+t.signature)])};kr.certificateExtensionsToAsn1=function(t){var e=me.create(me.Class.CONTEXT_SPECIFIC,3,!0,[]),r=me.create(me.Class.UNIVERSAL,me.Type.SEQUENCE,!0,[]);e.value.push(r);for(var n=0;n"u"&&(o=new Date);var s=!0,c=null,l=0;do{var u=e.shift(),d=null,f=!1;if(o&&(ou.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:kr.certificateError.certificate_expired,notBefore:u.validity.notBefore,notAfter:u.validity.notAfter,now:o}),c===null){if(d=e[0]||t.getIssuer(u),d===null&&u.isIssuer(u)&&(f=!0,d=u),d){var h=d;vi.util.isArray(h)||(h=[h]);for(var m=!1;!m&&h.length>0;){d=h.shift();try{m=d.verify(u)}catch{}}m||(c={message:"Certificate signature is invalid.",error:kr.certificateError.bad_certificate})}c===null&&(!d||f)&&!t.hasCertificate(u)&&(c={message:"Certificate is not trusted.",error:kr.certificateError.unknown_ca})}if(c===null&&d&&!u.isIssuer(d)&&(c={message:"Certificate issuer is invalid.",error:kr.certificateError.bad_certificate}),c===null)for(var g={keyUsage:!0,basicConstraints:!0},A=0;c===null&&AE.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:kr.certificateError.bad_certificate})}}var b=c===null?!0:c.error,T=r.verify?r.verify(b,l,n):b;if(T===!0)c=null;else throw b===!0&&(c={message:"The application rejected the certificate.",error:kr.certificateError.bad_certificate}),(T||T===0)&&(typeof T=="object"&&!vi.util.isArray(T)?(T.message&&(c.message=T.message),T.error&&(c.error=T.error)):typeof T=="string"&&(c.error=T)),c;s=!1,++l}while(e.length>0);return!0}});var Ber=I((JYd,vBn)=>{p();var Eu=us();$k();Mde();$q();Der();ker();ow();SRe();Fde();ic();Dnt();var Ye=Eu.asn1,Ws=Eu.pki,IRe=vBn.exports=Eu.pkcs12=Eu.pkcs12||{},_Bn={name:"ContentInfo",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},v_s={name:"PFX",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,capture:"version"},_Bn,{name:"PFX.macData",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",optional:!0,tagClass:Ye.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},C_s={name:"SafeBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},b_s={name:"Attribute",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SET,constructed:!0,capture:"values"}]},S_s={name:"CertBag",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:Ye.Class.UNIVERSAL,type:Ye.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:Ye.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:Ye.Class.UNIVERSAL,type:Ye.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function TRe(t,e,r,n){for(var o=[],s=0;s=0&&o.push(l)}}return o}a(TRe,"_getBagsByAttribute");IRe.pkcs12FromAsn1=function(t,e,r){typeof e=="string"?(r=e,e=!0):e===void 0&&(e=!0);var n={},o=[];if(!Ye.validate(t,v_s,n,o)){var s=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");throw s.errors=s,s}var c={version:n.version.charCodeAt(0),safeContents:[],getBags:a(function(E){var _={},v;return"localKeyId"in E?v=E.localKeyId:"localKeyIdHex"in E&&(v=Eu.util.hexToBytes(E.localKeyIdHex)),v===void 0&&!("friendlyName"in E)&&"bagType"in E&&(_[E.bagType]=TRe(c.safeContents,null,null,E.bagType)),v!==void 0&&(_.localKeyId=TRe(c.safeContents,"localKeyId",v,E.bagType)),"friendlyName"in E&&(_.friendlyName=TRe(c.safeContents,"friendlyName",E.friendlyName,E.bagType)),_},"getBags"),getBagsByFriendlyName:a(function(E,_){return TRe(c.safeContents,"friendlyName",E,_)},"getBagsByFriendlyName"),getBagsByLocalKeyId:a(function(E,_){return TRe(c.safeContents,"localKeyId",E,_)},"getBagsByLocalKeyId")};if(n.version.charCodeAt(0)!==3){var s=new Error("PKCS#12 PFX of version other than 3 not supported.");throw s.version=n.version.charCodeAt(0),s}if(Ye.derToOid(n.contentType)!==Ws.oids.data){var s=new Error("Only PKCS#12 PFX in password integrity mode supported.");throw s.oid=Ye.derToOid(n.contentType),s}var l=n.content.value[0];if(l.tagClass!==Ye.Class.UNIVERSAL||l.type!==Ye.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(l=Oer(l),n.mac){var u=null,d=0,f=Ye.derToOid(n.macAlgorithm);switch(f){case Ws.oids.sha1:u=Eu.md.sha1.create(),d=20;break;case Ws.oids.sha256:u=Eu.md.sha256.create(),d=32;break;case Ws.oids.sha384:u=Eu.md.sha384.create(),d=48;break;case Ws.oids.sha512:u=Eu.md.sha512.create(),d=64;break;case Ws.oids.md5:u=Eu.md.md5.create(),d=16;break}if(u===null)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+f);var h=new Eu.util.ByteBuffer(n.macSalt),m="macIterations"in n?parseInt(Eu.util.bytesToHex(n.macIterations),16):1,g=IRe.generateKey(r,h,3,m,d,u),A=Eu.hmac.create();A.start(u,g),A.update(l.value);var y=A.getMac();if(y.getBytes()!==n.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}else if(Array.isArray(t.value)&&t.value.length>2)throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");return T_s(c,l.value,e,r),c};function Oer(t){if(t.composed||t.constructed){for(var e=Eu.util.createBuffer(),r=0;r0&&(s=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SET,!0,u));var d=[],f=[];e!==null&&(Eu.util.isArray(e)?f=e:f=[e]);for(var h=[],m=0;m0){var E=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,h),_=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(E).getBytes())])]);d.push(_)}var v=null;if(t!==null){var b=Ws.wrapRsaPrivateKey(Ws.privateKeyToAsn1(t));r===null?v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.keyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[b]),s]):v=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.pkcs8ShroudedKeyBag).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ws.encryptPrivateKeyInfo(b,r,n)]),s]);var T=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[v]),w=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(T).getBytes())])]);d.push(w)}var R=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,d),x;if(n.useMac){var l=Eu.md.sha1.create(),P=new Eu.util.ByteBuffer(Eu.random.getBytes(n.saltSize)),D=n.count,t=IRe.generateKey(r,P,3,D,20),N=Eu.hmac.create();N.start(l,t),N.update(Ye.toDer(R).getBytes());var B=N.getMac();x=Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.sha1).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.NULL,!1,"")]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,B.getBytes())]),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,P.getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(D).getBytes())])}return Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.INTEGER,!1,Ye.integerToDer(3).getBytes()),Ye.create(Ye.Class.UNIVERSAL,Ye.Type.SEQUENCE,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OID,!1,Ye.oidToDer(Ws.oids.data).getBytes()),Ye.create(Ye.Class.CONTEXT_SPECIFIC,0,!0,[Ye.create(Ye.Class.UNIVERSAL,Ye.Type.OCTETSTRING,!1,Ye.toDer(R).getBytes())])]),x])};IRe.generateKey=Eu.pbe.generatePkcs12Key});var Fer=I((eKd,CBn)=>{p();var Yq=us();$k();$q();ker();EJ();Cnt();Ber();Rnt();SRe();ic();Dnt();var Ler=Yq.asn1,jde=CBn.exports=Yq.pki=Yq.pki||{};jde.pemToDer=function(t){var e=Yq.pem.decode(t)[0];if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PEM to DER; PEM is encrypted.");return Yq.util.createBuffer(e.body)};jde.privateKeyFromPem=function(t){var e=Yq.pem.decode(t)[0];if(e.type!=="PRIVATE KEY"&&e.type!=="RSA PRIVATE KEY"){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert private key from PEM; PEM is encrypted.");var n=Ler.fromDer(e.body);return jde.privateKeyFromAsn1(n)};jde.privateKeyToPem=function(t,e){var r={type:"RSA PRIVATE KEY",body:Ler.toDer(jde.privateKeyToAsn1(t)).getBytes()};return Yq.pem.encode(r,{maxline:e})};jde.privateKeyInfoToPem=function(t,e){var r={type:"PRIVATE KEY",body:Ler.toDer(t).getBytes()};return Yq.pem.encode(r,{maxline:e})}});var Ger=I((rKd,PBn)=>{p();var Kt=us();$k();Mde();ynt();EJ();Fer();ow();Fde();ic();var Bnt=a(function(t,e,r,n){var o=Kt.util.createBuffer(),s=t.length>>1,c=s+(t.length&1),l=t.substr(0,c),u=t.substr(s,c),d=Kt.util.createBuffer(),f=Kt.hmac.create();r=e+r;var h=Math.ceil(n/16),m=Math.ceil(n/20);f.start("MD5",l);var g=Kt.util.createBuffer();d.putBytes(r);for(var A=0;A0&&(Ee.queue(t,Ee.createAlert(t,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.no_renegotiation})),Ee.flush(t)),t.process()};Ee.parseHelloMessage=function(t,e,r){var n=null,o=t.entity===Ee.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});else{var s=e.fragment,c=s.length();if(n={version:{major:s.getByte(),minor:s.getByte()},random:Kt.util.createBuffer(s.getBytes(32)),session_id:zS(s,1),extensions:[]},o?(n.cipher_suite=s.getBytes(2),n.compression_method=s.getByte()):(n.cipher_suites=zS(s,2),n.compression_methods=zS(s,1)),c=r-(c-s.length()),c>0){for(var l=zS(s,2);l.length()>0;)n.extensions.push({type:[l.getByte(),l.getByte()],data:zS(l,2)});if(!o)for(var u=0;u0;){var h=f.getByte();if(h!==0)break;t.session.extensions.server_name.serverNameList.push(zS(f,2).getBytes())}}}if(t.session.version&&(n.version.major!==t.session.version.major||n.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=Ee.getCipherSuite(n.cipher_suite);else for(var m=Kt.util.createBuffer(n.cipher_suites.bytes());m.length()>0&&(t.session.cipherSuite=Ee.getCipherSuite(m.getBytes(2)),t.session.cipherSuite===null););if(t.session.cipherSuite===null)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure},cipherSuite:Kt.util.bytesToHex(n.cipher_suite)});o?t.session.compressionMethod=n.compression_method:t.session.compressionMethod=Ee.CompressionMethod.none}return n};Ee.createSecurityParameters=function(t,e){var r=t.entity===Ee.ConnectionEnd.client,n=e.random.bytes(),o=r?t.session.sp.client_random:n,s=r?n:Ee.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:Ee.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:s}};Ee.handleServerHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){if(n.version.minor<=t.version.minor)t.version.minor=n.version.minor;else return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}});t.session.version=t.version;var o=n.session_id.bytes();o.length>0&&o===t.session.id?(t.expect=TBn,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=N_s,t.session.resuming=!1,Ee.createSecurityParameters(t,n)),t.session.id=o,t.process()}};Ee.handleClientHello=function(t,e,r){var n=Ee.parseHelloMessage(t,e,r);if(!t.fail){var o=n.session_id.bytes(),s=null;if(t.sessionCache&&(s=t.sessionCache.getSession(o),s===null?o="":(s.version.major!==n.version.major||s.version.minor>n.version.minor)&&(s=null,o="")),o.length===0&&(o=Kt.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=n.version,t.session.sp={},s)t.version=t.session.version=s.version,t.session.sp=s.sp;else{for(var c,l=1;l0;)s=zS(o.certificate_list,3),c=Kt.asn1.fromDer(s),s=Kt.pki.certificateFromAsn1(c,!0),l.push(s)}catch(d){return t.error(t,{message:"Could not parse certificate list.",cause:d,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_certificate}})}var u=t.entity===Ee.ConnectionEnd.client;(u||t.verifyClient===!0)&&l.length===0?t.error(t,{message:u?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}}):l.length===0?t.expect=u?bBn:qer:(u?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],Ee.verifyCertificateChain(t,l)&&(t.expect=u?bBn:qer)),t.process()};Ee.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});t.expect=M_s,t.process()};Ee.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.unsupported_certificate}});var n=e.fragment,o={enc_pre_master_secret:zS(n,2).getBytes()},s=null;if(t.getPrivateKey)try{s=t.getPrivateKey(t,t.session.serverCertificate),s=Kt.pki.privateKeyFromPem(s)}catch(u){t.error(t,{message:"Could not get private key.",cause:u,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}if(s===null)return t.error(t,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}});try{var c=t.session.sp;c.pre_master_secret=s.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch{c.pre_master_secret=Kt.random.getBytes(48)}t.expect=jer,t.session.clientCertificate!==null&&(t.expect=q_s),t.process()};Ee.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment,o={certificate_types:zS(n,1),certificate_authorities:zS(n,2)};t.session.certificateRequest=o,t.expect=O_s,t.process()};Ee.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s={signature:zS(n,2).getBytes()},c=Kt.util.createBuffer();c.putBuffer(t.session.md5.digest()),c.putBuffer(t.session.sha1.digest()),c=c.getBytes();try{var l=t.session.clientCertificate;if(!l.publicKey.verify(c,s.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch{return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.handshake_failure}})}t.expect=jer,t.process()};Ee.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.record_overflow}});if(t.serverCertificate===null){var n={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.insufficient_security}},o=0,s=t.verify(t,n.alert.description,o,[]);if(s!==!0)return(s||s===0)&&(typeof s=="object"&&!Kt.util.isArray(s)?(s.message&&(n.message=s.message),s.alert&&(n.alert.description=s.alert)):typeof s=="number"&&(n.alert.description=s)),t.error(t,n)}t.session.certificateRequest!==null&&(e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createCertificate(t)}),Ee.queue(t,e)),e=Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createClientKeyExchange(t)}),Ee.queue(t,e),t.expect=F_s;var c=a(function(l,u){l.session.certificateRequest!==null&&l.session.clientCertificate!==null&&Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createCertificateVerify(l,u)})),Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),l.state.pending=Ee.createConnectionState(l),l.state.current.write=l.state.pending.write,Ee.queue(l,Ee.createRecord(l,{type:Ee.ContentType.handshake,data:Ee.createFinished(l)})),l.expect=TBn,Ee.flush(l),l.process()},"callback");if(t.session.certificateRequest===null||t.session.clientCertificate===null)return c(t,null);Ee.getClientSignature(t,c)};Ee.handleChangeCipherSpec=function(t,e){if(e.fragment.getByte()!==1)return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.illegal_parameter}});var r=t.entity===Ee.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=Ee.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?B_s:j_s,t.process()};Ee.handleFinished=function(t,e,r){var n=e.fragment;n.read-=4;var o=n.bytes();n.read+=4;var s=e.fragment.getBytes();n=Kt.util.createBuffer(),n.putBuffer(t.session.md5.digest()),n.putBuffer(t.session.sha1.digest());var c=t.entity===Ee.ConnectionEnd.client,l=c?"server finished":"client finished",u=t.session.sp,d=12,f=Bnt;if(n=f(u.master_secret,l,n.getBytes(),d),n.getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decrypt_error}});t.session.md5.update(o),t.session.sha1.update(o),(t.session.resuming&&c||!t.session.resuming&&!c)&&(Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.change_cipher_spec,data:Ee.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.handshake,data:Ee.createFinished(t)}))),t.expect=c?L_s:H_s,t.handshaking=!1,++t.handshakes,t.peerCertificate=c?t.session.serverCertificate:t.session.clientCertificate,Ee.flush(t),t.isConnected=!0,t.connected(t),t.process()};Ee.handleAlert=function(t,e){var r=e.fragment,n={level:r.getByte(),description:r.getByte()},o;switch(n.description){case Ee.Alert.Description.close_notify:o="Connection closed.";break;case Ee.Alert.Description.unexpected_message:o="Unexpected message.";break;case Ee.Alert.Description.bad_record_mac:o="Bad record MAC.";break;case Ee.Alert.Description.decryption_failed:o="Decryption failed.";break;case Ee.Alert.Description.record_overflow:o="Record overflow.";break;case Ee.Alert.Description.decompression_failure:o="Decompression failed.";break;case Ee.Alert.Description.handshake_failure:o="Handshake failure.";break;case Ee.Alert.Description.bad_certificate:o="Bad certificate.";break;case Ee.Alert.Description.unsupported_certificate:o="Unsupported certificate.";break;case Ee.Alert.Description.certificate_revoked:o="Certificate revoked.";break;case Ee.Alert.Description.certificate_expired:o="Certificate expired.";break;case Ee.Alert.Description.certificate_unknown:o="Certificate unknown.";break;case Ee.Alert.Description.illegal_parameter:o="Illegal parameter.";break;case Ee.Alert.Description.unknown_ca:o="Unknown certificate authority.";break;case Ee.Alert.Description.access_denied:o="Access denied.";break;case Ee.Alert.Description.decode_error:o="Decode error.";break;case Ee.Alert.Description.decrypt_error:o="Decrypt error.";break;case Ee.Alert.Description.export_restriction:o="Export restriction.";break;case Ee.Alert.Description.protocol_version:o="Unsupported protocol version.";break;case Ee.Alert.Description.insufficient_security:o="Insufficient security.";break;case Ee.Alert.Description.internal_error:o="Internal error.";break;case Ee.Alert.Description.user_canceled:o="User canceled.";break;case Ee.Alert.Description.no_renegotiation:o="Renegotiation not supported.";break;default:o="Unknown error.";break}if(n.description===Ee.Alert.Description.close_notify)return t.close();t.error(t,{message:o,send:!1,origin:t.entity===Ee.ConnectionEnd.client?"server":"client",alert:n}),t.process()};Ee.handleHandshake=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=Kt.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var s=r.bytes(o+4);r.read+=4,n in Ont[t.entity][t.expect]?(t.entity===Ee.ConnectionEnd.server&&!t.open&&!t.fail&&(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()}),n!==Ee.HandshakeType.hello_request&&n!==Ee.HandshakeType.certificate_verify&&n!==Ee.HandshakeType.finished&&(t.session.md5.update(s),t.session.sha1.update(s)),Ont[t.entity][t.expect][n](t,e,o)):Ee.handleUnexpected(t,e)};Ee.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()};Ee.handleHeartbeat=function(t,e){var r=e.fragment,n=r.getByte(),o=r.getInt16(),s=r.getBytes(o);if(n===Ee.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>s.length)return t.process();Ee.queue(t,Ee.createRecord(t,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_response,s)})),Ee.flush(t)}else if(n===Ee.HeartbeatMessageType.heartbeat_response){if(s!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,Kt.util.createBuffer(s))}t.process()};var D_s=0,N_s=1,bBn=2,M_s=3,O_s=4,TBn=5,B_s=6,L_s=7,F_s=8,U_s=0,Q_s=1,qer=2,q_s=3,jer=4,j_s=5,H_s=6,ye=Ee.handleUnexpected,IBn=Ee.handleChangeCipherSpec,xA=Ee.handleAlert,H_=Ee.handleHandshake,xBn=Ee.handleApplicationData,wA=Ee.handleHeartbeat,Her=[];Her[Ee.ConnectionEnd.client]=[[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[IBn,xA,ye,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,xBn,wA],[ye,xA,H_,ye,wA]];Her[Ee.ConnectionEnd.server]=[[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,ye,wA],[IBn,xA,ye,ye,wA],[ye,xA,H_,ye,wA],[ye,xA,H_,xBn,wA],[ye,xA,H_,ye,wA]];var Kq=Ee.handleHelloRequest,G_s=Ee.handleServerHello,wBn=Ee.handleCertificate,SBn=Ee.handleServerKeyExchange,Uer=Ee.handleCertificateRequest,Nnt=Ee.handleServerHelloDone,RBn=Ee.handleFinished,Ont=[];Ont[Ee.ConnectionEnd.client]=[[ye,ye,G_s,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,wBn,SBn,Uer,Nnt,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,SBn,Uer,Nnt,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,Uer,Nnt,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,Nnt,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,RBn],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[Kq,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye]];var $_s=Ee.handleClientHello,V_s=Ee.handleClientKeyExchange,W_s=Ee.handleCertificateVerify;Ont[Ee.ConnectionEnd.server]=[[ye,$_s,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,wBn,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,V_s,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,W_s,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,RBn],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye],[ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye,ye]];Ee.generateKeys=function(t,e){var r=Bnt,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,s=t.version.major===Ee.Versions.TLS_1_0.major&&t.version.minor===Ee.Versions.TLS_1_0.minor;s&&(o+=2*e.fixed_iv_length);var c=r(e.master_secret,"key expansion",n,o),l={client_write_MAC_key:c.getBytes(e.mac_key_length),server_write_MAC_key:c.getBytes(e.mac_key_length),client_write_key:c.getBytes(e.enc_key_length),server_write_key:c.getBytes(e.enc_key_length)};return s&&(l.client_write_IV=c.getBytes(e.fixed_iv_length),l.server_write_IV=c.getBytes(e.fixed_iv_length)),l};Ee.createConnectionState=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=a(function(){var s={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:a(function(c){return!0},"cipherFunction"),compressionState:null,compressFunction:a(function(c){return!0},"compressFunction"),updateSequenceNumber:a(function(){s.sequenceNumber[1]===4294967295?(s.sequenceNumber[1]=0,++s.sequenceNumber[0]):++s.sequenceNumber[1]},"updateSequenceNumber")};return s},"createMode"),n={read:r(),write:r()};if(n.read.update=function(s,c){return n.read.cipherFunction(c,n.read)?n.read.compressFunction(s,c,n.read)||s.error(s,{message:"Could not decompress record.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.decompression_failure}}):s.error(s,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.bad_record_mac}}),!s.fail},n.write.update=function(s,c){return n.write.compressFunction(s,c,n.write)?n.write.cipherFunction(c,n.write)||s.error(s,{message:"Could not encrypt record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):s.error(s,{message:"Could not compress record.",send:!1,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}),!s.fail},t.session){var o=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(o),o.keys=Ee.generateKeys(t,o),n.read.macKey=e?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=e?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,o),o.compression_algorithm){case Ee.CompressionMethod.none:break;case Ee.CompressionMethod.deflate:n.read.compressFunction=k_s,n.write.compressFunction=P_s;break;default:throw new Error("Unsupported compression algorithm.")}}return n};Ee.createRandom=function(){var t=new Date,e=+t+t.getTimezoneOffset()*6e4,r=Kt.util.createBuffer();return r.putInt32(e),r.putBytes(Kt.random.getBytes(28)),r};Ee.createRecord=function(t,e){if(!e.data)return null;var r={type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data};return r};Ee.createAlert=function(t,e){var r=Kt.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),Ee.createRecord(t,{type:Ee.ContentType.alert,data:r})};Ee.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=Kt.util.createBuffer(),r=0;r0&&(h+=2);var m=t.session.id,g=m.length+1+2+4+28+2+o+1+c+h,A=Kt.util.createBuffer();return A.putByte(Ee.HandshakeType.client_hello),A.putInt24(g),A.putByte(t.version.major),A.putByte(t.version.minor),A.putBytes(t.session.sp.client_random),lw(A,1,Kt.util.createBuffer(m)),lw(A,2,e),lw(A,1,s),h>0&&lw(A,2,l),A};Ee.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.server_hello),n.putInt24(r),n.putByte(t.version.major),n.putByte(t.version.minor),n.putBytes(t.session.sp.server_random),lw(n,1,Kt.util.createBuffer(e)),n.putByte(t.session.cipherSuite.id[0]),n.putByte(t.session.cipherSuite.id[1]),n.putByte(t.session.compressionMethod),n};Ee.createCertificate=function(t){var e=t.entity===Ee.ConnectionEnd.client,r=null;if(t.getCertificate){var n;e?n=t.session.certificateRequest:n=t.session.extensions.server_name.serverNameList,r=t.getCertificate(t,n)}var o=Kt.util.createBuffer();if(r!==null)try{Kt.util.isArray(r)||(r=[r]);for(var s=null,c=0;c0&&(r.putByte(Ee.HandshakeType.server_key_exchange),r.putInt24(e)),r};Ee.getClientSignature=function(t,e){var r=Kt.util.createBuffer();r.putBuffer(t.session.md5.digest()),r.putBuffer(t.session.sha1.digest()),r=r.getBytes(),t.getSignature=t.getSignature||function(n,o,s){var c=null;if(n.getPrivateKey)try{c=n.getPrivateKey(n,n.session.clientCertificate),c=Kt.pki.privateKeyFromPem(c)}catch(l){n.error(n,{message:"Could not get private key.",cause:l,send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}})}c===null?n.error(n,{message:"No private key set.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.internal_error}}):o=c.sign(o,null),s(n,o)},t.getSignature(t,r,e)};Ee.createCertificateVerify=function(t,e){var r=e.length+2,n=Kt.util.createBuffer();return n.putByte(Ee.HandshakeType.certificate_verify),n.putInt24(r),n.putInt16(e.length),n.putBytes(e),n};Ee.createCertificateRequest=function(t){var e=Kt.util.createBuffer();e.putByte(1);var r=Kt.util.createBuffer();for(var n in t.caStore.certs){var o=t.caStore.certs[n],s=Kt.pki.distinguishedNameToAsn1(o.subject),c=Kt.asn1.toDer(s);r.putInt16(c.length()),r.putBuffer(c)}var l=1+e.length()+2+r.length(),u=Kt.util.createBuffer();return u.putByte(Ee.HandshakeType.certificate_request),u.putInt24(l),lw(u,1,e),lw(u,2,r),u};Ee.createServerHelloDone=function(t){var e=Kt.util.createBuffer();return e.putByte(Ee.HandshakeType.server_hello_done),e.putInt24(0),e};Ee.createChangeCipherSpec=function(){var t=Kt.util.createBuffer();return t.putByte(1),t};Ee.createFinished=function(t){var e=Kt.util.createBuffer();e.putBuffer(t.session.md5.digest()),e.putBuffer(t.session.sha1.digest());var r=t.entity===Ee.ConnectionEnd.client,n=t.session.sp,o=12,s=Bnt,c=r?"client finished":"server finished";e=s(n.master_secret,c,e.getBytes(),o);var l=Kt.util.createBuffer();return l.putByte(Ee.HandshakeType.finished),l.putInt24(e.length()),l.putBuffer(e),l};Ee.createHeartbeat=function(t,e,r){typeof r>"u"&&(r=e.length);var n=Kt.util.createBuffer();n.putByte(t),n.putInt16(r),n.putBytes(e);var o=n.length(),s=Math.max(16,o-r-3);return n.putBytes(Kt.random.getBytes(s)),n};Ee.queue=function(t,e){if(e&&!(e.fragment.length()===0&&(e.type===Ee.ContentType.handshake||e.type===Ee.ContentType.alert||e.type===Ee.ContentType.change_cipher_spec))){if(e.type===Ee.ContentType.handshake){var r=e.fragment.bytes();t.session.md5.update(r),t.session.sha1.update(r),r=null}var n;if(e.fragment.length()<=Ee.MaxFragment)n=[e];else{n=[];for(var o=e.fragment.bytes();o.length>Ee.MaxFragment;)n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o.slice(0,Ee.MaxFragment))})),o=o.slice(Ee.MaxFragment);o.length>0&&n.push(Ee.createRecord(t,{type:e.type,data:Kt.util.createBuffer(o)}))}for(var s=0;s0&&(c=r.order[0]),c!==null&&c in r.cache){s=r.cache[c],delete r.cache[c];for(var l in r.order)if(r.order[l]===c){r.order.splice(l,1);break}}return s},r.setSession=function(o,s){if(r.order.length===r.capacity){var c=r.order.shift();delete r.cache[c]}var c=Kt.util.bytesToHex(o);r.order.push(c),r.cache[c]=s}}return r};Ee.createConnection=function(t){var e=null;t.caStore?Kt.util.isArray(t.caStore)?e=Kt.pki.createCaStore(t.caStore):e=t.caStore:e=Kt.pki.createCaStore();var r=t.cipherSuites||null;if(r===null){r=[];for(var n in Ee.CipherSuites)r.push(Ee.CipherSuites[n])}var o=t.server?Ee.ConnectionEnd.server:Ee.ConnectionEnd.client,s=t.sessionCache?Ee.createSessionCache(t.sessionCache):null,c={version:{major:Ee.Version.major,minor:Ee.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:s,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(f,h,m,g){return h},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:Kt.util.createBuffer(),tlsData:Kt.util.createBuffer(),data:Kt.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:a(function(f,h){h.origin=h.origin||(f.entity===Ee.ConnectionEnd.client?"client":"server"),h.send&&(Ee.queue(f,Ee.createAlert(f,h.alert)),Ee.flush(f));var m=h.fatal!==!1;m&&(f.fail=!0),t.error(f,h),m&&f.close(!1)},"error"),deflate:t.deflate||null,inflate:t.inflate||null};c.reset=function(f){c.version={major:Ee.Version.major,minor:Ee.Version.minor},c.record=null,c.session=null,c.peerCertificate=null,c.state={pending:null,current:null},c.expect=c.entity===Ee.ConnectionEnd.client?D_s:U_s,c.fragmented=null,c.records=[],c.open=!1,c.handshakes=0,c.handshaking=!1,c.isConnected=!1,c.fail=!(f||typeof f>"u"),c.input.clear(),c.tlsData.clear(),c.data.clear(),c.state.current=Ee.createConnectionState(c)},c.reset();var l=a(function(f,h){var m=h.type-Ee.ContentType.change_cipher_spec,g=Her[f.entity][f.expect];m in g?g[m](f,h):Ee.handleUnexpected(f,h)},"_update"),u=a(function(f){var h=0,m=f.input,g=m.length();if(g<5)h=5-g;else{f.record={type:m.getByte(),version:{major:m.getByte(),minor:m.getByte()},length:m.getInt16(),fragment:Kt.util.createBuffer(),ready:!1};var A=f.record.version.major===f.version.major;A&&f.session&&f.session.version&&(A=f.record.version.minor===f.version.minor),A||f.error(f,{message:"Incompatible TLS version.",send:!0,alert:{level:Ee.Alert.Level.fatal,description:Ee.Alert.Description.protocol_version}})}return h},"_readRecordHeader"),d=a(function(f){var h=0,m=f.input,g=m.length();if(g0&&(c.sessionCache&&(h=c.sessionCache.getSession(f)),h===null&&(f="")),f.length===0&&c.sessionCache&&(h=c.sessionCache.getSession(),h!==null&&(f=h.id)),c.session={id:f,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:Kt.md.md5.create(),sha1:Kt.md.sha1.create()},h&&(c.version=h.version,c.session.sp=h.sp),c.session.sp.client_random=Ee.createRandom().getBytes(),c.open=!0,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.handshake,data:Ee.createClientHello(c)})),Ee.flush(c)}},c.process=function(f){var h=0;return f&&c.input.putBytes(f),c.fail||(c.record!==null&&c.record.ready&&c.record.fragment.isEmpty()&&(c.record=null),c.record===null&&(h=u(c)),!c.fail&&c.record!==null&&!c.record.ready&&(h=d(c)),!c.fail&&c.record!==null&&c.record.ready&&l(c,c.record)),h},c.prepare=function(f){return Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.application_data,data:Kt.util.createBuffer(f)})),Ee.flush(c)},c.prepareHeartbeatRequest=function(f,h){return f instanceof Kt.util.ByteBuffer&&(f=f.bytes()),typeof h>"u"&&(h=f.length),c.expectedHeartbeatPayload=f,Ee.queue(c,Ee.createRecord(c,{type:Ee.ContentType.heartbeat,data:Ee.createHeartbeat(Ee.HeartbeatMessageType.heartbeat_request,f,h)})),Ee.flush(c)},c.close=function(f){if(!c.fail&&c.sessionCache&&c.session){var h={id:c.session.id,version:c.session.version,sp:c.session.sp};h.sp.keys=null,c.sessionCache.setSession(h.id,h)}c.open&&(c.open=!1,c.input.clear(),(c.isConnected||c.handshaking)&&(c.isConnected=c.handshaking=!1,Ee.queue(c,Ee.createAlert(c,{level:Ee.Alert.Level.warning,description:Ee.Alert.Description.close_notify})),Ee.flush(c)),c.closed(c)),c.reset(f)},c};PBn.exports=Kt.tls=Kt.tls||{};for(Mnt in Ee)typeof Ee[Mnt]!="function"&&(Kt.tls[Mnt]=Ee[Mnt]);var Mnt;Kt.tls.prf_tls1=Bnt;Kt.tls.hmac_sha1=R_s;Kt.tls.createSessionCache=Ee.createSessionCache;Kt.tls.createConnection=Ee.createConnection});var NBn=I((oKd,DBn)=>{p();var Jq=us();Gq();Ger();var uw=DBn.exports=Jq.tls;uw.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=uw.BulkCipherAlgorithm.aes,t.cipher_type=uw.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=uw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:kBn};uw.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:a(function(t){t.bulk_cipher_algorithm=uw.BulkCipherAlgorithm.aes,t.cipher_type=uw.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=uw.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},"initSecurityParameters"),initConnectionState:kBn};function kBn(t,e,r){var n=e.entity===Jq.tls.ConnectionEnd.client;t.read.cipherState={init:!1,cipher:Jq.cipher.createDecipher("AES-CBC",n?r.keys.server_write_key:r.keys.client_write_key),iv:n?r.keys.server_write_IV:r.keys.client_write_IV},t.write.cipherState={init:!1,cipher:Jq.cipher.createCipher("AES-CBC",n?r.keys.client_write_key:r.keys.server_write_key),iv:n?r.keys.client_write_IV:r.keys.server_write_IV},t.read.cipherFunction=Z_s,t.write.cipherFunction=Y_s,t.read.macLength=t.write.macLength=r.mac_length,t.read.macFunction=t.write.macFunction=uw.hmac_sha1}a(kBn,"initConnectionState");function Y_s(t,e){var r=!1,n=e.macFunction(e.macKey,e.sequenceNumber,t);t.fragment.putBytes(n),e.updateSequenceNumber();var o;t.version.minor===uw.Versions.TLS_1_0.minor?o=e.cipherState.init?null:e.cipherState.iv:o=Jq.random.getBytesSync(16),e.cipherState.init=!0;var s=e.cipherState.cipher;return s.start({iv:o}),t.version.minor>=uw.Versions.TLS_1_1.minor&&s.output.putBytes(o),s.update(t.fragment),s.finish(K_s)&&(t.fragment=s.output,t.length=t.fragment.length(),r=!0),r}a(Y_s,"encrypt_aes_cbc_sha1");function K_s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}a(K_s,"encrypt_aes_cbc_sha1_padding");function J_s(t,e,r){var n=!0;if(r){for(var o=e.length(),s=e.last(),c=o-1-s;c=s?(t.fragment=o.output.getBytes(l-s),c=o.output.getBytes(s)):t.fragment=o.output.getBytes(),t.fragment=Jq.util.createBuffer(t.fragment),t.length=t.fragment.length();var u=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),r=X_s(e.macKey,c,u)&&r,r}a(Z_s,"decrypt_aes_cbc_sha1");function X_s(t,e,r){var n=Jq.hmac.create();return n.start("SHA1",t),n.update(e),e=n.digest().getBytes(),n.start(null,null),n.update(r),r=n.digest().getBytes(),e===r}a(X_s,"compareMacs")});var Wer=I((cKd,LBn)=>{p();var td=us();OO();ic();var xRe=LBn.exports=td.sha512=td.sha512||{};td.md.sha512=td.md.algorithms.sha512=xRe;var OBn=td.sha384=td.sha512.sha384=td.sha512.sha384||{};OBn.create=function(){return xRe.create("SHA-384")};td.md.sha384=td.md.algorithms.sha384=OBn;td.sha512.sha256=td.sha512.sha256||{create:a(function(){return xRe.create("SHA-512/256")},"create")};td.md["sha512/256"]=td.md.algorithms["sha512/256"]=td.sha512.sha256;td.sha512.sha224=td.sha512.sha224||{create:a(function(){return xRe.create("SHA-512/224")},"create")};td.md["sha512/224"]=td.md.algorithms["sha512/224"]=td.sha512.sha224;xRe.create=function(t){if(BBn||evs(),typeof t>"u"&&(t="SHA-512"),!(t in TJ))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=TJ[t],r=null,n=td.util.createBuffer(),o=new Array(80),s=0;s<80;++s)o[s]=new Array(2);var c=64;switch(t){case"SHA-384":c=48;break;case"SHA-512/256":c=32;break;case"SHA-512/224":c=28;break}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:c,messageLength:0,fullMessageLength:null,messageLengthSize:16};return l.start=function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var u=l.messageLengthSize/4,d=0;d>>0,f>>>0];for(var h=l.fullMessageLength.length-1;h>=0;--h)l.fullMessageLength[h]+=f[1],f[1]=f[0]+(l.fullMessageLength[h]/4294967296>>>0),l.fullMessageLength[h]=l.fullMessageLength[h]>>>0,f[0]=f[1]/4294967296>>>0;return n.putBytes(u),MBn(r,o,n),(n.read>2048||n.length()===0)&&n.compact(),l},l.digest=function(){var u=td.util.createBuffer();u.putBytes(n.bytes());var d=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize,f=d&l.blockLength-1;u.putBytes($er.substr(0,l.blockLength-f));for(var h,m,g=l.fullMessageLength[0]*8,A=0;A>>0,g+=m,u.putInt32(g>>>0),g=h>>>0;u.putInt32(g);for(var y=new Array(r.length),A=0;A=128;){for(O=0;O<16;++O)e[O][0]=r.getInt32()>>>0,e[O][1]=r.getInt32()>>>0;for(;O<80;++O)U=e[O-2],q=U[0],Q=U[1],n=((q>>>19|Q<<13)^(Q>>>29|q<<3)^q>>>6)>>>0,o=((q<<13|Q>>>19)^(Q<<3|q>>>29)^(q<<26|Q>>>6))>>>0,W=e[O-15],q=W[0],Q=W[1],s=((q>>>1|Q<<31)^(q>>>8|Q<<24)^q>>>7)>>>0,c=((q<<31|Q>>>1)^(q<<24|Q>>>8)^(q<<25|Q>>>7))>>>0,z=e[O-7],$=e[O-16],Q=o+z[1]+c+$[1],e[O][0]=n+z[0]+s+$[0]+(Q/4294967296>>>0)>>>0,e[O][1]=Q>>>0;for(y=t[0][0],E=t[0][1],_=t[1][0],v=t[1][1],b=t[2][0],T=t[2][1],w=t[3][0],R=t[3][1],x=t[4][0],P=t[4][1],D=t[5][0],N=t[5][1],B=t[6][0],L=t[6][1],j=t[7][0],M=t[7][1],O=0;O<80;++O)d=((x>>>14|P<<18)^(x>>>18|P<<14)^(P>>>9|x<<23))>>>0,f=((x<<18|P>>>14)^(x<<14|P>>>18)^(P<<23|x>>>9))>>>0,h=(B^x&(D^B))>>>0,m=(L^P&(N^L))>>>0,l=((y>>>28|E<<4)^(E>>>2|y<<30)^(E>>>7|y<<25))>>>0,u=((y<<4|E>>>28)^(E<<30|y>>>2)^(E<<25|y>>>7))>>>0,g=(y&_|b&(y^_))>>>0,A=(E&v|T&(E^v))>>>0,Q=M+f+m+Ver[O][1]+e[O][1],n=j+d+h+Ver[O][0]+e[O][0]+(Q/4294967296>>>0)>>>0,o=Q>>>0,Q=u+A,s=l+g+(Q/4294967296>>>0)>>>0,c=Q>>>0,j=B,M=L,B=D,L=N,D=x,N=P,Q=R+o,x=w+n+(Q/4294967296>>>0)>>>0,P=Q>>>0,w=b,R=T,b=_,T=v,_=y,v=E,Q=o+c,y=n+s+(Q/4294967296>>>0)>>>0,E=Q>>>0;Q=t[0][1]+E,t[0][0]=t[0][0]+y+(Q/4294967296>>>0)>>>0,t[0][1]=Q>>>0,Q=t[1][1]+v,t[1][0]=t[1][0]+_+(Q/4294967296>>>0)>>>0,t[1][1]=Q>>>0,Q=t[2][1]+T,t[2][0]=t[2][0]+b+(Q/4294967296>>>0)>>>0,t[2][1]=Q>>>0,Q=t[3][1]+R,t[3][0]=t[3][0]+w+(Q/4294967296>>>0)>>>0,t[3][1]=Q>>>0,Q=t[4][1]+P,t[4][0]=t[4][0]+x+(Q/4294967296>>>0)>>>0,t[4][1]=Q>>>0,Q=t[5][1]+N,t[5][0]=t[5][0]+D+(Q/4294967296>>>0)>>>0,t[5][1]=Q>>>0,Q=t[6][1]+L,t[6][0]=t[6][0]+B+(Q/4294967296>>>0)>>>0,t[6][1]=Q>>>0,Q=t[7][1]+M,t[7][0]=t[7][0]+j+(Q/4294967296>>>0)>>>0,t[7][1]=Q>>>0,J-=128}}a(MBn,"_update")});var FBn=I(zer=>{p();var tvs=us();$k();var gg=tvs.asn1;zer.privateKeyValidator={name:"PrivateKeyInfo",tagClass:gg.Class.UNIVERSAL,type:gg.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:gg.Class.UNIVERSAL,type:gg.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:gg.Class.UNIVERSAL,type:gg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:gg.Class.UNIVERSAL,type:gg.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:gg.Class.UNIVERSAL,type:gg.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]};zer.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:gg.Class.UNIVERSAL,type:gg.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:gg.Class.UNIVERSAL,type:gg.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:gg.Class.UNIVERSAL,type:gg.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:gg.Class.UNIVERSAL,type:gg.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}});var JBn=I((pKd,KBn)=>{p();var RA=us();bRe();ow();Wer();ic();var GBn=FBn(),rvs=GBn.publicKeyValidator,nvs=GBn.privateKeyValidator;typeof UBn>"u"&&(UBn=RA.jsbn.BigInteger);var UBn,Ker=RA.util.ByteBuffer,VC=typeof Buffer>"u"?Uint8Array:Buffer;RA.pki=RA.pki||{};KBn.exports=RA.pki.ed25519=RA.ed25519=RA.ed25519||{};var zs=RA.ed25519;zs.constants={};zs.constants.PUBLIC_KEY_BYTE_LENGTH=32;zs.constants.PRIVATE_KEY_BYTE_LENGTH=64;zs.constants.SEED_BYTE_LENGTH=32;zs.constants.SIGN_BYTE_LENGTH=64;zs.constants.HASH_BYTE_LENGTH=64;zs.generateKeyPair=function(t){t=t||{};var e=t.seed;if(e===void 0)e=RA.random.getBytesSync(zs.constants.SEED_BYTE_LENGTH);else if(typeof e=="string"){if(e.length!==zs.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+zs.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=nF({message:e,encoding:"binary"});for(var r=new VC(zs.constants.PUBLIC_KEY_BYTE_LENGTH),n=new VC(zs.constants.PRIVATE_KEY_BYTE_LENGTH),o=0;o<32;++o)n[o]=e[o];return avs(r,n),{publicKey:r,privateKey:n}};zs.privateKeyFromAsn1=function(t){var e={},r=[],n=RA.asn1.validate(t,nvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=RA.asn1.derToOid(e.privateKeyOid),c=RA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.privateKey,u=nF({message:RA.asn1.fromDer(l).value,encoding:"binary"});return{privateKeyBytes:u}};zs.publicKeyFromAsn1=function(t){var e={},r=[],n=RA.asn1.validate(t,rvs,e,r);if(!n){var o=new Error("Invalid Key.");throw o.errors=r,o}var s=RA.asn1.derToOid(e.publicKeyOid),c=RA.oids.EdDSA25519;if(s!==c)throw new Error('Invalid OID "'+s+'"; OID must be "'+c+'".');var l=e.ed25519PublicKey;if(l.length!==zs.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return nF({message:l,encoding:"binary"})};zs.publicKeyFromPrivateKey=function(t){t=t||{};var e=nF({message:t.privateKey,encoding:"binary"});if(e.length!==zs.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+zs.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new VC(zs.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n=0};function nF(t){var e=t.message;if(e instanceof Uint8Array||e instanceof VC)return e;var r=t.encoding;if(e===void 0)if(t.md)e=t.md.digest().getBytes(),r="binary";else throw new TypeError('"options.message" or "options.md" not specified.');if(typeof e=="string"&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.from(e,r);e=new Ker(e,r)}else if(!(e instanceof Ker))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new VC(e.length()),o=0;o=0;--r){if(t[e+r]wRe[r])return!1}return!1}a(uvs,"_isCanonicalSignatureScalar");function $Bn(t,e){var r,n,o,s;for(n=63;n>=32;--n){for(r=0,o=n-32,s=n-12;o>8,e[o]-=r*256;e[o]+=r,e[n]=0}for(r=0,o=0;o<32;++o)e[o]+=r-(e[31]>>4)*wRe[o],r=e[o]>>8,e[o]&=255;for(o=0;o<32;++o)e[o]-=r*wRe[o];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=e[n]&255}a($Bn,"modL");function Zer(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;$Bn(t,e)}a(Zer,"reduce");function Xer(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi(),d=Gi(),f=Gi();Gde(r,t[1],t[0]),Gde(f,e[1],e[0]),Ul(r,r,f),Hde(n,t[0],t[1]),Hde(f,e[0],e[1]),Ul(n,n,f),Ul(o,t[3],e[3]),Ul(o,o,ovs),Ul(s,t[2],e[2]),Hde(s,s,s),Gde(c,n,r),Gde(l,s,o),Hde(u,s,o),Hde(d,n,r),Ul(t[0],c,l),Ul(t[1],d,u),Ul(t[2],u,l),Ul(t[3],c,d)}a(Xer,"add");function jBn(t,e,r){for(var n=0;n<4;++n)YBn(t[n],e[n],r)}a(jBn,"cswap");function etr(t,e){var r=Gi(),n=Gi(),o=Gi();mvs(o,e[2]),Ul(r,e[0],o),Ul(n,e[1],o),Fnt(t,n),t[31]^=WBn(r)<<7}a(etr,"pack");function Fnt(t,e){var r,n,o,s=Gi(),c=Gi();for(r=0;r<16;++r)c[r]=e[r];for(Yer(c),Yer(c),Yer(c),n=0;n<2;++n){for(s[0]=c[0]-65517,r=1;r<15;++r)s[r]=c[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=c[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,YBn(c,s,1-o)}for(r=0;r<16;r++)t[2*r]=c[r]&255,t[2*r+1]=c[r]>>8}a(Fnt,"pack25519");function dvs(t,e){var r=Gi(),n=Gi(),o=Gi(),s=Gi(),c=Gi(),l=Gi(),u=Gi();return Zq(t[2],Lnt),fvs(t[1],e),IJ(o,t[1]),Ul(s,o,ivs),Gde(o,o,t[2]),Hde(s,t[2],s),IJ(c,s),IJ(l,c),Ul(u,l,c),Ul(r,u,o),Ul(r,r,s),pvs(r,r),Ul(r,r,o),Ul(r,r,s),Ul(r,r,s),Ul(t[0],r,s),IJ(n,t[0]),Ul(n,n,s),HBn(n,o)&&Ul(t[0],t[0],svs),IJ(n,t[0]),Ul(n,n,s),HBn(n,o)?-1:(WBn(t[0])===e[31]>>7&&Gde(t[0],Jer,t[0]),Ul(t[3],t[0],t[1]),0)}a(dvs,"unpackneg");function fvs(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}a(fvs,"unpack25519");function pvs(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=250;n>=0;--n)IJ(r,r),n!==1&&Ul(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(pvs,"pow2523");function HBn(t,e){var r=new VC(32),n=new VC(32);return Fnt(r,t),Fnt(n,e),VBn(r,0,n,0)}a(HBn,"neq25519");function VBn(t,e,r,n){return hvs(t,e,r,n,32)}a(VBn,"crypto_verify_32");function hvs(t,e,r,n,o){var s,c=0;for(s=0;s>>8)-1}a(hvs,"vn");function WBn(t){var e=new VC(32);return Fnt(e,t),e[0]&1}a(WBn,"par25519");function zBn(t,e,r){var n,o;for(Zq(t[0],Jer),Zq(t[1],Lnt),Zq(t[2],Lnt),Zq(t[3],Jer),o=255;o>=0;--o)n=r[o/8|0]>>(o&7)&1,jBn(t,e,n),Xer(e,t),Xer(t,t),jBn(t,e,n)}a(zBn,"scalarmult");function ttr(t,e){var r=[Gi(),Gi(),Gi(),Gi()];Zq(r[0],QBn),Zq(r[1],qBn),Zq(r[2],Lnt),Ul(r[3],QBn,qBn),zBn(t,r,e)}a(ttr,"scalarbase");function Zq(t,e){var r;for(r=0;r<16;r++)t[r]=e[r]|0}a(Zq,"set25519");function mvs(t,e){var r=Gi(),n;for(n=0;n<16;++n)r[n]=e[n];for(n=253;n>=0;--n)IJ(r,r),n!==2&&n!==4&&Ul(r,r,e);for(n=0;n<16;++n)t[n]=r[n]}a(mvs,"inv25519");function Yer(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-n*65536;t[0]+=n-1+37*(n-1)}a(Yer,"car25519");function YBn(t,e,r){for(var n,o=~(r-1),s=0;s<16;++s)n=o&(t[s]^e[s]),t[s]^=n,e[s]^=n}a(YBn,"sel25519");function Gi(t){var e,r=new Float64Array(16);if(t)for(e=0;e{p();var YS=us();ic();ow();bRe();eLn.exports=YS.kem=YS.kem||{};var ZBn=YS.jsbn.BigInteger;YS.kem.rsa={};YS.kem.rsa.create=function(t,e){e=e||{};var r=e.prng||YS.random,n={};return n.encrypt=function(o,s){var c=Math.ceil(o.n.bitLength()/8),l;do l=new ZBn(YS.util.bytesToHex(r.getBytesSync(c)),16).mod(o.n);while(l.compareTo(ZBn.ONE)<=0);l=YS.util.hexToBytes(l.toString(16));var u=c-l.length;u>0&&(l=YS.util.fillString("\0",u)+l);var d=o.encrypt(l,"NONE"),f=t.generate(l,s);return{encapsulation:d,key:f}},n.decrypt=function(o,s,c){var l=o.decrypt(s,"NONE");return t.generate(l,c)},n};YS.kem.kdf1=function(t,e){XBn(this,t,0,e||t.digestLength)};YS.kem.kdf2=function(t,e){XBn(this,t,1,e||t.digestLength)};function XBn(t,e,r,n){t.generate=function(o,s){for(var c=new YS.util.ByteBuffer,l=Math.ceil(s/n)+r,u=new YS.util.ByteBuffer,d=r;d{p();var la=us();ic();iLn.exports=la.log=la.log||{};la.log.levels=["none","error","warning","info","debug","verbose","max"];var Unt={},itr=[],kRe=null;la.log.LEVEL_LOCKED=2;la.log.NO_LEVEL_CHECK=4;la.log.INTERPOLATE=8;for(HO=0;HO"u"||e?t.flags|=la.log.LEVEL_LOCKED:t.flags&=~la.log.LEVEL_LOCKED};la.log.addLogger=function(t){itr.push(t)};typeof console<"u"&&"log"in console?(console.error&&console.warn&&console.info&&console.debug?(rLn={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},DRe=a(function(t,e){la.log.prepareStandard(e);var r=rLn[e.level],n=[e.standard];n=n.concat(e.arguments.slice()),r.apply(console,n)},"f"),$de=la.log.makeLogger(DRe)):(DRe=a(function(e,r){la.log.prepareStandardFull(r),console.log(r.standardFull)},"f"),$de=la.log.makeLogger(DRe)),la.log.setLevel($de,"debug"),la.log.addLogger($de),kRe=$de):console={log:a(function(){},"log")};var $de,rLn,DRe;kRe!==null&&typeof window<"u"&&window.location&&(PRe=new URL(window.location.href).searchParams,PRe.has("console.level")&&la.log.setLevel(kRe,PRe.get("console.level").slice(-1)[0]),PRe.has("console.lock")&&(nLn=PRe.get("console.lock").slice(-1)[0],nLn=="true"&&la.log.lock(kRe)));var PRe,nLn;la.log.consoleLogger=kRe});var aLn=I((CKd,sLn)=>{p();sLn.exports=OO();ynt();Fde();yer();Wer()});var uLn=I((SKd,lLn)=>{p();var Zr=us();Gq();$k();vRe();$q();EJ();Der();ow();ic();Dnt();var Ze=Zr.asn1,G_=lLn.exports=Zr.pkcs7=Zr.pkcs7||{};G_.messageFromPem=function(t){var e=Zr.pem.decode(t)[0];if(e.type!=="PKCS7"){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=e.type,r}if(e.procType&&e.procType.type==="ENCRYPTED")throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var n=Ze.fromDer(e.body);return G_.messageFromAsn1(n)};G_.messageToPem=function(t,e){var r={type:"PKCS7",body:Ze.toDer(t.toAsn1()).getBytes()};return Zr.pem.encode(r,{maxline:e})};G_.messageFromAsn1=function(t){var e={},r=[];if(!Ze.validate(t,G_.asn1.contentInfoValidator,e,r)){var n=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw n.errors=r,n}var o=Ze.derToOid(e.contentType),s;switch(o){case Zr.pki.oids.envelopedData:s=G_.createEnvelopedData();break;case Zr.pki.oids.encryptedData:s=G_.createEncryptedData();break;case Zr.pki.oids.signedData:s=G_.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+o+" is not (yet) supported.")}return s.fromAsn1(e.content.value[0]),s};G_.createSignedData=function(){var t=null;return t={type:Zr.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:a(function(n){if(str(t,n,G_.asn1.signedDataValidator),t.certificates=[],t.crls=[],t.digestAlgorithmIdentifiers=[],t.contentInfo=null,t.signerInfos=[],t.rawCapture.certificates)for(var o=t.rawCapture.certificates.value,s=0;s0&&c.value[0].value.push(Ze.create(Ze.Class.CONTEXT_SPECIFIC,0,!0,n)),s.length>0&&c.value[0].value.push(Ze.create(Ze.Class.CONTEXT_SPECIFIC,1,!0,s)),c.value[0].value.push(Ze.create(Ze.Class.UNIVERSAL,Ze.Type.SET,!0,t.signerInfos)),Ze.create(Ze.Class.UNIVERSAL,Ze.Type.SEQUENCE,!0,[Ze.create(Ze.Class.UNIVERSAL,Ze.Type.OID,!1,Ze.oidToDer(t.type).getBytes()),c])},"toAsn1"),addSigner:a(function(n){var o=n.issuer,s=n.serialNumber;if(n.certificate){var c=n.certificate;typeof c=="string"&&(c=Zr.pki.certificateFromPem(c)),o=c.issuer.attributes,s=c.serialNumber}var l=n.key;if(!l)throw new Error("Could not add PKCS#7 signer; no private key specified.");typeof l=="string"&&(l=Zr.pki.privateKeyFromPem(l));var u=n.digestAlgorithm||Zr.pki.oids.sha1;switch(u){case Zr.pki.oids.sha1:case Zr.pki.oids.sha256:case Zr.pki.oids.sha384:case Zr.pki.oids.sha512:case Zr.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+u)}var d=n.authenticatedAttributes||[];if(d.length>0){for(var f=!1,h=!1,m=0;m0){for(var r=Ze.create(Ze.Class.CONTEXT_SPECIFIC,1,!0,[]),n=0;n=r&&o{p();var e0=us();Gq();Mde();ynt();Fde();ic();var qnt=dLn.exports=e0.ssh=e0.ssh||{};qnt.privateKeyToPutty=function(t,e,r){r=r||"",e=e||"";var n="ssh-rsa",o=e===""?"none":"aes256-cbc",s="PuTTY-User-Key-File-2: "+n+`\r `;s+="Encryption: "+o+`\r `,s+="Comment: "+r+`\r -`;var c=Zh.util.createBuffer();Kde(c,n),KO(c,t.e),KO(c,t.n);var l=Zh.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r -`,s+=l;var d=Zh.util.createBuffer();KO(d,t.d),KO(d,t.p),KO(d,t.q),KO(d,t.qInv);var f;if(!e)f=Zh.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=Vnt(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=Zh.util.createBuffer();g.putBuffer(Vnt("\0\0\0\0",e)),g.putBuffer(Vnt("\0\0\0",e));var A=Zh.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(Zh.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=Zh.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r +`;var c=e0.util.createBuffer();Vde(c,n),GO(c,t.e),GO(c,t.n);var l=e0.util.encode64(c.bytes(),64),u=Math.floor(l.length/66)+1;s+="Public-Lines: "+u+`\r +`,s+=l;var d=e0.util.createBuffer();GO(d,t.d),GO(d,t.p),GO(d,t.q),GO(d,t.qInv);var f;if(!e)f=e0.util.encode64(d.bytes(),64);else{var h=d.length()+16-1;h-=h%16;var m=Qnt(d.bytes());m.truncate(m.length()-h+d.length()),d.putBuffer(m);var g=e0.util.createBuffer();g.putBuffer(Qnt("\0\0\0\0",e)),g.putBuffer(Qnt("\0\0\0",e));var A=e0.aes.createEncryptionCipher(g.truncate(8),"CBC");A.start(e0.util.createBuffer().fillWithByte(0,16)),A.update(d.copy()),A.finish();var y=A.output;y.truncate(16),f=e0.util.encode64(y.bytes(),64)}u=Math.floor(f.length/66)+1,s+=`\r Private-Lines: `+u+`\r -`,s+=f;var E=Vnt("putty-private-key-file-mac-key",e),_=Zh.util.createBuffer();Kde(_,n),Kde(_,o),Kde(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=Zh.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r +`,s+=f;var E=Qnt("putty-private-key-file-mac-key",e),_=e0.util.createBuffer();Vde(_,n),Vde(_,o),Vde(_,r),_.putInt32(c.length()),_.putBuffer(c),_.putInt32(d.length()),_.putBuffer(d);var v=e0.hmac.create();return v.start("sha1",E),v.update(_.bytes()),s+=`\r Private-MAC: `+v.digest().toHex()+`\r -`,s};Wnt.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=Zh.util.createBuffer();return Kde(n,r),KO(n,t.e),KO(n,t.n),r+" "+Zh.util.encode64(n.bytes())+" "+e};Wnt.privateKeyToOpenSSH=function(t,e){return e?Zh.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):Zh.pki.privateKeyToPem(t)};Wnt.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||Zh.md.md5.create(),n="ssh-rsa",o=Zh.util.createBuffer();Kde(o,n),KO(o,t.e),KO(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function KO(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=Zh.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(KO,"_addBigIntegerToBuffer");function Kde(t,e){t.putInt32(e.length),t.putString(e)}a(Kde,"_addStringToBuffer");function Vnt(){for(var t=Zh.md.sha1.create(),e=arguments.length,r=0;r{p();uLn.exports=ds();Kq();kBn();WP();Ant();MRe();zBn();Fde();ZBn();rLn();iLn();xer();wnt();xJ();Cer();ker();aLn();Der();ber();per();Ont();sw();ger();lLn();Fer();ic()});var hLn=I(OJ=>{"use strict";p();Object.defineProperty(OJ,"__esModule",{value:!0});OJ.convert=OJ.Format=void 0;var VRe=dLn(),oj;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(oj=OJ.Format||(OJ.Format={}));function fLn(t){var e=VRe.pki.pemToDer(t),r=VRe.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(fLn,"myASN");function Ovs(t){var e=fLn(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` -`)}a(Ovs,"txtFormat");function pLn(t,e){switch(e){case oj.der:return VRe.pki.pemToDer(t);case oj.pem:return t;case oj.txt:return Ovs(t);case oj.asn1:return fLn(t);case oj.fingerprint:var r=VRe.md.sha1.create(),n=pLn(t,oj.der);return r.update(n.getBytes()),r.digest().toHex();case oj.x509:return VRe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(pLn,"convert");OJ.convert=pLn});var _Ln=I(Zv=>{"use strict";p();var sj=Zv&&Zv.__assign||function(){return sj=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(ttr.Agent),(0,gLn.setGlobalDispatcher)(new gLn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");Zv.addToGlobalAgent=Lvs});var CLn=I((aXd,rtr)=>{p();function Fvs(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a(Fvs,"all");process.platform!=="win32"?rtr.exports.all=()=>[]:rtr.exports.all=Fvs});var nl=I((hXd,xLn)=>{"use strict";p();xLn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var Atr=I((gXd,PLn)=>{"use strict";p();var Zde=0,dtr=1e3,ftr=(dtr>>1)-1,aj,ptr=Symbol("kFastTimer"),dF=[],htr=-2,mtr=-1,RLn=0,wLn=1;function gtr(){Zde+=ftr;let t=0,e=dF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=mtr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===mtr?(r._state=htr,--e!==0&&(dF[t]=dF[e])):++t}dF.length=e,dF.length!==0&&kLn()}a(gtr,"onTick");function kLn(){aj?.refresh?aj.refresh():(clearTimeout(aj),aj=setTimeout(gtr,ftr),aj?.unref())}a(kLn,"refreshTimeout");var Xnt=class{static{a(this,"FastTimer")}[ptr]=!0;_state=htr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===htr&&dF.push(this),(!aj||dF.length===1)&&kLn(),this._state=RLn}clear(){this._state=mtr,this._idleStart=-1}};PLn.exports={setTimeout(t,e,r){return e<=dtr?setTimeout(t,e,r):new Xnt(t,e,r)},clearTimeout(t){t[ptr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Xnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return Zde},tick(t=0){Zde+=t-dtr+1,gtr(),gtr()},reset(){Zde=0,dF.length=0,clearTimeout(aj),aj=null},kFastTimer:ptr}});var ao=I((EXd,r3n)=>{"use strict";p();var DLn=Symbol.for("undici.error.UND_ERR"),rd=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[DLn]===!0}get[DLn](){return!0}},NLn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),ytr=class extends rd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[NLn]===!0}get[NLn](){return!0}},MLn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),Etr=class extends rd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[MLn]===!0}get[MLn](){return!0}},OLn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),_tr=class extends rd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[OLn]===!0}get[OLn](){return!0}},BLn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),Ctr=class extends rd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[BLn]===!0}get[BLn](){return!0}},LLn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),vtr=class extends rd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[LLn]===!0}get[LLn](){return!0}},FLn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),btr=class extends rd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[FLn]===!0}get[FLn](){return!0}},ULn=Symbol.for("undici.error.UND_ERR_ABORT"),eit=class extends rd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[ULn]===!0}get[ULn](){return!0}},QLn=Symbol.for("undici.error.UND_ERR_ABORTED"),Str=class extends eit{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[QLn]===!0}get[QLn](){return!0}},qLn=Symbol.for("undici.error.UND_ERR_INFO"),Ttr=class extends rd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[qLn]===!0}get[qLn](){return!0}},jLn=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Itr=class extends rd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[jLn]===!0}get[jLn](){return!0}},HLn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),xtr=class extends rd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[HLn]===!0}get[HLn](){return!0}},GLn=Symbol.for("undici.error.UND_ERR_DESTROYED"),wtr=class extends rd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[GLn]===!0}get[GLn](){return!0}},$Ln=Symbol.for("undici.error.UND_ERR_CLOSED"),Rtr=class extends rd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[$Ln]===!0}get[$Ln](){return!0}},VLn=Symbol.for("undici.error.UND_ERR_SOCKET"),ktr=class extends rd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[VLn]===!0}get[VLn](){return!0}},WLn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Ptr=class extends rd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[WLn]===!0}get[WLn](){return!0}},zLn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Dtr=class extends rd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[zLn]===!0}get[zLn](){return!0}},YLn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Ntr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[YLn]===!0}get[YLn](){return!0}},KLn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Mtr=class extends rd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[KLn]===!0}get[KLn](){return!0}},JLn=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),Otr=class extends rd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[JLn]===!0}get[JLn](){return!0}},ZLn=Symbol.for("undici.error.UND_ERR_RESPONSE"),Btr=class extends rd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[ZLn]===!0}get[ZLn](){return!0}},XLn=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Ltr=class extends rd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[XLn]===!0}get[XLn](){return!0}},e3n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Ftr=class extends rd{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[e3n]===!0}get[e3n](){return!0}},Utr=class extends rd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},t3n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Qtr=class extends rd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[t3n]===!0}get[t3n](){return!0}};r3n.exports={AbortError:eit,HTTPParserError:Ntr,UndiciError:rd,HeadersTimeoutError:Etr,HeadersOverflowError:_tr,BodyTimeoutError:Ctr,RequestContentLengthMismatchError:Itr,ConnectTimeoutError:ytr,InvalidArgumentError:vtr,InvalidReturnValueError:btr,RequestAbortedError:Str,ClientDestroyedError:wtr,ClientClosedError:Rtr,InformationalError:Ttr,SocketError:ktr,NotSupportedError:Ptr,ResponseContentLengthMismatchError:xtr,BalancedPoolMissingUpstreamError:Dtr,ResponseExceededMaxSizeError:Mtr,RequestRetryError:Otr,ResponseError:Btr,SecureProxyConnectionError:Ltr,MaxOriginsReachedError:Ftr,Socks5ProxyError:Utr,MessageSizeExceededError:Qtr}});var rit=I((vXd,i3n)=>{"use strict";p();var qtr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],tit={};Object.setPrototypeOf(tit,null);var n3n={};Object.setPrototypeOf(n3n,null);function Qvs(t){let e=n3n[t];return e===void 0&&(e=Buffer.from(t)),e}a(Qvs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:o3n,headerNameLowerCasedRecord:qvs}=rit(),jtr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var WRe=require("node:assert"),{kDestroyed:f3n,kBodyUsed:Xde,kListeners:oit,kBody:l3n}=nl(),{IncomingMessage:jvs}=require("node:http"),p3n=require("node:stream"),Hvs=require("node:net"),{stringify:Gvs}=require("node:querystring"),{EventEmitter:$vs}=require("node:events"),iit=Atr(),{InvalidArgumentError:yg,ConnectTimeoutError:Vvs}=ao(),{headerNameLowerCasedRecord:Wvs}=rit(),{tree:h3n}=c3n(),[zvs,Yvs]=process.versions.node.split(".",2).map(t=>Number(t)),ait=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[l3n]=e,this[Xde]=!1}async*[Symbol.asyncIterator](){WRe(!this[Xde],"disturbed"),this[Xde]=!0,yield*this[l3n]}};function u3n(){}a(u3n,"noop");function Kvs(t){return cit(t)?(_3n(t)===0&&t.on("data",function(){WRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Xde]=!1,$vs.prototype.on.call(t,"data",function(){this[Xde]=!0})),t):t&&typeof t.pipeTo=="function"?new ait(t):t&&T3n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&E3n(t)?new ait(t):t}a(Kvs,"wrapRequestBody");function cit(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(cit,"isStream");function m3n(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(m3n,"isBlobLike");function g3n(t){return t.includes("?")||t.includes("#")}a(g3n,"pathHasQueryOrFragment");function Jvs(t,e){if(g3n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Gvs(e);return r&&(t+="?"+r),t}a(Jvs,"serializePathWithQuery");function A3n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(A3n,"isValidPort");function sit(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(sit,"isHttpOrHttpsPrefixed");function y3n(t){if(typeof t=="string"){if(t=new URL(t),!sit(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new yg("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&A3n(t.port)===!1)throw new yg("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new yg("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new yg("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new yg("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new yg("Invalid URL origin: the origin must be a string or null/undefined.");if(!sit(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!sit(t.origin||t.protocol))throw new yg("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(y3n,"parseURL");function Zvs(t){if(t=y3n(t),t.pathname!=="/"||t.search||t.hash)throw new yg("invalid url");return t}a(Zvs,"parseOrigin");function Xvs(t){if(t[0]==="["){let r=t.indexOf("]");return WRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(Xvs,"getHostname");function ebs(t){if(!t)return null;WRe(typeof t=="string");let e=Xvs(t);return Hvs.isIP(e)?"":e}a(ebs,"getServerName");function tbs(t){return JSON.parse(JSON.stringify(t))}a(tbs,"deepClone");function rbs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(rbs,"isAsyncIterable");function E3n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(E3n,"isIterable");function nbs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(nbs,"hasSafeIterator");function _3n(t){if(t==null)return 0;if(cit(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(m3n(t))return t.size!=null?t.size:null;if(S3n(t))return t.byteLength}return null}a(_3n,"bodyLength");function C3n(t){return t&&!!(t.destroyed||t[f3n]||p3n.isDestroyed?.(t))}a(C3n,"isDestroyed");function v3n(t,e){t==null||!cit(t)||C3n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===jvs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[f3n]=!0))}a(v3n,"destroy");var ibs=/timeout=(\d+)/;function obs(t){let e=t.match(ibs);return e?parseInt(e[1],10)*1e3:null}a(obs,"parseKeepAliveTimeout");function b3n(t){return typeof t=="string"?Wvs[t]??t.toLowerCase():h3n.lookup(t)??t.toString("latin1").toLowerCase()}a(b3n,"headerNameToString");function sbs(t){return h3n.lookup(t)??t.toString("latin1").toLowerCase()}a(sbs,"bufferToLowerCasedHeaderName");function abs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(abs,"parseHeaders");function cbs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(lbs,"encodeRawHeaders");function S3n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(S3n,"isBuffer");function ubs(t,e,r){if(!t||typeof t!="object")throw new yg("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new yg("invalid onConnect method");if(typeof t.onError!="function")throw new yg("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new yg("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new yg("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new yg("invalid onHeaders method");if(typeof t.onData!="function")throw new yg("invalid onData method");if(typeof t.onComplete!="function")throw new yg("invalid onComplete method")}}}a(ubs,"assertRequestHandler");function dbs(t){return!!(t&&(p3n.isDisturbed(t)||t[Xde]))}a(dbs,"isDisturbed");function fbs(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(fbs,"getSocketInfo");function pbs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(pbs,"ReadableStreamFrom");function T3n(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(T3n,"isFormDataLike");function hbs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(hbs,"addAbortListener");var I3n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function mbs(t){return I3n[t]===1}a(mbs,"isTokenCharCode");var gbs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function Abs(t){if(t.length>=12)return gbs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return u3n;let r=null,n=null,o=iit.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>d3n(t.deref(),e))})},e.timeout);return()=>{iit.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return u3n;let r=null,n=iit.setFastTimeout(()=>{r=setImmediate(()=>{d3n(t.deref(),e)})},e.timeout);return()=>{iit.clearFastTimeout(n),clearImmediate(r)}};function d3n(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,v3n(t,new Vvs(r))}a(d3n,"onConnectTimeout");function Ibs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(Ibs,"getProtocolFromUrlString");var x3n=Object.create(null);x3n.enumerable=!0;var Htr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},w3n={...Htr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Htr,null);Object.setPrototypeOf(w3n,null);R3n.exports={kEnumerableProperty:x3n,isDisturbed:dbs,isBlobLike:m3n,parseOrigin:Zvs,parseURL:y3n,getServerName:ebs,isStream:cit,isIterable:E3n,hasSafeIterator:nbs,isAsyncIterable:rbs,isDestroyed:C3n,headerNameToString:b3n,bufferToLowerCasedHeaderName:sbs,addListener:vbs,removeAllListeners:bbs,errorRequest:Sbs,parseRawHeaders:cbs,encodeRawHeaders:lbs,parseHeaders:abs,parseKeepAliveTimeout:obs,destroy:v3n,bodyLength:_3n,deepClone:tbs,ReadableStreamFrom:pbs,isBuffer:S3n,assertRequestHandler:ubs,getSocketInfo:fbs,isFormDataLike:T3n,pathHasQueryOrFragment:g3n,serializePathWithQuery:Jvs,addAbortListener:hbs,isValidHTTPToken:Abs,isValidHeaderValue:Ebs,isTokenCharCode:mbs,parseRangeHeader:Cbs,normalizedMethodRecordsBase:Htr,normalizedMethodRecords:w3n,isValidPort:A3n,isHttpOrHttpsPrefixed:sit,nodeMajor:zvs,nodeMinor:Yvs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:Kvs,setupConnectTimeout:Tbs,getProtocolFromUrlString:Ibs}});var Vtr=I((PXd,M3n)=>{"use strict";p();var{kConnected:k3n,kPending:P3n,kRunning:D3n,kSize:N3n,kFree:xbs,kQueued:wbs}=nl(),Gtr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[k3n],this.pending=e[P3n],this.running=e[D3n],this.size=e[N3n]}},$tr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[k3n],this.free=e[xbs],this.pending=e[P3n],this.queued=e[wbs],this.running=e[D3n],this.size=e[N3n]}};M3n.exports={ClientStats:Gtr,PoolStats:$tr}});var cj=I((MXd,B3n)=>{"use strict";p();var il=require("node:diagnostics_channel"),Ktr=require("node:util"),BJ=Ktr.debuglog("undici"),zRe=Ktr.debuglog("fetch"),lit=Ktr.debuglog("websocket"),rT={beforeConnect:il.channel("undici:client:beforeConnect"),connected:il.channel("undici:client:connected"),connectError:il.channel("undici:client:connectError"),sendHeaders:il.channel("undici:client:sendHeaders"),create:il.channel("undici:request:create"),bodySent:il.channel("undici:request:bodySent"),bodyChunkSent:il.channel("undici:request:bodyChunkSent"),bodyChunkReceived:il.channel("undici:request:bodyChunkReceived"),headers:il.channel("undici:request:headers"),trailers:il.channel("undici:request:trailers"),error:il.channel("undici:request:error"),open:il.channel("undici:websocket:open"),close:il.channel("undici:websocket:close"),socketError:il.channel("undici:websocket:socket_error"),ping:il.channel("undici:websocket:ping"),pong:il.channel("undici:websocket:pong"),proxyConnected:il.channel("undici:proxy:connected")},Wtr=!1;function O3n(t=BJ){if(!Wtr){if(rT.beforeConnect.hasSubscribers||rT.connected.hasSubscribers||rT.connectError.hasSubscribers||rT.sendHeaders.hasSubscribers){Wtr=!0;return}Wtr=!0,il.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),il.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),il.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),il.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(O3n,"trackClientEvents");var ztr=!1;function Rbs(t=BJ){if(!ztr){if(rT.headers.hasSubscribers||rT.trailers.hasSubscribers||rT.error.hasSubscribers){ztr=!0;return}ztr=!0,il.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),il.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),il.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(Rbs,"trackRequestEvents");var Ytr=!1;function kbs(t=lit){if(!Ytr){if(rT.open.hasSubscribers||rT.close.hasSubscribers||rT.socketError.hasSubscribers||rT.ping.hasSubscribers||rT.pong.hasSubscribers){Ytr=!0;return}Ytr=!0,il.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),il.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),il.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),il.subscribe("undici:websocket:ping",e=>{t("ping received")}),il.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(kbs,"trackWebSocketEvents");(BJ.enabled||zRe.enabled)&&(O3n(zRe.enabled?zRe:BJ),Rbs(zRe.enabled?zRe:BJ));lit.enabled&&(O3n(BJ.enabled?BJ:lit),kbs(lit));B3n.exports={channels:rT}});var U3n=I((LXd,F3n)=>{"use strict";p();var{InvalidArgumentError:Qc,NotSupportedError:Pbs}=ao(),JO=require("node:assert"),{isValidHTTPToken:Jtr,isValidHeaderValue:Ztr,isStream:Dbs,destroy:Nbs,isBuffer:Mbs,isFormDataLike:Obs,isIterable:Bbs,hasSafeIterator:Lbs,isBlobLike:Fbs,serializePathWithQuery:Ubs,assertRequestHandler:Qbs,getServerName:qbs,normalizedMethodRecords:jbs,getProtocolFromUrlString:Hbs}=Do(),{channels:Xv}=cj(),{headerNameLowerCasedRecord:L3n}=rit(),Gbs=/[^\u0021-\u00ff]/;function $bs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a($bs,"isValidContentLengthHeaderValue");var fw=Symbol("handler"),Xtr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:E,typeOfService:_},v){if(typeof r!="string")throw new Qc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Qc("path must be an absolute URL or start with a slash");if(Gbs.test(r))throw new Qc("invalid request path");if(typeof n!="string")throw new Qc("method must be a string");if(jbs[n]===void 0&&!Jtr(n))throw new Qc("invalid request method");if(d&&typeof d!="string")throw new Qc("upgrade must be a string");if(d&&!Ztr(d))throw new Qc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Qc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Qc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Qc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Qc("invalid expectContinue");if(y!=null)throw new Qc("invalid throwOnError");if(E!=null&&E!==0)throw new Qc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Qc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(Dbs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){Nbs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(Mbs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(Obs(o)||Bbs(o)||Fbs(o))this.body=o;else throw new Qc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?Ubs(r,c):r,this.origin=e,this.protocol=Hbs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new Qc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:Vbs}=ao();q3n.exports=class Q3n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new Q3n(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),trr(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),trr(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),trr(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new Vbs("invalid onError method");this.#e.onError?.(r)}};function trr(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(trr,"toRawHeaderValue")});var KRe=I((HXd,j3n)=>{"use strict";p();var Wbs=require("node:events"),zbs=YRe(),Ybs=a(t=>(e,r)=>t(e,zbs.wrap(r)),"wrapInterceptor"),rrr=class extends Wbs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=Ybs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};j3n.exports=rrr});var $3n=I((VXd,G3n)=>{"use strict";p();var{parseHeaders:nrr}=Do(),{InvalidArgumentError:Kbs}=ao(),irr=Symbol("resume"),orr=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[irr]=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[irr]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};G3n.exports=class H3n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new H3n(e):e}onConnect(e,r){this.#t=new orr(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#e.onRequestUpgrade?.(this.#t,e,nrr(r),n)}onHeaders(e,r,n,o){return this.#t[irr]=n,this.#e.onResponseStart?.(this.#t,e,nrr(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#e.onResponseEnd?.(this.#t,nrr(e))}onError(e){if(!this.#e.onResponseError)throw new Kbs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var FJ=I((YXd,V3n)=>{"use strict";p();var Jbs=KRe(),Zbs=$3n(),{ClientDestroyedError:srr,ClientClosedError:Xbs,InvalidArgumentError:dit}=ao(),{kDestroy:e1s,kClose:t1s,kClosed:JRe,kDestroyed:efe,kDispatch:r1s}=nl(),lj=Symbol("onDestroyed"),LJ=Symbol("onClosed"),arr=class extends Jbs{static{a(this,"DispatcherBase")}[efe]=!1;[lj]=null;[JRe]=!1;[LJ]=null;get destroyed(){return this[efe]}get closed(){return this[JRe]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new dit("invalid callback");if(this[efe]){let n=new srr;queueMicrotask(()=>e(n,null));return}if(this[JRe]){this[LJ]?this[LJ].push(e):queueMicrotask(()=>e(null,null));return}this[JRe]=!0,this[LJ]??=[],this[LJ].push(e);let r=a(()=>{let n=this[LJ];this[LJ]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new dit("invalid callback");if(this[efe]){this[lj]?this[lj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new srr),this[efe]=!0,this[lj]??=[],this[lj].push(r);let n=a(()=>{let o=this[lj];this[lj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new dit("handler must be an object");r=Zbs.unwrap(r);try{if(!e||typeof e!="object")throw new dit("opts must be an object.");if(this[efe]||this[lj])throw new srr;if(this[JRe])throw new Xbs;return this[r1s](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};V3n.exports=arr});var UJ=I((XXd,Y3n)=>{"use strict";p();var n1s=require("node:net"),W3n=require("node:assert"),z3n=Do(),{InvalidArgumentError:i1s}=ao(),crr,o1s=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function s1s({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new i1s("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new o1s(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:E},_){let v;if(m==="https:"){crr||(crr=require("node:tls")),A=A||l.servername||z3n.getServerName(h)||null;let T=A||f;W3n(T);let w=s||u.get(T)||null;g=g||443,v=crr.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else W3n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=n1s.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let b=z3n.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(s1s,"buildConnector");Y3n.exports=s1s});var K3n=I(lrr=>{"use strict";p();Object.defineProperty(lrr,"__esModule",{value:!0});lrr.enumToMap=a1s;function a1s(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(a1s,"enumToMap")});var J3n=I(Pe=>{"use strict";p();Object.defineProperty(Pe,"__esModule",{value:!0});Pe.SPECIAL_HEADERS=Pe.MINOR=Pe.MAJOR=Pe.HTAB_SP_VCHAR_OBS_TEXT=Pe.QUOTED_STRING=Pe.CONNECTION_TOKEN_CHARS=Pe.HEADER_CHARS=Pe.TOKEN=Pe.HEX=Pe.URL_CHAR=Pe.USERINFO_CHARS=Pe.MARK=Pe.ALPHANUM=Pe.NUM=Pe.HEX_MAP=Pe.NUM_MAP=Pe.ALPHA=Pe.STATUSES_HTTP=Pe.H_METHOD_MAP=Pe.METHOD_MAP=Pe.METHODS_RTSP=Pe.METHODS_ICE=Pe.METHODS_HTTP=Pe.HEADER_STATE=Pe.FINISH=Pe.STATUSES=Pe.METHODS=Pe.LENIENT_FLAGS=Pe.FLAGS=Pe.TYPE=Pe.ERROR=void 0;var c1s=K3n();Pe.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};Pe.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};Pe.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};Pe.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};Pe.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};Pe.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};Pe.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};Pe.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};Pe.METHODS_HTTP=[Pe.METHODS.DELETE,Pe.METHODS.GET,Pe.METHODS.HEAD,Pe.METHODS.POST,Pe.METHODS.PUT,Pe.METHODS.CONNECT,Pe.METHODS.OPTIONS,Pe.METHODS.TRACE,Pe.METHODS.COPY,Pe.METHODS.LOCK,Pe.METHODS.MKCOL,Pe.METHODS.MOVE,Pe.METHODS.PROPFIND,Pe.METHODS.PROPPATCH,Pe.METHODS.SEARCH,Pe.METHODS.UNLOCK,Pe.METHODS.BIND,Pe.METHODS.REBIND,Pe.METHODS.UNBIND,Pe.METHODS.ACL,Pe.METHODS.REPORT,Pe.METHODS.MKACTIVITY,Pe.METHODS.CHECKOUT,Pe.METHODS.MERGE,Pe.METHODS["M-SEARCH"],Pe.METHODS.NOTIFY,Pe.METHODS.SUBSCRIBE,Pe.METHODS.UNSUBSCRIBE,Pe.METHODS.PATCH,Pe.METHODS.PURGE,Pe.METHODS.MKCALENDAR,Pe.METHODS.LINK,Pe.METHODS.UNLINK,Pe.METHODS.PRI,Pe.METHODS.SOURCE,Pe.METHODS.QUERY];Pe.METHODS_ICE=[Pe.METHODS.SOURCE];Pe.METHODS_RTSP=[Pe.METHODS.OPTIONS,Pe.METHODS.DESCRIBE,Pe.METHODS.ANNOUNCE,Pe.METHODS.SETUP,Pe.METHODS.PLAY,Pe.METHODS.PAUSE,Pe.METHODS.TEARDOWN,Pe.METHODS.GET_PARAMETER,Pe.METHODS.SET_PARAMETER,Pe.METHODS.REDIRECT,Pe.METHODS.RECORD,Pe.METHODS.FLUSH,Pe.METHODS.GET,Pe.METHODS.POST];Pe.METHOD_MAP=(0,c1s.enumToMap)(Pe.METHODS);Pe.H_METHOD_MAP=Object.fromEntries(Object.entries(Pe.METHODS).filter(([t])=>t.startsWith("H")));Pe.STATUSES_HTTP=[Pe.STATUSES.CONTINUE,Pe.STATUSES.SWITCHING_PROTOCOLS,Pe.STATUSES.PROCESSING,Pe.STATUSES.EARLY_HINTS,Pe.STATUSES.RESPONSE_IS_STALE,Pe.STATUSES.REVALIDATION_FAILED,Pe.STATUSES.DISCONNECTED_OPERATION,Pe.STATUSES.HEURISTIC_EXPIRATION,Pe.STATUSES.MISCELLANEOUS_WARNING,Pe.STATUSES.OK,Pe.STATUSES.CREATED,Pe.STATUSES.ACCEPTED,Pe.STATUSES.NON_AUTHORITATIVE_INFORMATION,Pe.STATUSES.NO_CONTENT,Pe.STATUSES.RESET_CONTENT,Pe.STATUSES.PARTIAL_CONTENT,Pe.STATUSES.MULTI_STATUS,Pe.STATUSES.ALREADY_REPORTED,Pe.STATUSES.TRANSFORMATION_APPLIED,Pe.STATUSES.IM_USED,Pe.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,Pe.STATUSES.MULTIPLE_CHOICES,Pe.STATUSES.MOVED_PERMANENTLY,Pe.STATUSES.FOUND,Pe.STATUSES.SEE_OTHER,Pe.STATUSES.NOT_MODIFIED,Pe.STATUSES.USE_PROXY,Pe.STATUSES.SWITCH_PROXY,Pe.STATUSES.TEMPORARY_REDIRECT,Pe.STATUSES.PERMANENT_REDIRECT,Pe.STATUSES.BAD_REQUEST,Pe.STATUSES.UNAUTHORIZED,Pe.STATUSES.PAYMENT_REQUIRED,Pe.STATUSES.FORBIDDEN,Pe.STATUSES.NOT_FOUND,Pe.STATUSES.METHOD_NOT_ALLOWED,Pe.STATUSES.NOT_ACCEPTABLE,Pe.STATUSES.PROXY_AUTHENTICATION_REQUIRED,Pe.STATUSES.REQUEST_TIMEOUT,Pe.STATUSES.CONFLICT,Pe.STATUSES.GONE,Pe.STATUSES.LENGTH_REQUIRED,Pe.STATUSES.PRECONDITION_FAILED,Pe.STATUSES.PAYLOAD_TOO_LARGE,Pe.STATUSES.URI_TOO_LONG,Pe.STATUSES.UNSUPPORTED_MEDIA_TYPE,Pe.STATUSES.RANGE_NOT_SATISFIABLE,Pe.STATUSES.EXPECTATION_FAILED,Pe.STATUSES.IM_A_TEAPOT,Pe.STATUSES.PAGE_EXPIRED,Pe.STATUSES.ENHANCE_YOUR_CALM,Pe.STATUSES.MISDIRECTED_REQUEST,Pe.STATUSES.UNPROCESSABLE_ENTITY,Pe.STATUSES.LOCKED,Pe.STATUSES.FAILED_DEPENDENCY,Pe.STATUSES.TOO_EARLY,Pe.STATUSES.UPGRADE_REQUIRED,Pe.STATUSES.PRECONDITION_REQUIRED,Pe.STATUSES.TOO_MANY_REQUESTS,Pe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,Pe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,Pe.STATUSES.LOGIN_TIMEOUT,Pe.STATUSES.NO_RESPONSE,Pe.STATUSES.RETRY_WITH,Pe.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,Pe.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,Pe.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,Pe.STATUSES.INVALID_X_FORWARDED_FOR,Pe.STATUSES.REQUEST_HEADER_TOO_LARGE,Pe.STATUSES.SSL_CERTIFICATE_ERROR,Pe.STATUSES.SSL_CERTIFICATE_REQUIRED,Pe.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,Pe.STATUSES.INVALID_TOKEN,Pe.STATUSES.CLIENT_CLOSED_REQUEST,Pe.STATUSES.INTERNAL_SERVER_ERROR,Pe.STATUSES.NOT_IMPLEMENTED,Pe.STATUSES.BAD_GATEWAY,Pe.STATUSES.SERVICE_UNAVAILABLE,Pe.STATUSES.GATEWAY_TIMEOUT,Pe.STATUSES.HTTP_VERSION_NOT_SUPPORTED,Pe.STATUSES.VARIANT_ALSO_NEGOTIATES,Pe.STATUSES.INSUFFICIENT_STORAGE,Pe.STATUSES.LOOP_DETECTED,Pe.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,Pe.STATUSES.NOT_EXTENDED,Pe.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,Pe.STATUSES.WEB_SERVER_UNKNOWN_ERROR,Pe.STATUSES.WEB_SERVER_IS_DOWN,Pe.STATUSES.CONNECTION_TIMEOUT,Pe.STATUSES.ORIGIN_IS_UNREACHABLE,Pe.STATUSES.TIMEOUT_OCCURED,Pe.STATUSES.SSL_HANDSHAKE_FAILED,Pe.STATUSES.INVALID_SSL_CERTIFICATE,Pe.STATUSES.RAILGUN_ERROR,Pe.STATUSES.SITE_IS_OVERLOADED,Pe.STATUSES.SITE_IS_FROZEN,Pe.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,Pe.STATUSES.NETWORK_READ_TIMEOUT,Pe.STATUSES.NETWORK_CONNECT_TIMEOUT];Pe.ALPHA=[];for(let t=65;t<=90;t++)Pe.ALPHA.push(String.fromCharCode(t)),Pe.ALPHA.push(String.fromCharCode(t+32));Pe.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Pe.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Pe.NUM=["0","1","2","3","4","5","6","7","8","9"];Pe.ALPHANUM=Pe.ALPHA.concat(Pe.NUM);Pe.MARK=["-","_",".","!","~","*","'","(",")"];Pe.USERINFO_CHARS=Pe.ALPHANUM.concat(Pe.MARK).concat(["%",";",":","&","=","+","$",","]);Pe.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Pe.ALPHANUM);Pe.HEX=Pe.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Pe.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Pe.ALPHANUM);Pe.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Pe.HEADER_CHARS.push(t);Pe.CONNECTION_TOKEN_CHARS=Pe.HEADER_CHARS.filter(t=>t!==44);Pe.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&Pe.QUOTED_STRING.push(t);Pe.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)Pe.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)Pe.HTAB_SP_VCHAR_OBS_TEXT.push(t);Pe.MAJOR=Pe.NUM_MAP;Pe.MINOR=Pe.MAJOR;Pe.SPECIAL_HEADERS={connection:Pe.HEADER_STATE.CONNECTION,"content-length":Pe.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":Pe.HEADER_STATE.CONNECTION,"transfer-encoding":Pe.HEADER_STATE.TRANSFER_ENCODING,upgrade:Pe.HEADER_STATE.UPGRADE};Pe.default={ERROR:Pe.ERROR,TYPE:Pe.TYPE,FLAGS:Pe.FLAGS,LENIENT_FLAGS:Pe.LENIENT_FLAGS,METHODS:Pe.METHODS,STATUSES:Pe.STATUSES,FINISH:Pe.FINISH,HEADER_STATE:Pe.HEADER_STATE,ALPHA:Pe.ALPHA,NUM_MAP:Pe.NUM_MAP,HEX_MAP:Pe.HEX_MAP,NUM:Pe.NUM,ALPHANUM:Pe.ALPHANUM,MARK:Pe.MARK,USERINFO_CHARS:Pe.USERINFO_CHARS,URL_CHAR:Pe.URL_CHAR,HEX:Pe.HEX,TOKEN:Pe.TOKEN,HEADER_CHARS:Pe.HEADER_CHARS,CONNECTION_TOKEN_CHARS:Pe.CONNECTION_TOKEN_CHARS,QUOTED_STRING:Pe.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:Pe.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:Pe.MAJOR,MINOR:Pe.MINOR,SPECIAL_HEADERS:Pe.SPECIAL_HEADERS,METHODS_HTTP:Pe.METHODS_HTTP,METHODS_ICE:Pe.METHODS_ICE,METHODS_RTSP:Pe.METHODS_RTSP,METHOD_MAP:Pe.METHOD_MAP,H_METHOD_MAP:Pe.H_METHOD_MAP,STATUSES_HTTP:Pe.STATUSES_HTTP}});var drr=I((aef,Z3n)=>{"use strict";p();var{Buffer:l1s}=require("node:buffer"),u1s="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",urr;Object.defineProperty(Z3n,"exports",{get:a(()=>urr||(urr=l1s.from(u1s,"base64")),"get")})});var eFn=I((uef,X3n)=>{"use strict";p();var{Buffer:d1s}=require("node:buffer"),f1s="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",frr;Object.defineProperty(X3n,"exports",{get:a(()=>frr||(frr=d1s.from(f1s,"base64")),"get")})});var ZRe=I((pef,cFn)=>{"use strict";p();var tFn=["GET","HEAD","POST"],p1s=new Set(tFn),h1s=[101,204,205,304],rFn=[301,302,303,307,308],m1s=new Set(rFn),nFn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],g1s=new Set(nFn),iFn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],A1s=["",...iFn],y1s=new Set(iFn),E1s=["follow","manual","error"],oFn=["GET","HEAD","OPTIONS","TRACE"],_1s=new Set(oFn),C1s=["navigate","same-origin","no-cors","cors"],v1s=["omit","same-origin","include"],b1s=["default","no-store","reload","no-cache","force-cache","only-if-cached"],S1s=["content-encoding","content-language","content-location","content-type","content-length"],T1s=["half"],sFn=["CONNECT","TRACE","TRACK"],I1s=new Set(sFn),aFn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],x1s=new Set(aFn);cFn.exports={subresource:aFn,forbiddenMethods:sFn,requestBodyHeader:S1s,referrerPolicy:A1s,requestRedirect:E1s,requestMode:C1s,requestCredentials:v1s,requestCache:b1s,redirectStatus:rFn,corsSafeListedMethods:tFn,nullBodyStatus:h1s,safeMethods:oFn,badPorts:nFn,requestDuplex:T1s,subresourceSet:x1s,badPortsSet:g1s,redirectStatusSet:m1s,corsSafeListedMethodsSet:p1s,safeMethodsSet:_1s,forbiddenMethodsSet:I1s,referrerPolicyTokens:y1s}});var hrr=I((mef,lFn)=>{"use strict";p();var prr=Symbol.for("undici.globalOrigin.1");function w1s(){return globalThis[prr]}a(w1s,"getGlobalOrigin");function R1s(t){if(t===void 0){Object.defineProperty(globalThis,prr,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,prr,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(R1s,"setGlobalOrigin");lFn.exports={getGlobalOrigin:w1s,setGlobalOrigin:R1s}});var fit=I((yef,uFn)=>{"use strict";p();var k1s=new TextDecoder;function P1s(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),k1s.decode(t))}a(P1s,"utf8DecodeBytes");uFn.exports={utf8DecodeBytes:P1s}});var fF=I((Cef,hFn)=>{"use strict";p();var dFn=require("node:assert"),{utf8DecodeBytes:D1s}=fit();function N1s(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(L1s,"isomorphicDecode");var F1s=/[^\x00-\xFF]/;function U1s(t){return dFn(!F1s.test(t)),t}a(U1s,"isomorphicEncode");function Q1s(t){return JSON.parse(D1s(t))}a(Q1s,"parseJSONFromBytes");function q1s(t,e=!0,r=!0){return pFn(t,e,r,fFn)}a(q1s,"removeASCIIWhitespace");function pFn(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(pFn,"removeChars");function j1s(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return dFn(typeof e=="string"),e}a(j1s,"serializeJavascriptValueToJSONString");hFn.exports={collectASequenceOfCodePoints:N1s,collectASequenceOfCodePointsFast:M1s,forgivingBase64:B1s,isASCIIWhitespace:fFn,isomorphicDecode:L1s,isomorphicEncode:U1s,parseJSONFromBytes:Q1s,removeASCIIWhitespace:q1s,removeChars:pFn,serializeJavascriptValueToJSONString:j1s}});var pw=I((Sef,_Fn)=>{"use strict";p();var hit=require("node:assert"),{forgivingBase64:H1s,collectASequenceOfCodePoints:mrr,collectASequenceOfCodePointsFast:XRe,isomorphicDecode:G1s,removeASCIIWhitespace:$1s,removeChars:V1s}=fF(),W1s=new TextEncoder,eke=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,z1s=/[\u000A\u000D\u0009\u0020]/u,Y1s=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function K1s(t){hit(t.protocol==="data:");let e=AFn(t,!0);e=e.slice(5);let r={position:0},n=XRe(",",e,r),o=n.length;if(n=$1s(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=yFn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=G1s(c);if(c=H1s(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=grr(n);return l==="failure"&&(l=grr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(K1s,"dataURLProcessor");function AFn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(AFn,"URLSerializer");function yFn(t){let e=W1s.encode(t);return J1s(e)}a(yFn,"stringPercentDecode");function mFn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(mFn,"isHexCharByte");function gFn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(gFn,"hexByteToNumber");function J1s(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=XRe(";",t,e);if(n=pit(n,!1,!0),n.length===0||!eke.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionz1s.test(d),t,e);let l=mrr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=EFn(t,e,!0),XRe(";",t,e);else if(u=XRe(";",t,e),u=pit(u,!1,!0),u.length===0)continue;l.length!==0&&eke.test(l)&&(u.length===0||Y1s.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(grr,"parseMIMEType");function EFn(t,e,r=!1){let n=e.position,o="";for(hit(t[e.position]==='"'),e.position++;o+=mrr(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{hit(s==='"');break}}return r?o:t.slice(n,e.position)}a(EFn,"collectAnHTTPQuotedString");function Z1s(t){hit(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",eke.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(Z1s,"serializeAMimeType");function X1s(t){return t===13||t===10||t===9||t===32}a(X1s,"isHTTPWhiteSpace");function pit(t,e=!0,r=!0){return V1s(t,e,r,X1s)}a(pit,"removeHTTPWhitespace");function eSs(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(eSs,"minimizeSupportedMimeType");_Fn.exports={dataURLProcessor:K1s,URLSerializer:AFn,stringPercentDecode:yFn,parseMIMEType:grr,collectAnHTTPQuotedString:EFn,serializeAMimeType:Z1s,removeHTTPWhitespace:pit,minimizeSupportedMimeType:eSs,HTTP_TOKEN_CODEPOINTS:eke}});var pF=I((xef,yrr)=>{"use strict";p();var CFn={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function tSs(t){try{return CFn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(tSs,"detectRuntimeFeatureByNodeModule");function rSs(t,e){return typeof CFn[t]()[e]<"u"}a(rSs,"detectRuntimeFeatureByExportedProperty");var vFn=["markAsUncloneable","zstd"],nSs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},bFn=["crypto","sqlite"],iSs=[...bFn,...vFn];function oSs(t){if(bFn.includes(t))return tSs(`node:${t}`);if(vFn.includes(t)){let[e,r]=nSs[t];return rSs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(oSs,"detectRuntimeFeature");var Arr=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(iSs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=oSs(e);return this.#e.set(e,r),r}},SFn=new Arr;yrr.exports.runtimeFeatures=SFn;yrr.exports.default=SFn});var xA=I((kef,IFn)=>{"use strict";p();var sSs=require("node:assert"),{types:np,inspect:aSs}=require("node:util"),{runtimeFeatures:cSs}=pF(),Err=1,_rr=2,mit=3,git=4,Crr=5,Ait=6,vrr=7,nT=8,TFn=Function.call.bind(Function.prototype[Symbol.hasInstance]),rt={converters:{},util:{},errors:{},is:{}};rt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};rt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return rt.errors.exception({header:t.prefix,message:r})};rt.errors.invalidArgument=function(t){return rt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};rt.brandCheck=function(t,e){if(!TFn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};rt.brandCheckMultiple=function(t){let e=t.map(r=>rt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};rt.argumentLengthCheck=function({length:t},e,r){if(tTFn(t,e)};rt.util.Type=function(t){switch(typeof t){case"undefined":return Err;case"boolean":return _rr;case"string":return mit;case"symbol":return git;case"number":return Crr;case"bigint":return Ait;case"function":case"object":return t===null?vrr:nT}};rt.util.Types={UNDEFINED:Err,BOOLEAN:_rr,STRING:mit,SYMBOL:git,NUMBER:Crr,BIGINT:Ait,NULL:vrr,OBJECT:nT};rt.util.TypeValueToString=function(t){switch(rt.util.Type(t)){case Err:return"Undefined";case _rr:return"Boolean";case mit:return"String";case git:return"Symbol";case Crr:return"Number";case Ait:return"BigInt";case vrr:return"Null";case nT:return"Object"}};rt.util.markAsUncloneable=cSs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};rt.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),rt.util.HasFlag(n,rt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw rt.errors.exception({header:"Integer conversion",message:`Could not convert ${rt.util.Stringify(t)} to an integer.`});if(c=rt.util.IntegerPart(c),co)throw rt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&&rt.util.HasFlag(n,rt.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=rt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};rt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};rt.util.Stringify=function(t){switch(rt.util.Type(t)){case git:return`Symbol(${t.description})`;case nT:return aSs(t);case mit:return`"${t}"`;case Ait:return`${t}n`;default:return`${t}`}};rt.util.IsResizableArrayBuffer=function(t){if(np.isArrayBuffer(t))return t.resizable;if(np.isSharedArrayBuffer(t))return t.growable;throw rt.errors.exception({header:"IsResizableArrayBuffer",message:`"${rt.util.Stringify(t)}" is not an array buffer.`})};rt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};rt.sequenceConverter=function(t){return(e,r,n,o)=>{if(rt.util.Type(e)!==nT)throw rt.errors.exception({header:r,message:`${n} (${rt.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw rt.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};rt.recordConverter=function(t,e){return(r,n,o)=>{if(rt.util.Type(r)!==nT)throw rt.errors.exception({header:n,message:`${o} ("${rt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!np.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=rt.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};rt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw rt.errors.exception({header:n,message:`Expected ${o} ("${rt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};rt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&&rt.util.Type(e)!==nT)throw rt.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw rt.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw rt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};rt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};rt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};rt.is.ReadableStream=rt.util.MakeTypeAssertion(ReadableStream);rt.is.Blob=rt.util.MakeTypeAssertion(Blob);rt.is.URLSearchParams=rt.util.MakeTypeAssertion(URLSearchParams);rt.is.File=rt.util.MakeTypeAssertion(File);rt.is.URL=rt.util.MakeTypeAssertion(URL);rt.is.AbortSignal=rt.util.MakeTypeAssertion(AbortSignal);rt.is.MessagePort=rt.util.MakeTypeAssertion(MessagePort);rt.is.BufferSource=function(t){return np.isArrayBuffer(t)||ArrayBuffer.isView(t)&&np.isArrayBuffer(t.buffer)};rt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(np.isTypedArray(e)||np.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(sSs(np.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};rt.converters.DOMString=function(t,e,r,n){if(t===null&&rt.util.HasFlag(n,rt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw rt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};rt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw rt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};rt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};rt.converters.boolean=function(t){return!!t};rt.converters.any=function(t){return t};rt.converters["long long"]=function(t,e,r){return rt.util.ConvertToInt(t,64,"signed",0,e,r)};rt.converters["unsigned long long"]=function(t,e,r){return rt.util.ConvertToInt(t,64,"unsigned",0,e,r)};rt.converters["unsigned long"]=function(t,e,r){return rt.util.ConvertToInt(t,32,"unsigned",0,e,r)};rt.converters["unsigned short"]=function(t,e,r,n){return rt.util.ConvertToInt(t,16,"unsigned",n,e,r)};rt.converters.ArrayBuffer=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isArrayBuffer(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t))throw rt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};rt.converters.SharedArrayBuffer=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isSharedArrayBuffer(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t))throw rt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};rt.converters.TypedArray=function(t,e,r,n,o){if(rt.util.Type(t)!==nT||!np.isTypedArray(t)||t.constructor.name!==e.name)throw rt.errors.conversionFailed({prefix:r,argument:`${n} ("${rt.util.Stringify(t)}")`,types:[e.name]});if(!rt.util.HasFlag(o,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(o,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};rt.converters.DataView=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isDataView(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["DataView"]});if(!rt.util.HasFlag(n,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};rt.converters.ArrayBufferView=function(t,e,r,n){if(rt.util.Type(t)!==nT||!np.isArrayBufferView(t))throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!rt.util.HasFlag(n,rt.attributes.AllowShared)&&np.isSharedArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!rt.util.HasFlag(n,rt.attributes.AllowResizable)&&rt.util.IsResizableArrayBuffer(t.buffer))throw rt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};rt.converters.BufferSource=function(t,e,r,n){if(np.isArrayBuffer(t))return rt.converters.ArrayBuffer(t,e,r,n);if(np.isArrayBufferView(t))return n&=~rt.attributes.AllowShared,rt.converters.ArrayBufferView(t,e,r,n);throw np.isSharedArrayBuffer(t)?rt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};rt.converters.AllowSharedBufferSource=function(t,e,r,n){if(np.isArrayBuffer(t))return rt.converters.ArrayBuffer(t,e,r,n);if(np.isSharedArrayBuffer(t))return rt.converters.SharedArrayBuffer(t,e,r,n);if(np.isArrayBufferView(t))return n|=rt.attributes.AllowShared,rt.converters.ArrayBufferView(t,e,r,n);throw rt.errors.conversionFailed({prefix:e,argument:`${r} ("${rt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};rt.converters["sequence"]=rt.sequenceConverter(rt.converters.ByteString);rt.converters["sequence>"]=rt.sequenceConverter(rt.converters["sequence"]);rt.converters["record"]=rt.recordConverter(rt.converters.ByteString,rt.converters.ByteString);rt.converters.Blob=rt.interfaceConverter(rt.is.Blob,"Blob");rt.converters.AbortSignal=rt.interfaceConverter(rt.is.AbortSignal,"AbortSignal");rt.converters.EventHandlerNonNull=function(t){return rt.util.Type(t)!==nT?null:typeof t=="function"?t:()=>{}};rt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};IFn.exports={webidl:rt}});var iT=I((Def,QFn)=>{"use strict";p();var{Transform:lSs}=require("node:stream"),xFn=require("node:zlib"),{redirectStatusSet:uSs,referrerPolicyTokens:dSs,badPortsSet:fSs}=ZRe(),{getGlobalOrigin:wFn}=hrr(),{collectAnHTTPQuotedString:pSs,parseMIMEType:hSs}=pw(),{performance:mSs}=require("node:perf_hooks"),{ReadableStreamFrom:gSs,isValidHTTPToken:RFn,normalizedMethodRecordsBase:ASs}=Do(),rke=require("node:assert"),{isUint8Array:ySs}=require("node:util/types"),{webidl:uj}=xA(),{isomorphicEncode:brr,collectASequenceOfCodePoints:QJ,removeChars:ESs}=fF();function kFn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(kFn,"responseURL");function _Ss(t,e){if(!uSs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&DFn(r)&&(PFn(r)||(r=CSs(r)),r=new URL(r,kFn(t))),r&&!r.hash&&(r.hash=e),r}a(_Ss,"responseLocationURL");function PFn(t){for(let e=0;e126||r<32)return!1}return!0}a(PFn,"isValidEncodedURL");function CSs(t){return Buffer.from(t,"binary").toString("utf8")}a(CSs,"normalizeBinaryStringToUtf8");function jJ(t){return t.urlList[t.urlList.length-1]}a(jJ,"requestCurrentURL");function vSs(t){let e=jJ(t);return FFn(e)&&fSs.has(e.port)?"blocked":"allowed"}a(vSs,"requestBadPort");function bSs(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(bSs,"isErrorLike");function SSs(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(SSs,"isValidReasonPhrase");var TSs=RFn;function DFn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` -`)||t.includes("\r")||t.includes("\0"))===!1}a(DFn,"isValidHeaderValue");function ISs(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(dSs.has(o)){r=o;break}}return r}a(ISs,"parseReferrerPolicy");function xSs(t,e){let r=ISs(e);r!==""&&(t.referrerPolicy=r)}a(xSs,"setRequestReferrerPolicyOnRedirect");function wSs(){return"allowed"}a(wSs,"crossOriginResourcePolicyCheck");function RSs(){return"success"}a(RSs,"corsCheck");function kSs(){return"success"}a(kSs,"TAOCheck");function PSs(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(PSs,"appendFetchMetadata");function DSs(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&Trr(t.origin)&&!Trr(jJ(t))&&(e=null);break;case"same-origin":tke(t,jJ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(DSs,"appendRequestOriginHeader");function tfe(t,e){return t}a(tfe,"coarsenTime");function NSs(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Srr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=jJ(t);return qJ(n)&&!qJ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=jJ(t);return tke(n,s)?n:qJ(n)&&!qJ(s)?"no-referrer":o}case"same-origin":return tke(t,n)?n:"no-referrer";case"origin-when-cross-origin":return tke(t,n)?n:o;case"no-referrer-when-downgrade":{let s=jJ(t);return qJ(n)&&!qJ(s)?"no-referrer":n}}}a(LSs,"determineRequestsReferrer");function Srr(t,e=!1){return rke(uj.is.URL(t)),t=new URL(t),LFn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Srr,"stripURLForReferrer");var FSs=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),USs=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function MFn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),USs(t)):FSs(t)}a(MFn,"isOriginIPPotentiallyTrustworthy");function QSs(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||MFn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(QSs,"isOriginPotentiallyTrustworthy");function qJ(t){return uj.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:QSs(t.origin):!1}a(qJ,"isURLPotentiallyTrustworthy");function qSs(t){}a(qSs,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function tke(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(tke,"sameOrigin");function jSs(t){return t.controller.state==="aborted"}a(jSs,"isAborted");function HSs(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(HSs,"isCancelled");function GSs(t){return ASs[t.toLowerCase()]??t}a(GSs,"normalizeMethod");var $Ss=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function OFn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,$Ss),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(OFn,"createIterator");function VSs(t,e,r,n=0,o=1){let s=OFn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return uj.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return uj.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return uj.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(uj.brandCheck(this,e),uj.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(VSs,"iteratorMixin");function WSs(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();BFn(s,n,o)}catch(s){o(s)}}a(WSs,"fullyReadBody");function zSs(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(zSs,"readableStreamClose");async function BFn(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!ySs(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(BFn,"readAllBytes");function LFn(t){rke("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(LFn,"urlIsLocal");function Trr(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(Trr,"urlHasHttpsScheme");function FFn(t){rke("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(FFn,"urlIsHttpHttpsScheme");function YSs(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&QJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&QJ(u=>u===" "||u===" ",r,n);let o=QJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&QJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&QJ(u=>u===" "||u===" ",r,n);let c=QJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(YSs,"simpleRangeHeaderValue");function KSs(t,e,r){let n="bytes ";return n+=brr(`${t}`),n+="-",n+=brr(`${e}`),n+="/",n+=brr(`${r}`),n}a(KSs,"buildContentRange");var Irr=class extends lSs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?xFn.createInflate(this.#e):xFn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function JSs(t){return new Irr(t)}a(JSs,"createInflate");function ZSs(t){let e=null,r=null,n=null,o=UFn("content-type",t);if(o===null)return"failure";for(let s of o){let c=hSs(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(ZSs,"extractMimeType");function XSs(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(XSs,"gettingDecodingSplitting");function UFn(t,e){let r=e.get(t,!0);return r===null?null:XSs(r)}a(UFn,"getDecodeSplit");function eTs(t){return!1}a(eTs,"hasAuthenticationEntry");function tTs(t){return!!(t.username||t.password)}a(tTs,"includesCredentials");function rTs(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(rTs,"isTraversableNavigable");var xrr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return wFn()}get origin(){return this.baseUrl?.origin}policyContainer=NFn()},wrr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new xrr},nTs=new wrr;QFn.exports={isAborted:jSs,isCancelled:HSs,isValidEncodedURL:PFn,ReadableStreamFrom:gSs,tryUpgradeRequestToAPotentiallyTrustworthyURL:qSs,clampAndCoarsenConnectionTimingInfo:NSs,coarsenedSharedCurrentTime:MSs,determineRequestsReferrer:LSs,makePolicyContainer:NFn,clonePolicyContainer:BSs,appendFetchMetadata:PSs,appendRequestOriginHeader:DSs,TAOCheck:kSs,corsCheck:RSs,crossOriginResourcePolicyCheck:wSs,createOpaqueTimingInfo:OSs,setRequestReferrerPolicyOnRedirect:xSs,isValidHTTPToken:RFn,requestBadPort:vSs,requestCurrentURL:jJ,responseURL:kFn,responseLocationURL:_Ss,isURLPotentiallyTrustworthy:qJ,isValidReasonPhrase:SSs,sameOrigin:tke,normalizeMethod:GSs,iteratorMixin:VSs,createIterator:OFn,isValidHeaderName:TSs,isValidHeaderValue:DFn,isErrorLike:bSs,fullyReadBody:WSs,readableStreamClose:zSs,urlIsLocal:LFn,urlHasHttpsScheme:Trr,urlIsHttpHttpsScheme:FFn,readAllBytes:BFn,simpleRangeHeaderValue:YSs,buildContentRange:KSs,createInflate:JSs,extractMimeType:ZSs,getDecodeSplit:UFn,environmentSettingsObject:nTs,isOriginIPPotentiallyTrustworthy:MFn,hasAuthenticationEntry:eTs,includesCredentials:tTs,isTraversableNavigable:rTs}});var yit=I((Oef,jFn)=>{"use strict";p();var{iteratorMixin:iTs}=iT(),{kEnumerableProperty:rfe}=Do(),{webidl:xc}=xA(),qFn=require("node:util"),hF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(xc.util.markAsUncloneable(this),e!==void 0)throw xc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.append";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=Rrr(e,r,n);this.#e.push(s)}delete(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.delete"),e=xc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.get"),e=xc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=xc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return xc.brandCheck(this,t),xc.argumentLengthCheck(arguments,1,"FormData.has"),e=xc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){xc.brandCheck(this,t);let o="FormData.set";xc.argumentLengthCheck(arguments,2,o),e=xc.converters.USVString(e),arguments.length===3||xc.is.Blob(r)?(r=xc.converters.Blob(r,o,"value"),n!==void 0&&(n=xc.converters.USVString(n))):r=xc.converters.USVString(r);let s=Rrr(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[qFn.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=qFn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:oTs,setFormDataState:sTs}=hF;Reflect.deleteProperty(hF,"getFormDataState");Reflect.deleteProperty(hF,"setFormDataState");iTs("FormData",hF,oTs,"name","value");Object.defineProperties(hF.prototype,{append:rfe,delete:rfe,get:rfe,getAll:rfe,has:rfe,set:rfe,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Rrr(t,e,r){if(typeof e!="string"){if(xc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(Rrr,"makeEntry");xc.is.FormData=xc.util.MakeTypeAssertion(hF);jFn.exports={FormData:hF,makeEntry:Rrr,setFormDataState:sTs}});var $Fn=I((Fef,GFn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:aTs}=Do(),{HTTP_TOKEN_CODEPOINTS:cTs}=pw(),{makeEntry:lTs}=yit(),{webidl:krr}=xA(),Prr=require("node:assert"),{isomorphicDecode:HFn}=fF(),uTs=Buffer.from("--"),Drr=new TextDecoder,dTs=new TextDecoder("utf-8",{ignoreBOM:!0});function fTs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(pTs,"validateBoundary");function hTs(t,e){Prr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw eb("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw eb("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw eb("expected a value starting with -- and the boundary");if(ATs(t,uTs,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw eb("expected CRLF");s.position+=2;let l=gTs(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw eb("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw eb("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",fTs(f)||(f=""),g=new File([m],d,{type:f})):g=dTs.decode(Buffer.from(m)),Prr(krr.is.USVString(u)),Prr(typeof g=="string"&&krr.is.USVString(g)||krr.is.File(g)),o.push(lTs(u,g,d))}}a(hTs,"multipartFormDataParser");function mTs(t,e){t[e.position]===59&&e.position++,hw(c=>c===32||c===9,t,e);let r=hw(c=>Mrr(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,hw(c=>c===32||c===9,t,e);let s;if(o){let c=hw(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw eb("unknown encoding, expected utf-8''");s=decodeURIComponent(Drr.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=hw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw eb("Closing quote not found");e.position++,s=Drr.decode(c).replace(/%0A/ig,` -`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=hw(l=>Mrr(l)&&l!==59,t,e);s=Drr.decode(c)}return{name:n,value:s,extended:o}}a(mTs,"parseContentDispositionAttribute");function gTs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw eb("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=hw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Nrr(c,!0,!0,l=>l===9||l===32),!cTs.test(c.toString()))throw eb("header name does not match the field-name token production");if(t[e.position]!==58)throw eb("expected :");switch(e.position++,hw(l=>l===32||l===9,t,e),aTs(c)){case"content-disposition":{r=n=null;let l=!1;if(hw(d=>Mrr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw eb("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Nrr(l,!1,!0,u=>u===9||u===32),o=HFn(l);break}case"content-transfer-encoding":{let l=hw(u=>u!==10&&u!==13,t,e);l=Nrr(l,!1,!0,u=>u===9||u===32),s=HFn(l);break}default:hw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw eb("expected CRLF");e.position+=2}}a(gTs,"parseMultipartFormDataHeaders");function hw(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(Nrr,"removeChars");function ATs(t,e,r){if(t.length{"use strict";p();function _Ts(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(_Ts,"createDeferredPromise");VFn.exports={createDeferredPromise:_Ts}});var ife=I((Gef,JFn)=>{"use strict";p();var Lrr=Do(),{ReadableStreamFrom:CTs,readableStreamClose:vTs,fullyReadBody:bTs,extractMimeType:STs}=iT(),{FormData:WFn,setFormDataState:TTs}=yit(),{webidl:YP}=xA(),Orr=require("node:assert"),{isErrored:Brr,isDisturbed:ITs}=require("node:stream"),{isUint8Array:xTs}=require("node:util/types"),{serializeAMimeType:wTs}=pw(),{multipartFormDataParser:RTs}=$Fn(),{createDeferredPromise:kTs}=nke(),{parseJSONFromBytes:PTs}=fF(),{utf8DecodeBytes:DTs}=fit(),{runtimeFeatures:NTs}=pF(),MTs=NTs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),Eit=new TextEncoder;function OTs(){}a(OTs,"noop");var BTs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!ITs(e)&&!Brr(e)&&e.cancel("Response object has been garbage collected").catch(OTs)});function YFn(t,e=!1){let r=null,n=null;YP.is.ReadableStream(t)?r=t:YP.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),Orr(YP.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(YP.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(YP.is.BufferSource(t))s=YP.util.getCopyOfBytesHeldByBufferSource(t);else if(YP.is.FormData(t)){let d=`----formdata-undici-0${`${MTs(1e11)}`.padStart(11,"0")}`,f=`--${d}\r +`,s};qnt.publicKeyToOpenSSH=function(t,e){var r="ssh-rsa";e=e||"";var n=e0.util.createBuffer();return Vde(n,r),GO(n,t.e),GO(n,t.n),r+" "+e0.util.encode64(n.bytes())+" "+e};qnt.privateKeyToOpenSSH=function(t,e){return e?e0.pki.encryptRsaPrivateKey(t,e,{legacy:!0,algorithm:"aes128"}):e0.pki.privateKeyToPem(t)};qnt.getPublicKeyFingerprint=function(t,e){e=e||{};var r=e.md||e0.md.md5.create(),n="ssh-rsa",o=e0.util.createBuffer();Vde(o,n),GO(o,t.e),GO(o,t.n),r.start(),r.update(o.getBytes());var s=r.digest();if(e.encoding==="hex"){var c=s.toHex();return e.delimiter?c.match(/.{2}/g).join(e.delimiter):c}else{if(e.encoding==="binary")return s.getBytes();if(e.encoding)throw new Error('Unknown encoding "'+e.encoding+'".')}return s};function GO(t,e){var r=e.toString(16);r[0]>="8"&&(r="00"+r);var n=e0.util.hexToBytes(r);t.putInt32(n.length),t.putBytes(n)}a(GO,"_addBigIntegerToBuffer");function Vde(t,e){t.putInt32(e.length),t.putString(e)}a(Vde,"_addStringToBuffer");function Qnt(){for(var t=e0.md.sha1.create(),e=arguments.length,r=0;r{p();pLn.exports=us();Gq();NBn();$k();dnt();vRe();JBn();Mde();tLn();oLn();aLn();Ner();Cnt();EJ();xer();Ber();uLn();Fer();Rer();Eer();Rnt();ow();Cer();fLn();Ger();ic()});var ALn=I(xJ=>{"use strict";p();Object.defineProperty(xJ,"__esModule",{value:!0});xJ.convert=xJ.Format=void 0;var NRe=hLn(),Xq;(function(t){t.der="der",t.pem="pem",t.txt="txt",t.asn1="asn1",t.x509="x509",t.fingerprint="fingerprint"})(Xq=xJ.Format||(xJ.Format={}));function mLn(t){var e=NRe.pki.pemToDer(t),r=NRe.asn1,n=r.fromDer(e.data.toString("binary")).value[0].value,o=n[0],s=o.tagClass===r.Class.CONTEXT_SPECIFIC&&o.type===0&&o.constructed,c=n.slice(s);return{serial:c[0],issuer:c[2],valid:c[3],subject:c[4]}}a(mLn,"myASN");function bvs(t){var e=mLn(t),r=e.subject.value.map(function(o){return o.value[0].value[1].value}).join("/"),n=e.valid.value.map(function(o){return o.value}).join(" - ");return["Subject ".concat(r),"Valid ".concat(n),String(t)].join(` +`)}a(bvs,"txtFormat");function gLn(t,e){switch(e){case Xq.der:return NRe.pki.pemToDer(t);case Xq.pem:return t;case Xq.txt:return bvs(t);case Xq.asn1:return mLn(t);case Xq.fingerprint:var r=NRe.md.sha1.create(),n=gLn(t,Xq.der);return r.update(n.getBytes()),r.digest().toHex();case Xq.x509:return NRe.pki.certificateFromPem(t);default:throw new Error("unknown format ".concat(e))}}a(gLn,"convert");xJ.convert=gLn});var bLn=I(WC=>{"use strict";p();var ej=WC&&WC.__assign||function(){return ej=Object.assign||function(t){for(var e,r=1,n=arguments.length;r"u"&&(s.ca=e),r.call(this,s)},"newAgent");return n.prototype=r.prototype,n})(atr.Agent),(0,ELn.setGlobalDispatcher)(new ELn.Agent({connect:{ca:e}}))}},"addToGlobalAgent");WC.addToGlobalAgent=Tvs});var SLn=I((FKd,ctr)=>{p();function Ivs(){let{X509Certificate:t}=require("crypto"),{join:e}=require("path");var r=typeof __webpack_require__=="function"?__non_webpack_require__:require;let n=process.arch==="arm64"?"crypt32-arm64.node":"crypt32.node",o=r(e(__dirname,n)),s=[],c=new o.Crypt32;try{let l;for(;l=c.next();){let u=new t(l);s.push(u.toString())}}finally{c.done()}return Array.from(new Set(s))}a(Ivs,"all");process.platform!=="win32"?ctr.exports.all=()=>[]:ctr.exports.all=Ivs});var tl=I(($Kd,PLn)=>{"use strict";p();PLn.exports={kClose:Symbol("close"),kDestroy:Symbol("destroy"),kDispatch:Symbol("dispatch"),kUrl:Symbol("url"),kWriting:Symbol("writing"),kResuming:Symbol("resuming"),kQueue:Symbol("queue"),kConnect:Symbol("connect"),kConnecting:Symbol("connecting"),kKeepAliveDefaultTimeout:Symbol("default keep alive timeout"),kKeepAliveMaxTimeout:Symbol("max keep alive timeout"),kKeepAliveTimeoutThreshold:Symbol("keep alive timeout threshold"),kKeepAliveTimeoutValue:Symbol("keep alive timeout"),kKeepAlive:Symbol("keep alive"),kHeadersTimeout:Symbol("headers timeout"),kBodyTimeout:Symbol("body timeout"),kServerName:Symbol("server name"),kLocalAddress:Symbol("local address"),kHost:Symbol("host"),kNoRef:Symbol("no ref"),kBodyUsed:Symbol("used"),kBody:Symbol("abstracted request body"),kRunning:Symbol("running"),kBlocking:Symbol("blocking"),kPending:Symbol("pending"),kSize:Symbol("size"),kBusy:Symbol("busy"),kQueued:Symbol("queued"),kFree:Symbol("free"),kConnected:Symbol("connected"),kClosed:Symbol("closed"),kNeedDrain:Symbol("need drain"),kReset:Symbol("reset"),kDestroyed:Symbol.for("nodejs.stream.destroyed"),kResume:Symbol("resume"),kOnError:Symbol("on error"),kMaxHeadersSize:Symbol("max headers size"),kRunningIdx:Symbol("running index"),kPendingIdx:Symbol("pending index"),kError:Symbol("error"),kClients:Symbol("clients"),kClient:Symbol("client"),kParser:Symbol("parser"),kOnDestroyed:Symbol("destroy callbacks"),kPipelining:Symbol("pipelining"),kSocket:Symbol("socket"),kHostHeader:Symbol("host header"),kConnector:Symbol("connector"),kStrictContentLength:Symbol("strict content length"),kMaxRedirections:Symbol("maxRedirections"),kMaxRequests:Symbol("maxRequestsPerClient"),kProxy:Symbol("proxy agent options"),kCounter:Symbol("socket request counter"),kMaxResponseSize:Symbol("max response size"),kHTTP2Session:Symbol("http2Session"),kHTTP2SessionState:Symbol("http2Session state"),kRetryHandlerDefaultRetry:Symbol("retry agent default retry"),kConstruct:Symbol("constructable"),kListeners:Symbol("listeners"),kHTTPContext:Symbol("http context"),kMaxConcurrentStreams:Symbol("max concurrent streams"),kHTTP2InitialWindowSize:Symbol("http2 initial window size"),kHTTP2ConnectionWindowSize:Symbol("http2 connection window size"),kEnableConnectProtocol:Symbol("http2session connect protocol"),kRemoteSettings:Symbol("http2session remote settings"),kHTTP2Stream:Symbol("http2session client stream"),kPingInterval:Symbol("ping interval"),kNoProxyAgent:Symbol("no proxy agent"),kHttpProxyAgent:Symbol("http proxy agent"),kHttpsProxyAgent:Symbol("https proxy agent"),kSocks5ProxyAgent:Symbol("socks5 proxy agent")}});var btr=I((WKd,MLn)=>{"use strict";p();var zde=0,Atr=1e3,ytr=(Atr>>1)-1,tj,Etr=Symbol("kFastTimer"),oF=[],_tr=-2,vtr=-1,DLn=0,kLn=1;function Ctr(){zde+=ytr;let t=0,e=oF.length;for(;t=r._idleStart+r._idleTimeout&&(r._state=vtr,r._idleStart=-1,r._onTimeout(r._timerArg)),r._state===vtr?(r._state=_tr,--e!==0&&(oF[t]=oF[e])):++t}oF.length=e,oF.length!==0&&NLn()}a(Ctr,"onTick");function NLn(){tj?.refresh?tj.refresh():(clearTimeout(tj),tj=setTimeout(Ctr,ytr),tj?.unref())}a(NLn,"refreshTimeout");var Wnt=class{static{a(this,"FastTimer")}[Etr]=!0;_state=_tr;_idleTimeout=-1;_idleStart=-1;_onTimeout;_timerArg;constructor(e,r,n){this._onTimeout=e,this._idleTimeout=r,this._timerArg=n,this.refresh()}refresh(){this._state===_tr&&oF.push(this),(!tj||oF.length===1)&&NLn(),this._state=DLn}clear(){this._state=vtr,this._idleStart=-1}};MLn.exports={setTimeout(t,e,r){return e<=Atr?setTimeout(t,e,r):new Wnt(t,e,r)},clearTimeout(t){t[Etr]?t.clear():clearTimeout(t)},setFastTimeout(t,e,r){return new Wnt(t,e,r)},clearFastTimeout(t){t.clear()},now(){return zde},tick(t=0){zde+=t-Atr+1,Ctr(),Ctr()},reset(){zde=0,oF.length=0,clearTimeout(tj),tj=null},kFastTimer:Etr}});var ao=I((KKd,o3n)=>{"use strict";p();var OLn=Symbol.for("undici.error.UND_ERR"),rd=class extends Error{static{a(this,"UndiciError")}constructor(e,r){super(e,r),this.name="UndiciError",this.code="UND_ERR"}static[Symbol.hasInstance](e){return e&&e[OLn]===!0}get[OLn](){return!0}},BLn=Symbol.for("undici.error.UND_ERR_CONNECT_TIMEOUT"),Str=class extends rd{static{a(this,"ConnectTimeoutError")}constructor(e){super(e),this.name="ConnectTimeoutError",this.message=e||"Connect Timeout Error",this.code="UND_ERR_CONNECT_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[BLn]===!0}get[BLn](){return!0}},LLn=Symbol.for("undici.error.UND_ERR_HEADERS_TIMEOUT"),Ttr=class extends rd{static{a(this,"HeadersTimeoutError")}constructor(e){super(e),this.name="HeadersTimeoutError",this.message=e||"Headers Timeout Error",this.code="UND_ERR_HEADERS_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[LLn]===!0}get[LLn](){return!0}},FLn=Symbol.for("undici.error.UND_ERR_HEADERS_OVERFLOW"),Itr=class extends rd{static{a(this,"HeadersOverflowError")}constructor(e){super(e),this.name="HeadersOverflowError",this.message=e||"Headers Overflow Error",this.code="UND_ERR_HEADERS_OVERFLOW"}static[Symbol.hasInstance](e){return e&&e[FLn]===!0}get[FLn](){return!0}},ULn=Symbol.for("undici.error.UND_ERR_BODY_TIMEOUT"),xtr=class extends rd{static{a(this,"BodyTimeoutError")}constructor(e){super(e),this.name="BodyTimeoutError",this.message=e||"Body Timeout Error",this.code="UND_ERR_BODY_TIMEOUT"}static[Symbol.hasInstance](e){return e&&e[ULn]===!0}get[ULn](){return!0}},QLn=Symbol.for("undici.error.UND_ERR_INVALID_ARG"),wtr=class extends rd{static{a(this,"InvalidArgumentError")}constructor(e){super(e),this.name="InvalidArgumentError",this.message=e||"Invalid Argument Error",this.code="UND_ERR_INVALID_ARG"}static[Symbol.hasInstance](e){return e&&e[QLn]===!0}get[QLn](){return!0}},qLn=Symbol.for("undici.error.UND_ERR_INVALID_RETURN_VALUE"),Rtr=class extends rd{static{a(this,"InvalidReturnValueError")}constructor(e){super(e),this.name="InvalidReturnValueError",this.message=e||"Invalid Return Value Error",this.code="UND_ERR_INVALID_RETURN_VALUE"}static[Symbol.hasInstance](e){return e&&e[qLn]===!0}get[qLn](){return!0}},jLn=Symbol.for("undici.error.UND_ERR_ABORT"),znt=class extends rd{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError",this.message=e||"The operation was aborted",this.code="UND_ERR_ABORT"}static[Symbol.hasInstance](e){return e&&e[jLn]===!0}get[jLn](){return!0}},HLn=Symbol.for("undici.error.UND_ERR_ABORTED"),Ptr=class extends znt{static{a(this,"RequestAbortedError")}constructor(e){super(e),this.name="AbortError",this.message=e||"Request aborted",this.code="UND_ERR_ABORTED"}static[Symbol.hasInstance](e){return e&&e[HLn]===!0}get[HLn](){return!0}},GLn=Symbol.for("undici.error.UND_ERR_INFO"),ktr=class extends rd{static{a(this,"InformationalError")}constructor(e){super(e),this.name="InformationalError",this.message=e||"Request information",this.code="UND_ERR_INFO"}static[Symbol.hasInstance](e){return e&&e[GLn]===!0}get[GLn](){return!0}},$Ln=Symbol.for("undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"),Dtr=class extends rd{static{a(this,"RequestContentLengthMismatchError")}constructor(e){super(e),this.name="RequestContentLengthMismatchError",this.message=e||"Request body length does not match content-length header",this.code="UND_ERR_REQ_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[$Ln]===!0}get[$Ln](){return!0}},VLn=Symbol.for("undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH"),Ntr=class extends rd{static{a(this,"ResponseContentLengthMismatchError")}constructor(e){super(e),this.name="ResponseContentLengthMismatchError",this.message=e||"Response body length does not match content-length header",this.code="UND_ERR_RES_CONTENT_LENGTH_MISMATCH"}static[Symbol.hasInstance](e){return e&&e[VLn]===!0}get[VLn](){return!0}},WLn=Symbol.for("undici.error.UND_ERR_DESTROYED"),Mtr=class extends rd{static{a(this,"ClientDestroyedError")}constructor(e){super(e),this.name="ClientDestroyedError",this.message=e||"The client is destroyed",this.code="UND_ERR_DESTROYED"}static[Symbol.hasInstance](e){return e&&e[WLn]===!0}get[WLn](){return!0}},zLn=Symbol.for("undici.error.UND_ERR_CLOSED"),Otr=class extends rd{static{a(this,"ClientClosedError")}constructor(e){super(e),this.name="ClientClosedError",this.message=e||"The client is closed",this.code="UND_ERR_CLOSED"}static[Symbol.hasInstance](e){return e&&e[zLn]===!0}get[zLn](){return!0}},YLn=Symbol.for("undici.error.UND_ERR_SOCKET"),Btr=class extends rd{static{a(this,"SocketError")}constructor(e,r){super(e),this.name="SocketError",this.message=e||"Socket error",this.code="UND_ERR_SOCKET",this.socket=r}static[Symbol.hasInstance](e){return e&&e[YLn]===!0}get[YLn](){return!0}},KLn=Symbol.for("undici.error.UND_ERR_NOT_SUPPORTED"),Ltr=class extends rd{static{a(this,"NotSupportedError")}constructor(e){super(e),this.name="NotSupportedError",this.message=e||"Not supported error",this.code="UND_ERR_NOT_SUPPORTED"}static[Symbol.hasInstance](e){return e&&e[KLn]===!0}get[KLn](){return!0}},JLn=Symbol.for("undici.error.UND_ERR_BPL_MISSING_UPSTREAM"),Ftr=class extends rd{static{a(this,"BalancedPoolMissingUpstreamError")}constructor(e){super(e),this.name="MissingUpstreamError",this.message=e||"No upstream has been added to the BalancedPool",this.code="UND_ERR_BPL_MISSING_UPSTREAM"}static[Symbol.hasInstance](e){return e&&e[JLn]===!0}get[JLn](){return!0}},ZLn=Symbol.for("undici.error.UND_ERR_HTTP_PARSER"),Utr=class extends Error{static{a(this,"HTTPParserError")}constructor(e,r,n){super(e),this.name="HTTPParserError",this.code=r?`HPE_${r}`:void 0,this.data=n?n.toString():void 0}static[Symbol.hasInstance](e){return e&&e[ZLn]===!0}get[ZLn](){return!0}},XLn=Symbol.for("undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE"),Qtr=class extends rd{static{a(this,"ResponseExceededMaxSizeError")}constructor(e){super(e),this.name="ResponseExceededMaxSizeError",this.message=e||"Response content exceeded max size",this.code="UND_ERR_RES_EXCEEDED_MAX_SIZE"}static[Symbol.hasInstance](e){return e&&e[XLn]===!0}get[XLn](){return!0}},e3n=Symbol.for("undici.error.UND_ERR_REQ_RETRY"),qtr=class extends rd{static{a(this,"RequestRetryError")}constructor(e,r,{headers:n,data:o}){super(e),this.name="RequestRetryError",this.message=e||"Request retry error",this.code="UND_ERR_REQ_RETRY",this.statusCode=r,this.data=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[e3n]===!0}get[e3n](){return!0}},t3n=Symbol.for("undici.error.UND_ERR_RESPONSE"),jtr=class extends rd{static{a(this,"ResponseError")}constructor(e,r,{headers:n,body:o}){super(e),this.name="ResponseError",this.message=e||"Response error",this.code="UND_ERR_RESPONSE",this.statusCode=r,this.body=o,this.headers=n}static[Symbol.hasInstance](e){return e&&e[t3n]===!0}get[t3n](){return!0}},r3n=Symbol.for("undici.error.UND_ERR_PRX_TLS"),Htr=class extends rd{static{a(this,"SecureProxyConnectionError")}constructor(e,r,n={}){super(r,{cause:e,...n}),this.name="SecureProxyConnectionError",this.message=r||"Secure Proxy Connection failed",this.code="UND_ERR_PRX_TLS",this.cause=e}static[Symbol.hasInstance](e){return e&&e[r3n]===!0}get[r3n](){return!0}},n3n=Symbol.for("undici.error.UND_ERR_MAX_ORIGINS_REACHED"),Gtr=class extends rd{static{a(this,"MaxOriginsReachedError")}constructor(e){super(e),this.name="MaxOriginsReachedError",this.message=e||"Maximum allowed origins reached",this.code="UND_ERR_MAX_ORIGINS_REACHED"}static[Symbol.hasInstance](e){return e&&e[n3n]===!0}get[n3n](){return!0}},$tr=class extends rd{static{a(this,"Socks5ProxyError")}constructor(e,r){super(e),this.name="Socks5ProxyError",this.message=e||"SOCKS5 proxy error",this.code=r||"UND_ERR_SOCKS5"}},i3n=Symbol.for("undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"),Vtr=class extends rd{static{a(this,"MessageSizeExceededError")}constructor(e){super(e),this.name="MessageSizeExceededError",this.message=e||"Max decompressed message size exceeded",this.code="UND_ERR_WS_MESSAGE_SIZE_EXCEEDED"}static[Symbol.hasInstance](e){return e&&e[i3n]===!0}get[i3n](){return!0}};o3n.exports={AbortError:znt,HTTPParserError:Utr,UndiciError:rd,HeadersTimeoutError:Ttr,HeadersOverflowError:Itr,BodyTimeoutError:xtr,RequestContentLengthMismatchError:Dtr,ConnectTimeoutError:Str,InvalidArgumentError:wtr,InvalidReturnValueError:Rtr,RequestAbortedError:Ptr,ClientDestroyedError:Mtr,ClientClosedError:Otr,InformationalError:ktr,SocketError:Btr,NotSupportedError:Ltr,ResponseContentLengthMismatchError:Ntr,BalancedPoolMissingUpstreamError:Ftr,ResponseExceededMaxSizeError:Qtr,RequestRetryError:qtr,ResponseError:jtr,SecureProxyConnectionError:Htr,MaxOriginsReachedError:Gtr,Socks5ProxyError:$tr,MessageSizeExceededError:Vtr}});var Knt=I((XKd,a3n)=>{"use strict";p();var Wtr=["Accept","Accept-Encoding","Accept-Language","Accept-Ranges","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Age","Allow","Alt-Svc","Alt-Used","Authorization","Cache-Control","Clear-Site-Data","Connection","Content-Disposition","Content-Encoding","Content-Language","Content-Length","Content-Location","Content-Range","Content-Security-Policy","Content-Security-Policy-Report-Only","Content-Type","Cookie","Cross-Origin-Embedder-Policy","Cross-Origin-Opener-Policy","Cross-Origin-Resource-Policy","Date","Device-Memory","Downlink","ECT","ETag","Expect","Expect-CT","Expires","Forwarded","From","Host","If-Match","If-Modified-Since","If-None-Match","If-Range","If-Unmodified-Since","Keep-Alive","Last-Modified","Link","Location","Max-Forwards","Origin","Permissions-Policy","Pragma","Proxy-Authenticate","Proxy-Authorization","RTT","Range","Referer","Referrer-Policy","Refresh","Retry-After","Sec-WebSocket-Accept","Sec-WebSocket-Extensions","Sec-WebSocket-Key","Sec-WebSocket-Protocol","Sec-WebSocket-Version","Server","Server-Timing","Service-Worker-Allowed","Service-Worker-Navigation-Preload","Set-Cookie","SourceMap","Strict-Transport-Security","Supports-Loading-Mode","TE","Timing-Allow-Origin","Trailer","Transfer-Encoding","Upgrade","Upgrade-Insecure-Requests","User-Agent","Vary","Via","WWW-Authenticate","X-Content-Type-Options","X-DNS-Prefetch-Control","X-Frame-Options","X-Permitted-Cross-Domain-Policies","X-Powered-By","X-Requested-With","X-XSS-Protection"],Ynt={};Object.setPrototypeOf(Ynt,null);var s3n={};Object.setPrototypeOf(s3n,null);function wvs(t){let e=s3n[t];return e===void 0&&(e=Buffer.from(t)),e}a(wvs,"getHeaderNameAsBuffer");for(let t=0;t{"use strict";p();var{wellknownHeaderNames:c3n,headerNameLowerCasedRecord:Rvs}=Knt(),ztr=class t{static{a(this,"TstNode")}value=null;left=null;middle=null;right=null;code;constructor(e,r,n){if(n===void 0||n>=e.length)throw new TypeError("Unreachable");if((this.code=e.charCodeAt(n))>127)throw new TypeError("key must be ascii string");e.length!==++n?this.middle=new t(e,r,n):this.value=r}add(e,r){let n=e.length;if(n===0)throw new TypeError("Unreachable");let o=0,s=this;for(;;){let c=e.charCodeAt(o);if(c>127)throw new TypeError("key must be ascii string");if(s.code===c)if(n===++o){s.value=r;break}else if(s.middle!==null)s=s.middle;else{s.middle=new t(e,r,o);break}else if(s.code=65&&(s|=32);o!==null;){if(s===o.code){if(r===++n)return o;o=o.middle;break}o=o.code{"use strict";p();var MRe=require("node:assert"),{kDestroyed:m3n,kBodyUsed:Yde,kListeners:Xnt,kBody:f3n}=tl(),{IncomingMessage:Pvs}=require("node:http"),g3n=require("node:stream"),kvs=require("node:net"),{stringify:Dvs}=require("node:querystring"),{EventEmitter:Nvs}=require("node:events"),Znt=btr(),{InvalidArgumentError:Ag,ConnectTimeoutError:Mvs}=ao(),{headerNameLowerCasedRecord:Ovs}=Knt(),{tree:A3n}=d3n(),[Bvs,Lvs]=process.versions.node.split(".",2).map(t=>Number(t)),tit=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[f3n]=e,this[Yde]=!1}async*[Symbol.asyncIterator](){MRe(!this[Yde],"disturbed"),this[Yde]=!0,yield*this[f3n]}};function p3n(){}a(p3n,"noop");function Fvs(t){return rit(t)?(b3n(t)===0&&t.on("data",function(){MRe(!1)}),typeof t.readableDidRead!="boolean"&&(t[Yde]=!1,Nvs.prototype.on.call(t,"data",function(){this[Yde]=!0})),t):t&&typeof t.pipeTo=="function"?new tit(t):t&&w3n(t)?t:t&&typeof t!="string"&&!ArrayBuffer.isView(t)&&C3n(t)?new tit(t):t}a(Fvs,"wrapRequestBody");function rit(t){return t&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"}a(rit,"isStream");function y3n(t){if(t===null)return!1;if(t instanceof Blob)return!0;if(typeof t!="object")return!1;{let e=t[Symbol.toStringTag];return(e==="Blob"||e==="File")&&("stream"in t&&typeof t.stream=="function"||"arrayBuffer"in t&&typeof t.arrayBuffer=="function")}}a(y3n,"isBlobLike");function E3n(t){return t.includes("?")||t.includes("#")}a(E3n,"pathHasQueryOrFragment");function Uvs(t,e){if(E3n(t))throw new Error('Query params cannot be passed when url already contains "?" or "#".');let r=Dvs(e);return r&&(t+="?"+r),t}a(Uvs,"serializePathWithQuery");function _3n(t){let e=parseInt(t,10);return e===Number(t)&&e>=0&&e<=65535}a(_3n,"isValidPort");function eit(t){return t!=null&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&(t[4]===":"||t[4]==="s"&&t[5]===":")}a(eit,"isHttpOrHttpsPrefixed");function v3n(t){if(typeof t=="string"){if(t=new URL(t),!eit(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}if(!t||typeof t!="object")throw new Ag("Invalid URL: The URL argument must be a non-null object.");if(!(t instanceof URL)){if(t.port!=null&&t.port!==""&&_3n(t.port)===!1)throw new Ag("Invalid URL: port must be a valid integer or a string representation of an integer.");if(t.path!=null&&typeof t.path!="string")throw new Ag("Invalid URL path: the path must be a string or null/undefined.");if(t.pathname!=null&&typeof t.pathname!="string")throw new Ag("Invalid URL pathname: the pathname must be a string or null/undefined.");if(t.hostname!=null&&typeof t.hostname!="string")throw new Ag("Invalid URL hostname: the hostname must be a string or null/undefined.");if(t.origin!=null&&typeof t.origin!="string")throw new Ag("Invalid URL origin: the origin must be a string or null/undefined.");if(!eit(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");let e=t.port!=null?t.port:t.protocol==="https:"?443:80,r=t.origin!=null?t.origin:`${t.protocol||""}//${t.hostname||""}:${e}`,n=t.path!=null?t.path:`${t.pathname||""}${t.search||""}`;return r[r.length-1]==="/"&&(r=r.slice(0,r.length-1)),n&&n[0]!=="/"&&(n=`/${n}`),new URL(`${r}${n}`)}if(!eit(t.origin||t.protocol))throw new Ag("Invalid URL protocol: the URL must start with `http:` or `https:`.");return t}a(v3n,"parseURL");function Qvs(t){if(t=v3n(t),t.pathname!=="/"||t.search||t.hash)throw new Ag("invalid url");return t}a(Qvs,"parseOrigin");function qvs(t){if(t[0]==="["){let r=t.indexOf("]");return MRe(r!==-1),t.substring(1,r)}let e=t.indexOf(":");return e===-1?t:t.substring(0,e)}a(qvs,"getHostname");function jvs(t){if(!t)return null;MRe(typeof t=="string");let e=qvs(t);return kvs.isIP(e)?"":e}a(jvs,"getServerName");function Hvs(t){return JSON.parse(JSON.stringify(t))}a(Hvs,"deepClone");function Gvs(t){return t!=null&&typeof t[Symbol.asyncIterator]=="function"}a(Gvs,"isAsyncIterable");function C3n(t){return t!=null&&(typeof t[Symbol.iterator]=="function"||typeof t[Symbol.asyncIterator]=="function")}a(C3n,"isIterable");function $vs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a($vs,"hasSafeIterator");function b3n(t){if(t==null)return 0;if(rit(t)){let e=t._readableState;return e&&e.objectMode===!1&&e.ended===!0&&Number.isFinite(e.length)?e.length:null}else{if(y3n(t))return t.size!=null?t.size:null;if(x3n(t))return t.byteLength}return null}a(b3n,"bodyLength");function S3n(t){return t&&!!(t.destroyed||t[m3n]||g3n.isDestroyed?.(t))}a(S3n,"isDestroyed");function T3n(t,e){t==null||!rit(t)||S3n(t)||(typeof t.destroy=="function"?(Object.getPrototypeOf(t).constructor===Pvs&&(t.socket=null),t.destroy(e)):e&&queueMicrotask(()=>{t.emit("error",e)}),t.destroyed!==!0&&(t[m3n]=!0))}a(T3n,"destroy");var Vvs=/timeout=(\d+)/;function Wvs(t){let e=t.match(Vvs);return e?parseInt(e[1],10)*1e3:null}a(Wvs,"parseKeepAliveTimeout");function I3n(t){return typeof t=="string"?Ovs[t]??t.toLowerCase():A3n.lookup(t)??t.toString("latin1").toLowerCase()}a(I3n,"headerNameToString");function zvs(t){return A3n.lookup(t)??t.toString("latin1").toLowerCase()}a(zvs,"bufferToLowerCasedHeaderName");function Yvs(t,e){e===void 0&&(e={});for(let r=0;rc.toString("latin1")):t[r+1].toString("latin1");n==="__proto__"?Object.defineProperty(e,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[n]=s}else{let s=typeof t[r+1]=="string"?t[r+1]:Array.isArray(t[r+1])?t[r+1].map(c=>c.toString("latin1")):t[r+1].toString("latin1");e[n]=s}}return e}a(Yvs,"parseHeaders");function Kvs(t){let e=t.length,r=new Array(e),n,o;for(let s=0;sBuffer.from(e))}a(Jvs,"encodeRawHeaders");function x3n(t){return t instanceof Uint8Array||Buffer.isBuffer(t)}a(x3n,"isBuffer");function Zvs(t,e,r){if(!t||typeof t!="object")throw new Ag("handler must be an object");if(typeof t.onRequestStart!="function"){if(typeof t.onConnect!="function")throw new Ag("invalid onConnect method");if(typeof t.onError!="function")throw new Ag("invalid onError method");if(typeof t.onBodySent!="function"&&t.onBodySent!==void 0)throw new Ag("invalid onBodySent method");if(r||e==="CONNECT"){if(typeof t.onUpgrade!="function")throw new Ag("invalid onUpgrade method")}else{if(typeof t.onHeaders!="function")throw new Ag("invalid onHeaders method");if(typeof t.onData!="function")throw new Ag("invalid onData method");if(typeof t.onComplete!="function")throw new Ag("invalid onComplete method")}}}a(Zvs,"assertRequestHandler");function Xvs(t){return!!(t&&(g3n.isDisturbed(t)||t[Yde]))}a(Xvs,"isDisturbed");function eCs(t){return{localAddress:t.localAddress,localPort:t.localPort,remoteAddress:t.remoteAddress,remotePort:t.remotePort,remoteFamily:t.remoteFamily,timeout:t.timeout,bytesWritten:t.bytesWritten,bytesRead:t.bytesRead}}a(eCs,"getSocketInfo");function tCs(t){let e;return new ReadableStream({start(){e=t[Symbol.asyncIterator]()},pull(r){return e.next().then(({done:n,value:o})=>{if(n)return queueMicrotask(()=>{r.close(),r.byobRequest?.respond(0)});{let s=Buffer.isBuffer(o)?o:Buffer.from(o);return s.byteLength?r.enqueue(new Uint8Array(s)):this.pull(r)}})},cancel(){return e.return()},type:"bytes"})}a(tCs,"ReadableStreamFrom");function w3n(t){return t&&typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&t[Symbol.toStringTag]==="FormData"}a(w3n,"isFormDataLike");function rCs(t,e){return"addEventListener"in t?(t.addEventListener("abort",e,{once:!0}),()=>t.removeEventListener("abort",e)):(t.once("abort",e),()=>t.removeListener("abort",e))}a(rCs,"addAbortListener");var R3n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function nCs(t){return R3n[t]===1}a(nCs,"isTokenCharCode");var iCs=/^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;function oCs(t){if(t.length>=12)return iCs.test(t);if(t.length===0)return!1;for(let e=0;e{if(!e.timeout)return p3n;let r=null,n=null,o=Znt.setFastTimeout(()=>{r=setImmediate(()=>{n=setImmediate(()=>h3n(t.deref(),e))})},e.timeout);return()=>{Znt.clearFastTimeout(o),clearImmediate(r),clearImmediate(n)}}:(t,e)=>{if(!e.timeout)return p3n;let r=null,n=Znt.setFastTimeout(()=>{r=setImmediate(()=>{h3n(t.deref(),e)})},e.timeout);return()=>{Znt.clearFastTimeout(n),clearImmediate(r)}};function h3n(t,e){if(t==null)return;let r="Connect Timeout Error";Array.isArray(t.autoSelectFamilyAttemptedAddresses)?r+=` (attempted addresses: ${t.autoSelectFamilyAttemptedAddresses.join(", ")},`:r+=` (attempted address: ${e.hostname}:${e.port},`,r+=` timeout: ${e.timeout}ms)`,T3n(t,new Mvs(r))}a(h3n,"onConnectTimeout");function hCs(t){if(t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p")switch(t[4]){case":":return"http:";case"s":if(t[5]===":")return"https:"}return t.slice(0,t.indexOf(":")+1)}a(hCs,"getProtocolFromUrlString");var P3n=Object.create(null);P3n.enumerable=!0;var Ytr={delete:"DELETE",DELETE:"DELETE",get:"GET",GET:"GET",head:"HEAD",HEAD:"HEAD",options:"OPTIONS",OPTIONS:"OPTIONS",post:"POST",POST:"POST",put:"PUT",PUT:"PUT"},k3n={...Ytr,patch:"patch",PATCH:"PATCH"};Object.setPrototypeOf(Ytr,null);Object.setPrototypeOf(k3n,null);D3n.exports={kEnumerableProperty:P3n,isDisturbed:Xvs,isBlobLike:y3n,parseOrigin:Qvs,parseURL:v3n,getServerName:jvs,isStream:rit,isIterable:C3n,hasSafeIterator:$vs,isAsyncIterable:Gvs,isDestroyed:S3n,headerNameToString:I3n,bufferToLowerCasedHeaderName:zvs,addListener:uCs,removeAllListeners:dCs,errorRequest:fCs,parseRawHeaders:Kvs,encodeRawHeaders:Jvs,parseHeaders:Yvs,parseKeepAliveTimeout:Wvs,destroy:T3n,bodyLength:b3n,deepClone:Hvs,ReadableStreamFrom:tCs,isBuffer:x3n,assertRequestHandler:Zvs,getSocketInfo:eCs,isFormDataLike:w3n,pathHasQueryOrFragment:E3n,serializePathWithQuery:Uvs,addAbortListener:rCs,isValidHTTPToken:oCs,isValidHeaderValue:aCs,isTokenCharCode:nCs,parseRangeHeader:lCs,normalizedMethodRecordsBase:Ytr,normalizedMethodRecords:k3n,isValidPort:_3n,isHttpOrHttpsPrefixed:eit,nodeMajor:Bvs,nodeMinor:Lvs,safeHTTPMethods:Object.freeze(["GET","HEAD","OPTIONS","TRACE"]),wrapRequestBody:Fvs,setupConnectTimeout:pCs,getProtocolFromUrlString:hCs}});var Ztr=I((cJd,L3n)=>{"use strict";p();var{kConnected:N3n,kPending:M3n,kRunning:O3n,kSize:B3n,kFree:mCs,kQueued:gCs}=tl(),Ktr=class{static{a(this,"ClientStats")}constructor(e){this.connected=e[N3n],this.pending=e[M3n],this.running=e[O3n],this.size=e[B3n]}},Jtr=class{static{a(this,"PoolStats")}constructor(e){this.connected=e[N3n],this.free=e[mCs],this.pending=e[M3n],this.queued=e[gCs],this.running=e[O3n],this.size=e[B3n]}};L3n.exports={ClientStats:Ktr,PoolStats:Jtr}});var rj=I((dJd,U3n)=>{"use strict";p();var rl=require("node:diagnostics_channel"),nrr=require("node:util"),wJ=nrr.debuglog("undici"),ORe=nrr.debuglog("fetch"),nit=nrr.debuglog("websocket"),KS={beforeConnect:rl.channel("undici:client:beforeConnect"),connected:rl.channel("undici:client:connected"),connectError:rl.channel("undici:client:connectError"),sendHeaders:rl.channel("undici:client:sendHeaders"),create:rl.channel("undici:request:create"),bodySent:rl.channel("undici:request:bodySent"),bodyChunkSent:rl.channel("undici:request:bodyChunkSent"),bodyChunkReceived:rl.channel("undici:request:bodyChunkReceived"),headers:rl.channel("undici:request:headers"),trailers:rl.channel("undici:request:trailers"),error:rl.channel("undici:request:error"),open:rl.channel("undici:websocket:open"),close:rl.channel("undici:websocket:close"),socketError:rl.channel("undici:websocket:socket_error"),ping:rl.channel("undici:websocket:ping"),pong:rl.channel("undici:websocket:pong"),proxyConnected:rl.channel("undici:proxy:connected")},Xtr=!1;function F3n(t=wJ){if(!Xtr){if(KS.beforeConnect.hasSubscribers||KS.connected.hasSubscribers||KS.connectError.hasSubscribers||KS.sendHeaders.hasSubscribers){Xtr=!0;return}Xtr=!0,rl.subscribe("undici:client:beforeConnect",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connecting to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),rl.subscribe("undici:client:connected",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s}}=e;t("connected to %s%s using %s%s",s,o?`:${o}`:"",n,r)}),rl.subscribe("undici:client:connectError",e=>{let{connectParams:{version:r,protocol:n,port:o,host:s},error:c}=e;t("connection to %s%s using %s%s errored - %s",s,o?`:${o}`:"",n,r,c.message)}),rl.subscribe("undici:client:sendHeaders",e=>{let{request:{method:r,path:n,origin:o}}=e;t("sending request to %s %s%s",r,o,n)})}}a(F3n,"trackClientEvents");var trr=!1;function ACs(t=wJ){if(!trr){if(KS.headers.hasSubscribers||KS.trailers.hasSubscribers||KS.error.hasSubscribers){trr=!0;return}trr=!0,rl.subscribe("undici:request:headers",e=>{let{request:{method:r,path:n,origin:o},response:{statusCode:s}}=e;t("received response to %s %s%s - HTTP %d",r,o,n,s)}),rl.subscribe("undici:request:trailers",e=>{let{request:{method:r,path:n,origin:o}}=e;t("trailers received from %s %s%s",r,o,n)}),rl.subscribe("undici:request:error",e=>{let{request:{method:r,path:n,origin:o},error:s}=e;t("request to %s %s%s errored - %s",r,o,n,s.message)})}}a(ACs,"trackRequestEvents");var rrr=!1;function yCs(t=nit){if(!rrr){if(KS.open.hasSubscribers||KS.close.hasSubscribers||KS.socketError.hasSubscribers||KS.ping.hasSubscribers||KS.pong.hasSubscribers){rrr=!0;return}rrr=!0,rl.subscribe("undici:websocket:open",e=>{if(e.address!=null){let{address:r,port:n}=e.address;t("connection opened %s%s",r,n?`:${n}`:"")}else t("connection opened")}),rl.subscribe("undici:websocket:close",e=>{let{websocket:r,code:n,reason:o}=e;t("closed connection to %s - %s %s",r.url,n,o)}),rl.subscribe("undici:websocket:socket_error",e=>{t("connection errored - %s",e.message)}),rl.subscribe("undici:websocket:ping",e=>{t("ping received")}),rl.subscribe("undici:websocket:pong",e=>{t("pong received")})}}a(yCs,"trackWebSocketEvents");(wJ.enabled||ORe.enabled)&&(F3n(ORe.enabled?ORe:wJ),ACs(ORe.enabled?ORe:wJ));nit.enabled&&(F3n(wJ.enabled?wJ:nit),yCs(nit));U3n.exports={channels:KS}});var j3n=I((hJd,q3n)=>{"use strict";p();var{InvalidArgumentError:Lc,NotSupportedError:ECs}=ao(),$O=require("node:assert"),{isValidHTTPToken:irr,isValidHeaderValue:orr,isStream:_Cs,destroy:vCs,isBuffer:CCs,isFormDataLike:bCs,isIterable:SCs,hasSafeIterator:TCs,isBlobLike:ICs,serializePathWithQuery:xCs,assertRequestHandler:wCs,getServerName:RCs,normalizedMethodRecords:PCs,getProtocolFromUrlString:kCs}=ko(),{channels:zC}=rj(),{headerNameLowerCasedRecord:Q3n}=Knt(),DCs=/[^\u0021-\u00ff]/;function NCs(t){if(typeof t!="string"||t.length===0)return!1;for(let e=0;e57)return!1}return!0}a(NCs,"isValidContentLengthHeaderValue");var dw=Symbol("handler"),srr=class{static{a(this,"Request")}constructor(e,{path:r,method:n,body:o,headers:s,query:c,idempotent:l,blocking:u,upgrade:d,headersTimeout:f,bodyTimeout:h,reset:m,expectContinue:g,servername:A,throwOnError:y,maxRedirections:E,typeOfService:_},v){if(typeof r!="string")throw new Lc("path must be a string");if(r[0]!=="/"&&!(r.startsWith("http://")||r.startsWith("https://"))&&n!=="CONNECT")throw new Lc("path must be an absolute URL or start with a slash");if(DCs.test(r))throw new Lc("invalid request path");if(typeof n!="string")throw new Lc("method must be a string");if(PCs[n]===void 0&&!irr(n))throw new Lc("invalid request method");if(d&&typeof d!="string")throw new Lc("upgrade must be a string");if(d&&!orr(d))throw new Lc("invalid upgrade header");if(f!=null&&(!Number.isFinite(f)||f<0))throw new Lc("invalid headersTimeout");if(h!=null&&(!Number.isFinite(h)||h<0))throw new Lc("invalid bodyTimeout");if(m!=null&&typeof m!="boolean")throw new Lc("invalid reset");if(g!=null&&typeof g!="boolean")throw new Lc("invalid expectContinue");if(y!=null)throw new Lc("invalid throwOnError");if(E!=null&&E!==0)throw new Lc("maxRedirections is not supported, use the redirect interceptor");if(_!=null&&(!Number.isInteger(_)||_<0||_>255))throw new Lc("typeOfService must be an integer between 0 and 255");if(this.headersTimeout=f,this.bodyTimeout=h,this.method=n,this.typeOfService=_??0,this.abort=null,o==null)this.body=null;else if(_Cs(o)){this.body=o;let b=this.body._readableState;(!b||!b.autoDestroy)&&(this.endHandler=a(function(){vCs(this)},"autoDestroy"),this.body.on("end",this.endHandler)),this.errorHandler=T=>{this.abort?this.abort(T):this.error=T},this.body.on("error",this.errorHandler)}else if(CCs(o))this.body=o.byteLength?o:null;else if(ArrayBuffer.isView(o))this.body=o.buffer.byteLength?Buffer.from(o.buffer,o.byteOffset,o.byteLength):null;else if(o instanceof ArrayBuffer)this.body=o.byteLength?Buffer.from(o):null;else if(typeof o=="string")this.body=o.length?Buffer.from(o):null;else if(bCs(o)||SCs(o)||ICs(o))this.body=o;else throw new Lc("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");if(this.completed=!1,this.aborted=!1,this.upgrade=d||null,this.path=c?xCs(r,c):r,this.origin=e,this.protocol=kCs(e),this.idempotent=l??(n==="HEAD"||n==="GET"),this.blocking=u??this.method!=="HEAD",this.reset=m??null,this.host=null,this.contentLength=null,this.contentType=null,this.headers=[],this.expectContinue=g??!1,Array.isArray(s)){if(s.length%2!==0)throw new Lc("headers array must be even");for(let b=0;b{"use strict";p();var{InvalidArgumentError:MCs}=ao();G3n.exports=class H3n{static{a(this,"WrapHandler")}#e;constructor(e){this.#e=e}static wrap(e){return e.onRequestStart?e:new H3n(e)}onConnect(e,r){return this.#e.onConnect?.(e,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onHeaders(e,r,n,o){return this.#e.onHeaders?.(e,r,n,o)}onUpgrade(e,r,n){return this.#e.onUpgrade?.(e,r,n)}onData(e){return this.#e.onData?.(e)}onComplete(e){return this.#e.onComplete?.(e)}onError(e){if(!this.#e.onError)throw e;return this.#e.onError?.(e)}onRequestStart(e,r){this.#e.onConnect?.(n=>e.abort(n),r)}onRequestUpgrade(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),arr(l));this.#e.onUpgrade?.(r,s,o)}onResponseStart(e,r,n,o){let s=[];for(let[c,l]of Object.entries(n))s.push(Buffer.from(c,"latin1"),arr(l));this.#e.onHeaders?.(r,s,()=>e.resume(),o)===!1&&e.pause()}onResponseData(e,r){this.#e.onData?.(r)===!1&&e.pause()}onResponseEnd(e,r){let n=[];for(let[o,s]of Object.entries(r))n.push(Buffer.from(o,"latin1"),arr(s));this.#e.onComplete?.(n)}onResponseError(e,r){if(!this.#e.onError)throw new MCs("invalid onError method");this.#e.onError?.(r)}};function arr(t){return Array.isArray(t)?t.map(e=>Buffer.from(e,"latin1")):Buffer.from(t,"latin1")}a(arr,"toRawHeaderValue")});var LRe=I((_Jd,$3n)=>{"use strict";p();var OCs=require("node:events"),BCs=BRe(),LCs=a(t=>(e,r)=>t(e,BCs.wrap(r)),"wrapInterceptor"),crr=class extends OCs{static{a(this,"Dispatcher")}dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}compose(...e){let r=Array.isArray(e[0])?e[0]:e,n=this.dispatch.bind(this);for(let o of r)if(o!=null){if(typeof o!="function")throw new TypeError(`invalid interceptor, expected function received ${typeof o}`);if(n=o(n),n=LCs(n),n==null||typeof n!="function"||n.length!==2)throw new TypeError("invalid interceptor")}return new Proxy(this,{get:a((o,s)=>s==="dispatch"?n:o[s],"get")})}};$3n.exports=crr});var z3n=I((bJd,W3n)=>{"use strict";p();var{parseHeaders:lrr}=ko(),{InvalidArgumentError:FCs}=ao(),urr=Symbol("resume"),drr=class{static{a(this,"UnwrapController")}#e=!1;#t=null;#r=!1;#n;[urr]=null;constructor(e){this.#n=e}pause(){this.#e=!0}resume(){this.#e&&(this.#e=!1,this[urr]?.())}abort(e){this.#r||(this.#r=!0,this.#t=e,this.#n(e))}get aborted(){return this.#r}get reason(){return this.#t}get paused(){return this.#e}};W3n.exports=class V3n{static{a(this,"UnwrapHandler")}#e;#t;constructor(e){this.#e=e}static unwrap(e){return e.onRequestStart?new V3n(e):e}onConnect(e,r){this.#t=new drr(e),this.#e.onRequestStart?.(this.#t,r)}onResponseStarted(){return this.#e.onResponseStarted?.()}onUpgrade(e,r,n){this.#e.onRequestUpgrade?.(this.#t,e,lrr(r),n)}onHeaders(e,r,n,o){return this.#t[urr]=n,this.#e.onResponseStart?.(this.#t,e,lrr(r),o),!this.#t.paused}onData(e){return this.#e.onResponseData?.(this.#t,e),!this.#t.paused}onComplete(e){this.#e.onResponseEnd?.(this.#t,lrr(e))}onError(e){if(!this.#e.onResponseError)throw new FCs("invalid onError method");this.#e.onResponseError?.(this.#t,e)}}});var PJ=I((IJd,Y3n)=>{"use strict";p();var UCs=LRe(),QCs=z3n(),{ClientDestroyedError:frr,ClientClosedError:qCs,InvalidArgumentError:oit}=ao(),{kDestroy:jCs,kClose:HCs,kClosed:FRe,kDestroyed:Kde,kDispatch:GCs}=tl(),nj=Symbol("onDestroyed"),RJ=Symbol("onClosed"),prr=class extends UCs{static{a(this,"DispatcherBase")}[Kde]=!1;[nj]=null;[FRe]=!1;[RJ]=null;get destroyed(){return this[Kde]}get closed(){return this[FRe]}close(e){if(e===void 0)return new Promise((n,o)=>{this.close((s,c)=>s?o(s):n(c))});if(typeof e!="function")throw new oit("invalid callback");if(this[Kde]){let n=new frr;queueMicrotask(()=>e(n,null));return}if(this[FRe]){this[RJ]?this[RJ].push(e):queueMicrotask(()=>e(null,null));return}this[FRe]=!0,this[RJ]??=[],this[RJ].push(e);let r=a(()=>{let n=this[RJ];this[RJ]=null;for(let o=0;othis.destroy()).then(()=>queueMicrotask(r))}destroy(e,r){if(typeof e=="function"&&(r=e,e=null),r===void 0)return new Promise((o,s)=>{this.destroy(e,(c,l)=>c?s(c):o(l))});if(typeof r!="function")throw new oit("invalid callback");if(this[Kde]){this[nj]?this[nj].push(r):queueMicrotask(()=>r(null,null));return}e||(e=new frr),this[Kde]=!0,this[nj]??=[],this[nj].push(r);let n=a(()=>{let o=this[nj];this[nj]=null;for(let s=0;squeueMicrotask(n))}dispatch(e,r){if(!r||typeof r!="object")throw new oit("handler must be an object");r=QCs.unwrap(r);try{if(!e||typeof e!="object")throw new oit("opts must be an object.");if(this[Kde]||this[nj])throw new frr;if(this[FRe])throw new qCs;return this[GCs](e,r)}catch(n){if(typeof r.onError!="function")throw n;return r.onError(n),!1}}};Y3n.exports=prr});var kJ=I((PJd,Z3n)=>{"use strict";p();var $Cs=require("node:net"),K3n=require("node:assert"),J3n=ko(),{InvalidArgumentError:VCs}=ao(),hrr,WCs=class{static{a(this,"WeakSessionCache")}constructor(e){this._maxCachedSessions=e,this._sessionCache=new Map,this._sessionRegistry=new FinalizationRegistry(r=>{if(this._sessionCache.size=this._maxCachedSessions){for(let[o,s]of this._sessionCache)if(s.deref()===void 0){this._sessionCache.delete(o);return}let n=this._sessionCache.keys().next();n.done||this._sessionCache.delete(n.value)}this._sessionCache.set(e,new WeakRef(r)),this._sessionRegistry.register(r,e)}}};function zCs({allowH2:t,useH2c:e,maxCachedSessions:r,socketPath:n,timeout:o,session:s,...c}){if(r!=null&&(!Number.isInteger(r)||r<0))throw new VCs("maxCachedSessions must be a positive integer or zero");let l={path:n,...c},u=new WCs(r??100);return o=o??1e4,t=t??!1,a(function({hostname:f,host:h,protocol:m,port:g,servername:A,localAddress:y,httpSocket:E},_){let v;if(m==="https:"){hrr||(hrr=require("node:tls")),A=A||l.servername||J3n.getServerName(h)||null;let T=A||f;K3n(T);let w=s||u.get(T)||null;g=g||443,v=hrr.connect({highWaterMark:16384,...l,servername:A,session:w,localAddress:y,ALPNProtocols:t?["http/1.1","h2"]:["http/1.1"],socket:E,port:g,host:f}),v.on("session",function(R){u.set(T,R)})}else K3n(!E,"httpSocket can only be sent on TLS update"),g=g||80,v=$Cs.connect({highWaterMark:64*1024,...l,localAddress:y,port:g,host:f}),e===!0&&(v.alpnProtocol="h2");if(l.keepAlive==null||l.keepAlive){let T=l.keepAliveInitialDelay===void 0?6e4:l.keepAliveInitialDelay;v.setKeepAlive(!0,T)}let b=J3n.setupConnectTimeout(new WeakRef(v),{timeout:o,hostname:f,port:g});return v.setNoDelay(!0).once(m==="https:"?"secureConnect":"connect",function(){if(queueMicrotask(b),_){let T=_;_=null,T(null,this)}}).on("error",function(T){if(queueMicrotask(b),_){let w=_;_=null,w(T)}}),v},"connect")}a(zCs,"buildConnector");Z3n.exports=zCs});var X3n=I(mrr=>{"use strict";p();Object.defineProperty(mrr,"__esModule",{value:!0});mrr.enumToMap=YCs;function YCs(t,e=[],r=[]){let n=(e?.length??0)===0,o=(r?.length??0)===0;return Object.fromEntries(Object.entries(t).filter(([,s])=>typeof s=="number"&&(n||e.includes(s))&&(o||!r.includes(s))))}a(YCs,"enumToMap")});var eFn=I(Qe=>{"use strict";p();Object.defineProperty(Qe,"__esModule",{value:!0});Qe.SPECIAL_HEADERS=Qe.MINOR=Qe.MAJOR=Qe.HTAB_SP_VCHAR_OBS_TEXT=Qe.QUOTED_STRING=Qe.CONNECTION_TOKEN_CHARS=Qe.HEADER_CHARS=Qe.TOKEN=Qe.HEX=Qe.URL_CHAR=Qe.USERINFO_CHARS=Qe.MARK=Qe.ALPHANUM=Qe.NUM=Qe.HEX_MAP=Qe.NUM_MAP=Qe.ALPHA=Qe.STATUSES_HTTP=Qe.H_METHOD_MAP=Qe.METHOD_MAP=Qe.METHODS_RTSP=Qe.METHODS_ICE=Qe.METHODS_HTTP=Qe.HEADER_STATE=Qe.FINISH=Qe.STATUSES=Qe.METHODS=Qe.LENIENT_FLAGS=Qe.FLAGS=Qe.TYPE=Qe.ERROR=void 0;var KCs=X3n();Qe.ERROR={OK:0,INTERNAL:1,STRICT:2,CR_EXPECTED:25,LF_EXPECTED:3,UNEXPECTED_CONTENT_LENGTH:4,UNEXPECTED_SPACE:30,CLOSED_CONNECTION:5,INVALID_METHOD:6,INVALID_URL:7,INVALID_CONSTANT:8,INVALID_VERSION:9,INVALID_HEADER_TOKEN:10,INVALID_CONTENT_LENGTH:11,INVALID_CHUNK_SIZE:12,INVALID_STATUS:13,INVALID_EOF_STATE:14,INVALID_TRANSFER_ENCODING:15,CB_MESSAGE_BEGIN:16,CB_HEADERS_COMPLETE:17,CB_MESSAGE_COMPLETE:18,CB_CHUNK_HEADER:19,CB_CHUNK_COMPLETE:20,PAUSED:21,PAUSED_UPGRADE:22,PAUSED_H2_UPGRADE:23,USER:24,CB_URL_COMPLETE:26,CB_STATUS_COMPLETE:27,CB_METHOD_COMPLETE:32,CB_VERSION_COMPLETE:33,CB_HEADER_FIELD_COMPLETE:28,CB_HEADER_VALUE_COMPLETE:29,CB_CHUNK_EXTENSION_NAME_COMPLETE:34,CB_CHUNK_EXTENSION_VALUE_COMPLETE:35,CB_RESET:31,CB_PROTOCOL_COMPLETE:38};Qe.TYPE={BOTH:0,REQUEST:1,RESPONSE:2};Qe.FLAGS={CONNECTION_KEEP_ALIVE:1,CONNECTION_CLOSE:2,CONNECTION_UPGRADE:4,CHUNKED:8,UPGRADE:16,CONTENT_LENGTH:32,SKIPBODY:64,TRAILING:128,TRANSFER_ENCODING:512};Qe.LENIENT_FLAGS={HEADERS:1,CHUNKED_LENGTH:2,KEEP_ALIVE:4,TRANSFER_ENCODING:8,VERSION:16,DATA_AFTER_CLOSE:32,OPTIONAL_LF_AFTER_CR:64,OPTIONAL_CRLF_AFTER_CHUNK:128,OPTIONAL_CR_BEFORE_LF:256,SPACES_AFTER_CHUNK_SIZE:512};Qe.METHODS={DELETE:0,GET:1,HEAD:2,POST:3,PUT:4,CONNECT:5,OPTIONS:6,TRACE:7,COPY:8,LOCK:9,MKCOL:10,MOVE:11,PROPFIND:12,PROPPATCH:13,SEARCH:14,UNLOCK:15,BIND:16,REBIND:17,UNBIND:18,ACL:19,REPORT:20,MKACTIVITY:21,CHECKOUT:22,MERGE:23,"M-SEARCH":24,NOTIFY:25,SUBSCRIBE:26,UNSUBSCRIBE:27,PATCH:28,PURGE:29,MKCALENDAR:30,LINK:31,UNLINK:32,SOURCE:33,PRI:34,DESCRIBE:35,ANNOUNCE:36,SETUP:37,PLAY:38,PAUSE:39,TEARDOWN:40,GET_PARAMETER:41,SET_PARAMETER:42,REDIRECT:43,RECORD:44,FLUSH:45,QUERY:46};Qe.STATUSES={CONTINUE:100,SWITCHING_PROTOCOLS:101,PROCESSING:102,EARLY_HINTS:103,RESPONSE_IS_STALE:110,REVALIDATION_FAILED:111,DISCONNECTED_OPERATION:112,HEURISTIC_EXPIRATION:113,MISCELLANEOUS_WARNING:199,OK:200,CREATED:201,ACCEPTED:202,NON_AUTHORITATIVE_INFORMATION:203,NO_CONTENT:204,RESET_CONTENT:205,PARTIAL_CONTENT:206,MULTI_STATUS:207,ALREADY_REPORTED:208,TRANSFORMATION_APPLIED:214,IM_USED:226,MISCELLANEOUS_PERSISTENT_WARNING:299,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,USE_PROXY:305,SWITCH_PROXY:306,TEMPORARY_REDIRECT:307,PERMANENT_REDIRECT:308,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,IM_A_TEAPOT:418,PAGE_EXPIRED:419,ENHANCE_YOUR_CALM:420,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL:430,REQUEST_HEADER_FIELDS_TOO_LARGE:431,LOGIN_TIMEOUT:440,NO_RESPONSE:444,RETRY_WITH:449,BLOCKED_BY_PARENTAL_CONTROL:450,UNAVAILABLE_FOR_LEGAL_REASONS:451,CLIENT_CLOSED_LOAD_BALANCED_REQUEST:460,INVALID_X_FORWARDED_FOR:463,REQUEST_HEADER_TOO_LARGE:494,SSL_CERTIFICATE_ERROR:495,SSL_CERTIFICATE_REQUIRED:496,HTTP_REQUEST_SENT_TO_HTTPS_PORT:497,INVALID_TOKEN:498,CLIENT_CLOSED_REQUEST:499,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,BANDWIDTH_LIMIT_EXCEEDED:509,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511,WEB_SERVER_UNKNOWN_ERROR:520,WEB_SERVER_IS_DOWN:521,CONNECTION_TIMEOUT:522,ORIGIN_IS_UNREACHABLE:523,TIMEOUT_OCCURED:524,SSL_HANDSHAKE_FAILED:525,INVALID_SSL_CERTIFICATE:526,RAILGUN_ERROR:527,SITE_IS_OVERLOADED:529,SITE_IS_FROZEN:530,IDENTITY_PROVIDER_AUTHENTICATION_ERROR:561,NETWORK_READ_TIMEOUT:598,NETWORK_CONNECT_TIMEOUT:599};Qe.FINISH={SAFE:0,SAFE_WITH_CB:1,UNSAFE:2};Qe.HEADER_STATE={GENERAL:0,CONNECTION:1,CONTENT_LENGTH:2,TRANSFER_ENCODING:3,UPGRADE:4,CONNECTION_KEEP_ALIVE:5,CONNECTION_CLOSE:6,CONNECTION_UPGRADE:7,TRANSFER_ENCODING_CHUNKED:8};Qe.METHODS_HTTP=[Qe.METHODS.DELETE,Qe.METHODS.GET,Qe.METHODS.HEAD,Qe.METHODS.POST,Qe.METHODS.PUT,Qe.METHODS.CONNECT,Qe.METHODS.OPTIONS,Qe.METHODS.TRACE,Qe.METHODS.COPY,Qe.METHODS.LOCK,Qe.METHODS.MKCOL,Qe.METHODS.MOVE,Qe.METHODS.PROPFIND,Qe.METHODS.PROPPATCH,Qe.METHODS.SEARCH,Qe.METHODS.UNLOCK,Qe.METHODS.BIND,Qe.METHODS.REBIND,Qe.METHODS.UNBIND,Qe.METHODS.ACL,Qe.METHODS.REPORT,Qe.METHODS.MKACTIVITY,Qe.METHODS.CHECKOUT,Qe.METHODS.MERGE,Qe.METHODS["M-SEARCH"],Qe.METHODS.NOTIFY,Qe.METHODS.SUBSCRIBE,Qe.METHODS.UNSUBSCRIBE,Qe.METHODS.PATCH,Qe.METHODS.PURGE,Qe.METHODS.MKCALENDAR,Qe.METHODS.LINK,Qe.METHODS.UNLINK,Qe.METHODS.PRI,Qe.METHODS.SOURCE,Qe.METHODS.QUERY];Qe.METHODS_ICE=[Qe.METHODS.SOURCE];Qe.METHODS_RTSP=[Qe.METHODS.OPTIONS,Qe.METHODS.DESCRIBE,Qe.METHODS.ANNOUNCE,Qe.METHODS.SETUP,Qe.METHODS.PLAY,Qe.METHODS.PAUSE,Qe.METHODS.TEARDOWN,Qe.METHODS.GET_PARAMETER,Qe.METHODS.SET_PARAMETER,Qe.METHODS.REDIRECT,Qe.METHODS.RECORD,Qe.METHODS.FLUSH,Qe.METHODS.GET,Qe.METHODS.POST];Qe.METHOD_MAP=(0,KCs.enumToMap)(Qe.METHODS);Qe.H_METHOD_MAP=Object.fromEntries(Object.entries(Qe.METHODS).filter(([t])=>t.startsWith("H")));Qe.STATUSES_HTTP=[Qe.STATUSES.CONTINUE,Qe.STATUSES.SWITCHING_PROTOCOLS,Qe.STATUSES.PROCESSING,Qe.STATUSES.EARLY_HINTS,Qe.STATUSES.RESPONSE_IS_STALE,Qe.STATUSES.REVALIDATION_FAILED,Qe.STATUSES.DISCONNECTED_OPERATION,Qe.STATUSES.HEURISTIC_EXPIRATION,Qe.STATUSES.MISCELLANEOUS_WARNING,Qe.STATUSES.OK,Qe.STATUSES.CREATED,Qe.STATUSES.ACCEPTED,Qe.STATUSES.NON_AUTHORITATIVE_INFORMATION,Qe.STATUSES.NO_CONTENT,Qe.STATUSES.RESET_CONTENT,Qe.STATUSES.PARTIAL_CONTENT,Qe.STATUSES.MULTI_STATUS,Qe.STATUSES.ALREADY_REPORTED,Qe.STATUSES.TRANSFORMATION_APPLIED,Qe.STATUSES.IM_USED,Qe.STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,Qe.STATUSES.MULTIPLE_CHOICES,Qe.STATUSES.MOVED_PERMANENTLY,Qe.STATUSES.FOUND,Qe.STATUSES.SEE_OTHER,Qe.STATUSES.NOT_MODIFIED,Qe.STATUSES.USE_PROXY,Qe.STATUSES.SWITCH_PROXY,Qe.STATUSES.TEMPORARY_REDIRECT,Qe.STATUSES.PERMANENT_REDIRECT,Qe.STATUSES.BAD_REQUEST,Qe.STATUSES.UNAUTHORIZED,Qe.STATUSES.PAYMENT_REQUIRED,Qe.STATUSES.FORBIDDEN,Qe.STATUSES.NOT_FOUND,Qe.STATUSES.METHOD_NOT_ALLOWED,Qe.STATUSES.NOT_ACCEPTABLE,Qe.STATUSES.PROXY_AUTHENTICATION_REQUIRED,Qe.STATUSES.REQUEST_TIMEOUT,Qe.STATUSES.CONFLICT,Qe.STATUSES.GONE,Qe.STATUSES.LENGTH_REQUIRED,Qe.STATUSES.PRECONDITION_FAILED,Qe.STATUSES.PAYLOAD_TOO_LARGE,Qe.STATUSES.URI_TOO_LONG,Qe.STATUSES.UNSUPPORTED_MEDIA_TYPE,Qe.STATUSES.RANGE_NOT_SATISFIABLE,Qe.STATUSES.EXPECTATION_FAILED,Qe.STATUSES.IM_A_TEAPOT,Qe.STATUSES.PAGE_EXPIRED,Qe.STATUSES.ENHANCE_YOUR_CALM,Qe.STATUSES.MISDIRECTED_REQUEST,Qe.STATUSES.UNPROCESSABLE_ENTITY,Qe.STATUSES.LOCKED,Qe.STATUSES.FAILED_DEPENDENCY,Qe.STATUSES.TOO_EARLY,Qe.STATUSES.UPGRADE_REQUIRED,Qe.STATUSES.PRECONDITION_REQUIRED,Qe.STATUSES.TOO_MANY_REQUESTS,Qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,Qe.STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,Qe.STATUSES.LOGIN_TIMEOUT,Qe.STATUSES.NO_RESPONSE,Qe.STATUSES.RETRY_WITH,Qe.STATUSES.BLOCKED_BY_PARENTAL_CONTROL,Qe.STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,Qe.STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,Qe.STATUSES.INVALID_X_FORWARDED_FOR,Qe.STATUSES.REQUEST_HEADER_TOO_LARGE,Qe.STATUSES.SSL_CERTIFICATE_ERROR,Qe.STATUSES.SSL_CERTIFICATE_REQUIRED,Qe.STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,Qe.STATUSES.INVALID_TOKEN,Qe.STATUSES.CLIENT_CLOSED_REQUEST,Qe.STATUSES.INTERNAL_SERVER_ERROR,Qe.STATUSES.NOT_IMPLEMENTED,Qe.STATUSES.BAD_GATEWAY,Qe.STATUSES.SERVICE_UNAVAILABLE,Qe.STATUSES.GATEWAY_TIMEOUT,Qe.STATUSES.HTTP_VERSION_NOT_SUPPORTED,Qe.STATUSES.VARIANT_ALSO_NEGOTIATES,Qe.STATUSES.INSUFFICIENT_STORAGE,Qe.STATUSES.LOOP_DETECTED,Qe.STATUSES.BANDWIDTH_LIMIT_EXCEEDED,Qe.STATUSES.NOT_EXTENDED,Qe.STATUSES.NETWORK_AUTHENTICATION_REQUIRED,Qe.STATUSES.WEB_SERVER_UNKNOWN_ERROR,Qe.STATUSES.WEB_SERVER_IS_DOWN,Qe.STATUSES.CONNECTION_TIMEOUT,Qe.STATUSES.ORIGIN_IS_UNREACHABLE,Qe.STATUSES.TIMEOUT_OCCURED,Qe.STATUSES.SSL_HANDSHAKE_FAILED,Qe.STATUSES.INVALID_SSL_CERTIFICATE,Qe.STATUSES.RAILGUN_ERROR,Qe.STATUSES.SITE_IS_OVERLOADED,Qe.STATUSES.SITE_IS_FROZEN,Qe.STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,Qe.STATUSES.NETWORK_READ_TIMEOUT,Qe.STATUSES.NETWORK_CONNECT_TIMEOUT];Qe.ALPHA=[];for(let t=65;t<=90;t++)Qe.ALPHA.push(String.fromCharCode(t)),Qe.ALPHA.push(String.fromCharCode(t+32));Qe.NUM_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9};Qe.HEX_MAP={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};Qe.NUM=["0","1","2","3","4","5","6","7","8","9"];Qe.ALPHANUM=Qe.ALPHA.concat(Qe.NUM);Qe.MARK=["-","_",".","!","~","*","'","(",")"];Qe.USERINFO_CHARS=Qe.ALPHANUM.concat(Qe.MARK).concat(["%",";",":","&","=","+","$",","]);Qe.URL_CHAR=["!",'"',"$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","@","[","\\","]","^","_","`","{","|","}","~"].concat(Qe.ALPHANUM);Qe.HEX=Qe.NUM.concat(["a","b","c","d","e","f","A","B","C","D","E","F"]);Qe.TOKEN=["!","#","$","%","&","'","*","+","-",".","^","_","`","|","~"].concat(Qe.ALPHANUM);Qe.HEADER_CHARS=[" "];for(let t=32;t<=255;t++)t!==127&&Qe.HEADER_CHARS.push(t);Qe.CONNECTION_TOKEN_CHARS=Qe.HEADER_CHARS.filter(t=>t!==44);Qe.QUOTED_STRING=[" "," "];for(let t=33;t<=255;t++)t!==34&&t!==92&&Qe.QUOTED_STRING.push(t);Qe.HTAB_SP_VCHAR_OBS_TEXT=[" "," "];for(let t=33;t<=126;t++)Qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);for(let t=128;t<=255;t++)Qe.HTAB_SP_VCHAR_OBS_TEXT.push(t);Qe.MAJOR=Qe.NUM_MAP;Qe.MINOR=Qe.MAJOR;Qe.SPECIAL_HEADERS={connection:Qe.HEADER_STATE.CONNECTION,"content-length":Qe.HEADER_STATE.CONTENT_LENGTH,"proxy-connection":Qe.HEADER_STATE.CONNECTION,"transfer-encoding":Qe.HEADER_STATE.TRANSFER_ENCODING,upgrade:Qe.HEADER_STATE.UPGRADE};Qe.default={ERROR:Qe.ERROR,TYPE:Qe.TYPE,FLAGS:Qe.FLAGS,LENIENT_FLAGS:Qe.LENIENT_FLAGS,METHODS:Qe.METHODS,STATUSES:Qe.STATUSES,FINISH:Qe.FINISH,HEADER_STATE:Qe.HEADER_STATE,ALPHA:Qe.ALPHA,NUM_MAP:Qe.NUM_MAP,HEX_MAP:Qe.HEX_MAP,NUM:Qe.NUM,ALPHANUM:Qe.ALPHANUM,MARK:Qe.MARK,USERINFO_CHARS:Qe.USERINFO_CHARS,URL_CHAR:Qe.URL_CHAR,HEX:Qe.HEX,TOKEN:Qe.TOKEN,HEADER_CHARS:Qe.HEADER_CHARS,CONNECTION_TOKEN_CHARS:Qe.CONNECTION_TOKEN_CHARS,QUOTED_STRING:Qe.QUOTED_STRING,HTAB_SP_VCHAR_OBS_TEXT:Qe.HTAB_SP_VCHAR_OBS_TEXT,MAJOR:Qe.MAJOR,MINOR:Qe.MINOR,SPECIAL_HEADERS:Qe.SPECIAL_HEADERS,METHODS_HTTP:Qe.METHODS_HTTP,METHODS_ICE:Qe.METHODS_ICE,METHODS_RTSP:Qe.METHODS_RTSP,METHOD_MAP:Qe.METHOD_MAP,H_METHOD_MAP:Qe.H_METHOD_MAP,STATUSES_HTTP:Qe.STATUSES_HTTP}});var Arr=I((FJd,tFn)=>{"use strict";p();var{Buffer:JCs}=require("node:buffer"),ZCs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCq/ZAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgL5YUCAgd/A34gASACaiEEAkAgACIDKAIMIgANACADKAIEBEAgAyABNgIECyMAQRBrIgkkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAygCHCICQQJrDvwBAfkBAgMEBQYHCAkKCwwNDg8QERL4ARP3ARQV9gEWF/UBGBkaGxwdHh8g/QH7ASH0ASIjJCUmJygpKivzASwtLi8wMTLyAfEBMzTwAe8BNTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5P+gFQUVJT7gHtAVTsAVXrAVZXWFla6gFbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHpAegBzwHnAdAB5gHRAdIB0wHUAeUB1QHWAdcB2AHZAdoB2wHcAd0B3gHfAeAB4QHiAeMBAPwBC0EADOMBC0EODOIBC0ENDOEBC0EPDOABC0EQDN8BC0ETDN4BC0EUDN0BC0EVDNwBC0EWDNsBC0EXDNoBC0EYDNkBC0EZDNgBC0EaDNcBC0EbDNYBC0EcDNUBC0EdDNQBC0EeDNMBC0EfDNIBC0EgDNEBC0EhDNABC0EIDM8BC0EiDM4BC0EkDM0BC0EjDMwBC0EHDMsBC0ElDMoBC0EmDMkBC0EnDMgBC0EoDMcBC0ESDMYBC0ERDMUBC0EpDMQBC0EqDMMBC0ErDMIBC0EsDMEBC0HeAQzAAQtBLgy/AQtBLwy+AQtBMAy9AQtBMQy8AQtBMgy7AQtBMwy6AQtBNAy5AQtB3wEMuAELQTUMtwELQTkMtgELQQwMtQELQTYMtAELQTcMswELQTgMsgELQT4MsQELQToMsAELQeABDK8BC0ELDK4BC0E/DK0BC0E7DKwBC0EKDKsBC0E8DKoBC0E9DKkBC0HhAQyoAQtBwQAMpwELQcAADKYBC0HCAAylAQtBCQykAQtBLQyjAQtBwwAMogELQcQADKEBC0HFAAygAQtBxgAMnwELQccADJ4BC0HIAAydAQtByQAMnAELQcoADJsBC0HLAAyaAQtBzAAMmQELQc0ADJgBC0HOAAyXAQtBzwAMlgELQdAADJUBC0HRAAyUAQtB0gAMkwELQdMADJIBC0HVAAyRAQtB1AAMkAELQdYADI8BC0HXAAyOAQtB2AAMjQELQdkADIwBC0HaAAyLAQtB2wAMigELQdwADIkBC0HdAAyIAQtB3gAMhwELQd8ADIYBC0HgAAyFAQtB4QAMhAELQeIADIMBC0HjAAyCAQtB5AAMgQELQeUADIABC0HiAQx/C0HmAAx+C0HnAAx9C0EGDHwLQegADHsLQQUMegtB6QAMeQtBBAx4C0HqAAx3C0HrAAx2C0HsAAx1C0HtAAx0C0EDDHMLQe4ADHILQe8ADHELQfAADHALQfIADG8LQfEADG4LQfMADG0LQfQADGwLQfUADGsLQfYADGoLQQIMaQtB9wAMaAtB+AAMZwtB+QAMZgtB+gAMZQtB+wAMZAtB/AAMYwtB/QAMYgtB/gAMYQtB/wAMYAtBgAEMXwtBgQEMXgtBggEMXQtBgwEMXAtBhAEMWwtBhQEMWgtBhgEMWQtBhwEMWAtBiAEMVwtBiQEMVgtBigEMVQtBiwEMVAtBjAEMUwtBjQEMUgtBjgEMUQtBjwEMUAtBkAEMTwtBkQEMTgtBkgEMTQtBkwEMTAtBlAEMSwtBlQEMSgtBlgEMSQtBlwEMSAtBmAEMRwtBmQEMRgtBmgEMRQtBmwEMRAtBnAEMQwtBnQEMQgtBngEMQQtBnwEMQAtBoAEMPwtBoQEMPgtBogEMPQtBowEMPAtBpAEMOwtBpQEMOgtBpgEMOQtBpwEMOAtBqAEMNwtBqQEMNgtBqgEMNQtBqwEMNAtBrAEMMwtBrQEMMgtBrgEMMQtBrwEMMAtBsAEMLwtBsQEMLgtBsgEMLQtBswEMLAtBtAEMKwtBtQEMKgtBtgEMKQtBtwEMKAtBuAEMJwtBuQEMJgtBugEMJQtBuwEMJAtBvAEMIwtBvQEMIgtBvgEMIQtBvwEMIAtBwAEMHwtBwQEMHgtBwgEMHQtBAQwcC0HDAQwbC0HEAQwaC0HFAQwZC0HGAQwYC0HHAQwXC0HIAQwWC0HJAQwVC0HKAQwUC0HLAQwTC0HMAQwSC0HNAQwRC0HOAQwQC0HPAQwPC0HQAQwOC0HRAQwNC0HSAQwMC0HTAQwLC0HUAQwKC0HVAQwJC0HWAQwIC0HjAQwHC0HXAQwGC0HYAQwFC0HZAQwEC0HaAQwDC0HbAQwCC0HdAQwBC0HcAQshAgNAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJ/AkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAg7jAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEjJCUnKCmeA5sDmgORA4oDgwOAA/0C+wL4AvIC8QLvAu0C6ALnAuYC5QLkAtwC2wLaAtkC2ALXAtYC1QLPAs4CzALLAsoCyQLIAscCxgLEAsMCvgK8AroCuQK4ArcCtgK1ArQCswKyArECsAKuAq0CqQKoAqcCpgKlAqQCowKiAqECoAKfApgCkAKMAosCigKBAv4B/QH8AfsB+gH5AfgB9wH1AfMB8AHrAekB6AHnAeYB5QHkAeMB4gHhAeAB3wHeAd0B3AHaAdkB2AHXAdYB1QHUAdMB0gHRAdABzwHOAc0BzAHLAcoByQHIAccBxgHFAcQBwwHCAcEBwAG/Ab4BvQG8AbsBugG5AbgBtwG2AbUBtAGzAbIBsQGwAa8BrgGtAawBqwGqAakBqAGnAaYBpQGkAaMBogGfAZ4BmQGYAZcBlgGVAZQBkwGSAZEBkAGPAY0BjAGHAYYBhQGEAYMBggF9fHt6eXZ1dFBRUlNUVQsgASAERw1yQf0BIQIMvgMLIAEgBEcNmAFB2wEhAgy9AwsgASAERw3xAUGOASECDLwDCyABIARHDfwBQYQBIQIMuwMLIAEgBEcNigJB/wAhAgy6AwsgASAERw2RAkH9ACECDLkDCyABIARHDZQCQfsAIQIMuAMLIAEgBEcNHkEeIQIMtwMLIAEgBEcNGUEYIQIMtgMLIAEgBEcNygJBzQAhAgy1AwsgASAERw3VAkHGACECDLQDCyABIARHDdYCQcMAIQIMswMLIAEgBEcN3AJBOCECDLIDCyADLQAwQQFGDa0DDIkDC0EAIQACQAJAAkAgAy0AKkUNACADLQArRQ0AIAMvATIiAkECcUUNAQwCCyADLwEyIgJBAXFFDQELQQEhACADLQAoQQFGDQAgAy8BNCIGQeQAa0HkAEkNACAGQcwBRg0AIAZBsAJGDQAgAkHAAHENAEEAIQAgAkGIBHFBgARGDQAgAkEocUEARyEACyADQQA7ATIgA0EAOgAxAkAgAEUEQCADQQA6ADEgAy0ALkEEcQ0BDLEDCyADQgA3AyALIANBADoAMSADQQE6ADYMSAtBACEAAkAgAygCOCICRQ0AIAIoAjAiAkUNACADIAIRAAAhAAsgAEUNSCAAQRVHDWIgA0EENgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMrwMLIAEgBEYEQEEGIQIMrwMLIAEtAABBCkcNGSABQQFqIQEMGgsgA0IANwMgQRIhAgyUAwsgASAERw2KA0EjIQIMrAMLIAEgBEYEQEEHIQIMrAMLAkACQCABLQAAQQprDgQBGBgAGAsgAUEBaiEBQRAhAgyTAwsgAUEBaiEBIANBL2otAABBAXENF0EAIQIgA0EANgIcIAMgATYCFCADQZkgNgIQIANBGTYCDAyrAwsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFoNGEEIIQIMqgMLIAEgBEcEQCADQQk2AgggAyABNgIEQRQhAgyRAwtBCSECDKkDCyADKQMgUA2uAgxDCyABIARGBEBBCyECDKgDCyABLQAAQQpHDRYgAUEBaiEBDBcLIANBL2otAABBAXFFDRkMJgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0ZDEILQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGgwkC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRsMMgsgA0Evai0AAEEBcUUNHAwiC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADRwMQgtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0dDCALIAEgBEYEQEETIQIMoAMLAkAgAS0AACIAQQprDgQfIyMAIgsgAUEBaiEBDB8LQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIgxCCyABIARGBEBBFiECDJ4DCyABLQAAQcDBAGotAABBAUcNIwyDAwsCQANAIAEtAABBsDtqLQAAIgBBAUcEQAJAIABBAmsOAgMAJwsgAUEBaiEBQSEhAgyGAwsgBCABQQFqIgFHDQALQRghAgydAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAFBAWoiARA0IgANIQxBC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADSMMKgsgASAERgRAQRwhAgybAwsgA0EKNgIIIAMgATYCBEEAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADSVBJCECDIEDCyABIARHBEADQCABLQAAQbA9ai0AACIAQQNHBEAgAEEBaw4FGBomggMlJgsgBCABQQFqIgFHDQALQRshAgyaAwtBGyECDJkDCwNAIAEtAABBsD9qLQAAIgBBA0cEQCAAQQFrDgUPEScTJicLIAQgAUEBaiIBRw0AC0EeIQIMmAMLIAEgBEcEQCADQQs2AgggAyABNgIEQQchAgz/AgtBHyECDJcDCyABIARGBEBBICECDJcDCwJAIAEtAABBDWsOFC4/Pz8/Pz8/Pz8/Pz8/Pz8/Pz8APwtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQMlgMLIANBL2ohAgNAIAEgBEYEQEEhIQIMlwMLAkACQAJAIAEtAAAiAEEJaw4YAgApKQEpKSkpKSkpKSkpKSkpKSkpKSkCJwsgAUEBaiEBIANBL2otAABBAXFFDQoMGAsgAUEBaiEBDBcLIAFBAWohASACLQAAQQJxDQALQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDJUDCyADLQAuQYABcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUN5gIgAEEVRgRAIANBJDYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDJQDC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAyTAwtBACECIANBADYCHCADIAE2AhQgA0G+IDYCECADQQI2AgwMkgMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABIAynaiIBEDIiAEUNKyADQQc2AhwgAyABNgIUIAMgADYCDAyRAwsgAy0ALkHAAHFFDQELQQAhAAJAIAMoAjgiAkUNACACKAJYIgJFDQAgAyACEQAAIQALIABFDSsgAEEVRgRAIANBCjYCHCADIAE2AhQgA0HrGTYCECADQRU2AgxBACECDJADC0EAIQIgA0EANgIcIAMgATYCFCADQZMMNgIQIANBEzYCDAyPAwtBACECIANBADYCHCADIAE2AhQgA0GCFTYCECADQQI2AgwMjgMLQQAhAiADQQA2AhwgAyABNgIUIANB3RQ2AhAgA0EZNgIMDI0DC0EAIQIgA0EANgIcIAMgATYCFCADQeYdNgIQIANBGTYCDAyMAwsgAEEVRg09QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIsDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFDSggA0ENNgIcIAMgATYCFCADIAA2AgwMigMLIABBFUYNOkEAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAyJAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwoCyADQQ42AhwgAyAANgIMIAMgAUEBajYCFAyIAwsgAEEVRg03QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIcDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCcLIANBDzYCHCADIAA2AgwgAyABQQFqNgIUDIYDC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAyFAwsgAEEVRg0zQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIQDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFDSUgA0ERNgIcIAMgATYCFCADIAA2AgwMgwMLIABBFUYNMEEAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAyCAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwlCyADQRI2AhwgAyAANgIMIAMgAUEBajYCFAyBAwsgA0Evai0AAEEBcUUNAQtBFyECDOYCC0EAIQIgA0EANgIcIAMgATYCFCADQeIXNgIQIANBGTYCDAz+AgsgAEE7Rw0AIAFBAWohAQwMC0EAIQIgA0EANgIcIAMgATYCFCADQZIYNgIQIANBAjYCDAz8AgsgAEEVRg0oQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDPsCCyADQRQ2AhwgAyABNgIUIAMgADYCDAz6AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQz1AgsgA0EVNgIcIAMgADYCDCADIAFBAWo2AhQM+QILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM8wILIANBFzYCHCADIAA2AgwgAyABQQFqNgIUDPgCCyAAQRVGDSNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM9wILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEMHQsgA0EZNgIcIAMgADYCDCADIAFBAWo2AhQM9gILIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUEQCABQQFqIQEM7wILIANBGjYCHCADIAA2AgwgAyABQQFqNgIUDPUCCyAAQRVGDR9BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwM9AILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQwbCyADQRw2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8wILIAMoAgQhACADQQA2AgQgAyAAIAEQMyIARQRAIAFBAWohAQzrAgsgA0EdNgIcIAMgADYCDCADIAFBAWo2AhRBACECDPICCyAAQTtHDQEgAUEBaiEBC0EmIQIM1wILQQAhAiADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMDO8CCyABIARHBEADQCABLQAAQSBHDYQCIAQgAUEBaiIBRw0AC0EsIQIM7wILQSwhAgzuAgsgASAERgRAQTQhAgzuAgsCQAJAA0ACQCABLQAAQQprDgQCAAADAAsgBCABQQFqIgFHDQALQTQhAgzvAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDZ8CIANBMjYCHCADIAE2AhQgAyAANgIMQQAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDJ8CCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM7QILIAEgBEcEQAJAA0AgAS0AAEEwayIAQf8BcUEKTwRAQTohAgzXAgsgAykDICILQpmz5syZs+bMGVYNASADIAtCCn4iCjcDICAKIACtQv8BgyILQn+FVg0BIAMgCiALfDcDICAEIAFBAWoiAUcNAAtBwAAhAgzuAgsgAygCBCEAIANBADYCBCADIAAgAUEBaiIBEDEiAA0XDOICC0HAACECDOwCCyABIARGBEBByQAhAgzsAgsCQANAAkAgAS0AAEEJaw4YAAKiAqICqQKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogIAogILIAQgAUEBaiIBRw0AC0HJACECDOwCCyABQQFqIQEgA0Evai0AAEEBcQ2lAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgzrAgsgASAERwRAA0AgAS0AAEEgRw0VIAQgAUEBaiIBRw0AC0H4ACECDOsCC0H4ACECDOoCCyADQQI6ACgMOAtBACECIANBADYCHCADQb8LNgIQIANBAjYCDCADIAFBAWo2AhQM6AILQQAhAgzOAgtBDSECDM0CC0ETIQIMzAILQRUhAgzLAgtBFiECDMoCC0EYIQIMyQILQRkhAgzIAgtBGiECDMcCC0EbIQIMxgILQRwhAgzFAgtBHSECDMQCC0EeIQIMwwILQR8hAgzCAgtBICECDMECC0EiIQIMwAILQSMhAgy/AgtBJSECDL4CC0HlACECDL0CCyADQT02AhwgAyABNgIUIAMgADYCDEEAIQIM1QILIANBGzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDNQCCyADQSA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzTAgsgA0ETNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0gILIANBCzYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNECCyADQRA2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzQAgsgA0EgNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzwILIANBCzYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM4CCyADQQw2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzNAgtBACECIANBADYCHCADIAE2AhQgA0HdDjYCECADQRI2AgwMzAILAkADQAJAIAEtAABBCmsOBAACAgACCyAEIAFBAWoiAUcNAAtB/QEhAgzMAgsCQAJAIAMtADZBAUcNAEEAIQACQCADKAI4IgJFDQAgAigCYCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUcNASADQfwBNgIcIAMgATYCFCADQdwZNgIQIANBFTYCDEEAIQIMzQILQdwBIQIMswILIANBADYCHCADIAE2AhQgA0H5CzYCECADQR82AgxBACECDMsCCwJAAkAgAy0AKEEBaw4CBAEAC0HbASECDLICC0HUASECDLECCyADQQI6ADFBACEAAkAgAygCOCICRQ0AIAIoAgAiAkUNACADIAIRAAAhAAsgAEUEQEHdASECDLECCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQbQMNgIQIANBEDYCDEEAIQIMygILIANB+wE2AhwgAyABNgIUIANBgRo2AhAgA0EVNgIMQQAhAgzJAgsgASAERgRAQfoBIQIMyQILIAEtAABByABGDQEgA0EBOgAoC0HAASECDK4CC0HaASECDK0CCyABIARHBEAgA0EMNgIIIAMgATYCBEHZASECDK0CC0H5ASECDMUCCyABIARGBEBB+AEhAgzFAgsgAS0AAEHIAEcNBCABQQFqIQFB2AEhAgyrAgsgASAERgRAQfcBIQIMxAILAkACQCABLQAAQcUAaw4QAAUFBQUFBQUFBQUFBQUFAQULIAFBAWohAUHWASECDKsCCyABQQFqIQFB1wEhAgyqAgtB9gEhAiABIARGDcICIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbrVAGotAABHDQMgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMMCCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIARQRAQeMBIQIMqgILIANB9QE2AhwgAyABNgIUIAMgADYCDEEAIQIMwgILQfQBIQIgASAERg3BAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEG41QBqLQAARw0CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzCAgsgA0GBBDsBKCADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQLiIADQMMAgsgA0EANgIAC0EAIQIgA0EANgIcIAMgATYCFCADQeUfNgIQIANBCDYCDAy/AgtB1QEhAgylAgsgA0HzATYCHCADIAE2AhQgAyAANgIMQQAhAgy9AgtBACEAAkAgAygCOCICRQ0AIAIoAkAiAkUNACADIAIRAAAhAAsgAEUNbiAAQRVHBEAgA0EANgIcIAMgATYCFCADQYIPNgIQIANBIDYCDEEAIQIMvQILIANBjwE2AhwgAyABNgIUIANB7Bs2AhAgA0EVNgIMQQAhAgy8AgsgASAERwRAIANBDTYCCCADIAE2AgRB0wEhAgyjAgtB8gEhAgy7AgsgASAERgRAQfEBIQIMuwILAkACQAJAIAEtAABByABrDgsAAQgICAgICAgIAggLIAFBAWohAUHQASECDKMCCyABQQFqIQFB0QEhAgyiAgsgAUEBaiEBQdIBIQIMoQILQfABIQIgASAERg25AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBtdUAai0AAEcNBCAAQQJGDQMgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuQILQe8BIQIgASAERg24AiADKAIAIgAgBCABa2ohBiABIABrQQFqIQUDQCABLQAAIABBs9UAai0AAEcNAyAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMuAILQe4BIQIgASAERg23AiADKAIAIgAgBCABa2ohBiABIABrQQJqIQUDQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAY2AgAMtwILIAMoAgQhACADQgA3AwAgAyAAIAVBAWoiARArIgBFDQIgA0HsATYCHCADIAE2AhQgAyAANgIMQQAhAgy2AgsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNnAIgA0HtATYCHCADIAE2AhQgAyAANgIMQQAhAgy0AgtBzwEhAgyaAgtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDLQCC0HOASECDJoCCyADQesBNgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMsgILIAEgBEYEQEHrASECDLICCyABLQAAQS9GBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GyODYCECADQQg2AgxBACECDLECC0HNASECDJcCCyABIARHBEAgA0EONgIIIAMgATYCBEHMASECDJcCC0HqASECDK8CCyABIARGBEBB6QEhAgyvAgsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFBywEhAgyWAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZcCIANB6AE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAEgBEYEQEHnASECDK4CCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5gE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILQcoBIQIMlAILIAEgBEYEQEHlASECDK0CC0EAIQBBASEFQQEhB0EAIQICQAJAAkACQAJAAn8CQAJAAkACQAJAAkACQCABLQAAQTBrDgoKCQABAgMEBQYICwtBAgwGC0EDDAULQQQMBAtBBQwDC0EGDAILQQcMAQtBCAshAkEAIQVBACEHDAILQQkhAkEBIQBBACEFQQAhBwwBC0EAIQVBASECCyADIAI6ACsgAUEBaiEBAkACQCADLQAuQRBxDQACQAJAAkAgAy0AKg4DAQACBAsgB0UNAwwCCyAADQEMAgsgBUUNAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDQIgA0HiATYCHCADIAE2AhQgAyAANgIMQQAhAgyvAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZoCIANB4wE2AhwgAyABNgIUIAMgADYCDEEAIQIMrgILIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ2YAiADQeQBNgIcIAMgATYCFCADIAA2AgwMrQILQckBIQIMkwILQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgytAgtByAEhAgyTAgsgA0HhATYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDKsCCyABIARGBEBB4QEhAgyrAgsCQCABLQAAQSBGBEAgA0EAOwE0IAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBmRE2AhAgA0EJNgIMQQAhAgyrAgtBxwEhAgyRAgsgASAERgRAQeABIQIMqgILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyrAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqgILQcYBIQIMkAILIAEgBEYEQEHfASECDKkCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqgILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKkCC0HFASECDI8CCyABIARGBEBB3gEhAgyoAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKkCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyoAgtBxAEhAgyOAgsgASAERgRAQd0BIQIMpwILAkACQAJAAkAgAS0AAEEKaw4XAgMDAAMDAwMDAwMDAwMDAwMDAwMDAwEDCyABQQFqDAULIAFBAWohAUHDASECDI8CCyABQQFqIQEgA0Evai0AAEEBcQ0IIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKcCCyADQQA2AhwgAyABNgIUIANBjQs2AhAgA0ENNgIMQQAhAgymAgsgASAERwRAIANBDzYCCCADIAE2AgRBASECDI0CC0HcASECDKUCCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtB2wEhAgymAgsgAygCBCEAIANBADYCBCADIAAgARAtIgBFBEAgAUEBaiEBDAQLIANB2gE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMpQILIAMoAgQhACADQQA2AgQgAyAAIAEQLSIADQEgAUEBagshAUHBASECDIoCCyADQdkBNgIcIAMgADYCDCADIAFBAWo2AhRBACECDKICC0HCASECDIgCCyADQS9qLQAAQQFxDQEgA0EANgIcIAMgATYCFCADQeQcNgIQIANBGTYCDEEAIQIMoAILIAEgBEYEQEHZASECDKACCwJAAkACQCABLQAAQQprDgQBAgIAAgsgAUEBaiEBDAILIAFBAWohAQwBCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAjwiAkUNACADIAIRAAAhAAsgAEUNoAEgAEEVRgRAIANB2QA2AhwgAyABNgIUIANBtxo2AhAgA0EVNgIMQQAhAgyfAgsgA0EANgIcIAMgATYCFCADQYANNgIQIANBGzYCDEEAIQIMngILIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDJ0CCyABIARHBEAgA0EMNgIIIAMgATYCBEG/ASECDIQCC0HYASECDJwCCyABIARGBEBB1wEhAgycAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBwQBrDhUAAQIDWgQFBlpaWgcICQoLDA0ODxBaCyABQQFqIQFB+wAhAgySAgsgAUEBaiEBQfwAIQIMkQILIAFBAWohAUGBASECDJACCyABQQFqIQFBhQEhAgyPAgsgAUEBaiEBQYYBIQIMjgILIAFBAWohAUGJASECDI0CCyABQQFqIQFBigEhAgyMAgsgAUEBaiEBQY0BIQIMiwILIAFBAWohAUGWASECDIoCCyABQQFqIQFBlwEhAgyJAgsgAUEBaiEBQZgBIQIMiAILIAFBAWohAUGlASECDIcCCyABQQFqIQFBpgEhAgyGAgsgAUEBaiEBQawBIQIMhQILIAFBAWohAUG0ASECDIQCCyABQQFqIQFBtwEhAgyDAgsgAUEBaiEBQb4BIQIMggILIAEgBEYEQEHWASECDJsCCyABLQAAQc4ARw1IIAFBAWohAUG9ASECDIECCyABIARGBEBB1QEhAgyaAgsCQAJAAkAgAS0AAEHCAGsOEgBKSkpKSkpKSkoBSkpKSkpKAkoLIAFBAWohAUG4ASECDIICCyABQQFqIQFBuwEhAgyBAgsgAUEBaiEBQbwBIQIMgAILQdQBIQIgASAERg2YAiADKAIAIgAgBCABa2ohBSABIABrQQdqIQYCQANAIAEtAAAgAEGo1QBqLQAARw1FIABBB0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAgsgA0EANgIAIAZBAWohAUEbDEULIAEgBEYEQEHTASECDJgCCwJAAkAgAS0AAEHJAGsOBwBHR0dHRwFHCyABQQFqIQFBuQEhAgz/AQsgAUEBaiEBQboBIQIM/gELQdIBIQIgASAERg2WAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw1DIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyXAgsgA0EANgIAIAZBAWohAUEPDEMLQdEBIQIgASAERg2VAiADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw1CIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyWAgsgA0EANgIAIAZBAWohAUEgDEILQdABIQIgASAERg2UAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw1BIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyVAgsgA0EANgIAIAZBAWohAUESDEELIAEgBEYEQEHPASECDJQCCwJAAkAgAS0AAEHFAGsODgBDQ0NDQ0NDQ0NDQ0MBQwsgAUEBaiEBQbUBIQIM+wELIAFBAWohAUG2ASECDPoBC0HOASECIAEgBEYNkgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBntUAai0AAEcNPyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkwILIANBADYCACAGQQFqIQFBBww/C0HNASECIAEgBEYNkQIgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBmNUAai0AAEcNPiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkgILIANBADYCACAGQQFqIQFBKAw+CyABIARGBEBBzAEhAgyRAgsCQAJAAkAgAS0AAEHFAGsOEQBBQUFBQUFBQUEBQUFBQUECQQsgAUEBaiEBQbEBIQIM+QELIAFBAWohAUGyASECDPgBCyABQQFqIQFBswEhAgz3AQtBywEhAiABIARGDY8CIAMoAgAiACAEIAFraiEFIAEgAGtBBmohBgJAA0AgAS0AACAAQZHVAGotAABHDTwgAEEGRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJACCyADQQA2AgAgBkEBaiEBQRoMPAtBygEhAiABIARGDY4CIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQY3VAGotAABHDTsgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADI8CCyADQQA2AgAgBkEBaiEBQSEMOwsgASAERgRAQckBIQIMjgILAkACQCABLQAAQcEAaw4UAD09PT09PT09PT09PT09PT09PQE9CyABQQFqIQFBrQEhAgz1AQsgAUEBaiEBQbABIQIM9AELIAEgBEYEQEHIASECDI0CCwJAAkAgAS0AAEHVAGsOCwA8PDw8PDw8PDwBPAsgAUEBaiEBQa4BIQIM9AELIAFBAWohAUGvASECDPMBC0HHASECIAEgBEYNiwIgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNOCAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjAILIANBADYCACAGQQFqIQFBKgw4CyABIARGBEBBxgEhAgyLAgsgAS0AAEHQAEcNOCABQQFqIQFBJQw3C0HFASECIAEgBEYNiQIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBgdUAai0AAEcNNiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMigILIANBADYCACAGQQFqIQFBDgw2CyABIARGBEBBxAEhAgyJAgsgAS0AAEHFAEcNNiABQQFqIQFBqwEhAgzvAQsgASAERgRAQcMBIQIMiAILAkACQAJAAkAgAS0AAEHCAGsODwABAjk5OTk5OTk5OTk5AzkLIAFBAWohAUGnASECDPEBCyABQQFqIQFBqAEhAgzwAQsgAUEBaiEBQakBIQIM7wELIAFBAWohAUGqASECDO4BC0HCASECIAEgBEYNhgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB/tQAai0AAEcNMyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhwILIANBADYCACAGQQFqIQFBFAwzC0HBASECIAEgBEYNhQIgAygCACIAIAQgAWtqIQUgASAAa0EEaiEGAkADQCABLQAAIABB+dQAai0AAEcNMiAAQQRGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhgILIANBADYCACAGQQFqIQFBKwwyC0HAASECIAEgBEYNhAIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABB9tQAai0AAEcNMSAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhQILIANBADYCACAGQQFqIQFBLAwxC0G/ASECIAEgBEYNgwIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNMCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMhAILIANBADYCACAGQQFqIQFBEQwwC0G+ASECIAEgBEYNggIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB8tQAai0AAEcNLyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgwILIANBADYCACAGQQFqIQFBLgwvCyABIARGBEBBvQEhAgyCAgsCQAJAAkACQAJAIAEtAABBwQBrDhUANDQ0NDQ0NDQ0NAE0NAI0NAM0NAQ0CyABQQFqIQFBmwEhAgzsAQsgAUEBaiEBQZwBIQIM6wELIAFBAWohAUGdASECDOoBCyABQQFqIQFBogEhAgzpAQsgAUEBaiEBQaQBIQIM6AELIAEgBEYEQEG8ASECDIECCwJAAkAgAS0AAEHSAGsOAwAwATALIAFBAWohAUGjASECDOgBCyABQQFqIQFBBAwtC0G7ASECIAEgBEYN/wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB8NQAai0AAEcNLCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMgAILIANBADYCACAGQQFqIQFBHQwsCyABIARGBEBBugEhAgz/AQsCQAJAIAEtAABByQBrDgcBLi4uLi4ALgsgAUEBaiEBQaEBIQIM5gELIAFBAWohAUEiDCsLIAEgBEYEQEG5ASECDP4BCyABLQAAQdAARw0rIAFBAWohAUGgASECDOQBCyABIARGBEBBuAEhAgz9AQsCQAJAIAEtAABBxgBrDgsALCwsLCwsLCwsASwLIAFBAWohAUGeASECDOQBCyABQQFqIQFBnwEhAgzjAQtBtwEhAiABIARGDfsBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQezUAGotAABHDSggAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPwBCyADQQA2AgAgBkEBaiEBQQ0MKAtBtgEhAiABIARGDfoBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDScgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPsBCyADQQA2AgAgBkEBaiEBQQwMJwtBtQEhAiABIARGDfkBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQerUAGotAABHDSYgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPoBCyADQQA2AgAgBkEBaiEBQQMMJgtBtAEhAiABIARGDfgBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQejUAGotAABHDSUgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPkBCyADQQA2AgAgBkEBaiEBQSYMJQsgASAERgRAQbMBIQIM+AELAkACQCABLQAAQdQAaw4CAAEnCyABQQFqIQFBmQEhAgzfAQsgAUEBaiEBQZoBIQIM3gELQbIBIQIgASAERg32ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHm1ABqLQAARw0jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz3AQsgA0EANgIAIAZBAWohAUEnDCMLQbEBIQIgASAERg31ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHk1ABqLQAARw0iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz2AQsgA0EANgIAIAZBAWohAUEcDCILQbABIQIgASAERg30ASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHe1ABqLQAARw0hIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz1AQsgA0EANgIAIAZBAWohAUEGDCELQa8BIQIgASAERg3zASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEHZ1ABqLQAARw0gIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAz0AQsgA0EANgIAIAZBAWohAUEZDCALIAEgBEYEQEGuASECDPMBCwJAAkACQAJAIAEtAABBLWsOIwAkJCQkJCQkJCQkJCQkJCQkJCQkJCQkJAEkJCQkJAIkJCQDJAsgAUEBaiEBQY4BIQIM3AELIAFBAWohAUGPASECDNsBCyABQQFqIQFBlAEhAgzaAQsgAUEBaiEBQZUBIQIM2QELQa0BIQIgASAERg3xASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHX1ABqLQAARw0eIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzyAQsgA0EANgIAIAZBAWohAUELDB4LIAEgBEYEQEGsASECDPEBCwJAAkAgAS0AAEHBAGsOAwAgASALIAFBAWohAUGQASECDNgBCyABQQFqIQFBkwEhAgzXAQsgASAERgRAQasBIQIM8AELAkACQCABLQAAQcEAaw4PAB8fHx8fHx8fHx8fHx8BHwsgAUEBaiEBQZEBIQIM1wELIAFBAWohAUGSASECDNYBCyABIARGBEBBqgEhAgzvAQsgAS0AAEHMAEcNHCABQQFqIQFBCgwbC0GpASECIAEgBEYN7QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABB0dQAai0AAEcNGiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7gELIANBADYCACAGQQFqIQFBHgwaC0GoASECIAEgBEYN7AEgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBytQAai0AAEcNGSAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7QELIANBADYCACAGQQFqIQFBFQwZC0GnASECIAEgBEYN6wEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBx9QAai0AAEcNGCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM7AELIANBADYCACAGQQFqIQFBFwwYC0GmASECIAEgBEYN6gEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBwdQAai0AAEcNFyAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6wELIANBADYCACAGQQFqIQFBGAwXCyABIARGBEBBpQEhAgzqAQsCQAJAIAEtAABByQBrDgcAGRkZGRkBGQsgAUEBaiEBQYsBIQIM0QELIAFBAWohAUGMASECDNABC0GkASECIAEgBEYN6AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBptUAai0AAEcNFSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6QELIANBADYCACAGQQFqIQFBCQwVC0GjASECIAEgBEYN5wEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBpNUAai0AAEcNFCAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM6AELIANBADYCACAGQQFqIQFBHwwUC0GiASECIAEgBEYN5gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBvtQAai0AAEcNEyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5wELIANBADYCACAGQQFqIQFBAgwTC0GhASECIAEgBEYN5QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGA0AgAS0AACAAQbzUAGotAABHDREgAEEBRg0CIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADOUBCyABIARGBEBBoAEhAgzlAQtBASABLQAAQd8ARw0RGiABQQFqIQFBhwEhAgzLAQsgA0EANgIAIAZBAWohAUGIASECDMoBC0GfASECIAEgBEYN4gEgAygCACIAIAQgAWtqIQUgASAAa0EIaiEGAkADQCABLQAAIABBhNUAai0AAEcNDyAAQQhGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4wELIANBADYCACAGQQFqIQFBKQwPC0GeASECIAEgBEYN4QEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBuNQAai0AAEcNDiAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM4gELIANBADYCACAGQQFqIQFBLQwOCyABIARGBEBBnQEhAgzhAQsgAS0AAEHFAEcNDiABQQFqIQFBhAEhAgzHAQsgASAERgRAQZwBIQIM4AELAkACQCABLQAAQcwAaw4IAA8PDw8PDwEPCyABQQFqIQFBggEhAgzHAQsgAUEBaiEBQYMBIQIMxgELQZsBIQIgASAERg3eASADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEGz1ABqLQAARw0LIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzfAQsgA0EANgIAIAZBAWohAUEjDAsLQZoBIQIgASAERg3dASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGw1ABqLQAARw0KIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzeAQsgA0EANgIAIAZBAWohAUEADAoLIAEgBEYEQEGZASECDN0BCwJAAkAgAS0AAEHIAGsOCAAMDAwMDAwBDAsgAUEBaiEBQf0AIQIMxAELIAFBAWohAUGAASECDMMBCyABIARGBEBBmAEhAgzcAQsCQAJAIAEtAABBzgBrDgMACwELCyABQQFqIQFB/gAhAgzDAQsgAUEBaiEBQf8AIQIMwgELIAEgBEYEQEGXASECDNsBCyABLQAAQdkARw0IIAFBAWohAUEIDAcLQZYBIQIgASAERg3ZASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEGs1ABqLQAARw0GIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzaAQsgA0EANgIAIAZBAWohAUEFDAYLQZUBIQIgASAERg3YASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGm1ABqLQAARw0FIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzZAQsgA0EANgIAIAZBAWohAUEWDAULQZQBIQIgASAERg3XASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0EIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzYAQsgA0EANgIAIAZBAWohAUEQDAQLIAEgBEYEQEGTASECDNcBCwJAAkAgAS0AAEHDAGsODAAGBgYGBgYGBgYGAQYLIAFBAWohAUH5ACECDL4BCyABQQFqIQFB+gAhAgy9AQtBkgEhAiABIARGDdUBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQaDUAGotAABHDQIgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNYBCyADQQA2AgAgBkEBaiEBQSQMAgsgA0EANgIADAILIAEgBEYEQEGRASECDNQBCyABLQAAQcwARw0BIAFBAWohAUETCzoAKSADKAIEIQAgA0EANgIEIAMgACABEC4iAA0CDAELQQAhAiADQQA2AhwgAyABNgIUIANB/h82AhAgA0EGNgIMDNEBC0H4ACECDLcBCyADQZABNgIcIAMgATYCFCADIAA2AgxBACECDM8BC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ0AIABBFUYNASADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgzOAQtB9wAhAgy0AQsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDMwBCyABIARGBEBBjwEhAgzMAQsCQCABLQAAQSBGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GbHzYCECADQQY2AgxBACECDMwBC0ECIQIMsgELA0AgAS0AAEEgRw0CIAQgAUEBaiIBRw0AC0GOASECDMoBCyABIARGBEBBjQEhAgzKAQsCQCABLQAAQQlrDgRKAABKAAtB9QAhAgywAQsgAy0AKUEFRgRAQfYAIQIMsAELQfQAIQIMrwELIAEgBEYEQEGMASECDMgBCyADQRA2AgggAyABNgIEDAoLIAEgBEYEQEGLASECDMcBCwJAIAEtAABBCWsOBEcAAEcAC0HzACECDK0BCyABIARHBEAgA0EQNgIIIAMgATYCBEHxACECDK0BC0GKASECDMUBCwJAIAEgBEcEQANAIAEtAABBoNAAai0AACIAQQNHBEACQCAAQQFrDgJJAAQLQfAAIQIMrwELIAQgAUEBaiIBRw0AC0GIASECDMYBC0GIASECDMUBCyADQQA2AhwgAyABNgIUIANB2yA2AhAgA0EHNgIMQQAhAgzEAQsgASAERgRAQYkBIQIMxAELAkACQAJAIAEtAABBoNIAai0AAEEBaw4DRgIAAQtB8gAhAgysAQsgA0EANgIcIAMgATYCFCADQbQSNgIQIANBBzYCDEEAIQIMxAELQeoAIQIMqgELIAEgBEcEQCABQQFqIQFB7wAhAgyqAQtBhwEhAgzCAQsgBCABIgBGBEBBhgEhAgzCAQsgAC0AACIBQS9GBEAgAEEBaiEBQe4AIQIMqQELIAFBCWsiAkEXSw0BIAAhAUEBIAJ0QZuAgARxDUEMAQsgBCABIgBGBEBBhQEhAgzBAQsgAC0AAEEvRw0AIABBAWohAQwDC0EAIQIgA0EANgIcIAMgADYCFCADQdsgNgIQIANBBzYCDAy/AQsCQAJAAkACQAJAA0AgAS0AAEGgzgBqLQAAIgBBBUcEQAJAAkAgAEEBaw4IRwUGBwgABAEIC0HrACECDK0BCyABQQFqIQFB7QAhAgysAQsgBCABQQFqIgFHDQALQYQBIQIMwwELIAFBAWoMFAsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgzBAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgzAAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDR4gA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy/AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMvgELIAEgBEYEQEGDASECDL4BCwJAIAEtAABBoM4Aai0AAEEBaw4IPgQFBgAIAgMHCyABQQFqIQELQQMhAgyjAQsgAUEBagwNC0EAIQIgA0EANgIcIANB0RI2AhAgA0EHNgIMIAMgAUEBajYCFAy6AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgy5AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgy4AQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDRYgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgy3AQsgA0EANgIcIAMgATYCFCADQfkPNgIQIANBBzYCDEEAIQIMtgELQewAIQIMnAELIAEgBEYEQEGCASECDLUBCyABQQFqDAILIAEgBEYEQEGBASECDLQBCyABQQFqDAELIAEgBEYNASABQQFqCyEBQQQhAgyYAQtBgAEhAgywAQsDQCABLQAAQaDMAGotAAAiAEECRwRAIABBAUcEQEHpACECDJkBCwwxCyAEIAFBAWoiAUcNAAtB/wAhAgyvAQsgASAERgRAQf4AIQIMrwELAkAgAS0AAEEJaw43LwMGLwQGBgYGBgYGBgYGBgYGBgYGBgYFBgYCBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAAYLIAFBAWoLIQFBBSECDJQBCyABQQFqDAYLIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0IIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIANBADYCHCADIAE2AhQgA0GNFDYCECADQQc2AgxBACECDKgBCwJAAkACQAJAA0AgAS0AAEGgygBqLQAAIgBBBUcEQAJAIABBAWsOBi4DBAUGAAYLQegAIQIMlAELIAQgAUEBaiIBRw0AC0H9ACECDKsBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQdsANgIcIAMgATYCFCADIAA2AgxBACECDKoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDKkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNByADQfoANgIcIAMgATYCFCADIAA2AgxBACECDKgBCyADQQA2AhwgAyABNgIUIANB5Ag2AhAgA0EHNgIMQQAhAgynAQsgASAERg0BIAFBAWoLIQFBBiECDIwBC0H8ACECDKQBCwJAAkACQAJAA0AgAS0AAEGgyABqLQAAIgBBBUcEQCAAQQFrDgQpAgMEBQsgBCABQQFqIgFHDQALQfsAIQIMpwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMpgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMpQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0DIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMpAELIANBADYCHCADIAE2AhQgA0G8CjYCECADQQc2AgxBACECDKMBC0HPACECDIkBC0HRACECDIgBC0HnACECDIcBCyABIARGBEBB+gAhAgygAQsCQCABLQAAQQlrDgQgAAAgAAsgAUEBaiEBQeYAIQIMhgELIAEgBEYEQEH5ACECDJ8BCwJAIAEtAABBCWsOBB8AAB8AC0EAIQACQCADKAI4IgJFDQAgAigCOCICRQ0AIAMgAhEAACEACyAARQRAQeIBIQIMhgELIABBFUcEQCADQQA2AhwgAyABNgIUIANByQ02AhAgA0EaNgIMQQAhAgyfAQsgA0H4ADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDJ4BCyABIARHBEAgA0ENNgIIIAMgATYCBEHkACECDIUBC0H3ACECDJ0BCyABIARGBEBB9gAhAgydAQsCQAJAAkAgAS0AAEHIAGsOCwABCwsLCwsLCwsCCwsgAUEBaiEBQd0AIQIMhQELIAFBAWohAUHgACECDIQBCyABQQFqIQFB4wAhAgyDAQtB9QAhAiABIARGDZsBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbXVAGotAABHDQggAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJwBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIABEAgA0H0ADYCHCADIAE2AhQgAyAANgIMQQAhAgycAQtB4gAhAgyCAQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJwBC0HhACECDIIBCyADQfMANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMmgELIAMtACkiAEEja0ELSQ0JAkAgAEEGSw0AQQEgAHRBygBxRQ0ADAoLQQAhAiADQQA2AhwgAyABNgIUIANB7Qk2AhAgA0EINgIMDJkBC0HyACECIAEgBEYNmAEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABBs9UAai0AAEcNBSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMmQELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfEANgIcIAMgATYCFCADIAA2AgxBACECDJkBC0HfACECDH8LQQAhAAJAIAMoAjgiAkUNACACKAI0IgJFDQAgAyACEQAAIQALAkAgAARAIABBFUYNASADQQA2AhwgAyABNgIUIANB6g02AhAgA0EmNgIMQQAhAgyZAQtB3gAhAgx/CyADQfAANgIcIAMgATYCFCADQYAbNgIQIANBFTYCDEEAIQIMlwELIAMtAClBIUYNBiADQQA2AhwgAyABNgIUIANBkQo2AhAgA0EINgIMQQAhAgyWAQtB7wAhAiABIARGDZUBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDVAGotAABHDQIgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYBCyADKAIEIQAgA0IANwMAIAMgACAGQQFqIgEQKyIARQ0CIANB7QA2AhwgAyABNgIUIAMgADYCDEEAIQIMlQELIANBADYCAAsgAygCBCEAIANBADYCBCADIAAgARArIgBFDYABIANB7gA2AhwgAyABNgIUIAMgADYCDEEAIQIMkwELQdwAIQIMeQtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJMBC0HbACECDHkLIANB7AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyRAQsgAy0AKSIAQSNJDQAgAEEuRg0AIANBADYCHCADIAE2AhQgA0HJCTYCECADQQg2AgxBACECDJABC0HaACECDHYLIAEgBEYEQEHrACECDI8BCwJAIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMjwELQdkAIQIMdQsgASAERwRAIANBDjYCCCADIAE2AgRB2AAhAgx1C0HqACECDI0BCyABIARGBEBB6QAhAgyNAQsgAS0AAEEwayIAQf8BcUEKSQRAIAMgADoAKiABQQFqIQFB1wAhAgx0CyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeiADQegANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyABIARGBEBB5wAhAgyMAQsCQCABLQAAQS5GBEAgAUEBaiEBDAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELQdYAIQIMcgsgASAERgRAQeUAIQIMiwELQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIANgIcIAMgATYCFCADIAA2AgxBACECDI0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNfSADQeMANgIcIAMgATYCFCADIAA2AgxBACECDIwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNeyADQeQANgIcIAMgATYCFCADIAA2AgwMiwELQdQAIQIMcQsgAy0AKUEiRg2GAUHTACECDHALQQAhAAJAIAMoAjgiAkUNACACKAJEIgJFDQAgAyACEQAAIQALIABFBEBB1QAhAgxwCyAAQRVHBEAgA0EANgIcIAMgATYCFCADQaQNNgIQIANBITYCDEEAIQIMiQELIANB4QA2AhwgAyABNgIUIANB0Bo2AhAgA0EVNgIMQQAhAgyIAQsgASAERgRAQeAAIQIMiAELAkACQAJAAkACQCABLQAAQQprDgQBBAQABAsgAUEBaiEBDAELIAFBAWohASADQS9qLQAAQQFxRQ0BC0HSACECDHALIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIgBCyADQQA2AhwgAyABNgIUIANBthE2AhAgA0EJNgIMQQAhAgyHAQsgASAERgRAQd8AIQIMhwELIAEtAABBCkYEQCABQQFqIQEMCQsgAy0ALkHAAHENCCADQQA2AhwgAyABNgIUIANBthE2AhAgA0ECNgIMQQAhAgyGAQsgASAERgRAQd0AIQIMhgELIAEtAAAiAkENRgRAIAFBAWohAUHQACECDG0LIAEhACACQQlrDgQFAQEFAQsgBCABIgBGBEBB3AAhAgyFAQsgAC0AAEEKRw0AIABBAWoMAgtBACECIANBADYCHCADIAA2AhQgA0HKLTYCECADQQc2AgwMgwELIAEgBEYEQEHbACECDIMBCwJAIAEtAABBCWsOBAMAAAMACyABQQFqCyEBQc4AIQIMaAsgASAERgRAQdoAIQIMgQELIAEtAABBCWsOBAABAQABC0EAIQIgA0EANgIcIANBmhI2AhAgA0EHNgIMIAMgAUEBajYCFAx/CyADQYASOwEqQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2QA2AhwgAyABNgIUIANB6ho2AhAgA0EVNgIMQQAhAgx+C0HNACECDGQLIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDHwLIAEgBEYEQEHZACECDHwLIAEtAABBIEcNPSABQQFqIQEgAy0ALkEBcQ09IANBADYCHCADIAE2AhQgA0HCHDYCECADQR42AgxBACECDHsLIAEgBEYEQEHYACECDHsLAkACQAJAAkACQCABLQAAIgBBCmsOBAIDAwABCyABQQFqIQFBLCECDGULIABBOkcNASADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgx9CyABQQFqIQEgA0Evai0AAEEBcUUNcyADLQAyQYABcUUEQCADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALAkACQCAADhZNTEsBAQEBAQEBAQEBAQEBAQEBAQEAAQsgA0EpNgIcIAMgATYCFCADQawZNgIQIANBFTYCDEEAIQIMfgsgA0EANgIcIAMgATYCFCADQeULNgIQIANBETYCDEEAIQIMfQtBACEAAkAgAygCOCICRQ0AIAIoAlwiAkUNACADIAIRAAAhAAsgAEUNWSAAQRVHDQEgA0EFNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMfAtBywAhAgxiC0EAIQIgA0EANgIcIAMgATYCFCADQZAONgIQIANBFDYCDAx6CyADIAMvATJBgAFyOwEyDDsLIAEgBEcEQCADQRE2AgggAyABNgIEQcoAIQIMYAtB1wAhAgx4CyABIARGBEBB1gAhAgx4CwJAAkACQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxQeMAaw4TAEBAQEBAQEBAQEBAQAFAQEACA0ALIAFBAWohAUHGACECDGELIAFBAWohAUHHACECDGALIAFBAWohAUHIACECDF8LIAFBAWohAUHJACECDF4LQdUAIQIgBCABIgBGDXYgBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0IQQQgAUEFRg0KGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx2C0HUACECIAQgASIARg11IAQgAWsgAygCACIBaiEGIAAgAWtBD2ohBwNAIAFBgMgAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNB0EDIAFBD0YNCRogAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdQtB0wAhAiAEIAEiAEYNdCAEIAFrIAMoAgAiAWohBiAAIAFrQQ5qIQcDQCABQeLHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQYgAUEORg0HIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHQLQdIAIQIgBCABIgBGDXMgBCABayADKAIAIgFqIQUgACABa0EBaiEGA0AgAUHgxwBqLQAAIAAtAAAiB0EgciAHIAdBwQBrQf8BcUEaSRtB/wFxRw0FIAFBAUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBTYCAAxzCyABIARGBEBB0QAhAgxzCwJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB7gBrDgcAOTk5OTkBOQsgAUEBaiEBQcMAIQIMWgsgAUEBaiEBQcQAIQIMWQsgA0EANgIAIAZBAWohAUHFACECDFgLQdAAIQIgBCABIgBGDXAgBCABayADKAIAIgFqIQYgACABa0EJaiEHA0AgAUHWxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0CQQIgAUEJRg0EGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxwC0HPACECIAQgASIARg1vIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwNAIAFB0McAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQVGDQIgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMbwsgACEBIANBADYCAAwzC0EBCzoALCADQQA2AgAgB0EBaiEBC0EtIQIMUgsCQANAIAEtAABB0MUAai0AAEEBRw0BIAQgAUEBaiIBRw0AC0HNACECDGsLQcIAIQIMUQsgASAERgRAQcwAIQIMagsgAS0AAEE6RgRAIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0zIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMagsgA0EANgIcIAMgATYCFCADQecRNgIQIANBCjYCDEEAIQIMaQsCQAJAIAMtACxBAmsOAgABJwsgA0Ezai0AAEECcUUNJiADLQAuQQJxDSYgA0EANgIcIAMgATYCFCADQaYUNgIQIANBCzYCDEEAIQIMaQsgAy0AMkEgcUUNJSADLQAuQQJxDSUgA0EANgIcIAMgATYCFCADQb0TNgIQIANBDzYCDEEAIQIMaAtBACEAAkAgAygCOCICRQ0AIAIoAkgiAkUNACADIAIRAAAhAAsgAEUEQEHBACECDE8LIABBFUcEQCADQQA2AhwgAyABNgIUIANBpg82AhAgA0EcNgIMQQAhAgxoCyADQcoANgIcIAMgATYCFCADQYUcNgIQIANBFTYCDEEAIQIMZwsgASAERwRAA0AgAS0AAEHAwQBqLQAAQQFHDRcgBCABQQFqIgFHDQALQcQAIQIMZwtBxAAhAgxmCyABIARHBEADQAJAIAEtAAAiAEEgciAAIABBwQBrQf8BcUEaSRtB/wFxIgBBCUYNACAAQSBGDQACQAJAAkACQCAAQeMAaw4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUE2IQIMUgsgAUEBaiEBQTchAgxRCyABQQFqIQFBOCECDFALDBULIAQgAUEBaiIBRw0AC0E8IQIMZgtBPCECDGULIAEgBEYEQEHIACECDGULIANBEjYCCCADIAE2AgQCQAJAAkACQAJAIAMtACxBAWsOBBQAAQIJCyADLQAyQSBxDQNB4AEhAgxPCwJAIAMvATIiAEEIcUUNACADLQAoQQFHDQAgAy0ALkEIcUUNAgsgAyAAQff7A3FBgARyOwEyDAsLIAMgAy8BMkEQcjsBMgwECyADQQA2AgQgAyABIAEQMSIABEAgA0HBADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxmCyABQQFqIQEMWAsgA0EANgIcIAMgATYCFCADQfQTNgIQIANBBDYCDEEAIQIMZAtBxwAhAiABIARGDWMgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCAAQcDFAGotAAAgAS0AAEEgckcNASAAQQZGDUogAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMZAsgA0EANgIADAULAkAgASAERwRAA0AgAS0AAEHAwwBqLQAAIgBBAUcEQCAAQQJHDQMgAUEBaiEBDAULIAQgAUEBaiIBRw0AC0HFACECDGQLQcUAIQIMYwsLIANBADoALAwBC0ELIQIMRwtBPyECDEYLAkACQANAIAEtAAAiAEEgRwRAAkAgAEEKaw4EAwUFAwALIABBLEYNAwwECyAEIAFBAWoiAUcNAAtBxgAhAgxgCyADQQg6ACwMDgsgAy0AKEEBRw0CIAMtAC5BCHENAiADKAIEIQAgA0EANgIEIAMgACABEDEiAARAIANBwgA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMXwsgAUEBaiEBDFALQTshAgxECwJAA0AgAS0AACIAQSBHIABBCUdxDQEgBCABQQFqIgFHDQALQcMAIQIMXQsLQTwhAgxCCwJAAkAgASAERwRAA0AgAS0AACIAQSBHBEAgAEEKaw4EAwQEAwQLIAQgAUEBaiIBRw0AC0E/IQIMXQtBPyECDFwLIAMgAy8BMkEgcjsBMgwKCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNTiADQT42AhwgAyABNgIUIAMgADYCDEEAIQIMWgsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkYNAwwMCyAEIAFBAWoiAUcNAAtBNyECDFsLQTchAgxaCyABQQFqIQEMBAtBOyECIAQgASIARg1YIAQgAWsgAygCACIBaiEGIAAgAWtBBWohBwJAA0AgAUGQyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYEQEEHIQEMPwsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMWQsgA0EANgIAIAAhAQwFC0E6IQIgBCABIgBGDVcgBCABayADKAIAIgFqIQYgACABa0EIaiEHAkADQCABQbTBAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEIRgRAQQUhAQw+CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxYCyADQQA2AgAgACEBDAQLQTkhAiAEIAEiAEYNViAEIAFrIAMoAgAiAWohBiAAIAFrQQNqIQcCQANAIAFBsMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQNGBEBBBiEBDD0LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFcLIANBADYCACAAIQEMAwsCQANAIAEtAAAiAEEgRwRAIABBCmsOBAcEBAcCCyAEIAFBAWoiAUcNAAtBOCECDFYLIABBLEcNASABQQFqIQBBASEBAkACQAJAAkACQCADLQAsQQVrDgQDAQIEAAsgACEBDAQLQQIhAQwBC0EEIQELIANBAToALCADIAMvATIgAXI7ATIgACEBDAELIAMgAy8BMkEIcjsBMiAAIQELQT4hAgw7CyADQQA6ACwLQTkhAgw5CyABIARGBEBBNiECDFILAkACQAJAAkACQCABLQAAQQprDgQAAgIBAgsgAygCBCEAIANBADYCBCADIAAgARAxIgBFDQIgA0EzNgIcIAMgATYCFCADIAA2AgxBACECDFULIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQRAIAFBAWohAQwGCyADQTI2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMVAsgAy0ALkEBcQRAQd8BIQIMOwsgAygCBCEAIANBADYCBCADIAAgARAxIgANAQxJC0E0IQIMOQsgA0E1NgIcIAMgATYCFCADIAA2AgxBACECDFELQTUhAgw3CyADQS9qLQAAQQFxDQAgA0EANgIcIAMgATYCFCADQesWNgIQIANBGTYCDEEAIQIMTwtBMyECDDULIAEgBEYEQEEyIQIMTgsCQCABLQAAQQpGBEAgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GSFzYCECADQQM2AgxBACECDE4LQTIhAgw0CyABIARGBEBBMSECDE0LAkAgAS0AACIAQQlGDQAgAEEgRg0AQQEhAgJAIAMtACxBBWsOBAYEBQANCyADIAMvATJBCHI7ATIMDAsgAy0ALkEBcUUNASADLQAsQQhHDQAgA0EAOgAsC0E9IQIMMgsgA0EANgIcIAMgATYCFCADQcIWNgIQIANBCjYCDEEAIQIMSgtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgwGCyABIARGBEBBMCECDEcLIAEtAABBCkYEQCABQQFqIQEMAQsgAy0ALkEBcQ0AIANBADYCHCADIAE2AhQgA0HcKDYCECADQQI2AgxBACECDEYLQTAhAgwsCyABQQFqIQFBMSECDCsLIAEgBEYEQEEvIQIMRAsgAS0AACIAQQlHIABBIEdxRQRAIAFBAWohASADLQAuQQFxDQEgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDEEAIQIMRAtBASECAkACQAJAAkACQAJAIAMtACxBAmsOBwUEBAMBAgAECyADIAMvATJBCHI7ATIMAwtBAiECDAELQQQhAgsgA0EBOgAsIAMgAy8BMiACcjsBMgtBLyECDCsLIANBADYCHCADIAE2AhQgA0GEEzYCECADQQs2AgxBACECDEMLQeEBIQIMKQsgASAERgRAQS4hAgxCCyADQQA2AgQgA0ESNgIIIAMgASABEDEiAA0BC0EuIQIMJwsgA0EtNgIcIAMgATYCFCADIAA2AgxBACECDD8LQQAhAAJAIAMoAjgiAkUNACACKAJMIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB2AA2AhwgAyABNgIUIANBsxs2AhAgA0EVNgIMQQAhAgw+C0HMACECDCQLIANBADYCHCADIAE2AhQgA0GzDjYCECADQR02AgxBACECDDwLIAEgBEYEQEHOACECDDwLIAEtAAAiAEEgRg0CIABBOkYNAQsgA0EAOgAsQQkhAgwhCyADKAIEIQAgA0EANgIEIAMgACABEDAiAA0BDAILIAMtAC5BAXEEQEHeASECDCALIAMoAgQhACADQQA2AgQgAyAAIAEQMCIARQ0CIANBKjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgw4CyADQcsANgIcIAMgADYCDCADIAFBAWo2AhRBACECDDcLIAFBAWohAUHAACECDB0LIAFBAWohAQwsCyABIARGBEBBKyECDDULAkAgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQcAAcUUNBgsgAy0AMkGAAXEEQEEAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ0SIABBFUYEQCADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgw2CyADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMQQAhAgw1CyADQTJqIQIgAxA1QQAhAAJAIAMoAjgiBkUNACAGKAIoIgZFDQAgAyAGEQAAIQALIAAOFgIBAAQEBAQEBAQEBAQEBAQEBAQEBAMECyADQQE6ADALIAIgAi8BAEHAAHI7AQALQSshAgwYCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgwwCyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgwvCyADQQA2AhwgAyABNgIUIANBpQs2AhAgA0ECNgIMQQAhAgwuC0EBIQcgAy8BMiIFQQhxRQRAIAMpAyBCAFIhBwsCQCADLQAwBEBBASEAIAMtAClBBUYNASAFQcAAcUUgB3FFDQELAkAgAy0AKCICQQJGBEBBASEAIAMvATQiBkHlAEYNAkEAIQAgBUHAAHENAiAGQeQARg0CIAZB5gBrQQJJDQIgBkHMAUYNAiAGQbACRg0CDAELQQAhACAFQcAAcQ0BC0ECIQAgBUEIcQ0AIAVBgARxBEACQCACQQFHDQAgAy0ALkEKcQ0AQQUhAAwCC0EEIQAMAQsgBUEgcUUEQCADEDZBAEdBAnQhAAwBC0EAQQMgAykDIFAbIQALIABBAWsOBQIABwEDBAtBESECDBMLIANBAToAMQwpC0EAIQICQCADKAI4IgBFDQAgACgCMCIARQ0AIAMgABEAACECCyACRQ0mIAJBFUYEQCADQQM2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwrC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAwqCyADQQA2AhwgAyABNgIUIANB+SA2AhAgA0EPNgIMQQAhAgwpC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAADQELQQ4hAgwOCyAAQRVGBEAgA0ECNgIcIAMgATYCFCADQdIbNgIQIANBFTYCDEEAIQIMJwsgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDEEAIQIMJgtBKiECDAwLIAEgBEcEQCADQQk2AgggAyABNgIEQSkhAgwMC0EmIQIMJAsgAyADKQMgIgwgBCABa60iCn0iC0IAIAsgDFgbNwMgIAogDFQEQEElIQIMJAsgAygCBCEAIANBADYCBCADIAAgASAMp2oiARAyIgBFDQAgA0EFNgIcIAMgATYCFCADIAA2AgxBACECDCMLQQ8hAgwJC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FxYAAQIDBAUGBxQUFBQUFBQICQoLDA0UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFA4PEBESExQLQgIhCgwWC0IDIQoMFQtCBCEKDBQLQgUhCgwTC0IGIQoMEgtCByEKDBELQgghCgwQC0IJIQoMDwtCCiEKDA4LQgshCgwNC0IMIQoMDAtCDSEKDAsLQg4hCgwKC0IPIQoMCQtCCiEKDAgLQgshCgwHC0IMIQoMBgtCDSEKDAULQg4hCgwEC0IPIQoMAwsgA0EANgIcIAMgATYCFCADQZ8VNgIQIANBDDYCDEEAIQIMIQsgASAERgRAQSIhAgwhC0IAIQoCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAEtAABBMGsONxUUAAECAwQFBgcWFhYWFhYWCAkKCwwNFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYODxAREhMWC0ICIQoMFAtCAyEKDBMLQgQhCgwSC0IFIQoMEQtCBiEKDBALQgchCgwPC0IIIQoMDgtCCSEKDA0LQgohCgwMC0ILIQoMCwtCDCEKDAoLQg0hCgwJC0IOIQoMCAtCDyEKDAcLQgohCgwGC0ILIQoMBQtCDCEKDAQLQg0hCgwDC0IOIQoMAgtCDyEKDAELQgEhCgsgAUEBaiEBIAMpAyAiC0L//////////w9YBEAgAyALQgSGIAqENwMgDAILIANBADYCHCADIAE2AhQgA0G1CTYCECADQQw2AgxBACECDB4LQSchAgwEC0EoIQIMAwsgAyABOgAsIANBADYCACAHQQFqIQFBDCECDAILIANBADYCACAGQQFqIQFBCiECDAELIAFBAWohAUEIIQIMAAsAC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwXC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwWC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwVC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwUC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwTC0EAIQIgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDAwSC0EAIQIgA0EANgIcIAMgATYCFCADQYMRNgIQIANBCTYCDAwRC0EAIQIgA0EANgIcIAMgATYCFCADQd8KNgIQIANBCTYCDAwQC0EAIQIgA0EANgIcIAMgATYCFCADQe0QNgIQIANBCTYCDAwPC0EAIQIgA0EANgIcIAMgATYCFCADQdIRNgIQIANBCTYCDAwOC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwNC0EAIQIgA0EANgIcIAMgATYCFCADQbkXNgIQIANBDzYCDAwMC0EAIQIgA0EANgIcIAMgATYCFCADQZkTNgIQIANBCzYCDAwLC0EAIQIgA0EANgIcIAMgATYCFCADQZ0JNgIQIANBCzYCDAwKC0EAIQIgA0EANgIcIAMgATYCFCADQZcQNgIQIANBCjYCDAwJC0EAIQIgA0EANgIcIAMgATYCFCADQbEQNgIQIANBCjYCDAwIC0EAIQIgA0EANgIcIAMgATYCFCADQbsdNgIQIANBAjYCDAwHC0EAIQIgA0EANgIcIAMgATYCFCADQZYWNgIQIANBAjYCDAwGC0EAIQIgA0EANgIcIAMgATYCFCADQfkYNgIQIANBAjYCDAwFC0EAIQIgA0EANgIcIAMgATYCFCADQcQYNgIQIANBAjYCDAwECyADQQI2AhwgAyABNgIUIANBqR42AhAgA0EWNgIMQQAhAgwDC0HeACECIAEgBEYNAiAJQQhqIQcgAygCACEFAkACQCABIARHBEAgBUGWyABqIQggBCAFaiABayEGIAVBf3NBCmoiBSABaiEAA0AgAS0AACAILQAARwRAQQIhCAwDCyAFRQRAQQAhCCAAIQEMAwsgBUEBayEFIAhBAWohCCAEIAFBAWoiAUcNAAsgBiEFIAQhAQsgB0EBNgIAIAMgBTYCAAwBCyADQQA2AgAgByAINgIACyAHIAE2AgQgCSgCDCEAAkACQCAJKAIIQQFrDgIEAQALIANBADYCHCADQcIeNgIQIANBFzYCDCADIABBAWo2AhRBACECDAMLIANBADYCHCADIAA2AhQgA0HXHjYCECADQQk2AgxBACECDAILIAEgBEYEQEEoIQIMAgsgA0EJNgIIIAMgATYCBEEnIQIMAQsgASAERgRAQQEhAgwBCwNAAkACQAJAIAEtAABBCmsOBAABAQABCyABQQFqIQEMAQsgAUEBaiEBIAMtAC5BIHENAEEAIQIgA0EANgIcIAMgATYCFCADQaEhNgIQIANBBTYCDAwCC0EBIQIgASAERw0ACwsgCUEQaiQAIAJFBEAgAygCDCEADAELIAMgAjYCHEEAIQAgAygCBCIBRQ0AIAMgASAEIAMoAggRAQAiAUUNACADIAQ2AhQgAyABNgIMIAEhAAsgAAu+AgECfyAAQQA6AAAgAEHkAGoiAUEBa0EAOgAAIABBADoAAiAAQQA6AAEgAUEDa0EAOgAAIAFBAmtBADoAACAAQQA6AAMgAUEEa0EAOgAAQQAgAGtBA3EiASAAaiIAQQA2AgBB5AAgAWtBfHEiAiAAaiIBQQRrQQA2AgACQCACQQlJDQAgAEEANgIIIABBADYCBCABQQhrQQA2AgAgAUEMa0EANgIAIAJBGUkNACAAQQA2AhggAEEANgIUIABBADYCECAAQQA2AgwgAUEQa0EANgIAIAFBFGtBADYCACABQRhrQQA2AgAgAUEca0EANgIAIAIgAEEEcUEYciICayIBQSBJDQAgACACaiEAA0AgAEIANwMYIABCADcDECAAQgA3AwggAEIANwMAIABBIGohACABQSBrIgFBH0sNAAsLC1YBAX8CQCAAKAIMDQACQAJAAkACQCAALQAxDgMBAAMCCyAAKAI4IgFFDQAgASgCMCIBRQ0AIAAgAREAACIBDQMLQQAPCwALIABByhk2AhBBDiEBCyABCxoAIAAoAgxFBEAgAEHeHzYCECAAQRU2AgwLCxQAIAAoAgxBFUYEQCAAQQA2AgwLCxQAIAAoAgxBFkYEQCAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsrAAJAIABBJ08NAEL//////wkgAK2IQgGDUA0AIABBAnRB0DhqKAIADwsACxcAIABBL08EQAALIABBAnRB7DlqKAIAC78JAQF/QfQtIQECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQeQAaw70A2NiAAFhYWFhYWECAwQFYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYQYHCAkKCwwNDg9hYWFhYRBhYWFhYWFhYWFhYRFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWESExQVFhcYGRobYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1NmE3ODk6YWFhYWFhYWE7YWFhPGFhYWE9Pj9hYWFhYWFhYUBhYUFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFCQ0RFRkdISUpLTE1OT1BRUlNhYWFhYWFhYVRVVldYWVpbYVxdYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhXmFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYV9gYQtB6iwPC0GYJg8LQe0xDwtBoDcPC0HJKQ8LQbQpDwtBli0PC0HrKw8LQaI1DwtB2zQPC0HgKQ8LQeMkDwtB1SQPC0HuJA8LQeYlDwtByjQPC0HQNw8LQao1DwtB9SwPC0H2Jg8LQYIiDwtB8jMPC0G+KA8LQec3DwtBzSEPC0HAIQ8LQbglDwtByyUPC0GWJA8LQY80DwtBzTUPC0HdKg8LQe4zDwtBnDQPC0GeMQ8LQfQ1DwtB5SIPC0GvJQ8LQZkxDwtBsjYPC0H5Ng8LQcQyDwtB3SwPC0GCMQ8LQcExDwtBjTcPC0HJJA8LQew2DwtB5yoPC0HIIw8LQeIhDwtByTcPC0GlIg8LQZQiDwtB2zYPC0HeNQ8LQYYmDwtBvCsPC0GLMg8LQaAjDwtB9jAPC0GALA8LQYkrDwtBpCYPC0HyIw8LQYEoDwtBqzIPC0HrJw8LQcI2DwtBoiQPC0HPKg8LQdwjDwtBhycPC0HkNA8LQbciDwtBrTEPC0HVIg8LQa80DwtB3iYPC0HWMg8LQfQ0DwtBgTgPC0H0Nw8LQZI2DwtBnScPC0GCKQ8LQY0jDwtB1zEPC0G9NQ8LQbQ3DwtB2DAPC0G2Jw8LQZo4DwtBpyoPC0HEJw8LQa4jDwtB9SIPCwALQcomIQELIAELFwAgACAALwEuQf7/A3EgAUEAR3I7AS4LGgAgACAALwEuQf3/A3EgAUEAR0EBdHI7AS4LGgAgACAALwEuQfv/A3EgAUEAR0ECdHI7AS4LGgAgACAALwEuQff/A3EgAUEAR0EDdHI7AS4LGgAgACAALwEuQe//A3EgAUEAR0EEdHI7AS4LGgAgACAALwEuQd//A3EgAUEAR0EFdHI7AS4LGgAgACAALwEuQb//A3EgAUEAR0EGdHI7AS4LGgAgACAALwEuQf/+A3EgAUEAR0EHdHI7AS4LGgAgACAALwEuQf/9A3EgAUEAR0EIdHI7AS4LGgAgACAALwEuQf/7A3EgAUEAR0EJdHI7AS4LPgECfwJAIAAoAjgiA0UNACADKAIEIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHhEjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIIIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH8ETYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIMIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHsCjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIQIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH6HjYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIUIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHLEDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIYIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG3HzYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIcIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEG/FTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIsIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEH+CDYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIgIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEGMHTYCEEEYIQQLIAQLPgECfwJAIAAoAjgiA0UNACADKAIkIgNFDQAgACABIAIgAWsgAxEBACIEQX9HDQAgAEHmFTYCEEEYIQQLIAQLOAAgAAJ/IAAvATJBFHFBFEYEQEEBIAAtAChBAUYNARogAC8BNEHlAEYMAQsgAC0AKUEFRgs6ADALWQECfwJAIAAtAChBAUYNACAALwE0IgFB5ABrQeQASQ0AIAFBzAFGDQAgAUGwAkYNACAALwEyIgBBwABxDQBBASECIABBiARxQYAERg0AIABBKHFFIQILIAILjAEBAn8CQAJAAkAgAC0AKkUNACAALQArRQ0AIAAvATIiAUECcUUNAQwCCyAALwEyIgFBAXFFDQELQQEhAiAALQAoQQFGDQAgAC8BNCIAQeQAa0HkAEkNACAAQcwBRg0AIABBsAJGDQAgAUHAAHENAEEAIQIgAUGIBHFBgARGDQAgAUEocUEARyECCyACC1cAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",grr;Object.defineProperty(tFn,"exports",{get:a(()=>grr||(grr=JCs.from(ZCs,"base64")),"get")})});var nFn=I((qJd,rFn)=>{"use strict";p();var{Buffer:XCs}=require("node:buffer"),ebs="AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAn9/AGABfwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAzU0BQYAAAMAAAAAAAADAQMAAwMDAAACAAAAAAICAgICAgICAgIBAQEBAQEBAQEBAwAAAwAAAAQFAXABExMFAwEAAgYIAX8BQcDZBAsHxQcoBm1lbW9yeQIAC19pbml0aWFsaXplAAgZX19pbmRpcmVjdF9mdW5jdGlvbl90YWJsZQEAC2xsaHR0cF9pbml0AAkYbGxodHRwX3Nob3VsZF9rZWVwX2FsaXZlADcMbGxodHRwX2FsbG9jAAsGbWFsbG9jADkLbGxodHRwX2ZyZWUADARmcmVlAAwPbGxodHRwX2dldF90eXBlAA0VbGxodHRwX2dldF9odHRwX21ham9yAA4VbGxodHRwX2dldF9odHRwX21pbm9yAA8RbGxodHRwX2dldF9tZXRob2QAEBZsbGh0dHBfZ2V0X3N0YXR1c19jb2RlABESbGxodHRwX2dldF91cGdyYWRlABIMbGxodHRwX3Jlc2V0ABMObGxodHRwX2V4ZWN1dGUAFBRsbGh0dHBfc2V0dGluZ3NfaW5pdAAVDWxsaHR0cF9maW5pc2gAFgxsbGh0dHBfcGF1c2UAFw1sbGh0dHBfcmVzdW1lABgbbGxodHRwX3Jlc3VtZV9hZnRlcl91cGdyYWRlABkQbGxodHRwX2dldF9lcnJubwAaF2xsaHR0cF9nZXRfZXJyb3JfcmVhc29uABsXbGxodHRwX3NldF9lcnJvcl9yZWFzb24AHBRsbGh0dHBfZ2V0X2Vycm9yX3BvcwAdEWxsaHR0cF9lcnJub19uYW1lAB4SbGxodHRwX21ldGhvZF9uYW1lAB8SbGxodHRwX3N0YXR1c19uYW1lACAabGxodHRwX3NldF9sZW5pZW50X2hlYWRlcnMAISFsbGh0dHBfc2V0X2xlbmllbnRfY2h1bmtlZF9sZW5ndGgAIh1sbGh0dHBfc2V0X2xlbmllbnRfa2VlcF9hbGl2ZQAjJGxsaHR0cF9zZXRfbGVuaWVudF90cmFuc2Zlcl9lbmNvZGluZwAkGmxsaHR0cF9zZXRfbGVuaWVudF92ZXJzaW9uACUjbGxodHRwX3NldF9sZW5pZW50X2RhdGFfYWZ0ZXJfY2xvc2UAJidsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfbGZfYWZ0ZXJfY3IAJyxsbGh0dHBfc2V0X2xlbmllbnRfb3B0aW9uYWxfY3JsZl9hZnRlcl9jaHVuawAoKGxsaHR0cF9zZXRfbGVuaWVudF9vcHRpb25hbF9jcl9iZWZvcmVfbGYAKSpsbGh0dHBfc2V0X2xlbmllbnRfc3BhY2VzX2FmdGVyX2NodW5rX3NpemUAKhhsbGh0dHBfbWVzc2FnZV9uZWVkc19lb2YANgkYAQBBAQsSAQIDBAUKBgcyNDMuKy8tLDAxCuzaAjQWAEHA1QAoAgAEQAALQcDVAEEBNgIACxQAIAAQOCAAIAI2AjggACABOgAoCxQAIAAgAC8BNCAALQAwIAAQNxAACx4BAX9BwAAQOiIBEDggAUGACDYCOCABIAA6ACggAQuPDAEHfwJAIABFDQAgAEEIayIBIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgASABKAIAIgBrIgFB1NUAKAIASQ0BIAAgBGohBAJAAkBB2NUAKAIAIAFHBEAgAEH/AU0EQCAAQQN2IQMgASgCCCIAIAEoAgwiAkYEQEHE1QBBxNUAKAIAQX4gA3dxNgIADAULIAIgADYCCCAAIAI2AgwMBAsgASgCGCEGIAEgASgCDCIARwRAIAAgASgCCCICNgIIIAIgADYCDAwDCyABQRRqIgMoAgAiAkUEQCABKAIQIgJFDQIgAUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSgCBCIAQQNxQQNHDQIgBSAAQX5xNgIEQczVACAENgIAIAUgBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgASgCHCICQQJ0QfTXAGoiAygCACABRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAFGG2ogADYCACAARQ0BCyAAIAY2AhggASgCECICBEAgACACNgIQIAIgADYCGAsgAUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBU8NACAFKAIEIgBBAXFFDQACQAJAAkACQCAAQQJxRQRAQdzVACgCACAFRgRAQdzVACABNgIAQdDVAEHQ1QAoAgAgBGoiADYCACABIABBAXI2AgQgAUHY1QAoAgBHDQZBzNUAQQA2AgBB2NUAQQA2AgAMBgtB2NUAKAIAIAVGBEBB2NUAIAE2AgBBzNUAQczVACgCACAEaiIANgIAIAEgAEEBcjYCBCAAIAFqIAA2AgAMBgsgAEF4cSAEaiEEIABB/wFNBEAgAEEDdiEDIAUoAggiACAFKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwFCyACIAA2AgggACACNgIMDAQLIAUoAhghBiAFIAUoAgwiAEcEQEHU1QAoAgAaIAAgBSgCCCICNgIIIAIgADYCDAwDCyAFQRRqIgMoAgAiAkUEQCAFKAIQIgJFDQIgBUEQaiEDCwNAIAMhByACIgBBFGoiAygCACICDQAgAEEQaiEDIAAoAhAiAg0ACyAHQQA2AgAMAgsgBSAAQX5xNgIEIAEgBGogBDYCACABIARBAXI2AgQMAwtBACEACyAGRQ0AAkAgBSgCHCICQQJ0QfTXAGoiAygCACAFRgRAIAMgADYCACAADQFByNUAQcjVACgCAEF+IAJ3cTYCAAwCCyAGQRBBFCAGKAIQIAVGG2ogADYCACAARQ0BCyAAIAY2AhggBSgCECICBEAgACACNgIQIAIgADYCGAsgBUEUaigCACICRQ0AIABBFGogAjYCACACIAA2AhgLIAEgBGogBDYCACABIARBAXI2AgQgAUHY1QAoAgBHDQBBzNUAIAQ2AgAMAQsgBEH/AU0EQCAEQXhxQezVAGohAAJ/QcTVACgCACICQQEgBEEDdnQiA3FFBEBBxNUAIAIgA3I2AgAgAAwBCyAAKAIICyICIAE2AgwgACABNgIIIAEgADYCDCABIAI2AggMAQtBHyECIARB////B00EQCAEQSYgBEEIdmciAGt2QQFxIABBAXRrQT5qIQILIAEgAjYCHCABQgA3AhAgAkECdEH01wBqIQACQEHI1QAoAgAiA0EBIAJ0IgdxRQRAIAAgATYCAEHI1QAgAyAHcjYCACABIAA2AhggASABNgIIIAEgATYCDAwBCyAEQRkgAkEBdmtBACACQR9HG3QhAiAAKAIAIQACQANAIAAiAygCBEF4cSAERg0BIAJBHXYhACACQQF0IQIgAyAAQQRxakEQaiIHKAIAIgANAAsgByABNgIAIAEgAzYCGCABIAE2AgwgASABNgIIDAELIAMoAggiACABNgIMIAMgATYCCCABQQA2AhggASADNgIMIAEgADYCCAtB5NUAQeTVACgCAEEBayIAQX8gABs2AgALCwcAIAAtACgLBwAgAC0AKgsHACAALQArCwcAIAAtACkLBwAgAC8BNAsHACAALQAwC0ABBH8gACgCGCEBIAAvAS4hAiAALQAoIQMgACgCOCEEIAAQOCAAIAQ2AjggACADOgAoIAAgAjsBLiAAIAE2AhgLhocCAwd/A34BeyABIAJqIQQCQCAAIgMoAgwiAA0AIAMoAgQEQCADIAE2AgQLIwBBEGsiCSQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKAIcIgJBAmsO/AEB+QECAwQFBgcICQoLDA0ODxAREvgBE/cBFBX2ARYX9QEYGRobHB0eHyD9AfsBIfQBIiMkJSYnKCkqK/MBLC0uLzAxMvIB8QEzNPAB7wE1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk/6AVBRUlPuAe0BVOwBVesBVldYWVrqAVtcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AAYEBggGDAYQBhQGGAYcBiAGJAYoBiwGMAY0BjgGPAZABkQGSAZMBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAekB6AHPAecB0AHmAdEB0gHTAdQB5QHVAdYB1wHYAdkB2gHbAdwB3QHeAd8B4AHhAeIB4wEA/AELQQAM4wELQQ4M4gELQQ0M4QELQQ8M4AELQRAM3wELQRMM3gELQRQM3QELQRUM3AELQRYM2wELQRcM2gELQRgM2QELQRkM2AELQRoM1wELQRsM1gELQRwM1QELQR0M1AELQR4M0wELQR8M0gELQSAM0QELQSEM0AELQQgMzwELQSIMzgELQSQMzQELQSMMzAELQQcMywELQSUMygELQSYMyQELQScMyAELQSgMxwELQRIMxgELQREMxQELQSkMxAELQSoMwwELQSsMwgELQSwMwQELQd4BDMABC0EuDL8BC0EvDL4BC0EwDL0BC0ExDLwBC0EyDLsBC0EzDLoBC0E0DLkBC0HfAQy4AQtBNQy3AQtBOQy2AQtBDAy1AQtBNgy0AQtBNwyzAQtBOAyyAQtBPgyxAQtBOgywAQtB4AEMrwELQQsMrgELQT8MrQELQTsMrAELQQoMqwELQTwMqgELQT0MqQELQeEBDKgBC0HBAAynAQtBwAAMpgELQcIADKUBC0EJDKQBC0EtDKMBC0HDAAyiAQtBxAAMoQELQcUADKABC0HGAAyfAQtBxwAMngELQcgADJ0BC0HJAAycAQtBygAMmwELQcsADJoBC0HMAAyZAQtBzQAMmAELQc4ADJcBC0HPAAyWAQtB0AAMlQELQdEADJQBC0HSAAyTAQtB0wAMkgELQdUADJEBC0HUAAyQAQtB1gAMjwELQdcADI4BC0HYAAyNAQtB2QAMjAELQdoADIsBC0HbAAyKAQtB3AAMiQELQd0ADIgBC0HeAAyHAQtB3wAMhgELQeAADIUBC0HhAAyEAQtB4gAMgwELQeMADIIBC0HkAAyBAQtB5QAMgAELQeIBDH8LQeYADH4LQecADH0LQQYMfAtB6AAMewtBBQx6C0HpAAx5C0EEDHgLQeoADHcLQesADHYLQewADHULQe0ADHQLQQMMcwtB7gAMcgtB7wAMcQtB8AAMcAtB8gAMbwtB8QAMbgtB8wAMbQtB9AAMbAtB9QAMawtB9gAMagtBAgxpC0H3AAxoC0H4AAxnC0H5AAxmC0H6AAxlC0H7AAxkC0H8AAxjC0H9AAxiC0H+AAxhC0H/AAxgC0GAAQxfC0GBAQxeC0GCAQxdC0GDAQxcC0GEAQxbC0GFAQxaC0GGAQxZC0GHAQxYC0GIAQxXC0GJAQxWC0GKAQxVC0GLAQxUC0GMAQxTC0GNAQxSC0GOAQxRC0GPAQxQC0GQAQxPC0GRAQxOC0GSAQxNC0GTAQxMC0GUAQxLC0GVAQxKC0GWAQxJC0GXAQxIC0GYAQxHC0GZAQxGC0GaAQxFC0GbAQxEC0GcAQxDC0GdAQxCC0GeAQxBC0GfAQxAC0GgAQw/C0GhAQw+C0GiAQw9C0GjAQw8C0GkAQw7C0GlAQw6C0GmAQw5C0GnAQw4C0GoAQw3C0GpAQw2C0GqAQw1C0GrAQw0C0GsAQwzC0GtAQwyC0GuAQwxC0GvAQwwC0GwAQwvC0GxAQwuC0GyAQwtC0GzAQwsC0G0AQwrC0G1AQwqC0G2AQwpC0G3AQwoC0G4AQwnC0G5AQwmC0G6AQwlC0G7AQwkC0G8AQwjC0G9AQwiC0G+AQwhC0G/AQwgC0HAAQwfC0HBAQweC0HCAQwdC0EBDBwLQcMBDBsLQcQBDBoLQcUBDBkLQcYBDBgLQccBDBcLQcgBDBYLQckBDBULQcoBDBQLQcsBDBMLQcwBDBILQc0BDBELQc4BDBALQc8BDA8LQdABDA4LQdEBDA0LQdIBDAwLQdMBDAsLQdQBDAoLQdUBDAkLQdYBDAgLQeMBDAcLQdcBDAYLQdgBDAULQdkBDAQLQdoBDAMLQdsBDAILQd0BDAELQdwBCyECA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAMCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAn8CQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAwJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACDuMBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISMkJScoKZ4DmwOaA5EDigODA4AD/QL7AvgC8gLxAu8C7QLoAucC5gLlAuQC3ALbAtoC2QLYAtcC1gLVAs8CzgLMAssCygLJAsgCxwLGAsQCwwK+ArwCugK5ArgCtwK2ArUCtAKzArICsQKwAq4CrQKpAqgCpwKmAqUCpAKjAqICoQKgAp8CmAKQAowCiwKKAoEC/gH9AfwB+wH6AfkB+AH3AfUB8wHwAesB6QHoAecB5gHlAeQB4wHiAeEB4AHfAd4B3QHcAdoB2QHYAdcB1gHVAdQB0wHSAdEB0AHPAc4BzQHMAcsBygHJAcgBxwHGAcUBxAHDAcIBwQHAAb8BvgG9AbwBuwG6AbkBuAG3AbYBtQG0AbMBsgGxAbABrwGuAa0BrAGrAaoBqQGoAacBpgGlAaQBowGiAZ8BngGZAZgBlwGWAZUBlAGTAZIBkQGQAY8BjQGMAYcBhgGFAYQBgwGCAX18e3p5dnV0UFFSU1RVCyABIARHDXJB/QEhAgy+AwsgASAERw2YAUHbASECDL0DCyABIARHDfEBQY4BIQIMvAMLIAEgBEcN/AFBhAEhAgy7AwsgASAERw2KAkH/ACECDLoDCyABIARHDZECQf0AIQIMuQMLIAEgBEcNlAJB+wAhAgy4AwsgASAERw0eQR4hAgy3AwsgASAERw0ZQRghAgy2AwsgASAERw3KAkHNACECDLUDCyABIARHDdUCQcYAIQIMtAMLIAEgBEcN1gJBwwAhAgyzAwsgASAERw3cAkE4IQIMsgMLIAMtADBBAUYNrQMMiQMLQQAhAAJAAkACQCADLQAqRQ0AIAMtACtFDQAgAy8BMiICQQJxRQ0BDAILIAMvATIiAkEBcUUNAQtBASEAIAMtAChBAUYNACADLwE0IgZB5ABrQeQASQ0AIAZBzAFGDQAgBkGwAkYNACACQcAAcQ0AQQAhACACQYgEcUGABEYNACACQShxQQBHIQALIANBADsBMiADQQA6ADECQCAARQRAIANBADoAMSADLQAuQQRxDQEMsQMLIANCADcDIAsgA0EAOgAxIANBAToANgxIC0EAIQACQCADKAI4IgJFDQAgAigCMCICRQ0AIAMgAhEAACEACyAARQ1IIABBFUcNYiADQQQ2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgyvAwsgASAERgRAQQYhAgyvAwsgAS0AAEEKRw0ZIAFBAWohAQwaCyADQgA3AyBBEiECDJQDCyABIARHDYoDQSMhAgysAwsgASAERgRAQQchAgysAwsCQAJAIAEtAABBCmsOBAEYGAAYCyABQQFqIQFBECECDJMDCyABQQFqIQEgA0Evai0AAEEBcQ0XQQAhAiADQQA2AhwgAyABNgIUIANBmSA2AhAgA0EZNgIMDKsDCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMWg0YQQghAgyqAwsgASAERwRAIANBCTYCCCADIAE2AgRBFCECDJEDC0EJIQIMqQMLIAMpAyBQDa4CDEMLIAEgBEYEQEELIQIMqAMLIAEtAABBCkcNFiABQQFqIQEMFwsgA0Evai0AAEEBcUUNGQwmC0EAIQACQCADKAI4IgJFDQAgAigCUCICRQ0AIAMgAhEAACEACyAADRkMQgtBACEAAkAgAygCOCICRQ0AIAIoAlAiAkUNACADIAIRAAAhAAsgAA0aDCQLQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANGwwyCyADQS9qLQAAQQFxRQ0cDCILQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANHAxCC0EAIQACQCADKAI4IgJFDQAgAigCVCICRQ0AIAMgAhEAACEACyAADR0MIAsgASAERgRAQRMhAgygAwsCQCABLQAAIgBBCmsOBB8jIwAiCyABQQFqIQEMHwtBACEAAkAgAygCOCICRQ0AIAIoAlQiAkUNACADIAIRAAAhAAsgAA0iDEILIAEgBEYEQEEWIQIMngMLIAEtAABBwMEAai0AAEEBRw0jDIMDCwJAA0AgAS0AAEGwO2otAAAiAEEBRwRAAkAgAEECaw4CAwAnCyABQQFqIQFBISECDIYDCyAEIAFBAWoiAUcNAAtBGCECDJ0DCyADKAIEIQBBACECIANBADYCBCADIAAgAUEBaiIBEDQiAA0hDEELQQAhAAJAIAMoAjgiAkUNACACKAJUIgJFDQAgAyACEQAAIQALIAANIwwqCyABIARGBEBBHCECDJsDCyADQQo2AgggAyABNgIEQQAhAAJAIAMoAjgiAkUNACACKAJQIgJFDQAgAyACEQAAIQALIAANJUEkIQIMgQMLIAEgBEcEQANAIAEtAABBsD1qLQAAIgBBA0cEQCAAQQFrDgUYGiaCAyUmCyAEIAFBAWoiAUcNAAtBGyECDJoDC0EbIQIMmQMLA0AgAS0AAEGwP2otAAAiAEEDRwRAIABBAWsOBQ8RJxMmJwsgBCABQQFqIgFHDQALQR4hAgyYAwsgASAERwRAIANBCzYCCCADIAE2AgRBByECDP8CC0EfIQIMlwMLIAEgBEYEQEEgIQIMlwMLAkAgAS0AAEENaw4ULj8/Pz8/Pz8/Pz8/Pz8/Pz8/PwA/C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAyWAwsgA0EvaiECA0AgASAERgRAQSEhAgyXAwsCQAJAAkAgAS0AACIAQQlrDhgCACkpASkpKSkpKSkpKSkpKSkpKSkpKQInCyABQQFqIQEgA0Evai0AAEEBcUUNCgwYCyABQQFqIQEMFwsgAUEBaiEBIAItAABBAnENAAtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwMlQMLIAMtAC5BgAFxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ3mAiAAQRVGBEAgA0EkNgIcIAMgATYCFCADQZsbNgIQIANBFTYCDEEAIQIMlAMLQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDJMDC0EAIQIgA0EANgIcIAMgATYCFCADQb4gNgIQIANBAjYCDAySAwsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEgDKdqIgEQMiIARQ0rIANBBzYCHCADIAE2AhQgAyAANgIMDJEDCyADLQAuQcAAcUUNAQtBACEAAkAgAygCOCICRQ0AIAIoAlgiAkUNACADIAIRAAAhAAsgAEUNKyAAQRVGBEAgA0EKNgIcIAMgATYCFCADQesZNgIQIANBFTYCDEEAIQIMkAMLQQAhAiADQQA2AhwgAyABNgIUIANBkww2AhAgA0ETNgIMDI8DC0EAIQIgA0EANgIcIAMgATYCFCADQYIVNgIQIANBAjYCDAyOAwtBACECIANBADYCHCADIAE2AhQgA0HdFDYCECADQRk2AgwMjQMLQQAhAiADQQA2AhwgAyABNgIUIANB5h02AhAgA0EZNgIMDIwDCyAAQRVGDT1BACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMiwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUNKCADQQ02AhwgAyABNgIUIAMgADYCDAyKAwsgAEEVRg06QQAhAiADQQA2AhwgAyABNgIUIANB0A82AhAgA0EiNgIMDIkDCyADKAIEIQBBACECIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDCgLIANBDjYCHCADIAA2AgwgAyABQQFqNgIUDIgDCyAAQRVGDTdBACECIANBADYCHCADIAE2AhQgA0HQDzYCECADQSI2AgwMhwMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDMiAEUEQCABQQFqIQEMJwsgA0EPNgIcIAMgADYCDCADIAFBAWo2AhQMhgMLQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDIUDCyAAQRVGDTNBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwMhAMLIAMoAgQhAEEAIQIgA0EANgIEIAMgACABEDQiAEUNJSADQRE2AhwgAyABNgIUIAMgADYCDAyDAwsgAEEVRg0wQQAhAiADQQA2AhwgAyABNgIUIANB1gw2AhAgA0EjNgIMDIIDCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDCULIANBEjYCHCADIAA2AgwgAyABQQFqNgIUDIEDCyADQS9qLQAAQQFxRQ0BC0EXIQIM5gILQQAhAiADQQA2AhwgAyABNgIUIANB4hc2AhAgA0EZNgIMDP4CCyAAQTtHDQAgAUEBaiEBDAwLQQAhAiADQQA2AhwgAyABNgIUIANBkhg2AhAgA0ECNgIMDPwCCyAAQRVGDShBACECIANBADYCHCADIAE2AhQgA0HWDDYCECADQSM2AgwM+wILIANBFDYCHCADIAE2AhQgAyAANgIMDPoCCyADKAIEIQBBACECIANBADYCBCADIAAgARA0IgBFBEAgAUEBaiEBDPUCCyADQRU2AhwgAyAANgIMIAMgAUEBajYCFAz5AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzzAgsgA0EXNgIcIAMgADYCDCADIAFBAWo2AhQM+AILIABBFUYNI0EAIQIgA0EANgIcIAMgATYCFCADQdYMNgIQIANBIzYCDAz3AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQwdCyADQRk2AhwgAyAANgIMIAMgAUEBajYCFAz2AgsgAygCBCEAQQAhAiADQQA2AgQgAyAAIAEQNCIARQRAIAFBAWohAQzvAgsgA0EaNgIcIAMgADYCDCADIAFBAWo2AhQM9QILIABBFUYNH0EAIQIgA0EANgIcIAMgATYCFCADQdAPNgIQIANBIjYCDAz0AgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDBsLIANBHDYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgzzAgsgAygCBCEAIANBADYCBCADIAAgARAzIgBFBEAgAUEBaiEBDOsCCyADQR02AhwgAyAANgIMIAMgAUEBajYCFEEAIQIM8gILIABBO0cNASABQQFqIQELQSYhAgzXAgtBACECIANBADYCHCADIAE2AhQgA0GfFTYCECADQQw2AgwM7wILIAEgBEcEQANAIAEtAABBIEcNhAIgBCABQQFqIgFHDQALQSwhAgzvAgtBLCECDO4CCyABIARGBEBBNCECDO4CCwJAAkADQAJAIAEtAABBCmsOBAIAAAMACyAEIAFBAWoiAUcNAAtBNCECDO8CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNnwIgA0EyNgIcIAMgATYCFCADIAA2AgxBACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUEQCABQQFqIQEMnwILIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgztAgsgASAERwRAAkADQCABLQAAQTBrIgBB/wFxQQpPBEBBOiECDNcCCyADKQMgIgtCmbPmzJmz5swZVg0BIAMgC0IKfiIKNwMgIAogAK1C/wGDIgtCf4VWDQEgAyAKIAt8NwMgIAQgAUEBaiIBRw0AC0HAACECDO4CCyADKAIEIQAgA0EANgIEIAMgACABQQFqIgEQMSIADRcM4gILQcAAIQIM7AILIAEgBEYEQEHJACECDOwCCwJAA0ACQCABLQAAQQlrDhgAAqICogKpAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAgCiAgsgBCABQQFqIgFHDQALQckAIQIM7AILIAFBAWohASADQS9qLQAAQQFxDaUCIANBADYCHCADIAE2AhQgA0GXEDYCECADQQo2AgxBACECDOsCCyABIARHBEADQCABLQAAQSBHDRUgBCABQQFqIgFHDQALQfgAIQIM6wILQfgAIQIM6gILIANBAjoAKAw4C0EAIQIgA0EANgIcIANBvws2AhAgA0ECNgIMIAMgAUEBajYCFAzoAgtBACECDM4CC0ENIQIMzQILQRMhAgzMAgtBFSECDMsCC0EWIQIMygILQRghAgzJAgtBGSECDMgCC0EaIQIMxwILQRshAgzGAgtBHCECDMUCC0EdIQIMxAILQR4hAgzDAgtBHyECDMICC0EgIQIMwQILQSIhAgzAAgtBIyECDL8CC0ElIQIMvgILQeUAIQIMvQILIANBPTYCHCADIAE2AhQgAyAANgIMQQAhAgzVAgsgA0EbNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIM1AILIANBIDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNMCCyADQRM2AhwgAyABNgIUIANBmBo2AhAgA0EVNgIMQQAhAgzSAgsgA0ELNgIcIAMgATYCFCADQZgaNgIQIANBFTYCDEEAIQIM0QILIANBEDYCHCADIAE2AhQgA0GYGjYCECADQRU2AgxBACECDNACCyADQSA2AhwgAyABNgIUIANBpBw2AhAgA0EVNgIMQQAhAgzPAgsgA0ELNgIcIAMgATYCFCADQaQcNgIQIANBFTYCDEEAIQIMzgILIANBDDYCHCADIAE2AhQgA0GkHDYCECADQRU2AgxBACECDM0CC0EAIQIgA0EANgIcIAMgATYCFCADQd0ONgIQIANBEjYCDAzMAgsCQANAAkAgAS0AAEEKaw4EAAICAAILIAQgAUEBaiIBRw0AC0H9ASECDMwCCwJAAkAgAy0ANkEBRw0AQQAhAAJAIAMoAjgiAkUNACACKAJgIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRw0BIANB/AE2AhwgAyABNgIUIANB3Bk2AhAgA0EVNgIMQQAhAgzNAgtB3AEhAgyzAgsgA0EANgIcIAMgATYCFCADQfkLNgIQIANBHzYCDEEAIQIMywILAkACQCADLQAoQQFrDgIEAQALQdsBIQIMsgILQdQBIQIMsQILIANBAjoAMUEAIQACQCADKAI4IgJFDQAgAigCACICRQ0AIAMgAhEAACEACyAARQRAQd0BIQIMsQILIABBFUcEQCADQQA2AhwgAyABNgIUIANBtAw2AhAgA0EQNgIMQQAhAgzKAgsgA0H7ATYCHCADIAE2AhQgA0GBGjYCECADQRU2AgxBACECDMkCCyABIARGBEBB+gEhAgzJAgsgAS0AAEHIAEYNASADQQE6ACgLQcABIQIMrgILQdoBIQIMrQILIAEgBEcEQCADQQw2AgggAyABNgIEQdkBIQIMrQILQfkBIQIMxQILIAEgBEYEQEH4ASECDMUCCyABLQAAQcgARw0EIAFBAWohAUHYASECDKsCCyABIARGBEBB9wEhAgzEAgsCQAJAIAEtAABBxQBrDhAABQUFBQUFBQUFBQUFBQUBBQsgAUEBaiEBQdYBIQIMqwILIAFBAWohAUHXASECDKoCC0H2ASECIAEgBEYNwgIgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABButUAai0AAEcNAyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMwwILIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgBFBEBB4wEhAgyqAgsgA0H1ATYCHCADIAE2AhQgAyAANgIMQQAhAgzCAgtB9AEhAiABIARGDcECIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQbjVAGotAABHDQIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADMICCyADQYEEOwEoIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARAuIgANAwwCCyADQQA2AgALQQAhAiADQQA2AhwgAyABNgIUIANB5R82AhAgA0EINgIMDL8CC0HVASECDKUCCyADQfMBNgIcIAMgATYCFCADIAA2AgxBACECDL0CC0EAIQACQCADKAI4IgJFDQAgAigCQCICRQ0AIAMgAhEAACEACyAARQ1uIABBFUcEQCADQQA2AhwgAyABNgIUIANBgg82AhAgA0EgNgIMQQAhAgy9AgsgA0GPATYCHCADIAE2AhQgA0HsGzYCECADQRU2AgxBACECDLwCCyABIARHBEAgA0ENNgIIIAMgATYCBEHTASECDKMCC0HyASECDLsCCyABIARGBEBB8QEhAgy7AgsCQAJAAkAgAS0AAEHIAGsOCwABCAgICAgICAgCCAsgAUEBaiEBQdABIQIMowILIAFBAWohAUHRASECDKICCyABQQFqIQFB0gEhAgyhAgtB8AEhAiABIARGDbkCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEG11QBqLQAARw0EIABBAkYNAyAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy5AgtB7wEhAiABIARGDbgCIAMoAgAiACAEIAFraiEGIAEgAGtBAWohBQNAIAEtAAAgAEGz1QBqLQAARw0DIABBAUYNAiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy4AgtB7gEhAiABIARGDbcCIAMoAgAiACAEIAFraiEGIAEgAGtBAmohBQNAIAEtAAAgAEGw1QBqLQAARw0CIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBjYCAAy3AgsgAygCBCEAIANCADcDACADIAAgBUEBaiIBECsiAEUNAiADQewBNgIcIAMgATYCFCADIAA2AgxBACECDLYCCyADQQA2AgALIAMoAgQhACADQQA2AgQgAyAAIAEQKyIARQ2cAiADQe0BNgIcIAMgATYCFCADIAA2AgxBACECDLQCC0HPASECDJoCC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMtAILQc4BIQIMmgILIANB6wE2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyyAgsgASAERgRAQesBIQIMsgILIAEtAABBL0YEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQbI4NgIQIANBCDYCDEEAIQIMsQILQc0BIQIMlwILIAEgBEcEQCADQQ42AgggAyABNgIEQcwBIQIMlwILQeoBIQIMrwILIAEgBEYEQEHpASECDK8CCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHLASECDJYCCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNlwIgA0HoATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgASAERgRAQecBIQIMrgILAkAgAS0AAEEuRgRAIAFBAWohAQwBCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmAIgA0HmATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgtBygEhAgyUAgsgASAERgRAQeUBIQIMrQILQQAhAEEBIQVBASEHQQAhAgJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAIAEtAABBMGsOCgoJAAECAwQFBggLC0ECDAYLQQMMBQtBBAwEC0EFDAMLQQYMAgtBBwwBC0EICyECQQAhBUEAIQcMAgtBCSECQQEhAEEAIQVBACEHDAELQQAhBUEBIQILIAMgAjoAKyABQQFqIQECQAJAIAMtAC5BEHENAAJAAkACQCADLQAqDgMBAAIECyAHRQ0DDAILIAANAQwCCyAFRQ0BCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNAiADQeIBNgIcIAMgATYCFCADIAA2AgxBACECDK8CCyADKAIEIQAgA0EANgIEIAMgACABEC8iAEUNmgIgA0HjATYCHCADIAE2AhQgAyAANgIMQQAhAgyuAgsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDZgCIANB5AE2AhwgAyABNgIUIAMgADYCDAytAgtByQEhAgyTAgtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GkDTYCECADQSE2AgxBACECDK0CC0HIASECDJMCCyADQeEBNgIcIAMgATYCFCADQdAaNgIQIANBFTYCDEEAIQIMqwILIAEgBEYEQEHhASECDKsCCwJAIAEtAABBIEYEQCADQQA7ATQgAUEBaiEBDAELIANBADYCHCADIAE2AhQgA0GZETYCECADQQk2AgxBACECDKsCC0HHASECDJECCyABIARGBEBB4AEhAgyqAgsCQCABLQAAQTBrQf8BcSICQQpJBEAgAUEBaiEBAkAgAy8BNCIAQZkzSw0AIAMgAEEKbCIAOwE0IABB/v8DcSACQf//A3NLDQAgAyAAIAJqOwE0DAILQQAhAiADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMDKsCCyADQQA2AhwgAyABNgIUIANBlR42AhAgA0ENNgIMQQAhAgyqAgtBxgEhAgyQAgsgASAERgRAQd8BIQIMqQILAkAgAS0AAEEwa0H/AXEiAkEKSQRAIAFBAWohAQJAIAMvATQiAEGZM0sNACADIABBCmwiADsBNCAAQf7/A3EgAkH//wNzSw0AIAMgACACajsBNAwCC0EAIQIgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDAyqAgsgA0EANgIcIAMgATYCFCADQZUeNgIQIANBDTYCDEEAIQIMqQILQcUBIQIMjwILIAEgBEYEQEHeASECDKgCCwJAIAEtAABBMGtB/wFxIgJBCkkEQCABQQFqIQECQCADLwE0IgBBmTNLDQAgAyAAQQpsIgA7ATQgAEH+/wNxIAJB//8Dc0sNACADIAAgAmo7ATQMAgtBACECIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgwMqQILIANBADYCHCADIAE2AhQgA0GVHjYCECADQQ02AgxBACECDKgCC0HEASECDI4CCyABIARGBEBB3QEhAgynAgsCQAJAAkACQCABLQAAQQprDhcCAwMAAwMDAwMDAwMDAwMDAwMDAwMDAQMLIAFBAWoMBQsgAUEBaiEBQcMBIQIMjwILIAFBAWohASADQS9qLQAAQQFxDQggA0EANgIcIAMgATYCFCADQY0LNgIQIANBDTYCDEEAIQIMpwILIANBADYCHCADIAE2AhQgA0GNCzYCECADQQ02AgxBACECDKYCCyABIARHBEAgA0EPNgIIIAMgATYCBEEBIQIMjQILQdwBIQIMpQILAkACQANAAkAgAS0AAEEKaw4EAgAAAwALIAQgAUEBaiIBRw0AC0HbASECDKYCCyADKAIEIQAgA0EANgIEIAMgACABEC0iAEUEQCABQQFqIQEMBAsgA0HaATYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgylAgsgAygCBCEAIANBADYCBCADIAAgARAtIgANASABQQFqCyEBQcEBIQIMigILIANB2QE2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMogILQcIBIQIMiAILIANBL2otAABBAXENASADQQA2AhwgAyABNgIUIANB5Bw2AhAgA0EZNgIMQQAhAgygAgsgASAERgRAQdkBIQIMoAILAkACQAJAIAEtAABBCmsOBAECAgACCyABQQFqIQEMAgsgAUEBaiEBDAELIAMtAC5BwABxRQ0BC0EAIQACQCADKAI4IgJFDQAgAigCPCICRQ0AIAMgAhEAACEACyAARQ2gASAAQRVGBEAgA0HZADYCHCADIAE2AhQgA0G3GjYCECADQRU2AgxBACECDJ8CCyADQQA2AhwgAyABNgIUIANBgA02AhAgA0EbNgIMQQAhAgyeAgsgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMnQILIAEgBEcEQCADQQw2AgggAyABNgIEQb8BIQIMhAILQdgBIQIMnAILIAEgBEYEQEHXASECDJwCCwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEHBAGsOFQABAgNaBAUGWlpaBwgJCgsMDQ4PEFoLIAFBAWohAUH7ACECDJICCyABQQFqIQFB/AAhAgyRAgsgAUEBaiEBQYEBIQIMkAILIAFBAWohAUGFASECDI8CCyABQQFqIQFBhgEhAgyOAgsgAUEBaiEBQYkBIQIMjQILIAFBAWohAUGKASECDIwCCyABQQFqIQFBjQEhAgyLAgsgAUEBaiEBQZYBIQIMigILIAFBAWohAUGXASECDIkCCyABQQFqIQFBmAEhAgyIAgsgAUEBaiEBQaUBIQIMhwILIAFBAWohAUGmASECDIYCCyABQQFqIQFBrAEhAgyFAgsgAUEBaiEBQbQBIQIMhAILIAFBAWohAUG3ASECDIMCCyABQQFqIQFBvgEhAgyCAgsgASAERgRAQdYBIQIMmwILIAEtAABBzgBHDUggAUEBaiEBQb0BIQIMgQILIAEgBEYEQEHVASECDJoCCwJAAkACQCABLQAAQcIAaw4SAEpKSkpKSkpKSgFKSkpKSkoCSgsgAUEBaiEBQbgBIQIMggILIAFBAWohAUG7ASECDIECCyABQQFqIQFBvAEhAgyAAgtB1AEhAiABIARGDZgCIAMoAgAiACAEIAFraiEFIAEgAGtBB2ohBgJAA0AgAS0AACAAQajVAGotAABHDUUgAEEHRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJkCCyADQQA2AgAgBkEBaiEBQRsMRQsgASAERgRAQdMBIQIMmAILAkACQCABLQAAQckAaw4HAEdHR0dHAUcLIAFBAWohAUG5ASECDP8BCyABQQFqIQFBugEhAgz+AQtB0gEhAiABIARGDZYCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQabVAGotAABHDUMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJcCCyADQQA2AgAgBkEBaiEBQQ8MQwtB0QEhAiABIARGDZUCIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQaTVAGotAABHDUIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJYCCyADQQA2AgAgBkEBaiEBQSAMQgtB0AEhAiABIARGDZQCIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDUEgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADJUCCyADQQA2AgAgBkEBaiEBQRIMQQsgASAERgRAQc8BIQIMlAILAkACQCABLQAAQcUAaw4OAENDQ0NDQ0NDQ0NDQwFDCyABQQFqIQFBtQEhAgz7AQsgAUEBaiEBQbYBIQIM+gELQc4BIQIgASAERg2SAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGe1QBqLQAARw0/IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyTAgsgA0EANgIAIAZBAWohAUEHDD8LQc0BIQIgASAERg2RAiADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGY1QBqLQAARw0+IABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAySAgsgA0EANgIAIAZBAWohAUEoDD4LIAEgBEYEQEHMASECDJECCwJAAkACQCABLQAAQcUAaw4RAEFBQUFBQUFBQQFBQUFBQQJBCyABQQFqIQFBsQEhAgz5AQsgAUEBaiEBQbIBIQIM+AELIAFBAWohAUGzASECDPcBC0HLASECIAEgBEYNjwIgAygCACIAIAQgAWtqIQUgASAAa0EGaiEGAkADQCABLQAAIABBkdUAai0AAEcNPCAAQQZGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMkAILIANBADYCACAGQQFqIQFBGgw8C0HKASECIAEgBEYNjgIgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABBjdUAai0AAEcNOyAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMjwILIANBADYCACAGQQFqIQFBIQw7CyABIARGBEBByQEhAgyOAgsCQAJAIAEtAABBwQBrDhQAPT09PT09PT09PT09PT09PT09AT0LIAFBAWohAUGtASECDPUBCyABQQFqIQFBsAEhAgz0AQsgASAERgRAQcgBIQIMjQILAkACQCABLQAAQdUAaw4LADw8PDw8PDw8PAE8CyABQQFqIQFBrgEhAgz0AQsgAUEBaiEBQa8BIQIM8wELQccBIQIgASAERg2LAiADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw04IABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyMAgsgA0EANgIAIAZBAWohAUEqDDgLIAEgBEYEQEHGASECDIsCCyABLQAAQdAARw04IAFBAWohAUElDDcLQcUBIQIgASAERg2JAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGB1QBqLQAARw02IABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyKAgsgA0EANgIAIAZBAWohAUEODDYLIAEgBEYEQEHEASECDIkCCyABLQAAQcUARw02IAFBAWohAUGrASECDO8BCyABIARGBEBBwwEhAgyIAgsCQAJAAkACQCABLQAAQcIAaw4PAAECOTk5OTk5OTk5OTkDOQsgAUEBaiEBQacBIQIM8QELIAFBAWohAUGoASECDPABCyABQQFqIQFBqQEhAgzvAQsgAUEBaiEBQaoBIQIM7gELQcIBIQIgASAERg2GAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH+1ABqLQAARw0zIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyHAgsgA0EANgIAIAZBAWohAUEUDDMLQcEBIQIgASAERg2FAiADKAIAIgAgBCABa2ohBSABIABrQQRqIQYCQANAIAEtAAAgAEH51ABqLQAARw0yIABBBEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyGAgsgA0EANgIAIAZBAWohAUErDDILQcABIQIgASAERg2EAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEH21ABqLQAARw0xIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyFAgsgA0EANgIAIAZBAWohAUEsDDELQb8BIQIgASAERg2DAiADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGh1QBqLQAARw0wIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyEAgsgA0EANgIAIAZBAWohAUERDDALQb4BIQIgASAERg2CAiADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEHy1ABqLQAARw0vIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyDAgsgA0EANgIAIAZBAWohAUEuDC8LIAEgBEYEQEG9ASECDIICCwJAAkACQAJAAkAgAS0AAEHBAGsOFQA0NDQ0NDQ0NDQ0ATQ0AjQ0AzQ0BDQLIAFBAWohAUGbASECDOwBCyABQQFqIQFBnAEhAgzrAQsgAUEBaiEBQZ0BIQIM6gELIAFBAWohAUGiASECDOkBCyABQQFqIQFBpAEhAgzoAQsgASAERgRAQbwBIQIMgQILAkACQCABLQAAQdIAaw4DADABMAsgAUEBaiEBQaMBIQIM6AELIAFBAWohAUEEDC0LQbsBIQIgASAERg3/ASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHw1ABqLQAARw0sIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyAAgsgA0EANgIAIAZBAWohAUEdDCwLIAEgBEYEQEG6ASECDP8BCwJAAkAgAS0AAEHJAGsOBwEuLi4uLgAuCyABQQFqIQFBoQEhAgzmAQsgAUEBaiEBQSIMKwsgASAERgRAQbkBIQIM/gELIAEtAABB0ABHDSsgAUEBaiEBQaABIQIM5AELIAEgBEYEQEG4ASECDP0BCwJAAkAgAS0AAEHGAGsOCwAsLCwsLCwsLCwBLAsgAUEBaiEBQZ4BIQIM5AELIAFBAWohAUGfASECDOMBC0G3ASECIAEgBEYN+wEgAygCACIAIAQgAWtqIQUgASAAa0EDaiEGAkADQCABLQAAIABB7NQAai0AAEcNKCAAQQNGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM/AELIANBADYCACAGQQFqIQFBDQwoC0G2ASECIAEgBEYN+gEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBodUAai0AAEcNJyAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+wELIANBADYCACAGQQFqIQFBDAwnC0G1ASECIAEgBEYN+QEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6tQAai0AAEcNJiAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+gELIANBADYCACAGQQFqIQFBAwwmC0G0ASECIAEgBEYN+AEgAygCACIAIAQgAWtqIQUgASAAa0EBaiEGAkADQCABLQAAIABB6NQAai0AAEcNJSAAQQFGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM+QELIANBADYCACAGQQFqIQFBJgwlCyABIARGBEBBswEhAgz4AQsCQAJAIAEtAABB1ABrDgIAAScLIAFBAWohAUGZASECDN8BCyABQQFqIQFBmgEhAgzeAQtBsgEhAiABIARGDfYBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQebUAGotAABHDSMgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPcBCyADQQA2AgAgBkEBaiEBQScMIwtBsQEhAiABIARGDfUBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQeTUAGotAABHDSIgAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPYBCyADQQA2AgAgBkEBaiEBQRwMIgtBsAEhAiABIARGDfQBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQd7UAGotAABHDSEgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPUBCyADQQA2AgAgBkEBaiEBQQYMIQtBrwEhAiABIARGDfMBIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQdnUAGotAABHDSAgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPQBCyADQQA2AgAgBkEBaiEBQRkMIAsgASAERgRAQa4BIQIM8wELAkACQAJAAkAgAS0AAEEtaw4jACQkJCQkJCQkJCQkJCQkJCQkJCQkJCQkASQkJCQkAiQkJAMkCyABQQFqIQFBjgEhAgzcAQsgAUEBaiEBQY8BIQIM2wELIAFBAWohAUGUASECDNoBCyABQQFqIQFBlQEhAgzZAQtBrQEhAiABIARGDfEBIAMoAgAiACAEIAFraiEFIAEgAGtBAWohBgJAA0AgAS0AACAAQdfUAGotAABHDR4gAEEBRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADPIBCyADQQA2AgAgBkEBaiEBQQsMHgsgASAERgRAQawBIQIM8QELAkACQCABLQAAQcEAaw4DACABIAsgAUEBaiEBQZABIQIM2AELIAFBAWohAUGTASECDNcBCyABIARGBEBBqwEhAgzwAQsCQAJAIAEtAABBwQBrDg8AHx8fHx8fHx8fHx8fHwEfCyABQQFqIQFBkQEhAgzXAQsgAUEBaiEBQZIBIQIM1gELIAEgBEYEQEGqASECDO8BCyABLQAAQcwARw0cIAFBAWohAUEKDBsLQakBIQIgASAERg3tASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHR1ABqLQAARw0aIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzuAQsgA0EANgIAIAZBAWohAUEeDBoLQagBIQIgASAERg3sASADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEHK1ABqLQAARw0ZIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAztAQsgA0EANgIAIAZBAWohAUEVDBkLQacBIQIgASAERg3rASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEHH1ABqLQAARw0YIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzsAQsgA0EANgIAIAZBAWohAUEXDBgLQaYBIQIgASAERg3qASADKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEHB1ABqLQAARw0XIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzrAQsgA0EANgIAIAZBAWohAUEYDBcLIAEgBEYEQEGlASECDOoBCwJAAkAgAS0AAEHJAGsOBwAZGRkZGQEZCyABQQFqIQFBiwEhAgzRAQsgAUEBaiEBQYwBIQIM0AELQaQBIQIgASAERg3oASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGm1QBqLQAARw0VIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzpAQsgA0EANgIAIAZBAWohAUEJDBULQaMBIQIgASAERg3nASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGk1QBqLQAARw0UIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzoAQsgA0EANgIAIAZBAWohAUEfDBQLQaIBIQIgASAERg3mASADKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEG+1ABqLQAARw0TIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAznAQsgA0EANgIAIAZBAWohAUECDBMLQaEBIQIgASAERg3lASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYDQCABLQAAIABBvNQAai0AAEcNESAAQQFGDQIgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM5QELIAEgBEYEQEGgASECDOUBC0EBIAEtAABB3wBHDREaIAFBAWohAUGHASECDMsBCyADQQA2AgAgBkEBaiEBQYgBIQIMygELQZ8BIQIgASAERg3iASADKAIAIgAgBCABa2ohBSABIABrQQhqIQYCQANAIAEtAAAgAEGE1QBqLQAARw0PIABBCEYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAzjAQsgA0EANgIAIAZBAWohAUEpDA8LQZ4BIQIgASAERg3hASADKAIAIgAgBCABa2ohBSABIABrQQNqIQYCQANAIAEtAAAgAEG41ABqLQAARw0OIABBA0YNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAziAQsgA0EANgIAIAZBAWohAUEtDA4LIAEgBEYEQEGdASECDOEBCyABLQAAQcUARw0OIAFBAWohAUGEASECDMcBCyABIARGBEBBnAEhAgzgAQsCQAJAIAEtAABBzABrDggADw8PDw8PAQ8LIAFBAWohAUGCASECDMcBCyABQQFqIQFBgwEhAgzGAQtBmwEhAiABIARGDd4BIAMoAgAiACAEIAFraiEFIAEgAGtBBGohBgJAA0AgAS0AACAAQbPUAGotAABHDQsgAEEERg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN8BCyADQQA2AgAgBkEBaiEBQSMMCwtBmgEhAiABIARGDd0BIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQbDUAGotAABHDQogAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADN4BCyADQQA2AgAgBkEBaiEBQQAMCgsgASAERgRAQZkBIQIM3QELAkACQCABLQAAQcgAaw4IAAwMDAwMDAEMCyABQQFqIQFB/QAhAgzEAQsgAUEBaiEBQYABIQIMwwELIAEgBEYEQEGYASECDNwBCwJAAkAgAS0AAEHOAGsOAwALAQsLIAFBAWohAUH+ACECDMMBCyABQQFqIQFB/wAhAgzCAQsgASAERgRAQZcBIQIM2wELIAEtAABB2QBHDQggAUEBaiEBQQgMBwtBlgEhAiABIARGDdkBIAMoAgAiACAEIAFraiEFIAEgAGtBA2ohBgJAA0AgAS0AACAAQazUAGotAABHDQYgAEEDRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNoBCyADQQA2AgAgBkEBaiEBQQUMBgtBlQEhAiABIARGDdgBIAMoAgAiACAEIAFraiEFIAEgAGtBBWohBgJAA0AgAS0AACAAQabUAGotAABHDQUgAEEFRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNkBCyADQQA2AgAgBkEBaiEBQRYMBQtBlAEhAiABIARGDdcBIAMoAgAiACAEIAFraiEFIAEgAGtBAmohBgJAA0AgAS0AACAAQaHVAGotAABHDQQgAEECRg0BIABBAWohACAEIAFBAWoiAUcNAAsgAyAFNgIADNgBCyADQQA2AgAgBkEBaiEBQRAMBAsgASAERgRAQZMBIQIM1wELAkACQCABLQAAQcMAaw4MAAYGBgYGBgYGBgYBBgsgAUEBaiEBQfkAIQIMvgELIAFBAWohAUH6ACECDL0BC0GSASECIAEgBEYN1QEgAygCACIAIAQgAWtqIQUgASAAa0EFaiEGAkADQCABLQAAIABBoNQAai0AAEcNAiAAQQVGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAM1gELIANBADYCACAGQQFqIQFBJAwCCyADQQA2AgAMAgsgASAERgRAQZEBIQIM1AELIAEtAABBzABHDQEgAUEBaiEBQRMLOgApIAMoAgQhACADQQA2AgQgAyAAIAEQLiIADQIMAQtBACECIANBADYCHCADIAE2AhQgA0H+HzYCECADQQY2AgwM0QELQfgAIQIMtwELIANBkAE2AhwgAyABNgIUIAMgADYCDEEAIQIMzwELQQAhAAJAIAMoAjgiAkUNACACKAJAIgJFDQAgAyACEQAAIQALIABFDQAgAEEVRg0BIANBADYCHCADIAE2AhQgA0GCDzYCECADQSA2AgxBACECDM4BC0H3ACECDLQBCyADQY8BNgIcIAMgATYCFCADQewbNgIQIANBFTYCDEEAIQIMzAELIAEgBEYEQEGPASECDMwBCwJAIAEtAABBIEYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZsfNgIQIANBBjYCDEEAIQIMzAELQQIhAgyyAQsDQCABLQAAQSBHDQIgBCABQQFqIgFHDQALQY4BIQIMygELIAEgBEYEQEGNASECDMoBCwJAIAEtAABBCWsOBEoAAEoAC0H1ACECDLABCyADLQApQQVGBEBB9gAhAgywAQtB9AAhAgyvAQsgASAERgRAQYwBIQIMyAELIANBEDYCCCADIAE2AgQMCgsgASAERgRAQYsBIQIMxwELAkAgAS0AAEEJaw4ERwAARwALQfMAIQIMrQELIAEgBEcEQCADQRA2AgggAyABNgIEQfEAIQIMrQELQYoBIQIMxQELAkAgASAERwRAA0AgAS0AAEGg0ABqLQAAIgBBA0cEQAJAIABBAWsOAkkABAtB8AAhAgyvAQsgBCABQQFqIgFHDQALQYgBIQIMxgELQYgBIQIMxQELIANBADYCHCADIAE2AhQgA0HbIDYCECADQQc2AgxBACECDMQBCyABIARGBEBBiQEhAgzEAQsCQAJAAkAgAS0AAEGg0gBqLQAAQQFrDgNGAgABC0HyACECDKwBCyADQQA2AhwgAyABNgIUIANBtBI2AhAgA0EHNgIMQQAhAgzEAQtB6gAhAgyqAQsgASAERwRAIAFBAWohAUHvACECDKoBC0GHASECDMIBCyAEIAEiAEYEQEGGASECDMIBCyAALQAAIgFBL0YEQCAAQQFqIQFB7gAhAgypAQsgAUEJayICQRdLDQEgACEBQQEgAnRBm4CABHENQQwBCyAEIAEiAEYEQEGFASECDMEBCyAALQAAQS9HDQAgAEEBaiEBDAMLQQAhAiADQQA2AhwgAyAANgIUIANB2yA2AhAgA0EHNgIMDL8BCwJAAkACQAJAAkADQCABLQAAQaDOAGotAAAiAEEFRwRAAkACQCAAQQFrDghHBQYHCAAEAQgLQesAIQIMrQELIAFBAWohAUHtACECDKwBCyAEIAFBAWoiAUcNAAtBhAEhAgzDAQsgAUEBagwUCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDMEBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDMABCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNHiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDL8BCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy+AQsgASAERgRAQYMBIQIMvgELAkAgAS0AAEGgzgBqLQAAQQFrDgg+BAUGAAgCAwcLIAFBAWohAQtBAyECDKMBCyABQQFqDA0LQQAhAiADQQA2AhwgA0HREjYCECADQQc2AgwgAyABQQFqNgIUDLoBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQdsANgIcIAMgATYCFCADIAA2AgxBACECDLkBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQd0ANgIcIAMgATYCFCADIAA2AgxBACECDLgBCyADKAIEIQAgA0EANgIEIAMgACABECwiAEUNFiADQfoANgIcIAMgATYCFCADIAA2AgxBACECDLcBCyADQQA2AhwgAyABNgIUIANB+Q82AhAgA0EHNgIMQQAhAgy2AQtB7AAhAgycAQsgASAERgRAQYIBIQIMtQELIAFBAWoMAgsgASAERgRAQYEBIQIMtAELIAFBAWoMAQsgASAERg0BIAFBAWoLIQFBBCECDJgBC0GAASECDLABCwNAIAEtAABBoMwAai0AACIAQQJHBEAgAEEBRwRAQekAIQIMmQELDDELIAQgAUEBaiIBRw0AC0H/ACECDK8BCyABIARGBEBB/gAhAgyvAQsCQCABLQAAQQlrDjcvAwYvBAYGBgYGBgYGBgYGBgYGBgYGBgUGBgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYABgsgAUEBagshAUEFIQIMlAELIAFBAWoMBgsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgyrAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgyqAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQggA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgypAQsgA0EANgIcIAMgATYCFCADQY0UNgIQIANBBzYCDEEAIQIMqAELAkACQAJAAkADQCABLQAAQaDKAGotAAAiAEEFRwRAAkAgAEEBaw4GLgMEBQYABgtB6AAhAgyUAQsgBCABQQFqIgFHDQALQf0AIQIMqwELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB2wA2AhwgAyABNgIUIAMgADYCDEEAIQIMqgELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB3QA2AhwgAyABNgIUIAMgADYCDEEAIQIMqQELIAMoAgQhACADQQA2AgQgAyAAIAEQLCIARQ0HIANB+gA2AhwgAyABNgIUIAMgADYCDEEAIQIMqAELIANBADYCHCADIAE2AhQgA0HkCDYCECADQQc2AgxBACECDKcBCyABIARGDQEgAUEBagshAUEGIQIMjAELQfwAIQIMpAELAkACQAJAAkADQCABLQAAQaDIAGotAAAiAEEFRwRAIABBAWsOBCkCAwQFCyAEIAFBAWoiAUcNAAtB+wAhAgynAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HbADYCHCADIAE2AhQgAyAANgIMQQAhAgymAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0HdADYCHCADIAE2AhQgAyAANgIMQQAhAgylAQsgAygCBCEAIANBADYCBCADIAAgARAsIgBFDQMgA0H6ADYCHCADIAE2AhQgAyAANgIMQQAhAgykAQsgA0EANgIcIAMgATYCFCADQbwKNgIQIANBBzYCDEEAIQIMowELQc8AIQIMiQELQdEAIQIMiAELQecAIQIMhwELIAEgBEYEQEH6ACECDKABCwJAIAEtAABBCWsOBCAAACAACyABQQFqIQFB5gAhAgyGAQsgASAERgRAQfkAIQIMnwELAkAgAS0AAEEJaw4EHwAAHwALQQAhAAJAIAMoAjgiAkUNACACKAI4IgJFDQAgAyACEQAAIQALIABFBEBB4gEhAgyGAQsgAEEVRwRAIANBADYCHCADIAE2AhQgA0HJDTYCECADQRo2AgxBACECDJ8BCyADQfgANgIcIAMgATYCFCADQeoaNgIQIANBFTYCDEEAIQIMngELIAEgBEcEQCADQQ02AgggAyABNgIEQeQAIQIMhQELQfcAIQIMnQELIAEgBEYEQEH2ACECDJ0BCwJAAkACQCABLQAAQcgAaw4LAAELCwsLCwsLCwILCyABQQFqIQFB3QAhAgyFAQsgAUEBaiEBQeAAIQIMhAELIAFBAWohAUHjACECDIMBC0H1ACECIAEgBEYNmwEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBtdUAai0AAEcNCCAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMnAELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgAEQCADQfQANgIcIAMgATYCFCADIAA2AgxBACECDJwBC0HiACECDIIBC0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMnAELQeEAIQIMggELIANB8wA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyaAQsgAy0AKSIAQSNrQQtJDQkCQCAAQQZLDQBBASAAdEHKAHFFDQAMCgtBACECIANBADYCHCADIAE2AhQgA0HtCTYCECADQQg2AgwMmQELQfIAIQIgASAERg2YASADKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEGz1QBqLQAARw0FIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAyZAQsgAygCBCEAIANCADcDACADIAAgBkEBaiIBECsiAARAIANB8QA2AhwgAyABNgIUIAMgADYCDEEAIQIMmQELQd8AIQIMfwtBACEAAkAgAygCOCICRQ0AIAIoAjQiAkUNACADIAIRAAAhAAsCQCAABEAgAEEVRg0BIANBADYCHCADIAE2AhQgA0HqDTYCECADQSY2AgxBACECDJkBC0HeACECDH8LIANB8AA2AhwgAyABNgIUIANBgBs2AhAgA0EVNgIMQQAhAgyXAQsgAy0AKUEhRg0GIANBADYCHCADIAE2AhQgA0GRCjYCECADQQg2AgxBACECDJYBC0HvACECIAEgBEYNlQEgAygCACIAIAQgAWtqIQUgASAAa0ECaiEGAkADQCABLQAAIABBsNUAai0AAEcNAiAAQQJGDQEgAEEBaiEAIAQgAUEBaiIBRw0ACyADIAU2AgAMlgELIAMoAgQhACADQgA3AwAgAyAAIAZBAWoiARArIgBFDQIgA0HtADYCHCADIAE2AhQgAyAANgIMQQAhAgyVAQsgA0EANgIACyADKAIEIQAgA0EANgIEIAMgACABECsiAEUNgAEgA0HuADYCHCADIAE2AhQgAyAANgIMQQAhAgyTAQtB3AAhAgx5C0EAIQACQCADKAI4IgJFDQAgAigCNCICRQ0AIAMgAhEAACEACwJAIAAEQCAAQRVGDQEgA0EANgIcIAMgATYCFCADQeoNNgIQIANBJjYCDEEAIQIMkwELQdsAIQIMeQsgA0HsADYCHCADIAE2AhQgA0GAGzYCECADQRU2AgxBACECDJEBCyADLQApIgBBI0kNACAAQS5GDQAgA0EANgIcIAMgATYCFCADQckJNgIQIANBCDYCDEEAIQIMkAELQdoAIQIMdgsgASAERgRAQesAIQIMjwELAkAgAS0AAEEvRgRAIAFBAWohAQwBCyADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMQQAhAgyPAQtB2QAhAgx1CyABIARHBEAgA0EONgIIIAMgATYCBEHYACECDHULQeoAIQIMjQELIAEgBEYEQEHpACECDI0BCyABLQAAQTBrIgBB/wFxQQpJBEAgAyAAOgAqIAFBAWohAUHXACECDHQLIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ16IANB6AA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAEgBEYEQEHnACECDIwBCwJAIAEtAABBLkYEQCABQQFqIQEMAQsgAygCBCEAIANBADYCBCADIAAgARAvIgBFDXsgA0HmADYCHCADIAE2AhQgAyAANgIMQQAhAgyMAQtB1gAhAgxyCyABIARGBEBB5QAhAgyLAQtBACEAQQEhBUEBIQdBACECAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgAS0AAEEwaw4KCgkAAQIDBAUGCAsLQQIMBgtBAwwFC0EEDAQLQQUMAwtBBgwCC0EHDAELQQgLIQJBACEFQQAhBwwCC0EJIQJBASEAQQAhBUEAIQcMAQtBACEFQQEhAgsgAyACOgArIAFBAWohAQJAAkAgAy0ALkEQcQ0AAkACQAJAIAMtACoOAwEAAgQLIAdFDQMMAgsgAA0BDAILIAVFDQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ0CIANB4gA2AhwgAyABNgIUIAMgADYCDEEAIQIMjQELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ19IANB4wA2AhwgAyABNgIUIAMgADYCDEEAIQIMjAELIAMoAgQhACADQQA2AgQgAyAAIAEQLyIARQ17IANB5AA2AhwgAyABNgIUIAMgADYCDAyLAQtB1AAhAgxxCyADLQApQSJGDYYBQdMAIQIMcAtBACEAAkAgAygCOCICRQ0AIAIoAkQiAkUNACADIAIRAAAhAAsgAEUEQEHVACECDHALIABBFUcEQCADQQA2AhwgAyABNgIUIANBpA02AhAgA0EhNgIMQQAhAgyJAQsgA0HhADYCHCADIAE2AhQgA0HQGjYCECADQRU2AgxBACECDIgBCyABIARGBEBB4AAhAgyIAQsCQAJAAkACQAJAIAEtAABBCmsOBAEEBAAECyABQQFqIQEMAQsgAUEBaiEBIANBL2otAABBAXFFDQELQdIAIQIMcAsgA0EANgIcIAMgATYCFCADQbYRNgIQIANBCTYCDEEAIQIMiAELIANBADYCHCADIAE2AhQgA0G2ETYCECADQQk2AgxBACECDIcBCyABIARGBEBB3wAhAgyHAQsgAS0AAEEKRgRAIAFBAWohAQwJCyADLQAuQcAAcQ0IIANBADYCHCADIAE2AhQgA0G2ETYCECADQQI2AgxBACECDIYBCyABIARGBEBB3QAhAgyGAQsgAS0AACICQQ1GBEAgAUEBaiEBQdAAIQIMbQsgASEAIAJBCWsOBAUBAQUBCyAEIAEiAEYEQEHcACECDIUBCyAALQAAQQpHDQAgAEEBagwCC0EAIQIgA0EANgIcIAMgADYCFCADQcotNgIQIANBBzYCDAyDAQsgASAERgRAQdsAIQIMgwELAkAgAS0AAEEJaw4EAwAAAwALIAFBAWoLIQFBzgAhAgxoCyABIARGBEBB2gAhAgyBAQsgAS0AAEEJaw4EAAEBAAELQQAhAiADQQA2AhwgA0GaEjYCECADQQc2AgwgAyABQQFqNgIUDH8LIANBgBI7ASpBACEAAkAgAygCOCICRQ0AIAIoAjgiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HZADYCHCADIAE2AhQgA0HqGjYCECADQRU2AgxBACECDH4LQc0AIQIMZAsgA0EANgIcIAMgATYCFCADQckNNgIQIANBGjYCDEEAIQIMfAsgASAERgRAQdkAIQIMfAsgAS0AAEEgRw09IAFBAWohASADLQAuQQFxDT0gA0EANgIcIAMgATYCFCADQcIcNgIQIANBHjYCDEEAIQIMewsgASAERgRAQdgAIQIMewsCQAJAAkACQAJAIAEtAAAiAEEKaw4EAgMDAAELIAFBAWohAUEsIQIMZQsgAEE6Rw0BIANBADYCHCADIAE2AhQgA0HnETYCECADQQo2AgxBACECDH0LIAFBAWohASADQS9qLQAAQQFxRQ1zIAMtADJBgAFxRQRAIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsCQAJAIAAOFk1MSwEBAQEBAQEBAQEBAQEBAQEBAQABCyADQSk2AhwgAyABNgIUIANBrBk2AhAgA0EVNgIMQQAhAgx+CyADQQA2AhwgAyABNgIUIANB5Qs2AhAgA0ERNgIMQQAhAgx9C0EAIQACQCADKAI4IgJFDQAgAigCXCICRQ0AIAMgAhEAACEACyAARQ1ZIABBFUcNASADQQU2AhwgAyABNgIUIANBmxs2AhAgA0EVNgIMQQAhAgx8C0HLACECDGILQQAhAiADQQA2AhwgAyABNgIUIANBkA42AhAgA0EUNgIMDHoLIAMgAy8BMkGAAXI7ATIMOwsgASAERwRAIANBETYCCCADIAE2AgRBygAhAgxgC0HXACECDHgLIAEgBEYEQEHWACECDHgLAkACQAJAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXFB4wBrDhMAQEBAQEBAQEBAQEBAAUBAQAIDQAsgAUEBaiEBQcYAIQIMYQsgAUEBaiEBQccAIQIMYAsgAUEBaiEBQcgAIQIMXwsgAUEBaiEBQckAIQIMXgtB1QAhAiAEIAEiAEYNdiAEIAFrIAMoAgAiAWohBiAAIAFrQQVqIQcDQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQhBBCABQQVGDQoaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHYLQdQAIQIgBCABIgBGDXUgBCABayADKAIAIgFqIQYgACABa0EPaiEHA0AgAUGAyABqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0HQQMgAUEPRg0JGiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAx1C0HTACECIAQgASIARg10IAQgAWsgAygCACIBaiEGIAAgAWtBDmohBwNAIAFB4scAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNBiABQQ5GDQcgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMdAtB0gAhAiAEIAEiAEYNcyAEIAFrIAMoAgAiAWohBSAAIAFrQQFqIQYDQCABQeDHAGotAAAgAC0AACIHQSByIAcgB0HBAGtB/wFxQRpJG0H/AXFHDQUgAUEBRg0CIAFBAWohASAEIABBAWoiAEcNAAsgAyAFNgIADHMLIAEgBEYEQEHRACECDHMLAkACQCABLQAAIgBBIHIgACAAQcEAa0H/AXFBGkkbQf8BcUHuAGsOBwA5OTk5OQE5CyABQQFqIQFBwwAhAgxaCyABQQFqIQFBxAAhAgxZCyADQQA2AgAgBkEBaiEBQcUAIQIMWAtB0AAhAiAEIAEiAEYNcCAEIAFrIAMoAgAiAWohBiAAIAFrQQlqIQcDQCABQdbHAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQJBAiABQQlGDQQaIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADHALQc8AIQIgBCABIgBGDW8gBCABayADKAIAIgFqIQYgACABa0EFaiEHA0AgAUHQxwBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBBUYNAiABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxvCyAAIQEgA0EANgIADDMLQQELOgAsIANBADYCACAHQQFqIQELQS0hAgxSCwJAA0AgAS0AAEHQxQBqLQAAQQFHDQEgBCABQQFqIgFHDQALQc0AIQIMawtBwgAhAgxRCyABIARGBEBBzAAhAgxqCyABLQAAQTpGBEAgAygCBCEAIANBADYCBCADIAAgARAwIgBFDTMgA0HLADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxqCyADQQA2AhwgAyABNgIUIANB5xE2AhAgA0EKNgIMQQAhAgxpCwJAAkAgAy0ALEECaw4CAAEnCyADQTNqLQAAQQJxRQ0mIAMtAC5BAnENJiADQQA2AhwgAyABNgIUIANBphQ2AhAgA0ELNgIMQQAhAgxpCyADLQAyQSBxRQ0lIAMtAC5BAnENJSADQQA2AhwgAyABNgIUIANBvRM2AhAgA0EPNgIMQQAhAgxoC0EAIQACQCADKAI4IgJFDQAgAigCSCICRQ0AIAMgAhEAACEACyAARQRAQcEAIQIMTwsgAEEVRwRAIANBADYCHCADIAE2AhQgA0GmDzYCECADQRw2AgxBACECDGgLIANBygA2AhwgAyABNgIUIANBhRw2AhAgA0EVNgIMQQAhAgxnCyABIARHBEAgASECA0AgBCACIgFrQRBOBEAgAUEQaiEC/Qz/////////////////////IAH9AAAAIg1BB/1sIA39DODg4ODg4ODg4ODg4ODg4OD9bv0MX19fX19fX19fX19fX19fX/0mIA39DAkJCQkJCQkJCQkJCQkJCQn9I/1Q/VL9ZEF/c2giAEEQRg0BIAAgAWohAQwYCyABIARGBEBBxAAhAgxpCyABLQAAQcDBAGotAABBAUcNFyAEIAFBAWoiAkcNAAtBxAAhAgxnC0HEACECDGYLIAEgBEcEQANAAkAgAS0AACIAQSByIAAgAEHBAGtB/wFxQRpJG0H/AXEiAEEJRg0AIABBIEYNAAJAAkACQAJAIABB4wBrDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTYhAgxSCyABQQFqIQFBNyECDFELIAFBAWohAUE4IQIMUAsMFQsgBCABQQFqIgFHDQALQTwhAgxmC0E8IQIMZQsgASAERgRAQcgAIQIMZQsgA0ESNgIIIAMgATYCBAJAAkACQAJAAkAgAy0ALEEBaw4EFAABAgkLIAMtADJBIHENA0HgASECDE8LAkAgAy8BMiIAQQhxRQ0AIAMtAChBAUcNACADLQAuQQhxRQ0CCyADIABB9/sDcUGABHI7ATIMCwsgAyADLwEyQRByOwEyDAQLIANBADYCBCADIAEgARAxIgAEQCADQcEANgIcIAMgADYCDCADIAFBAWo2AhRBACECDGYLIAFBAWohAQxYCyADQQA2AhwgAyABNgIUIANB9BM2AhAgA0EENgIMQQAhAgxkC0HHACECIAEgBEYNYyADKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIABBwMUAai0AACABLQAAQSByRw0BIABBBkYNSiAAQQFqIQAgBCABQQFqIgFHDQALIAMgBTYCAAxkCyADQQA2AgAMBQsCQCABIARHBEADQCABLQAAQcDDAGotAAAiAEEBRwRAIABBAkcNAyABQQFqIQEMBQsgBCABQQFqIgFHDQALQcUAIQIMZAtBxQAhAgxjCwsgA0EAOgAsDAELQQshAgxHC0E/IQIMRgsCQAJAA0AgAS0AACIAQSBHBEACQCAAQQprDgQDBQUDAAsgAEEsRg0DDAQLIAQgAUEBaiIBRw0AC0HGACECDGALIANBCDoALAwOCyADLQAoQQFHDQIgAy0ALkEIcQ0CIAMoAgQhACADQQA2AgQgAyAAIAEQMSIABEAgA0HCADYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxfCyABQQFqIQEMUAtBOyECDEQLAkADQCABLQAAIgBBIEcgAEEJR3ENASAEIAFBAWoiAUcNAAtBwwAhAgxdCwtBPCECDEILAkACQCABIARHBEADQCABLQAAIgBBIEcEQCAAQQprDgQDBAQDBAsgBCABQQFqIgFHDQALQT8hAgxdC0E/IQIMXAsgAyADLwEyQSByOwEyDAoLIAMoAgQhACADQQA2AgQgAyAAIAEQMSIARQ1OIANBPjYCHCADIAE2AhQgAyAANgIMQQAhAgxaCwJAIAEgBEcEQANAIAEtAABBwMMAai0AACIAQQFHBEAgAEECRg0DDAwLIAQgAUEBaiIBRw0AC0E3IQIMWwtBNyECDFoLIAFBAWohAQwEC0E7IQIgBCABIgBGDVggBCABayADKAIAIgFqIQYgACABa0EFaiEHAkADQCABQZDIAGotAAAgAC0AACIFQSByIAUgBUHBAGtB/wFxQRpJG0H/AXFHDQEgAUEFRgRAQQchAQw/CyABQQFqIQEgBCAAQQFqIgBHDQALIAMgBjYCAAxZCyADQQA2AgAgACEBDAULQTohAiAEIAEiAEYNVyAEIAFrIAMoAgAiAWohBiAAIAFrQQhqIQcCQANAIAFBtMEAai0AACAALQAAIgVBIHIgBSAFQcEAa0H/AXFBGkkbQf8BcUcNASABQQhGBEBBBSEBDD4LIAFBAWohASAEIABBAWoiAEcNAAsgAyAGNgIADFgLIANBADYCACAAIQEMBAtBOSECIAQgASIARg1WIAQgAWsgAygCACIBaiEGIAAgAWtBA2ohBwJAA0AgAUGwwQBqLQAAIAAtAAAiBUEgciAFIAVBwQBrQf8BcUEaSRtB/wFxRw0BIAFBA0YEQEEGIQEMPQsgAUEBaiEBIAQgAEEBaiIARw0ACyADIAY2AgAMVwsgA0EANgIAIAAhAQwDCwJAA0AgAS0AACIAQSBHBEAgAEEKaw4EBwQEBwILIAQgAUEBaiIBRw0AC0E4IQIMVgsgAEEsRw0BIAFBAWohAEEBIQECQAJAAkACQAJAIAMtACxBBWsOBAMBAgQACyAAIQEMBAtBAiEBDAELQQQhAQsgA0EBOgAsIAMgAy8BMiABcjsBMiAAIQEMAQsgAyADLwEyQQhyOwEyIAAhAQtBPiECDDsLIANBADoALAtBOSECDDkLIAEgBEYEQEE2IQIMUgsCQAJAAkACQAJAIAEtAABBCmsOBAACAgECCyADKAIEIQAgA0EANgIEIAMgACABEDEiAEUNAiADQTM2AhwgAyABNgIUIAMgADYCDEEAIQIMVQsgAygCBCEAIANBADYCBCADIAAgARAxIgBFBEAgAUEBaiEBDAYLIANBMjYCHCADIAA2AgwgAyABQQFqNgIUQQAhAgxUCyADLQAuQQFxBEBB3wEhAgw7CyADKAIEIQAgA0EANgIEIAMgACABEDEiAA0BDEkLQTQhAgw5CyADQTU2AhwgAyABNgIUIAMgADYCDEEAIQIMUQtBNSECDDcLIANBL2otAABBAXENACADQQA2AhwgAyABNgIUIANB6xY2AhAgA0EZNgIMQQAhAgxPC0EzIQIMNQsgASAERgRAQTIhAgxOCwJAIAEtAABBCkYEQCABQQFqIQEMAQsgA0EANgIcIAMgATYCFCADQZIXNgIQIANBAzYCDEEAIQIMTgtBMiECDDQLIAEgBEYEQEExIQIMTQsCQCABLQAAIgBBCUYNACAAQSBGDQBBASECAkAgAy0ALEEFaw4EBgQFAA0LIAMgAy8BMkEIcjsBMgwMCyADLQAuQQFxRQ0BIAMtACxBCEcNACADQQA6ACwLQT0hAgwyCyADQQA2AhwgAyABNgIUIANBwhY2AhAgA0EKNgIMQQAhAgxKC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyDAYLIAEgBEYEQEEwIQIMRwsgAS0AAEEKRgRAIAFBAWohAQwBCyADLQAuQQFxDQAgA0EANgIcIAMgATYCFCADQdwoNgIQIANBAjYCDEEAIQIMRgtBMCECDCwLIAFBAWohAUExIQIMKwsgASAERgRAQS8hAgxECyABLQAAIgBBCUcgAEEgR3FFBEAgAUEBaiEBIAMtAC5BAXENASADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMQQAhAgxEC0EBIQICQAJAAkACQAJAAkAgAy0ALEECaw4HBQQEAwECAAQLIAMgAy8BMkEIcjsBMgwDC0ECIQIMAQtBBCECCyADQQE6ACwgAyADLwEyIAJyOwEyC0EvIQIMKwsgA0EANgIcIAMgATYCFCADQYQTNgIQIANBCzYCDEEAIQIMQwtB4QEhAgwpCyABIARGBEBBLiECDEILIANBADYCBCADQRI2AgggAyABIAEQMSIADQELQS4hAgwnCyADQS02AhwgAyABNgIUIAMgADYCDEEAIQIMPwtBACEAAkAgAygCOCICRQ0AIAIoAkwiAkUNACADIAIRAAAhAAsgAEUNACAAQRVHDQEgA0HYADYCHCADIAE2AhQgA0GzGzYCECADQRU2AgxBACECDD4LQcwAIQIMJAsgA0EANgIcIAMgATYCFCADQbMONgIQIANBHTYCDEEAIQIMPAsgASAERgRAQc4AIQIMPAsgAS0AACIAQSBGDQIgAEE6Rg0BCyADQQA6ACxBCSECDCELIAMoAgQhACADQQA2AgQgAyAAIAEQMCIADQEMAgsgAy0ALkEBcQRAQd4BIQIMIAsgAygCBCEAIANBADYCBCADIAAgARAwIgBFDQIgA0EqNgIcIAMgADYCDCADIAFBAWo2AhRBACECDDgLIANBywA2AhwgAyAANgIMIAMgAUEBajYCFEEAIQIMNwsgAUEBaiEBQcAAIQIMHQsgAUEBaiEBDCwLIAEgBEYEQEErIQIMNQsCQCABLQAAQQpGBEAgAUEBaiEBDAELIAMtAC5BwABxRQ0GCyADLQAyQYABcQRAQQAhAAJAIAMoAjgiAkUNACACKAJcIgJFDQAgAyACEQAAIQALIABFDRIgAEEVRgRAIANBBTYCHCADIAE2AhQgA0GbGzYCECADQRU2AgxBACECDDYLIANBADYCHCADIAE2AhQgA0GQDjYCECADQRQ2AgxBACECDDULIANBMmohAiADEDVBACEAAkAgAygCOCIGRQ0AIAYoAigiBkUNACADIAYRAAAhAAsgAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIANBAToAMAsgAiACLwEAQcAAcjsBAAtBKyECDBgLIANBKTYCHCADIAE2AhQgA0GsGTYCECADQRU2AgxBACECDDALIANBADYCHCADIAE2AhQgA0HlCzYCECADQRE2AgxBACECDC8LIANBADYCHCADIAE2AhQgA0GlCzYCECADQQI2AgxBACECDC4LQQEhByADLwEyIgVBCHFFBEAgAykDIEIAUiEHCwJAIAMtADAEQEEBIQAgAy0AKUEFRg0BIAVBwABxRSAHcUUNAQsCQCADLQAoIgJBAkYEQEEBIQAgAy8BNCIGQeUARg0CQQAhACAFQcAAcQ0CIAZB5ABGDQIgBkHmAGtBAkkNAiAGQcwBRg0CIAZBsAJGDQIMAQtBACEAIAVBwABxDQELQQIhACAFQQhxDQAgBUGABHEEQAJAIAJBAUcNACADLQAuQQpxDQBBBSEADAILQQQhAAwBCyAFQSBxRQRAIAMQNkEAR0ECdCEADAELQQBBAyADKQMgUBshAAsgAEEBaw4FAgAHAQMEC0ERIQIMEwsgA0EBOgAxDCkLQQAhAgJAIAMoAjgiAEUNACAAKAIwIgBFDQAgAyAAEQAAIQILIAJFDSYgAkEVRgRAIANBAzYCHCADIAE2AhQgA0HSGzYCECADQRU2AgxBACECDCsLQQAhAiADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMDCoLIANBADYCHCADIAE2AhQgA0H5IDYCECADQQ82AgxBACECDCkLQQAhAAJAIAMoAjgiAkUNACACKAIwIgJFDQAgAyACEQAAIQALIAANAQtBDiECDA4LIABBFUYEQCADQQI2AhwgAyABNgIUIANB0hs2AhAgA0EVNgIMQQAhAgwnCyADQQA2AhwgAyABNgIUIANB3Q42AhAgA0ESNgIMQQAhAgwmC0EqIQIMDAsgASAERwRAIANBCTYCCCADIAE2AgRBKSECDAwLQSYhAgwkCyADIAMpAyAiDCAEIAFrrSIKfSILQgAgCyAMWBs3AyAgCiAMVARAQSUhAgwkCyADKAIEIQAgA0EANgIEIAMgACABIAynaiIBEDIiAEUNACADQQU2AhwgAyABNgIUIAMgADYCDEEAIQIMIwtBDyECDAkLQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABLQAAQTBrDjcXFgABAgMEBQYHFBQUFBQUFAgJCgsMDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUDg8QERITFAtCAiEKDBYLQgMhCgwVC0IEIQoMFAtCBSEKDBMLQgYhCgwSC0IHIQoMEQtCCCEKDBALQgkhCgwPC0IKIQoMDgtCCyEKDA0LQgwhCgwMC0INIQoMCwtCDiEKDAoLQg8hCgwJC0IKIQoMCAtCCyEKDAcLQgwhCgwGC0INIQoMBQtCDiEKDAQLQg8hCgwDCyADQQA2AhwgAyABNgIUIANBnxU2AhAgA0EMNgIMQQAhAgwhCyABIARGBEBBIiECDCELQgAhCgJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAS0AAEEwaw43FRQAAQIDBAUGBxYWFhYWFhYICQoLDA0WFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFg4PEBESExYLQgIhCgwUC0IDIQoMEwtCBCEKDBILQgUhCgwRC0IGIQoMEAtCByEKDA8LQgghCgwOC0IJIQoMDQtCCiEKDAwLQgshCgwLC0IMIQoMCgtCDSEKDAkLQg4hCgwIC0IPIQoMBwtCCiEKDAYLQgshCgwFC0IMIQoMBAtCDSEKDAMLQg4hCgwCC0IPIQoMAQtCASEKCyABQQFqIQEgAykDICILQv//////////D1gEQCADIAtCBIYgCoQ3AyAMAgsgA0EANgIcIAMgATYCFCADQbUJNgIQIANBDDYCDEEAIQIMHgtBJyECDAQLQSghAgwDCyADIAE6ACwgA0EANgIAIAdBAWohAUEMIQIMAgsgA0EANgIAIAZBAWohAUEKIQIMAQsgAUEBaiEBQQghAgwACwALQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBcLQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBYLQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBULQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDBQLQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDBMLQQAhAiADQQA2AhwgAyABNgIUIANBsjg2AhAgA0EINgIMDBILQQAhAiADQQA2AhwgAyABNgIUIANBgxE2AhAgA0EJNgIMDBELQQAhAiADQQA2AhwgAyABNgIUIANB3wo2AhAgA0EJNgIMDBALQQAhAiADQQA2AhwgAyABNgIUIANB7RA2AhAgA0EJNgIMDA8LQQAhAiADQQA2AhwgAyABNgIUIANB0hE2AhAgA0EJNgIMDA4LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDA0LQQAhAiADQQA2AhwgAyABNgIUIANBuRc2AhAgA0EPNgIMDAwLQQAhAiADQQA2AhwgAyABNgIUIANBmRM2AhAgA0ELNgIMDAsLQQAhAiADQQA2AhwgAyABNgIUIANBnQk2AhAgA0ELNgIMDAoLQQAhAiADQQA2AhwgAyABNgIUIANBlxA2AhAgA0EKNgIMDAkLQQAhAiADQQA2AhwgAyABNgIUIANBsRA2AhAgA0EKNgIMDAgLQQAhAiADQQA2AhwgAyABNgIUIANBux02AhAgA0ECNgIMDAcLQQAhAiADQQA2AhwgAyABNgIUIANBlhY2AhAgA0ECNgIMDAYLQQAhAiADQQA2AhwgAyABNgIUIANB+Rg2AhAgA0ECNgIMDAULQQAhAiADQQA2AhwgAyABNgIUIANBxBg2AhAgA0ECNgIMDAQLIANBAjYCHCADIAE2AhQgA0GpHjYCECADQRY2AgxBACECDAMLQd4AIQIgASAERg0CIAlBCGohByADKAIAIQUCQAJAIAEgBEcEQCAFQZbIAGohCCAEIAVqIAFrIQYgBUF/c0EKaiIFIAFqIQADQCABLQAAIAgtAABHBEBBAiEIDAMLIAVFBEBBACEIIAAhAQwDCyAFQQFrIQUgCEEBaiEIIAQgAUEBaiIBRw0ACyAGIQUgBCEBCyAHQQE2AgAgAyAFNgIADAELIANBADYCACAHIAg2AgALIAcgATYCBCAJKAIMIQACQAJAIAkoAghBAWsOAgQBAAsgA0EANgIcIANBwh42AhAgA0EXNgIMIAMgAEEBajYCFEEAIQIMAwsgA0EANgIcIAMgADYCFCADQdceNgIQIANBCTYCDEEAIQIMAgsgASAERgRAQSghAgwCCyADQQk2AgggAyABNgIEQSchAgwBCyABIARGBEBBASECDAELA0ACQAJAAkAgAS0AAEEKaw4EAAEBAAELIAFBAWohAQwBCyABQQFqIQEgAy0ALkEgcQ0AQQAhAiADQQA2AhwgAyABNgIUIANBoSE2AhAgA0EFNgIMDAILQQEhAiABIARHDQALCyAJQRBqJAAgAkUEQCADKAIMIQAMAQsgAyACNgIcQQAhACADKAIEIgFFDQAgAyABIAQgAygCCBEBACIBRQ0AIAMgBDYCFCADIAE2AgwgASEACyAAC74CAQJ/IABBADoAACAAQeQAaiIBQQFrQQA6AAAgAEEAOgACIABBADoAASABQQNrQQA6AAAgAUECa0EAOgAAIABBADoAAyABQQRrQQA6AABBACAAa0EDcSIBIABqIgBBADYCAEHkACABa0F8cSICIABqIgFBBGtBADYCAAJAIAJBCUkNACAAQQA2AgggAEEANgIEIAFBCGtBADYCACABQQxrQQA2AgAgAkEZSQ0AIABBADYCGCAAQQA2AhQgAEEANgIQIABBADYCDCABQRBrQQA2AgAgAUEUa0EANgIAIAFBGGtBADYCACABQRxrQQA2AgAgAiAAQQRxQRhyIgJrIgFBIEkNACAAIAJqIQADQCAAQgA3AxggAEIANwMQIABCADcDCCAAQgA3AwAgAEEgaiEAIAFBIGsiAUEfSw0ACwsLVgEBfwJAIAAoAgwNAAJAAkACQAJAIAAtADEOAwEAAwILIAAoAjgiAUUNACABKAIwIgFFDQAgACABEQAAIgENAwtBAA8LAAsgAEHKGTYCEEEOIQELIAELGgAgACgCDEUEQCAAQd4fNgIQIABBFTYCDAsLFAAgACgCDEEVRgRAIABBADYCDAsLFAAgACgCDEEWRgRAIABBADYCDAsLBwAgACgCDAsHACAAKAIQCwkAIAAgATYCEAsHACAAKAIUCysAAkAgAEEnTw0AQv//////CSAArYhCAYNQDQAgAEECdEHQOGooAgAPCwALFwAgAEEvTwRAAAsgAEECdEHsOWooAgALvwkBAX9B9C0hAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB5ABrDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0HqLA8LQZgmDwtB7TEPC0GgNw8LQckpDwtBtCkPC0GWLQ8LQesrDwtBojUPC0HbNA8LQeApDwtB4yQPC0HVJA8LQe4kDwtB5iUPC0HKNA8LQdA3DwtBqjUPC0H1LA8LQfYmDwtBgiIPC0HyMw8LQb4oDwtB5zcPC0HNIQ8LQcAhDwtBuCUPC0HLJQ8LQZYkDwtBjzQPC0HNNQ8LQd0qDwtB7jMPC0GcNA8LQZ4xDwtB9DUPC0HlIg8LQa8lDwtBmTEPC0GyNg8LQfk2DwtBxDIPC0HdLA8LQYIxDwtBwTEPC0GNNw8LQckkDwtB7DYPC0HnKg8LQcgjDwtB4iEPC0HJNw8LQaUiDwtBlCIPC0HbNg8LQd41DwtBhiYPC0G8Kw8LQYsyDwtBoCMPC0H2MA8LQYAsDwtBiSsPC0GkJg8LQfIjDwtBgSgPC0GrMg8LQesnDwtBwjYPC0GiJA8LQc8qDwtB3CMPC0GHJw8LQeQ0DwtBtyIPC0GtMQ8LQdUiDwtBrzQPC0HeJg8LQdYyDwtB9DQPC0GBOA8LQfQ3DwtBkjYPC0GdJw8LQYIpDwtBjSMPC0HXMQ8LQb01DwtBtDcPC0HYMA8LQbYnDwtBmjgPC0GnKg8LQcQnDwtBriMPC0H1Ig8LAAtByiYhAQsgAQsXACAAIAAvAS5B/v8DcSABQQBHcjsBLgsaACAAIAAvAS5B/f8DcSABQQBHQQF0cjsBLgsaACAAIAAvAS5B+/8DcSABQQBHQQJ0cjsBLgsaACAAIAAvAS5B9/8DcSABQQBHQQN0cjsBLgsaACAAIAAvAS5B7/8DcSABQQBHQQR0cjsBLgsaACAAIAAvAS5B3/8DcSABQQBHQQV0cjsBLgsaACAAIAAvAS5Bv/8DcSABQQBHQQZ0cjsBLgsaACAAIAAvAS5B//4DcSABQQBHQQd0cjsBLgsaACAAIAAvAS5B//0DcSABQQBHQQh0cjsBLgsaACAAIAAvAS5B//sDcSABQQBHQQl0cjsBLgs+AQJ/AkAgACgCOCIDRQ0AIAMoAgQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeESNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAggiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfwRNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAgwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQewKNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQfoeNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQcsQNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhgiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQbcfNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAhwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQb8VNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiwiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQf4INgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiAiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQYwdNgIQQRghBAsgBAs+AQJ/AkAgACgCOCIDRQ0AIAMoAiQiA0UNACAAIAEgAiABayADEQEAIgRBf0cNACAAQeYVNgIQQRghBAsgBAs4ACAAAn8gAC8BMkEUcUEURgRAQQEgAC0AKEEBRg0BGiAALwE0QeUARgwBCyAALQApQQVGCzoAMAtZAQJ/AkAgAC0AKEEBRg0AIAAvATQiAUHkAGtB5ABJDQAgAUHMAUYNACABQbACRg0AIAAvATIiAEHAAHENAEEBIQIgAEGIBHFBgARGDQAgAEEocUUhAgsgAguMAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQAgAC8BMiIBQQJxRQ0BDAILIAAvATIiAUEBcUUNAQtBASECIAAtAChBAUYNACAALwE0IgBB5ABrQeQASQ0AIABBzAFGDQAgAEGwAkYNACABQcAAcQ0AQQAhAiABQYgEcUGABEYNACABQShxQQBHIQILIAILcwAgAEEQav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAP0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEwav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEEgav0MAAAAAAAAAAAAAAAAAAAAAP0LAwAgAEH9ATYCHAsGACAAEDoLmi0BC38jAEEQayIKJABB3NUAKAIAIglFBEBBnNkAKAIAIgVFBEBBqNkAQn83AgBBoNkAQoCAhICAgMAANwIAQZzZACAKQQhqQXBxQdiq1aoFcyIFNgIAQbDZAEEANgIAQYDZAEEANgIAC0GE2QBBwNkENgIAQdTVAEHA2QQ2AgBB6NUAIAU2AgBB5NUAQX82AgBBiNkAQcCmAzYCAANAIAFBgNYAaiABQfTVAGoiAjYCACACIAFB7NUAaiIDNgIAIAFB+NUAaiADNgIAIAFBiNYAaiABQfzVAGoiAzYCACADIAI2AgAgAUGQ1gBqIAFBhNYAaiICNgIAIAIgAzYCACABQYzWAGogAjYCACABQSBqIgFBgAJHDQALQczZBEGBpgM2AgBB4NUAQazZACgCADYCAEHQ1QBBgKYDNgIAQdzVAEHI2QQ2AgBBzP8HQTg2AgBByNkEIQkLAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAU0EQEHE1QAoAgAiBkEQIABBE2pBcHEgAEELSRsiBEEDdiIAdiIBQQNxBEACQCABQQFxIAByQQFzIgJBA3QiAEHs1QBqIgEgAEH01QBqKAIAIgAoAggiA0YEQEHE1QAgBkF+IAJ3cTYCAAwBCyABIAM2AgggAyABNgIMCyAAQQhqIQEgACACQQN0IgJBA3I2AgQgACACaiIAIAAoAgRBAXI2AgQMEQtBzNUAKAIAIgggBE8NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgBBA3QiAkHs1QBqIgEgAkH01QBqKAIAIgIoAggiA0YEQEHE1QAgBkF+IAB3cSIGNgIADAELIAEgAzYCCCADIAE2AgwLIAIgBEEDcjYCBCAAQQN0IgAgBGshBSAAIAJqIAU2AgAgAiAEaiIEIAVBAXI2AgQgCARAIAhBeHFB7NUAaiEAQdjVACgCACEDAn9BASAIQQN2dCIBIAZxRQRAQcTVACABIAZyNgIAIAAMAQsgACgCCAsiASADNgIMIAAgAzYCCCADIAA2AgwgAyABNgIICyACQQhqIQFB2NUAIAQ2AgBBzNUAIAU2AgAMEQtByNUAKAIAIgtFDQEgC2hBAnRB9NcAaigCACIAKAIEQXhxIARrIQUgACECA0ACQCACKAIQIgFFBEAgAkEUaigCACIBRQ0BCyABKAIEQXhxIARrIgMgBUkhAiADIAUgAhshBSABIAAgAhshACABIQIMAQsLIAAoAhghCSAAKAIMIgMgAEcEQEHU1QAoAgAaIAMgACgCCCIBNgIIIAEgAzYCDAwQCyAAQRRqIgIoAgAiAUUEQCAAKAIQIgFFDQMgAEEQaiECCwNAIAIhByABIgNBFGoiAigCACIBDQAgA0EQaiECIAMoAhAiAQ0ACyAHQQA2AgAMDwtBfyEEIABBv39LDQAgAEETaiIBQXBxIQRByNUAKAIAIghFDQBBACAEayEFAkACQAJAAn9BACAEQYACSQ0AGkEfIARB////B0sNABogBEEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+agsiBkECdEH01wBqKAIAIgJFBEBBACEBQQAhAwwBC0EAIQEgBEEZIAZBAXZrQQAgBkEfRxt0IQBBACEDA0ACQCACKAIEQXhxIARrIgcgBU8NACACIQMgByIFDQBBACEFIAIhAQwDCyABIAJBFGooAgAiByAHIAIgAEEddkEEcWpBEGooAgAiAkYbIAEgBxshASAAQQF0IQAgAg0ACwsgASADckUEQEEAIQNBAiAGdCIAQQAgAGtyIAhxIgBFDQMgAGhBAnRB9NcAaigCACEBCyABRQ0BCwNAIAEoAgRBeHEgBGsiAiAFSSEAIAIgBSAAGyEFIAEgAyAAGyEDIAEoAhAiAAR/IAAFIAFBFGooAgALIgENAAsLIANFDQAgBUHM1QAoAgAgBGtPDQAgAygCGCEHIAMgAygCDCIARwRAQdTVACgCABogACADKAIIIgE2AgggASAANgIMDA4LIANBFGoiAigCACIBRQRAIAMoAhAiAUUNAyADQRBqIQILA0AgAiEGIAEiAEEUaiICKAIAIgENACAAQRBqIQIgACgCECIBDQALIAZBADYCAAwNC0HM1QAoAgAiAyAETwRAQdjVACgCACEBAkAgAyAEayICQRBPBEAgASAEaiIAIAJBAXI2AgQgASADaiACNgIAIAEgBEEDcjYCBAwBCyABIANBA3I2AgQgASADaiIAIAAoAgRBAXI2AgRBACEAQQAhAgtBzNUAIAI2AgBB2NUAIAA2AgAgAUEIaiEBDA8LQdDVACgCACIDIARLBEAgBCAJaiIAIAMgBGsiAUEBcjYCBEHc1QAgADYCAEHQ1QAgATYCACAJIARBA3I2AgQgCUEIaiEBDA8LQQAhASAEAn9BnNkAKAIABEBBpNkAKAIADAELQajZAEJ/NwIAQaDZAEKAgISAgIDAADcCAEGc2QAgCkEMakFwcUHYqtWqBXM2AgBBsNkAQQA2AgBBgNkAQQA2AgBBgIAECyIAIARBxwBqIgVqIgZBACAAayIHcSICTwRAQbTZAEEwNgIADA8LAkBB/NgAKAIAIgFFDQBB9NgAKAIAIgggAmohACAAIAFNIAAgCEtxDQBBACEBQbTZAEEwNgIADA8LQYDZAC0AAEEEcQ0EAkACQCAJBEBBhNkAIQEDQCABKAIAIgAgCU0EQCAAIAEoAgRqIAlLDQMLIAEoAggiAQ0ACwtBABA7IgBBf0YNBSACIQZBoNkAKAIAIgFBAWsiAyAAcQRAIAIgAGsgACADakEAIAFrcWohBgsgBCAGTw0FIAZB/v///wdLDQVB/NgAKAIAIgMEQEH02AAoAgAiByAGaiEBIAEgB00NBiABIANLDQYLIAYQOyIBIABHDQEMBwsgBiADayAHcSIGQf7///8HSw0EIAYQOyEAIAAgASgCACABKAIEakYNAyAAIQELAkAgBiAEQcgAak8NACABQX9GDQBBpNkAKAIAIgAgBSAGa2pBACAAa3EiAEH+////B0sEQCABIQAMBwsgABA7QX9HBEAgACAGaiEGIAEhAAwHC0EAIAZrEDsaDAQLIAEiAEF/Rw0FDAMLQQAhAwwMC0EAIQAMCgsgAEF/Rw0CC0GA2QBBgNkAKAIAQQRyNgIACyACQf7///8HSw0BIAIQOyEAQQAQOyEBIABBf0YNASABQX9GDQEgACABTw0BIAEgAGsiBiAEQThqTQ0BC0H02ABB9NgAKAIAIAZqIgE2AgBB+NgAKAIAIAFJBEBB+NgAIAE2AgALAkACQAJAQdzVACgCACICBEBBhNkAIQEDQCAAIAEoAgAiAyABKAIEIgVqRg0CIAEoAggiAQ0ACwwCC0HU1QAoAgAiAUEARyAAIAFPcUUEQEHU1QAgADYCAAtBACEBQYjZACAGNgIAQYTZACAANgIAQeTVAEF/NgIAQejVAEGc2QAoAgA2AgBBkNkAQQA2AgADQCABQYDWAGogAUH01QBqIgI2AgAgAiABQezVAGoiAzYCACABQfjVAGogAzYCACABQYjWAGogAUH81QBqIgM2AgAgAyACNgIAIAFBkNYAaiABQYTWAGoiAjYCACACIAM2AgAgAUGM1gBqIAI2AgAgAUEgaiIBQYACRw0AC0F4IABrQQ9xIgEgAGoiAiAGQThrIgMgAWsiAUEBcjYCBEHg1QBBrNkAKAIANgIAQdDVACABNgIAQdzVACACNgIAIAAgA2pBODYCBAwCCyAAIAJNDQAgAiADSQ0AIAEoAgxBCHENAEF4IAJrQQ9xIgAgAmoiA0HQ1QAoAgAgBmoiByAAayIAQQFyNgIEIAEgBSAGajYCBEHg1QBBrNkAKAIANgIAQdDVACAANgIAQdzVACADNgIAIAIgB2pBODYCBAwBCyAAQdTVACgCAEkEQEHU1QAgADYCAAsgACAGaiEDQYTZACEBAkACQAJAA0AgAyABKAIARwRAIAEoAggiAQ0BDAILCyABLQAMQQhxRQ0BC0GE2QAhAQNAIAEoAgAiAyACTQRAIAMgASgCBGoiBSACSw0DCyABKAIIIQEMAAsACyABIAA2AgAgASABKAIEIAZqNgIEIABBeCAAa0EPcWoiCSAEQQNyNgIEIANBeCADa0EPcWoiBiAEIAlqIgRrIQEgAiAGRgRAQdzVACAENgIAQdDVAEHQ1QAoAgAgAWoiADYCACAEIABBAXI2AgQMCAtB2NUAKAIAIAZGBEBB2NUAIAQ2AgBBzNUAQczVACgCACABaiIANgIAIAQgAEEBcjYCBCAAIARqIAA2AgAMCAsgBigCBCIFQQNxQQFHDQYgBUF4cSEIIAVB/wFNBEAgBUEDdiEDIAYoAggiACAGKAIMIgJGBEBBxNUAQcTVACgCAEF+IAN3cTYCAAwHCyACIAA2AgggACACNgIMDAYLIAYoAhghByAGIAYoAgwiAEcEQCAAIAYoAggiAjYCCCACIAA2AgwMBQsgBkEUaiICKAIAIgVFBEAgBigCECIFRQ0EIAZBEGohAgsDQCACIQMgBSIAQRRqIgIoAgAiBQ0AIABBEGohAiAAKAIQIgUNAAsgA0EANgIADAQLQXggAGtBD3EiASAAaiIHIAZBOGsiAyABayIBQQFyNgIEIAAgA2pBODYCBCACIAVBNyAFa0EPcWpBP2siAyADIAJBEGpJGyIDQSM2AgRB4NUAQazZACgCADYCAEHQ1QAgATYCAEHc1QAgBzYCACADQRBqQYzZACkCADcCACADQYTZACkCADcCCEGM2QAgA0EIajYCAEGI2QAgBjYCAEGE2QAgADYCAEGQ2QBBADYCACADQSRqIQEDQCABQQc2AgAgBSABQQRqIgFLDQALIAIgA0YNACADIAMoAgRBfnE2AgQgAyADIAJrIgU2AgAgAiAFQQFyNgIEIAVB/wFNBEAgBUF4cUHs1QBqIQACf0HE1QAoAgAiAUEBIAVBA3Z0IgNxRQRAQcTVACABIANyNgIAIAAMAQsgACgCCAsiASACNgIMIAAgAjYCCCACIAA2AgwgAiABNgIIDAELQR8hASAFQf///wdNBEAgBUEmIAVBCHZnIgBrdkEBcSAAQQF0a0E+aiEBCyACIAE2AhwgAkIANwIQIAFBAnRB9NcAaiEAQcjVACgCACIDQQEgAXQiBnFFBEAgACACNgIAQcjVACADIAZyNgIAIAIgADYCGCACIAI2AgggAiACNgIMDAELIAVBGSABQQF2a0EAIAFBH0cbdCEBIAAoAgAhAwJAA0AgAyIAKAIEQXhxIAVGDQEgAUEddiEDIAFBAXQhASAAIANBBHFqQRBqIgYoAgAiAw0ACyAGIAI2AgAgAiAANgIYIAIgAjYCDCACIAI2AggMAQsgACgCCCIBIAI2AgwgACACNgIIIAJBADYCGCACIAA2AgwgAiABNgIIC0HQ1QAoAgAiASAETQ0AQdzVACgCACIAIARqIgIgASAEayIBQQFyNgIEQdDVACABNgIAQdzVACACNgIAIAAgBEEDcjYCBCAAQQhqIQEMCAtBACEBQbTZAEEwNgIADAcLQQAhAAsgB0UNAAJAIAYoAhwiAkECdEH01wBqIgMoAgAgBkYEQCADIAA2AgAgAA0BQcjVAEHI1QAoAgBBfiACd3E2AgAMAgsgB0EQQRQgBygCECAGRhtqIAA2AgAgAEUNAQsgACAHNgIYIAYoAhAiAgRAIAAgAjYCECACIAA2AhgLIAZBFGooAgAiAkUNACAAQRRqIAI2AgAgAiAANgIYCyABIAhqIQEgBiAIaiIGKAIEIQULIAYgBUF+cTYCBCABIARqIAE2AgAgBCABQQFyNgIEIAFB/wFNBEAgAUF4cUHs1QBqIQACf0HE1QAoAgAiAkEBIAFBA3Z0IgFxRQRAQcTVACABIAJyNgIAIAAMAQsgACgCCAsiASAENgIMIAAgBDYCCCAEIAA2AgwgBCABNgIIDAELQR8hBSABQf///wdNBEAgAUEmIAFBCHZnIgBrdkEBcSAAQQF0a0E+aiEFCyAEIAU2AhwgBEIANwIQIAVBAnRB9NcAaiEAQcjVACgCACICQQEgBXQiA3FFBEAgACAENgIAQcjVACACIANyNgIAIAQgADYCGCAEIAQ2AgggBCAENgIMDAELIAFBGSAFQQF2a0EAIAVBH0cbdCEFIAAoAgAhAAJAA0AgACICKAIEQXhxIAFGDQEgBUEddiEAIAVBAXQhBSACIABBBHFqQRBqIgMoAgAiAA0ACyADIAQ2AgAgBCACNgIYIAQgBDYCDCAEIAQ2AggMAQsgAigCCCIAIAQ2AgwgAiAENgIIIARBADYCGCAEIAI2AgwgBCAANgIICyAJQQhqIQEMAgsCQCAHRQ0AAkAgAygCHCIBQQJ0QfTXAGoiAigCACADRgRAIAIgADYCACAADQFByNUAIAhBfiABd3EiCDYCAAwCCyAHQRBBFCAHKAIQIANGG2ogADYCACAARQ0BCyAAIAc2AhggAygCECIBBEAgACABNgIQIAEgADYCGAsgA0EUaigCACIBRQ0AIABBFGogATYCACABIAA2AhgLAkAgBUEPTQRAIAMgBCAFaiIAQQNyNgIEIAAgA2oiACAAKAIEQQFyNgIEDAELIAMgBGoiAiAFQQFyNgIEIAMgBEEDcjYCBCACIAVqIAU2AgAgBUH/AU0EQCAFQXhxQezVAGohAAJ/QcTVACgCACIBQQEgBUEDdnQiBXFFBEBBxNUAIAEgBXI2AgAgAAwBCyAAKAIICyIBIAI2AgwgACACNgIIIAIgADYCDCACIAE2AggMAQtBHyEBIAVB////B00EQCAFQSYgBUEIdmciAGt2QQFxIABBAXRrQT5qIQELIAIgATYCHCACQgA3AhAgAUECdEH01wBqIQBBASABdCIEIAhxRQRAIAAgAjYCAEHI1QAgBCAIcjYCACACIAA2AhggAiACNgIIIAIgAjYCDAwBCyAFQRkgAUEBdmtBACABQR9HG3QhASAAKAIAIQQCQANAIAQiACgCBEF4cSAFRg0BIAFBHXYhBCABQQF0IQEgACAEQQRxakEQaiIGKAIAIgQNAAsgBiACNgIAIAIgADYCGCACIAI2AgwgAiACNgIIDAELIAAoAggiASACNgIMIAAgAjYCCCACQQA2AhggAiAANgIMIAIgATYCCAsgA0EIaiEBDAELAkAgCUUNAAJAIAAoAhwiAUECdEH01wBqIgIoAgAgAEYEQCACIAM2AgAgAw0BQcjVACALQX4gAXdxNgIADAILIAlBEEEUIAkoAhAgAEYbaiADNgIAIANFDQELIAMgCTYCGCAAKAIQIgEEQCADIAE2AhAgASADNgIYCyAAQRRqKAIAIgFFDQAgA0EUaiABNgIAIAEgAzYCGAsCQCAFQQ9NBEAgACAEIAVqIgFBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQMAQsgACAEaiIHIAVBAXI2AgQgACAEQQNyNgIEIAUgB2ogBTYCACAIBEAgCEF4cUHs1QBqIQFB2NUAKAIAIQMCf0EBIAhBA3Z0IgIgBnFFBEBBxNUAIAIgBnI2AgAgAQwBCyABKAIICyICIAM2AgwgASADNgIIIAMgATYCDCADIAI2AggLQdjVACAHNgIAQczVACAFNgIACyAAQQhqIQELIApBEGokACABC0MAIABFBEA/AEEQdA8LAkAgAEH//wNxDQAgAEEASA0AIABBEHZAACIAQX9GBEBBtNkAQTA2AgBBfw8LIABBEHQPCwALC5lCIgBBgAgLDQEAAAAAAAAAAgAAAAMAQZgICwUEAAAABQBBqAgLCQYAAAAHAAAACABB5AgLwjJJbnZhbGlkIGNoYXIgaW4gdXJsIHF1ZXJ5AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fYm9keQBDb250ZW50LUxlbmd0aCBvdmVyZmxvdwBDaHVuayBzaXplIG92ZXJmbG93AEludmFsaWQgbWV0aG9kIGZvciBIVFRQL3gueCByZXF1ZXN0AEludmFsaWQgbWV0aG9kIGZvciBSVFNQL3gueCByZXF1ZXN0AEV4cGVjdGVkIFNPVVJDRSBtZXRob2QgZm9yIElDRS94LnggcmVxdWVzdABJbnZhbGlkIGNoYXIgaW4gdXJsIGZyYWdtZW50IHN0YXJ0AEV4cGVjdGVkIGRvdABTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3N0YXR1cwBJbnZhbGlkIHJlc3BvbnNlIHN0YXR1cwBFeHBlY3RlZCBMRiBhZnRlciBoZWFkZXJzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3Byb3RvY29sX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fcHJvdG9jb2wARW1wdHkgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyYWN0ZXIgaW4gQ29udGVudC1MZW5ndGgAVHJhbnNmZXItRW5jb2RpbmcgY2FuJ3QgYmUgcHJlc2VudCB3aXRoIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgc2l6ZQBFeHBlY3RlZCBMRiBhZnRlciBjaHVuayBzaXplAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBVbmV4cGVjdGVkIHdoaXRlc3BhY2UgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgaGVhZGVyIHZhbHVlAE1pc3NpbmcgZXhwZWN0ZWQgTEYgYWZ0ZXIgaGVhZGVyIHZhbHVlAEludmFsaWQgYFRyYW5zZmVyLUVuY29kaW5nYCBoZWFkZXIgdmFsdWUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciBjaHVuayBleHRlbnNpb24gdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZSB2YWx1ZQBJbnZhbGlkIHF1b3RlZC1wYWlyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fcHJvdG9jb2xfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUATWlzc2luZyBleHBlY3RlZCBDUiBhZnRlciByZXNwb25zZSBsaW5lAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX25hbWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBuYW1lAE1pc3NpbmcgZXhwZWN0ZWQgQ1IgYWZ0ZXIgY2h1bmsgZXh0ZW5zaW9uIG5hbWUASW52YWxpZCBzdGF0dXMgY29kZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABNaXNzaW5nIGV4cGVjdGVkIENSIGFmdGVyIGNodW5rIGRhdGEARXhwZWN0ZWQgTEYgYWZ0ZXIgY2h1bmsgZGF0YQBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AARGF0YSBhZnRlciBgQ29ubmVjdGlvbjogY2xvc2VgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBRVUVSWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAEV4cGVjdGVkIExGIGFmdGVyIENSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX1BST1RPQ09MX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19DT01QTEVURQBIUEVfQ0JfSEVBREVSX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9OQU1FX0NPTVBMRVRFAEhQRV9DQl9NRVNTQUdFX0NPTVBMRVRFAEhQRV9DQl9NRVRIT0RfQ09NUExFVEUASFBFX0NCX0hFQURFUl9GSUVMRF9DT01QTEVURQBERUxFVEUASFBFX0lOVkFMSURfRU9GX1NUQVRFAElOVkFMSURfU1NMX0NFUlRJRklDQVRFAFBBVVNFAE5PX1JFU1BPTlNFAFVOU1VQUE9SVEVEX01FRElBX1RZUEUAR09ORQBOT1RfQUNDRVBUQUJMRQBTRVJWSUNFX1VOQVZBSUxBQkxFAFJBTkdFX05PVF9TQVRJU0ZJQUJMRQBPUklHSU5fSVNfVU5SRUFDSEFCTEUAUkVTUE9OU0VfSVNfU1RBTEUAUFVSR0UATUVSR0UAUkVRVUVTVF9IRUFERVJfRklFTERTX1RPT19MQVJHRQBSRVFVRVNUX0hFQURFUl9UT09fTEFSR0UAUEFZTE9BRF9UT09fTEFSR0UASU5TVUZGSUNJRU5UX1NUT1JBR0UASFBFX1BBVVNFRF9VUEdSQURFAEhQRV9QQVVTRURfSDJfVVBHUkFERQBTT1VSQ0UAQU5OT1VOQ0UAVFJBQ0UASFBFX1VORVhQRUNURURfU1BBQ0UAREVTQ1JJQkUAVU5TVUJTQ1JJQkUAUkVDT1JEAEhQRV9JTlZBTElEX01FVEhPRABOT1RfRk9VTkQAUFJPUEZJTkQAVU5CSU5EAFJFQklORABVTkFVVEhPUklaRUQATUVUSE9EX05PVF9BTExPV0VEAEhUVFBfVkVSU0lPTl9OT1RfU1VQUE9SVEVEAEFMUkVBRFlfUkVQT1JURUQAQUNDRVBURUQATk9UX0lNUExFTUVOVEVEAExPT1BfREVURUNURUQASFBFX0NSX0VYUEVDVEVEAEhQRV9MRl9FWFBFQ1RFRABDUkVBVEVEAElNX1VTRUQASFBFX1BBVVNFRABUSU1FT1VUX09DQ1VSRUQAUEFZTUVOVF9SRVFVSVJFRABQUkVDT05ESVRJT05fUkVRVUlSRUQAUFJPWFlfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATkVUV09SS19BVVRIRU5USUNBVElPTl9SRVFVSVJFRABMRU5HVEhfUkVRVUlSRUQAU1NMX0NFUlRJRklDQVRFX1JFUVVJUkVEAFVQR1JBREVfUkVRVUlSRUQAUEFHRV9FWFBJUkVEAFBSRUNPTkRJVElPTl9GQUlMRUQARVhQRUNUQVRJT05fRkFJTEVEAFJFVkFMSURBVElPTl9GQUlMRUQAU1NMX0hBTkRTSEFLRV9GQUlMRUQATE9DS0VEAFRSQU5TRk9STUFUSU9OX0FQUExJRUQATk9UX01PRElGSUVEAE5PVF9FWFRFTkRFRABCQU5EV0lEVEhfTElNSVRfRVhDRUVERUQAU0lURV9JU19PVkVSTE9BREVEAEhFQUQARXhwZWN0ZWQgSFRUUC8sIFJUU1AvIG9yIElDRS8A5xUAAK8VAACkEgAAkhoAACYWAACeFAAA2xkAAHkVAAB+EgAA/hQAADYVAAALFgAA2BYAAPMSAABCGAAArBYAABIVAAAUFwAA7xcAAEgUAABxFwAAshoAAGsZAAB+GQAANRQAAIIaAABEFwAA/RYAAB4YAACHFwAAqhkAAJMSAAAHGAAALBcAAMoXAACkFwAA5xUAAOcVAABYFwAAOxgAAKASAAAtHAAAwxEAAEgRAADeEgAAQhMAAKQZAAD9EAAA9xUAAKUVAADvFgAA+BkAAEoWAABWFgAA9RUAAAoaAAAIGgAAARoAAKsVAABCEgAA1xAAAEwRAAAFGQAAVBYAAB4RAADKGQAAyBkAAE4WAAD/GAAAcRQAAPAVAADuFQAAlBkAAPwVAAC/GQAAmxkAAHwUAABDEQAAcBgAAJUUAAAnFAAAGRQAANUSAADUGQAARBYAAPcQAEG5OwsBAQBB0DsL4AEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBuj0LBAEAAAIAQdE9C14DBAMDAwMDAAADAwADAwADAwMDAwMDAwMDAAUAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAwADAEG6PwsEAQAAAgBB0T8LXgMAAwMDAwMAAAMDAAMDAAMDAwMDAwMDAwMABAAFAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwADAAMAQbDBAAsNbG9zZWVlcC1hbGl2ZQBBycEACwEBAEHgwQAL4AEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQBBycMACwEBAEHgwwAL5wEBAQEBAQEBAQEBAQECAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAWNodW5rZWQAQfHFAAteAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQBB0McACyFlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AQYDIAAsgcmFuc2Zlci1lbmNvZGluZ3BncmFkZQ0KDQpTTQ0KDQoAQanIAAsFAQIAAQMAQcDIAAtfBAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanKAAsFAQIAAQMAQcDKAAtfBAUFBgUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAQanMAAsEAQAAAQBBwcwAC14CAgACAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAEGpzgALBQECAAEDAEHAzgALXwQFAAAFBQUFBQUFBQUFBQYFBQUFBQUFBQUFBQUABQAHCAUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQAFAAUABQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUAAAAFAEGp0AALBQEBAAEBAEHA0AALAQEAQdrQAAtBAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQanSAAsFAQEAAQEAQcDSAAsBAQBBytIACwYCAAAAAAIAQeHSAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBBoNQAC50BTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRVVFUllPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFVFRQQ0VUU1BBRFRQLw==",yrr;Object.defineProperty(rFn,"exports",{get:a(()=>yrr||(yrr=XCs.from(ebs,"base64")),"get")})});var URe=I((GJd,dFn)=>{"use strict";p();var iFn=["GET","HEAD","POST"],tbs=new Set(iFn),rbs=[101,204,205,304],oFn=[301,302,303,307,308],nbs=new Set(oFn),sFn=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"],ibs=new Set(sFn),aFn=["no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"],obs=["",...aFn],sbs=new Set(aFn),abs=["follow","manual","error"],cFn=["GET","HEAD","OPTIONS","TRACE"],cbs=new Set(cFn),lbs=["navigate","same-origin","no-cors","cors"],ubs=["omit","same-origin","include"],dbs=["default","no-store","reload","no-cache","force-cache","only-if-cached"],fbs=["content-encoding","content-language","content-location","content-type","content-length"],pbs=["half"],lFn=["CONNECT","TRACE","TRACK"],hbs=new Set(lFn),uFn=["audio","audioworklet","font","image","manifest","paintworklet","script","style","track","video","xslt",""],mbs=new Set(uFn);dFn.exports={subresource:uFn,forbiddenMethods:lFn,requestBodyHeader:fbs,referrerPolicy:obs,requestRedirect:abs,requestMode:lbs,requestCredentials:ubs,requestCache:dbs,redirectStatus:oFn,corsSafeListedMethods:iFn,nullBodyStatus:rbs,safeMethods:cFn,badPorts:sFn,requestDuplex:pbs,subresourceSet:mbs,badPortsSet:ibs,redirectStatusSet:nbs,corsSafeListedMethodsSet:tbs,safeMethodsSet:cbs,forbiddenMethodsSet:hbs,referrerPolicyTokens:sbs}});var _rr=I((VJd,fFn)=>{"use strict";p();var Err=Symbol.for("undici.globalOrigin.1");function gbs(){return globalThis[Err]}a(gbs,"getGlobalOrigin");function Abs(t){if(t===void 0){Object.defineProperty(globalThis,Err,{value:void 0,writable:!0,enumerable:!1,configurable:!1});return}let e=new URL(t);if(e.protocol!=="http:"&&e.protocol!=="https:")throw new TypeError(`Only http & https urls are allowed, received ${e.protocol}`);Object.defineProperty(globalThis,Err,{value:e,writable:!0,enumerable:!1,configurable:!1})}a(Abs,"setGlobalOrigin");fFn.exports={getGlobalOrigin:gbs,setGlobalOrigin:Abs}});var sit=I((YJd,pFn)=>{"use strict";p();var ybs=new TextDecoder;function Ebs(t){return t.length===0?"":(t[0]===239&&t[1]===187&&t[2]===191&&(t=t.subarray(3)),ybs.decode(t))}a(Ebs,"utf8DecodeBytes");pFn.exports={utf8DecodeBytes:Ebs}});var sF=I((ZJd,AFn)=>{"use strict";p();var hFn=require("node:assert"),{utf8DecodeBytes:_bs}=sit();function vbs(t,e,r){let n="";for(;r.positione)return String.fromCharCode.apply(null,t);let r="",n=0,o=65535;for(;ne&&(o=e-n),r+=String.fromCharCode.apply(null,t.subarray(n,n+=o));return r}a(Tbs,"isomorphicDecode");var Ibs=/[^\x00-\xFF]/;function xbs(t){return hFn(!Ibs.test(t)),t}a(xbs,"isomorphicEncode");function wbs(t){return JSON.parse(_bs(t))}a(wbs,"parseJSONFromBytes");function Rbs(t,e=!0,r=!0){return gFn(t,e,r,mFn)}a(Rbs,"removeASCIIWhitespace");function gFn(t,e,r,n){let o=0,s=t.length-1;if(e)for(;o0&&n(t.charCodeAt(s));)s--;return o===0&&s===t.length-1?t:t.slice(o,s+1)}a(gFn,"removeChars");function Pbs(t){let e=JSON.stringify(t);if(e===void 0)throw new TypeError("Value is not JSON serializable");return hFn(typeof e=="string"),e}a(Pbs,"serializeJavascriptValueToJSONString");AFn.exports={collectASequenceOfCodePoints:vbs,collectASequenceOfCodePointsFast:Cbs,forgivingBase64:Sbs,isASCIIWhitespace:mFn,isomorphicDecode:Tbs,isomorphicEncode:xbs,parseJSONFromBytes:wbs,removeASCIIWhitespace:Rbs,removeChars:gFn,serializeJavascriptValueToJSONString:Pbs}});var fw=I((tZd,bFn)=>{"use strict";p();var cit=require("node:assert"),{forgivingBase64:kbs,collectASequenceOfCodePoints:vrr,collectASequenceOfCodePointsFast:QRe,isomorphicDecode:Dbs,removeASCIIWhitespace:Nbs,removeChars:Mbs}=sF(),Obs=new TextEncoder,qRe=/^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u,Bbs=/[\u000A\u000D\u0009\u0020]/u,Lbs=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;function Fbs(t){cit(t.protocol==="data:");let e=_Fn(t,!0);e=e.slice(5);let r={position:0},n=QRe(",",e,r),o=n.length;if(n=Nbs(n,!0,!0),r.position>=e.length)return"failure";r.position++;let s=e.slice(o+1),c=vFn(s);if(/;(?:\u0020*)base64$/ui.test(n)){let u=Dbs(c);if(c=kbs(u),c==="failure")return"failure";n=n.slice(0,-6),n=n.replace(/(\u0020+)$/u,""),n=n.slice(0,-1)}n.startsWith(";")&&(n="text/plain"+n);let l=Crr(n);return l==="failure"&&(l=Crr("text/plain;charset=US-ASCII")),{mimeType:l,body:c}}a(Fbs,"dataURLProcessor");function _Fn(t,e=!1){if(!e)return t.href;let r=t.href,n=t.hash.length,o=n===0?r:r.substring(0,r.length-n);return!n&&r.endsWith("#")?o.slice(0,-1):o}a(_Fn,"URLSerializer");function vFn(t){let e=Obs.encode(t);return Ubs(e)}a(vFn,"stringPercentDecode");function yFn(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}a(yFn,"isHexCharByte");function EFn(t){return t>=48&&t<=57?t-48:(t&223)-55}a(EFn,"hexByteToNumber");function Ubs(t){let e=t.length,r=new Uint8Array(e),n=0,o=0;for(;o=t.length)return"failure";e.position++;let n=QRe(";",t,e);if(n=ait(n,!1,!0),n.length===0||!qRe.test(n))return"failure";let o=r.toLowerCase(),s=n.toLowerCase(),c={type:o,subtype:s,parameters:new Map,essence:`${o}/${s}`};for(;e.positionBbs.test(d),t,e);let l=vrr(d=>d!==";"&&d!=="=",t,e);if(l=l.toLowerCase(),e.position=t.length)break;let u=null;if(t[e.position]==='"')u=CFn(t,e,!0),QRe(";",t,e);else if(u=QRe(";",t,e),u=ait(u,!1,!0),u.length===0)continue;l.length!==0&&qRe.test(l)&&(u.length===0||Lbs.test(u))&&!c.parameters.has(l)&&c.parameters.set(l,u)}return c}a(Crr,"parseMIMEType");function CFn(t,e,r=!1){let n=e.position,o="";for(cit(t[e.position]==='"'),e.position++;o+=vrr(c=>c!=='"'&&c!=="\\",t,e),!(e.position>=t.length);){let s=t[e.position];if(e.position++,s==="\\"){if(e.position>=t.length){o+="\\";break}o+=t[e.position],e.position++}else{cit(s==='"');break}}return r?o:t.slice(n,e.position)}a(CFn,"collectAnHTTPQuotedString");function Qbs(t){cit(t!=="failure");let{parameters:e,essence:r}=t,n=r;for(let[o,s]of e.entries())n+=";",n+=o,n+="=",qRe.test(s)||(s=s.replace(/[\\"]/ug,"\\$&"),s='"'+s,s+='"'),n+=s;return n}a(Qbs,"serializeAMimeType");function qbs(t){return t===13||t===10||t===9||t===32}a(qbs,"isHTTPWhiteSpace");function ait(t,e=!0,r=!0){return Mbs(t,e,r,qbs)}a(ait,"removeHTTPWhitespace");function jbs(t){switch(t.essence){case"application/ecmascript":case"application/javascript":case"application/x-ecmascript":case"application/x-javascript":case"text/ecmascript":case"text/javascript":case"text/javascript1.0":case"text/javascript1.1":case"text/javascript1.2":case"text/javascript1.3":case"text/javascript1.4":case"text/javascript1.5":case"text/jscript":case"text/livescript":case"text/x-ecmascript":case"text/x-javascript":return"text/javascript";case"application/json":case"text/json":return"application/json";case"image/svg+xml":return"image/svg+xml";case"text/xml":case"application/xml":return"application/xml"}return t.subtype.endsWith("+json")?"application/json":t.subtype.endsWith("+xml")?"application/xml":""}a(jbs,"minimizeSupportedMimeType");bFn.exports={dataURLProcessor:Fbs,URLSerializer:_Fn,stringPercentDecode:vFn,parseMIMEType:Crr,collectAnHTTPQuotedString:CFn,serializeAMimeType:Qbs,removeHTTPWhitespace:ait,minimizeSupportedMimeType:jbs,HTTP_TOKEN_CODEPOINTS:qRe}});var aF=I((iZd,Srr)=>{"use strict";p();var SFn={__proto__:null,"node:crypto":a(()=>require("node:crypto"),"node:crypto"),"node:sqlite":a(()=>require("node:sqlite"),"node:sqlite"),"node:worker_threads":a(()=>require("node:worker_threads"),"node:worker_threads"),"node:zlib":a(()=>require("node:zlib"),"node:zlib")};function Hbs(t){try{return SFn[t](),!0}catch(e){if(e.code!=="ERR_UNKNOWN_BUILTIN_MODULE"&&e.code!=="ERR_NO_CRYPTO")throw e;return!1}}a(Hbs,"detectRuntimeFeatureByNodeModule");function Gbs(t,e){return typeof SFn[t]()[e]<"u"}a(Gbs,"detectRuntimeFeatureByExportedProperty");var TFn=["markAsUncloneable","zstd"],$bs={markAsUncloneable:["node:worker_threads","markAsUncloneable"],zstd:["node:zlib","createZstdDecompress"]},IFn=["crypto","sqlite"],Vbs=[...IFn,...TFn];function Wbs(t){if(IFn.includes(t))return Hbs(`node:${t}`);if(TFn.includes(t)){let[e,r]=$bs[t];return Gbs(e,r)}throw new TypeError(`unknown feature: ${t}`)}a(Wbs,"detectRuntimeFeature");var brr=class{static{a(this,"RuntimeFeatures")}#e=new Map;clear(){this.#e.clear()}has(e){return this.#e.get(e)??this.#t(e)}set(e,r){if(Vbs.includes(e)===!1)throw new TypeError(`unknown feature: ${e}`);this.#e.set(e,r)}#t(e){let r=Wbs(e);return this.#e.set(e,r),r}},xFn=new brr;Srr.exports.runtimeFeatures=xFn;Srr.exports.default=xFn});var PA=I((aZd,RFn)=>{"use strict";p();var zbs=require("node:assert"),{types:ap,inspect:Ybs}=require("node:util"),{runtimeFeatures:Kbs}=aF(),Trr=1,Irr=2,lit=3,uit=4,xrr=5,dit=6,wrr=7,JS=8,wFn=Function.call.bind(Function.prototype[Symbol.hasInstance]),lt={converters:{},util:{},errors:{},is:{}};lt.errors.exception=function(t){return new TypeError(`${t.header}: ${t.message}`)};lt.errors.conversionFailed=function(t){let e=t.types.length===1?"":" one of",r=`${t.argument} could not be converted to${e}: ${t.types.join(", ")}.`;return lt.errors.exception({header:t.prefix,message:r})};lt.errors.invalidArgument=function(t){return lt.errors.exception({header:t.prefix,message:`"${t.value}" is an invalid ${t.type}.`})};lt.brandCheck=function(t,e){if(!wFn(e,t)){let r=new TypeError("Illegal invocation");throw r.code="ERR_INVALID_THIS",r}};lt.brandCheckMultiple=function(t){let e=t.map(r=>lt.util.MakeTypeAssertion(r));return r=>{if(e.every(n=>!n(r))){let n=new TypeError("Illegal invocation");throw n.code="ERR_INVALID_THIS",n}}};lt.argumentLengthCheck=function({length:t},e,r){if(twFn(t,e)};lt.util.Type=function(t){switch(typeof t){case"undefined":return Trr;case"boolean":return Irr;case"string":return lit;case"symbol":return uit;case"number":return xrr;case"bigint":return dit;case"function":case"object":return t===null?wrr:JS}};lt.util.Types={UNDEFINED:Trr,BOOLEAN:Irr,STRING:lit,SYMBOL:uit,NUMBER:xrr,BIGINT:dit,NULL:wrr,OBJECT:JS};lt.util.TypeValueToString=function(t){switch(lt.util.Type(t)){case Trr:return"Undefined";case Irr:return"Boolean";case lit:return"String";case uit:return"Symbol";case xrr:return"Number";case dit:return"BigInt";case wrr:return"Null";case JS:return"Object"}};lt.util.markAsUncloneable=Kbs.has("markAsUncloneable")?require("node:worker_threads").markAsUncloneable:()=>{};lt.util.ConvertToInt=function(t,e,r,n){let o,s;e===64?(o=Math.pow(2,53)-1,r==="unsigned"?s=0:s=Math.pow(-2,53)+1):r==="unsigned"?(s=0,o=Math.pow(2,e)-1):(s=-Math.pow(2,e-1),o=Math.pow(2,e-1)-1);let c=Number(t);if(c===0&&(c=0),lt.util.HasFlag(n,lt.attributes.EnforceRange)){if(Number.isNaN(c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY)throw lt.errors.exception({header:"Integer conversion",message:`Could not convert ${lt.util.Stringify(t)} to an integer.`});if(c=lt.util.IntegerPart(c),co)throw lt.errors.exception({header:"Integer conversion",message:`Value must be between ${s}-${o}, got ${c}.`});return c}return!Number.isNaN(c)&<.util.HasFlag(n,lt.attributes.Clamp)?(c=Math.min(Math.max(c,s),o),Math.floor(c)%2===0?c=Math.floor(c):c=Math.ceil(c),c):Number.isNaN(c)||c===0&&Object.is(0,c)||c===Number.POSITIVE_INFINITY||c===Number.NEGATIVE_INFINITY?0:(c=lt.util.IntegerPart(c),c=c%Math.pow(2,e),r==="signed"&&c>=Math.pow(2,e-1)?c-Math.pow(2,e):c)};lt.util.IntegerPart=function(t){let e=Math.floor(Math.abs(t));return t<0?-1*e:e};lt.util.Stringify=function(t){switch(lt.util.Type(t)){case uit:return`Symbol(${t.description})`;case JS:return Ybs(t);case lit:return`"${t}"`;case dit:return`${t}n`;default:return`${t}`}};lt.util.IsResizableArrayBuffer=function(t){if(ap.isArrayBuffer(t))return t.resizable;if(ap.isSharedArrayBuffer(t))return t.growable;throw lt.errors.exception({header:"IsResizableArrayBuffer",message:`"${lt.util.Stringify(t)}" is not an array buffer.`})};lt.util.HasFlag=function(t,e){return typeof t=="number"&&(t&e)===e};lt.sequenceConverter=function(t){return(e,r,n,o)=>{if(lt.util.Type(e)!==JS)throw lt.errors.exception({header:r,message:`${n} (${lt.util.Stringify(e)}) is not iterable.`});let s=typeof o=="function"?o():e?.[Symbol.iterator]?.(),c=[],l=0;if(s===void 0||typeof s.next!="function")throw lt.errors.exception({header:r,message:`${n} is not iterable.`});for(;;){let{done:u,value:d}=s.next();if(u)break;c.push(t(d,r,`${n}[${l++}]`))}return c}};lt.recordConverter=function(t,e){return(r,n,o)=>{if(lt.util.Type(r)!==JS)throw lt.errors.exception({header:n,message:`${o} ("${lt.util.TypeValueToString(r)}") is not an Object.`});let s={};if(!ap.isProxy(r)){let l=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(let u of l){let d=lt.util.Stringify(u),f=t(u,n,`Key ${d} in ${o}`),h=e(r[u],n,`${o}[${d}]`);s[f]=h}return s}let c=Reflect.ownKeys(r);for(let l of c)if(Reflect.getOwnPropertyDescriptor(r,l)?.enumerable){let d=t(l,n,o),f=e(r[l],n,o);s[d]=f}return s}};lt.interfaceConverter=function(t,e){return(r,n,o)=>{if(!t(r))throw lt.errors.exception({header:n,message:`Expected ${o} ("${lt.util.Stringify(r)}") to be an instance of ${e}.`});return r}};lt.dictionaryConverter=function(t){return t.sort((e,r)=>(e.key>r.key)-(e.key{let o={};if(e!=null&<.util.Type(e)!==JS)throw lt.errors.exception({header:r,message:`Expected ${e} to be one of: Null, Undefined, Object.`});for(let s of t){let{key:c,defaultValue:l,required:u,converter:d}=s;if(u===!0&&(e==null||!Object.hasOwn(e,c)))throw lt.errors.exception({header:r,message:`Missing required key "${c}".`});let f=e?.[c],h=l!==void 0;if(h&&f===void 0&&(f=l()),u||h||f!==void 0){if(f=d(f,r,`${n}.${c}`),s.allowedValues&&!s.allowedValues.includes(f))throw lt.errors.exception({header:r,message:`${f} is not an accepted type. Expected one of ${s.allowedValues.join(", ")}.`});o[c]=f}}return o}};lt.nullableConverter=function(t){return(e,r,n)=>e===null?e:t(e,r,n)};lt.is.USVString=function(t){return typeof t=="string"&&t.isWellFormed()};lt.is.ReadableStream=lt.util.MakeTypeAssertion(ReadableStream);lt.is.Blob=lt.util.MakeTypeAssertion(Blob);lt.is.URLSearchParams=lt.util.MakeTypeAssertion(URLSearchParams);lt.is.File=lt.util.MakeTypeAssertion(File);lt.is.URL=lt.util.MakeTypeAssertion(URL);lt.is.AbortSignal=lt.util.MakeTypeAssertion(AbortSignal);lt.is.MessagePort=lt.util.MakeTypeAssertion(MessagePort);lt.is.BufferSource=function(t){return ap.isArrayBuffer(t)||ArrayBuffer.isView(t)&&ap.isArrayBuffer(t.buffer)};lt.util.getCopyOfBytesHeldByBufferSource=function(t){let e=t,r=e,n=0,o=0;if(ap.isTypedArray(e)||ap.isDataView(e)?(r=e.buffer,n=e.byteOffset,o=e.byteLength):(zbs(ap.isAnyArrayBuffer(e)),o=e.byteLength),r.detached)return new Uint8Array(0);let s=new Uint8Array(o),c=new Uint8Array(r,n,o);return s.set(c),s};lt.converters.DOMString=function(t,e,r,n){if(t===null&<.util.HasFlag(n,lt.attributes.LegacyNullToEmptyString))return"";if(typeof t=="symbol")throw lt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a DOMString.`});return String(t)};lt.converters.ByteString=function(t,e,r){if(typeof t=="symbol")throw lt.errors.exception({header:e,message:`${r} is a symbol, which cannot be converted to a ByteString.`});let n=String(t);for(let o=0;o255)throw new TypeError(`Cannot convert argument to a ByteString because the character at index ${o} has a value of ${n.charCodeAt(o)} which is greater than 255.`);return n};lt.converters.USVString=function(t){return typeof t=="string"?t.toWellFormed():`${t}`.toWellFormed()};lt.converters.boolean=function(t){return!!t};lt.converters.any=function(t){return t};lt.converters["long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"signed",0,e,r)};lt.converters["unsigned long long"]=function(t,e,r){return lt.util.ConvertToInt(t,64,"unsigned",0,e,r)};lt.converters["unsigned long"]=function(t,e,r){return lt.util.ConvertToInt(t,32,"unsigned",0,e,r)};lt.converters["unsigned short"]=function(t,e,r,n){return lt.util.ConvertToInt(t,16,"unsigned",n,e,r)};lt.converters.ArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==JS||!ap.isArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable ArrayBuffer.`});return t};lt.converters.SharedArrayBuffer=function(t,e,r,n){if(lt.util.Type(t)!==JS||!ap.isSharedArrayBuffer(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["SharedArrayBuffer"]});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t))throw lt.errors.exception({header:e,message:`${r} cannot be a resizable SharedArrayBuffer.`});return t};lt.converters.TypedArray=function(t,e,r,n,o){if(lt.util.Type(t)!==JS||!ap.isTypedArray(t)||t.constructor.name!==e.name)throw lt.errors.conversionFailed({prefix:r,argument:`${n} ("${lt.util.Stringify(t)}")`,types:[e.name]});if(!lt.util.HasFlag(o,lt.attributes.AllowShared)&&ap.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(o,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:r,message:`${n} cannot be a view on a resizable array buffer.`});return t};lt.converters.DataView=function(t,e,r,n){if(lt.util.Type(t)!==JS||!ap.isDataView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["DataView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&ap.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.ArrayBufferView=function(t,e,r,n){if(lt.util.Type(t)!==JS||!ap.isArrayBufferView(t))throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBufferView"]});if(!lt.util.HasFlag(n,lt.attributes.AllowShared)&&ap.isSharedArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a shared array buffer.`});if(!lt.util.HasFlag(n,lt.attributes.AllowResizable)&<.util.IsResizableArrayBuffer(t.buffer))throw lt.errors.exception({header:e,message:`${r} cannot be a view on a resizable array buffer.`});return t};lt.converters.BufferSource=function(t,e,r,n){if(ap.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(ap.isArrayBufferView(t))return n&=~lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw ap.isSharedArrayBuffer(t)?lt.errors.exception({header:e,message:`${r} cannot be a SharedArrayBuffer.`}):lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","ArrayBufferView"]})};lt.converters.AllowSharedBufferSource=function(t,e,r,n){if(ap.isArrayBuffer(t))return lt.converters.ArrayBuffer(t,e,r,n);if(ap.isSharedArrayBuffer(t))return lt.converters.SharedArrayBuffer(t,e,r,n);if(ap.isArrayBufferView(t))return n|=lt.attributes.AllowShared,lt.converters.ArrayBufferView(t,e,r,n);throw lt.errors.conversionFailed({prefix:e,argument:`${r} ("${lt.util.Stringify(t)}")`,types:["ArrayBuffer","SharedArrayBuffer","ArrayBufferView"]})};lt.converters["sequence"]=lt.sequenceConverter(lt.converters.ByteString);lt.converters["sequence>"]=lt.sequenceConverter(lt.converters["sequence"]);lt.converters["record"]=lt.recordConverter(lt.converters.ByteString,lt.converters.ByteString);lt.converters.Blob=lt.interfaceConverter(lt.is.Blob,"Blob");lt.converters.AbortSignal=lt.interfaceConverter(lt.is.AbortSignal,"AbortSignal");lt.converters.EventHandlerNonNull=function(t){return lt.util.Type(t)!==JS?null:typeof t=="function"?t:()=>{}};lt.attributes={Clamp:1,EnforceRange:2,AllowShared:4,AllowResizable:8,LegacyNullToEmptyString:16};RFn.exports={webidl:lt}});var ZS=I((lZd,HFn)=>{"use strict";p();var{Transform:Jbs}=require("node:stream"),PFn=require("node:zlib"),{redirectStatusSet:Zbs,referrerPolicyTokens:Xbs,badPortsSet:e1s}=URe(),{getGlobalOrigin:kFn}=_rr(),{collectAnHTTPQuotedString:t1s,parseMIMEType:r1s}=fw(),{performance:n1s}=require("node:perf_hooks"),{ReadableStreamFrom:i1s,isValidHTTPToken:DFn,normalizedMethodRecordsBase:o1s}=ko(),HRe=require("node:assert"),{isUint8Array:s1s}=require("node:util/types"),{webidl:ij}=PA(),{isomorphicEncode:Rrr,collectASequenceOfCodePoints:DJ,removeChars:a1s}=sF();function NFn(t){let e=t.urlList,r=e.length;return r===0?null:e[r-1].toString()}a(NFn,"responseURL");function c1s(t,e){if(!Zbs.has(t.status))return null;let r=t.headersList.get("location",!0);return r!==null&&OFn(r)&&(MFn(r)||(r=l1s(r)),r=new URL(r,NFn(t))),r&&!r.hash&&(r.hash=e),r}a(c1s,"responseLocationURL");function MFn(t){for(let e=0;e126||r<32)return!1}return!0}a(MFn,"isValidEncodedURL");function l1s(t){return Buffer.from(t,"binary").toString("utf8")}a(l1s,"normalizeBinaryStringToUtf8");function MJ(t){return t.urlList[t.urlList.length-1]}a(MJ,"requestCurrentURL");function u1s(t){let e=MJ(t);return qFn(e)&&e1s.has(e.port)?"blocked":"allowed"}a(u1s,"requestBadPort");function d1s(t){return t instanceof Error||t?.constructor?.name==="Error"||t?.constructor?.name==="DOMException"}a(d1s,"isErrorLike");function f1s(t){for(let e=0;e=32&&r<=126||r>=128&&r<=255))return!1}return!0}a(f1s,"isValidReasonPhrase");var p1s=DFn;function OFn(t){return(t[0]===" "||t[0]===" "||t[t.length-1]===" "||t[t.length-1]===" "||t.includes(` +`)||t.includes("\r")||t.includes("\0"))===!1}a(OFn,"isValidHeaderValue");function h1s(t){let e=(t.headersList.get("referrer-policy",!0)??"").split(","),r="";if(e.length)for(let n=e.length;n!==0;n--){let o=e[n-1].trim();if(Xbs.has(o)){r=o;break}}return r}a(h1s,"parseReferrerPolicy");function m1s(t,e){let r=h1s(e);r!==""&&(t.referrerPolicy=r)}a(m1s,"setRequestReferrerPolicyOnRedirect");function g1s(){return"allowed"}a(g1s,"crossOriginResourcePolicyCheck");function A1s(){return"success"}a(A1s,"corsCheck");function y1s(){return"success"}a(y1s,"TAOCheck");function E1s(t){let e=null;e=t.mode,t.headersList.set("sec-fetch-mode",e,!0)}a(E1s,"appendFetchMetadata");function _1s(t){let e=t.origin;if(!(e==="client"||e===void 0)){if(t.responseTainting==="cors"||t.mode==="websocket")t.headersList.append("origin",e,!0);else if(t.method!=="GET"&&t.method!=="HEAD"){switch(t.referrerPolicy){case"no-referrer":e=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":t.origin&&krr(t.origin)&&!krr(MJ(t))&&(e=null);break;case"same-origin":jRe(t,MJ(t))||(e=null);break;default:}t.headersList.append("origin",e,!0)}}}a(_1s,"appendRequestOriginHeader");function Jde(t,e){return t}a(Jde,"coarsenTime");function v1s(t,e,r){return!t?.startTime||t.startTime4096&&(n=o),e){case"no-referrer":return"no-referrer";case"origin":return o??Prr(r,!0);case"unsafe-url":return n;case"strict-origin":{let s=MJ(t);return NJ(n)&&!NJ(s)?"no-referrer":o}case"strict-origin-when-cross-origin":{let s=MJ(t);return jRe(n,s)?n:NJ(n)&&!NJ(s)?"no-referrer":o}case"same-origin":return jRe(t,n)?n:"no-referrer";case"origin-when-cross-origin":return jRe(t,n)?n:o;case"no-referrer-when-downgrade":{let s=MJ(t);return NJ(n)&&!NJ(s)?"no-referrer":n}}}a(T1s,"determineRequestsReferrer");function Prr(t,e=!1){return HRe(ij.is.URL(t)),t=new URL(t),QFn(t)?"no-referrer":(t.username="",t.password="",t.hash="",e===!0&&(t.pathname="",t.search=""),t)}a(Prr,"stripURLForReferrer");var I1s=RegExp.prototype.test.bind(/^127\.(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){2}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)$/),x1s=RegExp.prototype.test.bind(/^(?:(?:0{1,4}:){7}|(?:0{1,4}:){1,6}:|::)0{0,3}1$/);function LFn(t){return t.includes(":")?(t[0]==="["&&t[t.length-1]==="]"&&(t=t.slice(1,-1)),x1s(t)):I1s(t)}a(LFn,"isOriginIPPotentiallyTrustworthy");function w1s(t){return t==null||t==="null"?!1:(t=new URL(t),!!(t.protocol==="https:"||t.protocol==="wss:"||LFn(t.hostname)||t.hostname==="localhost"||t.hostname==="localhost."||t.hostname.endsWith(".localhost")||t.hostname.endsWith(".localhost.")||t.protocol==="file:"))}a(w1s,"isOriginPotentiallyTrustworthy");function NJ(t){return ij.is.URL(t)?t.href==="about:blank"||t.href==="about:srcdoc"||t.protocol==="data:"||t.protocol==="blob:"?!0:w1s(t.origin):!1}a(NJ,"isURLPotentiallyTrustworthy");function R1s(t){}a(R1s,"tryUpgradeRequestToAPotentiallyTrustworthyURL");function jRe(t,e){return t.origin===e.origin&&t.origin==="null"||t.protocol===e.protocol&&t.hostname===e.hostname&&t.port===e.port}a(jRe,"sameOrigin");function P1s(t){return t.controller.state==="aborted"}a(P1s,"isAborted");function k1s(t){return t.controller.state==="aborted"||t.controller.state==="terminated"}a(k1s,"isCancelled");function D1s(t){return o1s[t.toLowerCase()]??t}a(D1s,"normalizeMethod");var N1s=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));function FFn(t,e,r=0,n=1){class o{static{a(this,"FastIterableIterator")}#e;#t;#r;constructor(c,l){this.#e=c,this.#t=l,this.#r=0}next(){if(typeof this!="object"||this===null||!(#e in this))throw new TypeError(`'next' called on an object that does not implement interface ${t} Iterator.`);let c=this.#r,l=e(this.#e),u=l.length;if(c>=u)return{value:void 0,done:!0};let{[r]:d,[n]:f}=l[c];this.#r=c+1;let h;switch(this.#t){case"key":h=d;break;case"value":h=f;break;case"key+value":h=[d,f];break}return{value:h,done:!1}}}return delete o.prototype.constructor,Object.setPrototypeOf(o.prototype,N1s),Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{writable:!1,enumerable:!1,configurable:!0,value:`${t} Iterator`},next:{writable:!0,enumerable:!0,configurable:!0}}),function(s,c){return new o(s,c)}}a(FFn,"createIterator");function M1s(t,e,r,n=0,o=1){let s=FFn(t,r,n,o),c={keys:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return ij.brandCheck(this,e),s(this,"key")},"keys")},values:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return ij.brandCheck(this,e),s(this,"value")},"values")},entries:{writable:!0,enumerable:!0,configurable:!0,value:a(function(){return ij.brandCheck(this,e),s(this,"key+value")},"entries")},forEach:{writable:!0,enumerable:!0,configurable:!0,value:a(function(u,d=globalThis){if(ij.brandCheck(this,e),ij.argumentLengthCheck(arguments,1,`${t}.forEach`),typeof u!="function")throw new TypeError(`Failed to execute 'forEach' on '${t}': parameter 1 is not of type 'Function'.`);for(let{0:f,1:h}of s(this,"key+value"))u.call(d,h,f,this)},"forEach")}};return Object.defineProperties(e.prototype,{...c,[Symbol.iterator]:{writable:!0,enumerable:!1,configurable:!0,value:c.entries.value}})}a(M1s,"iteratorMixin");function O1s(t,e,r){let n=e,o=r;try{let s=t.stream.getReader();UFn(s,n,o)}catch(s){o(s)}}a(O1s,"fullyReadBody");function B1s(t){try{t.close(),t.byobRequest?.respond(0)}catch(e){if(!e.message.includes("Controller is already closed")&&!e.message.includes("ReadableStream is already closed"))throw e}}a(B1s,"readableStreamClose");async function UFn(t,e,r){try{let n=[],o=0;do{let{done:s,value:c}=await t.read();if(s){e(Buffer.concat(n,o));return}if(!s1s(c)){r(new TypeError("Received non-Uint8Array chunk"));return}n.push(c),o+=c.length}while(!0)}catch(n){r(n)}}a(UFn,"readAllBytes");function QFn(t){HRe("protocol"in t);let e=t.protocol;return e==="about:"||e==="blob:"||e==="data:"}a(QFn,"urlIsLocal");function krr(t){return typeof t=="string"&&t[5]===":"&&t[0]==="h"&&t[1]==="t"&&t[2]==="t"&&t[3]==="p"&&t[4]==="s"||t.protocol==="https:"}a(krr,"urlHasHttpsScheme");function qFn(t){HRe("protocol"in t);let e=t.protocol;return e==="http:"||e==="https:"}a(qFn,"urlIsHttpHttpsScheme");function L1s(t,e){let r=t;if(!r.startsWith("bytes"))return"failure";let n={position:5};if(e&&DJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==61)return"failure";n.position++,e&&DJ(u=>u===" "||u===" ",r,n);let o=DJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),s=o.length?Number(o):null;if(e&&DJ(u=>u===" "||u===" ",r,n),r.charCodeAt(n.position)!==45)return"failure";n.position++,e&&DJ(u=>u===" "||u===" ",r,n);let c=DJ(u=>{let d=u.charCodeAt(0);return d>=48&&d<=57},r,n),l=c.length?Number(c):null;return n.positionl?"failure":{rangeStartValue:s,rangeEndValue:l}}a(L1s,"simpleRangeHeaderValue");function F1s(t,e,r){let n="bytes ";return n+=Rrr(`${t}`),n+="-",n+=Rrr(`${e}`),n+="/",n+=Rrr(`${r}`),n}a(F1s,"buildContentRange");var Drr=class extends Jbs{static{a(this,"InflateStream")}#e;constructor(e){super(),this.#e=e}_transform(e,r,n){if(!this._inflateStream){if(e.length===0){n();return}this._inflateStream=(e[0]&15)===8?PFn.createInflate(this.#e):PFn.createInflateRaw(this.#e),this._inflateStream.on("data",this.push.bind(this)),this._inflateStream.on("end",()=>this.push(null)),this._inflateStream.on("error",o=>this.destroy(o))}this._inflateStream.write(e,r,n)}_final(e){this._inflateStream&&(this._inflateStream.end(),this._inflateStream=null),e()}};function U1s(t){return new Drr(t)}a(U1s,"createInflate");function Q1s(t){let e=null,r=null,n=null,o=jFn("content-type",t);if(o===null)return"failure";for(let s of o){let c=r1s(s);c==="failure"||c.essence==="*/*"||(n=c,n.essence!==r?(e=null,n.parameters.has("charset")&&(e=n.parameters.get("charset")),r=n.essence):!n.parameters.has("charset")&&e!==null&&n.parameters.set("charset",e))}return n??"failure"}a(Q1s,"extractMimeType");function q1s(t){let e=t,r={position:0},n=[],o="";for(;r.positions!=='"'&&s!==",",e,r),r.positions===9||s===32),n.push(o),o=""}return n}a(q1s,"gettingDecodingSplitting");function jFn(t,e){let r=e.get(t,!0);return r===null?null:q1s(r)}a(jFn,"getDecodeSplit");function j1s(t){return!1}a(j1s,"hasAuthenticationEntry");function H1s(t){return!!(t.username||t.password)}a(H1s,"includesCredentials");function G1s(t){return t!=null&&t!=="client"&&t!=="no-traversable"}a(G1s,"isTraversableNavigable");var Nrr=class{static{a(this,"EnvironmentSettingsObjectBase")}get baseUrl(){return kFn()}get origin(){return this.baseUrl?.origin}policyContainer=BFn()},Mrr=class{static{a(this,"EnvironmentSettingsObject")}settingsObject=new Nrr},$1s=new Mrr;HFn.exports={isAborted:P1s,isCancelled:k1s,isValidEncodedURL:MFn,ReadableStreamFrom:i1s,tryUpgradeRequestToAPotentiallyTrustworthyURL:R1s,clampAndCoarsenConnectionTimingInfo:v1s,coarsenedSharedCurrentTime:C1s,determineRequestsReferrer:T1s,makePolicyContainer:BFn,clonePolicyContainer:S1s,appendFetchMetadata:E1s,appendRequestOriginHeader:_1s,TAOCheck:y1s,corsCheck:A1s,crossOriginResourcePolicyCheck:g1s,createOpaqueTimingInfo:b1s,setRequestReferrerPolicyOnRedirect:m1s,isValidHTTPToken:DFn,requestBadPort:u1s,requestCurrentURL:MJ,responseURL:NFn,responseLocationURL:c1s,isURLPotentiallyTrustworthy:NJ,isValidReasonPhrase:f1s,sameOrigin:jRe,normalizeMethod:D1s,iteratorMixin:M1s,createIterator:FFn,isValidHeaderName:p1s,isValidHeaderValue:OFn,isErrorLike:d1s,fullyReadBody:O1s,readableStreamClose:B1s,urlIsLocal:QFn,urlHasHttpsScheme:krr,urlIsHttpHttpsScheme:qFn,readAllBytes:UFn,simpleRangeHeaderValue:L1s,buildContentRange:F1s,createInflate:U1s,extractMimeType:Q1s,getDecodeSplit:jFn,environmentSettingsObject:$1s,isOriginIPPotentiallyTrustworthy:LFn,hasAuthenticationEntry:j1s,includesCredentials:H1s,isTraversableNavigable:G1s}});var fit=I((fZd,$Fn)=>{"use strict";p();var{iteratorMixin:V1s}=ZS(),{kEnumerableProperty:Zde}=ko(),{webidl:Tc}=PA(),GFn=require("node:util"),cF=class t{static{a(this,"FormData")}#e=[];constructor(e=void 0){if(Tc.util.markAsUncloneable(this),e!==void 0)throw Tc.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]})}append(e,r,n=void 0){Tc.brandCheck(this,t);let o="FormData.append";Tc.argumentLengthCheck(arguments,2,o),e=Tc.converters.USVString(e),arguments.length===3||Tc.is.Blob(r)?(r=Tc.converters.Blob(r,o,"value"),n!==void 0&&(n=Tc.converters.USVString(n))):r=Tc.converters.USVString(r);let s=Orr(e,r,n);this.#e.push(s)}delete(e){Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.delete"),e=Tc.converters.USVString(e),this.#e=this.#e.filter(n=>n.name!==e)}get(e){Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.get"),e=Tc.converters.USVString(e);let n=this.#e.findIndex(o=>o.name===e);return n===-1?null:this.#e[n].value}getAll(e){return Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.getAll"),e=Tc.converters.USVString(e),this.#e.filter(n=>n.name===e).map(n=>n.value)}has(e){return Tc.brandCheck(this,t),Tc.argumentLengthCheck(arguments,1,"FormData.has"),e=Tc.converters.USVString(e),this.#e.findIndex(n=>n.name===e)!==-1}set(e,r,n=void 0){Tc.brandCheck(this,t);let o="FormData.set";Tc.argumentLengthCheck(arguments,2,o),e=Tc.converters.USVString(e),arguments.length===3||Tc.is.Blob(r)?(r=Tc.converters.Blob(r,o,"value"),n!==void 0&&(n=Tc.converters.USVString(n))):r=Tc.converters.USVString(r);let s=Orr(e,r,n),c=this.#e.findIndex(l=>l.name===e);c!==-1?this.#e=[...this.#e.slice(0,c),s,...this.#e.slice(c+1).filter(l=>l.name!==e)]:this.#e.push(s)}[GFn.inspect.custom](e,r){let n=this.#e.reduce((s,c)=>(s[c.name]?Array.isArray(s[c.name])?s[c.name].push(c.value):s[c.name]=[s[c.name],c.value]:s[c.name]=c.value,s),{__proto__:null});r.depth??=e,r.colors??=!0;let o=GFn.formatWithOptions(r,n);return`FormData ${o.slice(o.indexOf("]")+2)}`}static getFormDataState(e){return e.#e}static setFormDataState(e,r){e.#e=r}},{getFormDataState:W1s,setFormDataState:z1s}=cF;Reflect.deleteProperty(cF,"getFormDataState");Reflect.deleteProperty(cF,"setFormDataState");V1s("FormData",cF,W1s,"name","value");Object.defineProperties(cF.prototype,{append:Zde,delete:Zde,get:Zde,getAll:Zde,has:Zde,set:Zde,[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function Orr(t,e,r){if(typeof e!="string"){if(Tc.is.File(e)||(e=new File([e],"blob",{type:e.type})),r!==void 0){let n={type:e.type,lastModified:e.lastModified};e=new File([e],r,n)}}return{name:t,value:e}}a(Orr,"makeEntry");Tc.is.FormData=Tc.util.MakeTypeAssertion(cF);$Fn.exports={FormData:cF,makeEntry:Orr,setFormDataState:z1s}});var zFn=I((mZd,WFn)=>{"use strict";p();var{bufferToLowerCasedHeaderName:Y1s}=ko(),{HTTP_TOKEN_CODEPOINTS:K1s}=fw(),{makeEntry:J1s}=fit(),{webidl:Brr}=PA(),Lrr=require("node:assert"),{isomorphicDecode:VFn}=sF(),Z1s=Buffer.from("--"),Frr=new TextDecoder,X1s=new TextDecoder("utf-8",{ignoreBOM:!0});function eSs(t){for(let e=0;e70)return!1;for(let r=0;r=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}a(tSs,"validateBoundary");function rSs(t,e){Lrr(e!=="failure"&&e.essence==="multipart/form-data");let r=e.parameters.get("boundary");if(r===void 0)throw YC("missing boundary in content-type header");let n=Buffer.from(`--${r}`,"utf8"),o=[],s={position:0},c=t.indexOf(n);if(c===-1)throw YC("no boundary found in multipart body");for(s.position=c;;){if(t.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else throw YC("expected a value starting with -- and the boundary");if(oSs(t,Z1s,s))return o;if(t[s.position]!==13||t[s.position+1]!==10)throw YC("expected CRLF");s.position+=2;let l=iSs(t,s),{name:u,filename:d,contentType:f,encoding:h}=l;s.position+=2;let m;{let A=t.indexOf(n.subarray(2),s.position);if(A===-1)throw YC("expected boundary after body");m=t.subarray(s.position,A-4),s.position+=m.length,h==="base64"&&(m=Buffer.from(m.toString(),"base64"))}if(t[s.position]!==13||t[s.position+1]!==10)throw YC("expected CRLF");s.position+=2;let g;d!==null?(f??="text/plain",eSs(f)||(f=""),g=new File([m],d,{type:f})):g=X1s.decode(Buffer.from(m)),Lrr(Brr.is.USVString(u)),Lrr(typeof g=="string"&&Brr.is.USVString(g)||Brr.is.File(g)),o.push(J1s(u,g,d))}}a(rSs,"multipartFormDataParser");function nSs(t,e){t[e.position]===59&&e.position++,pw(c=>c===32||c===9,t,e);let r=pw(c=>Qrr(c)&&c!==61&&c!==42,t,e);if(r.length===0)return null;let n=r.toString("ascii").toLowerCase(),o=t[e.position]===42;if(o&&e.position++,t[e.position]!==61)return null;e.position++,pw(c=>c===32||c===9,t,e);let s;if(o){let c=pw(l=>l!==32&&l!==13&&l!==10&&l!==59,t,e);if(c[0]!==117&&c[0]!==85||c[1]!==116&&c[1]!==84||c[2]!==102&&c[2]!==70||c[3]!==45||c[4]!==56)throw YC("unknown encoding, expected utf-8''");s=decodeURIComponent(Frr.decode(c.subarray(7)))}else if(t[e.position]===34){e.position++;let c=pw(l=>l!==10&&l!==13&&l!==34,t,e);if(t[e.position]!==34)throw YC("Closing quote not found");e.position++,s=Frr.decode(c).replace(/%0A/ig,` +`).replace(/%0D/ig,"\r").replace(/%22/g,'"')}else{let c=pw(l=>Qrr(l)&&l!==59,t,e);s=Frr.decode(c)}return{name:n,value:s,extended:o}}a(nSs,"parseContentDispositionAttribute");function iSs(t,e){let r=null,n=null,o=null,s=null;for(;;){if(t[e.position]===13&&t[e.position+1]===10){if(r===null)throw YC("header name is null");return{name:r,filename:n,contentType:o,encoding:s}}let c=pw(l=>l!==10&&l!==13&&l!==58,t,e);if(c=Urr(c,!0,!0,l=>l===9||l===32),!K1s.test(c.toString()))throw YC("header name does not match the field-name token production");if(t[e.position]!==58)throw YC("expected :");switch(e.position++,pw(l=>l===32||l===9,t,e),Y1s(c)){case"content-disposition":{r=n=null;let l=!1;if(pw(d=>Qrr(d),t,e).toString("ascii").toLowerCase()!=="form-data")throw YC("expected form-data for content-disposition header");for(;e.positionu!==10&&u!==13,t,e);l=Urr(l,!1,!0,u=>u===9||u===32),o=VFn(l);break}case"content-transfer-encoding":{let l=pw(u=>u!==10&&u!==13,t,e);l=Urr(l,!1,!0,u=>u===9||u===32),s=VFn(l);break}default:pw(l=>l!==10&&l!==13,t,e)}if(t[e.position]!==13||t[e.position+1]!==10)throw YC("expected CRLF");e.position+=2}}a(iSs,"parseMultipartFormDataHeaders");function pw(t,e,r){let n=r.position;for(;n0&&n(t[s]);)s--;return o===0&&s===t.length-1?t:t.subarray(o,s+1)}a(Urr,"removeChars");function oSs(t,e,r){if(t.length{"use strict";p();function cSs(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}a(cSs,"createDeferredPromise");YFn.exports={createDeferredPromise:cSs}});var efe=I((vZd,e8n)=>{"use strict";p();var Hrr=ko(),{ReadableStreamFrom:lSs,readableStreamClose:uSs,fullyReadBody:dSs,extractMimeType:fSs}=ZS(),{FormData:KFn,setFormDataState:pSs}=fit(),{webidl:Wk}=PA(),qrr=require("node:assert"),{isErrored:jrr,isDisturbed:hSs}=require("node:stream"),{isUint8Array:mSs}=require("node:util/types"),{serializeAMimeType:gSs}=fw(),{multipartFormDataParser:ASs}=zFn(),{createDeferredPromise:ySs}=GRe(),{parseJSONFromBytes:ESs}=sF(),{utf8DecodeBytes:_Ss}=sit(),{runtimeFeatures:vSs}=aF(),CSs=vSs.has("crypto")?require("node:crypto").randomInt:t=>Math.floor(Math.random()*t),pit=new TextEncoder;function bSs(){}a(bSs,"noop");var SSs=new FinalizationRegistry(t=>{let e=t.deref();e&&!e.locked&&!hSs(e)&&!jrr(e)&&e.cancel("Response object has been garbage collected").catch(bSs)});function ZFn(t,e=!1){let r=null,n=null;Wk.is.ReadableStream(t)?r=t:Wk.is.Blob(t)?r=t.stream():r=new ReadableStream({pull(){},start(d){n=d},cancel(){},type:"bytes"}),qrr(Wk.is.ReadableStream(r));let o=null,s=null,c=null,l=null;if(typeof t=="string")s=t,l="text/plain;charset=UTF-8";else if(Wk.is.URLSearchParams(t))s=t.toString(),l="application/x-www-form-urlencoded;charset=UTF-8";else if(Wk.is.BufferSource(t))s=Wk.util.getCopyOfBytesHeldByBufferSource(t);else if(Wk.is.FormData(t)){let d=`----formdata-undici-0${`${CSs(1e11)}`.padStart(11,"0")}`,f=`--${d}\r Content-Disposition: form-data`;let h=a(_=>_.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"formdataEscape"),m=a(_=>_.replace(/\r?\n|\r/g,`\r -`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=Eit.encode(f+`; name="${h(m(_))}"\r +`),"normalizeLinefeeds"),g=[],A=new Uint8Array([13,10]);c=0;let y=!1;for(let[_,v]of t)if(typeof v=="string"){let b=pit.encode(f+`; name="${h(m(_))}"\r \r ${m(v)}\r -`);g.push(b),c+=b.byteLength}else{let b=Eit.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r +`);g.push(b),c+=b.byteLength}else{let b=pit.encode(`${f}; name="${h(m(_))}"`+(v.name?`; filename="${h(v.name)}"`:"")+`\r Content-Type: ${v.type||"application/octet-stream"}\r \r -`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=Eit.encode(`--${d}--\r -`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(YP.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Lrr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=YP.is.ReadableStream(t)?t:CTs(t)}return(typeof s=="string"||xTs(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(Brr(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!Brr(r)&&n.enqueue(typeof d=="string"?Eit.encode(d):new Uint8Array(d));queueMicrotask(()=>vTs(n))})(),[{stream:r,source:s,length:c},l]}a(YFn,"extractBody");function LTs(t,e=!1){return YP.is.ReadableStream(t)&&(Orr(!Lrr.isDisturbed(t),"The body has already been consumed."),Orr(!t.locked,"The stream is locked.")),YFn(t,e)}a(LTs,"safelyExtractBody");function FTs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(FTs,"cloneBody");function UTs(t,e){return{blob(){return nfe(this,n=>{let o=zFn(e(this));return o===null?o="":o&&(o=wTs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return nfe(this,n=>new Uint8Array(n).buffer,t,e)},text(){return nfe(this,DTs,t,e)},json(){return nfe(this,PTs,t,e)},formData(){return nfe(this,n=>{let o=zFn(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=RTs(n,o),c=new WFn;return TTs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new WFn;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return nfe(this,n=>new Uint8Array(n),t,e)}}}a(UTs,"bodyMixinMethods");function QTs(t,e){Object.assign(t.prototype,UTs(t,e))}a(QTs,"mixinBody");function nfe(t,e,r,n){try{YP.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),KFn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=kTs(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(bTs(t.body,c,s),o.promise)}a(nfe,"consumeBody");function KFn(t){let e=t.body;return e!=null&&(e.stream.locked||Lrr.isDisturbed(e.stream))}a(KFn,"bodyUnusable");function zFn(t){let e=t.headersList,r=STs(e);return r==="failure"?null:r}a(zFn,"bodyMimeType");JFn.exports={extractBody:YFn,safelyExtractBody:LTs,cloneBody:FTs,mixinBody:QTs,streamRegistry:BTs,bodyUnusable:KFn}});var d8n=I((Wef,u8n)=>{"use strict";p();var Ni=require("node:assert"),Ji=Do(),{channels:ZFn}=cj(),Frr=Atr(),{RequestContentLengthMismatchError:HJ,ResponseContentLengthMismatchError:XFn,RequestAbortedError:a8n,HeadersTimeoutError:qTs,HeadersOverflowError:jTs,SocketError:ske,InformationalError:ofe,BodyTimeoutError:HTs,HTTPParserError:GTs,ResponseExceededMaxSizeError:$Ts}=ao(),{kUrl:c8n,kReset:tb,kClient:Sit,kParser:op,kBlocking:ake,kRunning:oE,kPending:VTs,kSize:e8n,kWriting:fj,kQueue:KP,kNoRef:ike,kKeepAliveDefaultTimeout:WTs,kHostHeader:zTs,kPendingIdx:YTs,kRunningIdx:mw,kError:W_,kPipelining:vit,kSocket:sfe,kKeepAliveTimeoutValue:Tit,kMaxHeadersSize:KTs,kKeepAliveMaxTimeout:JTs,kKeepAliveTimeoutThreshold:ZTs,kHeadersTimeout:XTs,kBodyTimeout:eIs,kStrictContentLength:qrr,kMaxRequests:t8n,kCounter:tIs,kMaxResponseSize:rIs,kOnError:r8n,kResume:dj,kHTTPContext:l8n,kClosed:jrr}=nl(),oT=J3n(),n8n=Buffer.alloc(0),_it=Buffer[Symbol.species],nIs=Ji.removeAllListeners,Urr;function iIs(){let t=process.env.JEST_WORKER_ID?drr():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(eFn())}catch{}return e||(e=new WebAssembly.Module(t||drr())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onStatus(new _it(ZO.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Ni(ip.ptr===n),ip.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onHeaderField(new _it(ZO.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onHeaderValue(new _it(ZO.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Ni(ip.ptr===n),ip.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Ni(ip.ptr===n);let c=o-XO+ZO.byteOffset;return ip.onBody(new _it(ZO.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Ni(ip.ptr===n),ip.onMessageComplete()),"wasm_on_message_complete")}})}a(iIs,"lazyllhttp");var Qrr=null,ip=null,ZO=null,Cit=0,XO=null,oIs=0,oke=1,afe=2|oke,bit=4|oke,Hrr=8|oIs,Grr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(oT.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[KTs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[rIs]}setTimeout(e,r){e!==this.timeoutValue||r&oke^this.timeoutType&oke?(this.timeout&&(Frr.clearTimeout(this.timeout),this.timeout=null),e&&(r&oke?this.timeout=Frr.setFastTimeout(i8n,e,this.timeoutWeakRef):(this.timeout=setTimeout(i8n,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Ni(this.ptr!=null),Ni(ip===null),this.llhttp.llhttp_resume(this.ptr),Ni(this.timeoutType===bit),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||n8n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Ni(ip===null),Ni(this.ptr!=null),Ni(!this.paused);let{socket:r,llhttp:n}=this;e.length>Cit&&(XO&&n.free(XO),Cit=Math.ceil(e.length/4096)*4096,XO=n.malloc(Cit)),new Uint8Array(n.memory.buffer,XO,Cit).set(e);try{let o;try{ZO=e,ip=this,o=n.llhttp_execute(this.ptr,XO,e.length)}finally{ip=null,ZO=null}if(o!==oT.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-XO);if(o===oT.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===oT.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Ji.destroy(r,o)}}finish(){Ni(ip===null),Ni(this.ptr!=null),Ni(!this.paused);let{llhttp:e}=this,r;try{ip=this,r=e.llhttp_finish(this.ptr)}finally{ip=null}return r===oT.ERROR.OK?null:r===oT.ERROR.PAUSED||r===oT.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,n8n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new XFn;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new GTs(l,oT.ERROR[e],r)}destroy(){Ni(ip===null),Ni(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Frr.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[KP][r[mw]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Ji.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Ji.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Ji.destroy(this.socket,new jTs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Ni(r),Ni(n[sfe]===o),Ni(!o.destroyed),Ni(!this.paused),Ni((s.length&1)===0);let l=n[KP][n[mw]];Ni(l),Ni(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[op].destroy(),o[op]=null,o[Sit]=null,o[W_]=null,nIs(o),n[sfe]=null,n[l8n]=null,n[KP][n[mw]++]=null,n.emit("disconnect",n[c8n],[n],new ofe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Ji.destroy(o,u)}n[dj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[KP][o[mw]];if(!u)return-1;if(Ni(!this.upgrade),Ni(this.statusCode<200),e===100)return Ji.destroy(s,new ske("bad response",Ji.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Ji.destroy(s,new ske("bad upgrade",Ji.getSocketInfo(s))),-1;if(Ni(this.timeoutType===afe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[tb]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[eIs];this.setTimeout(f,bit)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Ni(o[oE]===1),this.upgrade=!0,2;if(r)return Ni(o[oE]===1),this.upgrade=!0,2;if(Ni((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[vit]){let f=this.keepAlive?Ji.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[ZTs],o[JTs]);h<=0?s[tb]=!0:o[Tit]=h}else o[Tit]=o[WTs]}else s[tb]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[ake]&&(s[ake]=!1,o[dj]()),d?oT.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[KP][r[mw]];return Ni(c),Ni(this.timeoutType===bit),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Ni(o>=200),s>-1&&this.bytesRead+e.length>s?(Ji.destroy(n,new $Ts),-1):(this.bytesRead+=e.length,c.onData(e)===!1?oT.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Ni(n>=100),Ni((this.headers.length&1)===0);let d=e[KP][e[mw]];if(Ni(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Ji.destroy(r,new XFn),-1;if(d.onComplete(s),e[KP][e[mw]++]=null,r[fj])return Ni(e[oE]===0),Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;if(u){if(r[tb]&&e[oE]===0)return Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;e[vit]==null||e[vit]===1?setImmediate(e[dj]):e[dj]()}else return Ji.destroy(r,new ofe("reset")),oT.ERROR.PAUSED;return 0}};function i8n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===afe?(!r[fj]||r.writableNeedDrain||o[oE]>1)&&(Ni(!s,"cannot be paused while waiting for headers"),Ji.destroy(r,new qTs)):n===bit?s||Ji.destroy(r,new HTs):n===Hrr&&(Ni(o[oE]===0&&o[Tit]),Ji.destroy(r,new ofe("socket idle timeout")))}a(i8n,"onParserTimeout");function sIs(t,e){if(t[sfe]=e,Qrr||(Qrr=iIs()),e.errored)throw e.errored;if(e.destroyed)throw new ske("destroyed");return e[ike]=!1,e[fj]=!1,e[tb]=!1,e[ake]=!1,e[op]=new Grr(t,e,Qrr),Ji.addListener(e,"error",aIs),Ji.addListener(e,"readable",cIs),Ji.addListener(e,"end",lIs),Ji.addListener(e,"close",uIs),e[jrr]=!1,e.on("close",dIs),{version:"h1",defaultPipelining:1,write(r){return hIs(t,r)},resume(){fIs(t)},destroy(r,n){e[jrr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[fj]||e[tb]||e[ake]||r&&(t[oE]>0&&!r.idempotent||t[oE]>0&&(r.upgrade||r.method==="CONNECT")||t[oE]>0&&Ji.bodyLength(r.body)!==0&&(Ji.isStream(r.body)||Ji.isAsyncIterable(r.body)||Ji.isFormDataLike(r.body))))}}}a(sIs,"connectH1");function aIs(t){Ni(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[op];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[W_]=r,this[Sit][r8n](r));return}this[W_]=t,this[Sit][r8n](t)}a(aIs,"onHttpSocketError");function cIs(){this[op]?.readMore()}a(cIs,"onHttpSocketReadable");function lIs(){let t=this[op];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Ji.destroy(this,e);return}Ji.destroy(this,new ske("other side closed",Ji.getSocketInfo(this)))}a(lIs,"onHttpSocketEnd");function uIs(){let t=this[op];t&&(!this[W_]&&t.statusCode&&!t.shouldKeepAlive&&(this[W_]=t.finish()||this[W_]),this[op].destroy(),this[op]=null);let e=this[W_]||new ske("closed",Ji.getSocketInfo(this)),r=this[Sit];if(r[sfe]=null,r[l8n]=null,r.destroyed){Ni(r[VTs]===0);let n=r[KP].splice(r[mw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[KP][r[mw]];r[KP][r[mw]++]=null,Ji.errorRequest(r,n,e)}r[YTs]=r[mw],Ni(r[oE]===0),r.emit("disconnect",r[c8n],[r],e),r[dj]()}a(uIs,"onHttpSocketClose");function dIs(){this[jrr]=!0}a(dIs,"onSocketClose");function fIs(t){let e=t[sfe];if(e&&!e.destroyed){if(t[e8n]===0?!e[ike]&&e.unref&&(e.unref(),e[ike]=!0):e[ike]&&e.ref&&(e.ref(),e[ike]=!1),t[e8n]===0)e[op].timeoutType!==Hrr&&e[op].setTimeout(t[Tit],Hrr);else if(t[oE]>0&&e[op].statusCode<200&&e[op].timeoutType!==afe){let r=t[KP][t[mw]],n=r.headersTimeout!=null?r.headersTimeout:t[XTs];e[op].setTimeout(n,afe)}}}a(fIs,"resumeH1");function pIs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(pIs,"shouldSendContentLength");function hIs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Ji.isFormDataLike(u)){Urr||(Urr=ife().extractBody);let[E,_]=Urr(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Ji.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Ji.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),pIs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[qrr])return Ji.errorRequest(t,e,new HJ),!1;process.emitWarning(new HJ)}let g=t[sfe],A=a(E=>{e.aborted||e.completed||(Ji.errorRequest(t,e,E||new a8n),Ji.destroy(u),Ji.destroy(g,new ofe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Ji.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[tb]=!0),(s||r==="CONNECT")&&(g[tb]=!0),l!=null&&(g[tb]=l),t[t8n]&&g[tIs]++>=t[t8n]&&(g[tb]=!0),c&&(g[ake]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r +`);g.push(b,v,A),typeof v.size=="number"?c+=b.byteLength+v.size+A.byteLength:y=!0}let E=pit.encode(`--${d}--\r +`);g.push(E),c+=E.byteLength,y&&(c=null),s=t,o=a(async function*(){for(let _ of g)_.stream?yield*_.stream():yield _},"action"),l=`multipart/form-data; boundary=${d}`}else if(Wk.is.Blob(t))s=t,c=t.size,t.type&&(l=t.type);else if(typeof t[Symbol.asyncIterator]=="function"){if(e)throw new TypeError("keepalive");if(Hrr.isDisturbed(t)||t.locked)throw new TypeError("Response body object should not be disturbed or locked");r=Wk.is.ReadableStream(t)?t:lSs(t)}return(typeof s=="string"||mSs(s))&&(o=a(()=>(c=typeof s=="string"?Buffer.byteLength(s):s.length,s),"action")),o!=null&&(async()=>{let d=o(),f=d?.[Symbol.asyncIterator]?.();if(f)for await(let h of f){if(jrr(r))break;h.length&&n.enqueue(new Uint8Array(h))}else d?.length&&!jrr(r)&&n.enqueue(typeof d=="string"?pit.encode(d):new Uint8Array(d));queueMicrotask(()=>uSs(n))})(),[{stream:r,source:s,length:c},l]}a(ZFn,"extractBody");function TSs(t,e=!1){return Wk.is.ReadableStream(t)&&(qrr(!Hrr.isDisturbed(t),"The body has already been consumed."),qrr(!t.locked,"The stream is locked.")),ZFn(t,e)}a(TSs,"safelyExtractBody");function ISs(t){let{0:e,1:r}=t.stream.tee();return t.stream=e,{stream:r,length:t.length,source:t.source}}a(ISs,"cloneBody");function xSs(t,e){return{blob(){return Xde(this,n=>{let o=JFn(e(this));return o===null?o="":o&&(o=gSs(o)),new Blob([n],{type:o})},t,e)},arrayBuffer(){return Xde(this,n=>new Uint8Array(n).buffer,t,e)},text(){return Xde(this,_Ss,t,e)},json(){return Xde(this,ESs,t,e)},formData(){return Xde(this,n=>{let o=JFn(e(this));if(o!==null)switch(o.essence){case"multipart/form-data":{let s=ASs(n,o),c=new KFn;return pSs(c,s),c}case"application/x-www-form-urlencoded":{let s=new URLSearchParams(n.toString()),c=new KFn;for(let[l,u]of s)c.append(l,u);return c}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},t,e)},bytes(){return Xde(this,n=>new Uint8Array(n),t,e)}}}a(xSs,"bodyMixinMethods");function wSs(t,e){Object.assign(t.prototype,xSs(t,e))}a(wSs,"mixinBody");function Xde(t,e,r,n){try{Wk.brandCheck(t,r)}catch(l){return Promise.reject(l)}if(t=n(t),XFn(t))return Promise.reject(new TypeError("Body is unusable: Body has already been read"));let o=ySs(),s=o.reject,c=a(l=>{try{o.resolve(e(l))}catch(u){s(u)}},"successSteps");return t.body==null?(c(Buffer.allocUnsafe(0)),o.promise):(dSs(t.body,c,s),o.promise)}a(Xde,"consumeBody");function XFn(t){let e=t.body;return e!=null&&(e.stream.locked||Hrr.isDisturbed(e.stream))}a(XFn,"bodyUnusable");function JFn(t){let e=t.headersList,r=fSs(e);return r==="failure"?null:r}a(JFn,"bodyMimeType");e8n.exports={extractBody:ZFn,safelyExtractBody:TSs,cloneBody:ISs,mixinBody:wSs,streamRegistry:SSs,bodyUnusable:XFn}});var h8n=I((SZd,p8n)=>{"use strict";p();var Di=require("node:assert"),Yi=ko(),{channels:t8n}=rj(),Grr=btr(),{RequestContentLengthMismatchError:OJ,ResponseContentLengthMismatchError:r8n,RequestAbortedError:u8n,HeadersTimeoutError:RSs,HeadersOverflowError:PSs,SocketError:WRe,InformationalError:tfe,BodyTimeoutError:kSs,HTTPParserError:DSs,ResponseExceededMaxSizeError:NSs}=ao(),{kUrl:d8n,kReset:KC,kClient:yit,kParser:lp,kBlocking:zRe,kRunning:sE,kPending:MSs,kSize:n8n,kWriting:sj,kQueue:zk,kNoRef:$Re,kKeepAliveDefaultTimeout:OSs,kHostHeader:BSs,kPendingIdx:LSs,kRunningIdx:hw,kError:$_,kPipelining:git,kSocket:rfe,kKeepAliveTimeoutValue:Eit,kMaxHeadersSize:FSs,kKeepAliveMaxTimeout:USs,kKeepAliveTimeoutThreshold:QSs,kHeadersTimeout:qSs,kBodyTimeout:jSs,kStrictContentLength:Wrr,kMaxRequests:i8n,kCounter:HSs,kMaxResponseSize:GSs,kOnError:o8n,kResume:oj,kHTTPContext:f8n,kClosed:zrr}=tl(),XS=eFn(),s8n=Buffer.alloc(0),hit=Buffer[Symbol.species],$Ss=Yi.removeAllListeners,$rr;function VSs(){let t=process.env.JEST_WORKER_ID?Arr():void 0,e,r=process.arch!=="ppc64";if(process.env.UNDICI_NO_WASM_SIMD==="1"?r=!1:process.env.UNDICI_NO_WASM_SIMD==="0"&&(r=!0),r)try{e=new WebAssembly.Module(nFn())}catch{}return e||(e=new WebAssembly.Module(t||Arr())),new WebAssembly.Instance(e,{env:{wasm_on_url:a((n,o,s)=>0,"wasm_on_url"),wasm_on_status:a((n,o,s)=>{Di(cp.ptr===n);let c=o-WO+VO.byteOffset;return cp.onStatus(new hit(VO.buffer,c,s))},"wasm_on_status"),wasm_on_message_begin:a(n=>(Di(cp.ptr===n),cp.onMessageBegin()),"wasm_on_message_begin"),wasm_on_header_field:a((n,o,s)=>{Di(cp.ptr===n);let c=o-WO+VO.byteOffset;return cp.onHeaderField(new hit(VO.buffer,c,s))},"wasm_on_header_field"),wasm_on_header_value:a((n,o,s)=>{Di(cp.ptr===n);let c=o-WO+VO.byteOffset;return cp.onHeaderValue(new hit(VO.buffer,c,s))},"wasm_on_header_value"),wasm_on_headers_complete:a((n,o,s,c)=>(Di(cp.ptr===n),cp.onHeadersComplete(o,s===1,c===1)),"wasm_on_headers_complete"),wasm_on_body:a((n,o,s)=>{Di(cp.ptr===n);let c=o-WO+VO.byteOffset;return cp.onBody(new hit(VO.buffer,c,s))},"wasm_on_body"),wasm_on_message_complete:a(n=>(Di(cp.ptr===n),cp.onMessageComplete()),"wasm_on_message_complete")}})}a(VSs,"lazyllhttp");var Vrr=null,cp=null,VO=null,mit=0,WO=null,WSs=0,VRe=1,nfe=2|VRe,Ait=4|VRe,Yrr=8|WSs,Krr=class{static{a(this,"Parser")}constructor(e,r,{exports:n}){this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(XS.TYPE.RESPONSE),this.client=e,this.socket=r,this.timeout=null,this.timeoutWeakRef=new WeakRef(this),this.timeoutValue=null,this.timeoutType=null,this.statusCode=0,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=e[FSs],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=e[GSs]}setTimeout(e,r){e!==this.timeoutValue||r&VRe^this.timeoutType&VRe?(this.timeout&&(Grr.clearTimeout(this.timeout),this.timeout=null),e&&(r&VRe?this.timeout=Grr.setFastTimeout(a8n,e,this.timeoutWeakRef):(this.timeout=setTimeout(a8n,e,this.timeoutWeakRef),this.timeout?.unref())),this.timeoutValue=e):this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.timeoutType=r}resume(){this.socket.destroyed||!this.paused||(Di(this.ptr!=null),Di(cp===null),this.llhttp.llhttp_resume(this.ptr),Di(this.timeoutType===Ait),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),this.paused=!1,this.execute(this.socket.read()||s8n),this.readMore())}readMore(){for(;!this.paused&&this.ptr;){let e=this.socket.read();if(e===null)break;this.execute(e)}}execute(e){Di(cp===null),Di(this.ptr!=null),Di(!this.paused);let{socket:r,llhttp:n}=this;e.length>mit&&(WO&&n.free(WO),mit=Math.ceil(e.length/4096)*4096,WO=n.malloc(mit)),new Uint8Array(n.memory.buffer,WO,mit).set(e);try{let o;try{VO=e,cp=this,o=n.llhttp_execute(this.ptr,WO,e.length)}finally{cp=null,VO=null}if(o!==XS.ERROR.OK){let s=e.subarray(n.llhttp_get_error_pos(this.ptr)-WO);if(o===XS.ERROR.PAUSED_UPGRADE)this.onUpgrade(s);else if(o===XS.ERROR.PAUSED)this.paused=!0,r.unshift(s);else throw this.createError(o,s)}}catch(o){Yi.destroy(r,o)}}finish(){Di(cp===null),Di(this.ptr!=null),Di(!this.paused);let{llhttp:e}=this,r;try{cp=this,r=e.llhttp_finish(this.ptr)}finally{cp=null}return r===XS.ERROR.OK?null:r===XS.ERROR.PAUSED||r===XS.ERROR.PAUSED_UPGRADE?(this.paused=!0,null):this.createError(r,s8n)}createError(e,r){let{llhttp:n,contentLength:o,bytesRead:s}=this;if(o&&s!==parseInt(o,10))return new r8n;let c=n.llhttp_get_error_reason(this.ptr),l="";if(c){let u=new Uint8Array(n.memory.buffer,c).indexOf(0);l="Response does not match the HTTP/1.1 protocol ("+Buffer.from(n.memory.buffer,c,u).toString()+")"}return new DSs(l,XS.ERROR[e],r)}destroy(){Di(cp===null),Di(this.ptr!=null),this.llhttp.llhttp_free(this.ptr),this.ptr=null,this.timeout&&Grr.clearTimeout(this.timeout),this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.paused=!1}onStatus(e){return this.statusText=e.toString(),0}onMessageBegin(){let{socket:e,client:r}=this;if(e.destroyed)return-1;let n=r[zk][r[hw]];return n?(n.onResponseStarted(),0):-1}onHeaderField(e){let r=this.headers.length;return(r&1)===0?this.headers.push(e):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]),this.trackHeader(e.length),0}onHeaderValue(e){let r=this.headers.length;(r&1)===1?(this.headers.push(e),r+=1):this.headers[r-1]=Buffer.concat([this.headers[r-1],e]);let n=this.headers[r-2];if(n.length===10){let o=Yi.bufferToLowerCasedHeaderName(n);o==="keep-alive"?this.keepAlive+=e.toString():o==="connection"&&(this.connection+=e.toString())}else n.length===14&&Yi.bufferToLowerCasedHeaderName(n)==="content-length"&&(this.contentLength+=e.toString());return this.trackHeader(e.length),0}trackHeader(e){this.headersSize+=e,this.headersSize>=this.headersMaxSize&&Yi.destroy(this.socket,new PSs)}onUpgrade(e){let{upgrade:r,client:n,socket:o,headers:s,statusCode:c}=this;Di(r),Di(n[rfe]===o),Di(!o.destroyed),Di(!this.paused),Di((s.length&1)===0);let l=n[zk][n[hw]];Di(l),Di(l.upgrade||l.method==="CONNECT"),this.statusCode=0,this.statusText="",this.shouldKeepAlive=!1,this.headers=[],this.headersSize=0,o.unshift(e),o[lp].destroy(),o[lp]=null,o[yit]=null,o[$_]=null,$Ss(o),n[rfe]=null,n[f8n]=null,n[zk][n[hw]++]=null,n.emit("disconnect",n[d8n],[n],new tfe("upgrade"));try{l.onUpgrade(c,s,o)}catch(u){Yi.destroy(o,u)}n[oj]()}onHeadersComplete(e,r,n){let{client:o,socket:s,headers:c,statusText:l}=this;if(s.destroyed)return-1;let u=o[zk][o[hw]];if(!u)return-1;if(Di(!this.upgrade),Di(this.statusCode<200),e===100)return Yi.destroy(s,new WRe("bad response",Yi.getSocketInfo(s))),-1;if(r&&!u.upgrade)return Yi.destroy(s,new WRe("bad upgrade",Yi.getSocketInfo(s))),-1;if(Di(this.timeoutType===nfe),this.statusCode=e,this.shouldKeepAlive=n||u.method==="HEAD"&&!s[KC]&&this.connection.toLowerCase()==="keep-alive",this.statusCode>=200){let f=u.bodyTimeout!=null?u.bodyTimeout:o[jSs];this.setTimeout(f,Ait)}else this.timeout&&this.timeout.refresh&&this.timeout.refresh();if(u.method==="CONNECT")return Di(o[sE]===1),this.upgrade=!0,2;if(r)return Di(o[sE]===1),this.upgrade=!0,2;if(Di((this.headers.length&1)===0),this.headers=[],this.headersSize=0,this.shouldKeepAlive&&o[git]){let f=this.keepAlive?Yi.parseKeepAliveTimeout(this.keepAlive):null;if(f!=null){let h=Math.min(f-o[QSs],o[USs]);h<=0?s[KC]=!0:o[Eit]=h}else o[Eit]=o[OSs]}else s[KC]=!0;let d=u.onHeaders(e,c,this.resume,l)===!1;return u.aborted?-1:u.method==="HEAD"||e<200?1:(s[zRe]&&(s[zRe]=!1,o[oj]()),d?XS.ERROR.PAUSED:0)}onBody(e){let{client:r,socket:n,statusCode:o,maxResponseSize:s}=this;if(n.destroyed)return-1;let c=r[zk][r[hw]];return Di(c),Di(this.timeoutType===Ait),this.timeout&&this.timeout.refresh&&this.timeout.refresh(),Di(o>=200),s>-1&&this.bytesRead+e.length>s?(Yi.destroy(n,new NSs),-1):(this.bytesRead+=e.length,c.onData(e)===!1?XS.ERROR.PAUSED:0)}onMessageComplete(){let{client:e,socket:r,statusCode:n,upgrade:o,headers:s,contentLength:c,bytesRead:l,shouldKeepAlive:u}=this;if(r.destroyed&&(!n||u))return-1;if(o)return 0;Di(n>=100),Di((this.headers.length&1)===0);let d=e[zk][e[hw]];if(Di(d),this.statusCode=0,this.statusText="",this.bytesRead=0,this.contentLength="",this.keepAlive="",this.connection="",this.headers=[],this.headersSize=0,n<200)return 0;if(d.method!=="HEAD"&&c&&l!==parseInt(c,10))return Yi.destroy(r,new r8n),-1;if(d.onComplete(s),e[zk][e[hw]++]=null,r[sj])return Di(e[sE]===0),Yi.destroy(r,new tfe("reset")),XS.ERROR.PAUSED;if(u){if(r[KC]&&e[sE]===0)return Yi.destroy(r,new tfe("reset")),XS.ERROR.PAUSED;e[git]==null||e[git]===1?setImmediate(e[oj]):e[oj]()}else return Yi.destroy(r,new tfe("reset")),XS.ERROR.PAUSED;return 0}};function a8n(t){let e=t.deref();if(!e)return;let{socket:r,timeoutType:n,client:o,paused:s}=e;n===nfe?(!r[sj]||r.writableNeedDrain||o[sE]>1)&&(Di(!s,"cannot be paused while waiting for headers"),Yi.destroy(r,new RSs)):n===Ait?s||Yi.destroy(r,new kSs):n===Yrr&&(Di(o[sE]===0&&o[Eit]),Yi.destroy(r,new tfe("socket idle timeout")))}a(a8n,"onParserTimeout");function zSs(t,e){if(t[rfe]=e,Vrr||(Vrr=VSs()),e.errored)throw e.errored;if(e.destroyed)throw new WRe("destroyed");return e[$Re]=!1,e[sj]=!1,e[KC]=!1,e[zRe]=!1,e[lp]=new Krr(t,e,Vrr),Yi.addListener(e,"error",YSs),Yi.addListener(e,"readable",KSs),Yi.addListener(e,"end",JSs),Yi.addListener(e,"close",ZSs),e[zrr]=!1,e.on("close",XSs),{version:"h1",defaultPipelining:1,write(r){return rTs(t,r)},resume(){eTs(t)},destroy(r,n){e[zrr]?queueMicrotask(n):(e.on("close",n),e.destroy(r))},get destroyed(){return e.destroyed},busy(r){return!!(e[sj]||e[KC]||e[zRe]||r&&(t[sE]>0&&!r.idempotent||t[sE]>0&&(r.upgrade||r.method==="CONNECT")||t[sE]>0&&Yi.bodyLength(r.body)!==0&&(Yi.isStream(r.body)||Yi.isAsyncIterable(r.body)||Yi.isFormDataLike(r.body))))}}}a(zSs,"connectH1");function YSs(t){Di(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID");let e=this[lp];if(t.code==="ECONNRESET"&&e.statusCode&&!e.shouldKeepAlive){let r=e.finish();r&&(this[$_]=r,this[yit][o8n](r));return}this[$_]=t,this[yit][o8n](t)}a(YSs,"onHttpSocketError");function KSs(){this[lp]?.readMore()}a(KSs,"onHttpSocketReadable");function JSs(){let t=this[lp];if(t.statusCode&&!t.shouldKeepAlive){let e=t.finish();e&&Yi.destroy(this,e);return}Yi.destroy(this,new WRe("other side closed",Yi.getSocketInfo(this)))}a(JSs,"onHttpSocketEnd");function ZSs(){let t=this[lp];t&&(!this[$_]&&t.statusCode&&!t.shouldKeepAlive&&(this[$_]=t.finish()||this[$_]),this[lp].destroy(),this[lp]=null);let e=this[$_]||new WRe("closed",Yi.getSocketInfo(this)),r=this[yit];if(r[rfe]=null,r[f8n]=null,r.destroyed){Di(r[MSs]===0);let n=r[zk].splice(r[hw]);for(let o=0;o0&&e.code!=="UND_ERR_INFO"){let n=r[zk][r[hw]];r[zk][r[hw]++]=null,Yi.errorRequest(r,n,e)}r[LSs]=r[hw],Di(r[sE]===0),r.emit("disconnect",r[d8n],[r],e),r[oj]()}a(ZSs,"onHttpSocketClose");function XSs(){this[zrr]=!0}a(XSs,"onSocketClose");function eTs(t){let e=t[rfe];if(e&&!e.destroyed){if(t[n8n]===0?!e[$Re]&&e.unref&&(e.unref(),e[$Re]=!0):e[$Re]&&e.ref&&(e.ref(),e[$Re]=!1),t[n8n]===0)e[lp].timeoutType!==Yrr&&e[lp].setTimeout(t[Eit],Yrr);else if(t[sE]>0&&e[lp].statusCode<200&&e[lp].timeoutType!==nfe){let r=t[zk][t[hw]],n=r.headersTimeout!=null?r.headersTimeout:t[qSs];e[lp].setTimeout(n,nfe)}}}a(eTs,"resumeH1");function tTs(t){return t!=="GET"&&t!=="HEAD"&&t!=="OPTIONS"&&t!=="TRACE"&&t!=="CONNECT"}a(tTs,"shouldSendContentLength");function rTs(t,e){let{method:r,path:n,host:o,upgrade:s,blocking:c,reset:l}=e,{body:u,headers:d,contentLength:f}=e,h=r==="PUT"||r==="POST"||r==="PATCH"||r==="QUERY"||r==="PROPFIND"||r==="PROPPATCH";if(Yi.isFormDataLike(u)){$rr||($rr=efe().extractBody);let[E,_]=$rr(u);e.contentType==null&&d.push("content-type",_),u=E.stream,f=E.length}else Yi.isBlobLike(u)&&e.contentType==null&&u.type&&d.push("content-type",u.type);u&&typeof u.read=="function"&&u.read(0);let m=Yi.bodyLength(u);if(f=m??f,f===null&&(f=e.contentLength),f===0&&!h&&(f=null),tTs(r)&&f>0&&e.contentLength!==null&&e.contentLength!==f){if(t[Wrr])return Yi.errorRequest(t,e,new OJ),!1;process.emitWarning(new OJ)}let g=t[rfe],A=a(E=>{e.aborted||e.completed||(Yi.errorRequest(t,e,E||new u8n),Yi.destroy(u),Yi.destroy(g,new tfe("aborted")))},"abort");try{e.onConnect(A)}catch(E){Yi.errorRequest(t,e,E)}if(e.aborted)return!1;r==="HEAD"&&(g[KC]=!0),(s||r==="CONNECT")&&(g[KC]=!0),l!=null&&(g[KC]=l),t[i8n]&&g[HSs]++>=t[i8n]&&(g[KC]=!0),c&&(g[zRe]=!0),g.setTypeOfService&&g.setTypeOfService(e.typeOfService);let y=`${r} ${n} HTTP/1.1\r `;if(typeof o=="string"?y+=`host: ${o}\r -`:y+=t[zTs],s?y+=`connection: upgrade\r +`:y+=t[BSs],s?y+=`connection: upgrade\r upgrade: ${s}\r -`:t[vit]&&!g[tb]?y+=`connection: keep-alive\r +`:t[git]&&!g[KC]?y+=`connection: keep-alive\r `:y+=`connection: close\r `,Array.isArray(d))for(let E=0;E{e.removeListener("error",g)}),!u){let A=new a8n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Ni(o.destroyed||o[fj]&&r[oE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Ji.destroy(e,A):Ji.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(mIs,"writeStream");function o8n(t,e,r,n,o,s,c,l){try{e?Ji.isBuffer(e)&&(Ni(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r +`}return t8n.sendHeaders.hasSubscribers&&t8n.sendHeaders.publish({request:e,headers:y,socket:g}),!u||m===0?c8n(A,null,t,e,g,f,y,h):Yi.isBuffer(u)?c8n(A,u,t,e,g,f,y,h):Yi.isBlobLike(u)?typeof u.stream=="function"?l8n(A,u.stream(),t,e,g,f,y,h):iTs(A,u,t,e,g,f,y,h):Yi.isStream(u)?nTs(A,u,t,e,g,f,y,h):Yi.isIterable(u)?l8n(A,u,t,e,g,f,y,h):Di(!1),!0}a(rTs,"writeH1");function nTs(t,e,r,n,o,s,c,l){Di(s!==0||r[sE]===0,"stream body cannot be pipelined");let u=!1,d=new _it({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c}),f=a(function(A){if(!u)try{!d.write(A)&&this.pause&&this.pause()}catch(y){Yi.destroy(this,y)}},"onData"),h=a(function(){u||e.resume&&e.resume()},"onDrain"),m=a(function(){if(queueMicrotask(()=>{e.removeListener("error",g)}),!u){let A=new u8n;queueMicrotask(()=>g(A))}},"onClose"),g=a(function(A){if(!u){if(u=!0,Di(o.destroyed||o[sj]&&r[sE]<=1),o.off("drain",h).off("error",g),e.removeListener("data",f).removeListener("end",g).removeListener("close",m),!A)try{d.end()}catch(y){A=y}d.destroy(A),A&&(A.code!=="UND_ERR_INFO"||A.message!=="reset")?Yi.destroy(e,A):Yi.destroy(e)}},"onFinished");e.on("data",f).on("end",g).on("error",g).on("close",m),e.resume&&e.resume(),o.on("drain",h).on("error",g),e.errorEmitted??e.errored?setImmediate(g,e.errored):(e.endEmitted??e.readableEnded)&&setImmediate(g,null),(e.closeEmitted??e.closed)&&setImmediate(m)}a(nTs,"writeStream");function c8n(t,e,r,n,o,s,c,l){try{e?Yi.isBuffer(e)&&(Di(s===e.byteLength,"buffer body must have content length"),o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[tb]=!0)):s===0?o.write(`${c}content-length: 0\r +`,"latin1"),o.write(e),o.uncork(),n.onBodySent(e),!l&&n.reset!==!1&&(o[KC]=!0)):s===0?o.write(`${c}content-length: 0\r \r -`,"latin1"):(Ni(s===null,"no body must not have content length"),o.write(`${c}\r -`,"latin1")),n.onRequestSent(),r[dj]()}catch(u){t(u)}}a(o8n,"writeBuffer");async function gIs(t,e,r,n,o,s,c,l){Ni(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new HJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r +`,"latin1"):(Di(s===null,"no body must not have content length"),o.write(`${c}\r +`,"latin1")),n.onRequestSent(),r[oj]()}catch(u){t(u)}}a(c8n,"writeBuffer");async function iTs(t,e,r,n,o,s,c,l){Di(s===e.size,"blob body must have content length");try{if(s!=null&&s!==e.size)throw new OJ;let u=Buffer.from(await e.arrayBuffer());o.cork(),o.write(`${c}content-length: ${s}\r \r -`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[tb]=!0),r[dj]()}catch(u){t(u)}}a(gIs,"writeBlob");async function s8n(t,e,r,n,o,s,c,l){Ni(s!==0||r[oE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Ni(u===null),o[W_]?g(o[W_]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new Iit({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[W_])throw o[W_];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(s8n,"writeIterable");var Iit=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[fj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[W_])throw r[W_];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[qrr])throw new HJ;process.emitWarning(new HJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[tb]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r +`,"latin1"),o.write(u),o.uncork(),n.onBodySent(u),n.onRequestSent(),!l&&n.reset!==!1&&(o[KC]=!0),r[oj]()}catch(u){t(u)}}a(iTs,"writeBlob");async function l8n(t,e,r,n,o,s,c,l){Di(s!==0||r[sE]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let m=u;u=null,m()}}a(d,"onDrain");let f=a(()=>new Promise((m,g)=>{Di(u===null),o[$_]?g(o[$_]):u=m}),"waitForDrain");o.on("close",d).on("drain",d);let h=new _it({abort:t,socket:o,request:n,contentLength:s,client:r,expectsPayload:l,header:c});try{for await(let m of e){if(o[$_])throw o[$_];h.write(m)||await f()}h.end()}catch(m){h.destroy(m)}finally{o.off("close",d).off("drain",d)}}a(l8n,"writeIterable");var _it=class{static{a(this,"AsyncWriter")}constructor({abort:e,socket:r,request:n,contentLength:o,client:s,expectsPayload:c,header:l}){this.socket=r,this.request=n,this.contentLength=o,this.client=s,this.bytesWritten=0,this.expectsPayload=c,this.header=l,this.abort=e,r[sj]=!0}write(e){let{socket:r,request:n,contentLength:o,client:s,bytesWritten:c,expectsPayload:l,header:u}=this;if(r[$_])throw r[$_];if(r.destroyed)return!1;let d=Buffer.byteLength(e);if(!d)return!0;if(o!==null&&c+d>o){if(s[Wrr])throw new OJ;process.emitWarning(new OJ)}r.cork(),c===0&&(!l&&n.reset!==!1&&(r[KC]=!0),o===null?r.write(`${u}transfer-encoding: chunked\r `,"latin1"):r.write(`${u}content-length: ${o}\r \r `,"latin1")),o===null&&r.write(`\r ${d.toString(16)}\r -`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[op].timeout&&r[op].timeoutType===afe&&r[op].timeout.refresh&&r[op].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[fj]=!1,e[W_])throw e[W_];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r +`,"latin1"),this.bytesWritten+=d;let f=r.write(e);return r.uncork(),n.onBodySent(e),f||r[lp].timeout&&r[lp].timeoutType===nfe&&r[lp].timeout.refresh&&r[lp].timeout.refresh(),f}end(){let{socket:e,contentLength:r,client:n,bytesWritten:o,expectsPayload:s,header:c,request:l}=this;if(l.onRequestSent(),e[sj]=!1,e[$_])throw e[$_];if(!e.destroyed){if(o===0?s?e.write(`${c}content-length: 0\r \r `,"latin1"):e.write(`${c}\r `,"latin1"):r===null&&e.write(`\r 0\r \r -`,"latin1"),r!==null&&o!==r){if(n[qrr])throw new HJ;process.emitWarning(new HJ)}e[op].timeout&&e[op].timeoutType===afe&&e[op].timeout.refresh&&e[op].timeout.refresh(),n[dj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[fj]=!1,e&&(Ni(n[oE]<=1,"pipeline should only contain this request"),o(e))}};u8n.exports=sIs});var _8n=I((Kef,E8n)=>{"use strict";p();var Aw=require("node:assert"),{pipeline:AIs}=require("node:stream"),ps=Do(),{RequestContentLengthMismatchError:zrr,RequestAbortedError:yIs,SocketError:dke,InformationalError:pj,InvalidArgumentError:EIs}=ao(),{kUrl:uke,kReset:kit,kClient:sT,kRunning:fke,kPending:_Is,kQueue:hj,kPendingIdx:Krr,kRunningIdx:JP,kError:aT,kSocket:Af,kStrictContentLength:CIs,kOnError:cfe,kMaxConcurrentStreams:wit,kPingInterval:f8n,kHTTP2Session:mF,kHTTP2InitialWindowSize:vIs,kHTTP2ConnectionWindowSize:bIs,kResume:e5,kSize:SIs,kHTTPContext:Jrr,kClosed:Yrr,kBodyTimeout:TIs,kEnableConnectProtocol:cke,kRemoteSettings:lke,kHTTP2Stream:xit,kHTTP2SessionState:Zrr}=nl(),{channels:p8n}=cj(),gw=Symbol("open streams"),h8n,Rit;try{Rit=require("node:http2")}catch{Rit={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:IIs,HTTP2_HEADER_METHOD:m8n,HTTP2_HEADER_PATH:g8n,HTTP2_HEADER_SCHEME:$rr,HTTP2_HEADER_CONTENT_LENGTH:xIs,HTTP2_HEADER_EXPECT:wIs,HTTP2_HEADER_STATUS:Vrr,HTTP2_HEADER_PROTOCOL:RIs,NGHTTP2_REFUSED_STREAM:kIs,NGHTTP2_CANCEL:PIs}}=Rit;function Wrr(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Wrr,"parseH2Headers");function DIs(t,e){t[Af]=e;let r=t[vIs],n=t[bIs],o=Rit.connect(t[uke],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[wit],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[Af]=e,o[gw]=0,o[sT]=t,o[Af]=e,o[Zrr]={ping:{interval:t[f8n]===0?null:setInterval(BIs,t[f8n],o).unref()}},o[cke]=!1,o[lke]=!1,n&&ps.addListener(o,"connect",MIs.bind(o,n)),ps.addListener(o,"error",LIs),ps.addListener(o,"frameError",FIs),ps.addListener(o,"end",UIs),ps.addListener(o,"goaway",QIs),ps.addListener(o,"close",qIs),ps.addListener(o,"remoteSettings",OIs),o.unref(),t[mF]=o,e[mF]=o,ps.addListener(e,"error",HIs),ps.addListener(e,"end",GIs),ps.addListener(e,"close",jIs),e[Yrr]=!1,e.on("close",$Is),{version:"h2",defaultPipelining:1/0,write(s){return WIs(t,s)},resume(){NIs(t)},destroy(s,c){e[Yrr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[fke]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[lke]===!1||ps.bodyLength(s.body)!==0&&(ps.isStream(s.body)||ps.isAsyncIterable(s.body)||ps.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[lke]===!1;return!1}}}a(DIs,"connectH2");function NIs(t){let e=t[Af];e?.destroyed===!1&&(t[SIs]===0||t[wit]===0?(e.unref(),t[mF].unref()):(e.ref(),t[mF].ref()))}a(NIs,"resumeH2");function MIs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(MIs,"applyConnectionWindowSize");function OIs(t){if(this[sT][wit]=t.maxConcurrentStreams??this[sT][wit],this[lke]===!0&&this[cke]===!0&&t.enableConnectProtocol===!1){let e=new pj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[Af][aT]=e,this[sT][cfe](e);return}this[cke]=t.enableConnectProtocol??this[cke],this[lke]=!0,this[sT][e5]()}a(OIs,"onHttp2RemoteSettings");function BIs(t){let e=t[Zrr];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[sT],c=this[sT];if(n!=null){let l=new pj(`HTTP/2: "PING" errored - type ${n.message}`);c[aT]=l,s[cfe](l)}else s.emit("ping",o)}a(r,"onPing")}a(BIs,"onHttp2SendPing");function LIs(t){Aw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Af][aT]=t,this[sT][cfe](t)}a(LIs,"onHttp2SessionError");function FIs(t,e,r){if(r===0){let n=new pj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[Af][aT]=n,this[sT][cfe](n)}}a(FIs,"onHttp2FrameError");function UIs(){let t=new dke("other side closed",ps.getSocketInfo(this[Af]));this.destroy(t),ps.destroy(this[Af],t)}a(UIs,"onHttp2SessionEnd");function QIs(t){let e=this[aT]||new dke(`HTTP/2: "GOAWAY" frame received with code ${t}`,ps.getSocketInfo(this[Af])),r=this[sT];if(r[Af]=null,r[Jrr]=null,this.close(),this[mF]=null,ps.destroy(this[Af],e),r[JP]{e.aborted||e.completed||(x=x||new yIs,ps.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[cfe](x),t[e5]()),ps.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ps.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[cke]===!1?(ps.errorRequest(t,e,new pj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[m8n]="CONNECT",g[RIs]="websocket",g[g8n]=s,f==="ws:"||f==="wss:"?g[$rr]=f==="ws:"?"http":"https":g[$rr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[xit]=!0,A.once("response",(x,k)=>{let{[Vrr]:D,...N}=x;e.onUpgrade(D,Wrr(N),A),++n[gw],t[hj][t[JP]++]=null}),A.on("error",()=>{(A.rstCode===kIs||A.rstCode===PIs)&&_(new pj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[gw]-=1,n[gw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[xit]=!0,A.on("response",x=>{let{[Vrr]:k,...D}=x;e.onUpgrade(k,Wrr(D),A),++n[gw],t[hj][t[JP]++]=null}),A.once("close",()=>{n[gw]-=1,n[gw]===0&&n.unref()}),A.setTimeout(r),!0);g[g8n]=s,g[$rr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ps.bodyLength(m);if(ps.isFormDataLike(m)){h8n??=ife().extractBody;let[x,k]=h8n(m);g["content-type"]=k,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),VIs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[CIs])return ps.errorRequest(t,e,new zrr),!1;process.emitWarning(new zrr)}if(b!=null&&(Aw(m||b===0,"no body must not have content length"),g[xIs]=`${b}`),n.ref(),p8n.sendHeaders.hasSubscribers){let x="";for(let k in g)x+=`${k}: ${g[k]}\r -`;p8n.sendHeaders.publish({request:e,headers:x,socket:n[Af]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[wIs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[xit]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[xit]=!0,R()),++n[gw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Vrr]:k,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(k),Wrr(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[hj][t[JP]++]=null,t[e5]()):(_(new pj("HTTP/2: stream half-closed (remote)")),t[hj][t[JP]++]=null,t[Krr]=t[JP],t[e5]())}),A.once("close",()=>{A.removeAllListeners("data"),n[gw]-=1,n[gw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,k)=>{A.removeAllListeners("data"),_(new pj(`HTTP/2: "frameError" received - type ${x}, code ${k}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new pj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[gw]-=1,n[gw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?A8n(_,A,null,t,e,t[Af],b,v):ps.isBuffer(m)?A8n(_,A,m,t,e,t[Af],b,v):ps.isBlobLike(m)?typeof m.stream=="function"?y8n(_,A,m.stream(),t,e,t[Af],b,v):YIs(_,A,m,t,e,t[Af],b,v):ps.isStream(m)?zIs(_,t[Af],v,A,m,t,e,b):ps.isIterable(m)?y8n(_,A,m,t,e,t[Af],b,v):Aw(!1)}a(R,"writeBodyH2")}a(WIs,"writeH2");function A8n(t,e,r,n,o,s,c,l){try{r!=null&&ps.isBuffer(r)&&(Aw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[kit]=!0),o.onRequestSent(),n[e5]()}catch(u){t(u)}}a(A8n,"writeBuffer");function zIs(t,e,r,n,o,s,c,l){Aw(l!==0||s[fke]===0,"stream body cannot be pipelined");let u=AIs(o,n,f=>{f?(ps.destroy(u,f),t(f)):(ps.removeAllListeners(u),c.onRequestSent(),r||(e[kit]=!0),s[e5]())});ps.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(zIs,"writeStream");async function YIs(t,e,r,n,o,s,c,l){Aw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new zrr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[kit]=!0),n[e5]()}catch(u){t(u)}}a(YIs,"writeBlob");async function y8n(t,e,r,n,o,s,c,l){Aw(c!==0||n[fke]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{Aw(u===null),s[aT]?m(s[aT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[aT])throw s[aT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[kit]=!0),n[e5]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(y8n,"writeIterable");E8n.exports=DIs});var yj=I((Xef,w8n)=>{"use strict";p();var gF=require("node:assert"),S8n=require("node:net"),pke=require("node:http"),GJ=Do(),{ClientStats:KIs}=Vtr(),{channels:lfe}=cj(),JIs=U3n(),ZIs=FJ(),{InvalidArgumentError:nd,InformationalError:XIs,ClientDestroyedError:exs}=ao(),txs=UJ(),{kUrl:t5,kServerName:Aj,kClient:rxs,kBusy:enr,kConnect:nxs,kResuming:$J,kRunning:Ake,kPending:yke,kSize:hke,kQueue:ZP,kConnected:ixs,kConnecting:ufe,kNeedDrain:gj,kKeepAliveDefaultTimeout:C8n,kHostHeader:oxs,kPendingIdx:XP,kRunningIdx:yF,kError:sxs,kPipelining:Pit,kKeepAliveTimeoutValue:axs,kMaxHeadersSize:cxs,kKeepAliveMaxTimeout:lxs,kKeepAliveTimeoutThreshold:uxs,kHeadersTimeout:dxs,kBodyTimeout:fxs,kStrictContentLength:pxs,kConnector:mke,kMaxRequests:tnr,kCounter:hxs,kClose:mxs,kDestroy:gxs,kDispatch:Axs,kLocalAddress:gke,kMaxResponseSize:yxs,kOnError:Exs,kHTTPContext:Kp,kMaxConcurrentStreams:_xs,kHTTP2InitialWindowSize:Cxs,kHTTP2ConnectionWindowSize:vxs,kResume:AF,kPingInterval:bxs}=nl(),Sxs=d8n(),Txs=_8n(),mj=Symbol("kClosedResolve"),Ixs=pke&&pke.maxHeaderSize&&Number.isInteger(pke.maxHeaderSize)&&pke.maxHeaderSize>0?()=>pke.maxHeaderSize:()=>{throw new nd("http module not available or http.maxHeaderSize invalid")},v8n=a(()=>{},"noop");function T8n(t){return t[Pit]??t[Kp]?.defaultPipelining??1}a(T8n,"getPipelining");var rnr=class extends ZIs{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k,maxConcurrentStreams:D,allowH2:N,useH2c:L,initialWindowSize:B,connectionWindowSize:Q,pingInterval:M}={}){if(d!==void 0)throw new nd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new nd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new nd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new nd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new nd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new nd("invalid maxHeaderSize")}else r=Ixs();if(A!=null&&typeof A!="string")throw new nd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new nd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new nd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new nd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new nd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new nd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new nd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new nd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new nd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||S8n.isIP(w)===0))throw new nd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new nd("maxResponseSize must be a positive number");if(k!=null&&(!Number.isInteger(k)||k<-1))throw new nd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new nd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new nd("maxConcurrentStreams must be a positive integer, greater than 0");if(L!=null&&typeof L!="boolean")throw new nd("useH2c must be a valid boolean value");if(B!=null&&(!Number.isInteger(B)||B<1))throw new nd("initialWindowSize must be a positive integer, greater than 0");if(Q!=null&&(!Number.isInteger(Q)||Q<1))throw new nd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new nd("pingInterval must be a positive integer, greater or equal to 0");if(super(),typeof b!="function")b=txs({...E,maxCachedSessions:v,allowH2:N,useH2c:L,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:k}:void 0,...b});else{let O=b;b=a((q,F)=>O({...q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},F),"connect")}this[t5]=GJ.parseOrigin(e),this[mke]=b,this[Pit]=y??1,this[cxs]=r,this[C8n]=f??4e3,this[lxs]=m??6e5,this[uxs]=g??2e3,this[axs]=this[C8n],this[Aj]=null,this[gke]=w??null,this[$J]=0,this[gj]=0,this[oxs]=`host: ${this[t5].hostname}${this[t5].port?`:${this[t5].port}`:""}\r -`,this[fxs]=l??3e5,this[dxs]=n??3e5,this[pxs]=_??!0,this[tnr]=T,this[mj]=null,this[yxs]=R>-1?R:-1,this[Kp]=null,this[_xs]=D??100,this[Cxs]=B??262144,this[vxs]=Q??524288,this[bxs]=M??6e4,this[ZP]=[],this[yF]=0,this[XP]=0,this[AF]=O=>nnr(this,O),this[Exs]=O=>I8n(this,O)}get pipelining(){return this[Pit]}set pipelining(e){this[Pit]=e,this[AF](!0)}get stats(){return new KIs(this)}get[yke](){return this[ZP].length-this[XP]}get[Ake](){return this[XP]-this[yF]}get[hke](){return this[ZP].length-this[yF]}get[ixs](){return!!this[Kp]&&!this[ufe]&&!this[Kp].destroyed}get[enr](){return!!(this[Kp]?.busy(null)||this[hke]>=(T8n(this)||1)||this[yke]>0)}[nxs](e){x8n(this),this.once("connect",e)}[Axs](e,r){let n=new JIs(this[t5].origin,e,r);return this[ZP].push(n),this[$J]||(GJ.bodyLength(n.body)==null&&GJ.isIterable(n.body)?(this[$J]=1,queueMicrotask(()=>nnr(this))):this[AF](!0)),this[$J]&&this[gj]!==2&&this[enr]&&(this[gj]=2),this[gj]<2}[mxs](){return new Promise(e=>{this[hke]?this[mj]=e:e(null)})}[gxs](e){return new Promise(r=>{let n=this[ZP].splice(this[XP]);for(let s=0;s{this[mj]&&(this[mj](),this[mj]=null),r(null)},"callback");this[Kp]?(this[Kp].destroy(e,o),this[Kp]=null):queueMicrotask(o),this[AF]()})}};function I8n(t,e){if(t[Ake]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){gF(t[XP]===t[yF]);let r=t[ZP].splice(t[yF]);for(let n=0;n{if(s){Xrr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[AF]();return}if(t.destroyed){GJ.destroy(c.on("error",v8n),new exs),t[AF]();return}gF(c);try{t[Kp]=c.alpnProtocol==="h2"?Txs(t,c):Sxs(t,c)}catch(l){c.destroy().on("error",v8n),Xrr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[AF]();return}t[ufe]=!1,c[hxs]=0,c[tnr]=t[tnr],c[rxs]=t,c[sxs]=null,lfe.connected.hasSubscribers&&lfe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Kp]?.version,servername:t[Aj],localAddress:t[gke]},connector:t[mke],socket:c}),t.emit("connect",t[t5],[t]),t[AF]()})}catch(s){Xrr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[AF]()}}a(x8n,"connect");function Xrr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[ufe]=!1,lfe.connectError.hasSubscribers&&lfe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[Kp]?.version,servername:t[Aj],localAddress:t[gke]},connector:t[mke],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(gF(t[Ake]===0);t[yke]>0&&t[ZP][t[XP]].servername===t[Aj];){let c=t[ZP][t[XP]++];GJ.errorRequest(t,c,e)}else I8n(t,e);t.emit("connectionError",t[t5],[t],e)}}a(Xrr,"handleConnectError");function b8n(t){t[gj]=0,t.emit("drain",t[t5],[t])}a(b8n,"emitDrain");function nnr(t,e){t[$J]!==2&&(t[$J]=2,xxs(t,e),t[$J]=0,t[yF]>256&&(t[ZP].splice(0,t[yF]),t[XP]-=t[yF],t[yF]=0))}a(nnr,"resume");function xxs(t,e){for(;;){if(t.destroyed){gF(t[yke]===0);return}if(t[mj]&&!t[hke]){t[mj](),t[mj]=null;return}if(t[Kp]&&t[Kp].resume(),t[enr])t[gj]=2;else if(t[gj]===2){e?(t[gj]=1,queueMicrotask(()=>b8n(t))):b8n(t);continue}if(t[yke]===0||t[Ake]>=(T8n(t)||1))return;let r=t[ZP][t[XP]];if(r===null)return;if(t[t5].protocol==="https:"&&t[Aj]!==r.servername){if(t[Ake]>0)return;t[Aj]=r.servername,t[Kp]?.destroy(new XIs("servername changed"),()=>{t[Kp]=null,nnr(t)})}if(t[ufe])return;if(!t[Kp]){x8n(t);return}if(t[Kp].destroyed||t[Kp].busy(r))return;!r.aborted&&t[Kp].write(r)?t[XP]++:t[ZP].splice(t[XP],1)}}a(xxs,"_resume");w8n.exports=rnr});var inr=I((ntf,R8n)=>{"use strict";p();var Dit=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};R8n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Dit}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Dit),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var Nit=I((stf,F8n)=>{"use strict";p();var{PoolStats:wxs}=Vtr(),Rxs=FJ(),kxs=inr(),{kConnected:onr,kSize:k8n,kRunning:P8n,kPending:D8n,kQueued:Eke,kBusy:Pxs,kFree:Dxs,kUrl:Nxs,kClose:Mxs,kDestroy:Oxs,kDispatch:Bxs}=nl(),Eg=Symbol("clients"),z_=Symbol("needDrain"),_ke=Symbol("queue"),snr=Symbol("closed resolve"),anr=Symbol("onDrain"),N8n=Symbol("onConnect"),M8n=Symbol("onDisconnect"),O8n=Symbol("onConnectionError"),cnr=Symbol("get dispatcher"),B8n=Symbol("add client"),L8n=Symbol("remove client"),lnr=class extends Rxs{static{a(this,"PoolBase")}[_ke]=new kxs;[Eke]=0;[Eg]=[];[z_]=!1;[anr](e,r,n){let o=this[_ke],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[Eke]--,s=!e.dispatch(c.opts,c.handler)}if(e[z_]=s,!s&&this[z_]&&(this[z_]=!1,this.emit("drain",r,[this,...n])),this[snr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[M8n]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[O8n]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[Pxs](){return this[z_]}get[onr](){let e=0;for(let{[onr]:r}of this[Eg])e+=r;return e}get[Dxs](){let e=0;for(let{[onr]:r,[z_]:n}of this[Eg])e+=r&&!n;return e}get[D8n](){let e=this[Eke];for(let{[D8n]:r}of this[Eg])e+=r;return e}get[P8n](){let e=0;for(let{[P8n]:r}of this[Eg])e+=r;return e}get[k8n](){let e=this[Eke];for(let{[k8n]:r}of this[Eg])e+=r;return e}get stats(){return new wxs(this)}[Mxs](){if(this[_ke].isEmpty()){let e=[];for(let r=0;r{this[snr]=e})}[Oxs](e){for(;;){let n=this[_ke].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[Eg].length);for(let n=0;n{this[z_]&&this[anr](e,e[Nxs],[e,this])}),this}[L8n](e){e.close(()=>{let r=this[Eg].indexOf(e);r!==-1&&this[Eg].splice(r,1)}),this[z_]=this[Eg].some(r=>!r[z_]&&r.closed!==!0&&r.destroyed!==!0)}};F8n.exports={PoolBase:lnr,kClients:Eg,kNeedDrain:z_,kAddClient:B8n,kRemoveClient:L8n,kGetDispatcher:cnr}});var VJ=I((ltf,j8n)=>{"use strict";p();var{PoolBase:Lxs,kClients:Mit,kNeedDrain:Fxs,kAddClient:Uxs,kGetDispatcher:Qxs,kRemoveClient:qxs}=Nit(),jxs=yj(),{InvalidArgumentError:unr}=ao(),U8n=Do(),{kUrl:Q8n}=nl(),Hxs=UJ(),Oit=Symbol("options"),dnr=Symbol("connections"),q8n=Symbol("factory");function Gxs(t,e){return new jxs(t,e)}a(Gxs,"defaultFactory");var fnr=class extends Lxs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=Gxs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new unr("invalid connections");if(typeof n!="function")throw new unr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new unr("connect must be a function or an object");typeof o!="function"&&(o=Hxs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[dnr]=r||null,this[Q8n]=U8n.parseOrigin(e),this[Oit]={...U8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Oit].interceptors=g.interceptors?{...g.interceptors}:void 0,this[q8n]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[Mit].indexOf(_);v!==-1&&this[Mit].splice(v,1)}})}[Qxs](){let e=this[Oit].clientTtl;for(let r of this[Mit])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[qxs](r);else if(!r[Fxs])return r;if(!this[dnr]||this[Mit].length{"use strict";p();var{BalancedPoolMissingUpstreamError:$xs,InvalidArgumentError:Vxs}=ao(),{PoolBase:Wxs,kClients:wA,kNeedDrain:Cke,kAddClient:zxs,kRemoveClient:Yxs,kGetDispatcher:Kxs}=Nit(),Jxs=VJ(),{kUrl:Bit}=nl(),Lit=Do(),H8n=Symbol("factory"),vke=Symbol("options"),G8n=Symbol("kGreatestCommonDivisor"),WJ=Symbol("kCurrentWeight"),zJ=Symbol("kIndex"),yw=Symbol("kWeight"),Fit=Symbol("kMaxWeightPerServer"),Uit=Symbol("kErrorPenalty");function Zxs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(Zxs,"getGreatestCommonDivisor");function Xxs(t,e){return new Jxs(t,e)}a(Xxs,"defaultFactory");var pnr=class extends Wxs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=Xxs,...n}={}){if(typeof r!="function")throw new Vxs("factory must be a function.");super(),this[vke]={...Lit.deepClone(n)},this[vke].interceptors=n.interceptors?{...n.interceptors}:void 0,this[zJ]=-1,this[WJ]=0,this[Fit]=this[vke].maxWeightPerServer||100,this[Uit]=this[vke].errorPenalty||15,Array.isArray(e)||(e=[e]),this[H8n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=Lit.parseOrigin(e).origin;if(this[wA].find(o=>o[Bit].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[H8n](r,this[vke]);this[zxs](n),n.on("connect",()=>{n[yw]=Math.min(this[Fit],n[yw]+this[Uit])}),n.on("connectionError",()=>{n[yw]=Math.max(1,n[yw]-this[Uit]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[yw]=Math.max(1,n[yw]-this[Uit]),this._updateBalancedPoolStats())});for(let o of this[wA])o[yw]=this[Fit];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Bit].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[Yxs](n),this}getUpstream(e){let r=Lit.parseOrigin(e).origin;return this[wA].find(n=>n[Bit].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[wA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Bit].origin)}[Kxs](){if(this[wA].length===0)throw new $xs;if(!this[wA].find(s=>!s[Cke]&&s.closed!==!0&&s.destroyed!==!0)||this[wA].map(s=>s[Cke]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[wA].findIndex(s=>!s[Cke]);for(;n++this[wA][o][yw]&&!s[Cke]&&(o=this[zJ]),this[zJ]===0&&(this[WJ]=this[WJ]-this[G8n],this[WJ]<=0&&(this[WJ]=this[Fit])),s[yw]>=this[WJ]&&!s[Cke])return s}return this[WJ]=this[wA][o][yw],this[zJ]=o,this[wA][o]}};$8n.exports=pnr});var K8n=I((mtf,Y8n)=>{"use strict";p();var{PoolBase:ews,kClients:Qit,kNeedDrain:tws,kAddClient:W8n,kGetDispatcher:rws,kRemoveClient:nws}=Nit(),iws=yj(),{InvalidArgumentError:hnr}=ao(),z8n=Do(),{kUrl:mnr}=nl(),ows=UJ(),bke=Symbol("options"),gnr=Symbol("connections"),Anr=Symbol("factory"),qit=Symbol("index");function sws(t,e){return new iws(t,e)}a(sws,"defaultFactory");var ynr=class extends ews{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=sws,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new hnr("invalid connections");if(typeof n!="function")throw new hnr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new hnr("connect must be a function or an object");typeof o!="function"&&(o=ows({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[gnr]=r||null,this[mnr]=z8n.parseOrigin(e),this[bke]={...z8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[bke].interceptors=g.interceptors?{...g.interceptors}:void 0,this[Anr]=n,this[qit]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[Qit].indexOf(_);v!==-1&&this[Qit].splice(v,1)}})}[rws](){let e=this[bke].clientTtl,r=this[Qit].length;if(r===0){let o=this[Anr](this[mnr],this[bke]);return this[W8n](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[nws](o),n++;continue}if(!o[tws])return o;n++}if(!this[gnr]||r{"use strict";p();var{InvalidArgumentError:jit,MaxOriginsReachedError:aws}=ao(),{kClients:Ew,kRunning:J8n,kClose:cws,kDestroy:lws,kDispatch:uws,kUrl:dws}=nl(),fws=FJ(),pws=VJ(),hws=yj(),mws=Do(),Z8n=Symbol("onConnect"),X8n=Symbol("onDisconnect"),e6n=Symbol("onConnectionError"),t6n=Symbol("onDrain"),r6n=Symbol("factory"),Enr=Symbol("options"),Ske=Symbol("origins");function gws(t,e){return e&&e.connections===1?new hws(t,e):new pws(t,e)}a(gws,"defaultFactory");var _nr=class extends fws{static{a(this,"Agent")}constructor({factory:e=gws,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new jit("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new jit("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new jit("maxOrigins must be a number greater than 0");super(),n&&typeof n!="function"&&(n={...n}),this[Enr]={...mws.deepClone(o),maxOrigins:r,connect:n},this[r6n]=e,this[Ew]=new Map,this[Ske]=new Set,this[t6n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[Z8n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[X8n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[e6n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[J8n](){let e=0;for(let{dispatcher:r}of this[Ew].values())e+=r[J8n];return e}[uws](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new jit("opts.origin must be a non-empty string or URL.");if(this[Ske].size>=this[Enr].maxOrigins&&!this[Ske].has(n))throw new aws;let o=this[Ew].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[Ew].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[Ew].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[Ske].delete(n))},"closeClientIfUnused");s=this[r6n](e.origin,this[Enr]).on("drain",this[t6n]).on("connect",(l,u)=>{let d=this[Ew].get(n);d&&(d.count+=1),this[Z8n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[X8n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[e6n](l,u,d)}),this[Ew].set(n,{count:0,dispatcher:s}),this[Ske].add(n)}return s.dispatch(e,r)}[cws](){let e=[];for(let{dispatcher:r}of this[Ew].values())e.push(r.close());return this[Ew].clear(),Promise.all(e)}[lws](e){let r=[];for(let{dispatcher:n}of this[Ew].values())r.push(n.destroy(e));return this[Ew].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[Ew].values())r.stats&&(e[r[dws].origin]=r.stats);return e}};n6n.exports=_nr});var a6n=I((Ctf,s6n)=>{"use strict";p();var{Buffer:_j}=require("node:buffer"),i6n=require("node:net"),{InvalidArgumentError:Ej}=ao();function Aws(t){if(i6n.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:_j.from(r)}}if(i6n.isIPv6(t))return{type:4,buffer:o6n(t)};let e=_j.from(t,"utf8");if(e.length>255)throw new Ej("Domain name too long (max 255 bytes)");return{type:3,buffer:_j.concat([_j.from([e.length]),e])}}a(Aws,"parseAddress");function o6n(t){let e=_j.alloc(16),r=t.indexOf("::");if(r!==-1){let n=t.slice(0,r),o=t.slice(r+2),s=n===""?[]:n.split(":"),c=o===""?[]:o.split(":"),l=0;for(let u of s)e.writeUInt16BE(parseInt(u,16),l),l+=2;l=16-c.length*2;for(let u of c)e.writeUInt16BE(parseInt(u,16),l),l+=2}else{let n=t.split(":");for(let o=0;o{"use strict";p();var{EventEmitter:Cws}=require("node:events"),{Buffer:KJ}=require("node:buffer"),{InvalidArgumentError:Tke,Socks5ProxyError:Cj}=ao(),{debuglog:vws}=require("node:util"),{parseAddress:bws}=a6n(),EF=vws("undici:socks5"),c6n=KJ.alloc(0),Hit=5,dfe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},l6n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},JJ={IPV4:1,DOMAIN:3,IPV6:4},r5={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},cT={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},Cnr=class extends Cws{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new Tke("socket is required");this.socket=e,this.options=r,this.state=cT.INITIAL,this.buffer=c6n,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(dfe.USERNAME_PASSWORD),this.authMethods.push(dfe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){EF("received data",e.length,"bytes in state",this.state),this.buffer=KJ.concat([this.buffer,e]);try{switch(this.state){case cT.HANDSHAKING:this.handleHandshakeResponse();break;case cT.AUTHENTICATING:this.handleAuthResponse();break;case cT.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){EF("socket error",e),this.state=cT.ERROR,this.emit("error",e),this.destroy()}onClose(){EF("socket closed"),this.state=cT.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}handshake(){if(this.state!==cT.INITIAL)throw new Tke("Handshake already started");EF("starting handshake with",this.authMethods.length,"auth methods"),this.state=cT.HANDSHAKING;let e=KJ.alloc(2+this.authMethods.length);e[0]=Hit,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==Hit)throw new Cj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===dfe.NO_ACCEPTABLE)throw new Cj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),EF("server selected auth method",r),r===dfe.NO_AUTH)this.emit("authenticated");else if(r===dfe.USERNAME_PASSWORD)this.state=cT.AUTHENTICATING,this.sendAuthRequest();else throw new Cj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new Tke("Username and password required for authentication");EF("sending username/password auth");let n=KJ.from(e),o=KJ.from(r);if(n.length>255||o.length>255)throw new Tke("Username or password too long");let s=KJ.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new Cj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new Cj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),EF("authentication successful"),this.emit("authenticated")}connect(e,r){if(this.state===cT.CONNECTED)throw new Tke("Already connected");EF("connecting to",e,r),this.state=cT.CONNECTING;let n=this.buildConnectRequest(l6n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=bws(r),c=KJ.alloc(4+s.length+2);return c[0]=Hit,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==Hit)throw new Cj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===JJ.IPV4)o+=6;else if(n===JJ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===JJ.IPV6)o+=18;else throw new Cj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var Sws=require("node:net"),{URL:f6n}=require("node:url"),vnr,Tws=FJ(),{InvalidArgumentError:p6n}=ao(),{Socks5Client:Iws}=d6n(),{kDispatch:h6n,kClose:xws,kDestroy:wws}=nl(),Rws=VJ(),kws=UJ(),{debuglog:Pws}=require("node:util"),vj=Pws("undici:socks5-proxy"),bnr=Symbol("proxy url"),Dws=Symbol("proxy headers"),m6n=Symbol("proxy auth"),n5=Symbol("pool"),Nws=Symbol("connector"),g6n=!1,Snr=class extends Tws{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),g6n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),g6n=!0),!e)throw new p6n("Proxy URL is mandatory");let n=typeof e=="string"?new f6n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new p6n("Proxy URL must use socks5:// or socks:// protocol");this[bnr]=n,this[Dws]=r.headers||{},this[m6n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[Nws]=r.connect||kws({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[n5]=null}async createSocks5Connection(e,r){let n=this[bnr].hostname,o=parseInt(this[bnr].port)||1080;vj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{let d=a(()=>{h.removeListener("error",f),l(h)},"onConnect"),f=a(m=>{h.removeListener("connect",d),u(m)},"onError"),h=Sws.connect({host:n,port:o});h.once("connect",d),h.once("error",f)}),c=new Iws(s,this[m6n]);return c.on("error",l=>{vj("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state==="authenticated"?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{vj("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}async[h6n](e,r){let{origin:n}=e;vj("dispatching request to",n,"via SOCKS5");try{return(!this[n5]||this[n5].destroyed||this[n5].closed)&&(this[n5]=new Rws(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(o,s)=>{try{let c=new f6n(n),l=c.hostname,u=parseInt(c.port)||(c.protocol==="https:"?443:80);vj("establishing SOCKS5 connection to",l,u);let d=await this.createSocks5Connection(l,u),f=d;c.protocol==="https:"&&(vnr||(vnr=require("node:tls")),vj("upgrading to TLS"),f=vnr.connect({socket:d,servername:l,...o.tls||{}}),await new Promise((h,m)=>{f.once("secureConnect",h),f.once("error",m)})),s(null,f)}catch(c){vj("SOCKS5 connection error:",c),s(c)}},"connect")})),this[n5][h6n](e,r)}catch(o){if(vj("dispatch error:",o),typeof r.onError=="function")r.onError(o);else throw o}}async[xws](){this[n5]&&await this[n5].close()}async[wws](e){this[n5]&&await this[n5].destroy(e)}};A6n.exports=Snr});var Rnr=I((ktf,R6n)=>{"use strict";p();var{kProxy:ffe,kClose:S6n,kDestroy:T6n,kDispatch:y6n}=nl(),Mws=YJ(),I6n=VJ(),x6n=FJ(),{InvalidArgumentError:ZJ,RequestAbortedError:Ows,SecureProxyConnectionError:Bws}=ao(),E6n=UJ(),w6n=yj(),{channels:_6n}=cj(),Lws=Tnr(),Git=Symbol("proxy agent"),bj=Symbol("proxy client"),_F=Symbol("proxy headers"),Inr=Symbol("request tls settings"),C6n=Symbol("proxy tls settings"),v6n=Symbol("connect endpoint function"),b6n=Symbol("tunnel proxy");function Fws(t){return t==="https:"?443:80}a(Fws,"defaultProtocolPort");function Uws(t,e){return new I6n(t,e)}a(Uws,"defaultFactory");var Qws=a(()=>{},"noop");function qws(t,e){return e.connections===1?new w6n(t,e):new I6n(t,e)}a(qws,"defaultAgentFactory");var xnr=class extends x6n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new ZJ("Proxy URL is mandatory");super(),this[_F]=r,o?this.#e=o(e,{connect:n}):this.#e=new w6n(e,{connect:n})}[y6n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new ZJ("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[_F],...c},this.#e[y6n](e,r)}[S6n](){return this.#e.close()}[T6n](e){return this.#e.destroy(e)}},wnr=class extends x6n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new ZJ("Proxy uri is mandatory");let{clientFactory:r=Uws}=e;if(typeof r!="function")throw new ZJ("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[ffe]={uri:s,protocol:u},this[Inr]=e.requestTls,this[C6n]=e.proxyTls,this[_F]=e.headers||{},this[b6n]=n,e.auth&&e.token)throw new ZJ("opts.auth cannot be used in combination with opts.token");e.auth?this[_F]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[_F]["proxy-authorization"]=e.token:d&&f&&(this[_F]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=E6n({...e.proxyTls});this[v6n]=E6n({...e.requestTls});let g=e.factory||qws,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[ffe].protocol==="socks5:"||this[ffe].protocol==="socks:"?new Lws(this[ffe].uri,{headers:this[_F],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls}):!this[b6n]&&_==="http:"&&this[ffe].protocol==="http:"?new xnr(this[ffe].uri,{headers:this[_F],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[bj]=null:this[bj]=r(o,{connect:m}),this[Git]=new Mws({...e,factory:A,connect:a(async(y,E)=>{if(!this[bj]){E(new ZJ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${Fws(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[_F],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[C6n]?.servername||h},{socket:b,statusCode:T}=await this[bj].connect(v);if(T!==200){b.on("error",Qws).destroy(),E(new Ows(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(_6n.proxyConnected.hasSubscribers&&_6n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Inr]?w=this[Inr].servername:w=y.servername,this[v6n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Bws(v)):E(v)}},"connect")})}dispatch(e,r){let n=jws(e.headers);if(Hws(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Git].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[S6n](){let e=[this[Git].close()];return this[bj]&&e.push(this[bj].close()),Promise.all(e)}[T6n](){let e=[this[Git].destroy()];return this[bj]&&e.push(this[bj].destroy()),Promise.all(e)}};function jws(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new ZJ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(Hws,"throwIfProxyAuthIsSent");R6n.exports=wnr});var M6n=I((Ntf,N6n)=>{"use strict";p();var Gws=FJ(),{kClose:$ws,kDestroy:Vws,kClosed:k6n,kDestroyed:P6n,kDispatch:Wws,kNoProxyAgent:Ike,kHttpProxyAgent:Sj,kHttpsProxyAgent:XJ}=nl(),D6n=Rnr(),zws=YJ(),Yws={"http:":80,"https:":443},knr=class extends Gws{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[Ike]=new zws(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[Sj]=new D6n({...s,uri:c}):this[Sj]=this[Ike];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[XJ]=new D6n({...s,uri:l}):this[XJ]=this[Sj],this.#o()}[Wws](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[$ws](){return Promise.all([this[Ike].close(),!this[Sj][k6n]&&this[Sj].close(),!this[XJ][k6n]&&this[XJ].close()])}[Vws](e){return Promise.all([this[Ike].destroy(e),!this[Sj][P6n]&&this[Sj].destroy(e),!this[XJ][P6n]&&this[XJ].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Yws[r]||0,this.#i(n,o)?r==="https:"?this[XJ]:this[Sj]:this[Ike]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var pfe=require("node:assert"),{kRetryHandlerDefaultRetry:O6n}=nl(),{RequestRetryError:xke}=ao(),Kws=YRe(),{isDisturbed:B6n,parseRangeHeader:L6n,wrapRequestBody:Jws}=Do();function Zws(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(Zws,"calculateRetryAfterHeader");var Pnr=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=Kws.wrap(n),this.opts={...s,body:Jws(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[O6n],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(B6n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[O6n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?Zws(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new xke("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new xke("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=L6n(n["content-range"]);if(!s)throw new xke("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new xke("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;pfe(this.start===c,"content-range mismatch"),pfe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=L6n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;pfe(c!=null&&Number.isFinite(c),"content-range mismatch"),pfe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}pfe(Number.isFinite(this.start)),pfe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new xke("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||B6n(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};F6n.exports=Pnr});var Q6n=I((Utf,U6n)=>{"use strict";p();var Xws=KRe(),eRs=$it(),Dnr=class extends Xws{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new eRs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};U6n.exports=Dnr});var H6n=I((jtf,j6n)=>{"use strict";p();var{InvalidArgumentError:q6n}=ao(),tRs=yj(),Nnr=class extends tRs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new q6n("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new q6n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};j6n.exports=Nnr});var Z6n=I(($tf,J6n)=>{"use strict";p();var W6n=require("node:assert"),{Readable:rRs}=require("node:stream"),{RequestAbortedError:z6n,NotSupportedError:nRs,InvalidArgumentError:iRs,AbortError:Vit}=ao(),Y6n=Do(),{ReadableStreamFrom:oRs}=Do(),lT=Symbol("kConsume"),Wit=Symbol("kReading"),eZ=Symbol("kBody"),G6n=Symbol("kAbort"),K6n=Symbol("kContentType"),Mnr=Symbol("kContentLength"),Onr=Symbol("kUsed"),zit=Symbol("kBytesRead"),sRs=a(()=>{},"noop"),Bnr=class extends rRs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[G6n]=r,this[lT]=null,this[zit]=0,this[eZ]=null,this[Onr]=!1,this[K6n]=n,this[Mnr]=Number.isFinite(o)?o:null,this[Wit]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new z6n),e&&this[G6n](),this[Onr]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[Wit]=!0,this[Onr]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[Wit]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[zit]+=e.length,this[lT])?(Fnr(this[lT],e),this[Wit]?super.push(e):!0):super.push(e)}text(){return wke(this,"text")}json(){return wke(this,"json")}blob(){return wke(this,"blob")}bytes(){return wke(this,"bytes")}arrayBuffer(){return wke(this,"arrayBuffer")}async formData(){throw new nRs}get bodyUsed(){return Y6n.isDisturbed(this)}get body(){return this[eZ]||(this[eZ]=oRs(this),this[lT]&&(this[eZ].getReader(),W6n(this[eZ].locked))),this[eZ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new iRs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new Vit):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Mnr]&&this[Mnr]>n||this[zit]>n)&&this.destroy(new Vit),r){let c=a(()=>{this.destroy(r.reason??new Vit)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Vit):o(null)})}else this.on("close",o);this.on("error",sRs).on("data",()=>{this[zit]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function aRs(t){return t[eZ]?.locked===!0||t[lT]!==null}a(aRs,"isLocked");function cRs(t){return Y6n.isDisturbed(t)||aRs(t)}a(cRs,"isUnusable");function wke(t,e){return W6n(!t[lT]),new Promise((r,n)=>{if(cRs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[lT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){Unr(this[lT],o)}).on("close",function(){this[lT].body!==null&&Unr(this[lT],new z6n)}),lRs(t[lT])})})}a(wke,"consume");function lRs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(Lnr,"chunksDecode");function $6n(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var uRs=require("node:assert"),{AsyncResource:dRs}=require("node:async_hooks"),{Readable:fRs}=Z6n(),{InvalidArgumentError:hfe,RequestAbortedError:X6n}=ao(),_w=Do();function Rke(){}a(Rke,"noop");var Yit=class extends dRs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new hfe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new hfe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new hfe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new hfe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new hfe("invalid method");if(l&&typeof l!="function")throw new hfe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw _w.isStream(c)&&_w.destroy(c.on("error",Rke),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new X6n:n&&(this.removeAbortListener=_w.addAbortListener(n,()=>{this.reason=n.reason??new X6n,this.res?_w.destroy(this.res.on("error",Rke),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}uRs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?_w.parseRawHeaders(r):_w.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?_w.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new fRs({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(E){this.res=null,_w.destroy(y.on("error",Rke),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){_w.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{_w.destroy(r.on("error",Rke),e)})),o&&(this.body=null,_w.isStream(o)&&(o.on("error",Rke),_w.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function e9n(t,e){if(e===void 0)return new Promise((r,n)=>{e9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Yit(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(e9n,"request");Qnr.exports=e9n;Qnr.exports.RequestHandler=Yit});var kke=I((Jtf,i9n)=>{"use strict";p();var{addAbortListener:pRs}=Do(),{RequestAbortedError:hRs}=ao(),mfe=Symbol("kListener"),i5=Symbol("kSignal");function r9n(t){t.abort?t.abort(t[i5]?.reason):t.reason=t[i5]?.reason??new hRs,n9n(t)}a(r9n,"abort");function mRs(t,e){if(t.reason=null,t[i5]=null,t[mfe]=null,!!e){if(e.aborted){r9n(t);return}t[i5]=e,t[mfe]=()=>{r9n(t)},pRs(t[i5],t[mfe])}}a(mRs,"addSignal");function n9n(t){t[i5]&&("removeEventListener"in t[i5]?t[i5].removeEventListener("abort",t[mfe]):t[i5].removeListener("abort",t[mfe]),t[i5]=null,t[mfe]=null)}a(n9n,"removeSignal");i9n.exports={addSignal:mRs,removeSignal:n9n}});var c9n=I((erf,a9n)=>{"use strict";p();var gRs=require("node:assert"),{finished:ARs}=require("node:stream"),{AsyncResource:yRs}=require("node:async_hooks"),{InvalidArgumentError:gfe,InvalidReturnValueError:ERs}=ao(),CF=Do(),{addSignal:_Rs,removeSignal:o9n}=kke();function CRs(){}a(CRs,"noop");var qnr=class extends yRs{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new gfe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new gfe("invalid callback");if(typeof r!="function")throw new gfe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new gfe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new gfe("invalid method");if(u&&typeof u!="function")throw new gfe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw CF.isStream(l)&&CF.destroy(l.on("error",CRs),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,CF.isStream(l)&&l.on("error",f=>{this.onError(f)}),_Rs(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}gRs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?CF.parseRawHeaders(r):CF.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new ERs("expected Writable");return ARs(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&CF.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;o9n(this),r&&(this.trailers=CF.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;o9n(this),this.factory=null,r?(this.res=null,CF.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,CF.destroy(s,e))}};function s9n(t,e,r){if(r===void 0)return new Promise((n,o)=>{s9n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new qnr(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(s9n,"stream");a9n.exports=s9n});var f9n=I((nrf,d9n)=>{"use strict";p();var{Readable:u9n,Duplex:vRs,PassThrough:bRs}=require("node:stream"),SRs=require("node:assert"),{AsyncResource:TRs}=require("node:async_hooks"),{InvalidArgumentError:Pke,InvalidReturnValueError:IRs,RequestAbortedError:jnr}=ao(),s5=Do(),{addSignal:xRs,removeSignal:wRs}=kke();function l9n(){}a(l9n,"noop");var Afe=Symbol("resume"),Hnr=class extends u9n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[Afe]=null}_read(){let{[Afe]:e}=this;e&&(this[Afe]=null,e())}_destroy(e,r){this._read(),r(e)}},Gnr=class extends u9n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[Afe]=e}_read(){this[Afe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new jnr),r(e)}},$nr=class extends TRs{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Pke("invalid opts");if(typeof r!="function")throw new Pke("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Pke("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new Pke("invalid method");if(c&&typeof c!="function")throw new Pke("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Hnr().on("error",l9n),this.ret=new vRs({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[Afe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new jnr),A&&u&&A(),s5.destroy(f,u),s5.destroy(h,u),s5.destroy(m,u),wRs(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,xRs(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}SRs(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?s5.parseRawHeaders(r):s5.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Gnr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?s5.parseRawHeaders(r):s5.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",l9n),u}if(!l||typeof l.on!="function")throw new IRs("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;s5.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||s5.destroy(u,new jnr)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,s5.destroy(r,e)}};function RRs(t,e){try{let r=new $nr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new bRs().destroy(r)}}a(RRs,"pipeline");d9n.exports=RRs});var y9n=I((srf,A9n)=>{"use strict";p();var{InvalidArgumentError:Vnr,SocketError:kRs}=ao(),{AsyncResource:PRs}=require("node:async_hooks"),p9n=require("node:assert"),h9n=Do(),{kHTTP2Stream:DRs}=nl(),{addSignal:NRs,removeSignal:m9n}=kke(),Wnr=class extends PRs{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Vnr("invalid opts");if(typeof r!="function")throw new Vnr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Vnr("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,NRs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}p9n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new kRs("bad upgrade",null)}onUpgrade(e,r,n){p9n(n[DRs]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;m9n(this),this.callback=null;let l=this.responseHeaders==="raw"?h9n.parseRawHeaders(r):h9n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;m9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function g9n(t,e){if(e===void 0)return new Promise((r,n)=>{g9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Wnr(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(g9n,"upgrade");A9n.exports=g9n});var b9n=I((lrf,v9n)=>{"use strict";p();var MRs=require("node:assert"),{AsyncResource:ORs}=require("node:async_hooks"),{InvalidArgumentError:znr,SocketError:BRs}=ao(),E9n=Do(),{addSignal:LRs,removeSignal:_9n}=kke(),Ynr=class extends ORs{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new znr("invalid opts");if(typeof r!="function")throw new znr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new znr("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,LRs(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}MRs(this.callback),this.abort=e,this.context=r}onHeaders(){throw new BRs("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;_9n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?E9n.parseRawHeaders(r):E9n.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;_9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function C9n(t,e){if(e===void 0)return new Promise((r,n)=>{C9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Ynr(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(C9n,"connect");v9n.exports=C9n});var S9n=I((frf,yfe)=>{"use strict";p();yfe.exports.request=t9n();yfe.exports.stream=c9n();yfe.exports.pipeline=f9n();yfe.exports.upgrade=y9n();yfe.exports.connect=b9n()});var Jnr=I((hrf,I9n)=>{"use strict";p();var{UndiciError:FRs}=ao(),T9n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),Knr=class extends FRs{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[T9n]===!0}get[T9n](){return!0}};I9n.exports={MockNotMatchedError:Knr}});var tZ=I((Arf,x9n)=>{"use strict";p();x9n.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var Dke=I((Erf,F9n)=>{"use strict";p();var{MockNotMatchedError:Efe}=Jnr(),{kDispatches:rZ,kMockAgent:URs,kOriginalDispatch:QRs,kOrigin:qRs,kGetNetConnect:jRs,kTotalDispatchCount:eir}=tZ(),{serializePathWithQuery:HRs}=Do(),{STATUS_CODES:GRs}=require("node:http"),{types:{isPromise:$Rs}}=require("node:util"),{InvalidArgumentError:Znr}=ao();function c5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(c5,"matchValue");function R9n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(R9n,"lowerCaseEntries");function k9n(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=k9n(e,r);if(!c5(n,o))return!1}return!0}a(P9n,"matchHeaders");function VRs(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(VRs,"normalizeSearchParams");function Xnr(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(Xnr,"safeUrl");function WRs(t,{path:e,method:r,body:n,headers:o}){let s=c5(t.path,e),c=c5(t.method,r),l=typeof t.body<"u"?c5(t.body,n):!0,u=P9n(t,o);return s&&c&&l&&u}a(WRs,"matchKey");function D9n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(D9n,"getResponseData");function N9n(t,e){let r=e.query?HRs(e.path,e.query):e.path,n=typeof r=="string"?Xnr(r):r,o=w9n(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?c5(w9n(Xnr(c)),o):c5(Xnr(c),n));if(s.length===0)throw new Efe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>c5(c,e.method)),s.length===0)throw new Efe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?c5(c,e.body):!0),s.length===0)throw new Efe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>P9n(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new Efe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(N9n,"getMockDispatch");function zRs(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[eir]=(t[eir]||0)+1,c}a(zRs,"addMockDispatch");function tir(t,e){let r=t.findIndex(n=>n.consumed?WRs(n,e):!1);r!==-1&&t.splice(r,1)}a(tir,"deleteMockDispatch");function w9n(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(w9n,"removeTrailingSlash");function M9n(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(M9n,"buildKey");function rir(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[rZ])},d):E(this[rZ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?nir(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if($Rs(w))return w.then(D=>E(v,D));if(g)return;let R=D9n(w),x=rir(c),k=rir(l);e.onHeaders?.(o,x,_,O9n(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(k),tir(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(B9n,"mockDispatch");function KRs(){let t=this[URs],e=this[qRs],r=this[QRs];return a(function(o,s){if(t.isMockActive)try{B9n.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[jRs](),u=this[rZ][eir]||this[rZ].length,f=`, ${this[rZ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new Efe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(L9n(l,e))r.call(this,o,s);else throw new Efe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(KRs,"buildMockDispatch");function L9n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>c5(n,r.host)))}a(L9n,"checkNetConnect");function JRs(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(JRs,"normalizeOrigin");function ZRs(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new Znr("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new Znr("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new Znr("options.ignoreTrailingSlash must to be a boolean");return r}a(ZRs,"buildAndValidateMockOptions");F9n.exports={getResponseData:D9n,getMockDispatch:N9n,addMockDispatch:zRs,deleteMockDispatch:tir,buildKey:M9n,generateKeyValues:rir,matchValue:c5,getResponse:YRs,getStatusText:O9n,mockDispatch:B9n,buildMockDispatch:KRs,checkNetConnect:L9n,buildAndValidateMockOptions:ZRs,getHeaderByName:k9n,buildHeadersFromArray:nir,normalizeSearchParams:VRs,normalizeOrigin:JRs}});var uir=I((vrf,lir)=>{"use strict";p();var{getResponseData:XRs,buildKey:eks,addMockDispatch:iir}=Dke(),{kDispatches:Kit,kDispatchKey:Jit,kDefaultHeaders:oir,kDefaultTrailers:sir,kContentLength:air,kMockDispatch:Zit,kIgnoreTrailingSlash:Xit}=tZ(),{InvalidArgumentError:l5}=ao(),{serializePathWithQuery:tks}=Do(),_fe=class{static{a(this,"MockScope")}constructor(e){this[Zit]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("waitInMs must be a valid integer > 0");return this[Zit].delay=e,this}persist(){return this[Zit].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new l5("repeatTimes must be a valid integer > 0");return this[Zit].times=e,this}},cir=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new l5("opts must be an object");if(typeof e.path>"u")throw new l5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=tks(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[Jit]=eks(e),this[Kit]=r,this[Xit]=e.ignoreTrailingSlash??!1,this[oir]={},this[sir]={},this[air]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=XRs(r),s=this[air]?{"content-length":o.length}:{},c={...this[oir],...s,...n.headers},l={...this[sir],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new l5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new l5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new l5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=iir(this[Kit],this[Jit],s,{ignoreTrailingSlash:this[Xit]});return new _fe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=iir(this[Kit],this[Jit],n,{ignoreTrailingSlash:this[Xit]});return new _fe(o)}replyWithError(e){if(typeof e>"u")throw new l5("error must be defined");let r=iir(this[Kit],this[Jit],{error:e},{ignoreTrailingSlash:this[Xit]});return new _fe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new l5("headers must be defined");return this[oir]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new l5("trailers must be defined");return this[sir]=e,this}replyContentLength(){return this[air]=!0,this}};lir.exports.MockInterceptor=cir;lir.exports.MockScope=_fe});var hir=I((Trf,$9n)=>{"use strict";p();var{promisify:rks}=require("node:util"),nks=yj(),{buildMockDispatch:iks}=Dke(),{kDispatches:dir,kMockAgent:U9n,kClose:Q9n,kOriginalClose:q9n,kOrigin:j9n,kOriginalDispatch:oks,kConnected:fir,kIgnoreTrailingSlash:H9n}=tZ(),{MockInterceptor:sks}=uir(),G9n=nl(),{InvalidArgumentError:aks}=ao(),pir=class extends nks{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new aks("Argument opts.agent must implement Agent");super(e,r),this[U9n]=r.agent,this[j9n]=e,this[H9n]=r.ignoreTrailingSlash??!1,this[dir]=[],this[fir]=1,this[oks]=this.dispatch,this[q9n]=this.close.bind(this),this.dispatch=iks.call(this),this.close=this[Q9n]}get[G9n.kConnected](){return this[fir]}intercept(e){return new sks(e&&{ignoreTrailingSlash:this[H9n],...e},this[dir])}cleanMocks(){this[dir]=[]}async[Q9n](){await rks(this[q9n])(),this[fir]=0,this[U9n][G9n.kClients].delete(this[j9n])}};$9n.exports=pir});var Air=I((wrf,gir)=>{"use strict";p();var{kMockCallHistoryAddLog:cks}=tZ(),{InvalidArgumentError:xj}=ao();function Tj(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new xj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Tj,"handleFilterCallsWithOptions");function lks(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new xj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(lks,"buildAndValidateFilterCallsOptions");function Ij(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new xj(`${t} parameter should be one of string, regexp, undefined or null`)}}a(Ij,"makeFilterCalls");function uks(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new xj("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(uks,"computeUrlWithMaybeSearchParameters");var eot=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=uks(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},mir=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new xj("nthCall must be called with a number");if(!Number.isInteger(e))throw new xj("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new xj("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...lks(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Tj(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Tj(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Tj(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Tj(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Tj(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Tj(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Tj(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Tj(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new xj("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=Ij.call(this,"protocol");filterCallsByHost=Ij.call(this,"host");filterCallsByPort=Ij.call(this,"port");filterCallsByOrigin=Ij.call(this,"origin");filterCallsByPath=Ij.call(this,"path");filterCallsByHash=Ij.call(this,"hash");filterCallsByFullUrl=Ij.call(this,"fullUrl");filterCallsByMethod=Ij.call(this,"method");clear(){this.logs=[]}[cks](e){let r=new eot(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};gir.exports.MockCallHistory=mir;gir.exports.MockCallHistoryLog=eot});var Cir=I((Prf,Z9n)=>{"use strict";p();var{promisify:dks}=require("node:util"),fks=VJ(),{buildMockDispatch:pks}=Dke(),{kDispatches:yir,kMockAgent:V9n,kClose:W9n,kOriginalClose:z9n,kOrigin:Y9n,kOriginalDispatch:hks,kConnected:Eir,kIgnoreTrailingSlash:K9n}=tZ(),{MockInterceptor:mks}=uir(),J9n=nl(),{InvalidArgumentError:gks}=ao(),_ir=class extends fks{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new gks("Argument opts.agent must implement Agent");super(e,r),this[V9n]=r.agent,this[Y9n]=e,this[K9n]=r.ignoreTrailingSlash??!1,this[yir]=[],this[Eir]=1,this[hks]=this.dispatch,this[z9n]=this.close.bind(this),this.dispatch=pks.call(this),this.close=this[W9n]}get[J9n.kConnected](){return this[Eir]}intercept(e){return new mks(e&&{ignoreTrailingSlash:this[K9n],...e},this[yir])}cleanMocks(){this[yir]=[]}async[W9n](){await dks(this[z9n])(),this[Eir]=0,this[V9n][J9n.kClients].delete(this[Y9n])}};Z9n.exports=_ir});var eUn=I((Orf,X9n)=>{"use strict";p();var{Transform:Aks}=require("node:stream"),{Console:yks}=require("node:console"),Eks=process.versions.icu?"\u2705":"Y ",_ks=process.versions.icu?"\u274C":"N ";X9n.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new Aks({transform(r,n,o){o(null,r)}}),this.logger=new yks({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?Eks:_ks,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Iir=I((Frf,aUn)=>{"use strict";p();var{kClients:nZ}=nl(),Cks=YJ(),{kAgent:vir,kMockAgentSet:tot,kMockAgentGet:tUn,kDispatches:bir,kIsMockActive:rot,kNetConnect:iZ,kGetNetConnect:vks,kOptions:not,kFactory:iot,kMockAgentRegisterCallHistory:Sir,kMockAgentIsCallHistoryEnabled:Nke,kMockAgentAddCallHistoryLog:rUn,kMockAgentMockCallHistoryInstance:Cfe,kMockAgentAcceptsNonStandardSearchParameters:nUn,kMockCallHistoryAddLog:bks,kIgnoreTrailingSlash:iUn}=tZ(),Sks=hir(),Tks=Cir(),{matchValue:Iks,normalizeSearchParams:xks,buildAndValidateMockOptions:wks,normalizeOrigin:oUn}=Dke(),{InvalidArgumentError:sUn,UndiciError:Rks}=ao(),kks=KRe(),Pks=eUn(),{MockCallHistory:Dks}=Air(),Tir=class extends kks{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=wks(e);if(this[iZ]=!0,this[rot]=!0,this[Nke]=r.enableCallHistory??!1,this[nUn]=r.acceptNonStandardSearchParameters??!1,this[iUn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new sUn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new Cks(e);this[vir]=n,this[nZ]=n[nZ],this[not]=r,this[Nke]&&this[Sir]()}get(e){let r=oUn(e),n=this[iUn]?r.replace(/\/$/,""):r,o=this[tUn](n);return o||(o=this[iot](n),this[tot](n,o)),o}dispatch(e,r){e.origin=oUn(e.origin),this.get(e.origin),this[rUn](e);let n=this[nUn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=xks(c,n);o.path=`${s}?${l}`}return this[vir].dispatch(o,r)}async close(){this.clearCallHistory(),await this[vir].close(),this[nZ].clear()}deactivate(){this[rot]=!1}activate(){this[rot]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[iZ])?this[iZ].push(e):this[iZ]=[e];else if(typeof e>"u")this[iZ]=!0;else throw new sUn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[iZ]=!1}enableCallHistory(){return this[Nke]=!0,this}disableCallHistory(){return this[Nke]=!1,this}getCallHistory(){return this[Cfe]}clearCallHistory(){this[Cfe]!==void 0&&this[Cfe].clear()}get isMockActive(){return this[rot]}[Sir](){this[Cfe]===void 0&&(this[Cfe]=new Dks)}[rUn](e){this[Nke]&&(this[Sir](),this[Cfe][bks](e))}[tot](e,r){this[nZ].set(e,{count:0,dispatcher:r})}[iot](e){let r=Object.assign({agent:this},this[not]);return this[not]&&this[not].connections===1?new Sks(e,r):new Tks(e,r)}[tUn](e){let r=this[nZ].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[iot]("http://localhost:9999");return this[tot](e,n),n}for(let[n,o]of Array.from(this[nZ]))if(o&&typeof n!="string"&&Iks(n,e)){let s=this[iot](e);return this[tot](e,s),s[bir]=o.dispatcher[bir],s}}[vks](){return this[iZ]}pendingInterceptors(){let e=this[nZ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[bir].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new Pks}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new Rks(r.length===1?`1 interceptor is pending: +`,"latin1"),r!==null&&o!==r){if(n[Wrr])throw new OJ;process.emitWarning(new OJ)}e[lp].timeout&&e[lp].timeoutType===nfe&&e[lp].timeout.refresh&&e[lp].timeout.refresh(),n[oj]()}}destroy(e){let{socket:r,client:n,abort:o}=this;r[sj]=!1,e&&(Di(n[sE]<=1,"pipeline should only contain this request"),o(e))}};p8n.exports=zSs});var b8n=I((xZd,C8n)=>{"use strict";p();var gw=require("node:assert"),{pipeline:oTs}=require("node:stream"),ds=ko(),{RequestContentLengthMismatchError:enr,RequestAbortedError:sTs,SocketError:ZRe,InformationalError:aj,InvalidArgumentError:aTs}=ao(),{kUrl:JRe,kReset:Sit,kClient:eT,kRunning:XRe,kPending:cTs,kQueue:cj,kPendingIdx:rnr,kRunningIdx:Yk,kError:tT,kSocket:gf,kStrictContentLength:lTs,kOnError:ife,kMaxConcurrentStreams:Cit,kPingInterval:m8n,kHTTP2Session:lF,kHTTP2InitialWindowSize:uTs,kHTTP2ConnectionWindowSize:dTs,kResume:zO,kSize:fTs,kHTTPContext:nnr,kClosed:tnr,kBodyTimeout:pTs,kEnableConnectProtocol:YRe,kRemoteSettings:KRe,kHTTP2Stream:vit,kHTTP2SessionState:inr}=tl(),{channels:g8n}=rj(),mw=Symbol("open streams"),A8n,bit;try{bit=require("node:http2")}catch{bit={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:hTs,HTTP2_HEADER_METHOD:y8n,HTTP2_HEADER_PATH:E8n,HTTP2_HEADER_SCHEME:Jrr,HTTP2_HEADER_CONTENT_LENGTH:mTs,HTTP2_HEADER_EXPECT:gTs,HTTP2_HEADER_STATUS:Zrr,HTTP2_HEADER_PROTOCOL:ATs,NGHTTP2_REFUSED_STREAM:yTs,NGHTTP2_CANCEL:ETs}}=bit;function Xrr(t){let e=[];for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.push(Buffer.from(r),Buffer.from(o));else e.push(Buffer.from(r),Buffer.from(n));return e}a(Xrr,"parseH2Headers");function _Ts(t,e){t[gf]=e;let r=t[uTs],n=t[dTs],o=bit.connect(t[JRe],{createConnection:a(()=>e,"createConnection"),peerMaxConcurrentStreams:t[Cit],settings:{enablePush:!1,...r!=null?{initialWindowSize:r}:null}});return t[gf]=e,o[mw]=0,o[eT]=t,o[gf]=e,o[inr]={ping:{interval:t[m8n]===0?null:setInterval(STs,t[m8n],o).unref()}},o[YRe]=!1,o[KRe]=!1,n&&ds.addListener(o,"connect",CTs.bind(o,n)),ds.addListener(o,"error",TTs),ds.addListener(o,"frameError",ITs),ds.addListener(o,"end",xTs),ds.addListener(o,"goaway",wTs),ds.addListener(o,"close",RTs),ds.addListener(o,"remoteSettings",bTs),o.unref(),t[lF]=o,e[lF]=o,ds.addListener(e,"error",kTs),ds.addListener(e,"end",DTs),ds.addListener(e,"close",PTs),e[tnr]=!1,e.on("close",NTs),{version:"h2",defaultPipelining:1/0,write(s){return OTs(t,s)},resume(){vTs(t)},destroy(s,c){e[tnr]?queueMicrotask(c):e.destroy(s).on("close",c)},get destroyed(){return e.destroyed},busy(s){if(s!=null)if(t[XRe]>0){if(s.idempotent===!1||(s.upgrade==="websocket"||s.method==="CONNECT")&&o[KRe]===!1||ds.bodyLength(s.body)!==0&&(ds.isStream(s.body)||ds.isAsyncIterable(s.body)||ds.isFormDataLike(s.body)))return!0}else return(s.upgrade==="websocket"||s.method==="CONNECT")&&o[KRe]===!1;return!1}}}a(_Ts,"connectH2");function vTs(t){let e=t[gf];e?.destroyed===!1&&(t[fTs]===0||t[Cit]===0?(e.unref(),t[lF].unref()):(e.ref(),t[lF].ref()))}a(vTs,"resumeH2");function CTs(t){try{typeof this.setLocalWindowSize=="function"&&this.setLocalWindowSize(t)}catch{}}a(CTs,"applyConnectionWindowSize");function bTs(t){if(this[eT][Cit]=t.maxConcurrentStreams??this[eT][Cit],this[KRe]===!0&&this[YRe]===!0&&t.enableConnectProtocol===!1){let e=new aj("HTTP/2: Server disabled extended CONNECT protocol against RFC-8441");this[gf][tT]=e,this[eT][ife](e);return}this[YRe]=t.enableConnectProtocol??this[YRe],this[KRe]=!0,this[eT][zO]()}a(bTs,"onHttp2RemoteSettings");function STs(t){let e=t[inr];if((t.closed||t.destroyed)&&e.ping.interval!=null){clearInterval(e.ping.interval),e.ping.interval=null;return}t.ping(r.bind(t));function r(n,o){let s=this[eT],c=this[eT];if(n!=null){let l=new aj(`HTTP/2: "PING" errored - type ${n.message}`);c[tT]=l,s[ife](l)}else s.emit("ping",o)}a(r,"onPing")}a(STs,"onHttp2SendPing");function TTs(t){gw(t.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[gf][tT]=t,this[eT][ife](t)}a(TTs,"onHttp2SessionError");function ITs(t,e,r){if(r===0){let n=new aj(`HTTP/2: "frameError" received - type ${t}, code ${e}`);this[gf][tT]=n,this[eT][ife](n)}}a(ITs,"onHttp2FrameError");function xTs(){let t=new ZRe("other side closed",ds.getSocketInfo(this[gf]));this.destroy(t),ds.destroy(this[gf],t)}a(xTs,"onHttp2SessionEnd");function wTs(t){let e=this[tT]||new ZRe(`HTTP/2: "GOAWAY" frame received with code ${t}`,ds.getSocketInfo(this[gf])),r=this[eT];if(r[gf]=null,r[nnr]=null,this.close(),this[lF]=null,ds.destroy(this[gf],e),r[Yk]{e.aborted||e.completed||(x=x||new sTs,ds.errorRequest(t,e,x),A!=null&&(A.removeAllListeners("data"),A.close(),t[ife](x),t[zO]()),ds.destroy(m,x))},"abort");try{e.onConnect(_)}catch(x){ds.errorRequest(t,e,x)}if(e.aborted)return!1;if(l||o==="CONNECT")return n.ref(),l==="websocket"?n[YRe]===!1?(ds.errorRequest(t,e,new aj("HTTP/2: Extended CONNECT protocol not supported by server")),n.unref(),!1):(g[y8n]="CONNECT",g[ATs]="websocket",g[E8n]=s,f==="ws:"||f==="wss:"?g[Jrr]=f==="ws:"?"http":"https":g[Jrr]=f==="http:"?"http":"https",A=n.request(g,{endStream:!1,signal:d}),A[vit]=!0,A.once("response",(x,P)=>{let{[Zrr]:D,...N}=x;e.onUpgrade(D,Xrr(N),A),++n[mw],t[cj][t[Yk]++]=null}),A.on("error",()=>{(A.rstCode===yTs||A.rstCode===ETs)&&_(new aj(`HTTP/2: "stream error" received - code ${A.rstCode}`))}),A.once("close",()=>{n[mw]-=1,n[mw]===0&&n.unref()}),A.setTimeout(r),!0):(A=n.request(g,{endStream:!1,signal:d}),A[vit]=!0,A.on("response",x=>{let{[Zrr]:P,...D}=x;e.onUpgrade(P,Xrr(D),A),++n[mw],t[cj][t[Yk]++]=null}),A.once("close",()=>{n[mw]-=1,n[mw]===0&&n.unref()}),A.setTimeout(r),!0);g[E8n]=s,g[Jrr]=f==="http:"?"http":"https";let v=o==="PUT"||o==="POST"||o==="PATCH";m&&typeof m.read=="function"&&m.read(0);let b=ds.bodyLength(m);if(ds.isFormDataLike(m)){A8n??=efe().extractBody;let[x,P]=A8n(m);g["content-type"]=P,m=x.stream,b=x.length}if(b==null&&(b=e.contentLength),v||(b=null),MTs(o)&&b>0&&e.contentLength!=null&&e.contentLength!==b){if(t[lTs])return ds.errorRequest(t,e,new enr),!1;process.emitWarning(new enr)}if(b!=null&&(gw(m||b===0,"no body must not have content length"),g[mTs]=`${b}`),n.ref(),g8n.sendHeaders.hasSubscribers){let x="";for(let P in g)x+=`${P}: ${g[P]}\r +`;g8n.sendHeaders.publish({request:e,headers:x,socket:n[gf]})}let T=o==="GET"||o==="HEAD"||m===null;u?(g[gTs]="100-continue",A=n.request(g,{endStream:T,signal:d}),A[vit]=!0,A.once("continue",R)):(A=n.request(g,{endStream:T,signal:d}),A[vit]=!0,R()),++n[mw],A.setTimeout(r);let w=!1;return A.once("response",x=>{let{[Zrr]:P,...D}=x;if(e.onResponseStarted(),w=!0,e.aborted){A.removeAllListeners("data");return}e.onHeaders(Number(P),Xrr(D),A.resume.bind(A),"")===!1&&A.pause(),A.on("data",N=>{e.aborted||e.completed||e.onData(N)===!1&&A.pause()})}),A.once("end",()=>{A.removeAllListeners("data"),w?(!e.aborted&&!e.completed&&e.onComplete({}),t[cj][t[Yk]++]=null,t[zO]()):(_(new aj("HTTP/2: stream half-closed (remote)")),t[cj][t[Yk]++]=null,t[rnr]=t[Yk],t[zO]())}),A.once("close",()=>{A.removeAllListeners("data"),n[mw]-=1,n[mw]===0&&n.unref()}),A.once("error",function(x){A.removeAllListeners("data"),_(x)}),A.once("frameError",(x,P)=>{A.removeAllListeners("data"),_(new aj(`HTTP/2: "frameError" received - type ${x}, code ${P}`))}),A.on("aborted",()=>{A.removeAllListeners("data")}),A.on("timeout",()=>{let x=new aj(`HTTP/2: "stream timeout after ${r}"`);A.removeAllListeners("data"),n[mw]-=1,n[mw]===0&&n.unref(),_(x)}),A.once("trailers",x=>{e.aborted||e.completed||(A.removeAllListeners("data"),e.onComplete(x))}),!0;function R(){!m||b===0?_8n(_,A,null,t,e,t[gf],b,v):ds.isBuffer(m)?_8n(_,A,m,t,e,t[gf],b,v):ds.isBlobLike(m)?typeof m.stream=="function"?v8n(_,A,m.stream(),t,e,t[gf],b,v):LTs(_,A,m,t,e,t[gf],b,v):ds.isStream(m)?BTs(_,t[gf],v,A,m,t,e,b):ds.isIterable(m)?v8n(_,A,m,t,e,t[gf],b,v):gw(!1)}a(R,"writeBodyH2")}a(OTs,"writeH2");function _8n(t,e,r,n,o,s,c,l){try{r!=null&&ds.isBuffer(r)&&(gw(c===r.byteLength,"buffer body must have content length"),e.cork(),e.write(r),e.uncork(),e.end(),o.onBodySent(r)),l||(s[Sit]=!0),o.onRequestSent(),n[zO]()}catch(u){t(u)}}a(_8n,"writeBuffer");function BTs(t,e,r,n,o,s,c,l){gw(l!==0||s[XRe]===0,"stream body cannot be pipelined");let u=oTs(o,n,f=>{f?(ds.destroy(u,f),t(f)):(ds.removeAllListeners(u),c.onRequestSent(),r||(e[Sit]=!0),s[zO]())});ds.addListener(u,"data",d);function d(f){c.onBodySent(f)}a(d,"onPipeData")}a(BTs,"writeStream");async function LTs(t,e,r,n,o,s,c,l){gw(c===r.size,"blob body must have content length");try{if(c!=null&&c!==r.size)throw new enr;let u=Buffer.from(await r.arrayBuffer());e.cork(),e.write(u),e.uncork(),e.end(),o.onBodySent(u),o.onRequestSent(),l||(s[Sit]=!0),n[zO]()}catch(u){t(u)}}a(LTs,"writeBlob");async function v8n(t,e,r,n,o,s,c,l){gw(c!==0||n[XRe]===0,"iterator body cannot be pipelined");let u=null;function d(){if(u){let h=u;u=null,h()}}a(d,"onDrain");let f=a(()=>new Promise((h,m)=>{gw(u===null),s[tT]?m(s[tT]):u=h}),"waitForDrain");e.on("close",d).on("drain",d);try{for await(let h of r){if(s[tT])throw s[tT];let m=e.write(h);o.onBodySent(h),m||await f()}e.end(),o.onRequestSent(),l||(s[Sit]=!0),n[zO]()}catch(h){t(h)}finally{e.off("close",d).off("drain",d)}}a(v8n,"writeIterable");C8n.exports=_Ts});var fj=I((PZd,k8n)=>{"use strict";p();var uF=require("node:assert"),x8n=require("node:net"),ePe=require("node:http"),BJ=ko(),{ClientStats:FTs}=Ztr(),{channels:ofe}=rj(),UTs=j3n(),QTs=PJ(),{InvalidArgumentError:nd,InformationalError:qTs,ClientDestroyedError:jTs}=ao(),HTs=kJ(),{kUrl:YO,kServerName:dj,kClient:GTs,kBusy:snr,kConnect:$Ts,kResuming:LJ,kRunning:iPe,kPending:oPe,kSize:tPe,kQueue:Kk,kConnected:VTs,kConnecting:sfe,kNeedDrain:uj,kKeepAliveDefaultTimeout:S8n,kHostHeader:WTs,kPendingIdx:Jk,kRunningIdx:fF,kError:zTs,kPipelining:Tit,kKeepAliveTimeoutValue:YTs,kMaxHeadersSize:KTs,kKeepAliveMaxTimeout:JTs,kKeepAliveTimeoutThreshold:ZTs,kHeadersTimeout:XTs,kBodyTimeout:eIs,kStrictContentLength:tIs,kConnector:rPe,kMaxRequests:anr,kCounter:rIs,kClose:nIs,kDestroy:iIs,kDispatch:oIs,kLocalAddress:nPe,kMaxResponseSize:sIs,kOnError:aIs,kHTTPContext:Xp,kMaxConcurrentStreams:cIs,kHTTP2InitialWindowSize:lIs,kHTTP2ConnectionWindowSize:uIs,kResume:dF,kPingInterval:dIs}=tl(),fIs=h8n(),pIs=b8n(),lj=Symbol("kClosedResolve"),hIs=ePe&&ePe.maxHeaderSize&&Number.isInteger(ePe.maxHeaderSize)&&ePe.maxHeaderSize>0?()=>ePe.maxHeaderSize:()=>{throw new nd("http module not available or http.maxHeaderSize invalid")},T8n=a(()=>{},"noop");function w8n(t){return t[Tit]??t[Xp]?.defaultPipelining??1}a(w8n,"getPipelining");var cnr=class extends QTs{static{a(this,"Client")}constructor(e,{maxHeaderSize:r,headersTimeout:n,socketTimeout:o,requestTimeout:s,connectTimeout:c,bodyTimeout:l,idleTimeout:u,keepAlive:d,keepAliveTimeout:f,maxKeepAliveTimeout:h,keepAliveMaxTimeout:m,keepAliveTimeoutThreshold:g,socketPath:A,pipelining:y,tls:E,strictContentLength:_,maxCachedSessions:v,connect:b,maxRequestsPerClient:T,localAddress:w,maxResponseSize:R,autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P,maxConcurrentStreams:D,allowH2:N,useH2c:B,initialWindowSize:L,connectionWindowSize:j,pingInterval:M}={}){if(d!==void 0)throw new nd("unsupported keepAlive, use pipelining=0 instead");if(o!==void 0)throw new nd("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");if(s!==void 0)throw new nd("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");if(u!==void 0)throw new nd("unsupported idleTimeout, use keepAliveTimeout instead");if(h!==void 0)throw new nd("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");if(r!=null){if(!Number.isInteger(r)||r<1)throw new nd("invalid maxHeaderSize")}else r=hIs();if(A!=null&&typeof A!="string")throw new nd("invalid socketPath");if(c!=null&&(!Number.isFinite(c)||c<0))throw new nd("invalid connectTimeout");if(f!=null&&(!Number.isFinite(f)||f<=0))throw new nd("invalid keepAliveTimeout");if(m!=null&&(!Number.isFinite(m)||m<=0))throw new nd("invalid keepAliveMaxTimeout");if(g!=null&&!Number.isFinite(g))throw new nd("invalid keepAliveTimeoutThreshold");if(n!=null&&(!Number.isInteger(n)||n<0))throw new nd("headersTimeout must be a positive integer or zero");if(l!=null&&(!Number.isInteger(l)||l<0))throw new nd("bodyTimeout must be a positive integer or zero");if(b!=null&&typeof b!="function"&&typeof b!="object")throw new nd("connect must be a function or an object");if(T!=null&&(!Number.isInteger(T)||T<0))throw new nd("maxRequestsPerClient must be a positive number");if(w!=null&&(typeof w!="string"||x8n.isIP(w)===0))throw new nd("localAddress must be valid string IP address");if(R!=null&&(!Number.isInteger(R)||R<-1))throw new nd("maxResponseSize must be a positive number");if(P!=null&&(!Number.isInteger(P)||P<-1))throw new nd("autoSelectFamilyAttemptTimeout must be a positive number");if(N!=null&&typeof N!="boolean")throw new nd("allowH2 must be a valid boolean value");if(D!=null&&(typeof D!="number"||D<1))throw new nd("maxConcurrentStreams must be a positive integer, greater than 0");if(B!=null&&typeof B!="boolean")throw new nd("useH2c must be a valid boolean value");if(L!=null&&(!Number.isInteger(L)||L<1))throw new nd("initialWindowSize must be a positive integer, greater than 0");if(j!=null&&(!Number.isInteger(j)||j<1))throw new nd("connectionWindowSize must be a positive integer, greater than 0");if(M!=null&&(typeof M!="number"||!Number.isInteger(M)||M<0))throw new nd("pingInterval must be a positive integer, greater or equal to 0");if(super(),typeof b!="function")b=HTs({...E,maxCachedSessions:v,allowH2:N,useH2c:B,socketPath:A,timeout:c,...typeof x=="boolean"?{autoSelectFamily:x,autoSelectFamilyAttemptTimeout:P}:void 0,...b});else{let O=b;b=a((q,Q)=>O({...q,...A!=null?{socketPath:A}:null,...N!=null?{allowH2:N}:null},Q),"connect")}this[YO]=BJ.parseOrigin(e),this[rPe]=b,this[Tit]=y??1,this[KTs]=r,this[S8n]=f??4e3,this[JTs]=m??6e5,this[ZTs]=g??2e3,this[YTs]=this[S8n],this[dj]=null,this[nPe]=w??null,this[LJ]=0,this[uj]=0,this[WTs]=`host: ${this[YO].hostname}${this[YO].port?`:${this[YO].port}`:""}\r +`,this[eIs]=l??3e5,this[XTs]=n??3e5,this[tIs]=_??!0,this[anr]=T,this[lj]=null,this[sIs]=R>-1?R:-1,this[Xp]=null,this[cIs]=D??100,this[lIs]=L??262144,this[uIs]=j??524288,this[dIs]=M??6e4,this[Kk]=[],this[fF]=0,this[Jk]=0,this[dF]=O=>lnr(this,O),this[aIs]=O=>R8n(this,O)}get pipelining(){return this[Tit]}set pipelining(e){this[Tit]=e,this[dF](!0)}get stats(){return new FTs(this)}get[oPe](){return this[Kk].length-this[Jk]}get[iPe](){return this[Jk]-this[fF]}get[tPe](){return this[Kk].length-this[fF]}get[VTs](){return!!this[Xp]&&!this[sfe]&&!this[Xp].destroyed}get[snr](){return!!(this[Xp]?.busy(null)||this[tPe]>=(w8n(this)||1)||this[oPe]>0)}[$Ts](e){P8n(this),this.once("connect",e)}[oIs](e,r){let n=new UTs(this[YO].origin,e,r);return this[Kk].push(n),this[LJ]||(BJ.bodyLength(n.body)==null&&BJ.isIterable(n.body)?(this[LJ]=1,queueMicrotask(()=>lnr(this))):this[dF](!0)),this[LJ]&&this[uj]!==2&&this[snr]&&(this[uj]=2),this[uj]<2}[nIs](){return new Promise(e=>{this[tPe]?this[lj]=e:e(null)})}[iIs](e){return new Promise(r=>{let n=this[Kk].splice(this[Jk]);for(let s=0;s{this[lj]&&(this[lj](),this[lj]=null),r(null)},"callback");this[Xp]?(this[Xp].destroy(e,o),this[Xp]=null):queueMicrotask(o),this[dF]()})}};function R8n(t,e){if(t[iPe]===0&&e.code!=="UND_ERR_INFO"&&e.code!=="UND_ERR_SOCKET"){uF(t[Jk]===t[fF]);let r=t[Kk].splice(t[fF]);for(let n=0;n{if(s){onr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[dF]();return}if(t.destroyed){BJ.destroy(c.on("error",T8n),new jTs),t[dF]();return}uF(c);try{t[Xp]=c.alpnProtocol==="h2"?pIs(t,c):fIs(t,c)}catch(l){c.destroy().on("error",T8n),onr(t,l,{host:e,hostname:r,protocol:n,port:o}),t[dF]();return}t[sfe]=!1,c[rIs]=0,c[anr]=t[anr],c[GTs]=t,c[zTs]=null,ofe.connected.hasSubscribers&&ofe.connected.publish({connectParams:{host:e,hostname:r,protocol:n,port:o,version:t[Xp]?.version,servername:t[dj],localAddress:t[nPe]},connector:t[rPe],socket:c}),t.emit("connect",t[YO],[t]),t[dF]()})}catch(s){onr(t,s,{host:e,hostname:r,protocol:n,port:o}),t[dF]()}}a(P8n,"connect");function onr(t,e,{host:r,hostname:n,protocol:o,port:s}){if(!t.destroyed){if(t[sfe]=!1,ofe.connectError.hasSubscribers&&ofe.connectError.publish({connectParams:{host:r,hostname:n,protocol:o,port:s,version:t[Xp]?.version,servername:t[dj],localAddress:t[nPe]},connector:t[rPe],error:e}),e.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(uF(t[iPe]===0);t[oPe]>0&&t[Kk][t[Jk]].servername===t[dj];){let c=t[Kk][t[Jk]++];BJ.errorRequest(t,c,e)}else R8n(t,e);t.emit("connectionError",t[YO],[t],e)}}a(onr,"handleConnectError");function I8n(t){t[uj]=0,t.emit("drain",t[YO],[t])}a(I8n,"emitDrain");function lnr(t,e){t[LJ]!==2&&(t[LJ]=2,mIs(t,e),t[LJ]=0,t[fF]>256&&(t[Kk].splice(0,t[fF]),t[Jk]-=t[fF],t[fF]=0))}a(lnr,"resume");function mIs(t,e){for(;;){if(t.destroyed){uF(t[oPe]===0);return}if(t[lj]&&!t[tPe]){t[lj](),t[lj]=null;return}if(t[Xp]&&t[Xp].resume(),t[snr])t[uj]=2;else if(t[uj]===2){e?(t[uj]=1,queueMicrotask(()=>I8n(t))):I8n(t);continue}if(t[oPe]===0||t[iPe]>=(w8n(t)||1))return;let r=t[Kk][t[Jk]];if(r===null)return;if(t[YO].protocol==="https:"&&t[dj]!==r.servername){if(t[iPe]>0)return;t[dj]=r.servername,t[Xp]?.destroy(new qTs("servername changed"),()=>{t[Xp]=null,lnr(t)})}if(t[sfe])return;if(!t[Xp]){P8n(t);return}if(t[Xp].destroyed||t[Xp].busy(r))return;!r.aborted&&t[Xp].write(r)?t[Jk]++:t[Kk].splice(t[Jk],1)}}a(mIs,"_resume");k8n.exports=cnr});var unr=I((MZd,D8n)=>{"use strict";p();var Iit=class{static{a(this,"FixedCircularBuffer")}bottom=0;top=0;list=new Array(2048).fill(void 0);next=null;isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(e){this.list[this.top]=e,this.top=this.top+1&2047}shift(){let e=this.list[this.bottom];return e===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,e)}};D8n.exports=class{static{a(this,"FixedQueue")}constructor(){this.head=this.tail=new Iit}isEmpty(){return this.head.isEmpty()}push(e){this.head.isFull()&&(this.head=this.head.next=new Iit),this.head.push(e)}shift(){let e=this.tail,r=e.shift();return e.isEmpty()&&e.next!==null&&(this.tail=e.next,e.next=null),r}}});var xit=I((LZd,q8n)=>{"use strict";p();var{PoolStats:gIs}=Ztr(),AIs=PJ(),yIs=unr(),{kConnected:dnr,kSize:N8n,kRunning:M8n,kPending:O8n,kQueued:sPe,kBusy:EIs,kFree:_Is,kUrl:vIs,kClose:CIs,kDestroy:bIs,kDispatch:SIs}=tl(),yg=Symbol("clients"),V_=Symbol("needDrain"),aPe=Symbol("queue"),fnr=Symbol("closed resolve"),pnr=Symbol("onDrain"),B8n=Symbol("onConnect"),L8n=Symbol("onDisconnect"),F8n=Symbol("onConnectionError"),hnr=Symbol("get dispatcher"),U8n=Symbol("add client"),Q8n=Symbol("remove client"),mnr=class extends AIs{static{a(this,"PoolBase")}[aPe]=new yIs;[sPe]=0;[yg]=[];[V_]=!1;[pnr](e,r,n){let o=this[aPe],s=!1;for(;!s;){let c=o.shift();if(!c)break;this[sPe]--,s=!e.dispatch(c.opts,c.handler)}if(e[V_]=s,!s&&this[V_]&&(this[V_]=!1,this.emit("drain",r,[this,...n])),this[fnr]&&o.isEmpty()){let c=[];for(let l=0;l{this.emit("connect",e,[this,...r])};[L8n]=(e,r,n)=>{this.emit("disconnect",e,[this,...r],n)};[F8n]=(e,r,n)=>{this.emit("connectionError",e,[this,...r],n)};get[EIs](){return this[V_]}get[dnr](){let e=0;for(let{[dnr]:r}of this[yg])e+=r;return e}get[_Is](){let e=0;for(let{[dnr]:r,[V_]:n}of this[yg])e+=r&&!n;return e}get[O8n](){let e=this[sPe];for(let{[O8n]:r}of this[yg])e+=r;return e}get[M8n](){let e=0;for(let{[M8n]:r}of this[yg])e+=r;return e}get[N8n](){let e=this[sPe];for(let{[N8n]:r}of this[yg])e+=r;return e}get stats(){return new gIs(this)}[CIs](){if(this[aPe].isEmpty()){let e=[];for(let r=0;r{this[fnr]=e})}[bIs](e){for(;;){let n=this[aPe].shift();if(!n)break;n.handler.onError(e)}let r=new Array(this[yg].length);for(let n=0;n{this[V_]&&this[pnr](e,e[vIs],[e,this])}),this}[Q8n](e){e.close(()=>{let r=this[yg].indexOf(e);r!==-1&&this[yg].splice(r,1)}),this[V_]=this[yg].some(r=>!r[V_]&&r.closed!==!0&&r.destroyed!==!0)}};q8n.exports={PoolBase:mnr,kClients:yg,kNeedDrain:V_,kAddClient:U8n,kRemoveClient:Q8n,kGetDispatcher:hnr}});var FJ=I((QZd,$8n)=>{"use strict";p();var{PoolBase:TIs,kClients:wit,kNeedDrain:IIs,kAddClient:xIs,kGetDispatcher:wIs,kRemoveClient:RIs}=xit(),PIs=fj(),{InvalidArgumentError:gnr}=ao(),j8n=ko(),{kUrl:H8n}=tl(),kIs=kJ(),Rit=Symbol("options"),Anr=Symbol("connections"),G8n=Symbol("factory");function DIs(t,e){return new PIs(t,e)}a(DIs,"defaultFactory");var ynr=class extends TIs{static{a(this,"Pool")}constructor(e,{connections:r,factory:n=DIs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new gnr("invalid connections");if(typeof n!="function")throw new gnr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new gnr("connect must be a function or an object");typeof o!="function"&&(o=kIs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Anr]=r||null,this[H8n]=j8n.parseOrigin(e),this[Rit]={...j8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[Rit].interceptors=g.interceptors?{...g.interceptors}:void 0,this[G8n]=n,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[wit].indexOf(_);v!==-1&&this[wit].splice(v,1)}})}[wIs](){let e=this[Rit].clientTtl;for(let r of this[wit])if(e!=null&&e>0&&r.ttl&&Date.now()-r.ttl>e)this[RIs](r);else if(!r[IIs])return r;if(!this[Anr]||this[wit].length{"use strict";p();var{BalancedPoolMissingUpstreamError:NIs,InvalidArgumentError:MIs}=ao(),{PoolBase:OIs,kClients:kA,kNeedDrain:cPe,kAddClient:BIs,kRemoveClient:LIs,kGetDispatcher:FIs}=xit(),UIs=FJ(),{kUrl:Pit}=tl(),kit=ko(),V8n=Symbol("factory"),lPe=Symbol("options"),W8n=Symbol("kGreatestCommonDivisor"),UJ=Symbol("kCurrentWeight"),QJ=Symbol("kIndex"),Aw=Symbol("kWeight"),Dit=Symbol("kMaxWeightPerServer"),Nit=Symbol("kErrorPenalty");function QIs(t,e){if(t===0)return e;for(;e!==0;){let r=e;e=t%e,t=r}return t}a(QIs,"getGreatestCommonDivisor");function qIs(t,e){return new UIs(t,e)}a(qIs,"defaultFactory");var Enr=class extends OIs{static{a(this,"BalancedPool")}constructor(e=[],{factory:r=qIs,...n}={}){if(typeof r!="function")throw new MIs("factory must be a function.");super(),this[lPe]={...kit.deepClone(n)},this[lPe].interceptors=n.interceptors?{...n.interceptors}:void 0,this[QJ]=-1,this[UJ]=0,this[Dit]=this[lPe].maxWeightPerServer||100,this[Nit]=this[lPe].errorPenalty||15,Array.isArray(e)||(e=[e]),this[V8n]=r;for(let o of e)this.addUpstream(o);this._updateBalancedPoolStats()}addUpstream(e){let r=kit.parseOrigin(e).origin;if(this[kA].find(o=>o[Pit].origin===r&&o.closed!==!0&&o.destroyed!==!0))return this;let n=this[V8n](r,this[lPe]);this[BIs](n),n.on("connect",()=>{n[Aw]=Math.min(this[Dit],n[Aw]+this[Nit])}),n.on("connectionError",()=>{n[Aw]=Math.max(1,n[Aw]-this[Nit]),this._updateBalancedPoolStats()}),n.on("disconnect",(...o)=>{let s=o[2];s&&s.code==="UND_ERR_SOCKET"&&(n[Aw]=Math.max(1,n[Aw]-this[Nit]),this._updateBalancedPoolStats())});for(let o of this[kA])o[Aw]=this[Dit];return this._updateBalancedPoolStats(),this}_updateBalancedPoolStats(){let e=0;for(let r=0;ro[Pit].origin===r&&o.closed!==!0&&o.destroyed!==!0);return n&&this[LIs](n),this}getUpstream(e){let r=kit.parseOrigin(e).origin;return this[kA].find(n=>n[Pit].origin===r&&n.closed!==!0&&n.destroyed!==!0)}get upstreams(){return this[kA].filter(e=>e.closed!==!0&&e.destroyed!==!0).map(e=>e[Pit].origin)}[FIs](){if(this[kA].length===0)throw new NIs;if(!this[kA].find(s=>!s[cPe]&&s.closed!==!0&&s.destroyed!==!0)||this[kA].map(s=>s[cPe]).reduce((s,c)=>s&&c,!0))return;let n=0,o=this[kA].findIndex(s=>!s[cPe]);for(;n++this[kA][o][Aw]&&!s[cPe]&&(o=this[QJ]),this[QJ]===0&&(this[UJ]=this[UJ]-this[W8n],this[UJ]<=0&&(this[UJ]=this[Dit])),s[Aw]>=this[UJ]&&!s[cPe])return s}return this[UJ]=this[kA][o][Aw],this[QJ]=o,this[kA][o]}};z8n.exports=Enr});var X8n=I((VZd,Z8n)=>{"use strict";p();var{PoolBase:jIs,kClients:Mit,kNeedDrain:HIs,kAddClient:K8n,kGetDispatcher:GIs,kRemoveClient:$Is}=xit(),VIs=fj(),{InvalidArgumentError:_nr}=ao(),J8n=ko(),{kUrl:vnr}=tl(),WIs=kJ(),uPe=Symbol("options"),Cnr=Symbol("connections"),bnr=Symbol("factory"),Oit=Symbol("index");function zIs(t,e){return new VIs(t,e)}a(zIs,"defaultFactory");var Snr=class extends jIs{static{a(this,"RoundRobinPool")}constructor(e,{connections:r,factory:n=zIs,connect:o,connectTimeout:s,tls:c,maxCachedSessions:l,socketPath:u,autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f,allowH2:h,clientTtl:m,...g}={}){if(r!=null&&(!Number.isFinite(r)||r<0))throw new _nr("invalid connections");if(typeof n!="function")throw new _nr("factory must be a function.");if(o!=null&&typeof o!="function"&&typeof o!="object")throw new _nr("connect must be a function or an object");typeof o!="function"&&(o=WIs({...c,maxCachedSessions:l,allowH2:h,socketPath:u,timeout:s,...typeof d=="boolean"?{autoSelectFamily:d,autoSelectFamilyAttemptTimeout:f}:void 0,...o})),super(),this[Cnr]=r||null,this[vnr]=J8n.parseOrigin(e),this[uPe]={...J8n.deepClone(g),connect:o,allowH2:h,clientTtl:m,socketPath:u},this[uPe].interceptors=g.interceptors?{...g.interceptors}:void 0,this[bnr]=n,this[Oit]=-1,this.on("connect",(A,y)=>{if(m!=null&&m>0)for(let E of y)Object.assign(E,{ttl:Date.now()})}),this.on("connectionError",(A,y,E)=>{for(let _ of y){let v=this[Mit].indexOf(_);v!==-1&&this[Mit].splice(v,1)}})}[GIs](){let e=this[uPe].clientTtl,r=this[Mit].length;if(r===0){let o=this[bnr](this[vnr],this[uPe]);return this[K8n](o),o}let n=0;for(;n0&&o.ttl&&Date.now()-o.ttl>e){this[$Is](o),n++;continue}if(!o[HIs])return o;n++}if(!this[Cnr]||r{"use strict";p();var{InvalidArgumentError:Bit,MaxOriginsReachedError:YIs}=ao(),{kClients:yw,kRunning:e6n,kClose:KIs,kDestroy:JIs,kDispatch:ZIs,kUrl:XIs}=tl(),exs=PJ(),txs=FJ(),rxs=fj(),nxs=ko(),t6n=Symbol("onConnect"),r6n=Symbol("onDisconnect"),n6n=Symbol("onConnectionError"),i6n=Symbol("onDrain"),o6n=Symbol("factory"),Tnr=Symbol("options"),dPe=Symbol("origins");function ixs(t,e){return e&&e.connections===1?new rxs(t,e):new txs(t,e)}a(ixs,"defaultFactory");var Inr=class extends exs{static{a(this,"Agent")}constructor({factory:e=ixs,maxOrigins:r=1/0,connect:n,...o}={}){if(typeof e!="function")throw new Bit("factory must be a function.");if(n!=null&&typeof n!="function"&&typeof n!="object")throw new Bit("connect must be a function or an object");if(typeof r!="number"||Number.isNaN(r)||r<=0)throw new Bit("maxOrigins must be a number greater than 0");super(),n&&typeof n!="function"&&(n={...n}),this[Tnr]={...nxs.deepClone(o),maxOrigins:r,connect:n},this[o6n]=e,this[yw]=new Map,this[dPe]=new Set,this[i6n]=(s,c)=>{this.emit("drain",s,[this,...c])},this[t6n]=(s,c)=>{this.emit("connect",s,[this,...c])},this[r6n]=(s,c,l)=>{this.emit("disconnect",s,[this,...c],l)},this[n6n]=(s,c,l)=>{this.emit("connectionError",s,[this,...c],l)}}get[e6n](){let e=0;for(let{dispatcher:r}of this[yw].values())e+=r[e6n];return e}[ZIs](e,r){let n;if(e.origin&&(typeof e.origin=="string"||e.origin instanceof URL))n=String(e.origin);else throw new Bit("opts.origin must be a non-empty string or URL.");if(this[dPe].size>=this[Tnr].maxOrigins&&!this[dPe].has(n))throw new YIs;let o=this[yw].get(n),s=o&&o.dispatcher;if(!s){let c=a(l=>{let u=this[yw].get(n);u&&(l&&(u.count-=1),u.count<=0&&(this[yw].delete(n),u.dispatcher.destroyed||u.dispatcher.close()),this[dPe].delete(n))},"closeClientIfUnused");s=this[o6n](e.origin,this[Tnr]).on("drain",this[i6n]).on("connect",(l,u)=>{let d=this[yw].get(n);d&&(d.count+=1),this[t6n](l,u)}).on("disconnect",(l,u,d)=>{c(!0),this[r6n](l,u,d)}).on("connectionError",(l,u,d)=>{c(!1),this[n6n](l,u,d)}),this[yw].set(n,{count:0,dispatcher:s}),this[dPe].add(n)}return s.dispatch(e,r)}[KIs](){let e=[];for(let{dispatcher:r}of this[yw].values())e.push(r.close());return this[yw].clear(),Promise.all(e)}[JIs](e){let r=[];for(let{dispatcher:n}of this[yw].values())r.push(n.destroy(e));return this[yw].clear(),Promise.all(r)}get stats(){let e={};for(let{dispatcher:r}of this[yw].values())r.stats&&(e[r[XIs].origin]=r.stats);return e}};s6n.exports=Inr});var u6n=I((ZZd,l6n)=>{"use strict";p();var{Buffer:hj}=require("node:buffer"),a6n=require("node:net"),{InvalidArgumentError:pj}=ao();function oxs(t){if(a6n.isIPv4(t)){let r=t.split(".").map(Number);return{type:1,buffer:hj.from(r)}}if(a6n.isIPv6(t))return{type:4,buffer:c6n(t)};let e=hj.from(t,"utf8");if(e.length>255)throw new pj("Domain name too long (max 255 bytes)");return{type:3,buffer:hj.concat([hj.from([e.length]),e])}}a(oxs,"parseAddress");function c6n(t){let e=hj.alloc(16),r=t.indexOf("::");if(r!==-1){let n=t.slice(0,r),o=t.slice(r+2),s=n===""?[]:n.split(":"),c=o===""?[]:o.split(":"),l=0;for(let u of s)e.writeUInt16BE(parseInt(u,16),l),l+=2;l=16-c.length*2;for(let u of c)e.writeUInt16BE(parseInt(u,16),l),l+=2}else{let n=t.split(":");for(let o=0;o{"use strict";p();var{EventEmitter:lxs}=require("node:events"),{Buffer:jJ}=require("node:buffer"),{InvalidArgumentError:fPe,Socks5ProxyError:mj}=ao(),{debuglog:uxs}=require("node:util"),{parseAddress:dxs}=u6n(),pF=uxs("undici:socks5"),d6n=jJ.alloc(0),Lit=5,afe={NO_AUTH:0,GSSAPI:1,USERNAME_PASSWORD:2,NO_ACCEPTABLE:255},f6n={CONNECT:1,BIND:2,UDP_ASSOCIATE:3},HJ={IPV4:1,DOMAIN:3,IPV6:4},KO={SUCCEEDED:0,GENERAL_FAILURE:1,CONNECTION_NOT_ALLOWED:2,NETWORK_UNREACHABLE:3,HOST_UNREACHABLE:4,CONNECTION_REFUSED:5,TTL_EXPIRED:6,COMMAND_NOT_SUPPORTED:7,ADDRESS_TYPE_NOT_SUPPORTED:8},rT={INITIAL:"initial",HANDSHAKING:"handshaking",AUTHENTICATING:"authenticating",CONNECTING:"connecting",CONNECTED:"connected",ERROR:"error",CLOSED:"closed"},xnr=class extends lxs{static{a(this,"Socks5Client")}constructor(e,r={}){if(super(),!e)throw new fPe("socket is required");this.socket=e,this.options=r,this.state=rT.INITIAL,this.buffer=d6n,this.onSocketData=this.onData.bind(this),this.onSocketError=this.onError.bind(this),this.onSocketClose=this.onClose.bind(this),this.authMethods=[],r.username&&r.password&&this.authMethods.push(afe.USERNAME_PASSWORD),this.authMethods.push(afe.NO_AUTH),this.socket.on("data",this.onSocketData),this.socket.on("error",this.onSocketError),this.socket.on("close",this.onSocketClose)}onData(e){pF("received data",e.length,"bytes in state",this.state),this.buffer=jJ.concat([this.buffer,e]);try{switch(this.state){case rT.HANDSHAKING:this.handleHandshakeResponse();break;case rT.AUTHENTICATING:this.handleAuthResponse();break;case rT.CONNECTING:this.handleConnectResponse();break}}catch(r){this.onError(r)}}onError(e){pF("socket error",e),this.state=rT.ERROR,this.emit("error",e),this.destroy()}onClose(){pF("socket closed"),this.state=rT.CLOSED,this.emit("close")}destroy(){this.socket&&!this.socket.destroyed&&this.socket.destroy()}handshake(){if(this.state!==rT.INITIAL)throw new fPe("Handshake already started");pF("starting handshake with",this.authMethods.length,"auth methods"),this.state=rT.HANDSHAKING;let e=jJ.alloc(2+this.authMethods.length);e[0]=Lit,e[1]=this.authMethods.length,this.authMethods.forEach((r,n)=>{e[2+n]=r}),this.socket.write(e)}handleHandshakeResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==Lit)throw new mj(`Invalid SOCKS version: ${e}`,"UND_ERR_SOCKS5_VERSION");if(r===afe.NO_ACCEPTABLE)throw new mj("No acceptable authentication method","UND_ERR_SOCKS5_AUTH_REJECTED");if(this.buffer=this.buffer.subarray(2),pF("server selected auth method",r),r===afe.NO_AUTH)this.emit("authenticated");else if(r===afe.USERNAME_PASSWORD)this.state=rT.AUTHENTICATING,this.sendAuthRequest();else throw new mj(`Unsupported authentication method: ${r}`,"UND_ERR_SOCKS5_AUTH_METHOD")}sendAuthRequest(){let{username:e,password:r}=this.options;if(!e||!r)throw new fPe("Username and password required for authentication");pF("sending username/password auth");let n=jJ.from(e),o=jJ.from(r);if(n.length>255||o.length>255)throw new fPe("Username or password too long");let s=jJ.alloc(3+n.length+o.length);s[0]=1,s[1]=n.length,n.copy(s,2),s[2+n.length]=o.length,o.copy(s,3+n.length),this.socket.write(s)}handleAuthResponse(){if(this.buffer.length<2)return;let e=this.buffer[0],r=this.buffer[1];if(e!==1)throw new mj(`Invalid auth sub-negotiation version: ${e}`,"UND_ERR_SOCKS5_AUTH_VERSION");if(r!==0)throw new mj("Authentication failed","UND_ERR_SOCKS5_AUTH_FAILED");this.buffer=this.buffer.subarray(2),pF("authentication successful"),this.emit("authenticated")}connect(e,r){if(this.state===rT.CONNECTED)throw new fPe("Already connected");pF("connecting to",e,r),this.state=rT.CONNECTING;let n=this.buildConnectRequest(f6n.CONNECT,e,r);this.socket.write(n)}buildConnectRequest(e,r,n){let{type:o,buffer:s}=dxs(r),c=jJ.alloc(4+s.length+2);return c[0]=Lit,c[1]=e,c[2]=0,c[3]=o,s.copy(c,4),c.writeUInt16BE(n,4+s.length),c}handleConnectResponse(){if(this.buffer.length<4)return;let e=this.buffer[0],r=this.buffer[1],n=this.buffer[3];if(e!==Lit)throw new mj(`Invalid SOCKS version in reply: ${e}`,"UND_ERR_SOCKS5_REPLY_VERSION");let o=4;if(n===HJ.IPV4)o+=6;else if(n===HJ.DOMAIN){if(this.buffer.length<5)return;o+=1+this.buffer[4]+2}else if(n===HJ.IPV6)o+=18;else throw new mj(`Invalid address type in reply: ${n}`,"UND_ERR_SOCKS5_ADDR_TYPE");if(this.buffer.length{"use strict";p();var fxs=require("node:net"),{URL:m6n}=require("node:url"),wnr,pxs=PJ(),{InvalidArgumentError:g6n}=ao(),{Socks5Client:hxs}=h6n(),{kDispatch:A6n,kClose:mxs,kDestroy:gxs}=tl(),Axs=FJ(),yxs=kJ(),{debuglog:Exs}=require("node:util"),gj=Exs("undici:socks5-proxy"),Rnr=Symbol("proxy url"),_xs=Symbol("proxy headers"),y6n=Symbol("proxy auth"),JO=Symbol("pool"),vxs=Symbol("connector"),E6n=!1,Pnr=class extends pxs{static{a(this,"Socks5ProxyAgent")}constructor(e,r={}){if(super(),E6n||(process.emitWarning("SOCKS5 proxy support is experimental and subject to change","ExperimentalWarning"),E6n=!0),!e)throw new g6n("Proxy URL is mandatory");let n=typeof e=="string"?new m6n(e):e;if(n.protocol!=="socks5:"&&n.protocol!=="socks:")throw new g6n("Proxy URL must use socks5:// or socks:// protocol");this[Rnr]=n,this[_xs]=r.headers||{},this[y6n]={username:r.username||(n.username?decodeURIComponent(n.username):null),password:r.password||(n.password?decodeURIComponent(n.password):null)},this[vxs]=r.connect||yxs({...r.proxyTls,servername:r.proxyTls?.servername||n.hostname}),this[JO]=null}async createSocks5Connection(e,r){let n=this[Rnr].hostname,o=parseInt(this[Rnr].port)||1080;gj("creating SOCKS5 connection to",n,o);let s=await new Promise((l,u)=>{let d=a(()=>{h.removeListener("error",f),l(h)},"onConnect"),f=a(m=>{h.removeListener("connect",d),u(m)},"onError"),h=fxs.connect({host:n,port:o});h.once("connect",d),h.once("error",f)}),c=new hxs(s,this[y6n]);return c.on("error",l=>{gj("SOCKS5 error:",l),s.destroy()}),await c.handshake(),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 authentication timeout"))},5e3),f=a(()=>{clearTimeout(d),c.removeListener("error",h),l()},"onAuthenticated"),h=a(m=>{clearTimeout(d),c.removeListener("authenticated",f),u(m)},"onError");c.state==="authenticated"?(clearTimeout(d),l()):(c.once("authenticated",f),c.once("error",h))}),await c.connect(e,r),await new Promise((l,u)=>{let d=setTimeout(()=>{u(new Error("SOCKS5 connection timeout"))},5e3),f=a(m=>{gj("SOCKS5 tunnel established to",e,r,"via",m),clearTimeout(d),c.removeListener("error",h),l()},"onConnected"),h=a(m=>{clearTimeout(d),c.removeListener("connected",f),u(m)},"onError");c.once("connected",f),c.once("error",h)}),s}async[A6n](e,r){let{origin:n}=e;gj("dispatching request to",n,"via SOCKS5");try{return(!this[JO]||this[JO].destroyed||this[JO].closed)&&(this[JO]=new Axs(n,{pipelining:e.pipelining,connections:e.connections,connect:a(async(o,s)=>{try{let c=new m6n(n),l=c.hostname,u=parseInt(c.port)||(c.protocol==="https:"?443:80);gj("establishing SOCKS5 connection to",l,u);let d=await this.createSocks5Connection(l,u),f=d;c.protocol==="https:"&&(wnr||(wnr=require("node:tls")),gj("upgrading to TLS"),f=wnr.connect({socket:d,servername:l,...o.tls||{}}),await new Promise((h,m)=>{f.once("secureConnect",h),f.once("error",m)})),s(null,f)}catch(c){gj("SOCKS5 connection error:",c),s(c)}},"connect")})),this[JO][A6n](e,r)}catch(o){if(gj("dispatch error:",o),typeof r.onError=="function")r.onError(o);else throw o}}async[mxs](){this[JO]&&await this[JO].close()}async[gxs](e){this[JO]&&await this[JO].destroy(e)}};_6n.exports=Pnr});var Onr=I((aXd,D6n)=>{"use strict";p();var{kProxy:cfe,kClose:x6n,kDestroy:w6n,kDispatch:v6n}=tl(),Cxs=qJ(),R6n=FJ(),P6n=PJ(),{InvalidArgumentError:GJ,RequestAbortedError:bxs,SecureProxyConnectionError:Sxs}=ao(),C6n=kJ(),k6n=fj(),{channels:b6n}=rj(),Txs=knr(),Fit=Symbol("proxy agent"),Aj=Symbol("proxy client"),hF=Symbol("proxy headers"),Dnr=Symbol("request tls settings"),S6n=Symbol("proxy tls settings"),T6n=Symbol("connect endpoint function"),I6n=Symbol("tunnel proxy");function Ixs(t){return t==="https:"?443:80}a(Ixs,"defaultProtocolPort");function xxs(t,e){return new R6n(t,e)}a(xxs,"defaultFactory");var wxs=a(()=>{},"noop");function Rxs(t,e){return e.connections===1?new k6n(t,e):new R6n(t,e)}a(Rxs,"defaultAgentFactory");var Nnr=class extends P6n{static{a(this,"Http1ProxyWrapper")}#e;constructor(e,{headers:r={},connect:n,factory:o}){if(!e)throw new GJ("Proxy URL is mandatory");super(),this[hF]=r,o?this.#e=o(e,{connect:n}):this.#e=new k6n(e,{connect:n})}[v6n](e,r){let n=r.onHeaders;r.onHeaders=function(l,u,d){if(l===407){typeof r.onError=="function"&&r.onError(new GJ("Proxy Authentication Required (407)"));return}n&&n.call(this,l,u,d)};let{origin:o,path:s="/",headers:c={}}=e;if(e.path=o+s,!("host"in c)&&!("Host"in c)){let{host:l}=new URL(o);c.host=l}return e.headers={...this[hF],...c},this.#e[v6n](e,r)}[x6n](){return this.#e.close()}[w6n](e){return this.#e.destroy(e)}},Mnr=class extends P6n{static{a(this,"ProxyAgent")}constructor(e){if(!e||typeof e=="object"&&!(e instanceof URL)&&!e.uri)throw new GJ("Proxy uri is mandatory");let{clientFactory:r=xxs}=e;if(typeof r!="function")throw new GJ("Proxy opts.clientFactory must be a function.");let{proxyTunnel:n=!0}=e;super();let o=this.#e(e),{href:s,origin:c,port:l,protocol:u,username:d,password:f,hostname:h}=o;if(this[cfe]={uri:s,protocol:u},this[Dnr]=e.requestTls,this[S6n]=e.proxyTls,this[hF]=e.headers||{},this[I6n]=n,e.auth&&e.token)throw new GJ("opts.auth cannot be used in combination with opts.token");e.auth?this[hF]["proxy-authorization"]=`Basic ${e.auth}`:e.token?this[hF]["proxy-authorization"]=e.token:d&&f&&(this[hF]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(d)}:${decodeURIComponent(f)}`).toString("base64")}`);let m=C6n({...e.proxyTls});this[T6n]=C6n({...e.requestTls});let g=e.factory||Rxs,A=a((y,E)=>{let{protocol:_}=new URL(y);return this[cfe].protocol==="socks5:"||this[cfe].protocol==="socks:"?new Txs(this[cfe].uri,{headers:this[hF],connect:m,factory:g,username:e.username||d,password:e.password||f,proxyTls:e.proxyTls}):!this[I6n]&&_==="http:"&&this[cfe].protocol==="http:"?new Nnr(this[cfe].uri,{headers:this[hF],connect:m,factory:g}):g(y,E)},"factory");u==="socks5:"||u==="socks:"?this[Aj]=null:this[Aj]=r(o,{connect:m}),this[Fit]=new Cxs({...e,factory:A,connect:a(async(y,E)=>{if(!this[Aj]){E(new GJ("Cannot establish tunnel connection without a proxy client"));return}let _=y.host;y.port||(_+=`:${Ixs(y.protocol)}`);try{let v={origin:c,port:l,path:_,signal:y.signal,headers:{...this[hF],host:y.host,...y.connections==null||y.connections>0?{"proxy-connection":"keep-alive"}:{}},servername:this[S6n]?.servername||h},{socket:b,statusCode:T}=await this[Aj].connect(v);if(T!==200){b.on("error",wxs).destroy(),E(new bxs(`Proxy response (${T}) !== 200 when HTTP Tunneling`));return}if(b6n.proxyConnected.hasSubscribers&&b6n.proxyConnected.publish({socket:b,connectParams:v}),y.protocol!=="https:"){E(null,b);return}let w;this[Dnr]?w=this[Dnr].servername:w=y.servername,this[T6n]({...y,servername:w,httpSocket:b},E)}catch(v){v.code==="ERR_TLS_CERT_ALTNAME_INVALID"?E(new Sxs(v)):E(v)}},"connect")})}dispatch(e,r){let n=Pxs(e.headers);if(kxs(n),n&&!("host"in n)&&!("Host"in n)){let{host:o}=new URL(e.origin);n.host=o}return this[Fit].dispatch({...e,headers:n},r)}#e(e){return typeof e=="string"?new URL(e):e instanceof URL?e:new URL(e.uri)}[x6n](){let e=[this[Fit].close()];return this[Aj]&&e.push(this[Aj].close()),Promise.all(e)}[w6n](){let e=[this[Fit].destroy()];return this[Aj]&&e.push(this[Aj].destroy()),Promise.all(e)}};function Pxs(t){if(Array.isArray(t)){let e={};for(let r=0;rr.toLowerCase()==="proxy-authorization"))throw new GJ("Proxy-Authorization should be sent in ProxyAgent constructor")}a(kxs,"throwIfProxyAuthIsSent");D6n.exports=Mnr});var L6n=I((uXd,B6n)=>{"use strict";p();var Dxs=PJ(),{kClose:Nxs,kDestroy:Mxs,kClosed:N6n,kDestroyed:M6n,kDispatch:Oxs,kNoProxyAgent:pPe,kHttpProxyAgent:yj,kHttpsProxyAgent:$J}=tl(),O6n=Onr(),Bxs=qJ(),Lxs={"http:":80,"https:":443},Bnr=class extends Dxs{static{a(this,"EnvHttpProxyAgent")}#e=null;#t=null;#r=null;constructor(e={}){super(),this.#r=e;let{httpProxy:r,httpsProxy:n,noProxy:o,...s}=e;this[pPe]=new Bxs(s);let c=r??process.env.http_proxy??process.env.HTTP_PROXY;c?this[yj]=new O6n({...s,uri:c}):this[yj]=this[pPe];let l=n??process.env.https_proxy??process.env.HTTPS_PROXY;l?this[$J]=new O6n({...s,uri:l}):this[$J]=this[yj],this.#o()}[Oxs](e,r){let n=new URL(e.origin);return this.#n(n).dispatch(e,r)}[Nxs](){return Promise.all([this[pPe].close(),!this[yj][N6n]&&this[yj].close(),!this[$J][N6n]&&this[$J].close()])}[Mxs](e){return Promise.all([this[pPe].destroy(e),!this[yj][M6n]&&this[yj].destroy(e),!this[$J][M6n]&&this[$J].destroy(e)])}#n(e){let{protocol:r,host:n,port:o}=e;return n=n.replace(/:\d*$/,"").toLowerCase(),o=Number.parseInt(o,10)||Lxs[r]||0,this.#i(n,o)?r==="https:"?this[$J]:this[yj]:this[pPe]}#i(e,r){if(this.#s&&this.#o(),this.#t.length===0)return!0;if(this.#e==="*")return!1;for(let n=0;n{"use strict";p();var lfe=require("node:assert"),{kRetryHandlerDefaultRetry:F6n}=tl(),{RequestRetryError:hPe}=ao(),Fxs=BRe(),{isDisturbed:U6n,parseRangeHeader:Q6n,wrapRequestBody:Uxs}=ko();function Qxs(t){let e=new Date(t).getTime();return isNaN(e)?0:e-Date.now()}a(Qxs,"calculateRetryAfterHeader");var Lnr=class t{static{a(this,"RetryHandler")}constructor(e,{dispatch:r,handler:n}){let{retryOptions:o,...s}=e,{retry:c,maxRetries:l,maxTimeout:u,minTimeout:d,timeoutFactor:f,methods:h,errorCodes:m,retryAfter:g,statusCodes:A,throwOnError:y}=o??{};this.error=null,this.dispatch=r,this.handler=Fxs.wrap(n),this.opts={...s,body:Uxs(e.body)},this.retryOpts={throwOnError:y??!0,retry:c??t[F6n],retryAfter:g??!0,maxTimeout:u??30*1e3,minTimeout:d??500,timeoutFactor:f??2,maxRetries:l??5,methods:h??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:A??[500,502,503,504,429],errorCodes:m??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE","UND_ERR_SOCKET"]},this.retryCount=0,this.retryCountCheckpoint=0,this.headersSent=!1,this.start=0,this.end=null,this.etag=null}onResponseStartWithRetry(e,r,n,o,s){if(this.retryOpts.throwOnError){this.retryOpts.statusCodes.includes(r)===!1?(this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)):this.error=s;return}if(U6n(this.opts.body)){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}function c(l){if(l){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o),e.resume();return}this.error=s,e.resume()}a(c,"shouldRetry"),e.pause(),this.retryOpts.retry(s,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},c.bind(this))}onRequestStart(e,r){this.headersSent||this.handler.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}static[F6n](e,{state:r,opts:n},o){let{statusCode:s,code:c,headers:l}=e,{method:u,retryOptions:d}=n,{maxRetries:f,minTimeout:h,maxTimeout:m,timeoutFactor:g,statusCodes:A,errorCodes:y,methods:E}=d,{counter:_}=r;if(c&&c!=="UND_ERR_REQ_RETRY"&&!y.includes(c)){o(e);return}if(Array.isArray(E)&&!E.includes(u)){o(e);return}if(s!=null&&Array.isArray(A)&&!A.includes(s)){o(e);return}if(_>f){o(e);return}let v=l?.["retry-after"];v&&(v=Number(v),v=Number.isNaN(v)?Qxs(l["retry-after"]):v*1e3);let b=v>0?Math.min(v,m):Math.min(h*g**(_-1),m);setTimeout(()=>o(null),b)}onResponseStart(e,r,n,o){if(this.error=null,this.retryCount+=1,r>=300){let s=new hPe("Request failed",r,{headers:n,data:{count:this.retryCount}});this.onResponseStartWithRetry(e,r,n,o,s);return}if(this.headersSent){if(r!==206&&(this.start>0||r!==200))throw new hPe("server does not support the range header and the payload was partially consumed",r,{headers:n,data:{count:this.retryCount}});let s=Q6n(n["content-range"]);if(!s)throw new hPe("Content-Range mismatch",r,{headers:n,data:{count:this.retryCount}});if(this.etag!=null&&this.etag!==n.etag)throw new hPe("ETag mismatch",r,{headers:n,data:{count:this.retryCount}});let{start:c,size:l,end:u=l?l-1:null}=s;lfe(this.start===c,"content-range mismatch"),lfe(this.end==null||this.end===u,"content-range mismatch");return}if(this.end==null){if(r===206){let s=Q6n(n["content-range"]);if(s==null){this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o);return}let{start:c,size:l,end:u=l?l-1:null}=s;lfe(c!=null&&Number.isFinite(c),"content-range mismatch"),lfe(u!=null&&Number.isFinite(u),"invalid content-length"),this.start=c,this.end=u}if(this.end==null){let s=n["content-length"];this.end=s!=null?Number(s)-1:null}lfe(Number.isFinite(this.start)),lfe(this.end==null||Number.isFinite(this.end),"invalid content-length"),this.resume=!0,this.etag=n.etag!=null?n.etag:null,this.etag!=null&&this.etag[0]==="W"&&this.etag[1]==="/"&&(this.etag=null),this.headersSent=!0,this.handler.onResponseStart?.(e,r,n,o)}else throw new hPe("Request failed",r,{headers:n,data:{count:this.retryCount}})}onResponseData(e,r){this.error||(this.start+=r.length,this.handler.onResponseData?.(e,r))}onResponseEnd(e,r){if(this.error&&this.retryOpts.throwOnError)throw this.error;if(!this.error)return this.retryCount=0,this.handler.onResponseEnd?.(e,r);this.retry(e)}retry(e){if(this.start!==0){let r={range:`bytes=${this.start}-${this.end??""}`};this.etag!=null&&(r["if-match"]=this.etag),this.opts={...this.opts,headers:{...this.opts.headers,...r}}}try{this.retryCountCheckpoint=this.retryCount,this.dispatch(this.opts,this)}catch(r){this.handler.onResponseError?.(e,r)}}onResponseError(e,r){if(e?.aborted||U6n(this.opts.body)){this.handler.onResponseError?.(e,r);return}function n(o){if(!o){this.retry(e);return}this.handler?.onResponseError?.(e,o)}a(n,"shouldRetry"),this.retryCount-this.retryCountCheckpoint>0?this.retryCount=this.retryCountCheckpoint+(this.retryCount-this.retryCountCheckpoint):this.retryCount+=1,this.retryOpts.retry(r,{state:{counter:this.retryCount},opts:{retryOptions:this.retryOpts,...this.opts}},n.bind(this))}};q6n.exports=Lnr});var H6n=I((gXd,j6n)=>{"use strict";p();var qxs=LRe(),jxs=Uit(),Fnr=class extends qxs{static{a(this,"RetryAgent")}#e=null;#t=null;constructor(e,r={}){super(r),this.#e=e,this.#t=r}dispatch(e,r){let n=new jxs({...e,retryOptions:this.#t},{dispatch:this.#e.dispatch.bind(this.#e),handler:r});return this.#e.dispatch(e,n)}close(){return this.#e.close()}destroy(){return this.#e.destroy()}};j6n.exports=Fnr});var V6n=I((EXd,$6n)=>{"use strict";p();var{InvalidArgumentError:G6n}=ao(),Hxs=fj(),Unr=class extends Hxs{static{a(this,"H2CClient")}constructor(e,r){if(typeof e=="string"&&(e=new URL(e)),e.protocol!=="http:")throw new G6n("h2c-client: Only h2c protocol is supported");let{maxConcurrentStreams:n,pipelining:o,...s}=r??{},c=100,l=100;if(n!=null&&Number.isInteger(n)&&n>0&&(c=n),o!=null&&Number.isInteger(o)&&o>0&&(l=o),l>c)throw new G6n("h2c-client: pipelining cannot be greater than maxConcurrentStreams");super(e,{...s,maxConcurrentStreams:c,pipelining:l,allowH2:!0,useH2c:!0})}};$6n.exports=Unr});var t9n=I((CXd,e9n)=>{"use strict";p();var K6n=require("node:assert"),{Readable:Gxs}=require("node:stream"),{RequestAbortedError:J6n,NotSupportedError:$xs,InvalidArgumentError:Vxs,AbortError:Qit}=ao(),Z6n=ko(),{ReadableStreamFrom:Wxs}=ko(),nT=Symbol("kConsume"),qit=Symbol("kReading"),VJ=Symbol("kBody"),W6n=Symbol("kAbort"),X6n=Symbol("kContentType"),Qnr=Symbol("kContentLength"),qnr=Symbol("kUsed"),jit=Symbol("kBytesRead"),zxs=a(()=>{},"noop"),jnr=class extends Gxs{static{a(this,"BodyReadable")}constructor({resume:e,abort:r,contentType:n="",contentLength:o,highWaterMark:s=64*1024}){super({autoDestroy:!0,read:e,highWaterMark:s}),this._readableState.dataEmitted=!1,this[W6n]=r,this[nT]=null,this[jit]=0,this[VJ]=null,this[qnr]=!1,this[X6n]=n,this[Qnr]=Number.isFinite(o)?o:null,this[qit]=!1}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new J6n),e&&this[W6n](),this[qnr]?r(e):setImmediate(r,e)}on(e,r){return(e==="data"||e==="readable")&&(this[qit]=!0,this[qnr]=!0),super.on(e,r)}addListener(e,r){return this.on(e,r)}off(e,r){let n=super.off(e,r);return(e==="data"||e==="readable")&&(this[qit]=this.listenerCount("data")>0||this.listenerCount("readable")>0),n}removeListener(e,r){return this.off(e,r)}push(e){return e&&(this[jit]+=e.length,this[nT])?(Gnr(this[nT],e),this[qit]?super.push(e):!0):super.push(e)}text(){return mPe(this,"text")}json(){return mPe(this,"json")}blob(){return mPe(this,"blob")}bytes(){return mPe(this,"bytes")}arrayBuffer(){return mPe(this,"arrayBuffer")}async formData(){throw new $xs}get bodyUsed(){return Z6n.isDisturbed(this)}get body(){return this[VJ]||(this[VJ]=Wxs(this),this[nT]&&(this[VJ].getReader(),K6n(this[VJ].locked))),this[VJ]}dump(e){let r=e?.signal;if(r!=null&&(typeof r!="object"||!("aborted"in r)))return Promise.reject(new Vxs("signal must be an AbortSignal"));let n=e?.limit&&Number.isFinite(e.limit)?e.limit:128*1024;return r?.aborted?Promise.reject(r.reason??new Qit):this._readableState.closeEmitted?Promise.resolve(null):new Promise((o,s)=>{if((this[Qnr]&&this[Qnr]>n||this[jit]>n)&&this.destroy(new Qit),r){let c=a(()=>{this.destroy(r.reason??new Qit)},"onAbort");r.addEventListener("abort",c),this.on("close",function(){r.removeEventListener("abort",c),r.aborted?s(r.reason??new Qit):o(null)})}else this.on("close",o);this.on("error",zxs).on("data",()=>{this[jit]>n&&this.destroy()}).resume()})}setEncoding(e){return Buffer.isEncoding(e)&&(this._readableState.encoding=e),this}};function Yxs(t){return t[VJ]?.locked===!0||t[nT]!==null}a(Yxs,"isLocked");function Kxs(t){return Z6n.isDisturbed(t)||Yxs(t)}a(Kxs,"isUnusable");function mPe(t,e){return K6n(!t[nT]),new Promise((r,n)=>{if(Kxs(t)){let o=t._readableState;o.destroyed&&o.closeEmitted===!1?t.on("error",n).on("close",()=>{n(new TypeError("unusable"))}):n(o.errored??new TypeError("unusable"))}else queueMicrotask(()=>{t[nT]={type:e,stream:t,resolve:r,reject:n,length:0,body:[]},t.on("error",function(o){$nr(this[nT],o)}).on("close",function(){this[nT].body!==null&&$nr(this[nT],new J6n)}),Jxs(t[nT])})})}a(mPe,"consume");function Jxs(t){if(t.body===null)return;let{_readableState:e}=t.stream;if(e.bufferIndex){let r=e.bufferIndex,n=e.buffer.length;for(let o=r;o2&&n[0]===239&&n[1]===187&&n[2]===191?3:0;return!r||r==="utf8"||r==="utf-8"?n.utf8Slice(s,o):n.subarray(s,o).toString(r)}a(Hnr,"chunksDecode");function z6n(t,e){if(t.length===0||e===0)return new Uint8Array(0);if(t.length===1)return new Uint8Array(t[0]);let r=new Uint8Array(Buffer.allocUnsafeSlow(e).buffer),n=0;for(let o=0;o{"use strict";p();var Zxs=require("node:assert"),{AsyncResource:Xxs}=require("node:async_hooks"),{Readable:ews}=t9n(),{InvalidArgumentError:ufe,RequestAbortedError:r9n}=ao(),Ew=ko();function gPe(){}a(gPe,"noop");var Hit=class extends Xxs{static{a(this,"RequestHandler")}constructor(e,r){if(!e||typeof e!="object")throw new ufe("invalid opts");let{signal:n,method:o,opaque:s,body:c,onInfo:l,responseHeaders:u,highWaterMark:d}=e;try{if(typeof r!="function")throw new ufe("invalid callback");if(d!=null&&(!Number.isFinite(d)||d<0))throw new ufe("invalid highWaterMark");if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new ufe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new ufe("invalid method");if(l&&typeof l!="function")throw new ufe("invalid onInfo callback");super("UNDICI_REQUEST")}catch(f){throw Ew.isStream(c)&&Ew.destroy(c.on("error",gPe),f),f}this.method=o,this.responseHeaders=u||null,this.opaque=s||null,this.callback=r,this.res=null,this.abort=null,this.body=c,this.trailers={},this.context=null,this.onInfo=l||null,this.highWaterMark=d,this.reason=null,this.removeAbortListener=null,n?.aborted?this.reason=n.reason??new r9n:n&&(this.removeAbortListener=Ew.addAbortListener(n,()=>{this.reason=n.reason??new r9n,this.res?Ew.destroy(this.res.on("error",gPe),this.reason):this.abort&&this.abort(this.reason)}))}onConnect(e,r){if(this.reason){e(this.reason);return}Zxs(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{callback:s,opaque:c,abort:l,context:u,responseHeaders:d,highWaterMark:f}=this,h=d==="raw"?Ew.parseRawHeaders(r):Ew.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:h});return}let m=d==="raw"?Ew.parseHeaders(r):h,g=m["content-type"],A=m["content-length"],y=new ews({resume:n,abort:l,contentType:g,contentLength:this.method!=="HEAD"&&A?Number(A):null,highWaterMark:f});if(this.removeAbortListener&&(y.on("close",this.removeAbortListener),this.removeAbortListener=null),this.callback=null,this.res=y,s!==null)try{this.runInAsyncScope(s,null,null,{statusCode:e,statusText:o,headers:h,trailers:this.trailers,opaque:c,body:y,context:u})}catch(E){this.res=null,Ew.destroy(y.on("error",gPe),E),queueMicrotask(()=>{throw E})}}onData(e){return this.res.push(e)}onComplete(e){Ew.parseHeaders(e,this.trailers),this.res.push(null)}onError(e){let{res:r,callback:n,body:o,opaque:s}=this;n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:s})})),r&&(this.res=null,queueMicrotask(()=>{Ew.destroy(r.on("error",gPe),e)})),o&&(this.body=null,Ew.isStream(o)&&(o.on("error",gPe),Ew.destroy(o,e))),this.removeAbortListener&&(this.removeAbortListener(),this.removeAbortListener=null)}};function n9n(t,e){if(e===void 0)return new Promise((r,n)=>{n9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Hit(t,e);this.dispatch(t,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(n9n,"request");Vnr.exports=n9n;Vnr.exports.RequestHandler=Hit});var APe=I((wXd,a9n)=>{"use strict";p();var{addAbortListener:tws}=ko(),{RequestAbortedError:rws}=ao(),dfe=Symbol("kListener"),ZO=Symbol("kSignal");function o9n(t){t.abort?t.abort(t[ZO]?.reason):t.reason=t[ZO]?.reason??new rws,s9n(t)}a(o9n,"abort");function nws(t,e){if(t.reason=null,t[ZO]=null,t[dfe]=null,!!e){if(e.aborted){o9n(t);return}t[ZO]=e,t[dfe]=()=>{o9n(t)},tws(t[ZO],t[dfe])}}a(nws,"addSignal");function s9n(t){t[ZO]&&("removeEventListener"in t[ZO]?t[ZO].removeEventListener("abort",t[dfe]):t[ZO].removeListener("abort",t[dfe]),t[ZO]=null,t[dfe]=null)}a(s9n,"removeSignal");a9n.exports={addSignal:nws,removeSignal:s9n}});var d9n=I((kXd,u9n)=>{"use strict";p();var iws=require("node:assert"),{finished:ows}=require("node:stream"),{AsyncResource:sws}=require("node:async_hooks"),{InvalidArgumentError:ffe,InvalidReturnValueError:aws}=ao(),mF=ko(),{addSignal:cws,removeSignal:c9n}=APe();function lws(){}a(lws,"noop");var Wnr=class extends sws{static{a(this,"StreamHandler")}constructor(e,r,n){if(!e||typeof e!="object")throw new ffe("invalid opts");let{signal:o,method:s,opaque:c,body:l,onInfo:u,responseHeaders:d}=e;try{if(typeof n!="function")throw new ffe("invalid callback");if(typeof r!="function")throw new ffe("invalid factory");if(o&&typeof o.on!="function"&&typeof o.addEventListener!="function")throw new ffe("signal must be an EventEmitter or EventTarget");if(s==="CONNECT")throw new ffe("invalid method");if(u&&typeof u!="function")throw new ffe("invalid onInfo callback");super("UNDICI_STREAM")}catch(f){throw mF.isStream(l)&&mF.destroy(l.on("error",lws),f),f}this.responseHeaders=d||null,this.opaque=c||null,this.factory=r,this.callback=n,this.res=null,this.abort=null,this.context=null,this.trailers=null,this.body=l,this.onInfo=u||null,mF.isStream(l)&&l.on("error",f=>{this.onError(f)}),cws(this,o)}onConnect(e,r){if(this.reason){e(this.reason);return}iws(this.callback),this.abort=e,this.context=r}onHeaders(e,r,n,o){let{factory:s,opaque:c,context:l,responseHeaders:u}=this,d=u==="raw"?mF.parseRawHeaders(r):mF.parseHeaders(r);if(e<200){this.onInfo&&this.onInfo({statusCode:e,headers:d});return}if(this.factory=null,s===null)return;let f=this.runInAsyncScope(s,null,{statusCode:e,headers:d,opaque:c,context:l});if(!f||typeof f.write!="function"||typeof f.end!="function"||typeof f.on!="function")throw new aws("expected Writable");return ows(f,{readable:!1},m=>{let{callback:g,res:A,opaque:y,trailers:E,abort:_}=this;this.res=null,(m||!A?.readable)&&mF.destroy(A,m),this.callback=null,this.runInAsyncScope(g,null,m||null,{opaque:y,trailers:E}),m&&_()}),f.on("drain",n),this.res=f,(f.writableNeedDrain!==void 0?f.writableNeedDrain:f._writableState?.needDrain)!==!0}onData(e){let{res:r}=this;return r?r.write(e):!0}onComplete(e){let{res:r}=this;c9n(this),r&&(this.trailers=mF.parseHeaders(e),r.end())}onError(e){let{res:r,callback:n,opaque:o,body:s}=this;c9n(this),this.factory=null,r?(this.res=null,mF.destroy(r,e)):n&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(n,null,e,{opaque:o})})),s&&(this.body=null,mF.destroy(s,e))}};function l9n(t,e,r){if(r===void 0)return new Promise((n,o)=>{l9n.call(this,t,e,(s,c)=>s?o(s):n(c))});try{let n=new Wnr(t,e,r);this.dispatch(t,n)}catch(n){if(typeof r!="function")throw n;let o=t?.opaque;queueMicrotask(()=>r(n,{opaque:o}))}}a(l9n,"stream");u9n.exports=l9n});var m9n=I((MXd,h9n)=>{"use strict";p();var{Readable:p9n,Duplex:uws,PassThrough:dws}=require("node:stream"),fws=require("node:assert"),{AsyncResource:pws}=require("node:async_hooks"),{InvalidArgumentError:yPe,InvalidReturnValueError:hws,RequestAbortedError:znr}=ao(),XO=ko(),{addSignal:mws,removeSignal:gws}=APe();function f9n(){}a(f9n,"noop");var pfe=Symbol("resume"),Ynr=class extends p9n{static{a(this,"PipelineRequest")}constructor(){super({autoDestroy:!0}),this[pfe]=null}_read(){let{[pfe]:e}=this;e&&(this[pfe]=null,e())}_destroy(e,r){this._read(),r(e)}},Knr=class extends p9n{static{a(this,"PipelineResponse")}constructor(e){super({autoDestroy:!0}),this[pfe]=e}_read(){this[pfe]()}_destroy(e,r){!e&&!this._readableState.endEmitted&&(e=new znr),r(e)}},Jnr=class extends pws{static{a(this,"PipelineHandler")}constructor(e,r){if(!e||typeof e!="object")throw new yPe("invalid opts");if(typeof r!="function")throw new yPe("invalid handler");let{signal:n,method:o,opaque:s,onInfo:c,responseHeaders:l}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new yPe("signal must be an EventEmitter or EventTarget");if(o==="CONNECT")throw new yPe("invalid method");if(c&&typeof c!="function")throw new yPe("invalid onInfo callback");super("UNDICI_PIPELINE"),this.opaque=s||null,this.responseHeaders=l||null,this.handler=r,this.abort=null,this.context=null,this.onInfo=c||null,this.req=new Ynr().on("error",f9n),this.ret=new uws({readableObjectMode:e.objectMode,autoDestroy:!0,read:a(()=>{let{body:u}=this;u?.resume&&u.resume()},"read"),write:a((u,d,f)=>{let{req:h}=this;h.push(u,d)||h._readableState.destroyed?f():h[pfe]=f},"write"),destroy:a((u,d)=>{let{body:f,req:h,res:m,ret:g,abort:A}=this;!u&&!g._readableState.endEmitted&&(u=new znr),A&&u&&A(),XO.destroy(f,u),XO.destroy(h,u),XO.destroy(m,u),gws(this),d(u)},"destroy")}).on("prefinish",()=>{let{req:u}=this;u.push(null)}),this.res=null,mws(this,n)}onConnect(e,r){let{res:n}=this;if(this.reason){e(this.reason);return}fws(!n,"pipeline cannot be retried"),this.abort=e,this.context=r}onHeaders(e,r,n){let{opaque:o,handler:s,context:c}=this;if(e<200){if(this.onInfo){let u=this.responseHeaders==="raw"?XO.parseRawHeaders(r):XO.parseHeaders(r);this.onInfo({statusCode:e,headers:u})}return}this.res=new Knr(n);let l;try{this.handler=null;let u=this.responseHeaders==="raw"?XO.parseRawHeaders(r):XO.parseHeaders(r);l=this.runInAsyncScope(s,null,{statusCode:e,headers:u,opaque:o,body:this.res,context:c})}catch(u){throw this.res.on("error",f9n),u}if(!l||typeof l.on!="function")throw new hws("expected Readable");l.on("data",u=>{let{ret:d,body:f}=this;!d.push(u)&&f.pause&&f.pause()}).on("error",u=>{let{ret:d}=this;XO.destroy(d,u)}).on("end",()=>{let{ret:u}=this;u.push(null)}).on("close",()=>{let{ret:u}=this;u._readableState.ended||XO.destroy(u,new znr)}),this.body=l}onData(e){let{res:r}=this;return r.push(e)}onComplete(e){let{res:r}=this;r.push(null)}onError(e){let{ret:r}=this;this.handler=null,XO.destroy(r,e)}};function Aws(t,e){try{let r=new Jnr(t,e);return this.dispatch({...t,body:r.req},r),r.ret}catch(r){return new dws().destroy(r)}}a(Aws,"pipeline");h9n.exports=Aws});var v9n=I((LXd,_9n)=>{"use strict";p();var{InvalidArgumentError:Znr,SocketError:yws}=ao(),{AsyncResource:Ews}=require("node:async_hooks"),g9n=require("node:assert"),A9n=ko(),{kHTTP2Stream:_ws}=tl(),{addSignal:vws,removeSignal:y9n}=APe(),Xnr=class extends Ews{static{a(this,"UpgradeHandler")}constructor(e,r){if(!e||typeof e!="object")throw new Znr("invalid opts");if(typeof r!="function")throw new Znr("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new Znr("signal must be an EventEmitter or EventTarget");super("UNDICI_UPGRADE"),this.responseHeaders=s||null,this.opaque=o||null,this.callback=r,this.abort=null,this.context=null,vws(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}g9n(this.callback),this.abort=e,this.context=null}onHeaders(){throw new yws("bad upgrade",null)}onUpgrade(e,r,n){g9n(n[_ws]===!0?e===200:e===101);let{callback:o,opaque:s,context:c}=this;y9n(this),this.callback=null;let l=this.responseHeaders==="raw"?A9n.parseRawHeaders(r):A9n.parseHeaders(r);this.runInAsyncScope(o,null,null,{headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;y9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function E9n(t,e){if(e===void 0)return new Promise((r,n)=>{E9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new Xnr(t,e),n={...t,method:t.method||"GET",upgrade:t.protocol||"Websocket"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(E9n,"upgrade");_9n.exports=E9n});var I9n=I((QXd,T9n)=>{"use strict";p();var Cws=require("node:assert"),{AsyncResource:bws}=require("node:async_hooks"),{InvalidArgumentError:eir,SocketError:Sws}=ao(),C9n=ko(),{addSignal:Tws,removeSignal:b9n}=APe(),tir=class extends bws{static{a(this,"ConnectHandler")}constructor(e,r){if(!e||typeof e!="object")throw new eir("invalid opts");if(typeof r!="function")throw new eir("invalid callback");let{signal:n,opaque:o,responseHeaders:s}=e;if(n&&typeof n.on!="function"&&typeof n.addEventListener!="function")throw new eir("signal must be an EventEmitter or EventTarget");super("UNDICI_CONNECT"),this.opaque=o||null,this.responseHeaders=s||null,this.callback=r,this.abort=null,Tws(this,n)}onConnect(e,r){if(this.reason){e(this.reason);return}Cws(this.callback),this.abort=e,this.context=r}onHeaders(){throw new Sws("bad connect",null)}onUpgrade(e,r,n){let{callback:o,opaque:s,context:c}=this;b9n(this),this.callback=null;let l=r;l!=null&&(l=this.responseHeaders==="raw"?C9n.parseRawHeaders(r):C9n.parseHeaders(r)),this.runInAsyncScope(o,null,null,{statusCode:e,headers:l,socket:n,opaque:s,context:c})}onError(e){let{callback:r,opaque:n}=this;b9n(this),r&&(this.callback=null,queueMicrotask(()=>{this.runInAsyncScope(r,null,e,{opaque:n})}))}};function S9n(t,e){if(e===void 0)return new Promise((r,n)=>{S9n.call(this,t,(o,s)=>o?n(o):r(s))});try{let r=new tir(t,e),n={...t,method:"CONNECT"};this.dispatch(n,r)}catch(r){if(typeof e!="function")throw r;let n=t?.opaque;queueMicrotask(()=>e(r,{opaque:n}))}}a(S9n,"connect");T9n.exports=S9n});var x9n=I((HXd,hfe)=>{"use strict";p();hfe.exports.request=i9n();hfe.exports.stream=d9n();hfe.exports.pipeline=m9n();hfe.exports.upgrade=v9n();hfe.exports.connect=I9n()});var nir=I(($Xd,R9n)=>{"use strict";p();var{UndiciError:Iws}=ao(),w9n=Symbol.for("undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED"),rir=class extends Iws{static{a(this,"MockNotMatchedError")}constructor(e){super(e),this.name="MockNotMatchedError",this.message=e||"The request does not match any registered mock dispatches",this.code="UND_MOCK_ERR_MOCK_NOT_MATCHED"}static[Symbol.hasInstance](e){return e&&e[w9n]===!0}get[w9n](){return!0}};R9n.exports={MockNotMatchedError:rir}});var WJ=I((zXd,P9n)=>{"use strict";p();P9n.exports={kAgent:Symbol("agent"),kOptions:Symbol("options"),kFactory:Symbol("factory"),kDispatches:Symbol("dispatches"),kDispatchKey:Symbol("dispatch key"),kDefaultHeaders:Symbol("default headers"),kDefaultTrailers:Symbol("default trailers"),kContentLength:Symbol("content length"),kMockAgent:Symbol("mock agent"),kMockAgentSet:Symbol("mock agent set"),kMockAgentGet:Symbol("mock agent get"),kMockDispatch:Symbol("mock dispatch"),kClose:Symbol("close"),kOriginalClose:Symbol("original agent close"),kOriginalDispatch:Symbol("original dispatch"),kOrigin:Symbol("origin"),kIsMockActive:Symbol("is mock active"),kNetConnect:Symbol("net connect"),kGetNetConnect:Symbol("get net connect"),kConnected:Symbol("connected"),kIgnoreTrailingSlash:Symbol("ignore trailing slash"),kMockAgentMockCallHistoryInstance:Symbol("mock agent mock call history name"),kMockAgentRegisterCallHistory:Symbol("mock agent register mock call history"),kMockAgentAddCallHistoryLog:Symbol("mock agent add call history log"),kMockAgentIsCallHistoryEnabled:Symbol("mock agent is call history enabled"),kMockAgentAcceptsNonStandardSearchParameters:Symbol("mock agent accepts non standard search parameters"),kMockCallHistoryAddLog:Symbol("mock call history add log"),kTotalDispatchCount:Symbol("total dispatch count")}});var EPe=I((KXd,q9n)=>{"use strict";p();var{MockNotMatchedError:mfe}=nir(),{kDispatches:zJ,kMockAgent:xws,kOriginalDispatch:wws,kOrigin:Rws,kGetNetConnect:Pws,kTotalDispatchCount:sir}=WJ(),{serializePathWithQuery:kws}=ko(),{STATUS_CODES:Dws}=require("node:http"),{types:{isPromise:Nws}}=require("node:util"),{InvalidArgumentError:iir}=ao();function e5(t,e){return typeof t=="string"?t===e:t instanceof RegExp?t.test(e):typeof t=="function"?t(e)===!0:!1}a(e5,"matchValue");function D9n(t){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e.toLocaleLowerCase(),r]))}a(D9n,"lowerCaseEntries");function N9n(t,e){if(Array.isArray(t)){for(let r=0;r"u")return!0;if(typeof e!="object"||typeof t.headers!="object")return!1;for(let[r,n]of Object.entries(t.headers)){let o=N9n(e,r);if(!e5(n,o))return!1}return!0}a(M9n,"matchHeaders");function Mws(t){if(typeof t!="string")return t;let e=new URLSearchParams(t),r=new URLSearchParams;for(let[n,o]of e.entries()){if(n=n.replace("[]",""),/^(['"]).*\1$/.test(o)){r.append(n,o);continue}if(o.includes(",")){let c=o.split(",");for(let l of c)r.append(n,l);continue}r.append(n,o)}return r}a(Mws,"normalizeSearchParams");function oir(t){if(typeof t!="string")return t;let e=t.split("?",3);if(e.length!==2)return t;let r=new URLSearchParams(e.pop());return r.sort(),[...e,r.toString()].join("?")}a(oir,"safeUrl");function Ows(t,{path:e,method:r,body:n,headers:o}){let s=e5(t.path,e),c=e5(t.method,r),l=typeof t.body<"u"?e5(t.body,n):!0,u=M9n(t,o);return s&&c&&l&&u}a(Ows,"matchKey");function O9n(t){return Buffer.isBuffer(t)||t instanceof Uint8Array||t instanceof ArrayBuffer?t:typeof t=="object"?JSON.stringify(t):t?t.toString():""}a(O9n,"getResponseData");function B9n(t,e){let r=e.query?kws(e.path,e.query):e.path,n=typeof r=="string"?oir(r):r,o=k9n(n),s=t.filter(({consumed:c})=>!c).filter(({path:c,ignoreTrailingSlash:l})=>l?e5(k9n(oir(c)),o):e5(oir(c),n));if(s.length===0)throw new mfe(`Mock dispatch not matched for path '${n}'`);if(s=s.filter(({method:c})=>e5(c,e.method)),s.length===0)throw new mfe(`Mock dispatch not matched for method '${e.method}' on path '${n}'`);if(s=s.filter(({body:c})=>typeof c<"u"?e5(c,e.body):!0),s.length===0)throw new mfe(`Mock dispatch not matched for body '${e.body}' on path '${n}'`);if(s=s.filter(c=>M9n(c,e.headers)),s.length===0){let c=typeof e.headers=="object"?JSON.stringify(e.headers):e.headers;throw new mfe(`Mock dispatch not matched for headers '${c}' on path '${n}'`)}return s[0]}a(B9n,"getMockDispatch");function Bws(t,e,r,n){let o={timesInvoked:0,times:1,persist:!1,consumed:!1,...n},s=typeof r=="function"?{callback:r}:{...r},c={...o,...e,pending:!0,data:{error:null,...s}};return t.push(c),t[sir]=(t[sir]||0)+1,c}a(Bws,"addMockDispatch");function air(t,e){let r=t.findIndex(n=>n.consumed?Ows(n,e):!1);r!==-1&&t.splice(r,1)}a(air,"deleteMockDispatch");function k9n(t){for(;t.endsWith("/");)t=t.slice(0,-1);return t.length===0&&(t="/"),t}a(k9n,"removeTrailingSlash");function L9n(t){let{path:e,method:r,body:n,headers:o,query:s}=t;return{path:e,method:r,body:n,headers:o,query:s}}a(L9n,"buildKey");function cir(t){let e=Object.keys(t),r=[];for(let n=0;n=m,n.pending=h0?A=setTimeout(()=>{A=null,E(this[zJ])},d):E(this[zJ]);function E(v,b=s){if(g)return;let T=Array.isArray(t.headers)?lir(t.headers):t.headers,w=typeof b=="function"?b({...t,headers:T}):b;if(Nws(w))return w.then(D=>E(v,D));if(g)return;let R=O9n(w),x=cir(c),P=cir(l);e.onHeaders?.(o,x,_,F9n(o)),e.onData?.(Buffer.from(R)),e.onComplete?.(P),air(v,r)}a(E,"handleReply");function _(){}return a(_,"resume"),!0}a(U9n,"mockDispatch");function Fws(){let t=this[xws],e=this[Rws],r=this[wws];return a(function(o,s){if(t.isMockActive)try{U9n.call(this,o,s)}catch(c){if(c.code==="UND_MOCK_ERR_MOCK_NOT_MATCHED"){let l=t[Pws](),u=this[zJ][sir]||this[zJ].length,f=`, ${this[zJ].filter(({consumed:h})=>!h).length} interceptor(s) remaining out of ${u} defined`;if(l===!1)throw new mfe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect disabled)${f}`);if(Q9n(l,e))r.call(this,o,s);else throw new mfe(`${c.message}: subsequent request to origin ${e} was not allowed (net.connect is not enabled for this origin)${f}`)}else throw c}else r.call(this,o,s)},"dispatch")}a(Fws,"buildMockDispatch");function Q9n(t,e){let r=new URL(e);return t===!0?!0:!!(Array.isArray(t)&&t.some(n=>e5(n,r.host)))}a(Q9n,"checkNetConnect");function Uws(t){return typeof t!="string"&&!(t instanceof URL)?t:t instanceof URL?t.origin:t.toLowerCase()}a(Uws,"normalizeOrigin");function Qws(t){let{agent:e,...r}=t;if("enableCallHistory"in r&&typeof r.enableCallHistory!="boolean")throw new iir("options.enableCallHistory must to be a boolean");if("acceptNonStandardSearchParameters"in r&&typeof r.acceptNonStandardSearchParameters!="boolean")throw new iir("options.acceptNonStandardSearchParameters must to be a boolean");if("ignoreTrailingSlash"in r&&typeof r.ignoreTrailingSlash!="boolean")throw new iir("options.ignoreTrailingSlash must to be a boolean");return r}a(Qws,"buildAndValidateMockOptions");q9n.exports={getResponseData:O9n,getMockDispatch:B9n,addMockDispatch:Bws,deleteMockDispatch:air,buildKey:L9n,generateKeyValues:cir,matchValue:e5,getResponse:Lws,getStatusText:F9n,mockDispatch:U9n,buildMockDispatch:Fws,checkNetConnect:Q9n,buildAndValidateMockOptions:Qws,getHeaderByName:N9n,buildHeadersFromArray:lir,normalizeSearchParams:Mws,normalizeOrigin:Uws}});var gir=I((XXd,mir)=>{"use strict";p();var{getResponseData:qws,buildKey:jws,addMockDispatch:uir}=EPe(),{kDispatches:Git,kDispatchKey:$it,kDefaultHeaders:dir,kDefaultTrailers:fir,kContentLength:pir,kMockDispatch:Vit,kIgnoreTrailingSlash:Wit}=WJ(),{InvalidArgumentError:t5}=ao(),{serializePathWithQuery:Hws}=ko(),gfe=class{static{a(this,"MockScope")}constructor(e){this[Vit]=e}delay(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new t5("waitInMs must be a valid integer > 0");return this[Vit].delay=e,this}persist(){return this[Vit].persist=!0,this}times(e){if(typeof e!="number"||!Number.isInteger(e)||e<=0)throw new t5("repeatTimes must be a valid integer > 0");return this[Vit].times=e,this}},hir=class{static{a(this,"MockInterceptor")}constructor(e,r){if(typeof e!="object")throw new t5("opts must be an object");if(typeof e.path>"u")throw new t5("opts.path must be defined");if(typeof e.method>"u"&&(e.method="GET"),typeof e.path=="string")if(e.query)e.path=Hws(e.path,e.query);else{let n=new URL(e.path,"data://");e.path=n.pathname+n.search}typeof e.method=="string"&&(e.method=e.method.toUpperCase()),this[$it]=jws(e),this[Git]=r,this[Wit]=e.ignoreTrailingSlash??!1,this[dir]={},this[fir]={},this[pir]=!1}createMockScopeDispatchData({statusCode:e,data:r,responseOptions:n}){let o=qws(r),s=this[pir]?{"content-length":o.length}:{},c={...this[dir],...s,...n.headers},l={...this[fir],...n.trailers};return{statusCode:e,data:r,headers:c,trailers:l}}validateReplyParameters(e){if(typeof e.statusCode>"u")throw new t5("statusCode must be defined");if(typeof e.responseOptions!="object"||e.responseOptions===null)throw new t5("responseOptions must be an object")}reply(e){if(typeof e=="function"){let s=a(l=>{let u=e(l);if(typeof u!="object"||u===null)throw new t5("reply options callback must return an object");let d={data:"",responseOptions:{},...u};return this.validateReplyParameters(d),{...this.createMockScopeDispatchData(d)}},"wrappedDefaultsCallback"),c=uir(this[Git],this[$it],s,{ignoreTrailingSlash:this[Wit]});return new gfe(c)}let r={statusCode:e,data:arguments[1]===void 0?"":arguments[1],responseOptions:arguments[2]===void 0?{}:arguments[2]};this.validateReplyParameters(r);let n=this.createMockScopeDispatchData(r),o=uir(this[Git],this[$it],n,{ignoreTrailingSlash:this[Wit]});return new gfe(o)}replyWithError(e){if(typeof e>"u")throw new t5("error must be defined");let r=uir(this[Git],this[$it],{error:e},{ignoreTrailingSlash:this[Wit]});return new gfe(r)}defaultReplyHeaders(e){if(typeof e>"u")throw new t5("headers must be defined");return this[dir]=e,this}defaultReplyTrailers(e){if(typeof e>"u")throw new t5("trailers must be defined");return this[fir]=e,this}replyContentLength(){return this[pir]=!0,this}};mir.exports.MockInterceptor=hir;mir.exports.MockScope=gfe});var _ir=I((ref,z9n)=>{"use strict";p();var{promisify:Gws}=require("node:util"),$ws=fj(),{buildMockDispatch:Vws}=EPe(),{kDispatches:Air,kMockAgent:j9n,kClose:H9n,kOriginalClose:G9n,kOrigin:$9n,kOriginalDispatch:Wws,kConnected:yir,kIgnoreTrailingSlash:V9n}=WJ(),{MockInterceptor:zws}=gir(),W9n=tl(),{InvalidArgumentError:Yws}=ao(),Eir=class extends $ws{static{a(this,"MockClient")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new Yws("Argument opts.agent must implement Agent");super(e,r),this[j9n]=r.agent,this[$9n]=e,this[V9n]=r.ignoreTrailingSlash??!1,this[Air]=[],this[yir]=1,this[Wws]=this.dispatch,this[G9n]=this.close.bind(this),this.dispatch=Vws.call(this),this.close=this[H9n]}get[W9n.kConnected](){return this[yir]}intercept(e){return new zws(e&&{ignoreTrailingSlash:this[V9n],...e},this[Air])}cleanMocks(){this[Air]=[]}async[H9n](){await Gws(this[G9n])(),this[yir]=0,this[j9n][W9n.kClients].delete(this[$9n])}};z9n.exports=Eir});var bir=I((oef,Cir)=>{"use strict";p();var{kMockCallHistoryAddLog:Kws}=WJ(),{InvalidArgumentError:vj}=ao();function Ej(t,e,r,n,o){switch(e.operator){case"OR":return n.push(...r(t,o)),n;case"AND":return r(t,n);default:throw new vj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'")}}a(Ej,"handleFilterCallsWithOptions");function Jws(t={}){let e={};if("operator"in t){if(typeof t.operator!="string"||t.operator.toUpperCase()!=="OR"&&t.operator.toUpperCase()!=="AND")throw new vj("options.operator must to be a case insensitive string equal to 'OR' or 'AND'");return{...e,operator:t.operator.toUpperCase()}}return e}a(Jws,"buildAndValidateFilterCallsOptions");function _j(t){return(e,r)=>{if(typeof e=="string"||e==null)return r.filter(n=>n[t]===e);if(e instanceof RegExp)return r.filter(n=>e.test(n[t]));throw new vj(`${t} parameter should be one of string, regexp, undefined or null`)}}a(_j,"makeFilterCalls");function Zws(t){try{let e=new URL(t.path,t.origin);return e.search.length!==0||(e.search=new URLSearchParams(t.query).toString()),e}catch(e){throw new vj("An error occurred when computing MockCallHistoryLog.url",{cause:e})}}a(Zws,"computeUrlWithMaybeSearchParameters");var zit=class{static{a(this,"MockCallHistoryLog")}constructor(e={}){this.body=e.body,this.headers=e.headers,this.method=e.method;let r=Zws(e);this.fullUrl=r.toString(),this.origin=r.origin,this.path=r.pathname,this.searchParams=Object.fromEntries(r.searchParams),this.protocol=r.protocol,this.host=r.host,this.port=r.port,this.hash=r.hash}toMap(){return new Map([["protocol",this.protocol],["host",this.host],["port",this.port],["origin",this.origin],["path",this.path],["hash",this.hash],["searchParams",this.searchParams],["fullUrl",this.fullUrl],["method",this.method],["body",this.body],["headers",this.headers]])}toString(){let e={betweenKeyValueSeparator:"->",betweenPairSeparator:"|"},r="";return this.toMap().forEach((n,o)=>{(typeof n=="string"||n===void 0||n===null)&&(r=`${r}${o}${e.betweenKeyValueSeparator}${n}${e.betweenPairSeparator}`),(typeof n=="object"&&n!==null||Array.isArray(n))&&(r=`${r}${o}${e.betweenKeyValueSeparator}${JSON.stringify(n)}${e.betweenPairSeparator}`)}),r.slice(0,-1)}},vir=class{static{a(this,"MockCallHistory")}logs=[];calls(){return this.logs}firstCall(){return this.logs.at(0)}lastCall(){return this.logs.at(-1)}nthCall(e){if(typeof e!="number")throw new vj("nthCall must be called with a number");if(!Number.isInteger(e))throw new vj("nthCall must be called with an integer");if(Math.sign(e)!==1)throw new vj("nthCall must be called with a positive value. use firstCall or lastCall instead");return this.logs.at(e-1)}filterCalls(e,r){if(this.logs.length===0)return this.logs;if(typeof e=="function")return this.logs.filter(e);if(e instanceof RegExp)return this.logs.filter(n=>e.test(n.toString()));if(typeof e=="object"&&e!==null){if(Object.keys(e).length===0)return this.logs;let n={operator:"OR",...Jws(r)},o=n.operator==="AND"?this.logs:[];return"protocol"in e&&(o=Ej(e.protocol,n,this.filterCallsByProtocol,o,this.logs)),"host"in e&&(o=Ej(e.host,n,this.filterCallsByHost,o,this.logs)),"port"in e&&(o=Ej(e.port,n,this.filterCallsByPort,o,this.logs)),"origin"in e&&(o=Ej(e.origin,n,this.filterCallsByOrigin,o,this.logs)),"path"in e&&(o=Ej(e.path,n,this.filterCallsByPath,o,this.logs)),"hash"in e&&(o=Ej(e.hash,n,this.filterCallsByHash,o,this.logs)),"fullUrl"in e&&(o=Ej(e.fullUrl,n,this.filterCallsByFullUrl,o,this.logs)),"method"in e&&(o=Ej(e.method,n,this.filterCallsByMethod,o,this.logs)),[...new Set(o)]}throw new vj("criteria parameter should be one of function, regexp, or object")}filterCallsByProtocol=_j.call(this,"protocol");filterCallsByHost=_j.call(this,"host");filterCallsByPort=_j.call(this,"port");filterCallsByOrigin=_j.call(this,"origin");filterCallsByPath=_j.call(this,"path");filterCallsByHash=_j.call(this,"hash");filterCallsByFullUrl=_j.call(this,"fullUrl");filterCallsByMethod=_j.call(this,"method");clear(){this.logs=[]}[Kws](e){let r=new zit(e);return this.logs.push(r),r}*[Symbol.iterator](){for(let e of this.calls())yield e}};Cir.exports.MockCallHistory=vir;Cir.exports.MockCallHistoryLog=zit});var xir=I((cef,tUn)=>{"use strict";p();var{promisify:Xws}=require("node:util"),eRs=FJ(),{buildMockDispatch:tRs}=EPe(),{kDispatches:Sir,kMockAgent:Y9n,kClose:K9n,kOriginalClose:J9n,kOrigin:Z9n,kOriginalDispatch:rRs,kConnected:Tir,kIgnoreTrailingSlash:X9n}=WJ(),{MockInterceptor:nRs}=gir(),eUn=tl(),{InvalidArgumentError:iRs}=ao(),Iir=class extends eRs{static{a(this,"MockPool")}constructor(e,r){if(!r||!r.agent||typeof r.agent.dispatch!="function")throw new iRs("Argument opts.agent must implement Agent");super(e,r),this[Y9n]=r.agent,this[Z9n]=e,this[X9n]=r.ignoreTrailingSlash??!1,this[Sir]=[],this[Tir]=1,this[rRs]=this.dispatch,this[J9n]=this.close.bind(this),this.dispatch=tRs.call(this),this.close=this[K9n]}get[eUn.kConnected](){return this[Tir]}intercept(e){return new nRs(e&&{ignoreTrailingSlash:this[X9n],...e},this[Sir])}cleanMocks(){this[Sir]=[]}async[K9n](){await Xws(this[J9n])(),this[Tir]=0,this[Y9n][eUn.kClients].delete(this[Z9n])}};tUn.exports=Iir});var nUn=I((fef,rUn)=>{"use strict";p();var{Transform:oRs}=require("node:stream"),{Console:sRs}=require("node:console"),aRs=process.versions.icu?"\u2705":"Y ",cRs=process.versions.icu?"\u274C":"N ";rUn.exports=class{static{a(this,"PendingInterceptorsFormatter")}constructor({disableColors:e}={}){this.transform=new oRs({transform(r,n,o){o(null,r)}}),this.logger=new sRs({stdout:this.transform,inspectOptions:{colors:!e&&!process.env.CI}})}format(e){let r=e.map(({method:n,path:o,data:{statusCode:s},persist:c,times:l,timesInvoked:u,origin:d})=>({Method:n,Origin:d,Path:o,"Status code":s,Persistent:c?aRs:cRs,Invocations:u,Remaining:c?1/0:l-u}));return this.logger.table(r),this.transform.read().toString()}}});var Dir=I((mef,uUn)=>{"use strict";p();var{kClients:YJ}=tl(),lRs=qJ(),{kAgent:wir,kMockAgentSet:Yit,kMockAgentGet:iUn,kDispatches:Rir,kIsMockActive:Kit,kNetConnect:KJ,kGetNetConnect:uRs,kOptions:Jit,kFactory:Zit,kMockAgentRegisterCallHistory:Pir,kMockAgentIsCallHistoryEnabled:_Pe,kMockAgentAddCallHistoryLog:oUn,kMockAgentMockCallHistoryInstance:Afe,kMockAgentAcceptsNonStandardSearchParameters:sUn,kMockCallHistoryAddLog:dRs,kIgnoreTrailingSlash:aUn}=WJ(),fRs=_ir(),pRs=xir(),{matchValue:hRs,normalizeSearchParams:mRs,buildAndValidateMockOptions:gRs,normalizeOrigin:cUn}=EPe(),{InvalidArgumentError:lUn,UndiciError:ARs}=ao(),yRs=LRe(),ERs=nUn(),{MockCallHistory:_Rs}=bir(),kir=class extends yRs{static{a(this,"MockAgent")}constructor(e={}){super(e);let r=gRs(e);if(this[KJ]=!0,this[Kit]=!0,this[_Pe]=r.enableCallHistory??!1,this[sUn]=r.acceptNonStandardSearchParameters??!1,this[aUn]=r.ignoreTrailingSlash??!1,e?.agent&&typeof e.agent.dispatch!="function")throw new lUn("Argument opts.agent must implement Agent");let n=e?.agent?e.agent:new lRs(e);this[wir]=n,this[YJ]=n[YJ],this[Jit]=r,this[_Pe]&&this[Pir]()}get(e){let r=cUn(e),n=this[aUn]?r.replace(/\/$/,""):r,o=this[iUn](n);return o||(o=this[Zit](n),this[Yit](n,o)),o}dispatch(e,r){e.origin=cUn(e.origin),this.get(e.origin),this[oUn](e);let n=this[sUn],o={...e};if(n&&o.path){let[s,c]=o.path.split("?"),l=mRs(c,n);o.path=`${s}?${l}`}return this[wir].dispatch(o,r)}async close(){this.clearCallHistory(),await this[wir].close(),this[YJ].clear()}deactivate(){this[Kit]=!1}activate(){this[Kit]=!0}enableNetConnect(e){if(typeof e=="string"||typeof e=="function"||e instanceof RegExp)Array.isArray(this[KJ])?this[KJ].push(e):this[KJ]=[e];else if(typeof e>"u")this[KJ]=!0;else throw new lUn("Unsupported matcher. Must be one of String|Function|RegExp.")}disableNetConnect(){this[KJ]=!1}enableCallHistory(){return this[_Pe]=!0,this}disableCallHistory(){return this[_Pe]=!1,this}getCallHistory(){return this[Afe]}clearCallHistory(){this[Afe]!==void 0&&this[Afe].clear()}get isMockActive(){return this[Kit]}[Pir](){this[Afe]===void 0&&(this[Afe]=new _Rs)}[oUn](e){this[_Pe]&&(this[Pir](),this[Afe][dRs](e))}[Yit](e,r){this[YJ].set(e,{count:0,dispatcher:r})}[Zit](e){let r=Object.assign({agent:this},this[Jit]);return this[Jit]&&this[Jit].connections===1?new fRs(e,r):new pRs(e,r)}[iUn](e){let r=this[YJ].get(e);if(r?.dispatcher)return r.dispatcher;if(typeof e!="string"){let n=this[Zit]("http://localhost:9999");return this[Yit](e,n),n}for(let[n,o]of Array.from(this[YJ]))if(o&&typeof n!="string"&&hRs(n,e)){let s=this[Zit](e);return this[Yit](e,s),s[Rir]=o.dispatcher[Rir],s}}[uRs](){return this[KJ]}pendingInterceptors(){let e=this[YJ];return Array.from(e.entries()).flatMap(([r,n])=>n.dispatcher[Rir].map(o=>({...o,origin:r}))).filter(({pending:r})=>r)}assertNoPendingInterceptors({pendingInterceptorsFormatter:e=new ERs}={}){let r=this.pendingInterceptors();if(r.length!==0)throw new ARs(r.length===1?`1 interceptor is pending: ${e.format(r)}`.trim():`${r.length} interceptors are pending: -${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p();var{InvalidArgumentError:Nks}=ao(),{runtimeFeatures:Mks}=pF();function Oks(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(Oks,"createHeaderFilters");var cUn=Mks.has("crypto")?require("node:crypto"):null,Bks=cUn?.hash?t=>cUn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function uUn(t){return Array.isArray(t)&&(t.length&1)===0}a(uUn,"isUndiciHeaders");function Lks(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(Lks,"isUrlExcludedFactory");function Fks(t){let e={};if(!t)return e;if(uUn(t)){for(let r=0;r{"use strict";p();var{writeFile:Qks,readFile:qks,mkdir:jks}=require("node:fs/promises"),{dirname:Hks,resolve:fUn}=require("node:path"),{setTimeout:Gks,clearTimeout:pUn}=require("node:timers"),{InvalidArgumentError:hUn,UndiciError:$ks}=ao(),{hashId:Vks,isUrlExcludedFactory:Wks,normalizeHeaders:mUn,createHeaderFilters:gUn}=xir();function Mke(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||mUn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:AUn(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(Mke,"formatRequestKey");function AUn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(AUn,"filterHeadersForMatching");function yUn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(yUn,"filterHeadersForStorage");function Oke(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return Vks(r)}a(Oke,"createRequestHash");var wir=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=gUn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=Wks(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=Mke(e,this.#s,this.matchOptions),o=Oke(n),s=mUn(r.headers),c={statusCode:r.statusCode,headers:yUn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=Mke(e,this.#s,this.matchOptions),n=Oke(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new hUn("Snapshot path is required");try{let n=await qks(fUn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new $ks(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new hUn("Snapshot path is required");let n=fUn(r);await jks(Hks(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await Qks(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=Mke(e,this.#s,this.matchOptions),n=Oke(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=Mke(e,this.#s,this.matchOptions),n=Oke(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(pUn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=Gks(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(pUn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};EUn.exports={SnapshotRecorder:wir,formatRequestKey:Mke,createRequestHash:Oke,filterHeadersForMatching:AUn,filterHeadersForStorage:yUn,createHeaderFilters:gUn}});var bUn=I((Wrf,vUn)=>{"use strict";p();var zks=YJ(),Yks=Iir(),{SnapshotRecorder:Kks}=_Un(),Jks=YRe(),{InvalidArgumentError:Zks,UndiciError:Xks}=ao(),{validateSnapshotMode:ePs}=xir(),rb=Symbol("kSnapshotRecorder"),u5=Symbol("kSnapshotMode"),Bke=Symbol("kSnapshotPath"),Rir=Symbol("kSnapshotLoaded"),oot=Symbol("kRealAgent"),CUn=!1,kir=class extends Yks{static{a(this,"SnapshotAgent")}constructor(e={}){CUn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),CUn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),ePs(r),(r==="playback"||r==="update")&&!n)throw new Zks(`snapshotPath is required when mode is '${r}'`);this[u5]=r,this[Bke]=n,this[rb]=new Kks({snapshotPath:this[Bke],mode:this[u5],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[Rir]=!1,(this[u5]==="record"||this[u5]==="update"||this[u5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[oot]=new zks(e)),(this[u5]==="playback"||this[u5]==="update")&&this[Bke]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=Jks.wrap(r);let n=this[u5];if(this[rb].isUrlExcluded(e))return this[oot].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Rir])return this.#e(e,r);let o=this[rb].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new Xks(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[rb].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[oot].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[rb].loadSnapshots(e||this[Bke]),this[Rir]=!0,this[u5]==="playback"&&this.#n()}async saveSnapshots(e){return this[rb].saveSnapshots(e||this[Bke])}#n(){for(let e of this[rb].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[rb]}getMode(){return this[u5]}clearSnapshots(){this[rb].clear()}resetCallCounts(){this[rb].resetCallCounts()}deleteSnapshot(e){return this[rb].deleteSnapshot(e)}getSnapshotInfo(e){return this[rb].getSnapshotInfo(e)}replaceSnapshots(e){this[rb].replaceSnapshots(e)}async close(){await this[rb].close(),await this[oot]?.close(),await super.close()}};vUn.exports=kir});var sot=I((Krf,xUn)=>{"use strict";p();var SUn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:tPs}=ao(),rPs=YJ();IUn()===void 0&&TUn(new rPs);function TUn(t){if(!t||typeof t.dispatch!="function")throw new tPs("Argument agent must implement Agent");Object.defineProperty(globalThis,SUn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(TUn,"setGlobalDispatcher");function IUn(){return globalThis[SUn]}a(IUn,"getGlobalDispatcher");var nPs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];xUn.exports={setGlobalDispatcher:TUn,getGlobalDispatcher:IUn,installedExports:nPs}});var vfe=I((enf,wUn)=>{"use strict";p();var vF=require("node:assert"),iPs=YRe();wUn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=iPs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return vF(!this.#t),vF(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return vF(!this.#t),vF(!this.#r),vF(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return vF(!this.#t),vF(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return vF(!this.#t),vF(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Mir=I((nnf,DUn)=>{"use strict";p();var nb=Do(),{kBodyUsed:Lke}=nl(),Nir=require("node:assert"),{InvalidArgumentError:Pir}=ao(),oPs=require("node:events"),sPs=[300,301,302,303,307,308],RUn=Symbol("body"),kUn=a(()=>{},"noop"),aot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[RUn]=e,this[Lke]=!1}async*[Symbol.asyncIterator](){Nir(!this[Lke],"disturbed"),this[Lke]=!0,yield*this[RUn]}},Dir=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Pir("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Pir("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],nb.isStream(this.opts.body)?(nb.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Nir(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[Lke]=!1,oPs.prototype.on.call(this.opts.body,"data",function(){this[Lke]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new aot(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&nb.isIterable(this.opts.body)&&!nb.isFormDataLike(this.opts.body)&&(this.opts.body=new aot(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",nb.isStream(this.opts.body)&&nb.destroy(this.opts.body.on("error",kUn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",nb.isStream(this.opts.body)&&nb.destroy(this.opts.body.on("error",kUn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||nb.isDisturbed(this.opts.body)||sPs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=nb.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new Pir(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=aPs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function PUn(t,e,r){if(t.length===4)return nb.headerNameToString(t)==="host";if(e&&nb.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=nb.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(PUn,"shouldRemoveHeader");function aPs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var cPs=Mir();function lPs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new cPs(e,s,l,o);return e(l,u)},"Intercept")}a(lPs,"createRedirectInterceptor");NUn.exports=lPs});var BUn=I((lnf,OUn)=>{"use strict";p();var uPs=vfe(),{ResponseError:dPs}=ao(),Oir=class extends uPs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new dPs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};OUn.exports=()=>t=>a(function(r,n){return t(r,new Oir(r,{handler:n}))},"Intercept")});var FUn=I((fnf,LUn)=>{"use strict";p();var fPs=$it();LUn.exports=t=>e=>a(function(n,o){return e(n,new fPs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var QUn=I((mnf,UUn)=>{"use strict";p();var{InvalidArgumentError:pPs,RequestAbortedError:hPs}=ao(),mPs=vfe(),Bir=class extends mPs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new pPs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new hPs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function gPs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new Bir({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(gPs,"createDumpInterceptor");UUn.exports=gPs});var GUn=I((ynf,HUn)=>{"use strict";p();var{isIP:APs}=require("node:net"),{lookup:yPs}=require("node:dns"),EPs=vfe(),{InvalidArgumentError:oZ,InformationalError:_Ps}=ao(),Lir=Math.pow(2,31)-1;function CPs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(CPs,"hasSafeIterator");function qUn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(qUn,"isHostHeader");function vPs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&CPs(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(vPs,"normalizeHeaders");function bPs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},Uir=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new Fir(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new _Ps("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){yPs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===Lir?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===Lir?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===Lir?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new Qir(this,e,r)}},Qir=class extends EPs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:jUn(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};HUn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new oZ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new oZ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new oZ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new oZ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new oZ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new oZ("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new oZ("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new Uir(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return APs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:jUn(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var bfe=I((Cnf,VUn)=>{"use strict";p();var{safeHTTPMethods:$Un,pathHasQueryOrFragment:SPs,hasSafeIterator:TPs}=Do(),{serializePathWithQuery:IPs}=Do();function xPs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!SPs(e)&&(e=IPs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(xPs,"makeCacheKey");function wPs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},TPs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(wPs,"normalizeHeaders");function RPs(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(RPs,"assertCacheKey");function kPs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(kPs,"assertCacheValue");function PPs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function LPs(t){switch(t[3]){case",":return FPs(t);case" ":return UPs(t);default:return QPs(t)}}a(LPs,"parseHttpDate");function FPs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(FPs,"parseImfDate");function UPs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(UPs,"parseAscTimeDate");function QPs(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(QPs,"parseRfc850Date");WUn.exports={parseHttpDate:LPs}});var ZUn=I((xnf,JUn)=>{"use strict";p();var qPs=Do(),{parseCacheControlHeader:jPs,parseVaryHeader:HPs,isEtagUsable:GPs}=bfe(),{parseHttpDate:YUn}=zUn();function $Ps(){}a($Ps,"noop");var KUn=[200,203,204,206,300,301,308,404,405,410,414,501],VPs=[206],WPs=2147483647e3,qir=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!qPs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.($Ps)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&KUn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?jPs(l):{};if(!zPs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?YPs(n.age):void 0;if(h&&h>=WPs)return s();let m=typeof n.date=="string"?YUn(n.date):void 0,g=KPs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=HPs(n.vary,this.#e.headers),!E))return s();let _=JPs(A,d,y),v=ZPs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),k=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{k()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),k()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&GPs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function zPs(t,e,r,n,o){return!(e<200||VPs.includes(e)||!KUn.includes(e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(zPs,"canCacheResponse");function YPs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(YPs,"getAge");function KPs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=YUn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(XPs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(KPs,"determineStaleAt");function JPs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(JPs,"determineDeleteAt");function ZPs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)t[o]&&(n??={...t},delete n[o]);return n??t}a(ZPs,"stripNecessaryHeaders");function XPs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(XPs,"isValidDate");JUn.exports=qir});var Hir=I((knf,t7n)=>{"use strict";p();var{Writable:e2s}=require("node:stream"),{EventEmitter:t2s}=require("node:events"),{assertCacheKey:XUn,assertCacheValue:r2s}=bfe(),jir=class extends t2s{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){XUn(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?e7n(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){XUn(e),r2s(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new e2s({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=e7n(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(e7n,"findEntry");t7n.exports=jir});var n7n=I((Nnf,r7n)=>{"use strict";p();var n2s=require("node:assert"),Gir=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(n2s(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};r7n.exports=Gir});var a7n=I((Bnf,s7n)=>{"use strict";p();var i7n=require("node:assert"),{Readable:i2s}=require("node:stream"),Sfe=Do(),Fke=ZUn(),o2s=Hir(),s2s=n7n(),{assertCacheStore:a2s,assertCacheMethods:c2s,makeCacheKey:l2s,normalizeHeaders:u2s,parseCacheControlHeader:d2s}=bfe(),{AbortError:f2s}=ao();function p2s(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function h2s(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(h2s,"needsRevalidation");function m2s(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(m2s,"isStale");function g2s(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(g2s,"withinStaleWhileRevalidateWindow");function A2s(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],Vir,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new Fke(e,r,n))}a(A2s,"handleUncachedResponse");function $ir(t,e,r,n,o,s){let c=Sfe.isStream(r.body)?r.body:i2s.from(r.body??[]);i7n(!c.destroyed,"stream should not be destroyed"),i7n(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new f2s)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a($ir,"sendCachedValue");function o7n(t,e,r,n,o,s,c){if(!c)return A2s(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new Fke(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=m2s(c,s),f=h2s(c,s,o);if(d||f){if(Sfe.isStream(o.body)&&Sfe.bodyLength(o.body)!==0)return t(o,new Fke(e,r,n));if(!f&&g2s(c))return $ir(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new Fke(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?$ir(n,o,c,u,y,d):Sfe.isStream(c.body)&&c.body.on("error",Vir).destroy()},new Fke(e,r,n),h))}Sfe.isStream(o.body)&&o.body.on("error",Vir).destroy(),$ir(n,o,c,u,null,!1)}a(o7n,"handleResult");s7n.exports=(t={})=>{let{store:e=new o2s,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(a2s(e,"opts.store"),c2s(r,"opts.methods"),p2s(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=Sfe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;Eo7n(u,c,m,f,d,h,A)):o7n(u,c,m,f,d,h,g)}}});var f7n=I((Unf,d7n)=>{"use strict";p();var{createInflate:Wir,createGunzip:c7n,createBrotliDecompress:y2s,createZstdDecompress:E2s}=require("node:zlib"),{pipeline:_2s}=require("node:stream"),C2s=vfe(),{runtimeFeatures:v2s}=pF(),l7n={gzip:c7n,"x-gzip":c7n,br:y2s,deflate:Wir,compress:Wir,"x-compress":Wir,...v2s.has("zstd")?{zstd:E2s}:{}},b2s=[204,304],u7n=!1,zir=class extends C2s{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=b2s,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!l7n[c])return o.length=0,o;o.push(l7n[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),_2s(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function S2s(t={}){return u7n||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),u7n=!0),e=>(r,n)=>{let o=new zir(n,t);return e(r,o)}}a(S2s,"createDecompressInterceptor");d7n.exports=S2s});var m7n=I((jnf,h7n)=>{"use strict";p();var{RequestAbortedError:T2s}=ao(),p7n=5*1024*1024,Yir=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=p7n;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=p7n){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#C(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new T2s(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#C(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#C(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};h7n.exports=Yir});var A7n=I(($nf,g7n)=>{"use strict";p();var I2s=require("node:diagnostics_channel"),x2s=Do(),w2s=m7n(),{normalizeHeaders:R2s,makeCacheKey:k2s,makeDeduplicationKey:P2s}=bfe(),cot=I2s.channel("undici:request:pending-requests");g7n.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!x2s.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:R2s(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=k2s(d),m=P2s(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new w2s(f,()=>{l.delete(m),cot.hasSubscribers&&cot.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),cot.hasSubscribers&&cot.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var _7n=I((znf,E7n)=>{"use strict";p();var{Writable:D2s}=require("node:stream"),{assertCacheKey:Kir,assertCacheValue:N2s}=bfe(),Jir,uT=3,y7n=2*1e3*1e3*1e3;E7n.exports=class{static{a(this,"SqliteCacheStore")}#e=y7n;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>y7n)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}Jir||(Jir=require("node:sqlite").DatabaseSync),this.#r=new Jir(e?.location??":memory:"),this.#r.exec(` +${e.format(r)}`.trim())}};uUn.exports=kir});var Nir=I((yef,hUn)=>{"use strict";p();var{InvalidArgumentError:vRs}=ao(),{runtimeFeatures:CRs}=aF();function bRs(t={}){let{ignoreHeaders:e=[],excludeHeaders:r=[],matchHeaders:n=[],caseSensitive:o=!1}=t;return{ignore:new Set(e.map(s=>o?s:s.toLowerCase())),exclude:new Set(r.map(s=>o?s:s.toLowerCase())),match:new Set(n.map(s=>o?s:s.toLowerCase()))}}a(bRs,"createHeaderFilters");var dUn=CRs.has("crypto")?require("node:crypto"):null,SRs=dUn?.hash?t=>dUn.hash("sha256",t,"base64url"):t=>Buffer.from(t).toString("base64url");function pUn(t){return Array.isArray(t)&&(t.length&1)===0}a(pUn,"isUndiciHeaders");function TRs(t=[]){return t.length===0?()=>!1:a(function(r){let n;for(let o of t)if(typeof o=="string"){if(n||(n=r.toLowerCase()),n.includes(o.toLowerCase()))return!0}else if(o instanceof RegExp&&o.test(r))return!0;return!1},"isUrlExcluded")}a(TRs,"isUrlExcludedFactory");function IRs(t){let e={};if(!t)return e;if(pUn(t)){for(let r=0;r{"use strict";p();var{writeFile:wRs,readFile:RRs,mkdir:PRs}=require("node:fs/promises"),{dirname:kRs,resolve:mUn}=require("node:path"),{setTimeout:DRs,clearTimeout:gUn}=require("node:timers"),{InvalidArgumentError:AUn,UndiciError:NRs}=ao(),{hashId:MRs,isUrlExcludedFactory:ORs,normalizeHeaders:yUn,createHeaderFilters:EUn}=Nir();function vPe(t,e,r={}){let n=new URL(t.path,t.origin),o=t._normalizedHeaders||yUn(t.headers);return t._normalizedHeaders||(t._normalizedHeaders=o),{method:t.method||"GET",url:r.matchQuery!==!1?n.toString():`${n.origin}${n.pathname}`,headers:_Un(o,e,r),body:r.matchBody!==!1&&t.body?String(t.body):""}}a(vPe,"formatRequestKey");function _Un(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{ignore:s,exclude:c,match:l}=e;for(let[u,d]of Object.entries(t)){let f=n?u:u.toLowerCase();c.has(f)||s.has(f)||l.size!==0&&!l.has(f)||(o[f]=d)}return o}a(_Un,"filterHeadersForMatching");function vUn(t,e,r={}){if(!t||typeof t!="object")return{};let{caseSensitive:n=!1}=r,o={},{exclude:s}=e;for(let[c,l]of Object.entries(t)){let u=n?c:c.toLowerCase();s.has(u)||(o[u]=l)}return o}a(vUn,"filterHeadersForStorage");function CPe(t){let e=[t.method,t.url];if(t.headers&&typeof t.headers=="object"){let n=Object.keys(t.headers).sort();for(let o of n){let s=Array.isArray(t.headers[o])?t.headers[o]:[t.headers[o]];e.push(o);for(let c of s.sort())e.push(String(c))}}e.push(t.body);let r=e.join("|");return MRs(r)}a(CPe,"createRequestHash");var Mir=class{static{a(this,"SnapshotRecorder")}#e;#t;#r=new Map;#n;#i=1/0;#o=!1;#s;constructor(e={}){this.#n=e.snapshotPath,this.#i=e.maxSnapshots||1/0,this.#o=e.autoFlush||!1,this.flushInterval=e.flushInterval||3e4,this._flushTimer=null,this.matchOptions={matchHeaders:e.matchHeaders||[],ignoreHeaders:e.ignoreHeaders||[],excludeHeaders:e.excludeHeaders||[],matchBody:e.matchBody!==!1,matchQuery:e.matchQuery!==!1,caseSensitive:e.caseSensitive||!1},this.#s=EUn(this.matchOptions),this.shouldRecord=e.shouldRecord||(()=>!0),this.shouldPlayback=e.shouldPlayback||(()=>!0),this.#t=ORs(e.excludeUrls),this.#o&&this.#n&&this.#a()}async record(e,r){if(!this.shouldRecord(e)||this.isUrlExcluded(e))return;let n=vPe(e,this.#s,this.matchOptions),o=CPe(n),s=yUn(r.headers),c={statusCode:r.statusCode,headers:vUn(s,this.#s,this.matchOptions),body:Buffer.isBuffer(r.body)?r.body.toString("base64"):Buffer.from(String(r.body||"")).toString("base64"),trailers:r.trailers};if(this.#r.size>=this.#i&&!this.#r.has(o)){let u=this.#r.keys().next().value;this.#r.delete(u)}let l=this.#r.get(o);l&&l.responses?(l.responses.push(c),l.timestamp=new Date().toISOString()):this.#r.set(o,{request:n,responses:[c],callCount:0,timestamp:new Date().toISOString()}),this.#o&&this.#n&&this.#u()}isUrlExcluded(e){let r=new URL(e.path,e.origin).toString();return this.#t(r)}findSnapshot(e){if(!this.shouldPlayback(e)||this.isUrlExcluded(e))return;let r=vPe(e,this.#s,this.matchOptions),n=CPe(r),o=this.#r.get(n);if(!o)return;let s=o.callCount||0,c=Math.min(s,o.responses.length-1);return o.callCount=s+1,{...o,response:o.responses[c]}}async loadSnapshots(e){let r=e||this.#n;if(!r)throw new AUn("Snapshot path is required");try{let n=await RRs(mUn(r),"utf8"),o=JSON.parse(n);if(Array.isArray(o)){this.#r.clear();for(let{hash:s,snapshot:c}of o)this.#r.set(s,c)}else this.#r=new Map(Object.entries(o))}catch(n){if(n.code==="ENOENT")this.#r.clear();else throw new NRs(`Failed to load snapshots from ${r}`,{cause:n})}}async saveSnapshots(e){let r=e||this.#n;if(!r)throw new AUn("Snapshot path is required");let n=mUn(r);await PRs(kRs(n),{recursive:!0});let o=Array.from(this.#r.entries()).map(([s,c])=>({hash:s,snapshot:c}));await wRs(n,JSON.stringify(o,null,2),{flush:!0})}clear(){this.#r.clear()}getSnapshots(){return Array.from(this.#r.values())}size(){return this.#r.size}resetCallCounts(){for(let e of this.#r.values())e.callCount=0}deleteSnapshot(e){let r=vPe(e,this.#s,this.matchOptions),n=CPe(r);return this.#r.delete(n)}getSnapshotInfo(e){let r=vPe(e,this.#s,this.matchOptions),n=CPe(r),o=this.#r.get(n);return o?{hash:n,request:o.request,responseCount:o.responses?o.responses.length:o.response?1:0,callCount:o.callCount||0,timestamp:o.timestamp}:null}replaceSnapshots(e){if(this.#r.clear(),Array.isArray(e))for(let{hash:r,snapshot:n}of e)this.#r.set(r,n);else e&&typeof e=="object"&&(this.#r=new Map(Object.entries(e)))}#a(){return this.#u()}#c(){this.#e&&(gUn(this.#e),this.saveSnapshots().catch(()=>{}),this.#e=null)}#u(){this.#e=DRs(()=>{this.saveSnapshots().catch(()=>{}),this.#o?this.#e?.refresh():this.#e=null},1e3)}destroy(){this.#c(),this.#e&&(gUn(this.#e),this.#e=null)}async close(){this.#n&&this.#r.size!==0&&await this.saveSnapshots(),this.destroy()}};CUn.exports={SnapshotRecorder:Mir,formatRequestKey:vPe,createRequestHash:CPe,filterHeadersForMatching:_Un,filterHeadersForStorage:vUn,createHeaderFilters:EUn}});var IUn=I((Sef,TUn)=>{"use strict";p();var BRs=qJ(),LRs=Dir(),{SnapshotRecorder:FRs}=bUn(),URs=BRe(),{InvalidArgumentError:QRs,UndiciError:qRs}=ao(),{validateSnapshotMode:jRs}=Nir(),JC=Symbol("kSnapshotRecorder"),r5=Symbol("kSnapshotMode"),bPe=Symbol("kSnapshotPath"),Oir=Symbol("kSnapshotLoaded"),Xit=Symbol("kRealAgent"),SUn=!1,Bir=class extends LRs{static{a(this,"SnapshotAgent")}constructor(e={}){SUn||(process.emitWarning("SnapshotAgent is experimental and subject to change","ExperimentalWarning"),SUn=!0);let{mode:r="record",snapshotPath:n=null,...o}=e;if(super(o),jRs(r),(r==="playback"||r==="update")&&!n)throw new QRs(`snapshotPath is required when mode is '${r}'`);this[r5]=r,this[bPe]=n,this[JC]=new FRs({snapshotPath:this[bPe],mode:this[r5],maxSnapshots:e.maxSnapshots,autoFlush:e.autoFlush,flushInterval:e.flushInterval,matchHeaders:e.matchHeaders,ignoreHeaders:e.ignoreHeaders,excludeHeaders:e.excludeHeaders,matchBody:e.matchBody,matchQuery:e.matchQuery,caseSensitive:e.caseSensitive,shouldRecord:e.shouldRecord,shouldPlayback:e.shouldPlayback,excludeUrls:e.excludeUrls}),this[Oir]=!1,(this[r5]==="record"||this[r5]==="update"||this[r5]==="playback"&&e.excludeUrls&&e.excludeUrls.length>0)&&(this[Xit]=new BRs(e)),(this[r5]==="playback"||this[r5]==="update")&&this[bPe]&&this.loadSnapshots().catch(()=>{})}dispatch(e,r){r=URs.wrap(r);let n=this[r5];if(this[JC].isUrlExcluded(e))return this[Xit].dispatch(e,r);if(n==="playback"||n==="update"){if(!this[Oir])return this.#e(e,r);let o=this[JC].findSnapshot(e);if(o)return this.#r(o,r);if(n==="update")return this.#t(e,r);{let s=new qRs(`No snapshot found for ${e.method||"GET"} ${e.path}`);if(r.onError){r.onError(s);return}throw s}}else if(n==="record")return this.#t(e,r)}async#e(e,r){return await this.loadSnapshots(),this.dispatch(e,r)}#t(e,r){let n={statusCode:null,headers:{},trailers:{},body:[]},o=this,s={onRequestStart(l,u){return r.onRequestStart(l,{...u,history:this.history})},onRequestUpgrade(l,u,d,f){return r.onRequestUpgrade(l,u,d,f)},onResponseStart(l,u,d,f){return n.statusCode=u,n.headers=d,r.onResponseStart(l,u,d,f)},onResponseData(l,u){return n.body.push(u),r.onResponseData(l,u)},onResponseEnd(l,u){n.trailers=u;let d=Buffer.concat(n.body);o[JC].record(e,{statusCode:n.statusCode,headers:n.headers,body:d,trailers:n.trailers}).then(()=>r.onResponseEnd(l,u)).catch(f=>r.onResponseError(l,f))}};return this[Xit].dispatch(e,s)}#r(e,r){try{let{response:n}=e,o={pause(){},resume(){},abort(c){this.aborted=!0,this.reason=c},aborted:!1,paused:!1};r.onRequestStart(o),r.onResponseStart(o,n.statusCode,n.headers);let s=Buffer.from(n.body,"base64");r.onResponseData(o,s),r.onResponseEnd(o,n.trailers)}catch(n){r.onError?.(n)}}async loadSnapshots(e){await this[JC].loadSnapshots(e||this[bPe]),this[Oir]=!0,this[r5]==="playback"&&this.#n()}async saveSnapshots(e){return this[JC].saveSnapshots(e||this[bPe])}#n(){for(let e of this[JC].getSnapshots()){let{request:r,responses:n,response:o}=e,s=new URL(r.url),c=this.get(s.origin),l=n?n[0]:o;l&&c.intercept({path:s.pathname+s.search,method:r.method,headers:r.headers,body:r.body}).reply(l.statusCode,l.body,{headers:l.headers,trailers:l.trailers}).persist()}}getRecorder(){return this[JC]}getMode(){return this[r5]}clearSnapshots(){this[JC].clear()}resetCallCounts(){this[JC].resetCallCounts()}deleteSnapshot(e){return this[JC].deleteSnapshot(e)}getSnapshotInfo(e){return this[JC].getSnapshotInfo(e)}replaceSnapshots(e){this[JC].replaceSnapshots(e)}async close(){await this[JC].close(),await this[Xit]?.close(),await super.close()}};TUn.exports=Bir});var eot=I((xef,PUn)=>{"use strict";p();var xUn=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:HRs}=ao(),GRs=qJ();RUn()===void 0&&wUn(new GRs);function wUn(t){if(!t||typeof t.dispatch!="function")throw new HRs("Argument agent must implement Agent");Object.defineProperty(globalThis,xUn,{value:t,writable:!0,enumerable:!1,configurable:!1})}a(wUn,"setGlobalDispatcher");function RUn(){return globalThis[xUn]}a(RUn,"getGlobalDispatcher");var $Rs=["fetch","Headers","Response","Request","FormData","WebSocket","CloseEvent","ErrorEvent","MessageEvent","EventSource"];PUn.exports={setGlobalDispatcher:wUn,getGlobalDispatcher:RUn,installedExports:$Rs}});var yfe=I((kef,kUn)=>{"use strict";p();var gF=require("node:assert"),VRs=BRe();kUn.exports=class{static{a(this,"DecoratorHandler")}#e;#t=!1;#r=!1;#n=!1;constructor(e){if(typeof e!="object"||e===null)throw new TypeError("handler must be an object");this.#e=VRs.wrap(e)}onRequestStart(...e){this.#e.onRequestStart?.(...e)}onRequestUpgrade(...e){return gF(!this.#t),gF(!this.#r),this.#e.onRequestUpgrade?.(...e)}onResponseStart(...e){return gF(!this.#t),gF(!this.#r),gF(!this.#n),this.#n=!0,this.#e.onResponseStart?.(...e)}onResponseData(...e){return gF(!this.#t),gF(!this.#r),this.#e.onResponseData?.(...e)}onResponseEnd(...e){return gF(!this.#t),gF(!this.#r),this.#t=!0,this.#e.onResponseEnd?.(...e)}onResponseError(...e){return this.#r=!0,this.#e.onResponseError?.(...e)}onBodySent(){}}});var Qir=I((Mef,OUn)=>{"use strict";p();var ZC=ko(),{kBodyUsed:SPe}=tl(),Uir=require("node:assert"),{InvalidArgumentError:Lir}=ao(),WRs=require("node:events"),zRs=[300,301,302,303,307,308],DUn=Symbol("body"),NUn=a(()=>{},"noop"),tot=class{static{a(this,"BodyAsyncIterable")}constructor(e){this[DUn]=e,this[SPe]=!1}async*[Symbol.asyncIterator](){Uir(!this[SPe],"disturbed"),this[SPe]=!0,yield*this[DUn]}},Fir=class t{static{a(this,"RedirectHandler")}static buildDispatch(e,r){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Lir("maxRedirections must be a positive number");let n=e.dispatch.bind(e);return(o,s)=>n(o,new t(n,r,o,s))}constructor(e,r,n,o){if(r!=null&&(!Number.isInteger(r)||r<0))throw new Lir("maxRedirections must be a positive number");this.dispatch=e,this.location=null;let{maxRedirections:s,...c}=n;this.opts=c,this.maxRedirections=r,this.handler=o,this.history=[],ZC.isStream(this.opts.body)?(ZC.bodyLength(this.opts.body)===0&&this.opts.body.on("data",function(){Uir(!1)}),typeof this.opts.body.readableDidRead!="boolean"&&(this.opts.body[SPe]=!1,WRs.prototype.on.call(this.opts.body,"data",function(){this[SPe]=!0}))):this.opts.body&&typeof this.opts.body.pipeTo=="function"?this.opts.body=new tot(this.opts.body):this.opts.body&&typeof this.opts.body!="string"&&!ArrayBuffer.isView(this.opts.body)&&ZC.isIterable(this.opts.body)&&!ZC.isFormDataLike(this.opts.body)&&(this.opts.body=new tot(this.opts.body))}onRequestStart(e,r){this.handler.onRequestStart?.(e,{...r,history:this.history})}onRequestUpgrade(e,r,n,o){this.handler.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if(this.opts.throwOnMaxRedirect&&this.history.length>=this.maxRedirections)throw new Error("max redirects");if((r===301||r===302)&&this.opts.method==="POST"&&(this.opts.method="GET",ZC.isStream(this.opts.body)&&ZC.destroy(this.opts.body.on("error",NUn)),this.opts.body=null),r===303&&this.opts.method!=="HEAD"&&(this.opts.method="GET",ZC.isStream(this.opts.body)&&ZC.destroy(this.opts.body.on("error",NUn)),this.opts.body=null),this.location=this.history.length>=this.maxRedirections||ZC.isDisturbed(this.opts.body)||zRs.indexOf(r)===-1?null:n.location,this.opts.origin&&this.history.push(new URL(this.opts.path,this.opts.origin)),!this.location){this.handler.onResponseStart?.(e,r,n,o);return}let{origin:s,pathname:c,search:l}=ZC.parseURL(new URL(this.location,this.opts.origin&&new URL(this.opts.path,this.opts.origin))),u=l?`${c}${l}`:c,d=`${s}${u}`;for(let f of this.history)if(f.toString()===d)throw new Lir(`Redirect loop detected. Cannot redirect to ${s}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);this.opts.headers=YRs(this.opts.headers,r===303,this.opts.origin!==s),this.opts.path=u,this.opts.origin=s,this.opts.query=null}onResponseData(e,r){this.location||this.handler.onResponseData?.(e,r)}onResponseEnd(e,r){this.location?this.dispatch(this.opts,this):this.handler.onResponseEnd(e,r)}onResponseError(e,r){this.handler.onResponseError?.(e,r)}};function MUn(t,e,r){if(t.length===4)return ZC.headerNameToString(t)==="host";if(e&&ZC.headerNameToString(t).startsWith("content-"))return!0;if(r&&(t.length===13||t.length===6||t.length===19)){let n=ZC.headerNameToString(t);return n==="authorization"||n==="cookie"||n==="proxy-authorization"}return!1}a(MUn,"shouldRemoveHeader");function YRs(t,e,r){let n=[];if(Array.isArray(t))for(let o=0;o{"use strict";p();var KRs=Qir();function JRs({maxRedirections:t}={}){return e=>a(function(n,o){let{maxRedirections:s=t,...c}=n;if(s==null||s===0)return e(n,o);let l={...c},u=new KRs(e,s,l,o);return e(l,u)},"Intercept")}a(JRs,"createRedirectInterceptor");BUn.exports=JRs});var UUn=I((Qef,FUn)=>{"use strict";p();var ZRs=yfe(),{ResponseError:XRs}=ao(),qir=class extends ZRs{static{a(this,"ResponseErrorHandler")}#e;#t;#r;#n;#i;constructor(e,{handler:r}){super(r)}#o(e){return(this.#t??"").indexOf(e)===0}onRequestStart(e,r){return this.#e=0,this.#t=null,this.#r=null,this.#n=null,this.#i="",super.onRequestStart(e,r)}onResponseStart(e,r,n,o){if(this.#e=r,this.#n=n,this.#t=n["content-type"],this.#e<400)return super.onResponseStart(e,r,n,o);(this.#o("application/json")||this.#o("text/plain"))&&(this.#r=new TextDecoder("utf-8"))}onResponseData(e,r){if(this.#e<400)return super.onResponseData(e,r);this.#i+=this.#r?.decode(r,{stream:!0})??""}onResponseEnd(e,r){if(this.#e>=400){if(this.#i+=this.#r?.decode(void 0,{stream:!1})??"",this.#o("application/json"))try{this.#i=JSON.parse(this.#i)}catch{}let n,o=Error.stackTraceLimit;Error.stackTraceLimit=0;try{n=new XRs("Response Error",this.#e,{body:this.#i,headers:this.#n})}finally{Error.stackTraceLimit=o}super.onResponseError(e,n)}else super.onResponseEnd(e,r)}onResponseError(e,r){super.onResponseError(e,r)}};FUn.exports=()=>t=>a(function(r,n){return t(r,new qir(r,{handler:n}))},"Intercept")});var qUn=I((Hef,QUn)=>{"use strict";p();var ePs=Uit();QUn.exports=t=>e=>a(function(n,o){return e(n,new ePs({...n,retryOptions:{...t,...n.retryOptions}},{handler:o,dispatch:e}))},"retryInterceptor")});var HUn=I((Vef,jUn)=>{"use strict";p();var{InvalidArgumentError:tPs,RequestAbortedError:rPs}=ao(),nPs=yfe(),jir=class extends nPs{static{a(this,"DumpHandler")}#e=1024*1024;#t=!1;#r=0;#n=null;aborted=!1;reason=!1;constructor({maxSize:e,signal:r},n){if(e!=null&&(!Number.isFinite(e)||e<1))throw new tPs("maxSize must be a number greater than 0");super(n),this.#e=e??this.#e}#i(e){this.aborted=!0,this.reason=e}onRequestStart(e,r){return e.abort=this.#i.bind(this),this.#n=e,super.onRequestStart(e,r)}onResponseStart(e,r,n,o){let s=n["content-length"];if(s!=null&&s>this.#e)throw new rPs(`Response size (${s}) larger than maxSize (${this.#e})`);return this.aborted===!0?!0:super.onResponseStart(e,r,n,o)}onResponseError(e,r){this.#t||(r=this.#n?.reason??r,super.onResponseError(e,r))}onResponseData(e,r){return this.#r=this.#r+r.length,this.#r>=this.#e&&(this.#t=!0,this.aborted===!0?super.onResponseError(e,this.reason):super.onResponseEnd(e,{})),!0}onResponseEnd(e,r){if(!this.#t){if(this.#n.aborted===!0){super.onResponseError(e,this.reason);return}super.onResponseEnd(e,r)}}};function iPs({maxSize:t}={maxSize:1024*1024}){return e=>a(function(n,o){let{dumpMaxSize:s=t}=n,c=new jir({maxSize:s,signal:n.signal},o);return e(n,c)},"Intercept")}a(iPs,"createDumpInterceptor");jUn.exports=iPs});var WUn=I((Yef,VUn)=>{"use strict";p();var{isIP:oPs}=require("node:net"),{lookup:sPs}=require("node:dns"),aPs=yfe(),{InvalidArgumentError:JJ,InformationalError:cPs}=ao(),Hir=Math.pow(2,31)-1;function lPs(t){let e=Object.getPrototypeOf(t);return Object.prototype.hasOwnProperty.call(t,Symbol.iterator)||e!=null&&e!==Object.prototype&&typeof t[Symbol.iterator]=="function"}a(lPs,"hasSafeIterator");function GUn(t){return typeof t=="string"&&t.toLowerCase()==="host"}a(GUn,"isHostHeader");function uPs(t){if(t==null)return null;if(Array.isArray(t)){if(t.length===0||!Array.isArray(t[0]))return t;let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}if(typeof t=="object"&&lPs(t)){let e=[];for(let r of t)Array.isArray(r)&&r.length===2?e.push(r[0],r[1]):e.push(r);return e}return t}a(uPs,"normalizeHeaders");function dPs(t){if(t==null)return!1;if(Array.isArray(t)){if(t.length===0)return!1;for(let e=0;e=this.#e}},$ir=class{static{a(this,"DNSInstance")}#e=0;#t=0;dualStack=!0;affinity=null;lookup=null;pick=null;storage=null;constructor(e){this.#e=e.maxTTL,this.#t=e.maxItems,this.dualStack=e.dualStack,this.affinity=e.affinity,this.lookup=e.lookup??this.#r,this.pick=e.pick??this.#n,this.storage=e.storage??new Gir(e)}runLookup(e,r,n){let o=this.storage.get(e.hostname);if(o==null&&this.storage.full()){n(null,e);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...r.dns,maxTTL:this.#e,maxItems:this.#t};if(o==null)this.lookup(e,s,(c,l)=>{if(c||l==null||l.length===0){n(c??new cPs("No DNS entries found"));return}this.setRecords(e,l);let u=this.storage.get(e.hostname),d=this.pick(e,u,s.affinity),f;typeof d.port=="number"?f=`:${d.port}`:e.port!==""?f=`:${e.port}`:f="",n(null,new URL(`${e.protocol}//${d.family===6?`[${d.address}]`:d.address}${f}`))});else{let c=this.pick(e,o,s.affinity);if(c==null){this.storage.delete(e.hostname),this.runLookup(e,r,n);return}let l;typeof c.port=="number"?l=`:${c.port}`:e.port!==""?l=`:${e.port}`:l="",n(null,new URL(`${e.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`))}}#r(e,r,n){sPs(e.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(o,s)=>{if(o)return n(o);let c=new Map;for(let l of s)c.set(`${l.address}:${l.family}`,l);n(null,c.values())})}#n(e,r,n){let o=null,{records:s,offset:c}=r,l;if(this.dualStack?(n==null&&(c==null||c===Hir?(r.offset=0,n=4):(r.offset++,n=(r.offset&1)===1?6:4)),s[n]!=null&&s[n].ips.length>0?l=s[n]:l=s[n===4?6:4]):l=s[n],l==null||l.ips.length===0)return o;l.offset==null||l.offset===Hir?l.offset=0:l.offset++;let u=l.offset%l.ips.length;return o=l.ips[u]??null,o==null?o:Date.now()-o.timestamp>o.ttl?(l.ips.splice(u,1),this.pick(e,r,n)):o}pickFamily(e,r){let n=this.storage.get(e.hostname)?.records;if(!n)return null;let o=n[r];if(!o)return null;o.offset==null||o.offset===Hir?o.offset=0:o.offset++;let s=o.offset%o.ips.length,c=o.ips[s]??null;return c==null||Date.now()-c.timestamp>c.ttl&&o.ips.splice(s,1),c}setRecords(e,r){let n=Date.now(),o={records:{4:null,6:null}},s=this.#e;for(let c of r){c.timestamp=n,typeof c.ttl=="number"?(c.ttl=Math.min(c.ttl,this.#e),s=Math.min(s,c.ttl)):c.ttl=this.#e;let l=o.records[c.family]??{ips:[]};l.ips.push(c),o.records[c.family]=l}this.storage.set(e.hostname,o,{ttl:s})}deleteRecords(e){this.storage.delete(e.hostname)}getHandler(e,r){return new Vir(this,e,r)}},Vir=class extends aPs{static{a(this,"DNSDispatchHandler")}#e=null;#t=null;#r=null;#n=null;#i=null;#o=null;#s=!0;constructor(e,{origin:r,handler:n,dispatch:o,newOrigin:s},c){super(n),this.#n=r,this.#o=s,this.#t={...c},this.#e=e,this.#r=o}onResponseError(e,r){switch(r.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){if(!this.#s){super.onResponseError(e,r);return}this.#s=!1;let n=this.#o.hostname[0]==="["?4:6,o=this.#e.pickFamily(this.#n,n);if(o==null){super.onResponseError(e,r);return}let s;typeof o.port=="number"?s=`:${o.port}`:this.#n.port!==""?s=`:${this.#n.port}`:s="";let c={...this.#t,origin:`${this.#n.protocol}//${o.family===6?`[${o.address}]`:o.address}${s}`,headers:$Un(this.#n.host,this.#t.headers)};this.#r(c,this);return}super.onResponseError(e,r);break}case"ENOTFOUND":this.#e.deleteRecords(this.#n),super.onResponseError(e,r);break;default:super.onResponseError(e,r);break}}};VUn.exports=t=>{if(t?.maxTTL!=null&&(typeof t?.maxTTL!="number"||t?.maxTTL<0))throw new JJ("Invalid maxTTL. Must be a positive number");if(t?.maxItems!=null&&(typeof t?.maxItems!="number"||t?.maxItems<1))throw new JJ("Invalid maxItems. Must be a positive number and greater than zero");if(t?.affinity!=null&&t?.affinity!==4&&t?.affinity!==6)throw new JJ("Invalid affinity. Must be either 4 or 6");if(t?.dualStack!=null&&typeof t?.dualStack!="boolean")throw new JJ("Invalid dualStack. Must be a boolean");if(t?.lookup!=null&&typeof t?.lookup!="function")throw new JJ("Invalid lookup. Must be a function");if(t?.pick!=null&&typeof t?.pick!="function")throw new JJ("Invalid pick. Must be a function");if(t?.storage!=null&&(typeof t?.storage?.get!="function"||typeof t?.storage?.set!="function"||typeof t?.storage?.full!="function"||typeof t?.storage?.delete!="function"))throw new JJ("Invalid storage. Must be a object with methods: { get, set, full, delete }");let e=t?.dualStack??!0,r;e?r=t?.affinity??null:r=t?.affinity??4;let n={maxTTL:t?.maxTTL??1e4,lookup:t?.lookup??null,pick:t?.pick??null,dualStack:e,affinity:r,maxItems:t?.maxItems??1/0,storage:t?.storage},o=new $ir(n);return s=>a(function(l,u){let d=l.origin.constructor===URL?l.origin:new URL(l.origin);return oPs(d.hostname)!==0?s(l,u):(o.runLookup(d,l,(f,h)=>{if(f)return u.onResponseError(null,f);let m={...l,servername:d.hostname,origin:h.origin,headers:$Un(d.host,l.headers)};s(m,o.getHandler({origin:d,dispatch:s,handler:u,newOrigin:h},l))}),!0)},"dnsInterceptor")}});var Efe=I((Zef,YUn)=>{"use strict";p();var{safeHTTPMethods:zUn,pathHasQueryOrFragment:fPs,hasSafeIterator:pPs}=ko(),{serializePathWithQuery:hPs}=ko();function mPs(t){if(!t.origin)throw new Error("opts.origin is undefined");let e=t.path||"/";return t.query&&!fPs(e)&&(e=hPs(e,t.query)),{origin:t.origin.toString(),method:t.method,path:e,headers:t.headers}}a(mPs,"makeCacheKey");function gPs(t){let e;if(t.headers==null)e={};else if(typeof t.headers=="object")if(e={},pPs(t.headers))for(let r of t.headers){if(!Array.isArray(r))throw new Error("opts.headers is not a valid header map");let[n,o]=r;if(typeof n!="string"||typeof o!="string")throw new Error("opts.headers is not a valid header map");e[n.toLowerCase()]=o}else for(let r of Object.keys(t.headers))e[r.toLowerCase()]=t.headers[r];else throw new Error("opts.headers is not an object");return e}a(gPs,"normalizeHeaders");function APs(t){if(typeof t!="object")throw new TypeError(`expected key to be object, got ${typeof t}`);for(let e of["origin","method","path"])if(typeof t[e]!="string")throw new TypeError(`expected key.${e} to be string, got ${typeof t[e]}`);if(t.headers!==void 0&&typeof t.headers!="object")throw new TypeError(`expected headers to be object, got ${typeof t}`)}a(APs,"assertCacheKey");function yPs(t){if(typeof t!="object")throw new TypeError(`expected value to be object, got ${typeof t}`);for(let e of["statusCode","cachedAt","staleAt","deleteAt"])if(typeof t[e]!="number")throw new TypeError(`expected value.${e} to be number, got ${typeof t[e]}`);if(typeof t.statusMessage!="string")throw new TypeError(`expected value.statusMessage to be string, got ${typeof t.statusMessage}`);if(t.headers!=null&&typeof t.headers!="object")throw new TypeError(`expected value.rawHeaders to be object, got ${typeof t.headers}`);if(t.vary!==void 0&&typeof t.vary!="object")throw new TypeError(`expected value.vary to be object, got ${typeof t.vary}`);if(t.etag!==void 0&&typeof t.etag!="string")throw new TypeError(`expected value.etag to be string, got ${typeof t.etag}`)}a(yPs,"assertCacheValue");function EPs(t){let e={},r;if(Array.isArray(t)){r=[];for(let n of t)r.push(...n.split(","))}else r=t.split(",");for(let n=0;n=2&&l[0]==='"'&&l[l.length-1]==='"'&&(l=l.substring(1,l.length-1));let u=parseInt(l,10);if(u!==u||c==="max-age"&&c in e&&e[c]>=u)continue;e[c]=u;break}case"private":case"no-cache":if(l){if(l[0]==='"'){let u=[l.substring(1)],d=l[l.length-1]==='"';if(!d)for(let f=n+1;f{"use strict";p();function TPs(t){switch(t[3]){case",":return IPs(t);case" ":return xPs(t);default:return wPs(t)}}a(TPs,"parseHttpDate");function IPs(t){if(t.length!==29||t[4]!==" "||t[7]!==" "||t[11]!==" "||t[16]!==" "||t[19]!==":"||t[22]!==":"||t[25]!==" "||t[26]!=="G"||t[27]!=="M"||t[28]!=="T")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=0;if(t[5]==="0"){let g=t.charCodeAt(6);if(g<49||g>57)return;r=g-48}else{let g=t.charCodeAt(5);if(g<49||g>51)return;let A=t.charCodeAt(6);if(A<48||A>57)return;r=(g-48)*10+(A-48)}let n=-1;if(t[8]==="J"&&t[9]==="a"&&t[10]==="n")n=0;else if(t[8]==="F"&&t[9]==="e"&&t[10]==="b")n=1;else if(t[8]==="M"&&t[9]==="a")if(t[10]==="r")n=2;else if(t[10]==="y")n=4;else return;else if(t[8]==="J")if(t[9]==="a"&&t[10]==="n")n=0;else if(t[9]==="u")if(t[10]==="n")n=5;else if(t[10]==="l")n=6;else return;else return;else if(t[8]==="A")if(t[9]==="p"&&t[10]==="r")n=3;else if(t[9]==="u"&&t[10]==="g")n=7;else return;else if(t[8]==="S"&&t[9]==="e"&&t[10]==="p")n=8;else if(t[8]==="O"&&t[9]==="c"&&t[10]==="t")n=9;else if(t[8]==="N"&&t[9]==="o"&&t[10]==="v")n=10;else if(t[8]==="D"&&t[9]==="e"&&t[10]==="c")n=11;else return;let o=t.charCodeAt(12);if(o<48||o>57)return;let s=t.charCodeAt(13);if(s<48||s>57)return;let c=t.charCodeAt(14);if(c<48||c>57)return;let l=t.charCodeAt(15);if(l<48||l>57)return;let u=(o-48)*1e3+(s-48)*100+(c-48)*10+(l-48),d=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;d=g-48}else{let g=t.charCodeAt(17);if(g<48||g>50)return;let A=t.charCodeAt(18);if(A<48||A>57||g===50&&A>51)return;d=(g-48)*10+(A-48)}let f=0;if(t[20]==="0"){let g=t.charCodeAt(21);if(g<48||g>57)return;f=g-48}else{let g=t.charCodeAt(20);if(g<48||g>53)return;let A=t.charCodeAt(21);if(A<48||A>57)return;f=(g-48)*10+(A-48)}let h=0;if(t[23]==="0"){let g=t.charCodeAt(24);if(g<48||g>57)return;h=g-48}else{let g=t.charCodeAt(23);if(g<48||g>53)return;let A=t.charCodeAt(24);if(A<48||A>57)return;h=(g-48)*10+(A-48)}let m=new Date(Date.UTC(u,n,r,d,f,h));return m.getUTCDay()===e?m:void 0}a(IPs,"parseImfDate");function xPs(t){if(t.length!==24||t[7]!==" "||t[10]!==" "||t[19]!==" ")return;let e=-1;if(t[0]==="S"&&t[1]==="u"&&t[2]==="n")e=0;else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n")e=1;else if(t[0]==="T"&&t[1]==="u"&&t[2]==="e")e=2;else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d")e=3;else if(t[0]==="T"&&t[1]==="h"&&t[2]==="u")e=4;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i")e=5;else if(t[0]==="S"&&t[1]==="a"&&t[2]==="t")e=6;else return;let r=-1;if(t[4]==="J"&&t[5]==="a"&&t[6]==="n")r=0;else if(t[4]==="F"&&t[5]==="e"&&t[6]==="b")r=1;else if(t[4]==="M"&&t[5]==="a")if(t[6]==="r")r=2;else if(t[6]==="y")r=4;else return;else if(t[4]==="J")if(t[5]==="a"&&t[6]==="n")r=0;else if(t[5]==="u")if(t[6]==="n")r=5;else if(t[6]==="l")r=6;else return;else return;else if(t[4]==="A")if(t[5]==="p"&&t[6]==="r")r=3;else if(t[5]==="u"&&t[6]==="g")r=7;else return;else if(t[4]==="S"&&t[5]==="e"&&t[6]==="p")r=8;else if(t[4]==="O"&&t[5]==="c"&&t[6]==="t")r=9;else if(t[4]==="N"&&t[5]==="o"&&t[6]==="v")r=10;else if(t[4]==="D"&&t[5]==="e"&&t[6]==="c")r=11;else return;let n=0;if(t[8]===" "){let g=t.charCodeAt(9);if(g<49||g>57)return;n=g-48}else{let g=t.charCodeAt(8);if(g<49||g>51)return;let A=t.charCodeAt(9);if(A<48||A>57)return;n=(g-48)*10+(A-48)}let o=0;if(t[11]==="0"){let g=t.charCodeAt(12);if(g<48||g>57)return;o=g-48}else{let g=t.charCodeAt(11);if(g<48||g>50)return;let A=t.charCodeAt(12);if(A<48||A>57||g===50&&A>51)return;o=(g-48)*10+(A-48)}let s=0;if(t[14]==="0"){let g=t.charCodeAt(15);if(g<48||g>57)return;s=g-48}else{let g=t.charCodeAt(14);if(g<48||g>53)return;let A=t.charCodeAt(15);if(A<48||A>57)return;s=(g-48)*10+(A-48)}let c=0;if(t[17]==="0"){let g=t.charCodeAt(18);if(g<48||g>57)return;c=g-48}else{let g=t.charCodeAt(17);if(g<48||g>53)return;let A=t.charCodeAt(18);if(A<48||A>57)return;c=(g-48)*10+(A-48)}let l=t.charCodeAt(20);if(l<48||l>57)return;let u=t.charCodeAt(21);if(u<48||u>57)return;let d=t.charCodeAt(22);if(d<48||d>57)return;let f=t.charCodeAt(23);if(f<48||f>57)return;let h=(l-48)*1e3+(u-48)*100+(d-48)*10+(f-48),m=new Date(Date.UTC(h,r,n,o,s,c));return m.getUTCDay()===e?m:void 0}a(xPs,"parseAscTimeDate");function wPs(t){let e=-1,r=-1;if(t[0]==="S")t[1]==="u"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y"?(r=0,e=6):t[1]==="a"&&t[2]==="t"&&t[3]==="u"&&t[4]==="r"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=6,e=8);else if(t[0]==="M"&&t[1]==="o"&&t[2]==="n"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=1,e=6;else if(t[0]==="T")t[1]==="u"&&t[2]==="e"&&t[3]==="s"&&t[4]==="d"&&t[5]==="a"&&t[6]==="y"?(r=2,e=7):t[1]==="h"&&t[2]==="u"&&t[3]==="r"&&t[4]==="s"&&t[5]==="d"&&t[6]==="a"&&t[7]==="y"&&(r=4,e=8);else if(t[0]==="W"&&t[1]==="e"&&t[2]==="d"&&t[3]==="n"&&t[4]==="e"&&t[5]==="s"&&t[6]==="d"&&t[7]==="a"&&t[8]==="y")r=3,e=9;else if(t[0]==="F"&&t[1]==="r"&&t[2]==="i"&&t[3]==="d"&&t[4]==="a"&&t[5]==="y")r=5,e=6;else return;if(t[e]!==","||t.length-e-1!==23||t[e+1]!==" "||t[e+4]!=="-"||t[e+8]!=="-"||t[e+11]!==" "||t[e+14]!==":"||t[e+17]!==":"||t[e+20]!==" "||t[e+21]!=="G"||t[e+22]!=="M"||t[e+23]!=="T")return;let n=0;if(t[e+2]==="0"){let m=t.charCodeAt(e+3);if(m<49||m>57)return;n=m-48}else{let m=t.charCodeAt(e+2);if(m<49||m>51)return;let g=t.charCodeAt(e+3);if(g<48||g>57)return;n=(m-48)*10+(g-48)}let o=-1;if(t[e+5]==="J"&&t[e+6]==="a"&&t[e+7]==="n")o=0;else if(t[e+5]==="F"&&t[e+6]==="e"&&t[e+7]==="b")o=1;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="r")o=2;else if(t[e+5]==="A"&&t[e+6]==="p"&&t[e+7]==="r")o=3;else if(t[e+5]==="M"&&t[e+6]==="a"&&t[e+7]==="y")o=4;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="n")o=5;else if(t[e+5]==="J"&&t[e+6]==="u"&&t[e+7]==="l")o=6;else if(t[e+5]==="A"&&t[e+6]==="u"&&t[e+7]==="g")o=7;else if(t[e+5]==="S"&&t[e+6]==="e"&&t[e+7]==="p")o=8;else if(t[e+5]==="O"&&t[e+6]==="c"&&t[e+7]==="t")o=9;else if(t[e+5]==="N"&&t[e+6]==="o"&&t[e+7]==="v")o=10;else if(t[e+5]==="D"&&t[e+6]==="e"&&t[e+7]==="c")o=11;else return;let s=t.charCodeAt(e+9);if(s<48||s>57)return;let c=t.charCodeAt(e+10);if(c<48||c>57)return;let l=(s-48)*10+(c-48);l+=l<70?2e3:1900;let u=0;if(t[e+12]==="0"){let m=t.charCodeAt(e+13);if(m<48||m>57)return;u=m-48}else{let m=t.charCodeAt(e+12);if(m<48||m>50)return;let g=t.charCodeAt(e+13);if(g<48||g>57||m===50&&g>51)return;u=(m-48)*10+(g-48)}let d=0;if(t[e+15]==="0"){let m=t.charCodeAt(e+16);if(m<48||m>57)return;d=m-48}else{let m=t.charCodeAt(e+15);if(m<48||m>53)return;let g=t.charCodeAt(e+16);if(g<48||g>57)return;d=(m-48)*10+(g-48)}let f=0;if(t[e+18]==="0"){let m=t.charCodeAt(e+19);if(m<48||m>57)return;f=m-48}else{let m=t.charCodeAt(e+18);if(m<48||m>53)return;let g=t.charCodeAt(e+19);if(g<48||g>57)return;f=(m-48)*10+(g-48)}let h=new Date(Date.UTC(l,o,n,u,d,f));return h.getUTCDay()===r?h:void 0}a(wPs,"parseRfc850Date");KUn.exports={parseHttpDate:TPs}});var t7n=I((itf,e7n)=>{"use strict";p();var RPs=ko(),{parseCacheControlHeader:PPs,parseVaryHeader:kPs,isEtagUsable:DPs}=Efe(),{parseHttpDate:ZUn}=JUn();function NPs(){}a(NPs,"noop");var XUn=[200,203,204,206,300,301,308,404,405,410,414,501],MPs=[206],OPs=2147483647e3,Wir=class{static{a(this,"CacheHandler")}#e;#t;#r;#n;#i;#o;constructor({store:e,type:r,cacheByDefault:n},o,s){this.#n=e,this.#t=r,this.#r=n,this.#e=o,this.#i=s}onRequestStart(e,r){this.#o?.destroy(),this.#o=void 0,this.#i.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#i.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){let s=a(()=>this.#i.onResponseStart?.(e,r,n,o),"downstreamOnHeaders"),c=this;if(!RPs.safeHTTPMethods.includes(this.#e.method)&&r>=200&&r<=399){try{this.#n.delete(this.#e)?.catch?.(NPs)}catch{}return s()}let l=n["cache-control"],u=n["last-modified"]&&XUn.includes(r);if(!l&&!n.expires&&!u&&!this.#r)return s();let d=l?PPs(l):{};if(!BPs(this.#t,r,n,d,this.#e.headers))return s();let f=Date.now(),h=n.age?LPs(n.age):void 0;if(h&&h>=OPs)return s();let m=typeof n.date=="string"?ZUn(n.date):void 0,g=FPs(this.#t,f,h,n,m,d)??this.#r;if(g===void 0||h&&h>g)return s();let A=m?m.getTime():f,y=g+A;if(f>=y)return s();let E;if(this.#e.headers&&n.vary&&(E=kPs(n.vary,this.#e.headers),!E))return s();let _=UPs(A,d,y),v=QPs(n,d),b={statusCode:r,statusMessage:o,headers:v,vary:E,cacheControlDirectives:d,cachedAt:h?f-h:f,staleAt:y,deleteAt:_};if(r===304){let T=a(R=>{if(!R)return s();if(b.statusCode=R.statusCode,b.statusMessage=R.statusMessage,b.etag=R.etag,b.headers={...R.headers,...v},s(),this.#o=this.#n.createWriteStream(this.#e,b),!(!this.#o||!R?.body))if(typeof R.body.values=="function"){let x=R.body.values(),P=a(()=>{for(let D of x){let N=this.#o.write(D)===!1;if(this.#i.onResponseData?.(e,D),N)break}},"streamCachedBody");this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("drain",()=>{P()}).on("close",function(){c.#o===this&&(c.#o=void 0)}),P()}else typeof R.body.on=="function"&&(R.body.on("data",x=>{this.#o.write(x),this.#i.onResponseData?.(e,x)}).on("end",()=>{this.#o.end()}).on("error",()=>{this.#o=void 0,this.#n.delete(this.#e)}),this.#o.on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0)}))},"handle304"),w=this.#n.get(this.#e);w&&typeof w.then=="function"?w.then(T):T(w)}else{if(typeof n.etag=="string"&&DPs(n.etag)&&(b.etag=n.etag),this.#o=this.#n.createWriteStream(this.#e,b),!this.#o)return s();this.#o.on("drain",()=>e.resume()).on("error",function(){c.#o=void 0,c.#n.delete(c.#e)}).on("close",function(){c.#o===this&&(c.#o=void 0),e.resume()}),s()}}onResponseData(e,r){this.#o?.write(r)===!1&&e.pause(),this.#i.onResponseData?.(e,r)}onResponseEnd(e,r){this.#o?.end(),this.#i.onResponseEnd?.(e,r)}onResponseError(e,r){this.#o?.destroy(r),this.#o=void 0,this.#i.onResponseError?.(e,r)}};function BPs(t,e,r,n,o){return!(e<200||MPs.includes(e)||!XUn.includes(e)&&!r.expires&&!n.public&&n["max-age"]===void 0&&!(n.private&&t==="private")&&!(n["s-maxage"]!==void 0&&t==="shared")||n["no-store"]||t==="shared"&&n.private===!0||r.vary?.includes("*")||o?.authorization&&(!n.public&&!n["s-maxage"]&&!n["must-revalidate"]||typeof o.authorization!="string"||Array.isArray(n["no-cache"])&&n["no-cache"].includes("authorization")||Array.isArray(n.private)&&n.private.includes("authorization")))}a(BPs,"canCacheResponse");function LPs(t){let e=parseInt(Array.isArray(t)?t[0]:t);return isNaN(e)?void 0:e*1e3}a(LPs,"getAge");function FPs(t,e,r,n,o,s){if(t==="shared"){let l=s["s-maxage"];if(l!==void 0)return l>0?l*1e3:void 0}let c=s["max-age"];if(c!==void 0)return c>0?c*1e3:void 0;if(typeof n.expires=="string"){let l=ZUn(n.expires);if(l)return e>=l.getTime()||o&&(o>=l||r!==void 0&&r>l-o)?void 0:l.getTime()-e}if(typeof n["last-modified"]=="string"){let l=new Date(n["last-modified"]);if(qPs(l))return l.getTime()>=e?void 0:(e-l.getTime())*.1}if(s.immutable)return 31536e3}a(FPs,"determineStaleAt");function UPs(t,e,r){let n=-1/0,o=-1/0,s=-1/0;if(e["stale-while-revalidate"]&&(n=r+e["stale-while-revalidate"]*1e3),e["stale-if-error"]&&(o=r+e["stale-if-error"]*1e3),e.immutable&&n===-1/0&&o===-1/0&&(s=t+31536e6),n===-1/0&&o===-1/0&&s===-1/0){let c=r-t;return r+c}return Math.max(r,n,o,s)}a(UPs,"determineDeleteAt");function QPs(t,e){let r=["connection","proxy-authenticate","proxy-authentication-info","proxy-authorization","proxy-connection","te","transfer-encoding","upgrade","age"];t.connection&&(Array.isArray(t.connection)?r.push(...t.connection.map(o=>o.trim())):r.push(...t.connection.split(",").map(o=>o.trim()))),Array.isArray(e["no-cache"])&&r.push(...e["no-cache"]),Array.isArray(e.private)&&r.push(...e.private);let n;for(let o of r)t[o]&&(n??={...t},delete n[o]);return n??t}a(QPs,"stripNecessaryHeaders");function qPs(t){return t instanceof Date&&Number.isFinite(t.valueOf())}a(qPs,"isValidDate");e7n.exports=Wir});var Yir=I((atf,i7n)=>{"use strict";p();var{Writable:jPs}=require("node:stream"),{EventEmitter:HPs}=require("node:events"),{assertCacheKey:r7n,assertCacheValue:GPs}=Efe(),zir=class extends HPs{static{a(this,"MemoryCacheStore")}#e=1024;#t=104857600;#r=5242880;#n=0;#i=0;#o=new Map;#s=!1;constructor(e){if(super(),e){if(typeof e!="object")throw new TypeError("MemoryCacheStore options must be an object");if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("MemoryCacheStore options.maxCount must be a non-negative integer");this.#e=e.maxCount}if(e.maxSize!==void 0){if(typeof e.maxSize!="number"||!Number.isInteger(e.maxSize)||e.maxSize<0)throw new TypeError("MemoryCacheStore options.maxSize must be a non-negative integer");this.#t=e.maxSize}if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("MemoryCacheStore options.maxEntrySize must be a non-negative integer");this.#r=e.maxEntrySize}}}get size(){return this.#n}isFull(){return this.#n>=this.#t||this.#i>=this.#e}get(e){r7n(e);let r=`${e.origin}:${e.path}`,n=Date.now(),o=this.#o.get(r),s=o?n7n(e,o,n):null;return s==null?void 0:{statusMessage:s.statusMessage,statusCode:s.statusCode,headers:s.headers,body:s.body,vary:s.vary?s.vary:void 0,etag:s.etag,cacheControlDirectives:s.cacheControlDirectives,cachedAt:s.cachedAt,staleAt:s.staleAt,deleteAt:s.deleteAt}}createWriteStream(e,r){r7n(e),GPs(r);let n=`${e.origin}:${e.path}`,o=this,s={...e,...r,body:[],size:0};return new jPs({write(c,l,u){typeof c=="string"&&(c=Buffer.from(c,l)),s.size+=c.byteLength,s.size>=o.#r?this.destroy():s.body.push(c),u(null)},final(c){let l=o.#o.get(n);l||(l=[],o.#o.set(n,l));let u=n7n(e,l,Date.now());if(u){let d=l.indexOf(u);l.splice(d,1,s),o.#n-=u.size}else l.push(s),o.#i+=1;if(o.#n+=s.size,o.#n>o.#t||o.#i>o.#e){o.#s||(o.emit("maxSizeExceeded",{size:o.#n,maxSize:o.#t,count:o.#i,maxCount:o.#e}),o.#s=!0);for(let[d,f]of o.#o){for(let h of f.splice(0,f.length/2))o.#n-=h.size,o.#i-=1;f.length===0&&o.#o.delete(d)}o.#nn.deleteAt>r&&n.method===t.method&&(n.vary==null||Object.keys(n.vary).every(o=>n.vary[o]===null?t.headers[o]===void 0:n.vary[o]===t.headers[o])))}a(n7n,"findEntry");i7n.exports=zir});var s7n=I((utf,o7n)=>{"use strict";p();var $Ps=require("node:assert"),Kir=class{static{a(this,"CacheRevalidationHandler")}#e=!1;#t;#r;#n;#i;constructor(e,r,n){if(typeof e!="function")throw new TypeError("callback must be a function");this.#t=e,this.#r=r,this.#i=n}onRequestStart(e,r){this.#e=!1,this.#n=r}onRequestUpgrade(e,r,n,o){this.#r.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){if($Ps(this.#t!=null),this.#e=r===304||this.#i&&r>=500&&r<=504,this.#t(this.#e,this.#n),this.#t=null,this.#e)return!0;this.#r.onRequestStart?.(e,this.#n),this.#r.onResponseStart?.(e,r,n,o)}onResponseData(e,r){if(!this.#e)return this.#r.onResponseData?.(e,r)}onResponseEnd(e,r){this.#e||this.#r.onResponseEnd?.(e,r)}onResponseError(e,r){if(!this.#e)if(this.#t&&(this.#t(!1),this.#t=null),typeof this.#r.onResponseError=="function")this.#r.onResponseError(e,r);else throw r}};o7n.exports=Kir});var u7n=I((ptf,l7n)=>{"use strict";p();var a7n=require("node:assert"),{Readable:VPs}=require("node:stream"),_fe=ko(),TPe=t7n(),WPs=Yir(),zPs=s7n(),{assertCacheStore:YPs,assertCacheMethods:KPs,makeCacheKey:JPs,normalizeHeaders:ZPs,parseCacheControlHeader:XPs}=Efe(),{AbortError:eks}=ao();function tks(t,e){if(t!==void 0){if(!Array.isArray(t))throw new TypeError(`expected ${e} to be an array or undefined, got ${typeof t}`);for(let r=0;r{},"nop");function rks(t,e,{headers:r={}}){return!!(e?.["no-cache"]||t.cacheControlDirectives?.["no-cache"]&&!Array.isArray(t.cacheControlDirectives["no-cache"])||r["if-modified-since"]||r["if-none-match"])}a(rks,"needsRevalidation");function nks(t,e){let r=Date.now();if(r>t.staleAt){if(e?.["max-stale"]){let n=t.staleAt+e["max-stale"]*1e3;return r>n}return!0}if(e?.["min-fresh"]){let n=t.staleAt-r,o=e["min-fresh"]*1e3;return n<=o}return!1}a(nks,"isStale");function iks(t){let e=t.cacheControlDirectives?.["stale-while-revalidate"];if(!e)return!1;let r=Date.now(),n=t.staleAt+e*1e3;return r<=n}a(iks,"withinStaleWhileRevalidateWindow");function oks(t,e,r,n,o,s){if(s?.["only-if-cached"]){let c=!1;try{if(typeof n.onConnect=="function"&&(n.onConnect(()=>{c=!0}),c)||typeof n.onHeaders=="function"&&(n.onHeaders(504,[],Zir,"Gateway Timeout"),c))return;typeof n.onComplete=="function"&&n.onComplete([])}catch(l){typeof n.onError=="function"&&n.onError(l)}return!0}return t(o,new TPe(e,r,n))}a(oks,"handleUncachedResponse");function Jir(t,e,r,n,o,s){let c=_fe.isStream(r.body)?r.body:VPs.from(r.body??[]);a7n(!c.destroyed,"stream should not be destroyed"),a7n(!c.readableDidRead,"stream should not be readableDidRead");let l={resume(){c.resume()},pause(){c.pause()},get paused(){return c.isPaused()},get aborted(){return c.destroyed},get reason(){return c.errored},abort(d){c.destroy(d??new eks)}};if(c.on("error",function(d){if(!this.readableEnded)if(typeof t.onResponseError=="function")t.onResponseError(l,d);else throw d}).on("close",function(){this.errored||t.onResponseEnd?.(l,{})}),t.onRequestStart?.(l,o),c.destroyed)return;let u={...r.headers,age:String(n)};s&&(u.warning='110 - "response is stale"'),t.onResponseStart?.(l,r.statusCode,u,r.statusMessage),e.method==="HEAD"?c.destroy():c.on("data",function(d){t.onResponseData?.(l,d)})}a(Jir,"sendCachedValue");function c7n(t,e,r,n,o,s,c){if(!c)return oks(t,e,r,n,o,s);let l=Date.now();if(l>c.deleteAt)return t(o,new TPe(e,r,n));let u=Math.round((l-c.cachedAt)/1e3);if(s?.["max-age"]&&u>=s["max-age"])return t(o,n);let d=nks(c,s),f=rks(c,s,o);if(d||f){if(_fe.isStream(o.body)&&_fe.bodyLength(o.body)!==0)return t(o,new TPe(e,r,n));if(!f&&iks(c))return Jir(n,o,c,u,null,!0),queueMicrotask(()=>{let A={...o.headers,"if-modified-since":new Date(c.cachedAt).toUTCString()};if(c.etag&&(A["if-none-match"]=c.etag),c.vary)for(let y in c.vary)c.vary[y]!=null&&(A[y]=c.vary[y]);t({...o,headers:A},new TPe(e,r,{onRequestStart(){},onRequestUpgrade(){},onResponseStart(){},onResponseData(){},onResponseEnd(){},onResponseError(){}}))}),!0;let h=!1,m=c.cacheControlDirectives["stale-if-error"]??s?.["stale-if-error"];m&&(h=l{A?Jir(n,o,c,u,y,d):_fe.isStream(c.body)&&c.body.on("error",Zir).destroy()},new TPe(e,r,n),h))}_fe.isStream(o.body)&&o.body.on("error",Zir).destroy(),Jir(n,o,c,u,null,!1)}a(c7n,"handleResult");l7n.exports=(t={})=>{let{store:e=new WPs,methods:r=["GET"],cacheByDefault:n=void 0,type:o="shared",origins:s=void 0}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(YPs(e,"opts.store"),KPs(r,"opts.methods"),tks(s,"opts.origins"),typeof n<"u"&&typeof n!="number")throw new TypeError(`expected opts.cacheByDefault to be number or undefined, got ${typeof n}`);if(typeof o<"u"&&o!=="shared"&&o!=="private")throw new TypeError(`expected opts.type to be shared, private, or undefined, got ${typeof o}`);let c={store:e,methods:r,cacheByDefault:n,type:o},l=_fe.safeHTTPMethods.filter(u=>r.includes(u)===!1);return u=>(d,f)=>{if(!d.origin||l.includes(d.method))return u(d,f);if(s!==void 0){let A=d.origin.toString().toLowerCase(),y=!1;for(let E=0;Ec7n(u,c,m,f,d,h,A)):c7n(u,c,m,f,d,h,g)}}});var m7n=I((gtf,h7n)=>{"use strict";p();var{createInflate:Xir,createGunzip:d7n,createBrotliDecompress:sks,createZstdDecompress:aks}=require("node:zlib"),{pipeline:cks}=require("node:stream"),lks=yfe(),{runtimeFeatures:uks}=aF(),f7n={gzip:d7n,"x-gzip":d7n,br:sks,deflate:Xir,compress:Xir,"x-compress":Xir,...uks.has("zstd")?{zstd:aks}:{}},dks=[204,304],p7n=!1,eor=class extends lks{static{a(this,"DecompressHandler")}#e=[];#t;#r;constructor(e,{skipStatusCodes:r=dks,skipErrorResponses:n=!0}={}){super(e),this.#t=r,this.#r=n}#n(e,r){return!!(!e||r<200||this.#t.includes(r)||this.#r&&r>=400)}#i(e){let r=e.split(","),n=5;if(r.length>n)throw new Error(`too many content-encodings in response: ${r.length}, maximum allowed is ${n}`);let o=[];for(let s=r.length-1;s>=0;s--){let c=r[s].trim();if(c){if(!f7n[c])return o.length=0,o;o.push(f7n[c]())}}return o}#o(e,r){e.on("readable",()=>{let n;for(;(n=e.read())!==null&&super.onResponseData(r,n)!==!1;);}),e.on("error",n=>{super.onResponseError(r,n)})}#s(e){let r=this.#e[0];this.#o(r,e),r.on("end",()=>{super.onResponseEnd(e,{})})}#a(e){let r=this.#e[this.#e.length-1];this.#o(r,e),cks(this.#e,n=>{if(n){super.onResponseError(e,n);return}super.onResponseEnd(e,{})})}#c(){this.#e.length=0}onResponseStart(e,r,n,o){let s=n["content-encoding"];if(this.#n(s,r))return super.onResponseStart(e,r,n,o);let c=this.#i(s.toLowerCase());if(c.length===0)return this.#c(),super.onResponseStart(e,r,n,o);this.#e=c;let{"content-encoding":l,"content-length":u,...d}=n;return this.#e.length===1?this.#s(e):this.#a(e),super.onResponseStart(e,r,d,o)}onResponseData(e,r){if(this.#e.length>0){this.#e[0].write(r);return}super.onResponseData(e,r)}onResponseEnd(e,r){if(this.#e.length>0){this.#e[0].end(),this.#c();return}super.onResponseEnd(e,r)}onResponseError(e,r){if(this.#e.length>0){for(let n of this.#e)n.destroy(r);this.#c()}super.onResponseError(e,r)}};function fks(t={}){return p7n||(process.emitWarning("DecompressInterceptor is experimental and subject to change","ExperimentalWarning"),p7n=!0),e=>(r,n)=>{let o=new eor(n,t);return e(r,o)}}a(fks,"createDecompressInterceptor");h7n.exports=fks});var y7n=I((Etf,A7n)=>{"use strict";p();var{RequestAbortedError:pks}=ao(),g7n=5*1024*1024,tor=class{static{a(this,"DeduplicationHandler")}#e;#t=[];#r=g7n;#n=0;#i={};#o="";#s=!1;#a=!1;#c=!1;#u=!1;#l=null;#p=null;constructor(e,r,n=g7n){this.#e=e,this.#p=r,this.#r=n}addWaitingHandler(e){if(this.#u||this.#c)return!1;let r=this.#g(e),n=r.controller;try{if(e.onRequestStart?.(n,null),n.aborted)return r.done=!0,!0;this.#a&&e.onResponseStart?.(n,this.#n,this.#i,this.#o)}catch{return r.done=!0,!0}return n.aborted||this.#t.push(r),!0}onRequestStart(e,r){this.#l=e,this.#e.onRequestStart?.(e,r)}onRequestUpgrade(e,r,n,o){this.#e.onRequestUpgrade?.(e,r,n,o)}onResponseStart(e,r,n,o){this.#a=!0,this.#n=r,this.#i=n,this.#o=o,this.#e.onResponseStart?.(e,r,n,o);for(let s of this.#t){let{handler:c,controller:l}=s;if(s.done||l.aborted){s.done=!0;continue}try{c.onResponseStart?.(l,r,n,o)}catch{}l.aborted&&(s.done=!0)}this.#m()}onResponseData(e,r){if(!(this.#s||this.#u)){this.#c=!0,this.#e.onResponseData?.(e,r);for(let n of this.#t){let{handler:o,controller:s}=n;if(n.done||s.aborted){n.done=!0;continue}if(s.paused){this.#A(n,r);continue}try{o.onResponseData?.(s,r)}catch{}s.aborted&&(n.done=!0,n.bufferedChunks=[],n.bufferedBytes=0)}this.#m()}}onResponseEnd(e,r){if(!(this.#s||this.#u)){this.#u=!0,this.#e.onResponseEnd?.(e,r);for(let n of this.#t){if(n.done||n.controller.aborted){n.done=!0;continue}if(this.#h(n),n.done||n.controller.aborted){n.done=!0;continue}if(n.controller.paused&&n.bufferedChunks.length>0){n.pendingTrailers=r;continue}try{n.handler.onResponseEnd?.(n.controller,r)}catch{}n.done=!0}this.#m(),this.#p?.()}}onResponseError(e,r){if(!this.#u){this.#s=!0,this.#u=!0,this.#e.onResponseError?.(e,r);for(let n of this.#t)this.#v(n,r);this.#t=[],this.#p?.()}}#g(e){let r={handler:e,controller:null,bufferedChunks:[],bufferedBytes:0,pendingTrailers:null,done:!1},n={aborted:!1,paused:!1,reason:null};return r.controller={resume:a(()=>{if(!n.aborted){if(n.paused=!1,this.#h(r),this.#u&&r.pendingTrailers&&r.bufferedChunks.length===0&&!n.paused&&!n.aborted){try{r.handler.onResponseEnd?.(r.controller,r.pendingTrailers)}catch{}r.pendingTrailers=null,r.done=!0}this.#m()}},"resume"),pause:a(()=>{n.aborted||(n.paused=!0)},"pause"),get paused(){return n.paused},get aborted(){return n.aborted},get reason(){return n.reason},abort:a(o=>{n.aborted=!0,n.reason=o??null,r.done=!0,r.pendingTrailers=null,r.bufferedChunks=[],r.bufferedBytes=0},"abort")},r}#A(e,r){if(e.done||e.controller.aborted){e.done=!0,e.bufferedChunks=[],e.bufferedBytes=0;return}let n=Buffer.from(r);if(e.bufferedChunks.push(n),e.bufferedBytes+=n.length,e.bufferedBytes>this.#r){let o=new pks(`Deduplicated waiting handler exceeded maxBufferSize (${this.#r} bytes) while paused`);this.#v(e,o)}}#h(e){let{handler:r,controller:n}=e;for(;!e.done&&!n.aborted&&!n.paused&&e.bufferedChunks.length>0;){let o=e.bufferedChunks.shift();e.bufferedBytes-=o.length;try{r.onResponseData?.(n,o)}catch{}if(n.aborted){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;break}}}#v(e,r){if(!e.done){e.done=!0,e.pendingTrailers=null,e.bufferedChunks=[],e.bufferedBytes=0;try{e.controller.abort(r),e.handler.onResponseError?.(e.controller,r)}catch{}}}#m(){this.#t=this.#t.filter(e=>e.done===!1)}};A7n.exports=tor});var _7n=I((Ctf,E7n)=>{"use strict";p();var hks=require("node:diagnostics_channel"),mks=ko(),gks=y7n(),{normalizeHeaders:Aks,makeCacheKey:yks,makeDeduplicationKey:Eks}=Efe(),rot=hks.channel("undici:request:pending-requests");E7n.exports=(t={})=>{let{methods:e=["GET"],skipHeaderNames:r=[],excludeHeaderNames:n=[],maxBufferSize:o=5*1024*1024}=t;if(typeof t!="object"||t===null)throw new TypeError(`expected type of opts to be an Object, got ${t===null?"null":typeof t}`);if(!Array.isArray(e))throw new TypeError(`expected opts.methods to be an array, got ${typeof e}`);for(let u of e)if(!mks.safeHTTPMethods.includes(u))throw new TypeError(`expected opts.methods to only contain safe HTTP methods, got ${u}`);if(!Array.isArray(r))throw new TypeError(`expected opts.skipHeaderNames to be an array, got ${typeof r}`);if(!Array.isArray(n))throw new TypeError(`expected opts.excludeHeaderNames to be an array, got ${typeof n}`);if(!Number.isFinite(o)||o<=0)throw new TypeError(`expected opts.maxBufferSize to be a positive finite number, got ${o}`);let s=new Set(r.map(u=>u.toLowerCase())),c=new Set(n.map(u=>u.toLowerCase())),l=new Map;return u=>(d,f)=>{if(!d.origin||e.includes(d.method)===!1)return u(d,f);if(d={...d,headers:Aks(d)},s.size>0){for(let y of Object.keys(d.headers))if(s.has(y.toLowerCase()))return u(d,f)}let h=yks(d),m=Eks(h,c),g=l.get(m);if(g)return g.addWaitingHandler(f)?!0:u(d,f);let A=new gks(f,()=>{l.delete(m),rot.hasSubscribers&&rot.publish({size:l.size,key:m,type:"removed"})},o);return l.set(m,A),rot.hasSubscribers&&rot.publish({size:l.size,key:m,type:"added"}),u(d,A)}}});var b7n=I((Ttf,C7n)=>{"use strict";p();var{Writable:_ks}=require("node:stream"),{assertCacheKey:ror,assertCacheValue:vks}=Efe(),nor,iT=3,v7n=2*1e3*1e3*1e3;C7n.exports=class{static{a(this,"SqliteCacheStore")}#e=v7n;#t=1/0;#r;#n;#i;#o;#s;#a;#c;#u;constructor(e){if(e){if(typeof e!="object")throw new TypeError("SqliteCacheStore options must be an object");if(e.maxEntrySize!==void 0){if(typeof e.maxEntrySize!="number"||!Number.isInteger(e.maxEntrySize)||e.maxEntrySize<0)throw new TypeError("SqliteCacheStore options.maxEntrySize must be a non-negative integer");if(e.maxEntrySize>v7n)throw new TypeError("SqliteCacheStore options.maxEntrySize must be less than 2gb");this.#e=e.maxEntrySize}if(e.maxCount!==void 0){if(typeof e.maxCount!="number"||!Number.isInteger(e.maxCount)||e.maxCount<0)throw new TypeError("SqliteCacheStore options.maxCount must be a non-negative integer");this.#t=e.maxCount}}nor||(nor=require("node:sqlite").DatabaseSync),this.#r=new nor(e?.location??":memory:"),this.#r.exec(` PRAGMA journal_mode = WAL; PRAGMA synchronous = NORMAL; PRAGMA temp_store = memory; PRAGMA optimize; - CREATE TABLE IF NOT EXISTS cacheInterceptorV${uT} ( + CREATE TABLE IF NOT EXISTS cacheInterceptorV${iT} ( -- Data specific to us id INTEGER PRIMARY KEY AUTOINCREMENT, url TEXT NOT NULL, @@ -287,8 +256,8 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p staleAt INTEGER NOT NULL ); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${uT}_getValuesQuery ON cacheInterceptorV${uT}(url, method, deleteAt); - CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${uT}_deleteByUrlQuery ON cacheInterceptorV${uT}(deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${iT}_getValuesQuery ON cacheInterceptorV${iT}(url, method, deleteAt); + CREATE INDEX IF NOT EXISTS idx_cacheInterceptorV${iT}_deleteByUrlQuery ON cacheInterceptorV${iT}(deleteAt); `),this.#n=this.#r.prepare(` SELECT id, @@ -302,14 +271,14 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p vary, cachedAt, staleAt - FROM cacheInterceptorV${uT} + FROM cacheInterceptorV${iT} WHERE url = ? AND method = ? ORDER BY deleteAt ASC `),this.#i=this.#r.prepare(` - UPDATE cacheInterceptorV${uT} SET + UPDATE cacheInterceptorV${iT} SET body = ?, deleteAt = ?, statusCode = ?, @@ -322,7 +291,7 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p WHERE id = ? `),this.#o=this.#r.prepare(` - INSERT INTO cacheInterceptorV${uT} ( + INSERT INTO cacheInterceptorV${iT} ( url, method, body, @@ -336,107 +305,107 @@ ${e.format(r)}`.trim())}};aUn.exports=Tir});var xir=I((qrf,dUn)=>{"use strict";p cachedAt, staleAt ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${uT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${uT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${uT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` - DELETE FROM cacheInterceptorV${uT} + `),this.#a=this.#r.prepare(`DELETE FROM cacheInterceptorV${iT} WHERE url = ?`),this.#c=this.#r.prepare(`SELECT COUNT(*) AS total FROM cacheInterceptorV${iT}`),this.#s=this.#r.prepare(`DELETE FROM cacheInterceptorV${iT} WHERE deleteAt <= ?`),this.#u=this.#t===1/0?null:this.#r.prepare(` + DELETE FROM cacheInterceptorV${iT} WHERE id IN ( SELECT id - FROM cacheInterceptorV${uT} + FROM cacheInterceptorV${iT} ORDER BY cachedAt ASC LIMIT ? ) - `)}close(){this.#r.close()}get(e){Kir(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){Kir(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){Kir(e),N2s(r);let n=0,o=[],s=this;return new D2s({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!M2s(o[h],f[h])){d=!1;break}}if(d)return u}}};function M2s(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(M2s,"headerValueEquals")});var sZ=I((Jnf,x7n)=>{"use strict";p();var{kConstruct:O2s}=nl(),{kEnumerableProperty:Tfe}=Do(),{iteratorMixin:B2s,isValidHeaderName:Uke,isValidHeaderValue:v7n}=iT(),{webidl:ka}=xA(),Zir=require("node:assert"),lot=require("node:util");function C7n(t){return t===10||t===13||t===9||t===32}a(C7n,"isHTTPWhiteSpaceCharCode");function b7n(t){let e=0,r=t.length;for(;r>e&&C7n(t.charCodeAt(r-1));)--r;for(;r>e&&C7n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(b7n,"headerValueNormalize");function S7n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(S7n,"fill");function Xir(t,e,r){if(r=b7n(r),Uke(e)){if(!v7n(r))throw ka.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(I7n(t)==="immutable")throw new TypeError("immutable");return dot(t).append(e,r,!1)}a(Xir,"appendHeader");function L2s(t){let e=dot(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],Zir(s!==null);return r.sort(T7n)}}},e2=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){ka.util.markAsUncloneable(this),e!==O2s&&(this.#t=new uot,this.#e="none",e!==void 0&&(e=ka.converters.HeadersInit(e,"Headers constructor","init"),S7n(this,e)))}append(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),Xir(this,e,r)}delete(e){if(ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.delete"),e=ka.converters.ByteString(e,"Headers.delete","name"),!Uke(e))throw ka.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=ka.converters.ByteString(e,r,"name"),!Uke(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=ka.converters.ByteString(e,r,"name"),!Uke(e))throw ka.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){ka.brandCheck(this,t),ka.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=ka.converters.ByteString(e,n,"name"),r=ka.converters.ByteString(r,n,"value"),r=b7n(r),Uke(e)){if(!v7n(r))throw ka.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw ka.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){ka.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[lot.inspect.custom](e,r){return r.depth??=e,`Headers ${lot.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:I7n,setHeadersGuard:F2s,getHeadersList:dot,setHeadersList:U2s}=e2;Reflect.deleteProperty(e2,"getHeadersGuard");Reflect.deleteProperty(e2,"setHeadersGuard");Reflect.deleteProperty(e2,"getHeadersList");Reflect.deleteProperty(e2,"setHeadersList");B2s("Headers",e2,L2s,0,1);Object.defineProperties(e2.prototype,{append:Tfe,delete:Tfe,get:Tfe,has:Tfe,set:Tfe,getSetCookie:Tfe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[lot.inspect.custom]:{enumerable:!1}});ka.converters.HeadersInit=function(t,e,r){if(ka.util.Type(t)===ka.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!lot.types.isProxy(t)&&n===e2.prototype.entries)try{return dot(t).entriesList}catch{}return typeof n=="function"?ka.converters["sequence>"](t,e,r,n.bind(t)):ka.converters["record"](t,e,r)}throw ka.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};x7n.exports={fill:S7n,compareHeaderName:T7n,Headers:e2,HeadersList:uot,getHeadersGuard:I7n,setHeadersGuard:F2s,setHeadersList:U2s,getHeadersList:dot}});var qke=I((eif,U7n)=>{"use strict";p();var{Headers:N7n,HeadersList:w7n,fill:Q2s,getHeadersGuard:q2s,setHeadersGuard:M7n,setHeadersList:O7n}=sZ(),{extractBody:R7n,cloneBody:j2s,mixinBody:H2s,streamRegistry:B7n,bodyUnusable:G2s}=ife(),L7n=Do(),k7n=require("node:util"),{kEnumerableProperty:dT}=L7n,{isValidReasonPhrase:$2s,isCancelled:V2s,isAborted:W2s,isErrorLike:z2s,environmentSettingsObject:Y2s}=iT(),{redirectStatusSet:K2s,nullBodyStatus:J2s}=ZRe(),{webidl:Zs}=xA(),{URLSerializer:P7n}=pw(),{kConstruct:pot}=nl(),eor=require("node:assert"),{isomorphicEncode:Z2s,serializeJavascriptValueToJSONString:X2s}=fF(),eDs=new TextEncoder("utf-8"),fT=class t{static{a(this,"Response")}#e;#t;static error(){return Qke(hot(),"immutable")}static json(e,r=void 0){Zs.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Zs.converters.ResponseInit(r));let n=eDs.encode(X2s(e)),o=R7n(n),s=Qke(Ife({}),"response");return D7n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Zs.argumentLengthCheck(arguments,1,"Response.redirect"),e=Zs.converters.USVString(e),r=Zs.converters["unsigned short"](r);let n;try{n=new URL(e,Y2s.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!K2s.has(r))throw new RangeError(`Invalid status code ${r}`);let o=Qke(Ife({}),"immutable");o.#t.status=r;let s=Z2s(P7n(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(Zs.util.markAsUncloneable(this),e===pot)return;e!==null&&(e=Zs.converters.BodyInit(e,"Response","body")),r=Zs.converters.ResponseInit(r),this.#t=Ife({}),this.#e=new N7n(pot),M7n(this.#e,"response"),O7n(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=R7n(e);n={body:o,type:s}}D7n(this,r,n)}get type(){return Zs.brandCheck(this,t),this.#t.type}get url(){Zs.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":P7n(r,!0)}get redirected(){return Zs.brandCheck(this,t),this.#t.urlList.length>1}get status(){return Zs.brandCheck(this,t),this.#t.status}get ok(){return Zs.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return Zs.brandCheck(this,t),this.#t.statusText}get headers(){return Zs.brandCheck(this,t),this.#e}get body(){return Zs.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return Zs.brandCheck(this,t),!!this.#t.body&&L7n.isDisturbed(this.#t.body.stream)}clone(){if(Zs.brandCheck(this,t),G2s(this.#t))throw Zs.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=tor(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&B7n.register(this,new WeakRef(this.#t.body.stream)),Qke(e,q2s(this.#e))}[k7n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${k7n.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:tDs,setResponseHeaders:rDs,getResponseState:aZ,setResponseState:nDs}=fT;Reflect.deleteProperty(fT,"getResponseHeaders");Reflect.deleteProperty(fT,"setResponseHeaders");Reflect.deleteProperty(fT,"getResponseState");Reflect.deleteProperty(fT,"setResponseState");H2s(fT,aZ);Object.defineProperties(fT.prototype,{type:dT,url:dT,status:dT,ok:dT,redirected:dT,statusText:dT,headers:dT,clone:dT,body:dT,bodyUsed:dT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(fT,{json:dT,redirect:dT,error:dT});function tor(t){if(t.internalResponse)return F7n(tor(t.internalResponse),t.type);let e=Ife({...t,body:null});return t.body!=null&&(e.body=j2s(t.body)),e}a(tor,"cloneResponse");function Ife(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new w7n(t?.headersList):new w7n,urlList:t?.urlList?[...t.urlList]:[]}}a(Ife,"makeResponse");function hot(t){let e=z2s(t);return Ife({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(hot,"makeNetworkError");function iDs(t){return t.type==="error"&&t.status===0}a(iDs,"isNetworkError");function fot(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return eor(!(n in e)),r[n]=o,!0}})}a(fot,"makeFilteredResponse");function F7n(t,e){if(e==="basic")return fot(t,{type:"basic",headersList:t.headersList});if(e==="cors")return fot(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return fot(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return fot(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});eor(!1)}a(F7n,"filterResponse");function oDs(t,e=null){return eor(V2s(t)),W2s(t)?hot(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):hot(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(oDs,"makeAppropriateNetworkError");function D7n(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!$2s(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(aZ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(aZ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&Q2s(tDs(t),e.headers),r){if(J2s.includes(t.status))throw Zs.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});aZ(t).body=r.body,r.type!=null&&!aZ(t).headersList.contains("content-type",!0)&&aZ(t).headersList.append("content-type",r.type,!0)}}a(D7n,"initializeResponse");function Qke(t,e){let r=new fT(pot);nDs(r,t);let n=new N7n(pot);return rDs(r,n),O7n(n,t.headersList),M7n(n,e),t.urlList.length!==0&&t.body?.stream&&B7n.register(r,new WeakRef(t.body.stream)),r}a(Qke,"fromInnerResponse");Zs.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Zs.converters.USVString(t,e,r):Zs.is.Blob(t)||Zs.is.BufferSource(t)||Zs.is.FormData(t)||Zs.is.URLSearchParams(t)?t:Zs.converters.DOMString(t,e,r)};Zs.converters.BodyInit=function(t,e,r){return Zs.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:Zs.converters.XMLHttpRequestBodyInit(t,e,r)};Zs.converters.ResponseInit=Zs.dictionaryConverter([{key:"status",converter:Zs.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Zs.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Zs.converters.HeadersInit}]);Zs.is.Response=Zs.util.MakeTypeAssertion(fT);U7n.exports={isNetworkError:iDs,makeNetworkError:hot,makeResponse:Ife,makeAppropriateNetworkError:oDs,filterResponse:F7n,Response:fT,cloneResponse:tor,fromInnerResponse:Qke,getResponseState:aZ}});var xfe=I((nif,X7n)=>{"use strict";p();var{extractBody:sDs,mixinBody:aDs,cloneBody:cDs,bodyUnusable:Q7n}=ife(),{Headers:V7n,fill:lDs,HeadersList:Aot,setHeadersGuard:ror,getHeadersGuard:uDs,setHeadersList:W7n,getHeadersList:q7n}=sZ(),got=Do(),j7n=require("node:util"),{isValidHTTPToken:dDs,sameOrigin:H7n,environmentSettingsObject:mot}=iT(),{forbiddenMethodsSet:fDs,corsSafeListedMethodsSet:pDs,referrerPolicy:hDs,requestRedirect:mDs,requestMode:gDs,requestCredentials:ADs,requestCache:yDs,requestDuplex:EDs}=ZRe(),{kEnumerableProperty:Xh,normalizedMethodRecordsBase:_Ds,normalizedMethodRecords:CDs}=got,{webidl:Mi}=xA(),{URLSerializer:vDs}=pw(),{kConstruct:yot}=nl(),bDs=require("node:assert"),{getMaxListeners:z7n,setMaxListeners:SDs,defaultMaxListeners:TDs}=require("node:events"),IDs=Symbol("abortController"),Y7n=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),Eot=new WeakMap,nor;try{nor=z7n(new AbortController().signal)>0}catch{nor=!1}function G7n(t){return e;function e(){let r=t.deref();if(r!==void 0){Y7n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=Eot.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}Eot.delete(r.signal)}}}}a(G7n,"buildAbort");var $7n=!1,ib=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Mi.util.markAsUncloneable(this),e===yot)return;Mi.argumentLengthCheck(arguments,1,"Request constructor"),e=Mi.converters.RequestInfo(e),r=Mi.converters.RequestInit(r);let o=null,s=null,c=mot.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=_ot({urlList:[_]}),s="cors"}else bDs(Mi.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=mot.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&H7n(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=_ot({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:mot.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!H7n(v,mot.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Mi.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=CDs[_];if(v!==void 0)o.method=v;else{if(!dDs(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(fDs.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=_Ds[b]??_,o.method=_}!$7n&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),$7n=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[IDs]=m;let _=new WeakRef(m),v=G7n(_);nor&&z7n(l)===TDs&&SDs(1500,l),got.addAbortListener(l,v),Y7n.register(m,{signal:l,abort:v},v)}if(this.#r=new V7n(yot),W7n(this.#r,o.headersList),ror(this.#r,"request"),h==="no-cors"){if(!pDs.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);ror(this.#r,"request-no-cors")}if(f){let _=q7n(this.#r),v=r.headers!==void 0?r.headers:new Aot(_);if(_.clear(),v instanceof Aot){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else lDs(this.#r,v)}let g=Mi.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=sDs(r.body,o.keepalive);A=_,v&&!q7n(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(Q7n(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Mi.brandCheck(this,t),this.#n.method}get url(){return Mi.brandCheck(this,t),vDs(this.#n.url)}get headers(){return Mi.brandCheck(this,t),this.#r}get destination(){return Mi.brandCheck(this,t),this.#n.destination}get referrer(){return Mi.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Mi.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Mi.brandCheck(this,t),this.#n.mode}get credentials(){return Mi.brandCheck(this,t),this.#n.credentials}get cache(){return Mi.brandCheck(this,t),this.#n.cache}get redirect(){return Mi.brandCheck(this,t),this.#n.redirect}get integrity(){return Mi.brandCheck(this,t),this.#n.integrity}get keepalive(){return Mi.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Mi.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Mi.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Mi.brandCheck(this,t),this.#e}get body(){return Mi.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Mi.brandCheck(this,t),!!this.#n.body&&got.isDisturbed(this.#n.body.stream)}get duplex(){return Mi.brandCheck(this,t),"half"}clone(){if(Mi.brandCheck(this,t),Q7n(this.#n))throw new TypeError("unusable");let e=J7n(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=Eot.get(this.signal);n===void 0&&(n=new Set,Eot.set(this.signal,n));let o=new WeakRef(r);n.add(o),got.addAbortListener(r.signal,G7n(o))}return Z7n(e,this.#t,r.signal,uDs(this.#r))}[j7n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${j7n.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:xDs,getRequestDispatcher:wDs,setRequestDispatcher:RDs,setRequestHeaders:kDs,getRequestState:K7n,setRequestState:PDs}=ib;Reflect.deleteProperty(ib,"setRequestSignal");Reflect.deleteProperty(ib,"getRequestDispatcher");Reflect.deleteProperty(ib,"setRequestDispatcher");Reflect.deleteProperty(ib,"setRequestHeaders");Reflect.deleteProperty(ib,"getRequestState");Reflect.deleteProperty(ib,"setRequestState");aDs(ib,K7n);function _ot(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new Aot(t.headersList):new Aot}}a(_ot,"makeRequest");function J7n(t){let e=_ot({...t,body:null});return t.body!=null&&(e.body=cDs(t.body)),e}a(J7n,"cloneRequest");function Z7n(t,e,r,n){let o=new ib(yot);PDs(o,t),RDs(o,e),xDs(o,r);let s=new V7n(yot);return kDs(o,s),W7n(s,t.headersList),ror(s,n),o}a(Z7n,"fromInnerRequest");Object.defineProperties(ib.prototype,{method:Xh,url:Xh,headers:Xh,redirect:Xh,clone:Xh,signal:Xh,duplex:Xh,destination:Xh,body:Xh,bodyUsed:Xh,isHistoryNavigation:Xh,isReloadNavigation:Xh,keepalive:Xh,integrity:Xh,cache:Xh,credentials:Xh,attribute:Xh,referrerPolicy:Xh,referrer:Xh,mode:Xh,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Mi.is.Request=Mi.util.MakeTypeAssertion(ib);Mi.converters.RequestInfo=function(t){return typeof t=="string"?Mi.converters.USVString(t):Mi.is.Request(t)?t:Mi.converters.USVString(t)};Mi.converters.RequestInit=Mi.dictionaryConverter([{key:"method",converter:Mi.converters.ByteString},{key:"headers",converter:Mi.converters.HeadersInit},{key:"body",converter:Mi.nullableConverter(Mi.converters.BodyInit)},{key:"referrer",converter:Mi.converters.USVString},{key:"referrerPolicy",converter:Mi.converters.DOMString,allowedValues:hDs},{key:"mode",converter:Mi.converters.DOMString,allowedValues:gDs},{key:"credentials",converter:Mi.converters.DOMString,allowedValues:ADs},{key:"cache",converter:Mi.converters.DOMString,allowedValues:yDs},{key:"redirect",converter:Mi.converters.DOMString,allowedValues:mDs},{key:"integrity",converter:Mi.converters.DOMString},{key:"keepalive",converter:Mi.converters.boolean},{key:"signal",converter:Mi.nullableConverter(t=>Mi.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Mi.converters.any},{key:"duplex",converter:Mi.converters.DOMString,allowedValues:EDs},{key:"dispatcher",converter:Mi.converters.any},{key:"priority",converter:Mi.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);X7n.exports={Request:ib,makeRequest:_ot,fromInnerRequest:Z7n,cloneRequest:J7n,getRequestDispatcher:wDs,getRequestState:K7n}});var aQn=I((sif,sQn)=>{"use strict";p();var DDs=require("node:assert"),{runtimeFeatures:tQn}=pF(),cZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),ior;if(tQn.has("crypto")){ior=require("node:crypto");let t=ior.getHashes();t.length===0&&cZ.clear();for(let e of cZ.keys())t.includes(e)===!1&&cZ.delete(e)}else cZ.clear();var eQn=Map.prototype.get.bind(cZ),oor=Map.prototype.has.bind(cZ),NDs=tQn.has("crypto")===!1||cZ.size===0?()=>!0:(t,e)=>{let r=nQn(e);if(r.length===0)return!0;let n=rQn(r);for(let o of n){let s=o.alg,c=o.val,l=iQn(s,t);if(oQn(l,c))return!0}return!1};function rQn(t){let e=[],r=null;for(let n of t){if(DDs(oor(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=eQn(o),c=n.alg,l=eQn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(rQn,"getStrongestMetadata");function nQn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!oor(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(nQn,"parseMetadata");var iQn=a((t,e)=>ior.hash(t,e,"base64"),"applyAlgorithmToBytes");function oQn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:ol,makeAppropriateNetworkError:jke,filterResponse:sor,makeResponse:Cot,fromInnerResponse:MDs,getResponseState:ODs}=qke(),{HeadersList:aor}=sZ(),{Request:BDs,cloneRequest:LDs,getRequestDispatcher:FDs,getRequestState:UDs}=xfe(),t2=require("node:zlib"),{makePolicyContainer:QDs,clonePolicyContainer:qDs,requestBadPort:jDs,TAOCheck:HDs,appendRequestOriginHeader:GDs,responseLocationURL:$Ds,requestCurrentURL:pT,setRequestReferrerPolicyOnRedirect:VDs,tryUpgradeRequestToAPotentiallyTrustworthyURL:WDs,createOpaqueTimingInfo:hor,appendFetchMetadata:zDs,corsCheck:YDs,crossOriginResourcePolicyCheck:KDs,determineRequestsReferrer:JDs,coarsenedSharedCurrentTime:Hke,sameOrigin:dor,isCancelled:wj,isAborted:cQn,isErrorLike:ZDs,fullyReadBody:XDs,readableStreamClose:eNs,urlIsLocal:tNs,urlIsHttpHttpsScheme:Tot,urlHasHttpsScheme:rNs,clampAndCoarsenConnectionTimingInfo:nNs,simpleRangeHeaderValue:iNs,buildContentRange:oNs,createInflate:sNs,extractMimeType:aNs,hasAuthenticationEntry:cNs,includesCredentials:lQn,isTraversableNavigable:lNs}=iT(),lZ=require("node:assert"),{safelyExtractBody:Iot,extractBody:uQn}=ife(),{redirectStatusSet:hQn,nullBodyStatus:mQn,safeMethodsSet:uNs,requestBodyHeader:dNs,subresourceSet:fNs}=ZRe(),pNs=require("node:events"),{Readable:hNs,pipeline:mNs,finished:gNs,isErrored:ANs,isReadable:vot}=require("node:stream"),{addAbortListener:yNs,bufferToLowerCasedHeaderName:dQn}=Do(),{dataURLProcessor:ENs,serializeAMimeType:_Ns,minimizeSupportedMimeType:CNs}=pw(),{getGlobalDispatcher:vNs}=sot(),{webidl:mor}=xA(),{STATUS_CODES:fQn}=require("node:http"),{bytesMatch:bNs}=aQn(),{createDeferredPromise:SNs}=nke(),{isomorphicEncode:bot}=fF(),{runtimeFeatures:TNs}=pF(),INs=TNs.has("zstd"),xNs=["GET","HEAD"],wNs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",cor,Sot=class extends pNs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function RNs(t){gQn(t,"fetch")}a(RNs,"handleFetchDone");function kNs(t,e=void 0){mor.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=SNs(),n;try{n=new BDs(t,e)}catch(f){return r.reject(f),r.promise}let o=UDs(n);if(n.signal.aborted)return lor(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return yNs(n.signal,()=>{l=!0,lZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();lor(r,o,f,n.signal.reason,u.controller)}),u=yQn({request:o,processResponseEndOfBody:RNs,processResponse:a(f=>{if(!l){if(f.aborted){lor(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(MDs(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:FDs(n),requestObject:n}),r.promise}a(kNs,"fetch");function gQn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Tot(r)&&n!==null&&(t.timingAllowPassed||(n=hor({startTime:n.startTime}),o=""),n.endTime=Hke(),t.timingInfo=n,AQn(n,r.href,e,globalThis,o,"",t.status))}a(gQn,"finalizeAndReportTiming");var AQn=performance.markResourceTiming;function lor(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&vot(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=ODs(r);s.body?.stream!=null&&vot(s.body.stream)&&o.error(n)}a(lor,"abortFetch");function yQn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=vNs(),requestObject:u=null}){lZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=Hke(f),m=hor({startTime:h}),g={controller:new Sot(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return lZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=qDs(t.client.policyContainer):t.policyContainer=QDs()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,fNs.has(t.destination),EQn(g,!1),g.controller}a(yQn,"fetching");async function EQn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!tNs(pT(r))&&(n=ol("local URLs only")),WDs(r),jDs(r)==="blocked"&&(n=ol("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=JDs(r)),n===null){let s=pT(r);dor(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await pQn(t)):r.mode==="same-origin"?n=ol('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=ol('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await pQn(t)):Tot(pT(r))?(r.responseTainting="cors",n=await _Qn(t)):n=ol("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=sor(n,"basic"):r.responseTainting==="cors"?n=sor(n,"cors"):r.responseTainting==="opaque"?n=sor(n,"opaque"):lZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=ol()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||mQn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>uor(t,ol(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!bNs(l,r.integrity)){s("integrity mismatch");return}n.body=Iot(l)[0],uor(t,n)},"processBody");XDs(n.body,c,s)}else uor(t,n)}catch(r){t.controller.terminate(r)}}a(EQn,"mainFetch");function pQn(t){if(wj(t)&&t.request.redirectCount===0)return Promise.resolve(jke(t));let{request:e}=t,{protocol:r}=pT(e);switch(r){case"about:":return Promise.resolve(ol("about scheme is not supported"));case"blob:":{cor||(cor=require("node:buffer").resolveObjectURL);let n=pT(e);if(n.search.length!==0)return Promise.resolve(ol("NetworkError when attempting to fetch resource."));let o=cor(n.toString());if(e.method!=="GET"||!mor.is.Blob(o))return Promise.resolve(ol("invalid method"));let s=Cot(),c=o.size,l=bot(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=iNs(d,!0);if(f==="failure")return Promise.resolve(ol("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(ol("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=uQn(g);s.body=A[0];let y=bot(`${g.size}`),E=oNs(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=uQn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=pT(e),o=ENs(n);if(o==="failure")return Promise.resolve(ol("failed to fetch the data URL"));let s=_Ns(o.mimeType);return Promise.resolve(Cot({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:Iot(o.body)[0]}))}case"file:":return Promise.resolve(ol("not implemented... yet..."));case"http:":case"https:":return _Qn(t).catch(n=>ol(n));default:return Promise.resolve(ol("unknown scheme"))}}a(pQn,"schemeFetch");function PNs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(PNs,"finalizeResponse");function uor(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Tot(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=hor(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=aNs(e.headersList);f!=="failure"&&(u.contentType=CNs(f))}t.request.initiatorType!=null&&AQn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():gNs(o.body.stream,()=>{n()})}a(uor,"fetchFinale");async function _Qn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await por(t),e.responseTainting==="cors"&&YDs(e,r)==="failure")return ol("cors failure");HDs(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&KDs(e.origin,e.client,e.destination,n)==="blocked"?ol("blocked"):(hQn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=ol("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await DNs(t,r):lZ(!1)),r.timingInfo=o,r)}a(_Qn,"httpFetch");function DNs(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=$Ds(n,pT(r).hash),o==null)return e}catch(c){return Promise.resolve(ol(c))}if(!Tot(o))return Promise.resolve(ol("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(ol("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!dor(r,o))return Promise.resolve(ol('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(ol('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(ol());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!xNs.includes(r.method)){r.method="GET",r.body=null;for(let c of dNs)r.headersList.delete(c)}dor(pT(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(lZ(r.body.source!=null),r.body=Iot(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=Hke(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),VDs(r,n),EQn(t,!0)}a(DNs,"httpRedirectFetch");async function por(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=LDs(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=bot(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,mor.is.URL(s.referrer)&&s.headersList.append("referer",bot(s.referrer.href),!0),GDs(s),zDs(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",wNs,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(rNs(pT(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(cNs(s)&&(s.useURLCredentials===void 0||!lQn(pT(s))))){if(lQn(pT(s))&&e){let{username:g,password:A}=pT(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return ol("only if cached");let m=await NNs(o,d,r);!uNs.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||lNs(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=Iot(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return wj(t)?jke(t):c;t.controller.connection.destroy(),c=await por(t,!0)}if(c.status===407)return n.window==="no-window"?ol():wj(t)?jke(t):ol("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(wj(t))return jke(t);t.controller.connection.destroy(),c=await por(t,e,!0)}return c}a(por,"httpNetworkOrCacheFetch");async function NNs(t,e=!1,r=!1){lZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){wj(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{wj(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{wj(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=Cot({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=Cot({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),jke(t,A)):ol(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{wj(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(cQn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){eNs(t.controller.controller),PNs(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),ANs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){cQn(t)?(o.aborted=!0,vot(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):vot(h)&&t.controller.controller.error(new TypeError("terminated",{cause:ZDs(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=pT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=nNs(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=Hke(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=Hke(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,k){if(w<200)return!1;let D=new aor;for(let M=0;Mq)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${q}`)),!0;for(let F=O.length-1;F>=0;--F){let U=O[F].trim();if(U==="x-gzip"||U==="gzip")B.push(t2.createGunzip({flush:t2.constants.Z_SYNC_FLUSH,finishFlush:t2.constants.Z_SYNC_FLUSH}));else if(U==="deflate")B.push(sNs({flush:t2.constants.Z_SYNC_FLUSH,finishFlush:t2.constants.Z_SYNC_FLUSH}));else if(U==="br")B.push(t2.createBrotliDecompress({flush:t2.constants.BROTLI_OPERATION_FLUSH,finishFlush:t2.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&INs)B.push(t2.createZstdDecompress({flush:t2.constants.ZSTD_e_continue,finishFlush:t2.constants.ZSTD_e_end}));else{B.length=0;break}}}let Q=this.onError.bind(this);return b({status:w,statusText:k,headersList:D,body:B.length?mNs(this.body,...B,M=>{M&&this.onError(M)}).on("error",Q):this.body.on("error",Q)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,k){if(k.session!=null&&R!==200||k.session==null&&R!==101)return!1;let D=new aor;for(let[N,L]of Object.entries(x)){if(L==null)continue;let B=N.toLowerCase();if(Array.isArray(L))for(let Q of L)D.append(B,String(Q),!0);else D.append(B,String(L),!0)}return b({status:R,statusText:fQn[R],headersList:D,socket:k}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let k=new aor;for(let D=0;D{"use strict";p();var MNs=require("node:assert"),{URLSerializer:vQn}=pw(),{isValidHeaderName:ONs}=iT();function BNs(t,e,r=!1){let n=vQn(t,r),o=vQn(e,r);return n===o}a(BNs,"urlEquals");function LNs(t){MNs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),ONs(r)&&e.push(r);return e}a(LNs,"getFieldValues");bQn.exports={urlEquals:BNs,getFieldValues:LNs}});var wQn=I((mif,xQn)=>{"use strict";p();var gor=require("node:assert"),{kConstruct:FNs}=nl(),{urlEquals:UNs,getFieldValues:Aor}=SQn(),{kEnumerableProperty:uZ,isDisturbed:QNs}=Do(),{webidl:Zn}=xA(),{cloneResponse:TQn,fromInnerResponse:qNs,getResponseState:jNs}=qke(),{Request:$ke,fromInnerRequest:HNs,getRequestState:d5}=xfe(),{fetching:GNs}=Gke(),{urlIsHttpHttpsScheme:xot,readAllBytes:$Ns}=iT(),{createDeferredPromise:wfe}=nke(),wot=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==FNs&&Zn.illegalConstructor(),Zn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Zn.brandCheck(this,t);let n="Cache.match";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Zn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Zn.brandCheck(this,t),Zn.argumentLengthCheck(arguments,1,"Cache.add"),e=Zn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Zn.brandCheck(this,t);let r="Cache.addAll";Zn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Zn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Zn.converters.RequestInfo(m),typeof m=="string")continue;let g=d5(m);if(!xot(g.url)||g.method!=="GET")throw Zn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=d5(new $ke(m));if(!xot(g.url))throw Zn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=wfe();s.push(GNs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Zn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=Aor(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Zn.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=wfe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Zn.brandCheck(this,t);let n="Cache.put";Zn.argumentLengthCheck(arguments,2,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.Response(r,n,"response");let o=null;if(Zn.is.Request(e)?o=d5(e):o=d5(new $ke(e)),!xot(o.url)||o.method!=="GET")throw Zn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=jNs(r);if(s.status===206)throw Zn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=Aor(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Zn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(QNs(s.body.stream)||s.body.stream.locked))throw Zn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=TQn(s),l=wfe();if(s.body!=null){let A=s.body.stream.getReader();$Ns(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=wfe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Zn.brandCheck(this,t);let n="Cache.delete";Zn.argumentLengthCheck(arguments,1,n),e=Zn.converters.RequestInfo(e),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else gor(typeof e=="string"),o=d5(new $ke(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=wfe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Zn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Zn.converters.RequestInfo(e)),r=Zn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=d5(new $ke(e)));let s=wfe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=HNs(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);gor(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!xot(u.url))throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Zn.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);gor(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!UNs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=Aor(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(Zn.is.Request(e)){if(o=d5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=d5(new $ke(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=qNs(TQn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(wot.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:uZ,matchAll:uZ,add:uZ,addAll:uZ,put:uZ,delete:uZ,keys:uZ});var IQn=[{key:"ignoreSearch",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Zn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Zn.converters.CacheQueryOptions=Zn.dictionaryConverter(IQn);Zn.converters.MultiCacheQueryOptions=Zn.dictionaryConverter([...IQn,{key:"cacheName",converter:Zn.converters.DOMString}]);Zn.converters.Response=Zn.interfaceConverter(Zn.is.Response,"Response");Zn.converters["sequence"]=Zn.sequenceConverter(Zn.converters.RequestInfo);xQn.exports={Cache:wot}});var kQn=I((yif,RQn)=>{"use strict";p();var{Cache:Rot}=wQn(),{webidl:sE}=xA(),{kEnumerableProperty:Vke}=Do(),{kConstruct:Wke}=nl(),kot=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==Wke&&sE.illegalConstructor(),sE.util.markAsUncloneable(this)}async match(e,r={}){if(sE.brandCheck(this,t),sE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=sE.converters.RequestInfo(e),r=sE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new Rot(Wke,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new Rot(Wke,n).match(e,r);if(s!==void 0)return s}}async has(e){sE.brandCheck(this,t);let r="CacheStorage.has";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){sE.brandCheck(this,t);let r="CacheStorage.open";if(sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new Rot(Wke,o)}let n=[];return this.#e.set(e,n),new Rot(Wke,n)}async delete(e){sE.brandCheck(this,t);let r="CacheStorage.delete";return sE.argumentLengthCheck(arguments,1,r),e=sE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return sE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(kot.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Vke,has:Vke,open:Vke,delete:Vke,keys:Vke});RQn.exports={CacheStorage:kot}});var DQn=I((Cif,PQn)=>{"use strict";p();PQn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var yor=I((bif,LQn)=>{"use strict";p();function VNs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(VNs,"isCTLExcludingHtab");function NQn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(NQn,"validateCookieName");function MQn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(MQn,"validateCookieValue");function OQn(t){for(let e=0;ee.toString().padStart(2,"0"));function BQn(t){return typeof t=="number"&&(t=new Date(t)),`${zNs[t.getUTCDay()]}, ${Pot[t.getUTCDate()]} ${YNs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Pot[t.getUTCHours()]}:${Pot[t.getUTCMinutes()]}:${Pot[t.getUTCSeconds()]} GMT`}a(BQn,"toIMFDate");function KNs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(KNs,"validateCookieMaxAge");function JNs(t){if(t.name.length===0)return null;NQn(t.name),MQn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(KNs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(WNs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(OQn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${BQn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(JNs,"stringify");LQn.exports={isCTLExcludingHtab:VNs,validateCookieName:NQn,validateCookiePath:OQn,validateCookieValue:MQn,toIMFDate:BQn,stringify:JNs}});var UQn=I((Iif,FQn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Dot}=fF(),{maxNameValuePairSize:ZNs,maxAttributeValueSize:XNs}=DQn(),{isCTLExcludingHtab:eMs}=yor(),tMs=require("node:assert"),{unescape:rMs}=require("node:querystring");function nMs(t){if(eMs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Dot(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Dot("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>ZNs?null:{name:n,value:rMs(o),...Rfe(r)}}a(nMs,"parseSetCookie");function Rfe(t,e={}){if(t.length===0)return e;tMs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Dot(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Dot("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>XNs)return Rfe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Rfe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Rfe(t,e)}a(Rfe,"parseUnparsedAttributes");FQn.exports={parseSetCookie:nMs,parseUnparsedAttributes:Rfe}});var HQn=I((Rif,jQn)=>{"use strict";p();var{parseSetCookie:QQn}=UQn(),{stringify:iMs}=yor(),{webidl:Wa}=xA(),{Headers:oMs}=sZ(),Not=Wa.brandCheckMultiple([oMs,globalThis.Headers].filter(Boolean));function sMs(t){Wa.argumentLengthCheck(arguments,1,"getCookies"),Not(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(sMs,"getCookies");function aMs(t,e,r){Not(t);let n="deleteCookie";Wa.argumentLengthCheck(arguments,2,n),e=Wa.converters.DOMString(e,n,"name"),r=Wa.converters.DeleteCookieAttributes(r),qQn(t,{name:e,value:"",expires:new Date(0),...r})}a(aMs,"deleteCookie");function cMs(t){Wa.argumentLengthCheck(arguments,1,"getSetCookies"),Not(t);let e=t.getSetCookie();return e?e.map(r=>QQn(r)):[]}a(cMs,"getSetCookies");function lMs(t){return t=Wa.converters.DOMString(t),QQn(t)}a(lMs,"parseCookie");function qQn(t,e){Wa.argumentLengthCheck(arguments,2,"setCookie"),Not(t),e=Wa.converters.Cookie(e);let r=iMs(e);r&&t.append("set-cookie",r,!0)}a(qQn,"setCookie");Wa.converters.DeleteCookieAttributes=Wa.dictionaryConverter([{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Wa.converters.Cookie=Wa.dictionaryConverter([{converter:Wa.converters.DOMString,key:"name"},{converter:Wa.converters.DOMString,key:"value"},{converter:Wa.nullableConverter(t=>typeof t=="number"?Wa.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.nullableConverter(Wa.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Wa.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Wa.sequenceConverter(Wa.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);jQn.exports={getCookies:sMs,deleteCookie:aMs,getSetCookies:cMs,setCookie:qQn,parseCookie:lMs}});var Bot=I((Dif,$Qn)=>{"use strict";p();var{webidl:ai}=xA(),{kEnumerableProperty:ob}=Do(),{kConstruct:GQn}=nl(),kfe=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===GQn){super(arguments[1],arguments[2]),ai.util.markAsUncloneable(this);return}let n="MessageEvent constructor";ai.argumentLengthCheck(arguments,1,n),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,ai.util.markAsUncloneable(this)}get data(){return ai.brandCheck(this,t),this.#e.data}get origin(){return ai.brandCheck(this,t),this.#e.origin}get lastEventId(){return ai.brandCheck(this,t),this.#e.lastEventId}get source(){return ai.brandCheck(this,t),this.#e.source}get ports(){return ai.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return ai.brandCheck(this,t),ai.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(GQn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:uMs}=kfe;delete kfe.createFastMessageEvent;var Mot=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";ai.argumentLengthCheck(arguments,1,n),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.CloseEventInit(r),super(e,r),this.#e=r,ai.util.markAsUncloneable(this)}get wasClean(){return ai.brandCheck(this,t),this.#e.wasClean}get code(){return ai.brandCheck(this,t),this.#e.code}get reason(){return ai.brandCheck(this,t),this.#e.reason}},Oot=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";ai.argumentLengthCheck(arguments,1,n),super(e,r),ai.util.markAsUncloneable(this),e=ai.converters.DOMString(e,n,"type"),r=ai.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return ai.brandCheck(this,t),this.#e.message}get filename(){return ai.brandCheck(this,t),this.#e.filename}get lineno(){return ai.brandCheck(this,t),this.#e.lineno}get colno(){return ai.brandCheck(this,t),this.#e.colno}get error(){return ai.brandCheck(this,t),this.#e.error}};Object.defineProperties(kfe.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:ob,origin:ob,lastEventId:ob,source:ob,ports:ob,initMessageEvent:ob});Object.defineProperties(Mot.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:ob,code:ob,wasClean:ob});Object.defineProperties(Oot.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:ob,filename:ob,lineno:ob,colno:ob,error:ob});ai.converters.MessagePort=ai.interfaceConverter(ai.is.MessagePort,"MessagePort");ai.converters["sequence"]=ai.sequenceConverter(ai.converters.MessagePort);var Eor=[{key:"bubbles",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ai.converters.MessageEventInit=ai.dictionaryConverter([...Eor,{key:"data",converter:ai.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:ai.nullableConverter(ai.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:ai.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);ai.converters.CloseEventInit=ai.dictionaryConverter([...Eor,{key:"wasClean",converter:ai.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:ai.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);ai.converters.ErrorEventInit=ai.dictionaryConverter([...Eor,{key:"message",converter:ai.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:ai.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:ai.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:ai.converters.any}]);$Qn.exports={MessageEvent:kfe,CloseEvent:Mot,ErrorEvent:Oot,createFastMessageEvent:uMs}});var Rj=I((Oif,VQn)=>{"use strict";p();var dMs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",fMs={enumerable:!0,writable:!1,configurable:!1},pMs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},hMs={SENT:1,RECEIVED:2},mMs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},gMs=65535,AMs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},yMs=Buffer.allocUnsafe(0),EMs={text:1,typedArray:2,arrayBuffer:3,blob:4};VQn.exports={uid:dMs,sentCloseFrameState:hMs,staticPropertyDescriptors:fMs,states:pMs,opcodes:mMs,maxUnsigned16Bit:gMs,parserStates:AMs,emptyBuffer:yMs,sendHints:EMs}});var dZ=I((Lif,JQn)=>{"use strict";p();var{states:Lot,opcodes:Pfe}=Rj(),{isUtf8:_Ms}=require("node:buffer"),{removeHTTPWhitespace:WQn}=pw(),{collectASequenceOfCodePointsFast:CMs}=fF();function vMs(t){return t===Lot.CONNECTING}a(vMs,"isConnecting");function bMs(t){return t===Lot.OPEN}a(bMs,"isEstablished");function SMs(t){return t===Lot.CLOSING}a(SMs,"isClosing");function TMs(t){return t===Lot.CLOSED}a(TMs,"isClosed");function IMs(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(IMs,"fireEvent");function xMs(t,e,r){t.onMessage(e,r)}a(xMs,"websocketMessageReceived");function wMs(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(wMs,"toArrayBuffer");function RMs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(RMs,"isValidSubprotocol");function kMs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(kMs,"isValidStatusCode");function zQn(t){return t===Pfe.CLOSE||t===Pfe.PING||t===Pfe.PONG}a(zQn,"isControlFrame");function YQn(t){return t===Pfe.CONTINUATION}a(YQn,"isContinuationFrame");function KQn(t){return t===Pfe.TEXT||t===Pfe.BINARY}a(KQn,"isTextBinaryFrame");function PMs(t){return KQn(t)||YQn(t)||zQn(t)}a(PMs,"isValidOpcode");function DMs(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(NMs,"isValidClientWindowBits");function MMs(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(MMs,"getURLRecord");function OMs(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(OMs,"validateCloseCodeAndReason");var BMs=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(_Ms(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();JQn.exports={isConnecting:vMs,isEstablished:bMs,isClosing:SMs,isClosed:TMs,fireEvent:IMs,isValidSubprotocol:RMs,isValidStatusCode:kMs,websocketMessageReceived:xMs,utf8Decode:BMs,isControlFrame:zQn,isContinuationFrame:YQn,isTextBinaryFrame:KQn,isValidOpcode:PMs,parseExtensions:DMs,isValidClientWindowBits:NMs,toArrayBuffer:wMs,getURLRecord:MMs,validateCloseCodeAndReason:OMs}});var Nfe=I((Qif,XQn)=>{"use strict";p();var{runtimeFeatures:LMs}=pF(),{maxUnsigned16Bit:ZQn,opcodes:FMs}=Rj(),Fot=8*1024,zke=null,Dfe=Fot,UMs=LMs.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;oZQn?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;uZQn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|FMs.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};XQn.exports={WebsocketFrameSend:Cor,generateMask:_or}});var Uot=I((Hif,oqn)=>{"use strict";p();var{uid:QMs,states:vor,sentCloseFrameState:bor,emptyBuffer:eqn,opcodes:qMs}=Rj(),{parseExtensions:jMs,isClosed:HMs,isClosing:GMs,isEstablished:nqn,isConnecting:$Ms,validateCloseCodeAndReason:VMs}=dZ(),{makeRequest:WMs}=xfe(),{fetching:zMs}=Gke(),{Headers:YMs,getHeadersList:KMs}=sZ(),{getDecodeSplit:JMs}=iT(),{WebsocketFrameSend:ZMs}=Nfe(),XMs=require("node:assert"),{runtimeFeatures:eOs}=pF(),tqn=eOs.has("crypto")?require("node:crypto"):null,rqn=!1;function tOs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=WMs({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=KMs(new YMs(o.headers));c.headersList=f}let l=tqn.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),zMs({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){f5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){f5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(rqn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),rqn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){f5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){f5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){f5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=tqn.hash("sha1",l+QMs,"base64");if(h!==m){f5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=jMs(g),!A.has("permessage-deflate"))){f5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!JMs("sec-websocket-protocol",c.headersList).includes(y)){f5(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a(tOs,"establishWebSocketConnection");function iqn(t,e,r,n=!1){if(e??=null,r??="",n&&VMs(e,r),!(HMs(t.readyState)||GMs(t.readyState)))if(!nqn(t.readyState))f5(t),t.readyState=vor.CLOSING;else if(!t.closeState.has(bor.SENT)&&!t.closeState.has(bor.RECEIVED)){let o=new ZMs;r.length!==0&&e===null&&(e=1e3),XMs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=eqn:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=eqn,t.socket.write(o.createFrame(qMs.CLOSE)),t.closeState.add(bor.SENT),t.readyState=vor.CLOSING}else t.readyState=vor.CLOSING}a(iqn,"closeWebSocketConnection");function f5(t,e,r,n){nqn(t.readyState)&&iqn(t,e,r,!1),t.controller.abort(),$Ms(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(f5,"failWebsocketConnection");oqn.exports={establishWebSocketConnection:tOs,failWebsocketConnection:f5,closeWebSocketConnection:iqn}});var cqn=I((Vif,aqn)=>{"use strict";p();var{createInflateRaw:rOs,Z_DEFAULT_WINDOWBITS:nOs}=require("node:zlib"),{isValidClientWindowBits:iOs}=dZ(),{MessageSizeExceededError:sqn}=ao(),oOs=Buffer.from([0,0,255,255]),Qot=Symbol("kBuffer"),Yke=Symbol("kLength"),sOs=4*1024*1024,Sor=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new sqn);return}if(!this.#e){let o=nOs;if(this.#t.serverMaxWindowBits){if(!iOs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=rOs({windowBits:o})}catch(s){n(s);return}this.#e[Qot]=[],this.#e[Yke]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[Yke]+=s.length,this.#e[Yke]>sOs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new sqn)}return}this.#e[Qot].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(oOs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Qot],this.#e[Yke]);this.#e[Qot].length=0,this.#e[Yke]=0,this.#n=null,n(null,o)})}};aqn.exports={PerMessageDeflate:Sor}});var xor=I((Yif,pqn)=>{"use strict";p();var{Writable:aOs}=require("node:stream"),cOs=require("node:assert"),{parserStates:sb,opcodes:Mfe,states:lOs,emptyBuffer:lqn,sentCloseFrameState:Kke}=Rj(),{isValidStatusCode:uOs,isValidOpcode:dOs,websocketMessageReceived:uqn,utf8Decode:fOs,isControlFrame:dqn,isTextBinaryFrame:Tor,isContinuationFrame:pOs}=dZ(),{failWebsocketConnection:hT}=Uot(),{WebsocketFrameSend:fqn}=Nfe(),{PerMessageDeflate:hOs}=cqn(),{MessageSizeExceededError:mOs}=ao(),Ior=class extends aOs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=sb.INFO;#o={};#s=[];#a;#c;constructor(e,r){super(),this.#c=e,this.#a=r??new Map,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new hOs(r))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#i===sb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Mfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!dOs(o))return hT(this.#c,1002,"Invalid opcode received"),e();if(s)return hT(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){hT(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){hT(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!Tor(o)){hT(this.#c,1002,"Invalid frame type was fragmented.");return}if(Tor(o)&&this.#s.length>0){hT(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){hT(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&dqn(o)){hT(this.#c,1002,"Control frame either too large or fragmented");return}if(pOs(o)&&this.#s.length===0&&!this.#o.compressed){hT(this.#c,1002,"Unexpected continuation frame");return}l<=125?(this.#o.payloadLength=l,this.#i=sb.READ_DATA):l===126?this.#i=sb.PAYLOADLENGTH_16:l===127&&(this.#i=sb.PAYLOADLENGTH_64),Tor(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===sb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);this.#o.payloadLength=r.readUInt16BE(0),this.#i=sb.READ_DATA}else if(this.#i===sb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){hT(this.#c,1009,"Received payload length > 2^31 bytes.");return}this.#o.payloadLength=o,this.#i=sb.READ_DATA}else if(this.#i===sb.READ_DATA){if(this.#r{if(n){let s=n instanceof mOs?1009:1007;hT(this.#c,s,n.message);return}if(this.writeFragments(o),!this.#o.fin){this.#i=sb.INFO,this.#n=!0,this.run(e);return}uqn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=sb.INFO,this.run(e)}),this.#n=!1;break}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return lqn;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){this.#t+=e.length,this.#s.push(e)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!uOs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=fOs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===Mfe.CLOSE){if(n===1)return hT(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return hT(this.#c,o,s),!1}if(!this.#c.closeState.has(Kke.SENT)&&!this.#c.closeState.has(Kke.RECEIVED)){let o=lqn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new fqn(o);this.#c.socket.write(s.createFrame(Mfe.CLOSE)),this.#c.closeState.add(Kke.SENT)}return this.#c.readyState=lOs.CLOSING,this.#c.closeState.add(Kke.RECEIVED),!1}else if(r===Mfe.PING){if(!this.#c.closeState.has(Kke.RECEIVED)){let o=new fqn(e);this.#c.socket.write(o.createFrame(Mfe.PONG)),this.#c.onPing(e)}}else r===Mfe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};pqn.exports={ByteParser:Ior}});var Aqn=I((Zif,gqn)=>{"use strict";p();var{WebsocketFrameSend:mqn}=Nfe(),{opcodes:hqn,sendHints:fZ}=Rj(),gOs=inr(),Ror=class{static{a(this,"SendQueue")}#e=new gOs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==fZ.blob){if(this.#t){let s={promise:null,callback:r,frame:wor(e,n)};this.#e.push(s)}else if(n===fZ.text){let{0:s,1:c}=mqn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(wor(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=wor(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function wor(t,e){return new mqn(AOs(t,e)).createFrame(e===fZ.text?hqn.TEXT:hqn.BINARY)}a(wor,"createFrame");function AOs(t,e){switch(e){case fZ.text:case fZ.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case fZ.arrayBuffer:case fZ.blob:return new Uint8Array(t)}}a(AOs,"toBuffer");gqn.exports={SendQueue:Ror}});var bqn=I((tof,vqn)=>{"use strict";p();var{isArrayBuffer:yOs}=require("node:util/types"),{webidl:pi}=xA(),{URLSerializer:EOs}=pw(),{environmentSettingsObject:yqn}=iT(),{staticPropertyDescriptors:kj,states:bF,sentCloseFrameState:kor,sendHints:qot,opcodes:Por}=Rj(),{isConnecting:_Os,isEstablished:Eqn,isClosing:_qn,isClosed:COs,isValidSubprotocol:vOs,fireEvent:jot,utf8Decode:bOs,toArrayBuffer:SOs,getURLRecord:TOs}=dZ(),{establishWebSocketConnection:IOs,closeWebSocketConnection:xOs,failWebsocketConnection:Cqn}=Uot(),{ByteParser:wOs}=xor(),{kEnumerableProperty:Cw}=Do(),{getGlobalDispatcher:ROs}=sot(),{ErrorEvent:kOs,CloseEvent:POs,createFastMessageEvent:DOs}=Bot(),{SendQueue:NOs}=Aqn(),{WebsocketFrameSend:MOs}=Nfe(),{channels:p5}=cj();function OOs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(OOs,"getSocketAddress");var Y_=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>Cqn(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=bF.CLOSING,p5.socketError.hasSubscribers&&p5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{p5.ping.hasSubscribers&&p5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{p5.pong.hasSubscribers&&p5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:bF.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),pi.util.markAsUncloneable(this);let n="WebSocket constructor";pi.argumentLengthCheck(arguments,1,n);let o=pi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=pi.converters.USVString(e),r=o.protocols;let s=yqn.settingsObject.baseUrl,c=TOs(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>vOs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=yqn.settingsObject;this.#o.controller=IOs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){pi.brandCheck(this,t),e!==void 0&&(e=pi.converters["unsigned short"](e,"WebSocket.close","code",pi.attributes.Clamp)),r!==void 0&&(r=pi.converters.USVString(r)),e??=null,r??="",xOs(this.#o,e,r,!0)}send(e){pi.brandCheck(this,t);let r="WebSocket.send";if(pi.argumentLengthCheck(arguments,1,r),e=pi.converters.WebSocketSendData(e,r,"data"),_Os(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Eqn(this.#o.readyState)||_qn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},qot.text)}else yOs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},qot.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},qot.typedArray)):pi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},qot.blob))}get readyState(){return pi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return pi.brandCheck(this,t),this.#t}get url(){return pi.brandCheck(this,t),EOs(this.#s)}get extensions(){return pi.brandCheck(this,t),this.#n}get protocol(){return pi.brandCheck(this,t),this.#r}get onopen(){return pi.brandCheck(this,t),this.#e.open}set onopen(e){pi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return pi.brandCheck(this,t),this.#e.error}set onerror(e){pi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return pi.brandCheck(this,t),this.#e.close}set onclose(e){pi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return pi.brandCheck(this,t),this.#e.message}set onmessage(e){pi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return pi.brandCheck(this,t),this.#a}set binaryType(e){pi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=new wOs(this.#o,r);n.on("drain",()=>this.#o.onParserDrain()),n.on("error",c=>this.#o.onParserError(c)),this.#c=n,this.#i=new NOs(e.socket),this.#o.readyState=bF.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");if(s!==null&&(this.#r=s),jot("open",this),p5.open.hasSubscribers){let c=e.headersList.entries;p5.open.publish({address:OOs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:c}})}}#l(e,r){if(this.#o.readyState!==bF.OPEN)return;let n;if(e===Por.TEXT)try{n=bOs(r)}catch{Cqn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Por.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=SOs(r));jot("message",this,DOs,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(kor.SENT)&&this.#o.closeState.has(kor.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=bF.CLOSED,this.#o.closeState.has(kor.RECEIVED)||(r=1006,jot("error",this,(s,c)=>new kOs(s,c),{error:new TypeError(n)})),jot("close",this,(s,c)=>new POs(s,c),{wasClean:e,code:r,reason:n}),p5.close.hasSubscribers&&p5.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(Eqn(n)&&!_qn(n)&&!COs(n)){let o=new MOs(r);e.#o.socket.write(o.createFrame(Por.PING))}}},{ping:BOs}=Y_;Reflect.deleteProperty(Y_,"ping");Y_.CONNECTING=Y_.prototype.CONNECTING=bF.CONNECTING;Y_.OPEN=Y_.prototype.OPEN=bF.OPEN;Y_.CLOSING=Y_.prototype.CLOSING=bF.CLOSING;Y_.CLOSED=Y_.prototype.CLOSED=bF.CLOSED;Object.defineProperties(Y_.prototype,{CONNECTING:kj,OPEN:kj,CLOSING:kj,CLOSED:kj,url:Cw,readyState:Cw,bufferedAmount:Cw,onopen:Cw,onerror:Cw,onclose:Cw,close:Cw,onmessage:Cw,binaryType:Cw,send:Cw,extensions:Cw,protocol:Cw,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(Y_,{CONNECTING:kj,OPEN:kj,CLOSING:kj,CLOSED:kj});pi.converters["sequence"]=pi.sequenceConverter(pi.converters.DOMString);pi.converters["DOMString or sequence"]=function(t,e,r){return pi.util.Type(t)===pi.util.Types.OBJECT&&Symbol.iterator in t?pi.converters["sequence"](t):pi.converters.DOMString(t,e,r)};pi.converters.WebSocketInit=pi.dictionaryConverter([{key:"protocols",converter:pi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:pi.converters.any,defaultValue:a(()=>ROs(),"defaultValue")},{key:"headers",converter:pi.nullableConverter(pi.converters.HeadersInit)}]);pi.converters["DOMString or sequence or WebSocketInit"]=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&!(Symbol.iterator in t)?pi.converters.WebSocketInit(t):{protocols:pi.converters["DOMString or sequence"](t)}};pi.converters.WebSocketSendData=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&(pi.is.Blob(t)||pi.is.BufferSource(t))?t:pi.converters.USVString(t)};vqn.exports={WebSocket:Y_,ping:BOs}});var Dor=I((iof,Iqn)=>{"use strict";p();var{webidl:Hot}=xA(),{validateCloseCodeAndReason:LOs}=dZ(),{kConstruct:Sqn}=nl(),{kEnumerableProperty:Tqn}=Do();function FOs(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(FOs,"createInheritableDOMException");var pZ=class t extends FOs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Hot.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===Sqn)return;r!==null&&(r=Hot.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";LOs(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,Sqn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:UOs}=pZ;delete pZ.createUnvalidatedWebSocketError;Object.defineProperties(pZ.prototype,{closeCode:Tqn,reason:Tqn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Hot.is.WebSocketError=Hot.util.MakeTypeAssertion(pZ);Iqn.exports={WebSocketError:pZ,createUnvalidatedWebSocketError:UOs}});var Pqn=I((aof,kqn)=>{"use strict";p();var{createDeferredPromise:Nor}=nke(),{environmentSettingsObject:xqn}=iT(),{states:Ofe,opcodes:Got,sentCloseFrameState:Bfe}=Rj(),{webidl:sp}=xA(),{getURLRecord:QOs,isValidSubprotocol:qOs,isEstablished:jOs,utf8Decode:HOs}=dZ(),{establishWebSocketConnection:GOs,failWebsocketConnection:Mor,closeWebSocketConnection:Oor}=Uot(),{channels:wqn}=cj(),{WebsocketFrameSend:$Os}=Nfe(),{ByteParser:VOs}=xor(),{WebSocketError:WOs,createUnvalidatedWebSocketError:zOs}=Dor(),{kEnumerableProperty:$ot}=Do(),{utf8DecodeBytes:YOs}=fit(),Rqn=!1,Vot=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>Mor(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=Ofe.CLOSING,wqn.socketError.hasSubscribers&&wqn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:Ofe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){Rqn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),Rqn=!0),sp.argumentLengthCheck(arguments,1,"WebSocket"),e=sp.converters.USVString(e),r!==null&&(r=sp.converters.WebSocketStreamOptions(r));let n=xqn.settingsObject.baseUrl,o=QOs(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>qOs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Nor(),this.#r=Nor(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{jOs(this.#a.readyState)||(Mor(this.#a),this.#a.readyState=Ofe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=xqn.settingsObject;this.#a.controller=GOs(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=sp.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;Oor(this.#a,r,n,!0)}#u(e){e=sp.converters.WebSocketStreamWrite(e);let r=Nor(),n=null,o=null;if(sp.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Got.BINARY;else{let s;try{s=sp.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Got.TEXT}if(!this.#a.closeState.has(Bfe.SENT)&&!this.#a.closeState.has(Bfe.RECEIVED)){let s=new $Os(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=new VOs(this.#a,r);n.on("drain",()=>this.#a.onParserDrain()),n.on("error",u=>this.#a.onParserError(u)),this.#c=n,this.#a.readyState=Ofe.OPEN;let o=r??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:a(u=>{this.#i=u},"start"),cancel:a(u=>this.#h(u),"cancel")}),l=new WritableStream({write:a(u=>this.#u(u),"write"),close:a(()=>Oor(this.#a,null,null),"close"),abort:a(u=>this.#A(u),"abort")});this.#n=c,this.#o=l,this.#t.resolve({extensions:o,protocol:s,readable:c,writable:l})}#p(e,r){if(this.#a.readyState!==Ofe.OPEN)return;let n;if(e===Got.TEXT)try{n=HOs(r)}catch{Mor(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Got.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Bfe.SENT)&&this.#a.closeState.has(Bfe.RECEIVED);if(this.#a.readyState=Ofe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new WOs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Bfe.SENT)&&!this.#a.closeState.has(Bfe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":YOs(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=zOs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";sp.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),Oor(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Vot.prototype,{url:$ot,opened:$ot,closed:$ot,close:$ot,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});sp.converters.WebSocketStreamOptions=sp.dictionaryConverter([{key:"protocols",converter:sp.sequenceConverter(sp.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:sp.nullableConverter(sp.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);sp.converters.WebSocketCloseInfo=sp.dictionaryConverter([{key:"closeCode",converter:a(t=>sp.converters["unsigned short"](t,sp.attributes.EnforceRange),"converter")},{key:"reason",converter:sp.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);sp.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?sp.converters.USVString(t):sp.converters.BufferSource(t)};kqn.exports={WebSocketStream:Vot}});var Nqn=I((uof,Dqn)=>{"use strict";p();function KOs(t){return t.indexOf("\0")===-1}a(KOs,"isValidLastEventId");function JOs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(JOs,"isASCIINumber");Dqn.exports={isValidLastEventId:KOs,isASCIINumber:JOs}});var Lqn=I((pof,Bqn)=>{"use strict";p();var{Transform:ZOs}=require("node:stream"),{isASCIINumber:Mqn,isValidLastEventId:Oqn}=Nqn(),SF=[239,187,191],Bor=10,Wot=13,XOs=58,e5s=32,Lor=class extends ZOs{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===SF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===SF[0]&&this.buffer[1]===SF[1]&&this.buffer[2]===SF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&Mqn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&Oqn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};Bqn.exports={EventSourceStream:Lor}});var $qn=I((gof,Gqn)=>{"use strict";p();var{pipeline:t5s}=require("node:stream"),{fetching:r5s}=Gke(),{makeRequest:n5s}=xfe(),{webidl:K_}=xA(),{EventSourceStream:i5s}=Lqn(),{parseMIMEType:o5s}=pw(),{createFastMessageEvent:s5s}=Bot(),{isNetworkError:Fqn}=qke(),{kEnumerableProperty:hZ}=Do(),{environmentSettingsObject:Uqn}=iT(),Qqn=!1,qqn=3e3,Jke=0,jqn=1,Zke=2,a5s="anonymous",c5s="use-credentials",Lfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=Jke;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),K_.util.markAsUncloneable(this);let n="EventSource constructor";K_.argumentLengthCheck(arguments,1,n),Qqn||(Qqn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=K_.converters.USVString(e),r=K_.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=Uqn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=a5s;r.withCredentials===!0&&(c=c5s,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=Uqn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=n5s(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===Zke)return;this.#n=Jke;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!Fqn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(Fqn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?o5s(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=jqn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new i5s({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(s5s(u.type,u.options))},"push")});t5s(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=r5s(e)}#u(){this.#n!==Zke&&(this.#n=Jke,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===Jke&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){K_.brandCheck(this,t),this.#n!==Zke&&(this.#n=Zke,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=K_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=K_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=K_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},Hqn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:Jke,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:jqn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:Zke,writable:!1}};Object.defineProperties(Lfe,Hqn);Object.defineProperties(Lfe.prototype,Hqn);Object.defineProperties(Lfe.prototype,{close:hZ,onerror:hZ,onmessage:hZ,onopen:hZ,readyState:hZ,url:hZ,withCredentials:hZ});K_.converters.EventSourceInitDict=K_.dictionaryConverter([{key:"withCredentials",converter:K_.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:K_.converters.any},{key:"node",converter:K_.dictionaryConverter([{key:"reconnectionTime",converter:K_.converters["unsigned long"],defaultValue:a(()=>qqn,"defaultValue")},{key:"dispatcher",converter:K_.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);Gqn.exports={EventSource:Lfe,defaultReconnectionTime:qqn}});var For=I((Eof,yn)=>{"use strict";p();var l5s=yj(),Wqn=KRe(),u5s=VJ(),d5s=V8n(),f5s=K8n(),p5s=YJ(),h5s=Rnr(),m5s=Tnr(),g5s=M6n(),A5s=Q6n(),y5s=H6n(),zqn=ao(),Yot=Do(),{InvalidArgumentError:zot}=zqn,Ffe=S9n(),E5s=UJ(),_5s=hir(),{MockCallHistory:C5s,MockCallHistoryLog:v5s}=Air(),b5s=Iir(),S5s=Cir(),T5s=bUn(),I5s=Jnr(),x5s=$it(),{getGlobalDispatcher:Yqn,setGlobalDispatcher:w5s}=sot(),R5s=vfe(),k5s=Mir();Object.assign(Wqn.prototype,Ffe);yn.exports.Dispatcher=Wqn;yn.exports.Client=l5s;yn.exports.Pool=u5s;yn.exports.BalancedPool=d5s;yn.exports.RoundRobinPool=f5s;yn.exports.Agent=p5s;yn.exports.ProxyAgent=h5s;yn.exports.Socks5ProxyAgent=m5s;yn.exports.EnvHttpProxyAgent=g5s;yn.exports.RetryAgent=A5s;yn.exports.H2CClient=y5s;yn.exports.RetryHandler=x5s;yn.exports.DecoratorHandler=R5s;yn.exports.RedirectHandler=k5s;yn.exports.interceptors={redirect:MUn(),responseError:BUn(),retry:FUn(),dump:QUn(),dns:GUn(),cache:a7n(),decompress:f7n(),deduplicate:A7n()};yn.exports.cacheStores={MemoryCacheStore:Hir()};var P5s=_7n();yn.exports.cacheStores.SqliteCacheStore=P5s;yn.exports.buildConnector=E5s;yn.exports.errors=zqn;yn.exports.util={parseHeaders:Yot.parseHeaders,headerNameToString:Yot.headerNameToString};function Xke(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new zot("invalid url");if(r!=null&&typeof r!="object")throw new zot("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new zot("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Yot.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Yot.parseURL(e);let{agent:o,dispatcher:s=Yqn()}=r;if(o)throw new zot("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(Xke,"makeDispatcher");yn.exports.setGlobalDispatcher=w5s;yn.exports.getGlobalDispatcher=Yqn;var D5s=Gke().fetch,Vqn=typeof __filename<"u"?__filename:void 0;function Kqn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,Kqn),!o.stack)return;let s=o.stack.split(` + `)}close(){this.#r.close()}get(e){ror(e);let r=this.#g(e);return r?{body:r.body?Buffer.from(r.body.buffer,r.body.byteOffset,r.body.byteLength):void 0,statusCode:r.statusCode,statusMessage:r.statusMessage,headers:r.headers?JSON.parse(r.headers):void 0,etag:r.etag?r.etag:void 0,vary:r.vary?JSON.parse(r.vary):void 0,cacheControlDirectives:r.cacheControlDirectives?JSON.parse(r.cacheControlDirectives):void 0,cachedAt:r.cachedAt,staleAt:r.staleAt,deleteAt:r.deleteAt}:void 0}set(e,r){ror(e);let n=this.#p(e),o=Array.isArray(r.body)?Buffer.concat(r.body):r.body,s=o?.byteLength;if(s&&s>this.#e)return;let c=this.#g(e,!0);c?this.#i.run(o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.cachedAt,r.staleAt,c.id):(this.#o.run(n,e.method,o,r.deleteAt,r.statusCode,r.statusMessage,r.headers?JSON.stringify(r.headers):null,r.etag?r.etag:null,r.cacheControlDirectives?JSON.stringify(r.cacheControlDirectives):null,r.vary?JSON.stringify(r.vary):null,r.cachedAt,r.staleAt),this.#l())}createWriteStream(e,r){ror(e),vks(r);let n=0,o=[],s=this;return new _ks({decodeStrings:!0,write(c,l,u){n+=c.byteLength,n=u.deleteAt&&!r)continue;let d=!0;if(u.vary){let f=JSON.parse(u.vary);for(let h in f)if(!Cks(o[h],f[h])){d=!1;break}}if(d)return u}}};function Cks(t,e){return t==null&&e==null?!0:t==null&&e!=null||t!=null&&e==null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:t.every((r,n)=>r===e[n]):t===e}a(Cks,"headerValueEquals")});var ZJ=I((wtf,P7n)=>{"use strict";p();var{kConstruct:bks}=tl(),{kEnumerableProperty:vfe}=ko(),{iteratorMixin:Sks,isValidHeaderName:IPe,isValidHeaderValue:T7n}=ZS(),{webidl:xa}=PA(),ior=require("node:assert"),not=require("node:util");function S7n(t){return t===10||t===13||t===9||t===32}a(S7n,"isHTTPWhiteSpaceCharCode");function I7n(t){let e=0,r=t.length;for(;r>e&&S7n(t.charCodeAt(r-1));)--r;for(;r>e&&S7n(t.charCodeAt(e));)++e;return e===0&&r===t.length?t:t.substring(e,r)}a(I7n,"headerValueNormalize");function x7n(t,e){if(Array.isArray(e))for(let r=0;r>","record"]})}a(x7n,"fill");function oor(t,e,r){if(r=I7n(r),IPe(e)){if(!T7n(r))throw xa.errors.invalidArgument({prefix:"Headers.append",value:r,type:"header value"})}else throw xa.errors.invalidArgument({prefix:"Headers.append",value:e,type:"header name"});if(R7n(t)==="immutable")throw new TypeError("immutable");return oot(t).append(e,r,!1)}a(oor,"appendHeader");function Tks(t){let e=oot(t);if(!e)return[];if(e.sortedMap)return e.sortedMap;let r=[],n=e.toSortedArray(),o=e.cookies;if(o===null||o.length===1)return e.sortedMap=n;for(let s=0;s>1),r[d][0]<=f[0]?u=d+1:l=d;if(s!==d){for(c=s;c>u;)r[c]=r[--c];r[u]=f}}if(!n.next().done)throw new TypeError("Unreachable");return r}else{let n=0;for(let{0:o,1:{value:s}}of this.headersMap)r[n++]=[o,s],ior(s!==null);return r.sort(w7n)}}},Zk=class t{static{a(this,"Headers")}#e;#t;constructor(e=void 0){xa.util.markAsUncloneable(this),e!==bks&&(this.#t=new iot,this.#e="none",e!==void 0&&(e=xa.converters.HeadersInit(e,"Headers constructor","init"),x7n(this,e)))}append(e,r){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,2,"Headers.append");let n="Headers.append";return e=xa.converters.ByteString(e,n,"name"),r=xa.converters.ByteString(r,n,"value"),oor(this,e,r)}delete(e){if(xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.delete"),e=xa.converters.ByteString(e,"Headers.delete","name"),!IPe(e))throw xa.errors.invalidArgument({prefix:"Headers.delete",value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(e,!1)&&this.#t.delete(e,!1)}get(e){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.get");let r="Headers.get";if(e=xa.converters.ByteString(e,r,"name"),!IPe(e))throw xa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.get(e,!1)}has(e){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,1,"Headers.has");let r="Headers.has";if(e=xa.converters.ByteString(e,r,"name"),!IPe(e))throw xa.errors.invalidArgument({prefix:r,value:e,type:"header name"});return this.#t.contains(e,!1)}set(e,r){xa.brandCheck(this,t),xa.argumentLengthCheck(arguments,2,"Headers.set");let n="Headers.set";if(e=xa.converters.ByteString(e,n,"name"),r=xa.converters.ByteString(r,n,"value"),r=I7n(r),IPe(e)){if(!T7n(r))throw xa.errors.invalidArgument({prefix:n,value:r,type:"header value"})}else throw xa.errors.invalidArgument({prefix:n,value:e,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(e,r,!1)}getSetCookie(){xa.brandCheck(this,t);let e=this.#t.cookies;return e?[...e]:[]}[not.inspect.custom](e,r){return r.depth??=e,`Headers ${not.formatWithOptions(r,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,r){e.#e=r}static getHeadersList(e){return e.#t}static setHeadersList(e,r){e.#t=r}},{getHeadersGuard:R7n,setHeadersGuard:Iks,getHeadersList:oot,setHeadersList:xks}=Zk;Reflect.deleteProperty(Zk,"getHeadersGuard");Reflect.deleteProperty(Zk,"setHeadersGuard");Reflect.deleteProperty(Zk,"getHeadersList");Reflect.deleteProperty(Zk,"setHeadersList");Sks("Headers",Zk,Tks,0,1);Object.defineProperties(Zk.prototype,{append:vfe,delete:vfe,get:vfe,has:vfe,set:vfe,getSetCookie:vfe,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[not.inspect.custom]:{enumerable:!1}});xa.converters.HeadersInit=function(t,e,r){if(xa.util.Type(t)===xa.util.Types.OBJECT){let n=Reflect.get(t,Symbol.iterator);if(!not.types.isProxy(t)&&n===Zk.prototype.entries)try{return oot(t).entriesList}catch{}return typeof n=="function"?xa.converters["sequence>"](t,e,r,n.bind(t)):xa.converters["record"](t,e,r)}throw xa.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence>","record"]})};P7n.exports={fill:x7n,compareHeaderName:w7n,Headers:Zk,HeadersList:iot,getHeadersGuard:R7n,setHeadersGuard:Iks,setHeadersList:xks,getHeadersList:oot}});var wPe=I((ktf,j7n)=>{"use strict";p();var{Headers:B7n,HeadersList:k7n,fill:wks,getHeadersGuard:Rks,setHeadersGuard:L7n,setHeadersList:F7n}=ZJ(),{extractBody:D7n,cloneBody:Pks,mixinBody:kks,streamRegistry:U7n,bodyUnusable:Dks}=efe(),Q7n=ko(),N7n=require("node:util"),{kEnumerableProperty:oT}=Q7n,{isValidReasonPhrase:Nks,isCancelled:Mks,isAborted:Oks,isErrorLike:Bks,environmentSettingsObject:Lks}=ZS(),{redirectStatusSet:Fks,nullBodyStatus:Uks}=URe(),{webidl:Ys}=PA(),{URLSerializer:M7n}=fw(),{kConstruct:aot}=tl(),sor=require("node:assert"),{isomorphicEncode:Qks,serializeJavascriptValueToJSONString:qks}=sF(),jks=new TextEncoder("utf-8"),sT=class t{static{a(this,"Response")}#e;#t;static error(){return xPe(cot(),"immutable")}static json(e,r=void 0){Ys.argumentLengthCheck(arguments,1,"Response.json"),r!==null&&(r=Ys.converters.ResponseInit(r));let n=jks.encode(qks(e)),o=D7n(n),s=xPe(Cfe({}),"response");return O7n(s,r,{body:o[0],type:"application/json"}),s}static redirect(e,r=302){Ys.argumentLengthCheck(arguments,1,"Response.redirect"),e=Ys.converters.USVString(e),r=Ys.converters["unsigned short"](r);let n;try{n=new URL(e,Lks.settingsObject.baseUrl)}catch(c){throw new TypeError(`Failed to parse URL from ${e}`,{cause:c})}if(!Fks.has(r))throw new RangeError(`Invalid status code ${r}`);let o=xPe(Cfe({}),"immutable");o.#t.status=r;let s=Qks(M7n(n));return o.#t.headersList.append("location",s,!0),o}constructor(e=null,r=void 0){if(Ys.util.markAsUncloneable(this),e===aot)return;e!==null&&(e=Ys.converters.BodyInit(e,"Response","body")),r=Ys.converters.ResponseInit(r),this.#t=Cfe({}),this.#e=new B7n(aot),L7n(this.#e,"response"),F7n(this.#e,this.#t.headersList);let n=null;if(e!=null){let[o,s]=D7n(e);n={body:o,type:s}}O7n(this,r,n)}get type(){return Ys.brandCheck(this,t),this.#t.type}get url(){Ys.brandCheck(this,t);let e=this.#t.urlList,r=e[e.length-1]??null;return r===null?"":M7n(r,!0)}get redirected(){return Ys.brandCheck(this,t),this.#t.urlList.length>1}get status(){return Ys.brandCheck(this,t),this.#t.status}get ok(){return Ys.brandCheck(this,t),this.#t.status>=200&&this.#t.status<=299}get statusText(){return Ys.brandCheck(this,t),this.#t.statusText}get headers(){return Ys.brandCheck(this,t),this.#e}get body(){return Ys.brandCheck(this,t),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return Ys.brandCheck(this,t),!!this.#t.body&&Q7n.isDisturbed(this.#t.body.stream)}clone(){if(Ys.brandCheck(this,t),Dks(this.#t))throw Ys.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let e=aor(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&U7n.register(this,new WeakRef(this.#t.body.stream)),xPe(e,Rks(this.#e))}[N7n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${N7n.formatWithOptions(r,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,r){e.#e=r}static getResponseState(e){return e.#t}static setResponseState(e,r){e.#t=r}},{getResponseHeaders:Hks,setResponseHeaders:Gks,getResponseState:XJ,setResponseState:$ks}=sT;Reflect.deleteProperty(sT,"getResponseHeaders");Reflect.deleteProperty(sT,"setResponseHeaders");Reflect.deleteProperty(sT,"getResponseState");Reflect.deleteProperty(sT,"setResponseState");kks(sT,XJ);Object.defineProperties(sT.prototype,{type:oT,url:oT,status:oT,ok:oT,redirected:oT,statusText:oT,headers:oT,clone:oT,body:oT,bodyUsed:oT,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(sT,{json:oT,redirect:oT,error:oT});function aor(t){if(t.internalResponse)return q7n(aor(t.internalResponse),t.type);let e=Cfe({...t,body:null});return t.body!=null&&(e.body=Pks(t.body)),e}a(aor,"cloneResponse");function Cfe(t){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...t,headersList:t?.headersList?new k7n(t?.headersList):new k7n,urlList:t?.urlList?[...t.urlList]:[]}}a(Cfe,"makeResponse");function cot(t){let e=Bks(t);return Cfe({type:"error",status:0,error:e?t:new Error(t&&String(t)),aborted:t&&t.name==="AbortError"})}a(cot,"makeNetworkError");function Vks(t){return t.type==="error"&&t.status===0}a(Vks,"isNetworkError");function sot(t,e){return e={internalResponse:t,...e},new Proxy(t,{get(r,n){return n in e?e[n]:r[n]},set(r,n,o){return sor(!(n in e)),r[n]=o,!0}})}a(sot,"makeFilteredResponse");function q7n(t,e){if(e==="basic")return sot(t,{type:"basic",headersList:t.headersList});if(e==="cors")return sot(t,{type:"cors",headersList:t.headersList});if(e==="opaque")return sot(t,{type:"opaque",urlList:[],status:0,statusText:"",body:null});if(e==="opaqueredirect")return sot(t,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});sor(!1)}a(q7n,"filterResponse");function Wks(t,e=null){return sor(Mks(t)),Oks(t)?cot(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:e})):cot(Object.assign(new DOMException("Request was cancelled."),{cause:e}))}a(Wks,"makeAppropriateNetworkError");function O7n(t,e,r){if(e.status!==null&&(e.status<200||e.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in e&&e.statusText!=null&&!Nks(String(e.statusText)))throw new TypeError("Invalid statusText");if("status"in e&&e.status!=null&&(XJ(t).status=e.status),"statusText"in e&&e.statusText!=null&&(XJ(t).statusText=e.statusText),"headers"in e&&e.headers!=null&&wks(Hks(t),e.headers),r){if(Uks.includes(t.status))throw Ys.errors.exception({header:"Response constructor",message:`Invalid response status code ${t.status}`});XJ(t).body=r.body,r.type!=null&&!XJ(t).headersList.contains("content-type",!0)&&XJ(t).headersList.append("content-type",r.type,!0)}}a(O7n,"initializeResponse");function xPe(t,e){let r=new sT(aot);$ks(r,t);let n=new B7n(aot);return Gks(r,n),F7n(n,t.headersList),L7n(n,e),t.urlList.length!==0&&t.body?.stream&&U7n.register(r,new WeakRef(t.body.stream)),r}a(xPe,"fromInnerResponse");Ys.converters.XMLHttpRequestBodyInit=function(t,e,r){return typeof t=="string"?Ys.converters.USVString(t,e,r):Ys.is.Blob(t)||Ys.is.BufferSource(t)||Ys.is.FormData(t)||Ys.is.URLSearchParams(t)?t:Ys.converters.DOMString(t,e,r)};Ys.converters.BodyInit=function(t,e,r){return Ys.is.ReadableStream(t)||t?.[Symbol.asyncIterator]?t:Ys.converters.XMLHttpRequestBodyInit(t,e,r)};Ys.converters.ResponseInit=Ys.dictionaryConverter([{key:"status",converter:Ys.converters["unsigned short"],defaultValue:a(()=>200,"defaultValue")},{key:"statusText",converter:Ys.converters.ByteString,defaultValue:a(()=>"","defaultValue")},{key:"headers",converter:Ys.converters.HeadersInit}]);Ys.is.Response=Ys.util.MakeTypeAssertion(sT);j7n.exports={isNetworkError:Vks,makeNetworkError:cot,makeResponse:Cfe,makeAppropriateNetworkError:Wks,filterResponse:q7n,Response:sT,cloneResponse:aor,fromInnerResponse:xPe,getResponseState:XJ}});var bfe=I((Mtf,rQn)=>{"use strict";p();var{extractBody:zks,mixinBody:Yks,cloneBody:Kks,bodyUnusable:H7n}=efe(),{Headers:Y7n,fill:Jks,HeadersList:dot,setHeadersGuard:cor,getHeadersGuard:Zks,setHeadersList:K7n,getHeadersList:G7n}=ZJ(),uot=ko(),$7n=require("node:util"),{isValidHTTPToken:Xks,sameOrigin:V7n,environmentSettingsObject:lot}=ZS(),{forbiddenMethodsSet:e2s,corsSafeListedMethodsSet:t2s,referrerPolicy:r2s,requestRedirect:n2s,requestMode:i2s,requestCredentials:o2s,requestCache:s2s,requestDuplex:a2s}=URe(),{kEnumerableProperty:t0,normalizedMethodRecordsBase:c2s,normalizedMethodRecords:l2s}=uot,{webidl:Ni}=PA(),{URLSerializer:u2s}=fw(),{kConstruct:fot}=tl(),d2s=require("node:assert"),{getMaxListeners:J7n,setMaxListeners:f2s,defaultMaxListeners:p2s}=require("node:events"),h2s=Symbol("abortController"),Z7n=new FinalizationRegistry(({signal:t,abort:e})=>{t.removeEventListener("abort",e)}),pot=new WeakMap,lor;try{lor=J7n(new AbortController().signal)>0}catch{lor=!1}function W7n(t){return e;function e(){let r=t.deref();if(r!==void 0){Z7n.unregister(e),this.removeEventListener("abort",e),r.abort(this.reason);let n=pot.get(r.signal);if(n!==void 0){if(n.size!==0){for(let o of n){let s=o.deref();s!==void 0&&s.abort(this.reason)}n.clear()}pot.delete(r.signal)}}}}a(W7n,"buildAbort");var z7n=!1,XC=class t{static{a(this,"Request")}#e;#t;#r;#n;constructor(e,r=void 0){if(Ni.util.markAsUncloneable(this),e===fot)return;Ni.argumentLengthCheck(arguments,1,"Request constructor"),e=Ni.converters.RequestInfo(e),r=Ni.converters.RequestInit(r);let o=null,s=null,c=lot.settingsObject.baseUrl,l=null;if(typeof e=="string"){this.#t=r.dispatcher;let _;try{_=new URL(e,c)}catch(v){throw new TypeError("Failed to parse URL from "+e,{cause:v})}if(_.username||_.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+e);o=hot({urlList:[_]}),s="cors"}else d2s(Ni.is.Request(e)),o=e.#n,l=e.#e,this.#t=r.dispatcher||e.#t;let u=lot.settingsObject.origin,d="client";if(o.window?.constructor?.name==="EnvironmentSettingsObject"&&V7n(o.window,u)&&(d=o.window),r.window!=null)throw new TypeError(`'window' option '${d}' must be null`);"window"in r&&(d="no-window"),o=hot({method:o.method,headersList:o.headersList,unsafeRequest:o.unsafeRequest,client:lot.settingsObject,window:d,priority:o.priority,origin:o.origin,referrer:o.referrer,referrerPolicy:o.referrerPolicy,mode:o.mode,credentials:o.credentials,cache:o.cache,redirect:o.redirect,integrity:o.integrity,keepalive:o.keepalive,reloadNavigation:o.reloadNavigation,historyNavigation:o.historyNavigation,urlList:[...o.urlList]});let f=Object.keys(r).length!==0;if(f&&(o.mode==="navigate"&&(o.mode="same-origin"),o.reloadNavigation=!1,o.historyNavigation=!1,o.origin="client",o.referrer="client",o.referrerPolicy="",o.url=o.urlList[o.urlList.length-1],o.urlList=[o.url]),r.referrer!==void 0){let _=r.referrer;if(_==="")o.referrer="no-referrer";else{let v;try{v=new URL(_,c)}catch(b){throw new TypeError(`Referrer "${_}" is not a valid URL.`,{cause:b})}v.protocol==="about:"&&v.hostname==="client"||u&&!V7n(v,lot.settingsObject.baseUrl)?o.referrer="client":o.referrer=v}}r.referrerPolicy!==void 0&&(o.referrerPolicy=r.referrerPolicy);let h;if(r.mode!==void 0?h=r.mode:h=s,h==="navigate")throw Ni.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(h!=null&&(o.mode=h),r.credentials!==void 0&&(o.credentials=r.credentials),r.cache!==void 0&&(o.cache=r.cache),o.cache==="only-if-cached"&&o.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(r.redirect!==void 0&&(o.redirect=r.redirect),r.integrity!=null&&(o.integrity=String(r.integrity)),r.keepalive!==void 0&&(o.keepalive=!!r.keepalive),r.method!==void 0){let _=r.method,v=l2s[_];if(v!==void 0)o.method=v;else{if(!Xks(_))throw new TypeError(`'${_}' is not a valid HTTP method.`);let b=_.toUpperCase();if(e2s.has(b))throw new TypeError(`'${_}' HTTP method is unsupported.`);_=c2s[b]??_,o.method=_}!z7n&&o.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),z7n=!0)}r.signal!==void 0&&(l=r.signal),this.#n=o;let m=new AbortController;if(this.#e=m.signal,l!=null)if(l.aborted)m.abort(l.reason);else{this[h2s]=m;let _=new WeakRef(m),v=W7n(_);lor&&J7n(l)===p2s&&f2s(1500,l),uot.addAbortListener(l,v),Z7n.register(m,{signal:l,abort:v},v)}if(this.#r=new Y7n(fot),K7n(this.#r,o.headersList),cor(this.#r,"request"),h==="no-cors"){if(!t2s.has(o.method))throw new TypeError(`'${o.method} is unsupported in no-cors mode.`);cor(this.#r,"request-no-cors")}if(f){let _=G7n(this.#r),v=r.headers!==void 0?r.headers:new dot(_);if(_.clear(),v instanceof dot){for(let{name:b,value:T}of v.rawValues())_.append(b,T,!1);_.cookies=v.cookies}else Jks(this.#r,v)}let g=Ni.is.Request(e)?e.#n.body:null;if((r.body!=null||g!=null)&&(o.method==="GET"||o.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let A=null;if(r.body!=null){let[_,v]=zks(r.body,o.keepalive);A=_,v&&!G7n(this.#r).contains("content-type",!0)&&this.#r.append("content-type",v,!0)}let y=A??g;if(y!=null&&y.source==null){if(A!=null&&r.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(o.mode!=="same-origin"&&o.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');o.useCORSPreflightFlag=!0}let E=y;if(A==null&&g!=null){if(H7n(e.#n))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let _=new TransformStream;g.stream.pipeThrough(_),E={source:g.source,length:g.length,stream:_.readable}}this.#n.body=E}get method(){return Ni.brandCheck(this,t),this.#n.method}get url(){return Ni.brandCheck(this,t),u2s(this.#n.url)}get headers(){return Ni.brandCheck(this,t),this.#r}get destination(){return Ni.brandCheck(this,t),this.#n.destination}get referrer(){return Ni.brandCheck(this,t),this.#n.referrer==="no-referrer"?"":this.#n.referrer==="client"?"about:client":this.#n.referrer.toString()}get referrerPolicy(){return Ni.brandCheck(this,t),this.#n.referrerPolicy}get mode(){return Ni.brandCheck(this,t),this.#n.mode}get credentials(){return Ni.brandCheck(this,t),this.#n.credentials}get cache(){return Ni.brandCheck(this,t),this.#n.cache}get redirect(){return Ni.brandCheck(this,t),this.#n.redirect}get integrity(){return Ni.brandCheck(this,t),this.#n.integrity}get keepalive(){return Ni.brandCheck(this,t),this.#n.keepalive}get isReloadNavigation(){return Ni.brandCheck(this,t),this.#n.reloadNavigation}get isHistoryNavigation(){return Ni.brandCheck(this,t),this.#n.historyNavigation}get signal(){return Ni.brandCheck(this,t),this.#e}get body(){return Ni.brandCheck(this,t),this.#n.body?this.#n.body.stream:null}get bodyUsed(){return Ni.brandCheck(this,t),!!this.#n.body&&uot.isDisturbed(this.#n.body.stream)}get duplex(){return Ni.brandCheck(this,t),"half"}clone(){if(Ni.brandCheck(this,t),H7n(this.#n))throw new TypeError("unusable");let e=eQn(this.#n),r=new AbortController;if(this.signal.aborted)r.abort(this.signal.reason);else{let n=pot.get(this.signal);n===void 0&&(n=new Set,pot.set(this.signal,n));let o=new WeakRef(r);n.add(o),uot.addAbortListener(r.signal,W7n(o))}return tQn(e,this.#t,r.signal,Zks(this.#r))}[$7n.inspect.custom](e,r){r.depth===null&&(r.depth=2),r.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${$7n.formatWithOptions(r,n)}`}static setRequestSignal(e,r){return e.#e=r,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,r){e.#t=r}static setRequestHeaders(e,r){e.#r=r}static getRequestState(e){return e.#n}static setRequestState(e,r){e.#n=r}},{setRequestSignal:m2s,getRequestDispatcher:g2s,setRequestDispatcher:A2s,setRequestHeaders:y2s,getRequestState:X7n,setRequestState:E2s}=XC;Reflect.deleteProperty(XC,"setRequestSignal");Reflect.deleteProperty(XC,"getRequestDispatcher");Reflect.deleteProperty(XC,"setRequestDispatcher");Reflect.deleteProperty(XC,"setRequestHeaders");Reflect.deleteProperty(XC,"getRequestState");Reflect.deleteProperty(XC,"setRequestState");Yks(XC,X7n);function hot(t){return{method:t.method??"GET",localURLsOnly:t.localURLsOnly??!1,unsafeRequest:t.unsafeRequest??!1,body:t.body??null,client:t.client??null,reservedClient:t.reservedClient??null,replacesClientId:t.replacesClientId??"",window:t.window??"client",keepalive:t.keepalive??!1,serviceWorkers:t.serviceWorkers??"all",initiator:t.initiator??"",destination:t.destination??"",priority:t.priority??null,origin:t.origin??"client",policyContainer:t.policyContainer??"client",referrer:t.referrer??"client",referrerPolicy:t.referrerPolicy??"",mode:t.mode??"no-cors",useCORSPreflightFlag:t.useCORSPreflightFlag??!1,credentials:t.credentials??"same-origin",useCredentials:t.useCredentials??!1,cache:t.cache??"default",redirect:t.redirect??"follow",integrity:t.integrity??"",cryptoGraphicsNonceMetadata:t.cryptoGraphicsNonceMetadata??"",parserMetadata:t.parserMetadata??"",reloadNavigation:t.reloadNavigation??!1,historyNavigation:t.historyNavigation??!1,userActivation:t.userActivation??!1,taintedOrigin:t.taintedOrigin??!1,redirectCount:t.redirectCount??0,responseTainting:t.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:t.preventNoCacheCacheControlHeaderModification??!1,done:t.done??!1,timingAllowFailed:t.timingAllowFailed??!1,useURLCredentials:t.useURLCredentials??void 0,traversableForUserPrompts:t.traversableForUserPrompts??"client",urlList:t.urlList,url:t.urlList[0],headersList:t.headersList?new dot(t.headersList):new dot}}a(hot,"makeRequest");function eQn(t){let e=hot({...t,body:null});return t.body!=null&&(e.body=Kks(t.body)),e}a(eQn,"cloneRequest");function tQn(t,e,r,n){let o=new XC(fot);E2s(o,t),A2s(o,e),m2s(o,r);let s=new Y7n(fot);return y2s(o,s),K7n(s,t.headersList),cor(s,n),o}a(tQn,"fromInnerRequest");Object.defineProperties(XC.prototype,{method:t0,url:t0,headers:t0,redirect:t0,clone:t0,signal:t0,duplex:t0,destination:t0,body:t0,bodyUsed:t0,isHistoryNavigation:t0,isReloadNavigation:t0,keepalive:t0,integrity:t0,cache:t0,credentials:t0,attribute:t0,referrerPolicy:t0,referrer:t0,mode:t0,[Symbol.toStringTag]:{value:"Request",configurable:!0}});Ni.is.Request=Ni.util.MakeTypeAssertion(XC);Ni.converters.RequestInfo=function(t){return typeof t=="string"?Ni.converters.USVString(t):Ni.is.Request(t)?t:Ni.converters.USVString(t)};Ni.converters.RequestInit=Ni.dictionaryConverter([{key:"method",converter:Ni.converters.ByteString},{key:"headers",converter:Ni.converters.HeadersInit},{key:"body",converter:Ni.nullableConverter(Ni.converters.BodyInit)},{key:"referrer",converter:Ni.converters.USVString},{key:"referrerPolicy",converter:Ni.converters.DOMString,allowedValues:r2s},{key:"mode",converter:Ni.converters.DOMString,allowedValues:i2s},{key:"credentials",converter:Ni.converters.DOMString,allowedValues:o2s},{key:"cache",converter:Ni.converters.DOMString,allowedValues:s2s},{key:"redirect",converter:Ni.converters.DOMString,allowedValues:n2s},{key:"integrity",converter:Ni.converters.DOMString},{key:"keepalive",converter:Ni.converters.boolean},{key:"signal",converter:Ni.nullableConverter(t=>Ni.converters.AbortSignal(t,"RequestInit","signal"))},{key:"window",converter:Ni.converters.any},{key:"duplex",converter:Ni.converters.DOMString,allowedValues:a2s},{key:"dispatcher",converter:Ni.converters.any},{key:"priority",converter:Ni.converters.DOMString,allowedValues:["high","low","auto"],defaultValue:a(()=>"auto","defaultValue")}]);rQn.exports={Request:XC,makeRequest:hot,fromInnerRequest:tQn,cloneRequest:eQn,getRequestDispatcher:g2s,getRequestState:X7n}});var uQn=I((Ltf,lQn)=>{"use strict";p();var _2s=require("node:assert"),{runtimeFeatures:iQn}=aF(),eZ=new Map([["sha256",0],["sha384",1],["sha512",2]]),uor;if(iQn.has("crypto")){uor=require("node:crypto");let t=uor.getHashes();t.length===0&&eZ.clear();for(let e of eZ.keys())t.includes(e)===!1&&eZ.delete(e)}else eZ.clear();var nQn=Map.prototype.get.bind(eZ),dor=Map.prototype.has.bind(eZ),v2s=iQn.has("crypto")===!1||eZ.size===0?()=>!0:(t,e)=>{let r=sQn(e);if(r.length===0)return!0;let n=oQn(r);for(let o of n){let s=o.alg,c=o.val,l=aQn(s,t);if(cQn(l,c))return!0}return!1};function oQn(t){let e=[],r=null;for(let n of t){if(_2s(dor(n.alg),"Invalid SRI hash algorithm token"),e.length===0){e.push(n),r=n;continue}let o=r.alg,s=nQn(o),c=n.alg,l=nQn(c);ls?(r=n,e[0]=n,e.length=1):e.push(n))}return e}a(oQn,"getStrongestMetadata");function sQn(t){let e=[];for(let r of t.split(" ")){let o=r.split("?",1)[0],s="",c=[o.slice(0,6),o.slice(7)],l=c[0];if(!dor(l))continue;c[1]&&(s=c[1]);let u={alg:l,val:s};e.push(u)}return e}a(sQn,"parseMetadata");var aQn=a((t,e)=>uor.hash(t,e,"base64"),"applyAlgorithmToBytes");function cQn(t,e){let r=t.length;r!==0&&t[r-1]==="="&&(r-=1),r!==0&&t[r-1]==="="&&(r-=1);let n=e.length;if(n!==0&&e[n-1]==="="&&(n-=1),n!==0&&e[n-1]==="="&&(n-=1),r!==n)return!1;for(let o=0;o{"use strict";p();var{makeNetworkError:nl,makeAppropriateNetworkError:RPe,filterResponse:por,makeResponse:mot,fromInnerResponse:C2s,getResponseState:b2s}=wPe(),{HeadersList:hor}=ZJ(),{Request:S2s,cloneRequest:T2s,getRequestDispatcher:I2s,getRequestState:x2s}=bfe(),Xk=require("node:zlib"),{makePolicyContainer:w2s,clonePolicyContainer:R2s,requestBadPort:P2s,TAOCheck:k2s,appendRequestOriginHeader:D2s,responseLocationURL:N2s,requestCurrentURL:aT,setRequestReferrerPolicyOnRedirect:M2s,tryUpgradeRequestToAPotentiallyTrustworthyURL:O2s,createOpaqueTimingInfo:_or,appendFetchMetadata:B2s,corsCheck:L2s,crossOriginResourcePolicyCheck:F2s,determineRequestsReferrer:U2s,coarsenedSharedCurrentTime:PPe,sameOrigin:yor,isCancelled:Cj,isAborted:dQn,isErrorLike:Q2s,fullyReadBody:q2s,readableStreamClose:j2s,urlIsLocal:H2s,urlIsHttpHttpsScheme:Eot,urlHasHttpsScheme:G2s,clampAndCoarsenConnectionTimingInfo:$2s,simpleRangeHeaderValue:V2s,buildContentRange:W2s,createInflate:z2s,extractMimeType:Y2s,hasAuthenticationEntry:K2s,includesCredentials:fQn,isTraversableNavigable:J2s}=ZS(),tZ=require("node:assert"),{safelyExtractBody:_ot,extractBody:pQn}=efe(),{redirectStatusSet:AQn,nullBodyStatus:yQn,safeMethodsSet:Z2s,requestBodyHeader:X2s,subresourceSet:eDs}=URe(),tDs=require("node:events"),{Readable:rDs,pipeline:nDs,finished:iDs,isErrored:oDs,isReadable:got}=require("node:stream"),{addAbortListener:sDs,bufferToLowerCasedHeaderName:hQn}=ko(),{dataURLProcessor:aDs,serializeAMimeType:cDs,minimizeSupportedMimeType:lDs}=fw(),{getGlobalDispatcher:uDs}=eot(),{webidl:vor}=PA(),{STATUS_CODES:mQn}=require("node:http"),{bytesMatch:dDs}=uQn(),{createDeferredPromise:fDs}=GRe(),{isomorphicEncode:Aot}=sF(),{runtimeFeatures:pDs}=aF(),hDs=pDs.has("zstd"),mDs=["GET","HEAD"],gDs=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",mor,yot=class extends tDs{static{a(this,"Fetch")}constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(e){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(e),this.emit("terminated",e))}abort(e){this.state==="ongoing"&&(this.state="aborted",e||(e=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit("terminated",e))}};function ADs(t){EQn(t,"fetch")}a(ADs,"handleFetchDone");function yDs(t,e=void 0){vor.argumentLengthCheck(arguments,1,"globalThis.fetch");let r=fDs(),n;try{n=new S2s(t,e)}catch(f){return r.reject(f),r.promise}let o=x2s(n);if(n.signal.aborted)return gor(r,o,null,n.signal.reason,null),r.promise;o.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(o.serviceWorkers="none");let c=null,l=!1,u=null;return sDs(n.signal,()=>{l=!0,tZ(u!=null),u.abort(n.signal.reason);let f=c?.deref();gor(r,o,f,n.signal.reason,u.controller)}),u=vQn({request:o,processResponseEndOfBody:ADs,processResponse:a(f=>{if(!l){if(f.aborted){gor(r,o,c,u.serializedAbortReason,u.controller);return}if(f.type==="error"){r.reject(new TypeError("fetch failed",{cause:f.error}));return}c=new WeakRef(C2s(f,"immutable")),r.resolve(c.deref()),r=null}},"processResponse"),dispatcher:I2s(n),requestObject:n}),r.promise}a(yDs,"fetch");function EQn(t,e="other"){if(t.type==="error"&&t.aborted||!t.urlList?.length)return;let r=t.urlList[0],n=t.timingInfo,o=t.cacheState;Eot(r)&&n!==null&&(t.timingAllowPassed||(n=_or({startTime:n.startTime}),o=""),n.endTime=PPe(),t.timingInfo=n,_Qn(n,r.href,e,globalThis,o,"",t.status))}a(EQn,"finalizeAndReportTiming");var _Qn=performance.markResourceTiming;function gor(t,e,r,n,o){if(t&&t.reject(n),e.body?.stream!=null&&got(e.body.stream)&&e.body.stream.cancel(n).catch(c=>{if(c.code!=="ERR_INVALID_STATE")throw c}),r==null)return;let s=b2s(r);s.body?.stream!=null&&got(s.body.stream)&&o.error(n)}a(gor,"abortFetch");function vQn({request:t,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseEndOfBody:o,processResponseConsumeBody:s,useParallelQueue:c=!1,dispatcher:l=uDs(),requestObject:u=null}){tZ(l);let d=null,f=!1;t.client!=null&&(d=t.client.globalObject,f=t.client.crossOriginIsolatedCapability);let h=PPe(f),m=_or({startTime:h}),g={controller:new yot(l),request:t,timingInfo:m,processRequestBodyChunkLength:e,processRequestEndOfBody:r,processResponse:n,processResponseConsumeBody:s,processResponseEndOfBody:o,taskDestination:d,crossOriginIsolatedCapability:f,requestObject:u};return tZ(!t.body||t.body.stream),t.window==="client"&&(t.window=t.client?.globalObject?.constructor?.name==="Window"?t.client:"no-window"),t.origin==="client"&&(t.origin=t.client.origin),t.policyContainer==="client"&&(t.client!=null?t.policyContainer=R2s(t.client.policyContainer):t.policyContainer=w2s()),t.headersList.contains("accept",!0)||t.headersList.append("accept","*/*",!0),t.headersList.contains("accept-language",!0)||t.headersList.append("accept-language","*",!0),t.priority,eDs.has(t.destination),CQn(g,!1),g.controller}a(vQn,"fetching");async function CQn(t,e){try{let r=t.request,n=null;if(r.localURLsOnly&&!H2s(aT(r))&&(n=nl("local URLs only")),O2s(r),P2s(r)==="blocked"&&(n=nl("bad port")),r.referrerPolicy===""&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!=="no-referrer"&&(r.referrer=U2s(r)),n===null){let s=aT(r);yor(s,r.url)&&r.responseTainting==="basic"||s.protocol==="data:"||r.mode==="navigate"||r.mode==="websocket"?(r.responseTainting="basic",n=await gQn(t)):r.mode==="same-origin"?n=nl('request mode cannot be "same-origin"'):r.mode==="no-cors"?r.redirect!=="follow"?n=nl('redirect mode cannot be "follow" for "no-cors" request'):(r.responseTainting="opaque",n=await gQn(t)):Eot(aT(r))?(r.responseTainting="cors",n=await bQn(t)):n=nl("URL scheme must be a HTTP(S) scheme")}if(e)return n;n.status!==0&&!n.internalResponse&&(r.responseTainting,r.responseTainting==="basic"?n=por(n,"basic"):r.responseTainting==="cors"?n=por(n,"cors"):r.responseTainting==="opaque"?n=por(n,"opaque"):tZ(!1));let o=n.status===0?n:n.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(n.timingAllowPassed=!0),n.type==="opaque"&&o.status===206&&o.rangeRequested&&!r.headers.contains("range",!0)&&(n=o=nl()),n.status!==0&&(r.method==="HEAD"||r.method==="CONNECT"||yQn.includes(o.status))&&(o.body=null,t.controller.dump=!0),r.integrity){let s=a(l=>Aor(t,nl(l)),"processBodyError");if(r.responseTainting==="opaque"||n.body==null){s(n.error);return}let c=a(l=>{if(!dDs(l,r.integrity)){s("integrity mismatch");return}n.body=_ot(l)[0],Aor(t,n)},"processBody");q2s(n.body,c,s)}else Aor(t,n)}catch(r){t.controller.terminate(r)}}a(CQn,"mainFetch");function gQn(t){if(Cj(t)&&t.request.redirectCount===0)return Promise.resolve(RPe(t));let{request:e}=t,{protocol:r}=aT(e);switch(r){case"about:":return Promise.resolve(nl("about scheme is not supported"));case"blob:":{mor||(mor=require("node:buffer").resolveObjectURL);let n=aT(e);if(n.search.length!==0)return Promise.resolve(nl("NetworkError when attempting to fetch resource."));let o=mor(n.toString());if(e.method!=="GET"||!vor.is.Blob(o))return Promise.resolve(nl("invalid method"));let s=mot(),c=o.size,l=Aot(`${c}`),u=o.type;if(e.headersList.contains("range",!0)){s.rangeRequested=!0;let d=e.headersList.get("range",!0),f=V2s(d,!0);if(f==="failure")return Promise.resolve(nl("failed to fetch the data URL"));let{rangeStartValue:h,rangeEndValue:m}=f;if(h===null)h=c-m,m=h+m-1;else{if(h>=c)return Promise.resolve(nl("Range start is greater than the blob's size."));(m===null||m>=c)&&(m=c-1)}let g=o.slice(h,m+1,u),A=pQn(g);s.body=A[0];let y=Aot(`${g.size}`),E=W2s(h,m,c);s.status=206,s.statusText="Partial Content",s.headersList.set("content-length",y,!0),s.headersList.set("content-type",u,!0),s.headersList.set("content-range",E,!0)}else{let d=pQn(o);s.statusText="OK",s.body=d[0],s.headersList.set("content-length",l,!0),s.headersList.set("content-type",u,!0)}return Promise.resolve(s)}case"data:":{let n=aT(e),o=aDs(n);if(o==="failure")return Promise.resolve(nl("failed to fetch the data URL"));let s=cDs(o.mimeType);return Promise.resolve(mot({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:s}]],body:_ot(o.body)[0]}))}case"file:":return Promise.resolve(nl("not implemented... yet..."));case"http:":case"https:":return bQn(t).catch(n=>nl(n));default:return Promise.resolve(nl("unknown scheme"))}}a(gQn,"schemeFetch");function EDs(t,e){t.request.done=!0,t.processResponseDone!=null&&queueMicrotask(()=>t.processResponseDone(e))}a(EDs,"finalizeResponse");function Aor(t,e){let r=t.timingInfo,n=a(()=>{let s=Date.now();t.request.destination==="document"&&(t.controller.fullTimingInfo=r),t.controller.reportTimingSteps=()=>{if(!Eot(t.request.url))return;r.endTime=s;let l=e.cacheState,u=e.bodyInfo;e.timingAllowPassed||(r=_or(r),l="");let d=0;if(t.request.mode!=="navigate"||!e.hasCrossOriginRedirects){d=e.status;let f=Y2s(e.headersList);f!=="failure"&&(u.contentType=lDs(f))}t.request.initiatorType!=null&&_Qn(r,t.request.url.href,t.request.initiatorType,globalThis,l,u,d)};let c=a(()=>{t.request.done=!0,t.processResponseEndOfBody!=null&&queueMicrotask(()=>t.processResponseEndOfBody(e)),t.request.initiatorType!=null&&t.controller.reportTimingSteps()},"processResponseEndOfBodyTask");queueMicrotask(()=>c())},"processResponseEndOfBody");t.processResponse!=null&&queueMicrotask(()=>{t.processResponse(e),t.processResponse=null});let o=e.type==="error"?e:e.internalResponse??e;o.body==null?n():iDs(o.body.stream,()=>{n()})}a(Aor,"fetchFinale");async function bQn(t){let e=t.request,r=null,n=null,o=t.timingInfo;if(e.serviceWorkers,r===null){if(e.redirect==="follow"&&(e.serviceWorkers="none"),n=r=await Eor(t),e.responseTainting==="cors"&&L2s(e,r)==="failure")return nl("cors failure");k2s(e,r)==="failure"&&(e.timingAllowFailed=!0)}return(e.responseTainting==="opaque"||r.type==="opaque")&&F2s(e.origin,e.client,e.destination,n)==="blocked"?nl("blocked"):(AQn.has(n.status)&&(e.redirect!=="manual"&&t.controller.connection.destroy(void 0,!1),e.redirect==="error"?r=nl("unexpected redirect"):e.redirect==="manual"?r=n:e.redirect==="follow"?r=await _Ds(t,r):tZ(!1)),r.timingInfo=o,r)}a(bQn,"httpFetch");function _Ds(t,e){let r=t.request,n=e.internalResponse?e.internalResponse:e,o;try{if(o=N2s(n,aT(r).hash),o==null)return e}catch(c){return Promise.resolve(nl(c))}if(!Eot(o))return Promise.resolve(nl("URL scheme must be a HTTP(S) scheme"));if(r.redirectCount===20)return Promise.resolve(nl("redirect count exceeded"));if(r.redirectCount+=1,r.mode==="cors"&&(o.username||o.password)&&!yor(r,o))return Promise.resolve(nl('cross origin not allowed for request mode "cors"'));if(r.responseTainting==="cors"&&(o.username||o.password))return Promise.resolve(nl('URL cannot contain credentials for request mode "cors"'));if(n.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(nl());if([301,302].includes(n.status)&&r.method==="POST"||n.status===303&&!mDs.includes(r.method)){r.method="GET",r.body=null;for(let c of X2s)r.headersList.delete(c)}yor(aT(r),o)||(r.headersList.delete("authorization",!0),r.headersList.delete("proxy-authorization",!0),r.headersList.delete("cookie",!0),r.headersList.delete("host",!0)),r.body!=null&&(tZ(r.body.source!=null),r.body=_ot(r.body.source)[0]);let s=t.timingInfo;return s.redirectEndTime=s.postRedirectStartTime=PPe(t.crossOriginIsolatedCapability),s.redirectStartTime===0&&(s.redirectStartTime=s.startTime),r.urlList.push(o),M2s(r,n),CQn(t,!0)}a(_Ds,"httpRedirectFetch");async function Eor(t,e=!1,r=!1){let n=t.request,o=null,s=null,c=null,l=null,u=!1;n.window==="no-window"&&n.redirect==="error"?(o=t,s=n):(s=T2s(n),o={...t},o.request=s);let d=n.credentials==="include"||n.credentials==="same-origin"&&n.responseTainting==="basic",f=s.body?s.body.length:null,h=null;if(s.body==null&&["POST","PUT"].includes(s.method)&&(h="0"),f!=null&&(h=Aot(`${f}`)),h!=null&&!s.headersList.contains("content-length",!0)&&s.headersList.append("content-length",h,!0),f!=null&&s.keepalive,vor.is.URL(s.referrer)&&s.headersList.append("referer",Aot(s.referrer.href),!0),D2s(s),B2s(s),s.headersList.contains("user-agent",!0)||s.headersList.append("user-agent",gDs,!0),s.cache==="default"&&(s.headersList.contains("if-modified-since",!0)||s.headersList.contains("if-none-match",!0)||s.headersList.contains("if-unmodified-since",!0)||s.headersList.contains("if-match",!0)||s.headersList.contains("if-range",!0))&&(s.cache="no-store"),s.cache==="no-cache"&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains("cache-control",!0)&&s.headersList.append("cache-control","max-age=0",!0),(s.cache==="no-store"||s.cache==="reload")&&(s.headersList.contains("pragma",!0)||s.headersList.append("pragma","no-cache",!0),s.headersList.contains("cache-control",!0)||s.headersList.append("cache-control","no-cache",!0)),s.headersList.contains("range",!0)&&s.headersList.append("accept-encoding","identity",!0),s.headersList.contains("accept-encoding",!0)||(G2s(aT(s))?s.headersList.append("accept-encoding","br, gzip, deflate",!0):s.headersList.append("accept-encoding","gzip, deflate",!0)),s.headersList.delete("host",!0),d&&!s.headersList.contains("authorization",!0)){let m=null;if(!(K2s(s)&&(s.useURLCredentials===void 0||!fQn(aT(s))))){if(fQn(aT(s))&&e){let{username:g,password:A}=aT(s);m=`Basic ${Buffer.from(`${g}:${A}`).toString("base64")}`}}m!==null&&s.headersList.append("Authorization",m,!1)}if(l==null&&(s.cache="no-store"),s.cache!=="no-store"&&s.cache,c==null){if(s.cache==="only-if-cached")return nl("only if cached");let m=await vDs(o,d,r);!Z2s.has(s.method)&&m.status>=200&&m.status<=399,u&&m.status,c==null&&(c=m)}if(c.urlList=[...s.urlList],s.headersList.contains("range",!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=d,c.status===401&&s.responseTainting!=="cors"&&d&&(n.useURLCredentials!==void 0||J2s(n.traversableForUserPrompts))){if(n.body!=null){if(n.body.source==null)return c;n.body=_ot(n.body.source)[0]}if(n.useURLCredentials===void 0||e)return Cj(t)?RPe(t):c;t.controller.connection.destroy(),c=await Eor(t,!0)}if(c.status===407)return n.window==="no-window"?nl():Cj(t)?RPe(t):nl("proxy authentication required");if(c.status===421&&!r&&(n.body==null||n.body.source!=null)){if(Cj(t))return RPe(t);t.controller.connection.destroy(),c=await Eor(t,e,!0)}return c}a(Eor,"httpNetworkOrCacheFetch");async function vDs(t,e=!1,r=!1){tZ(!t.controller.connection||t.controller.connection.destroyed),t.controller.connection={abort:null,destroyed:!1,destroy(A,y=!0){this.destroyed||(this.destroyed=!0,y&&this.abort?.(A??new DOMException("The operation was aborted.","AbortError")))}};let n=t.request,o=null,s=t.timingInfo;null==null&&(n.cache="no-store");let l=r?"yes":"no";n.mode;let u=null;if(n.body==null&&t.processRequestEndOfBody)queueMicrotask(()=>t.processRequestEndOfBody());else if(n.body!=null){let A=a(async function*(_){Cj(t)||(yield _,t.processRequestBodyChunkLength?.(_.byteLength))},"processBodyChunk"),y=a(()=>{Cj(t)||t.processRequestEndOfBody&&t.processRequestEndOfBody()},"processEndOfBody"),E=a(_=>{Cj(t)||(_.name==="AbortError"?t.controller.abort():t.controller.terminate(_))},"processBodyError");u=(async function*(){try{for await(let _ of n.body.stream)yield*A(_);y()}catch(_){E(_)}})()}try{let{body:A,status:y,statusText:E,headersList:_,socket:v}=await g({body:u});if(v)o=mot({status:y,statusText:E,headersList:_,socket:v});else{let b=A[Symbol.asyncIterator]();t.controller.next=()=>b.next(),o=mot({status:y,statusText:E,headersList:_})}}catch(A){return A.name==="AbortError"?(t.controller.connection.destroy(),RPe(t,A)):nl(A)}let d=a(()=>t.controller.resume(),"pullAlgorithm"),f=a(A=>{Cj(t)||t.controller.abort(A)},"cancelAlgorithm"),h=new ReadableStream({start(A){t.controller.controller=A},pull:d,cancel:f,type:"bytes"});o.body={stream:h,source:null,length:null},t.controller.resume||t.controller.on("terminated",m),t.controller.resume=async()=>{for(;;){let A,y;try{let{done:_,value:v}=await t.controller.next();if(dQn(t))break;A=_?void 0:v}catch(_){t.controller.ended&&!s.encodedBodySize?A=void 0:(A=_,y=!0)}if(A===void 0){j2s(t.controller.controller),EDs(t,o);return}if(s.decodedBodySize+=A?.byteLength??0,y){t.controller.terminate(A);return}let E=new Uint8Array(A);if(E.byteLength&&t.controller.controller.enqueue(E),oDs(h)){t.controller.terminate();return}if(t.controller.controller.desiredSize<=0)return}};function m(A){dQn(t)?(o.aborted=!0,got(h)&&t.controller.controller.error(t.controller.serializedAbortReason)):got(h)&&t.controller.controller.error(new TypeError("terminated",{cause:Q2s(A)?A:void 0})),t.controller.connection.destroy()}return a(m,"onAborted"),o;function g({body:A}){let y=aT(n),E=t.controller.dispatcher,_=y.pathname+y.search,v=y.search.length===0&&y.href[y.href.length-y.hash.length-1]==="?";return new Promise((b,T)=>E.dispatch({path:v?`${_}?`:_,origin:y.origin,method:n.method,body:E.isMockActive?n.body&&(n.body.source||n.body.stream):A,headers:n.headersList.entries,maxRedirections:0,upgrade:n.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:R}=t.controller;s.finalConnectionTimingInfo=$2s(void 0,s.postRedirectStartTime,t.crossOriginIsolatedCapability),R.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(t.controller.on("terminated",w),this.abort=R.abort=w),s.finalNetworkRequestStartTime=PPe(t.crossOriginIsolatedCapability)},onResponseStarted(){s.finalNetworkResponseStartTime=PPe(t.crossOriginIsolatedCapability)},onHeaders(w,R,x,P){if(w<200)return!1;let D=new hor;for(let M=0;Mq)return T(new Error(`too many content-encodings in response: ${O.length}, maximum allowed is ${q}`)),!0;for(let Q=O.length-1;Q>=0;--Q){let U=O[Q].trim();if(U==="x-gzip"||U==="gzip")L.push(Xk.createGunzip({flush:Xk.constants.Z_SYNC_FLUSH,finishFlush:Xk.constants.Z_SYNC_FLUSH}));else if(U==="deflate")L.push(z2s({flush:Xk.constants.Z_SYNC_FLUSH,finishFlush:Xk.constants.Z_SYNC_FLUSH}));else if(U==="br")L.push(Xk.createBrotliDecompress({flush:Xk.constants.BROTLI_OPERATION_FLUSH,finishFlush:Xk.constants.BROTLI_OPERATION_FLUSH}));else if(U==="zstd"&&hDs)L.push(Xk.createZstdDecompress({flush:Xk.constants.ZSTD_e_continue,finishFlush:Xk.constants.ZSTD_e_end}));else{L.length=0;break}}}let j=this.onError.bind(this);return b({status:w,statusText:P,headersList:D,body:L.length?nDs(this.body,...L,M=>{M&&this.onError(M)}).on("error",j):this.body.on("error",j)}),!0},onData(w){if(t.controller.dump)return;let R=w;return s.encodedBodySize+=R.byteLength,this.body.push(R)},onComplete(){this.abort&&t.controller.off("terminated",this.abort),t.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&t.controller.off("terminated",this.abort),this.body?.destroy(w),t.controller.terminate(w),T(w)},onRequestUpgrade(w,R,x,P){if(P.session!=null&&R!==200||P.session==null&&R!==101)return!1;let D=new hor;for(let[N,B]of Object.entries(x)){if(B==null)continue;let L=N.toLowerCase();if(Array.isArray(B))for(let j of B)D.append(L,String(j),!0);else D.append(L,String(B),!0)}return b({status:R,statusText:mQn[R],headersList:D,socket:P}),!0},onUpgrade(w,R,x){if(x.session!=null&&w!==200||x.session==null&&w!==101)return!1;let P=new hor;for(let D=0;D{"use strict";p();var CDs=require("node:assert"),{URLSerializer:TQn}=fw(),{isValidHeaderName:bDs}=ZS();function SDs(t,e,r=!1){let n=TQn(t,r),o=TQn(e,r);return n===o}a(SDs,"urlEquals");function TDs(t){CDs(t!==null);let e=[];for(let r of t.split(","))r=r.trim(),bDs(r)&&e.push(r);return e}a(TDs,"getFieldValues");IQn.exports={urlEquals:SDs,getFieldValues:TDs}});var kQn=I((Vtf,PQn)=>{"use strict";p();var Cor=require("node:assert"),{kConstruct:IDs}=tl(),{urlEquals:xDs,getFieldValues:bor}=xQn(),{kEnumerableProperty:rZ,isDisturbed:wDs}=ko(),{webidl:Jn}=PA(),{cloneResponse:wQn,fromInnerResponse:RDs,getResponseState:PDs}=wPe(),{Request:DPe,fromInnerRequest:kDs,getRequestState:n5}=bfe(),{fetching:DDs}=kPe(),{urlIsHttpHttpsScheme:vot,readAllBytes:NDs}=ZS(),{createDeferredPromise:Sfe}=GRe(),Cot=class t{static{a(this,"Cache")}#e;constructor(){arguments[0]!==IDs&&Jn.illegalConstructor(),Jn.util.markAsUncloneable(this),this.#e=arguments[1]}async match(e,r={}){Jn.brandCheck(this,t);let n="Cache.match";Jn.argumentLengthCheck(arguments,1,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=this.#i(e,r,1);if(o.length!==0)return o[0]}async matchAll(e=void 0,r={}){Jn.brandCheck(this,t);let n="Cache.matchAll";return e!==void 0&&(e=Jn.converters.RequestInfo(e)),r=Jn.converters.CacheQueryOptions(r,n,"options"),this.#i(e,r)}async add(e){Jn.brandCheck(this,t),Jn.argumentLengthCheck(arguments,1,"Cache.add"),e=Jn.converters.RequestInfo(e);let n=[e];return await this.addAll(n)}async addAll(e){Jn.brandCheck(this,t);let r="Cache.addAll";Jn.argumentLengthCheck(arguments,1,r);let n=[],o=[];for(let m of e){if(m===void 0)throw Jn.errors.conversionFailed({prefix:r,argument:"Argument 1",types:["undefined is not allowed"]});if(m=Jn.converters.RequestInfo(m),typeof m=="string")continue;let g=n5(m);if(!vot(g.url)||g.method!=="GET")throw Jn.errors.exception({header:r,message:"Expected http/s scheme when method is not GET."})}let s=[];for(let m of e){let g=n5(new DPe(m));if(!vot(g.url))throw Jn.errors.exception({header:r,message:"Expected http/s scheme."});g.initiator="fetch",g.destination="subresource",o.push(g);let A=Sfe();s.push(DDs({request:g,processResponse(y){if(y.type==="error"||y.status===206||y.status<200||y.status>299)A.reject(Jn.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(y.headersList.contains("vary")){let E=bor(y.headersList.get("vary"));for(let _ of E)if(_==="*"){A.reject(Jn.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let v of s)v.abort();return}}},processResponseEndOfBody(y){if(y.aborted){A.reject(new DOMException("aborted","AbortError"));return}A.resolve(y)}})),n.push(A.promise)}let l=await Promise.all(n),u=[],d=0;for(let m of l){let g={type:"put",request:o[d],response:m};u.push(g),d++}let f=Sfe(),h=null;try{this.#t(u)}catch(m){h=m}return queueMicrotask(()=>{h===null?f.resolve(void 0):f.reject(h)}),f.promise}async put(e,r){Jn.brandCheck(this,t);let n="Cache.put";Jn.argumentLengthCheck(arguments,2,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.Response(r,n,"response");let o=null;if(Jn.is.Request(e)?o=n5(e):o=n5(new DPe(e)),!vot(o.url)||o.method!=="GET")throw Jn.errors.exception({header:n,message:"Expected an http/s scheme when method is not GET"});let s=PDs(r);if(s.status===206)throw Jn.errors.exception({header:n,message:"Got 206 status"});if(s.headersList.contains("vary")){let g=bor(s.headersList.get("vary"));for(let A of g)if(A==="*")throw Jn.errors.exception({header:n,message:"Got * vary field value"})}if(s.body&&(wDs(s.body.stream)||s.body.stream.locked))throw Jn.errors.exception({header:n,message:"Response body is locked or disturbed"});let c=wQn(s),l=Sfe();if(s.body!=null){let A=s.body.stream.getReader();NDs(A,l.resolve,l.reject)}else l.resolve(void 0);let u=[],d={type:"put",request:o,response:c};u.push(d);let f=await l.promise;c.body!=null&&(c.body.source=f);let h=Sfe(),m=null;try{this.#t(u)}catch(g){m=g}return queueMicrotask(()=>{m===null?h.resolve():h.reject(m)}),h.promise}async delete(e,r={}){Jn.brandCheck(this,t);let n="Cache.delete";Jn.argumentLengthCheck(arguments,1,n),e=Jn.converters.RequestInfo(e),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=null;if(Jn.is.Request(e)){if(o=n5(e),o.method!=="GET"&&!r.ignoreMethod)return!1}else Cor(typeof e=="string"),o=n5(new DPe(e));let s=[],c={type:"delete",request:o,options:r};s.push(c);let l=Sfe(),u=null,d;try{d=this.#t(s)}catch(f){u=f}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(e=void 0,r={}){Jn.brandCheck(this,t);let n="Cache.keys";e!==void 0&&(e=Jn.converters.RequestInfo(e)),r=Jn.converters.CacheQueryOptions(r,n,"options");let o=null;if(e!==void 0)if(Jn.is.Request(e)){if(o=n5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=n5(new DPe(e)));let s=Sfe(),c=[];if(e===void 0)for(let l of this.#e)c.push(l[0]);else{let l=this.#r(o,r);for(let u of l)c.push(u[0])}return queueMicrotask(()=>{let l=[];for(let u of c){let d=kDs(u,void 0,new AbortController().signal,"immutable");l.push(d)}s.resolve(Object.freeze(l))}),s.promise}#t(e){let r=this.#e,n=[...r],o=[],s=[];try{for(let c of e){if(c.type!=="delete"&&c.type!=="put")throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(c.type==="delete"&&c.response!=null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(c.request,c.options,o).length)throw new DOMException("???","InvalidStateError");let l;if(c.type==="delete"){if(l=this.#r(c.request,c.options),l.length===0)return[];for(let u of l){let d=r.indexOf(u);Cor(d!==-1),r.splice(d,1)}}else if(c.type==="put"){if(c.response==null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let u=c.request;if(!vot(u.url))throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(u.method!=="GET")throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(c.options!=null)throw Jn.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});l=this.#r(c.request);for(let d of l){let f=r.indexOf(d);Cor(f!==-1),r.splice(f,1)}r.push([c.request,c.response]),o.push([c.request,c.response])}s.push([c.request,c.response])}return s}catch(c){throw this.#e.length=0,this.#e=n,c}}#r(e,r,n){let o=[],s=n??this.#e;for(let c of s){let[l,u]=c;this.#n(e,l,u,r)&&o.push(c)}return o}#n(e,r,n=null,o){let s=new URL(e.url),c=new URL(r.url);if(o?.ignoreSearch&&(c.search="",s.search=""),!xDs(s,c,!0))return!1;if(n==null||o?.ignoreVary||!n.headersList.contains("vary"))return!0;let l=bor(n.headersList.get("vary"));for(let u of l){if(u==="*")return!1;let d=r.headersList.get(u),f=e.headersList.get(u);if(d!==f)return!1}return!0}#i(e,r,n=1/0){let o=null;if(e!==void 0)if(Jn.is.Request(e)){if(o=n5(e),o.method!=="GET"&&!r.ignoreMethod)return[]}else typeof e=="string"&&(o=n5(new DPe(e)));let s=[];if(e===void 0)for(let l of this.#e)s.push(l[1]);else{let l=this.#r(o,r);for(let u of l)s.push(u[1])}let c=[];for(let l of s){let u=RDs(wQn(l),"immutable");if(c.push(u),c.length>=n)break}return Object.freeze(c)}};Object.defineProperties(Cot.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:rZ,matchAll:rZ,add:rZ,addAll:rZ,put:rZ,delete:rZ,keys:rZ});var RQn=[{key:"ignoreSearch",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreMethod",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"ignoreVary",converter:Jn.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];Jn.converters.CacheQueryOptions=Jn.dictionaryConverter(RQn);Jn.converters.MultiCacheQueryOptions=Jn.dictionaryConverter([...RQn,{key:"cacheName",converter:Jn.converters.DOMString}]);Jn.converters.Response=Jn.interfaceConverter(Jn.is.Response,"Response");Jn.converters["sequence"]=Jn.sequenceConverter(Jn.converters.RequestInfo);PQn.exports={Cache:Cot}});var NQn=I((Ytf,DQn)=>{"use strict";p();var{Cache:bot}=kQn(),{webidl:aE}=PA(),{kEnumerableProperty:NPe}=ko(),{kConstruct:MPe}=tl(),Sot=class t{static{a(this,"CacheStorage")}#e=new Map;constructor(){arguments[0]!==MPe&&aE.illegalConstructor(),aE.util.markAsUncloneable(this)}async match(e,r={}){if(aE.brandCheck(this,t),aE.argumentLengthCheck(arguments,1,"CacheStorage.match"),e=aE.converters.RequestInfo(e),r=aE.converters.MultiCacheQueryOptions(r),r.cacheName!=null){if(this.#e.has(r.cacheName)){let n=this.#e.get(r.cacheName);return await new bot(MPe,n).match(e,r)}}else for(let n of this.#e.values()){let s=await new bot(MPe,n).match(e,r);if(s!==void 0)return s}}async has(e){aE.brandCheck(this,t);let r="CacheStorage.has";return aE.argumentLengthCheck(arguments,1,r),e=aE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)}async open(e){aE.brandCheck(this,t);let r="CacheStorage.open";if(aE.argumentLengthCheck(arguments,1,r),e=aE.converters.DOMString(e,r,"cacheName"),this.#e.has(e)){let o=this.#e.get(e);return new bot(MPe,o)}let n=[];return this.#e.set(e,n),new bot(MPe,n)}async delete(e){aE.brandCheck(this,t);let r="CacheStorage.delete";return aE.argumentLengthCheck(arguments,1,r),e=aE.converters.DOMString(e,r,"cacheName"),this.#e.delete(e)}async keys(){return aE.brandCheck(this,t),[...this.#e.keys()]}};Object.defineProperties(Sot.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:NPe,has:NPe,open:NPe,delete:NPe,keys:NPe});DQn.exports={CacheStorage:Sot}});var OQn=I((Ztf,MQn)=>{"use strict";p();MQn.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Sor=I((erf,QQn)=>{"use strict";p();function MDs(t){for(let e=0;e=0&&r<=8||r>=10&&r<=31||r===127)return!0}return!1}a(MDs,"isCTLExcludingHtab");function BQn(t){for(let e=0;e126||r===34||r===40||r===41||r===60||r===62||r===64||r===44||r===59||r===58||r===92||r===47||r===91||r===93||r===63||r===61||r===123||r===125)throw new Error("Invalid cookie name")}}a(BQn,"validateCookieName");function LQn(t){let e=t.length,r=0;if(t[0]==='"'){if(e===1||t[e-1]!=='"')throw new Error("Invalid cookie value");--e,++r}for(;r126||n===34||n===44||n===59||n===92)throw new Error("Invalid cookie value")}}a(LQn,"validateCookieValue");function FQn(t){for(let e=0;ee.toString().padStart(2,"0"));function UQn(t){return typeof t=="number"&&(t=new Date(t)),`${BDs[t.getUTCDay()]}, ${Tot[t.getUTCDate()]} ${LDs[t.getUTCMonth()]} ${t.getUTCFullYear()} ${Tot[t.getUTCHours()]}:${Tot[t.getUTCMinutes()]}:${Tot[t.getUTCSeconds()]} GMT`}a(UQn,"toIMFDate");function FDs(t){if(t<0)throw new Error("Invalid cookie max-age")}a(FDs,"validateCookieMaxAge");function UDs(t){if(t.name.length===0)return null;BQn(t.name),LQn(t.value);let e=[`${t.name}=${t.value}`];t.name.startsWith("__Secure-")&&(t.secure=!0),t.name.startsWith("__Host-")&&(t.secure=!0,t.domain=null,t.path="/"),t.secure&&e.push("Secure"),t.httpOnly&&e.push("HttpOnly"),typeof t.maxAge=="number"&&(FDs(t.maxAge),e.push(`Max-Age=${t.maxAge}`)),t.domain&&(ODs(t.domain),e.push(`Domain=${t.domain}`)),t.path&&(FQn(t.path),e.push(`Path=${t.path}`)),t.expires&&t.expires.toString()!=="Invalid Date"&&e.push(`Expires=${UQn(t.expires)}`),t.sameSite&&e.push(`SameSite=${t.sameSite}`);for(let r of t.unparsed){if(!r.includes("="))throw new Error("Invalid unparsed");let[n,...o]=r.split("=");e.push(`${n.trim()}=${o.join("=")}`)}return e.join("; ")}a(UDs,"stringify");QQn.exports={isCTLExcludingHtab:MDs,validateCookieName:BQn,validateCookiePath:FQn,validateCookieValue:LQn,toIMFDate:UQn,stringify:UDs}});var jQn=I((nrf,qQn)=>{"use strict";p();var{collectASequenceOfCodePointsFast:Iot}=sF(),{maxNameValuePairSize:QDs,maxAttributeValueSize:qDs}=OQn(),{isCTLExcludingHtab:jDs}=Sor(),HDs=require("node:assert"),{unescape:GDs}=require("node:querystring");function $Ds(t){if(jDs(t))return null;let e="",r="",n="",o="";if(t.includes(";")){let s={position:0};e=Iot(";",t,s),r=t.slice(s.position)}else e=t;if(!e.includes("="))o=e;else{let s={position:0};n=Iot("=",e,s),o=e.slice(s.position+1)}return n=n.trim(),o=o.trim(),n.length+o.length>QDs?null:{name:n,value:GDs(o),...Tfe(r)}}a($Ds,"parseSetCookie");function Tfe(t,e={}){if(t.length===0)return e;HDs(t[0]===";"),t=t.slice(1);let r="";t.includes(";")?(r=Iot(";",t,{position:0}),t=t.slice(r.length)):(r=t,t="");let n="",o="";if(r.includes("=")){let c={position:0};n=Iot("=",r,c),o=r.slice(c.position+1)}else n=r;if(n=n.trim(),o=o.trim(),o.length>qDs)return Tfe(t,e);let s=n.toLowerCase();if(s==="expires"){let c=new Date(o);e.expires=c}else if(s==="max-age"){let c=o.charCodeAt(0);if((c<48||c>57)&&o[0]!=="-"||!/^\d+$/.test(o))return Tfe(t,e);let l=Number(o);e.maxAge=l}else if(s==="domain"){let c=o;c[0]==="."&&(c=c.slice(1)),c=c.toLowerCase(),e.domain=c}else if(s==="path"){let c="";o.length===0||o[0]!=="/"?c="/":c=o,e.path=c}else if(s==="secure")e.secure=!0;else if(s==="httponly")e.httpOnly=!0;else if(s==="samesite"){let c="Default",l=o.toLowerCase();l.includes("none")&&(c="None"),l.includes("strict")&&(c="Strict"),l.includes("lax")&&(c="Lax"),e.sameSite=c}else e.unparsed??=[],e.unparsed.push(`${n}=${o}`);return Tfe(t,e)}a(Tfe,"parseUnparsedAttributes");qQn.exports={parseSetCookie:$Ds,parseUnparsedAttributes:Tfe}});var VQn=I((srf,$Qn)=>{"use strict";p();var{parseSetCookie:HQn}=jQn(),{stringify:VDs}=Sor(),{webidl:Va}=PA(),{Headers:WDs}=ZJ(),xot=Va.brandCheckMultiple([WDs,globalThis.Headers].filter(Boolean));function zDs(t){Va.argumentLengthCheck(arguments,1,"getCookies"),xot(t);let e=t.get("cookie"),r={};if(!e)return r;for(let n of e.split(";")){let[o,...s]=n.split("=");r[o.trim()]=s.join("=")}return r}a(zDs,"getCookies");function YDs(t,e,r){xot(t);let n="deleteCookie";Va.argumentLengthCheck(arguments,2,n),e=Va.converters.DOMString(e,n,"name"),r=Va.converters.DeleteCookieAttributes(r),GQn(t,{name:e,value:"",expires:new Date(0),...r})}a(YDs,"deleteCookie");function KDs(t){Va.argumentLengthCheck(arguments,1,"getSetCookies"),xot(t);let e=t.getSetCookie();return e?e.map(r=>HQn(r)):[]}a(KDs,"getSetCookies");function JDs(t){return t=Va.converters.DOMString(t),HQn(t)}a(JDs,"parseCookie");function GQn(t,e){Va.argumentLengthCheck(arguments,2,"setCookie"),xot(t),e=Va.converters.Cookie(e);let r=VDs(e);r&&t.append("set-cookie",r,!0)}a(GQn,"setCookie");Va.converters.DeleteCookieAttributes=Va.dictionaryConverter([{converter:Va.nullableConverter(Va.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")}]);Va.converters.Cookie=Va.dictionaryConverter([{converter:Va.converters.DOMString,key:"name"},{converter:Va.converters.DOMString,key:"value"},{converter:Va.nullableConverter(t=>typeof t=="number"?Va.converters["unsigned long long"](t):new Date(t)),key:"expires",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters["long long"]),key:"maxAge",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters.DOMString),key:"domain",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters.DOMString),key:"path",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters.boolean),key:"secure",defaultValue:a(()=>null,"defaultValue")},{converter:Va.nullableConverter(Va.converters.boolean),key:"httpOnly",defaultValue:a(()=>null,"defaultValue")},{converter:Va.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Va.sequenceConverter(Va.converters.DOMString),key:"unparsed",defaultValue:a(()=>[],"defaultValue")}]);$Qn.exports={getCookies:zDs,deleteCookie:YDs,getSetCookies:KDs,setCookie:GQn,parseCookie:JDs}});var Pot=I((lrf,zQn)=>{"use strict";p();var{webidl:ci}=PA(),{kEnumerableProperty:eb}=ko(),{kConstruct:WQn}=tl(),Ife=class t extends Event{static{a(this,"MessageEvent")}#e;constructor(e,r={}){if(e===WQn){super(arguments[1],arguments[2]),ci.util.markAsUncloneable(this);return}let n="MessageEvent constructor";ci.argumentLengthCheck(arguments,1,n),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.MessageEventInit(r,n,"eventInitDict"),super(e,r),this.#e=r,ci.util.markAsUncloneable(this)}get data(){return ci.brandCheck(this,t),this.#e.data}get origin(){return ci.brandCheck(this,t),this.#e.origin}get lastEventId(){return ci.brandCheck(this,t),this.#e.lastEventId}get source(){return ci.brandCheck(this,t),this.#e.source}get ports(){return ci.brandCheck(this,t),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(e,r=!1,n=!1,o=null,s="",c="",l=null,u=[]){return ci.brandCheck(this,t),ci.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new t(e,{bubbles:r,cancelable:n,data:o,origin:s,lastEventId:c,source:l,ports:u})}static createFastMessageEvent(e,r){let n=new t(WQn,e,r);return n.#e=r,n.#e.data??=null,n.#e.origin??="",n.#e.lastEventId??="",n.#e.source??=null,n.#e.ports??=[],n}},{createFastMessageEvent:ZDs}=Ife;delete Ife.createFastMessageEvent;var wot=class t extends Event{static{a(this,"CloseEvent")}#e;constructor(e,r={}){let n="CloseEvent constructor";ci.argumentLengthCheck(arguments,1,n),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.CloseEventInit(r),super(e,r),this.#e=r,ci.util.markAsUncloneable(this)}get wasClean(){return ci.brandCheck(this,t),this.#e.wasClean}get code(){return ci.brandCheck(this,t),this.#e.code}get reason(){return ci.brandCheck(this,t),this.#e.reason}},Rot=class t extends Event{static{a(this,"ErrorEvent")}#e;constructor(e,r){let n="ErrorEvent constructor";ci.argumentLengthCheck(arguments,1,n),super(e,r),ci.util.markAsUncloneable(this),e=ci.converters.DOMString(e,n,"type"),r=ci.converters.ErrorEventInit(r??{}),this.#e=r}get message(){return ci.brandCheck(this,t),this.#e.message}get filename(){return ci.brandCheck(this,t),this.#e.filename}get lineno(){return ci.brandCheck(this,t),this.#e.lineno}get colno(){return ci.brandCheck(this,t),this.#e.colno}get error(){return ci.brandCheck(this,t),this.#e.error}};Object.defineProperties(Ife.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:eb,origin:eb,lastEventId:eb,source:eb,ports:eb,initMessageEvent:eb});Object.defineProperties(wot.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:eb,code:eb,wasClean:eb});Object.defineProperties(Rot.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:eb,filename:eb,lineno:eb,colno:eb,error:eb});ci.converters.MessagePort=ci.interfaceConverter(ci.is.MessagePort,"MessagePort");ci.converters["sequence"]=ci.sequenceConverter(ci.converters.MessagePort);var Tor=[{key:"bubbles",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"cancelable",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"composed",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")}];ci.converters.MessageEventInit=ci.dictionaryConverter([...Tor,{key:"data",converter:ci.converters.any,defaultValue:a(()=>null,"defaultValue")},{key:"origin",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lastEventId",converter:ci.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"source",converter:ci.nullableConverter(ci.converters.MessagePort),defaultValue:a(()=>null,"defaultValue")},{key:"ports",converter:ci.converters["sequence"],defaultValue:a(()=>[],"defaultValue")}]);ci.converters.CloseEventInit=ci.dictionaryConverter([...Tor,{key:"wasClean",converter:ci.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"code",converter:ci.converters["unsigned short"],defaultValue:a(()=>0,"defaultValue")},{key:"reason",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);ci.converters.ErrorEventInit=ci.dictionaryConverter([...Tor,{key:"message",converter:ci.converters.DOMString,defaultValue:a(()=>"","defaultValue")},{key:"filename",converter:ci.converters.USVString,defaultValue:a(()=>"","defaultValue")},{key:"lineno",converter:ci.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"colno",converter:ci.converters["unsigned long"],defaultValue:a(()=>0,"defaultValue")},{key:"error",converter:ci.converters.any}]);zQn.exports={MessageEvent:Ife,CloseEvent:wot,ErrorEvent:Rot,createFastMessageEvent:ZDs}});var bj=I((frf,YQn)=>{"use strict";p();var XDs="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",eNs={enumerable:!0,writable:!1,configurable:!1},tNs={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},rNs={SENT:1,RECEIVED:2},nNs={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},iNs=65535,oNs={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},sNs=Buffer.allocUnsafe(0),aNs={text:1,typedArray:2,arrayBuffer:3,blob:4};YQn.exports={uid:XDs,sentCloseFrameState:rNs,staticPropertyDescriptors:eNs,states:tNs,opcodes:nNs,maxUnsigned16Bit:iNs,parserStates:oNs,emptyBuffer:sNs,sendHints:aNs}});var nZ=I((hrf,eqn)=>{"use strict";p();var{states:kot,opcodes:xfe}=bj(),{isUtf8:cNs}=require("node:buffer"),{removeHTTPWhitespace:KQn}=fw(),{collectASequenceOfCodePointsFast:lNs}=sF();function uNs(t){return t===kot.CONNECTING}a(uNs,"isConnecting");function dNs(t){return t===kot.OPEN}a(dNs,"isEstablished");function fNs(t){return t===kot.CLOSING}a(fNs,"isClosing");function pNs(t){return t===kot.CLOSED}a(pNs,"isClosed");function hNs(t,e,r=(o,s)=>new Event(o,s),n={}){let o=r(t,n);e.dispatchEvent(o)}a(hNs,"fireEvent");function mNs(t,e,r){t.onMessage(e,r)}a(mNs,"websocketMessageReceived");function gNs(t){return t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}a(gNs,"toArrayBuffer");function ANs(t){if(t.length===0)return!1;for(let e=0;e126||r===34||r===40||r===41||r===44||r===47||r===58||r===59||r===60||r===61||r===62||r===63||r===64||r===91||r===92||r===93||r===123||r===125)return!1}return!0}a(ANs,"isValidSubprotocol");function yNs(t){return t>=1e3&&t<1015?t!==1004&&t!==1005&&t!==1006:t>=3e3&&t<=4999}a(yNs,"isValidStatusCode");function JQn(t){return t===xfe.CLOSE||t===xfe.PING||t===xfe.PONG}a(JQn,"isControlFrame");function ZQn(t){return t===xfe.CONTINUATION}a(ZQn,"isContinuationFrame");function XQn(t){return t===xfe.TEXT||t===xfe.BINARY}a(XQn,"isTextBinaryFrame");function ENs(t){return XQn(t)||ZQn(t)||JQn(t)}a(ENs,"isValidOpcode");function _Ns(t){let e={position:0},r=new Map;for(;e.position57)return!1}let e=Number.parseInt(t,10);return e>=8&&e<=15}a(vNs,"isValidClientWindowBits");function CNs(t,e){let r;try{r=new URL(t,e)}catch(n){throw new DOMException(n,"SyntaxError")}if(r.protocol==="http:"?r.protocol="ws:":r.protocol==="https:"&&(r.protocol="wss:"),r.protocol!=="ws:"&&r.protocol!=="wss:")throw new DOMException("expected a ws: or wss: url","SyntaxError");if(r.hash.length||r.href.endsWith("#"))throw new DOMException("hash","SyntaxError");return r}a(CNs,"getURLRecord");function bNs(t,e){if(t!==null&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");if(e!==null){let r=Buffer.byteLength(e);if(r>123)throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError")}}a(bNs,"validateCloseCodeAndReason");var SNs=(()=>{if(typeof process.versions.icu=="string"){let t=new TextDecoder("utf-8",{fatal:!0});return t.decode.bind(t)}return function(t){if(cNs(t))return t.toString("utf-8");throw new TypeError("Invalid utf-8 received.")}})();eqn.exports={isConnecting:uNs,isEstablished:dNs,isClosing:fNs,isClosed:pNs,fireEvent:hNs,isValidSubprotocol:ANs,isValidStatusCode:yNs,websocketMessageReceived:mNs,utf8Decode:SNs,isControlFrame:JQn,isContinuationFrame:ZQn,isTextBinaryFrame:XQn,isValidOpcode:ENs,parseExtensions:_Ns,isValidClientWindowBits:vNs,toArrayBuffer:gNs,getURLRecord:CNs,validateCloseCodeAndReason:bNs}});var Rfe=I((Arf,rqn)=>{"use strict";p();var{runtimeFeatures:TNs}=aF(),{maxUnsigned16Bit:tqn,opcodes:INs}=bj(),Dot=8*1024,OPe=null,wfe=Dot,xNs=TNs.has("crypto")?require("node:crypto").randomFillSync:a(function(e,r,n){for(let o=0;otqn?(c+=8,s=127):o>125&&(c+=2,s=126);let l=Buffer.allocUnsafe(o+c);l[0]=l[1]=0,l[0]|=128,l[0]=(l[0]&240)+e;l[c-4]=n[0],l[c-3]=n[1],l[c-2]=n[2],l[c-1]=n[3],l[1]=s,s===126?l.writeUInt16BE(o,2):s===127&&(l[2]=l[3]=0,l.writeUIntBE(o,4,6)),l[1]|=128;for(let u=0;utqn?(s+=8,o=127):n>125&&(s+=2,o=126);let c=Buffer.allocUnsafeSlow(s);return c[0]=128|INs.TEXT,c[1]=o|128,c[s-4]=r[0],c[s-3]=r[1],c[s-2]=r[2],c[s-1]=r[3],o===126?c.writeUInt16BE(n,2):o===127&&(c[2]=c[3]=0,c.writeUIntBE(n,4,6)),[c,e]}};rqn.exports={WebsocketFrameSend:xor,generateMask:Ior}});var Not=I((_rf,cqn)=>{"use strict";p();var{uid:wNs,states:wor,sentCloseFrameState:Ror,emptyBuffer:nqn,opcodes:RNs}=bj(),{parseExtensions:PNs,isClosed:kNs,isClosing:DNs,isEstablished:sqn,isConnecting:NNs,validateCloseCodeAndReason:MNs}=nZ(),{makeRequest:ONs}=bfe(),{fetching:BNs}=kPe(),{Headers:LNs,getHeadersList:FNs}=ZJ(),{getDecodeSplit:UNs}=ZS(),{WebsocketFrameSend:QNs}=Rfe(),qNs=require("node:assert"),{runtimeFeatures:jNs}=aF(),iqn=jNs.has("crypto")?require("node:crypto"):null,oqn=!1;function HNs(t,e,r,n,o){let s=t;s.protocol=t.protocol==="ws:"?"http:":"https:";let c=ONs({urlList:[s],client:r,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error",useURLCredentials:!0});if(o.headers){let f=FNs(new LNs(o.headers));c.headersList=f}let l=iqn.randomBytes(16).toString("base64");c.headersList.append("sec-websocket-key",l,!0),c.headersList.append("sec-websocket-version","13",!0);for(let f of e)c.headersList.append("sec-websocket-protocol",f,!0);return c.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits",!0),BNs({request:c,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(f){if(f.type==="error"||f.status!==101){if(f.socket?.session==null){i5(n,1002,"Received network error or non-101 status code.",f.error);return}if(f.status!==200){i5(n,1002,"Received network error or non-200 status code.",f.error);return}}if(oqn===!1&&f.socket?.session!=null&&(process.emitWarning("WebSocket over HTTP2 is experimental, and subject to change.","ExperimentalWarning"),oqn=!0),e.length!==0&&!f.headersList.get("Sec-WebSocket-Protocol")){i5(n,1002,"Server did not respond with sent protocols.");return}if(f.socket.session==null&&f.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){i5(n,1002,'Server did not set Upgrade header to "websocket".');return}if(f.socket.session==null&&f.headersList.get("Connection")?.toLowerCase()!=="upgrade"){i5(n,1002,'Server did not set Connection header to "upgrade".');return}let h=f.headersList.get("Sec-WebSocket-Accept"),m=iqn.hash("sha1",l+wNs,"base64");if(h!==m){i5(n,1002,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let g=f.headersList.get("Sec-WebSocket-Extensions"),A;if(g!==null&&(A=PNs(g),!A.has("permessage-deflate"))){i5(n,1002,"Sec-WebSocket-Extensions header does not match.");return}let y=f.headersList.get("Sec-WebSocket-Protocol");if(y!==null&&!UNs("sec-websocket-protocol",c.headersList).includes(y)){i5(n,1002,"Protocol was not set in the opening handshake.");return}f.socket.on("data",n.onSocketData),f.socket.on("close",n.onSocketClose),f.socket.on("error",n.onSocketError),n.wasEverConnected=!0,n.onConnectionEstablished(f,A)}})}a(HNs,"establishWebSocketConnection");function aqn(t,e,r,n=!1){if(e??=null,r??="",n&&MNs(e,r),!(kNs(t.readyState)||DNs(t.readyState)))if(!sqn(t.readyState))i5(t),t.readyState=wor.CLOSING;else if(!t.closeState.has(Ror.SENT)&&!t.closeState.has(Ror.RECEIVED)){let o=new QNs;r.length!==0&&e===null&&(e=1e3),qNs(e===null||Number.isInteger(e)),e===null&&r.length===0?o.frameData=nqn:e!==null&&r===null?(o.frameData=Buffer.allocUnsafe(2),o.frameData.writeUInt16BE(e,0)):e!==null&&r!==null?(o.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(r)),o.frameData.writeUInt16BE(e,0),o.frameData.write(r,2,"utf-8")):o.frameData=nqn,t.socket.write(o.createFrame(RNs.CLOSE)),t.closeState.add(Ror.SENT),t.readyState=wor.CLOSING}else t.readyState=wor.CLOSING}a(aqn,"closeWebSocketConnection");function i5(t,e,r,n){sqn(t.readyState)&&aqn(t,e,r,!1),t.controller.abort(),NNs(t.readyState)?t.onSocketClose():t.socket?.destroyed===!1&&t.socket.destroy()}a(i5,"failWebsocketConnection");cqn.exports={establishWebSocketConnection:HNs,failWebsocketConnection:i5,closeWebSocketConnection:aqn}});var dqn=I((brf,uqn)=>{"use strict";p();var{createInflateRaw:GNs,Z_DEFAULT_WINDOWBITS:$Ns}=require("node:zlib"),{isValidClientWindowBits:VNs}=nZ(),{MessageSizeExceededError:lqn}=ao(),WNs=Buffer.from([0,0,255,255]),Mot=Symbol("kBuffer"),BPe=Symbol("kLength"),zNs=4*1024*1024,Por=class{static{a(this,"PerMessageDeflate")}#e;#t={};#r=!1;#n=null;constructor(e){this.#t.serverNoContextTakeover=e.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,r,n){if(this.#r){n(new lqn);return}if(!this.#e){let o=$Ns;if(this.#t.serverMaxWindowBits){if(!VNs(this.#t.serverMaxWindowBits)){n(new Error("Invalid server_max_window_bits"));return}o=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=GNs({windowBits:o})}catch(s){n(s);return}this.#e[Mot]=[],this.#e[BPe]=0,this.#e.on("data",s=>{if(!this.#r){if(this.#e[BPe]+=s.length,this.#e[BPe]>zNs){if(this.#r=!0,this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null,this.#n){let c=this.#n;this.#n=null,c(new lqn)}return}this.#e[Mot].push(s)}}),this.#e.on("error",s=>{this.#e=null,n(s)})}this.#n=n,this.#e.write(e),r&&this.#e.write(WNs),this.#e.flush(()=>{if(this.#r||!this.#e)return;let o=Buffer.concat(this.#e[Mot],this.#e[BPe]);this.#e[Mot].length=0,this.#e[BPe]=0,this.#n=null,n(null,o)})}};uqn.exports={PerMessageDeflate:Por}});var Nor=I((Irf,gqn)=>{"use strict";p();var{Writable:YNs}=require("node:stream"),KNs=require("node:assert"),{parserStates:tb,opcodes:Pfe,states:JNs,emptyBuffer:fqn,sentCloseFrameState:LPe}=bj(),{isValidStatusCode:ZNs,isValidOpcode:XNs,websocketMessageReceived:pqn,utf8Decode:eMs,isControlFrame:hqn,isTextBinaryFrame:kor,isContinuationFrame:tMs}=nZ(),{failWebsocketConnection:cT}=Not(),{WebsocketFrameSend:mqn}=Rfe(),{PerMessageDeflate:rMs}=dqn(),{MessageSizeExceededError:nMs}=ao(),Dor=class extends YNs{static{a(this,"ByteParser")}#e=[];#t=0;#r=0;#n=!1;#i=tb.INFO;#o={};#s=[];#a;#c;constructor(e,r){super(),this.#c=e,this.#a=r??new Map,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new rMs(r))}_write(e,r,n){this.#e.push(e),this.#r+=e.length,this.#n=!0,this.run(n)}run(e){for(;this.#n;)if(this.#i===tb.INFO){if(this.#r<2)return e();let r=this.consume(2),n=(r[0]&128)!==0,o=r[0]&15,s=(r[1]&128)===128,c=!n&&o!==Pfe.CONTINUATION,l=r[1]&127,u=r[0]&64,d=r[0]&32,f=r[0]&16;if(!XNs(o))return cT(this.#c,1002,"Invalid opcode received"),e();if(s)return cT(this.#c,1002,"Frame cannot be masked"),e();if(u!==0&&!this.#a.has("permessage-deflate")){cT(this.#c,1002,"Expected RSV1 to be clear.");return}if(d!==0||f!==0){cT(this.#c,1002,"RSV1, RSV2, RSV3 must be clear");return}if(c&&!kor(o)){cT(this.#c,1002,"Invalid frame type was fragmented.");return}if(kor(o)&&this.#s.length>0){cT(this.#c,1002,"Expected continuation frame");return}if(this.#o.fragmented&&c){cT(this.#c,1002,"Fragmented frame exceeded 125 bytes.");return}if((l>125||c)&&hqn(o)){cT(this.#c,1002,"Control frame either too large or fragmented");return}if(tMs(o)&&this.#s.length===0&&!this.#o.compressed){cT(this.#c,1002,"Unexpected continuation frame");return}l<=125?(this.#o.payloadLength=l,this.#i=tb.READ_DATA):l===126?this.#i=tb.PAYLOADLENGTH_16:l===127&&(this.#i=tb.PAYLOADLENGTH_64),kor(o)&&(this.#o.binaryType=o,this.#o.compressed=u!==0),this.#o.opcode=o,this.#o.masked=s,this.#o.fin=n,this.#o.fragmented=c}else if(this.#i===tb.PAYLOADLENGTH_16){if(this.#r<2)return e();let r=this.consume(2);this.#o.payloadLength=r.readUInt16BE(0),this.#i=tb.READ_DATA}else if(this.#i===tb.PAYLOADLENGTH_64){if(this.#r<8)return e();let r=this.consume(8),n=r.readUInt32BE(0),o=r.readUInt32BE(4);if(n!==0||o>2**31-1){cT(this.#c,1009,"Received payload length > 2^31 bytes.");return}this.#o.payloadLength=o,this.#i=tb.READ_DATA}else if(this.#i===tb.READ_DATA){if(this.#r{if(n){let s=n instanceof nMs?1009:1007;cT(this.#c,s,n.message);return}if(this.writeFragments(o),!this.#o.fin){this.#i=tb.INFO,this.#n=!0,this.run(e);return}pqn(this.#c,this.#o.binaryType,this.consumeFragments()),this.#n=!0,this.#i=tb.INFO,this.run(e)}),this.#n=!1;break}}}consume(e){if(e>this.#r)throw new Error("Called consume() before buffers satiated.");if(e===0)return fqn;this.#r-=e;let r=this.#e[0];if(r.length>e)return this.#e[0]=r.subarray(e,r.length),r.subarray(0,e);if(r.length===e)return this.#e.shift();{let n=0,o=Buffer.allocUnsafeSlow(e);for(;n!==e;){let s=this.#e[0],c=s.length;if(c+n===e){o.set(this.#e.shift(),n);break}else if(c+n>e){o.set(s.subarray(0,e-n),n),this.#e[0]=s.subarray(e-n);break}else o.set(this.#e.shift(),n),n+=c}return o}}writeFragments(e){this.#t+=e.length,this.#s.push(e)}consumeFragments(){let e=this.#s;if(e.length===1)return this.#t=0,e.shift();let r=0,n=Buffer.allocUnsafeSlow(this.#t);for(let o=0;o=2&&(r=e.readUInt16BE(0)),r!==void 0&&!ZNs(r))return{code:1002,reason:"Invalid status code",error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=eMs(n)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:r,reason:n,error:!1}}parseControlFrame(e){let{opcode:r,payloadLength:n}=this.#o;if(r===Pfe.CLOSE){if(n===1)return cT(this.#c,1002,"Received close frame with a 1-byte body."),!1;if(this.#o.closeInfo=this.parseCloseBody(e),this.#o.closeInfo.error){let{code:o,reason:s}=this.#o.closeInfo;return cT(this.#c,o,s),!1}if(!this.#c.closeState.has(LPe.SENT)&&!this.#c.closeState.has(LPe.RECEIVED)){let o=fqn;this.#o.closeInfo.code&&(o=Buffer.allocUnsafe(2),o.writeUInt16BE(this.#o.closeInfo.code,0));let s=new mqn(o);this.#c.socket.write(s.createFrame(Pfe.CLOSE)),this.#c.closeState.add(LPe.SENT)}return this.#c.readyState=JNs.CLOSING,this.#c.closeState.add(LPe.RECEIVED),!1}else if(r===Pfe.PING){if(!this.#c.closeState.has(LPe.RECEIVED)){let o=new mqn(e);this.#c.socket.write(o.createFrame(Pfe.PONG)),this.#c.onPing(e)}}else r===Pfe.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#o.closeInfo}};gqn.exports={ByteParser:Dor}});var _qn=I((Rrf,Eqn)=>{"use strict";p();var{WebsocketFrameSend:yqn}=Rfe(),{opcodes:Aqn,sendHints:iZ}=bj(),iMs=unr(),Oor=class{static{a(this,"SendQueue")}#e=new iMs;#t=!1;#r;constructor(e){this.#r=e}add(e,r,n){if(n!==iZ.blob){if(this.#t){let s={promise:null,callback:r,frame:Mor(e,n)};this.#e.push(s)}else if(n===iZ.text){let{0:s,1:c}=yqn.createFastTextFrame(e);this.#r.cork(),this.#r.write(s),this.#r.write(c,r),this.#r.uncork()}else this.#r.write(Mor(e,n),r);return}let o={promise:e.arrayBuffer().then(s=>{o.promise=null,o.frame=Mor(s,n)}),callback:r,frame:null};this.#e.push(o),this.#t||this.#n()}async#n(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let r=e.shift();r.promise!==null&&await r.promise,this.#r.write(r.frame,r.callback),r.callback=r.frame=null}this.#t=!1}};function Mor(t,e){return new yqn(oMs(t,e)).createFrame(e===iZ.text?Aqn.TEXT:Aqn.BINARY)}a(Mor,"createFrame");function oMs(t,e){switch(e){case iZ.text:case iZ.typedArray:return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);case iZ.arrayBuffer:case iZ.blob:return new Uint8Array(t)}}a(oMs,"toBuffer");Eqn.exports={SendQueue:Oor}});var Iqn=I((Drf,Tqn)=>{"use strict";p();var{isArrayBuffer:sMs}=require("node:util/types"),{webidl:pi}=PA(),{URLSerializer:aMs}=fw(),{environmentSettingsObject:vqn}=ZS(),{staticPropertyDescriptors:Sj,states:AF,sentCloseFrameState:Bor,sendHints:Oot,opcodes:Lor}=bj(),{isConnecting:cMs,isEstablished:Cqn,isClosing:bqn,isClosed:lMs,isValidSubprotocol:uMs,fireEvent:Bot,utf8Decode:dMs,toArrayBuffer:fMs,getURLRecord:pMs}=nZ(),{establishWebSocketConnection:hMs,closeWebSocketConnection:mMs,failWebsocketConnection:Sqn}=Not(),{ByteParser:gMs}=Nor(),{kEnumerableProperty:_w}=ko(),{getGlobalDispatcher:AMs}=eot(),{ErrorEvent:yMs,CloseEvent:EMs,createFastMessageEvent:_Ms}=Pot(),{SendQueue:vMs}=_qn(),{WebsocketFrameSend:CMs}=Rfe(),{channels:s5}=rj();function bMs(t){return typeof t?.address=="function"?t.address():typeof t?.session?.socket?.address=="function"?t.session.socket.address():null}a(bMs,"getSocketAddress");var W_=class t extends EventTarget{static{a(this,"WebSocket")}#e={open:null,error:null,close:null,message:null};#t=0;#r="";#n="";#i;#o={onConnectionEstablished:a((e,r)=>this.#u(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#l(e,r),"onMessage"),onParserError:a(e=>Sqn(this.#o,null,e.message),"onParserError"),onParserDrain:a(()=>this.#p(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#o.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#o.readyState=AF.CLOSING,s5.socketError.hasSubscribers&&s5.socketError.publish(e),this.#o.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(e=>{s5.ping.hasSubscribers&&s5.ping.publish({payload:e,websocket:this})},"onPing"),onPong:a(e=>{s5.pong.hasSubscribers&&s5.pong.publish({payload:e,websocket:this})},"onPong"),readyState:AF.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#a;#c;constructor(e,r=[]){super(),pi.util.markAsUncloneable(this);let n="WebSocket constructor";pi.argumentLengthCheck(arguments,1,n);let o=pi.converters["DOMString or sequence or WebSocketInit"](r,n,"options");e=pi.converters.USVString(e),r=o.protocols;let s=vqn.settingsObject.baseUrl,c=pMs(e,s);if(typeof r=="string"&&(r=[r]),r.length!==new Set(r.map(u=>u.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(r.length>0&&!r.every(u=>uMs(u)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this.#s=new URL(c.href);let l=vqn.settingsObject;this.#o.controller=hMs(c,r,l,this.#o,o),this.#o.readyState=t.CONNECTING,this.#a="blob"}close(e=void 0,r=void 0){pi.brandCheck(this,t),e!==void 0&&(e=pi.converters["unsigned short"](e,"WebSocket.close","code",pi.attributes.Clamp)),r!==void 0&&(r=pi.converters.USVString(r)),e??=null,r??="",mMs(this.#o,e,r,!0)}send(e){pi.brandCheck(this,t);let r="WebSocket.send";if(pi.argumentLengthCheck(arguments,1,r),e=pi.converters.WebSocketSendData(e,r,"data"),cMs(this.#o.readyState))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!Cqn(this.#o.readyState)||bqn(this.#o.readyState)))if(typeof e=="string"){let n=Buffer.from(e);this.#t+=n.byteLength,this.#i.add(n,()=>{this.#t-=n.byteLength},Oot.text)}else sMs(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Oot.arrayBuffer)):ArrayBuffer.isView(e)?(this.#t+=e.byteLength,this.#i.add(e,()=>{this.#t-=e.byteLength},Oot.typedArray)):pi.is.Blob(e)&&(this.#t+=e.size,this.#i.add(e,()=>{this.#t-=e.size},Oot.blob))}get readyState(){return pi.brandCheck(this,t),this.#o.readyState}get bufferedAmount(){return pi.brandCheck(this,t),this.#t}get url(){return pi.brandCheck(this,t),aMs(this.#s)}get extensions(){return pi.brandCheck(this,t),this.#n}get protocol(){return pi.brandCheck(this,t),this.#r}get onopen(){return pi.brandCheck(this,t),this.#e.open}set onopen(e){pi.brandCheck(this,t),this.#e.open&&this.removeEventListener("open",this.#e.open);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onerror(){return pi.brandCheck(this,t),this.#e.error}set onerror(e){pi.brandCheck(this,t),this.#e.error&&this.removeEventListener("error",this.#e.error);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}get onclose(){return pi.brandCheck(this,t),this.#e.close}set onclose(e){pi.brandCheck(this,t),this.#e.close&&this.removeEventListener("close",this.#e.close);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("close",r),this.#e.close=e):this.#e.close=null}get onmessage(){return pi.brandCheck(this,t),this.#e.message}set onmessage(e){pi.brandCheck(this,t),this.#e.message&&this.removeEventListener("message",this.#e.message);let r=pi.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get binaryType(){return pi.brandCheck(this,t),this.#a}set binaryType(e){pi.brandCheck(this,t),e!=="blob"&&e!=="arraybuffer"?this.#a="blob":this.#a=e}#u(e,r){this.#o.socket=e.socket;let n=new gMs(this.#o,r);n.on("drain",()=>this.#o.onParserDrain()),n.on("error",c=>this.#o.onParserError(c)),this.#c=n,this.#i=new vMs(e.socket),this.#o.readyState=AF.OPEN;let o=e.headersList.get("sec-websocket-extensions");o!==null&&(this.#n=o);let s=e.headersList.get("sec-websocket-protocol");if(s!==null&&(this.#r=s),Bot("open",this),s5.open.hasSubscribers){let c=e.headersList.entries;s5.open.publish({address:bMs(e.socket),protocol:this.#r,extensions:this.#n,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:c}})}}#l(e,r){if(this.#o.readyState!==AF.OPEN)return;let n;if(e===Lor.TEXT)try{n=dMs(r)}catch{Sqn(this.#o,1007,"Received invalid UTF-8 in text frame.");return}else e===Lor.BINARY&&(this.#a==="blob"?n=new Blob([r]):n=fMs(r));Bot("message",this,_Ms,{origin:this.#s.origin,data:n})}#p(){this.#o.socket.resume()}#g(){let e=this.#o.closeState.has(Bor.SENT)&&this.#o.closeState.has(Bor.RECEIVED),r=1005,n="",o=this.#c?.closingInfo;o&&!o.error&&(r=o.code??1005,n=o.reason),this.#o.readyState=AF.CLOSED,this.#o.closeState.has(Bor.RECEIVED)||(r=1006,Bot("error",this,(s,c)=>new yMs(s,c),{error:new TypeError(n)})),Bot("close",this,(s,c)=>new EMs(s,c),{wasClean:e,code:r,reason:n}),s5.close.hasSubscribers&&s5.close.publish({websocket:this,code:r,reason:n})}static ping(e,r){if(Buffer.isBuffer(r)){if(r.length>125)throw new TypeError("A PING frame cannot have a body larger than 125 bytes.")}else if(r!==void 0)throw new TypeError("Expected buffer payload");let n=e.#o.readyState;if(Cqn(n)&&!bqn(n)&&!lMs(n)){let o=new CMs(r);e.#o.socket.write(o.createFrame(Lor.PING))}}},{ping:SMs}=W_;Reflect.deleteProperty(W_,"ping");W_.CONNECTING=W_.prototype.CONNECTING=AF.CONNECTING;W_.OPEN=W_.prototype.OPEN=AF.OPEN;W_.CLOSING=W_.prototype.CLOSING=AF.CLOSING;W_.CLOSED=W_.prototype.CLOSED=AF.CLOSED;Object.defineProperties(W_.prototype,{CONNECTING:Sj,OPEN:Sj,CLOSING:Sj,CLOSED:Sj,url:_w,readyState:_w,bufferedAmount:_w,onopen:_w,onerror:_w,onclose:_w,close:_w,onmessage:_w,binaryType:_w,send:_w,extensions:_w,protocol:_w,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(W_,{CONNECTING:Sj,OPEN:Sj,CLOSING:Sj,CLOSED:Sj});pi.converters["sequence"]=pi.sequenceConverter(pi.converters.DOMString);pi.converters["DOMString or sequence"]=function(t,e,r){return pi.util.Type(t)===pi.util.Types.OBJECT&&Symbol.iterator in t?pi.converters["sequence"](t):pi.converters.DOMString(t,e,r)};pi.converters.WebSocketInit=pi.dictionaryConverter([{key:"protocols",converter:pi.converters["DOMString or sequence"],defaultValue:a(()=>[],"defaultValue")},{key:"dispatcher",converter:pi.converters.any,defaultValue:a(()=>AMs(),"defaultValue")},{key:"headers",converter:pi.nullableConverter(pi.converters.HeadersInit)}]);pi.converters["DOMString or sequence or WebSocketInit"]=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&!(Symbol.iterator in t)?pi.converters.WebSocketInit(t):{protocols:pi.converters["DOMString or sequence"](t)}};pi.converters.WebSocketSendData=function(t){return pi.util.Type(t)===pi.util.Types.OBJECT&&(pi.is.Blob(t)||pi.is.BufferSource(t))?t:pi.converters.USVString(t)};Tqn.exports={WebSocket:W_,ping:SMs}});var For=I((Orf,Rqn)=>{"use strict";p();var{webidl:Lot}=PA(),{validateCloseCodeAndReason:TMs}=nZ(),{kConstruct:xqn}=tl(),{kEnumerableProperty:wqn}=ko();function IMs(){class t extends DOMException{static{a(this,"Test")}get reason(){return""}}return new t().reason!==void 0?DOMException:new Proxy(DOMException,{construct(e,r,n){let o=Reflect.construct(e,r,e);return Object.setPrototypeOf(o,n.prototype),o}})}a(IMs,"createInheritableDOMException");var oZ=class t extends IMs(){static{a(this,"WebSocketError")}#e;#t;constructor(e="",r=void 0){if(e=Lot.converters.DOMString(e,"WebSocketError","message"),super(e,"WebSocketError"),r===xqn)return;r!==null&&(r=Lot.converters.WebSocketCloseInfo(r));let n=r.closeCode??null,o=r.reason??"";TMs(n,o),o.length!==0&&n===null&&(n=1e3),this.#e=n,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(e,r,n){let o=new t(e,xqn);return o.#e=r,o.#t=n,o}},{createUnvalidatedWebSocketError:xMs}=oZ;delete oZ.createUnvalidatedWebSocketError;Object.defineProperties(oZ.prototype,{closeCode:wqn,reason:wqn,[Symbol.toStringTag]:{value:"WebSocketError",writable:!1,enumerable:!1,configurable:!0}});Lot.is.WebSocketError=Lot.util.MakeTypeAssertion(oZ);Rqn.exports={WebSocketError:oZ,createUnvalidatedWebSocketError:xMs}});var Mqn=I((Frf,Nqn)=>{"use strict";p();var{createDeferredPromise:Uor}=GRe(),{environmentSettingsObject:Pqn}=ZS(),{states:kfe,opcodes:Fot,sentCloseFrameState:Dfe}=bj(),{webidl:up}=PA(),{getURLRecord:wMs,isValidSubprotocol:RMs,isEstablished:PMs,utf8Decode:kMs}=nZ(),{establishWebSocketConnection:DMs,failWebsocketConnection:Qor,closeWebSocketConnection:qor}=Not(),{channels:kqn}=rj(),{WebsocketFrameSend:NMs}=Rfe(),{ByteParser:MMs}=Nor(),{WebSocketError:OMs,createUnvalidatedWebSocketError:BMs}=For(),{kEnumerableProperty:Uot}=ko(),{utf8DecodeBytes:LMs}=sit(),Dqn=!1,Qot=class{static{a(this,"WebSocketStream")}#e;#t;#r;#n;#i;#o;#s=!1;#a={onConnectionEstablished:a((e,r)=>this.#l(e,r),"onConnectionEstablished"),onMessage:a((e,r)=>this.#p(e,r),"onMessage"),onParserError:a(e=>Qor(this.#a,null,e.message),"onParserError"),onParserDrain:a(()=>this.#a.socket.resume(),"onParserDrain"),onSocketData:a(e=>{this.#c.write(e)||this.#a.socket.pause()},"onSocketData"),onSocketError:a(e=>{this.#a.readyState=kfe.CLOSING,kqn.socketError.hasSubscribers&&kqn.socketError.publish(e),this.#a.socket.destroy()},"onSocketError"),onSocketClose:a(()=>this.#g(),"onSocketClose"),onPing:a(()=>{},"onPing"),onPong:a(()=>{},"onPong"),readyState:kfe.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,r=void 0){Dqn||(process.emitWarning("WebSocketStream is experimental! Expect it to change at any time.",{code:"UNDICI-WSS"}),Dqn=!0),up.argumentLengthCheck(arguments,1,"WebSocket"),e=up.converters.USVString(e),r!==null&&(r=up.converters.WebSocketStreamOptions(r));let n=Pqn.settingsObject.baseUrl,o=wMs(e,n),s=r.protocols;if(s.length!==new Set(s.map(l=>l.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(s.length>0&&!s.every(l=>RMs(l)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(this.#e=o.toString(),this.#t=Uor(),this.#r=Uor(),r.signal!=null){let l=r.signal;if(l.aborted){this.#t.reject(l.reason),this.#r.reject(l.reason);return}l.addEventListener("abort",()=>{PMs(this.#a.readyState)||(Qor(this.#a),this.#a.readyState=kfe.CLOSING,this.#t.reject(l.reason),this.#r.reject(l.reason),this.#s=!0)},{once:!0})}let c=Pqn.settingsObject;this.#a.controller=DMs(o,s,c,this.#a,r)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#r.promise}close(e=void 0){e!==null&&(e=up.converters.WebSocketCloseInfo(e));let r=e.closeCode??null,n=e.reason;qor(this.#a,r,n,!0)}#u(e){e=up.converters.WebSocketStreamWrite(e);let r=Uor(),n=null,o=null;if(up.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),o=Fot.BINARY;else{let s;try{s=up.converters.DOMString(e)}catch(c){return r.reject(c),r.promise}n=new TextEncoder().encode(s),o=Fot.TEXT}if(!this.#a.closeState.has(Dfe.SENT)&&!this.#a.closeState.has(Dfe.RECEIVED)){let s=new NMs(n);this.#a.socket.write(s.createFrame(o),()=>{r.resolve(void 0)})}return r.promise}#l(e,r){this.#a.socket=e.socket;let n=new MMs(this.#a,r);n.on("drain",()=>this.#a.onParserDrain()),n.on("error",u=>this.#a.onParserError(u)),this.#c=n,this.#a.readyState=kfe.OPEN;let o=r??"",s=e.headersList.get("sec-websocket-protocol")??"",c=new ReadableStream({start:a(u=>{this.#i=u},"start"),cancel:a(u=>this.#h(u),"cancel")}),l=new WritableStream({write:a(u=>this.#u(u),"write"),close:a(()=>qor(this.#a,null,null),"close"),abort:a(u=>this.#A(u),"abort")});this.#n=c,this.#o=l,this.#t.resolve({extensions:o,protocol:s,readable:c,writable:l})}#p(e,r){if(this.#a.readyState!==kfe.OPEN)return;let n;if(e===Fot.TEXT)try{n=kMs(r)}catch{Qor(this.#a,1007,"Received invalid UTF-8 in text frame.");return}else e===Fot.BINARY&&(n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength));this.#i.enqueue(n)}#g(){let e=this.#a.closeState.has(Dfe.SENT)&&this.#a.closeState.has(Dfe.RECEIVED);if(this.#a.readyState=kfe.CLOSED,this.#s)return;this.#a.wasEverConnected||this.#t.reject(new OMs("Socket never opened"));let r=this.#c?.closingInfo,n=r?.code??1005;!this.#a.closeState.has(Dfe.SENT)&&!this.#a.closeState.has(Dfe.RECEIVED)&&(n=1006);let o=r?.reason==null?"":LMs(Buffer.from(r.reason));if(e)this.#i.close(),this.#o.locked||this.#o.abort(new DOMException("A closed WebSocketStream cannot be written to","InvalidStateError")),this.#r.resolve({closeCode:n,reason:o});else{let s=BMs("unclean close",n,o);this.#i?.error(s),this.#o?.abort(s),this.#r.reject(s)}}#A(e){let r=null,n="";up.is.WebSocketError(e)&&(r=e.closeCode,n=e.reason),qor(this.#a,r,n)}#h(e){this.#A(e)}};Object.defineProperties(Qot.prototype,{url:Uot,opened:Uot,closed:Uot,close:Uot,[Symbol.toStringTag]:{value:"WebSocketStream",writable:!1,enumerable:!1,configurable:!0}});up.converters.WebSocketStreamOptions=up.dictionaryConverter([{key:"protocols",converter:up.sequenceConverter(up.converters.USVString),defaultValue:a(()=>[],"defaultValue")},{key:"signal",converter:up.nullableConverter(up.converters.AbortSignal),defaultValue:a(()=>null,"defaultValue")}]);up.converters.WebSocketCloseInfo=up.dictionaryConverter([{key:"closeCode",converter:a(t=>up.converters["unsigned short"](t,up.attributes.EnforceRange),"converter")},{key:"reason",converter:up.converters.USVString,defaultValue:a(()=>"","defaultValue")}]);up.converters.WebSocketStreamWrite=function(t){return typeof t=="string"?up.converters.USVString(t):up.converters.BufferSource(t)};Nqn.exports={WebSocketStream:Qot}});var Bqn=I((qrf,Oqn)=>{"use strict";p();function FMs(t){return t.indexOf("\0")===-1}a(FMs,"isValidLastEventId");function UMs(t){if(t.length===0)return!1;for(let e=0;e57)return!1;return!0}a(UMs,"isASCIINumber");Oqn.exports={isValidLastEventId:FMs,isASCIINumber:UMs}});var Qqn=I((Grf,Uqn)=>{"use strict";p();var{Transform:QMs}=require("node:stream"),{isASCIINumber:Lqn,isValidLastEventId:Fqn}=Bqn(),yF=[239,187,191],jor=10,qot=13,qMs=58,jMs=32,Hor=class extends QMs{static{a(this,"EventSourceStream")}state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;buffer=null;pos=0;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},e.push&&(this.push=e.push)}_transform(e,r,n){if(e.length===0){n();return}if(this.buffer?this.buffer=Buffer.concat([this.buffer,e]):this.buffer=e,this.checkBOM)switch(this.buffer.length){case 1:if(this.buffer[0]===yF[0]){n();return}this.checkBOM=!1,n();return;case 2:if(this.buffer[0]===yF[0]&&this.buffer[1]===yF[1]){n();return}this.checkBOM=!1;break;case 3:if(this.buffer[0]===yF[0]&&this.buffer[1]===yF[1]&&this.buffer[2]===yF[2]){this.buffer=Buffer.alloc(0),this.checkBOM=!1,n();return}this.checkBOM=!1;break;default:this.buffer[0]===yF[0]&&this.buffer[1]===yF[1]&&this.buffer[2]===yF[2]&&(this.buffer=this.buffer.subarray(3)),this.checkBOM=!1;break}for(;this.pos0&&(r[o]=s);break}}processEvent(e){e.retry&&Lqn(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&Fqn(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||"message",options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};Uqn.exports={EventSourceStream:Hor}});var zqn=I((Wrf,Wqn)=>{"use strict";p();var{pipeline:HMs}=require("node:stream"),{fetching:GMs}=kPe(),{makeRequest:$Ms}=bfe(),{webidl:z_}=PA(),{EventSourceStream:VMs}=Qqn(),{parseMIMEType:WMs}=fw(),{createFastMessageEvent:zMs}=Pot(),{isNetworkError:qqn}=wPe(),{kEnumerableProperty:sZ}=ko(),{environmentSettingsObject:jqn}=ZS(),Hqn=!1,Gqn=3e3,FPe=0,$qn=1,UPe=2,YMs="anonymous",KMs="use-credentials",Nfe=class t extends EventTarget{static{a(this,"EventSource")}#e={open:null,error:null,message:null};#t;#r=!1;#n=FPe;#i=null;#o=null;#s;#a;constructor(e,r={}){super(),z_.util.markAsUncloneable(this);let n="EventSource constructor";z_.argumentLengthCheck(arguments,1,n),Hqn||(Hqn=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),e=z_.converters.USVString(e),r=z_.converters.EventSourceInitDict(r,n,"eventSourceInitDict"),this.#s=r.node.dispatcher||r.dispatcher,this.#a={lastEventId:"",reconnectionTime:r.node.reconnectionTime};let o=jqn,s;try{s=new URL(e,o.settingsObject.baseUrl),this.#a.origin=s.origin}catch(u){throw new DOMException(u,"SyntaxError")}this.#t=s.href;let c=YMs;r.withCredentials===!0&&(c=KMs,this.#r=!0);let l={redirect:"follow",keepalive:!0,mode:"cors",credentials:c==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};l.client=jqn.settingsObject,l.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],l.cache="no-store",l.initiator="other",l.urlList=[new URL(this.#t)],this.#i=$Ms(l),this.#c()}get readyState(){return this.#n}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#n===UPe)return;this.#n=FPe;let e={request:this.#i,dispatcher:this.#s},r=a(n=>{if(!qqn(n))return this.#u()},"processEventSourceEndOfBody");e.processResponseEndOfBody=r,e.processResponse=n=>{if(qqn(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#u();return}let o=n.headersList.get("content-type",!0),s=o!==null?WMs(o):"failure",c=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||c===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#n=$qn,this.dispatchEvent(new Event("open")),this.#a.origin=n.urlList[n.urlList.length-1].origin;let l=new VMs({eventSourceSettings:this.#a,push:a(u=>{this.dispatchEvent(zMs(u.type,u.options))},"push")});HMs(n.body.stream,l,u=>{u?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#o=GMs(e)}#u(){this.#n!==UPe&&(this.#n=FPe,this.dispatchEvent(new Event("error")),setTimeout(()=>{this.#n===FPe&&(this.#a.lastEventId.length&&this.#i.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c())},this.#a.reconnectionTime)?.unref())}close(){z_.brandCheck(this,t),this.#n!==UPe&&(this.#n=UPe,this.#o.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener("open",this.#e.open);let r=z_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("open",r),this.#e.open=e):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener("message",this.#e.message);let r=z_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("message",r),this.#e.message=e):this.#e.message=null}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener("error",this.#e.error);let r=z_.converters.EventHandlerNonNull(e);r!==null?(this.addEventListener("error",r),this.#e.error=e):this.#e.error=null}},Vqn={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:FPe,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:$qn,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:UPe,writable:!1}};Object.defineProperties(Nfe,Vqn);Object.defineProperties(Nfe.prototype,Vqn);Object.defineProperties(Nfe.prototype,{close:sZ,onerror:sZ,onmessage:sZ,onopen:sZ,readyState:sZ,url:sZ,withCredentials:sZ});z_.converters.EventSourceInitDict=z_.dictionaryConverter([{key:"withCredentials",converter:z_.converters.boolean,defaultValue:a(()=>!1,"defaultValue")},{key:"dispatcher",converter:z_.converters.any},{key:"node",converter:z_.dictionaryConverter([{key:"reconnectionTime",converter:z_.converters["unsigned long"],defaultValue:a(()=>Gqn,"defaultValue")},{key:"dispatcher",converter:z_.converters.any}]),defaultValue:a(()=>({}),"defaultValue")}]);Wqn.exports={EventSource:Nfe,defaultReconnectionTime:Gqn}});var Gor=I((Krf,An)=>{"use strict";p();var JMs=fj(),Kqn=LRe(),ZMs=FJ(),XMs=Y8n(),eOs=X8n(),tOs=qJ(),rOs=Onr(),nOs=knr(),iOs=L6n(),oOs=H6n(),sOs=V6n(),Jqn=ao(),Hot=ko(),{InvalidArgumentError:jot}=Jqn,Mfe=x9n(),aOs=kJ(),cOs=_ir(),{MockCallHistory:lOs,MockCallHistoryLog:uOs}=bir(),dOs=Dir(),fOs=xir(),pOs=IUn(),hOs=nir(),mOs=Uit(),{getGlobalDispatcher:Zqn,setGlobalDispatcher:gOs}=eot(),AOs=yfe(),yOs=Qir();Object.assign(Kqn.prototype,Mfe);An.exports.Dispatcher=Kqn;An.exports.Client=JMs;An.exports.Pool=ZMs;An.exports.BalancedPool=XMs;An.exports.RoundRobinPool=eOs;An.exports.Agent=tOs;An.exports.ProxyAgent=rOs;An.exports.Socks5ProxyAgent=nOs;An.exports.EnvHttpProxyAgent=iOs;An.exports.RetryAgent=oOs;An.exports.H2CClient=sOs;An.exports.RetryHandler=mOs;An.exports.DecoratorHandler=AOs;An.exports.RedirectHandler=yOs;An.exports.interceptors={redirect:LUn(),responseError:UUn(),retry:qUn(),dump:HUn(),dns:WUn(),cache:u7n(),decompress:m7n(),deduplicate:_7n()};An.exports.cacheStores={MemoryCacheStore:Yir()};var EOs=b7n();An.exports.cacheStores.SqliteCacheStore=EOs;An.exports.buildConnector=aOs;An.exports.errors=Jqn;An.exports.util={parseHeaders:Hot.parseHeaders,headerNameToString:Hot.headerNameToString};function QPe(t){return(e,r,n)=>{if(typeof r=="function"&&(n=r,r=null),!e||typeof e!="string"&&typeof e!="object"&&!(e instanceof URL))throw new jot("invalid url");if(r!=null&&typeof r!="object")throw new jot("invalid opts");if(r&&r.path!=null){if(typeof r.path!="string")throw new jot("invalid opts.path");let c=r.path;r.path.startsWith("/")||(c=`/${c}`),e=new URL(Hot.parseOrigin(e).origin+c)}else r||(r=typeof e=="object"?e:{}),e=Hot.parseURL(e);let{agent:o,dispatcher:s=Zqn()}=r;if(o)throw new jot("unsupported opts.agent. Did you mean opts.client?");return t.call(s,{...r,origin:e.origin,path:e.search?`${e.pathname}${e.search}`:e.pathname,method:r.method||(r.body?"PUT":"GET")},n)}}a(QPe,"makeDispatcher");An.exports.setGlobalDispatcher=gOs;An.exports.getGlobalDispatcher=Zqn;var _Os=kPe().fetch,Yqn=typeof __filename<"u"?__filename:void 0;function Xqn(t,e){if(!t||typeof t!="object")return;let r=typeof t.stack=="string"?t.stack:"",n=e.replace(/\\/g,"/");if(r&&(r.includes(e)||r.includes(n)))return;let o={};if(Error.captureStackTrace(o,Xqn),!o.stack)return;let s=o.stack.split(` `).slice(1).join(` `);t.stack=r?`${r} -${s}`:o.stack}a(Kqn,"appendFetchStackTrace");yn.exports.fetch=a(function(e,r=void 0){return D5s(e,r).catch(n=>{throw Vqn?Kqn(n,Vqn):n&&typeof n=="object"&&Error.captureStackTrace(n,yn.exports.fetch),n})},"fetch");yn.exports.Headers=sZ().Headers;yn.exports.Response=qke().Response;yn.exports.Request=xfe().Request;yn.exports.FormData=yit().FormData;var{setGlobalOrigin:N5s,getGlobalOrigin:M5s}=hrr();yn.exports.setGlobalOrigin=N5s;yn.exports.getGlobalOrigin=M5s;var{CacheStorage:O5s}=kQn(),{kConstruct:B5s}=nl();yn.exports.caches=new O5s(B5s);var{deleteCookie:L5s,getCookies:F5s,getSetCookies:U5s,setCookie:Q5s,parseCookie:q5s}=HQn();yn.exports.deleteCookie=L5s;yn.exports.getCookies=F5s;yn.exports.getSetCookies=U5s;yn.exports.setCookie=Q5s;yn.exports.parseCookie=q5s;var{parseMIMEType:j5s,serializeAMimeType:H5s}=pw();yn.exports.parseMIMEType=j5s;yn.exports.serializeAMimeType=H5s;var{CloseEvent:G5s,ErrorEvent:$5s,MessageEvent:V5s}=Bot(),{WebSocket:W5s,ping:z5s}=bqn();yn.exports.WebSocket=W5s;yn.exports.CloseEvent=G5s;yn.exports.ErrorEvent=$5s;yn.exports.MessageEvent=V5s;yn.exports.ping=z5s;yn.exports.WebSocketStream=Pqn().WebSocketStream;yn.exports.WebSocketError=Dor().WebSocketError;yn.exports.request=Xke(Ffe.request);yn.exports.stream=Xke(Ffe.stream);yn.exports.pipeline=Xke(Ffe.pipeline);yn.exports.connect=Xke(Ffe.connect);yn.exports.upgrade=Xke(Ffe.upgrade);yn.exports.MockClient=_5s;yn.exports.MockCallHistory=C5s;yn.exports.MockCallHistoryLog=v5s;yn.exports.MockPool=S5s;yn.exports.MockAgent=b5s;yn.exports.SnapshotAgent=T5s;yn.exports.mockErrors=I5s;var{EventSource:Y5s}=$qn();yn.exports.EventSource=Y5s;function K5s(){globalThis.fetch=yn.exports.fetch,globalThis.Headers=yn.exports.Headers,globalThis.Response=yn.exports.Response,globalThis.Request=yn.exports.Request,globalThis.FormData=yn.exports.FormData,globalThis.WebSocket=yn.exports.WebSocket,globalThis.CloseEvent=yn.exports.CloseEvent,globalThis.ErrorEvent=yn.exports.ErrorEvent,globalThis.MessageEvent=yn.exports.MessageEvent,globalThis.EventSource=yn.exports.EventSource}a(K5s,"install");yn.exports.install=K5s});var kPe=I(oc=>{"use strict";p();Object.defineProperty(oc,"__esModule",{value:!0});oc.regexpCode=oc.getEsmExportName=oc.getProperty=oc.safeStringify=oc.stringify=oc.strConcat=oc.addCodeArg=oc.str=oc._=oc.nil=oc._Code=oc.Name=oc.IDENTIFIER=oc._CodeOrName=void 0;var wPe=class{static{a(this,"_CodeOrName")}};oc._CodeOrName=wPe;oc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var IZ=class extends wPe{static{a(this,"Name")}constructor(e){if(super(),!oc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};oc.Name=IZ;var xw=class extends wPe{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof IZ&&(r[n.str]=(r[n.str]||0)+1),r),{})}};oc._Code=xw;oc.nil=new xw("");function Wjn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(cb,"__esModule",{value:!0});cb.ValueScope=cb.ValueScopeName=cb.Scope=cb.varKinds=cb.UsedValueState=void 0;var ab=kPe(),Psr=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},_st;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(_st||(cb.UsedValueState=_st={}));cb.varKinds={const:new ab.Name("const"),let:new ab.Name("let"),var:new ab.Name("var")};var Cst=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ab.Name?e:this.name(e)}name(e){return new ab.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};cb.Scope=Cst;var vst=class extends ab.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ab._)`.${new ab.Name(r)}[${n}]`}};cb.ValueScopeName=vst;var ELs=(0,ab._)`\n`,Dsr=class extends Cst{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ELs:ab.nil}}get(){return this._scope}name(e){return new vst(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ab._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=ab.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,_st.Started);let f=r(d);if(f){let h=this.opts.es5?cb.varKinds.var:cb.varKinds.const;s=(0,ab._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,ab._)`${s}${f}${this.opts._n}`;else throw new Psr(d);u.set(d,_st.Completed)})}return s}};cb.ValueScope=Dsr});var hs=I(xs=>{"use strict";p();Object.defineProperty(xs,"__esModule",{value:!0});xs.or=xs.and=xs.not=xs.CodeGen=xs.operators=xs.varKinds=xs.ValueScopeName=xs.ValueScope=xs.Scope=xs.Name=xs.regexpCode=xs.stringify=xs.getProperty=xs.nil=xs.strConcat=xs.str=xs._=void 0;var Pa=kPe(),o2=Nsr(),Fj=kPe();Object.defineProperty(xs,"_",{enumerable:!0,get:a(function(){return Fj._},"get")});Object.defineProperty(xs,"str",{enumerable:!0,get:a(function(){return Fj.str},"get")});Object.defineProperty(xs,"strConcat",{enumerable:!0,get:a(function(){return Fj.strConcat},"get")});Object.defineProperty(xs,"nil",{enumerable:!0,get:a(function(){return Fj.nil},"get")});Object.defineProperty(xs,"getProperty",{enumerable:!0,get:a(function(){return Fj.getProperty},"get")});Object.defineProperty(xs,"stringify",{enumerable:!0,get:a(function(){return Fj.stringify},"get")});Object.defineProperty(xs,"regexpCode",{enumerable:!0,get:a(function(){return Fj.regexpCode},"get")});Object.defineProperty(xs,"Name",{enumerable:!0,get:a(function(){return Fj.Name},"get")});var Ist=Nsr();Object.defineProperty(xs,"Scope",{enumerable:!0,get:a(function(){return Ist.Scope},"get")});Object.defineProperty(xs,"ValueScope",{enumerable:!0,get:a(function(){return Ist.ValueScope},"get")});Object.defineProperty(xs,"ValueScopeName",{enumerable:!0,get:a(function(){return Ist.ValueScopeName},"get")});Object.defineProperty(xs,"varKinds",{enumerable:!0,get:a(function(){return Ist.varKinds},"get")});xs.operators={GT:new Pa._Code(">"),GTE:new Pa._Code(">="),LT:new Pa._Code("<"),LTE:new Pa._Code("<="),EQ:new Pa._Code("==="),NEQ:new Pa._Code("!=="),NOT:new Pa._Code("!"),OR:new Pa._Code("||"),AND:new Pa._Code("&&"),ADD:new Pa._Code("+")};var PF=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},Msr=class extends PF{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?o2.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=$fe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Pa._CodeOrName?this.rhs.names:{}}},bst=class extends PF{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Pa.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$fe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Pa.Name?{}:{...this.lhs.names};return Tst(e,this.rhs)}},Osr=class extends bst{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Bsr=class extends PF{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Lsr=class extends PF{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Fsr=class extends PF{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Usr=class extends PF{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=$fe(this.code,e,r),this}get names(){return this.code instanceof Pa._CodeOrName?this.code.names:{}}},PPe=class extends PF{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(_Ls(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>RZ(e,r.names),{})}},DF=class extends PPe{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qsr=class extends PPe{static{a(this,"Root")}},Gfe=class extends DF{static{a(this,"Else")}};Gfe.kind="else";var xZ=class t extends DF{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Gfe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Yjn(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=$fe(this.condition,e,r),this}get names(){let e=super.names;return Tst(e,this.condition),this.else&&RZ(e,this.else.names),e}};xZ.kind="if";var wZ=class extends DF{static{a(this,"For")}};wZ.kind="for";var qsr=class extends wZ{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=$fe(this.iteration,e,r),this}get names(){return RZ(super.names,this.iteration.names)}},jsr=class extends wZ{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?o2.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Tst(super.names,this.from);return Tst(e,this.to)}},Sst=class extends wZ{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=$fe(this.iterable,e,r),this}get names(){return RZ(super.names,this.iterable.names)}},DPe=class extends DF{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};DPe.kind="func";var NPe=class extends PPe{static{a(this,"Return")}render(e){return"return "+super.render(e)}};NPe.kind="return";var Hsr=class extends DF{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&RZ(e,this.catch.names),this.finally&&RZ(e,this.finally.names),e}},MPe=class extends DF{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};MPe.kind="catch";var OPe=class extends DF{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};OPe.kind="finally";var Gsr=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` -`:""},this._extScope=e,this._scope=new o2.Scope({parent:e}),this._nodes=[new Qsr]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new Msr(e,s,n)),s}const(e,r,n){return this._def(o2.varKinds.const,e,r,n)}let(e,r,n){return this._def(o2.varKinds.let,e,r,n)}var(e,r,n){return this._def(o2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new bst(e,r,n))}add(e,r){return this._leafNode(new Osr(e,xs.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Pa.nil&&this._leafNode(new Usr(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Pa.addCodeArg)(r,o));return r.push("}"),new Pa._Code(r)}if(e,r,n){if(this._blockNode(new xZ(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new xZ(e))}else(){return this._elseNode(new Gfe)}endIf(){return this._endBlockNode(xZ,Gfe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new qsr(e),r)}forRange(e,r,n,o,s=this.opts.es5?o2.varKinds.var:o2.varKinds.let){let c=this._scope.toName(e);return this._for(new jsr(s,c,r,n),()=>o(c))}forOf(e,r,n,o=o2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Pa.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Pa._)`${c}.length`,l=>{this.var(s,(0,Pa._)`${c}[${l}]`),n(s)})}return this._for(new Sst("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?o2.varKinds.var:o2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Pa._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Sst("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(wZ)}label(e){return this._leafNode(new Bsr(e))}break(e){return this._leafNode(new Lsr(e))}return(e){let r=new NPe;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(NPe)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Hsr;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new MPe(s),r(s)}return n&&(this._currNode=o.finally=new OPe,this.code(n)),this._endBlockNode(MPe,OPe)}throw(e){return this._leafNode(new Fsr(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Pa.nil,n,o){return this._blockNode(new DPe(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(DPe)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof xZ))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};xs.CodeGen=Gsr;function RZ(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(RZ,"addNames");function Tst(t,e){return e instanceof Pa._CodeOrName?RZ(t,e.names):t}a(Tst,"addExprNames");function $fe(t,e,r){if(t instanceof Pa.Name)return n(t);if(!o(t))return t;return new Pa._Code(t._items.reduce((s,c)=>(c instanceof Pa.Name&&(c=n(c)),c instanceof Pa._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Pa._Code&&s._items.some(c=>c instanceof Pa.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a($fe,"optimizeExpr");function _Ls(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(_Ls,"subtractNames");function Yjn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Pa._)`!${$sr(t)}`}a(Yjn,"not");xs.not=Yjn;var CLs=Kjn(xs.operators.AND);function vLs(...t){return t.reduce(CLs)}a(vLs,"and");xs.and=vLs;var bLs=Kjn(xs.operators.OR);function SLs(...t){return t.reduce(bLs)}a(SLs,"or");xs.or=SLs;function Kjn(t){return(e,r)=>e===Pa.nil?r:r===Pa.nil?e:(0,Pa._)`${$sr(e)} ${t} ${$sr(r)}`}a(Kjn,"mappend");function $sr(t){return t instanceof Pa.Name?t:(0,Pa._)`(${t})`}a($sr,"par")});var za=I(Fs=>{"use strict";p();Object.defineProperty(Fs,"__esModule",{value:!0});Fs.checkStrictMode=Fs.getErrorPath=Fs.Type=Fs.useFunc=Fs.setEvaluated=Fs.evaluatedPropsToName=Fs.mergeEvaluated=Fs.eachItem=Fs.unescapeJsonPointer=Fs.escapeJsonPointer=Fs.escapeFragment=Fs.unescapeFragment=Fs.schemaRefOrVal=Fs.schemaHasRulesButRef=Fs.schemaHasRules=Fs.checkUnknownRules=Fs.alwaysValidSchema=Fs.toHash=void 0;var Gl=hs(),TLs=kPe();function ILs(t){let e={};for(let r of t)e[r]=!0;return e}a(ILs,"toHash");Fs.toHash=ILs;function xLs(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Xjn(t,e),!eHn(e,t.self.RULES.all))}a(xLs,"alwaysValidSchema");Fs.alwaysValidSchema=xLs;function Xjn(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||nHn(t,`unknown keyword: "${s}"`)}a(Xjn,"checkUnknownRules");Fs.checkUnknownRules=Xjn;function eHn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(eHn,"schemaHasRules");Fs.schemaHasRules=eHn;function wLs(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(wLs,"schemaHasRulesButRef");Fs.schemaHasRulesButRef=wLs;function RLs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Gl._)`${r}`}return(0,Gl._)`${t}${e}${(0,Gl.getProperty)(n)}`}a(RLs,"schemaRefOrVal");Fs.schemaRefOrVal=RLs;function kLs(t){return tHn(decodeURIComponent(t))}a(kLs,"unescapeFragment");Fs.unescapeFragment=kLs;function PLs(t){return encodeURIComponent(Wsr(t))}a(PLs,"escapeFragment");Fs.escapeFragment=PLs;function Wsr(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Wsr,"escapeJsonPointer");Fs.escapeJsonPointer=Wsr;function tHn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(tHn,"unescapeJsonPointer");Fs.unescapeJsonPointer=tHn;function DLs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(DLs,"eachItem");Fs.eachItem=DLs;function Jjn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof Gl.Name?(s instanceof Gl.Name?t(o,s,c):e(o,s,c),c):s instanceof Gl.Name?(e(o,c,s),s):r(s,c);return l===Gl.Name&&!(u instanceof Gl.Name)?n(o,u):u}}a(Jjn,"makeMergeEvaluated");Fs.mergeEvaluated={props:Jjn({mergeNames:a((t,e,r)=>t.if((0,Gl._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Gl._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Gl._)`${r} || {}`).code((0,Gl._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Gl._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Gl._)`${r} || {}`),zsr(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:rHn}),items:Jjn({mergeNames:a((t,e,r)=>t.if((0,Gl._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Gl._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,Gl._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Gl._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function rHn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Gl._)`{}`);return e!==void 0&&zsr(t,r,e),r}a(rHn,"evaluatedPropsToName");Fs.evaluatedPropsToName=rHn;function zsr(t,e,r){Object.keys(r).forEach(n=>t.assign((0,Gl._)`${e}${(0,Gl.getProperty)(n)}`,!0))}a(zsr,"setEvaluated");Fs.setEvaluated=zsr;var Zjn={};function NLs(t,e){return t.scopeValue("func",{ref:e,code:Zjn[e.code]||(Zjn[e.code]=new TLs._Code(e.code))})}a(NLs,"useFunc");Fs.useFunc=NLs;var Vsr;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Vsr||(Fs.Type=Vsr={}));function MLs(t,e,r){if(t instanceof Gl.Name){let n=e===Vsr.Num;return r?n?(0,Gl._)`"[" + ${t} + "]"`:(0,Gl._)`"['" + ${t} + "']"`:n?(0,Gl._)`"/" + ${t}`:(0,Gl._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Gl.getProperty)(t).toString():"/"+Wsr(t)}a(MLs,"getErrorPath");Fs.getErrorPath=MLs;function nHn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(nHn,"checkStrictMode");Fs.checkStrictMode=nHn});var NF=I(Ysr=>{"use strict";p();Object.defineProperty(Ysr,"__esModule",{value:!0});var aE=hs(),OLs={data:new aE.Name("data"),valCxt:new aE.Name("valCxt"),instancePath:new aE.Name("instancePath"),parentData:new aE.Name("parentData"),parentDataProperty:new aE.Name("parentDataProperty"),rootData:new aE.Name("rootData"),dynamicAnchors:new aE.Name("dynamicAnchors"),vErrors:new aE.Name("vErrors"),errors:new aE.Name("errors"),this:new aE.Name("this"),self:new aE.Name("self"),scope:new aE.Name("scope"),json:new aE.Name("json"),jsonPos:new aE.Name("jsonPos"),jsonLen:new aE.Name("jsonLen"),jsonPart:new aE.Name("jsonPart")};Ysr.default=OLs});var BPe=I(cE=>{"use strict";p();Object.defineProperty(cE,"__esModule",{value:!0});cE.extendErrors=cE.resetErrorsCount=cE.reportExtraError=cE.reportError=cE.keyword$DataError=cE.keywordError=void 0;var Ya=hs(),xst=za(),J_=NF();cE.keywordError={message:a(({keyword:t})=>(0,Ya.str)`must pass "${t}" keyword validation`,"message")};cE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,Ya.str)`"${t}" keyword must be ${e} ($data)`:(0,Ya.str)`"${t}" keyword is invalid ($data)`,"message")};function BLs(t,e=cE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=sHn(t,e,r);n??(c||l)?iHn(s,u):oHn(o,(0,Ya._)`[${u}]`)}a(BLs,"reportError");cE.reportError=BLs;function LLs(t,e=cE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=sHn(t,e,r);iHn(o,l),s||c||oHn(n,J_.default.vErrors)}a(LLs,"reportExtraError");cE.reportExtraError=LLs;function FLs(t,e){t.assign(J_.default.errors,e),t.if((0,Ya._)`${J_.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ya._)`${J_.default.vErrors}.length`,e),()=>t.assign(J_.default.vErrors,null)))}a(FLs,"resetErrorsCount");cE.resetErrorsCount=FLs;function ULs({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,J_.default.errors,l=>{t.const(c,(0,Ya._)`${J_.default.vErrors}[${l}]`),t.if((0,Ya._)`${c}.instancePath === undefined`,()=>t.assign((0,Ya._)`${c}.instancePath`,(0,Ya.strConcat)(J_.default.instancePath,s.errorPath))),t.assign((0,Ya._)`${c}.schemaPath`,(0,Ya.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ya._)`${c}.schema`,r),t.assign((0,Ya._)`${c}.data`,n))})}a(ULs,"extendErrors");cE.extendErrors=ULs;function iHn(t,e){let r=t.const("err",e);t.if((0,Ya._)`${J_.default.vErrors} === null`,()=>t.assign(J_.default.vErrors,(0,Ya._)`[${r}]`),(0,Ya._)`${J_.default.vErrors}.push(${r})`),t.code((0,Ya._)`${J_.default.errors}++`)}a(iHn,"addError");function oHn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Ya._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ya._)`${n}.errors`,e),r.return(!1))}a(oHn,"returnErrors");var kZ={keyword:new Ya.Name("keyword"),schemaPath:new Ya.Name("schemaPath"),params:new Ya.Name("params"),propertyName:new Ya.Name("propertyName"),message:new Ya.Name("message"),schema:new Ya.Name("schema"),parentSchema:new Ya.Name("parentSchema")};function sHn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ya._)`{}`:QLs(t,e,r)}a(sHn,"errorObjectCode");function QLs(t,e,r={}){let{gen:n,it:o}=t,s=[qLs(o,r),jLs(t,r)];return HLs(t,e,s),n.object(...s)}a(QLs,"errorObject");function qLs({errorPath:t},{instancePath:e}){let r=e?(0,Ya.str)`${t}${(0,xst.getErrorPath)(e,xst.Type.Str)}`:t;return[J_.default.instancePath,(0,Ya.strConcat)(J_.default.instancePath,r)]}a(qLs,"errorInstancePath");function jLs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Ya.str)`${e}/${t}`;return r&&(o=(0,Ya.str)`${o}${(0,xst.getErrorPath)(r,xst.Type.Str)}`),[kZ.schemaPath,o]}a(jLs,"errorSchemaPath");function HLs(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([kZ.keyword,o],[kZ.params,typeof e=="function"?e(t):e||(0,Ya._)`{}`]),u.messages&&n.push([kZ.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([kZ.schema,c],[kZ.parentSchema,(0,Ya._)`${f}${h}`],[J_.default.data,s]),d&&n.push([kZ.propertyName,d])}a(HLs,"extraErrorProps")});var cHn=I(Vfe=>{"use strict";p();Object.defineProperty(Vfe,"__esModule",{value:!0});Vfe.boolOrEmptySchema=Vfe.topBoolOrEmptySchema=void 0;var GLs=BPe(),$Ls=hs(),VLs=NF(),WLs={message:"boolean schema is false"};function zLs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?aHn(t,!1):typeof r=="object"&&r.$async===!0?e.return(VLs.default.data):(e.assign((0,$Ls._)`${n}.errors`,null),e.return(!0))}a(zLs,"topBoolOrEmptySchema");Vfe.topBoolOrEmptySchema=zLs;function YLs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),aHn(t)):r.var(e,!0)}a(YLs,"boolOrEmptySchema");Vfe.boolOrEmptySchema=YLs;function aHn(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,GLs.reportError)(o,WLs,void 0,e)}a(aHn,"falseSchemaError")});var Ksr=I(Wfe=>{"use strict";p();Object.defineProperty(Wfe,"__esModule",{value:!0});Wfe.getRules=Wfe.isJSONType=void 0;var KLs=["string","number","integer","boolean","null","object","array"],JLs=new Set(KLs);function ZLs(t){return typeof t=="string"&&JLs.has(t)}a(ZLs,"isJSONType");Wfe.isJSONType=ZLs;function XLs(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a(XLs,"getRules");Wfe.getRules=XLs});var Jsr=I(Uj=>{"use strict";p();Object.defineProperty(Uj,"__esModule",{value:!0});Uj.shouldUseRule=Uj.shouldUseGroup=Uj.schemaHasRulesForType=void 0;function e3s({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&lHn(t,n)}a(e3s,"schemaHasRulesForType");Uj.schemaHasRulesForType=e3s;function lHn(t,e){return e.rules.some(r=>uHn(t,r))}a(lHn,"shouldUseGroup");Uj.shouldUseGroup=lHn;function uHn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(uHn,"shouldUseRule");Uj.shouldUseRule=uHn});var LPe=I(lE=>{"use strict";p();Object.defineProperty(lE,"__esModule",{value:!0});lE.reportTypeError=lE.checkDataTypes=lE.checkDataType=lE.coerceAndCheckDataType=lE.getJSONTypes=lE.getSchemaTypes=lE.DataType=void 0;var t3s=Ksr(),r3s=Jsr(),n3s=BPe(),ns=hs(),dHn=za(),zfe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(zfe||(lE.DataType=zfe={}));function i3s(t){let e=fHn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(i3s,"getSchemaTypes");lE.getSchemaTypes=i3s;function fHn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(t3s.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(fHn,"getJSONTypes");lE.getJSONTypes=fHn;function o3s(t,e){let{gen:r,data:n,opts:o}=t,s=s3s(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,r3s.schemaHasRulesForType)(t,e[0]));if(c){let l=Xsr(e,n,o.strictNumbers,zfe.Wrong);r.if(l,()=>{s.length?a3s(t,e,s):ear(t)})}return c}a(o3s,"coerceAndCheckDataType");lE.coerceAndCheckDataType=o3s;var pHn=new Set(["string","number","integer","boolean","null"]);function s3s(t,e){return e?t.filter(r=>pHn.has(r)||e==="array"&&r==="array"):[]}a(s3s,"coerceToTypes");function a3s(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,ns._)`typeof ${o}`),l=n.let("coerced",(0,ns._)`undefined`);s.coerceTypes==="array"&&n.if((0,ns._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,ns._)`${o}[0]`).assign(c,(0,ns._)`typeof ${o}`).if(Xsr(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,ns._)`${l} !== undefined`);for(let d of r)(pHn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),ear(t),n.endIf(),n.if((0,ns._)`${l} !== undefined`,()=>{n.assign(o,l),c3s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,ns._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,ns._)`"" + ${o}`).elseIf((0,ns._)`${o} === null`).assign(l,(0,ns._)`""`);return;case"number":n.elseIf((0,ns._)`${c} == "boolean" || ${o} === null - || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,ns._)`+${o}`);return;case"integer":n.elseIf((0,ns._)`${c} === "boolean" || ${o} === null - || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,ns._)`+${o}`);return;case"boolean":n.elseIf((0,ns._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,ns._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,ns._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,ns._)`${c} === "string" || ${c} === "number" - || ${c} === "boolean" || ${o} === null`).assign(l,(0,ns._)`[${o}]`)}}a(u,"coerceSpecificType")}a(a3s,"coerceData");function c3s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ns._)`${e} !== undefined`,()=>t.assign((0,ns._)`${e}[${r}]`,n))}a(c3s,"assignParentData");function Zsr(t,e,r,n=zfe.Correct){let o=n===zfe.Correct?ns.operators.EQ:ns.operators.NEQ,s;switch(t){case"null":return(0,ns._)`${e} ${o} null`;case"array":s=(0,ns._)`Array.isArray(${e})`;break;case"object":s=(0,ns._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,ns._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,ns._)`typeof ${e} ${o} ${t}`}return n===zfe.Correct?s:(0,ns.not)(s);function c(l=ns.nil){return(0,ns.and)((0,ns._)`typeof ${e} == "number"`,l,r?(0,ns._)`isFinite(${e})`:ns.nil)}}a(Zsr,"checkDataType");lE.checkDataType=Zsr;function Xsr(t,e,r,n){if(t.length===1)return Zsr(t[0],e,r,n);let o,s=(0,dHn.toHash)(t);if(s.array&&s.object){let c=(0,ns._)`typeof ${e} != "object"`;o=s.null?c:(0,ns._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=ns.nil;s.number&&delete s.integer;for(let c in s)o=(0,ns.and)(o,Zsr(c,e,r,n));return o}a(Xsr,"checkDataTypes");lE.checkDataTypes=Xsr;var l3s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,ns._)`{type: ${t}}`:(0,ns._)`{type: ${e}}`,"params")};function ear(t){let e=u3s(t);(0,n3s.reportError)(e,l3s)}a(ear,"reportTypeError");lE.reportTypeError=ear;function u3s(t){let{gen:e,data:r,schema:n}=t,o=(0,dHn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(u3s,"getTypeErrorContext")});var mHn=I(wst=>{"use strict";p();Object.defineProperty(wst,"__esModule",{value:!0});wst.assignDefaults=void 0;var Yfe=hs(),d3s=za();function f3s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)hHn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>hHn(t,s,o.default))}a(f3s,"assignDefaults");wst.assignDefaults=f3s;function hHn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,Yfe._)`${s}${(0,Yfe.getProperty)(e)}`;if(o){(0,d3s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,Yfe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,Yfe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,Yfe._)`${l} = ${(0,Yfe.stringify)(r)}`)}a(hHn,"assignDefault")});var ww=I(Sl=>{"use strict";p();Object.defineProperty(Sl,"__esModule",{value:!0});Sl.validateUnion=Sl.validateArray=Sl.usePattern=Sl.callValidateCode=Sl.schemaProperties=Sl.allSchemaProperties=Sl.noPropertyInData=Sl.propertyInData=Sl.isOwnProperty=Sl.hasPropFunc=Sl.reportMissingProp=Sl.checkMissingProp=Sl.checkReportMissingProp=void 0;var id=hs(),tar=za(),Qj=NF(),p3s=za();function h3s(t,e){let{gen:r,data:n,it:o}=t;r.if(nar(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,id._)`${e}`},!0),t.error()})}a(h3s,"checkReportMissingProp");Sl.checkReportMissingProp=h3s;function m3s({gen:t,data:e,it:{opts:r}},n,o){return(0,id.or)(...n.map(s=>(0,id.and)(nar(t,e,s,r.ownProperties),(0,id._)`${o} = ${s}`)))}a(m3s,"checkMissingProp");Sl.checkMissingProp=m3s;function g3s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(g3s,"reportMissingProp");Sl.reportMissingProp=g3s;function gHn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,id._)`Object.prototype.hasOwnProperty`})}a(gHn,"hasPropFunc");Sl.hasPropFunc=gHn;function rar(t,e,r){return(0,id._)`${gHn(t)}.call(${e}, ${r})`}a(rar,"isOwnProperty");Sl.isOwnProperty=rar;function A3s(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} !== undefined`;return n?(0,id._)`${o} && ${rar(t,e,r)}`:o}a(A3s,"propertyInData");Sl.propertyInData=A3s;function nar(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} === undefined`;return n?(0,id.or)(o,(0,id.not)(rar(t,e,r))):o}a(nar,"noPropertyInData");Sl.noPropertyInData=nar;function AHn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(AHn,"allSchemaProperties");Sl.allSchemaProperties=AHn;function y3s(t,e){return AHn(e).filter(r=>!(0,tar.alwaysValidSchema)(t,e[r]))}a(y3s,"schemaProperties");Sl.schemaProperties=y3s;function E3s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,id._)`${t}, ${e}, ${n}${o}`:e,h=[[Qj.default.instancePath,(0,id.strConcat)(Qj.default.instancePath,s)],[Qj.default.parentData,c.parentData],[Qj.default.parentDataProperty,c.parentDataProperty],[Qj.default.rootData,Qj.default.rootData]];c.opts.dynamicRef&&h.push([Qj.default.dynamicAnchors,Qj.default.dynamicAnchors]);let m=(0,id._)`${f}, ${r.object(...h)}`;return u!==id.nil?(0,id._)`${l}.call(${u}, ${m})`:(0,id._)`${l}(${m})`}a(E3s,"callValidateCode");Sl.callValidateCode=E3s;var _3s=(0,id._)`new RegExp`;function C3s({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,id._)`${o.code==="new RegExp"?_3s:(0,p3s.useFunc)(t,o)}(${r}, ${n})`})}a(C3s,"usePattern");Sl.usePattern=C3s;function v3s(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,id._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:tar.Type.Num},s),e.if((0,id.not)(s),l)})}a(c,"validateItems")}a(v3s,"validateArray");Sl.validateArray=v3s;function b3s(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,tar.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,id._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,id.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(b3s,"validateUnion");Sl.validateUnion=b3s});var _Hn=I(h5=>{"use strict";p();Object.defineProperty(h5,"__esModule",{value:!0});h5.validateKeywordUsage=h5.validSchemaType=h5.funcKeywordCode=h5.macroKeywordCode=void 0;var Z_=hs(),PZ=NF(),S3s=ww(),T3s=BPe();function I3s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=EHn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Z_.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(I3s,"macroKeywordCode");h5.macroKeywordCode=I3s;function x3s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;R3s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=EHn(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&yHn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&yHn(t),E(()=>w3s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,Z_._)`await `),v=>n.assign(h,!1).if((0,Z_._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,Z_._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,Z_._)`${f}.errors`;return n.assign(_,null),y(Z_.nil),_}a(A,"validateSync");function y(_=e.async?(0,Z_._)`await `:Z_.nil){let v=u.opts.passContext?PZ.default.this:PZ.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Z_._)`${_}${(0,S3s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,Z_.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(x3s,"funcKeywordCode");h5.funcKeywordCode=x3s;function yHn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Z_._)`${n.parentData}[${n.parentDataProperty}]`))}a(yHn,"modifyData");function w3s(t,e){let{gen:r}=t;r.if((0,Z_._)`Array.isArray(${e})`,()=>{r.assign(PZ.default.vErrors,(0,Z_._)`${PZ.default.vErrors} === null ? ${e} : ${PZ.default.vErrors}.concat(${e})`).assign(PZ.default.errors,(0,Z_._)`${PZ.default.vErrors}.length`),(0,T3s.extendErrors)(t)},()=>t.error())}a(w3s,"addErrs");function R3s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(R3s,"checkAsyncKeyword");function EHn(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Z_.stringify)(r)})}a(EHn,"useKeyword");function k3s(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(k3s,"validSchemaType");h5.validSchemaType=k3s;function P3s({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(P3s,"validateKeywordUsage");h5.validateKeywordUsage=P3s});var vHn=I(qj=>{"use strict";p();Object.defineProperty(qj,"__esModule",{value:!0});qj.extendSubschemaMode=qj.extendSubschemaData=qj.getSubschema=void 0;var m5=hs(),CHn=za();function D3s(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,m5._)`${t.schemaPath}${(0,m5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,m5._)`${t.schemaPath}${(0,m5.getProperty)(e)}${(0,m5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,CHn.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(D3s,"getSubschema");qj.getSubschema=D3s;function N3s(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,m5._)`${e.data}${(0,m5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,m5.str)`${d}${(0,CHn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,m5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof m5.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(N3s,"extendSubschemaData");qj.extendSubschemaData=N3s;function M3s(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(M3s,"extendSubschemaMode");qj.extendSubschemaMode=M3s});var iar=I((kpf,bHn)=>{"use strict";p();bHn.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var THn=I((Npf,SHn)=>{"use strict";p();var jj=SHn.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Rst(e,n,o,t,"",t)};jj.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};jj.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};jj.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};jj.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Rst(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in jj.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(lb,"__esModule",{value:!0});lb.getSchemaRefs=lb.resolveUrl=lb.normalizeId=lb._getFullPath=lb.getFullPath=lb.inlineRef=void 0;var B3s=za(),L3s=iar(),F3s=THn(),U3s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Q3s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!oar(t):e?IHn(t)<=e:!1}a(Q3s,"inlineRef");lb.inlineRef=Q3s;var q3s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function oar(t){for(let e in t){if(q3s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(oar)||typeof r=="object"&&oar(r))return!0}return!1}a(oar,"hasRef");function IHn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!U3s.has(r)&&(typeof t[r]=="object"&&(0,B3s.eachItem)(t[r],n=>e+=IHn(n)),e===1/0))return 1/0}return e}a(IHn,"countKeys");function xHn(t,e="",r){r!==!1&&(e=Kfe(e));let n=t.parse(e);return wHn(t,n)}a(xHn,"getFullPath");lb.getFullPath=xHn;function wHn(t,e){return t.serialize(e).split("#")[0]+"#"}a(wHn,"_getFullPath");lb._getFullPath=wHn;var j3s=/#\/?$/;function Kfe(t){return t?t.replace(j3s,""):""}a(Kfe,"normalizeId");lb.normalizeId=Kfe;function H3s(t,e,r){return r=Kfe(r),t.resolve(e,r)}a(H3s,"resolveUrl");lb.resolveUrl=H3s;var G3s=/^[a-z_][-a-z0-9._]*$/i;function $3s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Kfe(t[r]||e),s={"":o},c=xHn(n,o,!1),l={},u=new Set;return F3s(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=Kfe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==Kfe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!G3s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!L3s(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a($3s,"getSchemaRefs");lb.getSchemaRefs=$3s});var qPe=I(Hj=>{"use strict";p();Object.defineProperty(Hj,"__esModule",{value:!0});Hj.getData=Hj.KeywordCxt=Hj.validateFunctionCode=void 0;var NHn=cHn(),RHn=LPe(),aar=Jsr(),kst=LPe(),V3s=mHn(),QPe=_Hn(),sar=vHn(),ni=hs(),po=NF(),W3s=FPe(),MF=za(),UPe=BPe();function z3s(t){if(BHn(t)&&(LHn(t),OHn(t))){J3s(t);return}MHn(t,()=>(0,NHn.topBoolOrEmptySchema)(t))}a(z3s,"validateFunctionCode");Hj.validateFunctionCode=z3s;function MHn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ni._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,ni._)`"use strict"; ${kHn(r,o)}`),K3s(t,o),t.code(s)}):t.func(e,(0,ni._)`${po.default.data}, ${Y3s(o)}`,n.$async,()=>t.code(kHn(r,o)).code(s))}a(MHn,"validateFunction");function Y3s(t){return(0,ni._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,ni._)`, ${po.default.dynamicAnchors}={}`:ni.nil}}={}`}a(Y3s,"destructureValCxt");function K3s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,ni._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,ni._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,ni._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,ni._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,ni._)`""`),t.var(po.default.parentData,(0,ni._)`undefined`),t.var(po.default.parentDataProperty,(0,ni._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`{}`)})}a(K3s,"destructureValCxtES5");function J3s(t){let{schema:e,opts:r,gen:n}=t;MHn(t,()=>{r.$comment&&e.$comment&&UHn(t),rFs(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&Z3s(t),FHn(t),oFs(t)})}a(J3s,"topSchemaObjCode");function Z3s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ni._)`${r}.evaluated`),e.if((0,ni._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ni._)`${t.evaluated}.props`,(0,ni._)`undefined`)),e.if((0,ni._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ni._)`${t.evaluated}.items`,(0,ni._)`undefined`))}a(Z3s,"resetEvaluated");function kHn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ni._)`/*# sourceURL=${r} */`:ni.nil}a(kHn,"funcSourceUrl");function X3s(t,e){if(BHn(t)&&(LHn(t),OHn(t))){eFs(t,e);return}(0,NHn.boolOrEmptySchema)(t,e)}a(X3s,"subschemaCode");function OHn({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(OHn,"schemaCxtHasRules");function BHn(t){return typeof t.schema!="boolean"}a(BHn,"isSchemaObj");function eFs(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&UHn(t),nFs(t),iFs(t);let s=n.const("_errs",po.default.errors);FHn(t,s),n.var(e,(0,ni._)`${s} === ${po.default.errors}`)}a(eFs,"subSchemaObjCode");function LHn(t){(0,MF.checkUnknownRules)(t),tFs(t)}a(LHn,"checkKeywords");function FHn(t,e){if(t.opts.jtd)return PHn(t,[],!1,e);let r=(0,RHn.getSchemaTypes)(t.schema),n=(0,RHn.coerceAndCheckDataType)(t,r);PHn(t,r,!n,e)}a(FHn,"typeAndKeywords");function tFs(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,MF.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(tFs,"checkRefsAndKeywords");function rFs(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,MF.checkStrictMode)(t,"default is ignored in the schema root")}a(rFs,"checkNoDefault");function nFs(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,W3s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(nFs,"updateContext");function iFs(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(iFs,"checkAsyncSchema");function UHn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ni._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ni.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ni._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(UHn,"commentKeyword");function oFs(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ni._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,ni._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,ni._)`${n}.errors`,po.default.vErrors),s.unevaluated&&sFs(t),e.return((0,ni._)`${po.default.errors} === 0`))}a(oFs,"returnResults");function sFs({gen:t,evaluated:e,props:r,items:n}){r instanceof ni.Name&&t.assign((0,ni._)`${e}.props`,r),n instanceof ni.Name&&t.assign((0,ni._)`${e}.items`,n)}a(sFs,"assignEvaluated");function PHn(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,MF.schemaHasRulesButRef)(s,f))){o.block(()=>qHn(t,"$ref",f.all.$ref.definition));return}u.jtd||aFs(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,aar.shouldUseGroup)(s,m)&&(m.type?(o.if((0,kst.checkDataType)(m.type,c,u.strictNumbers)),DHn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,kst.reportTypeError)(t)),o.endIf()):DHn(t,m),l||o.if((0,ni._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a(PHn,"schemaKeywords");function DHn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,V3s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,aar.shouldUseRule)(n,s)&&qHn(t,s.keyword,s.definition,e.type)})}a(DHn,"iterateKeywords");function aFs(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cFs(t,e),t.opts.allowUnionTypes||lFs(t,e),uFs(t,t.dataTypes))}a(aFs,"checkStrictTypes");function cFs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{QHn(t.dataTypes,r)||car(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),fFs(t,e)}}a(cFs,"checkContextTypes");function lFs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&car(t,"use allowUnionTypes to allow union type keyword")}a(lFs,"checkMultipleTypes");function uFs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,aar.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>dFs(e,c))&&car(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(uFs,"checkKeywordTypes");function dFs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(dFs,"hasApplicableType");function QHn(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(QHn,"includesType");function fFs(t,e){let r=[];for(let n of t.dataTypes)QHn(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(fFs,"narrowSchemaTypes");function car(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,MF.checkStrictMode)(t,e,t.opts.strictTypes)}a(car,"strictTypesError");var Pst=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,QPe.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,MF.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",jHn(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,QPe.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",po.default.errors))}result(e,r,n){this.failResult((0,ni.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ni.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ni._)`${r} !== undefined && (${(0,ni.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?UPe.reportExtraError:UPe.reportError)(this,this.def.error,r)}$dataError(){(0,UPe.reportError)(this,this.def.$dataError||UPe.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,UPe.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ni.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ni.nil,r=ni.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ni.or)((0,ni._)`${o} === undefined`,r)),e!==ni.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ni.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ni.or)(c(),l());function c(){if(n.length){if(!(r instanceof ni.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ni._)`${(0,kst.checkDataTypes)(u,r,s.opts.strictNumbers,kst.DataType.Wrong)}`}return ni.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ni._)`!${u}(${r})`}return ni.nil}}subschema(e,r){let n=(0,sar.getSubschema)(this.it,e);(0,sar.extendSubschemaData)(n,this.it,e),(0,sar.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return X3s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=MF.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=MF.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,ni.Name)),!0}};Hj.KeywordCxt=Pst;function qHn(t,e,r,n){let o=new Pst(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,QPe.funcKeywordCode)(o,r):"macro"in r?(0,QPe.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,QPe.funcKeywordCode)(o,r)}a(qHn,"keywordCode");var pFs=/^\/(?:[^~]|~0|~1)*$/,hFs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function jHn(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!pFs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=hFs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,ni._)`${s}${(0,ni.getProperty)((0,MF.unescapeJsonPointer)(d))}`,c=(0,ni._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(jHn,"getData");Hj.getData=jHn});var Dst=I(uar=>{"use strict";p();Object.defineProperty(uar,"__esModule",{value:!0});var lar=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};uar.default=lar});var jPe=I(par=>{"use strict";p();Object.defineProperty(par,"__esModule",{value:!0});var dar=FPe(),far=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,dar.resolveUrl)(e,r,n),this.missingSchema=(0,dar.normalizeId)((0,dar.getFullPath)(e,this.missingRef))}};par.default=far});var Mst=I(Rw=>{"use strict";p();Object.defineProperty(Rw,"__esModule",{value:!0});Rw.resolveSchema=Rw.getCompilingSchema=Rw.resolveRef=Rw.compileSchema=Rw.SchemaEnv=void 0;var s2=hs(),mFs=Dst(),DZ=NF(),a2=FPe(),HHn=za(),gFs=qPe(),Jfe=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,a2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Rw.SchemaEnv=Jfe;function mar(t){let e=GHn.call(this,t);if(e)return e;let r=(0,a2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new s2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:mFs.default,code:(0,s2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:DZ.default.data,parentData:DZ.default.parentData,parentDataProperty:DZ.default.parentDataProperty,dataNames:[DZ.default.data],dataPathArr:[s2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,s2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:s2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,s2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,gFs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(DZ.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${DZ.default.self}`,`${DZ.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof s2.Name?void 0:A,items:y instanceof s2.Name?void 0:y,dynamicProps:A instanceof s2.Name,dynamicItems:y instanceof s2.Name},g.source&&(g.source.evaluated=(0,s2.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a(mar,"compileSchema");Rw.compileSchema=mar;function AFs(t,e,r){var n;r=(0,a2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=_Fs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new Jfe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yFs.call(this,s)}a(AFs,"resolveRef");Rw.resolveRef=AFs;function yFs(t){return(0,a2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:mar.call(this,t)}a(yFs,"inlineOrCompile");function GHn(t){for(let e of this._compilations)if(EFs(e,t))return e}a(GHn,"getCompilingSchema");Rw.getCompilingSchema=GHn;function EFs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(EFs,"sameSchemaEnv");function _Fs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Nst.call(this,t,e)}a(_Fs,"resolve");function Nst(t,e){let r=this.opts.uriResolver.parse(e),n=(0,a2._getFullPath)(this.opts.uriResolver,r),o=(0,a2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return har.call(this,r,t);let s=(0,a2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=Nst.call(this,t,c);return typeof l?.schema!="object"?void 0:har.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||mar.call(this,c),s===(0,a2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,a2.resolveUrl)(this.opts.uriResolver,o,d)),new Jfe({schema:l,schemaId:u,root:t,baseId:o})}return har.call(this,r,c)}}a(Nst,"resolveSchema");Rw.resolveSchema=Nst;var CFs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function har(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,HHn.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!CFs.has(l)&&d&&(e=(0,a2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,HHn.schemaHasRulesButRef)(r,this.RULES)){let l=(0,a2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Nst.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Jfe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a(har,"getJsonPointer")});var $Hn=I((Jpf,vFs)=>{vFs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var yar=I((Zpf,JHn)=>{"use strict";p();var bFs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),WHn=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),gar=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),zHn=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),SFs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Aar(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(Aar,"stringArrayToHexStripped");var TFs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function VHn(t){return t.length=0,!0}a(VHn,"consumeIsZone");function IFs(t,e,r){if(t.length){let n=Aar(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(IFs,"consumeHextets");function xFs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=IFs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=VHn}else{o.push(d);continue}}return o.length&&(l===VHn?r.zone=o.join(""):c?n.push(o.join("")):n.push(Aar(o))),r.address=n.join(""),r}a(xFs,"getIPV6");function YHn(t){if(wFs(t,":")<2)return{host:t,isIPV6:!1};let e=xFs(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(YHn,"normalizeIPv6");function wFs(t,e){let r=0;for(let n=0;nkFs[n])}a(KHn,"reescapeHostDelimiters");function NFs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:LFs}=yar(),FFs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UFs=["http","https","ws","wss","urn","urn:uuid"];function QFs(t){return UFs.indexOf(t)!==-1}a(QFs,"isValidSchemeName");function Ear(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(Ear,"wsIsSecure");function ZHn(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(ZHn,"httpParse");function XHn(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(XHn,"httpSerialize");function qFs(t){return t.secure=Ear(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(qFs,"wsParse");function jFs(t){if((t.port===(Ear(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(jFs,"wsSerialize");function HFs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(FFs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=_ar(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(HFs,"urnParse");function GFs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=_ar(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(GFs,"urnSerialize");function $Fs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LFs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a($Fs,"urnuuidParse");function VFs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(VFs,"urnuuidSerialize");var eGn={scheme:"http",domainHost:!0,parse:ZHn,serialize:XHn},WFs={scheme:"https",domainHost:eGn.domainHost,parse:ZHn,serialize:XHn},Ost={scheme:"ws",domainHost:!0,parse:qFs,serialize:jFs},zFs={scheme:"wss",domainHost:Ost.domainHost,parse:Ost.parse,serialize:Ost.serialize},YFs={scheme:"urn",parse:HFs,serialize:GFs,skipNormalize:!0},KFs={scheme:"urn:uuid",parse:$Fs,serialize:VFs,skipNormalize:!0},Bst={http:eGn,https:WFs,ws:Ost,wss:zFs,urn:YFs,"urn:uuid":KFs};Object.setPrototypeOf(Bst,null);function _ar(t){return t&&(Bst[t]||Bst[t.toLowerCase()])||void 0}a(_ar,"getSchemeHandler");tGn.exports={wsIsSecure:Ear,SCHEMES:Bst,isValidSchemeName:QFs,getSchemeHandler:_ar}});var cGn=I((ihf,Lst)=>{"use strict";p();var{normalizeIPv6:JFs,removeDotSegments:HPe,recomposeAuthority:ZFs,normalizePercentEncoding:XFs,normalizePathEncoding:e8s,escapePreservingEscapes:t8s,reescapeHostDelimiters:r8s,isIPv4:n8s,nonSimpleDomain:i8s}=yar(),{SCHEMES:o8s,getSchemeHandler:iGn}=rGn();function s8s(t,e){return typeof t=="string"?t=d8s(t,e):typeof t=="object"&&(t=Zfe(NZ(t,e),e)),t}a(s8s,"normalize");function a8s(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=oGn(Zfe(t,n),Zfe(e,n),n,!0);return n.skipEscape=!0,NZ(o,n)}a(a8s,"resolve");function oGn(t,e,r,n){let o={};return n||(t=Zfe(NZ(t,r),r),e=Zfe(NZ(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=HPe(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=HPe(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=HPe(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=HPe(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(oGn,"resolveComponent");function c8s(t,e,r){let n=nGn(t,r),o=nGn(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(c8s,"equal");function NZ(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=iGn(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=XFs(r.path):(r.path=t8s(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=ZFs(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=HPe(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(NZ,"serialize");var l8s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u8s(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(u8s,"getParseError");function sGn(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(l8s);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=u8s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(n8s(n.host)===!1){let f=JFs(n.host);n.host=f.host.toLowerCase(),s=f.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=iGn(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&i8s(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=r8s(unescape(n.host),s))),n.path&&(n.path=e8s(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(sGn,"parseWithStatus");function Zfe(t,e){return sGn(t,e).parsed}a(Zfe,"parse");function d8s(t,e){return aGn(t,e).normalized}a(d8s,"normalizeString");function aGn(t,e){let{parsed:r,malformedAuthorityOrPort:n}=sGn(t,e);return{normalized:n?t:NZ(r,e),malformedAuthorityOrPort:n}}a(aGn,"normalizeStringWithStatus");function nGn(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=aGn(t,e);return n?void 0:r}if(typeof t=="object")return NZ(t,e)}a(nGn,"normalizeComparableURI");var Car={SCHEMES:o8s,normalize:s8s,resolve:a8s,resolveComponent:oGn,equal:c8s,serialize:NZ,parse:Zfe};Lst.exports=Car;Lst.exports.default=Car;Lst.exports.fastUri=Car});var uGn=I(bar=>{"use strict";p();Object.defineProperty(bar,"__esModule",{value:!0});var lGn=cGn();lGn.code='require("ajv/dist/runtime/uri").default';bar.default=lGn});var yGn=I(MA=>{"use strict";p();Object.defineProperty(MA,"__esModule",{value:!0});MA.CodeGen=MA.Name=MA.nil=MA.stringify=MA.str=MA._=MA.KeywordCxt=void 0;var f8s=qPe();Object.defineProperty(MA,"KeywordCxt",{enumerable:!0,get:a(function(){return f8s.KeywordCxt},"get")});var Xfe=hs();Object.defineProperty(MA,"_",{enumerable:!0,get:a(function(){return Xfe._},"get")});Object.defineProperty(MA,"str",{enumerable:!0,get:a(function(){return Xfe.str},"get")});Object.defineProperty(MA,"stringify",{enumerable:!0,get:a(function(){return Xfe.stringify},"get")});Object.defineProperty(MA,"nil",{enumerable:!0,get:a(function(){return Xfe.nil},"get")});Object.defineProperty(MA,"Name",{enumerable:!0,get:a(function(){return Xfe.Name},"get")});Object.defineProperty(MA,"CodeGen",{enumerable:!0,get:a(function(){return Xfe.CodeGen},"get")});var p8s=Dst(),mGn=jPe(),h8s=Ksr(),GPe=Mst(),m8s=hs(),$Pe=FPe(),Fst=LPe(),Tar=za(),dGn=$Hn(),g8s=uGn(),gGn=a((t,e)=>new RegExp(t,e),"defaultRegExp");gGn.code="new RegExp";var A8s=["removeAdditional","useDefaults","coerceTypes"],y8s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E8s={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_8s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},fGn=200;function C8s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,k,D;let N=t.strict,L=(e=t.code)===null||e===void 0?void 0:e.optimize,B=L===!0||L===void 0?1:L||0,Q=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:gGn,M=(o=t.uriResolver)!==null&&o!==void 0?o:g8s.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:B,regExp:Q}:{optimize:B,regExp:Q},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:fGn,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:fGn,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(k=t.unicodeRegExp)!==null&&k!==void 0?k:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(C8s,"requiredOptions");var VPe=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...C8s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new m8s.ValueScope({scope:{},prefixes:y8s,es5:r,lines:n}),this.logger=x8s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,h8s.getRules)(),pGn.call(this,E8s,e,"NOT SUPPORTED"),pGn.call(this,_8s,e,"DEPRECATED","warn"),this._metaOpts=T8s.call(this),e.formats&&b8s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S8s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),v8s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=dGn;n==="id"&&(o={...dGn},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof mGn.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,$Pe.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=hGn.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new GPe.SchemaEnv({schema:{},schemaId:n});if(r=GPe.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=hGn.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,$Pe.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(R8s.call(this,n,r),!r)return(0,Tar.eachItem)(n,s=>Sar.call(this,s)),this;P8s.call(this,r);let o={...r,type:(0,Fst.getJSONTypes)(r.type),schemaType:(0,Fst.getJSONTypes)(r.schemaType)};return(0,Tar.eachItem)(n,o.type.length===0?s=>Sar.call(this,s,o):s=>o.type.forEach(c=>Sar.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=AGn(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,$Pe.normalizeId)(c||n);let d=$Pe.getSchemaRefs.call(this,e,n);return u=new GPe.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):GPe.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{GPe.compileSchema.call(this,e)}finally{this.opts=r}}};VPe.ValidationError=p8s.default;VPe.MissingRefError=mGn.default;MA.default=VPe;function pGn(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(pGn,"checkOptions");function hGn(t){return t=(0,$Pe.normalizeId)(t),this.schemas[t]||this.refs[t]}a(hGn,"getSchEnv");function v8s(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(v8s,"addInitialSchemas");function b8s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(b8s,"addInitialFormats");function S8s(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(S8s,"addInitialKeywords");function T8s(){let t={...this.opts};for(let e of A8s)delete t[e];return t}a(T8s,"getMetaSchemaOptions");var I8s={log(){},warn(){},error(){}};function x8s(t){if(t===!1)return I8s;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(x8s,"getLogger");var w8s=/^[a-z_$][a-z0-9_$:-]*$/i;function R8s(t,e){let{RULES:r}=this;if((0,Tar.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!w8s.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(R8s,"checkKeyword");function Sar(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,Fst.getJSONTypes)(e.type),schemaType:(0,Fst.getJSONTypes)(e.schemaType)}};e.before?k8s.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(Sar,"addRule");function k8s(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(k8s,"addBeforeRule");function P8s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=AGn(e)),t.validateSchema=this.compile(e,!0))}a(P8s,"keywordMetaschema");var D8s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AGn(t){return{anyOf:[t,D8s]}}a(AGn,"schemaOrData")});var EGn=I(Iar=>{"use strict";p();Object.defineProperty(Iar,"__esModule",{value:!0});var N8s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Iar.default=N8s});var bGn=I(MZ=>{"use strict";p();Object.defineProperty(MZ,"__esModule",{value:!0});MZ.callRef=MZ.getValidate=void 0;var M8s=jPe(),_Gn=ww(),ub=hs(),epe=NF(),CGn=Mst(),Ust=za(),O8s={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=CGn.resolveRef.call(u,d,o,r);if(f===void 0)throw new M8s.default(n.opts.uriResolver,o,r);if(f instanceof CGn.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return Qst(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return Qst(t,(0,ub._)`${A}.validate`,d,d.$async)}function m(A){let y=vGn(t,A);Qst(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,ub.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:ub.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function vGn(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ub._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(vGn,"getValidate");MZ.getValidate=vGn;function Qst(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?epe.default.this:ub.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,ub._)`await ${(0,_Gn.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,ub._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,_Gn.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,ub._)`${A}.errors`;o.assign(epe.default.vErrors,(0,ub._)`${epe.default.vErrors} === null ? ${y} : ${epe.default.vErrors}.concat(${y})`),o.assign(epe.default.errors,(0,ub._)`${epe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=Ust.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,ub._)`${A}.evaluated.props`);s.props=Ust.mergeEvaluated.props(o,_,s.props,ub.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Ust.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,ub._)`${A}.evaluated.items`);s.items=Ust.mergeEvaluated.items(o,_,s.items,ub.Name)}}a(g,"addEvaluatedFrom")}a(Qst,"callRef");MZ.callRef=Qst;MZ.default=O8s});var SGn=I(xar=>{"use strict";p();Object.defineProperty(xar,"__esModule",{value:!0});var B8s=EGn(),L8s=bGn(),F8s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",B8s.default,L8s.default];xar.default=F8s});var TGn=I(war=>{"use strict";p();Object.defineProperty(war,"__esModule",{value:!0});var qst=hs(),Gj=qst.operators,jst={maximum:{okStr:"<=",ok:Gj.LTE,fail:Gj.GT},minimum:{okStr:">=",ok:Gj.GTE,fail:Gj.LT},exclusiveMaximum:{okStr:"<",ok:Gj.LT,fail:Gj.GTE},exclusiveMinimum:{okStr:">",ok:Gj.GT,fail:Gj.LTE}},U8s={message:a(({keyword:t,schemaCode:e})=>(0,qst.str)`must be ${jst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,qst._)`{comparison: ${jst[t].okStr}, limit: ${e}}`,"params")},Q8s={keyword:Object.keys(jst),type:"number",schemaType:"number",$data:!0,error:U8s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,qst._)`${r} ${jst[e].fail} ${n} || isNaN(${r})`)}};war.default=Q8s});var IGn=I(Rar=>{"use strict";p();Object.defineProperty(Rar,"__esModule",{value:!0});var WPe=hs(),q8s={message:a(({schemaCode:t})=>(0,WPe.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,WPe._)`{multipleOf: ${t}}`,"params")},j8s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:q8s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,WPe._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,WPe._)`${c} !== parseInt(${c})`;t.fail$data((0,WPe._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};Rar.default=j8s});var wGn=I(kar=>{"use strict";p();Object.defineProperty(kar,"__esModule",{value:!0});function xGn(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(Par,"__esModule",{value:!0});var OZ=hs(),H8s=za(),G8s=wGn(),$8s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,OZ.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,OZ._)`{limit: ${t}}`,"params")},V8s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:$8s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?OZ.operators.GT:OZ.operators.LT,c=o.opts.unicode===!1?(0,OZ._)`${r}.length`:(0,OZ._)`${(0,H8s.useFunc)(t.gen,G8s.default)}(${r})`;t.fail$data((0,OZ._)`${c} ${s} ${n}`)}};Par.default=V8s});var kGn=I(Dar=>{"use strict";p();Object.defineProperty(Dar,"__esModule",{value:!0});var W8s=ww(),z8s=za(),tpe=hs(),Y8s={message:a(({schemaCode:t})=>(0,tpe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,tpe._)`{pattern: ${t}}`,"params")},K8s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Y8s,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,tpe._)`new RegExp`:(0,z8s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,tpe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,tpe._)`!${f}`)}else{let u=(0,W8s.usePattern)(t,o);t.fail$data((0,tpe._)`!${u}.test(${r})`)}}};Dar.default=K8s});var PGn=I(Nar=>{"use strict";p();Object.defineProperty(Nar,"__esModule",{value:!0});var zPe=hs(),J8s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,zPe.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,zPe._)`{limit: ${t}}`,"params")},Z8s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:J8s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?zPe.operators.GT:zPe.operators.LT;t.fail$data((0,zPe._)`Object.keys(${r}).length ${o} ${n}`)}};Nar.default=Z8s});var DGn=I(Mar=>{"use strict";p();Object.defineProperty(Mar,"__esModule",{value:!0});var YPe=ww(),KPe=hs(),X8s=za(),e6s={message:a(({params:{missingProperty:t}})=>(0,KPe.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,KPe._)`{missingProperty: ${t}}`,"params")},t6s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:e6s,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,X8s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(KPe.nil,h);else for(let g of r)(0,YPe.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,YPe.checkMissingProp)(t,r,g)),(0,YPe.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,YPe.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,YPe.propertyInData)(e,o,g,l.ownProperties)),e.if((0,KPe.not)(A),()=>{t.error(),e.break()})},KPe.nil)}a(m,"loopUntilMissing")}};Mar.default=t6s});var NGn=I(Oar=>{"use strict";p();Object.defineProperty(Oar,"__esModule",{value:!0});var JPe=hs(),r6s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,JPe.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,JPe._)`{limit: ${t}}`,"params")},n6s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r6s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?JPe.operators.GT:JPe.operators.LT;t.fail$data((0,JPe._)`${r}.length ${o} ${n}`)}};Oar.default=n6s});var Hst=I(Bar=>{"use strict";p();Object.defineProperty(Bar,"__esModule",{value:!0});var MGn=iar();MGn.code='require("ajv/dist/runtime/equal").default';Bar.default=MGn});var OGn=I(Far=>{"use strict";p();Object.defineProperty(Far,"__esModule",{value:!0});var Lar=LPe(),OA=hs(),i6s=za(),o6s=Hst(),s6s={message:a(({params:{i:t,j:e}})=>(0,OA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,OA._)`{i: ${t}, j: ${e}}`,"params")},a6s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s6s,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,Lar.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,OA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,OA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,OA._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let E=e.name("item"),_=(0,Lar.checkDataTypes)(d,E,l.opts.strictNumbers,Lar.DataType.Wrong),v=e.const("indices",(0,OA._)`{}`);e.for((0,OA._)`;${A}--;`,()=>{e.let(E,(0,OA._)`${r}[${A}]`),e.if(_,(0,OA._)`continue`),d.length>1&&e.if((0,OA._)`typeof ${E} == "string"`,(0,OA._)`${E} += "_"`),e.if((0,OA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,OA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,OA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,i6s.useFunc)(e,o6s.default),_=e.name("outer");e.label(_).for((0,OA._)`;${A}--;`,()=>e.for((0,OA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,OA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};Far.default=a6s});var BGn=I(Qar=>{"use strict";p();Object.defineProperty(Qar,"__esModule",{value:!0});var Uar=hs(),c6s=za(),l6s=Hst(),u6s={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,Uar._)`{allowedValue: ${t}}`,"params")},d6s={keyword:"const",$data:!0,error:u6s,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Uar._)`!${(0,c6s.useFunc)(e,l6s.default)}(${r}, ${o})`):t.fail((0,Uar._)`${s} !== ${r}`)}};Qar.default=d6s});var LGn=I(qar=>{"use strict";p();Object.defineProperty(qar,"__esModule",{value:!0});var ZPe=hs(),f6s=za(),p6s=Hst(),h6s={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,ZPe._)`{allowedValues: ${t}}`,"params")},m6s={keyword:"enum",schemaType:"array",$data:!0,error:h6s,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,f6s.useFunc)(e,p6s.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,ZPe.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,ZPe._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,ZPe._)`${d()}(${r}, ${g}[${A}])`:(0,ZPe._)`${r} === ${y}`}a(m,"equalCode")}};qar.default=m6s});var FGn=I(jar=>{"use strict";p();Object.defineProperty(jar,"__esModule",{value:!0});var g6s=TGn(),A6s=IGn(),y6s=RGn(),E6s=kGn(),_6s=PGn(),C6s=DGn(),v6s=NGn(),b6s=OGn(),S6s=BGn(),T6s=LGn(),I6s=[g6s.default,A6s.default,y6s.default,E6s.default,_6s.default,C6s.default,v6s.default,b6s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},S6s.default,T6s.default];jar.default=I6s});var Gar=I(XPe=>{"use strict";p();Object.defineProperty(XPe,"__esModule",{value:!0});XPe.validateAdditionalItems=void 0;var BZ=hs(),Har=za(),x6s={message:a(({params:{len:t}})=>(0,BZ.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,BZ._)`{limit: ${t}}`,"params")},w6s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:x6s,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Har.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}UGn(t,n)}};function UGn(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,BZ._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,BZ._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Har.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,BZ._)`${l} <= ${e.length}`);r.if((0,BZ.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Har.Type.Num},d),c.allErrors||r.if((0,BZ.not)(d),()=>r.break())})}a(u,"validateItems")}a(UGn,"validateAdditionalItems");XPe.validateAdditionalItems=UGn;XPe.default=w6s});var $ar=I(e2e=>{"use strict";p();Object.defineProperty(e2e,"__esModule",{value:!0});e2e.validateTuple=void 0;var QGn=hs(),Gst=za(),R6s=ww(),k6s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return qGn(t,"additionalItems",e);r.items=!0,!(0,Gst.alwaysValidSchema)(r,e)&&t.ok((0,R6s.validateArray)(t))}};function qGn(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Gst.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,QGn._)`${s}.length`);r.forEach((h,m)=>{(0,Gst.alwaysValidSchema)(l,h)||(n.if((0,QGn._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,Gst.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(qGn,"validateTuple");e2e.validateTuple=qGn;e2e.default=k6s});var jGn=I(Var=>{"use strict";p();Object.defineProperty(Var,"__esModule",{value:!0});var P6s=$ar(),D6s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,P6s.validateTuple)(t,"items"),"code")};Var.default=D6s});var GGn=I(War=>{"use strict";p();Object.defineProperty(War,"__esModule",{value:!0});var HGn=hs(),N6s=za(),M6s=ww(),O6s=Gar(),B6s={message:a(({params:{len:t}})=>(0,HGn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,HGn._)`{limit: ${t}}`,"params")},L6s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:B6s,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,N6s.alwaysValidSchema)(n,e)&&(o?(0,O6s.validateAdditionalItems)(t,o):t.ok((0,M6s.validateArray)(t)))}};War.default=L6s});var $Gn=I(zar=>{"use strict";p();Object.defineProperty(zar,"__esModule",{value:!0});var kw=hs(),$st=za(),F6s={message:a(({params:{min:t,max:e}})=>e===void 0?(0,kw.str)`must contain at least ${t} valid item(s)`:(0,kw.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,kw._)`{minContains: ${t}}`:(0,kw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},U6s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:F6s,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,kw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,$st.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,$st.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,$st.alwaysValidSchema)(s,r)){let y=(0,kw._)`${f} >= ${c}`;l!==void 0&&(y=(0,kw._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,kw._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:$st.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,kw._)`${y}++`),l===void 0?e.if((0,kw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,kw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,kw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};zar.default=U6s});var zGn=I(g5=>{"use strict";p();Object.defineProperty(g5,"__esModule",{value:!0});g5.validateSchemaDeps=g5.validatePropertyDeps=g5.error=void 0;var Yar=hs(),Q6s=za(),t2e=ww();g5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Yar.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Yar._)`{property: ${t}, +${s}`:o.stack}a(Xqn,"appendFetchStackTrace");An.exports.fetch=a(function(e,r=void 0){return _Os(e,r).catch(n=>{throw Yqn?Xqn(n,Yqn):n&&typeof n=="object"&&Error.captureStackTrace(n,An.exports.fetch),n})},"fetch");An.exports.Headers=ZJ().Headers;An.exports.Response=wPe().Response;An.exports.Request=bfe().Request;An.exports.FormData=fit().FormData;var{setGlobalOrigin:vOs,getGlobalOrigin:COs}=_rr();An.exports.setGlobalOrigin=vOs;An.exports.getGlobalOrigin=COs;var{CacheStorage:bOs}=NQn(),{kConstruct:SOs}=tl();An.exports.caches=new bOs(SOs);var{deleteCookie:TOs,getCookies:IOs,getSetCookies:xOs,setCookie:wOs,parseCookie:ROs}=VQn();An.exports.deleteCookie=TOs;An.exports.getCookies=IOs;An.exports.getSetCookies=xOs;An.exports.setCookie=wOs;An.exports.parseCookie=ROs;var{parseMIMEType:POs,serializeAMimeType:kOs}=fw();An.exports.parseMIMEType=POs;An.exports.serializeAMimeType=kOs;var{CloseEvent:DOs,ErrorEvent:NOs,MessageEvent:MOs}=Pot(),{WebSocket:OOs,ping:BOs}=Iqn();An.exports.WebSocket=OOs;An.exports.CloseEvent=DOs;An.exports.ErrorEvent=NOs;An.exports.MessageEvent=MOs;An.exports.ping=BOs;An.exports.WebSocketStream=Mqn().WebSocketStream;An.exports.WebSocketError=For().WebSocketError;An.exports.request=QPe(Mfe.request);An.exports.stream=QPe(Mfe.stream);An.exports.pipeline=QPe(Mfe.pipeline);An.exports.connect=QPe(Mfe.connect);An.exports.upgrade=QPe(Mfe.upgrade);An.exports.MockClient=cOs;An.exports.MockCallHistory=lOs;An.exports.MockCallHistoryLog=uOs;An.exports.MockPool=fOs;An.exports.MockAgent=dOs;An.exports.SnapshotAgent=pOs;An.exports.mockErrors=hOs;var{EventSource:LOs}=zqn();An.exports.EventSource=LOs;function FOs(){globalThis.fetch=An.exports.fetch,globalThis.Headers=An.exports.Headers,globalThis.Response=An.exports.Response,globalThis.Request=An.exports.Request,globalThis.FormData=An.exports.FormData,globalThis.WebSocket=An.exports.WebSocket,globalThis.CloseEvent=An.exports.CloseEvent,globalThis.ErrorEvent=An.exports.ErrorEvent,globalThis.MessageEvent=An.exports.MessageEvent,globalThis.EventSource=An.exports.EventSource}a(FOs,"install");An.exports.install=FOs});var hjn,mjn=_e(()=>{p();hjn=typeof globalThis=="object"?globalThis:global});var gjn=_e(()=>{p();mjn()});var Ajn=_e(()=>{p();gjn()});var _F,nsr=_e(()=>{p();_F="1.9.0"});function c5s(t){var e=new Set([t]),r=new Set,n=t.match(yjn);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(yjn);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var yjn,Ejn,_jn=_e(()=>{p();nsr();yjn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(c5s,"_makeCompatibilityCheck");Ejn=c5s(_F)});function c5(t,e,r,n){var o;n===void 0&&(n=!1);var s=HPe[jPe]=(o=HPe[jPe])!==null&&o!==void 0?o:{version:_F};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==_F){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+_F);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+_F+"."),!0}function uT(t){var e,r,n=(e=HPe[jPe])===null||e===void 0?void 0:e.version;if(!(!n||!Ejn(n)))return(r=HPe[jPe])===null||r===void 0?void 0:r[t]}function l5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+_F+".");var r=HPe[jPe];r&&delete r[t]}var l5s,jPe,HPe,aZ=_e(()=>{p();Ajn();nsr();_jn();l5s=_F.split(".")[0],jPe=Symbol.for("opentelemetry.js.api."+l5s),HPe=hjn;a(c5,"registerGlobal");a(uT,"getGlobal");a(l5,"unregisterGlobal")});function GPe(t,e,r){var n=uT("diag");if(n)return r.unshift(e),n[t].apply(n,d5s([],u5s(r),!1))}var u5s,d5s,vjn,Cjn=_e(()=>{p();aZ();u5s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},d5s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(wa||(wa={}))});function bjn(t,e){twa.ALL&&(t=wa.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",wa.ERROR),warn:r("warn",wa.WARN),info:r("info",wa.INFO),debug:r("debug",wa.DEBUG),verbose:r("verbose",wa.VERBOSE)}}var Sjn=_e(()=>{p();Kot();a(bjn,"createLogLevelDiagLogger")});var f5s,p5s,h5s,cE,cZ=_e(()=>{p();Cjn();Sjn();Kot();aZ();f5s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},p5s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return c5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){l5(h5s,r)},r.createComponentLogger=function(o){return new vjn(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var m5s,g5s,Tjn,Ijn=_e(()=>{p();m5s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},g5s=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tjn=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=m5s(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();xjn=Symbol("BaggageEntryMetadata")});function Rjn(t){return t===void 0&&(t={}),new Tjn(new Map(Object.entries(t)))}function Bfe(t){return typeof t!="string"&&(A5s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:xjn,toString:a(function(){return t},"toString")}}var A5s,isr=_e(()=>{p();cZ();Ijn();wjn();A5s=cE.instance();a(Rjn,"createBaggage");a(Bfe,"baggageEntryMetadataFromString")});function rb(t){return Symbol.for(t)}var y5s,Jot,$Pe=_e(()=>{p();a(rb,"createContextKey");y5s=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),Jot=new y5s});var osr,Pjn,kjn=_e(()=>{p();osr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],Pjn=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();lZ=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),E5s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return w5s},t.prototype.createHistogram=function(e,r){return R5s},t.prototype.createCounter=function(e,r){return x5s},t.prototype.createUpDownCounter=function(e,r){return P5s},t.prototype.createObservableGauge=function(e,r){return D5s},t.prototype.createObservableCounter=function(e,r){return k5s},t.prototype.createObservableUpDownCounter=function(e,r){return N5s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Zot=(function(){function t(){}return a(t,"NoopMetric"),t})(),_5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Zot),v5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Zot),C5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Zot),b5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Zot),ssr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),S5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(ssr),T5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(ssr),I5s=(function(t){lZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(ssr),asr=new E5s,x5s=new _5s,w5s=new C5s,R5s=new b5s,P5s=new v5s,k5s=new S5s,D5s=new T5s,N5s=new I5s;a(Djn,"createNoopMeter")});var Xot,Njn=_e(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Xot||(Xot={}))});var est,tst,lsr=_e(()=>{p();est={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},tst={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var M5s,O5s,Mjn,Ojn=_e(()=>{p();$Pe();M5s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},O5s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();Ojn();aZ();cZ();B5s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},L5s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(Af||(Af={}))});var WPe,zPe,Lfe,rst=_e(()=>{p();dsr();WPe="0000000000000000",zPe="00000000000000000000000000000000",Lfe={traceId:zPe,spanId:WPe,traceFlags:Af.NONE}});var xj,nst=_e(()=>{p();rst();xj=(function(){function t(e){e===void 0&&(e=Lfe),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function ist(t){return t.getValue(fsr)||void 0}function Bjn(){return ist(Ij.getInstance().active())}function YPe(t,e){return t.setValue(fsr,e)}function Ljn(t){return t.deleteValue(fsr)}function Fjn(t,e){return YPe(t,new xj(e))}function ost(t){var e;return(e=ist(t))===null||e===void 0?void 0:e.spanContext()}var fsr,psr=_e(()=>{p();$Pe();nst();VPe();fsr=rb("OpenTelemetry Context Key SPAN");a(ist,"getSpan");a(Bjn,"getActiveSpan");a(YPe,"setSpan");a(Ljn,"deleteSpan");a(Fjn,"setSpanContext");a(ost,"getSpanContext")});function uZ(t){return U5s.test(t)&&t!==zPe}function hsr(t){return Q5s.test(t)&&t!==WPe}function nb(t){return uZ(t.traceId)&&hsr(t.spanId)}function Ujn(t){return new xj(t)}var U5s,Q5s,sst=_e(()=>{p();rst();nst();U5s=/^([0-9a-f]{32})$/i,Q5s=/^[0-9a-f]{16}$/i;a(uZ,"isValidTraceId");a(hsr,"isValidSpanId");a(nb,"isSpanContextValid");a(Ujn,"wrapSpanContext")});function q5s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var msr,ast,gsr=_e(()=>{p();VPe();psr();nst();sst();msr=Ij.getInstance(),ast=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=msr.active());var o=!!r?.root;if(o)return new xj;var s=n&&ost(n);return q5s(s)&&nb(s)?new xj(s):new xj},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??msr.active(),d=this.startSpan(e,s,u),f=YPe(u,d);return msr.with(f,l,void 0,d)}},t})();a(q5s,"isSpanContext")});var j5s,cst,Asr=_e(()=>{p();gsr();j5s=new ast,cst=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):j5s},t})()});var Qjn,qjn=_e(()=>{p();gsr();Qjn=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new ast},t})()});var H5s,KPe,ysr=_e(()=>{p();Asr();qjn();H5s=new Qjn,KPe=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new cst(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:H5s},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var ib,jjn=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(ib||(ib={}))});var Ffe,Hjn=_e(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(Ffe||(Ffe={}))});var Ufe,Gjn=_e(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Ufe||(Ufe={}))});function $jn(t){return V5s.test(t)}function Vjn(t){return W5s.test(t)&&!z5s.test(t)}var Esr,G5s,$5s,V5s,W5s,z5s,Wjn=_e(()=>{p();Esr="[_0-9a-z-*/]",G5s="[a-z]"+Esr+"{0,255}",$5s="[a-z0-9]"+Esr+"{0,240}@[a-z]"+Esr+"{0,13}",V5s=new RegExp("^(?:"+G5s+"|"+$5s+")$"),W5s=/^[ -~]{0,255}[!-~]$/,z5s=/,|=/;a($jn,"validateKey");a(Vjn,"validateValue")});var zjn,Y5s,Yjn,Kjn,Jjn,Zjn=_e(()=>{p();Wjn();zjn=32,Y5s=512,Yjn=",",Kjn="=",Jjn=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Kjn+e.get(n)),r},[]).join(Yjn)},t.prototype._parse=function(e){e.length>Y5s||(this._internalState=e.split(Yjn).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Kjn);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);$jn(c)&&Vjn(l)&&r.set(c,l)}return r},new Map),this._internalState.size>zjn&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,zjn))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function Xjn(t){return new Jjn(t)}var eHn=_e(()=>{p();Zjn();a(Xjn,"createTraceState")});var Eg,tHn=_e(()=>{p();VPe();Eg=Ij.getInstance()});var Pn,rHn=_e(()=>{p();cZ();Pn=cE.instance()});var K5s,nHn,iHn=_e(()=>{p();csr();K5s=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return asr},t})(),nHn=new K5s});var _sr,oHn,sHn=_e(()=>{p();iHn();aZ();cZ();_sr="metrics",oHn=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return c5(_sr,e,cE.instance())},t.prototype.getMeterProvider=function(){return uT(_sr)||nHn},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){l5(_sr,cE.instance())},t})()});var dZ,aHn=_e(()=>{p();sHn();dZ=oHn.getInstance()});var cHn,lHn=_e(()=>{p();cHn=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function Csr(t){return t.getValue(vsr)||void 0}function uHn(){return Csr(Ij.getInstance().active())}function dHn(t,e){return t.setValue(vsr,e)}function fHn(t){return t.deleteValue(vsr)}var vsr,pHn=_e(()=>{p();VPe();$Pe();vsr=rb("OpenTelemetry Baggage Key");a(Csr,"getBaggage");a(uHn,"getActiveBaggage");a(dHn,"setBaggage");a(fHn,"deleteBaggage")});var bsr,J5s,hHn,mHn=_e(()=>{p();aZ();lHn();lsr();pHn();isr();cZ();bsr="propagation",J5s=new cHn,hHn=(function(){function t(){this.createBaggage=Rjn,this.getBaggage=Csr,this.getActiveBaggage=uHn,this.setBaggage=dHn,this.deleteBaggage=fHn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return c5(bsr,e,cE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=tst),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=est),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){l5(bsr,cE.instance())},t.prototype._getGlobalPropagator=function(){return uT(bsr)||J5s},t})()});var dT,gHn=_e(()=>{p();mHn();dT=hHn.getInstance()});var Ssr,AHn,yHn=_e(()=>{p();aZ();ysr();sst();psr();cZ();Ssr="trace",AHn=(function(){function t(){this._proxyTracerProvider=new KPe,this.wrapSpanContext=Ujn,this.isSpanContextValid=nb,this.deleteSpan=Ljn,this.getSpan=ist,this.getActiveSpan=Bjn,this.getSpanContext=ost,this.setSpan=YPe,this.setSpanContext=Fjn}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=c5(Ssr,this._proxyTracerProvider,cE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return uT(Ssr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){l5(Ssr,cE.instance()),this._proxyTracerProvider=new KPe},t})()});var _u,EHn=_e(()=>{p();yHn();_u=AHn.getInstance()});var u5={};xi(u5,{DiagConsoleLogger:()=>Pjn,DiagLogLevel:()=>wa,INVALID_SPANID:()=>WPe,INVALID_SPAN_CONTEXT:()=>Lfe,INVALID_TRACEID:()=>zPe,ProxyTracer:()=>cst,ProxyTracerProvider:()=>KPe,ROOT_CONTEXT:()=>Jot,SamplingDecision:()=>ib,SpanKind:()=>Ffe,SpanStatusCode:()=>Ufe,TraceFlags:()=>Af,ValueType:()=>Xot,baggageEntryMetadataFromString:()=>Bfe,context:()=>Eg,createContextKey:()=>rb,createNoopMeter:()=>Djn,createTraceState:()=>Xjn,default:()=>Z5s,defaultTextMapGetter:()=>est,defaultTextMapSetter:()=>tst,diag:()=>Pn,isSpanContextValid:()=>nb,isValidSpanId:()=>hsr,isValidTraceId:()=>uZ,metrics:()=>dZ,propagation:()=>dT,trace:()=>_u});var Z5s,co=_e(()=>{p();isr();$Pe();kjn();Kot();csr();Njn();lsr();Asr();ysr();jjn();Hjn();Gjn();dsr();eHn();sst();rst();tHn();rHn();aHn();gHn();EHn();Z5s={context:Eg,diag:Pn,metrics:dZ,propagation:dT,trace:_u}});var xke=I(oc=>{"use strict";p();Object.defineProperty(oc,"__esModule",{value:!0});oc.regexpCode=oc.getEsmExportName=oc.getProperty=oc.safeStringify=oc.stringify=oc.strConcat=oc.addCodeArg=oc.str=oc._=oc.nil=oc._Code=oc.Name=oc.IDENTIFIER=oc._CodeOrName=void 0;var Tke=class{static{a(this,"_CodeOrName")}};oc._CodeOrName=Tke;oc.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var vZ=class extends Tke{static{a(this,"Name")}constructor(e){if(super(),!oc.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};oc.Name=vZ;var Iw=class extends Tke{static{a(this,"_Code")}constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof vZ&&(r[n.str]=(r[n.str]||0)+1),r),{})}};oc._Code=Iw;oc.nil=new Iw("");function aGn(t,...e){let r=[t[0]],n=0;for(;n{"use strict";p();Object.defineProperty(sb,"__esModule",{value:!0});sb.ValueScope=sb.ValueScopeName=sb.Scope=sb.varKinds=sb.UsedValueState=void 0;var ob=xke(),aar=class extends Error{static{a(this,"ValueError")}constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},xst;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(xst||(sb.UsedValueState=xst={}));sb.varKinds={const:new ob.Name("const"),let:new ob.Name("let"),var:new ob.Name("var")};var wst=class{static{a(this,"Scope")}constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ob.Name?e:this.name(e)}name(e){return new ob.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};sb.Scope=wst;var Rst=class extends ob.Name{static{a(this,"ValueScopeName")}constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ob._)`.${new ob.Name(r)}[${n}]`}};sb.ValueScopeName=Rst;var dLs=(0,ob._)`\n`,car=class extends wst{static{a(this,"ValueScope")}constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?dLs:ob.nil}}get(){return this._scope}name(e){return new Rst(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,c=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let f=l.get(c);if(f)return f}else l=this._values[s]=new Map;l.set(c,o);let u=this._scope[s]||(this._scope[s]=[]),d=u.length;return u[d]=r.ref,o.setValue(r,{property:s,itemIndex:d}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ob._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=ob.nil;for(let c in e){let l=e[c];if(!l)continue;let u=n[c]=n[c]||new Map;l.forEach(d=>{if(u.has(d))return;u.set(d,xst.Started);let f=r(d);if(f){let h=this.opts.es5?sb.varKinds.var:sb.varKinds.const;s=(0,ob._)`${s}${h} ${d} = ${f};${this.opts._n}`}else if(f=o?.(d))s=(0,ob._)`${s}${f}${this.opts._n}`;else throw new aar(d);u.set(d,xst.Completed)})}return s}};sb.ValueScope=car});var ps=I(Ts=>{"use strict";p();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.or=Ts.and=Ts.not=Ts.CodeGen=Ts.operators=Ts.varKinds=Ts.ValueScopeName=Ts.ValueScope=Ts.Scope=Ts.Name=Ts.regexpCode=Ts.stringify=Ts.getProperty=Ts.nil=Ts.strConcat=Ts.str=Ts._=void 0;var Ra=xke(),r2=lar(),Mj=xke();Object.defineProperty(Ts,"_",{enumerable:!0,get:a(function(){return Mj._},"get")});Object.defineProperty(Ts,"str",{enumerable:!0,get:a(function(){return Mj.str},"get")});Object.defineProperty(Ts,"strConcat",{enumerable:!0,get:a(function(){return Mj.strConcat},"get")});Object.defineProperty(Ts,"nil",{enumerable:!0,get:a(function(){return Mj.nil},"get")});Object.defineProperty(Ts,"getProperty",{enumerable:!0,get:a(function(){return Mj.getProperty},"get")});Object.defineProperty(Ts,"stringify",{enumerable:!0,get:a(function(){return Mj.stringify},"get")});Object.defineProperty(Ts,"regexpCode",{enumerable:!0,get:a(function(){return Mj.regexpCode},"get")});Object.defineProperty(Ts,"Name",{enumerable:!0,get:a(function(){return Mj.Name},"get")});var Nst=lar();Object.defineProperty(Ts,"Scope",{enumerable:!0,get:a(function(){return Nst.Scope},"get")});Object.defineProperty(Ts,"ValueScope",{enumerable:!0,get:a(function(){return Nst.ValueScope},"get")});Object.defineProperty(Ts,"ValueScopeName",{enumerable:!0,get:a(function(){return Nst.ValueScopeName},"get")});Object.defineProperty(Ts,"varKinds",{enumerable:!0,get:a(function(){return Nst.varKinds},"get")});Ts.operators={GT:new Ra._Code(">"),GTE:new Ra._Code(">="),LT:new Ra._Code("<"),LTE:new Ra._Code("<="),EQ:new Ra._Code("==="),NEQ:new Ra._Code("!=="),NOT:new Ra._Code("!"),OR:new Ra._Code("||"),AND:new Ra._Code("&&"),ADD:new Ra._Code("+")};var xF=class{static{a(this,"Node")}optimizeNodes(){return this}optimizeNames(e,r){return this}},uar=class extends xF{static{a(this,"Def")}constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?r2.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=$fe(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ra._CodeOrName?this.rhs.names:{}}},Pst=class extends xF{static{a(this,"Assign")}constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ra.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=$fe(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ra.Name?{}:{...this.lhs.names};return Dst(e,this.rhs)}},dar=class extends Pst{static{a(this,"AssignOp")}constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},far=class extends xF{static{a(this,"Label")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},par=class extends xF{static{a(this,"Break")}constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},har=class extends xF{static{a(this,"Throw")}constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},mar=class extends xF{static{a(this,"AnyCode")}constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=$fe(this.code,e,r),this}get names(){return this.code instanceof Ra._CodeOrName?this.code.names:{}}},wke=class extends xF{static{a(this,"ParentNode")}constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(fLs(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>SZ(e,r.names),{})}},wF=class extends wke{static{a(this,"BlockNode")}render(e){return"{"+e._n+super.render(e)+"}"+e._n}},gar=class extends wke{static{a(this,"Root")}},Gfe=class extends wF{static{a(this,"Else")}};Gfe.kind="else";var CZ=class t extends wF{static{a(this,"If")}constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Gfe(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lGn(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=$fe(this.condition,e,r),this}get names(){let e=super.names;return Dst(e,this.condition),this.else&&SZ(e,this.else.names),e}};CZ.kind="if";var bZ=class extends wF{static{a(this,"For")}};bZ.kind="for";var Aar=class extends bZ{static{a(this,"ForLoop")}constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=$fe(this.iteration,e,r),this}get names(){return SZ(super.names,this.iteration.names)}},yar=class extends bZ{static{a(this,"ForRange")}constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?r2.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Dst(super.names,this.from);return Dst(e,this.to)}},kst=class extends bZ{static{a(this,"ForIter")}constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=$fe(this.iterable,e,r),this}get names(){return SZ(super.names,this.iterable.names)}},Rke=class extends wF{static{a(this,"Func")}constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Rke.kind="func";var Pke=class extends wke{static{a(this,"Return")}render(e){return"return "+super.render(e)}};Pke.kind="return";var Ear=class extends wF{static{a(this,"Try")}render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&SZ(e,this.catch.names),this.finally&&SZ(e,this.finally.names),e}},kke=class extends wF{static{a(this,"Catch")}constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};kke.kind="catch";var Dke=class extends wF{static{a(this,"Finally")}render(e){return"finally"+super.render(e)}};Dke.kind="finally";var _ar=class{static{a(this,"CodeGen")}constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?` +`:""},this._extScope=e,this._scope=new r2.Scope({parent:e}),this._nodes=[new gar]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new uar(e,s,n)),s}const(e,r,n){return this._def(r2.varKinds.const,e,r,n)}let(e,r,n){return this._def(r2.varKinds.let,e,r,n)}var(e,r,n){return this._def(r2.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Pst(e,r,n))}add(e,r){return this._leafNode(new dar(e,Ts.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ra.nil&&this._leafNode(new mar(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,Ra.addCodeArg)(r,o));return r.push("}"),new Ra._Code(r)}if(e,r,n){if(this._blockNode(new CZ(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new CZ(e))}else(){return this._elseNode(new Gfe)}endIf(){return this._endBlockNode(CZ,Gfe)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Aar(e),r)}forRange(e,r,n,o,s=this.opts.es5?r2.varKinds.var:r2.varKinds.let){let c=this._scope.toName(e);return this._for(new yar(s,c,r,n),()=>o(c))}forOf(e,r,n,o=r2.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let c=r instanceof Ra.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ra._)`${c}.length`,l=>{this.var(s,(0,Ra._)`${c}[${l}]`),n(s)})}return this._for(new kst("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?r2.varKinds.var:r2.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ra._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new kst("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(bZ)}label(e){return this._leafNode(new far(e))}break(e){return this._leafNode(new par(e))}return(e){let r=new Pke;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Pke)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Ear;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new kke(s),r(s)}return n&&(this._currNode=o.finally=new Dke,this.code(n)),this._endBlockNode(kke,Dke)}throw(e){return this._leafNode(new har(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ra.nil,n,o){return this._blockNode(new Rke(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Rke)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof CZ))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};Ts.CodeGen=_ar;function SZ(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}a(SZ,"addNames");function Dst(t,e){return e instanceof Ra._CodeOrName?SZ(t,e.names):t}a(Dst,"addExprNames");function $fe(t,e,r){if(t instanceof Ra.Name)return n(t);if(!o(t))return t;return new Ra._Code(t._items.reduce((s,c)=>(c instanceof Ra.Name&&(c=n(c)),c instanceof Ra._Code?s.push(...c._items):s.push(c),s),[]));function n(s){let c=r[s.str];return c===void 0||e[s.str]!==1?s:(delete e[s.str],c)}function o(s){return s instanceof Ra._Code&&s._items.some(c=>c instanceof Ra.Name&&e[c.str]===1&&r[c.str]!==void 0)}}a($fe,"optimizeExpr");function fLs(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}a(fLs,"subtractNames");function lGn(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ra._)`!${Car(t)}`}a(lGn,"not");Ts.not=lGn;var pLs=uGn(Ts.operators.AND);function hLs(...t){return t.reduce(pLs)}a(hLs,"and");Ts.and=hLs;var mLs=uGn(Ts.operators.OR);function gLs(...t){return t.reduce(mLs)}a(gLs,"or");Ts.or=gLs;function uGn(t){return(e,r)=>e===Ra.nil?r:r===Ra.nil?e:(0,Ra._)`${Car(e)} ${t} ${Car(r)}`}a(uGn,"mappend");function Car(t){return t instanceof Ra.Name?t:(0,Ra._)`(${t})`}a(Car,"par")});var Wa=I(Bs=>{"use strict";p();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.checkStrictMode=Bs.getErrorPath=Bs.Type=Bs.useFunc=Bs.setEvaluated=Bs.evaluatedPropsToName=Bs.mergeEvaluated=Bs.eachItem=Bs.unescapeJsonPointer=Bs.escapeJsonPointer=Bs.escapeFragment=Bs.unescapeFragment=Bs.schemaRefOrVal=Bs.schemaHasRulesButRef=Bs.schemaHasRules=Bs.checkUnknownRules=Bs.alwaysValidSchema=Bs.toHash=void 0;var ql=ps(),ALs=xke();function yLs(t){let e={};for(let r of t)e[r]=!0;return e}a(yLs,"toHash");Bs.toHash=yLs;function ELs(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(pGn(t,e),!hGn(e,t.self.RULES.all))}a(ELs,"alwaysValidSchema");Bs.alwaysValidSchema=ELs;function pGn(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||AGn(t,`unknown keyword: "${s}"`)}a(pGn,"checkUnknownRules");Bs.checkUnknownRules=pGn;function hGn(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}a(hGn,"schemaHasRules");Bs.schemaHasRules=hGn;function _Ls(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}a(_Ls,"schemaHasRulesButRef");Bs.schemaHasRulesButRef=_Ls;function vLs({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ql._)`${r}`}return(0,ql._)`${t}${e}${(0,ql.getProperty)(n)}`}a(vLs,"schemaRefOrVal");Bs.schemaRefOrVal=vLs;function CLs(t){return mGn(decodeURIComponent(t))}a(CLs,"unescapeFragment");Bs.unescapeFragment=CLs;function bLs(t){return encodeURIComponent(Sar(t))}a(bLs,"escapeFragment");Bs.escapeFragment=bLs;function Sar(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}a(Sar,"escapeJsonPointer");Bs.escapeJsonPointer=Sar;function mGn(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}a(mGn,"unescapeJsonPointer");Bs.unescapeJsonPointer=mGn;function SLs(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}a(SLs,"eachItem");Bs.eachItem=SLs;function dGn({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,c,l)=>{let u=c===void 0?s:c instanceof ql.Name?(s instanceof ql.Name?t(o,s,c):e(o,s,c),c):s instanceof ql.Name?(e(o,c,s),s):r(s,c);return l===ql.Name&&!(u instanceof ql.Name)?n(o,u):u}}a(dGn,"makeMergeEvaluated");Bs.mergeEvaluated={props:dGn({mergeNames:a((t,e,r)=>t.if((0,ql._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ql._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ql._)`${r} || {}`).code((0,ql._)`Object.assign(${r}, ${e})`))}),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,ql._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ql._)`${r} || {}`),Tar(t,r,e))}),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:{...t,...e},"mergeValues"),resultToName:gGn}),items:dGn({mergeNames:a((t,e,r)=>t.if((0,ql._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ql._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),"mergeNames"),mergeToName:a((t,e,r)=>t.if((0,ql._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ql._)`${r} > ${e} ? ${r} : ${e}`)),"mergeToName"),mergeValues:a((t,e)=>t===!0?!0:Math.max(t,e),"mergeValues"),resultToName:a((t,e)=>t.var("items",e),"resultToName")})};function gGn(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ql._)`{}`);return e!==void 0&&Tar(t,r,e),r}a(gGn,"evaluatedPropsToName");Bs.evaluatedPropsToName=gGn;function Tar(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ql._)`${e}${(0,ql.getProperty)(n)}`,!0))}a(Tar,"setEvaluated");Bs.setEvaluated=Tar;var fGn={};function TLs(t,e){return t.scopeValue("func",{ref:e,code:fGn[e.code]||(fGn[e.code]=new ALs._Code(e.code))})}a(TLs,"useFunc");Bs.useFunc=TLs;var bar;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(bar||(Bs.Type=bar={}));function ILs(t,e,r){if(t instanceof ql.Name){let n=e===bar.Num;return r?n?(0,ql._)`"[" + ${t} + "]"`:(0,ql._)`"['" + ${t} + "']"`:n?(0,ql._)`"/" + ${t}`:(0,ql._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ql.getProperty)(t).toString():"/"+Sar(t)}a(ILs,"getErrorPath");Bs.getErrorPath=ILs;function AGn(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}a(AGn,"checkStrictMode");Bs.checkStrictMode=AGn});var RF=I(Iar=>{"use strict";p();Object.defineProperty(Iar,"__esModule",{value:!0});var lE=ps(),xLs={data:new lE.Name("data"),valCxt:new lE.Name("valCxt"),instancePath:new lE.Name("instancePath"),parentData:new lE.Name("parentData"),parentDataProperty:new lE.Name("parentDataProperty"),rootData:new lE.Name("rootData"),dynamicAnchors:new lE.Name("dynamicAnchors"),vErrors:new lE.Name("vErrors"),errors:new lE.Name("errors"),this:new lE.Name("this"),self:new lE.Name("self"),scope:new lE.Name("scope"),json:new lE.Name("json"),jsonPos:new lE.Name("jsonPos"),jsonLen:new lE.Name("jsonLen"),jsonPart:new lE.Name("jsonPart")};Iar.default=xLs});var Nke=I(uE=>{"use strict";p();Object.defineProperty(uE,"__esModule",{value:!0});uE.extendErrors=uE.resetErrorsCount=uE.reportExtraError=uE.reportError=uE.keyword$DataError=uE.keywordError=void 0;var za=ps(),Mst=Wa(),Y_=RF();uE.keywordError={message:a(({keyword:t})=>(0,za.str)`must pass "${t}" keyword validation`,"message")};uE.keyword$DataError={message:a(({keyword:t,schemaType:e})=>e?(0,za.str)`"${t}" keyword must be ${e} ($data)`:(0,za.str)`"${t}" keyword is invalid ($data)`,"message")};function wLs(t,e=uE.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:c,allErrors:l}=o,u=_Gn(t,e,r);n??(c||l)?yGn(s,u):EGn(o,(0,za._)`[${u}]`)}a(wLs,"reportError");uE.reportError=wLs;function RLs(t,e=uE.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:c}=n,l=_Gn(t,e,r);yGn(o,l),s||c||EGn(n,Y_.default.vErrors)}a(RLs,"reportExtraError");uE.reportExtraError=RLs;function PLs(t,e){t.assign(Y_.default.errors,e),t.if((0,za._)`${Y_.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,za._)`${Y_.default.vErrors}.length`,e),()=>t.assign(Y_.default.vErrors,null)))}a(PLs,"resetErrorsCount");uE.resetErrorsCount=PLs;function kLs({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let c=t.name("err");t.forRange("i",o,Y_.default.errors,l=>{t.const(c,(0,za._)`${Y_.default.vErrors}[${l}]`),t.if((0,za._)`${c}.instancePath === undefined`,()=>t.assign((0,za._)`${c}.instancePath`,(0,za.strConcat)(Y_.default.instancePath,s.errorPath))),t.assign((0,za._)`${c}.schemaPath`,(0,za.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,za._)`${c}.schema`,r),t.assign((0,za._)`${c}.data`,n))})}a(kLs,"extendErrors");uE.extendErrors=kLs;function yGn(t,e){let r=t.const("err",e);t.if((0,za._)`${Y_.default.vErrors} === null`,()=>t.assign(Y_.default.vErrors,(0,za._)`[${r}]`),(0,za._)`${Y_.default.vErrors}.push(${r})`),t.code((0,za._)`${Y_.default.errors}++`)}a(yGn,"addError");function EGn(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,za._)`new ${t.ValidationError}(${e})`):(r.assign((0,za._)`${n}.errors`,e),r.return(!1))}a(EGn,"returnErrors");var TZ={keyword:new za.Name("keyword"),schemaPath:new za.Name("schemaPath"),params:new za.Name("params"),propertyName:new za.Name("propertyName"),message:new za.Name("message"),schema:new za.Name("schema"),parentSchema:new za.Name("parentSchema")};function _Gn(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,za._)`{}`:DLs(t,e,r)}a(_Gn,"errorObjectCode");function DLs(t,e,r={}){let{gen:n,it:o}=t,s=[NLs(o,r),MLs(t,r)];return OLs(t,e,s),n.object(...s)}a(DLs,"errorObject");function NLs({errorPath:t},{instancePath:e}){let r=e?(0,za.str)`${t}${(0,Mst.getErrorPath)(e,Mst.Type.Str)}`:t;return[Y_.default.instancePath,(0,za.strConcat)(Y_.default.instancePath,r)]}a(NLs,"errorInstancePath");function MLs({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,za.str)`${e}/${t}`;return r&&(o=(0,za.str)`${o}${(0,Mst.getErrorPath)(r,Mst.Type.Str)}`),[TZ.schemaPath,o]}a(MLs,"errorSchemaPath");function OLs(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:c,it:l}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:h}=l;n.push([TZ.keyword,o],[TZ.params,typeof e=="function"?e(t):e||(0,za._)`{}`]),u.messages&&n.push([TZ.message,typeof r=="function"?r(t):r]),u.verbose&&n.push([TZ.schema,c],[TZ.parentSchema,(0,za._)`${f}${h}`],[Y_.default.data,s]),d&&n.push([TZ.propertyName,d])}a(OLs,"extraErrorProps")});var CGn=I(Vfe=>{"use strict";p();Object.defineProperty(Vfe,"__esModule",{value:!0});Vfe.boolOrEmptySchema=Vfe.topBoolOrEmptySchema=void 0;var BLs=Nke(),LLs=ps(),FLs=RF(),ULs={message:"boolean schema is false"};function QLs(t){let{gen:e,schema:r,validateName:n}=t;r===!1?vGn(t,!1):typeof r=="object"&&r.$async===!0?e.return(FLs.default.data):(e.assign((0,LLs._)`${n}.errors`,null),e.return(!0))}a(QLs,"topBoolOrEmptySchema");Vfe.topBoolOrEmptySchema=QLs;function qLs(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),vGn(t)):r.var(e,!0)}a(qLs,"boolOrEmptySchema");Vfe.boolOrEmptySchema=qLs;function vGn(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,BLs.reportError)(o,ULs,void 0,e)}a(vGn,"falseSchemaError")});var xar=I(Wfe=>{"use strict";p();Object.defineProperty(Wfe,"__esModule",{value:!0});Wfe.getRules=Wfe.isJSONType=void 0;var jLs=["string","number","integer","boolean","null","object","array"],HLs=new Set(jLs);function GLs(t){return typeof t=="string"&&HLs.has(t)}a(GLs,"isJSONType");Wfe.isJSONType=GLs;function $Ls(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}a($Ls,"getRules");Wfe.getRules=$Ls});var war=I(Oj=>{"use strict";p();Object.defineProperty(Oj,"__esModule",{value:!0});Oj.shouldUseRule=Oj.shouldUseGroup=Oj.schemaHasRulesForType=void 0;function VLs({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&bGn(t,n)}a(VLs,"schemaHasRulesForType");Oj.schemaHasRulesForType=VLs;function bGn(t,e){return e.rules.some(r=>SGn(t,r))}a(bGn,"shouldUseGroup");Oj.shouldUseGroup=bGn;function SGn(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}a(SGn,"shouldUseRule");Oj.shouldUseRule=SGn});var Mke=I(dE=>{"use strict";p();Object.defineProperty(dE,"__esModule",{value:!0});dE.reportTypeError=dE.checkDataTypes=dE.checkDataType=dE.coerceAndCheckDataType=dE.getJSONTypes=dE.getSchemaTypes=dE.DataType=void 0;var WLs=xar(),zLs=war(),YLs=Nke(),ts=ps(),TGn=Wa(),zfe;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(zfe||(dE.DataType=zfe={}));function KLs(t){let e=IGn(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}a(KLs,"getSchemaTypes");dE.getSchemaTypes=KLs;function IGn(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(WLs.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}a(IGn,"getJSONTypes");dE.getJSONTypes=IGn;function JLs(t,e){let{gen:r,data:n,opts:o}=t,s=ZLs(e,o.coerceTypes),c=e.length>0&&!(s.length===0&&e.length===1&&(0,zLs.schemaHasRulesForType)(t,e[0]));if(c){let l=Par(e,n,o.strictNumbers,zfe.Wrong);r.if(l,()=>{s.length?XLs(t,e,s):kar(t)})}return c}a(JLs,"coerceAndCheckDataType");dE.coerceAndCheckDataType=JLs;var xGn=new Set(["string","number","integer","boolean","null"]);function ZLs(t,e){return e?t.filter(r=>xGn.has(r)||e==="array"&&r==="array"):[]}a(ZLs,"coerceToTypes");function XLs(t,e,r){let{gen:n,data:o,opts:s}=t,c=n.let("dataType",(0,ts._)`typeof ${o}`),l=n.let("coerced",(0,ts._)`undefined`);s.coerceTypes==="array"&&n.if((0,ts._)`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,ts._)`${o}[0]`).assign(c,(0,ts._)`typeof ${o}`).if(Par(e,o,s.strictNumbers),()=>n.assign(l,o))),n.if((0,ts._)`${l} !== undefined`);for(let d of r)(xGn.has(d)||d==="array"&&s.coerceTypes==="array")&&u(d);n.else(),kar(t),n.endIf(),n.if((0,ts._)`${l} !== undefined`,()=>{n.assign(o,l),e3s(t,l)});function u(d){switch(d){case"string":n.elseIf((0,ts._)`${c} == "number" || ${c} == "boolean"`).assign(l,(0,ts._)`"" + ${o}`).elseIf((0,ts._)`${o} === null`).assign(l,(0,ts._)`""`);return;case"number":n.elseIf((0,ts._)`${c} == "boolean" || ${o} === null + || (${c} == "string" && ${o} && ${o} == +${o})`).assign(l,(0,ts._)`+${o}`);return;case"integer":n.elseIf((0,ts._)`${c} === "boolean" || ${o} === null + || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,(0,ts._)`+${o}`);return;case"boolean":n.elseIf((0,ts._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf((0,ts._)`${o} === "true" || ${o} === 1`).assign(l,!0);return;case"null":n.elseIf((0,ts._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(l,null);return;case"array":n.elseIf((0,ts._)`${c} === "string" || ${c} === "number" + || ${c} === "boolean" || ${o} === null`).assign(l,(0,ts._)`[${o}]`)}}a(u,"coerceSpecificType")}a(XLs,"coerceData");function e3s({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,ts._)`${e} !== undefined`,()=>t.assign((0,ts._)`${e}[${r}]`,n))}a(e3s,"assignParentData");function Rar(t,e,r,n=zfe.Correct){let o=n===zfe.Correct?ts.operators.EQ:ts.operators.NEQ,s;switch(t){case"null":return(0,ts._)`${e} ${o} null`;case"array":s=(0,ts._)`Array.isArray(${e})`;break;case"object":s=(0,ts._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=c((0,ts._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=c();break;default:return(0,ts._)`typeof ${e} ${o} ${t}`}return n===zfe.Correct?s:(0,ts.not)(s);function c(l=ts.nil){return(0,ts.and)((0,ts._)`typeof ${e} == "number"`,l,r?(0,ts._)`isFinite(${e})`:ts.nil)}}a(Rar,"checkDataType");dE.checkDataType=Rar;function Par(t,e,r,n){if(t.length===1)return Rar(t[0],e,r,n);let o,s=(0,TGn.toHash)(t);if(s.array&&s.object){let c=(0,ts._)`typeof ${e} != "object"`;o=s.null?c:(0,ts._)`!${e} || ${c}`,delete s.null,delete s.array,delete s.object}else o=ts.nil;s.number&&delete s.integer;for(let c in s)o=(0,ts.and)(o,Rar(c,e,r,n));return o}a(Par,"checkDataTypes");dE.checkDataTypes=Par;var t3s={message:a(({schema:t})=>`must be ${t}`,"message"),params:a(({schema:t,schemaValue:e})=>typeof t=="string"?(0,ts._)`{type: ${t}}`:(0,ts._)`{type: ${e}}`,"params")};function kar(t){let e=r3s(t);(0,YLs.reportError)(e,t3s)}a(kar,"reportTypeError");dE.reportTypeError=kar;function r3s(t){let{gen:e,data:r,schema:n}=t,o=(0,TGn.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}a(r3s,"getTypeErrorContext")});var RGn=I(Ost=>{"use strict";p();Object.defineProperty(Ost,"__esModule",{value:!0});Ost.assignDefaults=void 0;var Yfe=ps(),n3s=Wa();function i3s(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)wGn(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>wGn(t,s,o.default))}a(i3s,"assignDefaults");Ost.assignDefaults=i3s;function wGn(t,e,r){let{gen:n,compositeRule:o,data:s,opts:c}=t;if(r===void 0)return;let l=(0,Yfe._)`${s}${(0,Yfe.getProperty)(e)}`;if(o){(0,n3s.checkStrictMode)(t,`default is ignored for: ${l}`);return}let u=(0,Yfe._)`${l} === undefined`;c.useDefaults==="empty"&&(u=(0,Yfe._)`${u} || ${l} === null || ${l} === ""`),n.if(u,(0,Yfe._)`${l} = ${(0,Yfe.stringify)(r)}`)}a(wGn,"assignDefault")});var xw=I(Cl=>{"use strict";p();Object.defineProperty(Cl,"__esModule",{value:!0});Cl.validateUnion=Cl.validateArray=Cl.usePattern=Cl.callValidateCode=Cl.schemaProperties=Cl.allSchemaProperties=Cl.noPropertyInData=Cl.propertyInData=Cl.isOwnProperty=Cl.hasPropFunc=Cl.reportMissingProp=Cl.checkMissingProp=Cl.checkReportMissingProp=void 0;var id=ps(),Dar=Wa(),Bj=RF(),o3s=Wa();function s3s(t,e){let{gen:r,data:n,it:o}=t;r.if(Mar(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,id._)`${e}`},!0),t.error()})}a(s3s,"checkReportMissingProp");Cl.checkReportMissingProp=s3s;function a3s({gen:t,data:e,it:{opts:r}},n,o){return(0,id.or)(...n.map(s=>(0,id.and)(Mar(t,e,s,r.ownProperties),(0,id._)`${o} = ${s}`)))}a(a3s,"checkMissingProp");Cl.checkMissingProp=a3s;function c3s(t,e){t.setParams({missingProperty:e},!0),t.error()}a(c3s,"reportMissingProp");Cl.reportMissingProp=c3s;function PGn(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,id._)`Object.prototype.hasOwnProperty`})}a(PGn,"hasPropFunc");Cl.hasPropFunc=PGn;function Nar(t,e,r){return(0,id._)`${PGn(t)}.call(${e}, ${r})`}a(Nar,"isOwnProperty");Cl.isOwnProperty=Nar;function l3s(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} !== undefined`;return n?(0,id._)`${o} && ${Nar(t,e,r)}`:o}a(l3s,"propertyInData");Cl.propertyInData=l3s;function Mar(t,e,r,n){let o=(0,id._)`${e}${(0,id.getProperty)(r)} === undefined`;return n?(0,id.or)(o,(0,id.not)(Nar(t,e,r))):o}a(Mar,"noPropertyInData");Cl.noPropertyInData=Mar;function kGn(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}a(kGn,"allSchemaProperties");Cl.allSchemaProperties=kGn;function u3s(t,e){return kGn(e).filter(r=>!(0,Dar.alwaysValidSchema)(t,e[r]))}a(u3s,"schemaProperties");Cl.schemaProperties=u3s;function d3s({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,id._)`${t}, ${e}, ${n}${o}`:e,h=[[Bj.default.instancePath,(0,id.strConcat)(Bj.default.instancePath,s)],[Bj.default.parentData,c.parentData],[Bj.default.parentDataProperty,c.parentDataProperty],[Bj.default.rootData,Bj.default.rootData]];c.opts.dynamicRef&&h.push([Bj.default.dynamicAnchors,Bj.default.dynamicAnchors]);let m=(0,id._)`${f}, ${r.object(...h)}`;return u!==id.nil?(0,id._)`${l}.call(${u}, ${m})`:(0,id._)`${l}(${m})`}a(d3s,"callValidateCode");Cl.callValidateCode=d3s;var f3s=(0,id._)`new RegExp`;function p3s({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,id._)`${o.code==="new RegExp"?f3s:(0,o3s.useFunc)(t,o)}(${r}, ${n})`})}a(p3s,"usePattern");Cl.usePattern=p3s;function h3s(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let l=e.let("valid",!0);return c(()=>e.assign(l,!1)),l}return e.var(s,!0),c(()=>e.break()),s;function c(l){let u=e.const("len",(0,id._)`${r}.length`);e.forRange("i",0,u,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Dar.Type.Num},s),e.if((0,id.not)(s),l)})}a(c,"validateItems")}a(h3s,"validateArray");Cl.validateArray=h3s;function m3s(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(u=>(0,Dar.alwaysValidSchema)(o,u))&&!o.opts.unevaluated)return;let c=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((u,d)=>{let f=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(c,(0,id._)`${c} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,id.not)(c))})),t.result(c,()=>t.reset(),()=>t.error(!0))}a(m3s,"validateUnion");Cl.validateUnion=m3s});var MGn=I(d5=>{"use strict";p();Object.defineProperty(d5,"__esModule",{value:!0});d5.validateKeywordUsage=d5.validSchemaType=d5.funcKeywordCode=d5.macroKeywordCode=void 0;var K_=ps(),IZ=RF(),g3s=xw(),A3s=Nke();function y3s(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:c}=t,l=e.macro.call(c.self,o,s,c),u=NGn(r,n,l);c.opts.validateSchema!==!1&&c.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:K_.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}a(y3s,"macroKeywordCode");d5.macroKeywordCode=y3s;function E3s(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:c,$data:l,it:u}=t;v3s(u,e);let d=!l&&e.compile?e.compile.call(u.self,s,c,u):e.validate,f=NGn(n,o,d),h=n.let("valid");t.block$data(h,m),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function m(){if(e.errors===!1)y(),e.modifying&&DGn(t),E(()=>t.error());else{let _=e.async?g():A();e.modifying&&DGn(t),E(()=>_3s(t,_))}}a(m,"validateKeyword");function g(){let _=n.let("ruleErrs",null);return n.try(()=>y((0,K_._)`await `),v=>n.assign(h,!1).if((0,K_._)`${v} instanceof ${u.ValidationError}`,()=>n.assign(_,(0,K_._)`${v}.errors`),()=>n.throw(v))),_}a(g,"validateAsync");function A(){let _=(0,K_._)`${f}.errors`;return n.assign(_,null),y(K_.nil),_}a(A,"validateSync");function y(_=e.async?(0,K_._)`await `:K_.nil){let v=u.opts.passContext?IZ.default.this:IZ.default.self,b=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,K_._)`${_}${(0,g3s.callValidateCode)(t,f,v,b)}`,e.modifying)}a(y,"assignValid");function E(_){var v;n.if((0,K_.not)((v=e.valid)!==null&&v!==void 0?v:h),_)}a(E,"reportErrs")}a(E3s,"funcKeywordCode");d5.funcKeywordCode=E3s;function DGn(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,K_._)`${n.parentData}[${n.parentDataProperty}]`))}a(DGn,"modifyData");function _3s(t,e){let{gen:r}=t;r.if((0,K_._)`Array.isArray(${e})`,()=>{r.assign(IZ.default.vErrors,(0,K_._)`${IZ.default.vErrors} === null ? ${e} : ${IZ.default.vErrors}.concat(${e})`).assign(IZ.default.errors,(0,K_._)`${IZ.default.vErrors}.length`),(0,A3s.extendErrors)(t)},()=>t.error())}a(_3s,"addErrs");function v3s({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}a(v3s,"checkAsyncKeyword");function NGn(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,K_.stringify)(r)})}a(NGn,"useKeyword");function C3s(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}a(C3s,"validSchemaType");d5.validSchemaType=C3s;function b3s({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let c=o.dependencies;if(c?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${c.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let u=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(u);else throw new Error(u)}}a(b3s,"validateKeywordUsage");d5.validateKeywordUsage=b3s});var BGn=I(Lj=>{"use strict";p();Object.defineProperty(Lj,"__esModule",{value:!0});Lj.extendSubschemaMode=Lj.extendSubschemaData=Lj.getSubschema=void 0;var f5=ps(),OGn=Wa();function S3s(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,f5._)`${t.schemaPath}${(0,f5.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,f5._)`${t.schemaPath}${(0,f5.getProperty)(e)}${(0,f5.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,OGn.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}a(S3s,"getSubschema");Lj.getSubschema=S3s;function T3s(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:f,opts:h}=e,m=l.let("data",(0,f5._)`${e.data}${(0,f5.getProperty)(r)}`,!0);u(m),t.errorPath=(0,f5.str)`${d}${(0,OGn.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,f5._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(o!==void 0){let d=o instanceof f5.Name?o:l.let("data",o,!0);u(d),c!==void 0&&(t.propertyName=c)}s&&(t.dataTypes=s);function u(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}a(u,"dataContextProps")}a(T3s,"extendSubschemaData");Lj.extendSubschemaData=T3s;function I3s(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}a(I3s,"extendSubschemaMode");Lj.extendSubschemaMode=I3s});var Oar=I((Whf,LGn)=>{"use strict";p();LGn.exports=a(function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var c=s[o];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r},"equal")});var UGn=I((Khf,FGn)=>{"use strict";p();var Fj=FGn.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Bst(e,n,o,t,"",t)};Fj.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Fj.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Fj.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Fj.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Bst(t,e,r,n,o,s,c,l,u,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,c,l,u,d);for(var f in n){var h=n[f];if(Array.isArray(h)){if(f in Fj.arrayKeywords)for(var m=0;m{"use strict";p();Object.defineProperty(ab,"__esModule",{value:!0});ab.getSchemaRefs=ab.resolveUrl=ab.normalizeId=ab._getFullPath=ab.getFullPath=ab.inlineRef=void 0;var w3s=Wa(),R3s=Oar(),P3s=UGn(),k3s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function D3s(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Bar(t):e?QGn(t)<=e:!1}a(D3s,"inlineRef");ab.inlineRef=D3s;var N3s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Bar(t){for(let e in t){if(N3s.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Bar)||typeof r=="object"&&Bar(r))return!0}return!1}a(Bar,"hasRef");function QGn(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!k3s.has(r)&&(typeof t[r]=="object"&&(0,w3s.eachItem)(t[r],n=>e+=QGn(n)),e===1/0))return 1/0}return e}a(QGn,"countKeys");function qGn(t,e="",r){r!==!1&&(e=Kfe(e));let n=t.parse(e);return jGn(t,n)}a(qGn,"getFullPath");ab.getFullPath=qGn;function jGn(t,e){return t.serialize(e).split("#")[0]+"#"}a(jGn,"_getFullPath");ab._getFullPath=jGn;var M3s=/#\/?$/;function Kfe(t){return t?t.replace(M3s,""):""}a(Kfe,"normalizeId");ab.normalizeId=Kfe;function O3s(t,e,r){return r=Kfe(r),t.resolve(e,r)}a(O3s,"resolveUrl");ab.resolveUrl=O3s;var B3s=/^[a-z_][-a-z0-9._]*$/i;function L3s(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Kfe(t[r]||e),s={"":o},c=qGn(n,o,!1),l={},u=new Set;return P3s(t,{allKeys:!0},(h,m,g,A)=>{if(A===void 0)return;let y=c+m,E=s[A];typeof h[r]=="string"&&(E=_.call(this,h[r])),v.call(this,h.$anchor),v.call(this,h.$dynamicAnchor),s[m]=E;function _(b){let T=this.opts.uriResolver.resolve;if(b=Kfe(E?T(E,b):b),u.has(b))throw f(b);u.add(b);let w=this.refs[b];return typeof w=="string"&&(w=this.refs[w]),typeof w=="object"?d(h,w.schema,b):b!==Kfe(y)&&(b[0]==="#"?(d(h,l[b],b),l[b]=h):this.refs[b]=y),b}a(_,"addRef");function v(b){if(typeof b=="string"){if(!B3s.test(b))throw new Error(`invalid anchor "${b}"`);_.call(this,`#${b}`)}}a(v,"addAnchor")}),l;function d(h,m,g){if(m!==void 0&&!R3s(h,m))throw f(g)}a(d,"checkAmbiguosRef");function f(h){return new Error(`reference "${h}" resolves to more than one schema`)}a(f,"ambiguos")}a(L3s,"getSchemaRefs");ab.getSchemaRefs=L3s});var Fke=I(Uj=>{"use strict";p();Object.defineProperty(Uj,"__esModule",{value:!0});Uj.getData=Uj.KeywordCxt=Uj.validateFunctionCode=void 0;var WGn=CGn(),HGn=Mke(),Far=war(),Lst=Mke(),F3s=RGn(),Lke=MGn(),Lar=BGn(),ni=ps(),po=RF(),U3s=Oke(),PF=Wa(),Bke=Nke();function Q3s(t){if(KGn(t)&&(JGn(t),YGn(t))){H3s(t);return}zGn(t,()=>(0,WGn.topBoolOrEmptySchema)(t))}a(Q3s,"validateFunctionCode");Uj.validateFunctionCode=Q3s;function zGn({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,ni._)`${po.default.data}, ${po.default.valCxt}`,n.$async,()=>{t.code((0,ni._)`"use strict"; ${GGn(r,o)}`),j3s(t,o),t.code(s)}):t.func(e,(0,ni._)`${po.default.data}, ${q3s(o)}`,n.$async,()=>t.code(GGn(r,o)).code(s))}a(zGn,"validateFunction");function q3s(t){return(0,ni._)`{${po.default.instancePath}="", ${po.default.parentData}, ${po.default.parentDataProperty}, ${po.default.rootData}=${po.default.data}${t.dynamicRef?(0,ni._)`, ${po.default.dynamicAnchors}={}`:ni.nil}}={}`}a(q3s,"destructureValCxt");function j3s(t,e){t.if(po.default.valCxt,()=>{t.var(po.default.instancePath,(0,ni._)`${po.default.valCxt}.${po.default.instancePath}`),t.var(po.default.parentData,(0,ni._)`${po.default.valCxt}.${po.default.parentData}`),t.var(po.default.parentDataProperty,(0,ni._)`${po.default.valCxt}.${po.default.parentDataProperty}`),t.var(po.default.rootData,(0,ni._)`${po.default.valCxt}.${po.default.rootData}`),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`${po.default.valCxt}.${po.default.dynamicAnchors}`)},()=>{t.var(po.default.instancePath,(0,ni._)`""`),t.var(po.default.parentData,(0,ni._)`undefined`),t.var(po.default.parentDataProperty,(0,ni._)`undefined`),t.var(po.default.rootData,po.default.data),e.dynamicRef&&t.var(po.default.dynamicAnchors,(0,ni._)`{}`)})}a(j3s,"destructureValCxtES5");function H3s(t){let{schema:e,opts:r,gen:n}=t;zGn(t,()=>{r.$comment&&e.$comment&&XGn(t),z3s(t),n.let(po.default.vErrors,null),n.let(po.default.errors,0),r.unevaluated&&G3s(t),ZGn(t),J3s(t)})}a(H3s,"topSchemaObjCode");function G3s(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ni._)`${r}.evaluated`),e.if((0,ni._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ni._)`${t.evaluated}.props`,(0,ni._)`undefined`)),e.if((0,ni._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ni._)`${t.evaluated}.items`,(0,ni._)`undefined`))}a(G3s,"resetEvaluated");function GGn(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ni._)`/*# sourceURL=${r} */`:ni.nil}a(GGn,"funcSourceUrl");function $3s(t,e){if(KGn(t)&&(JGn(t),YGn(t))){V3s(t,e);return}(0,WGn.boolOrEmptySchema)(t,e)}a($3s,"subschemaCode");function YGn({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}a(YGn,"schemaCxtHasRules");function KGn(t){return typeof t.schema!="boolean"}a(KGn,"isSchemaObj");function V3s(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&XGn(t),Y3s(t),K3s(t);let s=n.const("_errs",po.default.errors);ZGn(t,s),n.var(e,(0,ni._)`${s} === ${po.default.errors}`)}a(V3s,"subSchemaObjCode");function JGn(t){(0,PF.checkUnknownRules)(t),W3s(t)}a(JGn,"checkKeywords");function ZGn(t,e){if(t.opts.jtd)return $Gn(t,[],!1,e);let r=(0,HGn.getSchemaTypes)(t.schema),n=(0,HGn.coerceAndCheckDataType)(t,r);$Gn(t,r,!n,e)}a(ZGn,"typeAndKeywords");function W3s(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,PF.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}a(W3s,"checkRefsAndKeywords");function z3s(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,PF.checkStrictMode)(t,"default is ignored in the schema root")}a(z3s,"checkNoDefault");function Y3s(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,U3s.resolveUrl)(t.opts.uriResolver,t.baseId,e))}a(Y3s,"updateContext");function K3s(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}a(K3s,"checkAsyncSchema");function XGn({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,ni._)`${po.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let c=(0,ni.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ni._)`${po.default.self}.opts.$comment(${s}, ${c}, ${l}.schema)`)}}a(XGn,"commentKeyword");function J3s(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,ni._)`${po.default.errors} === 0`,()=>e.return(po.default.data),()=>e.throw((0,ni._)`new ${o}(${po.default.vErrors})`)):(e.assign((0,ni._)`${n}.errors`,po.default.vErrors),s.unevaluated&&Z3s(t),e.return((0,ni._)`${po.default.errors} === 0`))}a(J3s,"returnResults");function Z3s({gen:t,evaluated:e,props:r,items:n}){r instanceof ni.Name&&t.assign((0,ni._)`${e}.props`,r),n instanceof ni.Name&&t.assign((0,ni._)`${e}.items`,n)}a(Z3s,"assignEvaluated");function $Gn(t,e,r,n){let{gen:o,schema:s,data:c,allErrors:l,opts:u,self:d}=t,{RULES:f}=d;if(s.$ref&&(u.ignoreKeywordsWithRef||!(0,PF.schemaHasRulesButRef)(s,f))){o.block(()=>t$n(t,"$ref",f.all.$ref.definition));return}u.jtd||X3s(t,e),o.block(()=>{for(let m of f.rules)h(m);h(f.post)});function h(m){(0,Far.shouldUseGroup)(s,m)&&(m.type?(o.if((0,Lst.checkDataType)(m.type,c,u.strictNumbers)),VGn(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,Lst.reportTypeError)(t)),o.endIf()):VGn(t,m),l||o.if((0,ni._)`${po.default.errors} === ${n||0}`))}a(h,"groupKeywords")}a($Gn,"schemaKeywords");function VGn(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,F3s.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Far.shouldUseRule)(n,s)&&t$n(t,s.keyword,s.definition,e.type)})}a(VGn,"iterateKeywords");function X3s(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(eFs(t,e),t.opts.allowUnionTypes||tFs(t,e),rFs(t,t.dataTypes))}a(X3s,"checkStrictTypes");function eFs(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{e$n(t.dataTypes,r)||Uar(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),iFs(t,e)}}a(eFs,"checkContextTypes");function tFs(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Uar(t,"use allowUnionTypes to allow union type keyword")}a(tFs,"checkMultipleTypes");function rFs(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Far.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(c=>nFs(e,c))&&Uar(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}a(rFs,"checkKeywordTypes");function nFs(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}a(nFs,"hasApplicableType");function e$n(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}a(e$n,"includesType");function iFs(t,e){let r=[];for(let n of t.dataTypes)e$n(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}a(iFs,"narrowSchemaTypes");function Uar(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,PF.checkStrictMode)(t,e,t.opts.strictTypes)}a(Uar,"strictTypesError");var Fst=class{static{a(this,"KeywordCxt")}constructor(e,r,n){if((0,Lke.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,PF.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",r$n(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Lke.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",po.default.errors))}result(e,r,n){this.failResult((0,ni.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ni.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ni._)`${r} !== undefined && (${(0,ni.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Bke.reportExtraError:Bke.reportError)(this,this.def.error,r)}$dataError(){(0,Bke.reportError)(this,this.def.$dataError||Bke.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bke.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ni.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ni.nil,r=ni.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:c}=this;n.if((0,ni.or)((0,ni._)`${o} === undefined`,r)),e!==ni.nil&&n.assign(e,!0),(s.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ni.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,ni.or)(c(),l());function c(){if(n.length){if(!(r instanceof ni.Name))throw new Error("ajv implementation error");let u=Array.isArray(n)?n:[n];return(0,ni._)`${(0,Lst.checkDataTypes)(u,r,s.opts.strictNumbers,Lst.DataType.Wrong)}`}return ni.nil}function l(){if(o.validateSchema){let u=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,ni._)`!${u}(${r})`}return ni.nil}}subschema(e,r){let n=(0,Lar.getSubschema)(this.it,e);(0,Lar.extendSubschemaData)(n,this.it,e),(0,Lar.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return $3s(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=PF.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=PF.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,ni.Name)),!0}};Uj.KeywordCxt=Fst;function t$n(t,e,r,n){let o=new Fst(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Lke.funcKeywordCode)(o,r):"macro"in r?(0,Lke.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Lke.funcKeywordCode)(o,r)}a(t$n,"keywordCode");var oFs=/^\/(?:[^~]|~0|~1)*$/,sFs=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function r$n(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return po.default.rootData;if(t[0]==="/"){if(!oFs.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=po.default.rootData}else{let d=sFs.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let f=+d[1];if(o=d[2],o==="#"){if(f>=e)throw new Error(u("property/index",f));return n[e-f]}if(f>e)throw new Error(u("data",f));if(s=r[e-f],!o)return s}let c=s,l=o.split("/");for(let d of l)d&&(s=(0,ni._)`${s}${(0,ni.getProperty)((0,PF.unescapeJsonPointer)(d))}`,c=(0,ni._)`${c} && ${s}`);return c;function u(d,f){return`Cannot access ${d} ${f} levels up, current level is ${e}`}}a(r$n,"getData");Uj.getData=r$n});var Ust=I(qar=>{"use strict";p();Object.defineProperty(qar,"__esModule",{value:!0});var Qar=class extends Error{static{a(this,"ValidationError")}constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};qar.default=Qar});var Uke=I(Gar=>{"use strict";p();Object.defineProperty(Gar,"__esModule",{value:!0});var jar=Oke(),Har=class extends Error{static{a(this,"MissingRefError")}constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,jar.resolveUrl)(e,r,n),this.missingSchema=(0,jar.normalizeId)((0,jar.getFullPath)(e,this.missingRef))}};Gar.default=Har});var qst=I(ww=>{"use strict";p();Object.defineProperty(ww,"__esModule",{value:!0});ww.resolveSchema=ww.getCompilingSchema=ww.resolveRef=ww.compileSchema=ww.SchemaEnv=void 0;var n2=ps(),aFs=Ust(),xZ=RF(),i2=Oke(),n$n=Wa(),cFs=Fke(),Jfe=class{static{a(this,"SchemaEnv")}constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,i2.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ww.SchemaEnv=Jfe;function Var(t){let e=i$n.call(this,t);if(e)return e;let r=(0,i2.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,c=new n2.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),l;t.$async&&(l=c.scopeValue("Error",{ref:aFs.default,code:(0,n2._)`require("ajv/dist/runtime/validation_error").default`}));let u=c.scopeName("validate");t.validateName=u;let d={gen:c,allErrors:this.opts.allErrors,data:xZ.default.data,parentData:xZ.default.parentData,parentDataProperty:xZ.default.parentDataProperty,dataNames:[xZ.default.data],dataPathArr:[n2.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,n2.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:n2.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n2._)`""`,opts:this.opts,self:this},f;try{this._compilations.add(t),(0,cFs.validateFunctionCode)(d),c.optimize(this.opts.code.optimize);let h=c.toString();f=`${c.scopeRefs(xZ.default.scope)}return ${h}`,this.opts.code.process&&(f=this.opts.code.process(f,t));let g=new Function(`${xZ.default.self}`,`${xZ.default.scope}`,f)(this,this.scope.get());if(this.scope.value(u,{ref:g}),g.errors=null,g.schema=t.schema,g.schemaEnv=t,t.$async&&(g.$async=!0),this.opts.code.source===!0&&(g.source={validateName:u,validateCode:h,scopeValues:c._values}),this.opts.unevaluated){let{props:A,items:y}=d;g.evaluated={props:A instanceof n2.Name?void 0:A,items:y instanceof n2.Name?void 0:y,dynamicProps:A instanceof n2.Name,dynamicItems:y instanceof n2.Name},g.source&&(g.source.evaluated=(0,n2.stringify)(g.evaluated))}return t.validate=g,t}catch(h){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),h}finally{this._compilations.delete(t)}}a(Var,"compileSchema");ww.compileSchema=Var;function lFs(t,e,r){var n;r=(0,i2.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=fFs.call(this,t,r);if(s===void 0){let c=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;c&&(s=new Jfe({schema:c,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=uFs.call(this,s)}a(lFs,"resolveRef");ww.resolveRef=lFs;function uFs(t){return(0,i2.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Var.call(this,t)}a(uFs,"inlineOrCompile");function i$n(t){for(let e of this._compilations)if(dFs(e,t))return e}a(i$n,"getCompilingSchema");ww.getCompilingSchema=i$n;function dFs(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}a(dFs,"sameSchemaEnv");function fFs(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Qst.call(this,t,e)}a(fFs,"resolve");function Qst(t,e){let r=this.opts.uriResolver.parse(e),n=(0,i2._getFullPath)(this.opts.uriResolver,r),o=(0,i2.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return $ar.call(this,r,t);let s=(0,i2.normalizeId)(n),c=this.refs[s]||this.schemas[s];if(typeof c=="string"){let l=Qst.call(this,t,c);return typeof l?.schema!="object"?void 0:$ar.call(this,r,l)}if(typeof c?.schema=="object"){if(c.validate||Var.call(this,c),s===(0,i2.normalizeId)(e)){let{schema:l}=c,{schemaId:u}=this.opts,d=l[u];return d&&(o=(0,i2.resolveUrl)(this.opts.uriResolver,o,d)),new Jfe({schema:l,schemaId:u,root:t,baseId:o})}return $ar.call(this,r,c)}}a(Qst,"resolveSchema");ww.resolveSchema=Qst;var pFs=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $ar(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let u=r[(0,n$n.unescapeFragment)(l)];if(u===void 0)return;r=u;let d=typeof r=="object"&&r[this.opts.schemaId];!pFs.has(l)&&d&&(e=(0,i2.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,n$n.schemaHasRulesButRef)(r,this.RULES)){let l=(0,i2.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Qst.call(this,n,l)}let{schemaId:c}=this.opts;if(s=s||new Jfe({schema:r,schemaId:c,root:n,baseId:e}),s.schema!==s.root.schema)return s}a($ar,"getJsonPointer")});var o$n=I((h0f,hFs)=>{hFs.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Yar=I((m0f,d$n)=>{"use strict";p();var mFs=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),a$n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),War=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),c$n=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),gFs=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function zar(t){let e="",r=0,n=0;for(n=0;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}a(zar,"stringArrayToHexStripped");var AFs=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function s$n(t){return t.length=0,!0}a(s$n,"consumeIsZone");function yFs(t,e,r){if(t.length){let n=zar(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}a(yFs,"consumeHextets");function EFs(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,c=!1,l=yFs;for(let u=0;u7){r.error=!0;break}u>0&&t[u-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(o,n,r))break;l=s$n}else{o.push(d);continue}}return o.length&&(l===s$n?r.zone=o.join(""):c?n.push(o.join("")):n.push(zar(o))),r.address=n.join(""),r}a(EFs,"getIPV6");function l$n(t){if(_Fs(t,":")<2)return{host:t,isIPV6:!1};let e=EFs(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}a(l$n,"normalizeIPv6");function _Fs(t,e){let r=0;for(let n=0;nCFs[n])}a(u$n,"reescapeHostDelimiters");function TFs(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n{"use strict";p();var{isUUID:RFs}=Yar(),PFs=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,kFs=["http","https","ws","wss","urn","urn:uuid"];function DFs(t){return kFs.indexOf(t)!==-1}a(DFs,"isValidSchemeName");function Kar(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}a(Kar,"wsIsSecure");function f$n(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}a(f$n,"httpParse");function p$n(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}a(p$n,"httpSerialize");function NFs(t){return t.secure=Kar(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}a(NFs,"wsParse");function MFs(t){if((t.port===(Kar(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}a(MFs,"wsSerialize");function OFs(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(PFs);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=Jar(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}a(OFs,"urnParse");function BFs(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=Jar(o);s&&(t=s.serialize(t,e));let c=t,l=t.nss;return c.path=`${n||e.nid}:${l}`,e.skipEscape=!0,c}a(BFs,"urnSerialize");function LFs(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!RFs(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}a(LFs,"urnuuidParse");function FFs(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}a(FFs,"urnuuidSerialize");var h$n={scheme:"http",domainHost:!0,parse:f$n,serialize:p$n},UFs={scheme:"https",domainHost:h$n.domainHost,parse:f$n,serialize:p$n},jst={scheme:"ws",domainHost:!0,parse:NFs,serialize:MFs},QFs={scheme:"wss",domainHost:jst.domainHost,parse:jst.parse,serialize:jst.serialize},qFs={scheme:"urn",parse:OFs,serialize:BFs,skipNormalize:!0},jFs={scheme:"urn:uuid",parse:LFs,serialize:FFs,skipNormalize:!0},Hst={http:h$n,https:UFs,ws:jst,wss:QFs,urn:qFs,"urn:uuid":jFs};Object.setPrototypeOf(Hst,null);function Jar(t){return t&&(Hst[t]||Hst[t.toLowerCase()])||void 0}a(Jar,"getSchemeHandler");m$n.exports={wsIsSecure:Kar,SCHEMES:Hst,isValidSchemeName:DFs,getSchemeHandler:Jar}});var C$n=I((v0f,Gst)=>{"use strict";p();var{normalizeIPv6:HFs,removeDotSegments:Qke,recomposeAuthority:GFs,normalizePercentEncoding:$Fs,normalizePathEncoding:VFs,escapePreservingEscapes:WFs,reescapeHostDelimiters:zFs,isIPv4:YFs,nonSimpleDomain:KFs}=Yar(),{SCHEMES:JFs,getSchemeHandler:y$n}=g$n();function ZFs(t,e){return typeof t=="string"?t=n8s(t,e):typeof t=="object"&&(t=Zfe(wZ(t,e),e)),t}a(ZFs,"normalize");function XFs(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=E$n(Zfe(t,n),Zfe(e,n),n,!0);return n.skipEscape=!0,wZ(o,n)}a(XFs,"resolve");function E$n(t,e,r,n){let o={};return n||(t=Zfe(wZ(t,r),r),e=Zfe(wZ(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=Qke(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=Qke(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=Qke(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=Qke(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}a(E$n,"resolveComponent");function e8s(t,e,r){let n=A$n(t,r),o=A$n(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}a(e8s,"equal");function wZ(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=y$n(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=$Fs(r.path):(r.path=WFs(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let c=GFs(r);if(c!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(c),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Qke(l)),c===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),o.push(l)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}a(wZ,"serialize");var t8s=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function r8s(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}a(r8s,"getParseError");function _$n(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let c=t.match(t8s);if(c){n.scheme=c[1],n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let l=r8s(n,c);if(l!==void 0&&(n.error=n.error||l,o=!0),n.host)if(YFs(n.host)===!1){let f=HFs(n.host);n.host=f.host.toLowerCase(),s=f.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let u=y$n(r.scheme||n.scheme);if(!r.unicodeSupport&&(!u||!u.unicodeSupport)&&n.host&&(r.domainHost||u&&u.domainHost)&&s===!1&&KFs(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!u||u&&!u.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=zFs(unescape(n.host),s))),n.path&&(n.path=VFs(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}u&&u.parse&&u.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}a(_$n,"parseWithStatus");function Zfe(t,e){return _$n(t,e).parsed}a(Zfe,"parse");function n8s(t,e){return v$n(t,e).normalized}a(n8s,"normalizeString");function v$n(t,e){let{parsed:r,malformedAuthorityOrPort:n}=_$n(t,e);return{normalized:n?t:wZ(r,e),malformedAuthorityOrPort:n}}a(v$n,"normalizeStringWithStatus");function A$n(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=v$n(t,e);return n?void 0:r}if(typeof t=="object")return wZ(t,e)}a(A$n,"normalizeComparableURI");var Zar={SCHEMES:JFs,normalize:ZFs,resolve:XFs,resolveComponent:E$n,equal:e8s,serialize:wZ,parse:Zfe};Gst.exports=Zar;Gst.exports.default=Zar;Gst.exports.fastUri=Zar});var S$n=I(Xar=>{"use strict";p();Object.defineProperty(Xar,"__esModule",{value:!0});var b$n=C$n();b$n.code='require("ajv/dist/runtime/uri").default';Xar.default=b$n});var D$n=I(LA=>{"use strict";p();Object.defineProperty(LA,"__esModule",{value:!0});LA.CodeGen=LA.Name=LA.nil=LA.stringify=LA.str=LA._=LA.KeywordCxt=void 0;var i8s=Fke();Object.defineProperty(LA,"KeywordCxt",{enumerable:!0,get:a(function(){return i8s.KeywordCxt},"get")});var Xfe=ps();Object.defineProperty(LA,"_",{enumerable:!0,get:a(function(){return Xfe._},"get")});Object.defineProperty(LA,"str",{enumerable:!0,get:a(function(){return Xfe.str},"get")});Object.defineProperty(LA,"stringify",{enumerable:!0,get:a(function(){return Xfe.stringify},"get")});Object.defineProperty(LA,"nil",{enumerable:!0,get:a(function(){return Xfe.nil},"get")});Object.defineProperty(LA,"Name",{enumerable:!0,get:a(function(){return Xfe.Name},"get")});Object.defineProperty(LA,"CodeGen",{enumerable:!0,get:a(function(){return Xfe.CodeGen},"get")});var o8s=Ust(),R$n=Uke(),s8s=xar(),qke=qst(),a8s=ps(),jke=Oke(),$st=Mke(),tcr=Wa(),T$n=o$n(),c8s=S$n(),P$n=a((t,e)=>new RegExp(t,e),"defaultRegExp");P$n.code="new RegExp";var l8s=["removeAdditional","useDefaults","coerceTypes"],u8s=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d8s={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},f8s={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},I$n=200;function p8s(t){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D;let N=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,L=B===!0||B===void 0?1:B||0,j=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:P$n,M=(o=t.uriResolver)!==null&&o!==void 0?o:c8s.default;return{strictSchema:(c=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&c!==void 0?c:!0,strictNumbers:(u=(l=t.strictNumbers)!==null&&l!==void 0?l:N)!==null&&u!==void 0?u:!0,strictTypes:(f=(d=t.strictTypes)!==null&&d!==void 0?d:N)!==null&&f!==void 0?f:"log",strictTuples:(m=(h=t.strictTuples)!==null&&h!==void 0?h:N)!==null&&m!==void 0?m:"log",strictRequired:(A=(g=t.strictRequired)!==null&&g!==void 0?g:N)!==null&&A!==void 0?A:!1,code:t.code?{...t.code,optimize:L,regExp:j}:{optimize:L,regExp:j},loopRequired:(y=t.loopRequired)!==null&&y!==void 0?y:I$n,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:I$n,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(b=t.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(T=t.schemaId)!==null&&T!==void 0?T:"$id",addUsedSchema:(w=t.addUsedSchema)!==null&&w!==void 0?w:!0,validateSchema:(R=t.validateSchema)!==null&&R!==void 0?R:!0,validateFormats:(x=t.validateFormats)!==null&&x!==void 0?x:!0,unicodeRegExp:(P=t.unicodeRegExp)!==null&&P!==void 0?P:!0,int32range:(D=t.int32range)!==null&&D!==void 0?D:!0,uriResolver:M}}a(p8s,"requiredOptions");var Hke=class{static{a(this,"Ajv")}constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...p8s(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new a8s.ValueScope({scope:{},prefixes:u8s,es5:r,lines:n}),this.logger=E8s(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,s8s.getRules)(),x$n.call(this,d8s,e,"NOT SUPPORTED"),x$n.call(this,f8s,e,"DEPRECATED","warn"),this._metaOpts=A8s.call(this),e.formats&&m8s.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&g8s.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),h8s.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=T$n;n==="id"&&(o={...T$n},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(f,h){await s.call(this,f.$schema);let m=this._addSchema(f,h);return m.validate||c.call(this,m)}async function s(f){f&&!this.getSchema(f)&&await o.call(this,{$ref:f},!0)}async function c(f){try{return this._compileSchemaEnv(f)}catch(h){if(!(h instanceof R$n.default))throw h;return l.call(this,h),await u.call(this,h.missingSchema),c.call(this,f)}}function l({missingSchema:f,missingRef:h}){if(this.refs[f])throw new Error(`AnySchema ${f} is loaded but ${h} cannot be resolved`)}async function u(f){let h=await d.call(this,f);this.refs[f]||await s.call(this,h.$schema),this.refs[f]||this.addSchema(h,f,r)}async function d(f){let h=this._loading[f];if(h)return h;try{return await(this._loading[f]=n(f))}finally{delete this._loading[f]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let c of e)this.addSchema(c,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:c}=this.opts;if(s=e[c],s!==void 0&&typeof s!="string")throw new Error(`schema ${c} must be string`)}return r=(0,jke.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=w$n.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new qke.SchemaEnv({schema:{},schemaId:n});if(r=qke.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=w$n.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,jke.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(v8s.call(this,n,r),!r)return(0,tcr.eachItem)(n,s=>ecr.call(this,s)),this;b8s.call(this,r);let o={...r,type:(0,$st.getJSONTypes)(r.type),schemaType:(0,$st.getJSONTypes)(r.schemaType)};return(0,tcr.eachItem)(n,o.type.length===0?s=>ecr.call(this,s,o):s=>o.type.forEach(c=>ecr.call(this,s,o,c))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),c=e;for(let l of s)c=c[l];for(let l in n){let u=n[l];if(typeof u!="object")continue;let{$data:d}=u.definition,f=c[l];d&&f&&(c[l]=k$n(f))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let c,{schemaId:l}=this.opts;if(typeof e=="object")c=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let u=this._cache.get(e);if(u!==void 0)return u;n=(0,jke.normalizeId)(c||n);let d=jke.getSchemaRefs.call(this,e,n);return u=new qke.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(u.schema,u),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=u),o&&this.validateSchema(e,!0),u}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):qke.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{qke.compileSchema.call(this,e)}finally{this.opts=r}}};Hke.ValidationError=o8s.default;Hke.MissingRefError=R$n.default;LA.default=Hke;function x$n(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}a(x$n,"checkOptions");function w$n(t){return t=(0,jke.normalizeId)(t),this.schemas[t]||this.refs[t]}a(w$n,"getSchEnv");function h8s(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}a(h8s,"addInitialSchemas");function m8s(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}a(m8s,"addInitialFormats");function g8s(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}a(g8s,"addInitialKeywords");function A8s(){let t={...this.opts};for(let e of l8s)delete t[e];return t}a(A8s,"getMetaSchemaOptions");var y8s={log(){},warn(){},error(){}};function E8s(t){if(t===!1)return y8s;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}a(E8s,"getLogger");var _8s=/^[a-z_$][a-z0-9_$:-]*$/i;function v8s(t,e){let{RULES:r}=this;if((0,tcr.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!_8s.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}a(v8s,"checkKeyword");function ecr(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,c=o?s.post:s.rules.find(({type:u})=>u===r);if(c||(c={type:r,rules:[]},s.rules.push(c)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,$st.getJSONTypes)(e.type),schemaType:(0,$st.getJSONTypes)(e.schemaType)}};e.before?C8s.call(this,c,l,e.before):c.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(u=>this.addKeyword(u))}a(ecr,"addRule");function C8s(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}a(C8s,"addBeforeRule");function b8s(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=k$n(e)),t.validateSchema=this.compile(e,!0))}a(b8s,"keywordMetaschema");var S8s={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function k$n(t){return{anyOf:[t,S8s]}}a(k$n,"schemaOrData")});var N$n=I(rcr=>{"use strict";p();Object.defineProperty(rcr,"__esModule",{value:!0});var T8s={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rcr.default=T8s});var L$n=I(RZ=>{"use strict";p();Object.defineProperty(RZ,"__esModule",{value:!0});RZ.callRef=RZ.getValidate=void 0;var I8s=Uke(),M$n=xw(),cb=ps(),epe=RF(),O$n=qst(),Vst=Wa(),x8s={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:c,opts:l,self:u}=n,{root:d}=s;if((r==="#"||r==="#/")&&o===d.baseId)return h();let f=O$n.resolveRef.call(u,d,o,r);if(f===void 0)throw new I8s.default(n.opts.uriResolver,o,r);if(f instanceof O$n.SchemaEnv)return m(f);return g(f);function h(){if(s===d)return Wst(t,c,s,s.$async);let A=e.scopeValue("root",{ref:d});return Wst(t,(0,cb._)`${A}.validate`,d,d.$async)}function m(A){let y=B$n(t,A);Wst(t,y,A,A.$async)}function g(A){let y=e.scopeValue("schema",l.code.source===!0?{ref:A,code:(0,cb.stringify)(A)}:{ref:A}),E=e.name("valid"),_=t.subschema({schema:A,dataTypes:[],schemaPath:cb.nil,topSchemaRef:y,errSchemaPath:r},E);t.mergeEvaluated(_),t.ok(E)}}};function B$n(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,cb._)`${r.scopeValue("wrapper",{ref:e})}.validate`}a(B$n,"getValidate");RZ.getValidate=B$n;function Wst(t,e,r,n){let{gen:o,it:s}=t,{allErrors:c,schemaEnv:l,opts:u}=s,d=u.passContext?epe.default.this:cb.nil;n?f():h();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");let A=o.let("valid");o.try(()=>{o.code((0,cb._)`await ${(0,M$n.callValidateCode)(t,e,d)}`),g(e),c||o.assign(A,!0)},y=>{o.if((0,cb._)`!(${y} instanceof ${s.ValidationError})`,()=>o.throw(y)),m(y),c||o.assign(A,!1)}),t.ok(A)}a(f,"callAsyncRef");function h(){t.result((0,M$n.callValidateCode)(t,e,d),()=>g(e),()=>m(e))}a(h,"callSyncRef");function m(A){let y=(0,cb._)`${A}.errors`;o.assign(epe.default.vErrors,(0,cb._)`${epe.default.vErrors} === null ? ${y} : ${epe.default.vErrors}.concat(${y})`),o.assign(epe.default.errors,(0,cb._)`${epe.default.vErrors}.length`)}a(m,"addErrorsFrom");function g(A){var y;if(!s.opts.unevaluated)return;let E=(y=r?.validate)===null||y===void 0?void 0:y.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=Vst.mergeEvaluated.props(o,E.props,s.props));else{let _=o.var("props",(0,cb._)`${A}.evaluated.props`);s.props=Vst.mergeEvaluated.props(o,_,s.props,cb.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=Vst.mergeEvaluated.items(o,E.items,s.items));else{let _=o.var("items",(0,cb._)`${A}.evaluated.items`);s.items=Vst.mergeEvaluated.items(o,_,s.items,cb.Name)}}a(g,"addEvaluatedFrom")}a(Wst,"callRef");RZ.callRef=Wst;RZ.default=x8s});var F$n=I(ncr=>{"use strict";p();Object.defineProperty(ncr,"__esModule",{value:!0});var w8s=N$n(),R8s=L$n(),P8s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",w8s.default,R8s.default];ncr.default=P8s});var U$n=I(icr=>{"use strict";p();Object.defineProperty(icr,"__esModule",{value:!0});var zst=ps(),Qj=zst.operators,Yst={maximum:{okStr:"<=",ok:Qj.LTE,fail:Qj.GT},minimum:{okStr:">=",ok:Qj.GTE,fail:Qj.LT},exclusiveMaximum:{okStr:"<",ok:Qj.LT,fail:Qj.GTE},exclusiveMinimum:{okStr:">",ok:Qj.GT,fail:Qj.LTE}},k8s={message:a(({keyword:t,schemaCode:e})=>(0,zst.str)`must be ${Yst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,zst._)`{comparison: ${Yst[t].okStr}, limit: ${e}}`,"params")},D8s={keyword:Object.keys(Yst),type:"number",schemaType:"number",$data:!0,error:k8s,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,zst._)`${r} ${Yst[e].fail} ${n} || isNaN(${r})`)}};icr.default=D8s});var Q$n=I(ocr=>{"use strict";p();Object.defineProperty(ocr,"__esModule",{value:!0});var Gke=ps(),N8s={message:a(({schemaCode:t})=>(0,Gke.str)`must be multiple of ${t}`,"message"),params:a(({schemaCode:t})=>(0,Gke._)`{multipleOf: ${t}}`,"params")},M8s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:N8s,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,c=e.let("res"),l=s?(0,Gke._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${s}`:(0,Gke._)`${c} !== parseInt(${c})`;t.fail$data((0,Gke._)`(${n} === 0 || (${c} = ${r}/${n}, ${l}))`)}};ocr.default=M8s});var j$n=I(scr=>{"use strict";p();Object.defineProperty(scr,"__esModule",{value:!0});function q$n(t){let e=t.length,r=0,n=0,o;for(;n=55296&&o<=56319&&n{"use strict";p();Object.defineProperty(acr,"__esModule",{value:!0});var PZ=ps(),O8s=Wa(),B8s=j$n(),L8s={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,PZ.str)`must NOT have ${r} than ${e} characters`},params:a(({schemaCode:t})=>(0,PZ._)`{limit: ${t}}`,"params")},F8s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:L8s,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?PZ.operators.GT:PZ.operators.LT,c=o.opts.unicode===!1?(0,PZ._)`${r}.length`:(0,PZ._)`${(0,O8s.useFunc)(t.gen,B8s.default)}(${r})`;t.fail$data((0,PZ._)`${c} ${s} ${n}`)}};acr.default=F8s});var G$n=I(ccr=>{"use strict";p();Object.defineProperty(ccr,"__esModule",{value:!0});var U8s=xw(),Q8s=Wa(),tpe=ps(),q8s={message:a(({schemaCode:t})=>(0,tpe.str)`must match pattern "${t}"`,"message"),params:a(({schemaCode:t})=>(0,tpe._)`{pattern: ${t}}`,"params")},j8s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:q8s,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t,l=c.opts.unicodeRegExp?"u":"";if(n){let{regExp:u}=c.opts.code,d=u.code==="new RegExp"?(0,tpe._)`new RegExp`:(0,Q8s.useFunc)(e,u),f=e.let("valid");e.try(()=>e.assign(f,(0,tpe._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(f,!1)),t.fail$data((0,tpe._)`!${f}`)}else{let u=(0,U8s.usePattern)(t,o);t.fail$data((0,tpe._)`!${u}.test(${r})`)}}};ccr.default=j8s});var $$n=I(lcr=>{"use strict";p();Object.defineProperty(lcr,"__esModule",{value:!0});var $ke=ps(),H8s={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,$ke.str)`must NOT have ${r} than ${e} properties`},params:a(({schemaCode:t})=>(0,$ke._)`{limit: ${t}}`,"params")},G8s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:H8s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?$ke.operators.GT:$ke.operators.LT;t.fail$data((0,$ke._)`Object.keys(${r}).length ${o} ${n}`)}};lcr.default=G8s});var V$n=I(ucr=>{"use strict";p();Object.defineProperty(ucr,"__esModule",{value:!0});var Vke=xw(),Wke=ps(),$8s=Wa(),V8s={message:a(({params:{missingProperty:t}})=>(0,Wke.str)`must have required property '${t}'`,"message"),params:a(({params:{missingProperty:t}})=>(0,Wke._)`{missingProperty: ${t}}`,"params")},W8s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:V8s,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:c}=t,{opts:l}=c;if(!s&&r.length===0)return;let u=r.length>=l.loopRequired;if(c.allErrors?d():f(),l.strictRequired){let g=t.parentSchema.properties,{definedProperties:A}=t.it;for(let y of r)if(g?.[y]===void 0&&!A.has(y)){let E=c.schemaEnv.baseId+c.errSchemaPath,_=`required property "${y}" is not defined at "${E}" (strictRequired)`;(0,$8s.checkStrictMode)(c,_,c.opts.strictRequired)}}function d(){if(u||s)t.block$data(Wke.nil,h);else for(let g of r)(0,Vke.checkReportMissingProp)(t,g)}a(d,"allErrorsMode");function f(){let g=e.let("missing");if(u||s){let A=e.let("valid",!0);t.block$data(A,()=>m(g,A)),t.ok(A)}else e.if((0,Vke.checkMissingProp)(t,r,g)),(0,Vke.reportMissingProp)(t,g),e.else()}a(f,"exitOnErrorMode");function h(){e.forOf("prop",n,g=>{t.setParams({missingProperty:g}),e.if((0,Vke.noPropertyInData)(e,o,g,l.ownProperties),()=>t.error())})}a(h,"loopAllRequired");function m(g,A){t.setParams({missingProperty:g}),e.forOf(g,n,()=>{e.assign(A,(0,Vke.propertyInData)(e,o,g,l.ownProperties)),e.if((0,Wke.not)(A),()=>{t.error(),e.break()})},Wke.nil)}a(m,"loopUntilMissing")}};ucr.default=W8s});var W$n=I(dcr=>{"use strict";p();Object.defineProperty(dcr,"__esModule",{value:!0});var zke=ps(),z8s={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,zke.str)`must NOT have ${r} than ${e} items`},params:a(({schemaCode:t})=>(0,zke._)`{limit: ${t}}`,"params")},Y8s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:z8s,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?zke.operators.GT:zke.operators.LT;t.fail$data((0,zke._)`${r}.length ${o} ${n}`)}};dcr.default=Y8s});var Kst=I(fcr=>{"use strict";p();Object.defineProperty(fcr,"__esModule",{value:!0});var z$n=Oar();z$n.code='require("ajv/dist/runtime/equal").default';fcr.default=z$n});var Y$n=I(hcr=>{"use strict";p();Object.defineProperty(hcr,"__esModule",{value:!0});var pcr=Mke(),FA=ps(),K8s=Wa(),J8s=Kst(),Z8s={message:a(({params:{i:t,j:e}})=>(0,FA.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,"message"),params:a(({params:{i:t,j:e}})=>(0,FA._)`{i: ${t}, j: ${e}}`,"params")},X8s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Z8s,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:c,it:l}=t;if(!n&&!o)return;let u=e.let("valid"),d=s.items?(0,pcr.getSchemaTypes)(s.items):[];t.block$data(u,f,(0,FA._)`${c} === false`),t.ok(u);function f(){let A=e.let("i",(0,FA._)`${r}.length`),y=e.let("j");t.setParams({i:A,j:y}),e.assign(u,!0),e.if((0,FA._)`${A} > 1`,()=>(h()?m:g)(A,y))}a(f,"validateUniqueItems");function h(){return d.length>0&&!d.some(A=>A==="object"||A==="array")}a(h,"canOptimize");function m(A,y){let E=e.name("item"),_=(0,pcr.checkDataTypes)(d,E,l.opts.strictNumbers,pcr.DataType.Wrong),v=e.const("indices",(0,FA._)`{}`);e.for((0,FA._)`;${A}--;`,()=>{e.let(E,(0,FA._)`${r}[${A}]`),e.if(_,(0,FA._)`continue`),d.length>1&&e.if((0,FA._)`typeof ${E} == "string"`,(0,FA._)`${E} += "_"`),e.if((0,FA._)`typeof ${v}[${E}] == "number"`,()=>{e.assign(y,(0,FA._)`${v}[${E}]`),t.error(),e.assign(u,!1).break()}).code((0,FA._)`${v}[${E}] = ${A}`)})}a(m,"loopN");function g(A,y){let E=(0,K8s.useFunc)(e,J8s.default),_=e.name("outer");e.label(_).for((0,FA._)`;${A}--;`,()=>e.for((0,FA._)`${y} = ${A}; ${y}--;`,()=>e.if((0,FA._)`${E}(${r}[${A}], ${r}[${y}])`,()=>{t.error(),e.assign(u,!1).break(_)})))}a(g,"loopN2")}};hcr.default=X8s});var K$n=I(gcr=>{"use strict";p();Object.defineProperty(gcr,"__esModule",{value:!0});var mcr=ps(),e6s=Wa(),t6s=Kst(),r6s={message:"must be equal to constant",params:a(({schemaCode:t})=>(0,mcr._)`{allowedValue: ${t}}`,"params")},n6s={keyword:"const",$data:!0,error:r6s,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,mcr._)`!${(0,e6s.useFunc)(e,t6s.default)}(${r}, ${o})`):t.fail((0,mcr._)`${s} !== ${r}`)}};gcr.default=n6s});var J$n=I(Acr=>{"use strict";p();Object.defineProperty(Acr,"__esModule",{value:!0});var Yke=ps(),i6s=Wa(),o6s=Kst(),s6s={message:"must be equal to one of the allowed values",params:a(({schemaCode:t})=>(0,Yke._)`{allowedValues: ${t}}`,"params")},a6s={keyword:"enum",schemaType:"array",$data:!0,error:s6s,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:c}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let l=o.length>=c.opts.loopEnum,u,d=a(()=>u??(u=(0,i6s.useFunc)(e,o6s.default)),"getEql"),f;if(l||n)f=e.let("valid"),t.block$data(f,h);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let g=e.const("vSchema",s);f=(0,Yke.or)(...o.map((A,y)=>m(g,y)))}t.pass(f);function h(){e.assign(f,!1),e.forOf("v",s,g=>e.if((0,Yke._)`${d()}(${r}, ${g})`,()=>e.assign(f,!0).break()))}a(h,"loopEnum");function m(g,A){let y=o[A];return typeof y=="object"&&y!==null?(0,Yke._)`${d()}(${r}, ${g}[${A}])`:(0,Yke._)`${r} === ${y}`}a(m,"equalCode")}};Acr.default=a6s});var Z$n=I(ycr=>{"use strict";p();Object.defineProperty(ycr,"__esModule",{value:!0});var c6s=U$n(),l6s=Q$n(),u6s=H$n(),d6s=G$n(),f6s=$$n(),p6s=V$n(),h6s=W$n(),m6s=Y$n(),g6s=K$n(),A6s=J$n(),y6s=[c6s.default,l6s.default,u6s.default,d6s.default,f6s.default,p6s.default,h6s.default,m6s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g6s.default,A6s.default];ycr.default=y6s});var _cr=I(Kke=>{"use strict";p();Object.defineProperty(Kke,"__esModule",{value:!0});Kke.validateAdditionalItems=void 0;var kZ=ps(),Ecr=Wa(),E6s={message:a(({params:{len:t}})=>(0,kZ.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,kZ._)`{limit: ${t}}`,"params")},_6s={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:E6s,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Ecr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}X$n(t,n)}};function X$n(t,e){let{gen:r,schema:n,data:o,keyword:s,it:c}=t;c.items=!0;let l=r.const("len",(0,kZ._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,kZ._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Ecr.alwaysValidSchema)(c,n)){let d=r.var("valid",(0,kZ._)`${l} <= ${e.length}`);r.if((0,kZ.not)(d),()=>u(d)),t.ok(d)}function u(d){r.forRange("i",e.length,l,f=>{t.subschema({keyword:s,dataProp:f,dataPropType:Ecr.Type.Num},d),c.allErrors||r.if((0,kZ.not)(d),()=>r.break())})}a(u,"validateItems")}a(X$n,"validateAdditionalItems");Kke.validateAdditionalItems=X$n;Kke.default=_6s});var vcr=I(Jke=>{"use strict";p();Object.defineProperty(Jke,"__esModule",{value:!0});Jke.validateTuple=void 0;var eVn=ps(),Jst=Wa(),v6s=xw(),C6s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return tVn(t,"additionalItems",e);r.items=!0,!(0,Jst.alwaysValidSchema)(r,e)&&t.ok((0,v6s.validateArray)(t))}};function tVn(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:c,it:l}=t;f(o),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Jst.mergeEvaluated.items(n,r.length,l.items));let u=n.name("valid"),d=n.const("len",(0,eVn._)`${s}.length`);r.forEach((h,m)=>{(0,Jst.alwaysValidSchema)(l,h)||(n.if((0,eVn._)`${d} > ${m}`,()=>t.subschema({keyword:c,schemaProp:m,dataProp:m},u)),t.ok(u))});function f(h){let{opts:m,errSchemaPath:g}=l,A=r.length,y=A===h.minItems&&(A===h.maxItems||h[e]===!1);if(m.strictTuples&&!y){let E=`"${c}" is ${A}-tuple, but minItems or maxItems/${e} are not specified or different at path "${g}"`;(0,Jst.checkStrictMode)(l,E,m.strictTuples)}}a(f,"checkStrictTuple")}a(tVn,"validateTuple");Jke.validateTuple=tVn;Jke.default=C6s});var rVn=I(Ccr=>{"use strict";p();Object.defineProperty(Ccr,"__esModule",{value:!0});var b6s=vcr(),S6s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(t=>(0,b6s.validateTuple)(t,"items"),"code")};Ccr.default=S6s});var iVn=I(bcr=>{"use strict";p();Object.defineProperty(bcr,"__esModule",{value:!0});var nVn=ps(),T6s=Wa(),I6s=xw(),x6s=_cr(),w6s={message:a(({params:{len:t}})=>(0,nVn.str)`must NOT have more than ${t} items`,"message"),params:a(({params:{len:t}})=>(0,nVn._)`{limit: ${t}}`,"params")},R6s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:w6s,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,T6s.alwaysValidSchema)(n,e)&&(o?(0,x6s.validateAdditionalItems)(t,o):t.ok((0,I6s.validateArray)(t)))}};bcr.default=R6s});var oVn=I(Scr=>{"use strict";p();Object.defineProperty(Scr,"__esModule",{value:!0});var Rw=ps(),Zst=Wa(),P6s={message:a(({params:{min:t,max:e}})=>e===void 0?(0,Rw.str)`must contain at least ${t} valid item(s)`:(0,Rw.str)`must contain at least ${t} and no more than ${e} valid item(s)`,"message"),params:a(({params:{min:t,max:e}})=>e===void 0?(0,Rw._)`{minContains: ${t}}`:(0,Rw._)`{minContains: ${t}, maxContains: ${e}}`,"params")},k6s={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:P6s,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,c,l,{minContains:u,maxContains:d}=n;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=e.const("len",(0,Rw._)`${o}.length`);if(t.setParams({min:c,max:l}),l===void 0&&c===0){(0,Zst.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&c>l){(0,Zst.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Zst.alwaysValidSchema)(s,r)){let y=(0,Rw._)`${f} >= ${c}`;l!==void 0&&(y=(0,Rw._)`${y} && ${f} <= ${l}`),t.pass(y);return}s.items=!0;let h=e.name("valid");l===void 0&&c===1?g(h,()=>e.if(h,()=>e.break())):c===0?(e.let(h,!0),l!==void 0&&e.if((0,Rw._)`${o}.length > 0`,m)):(e.let(h,!1),m()),t.result(h,()=>t.reset());function m(){let y=e.name("_valid"),E=e.let("count",0);g(y,()=>e.if(y,()=>A(E)))}a(m,"validateItemsWithCount");function g(y,E){e.forRange("i",0,f,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:Zst.Type.Num,compositeRule:!0},y),E()})}a(g,"validateItems");function A(y){e.code((0,Rw._)`${y}++`),l===void 0?e.if((0,Rw._)`${y} >= ${c}`,()=>e.assign(h,!0).break()):(e.if((0,Rw._)`${y} > ${l}`,()=>e.assign(h,!1).break()),c===1?e.assign(h,!0):e.if((0,Rw._)`${y} >= ${c}`,()=>e.assign(h,!0)))}a(A,"checkLimits")}};Scr.default=k6s});var cVn=I(p5=>{"use strict";p();Object.defineProperty(p5,"__esModule",{value:!0});p5.validateSchemaDeps=p5.validatePropertyDeps=p5.error=void 0;var Tcr=ps(),D6s=Wa(),Zke=xw();p5.error={message:a(({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Tcr.str)`must have ${n} ${r} when property ${t} is present`},"message"),params:a(({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Tcr._)`{property: ${t}, missingProperty: ${n}, depsCount: ${e}, - deps: ${r}}`,"params")};var q6s={keyword:"dependencies",type:"object",schemaType:"object",error:g5.error,code(t){let[e,r]=j6s(t);VGn(t,e),WGn(t,r)}};function j6s({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}a(j6s,"splitDependencies");function VGn(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let c in e){let l=e[c];if(l.length===0)continue;let u=(0,t2e.propertyInData)(r,n,c,o.opts.ownProperties);t.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),o.allErrors?r.if(u,()=>{for(let d of l)(0,t2e.checkReportMissingProp)(t,d)}):(r.if((0,Yar._)`${u} && (${(0,t2e.checkMissingProp)(t,l,s)})`),(0,t2e.reportMissingProp)(t,s),r.else())}}a(VGn,"validatePropertyDeps");g5.validatePropertyDeps=VGn;function WGn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,Q6s.alwaysValidSchema)(s,e[l])||(r.if((0,t2e.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(WGn,"validateSchemaDeps");g5.validateSchemaDeps=WGn;g5.default=q6s});var KGn=I(Kar=>{"use strict";p();Object.defineProperty(Kar,"__esModule",{value:!0});var YGn=hs(),H6s=za(),G6s={message:"property name must be valid",params:a(({params:t})=>(0,YGn._)`{propertyName: ${t.propertyName}}`,"params")},$6s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:G6s,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,H6s.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,YGn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Kar.default=$6s});var Zar=I(Jar=>{"use strict";p();Object.defineProperty(Jar,"__esModule",{value:!0});var Vst=ww(),c2=hs(),V6s=NF(),Wst=za(),W6s={message:"must NOT have additional properties",params:a(({params:t})=>(0,c2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},z6s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:W6s,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,Wst.alwaysValidSchema)(c,r))return;let d=(0,Vst.allSchemaProperties)(n.properties),f=(0,Vst.allSchemaProperties)(n.patternProperties);h(),t.ok((0,c2._)`${s} === ${V6s.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,Wst.schemaRefOrVal)(c,n.properties,"properties");_=(0,Vst.isOwnProperty)(e,v,E)}else d.length?_=(0,c2.or)(...d.map(v=>(0,c2._)`${E} === ${v}`)):_=c2.nil;return f.length&&(_=(0,c2.or)(_,...f.map(v=>(0,c2._)`${(0,Vst.usePattern)(t,v)}.test(${E})`))),(0,c2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,c2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Wst.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,c2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,c2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:Wst.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};Jar.default=z6s});var XGn=I(ecr=>{"use strict";p();Object.defineProperty(ecr,"__esModule",{value:!0});var Y6s=qPe(),JGn=ww(),Xar=za(),ZGn=Zar(),K6s={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&ZGn.default.code(new Y6s.KeywordCxt(s,ZGn.default,"additionalProperties"));let c=(0,JGn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Xar.mergeEvaluated.props(e,(0,Xar.toHash)(c),s.props));let l=c.filter(h=>!(0,Xar.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,JGn.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};ecr.default=K6s});var n$n=I(tcr=>{"use strict";p();Object.defineProperty(tcr,"__esModule",{value:!0});var e$n=ww(),zst=hs(),t$n=za(),r$n=za(),J6s={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,e$n.allSchemaProperties)(r),u=l.filter(y=>(0,t$n.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof zst.Name)&&(s.props=(0,r$n.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let E in d)new RegExp(y).test(E)&&(0,t$n.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,zst._)`${(0,e$n.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:r$n.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,zst._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,zst.not)(f),()=>e.break())})})}a(A,"validateProperties")}};tcr.default=J6s});var i$n=I(rcr=>{"use strict";p();Object.defineProperty(rcr,"__esModule",{value:!0});var Z6s=za(),X6s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,Z6s.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};rcr.default=X6s});var o$n=I(ncr=>{"use strict";p();Object.defineProperty(ncr,"__esModule",{value:!0});var e9s=ww(),t9s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e9s.validateUnion,error:{message:"must match a schema in anyOf"}};ncr.default=t9s});var s$n=I(icr=>{"use strict";p();Object.defineProperty(icr,"__esModule",{value:!0});var Yst=hs(),r9s=za(),n9s={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,Yst._)`{passingSchemas: ${t.passing}}`,"params")},i9s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n9s,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,r9s.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,Yst._)`${u} && ${c}`).assign(c,!1).assign(l,(0,Yst._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,Yst.Name)})})}a(d,"validateOneOf")}};icr.default=i9s});var a$n=I(ocr=>{"use strict";p();Object.defineProperty(ocr,"__esModule",{value:!0});var o9s=za(),s9s={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,o9s.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};ocr.default=s9s});var u$n=I(scr=>{"use strict";p();Object.defineProperty(scr,"__esModule",{value:!0});var Kst=hs(),l$n=za(),a9s={message:a(({params:t})=>(0,Kst.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,Kst._)`{failingKeyword: ${t.ifClause}}`,"params")},c9s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:a9s,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,l$n.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=c$n(n,"then"),s=c$n(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,Kst.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,Kst._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function c$n(t,e){let r=t.schema[e];return r!==void 0&&!(0,l$n.alwaysValidSchema)(t,r)}a(c$n,"hasSchema");scr.default=c9s});var d$n=I(acr=>{"use strict";p();Object.defineProperty(acr,"__esModule",{value:!0});var l9s=za(),u9s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,l9s.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};acr.default=u9s});var f$n=I(ccr=>{"use strict";p();Object.defineProperty(ccr,"__esModule",{value:!0});var d9s=Gar(),f9s=jGn(),p9s=$ar(),h9s=GGn(),m9s=$Gn(),g9s=zGn(),A9s=KGn(),y9s=Zar(),E9s=XGn(),_9s=n$n(),C9s=i$n(),v9s=o$n(),b9s=s$n(),S9s=a$n(),T9s=u$n(),I9s=d$n();function x9s(t=!1){let e=[C9s.default,v9s.default,b9s.default,S9s.default,T9s.default,I9s.default,A9s.default,y9s.default,g9s.default,E9s.default,_9s.default];return t?e.push(f9s.default,h9s.default):e.push(d9s.default,p9s.default),e.push(m9s.default),e}a(x9s,"getApplicator");ccr.default=x9s});var p$n=I(lcr=>{"use strict";p();Object.defineProperty(lcr,"__esModule",{value:!0});var Zp=hs(),w9s={message:a(({schemaCode:t})=>(0,Zp.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,Zp._)`{format: ${t}}`,"params")},R9s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:w9s,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,Zp._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,Zp._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,Zp._)`${y}.type || "string"`).assign(_,(0,Zp._)`${y}.validate`),()=>r.assign(E,(0,Zp._)`"string"`).assign(_,y)),t.fail$data((0,Zp.or)(v(),b()));function v(){return u.strictSchema===!1?Zp.nil:(0,Zp._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,Zp._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Zp._)`${_}(${n})`,w=(0,Zp._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,Zp._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function b(w){let R=w instanceof RegExp?(0,Zp.regexpCode)(w):u.code.formats?(0,Zp._)`${u.code.formats}${(0,Zp.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,Zp._)`${x}.validate`]:["string",w,x]}a(b,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,Zp._)`await ${_}(${n})`}return typeof E=="function"?(0,Zp._)`${_}(${n})`:(0,Zp._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};lcr.default=R9s});var h$n=I(ucr=>{"use strict";p();Object.defineProperty(ucr,"__esModule",{value:!0});var k9s=p$n(),P9s=[k9s.default];ucr.default=P9s});var m$n=I(rpe=>{"use strict";p();Object.defineProperty(rpe,"__esModule",{value:!0});rpe.contentVocabulary=rpe.metadataVocabulary=void 0;rpe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rpe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var A$n=I(dcr=>{"use strict";p();Object.defineProperty(dcr,"__esModule",{value:!0});var D9s=SGn(),N9s=FGn(),M9s=f$n(),O9s=h$n(),g$n=m$n(),B9s=[D9s.default,N9s.default,(0,M9s.default)(),O9s.default,g$n.metadataVocabulary,g$n.contentVocabulary];dcr.default=B9s});var E$n=I(Jst=>{"use strict";p();Object.defineProperty(Jst,"__esModule",{value:!0});Jst.DiscrError=void 0;var y$n;(function(t){t.Tag="tag",t.Mapping="mapping"})(y$n||(Jst.DiscrError=y$n={}))});var C$n=I(pcr=>{"use strict";p();Object.defineProperty(pcr,"__esModule",{value:!0});var npe=hs(),fcr=E$n(),_$n=Mst(),L9s=jPe(),F9s=za(),U9s={message:a(({params:{discrError:t,tagName:e}})=>t===fcr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,npe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},Q9s={keyword:"discriminator",type:"object",schemaType:"object",error:U9s,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,npe._)`${r}${(0,npe.getProperty)(l)}`);e.if((0,npe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:fcr.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,npe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:fcr.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,npe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{q9s.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var mcr=I((od,hcr)=>{"use strict";p();Object.defineProperty(od,"__esModule",{value:!0});od.MissingRefError=od.ValidationError=od.CodeGen=od.Name=od.nil=od.stringify=od.str=od._=od.KeywordCxt=od.Ajv=void 0;var j9s=yGn(),H9s=A$n(),G9s=C$n(),b$n=v$n(),$9s=["/properties"],Zst="http://json-schema.org/draft-07/schema",ipe=class extends j9s.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),H9s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(G9s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(b$n,$9s):b$n;this.addMetaSchema(e,Zst,!1),this.refs["http://json-schema.org/schema"]=Zst}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Zst)?Zst:void 0)}};od.Ajv=ipe;hcr.exports=od=ipe;hcr.exports.Ajv=ipe;Object.defineProperty(od,"__esModule",{value:!0});od.default=ipe;var V9s=qPe();Object.defineProperty(od,"KeywordCxt",{enumerable:!0,get:a(function(){return V9s.KeywordCxt},"get")});var ope=hs();Object.defineProperty(od,"_",{enumerable:!0,get:a(function(){return ope._},"get")});Object.defineProperty(od,"str",{enumerable:!0,get:a(function(){return ope.str},"get")});Object.defineProperty(od,"stringify",{enumerable:!0,get:a(function(){return ope.stringify},"get")});Object.defineProperty(od,"nil",{enumerable:!0,get:a(function(){return ope.nil},"get")});Object.defineProperty(od,"Name",{enumerable:!0,get:a(function(){return ope.Name},"get")});Object.defineProperty(od,"CodeGen",{enumerable:!0,get:a(function(){return ope.CodeGen},"get")});var W9s=Dst();Object.defineProperty(od,"ValidationError",{enumerable:!0,get:a(function(){return W9s.default},"get")});var z9s=jPe();Object.defineProperty(od,"MissingRefError",{enumerable:!0,get:a(function(){return z9s.default},"get")})});var P$n=I(y5=>{"use strict";p();Object.defineProperty(y5,"__esModule",{value:!0});y5.formatNames=y5.fastFormats=y5.fullFormats=void 0;function A5(t,e){return{validate:t,compare:e}}a(A5,"fmtDef");y5.fullFormats={date:A5(x$n,Ecr),time:A5(Acr(!0),_cr),"date-time":A5(S$n(!0),R$n),"iso-time":A5(Acr(),w$n),"iso-date-time":A5(S$n(),k$n),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:eUs,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:aUs,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:tUs,int32:{type:"number",validate:iUs},int64:{type:"number",validate:oUs},float:{type:"number",validate:I$n},double:{type:"number",validate:I$n},password:!0,binary:!0};y5.fastFormats={...y5.fullFormats,date:A5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ecr),time:A5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_cr),"date-time":A5(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,R$n),"iso-time":A5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w$n),"iso-date-time":A5(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,k$n),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};y5.formatNames=Object.keys(y5.fullFormats);function Y9s(t){return t%4===0&&(t%100!==0||t%400===0)}a(Y9s,"isLeapYear");var K9s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,J9s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function x$n(t){let e=K9s.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&Y9s(r)?29:J9s[n])}a(x$n,"date");function Ecr(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(Acr,"getTime");function _cr(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(_cr,"compareTime");function w$n(t,e){if(!(t&&e))return;let r=gcr.exec(t),n=gcr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=rUs}a(iUs,"validateInt32");function oUs(t){return Number.isInteger(t)}a(oUs,"validateInt64");function I$n(){return!0}a(I$n,"validateNumber");var sUs=/[^\\]\\Z/;function aUs(t){if(sUs.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(aUs,"regex")});var D$n=I(spe=>{"use strict";p();Object.defineProperty(spe,"__esModule",{value:!0});spe.formatLimitDefinition=void 0;var cUs=mcr(),l2=hs(),$j=l2.operators,Xst={formatMaximum:{okStr:"<=",ok:$j.LTE,fail:$j.GT},formatMinimum:{okStr:">=",ok:$j.GTE,fail:$j.LT},formatExclusiveMaximum:{okStr:"<",ok:$j.LT,fail:$j.GTE},formatExclusiveMinimum:{okStr:">",ok:$j.GT,fail:$j.LTE}},lUs={message:a(({keyword:t,schemaCode:e})=>(0,l2.str)`should be ${Xst[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,l2._)`{comparison: ${Xst[t].okStr}, limit: ${e}}`,"params")};spe.formatLimitDefinition={keyword:Object.keys(Xst),type:"string",schemaType:"string",$data:!0,error:lUs,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new cUs.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,l2._)`${m}[${u.schemaCode}]`);t.fail$data((0,l2.or)((0,l2._)`typeof ${g} != "object"`,(0,l2._)`${g} instanceof RegExp`,(0,l2._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,l2._)`${c.code.formats}${(0,l2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,l2._)`${m}.compare(${r}, ${n}) ${Xst[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var uUs=a(t=>(t.addKeyword(spe.formatLimitDefinition),t),"formatLimitPlugin");spe.default=uUs});var B$n=I((r2e,O$n)=>{"use strict";p();Object.defineProperty(r2e,"__esModule",{value:!0});var ape=P$n(),dUs=D$n(),Ccr=hs(),N$n=new Ccr.Name("fullFormats"),fUs=new Ccr.Name("fastFormats"),vcr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return M$n(t,e,ape.fullFormats,N$n),t;let[r,n]=e.mode==="fast"?[ape.fastFormats,fUs]:[ape.fullFormats,N$n],o=e.formats||ape.formatNames;return M$n(t,o,r,n),e.keywords&&(0,dUs.default)(t),t},"formatsPlugin");vcr.get=(t,e="full")=>{let n=(e==="fast"?ape.fastFormats:ape.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function M$n(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Ccr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(M$n,"addFormats");O$n.exports=r2e=vcr;Object.defineProperty(r2e,"__esModule",{value:!0});r2e.default=vcr});var lVn=I((vAf,cVn)=>{p();cVn.exports=aVn;aVn.sync=vUs;var oVn=require("fs");function CUs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();pVn.exports=dVn;dVn.sync=bUs;var uVn=require("fs");function dVn(t,e,r){uVn.stat(t,function(n,o){r(n,n?!1:fVn(o,e))})}a(dVn,"isexe");function bUs(t,e){return fVn(uVn.statSync(t),e)}a(bUs,"sync");function fVn(t,e){return t.isFile()&&SUs(t,e)}a(fVn,"checkStat");function SUs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(SUs,"checkMode")});var gVn=I((RAf,mVn)=>{p();var wAf=require("fs"),hat;process.platform==="win32"||global.TESTING_WINDOWS?hat=lVn():hat=hVn();mVn.exports=Fcr;Fcr.sync=TUs;function Fcr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Fcr(t,e||{},function(s,c){s?o(s):n(c)})})}hat(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(Fcr,"isexe");function TUs(t,e){try{return hat.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(TUs,"sync")});var bVn=I((DAf,vVn)=>{p();var ype=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",AVn=require("path"),IUs=ype?";":":",yVn=gVn(),EVn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),_Vn=a((t,e)=>{let r=e.colon||IUs,n=t.match(/\//)||ype&&t.match(/\\/)?[""]:[...ype?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=ype?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=ype?o.split(r):[""];return ype&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),CVn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=_Vn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(EVn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=AVn.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];yVn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),xUs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=_Vn(t,e),s=[];for(let c=0;c{"use strict";p();var SVn=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");Ucr.exports=SVn;Ucr.exports.default=SVn});var RVn=I((FAf,wVn)=>{"use strict";p();var IVn=require("path"),wUs=bVn(),RUs=TVn();function xVn(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=wUs.sync(t.command,{path:r[RUs({env:r})],pathExt:e?IVn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=IVn.resolve(o?t.options.cwd:"",c)),c}a(xVn,"resolveCommandAttempt");function kUs(t){return xVn(t)||xVn(t,!0)}a(kUs,"resolveCommand");wVn.exports=kUs});var kVn=I((qAf,qcr)=>{"use strict";p();var Qcr=/([()\][%!^"`<>&|;, *?])/g;function PUs(t){return t=t.replace(Qcr,"^$1"),t}a(PUs,"escapeCommand");function DUs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Qcr,"^$1"),e&&(t=t.replace(Qcr,"^$1")),t}a(DUs,"escapeArgument");qcr.exports.command=PUs;qcr.exports.argument=DUs});var DVn=I((GAf,PVn)=>{"use strict";p();PVn.exports=/^#!(.*)/});var MVn=I((VAf,NVn)=>{"use strict";p();var NUs=DVn();NVn.exports=(t="")=>{let e=t.match(NUs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var BVn=I((zAf,OVn)=>{"use strict";p();var jcr=require("fs"),MUs=MVn();function OUs(t){let r=Buffer.alloc(150),n;try{n=jcr.openSync(t,"r"),jcr.readSync(n,r,0,150,0),jcr.closeSync(n)}catch{}return MUs(r.toString())}a(OUs,"readShebang");OVn.exports=OUs});var QVn=I((JAf,UVn)=>{"use strict";p();var BUs=require("path"),LVn=RVn(),FVn=kVn(),LUs=BVn(),FUs=process.platform==="win32",UUs=/\.(?:com|exe)$/i,QUs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qUs(t){t.file=LVn(t);let e=t.file&&LUs(t.file);return e?(t.args.unshift(t.file),t.command=e,LVn(t)):t.file}a(qUs,"detectShebang");function jUs(t){if(!FUs)return t;let e=qUs(t),r=!UUs.test(e);if(t.options.forceShell||r){let n=QUs.test(e);t.command=BUs.normalize(t.command),t.command=FVn.command(t.command),t.args=t.args.map(s=>FVn.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(jUs,"parseNonShell");function HUs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:jUs(n)}a(HUs,"parse");UVn.exports=HUs});var HVn=I((eyf,jVn)=>{"use strict";p();var Hcr=process.platform==="win32";function Gcr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(Gcr,"notFoundError");function GUs(t,e){if(!Hcr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=qVn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(GUs,"hookChildProcess");function qVn(t,e){return Hcr&&t===1&&!e.file?Gcr(e.original,"spawn"):null}a(qVn,"verifyENOENT");function $Us(t,e){return Hcr&&t===1&&!e.file?Gcr(e.original,"spawnSync"):null}a($Us,"verifyENOENTSync");jVn.exports={hookChildProcess:GUs,verifyENOENT:qVn,verifyENOENTSync:$Us,notFoundError:Gcr}});var VVn=I((nyf,Epe)=>{"use strict";p();var GVn=require("child_process"),$cr=QVn(),Vcr=HVn();function $Vn(t,e,r){let n=$cr(t,e,r),o=GVn.spawn(n.command,n.args,n.options);return Vcr.hookChildProcess(o,n),o}a($Vn,"spawn");function VUs(t,e,r){let n=$cr(t,e,r),o=GVn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Vcr.verifyENOENTSync(o.status,n),o}a(VUs,"spawnSync");Epe.exports=$Vn;Epe.exports.spawn=$Vn;Epe.exports.sync=VUs;Epe.exports._parse=$cr;Epe.exports._enoent=Vcr});var rWn,nWn=me(()=>{p();rWn=typeof globalThis=="object"?globalThis:global});var iWn=me(()=>{p();nWn()});var oWn=me(()=>{p();iWn()});var LF,Kcr=me(()=>{p();LF="1.9.0"});function i7s(t){var e=new Set([t]),r=new Set,n=t.match(sWn);if(!n)return function(){return!1};var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(o.prerelease!=null)return a(function(u){return u===t},"isExactmatch");function s(l){return r.add(l),!1}a(s,"_reject");function c(l){return e.add(l),!0}return a(c,"_accept"),a(function(u){if(e.has(u))return!0;if(r.has(u))return!1;var d=u.match(sWn);if(!d)return s(u);var f={major:+d[1],minor:+d[2],patch:+d[3],prerelease:d[4]};return f.prerelease!=null||o.major!==f.major?s(u):o.major===0?o.minor===f.minor&&o.patch<=f.patch?c(u):s(u):o.minor<=f.minor?c(u):s(u)},"isCompatible")}var sWn,aWn,cWn=me(()=>{p();Kcr();sWn=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;a(i7s,"_makeCompatibilityCheck");aWn=i7s(LF)});function _5(t,e,r,n){var o;n===void 0&&(n=!1);var s=d2e[u2e]=(o=d2e[u2e])!==null&&o!==void 0?o:{version:LF};if(!n&&s[t]){var c=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+t);return r.error(c.stack||c.message),!1}if(s.version!==LF){var c=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+t+" does not match previously registered API v"+LF);return r.error(c.stack||c.message),!1}return s[t]=e,r.debug("@opentelemetry/api: Registered a global for "+t+" v"+LF+"."),!0}function AT(t){var e,r,n=(e=d2e[u2e])===null||e===void 0?void 0:e.version;if(!(!n||!aWn(n)))return(r=d2e[u2e])===null||r===void 0?void 0:r[t]}function C5(t,e){e.debug("@opentelemetry/api: Unregistering a global for "+t+" v"+LF+".");var r=d2e[u2e];r&&delete r[t]}var o7s,u2e,d2e,jZ=me(()=>{p();oWn();Kcr();cWn();o7s=LF.split(".")[0],u2e=Symbol.for("opentelemetry.js.api."+o7s),d2e=rWn;a(_5,"registerGlobal");a(AT,"getGlobal");a(C5,"unregisterGlobal")});function f2e(t,e,r){var n=AT("diag");if(n)return r.unshift(e),n[t].apply(n,a7s([],s7s(r),!1))}var s7s,a7s,lWn,uWn=me(()=>{p();jZ();s7s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},a7s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(Da||(Da={}))});function dWn(t,e){tDa.ALL&&(t=Da.ALL),e=e||{};function r(n,o){var s=e[n];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return a(r,"_filterFunc"),{error:r("error",Da.ERROR),warn:r("warn",Da.WARN),info:r("info",Da.INFO),debug:r("debug",Da.DEBUG),verbose:r("verbose",Da.VERBOSE)}}var fWn=me(()=>{p();Eat();a(dWn,"createLogLevelDiagLogger")});var c7s,l7s,u7s,uE,HZ=me(()=>{p();uWn();fWn();Eat();jZ();c7s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},l7s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n";f.warn("Current logger will be overwritten from "+m),h.warn("Current logger will overwrite one already registered from "+m)}return _5("diag",h,r,!0)},"setLogger");r.setLogger=n,r.disable=function(){C5(u7s,r)},r.createComponentLogger=function(o){return new lWn(o)},r.verbose=e("verbose"),r.debug=e("debug"),r.info=e("info"),r.warn=e("warn"),r.error=e("error")}return a(t,"DiagAPI"),t.instance=function(){return this._instance||(this._instance=new t),this._instance},t})()});var d7s,f7s,pWn,hWn=me(()=>{p();d7s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},f7s=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pWn=(function(){function t(e){this._entries=e?new Map(e):new Map}return a(t,"BaggageImpl"),t.prototype.getEntry=function(e){var r=this._entries.get(e);if(r)return Object.assign({},r)},t.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var r=d7s(e,2),n=r[0],o=r[1];return[n,o]})},t.prototype.setEntry=function(e,r){var n=new t(this._entries);return n._entries.set(e,r),n},t.prototype.removeEntry=function(e){var r=new t(this._entries);return r._entries.delete(e),r},t.prototype.removeEntries=function(){for(var e,r,n=[],o=0;o{p();mWn=Symbol("BaggageEntryMetadata")});function AWn(t){return t===void 0&&(t={}),new pWn(new Map(Object.entries(t)))}function Cpe(t){return typeof t!="string"&&(p7s.error("Cannot create baggage metadata from unknown type: "+typeof t),t=""),{__TYPE__:mWn,toString:a(function(){return t},"toString")}}var p7s,Jcr=me(()=>{p();HZ();hWn();gWn();p7s=uE.instance();a(AWn,"createBaggage");a(Cpe,"baggageEntryMetadataFromString")});function hb(t){return Symbol.for(t)}var h7s,_at,p2e=me(()=>{p();a(hb,"createContextKey");h7s=(function(){function t(e){var r=this;r._currentContext=e?new Map(e):new Map,r.getValue=function(n){return r._currentContext.get(n)},r.setValue=function(n,o){var s=new t(r._currentContext);return s._currentContext.set(n,o),s},r.deleteValue=function(n){var o=new t(r._currentContext);return o._currentContext.delete(n),o}}return a(t,"BaseContext"),t})(),_at=new h7s});var Zcr,yWn,EWn=me(()=>{p();Zcr=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],yWn=(function(){function t(){function e(n){return function(){for(var o=[],s=0;s{p();GZ=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),m7s=(function(){function t(){}return a(t,"NoopMeter"),t.prototype.createGauge=function(e,r){return S7s},t.prototype.createHistogram=function(e,r){return T7s},t.prototype.createCounter=function(e,r){return b7s},t.prototype.createUpDownCounter=function(e,r){return I7s},t.prototype.createObservableGauge=function(e,r){return w7s},t.prototype.createObservableCounter=function(e,r){return x7s},t.prototype.createObservableUpDownCounter=function(e,r){return R7s},t.prototype.addBatchObservableCallback=function(e,r){},t.prototype.removeBatchObservableCallback=function(e){},t})(),Cat=(function(){function t(){}return a(t,"NoopMetric"),t})(),g7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),A7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopUpDownCounterMetric"),e.prototype.add=function(r,n){},e})(Cat),y7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopGaugeMetric"),e.prototype.record=function(r,n){},e})(Cat),E7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopHistogramMetric"),e.prototype.record=function(r,n){},e})(Cat),Xcr=(function(){function t(){}return a(t,"NoopObservableMetric"),t.prototype.addCallback=function(e){},t.prototype.removeCallback=function(e){},t})(),_7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableCounterMetric"),e})(Xcr),C7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableGaugeMetric"),e})(Xcr),v7s=(function(t){GZ(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NoopObservableUpDownCounterMetric"),e})(Xcr),elr=new m7s,b7s=new g7s,S7s=new y7s,T7s=new E7s,I7s=new A7s,x7s=new _7s,w7s=new C7s,R7s=new v7s;a(_Wn,"createNoopMeter")});var vat,CWn=me(()=>{p();(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(vat||(vat={}))});var bat,Sat,rlr=me(()=>{p();bat={get:a(function(t,e){if(t!=null)return t[e]},"get"),keys:a(function(t){return t==null?[]:Object.keys(t)},"keys")},Sat={set:a(function(t,e,r){t!=null&&(t[e]=r)},"set")}});var k7s,P7s,vWn,bWn=me(()=>{p();p2e();k7s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},P7s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();bWn();jZ();HZ();D7s=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},N7s=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(yf||(yf={}))});var m2e,g2e,vpe,Tat=me(()=>{p();ilr();m2e="0000000000000000",g2e="00000000000000000000000000000000",vpe={traceId:g2e,spanId:m2e,traceFlags:yf.NONE}});var Kj,Iat=me(()=>{p();Tat();Kj=(function(){function t(e){e===void 0&&(e=vpe),this._spanContext=e}return a(t,"NonRecordingSpan"),t.prototype.spanContext=function(){return this._spanContext},t.prototype.setAttribute=function(e,r){return this},t.prototype.setAttributes=function(e){return this},t.prototype.addEvent=function(e,r){return this},t.prototype.addLink=function(e){return this},t.prototype.addLinks=function(e){return this},t.prototype.setStatus=function(e){return this},t.prototype.updateName=function(e){return this},t.prototype.end=function(e){},t.prototype.isRecording=function(){return!1},t.prototype.recordException=function(e,r){},t})()});function xat(t){return t.getValue(olr)||void 0}function SWn(){return xat(Yj.getInstance().active())}function A2e(t,e){return t.setValue(olr,e)}function TWn(t){return t.deleteValue(olr)}function IWn(t,e){return A2e(t,new Kj(e))}function wat(t){var e;return(e=xat(t))===null||e===void 0?void 0:e.spanContext()}var olr,slr=me(()=>{p();p2e();Iat();h2e();olr=hb("OpenTelemetry Context Key SPAN");a(xat,"getSpan");a(SWn,"getActiveSpan");a(A2e,"setSpan");a(TWn,"deleteSpan");a(IWn,"setSpanContext");a(wat,"getSpanContext")});function $Z(t){return O7s.test(t)&&t!==g2e}function alr(t){return B7s.test(t)&&t!==m2e}function mb(t){return $Z(t.traceId)&&alr(t.spanId)}function xWn(t){return new Kj(t)}var O7s,B7s,Rat=me(()=>{p();Tat();Iat();O7s=/^([0-9a-f]{32})$/i,B7s=/^[0-9a-f]{16}$/i;a($Z,"isValidTraceId");a(alr,"isValidSpanId");a(mb,"isSpanContextValid");a(xWn,"wrapSpanContext")});function L7s(t){return typeof t=="object"&&typeof t.spanId=="string"&&typeof t.traceId=="string"&&typeof t.traceFlags=="number"}var clr,kat,llr=me(()=>{p();h2e();slr();Iat();Rat();clr=Yj.getInstance(),kat=(function(){function t(){}return a(t,"NoopTracer"),t.prototype.startSpan=function(e,r,n){n===void 0&&(n=clr.active());var o=!!r?.root;if(o)return new Kj;var s=n&&wat(n);return L7s(s)&&mb(s)?new Kj(s):new Kj},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??clr.active(),d=this.startSpan(e,s,u),f=A2e(u,d);return clr.with(f,l,void 0,d)}},t})();a(L7s,"isSpanContext")});var F7s,Pat,ulr=me(()=>{p();llr();F7s=new kat,Pat=(function(){function t(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}return a(t,"ProxyTracer"),t.prototype.startSpan=function(e,r,n){return this._getTracer().startSpan(e,r,n)},t.prototype.startActiveSpan=function(e,r,n,o){var s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)},t.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):F7s},t})()});var wWn,RWn=me(()=>{p();llr();wWn=(function(){function t(){}return a(t,"NoopTracerProvider"),t.prototype.getTracer=function(e,r,n){return new kat},t})()});var U7s,y2e,dlr=me(()=>{p();ulr();RWn();U7s=new wWn,y2e=(function(){function t(){}return a(t,"ProxyTracerProvider"),t.prototype.getTracer=function(e,r,n){var o;return(o=this.getDelegateTracer(e,r,n))!==null&&o!==void 0?o:new Pat(this,e,r,n)},t.prototype.getDelegate=function(){var e;return(e=this._delegate)!==null&&e!==void 0?e:U7s},t.prototype.setDelegate=function(e){this._delegate=e},t.prototype.getDelegateTracer=function(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,r,n)},t})()});var gb,kWn=me(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(gb||(gb={}))});var bpe,PWn=me(()=>{p();(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(bpe||(bpe={}))});var Spe,DWn=me(()=>{p();(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(Spe||(Spe={}))});function NWn(t){return j7s.test(t)}function MWn(t){return H7s.test(t)&&!G7s.test(t)}var flr,Q7s,q7s,j7s,H7s,G7s,OWn=me(()=>{p();flr="[_0-9a-z-*/]",Q7s="[a-z]"+flr+"{0,255}",q7s="[a-z0-9]"+flr+"{0,240}@[a-z]"+flr+"{0,13}",j7s=new RegExp("^(?:"+Q7s+"|"+q7s+")$"),H7s=/^[ -~]{0,255}[!-~]$/,G7s=/,|=/;a(NWn,"validateKey");a(MWn,"validateValue")});var BWn,$7s,LWn,FWn,UWn,QWn=me(()=>{p();OWn();BWn=32,$7s=512,LWn=",",FWn="=",UWn=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceStateImpl"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+FWn+e.get(n)),r},[]).join(LWn)},t.prototype._parse=function(e){e.length>$7s||(this._internalState=e.split(LWn).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(FWn);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);NWn(c)&&MWn(l)&&r.set(c,l)}return r},new Map),this._internalState.size>BWn&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BWn))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function qWn(t){return new UWn(t)}var jWn=me(()=>{p();QWn();a(qWn,"createTraceState")});var _g,HWn=me(()=>{p();h2e();_g=Yj.getInstance()});var kn,GWn=me(()=>{p();HZ();kn=uE.instance()});var V7s,$Wn,VWn=me(()=>{p();tlr();V7s=(function(){function t(){}return a(t,"NoopMeterProvider"),t.prototype.getMeter=function(e,r,n){return elr},t})(),$Wn=new V7s});var plr,WWn,zWn=me(()=>{p();VWn();jZ();HZ();plr="metrics",WWn=(function(){function t(){}return a(t,"MetricsAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalMeterProvider=function(e){return _5(plr,e,uE.instance())},t.prototype.getMeterProvider=function(){return AT(plr)||$Wn},t.prototype.getMeter=function(e,r,n){return this.getMeterProvider().getMeter(e,r,n)},t.prototype.disable=function(){C5(plr,uE.instance())},t})()});var VZ,YWn=me(()=>{p();zWn();VZ=WWn.getInstance()});var KWn,JWn=me(()=>{p();KWn=(function(){function t(){}return a(t,"NoopTextMapPropagator"),t.prototype.inject=function(e,r){},t.prototype.extract=function(e,r){return e},t.prototype.fields=function(){return[]},t})()});function mlr(t){return t.getValue(hlr)||void 0}function ZWn(){return mlr(Yj.getInstance().active())}function XWn(t,e){return t.setValue(hlr,e)}function ezn(t){return t.deleteValue(hlr)}var hlr,tzn=me(()=>{p();h2e();p2e();hlr=hb("OpenTelemetry Baggage Key");a(mlr,"getBaggage");a(ZWn,"getActiveBaggage");a(XWn,"setBaggage");a(ezn,"deleteBaggage")});var glr,W7s,rzn,nzn=me(()=>{p();jZ();JWn();rlr();tzn();Jcr();HZ();glr="propagation",W7s=new KWn,rzn=(function(){function t(){this.createBaggage=AWn,this.getBaggage=mlr,this.getActiveBaggage=ZWn,this.setBaggage=XWn,this.deleteBaggage=ezn}return a(t,"PropagationAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalPropagator=function(e){return _5(glr,e,uE.instance())},t.prototype.inject=function(e,r,n){return n===void 0&&(n=Sat),this._getGlobalPropagator().inject(e,r,n)},t.prototype.extract=function(e,r,n){return n===void 0&&(n=bat),this._getGlobalPropagator().extract(e,r,n)},t.prototype.fields=function(){return this._getGlobalPropagator().fields()},t.prototype.disable=function(){C5(glr,uE.instance())},t.prototype._getGlobalPropagator=function(){return AT(glr)||W7s},t})()});var yT,izn=me(()=>{p();nzn();yT=rzn.getInstance()});var Alr,ozn,szn=me(()=>{p();jZ();dlr();Rat();slr();HZ();Alr="trace",ozn=(function(){function t(){this._proxyTracerProvider=new y2e,this.wrapSpanContext=xWn,this.isSpanContextValid=mb,this.deleteSpan=TWn,this.getSpan=xat,this.getActiveSpan=SWn,this.getSpanContext=wat,this.setSpan=A2e,this.setSpanContext=IWn}return a(t,"TraceAPI"),t.getInstance=function(){return this._instance||(this._instance=new t),this._instance},t.prototype.setGlobalTracerProvider=function(e){var r=_5(Alr,this._proxyTracerProvider,uE.instance());return r&&this._proxyTracerProvider.setDelegate(e),r},t.prototype.getTracerProvider=function(){return AT(Alr)||this._proxyTracerProvider},t.prototype.getTracer=function(e,r){return this.getTracerProvider().getTracer(e,r)},t.prototype.disable=function(){C5(Alr,uE.instance()),this._proxyTracerProvider=new y2e},t})()});var Cu,azn=me(()=>{p();szn();Cu=ozn.getInstance()});var v5={};wi(v5,{DiagConsoleLogger:()=>yWn,DiagLogLevel:()=>Da,INVALID_SPANID:()=>m2e,INVALID_SPAN_CONTEXT:()=>vpe,INVALID_TRACEID:()=>g2e,ProxyTracer:()=>Pat,ProxyTracerProvider:()=>y2e,ROOT_CONTEXT:()=>_at,SamplingDecision:()=>gb,SpanKind:()=>bpe,SpanStatusCode:()=>Spe,TraceFlags:()=>yf,ValueType:()=>vat,baggageEntryMetadataFromString:()=>Cpe,context:()=>_g,createContextKey:()=>hb,createNoopMeter:()=>_Wn,createTraceState:()=>qWn,default:()=>z7s,defaultTextMapGetter:()=>bat,defaultTextMapSetter:()=>Sat,diag:()=>kn,isSpanContextValid:()=>mb,isValidSpanId:()=>alr,isValidTraceId:()=>$Z,metrics:()=>VZ,propagation:()=>yT,trace:()=>Cu});var z7s,co=me(()=>{p();Jcr();p2e();EWn();Eat();tlr();CWn();rlr();ulr();dlr();kWn();PWn();DWn();ilr();jWn();Rat();Tat();HWn();GWn();YWn();izn();azn();z7s={context:_g,diag:kn,metrics:VZ,propagation:yT,trace:Cu}});var ET=I(KZ=>{"use strict";p();Object.defineProperty(KZ,"__esModule",{value:!0});KZ.DebugNameData=void 0;KZ.getDebugName=NYn;KZ.getClassName=MYn;KZ.getFunctionName=OYn;var Klr=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return NYn(e,this)}};KZ.DebugNameData=Klr;var kYn=new Map,Jlr=new WeakMap;function NYn(t,e){let r=Jlr.get(t);if(r)return r;let n=Bqs(t,e);if(n){let o=kYn.get(n)??0;o++,kYn.set(n,o);let s=o===1?n:`${n}#${o}`;return Jlr.set(t,s),s}}a(NYn,"getDebugName");function Bqs(t,e){let r=Jlr.get(t);if(r)return r;let n=e.owner?Fqs(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=OYn(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=Lqs(e.owner,t);if(l!==void 0)return n+l}}a(Bqs,"computeDebugName");function Lqs(t,e){for(let r in t)if(t[r]===e)return r}a(Lqs,"findKey");var PYn=new Map,DYn=new WeakMap;function Fqs(t){let e=DYn.get(t);if(e)return e;let r=MYn(t)??"Object",n=PYn.get(r)??0;n++,PYn.set(r,n);let o=n===1?r:`${r}#${n}`;return DYn.set(t,o),o}a(Fqs,"formatOwner");function MYn(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(MYn,"getClassName");function OYn(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(OYn,"getFunctionName")});var zYn=I(lp=>{"use strict";p();var Uqs=lp&&lp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qqs=lp&&lp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qqs=lp&&lp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(UYn,"strictEqualsC");function QYn(t,e,r){return FYn.equals(t,e,r??lct)}a(QYn,"arrayEquals");function qYn(t){return(e,r)=>FYn.equals(e,r,t??lct)}a(qYn,"arrayEqualsC");function O2e(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rO2e(t,e)}a(jYn,"structuralEqualsC");function jqs(t){return JSON.stringify(Zlr(t))}a(jqs,"getStructuralKey");var Hqs=0,BYn=new WeakMap;function Zlr(t){if(Array.isArray(t))return t.map(Zlr);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=Zlr(e[n]);return r}else{let e=BYn.get(t);return e===void 0&&(e=Hqs++,BYn.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(Zlr,"toNormalizedJsonStructure");function HYn(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(HYn,"jsonStringifyEquals");function GYn(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(GYn,"jsonStringifyEqualsC");function $Yn(){return(t,e)=>t.equals(e)}a($Yn,"thisEqualsC");function VYn(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(VYn,"equalsIfDefined");function WYn(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(WYn,"equalsIfDefinedC");var LYn;(function(t){t.strict=lct,t.strictC=UYn,t.array=QYn,t.arrayC=qYn,t.structural=O2e,t.structuralC=jYn,t.jsonStringify=HYn,t.jsonStringifyC=GYn,t.thisC=$Yn,t.ifDefined=VYn,t.ifDefinedC=WYn})(LYn||(lp.equals=LYn={}))});var eC=I(up=>{"use strict";p();Object.defineProperty(up,"__esModule",{value:!0});up.trackDisposable=up.toDisposable=up.markAsDisposed=up.DisposableStore=up.Event=up.onUnexpectedError=up.onBugIndicatingError=up.BugIndicatingError=up.strictEquals=up.assertFn=void 0;var Gqs=Yu();Object.defineProperty(up,"assertFn",{enumerable:!0,get:a(function(){return Gqs.assertFn},"get")});var $qs=zYn();Object.defineProperty(up,"strictEquals",{enumerable:!0,get:a(function(){return $qs.strictEquals},"get")});var Xlr=Ts();Object.defineProperty(up,"BugIndicatingError",{enumerable:!0,get:a(function(){return Xlr.BugIndicatingError},"get")});Object.defineProperty(up,"onBugIndicatingError",{enumerable:!0,get:a(function(){return Xlr.onBugIndicatingError},"get")});Object.defineProperty(up,"onUnexpectedError",{enumerable:!0,get:a(function(){return Xlr.onUnexpectedError},"get")});var Vqs=Sc();Object.defineProperty(up,"Event",{enumerable:!0,get:a(function(){return Vqs.Event},"get")});var uct=ko();Object.defineProperty(up,"DisposableStore",{enumerable:!0,get:a(function(){return uct.DisposableStore},"get")});Object.defineProperty(up,"markAsDisposed",{enumerable:!0,get:a(function(){return uct.markAsDisposed},"get")});Object.defineProperty(up,"toDisposable",{enumerable:!0,get:a(function(){return uct.toDisposable},"get")});Object.defineProperty(up,"trackDisposable",{enumerable:!0,get:a(function(){return uct.trackDisposable},"get")})});var YYn=I(eur=>{"use strict";p();Object.defineProperty(eur,"__esModule",{value:!0});eur.handleBugIndicatingErrorRecovery=zqs;var Wqs=eC();function zqs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,Wqs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(zqs,"handleBugIndicatingErrorRecovery")});var x5=I(Ope=>{"use strict";p();Object.defineProperty(Ope,"__esModule",{value:!0});Ope.addLogger=Yqs;Ope.getLogger=Kqs;Ope.setLogObservableFn=Jqs;Ope.logObservable=Zqs;var JZ;function Yqs(t){JZ?JZ instanceof dct?JZ.loggers.push(t):JZ=new dct([JZ,t]):JZ=t}a(Yqs,"addLogger");function Kqs(){return JZ}a(Kqs,"getLogger");var tur;function Jqs(t){tur=t}a(Jqs,"setLogObservableFn");function Zqs(t){tur&&tur(t)}a(Zqs,"logObservable");var dct=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var qF=I(Xj=>{"use strict";p();Object.defineProperty(Xj,"__esModule",{value:!0});Xj.TransactionImpl=void 0;Xj.transaction=rur;Xj.globalTransaction=ejs;Xj.asyncTransaction=tjs;Xj.subtransaction=rjs;var KYn=YYn(),Xqs=ET(),JYn=x5();function rur(t,e){let r=new Bpe(t,e);try{t(r)}finally{r.finish()}}a(rur,"transaction");var fct;function ejs(t){if(fct)t(fct);else{let e=new Bpe(t,void 0);fct=e;try{t(e)}finally{e.finish(),fct=void 0}}}a(ejs,"globalTransaction");async function tjs(t,e){let r=new Bpe(t,e);try{await t(r)}finally{r.finish()}}a(tjs,"asyncTransaction");function rjs(t,e,r){t?e(t):rur(e,r)}a(rjs,"subtransaction");var Bpe=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,JYn.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,Xqs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,KYn.handleBugIndicatingErrorRecovery)("Transaction already finished!"),rur(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,KYn.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(pct,"__esModule",{value:!0});pct.DebugLocation=void 0;var ZYn;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,nur.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(ZYn||(pct.DebugLocation=ZYn={}));var nur=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` -`),o=njs(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function njs(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(njs,"parseLine")});var h2=I(w5=>{"use strict";p();Object.defineProperty(w5,"__esModule",{value:!0});w5.BaseObservable=w5.ConvenientObservable=void 0;w5._setDerivedOpts=ojs;w5._setRecomputeInitiallyAndOnChange=sjs;w5._setKeepObserved=ajs;w5._setDebugGetObservableGraph=cjs;var XYn=_T(),ijs=ET(),Lpe=x5(),iur;function ojs(t){iur=t}a(ojs,"_setDerivedOpts");var eKn;function sjs(t){eKn=t}a(sjs,"_setRecomputeInitiallyAndOnChange");var tKn;function ajs(t){tKn=t}a(ajs,"_setKeepObserved");var our;function cjs(t){our=t}a(cjs,"_setDebugGetObservableGraph");var hct=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=XYn.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return iur({owner:o,debugName:a(()=>{let c=(0,ijs.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return iur({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(eKn(this,r)),this}keepObserved(e){return e.add(tKn(this)),this}get debugValue(){return this.get()}get debug(){return new sur(this)}};w5.ConvenientObservable=hct;var sur=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return our(this.observable,{type:"dependencies"})}getObserverGraph(){return our(this.observable,{type:"observers"})}},aur=class extends hct{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Lpe.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Lpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Lpe.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Lpe.getLogger)();return(0,Lpe.logObservable)(this),e||(0,Lpe.getLogger)()?.handleObservableCreated(this,XYn.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};w5.BaseObservable=aur});var jF=I(eH=>{"use strict";p();Object.defineProperty(eH,"__esModule",{value:!0});eH.DisposableObservableValue=eH.ObservableValue=void 0;eH.observableValue=djs;eH.disposableObservableValue=fjs;var ljs=qF(),ujs=h2(),nKn=eC(),mct=ET(),rKn=x5(),iKn=_T();function djs(t,e,r=iKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new mct.DebugNameData(void 0,t,void 0):n=new mct.DebugNameData(t,void 0,void 0),new B2e(n,e,nKn.strictEquals,r)}a(djs,"observableValue");var B2e=class extends ujs.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,rKn.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new ljs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,rKn.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};eH.ObservableValue=B2e;function fjs(t,e,r=iKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new mct.DebugNameData(void 0,t,void 0):n=new mct.DebugNameData(t,void 0,void 0),new gct(n,e,nKn.strictEquals,r)}a(fjs,"disposableObservableValue");var gct=class extends B2e{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};eH.DisposableObservableValue=gct});var sKn=I(Act=>{"use strict";p();Object.defineProperty(Act,"__esModule",{value:!0});Act.LazyObservableValue=void 0;var pjs=qF(),oKn=x5(),hjs=h2(),cur=class extends hjs.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,oKn.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,oKn.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new pjs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};Act.LazyObservableValue=cur});var yct=I(lur=>{"use strict";p();Object.defineProperty(lur,"__esModule",{value:!0});lur.observableValueOpts=yjs;var aKn=ET(),cKn=eC(),mjs=jF(),gjs=sKn(),Ajs=_T();function yjs(t,e,r=Ajs.DebugLocation.ofCaller()){return t.lazy?new gjs.LazyObservableValue(new aKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cKn.strictEquals,r):new mjs.ObservableValue(new aKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??cKn.strictEquals,r)}a(yjs,"observableValueOpts")});var _ct=I(Ect=>{"use strict";p();Object.defineProperty(Ect,"__esModule",{value:!0});Ect.AutorunObserver=void 0;var Dw=eC(),L2e=x5();function Ejs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Ejs,"autorunStateToString");var uur=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,L2e.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,Dw.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,L2e.getLogger)()?.handleAutorunDisposed(this),(0,Dw.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,L2e.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,Dw.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,L2e.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,Dw.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,L2e.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,Dw.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Dw.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new Dw.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new Dw.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Dw.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new Dw.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Ejs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,Dw.onBugIndicatingError)(new Dw.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Ect.AutorunObserver=uur});var ZZ=I(Nw=>{"use strict";p();Object.defineProperty(Nw,"__esModule",{value:!0});Nw.autorun=pur;Nw.autorunOpts=F2e;Nw.autorunHandleChanges=lKn;Nw.autorunWithStoreHandleChanges=vjs;Nw.autorunWithStore=bjs;Nw.autorunDelta=Sjs;Nw.autorunIterableDelta=Tjs;Nw.autorunPerKeyedItem=Ijs;Nw.autorunSelfDisposable=xjs;Nw.registerAutorunSelfDisposable=wjs;var Fpe=eC(),dur=ET(),fur=_ct(),Upe=_T(),_js=jF(),Cjs=qF();function pur(t,e=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(void 0,void 0,t),t,void 0,e)}a(pur,"autorun");function F2e(t,e,r=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(F2e,"autorunOpts");function lKn(t,e,r=Upe.DebugLocation.ofCaller()){return new fur.AutorunObserver(new dur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(lKn,"autorunHandleChanges");function vjs(t,e){let r=new Fpe.DisposableStore,n=lKn({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,Fpe.toDisposable)(()=>{n.dispose(),r.dispose()})}a(vjs,"autorunWithStoreHandleChanges");function bjs(t){let e=new Fpe.DisposableStore,r=F2e({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,Fpe.toDisposable)(()=>{r.dispose(),e.dispose()})}a(bjs,"autorunWithStore");function Sjs(t,e){let r;return F2e({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(Sjs,"autorunDelta");function Tjs(t,e,r=n=>n){let n=new Map;return F2e({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(Tjs,"autorunIterableDelta");function Ijs(t,e,r,n=Upe.DebugLocation.ofCaller()){let o=new Map,s=F2e({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Cjs.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new Fpe.DisposableStore,E={value:(0,_js.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,Fpe.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(Ijs,"autorunPerKeyedItem");function xjs(t,e=Upe.DebugLocation.ofCaller()){let r,n=!1;return r=pur(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(xjs,"autorunSelfDisposable");function wjs(t,e,r=Upe.DebugLocation.ofCaller()){let n,o=!1;n=pur(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(wjs,"registerAutorunSelfDisposable")});var qpe=I(Qpe=>{"use strict";p();Object.defineProperty(Qpe,"__esModule",{value:!0});Qpe.DerivedWithSetter=Qpe.Derived=void 0;var Rjs=h2(),XZ=eC(),hur=x5();function kjs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(kjs,"derivedStateToString");var Cct=class extends Rjs.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,hur.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,hur.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,XZ.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new XZ.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,XZ.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,hur.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,XZ.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new XZ.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new XZ.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new XZ.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:kjs(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};Qpe.Derived=Cct;var mur=class extends Cct{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Qpe.DerivedWithSetter=mur});var vct=I(tH=>{"use strict";p();Object.defineProperty(tH,"__esModule",{value:!0});tH.derived=Djs;tH.derivedWithSetter=Njs;tH.derivedOpts=uKn;tH.derivedHandleChanges=Mjs;tH.derivedWithStore=Ojs;tH.derivedDisposable=Bjs;var R5=eC(),jpe=_T(),eX=ET(),Pjs=h2(),tX=qpe();function Djs(t,e,r=jpe.DebugLocation.ofCaller()){return e!==void 0?new tX.Derived(new eX.DebugNameData(t,void 0,e),e,void 0,void 0,R5.strictEquals,r):new tX.Derived(new eX.DebugNameData(void 0,void 0,t),t,void 0,void 0,R5.strictEquals,r)}a(Djs,"derived");function Njs(t,e,r,n=jpe.DebugLocation.ofCaller()){return new tX.DerivedWithSetter(new eX.DebugNameData(t,void 0,e),e,void 0,void 0,R5.strictEquals,r,n)}a(Njs,"derivedWithSetter");function uKn(t,e,r=jpe.DebugLocation.ofCaller()){return new tX.Derived(new eX.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??R5.strictEquals,r)}a(uKn,"derivedOpts");(0,Pjs._setDerivedOpts)(uKn);function Mjs(t,e,r=jpe.DebugLocation.ofCaller()){return new tX.Derived(new eX.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??R5.strictEquals,r)}a(Mjs,"derivedHandleChanges");function Ojs(t,e,r=jpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new R5.DisposableStore;return new tX.Derived(new eX.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new R5.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),R5.strictEquals,r)}a(Ojs,"derivedWithStore");function Bjs(t,e,r=jpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new tX.Derived(new eX.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new R5.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},R5.strictEquals,r)}a(Bjs,"derivedDisposable")});var pKn=I(Mw=>{"use strict";p();Object.defineProperty(Mw,"__esModule",{value:!0});Mw.ObservableLazyPromise=Mw.ObservableResolvedPromise=Mw.PromiseResult=Mw.ObservablePromise=Mw.ObservableLazy=void 0;var Ljs=ZZ(),dKn=qF(),fKn=vct(),bct=jF(),Sct=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,bct.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};Mw.ObservableLazy=Sct;var Tct=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,bct.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,fKn.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,dKn.transaction)(n=>{this._value.set(new U2e(r,void 0),n)}),r),r=>{throw(0,dKn.transaction)(n=>{this._value.set(new U2e(void 0,r),n)}),r})}};Mw.ObservablePromise=Tct;var U2e=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};Mw.PromiseResult=U2e;var gur=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,bct.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,bct.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,Ljs.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};Mw.ObservableResolvedPromise=gur;var Aur=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Sct(()=>new Tct(this._computePromise())),this.cachedPromiseResult=(0,fKn.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};Mw.ObservableLazyPromise=Aur});var Eur=I(k5=>{"use strict";p();Object.defineProperty(k5,"__esModule",{value:!0});k5.cancelOnDispose=k5.CancellationTokenSource=k5.CancellationToken=k5.CancellationError=void 0;var Fjs=Ts();Object.defineProperty(k5,"CancellationError",{enumerable:!0,get:a(function(){return Fjs.CancellationError},"get")});var yur=SP();Object.defineProperty(k5,"CancellationToken",{enumerable:!0,get:a(function(){return yur.CancellationToken},"get")});Object.defineProperty(k5,"CancellationTokenSource",{enumerable:!0,get:a(function(){return yur.CancellationTokenSource},"get")});Object.defineProperty(k5,"cancelOnDispose",{enumerable:!0,get:a(function(){return yur.cancelOnDispose},"get")})});var hKn=I(Ict=>{"use strict";p();Object.defineProperty(Ict,"__esModule",{value:!0});Ict.waitForState=Gjs;Ict.derivedWithCancellationToken=$js;var Ujs=ET(),_ur=Eur(),Qjs=eC(),qjs=ZZ(),jjs=qpe(),Hjs=_T();function Gjs(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,qjs.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new _ur.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new _ur.CancellationError);return}}c=!1,l&&d.dispose()})}a(Gjs,"waitForState");function $js(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new jjs.Derived(new Ujs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new _ur.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),Qjs.strictEquals,Hjs.DebugLocation.ofCaller())}a($js,"derivedWithCancellationToken")});var rH=I(rX=>{"use strict";p();Object.defineProperty(rX,"__esModule",{value:!0});rX.FromEventObservable=void 0;rX.observableFromEvent=Cur;rX.observableFromEventOpts=zjs;var Vjs=qF(),gKn=eC(),AKn=ET(),mKn=x5(),Wjs=h2(),yKn=_T();function Cur(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new m2(new AKn.DebugNameData(e,void 0,n),r,n,()=>m2.globalTransaction,gKn.strictEquals,o??yKn.DebugLocation.ofCaller())}a(Cur,"observableFromEvent");function zjs(t,e,r,n=yKn.DebugLocation.ofCaller()){return new m2(new AKn.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??m2.globalTransaction,t.equalsFn??gKn.strictEquals,n)}a(zjs,"observableFromEventOpts");var m2=class extends Wjs.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,Vjs.subtransaction)(this._getTransaction(),m=>{(0,mKn.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,mKn.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};rX.FromEventObservable=m2;(function(t){t.Observer=m2;function e(r,n){let o=!1;m2.globalTransaction===void 0&&(m2.globalTransaction=r,o=!0);try{n()}finally{o&&(m2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Cur||(rX.observableFromEvent=Cur={}))});var bur=I(vur=>{"use strict";p();Object.defineProperty(vur,"__esModule",{value:!0});vur.observableSignal=Xjs;var Yjs=qF(),Kjs=ET(),Jjs=h2(),Zjs=_T();function Xjs(t,e=Zjs.DebugLocation.ofCaller()){return typeof t=="string"?new xct(t,void 0,e):new xct(void 0,t,e)}a(Xjs,"observableSignal");var xct=class extends Jjs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Kjs.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,Yjs.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var Rct=I(mE=>{"use strict";p();Object.defineProperty(mE,"__esModule",{value:!0});mE.KeepAliveObserver=void 0;mE.observableFromPromise=eHs;mE.signalFromObservable=tHs;mE.debouncedObservable=rHs;mE.throttledObservable=nHs;mE.debouncedObservable2=iHs;mE.wasEventTriggeredRecently=oHs;mE.keepObserved=SKn;mE.recomputeInitiallyAndOnChange=TKn;mE.derivedObservableWithCache=sHs;mE.derivedObservableWithWritableCache=aHs;mE.mapObservableArrayCached=cHs;mE.isObservable=lHs;var EKn=ZZ(),_Kn=jF(),Sur=eC(),q2e=vct(),CKn=rH(),vKn=bur(),bKn=h2(),Tur=_T();function eHs(t){let e=(0,_Kn.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(eHs,"observableFromPromise");function tHs(t,e){return(0,q2e.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(tHs,"signalFromObservable");function rHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,CKn.observableFromEvent)(void 0,c=>{let l=(0,EKn.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(rHs,"debouncedObservable");function nHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,CKn.observableFromEvent)(void 0,c=>{let l=(0,EKn.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(nHs,"throttledObservable");function iHs(t,e,r=Tur.DebugLocation.ofCaller()){let n=(0,vKn.observableSignal)("handleTimeout"),o,s;return(0,q2e.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(iHs,"debouncedObservable2");function oHs(t,e,r){let n=(0,_Kn.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(oHs,"wasEventTriggeredRecently");function SKn(t){let e=new Q2e(!1,void 0);return t.addObserver(e),(0,Sur.toDisposable)(()=>{t.removeObserver(e)})}a(SKn,"keepObserved");(0,bKn._setKeepObserved)(SKn);function TKn(t,e){let r=new Q2e(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Sur.toDisposable)(()=>{t.removeObserver(r)})}a(TKn,"recomputeInitiallyAndOnChange");(0,bKn._setRecomputeInitiallyAndOnChange)(TKn);var Q2e=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};mE.KeepAliveObserver=Q2e;function sHs(t,e){let r;return(0,q2e.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(sHs,"derivedObservableWithCache");function aHs(t,e){let r,n=(0,vKn.observableSignal)("derivedObservableWithWritableCache"),o=(0,q2e.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(aHs,"derivedObservableWithWritableCache");function cHs(t,e,r,n){let o=new wct(r,n);return(0,q2e.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new wct(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(cHs,"mapObservableArrayCached");var wct=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new Sur.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function lHs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(lHs,"isObservable")});var xKn=I(kct=>{"use strict";p();Object.defineProperty(kct,"__esModule",{value:!0});kct.recordChanges=uHs;kct.recordChangesLazy=dHs;var IKn=eC();function uHs(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new IKn.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(uHs,"recordChanges");function dHs(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new IKn.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(dHs,"recordChangesLazy")});var wKn=I(xur=>{"use strict";p();Object.defineProperty(xur,"__esModule",{value:!0});xur.constObservable=pHs;var fHs=h2();function pHs(t){return new Iur(t)}a(pHs,"constObservable");var Iur=class extends fHs.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var RKn=I(Rur=>{"use strict";p();Object.defineProperty(Rur,"__esModule",{value:!0});Rur.observableSignalFromEvent=yHs;var hHs=qF(),mHs=ET(),gHs=h2(),AHs=_T();function yHs(t,e,r=AHs.DebugLocation.ofCaller()){return new wur(typeof t=="string"?t:new mHs.DebugNameData(t,void 0,void 0),e,r)}a(yHs,"observableSignalFromEvent");var wur=class extends gHs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,hHs.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var kKn=I(j2e=>{"use strict";p();Object.defineProperty(j2e,"__esModule",{value:!0});j2e.ValueWithChangeEventFromObservable=void 0;j2e.observableFromValueWithChangeEvent=CHs;var EHs=eC(),_Hs=rH(),Pct=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return EHs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};j2e.ValueWithChangeEventFromObservable=Pct;function CHs(t,e){return e instanceof Pct?e.observable:(0,_Hs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(CHs,"observableFromValueWithChangeEvent")});var NKn=I(H2e=>{"use strict";p();Object.defineProperty(H2e,"__esModule",{value:!0});H2e.runOnChange=PKn;H2e.runOnChangeWithStore=DKn;H2e.runOnChangeWithCancellationToken=THs;var vHs=Eur(),bHs=eC(),SHs=ZZ();function PKn(t,e){let r,n=!0;return(0,SHs.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(PKn,"runOnChange");function DKn(t,e){let r=new bHs.DisposableStore,n=PKn(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(DKn,"runOnChangeWithStore");function THs(t,e){return DKn(t,(r,n,o,s)=>{e(r,n,o,(0,vHs.cancelOnDispose)(s))})}a(THs,"runOnChangeWithCancellationToken")});var BKn=I(Dct=>{"use strict";p();Object.defineProperty(Dct,"__esModule",{value:!0});Dct.latestChangedValue=RHs;Dct.derivedConstOnceDefined=kHs;var MKn=eC(),OKn=ET(),IHs=rH(),xHs=ZZ(),wHs=Rct();function RHs(t,e){if(e.length===0)throw new MKn.BugIndicatingError;let r=!1,n,o=(0,IHs.observableFromEvent)(t,s=>{let c=new MKn.DisposableStore;for(let l of e)c.add((0,xHs.autorunOpts)({debugName:a(()=>(0,OKn.getDebugName)(o,new OKn.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(RHs,"latestChangedValue");function kHs(t,e){return(0,wHs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(kHs,"derivedConstOnceDefined")});var LKn=I(Nct=>{"use strict";p();Object.defineProperty(Nct,"__esModule",{value:!0});Nct.ObservableSet=void 0;var PHs=yct(),kur=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,PHs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};Nct.ObservableSet=kur});var FKn=I(Mct=>{"use strict";p();Object.defineProperty(Mct,"__esModule",{value:!0});Mct.ObservableMap=void 0;var DHs=yct(),Pur=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,DHs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};Mct.ObservableMap=Pur});var Lct=I(Vpe=>{"use strict";p();Object.defineProperty(Vpe,"__esModule",{value:!0});Vpe.ConsoleObservableLogger=void 0;Vpe.logObservableToConsole=OHs;Vpe.formatValue=$pe;var NHs=x5(),MHs=ET(),UKn=qpe(),Oct;function OHs(t){Oct||(Oct=new Bct,(0,NHs.addLogger)(Oct)),Oct.addFilteredObj(t)}a(OHs,"logObservableToConsole");var Bct=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return BHs([Hpe(UHs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[Hpe(" "),Ow($pe(e.oldValue,70),{color:"red",strikeThrough:!0}),Hpe(" "),Ow($pe(e.newValue,60),{color:"green"})]:[Hpe(" (unchanged)")]:[Hpe(" "),Ow($pe(e.newValue,60),{color:"green"}),Hpe(" (initial)")]}handleObservableCreated(e){if(e instanceof UKn.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof UKn.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([Gpe("observable value changed"),Ow(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return Ow(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Gpe("derived recomputed"),Ow(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Gpe("derived cleared"),Ow(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Gpe("observable from event triggered"),Ow(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Gpe("autorun"),Ow(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Gpe("transaction"),Ow(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Vpe.ConsoleObservableLogger=Bct;function BHs(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(BHs,"consoleTextToArgs");function Hpe(t){return Ow(t,{color:"black"})}a(Hpe,"normalText");function Gpe(t){return Ow(QHs(`${t}: `,10),{color:"black",bold:!0})}a(Gpe,"formatKind");function Ow(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(Ow,"styled");function $pe(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?LHs(t,e):FHs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a($pe,"formatValue");function LHs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${$pe(o,e-r.length)}`}return r+=" ]",r}a(LHs,"formatArray");function FHs(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,MHs.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${$pe(c,e-n.length)}`}return n+=r?")":" }",n}a(FHs,"formatObject");function UHs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(UHs,"repeat");function QHs(t,e){for(;t.length{"use strict";p();Object.defineProperty(Fct,"__esModule",{value:!0});Fct.SimpleTypedRpcConnection=void 0;var Dur=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};Fct.SimpleTypedRpcConnection=Dur});var qKn=I(Nur=>{"use strict";p();Object.defineProperty(Nur,"__esModule",{value:!0});Nur.registerDebugChannel=jHs;var qHs=QKn();function jHs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=HHs({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},qHs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(jHs,"registerDebugChannel");function HHs(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(HHs,"createChannelFactoryFromDebugChannel")});var GKn=I(nH=>{"use strict";p();Object.defineProperty(nH,"__esModule",{value:!0});nH.Throttler=nH.Debouncer=void 0;nH.deepAssign=jKn;nH.deepAssignDeleteNulls=HKn;var Mur=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};nH.Debouncer=Mur;var Our=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};nH.Throttler=Our;function jKn(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?jKn(t[r],e[r]):t[r]=e[r]}a(jKn,"deepAssign");function HKn(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?HKn(t[r],e[r]):t[r]=e[r]}a(HKn,"deepAssignDeleteNulls")});var WKn=I(Qct=>{"use strict";p();Object.defineProperty(Qct,"__esModule",{value:!0});Qct.DevToolsLogger=void 0;var $Kn=_ct(),Uct=Lct(),GHs=qKn(),Bur=GKn(),G2e=BS(),$Hs=rH(),nX=Ts(),iX=qpe(),VKn=jF(),VHs=_T(),Lur=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nX.onUnexpectedError)(new nX.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,nX.onUnexpectedError)(new nX.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof iX.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(G2e.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof $Kn.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof iX.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,GHs.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(G2e.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(G2e.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(G2e.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(G2e.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof iX.Derived)n.debugSetValue(r);else if(n instanceof VKn.ObservableValue)n.debugSetValue(r);else if(n instanceof $Hs.FromEventObservable)n.debugSetValue(r);else throw new nX.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iX.Derived)return(0,Uct.formatValue)(r.debugGetState().value,200);if(r instanceof VKn.ObservableValue)return(0,Uct.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new nX.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof iX.Derived)r.debugRecompute();else if(r instanceof $Kn.AutorunObserver)r.debugRerun();else throw new nX.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new Bur.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},VHs.DebugLocation.enable()}_handleChange(e){(0,Bur.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,Bur.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof iX.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof iX.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Uct.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,Uct.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};Qct.DevToolsLogger=Lur});var JKn=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});Fur.debugGetObservableGraph=JHs;var WHs=qpe(),zHs=rH(),YHs=jF(),KHs=_ct(),zKn=Lct();function JHs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=oX.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?KKn(n,0,o,e).trim():YKn(n,0,o,e).trim()}a(JHs,"debugGetObservableGraph");function YKn(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,zKn.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=oX.from(l,n.debugNamePostProcessor??(d=>d))??oX.unknown(l);s.push(YKn(u,e+1,r,n))}}return s.join(` -`)}a(YKn,"formatObservableInfoWithDependencies");function KKn(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` -`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,zKn.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=oX.from(l,n.debugNamePostProcessor??(d=>d))??oX.unknown(l);s.push(KKn(u,e+1,r,n))}}return s.join(` -`)}a(KKn,"formatObservableInfoWithObservers");var oX=class t{static{a(this,"Info")}static from(e,r){if(e instanceof KHs.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof WHs.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof YHs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof zHs.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var HF=I(Bt=>{"use strict";p();Object.defineProperty(Bt,"__esModule",{value:!0});Bt.ValueWithChangeEventFromObservable=Bt.observableFromValueWithChangeEvent=Bt.TransactionImpl=Bt.transaction=Bt.subtransaction=Bt.globalTransaction=Bt.asyncTransaction=Bt.observableSignalFromEvent=Bt.observableFromEventOpts=Bt.observableSignal=Bt.constObservable=Bt.recordChangesLazy=Bt.recordChanges=Bt.isObservable=Bt.wasEventTriggeredRecently=Bt.throttledObservable=Bt.signalFromObservable=Bt.recomputeInitiallyAndOnChange=Bt.observableFromPromise=Bt.mapObservableArrayCached=Bt.keepObserved=Bt.derivedObservableWithWritableCache=Bt.derivedObservableWithCache=Bt.debouncedObservable2=Bt.debouncedObservable=Bt.waitForState=Bt.derivedWithCancellationToken=Bt.PromiseResult=Bt.ObservableResolvedPromise=Bt.ObservablePromise=Bt.ObservableLazyPromise=Bt.ObservableLazy=Bt.derivedWithStore=Bt.derivedWithSetter=Bt.derivedOpts=Bt.derivedHandleChanges=Bt.derivedDisposable=Bt.derived=Bt.disposableObservableValue=Bt.registerAutorunSelfDisposable=Bt.autorunSelfDisposable=Bt.autorunPerKeyedItem=Bt.autorunIterableDelta=Bt.autorunWithStoreHandleChanges=Bt.autorunWithStore=Bt.autorunOpts=Bt.autorunHandleChanges=Bt.autorunDelta=Bt.autorun=Bt.observableValueOpts=void 0;Bt.DebugLocation=Bt.ObservableMap=Bt.ObservableSet=Bt.observableValue=Bt.observableFromEvent=Bt.latestChangedValue=Bt.derivedConstOnceDefined=Bt.runOnChangeWithStore=Bt.runOnChangeWithCancellationToken=Bt.runOnChange=void 0;var ZHs=yct();Object.defineProperty(Bt,"observableValueOpts",{enumerable:!0,get:a(function(){return ZHs.observableValueOpts},"get")});var P5=ZZ();Object.defineProperty(Bt,"autorun",{enumerable:!0,get:a(function(){return P5.autorun},"get")});Object.defineProperty(Bt,"autorunDelta",{enumerable:!0,get:a(function(){return P5.autorunDelta},"get")});Object.defineProperty(Bt,"autorunHandleChanges",{enumerable:!0,get:a(function(){return P5.autorunHandleChanges},"get")});Object.defineProperty(Bt,"autorunOpts",{enumerable:!0,get:a(function(){return P5.autorunOpts},"get")});Object.defineProperty(Bt,"autorunWithStore",{enumerable:!0,get:a(function(){return P5.autorunWithStore},"get")});Object.defineProperty(Bt,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return P5.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Bt,"autorunIterableDelta",{enumerable:!0,get:a(function(){return P5.autorunIterableDelta},"get")});Object.defineProperty(Bt,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return P5.autorunPerKeyedItem},"get")});Object.defineProperty(Bt,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return P5.autorunSelfDisposable},"get")});Object.defineProperty(Bt,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return P5.registerAutorunSelfDisposable},"get")});var XHs=jF();Object.defineProperty(Bt,"disposableObservableValue",{enumerable:!0,get:a(function(){return XHs.disposableObservableValue},"get")});var Wpe=vct();Object.defineProperty(Bt,"derived",{enumerable:!0,get:a(function(){return Wpe.derived},"get")});Object.defineProperty(Bt,"derivedDisposable",{enumerable:!0,get:a(function(){return Wpe.derivedDisposable},"get")});Object.defineProperty(Bt,"derivedHandleChanges",{enumerable:!0,get:a(function(){return Wpe.derivedHandleChanges},"get")});Object.defineProperty(Bt,"derivedOpts",{enumerable:!0,get:a(function(){return Wpe.derivedOpts},"get")});Object.defineProperty(Bt,"derivedWithSetter",{enumerable:!0,get:a(function(){return Wpe.derivedWithSetter},"get")});Object.defineProperty(Bt,"derivedWithStore",{enumerable:!0,get:a(function(){return Wpe.derivedWithStore},"get")});var $2e=pKn();Object.defineProperty(Bt,"ObservableLazy",{enumerable:!0,get:a(function(){return $2e.ObservableLazy},"get")});Object.defineProperty(Bt,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return $2e.ObservableLazyPromise},"get")});Object.defineProperty(Bt,"ObservablePromise",{enumerable:!0,get:a(function(){return $2e.ObservablePromise},"get")});Object.defineProperty(Bt,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return $2e.ObservableResolvedPromise},"get")});Object.defineProperty(Bt,"PromiseResult",{enumerable:!0,get:a(function(){return $2e.PromiseResult},"get")});var XKn=hKn();Object.defineProperty(Bt,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return XKn.derivedWithCancellationToken},"get")});Object.defineProperty(Bt,"waitForState",{enumerable:!0,get:a(function(){return XKn.waitForState},"get")});var Bw=Rct();Object.defineProperty(Bt,"debouncedObservable",{enumerable:!0,get:a(function(){return Bw.debouncedObservable},"get")});Object.defineProperty(Bt,"debouncedObservable2",{enumerable:!0,get:a(function(){return Bw.debouncedObservable2},"get")});Object.defineProperty(Bt,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return Bw.derivedObservableWithCache},"get")});Object.defineProperty(Bt,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return Bw.derivedObservableWithWritableCache},"get")});Object.defineProperty(Bt,"keepObserved",{enumerable:!0,get:a(function(){return Bw.keepObserved},"get")});Object.defineProperty(Bt,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return Bw.mapObservableArrayCached},"get")});Object.defineProperty(Bt,"observableFromPromise",{enumerable:!0,get:a(function(){return Bw.observableFromPromise},"get")});Object.defineProperty(Bt,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return Bw.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Bt,"signalFromObservable",{enumerable:!0,get:a(function(){return Bw.signalFromObservable},"get")});Object.defineProperty(Bt,"throttledObservable",{enumerable:!0,get:a(function(){return Bw.throttledObservable},"get")});Object.defineProperty(Bt,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return Bw.wasEventTriggeredRecently},"get")});Object.defineProperty(Bt,"isObservable",{enumerable:!0,get:a(function(){return Bw.isObservable},"get")});var eJn=xKn();Object.defineProperty(Bt,"recordChanges",{enumerable:!0,get:a(function(){return eJn.recordChanges},"get")});Object.defineProperty(Bt,"recordChangesLazy",{enumerable:!0,get:a(function(){return eJn.recordChangesLazy},"get")});var eGs=wKn();Object.defineProperty(Bt,"constObservable",{enumerable:!0,get:a(function(){return eGs.constObservable},"get")});var tGs=bur();Object.defineProperty(Bt,"observableSignal",{enumerable:!0,get:a(function(){return tGs.observableSignal},"get")});var rGs=rH();Object.defineProperty(Bt,"observableFromEventOpts",{enumerable:!0,get:a(function(){return rGs.observableFromEventOpts},"get")});var nGs=RKn();Object.defineProperty(Bt,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return nGs.observableSignalFromEvent},"get")});var V2e=qF();Object.defineProperty(Bt,"asyncTransaction",{enumerable:!0,get:a(function(){return V2e.asyncTransaction},"get")});Object.defineProperty(Bt,"globalTransaction",{enumerable:!0,get:a(function(){return V2e.globalTransaction},"get")});Object.defineProperty(Bt,"subtransaction",{enumerable:!0,get:a(function(){return V2e.subtransaction},"get")});Object.defineProperty(Bt,"transaction",{enumerable:!0,get:a(function(){return V2e.transaction},"get")});Object.defineProperty(Bt,"TransactionImpl",{enumerable:!0,get:a(function(){return V2e.TransactionImpl},"get")});var tJn=kKn();Object.defineProperty(Bt,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return tJn.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Bt,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return tJn.ValueWithChangeEventFromObservable},"get")});var Uur=NKn();Object.defineProperty(Bt,"runOnChange",{enumerable:!0,get:a(function(){return Uur.runOnChange},"get")});Object.defineProperty(Bt,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return Uur.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Bt,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return Uur.runOnChangeWithStore},"get")});var rJn=BKn();Object.defineProperty(Bt,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return rJn.derivedConstOnceDefined},"get")});Object.defineProperty(Bt,"latestChangedValue",{enumerable:!0,get:a(function(){return rJn.latestChangedValue},"get")});var iGs=rH();Object.defineProperty(Bt,"observableFromEvent",{enumerable:!0,get:a(function(){return iGs.observableFromEvent},"get")});var oGs=jF();Object.defineProperty(Bt,"observableValue",{enumerable:!0,get:a(function(){return oGs.observableValue},"get")});var sGs=LKn();Object.defineProperty(Bt,"ObservableSet",{enumerable:!0,get:a(function(){return sGs.ObservableSet},"get")});var aGs=FKn();Object.defineProperty(Bt,"ObservableMap",{enumerable:!0,get:a(function(){return aGs.ObservableMap},"get")});var cGs=_T();Object.defineProperty(Bt,"DebugLocation",{enumerable:!0,get:a(function(){return cGs.DebugLocation},"get")});var Qur=x5(),nJn=Lct(),lGs=WKn(),ZKn=QIe(),uGs=h2(),dGs=JKn();(0,uGs._setDebugGetObservableGraph)(dGs.debugGetObservableGraph);(0,Qur.setLogObservableFn)(nJn.logObservableToConsole);var fGs=!1;fGs&&(0,Qur.addLogger)(new nJn.ConsoleObservableLogger);ZKn.env&&ZKn.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,Qur.addLogger)(lGs.DevToolsLogger.getInstance())});var sd=I(zpe=>{"use strict";p();Object.defineProperty(zpe,"__esModule",{value:!0});zpe.OffsetRangeSet=zpe.OffsetRange=void 0;var qct=Ts(),jct=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new qct.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new qct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new qct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};zpe.OffsetRangeSet=qur});var g2=I(Jpe=>{"use strict";p();Object.defineProperty(Jpe,"__esModule",{value:!0});Jpe.LineRangeSet=Jpe.LineRange=void 0;var iJn=Ts(),pGs=sd(),oJn=qp(),Ype=ZQ(),sJn=El(),Kpe=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,sJn.compareBy)(e=>e.startLineNumber,sJn.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new iJn.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Ype.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Ype.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Ype.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Kpe(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Ype.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Ype.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Kpe(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Jpe.LineRangeSet=W2e});var Zpe=I(Gct=>{"use strict";p();Object.defineProperty(Gct,"__esModule",{value:!0});Gct.TextLength=void 0;var hGs=g2(),aJn=I_(),Hct=qp(),jur=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` -`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Hct.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Hct.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Hct.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return hGs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new aJn.Position(e.lineNumber,e.column+this.columnCount):new aJn.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Hct.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Gct.TextLength=jur});var Vct=I(sX=>{"use strict";p();Object.defineProperty(sX,"__esModule",{value:!0});sX.PositionOffsetTransformer=sX.PositionOffsetTransformerBase=void 0;sX._setPositionOffsetTransformerDependencies=yGs;var mGs=ZQ(),gGs=sd(),z2e=I_(),AGs=qp(),$ct=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new gGs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return AGs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new GF.deps.StringEdit(r)}getStringReplacement(e){return new GF.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new GF.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new GF.deps.TextEdit(r)}};sX.PositionOffsetTransformerBase=$ct;var GF=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function yGs(t){GF._deps=t}a(yGs,"_setPositionOffsetTransformerDependencies");var Hur=class extends $ct{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new z2e.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new z2e.Position(r,o+1)}if(e.column<1)return new z2e.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new z2e.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,mGs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new z2e.Position(n,o)}getTextLength(e){return GF.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new GF.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};sX.PositionOffsetTransformer=Hur});var CT=I(D5=>{"use strict";p();Object.defineProperty(D5,"__esModule",{value:!0});D5.StringText=D5.ArrayText=D5.LineBasedText=D5.AbstractText=void 0;var EGs=Yu(),_Gs=Gh(),CGs=I_(),cJn=qp(),vGs=Zpe(),lJn=Vct(),Y2e=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new CGs.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new cJn.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new lJn.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new cJn.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,_Gs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};D5.AbstractText=Y2e;var Wct=class extends Y2e{static{a(this,"LineBasedText")}constructor(e,r){(0,EGs.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;n{for(let d of l)(0,Zke.checkReportMissingProp)(t,d)}):(r.if((0,Tcr._)`${u} && (${(0,Zke.checkMissingProp)(t,l,s)})`),(0,Zke.reportMissingProp)(t,s),r.else())}}a(sVn,"validatePropertyDeps");p5.validatePropertyDeps=sVn;function aVn(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,c=r.name("valid");for(let l in e)(0,D6s.alwaysValidSchema)(s,e[l])||(r.if((0,Zke.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let u=t.subschema({keyword:o,schemaProp:l},c);t.mergeValidEvaluated(u,c)},()=>r.var(c,!0)),t.ok(c))}a(aVn,"validateSchemaDeps");p5.validateSchemaDeps=aVn;p5.default=N6s});var uVn=I(Icr=>{"use strict";p();Object.defineProperty(Icr,"__esModule",{value:!0});var lVn=ps(),O6s=Wa(),B6s={message:"property name must be valid",params:a(({params:t})=>(0,lVn._)`{propertyName: ${t.propertyName}}`,"params")},L6s={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:B6s,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,O6s.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,c=>{t.setParams({propertyName:c}),t.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},s),e.if((0,lVn.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Icr.default=L6s});var wcr=I(xcr=>{"use strict";p();Object.defineProperty(xcr,"__esModule",{value:!0});var Xst=xw(),o2=ps(),F6s=RF(),eat=Wa(),U6s={message:"must NOT have additional properties",params:a(({params:t})=>(0,o2._)`{additionalProperty: ${t.additionalProperty}}`,"params")},Q6s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:U6s,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:c}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:u}=c;if(c.props=!0,u.removeAdditional!=="all"&&(0,eat.alwaysValidSchema)(c,r))return;let d=(0,Xst.allSchemaProperties)(n.properties),f=(0,Xst.allSchemaProperties)(n.patternProperties);h(),t.ok((0,o2._)`${s} === ${F6s.default.errors}`);function h(){e.forIn("key",o,E=>{!d.length&&!f.length?A(E):e.if(m(E),()=>A(E))})}a(h,"checkAdditionalProperties");function m(E){let _;if(d.length>8){let v=(0,eat.schemaRefOrVal)(c,n.properties,"properties");_=(0,Xst.isOwnProperty)(e,v,E)}else d.length?_=(0,o2.or)(...d.map(v=>(0,o2._)`${E} === ${v}`)):_=o2.nil;return f.length&&(_=(0,o2.or)(_,...f.map(v=>(0,o2._)`${(0,Xst.usePattern)(t,v)}.test(${E})`))),(0,o2.not)(_)}a(m,"isAdditional");function g(E){e.code((0,o2._)`delete ${o}[${E}]`)}a(g,"deleteAdditional");function A(E){if(u.removeAdditional==="all"||u.removeAdditional&&r===!1){g(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,eat.alwaysValidSchema)(c,r)){let _=e.name("valid");u.removeAdditional==="failing"?(y(E,_,!1),e.if((0,o2.not)(_),()=>{t.reset(),g(E)})):(y(E,_),l||e.if((0,o2.not)(_),()=>e.break()))}}a(A,"additionalPropertyCode");function y(E,_,v){let b={keyword:"additionalProperties",dataProp:E,dataPropType:eat.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(b,_)}a(y,"applyAdditionalSchema")}};xcr.default=Q6s});var pVn=I(Pcr=>{"use strict";p();Object.defineProperty(Pcr,"__esModule",{value:!0});var q6s=Fke(),dVn=xw(),Rcr=Wa(),fVn=wcr(),j6s={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&fVn.default.code(new q6s.KeywordCxt(s,fVn.default,"additionalProperties"));let c=(0,dVn.allSchemaProperties)(r);for(let h of c)s.definedProperties.add(h);s.opts.unevaluated&&c.length&&s.props!==!0&&(s.props=Rcr.mergeEvaluated.props(e,(0,Rcr.toHash)(c),s.props));let l=c.filter(h=>!(0,Rcr.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let u=e.name("valid");for(let h of l)d(h)?f(h):(e.if((0,dVn.propertyInData)(e,o,h,s.opts.ownProperties)),f(h),s.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(u);function d(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}a(d,"hasDefault");function f(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}a(f,"applyPropertySchema")}};Pcr.default=j6s});var AVn=I(kcr=>{"use strict";p();Object.defineProperty(kcr,"__esModule",{value:!0});var hVn=xw(),tat=ps(),mVn=Wa(),gVn=Wa(),H6s={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:c}=s,l=(0,hVn.allSchemaProperties)(r),u=l.filter(y=>(0,mVn.alwaysValidSchema)(s,r[y]));if(l.length===0||u.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=c.strictSchema&&!c.allowMatchingProperties&&o.properties,f=e.name("valid");s.props!==!0&&!(s.props instanceof tat.Name)&&(s.props=(0,gVn.evaluatedPropsToName)(e,s.props));let{props:h}=s;m();function m(){for(let y of l)d&&g(y),s.allErrors?A(y):(e.var(f,!0),A(y),e.if(f))}a(m,"validatePatternProperties");function g(y){for(let E in d)new RegExp(y).test(E)&&(0,mVn.checkStrictMode)(s,`property ${E} matches pattern ${y} (use allowMatchingProperties)`)}a(g,"checkMatchingProperties");function A(y){e.forIn("key",n,E=>{e.if((0,tat._)`${(0,hVn.usePattern)(t,y)}.test(${E})`,()=>{let _=u.includes(y);_||t.subschema({keyword:"patternProperties",schemaProp:y,dataProp:E,dataPropType:gVn.Type.Str},f),s.opts.unevaluated&&h!==!0?e.assign((0,tat._)`${h}[${E}]`,!0):!_&&!s.allErrors&&e.if((0,tat.not)(f),()=>e.break())})})}a(A,"validateProperties")}};kcr.default=H6s});var yVn=I(Dcr=>{"use strict";p();Object.defineProperty(Dcr,"__esModule",{value:!0});var G6s=Wa(),$6s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,G6s.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Dcr.default=$6s});var EVn=I(Ncr=>{"use strict";p();Object.defineProperty(Ncr,"__esModule",{value:!0});var V6s=xw(),W6s={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:V6s.validateUnion,error:{message:"must match a schema in anyOf"}};Ncr.default=W6s});var _Vn=I(Mcr=>{"use strict";p();Object.defineProperty(Mcr,"__esModule",{value:!0});var rat=ps(),z6s=Wa(),Y6s={message:"must match exactly one schema in oneOf",params:a(({params:t})=>(0,rat._)`{passingSchemas: ${t.passing}}`,"params")},K6s={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Y6s,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,c=e.let("valid",!1),l=e.let("passing",null),u=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(c,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((f,h)=>{let m;(0,z6s.alwaysValidSchema)(o,f)?e.var(u,!0):m=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},u),h>0&&e.if((0,rat._)`${u} && ${c}`).assign(c,!1).assign(l,(0,rat._)`[${l}, ${h}]`).else(),e.if(u,()=>{e.assign(c,!0),e.assign(l,h),m&&t.mergeEvaluated(m,rat.Name)})})}a(d,"validateOneOf")}};Mcr.default=K6s});var vVn=I(Ocr=>{"use strict";p();Object.defineProperty(Ocr,"__esModule",{value:!0});var J6s=Wa(),Z6s={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,c)=>{if((0,J6s.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};Ocr.default=Z6s});var SVn=I(Bcr=>{"use strict";p();Object.defineProperty(Bcr,"__esModule",{value:!0});var nat=ps(),bVn=Wa(),X6s={message:a(({params:t})=>(0,nat.str)`must match "${t.ifClause}" schema`,"message"),params:a(({params:t})=>(0,nat._)`{failingKeyword: ${t.ifClause}}`,"params")},e9s={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:X6s,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,bVn.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=CVn(n,"then"),s=CVn(n,"else");if(!o&&!s)return;let c=e.let("valid",!0),l=e.name("_valid");if(u(),t.reset(),o&&s){let f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,d("then",f),d("else",f))}else o?e.if(l,d("then")):e.if((0,nat.not)(l),d("else"));t.pass(c,()=>t.error(!0));function u(){let f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}a(u,"validateIf");function d(f,h){return()=>{let m=t.subschema({keyword:f},l);e.assign(c,l),t.mergeValidEvaluated(m,c),h?e.assign(h,(0,nat._)`${f}`):t.setParams({ifClause:f})}}a(d,"validateClause")}};function CVn(t,e){let r=t.schema[e];return r!==void 0&&!(0,bVn.alwaysValidSchema)(t,r)}a(CVn,"hasSchema");Bcr.default=e9s});var TVn=I(Lcr=>{"use strict";p();Object.defineProperty(Lcr,"__esModule",{value:!0});var t9s=Wa(),r9s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,t9s.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Lcr.default=r9s});var IVn=I(Fcr=>{"use strict";p();Object.defineProperty(Fcr,"__esModule",{value:!0});var n9s=_cr(),i9s=rVn(),o9s=vcr(),s9s=iVn(),a9s=oVn(),c9s=cVn(),l9s=uVn(),u9s=wcr(),d9s=pVn(),f9s=AVn(),p9s=yVn(),h9s=EVn(),m9s=_Vn(),g9s=vVn(),A9s=SVn(),y9s=TVn();function E9s(t=!1){let e=[p9s.default,h9s.default,m9s.default,g9s.default,A9s.default,y9s.default,l9s.default,u9s.default,c9s.default,d9s.default,f9s.default];return t?e.push(i9s.default,s9s.default):e.push(n9s.default,o9s.default),e.push(a9s.default),e}a(E9s,"getApplicator");Fcr.default=E9s});var xVn=I(Ucr=>{"use strict";p();Object.defineProperty(Ucr,"__esModule",{value:!0});var th=ps(),_9s={message:a(({schemaCode:t})=>(0,th.str)`must match format "${t}"`,"message"),params:a(({schemaCode:t})=>(0,th._)`{format: ${t}}`,"params")},v9s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:_9s,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:c,it:l}=t,{opts:u,errSchemaPath:d,schemaEnv:f,self:h}=l;if(!u.validateFormats)return;o?m():g();function m(){let A=r.scopeValue("formats",{ref:h.formats,code:u.code.formats}),y=r.const("fDef",(0,th._)`${A}[${c}]`),E=r.let("fType"),_=r.let("format");r.if((0,th._)`typeof ${y} == "object" && !(${y} instanceof RegExp)`,()=>r.assign(E,(0,th._)`${y}.type || "string"`).assign(_,(0,th._)`${y}.validate`),()=>r.assign(E,(0,th._)`"string"`).assign(_,y)),t.fail$data((0,th.or)(v(),b()));function v(){return u.strictSchema===!1?th.nil:(0,th._)`${c} && !${_}`}a(v,"unknownFmt");function b(){let T=f.$async?(0,th._)`(${y}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,th._)`${_}(${n})`,w=(0,th._)`(typeof ${_} == "function" ? ${T} : ${_}.test(${n}))`;return(0,th._)`${_} && ${_} !== true && ${E} === ${e} && !${w}`}a(b,"invalidFmt")}a(m,"validate$DataFormat");function g(){let A=h.formats[s];if(!A){v();return}if(A===!0)return;let[y,E,_]=b(A);y===e&&t.pass(T());function v(){if(u.strictSchema===!1){h.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${s}" ignored in schema at path "${d}"`}}a(v,"unknownFormat");function b(w){let R=w instanceof RegExp?(0,th.regexpCode)(w):u.code.formats?(0,th._)`${u.code.formats}${(0,th.getProperty)(s)}`:void 0,x=r.scopeValue("formats",{key:s,ref:w,code:R});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,th._)`${x}.validate`]:["string",w,x]}a(b,"getFormat");function T(){if(typeof A=="object"&&!(A instanceof RegExp)&&A.async){if(!f.$async)throw new Error("async format in sync schema");return(0,th._)`await ${_}(${n})`}return typeof E=="function"?(0,th._)`${_}(${n})`:(0,th._)`${_}.test(${n})`}a(T,"validCondition")}a(g,"validateFormat")}};Ucr.default=v9s});var wVn=I(Qcr=>{"use strict";p();Object.defineProperty(Qcr,"__esModule",{value:!0});var C9s=xVn(),b9s=[C9s.default];Qcr.default=b9s});var RVn=I(rpe=>{"use strict";p();Object.defineProperty(rpe,"__esModule",{value:!0});rpe.contentVocabulary=rpe.metadataVocabulary=void 0;rpe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rpe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kVn=I(qcr=>{"use strict";p();Object.defineProperty(qcr,"__esModule",{value:!0});var S9s=F$n(),T9s=Z$n(),I9s=IVn(),x9s=wVn(),PVn=RVn(),w9s=[S9s.default,T9s.default,(0,I9s.default)(),x9s.default,PVn.metadataVocabulary,PVn.contentVocabulary];qcr.default=w9s});var NVn=I(iat=>{"use strict";p();Object.defineProperty(iat,"__esModule",{value:!0});iat.DiscrError=void 0;var DVn;(function(t){t.Tag="tag",t.Mapping="mapping"})(DVn||(iat.DiscrError=DVn={}))});var OVn=I(Hcr=>{"use strict";p();Object.defineProperty(Hcr,"__esModule",{value:!0});var npe=ps(),jcr=NVn(),MVn=qst(),R9s=Uke(),P9s=Wa(),k9s={message:a(({params:{discrError:t,tagName:e}})=>t===jcr.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,"message"),params:a(({params:{discrError:t,tag:e,tagName:r}})=>(0,npe._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`,"params")},D9s={keyword:"discriminator",type:"object",schemaType:"object",error:k9s,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:c}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!c)throw new Error("discriminator: requires oneOf keyword");let u=e.let("valid",!1),d=e.const("tag",(0,npe._)`${r}${(0,npe.getProperty)(l)}`);e.if((0,npe._)`typeof ${d} == "string"`,()=>f(),()=>t.error(!1,{discrError:jcr.DiscrError.Tag,tag:d,tagName:l})),t.ok(u);function f(){let g=m();e.if(!1);for(let A in g)e.elseIf((0,npe._)`${d} === ${A}`),e.assign(u,h(g[A]));e.else(),t.error(!1,{discrError:jcr.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}a(f,"validateMapping");function h(g){let A=e.name("valid"),y=t.subschema({keyword:"oneOf",schemaProp:g},A);return t.mergeEvaluated(y,npe.Name),A}a(h,"applyTagSchema");function m(){var g;let A={},y=_(o),E=!0;for(let T=0;T{N9s.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var $cr=I((od,Gcr)=>{"use strict";p();Object.defineProperty(od,"__esModule",{value:!0});od.MissingRefError=od.ValidationError=od.CodeGen=od.Name=od.nil=od.stringify=od.str=od._=od.KeywordCxt=od.Ajv=void 0;var M9s=D$n(),O9s=kVn(),B9s=OVn(),LVn=BVn(),L9s=["/properties"],oat="http://json-schema.org/draft-07/schema",ipe=class extends M9s.default{static{a(this,"Ajv")}_addVocabularies(){super._addVocabularies(),O9s.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(B9s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(LVn,L9s):LVn;this.addMetaSchema(e,oat,!1),this.refs["http://json-schema.org/schema"]=oat}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(oat)?oat:void 0)}};od.Ajv=ipe;Gcr.exports=od=ipe;Gcr.exports.Ajv=ipe;Object.defineProperty(od,"__esModule",{value:!0});od.default=ipe;var F9s=Fke();Object.defineProperty(od,"KeywordCxt",{enumerable:!0,get:a(function(){return F9s.KeywordCxt},"get")});var ope=ps();Object.defineProperty(od,"_",{enumerable:!0,get:a(function(){return ope._},"get")});Object.defineProperty(od,"str",{enumerable:!0,get:a(function(){return ope.str},"get")});Object.defineProperty(od,"stringify",{enumerable:!0,get:a(function(){return ope.stringify},"get")});Object.defineProperty(od,"nil",{enumerable:!0,get:a(function(){return ope.nil},"get")});Object.defineProperty(od,"Name",{enumerable:!0,get:a(function(){return ope.Name},"get")});Object.defineProperty(od,"CodeGen",{enumerable:!0,get:a(function(){return ope.CodeGen},"get")});var U9s=Ust();Object.defineProperty(od,"ValidationError",{enumerable:!0,get:a(function(){return U9s.default},"get")});var Q9s=Uke();Object.defineProperty(od,"MissingRefError",{enumerable:!0,get:a(function(){return Q9s.default},"get")})});var $Vn=I(m5=>{"use strict";p();Object.defineProperty(m5,"__esModule",{value:!0});m5.formatNames=m5.fastFormats=m5.fullFormats=void 0;function h5(t,e){return{validate:t,compare:e}}a(h5,"fmtDef");m5.fullFormats={date:h5(qVn,Ycr),time:h5(Wcr(!0),Kcr),"date-time":h5(FVn(!0),HVn),"iso-time":h5(Wcr(),jVn),"iso-date-time":h5(FVn(),GVn),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:V9s,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:X9s,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:W9s,int32:{type:"number",validate:K9s},int64:{type:"number",validate:J9s},float:{type:"number",validate:QVn},double:{type:"number",validate:QVn},password:!0,binary:!0};m5.fastFormats={...m5.fullFormats,date:h5(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Ycr),time:h5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Kcr),"date-time":h5(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,HVn),"iso-time":h5(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,jVn),"iso-date-time":h5(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,GVn),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};m5.formatNames=Object.keys(m5.fullFormats);function q9s(t){return t%4===0&&(t%100!==0||t%400===0)}a(q9s,"isLeapYear");var j9s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,H9s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function qVn(t){let e=j9s.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&q9s(r)?29:H9s[n])}a(qVn,"date");function Ycr(t,e){if(t&&e)return t>e?1:t23||f>59||t&&!l)return!1;if(o<=23&&s<=59&&c<60)return!0;let h=s-f*u,m=o-d*u-(h<0?1:0);return(m===23||m===-1)&&(h===59||h===-1)&&c<61},"time")}a(Wcr,"getTime");function Kcr(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}a(Kcr,"compareTime");function jVn(t,e){if(!(t&&e))return;let r=Vcr.exec(t),n=Vcr.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t=z9s}a(K9s,"validateInt32");function J9s(t){return Number.isInteger(t)}a(J9s,"validateInt64");function QVn(){return!0}a(QVn,"validateNumber");var Z9s=/[^\\]\\Z/;function X9s(t){if(Z9s.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}a(X9s,"regex")});var VVn=I(spe=>{"use strict";p();Object.defineProperty(spe,"__esModule",{value:!0});spe.formatLimitDefinition=void 0;var eUs=$cr(),s2=ps(),qj=s2.operators,sat={formatMaximum:{okStr:"<=",ok:qj.LTE,fail:qj.GT},formatMinimum:{okStr:">=",ok:qj.GTE,fail:qj.LT},formatExclusiveMaximum:{okStr:"<",ok:qj.LT,fail:qj.GTE},formatExclusiveMinimum:{okStr:">",ok:qj.GT,fail:qj.LTE}},tUs={message:a(({keyword:t,schemaCode:e})=>(0,s2.str)`should be ${sat[t].okStr} ${e}`,"message"),params:a(({keyword:t,schemaCode:e})=>(0,s2._)`{comparison: ${sat[t].okStr}, limit: ${e}}`,"params")};spe.formatLimitDefinition={keyword:Object.keys(sat),type:"string",schemaType:"string",$data:!0,error:tUs,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:c,self:l}=s;if(!c.validateFormats)return;let u=new eUs.KeywordCxt(s,l.RULES.all.format.definition,"format");u.$data?d():f();function d(){let m=e.scopeValue("formats",{ref:l.formats,code:c.code.formats}),g=e.const("fmt",(0,s2._)`${m}[${u.schemaCode}]`);t.fail$data((0,s2.or)((0,s2._)`typeof ${g} != "object"`,(0,s2._)`${g} instanceof RegExp`,(0,s2._)`typeof ${g}.compare != "function"`,h(g)))}a(d,"validate$DataFormat");function f(){let m=u.schema,g=l.formats[m];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let A=e.scopeValue("formats",{key:m,ref:g,code:c.code.formats?(0,s2._)`${c.code.formats}${(0,s2.getProperty)(m)}`:void 0});t.fail$data(h(A))}a(f,"validateFormat");function h(m){return(0,s2._)`${m}.compare(${r}, ${n}) ${sat[o].fail} 0`}a(h,"compareCode")},dependencies:["format"]};var rUs=a(t=>(t.addKeyword(spe.formatLimitDefinition),t),"formatLimitPlugin");spe.default=rUs});var KVn=I((Xke,YVn)=>{"use strict";p();Object.defineProperty(Xke,"__esModule",{value:!0});var ape=$Vn(),nUs=VVn(),Jcr=ps(),WVn=new Jcr.Name("fullFormats"),iUs=new Jcr.Name("fastFormats"),Zcr=a((t,e={keywords:!0})=>{if(Array.isArray(e))return zVn(t,e,ape.fullFormats,WVn),t;let[r,n]=e.mode==="fast"?[ape.fastFormats,iUs]:[ape.fullFormats,WVn],o=e.formats||ape.formatNames;return zVn(t,o,r,n),e.keywords&&(0,nUs.default)(t),t},"formatsPlugin");Zcr.get=(t,e="full")=>{let n=(e==="fast"?ape.fastFormats:ape.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function zVn(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Jcr._)`require("ajv-formats/dist/formats").${n}`);for(let c of e)t.addFormat(c,r[c])}a(zVn,"addFormats");YVn.exports=Xke=Zcr;Object.defineProperty(Xke,"__esModule",{value:!0});Xke.default=Zcr});var bWn=I((Uyf,CWn)=>{p();CWn.exports=vWn;vWn.sync=hUs;var EWn=require("fs");function pUs(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n{p();xWn.exports=TWn;TWn.sync=mUs;var SWn=require("fs");function TWn(t,e,r){SWn.stat(t,function(n,o){r(n,n?!1:IWn(o,e))})}a(TWn,"isexe");function mUs(t,e){return IWn(SWn.statSync(t),e)}a(mUs,"sync");function IWn(t,e){return t.isFile()&&gUs(t,e)}a(IWn,"checkStat");function gUs(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),c=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),l=parseInt("100",8),u=parseInt("010",8),d=parseInt("001",8),f=l|u,h=r&d||r&u&&o===c||r&l&&n===s||r&f&&s===0;return h}a(gUs,"checkMode")});var PWn=I((Vyf,RWn)=>{p();var $yf=require("fs"),vat;process.platform==="win32"||global.TESTING_WINDOWS?vat=bWn():vat=wWn();RWn.exports=hlr;hlr.sync=AUs;function hlr(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){hlr(t,e||{},function(s,c){s?o(s):n(c)})})}vat(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}a(hlr,"isexe");function AUs(t,e){try{return vat.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}a(AUs,"sync")});var LWn=I((Yyf,BWn)=>{p();var ype=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",kWn=require("path"),yUs=ype?";":":",DWn=PWn(),NWn=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),MWn=a((t,e)=>{let r=e.colon||yUs,n=t.match(/\//)||ype&&t.match(/\\/)?[""]:[...ype?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=ype?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=ype?o.split(r):[""];return ype&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},"getPathInfo"),OWn=a((t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=MWn(t,e),c=[],l=a(d=>new Promise((f,h)=>{if(d===n.length)return e.all&&c.length?f(c):h(NWn(t));let m=n[d],g=/^".*"$/.test(m)?m.slice(1,-1):m,A=kWn.join(g,t),y=!g&&/^\.[\\\/]/.test(t)?t.slice(0,2)+A:A;f(u(y,d,0))}),"step"),u=a((d,f,h)=>new Promise((m,g)=>{if(h===o.length)return m(l(f+1));let A=o[h];DWn(d+A,{pathExt:s},(y,E)=>{if(!y&&E)if(e.all)c.push(d+A);else return m(d+A);return m(u(d,f,h+1))})}),"subStep");return r?l(0).then(d=>r(null,d),r):l(0)},"which"),EUs=a((t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=MWn(t,e),s=[];for(let c=0;c{"use strict";p();var FWn=a((t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");mlr.exports=FWn;mlr.exports.default=FWn});var HWn=I((tEf,jWn)=>{"use strict";p();var QWn=require("path"),_Us=LWn(),vUs=UWn();function qWn(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let c;try{c=_Us.sync(t.command,{path:r[vUs({env:r})],pathExt:e?QWn.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return c&&(c=QWn.resolve(o?t.options.cwd:"",c)),c}a(qWn,"resolveCommandAttempt");function CUs(t){return qWn(t)||qWn(t,!0)}a(CUs,"resolveCommand");jWn.exports=CUs});var GWn=I((iEf,Alr)=>{"use strict";p();var glr=/([()\][%!^"`<>&|;, *?])/g;function bUs(t){return t=t.replace(glr,"^$1"),t}a(bUs,"escapeCommand");function SUs(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(glr,"^$1"),e&&(t=t.replace(glr,"^$1")),t}a(SUs,"escapeArgument");Alr.exports.command=bUs;Alr.exports.argument=SUs});var VWn=I((aEf,$Wn)=>{"use strict";p();$Wn.exports=/^#!(.*)/});var zWn=I((lEf,WWn)=>{"use strict";p();var TUs=VWn();WWn.exports=(t="")=>{let e=t.match(TUs);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var KWn=I((dEf,YWn)=>{"use strict";p();var ylr=require("fs"),IUs=zWn();function xUs(t){let r=Buffer.alloc(150),n;try{n=ylr.openSync(t,"r"),ylr.readSync(n,r,0,150,0),ylr.closeSync(n)}catch{}return IUs(r.toString())}a(xUs,"readShebang");YWn.exports=xUs});var ezn=I((hEf,XWn)=>{"use strict";p();var wUs=require("path"),JWn=HWn(),ZWn=GWn(),RUs=KWn(),PUs=process.platform==="win32",kUs=/\.(?:com|exe)$/i,DUs=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function NUs(t){t.file=JWn(t);let e=t.file&&RUs(t.file);return e?(t.args.unshift(t.file),t.command=e,JWn(t)):t.file}a(NUs,"detectShebang");function MUs(t){if(!PUs)return t;let e=NUs(t),r=!kUs.test(e);if(t.options.forceShell||r){let n=DUs.test(e);t.command=wUs.normalize(t.command),t.command=ZWn.command(t.command),t.args=t.args.map(s=>ZWn.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}a(MUs,"parseNonShell");function OUs(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:MUs(n)}a(OUs,"parse");XWn.exports=OUs});var nzn=I((AEf,rzn)=>{"use strict";p();var Elr=process.platform==="win32";function _lr(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}a(_lr,"notFoundError");function BUs(t,e){if(!Elr)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=tzn(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}a(BUs,"hookChildProcess");function tzn(t,e){return Elr&&t===1&&!e.file?_lr(e.original,"spawn"):null}a(tzn,"verifyENOENT");function LUs(t,e){return Elr&&t===1&&!e.file?_lr(e.original,"spawnSync"):null}a(LUs,"verifyENOENTSync");rzn.exports={hookChildProcess:BUs,verifyENOENT:tzn,verifyENOENTSync:LUs,notFoundError:_lr}});var szn=I((_Ef,Epe)=>{"use strict";p();var izn=require("child_process"),vlr=ezn(),Clr=nzn();function ozn(t,e,r){let n=vlr(t,e,r),o=izn.spawn(n.command,n.args,n.options);return Clr.hookChildProcess(o,n),o}a(ozn,"spawn");function FUs(t,e,r){let n=vlr(t,e,r),o=izn.spawnSync(n.command,n.args,n.options);return o.error=o.error||Clr.verifyENOENTSync(o.status,n),o}a(FUs,"spawnSync");Epe.exports=ozn;Epe.exports.spawn=ozn;Epe.exports.sync=FUs;Epe.exports._parse=vlr;Epe.exports._enoent=Clr});var mT=I($Z=>{"use strict";p();Object.defineProperty($Z,"__esModule",{value:!0});$Z.DebugNameData=void 0;$Z.getDebugName=hKn;$Z.getClassName=mKn;$Z.getFunctionName=gKn;var fur=class{static{a(this,"DebugNameData")}constructor(e,r,n){this.owner=e,this.debugNameSource=r,this.referenceFn=n}getDebugName(e){return hKn(e,this)}};$Z.DebugNameData=fur;var dKn=new Map,pur=new WeakMap;function hKn(t,e){let r=pur.get(t);if(r)return r;let n=uqs(t,e);if(n){let o=dKn.get(n)??0;o++,dKn.set(n,o);let s=o===1?n:`${n}#${o}`;return pur.set(t,s),s}}a(hKn,"getDebugName");function uqs(t,e){let r=pur.get(t);if(r)return r;let n=e.owner?fqs(e.owner)+".":"",o,s=e.debugNameSource;if(s!==void 0)if(typeof s=="function"){if(o=s(),o!==void 0)return n+o}else return n+s;let c=e.referenceFn;if(c!==void 0&&(o=gKn(c),o!==void 0))return n+o;if(e.owner!==void 0){let l=dqs(e.owner,t);if(l!==void 0)return n+l}}a(uqs,"computeDebugName");function dqs(t,e){for(let r in t)if(t[r]===e)return r}a(dqs,"findKey");var fKn=new Map,pKn=new WeakMap;function fqs(t){let e=pKn.get(t);if(e)return e;let r=mKn(t)??"Object",n=fKn.get(r)??0;n++,fKn.set(r,n);let o=n===1?r:`${r}#${n}`;return pKn.set(t,o),o}a(fqs,"formatOwner");function mKn(t){let e=t.constructor;if(e)return e.name==="Object"?void 0:e.name}a(mKn,"getClassName");function gKn(t){let e=t.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(n?n[1]:void 0)?.trim()}a(gKn,"getFunctionName")});var RKn=I(pp=>{"use strict";p();var pqs=pp&&pp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hqs=pp&&pp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mqs=pp&&pp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot===e}a(_Kn,"strictEqualsC");function vKn(t,e,r){return EKn.equals(t,e,r??hct)}a(vKn,"arrayEquals");function CKn(t){return(e,r)=>EKn.equals(e,r,t??hct)}a(CKn,"arrayEqualsC");function T2e(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let r=0;rT2e(t,e)}a(bKn,"structuralEqualsC");function gqs(t){return JSON.stringify(hur(t))}a(gqs,"getStructuralKey");var Aqs=0,AKn=new WeakMap;function hur(t){if(Array.isArray(t))return t.map(hur);if(t&&typeof t=="object")if(Object.getPrototypeOf(t)===Object.prototype){let e=t,r=Object.create(null);for(let n of Object.keys(e).sort())r[n]=hur(e[n]);return r}else{let e=AKn.get(t);return e===void 0&&(e=Aqs++,AKn.set(t,e)),e+"----2b76a038c20c4bcc"}return t}a(hur,"toNormalizedJsonStructure");function SKn(t,e){return JSON.stringify(t)===JSON.stringify(e)}a(SKn,"jsonStringifyEquals");function TKn(){return(t,e)=>JSON.stringify(t)===JSON.stringify(e)}a(TKn,"jsonStringifyEqualsC");function IKn(){return(t,e)=>t.equals(e)}a(IKn,"thisEqualsC");function xKn(t,e,r){return t==null||e===void 0||e===null?e===t:r(t,e)}a(xKn,"equalsIfDefined");function wKn(t){return(e,r)=>e==null||r===void 0||r===null?r===e:t(e,r)}a(wKn,"equalsIfDefinedC");var yKn;(function(t){t.strict=hct,t.strictC=_Kn,t.array=vKn,t.arrayC=CKn,t.structural=T2e,t.structuralC=bKn,t.jsonStringify=SKn,t.jsonStringifyC=TKn,t.thisC=IKn,t.ifDefined=xKn,t.ifDefinedC=wKn})(yKn||(pp.equals=yKn={}))});var J_=I(hp=>{"use strict";p();Object.defineProperty(hp,"__esModule",{value:!0});hp.trackDisposable=hp.toDisposable=hp.markAsDisposed=hp.DisposableStore=hp.Event=hp.onUnexpectedError=hp.onBugIndicatingError=hp.BugIndicatingError=hp.strictEquals=hp.assertFn=void 0;var yqs=Gu();Object.defineProperty(hp,"assertFn",{enumerable:!0,get:a(function(){return yqs.assertFn},"get")});var Eqs=RKn();Object.defineProperty(hp,"strictEquals",{enumerable:!0,get:a(function(){return Eqs.strictEquals},"get")});var mur=bs();Object.defineProperty(hp,"BugIndicatingError",{enumerable:!0,get:a(function(){return mur.BugIndicatingError},"get")});Object.defineProperty(hp,"onBugIndicatingError",{enumerable:!0,get:a(function(){return mur.onBugIndicatingError},"get")});Object.defineProperty(hp,"onUnexpectedError",{enumerable:!0,get:a(function(){return mur.onUnexpectedError},"get")});var _qs=_c();Object.defineProperty(hp,"Event",{enumerable:!0,get:a(function(){return _qs.Event},"get")});var mct=Io();Object.defineProperty(hp,"DisposableStore",{enumerable:!0,get:a(function(){return mct.DisposableStore},"get")});Object.defineProperty(hp,"markAsDisposed",{enumerable:!0,get:a(function(){return mct.markAsDisposed},"get")});Object.defineProperty(hp,"toDisposable",{enumerable:!0,get:a(function(){return mct.toDisposable},"get")});Object.defineProperty(hp,"trackDisposable",{enumerable:!0,get:a(function(){return mct.trackDisposable},"get")})});var PKn=I(gur=>{"use strict";p();Object.defineProperty(gur,"__esModule",{value:!0});gur.handleBugIndicatingErrorRecovery=Cqs;var vqs=J_();function Cqs(t){let e=new Error("BugIndicatingErrorRecovery: "+t);(0,vqs.onUnexpectedError)(e),console.error("recovered from an error that indicates a bug",e)}a(Cqs,"handleBugIndicatingErrorRecovery")});var v5=I(Npe=>{"use strict";p();Object.defineProperty(Npe,"__esModule",{value:!0});Npe.addLogger=bqs;Npe.getLogger=Sqs;Npe.setLogObservableFn=Tqs;Npe.logObservable=Iqs;var VZ;function bqs(t){VZ?VZ instanceof gct?VZ.loggers.push(t):VZ=new gct([VZ,t]):VZ=t}a(bqs,"addLogger");function Sqs(){return VZ}a(Sqs,"getLogger");var Aur;function Tqs(t){Aur=t}a(Tqs,"setLogObservableFn");function Iqs(t){Aur&&Aur(t)}a(Iqs,"logObservable");var gct=class{static{a(this,"ComposedLogger")}constructor(e){this.loggers=e}handleObservableCreated(e,r){for(let n of this.loggers)n.handleObservableCreated(e,r)}handleOnListenerCountChanged(e,r){for(let n of this.loggers)n.handleOnListenerCountChanged(e,r)}handleObservableUpdated(e,r){for(let n of this.loggers)n.handleObservableUpdated(e,r)}handleAutorunCreated(e,r){for(let n of this.loggers)n.handleAutorunCreated(e,r)}handleAutorunDisposed(e){for(let r of this.loggers)r.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,r,n){for(let o of this.loggers)o.handleAutorunDependencyChanged(e,r,n)}handleAutorunStarted(e){for(let r of this.loggers)r.handleAutorunStarted(e)}handleAutorunFinished(e){for(let r of this.loggers)r.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,r,n){for(let o of this.loggers)o.handleDerivedDependencyChanged(e,r,n)}handleDerivedCleared(e){for(let r of this.loggers)r.handleDerivedCleared(e)}handleBeginTransaction(e){for(let r of this.loggers)r.handleBeginTransaction(e)}handleEndTransaction(e){for(let r of this.loggers)r.handleEndTransaction(e)}}});var MF=I(Wj=>{"use strict";p();Object.defineProperty(Wj,"__esModule",{value:!0});Wj.TransactionImpl=void 0;Wj.transaction=yur;Wj.globalTransaction=wqs;Wj.asyncTransaction=Rqs;Wj.subtransaction=Pqs;var kKn=PKn(),xqs=mT(),DKn=v5();function yur(t,e){let r=new Mpe(t,e);try{t(r)}finally{r.finish()}}a(yur,"transaction");var Act;function wqs(t){if(Act)t(Act);else{let e=new Mpe(t,void 0);Act=e;try{t(e)}finally{e.finish(),Act=void 0}}}a(wqs,"globalTransaction");async function Rqs(t,e){let r=new Mpe(t,e);try{await t(r)}finally{r.finish()}}a(Rqs,"asyncTransaction");function Pqs(t,e,r){t?e(t):yur(e,r)}a(Pqs,"subtransaction");var Mpe=class{static{a(this,"TransactionImpl")}constructor(e,r){this._fn=e,this._getDebugName=r,this._updatingObservers=[],(0,DKn.getLogger)()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():(0,xqs.getFunctionName)(this._fn)}updateObserver(e,r){if(!this._updatingObservers){(0,kKn.handleBugIndicatingErrorRecovery)("Transaction already finished!"),yur(n=>{n.updateObserver(e,r)});return}this._updatingObservers.push({observer:e,observable:r}),e.beginUpdate(r)}finish(){let e=this._updatingObservers;if(!e){(0,kKn.handleBugIndicatingErrorRecovery)("transaction.finish() has already been called!");return}for(let r=0;r{"use strict";p();Object.defineProperty(yct,"__esModule",{value:!0});yct.DebugLocation=void 0;var NKn;(function(t){let e=!1;function r(){e=!0}a(r,"enable"),t.enable=r;function n(){if(!e)return;let o=Error,s=o.stackTraceLimit;o.stackTraceLimit=3;let c=new Error().stack;return o.stackTraceLimit=s,Eur.fromStack(c,2)}a(n,"ofCaller"),t.ofCaller=n})(NKn||(yct.DebugLocation=NKn={}));var Eur=class t{static{a(this,"DebugLocationImpl")}static fromStack(e,r){let n=e.split(` +`),o=kqs(n[r+1]);if(o)return new t(o.fileName,o.line,o.column,o.id)}constructor(e,r,n,o){this.fileName=e,this.line=r,this.column=n,this.id=o}};function kqs(t){let e=t.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:t};let r=t.match(/at ([^\(\)]*):(\d+):(\d+)/);if(r)return{fileName:r[1],line:parseInt(r[2]),column:parseInt(r[3]),id:t}}a(kqs,"parseLine")});var d2=I(C5=>{"use strict";p();Object.defineProperty(C5,"__esModule",{value:!0});C5.BaseObservable=C5.ConvenientObservable=void 0;C5._setDerivedOpts=Nqs;C5._setRecomputeInitiallyAndOnChange=Mqs;C5._setKeepObserved=Oqs;C5._setDebugGetObservableGraph=Bqs;var MKn=gT(),Dqs=mT(),Ope=v5(),_ur;function Nqs(t){_ur=t}a(Nqs,"_setDerivedOpts");var OKn;function Mqs(t){OKn=t}a(Mqs,"_setRecomputeInitiallyAndOnChange");var BKn;function Oqs(t){BKn=t}a(Oqs,"_setKeepObserved");var vur;function Bqs(t){vur=t}a(Bqs,"_setDebugGetObservableGraph");var Ect=class{static{a(this,"ConvenientObservable")}get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,r,n=MKn.DebugLocation.ofCaller()){let o=r===void 0?void 0:e,s=r===void 0?e:r;return _ur({owner:o,debugName:a(()=>{let c=(0,Dqs.getFunctionName)(s);if(c!==void 0)return c;let u=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(u)return`${this.debugName}.${u[2]}`;if(!o)return`${this.debugName} (mapped)`},"debugName"),debugReferenceFn:s},c=>s(this.read(c),c),n)}flatten(){return _ur({owner:void 0,debugName:a(()=>`${this.debugName} (flattened)`,"debugName")},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,r){return e.add(OKn(this,r)),this}keepObserved(e){return e.add(BKn(this)),this}get debugValue(){return this.get()}get debug(){return new Cur(this)}};C5.ConvenientObservable=Ect;var Cur=class{static{a(this,"DebugHelper")}constructor(e){this.observable=e}getDependencyGraph(){return vur(this.observable,{type:"dependencies"})}getObserverGraph(){return vur(this.observable,{type:"observers"})}},bur=class extends Ect{static{a(this,"BaseObservable")}constructor(e){super(),this._observers=new Set,(0,Ope.getLogger)()?.handleObservableCreated(this,e)}addObserver(e){let r=this._observers.size;this._observers.add(e),r===0&&this.onFirstObserverAdded(),r!==this._observers.size&&(0,Ope.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let r=this._observers.delete(e);r&&this._observers.size===0&&this.onLastObserverRemoved(),r&&(0,Ope.getLogger)()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!(0,Ope.getLogger)();return(0,Ope.logObservable)(this),e||(0,Ope.getLogger)()?.handleObservableCreated(this,MKn.DebugLocation.ofCaller()),this}debugGetObservers(){return this._observers}};C5.BaseObservable=bur});var OF=I(zj=>{"use strict";p();Object.defineProperty(zj,"__esModule",{value:!0});zj.DisposableObservableValue=zj.ObservableValue=void 0;zj.observableValue=Uqs;zj.disposableObservableValue=Qqs;var Lqs=MF(),Fqs=d2(),FKn=J_(),_ct=mT(),LKn=v5(),UKn=gT();function Uqs(t,e,r=UKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new _ct.DebugNameData(void 0,t,void 0):n=new _ct.DebugNameData(t,void 0,void 0),new I2e(n,e,FKn.strictEquals,r)}a(Uqs,"observableValue");var I2e=class extends Fqs.BaseObservable{static{a(this,"ObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._value=r,(0,LKn.getLogger)()?.handleObservableUpdated(this,{hadValue:!1,newValue:r,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new Lqs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{let s=this._value;this._setValue(e),(0,LKn.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:e,change:n,didChange:!0,hadValue:!0});for(let c of this._observers)r.updateObserver(c,this),c.handleChange(this,n)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};zj.ObservableValue=I2e;function Qqs(t,e,r=UKn.DebugLocation.ofCaller()){let n;return typeof t=="string"?n=new _ct.DebugNameData(void 0,t,void 0):n=new _ct.DebugNameData(t,void 0,void 0),new vct(n,e,FKn.strictEquals,r)}a(Qqs,"disposableObservableValue");var vct=class extends I2e{static{a(this,"DisposableObservableValue")}_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}};zj.DisposableObservableValue=vct});var qKn=I(Cct=>{"use strict";p();Object.defineProperty(Cct,"__esModule",{value:!0});Cct.LazyObservableValue=void 0;var qqs=MF(),QKn=v5(),jqs=d2(),Sur=class extends jqs.BaseObservable{static{a(this,"LazyObservableValue")}get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,r,n,o){super(o),this._debugNameData=e,this._equalityComparator=n,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=r}get(){return this._update(),this._value}_update(){if(!this._isUpToDate)if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas){(0,QKn.getLogger)()?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let r of this._observers)r.handleChange(this,e)}this._deltas.length=0}else{(0,QKn.getLogger)()?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0});for(let e of this._observers)e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,this._updateCounter===1)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){this._update();let e=[...this._observers];for(let r of e)r.endUpdate(this)}}addObserver(e){let r=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),r&&e.beginUpdate(this)}removeObserver(e){let r=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),r&&e.endUpdate(this)}set(e,r,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let o;r||(r=o=new qqs.TransactionImpl(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),n!==void 0&&this._deltas.push(n),r.updateObserver({beginUpdate:a(()=>this._beginUpdate(),"beginUpdate"),endUpdate:a(()=>this._endUpdate(),"endUpdate"),handleChange:a((s,c)=>{},"handleChange"),handlePossibleChange:a(s=>{},"handlePossibleChange")},this),this._updateCounter>1)for(let s of this._observers)s.handlePossibleChange(this)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}};Cct.LazyObservableValue=Sur});var bct=I(Tur=>{"use strict";p();Object.defineProperty(Tur,"__esModule",{value:!0});Tur.observableValueOpts=Vqs;var jKn=mT(),HKn=J_(),Hqs=OF(),Gqs=qKn(),$qs=gT();function Vqs(t,e,r=$qs.DebugLocation.ofCaller()){return t.lazy?new Gqs.LazyObservableValue(new jKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??HKn.strictEquals,r):new Hqs.ObservableValue(new jKn.DebugNameData(t.owner,t.debugName,void 0),e,t.equalsFn??HKn.strictEquals,r)}a(Vqs,"observableValueOpts")});var Tct=I(Sct=>{"use strict";p();Object.defineProperty(Sct,"__esModule",{value:!0});Sct.AutorunObserver=void 0;var kw=J_(),x2e=v5();function Wqs(t){switch(t){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(Wqs,"autorunStateToString");var Iur=class{static{a(this,"AutorunObserver")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o){this._debugNameData=e,this._runFn=r,this._changeTracker=n,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),(0,x2e.getLogger)()?.handleAutorunCreated(this,o),this._run(),(0,kw.trackDisposable)(this)}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),(0,x2e.getLogger)()?.handleAutorunDisposed(this),(0,kw.markAsDisposed)(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){(0,x2e.getLogger)()?.handleAutorunStarted(this);let r=this._changeSummary,n=this._delayedStore;n!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,r),this._changeSummary=this._changeTracker.createChangeSummary(r)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,r)}catch(o){(0,kw.onBugIndicatingError)(o)}finally{this._isRunning=!1,n!==void 0&&n.dispose()}}}finally{this._disposed||(0,x2e.getLogger)()?.handleAutorunFinished(this);for(let r of this._dependenciesToBeRemoved)r.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===3&&(this._checkIterations(),this._state=1),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===1){this._state=3;for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._iteration++,this._state!==3&&this._run()}while(this._state!==3)}}finally{this._updateCount--}(0,kw.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===3&&this._isDependency(e)&&(this._checkIterations(),this._state=1)}handleChange(e,r){if(this._isDependency(e)){(0,x2e.getLogger)()?.handleAutorunDependencyChanged(this,e,r);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(o=>o===e,"didChange")},this._changeSummary))&&(this._checkIterations(),this._state=2)}catch(n){(0,kw.onBugIndicatingError)(n)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new kw.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}get store(){if(this._ensureNoRunning(),this._disposed)throw new kw.BugIndicatingError("Cannot access store after dispose");return this._store===void 0&&(this._store=new kw.DisposableStore),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new kw.BugIndicatingError("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new kw.DisposableStore),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:Wqs(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}_checkIterations(){return this._iteration>100?((0,kw.onBugIndicatingError)(new kw.BugIndicatingError(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}};Sct.AutorunObserver=Iur});var WZ=I(Dw=>{"use strict";p();Object.defineProperty(Dw,"__esModule",{value:!0});Dw.autorun=Rur;Dw.autorunOpts=w2e;Dw.autorunHandleChanges=GKn;Dw.autorunWithStoreHandleChanges=Kqs;Dw.autorunWithStore=Jqs;Dw.autorunDelta=Zqs;Dw.autorunIterableDelta=Xqs;Dw.autorunPerKeyedItem=ejs;Dw.autorunSelfDisposable=tjs;Dw.registerAutorunSelfDisposable=rjs;var Bpe=J_(),xur=mT(),wur=Tct(),Lpe=gT(),zqs=OF(),Yqs=MF();function Rur(t,e=Lpe.DebugLocation.ofCaller()){return new wur.AutorunObserver(new xur.DebugNameData(void 0,void 0,t),t,void 0,e)}a(Rur,"autorun");function w2e(t,e,r=Lpe.DebugLocation.ofCaller()){return new wur.AutorunObserver(new xur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,void 0,r)}a(w2e,"autorunOpts");function GKn(t,e,r=Lpe.DebugLocation.ofCaller()){return new wur.AutorunObserver(new xur.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??e),e,t.changeTracker,r)}a(GKn,"autorunHandleChanges");function Kqs(t,e){let r=new Bpe.DisposableStore,n=GKn({owner:t.owner,debugName:t.debugName,debugReferenceFn:t.debugReferenceFn??e,changeTracker:t.changeTracker},(o,s)=>{r.clear(),e(o,s,r)});return(0,Bpe.toDisposable)(()=>{n.dispose(),r.dispose()})}a(Kqs,"autorunWithStoreHandleChanges");function Jqs(t){let e=new Bpe.DisposableStore,r=w2e({owner:void 0,debugName:void 0,debugReferenceFn:t},n=>{e.clear(),t(n,e)});return(0,Bpe.toDisposable)(()=>{r.dispose(),e.dispose()})}a(Jqs,"autorunWithStore");function Zqs(t,e){let r;return w2e({debugReferenceFn:e},n=>{let o=t.read(n),s=r;r=o,e({lastValue:s,newValue:o})})}a(Zqs,"autorunDelta");function Xqs(t,e,r=n=>n){let n=new Map;return w2e({debugReferenceFn:t},o=>{let s=new Map,c=new Map(n);for(let l of t(o)){let u=r(l);n.has(u)?c.delete(u):(s.set(u,l),n.set(u,l))}for(let l of c.keys())n.delete(l);(s.size||c.size)&&e({addedValues:[...s.values()],removedValues:[...c.values()]})})}a(Xqs,"autorunIterableDelta");function ejs(t,e,r,n=Lpe.DebugLocation.ofCaller()){let o=new Map,s=w2e({debugReferenceFn:r},c=>{let l=t.read(c),u=new Set,d=[];(0,Yqs.transaction)(f=>{for(let h of l){let m=e(h);u.add(m);let g=o.get(m);if(g)g.value.set(h,f);else{let A=new Bpe.DisposableStore,E={value:(0,zqs.observableValue)("keyedItem",h),store:A};o.set(m,E),d.push({key:m,cell:E})}}for(let[h,m]of o)u.has(h)||(m.store.dispose(),o.delete(h))});for(let{key:f,cell:h}of d)r(f,h.value,h.store)},n);return(0,Bpe.toDisposable)(()=>{s.dispose();for(let c of o.values())c.store.dispose();o.clear()})}a(ejs,"autorunPerKeyedItem");function tjs(t,e=Lpe.DebugLocation.ofCaller()){let r,n=!1;return r=Rur(o=>{t({delayedStore:o.delayedStore,store:o.store,readObservable:o.readObservable.bind(o),dispose:a(()=>{r?.dispose(),n=!0},"dispose")})},e),n&&r.dispose(),r}a(tjs,"autorunSelfDisposable");function rjs(t,e,r=Lpe.DebugLocation.ofCaller()){let n,o=!1;n=Rur(s=>{e({delayedStore:s.delayedStore,store:s.store,readObservable:s.readObservable.bind(s),dispose:a(()=>{n?t.delete(n):o=!0},"dispose")})},r),o?n.dispose():t.add(n)}a(rjs,"registerAutorunSelfDisposable")});var Upe=I(Fpe=>{"use strict";p();Object.defineProperty(Fpe,"__esModule",{value:!0});Fpe.DerivedWithSetter=Fpe.Derived=void 0;var njs=d2(),zZ=J_(),Pur=v5();function ijs(t){switch(t){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return""}}a(ijs,"derivedStateToString");var Ict=class extends njs.BaseObservable{static{a(this,"Derived")}get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,r,n,o=void 0,s,c){super(c),this._debugNameData=e,this._computeFn=r,this._changeTracker=n,this._handleLastObserverRemoved=o,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=0,this._value=void 0,(0,Pur.getLogger)()?.handleDerivedCleared(this);for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,this._observers.size===0){let r;try{this._isReaderValid=!0;let n;this._changeTracker&&(n=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,n)),r=this._computeFn(this,n)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),r}else{do{if(this._state===1){for(let r of this._dependencies)if(r.reportChanges(),this._state===2)break}this._state===1&&(this._state=3),this._state!==3&&this._recompute()}while(this._state!==3);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let r=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=r;try{let n=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,n),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(n));let o=this._state!==0,s=this._value;this._state=3;let c=this._delayedStore;c!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,n)}finally{this._isReaderValid=!1;for(let l of this._dependenciesToBeRemoved)l.removeObserver(this);this._dependenciesToBeRemoved.clear(),c!==void 0&&c.dispose()}e=this._didReportChange||o&&!this._equalityComparator(s,this._value),(0,Pur.getLogger)()?.handleObservableUpdated(this,{oldValue:s,newValue:this._value,change:void 0,didChange:e,hadValue:o})}catch(n){(0,zZ.onBugIndicatingError)(n)}if(this._isComputing=!1,!this._didReportChange&&e)for(let n of this._observers)n.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new zZ.BugIndicatingError("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let r=this._updateCount===1;if(this._state===3&&(this._state=1,!r))for(let n of this._observers)n.handlePossibleChange(this);if(r)for(let n of this._observers)n.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let r=[...this._observers];for(let n of r)n.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let n=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let o of n)o.endUpdate(this)}}(0,zZ.assertFn)(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===3&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=1;for(let r of this._observers)r.handlePossibleChange(this)}}handleChange(e,r){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){(0,Pur.getLogger)()?.handleDerivedDependencyChanged(this,e,r);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:r,didChange:a(s=>s===e,"didChange")},this._changeSummary):!0}catch(s){(0,zZ.onBugIndicatingError)(s)}let o=this._state===3;if(n&&(this._state===1||o)&&(this._state=2,o))for(let s of this._observers)s.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new zZ.BugIndicatingError("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let r=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),r}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let r of this._observers)r.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new zZ.DisposableStore),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new zZ.DisposableStore),this._delayedStore}addObserver(e){let r=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),r&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:ijs(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=2:this._recompute()}finally{this.endUpdate(this)}}setValue(e,r,n){this._value=e;let o=this._observers;r.updateObserver(this,this);for(let s of o)s.handleChange(this,n)}};Fpe.Derived=Ict;var kur=class extends Ict{static{a(this,"DerivedWithSetter")}constructor(e,r,n,o=void 0,s,c,l){super(e,r,n,o,s,l),this.set=c}};Fpe.DerivedWithSetter=kur});var xct=I(Yj=>{"use strict";p();Object.defineProperty(Yj,"__esModule",{value:!0});Yj.derived=sjs;Yj.derivedWithSetter=ajs;Yj.derivedOpts=$Kn;Yj.derivedHandleChanges=cjs;Yj.derivedWithStore=ljs;Yj.derivedDisposable=ujs;var b5=J_(),Qpe=gT(),YZ=mT(),ojs=d2(),KZ=Upe();function sjs(t,e,r=Qpe.DebugLocation.ofCaller()){return e!==void 0?new KZ.Derived(new YZ.DebugNameData(t,void 0,e),e,void 0,void 0,b5.strictEquals,r):new KZ.Derived(new YZ.DebugNameData(void 0,void 0,t),t,void 0,void 0,b5.strictEquals,r)}a(sjs,"derived");function ajs(t,e,r,n=Qpe.DebugLocation.ofCaller()){return new KZ.DerivedWithSetter(new YZ.DebugNameData(t,void 0,e),e,void 0,void 0,b5.strictEquals,r,n)}a(ajs,"derivedWithSetter");function $Kn(t,e,r=Qpe.DebugLocation.ofCaller()){return new KZ.Derived(new YZ.DebugNameData(t.owner,t.debugName,t.debugReferenceFn),e,void 0,t.onLastObserverRemoved,t.equalsFn??b5.strictEquals,r)}a($Kn,"derivedOpts");(0,ojs._setDerivedOpts)($Kn);function cjs(t,e,r=Qpe.DebugLocation.ofCaller()){return new KZ.Derived(new YZ.DebugNameData(t.owner,t.debugName,void 0),e,t.changeTracker,void 0,t.equalityComparer??b5.strictEquals,r)}a(cjs,"derivedHandleChanges");function ljs(t,e,r=Qpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s=new b5.DisposableStore;return new KZ.Derived(new YZ.DebugNameData(o,void 0,n),c=>(s.isDisposed?s=new b5.DisposableStore:s.clear(),n(c,s)),void 0,()=>s.dispose(),b5.strictEquals,r)}a(ljs,"derivedWithStore");function ujs(t,e,r=Qpe.DebugLocation.ofCaller()){let n,o;e===void 0?(n=t,o=void 0):(o=t,n=e);let s;return new KZ.Derived(new YZ.DebugNameData(o,void 0,n),c=>{s?s.clear():s=new b5.DisposableStore;let l=n(c);return l&&s.add(l),l},void 0,()=>{s&&(s.dispose(),s=void 0)},b5.strictEquals,r)}a(ujs,"derivedDisposable")});var zKn=I(Nw=>{"use strict";p();Object.defineProperty(Nw,"__esModule",{value:!0});Nw.ObservableLazyPromise=Nw.ObservableResolvedPromise=Nw.PromiseResult=Nw.ObservablePromise=Nw.ObservableLazy=void 0;var djs=WZ(),VKn=MF(),WKn=xct(),wct=OF(),Rct=class{static{a(this,"ObservableLazy")}get cachedValue(){return this._value}constructor(e){this._computeValue=e,this._value=(0,wct.observableValue)(this,void 0)}getValue(){let e=this._value.get();return e||(e=this._computeValue(),this._value.set(e,void 0)),e}};Nw.ObservableLazy=Rct;var Pct=class t{static{a(this,"ObservablePromise")}static fromFn(e){return new t(e())}static resolved(e){return new t(Promise.resolve(e))}constructor(e){this._value=(0,wct.observableValue)(this,void 0),this.promiseResult=this._value,this.resolvedValue=(0,WKn.derived)(this,r=>{let n=this.promiseResult.read(r);if(n)return n.getDataOrThrow()}),this.promise=e.then(r=>((0,VKn.transaction)(n=>{this._value.set(new R2e(r,void 0),n)}),r),r=>{throw(0,VKn.transaction)(n=>{this._value.set(new R2e(void 0,r),n)}),r})}};Nw.ObservablePromise=Pct;var R2e=class{static{a(this,"PromiseResult")}constructor(e,r){this.data=e,this.error=r}getDataOrThrow(){if(this.error)throw this.error;return this.data}};Nw.PromiseResult=R2e;var Dur=class{static{a(this,"ObservableResolvedPromise")}constructor(e,r,n){this._isResolving=(0,wct.observableValue)(this,!1),this.isResolving=this._isResolving,this._lastResolved=(0,wct.observableValue)(this,r),this.lastResolved=this._lastResolved,n.add((0,djs.autorun)(o=>{let s=e.read(o);this._runningPromise=s;let c=s.promiseResult.read(o);c?s===this._runningPromise&&(this._isResolving.set(!1,void 0),this._lastResolved.set(c.getDataOrThrow(),void 0)):this._isResolving.set(!0,void 0)}))}};Nw.ObservableResolvedPromise=Dur;var Nur=class{static{a(this,"ObservableLazyPromise")}constructor(e){this._computePromise=e,this._lazyValue=new Rct(()=>new Pct(this._computePromise())),this.cachedPromiseResult=(0,WKn.derived)(this,r=>this._lazyValue.cachedValue.read(r)?.promiseResult.read(r))}getPromise(){return this._lazyValue.getValue().promise}};Nw.ObservableLazyPromise=Nur});var Our=I(S5=>{"use strict";p();Object.defineProperty(S5,"__esModule",{value:!0});S5.cancelOnDispose=S5.CancellationTokenSource=S5.CancellationToken=S5.CancellationError=void 0;var fjs=bs();Object.defineProperty(S5,"CancellationError",{enumerable:!0,get:a(function(){return fjs.CancellationError},"get")});var Mur=ik();Object.defineProperty(S5,"CancellationToken",{enumerable:!0,get:a(function(){return Mur.CancellationToken},"get")});Object.defineProperty(S5,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Mur.CancellationTokenSource},"get")});Object.defineProperty(S5,"cancelOnDispose",{enumerable:!0,get:a(function(){return Mur.cancelOnDispose},"get")})});var YKn=I(kct=>{"use strict";p();Object.defineProperty(kct,"__esModule",{value:!0});kct.waitForState=yjs;kct.derivedWithCancellationToken=Ejs;var pjs=mT(),Bur=Our(),hjs=J_(),mjs=WZ(),gjs=Upe(),Ajs=gT();function yjs(t,e,r,n){return e||(e=a(o=>o!=null,"predicate")),new Promise((o,s)=>{let c=!0,l=!1,u=t.map(f=>({isFinished:e(f),error:r?r(f):!1,state:f})),d=(0,mjs.autorun)(f=>{let{isFinished:h,error:m,state:g}=u.read(f);(h||m)&&(c?l=!0:d.dispose(),m?s(m===!0?g:m):o(g))});if(n){let f=n.onCancellationRequested(()=>{d.dispose(),f.dispose(),s(new Bur.CancellationError)});if(n.isCancellationRequested){d.dispose(),f.dispose(),s(new Bur.CancellationError);return}}c=!1,l&&d.dispose()})}a(yjs,"waitForState");function Ejs(t,e){let r,n;e===void 0?(r=t,n=void 0):(n=t,r=e);let o;return new gjs.Derived(new pjs.DebugNameData(n,void 0,r),s=>(o&&o.dispose(!0),o=new Bur.CancellationTokenSource,r(s,o.token)),void 0,()=>o?.dispose(),hjs.strictEquals,Ajs.DebugLocation.ofCaller())}a(Ejs,"derivedWithCancellationToken")});var Kj=I(JZ=>{"use strict";p();Object.defineProperty(JZ,"__esModule",{value:!0});JZ.FromEventObservable=void 0;JZ.observableFromEvent=Lur;JZ.observableFromEventOpts=Cjs;var _js=MF(),JKn=J_(),ZKn=mT(),KKn=v5(),vjs=d2(),XKn=gT();function Lur(...t){let e,r,n,o;return t.length===2?[r,n]=t:[e,r,n,o]=t,new f2(new ZKn.DebugNameData(e,void 0,n),r,n,()=>f2.globalTransaction,JKn.strictEquals,o??XKn.DebugLocation.ofCaller())}a(Lur,"observableFromEvent");function Cjs(t,e,r,n=XKn.DebugLocation.ofCaller()){return new f2(new ZKn.DebugNameData(t.owner,t.debugName,t.debugReferenceFn??r),e,r,()=>t.getTransaction?.()??f2.globalTransaction,t.equalsFn??JKn.strictEquals,n)}a(Cjs,"observableFromEventOpts");var f2=class extends vjs.BaseObservable{static{a(this,"FromEventObservable")}constructor(e,r,n,o,s,c){super(c),this._debugNameData=e,this.event=r,this._getValue=n,this._getTransaction=o,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=l=>{let u=this._getValue(l),d=this._value,f=!this._hasValue||!this._equalityComparator(d,u),h=!1;f&&(this._value=u,this._hasValue&&(h=!0,(0,_js.subtransaction)(this._getTransaction(),m=>{(0,KKn.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue});for(let g of this._observers)m.updateObserver(g,this),g.handleChange(this,void 0)},()=>{let m=this.getDebugName();return"Event fired"+(m?`: ${m}`:"")})),this._hasValue=!0),h||(0,KKn.getLogger)()?.handleObservableUpdated(this,{oldValue:d,newValue:u,change:void 0,didChange:f,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};JZ.FromEventObservable=f2;(function(t){t.Observer=f2;function e(r,n){let o=!1;f2.globalTransaction===void 0&&(f2.globalTransaction=r,o=!0);try{n()}finally{o&&(f2.globalTransaction=void 0)}}a(e,"batchEventsGlobally"),t.batchEventsGlobally=e})(Lur||(JZ.observableFromEvent=Lur={}))});var Uur=I(Fur=>{"use strict";p();Object.defineProperty(Fur,"__esModule",{value:!0});Fur.observableSignal=xjs;var bjs=MF(),Sjs=mT(),Tjs=d2(),Ijs=gT();function xjs(t,e=Ijs.DebugLocation.ofCaller()){return typeof t=="string"?new Dct(t,void 0,e):new Dct(void 0,t,e)}a(xjs,"observableSignal");var Dct=class extends Tjs.BaseObservable{static{a(this,"ObservableSignal")}get debugName(){return new Sjs.DebugNameData(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,r,n){super(n),this._debugName=e,this._owner=r}trigger(e,r){if(!e){(0,bjs.transaction)(n=>{this.trigger(n,r)},()=>`Trigger signal ${this.debugName}`);return}for(let n of this._observers)e.updateObserver(n,this),n.handleChange(this,r)}get(){}}});var Mct=I(pE=>{"use strict";p();Object.defineProperty(pE,"__esModule",{value:!0});pE.KeepAliveObserver=void 0;pE.observableFromPromise=wjs;pE.signalFromObservable=Rjs;pE.debouncedObservable=Pjs;pE.throttledObservable=kjs;pE.debouncedObservable2=Djs;pE.wasEventTriggeredRecently=Njs;pE.keepObserved=oJn;pE.recomputeInitiallyAndOnChange=sJn;pE.derivedObservableWithCache=Mjs;pE.derivedObservableWithWritableCache=Ojs;pE.mapObservableArrayCached=Bjs;pE.isObservable=Ljs;var eJn=WZ(),tJn=OF(),Qur=J_(),k2e=xct(),rJn=Kj(),nJn=Uur(),iJn=d2(),qur=gT();function wjs(t){let e=(0,tJn.observableValue)("promiseValue",{});return t.then(r=>{e.set({value:r},void 0)}),e}a(wjs,"observableFromPromise");function Rjs(t,e){return(0,k2e.derivedOpts)({owner:t,equalsFn:a(()=>!1,"equalsFn")},r=>{e.read(r)})}a(Rjs,"signalFromObservable");function Pjs(t,e,r=qur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,rJn.observableFromEvent)(void 0,c=>{let l=(0,eJn.autorun)(u=>{let d=t.read(u);if(!n)n=!0,o=d;else{s&&clearTimeout(s);let f=typeof e=="number"?e:e(o,d);if(f===0){o=d,c();return}s=setTimeout(()=>{o=d,c()},f)}});return{dispose(){l.dispose(),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(Pjs,"debouncedObservable");function kjs(t,e,r=qur.DebugLocation.ofCaller()){let n=!1,o,s;return(0,rJn.observableFromEvent)(void 0,c=>{let l=(0,eJn.autorun)(u=>{let d=t.read(u);n?s||(s=setTimeout(()=>{s=void 0,o=t.read(void 0),c()},e)):(n=!0,o=d)});return{dispose(){l.dispose(),s&&(clearTimeout(s),s=void 0),n=!1,o=void 0}}},()=>n?o:t.get(),r)}a(kjs,"throttledObservable");function Djs(t,e,r=qur.DebugLocation.ofCaller()){let n=(0,nJn.observableSignal)("handleTimeout"),o,s;return(0,k2e.derivedOpts)({owner:void 0,onLastObserverRemoved:a(()=>{o=void 0},"onLastObserverRemoved")},l=>{let u=t.read(l);if(n.read(l),u!==o){let d=typeof e=="number"?e:e(o,u);if(d===0)return o=u,u;s&&clearTimeout(s),s=setTimeout(()=>{o=u,n.trigger(void 0)},d)}return o},r)}a(Djs,"debouncedObservable2");function Njs(t,e,r){let n=(0,tJn.observableValue)("triggeredRecently",!1),o;return r.add(t(()=>{n.set(!0,void 0),o&&clearTimeout(o),o=setTimeout(()=>{n.set(!1,void 0)},e)})),n}a(Njs,"wasEventTriggeredRecently");function oJn(t){let e=new P2e(!1,void 0);return t.addObserver(e),(0,Qur.toDisposable)(()=>{t.removeObserver(e)})}a(oJn,"keepObserved");(0,iJn._setKeepObserved)(oJn);function sJn(t,e){let r=new P2e(!0,e);t.addObserver(r);try{r.beginUpdate(t)}finally{r.endUpdate(t)}return(0,Qur.toDisposable)(()=>{t.removeObserver(r)})}a(sJn,"recomputeInitiallyAndOnChange");(0,iJn._setRecomputeInitiallyAndOnChange)(sJn);var P2e=class{static{a(this,"KeepAliveObserver")}constructor(e,r){this._forceRecompute=e,this._handleValue=r,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,r){}};pE.KeepAliveObserver=P2e;function Mjs(t,e){let r;return(0,k2e.derivedOpts)({owner:t,debugReferenceFn:e},o=>(r=e(o,r),r))}a(Mjs,"derivedObservableWithCache");function Ojs(t,e){let r,n=(0,nJn.observableSignal)("derivedObservableWithWritableCache"),o=(0,k2e.derived)(t,s=>(n.read(s),r=e(s,r),r));return Object.assign(o,{clearCache:a(s=>{r=void 0,n.trigger(s)},"clearCache"),setCache:a((s,c)=>{r=s,n.trigger(c)},"setCache")})}a(Ojs,"derivedObservableWithWritableCache");function Bjs(t,e,r,n){let o=new Nct(r,n);return(0,k2e.derivedOpts)({debugReferenceFn:r,owner:t,onLastObserverRemoved:a(()=>{o.dispose(),o=new Nct(r)},"onLastObserverRemoved")},c=>{let l=e.read(c);return o.setItems(l),o.getItems()})}a(Bjs,"mapObservableArrayCached");var Nct=class{static{a(this,"ArrayMap")}constructor(e,r){this._map=e,this._keySelector=r,this._cache=new Map,this._items=[]}dispose(){this._cache.forEach(e=>e.store.dispose()),this._cache.clear()}setItems(e){let r=[],n=new Set(this._cache.keys());for(let o of e){let s=this._keySelector?this._keySelector(o):o,c=this._cache.get(s);if(c)n.delete(s);else{let l=new Qur.DisposableStore;c={out:this._map(o,l),store:l},this._cache.set(s,c)}r.push(c.out)}for(let o of n)this._cache.get(o).store.dispose(),this._cache.delete(o);this._items=r}getItems(){return this._items}};function Ljs(t){return!!t&&t.read!==void 0&&t.reportChanges!==void 0}a(Ljs,"isObservable")});var cJn=I(Oct=>{"use strict";p();Object.defineProperty(Oct,"__esModule",{value:!0});Oct.recordChanges=Fjs;Oct.recordChangesLazy=Ujs;var aJn=J_();function Fjs(t){return{createChangeSummary:a(e=>({changes:[]}),"createChangeSummary"),handleChange(e,r){for(let n in t)e.didChange(t[n])&&r.changes.push({key:n,change:e.change});return!0},beforeUpdate(e,r){for(let n in t){if(n==="changes")throw new aJn.BugIndicatingError('property name "changes" is reserved for change tracking');r[n]=t[n].read(e)}}}}a(Fjs,"recordChanges");function Ujs(t){let e;return{createChangeSummary:a(r=>({changes:[]}),"createChangeSummary"),handleChange(r,n){e||(e=t());for(let o in e)r.didChange(e[o])&&n.changes.push({key:o,change:r.change});return!0},beforeUpdate(r,n){e||(e=t());for(let o in e){if(o==="changes")throw new aJn.BugIndicatingError('property name "changes" is reserved for change tracking');n[o]=e[o].read(r)}}}}a(Ujs,"recordChangesLazy")});var lJn=I(Hur=>{"use strict";p();Object.defineProperty(Hur,"__esModule",{value:!0});Hur.constObservable=qjs;var Qjs=d2();function qjs(t){return new jur(t)}a(qjs,"constObservable");var jur=class extends Qjs.ConvenientObservable{static{a(this,"ConstObservable")}constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}log(){return this}toString(){return`Const: ${this.value}`}}});var uJn=I($ur=>{"use strict";p();Object.defineProperty($ur,"__esModule",{value:!0});$ur.observableSignalFromEvent=Vjs;var jjs=MF(),Hjs=mT(),Gjs=d2(),$js=gT();function Vjs(t,e,r=$js.DebugLocation.ofCaller()){return new Gur(typeof t=="string"?t:new Hjs.DebugNameData(t,void 0,void 0),e,r)}a(Vjs,"observableSignalFromEvent");var Gur=class extends Gjs.BaseObservable{static{a(this,"FromEventObservableSignal")}constructor(e,r,n){super(n),this.event=r,this.handleEvent=()=>{(0,jjs.transaction)(o=>{for(let s of this._observers)o.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}});var dJn=I(D2e=>{"use strict";p();Object.defineProperty(D2e,"__esModule",{value:!0});D2e.ValueWithChangeEventFromObservable=void 0;D2e.observableFromValueWithChangeEvent=Yjs;var Wjs=J_(),zjs=Kj(),Bct=class{static{a(this,"ValueWithChangeEventFromObservable")}constructor(e){this.observable=e}get onDidChange(){return Wjs.Event.fromObservableLight(this.observable)}get value(){return this.observable.get()}};D2e.ValueWithChangeEventFromObservable=Bct;function Yjs(t,e){return e instanceof Bct?e.observable:(0,zjs.observableFromEvent)(t,e.onDidChange,()=>e.value)}a(Yjs,"observableFromValueWithChangeEvent")});var hJn=I(N2e=>{"use strict";p();Object.defineProperty(N2e,"__esModule",{value:!0});N2e.runOnChange=fJn;N2e.runOnChangeWithStore=pJn;N2e.runOnChangeWithCancellationToken=Xjs;var Kjs=Our(),Jjs=J_(),Zjs=WZ();function fJn(t,e){let r,n=!0;return(0,Zjs.autorunWithStoreHandleChanges)({changeTracker:{createChangeSummary:a(()=>({deltas:[],didChange:!1}),"createChangeSummary"),handleChange:a((o,s)=>{if(o.didChange(t)){let c=o.change;c!==void 0&&s.deltas.push(c),s.didChange=!0}return!0},"handleChange")}},(o,s)=>{let c=t.read(o),l=r;s.didChange&&(r=c,e(c,l,s.deltas)),n&&(n=!1,r=c)})}a(fJn,"runOnChange");function pJn(t,e){let r=new Jjs.DisposableStore,n=fJn(t,(o,s,c)=>{r.clear(),e(o,s,c,r)});return{dispose(){n.dispose(),r.dispose()}}}a(pJn,"runOnChangeWithStore");function Xjs(t,e){return pJn(t,(r,n,o,s)=>{e(r,n,o,(0,Kjs.cancelOnDispose)(s))})}a(Xjs,"runOnChangeWithCancellationToken")});var AJn=I(Lct=>{"use strict";p();Object.defineProperty(Lct,"__esModule",{value:!0});Lct.latestChangedValue=nHs;Lct.derivedConstOnceDefined=iHs;var mJn=J_(),gJn=mT(),eHs=Kj(),tHs=WZ(),rHs=Mct();function nHs(t,e){if(e.length===0)throw new mJn.BugIndicatingError;let r=!1,n,o=(0,eHs.observableFromEvent)(t,s=>{let c=new mJn.DisposableStore;for(let l of e)c.add((0,tHs.autorunOpts)({debugName:a(()=>(0,gJn.getDebugName)(o,new gJn.DebugNameData(t,void 0,void 0))+".updateLastChangedValue","debugName")},u=>{r=!0,n=l.read(u),s()}));return c.add({dispose(){r=!1,n=void 0}}),c},()=>r?n:e[e.length-1].get());return o}a(nHs,"latestChangedValue");function iHs(t,e){return(0,rHs.derivedObservableWithCache)(t,(r,n)=>n??e(r))}a(iHs,"derivedConstOnceDefined")});var yJn=I(Fct=>{"use strict";p();Object.defineProperty(Fct,"__esModule",{value:!0});Fct.ObservableSet=void 0;var oHs=bct(),Vur=class{static{a(this,"ObservableSet")}constructor(){this._data=new Set,this._obs=(0,oHs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}add(e,r){return this._data.has(e)||(this._data.add(e),this._obs.set(this,r)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){for(let e of this._data)yield[e,e]}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.values()}get[Symbol.toStringTag](){return"ObservableSet"}};Fct.ObservableSet=Vur});var EJn=I(Uct=>{"use strict";p();Object.defineProperty(Uct,"__esModule",{value:!0});Uct.ObservableMap=void 0;var sHs=bct(),Wur=class{static{a(this,"ObservableMap")}constructor(){this._data=new Map,this._obs=(0,sHs.observableValueOpts)({equalsFn:a(()=>!1,"equalsFn")},this),this.observable=this._obs}get size(){return this._data.size}has(e){return this._data.has(e)}get(e){return this._data.get(e)}set(e,r,n){let o=this._data.has(e),s=this._data.get(e);return(!o||s!==r)&&(this._data.set(e,r),this._obs.set(this,n)),this}delete(e,r){let n=this._data.delete(e);return n&&this._obs.set(this,r),n}clear(e){this._data.size>0&&(this._data.clear(),this._obs.set(this,e))}forEach(e,r){this._data.forEach((n,o,s)=>{e.call(r,n,o,this)})}*entries(){yield*this._data.entries()}*keys(){yield*this._data.keys()}*values(){yield*this._data.values()}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"ObservableMap"}};Uct.ObservableMap=Wur});var jct=I(Gpe=>{"use strict";p();Object.defineProperty(Gpe,"__esModule",{value:!0});Gpe.ConsoleObservableLogger=void 0;Gpe.logObservableToConsole=lHs;Gpe.formatValue=Hpe;var aHs=v5(),cHs=mT(),_Jn=Upe(),Qct;function lHs(t){Qct||(Qct=new qct,(0,aHs.addLogger)(Qct)),Qct.addFilteredObj(t)}a(lHs,"logObservableToConsole");var qct=class{static{a(this,"ConsoleObservableLogger")}constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return uHs([qpe(pHs("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[qpe(" "),Mw(Hpe(e.oldValue,70),{color:"red",strikeThrough:!0}),qpe(" "),Mw(Hpe(e.newValue,60),{color:"green"})]:[qpe(" (unchanged)")]:[qpe(" "),Mw(Hpe(e.newValue,60),{color:"green"}),qpe(" (initial)")]}handleObservableCreated(e){if(e instanceof _Jn.Derived){let r=e;if(this.changedObservablesSets.set(r,new Set),!1){let o=[];r.__debugUpdating=o;let s=r.beginUpdate;r.beginUpdate=l=>(o.push(l),s.apply(r,[l]));let c=r.endUpdate;r.endUpdate=l=>{let u=o.indexOf(l);return u===-1&&console.error("endUpdate called without beginUpdate",r.debugName,l.debugName),o.splice(u,1),c.apply(r,[l])}}}}handleOnListenerCountChanged(e,r){}handleObservableUpdated(e,r){if(this._isIncluded(e)){if(e instanceof _Jn.Derived){this._handleDerivedRecomputed(e,r);return}console.log(...this.textToConsoleArgs([jpe("observable value changed"),Mw(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r)]))}}formatChanges(e){if(e.size!==0)return Mw(" (changed deps: "+[...e].map(r=>r.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(r)}_handleDerivedRecomputed(e,r){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([jpe("derived recomputed"),Mw(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([jpe("derived cleared"),Mw(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,r){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([jpe("observable from event triggered"),Mw(e.debugName,{color:"BlueViolet"}),...this.formatInfo(r),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,r,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(r)}handleAutorunStarted(e){let r=this.changedObservablesSets.get(e);r&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([jpe("autorun"),Mw(e.debugName,{color:"BlueViolet"}),this.formatChanges(r),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),r.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let r=e.getDebugName();r===void 0&&(r=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([jpe("transaction"),Mw(r,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};Gpe.ConsoleObservableLogger=qct;function uHs(t){let e=new Array,r=[],n="";function o(c){if("length"in c)for(let l of c)l&&o(l);else"text"in c?(n+=`%c${c.text}`,e.push(c.style),c.data&&r.push(...c.data)):"data"in c&&r.push(...c.data)}a(o,"process"),o(t);let s=[n,...e];return s.push(...r),s}a(uHs,"consoleTextToArgs");function qpe(t){return Mw(t,{color:"black"})}a(qpe,"normalText");function jpe(t){return Mw(hHs(`${t}: `,10),{color:"black",bold:!0})}a(jpe,"formatKind");function Mw(t,e={color:"black"}){function r(o){return Object.entries(o).reduce((s,[c,l])=>`${s}${c}:${l};`,"")}a(r,"objToCss");let n={color:e.color};return e.strikeThrough&&(n["text-decoration"]="line-through"),e.bold&&(n["font-weight"]="bold"),{text:t,style:r(n)}}a(Mw,"styled");function Hpe(t,e){switch(typeof t){case"number":return""+t;case"string":return t.length+2<=e?`"${t}"`:`"${t.substr(0,e-7)}"+...`;case"boolean":return t?"true":"false";case"undefined":return"undefined";case"object":return t===null?"null":Array.isArray(t)?dHs(t,e):fHs(t,e);case"symbol":return t.toString();case"function":return`[[Function${t.name?" "+t.name:""}]]`;default:return""+t}}a(Hpe,"formatValue");function dHs(t,e){let r="[ ",n=!0;for(let o of t){if(n||(r+=", "),r.length-5>e){r+="...";break}n=!1,r+=`${Hpe(o,e-r.length)}`}return r+=" ]",r}a(dHs,"formatArray");function fHs(t,e){if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString){let s=t.toString();return s.length<=e?s:s.substring(0,e-3)+"..."}let r=(0,cHs.getClassName)(t),n=r?r+"(":"{ ",o=!0;for(let[s,c]of Object.entries(t)){if(o||(n+=", "),n.length-5>e){n+="...";break}o=!1,n+=`${s}: ${Hpe(c,e-n.length)}`}return n+=r?")":" }",n}a(fHs,"formatObject");function pHs(t,e){let r="";for(let n=1;n<=e;n++)r+=t;return r}a(pHs,"repeat");function hHs(t,e){for(;t.length{"use strict";p();Object.defineProperty(Hct,"__esModule",{value:!0});Hct.SimpleTypedRpcConnection=void 0;var zur=class t{static{a(this,"SimpleTypedRpcConnection")}static createHost(e,r){return new t(e,r)}static createClient(e,r){return new t(e,r)}constructor(e,r){this._channelFactory=e,this._getHandler=r,this._channel=this._channelFactory({handleNotification:a(s=>{let c=s,l=this._getHandler().notifications[c[0]];if(!l)throw new Error(`Unknown notification "${c[0]}"!`);l(...c[1])},"handleNotification"),handleRequest:a(s=>{let c=s;try{return{type:"result",value:this._getHandler().requests[c[0]](...c[1])}}catch(l){return{type:"error",value:l}}},"handleRequest")});let n=new Proxy({},{get:a((s,c)=>async(...l)=>{let u=await this._channel.sendRequest([c,l]);if(u.type==="error")throw u.value;return u.value},"get")}),o=new Proxy({},{get:a((s,c)=>(...l)=>{this._channel.sendNotification([c,l])},"get")});this.api={notifications:o,requests:n}}};Hct.SimpleTypedRpcConnection=zur});var CJn=I(Yur=>{"use strict";p();Object.defineProperty(Yur,"__esModule",{value:!0});Yur.registerDebugChannel=gHs;var mHs=vJn();function gHs(t,e){let r=globalThis,n=[],o,{channel:s,handler:c}=AHs({sendNotification:a(u=>{o?o.sendNotification(u):n.push(u)},"sendNotification")}),l;return(r.$$debugValueEditor_debugChannels??(r.$$debugValueEditor_debugChannels={}))[t]=u=>{l=e(),o=u;for(let d of n)u.sendNotification(d);return n=[],c},mHs.SimpleTypedRpcConnection.createClient(s,()=>{if(!l)throw new Error("Not supported");return l})}a(gHs,"registerDebugChannel");function AHs(t){let e;return{channel:a(n=>(e=n,{sendNotification:a(o=>{t.sendNotification(o)},"sendNotification"),sendRequest:a(o=>{throw new Error("not supported")},"sendRequest")}),"channel"),handler:{handleRequest:a(n=>n.type==="notification"?e?.handleNotification(n.data):e?.handleRequest(n.data),"handleRequest")}}}a(AHs,"createChannelFactoryFromDebugChannel")});var TJn=I(Jj=>{"use strict";p();Object.defineProperty(Jj,"__esModule",{value:!0});Jj.Throttler=Jj.Debouncer=void 0;Jj.deepAssign=bJn;Jj.deepAssignDeleteNulls=SJn;var Kur=class{static{a(this,"Debouncer")}constructor(){this._timeout=void 0}debounce(e,r){this._timeout!==void 0&&clearTimeout(this._timeout),this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r)}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};Jj.Debouncer=Kur;var Jur=class{static{a(this,"Throttler")}constructor(){this._timeout=void 0}throttle(e,r){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},r))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}};Jj.Throttler=Jur;function bJn(t,e){for(let r in e)t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?bJn(t[r],e[r]):t[r]=e[r]}a(bJn,"deepAssign");function SJn(t,e){for(let r in e)e[r]===null?delete t[r]:t[r]&&typeof t[r]=="object"&&e[r]&&typeof e[r]=="object"?SJn(t[r],e[r]):t[r]=e[r]}a(SJn,"deepAssignDeleteNulls")});var wJn=I($ct=>{"use strict";p();Object.defineProperty($ct,"__esModule",{value:!0});$ct.DevToolsLogger=void 0;var IJn=Tct(),Gct=jct(),yHs=CJn(),Zur=TJn(),M2e=dS(),EHs=Kj(),ZZ=bs(),XZ=Upe(),xJn=OF(),_Hs=gT(),Xur=class t{static{a(this,"DevToolsLogger")}static{this._instance=void 0}static getInstance(){return t._instance===void 0&&(t._instance=new t),t._instance}getTransactionState(){let e=[],r=[...this._activeTransactions];if(r.length===0)return;let n=r.flatMap(s=>s.debugGetUpdatingObservers()??[]).map(s=>s.observer),o=new Set;for(;n.length>0;){let s=n.shift();if(o.has(s))continue;o.add(s);let c=this._getInfo(s,l=>{o.has(l)||n.push(l)});c&&e.push(c)}return{names:r.map(s=>s.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,ZZ.onUnexpectedError)(new ZZ.BugIndicatingError("No info found"));return}return r}_getAutorunInfo(e){let r=this._instanceInfos.get(e);if(!r){(0,ZZ.onUnexpectedError)(new ZZ.BugIndicatingError("No info found"));return}return r}_getInfo(e,r){if(e instanceof XZ.Derived){let n=[...e.debugGetObservers()];for(let u of n)r(u);let o=this._getObservableInfo(e);if(!o)return;let s=e.debugGetState(),c={name:e.debugName,instanceId:o.instanceId,updateCount:s.updateCount},l=[...o.changedObservables].map(u=>this._instanceInfos.get(u)?.instanceId).filter(M2e.isDefined);if(s.isComputing)return{...c,type:"observable/derived",state:"updating",changedDependencies:l,initialComputation:!1};switch(s.state){case 0:return{...c,type:"observable/derived",state:"noValue"};case 3:return{...c,type:"observable/derived",state:"upToDate"};case 2:return{...c,type:"observable/derived",state:"stale",changedDependencies:l};case 1:return{...c,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof IJn.AutorunObserver){let n=this._getAutorunInfo(e);if(!n)return;let o={name:e.debugName,instanceId:n.instanceId,updateCount:n.updateCount},s=[...n.changedObservables].map(c=>this._instanceInfos.get(c).instanceId);if(e.debugGetState().isRunning)return{...o,type:"autorun",state:"updating",changedDependencies:s};switch(e.debugGetState().state){case 3:return{...o,type:"autorun",state:"upToDate"};case 2:return{...o,type:"autorun",state:"stale",changedDependencies:s};case 1:return{...o,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let r=this._getObservableInfo(e);if(r)return{name:e.debugName,instanceId:r.instanceId}}_formatObserver(e){if(e instanceof XZ.Derived)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let r=this._getAutorunInfo(e);if(r)return{name:e.toString(),instanceId:r.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=(0,yHs.registerDebugChannel)("observableDevTools",()=>({notifications:{setDeclarationIdFilter:a(e=>{},"setDeclarationIdFilter"),logObservableValue:a(e=>{console.log("logObservableValue",e)},"logObservableValue"),flushUpdates:a(()=>{this._flushUpdates()},"flushUpdates"),resetUpdates:a(()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)},"resetUpdates")},requests:{getDeclarations:a(()=>{let e={};for(let r of this._declarations.values())e[r.id]=r;return{decls:e}},"getDeclarations"),getSummarizedInstances:a(()=>null,"getSummarizedInstances"),getObservableValueInfo:a(e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(n=>this._formatObserver(n)).filter(M2e.isDefined)}),"getObservableValueInfo"),getDerivedInfo:a(e=>{let r=this._aliveInstances.get(e);return{dependencies:[...r.debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(M2e.isDefined),observers:[...r.debugGetObservers()].map(n=>this._formatObserver(n)).filter(M2e.isDefined)}},"getDerivedInfo"),getAutorunInfo:a(e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(n=>this._formatObservable(n)).filter(M2e.isDefined)}),"getAutorunInfo"),getTransactionState:a(()=>this.getTransactionState(),"getTransactionState"),setValue:a((e,r)=>{let n=this._aliveInstances.get(e);if(n instanceof XZ.Derived)n.debugSetValue(r);else if(n instanceof xJn.ObservableValue)n.debugSetValue(r);else if(n instanceof EHs.FromEventObservable)n.debugSetValue(r);else throw new ZZ.BugIndicatingError("Observable is not supported");let o=[...n.debugGetObservers()];for(let s of o)s.beginUpdate(n);for(let s of o)s.handleChange(n,void 0);for(let s of o)s.endUpdate(n)},"setValue"),getValue:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof XZ.Derived)return(0,Gct.formatValue)(r.debugGetState().value,200);if(r instanceof xJn.ObservableValue)return(0,Gct.formatValue)(r.debugGetState().value,200)},"getValue"),logValue:a(e=>{let r=this._aliveInstances.get(e);if(r&&"get"in r)console.log("Logged Value:",r.get());else throw new ZZ.BugIndicatingError("Observable is not supported")},"logValue"),rerun:a(e=>{let r=this._aliveInstances.get(e);if(r instanceof XZ.Derived)r.debugRecompute();else if(r instanceof IJn.AutorunObserver)r.debugRerun();else throw new ZZ.BugIndicatingError("Observable is not supported")},"rerun")}})),this._pendingChanges=null,this._changeThrottler=new Zur.Throttler,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},_Hs.DebugLocation.enable()}_handleChange(e){(0,Zur.deepAssignDeleteNulls)(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:(0,Zur.deepAssign)(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,r){if(!r)return-1;let n=this._declarations.get(r.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:r.fileName,line:r.line,column:r.column},this._declarations.set(r.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,r){let o={declarationId:this._getDeclarationId("observable/value",r),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o)}handleOnListenerCountChanged(e,r){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&r>0){let o=e instanceof XZ.Derived?"observable/derived":"observable/value";this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:o,name:e.debugName}}})}else n.listenerCount>0&&r===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=r}}handleObservableUpdated(e,r){if(e instanceof XZ.Derived){this._handleDerivedRecomputed(e,r);return}let n=this._getObservableInfo(e);n&&r.didChange&&(n.lastValue=(0,Gct.formatValue)(r.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,r){let o={declarationId:this._getDeclarationId("autorun",r),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,o),this._aliveInstances.set(o.instanceId,e),o&&this._handleChange({instances:{[o.instanceId]:{instanceId:o.instanceId,declarationId:o.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let r=this._getAutorunInfo(e);r&&(this._handleChange({instances:{[r.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(r.instanceId))}handleAutorunDependencyChanged(e,r,n){let o=this._getAutorunInfo(e);o&&o.changedObservables.add(r)}handleAutorunStarted(e){}handleAutorunFinished(e){let r=this._getAutorunInfo(e);r&&(r.changedObservables.clear(),r.updateCount++,this._handleChange({instances:{[r.instanceId]:{runCount:r.updateCount}}}))}handleDerivedDependencyChanged(e,r,n){let o=this._getObservableInfo(e);o&&o.changedObservables.add(r)}_handleDerivedRecomputed(e,r){let n=this._getObservableInfo(e);if(!n)return;let o=(0,Gct.formatValue)(r.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=o,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:o,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let r=this._getObservableInfo(e);r&&(r.lastValue=void 0,r.changedObservables.clear(),r.listenerCount>0&&this._handleChange({instances:{[r.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};$ct.DevToolsLogger=Xur});var DJn=I(edr=>{"use strict";p();Object.defineProperty(edr,"__esModule",{value:!0});edr.debugGetObservableGraph=THs;var vHs=Upe(),CHs=Kj(),bHs=OF(),SHs=Tct(),RJn=jct();function THs(t,e){let r=e?.debugNamePostProcessor??(s=>s),n=eX.from(t,r);if(!n)return"";let o=new Set;return e.type==="observers"?kJn(n,0,o,e).trim():PJn(n,0,o,e).trim()}a(THs,"debugGetObservableGraph");function PJn(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,RJn.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.dependencies.length>0){s.push(`${o} dependencies:`);for(let l of t.dependencies){let u=eX.from(l,n.debugNamePostProcessor??(d=>d))??eX.unknown(l);s.push(PJn(u,e+1,r,n))}}return s.join(` +`)}a(PJn,"formatObservableInfoWithDependencies");function kJn(t,e,r,n){let o=" ".repeat(e),s=[];if(r.has(t.sourceObj))return s.push(`${o}* ${t.type} ${t.name} (already listed)`),s.join(` +`);if(r.add(t.sourceObj),s.push(`${o}* ${t.type} ${t.name}:`),s.push(`${o} value: ${(0,RJn.formatValue)(t.value,50)}`),s.push(`${o} state: ${t.state}`),t.observers.length>0){s.push(`${o} observers:`);for(let l of t.observers){let u=eX.from(l,n.debugNamePostProcessor??(d=>d))??eX.unknown(l);s.push(kJn(u,e+1,r,n))}}return s.join(` +`)}a(kJn,"formatObservableInfoWithObservers");var eX=class t{static{a(this,"Info")}static from(e,r){if(e instanceof SHs.AutorunObserver){let n=e.debugGetState();return new t(e,r(e.debugName),"autorun",void 0,n.stateStr,Array.from(n.dependencies),[])}else if(e instanceof vHs.Derived){let n=e.debugGetState();return new t(e,r(e.debugName),"derived",n.value,n.stateStr,Array.from(n.dependencies),Array.from(e.debugGetObservers()))}else if(e instanceof bHs.ObservableValue){let n=e.debugGetState();return new t(e,r(e.debugName),"observableValue",n.value,"upToDate",[],Array.from(e.debugGetObservers()))}else if(e instanceof CHs.FromEventObservable){let n=e.debugGetState();return new t(e,r(e.debugName),"fromEvent",n.value,n.hasValue?"upToDate":"initial",[],Array.from(e.debugGetObservers()))}}static unknown(e){return new t(e,"(unknown)","unknown",void 0,"unknown",[],[])}constructor(e,r,n,o,s,c,l){this.sourceObj=e,this.name=r,this.type=n,this.value=o,this.state=s,this.dependencies=c,this.observers=l}}});var BF=I(Lt=>{"use strict";p();Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ValueWithChangeEventFromObservable=Lt.observableFromValueWithChangeEvent=Lt.TransactionImpl=Lt.transaction=Lt.subtransaction=Lt.globalTransaction=Lt.asyncTransaction=Lt.observableSignalFromEvent=Lt.observableFromEventOpts=Lt.observableSignal=Lt.constObservable=Lt.recordChangesLazy=Lt.recordChanges=Lt.isObservable=Lt.wasEventTriggeredRecently=Lt.throttledObservable=Lt.signalFromObservable=Lt.recomputeInitiallyAndOnChange=Lt.observableFromPromise=Lt.mapObservableArrayCached=Lt.keepObserved=Lt.derivedObservableWithWritableCache=Lt.derivedObservableWithCache=Lt.debouncedObservable2=Lt.debouncedObservable=Lt.waitForState=Lt.derivedWithCancellationToken=Lt.PromiseResult=Lt.ObservableResolvedPromise=Lt.ObservablePromise=Lt.ObservableLazyPromise=Lt.ObservableLazy=Lt.derivedWithStore=Lt.derivedWithSetter=Lt.derivedOpts=Lt.derivedHandleChanges=Lt.derivedDisposable=Lt.derived=Lt.disposableObservableValue=Lt.registerAutorunSelfDisposable=Lt.autorunSelfDisposable=Lt.autorunPerKeyedItem=Lt.autorunIterableDelta=Lt.autorunWithStoreHandleChanges=Lt.autorunWithStore=Lt.autorunOpts=Lt.autorunHandleChanges=Lt.autorunDelta=Lt.autorun=Lt.observableValueOpts=void 0;Lt.DebugLocation=Lt.ObservableMap=Lt.ObservableSet=Lt.observableValue=Lt.observableFromEvent=Lt.latestChangedValue=Lt.derivedConstOnceDefined=Lt.runOnChangeWithStore=Lt.runOnChangeWithCancellationToken=Lt.runOnChange=void 0;var IHs=bct();Object.defineProperty(Lt,"observableValueOpts",{enumerable:!0,get:a(function(){return IHs.observableValueOpts},"get")});var T5=WZ();Object.defineProperty(Lt,"autorun",{enumerable:!0,get:a(function(){return T5.autorun},"get")});Object.defineProperty(Lt,"autorunDelta",{enumerable:!0,get:a(function(){return T5.autorunDelta},"get")});Object.defineProperty(Lt,"autorunHandleChanges",{enumerable:!0,get:a(function(){return T5.autorunHandleChanges},"get")});Object.defineProperty(Lt,"autorunOpts",{enumerable:!0,get:a(function(){return T5.autorunOpts},"get")});Object.defineProperty(Lt,"autorunWithStore",{enumerable:!0,get:a(function(){return T5.autorunWithStore},"get")});Object.defineProperty(Lt,"autorunWithStoreHandleChanges",{enumerable:!0,get:a(function(){return T5.autorunWithStoreHandleChanges},"get")});Object.defineProperty(Lt,"autorunIterableDelta",{enumerable:!0,get:a(function(){return T5.autorunIterableDelta},"get")});Object.defineProperty(Lt,"autorunPerKeyedItem",{enumerable:!0,get:a(function(){return T5.autorunPerKeyedItem},"get")});Object.defineProperty(Lt,"autorunSelfDisposable",{enumerable:!0,get:a(function(){return T5.autorunSelfDisposable},"get")});Object.defineProperty(Lt,"registerAutorunSelfDisposable",{enumerable:!0,get:a(function(){return T5.registerAutorunSelfDisposable},"get")});var xHs=OF();Object.defineProperty(Lt,"disposableObservableValue",{enumerable:!0,get:a(function(){return xHs.disposableObservableValue},"get")});var $pe=xct();Object.defineProperty(Lt,"derived",{enumerable:!0,get:a(function(){return $pe.derived},"get")});Object.defineProperty(Lt,"derivedDisposable",{enumerable:!0,get:a(function(){return $pe.derivedDisposable},"get")});Object.defineProperty(Lt,"derivedHandleChanges",{enumerable:!0,get:a(function(){return $pe.derivedHandleChanges},"get")});Object.defineProperty(Lt,"derivedOpts",{enumerable:!0,get:a(function(){return $pe.derivedOpts},"get")});Object.defineProperty(Lt,"derivedWithSetter",{enumerable:!0,get:a(function(){return $pe.derivedWithSetter},"get")});Object.defineProperty(Lt,"derivedWithStore",{enumerable:!0,get:a(function(){return $pe.derivedWithStore},"get")});var O2e=zKn();Object.defineProperty(Lt,"ObservableLazy",{enumerable:!0,get:a(function(){return O2e.ObservableLazy},"get")});Object.defineProperty(Lt,"ObservableLazyPromise",{enumerable:!0,get:a(function(){return O2e.ObservableLazyPromise},"get")});Object.defineProperty(Lt,"ObservablePromise",{enumerable:!0,get:a(function(){return O2e.ObservablePromise},"get")});Object.defineProperty(Lt,"ObservableResolvedPromise",{enumerable:!0,get:a(function(){return O2e.ObservableResolvedPromise},"get")});Object.defineProperty(Lt,"PromiseResult",{enumerable:!0,get:a(function(){return O2e.PromiseResult},"get")});var MJn=YKn();Object.defineProperty(Lt,"derivedWithCancellationToken",{enumerable:!0,get:a(function(){return MJn.derivedWithCancellationToken},"get")});Object.defineProperty(Lt,"waitForState",{enumerable:!0,get:a(function(){return MJn.waitForState},"get")});var Ow=Mct();Object.defineProperty(Lt,"debouncedObservable",{enumerable:!0,get:a(function(){return Ow.debouncedObservable},"get")});Object.defineProperty(Lt,"debouncedObservable2",{enumerable:!0,get:a(function(){return Ow.debouncedObservable2},"get")});Object.defineProperty(Lt,"derivedObservableWithCache",{enumerable:!0,get:a(function(){return Ow.derivedObservableWithCache},"get")});Object.defineProperty(Lt,"derivedObservableWithWritableCache",{enumerable:!0,get:a(function(){return Ow.derivedObservableWithWritableCache},"get")});Object.defineProperty(Lt,"keepObserved",{enumerable:!0,get:a(function(){return Ow.keepObserved},"get")});Object.defineProperty(Lt,"mapObservableArrayCached",{enumerable:!0,get:a(function(){return Ow.mapObservableArrayCached},"get")});Object.defineProperty(Lt,"observableFromPromise",{enumerable:!0,get:a(function(){return Ow.observableFromPromise},"get")});Object.defineProperty(Lt,"recomputeInitiallyAndOnChange",{enumerable:!0,get:a(function(){return Ow.recomputeInitiallyAndOnChange},"get")});Object.defineProperty(Lt,"signalFromObservable",{enumerable:!0,get:a(function(){return Ow.signalFromObservable},"get")});Object.defineProperty(Lt,"throttledObservable",{enumerable:!0,get:a(function(){return Ow.throttledObservable},"get")});Object.defineProperty(Lt,"wasEventTriggeredRecently",{enumerable:!0,get:a(function(){return Ow.wasEventTriggeredRecently},"get")});Object.defineProperty(Lt,"isObservable",{enumerable:!0,get:a(function(){return Ow.isObservable},"get")});var OJn=cJn();Object.defineProperty(Lt,"recordChanges",{enumerable:!0,get:a(function(){return OJn.recordChanges},"get")});Object.defineProperty(Lt,"recordChangesLazy",{enumerable:!0,get:a(function(){return OJn.recordChangesLazy},"get")});var wHs=lJn();Object.defineProperty(Lt,"constObservable",{enumerable:!0,get:a(function(){return wHs.constObservable},"get")});var RHs=Uur();Object.defineProperty(Lt,"observableSignal",{enumerable:!0,get:a(function(){return RHs.observableSignal},"get")});var PHs=Kj();Object.defineProperty(Lt,"observableFromEventOpts",{enumerable:!0,get:a(function(){return PHs.observableFromEventOpts},"get")});var kHs=uJn();Object.defineProperty(Lt,"observableSignalFromEvent",{enumerable:!0,get:a(function(){return kHs.observableSignalFromEvent},"get")});var B2e=MF();Object.defineProperty(Lt,"asyncTransaction",{enumerable:!0,get:a(function(){return B2e.asyncTransaction},"get")});Object.defineProperty(Lt,"globalTransaction",{enumerable:!0,get:a(function(){return B2e.globalTransaction},"get")});Object.defineProperty(Lt,"subtransaction",{enumerable:!0,get:a(function(){return B2e.subtransaction},"get")});Object.defineProperty(Lt,"transaction",{enumerable:!0,get:a(function(){return B2e.transaction},"get")});Object.defineProperty(Lt,"TransactionImpl",{enumerable:!0,get:a(function(){return B2e.TransactionImpl},"get")});var BJn=dJn();Object.defineProperty(Lt,"observableFromValueWithChangeEvent",{enumerable:!0,get:a(function(){return BJn.observableFromValueWithChangeEvent},"get")});Object.defineProperty(Lt,"ValueWithChangeEventFromObservable",{enumerable:!0,get:a(function(){return BJn.ValueWithChangeEventFromObservable},"get")});var tdr=hJn();Object.defineProperty(Lt,"runOnChange",{enumerable:!0,get:a(function(){return tdr.runOnChange},"get")});Object.defineProperty(Lt,"runOnChangeWithCancellationToken",{enumerable:!0,get:a(function(){return tdr.runOnChangeWithCancellationToken},"get")});Object.defineProperty(Lt,"runOnChangeWithStore",{enumerable:!0,get:a(function(){return tdr.runOnChangeWithStore},"get")});var LJn=AJn();Object.defineProperty(Lt,"derivedConstOnceDefined",{enumerable:!0,get:a(function(){return LJn.derivedConstOnceDefined},"get")});Object.defineProperty(Lt,"latestChangedValue",{enumerable:!0,get:a(function(){return LJn.latestChangedValue},"get")});var DHs=Kj();Object.defineProperty(Lt,"observableFromEvent",{enumerable:!0,get:a(function(){return DHs.observableFromEvent},"get")});var NHs=OF();Object.defineProperty(Lt,"observableValue",{enumerable:!0,get:a(function(){return NHs.observableValue},"get")});var MHs=yJn();Object.defineProperty(Lt,"ObservableSet",{enumerable:!0,get:a(function(){return MHs.ObservableSet},"get")});var OHs=EJn();Object.defineProperty(Lt,"ObservableMap",{enumerable:!0,get:a(function(){return OHs.ObservableMap},"get")});var BHs=gT();Object.defineProperty(Lt,"DebugLocation",{enumerable:!0,get:a(function(){return BHs.DebugLocation},"get")});var rdr=v5(),FJn=jct(),LHs=wJn(),NJn=JSe(),FHs=d2(),UHs=DJn();(0,FHs._setDebugGetObservableGraph)(UHs.debugGetObservableGraph);(0,rdr.setLogObservableFn)(FJn.logObservableToConsole);var QHs=!1;QHs&&(0,rdr.addLogger)(new FJn.ConsoleObservableLogger);NJn.env&&NJn.env.VSCODE_DEV_DEBUG_OBSERVABLES&&(0,rdr.addLogger)(LHs.DevToolsLogger.getInstance())});var sd=I(Vpe=>{"use strict";p();Object.defineProperty(Vpe,"__esModule",{value:!0});Vpe.OffsetRangeSet=Vpe.OffsetRange=void 0;var Vct=bs(),Wct=class t{static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static equals(e,r){return e.start===r.start&&e.endExclusive===r.endExclusive}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}constructor(e,r){if(this.start=e,this.endExclusive=r,e>r)throw new Vct.BugIndicatingError(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Vct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Vct.BugIndicatingError(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.toString()).join(", ")}intersectsStrict(e){let r=0;for(;re+r.length,0)}};Vpe.OffsetRangeSet=ndr});var p2=I(Ype=>{"use strict";p();Object.defineProperty(Ype,"__esModule",{value:!0});Ype.LineRangeSet=Ype.LineRange=void 0;var UJn=bs(),qHs=sd(),QJn=Gp(),Wpe=w7(),qJn=ml(),zpe=class t{static{a(this,"LineRange")}static ofLength(e,r){return new t(e,e+r)}static fromRange(e){return new t(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new t(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,qJn.compareBy)(e=>e.startLineNumber,qJn.numberComparator)}static subtract(e,r){return r?e.startLineNumberr)throw new UJn.BugIndicatingError(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=(0,Wpe.findLastIdxMonotonous)(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=(0,Wpe.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=(0,Wpe.findLastMonotonous)(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new zpe(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=(0,Wpe.findFirstIdxMonotonousOrArrLen)(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=(0,Wpe.findLastIdxMonotonous)(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new zpe(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};Ype.LineRangeSet=L2e});var Kpe=I(Yct=>{"use strict";p();Object.defineProperty(Yct,"__esModule",{value:!0});Yct.TextLength=void 0;var jHs=p2(),jJn=T_(),zct=Gp(),idr=class t{static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +`?(r++,n=0):n++;return new t(r,n)}static ofSubstr(e,r){return t.ofText(r.substring(e))}static sum(e,r){return e.reduce((n,o)=>n.add(r(o)),t.zero)}constructor(e,r){this.lineCount=e,this.columnCount=r}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new zct.Range(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new zct.Range(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new zct.Range(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return jHs.LineRange.ofLength(1,this.lineCount+1)}addToPosition(e){return this.lineCount===0?new jJn.Position(e.lineNumber,e.column+this.columnCount):new jJn.Position(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return zct.Range.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};Yct.TextLength=idr});var Jct=I(tX=>{"use strict";p();Object.defineProperty(tX,"__esModule",{value:!0});tX.PositionOffsetTransformer=tX.PositionOffsetTransformerBase=void 0;tX._setPositionOffsetTransformerDependencies=VHs;var HHs=w7(),GHs=sd(),F2e=T_(),$Hs=Gp(),Kct=class{static{a(this,"PositionOffsetTransformerBase")}getOffsetRange(e){return new GHs.OffsetRange(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return $Hs.Range.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringEdit(e){let r=e.replacements.map(n=>this.getStringReplacement(n));return new LF.deps.StringEdit(r)}getStringReplacement(e){return new LF.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new LF.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let r=e.replacements.map(n=>this.getTextReplacement(n));return new LF.deps.TextEdit(r)}};tX.PositionOffsetTransformerBase=Kct;var LF=class{static{a(this,"Deps")}static{this._deps=void 0}static get deps(){if(!this._deps)throw new Error("Dependencies not set. Call _setDependencies first.");return this._deps}};function VHs(t){LF._deps=t}a(VHs,"_setPositionOffsetTransformerDependencies");var odr=class extends Kct{static{a(this,"PositionOffsetTransformer")}constructor(e){super(),this.text=e}get lineStartOffsetByLineIdx(){return this._lineStartOffsetByLineIdx||this._computeLineOffsets(),this._lineStartOffsetByLineIdx}get lineEndOffsetByLineIdx(){return this._lineEndOffsetByLineIdx||this._computeLineOffsets(),this._lineEndOffsetByLineIdx}_computeLineOffsets(){this._lineStartOffsetByLineIdx=[],this._lineEndOffsetByLineIdx=[],this._lineStartOffsetByLineIdx.push(0);for(let e=0;e0&&this.text.charAt(e-1)==="\r"?this._lineEndOffsetByLineIdx.push(e-1):this._lineEndOffsetByLineIdx.push(e));this._lineEndOffsetByLineIdx.push(this.text.length)}getOffset(e){let r=this._validatePosition(e);return this.lineStartOffsetByLineIdx[r.lineNumber-1]+r.column-1}_validatePosition(e){if(e.lineNumber<1)return new F2e.Position(1,1);let r=this.textLength.lineCount+1;if(e.lineNumber>r){let o=this.getLineLength(r);return new F2e.Position(r,o+1)}if(e.column<1)return new F2e.Position(e.lineNumber,1);let n=this.getLineLength(e.lineNumber);return e.column-1>n?new F2e.Position(e.lineNumber,n+1):e}getPosition(e){let r=(0,HHs.findLastIdxMonotonous)(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new F2e.Position(n,o)}getTextLength(e){return LF.deps.TextLength.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new LF.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};tX.PositionOffsetTransformer=odr});var AT=I(I5=>{"use strict";p();Object.defineProperty(I5,"__esModule",{value:!0});I5.StringText=I5.ArrayText=I5.LineBasedText=I5.AbstractText=void 0;var WHs=Gu(),zHs=Oh(),YHs=T_(),HJn=Gp(),KHs=Kpe(),GJn=Jct(),U2e=class{static{a(this,"AbstractText")}constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new YHs.Position(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new HJn.Range(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new GJn.PositionOffsetTransformer(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new HJn.Range(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return(0,zHs.splitLines)(e)}getLinesOfRange(e){return e.mapToLineArray(r=>this.getLineAt(r))}equals(e){return this===e?!0:this.getValue()===e.getValue()}};I5.AbstractText=U2e;var Zct=class extends U2e{static{a(this,"LineBasedText")}constructor(e,r){(0,WHs.assert)(r>=1),super(),this._getLineContent=e,this._lineCount=r}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let r=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let n=e.startLineNumber+1;ne[r-1],e.length)}};D5.ArrayText=Gur;var $ur=class extends Y2e{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new lJn.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};D5.StringText=$ur});var dJn=I(N5=>{"use strict";p();Object.defineProperty(N5,"__esModule",{value:!0});N5.AnnotationReplacement=N5.Edit=N5.BaseReplacement=N5.BaseEdit=void 0;var bGs=El(),uJn=Ts(),Lw=sd(),zct=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new uJn.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(Lw.OffsetRange.emptyAt(h),new Lw.OffsetRange(0,m));s.push(E)}if(!f)throw new uJn.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Lw.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new Lw.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Lw.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Lw.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new Lw.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Lw.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,bGs.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new Lw.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};N5.BaseReplacement=Yct;var Vur=class t extends zct{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};N5.Edit=Vur;var Wur=class t extends Yct{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};N5.AnnotationReplacement=Wur});var gE=I(LA=>{"use strict";p();Object.defineProperty(LA,"__esModule",{value:!0});LA.AnnotatedStringReplacement=LA.AnnotatedStringEdit=LA.VoidEditData=LA.StringReplacement=LA.StringEdit=LA.BaseStringReplacement=LA.BaseStringEdit=void 0;LA.applyEditsToRanges=TGs;var Kct=Gh(),A2=sd(),SGs=CT(),pJn=dJn(),K2e=class extends pJn.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(tC.replace(A2.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new M5(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new M5(r)}normalizeEOL(e){return new M5(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=tC.replace(A2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?M5.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new SGs.StringText(this.apply(e.value))}mapData(e){return new Jct(this.replacements.map(r=>new aX(r.replaceRange,r.newText,e(r))))}};LA.BaseStringEdit=K2e;var J2e=class extends pJn.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,Kct.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,Kct.commonSuffixLength)(r,this.newText)),s=new A2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new tC(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new tC(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,Kct.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new A2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,Kct.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new A2.OffsetRange(0,this.newText.length-n))}toEdit(){return new M5([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};LA.BaseStringReplacement=J2e;var M5=class t extends K2e{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` -`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new tC(new A2.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new tC(e,r)])}static insert(e,r){return new t([new tC(A2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new tC(e,"")])}static fromJson(e){return new t(e.map(tC.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(TGs,"applyEditsToRanges");var zur=class{static{a(this,"VoidEditData")}join(e){return this}};LA.VoidEditData=zur;var Jct=class t extends K2e{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new aX(e,r,n)])}static insert(e,r,n){return new t([new aX(A2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new aX(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(Zct,"__esModule",{value:!0});Zct.LanguageId=void 0;var hJn;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(hJn||(Zct.LanguageId=hJn={}))});var gJn=I(iH=>{"use strict";p();Object.defineProperty(iH,"__esModule",{value:!0});iH.EditReasons=iH.TextModelEditReason=iH.EditReason=void 0;var Yur=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new Z2e(this.metadata,mJn).toKey(e)}};iH.EditReason=Yur;var mJn=Symbol("TextModelEditReason"),Z2e=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};iH.TextModelEditReason=Z2e;function Fw(t){return new Z2e(t,mJn)}a(Fw,"createEditReason");iH.EditReasons={unknown(t){return Fw({source:"unknown",name:t.name})},chatApplyEdits(t){return Fw({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return Fw({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return Fw({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return Fw({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>Fw({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return Fw({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>Fw({source:"setValue"}),"setValue"),eolChange:a(()=>Fw({source:"eolChange"}),"eolChange"),applyEdits:a(()=>Fw({source:"applyEdits"}),"applyEdits"),snippet:a(()=>Fw({source:"snippet"}),"snippet"),suggest:a(t=>Fw({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var cX=I(O5=>{"use strict";p();Object.defineProperty(O5,"__esModule",{value:!0});O5.MutableObservableDocument=O5.MutableObservableWorkspace=O5.StringEditWithReason=O5.ObservableWorkspace=void 0;var xGs=Yu(),AJn=ko(),rC=HF(),EJn=gE(),wGs=sd(),RGs=CT(),kGs=Xct(),yJn=gJn(),elt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,rC.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,rC.derivedWithStore)((e,r)=>{let n=(0,rC.observableValue)("lastActiveDocument",void 0);return r.add((0,rC.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,rC.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};O5.ObservableWorkspace=elt;var Xpe=class extends EJn.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};O5.StringEditWithReason=Xpe;var Kur=class extends elt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,rC.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,xGs.assert)(!this._documents.has(e.id));let n=new tlt(e.id,new RGs.StringText(e.initialValue??""),[],e.languageId??kGs.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};O5.MutableObservableWorkspace=Kur;var tlt=class extends AJn.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,rC.observableValue)(this,r),this._selection=(0,rC.observableValue)(this,n),this._primarySelectionLine=(0,rC.observableValue)(this,void 0),this._visibleRanges=(0,rC.observableValue)(this,[]),this._languageId=(0,rC.observableValue)(this,o),this._version=(0,rC.observableValue)(this,c),this._diagnostics=(0,rC.observableValue)(this,[]),this._register((0,AJn.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Xpe?e:new Xpe(e.replacements,yJn.EditReason.unknown);(0,rC.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=yJn.EditReason.unknown,s=new Xpe([EJn.StringReplacement.replace(new wGs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,rC.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};O5.MutableObservableDocument=tlt});var y2=I(lX=>{"use strict";p();var PGs=lX&&lX.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DGs=lX&&lX.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&PGs(e,t,r)};Object.defineProperty(lX,"__esModule",{value:!0});DGs(HF(),lX)});var B5=I(Jur=>{"use strict";p();Object.defineProperty(Jur,"__esModule",{value:!0});Jur.autorunWithChanges=MGs;var NGs=y2();function MGs(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,NGs.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(MGs,"autorunWithChanges")});var Ka=I(UA=>{"use strict";p();var Idr=Symbol.for("yaml.alias"),kZn=Symbol.for("yaml.document"),jlt=Symbol.for("yaml.map"),PZn=Symbol.for("yaml.pair"),xdr=Symbol.for("yaml.scalar"),Hlt=Symbol.for("yaml.seq"),zF=Symbol.for("yaml.node.type"),mVs=a(t=>!!t&&typeof t=="object"&&t[zF]===Idr,"isAlias"),gVs=a(t=>!!t&&typeof t=="object"&&t[zF]===kZn,"isDocument"),AVs=a(t=>!!t&&typeof t=="object"&&t[zF]===jlt,"isMap"),yVs=a(t=>!!t&&typeof t=="object"&&t[zF]===PZn,"isPair"),DZn=a(t=>!!t&&typeof t=="object"&&t[zF]===xdr,"isScalar"),EVs=a(t=>!!t&&typeof t=="object"&&t[zF]===Hlt,"isSeq");function NZn(t){if(t&&typeof t=="object")switch(t[zF]){case jlt:case Hlt:return!0}return!1}a(NZn,"isCollection");function _Vs(t){if(t&&typeof t=="object")switch(t[zF]){case Idr:case jlt:case xdr:case Hlt:return!0}return!1}a(_Vs,"isNode");var CVs=a(t=>(DZn(t)||NZn(t))&&!!t.anchor,"hasAnchor");UA.ALIAS=Idr;UA.DOC=kZn;UA.MAP=jlt;UA.NODE_TYPE=zF;UA.PAIR=PZn;UA.SCALAR=xdr;UA.SEQ=Hlt;UA.hasAnchor=CVs;UA.isAlias=mVs;UA.isCollection=NZn;UA.isDocument=gVs;UA.isMap=AVs;UA.isNode=_Vs;UA.isPair=yVs;UA.isScalar=DZn;UA.isSeq=EVs});var lDe=I(wdr=>{"use strict";p();var am=Ka(),Sb=Symbol("break visit"),MZn=Symbol("skip children"),Q5=Symbol("remove node");function Glt(t,e){let r=OZn(e);am.isDocument(t)?ahe(null,t.contents,r,Object.freeze([t]))===Q5&&(t.contents=null):ahe(null,t,r,Object.freeze([]))}a(Glt,"visit");Glt.BREAK=Sb;Glt.SKIP=MZn;Glt.REMOVE=Q5;function ahe(t,e,r,n){let o=BZn(t,e,r,n);if(am.isNode(o)||am.isPair(o))return LZn(t,n,o),ahe(t,o,r,n);if(typeof o!="symbol"){if(am.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var FZn=Ka(),vVs=lDe(),bVs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},SVs=a(t=>t.replace(/[!,[\]{}]/g,e=>bVs[e]),"escapeTagName"),uDe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+SVs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&FZn.isNode(e.contents)){let s={};vVs.visit(e.contents,(c,l)=>{FZn.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` -`)}};uDe.defaultYaml={explicit:!1,version:"1.2"};uDe.defaultTags={"!!":"tag:yaml.org,2002:"};UZn.Directives=uDe});var Vlt=I(dDe=>{"use strict";p();var QZn=Ka(),TVs=lDe();function IVs(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(IVs,"anchorIsValid");function qZn(t){let e=new Set;return TVs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(qZn,"anchorNames");function jZn(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(jZn,"findNewAnchor");function xVs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=qZn(t));let c=jZn(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(QZn.isScalar(c.node)||QZn.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(xVs,"createNodeAnchors");dDe.anchorIsValid=IVs;dDe.anchorNames=qZn;dDe.createNodeAnchors=xVs;dDe.findNewAnchor=jZn});var kdr=I(HZn=>{"use strict";p();function fDe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var wVs=Ka();function GZn(t,e,r){if(Array.isArray(t))return t.map((n,o)=>GZn(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!wVs.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(GZn,"toJS");$Zn.toJS=GZn});var Wlt=I(WZn=>{"use strict";p();var RVs=kdr(),VZn=Ka(),kVs=cH(),Pdr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,VZn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!VZn.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=kVs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?RVs.applyReviver(s,{"":l},"",l):l}};WZn.NodeBase=Pdr});var pDe=I(zZn=>{"use strict";p();var PVs=Vlt(),DVs=lDe(),lhe=Ka(),NVs=Wlt(),MVs=cH(),Ddr=class extends NVs.NodeBase{static{a(this,"Alias")}constructor(e){super(lhe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],DVs.visit(e,{Node:a((s,c)=>{(lhe.isAlias(c)||lhe.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(MVs.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=zlt(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(PVs.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function zlt(t,e,r){if(lhe.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(lhe.isCollection(e)){let n=0;for(let o of e.items){let s=zlt(t,o,r);s>n&&(n=s)}return n}else if(lhe.isPair(e)){let n=zlt(t,e.key,r),o=zlt(t,e.value,r);return Math.max(n,o)}return 1}a(zlt,"getAliasCount");zZn.Alias=Ddr});var i0=I(Ndr=>{"use strict";p();var OVs=Ka(),BVs=Wlt(),LVs=cH(),FVs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),lH=class extends BVs.NodeBase{static{a(this,"Scalar")}constructor(e){super(OVs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:LVs.toJS(this.value,e,r)}toString(){return String(this.value)}};lH.BLOCK_FOLDED="BLOCK_FOLDED";lH.BLOCK_LITERAL="BLOCK_LITERAL";lH.PLAIN="PLAIN";lH.QUOTE_DOUBLE="QUOTE_DOUBLE";lH.QUOTE_SINGLE="QUOTE_SINGLE";Ndr.Scalar=lH;Ndr.isScalarValue=FVs});var hDe=I(KZn=>{"use strict";p();var UVs=pDe(),mX=Ka(),YZn=i0(),QVs="tag:yaml.org,2002:";function qVs(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(qVs,"findTagObject");function jVs(t,e,r){if(mX.isDocument(t)&&(t=t.contents),mX.isNode(t))return t;if(mX.isPair(t)){let h=r.schema[mX.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new UVs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=QVs+e.slice(2));let d=qVs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new YZn.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[mX.MAP]:Symbol.iterator in Object(t)?c[mX.SEQ]:c[mX.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new YZn.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(jVs,"createNode");KZn.createNode=jVs});var Klt=I(Ylt=>{"use strict";p();var HVs=hDe(),q5=Ka(),GVs=Wlt();function Mdr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return HVs.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(Mdr,"collectionFromPath");var JZn=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Odr=class extends GVs.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>q5.isNode(n)||q5.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(JZn(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(q5.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Mdr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(q5.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&q5.isScalar(s)?s.value:s:q5.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!q5.isPair(r))return!1;let n=r.value;return n==null||e&&q5.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return q5.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(q5.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Mdr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};Ylt.Collection=Odr;Ylt.collectionFromPath=Mdr;Ylt.isEmptyPath=JZn});var mDe=I(Jlt=>{"use strict";p();var $Vs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function Bdr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(Bdr,"indentComment");var VVs=a((t,e,r)=>t.endsWith(` -`)?Bdr(r,e):r.includes(` +`+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1),r}getLineLength(e){return this._getLineContent(e).length}get length(){let e=this._getLineContent(this._lineCount);return new KHs.TextLength(this._lineCount-1,e.length)}};I5.LineBasedText=Zct;var sdr=class extends Zct{static{a(this,"ArrayText")}constructor(e){super(r=>e[r-1],e.length)}};I5.ArrayText=sdr;var adr=class extends U2e{static{a(this,"StringText")}constructor(e){super(),this.value=e,this._t=new GJn.PositionOffsetTransformer(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}};I5.StringText=adr});var VJn=I(x5=>{"use strict";p();Object.defineProperty(x5,"__esModule",{value:!0});x5.AnnotationReplacement=x5.Edit=x5.BaseReplacement=x5.BaseEdit=void 0;var JHs=ml(),$Jn=bs(),Bw=sd(),Xct=class{static{a(this,"BaseEdit")}constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new $Jn.BugIndicatingError(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(Bw.OffsetRange.emptyAt(h),new Bw.OffsetRange(0,m));s.push(E)}if(!f)throw new $Jn.BugIndicatingError("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(Bw.OffsetRange.ofStartAndLength(f.replaceRange.endExclusive,0),new Bw.OffsetRange(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new Bw.OffsetRange(h,l.replaceRange.endExclusive-c),y=l.slice(A,new Bw.OffsetRange(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new Bw.OffsetRange(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Bw.OffsetRange.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return(0,JHs.sumBy)(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new Bw.OffsetRange(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}};x5.BaseReplacement=elt;var cdr=class t extends Xct{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};x5.Edit=cdr;var ldr=class t extends elt{static{a(this,"AnnotationReplacement")}constructor(e,r,n){super(e),this.newLength=r,this.annotation=n}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newLength===e.newLength&&this.annotation===e.annotation}getNewLength(){return this.newLength}tryJoinTouching(e){if(this.annotation===e.annotation)return new t(this.replaceRange.joinRightTouching(e.replaceRange),this.newLength+e.newLength,this.annotation)}slice(e,r){return new t(e,r?r.length:this.newLength,this.annotation)}};x5.AnnotationReplacement=ldr});var hE=I(HA=>{"use strict";p();Object.defineProperty(HA,"__esModule",{value:!0});HA.AnnotatedStringReplacement=HA.AnnotatedStringEdit=HA.VoidEditData=HA.StringReplacement=HA.StringEdit=HA.BaseStringReplacement=HA.BaseStringEdit=void 0;HA.applyEditsToRanges=XHs;var tlt=Oh(),h2=sd(),ZHs=AT(),zJn=VJn(),Q2e=class extends zJn.BaseEdit{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(Z_.replace(h2.OffsetRange.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new w5(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}rebaseSkipConflicting(e){return this._tryRebase(e,!1)}tryRebase(e){return this._tryRebase(e,!0)}_tryRebase(e,r){let n=[],o=0,s=0,c=0;for(;se.toJson())}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new w5(r)}normalizeEOL(e){return new w5(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=Z_.replace(h2.OffsetRange.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?w5.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new ZHs.StringText(this.apply(e.value))}mapData(e){return new rlt(this.replacements.map(r=>new rX(r.replaceRange,r.newText,e(r))))}};HA.BaseStringEdit=Q2e;var q2e=class extends zJn.BaseReplacement{static{a(this,"BaseStringReplacement")}constructor(e,r){super(e),this.newText=r}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}isNeutralOn(e){return this.newText===e.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(e){let r=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),n=(0,tlt.commonPrefixLength)(r,this.newText),o=Math.min(r.length-n,this.newText.length-n,(0,tlt.commonSuffixLength)(r,this.newText)),s=new h2.OffsetRange(this.replaceRange.start+n,this.replaceRange.endExclusive-o),c=this.newText.substring(n,this.newText.length-o);return new Z_(s,c)}normalizeEOL(e){let r=this.newText.replace(/\r\n|\n/g,e);return new Z_(this.replaceRange,r)}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let r=this.replaceRange.substring(e),n=(0,tlt.commonPrefixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaStart(n),new h2.OffsetRange(n,this.newText.length))}removeCommonSuffix(e){let r=this.replaceRange.substring(e),n=(0,tlt.commonSuffixLength)(r,this.newText);return n===0?this:this.slice(this.replaceRange.deltaEnd(-n),new h2.OffsetRange(0,this.newText.length-n))}toEdit(){return new w5([this])}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}};HA.BaseStringReplacement=q2e;var w5=class t extends Q2e{static{a(this,"StringEdit")}static parse(e){let r=[],n=/\[(\d+),\s*(\d+)\)\s*->\s*"([^"]*)"/g,o;for(;(o=n.exec(e))!==null;){let s=parseInt(o[1],10),c=parseInt(o[2],10),l=o[3].replace(/\\n/g,` +`).replace(/\\r/g,"\r").replace(/\\\\/g,"\\");r.push(new Z_(new h2.OffsetRange(s,c),l))}return new t(r)}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new Z_(e,r)])}static insert(e,r){return new t([new Z_(h2.OffsetRange.emptyAt(e),r)])}static delete(e){return new t([new Z_(e,"")])}static fromJson(e){return new t(e.map(Z_.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(XHs,"applyEditsToRanges");var udr=class{static{a(this,"VoidEditData")}join(e){return this}};HA.VoidEditData=udr;var rlt=class t extends Q2e{static{a(this,"AnnotatedStringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r,n){return new t([new rX(e,r,n)])}static insert(e,r,n){return new t([new rX(h2.OffsetRange.emptyAt(e),r,n)])}static delete(e,r){return new t([new rX(e,"",r)])}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;n{"use strict";p();Object.defineProperty(nlt,"__esModule",{value:!0});nlt.LanguageId=void 0;var YJn;(function(t){t.PlainText="plaintext";function e(r){return r}a(e,"create"),t.create=e})(YJn||(nlt.LanguageId=YJn={}))});var JJn=I(Zj=>{"use strict";p();Object.defineProperty(Zj,"__esModule",{value:!0});Zj.EditReasons=Zj.TextModelEditReason=Zj.EditReason=void 0;var ddr=class t{static{a(this,"EditReason")}static create(e){return e?new t(e):t.unknown}constructor(e){this.metadata=e}static{this.unknown=new t({source:"unknown",name:void 0})}toKey(e){return new j2e(this.metadata,KJn).toKey(e)}};Zj.EditReason=ddr;var KJn=Symbol("TextModelEditReason"),j2e=class{static{a(this,"TextModelEditReason")}constructor(e,r){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e){let r=this.metadata;return Object.entries(r).filter(([o,s])=>(o.match(/\$/g)||[]).length<=e&&s!==void 0&&s!==null&&s!=="").map(([o,s])=>`${o}:${s}`).join("-")}};Zj.TextModelEditReason=j2e;function Lw(t){return new j2e(t,KJn)}a(Lw,"createEditReason");Zj.EditReasons={unknown(t){return Lw({source:"unknown",name:t.name})},chatApplyEdits(t){return Lw({source:"Chat.applyEdits",$modelId:t.modelId})},inlineCompletionAccept(t){return Lw({source:"inlineCompletionAccept",$nes:t.nes,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineCompletionPartialAccept(t){return Lw({source:"inlineCompletionPartialAccept",type:t.type,$extensionId:t.extensionId,$$requestUuid:t.requestUuid})},inlineChatApplyEdit(t){return Lw({source:"inlineChat.applyEdits",$modelId:t.modelId})},reloadFromDisk:a(()=>Lw({source:"reloadFromDisk"}),"reloadFromDisk"),cursor(t){return Lw({source:"cursor",kind:t.kind,detailedSource:t.detailedSource})},setValue:a(()=>Lw({source:"setValue"}),"setValue"),eolChange:a(()=>Lw({source:"eolChange"}),"eolChange"),applyEdits:a(()=>Lw({source:"applyEdits"}),"applyEdits"),snippet:a(()=>Lw({source:"snippet"}),"snippet"),suggest:a(t=>Lw({source:"suggest",$extensionId:t.extensionId}),"suggest")}});var nX=I(R5=>{"use strict";p();Object.defineProperty(R5,"__esModule",{value:!0});R5.MutableObservableDocument=R5.MutableObservableWorkspace=R5.StringEditWithReason=R5.ObservableWorkspace=void 0;var tGs=Gu(),ZJn=Io(),X_=BF(),eZn=hE(),rGs=sd(),nGs=AT(),iGs=ilt(),XJn=JJn(),olt=class{static{a(this,"ObservableWorkspace")}constructor(){this._version=0,this.onDidOpenDocumentChange=(0,X_.derivedHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({didChange:!1}),"createChangeSummary"),handleChange:a((e,r)=>(e.didChange(this.openDocuments)||(r.didChange=!0),!0),"handleChange")}},(e,r)=>{let n=this.openDocuments.read(e);for(let o of n)o.value.read(e);return r.didChange&&this._version++,this._version}),this.lastActiveDocument=(0,X_.derivedWithStore)((e,r)=>{let n=(0,X_.observableValue)("lastActiveDocument",void 0);return r.add((0,X_.autorunWithStore)((o,s)=>{let c=this.openDocuments.read(o);for(let l of c)s.add((0,X_.runOnChange)(l.value,()=>{n.set(l,void 0)}))})),n}).flatten()}getFirstOpenDocument(){return this.openDocuments.get()[0]}getDocument(e){return this.openDocuments.get().find(r=>r.id===e)}};R5.ObservableWorkspace=olt;var Jpe=class extends eZn.StringEdit{static{a(this,"StringEditWithReason")}constructor(e,r){super(e),this.reason=r}};R5.StringEditWithReason=Jpe;var fdr=class extends olt{static{a(this,"MutableObservableWorkspace")}constructor(){super(...arguments),this._openDocuments=(0,X_.observableValue)(this,[]),this.openDocuments=this._openDocuments,this._documents=new Map}addDocument(e,r=void 0){(0,tGs.assert)(!this._documents.has(e.id));let n=new slt(e.id,new nGs.StringText(e.initialValue??""),[],e.languageId??iGs.LanguageId.PlainText,()=>{this._documents.delete(e.id);let o=this._openDocuments.get(),s=o.filter(c=>c.id!==n.id);s.length!==o.length&&this._openDocuments.set(s,r,{added:[],removed:[n]})},e.initialVersionId??0,e.workspaceRoot);return this._documents.set(e.id,n),this._openDocuments.set([...this._openDocuments.get(),n],r,{added:[n],removed:[]}),n}getDocument(e){return this._documents.get(e)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let e of this._documents.values())e.dispose();this._documents.clear()}getWorkspaceRoot(e){return this._documents.get(e)?.workspaceRoot}};R5.MutableObservableWorkspace=fdr;var slt=class extends ZJn.Disposable{static{a(this,"MutableObservableDocument")}get value(){return this._value}get selection(){return this._selection}get primarySelectionLine(){return this._primarySelectionLine}get visibleRanges(){return this._visibleRanges}get languageId(){return this._languageId}get version(){return this._version}get diagnostics(){return this._diagnostics}constructor(e,r,n,o,s,c,l){super(),this.id=e,this.workspaceRoot=l,this._value=(0,X_.observableValue)(this,r),this._selection=(0,X_.observableValue)(this,n),this._primarySelectionLine=(0,X_.observableValue)(this,void 0),this._visibleRanges=(0,X_.observableValue)(this,[]),this._languageId=(0,X_.observableValue)(this,o),this._version=(0,X_.observableValue)(this,c),this._diagnostics=(0,X_.observableValue)(this,[]),this._register((0,ZJn.toDisposable)(s))}setSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setVisibleRange(e,r=void 0){this._visibleRanges.set(e,r)}applyEdit(e,r=void 0,n=void 0){let o=e.applyOnText(this.value.get()),s=e instanceof Jpe?e:new Jpe(e.replacements,XJn.EditReason.unknown);(0,X_.subtransaction)(r,c=>{this._value.set(o,c,s),this._version.set(n??this._version.get()+1,c)})}updateSelection(e,r=void 0,n){this._selection.set(e,r),this._primarySelectionLine.set(n,r)}setValue(e,r=void 0,n=void 0){let o=XJn.EditReason.unknown,s=new Jpe([eZn.StringReplacement.replace(new rGs.OffsetRange(0,this.value.get().value.length),e.value)],o);(0,X_.subtransaction)(r,c=>{this._value.set(e,c,s),this._version.set(n??this._version.get()+1,c)})}updateDiagnostics(e,r=void 0){this._diagnostics.set(e,r)}};R5.MutableObservableDocument=slt});var m2=I(iX=>{"use strict";p();var oGs=iX&&iX.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sGs=iX&&iX.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oGs(e,t,r)};Object.defineProperty(iX,"__esModule",{value:!0});sGs(BF(),iX)});var P5=I(pdr=>{"use strict";p();Object.defineProperty(pdr,"__esModule",{value:!0});pdr.autorunWithChanges=cGs;var aGs=m2();function cGs(t,e,r){let n=new Map(Object.entries(e).map(([s,c])=>[c,s])),o=new Map(Object.keys(e).map(s=>[s,void 0]));return(0,aGs.autorunHandleChanges)({owner:t,changeTracker:{createChangeSummary:a(()=>({}),"createChangeSummary"),handleChange:a((s,c)=>{let l=n.get(s.changedObservable);return c[l]===void 0&&(c[l]={value:void 0,changes:[]}),c[l].changes.push(s.change),!0},"handleChange")}},(s,c)=>{for(let[l,u]of Object.entries(e)){let d=u.read(s);c[l]===void 0&&(c[l]={value:d,changes:[],previous:o.get(l)}),c[l].value=d,c[l].previous=o.get(l)===void 0?void 0:o.get(l),o.set(l,d)}r(c)})}a(cGs,"autorunWithChanges")});var Ya=I($A=>{"use strict";p();var Gdr=Symbol.for("yaml.alias"),pXn=Symbol.for("yaml.document"),Ylt=Symbol.for("yaml.map"),hXn=Symbol.for("yaml.pair"),$dr=Symbol.for("yaml.scalar"),Klt=Symbol.for("yaml.seq"),qF=Symbol.for("yaml.node.type"),rVs=a(t=>!!t&&typeof t=="object"&&t[qF]===Gdr,"isAlias"),nVs=a(t=>!!t&&typeof t=="object"&&t[qF]===pXn,"isDocument"),iVs=a(t=>!!t&&typeof t=="object"&&t[qF]===Ylt,"isMap"),oVs=a(t=>!!t&&typeof t=="object"&&t[qF]===hXn,"isPair"),mXn=a(t=>!!t&&typeof t=="object"&&t[qF]===$dr,"isScalar"),sVs=a(t=>!!t&&typeof t=="object"&&t[qF]===Klt,"isSeq");function gXn(t){if(t&&typeof t=="object")switch(t[qF]){case Ylt:case Klt:return!0}return!1}a(gXn,"isCollection");function aVs(t){if(t&&typeof t=="object")switch(t[qF]){case Gdr:case Ylt:case $dr:case Klt:return!0}return!1}a(aVs,"isNode");var cVs=a(t=>(mXn(t)||gXn(t))&&!!t.anchor,"hasAnchor");$A.ALIAS=Gdr;$A.DOC=pXn;$A.MAP=Ylt;$A.NODE_TYPE=qF;$A.PAIR=hXn;$A.SCALAR=$dr;$A.SEQ=Klt;$A.hasAnchor=cVs;$A.isAlias=rVs;$A.isCollection=gXn;$A.isDocument=nVs;$A.isMap=iVs;$A.isNode=aVs;$A.isPair=oVs;$A.isScalar=mXn;$A.isSeq=sVs});var eDe=I(Vdr=>{"use strict";p();var lm=Ya(),Ab=Symbol("break visit"),AXn=Symbol("skip children"),O5=Symbol("remove node");function Jlt(t,e){let r=yXn(e);lm.isDocument(t)?ohe(null,t.contents,r,Object.freeze([t]))===O5&&(t.contents=null):ohe(null,t,r,Object.freeze([]))}a(Jlt,"visit");Jlt.BREAK=Ab;Jlt.SKIP=AXn;Jlt.REMOVE=O5;function ohe(t,e,r,n){let o=EXn(t,e,r,n);if(lm.isNode(o)||lm.isPair(o))return _Xn(t,n,o),ohe(t,o,r,n);if(typeof o!="symbol"){if(lm.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s{"use strict";p();var vXn=Ya(),lVs=eDe(),uVs={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dVs=a(t=>t.replace(/[!,[\]{}]/g,e=>uVs[e]),"escapeTagName"),tDe=class t{static{a(this,"Directives")}constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),o=n.shift();switch(o){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,c]=n;return this.tags[s]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let c=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,c),!1}}default:return r(0,`Unknown directive ${o}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let c=e.slice(2,-1);return c==="!"||c==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),c)}let[,n,o]=e.match(/^(.*!)([^!]*)$/s);o||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(o)}catch(c){return r(String(c)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+dVs(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),o;if(e&&n.length>0&&vXn.isNode(e.contents)){let s={};lVs.visit(e.contents,(c,l)=>{vXn.isNode(l)&&l.tag&&(s[l.tag]=!0)}),o=Object.keys(s)}else o=[];for(let[s,c]of n)s==="!!"&&c==="tag:yaml.org,2002:"||(!e||o.some(l=>l.startsWith(c)))&&r.push(`%TAG ${s} ${c}`);return r.join(` +`)}};tDe.defaultYaml={explicit:!1,version:"1.2"};tDe.defaultTags={"!!":"tag:yaml.org,2002:"};CXn.Directives=tDe});var Xlt=I(rDe=>{"use strict";p();var bXn=Ya(),fVs=eDe();function pVs(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}a(pVs,"anchorIsValid");function SXn(t){let e=new Set;return fVs.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}a(SXn,"anchorNames");function TXn(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}a(TXn,"findNewAnchor");function hVs(t,e){let r=[],n=new Map,o=null;return{onAnchor:a(s=>{r.push(s),o??(o=SXn(t));let c=TXn(e,o);return o.add(c),c},"onAnchor"),setAnchors:a(()=>{for(let s of r){let c=n.get(s);if(typeof c=="object"&&c.anchor&&(bXn.isScalar(c.node)||bXn.isCollection(c.node)))c.node.anchor=c.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},"setAnchors"),sourceObjects:n}}a(hVs,"createNodeAnchors");rDe.anchorIsValid=pVs;rDe.anchorNames=SXn;rDe.createNodeAnchors=hVs;rDe.findNewAnchor=TXn});var zdr=I(IXn=>{"use strict";p();function nDe(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let o=0,s=n.length;o{"use strict";p();var mVs=Ya();function xXn(t,e,r){if(Array.isArray(t))return t.map((n,o)=>xXn(n,String(o),r));if(t&&typeof t.toJSON=="function"){if(!r||!mVs.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let o=t.toJSON(e,r);return r.onCreate&&r.onCreate(o),o}return typeof t=="bigint"&&!r?.keep?Number(t):t}a(xXn,"toJS");wXn.toJS=xXn});var eut=I(PXn=>{"use strict";p();var gVs=zdr(),RXn=Ya(),AVs=rH(),Ydr=class{static{a(this,"NodeBase")}constructor(e){Object.defineProperty(this,RXn.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:o,reviver:s}={}){if(!RXn.isDocument(e))throw new TypeError("A document argument is required");let c={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=AVs.toJS(this,"",c);if(typeof o=="function")for(let{count:u,res:d}of c.anchors.values())o(d,u);return typeof s=="function"?gVs.applyReviver(s,{"":l},"",l):l}};PXn.NodeBase=Ydr});var iDe=I(kXn=>{"use strict";p();var yVs=Xlt(),EVs=eDe(),ahe=Ya(),_Vs=eut(),vVs=rH(),Kdr=class extends _Vs.NodeBase{static{a(this,"Alias")}constructor(e){super(ahe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],EVs.visit(e,{Node:a((s,c)=>{(ahe.isAlias(c)||ahe.hasAnchor(c))&&n.push(c)},"Node")}),r&&(r.aliasResolveCache=n));let o;for(let s of n){if(s===this)break;s.anchor===this.source&&(o=s)}return o}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:o,maxAliasCount:s}=r,c=this.resolve(o,r);if(!c){let u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(u)}let l=n.get(c);if(l||(vVs.toJS(c,null,r),l=n.get(c)),l?.res===void 0){let u="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(u)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=tut(o,c,n)),l.count*l.aliasCount>s)){let u="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(u)}return l.res}toString(e,r,n){let o=`*${this.source}`;if(e){if(yVs.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${o} `}return o}};function tut(t,e,r){if(ahe.isAlias(e)){let n=e.resolve(t),o=r&&n&&r.get(n);return o?o.count*o.aliasCount:0}else if(ahe.isCollection(e)){let n=0;for(let o of e.items){let s=tut(t,o,r);s>n&&(n=s)}return n}else if(ahe.isPair(e)){let n=tut(t,e.key,r),o=tut(t,e.value,r);return Math.max(n,o)}return 1}a(tut,"getAliasCount");kXn.Alias=Kdr});var s0=I(Jdr=>{"use strict";p();var CVs=Ya(),bVs=eut(),SVs=rH(),TVs=a(t=>!t||typeof t!="function"&&typeof t!="object","isScalarValue"),nH=class extends bVs.NodeBase{static{a(this,"Scalar")}constructor(e){super(CVs.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:SVs.toJS(this.value,e,r)}toString(){return String(this.value)}};nH.BLOCK_FOLDED="BLOCK_FOLDED";nH.BLOCK_LITERAL="BLOCK_LITERAL";nH.PLAIN="PLAIN";nH.QUOTE_DOUBLE="QUOTE_DOUBLE";nH.QUOTE_SINGLE="QUOTE_SINGLE";Jdr.Scalar=nH;Jdr.isScalarValue=TVs});var oDe=I(NXn=>{"use strict";p();var IVs=iDe(),dX=Ya(),DXn=s0(),xVs="tag:yaml.org,2002:";function wVs(t,e,r){if(e){let n=r.filter(s=>s.tag===e),o=n.find(s=>!s.format)??n[0];if(!o)throw new Error(`Tag ${e} not found`);return o}return r.find(n=>n.identify?.(t)&&!n.format)}a(wVs,"findTagObject");function RVs(t,e,r){if(dX.isDocument(t)&&(t=t.contents),dX.isNode(t))return t;if(dX.isPair(t)){let h=r.schema[dX.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:o,onTagObj:s,schema:c,sourceObjects:l}=r,u;if(n&&t&&typeof t=="object"){if(u=l.get(t),u)return u.anchor??(u.anchor=o(t)),new IVs.Alias(u.anchor);u={anchor:null,node:null},l.set(t,u)}e?.startsWith("!!")&&(e=xVs+e.slice(2));let d=wVs(t,e,c.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new DXn.Scalar(t);return u&&(u.node=h),h}d=t instanceof Map?c[dX.MAP]:Symbol.iterator in Object(t)?c[dX.SEQ]:c[dX.MAP]}s&&(s(d),delete r.onTagObj);let f=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new DXn.Scalar(t);return e?f.tag=e:d.default||(f.tag=d.tag),u&&(u.node=f),f}a(RVs,"createNode");NXn.createNode=RVs});var nut=I(rut=>{"use strict";p();var PVs=oDe(),B5=Ya(),kVs=eut();function Zdr(t,e,r){let n=r;for(let o=e.length-1;o>=0;--o){let s=e[o];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let c=[];c[s]=n,n=c}else n=new Map([[s,n]])}return PVs.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:a(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:t,sourceObjects:new Map})}a(Zdr,"collectionFromPath");var MXn=a(t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,"isEmptyPath"),Xdr=class extends kVs.NodeBase{static{a(this,"Collection")}constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>B5.isNode(n)||B5.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(MXn(e))this.add(r);else{let[n,...o]=e,s=this.get(n,!0);if(B5.isCollection(s))s.addIn(o,r);else if(s===void 0&&this.schema)this.set(n,Zdr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let o=this.get(r,!0);if(B5.isCollection(o))return o.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...o]=e,s=this.get(n,!0);return o.length===0?!r&&B5.isScalar(s)?s.value:s:B5.isCollection(s)?s.getIn(o,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!B5.isPair(r))return!1;let n=r.value;return n==null||e&&B5.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let o=this.get(r,!0);return B5.isCollection(o)?o.hasIn(n):!1}setIn(e,r){let[n,...o]=e;if(o.length===0)this.set(n,r);else{let s=this.get(n,!0);if(B5.isCollection(s))s.setIn(o,r);else if(s===void 0&&this.schema)this.set(n,Zdr(this.schema,o,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${o}`)}}};rut.Collection=Xdr;rut.collectionFromPath=Zdr;rut.isEmptyPath=MXn});var sDe=I(iut=>{"use strict";p();var DVs=a(t=>t.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function efr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}a(efr,"indentComment");var NVs=a((t,e,r)=>t.endsWith(` +`)?efr(r,e):r.includes(` `)?` -`+Bdr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");Jlt.indentComment=Bdr;Jlt.lineComment=VVs;Jlt.stringifyComment=$Vs});var XZn=I(gDe=>{"use strict";p();var WVs="flow",Ldr="block",Zlt="quoted";function zVs(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,E=-1,_=-1;r===Ldr&&(y=ZZn(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===Zlt&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` -`)r===Ldr&&(y=ZZn(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` +`+efr(r,e):(t.endsWith(" ")?"":" ")+r,"lineComment");iut.indentComment=efr;iut.lineComment=NVs;iut.stringifyComment=DVs});var BXn=I(aDe=>{"use strict";p();var MVs="flow",tfr="block",sut="quoted";function OVs(t,e,r="flow",{indentAtStart:n,lineWidth:o=80,minContentWidth:s=20,onFold:c,onOverflow:l}={}){if(!o||o<0)return t;oo-Math.max(2,s)?d.push(0):h=o-n);let m,g,A=!1,y=-1,E=-1,_=-1;r===tfr&&(y=OXn(t,y,e.length),y!==-1&&(h=y+u));for(let b;b=t[y+=1];){if(r===sut&&b==="\\"){switch(E=y,t[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(b===` +`)r===tfr&&(y=OXn(t,y,e.length)),h=y+e.length+u,m=void 0;else{if(b===" "&&g&&g!==" "&&g!==` `&&g!==" "){let T=t[y+1];T&&T!==" "&&T!==` -`&&T!==" "&&(m=y)}if(y>=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===Zlt){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var b2=i0(),uH=XZn(),eut=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),tut=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function YVs(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a(YVs,"lineLengthOverLimit");function ADe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(tut(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length=h)if(m)d.push(m),h=m+u,m=void 0;else if(r===sut){for(;g===" "||g===" ";)g=b,b=t[y+=1],A=!0;let T=y>_+1?y-2:E-1;if(f[T])return t;d.push(T),f[T]=!0,h=T+u,m=void 0}else A=!0}g=b}if(A&&l&&l(),d.length===0)return t;c&&c();let v=t.slice(0,d[0]);for(let b=0;b{"use strict";p();var v2=s0(),iH=BXn(),cut=a((t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),"getFoldOptions"),lut=a(t=>/^(%|---|\.\.\.)/m.test(t),"containsDocumentMarker");function BVs(t,e,r){if(!e||e<0)return!1;let n=e-r,o=t.length;if(o<=n)return!1;for(let s=0,c=0;sn)return!0;if(c=s+1,o-c<=n)return!1}return!0}a(BVs,"lineLengthOverLimit");function cDe(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,o=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(lut(t)?" ":""),c="",l=0;for(let u=0,d=r[u];d;d=r[++u])if(d===" "&&r[u+1]==="\\"&&r[u+2]==="n"&&(c+=r.slice(l,u)+"\\ ",u+=1,l=u,d="\\"),d==="\\")switch(r[u+1]){case"u":{c+=r.slice(l,u);let f=r.substr(u+2,4);switch(f){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:f.substr(0,2)==="00"?c+="\\x"+f.substr(2):c+=r.substr(u,6)}u+=5,l=u+1}break;case"n":if(n||r[u+2]==='"'||r.length `;let h,m;for(m=r.length;m>0;--m){let w=r[m-1];if(w!==` `&&w!==" "&&w!==" ")break}let g=r.substring(m),A=g.indexOf(` `);A===-1?h="-":r===g||A!==g.length-1?(h="+",s&&s()):h="",g&&(r=r.slice(0,-g.length),g[g.length-1]===` -`&&(g=g.slice(0,-1)),g=g.replace(Udr,`$&${d}`));let y=!1,E,_=-1;for(E=0;E{R=!0});let k=uH.foldFlowLines(`${v}${w}${g}`,d,uH.FOLD_BLOCK,x);if(!R)return`>${T} -${d}${k}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} -${d}${v}${r}${g}`}a(Xlt,"blockString");function KVs(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` -`)||f&&/[[\]{},]/.test(s))return uhe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` -`)?uhe(s,e):Xlt(t,e,r,n);if(!l&&!f&&o!==b2.Scalar.PLAIN&&s.includes(` -`))return Xlt(t,e,r,n);if(tut(s)){if(u==="")return e.forceBlockIndent=!0,Xlt(t,e,r,n);if(l&&u===d)return uhe(s,e)}let h=s.replace(/\n+/g,`$& -${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return uhe(s,e)}return l?h:uH.foldFlowLines(h,u,uH.FOLD_FLOW,eut(e,!1))}a(KVs,"plainString");function JVs(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==b2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=b2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case b2.Scalar.BLOCK_FOLDED:case b2.Scalar.BLOCK_LITERAL:return o||s?uhe(c.value,e):Xlt(c,e,r,n);case b2.Scalar.QUOTE_DOUBLE:return ADe(c.value,e);case b2.Scalar.QUOTE_SINGLE:return Fdr(c.value,e);case b2.Scalar.PLAIN:return KVs(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(JVs,"stringifyString");eXn.stringifyString=JVs});var EDe=I(Qdr=>{"use strict";p();var ZVs=Vlt(),dH=Ka(),XVs=mDe(),eWs=yDe();function tWs(t,e){let r=Object.assign({blockQuote:!0,commentString:XVs.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(tWs,"createStringifyContext");function rWs(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(dH.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(rWs,"getTagObject");function nWs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(dH.isScalar(t)||dH.isCollection(t))&&t.anchor;s&&ZVs.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(nWs,"stringifyProps");function iWs(t,e,r,n){if(dH.isPair(t))return t.toString(e,r,n);if(dH.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=dH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=rWs(e.doc.schema.tags,s));let c=nWs(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):dH.isScalar(s)?eWs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?dH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} -${e.indent}${l}`:l}a(iWs,"stringify");Qdr.createStringifyContext=tWs;Qdr.stringify=iWs});var iXn=I(nXn=>{"use strict";p();var YF=Ka(),tXn=i0(),rXn=EDe(),_De=mDe();function oWs({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=YF.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(YF.isCollection(t)||!YF.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||YF.isCollection(t)||(YF.isScalar(t)?t.type===tXn.Scalar.BLOCK_FOLDED||t.type===tXn.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=rXn.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=_De.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=_De.lineComment(E,r.indent,d(m))),E=`? ${E} -${l}:`):(E=`${E}:`,m&&(E+=_De.lineComment(E,r.indent,d(m))));let _,v,b;YF.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&YF.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&YF.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=rXn.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),R=!1,x=cut(n,!0);c!=="folded"&&e!==v2.Scalar.BLOCK_FOLDED&&(x.onOverflow=()=>{R=!0});let P=iH.foldFlowLines(`${v}${w}${g}`,d,iH.FOLD_BLOCK,x);if(!R)return`>${T} +${d}${P}`}return r=r.replace(/\n+/g,`$&${d}`),`|${T} +${d}${v}${r}${g}`}a(aut,"blockString");function LVs(t,e,r,n){let{type:o,value:s}=t,{actualString:c,implicitKey:l,indent:u,indentStep:d,inFlow:f}=e;if(l&&s.includes(` +`)||f&&/[[\]{},]/.test(s))return che(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||f||!s.includes(` +`)?che(s,e):aut(t,e,r,n);if(!l&&!f&&o!==v2.Scalar.PLAIN&&s.includes(` +`))return aut(t,e,r,n);if(lut(s)){if(u==="")return e.forceBlockIndent=!0,aut(t,e,r,n);if(l&&u===d)return che(s,e)}let h=s.replace(/\n+/g,`$& +${u}`);if(c){let m=a(y=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(h),"test"),{compat:g,tags:A}=e.doc.schema;if(A.some(m)||g?.some(m))return che(s,e)}return l?h:iH.foldFlowLines(h,u,iH.FOLD_FLOW,cut(e,!1))}a(LVs,"plainString");function FVs(t,e,r,n){let{implicitKey:o,inFlow:s}=e,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==v2.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(l=v2.Scalar.QUOTE_DOUBLE);let u=a(f=>{switch(f){case v2.Scalar.BLOCK_FOLDED:case v2.Scalar.BLOCK_LITERAL:return o||s?che(c.value,e):aut(c,e,r,n);case v2.Scalar.QUOTE_DOUBLE:return cDe(c.value,e);case v2.Scalar.QUOTE_SINGLE:return rfr(c.value,e);case v2.Scalar.PLAIN:return LVs(c,e,r,n);default:return null}},"_stringify"),d=u(l);if(d===null){let{defaultKeyType:f,defaultStringType:h}=e.options,m=o&&f||h;if(d=u(m),d===null)throw new Error(`Unsupported default string type ${m}`)}return d}a(FVs,"stringifyString");LXn.stringifyString=FVs});var uDe=I(ifr=>{"use strict";p();var UVs=Xlt(),oH=Ya(),QVs=sDe(),qVs=lDe();function jVs(t,e){let r=Object.assign({blockQuote:!0,commentString:QVs.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}a(jVs,"createStringifyContext");function HVs(t,e){if(e.tag){let o=t.filter(s=>s.tag===e.tag);if(o.length>0)return o.find(s=>s.format===e.format)??o[0]}let r,n;if(oH.isScalar(e)){n=e.value;let o=t.filter(s=>s.identify?.(n));if(o.length>1){let s=o.filter(c=>c.test);s.length>0&&(o=s)}r=o.find(s=>s.format===e.format)??o.find(s=>!s.format)}else n=e,r=t.find(o=>o.nodeClass&&n instanceof o.nodeClass);if(!r){let o=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${o} value`)}return r}a(HVs,"getTagObject");function GVs(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let o=[],s=(oH.isScalar(t)||oH.isCollection(t))&&t.anchor;s&&UVs.anchorIsValid(s)&&(r.add(s),o.push(`&${s}`));let c=t.tag??(e.default?null:e.tag);return c&&o.push(n.directives.tagString(c)),o.join(" ")}a(GVs,"stringifyProps");function $Vs(t,e,r,n){if(oH.isPair(t))return t.toString(e,r,n);if(oH.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let o,s=oH.isNode(t)?t:e.doc.createNode(t,{onTagObj:a(u=>o=u,"onTagObj")});o??(o=HVs(e.doc.schema.tags,s));let c=GVs(s,o,e);c.length>0&&(e.indentAtStart=(e.indentAtStart??0)+c.length+1);let l=typeof o.stringify=="function"?o.stringify(s,e,r,n):oH.isScalar(s)?qVs.stringifyString(s,e,r,n):s.toString(e,r,n);return c?oH.isScalar(s)||l[0]==="{"||l[0]==="["?`${c} ${l}`:`${c} +${e.indent}${l}`:l}a($Vs,"stringify");ifr.createStringifyContext=jVs;ifr.stringify=$Vs});var qXn=I(QXn=>{"use strict";p();var jF=Ya(),FXn=s0(),UXn=uDe(),dDe=sDe();function VVs({key:t,value:e},r,n,o){let{allNullValues:s,doc:c,indent:l,indentStep:u,options:{commentString:d,indentSeq:f,simpleKeys:h}}=r,m=jF.isNode(t)&&t.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(jF.isCollection(t)||!jF.isNode(t)&&typeof t=="object"){let x="With simple keys, collection cannot be used as a key value";throw new Error(x)}}let g=!h&&(!t||m&&e==null&&!r.inFlow||jF.isCollection(t)||(jF.isScalar(t)?t.type===FXn.Scalar.BLOCK_FOLDED||t.type===FXn.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!g&&(h||!s),indent:l+u});let A=!1,y=!1,E=UXn.stringify(t,r,()=>A=!0,()=>y=!0);if(!g&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(r.inFlow){if(s||e==null)return A&&n&&n(),E===""?"?":g?`? ${E}`:E}else if(s&&!h||e==null&&g)return E=`? ${E}`,m&&!A?E+=dDe.lineComment(E,r.indent,d(m)):y&&o&&o(),E;A&&(m=null),g?(m&&(E+=dDe.lineComment(E,r.indent,d(m))),E=`? ${E} +${l}:`):(E=`${E}:`,m&&(E+=dDe.lineComment(E,r.indent,d(m))));let _,v,b;jF.isNode(e)?(_=!!e.spaceBefore,v=e.commentBefore,b=e.comment):(_=!1,v=null,b=null,e&&typeof e=="object"&&(e=c.createNode(e))),r.implicitKey=!1,!g&&!m&&jF.isScalar(e)&&(r.indentAtStart=E.length+1),y=!1,!f&&u.length>=2&&!r.inFlow&&!g&&jF.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let T=!1,w=UXn.stringify(e,r,()=>T=!0,()=>y=!0),R=" ";if(m||_||v){if(R=_?` `:"",v){let x=d(v);R+=` -${_De.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` +${dDe.indentComment(x,r.indent)}`}w===""&&!r.inFlow?R===` `&&b&&(R=` `):R+=` -${r.indent}`}else if(!g&&YF.isCollection(e)){let x=w[0],k=w.indexOf(` -`),D=k!==-1,N=r.inFlow??e.flow??e.items.length===0;if(D||!N){let L=!1;if(D&&(x==="&"||x==="!")){let B=w.indexOf(" ");x==="&"&&B!==-1&&B{"use strict";p();var oXn=require("process");function sWs(t,...e){t==="debug"&&console.log(...e)}a(sWs,"debug");function aWs(t,e){(t==="debug"||t==="warn")&&(typeof oXn.emitWarning=="function"?oXn.emitWarning(e):console.warn(e))}a(aWs,"warn");qdr.debug=sWs;qdr.warn=aWs});var sut=I(iut=>{"use strict";p();var CDe=Ka(),sXn=i0(),rut="<<",nut={identify:a(t=>t===rut||typeof t=="symbol"&&t.description===rut,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new sXn.Scalar(Symbol(rut)),{addToJSMap:aXn}),"resolve"),stringify:a(()=>rut,"stringify")},cWs=a((t,e)=>(nut.identify(e)||CDe.isScalar(e)&&(!e.type||e.type===sXn.Scalar.PLAIN)&&nut.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===nut.tag&&r.default),"isMergeKey");function aXn(t,e,r){if(r=t&&CDe.isAlias(r)?r.resolve(t.doc):r,CDe.isSeq(r))for(let n of r.items)Hdr(t,e,n);else if(Array.isArray(r))for(let n of r)Hdr(t,e,n);else Hdr(t,e,r)}a(aXn,"addMergeToJSMap");function Hdr(t,e,r){let n=t&&CDe.isAlias(r)?r.resolve(t.doc):r;if(!CDe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(Hdr,"mergeValue");iut.addMergeToJSMap=aXn;iut.isMergeKey=cWs;iut.merge=nut});var $dr=I(uXn=>{"use strict";p();var lWs=jdr(),cXn=sut(),uWs=EDe(),lXn=Ka(),Gdr=cH();function dWs(t,e,{key:r,value:n}){if(lXn.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(cXn.isMergeKey(t,r))cXn.addMergeToJSMap(t,e,n);else{let o=Gdr.toJS(r,"",t);if(e instanceof Map)e.set(o,Gdr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=fWs(r,o,t),c=Gdr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(dWs,"addPairToJSMap");function fWs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(lXn.isNode(t)&&r?.doc){let n=uWs.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),lWs.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(fWs,"stringifyKey");uXn.addPairToJSMap=dWs});var fH=I(Vdr=>{"use strict";p();var dXn=hDe(),pWs=iXn(),hWs=$dr(),aut=Ka();function mWs(t,e,r){let n=dXn.createNode(t,void 0,r),o=dXn.createNode(e,void 0,r);return new cut(n,o)}a(mWs,"createPair");var cut=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,aut.NODE_TYPE,{value:aut.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return aut.isNode(r)&&(r=r.clone(e)),aut.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return hWs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?pWs.stringifyPair(this,e,r,n):JSON.stringify(this)}};Vdr.Pair=cut;Vdr.createPair=mWs});var Wdr=I(pXn=>{"use strict";p();var gX=Ka(),fXn=EDe(),lut=mDe();function gWs(t,e,r){return(e.inFlow??t.flow?yWs:AWs)(t,e,r)}a(gWs,"stringifyCollection");function AWs({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;AE=null,()=>h=!0);E&&(_+=lut.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;A{"use strict";p();var jXn=require("process");function WVs(t,...e){t==="debug"&&console.log(...e)}a(WVs,"debug");function zVs(t,e){(t==="debug"||t==="warn")&&(typeof jXn.emitWarning=="function"?jXn.emitWarning(e):console.warn(e))}a(zVs,"warn");ofr.debug=WVs;ofr.warn=zVs});var put=I(fut=>{"use strict";p();var fDe=Ya(),HXn=s0(),uut="<<",dut={identify:a(t=>t===uut||typeof t=="symbol"&&t.description===uut,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:a(()=>Object.assign(new HXn.Scalar(Symbol(uut)),{addToJSMap:GXn}),"resolve"),stringify:a(()=>uut,"stringify")},YVs=a((t,e)=>(dut.identify(e)||fDe.isScalar(e)&&(!e.type||e.type===HXn.Scalar.PLAIN)&&dut.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===dut.tag&&r.default),"isMergeKey");function GXn(t,e,r){if(r=t&&fDe.isAlias(r)?r.resolve(t.doc):r,fDe.isSeq(r))for(let n of r.items)afr(t,e,n);else if(Array.isArray(r))for(let n of r)afr(t,e,n);else afr(t,e,r)}a(GXn,"addMergeToJSMap");function afr(t,e,r){let n=t&&fDe.isAlias(r)?r.resolve(t.doc):r;if(!fDe.isMap(n))throw new Error("Merge sources must be maps or map aliases");let o=n.toJSON(null,t,Map);for(let[s,c]of o)e instanceof Map?e.has(s)||e.set(s,c):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0});return e}a(afr,"mergeValue");fut.addMergeToJSMap=GXn;fut.isMergeKey=YVs;fut.merge=dut});var lfr=I(WXn=>{"use strict";p();var KVs=sfr(),$Xn=put(),JVs=uDe(),VXn=Ya(),cfr=rH();function ZVs(t,e,{key:r,value:n}){if(VXn.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if($Xn.isMergeKey(t,r))$Xn.addMergeToJSMap(t,e,n);else{let o=cfr.toJS(r,"",t);if(e instanceof Map)e.set(o,cfr.toJS(n,o,t));else if(e instanceof Set)e.add(o);else{let s=XVs(r,o,t),c=cfr.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:c,writable:!0,enumerable:!0,configurable:!0}):e[s]=c}}return e}a(ZVs,"addPairToJSMap");function XVs(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(VXn.isNode(t)&&r?.doc){let n=JVs.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let o=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(o);s.length>40&&(s=s.substring(0,36)+'..."'),KVs.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return o}return JSON.stringify(e)}a(XVs,"stringifyKey");WXn.addPairToJSMap=ZVs});var sH=I(ufr=>{"use strict";p();var zXn=oDe(),eWs=qXn(),tWs=lfr(),hut=Ya();function rWs(t,e,r){let n=zXn.createNode(t,void 0,r),o=zXn.createNode(e,void 0,r);return new mut(n,o)}a(rWs,"createPair");var mut=class t{static{a(this,"Pair")}constructor(e,r=null){Object.defineProperty(this,hut.NODE_TYPE,{value:hut.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return hut.isNode(r)&&(r=r.clone(e)),hut.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return tWs.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?eWs.stringifyPair(this,e,r,n):JSON.stringify(this)}};ufr.Pair=mut;ufr.createPair=rWs});var dfr=I(KXn=>{"use strict";p();var fX=Ya(),YXn=uDe(),gut=sDe();function nWs(t,e,r){return(e.inFlow??t.flow?oWs:iWs)(t,e,r)}a(nWs,"stringifyCollection");function iWs({comment:t,items:e},r,{blockItemPrefix:n,flowChars:o,itemIndent:s,onChompKeep:c,onComment:l}){let{indent:u,options:{commentString:d}}=r,f=Object.assign({},r,{indent:s,type:null}),h=!1,m=[];for(let A=0;AE=null,()=>h=!0);E&&(_+=gut.lineComment(_,s,d(E))),h&&E&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=o.start+o.end;else{g=m[0];for(let A=1;AE=null);d||(d=h.length>f||_.includes(` -`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=lut.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` +`+gut.indentComment(d(t),u),l&&l()):h&&c&&c(),g}a(iWs,"stringifyBlockCollection");function oWs({items:t},e,{flowChars:r,itemIndent:n}){let{indent:o,indentStep:s,flowCollectionPadding:c,options:{commentString:l}}=e;n+=s;let u=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,f=0,h=[];for(let A=0;AE=null);d||(d=h.length>f||_.includes(` +`)),A0&&(d||(d=h.reduce((v,b)=>v+b.length+2,2)+(_.length+2)>e.options.lineWidth)),d&&(_+=",")),E&&(_+=gut.lineComment(_,n,l(E))),h.push(_),f=h.length}let{start:m,end:g}=r;if(h.length===0)return m+g;if(!d){let A=h.reduce((y,E)=>y+E.length+2,2);d=e.options.lineWidth>0&&A>e.options.lineWidth}if(d){let A=m;for(let y of h)A+=y?` ${s}${o}${y}`:` `;return`${A} -${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(yWs,"stringifyFlowCollection");function uut({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=lut.indentComment(e(n),t);r.push(s.trimStart())}}a(uut,"addCommentBefore");pXn.stringifyCollection=gWs});var hH=I(Ydr=>{"use strict";p();var EWs=Wdr(),_Ws=$dr(),CWs=Klt(),pH=Ka(),dut=fH(),vWs=i0();function vDe(t,e){let r=pH.isScalar(e)?e.value:e;for(let n of t)if(pH.isPair(n)&&(n.key===e||n.key===r||pH.isScalar(n.key)&&n.key.value===r))return n}a(vDe,"findPair");var zdr=class extends CWs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(pH.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(dut.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;pH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new dut.Pair(e,e?.value):n=new dut.Pair(e.key,e.value);let o=vDe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);pH.isScalar(o.value)&&vWs.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=vDe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=vDe(this.items,e)?.value;return(!r&&pH.isScalar(o)?o.value:o)??void 0}has(e){return!!vDe(this.items,e)}set(e,r){this.add(new dut.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)_Ws.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!pH.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),EWs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};Ydr.YAMLMap=zdr;Ydr.findPair=vDe});var dhe=I(mXn=>{"use strict";p();var bWs=Ka(),hXn=hH(),SWs={collection:"map",default:!0,nodeClass:hXn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return bWs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>hXn.YAMLMap.from(t,e,r),"createNode")};mXn.map=SWs});var mH=I(gXn=>{"use strict";p();var TWs=hDe(),IWs=Wdr(),xWs=Klt(),put=Ka(),wWs=i0(),RWs=cH(),Kdr=class extends xWs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(put.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=fut(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=fut(e);if(typeof n!="number")return;let o=this.items[n];return!r&&put.isScalar(o)?o.value:o}has(e){let r=fut(e);return typeof r=="number"&&r=0?e:null}a(fut,"asItemIndex");gXn.YAMLSeq=Kdr});var fhe=I(yXn=>{"use strict";p();var kWs=Ka(),AXn=mH(),PWs={collection:"seq",default:!0,nodeClass:AXn.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return kWs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>AXn.YAMLSeq.from(t,e,r),"createNode")};yXn.seq=PWs});var bDe=I(EXn=>{"use strict";p();var DWs=yDe(),NWs={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),DWs.stringifyString(t,e,r,n)}};EXn.string=NWs});var hut=I(vXn=>{"use strict";p();var _Xn=i0(),CXn={identify:a(t=>t==null,"identify"),createNode:a(()=>new _Xn.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new _Xn.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&CXn.test.test(t)?t:e.options.nullStr,"stringify")};vXn.nullTag=CXn});var Jdr=I(SXn=>{"use strict";p();var MWs=i0(),bXn={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new MWs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&bXn.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};SXn.boolTag=bXn});var phe=I(TXn=>{"use strict";p();function OWs({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(OWs,"stringifyNumber");TXn.stringifyNumber=OWs});var Xdr=I(mut=>{"use strict";p();var BWs=i0(),Zdr=phe(),LWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Zdr.stringifyNumber},FWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Zdr.stringifyNumber(t)}},UWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new BWs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Zdr.stringifyNumber};mut.float=UWs;mut.floatExp=FWs;mut.floatNaN=LWs});var tfr=I(Aut=>{"use strict";p();var IXn=phe(),gut=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),efr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function xXn(t,e,r){let{value:n}=t;return gut(n)&&n>=0?r+n.toString(e):IXn.stringifyNumber(t)}a(xXn,"intStringify");var QWs={identify:a(t=>gut(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>efr(t,2,8,r),"resolve"),stringify:a(t=>xXn(t,8,"0o"),"stringify")},qWs={identify:gut,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>efr(t,0,10,r),"resolve"),stringify:IXn.stringifyNumber},jWs={identify:a(t=>gut(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>efr(t,2,16,r),"resolve"),stringify:a(t=>xXn(t,16,"0x"),"stringify")};Aut.int=qWs;Aut.intHex=jWs;Aut.intOct=QWs});var RXn=I(wXn=>{"use strict";p();var HWs=dhe(),GWs=hut(),$Ws=fhe(),VWs=bDe(),WWs=Jdr(),rfr=Xdr(),nfr=tfr(),zWs=[HWs.map,$Ws.seq,VWs.string,GWs.nullTag,WWs.boolTag,nfr.intOct,nfr.int,nfr.intHex,rfr.floatNaN,rfr.floatExp,rfr.float];wXn.schema=zWs});var DXn=I(PXn=>{"use strict";p();var YWs=i0(),KWs=dhe(),JWs=fhe();function kXn(t){return typeof t=="bigint"||Number.isInteger(t)}a(kXn,"intIdentify");var yut=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),ZWs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:yut},{identify:a(t=>t==null,"identify"),createNode:a(()=>new YWs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:yut},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:yut},{identify:kXn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>kXn(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:yut}],XWs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},ezs=[KWs.map,JWs.seq].concat(ZWs,XWs);PXn.schema=ezs});var ofr=I(NXn=>{"use strict";p();var SDe=require("buffer"),ifr=i0(),tzs=yDe(),rzs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof SDe.Buffer=="function")return SDe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var Eut=Ka(),sfr=fH(),nzs=i0(),izs=mH();function MXn(t,e){if(Eut.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new sfr.Pair(new nzs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} +${o}${g}`}else return`${m}${c}${h.join(" ")}${c}${g}`}a(oWs,"stringifyFlowCollection");function Aut({indent:t,options:{commentString:e}},r,n,o){if(n&&o&&(n=n.replace(/^\n+/,"")),n){let s=gut.indentComment(e(n),t);r.push(s.trimStart())}}a(Aut,"addCommentBefore");KXn.stringifyCollection=nWs});var cH=I(pfr=>{"use strict";p();var sWs=dfr(),aWs=lfr(),cWs=nut(),aH=Ya(),yut=sH(),lWs=s0();function pDe(t,e){let r=aH.isScalar(e)?e.value:e;for(let n of t)if(aH.isPair(n)&&(n.key===e||n.key===r||aH.isScalar(n.key)&&n.key.value===r))return n}a(pDe,"findPair");var ffr=class extends cWs.Collection{static{a(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(aH.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:o,replacer:s}=n,c=new this(e),l=a((u,d)=>{if(typeof s=="function")d=s.call(r,u,d);else if(Array.isArray(s)&&!s.includes(u))return;(d!==void 0||o)&&c.items.push(yut.createPair(u,d,n))},"add");if(r instanceof Map)for(let[u,d]of r)l(u,d);else if(r&&typeof r=="object")for(let u of Object.keys(r))l(u,r[u]);return typeof e.sortMapEntries=="function"&&c.items.sort(e.sortMapEntries),c}add(e,r){let n;aH.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new yut.Pair(e,e?.value):n=new yut.Pair(e.key,e.value);let o=pDe(this.items,n.key),s=this.schema?.sortMapEntries;if(o){if(!r)throw new Error(`Key ${n.key} already set`);aH.isScalar(o.value)&&lWs.isScalarValue(n.value)?o.value.value=n.value:o.value=n.value}else if(s){let c=this.items.findIndex(l=>s(n,l)<0);c===-1?this.items.push(n):this.items.splice(c,0,n)}else this.items.push(n)}delete(e){let r=pDe(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let o=pDe(this.items,e)?.value;return(!r&&aH.isScalar(o)?o.value:o)??void 0}has(e){return!!pDe(this.items,e)}set(e,r){this.add(new yut.Pair(e,r),!0)}toJSON(e,r,n){let o=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(o);for(let s of this.items)aWs.addPairToJSMap(r,o,s);return o}toString(e,r,n){if(!e)return JSON.stringify(this);for(let o of this.items)if(!aH.isPair(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),sWs.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};pfr.YAMLMap=ffr;pfr.findPair=pDe});var lhe=I(ZXn=>{"use strict";p();var uWs=Ya(),JXn=cH(),dWs={collection:"map",default:!0,nodeClass:JXn.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return uWs.isMap(t)||e("Expected a mapping for this tag"),t},createNode:a((t,e,r)=>JXn.YAMLMap.from(t,e,r),"createNode")};ZXn.map=dWs});var lH=I(XXn=>{"use strict";p();var fWs=oDe(),pWs=dfr(),hWs=nut(),_ut=Ya(),mWs=s0(),gWs=rH(),hfr=class extends hWs.Collection{static{a(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(_ut.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Eut(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Eut(e);if(typeof n!="number")return;let o=this.items[n];return!r&&_ut.isScalar(o)?o.value:o}has(e){let r=Eut(e);return typeof r=="number"&&r=0?e:null}a(Eut,"asItemIndex");XXn.YAMLSeq=hfr});var uhe=I(tei=>{"use strict";p();var AWs=Ya(),eei=lH(),yWs={collection:"seq",default:!0,nodeClass:eei.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return AWs.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:a((t,e,r)=>eei.YAMLSeq.from(t,e,r),"createNode")};tei.seq=yWs});var hDe=I(rei=>{"use strict";p();var EWs=lDe(),_Ws={identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),EWs.stringifyString(t,e,r,n)}};rei.string=_Ws});var vut=I(oei=>{"use strict";p();var nei=s0(),iei={identify:a(t=>t==null,"identify"),createNode:a(()=>new nei.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:a(()=>new nei.Scalar(null),"resolve"),stringify:a(({source:t},e)=>typeof t=="string"&&iei.test.test(t)?t:e.options.nullStr,"stringify")};oei.nullTag=iei});var mfr=I(aei=>{"use strict";p();var vWs=s0(),sei={identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:a(t=>new vWs.Scalar(t[0]==="t"||t[0]==="T"),"resolve"),stringify({source:t,value:e},r){if(t&&sei.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};aei.boolTag=sei});var dhe=I(cei=>{"use strict";p();function CWs({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let o=typeof n=="number"?n:Number(n);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let c=s.indexOf(".");c<0&&(c=s.length,s+=".");let l=e-(s.length-c-1);for(;l-- >0;)s+="0"}return s}a(CWs,"stringifyNumber");cei.stringifyNumber=CWs});var Afr=I(Cut=>{"use strict";p();var bWs=s0(),gfr=dhe(),SWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:gfr.stringifyNumber},TWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():gfr.stringifyNumber(t)}},IWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new bWs.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:gfr.stringifyNumber};Cut.float=IWs;Cut.floatExp=TWs;Cut.floatNaN=SWs});var Efr=I(Sut=>{"use strict";p();var lei=dhe(),but=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify"),yfr=a((t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r),"intResolve");function uei(t,e,r){let{value:n}=t;return but(n)&&n>=0?r+n.toString(e):lei.stringifyNumber(t)}a(uei,"intStringify");var xWs={identify:a(t=>but(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:a((t,e,r)=>yfr(t,2,8,r),"resolve"),stringify:a(t=>uei(t,8,"0o"),"stringify")},wWs={identify:but,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:a((t,e,r)=>yfr(t,0,10,r),"resolve"),stringify:lei.stringifyNumber},RWs={identify:a(t=>but(t)&&t>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:a((t,e,r)=>yfr(t,2,16,r),"resolve"),stringify:a(t=>uei(t,16,"0x"),"stringify")};Sut.int=wWs;Sut.intHex=RWs;Sut.intOct=xWs});var fei=I(dei=>{"use strict";p();var PWs=lhe(),kWs=vut(),DWs=uhe(),NWs=hDe(),MWs=mfr(),_fr=Afr(),vfr=Efr(),OWs=[PWs.map,DWs.seq,NWs.string,kWs.nullTag,MWs.boolTag,vfr.intOct,vfr.int,vfr.intHex,_fr.floatNaN,_fr.floatExp,_fr.float];dei.schema=OWs});var mei=I(hei=>{"use strict";p();var BWs=s0(),LWs=lhe(),FWs=uhe();function pei(t){return typeof t=="bigint"||Number.isInteger(t)}a(pei,"intIdentify");var Tut=a(({value:t})=>JSON.stringify(t),"stringifyJSON"),UWs=[{identify:a(t=>typeof t=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:a(t=>t,"resolve"),stringify:Tut},{identify:a(t=>t==null,"identify"),createNode:a(()=>new BWs.Scalar(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:a(()=>null,"resolve"),stringify:Tut},{identify:a(t=>typeof t=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:a(t=>t==="true","resolve"),stringify:Tut},{identify:pei,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:a((t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),"resolve"),stringify:a(({value:t})=>pei(t)?t.toString():JSON.stringify(t),"stringify")},{identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:a(t=>parseFloat(t),"resolve"),stringify:Tut}],QWs={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},qWs=[LWs.map,FWs.seq].concat(UWs,QWs);hei.schema=qWs});var bfr=I(gei=>{"use strict";p();var mDe=require("buffer"),Cfr=s0(),jWs=lDe(),HWs={identify:a(t=>t instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof mDe.Buffer=="function")return mDe.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let o=0;o{"use strict";p();var Iut=Ya(),Sfr=sH(),GWs=s0(),$Ws=lH();function Aei(t,e){if(Iut.isSeq(t))for(let r=0;r1&&e("Each pair must have its own sequence indicator");let o=n.items[0]||new Sfr.Pair(new GWs.Scalar(null));if(n.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${n.commentBefore} ${o.key.commentBefore}`:n.commentBefore),n.comment){let s=o.value??o.key;s.comment=s.comment?`${n.comment} -${s.comment}`:n.comment}n=o}t.items[r]=Eut.isPair(n)?n:new sfr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(MXn,"resolvePairs");function OXn(t,e,r){let{replacer:n}=r,o=new izs.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(sfr.createPair(l,u,r))}return o}a(OXn,"createPairs");var ozs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:MXn,createNode:OXn};_ut.createPairs=OXn;_ut.pairs=ozs;_ut.resolvePairs=MXn});var lfr=I(cfr=>{"use strict";p();var BXn=Ka(),afr=cH(),TDe=hH(),szs=mH(),LXn=Cut(),AX=class t extends szs.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=TDe.YAMLMap.prototype.add.bind(this),this.delete=TDe.YAMLMap.prototype.delete.bind(this),this.get=TDe.YAMLMap.prototype.get.bind(this),this.has=TDe.YAMLMap.prototype.has.bind(this),this.set=TDe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if(BXn.isPair(o)?(s=afr.toJS(o.key,"",r),c=afr.toJS(o.value,s,r)):s=afr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=LXn.createPairs(e,r,n),s=new this;return s.items=o.items,s}};AX.tag="tag:yaml.org,2002:omap";var azs={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:AX,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=LXn.resolvePairs(t,e),n=[];for(let{key:o}of r.items)BXn.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new AX,r)},createNode:a((t,e,r)=>AX.from(t,e,r),"createNode")};cfr.YAMLOMap=AX;cfr.omap=azs});var jXn=I(ufr=>{"use strict";p();var FXn=i0();function UXn({value:t,source:e},r){return e&&(t?QXn:qXn).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(UXn,"boolStringify");var QXn={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new FXn.Scalar(!0),"resolve"),stringify:UXn},qXn={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new FXn.Scalar(!1),"resolve"),stringify:UXn};ufr.falseTag=qXn;ufr.trueTag=QXn});var HXn=I(vut=>{"use strict";p();var czs=i0(),dfr=phe(),lzs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:dfr.stringifyNumber},uzs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():dfr.stringifyNumber(t)}},dzs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new czs.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:dfr.stringifyNumber};vut.float=dzs;vut.floatExp=uzs;vut.floatNaN=lzs});var $Xn=I(xDe=>{"use strict";p();var GXn=phe(),IDe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function but(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(but,"intResolve");function ffr(t,e,r){let{value:n}=t;if(IDe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return GXn.stringifyNumber(t)}a(ffr,"intStringify");var fzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>but(t,2,2,r),"resolve"),stringify:a(t=>ffr(t,2,"0b"),"stringify")},pzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>but(t,1,8,r),"resolve"),stringify:a(t=>ffr(t,8,"0"),"stringify")},hzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>but(t,0,10,r),"resolve"),stringify:GXn.stringifyNumber},mzs={identify:IDe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>but(t,2,16,r),"resolve"),stringify:a(t=>ffr(t,16,"0x"),"stringify")};xDe.int=hzs;xDe.intBin=fzs;xDe.intHex=mzs;xDe.intOct=pzs});var hfr=I(pfr=>{"use strict";p();var Iut=Ka(),Sut=fH(),Tut=hH(),yX=class t extends Tut.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Iut.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Sut.Pair(e.key,null):r=new Sut.Pair(e,null),Tut.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Tut.findPair(this.items,e);return!r&&Iut.isPair(n)?Iut.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Tut.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Sut.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(Sut.createPair(c,null,n));return s}};yX.tag="tag:yaml.org,2002:set";var gzs={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:yX,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>yX.from(t,e,r),"createNode"),resolve(t,e){if(Iut.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new yX,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};pfr.YAMLSet=yX;pfr.set=gzs});var gfr=I(xut=>{"use strict";p();var Azs=phe();function mfr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a(mfr,"parseSexagesimal");function VXn(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return Azs.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(VXn,"stringifySexagesimal");var yzs={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>mfr(t,r),"resolve"),stringify:VXn},Ezs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>mfr(t,!1),"resolve"),stringify:VXn},WXn={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(WXn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=mfr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};xut.floatTime=Ezs;xut.intTime=yzs;xut.timestamp=WXn});var KXn=I(YXn=>{"use strict";p();var _zs=dhe(),Czs=hut(),vzs=fhe(),bzs=bDe(),Szs=ofr(),zXn=jXn(),Afr=HXn(),wut=$Xn(),Tzs=sut(),Izs=lfr(),xzs=Cut(),wzs=hfr(),yfr=gfr(),Rzs=[_zs.map,vzs.seq,bzs.string,Czs.nullTag,zXn.trueTag,zXn.falseTag,wut.intBin,wut.intOct,wut.int,wut.intHex,Afr.floatNaN,Afr.floatExp,Afr.float,Szs.binary,Tzs.merge,Izs.omap,xzs.pairs,wzs.set,yfr.intTime,yfr.floatTime,yfr.timestamp];YXn.schema=Rzs});var sei=I(Cfr=>{"use strict";p();var eei=dhe(),kzs=hut(),tei=fhe(),Pzs=bDe(),Dzs=Jdr(),Efr=Xdr(),_fr=tfr(),Nzs=RXn(),Mzs=DXn(),rei=ofr(),wDe=sut(),nei=lfr(),iei=Cut(),JXn=KXn(),oei=hfr(),Rut=gfr(),ZXn=new Map([["core",Nzs.schema],["failsafe",[eei.map,tei.seq,Pzs.string]],["json",Mzs.schema],["yaml11",JXn.schema],["yaml-1.1",JXn.schema]]),XXn={binary:rei.binary,bool:Dzs.boolTag,float:Efr.float,floatExp:Efr.floatExp,floatNaN:Efr.floatNaN,floatTime:Rut.floatTime,int:_fr.int,intHex:_fr.intHex,intOct:_fr.intOct,intTime:Rut.intTime,map:eei.map,merge:wDe.merge,null:kzs.nullTag,omap:nei.omap,pairs:iei.pairs,seq:tei.seq,set:oei.set,timestamp:Rut.timestamp},Ozs={"tag:yaml.org,2002:binary":rei.binary,"tag:yaml.org,2002:merge":wDe.merge,"tag:yaml.org,2002:omap":nei.omap,"tag:yaml.org,2002:pairs":iei.pairs,"tag:yaml.org,2002:set":oei.set,"tag:yaml.org,2002:timestamp":Rut.timestamp};function Bzs(t,e,r){let n=ZXn.get(e);if(n&&!t)return r&&!n.includes(wDe.merge)?n.concat(wDe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(ZXn.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(wDe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?XXn[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(XXn).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(Bzs,"getTags");Cfr.coreKnownTags=Ozs;Cfr.getTags=Bzs});var Sfr=I(aei=>{"use strict";p();var vfr=Ka(),Lzs=dhe(),Fzs=fhe(),Uzs=bDe(),kut=sei(),Qzs=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),bfr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?kut.getTags(e,"compat"):e?kut.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?kut.coreKnownTags:{},this.tags=kut.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,vfr.MAP,{value:Lzs.map}),Object.defineProperty(this,vfr.SCALAR,{value:Uzs.string}),Object.defineProperty(this,vfr.SEQ,{value:Fzs.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?Qzs:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};aei.Schema=bfr});var lei=I(cei=>{"use strict";p();var qzs=Ka(),Tfr=EDe(),RDe=mDe();function jzs(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=Tfr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(RDe.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(qzs.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(RDe.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Tfr.stringify(t.contents,o,()=>l=null,u);l&&(d+=RDe.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Tfr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` -`)?(r.push("..."),r.push(RDe.indentComment(u,""))):r.push(`... ${u}`)}else r.push("...");else{let u=t.comment;u&&c&&(u=u.replace(/^\n+/,"")),u&&((!c||l)&&r[r.length-1]!==""&&r.push(""),r.push(RDe.indentComment(s(u),"")))}return r.join(` +${s.comment}`:n.comment}n=o}t.items[r]=Iut.isPair(n)?n:new Sfr.Pair(n)}}else e("Expected a sequence for this tag");return t}a(Aei,"resolvePairs");function yei(t,e,r){let{replacer:n}=r,o=new $Ws.YAMLSeq(t);o.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let c of e){typeof n=="function"&&(c=n.call(e,String(s++),c));let l,u;if(Array.isArray(c))if(c.length===2)l=c[0],u=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){let d=Object.keys(c);if(d.length===1)l=d[0],u=c[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=c;o.items.push(Sfr.createPair(l,u,r))}return o}a(yei,"createPairs");var VWs={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Aei,createNode:yei};xut.createPairs=yei;xut.pairs=VWs;xut.resolvePairs=Aei});var xfr=I(Ifr=>{"use strict";p();var Eei=Ya(),Tfr=rH(),gDe=cH(),WWs=lH(),_ei=wut(),pX=class t extends WWs.YAMLSeq{static{a(this,"YAMLOMap")}constructor(){super(),this.add=gDe.YAMLMap.prototype.add.bind(this),this.delete=gDe.YAMLMap.prototype.delete.bind(this),this.get=gDe.YAMLMap.prototype.get.bind(this),this.has=gDe.YAMLMap.prototype.has.bind(this),this.set=gDe.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let o of this.items){let s,c;if(Eei.isPair(o)?(s=Tfr.toJS(o.key,"",r),c=Tfr.toJS(o.value,s,r)):s=Tfr.toJS(o,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,c)}return n}static from(e,r,n){let o=_ei.createPairs(e,r,n),s=new this;return s.items=o.items,s}};pX.tag="tag:yaml.org,2002:omap";var zWs={collection:"seq",identify:a(t=>t instanceof Map,"identify"),nodeClass:pX,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=_ei.resolvePairs(t,e),n=[];for(let{key:o}of r.items)Eei.isScalar(o)&&(n.includes(o.value)?e(`Ordered maps must not include duplicate keys: ${o.value}`):n.push(o.value));return Object.assign(new pX,r)},createNode:a((t,e,r)=>pX.from(t,e,r),"createNode")};Ifr.YAMLOMap=pX;Ifr.omap=zWs});var Tei=I(wfr=>{"use strict";p();var vei=s0();function Cei({value:t,source:e},r){return e&&(t?bei:Sei).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}a(Cei,"boolStringify");var bei={identify:a(t=>t===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:a(()=>new vei.Scalar(!0),"resolve"),stringify:Cei},Sei={identify:a(t=>t===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:a(()=>new vei.Scalar(!1),"resolve"),stringify:Cei};wfr.falseTag=Sei;wfr.trueTag=bei});var Iei=I(Rut=>{"use strict";p();var YWs=s0(),Rfr=dhe(),KWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:a(t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:Rfr.stringifyNumber},JWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:a(t=>parseFloat(t.replace(/_/g,"")),"resolve"),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Rfr.stringifyNumber(t)}},ZWs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new YWs.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Rfr.stringifyNumber};Rut.float=ZWs;Rut.floatExp=JWs;Rut.floatNaN=KWs});var wei=I(yDe=>{"use strict";p();var xei=dhe(),ADe=a(t=>typeof t=="bigint"||Number.isInteger(t),"intIdentify");function Put(t,e,r,{intAsBigInt:n}){let o=t[0];if((o==="-"||o==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let c=BigInt(t);return o==="-"?BigInt(-1)*c:c}let s=parseInt(t,r);return o==="-"?-1*s:s}a(Put,"intResolve");function Pfr(t,e,r){let{value:n}=t;if(ADe(n)){let o=n.toString(e);return n<0?"-"+r+o.substr(1):r+o}return xei.stringifyNumber(t)}a(Pfr,"intStringify");var XWs={identify:ADe,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:a((t,e,r)=>Put(t,2,2,r),"resolve"),stringify:a(t=>Pfr(t,2,"0b"),"stringify")},ezs={identify:ADe,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:a((t,e,r)=>Put(t,1,8,r),"resolve"),stringify:a(t=>Pfr(t,8,"0"),"stringify")},tzs={identify:ADe,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:a((t,e,r)=>Put(t,0,10,r),"resolve"),stringify:xei.stringifyNumber},rzs={identify:ADe,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:a((t,e,r)=>Put(t,2,16,r),"resolve"),stringify:a(t=>Pfr(t,16,"0x"),"stringify")};yDe.int=tzs;yDe.intBin=XWs;yDe.intHex=rzs;yDe.intOct=ezs});var Dfr=I(kfr=>{"use strict";p();var Nut=Ya(),kut=sH(),Dut=cH(),hX=class t extends Dut.YAMLMap{static{a(this,"YAMLSet")}constructor(e){super(e),this.tag=t.tag}add(e){let r;Nut.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new kut.Pair(e.key,null):r=new kut.Pair(e,null),Dut.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Dut.findPair(this.items,e);return!r&&Nut.isPair(n)?Nut.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Dut.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new kut.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:o}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let c of r)typeof o=="function"&&(c=o.call(r,c,c)),s.items.push(kut.createPair(c,null,n));return s}};hX.tag="tag:yaml.org,2002:set";var nzs={collection:"map",identify:a(t=>t instanceof Set,"identify"),nodeClass:hX,default:!1,tag:"tag:yaml.org,2002:set",createNode:a((t,e,r)=>hX.from(t,e,r),"createNode"),resolve(t,e){if(Nut.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new hX,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};kfr.YAMLSet=hX;kfr.set=nzs});var Mfr=I(Mut=>{"use strict";p();var izs=dhe();function Nfr(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,o=a(c=>e?BigInt(c):Number(c),"num"),s=n.replace(/_/g,"").split(":").reduce((c,l)=>c*o(60)+o(l),o(0));return r==="-"?o(-1)*s:s}a(Nfr,"parseSexagesimal");function Rei(t){let{value:e}=t,r=a(c=>c,"num");if(typeof e=="bigint")r=a(c=>BigInt(c),"num");else if(isNaN(e)||!isFinite(e))return izs.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let o=r(60),s=[e%o];return e<60?s.unshift(0):(e=(e-s[0])/o,s.unshift(e%o),e>=60&&(e=(e-s[0])/o,s.unshift(e))),n+s.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}a(Rei,"stringifySexagesimal");var ozs={identify:a(t=>typeof t=="bigint"||Number.isInteger(t),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:a((t,e,{intAsBigInt:r})=>Nfr(t,r),"resolve"),stringify:Rei},szs={identify:a(t=>typeof t=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:a(t=>Nfr(t,!1),"resolve"),stringify:Rei},Pei={identify:a(t=>t instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Pei.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,o,s,c,l]=e.map(Number),u=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,o,s||0,c||0,l||0,u),f=e[8];if(f&&f!=="Z"){let h=Nfr(f,!1);Math.abs(h)<30&&(h*=60),d-=6e4*h}return new Date(d)},stringify:a(({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")};Mut.floatTime=szs;Mut.intTime=ozs;Mut.timestamp=Pei});var Nei=I(Dei=>{"use strict";p();var azs=lhe(),czs=vut(),lzs=uhe(),uzs=hDe(),dzs=bfr(),kei=Tei(),Ofr=Iei(),Out=wei(),fzs=put(),pzs=xfr(),hzs=wut(),mzs=Dfr(),Bfr=Mfr(),gzs=[azs.map,lzs.seq,uzs.string,czs.nullTag,kei.trueTag,kei.falseTag,Out.intBin,Out.intOct,Out.int,Out.intHex,Ofr.floatNaN,Ofr.floatExp,Ofr.float,dzs.binary,fzs.merge,pzs.omap,hzs.pairs,mzs.set,Bfr.intTime,Bfr.floatTime,Bfr.timestamp];Dei.schema=gzs});var Hei=I(Ufr=>{"use strict";p();var Lei=lhe(),Azs=vut(),Fei=uhe(),yzs=hDe(),Ezs=mfr(),Lfr=Afr(),Ffr=Efr(),_zs=fei(),vzs=mei(),Uei=bfr(),EDe=put(),Qei=xfr(),qei=wut(),Mei=Nei(),jei=Dfr(),But=Mfr(),Oei=new Map([["core",_zs.schema],["failsafe",[Lei.map,Fei.seq,yzs.string]],["json",vzs.schema],["yaml11",Mei.schema],["yaml-1.1",Mei.schema]]),Bei={binary:Uei.binary,bool:Ezs.boolTag,float:Lfr.float,floatExp:Lfr.floatExp,floatNaN:Lfr.floatNaN,floatTime:But.floatTime,int:Ffr.int,intHex:Ffr.intHex,intOct:Ffr.intOct,intTime:But.intTime,map:Lei.map,merge:EDe.merge,null:Azs.nullTag,omap:Qei.omap,pairs:qei.pairs,seq:Fei.seq,set:jei.set,timestamp:But.timestamp},Czs={"tag:yaml.org,2002:binary":Uei.binary,"tag:yaml.org,2002:merge":EDe.merge,"tag:yaml.org,2002:omap":Qei.omap,"tag:yaml.org,2002:pairs":qei.pairs,"tag:yaml.org,2002:set":jei.set,"tag:yaml.org,2002:timestamp":But.timestamp};function bzs(t,e,r){let n=Oei.get(e);if(n&&!t)return r&&!n.includes(EDe.merge)?n.concat(EDe.merge):n.slice();let o=n;if(!o)if(Array.isArray(t))o=[];else{let s=Array.from(Oei.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)o=o.concat(s);else typeof t=="function"&&(o=t(o.slice()));return r&&(o=o.concat(EDe.merge)),o.reduce((s,c)=>{let l=typeof c=="string"?Bei[c]:c;if(!l){let u=JSON.stringify(c),d=Object.keys(Bei).map(f=>JSON.stringify(f)).join(", ");throw new Error(`Unknown custom tag ${u}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}a(bzs,"getTags");Ufr.coreKnownTags=Czs;Ufr.getTags=bzs});var jfr=I(Gei=>{"use strict";p();var Qfr=Ya(),Szs=lhe(),Tzs=uhe(),Izs=hDe(),Lut=Hei(),xzs=a((t,e)=>t.keye.key?1:0,"sortMapEntriesByKey"),qfr=class t{static{a(this,"Schema")}constructor({compat:e,customTags:r,merge:n,resolveKnownTags:o,schema:s,sortMapEntries:c,toStringDefaults:l}){this.compat=Array.isArray(e)?Lut.getTags(e,"compat"):e?Lut.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=o?Lut.coreKnownTags:{},this.tags=Lut.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Qfr.MAP,{value:Szs.map}),Object.defineProperty(this,Qfr.SCALAR,{value:Izs.string}),Object.defineProperty(this,Qfr.SEQ,{value:Tzs.seq}),this.sortMapEntries=typeof c=="function"?c:c===!0?xzs:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Gei.Schema=qfr});var Vei=I($ei=>{"use strict";p();var wzs=Ya(),Hfr=uDe(),_De=sDe();function Rzs(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let u=t.directives.toString(t);u?(r.push(u),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let o=Hfr.createStringifyContext(t,e),{commentString:s}=o.options;if(t.commentBefore){r.length!==1&&r.unshift("");let u=s(t.commentBefore);r.unshift(_De.indentComment(u,""))}let c=!1,l=null;if(t.contents){if(wzs.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let f=s(t.contents.commentBefore);r.push(_De.indentComment(f,""))}o.forceBlockIndent=!!t.comment,l=t.contents.comment}let u=l?void 0:()=>c=!0,d=Hfr.stringify(t.contents,o,()=>l=null,u);l&&(d+=_De.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Hfr.stringify(t.contents,o));if(t.directives?.docEnd)if(t.comment){let u=s(t.comment);u.includes(` +`)?(r.push("..."),r.push(_De.indentComment(u,""))):r.push(`... ${u}`)}else r.push("...");else{let u=t.comment;u&&c&&(u=u.replace(/^\n+/,"")),u&&((!c||l)&&r[r.length-1]!==""&&r.push(""),r.push(_De.indentComment(s(u),"")))}return r.join(` `)+` -`}a(jzs,"stringifyDocument");cei.stringifyDocument=jzs});var kDe=I(uei=>{"use strict";p();var Hzs=pDe(),hhe=Klt(),Qw=Ka(),Gzs=fH(),$zs=cH(),Vzs=Sfr(),Wzs=lei(),Ifr=Vlt(),zzs=kdr(),Yzs=hDe(),xfr=Rdr(),wfr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qw.NODE_TYPE,{value:Qw.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new xfr.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[Qw.NODE_TYPE]:{value:Qw.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Qw.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){mhe(this.contents)&&this.contents.add(e)}addIn(e,r){mhe(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Ifr.anchorNames(this);e.anchor=!r||n.has(r)?Ifr.findNewAnchor(r||"a",n):r}return new Hzs.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Ifr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Yzs.createNode(e,f,A);return l&&Qw.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new Gzs.Pair(o,s)}delete(e){return mhe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hhe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):mhe(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Qw.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return hhe.isEmptyPath(e)?!r&&Qw.isScalar(this.contents)?this.contents.value:this.contents:Qw.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Qw.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return hhe.isEmptyPath(e)?this.contents!==void 0:Qw.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=hhe.collectionFromPath(this.schema,[e],r):mhe(this.contents)&&this.contents.set(e,r)}setIn(e,r){hhe.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=hhe.collectionFromPath(this.schema,Array.from(e),r):mhe(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new xfr.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new xfr.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Vzs.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=$zs.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?zzs.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Wzs.stringifyDocument(this,e)}};function mhe(t){if(Qw.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(mhe,"assertCollection");uei.Document=wfr});var NDe=I(DDe=>{"use strict";p();var PDe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},Rfr=class extends PDe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},kfr=class extends PDe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Kzs=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 +`}a(Rzs,"stringifyDocument");$ei.stringifyDocument=Rzs});var vDe=I(Wei=>{"use strict";p();var Pzs=iDe(),fhe=nut(),Uw=Ya(),kzs=sH(),Dzs=rH(),Nzs=jfr(),Mzs=Vei(),Gfr=Xlt(),Ozs=zdr(),Bzs=oDe(),$fr=Wdr(),Vfr=class t{static{a(this,"Document")}constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Uw.NODE_TYPE,{value:Uw.DOC});let o=null;typeof r=="function"||Array.isArray(r)?o=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:c}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new $fr.Directives({version:c}),this.setSchema(c,n),this.contents=e===void 0?null:this.createNode(e,o,n)}clone(){let e=Object.create(t.prototype,{[Uw.NODE_TYPE]:{value:Uw.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Uw.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){phe(this.contents)&&this.contents.add(e)}addIn(e,r){phe(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=Gfr.anchorNames(this);e.anchor=!r||n.has(r)?Gfr.findNewAnchor(r||"a",n):r}return new Pzs.Alias(e.anchor)}createNode(e,r,n){let o;if(typeof r=="function")e=r.call({"":e},"",e),o=r;else if(Array.isArray(r)){let E=a(v=>typeof v=="number"||v instanceof String||v instanceof Number,"keyToStr"),_=r.filter(E).map(String);_.length>0&&(r=r.concat(_)),o=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:c,flow:l,keepUndefined:u,onTagObj:d,tag:f}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=Gfr.createNodeAnchors(this,c||"a"),A={aliasDuplicateObjects:s??!0,keepUndefined:u??!1,onAnchor:h,onTagObj:d,replacer:o,schema:this.schema,sourceObjects:g},y=Bzs.createNode(e,f,A);return l&&Uw.isCollection(y)&&(y.flow=!0),m(),y}createPair(e,r,n={}){let o=this.createNode(e,null,n),s=this.createNode(r,null,n);return new kzs.Pair(o,s)}delete(e){return phe(this.contents)?this.contents.delete(e):!1}deleteIn(e){return fhe.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):phe(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Uw.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return fhe.isEmptyPath(e)?!r&&Uw.isScalar(this.contents)?this.contents.value:this.contents:Uw.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Uw.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return fhe.isEmptyPath(e)?this.contents!==void 0:Uw.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=fhe.collectionFromPath(this.schema,[e],r):phe(this.contents)&&this.contents.set(e,r)}setIn(e,r){fhe.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=fhe.collectionFromPath(this.schema,Array.from(e),r):phe(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new $fr.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new $fr.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let o=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new Nzs.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:o,onAnchor:s,reviver:c}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},u=Dzs.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:f}of l.anchors.values())s(f,d);return typeof c=="function"?Ozs.applyReviver(c,{"":u},"",u):u}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Mzs.stringifyDocument(this,e)}};function phe(t){if(Uw.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}a(phe,"assertCollection");Wei.Document=Vfr});var SDe=I(bDe=>{"use strict";p();var CDe=class extends Error{static{a(this,"YAMLError")}constructor(e,r,n,o){super(),this.name=e,this.code=n,this.message=o,this.pos=r}},Wfr=class extends CDe{static{a(this,"YAMLParseError")}constructor(e,r,n){super("YAMLParseError",e,r,n)}},zfr=class extends CDe{static{a(this,"YAMLWarning")}constructor(e,r,n){super("YAMLWarning",e,r,n)}},Lzs=a((t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:o}=r.linePos[0];r.message+=` at line ${n}, column ${o}`;let s=o-1,c=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&c.length>80){let l=Math.min(s-39,c.length-79);c="\u2026"+c.substring(l),s-=l-1}if(c.length>80&&(c=c.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(c.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026 `),c=l+c}if(/[^ ]/.test(c)){let l=1,u=r.linePos[1];u?.line===n&&u.col>o&&(l=Math.max(1,Math.min(u.col-o,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`: ${c} ${d} -`}},"prettifyError");DDe.YAMLError=PDe;DDe.YAMLParseError=Rfr;DDe.YAMLWarning=kfr;DDe.prettifyError=Kzs});var MDe=I(dei=>{"use strict";p();function Jzs(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,E=null,_=null,v=null,b=null,T=null,w=null;for(let k of t)switch(A&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&s(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&k.type!=="comment"&&k.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),k.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&k.source.includes(" ")&&(y=k),f=!0;break;case"comment":{f||s(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=k.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=k.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=k.source,d=!0,g=!0,(E||_)&&(v=k),f=!0;break;case"anchor":E&&s(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&s(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=k,w??(w=k.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(k,"MULTIPLE_TAGS","A node can have at most one tag"),_=k,w??(w=k.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),T&&s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${e??"collection"}`),T=k,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(k,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=k,d=!1,f=!1;break}default:s(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Jzs,"resolveProps");dei.resolveProps=Jzs});var Put=I(fei=>{"use strict";p();function Pfr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` -`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Pfr(e.key)||Pfr(e.value))return!0}return!1;default:return!0}}a(Pfr,"containsNewline");fei.containsNewline=Pfr});var Dfr=I(pei=>{"use strict";p();var Zzs=Put();function Xzs(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Zzs.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Xzs,"flowIndentCheck");pei.flowIndentCheck=Xzs});var Nfr=I(mei=>{"use strict";p();var hei=Ka();function eYs(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||hei.isScalar(s)&&hei.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(eYs,"mapIncludes");mei.mapIncludes=eYs});var Cei=I(_ei=>{"use strict";p();var gei=fH(),tYs=hH(),Aei=MDe(),rYs=Put(),yei=Dfr(),nYs=Nfr(),Eei="All mapping items must start at the same column";function iYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??tYs.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=Aei.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",Eei)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` -`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||rYs.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",Eei);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&yei.flowIndentCheck(n.indent,m,o),r.atKey=!1,nYs.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=Aei.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var oYs=mH(),sYs=MDe(),aYs=Dfr();function cYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??oYs.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=sYs.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&aYs.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(cYs,"resolveBlockSeq");vei.resolveBlockSeq=cYs});var ghe=I(Sei=>{"use strict";p();function lYs(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(lYs,"resolveEnd");Sei.resolveEnd=lYs});var wei=I(xei=>{"use strict";p();var uYs=Ka(),dYs=fH(),Tei=hH(),fYs=mH(),pYs=ghe(),Iei=MDe(),hYs=Put(),mYs=Nfr(),Mfr="Block collections are not allowed within flow collections",Ofr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function gYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?Tei.YAMLMap:fYs.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E0){let E=pYs.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` -`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a(gYs,"resolveFlowCollection");xei.resolveFlowCollection=gYs});var kei=I(Rei=>{"use strict";p();var AYs=Ka(),yYs=i0(),EYs=hH(),_Ys=mH(),CYs=Cei(),vYs=bei(),bYs=wei();function Bfr(t,e,r,n,o,s){let c=r.type==="block-map"?CYs.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?vYs.resolveBlockSeq(t,e,r,n,s):bYs.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(Bfr,"resolveCollection");function SYs(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),Bfr(t,e,r,o,c)}let d=Bfr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=AYs.isNode(f)?f:new yYs.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(SYs,"composeCollection");Rei.composeCollection=SYs});var Ffr=I(Pei=>{"use strict";p();var Lfr=i0();function TYs(t,e,r){let n=e.offset,o=IYs(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?Lfr.Scalar.BLOCK_FOLDED:Lfr.Scalar.BLOCK_LITERAL,c=e.source?xYs(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` +`}},"prettifyError");bDe.YAMLError=CDe;bDe.YAMLParseError=Wfr;bDe.YAMLWarning=zfr;bDe.prettifyError=Lzs});var TDe=I(zei=>{"use strict";p();function Fzs(t,{flow:e,indicator:r,next:n,offset:o,onError:s,parentIndent:c,startOnNewline:l}){let u=!1,d=l,f=l,h="",m="",g=!1,A=!1,y=null,E=null,_=null,v=null,b=null,T=null,w=null;for(let P of t)switch(A&&(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma"&&s(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A=!1),y&&(d&&P.type!=="comment"&&P.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),P.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&P.source.includes(" ")&&(y=P),f=!0;break;case"comment":{f||s(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let D=P.source.substring(1)||" ";h?h+=m+D:h=D,m="",d=!1;break}case"newline":d?h?h+=P.source:(!T||r!=="seq-item-ind")&&(u=!0):m+=P.source,d=!0,g=!0,(E||_)&&(v=P),f=!0;break;case"anchor":E&&s(P,"MULTIPLE_ANCHORS","A node can have at most one anchor"),P.source.endsWith(":")&&s(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=P,w??(w=P.offset),d=!1,f=!1,A=!0;break;case"tag":{_&&s(P,"MULTIPLE_TAGS","A node can have at most one tag"),_=P,w??(w=P.offset),d=!1,f=!1,A=!0;break}case r:(E||_)&&s(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`),T&&s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${e??"collection"}`),T=P,d=r==="seq-item-ind"||r==="explicit-key-ind",f=!1;break;case"comma":if(e){b&&s(P,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),b=P,d=!1,f=!1;break}default:s(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),d=!1,f=!1}let R=t[t.length-1],x=R?R.offset+R.source.length:o;return A&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(d&&y.indent<=c||n?.type==="block-map"||n?.type==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:T,spaceBefore:u,comment:h,hasNewline:g,anchor:E,tag:_,newlineAfterProp:v,end:x,start:w??x}}a(Fzs,"resolveProps");zei.resolveProps=Fzs});var Fut=I(Yei=>{"use strict";p();function Yfr(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(` +`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Yfr(e.key)||Yfr(e.value))return!0}return!1;default:return!0}}a(Yfr,"containsNewline");Yei.containsNewline=Yfr});var Kfr=I(Kei=>{"use strict";p();var Uzs=Fut();function Qzs(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&Uzs.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}a(Qzs,"flowIndentCheck");Kei.flowIndentCheck=Qzs});var Jfr=I(Zei=>{"use strict";p();var Jei=Ya();function qzs(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let o=typeof n=="function"?n:(s,c)=>s===c||Jei.isScalar(s)&&Jei.isScalar(c)&&s.value===c.value;return e.some(s=>o(s.key,r))}a(qzs,"mapIncludes");Zei.mapIncludes=qzs});var iti=I(nti=>{"use strict";p();var Xei=sH(),jzs=cH(),eti=TDe(),Hzs=Fut(),tti=Kfr(),Gzs=Jfr(),rti="All mapping items must start at the same column";function $zs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??jzs.YAMLMap,l=new c(r.schema);r.atRoot&&(r.atRoot=!1);let u=n.offset,d=null;for(let f of n.items){let{start:h,key:m,sep:g,value:A}=f,y=eti.resolveProps(h,{indicator:"explicit-key-ind",next:m??g?.[0],offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0}),E=!y.found;if(E){if(m&&(m.type==="block-seq"?o(u,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==n.indent&&o(u,"BAD_INDENT",rti)),!y.anchor&&!y.tag&&!g){d=y.end,y.comment&&(l.comment?l.comment+=` +`+y.comment:l.comment=y.comment);continue}(y.newlineAfterProp||Hzs.containsNewline(m))&&o(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else y.found?.indent!==n.indent&&o(u,"BAD_INDENT",rti);r.atKey=!0;let _=y.end,v=m?t(r,m,y,o):e(r,_,h,null,y,o);r.schema.compat&&tti.flowIndentCheck(n.indent,m,o),r.atKey=!1,Gzs.mapIncludes(r,l.items,v)&&o(_,"DUPLICATE_KEY","Map keys must be unique");let b=eti.resolveProps(g??[],{indicator:"map-value-ind",next:A,offset:v.range[2],onError:o,parentIndent:n.indent,startOnNewline:!m||m.type==="block-scalar"});if(u=b.end,b.found){E&&(A?.type==="block-map"&&!b.hasNewline&&o(u,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&y.start{"use strict";p();var Vzs=lH(),Wzs=TDe(),zzs=Kfr();function Yzs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=s?.nodeClass??Vzs.YAMLSeq,l=new c(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=n.offset,d=null;for(let{start:f,value:h}of n.items){let m=Wzs.resolveProps(f,{indicator:"seq-item-ind",next:h,offset:u,onError:o,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h?.type==="block-seq"?o(m.end,"BAD_INDENT","All sequence items must start at the same column"):o(u,"MISSING_CHAR","Sequence item without - indicator");else{d=m.end,m.comment&&(l.comment=m.comment);continue}let g=h?t(r,h,m,o):e(r,m.end,f,null,m,o);r.schema.compat&&zzs.flowIndentCheck(n.indent,h,o),u=g.range[2],l.items.push(g)}return l.range=[n.offset,u,d??u],l}a(Yzs,"resolveBlockSeq");oti.resolveBlockSeq=Yzs});var hhe=I(ati=>{"use strict";p();function Kzs(t,e,r,n){let o="";if(t){let s=!1,c="";for(let l of t){let{source:u,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let f=u.substring(1)||" ";o?o+=c+f:o=f,c="";break}case"newline":o&&(c+=u),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=u.length}}return{comment:o,offset:e}}a(Kzs,"resolveEnd");ati.resolveEnd=Kzs});var dti=I(uti=>{"use strict";p();var Jzs=Ya(),Zzs=sH(),cti=cH(),Xzs=lH(),eYs=hhe(),lti=TDe(),tYs=Fut(),rYs=Jfr(),Zfr="Block collections are not allowed within flow collections",Xfr=a(t=>t&&(t.type==="block-map"||t.type==="block-seq"),"isBlock");function nYs({composeNode:t,composeEmptyNode:e},r,n,o,s){let c=n.start.source==="{",l=c?"flow map":"flow sequence",u=s?.nodeClass??(c?cti.YAMLMap:Xzs.YAMLSeq),d=new u(r.schema);d.flow=!0;let f=r.atRoot;f&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E0){let E=eYs.resolveEnd(A,y,r.options.strict,o);E.comment&&(d.comment?d.comment+=` +`+E.comment:d.comment=E.comment),d.range=[n.offset,y,E.offset]}else d.range=[n.offset,y,y];return d}a(nYs,"resolveFlowCollection");uti.resolveFlowCollection=nYs});var pti=I(fti=>{"use strict";p();var iYs=Ya(),oYs=s0(),sYs=cH(),aYs=lH(),cYs=iti(),lYs=sti(),uYs=dti();function epr(t,e,r,n,o,s){let c=r.type==="block-map"?cYs.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?lYs.resolveBlockSeq(t,e,r,n,s):uYs.resolveFlowCollection(t,e,r,n,s),l=c.constructor;return o==="!"||o===l.tagName?(c.tag=l.tagName,c):(o&&(c.tag=o),c)}a(epr,"resolveCollection");function dYs(t,e,r,n,o){let s=n.tag,c=s?e.directives.tagName(s.source,m=>o(s,"TAG_RESOLVE_FAILED",m)):null;if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:g}=n,A=m&&s?m.offset>s.offset?m:s:m??s;A&&(!g||g.offsetm.tag===c&&m.collection===l);if(!u){let m=e.schema.knownTags[c];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),u=m;else return m?o(s,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):o(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),epr(t,e,r,o,c)}let d=epr(t,e,r,o,c,u),f=u.resolve?.(d,m=>o(s,"TAG_RESOLVE_FAILED",m),e.options)??d,h=iYs.isNode(f)?f:new oYs.Scalar(f);return h.range=d.range,h.tag=c,u?.format&&(h.format=u.format),h}a(dYs,"composeCollection");fti.composeCollection=dYs});var rpr=I(hti=>{"use strict";p();var tpr=s0();function fYs(t,e,r){let n=e.offset,o=pYs(e,t.options.strict,r);if(!o)return{value:"",type:null,comment:"",range:[n,n,n]};let s=o.mode===">"?tpr.Scalar.BLOCK_FOLDED:tpr.Scalar.BLOCK_LITERAL,c=e.source?hYs(e.source):[],l=c.length;for(let y=c.length-1;y>=0;--y){let E=c[y][1];if(E===""||E==="\r")l=y;else break}if(l===0){let y=o.chomp==="+"&&c.length>0?` `.repeat(Math.max(1,c.length-1)):"",E=n+o.length;return e.source&&(E+=e.source.length),{value:y,type:s,comment:o.comment,range:[n,E,E]}}let u=e.indent+o.indent,d=e.offset+o.length,f=0;for(let y=0;yu&&(u=E.length);else{E.length=l;--y)c[y][0].length>u&&(l=y+1);let h="",m="",g=!1;for(let y=0;yu||_[0]===" "?(m===" "?m=` `:!g&&m===` `&&(m=` @@ -449,84 +418,75 @@ ${d} `+c[y][0].slice(u);h[h.length-1]!==` `&&(h+=` `);break;default:h+=` -`}let A=n+o.length+e.source.length;return{value:h,type:s,comment:o.comment,range:[n,A,A]}}a(TYs,"resolveBlockScalar");function IYs({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:o}=e[0],s=o[0],c=0,l="",u=-1;for(let m=1;m{"use strict";p();var Ufr=i0(),wYs=ghe();function RYs(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=Ufr.Scalar.PLAIN,u=kYs(s,d);break;case"single-quoted-scalar":l=Ufr.Scalar.QUOTE_SINGLE,u=PYs(s,d);break;case"double-quoted-scalar":l=Ufr.Scalar.QUOTE_DOUBLE,u=DYs(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=wYs.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(RYs,"resolveFlowScalar");function kYs(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Dei(t)}a(kYs,"plainValue");function PYs(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Dei(t.slice(1,-1)).replace(/''/g,"'")}a(PYs,"singleQuotedValue");function Dei(t){let e,r;try{e=new RegExp(`(.*?)(?{"use strict";p();var npr=s0(),mYs=hhe();function gYs(t,e,r){let{offset:n,type:o,source:s,end:c}=t,l,u,d=a((m,g,A)=>r(n+m,g,A),"_onError");switch(o){case"scalar":l=npr.Scalar.PLAIN,u=AYs(s,d);break;case"single-quoted-scalar":l=npr.Scalar.QUOTE_SINGLE,u=yYs(s,d);break;case"double-quoted-scalar":l=npr.Scalar.QUOTE_DOUBLE,u=EYs(s,d);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let f=n+s.length,h=mYs.resolveEnd(c,f,e,r);return{value:u,type:l,comment:h.comment,range:[n,f,h.offset]}}a(gYs,"resolveFlowScalar");function AYs(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),mti(t)}a(AYs,"plainValue");function yYs(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),mti(t.slice(1,-1)).replace(/''/g,"'")}a(yYs,"singleQuotedValue");function mti(t){let e,r;try{e=new RegExp(`(.*?)(?s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(DYs,"doubleQuotedValue");function NYs(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` +`)&&(r+=n>s?t.slice(s,n+1):o)}else r+=o}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}a(EYs,"doubleQuotedValue");function _Ys(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===` `||n==="\r")&&!(n==="\r"&&t[e+2]!==` `);)n===` `&&(r+=` -`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}a(NYs,"foldNewline");var MYs={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function OYs(t,e,r,n){let o=t.substr(e,r),c=o.length===r&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(c)){let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(c)}a(OYs,"parseCharCode");Nei.resolveFlowScalar=RYs});var Bei=I(Oei=>{"use strict";p();var EX=Ka(),Mei=i0(),BYs=Ffr(),LYs=Qfr();function FYs(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?BYs.resolveBlockScalar(t,e,n):LYs.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[EX.SCALAR]:u?d=UYs(t.schema,o,u,r,n):e.type==="scalar"?d=QYs(t,o,e,n):d=t.schema[EX.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=EX.isScalar(h)?h:new Mei.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Mei.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(FYs,"composeScalar");function UYs(t,e,r,n,o){if(r==="!")return t[EX.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[EX.SCALAR])}a(UYs,"findScalarTagByName");function QYs({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[EX.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[EX.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(QYs,"findScalarTagByTest");Oei.composeScalar=FYs});var Fei=I(Lei=>{"use strict";p();function qYs(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(qYs,"emptyScalarPosition");Lei.emptyScalarPosition=qYs});var qei=I(jfr=>{"use strict";p();var jYs=pDe(),HYs=Ka(),GYs=kei(),Uei=Bei(),$Ys=ghe(),VYs=Fei(),WYs={composeNode:Qei,composeEmptyNode:qfr};function Qei(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=zYs(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=Uei.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=GYs.composeCollection(WYs,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=qfr(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!HYs.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(Qei,"composeNode");function qfr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:VYs.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Uei.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(qfr,"composeEmptyNode");function zYs({options:t},{offset:e,source:r,end:n},o){let s=new jYs.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=$Ys.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(zYs,"composeAlias");jfr.composeEmptyNode=qfr;jfr.composeNode=Qei});var Gei=I(Hei=>{"use strict";p();var YYs=kDe(),jei=qei(),KYs=ghe(),JYs=MDe();function ZYs(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new YYs.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=JYs.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?jei.composeNode(d,o,f,c):jei.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=KYs.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(ZYs,"composeDoc");Hei.composeDoc=ZYs});var Gfr=I(Wei=>{"use strict";p();var XYs=require("process"),eKs=Rdr(),tKs=kDe(),ODe=NDe(),$ei=Ka(),rKs=Gei(),nKs=ghe();function BDe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(BDe,"getErrorPos");function Vei(t){let e="",r=!1,n=!1;for(let o=0;o{"use strict";p();var mX=Ya(),Ati=s0(),bYs=rpr(),SYs=ipr();function TYs(t,e,r,n){let{value:o,type:s,comment:c,range:l}=e.type==="block-scalar"?bYs.resolveBlockScalar(t,e,n):SYs.resolveFlowScalar(e,t.options.strict,n),u=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[mX.SCALAR]:u?d=IYs(t.schema,o,u,r,n):e.type==="scalar"?d=xYs(t,o,e,n):d=t.schema[mX.SCALAR];let f;try{let h=d.resolve(o,m=>n(r??e,"TAG_RESOLVE_FAILED",m),t.options);f=mX.isScalar(h)?h:new Ati.Scalar(h)}catch(h){let m=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",m),f=new Ati.Scalar(o)}return f.range=l,f.source=o,s&&(f.type=s),u&&(f.tag=u),d.format&&(f.format=d.format),c&&(f.comment=c),f}a(TYs,"composeScalar");function IYs(t,e,r,n,o){if(r==="!")return t[mX.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let c=t.knownTags[r];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(o(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[mX.SCALAR])}a(IYs,"findScalarTagByName");function xYs({atKey:t,directives:e,schema:r},n,o,s){let c=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[mX.SCALAR];if(r.compat){let l=r.compat.find(u=>u.default&&u.test?.test(n))??r[mX.SCALAR];if(c.tag!==l.tag){let u=e.tagString(c.tag),d=e.tagString(l.tag),f=`Value may be parsed as either ${u} or ${d}`;s(o,"TAG_RESOLVE_FAILED",f,!0)}}return c}a(xYs,"findScalarTagByTest");yti.composeScalar=TYs});var vti=I(_ti=>{"use strict";p();function wYs(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let o=e[n];switch(o.type){case"space":case"comment":case"newline":t-=o.source.length;continue}for(o=e[++n];o?.type==="space";)t+=o.source.length,o=e[++n];break}}return t}a(wYs,"emptyScalarPosition");_ti.emptyScalarPosition=wYs});var Sti=I(spr=>{"use strict";p();var RYs=iDe(),PYs=Ya(),kYs=pti(),Cti=Eti(),DYs=hhe(),NYs=vti(),MYs={composeNode:bti,composeEmptyNode:opr};function bti(t,e,r,n){let o=t.atKey,{spaceBefore:s,comment:c,anchor:l,tag:u}=r,d,f=!0;switch(e.type){case"alias":d=OYs(t,e,n),(l||u)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":d=Cti.composeScalar(t,e,u,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=kYs.composeCollection(MYs,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(h){let m=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",m)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=!1}}return d??(d=opr(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),o&&t.options.stringKeys&&(!PYs.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(u??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),c&&(e.type==="scalar"&&e.source===""?d.comment=c:d.commentBefore=c),t.options.keepSourceTokens&&f&&(d.srcToken=e),d}a(bti,"composeNode");function opr(t,e,r,n,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:"scalar",offset:NYs.emptyScalarPosition(e,r,n),indent:-1,source:""},h=Cti.composeScalar(t,f,l,d);return c&&(h.anchor=c.source.substring(1),h.anchor===""&&d(c,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=u),h}a(opr,"composeEmptyNode");function OYs({options:t},{offset:e,source:r,end:n},o){let s=new RYs.Alias(r.substring(1));s.source===""&&o(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&o(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let c=e+r.length,l=DYs.resolveEnd(n,c,t.strict,o);return s.range=[e,c,l.offset],l.comment&&(s.comment=l.comment),s}a(OYs,"composeAlias");spr.composeEmptyNode=opr;spr.composeNode=bti});var xti=I(Iti=>{"use strict";p();var BYs=vDe(),Tti=Sti(),LYs=hhe(),FYs=TDe();function UYs(t,e,{offset:r,start:n,value:o,end:s},c){let l=Object.assign({_directives:e},t),u=new BYs.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:u.directives,options:u.options,schema:u.schema},f=FYs.resolveProps(n,{indicator:"doc-start",next:o??s?.[0],offset:r,onError:c,parentIndent:0,startOnNewline:!0});f.found&&(u.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!f.hasNewline&&c(f.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),u.contents=o?Tti.composeNode(d,o,f,c):Tti.composeEmptyNode(d,f.end,n,null,f,c);let h=u.contents.range[2],m=LYs.resolveEnd(s,h,!1,c);return m.comment&&(u.comment=m.comment),u.range=[r,h,m.offset],u}a(UYs,"composeDoc");Iti.composeDoc=UYs});var cpr=I(Pti=>{"use strict";p();var QYs=require("process"),qYs=Wdr(),jYs=vDe(),IDe=SDe(),wti=Ya(),HYs=xti(),GYs=hhe();function xDe(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}a(xDe,"getErrorPos");function Rti(t){let e="",r=!1,n=!1;for(let o=0;o{let c=BDe(r);s?this.warnings.push(new ODe.YAMLWarning(c,n,o)):this.errors.push(new ODe.YAMLParseError(c,n,o))},this.directives=new eKs.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Vei(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} -${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if($ei.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];$ei.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} +`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[o+1]?.[0]!=="#"&&(o+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}a(Rti,"parsePrelude");var apr=class{static{a(this,"Composer")}constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,o,s)=>{let c=xDe(r);s?this.warnings.push(new IDe.YAMLWarning(c,n,o)):this.errors.push(new IDe.YAMLParseError(c,n,o))},this.directives=new qYs.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:o}=Rti(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment} +${n}`:n;else if(o||e.directives.docStart||!s)e.commentBefore=n;else if(wti.isCollection(s)&&!s.flow&&s.items.length>0){let c=s.items[0];wti.isPair(c)&&(c=c.key);let l=c.commentBefore;c.commentBefore=l?`${n} ${l}`:n}else{let c=s.commentBefore;s.commentBefore=c?`${n} -${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Vei(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(XYs.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=BDe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=rKs.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new ODe.YAMLParseError(BDe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new ODe.YAMLParseError(BDe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=nKs.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} -${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new ODe.YAMLParseError(BDe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new tKs.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};Wei.Composer=Hfr});var Kei=I(Dut=>{"use strict";p();var iKs=Ffr(),oKs=Qfr(),sKs=NDe(),zei=yDe();function aKs(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new sKs.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return oKs.resolveFlowScalar(t,e,n);case"block-scalar":return iKs.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(aKs,"resolveAsScalar");function cKs(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=zei.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` +${c}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Rti(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let o of e)yield*this.next(o);yield*this.end(r,n)}*next(e){switch(QYs.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,o)=>{let s=xDe(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=HYs.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new IDe.YAMLParseError(xDe(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new IDe.YAMLParseError(xDe(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=GYs.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n} +${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new IDe.YAMLParseError(xDe(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),o=new jYs.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,r,r],this.decorate(o,!1),yield o}}};Pti.Composer=apr});var Nti=I(Uut=>{"use strict";p();var $Ys=rpr(),VYs=ipr(),WYs=SDe(),kti=lDe();function zYs(t,e=!0,r){if(t){let n=a((o,s,c)=>{let l=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(r)r(l,s,c);else throw new WYs.YAMLParseError([l,l+1],s,c)},"_onError");switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return VYs.resolveFlowScalar(t,e,n);case"block-scalar":return $Ys.resolveBlockScalar({options:{strict:e}},t,n)}}return null}a(zYs,"resolveAsScalar");function YYs(t,e){let{implicitKey:r=!1,indent:n,inFlow:o=!1,offset:s=-1,type:c="PLAIN"}=e,l=kti.stringifyString({type:c,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),u=e.end??[{type:"newline",offset:-1,indent:n,source:` `}];switch(l[0]){case"|":case">":{let d=l.indexOf(` `),f=l.substring(0,d),h=l.substring(d+1)+` -`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return Yei(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` -`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a(cKs,"createScalarToken");function lKs(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=zei.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":uKs(t,u);break;case'"':$fr(t,u,"double-quoted-scalar");break;case"'":$fr(t,u,"single-quoted-scalar");break;default:$fr(t,u,"scalar")}}a(lKs,"setScalarValue");function uKs(t,e){let r=e.indexOf(` +`,m=[{type:"block-scalar-header",offset:s,indent:n,source:f}];return Dti(m,u)||m.push({type:"newline",offset:-1,indent:n,source:` +`}),{type:"block-scalar",offset:s,indent:n,props:m,source:h}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:u};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:u};default:return{type:"scalar",offset:s,indent:n,source:l,end:u}}}a(YYs,"createScalarToken");function KYs(t,e,r={}){let{afterKey:n=!1,implicitKey:o=!1,inFlow:s=!1,type:c}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}let u=kti.stringifyString({type:c,value:e},{implicitKey:o||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(u[0]){case"|":case">":JYs(t,u);break;case'"':lpr(t,u,"double-quoted-scalar");break;case"'":lpr(t,u,"single-quoted-scalar");break;default:lpr(t,u,"scalar")}}a(KYs,"setScalarValue");function JYs(t,e){let r=e.indexOf(` `),n=e.substring(0,r),o=e.substring(r+1)+` -`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];Yei(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` -`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(uKs,"setBlockScalarValue");function Yei(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(Yei,"addEndtoBlockProps");function $fr(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` -`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a($fr,"setFlowScalarValue");Dut.createScalarToken=cKs;Dut.resolveAsScalar=aKs;Dut.setScalarValue=lKs});var Zei=I(Jei=>{"use strict";p();var dKs=a(t=>"type"in t?Mut(t):Nut(t),"stringify");function Mut(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Mut(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Nut(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Nut(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Nut(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(Mut,"stringifyToken");function Nut({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=Mut(e)),r)for(let s of r)o+=s.source;return n&&(o+=Mut(n)),o}a(Nut,"stringifyItem");Jei.stringify=dKs});var rti=I(tti=>{"use strict";p();var Vfr=Symbol("break visit"),fKs=Symbol("skip children"),Xei=Symbol("remove item");function _X(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),eti(Object.freeze([]),t,e)}a(_X,"visit");_X.BREAK=Vfr;_X.SKIP=fKs;_X.REMOVE=Xei;_X.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};_X.parentCollection=(t,e)=>{let r=_X.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function eti(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var Wfr=Kei(),pKs=Zei(),hKs=rti(),zfr="\uFEFF",Yfr="",Kfr="",Jfr="",mKs=a(t=>!!t&&"items"in t,"isCollection"),gKs=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function AKs(t){switch(t){case zfr:return"";case Yfr:return"";case Kfr:return"";case Jfr:return"";default:return JSON.stringify(t)}}a(AKs,"prettyToken");function yKs(t){switch(t){case zfr:return"byte-order-mark";case Yfr:return"doc-mode";case Kfr:return"flow-error-end";case Jfr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=o}else{let{offset:s}=t,c="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:c,source:n}];Dti(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:c,source:` +`});for(let u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:"block-scalar",indent:c,props:l,source:o})}}a(JYs,"setBlockScalarValue");function Dti(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}a(Dti,"addEndtoBlockProps");function lpr(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),o=e.length;t.props[0].type==="block-scalar-header"&&(o-=t.props[0].source.length);for(let s of n)s.offset+=o;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let o={type:"newline",offset:t.offset+e.length,indent:t.indent,source:` +`};delete t.items,Object.assign(t,{type:r,source:e,end:[o]});break}default:{let n="indent"in t?t.indent:-1,o="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:o})}}}a(lpr,"setFlowScalarValue");Uut.createScalarToken=YYs;Uut.resolveAsScalar=zYs;Uut.setScalarValue=KYs});var Oti=I(Mti=>{"use strict";p();var ZYs=a(t=>"type"in t?qut(t):Qut(t),"stringify");function qut(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=qut(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Qut(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Qut(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Qut(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}a(qut,"stringifyToken");function Qut({start:t,key:e,sep:r,value:n}){let o="";for(let s of t)o+=s.source;if(e&&(o+=qut(e)),r)for(let s of r)o+=s.source;return n&&(o+=qut(n)),o}a(Qut,"stringifyItem");Mti.stringify=ZYs});var Uti=I(Fti=>{"use strict";p();var upr=Symbol("break visit"),XYs=Symbol("skip children"),Bti=Symbol("remove item");function gX(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Lti(Object.freeze([]),t,e)}a(gX,"visit");gX.BREAK=upr;gX.SKIP=XYs;gX.REMOVE=Bti;gX.itemAtPath=(t,e)=>{let r=t;for(let[n,o]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[o];else return}return r};gX.parentCollection=(t,e)=>{let r=gX.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],o=r?.[n];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function Lti(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let o of["key","value"]){let s=e[o];if(s&&"items"in s){for(let c=0;c{"use strict";p();var dpr=Nti(),eKs=Oti(),tKs=Uti(),fpr="\uFEFF",ppr="",hpr="",mpr="",rKs=a(t=>!!t&&"items"in t,"isCollection"),nKs=a(t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar"),"isScalar");function iKs(t){switch(t){case fpr:return"";case ppr:return"";case hpr:return"";case mpr:return"";default:return JSON.stringify(t)}}a(iKs,"prettyToken");function oKs(t){switch(t){case fpr:return"byte-order-mark";case ppr:return"doc-mode";case hpr:return"flow-error-end";case mpr:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(yKs,"tokenType");Tb.createScalarToken=Wfr.createScalarToken;Tb.resolveAsScalar=Wfr.resolveAsScalar;Tb.setScalarValue=Wfr.setScalarValue;Tb.stringify=pKs.stringify;Tb.visit=hKs.visit;Tb.BOM=zfr;Tb.DOCUMENT=Yfr;Tb.FLOW_END=Kfr;Tb.SCALAR=Jfr;Tb.isCollection=mKs;Tb.isScalar=gKs;Tb.prettyToken=AKs;Tb.tokenType=yKs});var epr=I(iti=>{"use strict";p();var LDe=Out();function S2(t){switch(t){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}a(S2,"isEmpty");var nti=new Set("0123456789ABCDEFabcdef"),EKs=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),But=new Set(",[]{}"),_Ks=new Set(` ,[]{} -\r `),Zfr=a(t=>!t||_Ks.has(t),"isNotAnchorChar"),Xfr=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}a(oKs,"tokenType");yb.createScalarToken=dpr.createScalarToken;yb.resolveAsScalar=dpr.resolveAsScalar;yb.setScalarValue=dpr.setScalarValue;yb.stringify=eKs.stringify;yb.visit=tKs.visit;yb.BOM=fpr;yb.DOCUMENT=ppr;yb.FLOW_END=hpr;yb.SCALAR=mpr;yb.isCollection=rKs;yb.isScalar=nKs;yb.prettyToken=iKs;yb.tokenType=oKs});var ypr=I(qti=>{"use strict";p();var wDe=jut();function C2(t){switch(t){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}a(C2,"isEmpty");var Qti=new Set("0123456789ABCDEFabcdef"),sKs=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Hut=new Set(",[]{}"),aKs=new Set(` ,[]{} +\r `),gpr=a(t=>!t||aKs.has(t),"isNotAnchorChar"),Apr=class{static{a(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===` `?!0:r==="\r"?this.buffer[e+1]===` `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let o=this.buffer[n+e+1];if(o===` `||!o&&!this.atEnd)return e+n+1}return r===` -`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&S2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!S2(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&S2(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Zfr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&n=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&C2(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&ethis.indentValue&&!C2(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&C2(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(gpr),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let o=this.getLine();if(o===null)return this.setNext("flow");if((n!==-1&&n"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>S2(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case` +`,s)}o!==-1&&(r=o-(n[o-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>C2(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case` `:e=s,r=0;break;case"\r":{let c=this.buffer[s+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===` `)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(` `,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let o=e+1;for(n=this.buffer[o];n===" ";)n=this.buffer[++o];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===` `;)n=this.buffer[++o];e=o-1}else if(!this.blockScalarKeep)do{let s=e-1,c=this.buffer[s];c==="\r"&&(c=this.buffer[--s]);let l=s;for(;c===" ";)c=this.buffer[--s];if(c===` -`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield LDe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(S2(s)||e&&But.has(s))break;r=n}else if(S2(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` +`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield wDe.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,o;for(;o=this.buffer[++n];)if(o===":"){let s=this.buffer[n+1];if(C2(s)||e&&Hut.has(s))break;r=n}else if(C2(o)){let s=this.buffer[n+1];if(o==="\r"&&(s===` `?(n+=1,o=` -`,s=this.buffer[n+1]):r=n),s==="#"||e&&But.has(s))break;if(o===` -`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&But.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield LDe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Zfr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(S2(r)||e&&But.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!S2(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(EKs.has(r))r=this.buffer[++e];else if(r==="%"&&nti.has(this.buffer[e+1])&&nti.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` +`,s=this.buffer[n+1]):r=n),s==="#"||e&&Hut.has(s))break;if(o===` +`){let c=this.continueScalar(n+1);if(c===-1)break;n=Math.max(n,c-2)}}else{if(e&&Hut.has(o))break;r=n}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield wDe.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(gpr))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(C2(r)||e&&Hut.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!C2(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(sKs.has(r))r=this.buffer[++e];else if(r==="%"&&Qti.has(this.buffer[e+1])&&Qti.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let o=r-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};iti.Lexer=Xfr});var rpr=I(oti=>{"use strict";p();var tpr=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var CKs=require("process"),sti=Out(),vKs=epr();function gH(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(Ahe,"getFirstKeyStartProps");function cti(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!gH(e.start,"explicit-key-ind")&&!gH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,lti(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a(cti,"fixFlowSeqItems");var npr=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new vKs.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,CKs.env.LOG_TOKENS&&console.log("|",sti.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=sti.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&cti(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&ati(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,o),this.pos=r),o}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};qti.Lexer=Apr});var _pr=I(jti=>{"use strict";p();var Epr=class{static{a(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r>1;this.lineStarts[s]{"use strict";p();var cKs=require("process"),Hti=jut(),lKs=ypr();function uH(t,e){for(let r=0;r=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}a(mhe,"getFirstKeyStartProps");function $ti(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!uH(e.start,"explicit-key-ind")&&!uH(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Vti(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}a($ti,"fixFlowSeqItems");var vpr=class{static{a(this,"Parser")}constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lKs.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,cKs.env.LOG_TOKENS&&console.log("|",Hti.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Hti.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&$ti(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let o=n.items[n.items.length-1];if(o.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=r;else{Object.assign(o,{key:r,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=n.items[n.items.length-1];o.value?n.items.push({start:[],value:r}):o.value=r;break}case"flow-collection":{let o=n.items[n.items.length-1];!o||o.value?n.items.push({start:[],key:r,sep:[]}):o.sep?o.value=r:Object.assign(o,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let o=r.items[r.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Gti(o.start)===-1&&(r.indent===0||o.start.every(s=>s.type!=="comment"||s.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gH(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(lti(r.key)&&!gH(r.sep,"newline")){let c=Ahe(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(gH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=Ahe(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):gH(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!gH(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||gH(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=Lut(n),s=Ahe(o);cti(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` +`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,o=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(o&&r.sep&&!r.value){let c=[];for(let l=0;le.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(s=r.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":o||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):o||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(uH(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Vti(r.key)&&!uH(r.sep,"newline")){let c=mhe(r.start),l=r.key,u=r.sep;u.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:l,sep:u}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(uH(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let c=mhe(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||o?e.items.push({start:s,key:null,sep:[this.sourceToken]}):uH(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let c=this.flowScalar(this.type);o||r.value?(e.items.push({start:s,key:c,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(c):(Object.assign(r,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{let c=this.startBlockValue(e);if(c){if(c.type==="block-seq"){if(!r.explicitKey&&r.sep&&!uH(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,r.start),o.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||uH(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:o,sep:[]}):r.sep?this.stack.push(o):Object.assign(r,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let o=Gut(n),s=mhe(o);$ti(e);let c=e.end.splice(1,e.end.length);c.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(` `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(` -`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Lut(e),n=Ahe(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Lut(e),n=Ahe(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};uti.Parser=npr});var mti=I(UDe=>{"use strict";p();var dti=Gfr(),bKs=kDe(),FDe=NDe(),SKs=jdr(),TKs=Ka(),IKs=rpr(),fti=ipr();function pti(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new IKs.LineCounter||null,prettyErrors:e}}a(pti,"parseOptions");function xKs(t,e={}){let{lineCounter:r,prettyErrors:n}=pti(e),o=new fti.Parser(r?.addNewLine),s=new dti.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(FDe.prettifyError(t,r)),l.warnings.forEach(FDe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(xKs,"parseAllDocuments");function hti(t,e={}){let{lineCounter:r,prettyErrors:n}=pti(e),o=new fti.Parser(r?.addNewLine),s=new dti.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new FDe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(FDe.prettifyError(t,r)),c.warnings.forEach(FDe.prettifyError(t,r))),c}a(hti,"parseDocument");function wKs(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=hti(t,r);if(!o)return null;if(o.warnings.forEach(s=>SKs.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(wKs,"parse");function RKs(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return TKs.isDocument(t)&&!n?t.toString(r):new bKs.Document(t,n,r).toString(r)}a(RKs,"stringify");UDe.parse=wKs;UDe.parseAllDocuments=xKs;UDe.parseDocument=hti;UDe.stringify=RKs});var Ati=I(qc=>{"use strict";p();var kKs=Gfr(),PKs=kDe(),DKs=Sfr(),opr=NDe(),NKs=pDe(),AH=Ka(),MKs=fH(),OKs=i0(),BKs=hH(),LKs=mH(),FKs=Out(),UKs=epr(),QKs=rpr(),qKs=ipr(),Fut=mti(),gti=lDe();qc.Composer=kKs.Composer;qc.Document=PKs.Document;qc.Schema=DKs.Schema;qc.YAMLError=opr.YAMLError;qc.YAMLParseError=opr.YAMLParseError;qc.YAMLWarning=opr.YAMLWarning;qc.Alias=NKs.Alias;qc.isAlias=AH.isAlias;qc.isCollection=AH.isCollection;qc.isDocument=AH.isDocument;qc.isMap=AH.isMap;qc.isNode=AH.isNode;qc.isPair=AH.isPair;qc.isScalar=AH.isScalar;qc.isSeq=AH.isSeq;qc.Pair=MKs.Pair;qc.Scalar=OKs.Scalar;qc.YAMLMap=BKs.YAMLMap;qc.YAMLSeq=LKs.YAMLSeq;qc.CST=FKs;qc.Lexer=UKs.Lexer;qc.LineCounter=QKs.LineCounter;qc.Parser=qKs.Parser;qc.parse=Fut.parse;qc.parseAllDocuments=Fut.parseAllDocuments;qc.parseDocument=Fut.parseDocument;qc.stringify=Fut.stringify;qc.visit=gti.visit;qc.visitAsync=gti.visitAsync});var yti=I(Uut=>{"use strict";p();Object.defineProperty(Uut,"__esModule",{value:!0});Uut.FetchCancellationError=void 0;var jKs=Ts(),spr=class extends jKs.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};Uut.FetchCancellationError=spr});var Qs=I(yH=>{"use strict";p();Object.defineProperty(yH,"__esModule",{value:!0});yH.IInstantiationService=yH._util=void 0;yH.createDecorator=Eti;yH.refineServiceDecorator=GKs;var KF;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(r){return r[t.DI_DEPENDENCIES]||[]}a(e,"getServiceDependencies"),t.getServiceDependencies=e})(KF||(yH._util=KF={}));yH.IInstantiationService=Eti("instantiationService");function HKs(t,e,r){e[KF.DI_TARGET]===e?e[KF.DI_DEPENDENCIES].push({id:t,index:r}):(e[KF.DI_DEPENDENCIES]=[{id:t,index:r}],e[KF.DI_TARGET]=e)}a(HKs,"storeServiceDependency");function Eti(t){if(KF.serviceIds.has(t))return KF.serviceIds.get(t);let e=a(function(r,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");HKs(e,r,o)},"id");return e.toString=()=>t,KF.serviceIds.set(t,e),e}a(Eti,"createDecorator");function GKs(t){return t}a(GKs,"refineServiceDecorator")});var qut=I(Qut=>{"use strict";p();Object.defineProperty(Qut,"__esModule",{value:!0});Qut.SyncDescriptor=void 0;var apr=class{static{a(this,"SyncDescriptor")}constructor(e,r=[],n=!1){this.ctor=e,this.staticArguments=r,this.supportsDelayedInstantiation=n}};Qut.SyncDescriptor=apr});var _ti=I(yhe=>{"use strict";p();Object.defineProperty(yhe,"__esModule",{value:!0});yhe.Graph=yhe.Node=void 0;var jut=class{static{a(this,"Node")}constructor(e,r){this.key=e,this.data=r,this.incoming=new Map,this.outgoing=new Map}};yhe.Node=jut;var cpr=class{static{a(this,"Graph")}constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let r of this._nodes.values())r.outgoing.size===0&&e.push(r);return e}insertEdge(e,r){let n=this.lookupOrInsertNode(e),o=this.lookupOrInsertNode(r);n.outgoing.set(o.key,o),o.incoming.set(n.key,n)}removeNode(e){let r=this._hashFn(e);this._nodes.delete(r);for(let n of this._nodes.values())n.outgoing.delete(r),n.incoming.delete(r)}lookupOrInsertNode(e){let r=this._hashFn(e),n=this._nodes.get(r);return n||(n=new jut(r,e),this._nodes.set(r,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[r,n]of this._nodes)e.push(`${r} - (-> incoming)[${[...n.incoming.keys()].join(", ")}] - (outgoing ->)[${[...n.outgoing.keys()].join(",")}] -`);return e.join(` -`)}findCycleSlow(){for(let[e,r]of this._nodes){let n=new Set([e]),o=this._findCycle(r,n);if(o)return o}}_findCycle(e,r){for(let[n,o]of e.outgoing){if(r.has(n))return[...r,n].join(" -> ");r.add(n);let s=this._findCycle(o,r);if(s)return s;r.delete(n)}}};yhe.Graph=cpr});var upr=I(Hut=>{"use strict";p();Object.defineProperty(Hut,"__esModule",{value:!0});Hut.ServiceCollection=void 0;var lpr=class{static{a(this,"ServiceCollection")}constructor(...e){this._entries=new Map;for(let[r,n]of e)this.set(r,n)}set(e,r){let n=this._entries.get(e);return this._entries.set(e,r),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};Hut.ServiceCollection=lpr});var vti=I(Che=>{"use strict";p();Object.defineProperty(Che,"__esModule",{value:!0});Che.Trace=Che.InstantiationService=void 0;var $Ks=Xc(),VKs=Ts(),dpr=ko(),Ehe=qut(),Cti=_ti(),fpr=Qs(),WKs=upr(),zKs=Ele(),YKs=!1,Gut=class extends Error{static{a(this,"CyclicDependencyError")}constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}},ppr=class t{static{a(this,"InstantiationService")}constructor(e=new WKs.ServiceCollection,r=!1,n,o=YKs){this._services=e,this._strict=r,this._parent=n,this._enableTracing=o,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(fpr.IInstantiationService,this),this._globalGraph=o?n?._globalGraph??new Cti.Graph(s=>s):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,(0,dpr.dispose)(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)(0,dpr.isDisposable)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,r){this._throwIfDisposed();let n=this,o=new class extends t{dispose(){n._children.delete(o),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(o),r?.add(o),o}invokeFunction(e,...r){this._throwIfDisposed();let n=_he.traceInvocation(this._enableTracing,e),o=!1;try{return e({get:a(c=>{if(o)throw(0,VKs.illegalState)("service accessor is only valid during the invocation of its target method");let l=this._getOrCreateServiceInstance(c,n);return l||this._throwIfStrict(`[invokeFunction] unknown service '${c}'`,!1),l},"get")},...r)}finally{o=!0,n.stop()}}createInstance(e,...r){this._throwIfDisposed();let n,o;return e instanceof Ehe.SyncDescriptor?(n=_he.traceCreation(this._enableTracing,e.ctor),o=this._createInstance(e.ctor,e.staticArguments.concat(r),n)):(n=_he.traceCreation(this._enableTracing,e),o=this._createInstance(e,r,n)),n.stop(),o}_createInstance(e,r=[],n){let o=fpr._util.getServiceDependencies(e).sort((l,u)=>l.index-u.index),s=[];for(let l of o){let u=this._getOrCreateServiceInstance(l.id,n);u||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id}.`,!1),s.push(u)}let c=o.length>0?o[0].index:r.length;if(r.length!==c){console.trace(`[createInstance] First service dependency of ${e.name} at position ${c+1} conflicts with ${r.length} static arguments`);let l=c-r.length;l>0?r=r.concat(new Array(l)):r=r.slice(0,c)}return Reflect.construct(e,r.concat(s))}_setCreatedServiceInstance(e,r){if(this._services.get(e)instanceof Ehe.SyncDescriptor)this._services.set(e,r);else if(this._parent)this._parent._setCreatedServiceInstance(e,r);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let r=this._services.get(e);return!r&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):r}_getOrCreateServiceInstance(e,r){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof Ehe.SyncDescriptor?this._safeCreateAndCacheServiceInstance(e,n,r.branch(e,!0)):(r.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,r,n){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,r,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,r,n){let o=new Cti.Graph(u=>u.id.toString()),s=0,c=[{id:e,desc:r,_trace:n}],l=new Set;for(;c.length;){let u=c.pop();if(!l.has(String(u.id))){if(l.add(String(u.id)),o.lookupOrInsertNode(u),s++>1e3)throw new Gut(o);for(let d of fpr._util.getServiceDependencies(u.desc.ctor)){let f=this._getServiceInstanceOrDescriptor(d.id);if(f||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(u.id),String(d.id)),f instanceof Ehe.SyncDescriptor){let h={id:d.id,desc:f,_trace:u._trace.branch(d.id,!0)};o.insertEdge(u,h),c.push(h)}}}}for(;;){let u=o.roots();if(u.length===0){if(!o.isEmpty())throw new Gut(o);break}for(let{data:d}of u){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Ehe.SyncDescriptor){let h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,h)}o.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,r,n=[],o,s){if(this._services.get(e)instanceof Ehe.SyncDescriptor)return this._createServiceInstance(e,r,n,o,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,r,n,o,s);throw new Error(`illegalState - creating UNKNOWN service instance ${r.name}`)}_createServiceInstance(e,r,n=[],o,s,c){if(o){let l=new t(void 0,this._strict,this,this._enableTracing);l._globalGraphImplicitDependency=String(e);let u=new Map,d=new $Ks.GlobalIdleValue(()=>{let f=l._createInstance(r,n,s);for(let[h,m]of u){let g=f[h];if(typeof g=="function")for(let A of m)A.disposable=g.apply(f,A.listener)}return u.clear(),c.add(f),f});return new Proxy(Object.create(null),{get(f,h){if(!d.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let A=u.get(h);return A||(A=new zKs.LinkedList,u.set(h,A)),a((E,_,v)=>{if(d.isInitialized)return d.value[h](E,_,v);{let b={listener:[E,_,v],disposable:void 0},T=A.push(b);return(0,dpr.toDisposable)(()=>{T(),b.disposable?.dispose()})}},"event")}if(h in f)return f[h];let m=d.value,g=m[h];return typeof g!="function"||(g=g.bind(m),f[h]=g),g},set(f,h,m){return d.value[h]=m,!0},getPrototypeOf(f){return r.prototype}})}else{let l=this._createInstance(r,n,s);return c.add(l),l}}_throwIfStrict(e,r){if(r&&console.warn(e),this._strict)throw new Error(e)}};Che.InstantiationService=ppr;var _he=class t{static{a(this,"Trace")}static{this.all=new Set}static{this._None=new class extends t{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,r){return e?new t(2,r.name||new Error().stack.split(` -`).slice(3,4).join(` -`)):t._None}static traceCreation(e,r){return e?new t(1,r.name):t._None}static{this._totals=0}constructor(e,r){this.type=e,this.name=r,this._start=Date.now(),this._dep=[]}branch(e,r){let n=new t(3,e.toString());return this._dep.push([e,r,n]),n}stop(){let e=Date.now()-this._start;t._totals+=e;let r=!1;function n(s,c){let l=[],u=new Array(s+1).join(" ");for(let[d,f,h]of c._dep)if(f&&h){r=!0,l.push(`${u}CREATES -> ${d}`);let m=n(s+1,h);m&&l.push(m)}else l.push(`${u}uses -> ${d}`);return l.join(` -`)}a(n,"printChild");let o=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${n(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${t._totals.toFixed(2)}ms)`];(e>2||r)&&t.all.add(o.join(` -`))}};Che.Trace=_he});var rn=I(vhe=>{"use strict";p();Object.defineProperty(vhe,"__esModule",{value:!0});vhe.InstantiationServiceBuilder=vhe.createServiceIdentifier=void 0;var KKs=Qs();Object.defineProperty(vhe,"createServiceIdentifier",{enumerable:!0,get:a(function(){return KKs.createDecorator},"get")});var JKs=vti(),bti=upr(),hpr=class{static{a(this,"InstantiationServiceBuilder")}constructor(e){this._isSealed=!1,this._collection=Array.isArray(e)?new bti.ServiceCollection(...e):e??new bti.ServiceCollection}define(e,r){if(this._isSealed)throw new Error("This accessor is sealed and cannot be modified anymore.");this._collection.set(e,r)}seal(){if(this._isSealed)throw new Error("This accessor is sealed and cannot be seal again anymore.");return this._isSealed=!0,new JKs.InstantiationService(this._collection,!0)}};vhe.InstantiationServiceBuilder=hpr});var QDe=I(qw=>{"use strict";p();Object.defineProperty(qw,"__esModule",{value:!0});qw.NullLanguageContextService=qw.TriggerKind=qw.KnownSources=qw.ContextKind=qw.ILanguageContextService=void 0;var ZKs=rn();qw.ILanguageContextService=(0,ZKs.createServiceIdentifier)("ILanguageContextService");var Sti;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(Sti||(qw.ContextKind=Sti={}));var Tti;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(Tti||(qw.KnownSources=Tti={}));var Iti;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(Iti||(qw.TriggerKind=Iti={}));var mpr=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};qw.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new mpr,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var wti=I($ut=>{"use strict";p();Object.defineProperty($ut,"__esModule",{value:!0});$ut.serializeLanguageContext=eJs;$ut.serializeFileDiagnostics=oJs;var XKs=qp(),gpr=QDe();function eJs(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:tJs(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(eJs,"serializeLanguageContext");function tJs(t){switch(t.kind){case gpr.ContextKind.Snippet:return rJs(t);case gpr.ContextKind.Trait:return nJs(t);case gpr.ContextKind.DiagnosticBag:return iJs(t)}}a(tJs,"serializeLanguageContextItem");function rJs(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(rJs,"serializeSnippetContext");function nJs(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(nJs,"serializeTraitContext");function iJs(t){let e=t.values.map(r=>xti(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(iJs,"serializeDiagnosticBagContext");function xti(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new XKs.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(xti,"serializeDiagnostic");function oJs(t){return t.flatMap(([e,r])=>r.map(n=>xti(n,e)))}a(oJs,"serializeFileDiagnostics")});var ypr=I(Apr=>{"use strict";p();Object.defineProperty(Apr,"__esModule",{value:!0});Apr.stringifyChatMessages=sJs;var Vut=wo();function sJs(t){return t.map(aJs).join(` -`)}a(sJs,"stringifyChatMessages");function aJs({role:t,content:e}){if(t!==Vut.Raw.ChatRole.User&&t!==Vut.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===Vut.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==Vut.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} +`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Gut(e),n=mhe(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Gut(e),n=mhe(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Wti.Parser=vpr});var Zti=I(PDe=>{"use strict";p();var zti=cpr(),uKs=vDe(),RDe=SDe(),dKs=sfr(),fKs=Ya(),pKs=_pr(),Yti=Cpr();function Kti(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new pKs.LineCounter||null,prettyErrors:e}}a(Kti,"parseOptions");function hKs(t,e={}){let{lineCounter:r,prettyErrors:n}=Kti(e),o=new Yti.Parser(r?.addNewLine),s=new zti.Composer(e),c=Array.from(s.compose(o.parse(t)));if(n&&r)for(let l of c)l.errors.forEach(RDe.prettifyError(t,r)),l.warnings.forEach(RDe.prettifyError(t,r));return c.length>0?c:Object.assign([],{empty:!0},s.streamInfo())}a(hKs,"parseAllDocuments");function Jti(t,e={}){let{lineCounter:r,prettyErrors:n}=Kti(e),o=new Yti.Parser(r?.addNewLine),s=new zti.Composer(e),c=null;for(let l of s.compose(o.parse(t),!0,t.length))if(!c)c=l;else if(c.options.logLevel!=="silent"){c.errors.push(new RDe.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(c.errors.forEach(RDe.prettifyError(t,r)),c.warnings.forEach(RDe.prettifyError(t,r))),c}a(Jti,"parseDocument");function mKs(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let o=Jti(t,r);if(!o)return null;if(o.warnings.forEach(s=>dKs.warn(o.options.logLevel,s)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:n},r))}a(mKs,"parse");function gKs(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let o=Math.round(r);r=o<1?void 0:o>8?{indent:8}:{indent:o}}if(t===void 0){let{keepUndefined:o}=r??e??{};if(!o)return}return fKs.isDocument(t)&&!n?t.toString(r):new uKs.Document(t,n,r).toString(r)}a(gKs,"stringify");PDe.parse=mKs;PDe.parseAllDocuments=hKs;PDe.parseDocument=Jti;PDe.stringify=gKs});var eri=I(Fc=>{"use strict";p();var AKs=cpr(),yKs=vDe(),EKs=jfr(),bpr=SDe(),_Ks=iDe(),dH=Ya(),vKs=sH(),CKs=s0(),bKs=cH(),SKs=lH(),TKs=jut(),IKs=ypr(),xKs=_pr(),wKs=Cpr(),$ut=Zti(),Xti=eDe();Fc.Composer=AKs.Composer;Fc.Document=yKs.Document;Fc.Schema=EKs.Schema;Fc.YAMLError=bpr.YAMLError;Fc.YAMLParseError=bpr.YAMLParseError;Fc.YAMLWarning=bpr.YAMLWarning;Fc.Alias=_Ks.Alias;Fc.isAlias=dH.isAlias;Fc.isCollection=dH.isCollection;Fc.isDocument=dH.isDocument;Fc.isMap=dH.isMap;Fc.isNode=dH.isNode;Fc.isPair=dH.isPair;Fc.isScalar=dH.isScalar;Fc.isSeq=dH.isSeq;Fc.Pair=vKs.Pair;Fc.Scalar=CKs.Scalar;Fc.YAMLMap=bKs.YAMLMap;Fc.YAMLSeq=SKs.YAMLSeq;Fc.CST=TKs;Fc.Lexer=IKs.Lexer;Fc.LineCounter=xKs.LineCounter;Fc.Parser=wKs.Parser;Fc.parse=$ut.parse;Fc.parseAllDocuments=$ut.parseAllDocuments;Fc.parseDocument=$ut.parseDocument;Fc.stringify=$ut.stringify;Fc.visit=Xti.visit;Fc.visitAsync=Xti.visitAsync});var tri=I(Vut=>{"use strict";p();Object.defineProperty(Vut,"__esModule",{value:!0});Vut.FetchCancellationError=void 0;var RKs=bs(),Spr=class extends RKs.CancellationError{static{a(this,"FetchCancellationError")}constructor(e){super(),this.extraInformation=e}};Vut.FetchCancellationError=Spr});var kDe=I(Qw=>{"use strict";p();Object.defineProperty(Qw,"__esModule",{value:!0});Qw.NullLanguageContextService=Qw.TriggerKind=Qw.KnownSources=Qw.ContextKind=Qw.ILanguageContextService=void 0;var PKs=tn();Qw.ILanguageContextService=(0,PKs.createServiceIdentifier)("ILanguageContextService");var rri;(function(t){t.Snippet="snippet",t.Trait="trait",t.DiagnosticBag="diagnosticBag"})(rri||(Qw.ContextKind=rri={}));var nri;(function(t){t.unknown="unknown",t.sideCar="sideCar",t.completion="completion",t.populateCache="populateCache",t.nes="nes",t.chat="chat",t.fix="fix"})(nri||(Qw.KnownSources=nri={}));var iri;(function(t){t.unknown="unknown",t.selection="selection",t.completion="completion"})(iri||(Qw.TriggerKind=iri={}));var Tpr=class{static{a(this,"EmptyAsyncIterable")}async*[Symbol.asyncIterator](){}};Qw.NullLanguageContextService={_serviceBrand:void 0,isActivated:a(async()=>!1,"isActivated"),populateCache:a(async()=>{},"populateCache"),getContext:a(()=>new Tpr,"getContext"),getContextOnTimeout:a(()=>[],"getContextOnTimeout")}});var sri=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.serializeLanguageContext=DKs;Wut.serializeFileDiagnostics=LKs;var kKs=Gp(),Ipr=kDe();function DKs(t){return{start:t.start,end:t.end,items:t.items.map(e=>({context:NKs(e.context),timeStamp:e.timeStamp,onTimeout:e.onTimeout}))}}a(DKs,"serializeLanguageContext");function NKs(t){switch(t.kind){case Ipr.ContextKind.Snippet:return MKs(t);case Ipr.ContextKind.Trait:return OKs(t);case Ipr.ContextKind.DiagnosticBag:return BKs(t)}}a(NKs,"serializeLanguageContextItem");function MKs(t){return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),additionalUris:t.additionalUris?.map(e=>e.toString()),value:t.value}}a(MKs,"serializeSnippetContext");function OKs(t){return{kind:t.kind,priority:t.priority,name:t.name,value:t.value}}a(OKs,"serializeTraitContext");function BKs(t){let e=t.values.map(r=>ori(r));return{kind:t.kind,priority:t.priority,uri:t.uri.toString(),values:e}}a(BKs,"serializeDiagnosticBagContext");function ori(t,e){let r={severity:t.severity===0?"Error":t.severity===1?"Warning":t.severity===2?"Information":"Hint",message:t.message,source:t.source||"",code:t.code&&typeof t.code!="number"&&typeof t.code!="string"?t.code.value:t.code,range:new kKs.Range(t.range.start.line+1,t.range.start.character+1,t.range.end.line+1,t.range.end.character+1).toString()};return e&&(r.uri=e.toString()),r}a(ori,"serializeDiagnostic");function LKs(t){return t.flatMap(([e,r])=>r.map(n=>ori(n,e)))}a(LKs,"serializeFileDiagnostics")});var wpr=I(xpr=>{"use strict";p();Object.defineProperty(xpr,"__esModule",{value:!0});xpr.stringifyChatMessages=FKs;var zut=xo();function FKs(t){return t.map(UKs).join(` +`)}a(FKs,"stringifyChatMessages");function UKs({role:t,content:e}){if(t!==zut.Raw.ChatRole.User&&t!==zut.Raw.ChatRole.System)return"omitted because of non-user and non-system role";let r=t===zut.Raw.ChatRole.User?"User":"System",n=e.at(0);return n?.type!==zut.Raw.ChatCompletionContentPartKind.Text?"omitted because of non-text content":`${r} ------ ${n.text} -==================`}a(aJs,"stringifyMessage")});var _pr=I(Wut=>{"use strict";p();Object.defineProperty(Wut,"__esModule",{value:!0});Wut.register=lJs;Wut.getCodiconFontCharacters=uJs;var cJs=BS(),Epr=Object.create(null);function lJs(t,e){if((0,cJs.isString)(e)){let r=Epr[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return Epr[t]=e,{id:t}}a(lJs,"register");function uJs(){return Epr}a(uJs,"getCodiconFontCharacters")});var Rti=I(zut=>{"use strict";p();Object.defineProperty(zut,"__esModule",{value:!0});zut.codiconsLibrary=void 0;var $=_pr();zut.codiconsLibrary={add:(0,$.register)("add",6e4),plus:(0,$.register)("plus",6e4),gistNew:(0,$.register)("gist-new",6e4),repoCreate:(0,$.register)("repo-create",6e4),lightbulb:(0,$.register)("lightbulb",60001),lightBulb:(0,$.register)("light-bulb",60001),repo:(0,$.register)("repo",60002),repoDelete:(0,$.register)("repo-delete",60002),gistFork:(0,$.register)("gist-fork",60003),repoForked:(0,$.register)("repo-forked",60003),gitPullRequest:(0,$.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,$.register)("git-pull-request-abandoned",60004),recordKeys:(0,$.register)("record-keys",60005),keyboard:(0,$.register)("keyboard",60005),tag:(0,$.register)("tag",60006),gitPullRequestLabel:(0,$.register)("git-pull-request-label",60006),tagAdd:(0,$.register)("tag-add",60006),tagRemove:(0,$.register)("tag-remove",60006),person:(0,$.register)("person",60007),personFollow:(0,$.register)("person-follow",60007),personOutline:(0,$.register)("person-outline",60007),personFilled:(0,$.register)("person-filled",60007),sourceControl:(0,$.register)("source-control",60008),mirror:(0,$.register)("mirror",60009),mirrorPublic:(0,$.register)("mirror-public",60009),star:(0,$.register)("star",60010),starAdd:(0,$.register)("star-add",60010),starDelete:(0,$.register)("star-delete",60010),starEmpty:(0,$.register)("star-empty",60010),comment:(0,$.register)("comment",60011),commentAdd:(0,$.register)("comment-add",60011),alert:(0,$.register)("alert",60012),warning:(0,$.register)("warning",60012),search:(0,$.register)("search",60013),searchSave:(0,$.register)("search-save",60013),logOut:(0,$.register)("log-out",60014),signOut:(0,$.register)("sign-out",60014),logIn:(0,$.register)("log-in",60015),signIn:(0,$.register)("sign-in",60015),eye:(0,$.register)("eye",60016),eyeUnwatch:(0,$.register)("eye-unwatch",60016),eyeWatch:(0,$.register)("eye-watch",60016),circleFilled:(0,$.register)("circle-filled",60017),primitiveDot:(0,$.register)("primitive-dot",60017),closeDirty:(0,$.register)("close-dirty",60017),debugBreakpoint:(0,$.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,$.register)("debug-breakpoint-disabled",60017),debugHint:(0,$.register)("debug-hint",60017),terminalDecorationSuccess:(0,$.register)("terminal-decoration-success",60017),primitiveSquare:(0,$.register)("primitive-square",60018),edit:(0,$.register)("edit",60019),pencil:(0,$.register)("pencil",60019),info:(0,$.register)("info",60020),issueOpened:(0,$.register)("issue-opened",60020),gistPrivate:(0,$.register)("gist-private",60021),gitForkPrivate:(0,$.register)("git-fork-private",60021),lock:(0,$.register)("lock",60021),mirrorPrivate:(0,$.register)("mirror-private",60021),close:(0,$.register)("close",60022),removeClose:(0,$.register)("remove-close",60022),x:(0,$.register)("x",60022),repoSync:(0,$.register)("repo-sync",60023),sync:(0,$.register)("sync",60023),clone:(0,$.register)("clone",60024),desktopDownload:(0,$.register)("desktop-download",60024),beaker:(0,$.register)("beaker",60025),microscope:(0,$.register)("microscope",60025),vm:(0,$.register)("vm",60026),deviceDesktop:(0,$.register)("device-desktop",60026),file:(0,$.register)("file",60027),more:(0,$.register)("more",60028),ellipsis:(0,$.register)("ellipsis",60028),kebabHorizontal:(0,$.register)("kebab-horizontal",60028),mailReply:(0,$.register)("mail-reply",60029),reply:(0,$.register)("reply",60029),organization:(0,$.register)("organization",60030),organizationFilled:(0,$.register)("organization-filled",60030),organizationOutline:(0,$.register)("organization-outline",60030),newFile:(0,$.register)("new-file",60031),fileAdd:(0,$.register)("file-add",60031),newFolder:(0,$.register)("new-folder",60032),fileDirectoryCreate:(0,$.register)("file-directory-create",60032),trash:(0,$.register)("trash",60033),trashcan:(0,$.register)("trashcan",60033),history:(0,$.register)("history",60034),clock:(0,$.register)("clock",60034),folder:(0,$.register)("folder",60035),fileDirectory:(0,$.register)("file-directory",60035),symbolFolder:(0,$.register)("symbol-folder",60035),logoGithub:(0,$.register)("logo-github",60036),markGithub:(0,$.register)("mark-github",60036),github:(0,$.register)("github",60036),terminal:(0,$.register)("terminal",60037),console:(0,$.register)("console",60037),repl:(0,$.register)("repl",60037),zap:(0,$.register)("zap",60038),symbolEvent:(0,$.register)("symbol-event",60038),error:(0,$.register)("error",60039),stop:(0,$.register)("stop",60039),variable:(0,$.register)("variable",60040),symbolVariable:(0,$.register)("symbol-variable",60040),array:(0,$.register)("array",60042),symbolArray:(0,$.register)("symbol-array",60042),symbolModule:(0,$.register)("symbol-module",60043),symbolPackage:(0,$.register)("symbol-package",60043),symbolNamespace:(0,$.register)("symbol-namespace",60043),symbolObject:(0,$.register)("symbol-object",60043),symbolMethod:(0,$.register)("symbol-method",60044),symbolFunction:(0,$.register)("symbol-function",60044),symbolConstructor:(0,$.register)("symbol-constructor",60044),symbolBoolean:(0,$.register)("symbol-boolean",60047),symbolNull:(0,$.register)("symbol-null",60047),symbolNumeric:(0,$.register)("symbol-numeric",60048),symbolNumber:(0,$.register)("symbol-number",60048),symbolStructure:(0,$.register)("symbol-structure",60049),symbolStruct:(0,$.register)("symbol-struct",60049),symbolParameter:(0,$.register)("symbol-parameter",60050),symbolTypeParameter:(0,$.register)("symbol-type-parameter",60050),symbolKey:(0,$.register)("symbol-key",60051),symbolText:(0,$.register)("symbol-text",60051),symbolReference:(0,$.register)("symbol-reference",60052),goToFile:(0,$.register)("go-to-file",60052),symbolEnum:(0,$.register)("symbol-enum",60053),symbolValue:(0,$.register)("symbol-value",60053),symbolRuler:(0,$.register)("symbol-ruler",60054),symbolUnit:(0,$.register)("symbol-unit",60054),activateBreakpoints:(0,$.register)("activate-breakpoints",60055),archive:(0,$.register)("archive",60056),arrowBoth:(0,$.register)("arrow-both",60057),arrowDown:(0,$.register)("arrow-down",60058),arrowLeft:(0,$.register)("arrow-left",60059),arrowRight:(0,$.register)("arrow-right",60060),arrowSmallDown:(0,$.register)("arrow-small-down",60061),arrowSmallLeft:(0,$.register)("arrow-small-left",60062),arrowSmallRight:(0,$.register)("arrow-small-right",60063),arrowSmallUp:(0,$.register)("arrow-small-up",60064),arrowUp:(0,$.register)("arrow-up",60065),bell:(0,$.register)("bell",60066),bold:(0,$.register)("bold",60067),book:(0,$.register)("book",60068),bookmark:(0,$.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,$.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,$.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,$.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,$.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,$.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,$.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,$.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,$.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,$.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,$.register)("briefcase",60076),broadcast:(0,$.register)("broadcast",60077),browser:(0,$.register)("browser",60078),bug:(0,$.register)("bug",60079),calendar:(0,$.register)("calendar",60080),caseSensitive:(0,$.register)("case-sensitive",60081),check:(0,$.register)("check",60082),checklist:(0,$.register)("checklist",60083),chevronDown:(0,$.register)("chevron-down",60084),chevronLeft:(0,$.register)("chevron-left",60085),chevronRight:(0,$.register)("chevron-right",60086),chevronUp:(0,$.register)("chevron-up",60087),chromeClose:(0,$.register)("chrome-close",60088),chromeMaximize:(0,$.register)("chrome-maximize",60089),chromeMinimize:(0,$.register)("chrome-minimize",60090),chromeRestore:(0,$.register)("chrome-restore",60091),circleOutline:(0,$.register)("circle-outline",60092),circle:(0,$.register)("circle",60092),debugBreakpointUnverified:(0,$.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,$.register)("terminal-decoration-incomplete",60092),circleSlash:(0,$.register)("circle-slash",60093),circuitBoard:(0,$.register)("circuit-board",60094),clearAll:(0,$.register)("clear-all",60095),clippy:(0,$.register)("clippy",60096),closeAll:(0,$.register)("close-all",60097),cloudDownload:(0,$.register)("cloud-download",60098),cloudUpload:(0,$.register)("cloud-upload",60099),code:(0,$.register)("code",60100),collapseAll:(0,$.register)("collapse-all",60101),colorMode:(0,$.register)("color-mode",60102),commentDiscussion:(0,$.register)("comment-discussion",60103),creditCard:(0,$.register)("credit-card",60105),dash:(0,$.register)("dash",60108),dashboard:(0,$.register)("dashboard",60109),database:(0,$.register)("database",60110),debugContinue:(0,$.register)("debug-continue",60111),debugDisconnect:(0,$.register)("debug-disconnect",60112),debugPause:(0,$.register)("debug-pause",60113),debugRestart:(0,$.register)("debug-restart",60114),debugStart:(0,$.register)("debug-start",60115),debugStepInto:(0,$.register)("debug-step-into",60116),debugStepOut:(0,$.register)("debug-step-out",60117),debugStepOver:(0,$.register)("debug-step-over",60118),debugStop:(0,$.register)("debug-stop",60119),debug:(0,$.register)("debug",60120),deviceCameraVideo:(0,$.register)("device-camera-video",60121),deviceCamera:(0,$.register)("device-camera",60122),deviceMobile:(0,$.register)("device-mobile",60123),diffAdded:(0,$.register)("diff-added",60124),diffIgnored:(0,$.register)("diff-ignored",60125),diffModified:(0,$.register)("diff-modified",60126),diffRemoved:(0,$.register)("diff-removed",60127),diffRenamed:(0,$.register)("diff-renamed",60128),diff:(0,$.register)("diff",60129),diffSidebyside:(0,$.register)("diff-sidebyside",60129),discard:(0,$.register)("discard",60130),editorLayout:(0,$.register)("editor-layout",60131),emptyWindow:(0,$.register)("empty-window",60132),exclude:(0,$.register)("exclude",60133),extensions:(0,$.register)("extensions",60134),eyeClosed:(0,$.register)("eye-closed",60135),fileBinary:(0,$.register)("file-binary",60136),fileCode:(0,$.register)("file-code",60137),fileMedia:(0,$.register)("file-media",60138),filePdf:(0,$.register)("file-pdf",60139),fileSubmodule:(0,$.register)("file-submodule",60140),fileSymlinkDirectory:(0,$.register)("file-symlink-directory",60141),fileSymlinkFile:(0,$.register)("file-symlink-file",60142),fileZip:(0,$.register)("file-zip",60143),files:(0,$.register)("files",60144),filter:(0,$.register)("filter",60145),flame:(0,$.register)("flame",60146),foldDown:(0,$.register)("fold-down",60147),foldUp:(0,$.register)("fold-up",60148),fold:(0,$.register)("fold",60149),folderActive:(0,$.register)("folder-active",60150),folderOpened:(0,$.register)("folder-opened",60151),gear:(0,$.register)("gear",60152),gift:(0,$.register)("gift",60153),gistSecret:(0,$.register)("gist-secret",60154),gist:(0,$.register)("gist",60155),gitCommit:(0,$.register)("git-commit",60156),gitCompare:(0,$.register)("git-compare",60157),compareChanges:(0,$.register)("compare-changes",60157),gitMerge:(0,$.register)("git-merge",60158),githubAction:(0,$.register)("github-action",60159),githubAlt:(0,$.register)("github-alt",60160),globe:(0,$.register)("globe",60161),grabber:(0,$.register)("grabber",60162),graph:(0,$.register)("graph",60163),gripper:(0,$.register)("gripper",60164),heart:(0,$.register)("heart",60165),home:(0,$.register)("home",60166),horizontalRule:(0,$.register)("horizontal-rule",60167),hubot:(0,$.register)("hubot",60168),inbox:(0,$.register)("inbox",60169),issueReopened:(0,$.register)("issue-reopened",60171),issues:(0,$.register)("issues",60172),italic:(0,$.register)("italic",60173),jersey:(0,$.register)("jersey",60174),json:(0,$.register)("json",60175),bracket:(0,$.register)("bracket",60175),kebabVertical:(0,$.register)("kebab-vertical",60176),key:(0,$.register)("key",60177),law:(0,$.register)("law",60178),lightbulbAutofix:(0,$.register)("lightbulb-autofix",60179),linkExternal:(0,$.register)("link-external",60180),link:(0,$.register)("link",60181),listOrdered:(0,$.register)("list-ordered",60182),listUnordered:(0,$.register)("list-unordered",60183),liveShare:(0,$.register)("live-share",60184),loading:(0,$.register)("loading",60185),location:(0,$.register)("location",60186),mailRead:(0,$.register)("mail-read",60187),mail:(0,$.register)("mail",60188),markdown:(0,$.register)("markdown",60189),megaphone:(0,$.register)("megaphone",60190),mention:(0,$.register)("mention",60191),milestone:(0,$.register)("milestone",60192),gitPullRequestMilestone:(0,$.register)("git-pull-request-milestone",60192),mortarBoard:(0,$.register)("mortar-board",60193),move:(0,$.register)("move",60194),multipleWindows:(0,$.register)("multiple-windows",60195),mute:(0,$.register)("mute",60196),noNewline:(0,$.register)("no-newline",60197),note:(0,$.register)("note",60198),octoface:(0,$.register)("octoface",60199),openPreview:(0,$.register)("open-preview",60200),package:(0,$.register)("package",60201),paintcan:(0,$.register)("paintcan",60202),pin:(0,$.register)("pin",60203),play:(0,$.register)("play",60204),run:(0,$.register)("run",60204),plug:(0,$.register)("plug",60205),preserveCase:(0,$.register)("preserve-case",60206),preview:(0,$.register)("preview",60207),project:(0,$.register)("project",60208),pulse:(0,$.register)("pulse",60209),question:(0,$.register)("question",60210),quote:(0,$.register)("quote",60211),radioTower:(0,$.register)("radio-tower",60212),reactions:(0,$.register)("reactions",60213),references:(0,$.register)("references",60214),refresh:(0,$.register)("refresh",60215),regex:(0,$.register)("regex",60216),remoteExplorer:(0,$.register)("remote-explorer",60217),remote:(0,$.register)("remote",60218),remove:(0,$.register)("remove",60219),replaceAll:(0,$.register)("replace-all",60220),replace:(0,$.register)("replace",60221),repoClone:(0,$.register)("repo-clone",60222),repoForcePush:(0,$.register)("repo-force-push",60223),repoPull:(0,$.register)("repo-pull",60224),repoPush:(0,$.register)("repo-push",60225),report:(0,$.register)("report",60226),requestChanges:(0,$.register)("request-changes",60227),rocket:(0,$.register)("rocket",60228),rootFolderOpened:(0,$.register)("root-folder-opened",60229),rootFolder:(0,$.register)("root-folder",60230),rss:(0,$.register)("rss",60231),ruby:(0,$.register)("ruby",60232),saveAll:(0,$.register)("save-all",60233),saveAs:(0,$.register)("save-as",60234),save:(0,$.register)("save",60235),screenFull:(0,$.register)("screen-full",60236),screenNormal:(0,$.register)("screen-normal",60237),searchStop:(0,$.register)("search-stop",60238),server:(0,$.register)("server",60240),settingsGear:(0,$.register)("settings-gear",60241),settings:(0,$.register)("settings",60242),shield:(0,$.register)("shield",60243),smiley:(0,$.register)("smiley",60244),sortPrecedence:(0,$.register)("sort-precedence",60245),splitHorizontal:(0,$.register)("split-horizontal",60246),splitVertical:(0,$.register)("split-vertical",60247),squirrel:(0,$.register)("squirrel",60248),starFull:(0,$.register)("star-full",60249),starHalf:(0,$.register)("star-half",60250),symbolClass:(0,$.register)("symbol-class",60251),symbolColor:(0,$.register)("symbol-color",60252),symbolConstant:(0,$.register)("symbol-constant",60253),symbolEnumMember:(0,$.register)("symbol-enum-member",60254),symbolField:(0,$.register)("symbol-field",60255),symbolFile:(0,$.register)("symbol-file",60256),symbolInterface:(0,$.register)("symbol-interface",60257),symbolKeyword:(0,$.register)("symbol-keyword",60258),symbolMisc:(0,$.register)("symbol-misc",60259),symbolOperator:(0,$.register)("symbol-operator",60260),symbolProperty:(0,$.register)("symbol-property",60261),wrench:(0,$.register)("wrench",60261),wrenchSubaction:(0,$.register)("wrench-subaction",60261),symbolSnippet:(0,$.register)("symbol-snippet",60262),tasklist:(0,$.register)("tasklist",60263),telescope:(0,$.register)("telescope",60264),textSize:(0,$.register)("text-size",60265),threeBars:(0,$.register)("three-bars",60266),thumbsdown:(0,$.register)("thumbsdown",60267),thumbsup:(0,$.register)("thumbsup",60268),tools:(0,$.register)("tools",60269),triangleDown:(0,$.register)("triangle-down",60270),triangleLeft:(0,$.register)("triangle-left",60271),triangleRight:(0,$.register)("triangle-right",60272),triangleUp:(0,$.register)("triangle-up",60273),twitter:(0,$.register)("twitter",60274),unfold:(0,$.register)("unfold",60275),unlock:(0,$.register)("unlock",60276),unmute:(0,$.register)("unmute",60277),unverified:(0,$.register)("unverified",60278),verified:(0,$.register)("verified",60279),versions:(0,$.register)("versions",60280),vmActive:(0,$.register)("vm-active",60281),vmOutline:(0,$.register)("vm-outline",60282),vmRunning:(0,$.register)("vm-running",60283),watch:(0,$.register)("watch",60284),whitespace:(0,$.register)("whitespace",60285),wholeWord:(0,$.register)("whole-word",60286),window:(0,$.register)("window",60287),wordWrap:(0,$.register)("word-wrap",60288),zoomIn:(0,$.register)("zoom-in",60289),zoomOut:(0,$.register)("zoom-out",60290),listFilter:(0,$.register)("list-filter",60291),listFlat:(0,$.register)("list-flat",60292),listSelection:(0,$.register)("list-selection",60293),selection:(0,$.register)("selection",60293),listTree:(0,$.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,$.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,$.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,$.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,$.register)("debug-stackframe-active",60297),circleSmallFilled:(0,$.register)("circle-small-filled",60298),debugStackframeDot:(0,$.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,$.register)("terminal-decoration-mark",60298),debugStackframe:(0,$.register)("debug-stackframe",60299),debugStackframeFocused:(0,$.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,$.register)("debug-breakpoint-unsupported",60300),symbolString:(0,$.register)("symbol-string",60301),debugReverseContinue:(0,$.register)("debug-reverse-continue",60302),debugStepBack:(0,$.register)("debug-step-back",60303),debugRestartFrame:(0,$.register)("debug-restart-frame",60304),debugAlt:(0,$.register)("debug-alt",60305),callIncoming:(0,$.register)("call-incoming",60306),callOutgoing:(0,$.register)("call-outgoing",60307),menu:(0,$.register)("menu",60308),expandAll:(0,$.register)("expand-all",60309),feedback:(0,$.register)("feedback",60310),gitPullRequestReviewer:(0,$.register)("git-pull-request-reviewer",60310),groupByRefType:(0,$.register)("group-by-ref-type",60311),ungroupByRefType:(0,$.register)("ungroup-by-ref-type",60312),account:(0,$.register)("account",60313),gitPullRequestAssignee:(0,$.register)("git-pull-request-assignee",60313),bellDot:(0,$.register)("bell-dot",60314),debugConsole:(0,$.register)("debug-console",60315),library:(0,$.register)("library",60316),output:(0,$.register)("output",60317),runAll:(0,$.register)("run-all",60318),syncIgnored:(0,$.register)("sync-ignored",60319),pinned:(0,$.register)("pinned",60320),githubInverted:(0,$.register)("github-inverted",60321),serverProcess:(0,$.register)("server-process",60322),serverEnvironment:(0,$.register)("server-environment",60323),pass:(0,$.register)("pass",60324),issueClosed:(0,$.register)("issue-closed",60324),stopCircle:(0,$.register)("stop-circle",60325),playCircle:(0,$.register)("play-circle",60326),record:(0,$.register)("record",60327),debugAltSmall:(0,$.register)("debug-alt-small",60328),vmConnect:(0,$.register)("vm-connect",60329),cloud:(0,$.register)("cloud",60330),merge:(0,$.register)("merge",60331),export:(0,$.register)("export",60332),graphLeft:(0,$.register)("graph-left",60333),magnet:(0,$.register)("magnet",60334),notebook:(0,$.register)("notebook",60335),redo:(0,$.register)("redo",60336),checkAll:(0,$.register)("check-all",60337),pinnedDirty:(0,$.register)("pinned-dirty",60338),passFilled:(0,$.register)("pass-filled",60339),circleLargeFilled:(0,$.register)("circle-large-filled",60340),circleLarge:(0,$.register)("circle-large",60341),circleLargeOutline:(0,$.register)("circle-large-outline",60341),combine:(0,$.register)("combine",60342),gather:(0,$.register)("gather",60342),table:(0,$.register)("table",60343),variableGroup:(0,$.register)("variable-group",60344),typeHierarchy:(0,$.register)("type-hierarchy",60345),typeHierarchySub:(0,$.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,$.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,$.register)("git-pull-request-create",60348),runAbove:(0,$.register)("run-above",60349),runBelow:(0,$.register)("run-below",60350),notebookTemplate:(0,$.register)("notebook-template",60351),debugRerun:(0,$.register)("debug-rerun",60352),workspaceTrusted:(0,$.register)("workspace-trusted",60353),workspaceUntrusted:(0,$.register)("workspace-untrusted",60354),workspaceUnknown:(0,$.register)("workspace-unknown",60355),terminalCmd:(0,$.register)("terminal-cmd",60356),terminalDebian:(0,$.register)("terminal-debian",60357),terminalLinux:(0,$.register)("terminal-linux",60358),terminalPowershell:(0,$.register)("terminal-powershell",60359),terminalTmux:(0,$.register)("terminal-tmux",60360),terminalUbuntu:(0,$.register)("terminal-ubuntu",60361),terminalBash:(0,$.register)("terminal-bash",60362),arrowSwap:(0,$.register)("arrow-swap",60363),copy:(0,$.register)("copy",60364),personAdd:(0,$.register)("person-add",60365),filterFilled:(0,$.register)("filter-filled",60366),wand:(0,$.register)("wand",60367),debugLineByLine:(0,$.register)("debug-line-by-line",60368),inspect:(0,$.register)("inspect",60369),layers:(0,$.register)("layers",60370),layersDot:(0,$.register)("layers-dot",60371),layersActive:(0,$.register)("layers-active",60372),compass:(0,$.register)("compass",60373),compassDot:(0,$.register)("compass-dot",60374),compassActive:(0,$.register)("compass-active",60375),azure:(0,$.register)("azure",60376),issueDraft:(0,$.register)("issue-draft",60377),gitPullRequestClosed:(0,$.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,$.register)("git-pull-request-draft",60379),debugAll:(0,$.register)("debug-all",60380),debugCoverage:(0,$.register)("debug-coverage",60381),runErrors:(0,$.register)("run-errors",60382),folderLibrary:(0,$.register)("folder-library",60383),debugContinueSmall:(0,$.register)("debug-continue-small",60384),beakerStop:(0,$.register)("beaker-stop",60385),graphLine:(0,$.register)("graph-line",60386),graphScatter:(0,$.register)("graph-scatter",60387),pieChart:(0,$.register)("pie-chart",60388),bracketDot:(0,$.register)("bracket-dot",60389),bracketError:(0,$.register)("bracket-error",60390),lockSmall:(0,$.register)("lock-small",60391),azureDevops:(0,$.register)("azure-devops",60392),verifiedFilled:(0,$.register)("verified-filled",60393),newline:(0,$.register)("newline",60394),layout:(0,$.register)("layout",60395),layoutActivitybarLeft:(0,$.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,$.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,$.register)("layout-panel-left",60398),layoutPanelCenter:(0,$.register)("layout-panel-center",60399),layoutPanelJustify:(0,$.register)("layout-panel-justify",60400),layoutPanelRight:(0,$.register)("layout-panel-right",60401),layoutPanel:(0,$.register)("layout-panel",60402),layoutSidebarLeft:(0,$.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,$.register)("layout-sidebar-right",60404),layoutStatusbar:(0,$.register)("layout-statusbar",60405),layoutMenubar:(0,$.register)("layout-menubar",60406),layoutCentered:(0,$.register)("layout-centered",60407),target:(0,$.register)("target",60408),indent:(0,$.register)("indent",60409),recordSmall:(0,$.register)("record-small",60410),errorSmall:(0,$.register)("error-small",60411),terminalDecorationError:(0,$.register)("terminal-decoration-error",60411),arrowCircleDown:(0,$.register)("arrow-circle-down",60412),arrowCircleLeft:(0,$.register)("arrow-circle-left",60413),arrowCircleRight:(0,$.register)("arrow-circle-right",60414),arrowCircleUp:(0,$.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,$.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,$.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,$.register)("layout-sidebar-left-off",60418),blank:(0,$.register)("blank",60419),heartFilled:(0,$.register)("heart-filled",60420),map:(0,$.register)("map",60421),mapHorizontal:(0,$.register)("map-horizontal",60421),foldHorizontal:(0,$.register)("fold-horizontal",60421),mapFilled:(0,$.register)("map-filled",60422),mapHorizontalFilled:(0,$.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,$.register)("fold-horizontal-filled",60422),circleSmall:(0,$.register)("circle-small",60423),bellSlash:(0,$.register)("bell-slash",60424),bellSlashDot:(0,$.register)("bell-slash-dot",60425),commentUnresolved:(0,$.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,$.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,$.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,$.register)("search-fuzzy",60429),commentDraft:(0,$.register)("comment-draft",60430),send:(0,$.register)("send",60431),sparkle:(0,$.register)("sparkle",60432),insert:(0,$.register)("insert",60433),mic:(0,$.register)("mic",60434),thumbsdownFilled:(0,$.register)("thumbsdown-filled",60435),thumbsupFilled:(0,$.register)("thumbsup-filled",60436),coffee:(0,$.register)("coffee",60437),snake:(0,$.register)("snake",60438),game:(0,$.register)("game",60439),vr:(0,$.register)("vr",60440),chip:(0,$.register)("chip",60441),piano:(0,$.register)("piano",60442),music:(0,$.register)("music",60443),micFilled:(0,$.register)("mic-filled",60444),repoFetch:(0,$.register)("repo-fetch",60445),copilot:(0,$.register)("copilot",60446),lightbulbSparkle:(0,$.register)("lightbulb-sparkle",60447),robot:(0,$.register)("robot",60448),sparkleFilled:(0,$.register)("sparkle-filled",60449),diffSingle:(0,$.register)("diff-single",60450),diffMultiple:(0,$.register)("diff-multiple",60451),surroundWith:(0,$.register)("surround-with",60452),share:(0,$.register)("share",60453),gitStash:(0,$.register)("git-stash",60454),gitStashApply:(0,$.register)("git-stash-apply",60455),gitStashPop:(0,$.register)("git-stash-pop",60456),vscode:(0,$.register)("vscode",60457),vscodeInsiders:(0,$.register)("vscode-insiders",60458),codeOss:(0,$.register)("code-oss",60459),runCoverage:(0,$.register)("run-coverage",60460),runAllCoverage:(0,$.register)("run-all-coverage",60461),coverage:(0,$.register)("coverage",60462),githubProject:(0,$.register)("github-project",60463),mapVertical:(0,$.register)("map-vertical",60464),foldVertical:(0,$.register)("fold-vertical",60464),mapVerticalFilled:(0,$.register)("map-vertical-filled",60465),foldVerticalFilled:(0,$.register)("fold-vertical-filled",60465),goToSearch:(0,$.register)("go-to-search",60466),percentage:(0,$.register)("percentage",60467),sortPercentage:(0,$.register)("sort-percentage",60467),attach:(0,$.register)("attach",60468),goToEditingSession:(0,$.register)("go-to-editing-session",60469),editSession:(0,$.register)("edit-session",60470),codeReview:(0,$.register)("code-review",60471),copilotWarning:(0,$.register)("copilot-warning",60472),python:(0,$.register)("python",60473),copilotLarge:(0,$.register)("copilot-large",60474),copilotWarningLarge:(0,$.register)("copilot-warning-large",60475),keyboardTab:(0,$.register)("keyboard-tab",60476),copilotBlocked:(0,$.register)("copilot-blocked",60477),copilotNotConnected:(0,$.register)("copilot-not-connected",60478),flag:(0,$.register)("flag",60479),lightbulbEmpty:(0,$.register)("lightbulb-empty",60480),symbolMethodArrow:(0,$.register)("symbol-method-arrow",60481),copilotUnavailable:(0,$.register)("copilot-unavailable",60482),repoPinned:(0,$.register)("repo-pinned",60483),keyboardTabAbove:(0,$.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,$.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,$.register)("git-pull-request-done",60486),mcp:(0,$.register)("mcp",60487),extensionsLarge:(0,$.register)("extensions-large",60488),layoutPanelDock:(0,$.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,$.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,$.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,$.register)("copilot-in-progress",60492),copilotError:(0,$.register)("copilot-error",60493),copilotSuccess:(0,$.register)("copilot-success",60494),chatSparkle:(0,$.register)("chat-sparkle",60495),searchSparkle:(0,$.register)("search-sparkle",60496),editSparkle:(0,$.register)("edit-sparkle",60497),copilotSnooze:(0,$.register)("copilot-snooze",60498),sendToRemoteAgent:(0,$.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,$.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,$.register)("chat-sparkle-warning",60501),chatSparkleError:(0,$.register)("chat-sparkle-error",60502),collection:(0,$.register)("collection",60503),newCollection:(0,$.register)("new-collection",60504),thinking:(0,$.register)("thinking",60505),build:(0,$.register)("build",60506),commentDiscussionQuote:(0,$.register)("comment-discussion-quote",60507),cursor:(0,$.register)("cursor",60508),eraser:(0,$.register)("eraser",60509),fileText:(0,$.register)("file-text",60510),quotes:(0,$.register)("quotes",60512),rename:(0,$.register)("rename",60513),runWithDeps:(0,$.register)("run-with-deps",60514),debugConnected:(0,$.register)("debug-connected",60515),strikethrough:(0,$.register)("strikethrough",60516),openInProduct:(0,$.register)("open-in-product",60517),indexZero:(0,$.register)("index-zero",60518),agent:(0,$.register)("agent",60519),editCode:(0,$.register)("edit-code",60520),repoSelected:(0,$.register)("repo-selected",60521),skip:(0,$.register)("skip",60522),mergeInto:(0,$.register)("merge-into",60523),gitBranchChanges:(0,$.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,$.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,$.register)("git-branch-conflicts",60526),gitBranch:(0,$.register)("git-branch",60527),gitBranchCreate:(0,$.register)("git-branch-create",60527),gitBranchDelete:(0,$.register)("git-branch-delete",60527),searchLarge:(0,$.register)("search-large",60528),terminalGitBash:(0,$.register)("terminal-git-bash",60529),windowActive:(0,$.register)("window-active",60530),forward:(0,$.register)("forward",60531),download:(0,$.register)("download",60532),clockface:(0,$.register)("clockface",60533),unarchive:(0,$.register)("unarchive",60534),sessionInProgress:(0,$.register)("session-in-progress",60535),collectionSmall:(0,$.register)("collection-small",60536),vmSmall:(0,$.register)("vm-small",60537),cloudSmall:(0,$.register)("cloud-small",60538),addSmall:(0,$.register)("add-small",60539),removeSmall:(0,$.register)("remove-small",60540),worktreeSmall:(0,$.register)("worktree-small",60541),worktree:(0,$.register)("worktree",60542),screenCut:(0,$.register)("screen-cut",60543),ask:(0,$.register)("ask",60544),openai:(0,$.register)("openai",60545),claude:(0,$.register)("claude",60546),openInWindow:(0,$.register)("open-in-window",60547),newSession:(0,$.register)("new-session",60548),terminalSecure:(0,$.register)("terminal-secure",60549),chatImport:(0,$.register)("chat-import",60550),chatExport:(0,$.register)("chat-export",60551),shareWindow:(0,$.register)("share-window",60552)}});var Cpr=I(JF=>{"use strict";p();Object.defineProperty(JF,"__esModule",{value:!0});JF.Codicon=JF.codiconsDerived=void 0;JF.getAllCodicons=fJs;var jc=_pr(),dJs=Rti();function fJs(){return Object.values(JF.Codicon)}a(fJs,"getAllCodicons");JF.codiconsDerived={dialogError:(0,jc.register)("dialog-error","error"),dialogWarning:(0,jc.register)("dialog-warning","warning"),dialogInfo:(0,jc.register)("dialog-info","info"),dialogClose:(0,jc.register)("dialog-close","close"),treeItemExpanded:(0,jc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,jc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,jc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,jc.register)("tree-filter-clear","close"),treeItemLoading:(0,jc.register)("tree-item-loading","loading"),menuSelection:(0,jc.register)("menu-selection","check"),menuSubmenu:(0,jc.register)("menu-submenu","chevron-right"),menuBarMore:(0,jc.register)("menubar-more","more"),scrollbarButtonLeft:(0,jc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,jc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,jc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,jc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,jc.register)("toolbar-more","more"),quickInputBack:(0,jc.register)("quick-input-back","arrow-left"),dropDownButton:(0,jc.register)("drop-down-button",60084),symbolCustomColor:(0,jc.register)("symbol-customcolor",60252),exportIcon:(0,jc.register)("export",60332),workspaceUnspecified:(0,jc.register)("workspace-unspecified",60355),newLine:(0,jc.register)("newline",60394),thumbsDownFilled:(0,jc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,jc.register)("thumbsup-filled",60436),gitFetch:(0,jc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,jc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,jc.register)("debug-breakpoint-pending",60377),chatImport:(0,jc.register)("chat-import",60550),chatExport:(0,jc.register)("chat-export",60551)};JF.Codicon={...dJs.codiconsLibrary,...JF.codiconsDerived}});var Spr=I(CX=>{"use strict";p();Object.defineProperty(CX,"__esModule",{value:!0});CX.ThemeIcon=CX.ThemeColor=void 0;CX.themeColorFromId=pJs;var vpr=Cpr(),bpr;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(bpr||(CX.ThemeColor=bpr={}));function pJs(t){return{id:t}}a(pJs,"themeColorFromId");var kti;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r(vpr.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||bpr.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===vpr.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===vpr.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(kti||(CX.ThemeIcon=kti={}))});var qDe=I(EH=>{"use strict";p();Object.defineProperty(EH,"__esModule",{value:!0});EH.Icon=void 0;EH.overrideNowValue=hJs;EH.now=mJs;EH.shortenOpportunityId=gJs;EH.checkIfCursorAtEndOfLine=AJs;var ZF=Spr(),Tpr=-1;function hJs(t){Tpr=t}a(hJs,"overrideNowValue");function mJs(){return Tpr!==-1?Tpr:Date.now()}a(mJs,"now");var Pti;(function(t){t.circleSlash={themeIcon:ZF.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:ZF.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:ZF.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:ZF.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:ZF.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:ZF.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:ZF.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:ZF.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:ZF.ThemeIcon.fromId("thumbsdown"),svg:''}})(Pti||(EH.Icon=Pti={}));function gJs(t){return t.substring(4,8)}a(gJs,"shortenOpportunityId");function AJs(t,e){return t.substring(e).match(/^\s*$/)!==null}a(AJs,"checkIfCursorAtEndOfLine")});var Kut=I(j5=>{"use strict";p();var yJs=j5&&j5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),EJs=j5&&j5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_Js=j5&&j5.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Yut,"__esModule",{value:!0});Yut.register=qKs;Yut.getCodiconFontCharacters=jKs;var QKs=dS(),Rpr=Object.create(null);function qKs(t,e){if((0,QKs.isString)(e)){let r=Rpr[e];if(r===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=r}return Rpr[t]=e,{id:t}}a(qKs,"register");function jKs(){return Rpr}a(jKs,"getCodiconFontCharacters")});var ari=I(Kut=>{"use strict";p();Object.defineProperty(Kut,"__esModule",{value:!0});Kut.codiconsLibrary=void 0;var V=Ppr();Kut.codiconsLibrary={add:(0,V.register)("add",6e4),plus:(0,V.register)("plus",6e4),gistNew:(0,V.register)("gist-new",6e4),repoCreate:(0,V.register)("repo-create",6e4),lightbulb:(0,V.register)("lightbulb",60001),lightBulb:(0,V.register)("light-bulb",60001),repo:(0,V.register)("repo",60002),repoDelete:(0,V.register)("repo-delete",60002),gistFork:(0,V.register)("gist-fork",60003),repoForked:(0,V.register)("repo-forked",60003),gitPullRequest:(0,V.register)("git-pull-request",60004),gitPullRequestAbandoned:(0,V.register)("git-pull-request-abandoned",60004),recordKeys:(0,V.register)("record-keys",60005),keyboard:(0,V.register)("keyboard",60005),tag:(0,V.register)("tag",60006),gitPullRequestLabel:(0,V.register)("git-pull-request-label",60006),tagAdd:(0,V.register)("tag-add",60006),tagRemove:(0,V.register)("tag-remove",60006),person:(0,V.register)("person",60007),personFollow:(0,V.register)("person-follow",60007),personOutline:(0,V.register)("person-outline",60007),personFilled:(0,V.register)("person-filled",60007),sourceControl:(0,V.register)("source-control",60008),mirror:(0,V.register)("mirror",60009),mirrorPublic:(0,V.register)("mirror-public",60009),star:(0,V.register)("star",60010),starAdd:(0,V.register)("star-add",60010),starDelete:(0,V.register)("star-delete",60010),starEmpty:(0,V.register)("star-empty",60010),comment:(0,V.register)("comment",60011),commentAdd:(0,V.register)("comment-add",60011),alert:(0,V.register)("alert",60012),warning:(0,V.register)("warning",60012),search:(0,V.register)("search",60013),searchSave:(0,V.register)("search-save",60013),logOut:(0,V.register)("log-out",60014),signOut:(0,V.register)("sign-out",60014),logIn:(0,V.register)("log-in",60015),signIn:(0,V.register)("sign-in",60015),eye:(0,V.register)("eye",60016),eyeUnwatch:(0,V.register)("eye-unwatch",60016),eyeWatch:(0,V.register)("eye-watch",60016),circleFilled:(0,V.register)("circle-filled",60017),primitiveDot:(0,V.register)("primitive-dot",60017),closeDirty:(0,V.register)("close-dirty",60017),debugBreakpoint:(0,V.register)("debug-breakpoint",60017),debugBreakpointDisabled:(0,V.register)("debug-breakpoint-disabled",60017),debugHint:(0,V.register)("debug-hint",60017),terminalDecorationSuccess:(0,V.register)("terminal-decoration-success",60017),primitiveSquare:(0,V.register)("primitive-square",60018),edit:(0,V.register)("edit",60019),pencil:(0,V.register)("pencil",60019),info:(0,V.register)("info",60020),issueOpened:(0,V.register)("issue-opened",60020),gistPrivate:(0,V.register)("gist-private",60021),gitForkPrivate:(0,V.register)("git-fork-private",60021),lock:(0,V.register)("lock",60021),mirrorPrivate:(0,V.register)("mirror-private",60021),close:(0,V.register)("close",60022),removeClose:(0,V.register)("remove-close",60022),x:(0,V.register)("x",60022),repoSync:(0,V.register)("repo-sync",60023),sync:(0,V.register)("sync",60023),clone:(0,V.register)("clone",60024),desktopDownload:(0,V.register)("desktop-download",60024),beaker:(0,V.register)("beaker",60025),microscope:(0,V.register)("microscope",60025),vm:(0,V.register)("vm",60026),deviceDesktop:(0,V.register)("device-desktop",60026),file:(0,V.register)("file",60027),more:(0,V.register)("more",60028),ellipsis:(0,V.register)("ellipsis",60028),kebabHorizontal:(0,V.register)("kebab-horizontal",60028),mailReply:(0,V.register)("mail-reply",60029),reply:(0,V.register)("reply",60029),organization:(0,V.register)("organization",60030),organizationFilled:(0,V.register)("organization-filled",60030),organizationOutline:(0,V.register)("organization-outline",60030),newFile:(0,V.register)("new-file",60031),fileAdd:(0,V.register)("file-add",60031),newFolder:(0,V.register)("new-folder",60032),fileDirectoryCreate:(0,V.register)("file-directory-create",60032),trash:(0,V.register)("trash",60033),trashcan:(0,V.register)("trashcan",60033),history:(0,V.register)("history",60034),clock:(0,V.register)("clock",60034),folder:(0,V.register)("folder",60035),fileDirectory:(0,V.register)("file-directory",60035),symbolFolder:(0,V.register)("symbol-folder",60035),logoGithub:(0,V.register)("logo-github",60036),markGithub:(0,V.register)("mark-github",60036),github:(0,V.register)("github",60036),terminal:(0,V.register)("terminal",60037),console:(0,V.register)("console",60037),repl:(0,V.register)("repl",60037),zap:(0,V.register)("zap",60038),symbolEvent:(0,V.register)("symbol-event",60038),error:(0,V.register)("error",60039),stop:(0,V.register)("stop",60039),variable:(0,V.register)("variable",60040),symbolVariable:(0,V.register)("symbol-variable",60040),array:(0,V.register)("array",60042),symbolArray:(0,V.register)("symbol-array",60042),symbolModule:(0,V.register)("symbol-module",60043),symbolPackage:(0,V.register)("symbol-package",60043),symbolNamespace:(0,V.register)("symbol-namespace",60043),symbolObject:(0,V.register)("symbol-object",60043),symbolMethod:(0,V.register)("symbol-method",60044),symbolFunction:(0,V.register)("symbol-function",60044),symbolConstructor:(0,V.register)("symbol-constructor",60044),symbolBoolean:(0,V.register)("symbol-boolean",60047),symbolNull:(0,V.register)("symbol-null",60047),symbolNumeric:(0,V.register)("symbol-numeric",60048),symbolNumber:(0,V.register)("symbol-number",60048),symbolStructure:(0,V.register)("symbol-structure",60049),symbolStruct:(0,V.register)("symbol-struct",60049),symbolParameter:(0,V.register)("symbol-parameter",60050),symbolTypeParameter:(0,V.register)("symbol-type-parameter",60050),symbolKey:(0,V.register)("symbol-key",60051),symbolText:(0,V.register)("symbol-text",60051),symbolReference:(0,V.register)("symbol-reference",60052),goToFile:(0,V.register)("go-to-file",60052),symbolEnum:(0,V.register)("symbol-enum",60053),symbolValue:(0,V.register)("symbol-value",60053),symbolRuler:(0,V.register)("symbol-ruler",60054),symbolUnit:(0,V.register)("symbol-unit",60054),activateBreakpoints:(0,V.register)("activate-breakpoints",60055),archive:(0,V.register)("archive",60056),arrowBoth:(0,V.register)("arrow-both",60057),arrowDown:(0,V.register)("arrow-down",60058),arrowLeft:(0,V.register)("arrow-left",60059),arrowRight:(0,V.register)("arrow-right",60060),arrowSmallDown:(0,V.register)("arrow-small-down",60061),arrowSmallLeft:(0,V.register)("arrow-small-left",60062),arrowSmallRight:(0,V.register)("arrow-small-right",60063),arrowSmallUp:(0,V.register)("arrow-small-up",60064),arrowUp:(0,V.register)("arrow-up",60065),bell:(0,V.register)("bell",60066),bold:(0,V.register)("bold",60067),book:(0,V.register)("book",60068),bookmark:(0,V.register)("bookmark",60069),debugBreakpointConditionalUnverified:(0,V.register)("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:(0,V.register)("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:(0,V.register)("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:(0,V.register)("debug-breakpoint-data-unverified",60072),debugBreakpointData:(0,V.register)("debug-breakpoint-data",60073),debugBreakpointDataDisabled:(0,V.register)("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:(0,V.register)("debug-breakpoint-log-unverified",60074),debugBreakpointLog:(0,V.register)("debug-breakpoint-log",60075),debugBreakpointLogDisabled:(0,V.register)("debug-breakpoint-log-disabled",60075),briefcase:(0,V.register)("briefcase",60076),broadcast:(0,V.register)("broadcast",60077),browser:(0,V.register)("browser",60078),bug:(0,V.register)("bug",60079),calendar:(0,V.register)("calendar",60080),caseSensitive:(0,V.register)("case-sensitive",60081),check:(0,V.register)("check",60082),checklist:(0,V.register)("checklist",60083),chevronDown:(0,V.register)("chevron-down",60084),chevronLeft:(0,V.register)("chevron-left",60085),chevronRight:(0,V.register)("chevron-right",60086),chevronUp:(0,V.register)("chevron-up",60087),chromeClose:(0,V.register)("chrome-close",60088),chromeMaximize:(0,V.register)("chrome-maximize",60089),chromeMinimize:(0,V.register)("chrome-minimize",60090),chromeRestore:(0,V.register)("chrome-restore",60091),circleOutline:(0,V.register)("circle-outline",60092),circle:(0,V.register)("circle",60092),debugBreakpointUnverified:(0,V.register)("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:(0,V.register)("terminal-decoration-incomplete",60092),circleSlash:(0,V.register)("circle-slash",60093),circuitBoard:(0,V.register)("circuit-board",60094),clearAll:(0,V.register)("clear-all",60095),clippy:(0,V.register)("clippy",60096),closeAll:(0,V.register)("close-all",60097),cloudDownload:(0,V.register)("cloud-download",60098),cloudUpload:(0,V.register)("cloud-upload",60099),code:(0,V.register)("code",60100),collapseAll:(0,V.register)("collapse-all",60101),colorMode:(0,V.register)("color-mode",60102),commentDiscussion:(0,V.register)("comment-discussion",60103),creditCard:(0,V.register)("credit-card",60105),dash:(0,V.register)("dash",60108),dashboard:(0,V.register)("dashboard",60109),database:(0,V.register)("database",60110),debugContinue:(0,V.register)("debug-continue",60111),debugDisconnect:(0,V.register)("debug-disconnect",60112),debugPause:(0,V.register)("debug-pause",60113),debugRestart:(0,V.register)("debug-restart",60114),debugStart:(0,V.register)("debug-start",60115),debugStepInto:(0,V.register)("debug-step-into",60116),debugStepOut:(0,V.register)("debug-step-out",60117),debugStepOver:(0,V.register)("debug-step-over",60118),debugStop:(0,V.register)("debug-stop",60119),debug:(0,V.register)("debug",60120),deviceCameraVideo:(0,V.register)("device-camera-video",60121),deviceCamera:(0,V.register)("device-camera",60122),deviceMobile:(0,V.register)("device-mobile",60123),diffAdded:(0,V.register)("diff-added",60124),diffIgnored:(0,V.register)("diff-ignored",60125),diffModified:(0,V.register)("diff-modified",60126),diffRemoved:(0,V.register)("diff-removed",60127),diffRenamed:(0,V.register)("diff-renamed",60128),diff:(0,V.register)("diff",60129),diffSidebyside:(0,V.register)("diff-sidebyside",60129),discard:(0,V.register)("discard",60130),editorLayout:(0,V.register)("editor-layout",60131),emptyWindow:(0,V.register)("empty-window",60132),exclude:(0,V.register)("exclude",60133),extensions:(0,V.register)("extensions",60134),eyeClosed:(0,V.register)("eye-closed",60135),fileBinary:(0,V.register)("file-binary",60136),fileCode:(0,V.register)("file-code",60137),fileMedia:(0,V.register)("file-media",60138),filePdf:(0,V.register)("file-pdf",60139),fileSubmodule:(0,V.register)("file-submodule",60140),fileSymlinkDirectory:(0,V.register)("file-symlink-directory",60141),fileSymlinkFile:(0,V.register)("file-symlink-file",60142),fileZip:(0,V.register)("file-zip",60143),files:(0,V.register)("files",60144),filter:(0,V.register)("filter",60145),flame:(0,V.register)("flame",60146),foldDown:(0,V.register)("fold-down",60147),foldUp:(0,V.register)("fold-up",60148),fold:(0,V.register)("fold",60149),folderActive:(0,V.register)("folder-active",60150),folderOpened:(0,V.register)("folder-opened",60151),gear:(0,V.register)("gear",60152),gift:(0,V.register)("gift",60153),gistSecret:(0,V.register)("gist-secret",60154),gist:(0,V.register)("gist",60155),gitCommit:(0,V.register)("git-commit",60156),gitCompare:(0,V.register)("git-compare",60157),compareChanges:(0,V.register)("compare-changes",60157),gitMerge:(0,V.register)("git-merge",60158),githubAction:(0,V.register)("github-action",60159),githubAlt:(0,V.register)("github-alt",60160),globe:(0,V.register)("globe",60161),grabber:(0,V.register)("grabber",60162),graph:(0,V.register)("graph",60163),gripper:(0,V.register)("gripper",60164),heart:(0,V.register)("heart",60165),home:(0,V.register)("home",60166),horizontalRule:(0,V.register)("horizontal-rule",60167),hubot:(0,V.register)("hubot",60168),inbox:(0,V.register)("inbox",60169),issueReopened:(0,V.register)("issue-reopened",60171),issues:(0,V.register)("issues",60172),italic:(0,V.register)("italic",60173),jersey:(0,V.register)("jersey",60174),json:(0,V.register)("json",60175),bracket:(0,V.register)("bracket",60175),kebabVertical:(0,V.register)("kebab-vertical",60176),key:(0,V.register)("key",60177),law:(0,V.register)("law",60178),lightbulbAutofix:(0,V.register)("lightbulb-autofix",60179),linkExternal:(0,V.register)("link-external",60180),link:(0,V.register)("link",60181),listOrdered:(0,V.register)("list-ordered",60182),listUnordered:(0,V.register)("list-unordered",60183),liveShare:(0,V.register)("live-share",60184),loading:(0,V.register)("loading",60185),location:(0,V.register)("location",60186),mailRead:(0,V.register)("mail-read",60187),mail:(0,V.register)("mail",60188),markdown:(0,V.register)("markdown",60189),megaphone:(0,V.register)("megaphone",60190),mention:(0,V.register)("mention",60191),milestone:(0,V.register)("milestone",60192),gitPullRequestMilestone:(0,V.register)("git-pull-request-milestone",60192),mortarBoard:(0,V.register)("mortar-board",60193),move:(0,V.register)("move",60194),multipleWindows:(0,V.register)("multiple-windows",60195),mute:(0,V.register)("mute",60196),noNewline:(0,V.register)("no-newline",60197),note:(0,V.register)("note",60198),octoface:(0,V.register)("octoface",60199),openPreview:(0,V.register)("open-preview",60200),package:(0,V.register)("package",60201),paintcan:(0,V.register)("paintcan",60202),pin:(0,V.register)("pin",60203),play:(0,V.register)("play",60204),run:(0,V.register)("run",60204),plug:(0,V.register)("plug",60205),preserveCase:(0,V.register)("preserve-case",60206),preview:(0,V.register)("preview",60207),project:(0,V.register)("project",60208),pulse:(0,V.register)("pulse",60209),question:(0,V.register)("question",60210),quote:(0,V.register)("quote",60211),radioTower:(0,V.register)("radio-tower",60212),reactions:(0,V.register)("reactions",60213),references:(0,V.register)("references",60214),refresh:(0,V.register)("refresh",60215),regex:(0,V.register)("regex",60216),remoteExplorer:(0,V.register)("remote-explorer",60217),remote:(0,V.register)("remote",60218),remove:(0,V.register)("remove",60219),replaceAll:(0,V.register)("replace-all",60220),replace:(0,V.register)("replace",60221),repoClone:(0,V.register)("repo-clone",60222),repoForcePush:(0,V.register)("repo-force-push",60223),repoPull:(0,V.register)("repo-pull",60224),repoPush:(0,V.register)("repo-push",60225),report:(0,V.register)("report",60226),requestChanges:(0,V.register)("request-changes",60227),rocket:(0,V.register)("rocket",60228),rootFolderOpened:(0,V.register)("root-folder-opened",60229),rootFolder:(0,V.register)("root-folder",60230),rss:(0,V.register)("rss",60231),ruby:(0,V.register)("ruby",60232),saveAll:(0,V.register)("save-all",60233),saveAs:(0,V.register)("save-as",60234),save:(0,V.register)("save",60235),screenFull:(0,V.register)("screen-full",60236),screenNormal:(0,V.register)("screen-normal",60237),searchStop:(0,V.register)("search-stop",60238),server:(0,V.register)("server",60240),settingsGear:(0,V.register)("settings-gear",60241),settings:(0,V.register)("settings",60242),shield:(0,V.register)("shield",60243),smiley:(0,V.register)("smiley",60244),sortPrecedence:(0,V.register)("sort-precedence",60245),splitHorizontal:(0,V.register)("split-horizontal",60246),splitVertical:(0,V.register)("split-vertical",60247),squirrel:(0,V.register)("squirrel",60248),starFull:(0,V.register)("star-full",60249),starHalf:(0,V.register)("star-half",60250),symbolClass:(0,V.register)("symbol-class",60251),symbolColor:(0,V.register)("symbol-color",60252),symbolConstant:(0,V.register)("symbol-constant",60253),symbolEnumMember:(0,V.register)("symbol-enum-member",60254),symbolField:(0,V.register)("symbol-field",60255),symbolFile:(0,V.register)("symbol-file",60256),symbolInterface:(0,V.register)("symbol-interface",60257),symbolKeyword:(0,V.register)("symbol-keyword",60258),symbolMisc:(0,V.register)("symbol-misc",60259),symbolOperator:(0,V.register)("symbol-operator",60260),symbolProperty:(0,V.register)("symbol-property",60261),wrench:(0,V.register)("wrench",60261),wrenchSubaction:(0,V.register)("wrench-subaction",60261),symbolSnippet:(0,V.register)("symbol-snippet",60262),tasklist:(0,V.register)("tasklist",60263),telescope:(0,V.register)("telescope",60264),textSize:(0,V.register)("text-size",60265),threeBars:(0,V.register)("three-bars",60266),thumbsdown:(0,V.register)("thumbsdown",60267),thumbsup:(0,V.register)("thumbsup",60268),tools:(0,V.register)("tools",60269),triangleDown:(0,V.register)("triangle-down",60270),triangleLeft:(0,V.register)("triangle-left",60271),triangleRight:(0,V.register)("triangle-right",60272),triangleUp:(0,V.register)("triangle-up",60273),twitter:(0,V.register)("twitter",60274),unfold:(0,V.register)("unfold",60275),unlock:(0,V.register)("unlock",60276),unmute:(0,V.register)("unmute",60277),unverified:(0,V.register)("unverified",60278),verified:(0,V.register)("verified",60279),versions:(0,V.register)("versions",60280),vmActive:(0,V.register)("vm-active",60281),vmOutline:(0,V.register)("vm-outline",60282),vmRunning:(0,V.register)("vm-running",60283),watch:(0,V.register)("watch",60284),whitespace:(0,V.register)("whitespace",60285),wholeWord:(0,V.register)("whole-word",60286),window:(0,V.register)("window",60287),wordWrap:(0,V.register)("word-wrap",60288),zoomIn:(0,V.register)("zoom-in",60289),zoomOut:(0,V.register)("zoom-out",60290),listFilter:(0,V.register)("list-filter",60291),listFlat:(0,V.register)("list-flat",60292),listSelection:(0,V.register)("list-selection",60293),selection:(0,V.register)("selection",60293),listTree:(0,V.register)("list-tree",60294),debugBreakpointFunctionUnverified:(0,V.register)("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:(0,V.register)("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:(0,V.register)("debug-breakpoint-function-disabled",60296),debugStackframeActive:(0,V.register)("debug-stackframe-active",60297),circleSmallFilled:(0,V.register)("circle-small-filled",60298),debugStackframeDot:(0,V.register)("debug-stackframe-dot",60298),terminalDecorationMark:(0,V.register)("terminal-decoration-mark",60298),debugStackframe:(0,V.register)("debug-stackframe",60299),debugStackframeFocused:(0,V.register)("debug-stackframe-focused",60299),debugBreakpointUnsupported:(0,V.register)("debug-breakpoint-unsupported",60300),symbolString:(0,V.register)("symbol-string",60301),debugReverseContinue:(0,V.register)("debug-reverse-continue",60302),debugStepBack:(0,V.register)("debug-step-back",60303),debugRestartFrame:(0,V.register)("debug-restart-frame",60304),debugAlt:(0,V.register)("debug-alt",60305),callIncoming:(0,V.register)("call-incoming",60306),callOutgoing:(0,V.register)("call-outgoing",60307),menu:(0,V.register)("menu",60308),expandAll:(0,V.register)("expand-all",60309),feedback:(0,V.register)("feedback",60310),gitPullRequestReviewer:(0,V.register)("git-pull-request-reviewer",60310),groupByRefType:(0,V.register)("group-by-ref-type",60311),ungroupByRefType:(0,V.register)("ungroup-by-ref-type",60312),account:(0,V.register)("account",60313),gitPullRequestAssignee:(0,V.register)("git-pull-request-assignee",60313),bellDot:(0,V.register)("bell-dot",60314),debugConsole:(0,V.register)("debug-console",60315),library:(0,V.register)("library",60316),output:(0,V.register)("output",60317),runAll:(0,V.register)("run-all",60318),syncIgnored:(0,V.register)("sync-ignored",60319),pinned:(0,V.register)("pinned",60320),githubInverted:(0,V.register)("github-inverted",60321),serverProcess:(0,V.register)("server-process",60322),serverEnvironment:(0,V.register)("server-environment",60323),pass:(0,V.register)("pass",60324),issueClosed:(0,V.register)("issue-closed",60324),stopCircle:(0,V.register)("stop-circle",60325),playCircle:(0,V.register)("play-circle",60326),record:(0,V.register)("record",60327),debugAltSmall:(0,V.register)("debug-alt-small",60328),vmConnect:(0,V.register)("vm-connect",60329),cloud:(0,V.register)("cloud",60330),merge:(0,V.register)("merge",60331),export:(0,V.register)("export",60332),graphLeft:(0,V.register)("graph-left",60333),magnet:(0,V.register)("magnet",60334),notebook:(0,V.register)("notebook",60335),redo:(0,V.register)("redo",60336),checkAll:(0,V.register)("check-all",60337),pinnedDirty:(0,V.register)("pinned-dirty",60338),passFilled:(0,V.register)("pass-filled",60339),circleLargeFilled:(0,V.register)("circle-large-filled",60340),circleLarge:(0,V.register)("circle-large",60341),circleLargeOutline:(0,V.register)("circle-large-outline",60341),combine:(0,V.register)("combine",60342),gather:(0,V.register)("gather",60342),table:(0,V.register)("table",60343),variableGroup:(0,V.register)("variable-group",60344),typeHierarchy:(0,V.register)("type-hierarchy",60345),typeHierarchySub:(0,V.register)("type-hierarchy-sub",60346),typeHierarchySuper:(0,V.register)("type-hierarchy-super",60347),gitPullRequestCreate:(0,V.register)("git-pull-request-create",60348),runAbove:(0,V.register)("run-above",60349),runBelow:(0,V.register)("run-below",60350),notebookTemplate:(0,V.register)("notebook-template",60351),debugRerun:(0,V.register)("debug-rerun",60352),workspaceTrusted:(0,V.register)("workspace-trusted",60353),workspaceUntrusted:(0,V.register)("workspace-untrusted",60354),workspaceUnknown:(0,V.register)("workspace-unknown",60355),terminalCmd:(0,V.register)("terminal-cmd",60356),terminalDebian:(0,V.register)("terminal-debian",60357),terminalLinux:(0,V.register)("terminal-linux",60358),terminalPowershell:(0,V.register)("terminal-powershell",60359),terminalTmux:(0,V.register)("terminal-tmux",60360),terminalUbuntu:(0,V.register)("terminal-ubuntu",60361),terminalBash:(0,V.register)("terminal-bash",60362),arrowSwap:(0,V.register)("arrow-swap",60363),copy:(0,V.register)("copy",60364),personAdd:(0,V.register)("person-add",60365),filterFilled:(0,V.register)("filter-filled",60366),wand:(0,V.register)("wand",60367),debugLineByLine:(0,V.register)("debug-line-by-line",60368),inspect:(0,V.register)("inspect",60369),layers:(0,V.register)("layers",60370),layersDot:(0,V.register)("layers-dot",60371),layersActive:(0,V.register)("layers-active",60372),compass:(0,V.register)("compass",60373),compassDot:(0,V.register)("compass-dot",60374),compassActive:(0,V.register)("compass-active",60375),azure:(0,V.register)("azure",60376),issueDraft:(0,V.register)("issue-draft",60377),gitPullRequestClosed:(0,V.register)("git-pull-request-closed",60378),gitPullRequestDraft:(0,V.register)("git-pull-request-draft",60379),debugAll:(0,V.register)("debug-all",60380),debugCoverage:(0,V.register)("debug-coverage",60381),runErrors:(0,V.register)("run-errors",60382),folderLibrary:(0,V.register)("folder-library",60383),debugContinueSmall:(0,V.register)("debug-continue-small",60384),beakerStop:(0,V.register)("beaker-stop",60385),graphLine:(0,V.register)("graph-line",60386),graphScatter:(0,V.register)("graph-scatter",60387),pieChart:(0,V.register)("pie-chart",60388),bracketDot:(0,V.register)("bracket-dot",60389),bracketError:(0,V.register)("bracket-error",60390),lockSmall:(0,V.register)("lock-small",60391),azureDevops:(0,V.register)("azure-devops",60392),verifiedFilled:(0,V.register)("verified-filled",60393),newline:(0,V.register)("newline",60394),layout:(0,V.register)("layout",60395),layoutActivitybarLeft:(0,V.register)("layout-activitybar-left",60396),layoutActivitybarRight:(0,V.register)("layout-activitybar-right",60397),layoutPanelLeft:(0,V.register)("layout-panel-left",60398),layoutPanelCenter:(0,V.register)("layout-panel-center",60399),layoutPanelJustify:(0,V.register)("layout-panel-justify",60400),layoutPanelRight:(0,V.register)("layout-panel-right",60401),layoutPanel:(0,V.register)("layout-panel",60402),layoutSidebarLeft:(0,V.register)("layout-sidebar-left",60403),layoutSidebarRight:(0,V.register)("layout-sidebar-right",60404),layoutStatusbar:(0,V.register)("layout-statusbar",60405),layoutMenubar:(0,V.register)("layout-menubar",60406),layoutCentered:(0,V.register)("layout-centered",60407),target:(0,V.register)("target",60408),indent:(0,V.register)("indent",60409),recordSmall:(0,V.register)("record-small",60410),errorSmall:(0,V.register)("error-small",60411),terminalDecorationError:(0,V.register)("terminal-decoration-error",60411),arrowCircleDown:(0,V.register)("arrow-circle-down",60412),arrowCircleLeft:(0,V.register)("arrow-circle-left",60413),arrowCircleRight:(0,V.register)("arrow-circle-right",60414),arrowCircleUp:(0,V.register)("arrow-circle-up",60415),layoutSidebarRightOff:(0,V.register)("layout-sidebar-right-off",60416),layoutPanelOff:(0,V.register)("layout-panel-off",60417),layoutSidebarLeftOff:(0,V.register)("layout-sidebar-left-off",60418),blank:(0,V.register)("blank",60419),heartFilled:(0,V.register)("heart-filled",60420),map:(0,V.register)("map",60421),mapHorizontal:(0,V.register)("map-horizontal",60421),foldHorizontal:(0,V.register)("fold-horizontal",60421),mapFilled:(0,V.register)("map-filled",60422),mapHorizontalFilled:(0,V.register)("map-horizontal-filled",60422),foldHorizontalFilled:(0,V.register)("fold-horizontal-filled",60422),circleSmall:(0,V.register)("circle-small",60423),bellSlash:(0,V.register)("bell-slash",60424),bellSlashDot:(0,V.register)("bell-slash-dot",60425),commentUnresolved:(0,V.register)("comment-unresolved",60426),gitPullRequestGoToChanges:(0,V.register)("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:(0,V.register)("git-pull-request-new-changes",60428),searchFuzzy:(0,V.register)("search-fuzzy",60429),commentDraft:(0,V.register)("comment-draft",60430),send:(0,V.register)("send",60431),sparkle:(0,V.register)("sparkle",60432),insert:(0,V.register)("insert",60433),mic:(0,V.register)("mic",60434),thumbsdownFilled:(0,V.register)("thumbsdown-filled",60435),thumbsupFilled:(0,V.register)("thumbsup-filled",60436),coffee:(0,V.register)("coffee",60437),snake:(0,V.register)("snake",60438),game:(0,V.register)("game",60439),vr:(0,V.register)("vr",60440),chip:(0,V.register)("chip",60441),piano:(0,V.register)("piano",60442),music:(0,V.register)("music",60443),micFilled:(0,V.register)("mic-filled",60444),repoFetch:(0,V.register)("repo-fetch",60445),copilot:(0,V.register)("copilot",60446),lightbulbSparkle:(0,V.register)("lightbulb-sparkle",60447),robot:(0,V.register)("robot",60448),sparkleFilled:(0,V.register)("sparkle-filled",60449),diffSingle:(0,V.register)("diff-single",60450),diffMultiple:(0,V.register)("diff-multiple",60451),surroundWith:(0,V.register)("surround-with",60452),share:(0,V.register)("share",60453),gitStash:(0,V.register)("git-stash",60454),gitStashApply:(0,V.register)("git-stash-apply",60455),gitStashPop:(0,V.register)("git-stash-pop",60456),vscode:(0,V.register)("vscode",60457),vscodeInsiders:(0,V.register)("vscode-insiders",60458),codeOss:(0,V.register)("code-oss",60459),runCoverage:(0,V.register)("run-coverage",60460),runAllCoverage:(0,V.register)("run-all-coverage",60461),coverage:(0,V.register)("coverage",60462),githubProject:(0,V.register)("github-project",60463),mapVertical:(0,V.register)("map-vertical",60464),foldVertical:(0,V.register)("fold-vertical",60464),mapVerticalFilled:(0,V.register)("map-vertical-filled",60465),foldVerticalFilled:(0,V.register)("fold-vertical-filled",60465),goToSearch:(0,V.register)("go-to-search",60466),percentage:(0,V.register)("percentage",60467),sortPercentage:(0,V.register)("sort-percentage",60467),attach:(0,V.register)("attach",60468),goToEditingSession:(0,V.register)("go-to-editing-session",60469),editSession:(0,V.register)("edit-session",60470),codeReview:(0,V.register)("code-review",60471),copilotWarning:(0,V.register)("copilot-warning",60472),python:(0,V.register)("python",60473),copilotLarge:(0,V.register)("copilot-large",60474),copilotWarningLarge:(0,V.register)("copilot-warning-large",60475),keyboardTab:(0,V.register)("keyboard-tab",60476),copilotBlocked:(0,V.register)("copilot-blocked",60477),copilotNotConnected:(0,V.register)("copilot-not-connected",60478),flag:(0,V.register)("flag",60479),lightbulbEmpty:(0,V.register)("lightbulb-empty",60480),symbolMethodArrow:(0,V.register)("symbol-method-arrow",60481),copilotUnavailable:(0,V.register)("copilot-unavailable",60482),repoPinned:(0,V.register)("repo-pinned",60483),keyboardTabAbove:(0,V.register)("keyboard-tab-above",60484),keyboardTabBelow:(0,V.register)("keyboard-tab-below",60485),gitPullRequestDone:(0,V.register)("git-pull-request-done",60486),mcp:(0,V.register)("mcp",60487),extensionsLarge:(0,V.register)("extensions-large",60488),layoutPanelDock:(0,V.register)("layout-panel-dock",60489),layoutSidebarLeftDock:(0,V.register)("layout-sidebar-left-dock",60490),layoutSidebarRightDock:(0,V.register)("layout-sidebar-right-dock",60491),copilotInProgress:(0,V.register)("copilot-in-progress",60492),copilotError:(0,V.register)("copilot-error",60493),copilotSuccess:(0,V.register)("copilot-success",60494),chatSparkle:(0,V.register)("chat-sparkle",60495),searchSparkle:(0,V.register)("search-sparkle",60496),editSparkle:(0,V.register)("edit-sparkle",60497),copilotSnooze:(0,V.register)("copilot-snooze",60498),sendToRemoteAgent:(0,V.register)("send-to-remote-agent",60499),commentDiscussionSparkle:(0,V.register)("comment-discussion-sparkle",60500),chatSparkleWarning:(0,V.register)("chat-sparkle-warning",60501),chatSparkleError:(0,V.register)("chat-sparkle-error",60502),collection:(0,V.register)("collection",60503),newCollection:(0,V.register)("new-collection",60504),thinking:(0,V.register)("thinking",60505),build:(0,V.register)("build",60506),commentDiscussionQuote:(0,V.register)("comment-discussion-quote",60507),cursor:(0,V.register)("cursor",60508),eraser:(0,V.register)("eraser",60509),fileText:(0,V.register)("file-text",60510),quotes:(0,V.register)("quotes",60512),rename:(0,V.register)("rename",60513),runWithDeps:(0,V.register)("run-with-deps",60514),debugConnected:(0,V.register)("debug-connected",60515),strikethrough:(0,V.register)("strikethrough",60516),openInProduct:(0,V.register)("open-in-product",60517),indexZero:(0,V.register)("index-zero",60518),agent:(0,V.register)("agent",60519),editCode:(0,V.register)("edit-code",60520),repoSelected:(0,V.register)("repo-selected",60521),skip:(0,V.register)("skip",60522),mergeInto:(0,V.register)("merge-into",60523),gitBranchChanges:(0,V.register)("git-branch-changes",60524),gitBranchStagedChanges:(0,V.register)("git-branch-staged-changes",60525),gitBranchConflicts:(0,V.register)("git-branch-conflicts",60526),gitBranch:(0,V.register)("git-branch",60527),gitBranchCreate:(0,V.register)("git-branch-create",60527),gitBranchDelete:(0,V.register)("git-branch-delete",60527),searchLarge:(0,V.register)("search-large",60528),terminalGitBash:(0,V.register)("terminal-git-bash",60529),windowActive:(0,V.register)("window-active",60530),forward:(0,V.register)("forward",60531),download:(0,V.register)("download",60532),clockface:(0,V.register)("clockface",60533),unarchive:(0,V.register)("unarchive",60534),sessionInProgress:(0,V.register)("session-in-progress",60535),collectionSmall:(0,V.register)("collection-small",60536),vmSmall:(0,V.register)("vm-small",60537),cloudSmall:(0,V.register)("cloud-small",60538),addSmall:(0,V.register)("add-small",60539),removeSmall:(0,V.register)("remove-small",60540),worktreeSmall:(0,V.register)("worktree-small",60541),worktree:(0,V.register)("worktree",60542),screenCut:(0,V.register)("screen-cut",60543),ask:(0,V.register)("ask",60544),openai:(0,V.register)("openai",60545),claude:(0,V.register)("claude",60546),openInWindow:(0,V.register)("open-in-window",60547),newSession:(0,V.register)("new-session",60548),terminalSecure:(0,V.register)("terminal-secure",60549),chatImport:(0,V.register)("chat-import",60550),chatExport:(0,V.register)("chat-export",60551),shareWindow:(0,V.register)("share-window",60552)}});var kpr=I(HF=>{"use strict";p();Object.defineProperty(HF,"__esModule",{value:!0});HF.Codicon=HF.codiconsDerived=void 0;HF.getAllCodicons=GKs;var Uc=Ppr(),HKs=ari();function GKs(){return Object.values(HF.Codicon)}a(GKs,"getAllCodicons");HF.codiconsDerived={dialogError:(0,Uc.register)("dialog-error","error"),dialogWarning:(0,Uc.register)("dialog-warning","warning"),dialogInfo:(0,Uc.register)("dialog-info","info"),dialogClose:(0,Uc.register)("dialog-close","close"),treeItemExpanded:(0,Uc.register)("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:(0,Uc.register)("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:(0,Uc.register)("tree-filter-on-type-off","list-selection"),treeFilterClear:(0,Uc.register)("tree-filter-clear","close"),treeItemLoading:(0,Uc.register)("tree-item-loading","loading"),menuSelection:(0,Uc.register)("menu-selection","check"),menuSubmenu:(0,Uc.register)("menu-submenu","chevron-right"),menuBarMore:(0,Uc.register)("menubar-more","more"),scrollbarButtonLeft:(0,Uc.register)("scrollbar-button-left","triangle-left"),scrollbarButtonRight:(0,Uc.register)("scrollbar-button-right","triangle-right"),scrollbarButtonUp:(0,Uc.register)("scrollbar-button-up","triangle-up"),scrollbarButtonDown:(0,Uc.register)("scrollbar-button-down","triangle-down"),toolBarMore:(0,Uc.register)("toolbar-more","more"),quickInputBack:(0,Uc.register)("quick-input-back","arrow-left"),dropDownButton:(0,Uc.register)("drop-down-button",60084),symbolCustomColor:(0,Uc.register)("symbol-customcolor",60252),exportIcon:(0,Uc.register)("export",60332),workspaceUnspecified:(0,Uc.register)("workspace-unspecified",60355),newLine:(0,Uc.register)("newline",60394),thumbsDownFilled:(0,Uc.register)("thumbsdown-filled",60435),thumbsUpFilled:(0,Uc.register)("thumbsup-filled",60436),gitFetch:(0,Uc.register)("git-fetch",60445),lightbulbSparkleAutofix:(0,Uc.register)("lightbulb-sparkle-autofix",60447),debugBreakpointPending:(0,Uc.register)("debug-breakpoint-pending",60377),chatImport:(0,Uc.register)("chat-import",60550),chatExport:(0,Uc.register)("chat-export",60551)};HF.Codicon={...HKs.codiconsLibrary,...HF.codiconsDerived}});var Mpr=I(AX=>{"use strict";p();Object.defineProperty(AX,"__esModule",{value:!0});AX.ThemeIcon=AX.ThemeColor=void 0;AX.themeColorFromId=$Ks;var Dpr=kpr(),Npr;(function(t){function e(r){return!!r&&typeof r=="object"&&typeof r.id=="string"}a(e,"isThemeColor"),t.isThemeColor=e})(Npr||(AX.ThemeColor=Npr={}));function $Ks(t){return{id:t}}a($Ks,"themeColorFromId");var cri;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";let e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function r(A){let y=e.exec(A.id);if(!y)return r(Dpr.Codicon.error);let[,E,_]=y,v=["codicon","codicon-"+E];return _&&v.push("codicon-modifier-"+_.substring(1)),v}a(r,"asClassNameArray"),t.asClassNameArray=r;function n(A){return r(A).join(" ")}a(n,"asClassName"),t.asClassName=n;function o(A){return"."+r(A).join(".")}a(o,"asCSSSelector"),t.asCSSSelector=o;function s(A){return!!A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color>"u"||Npr.isThemeColor(A.color))}a(s,"isThemeIcon"),t.isThemeIcon=s;let c=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function l(A){let y=c.exec(A);if(!y)return;let[,E]=y;return{id:E}}a(l,"fromString"),t.fromString=l;function u(A){return{id:A}}a(u,"fromId"),t.fromId=u;function d(A,y){let E=A.id,_=E.lastIndexOf("~");return _!==-1&&(E=E.substring(0,_)),y&&(E=`${E}~${y}`),{id:E}}a(d,"modify"),t.modify=d;function f(A){let y=A.id.lastIndexOf("~");if(y!==-1)return A.id.substring(y+1)}a(f,"getModifier"),t.getModifier=f;function h(A,y){return A.id===y.id&&A.color?.id===y.color?.id}a(h,"isEqual"),t.isEqual=h;function m(A){return A?.id===Dpr.Codicon.file.id}a(m,"isFile"),t.isFile=m;function g(A){return A?.id===Dpr.Codicon.folder.id}a(g,"isFolder"),t.isFolder=g})(cri||(AX.ThemeIcon=cri={}))});var DDe=I(fH=>{"use strict";p();Object.defineProperty(fH,"__esModule",{value:!0});fH.Icon=void 0;fH.overrideNowValue=VKs;fH.now=WKs;fH.shortenOpportunityId=zKs;fH.checkIfCursorAtEndOfLine=YKs;var GF=Mpr(),Opr=-1;function VKs(t){Opr=t}a(VKs,"overrideNowValue");function WKs(){return Opr!==-1?Opr:Date.now()}a(WKs,"now");var lri;(function(t){t.circleSlash={themeIcon:GF.ThemeIcon.fromId("circle-slash"),svg:''},t.error={themeIcon:GF.ThemeIcon.fromId("error"),svg:''},t.skipped={themeIcon:GF.ThemeIcon.fromId("testing-skipped-icon"),svg:''},t.lightbulbFull={themeIcon:GF.ThemeIcon.fromId("refactor-preview-view-icon"),svg:''},t.database={themeIcon:GF.ThemeIcon.fromId("database"),svg:''},t.gitMerge={themeIcon:GF.ThemeIcon.fromId("git-merge"),svg:''},t.loading={themeIcon:GF.ThemeIcon.fromId("loading~spin"),svg:''},t.check={themeIcon:GF.ThemeIcon.fromId("check"),svg:''},t.thumbsdown={themeIcon:GF.ThemeIcon.fromId("thumbsdown"),svg:''}})(lri||(fH.Icon=lri={}));function zKs(t){return t.substring(4,8)}a(zKs,"shortenOpportunityId");function YKs(t,e){return t.substring(e).match(/^\s*$/)!==null}a(YKs,"checkIfCursorAtEndOfLine")});var Zut=I(L5=>{"use strict";p();var KKs=L5&&L5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JKs=L5&&L5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZKs=L5&&L5.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oExplanation for icons -`),e.push(`- ${AE.Icon.lightbulbFull.svg} - model had suggestions -`),e.push(`- ${AE.Icon.circleSlash.svg} - model had NO suggestions -`),e.push(`- ${AE.Icon.database.svg} - response is from cache -`),e.push(`- ${AE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) -`),e.push(`- ${AE.Icon.error.svg} - error happened -`),e.push(`- ${AE.Icon.skipped.svg} - fetching started but got cancelled +`),e.push(`- ${mE.Icon.lightbulbFull.svg} - model had suggestions +`),e.push(`- ${mE.Icon.circleSlash.svg} - model had NO suggestions +`),e.push(`- ${mE.Icon.database.svg} - response is from cache +`),e.push(`- ${mE.Icon.gitMerge.svg} - joined an in-flight request (async or speculative reuse) +`),e.push(`- ${mE.Icon.error.svg} - error happened +`),e.push(`- ${mE.Icon.skipped.svg} - fetching started but got cancelled `),e.push(` `),e.push(`Inline Edit Provider: ${this._statelessNextEditProviderId??""} `),e.push("Chat Endpoint"),e.push("```"),e.push(`Model name: ${this._endpointInfo?.modelName??""}`),e.push(`URL: ${this._endpointInfo?.url??""}`),e.push("```");let r=this._logContextOfCachedEdit?`(cached #${this._logContextOfCachedEdit.requestId})`:"(not cached)";if(e.push(`Opportunity ID: ${this._context?this._context.requestUuid:""}`),this.headerRequestId&&(e.push(""),e.push(`Header Request ID: ${this.headerRequestId} ${r}`)),this._nextEditRequest&&(e.push(`## Latest user edits ${r}`),e.push(`
Edit @@ -542,11 +502,11 @@ ${n.text} `);let n=this.prompt;e.push("````"),e.push(...n.split(` `)),e.push("````"),e.push(`
-`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(Yut.ErrorUtils.toString(Yut.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view +`)}return this.error&&(e.push(`## Error ${r}`),e.push("```"),e.push(Jut.ErrorUtils.toString(Jut.ErrorUtils.fromUnknown(this.error))),e.push("```")),this.response&&(e.push(`## Response ${r}`),e.push(`
Click to view `),e.push("````"),e.push(this.response),e.push("````"),e.push(`
`)),this._responseResults&&(e.push(`## Response Results ${r}`),e.push(`
Click to view -`),e.push("```"),e.push(Dti.stringify(this._responseResults,null," ")),e.push("```"),e.push(` +`),e.push("```"),e.push(uri.stringify(this._responseResults,null," ")),e.push("```"),e.push(`
`)),this._isAccepted!==void 0&&e.push(`## Accepted : ${this._isAccepted?"Yes":"No"}`),this._rebaseFailure&&(e.push("## Rebase Failure"),e.push(`
Click to view `),e.push(this._rebaseFailure.toMarkdown()),e.push(` @@ -558,8 +518,8 @@ ${n.text} `),e.push("```"),e.push(...this._trace),e.push("```"),e.push(`
`)),e.join(` -`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(Yut.ErrorUtils.toString(Yut.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` -`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,TJs.stringifyChatMessages)(e)),this.fireDidChange()}_setOutcome(e){this._outcome!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?AE.Icon.check:AE.Icon.loading;case"succeeded":return AE.Icon.lightbulbFull;case"noSuggestions":return AE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return AE.Icon.database;case"reusedInFlight":return AE.Icon.gitMerge;case"skipped":case"cancelled":return AE.Icon.skipped;case"errored":return AE.Icon.error;case"previouslyRejected":return AE.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof bJs.FetchCancellationError?this._setOutcome("skipped"):(0,CJs.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${IJs(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram +`)}toMinimalLog(){let e=[];return this._nesTypePicked==="diagnostics"&&this._diagnosticsResultEdit?(e.push("## Result (Diagnostics):"),e.push("``` patch"),e.push(this._diagnosticsResultEdit.toString()),e.push("```")):this._nesTypePicked==="llm"&&this._resultEdit?(e.push("## Result:"),e.push("``` patch"),typeof this._resultEdit=="string"?e.push(this._resultEdit):e.push(this._resultEdit.toString()),e.push("```")):e.push("## Result: "),this.error&&(e.push("## Error:"),e.push("```"),e.push(Jut.ErrorUtils.toString(Jut.ErrorUtils.fromUnknown(this.error))),e.push("```")),e.push("### Info:"),e.push(`**From cache:** ${this._logContextOfCachedEdit?`YES (Request: ${this._logContextOfCachedEdit.requestId})`:"NO"}`),this._context&&(e.push(`**Trigger Kind:** ${this._context.triggerKind===0?"Manual":"Automatic"}`),e.push(`**Request UUID:** ${this._context.requestUuid}`)),e.join(` +`)}setStatelessNextEditProviderId(e){this._statelessNextEditProviderId=e}setRequestInput(e){this._isVisible=!0,this._nextEditRequest=e,this.fireDidChange()}setResult(e){this._isVisible=!0,this._resultEdit=e,this.fireDidChange()}setDiagnosticsResult(e){this._isVisible=!0,this._diagnosticsResultEdit=e,this.fireDidChange()}setPickedNESType(e){return this._nesTypePicked=e,this}setIsCachedResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="cached",this.fireDidChange()}setIsReusedInFlightResult(e){this._logContextOfCachedEdit=e,this.recordingBookmark=e.recordingBookmark,this._nextEditRequest=e._nextEditRequest??this._nextEditRequest,this._resultEdit=e._resultEdit??this._resultEdit,this._diagnosticsResultEdit=e._diagnosticsResultEdit??this._diagnosticsResultEdit,this._endpointInfo=e._endpointInfo??this._endpointInfo,this._headerRequestId=e._headerRequestId??this._headerRequestId,e._prompt&&(this._prompt=e._prompt),this.response=e.response??this.response,this._responseResults=e._responseResults??this._responseResults,e.fullResponsePromise&&this.setFullResponse(e.fullResponsePromise),this._error=e._error??this._error,this._isVisible=!0,this._outcome="reusedInFlight",this.fireDidChange()}setEndpointInfo(e,r){this._endpointInfo={url:e,modelName:r},this.fireDidChange()}get endpointInfo(){return this._endpointInfo}setHeaderRequestId(e){this._headerRequestId=e,this.fireDidChange()}get headerRequestId(){return this._headerRequestId}get prompt(){return this._prompt}get rawMessages(){return this._rawMessages}setPrompt(e){this._isVisible=!0,typeof e=="string"?this._prompt=e:(this._rawMessages=e,this._prompt=(0,nJs.stringifyChatMessages)(e)),this.fireDidChange()}_setOutcome(e){this._outcome!=="pending"&&this._outcome!=="reusedInFlight"&&console.warn(`[InlineEditRequestLogContext] outcome transition from '${this._outcome}' to '${e}' (request #${this.requestId})`),this._outcome=e}_resolveIcon(){switch(this._outcome){case"pending":return this._isCompleted?mE.Icon.check:mE.Icon.loading;case"succeeded":return mE.Icon.lightbulbFull;case"noSuggestions":return mE.Icon.circleSlash;case"cached":case"cachedFromGhostText":return mE.Icon.database;case"reusedInFlight":return mE.Icon.gitMerge;case"skipped":case"cancelled":return mE.Icon.skipped;case"errored":return mE.Icon.error;case"previouslyRejected":return mE.Icon.thumbsdown}}getIcon(){return this._resolveIcon().themeIcon}setIsSkipped(){this._setOutcome("skipped"),this._isVisible=!1,this.fireDidChange()}markAsFromCache(){this._setOutcome("cachedFromGhostText"),this._isVisible=!0,this.fireDidChange()}markAsNoSuggestions(){this._setOutcome("noSuggestions"),this._isVisible=!0,this.fireDidChange()}markAsPreviouslyRejected(){this._outcome="previouslyRejected",this._isVisible=!0,this.fireDidChange()}get error(){return this._error}setError(e){this._isVisible=!0,this._error=e,this._error instanceof tJs.FetchCancellationError?this._setOutcome("skipped"):(0,XKs.isCancellationError)(this._error)?(this._setOutcome("cancelled"),this._isVisible=!1):this._setOutcome("errored"),this.fireDidChange()}setResponse(e){this._isVisible=!0,this.response=e,this.fireDidChange()}setFullResponse(e){this.fullResponsePromise=e,e.then(r=>this.fullResponse=r)}async allPromisesResolved(){await this.fullResponsePromise}setProviderStartTime(){this.providerStartTime=Date.now(),this.fireDidChange()}setProviderEndTime(){this.providerEndTime=Date.now(),this.fireDidChange()}setFetchStartTime(){this.fetchStartTime=Date.now(),this.fireDidChange()}setFetchEndTime(){this.fetchEndTime=Date.now(),this.fireDidChange()}get responseResults(){return this._responseResults}setResponseResults(e){this._isVisible=!0,this._responseResults=e,this._outcome==="pending"&&(this._outcome="succeeded"),this.fireDidChange()}getDebugName(){return`NES | ${iJs(this.filePath)} (v${this.version})`}getMarkdownTitle(){return`${this._resolveIcon().svg} `+this.getDebugName()}setRecentEdit(e){this._recentEdit=e}trace(e){this._trace.push(e),this.fireDidChange()}_renderTraceDiagram(){if(this._trace.length===0)return[];let e=[];e.push("## Trace Diagram"),e.push(`
Trace Diagram `),e.push("```");let r=this._trace.map(d=>{let f=d.match(/^\[\s*(\d+)ms\]/),h=f?parseInt(f[1],10):0,m=d.replace(/^\[\s*\d+ms\]\s*/,""),g=[],A=m,y;for(;y=A.match(/^\[([^\]]+)\]/);)g.push(y[1]),A=A.slice(y[0].length);let E=A.trim();return{timestamp:h,segments:g,message:E}});if(r.length===0)return e.push("(no trace data)"),e.push("```"),e.push(`
`),e;let n=Math.max(...r.map(d=>d.timestamp)),o=Math.max(6,String(n).length+3),s=new Map,c=[];r.forEach((d,f)=>{let h=d.segments.join("|");for(let[g,A]of s)!h.startsWith(g)&&h!==g&&(c.push({path:g,startTime:A.startTime,endTime:d.timestamp,depth:A.depth,name:g.split("|").pop()||""}),s.delete(g));let m="";d.segments.forEach((g,A)=>{m=m?`${m}|${g}`:g,s.has(m)||s.set(m,{startTime:d.timestamp,depth:A})})});let l=r[r.length-1]?.timestamp||0;for(let[d,f]of s)c.push({path:d,startTime:f.startTime,endTime:l,depth:f.depth,name:d.split("|").pop()||""});e.push(""),e.push("Timeline (nested call hierarchy):"),e.push("\u2500".repeat(60));let u=[];for(let d of r){let f=`[${String(d.timestamp).padStart(o-3)}ms]`,h="\u2502 ",m="\u251C\u2500\u2500 ",g="",A="",y=!1;for(let E=0;Ethis.addLog(`- ${r}`))}addCodeblockToLog(e,r=""){this._logs.push(`\`\`\`${r} ${e} \`\`\` -`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:Dti.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,SJs.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};j5.InlineEditRequestLogContext=Ipr;function IJs(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(IJs,"basename")});var Nti=I(Jut=>{"use strict";p();Object.defineProperty(Jut,"__esModule",{value:!0});Jut.GhostTextLogContext=void 0;var xJs=Kut(),wJs=hA(),xpr=class extends xJs.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,wJs.basename)(this.filePath)} (v${this.version})`}};Jut.GhostTextLogContext=xpr});var _H=I(bhe=>{"use strict";p();Object.defineProperty(bhe,"__esModule",{value:!0});bhe.CopilotTokenStore=bhe.ICopilotTokenStore=void 0;var RJs=rn(),kJs=Sc(),PJs=ko();bhe.ICopilotTokenStore=(0,RJs.createServiceIdentifier)("ICopilotTokenStore");var wpr=class extends PJs.Disposable{static{a(this,"CopilotTokenStore")}constructor(){super(...arguments),this._onDidStoreUpdate=this._register(new kJs.Emitter),this.onDidStoreUpdate=this._onDidStoreUpdate.event}get copilotToken(){return this._copilotToken}set copilotToken(e){let r=this._copilotToken?.token;this._copilotToken=e,r!==e?.token&&this._onDidStoreUpdate.fire()}};bhe.CopilotTokenStore=wpr});var o0=I(QA=>{"use strict";p();var DJs=QA&&QA.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},NJs=QA&&QA.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(QA,"__esModule",{value:!0});QA.TelemetryTrustedValue=QA.ITelemetryService=QA.TelemetryUserConfigImpl=QA.ITelemetryUserConfig=void 0;QA.createTrackingIdGetter=OJs;QA.multiplexProperties=LJs;var Mti=rn(),MJs=_H();QA.ITelemetryUserConfig=(0,Mti.createServiceIdentifier)("ITelemetryUserConfig");var Rpr=class{static{a(this,"TelemetryUserConfigImpl")}constructor(e,r,n){this._tokenStore=n,this.trackingId=e,this.optedIn=r??!1,this.updateFromToken(this._tokenStore.copilotToken),this._tokenStore.onDidStoreUpdate(()=>{this.updateFromToken(this._tokenStore.copilotToken)})}updateFromToken(e){if(!e)return;let r=e.getTokenValue("rt")==="1",n=e.getTokenValue("tid");n!==void 0&&(this.trackingId=n,this.organizationsList=e.organizationList.toString(),this.enterpriseList=e.enterpriseList.toString(),this.optedIn=r)}};QA.TelemetryUserConfigImpl=Rpr;QA.TelemetryUserConfigImpl=Rpr=DJs([NJs(2,MJs.ICopilotTokenStore)],Rpr);function OJs(t){let e=t.copilotToken?.getTokenValue("tid");return t.onDidStoreUpdate(()=>{let r=t.copilotToken?.getTokenValue("tid");r&&(e=r)}),()=>e}a(OJs,"createTrackingIdGetter");QA.ITelemetryService=(0,Mti.createServiceIdentifier)("ITelemetryService");var kpr=class{static{a(this,"TelemetryTrustedValue")}constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};QA.TelemetryTrustedValue=kpr;var jDe=8192,BJs=50;function LJs(t){let e={...t};for(let r in t){let n=t[r],o=n?.length??0;if(o>jDe){let s=0,c=0;for(;o>0&&c1&&(l=r+"_"+(c<10?"0":"")+c);let u=s+jDe;o{"use strict";p();var FJs=jo&&jo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UJs=jo&&jo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),QJs=jo&&jo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&FJs(e,t,r);return UJs(e,t),e},Ppr=jo&&jo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Dpr=jo&&jo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var Opr=bX&&bX.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Bpr=bX&&bX.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,H5.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return Opr(this,void 0,void 0,function(){var r,n,o;return Bpr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,H5.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=vX.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,H5.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return H5.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return Opr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return Bpr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,H5.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return vX.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var Uti=Fti(),zJs="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",YJs="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",KJs=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{JJs.exports={}});var Xut=I(She=>{"use strict";p();var ZJs=She&&She.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(She,"__esModule",{value:!0});She.JsonConfig=void 0;var XJs=require("fs"),Zut=require("path"),Lpr=$l(),eZs=ZJs(qti()),tZs="APPLICATIONINSIGHTS_CONFIGURATION_FILE",rZs="APPLICATIONINSIGHTS_CONNECTION_STRING",jti="APPSETTING_",Hti="APPINSIGHTS_INSTRUMENTATIONKEY",Gti="APPINSIGHTS_INSTRUMENTATION_KEY",nZs="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",iZs="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",oZs="http_proxy",sZs="https_proxy",aZs="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",cZs="APPLICATION_INSIGHTS_NO_STATSBEAT",lZs="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",uZs="APPLICATION_INSIGHTS_NO_PATCH_MODULES",dZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",fZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",pZs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",hZs="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",mZs="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",gZs=(function(){function t(){this.connectionString=process.env[rZs],this.instrumentationKey=process.env[Hti]||process.env[jti+Hti]||process.env[Gti]||process.env[jti+Gti],!this.connectionString&&this.instrumentationKey&&Lpr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[iZs],this.extendedMetricDisablers=process.env[nZs],this.proxyHttpUrl=process.env[oZs],this.proxyHttpsUrl=process.env[sZs],this.noDiagnosticChannel=!!process.env[aZs],this.disableStatsbeat=!!process.env[cZs],this.noHttpAgentKeepAlive=!!process.env[lZs],this.noPatchModules=process.env[uZs]||"",this.enableWebInstrumentation=!!process.env[dZs]||!!process.env[hZs],this.webInstrumentationSrc=process.env[pZs]||"",this.webInstrumentationConnectionString=process.env[fZs]||process.env[mZs]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=Zut.join(__dirname,"../../");this._tempDir=Zut.join(o,n);var s=process.env[tZs];if(s){Zut.isAbsolute(s)?this._tempDir=s:this._tempDir=Zut.join(o,s);try{e=XJs.readFileSync(this._tempDir,"utf8")}catch(l){Lpr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(eZs.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){Lpr.warn("Invalid JSON config file: ",l)}},t})();She.JsonConfig=gZs});var Fpr=I(edt=>{"use strict";p();Object.defineProperty(edt,"__esModule",{value:!0});edt.makePatchingRequire=void 0;var AZs=require("path"),yZs=DL(),$ti=dp(),Wti=require("module"),EZs=Object.keys(process.binding("natives")),Vti=Wti.prototype.require;function _Zs(t){var e={};return a(function(n){var o=Vti.apply(this,arguments);if(t[n]){var s=Wti._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(EZs.indexOf(n)<0)try{c=Vti.call(this,AZs.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{CZs.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var dp=I(jw=>{"use strict";p();Object.defineProperty(jw,"__esModule",{value:!0});jw.channel=jw.ContextPreservingEventEmitter=jw.trueFilter=jw.makePatchingRequire=void 0;var vZs=Fpr(),bZs=Fpr();Object.defineProperty(jw,"makePatchingRequire",{enumerable:!0,get:a(function(){return bZs.makePatchingRequire},"get")});var SZs=a(function(t){return!0},"trueFilter");jw.trueFilter=SZs;var Kti=(function(){function t(){this.version=zti().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=jw.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=jw.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();Upr=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(The,"suppressTracing");a(Jti,"unsuppressTracing");a(CH,"isTracingSuppressed")});var Zti,tdt,Ihe,rdt,Xti,eri,tri,Qpr=me(()=>{p();Zti="=",tdt=";",Ihe=",",rdt="baggage",Xti=180,eri=4096,tri=8192});function ndt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?Ihe:"")+r;return n.length>tri?e:n},"")}function idt(t){return t.getAllEntries().map(function(e){var r=TZs(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=tdt+o.metadata.toString()),s})}function GDe(t){var e=t.split(tdt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Zti);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Cpe(e.join(tdt))),{key:o,value:s,metadata:c}}}}}function rri(t){return typeof t!="string"||t.length===0?{}:t.split(Ihe).map(function(e){return GDe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var TZs,qpr=me(()=>{p();co();Qpr();TZs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(ndt,"serializeKeyPairs");a(idt,"getKeyPairs");a(GDe,"parsePairKeyValue");a(rri,"parseKeyPairsIntoRecord")});var odt,nri=me(()=>{p();co();HDe();Qpr();qpr();odt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=yT.getBaggage(e);if(!(!o||CH(e))){var s=idt(o).filter(function(l){return l.length<=eri}).slice(0,Xti),c=ndt(s);c.length>0&&n.set(r,rdt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,rdt),s=Array.isArray(o)?o.join(Ihe):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(Ihe);return l.forEach(function(u){var d=GDe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:yT.setBaggage(e,yT.createBaggage(c))},t.prototype.fields=function(){return[rdt]},t})()});var iri,ori=me(()=>{p();iri=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function vH(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=sri(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=IZs(s.value,2),l=c[0],u=c[1];if(!jpr(l)){kn.warn("Invalid attribute key: "+l);continue}if(!$De(u)){kn.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function jpr(t){return typeof t=="string"&&t.length>0}function $De(t){return t==null?!0:Array.isArray(t)?xZs(t):ari(t)}function xZs(t){var e,r,n;try{for(var o=sri(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(ari(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function ari(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var sri,IZs,cri=me(()=>{p();co();sri=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},IZs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(vH,"sanitizeAttributes");a(jpr,"isAttributeKey");a($De,"isAttributeValue");a(xZs,"isHomogeneousAttributeValueArray");a(ari,"isValidPrimitiveAttributeValue")});function sdt(){return function(t){kn.error(wZs(t))}}function wZs(t){return typeof t=="string"?t:JSON.stringify(RZs(t))}function RZs(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var Hpr=me(()=>{p();co();a(sdt,"loggingErrorHandler");a(wZs,"stringifyException");a(RZs,"flattenException")});function uri(t){lri=t}function nC(t){try{lri(t)}catch{}}var lri,Gpr=me(()=>{p();Hpr();lri=sdt();a(uri,"setGlobalErrorHandler");a(nC,"globalErrorHandler")});var Ib,$pr=me(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Ib||(Ib={}))});function DZs(t){return PZs.indexOf(t)>-1}function MZs(t){return NZs.indexOf(t)>-1}function BZs(t){return OZs.indexOf(t)>-1}function LZs(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function FZs(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function UZs(t,e,r,n){n===void 0&&(n=kZs);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function qZs(t,e,r){var n=r[t];if(typeof n=="string"){var o=QZs[n.toUpperCase()];o!=null&&(e[t]=o)}}function WDe(t){var e={};for(var r in VDe){var n=r;switch(n){case"OTEL_LOG_LEVEL":qZs(n,e,t);break;default:if(DZs(n))LZs(n,e,t);else if(MZs(n))FZs(n,e,t);else if(BZs(n))UZs(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var kZs,PZs,NZs,OZs,SX,TX,Vpr,Wpr,VDe,QZs,zpr=me(()=>{p();co();$pr();kZs=",",PZs=["OTEL_SDK_DISABLED"];a(DZs,"isEnvVarABoolean");NZs=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(MZs,"isEnvVarANumber");OZs=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(BZs,"isEnvVarAList");SX=1/0,TX=128,Vpr=128,Wpr=128,VDe={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Da.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:SX,OTEL_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:SX,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:SX,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:TX,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Vpr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Wpr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Ib.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(LZs,"parseBoolean");a(FZs,"parseNumber");a(UZs,"parseStringList");QZs={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(qZs,"setLogLevelFromEnv");a(WDe,"parseEnvironment")});function Hw(){var t=WDe(process.env);return Object.assign({},VDe,t)}function xhe(){return WDe(process.env)}var dri=me(()=>{p();zpr();a(Hw,"getEnv");a(xhe,"getEnvWithoutDefaults")});var adt,fri=me(()=>{p();adt=typeof globalThis=="object"?globalThis:global});function pri(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function cdt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(pri,"intValue");a(cdt,"hexToBinary")});function ldt(t){return Buffer.from(cdt(t)).toString("base64")}var hri=me(()=>{p();Ypr();a(ldt,"hexToBase64")});function mri(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(udt[t-1]=1);return udt.toString("hex",0,t)},"generateId")}var jZs,gri,ddt,udt,Ari=me(()=>{p();jZs=8,gri=16,ddt=(function(){function t(){this.generateTraceId=mri(gri),this.generateSpanId=mri(jZs)}return a(t,"RandomIdGenerator"),t})(),udt=Buffer.allocUnsafe(gri);a(mri,"getIdGenerator")});var yri,Gw,Eri=me(()=>{p();yri=require("perf_hooks"),Gw=yri.performance});var fdt,Kpr=me(()=>{p();fdt="1.30.1"});var _ri=me(()=>{p()});var Cri=me(()=>{p();_ri()});var HZs,GZs,$Zs,VZs,vri,bri,Sri,Tri,WZs,Iri,xri=me(()=>{p();HZs="process.runtime.name",GZs="telemetry.sdk.name",$Zs="telemetry.sdk.language",VZs="telemetry.sdk.version",vri=HZs,bri=GZs,Sri=$Zs,Tri=VZs,WZs="nodejs",Iri=WZs});var wri=me(()=>{p();xri()});var Rri=me(()=>{p()});var kri=me(()=>{p()});var Pri=me(()=>{p();Cri();wri();Rri();kri()});var whe,bH,Dri=me(()=>{p();Kpr();Pri();bH=(whe={},whe[bri]="opentelemetry",whe[vri]="node",whe[Sri]=Iri,whe[Tri]=fdt,whe)});function Rhe(t){t.unref()}var Nri=me(()=>{p();a(Rhe,"unrefTimer")});var Mri=me(()=>{p();dri();fri();hri();Ari();Eri();Dri();Nri()});var Jpr=me(()=>{p();Mri()});function I2(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*YZs);return[r,n]}function khe(){var t=Gw.timeOrigin;if(typeof t!="number"){var e=Gw;t=e.timing&&e.timing.fetchStart}return t}function zDe(t){var e=I2(khe()),r=I2(typeof t=="number"?t:Gw.now());return JDe(e,r)}function Bri(t){if(Phe(t))return t;if(typeof t=="number")return t=pdt&&(r[1]-=pdt,r[0]+=1),r}var Ori,zZs,YZs,pdt,Qri=me(()=>{p();Jpr();Ori=9,zZs=6,YZs=Math.pow(10,zZs),pdt=Math.pow(10,Ori);a(I2,"millisToHrTime");a(khe,"getTimeOrigin");a(zDe,"hrTime");a(Bri,"timeInputToHrTime");a(hdt,"hrTimeDuration");a(Lri,"hrTimeToTimeStamp");a(Fri,"hrTimeToNanoseconds");a(Uri,"hrTimeToMilliseconds");a(YDe,"hrTimeToMicroseconds");a(Phe,"isTimeInputHrTime");a(KDe,"isTimeInput");a(JDe,"addHrTimes")});var ST,qri=me(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(ST||(ST={}))});var KZs,mdt,jri=me(()=>{p();co();KZs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mdt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=KZs(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){kn.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){kn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function Hri(t){return XZs.test(t)}function Gri(t){return eXs.test(t)&&!tXs.test(t)}var Zpr,JZs,ZZs,XZs,eXs,tXs,$ri=me(()=>{p();Zpr="[_0-9a-z-*/]",JZs="[a-z]"+Zpr+"{0,255}",ZZs="[a-z0-9]"+Zpr+"{0,240}@[a-z]"+Zpr+"{0,13}",XZs=new RegExp("^(?:"+JZs+"|"+ZZs+")$"),eXs=/^[ -~]{0,255}[!-~]$/,tXs=/,|=/;a(Hri,"validateKey");a(Gri,"validateValue")});var Vri,rXs,Wri,zri,gdt,Xpr=me(()=>{p();$ri();Vri=32,rXs=512,Wri=",",zri="=",gdt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+zri+e.get(n)),r},[]).join(Wri)},t.prototype._parse=function(e){e.length>rXs||(this._internalState=e.split(Wri).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(zri);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);Hri(c)&&Gri(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Vri&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Vri))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function ehr(t){var e=cXs.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var ZDe,XDe,nXs,iXs,oXs,sXs,aXs,cXs,Adt,Yri=me(()=>{p();co();HDe();Xpr();ZDe="traceparent",XDe="tracestate",nXs="00",iXs="(?!ff)[\\da-f]{2}",oXs="(?![0]{32})[\\da-f]{32}",sXs="(?![0]{16})[\\da-f]{16}",aXs="[\\da-f]{2}",cXs=new RegExp("^\\s?("+iXs+")-("+oXs+")-("+sXs+")-("+aXs+")(-.*)?\\s?$");a(ehr,"parseTraceParent");Adt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=Cu.getSpanContext(e);if(!(!o||CH(e)||!mb(o))){var s=nXs+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||yf.NONE).toString(16);n.set(r,ZDe,s),o.traceState&&n.set(r,XDe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,ZDe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ehr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,XDe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new gdt(typeof u=="string"?u:void 0)}return Cu.setSpanContext(e,c)},t.prototype.fields=function(){return[ZDe,XDe]},t})()});function Kri(t,e){return t.setValue(thr,e)}function Jri(t){return t.deleteValue(thr)}function Zri(t){return t.getValue(thr)}var thr,ydt,Xri=me(()=>{p();co();thr=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(ydt||(ydt={}));a(Kri,"setRPCMetadata");a(Jri,"deleteRPCMetadata");a(Zri,"getRPCMetadata")});var eNe,rhr=me(()=>{p();co();eNe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:gb.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var Dhe,nhr=me(()=>{p();co();Dhe=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:gb.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var eni,tni=me(()=>{p();co();Gpr();rhr();nhr();eni=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(nC(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Dhe),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new Dhe,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new eNe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new Dhe,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new eNe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Cu.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&yf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&yf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var rni,nni=me(()=>{p();co();rni=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:$Z(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function mXs(t,e){return function(r){return t(e(r))}}function ihr(t){if(!gXs(t)||AXs(t)!==lXs)return!1;var e=hXs(t);if(e===null)return!0;var r=sni.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ini.call(r)===pXs}function gXs(t){return t!=null&&typeof t=="object"}function AXs(t){return t==null?t===void 0?dXs:uXs:IX&&IX in Object(t)?yXs(t):EXs(t)}function yXs(t){var e=sni.call(t,IX),r=t[IX],n=!1;try{t[IX]=void 0,n=!0}catch{}var o=ani.call(t);return n&&(e?t[IX]=r:delete t[IX]),o}function EXs(t){return ani.call(t)}var lXs,uXs,dXs,fXs,ini,pXs,hXs,oni,sni,IX,ani,cni=me(()=>{p();lXs="[object Object]",uXs="[object Null]",dXs="[object Undefined]",fXs=Function.prototype,ini=fXs.toString,pXs=ini.call(Object),hXs=mXs(Object.getPrototypeOf,Object),oni=Object.prototype,sni=oni.hasOwnProperty,IX=Symbol?Symbol.toStringTag:void 0,ani=oni.toString;a(mXs,"overArg");a(ihr,"isPlainObject");a(gXs,"isObjectLike");a(AXs,"baseGetTag");a(yXs,"getRawTag");a(EXs,"objectToString")});function Cdt(){for(var t=[],e=0;e0;)r=uni(r,t.shift(),0,n);return r}function ohr(t){return _dt(t)?t.slice():t}function uni(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>_Xs)){if(r++,Edt(t)||Edt(e)||dni(e))o=ohr(e);else if(_dt(t)){if(o=t.slice(),_dt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(lni(t,u,n)||lni(e,u,n))delete o[u];else{if(tNe(f)&&tNe(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=uni(o[u],d,r,n)}}}}else o=e;return o}}function lni(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function CXs(t,e){return!(!ihr(t)||!ihr(e))}var _Xs,fni=me(()=>{p();cni();_Xs=20;a(Cdt,"merge");a(ohr,"takeValue");a(uni,"mergeTwoObjects");a(lni,"wasObjectReferenced");a(_dt,"isArray");a(dni,"isFunction");a(tNe,"isObject");a(Edt,"isPrimitive");a(CXs,"shouldMerge")});function pni(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new shr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var vXs,shr,hni=me(()=>{p();vXs=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),shr=(function(t){vXs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(pni,"callWithTimeout")});function ahr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function mni(t,e){var r,n;if(!e)return!1;try{for(var o=bXs(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(ahr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var bXs,gni=me(()=>{p();bXs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(ahr,"urlMatches");a(mni,"isUrlIgnored")});function Ani(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var yni=me(()=>{p();a(Ani,"isWrapped")});var Eni,_ni=me(()=>{p();Eni=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var SXs,TXs,Nhe,Cni=me(()=>{p();_ni();SXs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},TXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();HDe();a(vni,"_export")});var Sni={};wi(Sni,{AlwaysOffSampler:()=>eNe,AlwaysOnSampler:()=>Dhe,AnchoredClock:()=>iri,BindOnceFuture:()=>Nhe,CompositePropagator:()=>mdt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>TX,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>SX,DEFAULT_ENVIRONMENT:()=>VDe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>Vpr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>Wpr,ExportResultCode:()=>ST,ParentBasedSampler:()=>eni,RPCType:()=>ydt,RandomIdGenerator:()=>ddt,SDK_INFO:()=>bH,TRACE_PARENT_HEADER:()=>ZDe,TRACE_STATE_HEADER:()=>XDe,TimeoutError:()=>shr,TraceIdRatioBasedSampler:()=>rni,TraceState:()=>gdt,TracesSamplerValues:()=>Ib,VERSION:()=>fdt,W3CBaggagePropagator:()=>odt,W3CTraceContextPropagator:()=>Adt,_globalThis:()=>adt,addHrTimes:()=>JDe,baggageUtils:()=>IXs,callWithTimeout:()=>pni,deleteRPCMetadata:()=>Jri,getEnv:()=>Hw,getEnvWithoutDefaults:()=>xhe,getRPCMetadata:()=>Zri,getTimeOrigin:()=>khe,globalErrorHandler:()=>nC,hexToBase64:()=>ldt,hexToBinary:()=>cdt,hrTime:()=>zDe,hrTimeDuration:()=>hdt,hrTimeToMicroseconds:()=>YDe,hrTimeToMilliseconds:()=>Uri,hrTimeToNanoseconds:()=>Fri,hrTimeToTimeStamp:()=>Lri,internal:()=>chr,isAttributeKey:()=>jpr,isAttributeValue:()=>$De,isTimeInput:()=>KDe,isTimeInputHrTime:()=>Phe,isTracingSuppressed:()=>CH,isUrlIgnored:()=>mni,isWrapped:()=>Ani,loggingErrorHandler:()=>sdt,merge:()=>Cdt,millisToHrTime:()=>I2,otperformance:()=>Gw,parseEnvironment:()=>WDe,parseTraceParent:()=>ehr,sanitizeAttributes:()=>vH,setGlobalErrorHandler:()=>uri,setRPCMetadata:()=>Kri,suppressTracing:()=>The,timeInputToHrTime:()=>Bri,unrefTimer:()=>Rhe,unsuppressTracing:()=>Jti,urlMatches:()=>ahr});var IXs,chr,xb=me(()=>{p();nri();ori();cri();Gpr();Hpr();Qri();Ypr();qri();qpr();Jpr();jri();Yri();Xri();rhr();nhr();tni();nni();HDe();Xpr();zpr();fni();$pr();hni();gni();yni();Cni();Kpr();bni();IXs={getKeyPairs:idt,serializeKeyPairs:ndt,parseKeyPairsIntoRecord:rri,parsePairKeyValue:GDe},chr={_export:vni}});var xXs,wXs,RXs,vdt,bdt,Tni,Ini=me(()=>{p();xXs="exception.type",wXs="exception.message",RXs="exception.stacktrace",vdt=xXs,bdt=wXs,Tni=RXs});var xni=me(()=>{p();Ini()});var wni=me(()=>{p()});var Rni=me(()=>{p();wni()});var kni=me(()=>{p()});var Pni=me(()=>{p()});var Dni=me(()=>{p();xni();Rni();kni();Pni()});var Nni,Mni=me(()=>{p();Nni="exception"});var lhr,kXs,Oni,PXs,Sdt,uhr=me(()=>{p();co();xb();Dni();Mni();lhr=function(){return lhr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Oni=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},PXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(kn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=kXs(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=Oni(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return kn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&kn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),KDe(r)&&(KDe(n)||(n=r),r=void 0);var o=vH(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,PXs([],Oni(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=lhr({},e),this.status.message!=null&&typeof e.message!="string"&&(kn.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){kn.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=hdt(this.startTime,this.endTime),this._duration[0]<0&&(kn.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&kn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=Gw.now())return zDe(e+this._performanceOffset);if(typeof e=="number")return I2(e);if(e instanceof Date)return I2(e.getTime());if(Phe(e))return e;if(this._startTimeProvided)return I2(Date.now());var r=Gw.now()-this._performanceStartTime;return JDe(this.startTime,I2(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[bdt]=e:e&&(e.code?n[vdt]=e.code.toString():e.name&&(n[vdt]=e.name),e.message&&(n[bdt]=e.message),e.stack&&(n[Tni]=e.stack)),n[vdt]||n[bdt]?this.addEvent(Nni,n,r):kn.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&kn.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(kn.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var x2,rNe=me(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(x2||(x2={}))});var SH,Tdt=me(()=>{p();rNe();SH=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:x2.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var G5,Idt=me(()=>{p();rNe();G5=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:x2.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Mhe,dhr=me(()=>{p();co();xb();Tdt();Idt();Mhe=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(nC(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new G5),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new G5,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new SH,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new G5,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new SH}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=Cu.getSpanContext(e);return!l||!mb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&yf.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&yf.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var nNe,fhr=me(()=>{p();co();rNe();nNe=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:$Z(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function xdt(){var t=Hw();return{sampler:phr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function phr(t){switch(t===void 0&&(t=Hw()),t.OTEL_TRACES_SAMPLER){case Ib.AlwaysOn:return new G5;case Ib.AlwaysOff:return new SH;case Ib.ParentBasedAlwaysOn:return new Mhe({root:new G5});case Ib.ParentBasedAlwaysOff:return new Mhe({root:new SH});case Ib.TraceIdRatio:return new nNe(Bni(t));case Ib.ParentBasedTraceIdRatio:return new Mhe({root:new nNe(Bni(t))});default:return kn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+DXs+'".'),new G5}}function Bni(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return kn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+Ohe+"."),Ohe;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(kn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+Ohe+"."),Ohe):e<0||e>1?(kn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+Ohe+"."),Ohe):e}var DXs,Ohe,hhr=me(()=>{p();co();xb();Tdt();Idt();dhr();fhr();DXs=Ib.AlwaysOn,Ohe=1;a(xdt,"loadDefaultConfig");a(phr,"buildSamplerFromEnv");a(Bni,"getSamplerProbabilityFromEnv")});function Lni(t){var e={sampler:phr()},r=xdt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function Fni(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=xhe();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:TX,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:SX,Object.assign({},t,{spanLimits:g})}var mhr=me(()=>{p();hhr();xb();a(Lni,"mergeConfig");a(Fni,"reconfigureLimits")});var Uni,Qni=me(()=>{p();co();xb();Uni=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=Hw();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Nhe(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(kn.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&yf.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&kn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(kn.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,nC(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),Rhe(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var NXs,Bhe,qni=me(()=>{p();Qni();NXs=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Bhe=(function(t){NXs(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(Uni)});function jni(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(wdt[t-1]=1);return wdt.toString("hex",0,t)},"generateId")}var MXs,Hni,Lhe,wdt,Gni=me(()=>{p();MXs=8,Hni=16,Lhe=(function(){function t(){this.generateTraceId=jni(Hni),this.generateSpanId=jni(MXs)}return a(t,"RandomIdGenerator"),t})(),wdt=Buffer.allocUnsafe(Hni);a(jni,"getIdGenerator")});var $ni=me(()=>{p();qni();Gni()});var Rdt=me(()=>{p();$ni()});var kdt,ghr=me(()=>{p();co();xb();uhr();mhr();Rdt();kdt=(function(){function t(e,r,n){this._tracerProvider=n;var o=Lni(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new Lhe,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=_g.active()),r.root&&(n=Cu.deleteSpan(n));var l=Cu.getSpan(n);if(CH(n)){kn.debug("Instrumentation suppressed, returning Noop Span");var u=Cu.wrapSpanContext(vpe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!Cu.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:bpe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:vH(R.attributes)}}),E=vH(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===gb.RECORD_AND_SAMPLED?yf.SAMPLED:yf.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===gb.NOT_RECORD){kn.debug("Recording is off, propagating context in a non-recording span");var u=Cu.wrapSpanContext(b);return u}var T=vH(Object.assign(E,_.attributes)),w=new Sdt(this,n,e,b,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??_g.active(),d=this.startSpan(e,s,u),f=Cu.setSpan(u,d);return _g.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var Vni=me(()=>{p()});var Wni=me(()=>{p();Vni()});var OXs,BXs,LXs,FXs,zni,Ahr,yhr,Ehr,Yni=me(()=>{p();OXs="service.name",BXs="telemetry.sdk.name",LXs="telemetry.sdk.language",FXs="telemetry.sdk.version",zni=OXs,Ahr=BXs,yhr=LXs,Ehr=FXs});var Kni=me(()=>{p();Yni()});var Jni=me(()=>{p()});var Zni=me(()=>{p()});var Xni=me(()=>{p();Wni();Kni();Jni();Zni()});function Pdt(){return"unknown_service:"+process.argv0}var eii=me(()=>{p();a(Pdt,"defaultServiceName")});var tii=me(()=>{p();eii()});var rii=me(()=>{p();tii()});var TH,UXs,QXs,qXs,Ddt,nii=me(()=>{p();co();Xni();xb();rii();TH=function(){return TH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Ddt=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return kn.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[zni]=Pdt(),e[yhr]=bH[yhr],e[Ahr]=bH[Ahr],e[Ehr]=bH[Ehr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&kn.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return UXs(this,void 0,void 0,function(){return QXs(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=TH(TH({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=qXs(c,2),d=u[0],f=u[1];return TH(TH(TH(TH({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var iii=me(()=>{p();nii()});var Ndt,_hr,oii=me(()=>{p();xb();Ndt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_hr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Ndt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){nC(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Ndt(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=Ndt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=Ndt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var Mdt,Chr=me(()=>{p();Mdt=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var jXs,HXs,e8,sii,aii=me(()=>{p();co();xb();iii();ghr();hhr();oii();Chr();Rdt();mhr();jXs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},HXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(Hw().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||kn.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new mdt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=Hw().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||kn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Adt}],["baggage",function(){return new odt}]]),t._registeredExporters=new Map,t})()});var GXs,cii,lii=me(()=>{p();xb();GXs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cii=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:YDe(e.startTime),duration:YDe(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=GXs(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:ST.SUCCESS})},t})()});var $Xs,VXs,uii,dii=me(()=>{p();xb();$Xs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},VXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();xb();WXs=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},zXs=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]SH,AlwaysOnSampler:()=>G5,BasicTracerProvider:()=>sii,BatchSpanProcessor:()=>Bhe,ConsoleSpanExporter:()=>cii,ForceFlushState:()=>e8,InMemorySpanExporter:()=>uii,NoopSpanProcessor:()=>Mdt,ParentBasedSampler:()=>Mhe,RandomIdGenerator:()=>Lhe,SamplingDecision:()=>x2,SimpleSpanProcessor:()=>fii,Span:()=>Sdt,TraceIdRatioBasedSampler:()=>nNe,Tracer:()=>kdt});var mii=me(()=>{p();ghr();aii();Rdt();lii();dii();pii();Chr();Tdt();Idt();dhr();fhr();rNe();uhr()});var iNe,gii,vhr=me(()=>{p();iNe=class{static{a(this,"NoopLogger")}emit(e){}},gii=new iNe});var bhr,Odt,Shr=me(()=>{p();vhr();bhr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new iNe}},Odt=new bhr});var Bdt,Aii=me(()=>{p();vhr();Bdt=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):gii}}});var oNe,yii=me(()=>{p();Shr();Aii();oNe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Bdt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Odt}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var Ldt,Eii=me(()=>{p();Ldt=typeof globalThis=="object"?globalThis:global});var _ii=me(()=>{p();Eii()});var Cii=me(()=>{p();_ii()});function vii(t,e,r){return n=>n===t?e:r}var sNe,Fhe,Thr,bii=me(()=>{p();Cii();sNe=Symbol.for("io.opentelemetry.js.api.logs"),Fhe=Ldt;a(vii,"makeGetter");Thr=1});var Fdt,Sii=me(()=>{p();bii();Shr();yii();Fdt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new oNe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Fhe[sNe]?this.getLoggerProvider():(Fhe[sNe]=vii(Thr,e,Odt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Fhe[sNe])===null||e===void 0?void 0:e.call(Fhe,Thr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Fhe[sNe],this._proxyLoggerProvider=new oNe}}});var Udt,Ihr=me(()=>{p();Sii();Udt=Fdt.getInstance()});function Tii(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var xii=me(()=>{p();a(Tii,"enableInstrumentations");a(Iii,"disableInstrumentations")});function wii(t){let e=t.tracerProvider||Cu.getTracerProvider(),r=t.meterProvider||VZ.getMeterProvider(),n=t.loggerProvider||Udt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return Tii(o,e,r,n),()=>{Iii(o)}}var Rii=me(()=>{p();co();Ihr();xii();a(wii,"registerInstrumentations")});function Oii(t,e,r){if(!JXs(t))return kn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=tea(t);if(!n)return!1;let o=[],s=Bii(n,e,o,r);return s&&!r?.includePrerelease?XXs(n,o):s}function JXs(t){return typeof t=="string"&&Mii.test(t)}function Bii(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(xhr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=vea(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!xhr(t,s,r,n))return!1;return!0}return xhr(t,e,r,n)}function xhr(t,e,r,n){if(e=eea(e,n),e.includes(" "))return Bii(t,e,r,n);{let o=rea(e);return r.push(o),ZXs(t,o)}}function ZXs(t,e){if(e.invalid)return!1;if(!e.version||Rhr(e.version))return!0;let r=Pii(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=Pii(n,o)}return KXs[e.op]?.includes(r)}function XXs(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function eea(t,e){return t=t.trim(),t=_ea(t,e),t=Eea(t),t=Cea(t,e),t=t.trim(),t}function iC(t){return!t||t.toLowerCase()==="x"||t==="*"}function tea(t){let e=t.match(Mii);if(!e){kn.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function rea(t){if(!t)return{};let e=t.match(YXs);if(!e)return kn.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function Rhr(t){return t==="*"||t==="x"||t==="X"}function kii(t){let e=parseInt(t,10);return isNaN(e)?t:e}function nea(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function iea(t,e){if(Rhr(t)||Rhr(e))return 0;let[r,n]=nea(kii(t),kii(e));return r>n?1:r{let l;return iC(n)?l="":iC(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:iC(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function _ea(t,e){let r=yea,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return iC(s)?d="":iC(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:iC(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function Cea(t,e){let r=uea;return t.replace(r,(n,o,s,c,l,u)=>{let d=iC(s),f=d||iC(c),h=f||iC(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function vea(t,e){let r=fea;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(iC(s)?o="":iC(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:iC(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,iC(h)?f="":iC(m)?f=`<${+h+1}.0.0-0`:iC(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var Mii,YXs,KXs,Lii,Fii,oea,sea,Dii,aea,Nii,cea,whr,aNe,lea,uea,dea,fea,pea,hea,mea,gea,Aea,yea,Uii=me(()=>{p();co();Mii=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,YXs=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,KXs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(Oii,"satisfies");a(JXs,"_validateVersion");a(Bii,"_doSatisfies");a(xhr,"_checkRange");a(ZXs,"_satisfies");a(XXs,"_doPreleaseCheck");a(eea,"_normalizeRange");a(iC,"isX");a(tea,"_parseVersion");a(rea,"_parseRange");a(Rhr,"_isWildcard");a(kii,"_parseVersionString");a(nea,"_normalizeVersionType");a(iea,"_compareVersionStrings");a(Pii,"_compareVersionSegments");Lii="[a-zA-Z0-9-]",Fii="0|[1-9]\\d*",oea=`\\d*[a-zA-Z-]${Lii}*`,sea="((?:<|>)?=?)",Dii=`(?:${Fii}|${oea})`,aea=`(?:-(${Dii}(?:\\.${Dii})*))`,Nii=`${Lii}+`,cea=`(?:\\+(${Nii}(?:\\.${Nii})*))`,whr=`${Fii}|x|X|\\*`,aNe=`[v=\\s]*(${whr})(?:\\.(${whr})(?:\\.(${whr})(?:${aea})?${cea}?)?)?`,lea=`^${sea}\\s*${aNe}$`,uea=new RegExp(lea),dea=`^\\s*(${aNe})\\s+-\\s+(${aNe})\\s*$`,fea=new RegExp(dea),pea="(?:~>?)",hea=`^${pea}${aNe}$`,mea=new RegExp(hea),gea="(?:\\^)",Aea=`^${gea}${aNe}$`,yea=new RegExp(Aea);a(Eea,"replaceTilde");a(_ea,"replaceCaret");a(Cea,"replaceXRange");a(vea,"replaceHyphen")});var Uhe=I((lWf,jii)=>{"use strict";p();function khr(t){return typeof t=="function"}a(khr,"isFunction");var oC=console.error.bind(console);function cNe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(cNe,"defineProperty");function lNe(t){t&&t.logger&&(khr(t.logger)?oC=t.logger:oC("new logger isn't a function, not replacing"))}a(lNe,"shimmer");function Qii(t,e,r){if(!t||!t[e]){oC("no original function "+e+" to wrap");return}if(!r){oC("no wrapper function"),oC(new Error().stack);return}if(!khr(t[e])||!khr(r)){oC("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return cNe(o,"__original",n),cNe(o,"__unwrap",function(){t[e]===o&&cNe(t,e,n)}),cNe(o,"__wrapped",!0),cNe(t,e,o),o}a(Qii,"wrap");function bea(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{oC("must provide one or more modules to patch"),oC(new Error().stack);return}if(!(e&&Array.isArray(e))){oC("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Qii(n,o,r)})})}a(bea,"massWrap");function qii(t,e){if(!t||!t[e]){oC("no function to unwrap."),oC(new Error().stack);return}if(!t[e].__unwrap)oC("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(qii,"unwrap");function Sea(t,e){if(t)Array.isArray(t)||(t=[t]);else{oC("must provide one or more modules to patch"),oC(new Error().stack);return}if(!(e&&Array.isArray(e))){oC("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){qii(r,n)})})}a(Sea,"massUnwrap");lNe.wrap=Qii;lNe.massWrap=bea;lNe.unwrap=qii;lNe.massUnwrap=Sea;jii.exports=lNe});var IH,Qdt,Hii=me(()=>{p();co();Ihr();IH=ce(Uhe()),Qdt=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=kn.createComponentLogger({namespace:e}),this._tracer=Cu.getTracer(e,r),this._meter=VZ.getMeter(e,r),this._logger=Udt.getLogger(e,r),this._updateMetricInstruments()}_wrap=IH.wrap;_unwrap=IH.unwrap;_massWrap=IH.massWrap;_massUnwrap=IH.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var $ii=I((AWf,Gii)=>{p();var Qhe=1e3,qhe=Qhe*60,jhe=qhe*60,xX=jhe*24,Tea=xX*7,Iea=xX*365.25;Gii.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return xea(t);if(r==="number"&&isFinite(t))return e.long?Rea(t):wea(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function xea(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Iea;case"weeks":case"week":case"w":return r*Tea;case"days":case"day":case"d":return r*xX;case"hours":case"hour":case"hrs":case"hr":case"h":return r*jhe;case"minutes":case"minute":case"mins":case"min":case"m":return r*qhe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Qhe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(xea,"parse");function wea(t){var e=Math.abs(t);return e>=xX?Math.round(t/xX)+"d":e>=jhe?Math.round(t/jhe)+"h":e>=qhe?Math.round(t/qhe)+"m":e>=Qhe?Math.round(t/Qhe)+"s":t+"ms"}a(wea,"fmtShort");function Rea(t){var e=Math.abs(t);return e>=xX?qdt(t,e,xX,"day"):e>=jhe?qdt(t,e,jhe,"hour"):e>=qhe?qdt(t,e,qhe,"minute"):e>=Qhe?qdt(t,e,Qhe,"second"):t+" ms"}a(Rea,"fmtLong");function qdt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(qdt,"plural")});var Phr=I((_Wf,Vii)=>{p();function kea(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=$ii(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let k=r.formatters[x];if(typeof k=="function"){let D=E[T];R=k.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(kea,"setup");Vii.exports=kea});var Wii=I((wb,jdt)=>{p();wb.formatArgs=Dea;wb.save=Nea;wb.load=Mea;wb.useColors=Pea;wb.storage=Oea();wb.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();wb.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Pea(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(Pea,"useColors");function Dea(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+jdt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(Dea,"formatArgs");wb.log=console.debug||console.log||(()=>{});function Nea(t){try{t?wb.storage.setItem("debug",t):wb.storage.removeItem("debug")}catch{}}a(Nea,"save");function Mea(){let t;try{t=wb.storage.getItem("debug")||wb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(Mea,"load");function Oea(){try{return localStorage}catch{}}a(Oea,"localstorage");jdt.exports=Phr()(wb);var{formatters:Bea}=jdt.exports;Bea.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Yii=I((vg,Gdt)=>{p();var Lea=require("tty"),Hdt=require("util");vg.init=Gea;vg.log=qea;vg.formatArgs=Uea;vg.save=jea;vg.load=Hea;vg.useColors=Fea;vg.destroy=Hdt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");vg.colors=[6,2,3,4,5,1];try{let t=sHe();t&&(t.stderr||t).level>=2&&(vg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}vg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function Fea(){return"colors"in vg.inspectOpts?!!vg.inspectOpts.colors:Lea.isatty(process.stderr.fd)}a(Fea,"useColors");function Uea(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` +`)}setDiagnosticsData(e){this._fileDiagnostics=e}setTerminalData(e){this._terminalOutput=e}setLanguageContext(e){this._languageContext=e}toJSON(){return{requestId:this.requestId,time:this.time,filePath:this.filePath,version:this.version,statelessNextEditProviderId:this._statelessNextEditProviderId,nextEditRequest:this._nextEditRequest?.serialize(),diagnosticsResultEdit:this._diagnosticsResultEdit?.toString(),resultEdit:this._resultEdit?.toString(),isCachedResult:!!this._logContextOfCachedEdit,prompt:this.prompt,error:String(this.error),response:this.fullResponse,responseResults:uri.stringify(this._responseResults,null," "),providerStartTime:this.providerStartTime,providerEndTime:this.providerEndTime,fetchStartTime:this.fetchStartTime,fetchEndTime:this.fetchEndTime,logs:this._logs,isAccepted:this._isAccepted,languageContext:this._languageContext?(0,rJs.serializeLanguageContext)(this._languageContext):void 0,diagnostics:this._fileDiagnostics,terminalOutput:this._terminalOutput}}};L5.InlineEditRequestLogContext=Bpr;function iJs(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)}a(iJs,"basename")});var dri=I(Xut=>{"use strict";p();Object.defineProperty(Xut,"__esModule",{value:!0});Xut.GhostTextLogContext=void 0;var oJs=Zut(),sJs=fA(),Lpr=class extends oJs.InlineEditRequestLogContext{static{a(this,"GhostTextLogContext")}getDebugName(){return`Ghost | ${(0,sJs.basename)(this.filePath)} (v${this.version})`}};Xut.GhostTextLogContext=Lpr});var qpr=I(Fo=>{"use strict";p();var aJs=Fo&&Fo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cJs=Fo&&Fo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lJs=Fo&&Fo.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aJs(e,t,r);return cJs(e,t),e},Fpr=Fo&&Fo.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Upr=Fo&&Fo.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var jpr=EX&&EX.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Hpr=EX&&EX.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]this.maxSizeBytes?[4,this._createBackupFile(r)]:[3,14];case 13:return u.sent(),[3,16];case 14:return[4,F5.appendFileAsync(this._fileFullPath,r)];case 15:u.sent(),u.label=16;case 16:return[3,18];case 17:return l=u.sent(),console.log(this.TAG,"Failed to create backup file: "+(l&&l.message)),[3,18];case 18:return[2]}})})},t.prototype._createBackupFile=function(e){return jpr(this,void 0,void 0,function(){var r,n,o;return Hpr(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),[4,F5.readFileAsync(this._fileFullPath)];case 1:return r=s.sent(),n=yX.join(this._tempDir,new Date().getTime()+"."+this._logFileName),[4,F5.writeFileAsync(n,r)];case 2:return s.sent(),[3,5];case 3:return o=s.sent(),console.log("Failed to generate backup log file",o),[3,5];case 4:return F5.writeFileAsync(this._fileFullPath,e),[7];case 5:return[2]}})})},t.prototype._fileCleanupTask=function(){return jpr(this,void 0,void 0,function(){var e,r,n,o,s,c=this;return Hpr(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,F5.readdirAsync(this._tempDir)];case 1:e=l.sent(),e=e.filter(function(u){return yX.basename(u).indexOf(c._backUpNameFormat)>-1}),e.sort(function(u,d){var f=new Date(parseInt(u.split(c._backUpNameFormat)[0])),h=new Date(parseInt(d.split(c._backUpNameFormat)[0]));if(f=h)return 1}),r=e.length,n=0,l.label=2;case 2:return n{"use strict";p();var gri=mri(),AJs="APPLICATION_INSIGHTS_ENABLE_DEBUG_LOGS",yJs="APPLICATION_INSIGHTS_DISABLE_WARNING_LOGS",EJs=(function(){function t(){}return a(t,"Logging"),t.info=function(e){for(var r=[],n=1;n{_Js.exports={}});var tdt=I(ghe=>{"use strict";p();var vJs=ghe&&ghe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ghe,"__esModule",{value:!0});ghe.JsonConfig=void 0;var CJs=require("fs"),edt=require("path"),Gpr=jl(),bJs=vJs(yri()),SJs="APPLICATIONINSIGHTS_CONFIGURATION_FILE",TJs="APPLICATIONINSIGHTS_CONNECTION_STRING",Eri="APPSETTING_",_ri="APPINSIGHTS_INSTRUMENTATIONKEY",vri="APPINSIGHTS_INSTRUMENTATION_KEY",IJs="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",xJs="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",wJs="http_proxy",RJs="https_proxy",PJs="APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL",kJs="APPLICATION_INSIGHTS_NO_STATSBEAT",DJs="APPLICATION_INSIGHTS_NO_HTTP_AGENT_KEEP_ALIVE",NJs="APPLICATION_INSIGHTS_NO_PATCH_MODULES",MJs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_ENABLED",OJs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_CONNECTION_STRING",BJs="APPLICATIONINSIGHTS_WEB_INSTRUMENTATION_SOURCE",LJs="APPLICATIONINSIGHTS_WEB_SNIPPET_ENABLED",FJs="APPLICATIONINSIGHTS_WEB_SNIPPET_CONNECTION_STRING",UJs=(function(){function t(){this.connectionString=process.env[TJs],this.instrumentationKey=process.env[_ri]||process.env[Eri+_ri]||process.env[vri]||process.env[Eri+vri],!this.connectionString&&this.instrumentationKey&&Gpr.warn("APPINSIGHTS_INSTRUMENTATIONKEY is in path of deprecation, please use APPLICATIONINSIGHTS_CONNECTION_STRING env variable to setup the SDK."),this.disableAllExtendedMetrics=!!process.env[xJs],this.extendedMetricDisablers=process.env[IJs],this.proxyHttpUrl=process.env[wJs],this.proxyHttpsUrl=process.env[RJs],this.noDiagnosticChannel=!!process.env[PJs],this.disableStatsbeat=!!process.env[kJs],this.noHttpAgentKeepAlive=!!process.env[DJs],this.noPatchModules=process.env[NJs]||"",this.enableWebInstrumentation=!!process.env[MJs]||!!process.env[LJs],this.webInstrumentationSrc=process.env[BJs]||"",this.webInstrumentationConnectionString=process.env[OJs]||process.env[FJs]||"",this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.webSnippetConnectionString=this.webInstrumentationConnectionString,this._loadJsonFile()}return a(t,"JsonConfig"),t.getInstance=function(){return t._instance||(t._instance=new t),t._instance},t.prototype._loadJsonFile=function(){var e="",r=process.env.APPLICATIONINSIGHTS_CONFIGURATION_CONTENT;if(r)e=r;else{var n="applicationinsights.json",o=edt.join(__dirname,"../../");this._tempDir=edt.join(o,n);var s=process.env[SJs];if(s){edt.isAbsolute(s)?this._tempDir=s:this._tempDir=edt.join(o,s);try{e=CJs.readFileSync(this._tempDir,"utf8")}catch(l){Gpr.warn("Failed to read JSON config file: ",l)}}else e=JSON.stringify(bJs.default)}try{var c=JSON.parse(e);c.disableStatsbeat!=null&&(this.disableStatsbeat=c.disableStatsbeat),c.disableAllExtendedMetrics!=null&&(this.disableAllExtendedMetrics=c.disableStatsbeat),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.noHttpAgentKeepAlive!=null&&(this.noHttpAgentKeepAlive=c.noHttpAgentKeepAlive),c.connectionString!=null&&(this.connectionString=c.connectionString),c.extendedMetricDisablers!=null&&(this.extendedMetricDisablers=c.extendedMetricDisablers),c.noDiagnosticChannel!=null&&(this.noDiagnosticChannel=c.noDiagnosticChannel),c.proxyHttpUrl!=null&&(this.proxyHttpUrl=c.proxyHttpUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.proxyHttpsUrl!=null&&(this.proxyHttpsUrl=c.proxyHttpsUrl),c.noPatchModules!=null&&(this.noPatchModules=c.noPatchModules),c.enableAutoWebSnippetInjection!=null&&(this.enableWebInstrumentation=c.enableAutoWebSnippetInjection,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.enableWebInstrumentation!=null&&(this.enableWebInstrumentation=c.enableWebInstrumentation,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation),c.webSnippetConnectionString!=null&&(this.webInstrumentationConnectionString=c.webSnippetConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConnectionString!=null&&(this.webInstrumentationConnectionString=c.webInstrumentationConnectionString,this.webSnippetConnectionString=this.webInstrumentationConnectionString),c.webInstrumentationConfig!=null&&(this.webInstrumentationConfig=c.webInstrumentationConfig),c.webInstrumentationSrc!=null&&(this.webInstrumentationSrc=c.webInstrumentationSrc),c.enableLoggerErrorToTrace!=null&&(this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace),this.endpointUrl=c.endpointUrl,this.maxBatchSize=c.maxBatchSize,this.maxBatchIntervalMs=c.maxBatchIntervalMs,this.disableAppInsights=c.disableAppInsights,this.samplingPercentage=c.samplingPercentage,this.correlationIdRetryIntervalMs=c.correlationIdRetryIntervalMs,this.correlationHeaderExcludedDomains=c.correlationHeaderExcludedDomains,this.ignoreLegacyHeaders=c.ignoreLegacyHeaders,this.distributedTracingMode=c.distributedTracingMode,this.enableAutoCollectExternalLoggers=c.enableAutoCollectExternalLoggers,this.enableAutoCollectConsole=c.enableAutoCollectConsole,this.enableLoggerErrorToTrace=c.enableLoggerErrorToTrace,this.enableAutoCollectExceptions=c.enableAutoCollectExceptions,this.enableAutoCollectPerformance=c.enableAutoCollectPerformance,this.enableAutoCollectExtendedMetrics=c.enableAutoCollectExtendedMetrics,this.enableAutoCollectPreAggregatedMetrics=c.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectHeartbeat=c.enableAutoCollectHeartbeat,this.enableAutoCollectRequests=c.enableAutoCollectRequests,this.enableAutoCollectDependencies=c.enableAutoCollectDependencies,this.enableAutoDependencyCorrelation=c.enableAutoDependencyCorrelation,this.enableAutoCollectIncomingRequestAzureFunctions=c.enableAutoCollectIncomingRequestAzureFunctions,this.enableUseAsyncHooks=c.enableUseAsyncHooks,this.enableUseDiskRetryCaching=c.enableUseDiskRetryCaching,this.enableResendInterval=c.enableResendInterval,this.enableMaxBytesOnDisk=c.enableMaxBytesOnDisk,this.enableInternalDebugLogging=c.enableInternalDebugLogging,this.enableInternalWarningLogging=c.enableInternalWarningLogging,this.enableSendLiveMetrics=c.enableSendLiveMetrics,this.quickPulseHost=c.quickPulseHost}catch(l){Gpr.warn("Invalid JSON config file: ",l)}},t})();ghe.JsonConfig=UJs});var $pr=I(rdt=>{"use strict";p();Object.defineProperty(rdt,"__esModule",{value:!0});rdt.makePatchingRequire=void 0;var QJs=require("path"),qJs=TL(),Cri=mp(),Sri=require("module"),jJs=Object.keys(process.binding("natives")),bri=Sri.prototype.require;function HJs(t){var e={};return a(function(n){var o=bri.apply(this,arguments);if(t[n]){var s=Sri._resolveFilename(n,this);if(e.hasOwnProperty(s))return e[s];var c=void 0;if(jJs.indexOf(n)<0)try{c=bri.call(this,QJs.join(n,"package.json")).version}catch{return o}else c=process.version.substring(1);var l=c.indexOf("-");l>=0&&(c=c.substring(0,l));for(var u=o,d=0,f=t[n];d{GJs.exports={name:"diagnostic-channel",version:"1.1.1",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"eslint ./ --fix",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js",debug:"mocha --inspect-brk ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^7.5.3"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"~8.0.0",mocha:"^3.2.0",rimraf:"^2.6.1",sinon:"1.17.6",typescript:"4.1.2"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}});var mp=I(qw=>{"use strict";p();Object.defineProperty(qw,"__esModule",{value:!0});qw.channel=qw.ContextPreservingEventEmitter=qw.trueFilter=qw.makePatchingRequire=void 0;var $Js=$pr(),VJs=$pr();Object.defineProperty(qw,"makePatchingRequire",{enumerable:!0,get:a(function(){return VJs.makePatchingRequire},"get")});var WJs=a(function(t){return!0},"trueFilter");qw.trueFilter=WJs;var xri=(function(){function t(){this.version=Tri().version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.modulesPatched=[],this.currentlyPublishing=!1}return a(t,"ContextPreservingEventEmitter"),t.prototype.shouldPublish=function(e){var r=this.subscribers[e];return r?r.some(function(n){var o=n.filter;return!o||o(!1)}):!1},t.prototype.publish=function(e,r){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var o={timestamp:Date.now(),data:r};this.currentlyPublishing=!0,n.forEach(function(s){var c=s.listener,l=s.filter;try{l&&l(!0)&&c(o)}catch{}}),this.currentlyPublishing=!1}}},t.prototype.subscribe=function(e,r,n,o){n===void 0&&(n=qw.trueFilter),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:r,filter:n,patchCallback:o});var s=this.checkIfModuleIsAlreadyPatched(e);s&&o&&o(s.name,s.version)},t.prototype.unsubscribe=function(e,r,n){n===void 0&&(n=qw.trueFilter);var o=this.subscribers[e];if(o){for(var s=0;s{p();co();Vpr=rb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(Ahe,"suppressTracing");a(wri,"unsuppressTracing");a(pH,"isTracingSuppressed")});var Rri,ndt,yhe,idt,Pri,kri,Dri,Wpr=_e(()=>{p();Rri="=",ndt=";",yhe=",",idt="baggage",Pri=180,kri=4096,Dri=8192});function odt(t){return t.reduce(function(e,r){var n=""+e+(e!==""?yhe:"")+r;return n.length>Dri?e:n},"")}function sdt(t){return t.getAllEntries().map(function(e){var r=zJs(e,2),n=r[0],o=r[1],s=encodeURIComponent(n)+"="+encodeURIComponent(o.value);return o.metadata!==void 0&&(s+=ndt+o.metadata.toString()),s})}function MDe(t){var e=t.split(ndt);if(!(e.length<=0)){var r=e.shift();if(r){var n=r.indexOf(Rri);if(!(n<=0)){var o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Bfe(e.join(ndt))),{key:o,value:s,metadata:c}}}}}function Nri(t){return typeof t!="string"||t.length===0?{}:t.split(yhe).map(function(e){return MDe(e)}).filter(function(e){return e!==void 0&&e.value.length>0}).reduce(function(e,r){return e[r.key]=r.value,e},{})}var zJs,zpr=_e(()=>{p();co();Wpr();zJs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(odt,"serializeKeyPairs");a(sdt,"getKeyPairs");a(MDe,"parsePairKeyValue");a(Nri,"parseKeyPairsIntoRecord")});var adt,Mri=_e(()=>{p();co();NDe();Wpr();zpr();adt=(function(){function t(){}return a(t,"W3CBaggagePropagator"),t.prototype.inject=function(e,r,n){var o=dT.getBaggage(e);if(!(!o||pH(e))){var s=sdt(o).filter(function(l){return l.length<=kri}).slice(0,Pri),c=odt(s);c.length>0&&n.set(r,idt,c)}},t.prototype.extract=function(e,r,n){var o=n.get(r,idt),s=Array.isArray(o)?o.join(yhe):o;if(!s)return e;var c={};if(s.length===0)return e;var l=s.split(yhe);return l.forEach(function(u){var d=MDe(u);if(d){var f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0?e:dT.setBaggage(e,dT.createBaggage(c))},t.prototype.fields=function(){return[idt]},t})()});var Ori,Bri=_e(()=>{p();Ori=(function(){function t(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}return a(t,"AnchoredClock"),t.prototype.now=function(){var e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e},t})()});function hH(t){var e,r,n={};if(typeof t!="object"||t==null)return n;try{for(var o=Lri(Object.entries(t)),s=o.next();!s.done;s=o.next()){var c=YJs(s.value,2),l=c[0],u=c[1];if(!Ypr(l)){Pn.warn("Invalid attribute key: "+l);continue}if(!ODe(u)){Pn.warn("Invalid attribute value set for key: "+l);continue}Array.isArray(u)?n[l]=u.slice():n[l]=u}}catch(d){e={error:d}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n}function Ypr(t){return typeof t=="string"&&t.length>0}function ODe(t){return t==null?!0:Array.isArray(t)?KJs(t):Fri(t)}function KJs(t){var e,r,n;try{for(var o=Lri(t),s=o.next();!s.done;s=o.next()){var c=s.value;if(c!=null){if(!n){if(Fri(c)){n=typeof c;continue}return!1}if(typeof c!==n)return!1}}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return!0}function Fri(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}var Lri,YJs,Uri=_e(()=>{p();co();Lri=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},YJs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s};a(hH,"sanitizeAttributes");a(Ypr,"isAttributeKey");a(ODe,"isAttributeValue");a(KJs,"isHomogeneousAttributeValueArray");a(Fri,"isValidPrimitiveAttributeValue")});function cdt(){return function(t){Pn.error(JJs(t))}}function JJs(t){return typeof t=="string"?t:JSON.stringify(ZJs(t))}function ZJs(t){for(var e={},r=t;r!==null;)Object.getOwnPropertyNames(r).forEach(function(n){if(!e[n]){var o=r[n];o&&(e[n]=String(o))}}),r=Object.getPrototypeOf(r);return e}var Kpr=_e(()=>{p();co();a(cdt,"loggingErrorHandler");a(JJs,"stringifyException");a(ZJs,"flattenException")});function qri(t){Qri=t}function ev(t){try{Qri(t)}catch{}}var Qri,Jpr=_e(()=>{p();Kpr();Qri=cdt();a(qri,"setGlobalErrorHandler");a(ev,"globalErrorHandler")});var Eb,Zpr=_e(()=>{p();(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Eb||(Eb={}))});function tZs(t){return eZs.indexOf(t)>-1}function nZs(t){return rZs.indexOf(t)>-1}function oZs(t){return iZs.indexOf(t)>-1}function sZs(t,e,r){if(!(typeof r[t]>"u")){var n=String(r[t]);e[t]=n.toLowerCase()==="true"}}function aZs(t,e,r,n,o){if(n===void 0&&(n=-1/0),o===void 0&&(o=1/0),typeof r[t]<"u"){var s=Number(r[t]);isNaN(s)||(so?e[t]=o:e[t]=s)}}function cZs(t,e,r,n){n===void 0&&(n=XJs);var o=r[t];typeof o=="string"&&(e[t]=o.split(n).map(function(s){return s.trim()}))}function uZs(t,e,r){var n=r[t];if(typeof n=="string"){var o=lZs[n.toUpperCase()];o!=null&&(e[t]=o)}}function LDe(t){var e={};for(var r in BDe){var n=r;switch(n){case"OTEL_LOG_LEVEL":uZs(n,e,t);break;default:if(tZs(n))sZs(n,e,t);else if(nZs(n))aZs(n,e,t);else if(oZs(n))cZs(n,e,t);else{var o=t[n];typeof o<"u"&&o!==null&&(e[n]=String(o))}}}return e}var XJs,eZs,rZs,iZs,_X,vX,Xpr,ehr,BDe,lZs,thr=_e(()=>{p();co();Zpr();XJs=",",eZs=["OTEL_SDK_DISABLED"];a(tZs,"isEnvVarABoolean");rZs=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];a(nZs,"isEnvVarANumber");iZs=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];a(oZs,"isEnvVarAList");_X=1/0,vX=128,Xpr=128,ehr=128,BDe={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:wa.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:_X,OTEL_ATTRIBUTE_COUNT_LIMIT:vX,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:_X,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:vX,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:_X,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:vX,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Xpr,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:ehr,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Eb.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};a(sZs,"parseBoolean");a(aZs,"parseNumber");a(cZs,"parseStringList");lZs={ALL:wa.ALL,VERBOSE:wa.VERBOSE,DEBUG:wa.DEBUG,INFO:wa.INFO,WARN:wa.WARN,ERROR:wa.ERROR,NONE:wa.NONE};a(uZs,"setLogLevelFromEnv");a(LDe,"parseEnvironment")});function jw(){var t=LDe(process.env);return Object.assign({},BDe,t)}function Ehe(){return LDe(process.env)}var jri=_e(()=>{p();thr();a(jw,"getEnv");a(Ehe,"getEnvWithoutDefaults")});var ldt,Hri=_e(()=>{p();ldt=typeof globalThis=="object"?globalThis:global});function Gri(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function udt(t){for(var e=new Uint8Array(t.length/2),r=0,n=0;n{p();a(Gri,"intValue");a(udt,"hexToBinary")});function ddt(t){return Buffer.from(udt(t)).toString("base64")}var $ri=_e(()=>{p();rhr();a(ddt,"hexToBase64")});function Vri(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(fdt[t-1]=1);return fdt.toString("hex",0,t)},"generateId")}var dZs,Wri,pdt,fdt,zri=_e(()=>{p();dZs=8,Wri=16,pdt=(function(){function t(){this.generateTraceId=Vri(Wri),this.generateSpanId=Vri(dZs)}return a(t,"RandomIdGenerator"),t})(),fdt=Buffer.allocUnsafe(Wri);a(Vri,"getIdGenerator")});var Yri,Hw,Kri=_e(()=>{p();Yri=require("perf_hooks"),Hw=Yri.performance});var hdt,nhr=_e(()=>{p();hdt="1.30.1"});var Jri=_e(()=>{p()});var Zri=_e(()=>{p();Jri()});var fZs,pZs,hZs,mZs,Xri,eni,tni,rni,gZs,nni,ini=_e(()=>{p();fZs="process.runtime.name",pZs="telemetry.sdk.name",hZs="telemetry.sdk.language",mZs="telemetry.sdk.version",Xri=fZs,eni=pZs,tni=hZs,rni=mZs,gZs="nodejs",nni=gZs});var oni=_e(()=>{p();ini()});var sni=_e(()=>{p()});var ani=_e(()=>{p()});var cni=_e(()=>{p();Zri();oni();sni();ani()});var _he,mH,lni=_e(()=>{p();nhr();cni();mH=(_he={},_he[eni]="opentelemetry",_he[Xri]="node",_he[tni]=nni,_he[rni]=hdt,_he)});function vhe(t){t.unref()}var uni=_e(()=>{p();a(vhe,"unrefTimer")});var dni=_e(()=>{p();jri();Hri();$ri();zri();Kri();lni();uni()});var ihr=_e(()=>{p();dni()});function S2(t){var e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*yZs);return[r,n]}function Che(){var t=Hw.timeOrigin;if(typeof t!="number"){var e=Hw;t=e.timing&&e.timing.fetchStart}return t}function FDe(t){var e=S2(Che()),r=S2(typeof t=="number"?t:Hw.now());return qDe(e,r)}function pni(t){if(bhe(t))return t;if(typeof t=="number")return t=mdt&&(r[1]-=mdt,r[0]+=1),r}var fni,AZs,yZs,mdt,Ani=_e(()=>{p();ihr();fni=9,AZs=6,yZs=Math.pow(10,AZs),mdt=Math.pow(10,fni);a(S2,"millisToHrTime");a(Che,"getTimeOrigin");a(FDe,"hrTime");a(pni,"timeInputToHrTime");a(gdt,"hrTimeDuration");a(hni,"hrTimeToTimeStamp");a(mni,"hrTimeToNanoseconds");a(gni,"hrTimeToMilliseconds");a(UDe,"hrTimeToMicroseconds");a(bhe,"isTimeInputHrTime");a(QDe,"isTimeInput");a(qDe,"addHrTimes")});var _T,yni=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(_T||(_T={}))});var EZs,Adt,Eni=_e(()=>{p();co();EZs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Adt=(function(){function t(e){e===void 0&&(e={});var r;this._propagators=(r=e.propagators)!==null&&r!==void 0?r:[],this._fields=Array.from(new Set(this._propagators.map(function(n){return typeof n.fields=="function"?n.fields():[]}).reduce(function(n,o){return n.concat(o)},[])))}return a(t,"CompositePropagator"),t.prototype.inject=function(e,r,n){var o,s;try{for(var c=EZs(this._propagators),l=c.next();!l.done;l=c.next()){var u=l.value;try{u.inject(e,r,n)}catch(d){Pn.warn("Failed to inject with "+u.constructor.name+". Err: "+d.message)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}},t.prototype.extract=function(e,r,n){return this._propagators.reduce(function(o,s){try{return s.extract(o,r,n)}catch(c){Pn.warn("Failed to extract with "+s.constructor.name+". Err: "+c.message)}return o},e)},t.prototype.fields=function(){return this._fields.slice()},t})()});function _ni(t){return CZs.test(t)}function vni(t){return bZs.test(t)&&!SZs.test(t)}var ohr,_Zs,vZs,CZs,bZs,SZs,Cni=_e(()=>{p();ohr="[_0-9a-z-*/]",_Zs="[a-z]"+ohr+"{0,255}",vZs="[a-z0-9]"+ohr+"{0,240}@[a-z]"+ohr+"{0,13}",CZs=new RegExp("^(?:"+_Zs+"|"+vZs+")$"),bZs=/^[ -~]{0,255}[!-~]$/,SZs=/,|=/;a(_ni,"validateKey");a(vni,"validateValue")});var bni,TZs,Sni,Tni,ydt,shr=_e(()=>{p();Cni();bni=32,TZs=512,Sni=",",Tni="=",ydt=(function(){function t(e){this._internalState=new Map,e&&this._parse(e)}return a(t,"TraceState"),t.prototype.set=function(e,r){var n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n},t.prototype.unset=function(e){var r=this._clone();return r._internalState.delete(e),r},t.prototype.get=function(e){return this._internalState.get(e)},t.prototype.serialize=function(){var e=this;return this._keys().reduce(function(r,n){return r.push(n+Tni+e.get(n)),r},[]).join(Sni)},t.prototype._parse=function(e){e.length>TZs||(this._internalState=e.split(Sni).reverse().reduce(function(r,n){var o=n.trim(),s=o.indexOf(Tni);if(s!==-1){var c=o.slice(0,s),l=o.slice(s+1,n.length);_ni(c)&&vni(l)&&r.set(c,l)}return r},new Map),this._internalState.size>bni&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,bni))))},t.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},t.prototype._clone=function(){var e=new t;return e._internalState=new Map(this._internalState),e},t})()});function ahr(t){var e=kZs.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var jDe,HDe,IZs,xZs,wZs,RZs,PZs,kZs,Edt,Ini=_e(()=>{p();co();NDe();shr();jDe="traceparent",HDe="tracestate",IZs="00",xZs="(?!ff)[\\da-f]{2}",wZs="(?![0]{32})[\\da-f]{32}",RZs="(?![0]{16})[\\da-f]{16}",PZs="[\\da-f]{2}",kZs=new RegExp("^\\s?("+xZs+")-("+wZs+")-("+RZs+")-("+PZs+")(-.*)?\\s?$");a(ahr,"parseTraceParent");Edt=(function(){function t(){}return a(t,"W3CTraceContextPropagator"),t.prototype.inject=function(e,r,n){var o=_u.getSpanContext(e);if(!(!o||pH(e)||!nb(o))){var s=IZs+"-"+o.traceId+"-"+o.spanId+"-0"+Number(o.traceFlags||Af.NONE).toString(16);n.set(r,jDe,s),o.traceState&&n.set(r,HDe,o.traceState.serialize())}},t.prototype.extract=function(e,r,n){var o=n.get(r,jDe);if(!o)return e;var s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;var c=ahr(s);if(!c)return e;c.isRemote=!0;var l=n.get(r,HDe);if(l){var u=Array.isArray(l)?l.join(","):l;c.traceState=new ydt(typeof u=="string"?u:void 0)}return _u.setSpanContext(e,c)},t.prototype.fields=function(){return[jDe,HDe]},t})()});function xni(t,e){return t.setValue(chr,e)}function wni(t){return t.deleteValue(chr)}function Rni(t){return t.getValue(chr)}var chr,_dt,Pni=_e(()=>{p();co();chr=rb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(_dt||(_dt={}));a(xni,"setRPCMetadata");a(wni,"deleteRPCMetadata");a(Rni,"getRPCMetadata")});var GDe,lhr=_e(()=>{p();co();GDe=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:ib.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var She,uhr=_e(()=>{p();co();She=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:ib.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var kni,Dni=_e(()=>{p();co();Jpr();lhr();uhr();kni=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new She),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new She,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new GDe,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new She,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new GDe}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=_u.getSpanContext(e);return!l||!nb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Af.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Af.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var Nni,Mni=_e(()=>{p();co();Nni=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:uZ(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function FZs(t,e){return function(r){return t(e(r))}}function dhr(t){if(!UZs(t)||QZs(t)!==DZs)return!1;var e=LZs(t);if(e===null)return!0;var r=Lni.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Oni.call(r)===BZs}function UZs(t){return t!=null&&typeof t=="object"}function QZs(t){return t==null?t===void 0?MZs:NZs:CX&&CX in Object(t)?qZs(t):jZs(t)}function qZs(t){var e=Lni.call(t,CX),r=t[CX],n=!1;try{t[CX]=void 0,n=!0}catch{}var o=Fni.call(t);return n&&(e?t[CX]=r:delete t[CX]),o}function jZs(t){return Fni.call(t)}var DZs,NZs,MZs,OZs,Oni,BZs,LZs,Bni,Lni,CX,Fni,Uni=_e(()=>{p();DZs="[object Object]",NZs="[object Null]",MZs="[object Undefined]",OZs=Function.prototype,Oni=OZs.toString,BZs=Oni.call(Object),LZs=FZs(Object.getPrototypeOf,Object),Bni=Object.prototype,Lni=Bni.hasOwnProperty,CX=Symbol?Symbol.toStringTag:void 0,Fni=Bni.toString;a(FZs,"overArg");a(dhr,"isPlainObject");a(UZs,"isObjectLike");a(QZs,"baseGetTag");a(qZs,"getRawTag");a(jZs,"objectToString")});function bdt(){for(var t=[],e=0;e0;)r=qni(r,t.shift(),0,n);return r}function fhr(t){return Cdt(t)?t.slice():t}function qni(t,e,r,n){r===void 0&&(r=0);var o;if(!(r>HZs)){if(r++,vdt(t)||vdt(e)||jni(e))o=fhr(e);else if(Cdt(t)){if(o=t.slice(),Cdt(e))for(var s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{var f=o[u],h=d;if(Qni(t,u,n)||Qni(e,u,n))delete o[u];else{if($De(f)&&$De(h)){var m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=qni(o[u],d,r,n)}}}}else o=e;return o}}function Qni(t,e,r){for(var n=r.get(t[e])||[],o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function GZs(t,e){return!(!dhr(t)||!dhr(e))}var HZs,Hni=_e(()=>{p();Uni();HZs=20;a(bdt,"merge");a(fhr,"takeValue");a(qni,"mergeTwoObjects");a(Qni,"wasObjectReferenced");a(Cdt,"isArray");a(jni,"isFunction");a($De,"isObject");a(vdt,"isPrimitive");a(GZs,"shouldMerge")});function Gni(t,e){var r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new phr("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(function(o){return clearTimeout(r),o},function(o){throw clearTimeout(r),o})}var $Zs,phr,$ni=_e(()=>{p();$Zs=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),phr=(function(t){$Zs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return a(e,"TimeoutError"),e})(Error);a(Gni,"callWithTimeout")});function hhr(t,e){return typeof e=="string"?t===e:!!t.match(e)}function Vni(t,e){var r,n;if(!e)return!1;try{for(var o=VZs(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(hhr(t,c))return!0}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1}var VZs,Wni=_e(()=>{p();VZs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};a(hhr,"urlMatches");a(Vni,"isUrlIgnored")});function zni(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Yni=_e(()=>{p();a(zni,"isWrapped")});var Kni,Jni=_e(()=>{p();Kni=(function(){function t(){var e=this;this._promise=new Promise(function(r,n){e._resolve=r,e._reject=n})}return a(t,"Deferred"),Object.defineProperty(t.prototype,"promise",{get:a(function(){return this._promise},"get"),enumerable:!1,configurable:!0}),t.prototype.resolve=function(e){this._resolve(e)},t.prototype.reject=function(e){this._reject(e)},t})()});var WZs,zZs,The,Zni=_e(()=>{p();Jni();WZs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},zZs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();NDe();a(Xni,"_export")});var tii={};xi(tii,{AlwaysOffSampler:()=>GDe,AlwaysOnSampler:()=>She,AnchoredClock:()=>Ori,BindOnceFuture:()=>The,CompositePropagator:()=>Adt,DEFAULT_ATTRIBUTE_COUNT_LIMIT:()=>vX,DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT:()=>_X,DEFAULT_ENVIRONMENT:()=>BDe,DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:()=>Xpr,DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:()=>ehr,ExportResultCode:()=>_T,ParentBasedSampler:()=>kni,RPCType:()=>_dt,RandomIdGenerator:()=>pdt,SDK_INFO:()=>mH,TRACE_PARENT_HEADER:()=>jDe,TRACE_STATE_HEADER:()=>HDe,TimeoutError:()=>phr,TraceIdRatioBasedSampler:()=>Nni,TraceState:()=>ydt,TracesSamplerValues:()=>Eb,VERSION:()=>hdt,W3CBaggagePropagator:()=>adt,W3CTraceContextPropagator:()=>Edt,_globalThis:()=>ldt,addHrTimes:()=>qDe,baggageUtils:()=>YZs,callWithTimeout:()=>Gni,deleteRPCMetadata:()=>wni,getEnv:()=>jw,getEnvWithoutDefaults:()=>Ehe,getRPCMetadata:()=>Rni,getTimeOrigin:()=>Che,globalErrorHandler:()=>ev,hexToBase64:()=>ddt,hexToBinary:()=>udt,hrTime:()=>FDe,hrTimeDuration:()=>gdt,hrTimeToMicroseconds:()=>UDe,hrTimeToMilliseconds:()=>gni,hrTimeToNanoseconds:()=>mni,hrTimeToTimeStamp:()=>hni,internal:()=>mhr,isAttributeKey:()=>Ypr,isAttributeValue:()=>ODe,isTimeInput:()=>QDe,isTimeInputHrTime:()=>bhe,isTracingSuppressed:()=>pH,isUrlIgnored:()=>Vni,isWrapped:()=>zni,loggingErrorHandler:()=>cdt,merge:()=>bdt,millisToHrTime:()=>S2,otperformance:()=>Hw,parseEnvironment:()=>LDe,parseTraceParent:()=>ahr,sanitizeAttributes:()=>hH,setGlobalErrorHandler:()=>qri,setRPCMetadata:()=>xni,suppressTracing:()=>Ahe,timeInputToHrTime:()=>pni,unrefTimer:()=>vhe,unsuppressTracing:()=>wri,urlMatches:()=>hhr});var YZs,mhr,_b=_e(()=>{p();Mri();Bri();Uri();Jpr();Kpr();Ani();rhr();yni();zpr();ihr();Eni();Ini();Pni();lhr();uhr();Dni();Mni();NDe();shr();thr();Hni();Zpr();$ni();Wni();Yni();Zni();nhr();eii();YZs={getKeyPairs:sdt,serializeKeyPairs:odt,parseKeyPairsIntoRecord:Nri,parsePairKeyValue:MDe},mhr={_export:Xni}});var KZs,JZs,ZZs,Sdt,Tdt,rii,nii=_e(()=>{p();KZs="exception.type",JZs="exception.message",ZZs="exception.stacktrace",Sdt=KZs,Tdt=JZs,rii=ZZs});var iii=_e(()=>{p();nii()});var oii=_e(()=>{p()});var sii=_e(()=>{p();oii()});var aii=_e(()=>{p()});var cii=_e(()=>{p()});var lii=_e(()=>{p();iii();sii();aii();cii()});var uii,dii=_e(()=>{p();uii="exception"});var ghr,XZs,fii,eXs,Idt,Ahr=_e(()=>{p();co();_b();lii();dii();ghr=function(){return ghr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fii=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},eXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(Pn.warn("Invalid attribute value set for key: "+e),this)},t.prototype.setAttributes=function(e){var r,n;try{for(var o=XZs(Object.entries(e)),s=o.next();!s.done;s=o.next()){var c=fii(s.value,2),l=c[0],u=c[1];this.setAttribute(l,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return this},t.prototype.addEvent=function(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return Pn.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Pn.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),QDe(r)&&(QDe(n)||(n=r),r=void 0);var o=hH(r);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this},t.prototype.addLink=function(e){return this.links.push(e),this},t.prototype.addLinks=function(e){var r;return(r=this.links).push.apply(r,eXs([],fii(e),!1)),this},t.prototype.setStatus=function(e){return this._isSpanEnded()?this:(this.status=ghr({},e),this.status.message!=null&&typeof e.message!="string"&&(Pn.warn("Dropping invalid status.message of type '"+typeof e.message+"', expected 'string'"),delete this.status.message),this)},t.prototype.updateName=function(e){return this._isSpanEnded()?this:(this.name=e,this)},t.prototype.end=function(e){if(this._isSpanEnded()){Pn.error(this.name+" "+this._spanContext.traceId+"-"+this._spanContext.spanId+" - You can only call end() on a span once.");return}this._ended=!0,this.endTime=this._getTime(e),this._duration=gdt(this.startTime,this.endTime),this._duration[0]<0&&(Pn.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Pn.warn("Dropped "+this._droppedEventsCount+" events because eventCountLimit reached"),this._spanProcessor.onEnd(this)},t.prototype._getTime=function(e){if(typeof e=="number"&&e<=Hw.now())return FDe(e+this._performanceOffset);if(typeof e=="number")return S2(e);if(e instanceof Date)return S2(e.getTime());if(bhe(e))return e;if(this._startTimeProvided)return S2(Date.now());var r=Hw.now()-this._performanceStartTime;return qDe(this.startTime,S2(r))},t.prototype.isRecording=function(){return this._ended===!1},t.prototype.recordException=function(e,r){var n={};typeof e=="string"?n[Tdt]=e:e&&(e.code?n[Sdt]=e.code.toString():e.name&&(n[Sdt]=e.name),e.message&&(n[Tdt]=e.message),e.stack&&(n[rii]=e.stack)),n[Sdt]||n[Tdt]?this.addEvent(uii,n,r):Pn.warn("Failed to record an exception "+e)},Object.defineProperty(t.prototype,"duration",{get:a(function(){return this._duration},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ended",{get:a(function(){return this._ended},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedAttributesCount",{get:a(function(){return this._droppedAttributesCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedEventsCount",{get:a(function(){return this._droppedEventsCount},"get"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"droppedLinksCount",{get:a(function(){return this._droppedLinksCount},"get"),enumerable:!1,configurable:!0}),t.prototype._isSpanEnded=function(){return this._ended&&Pn.warn("Can not execute the operation on ended Span {traceId: "+this._spanContext.traceId+", spanId: "+this._spanContext.spanId+"}"),this._ended},t.prototype._truncateToLimitUtil=function(e,r){return e.length<=r?e:e.substring(0,r)},t.prototype._truncateToSize=function(e){var r=this,n=this._attributeValueLengthLimit;return n<=0?(Pn.warn("Attribute value limit must be positive, got "+n),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(function(o){return typeof o=="string"?r._truncateToLimitUtil(o,n):o}):e},t})()});var T2,VDe=_e(()=>{p();(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(T2||(T2={}))});var gH,xdt=_e(()=>{p();VDe();gH=(function(){function t(){}return a(t,"AlwaysOffSampler"),t.prototype.shouldSample=function(){return{decision:T2.NOT_RECORD}},t.prototype.toString=function(){return"AlwaysOffSampler"},t})()});var U5,wdt=_e(()=>{p();VDe();U5=(function(){function t(){}return a(t,"AlwaysOnSampler"),t.prototype.shouldSample=function(){return{decision:T2.RECORD_AND_SAMPLED}},t.prototype.toString=function(){return"AlwaysOnSampler"},t})()});var Ihe,yhr=_e(()=>{p();co();_b();xdt();wdt();Ihe=(function(){function t(e){var r,n,o,s;this._root=e.root,this._root||(ev(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new U5),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new U5,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new gH,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new U5,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new gH}return a(t,"ParentBasedSampler"),t.prototype.shouldSample=function(e,r,n,o,s,c){var l=_u.getSpanContext(e);return!l||!nb(l)?this._root.shouldSample(e,r,n,o,s,c):l.isRemote?l.traceFlags&Af.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,o,s,c):this._remoteParentNotSampled.shouldSample(e,r,n,o,s,c):l.traceFlags&Af.SAMPLED?this._localParentSampled.shouldSample(e,r,n,o,s,c):this._localParentNotSampled.shouldSample(e,r,n,o,s,c)},t.prototype.toString=function(){return"ParentBased{root="+this._root.toString()+", remoteParentSampled="+this._remoteParentSampled.toString()+", remoteParentNotSampled="+this._remoteParentNotSampled.toString()+", localParentSampled="+this._localParentSampled.toString()+", localParentNotSampled="+this._localParentNotSampled.toString()+"}"},t})()});var WDe,Ehr=_e(()=>{p();co();VDe();WDe=(function(){function t(e){e===void 0&&(e=0),this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}return a(t,"TraceIdRatioBasedSampler"),t.prototype.shouldSample=function(e,r){return{decision:uZ(r)&&this._accumulate(r)=1?1:e<=0?0:e},t.prototype._accumulate=function(e){for(var r=0,n=0;n>>0}return r},t})()});function Rdt(){var t=jw();return{sampler:_hr(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}function _hr(t){switch(t===void 0&&(t=jw()),t.OTEL_TRACES_SAMPLER){case Eb.AlwaysOn:return new U5;case Eb.AlwaysOff:return new gH;case Eb.ParentBasedAlwaysOn:return new Ihe({root:new U5});case Eb.ParentBasedAlwaysOff:return new Ihe({root:new gH});case Eb.TraceIdRatio:return new WDe(pii(t));case Eb.ParentBasedTraceIdRatio:return new Ihe({root:new WDe(pii(t))});default:return Pn.error('OTEL_TRACES_SAMPLER value "'+t.OTEL_TRACES_SAMPLER+" invalid, defaulting to "+tXs+'".'),new U5}}function pii(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Pn.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to "+xhe+"."),xhe;var e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Pn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is invalid, defaulting to "+xhe+"."),xhe):e<0||e>1?(Pn.error("OTEL_TRACES_SAMPLER_ARG="+t.OTEL_TRACES_SAMPLER_ARG+" was given, but it is out of range ([0..1]), defaulting to "+xhe+"."),xhe):e}var tXs,xhe,vhr=_e(()=>{p();co();_b();xdt();wdt();yhr();Ehr();tXs=Eb.AlwaysOn,xhe=1;a(Rdt,"loadDefaultConfig");a(_hr,"buildSamplerFromEnv");a(pii,"getSamplerProbabilityFromEnv")});function hii(t){var e={sampler:_hr()},r=Rdt(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}function mii(t){var e,r,n,o,s,c,l,u,d,f,h,m,g=Object.assign({},t.spanLimits),A=Ehe();return g.attributeCountLimit=(c=(s=(o=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&o!==void 0?o:A.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:A.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&c!==void 0?c:vX,g.attributeValueLengthLimit=(m=(h=(f=(u=(l=t.spanLimits)===null||l===void 0?void 0:l.attributeValueLengthLimit)!==null&&u!==void 0?u:(d=t.generalLimits)===null||d===void 0?void 0:d.attributeValueLengthLimit)!==null&&f!==void 0?f:A.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&h!==void 0?h:A.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&m!==void 0?m:_X,Object.assign({},t,{spanLimits:g})}var Chr=_e(()=>{p();vhr();_b();a(hii,"mergeConfig");a(mii,"reconfigureLimits")});var gii,Aii=_e(()=>{p();co();_b();gii=(function(){function t(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;var n=jw();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new The(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Pn.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}return a(t,"BatchSpanProcessorBase"),t.prototype.forceFlush=function(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()},t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Af.SAMPLED)!==0&&this._addToBuffer(e)},t.prototype.shutdown=function(){return this._shutdownOnce.call()},t.prototype._shutdown=function(){var e=this;return Promise.resolve().then(function(){return e.onShutdown()}).then(function(){return e._flushAll()}).then(function(){return e._exporter.shutdown()})},t.prototype._addToBuffer=function(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Pn.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Pn.warn("Dropped "+this._droppedSpansCount+" spans because maxQueueSize reached"),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()},t.prototype._flushAll=function(){var e=this;return new Promise(function(r,n){for(var o=[],s=Math.ceil(e._finishedSpans.length/e._maxExportBatchSize),c=0,l=s;c0&&(e._clearTimer(),e._maybeStartTimer())}).catch(function(n){e._isExporting=!1,ev(n)})},"flush");if(this._finishedSpans.length>=this._maxExportBatchSize)return r();this._timer===void 0&&(this._timer=setTimeout(function(){return r()},this._scheduledDelayMillis),vhe(this._timer))}},t.prototype._clearTimer=function(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)},t})()});var rXs,whe,yii=_e(()=>{p();Aii();rXs=(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),whe=(function(t){rXs(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"BatchSpanProcessor"),e.prototype.onShutdown=function(){},e})(gii)});function Eii(t){return a(function(){for(var r=0;r>>0,r*4);for(var r=0;r0);r++)r===t-1&&(Pdt[t-1]=1);return Pdt.toString("hex",0,t)},"generateId")}var nXs,_ii,Rhe,Pdt,vii=_e(()=>{p();nXs=8,_ii=16,Rhe=(function(){function t(){this.generateTraceId=Eii(_ii),this.generateSpanId=Eii(nXs)}return a(t,"RandomIdGenerator"),t})(),Pdt=Buffer.allocUnsafe(_ii);a(Eii,"getIdGenerator")});var Cii=_e(()=>{p();yii();vii()});var kdt=_e(()=>{p();Cii()});var Ddt,bhr=_e(()=>{p();co();_b();Ahr();Chr();kdt();Ddt=(function(){function t(e,r,n){this._tracerProvider=n;var o=hii(r);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=r.idGenerator||new Rhe,this.resource=n.resource,this.instrumentationLibrary=e}return a(t,"Tracer"),t.prototype.startSpan=function(e,r,n){var o,s,c;r===void 0&&(r={}),n===void 0&&(n=Eg.active()),r.root&&(n=_u.deleteSpan(n));var l=_u.getSpan(n);if(pH(n)){Pn.debug("Instrumentation suppressed, returning Noop Span");var u=_u.wrapSpanContext(Lfe);return u}var d=l?.spanContext(),f=this._idGenerator.generateSpanId(),h,m,g;!d||!_u.isSpanContextValid(d)?h=this._idGenerator.generateTraceId():(h=d.traceId,m=d.traceState,g=d.spanId);var A=(o=r.kind)!==null&&o!==void 0?o:Ffe.INTERNAL,y=((s=r.links)!==null&&s!==void 0?s:[]).map(function(R){return{context:R.context,attributes:hH(R.attributes)}}),E=hH(r.attributes),_=this._sampler.shouldSample(n,h,e,A,E,y);m=(c=_.traceState)!==null&&c!==void 0?c:m;var v=_.decision===ib.RECORD_AND_SAMPLED?Af.SAMPLED:Af.NONE,b={traceId:h,spanId:f,traceFlags:v,traceState:m};if(_.decision===ib.NOT_RECORD){Pn.debug("Recording is off, propagating context in a non-recording span");var u=_u.wrapSpanContext(b);return u}var T=hH(Object.assign(E,_.attributes)),w=new Idt(this,n,e,b,A,g,y,r.startTime,void 0,T);return w},t.prototype.startActiveSpan=function(e,r,n,o){var s,c,l;if(!(arguments.length<2)){arguments.length===2?l=r:arguments.length===3?(s=r,l=n):(s=r,c=n,l=o);var u=c??Eg.active(),d=this.startSpan(e,s,u),f=_u.setSpan(u,d);return Eg.with(f,l,void 0,d)}},t.prototype.getGeneralLimits=function(){return this._generalLimits},t.prototype.getSpanLimits=function(){return this._spanLimits},t.prototype.getActiveSpanProcessor=function(){return this._tracerProvider.getActiveSpanProcessor()},t})()});var bii=_e(()=>{p()});var Sii=_e(()=>{p();bii()});var iXs,oXs,sXs,aXs,Tii,Shr,Thr,Ihr,Iii=_e(()=>{p();iXs="service.name",oXs="telemetry.sdk.name",sXs="telemetry.sdk.language",aXs="telemetry.sdk.version",Tii=iXs,Shr=oXs,Thr=sXs,Ihr=aXs});var xii=_e(()=>{p();Iii()});var wii=_e(()=>{p()});var Rii=_e(()=>{p()});var Pii=_e(()=>{p();Sii();xii();wii();Rii()});function Ndt(){return"unknown_service:"+process.argv0}var kii=_e(()=>{p();a(Ndt,"defaultServiceName")});var Dii=_e(()=>{p();kii()});var Nii=_e(()=>{p();Dii()});var AH,cXs,lXs,uXs,Mdt,Mii=_e(()=>{p();co();Pii();_b();Nii();AH=function(){return AH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},Mdt=(function(){function t(e,r){var n=this,o;this._attributes=e,this.asyncAttributesPending=r!=null,this._syncAttributes=(o=this._attributes)!==null&&o!==void 0?o:{},this._asyncAttributesPromise=r?.then(function(s){return n._attributes=Object.assign({},n._attributes,s),n.asyncAttributesPending=!1,s},function(s){return Pn.debug("a resource's async attributes promise rejected: %s",s),n.asyncAttributesPending=!1,{}})}return a(t,"Resource"),t.empty=function(){return t.EMPTY},t.default=function(){var e;return new t((e={},e[Tii]=Ndt(),e[Thr]=mH[Thr],e[Shr]=mH[Shr],e[Ihr]=mH[Ihr],e))},Object.defineProperty(t.prototype,"attributes",{get:a(function(){var e;return this.asyncAttributesPending&&Pn.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}},"get"),enumerable:!1,configurable:!0}),t.prototype.waitForAsyncAttributes=function(){return cXs(this,void 0,void 0,function(){return lXs(this,function(e){switch(e.label){case 0:return this.asyncAttributesPending?[4,this._asyncAttributesPromise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.merge=function(e){var r=this,n;if(!e)return this;var o=AH(AH({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(o);var s=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(function(c){var l,u=uXs(c,2),d=u[0],f=u[1];return AH(AH(AH(AH({},r._syncAttributes),d),(l=e._syncAttributes)!==null&&l!==void 0?l:e.attributes),f)});return new t(o,s)},t.EMPTY=new t({}),t})()});var Oii=_e(()=>{p();Mii()});var Odt,xhr,Bii=_e(()=>{p();_b();Odt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xhr=(function(){function t(e){this._spanProcessors=e}return a(t,"MultiSpanProcessor"),t.prototype.forceFlush=function(){var e,r,n=[];try{for(var o=Odt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.forceFlush())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l){Promise.all(n).then(function(){l()}).catch(function(u){ev(u||new Error("MultiSpanProcessor: forceFlush failed")),l()})})},t.prototype.onStart=function(e,r){var n,o;try{for(var s=Odt(this._spanProcessors),c=s.next();!c.done;c=s.next()){var l=c.value;l.onStart(e,r)}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},t.prototype.onEnd=function(e){var r,n;try{for(var o=Odt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;c.onEnd(e)}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.shutdown=function(){var e,r,n=[];try{for(var o=Odt(this._spanProcessors),s=o.next();!s.done;s=o.next()){var c=s.value;n.push(c.shutdown())}}catch(l){e={error:l}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return new Promise(function(l,u){Promise.all(n).then(function(){l()},u)})},t})()});var Bdt,whr=_e(()=>{p();Bdt=(function(){function t(){}return a(t,"NoopSpanProcessor"),t.prototype.onStart=function(e,r){},t.prototype.onEnd=function(e){},t.prototype.shutdown=function(){return Promise.resolve()},t.prototype.forceFlush=function(){return Promise.resolve()},t})()});var dXs,fXs,VF,Lii,Fii=_e(()=>{p();co();_b();Oii();bhr();vhr();Bii();whr();kdt();Chr();dXs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},fXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n0?o(c):n()}).catch(function(s){return o([s])})})},t.prototype.shutdown=function(){return this.activeSpanProcessor.shutdown()},t.prototype._getPropagator=function(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()},t.prototype._getSpanExporter=function(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()},t.prototype._buildPropagatorFromEnv=function(){var e=this,r=Array.from(new Set(jw().OTEL_PROPAGATORS)),n=r.map(function(s){var c=e._getPropagator(s);return c||Pn.warn('Propagator "'+s+'" requested through environment variable is unavailable.'),c}),o=n.reduce(function(s,c){return c&&s.push(c),s},[]);if(o.length!==0)return r.length===1?o[0]:new Adt({propagators:o})},t.prototype._buildExporterFromEnv=function(){var e=jw().OTEL_TRACES_EXPORTER;if(!(e==="none"||e==="")){var r=this._getSpanExporter(e);return r||Pn.error('Exporter "'+e+'" requested through environment variable is unavailable.'),r}},t._registeredPropagators=new Map([["tracecontext",function(){return new Edt}],["baggage",function(){return new adt}]]),t._registeredExporters=new Map,t})()});var pXs,Uii,Qii=_e(()=>{p();_b();pXs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Uii=(function(){function t(){}return a(t,"ConsoleSpanExporter"),t.prototype.export=function(e,r){return this._sendSpans(e,r)},t.prototype.shutdown=function(){return this._sendSpans([]),this.forceFlush()},t.prototype.forceFlush=function(){return Promise.resolve()},t.prototype._exportInfo=function(e){var r;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:UDe(e.startTime),duration:UDe(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}},t.prototype._sendSpans=function(e,r){var n,o;try{for(var s=pXs(e),c=s.next();!c.done;c=s.next()){var l=c.value;console.dir(this._exportInfo(l),{depth:3})}}catch(u){n={error:u}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(r)return r({code:_T.SUCCESS})},t})()});var hXs,mXs,qii,jii=_e(()=>{p();_b();hXs=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,s=[],c;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(l){c={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s},mXs=function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{p();co();_b();gXs=function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},AXs=function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]gH,AlwaysOnSampler:()=>U5,BasicTracerProvider:()=>Lii,BatchSpanProcessor:()=>whe,ConsoleSpanExporter:()=>Uii,ForceFlushState:()=>VF,InMemorySpanExporter:()=>qii,NoopSpanProcessor:()=>Bdt,ParentBasedSampler:()=>Ihe,RandomIdGenerator:()=>Rhe,SamplingDecision:()=>T2,SimpleSpanProcessor:()=>Hii,Span:()=>Idt,TraceIdRatioBasedSampler:()=>WDe,Tracer:()=>Ddt});var Vii=_e(()=>{p();bhr();Fii();kdt();Qii();jii();Gii();whr();xdt();wdt();yhr();Ehr();VDe();Ahr()});var zDe,Wii,Rhr=_e(()=>{p();zDe=class{static{a(this,"NoopLogger")}emit(e){}},Wii=new zDe});var Phr,Ldt,khr=_e(()=>{p();Rhr();Phr=class{static{a(this,"NoopLoggerProvider")}getLogger(e,r,n){return new zDe}},Ldt=new Phr});var Fdt,zii=_e(()=>{p();Rhr();Fdt=class{static{a(this,"ProxyLogger")}constructor(e,r,n,o){this._provider=e,this.name=r,this.version=n,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Wii}}});var YDe,Yii=_e(()=>{p();khr();zii();YDe=class{static{a(this,"ProxyLoggerProvider")}getLogger(e,r,n){var o;return(o=this.getDelegateLogger(e,r,n))!==null&&o!==void 0?o:new Fdt(this,e,r,n)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Ldt}setDelegate(e){this._delegate=e}getDelegateLogger(e,r,n){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,r,n)}}});var Udt,Kii=_e(()=>{p();Udt=typeof globalThis=="object"?globalThis:global});var Jii=_e(()=>{p();Kii()});var Zii=_e(()=>{p();Jii()});function Xii(t,e,r){return n=>n===t?e:r}var KDe,Phe,Dhr,eoi=_e(()=>{p();Zii();KDe=Symbol.for("io.opentelemetry.js.api.logs"),Phe=Udt;a(Xii,"makeGetter");Dhr=1});var Qdt,toi=_e(()=>{p();eoi();khr();Yii();Qdt=class t{static{a(this,"LogsAPI")}constructor(){this._proxyLoggerProvider=new YDe}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Phe[KDe]?this.getLoggerProvider():(Phe[KDe]=Xii(Dhr,e,Ldt),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,r;return(r=(e=Phe[KDe])===null||e===void 0?void 0:e.call(Phe,Dhr))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(e,r,n){return this.getLoggerProvider().getLogger(e,r,n)}disable(){delete Phe[KDe],this._proxyLoggerProvider=new YDe}}});var qdt,Nhr=_e(()=>{p();toi();qdt=Qdt.getInstance()});function roi(t,e,r,n){for(let o=0,s=t.length;oe.disable())}var ioi=_e(()=>{p();a(roi,"enableInstrumentations");a(noi,"disableInstrumentations")});function ooi(t){let e=t.tracerProvider||_u.getTracerProvider(),r=t.meterProvider||dZ.getMeterProvider(),n=t.loggerProvider||qdt.getLoggerProvider(),o=t.instrumentations?.flat()??[];return roi(o,e,r,n),()=>{noi(o)}}var soi=_e(()=>{p();co();Nhr();ioi();a(ooi,"registerInstrumentations")});function foi(t,e,r){if(!_Xs(t))return Pn.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let n=SXs(t);if(!n)return!1;let o=[],s=poi(n,e,o,r);return s&&!r?.includePrerelease?CXs(n,o):s}function _Xs(t){return typeof t=="string"&&doi.test(t)}function poi(t,e,r,n){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(Mhr(t,s,r,n))return!0;return!1}else if(e.includes(" - "))e=$Xs(e,n);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!Mhr(t,s,r,n))return!1;return!0}return Mhr(t,e,r,n)}function Mhr(t,e,r,n){if(e=bXs(e,n),e.includes(" "))return poi(t,e,r,n);{let o=TXs(e);return r.push(o),vXs(t,o)}}function vXs(t,e){if(e.invalid)return!1;if(!e.version||Bhr(e.version))return!0;let r=coi(t.versionSegments||[],e.versionSegments||[]);if(r===0){let n=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!n.length&&!o.length?r=0:!n.length&&o.length?r=1:n.length&&!o.length?r=-1:r=coi(n,o)}return EXs[e.op]?.includes(r)}function CXs(t,e){return t.prerelease?e.some(r=>r.prerelease&&r.version===t.version):!0}function bXs(t,e){return t=t.trim(),t=HXs(t,e),t=jXs(t),t=GXs(t,e),t=t.trim(),t}function tv(t){return!t||t.toLowerCase()==="x"||t==="*"}function SXs(t){let e=t.match(doi);if(!e){Pn.error(`Invalid version: ${t}`);return}let r=e.groups.version,n=e.groups.prerelease,o=e.groups.build,s=r.split("."),c=n?.split(".");return{op:void 0,version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:n,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function TXs(t){if(!t)return{};let e=t.match(yXs);if(!e)return Pn.error(`Invalid range: ${t}`),{invalid:!0};let r=e.groups.op,n=e.groups.version,o=e.groups.prerelease,s=e.groups.build,c=n.split("."),l=o?.split(".");return r==="=="&&(r="="),{op:r||"=",version:n,versionSegments:c,versionSegmentCount:c.length,prerelease:o,prereleaseSegments:l,prereleaseSegmentCount:l?l.length:0,build:s}}function Bhr(t){return t==="*"||t==="x"||t==="X"}function aoi(t){let e=parseInt(t,10);return isNaN(e)?t:e}function IXs(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function xXs(t,e){if(Bhr(t)||Bhr(e))return 0;let[r,n]=IXs(aoi(t),aoi(e));return r>n?1:r{let l;return tv(n)?l="":tv(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:tv(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:c?l=`>=${n}.${o}.${s}-${c} <${n}.${+o+1}.0-0`:l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,l})}function HXs(t,e){let r=qXs,n=e?.includePrerelease?"-0":"";return t.replace(r,(o,s,c,l,u)=>{let d;return tv(s)?d="":tv(c)?d=`>=${s}.0.0${n} <${+s+1}.0.0-0`:tv(l)?s==="0"?d=`>=${s}.${c}.0${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.0${n} <${+s+1}.0.0-0`:u?s==="0"?c==="0"?d=`>=${s}.${c}.${l}-${u} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}-${u} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l}-${u} <${+s+1}.0.0-0`:s==="0"?c==="0"?d=`>=${s}.${c}.${l}${n} <${s}.${c}.${+l+1}-0`:d=`>=${s}.${c}.${l}${n} <${s}.${+c+1}.0-0`:d=`>=${s}.${c}.${l} <${+s+1}.0.0-0`,d})}function GXs(t,e){let r=NXs;return t.replace(r,(n,o,s,c,l,u)=>{let d=tv(s),f=d||tv(c),h=f||tv(l),m=h;return o==="="&&m&&(o=""),u=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),o==="<"&&(u="-0"),n=`${o+s}.${c}.${l}${u}`):f?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:h&&(n=`>=${s}.${c}.0${u} <${s}.${+c+1}.0-0`),n})}function $Xs(t,e){let r=OXs;return t.replace(r,(n,o,s,c,l,u,d,f,h,m,g,A)=>(tv(s)?o="":tv(c)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:tv(l)?o=`>=${s}.${c}.0${e?.includePrerelease?"-0":""}`:u?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,tv(h)?f="":tv(m)?f=`<${+h+1}.0.0-0`:tv(g)?f=`<${h}.${+m+1}.0-0`:A?f=`<=${h}.${m}.${g}-${A}`:e?.includePrerelease?f=`<${h}.${m}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}var doi,yXs,EXs,hoi,moi,wXs,RXs,loi,PXs,uoi,kXs,Ohr,JDe,DXs,NXs,MXs,OXs,BXs,LXs,FXs,UXs,QXs,qXs,goi=_e(()=>{p();co();doi=/^(?:v)?(?(?0|[1-9]\d*)\.(?0|[1-9]\d*)\.(?0|[1-9]\d*))(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,yXs=/^(?<|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?(?x|X|\*|0|[1-9]\d*)(?:\.(?x|X|\*|0|[1-9]\d*))?(?:\.(?x|X|\*|0|[1-9]\d*))?)(?:-(?(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,EXs={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};a(foi,"satisfies");a(_Xs,"_validateVersion");a(poi,"_doSatisfies");a(Mhr,"_checkRange");a(vXs,"_satisfies");a(CXs,"_doPreleaseCheck");a(bXs,"_normalizeRange");a(tv,"isX");a(SXs,"_parseVersion");a(TXs,"_parseRange");a(Bhr,"_isWildcard");a(aoi,"_parseVersionString");a(IXs,"_normalizeVersionType");a(xXs,"_compareVersionStrings");a(coi,"_compareVersionSegments");hoi="[a-zA-Z0-9-]",moi="0|[1-9]\\d*",wXs=`\\d*[a-zA-Z-]${hoi}*`,RXs="((?:<|>)?=?)",loi=`(?:${moi}|${wXs})`,PXs=`(?:-(${loi}(?:\\.${loi})*))`,uoi=`${hoi}+`,kXs=`(?:\\+(${uoi}(?:\\.${uoi})*))`,Ohr=`${moi}|x|X|\\*`,JDe=`[v=\\s]*(${Ohr})(?:\\.(${Ohr})(?:\\.(${Ohr})(?:${PXs})?${kXs}?)?)?`,DXs=`^${RXs}\\s*${JDe}$`,NXs=new RegExp(DXs),MXs=`^\\s*(${JDe})\\s+-\\s+(${JDe})\\s*$`,OXs=new RegExp(MXs),BXs="(?:~>?)",LXs=`^${BXs}${JDe}$`,FXs=new RegExp(LXs),UXs="(?:\\^)",QXs=`^${UXs}${JDe}$`,qXs=new RegExp(QXs);a(jXs,"replaceTilde");a(HXs,"replaceCaret");a(GXs,"replaceXRange");a($Xs,"replaceHyphen")});var khe=I((nWf,Eoi)=>{"use strict";p();function Lhr(t){return typeof t=="function"}a(Lhr,"isFunction");var rv=console.error.bind(console);function ZDe(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(ZDe,"defineProperty");function XDe(t){t&&t.logger&&(Lhr(t.logger)?rv=t.logger:rv("new logger isn't a function, not replacing"))}a(XDe,"shimmer");function Aoi(t,e,r){if(!t||!t[e]){rv("no original function "+e+" to wrap");return}if(!r){rv("no wrapper function"),rv(new Error().stack);return}if(!Lhr(t[e])||!Lhr(r)){rv("original object and wrapper must be functions");return}var n=t[e],o=r(n,e);return ZDe(o,"__original",n),ZDe(o,"__unwrap",function(){t[e]===o&&ZDe(t,e,n)}),ZDe(o,"__wrapped",!0),ZDe(t,e,o),o}a(Aoi,"wrap");function VXs(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{rv("must provide one or more modules to patch"),rv(new Error().stack);return}if(!(e&&Array.isArray(e))){rv("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(o){Aoi(n,o,r)})})}a(VXs,"massWrap");function yoi(t,e){if(!t||!t[e]){rv("no function to unwrap."),rv(new Error().stack);return}if(!t[e].__unwrap)rv("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}a(yoi,"unwrap");function WXs(t,e){if(t)Array.isArray(t)||(t=[t]);else{rv("must provide one or more modules to patch"),rv(new Error().stack);return}if(!(e&&Array.isArray(e))){rv("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){yoi(r,n)})})}a(WXs,"massUnwrap");XDe.wrap=Aoi;XDe.massWrap=VXs;XDe.unwrap=yoi;XDe.massUnwrap=WXs;Eoi.exports=XDe});var yH,jdt,_oi=_e(()=>{p();co();Nhr();yH=fe(khe()),jdt=class{static{a(this,"InstrumentationAbstract")}instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this.setConfig(n),this._diag=Pn.createComponentLogger({namespace:e}),this._tracer=_u.getTracer(e,r),this._meter=dZ.getMeter(e,r),this._logger=qdt.getLogger(e,r),this._updateMetricInstruments()}_wrap=yH.wrap;_unwrap=yH.unwrap;_massWrap=yH.massWrap;_massUnwrap=yH.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,o){if(e)try{e(n,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},s)}}}});var Coi=I((dWf,voi)=>{p();var Dhe=1e3,Nhe=Dhe*60,Mhe=Nhe*60,bX=Mhe*24,zXs=bX*7,YXs=bX*365.25;voi.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return KXs(t);if(r==="number"&&isFinite(t))return e.long?ZXs(t):JXs(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function KXs(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*YXs;case"weeks":case"week":case"w":return r*zXs;case"days":case"day":case"d":return r*bX;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Mhe;case"minutes":case"minute":case"mins":case"min":case"m":return r*Nhe;case"seconds":case"second":case"secs":case"sec":case"s":return r*Dhe;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}a(KXs,"parse");function JXs(t){var e=Math.abs(t);return e>=bX?Math.round(t/bX)+"d":e>=Mhe?Math.round(t/Mhe)+"h":e>=Nhe?Math.round(t/Nhe)+"m":e>=Dhe?Math.round(t/Dhe)+"s":t+"ms"}a(JXs,"fmtShort");function ZXs(t){var e=Math.abs(t);return e>=bX?Hdt(t,e,bX,"day"):e>=Mhe?Hdt(t,e,Mhe,"hour"):e>=Nhe?Hdt(t,e,Nhe,"minute"):e>=Dhe?Hdt(t,e,Dhe,"second"):t+" ms"}a(ZXs,"fmtLong");function Hdt(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}a(Hdt,"plural")});var Fhr=I((hWf,boi)=>{p();function XXs(t){r.debug=r,r.default=r,r.coerce=u,r.disable=c,r.enable=o,r.enabled=l,r.humanize=Coi(),r.destroy=d,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let m=0;m{if(R==="%%")return"%";T++;let P=r.formatters[x];if(typeof P=="function"){let D=E[T];R=P.call(_,D),E.splice(T,1),T--}return R}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return a(y,"debug"),y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=n,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:a(()=>m!==null?m:(g!==r.namespaces&&(g=r.namespaces,A=r.enabled(f)),A),"get"),set:a(E=>{m=E},"set")}),typeof r.init=="function"&&r.init(y),y}a(r,"createDebug");function n(f,h){let m=r(this.namespace+(typeof h>"u"?":":h)+f);return m.log=this.log,m}a(n,"extend");function o(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of h)m[0]==="-"?r.skips.push(m.slice(1)):r.names.push(m)}a(o,"enable");function s(f,h){let m=0,g=0,A=-1,y=0;for(;m"-"+h)].join(",");return r.enable(""),f}a(c,"disable");function l(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}a(l,"enabled");function u(f){return f instanceof Error?f.stack||f.message:f}a(u,"coerce");function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(d,"destroy"),r.enable(r.load()),r}a(XXs,"setup");boi.exports=XXs});var Soi=I((vb,Gdt)=>{p();vb.formatArgs=tea;vb.save=rea;vb.load=nea;vb.useColors=eea;vb.storage=iea();vb.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();vb.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function eea(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(eea,"useColors");function tea(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gdt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}a(tea,"formatArgs");vb.log=console.debug||console.log||(()=>{});function rea(t){try{t?vb.storage.setItem("debug",t):vb.storage.removeItem("debug")}catch{}}a(rea,"save");function nea(){let t;try{t=vb.storage.getItem("debug")||vb.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}a(nea,"load");function iea(){try{return localStorage}catch{}}a(iea,"localstorage");Gdt.exports=Fhr()(vb);var{formatters:oea}=Gdt.exports;oea.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ioi=I((bg,Vdt)=>{p();var sea=require("tty"),$dt=require("util");bg.init=pea;bg.log=uea;bg.formatArgs=cea;bg.save=dea;bg.load=fea;bg.useColors=aea;bg.destroy=$dt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");bg.colors=[6,2,3,4,5,1];try{let t=Vje();t&&(t.stderr||t).level>=2&&(bg.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}bg.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function aea(){return"colors"in bg.inspectOpts?!!bg.inspectOpts.colors:sea.isatty(process.stderr.fd)}a(aea,"useColors");function cea(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(` `).join(` -`+s),t.push(o+"m+"+Gdt.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Qea()+e+" "+t[0]}a(Uea,"formatArgs");function Qea(){return vg.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(Qea,"getDate");function qea(...t){return process.stderr.write(Hdt.formatWithOptions(vg.inspectOpts,...t)+` -`)}a(qea,"log");function jea(t){t?process.env.DEBUG=t:delete process.env.DEBUG}a(jea,"save");function Hea(){return process.env.DEBUG}a(Hea,"load");function Gea(t){t.inspectOpts={};let e=Object.keys(vg.inspectOpts);for(let r=0;re.trim()).join(" ")};zii.O=function(t){return this.inspectOpts.colors=this.useColors,Hdt.inspect(t,this.inspectOpts)}});var Kii=I((xWf,Dhr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Dhr.exports=Wii():Dhr.exports=Yii()});var Mhr=I((RWf,Jii)=>{"use strict";p();var Nhr=require("path").sep;Jii.exports=function(t){var e=t.split(Nhr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+Nhr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Nhr;return{name:o,basedir:c,path:d}}}});var Ohr=I((PWf,Zii)=>{"use strict";p();var $ea=require("os");Zii.exports=$ea.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var Bhr=I((MWf,Xii)=>{p();Xii.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var eoi=I((BWf,uNe)=>{"use strict";p();var Vea=process.platform==="win32",Wea=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Lhr={};function zea(t){return Wea.exec(t).slice(1)}a(zea,"win32SplitPath");Lhr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=zea(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Yea=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Fhr={};function Kea(t){return Yea.exec(t).slice(1)}a(Kea,"posixSplitPath");Fhr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Kea(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Vea?uNe.exports=Lhr.parse:uNe.exports=Fhr.parse;uNe.exports.posix=Fhr.parse;uNe.exports.win32=Lhr.parse});var Uhr=I((UWf,ioi)=>{p();var noi=require("path"),toi=noi.parse||eoi(),roi=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=toi(e);s.dir!==o[o.length-1];)o.push(s.dir),s=toi(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return noi.resolve(n,l,u)}))},[])},"getNodeModulesDirs");ioi.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return roi(e,o)},r);var s=roi(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Qhr=I((jWf,ooi)=>{p();ooi.exports=function(t,e){return e||{}}});var coi=I((GWf,aoi)=>{"use strict";p();var Jea="Function.prototype.bind called on incompatible ",Zea=Object.prototype.toString,Xea=Math.max,eta="[object Function]",soi=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var nta=coi();loi.exports=Function.prototype.bind||nta});var foi=I((YWf,doi)=>{"use strict";p();var ita=Function.prototype.call,ota=Object.prototype.hasOwnProperty,sta=uoi();doi.exports=sta.call(ita,ota)});var poi=I((JWf,ata)=>{ata.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var dNe=I((ZWf,goi)=>{"use strict";p();var cta=foi();function lta(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(lta,"specifierIncluded");function hoi(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var wX=require("fs"),dta=Ohr(),s0=require("path"),fta=Bhr(),pta=Uhr(),hta=Qhr(),mta=dNe(),gta=process.platform!=="win32"&&wX.realpath&&typeof wX.realpath.native=="function"?wX.realpath.native:wX.realpath,Aoi=dta(),Ata=a(function(){return[s0.join(Aoi,".node_modules"),s0.join(Aoi,".node_libraries")]},"defaultPaths"),yta=a(function(e,r){wX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),Eta=a(function(e,r){wX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),_ta=a(function(e,r){gta(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),fNe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Cta=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),vta=a(function(e,r,n){for(var o=pta(r,n,e),s=0;s{bta.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var Soi=I((ozf,boi)=>{"use strict";p();var Sta=dNe(),Coi=_oi(),voi={};for($dt in Coi)Object.prototype.hasOwnProperty.call(Coi,$dt)&&(voi[$dt]=Sta($dt));var $dt;boi.exports=voi});var Ioi=I((azf,Toi)=>{p();var Tta=dNe();Toi.exports=a(function(e){return Tta(e)},"isCore")});var Roi=I((uzf,woi)=>{p();var Ita=dNe(),RX=require("fs"),yE=require("path"),xta=Ohr(),wta=Bhr(),Rta=Uhr(),kta=Qhr(),Pta=process.platform!=="win32"&&RX.realpathSync&&typeof RX.realpathSync.native=="function"?RX.realpathSync.native:RX.realpathSync,xoi=xta(),Dta=a(function(){return[yE.join(xoi,".node_modules"),yE.join(xoi,".node_libraries")]},"defaultPaths"),Nta=a(function(e){try{var r=RX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),Mta=a(function(e){try{var r=RX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),Ota=a(function(e){try{return Pta(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),pNe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),Bta=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),Lta=a(function(e,r,n){for(var o=Rta(r,n,e),s=0;s{p();var Vdt=Eoi();Vdt.core=Soi();Vdt.isCore=Ioi();Vdt.sync=Roi();koi.exports=Vdt});var Poi=I((mzf,Fta)=>{Fta.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var $hr=I((gzf,Ghr)=>{"use strict";p();var Ghe=require("path"),w2=require("module"),Xp=Kii()("require-in-the-middle"),Uta=Mhr();Ghr.exports=hNe;Ghr.exports.Hook=hNe;var jhr,Hhe;if(w2.isBuiltin)Hhe=w2.isBuiltin;else if(w2.builtinModules)Hhe=a(t=>t.startsWith("node:")?!0:(jhr===void 0&&(jhr=new Set(w2.builtinModules)),jhr.has(t)),"isCore");else{let t=qhr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Hhe=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):Hhe=a(n=>!!t.core[n],"isCore")}var Wdt;function Qta(t,e){if(!Wdt)if(require.resolve&&require.resolve.paths)Wdt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=qhr();Wdt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Wdt(t,e)}a(Qta,"resolve");var qta=/([/\\]index)?(\.js)?$/,Hhr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(Xp('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function hNe(t,e,r){if(!(this instanceof hNe))return new hNe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof w2._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof w2._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,Poi().bugs.url);return}this._cache=new Hhr,this._unhooked=!1,this._origRequire=w2.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);Xp("registering require hook"),this._require=w2.prototype.require=function(u){return n._unhooked===!0?(Xp("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(Xp("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=Hhe(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);Hhe(v)&&(m=v)}}else{if(d)return Xp("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=w2._resolveFilename(f,this)}catch(v){return Xp('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(Xp("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return Xp("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return Xp("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return Xp("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=Ghe.parse(m);g=v.name,A=v.dir}else{let v=Uta(m);if(v===void 0)return Xp("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=jta(v);Xp("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=Qta(g,A)}catch{return Xp("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+Ghe.sep+Ghe.relative(A,m),Xp("preparing to process require of internal file: %s",g);else return Xp("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),Xp("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),Xp("returning module: %s",g),_}a(l,"patchedRequire")}a(hNe,"Hook");hNe.prototype.unhook=function(){this._unhooked=!0,this._require===w2.prototype.require?(w2.prototype.require=this._origRequire,Xp("require unhook successful")):Xp("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Xp("process.getBuiltinModule unhook successful")):Xp("process.getBuiltinModule unhook unsuccessful"))};function jta(t){let e=Ghe.sep!=="/"?t.path.split(Ghe.sep).join("/"):t.path;return Ghe.posix.join(t.name,e).replace(qta,"")}a(jta,"resolveModuleName")});var zdt,Ydt,Doi=me(()=>{p();zdt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Ydt=class{static{a(this,"ModuleNameTrie")}_trie=new zdt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new zdt,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function Gta(t){return Vhr.sep!=="/"?t.split(Vhr.sep).join("/"):t}var Moi,Vhr,Hta,Kdt,Ooi=me(()=>{p();Moi=ce($hr()),Vhr=ce(require("path"));Doi();Hta=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Kdt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Ydt;static _instance;constructor(){this._initialize()}_initialize(){new Moi.Hook(null,{internals:!0},(e,r,n)=>{let o=Gta(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return Hta?new t:this._instance=this._instance??new t}};a(Gta,"normalizePathSeparators")});var qoi=I(kX=>{p();var Boi=[],Whr=new WeakMap,Loi=new WeakMap,Foi=new Map,Uoi=[],$ta={set(t,e,r){return Whr.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=Loi.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return Whr.get(t)[e](r.value)}};function Vta(t,e,r,n,o){Foi.set(t,o),Whr.set(e,r),Loi.set(e,n);let s=new Proxy(e,$ta);Boi.forEach(c=>c(t,s)),Uoi.push([t,s])}a(Vta,"register");var Qoi=!1;function Wta(){return Qoi}a(Wta,"getExperimentalPatchInternals");function zta(t){Qoi=t}a(zta,"setExperimentalPatchInternals");kX.register=Vta;kX.importHooks=Boi;kX.specifiers=Foi;kX.toHook=Uoi;kX.getExperimentalPatchInternals=Wta;kX.setExperimentalPatchInternals=zta});var Woi=I((Rzf,$he)=>{p();var joi=require("path"),Yta=Mhr(),{fileURLToPath:Hoi}=require("url"),{MessageChannel:Kta}=require("worker_threads"),{importHooks:zhr,specifiers:Jta,toHook:Zta,getExperimentalPatchInternals:Xta}=qoi();function $oi(t){zhr.push(t),Zta.forEach(([e,r])=>t(e,r))}a($oi,"addHook");function Voi(t){let e=zhr.indexOf(t);e>-1&&zhr.splice(e,1)}a(Voi,"removeHook");function Goi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(Goi,"callHookFn");var Yhr;function era(){let{port1:t,port2:e}=new Kta,r=0,n;Yhr=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(era,"createAddHookMessageChannel");function mNe(t,e,r){if(!(this instanceof mNe))return new mNe(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;Yhr&&Array.isArray(t)&&Yhr(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=Hoi(o)}catch{}let d=Yta(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+joi.sep+joi.relative(u,Hoi(c));else if(!Xta()&&!u.endsWith(Jta.get(c)))continue}Goi(r,s,o,u)}}else Goi(r,s,o,u)},$oi(this._iitmHook)}a(mNe,"Hook");mNe.prototype.unhook=function(){Voi(this._iitmHook)};$he.exports=mNe;$he.exports.Hook=mNe;$he.exports.addHook=$oi;$he.exports.removeHook=Voi;$he.exports.createAddHookMessageChannel=era});function zoi(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function Yoi(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Jdt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var Khr=me(()=>{p();a(zoi,"safeExecuteInTheMiddle");a(Yoi,"safeExecuteInTheMiddleAsync");a(Jdt,"isWrapped")});function Koi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>Oii(e,n,{includePrerelease:r}))}var t8,Jhr,gNe,Joi,Zoi,Xoi,Vhe,esi=me(()=>{p();t8=ce(require("path")),Jhr=require("util");Uii();gNe=ce(Uhe());Hii();Ooi();Joi=ce(Woi());co();Zoi=ce($hr()),Xoi=require("fs");Khr();Vhe=class extends Qdt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Kdt.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Jdt(e[r])&&this._unwrap(e,r),Jhr.types.isProxy(e)){let o=(0,gNe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,gNe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>Jhr.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,gNe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{kn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){kn.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{kn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){kn.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,Xoi.readFileSync)(t8.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{kn.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return Koi(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=t8.normalize(n);return c.filter(d=>d.name===l).filter(d=>Koi(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&t8.isAbsolute(l)){let d=t8.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=t8.isAbsolute(e.name)?new Zoi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new Joi.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(Koi,"isSupported")});var ANe,tsi=me(()=>{p();ANe=require("path")});var rsi=me(()=>{p();esi();tsi()});var Zhr=me(()=>{p();rsi()});var Zdt,nsi=me(()=>{p();Zdt=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var Xdt,isi=me(()=>{p();Zhr();Xdt=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,ANe.normalize)(e)}}});var Xhr={};wi(Xhr,{InstrumentationBase:()=>Vhe,InstrumentationNodeModuleDefinition:()=>Zdt,InstrumentationNodeModuleFile:()=>Xdt,isWrapped:()=>Jdt,registerInstrumentations:()=>wii,safeExecuteInTheMiddle:()=>zoi,safeExecuteInTheMiddleAsync:()=>Yoi});var e0r=me(()=>{p();Rii();Zhr();nsi();isi();Khr()});var ssi=I(t0r=>{"use strict";p();Object.defineProperty(t0r,"__esModule",{value:!0});t0r.log=ira;var osi=(OL(),Ca(E7)),tra=require("node:os"),rra=osi.__importDefault(require("node:util")),nra=osi.__importStar(require("node:process"));function ira(t,...e){nra.stderr.write(`${rra.default.format(t,...e)}${tra.EOL}`)}a(ira,"log")});var dsi=I(s0r=>{"use strict";p();Object.defineProperty(s0r,"__esModule",{value:!0});var ora=ssi(),asi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,csi,r0r=[],n0r=[],eft=[];asi&&i0r(asi);var lsi=Object.assign(t=>usi(t),{enable:i0r,enabled:o0r,disable:sra,log:ora.log});function i0r(t){csi=t,r0r=[],n0r=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?n0r.push(new RegExp(`^${n.substr(1)}$`)):r0r.push(new RegExp(`^${n}$`));for(let n of eft)n.enabled=o0r(n.namespace)}a(i0r,"enable");function o0r(t){if(t.endsWith("*"))return!0;for(let e of n0r)if(e.test(t))return!1;for(let e of r0r)if(e.test(t))return!0;return!1}a(o0r,"enabled");function sra(){let t=csi||"";return i0r(""),t}a(sra,"disable");function usi(t){let e=Object.assign(r,{enabled:o0r(t),destroy:ara,log:lsi.log,namespace:t,extend:cra});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),eft.push(e),e}a(usi,"createDebugger");function ara(){let t=eft.indexOf(this);return t>=0?(eft.splice(t,1),!0):!1}a(ara,"destroy");function cra(t){let e=usi(`${this.namespace}:${t}`);return e.log=this.log,e}a(cra,"extend");s0r.default=lsi});var ift=I($5=>{"use strict";p();Object.defineProperty($5,"__esModule",{value:!0});$5.AzureLogger=void 0;$5.setLogLevel=hsi;$5.getLogLevel=ura;$5.createClientLogger=dra;var lra=(OL(),Ca(E7)),yNe=lra.__importDefault(dsi()),psi=new Set,tft=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,nft;$5.AzureLogger=(0,yNe.default)("azure");$5.AzureLogger.log=(...t)=>{yNe.default.log(...t)};var a0r=["verbose","info","warning","error"];tft&&(Asi(tft)?hsi(tft):console.error(`AZURE_LOG_LEVEL set to unknown log level '${tft}'; logging is not enabled. Acceptable values: ${a0r.join(", ")}.`));function hsi(t){if(t&&!Asi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${a0r.join(",")}`);nft=t;let e=[];for(let r of psi)gsi(r)&&e.push(r.namespace);yNe.default.enable(e.join(","))}a(hsi,"setLogLevel");function ura(){return nft}a(ura,"getLogLevel");var fsi={verbose:400,info:300,warning:200,error:100};function dra(t){let e=$5.AzureLogger.extend(t);return msi($5.AzureLogger,e),{error:rft(e,"error"),warning:rft(e,"warning"),info:rft(e,"info"),verbose:rft(e,"verbose")}}a(dra,"createClientLogger");function msi(t,e){e.log=(...r)=>{t.log(...r)}}a(msi,"patchLogMethod");function rft(t,e){let r=Object.assign(t.extend(e),{level:e});if(msi(t,r),gsi(r)){let n=yNe.default.disable();yNe.default.enable(n+","+r.namespace)}return psi.add(r),r}a(rft,"createLogger");function gsi(t){return!!(nft&&fsi[t.level]<=fsi[nft])}a(gsi,"shouldEnable");function Asi(t){return a0r.includes(t)}a(Asi,"isAzureLogLevel")});var c0r=I(oft=>{"use strict";p();Object.defineProperty(oft,"__esModule",{value:!0});oft.logger=void 0;var fra=ift();oft.logger=(0,fra.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function sft(t){return t.setValue(l0r,!0)}function ysi(t){return t.deleteValue(l0r)}function Whe(t){return t.getValue(l0r)===!0}var l0r,ENe=me(()=>{p();co();l0r=hb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(sft,"suppressTracing");a(ysi,"unsuppressTracing");a(Whe,"isTracingSuppressed")});var aft,Esi=me(()=>{p();aft="baggage"});function Csi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function vsi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function u0r(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Cpe(e.join(";"))),{key:o,value:s,metadata:c}}function bsi(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=u0r(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var d0r=me(()=>{p();co();a(Csi,"serializeKeyPairs");a(vsi,"getKeyPairs");a(u0r,"parsePairKeyValue");a(bsi,"parseKeyPairsIntoRecord")});var lft,Ssi=me(()=>{p();co();ENe();Esi();d0r();lft=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=yT.getBaggage(e);if(!o||Whe(e))return;let s=vsi(o).filter(l=>l.length<=4096).slice(0,180),c=Csi(s);c.length>0&&n.set(r,aft,c)}extract(e,r,n){let o=n.get(r,aft),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=u0r(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:yT.setBaggage(e,yT.createBaggage(c))}fields(){return[aft]}}});var uft,Tsi=me(()=>{p();uft=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function Isi(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!mra(r)){kn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!f0r(n)){kn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function mra(t){return typeof t=="string"&&t!==""}function f0r(t){return t==null?!0:Array.isArray(t)?gra(t):xsi(typeof t)}function gra(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(xsi(n)){e=n;continue}return!1}return!1}}return!0}function xsi(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var wsi=me(()=>{p();co();a(Isi,"sanitizeAttributes");a(mra,"isAttributeKey");a(f0r,"isAttributeValue");a(gra,"isHomogeneousAttributeValueArray");a(xsi,"isValidPrimitiveAttributeValueType")});function dft(){return t=>{kn.error(Ara(t))}}function Ara(t){return typeof t=="string"?t:JSON.stringify(yra(t))}function yra(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var p0r=me(()=>{p();co();a(dft,"loggingErrorHandler");a(Ara,"stringifyException");a(yra,"flattenException")});function ksi(t){Rsi=t}function Psi(t){try{Rsi(t)}catch{}}var Rsi,Dsi=me(()=>{p();p0r();Rsi=dft();a(ksi,"setGlobalErrorHandler");a(Psi,"globalErrorHandler")});function fft(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){kn.warn(`Unknown value ${(0,h0r.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function _Ne(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function pft(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||kn.warn(`Unknown value ${(0,h0r.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function hft(t){return _Ne(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var h0r,Nsi=me(()=>{p();co();h0r=require("util");a(fft,"getNumberFromEnv");a(_Ne,"getStringFromEnv");a(pft,"getBooleanFromEnv");a(hft,"getStringListFromEnv")});var mft,Msi=me(()=>{p();mft=typeof globalThis=="object"?globalThis:global});var Osi,xH,Bsi=me(()=>{p();Osi=require("perf_hooks"),xH=Osi.performance});var Lsi,Fsi=me(()=>{p();Lsi="2.2.0"});function eh(t){let e={},r=t.length;for(let n=0;n{p();a(eh,"createConstMap")});var Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,Cai,vai,bai,Sai,Tai,Iai,xai,wai,Rai,kai,Pai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,Cci,vci,bci,Sci,Tci,Ici,xci,wci,Rci,kci,Pci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili,Era,_ra,Cra,vra,bra,Sra,Tra,Ira,xra,wra,Rra,kra,Pra,Dra,Nra,Mra,Ora,Bra,Lra,Fra,Ura,Qra,qra,jra,Hra,Gra,$ra,Vra,Wra,zra,Yra,Kra,Jra,Zra,Xra,ena,tna,rna,nna,ina,ona,sna,ana,cna,lna,una,dna,fna,pna,hna,mna,gna,Ana,yna,Ena,_na,Cna,vna,bna,Sna,Tna,Ina,xna,wna,Rna,kna,Pna,Dna,Nna,Mna,Ona,Bna,Lna,Fna,Una,Qna,qna,jna,Hna,Gna,$na,Vna,Wna,zna,Yna,Kna,Jna,Zna,Xna,eia,tia,ria,nia,iia,oia,sia,aia,cia,lia,uia,dia,fia,pia,hia,mia,gia,Aia,yia,Eia,_ia,Cia,via,bia,Sia,Tia,Iia,xia,wia,Ria,kia,Pia,Dia,Nia,Mia,Oia,Bia,Lia,Fia,Uia,oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,Cli,vli,bli,Sli,Tli,Ili,xli,wli,Rli,kli,Pli,Dli,Nli,Mli,Oli,Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli,Qia,qia,jia,Hia,Gia,$ia,Via,Wia,zia,Yia,Kia,Jia,Zia,Xia,eoa,toa,roa,noa,ioa,ooa,soa,aoa,coa,loa,uoa,doa,foa,poa,hoa,moa,goa,Aoa,yoa,Eoa,_oa,Coa,voa,boa,Soa,Toa,Ioa,xoa,woa,Roa,koa,Poa,Doa,Noa,Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui,Moa,Ooa,Boa,Loa,Foa,Uoa,Qoa,qoa,joa,Hoa,Goa,$oa,lui,uui,dui,fui,pui,Voa,Woa,zoa,Yoa,Koa,Joa,hui,mui,gui,Zoa,Xoa,esa,tsa,Aui,yui,Eui,_ui,rsa,nsa,isa,osa,ssa,Cui,vui,bui,Sui,Tui,Iui,xui,asa,csa,lsa,usa,dsa,fsa,psa,hsa,wui,Rui,kui,Pui,Dui,msa,gsa,Asa,ysa,Esa,_sa,Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui,Csa,vsa,bsa,Ssa,Tsa,Isa,xsa,wsa,Rsa,ksa,Psa,Dsa,Nsa,Msa,Osa,Bsa,Lsa,Fsa,Usa,Qsa,qsa,jsa,edi,tdi,rdi,ndi,idi,Hsa,Gsa,$sa,Vsa,Wsa,zsa,odi,sdi,Ysa,Ksa,Jsa,adi,cdi,Zsa,Xsa,eaa,ldi,udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,Cdi,vdi,bdi,Sdi,Tdi,taa,raa,naa,iaa,oaa,saa,aaa,caa,laa,uaa,daa,faa,paa,haa,maa,gaa,Aaa,yaa,Idi,xdi,Eaa,_aa,Caa,wdi=me(()=>{p();m0r();Usi="aws.lambda.invoked_arn",Qsi="db.system",qsi="db.connection_string",jsi="db.user",Hsi="db.jdbc.driver_classname",Gsi="db.name",$si="db.statement",Vsi="db.operation",Wsi="db.mssql.instance_name",zsi="db.cassandra.keyspace",Ysi="db.cassandra.page_size",Ksi="db.cassandra.consistency_level",Jsi="db.cassandra.table",Zsi="db.cassandra.idempotence",Xsi="db.cassandra.speculative_execution_count",eai="db.cassandra.coordinator.id",tai="db.cassandra.coordinator.dc",rai="db.hbase.namespace",nai="db.redis.database_index",iai="db.mongodb.collection",oai="db.sql.table",sai="exception.type",aai="exception.message",cai="exception.stacktrace",lai="exception.escaped",uai="faas.trigger",dai="faas.execution",fai="faas.document.collection",pai="faas.document.operation",hai="faas.document.time",mai="faas.document.name",gai="faas.time",Aai="faas.cron",yai="faas.coldstart",Eai="faas.invoked_name",_ai="faas.invoked_provider",Cai="faas.invoked_region",vai="net.transport",bai="net.peer.ip",Sai="net.peer.port",Tai="net.peer.name",Iai="net.host.ip",xai="net.host.port",wai="net.host.name",Rai="net.host.connection.type",kai="net.host.connection.subtype",Pai="net.host.carrier.name",Dai="net.host.carrier.mcc",Nai="net.host.carrier.mnc",Mai="net.host.carrier.icc",Oai="peer.service",Bai="enduser.id",Lai="enduser.role",Fai="enduser.scope",Uai="thread.id",Qai="thread.name",qai="code.function",jai="code.namespace",Hai="code.filepath",Gai="code.lineno",$ai="http.method",Vai="http.url",Wai="http.target",zai="http.host",Yai="http.scheme",Kai="http.status_code",Jai="http.flavor",Zai="http.user_agent",Xai="http.request_content_length",eci="http.request_content_length_uncompressed",tci="http.response_content_length",rci="http.response_content_length_uncompressed",nci="http.server_name",ici="http.route",oci="http.client_ip",sci="aws.dynamodb.table_names",aci="aws.dynamodb.consumed_capacity",cci="aws.dynamodb.item_collection_metrics",lci="aws.dynamodb.provisioned_read_capacity",uci="aws.dynamodb.provisioned_write_capacity",dci="aws.dynamodb.consistent_read",fci="aws.dynamodb.projection",pci="aws.dynamodb.limit",hci="aws.dynamodb.attributes_to_get",mci="aws.dynamodb.index_name",gci="aws.dynamodb.select",Aci="aws.dynamodb.global_secondary_indexes",yci="aws.dynamodb.local_secondary_indexes",Eci="aws.dynamodb.exclusive_start_table",_ci="aws.dynamodb.table_count",Cci="aws.dynamodb.scan_forward",vci="aws.dynamodb.segment",bci="aws.dynamodb.total_segments",Sci="aws.dynamodb.count",Tci="aws.dynamodb.scanned_count",Ici="aws.dynamodb.attribute_definitions",xci="aws.dynamodb.global_secondary_index_updates",wci="messaging.system",Rci="messaging.destination",kci="messaging.destination_kind",Pci="messaging.temp_destination",Dci="messaging.protocol",Nci="messaging.protocol_version",Mci="messaging.url",Oci="messaging.message_id",Bci="messaging.conversation_id",Lci="messaging.message_payload_size_bytes",Fci="messaging.message_payload_compressed_size_bytes",Uci="messaging.operation",Qci="messaging.consumer_id",qci="messaging.rabbitmq.routing_key",jci="messaging.kafka.message_key",Hci="messaging.kafka.consumer_group",Gci="messaging.kafka.client_id",$ci="messaging.kafka.partition",Vci="messaging.kafka.tombstone",Wci="rpc.system",zci="rpc.service",Yci="rpc.method",Kci="rpc.grpc.status_code",Jci="rpc.jsonrpc.version",Zci="rpc.jsonrpc.request_id",Xci="rpc.jsonrpc.error_code",eli="rpc.jsonrpc.error_message",tli="message.type",rli="message.id",nli="message.compressed_size",ili="message.uncompressed_size",Era=Usi,_ra=Qsi,Cra=qsi,vra=jsi,bra=Hsi,Sra=Gsi,Tra=$si,Ira=Vsi,xra=Wsi,wra=zsi,Rra=Ysi,kra=Ksi,Pra=Jsi,Dra=Zsi,Nra=Xsi,Mra=eai,Ora=tai,Bra=rai,Lra=nai,Fra=iai,Ura=oai,Qra=sai,qra=aai,jra=cai,Hra=lai,Gra=uai,$ra=dai,Vra=fai,Wra=pai,zra=hai,Yra=mai,Kra=gai,Jra=Aai,Zra=yai,Xra=Eai,ena=_ai,tna=Cai,rna=vai,nna=bai,ina=Sai,ona=Tai,sna=Iai,ana=xai,cna=wai,lna=Rai,una=kai,dna=Pai,fna=Dai,pna=Nai,hna=Mai,mna=Oai,gna=Bai,Ana=Lai,yna=Fai,Ena=Uai,_na=Qai,Cna=qai,vna=jai,bna=Hai,Sna=Gai,Tna=$ai,Ina=Vai,xna=Wai,wna=zai,Rna=Yai,kna=Kai,Pna=Jai,Dna=Zai,Nna=Xai,Mna=eci,Ona=tci,Bna=rci,Lna=nci,Fna=ici,Una=oci,Qna=sci,qna=aci,jna=cci,Hna=lci,Gna=uci,$na=dci,Vna=fci,Wna=pci,zna=hci,Yna=mci,Kna=gci,Jna=Aci,Zna=yci,Xna=Eci,eia=_ci,tia=Cci,ria=vci,nia=bci,iia=Sci,oia=Tci,sia=Ici,aia=xci,cia=wci,lia=Rci,uia=kci,dia=Pci,fia=Dci,pia=Nci,hia=Mci,mia=Oci,gia=Bci,Aia=Lci,yia=Fci,Eia=Uci,_ia=Qci,Cia=qci,via=jci,bia=Hci,Sia=Gci,Tia=$ci,Iia=Vci,xia=Wci,wia=zci,Ria=Yci,kia=Kci,Pia=Jci,Dia=Zci,Nia=Xci,Mia=eli,Oia=tli,Bia=rli,Lia=nli,Fia=ili,Uia=eh([Usi,Qsi,qsi,jsi,Hsi,Gsi,$si,Vsi,Wsi,zsi,Ysi,Ksi,Jsi,Zsi,Xsi,eai,tai,rai,nai,iai,oai,sai,aai,cai,lai,uai,dai,fai,pai,hai,mai,gai,Aai,yai,Eai,_ai,Cai,vai,bai,Sai,Tai,Iai,xai,wai,Rai,kai,Pai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,Cci,vci,bci,Sci,Tci,Ici,xci,wci,Rci,kci,Pci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili]),oli="other_sql",sli="mssql",ali="mysql",cli="oracle",lli="db2",uli="postgresql",dli="redshift",fli="hive",pli="cloudscape",hli="hsqldb",mli="progress",gli="maxdb",Ali="hanadb",yli="ingres",Eli="firstsql",_li="edb",Cli="cache",vli="adabas",bli="firebird",Sli="derby",Tli="filemaker",Ili="informix",xli="instantdb",wli="interbase",Rli="mariadb",kli="netezza",Pli="pervasive",Dli="pointbase",Nli="sqlite",Mli="sybase",Oli="teradata",Bli="vertica",Lli="h2",Fli="coldfusion",Uli="cassandra",Qli="hbase",qli="mongodb",jli="redis",Hli="couchbase",Gli="couchdb",$li="cosmosdb",Vli="dynamodb",Wli="neo4j",zli="geode",Yli="elasticsearch",Kli="memcached",Jli="cockroachdb",Qia=oli,qia=sli,jia=ali,Hia=cli,Gia=lli,$ia=uli,Via=dli,Wia=fli,zia=pli,Yia=hli,Kia=mli,Jia=gli,Zia=Ali,Xia=yli,eoa=Eli,toa=_li,roa=Cli,noa=vli,ioa=bli,ooa=Sli,soa=Tli,aoa=Ili,coa=xli,loa=wli,uoa=Rli,doa=kli,foa=Pli,poa=Dli,hoa=Nli,moa=Mli,goa=Oli,Aoa=Bli,yoa=Lli,Eoa=Fli,_oa=Uli,Coa=Qli,voa=qli,boa=jli,Soa=Hli,Toa=Gli,Ioa=$li,xoa=Vli,woa=Wli,Roa=zli,koa=Yli,Poa=Kli,Doa=Jli,Noa=eh([oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,Cli,vli,bli,Sli,Tli,Ili,xli,wli,Rli,kli,Pli,Dli,Nli,Mli,Oli,Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli]),Zli="all",Xli="each_quorum",eui="quorum",tui="local_quorum",rui="one",nui="two",iui="three",oui="local_one",sui="any",aui="serial",cui="local_serial",Moa=Zli,Ooa=Xli,Boa=eui,Loa=tui,Foa=rui,Uoa=nui,Qoa=iui,qoa=oui,joa=sui,Hoa=aui,Goa=cui,$oa=eh([Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui]),lui="datasource",uui="http",dui="pubsub",fui="timer",pui="other",Voa=lui,Woa=uui,zoa=dui,Yoa=fui,Koa=pui,Joa=eh([lui,uui,dui,fui,pui]),hui="insert",mui="edit",gui="delete",Zoa=hui,Xoa=mui,esa=gui,tsa=eh([hui,mui,gui]),Aui="alibaba_cloud",yui="aws",Eui="azure",_ui="gcp",rsa=Aui,nsa=yui,isa=Eui,osa=_ui,ssa=eh([Aui,yui,Eui,_ui]),Cui="ip_tcp",vui="ip_udp",bui="ip",Sui="unix",Tui="pipe",Iui="inproc",xui="other",asa=Cui,csa=vui,lsa=bui,usa=Sui,dsa=Tui,fsa=Iui,psa=xui,hsa=eh([Cui,vui,bui,Sui,Tui,Iui,xui]),wui="wifi",Rui="wired",kui="cell",Pui="unavailable",Dui="unknown",msa=wui,gsa=Rui,Asa=kui,ysa=Pui,Esa=Dui,_sa=eh([wui,Rui,kui,Pui,Dui]),Nui="gprs",Mui="edge",Oui="umts",Bui="cdma",Lui="evdo_0",Fui="evdo_a",Uui="cdma2000_1xrtt",Qui="hsdpa",qui="hsupa",jui="hspa",Hui="iden",Gui="evdo_b",$ui="lte",Vui="ehrpd",Wui="hspap",zui="gsm",Yui="td_scdma",Kui="iwlan",Jui="nr",Zui="nrnsa",Xui="lte_ca",Csa=Nui,vsa=Mui,bsa=Oui,Ssa=Bui,Tsa=Lui,Isa=Fui,xsa=Uui,wsa=Qui,Rsa=qui,ksa=jui,Psa=Hui,Dsa=Gui,Nsa=$ui,Msa=Vui,Osa=Wui,Bsa=zui,Lsa=Yui,Fsa=Kui,Usa=Jui,Qsa=Zui,qsa=Xui,jsa=eh([Nui,Mui,Oui,Bui,Lui,Fui,Uui,Qui,qui,jui,Hui,Gui,$ui,Vui,Wui,zui,Yui,Kui,Jui,Zui,Xui]),edi="1.0",tdi="1.1",rdi="2.0",ndi="SPDY",idi="QUIC",Hsa=edi,Gsa=tdi,$sa=rdi,Vsa=ndi,Wsa=idi,zsa={HTTP_1_0:edi,HTTP_1_1:tdi,HTTP_2_0:rdi,SPDY:ndi,QUIC:idi},odi="queue",sdi="topic",Ysa=odi,Ksa=sdi,Jsa=eh([odi,sdi]),adi="receive",cdi="process",Zsa=adi,Xsa=cdi,eaa=eh([adi,cdi]),ldi=0,udi=1,ddi=2,fdi=3,pdi=4,hdi=5,mdi=6,gdi=7,Adi=8,ydi=9,Edi=10,_di=11,Cdi=12,vdi=13,bdi=14,Sdi=15,Tdi=16,taa=ldi,raa=udi,naa=ddi,iaa=fdi,oaa=pdi,saa=hdi,aaa=mdi,caa=gdi,laa=Adi,uaa=ydi,daa=Edi,faa=_di,paa=Cdi,haa=vdi,maa=bdi,gaa=Sdi,Aaa=Tdi,yaa={OK:ldi,CANCELLED:udi,UNKNOWN:ddi,INVALID_ARGUMENT:fdi,DEADLINE_EXCEEDED:pdi,NOT_FOUND:hdi,ALREADY_EXISTS:mdi,PERMISSION_DENIED:gdi,RESOURCE_EXHAUSTED:Adi,FAILED_PRECONDITION:ydi,ABORTED:Edi,OUT_OF_RANGE:_di,UNIMPLEMENTED:Cdi,INTERNAL:vdi,UNAVAILABLE:bdi,DATA_LOSS:Sdi,UNAUTHENTICATED:Tdi},Idi="SENT",xdi="RECEIVED",Eaa=Idi,_aa=xdi,Caa=eh([Idi,xdi])});var Rdi=me(()=>{p();wdi()});var kdi,Pdi,Ddi,Ndi,Mdi,Odi,Bdi,Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,Cfi,vfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,vaa,baa,Saa,Taa,Iaa,xaa,waa,Raa,kaa,Paa,Daa,Naa,Maa,Oaa,Baa,Laa,Faa,Uaa,Qaa,qaa,jaa,Haa,Gaa,$aa,Vaa,Waa,zaa,Yaa,Kaa,Jaa,Zaa,Xaa,eca,tca,rca,nca,ica,oca,sca,aca,cca,lca,uca,dca,fca,pca,hca,mca,gca,Aca,yca,Eca,_ca,Cca,vca,bca,Sca,Tca,Ica,xca,wca,Rca,kca,Pca,Dca,Nca,Mca,Oca,Bca,Lca,Fca,Uca,Qca,qca,jca,Hca,Gca,$ca,Vca,Wca,zca,Yca,npi,ipi,opi,spi,Kca,Jca,Zca,Xca,ela,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,Cpi,vpi,bpi,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,dla,fla,pla,hla,mla,gla,Ala,yla,Spi,Tpi,Ela,_la,Cla,Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi,vla,bla,Sla,Tla,Ila,xla,wla,Rla,Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi,kla,Pla,Dla,Nla,Mla,Ola,Bla,Lla,Fla,Ula,Qla,qla,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,ehi=me(()=>{p();m0r();kdi="cloud.provider",Pdi="cloud.account.id",Ddi="cloud.region",Ndi="cloud.availability_zone",Mdi="cloud.platform",Odi="aws.ecs.container.arn",Bdi="aws.ecs.cluster.arn",Ldi="aws.ecs.launchtype",Fdi="aws.ecs.task.arn",Udi="aws.ecs.task.family",Qdi="aws.ecs.task.revision",qdi="aws.eks.cluster.arn",jdi="aws.log.group.names",Hdi="aws.log.group.arns",Gdi="aws.log.stream.names",$di="aws.log.stream.arns",Vdi="container.name",Wdi="container.id",zdi="container.runtime",Ydi="container.image.name",Kdi="container.image.tag",Jdi="deployment.environment",Zdi="device.id",Xdi="device.model.identifier",efi="device.model.name",tfi="faas.name",rfi="faas.id",nfi="faas.version",ifi="faas.instance",ofi="faas.max_memory",sfi="host.id",afi="host.name",cfi="host.type",lfi="host.arch",ufi="host.image.name",dfi="host.image.id",ffi="host.image.version",pfi="k8s.cluster.name",hfi="k8s.node.name",mfi="k8s.node.uid",gfi="k8s.namespace.name",Afi="k8s.pod.uid",yfi="k8s.pod.name",Efi="k8s.container.name",_fi="k8s.replicaset.uid",Cfi="k8s.replicaset.name",vfi="k8s.deployment.uid",bfi="k8s.deployment.name",Sfi="k8s.statefulset.uid",Tfi="k8s.statefulset.name",Ifi="k8s.daemonset.uid",xfi="k8s.daemonset.name",wfi="k8s.job.uid",Rfi="k8s.job.name",kfi="k8s.cronjob.uid",Pfi="k8s.cronjob.name",Dfi="os.type",Nfi="os.description",Mfi="os.name",Ofi="os.version",Bfi="process.pid",Lfi="process.executable.name",Ffi="process.executable.path",Ufi="process.command",Qfi="process.command_line",qfi="process.command_args",jfi="process.owner",Hfi="process.runtime.name",Gfi="process.runtime.version",$fi="process.runtime.description",Vfi="service.name",Wfi="service.namespace",zfi="service.instance.id",Yfi="service.version",Kfi="telemetry.sdk.name",Jfi="telemetry.sdk.language",Zfi="telemetry.sdk.version",Xfi="telemetry.auto.version",epi="webengine.name",tpi="webengine.version",rpi="webengine.description",vaa=kdi,baa=Pdi,Saa=Ddi,Taa=Ndi,Iaa=Mdi,xaa=Odi,waa=Bdi,Raa=Ldi,kaa=Fdi,Paa=Udi,Daa=Qdi,Naa=qdi,Maa=jdi,Oaa=Hdi,Baa=Gdi,Laa=$di,Faa=Vdi,Uaa=Wdi,Qaa=zdi,qaa=Ydi,jaa=Kdi,Haa=Jdi,Gaa=Zdi,$aa=Xdi,Vaa=efi,Waa=tfi,zaa=rfi,Yaa=nfi,Kaa=ifi,Jaa=ofi,Zaa=sfi,Xaa=afi,eca=cfi,tca=lfi,rca=ufi,nca=dfi,ica=ffi,oca=pfi,sca=hfi,aca=mfi,cca=gfi,lca=Afi,uca=yfi,dca=Efi,fca=_fi,pca=Cfi,hca=vfi,mca=bfi,gca=Sfi,Aca=Tfi,yca=Ifi,Eca=xfi,_ca=wfi,Cca=Rfi,vca=kfi,bca=Pfi,Sca=Dfi,Tca=Nfi,Ica=Mfi,xca=Ofi,wca=Bfi,Rca=Lfi,kca=Ffi,Pca=Ufi,Dca=Qfi,Nca=qfi,Mca=jfi,Oca=Hfi,Bca=Gfi,Lca=$fi,Fca=Vfi,Uca=Wfi,Qca=zfi,qca=Yfi,jca=Kfi,Hca=Jfi,Gca=Zfi,$ca=Xfi,Vca=epi,Wca=tpi,zca=rpi,Yca=eh([kdi,Pdi,Ddi,Ndi,Mdi,Odi,Bdi,Ldi,Fdi,Udi,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,nfi,ifi,ofi,sfi,afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,Cfi,vfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,kfi,Pfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi]),npi="alibaba_cloud",ipi="aws",opi="azure",spi="gcp",Kca=npi,Jca=ipi,Zca=opi,Xca=spi,ela=eh([npi,ipi,opi,spi]),api="alibaba_cloud_ecs",cpi="alibaba_cloud_fc",lpi="aws_ec2",upi="aws_ecs",dpi="aws_eks",fpi="aws_lambda",ppi="aws_elastic_beanstalk",hpi="azure_vm",mpi="azure_container_instances",gpi="azure_aks",Api="azure_functions",ypi="azure_app_service",Epi="gcp_compute_engine",_pi="gcp_cloud_run",Cpi="gcp_kubernetes_engine",vpi="gcp_cloud_functions",bpi="gcp_app_engine",tla=api,rla=cpi,nla=lpi,ila=upi,ola=dpi,sla=fpi,ala=ppi,cla=hpi,lla=mpi,ula=gpi,dla=Api,fla=ypi,pla=Epi,hla=_pi,mla=Cpi,gla=vpi,Ala=bpi,yla=eh([api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,Cpi,vpi,bpi]),Spi="ec2",Tpi="fargate",Ela=Spi,_la=Tpi,Cla=eh([Spi,Tpi]),Ipi="amd64",xpi="arm32",wpi="arm64",Rpi="ia64",kpi="ppc32",Ppi="ppc64",Dpi="x86",vla=Ipi,bla=xpi,Sla=wpi,Tla=Rpi,Ila=kpi,xla=Ppi,wla=Dpi,Rla=eh([Ipi,xpi,wpi,Rpi,kpi,Ppi,Dpi]),Npi="windows",Mpi="linux",Opi="darwin",Bpi="freebsd",Lpi="netbsd",Fpi="openbsd",Upi="dragonflybsd",Qpi="hpux",qpi="aix",jpi="solaris",Hpi="z_os",kla=Npi,Pla=Mpi,Dla=Opi,Nla=Bpi,Mla=Lpi,Ola=Fpi,Bla=Upi,Lla=Qpi,Fla=qpi,Ula=jpi,Qla=Hpi,qla=eh([Npi,Mpi,Opi,Bpi,Lpi,Fpi,Upi,Qpi,qpi,jpi,Hpi]),Gpi="cpp",$pi="dotnet",Vpi="erlang",Wpi="go",zpi="java",Ypi="nodejs",Kpi="php",Jpi="python",Zpi="ruby",Xpi="webjs",jla=Gpi,Hla=$pi,Gla=Vpi,$la=Wpi,Vla=zpi,Wla=Ypi,zla=Kpi,Yla=Jpi,Kla=Zpi,Jla=Xpi,Zla=eh([Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi])});var thi=me(()=>{p();ehi()});var Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,Cua,vua,bua,Sua,Tua,Iua,xua,wua,Rua,kua,Pua,Dua,Nua,Mua,Oua,Bua,Lua,Fua,Uua,Qua,xKf,wKf,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,Cda,vda,bda,Sda,Tda,Ida,xda,wda,Rda,kda,Pda,Dda,Nda,Mda,Oda,Bda,Lda,Fda,Uda,Qda,qda,jda,Hda,Gda,$da,Vda,Wda,zda,Yda,Kda,Jda,Zda,Xda,efa,tfa,rfa,g0r,nfa,ifa,ofa,sfa,afa,A0r,cfa,lfa,ufa,dfa,ffa,pfa,y0r,E0r,hfa,mfa,gfa,Afa,yfa,Efa,rhi=me(()=>{p();Xla="aspnetcore.diagnostics.exception.result",eua="aborted",tua="handled",rua="skipped",nua="unhandled",iua="aspnetcore.diagnostics.handler.type",oua="aspnetcore.rate_limiting.policy",sua="aspnetcore.rate_limiting.result",aua="acquired",cua="endpoint_limiter",lua="global_limiter",uua="request_canceled",dua="aspnetcore.request.is_unhandled",fua="aspnetcore.routing.is_fallback",pua="aspnetcore.routing.match_status",hua="failure",mua="success",gua="aspnetcore.user.is_authenticated",Aua="client.address",yua="client.port",Eua="code.column.number",_ua="code.file.path",Cua="code.function.name",vua="code.line.number",bua="code.stacktrace",Sua="db.collection.name",Tua="db.namespace",Iua="db.operation.batch.size",xua="db.operation.name",wua="db.query.summary",Rua="db.query.text",kua="db.response.status_code",Pua="db.stored_procedure.name",Dua="db.system.name",Nua="mariadb",Mua="microsoft.sql_server",Oua="mysql",Bua="postgresql",Lua="dotnet.gc.heap.generation",Fua="gen0",Uua="gen1",Qua="gen2",xKf="loh",wKf="poh",qua="error.type",jua="_OTHER",Hua="exception.escaped",Gua="exception.message",$ua="exception.stacktrace",Vua="exception.type",Wua=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),zua="http.request.method",Yua="_OTHER",Kua="CONNECT",Jua="DELETE",Zua="GET",Xua="HEAD",eda="OPTIONS",tda="PATCH",rda="POST",nda="PUT",ida="TRACE",oda="http.request.method_original",sda="http.request.resend_count",ada=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),cda="http.response.status_code",lda="http.route",uda="jvm.gc.action",dda="jvm.gc.name",fda="jvm.memory.pool.name",pda="jvm.memory.type",hda="heap",mda="non_heap",gda="jvm.thread.daemon",Ada="jvm.thread.state",yda="blocked",Eda="new",_da="runnable",Cda="terminated",vda="timed_waiting",bda="waiting",Sda="network.local.address",Tda="network.local.port",Ida="network.peer.address",xda="network.peer.port",wda="network.protocol.name",Rda="network.protocol.version",kda="network.transport",Pda="pipe",Dda="quic",Nda="tcp",Mda="udp",Oda="unix",Bda="network.type",Lda="ipv4",Fda="ipv6",Uda="otel.scope.name",Qda="otel.scope.version",qda="otel.status_code",jda="ERROR",Hda="OK",Gda="otel.status_description",$da="server.address",Vda="server.port",Wda="service.name",zda="service.version",Yda="signalr.connection.status",Kda="app_shutdown",Jda="normal_closure",Zda="timeout",Xda="signalr.transport",efa="long_polling",tfa="server_sent_events",rfa="web_sockets",g0r="telemetry.sdk.language",nfa="cpp",ifa="dotnet",ofa="erlang",sfa="go",afa="java",A0r="nodejs",cfa="php",lfa="python",ufa="ruby",dfa="rust",ffa="swift",pfa="webjs",y0r="telemetry.sdk.name",E0r="telemetry.sdk.version",hfa="url.fragment",mfa="url.full",gfa="url.path",Afa="url.query",yfa="url.scheme",Efa="user_agent.original"});var _fa,Cfa,vfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,kfa,Pfa,Dfa,Nfa,Mfa,Ofa,Bfa,Lfa,Ffa,Ufa,Qfa,qfa,jfa,Hfa,Gfa,$fa,Vfa,Wfa,zfa,Yfa,Kfa,Jfa,Zfa,Xfa,epa,tpa,rpa,npa,ipa,opa,spa,apa,cpa,lpa,upa,dpa,fpa,ppa,hpa,mpa,gpa,nhi=me(()=>{p();_fa="aspnetcore.diagnostics.exceptions",Cfa="aspnetcore.rate_limiting.active_request_leases",vfa="aspnetcore.rate_limiting.queued_requests",bfa="aspnetcore.rate_limiting.request.time_in_queue",Sfa="aspnetcore.rate_limiting.request_lease.duration",Tfa="aspnetcore.rate_limiting.requests",Ifa="aspnetcore.routing.match_attempts",xfa="db.client.operation.duration",wfa="dotnet.assembly.count",Rfa="dotnet.exceptions",kfa="dotnet.gc.collections",Pfa="dotnet.gc.heap.total_allocated",Dfa="dotnet.gc.last_collection.heap.fragmentation.size",Nfa="dotnet.gc.last_collection.heap.size",Mfa="dotnet.gc.last_collection.memory.committed_size",Ofa="dotnet.gc.pause.time",Bfa="dotnet.jit.compilation.time",Lfa="dotnet.jit.compiled_il.size",Ffa="dotnet.jit.compiled_methods",Ufa="dotnet.monitor.lock_contentions",Qfa="dotnet.process.cpu.count",qfa="dotnet.process.cpu.time",jfa="dotnet.process.memory.working_set",Hfa="dotnet.thread_pool.queue.length",Gfa="dotnet.thread_pool.thread.count",$fa="dotnet.thread_pool.work_item.count",Vfa="dotnet.timer.count",Wfa="http.client.request.duration",zfa="http.server.request.duration",Yfa="jvm.class.count",Kfa="jvm.class.loaded",Jfa="jvm.class.unloaded",Zfa="jvm.cpu.count",Xfa="jvm.cpu.recent_utilization",epa="jvm.cpu.time",tpa="jvm.gc.duration",rpa="jvm.memory.committed",npa="jvm.memory.limit",ipa="jvm.memory.used",opa="jvm.memory.used_after_last_gc",spa="jvm.thread.count",apa="kestrel.active_connections",cpa="kestrel.active_tls_handshakes",lpa="kestrel.connection.duration",upa="kestrel.queued_connections",dpa="kestrel.queued_requests",fpa="kestrel.rejected_connections",ppa="kestrel.tls_handshake.duration",hpa="kestrel.upgraded_connections",mpa="signalr.server.active_connections",gpa="signalr.server.connection.duration"});var Apa,ihi=me(()=>{p();Apa="exception"});var _0r={};wi(_0r,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>eua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>tua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>rua,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>nua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>aua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>cua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>lua,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>uua,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>hua,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>mua,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Xla,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>iua,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>oua,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>sua,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>dua,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>fua,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>pua,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>gua,ATTR_CLIENT_ADDRESS:()=>Aua,ATTR_CLIENT_PORT:()=>yua,ATTR_CODE_COLUMN_NUMBER:()=>Eua,ATTR_CODE_FILE_PATH:()=>_ua,ATTR_CODE_FUNCTION_NAME:()=>Cua,ATTR_CODE_LINE_NUMBER:()=>vua,ATTR_CODE_STACKTRACE:()=>bua,ATTR_DB_COLLECTION_NAME:()=>Sua,ATTR_DB_NAMESPACE:()=>Tua,ATTR_DB_OPERATION_BATCH_SIZE:()=>Iua,ATTR_DB_OPERATION_NAME:()=>xua,ATTR_DB_QUERY_SUMMARY:()=>wua,ATTR_DB_QUERY_TEXT:()=>Rua,ATTR_DB_RESPONSE_STATUS_CODE:()=>kua,ATTR_DB_STORED_PROCEDURE_NAME:()=>Pua,ATTR_DB_SYSTEM_NAME:()=>Dua,ATTR_DOTNET_GC_HEAP_GENERATION:()=>Lua,ATTR_ERROR_TYPE:()=>qua,ATTR_EXCEPTION_ESCAPED:()=>Hua,ATTR_EXCEPTION_MESSAGE:()=>Gua,ATTR_EXCEPTION_STACKTRACE:()=>$ua,ATTR_EXCEPTION_TYPE:()=>Vua,ATTR_HTTP_REQUEST_HEADER:()=>Wua,ATTR_HTTP_REQUEST_METHOD:()=>zua,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>oda,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>sda,ATTR_HTTP_RESPONSE_HEADER:()=>ada,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>cda,ATTR_HTTP_ROUTE:()=>lda,ATTR_JVM_GC_ACTION:()=>uda,ATTR_JVM_GC_NAME:()=>dda,ATTR_JVM_MEMORY_POOL_NAME:()=>fda,ATTR_JVM_MEMORY_TYPE:()=>pda,ATTR_JVM_THREAD_DAEMON:()=>gda,ATTR_JVM_THREAD_STATE:()=>Ada,ATTR_NETWORK_LOCAL_ADDRESS:()=>Sda,ATTR_NETWORK_LOCAL_PORT:()=>Tda,ATTR_NETWORK_PEER_ADDRESS:()=>Ida,ATTR_NETWORK_PEER_PORT:()=>xda,ATTR_NETWORK_PROTOCOL_NAME:()=>wda,ATTR_NETWORK_PROTOCOL_VERSION:()=>Rda,ATTR_NETWORK_TRANSPORT:()=>kda,ATTR_NETWORK_TYPE:()=>Bda,ATTR_OTEL_SCOPE_NAME:()=>Uda,ATTR_OTEL_SCOPE_VERSION:()=>Qda,ATTR_OTEL_STATUS_CODE:()=>qda,ATTR_OTEL_STATUS_DESCRIPTION:()=>Gda,ATTR_SERVER_ADDRESS:()=>$da,ATTR_SERVER_PORT:()=>Vda,ATTR_SERVICE_NAME:()=>Wda,ATTR_SERVICE_VERSION:()=>zda,ATTR_SIGNALR_CONNECTION_STATUS:()=>Yda,ATTR_SIGNALR_TRANSPORT:()=>Xda,ATTR_TELEMETRY_SDK_LANGUAGE:()=>g0r,ATTR_TELEMETRY_SDK_NAME:()=>y0r,ATTR_TELEMETRY_SDK_VERSION:()=>E0r,ATTR_URL_FRAGMENT:()=>hfa,ATTR_URL_FULL:()=>mfa,ATTR_URL_PATH:()=>gfa,ATTR_URL_QUERY:()=>Afa,ATTR_URL_SCHEME:()=>yfa,ATTR_USER_AGENT_ORIGINAL:()=>Efa,AWSECSLAUNCHTYPEVALUES_EC2:()=>Ela,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>_la,AwsEcsLaunchtypeValues:()=>Cla,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>tla,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>rla,CLOUDPLATFORMVALUES_AWS_EC2:()=>nla,CLOUDPLATFORMVALUES_AWS_ECS:()=>ila,CLOUDPLATFORMVALUES_AWS_EKS:()=>ola,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>ala,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>sla,CLOUDPLATFORMVALUES_AZURE_AKS:()=>ula,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>fla,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>lla,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>dla,CLOUDPLATFORMVALUES_AZURE_VM:()=>cla,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Ala,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>gla,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>hla,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>pla,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>mla,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Kca,CLOUDPROVIDERVALUES_AWS:()=>Jca,CLOUDPROVIDERVALUES_AZURE:()=>Zca,CLOUDPROVIDERVALUES_GCP:()=>Xca,CloudPlatformValues:()=>yla,CloudProviderValues:()=>ela,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>Moa,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>joa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>Ooa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>qoa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>Loa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>Goa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>Foa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>Boa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>Hoa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Qoa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>Uoa,DBSYSTEMVALUES_ADABAS:()=>noa,DBSYSTEMVALUES_CACHE:()=>roa,DBSYSTEMVALUES_CASSANDRA:()=>_oa,DBSYSTEMVALUES_CLOUDSCAPE:()=>zia,DBSYSTEMVALUES_COCKROACHDB:()=>Doa,DBSYSTEMVALUES_COLDFUSION:()=>Eoa,DBSYSTEMVALUES_COSMOSDB:()=>Ioa,DBSYSTEMVALUES_COUCHBASE:()=>Soa,DBSYSTEMVALUES_COUCHDB:()=>Toa,DBSYSTEMVALUES_DB2:()=>Gia,DBSYSTEMVALUES_DERBY:()=>ooa,DBSYSTEMVALUES_DYNAMODB:()=>xoa,DBSYSTEMVALUES_EDB:()=>toa,DBSYSTEMVALUES_ELASTICSEARCH:()=>koa,DBSYSTEMVALUES_FILEMAKER:()=>soa,DBSYSTEMVALUES_FIREBIRD:()=>ioa,DBSYSTEMVALUES_FIRSTSQL:()=>eoa,DBSYSTEMVALUES_GEODE:()=>Roa,DBSYSTEMVALUES_H2:()=>yoa,DBSYSTEMVALUES_HANADB:()=>Zia,DBSYSTEMVALUES_HBASE:()=>Coa,DBSYSTEMVALUES_HIVE:()=>Wia,DBSYSTEMVALUES_HSQLDB:()=>Yia,DBSYSTEMVALUES_INFORMIX:()=>aoa,DBSYSTEMVALUES_INGRES:()=>Xia,DBSYSTEMVALUES_INSTANTDB:()=>coa,DBSYSTEMVALUES_INTERBASE:()=>loa,DBSYSTEMVALUES_MARIADB:()=>uoa,DBSYSTEMVALUES_MAXDB:()=>Jia,DBSYSTEMVALUES_MEMCACHED:()=>Poa,DBSYSTEMVALUES_MONGODB:()=>voa,DBSYSTEMVALUES_MSSQL:()=>qia,DBSYSTEMVALUES_MYSQL:()=>jia,DBSYSTEMVALUES_NEO4J:()=>woa,DBSYSTEMVALUES_NETEZZA:()=>doa,DBSYSTEMVALUES_ORACLE:()=>Hia,DBSYSTEMVALUES_OTHER_SQL:()=>Qia,DBSYSTEMVALUES_PERVASIVE:()=>foa,DBSYSTEMVALUES_POINTBASE:()=>poa,DBSYSTEMVALUES_POSTGRESQL:()=>$ia,DBSYSTEMVALUES_PROGRESS:()=>Kia,DBSYSTEMVALUES_REDIS:()=>boa,DBSYSTEMVALUES_REDSHIFT:()=>Via,DBSYSTEMVALUES_SQLITE:()=>hoa,DBSYSTEMVALUES_SYBASE:()=>moa,DBSYSTEMVALUES_TERADATA:()=>goa,DBSYSTEMVALUES_VERTICA:()=>Aoa,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Nua,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>Mua,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Oua,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>Bua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Fua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>Uua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Qua,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>xKf,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>wKf,DbCassandraConsistencyLevelValues:()=>$oa,DbSystemValues:()=>Noa,ERROR_TYPE_VALUE_OTHER:()=>jua,EVENT_EXCEPTION:()=>Apa,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>esa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Xoa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Zoa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>rsa,FAASINVOKEDPROVIDERVALUES_AWS:()=>nsa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>isa,FAASINVOKEDPROVIDERVALUES_GCP:()=>osa,FAASTRIGGERVALUES_DATASOURCE:()=>Voa,FAASTRIGGERVALUES_HTTP:()=>Woa,FAASTRIGGERVALUES_OTHER:()=>Koa,FAASTRIGGERVALUES_PUBSUB:()=>zoa,FAASTRIGGERVALUES_TIMER:()=>Yoa,FaasDocumentOperationValues:()=>tsa,FaasInvokedProviderValues:()=>ssa,FaasTriggerValues:()=>Joa,HOSTARCHVALUES_AMD64:()=>vla,HOSTARCHVALUES_ARM32:()=>bla,HOSTARCHVALUES_ARM64:()=>Sla,HOSTARCHVALUES_IA64:()=>Tla,HOSTARCHVALUES_PPC32:()=>Ila,HOSTARCHVALUES_PPC64:()=>xla,HOSTARCHVALUES_X86:()=>wla,HTTPFLAVORVALUES_HTTP_1_0:()=>Hsa,HTTPFLAVORVALUES_HTTP_1_1:()=>Gsa,HTTPFLAVORVALUES_HTTP_2_0:()=>$sa,HTTPFLAVORVALUES_QUIC:()=>Wsa,HTTPFLAVORVALUES_SPDY:()=>Vsa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Kua,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>Jua,HTTP_REQUEST_METHOD_VALUE_GET:()=>Zua,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Xua,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>eda,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Yua,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>tda,HTTP_REQUEST_METHOD_VALUE_POST:()=>rda,HTTP_REQUEST_METHOD_VALUE_PUT:()=>nda,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>ida,HostArchValues:()=>Rla,HttpFlavorValues:()=>zsa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>hda,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>mda,JVM_THREAD_STATE_VALUE_BLOCKED:()=>yda,JVM_THREAD_STATE_VALUE_NEW:()=>Eda,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>_da,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Cda,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>vda,JVM_THREAD_STATE_VALUE_WAITING:()=>bda,MESSAGETYPEVALUES_RECEIVED:()=>_aa,MESSAGETYPEVALUES_SENT:()=>Eaa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Ysa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Ksa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Xsa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Zsa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>_fa,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Cfa,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>vfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Tfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Sfa,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>bfa,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Ifa,METRIC_DB_CLIENT_OPERATION_DURATION:()=>xfa,METRIC_DOTNET_ASSEMBLY_COUNT:()=>wfa,METRIC_DOTNET_EXCEPTIONS:()=>Rfa,METRIC_DOTNET_GC_COLLECTIONS:()=>kfa,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>Pfa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>Dfa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Nfa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Mfa,METRIC_DOTNET_GC_PAUSE_TIME:()=>Ofa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Bfa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Lfa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Ffa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Ufa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>Qfa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>qfa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>jfa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>Hfa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Gfa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>$fa,METRIC_DOTNET_TIMER_COUNT:()=>Vfa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Wfa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>zfa,METRIC_JVM_CLASS_COUNT:()=>Yfa,METRIC_JVM_CLASS_LOADED:()=>Kfa,METRIC_JVM_CLASS_UNLOADED:()=>Jfa,METRIC_JVM_CPU_COUNT:()=>Zfa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Xfa,METRIC_JVM_CPU_TIME:()=>epa,METRIC_JVM_GC_DURATION:()=>tpa,METRIC_JVM_MEMORY_COMMITTED:()=>rpa,METRIC_JVM_MEMORY_LIMIT:()=>npa,METRIC_JVM_MEMORY_USED:()=>ipa,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>opa,METRIC_JVM_THREAD_COUNT:()=>spa,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>apa,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>cpa,METRIC_KESTREL_CONNECTION_DURATION:()=>lpa,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>upa,METRIC_KESTREL_QUEUED_REQUESTS:()=>dpa,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>fpa,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>ppa,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>hpa,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>mpa,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>gpa,MessageTypeValues:()=>Caa,MessagingDestinationKindValues:()=>Jsa,MessagingOperationValues:()=>eaa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Ssa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>xsa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>vsa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>Msa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Tsa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Isa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>Dsa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Csa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>Bsa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>wsa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>ksa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>Osa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Rsa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>Psa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>Fsa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>Nsa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>qsa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>Usa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Qsa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>Lsa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>bsa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Asa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>ysa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>Esa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>msa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>gsa,NETTRANSPORTVALUES_INPROC:()=>fsa,NETTRANSPORTVALUES_IP:()=>lsa,NETTRANSPORTVALUES_IP_TCP:()=>asa,NETTRANSPORTVALUES_IP_UDP:()=>csa,NETTRANSPORTVALUES_OTHER:()=>psa,NETTRANSPORTVALUES_PIPE:()=>dsa,NETTRANSPORTVALUES_UNIX:()=>usa,NETWORK_TRANSPORT_VALUE_PIPE:()=>Pda,NETWORK_TRANSPORT_VALUE_QUIC:()=>Dda,NETWORK_TRANSPORT_VALUE_TCP:()=>Nda,NETWORK_TRANSPORT_VALUE_UDP:()=>Mda,NETWORK_TRANSPORT_VALUE_UNIX:()=>Oda,NETWORK_TYPE_VALUE_IPV4:()=>Lda,NETWORK_TYPE_VALUE_IPV6:()=>Fda,NetHostConnectionSubtypeValues:()=>jsa,NetHostConnectionTypeValues:()=>_sa,NetTransportValues:()=>hsa,OSTYPEVALUES_AIX:()=>Fla,OSTYPEVALUES_DARWIN:()=>Dla,OSTYPEVALUES_DRAGONFLYBSD:()=>Bla,OSTYPEVALUES_FREEBSD:()=>Nla,OSTYPEVALUES_HPUX:()=>Lla,OSTYPEVALUES_LINUX:()=>Pla,OSTYPEVALUES_NETBSD:()=>Mla,OSTYPEVALUES_OPENBSD:()=>Ola,OSTYPEVALUES_SOLARIS:()=>Ula,OSTYPEVALUES_WINDOWS:()=>kla,OSTYPEVALUES_Z_OS:()=>Qla,OTEL_STATUS_CODE_VALUE_ERROR:()=>jda,OTEL_STATUS_CODE_VALUE_OK:()=>Hda,OsTypeValues:()=>qla,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>daa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>aaa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>raa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>gaa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>oaa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>uaa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>haa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>iaa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>saa,RPCGRPCSTATUSCODEVALUES_OK:()=>taa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>faa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>caa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>laa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Aaa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>maa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>paa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>naa,RpcGrpcStatusCodeValues:()=>yaa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>zna,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>sia,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>$na,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>qna,SEMATTRS_AWS_DYNAMODB_COUNT:()=>iia,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Xna,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Jna,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>aia,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Yna,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>jna,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Wna,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Zna,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Vna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>Hna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>Gna,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>oia,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>tia,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>ria,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Kna,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>eia,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Qna,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>nia,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Era,SEMATTRS_CODE_FILEPATH:()=>bna,SEMATTRS_CODE_FUNCTION:()=>Cna,SEMATTRS_CODE_LINENO:()=>Sna,SEMATTRS_CODE_NAMESPACE:()=>vna,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>kra,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>Ora,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>Mra,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>Dra,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>wra,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Rra,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>Nra,SEMATTRS_DB_CASSANDRA_TABLE:()=>Pra,SEMATTRS_DB_CONNECTION_STRING:()=>Cra,SEMATTRS_DB_HBASE_NAMESPACE:()=>Bra,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>bra,SEMATTRS_DB_MONGODB_COLLECTION:()=>Fra,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>xra,SEMATTRS_DB_NAME:()=>Sra,SEMATTRS_DB_OPERATION:()=>Ira,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>Lra,SEMATTRS_DB_SQL_TABLE:()=>Ura,SEMATTRS_DB_STATEMENT:()=>Tra,SEMATTRS_DB_SYSTEM:()=>_ra,SEMATTRS_DB_USER:()=>vra,SEMATTRS_ENDUSER_ID:()=>gna,SEMATTRS_ENDUSER_ROLE:()=>Ana,SEMATTRS_ENDUSER_SCOPE:()=>yna,SEMATTRS_EXCEPTION_ESCAPED:()=>Hra,SEMATTRS_EXCEPTION_MESSAGE:()=>qra,SEMATTRS_EXCEPTION_STACKTRACE:()=>jra,SEMATTRS_EXCEPTION_TYPE:()=>Qra,SEMATTRS_FAAS_COLDSTART:()=>Zra,SEMATTRS_FAAS_CRON:()=>Jra,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Vra,SEMATTRS_FAAS_DOCUMENT_NAME:()=>Yra,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Wra,SEMATTRS_FAAS_DOCUMENT_TIME:()=>zra,SEMATTRS_FAAS_EXECUTION:()=>$ra,SEMATTRS_FAAS_INVOKED_NAME:()=>Xra,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>ena,SEMATTRS_FAAS_INVOKED_REGION:()=>tna,SEMATTRS_FAAS_TIME:()=>Kra,SEMATTRS_FAAS_TRIGGER:()=>Gra,SEMATTRS_HTTP_CLIENT_IP:()=>Una,SEMATTRS_HTTP_FLAVOR:()=>Pna,SEMATTRS_HTTP_HOST:()=>wna,SEMATTRS_HTTP_METHOD:()=>Tna,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>Nna,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>Mna,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>Ona,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>Bna,SEMATTRS_HTTP_ROUTE:()=>Fna,SEMATTRS_HTTP_SCHEME:()=>Rna,SEMATTRS_HTTP_SERVER_NAME:()=>Lna,SEMATTRS_HTTP_STATUS_CODE:()=>kna,SEMATTRS_HTTP_TARGET:()=>xna,SEMATTRS_HTTP_URL:()=>Ina,SEMATTRS_HTTP_USER_AGENT:()=>Dna,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Lia,SEMATTRS_MESSAGE_ID:()=>Bia,SEMATTRS_MESSAGE_TYPE:()=>Oia,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Fia,SEMATTRS_MESSAGING_CONSUMER_ID:()=>_ia,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>gia,SEMATTRS_MESSAGING_DESTINATION:()=>lia,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>uia,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Sia,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>bia,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>via,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Tia,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Iia,SEMATTRS_MESSAGING_MESSAGE_ID:()=>mia,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>yia,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Aia,SEMATTRS_MESSAGING_OPERATION:()=>Eia,SEMATTRS_MESSAGING_PROTOCOL:()=>fia,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>pia,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Cia,SEMATTRS_MESSAGING_SYSTEM:()=>cia,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>dia,SEMATTRS_MESSAGING_URL:()=>hia,SEMATTRS_NET_HOST_CARRIER_ICC:()=>hna,SEMATTRS_NET_HOST_CARRIER_MCC:()=>fna,SEMATTRS_NET_HOST_CARRIER_MNC:()=>pna,SEMATTRS_NET_HOST_CARRIER_NAME:()=>dna,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>una,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>lna,SEMATTRS_NET_HOST_IP:()=>sna,SEMATTRS_NET_HOST_NAME:()=>cna,SEMATTRS_NET_HOST_PORT:()=>ana,SEMATTRS_NET_PEER_IP:()=>nna,SEMATTRS_NET_PEER_NAME:()=>ona,SEMATTRS_NET_PEER_PORT:()=>ina,SEMATTRS_NET_TRANSPORT:()=>rna,SEMATTRS_PEER_SERVICE:()=>mna,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>kia,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Nia,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Mia,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Dia,SEMATTRS_RPC_JSONRPC_VERSION:()=>Pia,SEMATTRS_RPC_METHOD:()=>Ria,SEMATTRS_RPC_SERVICE:()=>wia,SEMATTRS_RPC_SYSTEM:()=>xia,SEMATTRS_THREAD_ID:()=>Ena,SEMATTRS_THREAD_NAME:()=>_na,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>waa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>xaa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Raa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>kaa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>Paa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>Daa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>Naa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>Oaa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>Maa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>Laa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>Baa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>baa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Taa,SEMRESATTRS_CLOUD_PLATFORM:()=>Iaa,SEMRESATTRS_CLOUD_PROVIDER:()=>vaa,SEMRESATTRS_CLOUD_REGION:()=>Saa,SEMRESATTRS_CONTAINER_ID:()=>Uaa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>qaa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>jaa,SEMRESATTRS_CONTAINER_NAME:()=>Faa,SEMRESATTRS_CONTAINER_RUNTIME:()=>Qaa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>Haa,SEMRESATTRS_DEVICE_ID:()=>Gaa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>$aa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Vaa,SEMRESATTRS_FAAS_ID:()=>zaa,SEMRESATTRS_FAAS_INSTANCE:()=>Kaa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Jaa,SEMRESATTRS_FAAS_NAME:()=>Waa,SEMRESATTRS_FAAS_VERSION:()=>Yaa,SEMRESATTRS_HOST_ARCH:()=>tca,SEMRESATTRS_HOST_ID:()=>Zaa,SEMRESATTRS_HOST_IMAGE_ID:()=>nca,SEMRESATTRS_HOST_IMAGE_NAME:()=>rca,SEMRESATTRS_HOST_IMAGE_VERSION:()=>ica,SEMRESATTRS_HOST_NAME:()=>Xaa,SEMRESATTRS_HOST_TYPE:()=>eca,SEMRESATTRS_K8S_CLUSTER_NAME:()=>oca,SEMRESATTRS_K8S_CONTAINER_NAME:()=>dca,SEMRESATTRS_K8S_CRONJOB_NAME:()=>bca,SEMRESATTRS_K8S_CRONJOB_UID:()=>vca,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>Eca,SEMRESATTRS_K8S_DAEMONSET_UID:()=>yca,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>mca,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>hca,SEMRESATTRS_K8S_JOB_NAME:()=>Cca,SEMRESATTRS_K8S_JOB_UID:()=>_ca,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>cca,SEMRESATTRS_K8S_NODE_NAME:()=>sca,SEMRESATTRS_K8S_NODE_UID:()=>aca,SEMRESATTRS_K8S_POD_NAME:()=>uca,SEMRESATTRS_K8S_POD_UID:()=>lca,SEMRESATTRS_K8S_REPLICASET_NAME:()=>pca,SEMRESATTRS_K8S_REPLICASET_UID:()=>fca,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Aca,SEMRESATTRS_K8S_STATEFULSET_UID:()=>gca,SEMRESATTRS_OS_DESCRIPTION:()=>Tca,SEMRESATTRS_OS_NAME:()=>Ica,SEMRESATTRS_OS_TYPE:()=>Sca,SEMRESATTRS_OS_VERSION:()=>xca,SEMRESATTRS_PROCESS_COMMAND:()=>Pca,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Nca,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Dca,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Rca,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>kca,SEMRESATTRS_PROCESS_OWNER:()=>Mca,SEMRESATTRS_PROCESS_PID:()=>wca,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Lca,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Oca,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Bca,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Qca,SEMRESATTRS_SERVICE_NAME:()=>Fca,SEMRESATTRS_SERVICE_NAMESPACE:()=>Uca,SEMRESATTRS_SERVICE_VERSION:()=>qca,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>$ca,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Hca,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>jca,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Gca,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>zca,SEMRESATTRS_WEBENGINE_NAME:()=>Vca,SEMRESATTRS_WEBENGINE_VERSION:()=>Wca,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Kda,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Jda,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Zda,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>efa,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>tfa,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>rfa,SemanticAttributes:()=>Uia,SemanticResourceAttributes:()=>Yca,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>jla,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>Hla,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>Gla,TELEMETRYSDKLANGUAGEVALUES_GO:()=>$la,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Vla,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Wla,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>zla,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Yla,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Kla,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Jla,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>nfa,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>ifa,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>ofa,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>sfa,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>afa,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>A0r,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>cfa,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>lfa,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>ufa,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>dfa,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>ffa,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>pfa,TelemetrySdkLanguageValues:()=>Zla});var gft=me(()=>{p();Rdi();thi();rhi();nhi();ihi()});var ohi,shi=me(()=>{p();ohi="process.runtime.name"});var Aft,ahi=me(()=>{p();Fsi();gft();shi();Aft={[y0r]:"opentelemetry",[ohi]:"node",[g0r]:A0r,[E0r]:Lsi}});var chi=me(()=>{p();Nsi();Msi();Bsi();ahi()});var C0r=me(()=>{p();chi()});function zhe(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*Epa);return[r,n]}function Eft(){let t=xH.timeOrigin;if(typeof t!="number"){let e=xH;t=e.timing&&e.timing.fetchStart}return t}function v0r(t){let e=zhe(Eft()),r=zhe(typeof t=="number"?t:xH.now());return b0r(e,r)}function uhi(t){if(_ft(t))return t;if(typeof t=="number")return t=yft&&(r[1]-=yft,r[0]+=1),r}var lhi,ypa,Epa,yft,Ahi=me(()=>{p();C0r();lhi=9,ypa=6,Epa=Math.pow(10,ypa),yft=Math.pow(10,lhi);a(zhe,"millisToHrTime");a(Eft,"getTimeOrigin");a(v0r,"hrTime");a(uhi,"timeInputToHrTime");a(dhi,"hrTimeDuration");a(fhi,"hrTimeToTimeStamp");a(phi,"hrTimeToNanoseconds");a(hhi,"hrTimeToMilliseconds");a(mhi,"hrTimeToMicroseconds");a(_ft,"isTimeInputHrTime");a(ghi,"isTimeInput");a(b0r,"addHrTimes")});function yhi(t){typeof t!="number"&&t.unref()}var Ehi=me(()=>{p();a(yhi,"unrefTimer")});var Cft,_hi=me(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Cft||(Cft={}))});var vft,Chi=me(()=>{p();co();vft=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){kn.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){kn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function vhi(t){return vpa.test(t)}function bhi(t){return bpa.test(t)&&!Spa.test(t)}var S0r,_pa,Cpa,vpa,bpa,Spa,Shi=me(()=>{p();S0r="[_0-9a-z-*/]",_pa=`[a-z]${S0r}{0,255}`,Cpa=`[a-z0-9]${S0r}{0,240}@[a-z]${S0r}{0,13}`,vpa=new RegExp(`^(?:${_pa}|${Cpa})$`),bpa=/^[ -~]{0,255}[!-~]$/,Spa=/,|=/;a(vhi,"validateKey");a(bhi,"validateValue")});var Thi,Tpa,Ihi,xhi,Yhe,T0r=me(()=>{p();Shi();Thi=32,Tpa=512,Ihi=",",xhi="=",Yhe=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+xhi+this.get(r)),e),[]).join(Ihi)}_parse(e){e.length>Tpa||(this._internalState=e.split(Ihi).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(xhi);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);vhi(c)&&bhi(l)&&r.set(c,l)}return r},new Map),this._internalState.size>Thi&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Thi))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function I0r(t){let e=Ppa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var CNe,vNe,Ipa,xpa,wpa,Rpa,kpa,Ppa,bft,whi=me(()=>{p();co();ENe();T0r();CNe="traceparent",vNe="tracestate",Ipa="00",xpa="(?!ff)[\\da-f]{2}",wpa="(?![0]{32})[\\da-f]{32}",Rpa="(?![0]{16})[\\da-f]{16}",kpa="[\\da-f]{2}",Ppa=new RegExp(`^\\s?(${xpa})-(${wpa})-(${Rpa})-(${kpa})(-.*)?\\s?$`);a(I0r,"parseTraceParent");bft=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=Cu.getSpanContext(e);if(!o||Whe(e)||!mb(o))return;let s=`${Ipa}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||yf.NONE).toString(16)}`;n.set(r,CNe,s),o.traceState&&n.set(r,vNe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,CNe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=I0r(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,vNe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new Yhe(typeof u=="string"?u:void 0)}return Cu.setSpanContext(e,c)}fields(){return[CNe,vNe]}}});function Rhi(t,e){return t.setValue(x0r,e)}function khi(t){return t.deleteValue(x0r)}function Phi(t){return t.getValue(x0r)}var x0r,Sft,Dhi=me(()=>{p();co();x0r=hb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Sft||(Sft={}));a(Rhi,"setRPCMetadata");a(khi,"deleteRPCMetadata");a(Phi,"getRPCMetadata")});function w0r(t){if(!Fpa(t)||Upa(t)!==Dpa)return!1;let e=Lpa(t);if(e===null)return!0;let r=Ohi.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Nhi.call(r)===Bpa}function Fpa(t){return t!=null&&typeof t=="object"}function Upa(t){return t==null?t===void 0?Mpa:Npa:PX&&PX in Object(t)?Qpa(t):qpa(t)}function Qpa(t){let e=Ohi.call(t,PX),r=t[PX],n=!1;try{t[PX]=void 0,n=!0}catch{}let o=Bhi.call(t);return n&&(e?t[PX]=r:delete t[PX]),o}function qpa(t){return Bhi.call(t)}var Dpa,Npa,Mpa,Opa,Nhi,Bpa,Lpa,Mhi,Ohi,PX,Bhi,Lhi=me(()=>{p();Dpa="[object Object]",Npa="[object Null]",Mpa="[object Undefined]",Opa=Function.prototype,Nhi=Opa.toString,Bpa=Nhi.call(Object),Lpa=Object.getPrototypeOf,Mhi=Object.prototype,Ohi=Mhi.hasOwnProperty,PX=Symbol?Symbol.toStringTag:void 0,Bhi=Mhi.toString;a(w0r,"isPlainObject");a(Fpa,"isObjectLike");a(Upa,"baseGetTag");a(Qpa,"getRawTag");a(qpa,"objectToString")});function Uhi(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=Qhi(e,t.shift(),0,r);return e}function R0r(t){return Ift(t)?t.slice():t}function Qhi(t,e,r=0,n){let o;if(!(r>jpa)){if(r++,Tft(t)||Tft(e)||qhi(e))o=R0r(e);else if(Ift(t)){if(o=t.slice(),Ift(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(Fhi(t,u,n)||Fhi(e,u,n))delete o[u];else{if(bNe(f)&&bNe(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=Qhi(o[u],d,r,n)}}}}else o=e;return o}}function Fhi(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function Hpa(t,e){return!(!w0r(t)||!w0r(e))}var jpa,jhi=me(()=>{p();Lhi();jpa=20;a(Uhi,"merge");a(R0r,"takeValue");a(Qhi,"mergeTwoObjects");a(Fhi,"wasObjectReferenced");a(Ift,"isArray");a(qhi,"isFunction");a(bNe,"isObject");a(Tft,"isPrimitive");a(Hpa,"shouldMerge")});function Hhi(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new SNe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var SNe,Ghi=me(()=>{p();SNe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(Hhi,"callWithTimeout")});function k0r(t,e){return typeof e=="string"?t===e:!!t.match(e)}function $hi(t,e){if(!e)return!1;for(let r of e)if(k0r(t,r))return!0;return!1}var Vhi=me(()=>{p();a(k0r,"urlMatches");a($hi,"isUrlIgnored")});var xft,Whi=me(()=>{p();xft=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var wft,zhi=me(()=>{p();Whi();wft=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new xft;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function Khi(t){if(t==null)return;let e=Yhi[t.toUpperCase()];return e??(kn.warn(`Unknown log level "${t}", expected one of ${Object.keys(Yhi)}, using default`),Da.INFO)}var Yhi,Jhi=me(()=>{p();co();Yhi={ALL:Da.ALL,VERBOSE:Da.VERBOSE,DEBUG:Da.DEBUG,INFO:Da.INFO,WARN:Da.WARN,ERROR:Da.ERROR,NONE:Da.NONE};a(Khi,"diagLogLevelFromString")});function Zhi(t,e){return new Promise(r=>{_g.with(sft(_g.active()),()=>{t.export(e,n=>{r(n)})})})}var Xhi=me(()=>{p();co();ENe();a(Zhi,"_export")});var Rft={};wi(Rft,{AnchoredClock:()=>uft,BindOnceFuture:()=>wft,CompositePropagator:()=>vft,ExportResultCode:()=>Cft,RPCType:()=>Sft,SDK_INFO:()=>Aft,TRACE_PARENT_HEADER:()=>CNe,TRACE_STATE_HEADER:()=>vNe,TimeoutError:()=>SNe,TraceState:()=>Yhe,W3CBaggagePropagator:()=>lft,W3CTraceContextPropagator:()=>bft,_globalThis:()=>mft,addHrTimes:()=>b0r,callWithTimeout:()=>Hhi,deleteRPCMetadata:()=>khi,diagLogLevelFromString:()=>Khi,getBooleanFromEnv:()=>pft,getNumberFromEnv:()=>fft,getRPCMetadata:()=>Phi,getStringFromEnv:()=>_Ne,getStringListFromEnv:()=>hft,getTimeOrigin:()=>Eft,globalErrorHandler:()=>Psi,hrTime:()=>v0r,hrTimeDuration:()=>dhi,hrTimeToMicroseconds:()=>mhi,hrTimeToMilliseconds:()=>hhi,hrTimeToNanoseconds:()=>phi,hrTimeToTimeStamp:()=>fhi,internal:()=>Gpa,isAttributeValue:()=>f0r,isTimeInput:()=>ghi,isTimeInputHrTime:()=>_ft,isTracingSuppressed:()=>Whe,isUrlIgnored:()=>$hi,loggingErrorHandler:()=>dft,merge:()=>Uhi,millisToHrTime:()=>zhe,otperformance:()=>xH,parseKeyPairsIntoRecord:()=>bsi,parseTraceParent:()=>I0r,sanitizeAttributes:()=>Isi,setGlobalErrorHandler:()=>ksi,setRPCMetadata:()=>Rhi,suppressTracing:()=>sft,timeInputToHrTime:()=>uhi,unrefTimer:()=>yhi,unsuppressTracing:()=>ysi,urlMatches:()=>k0r});var Gpa,kft=me(()=>{p();Ssi();Tsi();wsi();Dsi();p0r();Ahi();Ehi();_hi();d0r();C0r();Chi();whi();Dhi();ENe();T0r();jhi();Ghi();Vhi();zhi();Jhi();Xhi();Gpa={_export:Zhi}});var r0i=I(Pft=>{"use strict";p();Object.defineProperty(Pft,"__esModule",{value:!0});Pft.OpenTelemetrySpanWrapper=void 0;var e0i=(co(),Ca(v5)),t0i=(kft(),Ca(Rft)),$pa=c0r(),P0r=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&Vpa(e.error)?e.error?(this._span.setStatus({code:e0i.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:e0i.SpanStatusCode.ERROR}):e.status==="success"&&$pa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,t0i.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,t0i.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Pft.OpenTelemetrySpanWrapper=P0r;function Vpa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(Vpa,"isRecordableError")});var D0r=I(V5=>{"use strict";p();Object.defineProperty(V5,"__esModule",{value:!0});V5.environmentCache=V5.SDK_VERSION=void 0;V5.envVarToBoolean=Wpa;V5.SDK_VERSION="1.0.0-beta.9";V5.environmentCache=new Map;function Wpa(t){var e;V5.environmentCache.has(t)||zpa(t);let r=((e=V5.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(Wpa,"envVarToBoolean");function zpa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];V5.environmentCache.set(t,r)}}a(zpa,"loadEnvironmentVariable")});var s0i=I(Dft=>{"use strict";p();Object.defineProperty(Dft,"__esModule",{value:!0});Dft.toOpenTelemetrySpanKind=o0i;Dft.toSpanOptions=Kpa;var n0i=(co(),Ca(v5)),i0i=(kft(),Ca(Rft));function o0i(t){let e=(t||"internal").toUpperCase();return n0i.SpanKind[e]}a(o0i,"toOpenTelemetrySpanKind");function Ypa(t=[]){return t.reduce((e,r)=>{let n=n0i.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,i0i.sanitizeAttributes)(r.attributes)}),e},[])}a(Ypa,"toOpenTelemetryLinks");function Kpa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,i0i.sanitizeAttributes)(e),s=o0i(n),c=Ypa(r);return{attributes:o,kind:s,links:c}}a(Kpa,"toSpanOptions")});var l0i=I(wH=>{"use strict";p();Object.defineProperty(wH,"__esModule",{value:!0});wH.OpenTelemetryInstrumenter=wH.propagator=void 0;var W5=(co(),Ca(v5)),c0i=(kft(),Ca(Rft)),Jpa=r0i(),a0i=D0r(),Zpa=s0i();wH.propagator=new c0i.W3CTraceContextPropagator;var N0r=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||W5.context.active(),o;return(0,a0i.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=W5.trace.wrapSpanContext(W5.INVALID_SPAN_CONTEXT):(o=W5.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,Zpa.toSpanOptions)(r),n),(0,a0i.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,c0i.suppressTracing)(n))),{span:new Jpa.OpenTelemetrySpanWrapper(o),tracingContext:W5.trace.setSpan(n,o)}}withContext(e,r,...n){return W5.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return wH.propagator.extract(W5.context.active(),{traceparent:e},W5.defaultTextMapGetter)}createRequestHeaders(e){let r={};return wH.propagator.inject(e||W5.context.active(),r,W5.defaultTextMapSetter),r}};wH.OpenTelemetryInstrumenter=N0r});var d0i=I(TNe=>{"use strict";p();Object.defineProperty(TNe,"__esModule",{value:!0});TNe.AzureSdkInstrumentation=void 0;TNe.createAzureSdkInstrumentation=tha;var u0i=(e0r(),Ca(Xhr)),Xpa=l0i(),eha=D0r(),Nft=class extends u0i.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",eha.SDK_VERSION,Object.assign({},e))}init(){let e=new u0i.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Xpa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};TNe.AzureSdkInstrumentation=Nft;function tha(t={}){return new Nft(t)}a(tha,"createAzureSdkInstrumentation")});var p0i=I(Mft=>{"use strict";p();Object.defineProperty(Mft,"__esModule",{value:!0});var f0i=(OL(),Ca(E7));f0i.__exportStar(c0r(),Mft);f0i.__exportStar(d0i(),Mft)});var m0i=I($w=>{"use strict";p();Object.defineProperty($w,"__esModule",{value:!0});$w.enable=$w.azureCoreTracing=$w.AzureMonitorSymbol=void 0;var M0r=dp();$w.AzureMonitorSymbol="Azure_Monitor_Tracer";var O0r="azure-coretracing",h0i=!1,rha=a(function(t){if(h0i)return t;try{var e=(mii(),Ca(hii)),r=(co(),Ca(v5)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var E=y.apply(this,arguments);return M0r.channel.publish(O0r,A),E},A},d[$w.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[$w.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return M0r.channel.publish(O0r,v),T},v},g[$w.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(e0r(),Ca(Xhr)),u=p0i();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}h0i=!0}catch{}return t},"azureCoreTracingPatchFunction");$w.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:rha,publisherName:O0r};function nha(){M0r.channel.registerMonkeyPatch("@azure/core-tracing",$w.azureCoreTracing)}a(nha,"enable");$w.enable=nha});var A0i=I(DX=>{"use strict";p();Object.defineProperty(DX,"__esModule",{value:!0});DX.enable=DX.bunyan=void 0;var g0i=dp(),iha=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),g0i.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");DX.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:iha};function oha(){g0i.channel.registerMonkeyPatch("bunyan",DX.bunyan)}a(oha,"enable");DX.enable=oha});var E0i=I(NX=>{"use strict";p();Object.defineProperty(NX,"__esModule",{value:!0});NX.enable=NX.console=void 0;var B0r=dp(),y0i=require("stream"),sha=a(function(t){var e=new y0i.Writable,r=new y0i.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return B0r.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return B0r.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:sha};function aha(){B0r.channel.registerMonkeyPatch("console",NX.console),require("console")}a(aha,"enable");NX.enable=aha});var _0i=I(MX=>{"use strict";p();Object.defineProperty(MX,"__esModule",{value:!0});MX.enable=MX.mongoCore=void 0;var L0r=dp(),cha=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=L0r.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=L0r.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");MX.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:cha};function lha(){L0r.channel.registerMonkeyPatch("mongodb-core",MX.mongoCore)}a(lha,"enable");MX.enable=lha});var C0i=I(sC=>{"use strict";p();var Khe=sC&&sC.__assign||function(){return Khe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:uha};sC.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:dha};sC.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:pha};function hha(){EE.channel.registerMonkeyPatch("mongodb",sC.mongo2),EE.channel.registerMonkeyPatch("mongodb",sC.mongo3),EE.channel.registerMonkeyPatch("mongodb",sC.mongo330)}a(hha,"enable");sC.enable=hha});var b0i=I(OX=>{"use strict";p();Object.defineProperty(OX,"__esModule",{value:!0});OX.enable=OX.mysql=void 0;var Oft=dp(),v0i=require("path"),mha=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=Oft.channel.bindToContext(h(_,E))):arguments[A]=Oft.channel.bindToContext(E));var v=m.apply(this,arguments);return _.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(v0i.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;Oft.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(v0i.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");OX.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:mha};function gha(){Oft.channel.registerMonkeyPatch("mysql",OX.mysql)}a(gha,"enable");OX.enable=gha});var T0i=I(BX=>{"use strict";p();Object.defineProperty(BX,"__esModule",{value:!0});BX.enable=BX.postgresPool1=void 0;var S0i=dp();function Aha(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=S0i.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(Aha,"postgresPool1PatchFunction");BX.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:Aha};function yha(){S0i.channel.registerMonkeyPatch("pg-pool",BX.postgresPool1)}a(yha,"enable");BX.enable=yha});var x0i=I(z5=>{"use strict";p();Object.defineProperty(z5,"__esModule",{value:!0});z5.enable=z5.postgres=z5.postgres6=void 0;var Jhe=dp(),I0i=require("events"),F0r="postgres";function Eha(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=Jhe.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),Jhe.channel.publish(F0r,u),A){if(m)return m.apply(this,arguments);f&&f instanceof I0i.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(Eha,"postgres6PatchFunction");function _ha(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var b=Jhe.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),Jhe.channel.publish(F0r,m),T){if(v)return v.apply(this,arguments);g&&g instanceof I0i.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(_ha,"postgresLatestPatchFunction");z5.postgres6={versionSpecifier:"6.*",patch:Eha};z5.postgres={versionSpecifier:">=7.* <=8.*",patch:_ha,publisherName:F0r};function Cha(){Jhe.channel.registerMonkeyPatch("pg",z5.postgres6),Jhe.channel.registerMonkeyPatch("pg",z5.postgres)}a(Cha,"enable");z5.enable=Cha});var w0i=I(LX=>{"use strict";p();Object.defineProperty(LX,"__esModule",{value:!0});LX.enable=LX.redis=void 0;var U0r=dp(),vha=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=U0r.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;U0r.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");LX.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:vha};function bha(){U0r.channel.registerMonkeyPatch("redis",LX.redis)}a(bha,"enable");LX.enable=bha});var R0i=I(r8=>{"use strict";p();var Bft=r8&&r8.__assign||function(){return Bft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Sha};function Tha(){Q0r.channel.registerMonkeyPatch("tedious",r8.tedious)}a(Tha,"enable");r8.enable=Tha});var k0i=I(Rb=>{"use strict";p();var Iha=Rb&&Rb.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),xha=Rb&&Rb.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");Rb.winston3={versionSpecifier:"3.x",patch:Rha};Rb.winston2={versionSpecifier:"2.x",patch:wha};function kha(){Lft.channel.registerMonkeyPatch("winston",Rb.winston2),Lft.channel.registerMonkeyPatch("winston",Rb.winston3)}a(kha,"enable");Rb.enable=kha});var j0i=I(bu=>{"use strict";p();Object.defineProperty(bu,"__esModule",{value:!0});bu.enable=bu.tedious=bu.pgPool=bu.pg=bu.winston=bu.redis=bu.mysql=bu.mongodb=bu.mongodbCore=bu.console=bu.bunyan=bu.azuresdk=void 0;var P0i=m0i();bu.azuresdk=P0i;var D0i=A0i();bu.bunyan=D0i;var N0i=E0i();bu.console=N0i;var M0i=_0i();bu.mongodbCore=M0i;var O0i=C0i();bu.mongodb=O0i;var B0i=b0i();bu.mysql=B0i;var L0i=T0i();bu.pgPool=L0i;var F0i=x0i();bu.pg=F0i;var U0i=w0i();bu.redis=U0i;var Q0i=R0i();bu.tedious=Q0i;var q0i=k0i();bu.winston=q0i;function Pha(){D0i.enable(),N0i.enable(),M0i.enable(),O0i.enable(),B0i.enable(),F0i.enable(),L0i.enable(),U0i.enable(),q0i.enable(),P0i.enable(),Q0i.enable()}a(Pha,"enable");bu.enable=Pha});var Qft=I(FX=>{"use strict";p();Object.defineProperty(FX,"__esModule",{value:!0});FX.IsInitialized=void 0;FX.registerContextPreservation=Dha;var q0r=$l(),G0i=Xut();FX.IsInitialized=!G0i.JsonConfig.getInstance().noDiagnosticChannel;var j0r="DiagnosticChannel";if(FX.IsInitialized){R2=j0i(),H0i=G0i.JsonConfig.getInstance().noPatchModules,Fft=H0i.split(","),H0r={bunyan:R2.bunyan,console:R2.console,mongodb:R2.mongodb,mongodbCore:R2.mongodbCore,mysql:R2.mysql,redis:R2.redis,pg:R2.pg,pgPool:R2.pgPool,winston:R2.winston,azuresdk:R2.azuresdk};for(Uft in H0r)Fft.indexOf(Uft)===-1&&(H0r[Uft].enable(),q0r.info(j0r,"Subscribed to ".concat(Uft," events")));Fft.length>0&&q0r.info(j0r,"Some modules will not be patched",Fft)}else q0r.info(j0r,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var R2,H0i,Fft,H0r,Uft;function Dha(t){if(FX.IsInitialized){var e=dp();e.channel.addContextPreservation(t)}}a(Dha,"registerContextPreservation")});var Zhe=I((NXf,$0i)=>{"use strict";p();$0i.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var qA=I((V0r,V0i)=>{"use strict";p();var kH=V0r&&V0r.__assign||function(){return kH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){UX.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){UX.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",UX.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var W0r=qA(),Bha=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+W0r.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=W0r.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=W0r.randomu32(),t})();W0i.exports=Bha});var qft=I((QXf,z0i)=>{"use strict";p();var jA=qA(),Lha=QX(),Fha=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=jA.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=jA.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=jA.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=jA.w3cTraceId().substr(0,16),this.traceId=jA.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=Lha.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=jA.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=jA.w3cTraceId(),this.spanId=jA.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=jA.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();z0i.exports=Fha});var z0r=I((HXf,Y0i)=>{"use strict";p();var Uha=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var Qha=(function(){function t(){}return a(t,"Domain"),t})();K0i.exports=Qha});var Z0i=I((Y0r,J0i)=>{"use strict";p();var qha=Y0r&&Y0r.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),jha=n8(),Hha=(function(t){qha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(jha);J0i.exports=Hha});var K0r=I((JXf,X0i)=>{"use strict";p();var Gha=(function(){function t(){}return a(t,"Base"),t})();X0i.exports=Gha});var tmi=I((eep,emi)=>{"use strict";p();var $ha=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();emi.exports=$ha});var nmi=I((J0r,rmi)=>{"use strict";p();var Vha=J0r&&J0r.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Wha=K0r(),zha=(function(t){Vha(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(Wha);rmi.exports=zha});var X0r=I((oep,imi)=>{"use strict";p();var Z0r;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(Z0r||(Z0r={}));imi.exports=Z0r});var smi=I((aep,omi)=>{"use strict";p();var Yha=X0r(),Kha=(function(){function t(){this.kind=Yha.Measurement}return a(t,"DataPoint"),t})();omi.exports=Kha});var cmi=I((uep,ami)=>{"use strict";p();var Jha=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();ami.exports=Jha});var tmr=I((emr,lmi)=>{"use strict";p();var Zha=emr&&emr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Xha=n8(),e0a=(function(t){Zha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(Xha);lmi.exports=e0a});var dmi=I((rmr,umi)=>{"use strict";p();var t0a=rmr&&rmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),r0a=n8(),n0a=(function(t){t0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(r0a);umi.exports=n0a});var pmi=I((Aep,fmi)=>{"use strict";p();var i0a=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();fmi.exports=i0a});var mmi=I((nmr,hmi)=>{"use strict";p();var o0a=nmr&&nmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),s0a=n8(),a0a=(function(t){o0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(s0a);hmi.exports=a0a});var Ami=I((imr,gmi)=>{"use strict";p();var c0a=imr&&imr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),l0a=n8(),u0a=(function(t){c0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(l0a);gmi.exports=u0a});var Emi=I((omr,ymi)=>{"use strict";p();var d0a=omr&&omr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),f0a=tmr(),p0a=(function(t){d0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(f0a);ymi.exports=p0a});var Cmi=I((smr,_mi)=>{"use strict";p();var h0a=smr&&smr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),m0a=n8(),g0a=(function(t){h0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})(m0a);_mi.exports=g0a});var bmi=I((amr,vmi)=>{"use strict";p();var A0a=amr&&amr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),y0a=n8(),E0a=(function(t){A0a(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(y0a);vmi.exports=E0a});var Tmi=I((kep,Smi)=>{"use strict";p();var cmr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(cmr||(cmr={}));Smi.exports=cmr});var xmi=I((Dep,Imi)=>{"use strict";p();var _0a=(function(){function t(){}return a(t,"StackFrame"),t})();Imi.exports=_0a});var lmr=I(a0=>{"use strict";p();Object.defineProperty(a0,"__esModule",{value:!0});a0.AvailabilityData=Z0i();a0.Base=K0r();a0.ContextTagKeys=tmi();a0.Data=nmi();a0.DataPoint=smi();a0.DataPointType=X0r();a0.Domain=n8();a0.Envelope=cmi();a0.EventData=tmr();a0.ExceptionData=dmi();a0.ExceptionDetails=pmi();a0.MessageData=mmi();a0.MetricData=Ami();a0.PageViewData=Emi();a0.RemoteDependencyData=Cmi();a0.RequestData=bmi();a0.SeverityLevel=Tmi();a0.StackFrame=xmi()});var wmi=I(INe=>{"use strict";p();Object.defineProperty(INe,"__esModule",{value:!0});INe.RemoteDependencyDataConstants=void 0;INe.domainSupportsProperties=v0a;var qX=lmr(),C0a=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();INe.RemoteDependencyDataConstants=C0a;function v0a(t){return"properties"in t||t instanceof qX.EventData||t instanceof qX.ExceptionData||t instanceof qX.MessageData||t instanceof qX.MetricData||t instanceof qX.PageViewData||t instanceof qX.RemoteDependencyData||t instanceof qX.RequestData}a(v0a,"domainSupportsProperties")});var kmi=I(Rmi=>{"use strict";p();Object.defineProperty(Rmi,"__esModule",{value:!0})});var Dmi=I(Pmi=>{"use strict";p();Object.defineProperty(Pmi,"__esModule",{value:!0})});var Mmi=I(Nmi=>{"use strict";p();Object.defineProperty(Nmi,"__esModule",{value:!0})});var Bmi=I(Omi=>{"use strict";p();Object.defineProperty(Omi,"__esModule",{value:!0})});var Fmi=I(Lmi=>{"use strict";p();Object.defineProperty(Lmi,"__esModule",{value:!0})});var Qmi=I(Umi=>{"use strict";p();Object.defineProperty(Umi,"__esModule",{value:!0})});var jmi=I(qmi=>{"use strict";p();Object.defineProperty(qmi,"__esModule",{value:!0})});var Gmi=I(Hmi=>{"use strict";p();Object.defineProperty(Hmi,"__esModule",{value:!0})});var Vmi=I($mi=>{"use strict";p();Object.defineProperty($mi,"__esModule",{value:!0})});var zmi=I(Wmi=>{"use strict";p();Object.defineProperty(Wmi,"__esModule",{value:!0})});var Kmi=I(Ymi=>{"use strict";p();Object.defineProperty(Ymi,"__esModule",{value:!0})});var Zmi=I(Jmi=>{"use strict";p();Object.defineProperty(Jmi,"__esModule",{value:!0})});var Xmi=I(PH=>{"use strict";p();Object.defineProperty(PH,"__esModule",{value:!0});PH.TelemetryType=PH.TelemetryTypeString=void 0;PH.telemetryTypeToBaseType=b0a;PH.baseTypeToTelemetryType=S0a;function b0a(t){switch(t){case bg.Event:return"EventData";case bg.Exception:return"ExceptionData";case bg.Trace:return"MessageData";case bg.Metric:return"MetricData";case bg.Request:return"RequestData";case bg.Dependency:return"RemoteDependencyData";case bg.Availability:return"AvailabilityData";case bg.PageView:return"PageViewData"}}a(b0a,"telemetryTypeToBaseType");function S0a(t){switch(t){case"EventData":return bg.Event;case"ExceptionData":return bg.Exception;case"MessageData":return bg.Trace;case"MetricData":return bg.Metric;case"RequestData":return bg.Request;case"RemoteDependencyData":return bg.Dependency;case"AvailabilityData":return bg.Availability;case"PageViewData":return bg.PageView}}a(S0a,"baseTypeToTelemetryType");PH.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var bg;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(bg||(PH.TelemetryType=bg={}))});var egi=I(cm=>{"use strict";p();var T0a=cm&&cm.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TT=cm&&cm.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&T0a(e,t,r)};Object.defineProperty(cm,"__esModule",{value:!0});TT(kmi(),cm);TT(Dmi(),cm);TT(Mmi(),cm);TT(Bmi(),cm);TT(Fmi(),cm);TT(Qmi(),cm);TT(jmi(),cm);TT(Gmi(),cm);TT(Vmi(),cm);TT(zmi(),cm);TT(Kmi(),cm);TT(Zmi(),cm);TT(Xmi(),cm)});var rgi=I(tgi=>{"use strict";p();Object.defineProperty(tgi,"__esModule",{value:!0})});var igi=I(ngi=>{"use strict";p();Object.defineProperty(ngi,"__esModule",{value:!0})});var sgi=I(ogi=>{"use strict";p();Object.defineProperty(ogi,"__esModule",{value:!0})});var cgi=I(agi=>{"use strict";p();Object.defineProperty(agi,"__esModule",{value:!0})});var ugi=I(lgi=>{"use strict";p();Object.defineProperty(lgi,"__esModule",{value:!0})});var fgi=I(dgi=>{"use strict";p();Object.defineProperty(dgi,"__esModule",{value:!0})});var hgi=I(pgi=>{"use strict";p();Object.defineProperty(pgi,"__esModule",{value:!0})});var ggi=I(mgi=>{"use strict";p();Object.defineProperty(mgi,"__esModule",{value:!0})});var Agi=I(kb=>{"use strict";p();var I0a=kb&&kb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DH=kb&&kb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I0a(e,t,r)};Object.defineProperty(kb,"__esModule",{value:!0});DH(rgi(),kb);DH(igi(),kb);DH(sgi(),kb);DH(cgi(),kb);DH(ugi(),kb);DH(fgi(),kb);DH(hgi(),kb);DH(ggi(),kb)});var _E=I(Y5=>{"use strict";p();var x0a=Y5&&Y5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jft=Y5&&Y5.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x0a(e,t,r)};Object.defineProperty(Y5,"__esModule",{value:!0});jft(wmi(),Y5);jft(lmr(),Y5);jft(egi(),Y5);jft(Agi(),Y5)});var umr=I((Ftp,ygi)=>{"use strict";p();var w0a=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var k2;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var HA;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(HA||(jr.QuickPulseCounter=HA={}));var xNe;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(xNe||(jr.PerformanceCounter=xNe={}));var Egi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Egi||(jr.MetricId=Egi={}));jr.PerformanceToQuickPulseCounter=(k2={},k2[xNe.PROCESSOR_TIME]=HA.PROCESSOR_TIME,k2[xNe.REQUEST_RATE]=HA.REQUEST_RATE,k2[xNe.REQUEST_DURATION]=HA.REQUEST_DURATION,k2[HA.COMMITTED_BYTES]=HA.COMMITTED_BYTES,k2[HA.REQUEST_FAILURE_RATE]=HA.REQUEST_FAILURE_RATE,k2[HA.DEPENDENCY_RATE]=HA.DEPENDENCY_RATE,k2[HA.DEPENDENCY_FAILURE_RATE]=HA.DEPENDENCY_FAILURE_RATE,k2[HA.DEPENDENCY_DURATION]=HA.DEPENDENCY_DURATION,k2[HA.EXCEPTION_RATE]=HA.EXCEPTION_RATE,k2);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var _gi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(_gi||(jr.StatsbeatFeature=_gi={}));var Cgi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(Cgi||(jr.StatsbeatInstrumentation=Cgi={}));var vgi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(vgi||(jr.StatsbeatFeatureType=vgi={}));var bgi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(bgi||(jr.StatsbeatNetworkCategory=bgi={}));var Sgi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(Sgi||(jr.HttpRequestCookieNames=Sgi={}));var Tgi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(Tgi||(jr.AttachTypePrefix=Tgi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var hmr=I((pmr,Igi)=>{"use strict";p();var R0a=pmr&&pmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Hft=require("url"),k0a=_E(),dmr=qA(),IT=Zhe(),P0a=umr(),NH=QX(),D0a=z0r(),fmr=qft(),N0a=$l(),Gft=ad(),M0a=(function(t){R0a(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new Hft.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(Gft.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Gft.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Gft.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new Hft.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new Hft.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=Hft.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===Gft.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",N0a.warn("Could not decode the auth cookie with error: ",dmr.dumpObj(s))}var o=e.parseId(dmr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=dmr.getCorrelationContextTarget(r,IT.requestContextSourceKey),r.headers){var o=r.headers[IT.traceStateHeader]?r.headers[IT.traceStateHeader].toString():null,s=r.headers[IT.traceparentHeader]?r.headers[IT.traceparentHeader].toString():null,c=r.headers[IT.requestIdHeader]?r.headers[IT.requestIdHeader].toString():null,l=r.headers[IT.parentIdHeader]?r.headers[IT.parentIdHeader].toString():null,u=r.headers[IT.rootIdHeader]?r.headers[IT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[IT.correlationContextHeader]?r.headers[IT.correlationContextHeader].toString():null,NH.w3cEnabled&&(s||o)?(this.traceparent=new fmr(s?s.toString():null),this.tracestate=s&&o&&new D0a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?NH.w3cEnabled?(this.traceparent=new fmr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=NH.generateRequestId(this.parentId),this.operationId=NH.getRootId(this.requestId)):NH.w3cEnabled?(this.traceparent=new fmr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=NH.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=NH.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=NH.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new k0a.ContextTagKeys,e})(P0a);Igi.exports=M0a});var Hgi=I((Eo,jgi)=>{p();Eo=jgi.exports=Na;var al;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?al=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):al=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var wNe=256,$ft=Number.MAX_SAFE_INTEGER||9007199254740991,mmr=16,O0a=wNe-6,RNe=Eo.re=[],Su=Eo.safeRe=[],er=Eo.src=[],pa=0,_mr="[a-zA-Z0-9-]",gmr=[["\\s",1],["\\d",wNe],[_mr,O0a]];function Jft(t){for(var e=0;e)?=?)";var Vft=pa++;er[Vft]=er[t0e]+"|x|X|\\*";var Wft=pa++;er[Wft]=er[e0e]+"|x|X|\\*";var jX=pa++;er[jX]="[v=\\s]*("+er[Wft]+")(?:\\.("+er[Wft]+")(?:\\.("+er[Wft]+")(?:"+er[vmr]+")?"+er[PNe]+"?)?)?";var n0e=pa++;er[n0e]="[v=\\s]*("+er[Vft]+")(?:\\.("+er[Vft]+")(?:\\.("+er[Vft]+")(?:"+er[bmr]+")?"+er[PNe]+"?)?)?";var Pgi=pa++;er[Pgi]="^"+er[s0e]+"\\s*"+er[jX]+"$";var Dgi=pa++;er[Dgi]="^"+er[s0e]+"\\s*"+er[n0e]+"$";var Ngi=pa++;er[Ngi]="(?:^|[^\\d])(\\d{1,"+mmr+"})(?:\\.(\\d{1,"+mmr+"}))?(?:\\.(\\d{1,"+mmr+"}))?(?:$|[^\\d])";var Zft=pa++;er[Zft]="(?:~>?)";var i0e=pa++;er[i0e]="(\\s*)"+er[Zft]+"\\s+";RNe[i0e]=new RegExp(er[i0e],"g");Su[i0e]=new RegExp(Jft(er[i0e]),"g");var B0a="$1~",Mgi=pa++;er[Mgi]="^"+er[Zft]+er[jX]+"$";var Ogi=pa++;er[Ogi]="^"+er[Zft]+er[n0e]+"$";var Xft=pa++;er[Xft]="(?:\\^)";var o0e=pa++;er[o0e]="(\\s*)"+er[Xft]+"\\s+";RNe[o0e]=new RegExp(er[o0e],"g");Su[o0e]=new RegExp(Jft(er[o0e]),"g");var L0a="$1^",Bgi=pa++;er[Bgi]="^"+er[Xft]+er[jX]+"$";var Lgi=pa++;er[Lgi]="^"+er[Xft]+er[n0e]+"$";var xmr=pa++;er[xmr]="^"+er[s0e]+"\\s*("+Tmr+")$|^$";var wmr=pa++;er[wmr]="^"+er[s0e]+"\\s*("+kgi+")$|^$";var HX=pa++;er[HX]="(\\s*)"+er[s0e]+"\\s*("+Tmr+"|"+er[jX]+")";RNe[HX]=new RegExp(er[HX],"g");Su[HX]=new RegExp(Jft(er[HX]),"g");var F0a="$1$2$3",Fgi=pa++;er[Fgi]="^\\s*("+er[jX]+")\\s+-\\s+("+er[jX]+")\\s*$";var Ugi=pa++;er[Ugi]="^\\s*("+er[n0e]+")\\s+-\\s+("+er[n0e]+")\\s*$";var Qgi=pa++;er[Qgi]="(<|>)?=?\\s*\\*";for(K5=0;K5wNe)return null;var r=e.loose?Su[Imr]:Su[Smr];if(!r.test(t))return null;try{return new Na(t,e)}catch{return null}}a(GX,"parse");Eo.valid=U0a;function U0a(t,e){var r=GX(t,e);return r?r.version:null}a(U0a,"valid");Eo.clean=Q0a;function Q0a(t,e){var r=GX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Q0a,"clean");Eo.SemVer=Na;function Na(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Na){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>wNe)throw new TypeError("version is longer than "+wNe+" characters");if(!(this instanceof Na))return new Na(t,e);al("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Su[Imr]:Su[Smr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>$ft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$ft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$ft||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o<$ft)return o}return n}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}a(Na,"SemVer");Na.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version};Na.prototype.toString=function(){return this.version};Na.prototype.compare=function(t){return al("SemVer.compare",this.version,this.options,t),t instanceof Na||(t=new Na(t,this.options)),this.compareMain(t)||this.comparePre(t)};Na.prototype.compareMain=function(t){return t instanceof Na||(t=new Na(t,this.options)),r0e(this.major,t.major)||r0e(this.minor,t.minor)||r0e(this.patch,t.patch)};Na.prototype.comparePre=function(t){if(t instanceof Na||(t=new Na(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var e=0;do{var r=this.prerelease[e],n=t.prerelease[e];if(al("prerelease compare",e,r,n),r===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(r===void 0)return-1;if(r===n)continue;return r0e(r,n)}while(++e)};Na.prototype.inc=function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e),this.inc("pre",e);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=q0a;function q0a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Na(t,r).inc(e,n).version}catch{return null}}a(q0a,"inc");Eo.diff=j0a;function j0a(t,e){if(Rmr(t,e))return null;var r=GX(t),n=GX(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(j0a,"diff");Eo.compareIdentifiers=r0e;var xgi=/^[0-9]+$/;function r0e(t,e){var r=xgi.test(t),n=xgi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(kNe,"gt");Eo.lt=zft;function zft(t,e,r){return i8(t,e,r)<0}a(zft,"lt");Eo.eq=Rmr;function Rmr(t,e,r){return i8(t,e,r)===0}a(Rmr,"eq");Eo.neq=qgi;function qgi(t,e,r){return i8(t,e,r)!==0}a(qgi,"neq");Eo.gte=kmr;function kmr(t,e,r){return i8(t,e,r)>=0}a(kmr,"gte");Eo.lte=Pmr;function Pmr(t,e,r){return i8(t,e,r)<=0}a(Pmr,"lte");Eo.cmp=Yft;function Yft(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Rmr(t,r,n);case"!=":return qgi(t,r,n);case">":return kNe(t,r,n);case">=":return kmr(t,r,n);case"<":return zft(t,r,n);case"<=":return Pmr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Yft,"cmp");Eo.Comparator=Vw;function Vw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Vw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof Vw))return new Vw(t,e);t=t.trim().split(/\s+/).join(" "),al("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===DNe?this.value="":this.value=this.operator+this.semver.version,al("comp",this)}a(Vw,"Comparator");var DNe={};Vw.prototype.parse=function(t){var e=this.options.loose?Su[xmr]:Su[wmr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Na(r[2],this.options.loose):this.semver=DNe};Vw.prototype.toString=function(){return this.value};Vw.prototype.test=function(t){return al("Comparator.test",t,this.options.loose),this.semver===DNe?!0:(typeof t=="string"&&(t=new Na(t,this.options)),Yft(t,this.operator,this.semver,this.options))};Vw.prototype.intersects=function(t,e){if(!(t instanceof Vw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Ef(t.value,e),Kft(this.value,r,e);if(t.operator==="")return r=new Ef(this.value,e),Kft(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=Yft(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Yft(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Ef;function Ef(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ef)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Ef(t.raw,e);if(t instanceof Vw)return new Ef(t.value,e);if(!(this instanceof Ef))return new Ef(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Ef,"Range");Ef.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Ef.prototype.toString=function(){return this.range};Ef.prototype.parseRange=function(t){var e=this.options.loose,r=e?Su[Ugi]:Su[Fgi];t=t.replace(r,sma),al("hyphen replace",t),t=t.replace(Su[HX],F0a),al("comparator trim",t,Su[HX]),t=t.replace(Su[i0e],B0a),t=t.replace(Su[o0e],L0a);var n=e?Su[xmr]:Su[wmr],o=t.split(" ").map(function(s){return Z0a(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new Vw(s,this.options)},this),o};Ef.prototype.intersects=function(t,e){if(!(t instanceof Ef))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=J0a;function J0a(t,e){return new Ef(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(J0a,"toComparators");function Z0a(t,e){return al("comp",t,e),t=tma(t,e),al("caret",t),t=X0a(t,e),al("tildes",t),t=nma(t,e),al("xrange",t),t=oma(t,e),al("stars",t),t}a(Z0a,"parseComparator");function aC(t){return!t||t.toLowerCase()==="x"||t==="*"}a(aC,"isX");function X0a(t,e){return t.trim().split(/\s+/).map(function(r){return ema(r,e)}).join(" ")}a(X0a,"replaceTildes");function ema(t,e){var r=e.loose?Su[Ogi]:Su[Mgi];return t.replace(r,function(n,o,s,c,l){al("tilde",t,n,o,s,c,l);var u;return aC(o)?u="":aC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":aC(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(al("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",al("tilde return",u),u})}a(ema,"replaceTilde");function tma(t,e){return t.trim().split(/\s+/).map(function(r){return rma(r,e)}).join(" ")}a(tma,"replaceCarets");function rma(t,e){al("caret",t,e);var r=e.loose?Su[Lgi]:Su[Bgi];return t.replace(r,function(n,o,s,c,l){al("caret",t,n,o,s,c,l);var u;return aC(o)?u="":aC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":aC(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(al("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(al("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),al("caret return",u),u})}a(rma,"replaceCaret");function nma(t,e){return al("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return ima(r,e)}).join(" ")}a(nma,"replaceXRanges");function ima(t,e){t=t.trim();var r=e.loose?Su[Dgi]:Su[Pgi];return t.replace(r,function(n,o,s,c,l,u){al("xRange",t,n,o,s,c,l,u);var d=aC(s),f=d||aC(c),h=f||aC(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),al("xRange return",n),n})}a(ima,"replaceXRange");function oma(t,e){return al("replaceStars",t,e),t.trim().replace(Su[Qgi],"")}a(oma,"replaceStars");function sma(t,e,r,n,o,s,c,l,u,d,f,h,m){return aC(r)?e="":aC(n)?e=">="+r+".0.0":aC(o)?e=">="+r+"."+n+".0":e=">="+e,aC(u)?l="":aC(d)?l="<"+(+u+1)+".0.0":aC(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(sma,"hyphenReplace");Ef.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Na(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(ama,"testSet");Eo.satisfies=Kft;function Kft(t,e,r){try{e=new Ef(e,r)}catch{return!1}return e.test(t)}a(Kft,"satisfies");Eo.maxSatisfying=cma;function cma(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Na(n,r))}),n}a(cma,"maxSatisfying");Eo.minSatisfying=lma;function lma(t,e,r){var n=null,o=null;try{var s=new Ef(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Na(n,r))}),n}a(lma,"minSatisfying");Eo.minVersion=uma;function uma(t,e){t=new Ef(t,e);var r=new Na("0.0.0");if(t.test(r)||(r=new Na("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||kNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(uma,"minVersion");Eo.validRange=dma;function dma(t,e){try{return new Ef(t,e).range||"*"}catch{return null}}a(dma,"validRange");Eo.ltr=fma;function fma(t,e,r){return Dmr(t,e,"<",r)}a(fma,"ltr");Eo.gtr=pma;function pma(t,e,r){return Dmr(t,e,">",r)}a(pma,"gtr");Eo.outside=Dmr;function Dmr(t,e,r,n){t=new Na(t,n),e=new Ef(e,n);var o,s,c,l,u;switch(r){case">":o=kNe,s=Pmr,c=zft,l=">",u=">=";break;case"<":o=zft,s=kmr,c=kNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kft(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(Dmr,"outside");Eo.prerelease=hma;function hma(t,e){var r=GX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(hma,"prerelease");Eo.intersects=mma;function mma(t,e,r){return t=new Ef(t,r),e=new Ef(e,r),t.intersects(e)}a(mma,"intersects");Eo.coerce=gma;function gma(t){if(t instanceof Na)return t;if(typeof t!="string")return null;var e=t.match(Su[Ngi]);return e==null?null:GX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(gma,"coerce")});var rpt=I((Wtp,Wgi)=>{"use strict";p();var $gi=Uhe(),a0e=$gi.wrap,ept=$gi.unwrap,o8="wrap@before";function tpt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(tpt,"defineProperty");function Ama(t,e){for(var r=e.length,n=0;n0&&Ama(t,o)}a(yma,"_findAndProcess");function Ggi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var Rc=require("util"),s8=require("assert"),Ema=rpt(),cd=require("async_hooks"),NNe="cls@contexts",MNe="error@context",_f=process.env.DEBUG_CLS_HOOKED,wc=-1;Kgi.exports={getNamespace:zgi,createNamespace:_ma,destroyNamespace:Ygi,reset:Cma,ERROR_SYMBOL:MNe};function Ww(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(Ww,"Namespace");Ww.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,_f){let n=" ".repeat(this._indent<0?0:this._indent);Qd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");Ww.prototype.get=a(function(e){if(!this.active){if(_f){let r=cd.currentId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+wc+" active:"+Rc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Qd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${Rc.inspect(this.active)}`)}return this.active[e]},"get");Ww.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=wc,_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${wc} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${Rc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");Ww.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${Rc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[MNe]=r),n}finally{if(_f){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${Rc.inspect(r)}`)}this.exit(r)}},"run");Ww.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");Ww.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return _f&&Qd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),n.then(o=>(_f&&Qd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[MNe]=r,_f&&Qd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+wc+" len:"+this._set.length+" "+Rc.inspect(r)),this.exit(r),o})},"runPromise");Ww.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[MNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");Ww.prototype.enter=a(function(e){if(s8.ok(e,"context must be provided for entering"),_f){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Qd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${wc} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${Rc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");Ww.prototype.exit=a(function(e){if(s8.ok(e,"context must be provided for exiting"),_f){let n=cd.executionAsyncId(),o=cd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Qd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${wc} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${Rc.inspect(e)}`)}if(this.active===e){s8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(_f&&Qd("??ERROR?? context exiting but not entered - ignoring: "+Rc.inspect(e)),s8.ok(r>=0,`context not currently entered; can't exit. -`+Rc.inspect(this)+` -`+Rc.inspect(e))):(s8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");Ww.prototype.bindEmitter=a(function(e){s8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[NNe]||(c[NNe]=Object.create(null)),c[NNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[NNe]))return c;let l=c,u=c[NNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Ema(e,o,s)},"bindEmitter");Ww.prototype.fromException=a(function(e){return e[MNe]},"fromException");function zgi(t){return process.namespaces[t]}a(zgi,"getNamespace");function _ma(t){s8.ok(t,"namespace must be given a name."),_f&&Qd(`NS-CREATING NAMESPACE (${t})`);let e=new Ww(t);return e.id=wc,cd.createHook({init(n,o,s,c){if(wc=cd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),_f){let l=" ".repeat(e._indent<0?0:e._indent);Qd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(wc===0){let l=cd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),_f){let d=" ".repeat(e._indent<0?0:e._indent);Qd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(_f){let d=" ".repeat(e._indent<0?0:e._indent);Qd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${wc} triggerId:${l} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(_f&&o==="PROMISE"){Qd(Rc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Qd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){wc=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(_f){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${Rc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){wc=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(wc),o){if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}AFTER (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}e.exit(o)}else if(_f){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Qd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${wc} triggerId:${s} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(o)}`)}},destroy(n){if(wc=cd.executionAsyncId(),_f){let o=cd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Qd(`${s}DESTROY (${t}) currentUid:${wc} asyncId:${n} triggerId:${o} active:${Rc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${Rc.inspect(e._contexts.get(wc))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(_ma,"createNamespace");function Ygi(t){let e=zgi(t);s8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),s8.ok(e.id,"don't assign to process.namespaces directly! "+Rc.inspect(e)),process.namespaces[t]=null}a(Ygi,"destroyNamespace");function Cma(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){Ygi(t)}),process.namespaces=Object.create(null)}a(Cma,"reset");process.namespaces={};function Qd(...t){_f&&process._rawDebug(`${Rc.format(...t)}`)}a(Qd,"debug2")});var Xgi=I((Xtp,Zgi)=>{"use strict";p();function vma(){}a(vma,"NextTickWrap");Zgi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var tAi=I((rrp,eAi)=>{"use strict";p();function bma(){}a(bma,"PromiseWrap");eAi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new bma,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var nAi=I((orp,rAi)=>{"use strict";p();var xT=require("timers");function Sma(){}a(Sma,"TimeoutWrap");function Tma(){}a(Tma,"IntervalWrap");function Ima(){}a(Ima,"ImmediateWrap");var xma=new Map,wma=new Map,Rma=new Map,Nmr=null,Mmr=!1;rAi.exports=a(function(){Omr(this._hooks,this._state,"setTimeout","clearTimeout",Sma,xma,!0),Omr(this._hooks,this._state,"setInterval","clearInterval",Tma,wma,!1),Omr(this._hooks,this._state,"setImmediate","clearImmediate",Ima,Rma,!0),global.setTimeout=xT.setTimeout,global.setInterval=xT.setInterval,global.setImmediate=xT.setImmediate,global.clearTimeout=xT.clearTimeout,global.clearInterval=xT.clearInterval,global.clearImmediate=xT.clearImmediate},"patch");function Omr(t,e,r,n,o,s,c){let l=xT[r],u=xT[n];xT[r]=function(){if(!e.enabled)return l.apply(xT,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),Nmr=null,(c||Mmr)&&(Mmr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(xT,d),s.set(g,m),g},xT[n]=function(d){if(Nmr===d&&d!==null)Mmr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(xT,arguments)}}a(Omr,"patchTimer")});var Bmr=I((crp,kma)=>{kma.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var sAi=I((lrp,oAi)=>{"use strict";p();var BNe=process.binding("async_wrap"),Pma=BNe.Providers.TIMERWRAP,iAi={nextTick:Xgi(),promise:tAi(),timers:nAi()},ONe=new Set;function Dma(){this.enabled=!1,this.counter=0}a(Dma,"State");function Lmr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===Pma){ONe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!ONe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!ONe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(ONe.has(o)){ONe.delete(o);return}for(let s of n)s(o)}}a(Lmr,"Hooks");Lmr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function npt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(npt,"removeElement");Lmr.prototype.remove=function(t){t.init&&npt(this.initFns,t.init),t.pre&&npt(this.preFns,t.pre),t.post&&npt(this.postFns,t.post),t.destroy&&npt(this.destroyFns,t.destroy)};function LNe(){this._state=new Dma,this._hooks=new Lmr,this.version=Bmr().version,this.providers=BNe.Providers;for(let t of Object.keys(iAi))iAi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),BNe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(LNe,"AsyncHook");oAi.exports=LNe;LNe.prototype.addHooks=function(t){this._hooks.add(t)};LNe.prototype.removeHooks=function(t){this._hooks.remove(t)};LNe.prototype.enable=function(){this._state.enabled=!0,BNe.enable()};LNe.prototype.disable=function(){this._state.enabled=!1,BNe.disable()}});var Fmr=I((frp,Nma)=>{Nma.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var cAi=I((prp,aAi)=>{p();function Mma(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(Mma,"FormatErrorString");aAi.exports=a(function(e,r){var n=[];n.push(Mma(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` -`)},"FormatStackTrace")});var fAi=I((grp,dAi)=>{p();var ipt=cAi();function uAi(){this.extend=new FNe,this.filter=new FNe,this.format=new UNe,this.version=Fmr().version}a(uAi,"stackChain");var Qmr=!1;uAi.prototype.callSite=a(function t(e){e||(e={}),Qmr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Qmr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var MH=new uAi;function FNe(){this._modifiers=[]}a(FNe,"TraceModifier");FNe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===Fmr().version)qmr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else qmr.exports=global._stackChain=fAi()});var pAi=I((Crp,Hmr)=>{"use strict";p();var Bma=sAi();if(global._asyncHook)if(global._asyncHook.version===Bmr().version)Hmr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else jmr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Hmr.exports=global._asyncHook=new Bma});var EAi=I((brp,yAi)=>{"use strict";p();var rh=require("util"),a8=require("assert"),Lma=rpt(),c0e=pAi(),QNe="cls@contexts",qNe="error@context",mAi=[];for(let t in c0e.providers)mAi[c0e.providers[t]]=t;var fp=process.env.DEBUG_CLS_HOOKED,c0=-1;yAi.exports={getNamespace:gAi,createNamespace:Fma,destroyNamespace:AAi,reset:Uma,ERROR_SYMBOL:qNe};function zw(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(zw,"Namespace");zw.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return fp&&th(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0)),this.active[e]=r,r},"set");zw.prototype.get=a(function(e){if(!this.active){fp&&th(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0));return}return fp&&th(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+c0+" active:"+rh.inspect(this.active,!0)),this.active[e]},"get");zw.prototype.createContext=a(function(){fp&&th(" CREATING Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" active:"+rh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=c0,fp&&th(" CREATED Context: "+this.name+" uid:"+c0+" len:"+this._set.length+" context:"+rh.inspect(e,!0,2,!0)),e},"createContext");zw.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return fp&&th(" BEFORE RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),e(r),r}catch(n){throw n&&(n[qNe]=r),n}finally{fp&&th(" AFTER RUN: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r)}},"run");zw.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");zw.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return fp&&th(" BEFORE runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),n.then(o=>(fp&&th(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[qNe]=r,fp&&th(" AFTER runPromise: "+this.name+" uid:"+c0+" len:"+this._set.length+" "+rh.inspect(r)),this.exit(r),o})},"runPromise");zw.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[qNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");zw.prototype.enter=a(function(e){a8.ok(e,"context must be provided for entering"),fp&&th(" ENTER "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+rh.inspect(e)),this._set.push(this.active),this.active=e},"enter");zw.prototype.exit=a(function(e){if(a8.ok(e,"context must be provided for exiting"),fp&&th(" EXIT "+this.name+" uid:"+c0+" len:"+this._set.length+" context: "+rh.inspect(e)),this.active===e){a8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(fp&&th("??ERROR?? context exiting but not entered - ignoring: "+rh.inspect(e)),a8.ok(r>=0,`context not currently entered; can't exit. -`+rh.inspect(this)+` -`+rh.inspect(e))):(a8.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");zw.prototype.bindEmitter=a(function(e){a8.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[QNe]||(c[QNe]=Object.create(null)),c[QNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[QNe]))return c;let l=c,u=c[QNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),Lma(e,o,s)},"bindEmitter");zw.prototype.fromException=a(function(e){return e[qNe]},"fromException");function gAi(t){return process.namespaces[t]}a(gAi,"getNamespace");function Fma(t){a8.ok(t,"namespace must be given a name."),fp&&th("CREATING NAMESPACE "+t);let e=new zw(t);return e.id=c0,c0e.addHooks({init(r,n,o,s,c){c0=r,s?(e._contexts.set(r,e._contexts.get(s)),fp&&th("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(c0,e.active),fp&&th("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+mAi[o]+" active:"+rh.inspect(e.active,!0))},pre(r,n){c0=r;let o=e._contexts.get(r);o?(fp&&th(" PRE "+t+" uid:"+r+" handle:"+opt(n)+" context:"+rh.inspect(o)),e.enter(o)):fp&&th(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+opt(n))},post(r,n){c0=r;let o=e._contexts.get(r);o?(fp&&th(" POST "+t+" uid:"+r+" handle:"+opt(n)+" context:"+rh.inspect(o)),e.exit(o)):fp&&th(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+opt(n))},destroy(r){c0=r,fp&&th("DESTROY "+t+" uid:"+r+" context:"+rh.inspect(e._contexts.get(c0))+" active:"+rh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(Fma,"createNamespace");function AAi(t){let e=gAi(t);a8.ok(e,`can't delete nonexistent namespace! "`+t+'"'),a8.ok(e.id,"don't assign to process.namespaces directly! "+rh.inspect(e)),process.namespaces[t]=null}a(AAi,"destroyNamespace");function Uma(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){AAi(t)}),process.namespaces=Object.create(null)}a(Uma,"reset");process.namespaces={};c0e._state&&!c0e._state.enabled&&c0e.enable();function th(t){process.env.DEBUG&&process._rawDebug(t)}a(th,"debug2");function opt(t){if(!t)return t;if(typeof t=="function")return t.name?t.name:(t.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(t.constructor&&t.constructor.name)return t.constructor.name}a(opt,"getFunctionName");if(fp){Gmr=jmr();for(hAi in Gmr.filter._modifiers)Gmr.filter.deattach(hAi)}var Gmr,hAi});var _Ai=I((Irp,$mr)=>{"use strict";p();var Qma=Hgi();process&&Qma.gte(process.versions.node,"8.0.0")?$mr.exports=Jgi():$mr.exports=EAi()});var LAi=I((_o,BAi)=>{p();_o=BAi.exports=Ma;var cl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?cl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):cl=a(function(){},"debug");_o.SEMVER_SPEC_VERSION="2.0.0";var jNe=256,spt=Number.MAX_SAFE_INTEGER||9007199254740991,Vmr=16,qma=jNe-6,HNe=_o.re=[],Tu=_o.safeRe=[],tr=_o.src=[],ha=0,Jmr="[a-zA-Z0-9-]",Wmr=[["\\s",1],["\\d",jNe],[Jmr,qma]];function fpt(t){for(var e=0;e)?=?)";var apt=ha++;tr[apt]=tr[u0e]+"|x|X|\\*";var cpt=ha++;tr[cpt]=tr[l0e]+"|x|X|\\*";var $X=ha++;tr[$X]="[v=\\s]*("+tr[cpt]+")(?:\\.("+tr[cpt]+")(?:\\.("+tr[cpt]+")(?:"+tr[Xmr]+")?"+tr[$Ne]+"?)?)?";var f0e=ha++;tr[f0e]="[v=\\s]*("+tr[apt]+")(?:\\.("+tr[apt]+")(?:\\.("+tr[apt]+")(?:"+tr[egr]+")?"+tr[$Ne]+"?)?)?";var TAi=ha++;tr[TAi]="^"+tr[m0e]+"\\s*"+tr[$X]+"$";var IAi=ha++;tr[IAi]="^"+tr[m0e]+"\\s*"+tr[f0e]+"$";var xAi=ha++;tr[xAi]="(?:^|[^\\d])(\\d{1,"+Vmr+"})(?:\\.(\\d{1,"+Vmr+"}))?(?:\\.(\\d{1,"+Vmr+"}))?(?:$|[^\\d])";var ppt=ha++;tr[ppt]="(?:~>?)";var p0e=ha++;tr[p0e]="(\\s*)"+tr[ppt]+"\\s+";HNe[p0e]=new RegExp(tr[p0e],"g");Tu[p0e]=new RegExp(fpt(tr[p0e]),"g");var jma="$1~",wAi=ha++;tr[wAi]="^"+tr[ppt]+tr[$X]+"$";var RAi=ha++;tr[RAi]="^"+tr[ppt]+tr[f0e]+"$";var hpt=ha++;tr[hpt]="(?:\\^)";var h0e=ha++;tr[h0e]="(\\s*)"+tr[hpt]+"\\s+";HNe[h0e]=new RegExp(tr[h0e],"g");Tu[h0e]=new RegExp(fpt(tr[h0e]),"g");var Hma="$1^",kAi=ha++;tr[kAi]="^"+tr[hpt]+tr[$X]+"$";var PAi=ha++;tr[PAi]="^"+tr[hpt]+tr[f0e]+"$";var igr=ha++;tr[igr]="^"+tr[m0e]+"\\s*("+rgr+")$|^$";var ogr=ha++;tr[ogr]="^"+tr[m0e]+"\\s*("+SAi+")$|^$";var VX=ha++;tr[VX]="(\\s*)"+tr[m0e]+"\\s*("+rgr+"|"+tr[$X]+")";HNe[VX]=new RegExp(tr[VX],"g");Tu[VX]=new RegExp(fpt(tr[VX]),"g");var Gma="$1$2$3",DAi=ha++;tr[DAi]="^\\s*("+tr[$X]+")\\s+-\\s+("+tr[$X]+")\\s*$";var NAi=ha++;tr[NAi]="^\\s*("+tr[f0e]+")\\s+-\\s+("+tr[f0e]+")\\s*$";var MAi=ha++;tr[MAi]="(<|>)?=?\\s*\\*";for(J5=0;J5jNe)return null;var r=e.loose?Tu[ngr]:Tu[tgr];if(!r.test(t))return null;try{return new Ma(t,e)}catch{return null}}a(WX,"parse");_o.valid=$ma;function $ma(t,e){var r=WX(t,e);return r?r.version:null}a($ma,"valid");_o.clean=Vma;function Vma(t,e){var r=WX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(Vma,"clean");_o.SemVer=Ma;function Ma(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Ma){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>jNe)throw new TypeError("version is longer than "+jNe+" characters");if(!(this instanceof Ma))return new Ma(t,e);cl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Tu[ngr]:Tu[tgr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>spt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>spt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>spt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};_o.inc=Wma;function Wma(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Ma(t,r).inc(e,n).version}catch{return null}}a(Wma,"inc");_o.diff=zma;function zma(t,e){if(sgr(t,e))return null;var r=WX(t),n=WX(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(zma,"diff");_o.compareIdentifiers=d0e;var CAi=/^[0-9]+$/;function d0e(t,e){var r=CAi.test(t),n=CAi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(GNe,"gt");_o.lt=lpt;function lpt(t,e,r){return c8(t,e,r)<0}a(lpt,"lt");_o.eq=sgr;function sgr(t,e,r){return c8(t,e,r)===0}a(sgr,"eq");_o.neq=OAi;function OAi(t,e,r){return c8(t,e,r)!==0}a(OAi,"neq");_o.gte=agr;function agr(t,e,r){return c8(t,e,r)>=0}a(agr,"gte");_o.lte=cgr;function cgr(t,e,r){return c8(t,e,r)<=0}a(cgr,"lte");_o.cmp=upt;function upt(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return sgr(t,r,n);case"!=":return OAi(t,r,n);case">":return GNe(t,r,n);case">=":return agr(t,r,n);case"<":return lpt(t,r,n);case"<=":return cgr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(upt,"cmp");_o.Comparator=Yw;function Yw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Yw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof Yw))return new Yw(t,e);t=t.trim().split(/\s+/).join(" "),cl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===VNe?this.value="":this.value=this.operator+this.semver.version,cl("comp",this)}a(Yw,"Comparator");var VNe={};Yw.prototype.parse=function(t){var e=this.options.loose?Tu[igr]:Tu[ogr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Ma(r[2],this.options.loose):this.semver=VNe};Yw.prototype.toString=function(){return this.value};Yw.prototype.test=function(t){return cl("Comparator.test",t,this.options.loose),this.semver===VNe?!0:(typeof t=="string"&&(t=new Ma(t,this.options)),upt(t,this.operator,this.semver,this.options))};Yw.prototype.intersects=function(t,e){if(!(t instanceof Yw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Cf(t.value,e),dpt(this.value,r,e);if(t.operator==="")return r=new Cf(this.value,e),dpt(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=upt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=upt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};_o.Range=Cf;function Cf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Cf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Cf(t.raw,e);if(t instanceof Yw)return new Cf(t.value,e);if(!(this instanceof Cf))return new Cf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Cf,"Range");Cf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Cf.prototype.toString=function(){return this.range};Cf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Tu[NAi]:Tu[DAi];t=t.replace(r,fga),cl("hyphen replace",t),t=t.replace(Tu[VX],Gma),cl("comparator trim",t,Tu[VX]),t=t.replace(Tu[p0e],jma),t=t.replace(Tu[h0e],Hma);var n=e?Tu[igr]:Tu[ogr],o=t.split(" ").map(function(s){return iga(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new Yw(s,this.options)},this),o};Cf.prototype.intersects=function(t,e){if(!(t instanceof Cf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};_o.toComparators=nga;function nga(t,e){return new Cf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(nga,"toComparators");function iga(t,e){return cl("comp",t,e),t=aga(t,e),cl("caret",t),t=oga(t,e),cl("tildes",t),t=lga(t,e),cl("xrange",t),t=dga(t,e),cl("stars",t),t}a(iga,"parseComparator");function cC(t){return!t||t.toLowerCase()==="x"||t==="*"}a(cC,"isX");function oga(t,e){return t.trim().split(/\s+/).map(function(r){return sga(r,e)}).join(" ")}a(oga,"replaceTildes");function sga(t,e){var r=e.loose?Tu[RAi]:Tu[wAi];return t.replace(r,function(n,o,s,c,l){cl("tilde",t,n,o,s,c,l);var u;return cC(o)?u="":cC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":cC(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(cl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",cl("tilde return",u),u})}a(sga,"replaceTilde");function aga(t,e){return t.trim().split(/\s+/).map(function(r){return cga(r,e)}).join(" ")}a(aga,"replaceCarets");function cga(t,e){cl("caret",t,e);var r=e.loose?Tu[PAi]:Tu[kAi];return t.replace(r,function(n,o,s,c,l){cl("caret",t,n,o,s,c,l);var u;return cC(o)?u="":cC(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":cC(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(cl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(cl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),cl("caret return",u),u})}a(cga,"replaceCaret");function lga(t,e){return cl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return uga(r,e)}).join(" ")}a(lga,"replaceXRanges");function uga(t,e){t=t.trim();var r=e.loose?Tu[IAi]:Tu[TAi];return t.replace(r,function(n,o,s,c,l,u){cl("xRange",t,n,o,s,c,l,u);var d=cC(s),f=d||cC(c),h=f||cC(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),cl("xRange return",n),n})}a(uga,"replaceXRange");function dga(t,e){return cl("replaceStars",t,e),t.trim().replace(Tu[MAi],"")}a(dga,"replaceStars");function fga(t,e,r,n,o,s,c,l,u,d,f,h,m){return cC(r)?e="":cC(n)?e=">="+r+".0.0":cC(o)?e=">="+r+"."+n+".0":e=">="+e,cC(u)?l="":cC(d)?l="<"+(+u+1)+".0.0":cC(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(fga,"hyphenReplace");Cf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Ma(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(pga,"testSet");_o.satisfies=dpt;function dpt(t,e,r){try{e=new Cf(e,r)}catch{return!1}return e.test(t)}a(dpt,"satisfies");_o.maxSatisfying=hga;function hga(t,e,r){var n=null,o=null;try{var s=new Cf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Ma(n,r))}),n}a(hga,"maxSatisfying");_o.minSatisfying=mga;function mga(t,e,r){var n=null,o=null;try{var s=new Cf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Ma(n,r))}),n}a(mga,"minSatisfying");_o.minVersion=gga;function gga(t,e){t=new Cf(t,e);var r=new Ma("0.0.0");if(t.test(r)||(r=new Ma("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||GNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(gga,"minVersion");_o.validRange=Aga;function Aga(t,e){try{return new Cf(t,e).range||"*"}catch{return null}}a(Aga,"validRange");_o.ltr=yga;function yga(t,e,r){return lgr(t,e,"<",r)}a(yga,"ltr");_o.gtr=Ega;function Ega(t,e,r){return lgr(t,e,">",r)}a(Ega,"gtr");_o.outside=lgr;function lgr(t,e,r,n){t=new Ma(t,n),e=new Cf(e,n);var o,s,c,l,u;switch(r){case">":o=GNe,s=cgr,c=lpt,l=">",u=">=";break;case"<":o=lpt,s=agr,c=GNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dpt(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(lgr,"outside");_o.prerelease=_ga;function _ga(t,e){var r=WX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(_ga,"prerelease");_o.intersects=Cga;function Cga(t,e,r){return t=new Cf(t,r),e=new Cf(e,r),t.intersects(e)}a(Cga,"intersects");_o.coerce=vga;function vga(t){if(t instanceof Ma)return t;if(typeof t!="string")return null;var e=t.match(Tu[xAi]);return e==null?null:WX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(vga,"coerce")});var QAi=I((krp,UAi)=>{p();var bga=Uhe().wrap,dgr=1,fgr=2,pgr=4,gpt=8,Vl=[],Sga=0,CE=!1,OH=[],g0e,hgr;function mgr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Vl=OH.pop()),A0e=void 0,n&&!CE},"asyncCatcher"),hgr=a(function(e,r,n){var o=[];CE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);CE=!1;var d=e.apply(this,arguments);for(CE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return CE=!1,Vl=OH.pop(),A0e=void 0,d}},"asyncWrap"),bga(process,"_fatalException",function(t){return a(function(r){return g0e(r)||t(r)},"_asyncFatalException")})):(ugr=!1,g0e=a(function(e){if(ugr)throw e;for(var r=!1,n=Vl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);CE=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);CE=!1}Vl=OH.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",g0e));var mpt,A0e,ugr;function Tga(t,e,r){CE=!0;for(var n=0;n0)return hgr(t,r,e);return Tga(t,r,e)}a(Iga,"wrapCallback");function Z5(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=dgr),typeof t.before=="function"&&(this.before=t.before,this.flags|=fgr),typeof t.after=="function"&&(this.after=t.after,this.flags|=pgr),typeof t.error=="function"&&(this.error=t.error,this.flags|=gpt),this.uid=++Sga,this.data=e===void 0?null:e}a(Z5,"AsyncListener");Z5.prototype.create=void 0;Z5.prototype.before=void 0;Z5.prototype.after=void 0;Z5.prototype.error=void 0;Z5.prototype.data=void 0;Z5.prototype.uid=0;Z5.prototype.flags=0;function FAi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof Z5?t:new Z5(t,e)}a(FAi,"createAsyncListener");function xga(t,e){var r;t instanceof Z5?r=t:r=FAi(t,e);for(var n=!1,o=0;o{"use strict";p();qAi.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var YAi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var VAi=Uhe(),ypt=LAi(),Pb=VAi.wrap,BH=VAi.massWrap,vf=QAi(),Rga=require("util"),kga=ypt.gte(process.version,"6.0.0"),ygr=ypt.gte(process.version,"7.0.0"),Pga=ypt.gte(process.version,"8.0.0"),Dga=ypt.gte(process.version,"11.0.0"),X5=require("net");ygr&&!X5._normalizeArgs?X5._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:Lga(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!ygr&&!X5._normalizeConnectArgs&&(X5._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in X5.Server.prototype?Pb(X5.Server.prototype,"_setUpListenHandle",HAi):Pb(X5.Server.prototype,"_listen2",HAi);function HAi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=vf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=vf(this._handle.onconnection))}}}a(HAi,"wrapSetUpListenHandle");function WAi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=vf(e._originalOnread)}}a(WAi,"patchOnRead");Pb(X5.Socket.prototype,"connect",function(t){return function(){var e;Pga&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=ygr?X5._normalizeArgs(arguments):X5._normalizeConnectArgs(arguments),e[1]&&(e[1]=vf(e[1]));var r=t.apply(this,e);return WAi(this),r}});var Nga=require("http");Pb(Nga.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=vf(function(n){return WAi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var ggr=require("child_process");function GAi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=vf(e._handle.onread),Pb(e._handle,"close",Ept))}),t._handle&&(t._handle.onexit=vf(t._handle.onexit))}a(GAi,"wrapChildProcess");ggr.ChildProcess?Pb(ggr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return GAi(this),e}}):BH(ggr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return GAi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var Cgr=[];process._nextDomainTick&&Cgr.push("_nextDomainTick");process._tickDomainCallback&&Cgr.push("_tickDomainCallback");BH(process,Cgr,e4);Pb(process,"nextTick",Ept);var vgr=["setTimeout","setInterval"];global.setImmediate&&vgr.push("setImmediate");var zAi=require("timers"),Mga=global.setTimeout===zAi.setTimeout;BH(zAi,vgr,Ept);Mga&&BH(global,vgr,Ept);var Egr=require("dns");BH(Egr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],e4);Egr.resolveNaptr&&Pb(Egr,"resolveNaptr",e4);var YX=require("fs");BH(YX,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],e4);YX.lchown&&Pb(YX,"lchown",e4);YX.lchmod&&Pb(YX,"lchmod",e4);YX.ftruncate&&Pb(YX,"ftruncate",e4);var WNe;try{WNe=require("zlib")}catch{}WNe&&WNe.Deflate&&WNe.Deflate.prototype&&(zX=Object.getPrototypeOf(WNe.Deflate.prototype),zX._transform?Pb(zX,"_transform",e4):zX.write&&zX.flush&&zX.end&&BH(zX,["write","flush","end"],e4));var zX,_gr;try{_gr=require("crypto")}catch{}_gr&&(Agr=["pbkdf2","randomBytes"],Dga||Agr.push("pseudoRandomBytes"),BH(_gr,Agr,e4));var Agr,Apt=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Apt&&($Ai=process.addAsyncListener({create:a(function(){Apt=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Apt=!1},"notSync")),process.removeAsyncListener($Ai));var $Ai;Apt&&Oga();function Oga(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),Rga.inherits(e,t),Pb(t.prototype,"then",s),t.prototype.chain&&Pb(t.prototype,"chain",s),kga)global.Promise=jAi()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=vf(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:vf(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(Oga,"wrapPromise");function e4(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(Bga,"toNumber");function Lga(t){return typeof t=="string"&&Bga(t)===!1}a(Lga,"isPipeName")});var eyi=I((qrp,XAi)=>{"use strict";p();var l8=require("assert"),Fga=rpt(),zNe="cls@contexts",bgr="error@context";process.addAsyncListener||YAi();function P2(t){this.name=t,this.active=null,this._set=[],this.id=null}a(P2,"Namespace");P2.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};P2.prototype.get=function(t){if(this.active)return this.active[t]};P2.prototype.createContext=function(){return Object.create(this.active)};P2.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[bgr]=e),r}finally{this.exit(e)}};P2.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};P2.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[bgr]=e),n}finally{r.exit(e)}}};P2.prototype.enter=function(t){l8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};P2.prototype.exit=function(t){if(l8.ok(t,"context must be provided for exiting"),this.active===t){l8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);l8.ok(e>=0,"context not currently entered; can't exit"),l8.ok(e,"can't remove top context"),this._set.splice(e,1)};P2.prototype.bindEmitter=function(t){l8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[zNe]||(s[zNe]=Object.create(null)),s[zNe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[zNe]))return s;var c=s,l=s[zNe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),Fga(t,n,o)};P2.prototype.fromException=function(t){return t[bgr]};function KAi(t){return process.namespaces[t]}a(KAi,"get");function Uga(t){l8.ok(t,"namespace must be given a name!");var e=new P2(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(Uga,"create");function JAi(t){var e=KAi(t);l8.ok(e,"can't delete nonexistent namespace!"),l8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(JAi,"destroy");function ZAi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){JAi(t)}),process.namespaces=Object.create(null)}a(ZAi,"reset");process.namespaces||ZAi();XAi.exports={getNamespace:KAi,createNamespace:Uga,destroyNamespace:JAi,reset:ZAi}});var FH=I(t4=>{"use strict";p();var Qga=t4&&t4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qga=t4&&t4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jga=t4&&t4.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Qga(e,t,r);return qga(e,t),e};Object.defineProperty(t4,"__esModule",{value:!0});t4.CorrelationContextManager=void 0;var LH=$l(),Hga=jga(Qft()),KX=qft(),Sgr=z0r(),tyi=hmr(),y0e=qA(),Gga=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new $ga(o)}:null},t.spanToContextObject=function(e,r,n){var o=new KX;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=KX.formatOpenTelemetryTraceFlags(e.traceFlags)||KX.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){LH.warn("Error binding to session context",y0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){LH.warn("Error binding to session context",y0e.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){LH.warn("Error binding to session context",y0e.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=_Ai():this.cls=eyi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){LH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",y0e.dumpObj(r)),this.enabled=!1;return}Hga.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){LH.warn("Error binding to session context",y0e.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new KX(f.headers.traceparent):f.headers["request-id"]&&(u=new KX(null,f.headers["request-id"])),f.headers.tracestate&&(d=new Sgr(f.headers.tracestate)))}u||(u=new KX(n.traceParent||n.traceparent)),d||(d=new Sgr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new tyi(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new KX(c.traceparent?c.traceparent.toString():null),d=new Sgr(c.tracestate?c.tracestate.toString():null),m=new tyi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return LH.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){LH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",y0e.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();t4.CorrelationContextManager=Gga;var $ga=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");No.insertSnippetByIndex=HAa;var GAa=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");No.isContentTypeHeaderHtml=GAa});var Pgr=I((wnp,Cyi)=>{"use strict";p();var _yi=ad(),$Aa=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||_yi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||_yi.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();Cyi.exports=$Aa});var vyi={};wi(vyi,{webSnippet:()=>VAa});var VAa,byi=me(()=>{p();VAa=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;ae.trim()).join(" ")};Toi.O=function(t){return this.inspectOpts.colors=this.useColors,$dt.inspect(t,this.inspectOpts)}});var xoi=I((vWf,Uhr)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Uhr.exports=Soi():Uhr.exports=Ioi()});var qhr=I((bWf,woi)=>{"use strict";p();var Qhr=require("path").sep;woi.exports=function(t){var e=t.split(Qhr),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",o=n?e[r+1]+"/"+e[r+2]:e[r+1],s=n?3:2,c="",l=r+s-1,u=0;u<=l;u++)u===l?c+=e[u]:c+=e[u]+Qhr;for(var d="",f=e.length-1,h=r+s;h<=f;h++)h===f?d+=e[h]:d+=e[h]+Qhr;return{name:o,basedir:c,path:d}}}});var jhr=I((TWf,Roi)=>{"use strict";p();var hea=require("os");Roi.exports=hea.homedir||a(function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null},"homedir")});var Hhr=I((wWf,Poi)=>{p();Poi.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var koi=I((PWf,eNe)=>{"use strict";p();var mea=process.platform==="win32",gea=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Ghr={};function Aea(t){return gea.exec(t).slice(1)}a(Aea,"win32SplitPath");Ghr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Aea(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var yea=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,$hr={};function Eea(t){return yea.exec(t).slice(1)}a(Eea,"posixSplitPath");$hr.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=Eea(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};mea?eNe.exports=Ghr.parse:eNe.exports=$hr.parse;eNe.exports.posix=$hr.parse;eNe.exports.win32=Ghr.parse});var Vhr=I((NWf,Ooi)=>{p();var Moi=require("path"),Doi=Moi.parse||koi(),Noi=a(function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var o=[e],s=Doi(e);s.dir!==o[o.length-1];)o.push(s.dir),s=Doi(s.dir);return o.reduce(function(c,l){return c.concat(r.map(function(u){return Moi.resolve(n,l,u)}))},[])},"getNodeModulesDirs");Ooi.exports=a(function(e,r,n){var o=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return Noi(e,o)},r);var s=Noi(e,o);return r&&r.paths?s.concat(r.paths):s},"nodeModulesPaths")});var Whr=I((BWf,Boi)=>{p();Boi.exports=function(t,e){return e||{}}});var Uoi=I((FWf,Foi)=>{"use strict";p();var _ea="Function.prototype.bind called on incompatible ",vea=Object.prototype.toString,Cea=Math.max,bea="[object Function]",Loi=a(function(e,r){for(var n=[],o=0;o{"use strict";p();var Iea=Uoi();Qoi.exports=Function.prototype.bind||Iea});var Hoi=I((HWf,joi)=>{"use strict";p();var xea=Function.prototype.call,wea=Object.prototype.hasOwnProperty,Rea=qoi();joi.exports=Rea.call(xea,wea)});var Goi=I(($Wf,Pea)=>{Pea.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var tNe=I((VWf,Woi)=>{"use strict";p();var kea=Hoi();function Dea(t,e){for(var r=t.split("."),n=e.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),c=0;c<3;++c){var l=parseInt(r[c]||0,10),u=parseInt(s[c]||0,10);if(l!==u)return o==="<"?l="?l>=u:!1}return o===">="}a(Dea,"specifierIncluded");function $oi(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n{p();var SX=require("fs"),Mea=jhr(),a0=require("path"),Oea=Hhr(),Bea=Vhr(),Lea=Whr(),Fea=tNe(),Uea=process.platform!=="win32"&&SX.realpath&&typeof SX.realpath.native=="function"?SX.realpath.native:SX.realpath,zoi=Mea(),Qea=a(function(){return[a0.join(zoi,".node_modules"),a0.join(zoi,".node_libraries")]},"defaultPaths"),qea=a(function(e,r){SX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isFile()||o.isFIFO())})},"isFile"),jea=a(function(e,r){SX.stat(e,function(n,o){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,o.isDirectory())})},"isDirectory"),Hea=a(function(e,r){Uea(e,function(n,o){n&&n.code!=="ENOENT"?r(n):r(null,n?e:o)})},"realpath"),rNe=a(function(e,r,n,o){n&&n.preserveSymlinks===!1?e(r,o):o(null,r)},"maybeRealpath"),Gea=a(function(e,r,n){e(r,function(o,s){if(o)n(o);else try{var c=JSON.parse(s);n(null,c)}catch{n(null)}})},"defaultReadPackage"),$ea=a(function(e,r,n){for(var o=Bea(r,n,e),s=0;s{Vea.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var tsi=I((XWf,esi)=>{"use strict";p();var Wea=tNe(),Zoi=Joi(),Xoi={};for(Wdt in Zoi)Object.prototype.hasOwnProperty.call(Zoi,Wdt)&&(Xoi[Wdt]=Wea(Wdt));var Wdt;esi.exports=Xoi});var nsi=I((tzf,rsi)=>{p();var zea=tNe();rsi.exports=a(function(e){return zea(e)},"isCore")});var ssi=I((izf,osi)=>{p();var Yea=tNe(),TX=require("fs"),gE=require("path"),Kea=jhr(),Jea=Hhr(),Zea=Vhr(),Xea=Whr(),eta=process.platform!=="win32"&&TX.realpathSync&&typeof TX.realpathSync.native=="function"?TX.realpathSync.native:TX.realpathSync,isi=Kea(),tta=a(function(){return[gE.join(isi,".node_modules"),gE.join(isi,".node_libraries")]},"defaultPaths"),rta=a(function(e){try{var r=TX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},"isFile"),nta=a(function(e){try{var r=TX.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},"isDirectory"),ita=a(function(e){try{return eta(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},"realpathSync"),nNe=a(function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},"maybeRealpathSync"),ota=a(function(e,r){var n=e(r);try{var o=JSON.parse(n);return o}catch{}},"defaultReadPackageSync"),sta=a(function(e,r,n){for(var o=Zea(r,n,e),s=0;s{p();var zdt=Koi();zdt.core=tsi();zdt.isCore=nsi();zdt.sync=ssi();asi.exports=zdt});var csi=I((lzf,ata)=>{ata.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var Zhr=I((uzf,Jhr)=>{"use strict";p();var Bhe=require("path"),I2=require("module"),rh=xoi()("require-in-the-middle"),cta=qhr();Jhr.exports=iNe;Jhr.exports.Hook=iNe;var Yhr,Ohe;if(I2.isBuiltin)Ohe=I2.isBuiltin;else if(I2.builtinModules)Ohe=a(t=>t.startsWith("node:")?!0:(Yhr===void 0&&(Yhr=new Set(I2.builtinModules)),Yhr.has(t)),"isCore");else{let t=zhr(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Ohe=a(n=>n==="http2"?!0:!!t.core[n],"isCore"):Ohe=a(n=>!!t.core[n],"isCore")}var Ydt;function lta(t,e){if(!Ydt)if(require.resolve&&require.resolve.paths)Ydt=a(function(r,n){return require.resolve(r,{paths:[n]})},"_resolve");else{let r=zhr();Ydt=a(function(n,o){return r.sync(n,{basedir:o})},"_resolve")}return Ydt(t,e)}a(lta,"resolve");var uta=/([/\\]index)?(\.js)?$/,Khr=class{static{a(this,"ExportsCache")}constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=require.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in require.cache?require.cache[e][this._kRitmExports]=r:(rh('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function iNe(t,e,r){if(!(this instanceof iNe))return new iNe(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof I2._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof I2._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,csi().bugs.url);return}this._cache=new Khr,this._unhooked=!1,this._origRequire=I2.prototype.require;let n=this,o=new Set,s=e?e.internals===!0:!1,c=Array.isArray(t);rh("registering require hook"),this._require=I2.prototype.require=function(u){return n._unhooked===!0?(rh("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):l.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(u){return n._unhooked===!0?(rh("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):l.call(this,arguments,!0)});function l(u,d){let f=u[0],h=Ohe(f),m;if(h){if(m=f,f.startsWith("node:")){let v=f.slice(5);Ohe(v)&&(m=v)}}else{if(d)return rh("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,u);try{m=I2._resolveFilename(f,this)}catch(v){return rh('Module._resolveFilename("%s") threw %j, calling original Module.require',f,v.message),n._origRequire.apply(this,u)}}let g,A;if(rh("processing %s module require('%s'): %s",h===!0?"core":"non-core",f,m),n._cache.has(m,h)===!0)return rh("returning already patched cached module: %s",m),n._cache.get(m,h);let y=o.has(m);y===!1&&o.add(m);let E=d?n._origGetBuiltinModule.apply(this,u):n._origRequire.apply(this,u);if(y===!0)return rh("module is in the process of being patched already - ignoring: %s",m),E;if(o.delete(m),h===!0){if(c===!0&&t.includes(m)===!1)return rh("ignoring core module not on whitelist: %s",m),E;g=m}else if(c===!0&&t.includes(m)){let v=Bhe.parse(m);g=v.name,A=v.dir}else{let v=cta(m);if(v===void 0)return rh("could not parse filename: %s",m),E;g=v.name,A=v.basedir;let b=dta(v);rh("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",g,f,b,A);let T=!1;if(c){if(!f.startsWith(".")&&t.includes(f)&&(g=f,T=!0),!t.includes(g)&&!t.includes(b))return E;t.includes(b)&&b!==g&&(g=b,T=!0)}if(!T){let w;try{w=lta(g,A)}catch{return rh("could not resolve module: %s",g),n._cache.set(m,E,h),E}if(w!==m)if(s===!0)g=g+Bhe.sep+Bhe.relative(A,m),rh("preparing to process require of internal file: %s",g);else return rh("ignoring require of non-main module file: %s",w),n._cache.set(m,E,h),E}}n._cache.set(m,E,h),rh("calling require hook: %s",g);let _=r(E,g,A);return n._cache.set(m,_,h),rh("returning module: %s",g),_}a(l,"patchedRequire")}a(iNe,"Hook");iNe.prototype.unhook=function(){this._unhooked=!0,this._require===I2.prototype.require?(I2.prototype.require=this._origRequire,rh("require unhook successful")):rh("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,rh("process.getBuiltinModule unhook successful")):rh("process.getBuiltinModule unhook unsuccessful"))};function dta(t){let e=Bhe.sep!=="/"?t.path.split(Bhe.sep).join("/"):t.path;return Bhe.posix.join(t.name,e).replace(uta,"")}a(dta,"resolveModuleName")});var Kdt,Jdt,lsi=_e(()=>{p();Kdt=class{static{a(this,"ModuleNameTrieNode")}hooks=[];children=new Map},Jdt=class{static{a(this,"ModuleNameTrie")}_trie=new Kdt;_counter=0;insert(e){let r=this._trie;for(let n of e.moduleName.split("/")){let o=r.children.get(n);o||(o=new Kdt,r.children.set(n,o)),r=o}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let o=this._trie,s=[],c=!0;for(let l of e.split("/")){let u=o.children.get(l);if(!u){c=!1;break}n||s.push(...u.hooks),o=u}return n&&c&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(r&&s.sort((l,u)=>l.insertedId-u.insertedId),s.map(({hook:l})=>l))}}});function pta(t){return Xhr.sep!=="/"?t.split(Xhr.sep).join("/"):t}var dsi,Xhr,fta,Zdt,fsi=_e(()=>{p();dsi=fe(Zhr()),Xhr=fe(require("path"));lsi();fta=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),Zdt=class t{static{a(this,"RequireInTheMiddleSingleton")}_moduleNameTrie=new Jdt;static _instance;constructor(){this._initialize()}_initialize(){new dsi.Hook(null,{internals:!0},(e,r,n)=>{let o=pta(r),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:c}of s)e=c(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){return fta?new t:this._instance=this._instance??new t}};a(pta,"normalizePathSeparators")});var ysi=I(IX=>{p();var psi=[],e0r=new WeakMap,hsi=new WeakMap,msi=new Map,gsi=[],hta={set(t,e,r){return e0r.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=hsi.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return e0r.get(t)[e](r.value)}};function mta(t,e,r,n,o){msi.set(t,o),e0r.set(e,r),hsi.set(e,n);let s=new Proxy(e,hta);psi.forEach(c=>c(t,s)),gsi.push([t,s])}a(mta,"register");var Asi=!1;function gta(){return Asi}a(gta,"getExperimentalPatchInternals");function Ata(t){Asi=t}a(Ata,"setExperimentalPatchInternals");IX.register=mta;IX.importHooks=psi;IX.specifiers=msi;IX.toHook=gsi;IX.getExperimentalPatchInternals=gta;IX.setExperimentalPatchInternals=Ata});var Ssi=I((bzf,Lhe)=>{p();var Esi=require("path"),yta=qhr(),{fileURLToPath:_si}=require("url"),{MessageChannel:Eta}=require("worker_threads"),{importHooks:t0r,specifiers:_ta,toHook:vta,getExperimentalPatchInternals:Cta}=ysi();function Csi(t){t0r.push(t),vta.forEach(([e,r])=>t(e,r))}a(Csi,"addHook");function bsi(t){let e=t0r.indexOf(t);e>-1&&t0r.splice(e,1)}a(bsi,"removeHook");function vsi(t,e,r,n){let o=t(e,r,n);o&&o!==e&&(e.default=o)}a(vsi,"callHookFn");var r0r;function bta(){let{port1:t,port2:e}=new Eta,r=0,n;r0r=a(l=>{r++,t.postMessage(l)},"sendModulesToLoader"),t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function o(){let l=setInterval(()=>{},1e3),u=new Promise(d=>{n=d}).then(()=>{clearInterval(l)});return r===0&&n(),u}a(o,"waitForAllMessagesAcknowledged");let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}a(bta,"createAddHookMessageChannel");function oNe(t,e,r){if(!(this instanceof oNe))return new oNe(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;r0r&&Array.isArray(t)&&r0r(t),this._iitmHook=(o,s)=>{let c=o,l=o.startsWith("node:"),u;if(l)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=_si(o)}catch{}let d=yta(o);d&&(o=d.name,u=d.basedir)}if(t){for(let d of t)if(d===o){if(u){if(n)o=o+Esi.sep+Esi.relative(u,_si(c));else if(!Cta()&&!u.endsWith(_ta.get(c)))continue}vsi(r,s,o,u)}}else vsi(r,s,o,u)},Csi(this._iitmHook)}a(oNe,"Hook");oNe.prototype.unhook=function(){bsi(this._iitmHook)};Lhe.exports=oNe;Lhe.exports.Hook=oNe;Lhe.exports.addHook=Csi;Lhe.exports.removeHook=bsi;Lhe.exports.createAddHookMessageChannel=bta});function Tsi(t,e,r){let n,o;try{o=t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}async function Isi(t,e,r){let n,o;try{o=await t()}catch(s){n=s}finally{if(e(n,o),n&&!r)throw n;return o}}function Xdt(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}var n0r=_e(()=>{p();a(Tsi,"safeExecuteInTheMiddle");a(Isi,"safeExecuteInTheMiddleAsync");a(Xdt,"isWrapped")});function xsi(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>foi(e,n,{includePrerelease:r}))}var WF,i0r,sNe,wsi,Rsi,Psi,Fhe,ksi=_e(()=>{p();WF=fe(require("path")),i0r=require("util");goi();sNe=fe(khe());_oi();fsi();wsi=fe(Ssi());co();Rsi=fe(Zhr()),Psi=require("fs");n0r();Fhe=class extends jdt{static{a(this,"InstrumentationBase")}_modules;_hooks=[];_requireInTheMiddleSingleton=Zdt.getInstance();_enabled=!1;constructor(e,r,n){super(e,r,n);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=a((e,r,n)=>{if(Xdt(e[r])&&this._unwrap(e,r),i0r.types.isProxy(e)){let o=(0,sNe.wrap)(Object.assign({},e),r,n);return Object.defineProperty(e,r,{value:o}),o}else return(0,sNe.wrap)(e,r,n)},"_wrap");_unwrap=a((e,r)=>i0r.types.isProxy(e)?Object.defineProperty(e,r,{value:e[r]}):(0,sNe.unwrap)(e,r),"_unwrap");_massWrap=a((e,r,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Pn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Pn.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{r.forEach(s=>{this._wrap(o,s,n)})})},"_massWrap");_massUnwrap=a((e,r)=>{if(e)Array.isArray(e)||(e=[e]);else{Pn.error("must provide one or more modules to patch");return}if(!(r&&Array.isArray(r))){Pn.error("must provide one or more functions to wrap on modules");return}e.forEach(n=>{r.forEach(o=>{this._unwrap(n,o)})})},"_massUnwrap");_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=require.resolve(r);require.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,Psi.readFileSync)(WF.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{Pn.warn("Failed extracting version",e)}}_onRequire(e,r,n,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===n)return xsi(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(r,e.moduleVersion)):r;let c=e.files??[],l=WF.normalize(n);return c.filter(d=>d.name===l).filter(d=>xsi(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=a((c,l,u)=>{if(!u&&WF.isAbsolute(l)){let d=WF.parse(l);l=d.name,u=d.dir}return this._onRequire(e,c,l,u)},"hookFn"),n=a((c,l,u)=>this._onRequire(e,c,l,u),"onRequire"),o=WF.isAbsolute(e.name)?new Rsi.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(o);let s=new wsi.Hook([e.name],{internals:!1},r);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};a(xsi,"isSupported")});var aNe,Dsi=_e(()=>{p();aNe=require("path")});var Nsi=_e(()=>{p();ksi();Dsi()});var o0r=_e(()=>{p();Nsi()});var eft,Msi=_e(()=>{p();eft=class{static{a(this,"InstrumentationNodeModuleDefinition")}name;supportedVersions;patch;unpatch;files;constructor(e,r,n,o,s){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=o,this.files=s||[]}}});var tft,Osi=_e(()=>{p();o0r();tft=class{static{a(this,"InstrumentationNodeModuleFile")}supportedVersions;patch;unpatch;name;constructor(e,r,n,o){this.supportedVersions=r,this.patch=n,this.unpatch=o,this.name=(0,aNe.normalize)(e)}}});var s0r={};xi(s0r,{InstrumentationBase:()=>Fhe,InstrumentationNodeModuleDefinition:()=>eft,InstrumentationNodeModuleFile:()=>tft,isWrapped:()=>Xdt,registerInstrumentations:()=>ooi,safeExecuteInTheMiddle:()=>Tsi,safeExecuteInTheMiddleAsync:()=>Isi});var a0r=_e(()=>{p();soi();o0r();Msi();Osi();n0r()});var Lsi=I(c0r=>{"use strict";p();Object.defineProperty(c0r,"__esModule",{value:!0});c0r.log=xta;var Bsi=(wL(),ya(h7)),Sta=require("node:os"),Tta=Bsi.__importDefault(require("node:util")),Ita=Bsi.__importStar(require("node:process"));function xta(t,...e){Ita.stderr.write(`${Tta.default.format(t,...e)}${Sta.EOL}`)}a(xta,"log")});var jsi=I(p0r=>{"use strict";p();Object.defineProperty(p0r,"__esModule",{value:!0});var wta=Lsi(),Fsi=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Usi,l0r=[],u0r=[],rft=[];Fsi&&d0r(Fsi);var Qsi=Object.assign(t=>qsi(t),{enable:d0r,enabled:f0r,disable:Rta,log:wta.log});function d0r(t){Usi=t,l0r=[],u0r=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?u0r.push(new RegExp(`^${n.substr(1)}$`)):l0r.push(new RegExp(`^${n}$`));for(let n of rft)n.enabled=f0r(n.namespace)}a(d0r,"enable");function f0r(t){if(t.endsWith("*"))return!0;for(let e of u0r)if(e.test(t))return!1;for(let e of l0r)if(e.test(t))return!0;return!1}a(f0r,"enabled");function Rta(){let t=Usi||"";return d0r(""),t}a(Rta,"disable");function qsi(t){let e=Object.assign(r,{enabled:f0r(t),destroy:Pta,log:Qsi.log,namespace:t,extend:kta});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),rft.push(e),e}a(qsi,"createDebugger");function Pta(){let t=rft.indexOf(this);return t>=0?(rft.splice(t,1),!0):!1}a(Pta,"destroy");function kta(t){let e=qsi(`${this.namespace}:${t}`);return e.log=this.log,e}a(kta,"extend");p0r.default=Qsi});var sft=I(Q5=>{"use strict";p();Object.defineProperty(Q5,"__esModule",{value:!0});Q5.AzureLogger=void 0;Q5.setLogLevel=$si;Q5.getLogLevel=Nta;Q5.createClientLogger=Mta;var Dta=(wL(),ya(h7)),cNe=Dta.__importDefault(jsi()),Gsi=new Set,nft=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,oft;Q5.AzureLogger=(0,cNe.default)("azure");Q5.AzureLogger.log=(...t)=>{cNe.default.log(...t)};var h0r=["verbose","info","warning","error"];nft&&(zsi(nft)?$si(nft):console.error(`AZURE_LOG_LEVEL set to unknown log level '${nft}'; logging is not enabled. Acceptable values: ${h0r.join(", ")}.`));function $si(t){if(t&&!zsi(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${h0r.join(",")}`);oft=t;let e=[];for(let r of Gsi)Wsi(r)&&e.push(r.namespace);cNe.default.enable(e.join(","))}a($si,"setLogLevel");function Nta(){return oft}a(Nta,"getLogLevel");var Hsi={verbose:400,info:300,warning:200,error:100};function Mta(t){let e=Q5.AzureLogger.extend(t);return Vsi(Q5.AzureLogger,e),{error:ift(e,"error"),warning:ift(e,"warning"),info:ift(e,"info"),verbose:ift(e,"verbose")}}a(Mta,"createClientLogger");function Vsi(t,e){e.log=(...r)=>{t.log(...r)}}a(Vsi,"patchLogMethod");function ift(t,e){let r=Object.assign(t.extend(e),{level:e});if(Vsi(t,r),Wsi(r)){let n=cNe.default.disable();cNe.default.enable(n+","+r.namespace)}return Gsi.add(r),r}a(ift,"createLogger");function Wsi(t){return!!(oft&&Hsi[t.level]<=Hsi[oft])}a(Wsi,"shouldEnable");function zsi(t){return h0r.includes(t)}a(zsi,"isAzureLogLevel")});var m0r=I(aft=>{"use strict";p();Object.defineProperty(aft,"__esModule",{value:!0});aft.logger=void 0;var Ota=sft();aft.logger=(0,Ota.createClientLogger)("opentelemetry-instrumentation-azure-sdk")});function cft(t){return t.setValue(g0r,!0)}function Ysi(t){return t.deleteValue(g0r)}function Uhe(t){return t.getValue(g0r)===!0}var g0r,lNe=_e(()=>{p();co();g0r=rb("OpenTelemetry SDK Context Key SUPPRESS_TRACING");a(cft,"suppressTracing");a(Ysi,"unsuppressTracing");a(Uhe,"isTracingSuppressed")});var lft,Ksi=_e(()=>{p();lft="baggage"});function Zsi(t){return t.reduce((e,r)=>{let n=`${e}${e!==""?",":""}${r}`;return n.length>8192?e:n},"")}function Xsi(t){return t.getAllEntries().map(([e,r])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function A0r(t){let e=t.split(";");if(e.length<=0)return;let r=e.shift();if(!r)return;let n=r.indexOf("=");if(n<=0)return;let o=decodeURIComponent(r.substring(0,n).trim()),s=decodeURIComponent(r.substring(n+1).trim()),c;return e.length>0&&(c=Bfe(e.join(";"))),{key:o,value:s,metadata:c}}function eai(t){let e={};return typeof t=="string"&&t.length>0&&t.split(",").forEach(r=>{let n=A0r(r);n!==void 0&&n.value.length>0&&(e[n.key]=n.value)}),e}var y0r=_e(()=>{p();co();a(Zsi,"serializeKeyPairs");a(Xsi,"getKeyPairs");a(A0r,"parsePairKeyValue");a(eai,"parseKeyPairsIntoRecord")});var dft,tai=_e(()=>{p();co();lNe();Ksi();y0r();dft=class{static{a(this,"W3CBaggagePropagator")}inject(e,r,n){let o=dT.getBaggage(e);if(!o||Uhe(e))return;let s=Xsi(o).filter(l=>l.length<=4096).slice(0,180),c=Zsi(s);c.length>0&&n.set(r,lft,c)}extract(e,r,n){let o=n.get(r,lft),s=Array.isArray(o)?o.join(","):o;if(!s)return e;let c={};return s.length===0||(s.split(",").forEach(u=>{let d=A0r(u);if(d){let f={value:d.value};d.metadata&&(f.metadata=d.metadata),c[d.key]=f}}),Object.entries(c).length===0)?e:dT.setBaggage(e,dT.createBaggage(c))}fields(){return[lft]}}});var fft,rai=_e(()=>{p();fft=class{static{a(this,"AnchoredClock")}_monotonicClock;_epochMillis;_performanceMillis;constructor(e,r){this._monotonicClock=r,this._epochMillis=e.now(),this._performanceMillis=r.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}}});function nai(t){let e={};if(typeof t!="object"||t==null)return e;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(!Fta(r)){Pn.warn(`Invalid attribute key: ${r}`);continue}let n=t[r];if(!E0r(n)){Pn.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?e[r]=n.slice():e[r]=n}return e}function Fta(t){return typeof t=="string"&&t!==""}function E0r(t){return t==null?!0:Array.isArray(t)?Uta(t):iai(typeof t)}function Uta(t){let e;for(let r of t){if(r==null)continue;let n=typeof r;if(n!==e){if(!e){if(iai(n)){e=n;continue}return!1}return!1}}return!0}function iai(t){switch(t){case"number":case"boolean":case"string":return!0}return!1}var oai=_e(()=>{p();co();a(nai,"sanitizeAttributes");a(Fta,"isAttributeKey");a(E0r,"isAttributeValue");a(Uta,"isHomogeneousAttributeValueArray");a(iai,"isValidPrimitiveAttributeValueType")});function pft(){return t=>{Pn.error(Qta(t))}}function Qta(t){return typeof t=="string"?t:JSON.stringify(qta(t))}function qta(t){let e={},r=t;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(e[n])return;let o=r[n];o&&(e[n]=String(o))}),r=Object.getPrototypeOf(r);return e}var _0r=_e(()=>{p();co();a(pft,"loggingErrorHandler");a(Qta,"stringifyException");a(qta,"flattenException")});function aai(t){sai=t}function cai(t){try{sai(t)}catch{}}var sai,lai=_e(()=>{p();_0r();sai=pft();a(aai,"setGlobalErrorHandler");a(cai,"globalErrorHandler")});function hft(t){let e=process.env[t];if(e==null||e.trim()==="")return;let r=Number(e);if(isNaN(r)){Pn.warn(`Unknown value ${(0,v0r.inspect)(e)} for ${t}, expected a number, using defaults`);return}return r}function uNe(t){let e=process.env[t];if(!(e==null||e.trim()===""))return e}function mft(t){let e=process.env[t]?.trim().toLowerCase();return e==null||e===""?!1:e==="true"?!0:(e==="false"||Pn.warn(`Unknown value ${(0,v0r.inspect)(e)} for ${t}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}function gft(t){return uNe(t)?.split(",").map(e=>e.trim()).filter(e=>e!=="")}var v0r,uai=_e(()=>{p();co();v0r=require("util");a(hft,"getNumberFromEnv");a(uNe,"getStringFromEnv");a(mft,"getBooleanFromEnv");a(gft,"getStringListFromEnv")});var Aft,dai=_e(()=>{p();Aft=typeof globalThis=="object"?globalThis:global});var fai,EH,pai=_e(()=>{p();fai=require("perf_hooks"),EH=fai.performance});var hai,mai=_e(()=>{p();hai="2.2.0"});function nh(t){let e={},r=t.length;for(let n=0;n{p();a(nh,"createConstMap")});var gai,Aai,yai,Eai,_ai,vai,Cai,bai,Sai,Tai,Iai,xai,wai,Rai,Pai,kai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,vci,Cci,bci,Sci,Tci,Ici,xci,wci,Rci,Pci,kci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili,oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,vli,Cli,bli,Sli,Tli,Ili,xli,wli,Rli,Pli,kli,Dli,Nli,Mli,Oli,jta,Hta,Gta,$ta,Vta,Wta,zta,Yta,Kta,Jta,Zta,Xta,era,tra,rra,nra,ira,ora,sra,ara,cra,lra,ura,dra,fra,pra,hra,mra,gra,Ara,yra,Era,_ra,vra,Cra,bra,Sra,Tra,Ira,xra,wra,Rra,Pra,kra,Dra,Nra,Mra,Ora,Bra,Lra,Fra,Ura,Qra,qra,jra,Hra,Gra,$ra,Vra,Wra,zra,Yra,Kra,Jra,Zra,Xra,ena,tna,rna,nna,ina,ona,sna,ana,cna,lna,una,dna,fna,pna,hna,mna,gna,Ana,yna,Ena,_na,vna,Cna,bna,Sna,Tna,Ina,xna,wna,Rna,Pna,kna,Dna,Nna,Mna,Ona,Bna,Lna,Fna,Una,Qna,qna,jna,Hna,Gna,$na,Vna,Wna,zna,Yna,Kna,Jna,Zna,Xna,eia,tia,ria,nia,iia,oia,sia,aia,cia,Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli,Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui,lui,uui,dui,fui,pui,hui,mui,gui,Aui,yui,Eui,_ui,vui,Cui,bui,Sui,Tui,Iui,xui,wui,lia,uia,dia,fia,pia,hia,mia,gia,Aia,yia,Eia,_ia,via,Cia,bia,Sia,Tia,Iia,xia,wia,Ria,Pia,kia,Dia,Nia,Mia,Oia,Bia,Lia,Fia,Uia,Qia,qia,jia,Hia,Gia,$ia,Via,Wia,zia,Yia,Kia,Jia,Zia,Xia,eoa,toa,roa,Rui,Pui,kui,Dui,Nui,Mui,Oui,Bui,Lui,Fui,Uui,noa,ioa,ooa,soa,aoa,coa,loa,uoa,doa,foa,poa,hoa,Qui,qui,jui,Hui,Gui,moa,goa,Aoa,yoa,Eoa,_oa,$ui,Vui,Wui,voa,Coa,boa,Soa,zui,Yui,Kui,Jui,Toa,Ioa,xoa,woa,Roa,Zui,Xui,edi,tdi,rdi,ndi,idi,Poa,koa,Doa,Noa,Moa,Ooa,Boa,Loa,odi,sdi,adi,cdi,ldi,Foa,Uoa,Qoa,qoa,joa,Hoa,udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,vdi,Cdi,bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,Pdi,Goa,$oa,Voa,Woa,zoa,Yoa,Koa,Joa,Zoa,Xoa,esa,tsa,rsa,nsa,isa,osa,ssa,asa,csa,lsa,usa,dsa,kdi,Ddi,Ndi,Mdi,Odi,fsa,psa,hsa,msa,gsa,Asa,Bdi,Ldi,ysa,Esa,_sa,Fdi,Udi,vsa,Csa,bsa,Qdi,qdi,jdi,Hdi,Gdi,$di,Vdi,Wdi,zdi,Ydi,Kdi,Jdi,Zdi,Xdi,efi,tfi,rfi,Ssa,Tsa,Isa,xsa,wsa,Rsa,Psa,ksa,Dsa,Nsa,Msa,Osa,Bsa,Lsa,Fsa,Usa,Qsa,qsa,nfi,ifi,jsa,Hsa,Gsa,ofi=_e(()=>{p();C0r();gai="aws.lambda.invoked_arn",Aai="db.system",yai="db.connection_string",Eai="db.user",_ai="db.jdbc.driver_classname",vai="db.name",Cai="db.statement",bai="db.operation",Sai="db.mssql.instance_name",Tai="db.cassandra.keyspace",Iai="db.cassandra.page_size",xai="db.cassandra.consistency_level",wai="db.cassandra.table",Rai="db.cassandra.idempotence",Pai="db.cassandra.speculative_execution_count",kai="db.cassandra.coordinator.id",Dai="db.cassandra.coordinator.dc",Nai="db.hbase.namespace",Mai="db.redis.database_index",Oai="db.mongodb.collection",Bai="db.sql.table",Lai="exception.type",Fai="exception.message",Uai="exception.stacktrace",Qai="exception.escaped",qai="faas.trigger",jai="faas.execution",Hai="faas.document.collection",Gai="faas.document.operation",$ai="faas.document.time",Vai="faas.document.name",Wai="faas.time",zai="faas.cron",Yai="faas.coldstart",Kai="faas.invoked_name",Jai="faas.invoked_provider",Zai="faas.invoked_region",Xai="net.transport",eci="net.peer.ip",tci="net.peer.port",rci="net.peer.name",nci="net.host.ip",ici="net.host.port",oci="net.host.name",sci="net.host.connection.type",aci="net.host.connection.subtype",cci="net.host.carrier.name",lci="net.host.carrier.mcc",uci="net.host.carrier.mnc",dci="net.host.carrier.icc",fci="peer.service",pci="enduser.id",hci="enduser.role",mci="enduser.scope",gci="thread.id",Aci="thread.name",yci="code.function",Eci="code.namespace",_ci="code.filepath",vci="code.lineno",Cci="http.method",bci="http.url",Sci="http.target",Tci="http.host",Ici="http.scheme",xci="http.status_code",wci="http.flavor",Rci="http.user_agent",Pci="http.request_content_length",kci="http.request_content_length_uncompressed",Dci="http.response_content_length",Nci="http.response_content_length_uncompressed",Mci="http.server_name",Oci="http.route",Bci="http.client_ip",Lci="aws.dynamodb.table_names",Fci="aws.dynamodb.consumed_capacity",Uci="aws.dynamodb.item_collection_metrics",Qci="aws.dynamodb.provisioned_read_capacity",qci="aws.dynamodb.provisioned_write_capacity",jci="aws.dynamodb.consistent_read",Hci="aws.dynamodb.projection",Gci="aws.dynamodb.limit",$ci="aws.dynamodb.attributes_to_get",Vci="aws.dynamodb.index_name",Wci="aws.dynamodb.select",zci="aws.dynamodb.global_secondary_indexes",Yci="aws.dynamodb.local_secondary_indexes",Kci="aws.dynamodb.exclusive_start_table",Jci="aws.dynamodb.table_count",Zci="aws.dynamodb.scan_forward",Xci="aws.dynamodb.segment",eli="aws.dynamodb.total_segments",tli="aws.dynamodb.count",rli="aws.dynamodb.scanned_count",nli="aws.dynamodb.attribute_definitions",ili="aws.dynamodb.global_secondary_index_updates",oli="messaging.system",sli="messaging.destination",ali="messaging.destination_kind",cli="messaging.temp_destination",lli="messaging.protocol",uli="messaging.protocol_version",dli="messaging.url",fli="messaging.message_id",pli="messaging.conversation_id",hli="messaging.message_payload_size_bytes",mli="messaging.message_payload_compressed_size_bytes",gli="messaging.operation",Ali="messaging.consumer_id",yli="messaging.rabbitmq.routing_key",Eli="messaging.kafka.message_key",_li="messaging.kafka.consumer_group",vli="messaging.kafka.client_id",Cli="messaging.kafka.partition",bli="messaging.kafka.tombstone",Sli="rpc.system",Tli="rpc.service",Ili="rpc.method",xli="rpc.grpc.status_code",wli="rpc.jsonrpc.version",Rli="rpc.jsonrpc.request_id",Pli="rpc.jsonrpc.error_code",kli="rpc.jsonrpc.error_message",Dli="message.type",Nli="message.id",Mli="message.compressed_size",Oli="message.uncompressed_size",jta=gai,Hta=Aai,Gta=yai,$ta=Eai,Vta=_ai,Wta=vai,zta=Cai,Yta=bai,Kta=Sai,Jta=Tai,Zta=Iai,Xta=xai,era=wai,tra=Rai,rra=Pai,nra=kai,ira=Dai,ora=Nai,sra=Mai,ara=Oai,cra=Bai,lra=Lai,ura=Fai,dra=Uai,fra=Qai,pra=qai,hra=jai,mra=Hai,gra=Gai,Ara=$ai,yra=Vai,Era=Wai,_ra=zai,vra=Yai,Cra=Kai,bra=Jai,Sra=Zai,Tra=Xai,Ira=eci,xra=tci,wra=rci,Rra=nci,Pra=ici,kra=oci,Dra=sci,Nra=aci,Mra=cci,Ora=lci,Bra=uci,Lra=dci,Fra=fci,Ura=pci,Qra=hci,qra=mci,jra=gci,Hra=Aci,Gra=yci,$ra=Eci,Vra=_ci,Wra=vci,zra=Cci,Yra=bci,Kra=Sci,Jra=Tci,Zra=Ici,Xra=xci,ena=wci,tna=Rci,rna=Pci,nna=kci,ina=Dci,ona=Nci,sna=Mci,ana=Oci,cna=Bci,lna=Lci,una=Fci,dna=Uci,fna=Qci,pna=qci,hna=jci,mna=Hci,gna=Gci,Ana=$ci,yna=Vci,Ena=Wci,_na=zci,vna=Yci,Cna=Kci,bna=Jci,Sna=Zci,Tna=Xci,Ina=eli,xna=tli,wna=rli,Rna=nli,Pna=ili,kna=oli,Dna=sli,Nna=ali,Mna=cli,Ona=lli,Bna=uli,Lna=dli,Fna=fli,Una=pli,Qna=hli,qna=mli,jna=gli,Hna=Ali,Gna=yli,$na=Eli,Vna=_li,Wna=vli,zna=Cli,Yna=bli,Kna=Sli,Jna=Tli,Zna=Ili,Xna=xli,eia=wli,tia=Rli,ria=Pli,nia=kli,iia=Dli,oia=Nli,sia=Mli,aia=Oli,cia=nh([gai,Aai,yai,Eai,_ai,vai,Cai,bai,Sai,Tai,Iai,xai,wai,Rai,Pai,kai,Dai,Nai,Mai,Oai,Bai,Lai,Fai,Uai,Qai,qai,jai,Hai,Gai,$ai,Vai,Wai,zai,Yai,Kai,Jai,Zai,Xai,eci,tci,rci,nci,ici,oci,sci,aci,cci,lci,uci,dci,fci,pci,hci,mci,gci,Aci,yci,Eci,_ci,vci,Cci,bci,Sci,Tci,Ici,xci,wci,Rci,Pci,kci,Dci,Nci,Mci,Oci,Bci,Lci,Fci,Uci,Qci,qci,jci,Hci,Gci,$ci,Vci,Wci,zci,Yci,Kci,Jci,Zci,Xci,eli,tli,rli,nli,ili,oli,sli,ali,cli,lli,uli,dli,fli,pli,hli,mli,gli,Ali,yli,Eli,_li,vli,Cli,bli,Sli,Tli,Ili,xli,wli,Rli,Pli,kli,Dli,Nli,Mli,Oli]),Bli="other_sql",Lli="mssql",Fli="mysql",Uli="oracle",Qli="db2",qli="postgresql",jli="redshift",Hli="hive",Gli="cloudscape",$li="hsqldb",Vli="progress",Wli="maxdb",zli="hanadb",Yli="ingres",Kli="firstsql",Jli="edb",Zli="cache",Xli="adabas",eui="firebird",tui="derby",rui="filemaker",nui="informix",iui="instantdb",oui="interbase",sui="mariadb",aui="netezza",cui="pervasive",lui="pointbase",uui="sqlite",dui="sybase",fui="teradata",pui="vertica",hui="h2",mui="coldfusion",gui="cassandra",Aui="hbase",yui="mongodb",Eui="redis",_ui="couchbase",vui="couchdb",Cui="cosmosdb",bui="dynamodb",Sui="neo4j",Tui="geode",Iui="elasticsearch",xui="memcached",wui="cockroachdb",lia=Bli,uia=Lli,dia=Fli,fia=Uli,pia=Qli,hia=qli,mia=jli,gia=Hli,Aia=Gli,yia=$li,Eia=Vli,_ia=Wli,via=zli,Cia=Yli,bia=Kli,Sia=Jli,Tia=Zli,Iia=Xli,xia=eui,wia=tui,Ria=rui,Pia=nui,kia=iui,Dia=oui,Nia=sui,Mia=aui,Oia=cui,Bia=lui,Lia=uui,Fia=dui,Uia=fui,Qia=pui,qia=hui,jia=mui,Hia=gui,Gia=Aui,$ia=yui,Via=Eui,Wia=_ui,zia=vui,Yia=Cui,Kia=bui,Jia=Sui,Zia=Tui,Xia=Iui,eoa=xui,toa=wui,roa=nh([Bli,Lli,Fli,Uli,Qli,qli,jli,Hli,Gli,$li,Vli,Wli,zli,Yli,Kli,Jli,Zli,Xli,eui,tui,rui,nui,iui,oui,sui,aui,cui,lui,uui,dui,fui,pui,hui,mui,gui,Aui,yui,Eui,_ui,vui,Cui,bui,Sui,Tui,Iui,xui,wui]),Rui="all",Pui="each_quorum",kui="quorum",Dui="local_quorum",Nui="one",Mui="two",Oui="three",Bui="local_one",Lui="any",Fui="serial",Uui="local_serial",noa=Rui,ioa=Pui,ooa=kui,soa=Dui,aoa=Nui,coa=Mui,loa=Oui,uoa=Bui,doa=Lui,foa=Fui,poa=Uui,hoa=nh([Rui,Pui,kui,Dui,Nui,Mui,Oui,Bui,Lui,Fui,Uui]),Qui="datasource",qui="http",jui="pubsub",Hui="timer",Gui="other",moa=Qui,goa=qui,Aoa=jui,yoa=Hui,Eoa=Gui,_oa=nh([Qui,qui,jui,Hui,Gui]),$ui="insert",Vui="edit",Wui="delete",voa=$ui,Coa=Vui,boa=Wui,Soa=nh([$ui,Vui,Wui]),zui="alibaba_cloud",Yui="aws",Kui="azure",Jui="gcp",Toa=zui,Ioa=Yui,xoa=Kui,woa=Jui,Roa=nh([zui,Yui,Kui,Jui]),Zui="ip_tcp",Xui="ip_udp",edi="ip",tdi="unix",rdi="pipe",ndi="inproc",idi="other",Poa=Zui,koa=Xui,Doa=edi,Noa=tdi,Moa=rdi,Ooa=ndi,Boa=idi,Loa=nh([Zui,Xui,edi,tdi,rdi,ndi,idi]),odi="wifi",sdi="wired",adi="cell",cdi="unavailable",ldi="unknown",Foa=odi,Uoa=sdi,Qoa=adi,qoa=cdi,joa=ldi,Hoa=nh([odi,sdi,adi,cdi,ldi]),udi="gprs",ddi="edge",fdi="umts",pdi="cdma",hdi="evdo_0",mdi="evdo_a",gdi="cdma2000_1xrtt",Adi="hsdpa",ydi="hsupa",Edi="hspa",_di="iden",vdi="evdo_b",Cdi="lte",bdi="ehrpd",Sdi="hspap",Tdi="gsm",Idi="td_scdma",xdi="iwlan",wdi="nr",Rdi="nrnsa",Pdi="lte_ca",Goa=udi,$oa=ddi,Voa=fdi,Woa=pdi,zoa=hdi,Yoa=mdi,Koa=gdi,Joa=Adi,Zoa=ydi,Xoa=Edi,esa=_di,tsa=vdi,rsa=Cdi,nsa=bdi,isa=Sdi,osa=Tdi,ssa=Idi,asa=xdi,csa=wdi,lsa=Rdi,usa=Pdi,dsa=nh([udi,ddi,fdi,pdi,hdi,mdi,gdi,Adi,ydi,Edi,_di,vdi,Cdi,bdi,Sdi,Tdi,Idi,xdi,wdi,Rdi,Pdi]),kdi="1.0",Ddi="1.1",Ndi="2.0",Mdi="SPDY",Odi="QUIC",fsa=kdi,psa=Ddi,hsa=Ndi,msa=Mdi,gsa=Odi,Asa={HTTP_1_0:kdi,HTTP_1_1:Ddi,HTTP_2_0:Ndi,SPDY:Mdi,QUIC:Odi},Bdi="queue",Ldi="topic",ysa=Bdi,Esa=Ldi,_sa=nh([Bdi,Ldi]),Fdi="receive",Udi="process",vsa=Fdi,Csa=Udi,bsa=nh([Fdi,Udi]),Qdi=0,qdi=1,jdi=2,Hdi=3,Gdi=4,$di=5,Vdi=6,Wdi=7,zdi=8,Ydi=9,Kdi=10,Jdi=11,Zdi=12,Xdi=13,efi=14,tfi=15,rfi=16,Ssa=Qdi,Tsa=qdi,Isa=jdi,xsa=Hdi,wsa=Gdi,Rsa=$di,Psa=Vdi,ksa=Wdi,Dsa=zdi,Nsa=Ydi,Msa=Kdi,Osa=Jdi,Bsa=Zdi,Lsa=Xdi,Fsa=efi,Usa=tfi,Qsa=rfi,qsa={OK:Qdi,CANCELLED:qdi,UNKNOWN:jdi,INVALID_ARGUMENT:Hdi,DEADLINE_EXCEEDED:Gdi,NOT_FOUND:$di,ALREADY_EXISTS:Vdi,PERMISSION_DENIED:Wdi,RESOURCE_EXHAUSTED:zdi,FAILED_PRECONDITION:Ydi,ABORTED:Kdi,OUT_OF_RANGE:Jdi,UNIMPLEMENTED:Zdi,INTERNAL:Xdi,UNAVAILABLE:efi,DATA_LOSS:tfi,UNAUTHENTICATED:rfi},nfi="SENT",ifi="RECEIVED",jsa=nfi,Hsa=ifi,Gsa=nh([nfi,ifi])});var sfi=_e(()=>{p();ofi()});var afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,Pfi,kfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,Ppi,kpi,Dpi,Npi,$sa,Vsa,Wsa,zsa,Ysa,Ksa,Jsa,Zsa,Xsa,eaa,taa,raa,naa,iaa,oaa,saa,aaa,caa,laa,uaa,daa,faa,paa,haa,maa,gaa,Aaa,yaa,Eaa,_aa,vaa,Caa,baa,Saa,Taa,Iaa,xaa,waa,Raa,Paa,kaa,Daa,Naa,Maa,Oaa,Baa,Laa,Faa,Uaa,Qaa,qaa,jaa,Haa,Gaa,$aa,Vaa,Waa,zaa,Yaa,Kaa,Jaa,Zaa,Xaa,eca,tca,rca,nca,ica,oca,sca,aca,cca,lca,uca,dca,fca,pca,hca,mca,gca,Aca,yca,Mpi,Opi,Bpi,Lpi,Eca,_ca,vca,Cca,bca,Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi,Sca,Tca,Ica,xca,wca,Rca,Pca,kca,Dca,Nca,Mca,Oca,Bca,Lca,Fca,Uca,Qca,qca,thi,rhi,jca,Hca,Gca,nhi,ihi,ohi,shi,ahi,chi,lhi,$ca,Vca,Wca,zca,Yca,Kca,Jca,Zca,uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi,Xca,ela,tla,rla,nla,ila,ola,sla,ala,cla,lla,ula,vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,Phi,dla,fla,pla,hla,mla,gla,Ala,yla,Ela,_la,vla,khi=_e(()=>{p();C0r();afi="cloud.provider",cfi="cloud.account.id",lfi="cloud.region",ufi="cloud.availability_zone",dfi="cloud.platform",ffi="aws.ecs.container.arn",pfi="aws.ecs.cluster.arn",hfi="aws.ecs.launchtype",mfi="aws.ecs.task.arn",gfi="aws.ecs.task.family",Afi="aws.ecs.task.revision",yfi="aws.eks.cluster.arn",Efi="aws.log.group.names",_fi="aws.log.group.arns",vfi="aws.log.stream.names",Cfi="aws.log.stream.arns",bfi="container.name",Sfi="container.id",Tfi="container.runtime",Ifi="container.image.name",xfi="container.image.tag",wfi="deployment.environment",Rfi="device.id",Pfi="device.model.identifier",kfi="device.model.name",Dfi="faas.name",Nfi="faas.id",Mfi="faas.version",Ofi="faas.instance",Bfi="faas.max_memory",Lfi="host.id",Ffi="host.name",Ufi="host.type",Qfi="host.arch",qfi="host.image.name",jfi="host.image.id",Hfi="host.image.version",Gfi="k8s.cluster.name",$fi="k8s.node.name",Vfi="k8s.node.uid",Wfi="k8s.namespace.name",zfi="k8s.pod.uid",Yfi="k8s.pod.name",Kfi="k8s.container.name",Jfi="k8s.replicaset.uid",Zfi="k8s.replicaset.name",Xfi="k8s.deployment.uid",epi="k8s.deployment.name",tpi="k8s.statefulset.uid",rpi="k8s.statefulset.name",npi="k8s.daemonset.uid",ipi="k8s.daemonset.name",opi="k8s.job.uid",spi="k8s.job.name",api="k8s.cronjob.uid",cpi="k8s.cronjob.name",lpi="os.type",upi="os.description",dpi="os.name",fpi="os.version",ppi="process.pid",hpi="process.executable.name",mpi="process.executable.path",gpi="process.command",Api="process.command_line",ypi="process.command_args",Epi="process.owner",_pi="process.runtime.name",vpi="process.runtime.version",Cpi="process.runtime.description",bpi="service.name",Spi="service.namespace",Tpi="service.instance.id",Ipi="service.version",xpi="telemetry.sdk.name",wpi="telemetry.sdk.language",Rpi="telemetry.sdk.version",Ppi="telemetry.auto.version",kpi="webengine.name",Dpi="webengine.version",Npi="webengine.description",$sa=afi,Vsa=cfi,Wsa=lfi,zsa=ufi,Ysa=dfi,Ksa=ffi,Jsa=pfi,Zsa=hfi,Xsa=mfi,eaa=gfi,taa=Afi,raa=yfi,naa=Efi,iaa=_fi,oaa=vfi,saa=Cfi,aaa=bfi,caa=Sfi,laa=Tfi,uaa=Ifi,daa=xfi,faa=wfi,paa=Rfi,haa=Pfi,maa=kfi,gaa=Dfi,Aaa=Nfi,yaa=Mfi,Eaa=Ofi,_aa=Bfi,vaa=Lfi,Caa=Ffi,baa=Ufi,Saa=Qfi,Taa=qfi,Iaa=jfi,xaa=Hfi,waa=Gfi,Raa=$fi,Paa=Vfi,kaa=Wfi,Daa=zfi,Naa=Yfi,Maa=Kfi,Oaa=Jfi,Baa=Zfi,Laa=Xfi,Faa=epi,Uaa=tpi,Qaa=rpi,qaa=npi,jaa=ipi,Haa=opi,Gaa=spi,$aa=api,Vaa=cpi,Waa=lpi,zaa=upi,Yaa=dpi,Kaa=fpi,Jaa=ppi,Zaa=hpi,Xaa=mpi,eca=gpi,tca=Api,rca=ypi,nca=Epi,ica=_pi,oca=vpi,sca=Cpi,aca=bpi,cca=Spi,lca=Tpi,uca=Ipi,dca=xpi,fca=wpi,pca=Rpi,hca=Ppi,mca=kpi,gca=Dpi,Aca=Npi,yca=nh([afi,cfi,lfi,ufi,dfi,ffi,pfi,hfi,mfi,gfi,Afi,yfi,Efi,_fi,vfi,Cfi,bfi,Sfi,Tfi,Ifi,xfi,wfi,Rfi,Pfi,kfi,Dfi,Nfi,Mfi,Ofi,Bfi,Lfi,Ffi,Ufi,Qfi,qfi,jfi,Hfi,Gfi,$fi,Vfi,Wfi,zfi,Yfi,Kfi,Jfi,Zfi,Xfi,epi,tpi,rpi,npi,ipi,opi,spi,api,cpi,lpi,upi,dpi,fpi,ppi,hpi,mpi,gpi,Api,ypi,Epi,_pi,vpi,Cpi,bpi,Spi,Tpi,Ipi,xpi,wpi,Rpi,Ppi,kpi,Dpi,Npi]),Mpi="alibaba_cloud",Opi="aws",Bpi="azure",Lpi="gcp",Eca=Mpi,_ca=Opi,vca=Bpi,Cca=Lpi,bca=nh([Mpi,Opi,Bpi,Lpi]),Fpi="alibaba_cloud_ecs",Upi="alibaba_cloud_fc",Qpi="aws_ec2",qpi="aws_ecs",jpi="aws_eks",Hpi="aws_lambda",Gpi="aws_elastic_beanstalk",$pi="azure_vm",Vpi="azure_container_instances",Wpi="azure_aks",zpi="azure_functions",Ypi="azure_app_service",Kpi="gcp_compute_engine",Jpi="gcp_cloud_run",Zpi="gcp_kubernetes_engine",Xpi="gcp_cloud_functions",ehi="gcp_app_engine",Sca=Fpi,Tca=Upi,Ica=Qpi,xca=qpi,wca=jpi,Rca=Hpi,Pca=Gpi,kca=$pi,Dca=Vpi,Nca=Wpi,Mca=zpi,Oca=Ypi,Bca=Kpi,Lca=Jpi,Fca=Zpi,Uca=Xpi,Qca=ehi,qca=nh([Fpi,Upi,Qpi,qpi,jpi,Hpi,Gpi,$pi,Vpi,Wpi,zpi,Ypi,Kpi,Jpi,Zpi,Xpi,ehi]),thi="ec2",rhi="fargate",jca=thi,Hca=rhi,Gca=nh([thi,rhi]),nhi="amd64",ihi="arm32",ohi="arm64",shi="ia64",ahi="ppc32",chi="ppc64",lhi="x86",$ca=nhi,Vca=ihi,Wca=ohi,zca=shi,Yca=ahi,Kca=chi,Jca=lhi,Zca=nh([nhi,ihi,ohi,shi,ahi,chi,lhi]),uhi="windows",dhi="linux",fhi="darwin",phi="freebsd",hhi="netbsd",mhi="openbsd",ghi="dragonflybsd",Ahi="hpux",yhi="aix",Ehi="solaris",_hi="z_os",Xca=uhi,ela=dhi,tla=fhi,rla=phi,nla=hhi,ila=mhi,ola=ghi,sla=Ahi,ala=yhi,cla=Ehi,lla=_hi,ula=nh([uhi,dhi,fhi,phi,hhi,mhi,ghi,Ahi,yhi,Ehi,_hi]),vhi="cpp",Chi="dotnet",bhi="erlang",Shi="go",Thi="java",Ihi="nodejs",xhi="php",whi="python",Rhi="ruby",Phi="webjs",dla=vhi,fla=Chi,pla=bhi,hla=Shi,mla=Thi,gla=Ihi,Ala=xhi,yla=whi,Ela=Rhi,_la=Phi,vla=nh([vhi,Chi,bhi,Shi,Thi,Ihi,xhi,whi,Rhi,Phi])});var Dhi=_e(()=>{p();khi()});var Cla,bla,Sla,Tla,Ila,xla,wla,Rla,Pla,kla,Dla,Nla,Mla,Ola,Bla,Lla,Fla,Ula,Qla,qla,jla,Hla,Gla,$la,Vla,Wla,zla,Yla,Kla,Jla,Zla,Xla,eua,tua,rua,nua,iua,oua,sua,aua,cua,lua,vKf,CKf,uua,dua,fua,pua,hua,mua,gua,Aua,yua,Eua,_ua,vua,Cua,bua,Sua,Tua,Iua,xua,wua,Rua,Pua,kua,Dua,Nua,Mua,Oua,Bua,Lua,Fua,Uua,Qua,qua,jua,Hua,Gua,$ua,Vua,Wua,zua,Yua,Kua,Jua,Zua,Xua,eda,tda,rda,nda,ida,oda,sda,ada,cda,lda,uda,dda,fda,pda,hda,mda,gda,Ada,yda,Eda,_da,vda,Cda,bda,Sda,Tda,b0r,Ida,xda,wda,Rda,Pda,S0r,kda,Dda,Nda,Mda,Oda,Bda,T0r,I0r,Lda,Fda,Uda,Qda,qda,jda,Nhi=_e(()=>{p();Cla="aspnetcore.diagnostics.exception.result",bla="aborted",Sla="handled",Tla="skipped",Ila="unhandled",xla="aspnetcore.diagnostics.handler.type",wla="aspnetcore.rate_limiting.policy",Rla="aspnetcore.rate_limiting.result",Pla="acquired",kla="endpoint_limiter",Dla="global_limiter",Nla="request_canceled",Mla="aspnetcore.request.is_unhandled",Ola="aspnetcore.routing.is_fallback",Bla="aspnetcore.routing.match_status",Lla="failure",Fla="success",Ula="aspnetcore.user.is_authenticated",Qla="client.address",qla="client.port",jla="code.column.number",Hla="code.file.path",Gla="code.function.name",$la="code.line.number",Vla="code.stacktrace",Wla="db.collection.name",zla="db.namespace",Yla="db.operation.batch.size",Kla="db.operation.name",Jla="db.query.summary",Zla="db.query.text",Xla="db.response.status_code",eua="db.stored_procedure.name",tua="db.system.name",rua="mariadb",nua="microsoft.sql_server",iua="mysql",oua="postgresql",sua="dotnet.gc.heap.generation",aua="gen0",cua="gen1",lua="gen2",vKf="loh",CKf="poh",uua="error.type",dua="_OTHER",fua="exception.escaped",pua="exception.message",hua="exception.stacktrace",mua="exception.type",gua=a(t=>`http.request.header.${t}`,"ATTR_HTTP_REQUEST_HEADER"),Aua="http.request.method",yua="_OTHER",Eua="CONNECT",_ua="DELETE",vua="GET",Cua="HEAD",bua="OPTIONS",Sua="PATCH",Tua="POST",Iua="PUT",xua="TRACE",wua="http.request.method_original",Rua="http.request.resend_count",Pua=a(t=>`http.response.header.${t}`,"ATTR_HTTP_RESPONSE_HEADER"),kua="http.response.status_code",Dua="http.route",Nua="jvm.gc.action",Mua="jvm.gc.name",Oua="jvm.memory.pool.name",Bua="jvm.memory.type",Lua="heap",Fua="non_heap",Uua="jvm.thread.daemon",Qua="jvm.thread.state",qua="blocked",jua="new",Hua="runnable",Gua="terminated",$ua="timed_waiting",Vua="waiting",Wua="network.local.address",zua="network.local.port",Yua="network.peer.address",Kua="network.peer.port",Jua="network.protocol.name",Zua="network.protocol.version",Xua="network.transport",eda="pipe",tda="quic",rda="tcp",nda="udp",ida="unix",oda="network.type",sda="ipv4",ada="ipv6",cda="otel.scope.name",lda="otel.scope.version",uda="otel.status_code",dda="ERROR",fda="OK",pda="otel.status_description",hda="server.address",mda="server.port",gda="service.name",Ada="service.version",yda="signalr.connection.status",Eda="app_shutdown",_da="normal_closure",vda="timeout",Cda="signalr.transport",bda="long_polling",Sda="server_sent_events",Tda="web_sockets",b0r="telemetry.sdk.language",Ida="cpp",xda="dotnet",wda="erlang",Rda="go",Pda="java",S0r="nodejs",kda="php",Dda="python",Nda="ruby",Mda="rust",Oda="swift",Bda="webjs",T0r="telemetry.sdk.name",I0r="telemetry.sdk.version",Lda="url.fragment",Fda="url.full",Uda="url.path",Qda="url.query",qda="url.scheme",jda="user_agent.original"});var Hda,Gda,$da,Vda,Wda,zda,Yda,Kda,Jda,Zda,Xda,efa,tfa,rfa,nfa,ifa,ofa,sfa,afa,cfa,lfa,ufa,dfa,ffa,pfa,hfa,mfa,gfa,Afa,yfa,Efa,_fa,vfa,Cfa,bfa,Sfa,Tfa,Ifa,xfa,wfa,Rfa,Pfa,kfa,Dfa,Nfa,Mfa,Ofa,Bfa,Lfa,Ffa,Ufa,Mhi=_e(()=>{p();Hda="aspnetcore.diagnostics.exceptions",Gda="aspnetcore.rate_limiting.active_request_leases",$da="aspnetcore.rate_limiting.queued_requests",Vda="aspnetcore.rate_limiting.request.time_in_queue",Wda="aspnetcore.rate_limiting.request_lease.duration",zda="aspnetcore.rate_limiting.requests",Yda="aspnetcore.routing.match_attempts",Kda="db.client.operation.duration",Jda="dotnet.assembly.count",Zda="dotnet.exceptions",Xda="dotnet.gc.collections",efa="dotnet.gc.heap.total_allocated",tfa="dotnet.gc.last_collection.heap.fragmentation.size",rfa="dotnet.gc.last_collection.heap.size",nfa="dotnet.gc.last_collection.memory.committed_size",ifa="dotnet.gc.pause.time",ofa="dotnet.jit.compilation.time",sfa="dotnet.jit.compiled_il.size",afa="dotnet.jit.compiled_methods",cfa="dotnet.monitor.lock_contentions",lfa="dotnet.process.cpu.count",ufa="dotnet.process.cpu.time",dfa="dotnet.process.memory.working_set",ffa="dotnet.thread_pool.queue.length",pfa="dotnet.thread_pool.thread.count",hfa="dotnet.thread_pool.work_item.count",mfa="dotnet.timer.count",gfa="http.client.request.duration",Afa="http.server.request.duration",yfa="jvm.class.count",Efa="jvm.class.loaded",_fa="jvm.class.unloaded",vfa="jvm.cpu.count",Cfa="jvm.cpu.recent_utilization",bfa="jvm.cpu.time",Sfa="jvm.gc.duration",Tfa="jvm.memory.committed",Ifa="jvm.memory.limit",xfa="jvm.memory.used",wfa="jvm.memory.used_after_last_gc",Rfa="jvm.thread.count",Pfa="kestrel.active_connections",kfa="kestrel.active_tls_handshakes",Dfa="kestrel.connection.duration",Nfa="kestrel.queued_connections",Mfa="kestrel.queued_requests",Ofa="kestrel.rejected_connections",Bfa="kestrel.tls_handshake.duration",Lfa="kestrel.upgraded_connections",Ffa="signalr.server.active_connections",Ufa="signalr.server.connection.duration"});var Qfa,Ohi=_e(()=>{p();Qfa="exception"});var x0r={};xi(x0r,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>bla,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Sla,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Tla,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>Ila,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Pla,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>kla,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Dla,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Nla,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>Lla,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Fla,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Cla,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>xla,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>wla,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Rla,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Mla,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Ola,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Bla,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Ula,ATTR_CLIENT_ADDRESS:()=>Qla,ATTR_CLIENT_PORT:()=>qla,ATTR_CODE_COLUMN_NUMBER:()=>jla,ATTR_CODE_FILE_PATH:()=>Hla,ATTR_CODE_FUNCTION_NAME:()=>Gla,ATTR_CODE_LINE_NUMBER:()=>$la,ATTR_CODE_STACKTRACE:()=>Vla,ATTR_DB_COLLECTION_NAME:()=>Wla,ATTR_DB_NAMESPACE:()=>zla,ATTR_DB_OPERATION_BATCH_SIZE:()=>Yla,ATTR_DB_OPERATION_NAME:()=>Kla,ATTR_DB_QUERY_SUMMARY:()=>Jla,ATTR_DB_QUERY_TEXT:()=>Zla,ATTR_DB_RESPONSE_STATUS_CODE:()=>Xla,ATTR_DB_STORED_PROCEDURE_NAME:()=>eua,ATTR_DB_SYSTEM_NAME:()=>tua,ATTR_DOTNET_GC_HEAP_GENERATION:()=>sua,ATTR_ERROR_TYPE:()=>uua,ATTR_EXCEPTION_ESCAPED:()=>fua,ATTR_EXCEPTION_MESSAGE:()=>pua,ATTR_EXCEPTION_STACKTRACE:()=>hua,ATTR_EXCEPTION_TYPE:()=>mua,ATTR_HTTP_REQUEST_HEADER:()=>gua,ATTR_HTTP_REQUEST_METHOD:()=>Aua,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>wua,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Rua,ATTR_HTTP_RESPONSE_HEADER:()=>Pua,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>kua,ATTR_HTTP_ROUTE:()=>Dua,ATTR_JVM_GC_ACTION:()=>Nua,ATTR_JVM_GC_NAME:()=>Mua,ATTR_JVM_MEMORY_POOL_NAME:()=>Oua,ATTR_JVM_MEMORY_TYPE:()=>Bua,ATTR_JVM_THREAD_DAEMON:()=>Uua,ATTR_JVM_THREAD_STATE:()=>Qua,ATTR_NETWORK_LOCAL_ADDRESS:()=>Wua,ATTR_NETWORK_LOCAL_PORT:()=>zua,ATTR_NETWORK_PEER_ADDRESS:()=>Yua,ATTR_NETWORK_PEER_PORT:()=>Kua,ATTR_NETWORK_PROTOCOL_NAME:()=>Jua,ATTR_NETWORK_PROTOCOL_VERSION:()=>Zua,ATTR_NETWORK_TRANSPORT:()=>Xua,ATTR_NETWORK_TYPE:()=>oda,ATTR_OTEL_SCOPE_NAME:()=>cda,ATTR_OTEL_SCOPE_VERSION:()=>lda,ATTR_OTEL_STATUS_CODE:()=>uda,ATTR_OTEL_STATUS_DESCRIPTION:()=>pda,ATTR_SERVER_ADDRESS:()=>hda,ATTR_SERVER_PORT:()=>mda,ATTR_SERVICE_NAME:()=>gda,ATTR_SERVICE_VERSION:()=>Ada,ATTR_SIGNALR_CONNECTION_STATUS:()=>yda,ATTR_SIGNALR_TRANSPORT:()=>Cda,ATTR_TELEMETRY_SDK_LANGUAGE:()=>b0r,ATTR_TELEMETRY_SDK_NAME:()=>T0r,ATTR_TELEMETRY_SDK_VERSION:()=>I0r,ATTR_URL_FRAGMENT:()=>Lda,ATTR_URL_FULL:()=>Fda,ATTR_URL_PATH:()=>Uda,ATTR_URL_QUERY:()=>Qda,ATTR_URL_SCHEME:()=>qda,ATTR_USER_AGENT_ORIGINAL:()=>jda,AWSECSLAUNCHTYPEVALUES_EC2:()=>jca,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Hca,AwsEcsLaunchtypeValues:()=>Gca,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Sca,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Tca,CLOUDPLATFORMVALUES_AWS_EC2:()=>Ica,CLOUDPLATFORMVALUES_AWS_ECS:()=>xca,CLOUDPLATFORMVALUES_AWS_EKS:()=>wca,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Pca,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Rca,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Nca,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Oca,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Dca,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Mca,CLOUDPLATFORMVALUES_AZURE_VM:()=>kca,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Qca,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Uca,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Lca,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Bca,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Fca,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Eca,CLOUDPROVIDERVALUES_AWS:()=>_ca,CLOUDPROVIDERVALUES_AZURE:()=>vca,CLOUDPROVIDERVALUES_GCP:()=>Cca,CloudPlatformValues:()=>qca,CloudProviderValues:()=>bca,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>noa,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>doa,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>ioa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>uoa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>soa,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>poa,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>aoa,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>ooa,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>foa,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>loa,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>coa,DBSYSTEMVALUES_ADABAS:()=>Iia,DBSYSTEMVALUES_CACHE:()=>Tia,DBSYSTEMVALUES_CASSANDRA:()=>Hia,DBSYSTEMVALUES_CLOUDSCAPE:()=>Aia,DBSYSTEMVALUES_COCKROACHDB:()=>toa,DBSYSTEMVALUES_COLDFUSION:()=>jia,DBSYSTEMVALUES_COSMOSDB:()=>Yia,DBSYSTEMVALUES_COUCHBASE:()=>Wia,DBSYSTEMVALUES_COUCHDB:()=>zia,DBSYSTEMVALUES_DB2:()=>pia,DBSYSTEMVALUES_DERBY:()=>wia,DBSYSTEMVALUES_DYNAMODB:()=>Kia,DBSYSTEMVALUES_EDB:()=>Sia,DBSYSTEMVALUES_ELASTICSEARCH:()=>Xia,DBSYSTEMVALUES_FILEMAKER:()=>Ria,DBSYSTEMVALUES_FIREBIRD:()=>xia,DBSYSTEMVALUES_FIRSTSQL:()=>bia,DBSYSTEMVALUES_GEODE:()=>Zia,DBSYSTEMVALUES_H2:()=>qia,DBSYSTEMVALUES_HANADB:()=>via,DBSYSTEMVALUES_HBASE:()=>Gia,DBSYSTEMVALUES_HIVE:()=>gia,DBSYSTEMVALUES_HSQLDB:()=>yia,DBSYSTEMVALUES_INFORMIX:()=>Pia,DBSYSTEMVALUES_INGRES:()=>Cia,DBSYSTEMVALUES_INSTANTDB:()=>kia,DBSYSTEMVALUES_INTERBASE:()=>Dia,DBSYSTEMVALUES_MARIADB:()=>Nia,DBSYSTEMVALUES_MAXDB:()=>_ia,DBSYSTEMVALUES_MEMCACHED:()=>eoa,DBSYSTEMVALUES_MONGODB:()=>$ia,DBSYSTEMVALUES_MSSQL:()=>uia,DBSYSTEMVALUES_MYSQL:()=>dia,DBSYSTEMVALUES_NEO4J:()=>Jia,DBSYSTEMVALUES_NETEZZA:()=>Mia,DBSYSTEMVALUES_ORACLE:()=>fia,DBSYSTEMVALUES_OTHER_SQL:()=>lia,DBSYSTEMVALUES_PERVASIVE:()=>Oia,DBSYSTEMVALUES_POINTBASE:()=>Bia,DBSYSTEMVALUES_POSTGRESQL:()=>hia,DBSYSTEMVALUES_PROGRESS:()=>Eia,DBSYSTEMVALUES_REDIS:()=>Via,DBSYSTEMVALUES_REDSHIFT:()=>mia,DBSYSTEMVALUES_SQLITE:()=>Lia,DBSYSTEMVALUES_SYBASE:()=>Fia,DBSYSTEMVALUES_TERADATA:()=>Uia,DBSYSTEMVALUES_VERTICA:()=>Qia,DB_SYSTEM_NAME_VALUE_MARIADB:()=>rua,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>nua,DB_SYSTEM_NAME_VALUE_MYSQL:()=>iua,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>oua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>aua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>cua,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>lua,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>vKf,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>CKf,DbCassandraConsistencyLevelValues:()=>hoa,DbSystemValues:()=>roa,ERROR_TYPE_VALUE_OTHER:()=>dua,EVENT_EXCEPTION:()=>Qfa,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>boa,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Coa,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>voa,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Toa,FAASINVOKEDPROVIDERVALUES_AWS:()=>Ioa,FAASINVOKEDPROVIDERVALUES_AZURE:()=>xoa,FAASINVOKEDPROVIDERVALUES_GCP:()=>woa,FAASTRIGGERVALUES_DATASOURCE:()=>moa,FAASTRIGGERVALUES_HTTP:()=>goa,FAASTRIGGERVALUES_OTHER:()=>Eoa,FAASTRIGGERVALUES_PUBSUB:()=>Aoa,FAASTRIGGERVALUES_TIMER:()=>yoa,FaasDocumentOperationValues:()=>Soa,FaasInvokedProviderValues:()=>Roa,FaasTriggerValues:()=>_oa,HOSTARCHVALUES_AMD64:()=>$ca,HOSTARCHVALUES_ARM32:()=>Vca,HOSTARCHVALUES_ARM64:()=>Wca,HOSTARCHVALUES_IA64:()=>zca,HOSTARCHVALUES_PPC32:()=>Yca,HOSTARCHVALUES_PPC64:()=>Kca,HOSTARCHVALUES_X86:()=>Jca,HTTPFLAVORVALUES_HTTP_1_0:()=>fsa,HTTPFLAVORVALUES_HTTP_1_1:()=>psa,HTTPFLAVORVALUES_HTTP_2_0:()=>hsa,HTTPFLAVORVALUES_QUIC:()=>gsa,HTTPFLAVORVALUES_SPDY:()=>msa,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Eua,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>_ua,HTTP_REQUEST_METHOD_VALUE_GET:()=>vua,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Cua,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>bua,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>yua,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Sua,HTTP_REQUEST_METHOD_VALUE_POST:()=>Tua,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Iua,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>xua,HostArchValues:()=>Zca,HttpFlavorValues:()=>Asa,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Lua,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Fua,JVM_THREAD_STATE_VALUE_BLOCKED:()=>qua,JVM_THREAD_STATE_VALUE_NEW:()=>jua,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Hua,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Gua,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>$ua,JVM_THREAD_STATE_VALUE_WAITING:()=>Vua,MESSAGETYPEVALUES_RECEIVED:()=>Hsa,MESSAGETYPEVALUES_SENT:()=>jsa,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>ysa,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Esa,MESSAGINGOPERATIONVALUES_PROCESS:()=>Csa,MESSAGINGOPERATIONVALUES_RECEIVE:()=>vsa,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Hda,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Gda,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>$da,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>zda,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Wda,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Vda,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Yda,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Kda,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Jda,METRIC_DOTNET_EXCEPTIONS:()=>Zda,METRIC_DOTNET_GC_COLLECTIONS:()=>Xda,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>efa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>tfa,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>rfa,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>nfa,METRIC_DOTNET_GC_PAUSE_TIME:()=>ifa,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>ofa,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>sfa,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>afa,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>cfa,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>lfa,METRIC_DOTNET_PROCESS_CPU_TIME:()=>ufa,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>dfa,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>ffa,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>pfa,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>hfa,METRIC_DOTNET_TIMER_COUNT:()=>mfa,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>gfa,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Afa,METRIC_JVM_CLASS_COUNT:()=>yfa,METRIC_JVM_CLASS_LOADED:()=>Efa,METRIC_JVM_CLASS_UNLOADED:()=>_fa,METRIC_JVM_CPU_COUNT:()=>vfa,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Cfa,METRIC_JVM_CPU_TIME:()=>bfa,METRIC_JVM_GC_DURATION:()=>Sfa,METRIC_JVM_MEMORY_COMMITTED:()=>Tfa,METRIC_JVM_MEMORY_LIMIT:()=>Ifa,METRIC_JVM_MEMORY_USED:()=>xfa,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>wfa,METRIC_JVM_THREAD_COUNT:()=>Rfa,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Pfa,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>kfa,METRIC_KESTREL_CONNECTION_DURATION:()=>Dfa,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Nfa,METRIC_KESTREL_QUEUED_REQUESTS:()=>Mfa,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Ofa,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Bfa,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>Lfa,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>Ffa,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>Ufa,MessageTypeValues:()=>Gsa,MessagingDestinationKindValues:()=>_sa,MessagingOperationValues:()=>bsa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>Woa,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Koa,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>$oa,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>nsa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>zoa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Yoa,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>tsa,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Goa,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>osa,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Joa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>Xoa,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>isa,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>Zoa,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>esa,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>asa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>rsa,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>usa,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>csa,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>lsa,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>ssa,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Voa,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Qoa,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>qoa,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>joa,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Foa,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Uoa,NETTRANSPORTVALUES_INPROC:()=>Ooa,NETTRANSPORTVALUES_IP:()=>Doa,NETTRANSPORTVALUES_IP_TCP:()=>Poa,NETTRANSPORTVALUES_IP_UDP:()=>koa,NETTRANSPORTVALUES_OTHER:()=>Boa,NETTRANSPORTVALUES_PIPE:()=>Moa,NETTRANSPORTVALUES_UNIX:()=>Noa,NETWORK_TRANSPORT_VALUE_PIPE:()=>eda,NETWORK_TRANSPORT_VALUE_QUIC:()=>tda,NETWORK_TRANSPORT_VALUE_TCP:()=>rda,NETWORK_TRANSPORT_VALUE_UDP:()=>nda,NETWORK_TRANSPORT_VALUE_UNIX:()=>ida,NETWORK_TYPE_VALUE_IPV4:()=>sda,NETWORK_TYPE_VALUE_IPV6:()=>ada,NetHostConnectionSubtypeValues:()=>dsa,NetHostConnectionTypeValues:()=>Hoa,NetTransportValues:()=>Loa,OSTYPEVALUES_AIX:()=>ala,OSTYPEVALUES_DARWIN:()=>tla,OSTYPEVALUES_DRAGONFLYBSD:()=>ola,OSTYPEVALUES_FREEBSD:()=>rla,OSTYPEVALUES_HPUX:()=>sla,OSTYPEVALUES_LINUX:()=>ela,OSTYPEVALUES_NETBSD:()=>nla,OSTYPEVALUES_OPENBSD:()=>ila,OSTYPEVALUES_SOLARIS:()=>cla,OSTYPEVALUES_WINDOWS:()=>Xca,OSTYPEVALUES_Z_OS:()=>lla,OTEL_STATUS_CODE_VALUE_ERROR:()=>dda,OTEL_STATUS_CODE_VALUE_OK:()=>fda,OsTypeValues:()=>ula,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Msa,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Psa,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Tsa,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Usa,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>wsa,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Nsa,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Lsa,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>xsa,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Rsa,RPCGRPCSTATUSCODEVALUES_OK:()=>Ssa,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Osa,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>ksa,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Dsa,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Qsa,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Fsa,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Bsa,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Isa,RpcGrpcStatusCodeValues:()=>qsa,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>Ana,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Rna,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>hna,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>una,SEMATTRS_AWS_DYNAMODB_COUNT:()=>xna,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Cna,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>_na,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Pna,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>yna,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>dna,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>gna,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>vna,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>mna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>fna,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>pna,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>wna,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Sna,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Tna,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Ena,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>bna,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>lna,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Ina,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>jta,SEMATTRS_CODE_FILEPATH:()=>Vra,SEMATTRS_CODE_FUNCTION:()=>Gra,SEMATTRS_CODE_LINENO:()=>Wra,SEMATTRS_CODE_NAMESPACE:()=>$ra,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>Xta,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>ira,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>nra,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>tra,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Jta,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>Zta,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>rra,SEMATTRS_DB_CASSANDRA_TABLE:()=>era,SEMATTRS_DB_CONNECTION_STRING:()=>Gta,SEMATTRS_DB_HBASE_NAMESPACE:()=>ora,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Vta,SEMATTRS_DB_MONGODB_COLLECTION:()=>ara,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Kta,SEMATTRS_DB_NAME:()=>Wta,SEMATTRS_DB_OPERATION:()=>Yta,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>sra,SEMATTRS_DB_SQL_TABLE:()=>cra,SEMATTRS_DB_STATEMENT:()=>zta,SEMATTRS_DB_SYSTEM:()=>Hta,SEMATTRS_DB_USER:()=>$ta,SEMATTRS_ENDUSER_ID:()=>Ura,SEMATTRS_ENDUSER_ROLE:()=>Qra,SEMATTRS_ENDUSER_SCOPE:()=>qra,SEMATTRS_EXCEPTION_ESCAPED:()=>fra,SEMATTRS_EXCEPTION_MESSAGE:()=>ura,SEMATTRS_EXCEPTION_STACKTRACE:()=>dra,SEMATTRS_EXCEPTION_TYPE:()=>lra,SEMATTRS_FAAS_COLDSTART:()=>vra,SEMATTRS_FAAS_CRON:()=>_ra,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>mra,SEMATTRS_FAAS_DOCUMENT_NAME:()=>yra,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>gra,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Ara,SEMATTRS_FAAS_EXECUTION:()=>hra,SEMATTRS_FAAS_INVOKED_NAME:()=>Cra,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>bra,SEMATTRS_FAAS_INVOKED_REGION:()=>Sra,SEMATTRS_FAAS_TIME:()=>Era,SEMATTRS_FAAS_TRIGGER:()=>pra,SEMATTRS_HTTP_CLIENT_IP:()=>cna,SEMATTRS_HTTP_FLAVOR:()=>ena,SEMATTRS_HTTP_HOST:()=>Jra,SEMATTRS_HTTP_METHOD:()=>zra,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>rna,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>nna,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>ina,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>ona,SEMATTRS_HTTP_ROUTE:()=>ana,SEMATTRS_HTTP_SCHEME:()=>Zra,SEMATTRS_HTTP_SERVER_NAME:()=>sna,SEMATTRS_HTTP_STATUS_CODE:()=>Xra,SEMATTRS_HTTP_TARGET:()=>Kra,SEMATTRS_HTTP_URL:()=>Yra,SEMATTRS_HTTP_USER_AGENT:()=>tna,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>sia,SEMATTRS_MESSAGE_ID:()=>oia,SEMATTRS_MESSAGE_TYPE:()=>iia,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>aia,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Hna,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Una,SEMATTRS_MESSAGING_DESTINATION:()=>Dna,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Nna,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>Wna,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Vna,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>$na,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>zna,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Yna,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Fna,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>qna,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Qna,SEMATTRS_MESSAGING_OPERATION:()=>jna,SEMATTRS_MESSAGING_PROTOCOL:()=>Ona,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Bna,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Gna,SEMATTRS_MESSAGING_SYSTEM:()=>kna,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Mna,SEMATTRS_MESSAGING_URL:()=>Lna,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Lra,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Ora,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Bra,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Mra,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Nra,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Dra,SEMATTRS_NET_HOST_IP:()=>Rra,SEMATTRS_NET_HOST_NAME:()=>kra,SEMATTRS_NET_HOST_PORT:()=>Pra,SEMATTRS_NET_PEER_IP:()=>Ira,SEMATTRS_NET_PEER_NAME:()=>wra,SEMATTRS_NET_PEER_PORT:()=>xra,SEMATTRS_NET_TRANSPORT:()=>Tra,SEMATTRS_PEER_SERVICE:()=>Fra,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>Xna,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>ria,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>nia,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>tia,SEMATTRS_RPC_JSONRPC_VERSION:()=>eia,SEMATTRS_RPC_METHOD:()=>Zna,SEMATTRS_RPC_SERVICE:()=>Jna,SEMATTRS_RPC_SYSTEM:()=>Kna,SEMATTRS_THREAD_ID:()=>jra,SEMATTRS_THREAD_NAME:()=>Hra,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Jsa,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Ksa,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>Zsa,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>Xsa,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>eaa,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>taa,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>raa,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>iaa,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>naa,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>saa,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>oaa,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Vsa,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>zsa,SEMRESATTRS_CLOUD_PLATFORM:()=>Ysa,SEMRESATTRS_CLOUD_PROVIDER:()=>$sa,SEMRESATTRS_CLOUD_REGION:()=>Wsa,SEMRESATTRS_CONTAINER_ID:()=>caa,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>uaa,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>daa,SEMRESATTRS_CONTAINER_NAME:()=>aaa,SEMRESATTRS_CONTAINER_RUNTIME:()=>laa,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>faa,SEMRESATTRS_DEVICE_ID:()=>paa,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>haa,SEMRESATTRS_DEVICE_MODEL_NAME:()=>maa,SEMRESATTRS_FAAS_ID:()=>Aaa,SEMRESATTRS_FAAS_INSTANCE:()=>Eaa,SEMRESATTRS_FAAS_MAX_MEMORY:()=>_aa,SEMRESATTRS_FAAS_NAME:()=>gaa,SEMRESATTRS_FAAS_VERSION:()=>yaa,SEMRESATTRS_HOST_ARCH:()=>Saa,SEMRESATTRS_HOST_ID:()=>vaa,SEMRESATTRS_HOST_IMAGE_ID:()=>Iaa,SEMRESATTRS_HOST_IMAGE_NAME:()=>Taa,SEMRESATTRS_HOST_IMAGE_VERSION:()=>xaa,SEMRESATTRS_HOST_NAME:()=>Caa,SEMRESATTRS_HOST_TYPE:()=>baa,SEMRESATTRS_K8S_CLUSTER_NAME:()=>waa,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Maa,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Vaa,SEMRESATTRS_K8S_CRONJOB_UID:()=>$aa,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>jaa,SEMRESATTRS_K8S_DAEMONSET_UID:()=>qaa,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Faa,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Laa,SEMRESATTRS_K8S_JOB_NAME:()=>Gaa,SEMRESATTRS_K8S_JOB_UID:()=>Haa,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>kaa,SEMRESATTRS_K8S_NODE_NAME:()=>Raa,SEMRESATTRS_K8S_NODE_UID:()=>Paa,SEMRESATTRS_K8S_POD_NAME:()=>Naa,SEMRESATTRS_K8S_POD_UID:()=>Daa,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Baa,SEMRESATTRS_K8S_REPLICASET_UID:()=>Oaa,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Qaa,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Uaa,SEMRESATTRS_OS_DESCRIPTION:()=>zaa,SEMRESATTRS_OS_NAME:()=>Yaa,SEMRESATTRS_OS_TYPE:()=>Waa,SEMRESATTRS_OS_VERSION:()=>Kaa,SEMRESATTRS_PROCESS_COMMAND:()=>eca,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>rca,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>tca,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Zaa,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Xaa,SEMRESATTRS_PROCESS_OWNER:()=>nca,SEMRESATTRS_PROCESS_PID:()=>Jaa,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>sca,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>ica,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>oca,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>lca,SEMRESATTRS_SERVICE_NAME:()=>aca,SEMRESATTRS_SERVICE_NAMESPACE:()=>cca,SEMRESATTRS_SERVICE_VERSION:()=>uca,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>hca,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>fca,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>dca,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>pca,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Aca,SEMRESATTRS_WEBENGINE_NAME:()=>mca,SEMRESATTRS_WEBENGINE_VERSION:()=>gca,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Eda,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>_da,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>vda,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>bda,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Sda,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Tda,SemanticAttributes:()=>cia,SemanticResourceAttributes:()=>yca,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>dla,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>fla,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>pla,TELEMETRYSDKLANGUAGEVALUES_GO:()=>hla,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>mla,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>gla,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Ala,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>yla,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Ela,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>_la,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Ida,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>xda,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>wda,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Rda,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Pda,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>S0r,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>kda,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Dda,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Nda,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Mda,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Oda,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Bda,TelemetrySdkLanguageValues:()=>vla});var yft=_e(()=>{p();sfi();Dhi();Nhi();Mhi();Ohi()});var Bhi,Lhi=_e(()=>{p();Bhi="process.runtime.name"});var Eft,Fhi=_e(()=>{p();mai();yft();Lhi();Eft={[T0r]:"opentelemetry",[Bhi]:"node",[b0r]:S0r,[I0r]:hai}});var Uhi=_e(()=>{p();uai();dai();pai();Fhi()});var w0r=_e(()=>{p();Uhi()});function Qhe(t){let e=t/1e3,r=Math.trunc(e),n=Math.round(t%1e3*jfa);return[r,n]}function vft(){let t=EH.timeOrigin;if(typeof t!="number"){let e=EH;t=e.timing&&e.timing.fetchStart}return t}function R0r(t){let e=Qhe(vft()),r=Qhe(typeof t=="number"?t:EH.now());return P0r(e,r)}function qhi(t){if(Cft(t))return t;if(typeof t=="number")return t=_ft&&(r[1]-=_ft,r[0]+=1),r}var Qhi,qfa,jfa,_ft,zhi=_e(()=>{p();w0r();Qhi=9,qfa=6,jfa=Math.pow(10,qfa),_ft=Math.pow(10,Qhi);a(Qhe,"millisToHrTime");a(vft,"getTimeOrigin");a(R0r,"hrTime");a(qhi,"timeInputToHrTime");a(jhi,"hrTimeDuration");a(Hhi,"hrTimeToTimeStamp");a(Ghi,"hrTimeToNanoseconds");a($hi,"hrTimeToMilliseconds");a(Vhi,"hrTimeToMicroseconds");a(Cft,"isTimeInputHrTime");a(Whi,"isTimeInput");a(P0r,"addHrTimes")});function Yhi(t){typeof t!="number"&&t.unref()}var Khi=_e(()=>{p();a(Yhi,"unrefTimer")});var bft,Jhi=_e(()=>{p();(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(bft||(bft={}))});var Sft,Zhi=_e(()=>{p();co();Sft=class{static{a(this,"CompositePropagator")}_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(e,r,n){for(let o of this._propagators)try{o.inject(e,r,n)}catch(s){Pn.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,r,n){return this._propagators.reduce((o,s)=>{try{return s.extract(o,r,n)}catch(c){Pn.warn(`Failed to extract with ${s.constructor.name}. Err: ${c.message}`)}return o},e)}fields(){return this._fields.slice()}}});function Xhi(t){return $fa.test(t)}function e0i(t){return Vfa.test(t)&&!Wfa.test(t)}var k0r,Hfa,Gfa,$fa,Vfa,Wfa,t0i=_e(()=>{p();k0r="[_0-9a-z-*/]",Hfa=`[a-z]${k0r}{0,255}`,Gfa=`[a-z0-9]${k0r}{0,240}@[a-z]${k0r}{0,13}`,$fa=new RegExp(`^(?:${Hfa}|${Gfa})$`),Vfa=/^[ -~]{0,255}[!-~]$/,Wfa=/,|=/;a(Xhi,"validateKey");a(e0i,"validateValue")});var r0i,zfa,n0i,i0i,qhe,D0r=_e(()=>{p();t0i();r0i=32,zfa=512,n0i=",",i0i="=",qhe=class t{static{a(this,"TraceState")}_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,r){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,r),n}unset(e){let r=this._clone();return r._internalState.delete(e),r}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,r)=>(e.push(r+i0i+this.get(r)),e),[]).join(n0i)}_parse(e){e.length>zfa||(this._internalState=e.split(n0i).reverse().reduce((r,n)=>{let o=n.trim(),s=o.indexOf(i0i);if(s!==-1){let c=o.slice(0,s),l=o.slice(s+1,n.length);Xhi(c)&&e0i(l)&&r.set(c,l)}return r},new Map),this._internalState.size>r0i&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r0i))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function N0r(t){let e=epa.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}var dNe,fNe,Yfa,Kfa,Jfa,Zfa,Xfa,epa,Tft,o0i=_e(()=>{p();co();lNe();D0r();dNe="traceparent",fNe="tracestate",Yfa="00",Kfa="(?!ff)[\\da-f]{2}",Jfa="(?![0]{32})[\\da-f]{32}",Zfa="(?![0]{16})[\\da-f]{16}",Xfa="[\\da-f]{2}",epa=new RegExp(`^\\s?(${Kfa})-(${Jfa})-(${Zfa})-(${Xfa})(-.*)?\\s?$`);a(N0r,"parseTraceParent");Tft=class{static{a(this,"W3CTraceContextPropagator")}inject(e,r,n){let o=_u.getSpanContext(e);if(!o||Uhe(e)||!nb(o))return;let s=`${Yfa}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||Af.NONE).toString(16)}`;n.set(r,dNe,s),o.traceState&&n.set(r,fNe,o.traceState.serialize())}extract(e,r,n){let o=n.get(r,dNe);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let c=N0r(s);if(!c)return e;c.isRemote=!0;let l=n.get(r,fNe);if(l){let u=Array.isArray(l)?l.join(","):l;c.traceState=new qhe(typeof u=="string"?u:void 0)}return _u.setSpanContext(e,c)}fields(){return[dNe,fNe]}}});function s0i(t,e){return t.setValue(M0r,e)}function a0i(t){return t.deleteValue(M0r)}function c0i(t){return t.getValue(M0r)}var M0r,Ift,l0i=_e(()=>{p();co();M0r=rb("OpenTelemetry SDK Context Key RPC_METADATA");(function(t){t.HTTP="http"})(Ift||(Ift={}));a(s0i,"setRPCMetadata");a(a0i,"deleteRPCMetadata");a(c0i,"getRPCMetadata")});function O0r(t){if(!apa(t)||cpa(t)!==tpa)return!1;let e=spa(t);if(e===null)return!0;let r=f0i.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&u0i.call(r)===opa}function apa(t){return t!=null&&typeof t=="object"}function cpa(t){return t==null?t===void 0?npa:rpa:xX&&xX in Object(t)?lpa(t):upa(t)}function lpa(t){let e=f0i.call(t,xX),r=t[xX],n=!1;try{t[xX]=void 0,n=!0}catch{}let o=p0i.call(t);return n&&(e?t[xX]=r:delete t[xX]),o}function upa(t){return p0i.call(t)}var tpa,rpa,npa,ipa,u0i,opa,spa,d0i,f0i,xX,p0i,h0i=_e(()=>{p();tpa="[object Object]",rpa="[object Null]",npa="[object Undefined]",ipa=Function.prototype,u0i=ipa.toString,opa=u0i.call(Object),spa=Object.getPrototypeOf,d0i=Object.prototype,f0i=d0i.hasOwnProperty,xX=Symbol?Symbol.toStringTag:void 0,p0i=d0i.toString;a(O0r,"isPlainObject");a(apa,"isObjectLike");a(cpa,"baseGetTag");a(lpa,"getRawTag");a(upa,"objectToString")});function g0i(...t){let e=t.shift(),r=new WeakMap;for(;t.length>0;)e=A0i(e,t.shift(),0,r);return e}function B0r(t){return wft(t)?t.slice():t}function A0i(t,e,r=0,n){let o;if(!(r>dpa)){if(r++,xft(t)||xft(e)||y0i(e))o=B0r(e);else if(wft(t)){if(o=t.slice(),wft(e))for(let s=0,c=e.length;s"u"?delete o[u]:o[u]=d;else{let f=o[u],h=d;if(m0i(t,u,n)||m0i(e,u,n))delete o[u];else{if(pNe(f)&&pNe(h)){let m=n.get(f)||[],g=n.get(h)||[];m.push({obj:t,key:u}),g.push({obj:e,key:u}),n.set(f,m),n.set(h,g)}o[u]=A0i(o[u],d,r,n)}}}}else o=e;return o}}function m0i(t,e,r){let n=r.get(t[e])||[];for(let o=0,s=n.length;o"u"||t instanceof Date||t instanceof RegExp||t===null}function fpa(t,e){return!(!O0r(t)||!O0r(e))}var dpa,E0i=_e(()=>{p();h0i();dpa=20;a(g0i,"merge");a(B0r,"takeValue");a(A0i,"mergeTwoObjects");a(m0i,"wasObjectReferenced");a(wft,"isArray");a(y0i,"isFunction");a(pNe,"isObject");a(xft,"isPrimitive");a(fpa,"shouldMerge")});function _0i(t,e){let r,n=new Promise(a(function(s,c){r=setTimeout(a(function(){c(new hNe("Operation timed out."))},"timeoutHandler"),e)},"timeoutFunction"));return Promise.race([t,n]).then(o=>(clearTimeout(r),o),o=>{throw clearTimeout(r),o})}var hNe,v0i=_e(()=>{p();hNe=class t extends Error{static{a(this,"TimeoutError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};a(_0i,"callWithTimeout")});function L0r(t,e){return typeof e=="string"?t===e:!!t.match(e)}function C0i(t,e){if(!e)return!1;for(let r of e)if(L0r(t,r))return!0;return!1}var b0i=_e(()=>{p();a(L0r,"urlMatches");a(C0i,"isUrlIgnored")});var Rft,S0i=_e(()=>{p();Rft=class{static{a(this,"Deferred")}_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,r)=>{this._resolve=e,this._reject=r})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}});var Pft,T0i=_e(()=>{p();S0i();Pft=class{static{a(this,"BindOnceFuture")}_callback;_that;_isCalled=!1;_deferred=new Rft;constructor(e,r){this._callback=e,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}});function x0i(t){if(t==null)return;let e=I0i[t.toUpperCase()];return e??(Pn.warn(`Unknown log level "${t}", expected one of ${Object.keys(I0i)}, using default`),wa.INFO)}var I0i,w0i=_e(()=>{p();co();I0i={ALL:wa.ALL,VERBOSE:wa.VERBOSE,DEBUG:wa.DEBUG,INFO:wa.INFO,WARN:wa.WARN,ERROR:wa.ERROR,NONE:wa.NONE};a(x0i,"diagLogLevelFromString")});function R0i(t,e){return new Promise(r=>{Eg.with(cft(Eg.active()),()=>{t.export(e,n=>{r(n)})})})}var P0i=_e(()=>{p();co();lNe();a(R0i,"_export")});var kft={};xi(kft,{AnchoredClock:()=>fft,BindOnceFuture:()=>Pft,CompositePropagator:()=>Sft,ExportResultCode:()=>bft,RPCType:()=>Ift,SDK_INFO:()=>Eft,TRACE_PARENT_HEADER:()=>dNe,TRACE_STATE_HEADER:()=>fNe,TimeoutError:()=>hNe,TraceState:()=>qhe,W3CBaggagePropagator:()=>dft,W3CTraceContextPropagator:()=>Tft,_globalThis:()=>Aft,addHrTimes:()=>P0r,callWithTimeout:()=>_0i,deleteRPCMetadata:()=>a0i,diagLogLevelFromString:()=>x0i,getBooleanFromEnv:()=>mft,getNumberFromEnv:()=>hft,getRPCMetadata:()=>c0i,getStringFromEnv:()=>uNe,getStringListFromEnv:()=>gft,getTimeOrigin:()=>vft,globalErrorHandler:()=>cai,hrTime:()=>R0r,hrTimeDuration:()=>jhi,hrTimeToMicroseconds:()=>Vhi,hrTimeToMilliseconds:()=>$hi,hrTimeToNanoseconds:()=>Ghi,hrTimeToTimeStamp:()=>Hhi,internal:()=>ppa,isAttributeValue:()=>E0r,isTimeInput:()=>Whi,isTimeInputHrTime:()=>Cft,isTracingSuppressed:()=>Uhe,isUrlIgnored:()=>C0i,loggingErrorHandler:()=>pft,merge:()=>g0i,millisToHrTime:()=>Qhe,otperformance:()=>EH,parseKeyPairsIntoRecord:()=>eai,parseTraceParent:()=>N0r,sanitizeAttributes:()=>nai,setGlobalErrorHandler:()=>aai,setRPCMetadata:()=>s0i,suppressTracing:()=>cft,timeInputToHrTime:()=>qhi,unrefTimer:()=>Yhi,unsuppressTracing:()=>Ysi,urlMatches:()=>L0r});var ppa,Dft=_e(()=>{p();tai();rai();oai();lai();_0r();zhi();Khi();Jhi();y0r();w0r();Zhi();o0i();l0i();lNe();D0r();E0i();v0i();b0i();T0i();w0i();P0i();ppa={_export:R0i}});var N0i=I(Nft=>{"use strict";p();Object.defineProperty(Nft,"__esModule",{value:!0});Nft.OpenTelemetrySpanWrapper=void 0;var k0i=(co(),ya(u5)),D0i=(Dft(),ya(kft)),hpa=m0r(),F0r=class{static{a(this,"OpenTelemetrySpanWrapper")}constructor(e){this._span=e}setStatus(e){e.status==="error"&&mpa(e.error)?e.error?(this._span.setStatus({code:k0i.SpanStatusCode.ERROR,message:e.error.toString()}),this.recordException(e.error)):this._span.setStatus({code:k0i.SpanStatusCode.ERROR}):e.status==="success"&&hpa.logger.verbose("Leaving span with status UNSET per OpenTelemetry spec.")}setAttribute(e,r){r!=null&&(0,D0i.isAttributeValue)(r)&&this._span.setAttribute(e,r)}end(){this._span.end()}recordException(e){this._span.recordException(e)}isRecording(){return this._span.isRecording()}addEvent(e,r={}){this._span.addEvent(e,(0,D0i.sanitizeAttributes)(r.attributes),r.startTime)}unwrap(){return this._span}};Nft.OpenTelemetrySpanWrapper=F0r;function mpa(t){return t!==null&&typeof t=="object"&&"statusCode"in t?t.statusCode!==304:!0}a(mpa,"isRecordableError")});var U0r=I(q5=>{"use strict";p();Object.defineProperty(q5,"__esModule",{value:!0});q5.environmentCache=q5.SDK_VERSION=void 0;q5.envVarToBoolean=gpa;q5.SDK_VERSION="1.0.0-beta.9";q5.environmentCache=new Map;function gpa(t){var e;q5.environmentCache.has(t)||Apa(t);let r=((e=q5.environmentCache.get(t))!==null&&e!==void 0?e:"").toLowerCase();return r!=="false"&&r!=="0"&&!!r}a(gpa,"envVarToBoolean");function Apa(t){var e;if(typeof process<"u"&&process.env){let r=(e=process.env[t])!==null&&e!==void 0?e:process.env[t.toLowerCase()];q5.environmentCache.set(t,r)}}a(Apa,"loadEnvironmentVariable")});var L0i=I(Mft=>{"use strict";p();Object.defineProperty(Mft,"__esModule",{value:!0});Mft.toOpenTelemetrySpanKind=B0i;Mft.toSpanOptions=Epa;var M0i=(co(),ya(u5)),O0i=(Dft(),ya(kft));function B0i(t){let e=(t||"internal").toUpperCase();return M0i.SpanKind[e]}a(B0i,"toOpenTelemetrySpanKind");function ypa(t=[]){return t.reduce((e,r)=>{let n=M0i.trace.getSpanContext(r.tracingContext);return n&&e.push({context:n,attributes:(0,O0i.sanitizeAttributes)(r.attributes)}),e},[])}a(ypa,"toOpenTelemetryLinks");function Epa(t){let{spanAttributes:e,spanLinks:r,spanKind:n}=t||{},o=(0,O0i.sanitizeAttributes)(e),s=B0i(n),c=ypa(r);return{attributes:o,kind:s,links:c}}a(Epa,"toSpanOptions")});var Q0i=I(_H=>{"use strict";p();Object.defineProperty(_H,"__esModule",{value:!0});_H.OpenTelemetryInstrumenter=_H.propagator=void 0;var j5=(co(),ya(u5)),U0i=(Dft(),ya(kft)),_pa=N0i(),F0i=U0r(),vpa=L0i();_H.propagator=new U0i.W3CTraceContextPropagator;var Q0r=class{static{a(this,"OpenTelemetryInstrumenter")}startSpan(e,r){let n=r?.tracingContext||j5.context.active(),o;return(0,F0i.envVarToBoolean)("AZURE_TRACING_DISABLED")?o=j5.trace.wrapSpanContext(j5.INVALID_SPAN_CONTEXT):(o=j5.trace.getTracer(r.packageName,r.packageVersion).startSpan(e,(0,vpa.toSpanOptions)(r),n),(0,F0i.envVarToBoolean)("AZURE_HTTP_TRACING_CHILDREN_DISABLED")&&e.toUpperCase().startsWith("HTTP")&&(n=(0,U0i.suppressTracing)(n))),{span:new _pa.OpenTelemetrySpanWrapper(o),tracingContext:j5.trace.setSpan(n,o)}}withContext(e,r,...n){return j5.context.with(e,r,void 0,...n)}parseTraceparentHeader(e){return _H.propagator.extract(j5.context.active(),{traceparent:e},j5.defaultTextMapGetter)}createRequestHeaders(e){let r={};return _H.propagator.inject(e||j5.context.active(),r,j5.defaultTextMapSetter),r}};_H.OpenTelemetryInstrumenter=Q0r});var j0i=I(mNe=>{"use strict";p();Object.defineProperty(mNe,"__esModule",{value:!0});mNe.AzureSdkInstrumentation=void 0;mNe.createAzureSdkInstrumentation=Spa;var q0i=(a0r(),ya(s0r)),Cpa=Q0i(),bpa=U0r(),Oft=class extends q0i.InstrumentationBase{static{a(this,"AzureSdkInstrumentation")}constructor(e={}){super("@azure/opentelemetry-instrumentation-azure-sdk",bpa.SDK_VERSION,Object.assign({},e))}init(){let e=new q0i.InstrumentationNodeModuleDefinition("@azure/core-tracing",["^1.0.0-preview.14","^1.0.0"],r=>(typeof r.useInstrumenter=="function"&&r.useInstrumenter(new Cpa.OpenTelemetryInstrumenter),r));return e.includePrerelease=!0,e}};mNe.AzureSdkInstrumentation=Oft;function Spa(t={}){return new Oft(t)}a(Spa,"createAzureSdkInstrumentation")});var G0i=I(Bft=>{"use strict";p();Object.defineProperty(Bft,"__esModule",{value:!0});var H0i=(wL(),ya(h7));H0i.__exportStar(m0r(),Bft);H0i.__exportStar(j0i(),Bft)});var V0i=I(Gw=>{"use strict";p();Object.defineProperty(Gw,"__esModule",{value:!0});Gw.enable=Gw.azureCoreTracing=Gw.AzureMonitorSymbol=void 0;var q0r=mp();Gw.AzureMonitorSymbol="Azure_Monitor_Tracer";var j0r="azure-coretracing",$0i=!1,Tpa=a(function(t){if($0i)return t;try{var e=(Vii(),ya($ii)),r=(co(),ya(u5)),n=new e.BasicTracerProvider,o=n.getTracer("applicationinsights tracer");if(t.setTracer){var s=t.setTracer;t.setTracer=function(d){var f=d.startSpan;d.startSpan=function(h,m,g){var A=f.call(this,h,m,g),y=A.end;return A.end=function(){var E=y.apply(this,arguments);return q0r.channel.publish(j0r,A),E},A},d[Gw.AzureMonitorSymbol]=!0,s.call(this,d)},r.trace.getSpan(r.context.active()),t.setTracer(o)}else{var c=r.trace.setGlobalTracerProvider;r.trace.setGlobalTracerProvider=function(d){var f=d.getTracer;return d.getTracer=function(h,m){var g=f.call(this,h,m);if(!g[Gw.AzureMonitorSymbol]){var A=g.startSpan;g.startSpan=function(y,E,_){var v=A.call(this,y,E,_),b=v.end;return v.end=function(){var T=b.apply(this,arguments);return q0r.channel.publish(j0r,v),T},v},g[Gw.AzureMonitorSymbol]=!0}return g},c.call(this,d)},n.register(),r.trace.getSpan(r.context.active());var l=(a0r(),ya(s0r)),u=G0i();l.registerInstrumentations({instrumentations:[u.createAzureSdkInstrumentation()]})}$0i=!0}catch{}return t},"azureCoreTracingPatchFunction");Gw.azureCoreTracing={versionSpecifier:">= 1.0.0 < 2.0.0",patch:Tpa,publisherName:j0r};function Ipa(){q0r.channel.registerMonkeyPatch("@azure/core-tracing",Gw.azureCoreTracing)}a(Ipa,"enable");Gw.enable=Ipa});var z0i=I(wX=>{"use strict";p();Object.defineProperty(wX,"__esModule",{value:!0});wX.enable=wX.bunyan=void 0;var W0i=mp(),xpa=a(function(t){var e=t.prototype._emit;return t.prototype._emit=function(r,n){var o=e.apply(this,arguments);if(!n){var s=o;s||(s=e.call(this,r,!0)),W0i.channel.publish("bunyan",{level:r.level,result:s})}return o},t},"bunyanPatchFunction");wX.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:xpa};function wpa(){W0i.channel.registerMonkeyPatch("bunyan",wX.bunyan)}a(wpa,"enable");wX.enable=wpa});var K0i=I(RX=>{"use strict";p();Object.defineProperty(RX,"__esModule",{value:!0});RX.enable=RX.console=void 0;var H0r=mp(),Y0i=require("stream"),Rpa=a(function(t){var e=new Y0i.Writable,r=new Y0i.Writable;e.write=function(d){if(!d)return!0;var f=d.toString();return H0r.channel.publish("console",{message:f}),!0},r.write=function(d){if(!d)return!0;var f=d.toString();return H0r.channel.publish("console",{message:f,stderr:!0}),!0};for(var n=new t.Console(e,r),o=["log","info","warn","error","dir","time","timeEnd","trace","assert"],s=a(function(d){var f=t[d];f&&(t[d]=function(){if(n[d])try{n[d].apply(n,arguments)}catch{}return f.apply(t,arguments)})},"_loop_1"),c=0,l=o;c= 4.0.0",patch:Rpa};function Ppa(){H0r.channel.registerMonkeyPatch("console",RX.console),require("console")}a(Ppa,"enable");RX.enable=Ppa});var J0i=I(PX=>{"use strict";p();Object.defineProperty(PX,"__esModule",{value:!0});PX.enable=PX.mongoCore=void 0;var G0r=mp(),kpa=a(function(t){var e=t.Server.prototype.connect;return t.Server.prototype.connect=a(function(){var n=e.apply(this,arguments),o=this.s.pool.write;this.s.pool.write=a(function(){var l=typeof arguments[1]=="function"?1:2;return typeof arguments[l]=="function"&&(arguments[l]=G0r.channel.bindToContext(arguments[l])),o.apply(this,arguments)},"contextPreservingWrite");var s=this.s.pool.logout;return this.s.pool.logout=a(function(){return typeof arguments[1]=="function"&&(arguments[1]=G0r.channel.bindToContext(arguments[1])),s.apply(this,arguments)},"contextPreservingLogout"),n},"contextPreservingConnect"),t},"mongodbcorePatchFunction");PX.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:kpa};function Dpa(){G0r.channel.registerMonkeyPatch("mongodb-core",PX.mongoCore)}a(Dpa,"enable");PX.enable=Dpa});var Z0i=I(nv=>{"use strict";p();var jhe=nv&&nv.__assign||function(){return jhe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 2.0.0 <= 3.0.5",patch:Npa};nv.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:Mpa};nv.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:Bpa};function Lpa(){AE.channel.registerMonkeyPatch("mongodb",nv.mongo2),AE.channel.registerMonkeyPatch("mongodb",nv.mongo3),AE.channel.registerMonkeyPatch("mongodb",nv.mongo330)}a(Lpa,"enable");nv.enable=Lpa});var emi=I(kX=>{"use strict";p();Object.defineProperty(kX,"__esModule",{value:!0});kX.enable=kX.mysql=void 0;var Lft=mp(),X0i=require("path"),Fpa=a(function(t,e){var r=a(function(u,d){return function(f,h){var m=u[f];m&&(u[f]=a(function(){for(var A=arguments.length-1,y=arguments.length-1;y>=0;--y)if(typeof arguments[y]=="function"){A=y;break}else if(typeof arguments[y]<"u")break;var E=arguments[A],_={result:null,startTime:null,startDate:null};typeof E=="function"&&(h?(_.startTime=process.hrtime(),_.startDate=new Date,arguments[A]=Lft.channel.bindToContext(h(_,E))):arguments[A]=Lft.channel.bindToContext(E));var v=m.apply(this,arguments);return _.result=v,v},"mysqlContextPreserver"))}},"patchObjectFunction"),n=a(function(u,d){return r(u.prototype,d+".prototype")},"patchClassMemberFunction"),o=["connect","changeUser","ping","statistics","end"],s=require(X0i.dirname(e)+"/lib/Connection");o.forEach(function(u){return n(s,"Connection")(u)}),r(s,"Connection")("createQuery",function(u,d){return function(f){var h=process.hrtime(u.startTime),m=h[0]*1e3+h[1]/1e6|0;Lft.channel.publish("mysql",{query:u.result,callbackArgs:arguments,err:f,duration:m,time:u.startDate}),d.apply(this,arguments)}});var c=["_enqueueCallback"],l=require(X0i.dirname(e)+"/lib/Pool");return c.forEach(function(u){return n(l,"Pool")(u)}),t},"mysqlPatchFunction");kX.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:Fpa};function Upa(){Lft.channel.registerMonkeyPatch("mysql",kX.mysql)}a(Upa,"enable");kX.enable=Upa});var rmi=I(DX=>{"use strict";p();Object.defineProperty(DX,"__esModule",{value:!0});DX.enable=DX.postgresPool1=void 0;var tmi=mp();function Qpa(t){var e=t.prototype.connect;return t.prototype.connect=a(function(n){return n&&(arguments[0]=tmi.channel.bindToContext(n)),e.apply(this,arguments)},"connect"),t}a(Qpa,"postgresPool1PatchFunction");DX.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:Qpa};function qpa(){tmi.channel.registerMonkeyPatch("pg-pool",DX.postgresPool1)}a(qpa,"enable");DX.enable=qpa});var imi=I(H5=>{"use strict";p();Object.defineProperty(H5,"__esModule",{value:!0});H5.enable=H5.postgres=H5.postgres6=void 0;var Hhe=mp(),nmi=require("events"),$0r="postgres";function jpa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},d=process.hrtime(),f;function h(m){m&&m[n]&&(m=m[n]);var g=Hhe.channel.bindToContext(function(A,y){var E=process.hrtime(d);if(u.result=y&&{rowCount:y.rowCount,command:y.command},u.error=A,u.duration=Math.ceil(E[0]*1e3+E[1]/1e6),Hhe.channel.publish($0r,u),A){if(m)return m.apply(this,arguments);f&&f instanceof nmi.EventEmitter&&f.emit("error",A)}else m&&m.apply(this,arguments)});try{return Object.defineProperty(g,n,{value:m}),g}catch{return m}}a(h,"patchCallback");try{typeof s=="string"?c instanceof Array?(u.query.preparable={text:s,args:c},l=h(l)):(u.query.text=s,l?l=h(l):c=h(c)):(typeof s.name=="string"?u.query.plan=s.name:s.values instanceof Array?u.query.preparable={text:s.text,args:s.values}:u.query.text=s.text,l?l=h(l):c?c=h(c):s.callback=h(s.callback))}catch{return r.apply(this,arguments)}return arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3,f=r.apply(this,arguments),f},"query"),t}a(jpa,"postgres6PatchFunction");function Hpa(t,e){var r=t.Client.prototype.query,n="__diagnosticOriginalFunc";return t.Client.prototype.query=a(function(s,c,l){var u=this,d,f,h=!!l,m={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},g,A=process.hrtime();function y(v){v&&v[n]&&(v=v[n]);var b=Hhe.channel.bindToContext(function(T,w){var R=process.hrtime(A);if(m.result=w&&{rowCount:w.rowCount,command:w.command},m.error=T,m.duration=Math.ceil(R[0]*1e3+R[1]/1e6),Hhe.channel.publish($0r,m),T){if(v)return v.apply(this,arguments);g&&g instanceof nmi.EventEmitter&&g.emit("error",T)}else v&&v.apply(this,arguments)});try{return Object.defineProperty(b,n,{value:v}),b}catch{return v}}a(y,"patchCallback");try{typeof s=="string"?c instanceof Array?(m.query.preparable={text:s,args:c},h=typeof l=="function",l=h?y(l):l):(m.query.text=s,l?(h=typeof l=="function",l=h?y(l):l):(h=typeof c=="function",c=h?y(c):c)):(typeof s.name=="string"?m.query.plan=s.name:s.values instanceof Array?m.query.preparable={text:s.text,args:s.values}:s.cursor?m.query.text=(d=s.cursor)===null||d===void 0?void 0:d.text:m.query.text=s.text,l?(h=typeof l=="function",l=y(l)):c?(h=typeof c=="function",c=h?y(c):c):(h=typeof s.callback=="function",s.callback=h?y(s.callback):s.callback))}catch{return r.apply(this,arguments)}arguments[0]=s,arguments[1]=c,arguments[2]=l,arguments.length=arguments.length>3?arguments.length:3;try{g=r.apply(this,arguments)}catch(v){throw y()(v,void 0),v}if(!h){if(g instanceof Promise)return g.then(function(v){return y()(void 0,v),new u._Promise(function(b,T){b(v)})}).catch(function(v){return y()(v,void 0),new u._Promise(function(b,T){T(v)})});var E=g.text?g.text:"";if(g.cursor&&(E=(f=g.cursor)===null||f===void 0?void 0:f.text),E){var _={command:E,rowCount:0};y()(void 0,_)}}return g},"query"),t}a(Hpa,"postgresLatestPatchFunction");H5.postgres6={versionSpecifier:"6.*",patch:jpa};H5.postgres={versionSpecifier:">=7.* <=8.*",patch:Hpa,publisherName:$0r};function Gpa(){Hhe.channel.registerMonkeyPatch("pg",H5.postgres6),Hhe.channel.registerMonkeyPatch("pg",H5.postgres)}a(Gpa,"enable");H5.enable=Gpa});var omi=I(NX=>{"use strict";p();Object.defineProperty(NX,"__esModule",{value:!0});NX.enable=NX.redis=void 0;var V0r=mp(),$pa=a(function(t){var e=t.RedisClient.prototype.internal_send_command;return t.RedisClient.prototype.internal_send_command=function(r){if(r){var n=r.callback;if(!n||!n.pubsubBound){var o=this.address,s=process.hrtime(),c=new Date;r.callback=V0r.channel.bindToContext(function(l,u){var d=process.hrtime(s),f=d[0]*1e3+d[1]/1e6|0;V0r.channel.publish("redis",{duration:f,address:o,commandObj:r,err:l,result:u,time:c}),typeof n=="function"&&n.apply(this,arguments)}),r.callback.pubsubBound=!0}}return e.call(this,r)},t},"redisPatchFunction");NX.redis={versionSpecifier:">= 2.0.0 < 4.0.0",patch:$pa};function Vpa(){V0r.channel.registerMonkeyPatch("redis",NX.redis)}a(Vpa,"enable");NX.enable=Vpa});var smi=I(zF=>{"use strict";p();var Fft=zF&&zF.__assign||function(){return Fft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r= 6.0.0 < 9.0.0",patch:Wpa};function zpa(){W0r.channel.registerMonkeyPatch("tedious",zF.tedious)}a(zpa,"enable");zF.enable=zpa});var ami=I(Cb=>{"use strict";p();var Ypa=Cb&&Cb.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Kpa=Cb&&Cb.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);od[f]?h:f);return f}a(n,"getLogLevel");function o(l){this.add(new r(t,{level:n(l)}))}a(o,"patchedConfigure");var s=t.createLogger;t.createLogger=a(function(u){var d=s.call(this,u);d.add(new r(t,{level:n(u)}));var f=d.configure;return d.configure=function(){f.apply(this,arguments),o.apply(this,arguments)},d},"patchedCreate");var c=t.configure;return t.configure=function(){c.apply(this,arguments),o.apply(this,arguments)},t.add(new r(t)),t},"winston3PatchFunction");Cb.winston3={versionSpecifier:"3.x",patch:Zpa};Cb.winston2={versionSpecifier:"2.x",patch:Jpa};function Xpa(){Uft.channel.registerMonkeyPatch("winston",Cb.winston2),Uft.channel.registerMonkeyPatch("winston",Cb.winston3)}a(Xpa,"enable");Cb.enable=Xpa});var Emi=I(Cu=>{"use strict";p();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.enable=Cu.tedious=Cu.pgPool=Cu.pg=Cu.winston=Cu.redis=Cu.mysql=Cu.mongodb=Cu.mongodbCore=Cu.console=Cu.bunyan=Cu.azuresdk=void 0;var cmi=V0i();Cu.azuresdk=cmi;var lmi=z0i();Cu.bunyan=lmi;var umi=K0i();Cu.console=umi;var dmi=J0i();Cu.mongodbCore=dmi;var fmi=Z0i();Cu.mongodb=fmi;var pmi=emi();Cu.mysql=pmi;var hmi=rmi();Cu.pgPool=hmi;var mmi=imi();Cu.pg=mmi;var gmi=omi();Cu.redis=gmi;var Ami=smi();Cu.tedious=Ami;var ymi=ami();Cu.winston=ymi;function eha(){lmi.enable(),umi.enable(),dmi.enable(),fmi.enable(),pmi.enable(),mmi.enable(),hmi.enable(),gmi.enable(),ymi.enable(),cmi.enable(),Ami.enable()}a(eha,"enable");Cu.enable=eha});var jft=I(MX=>{"use strict";p();Object.defineProperty(MX,"__esModule",{value:!0});MX.IsInitialized=void 0;MX.registerContextPreservation=tha;var z0r=jl(),vmi=tdt();MX.IsInitialized=!vmi.JsonConfig.getInstance().noDiagnosticChannel;var Y0r="DiagnosticChannel";if(MX.IsInitialized){x2=Emi(),_mi=vmi.JsonConfig.getInstance().noPatchModules,Qft=_mi.split(","),K0r={bunyan:x2.bunyan,console:x2.console,mongodb:x2.mongodb,mongodbCore:x2.mongodbCore,mysql:x2.mysql,redis:x2.redis,pg:x2.pg,pgPool:x2.pgPool,winston:x2.winston,azuresdk:x2.azuresdk};for(qft in K0r)Qft.indexOf(qft)===-1&&(K0r[qft].enable(),z0r.info(Y0r,"Subscribed to ".concat(qft," events")));Qft.length>0&&z0r.info(Y0r,"Some modules will not be patched",Qft)}else z0r.info(Y0r,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");var x2,_mi,Qft,K0r,qft;function tha(t){if(MX.IsInitialized){var e=mp();e.channel.addContextPreservation(t)}}a(tha,"registerContextPreservation")});var Ghe=I((xXf,Cmi)=>{"use strict";p();Cmi.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}});var VA=I((X0r,bmi)=>{"use strict";p();var CH=X0r&&X0r.__assign||function(){return CH=Object.assign||function(t){for(var e,r=1,n=arguments.length;r>u&255)},"toChar"),n=a(function(l){return r(l,24)+r(l,16)+r(l,8)+r(l,0)},"int32AsString"),o=e.map(n).join(""),s=Buffer.from?Buffer.from(o,"binary"):new Buffer(o,"binary"),c=s.toString("base64");return c.substr(0,c.indexOf("="))},t.random32=function(){return 4294967296*Math.random()|0},t.randomu32=function(){return t.random32()+2147483648},t.w3cTraceId=function(){for(var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n,o=0;o<4;o++)n=t.random32(),r+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15];var s=e[8+Math.random()*4|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},t.w3cSpanId=function(){return t.w3cTraceId().substring(16)},t.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"},t.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"},t.isError=function(e){return Object.prototype.toString.call(e)==="[object Error]"},t.isPrimitive=function(e){var r=typeof e;return r==="string"||r==="number"||r==="boolean"},t.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"},t.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var r=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/(1e3*60))%60,o=""+Math.floor(e/(1e3*60*60))%24,s=Math.floor(e/(1e3*60*60*24));r=r.indexOf(".")<2?"0"+r:r,n=n.length<2?"0"+n:n,o=o.length<2?"0"+o:o;var c=s>0?s+".":"";return c+o+":"+n+":"+r},t.extractError=function(e){var r=e;return{message:e.message,code:r.code||r.id||""}},t.extractObject=function(e){return e instanceof Error?t.extractError(e):typeof e.toJSON=="function"?e.toJSON():e},t.validateStringMap=function(e){if(typeof e!="object"){OX.info("Invalid properties dropped from payload");return}var r={};for(var n in e){var o="",s=e[n],c=typeof s;if(t.isPrimitive(s))o=s.toString();else if(s===null||c==="undefined")o="";else if(c==="function"){OX.info("key: "+n+" was function; will not serialize");continue}else{var l=t.isArray(s)?s:t.extractObject(s);try{t.isPrimitive(l)?o=l:o=JSON.stringify(l)}catch(u){o=s.constructor.name.toString()+" (Error: "+u.message+")",OX.info("key: "+n+", could not be serialized")}}r[n]=o.substring(0,t.MAX_PROPERTY_LENGTH)}return r},t.canIncludeCorrelationHeader=function(e,r){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!r)return!0;for(var o=0;o{"use strict";p();var emr=VA(),oha=(function(){function t(){}return a(t,"CorrelationIdManager"),t.queryCorrelationId=function(e,r){},t.cancelCorrelationIdQuery=function(e,r){},t.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e,e[e.length-1]!=="."&&(e+=".");var r=(t.currentRootId++).toString(16);return t.appendSuffix(e,r,"_")}else return t.generateRootId()},t.getRootId=function(e){var r=e.indexOf(".");r<0&&(r=e.length);var n=e[0]==="|"?1:0;return e.substring(n,r)},t.generateRootId=function(){return"|"+emr.w3cTraceId()+"."},t.appendSuffix=function(e,r,n){if(e.length+r.lengtho)for(;o>1;--o){var s=e[o-1];if(s==="."||s==="_")break}if(o<=1)return t.generateRootId();for(r=emr.randomu32().toString(16);r.length<8;)r="0"+r;return e.substring(0,o)+r+"#"},t.correlationIdPrefix="cid-v1:",t.w3cEnabled=!0,t.HTTP_TIMEOUT=2500,t.requestIdMaxLength=1024,t.currentRootId=emr.randomu32(),t})();Smi.exports=oha});var Hft=I((MXf,Tmi)=>{"use strict";p();var WA=VA(),sha=BX(),aha=(function(){function t(e,r){if(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.version=t.DEFAULT_VERSION,e&&typeof e=="string")if(e.split(",").length>1)this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16);else{var n=e.trim().split("-"),o=n.length;o>=4?(this.version=n[0],this.traceId=n[1],this.spanId=n[2],this.traceFlag=n[3]):(this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=t.DEFAULT_VERSION,this.traceId=WA.w3cTraceId()),this.version==="00"&&o!==4&&(this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)),this.version==="ff"&&(this.version=t.DEFAULT_VERSION,this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=t.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=t.DEFAULT_TRACE_FLAG,this.traceId=WA.w3cTraceId()),t.isValidTraceId(this.traceId)||(this.traceId=WA.w3cTraceId()),t.isValidSpanId(this.spanId)||(this.spanId=WA.w3cTraceId().substr(0,16),this.traceId=WA.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(r){this.parentId=r.slice();var s=sha.getRootId(r);t.isValidTraceId(s)||(this.legacyRootId=s,s=WA.w3cTraceId()),r.indexOf("|")!==-1&&(r=r.substring(1+r.substring(0,r.length-1).lastIndexOf("."),r.length-1)),this.traceId=s,this.spanId=r}else this.traceId=WA.w3cTraceId(),this.spanId=WA.w3cTraceId().substr(0,16)}return a(t,"Traceparent"),t.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"},t.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"},t.formatOpenTelemetryTraceFlags=function(e){var r="0"+e.toString(16);return r.substring(r.length-2)},t.prototype.getBackCompatRequestId=function(){return"|".concat(this.traceId,".").concat(this.spanId,".")},t.prototype.toString=function(){return"".concat(this.version,"-").concat(this.traceId,"-").concat(this.spanId,"-").concat(this.traceFlag)},t.prototype.updateSpanId=function(){this.spanId=WA.w3cTraceId().substr(0,16)},t.DEFAULT_TRACE_FLAG="01",t.DEFAULT_VERSION="00",t})();Tmi.exports=aha});var tmr=I((LXf,Imi)=>{"use strict";p();var cha=(function(){function t(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return a(t,"Tracestate"),t.prototype.toString=function(){var e=this.fieldmap;return!e||e.length==0?null:e.join(", ")},t.validateKeyChars=function(e){var r=e.split("@");if(r.length==2){var n=r[0].trim(),o=r[1].trim(),s=!!n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/),c=!!o.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/);return s&&c}else if(r.length==1)return!!e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/);return!1},t.prototype.parseHeader=function(e){var r=[],n={},o=e.split(",");if(o.length>32)return null;for(var s=0,c=o;s{"use strict";p();var lha=(function(){function t(){}return a(t,"Domain"),t})();xmi.exports=lha});var Rmi=I((rmr,wmi)=>{"use strict";p();var uha=rmr&&rmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),dha=YF(),fha=(function(t){uha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"AvailabilityData"),e})(dha);wmi.exports=fha});var nmr=I(($Xf,Pmi)=>{"use strict";p();var pha=(function(){function t(){}return a(t,"Base"),t})();Pmi.exports=pha});var Dmi=I((zXf,kmi)=>{"use strict";p();var hha=(function(){function t(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}return a(t,"ContextTagKeys"),t})();kmi.exports=hha});var Mmi=I((imr,Nmi)=>{"use strict";p();var mha=imr&&imr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),gha=nmr(),Aha=(function(t){mha(e,t);function e(){return t.call(this)||this}return a(e,"Data"),e})(gha);Nmi.exports=Aha});var smr=I((XXf,Omi)=>{"use strict";p();var omr;(function(t){t[t.Measurement=0]="Measurement",t[t.Aggregation=1]="Aggregation"})(omr||(omr={}));Omi.exports=omr});var Lmi=I((tep,Bmi)=>{"use strict";p();var yha=smr(),Eha=(function(){function t(){this.kind=yha.Measurement}return a(t,"DataPoint"),t})();Bmi.exports=Eha});var Umi=I((iep,Fmi)=>{"use strict";p();var _ha=(function(){function t(){this.ver=1,this.sampleRate=100,this.tags={}}return a(t,"Envelope"),t})();Fmi.exports=_ha});var cmr=I((amr,Qmi)=>{"use strict";p();var vha=amr&&amr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Cha=YF(),bha=(function(t){vha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"EventData"),e})(Cha);Qmi.exports=bha});var jmi=I((lmr,qmi)=>{"use strict";p();var Sha=lmr&&lmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Tha=YF(),Iha=(function(t){Sha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.exceptions=[],r.properties={},r.measurements={},r}return a(e,"ExceptionData"),e})(Tha);qmi.exports=Iha});var Gmi=I((dep,Hmi)=>{"use strict";p();var xha=(function(){function t(){this.hasFullStack=!0,this.parsedStack=[]}return a(t,"ExceptionDetails"),t})();Hmi.exports=xha});var Vmi=I((umr,$mi)=>{"use strict";p();var wha=umr&&umr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Rha=YF(),Pha=(function(t){wha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r}return a(e,"MessageData"),e})(Rha);$mi.exports=Pha});var zmi=I((dmr,Wmi)=>{"use strict";p();var kha=dmr&&dmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Dha=YF(),Nha=(function(t){kha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.metrics=[],r.properties={},r}return a(e,"MetricData"),e})(Dha);Wmi.exports=Nha});var Kmi=I((fmr,Ymi)=>{"use strict";p();var Mha=fmr&&fmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Oha=cmr(),Bha=(function(t){Mha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"PageViewData"),e})(Oha);Ymi.exports=Bha});var Zmi=I((pmr,Jmi)=>{"use strict";p();var Lha=pmr&&pmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Fha=YF(),Uha=(function(t){Lha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.success=!0,r.properties={},r.measurements={},r}return a(e,"RemoteDependencyData"),e})(Fha);Jmi.exports=Uha});var egi=I((hmr,Xmi)=>{"use strict";p();var Qha=hmr&&hmr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),qha=YF(),jha=(function(t){Qha(e,t);function e(){var r=t.call(this)||this;return r.ver=2,r.properties={},r.measurements={},r}return a(e,"RequestData"),e})(qha);Xmi.exports=jha});var rgi=I((Sep,tgi)=>{"use strict";p();var mmr;(function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"})(mmr||(mmr={}));tgi.exports=mmr});var igi=I((Iep,ngi)=>{"use strict";p();var Hha=(function(){function t(){}return a(t,"StackFrame"),t})();ngi.exports=Hha});var gmr=I(c0=>{"use strict";p();Object.defineProperty(c0,"__esModule",{value:!0});c0.AvailabilityData=Rmi();c0.Base=nmr();c0.ContextTagKeys=Dmi();c0.Data=Mmi();c0.DataPoint=Lmi();c0.DataPointType=smr();c0.Domain=YF();c0.Envelope=Umi();c0.EventData=cmr();c0.ExceptionData=jmi();c0.ExceptionDetails=Gmi();c0.MessageData=Vmi();c0.MetricData=zmi();c0.PageViewData=Kmi();c0.RemoteDependencyData=Zmi();c0.RequestData=egi();c0.SeverityLevel=rgi();c0.StackFrame=igi()});var ogi=I(gNe=>{"use strict";p();Object.defineProperty(gNe,"__esModule",{value:!0});gNe.RemoteDependencyDataConstants=void 0;gNe.domainSupportsProperties=$ha;var LX=gmr(),Gha=(function(){function t(){}return a(t,"RemoteDependencyDataConstants"),t.TYPE_HTTP="Http",t.TYPE_AI="Http (tracked component)",t})();gNe.RemoteDependencyDataConstants=Gha;function $ha(t){return"properties"in t||t instanceof LX.EventData||t instanceof LX.ExceptionData||t instanceof LX.MessageData||t instanceof LX.MetricData||t instanceof LX.PageViewData||t instanceof LX.RemoteDependencyData||t instanceof LX.RequestData}a($ha,"domainSupportsProperties")});var agi=I(sgi=>{"use strict";p();Object.defineProperty(sgi,"__esModule",{value:!0})});var lgi=I(cgi=>{"use strict";p();Object.defineProperty(cgi,"__esModule",{value:!0})});var dgi=I(ugi=>{"use strict";p();Object.defineProperty(ugi,"__esModule",{value:!0})});var pgi=I(fgi=>{"use strict";p();Object.defineProperty(fgi,"__esModule",{value:!0})});var mgi=I(hgi=>{"use strict";p();Object.defineProperty(hgi,"__esModule",{value:!0})});var Agi=I(ggi=>{"use strict";p();Object.defineProperty(ggi,"__esModule",{value:!0})});var Egi=I(ygi=>{"use strict";p();Object.defineProperty(ygi,"__esModule",{value:!0})});var vgi=I(_gi=>{"use strict";p();Object.defineProperty(_gi,"__esModule",{value:!0})});var bgi=I(Cgi=>{"use strict";p();Object.defineProperty(Cgi,"__esModule",{value:!0})});var Tgi=I(Sgi=>{"use strict";p();Object.defineProperty(Sgi,"__esModule",{value:!0})});var xgi=I(Igi=>{"use strict";p();Object.defineProperty(Igi,"__esModule",{value:!0})});var Rgi=I(wgi=>{"use strict";p();Object.defineProperty(wgi,"__esModule",{value:!0})});var Pgi=I(bH=>{"use strict";p();Object.defineProperty(bH,"__esModule",{value:!0});bH.TelemetryType=bH.TelemetryTypeString=void 0;bH.telemetryTypeToBaseType=Vha;bH.baseTypeToTelemetryType=Wha;function Vha(t){switch(t){case Sg.Event:return"EventData";case Sg.Exception:return"ExceptionData";case Sg.Trace:return"MessageData";case Sg.Metric:return"MetricData";case Sg.Request:return"RequestData";case Sg.Dependency:return"RemoteDependencyData";case Sg.Availability:return"AvailabilityData";case Sg.PageView:return"PageViewData"}}a(Vha,"telemetryTypeToBaseType");function Wha(t){switch(t){case"EventData":return Sg.Event;case"ExceptionData":return Sg.Exception;case"MessageData":return Sg.Trace;case"MetricData":return Sg.Metric;case"RequestData":return Sg.Request;case"RemoteDependencyData":return Sg.Dependency;case"AvailabilityData":return Sg.Availability;case"PageViewData":return Sg.PageView}}a(Wha,"baseTypeToTelemetryType");bH.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData",PageView:"PageViewData"};var Sg;(function(t){t[t.Event=0]="Event",t[t.Exception=1]="Exception",t[t.Trace=2]="Trace",t[t.Metric=3]="Metric",t[t.Request=4]="Request",t[t.Dependency=5]="Dependency",t[t.Availability=6]="Availability",t[t.PageView=7]="PageView"})(Sg||(bH.TelemetryType=Sg={}))});var kgi=I(um=>{"use strict";p();var zha=um&&um.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vT=um&&um.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zha(e,t,r)};Object.defineProperty(um,"__esModule",{value:!0});vT(agi(),um);vT(lgi(),um);vT(dgi(),um);vT(pgi(),um);vT(mgi(),um);vT(Agi(),um);vT(Egi(),um);vT(vgi(),um);vT(bgi(),um);vT(Tgi(),um);vT(xgi(),um);vT(Rgi(),um);vT(Pgi(),um)});var Ngi=I(Dgi=>{"use strict";p();Object.defineProperty(Dgi,"__esModule",{value:!0})});var Ogi=I(Mgi=>{"use strict";p();Object.defineProperty(Mgi,"__esModule",{value:!0})});var Lgi=I(Bgi=>{"use strict";p();Object.defineProperty(Bgi,"__esModule",{value:!0})});var Ugi=I(Fgi=>{"use strict";p();Object.defineProperty(Fgi,"__esModule",{value:!0})});var qgi=I(Qgi=>{"use strict";p();Object.defineProperty(Qgi,"__esModule",{value:!0})});var Hgi=I(jgi=>{"use strict";p();Object.defineProperty(jgi,"__esModule",{value:!0})});var $gi=I(Ggi=>{"use strict";p();Object.defineProperty(Ggi,"__esModule",{value:!0})});var Wgi=I(Vgi=>{"use strict";p();Object.defineProperty(Vgi,"__esModule",{value:!0})});var zgi=I(bb=>{"use strict";p();var Yha=bb&&bb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SH=bb&&bb.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yha(e,t,r)};Object.defineProperty(bb,"__esModule",{value:!0});SH(Ngi(),bb);SH(Ogi(),bb);SH(Lgi(),bb);SH(Ugi(),bb);SH(qgi(),bb);SH(Hgi(),bb);SH($gi(),bb);SH(Wgi(),bb)});var yE=I(G5=>{"use strict";p();var Kha=G5&&G5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Gft=G5&&G5.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kha(e,t,r)};Object.defineProperty(G5,"__esModule",{value:!0});Gft(ogi(),G5);Gft(gmr(),G5);Gft(kgi(),G5);Gft(zgi(),G5)});var Amr=I((Dtp,Ygi)=>{"use strict";p();var Jha=(function(){function t(){}return a(t,"RequestParser"),t.prototype.getUrl=function(){return this.url},t.prototype.RequestParser=function(){this.startTime=+new Date},t.prototype._setStatus=function(e,r){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var o=this.properties||{};if(r){if(typeof r=="string")o.error=r;else if(r instanceof Error)o.error=r.message;else if(typeof r=="object")for(var s in r)o[s]=r[s]&&r[s].toString&&r[s].toString()}this.properties=o},t.prototype._isSuccess=function(){return 0{"use strict";p();var w2;Object.defineProperty(jr,"__esModule",{value:!0});jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE=jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE=jr.TIME_SINCE_ENQUEUED=jr.ENQUEUED_TIME=jr.MessageBusDestination=jr.MicrosoftEventHub=jr.AzNamespace=jr.AttachTypePrefix=jr.HttpRequestCookieNames=jr.StatsbeatNetworkCategory=jr.StatsbeatFeatureType=jr.StatsbeatInstrumentation=jr.StatsbeatFeature=jr.StatsbeatCounter=jr.StatsbeatAttach=jr.StatsbeatResourceProvider=jr.StatsbeatTelemetryName=jr.HeartBeatMetricName=jr.DependencyTypeName=jr.TelemetryTypeStringToQuickPulseDocumentType=jr.TelemetryTypeStringToQuickPulseType=jr.QuickPulseType=jr.QuickPulseDocumentType=jr.PerformanceToQuickPulseCounter=jr.MetricId=jr.PerformanceCounter=jr.QuickPulseCounter=jr.DEFAULT_LIVEMETRICS_HOST=jr.DEFAULT_LIVEMETRICS_ENDPOINT=jr.DEFAULT_BREEZE_ENDPOINT=jr.APPLICATION_INSIGHTS_SDK_VERSION=void 0;jr.APPLICATION_INSIGHTS_SDK_VERSION="2.9.8";jr.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";jr.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var zA;(function(t){t.COMMITTED_BYTES="\\Memory\\Committed Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",t.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",t.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",t.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",t.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",t.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",t.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"})(zA||(jr.QuickPulseCounter=zA={}));var ANe;(function(t){t.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",t.AVAILABLE_BYTES="\\Memory\\Available Bytes",t.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",t.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",t.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",t.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(ANe||(jr.PerformanceCounter=ANe={}));var Kgi;(function(t){t.REQUESTS_DURATION="requests/duration",t.DEPENDENCIES_DURATION="dependencies/duration",t.EXCEPTIONS_COUNT="exceptions/count",t.TRACES_COUNT="traces/count"})(Kgi||(jr.MetricId=Kgi={}));jr.PerformanceToQuickPulseCounter=(w2={},w2[ANe.PROCESSOR_TIME]=zA.PROCESSOR_TIME,w2[ANe.REQUEST_RATE]=zA.REQUEST_RATE,w2[ANe.REQUEST_DURATION]=zA.REQUEST_DURATION,w2[zA.COMMITTED_BYTES]=zA.COMMITTED_BYTES,w2[zA.REQUEST_FAILURE_RATE]=zA.REQUEST_FAILURE_RATE,w2[zA.DEPENDENCY_RATE]=zA.DEPENDENCY_RATE,w2[zA.DEPENDENCY_FAILURE_RATE]=zA.DEPENDENCY_FAILURE_RATE,w2[zA.DEPENDENCY_DURATION]=zA.DEPENDENCY_DURATION,w2[zA.EXCEPTION_RATE]=zA.EXCEPTION_RATE,w2);jr.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability",PageView:"PageView"};jr.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument",PageView:"PageViewTelemetryDocument"};jr.TelemetryTypeStringToQuickPulseType={EventData:jr.QuickPulseType.Event,ExceptionData:jr.QuickPulseType.Exception,MessageData:jr.QuickPulseType.Trace,MetricData:jr.QuickPulseType.Metric,RequestData:jr.QuickPulseType.Request,RemoteDependencyData:jr.QuickPulseType.Dependency,AvailabilityData:jr.QuickPulseType.Availability,PageViewData:jr.QuickPulseType.PageView};jr.TelemetryTypeStringToQuickPulseDocumentType={EventData:jr.QuickPulseDocumentType.Event,ExceptionData:jr.QuickPulseDocumentType.Exception,MessageData:jr.QuickPulseDocumentType.Trace,MetricData:jr.QuickPulseDocumentType.Metric,RequestData:jr.QuickPulseDocumentType.Request,RemoteDependencyData:jr.QuickPulseDocumentType.Dependency,AvailabilityData:jr.QuickPulseDocumentType.Availability,PageViewData:jr.QuickPulseDocumentType.PageView};jr.DependencyTypeName={Grpc:"GRPC",Http:"HTTP",InProc:"InProc",Sql:"SQL",QueueMessage:"Queue Message"};jr.HeartBeatMetricName="HeartbeatState";jr.StatsbeatTelemetryName="Statsbeat";jr.StatsbeatResourceProvider={appsvc:"appsvc",aks:"aks",functions:"functions",vm:"vm",unknown:"unknown"};jr.StatsbeatAttach={codeless:"IntegratedAuto",sdk:"Manual"};jr.StatsbeatCounter={REQUEST_SUCCESS:"Request_Success_Count",REQUEST_FAILURE:"Request_Failure_Count",REQUEST_DURATION:"Request_Duration",RETRY_COUNT:"Retry_Count",THROTTLE_COUNT:"Throttle_Count",EXCEPTION_COUNT:"Exception_Count",ATTACH:"Attach",FEATURE:"Feature"};var Jgi;(function(t){t[t.NONE=0]="NONE",t[t.DISK_RETRY=1]="DISK_RETRY",t[t.AAD_HANDLING=2]="AAD_HANDLING",t[t.BROWSER_SDK_LOADER=4]="BROWSER_SDK_LOADER",t[t.LIVE_METRICS=16]="LIVE_METRICS",t[t.NATIVE_METRICS=8192]="NATIVE_METRICS"})(Jgi||(jr.StatsbeatFeature=Jgi={}));var Zgi;(function(t){t[t.NONE=0]="NONE",t[t.AZURE_CORE_TRACING=1]="AZURE_CORE_TRACING",t[t.MONGODB=2]="MONGODB",t[t.MYSQL=4]="MYSQL",t[t.REDIS=8]="REDIS",t[t.POSTGRES=16]="POSTGRES",t[t.BUNYAN=32]="BUNYAN",t[t.WINSTON=64]="WINSTON",t[t.CONSOLE=128]="CONSOLE"})(Zgi||(jr.StatsbeatInstrumentation=Zgi={}));var Xgi;(function(t){t[t.Feature=0]="Feature",t[t.Instrumentation=1]="Instrumentation"})(Xgi||(jr.StatsbeatFeatureType=Xgi={}));var eAi;(function(t){t[t.Breeze=0]="Breeze",t[t.Quickpulse=1]="Quickpulse"})(eAi||(jr.StatsbeatNetworkCategory=eAi={}));var tAi;(function(t){t.SESSION="ai_session",t.USER="ai_user",t.AUTH_USER="ai_authUser"})(tAi||(jr.HttpRequestCookieNames=tAi={}));var rAi;(function(t){t.INTEGRATED_AUTO="i",t.MANUAL="m"})(rAi||(jr.AttachTypePrefix=rAi={}));jr.AzNamespace="az.namespace";jr.MicrosoftEventHub="Microsoft.EventHub";jr.MessageBusDestination="message_bus.destination";jr.ENQUEUED_TIME="enqueuedTime";jr.TIME_SINCE_ENQUEUED="timeSinceEnqueued";jr.WEB_INSTRUMENTATION_DEFAULT_SOURCE="https://js.monitor.azure.com/scripts/b/ai";jr.WEB_INSTRUMENTATION_DEPRECATED_SOURCE="https://az416426.vo.msecnd.net/scripts/b/ai"});var vmr=I((_mr,nAi)=>{"use strict";p();var Zha=_mr&&_mr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),$ft=require("url"),Xha=yE(),ymr=VA(),CT=Ghe(),e0a=Amr(),TH=BX(),t0a=tmr(),Emr=Hft(),r0a=jl(),Vft=ad(),n0a=(function(t){Zha(e,t);function e(r,n){var o=t.call(this)||this;return r&&(o.method=r.method,o.url=o._getAbsoluteUrl(r),o.startTime=+new Date,o.socketRemoteAddress=r.socket&&r.socket.remoteAddress,o.parseHeaders(r,n),r.connection&&(o.connectionRemoteAddress=r.connection.remoteAddress,o.legacySocketRemoteAddress=r.connection.socket&&r.connection.socket.remoteAddress)),o}return a(e,"HttpRequestParser"),e.prototype.onError=function(r,n){this._setStatus(void 0,r),n&&(this.duration=n)},e.prototype.onResponse=function(r,n){this._setStatus(r.statusCode,void 0),n&&(this.duration=n)},e.prototype.getRequestTelemetry=function(r){var n=this.method;try{n+=" "+new $ft.URL(this.url).pathname}catch{}var o={id:this.requestId,name:n,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(r&&r.time?o.time=r.time:this.startTime&&(o.time=new Date(this.startTime)),r){for(var s in r)o[s]||(o[s]=r[s]);if(r.properties)for(var s in r.properties)o.properties[s]=r.properties[s]}return o},e.prototype.getRequestTags=function(r){var n={};for(var o in r)n[o]=r[o];return n[e.keys.locationIp]=r[e.keys.locationIp]||this._getIp(),n[e.keys.sessionId]=r[e.keys.sessionId]||this._getId(Vft.HttpRequestCookieNames.SESSION),n[e.keys.userId]=r[e.keys.userId]||this._getId(Vft.HttpRequestCookieNames.USER),n[e.keys.userAuthUserId]=r[e.keys.userAuthUserId]||this._getId(Vft.HttpRequestCookieNames.AUTH_USER),n[e.keys.operationName]=this.getOperationName(r),n[e.keys.operationParentId]=this.getOperationParentId(r),n[e.keys.operationId]=this.getOperationId(r),n},e.prototype.getOperationId=function(r){return r[e.keys.operationId]||this.operationId},e.prototype.getOperationParentId=function(r){return r[e.keys.operationParentId]||this.parentId||this.getOperationId(r)},e.prototype.getOperationName=function(r){if(r[e.keys.operationName])return r[e.keys.operationName];var n="";try{n=new $ft.URL(this.url).pathname}catch{}var o=this.method;return n&&(o+=" "+n),o},e.prototype.getRequestId=function(){return this.requestId},e.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},e.prototype.getTraceparent=function(){return this.traceparent},e.prototype.getTracestate=function(){return this.tracestate},e.prototype.getLegacyRootId=function(){return this.legacyRootId},e.prototype._getAbsoluteUrl=function(r){if(!r.headers)return r.url;var n=r.connection?r.connection.encrypted:null,o=n||r.headers["x-forwarded-proto"]=="https"?"https":"http",s=o+"://"+r.headers.host+"/",c="",l="";try{var u=new $ft.URL(r.url,s);c=u.pathname,l=u.search}catch{}var d=$ft.format({protocol:o,host:r.headers.host,pathname:c,search:l});return d},e.prototype._getIp=function(){var r=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,n=a(function(s){var c=r.exec(s);if(c)return c[0]},"check"),o=n(this.rawHeaders["x-forwarded-for"])||n(this.rawHeaders["x-client-ip"])||n(this.rawHeaders["x-real-ip"])||n(this.connectionRemoteAddress)||n(this.socketRemoteAddress)||n(this.legacySocketRemoteAddress);return!o&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&this.connectionRemoteAddress.substr(0,2)==="::"&&(o="127.0.0.1"),o},e.prototype._getId=function(r){var n=this.rawHeaders&&this.rawHeaders.cookie&&typeof this.rawHeaders.cookie=="string"&&this.rawHeaders.cookie||"";if(r===Vft.HttpRequestCookieNames.AUTH_USER)try{n=decodeURI(n)}catch(s){n="",r0a.warn("Could not decode the auth cookie with error: ",ymr.dumpObj(s))}var o=e.parseId(ymr.getCookie(r,n));return o},e.prototype.setBackCompatFromThisTraceContext=function(){this.operationId=this.traceparent.traceId,this.traceparent.legacyRootId&&(this.legacyRootId=this.traceparent.legacyRootId),this.parentId=this.traceparent.parentId,this.traceparent.updateSpanId(),this.requestId=this.traceparent.getBackCompatRequestId()},e.prototype.parseHeaders=function(r,n){if(this.rawHeaders=r.headers||r.rawHeaders,this.userAgent=r.headers&&r.headers["user-agent"],this.sourceCorrelationId=ymr.getCorrelationContextTarget(r,CT.requestContextSourceKey),r.headers){var o=r.headers[CT.traceStateHeader]?r.headers[CT.traceStateHeader].toString():null,s=r.headers[CT.traceparentHeader]?r.headers[CT.traceparentHeader].toString():null,c=r.headers[CT.requestIdHeader]?r.headers[CT.requestIdHeader].toString():null,l=r.headers[CT.parentIdHeader]?r.headers[CT.parentIdHeader].toString():null,u=r.headers[CT.rootIdHeader]?r.headers[CT.rootIdHeader].toString():null;this.correlationContextHeader=r.headers[CT.correlationContextHeader]?r.headers[CT.correlationContextHeader].toString():null,TH.w3cEnabled&&(s||o)?(this.traceparent=new Emr(s?s.toString():null),this.tracestate=s&&o&&new t0a(o?o.toString():null),this.setBackCompatFromThisTraceContext()):c?TH.w3cEnabled?(this.traceparent=new Emr(null,c),this.setBackCompatFromThisTraceContext()):(this.parentId=c,this.requestId=TH.generateRequestId(this.parentId),this.operationId=TH.getRootId(this.requestId)):TH.w3cEnabled?(this.traceparent=new Emr,this.traceparent.parentId=l,this.traceparent.legacyRootId=u||l,this.setBackCompatFromThisTraceContext()):(this.parentId=l,this.requestId=TH.generateRequestId(u||this.parentId),this.correlationContextHeader=null,this.operationId=TH.getRootId(this.requestId)),n&&(this.requestId=n,this.operationId=TH.getRootId(this.requestId))}},e.parseId=function(r){var n=r.split("|");return n.length>0?n[0]:""},e.keys=new Xha.ContextTagKeys,e})(e0a);nAi.exports=n0a});var _Ai=I((yo,EAi)=>{p();yo=EAi.exports=Pa;var ol;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?ol=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):ol=a(function(){},"debug");yo.SEMVER_SPEC_VERSION="2.0.0";var yNe=256,Wft=Number.MAX_SAFE_INTEGER||9007199254740991,Cmr=16,i0a=yNe-6,ENe=yo.re=[],bu=yo.safeRe=[],er=yo.src=[],ua=0,xmr="[a-zA-Z0-9-]",bmr=[["\\s",1],["\\d",yNe],[xmr,i0a]];function Xft(t){for(var e=0;e)?=?)";var zft=ua++;er[zft]=er[Whe]+"|x|X|\\*";var Yft=ua++;er[Yft]=er[Vhe]+"|x|X|\\*";var FX=ua++;er[FX]="[v=\\s]*("+er[Yft]+")(?:\\.("+er[Yft]+")(?:\\.("+er[Yft]+")(?:"+er[Rmr]+")?"+er[vNe]+"?)?)?";var Yhe=ua++;er[Yhe]="[v=\\s]*("+er[zft]+")(?:\\.("+er[zft]+")(?:\\.("+er[zft]+")(?:"+er[Pmr]+")?"+er[vNe]+"?)?)?";var cAi=ua++;er[cAi]="^"+er[Zhe]+"\\s*"+er[FX]+"$";var lAi=ua++;er[lAi]="^"+er[Zhe]+"\\s*"+er[Yhe]+"$";var uAi=ua++;er[uAi]="(?:^|[^\\d])(\\d{1,"+Cmr+"})(?:\\.(\\d{1,"+Cmr+"}))?(?:\\.(\\d{1,"+Cmr+"}))?(?:$|[^\\d])";var ept=ua++;er[ept]="(?:~>?)";var Khe=ua++;er[Khe]="(\\s*)"+er[ept]+"\\s+";ENe[Khe]=new RegExp(er[Khe],"g");bu[Khe]=new RegExp(Xft(er[Khe]),"g");var o0a="$1~",dAi=ua++;er[dAi]="^"+er[ept]+er[FX]+"$";var fAi=ua++;er[fAi]="^"+er[ept]+er[Yhe]+"$";var tpt=ua++;er[tpt]="(?:\\^)";var Jhe=ua++;er[Jhe]="(\\s*)"+er[tpt]+"\\s+";ENe[Jhe]=new RegExp(er[Jhe],"g");bu[Jhe]=new RegExp(Xft(er[Jhe]),"g");var s0a="$1^",pAi=ua++;er[pAi]="^"+er[tpt]+er[FX]+"$";var hAi=ua++;er[hAi]="^"+er[tpt]+er[Yhe]+"$";var Mmr=ua++;er[Mmr]="^"+er[Zhe]+"\\s*("+Dmr+")$|^$";var Omr=ua++;er[Omr]="^"+er[Zhe]+"\\s*("+aAi+")$|^$";var UX=ua++;er[UX]="(\\s*)"+er[Zhe]+"\\s*("+Dmr+"|"+er[FX]+")";ENe[UX]=new RegExp(er[UX],"g");bu[UX]=new RegExp(Xft(er[UX]),"g");var a0a="$1$2$3",mAi=ua++;er[mAi]="^\\s*("+er[FX]+")\\s+-\\s+("+er[FX]+")\\s*$";var gAi=ua++;er[gAi]="^\\s*("+er[Yhe]+")\\s+-\\s+("+er[Yhe]+")\\s*$";var AAi=ua++;er[AAi]="(<|>)?=?\\s*\\*";for($5=0;$5yNe)return null;var r=e.loose?bu[Nmr]:bu[kmr];if(!r.test(t))return null;try{return new Pa(t,e)}catch{return null}}a(QX,"parse");yo.valid=c0a;function c0a(t,e){var r=QX(t,e);return r?r.version:null}a(c0a,"valid");yo.clean=l0a;function l0a(t,e){var r=QX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(l0a,"clean");yo.SemVer=Pa;function Pa(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Pa){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>yNe)throw new TypeError("version is longer than "+yNe+" characters");if(!(this instanceof Pa))return new Pa(t,e);ol("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?bu[Nmr]:bu[kmr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Wft||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wft||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wft||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};yo.inc=u0a;function u0a(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new Pa(t,r).inc(e,n).version}catch{return null}}a(u0a,"inc");yo.diff=d0a;function d0a(t,e){if(Bmr(t,e))return null;var r=QX(t),n=QX(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(d0a,"diff");yo.compareIdentifiers=zhe;var iAi=/^[0-9]+$/;function zhe(t,e){var r=iAi.test(t),n=iAi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(_Ne,"gt");yo.lt=Kft;function Kft(t,e,r){return KF(t,e,r)<0}a(Kft,"lt");yo.eq=Bmr;function Bmr(t,e,r){return KF(t,e,r)===0}a(Bmr,"eq");yo.neq=yAi;function yAi(t,e,r){return KF(t,e,r)!==0}a(yAi,"neq");yo.gte=Lmr;function Lmr(t,e,r){return KF(t,e,r)>=0}a(Lmr,"gte");yo.lte=Fmr;function Fmr(t,e,r){return KF(t,e,r)<=0}a(Fmr,"lte");yo.cmp=Jft;function Jft(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Bmr(t,r,n);case"!=":return yAi(t,r,n);case">":return _Ne(t,r,n);case">=":return Lmr(t,r,n);case"<":return Kft(t,r,n);case"<=":return Fmr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(Jft,"cmp");yo.Comparator=$w;function $w(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof $w){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof $w))return new $w(t,e);t=t.trim().split(/\s+/).join(" "),ol("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===CNe?this.value="":this.value=this.operator+this.semver.version,ol("comp",this)}a($w,"Comparator");var CNe={};$w.prototype.parse=function(t){var e=this.options.loose?bu[Mmr]:bu[Omr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new Pa(r[2],this.options.loose):this.semver=CNe};$w.prototype.toString=function(){return this.value};$w.prototype.test=function(t){return ol("Comparator.test",t,this.options.loose),this.semver===CNe?!0:(typeof t=="string"&&(t=new Pa(t,this.options)),Jft(t,this.operator,this.semver,this.options))};$w.prototype.intersects=function(t,e){if(!(t instanceof $w))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new _f(t.value,e),Zft(this.value,r,e);if(t.operator==="")return r=new _f(this.value,e),Zft(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=Jft(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=Jft(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};yo.Range=_f;function _f(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof _f)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new _f(t.raw,e);if(t instanceof $w)return new _f(t.value,e);if(!(this instanceof _f))return new _f(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(_f,"Range");_f.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};_f.prototype.toString=function(){return this.range};_f.prototype.parseRange=function(t){var e=this.options.loose,r=e?bu[gAi]:bu[mAi];t=t.replace(r,R0a),ol("hyphen replace",t),t=t.replace(bu[UX],a0a),ol("comparator trim",t,bu[UX]),t=t.replace(bu[Khe],o0a),t=t.replace(bu[Jhe],s0a);var n=e?bu[Mmr]:bu[Omr],o=t.split(" ").map(function(s){return v0a(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new $w(s,this.options)},this),o};_f.prototype.intersects=function(t,e){if(!(t instanceof _f))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};yo.toComparators=_0a;function _0a(t,e){return new _f(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(_0a,"toComparators");function v0a(t,e){return ol("comp",t,e),t=S0a(t,e),ol("caret",t),t=C0a(t,e),ol("tildes",t),t=I0a(t,e),ol("xrange",t),t=w0a(t,e),ol("stars",t),t}a(v0a,"parseComparator");function iv(t){return!t||t.toLowerCase()==="x"||t==="*"}a(iv,"isX");function C0a(t,e){return t.trim().split(/\s+/).map(function(r){return b0a(r,e)}).join(" ")}a(C0a,"replaceTildes");function b0a(t,e){var r=e.loose?bu[fAi]:bu[dAi];return t.replace(r,function(n,o,s,c,l){ol("tilde",t,n,o,s,c,l);var u;return iv(o)?u="":iv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":iv(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(ol("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",ol("tilde return",u),u})}a(b0a,"replaceTilde");function S0a(t,e){return t.trim().split(/\s+/).map(function(r){return T0a(r,e)}).join(" ")}a(S0a,"replaceCarets");function T0a(t,e){ol("caret",t,e);var r=e.loose?bu[hAi]:bu[pAi];return t.replace(r,function(n,o,s,c,l){ol("caret",t,n,o,s,c,l);var u;return iv(o)?u="":iv(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":iv(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(ol("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(ol("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),ol("caret return",u),u})}a(T0a,"replaceCaret");function I0a(t,e){return ol("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return x0a(r,e)}).join(" ")}a(I0a,"replaceXRanges");function x0a(t,e){t=t.trim();var r=e.loose?bu[lAi]:bu[cAi];return t.replace(r,function(n,o,s,c,l,u){ol("xRange",t,n,o,s,c,l,u);var d=iv(s),f=d||iv(c),h=f||iv(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),ol("xRange return",n),n})}a(x0a,"replaceXRange");function w0a(t,e){return ol("replaceStars",t,e),t.trim().replace(bu[AAi],"")}a(w0a,"replaceStars");function R0a(t,e,r,n,o,s,c,l,u,d,f,h,m){return iv(r)?e="":iv(n)?e=">="+r+".0.0":iv(o)?e=">="+r+"."+n+".0":e=">="+e,iv(u)?l="":iv(d)?l="<"+(+u+1)+".0.0":iv(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(R0a,"hyphenReplace");_f.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new Pa(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(P0a,"testSet");yo.satisfies=Zft;function Zft(t,e,r){try{e=new _f(e,r)}catch{return!1}return e.test(t)}a(Zft,"satisfies");yo.maxSatisfying=k0a;function k0a(t,e,r){var n=null,o=null;try{var s=new _f(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new Pa(n,r))}),n}a(k0a,"maxSatisfying");yo.minSatisfying=D0a;function D0a(t,e,r){var n=null,o=null;try{var s=new _f(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new Pa(n,r))}),n}a(D0a,"minSatisfying");yo.minVersion=N0a;function N0a(t,e){t=new _f(t,e);var r=new Pa("0.0.0");if(t.test(r)||(r=new Pa("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||_Ne(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(N0a,"minVersion");yo.validRange=M0a;function M0a(t,e){try{return new _f(t,e).range||"*"}catch{return null}}a(M0a,"validRange");yo.ltr=O0a;function O0a(t,e,r){return Umr(t,e,"<",r)}a(O0a,"ltr");yo.gtr=B0a;function B0a(t,e,r){return Umr(t,e,">",r)}a(B0a,"gtr");yo.outside=Umr;function Umr(t,e,r,n){t=new Pa(t,n),e=new _f(e,n);var o,s,c,l,u;switch(r){case">":o=_Ne,s=Fmr,c=Kft,l=">",u=">=";break;case"<":o=Kft,s=Lmr,c=_Ne,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Zft(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(Umr,"outside");yo.prerelease=L0a;function L0a(t,e){var r=QX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(L0a,"prerelease");yo.intersects=F0a;function F0a(t,e,r){return t=new _f(t,r),e=new _f(e,r),t.intersects(e)}a(F0a,"intersects");yo.coerce=U0a;function U0a(t){if(t instanceof Pa)return t;if(typeof t!="string")return null;var e=t.match(bu[uAi]);return e==null?null:QX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a(U0a,"coerce")});var ipt=I((qtp,SAi)=>{"use strict";p();var CAi=khe(),Xhe=CAi.wrap,rpt=CAi.unwrap,JF="wrap@before";function npt(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}a(npt,"defineProperty");function Q0a(t,e){for(var r=e.length,n=0;n0&&Q0a(t,o)}a(q0a,"_findAndProcess");function vAi(t,e){if(t){var r=t;if(typeof t=="function")r=e(t);else if(Array.isArray(t)){r=[];for(var n=0;n{"use strict";p();var xc=require("util"),ZF=require("assert"),j0a=ipt(),cd=require("async_hooks"),bNe="cls@contexts",SNe="error@context",vf=process.env.DEBUG_CLS_HOOKED,Ic=-1;xAi.exports={getNamespace:TAi,createNamespace:H0a,destroyNamespace:IAi,reset:G0a,ERROR_SYMBOL:SNe};function Vw(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}a(Vw,"Namespace");Vw.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=r,vf){let n=" ".repeat(this._indent<0?0:this._indent);Fd(n+"CONTEXT-SET KEY:"+e+"="+r+" in ns:"+this.name+" currentUid:"+Ic+" active:"+xc.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return r},"set");Vw.prototype.get=a(function(e){if(!this.active){if(vf){let r=cd.currentId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length}`)}return}if(vf){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(o+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+Ic+" active:"+xc.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),Fd(`${o}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} active:${xc.inspect(this.active)}`)}return this.active[e]},"get");Vw.prototype.createContext=a(function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=Ic,vf){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-CREATED Context: (${this.name}) currentUid:${Ic} asyncHooksCurrentId:${r} triggerId:${n} len:${this._set.length} context:${xc.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},"createContext");Vw.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{if(vf){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} context:${xc.inspect(r)}`)}return e(r),r}catch(n){throw n&&(n[SNe]=r),n}finally{if(vf){let n=cd.triggerAsyncId(),o=cd.executionAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-RUN END: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${o} len:${this._set.length} ${xc.inspect(r)}`)}this.exit(r)}},"run");Vw.prototype.runAndReturn=a(function(e){let r;return this.run(function(n){r=e(n)}),r},"runAndReturn");Vw.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return vf&&Fd("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),n.then(o=>(vf&&Fd("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),this.exit(r),o)).catch(o=>{throw o[SNe]=r,vf&&Fd("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+Ic+" len:"+this._set.length+" "+xc.inspect(r)),this.exit(r),o})},"runPromise");Vw.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[SNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");Vw.prototype.enter=a(function(e){if(ZF.ok(e,"context must be provided for entering"),vf){let r=cd.executionAsyncId(),n=cd.triggerAsyncId(),o=" ".repeat(this._indent<0?0:this._indent);Fd(`${o}CONTEXT-ENTER: (${this.name}) currentUid:${Ic} triggerId:${n} asyncHooksCurrentId:${r} len:${this._set.length} ${xc.inspect(e)}`)}this._set.push(this.active),this.active=e},"enter");Vw.prototype.exit=a(function(e){if(ZF.ok(e,"context must be provided for exiting"),vf){let n=cd.executionAsyncId(),o=cd.triggerAsyncId(),s=" ".repeat(this._indent<0?0:this._indent);Fd(`${s}CONTEXT-EXIT: (${this.name}) currentUid:${Ic} triggerId:${o} asyncHooksCurrentId:${n} len:${this._set.length} ${xc.inspect(e)}`)}if(this.active===e){ZF.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(vf&&Fd("??ERROR?? context exiting but not entered - ignoring: "+xc.inspect(e)),ZF.ok(r>=0,`context not currently entered; can't exit. +`+xc.inspect(this)+` +`+xc.inspect(e))):(ZF.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");Vw.prototype.bindEmitter=a(function(e){ZF.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[bNe]||(c[bNe]=Object.create(null)),c[bNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[bNe]))return c;let l=c,u=c[bNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),j0a(e,o,s)},"bindEmitter");Vw.prototype.fromException=a(function(e){return e[SNe]},"fromException");function TAi(t){return process.namespaces[t]}a(TAi,"getNamespace");function H0a(t){ZF.ok(t,"namespace must be given a name."),vf&&Fd(`NS-CREATING NAMESPACE (${t})`);let e=new Vw(t);return e.id=Ic,cd.createHook({init(n,o,s,c){if(Ic=cd.executionAsyncId(),e.active){if(e._contexts.set(n,e.active),vf){let l=" ".repeat(e._indent<0?0:e._indent);Fd(`${l}INIT [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(Ic===0){let l=cd.triggerAsyncId(),u=e._contexts.get(l);if(u){if(e._contexts.set(n,u),vf){let d=" ".repeat(e._indent<0?0:e._indent);Fd(`${d}INIT USING CONTEXT FROM TRIGGERID [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${l} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}else if(vf){let d=" ".repeat(e._indent<0?0:e._indent);Fd(`${d}INIT MISSING CONTEXT [${o}] (${t}) asyncId:${n} currentUid:${Ic} triggerId:${l} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}}if(vf&&o==="PROMISE"){Fd(xc.inspect(c,{showHidden:!0}));let l=c.parentId,u=" ".repeat(e._indent<0?0:e._indent);Fd(`${u}INIT RESOURCE-PROMISE [${o}] (${t}) parentId:${l} asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} resource:${c}`)}},before(n){Ic=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Ic),o){if(vf){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}BEFORE (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`),e._indent+=2}e.enter(o)}else if(vf){let s=cd.triggerAsyncId(),c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}BEFORE MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} namespace._contexts:${xc.inspect(e._contexts,{showHidden:!0,depth:2,colors:!0})}`),e._indent+=2}},after(n){Ic=cd.executionAsyncId();let o;if(o=e._contexts.get(n)||e._contexts.get(Ic),o){if(vf){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}AFTER (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`)}e.exit(o)}else if(vf){let s=cd.triggerAsyncId();e._indent-=2;let c=" ".repeat(e._indent<0?0:e._indent);Fd(`${c}AFTER MISSING CONTEXT (${t}) asyncId:${n} currentUid:${Ic} triggerId:${s} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(o)}`)}},destroy(n){if(Ic=cd.executionAsyncId(),vf){let o=cd.triggerAsyncId(),s=" ".repeat(e._indent<0?0:e._indent);Fd(`${s}DESTROY (${t}) currentUid:${Ic} asyncId:${n} triggerId:${o} active:${xc.inspect(e.active,{showHidden:!0,depth:2,colors:!0})} context:${xc.inspect(e._contexts.get(Ic))}`)}e._contexts.delete(n)}}).enable(),process.namespaces[t]=e,e}a(H0a,"createNamespace");function IAi(t){let e=TAi(t);ZF.ok(e,`can't delete nonexistent namespace! "`+t+'"'),ZF.ok(e.id,"don't assign to process.namespaces directly! "+xc.inspect(e)),process.namespaces[t]=null}a(IAi,"destroyNamespace");function G0a(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){IAi(t)}),process.namespaces=Object.create(null)}a(G0a,"reset");process.namespaces={};function Fd(...t){vf&&process._rawDebug(`${xc.format(...t)}`)}a(Fd,"debug2")});var PAi=I((Wtp,RAi)=>{"use strict";p();function $0a(){}a($0a,"NextTickWrap");RAi.exports=a(function(){let e=this._hooks,r=this._state,n=process.nextTick;process.nextTick=function(){if(!r.enabled)return n.apply(process,arguments);let o=new Array(arguments.length);for(let u=0;u0&&process.once("uncaughtException",function(){e.post.call(c,l,!0),e.destroy.call(null,l)})}e.post.call(c,l,!1),e.destroy.call(null,l)},n.apply(process,o)}},"patch")});var DAi=I((Ktp,kAi)=>{"use strict";p();function V0a(){}a(V0a,"PromiseWrap");kAi.exports=a(function(){let e=this._hooks,r=this._state,n=global.Promise,o=n.prototype.then;n.prototype.then=u;function s(d,f,h,m){return typeof d!="function"?m?c(h):l(h):a(function(){e.pre.call(f,h);try{return d.apply(this,arguments)}finally{e.post.call(f,h,!1),e.destroy.call(null,h)}},"wrappedHandler")}a(s,"makeWrappedHandler");function c(d){return a(function(h){return e.destroy.call(null,d),h},"unhandledResolutionHandler")}a(c,"makeUnhandledResolutionHandler");function l(d){return a(function(h){throw e.destroy.call(null,d),h},"unhandledRejectedHandler")}a(l,"makeUnhandledRejectionHandler");function u(d,f){if(!r.enabled)return o.call(this,d,f);let h=new V0a,m=--r.counter;return e.init.call(h,m,0,null,null),o.call(this,s(d,h,m,!0),s(f,h,m,!1))}a(u,"wrappedThen")},"patchPromise")});var MAi=I((Xtp,NAi)=>{"use strict";p();var bT=require("timers");function W0a(){}a(W0a,"TimeoutWrap");function z0a(){}a(z0a,"IntervalWrap");function Y0a(){}a(Y0a,"ImmediateWrap");var K0a=new Map,J0a=new Map,Z0a=new Map,Qmr=null,qmr=!1;NAi.exports=a(function(){jmr(this._hooks,this._state,"setTimeout","clearTimeout",W0a,K0a,!0),jmr(this._hooks,this._state,"setInterval","clearInterval",z0a,J0a,!1),jmr(this._hooks,this._state,"setImmediate","clearImmediate",Y0a,Z0a,!0),global.setTimeout=bT.setTimeout,global.setInterval=bT.setInterval,global.setImmediate=bT.setImmediate,global.clearTimeout=bT.clearTimeout,global.clearInterval=bT.clearInterval,global.clearImmediate=bT.clearImmediate},"patch");function jmr(t,e,r,n,o,s,c){let l=bT[r],u=bT[n];bT[r]=function(){if(!e.enabled)return l.apply(bT,arguments);let d=new Array(arguments.length);for(let A=0;A0&&process.once("uncaughtException",function(){t.post.call(h,m,!0),s.delete(g),t.destroy.call(null,m)})}t.post.call(h,m,!1),Qmr=null,(c||qmr)&&(qmr=!1,s.delete(g),t.destroy.call(null,m))},g=l.apply(bT,d),s.set(g,m),g},bT[n]=function(d){if(Qmr===d&&d!==null)qmr=!0;else if(s.has(d)){let f=s.get(d);s.delete(d),t.destroy.call(null,f)}u.apply(bT,arguments)}}a(jmr,"patchTimer")});var Hmr=I((rrp,X0a)=>{X0a.exports={name:"async-hook-jl",description:"Inspect the life of handle objects in node",version:"1.7.6",author:"Andreas Madsen ",main:"./index.js",scripts:{test:"node ./test/runner.js && eslint ."},repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},keywords:["async","async hooks","inspect","async wrap"],license:"MIT",dependencies:{"stack-chain":"^1.3.7"},devDependencies:{async:"1.5.x","cli-color":"1.1.x",eslint:"^3.4.0",endpoint:"0.4.x"},engines:{node:"^4.7 || >=6.9 || >=7.3"}}});var LAi=I((nrp,BAi)=>{"use strict";p();var INe=process.binding("async_wrap"),ema=INe.Providers.TIMERWRAP,OAi={nextTick:PAi(),promise:DAi(),timers:MAi()},TNe=new Set;function tma(){this.enabled=!1,this.counter=0}a(tma,"State");function Gmr(){let t=this.initFns=[],e=this.preFns=[],r=this.postFns=[],n=this.destroyFns=[];this.init=function(o,s,c,l){if(s===ema){TNe.add(o);return}for(let u of t)u(o,this,s,c,l)},this.pre=function(o){if(!TNe.has(o))for(let s of e)s(o,this)},this.post=function(o,s){if(!TNe.has(o))for(let c of r)c(o,this,s)},this.destroy=function(o){if(TNe.has(o)){TNe.delete(o);return}for(let s of n)s(o)}}a(Gmr,"Hooks");Gmr.prototype.add=function(t){t.init&&this.initFns.push(t.init),t.pre&&this.preFns.push(t.pre),t.post&&this.postFns.push(t.post),t.destroy&&this.destroyFns.push(t.destroy)};function opt(t,e){let r=t.indexOf(e);r!==-1&&t.splice(r,1)}a(opt,"removeElement");Gmr.prototype.remove=function(t){t.init&&opt(this.initFns,t.init),t.pre&&opt(this.preFns,t.pre),t.post&&opt(this.postFns,t.post),t.destroy&&opt(this.destroyFns,t.destroy)};function xNe(){this._state=new tma,this._hooks=new Gmr,this.version=Hmr().version,this.providers=INe.Providers;for(let t of Object.keys(OAi))OAi[t].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),INe.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}a(xNe,"AsyncHook");BAi.exports=xNe;xNe.prototype.addHooks=function(t){this._hooks.add(t)};xNe.prototype.removeHooks=function(t){this._hooks.remove(t)};xNe.prototype.enable=function(){this._state.enabled=!0,INe.enable()};xNe.prototype.disable=function(){this._state.enabled=!1,INe.disable()}});var $mr=I((srp,rma)=>{rma.exports={name:"stack-chain",description:"API for combining call site modifiers",version:"1.3.7",author:"Andreas Madsen ",scripts:{test:"tap ./test/simple"},repository:{type:"git",url:"git://github.com/AndreasMadsen/stack-chain.git"},keywords:["stack","chain","trace","call site","concat","format"],devDependencies:{tap:"2.x.x","uglify-js":"2.5.x"},license:"MIT"}});var UAi=I((arp,FAi)=>{p();function nma(t){try{return Error.prototype.toString.call(t)}catch(e){try{return""}catch{return""}}}a(nma,"FormatErrorString");FAi.exports=a(function(e,r){var n=[];n.push(nma(e));for(var o=0;o"}catch{c=""}}n.push(" at "+c)}return n.join(` +`)},"FormatStackTrace")});var HAi=I((urp,jAi)=>{p();var spt=UAi();function qAi(){this.extend=new wNe,this.filter=new wNe,this.format=new RNe,this.version=$mr().version}a(qAi,"stackChain");var Wmr=!1;qAi.prototype.callSite=a(function t(e){e||(e={}),Wmr=!0;var r={};Error.captureStackTrace(r,t);var n=r.stack;return Wmr=!1,n=n.slice(e.slice||0),e.extend&&(n=this.extend._modify(r,n)),e.filter&&(n=this.filter._modify(r,n)),n},"collectCallSites");var IH=new qAi;function wNe(){this._modifiers=[]}a(wNe,"TraceModifier");wNe.prototype._modify=function(t,e){for(var r=0,n=this._modifiers.length;r{p();if(global._stackChain)if(global._stackChain.version===$mr().version)zmr.exports=global._stackChain;else throw new Error("Conflicting version of stack-chain found");else zmr.exports=global._stackChain=HAi()});var GAi=I((mrp,Kmr)=>{"use strict";p();var oma=LAi();if(global._asyncHook)if(global._asyncHook.version===Hmr().version)Kmr.exports=global._asyncHook;else throw new Error("Conflicting version of async-hook-jl found");else Ymr().filter.attach(function(e,r){return r.filter(function(n){let o=n.getFileName();return!(o&&o.slice(0,__dirname.length)===__dirname)})}),Kmr.exports=global._asyncHook=new oma});var KAi=I((Arp,YAi)=>{"use strict";p();var oh=require("util"),XF=require("assert"),sma=ipt(),e0e=GAi(),PNe="cls@contexts",kNe="error@context",VAi=[];for(let t in e0e.providers)VAi[e0e.providers[t]]=t;var gp=process.env.DEBUG_CLS_HOOKED,l0=-1;YAi.exports={getNamespace:WAi,createNamespace:ama,destroyNamespace:zAi,reset:cma,ERROR_SYMBOL:kNe};function Ww(t){this.name=t,this.active=null,this._set=[],this.id=null,this._contexts=new Map}a(Ww,"Namespace");Ww.prototype.set=a(function(e,r){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return gp&&ih(" SETTING KEY:"+e+"="+r+" in ns:"+this.name+" uid:"+l0+" active:"+oh.inspect(this.active,!0)),this.active[e]=r,r},"set");Ww.prototype.get=a(function(e){if(!this.active){gp&&ih(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+l0+" active:"+oh.inspect(this.active,!0));return}return gp&&ih(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+l0+" active:"+oh.inspect(this.active,!0)),this.active[e]},"get");Ww.prototype.createContext=a(function(){gp&&ih(" CREATING Context: "+this.name+" uid:"+l0+" len:"+this._set.length+" active:"+oh.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=l0,gp&&ih(" CREATED Context: "+this.name+" uid:"+l0+" len:"+this._set.length+" context:"+oh.inspect(e,!0,2,!0)),e},"createContext");Ww.prototype.run=a(function(e){let r=this.createContext();this.enter(r);try{return gp&&ih(" BEFORE RUN: "+this.name+" uid:"+l0+" len:"+this._set.length+" "+oh.inspect(r)),e(r),r}catch(n){throw n&&(n[kNe]=r),n}finally{gp&&ih(" AFTER RUN: "+this.name+" uid:"+l0+" len:"+this._set.length+" "+oh.inspect(r)),this.exit(r)}},"run");Ww.prototype.runAndReturn=a(function(e){var r;return this.run(function(n){r=e(n)}),r},"runAndReturn");Ww.prototype.runPromise=a(function(e){let r=this.createContext();this.enter(r);let n=e(r);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return gp&&ih(" BEFORE runPromise: "+this.name+" uid:"+l0+" len:"+this._set.length+" "+oh.inspect(r)),n.then(o=>(gp&&ih(" AFTER runPromise: "+this.name+" uid:"+l0+" len:"+this._set.length+" "+oh.inspect(r)),this.exit(r),o)).catch(o=>{throw o[kNe]=r,gp&&ih(" AFTER runPromise: "+this.name+" uid:"+l0+" len:"+this._set.length+" "+oh.inspect(r)),this.exit(r),o})},"runPromise");Ww.prototype.bind=a(function(e,r){r||(this.active?r=this.active:r=this.createContext());let n=this;return a(function(){n.enter(r);try{return e.apply(this,arguments)}catch(s){throw s&&(s[kNe]=r),s}finally{n.exit(r)}},"clsBind")},"bindFactory");Ww.prototype.enter=a(function(e){XF.ok(e,"context must be provided for entering"),gp&&ih(" ENTER "+this.name+" uid:"+l0+" len:"+this._set.length+" context: "+oh.inspect(e)),this._set.push(this.active),this.active=e},"enter");Ww.prototype.exit=a(function(e){if(XF.ok(e,"context must be provided for exiting"),gp&&ih(" EXIT "+this.name+" uid:"+l0+" len:"+this._set.length+" context: "+oh.inspect(e)),this.active===e){XF.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}let r=this._set.lastIndexOf(e);r<0?(gp&&ih("??ERROR?? context exiting but not entered - ignoring: "+oh.inspect(e)),XF.ok(r>=0,`context not currently entered; can't exit. +`+oh.inspect(this)+` +`+oh.inspect(e))):(XF.ok(r,"can't remove top context"),this._set.splice(r,1))},"exit");Ww.prototype.bindEmitter=a(function(e){XF.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let r=this,n="context@"+this.name;function o(c){c&&(c[PNe]||(c[PNe]=Object.create(null)),c[PNe][n]={namespace:r,context:r.active})}a(o,"attach");function s(c){if(!(c&&c[PNe]))return c;let l=c,u=c[PNe];return Object.keys(u).forEach(function(d){let f=u[d];l=f.namespace.bind(l,f.context)}),l}a(s,"bind"),sma(e,o,s)},"bindEmitter");Ww.prototype.fromException=a(function(e){return e[kNe]},"fromException");function WAi(t){return process.namespaces[t]}a(WAi,"getNamespace");function ama(t){XF.ok(t,"namespace must be given a name."),gp&&ih("CREATING NAMESPACE "+t);let e=new Ww(t);return e.id=l0,e0e.addHooks({init(r,n,o,s,c){l0=r,s?(e._contexts.set(r,e._contexts.get(s)),gp&&ih("PARENTID: "+t+" uid:"+r+" parent:"+s+" provider:"+o)):e._contexts.set(l0,e.active),gp&&ih("INIT "+t+" uid:"+r+" parent:"+s+" provider:"+VAi[o]+" active:"+oh.inspect(e.active,!0))},pre(r,n){l0=r;let o=e._contexts.get(r);o?(gp&&ih(" PRE "+t+" uid:"+r+" handle:"+apt(n)+" context:"+oh.inspect(o)),e.enter(o)):gp&&ih(" PRE MISSING CONTEXT "+t+" uid:"+r+" handle:"+apt(n))},post(r,n){l0=r;let o=e._contexts.get(r);o?(gp&&ih(" POST "+t+" uid:"+r+" handle:"+apt(n)+" context:"+oh.inspect(o)),e.exit(o)):gp&&ih(" POST MISSING CONTEXT "+t+" uid:"+r+" handle:"+apt(n))},destroy(r){l0=r,gp&&ih("DESTROY "+t+" uid:"+r+" context:"+oh.inspect(e._contexts.get(l0))+" active:"+oh.inspect(e.active,!0)),e._contexts.delete(r)}}),process.namespaces[t]=e,e}a(ama,"createNamespace");function zAi(t){let e=WAi(t);XF.ok(e,`can't delete nonexistent namespace! "`+t+'"'),XF.ok(e.id,"don't assign to process.namespaces directly! "+oh.inspect(e)),process.namespaces[t]=null}a(zAi,"destroyNamespace");function cma(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){zAi(t)}),process.namespaces=Object.create(null)}a(cma,"reset");process.namespaces={};e0e._state&&!e0e._state.enabled&&e0e.enable();function ih(t){process.env.DEBUG&&process._rawDebug(t)}a(ih,"debug2");function apt(t){if(!t)return t;if(typeof t=="function")return t.name?t.name:(t.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1];if(t.constructor&&t.constructor.name)return t.constructor.name}a(apt,"getFunctionName");if(gp){Jmr=Ymr();for($Ai in Jmr.filter._modifiers)Jmr.filter.deattach($Ai)}var Jmr,$Ai});var JAi=I((_rp,Zmr)=>{"use strict";p();var lma=_Ai();process&&lma.gte(process.versions.node,"8.0.0")?Zmr.exports=wAi():Zmr.exports=KAi()});var hyi=I((Eo,pyi)=>{p();Eo=pyi.exports=ka;var sl;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?sl=a(function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("SEMVER"),console.log.apply(console,t)},"debug"):sl=a(function(){},"debug");Eo.SEMVER_SPEC_VERSION="2.0.0";var DNe=256,cpt=Number.MAX_SAFE_INTEGER||9007199254740991,Xmr=16,uma=DNe-6,NNe=Eo.re=[],Su=Eo.safeRe=[],tr=Eo.src=[],da=0,igr="[a-zA-Z0-9-]",egr=[["\\s",1],["\\d",DNe],[igr,uma]];function hpt(t){for(var e=0;e)?=?)";var lpt=da++;tr[lpt]=tr[r0e]+"|x|X|\\*";var upt=da++;tr[upt]=tr[t0e]+"|x|X|\\*";var qX=da++;tr[qX]="[v=\\s]*("+tr[upt]+")(?:\\.("+tr[upt]+")(?:\\.("+tr[upt]+")(?:"+tr[sgr]+")?"+tr[ONe]+"?)?)?";var i0e=da++;tr[i0e]="[v=\\s]*("+tr[lpt]+")(?:\\.("+tr[lpt]+")(?:\\.("+tr[lpt]+")(?:"+tr[agr]+")?"+tr[ONe]+"?)?)?";var ryi=da++;tr[ryi]="^"+tr[a0e]+"\\s*"+tr[qX]+"$";var nyi=da++;tr[nyi]="^"+tr[a0e]+"\\s*"+tr[i0e]+"$";var iyi=da++;tr[iyi]="(?:^|[^\\d])(\\d{1,"+Xmr+"})(?:\\.(\\d{1,"+Xmr+"}))?(?:\\.(\\d{1,"+Xmr+"}))?(?:$|[^\\d])";var mpt=da++;tr[mpt]="(?:~>?)";var o0e=da++;tr[o0e]="(\\s*)"+tr[mpt]+"\\s+";NNe[o0e]=new RegExp(tr[o0e],"g");Su[o0e]=new RegExp(hpt(tr[o0e]),"g");var dma="$1~",oyi=da++;tr[oyi]="^"+tr[mpt]+tr[qX]+"$";var syi=da++;tr[syi]="^"+tr[mpt]+tr[i0e]+"$";var gpt=da++;tr[gpt]="(?:\\^)";var s0e=da++;tr[s0e]="(\\s*)"+tr[gpt]+"\\s+";NNe[s0e]=new RegExp(tr[s0e],"g");Su[s0e]=new RegExp(hpt(tr[s0e]),"g");var fma="$1^",ayi=da++;tr[ayi]="^"+tr[gpt]+tr[qX]+"$";var cyi=da++;tr[cyi]="^"+tr[gpt]+tr[i0e]+"$";var dgr=da++;tr[dgr]="^"+tr[a0e]+"\\s*("+lgr+")$|^$";var fgr=da++;tr[fgr]="^"+tr[a0e]+"\\s*("+tyi+")$|^$";var jX=da++;tr[jX]="(\\s*)"+tr[a0e]+"\\s*("+lgr+"|"+tr[qX]+")";NNe[jX]=new RegExp(tr[jX],"g");Su[jX]=new RegExp(hpt(tr[jX]),"g");var pma="$1$2$3",lyi=da++;tr[lyi]="^\\s*("+tr[qX]+")\\s+-\\s+("+tr[qX]+")\\s*$";var uyi=da++;tr[uyi]="^\\s*("+tr[i0e]+")\\s+-\\s+("+tr[i0e]+")\\s*$";var dyi=da++;tr[dyi]="(<|>)?=?\\s*\\*";for(V5=0;V5DNe)return null;var r=e.loose?Su[ugr]:Su[cgr];if(!r.test(t))return null;try{return new ka(t,e)}catch{return null}}a(HX,"parse");Eo.valid=hma;function hma(t,e){var r=HX(t,e);return r?r.version:null}a(hma,"valid");Eo.clean=mma;function mma(t,e){var r=HX(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}a(mma,"clean");Eo.SemVer=ka;function ka(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof ka){if(t.loose===e.loose)return t;t=t.version}else if(typeof t!="string")throw new TypeError("Invalid Version: "+t);if(t.length>DNe)throw new TypeError("version is longer than "+DNe+" characters");if(!(this instanceof ka))return new ka(t,e);sl("SemVer",t,e),this.options=e,this.loose=!!e.loose;var r=t.trim().match(e.loose?Su[ugr]:Su[cgr]);if(!r)throw new TypeError("Invalid Version: "+t);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>cpt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>cpt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>cpt||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(n){if(/^[0-9]+$/.test(n)){var o=+n;if(o>=0&&o=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+t)}return this.format(),this.raw=this.version,this};Eo.inc=gma;function gma(t,e,r,n){typeof r=="string"&&(n=r,r=void 0);try{return new ka(t,r).inc(e,n).version}catch{return null}}a(gma,"inc");Eo.diff=Ama;function Ama(t,e){if(pgr(t,e))return null;var r=HX(t),n=HX(e),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var s="prerelease"}for(var c in r)if((c==="major"||c==="minor"||c==="patch")&&r[c]!==n[c])return o+c;return s}a(Ama,"diff");Eo.compareIdentifiers=n0e;var ZAi=/^[0-9]+$/;function n0e(t,e){var r=ZAi.test(t),n=ZAi.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t0}a(MNe,"gt");Eo.lt=dpt;function dpt(t,e,r){return e8(t,e,r)<0}a(dpt,"lt");Eo.eq=pgr;function pgr(t,e,r){return e8(t,e,r)===0}a(pgr,"eq");Eo.neq=fyi;function fyi(t,e,r){return e8(t,e,r)!==0}a(fyi,"neq");Eo.gte=hgr;function hgr(t,e,r){return e8(t,e,r)>=0}a(hgr,"gte");Eo.lte=mgr;function mgr(t,e,r){return e8(t,e,r)<=0}a(mgr,"lte");Eo.cmp=fpt;function fpt(t,e,r,n){switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return pgr(t,r,n);case"!=":return fyi(t,r,n);case">":return MNe(t,r,n);case">=":return hgr(t,r,n);case"<":return dpt(t,r,n);case"<=":return mgr(t,r,n);default:throw new TypeError("Invalid operator: "+e)}}a(fpt,"cmp");Eo.Comparator=zw;function zw(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof zw){if(t.loose===!!e.loose)return t;t=t.value}if(!(this instanceof zw))return new zw(t,e);t=t.trim().split(/\s+/).join(" "),sl("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===BNe?this.value="":this.value=this.operator+this.semver.version,sl("comp",this)}a(zw,"Comparator");var BNe={};zw.prototype.parse=function(t){var e=this.options.loose?Su[dgr]:Su[fgr],r=t.match(e);if(!r)throw new TypeError("Invalid comparator: "+t);this.operator=r[1],this.operator==="="&&(this.operator=""),r[2]?this.semver=new ka(r[2],this.options.loose):this.semver=BNe};zw.prototype.toString=function(){return this.value};zw.prototype.test=function(t){return sl("Comparator.test",t,this.options.loose),this.semver===BNe?!0:(typeof t=="string"&&(t=new ka(t,this.options)),fpt(t,this.operator,this.semver,this.options))};zw.prototype.intersects=function(t,e){if(!(t instanceof zw))throw new TypeError("a Comparator is required");(!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1});var r;if(this.operator==="")return r=new Cf(t.value,e),ppt(this.value,r,e);if(t.operator==="")return r=new Cf(this.value,e),ppt(t.semver,r,e);var n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">"),o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<"),s=this.semver.version===t.semver.version,c=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<="),l=fpt(this.semver,"<",t.semver,e)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<"),u=fpt(this.semver,">",t.semver,e)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||s&&c||l||u};Eo.Range=Cf;function Cf(t,e){if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),t instanceof Cf)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new Cf(t.raw,e);if(t instanceof zw)return new Cf(t.value,e);if(!(this instanceof Cf))return new Cf(t,e);if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}a(Cf,"Range");Cf.prototype.format=function(){return this.range=this.set.map(function(t){return t.join(" ").trim()}).join("||").trim(),this.range};Cf.prototype.toString=function(){return this.range};Cf.prototype.parseRange=function(t){var e=this.options.loose,r=e?Su[uyi]:Su[lyi];t=t.replace(r,Oma),sl("hyphen replace",t),t=t.replace(Su[jX],pma),sl("comparator trim",t,Su[jX]),t=t.replace(Su[o0e],dma),t=t.replace(Su[s0e],fma);var n=e?Su[dgr]:Su[fgr],o=t.split(" ").map(function(s){return xma(s,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter(function(s){return!!s.match(n)})),o=o.map(function(s){return new zw(s,this.options)},this),o};Cf.prototype.intersects=function(t,e){if(!(t instanceof Cf))throw new TypeError("a Range is required");return this.set.some(function(r){return r.every(function(n){return t.set.some(function(o){return o.every(function(s){return n.intersects(s,e)})})})})};Eo.toComparators=Ima;function Ima(t,e){return new Cf(t,e).set.map(function(r){return r.map(function(n){return n.value}).join(" ").trim().split(" ")})}a(Ima,"toComparators");function xma(t,e){return sl("comp",t,e),t=Pma(t,e),sl("caret",t),t=wma(t,e),sl("tildes",t),t=Dma(t,e),sl("xrange",t),t=Mma(t,e),sl("stars",t),t}a(xma,"parseComparator");function ov(t){return!t||t.toLowerCase()==="x"||t==="*"}a(ov,"isX");function wma(t,e){return t.trim().split(/\s+/).map(function(r){return Rma(r,e)}).join(" ")}a(wma,"replaceTildes");function Rma(t,e){var r=e.loose?Su[syi]:Su[oyi];return t.replace(r,function(n,o,s,c,l){sl("tilde",t,n,o,s,c,l);var u;return ov(o)?u="":ov(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":ov(c)?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":l?(sl("replaceTilde pr",l),u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0"):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0",sl("tilde return",u),u})}a(Rma,"replaceTilde");function Pma(t,e){return t.trim().split(/\s+/).map(function(r){return kma(r,e)}).join(" ")}a(Pma,"replaceCarets");function kma(t,e){sl("caret",t,e);var r=e.loose?Su[cyi]:Su[ayi];return t.replace(r,function(n,o,s,c,l){sl("caret",t,n,o,s,c,l);var u;return ov(o)?u="":ov(s)?u=">="+o+".0.0 <"+(+o+1)+".0.0":ov(c)?o==="0"?u=">="+o+"."+s+".0 <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+".0 <"+(+o+1)+".0.0":l?(sl("replaceCaret pr",l),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+"-"+l+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+"-"+l+" <"+(+o+1)+".0.0"):(sl("no pr"),o==="0"?s==="0"?u=">="+o+"."+s+"."+c+" <"+o+"."+s+"."+(+c+1):u=">="+o+"."+s+"."+c+" <"+o+"."+(+s+1)+".0":u=">="+o+"."+s+"."+c+" <"+(+o+1)+".0.0"),sl("caret return",u),u})}a(kma,"replaceCaret");function Dma(t,e){return sl("replaceXRanges",t,e),t.split(/\s+/).map(function(r){return Nma(r,e)}).join(" ")}a(Dma,"replaceXRanges");function Nma(t,e){t=t.trim();var r=e.loose?Su[nyi]:Su[ryi];return t.replace(r,function(n,o,s,c,l,u){sl("xRange",t,n,o,s,c,l,u);var d=ov(s),f=d||ov(c),h=f||ov(l),m=h;return o==="="&&m&&(o=""),d?o===">"||o==="<"?n="<0.0.0":n="*":o&&m?(f&&(c=0),l=0,o===">"?(o=">=",f?(s=+s+1,c=0,l=0):(c=+c+1,l=0)):o==="<="&&(o="<",f?s=+s+1:c=+c+1),n=o+s+"."+c+"."+l):f?n=">="+s+".0.0 <"+(+s+1)+".0.0":h&&(n=">="+s+"."+c+".0 <"+s+"."+(+c+1)+".0"),sl("xRange return",n),n})}a(Nma,"replaceXRange");function Mma(t,e){return sl("replaceStars",t,e),t.trim().replace(Su[dyi],"")}a(Mma,"replaceStars");function Oma(t,e,r,n,o,s,c,l,u,d,f,h,m){return ov(r)?e="":ov(n)?e=">="+r+".0.0":ov(o)?e=">="+r+"."+n+".0":e=">="+e,ov(u)?l="":ov(d)?l="<"+(+u+1)+".0.0":ov(f)?l="<"+u+"."+(+d+1)+".0":h?l="<="+u+"."+d+"."+f+"-"+h:l="<="+l,(e+" "+l).trim()}a(Oma,"hyphenReplace");Cf.prototype.test=function(t){if(!t)return!1;typeof t=="string"&&(t=new ka(t,this.options));for(var e=0;e0){var o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}a(Bma,"testSet");Eo.satisfies=ppt;function ppt(t,e,r){try{e=new Cf(e,r)}catch{return!1}return e.test(t)}a(ppt,"satisfies");Eo.maxSatisfying=Lma;function Lma(t,e,r){var n=null,o=null;try{var s=new Cf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===-1)&&(n=c,o=new ka(n,r))}),n}a(Lma,"maxSatisfying");Eo.minSatisfying=Fma;function Fma(t,e,r){var n=null,o=null;try{var s=new Cf(e,r)}catch{return null}return t.forEach(function(c){s.test(c)&&(!n||o.compare(c)===1)&&(n=c,o=new ka(n,r))}),n}a(Fma,"minSatisfying");Eo.minVersion=Uma;function Uma(t,e){t=new Cf(t,e);var r=new ka("0.0.0");if(t.test(r)||(r=new ka("0.0.0-0"),t.test(r)))return r;r=null;for(var n=0;n":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!r||MNe(r,c))&&(r=c);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+s.operator)}})}return r&&t.test(r)?r:null}a(Uma,"minVersion");Eo.validRange=Qma;function Qma(t,e){try{return new Cf(t,e).range||"*"}catch{return null}}a(Qma,"validRange");Eo.ltr=qma;function qma(t,e,r){return ggr(t,e,"<",r)}a(qma,"ltr");Eo.gtr=jma;function jma(t,e,r){return ggr(t,e,">",r)}a(jma,"gtr");Eo.outside=ggr;function ggr(t,e,r,n){t=new ka(t,n),e=new Cf(e,n);var o,s,c,l,u;switch(r){case">":o=MNe,s=mgr,c=dpt,l=">",u=">=";break;case"<":o=dpt,s=hgr,c=MNe,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ppt(t,e,n))return!1;for(var d=0;d=0.0.0")),h=h||g,m=m||g,o(g.semver,h.semver,n)?h=g:c(g.semver,m.semver,n)&&(m=g)}),h.operator===l||h.operator===u||(!m.operator||m.operator===l)&&s(t,m.semver))return!1;if(m.operator===u&&c(t,m.semver))return!1}return!0}a(ggr,"outside");Eo.prerelease=Hma;function Hma(t,e){var r=HX(t,e);return r&&r.prerelease.length?r.prerelease:null}a(Hma,"prerelease");Eo.intersects=Gma;function Gma(t,e,r){return t=new Cf(t,r),e=new Cf(e,r),t.intersects(e)}a(Gma,"intersects");Eo.coerce=$ma;function $ma(t){if(t instanceof ka)return t;if(typeof t!="string")return null;var e=t.match(Su[iyi]);return e==null?null:HX(e[1]+"."+(e[2]||"0")+"."+(e[3]||"0"))}a($ma,"coerce")});var Ayi=I((Srp,gyi)=>{p();var Vma=khe().wrap,ygr=1,Egr=2,_gr=4,ypt=8,Hl=[],Wma=0,EE=!1,xH=[],c0e,vgr;function Cgr(t,e){var r=t.length,n=e.length,o=[];if(r===0&&n===0)return o;for(var s=0;s0&&(Hl=xH.pop()),l0e=void 0,n&&!EE},"asyncCatcher"),vgr=a(function(e,r,n){var o=[];EE=!0;for(var s=0;s0&&r[u].before(this,o[r[u].uid]);EE=!1;var d=e.apply(this,arguments);for(EE=!0,u=0;u0&&r[u].after(this,o[r[u].uid]);return EE=!1,Hl=xH.pop(),l0e=void 0,d}},"asyncWrap"),Vma(process,"_fatalException",function(t){return a(function(r){return c0e(r)||t(r)},"_asyncFatalException")})):(Agr=!1,c0e=a(function(e){if(Agr)throw e;for(var r=!1,n=Hl.length,o=0;o0&&r[f].before(this,o[r[f].uid]);EE=!1;var h;try{h=e.apply(this,arguments)}catch(m){u=!0;for(var f=0;f0&&r[f].after(this,o[r[f].uid]);EE=!1}Hl=xH.pop()}return h}},"asyncWrap"),process.addListener("uncaughtException",c0e));var Apt,l0e,Agr;function zma(t,e,r){EE=!0;for(var n=0;n0)return vgr(t,r,e);return zma(t,r,e)}a(Yma,"wrapCallback");function W5(t,e){typeof t.create=="function"&&(this.create=t.create,this.flags|=ygr),typeof t.before=="function"&&(this.before=t.before,this.flags|=Egr),typeof t.after=="function"&&(this.after=t.after,this.flags|=_gr),typeof t.error=="function"&&(this.error=t.error,this.flags|=ypt),this.uid=++Wma,this.data=e===void 0?null:e}a(W5,"AsyncListener");W5.prototype.create=void 0;W5.prototype.before=void 0;W5.prototype.after=void 0;W5.prototype.error=void 0;W5.prototype.data=void 0;W5.prototype.uid=0;W5.prototype.flags=0;function myi(t,e){if(typeof t!="object"||!t)throw new TypeError("callbacks argument must be an object");return t instanceof W5?t:new W5(t,e)}a(myi,"createAsyncListener");function Kma(t,e){var r;t instanceof W5?r=t:r=myi(t,e);for(var n=!1,o=0;o{"use strict";p();yyi.exports=(t,e)=>class extends t{static{a(this,"WrappedPromise")}constructor(n){var o,s;super(l);var c=this;try{n.apply(o,s)}catch(u){s[1](u)}return c;function l(u,d){o=this,s=[f,h];function f(m){return e(c,!1),u(m)}a(f,"wrappedResolve");function h(m){return e(c,!1),d(m)}a(h,"wrappedReject")}}}});var Iyi=I(()=>{"use strict";p();if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var byi=khe(),_pt=hyi(),Sb=byi.wrap,wH=byi.massWrap,bf=Ayi(),Zma=require("util"),Xma=_pt.gte(process.version,"6.0.0"),Tgr=_pt.gte(process.version,"7.0.0"),ega=_pt.gte(process.version,"8.0.0"),tga=_pt.gte(process.version,"11.0.0"),z5=require("net");Tgr&&!z5._normalizeArgs?z5._normalizeArgs=function(t){if(t.length===0)return[{},null];var e=t[0],r={};typeof e=="object"&&e!==null?r=e:sga(e)?r.path=e:(r.port=e,t.length>1&&typeof t[1]=="string"&&(r.host=t[1]));var n=t[t.length-1];return typeof n!="function"?[r,null]:[r,n]}:!Tgr&&!z5._normalizeConnectArgs&&(z5._normalizeConnectArgs=function(t){var e={};function r(o){return(o=Number(o))>=0?o:!1}a(r,"toNumber"),typeof t[0]=="object"&&t[0]!==null?e=t[0]:typeof t[0]=="string"&&r(t[0])===!1?e.path=t[0]:(e.port=t[0],typeof t[1]=="string"&&(e.host=t[1]));var n=t[t.length-1];return typeof n=="function"?[e,n]:[e]});"_setUpListenHandle"in z5.Server.prototype?Sb(z5.Server.prototype,"_setUpListenHandle",_yi):Sb(z5.Server.prototype,"_listen2",_yi);function _yi(t){return function(){this.on("connection",function(e){e._handle&&(e._handle.onread=bf(e._handle.onread))});try{return t.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=bf(this._handle.onconnection))}}}a(_yi,"wrapSetUpListenHandle");function Syi(t){if(t&&t._handle){var e=t._handle;e._originalOnread||(e._originalOnread=e.onread),e.onread=bf(e._originalOnread)}}a(Syi,"patchOnRead");Sb(z5.Socket.prototype,"connect",function(t){return function(){var e;ega&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?e=arguments[0]:e=Tgr?z5._normalizeArgs(arguments):z5._normalizeConnectArgs(arguments),e[1]&&(e[1]=bf(e[1]));var r=t.apply(this,e);return Syi(this),r}});var rga=require("http");Sb(rga.Agent.prototype,"addRequest",function(t){return function(e){var r=e.onSocket;return e.onSocket=bf(function(n){return Syi(n),r.apply(this,arguments)}),t.apply(this,arguments)}});var bgr=require("child_process");function vyi(t){Array.isArray(t.stdio)&&t.stdio.forEach(function(e){e&&e._handle&&(e._handle.onread=bf(e._handle.onread),Sb(e._handle,"close",vpt))}),t._handle&&(t._handle.onexit=bf(t._handle.onexit))}a(vyi,"wrapChildProcess");bgr.ChildProcess?Sb(bgr.ChildProcess.prototype,"spawn",function(t){return function(){var e=t.apply(this,arguments);return vyi(this),e}}):wH(bgr,["execFile","fork","spawn"],function(t){return function(){var e=t.apply(this,arguments);return vyi(e),e}});process._fatalException||(process._originalNextTick=process.nextTick);var wgr=[];process._nextDomainTick&&wgr.push("_nextDomainTick");process._tickDomainCallback&&wgr.push("_tickDomainCallback");wH(process,wgr,Y5);Sb(process,"nextTick",vpt);var Rgr=["setTimeout","setInterval"];global.setImmediate&&Rgr.push("setImmediate");var Tyi=require("timers"),nga=global.setTimeout===Tyi.setTimeout;wH(Tyi,Rgr,vpt);nga&&wH(global,Rgr,vpt);var Igr=require("dns");wH(Igr,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],Y5);Igr.resolveNaptr&&Sb(Igr,"resolveNaptr",Y5);var $X=require("fs");wH($X,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],Y5);$X.lchown&&Sb($X,"lchown",Y5);$X.lchmod&&Sb($X,"lchmod",Y5);$X.ftruncate&&Sb($X,"ftruncate",Y5);var LNe;try{LNe=require("zlib")}catch{}LNe&&LNe.Deflate&&LNe.Deflate.prototype&&(GX=Object.getPrototypeOf(LNe.Deflate.prototype),GX._transform?Sb(GX,"_transform",Y5):GX.write&&GX.flush&&GX.end&&wH(GX,["write","flush","end"],Y5));var GX,xgr;try{xgr=require("crypto")}catch{}xgr&&(Sgr=["pbkdf2","randomBytes"],tga||Sgr.push("pseudoRandomBytes"),wH(xgr,Sgr,Y5));var Sgr,Ept=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";Ept&&(Cyi=process.addAsyncListener({create:a(function(){Ept=!1},"create")}),global.Promise.resolve(!0).then(a(function(){Ept=!1},"notSync")),process.removeAsyncListener(Cyi));var Cyi;Ept&&iga();function iga(){var t=global.Promise;function e(c){if(!(this instanceof e))return t(c);if(typeof c!="function")return new t(c);var l,u,d=new t(f);d.__proto__=e.prototype;try{c.apply(l,u)}catch(h){u[1](h)}return d;function f(h,m){l=this,u=[g,A];function g(y){return n(d,!1),h(y)}a(g,"wrappedResolve");function A(y){return n(d,!1),m(y)}a(A,"wrappedReject")}}if(a(e,"wrappedPromise"),Zma.inherits(e,t),Sb(t.prototype,"then",s),t.prototype.chain&&Sb(t.prototype,"chain",s),Xma)global.Promise=Eyi()(t,n);else{var r=["all","race","reject","resolve","accept","defer"];r.forEach(function(c){typeof t[c]=="function"&&(e[c]=t[c])}),global.Promise=e}function n(c,l){(!c.__asl_wrapper||l)&&(c.__asl_wrapper=bf(o))}a(n,"ensureAslWrapper");function o(c,l,u,d){var f;try{return f=l.call(c,u),{returnVal:f,error:!1}}catch(h){return{errorVal:h,error:!0}}finally{f instanceof t?d.__asl_wrapper=a(function(){var m=f.__asl_wrapper||o;return m.apply(this,arguments)},"proxyWrapper"):n(d,!0)}}a(o,"propagateAslWrapper");function s(c){return a(function(){var u=this,d=c.apply(u,Array.prototype.map.call(arguments,f));return d.__asl_wrapper=a(function(m,g,A,y){return u.__asl_wrapper?(u.__asl_wrapper(m,function(){},null,d),d.__asl_wrapper(m,g,A,y)):o(m,g,A,y)},"proxyWrapper"),d;function f(h){return typeof h!="function"?h:bf(function(m){var g=(u.__asl_wrapper||o)(this,h,m,d);if(g.error)throw g.errorVal;return g.returnVal})}a(f,"bind")},"wrappedThen")}a(s,"wrapThen")}a(iga,"wrapPromise");function Y5(t){var e=a(function(){var r,n=arguments.length-1;if(typeof arguments[n]=="function"){r=Array(arguments.length);for(var o=0;o=0?t:!1}a(oga,"toNumber");function sga(t){return typeof t=="string"&&oga(t)===!1}a(sga,"isPipeName")});var kyi=I((Orp,Pyi)=>{"use strict";p();var t8=require("assert"),aga=ipt(),FNe="cls@contexts",Pgr="error@context";process.addAsyncListener||Iyi();function R2(t){this.name=t,this.active=null,this._set=[],this.id=null}a(R2,"Namespace");R2.prototype.set=function(t,e){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[t]=e,e};R2.prototype.get=function(t){if(this.active)return this.active[t]};R2.prototype.createContext=function(){return Object.create(this.active)};R2.prototype.run=function(t){var e=this.createContext();this.enter(e);try{return t(e),e}catch(r){throw r&&(r[Pgr]=e),r}finally{this.exit(e)}};R2.prototype.runAndReturn=function(t){var e;return this.run(function(r){e=t(r)}),e};R2.prototype.bind=function(t,e){e||(this.active?e=this.active:e=this.createContext());var r=this;return function(){r.enter(e);try{return t.apply(this,arguments)}catch(n){throw n&&(n[Pgr]=e),n}finally{r.exit(e)}}};R2.prototype.enter=function(t){t8.ok(t,"context must be provided for entering"),this._set.push(this.active),this.active=t};R2.prototype.exit=function(t){if(t8.ok(t,"context must be provided for exiting"),this.active===t){t8.ok(this._set.length,"can't remove top context"),this.active=this._set.pop();return}var e=this._set.lastIndexOf(t);t8.ok(e>=0,"context not currently entered; can't exit"),t8.ok(e,"can't remove top context"),this._set.splice(e,1)};R2.prototype.bindEmitter=function(t){t8.ok(t.on&&t.addListener&&t.emit,"can only bind real EEs");var e=this,r="context@"+this.name;function n(s){s&&(s[FNe]||(s[FNe]=Object.create(null)),s[FNe][r]={namespace:e,context:e.active})}a(n,"attach");function o(s){if(!(s&&s[FNe]))return s;var c=s,l=s[FNe];return Object.keys(l).forEach(function(u){var d=l[u];c=d.namespace.bind(c,d.context)}),c}a(o,"bind"),aga(t,n,o)};R2.prototype.fromException=function(t){return t[Pgr]};function xyi(t){return process.namespaces[t]}a(xyi,"get");function cga(t){t8.ok(t,"namespace must be given a name!");var e=new R2(t);return e.id=process.addAsyncListener({create:a(function(){return e.active},"create"),before:a(function(r,n){n&&e.enter(n)},"before"),after:a(function(r,n){n&&e.exit(n)},"after"),error:a(function(r){r&&e.exit(r)},"error")}),process.namespaces[t]=e,e}a(cga,"create");function wyi(t){var e=xyi(t);t8.ok(e,"can't delete nonexistent namespace!"),t8.ok(e.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(e.id),process.namespaces[t]=null}a(wyi,"destroy");function Ryi(){process.namespaces&&Object.keys(process.namespaces).forEach(function(t){wyi(t)}),process.namespaces=Object.create(null)}a(Ryi,"reset");process.namespaces||Ryi();Pyi.exports={getNamespace:xyi,createNamespace:cga,destroyNamespace:wyi,reset:Ryi}});var PH=I(K5=>{"use strict";p();var lga=K5&&K5.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uga=K5&&K5.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dga=K5&&K5.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lga(e,t,r);return uga(e,t),e};Object.defineProperty(K5,"__esModule",{value:!0});K5.CorrelationContextManager=void 0;var RH=jl(),fga=dga(jft()),VX=Hft(),kgr=tmr(),Dyi=vmr(),u0e=VA(),pga=(function(){function t(){}return a(t,"CorrelationContextManager"),t.getCurrentContext=function(){if(!t.enabled)return null;var e=t.session.get(t.CONTEXT_NAME);return e===void 0?null:e},t.generateContextObject=function(e,r,n,o,s,c){return r=r||e,this.enabled?{operation:{name:n,id:e,parentId:r,traceparent:s,tracestate:c},customProperties:new hga(o)}:null},t.spanToContextObject=function(e,r,n){var o=new VX;return o.traceId=e.traceId,o.spanId=e.spanId,o.traceFlag=VX.formatOpenTelemetryTraceFlags(e.traceFlags)||VX.DEFAULT_TRACE_FLAG,o.parentId=r,t.generateContextObject(o.traceId,o.parentId,n,null,o)},t.runWithContext=function(e,r){var n;if(t.enabled)try{return t.session.bind(r,(n={},n[t.CONTEXT_NAME]=e,n))()}catch(o){RH.warn("Error binding to session context",u0e.dumpObj(o))}return r()},t.wrapEmitter=function(e){if(t.enabled)try{t.session.bindEmitter(e)}catch(r){RH.warn("Error binding to session context",u0e.dumpObj(r))}},t.wrapCallback=function(e,r){var n;if(t.enabled)try{return t.session.bind(e,r?(n={},n[t.CONTEXT_NAME]=r,n):void 0)}catch(o){RH.warn("Error binding to session context",u0e.dumpObj(o))}return e},t.enable=function(e){if(!this.enabled){if(!this.isNodeVersionCompatible()){this.enabled=!1;return}if(!t.hasEverEnabled){this.forceClsHooked=e,this.hasEverEnabled=!0,typeof this.cls>"u"&&(t.forceClsHooked===!0||t.forceClsHooked===void 0&&t.shouldUseClsHooked()?this.cls=JAi():this.cls=kyi());try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(r){RH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",u0e.dumpObj(r)),this.enabled=!1;return}fga.registerContextPreservation(function(r){try{return t.session.bind(r)}catch(n){RH.warn("Error binding to session context",u0e.dumpObj(n))}})}this.enabled=!0}},t.startOperation=function(e,r){var n=e&&e.traceContext||null,o=e&&e.spanContext?e:null,s=e&&e.traceId?e:null,c=e&&e.headers;if(o)return this.spanToContextObject(o.spanContext(),o.parentSpanId,o.name);if(s)return this.spanToContextObject(s,"|".concat(s.traceId,".").concat(s.spanId,"."),typeof r=="string"?r:"");var l=typeof r=="string"?r:"";if(n){var u=null,d=null;if(l=n.attributes.OperationName||l,r){var f=r;f.headers&&(f.headers.traceparent?u=new VX(f.headers.traceparent):f.headers["request-id"]&&(u=new VX(null,f.headers["request-id"])),f.headers.tracestate&&(d=new kgr(f.headers.tracestate)))}u||(u=new VX(n.traceParent||n.traceparent)),d||(d=new kgr(n.traceState||n.tracestate));var h=void 0;if(typeof r=="object"){var m=new Dyi(r);h=m.getCorrelationContextHeader(),l=m.getOperationName({})}var g=t.generateContextObject(u.traceId,u.parentId,l,h,u,d);return g}if(c){var u=new VX(c.traceparent?c.traceparent.toString():null),d=new kgr(c.tracestate?c.tracestate.toString():null),m=new Dyi(e),g=t.generateContextObject(u.traceId,u.parentId,m.getOperationName({}),m.getCorrelationContextHeader(),u,d);return g}return RH.warn("startOperation was called with invalid arguments",arguments),null},t.disable=function(){this.enabled=!1},t.reset=function(){if(t.hasEverEnabled){t.session=null;try{t.session=this.cls.createNamespace("AI-CLS-Session")}catch(e){RH.warn("Failed to create AI-CLS-Session namespace. Correlation of requests may be lost",u0e.dumpObj(e)),this.enabled=!1;return}}},t.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},t.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},t.canUseClsHooked=function(){var e=process.versions.node.split("."),r=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,o=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(r&&n)&&o},t.enabled=!1,t.hasEverEnabled=!1,t.forceClsHooked=void 0,t.CONTEXT_NAME="ApplicationInsights-Context",t})();K5.CorrelationContextManager=pga;var hga=(function(){function t(e){this.props=[],this.addHeaderData(e)}return a(t,"CustomPropertiesImpl"),t.prototype.addHeaderData=function(e){var r=e?e.split(", "):[];this.props=r.map(function(n){var o=n.split("=");return{key:o[0],value:o[1]}}).concat(this.props)},t.prototype.serializeToHeader=function(){return this.props.map(function(e){return"".concat(e.key,"=").concat(e.value)}).join(", ")},t.prototype.getProperty=function(e){for(var r=0;r'+r+""+s,n},"insertSnippetByIndex");Do.insertSnippetByIndex=fAa;var pAa=a(function(t){var e=!1,r=t.getHeader("Content-Type");return r&&(typeof r=="string"?e=r.indexOf("html")>=0:e=r.toString().indexOf("html")>=0),e},"isContentTypeHeaderHtml");Do.isContentTypeHeaderHtml=pAa});var Fgr=I((Cnp,Zyi)=>{"use strict";p();var Jyi=ad(),hAa=(function(){function t(){}return a(t,"ConnectionStringParser"),t.parse=function(e){if(!e)return{};var r=e.split(t._FIELDS_SEPARATOR),n=r.reduce(function(s,c){var l=c.split(t._FIELD_KEY_VALUE_SEPARATOR);if(l.length===2){var u=l[0].toLowerCase(),d=l[1];s[u]=d}return s},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var o=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+o+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+o+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||Jyi.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||Jyi.DEFAULT_LIVEMETRICS_ENDPOINT}return n},t.isIkeyValid=function(e){if(!e||e=="")return!1;var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t._FIELDS_SEPARATOR=";",t._FIELD_KEY_VALUE_SEPARATOR="=",t})();Zyi.exports=hAa});var Xyi={};xi(Xyi,{webSnippet:()=>mAa});var mAa,eEi=_e(()=>{p();mAa=`!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a{"use strict";p();var Syi=require("http"),Tyi=require("https"),v0e=require("zlib"),r4=$l(),Jw=Eyi(),Iyi=kgr(),KNe=ad(),xyi=Pgr(),WAa=(byi(),Ca(vyi)),zAa=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=KNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=KNe.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(KNe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(KNe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=xyi.parse(e),o=n.instrumentationkey||"";xyi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,r4.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){r4.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=Iyi.getOsPrefix(),n=Iyi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r +}});`});var sEi=I((Inp,oEi)=>{"use strict";p();var tEi=require("http"),rEi=require("https"),h0e=require("zlib"),J5=jl(),Kw=Kyi(),nEi=Lgr(),QNe=ad(),iEi=Fgr(),gAa=(eEi(),ya(Xyi)),AAa=(function(){function t(e){var r;if(this._isIkeyValid=!0,t.INSTANCE)throw new Error("Web snippet injection should be configured from the applicationInsights object");t.INSTANCE=this,t._aiUrl=QNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,t._aiDeprecatedUrl=QNe.WEB_INSTRUMENTATION_DEPRECATED_SOURCE;var n=this._getWebSnippetIkey((r=e.config)===null||r===void 0?void 0:r.webInstrumentationConnectionString);this._webInstrumentationIkey=n||e.config.instrumentationKey,this._clientWebInstrumentationConfig=e.config.webInstrumentationConfig,this._clientWebInstrumentationSrc=e.config.webInstrumentationSrc,this._statsbeat=e?.getStatsbeat()}return a(t,"WebSnippet"),t.prototype.enable=function(e,r){this._isEnabled=e,this._webInstrumentationIkey=this._getWebSnippetIkey(r)||this._webInstrumentationIkey,t._snippet=this._getWebInstrumentationReplacedStr(),this._isEnabled&&!this._isInitialized&&this._isIkeyValid?(this._statsbeat&&this._statsbeat.addFeature(QNe.StatsbeatFeature.BROWSER_SDK_LOADER),this._initialize()):this._isEnabled||this._statsbeat&&this._statsbeat.removeFeature(QNe.StatsbeatFeature.BROWSER_SDK_LOADER)},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype._getWebSnippetIkey=function(e){var r=null;try{var n=iEi.parse(e),o=n.instrumentationkey||"";iEi.isIkeyValid(o)?(this._isIkeyValid=!0,r=o):(this._isIkeyValid=!1,J5.info("Invalid web Instrumentation connection string, web Instrumentation is not enabled."))}catch(s){J5.info("get web snippet ikey error: "+s)}return r},t.prototype._getWebInstrumentationReplacedStr=function(){var e=this._getClientWebInstrumentationConfigStr(this._clientWebInstrumentationConfig),r=nEi.getOsPrefix(),n=nEi.getResourceProvider(),o="".concat(this._webInstrumentationIkey,`",\r `).concat(e,` disableIkeyDeprecationMessage: true,\r - sdkExtension: "`).concat(n).concat(r,"d_n_"),s=WAa.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(KNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r + sdkExtension: "`).concat(n).concat(r,"d_n_"),s=gAa.webSnippet.replace("INSTRUMENTATION_KEY",o);return this._clientWebInstrumentationSrc?s.replace("".concat(QNe.WEB_INSTRUMENTATION_DEFAULT_SOURCE,".2.min.js"),this._clientWebInstrumentationSrc):s},t.prototype._getClientWebInstrumentationConfigStr=function(e){var r="";try{e!=null&&e.length>0&&e.forEach(function(n){var o=n.name;if(o!==void 0){var s=n.value,c="";switch(typeof s){case"function":break;case"object":break;case"string":c=" ".concat(o,': "').concat(s,`",\r `),r+=c;break;default:c=" ".concat(o,": ").concat(s,`,\r -`),r+=c;break}}})}catch{this._isEnabled=!1,r4.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=Syi.createServer,r=Tyi.createServer,n=this._isEnabled;Syi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=Jw.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){r4.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=Jw.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){r4.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},Tyi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var E=Jw.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){r4.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=Jw.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){r4.warn("Inject snippet error: "+b)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=Jw.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){r4.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=Jw.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=Jw.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){r4.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case Jw.contentEncodingMethod.GZIP:var o=v0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=v0e.gzipSync(s)}break;case Jw.contentEncodingMethod.DEFLATE:var c=v0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=v0e.deflateSync(l)}break;case Jw.contentEncodingMethod.BR:var u=Jw.getBrotliDecompressSync(v0e),d=Jw.getBrotliCompressSync(v0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){r4.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();wyi.exports=zAa});var Pyi=I((Ngr,kyi)=>{"use strict";p();var YAa=Ngr&&Ngr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Zw=require("url"),Dgr=_E(),KAa=qA(),JAa=Zhe(),ZAa=umr(),XAa=QX(),eya=(function(t){YAa(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=KAa.getCorrelationContextTarget(r,JAa.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=Dgr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new Zw.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=Dgr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==XAa.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=Dgr.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new Zw.URL(r)}catch{}else try{var o=new Zw.URL("http://"+r);o.port==="443"?r=new Zw.URL("https://"+r):r=new Zw.URL("http://"+r)}catch{}else{if(r&&typeof Zw.URL=="function"&&r instanceof Zw.URL)return Zw.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new Zw.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new Zw.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new Zw.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",Zw.format(r)},e})(ZAa);kyi.exports=eya});var Dyi=I(b0e=>{"use strict";p();var Mpt=b0e&&b0e.__assign||function(){return Mpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var oya=f8&&f8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sya=f8&&f8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aya=f8&&f8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&oya(e,t,r);return sya(e,t),e};Object.defineProperty(f8,"__esModule",{value:!0});f8.spanToTelemetryContract=hya;var Nyi=require("url"),D2=(co(),Ca(v5)),ms=(gft(),Ca(_0r)),d8=aya(ad()),cya=Dyi(),lya=qA();function uya(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=lya.stringify(s)),e}a(uya,"createPropertiesFromSpan");function dya(t){return t===ms.DbSystemValues.DB2||t===ms.DbSystemValues.DERBY||t===ms.DbSystemValues.MARIADB||t===ms.DbSystemValues.MSSQL||t===ms.DbSystemValues.ORACLE||t===ms.DbSystemValues.SQLITE||t===ms.DbSystemValues.OTHER_SQL||t===ms.DbSystemValues.HSQLDB||t===ms.DbSystemValues.H2}a(dya,"isSqlDB");function Myi(t){var e=t.attributes[ms.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[ms.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[ms.SemanticAttributes.HTTP_SCHEME],o=t.attributes[ms.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[ms.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[ms.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[ms.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[ms.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(Myi,"getUrl");function Ogr(t){var e=t.attributes[ms.SemanticAttributes.PEER_SERVICE],r=t.attributes[ms.SemanticAttributes.HTTP_HOST],n=t.attributes[ms.SemanticAttributes.HTTP_URL],o=t.attributes[ms.SemanticAttributes.NET_PEER_NAME],s=t.attributes[ms.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(Ogr,"getDependencyTarget");function fya(t){var e={name:t.name,success:t.status.code!=D2.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===D2.SpanKind.PRODUCER&&(e.dependencyTypeName=d8.DependencyTypeName.QueueMessage),t.kind===D2.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=d8.DependencyTypeName.InProc);var r=t.attributes[ms.SemanticAttributes.HTTP_METHOD],n=t.attributes[ms.SemanticAttributes.DB_SYSTEM],o=t.attributes[ms.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=d8.DependencyTypeName.Http;var s=t.attributes[ms.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new Nyi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=Myi(t);var u=t.attributes[ms.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=Ogr(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===ms.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===ms.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===ms.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===ms.DbSystemValues.REDIS?e.dependencyTypeName="redis":dya(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[ms.SemanticAttributes.DB_STATEMENT],y=t.attributes[ms.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=Ogr(t),E=t.attributes[ms.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=d8.DependencyTypeName.Grpc;var _=t.attributes[ms.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=Ogr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(fya,"createDependencyData");function pya(t){var e={name:t.name,success:t.status.code!=D2.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[ms.SemanticAttributes.HTTP_METHOD],n=t.attributes[ms.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==D2.SpanKind.SERVER){var o=t.attributes[ms.SemanticAttributes.HTTP_ROUTE],s=t.attributes[ms.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new Nyi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=Myi(t);var l=t.attributes[ms.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(pya,"createRequestData");function hya(t){var e;switch(t.kind){case D2.SpanKind.CLIENT:case D2.SpanKind.PRODUCER:case D2.SpanKind.INTERNAL:e=fya(t);break;case D2.SpanKind.SERVER:case D2.SpanKind.CONSUMER:e=pya(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=uya(t),t.attributes[d8.AzNamespace]&&(t.kind===D2.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(d8.DependencyTypeName.InProc," | ").concat(t.attributes[d8.AzNamespace])),t.attributes[d8.AzNamespace]===d8.MicrosoftEventHub&&(0,cya.parseEventHubSpan)(t,e)),e}a(hya,"spanToTelemetryContract")});var Lyi=I(HH=>{"use strict";p();var S0e=HH&&HH.__assign||function(){return S0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var gya=wT&&wT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Aya=wT&&wT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),yya=wT&&wT.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gya(e,t,r);return Aya(e,t),e};Object.defineProperty(wT,"__esModule",{value:!0});wT.subscriber=void 0;wT.enable=bya;var ZNe=(co(),Ca(v5)),Eya=ad(),Bgr=dp(),_ya=yya(Oyi()),Cya=Lyi(),eee=[],vya=a(function(t){try{var e=t.data,r=_ya.spanToTelemetryContract(e);Cya.AsyncScopeManager.with(e,function(){eee.forEach(function(n){e.kind===ZNe.SpanKind.SERVER||e.kind===ZNe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===ZNe.SpanKind.CLIENT||e.kind===ZNe.SpanKind.INTERNAL||e.kind===ZNe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");wT.subscriber=vya;function bya(t,e){if(t){var r=eee.find(function(n){return n==e});if(r)return;eee.length===0&&Bgr.channel.subscribe("azure-coretracing",wT.subscriber,Bgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Eya.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),eee.push(e)}else eee=eee.filter(function(n){return n!=e}),eee.length===0&&Bgr.channel.unsubscribe("azure-coretracing",wT.subscriber)}a(bya,"enable")});var Uyi=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.subscriber=void 0;ree.enable=Iya;var Sya=ad(),Lgr=dp(),tee=[],Tya=a(function(t){t.data.event.commandName!=="ismaster"&&tee.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");ree.subscriber=Tya;function Iya(t,e){if(t){var r=tee.find(function(n){return n==e});if(r)return;tee.length===0&&Lgr.channel.subscribe("mongodb",ree.subscriber,Lgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Sya.StatsbeatInstrumentation.MONGODB)}),tee.push(e)}else tee=tee.filter(function(n){return n!=e}),tee.length===0&&Lgr.channel.unsubscribe("mongodb",ree.subscriber)}a(Iya,"enable")});var Qyi=I(iee=>{"use strict";p();Object.defineProperty(iee,"__esModule",{value:!0});iee.subscriber=void 0;iee.enable=Rya;var xya=ad(),Fgr=dp(),nee=[],wya=a(function(t){nee.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");iee.subscriber=wya;function Rya(t,e){if(t){var r=nee.find(function(n){return n==e});if(r)return;nee.length===0&&Fgr.channel.subscribe("mysql",iee.subscriber,Fgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(xya.StatsbeatInstrumentation.MYSQL)}),nee.push(e)}else nee=nee.filter(function(n){return n!=e}),nee.length===0&&Fgr.channel.unsubscribe("mysql",iee.subscriber)}a(Rya,"enable")});var qyi=I(see=>{"use strict";p();Object.defineProperty(see,"__esModule",{value:!0});see.subscriber=void 0;see.enable=Dya;var kya=ad(),Ugr=dp(),oee=[],Pya=a(function(t){oee.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");see.subscriber=Pya;function Dya(t,e){if(t){var r=oee.find(function(n){return n==e});if(r)return;oee.length===0&&Ugr.channel.subscribe("redis",see.subscriber,Ugr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(kya.StatsbeatInstrumentation.REDIS)}),oee.push(e)}else oee=oee.filter(function(n){return n!=e}),oee.length===0&&Ugr.channel.unsubscribe("redis",see.subscriber)}a(Dya,"enable")});var jyi=I(cee=>{"use strict";p();Object.defineProperty(cee,"__esModule",{value:!0});cee.subscriber=void 0;cee.enable=Oya;var Nya=ad(),Qgr=dp(),aee=[],Mya=a(function(t){aee.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");cee.subscriber=Mya;function Oya(t,e){if(t){var r=aee.find(function(n){return n==e});if(r)return;aee.length===0&&Qgr.channel.subscribe("postgres",cee.subscriber,Qgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(Nya.StatsbeatInstrumentation.POSTGRES)}),aee.push(e)}else aee=aee.filter(function(n){return n!=e}),aee.length===0&&Qgr.channel.unsubscribe("postgres",cee.subscriber)}a(Oya,"enable")});var x0e=I((p8,Hyi)=>{"use strict";p();var Bya=p8&&p8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lya=p8&&p8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fya=p8&&p8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Bya(e,t,r);return Lya(e,t),e},Opt=p8&&p8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var Gyi=require("http"),$yi=require("https"),Vyi=$l(),Wyi=qA(),jya=Zhe(),jgr=hmr(),h8=FH(),Hya=wpt(),Gya=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||Hya.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?h8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&h8.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return h8.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new jgr(e),c=this._generateCorrelationContext(s);h8.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){h8.CorrelationContextManager.wrapEmitter(c),h8.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=Gyi.createServer;Gyi.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=$yi.createServer;$yi.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){Vyi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=h8.CorrelationContextManager.getCurrentContext(),o=new jgr(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){Vyi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=h8.CorrelationContextManager.getCurrentContext(),s=n||new jgr(r.request,o&&o.operation.parentId);Wyi.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(jya.requestContextHeader);Wyi.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,h8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();zyi.exports=Gya});var Jyi=I(($gr,Kyi)=>{"use strict";p();var Xw=$gr&&$gr.__assign||function(){return Xw=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:Wya,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case lee.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case lee.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case lee.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case lee.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case lee.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=Xw(Xw({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=Xw(Xw({},r),{Message:e.data.baseData.message,SeverityLevel:lee.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` -`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=Xw(Xw({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Xw(Xw({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Xw(Xw({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=Yyi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=Yyi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):Vya.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new lee.ContextTagKeys,t})();Kyi.exports=zya});var Xyi=I((hip,Zyi)=>{"use strict";p();var Yya=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");Zyi.exports={getTransmissionTime:Yya}});var nEi=I((tMe,rEi)=>{"use strict";p();var eEi=tMe&&tMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},tEi=tMe&&tMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=eR.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[eR.time]=Zya.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",Vgr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=Wgr.tlsRestrictedAgent,h=Kya.request(l,function(E){if(E.statusCode==200){var _=E.headers[eR.subscribed]==="true",v=null;try{v=E.headers[eR.endpointRedirect]?new Xya.URL(E.headers[eR.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+Wgr.dumpObj(T))}var b=E.headers[eR.pollingIntervalHint]?parseInt(E.headers[eR.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),Vgr.warn(t.TAG,r,e)):Vgr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();rEi.exports=eEa});var lEi=I((rMe,cEi)=>{"use strict";p();var iEi=rMe&&rMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},oEi=rMe&&rMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return iEi(this,void 0,void 0,function(){return oEi(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(sEi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,sEi.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();cEi.exports=nEa});var dEi=I(w0e=>{"use strict";p();var Fpt=w0e&&w0e.__assign||function(){return Fpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var fEi=$H&&$H.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},pEi=$H&&$H.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var lEa=QX(),mEi=Pgr(),uEa=$l(),gEi=ad(),dEa=require("url"),fEa=Xut(),pEa=(function(){function t(e){this._endpointBase=gEi.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=mEi.parse(e),o=mEi.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||gEi.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new dEa.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=lEa.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||uEa.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=fEa.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();AEi.exports=pEa});var Xgr=I(Zgr=>{"use strict";p();Object.defineProperty(Zgr,"__esModule",{value:!0});Zgr.createEmptyPipeline=hEa;var yEi=new Set(["Deserialize","Serialize","Retry","Sign"]),Jgr=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!yEi.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!yEi.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function hEa(){return Jgr.create()}a(hEa,"createEmptyPipeline")});var uee=I(Qpt=>{"use strict";p();Object.defineProperty(Qpt,"__esModule",{value:!0});Qpt.logger=void 0;var mEa=ift();Qpt.logger=(0,mEa.createClientLogger)("core-rest-pipeline")});var tAr=I(eAr=>{"use strict";p();Object.defineProperty(eAr,"__esModule",{value:!0});eAr.getRandomIntegerInclusive=gEa;function gEa(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(gEa,"getRandomIntegerInclusive")});var EEi=I(rAr=>{"use strict";p();Object.defineProperty(rAr,"__esModule",{value:!0});rAr.calculateRetryDelay=yEa;var AEa=tAr();function yEa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,AEa.getRandomIntegerInclusive)(0,n/2)}}a(yEa,"calculateRetryDelay")});var qpt=I(nAr=>{"use strict";p();Object.defineProperty(nAr,"__esModule",{value:!0});nAr.isObject=EEa;function EEa(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(EEa,"isObject")});var _Ei=I(iAr=>{"use strict";p();Object.defineProperty(iAr,"__esModule",{value:!0});iAr.isError=CEa;var _Ea=qpt();function CEa(t){if((0,_Ea.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(CEa,"isError")});var vEi=I(jpt=>{"use strict";p();Object.defineProperty(jpt,"__esModule",{value:!0});jpt.computeSha256Hmac=vEa;jpt.computeSha256Hash=bEa;var CEi=require("node:crypto");async function vEa(t,e,r){let n=Buffer.from(t,"base64");return(0,CEi.createHmac)("sha256",n).update(e).digest(r)}a(vEa,"computeSha256Hmac");async function bEa(t,e){return(0,CEi.createHash)("sha256").update(t).digest(e)}a(bEa,"computeSha256Hash")});var bEi=I(sAr=>{"use strict";p();var oAr;Object.defineProperty(sAr,"__esModule",{value:!0});sAr.randomUUID=IEa;var SEa=require("node:crypto"),TEa=typeof((oAr=globalThis?.crypto)===null||oAr===void 0?void 0:oAr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):SEa.randomUUID;function IEa(){return TEa()}a(IEa,"randomUUID")});var SEi=I(lm=>{"use strict";p();var aAr,cAr,lAr,uAr;Object.defineProperty(lm,"__esModule",{value:!0});lm.isReactNative=lm.isNodeRuntime=lm.isNodeLike=lm.isBun=lm.isDeno=lm.isWebWorker=lm.isBrowser=void 0;lm.isBrowser=typeof window<"u"&&typeof window.document<"u";lm.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((aAr=self.constructor)===null||aAr===void 0?void 0:aAr.name)==="DedicatedWorkerGlobalScope"||((cAr=self.constructor)===null||cAr===void 0?void 0:cAr.name)==="ServiceWorkerGlobalScope"||((lAr=self.constructor)===null||lAr===void 0?void 0:lAr.name)==="SharedWorkerGlobalScope");lm.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";lm.isBun=typeof Bun<"u"&&typeof Bun.version<"u";lm.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((uAr=globalThis.process.versions)===null||uAr===void 0)&&uAr.node);lm.isNodeRuntime=lm.isNodeLike&&!lm.isBun&&!lm.isDeno;lm.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var TEi=I(Hpt=>{"use strict";p();Object.defineProperty(Hpt,"__esModule",{value:!0});Hpt.uint8ArrayToString=xEa;Hpt.stringToUint8Array=wEa;function xEa(t,e){return Buffer.from(t).toString(e)}a(xEa,"uint8ArrayToString");function wEa(t,e){return Buffer.from(t,e)}a(wEa,"stringToUint8Array")});var IEi=I(Gpt=>{"use strict";p();Object.defineProperty(Gpt,"__esModule",{value:!0});Gpt.Sanitizer=void 0;var REa=qpt(),dAr="REDACTED",kEa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],PEa=["api-version"],fAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=kEa.concat(e),r=PEa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,REa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,dAr);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=dAr;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=dAr;return r}};Gpt.Sanitizer=fAr});var $pt=I(ma=>{"use strict";p();Object.defineProperty(ma,"__esModule",{value:!0});ma.Sanitizer=ma.uint8ArrayToString=ma.stringToUint8Array=ma.isWebWorker=ma.isReactNative=ma.isDeno=ma.isNodeRuntime=ma.isNodeLike=ma.isBun=ma.isBrowser=ma.randomUUID=ma.computeSha256Hmac=ma.computeSha256Hash=ma.isError=ma.isObject=ma.getRandomIntegerInclusive=ma.calculateRetryDelay=void 0;var DEa=EEi();Object.defineProperty(ma,"calculateRetryDelay",{enumerable:!0,get:a(function(){return DEa.calculateRetryDelay},"get")});var NEa=tAr();Object.defineProperty(ma,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return NEa.getRandomIntegerInclusive},"get")});var MEa=qpt();Object.defineProperty(ma,"isObject",{enumerable:!0,get:a(function(){return MEa.isObject},"get")});var OEa=_Ei();Object.defineProperty(ma,"isError",{enumerable:!0,get:a(function(){return OEa.isError},"get")});var xEi=vEi();Object.defineProperty(ma,"computeSha256Hash",{enumerable:!0,get:a(function(){return xEi.computeSha256Hash},"get")});Object.defineProperty(ma,"computeSha256Hmac",{enumerable:!0,get:a(function(){return xEi.computeSha256Hmac},"get")});var BEa=bEi();Object.defineProperty(ma,"randomUUID",{enumerable:!0,get:a(function(){return BEa.randomUUID},"get")});var dee=SEi();Object.defineProperty(ma,"isBrowser",{enumerable:!0,get:a(function(){return dee.isBrowser},"get")});Object.defineProperty(ma,"isBun",{enumerable:!0,get:a(function(){return dee.isBun},"get")});Object.defineProperty(ma,"isNodeLike",{enumerable:!0,get:a(function(){return dee.isNodeLike},"get")});Object.defineProperty(ma,"isNodeRuntime",{enumerable:!0,get:a(function(){return dee.isNodeRuntime},"get")});Object.defineProperty(ma,"isDeno",{enumerable:!0,get:a(function(){return dee.isDeno},"get")});Object.defineProperty(ma,"isReactNative",{enumerable:!0,get:a(function(){return dee.isReactNative},"get")});Object.defineProperty(ma,"isWebWorker",{enumerable:!0,get:a(function(){return dee.isWebWorker},"get")});var wEi=TEi();Object.defineProperty(ma,"stringToUint8Array",{enumerable:!0,get:a(function(){return wEi.stringToUint8Array},"get")});Object.defineProperty(ma,"uint8ArrayToString",{enumerable:!0,get:a(function(){return wEi.uint8ArrayToString},"get")});var LEa=IEi();Object.defineProperty(ma,"Sanitizer",{enumerable:!0,get:a(function(){return LEa.Sanitizer},"get")})});var REi=I(pAr=>{"use strict";p();Object.defineProperty(pAr,"__esModule",{value:!0});pAr.cancelablePromiseRace=FEa;async function FEa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(FEa,"cancelablePromiseRace")});var kEi=I(Vpt=>{"use strict";p();Object.defineProperty(Vpt,"__esModule",{value:!0});Vpt.AbortError=void 0;var hAr=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};Vpt.AbortError=hAr});var iMe=I(Wpt=>{"use strict";p();Object.defineProperty(Wpt,"__esModule",{value:!0});Wpt.AbortError=void 0;var UEa=kEi();Object.defineProperty(Wpt,"AbortError",{enumerable:!0,get:a(function(){return UEa.AbortError},"get")})});var gAr=I(mAr=>{"use strict";p();Object.defineProperty(mAr,"__esModule",{value:!0});mAr.createAbortablePromise=qEa;var QEa=iMe();function qEa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new QEa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(qEa,"createAbortablePromise")});var PEi=I(zpt=>{"use strict";p();Object.defineProperty(zpt,"__esModule",{value:!0});zpt.delay=$Ea;zpt.calculateRetryDelay=VEa;var jEa=gAr(),HEa=$pt(),GEa="The delay was aborted.";function $Ea(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,jEa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??GEa})}a($Ea,"delay");function VEa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,HEa.getRandomIntegerInclusive)(0,n/2)}}a(VEa,"calculateRetryDelay")});var DEi=I(AAr=>{"use strict";p();Object.defineProperty(AAr,"__esModule",{value:!0});AAr.getErrorMessage=zEa;var WEa=$pt();function zEa(t){if((0,WEa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(zEa,"getErrorMessage")});var MEi=I(oMe=>{"use strict";p();Object.defineProperty(oMe,"__esModule",{value:!0});oMe.isDefined=yAr;oMe.isObjectWithProperties=YEa;oMe.objectHasProperty=NEi;function yAr(t){return typeof t<"u"&&t!==null}a(yAr,"isDefined");function YEa(t,e){if(!yAr(t)||typeof t!="object")return!1;for(let r of e)if(!NEi(t,r))return!1;return!0}a(YEa,"isObjectWithProperties");function NEi(t,e){return yAr(t)&&typeof t=="object"&&e in t}a(NEi,"objectHasProperty")});var n4=I(is=>{"use strict";p();Object.defineProperty(is,"__esModule",{value:!0});is.isWebWorker=is.isReactNative=is.isNodeRuntime=is.isNodeLike=is.isNode=is.isDeno=is.isBun=is.isBrowser=is.objectHasProperty=is.isObjectWithProperties=is.isDefined=is.getErrorMessage=is.delay=is.createAbortablePromise=is.cancelablePromiseRace=void 0;is.calculateRetryDelay=t_a;is.computeSha256Hash=r_a;is.computeSha256Hmac=n_a;is.getRandomIntegerInclusive=i_a;is.isError=o_a;is.isObject=s_a;is.randomUUID=a_a;is.uint8ArrayToString=c_a;is.stringToUint8Array=l_a;var KEa=(OL(),Ca(E7)),$A=KEa.__importStar($pt()),JEa=REi();Object.defineProperty(is,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return JEa.cancelablePromiseRace},"get")});var ZEa=gAr();Object.defineProperty(is,"createAbortablePromise",{enumerable:!0,get:a(function(){return ZEa.createAbortablePromise},"get")});var XEa=PEi();Object.defineProperty(is,"delay",{enumerable:!0,get:a(function(){return XEa.delay},"get")});var e_a=DEi();Object.defineProperty(is,"getErrorMessage",{enumerable:!0,get:a(function(){return e_a.getErrorMessage},"get")});var EAr=MEi();Object.defineProperty(is,"isDefined",{enumerable:!0,get:a(function(){return EAr.isDefined},"get")});Object.defineProperty(is,"isObjectWithProperties",{enumerable:!0,get:a(function(){return EAr.isObjectWithProperties},"get")});Object.defineProperty(is,"objectHasProperty",{enumerable:!0,get:a(function(){return EAr.objectHasProperty},"get")});function t_a(t,e){return $A.calculateRetryDelay(t,e)}a(t_a,"calculateRetryDelay");function r_a(t,e){return $A.computeSha256Hash(t,e)}a(r_a,"computeSha256Hash");function n_a(t,e,r){return $A.computeSha256Hmac(t,e,r)}a(n_a,"computeSha256Hmac");function i_a(t,e){return $A.getRandomIntegerInclusive(t,e)}a(i_a,"getRandomIntegerInclusive");function o_a(t){return $A.isError(t)}a(o_a,"isError");function s_a(t){return $A.isObject(t)}a(s_a,"isObject");function a_a(){return $A.randomUUID()}a(a_a,"randomUUID");is.isBrowser=$A.isBrowser;is.isBun=$A.isBun;is.isDeno=$A.isDeno;is.isNode=$A.isNodeLike;is.isNodeLike=$A.isNodeLike;is.isNodeRuntime=$A.isNodeRuntime;is.isReactNative=$A.isReactNative;is.isWebWorker=$A.isWebWorker;function c_a(t,e){return $A.uint8ArrayToString(t,e)}a(c_a,"uint8ArrayToString");function l_a(t,e){return $A.stringToUint8Array(t,e)}a(l_a,"stringToUint8Array")});var Kpt=I(Ypt=>{"use strict";p();Object.defineProperty(Ypt,"__esModule",{value:!0});Ypt.Sanitizer=void 0;var u_a=n4(),_Ar="REDACTED",d_a=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],f_a=["api-version"],CAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=d_a.concat(e),r=f_a.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,u_a.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,_Ar);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=_Ar;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=_Ar;return r}};Ypt.Sanitizer=CAr});var vAr=I(R0e=>{"use strict";p();Object.defineProperty(R0e,"__esModule",{value:!0});R0e.logPolicyName=void 0;R0e.logPolicy=m_a;var p_a=uee(),h_a=Kpt();R0e.logPolicyName="logPolicy";function m_a(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:p_a.logger.info,n=new h_a.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:R0e.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(m_a,"logPolicy")});var bAr=I(k0e=>{"use strict";p();Object.defineProperty(k0e,"__esModule",{value:!0});k0e.redirectPolicyName=void 0;k0e.redirectPolicy=g_a;k0e.redirectPolicyName="redirectPolicy";var OEi=["GET","HEAD"];function g_a(t={}){let{maxRetries:e=20}=t;return{name:k0e.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return BEi(n,o,e)}}}a(g_a,"redirectPolicy");async function BEi(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&OEi.includes(o.method)||s===302&&OEi.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Jpt,"__esModule",{value:!0});Jpt.getHeaderName=A_a;Jpt.setPlatformSpecificData=y_a;var LEi=(OL(),Ca(E7)),SAr=LEi.__importStar(require("node:os")),TAr=LEi.__importStar(require("node:process"));function A_a(){return"User-Agent"}a(A_a,"getHeaderName");async function y_a(t){if(TAr&&TAr.versions){let e=TAr.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${SAr.arch()}-${SAr.type()}-${SAr.release()})`)}a(y_a,"setPlatformSpecificData")});var VH=I(P0e=>{"use strict";p();Object.defineProperty(P0e,"__esModule",{value:!0});P0e.DEFAULT_RETRY_POLICY_COUNT=P0e.SDK_VERSION=void 0;P0e.SDK_VERSION="1.16.3";P0e.DEFAULT_RETRY_POLICY_COUNT=3});var IAr=I(Zpt=>{"use strict";p();Object.defineProperty(Zpt,"__esModule",{value:!0});Zpt.getUserAgentHeaderName=C_a;Zpt.getUserAgentValue=v_a;var UEi=FEi(),E_a=VH();function __a(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(__a,"getUserAgentString");function C_a(){return(0,UEi.getHeaderName)()}a(C_a,"getUserAgentHeaderName");async function v_a(t){let e=new Map;e.set("core-rest-pipeline",E_a.SDK_VERSION),await(0,UEi.setPlatformSpecificData)(e);let r=__a(e);return t?`${t} ${r}`:r}a(v_a,"getUserAgentValue")});var xAr=I(D0e=>{"use strict";p();Object.defineProperty(D0e,"__esModule",{value:!0});D0e.userAgentPolicyName=void 0;D0e.userAgentPolicy=b_a;var qEi=IAr(),QEi=(0,qEi.getUserAgentHeaderName)();D0e.userAgentPolicyName="userAgentPolicy";function b_a(t={}){let e=(0,qEi.getUserAgentValue)(t.userAgentPrefix);return{name:D0e.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(QEi)||r.headers.set(QEi,await e),n(r)}}}a(b_a,"userAgentPolicy")});var Xpt=I(N0e=>{"use strict";p();Object.defineProperty(N0e,"__esModule",{value:!0});N0e.isNodeReadableStream=jEi;N0e.isWebReadableStream=HEi;N0e.isReadableStream=S_a;N0e.isBlob=T_a;function jEi(t){return!!(t&&typeof t.pipe=="function")}a(jEi,"isNodeReadableStream");function HEi(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(HEi,"isWebReadableStream");function S_a(t){return jEi(t)||HEi(t)}a(S_a,"isReadableStream");function T_a(t){return typeof t.stream=="function"}a(T_a,"isBlob")});var wAr=I(sMe=>{"use strict";p();Object.defineProperty(sMe,"__esModule",{value:!0});sMe.getRawContent=R_a;sMe.createFileFromStream=k_a;sMe.createFile=P_a;var I_a=n4(),x_a=Xpt(),GEi={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},eht=Symbol("rawContent");function w_a(t){return typeof t[eht]=="function"}a(w_a,"hasRawContent");function R_a(t){return w_a(t)?t[eht]():t.stream()}a(R_a,"getRawContent");function k_a(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},GEi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,x_a.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[eht]:t})}a(k_a,"createFileFromStream");function P_a(t,e,r={}){var n,o,s;return I_a.isNodeLike?Object.assign(Object.assign({},GEi),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[eht]:()=>t}):new File([t],e,r)}a(P_a,"createFile")});var WEi=I(kAr=>{"use strict";p();Object.defineProperty(kAr,"__esModule",{value:!0});kAr.concat=B_a;var m8=(OL(),Ca(E7)),RAr=require("node:stream"),D_a=Xpt(),N_a=wAr();function $Ei(){return m8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield m8.__await(e.read());if(r)return yield m8.__await(void 0);yield yield m8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a($Ei,"streamAsyncIterator");function M_a(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=$Ei.bind(t)),t.values||(t.values=$Ei.bind(t))}a(M_a,"makeAsyncIterable");function O_a(t){return t instanceof ReadableStream?(M_a(t),RAr.Readable.fromWeb(t)):t}a(O_a,"ensureNodeStream");function VEi(t){return t instanceof Uint8Array?RAr.Readable.from(Buffer.from(t)):(0,D_a.isBlob)(t)?VEi((0,N_a.getRawContent)(t)):O_a(t)}a(VEi,"toStream");async function B_a(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(VEi);return RAr.Readable.from((function(){return m8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,m8.__asyncValues(d)),u;u=yield m8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield m8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield m8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(B_a,"concat")});var PAr=I(M0e=>{"use strict";p();Object.defineProperty(M0e,"__esModule",{value:!0});M0e.multipartPolicyName=void 0;M0e.multipartPolicy=W_a;var fee=n4(),L_a=WEi(),F_a=Xpt();function U_a(){return`----AzSDKFormBoundary${(0,fee.randomUUID)()}`}a(U_a,"generateBoundary");function Q_a(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(Q_a,"encodeHeaders");function q_a(t){return t instanceof Uint8Array?t.byteLength:(0,F_a.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(q_a,"getLength");function j_a(t){let e=0;for(let r of t){let n=q_a(r);if(n===void 0)return;e+=n}return e}a(j_a,"getTotalLength");async function H_a(t,e,r){let n=[(0,fee.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,fee.stringToUint8Array)(`\r -`,"utf-8"),(0,fee.stringToUint8Array)(Q_a(s.headers),"utf-8"),(0,fee.stringToUint8Array)(`\r -`,"utf-8"),s.body,(0,fee.stringToUint8Array)(`\r ---${r}`,"utf-8")]),(0,fee.stringToUint8Array)(`--\r +`),r+=c;break}}})}catch{this._isEnabled=!1,J5.info("Parse client web instrumentation error. Web Instrumentation is disabled")}return r},t.prototype._initialize=function(){this._isInitialized=!0;var e=tEi.createServer,r=rEi.createServer,n=this._isEnabled;tEi.createServer=function(o){var s=o;return s&&(o=a(function(c,l){var u=l.write,d=c.method=="GET";l.write=a(function(m,g,A){try{if(n&&d){var y=Kw.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){J5.warn("Inject snippet error: "+v)}return u.apply(l,arguments)},"wrap");var f=l.end;return l.end=a(function(m,g,A){if(n&&d)try{if(n&&d){var y=Kw.getContentEncodingFromHeaders(l),E=void 0;if(typeof g=="string"&&(E=g),y==null)t.INSTANCE.ValidateInjection(l,m)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,void 0,E));else if(y.length){var _=y[0];arguments[0]=t.INSTANCE.InjectWebSnippet(l,m,_)}}}catch(v){J5.warn("Inject snipet error: "+v)}return f.apply(l,arguments)},"wrap"),s(c,l)},"requestListener")),e(o)},rEi.createServer=function(o,s){var c=s;if(c)return s=a(function(l,u){var d=l.method=="GET",f=u.write,h=u.end;return u.write=a(function(g,A,y){try{if(n&&d){var E=Kw.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=this.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){J5.warn("Inject snippet error: "+b)}return f.apply(u,arguments)},"wrap"),u.end=a(function(g,A,y){try{if(n&&d){var E=Kw.getContentEncodingFromHeaders(u),_=void 0;if(typeof A=="string"&&(_=A),E==null)t.INSTANCE.ValidateInjection(u,g)&&(arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,void 0,_));else if(E.length){var v=E[0];arguments[0]=t.INSTANCE.InjectWebSnippet(u,g,v)}}}catch(b){J5.warn("Inject snippet error: "+b)}return h.apply(u,arguments)},"wrap"),c(l,u)},"httpsRequestListener"),r(o,s)}},t.prototype.ValidateInjection=function(e,r){try{if(!e||!r||e.statusCode!=200)return!1;var n=Kw.isContentTypeHeaderHtml(e);if(!n)return!1;var o=r.slice().toString();if(o.indexOf("")>=0&&o.indexOf("")>=0&&o.indexOf(t._aiUrl)<0&&o.indexOf(t._aiDeprecatedUrl)<0)return!0}catch(s){J5.info("validate injections error: "+s)}return!1},t.prototype.InjectWebSnippet=function(e,r,n,o){try{var s=!!n;if(s)e.removeHeader("Content-Length"),r=this._getInjectedCompressBuffer(e,r,n),e.setHeader("Content-Length",r.length);else{var c=r.toString(),l=c.indexOf("");if(l<0)return r;var u=Kw.insertSnippetByIndex(l,c,t._snippet);if(typeof r=="string")e.removeHeader("Content-Length"),r=u,e.setHeader("Content-Length",Buffer.byteLength(r));else if(Buffer.isBuffer(r)){var d=o||"utf8",f=Kw.isBufferType(r,d);if(f){e.removeHeader("Content-Length");var h=Buffer.from(u).toString(d);r=Buffer.from(h,d),e.setHeader("Content-Length",r.length)}}}}catch(m){J5.warn("Failed to inject web snippet and change content-lenght headers. Exception:"+m)}return r},t.prototype._getInjectedCompressBuffer=function(e,r,n){try{switch(n){case Kw.contentEncodingMethod.GZIP:var o=h0e.gunzipSync(r);if(this.ValidateInjection(e,o)){var s=this.InjectWebSnippet(e,o);r=h0e.gzipSync(s)}break;case Kw.contentEncodingMethod.DEFLATE:var c=h0e.inflateSync(r);if(this.ValidateInjection(e,c)){var l=this.InjectWebSnippet(e,c);r=h0e.deflateSync(l)}break;case Kw.contentEncodingMethod.BR:var u=Kw.getBrotliDecompressSync(h0e),d=Kw.getBrotliCompressSync(h0e);if(u&&d){var f=u(r);if(this.ValidateInjection(e,f)){var h=this.InjectWebSnippet(e,f);r=d(h)}break}}}catch(m){J5.info("get web injection compress buffer error: "+m)}return r},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1},t})();oEi.exports=AAa});var cEi=I((Qgr,aEi)=>{"use strict";p();var yAa=Qgr&&Qgr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Jw=require("url"),Ugr=yE(),EAa=VA(),_Aa=Ghe(),vAa=Amr(),CAa=BX(),bAa=(function(t){yAa(e,t);function e(r,n){var o=t.call(this)||this;return n&&n.method&&r&&(o.method=n.method,o.url=e._getUrlFromRequestOptions(r,n),o.startTime=+new Date),o}return a(e,"HttpDependencyParser"),e.prototype.onError=function(r){this._setStatus(void 0,r)},e.prototype.onResponse=function(r){this._setStatus(r.statusCode,void 0),this.correlationId=EAa.getCorrelationContextTarget(r,_Aa.requestContextTargetKey)},e.prototype.getDependencyTelemetry=function(r,n){var o=this.method.toUpperCase(),s=Ugr.RemoteDependencyDataConstants.TYPE_HTTP,c="";try{var l=new Jw.URL(this.url);l.search=void 0,l.hash=void 0,o+=" "+l.pathname,c=l.hostname,l.port&&(c+=":"+l.port)}catch{}this.correlationId?(s=Ugr.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==CAa.correlationIdPrefix&&(c+=" | "+this.correlationId)):s=Ugr.RemoteDependencyDataConstants.TYPE_HTTP;var u={id:n,name:o,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:s,target:c};if(r&&r.time?u.time=r.time:this.startTime&&(u.time=new Date(this.startTime)),r){for(var d in r)u[d]||(u[d]=r[d]);if(r.properties)for(var d in r.properties)u.properties[d]=r.properties[d]}return u},e._getUrlFromRequestOptions=function(r,n){if(typeof r=="string")if(r.indexOf("http://")===0||r.indexOf("https://")===0)try{r=new Jw.URL(r)}catch{}else try{var o=new Jw.URL("http://"+r);o.port==="443"?r=new Jw.URL("https://"+r):r=new Jw.URL("http://"+r)}catch{}else{if(r&&typeof Jw.URL=="function"&&r instanceof Jw.URL)return Jw.format(r);var s=r;r={},s&&Object.keys(s).forEach(function(u){r[u]=s[u]})}if(r.path&&r.host)try{var c=new Jw.URL(r.path,"http://"+r.host+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.path&&r.hostname&&!r.host)try{var c=new Jw.URL(r.path,"http://"+r.hostname+r.path);r.pathname=c.pathname,r.search=c.search}catch{}if(r.host&&r.port)try{var l=new Jw.URL("http://".concat(r.host));!l.port&&r.port&&(r.hostname=r.host,delete r.host)}catch{}return r.protocol=r.protocol||n.agent&&n.agent.protocol||n.protocol||void 0,r.hostname=r.hostname||"localhost",Jw.format(r)},e})(vAa);aEi.exports=bAa});var lEi=I(m0e=>{"use strict";p();var Bpt=m0e&&m0e.__assign||function(){return Bpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var wAa=i8&&i8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RAa=i8&&i8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PAa=i8&&i8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&wAa(e,t,r);return RAa(e,t),e};Object.defineProperty(i8,"__esModule",{value:!0});i8.spanToTelemetryContract=LAa;var uEi=require("url"),P2=(co(),ya(u5)),hs=(yft(),ya(x0r)),n8=PAa(ad()),kAa=lEi(),DAa=VA();function NAa(t){for(var e={},r=0,n=Object.keys(t.attributes);r0&&(e["_MS.links"]=DAa.stringify(s)),e}a(NAa,"createPropertiesFromSpan");function MAa(t){return t===hs.DbSystemValues.DB2||t===hs.DbSystemValues.DERBY||t===hs.DbSystemValues.MARIADB||t===hs.DbSystemValues.MSSQL||t===hs.DbSystemValues.ORACLE||t===hs.DbSystemValues.SQLITE||t===hs.DbSystemValues.OTHER_SQL||t===hs.DbSystemValues.HSQLDB||t===hs.DbSystemValues.H2}a(MAa,"isSqlDB");function dEi(t){var e=t.attributes[hs.SemanticAttributes.HTTP_METHOD];if(e){var r=t.attributes[hs.SemanticAttributes.HTTP_URL];if(r)return String(r);var n=t.attributes[hs.SemanticAttributes.HTTP_SCHEME],o=t.attributes[hs.SemanticAttributes.HTTP_TARGET];if(n&&o){var s=t.attributes[hs.SemanticAttributes.HTTP_HOST];if(s)return"".concat(n,"://").concat(s).concat(o);var c=t.attributes[hs.SemanticAttributes.NET_PEER_PORT];if(c){var l=t.attributes[hs.SemanticAttributes.NET_PEER_NAME];if(l)return"".concat(n,"://").concat(l,":").concat(c).concat(o);var u=t.attributes[hs.SemanticAttributes.NET_PEER_IP];if(u)return"".concat(n,"://").concat(u,":").concat(c).concat(o)}}}return""}a(dEi,"getUrl");function jgr(t){var e=t.attributes[hs.SemanticAttributes.PEER_SERVICE],r=t.attributes[hs.SemanticAttributes.HTTP_HOST],n=t.attributes[hs.SemanticAttributes.HTTP_URL],o=t.attributes[hs.SemanticAttributes.NET_PEER_NAME],s=t.attributes[hs.SemanticAttributes.NET_PEER_IP];return e?String(e):r?String(r):n?String(n):o?String(o):s?String(s):""}a(jgr,"getDependencyTarget");function OAa(t){var e={name:t.name,success:t.status.code!=P2.SpanStatusCode.ERROR,resultCode:"0",duration:0,data:"",dependencyTypeName:""};t.kind===P2.SpanKind.PRODUCER&&(e.dependencyTypeName=n8.DependencyTypeName.QueueMessage),t.kind===P2.SpanKind.INTERNAL&&t.parentSpanId&&(e.dependencyTypeName=n8.DependencyTypeName.InProc);var r=t.attributes[hs.SemanticAttributes.HTTP_METHOD],n=t.attributes[hs.SemanticAttributes.DB_SYSTEM],o=t.attributes[hs.SemanticAttributes.RPC_SYSTEM];if(r){e.dependencyTypeName=n8.DependencyTypeName.Http;var s=t.attributes[hs.SemanticAttributes.HTTP_URL];if(s){var c="";try{var l=new uEi.URL(String(s));c=l.pathname}catch{}e.name="".concat(r," ").concat(c)}e.data=dEi(t);var u=t.attributes[hs.SemanticAttributes.HTTP_STATUS_CODE];u&&(e.resultCode=String(u));var d=jgr(t);if(d){try{var f=new RegExp(/(https?)(:\/\/.*)(:\d+)(\S*)/),h=f.exec(d);if(h!=null){var m=h[1],g=h[3];(m=="https"&&g==":443"||m=="http"&&g==":80")&&(d=h[1]+h[2]+h[4])}}catch{}e.target="".concat(d)}}else if(n){String(n)===hs.DbSystemValues.MYSQL?e.dependencyTypeName="mysql":String(n)===hs.DbSystemValues.POSTGRESQL?e.dependencyTypeName="postgresql":String(n)===hs.DbSystemValues.MONGODB?e.dependencyTypeName="mongodb":String(n)===hs.DbSystemValues.REDIS?e.dependencyTypeName="redis":MAa(String(n))?e.dependencyTypeName="SQL":e.dependencyTypeName=String(n);var A=t.attributes[hs.SemanticAttributes.DB_STATEMENT],y=t.attributes[hs.SemanticAttributes.DB_OPERATION];A?e.data=String(A):y&&(e.data=String(y));var d=jgr(t),E=t.attributes[hs.SemanticAttributes.DB_NAME];d?e.target=E?"".concat(d,"|").concat(E):"".concat(d):e.target=E?"".concat(E):"".concat(n)}else if(o){e.dependencyTypeName=n8.DependencyTypeName.Grpc;var _=t.attributes[hs.SemanticAttributes.RPC_GRPC_STATUS_CODE];_&&(e.resultCode=String(_));var d=jgr(t);d?e.target="".concat(d):o&&(e.target=String(o))}return e}a(OAa,"createDependencyData");function BAa(t){var e={name:t.name,success:t.status.code!=P2.SpanStatusCode.ERROR,resultCode:"0",duration:0,url:"",source:void 0},r=t.attributes[hs.SemanticAttributes.HTTP_METHOD],n=t.attributes[hs.SemanticAttributes.RPC_GRPC_STATUS_CODE];if(r){if(t.kind==P2.SpanKind.SERVER){var o=t.attributes[hs.SemanticAttributes.HTTP_ROUTE],s=t.attributes[hs.SemanticAttributes.HTTP_URL];if(o)e.name="".concat(r," ").concat(o);else if(s)try{var c=new uEi.URL(String(s));e.name="".concat(r," ").concat(c.pathname)}catch{}}e.url=dEi(t);var l=t.attributes[hs.SemanticAttributes.HTTP_STATUS_CODE];l&&(e.resultCode=String(l))}else n&&(e.resultCode=String(n));return e}a(BAa,"createRequestData");function LAa(t){var e;switch(t.kind){case P2.SpanKind.CLIENT:case P2.SpanKind.PRODUCER:case P2.SpanKind.INTERNAL:e=OAa(t);break;case P2.SpanKind.SERVER:case P2.SpanKind.CONSUMER:e=BAa(t);break}var r=t.spanContext?t.spanContext():t.context(),n="".concat(r.spanId),o=Math.round(t.duration[0]*1e3+t.duration[1]/1e6);return e.id=n,e.duration=o,e.properties=NAa(t),t.attributes[n8.AzNamespace]&&(t.kind===P2.SpanKind.INTERNAL&&(e.dependencyTypeName="".concat(n8.DependencyTypeName.InProc," | ").concat(t.attributes[n8.AzNamespace])),t.attributes[n8.AzNamespace]===n8.MicrosoftEventHub&&(0,kAa.parseEventHubSpan)(t,e)),e}a(LAa,"spanToTelemetryContract")});var hEi=I(OH=>{"use strict";p();var g0e=OH&&OH.__assign||function(){return g0e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var UAa=ST&&ST.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QAa=ST&&ST.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qAa=ST&&ST.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&UAa(e,t,r);return QAa(e,t),e};Object.defineProperty(ST,"__esModule",{value:!0});ST.subscriber=void 0;ST.enable=VAa;var jNe=(co(),ya(u5)),jAa=ad(),Hgr=mp(),HAa=qAa(fEi()),GAa=hEi(),YX=[],$Aa=a(function(t){try{var e=t.data,r=HAa.spanToTelemetryContract(e);GAa.AsyncScopeManager.with(e,function(){YX.forEach(function(n){e.kind===jNe.SpanKind.SERVER||e.kind===jNe.SpanKind.CONSUMER?n.trackRequest(r):(e.kind===jNe.SpanKind.CLIENT||e.kind===jNe.SpanKind.INTERNAL||e.kind===jNe.SpanKind.PRODUCER)&&n.trackDependency(r)})})}catch{}},"subscriber");ST.subscriber=$Aa;function VAa(t,e){if(t){var r=YX.find(function(n){return n==e});if(r)return;YX.length===0&&Hgr.channel.subscribe("azure-coretracing",ST.subscriber,Hgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(jAa.StatsbeatInstrumentation.AZURE_CORE_TRACING)}),YX.push(e)}else YX=YX.filter(function(n){return n!=e}),YX.length===0&&Hgr.channel.unsubscribe("azure-coretracing",ST.subscriber)}a(VAa,"enable")});var gEi=I(JX=>{"use strict";p();Object.defineProperty(JX,"__esModule",{value:!0});JX.subscriber=void 0;JX.enable=YAa;var WAa=ad(),Ggr=mp(),KX=[],zAa=a(function(t){t.data.event.commandName!=="ismaster"&&KX.forEach(function(e){var r=t.data.startedData&&t.data.startedData.databaseName||"Unknown database";e.trackDependency({target:r,data:t.data.event.commandName,name:t.data.event.commandName,duration:t.data.event.duration,success:t.data.succeeded,resultCode:t.data.succeeded?"0":"1",time:t.data.startedData.time,dependencyTypeName:"mongodb"})})},"subscriber");JX.subscriber=zAa;function YAa(t,e){if(t){var r=KX.find(function(n){return n==e});if(r)return;KX.length===0&&Ggr.channel.subscribe("mongodb",JX.subscriber,Ggr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(WAa.StatsbeatInstrumentation.MONGODB)}),KX.push(e)}else KX=KX.filter(function(n){return n!=e}),KX.length===0&&Ggr.channel.unsubscribe("mongodb",JX.subscriber)}a(YAa,"enable")});var AEi=I(eee=>{"use strict";p();Object.defineProperty(eee,"__esModule",{value:!0});eee.subscriber=void 0;eee.enable=ZAa;var KAa=ad(),$gr=mp(),ZX=[],JAa=a(function(t){ZX.forEach(function(e){var r=t.data.query||{},n=r.sql||"Unknown query",o=!t.data.err,s=r._connection||{},c=s.config||{},l=c.socketPath?c.socketPath:"".concat(c.host||"localhost",":").concat(c.port);e.trackDependency({target:l,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"mysql"})})},"subscriber");eee.subscriber=JAa;function ZAa(t,e){if(t){var r=ZX.find(function(n){return n==e});if(r)return;ZX.length===0&&$gr.channel.subscribe("mysql",eee.subscriber,$gr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(KAa.StatsbeatInstrumentation.MYSQL)}),ZX.push(e)}else ZX=ZX.filter(function(n){return n!=e}),ZX.length===0&&$gr.channel.unsubscribe("mysql",eee.subscriber)}a(ZAa,"enable")});var yEi=I(ree=>{"use strict";p();Object.defineProperty(ree,"__esModule",{value:!0});ree.subscriber=void 0;ree.enable=tya;var XAa=ad(),Vgr=mp(),tee=[],eya=a(function(t){tee.forEach(function(e){t.data.commandObj.command!=="info"&&e.trackDependency({target:t.data.address,name:t.data.commandObj.command,data:t.data.commandObj.command,duration:t.data.duration,success:!t.data.err,resultCode:t.data.err?"1":"0",time:t.data.time,dependencyTypeName:"redis"})})},"subscriber");ree.subscriber=eya;function tya(t,e){if(t){var r=tee.find(function(n){return n==e});if(r)return;tee.length===0&&Vgr.channel.subscribe("redis",ree.subscriber,Vgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(XAa.StatsbeatInstrumentation.REDIS)}),tee.push(e)}else tee=tee.filter(function(n){return n!=e}),tee.length===0&&Vgr.channel.unsubscribe("redis",ree.subscriber)}a(tya,"enable")});var EEi=I(iee=>{"use strict";p();Object.defineProperty(iee,"__esModule",{value:!0});iee.subscriber=void 0;iee.enable=iya;var rya=ad(),Wgr=mp(),nee=[],nya=a(function(t){nee.forEach(function(e){var r=t.data.query,n=r.preparable&&r.preparable.text||r.plan||r.text||"unknown query",o=!t.data.error,s="".concat(t.data.database.host,":").concat(t.data.database.port);e.trackDependency({target:s,data:n,name:n,duration:t.data.duration,success:o,resultCode:o?"0":"1",time:t.data.time,dependencyTypeName:"postgres"})})},"subscriber");iee.subscriber=nya;function iya(t,e){if(t){var r=nee.find(function(n){return n==e});if(r)return;nee.length===0&&Wgr.channel.subscribe("postgres",iee.subscriber,Wgr.trueFilter,function(n,o){var s=e.getStatsbeat();s&&s.addInstrumentation(rya.StatsbeatInstrumentation.POSTGRES)}),nee.push(e)}else nee=nee.filter(function(n){return n!=e}),nee.length===0&&Wgr.channel.unsubscribe("postgres",iee.subscriber)}a(iya,"enable")});var E0e=I((o8,_Ei)=>{"use strict";p();var oya=o8&&o8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sya=o8&&o8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),aya=o8&&o8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&oya(e,t,r);return sya(e,t),e},Lpt=o8&&o8.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,s;n{"use strict";p();var vEi=require("http"),CEi=require("https"),bEi=jl(),SEi=VA(),dya=Ghe(),Ygr=vmr(),s8=PH(),fya=Ppt(),pya=(function(){function t(e){if(t.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");t.INSTANCE=this,this._client=e}return a(t,"AutoCollectHttpRequests"),t.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||fya.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},t.prototype.useAutoCorrelation=function(e,r){e&&!this._isAutoCorrelating?s8.CorrelationContextManager.enable(r):!e&&this._isAutoCorrelating&&s8.CorrelationContextManager.disable(),this._isAutoCorrelating=e},t.prototype.isInitialized=function(){return this._isInitialized},t.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},t.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return s8.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader(),e.getTraceparent(),e.getTracestate())},t.prototype._registerRequest=function(e,r,n){var o=this,s=new Ygr(e),c=this._generateCorrelationContext(s);s8.CorrelationContextManager.runWithContext(c,function(){o._isEnabled&&(e[t.alreadyAutoCollectedFlag]=!0,t.trackRequest(o._client,{request:e,response:r},s)),typeof n=="function"&&n(e,r)})},t.prototype._initialize=function(){if(this._isInitialized=!0,!t.HANDLER_READY){t.HANDLER_READY=!0;var e=a(function(s){if(s){if(typeof s!="function")throw new Error("onRequest handler must be a function");return function(c,l){s8.CorrelationContextManager.wrapEmitter(c),s8.CorrelationContextManager.wrapEmitter(l);var u=c&&!c[t.alreadyAutoCollectedFlag];c&&u&&t.INSTANCE?t.INSTANCE._registerRequest(c,l,s):s(c,l)}}},"wrapOnRequestHandler"),r=a(function(s){var c=s.addListener.bind(s);s.addListener=function(l,u){switch(l){case"request":case"checkContinue":return c(l,e(u));default:return c(l,u)}},s.on=s.addListener},"wrapServerEventHandler"),n=vEi.createServer;vEi.createServer=function(s,c){if(c&&typeof c=="function"){var l=n(s,e(c));return r(l),l}else{var l=n(e(s));return r(l),l}};var o=CEi.createServer;CEi.createServer=function(s,c){var l=o(s,e(c));return r(l),l}}},t.trackRequestSync=function(e,r){if(!r.request||!r.response||!e){bEi.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1,t.addResponseCorrelationIdHeader(e,r.response);var n=s8.CorrelationContextManager.getCurrentContext(),o=new Ygr(r.request,n&&n.operation.parentId);n&&(n.operation.id=o.getOperationId(e.context.tags)||n.operation.id,n.operation.name=o.getOperationName(e.context.tags)||n.operation.name,n.operation.parentId=o.getRequestId()||n.operation.parentId,n.customProperties.addHeaderData(o.getCorrelationContextHeader())),t.endRequest(e,o,r,r.duration,r.error)},t.trackRequest=function(e,r,n){if(!r.request||!r.response||!e){bEi.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!r.request,!r.response,!e);return}r.isProcessed=!1;var o=s8.CorrelationContextManager.getCurrentContext(),s=n||new Ygr(r.request,o&&o.operation.parentId);SEi.canIncludeCorrelationHeader(e,s.getUrl())&&t.addResponseCorrelationIdHeader(e,r.response),o&&!n&&(o.operation.id=s.getOperationId(e.context.tags)||o.operation.id,o.operation.name=s.getOperationName(e.context.tags)||o.operation.name,o.operation.parentId=s.getOperationParentId(e.context.tags)||o.operation.parentId,o.customProperties.addHeaderData(s.getCorrelationContextHeader())),r.response.once&&r.response.once("finish",function(){t.endRequest(e,s,r,null,null)}),r.request.on&&r.request.on("error",function(c){t.endRequest(e,s,r,null,c)}),r.request.on&&r.request.on("aborted",function(){var c="The request has been aborted and the network socket has closed.";t.endRequest(e,s,r,null,c)})},t.addResponseCorrelationIdHeader=function(e,r){if(e.config&&e.config.correlationId&&r.getHeader&&r.setHeader&&!r.headersSent){var n=r.getHeader(dya.requestContextHeader);SEi.safeIncludeCorrelationHeader(e,r,n)}},t.endRequest=function(e,r,n,o,s){if(!n.isProcessed){n.isProcessed=!0,s?r.onError(s,o):r.onResponse(n.response,o);var c=r.getRequestTelemetry(n);if(c.tagOverrides=r.getRequestTags(e.context.tags),n.tagOverrides)for(var l in n.tagOverrides)c.tagOverrides[l]=n.tagOverrides[l];var u=r.getLegacyRootId();u&&(c.properties.ai_legacyRootId=u),c.contextObjects=c.contextObjects||{},c.contextObjects["http.ServerRequest"]=n.request,c.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(c)}},t.prototype.dispose=function(){t.INSTANCE=null,this.enable(!1),this._isInitialized=!1,s8.CorrelationContextManager.disable(),this._isAutoCorrelating=!1},t.HANDLER_READY=!1,t.alreadyAutoCollectedFlag="_appInsightsAutoCollected",t})();TEi.exports=pya});var wEi=I((Zgr,xEi)=>{"use strict";p();var Zw=Zgr&&Zgr.__assign||function(){return Zw=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0?r:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date(".concat(Date.now(),")/"),Version:o.tags[o.keys.internalSdkVersion],StreamId:gya,MachineName:s,Instance:c,RoleName:l};return u},t.createQuickPulseMetric=function(e){var r;return r={Name:e.name,Value:e.value,Weight:e.count||1},r},t.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case oee.TelemetryTypeString.Event:return t.createQuickPulseEventDocument(e);case oee.TelemetryTypeString.Exception:return t.createQuickPulseExceptionDocument(e);case oee.TelemetryTypeString.Trace:return t.createQuickPulseTraceDocument(e);case oee.TelemetryTypeString.Dependency:return t.createQuickPulseDependencyDocument(e);case oee.TelemetryTypeString.Request:return t.createQuickPulseRequestDocument(e)}return null},t.createQuickPulseEventDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.name,o=Zw(Zw({},r),{Name:n});return o},t.createQuickPulseTraceDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.severityLevel||0,o=Zw(Zw({},r),{Message:e.data.baseData.message,SeverityLevel:oee.SeverityLevel[n]});return o},t.createQuickPulseExceptionDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData.exceptions,o="",s="",c="";n&&n.length>0&&(n[0].parsedStack&&n[0].parsedStack.length>0?n[0].parsedStack.forEach(function(u){o+=u.assembly+` +`}):n[0].stack&&n[0].stack.length>0&&(o=n[0].stack),s=n[0].message,c=n[0].typeName);var l=Zw(Zw({},r),{Exception:o,ExceptionMessage:s,ExceptionType:c});return l},t.createQuickPulseRequestDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Zw(Zw({},r),{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return o},t.createQuickPulseDependencyDocument=function(e){var r=t.createQuickPulseDocument(e),n=e.data.baseData,o=Zw(Zw({},r),{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:r.OperationId,DependencyTypeName:n.type});return o},t.createQuickPulseDocument=function(e){var r,n,o,s;e.data.baseType?(n=IEi.TelemetryTypeStringToQuickPulseType[e.data.baseType],r=IEi.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]):mya.warn("Document type invalid; not sending live metric document",e.data.baseType),o=e.tags[t.keys.operationId],s=t.aggregateProperties(e);var c={DocumentType:r,__type:n,OperationId:o,Version:"1.0",Properties:s};return c},t.aggregateProperties=function(e){var r=[],n=e.data.baseData.measurements||{};for(var o in n)if(n.hasOwnProperty(o)){var s=n[o],c={key:o,value:s};r.push(c)}var l=e.data.baseData.properties||{};for(var o in l)if(l.hasOwnProperty(o)){var s=l[o],c={key:o,value:s};r.push(c)}return r},t.keys=new oee.ContextTagKeys,t})();xEi.exports=Aya});var PEi=I((cip,REi)=>{"use strict";p();var yya=a(function(){return(Date.now()+621355968e5)*1e4},"getTransmissionTime");REi.exports={getTransmissionTime:yya}});var MEi=I(($Ne,NEi)=>{"use strict";p();var kEi=$Ne&&$Ne.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},DEi=$Ne&&$Ne.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?r:this._config.quickPulseHost,m.method=Xw.method,m.path="/QuickPulseService.svc/".concat(o,"?ikey=").concat(this._config.instrumentationKey),m.headers=(g={Expect:"100-continue"},g[Xw.time]=vya.getTransmissionTime(),g["Content-Type"]="application/json",g["Content-Length"]=Buffer.byteLength(c),g),m),s&&s.length>0&&s.forEach(function(E){return l.headers[E.name]=E.value}),o!=="post")return[3,4];if(u=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!u)return[3,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,u.addAuthorizationHeader(l)];case 2:return y.sent(),[3,4];case 3:return d=y.sent(),f="Failed to get AAD bearer token for the Application. Error:",Xgr.info(t.TAG,f,d),[2];case 4:return this._config.httpsAgent?l.agent=this._config.httpsAgent:l.agent=eAr.tlsRestrictedAgent,h=Eya.request(l,function(E){if(E.statusCode==200){var _=E.headers[Xw.subscribed]==="true",v=null;try{v=E.headers[Xw.endpointRedirect]?new Cya.URL(E.headers[Xw.endpointRedirect].toString()).host:null}catch(T){A._onError("Failed to parse redirect header from QuickPulse: "+eAr.dumpObj(T))}var b=E.headers[Xw.pollingIntervalHint]?parseInt(E.headers[Xw.pollingIntervalHint].toString()):null;A._consecutiveErrors=0,n(_,E,v,b)}else A._onError("StatusCode:"+E.statusCode+" StatusMessage:"+E.statusMessage),n()}),h.on("error",function(E){A._onError(E),n()}),h.write(c),h.end(),[2]}})})},t.prototype._onError=function(e){this._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";this._consecutiveErrors%t.MAX_QPS_FAILURES_BEFORE_WARN===0?(r="Live Metrics endpoint could not be reached ".concat(this._consecutiveErrors," consecutive times. Most recent error:"),Xgr.warn(t.TAG,r,e)):Xgr.info(t.TAG,r,e)},t.TAG="QuickPulseSender",t.MAX_QPS_FAILURES_BEFORE_WARN=25,t})();NEi.exports=bya});var QEi=I((VNe,UEi)=>{"use strict";p();var OEi=VNe&&VNe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},BEi=VNe&&VNe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0?this._pollingIntervalHint:t.PING_INTERVAL,o=this._isCollectingData?t.POST_INTERVAL:n,this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,o=t.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=t.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(o=t.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),o),this._handle.unref(),[2]}})})},t.prototype._ping=function(e){this._sender.ping(e,this._redirectedHost,this._quickPulseDone.bind(this))},t.prototype._post=function(e){return OEi(this,void 0,void 0,function(){return BEi(this,function(r){switch(r.label){case 0:return[4,this._sender.post(e,this._redirectedHost,this._quickPulseDone.bind(this))];case 1:return r.sent(),[2]}})})},t.prototype._quickPulseDone=function(e,r,n,o){e!=null?(this._isCollectingData!==e&&(LEi.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,n&&n.length>0&&(this._redirectedHost=n,LEi.info("Redirecting endpoint to: ",n)),o&&o>0&&(this._pollingIntervalHint=o),r&&r.statusCode<300&&r.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},t.MAX_POST_WAIT_TIME=2e4,t.MAX_PING_WAIT_TIME=6e4,t.FALLBACK_INTERVAL=6e4,t.PING_INTERVAL=5e3,t.POST_INTERVAL=1e3,t})();UEi.exports=Iya});var jEi=I(_0e=>{"use strict";p();var Qpt=_0e&&_0e.__assign||function(){return Qpt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)for(var l=0,u=s;l{"use strict";p();var HEi=LH&&LH.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},GEi=LH&&LH.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var Dya=BX(),VEi=Fgr(),Nya=jl(),WEi=ad(),Mya=require("url"),Oya=tdt(),Bya=(function(){function t(e){this._endpointBase=WEi.DEFAULT_BREEZE_ENDPOINT,this._mergeConfig();var r=this._connectionString,n=VEi.parse(e),o=VEi.parse(r),s=!n.instrumentationkey&&Object.keys(n).length>0?null:e,c=this._instrumentationKey;this.instrumentationKey=n.instrumentationkey||s||o.instrumentationkey||c;var l="".concat(this.endpointUrl||n.ingestionendpoint||o.ingestionendpoint||this._endpointBase);l.endsWith("/")&&(l=l.slice(0,-1)),this.endpointUrl="".concat(l,"/v2.1/track"),this.maxBatchSize=this.maxBatchSize||250,this.maxBatchIntervalMs=this.maxBatchIntervalMs||15e3,this.disableAppInsights=this.disableAppInsights||!1,this.samplingPercentage=this.samplingPercentage||100,this.correlationIdRetryIntervalMs=this.correlationIdRetryIntervalMs||30*1e3,this.enableWebInstrumentation=this.enableWebInstrumentation||this.enableAutoWebSnippetInjection||!1,this.webInstrumentationConfig=this.webInstrumentationConfig||null,this.enableAutoWebSnippetInjection=this.enableWebInstrumentation,this.correlationHeaderExcludedDomains=this.correlationHeaderExcludedDomains||["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.ignoreLegacyHeaders=this.ignoreLegacyHeaders||!1,this.profileQueryEndpoint=n.ingestionendpoint||o.ingestionendpoint||process.env[t.ENV_profileQueryEndpoint]||this._endpointBase,this.quickPulseHost=this.quickPulseHost||n.liveendpoint||o.liveendpoint||process.env[t.ENV_quickPulseHost]||WEi.DEFAULT_LIVEMETRICS_HOST,this.webInstrumentationConnectionString=this.webInstrumentationConnectionString||this._webInstrumentationConnectionString||"",this.webSnippetConnectionString=this.webInstrumentationConnectionString,this.quickPulseHost.match(/^https?:\/\//)&&(this.quickPulseHost=new Mya.URL(this.quickPulseHost).host),this.aadAudience=n.aadaudience||o.aadaudience}return a(t,"Config"),Object.defineProperty(t.prototype,"profileQueryEndpoint",{get:a(function(){return this._profileQueryEndpoint},"get"),set:a(function(e){this._profileQueryEndpoint=e,this.correlationId=Dya.correlationIdPrefix},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instrumentationKey",{get:a(function(){return this._instrumentationKey},"get"),set:a(function(e){t._validateInstrumentationKey(e)||Nya.warn("An invalid instrumentation key was provided. There may be resulting telemetry loss",this.instrumentationKey),this._instrumentationKey=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webSnippetConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webInstrumentationConnectionString",{get:a(function(){return this._webInstrumentationConnectionString},"get"),set:a(function(e){this._webInstrumentationConnectionString=e},"set"),enumerable:!1,configurable:!0}),t.prototype._mergeConfig=function(){var e=Oya.JsonConfig.getInstance();this._connectionString=e.connectionString,this._instrumentationKey=e.instrumentationKey,this.correlationHeaderExcludedDomains=e.correlationHeaderExcludedDomains,this.correlationIdRetryIntervalMs=e.correlationIdRetryIntervalMs,this.disableAllExtendedMetrics=e.disableAllExtendedMetrics,this.disableAppInsights=e.disableAppInsights,this.disableStatsbeat=e.disableStatsbeat,this.distributedTracingMode=e.distributedTracingMode,this.enableAutoCollectConsole=e.enableAutoCollectConsole,this.enableLoggerErrorToTrace=e.enableLoggerErrorToTrace,this.enableAutoCollectDependencies=e.enableAutoCollectDependencies,this.enableAutoCollectIncomingRequestAzureFunctions=e.enableAutoCollectIncomingRequestAzureFunctions,this.enableAutoCollectExceptions=e.enableAutoCollectExceptions,this.enableAutoCollectExtendedMetrics=e.enableAutoCollectExtendedMetrics,this.enableAutoCollectExternalLoggers=e.enableAutoCollectExternalLoggers,this.enableAutoCollectHeartbeat=e.enableAutoCollectHeartbeat,this.enableAutoCollectPerformance=e.enableAutoCollectPerformance,this.enableAutoCollectPreAggregatedMetrics=e.enableAutoCollectPreAggregatedMetrics,this.enableAutoCollectRequests=e.enableAutoCollectRequests,this.enableAutoDependencyCorrelation=e.enableAutoDependencyCorrelation,this.enableInternalDebugLogging=e.enableInternalDebugLogging,this.enableInternalWarningLogging=e.enableInternalWarningLogging,this.enableResendInterval=e.enableResendInterval,this.enableMaxBytesOnDisk=e.enableMaxBytesOnDisk,this.enableSendLiveMetrics=e.enableSendLiveMetrics,this.enableUseAsyncHooks=e.enableUseAsyncHooks,this.enableUseDiskRetryCaching=e.enableUseDiskRetryCaching,this.endpointUrl=e.endpointUrl,this.extendedMetricDisablers=e.extendedMetricDisablers,this.ignoreLegacyHeaders=e.ignoreLegacyHeaders,this.maxBatchIntervalMs=e.maxBatchIntervalMs,this.maxBatchSize=e.maxBatchSize,this.proxyHttpUrl=e.proxyHttpUrl,this.proxyHttpsUrl=e.proxyHttpsUrl,this.quickPulseHost=e.quickPulseHost,this.samplingPercentage=e.samplingPercentage,this.enableWebInstrumentation=e.enableWebInstrumentation,this._webInstrumentationConnectionString=e.webInstrumentationConnectionString,this.webInstrumentationConfig=e.webInstrumentationConfig,this.webInstrumentationSrc=e.webInstrumentationSrc},t._validateInstrumentationKey=function(e){var r="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",n=new RegExp(r);return n.test(e)},t.ENV_azurePrefix="APPSETTING_",t.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",t.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",t.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",t.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",t})();zEi.exports=Bya});var sAr=I(oAr=>{"use strict";p();Object.defineProperty(oAr,"__esModule",{value:!0});oAr.createEmptyPipeline=Lya;var YEi=new Set(["Deserialize","Serialize","Retry","Sign"]),iAr=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!YEi.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!YEi.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function Lya(){return iAr.create()}a(Lya,"createEmptyPipeline")});var see=I(jpt=>{"use strict";p();Object.defineProperty(jpt,"__esModule",{value:!0});jpt.logger=void 0;var Fya=sft();jpt.logger=(0,Fya.createClientLogger)("core-rest-pipeline")});var cAr=I(aAr=>{"use strict";p();Object.defineProperty(aAr,"__esModule",{value:!0});aAr.getRandomIntegerInclusive=Uya;function Uya(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(Uya,"getRandomIntegerInclusive")});var KEi=I(lAr=>{"use strict";p();Object.defineProperty(lAr,"__esModule",{value:!0});lAr.calculateRetryDelay=qya;var Qya=cAr();function qya(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,Qya.getRandomIntegerInclusive)(0,n/2)}}a(qya,"calculateRetryDelay")});var Hpt=I(uAr=>{"use strict";p();Object.defineProperty(uAr,"__esModule",{value:!0});uAr.isObject=jya;function jya(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(jya,"isObject")});var JEi=I(dAr=>{"use strict";p();Object.defineProperty(dAr,"__esModule",{value:!0});dAr.isError=Gya;var Hya=Hpt();function Gya(t){if((0,Hya.isObject)(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(Gya,"isError")});var XEi=I(Gpt=>{"use strict";p();Object.defineProperty(Gpt,"__esModule",{value:!0});Gpt.computeSha256Hmac=$ya;Gpt.computeSha256Hash=Vya;var ZEi=require("node:crypto");async function $ya(t,e,r){let n=Buffer.from(t,"base64");return(0,ZEi.createHmac)("sha256",n).update(e).digest(r)}a($ya,"computeSha256Hmac");async function Vya(t,e){return(0,ZEi.createHash)("sha256").update(t).digest(e)}a(Vya,"computeSha256Hash")});var e_i=I(pAr=>{"use strict";p();var fAr;Object.defineProperty(pAr,"__esModule",{value:!0});pAr.randomUUID=Yya;var Wya=require("node:crypto"),zya=typeof((fAr=globalThis?.crypto)===null||fAr===void 0?void 0:fAr.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Wya.randomUUID;function Yya(){return zya()}a(Yya,"randomUUID")});var t_i=I(dm=>{"use strict";p();var hAr,mAr,gAr,AAr;Object.defineProperty(dm,"__esModule",{value:!0});dm.isReactNative=dm.isNodeRuntime=dm.isNodeLike=dm.isBun=dm.isDeno=dm.isWebWorker=dm.isBrowser=void 0;dm.isBrowser=typeof window<"u"&&typeof window.document<"u";dm.isWebWorker=typeof self=="object"&&typeof self?.importScripts=="function"&&(((hAr=self.constructor)===null||hAr===void 0?void 0:hAr.name)==="DedicatedWorkerGlobalScope"||((mAr=self.constructor)===null||mAr===void 0?void 0:mAr.name)==="ServiceWorkerGlobalScope"||((gAr=self.constructor)===null||gAr===void 0?void 0:gAr.name)==="SharedWorkerGlobalScope");dm.isDeno=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";dm.isBun=typeof Bun<"u"&&typeof Bun.version<"u";dm.isNodeLike=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((AAr=globalThis.process.versions)===null||AAr===void 0)&&AAr.node);dm.isNodeRuntime=dm.isNodeLike&&!dm.isBun&&!dm.isDeno;dm.isReactNative=typeof navigator<"u"&&navigator?.product==="ReactNative"});var r_i=I($pt=>{"use strict";p();Object.defineProperty($pt,"__esModule",{value:!0});$pt.uint8ArrayToString=Kya;$pt.stringToUint8Array=Jya;function Kya(t,e){return Buffer.from(t).toString(e)}a(Kya,"uint8ArrayToString");function Jya(t,e){return Buffer.from(t,e)}a(Jya,"stringToUint8Array")});var n_i=I(Vpt=>{"use strict";p();Object.defineProperty(Vpt,"__esModule",{value:!0});Vpt.Sanitizer=void 0;var Zya=Hpt(),yAr="REDACTED",Xya=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],eEa=["api-version"],EAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=Xya.concat(e),r=eEa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,Zya.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,yAr);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=yAr;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=yAr;return r}};Vpt.Sanitizer=EAr});var Wpt=I(fa=>{"use strict";p();Object.defineProperty(fa,"__esModule",{value:!0});fa.Sanitizer=fa.uint8ArrayToString=fa.stringToUint8Array=fa.isWebWorker=fa.isReactNative=fa.isDeno=fa.isNodeRuntime=fa.isNodeLike=fa.isBun=fa.isBrowser=fa.randomUUID=fa.computeSha256Hmac=fa.computeSha256Hash=fa.isError=fa.isObject=fa.getRandomIntegerInclusive=fa.calculateRetryDelay=void 0;var tEa=KEi();Object.defineProperty(fa,"calculateRetryDelay",{enumerable:!0,get:a(function(){return tEa.calculateRetryDelay},"get")});var rEa=cAr();Object.defineProperty(fa,"getRandomIntegerInclusive",{enumerable:!0,get:a(function(){return rEa.getRandomIntegerInclusive},"get")});var nEa=Hpt();Object.defineProperty(fa,"isObject",{enumerable:!0,get:a(function(){return nEa.isObject},"get")});var iEa=JEi();Object.defineProperty(fa,"isError",{enumerable:!0,get:a(function(){return iEa.isError},"get")});var i_i=XEi();Object.defineProperty(fa,"computeSha256Hash",{enumerable:!0,get:a(function(){return i_i.computeSha256Hash},"get")});Object.defineProperty(fa,"computeSha256Hmac",{enumerable:!0,get:a(function(){return i_i.computeSha256Hmac},"get")});var oEa=e_i();Object.defineProperty(fa,"randomUUID",{enumerable:!0,get:a(function(){return oEa.randomUUID},"get")});var aee=t_i();Object.defineProperty(fa,"isBrowser",{enumerable:!0,get:a(function(){return aee.isBrowser},"get")});Object.defineProperty(fa,"isBun",{enumerable:!0,get:a(function(){return aee.isBun},"get")});Object.defineProperty(fa,"isNodeLike",{enumerable:!0,get:a(function(){return aee.isNodeLike},"get")});Object.defineProperty(fa,"isNodeRuntime",{enumerable:!0,get:a(function(){return aee.isNodeRuntime},"get")});Object.defineProperty(fa,"isDeno",{enumerable:!0,get:a(function(){return aee.isDeno},"get")});Object.defineProperty(fa,"isReactNative",{enumerable:!0,get:a(function(){return aee.isReactNative},"get")});Object.defineProperty(fa,"isWebWorker",{enumerable:!0,get:a(function(){return aee.isWebWorker},"get")});var o_i=r_i();Object.defineProperty(fa,"stringToUint8Array",{enumerable:!0,get:a(function(){return o_i.stringToUint8Array},"get")});Object.defineProperty(fa,"uint8ArrayToString",{enumerable:!0,get:a(function(){return o_i.uint8ArrayToString},"get")});var sEa=n_i();Object.defineProperty(fa,"Sanitizer",{enumerable:!0,get:a(function(){return sEa.Sanitizer},"get")})});var s_i=I(_Ar=>{"use strict";p();Object.defineProperty(_Ar,"__esModule",{value:!0});_Ar.cancelablePromiseRace=aEa;async function aEa(t,e){var r,n;let o=new AbortController;function s(){o.abort()}a(s,"abortHandler"),(r=e?.abortSignal)===null||r===void 0||r.addEventListener("abort",s);try{return await Promise.race(t.map(c=>c({abortSignal:o.signal})))}finally{o.abort(),(n=e?.abortSignal)===null||n===void 0||n.removeEventListener("abort",s)}}a(aEa,"cancelablePromiseRace")});var a_i=I(zpt=>{"use strict";p();Object.defineProperty(zpt,"__esModule",{value:!0});zpt.AbortError=void 0;var vAr=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};zpt.AbortError=vAr});var zNe=I(Ypt=>{"use strict";p();Object.defineProperty(Ypt,"__esModule",{value:!0});Ypt.AbortError=void 0;var cEa=a_i();Object.defineProperty(Ypt,"AbortError",{enumerable:!0,get:a(function(){return cEa.AbortError},"get")})});var bAr=I(CAr=>{"use strict";p();Object.defineProperty(CAr,"__esModule",{value:!0});CAr.createAbortablePromise=uEa;var lEa=zNe();function uEa(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new lEa.AbortError(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(uEa,"createAbortablePromise")});var c_i=I(Kpt=>{"use strict";p();Object.defineProperty(Kpt,"__esModule",{value:!0});Kpt.delay=hEa;Kpt.calculateRetryDelay=mEa;var dEa=bAr(),fEa=Wpt(),pEa="The delay was aborted.";function hEa(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return(0,dEa.createAbortablePromise)(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??pEa})}a(hEa,"delay");function mEa(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+(0,fEa.getRandomIntegerInclusive)(0,n/2)}}a(mEa,"calculateRetryDelay")});var l_i=I(SAr=>{"use strict";p();Object.defineProperty(SAr,"__esModule",{value:!0});SAr.getErrorMessage=AEa;var gEa=Wpt();function AEa(t){if((0,gEa.isError)(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(AEa,"getErrorMessage")});var d_i=I(YNe=>{"use strict";p();Object.defineProperty(YNe,"__esModule",{value:!0});YNe.isDefined=TAr;YNe.isObjectWithProperties=yEa;YNe.objectHasProperty=u_i;function TAr(t){return typeof t<"u"&&t!==null}a(TAr,"isDefined");function yEa(t,e){if(!TAr(t)||typeof t!="object")return!1;for(let r of e)if(!u_i(t,r))return!1;return!0}a(yEa,"isObjectWithProperties");function u_i(t,e){return TAr(t)&&typeof t=="object"&&e in t}a(u_i,"objectHasProperty")});var Z5=I(rs=>{"use strict";p();Object.defineProperty(rs,"__esModule",{value:!0});rs.isWebWorker=rs.isReactNative=rs.isNodeRuntime=rs.isNodeLike=rs.isNode=rs.isDeno=rs.isBun=rs.isBrowser=rs.objectHasProperty=rs.isObjectWithProperties=rs.isDefined=rs.getErrorMessage=rs.delay=rs.createAbortablePromise=rs.cancelablePromiseRace=void 0;rs.calculateRetryDelay=SEa;rs.computeSha256Hash=TEa;rs.computeSha256Hmac=IEa;rs.getRandomIntegerInclusive=xEa;rs.isError=wEa;rs.isObject=REa;rs.randomUUID=PEa;rs.uint8ArrayToString=kEa;rs.stringToUint8Array=DEa;var EEa=(wL(),ya(h7)),KA=EEa.__importStar(Wpt()),_Ea=s_i();Object.defineProperty(rs,"cancelablePromiseRace",{enumerable:!0,get:a(function(){return _Ea.cancelablePromiseRace},"get")});var vEa=bAr();Object.defineProperty(rs,"createAbortablePromise",{enumerable:!0,get:a(function(){return vEa.createAbortablePromise},"get")});var CEa=c_i();Object.defineProperty(rs,"delay",{enumerable:!0,get:a(function(){return CEa.delay},"get")});var bEa=l_i();Object.defineProperty(rs,"getErrorMessage",{enumerable:!0,get:a(function(){return bEa.getErrorMessage},"get")});var IAr=d_i();Object.defineProperty(rs,"isDefined",{enumerable:!0,get:a(function(){return IAr.isDefined},"get")});Object.defineProperty(rs,"isObjectWithProperties",{enumerable:!0,get:a(function(){return IAr.isObjectWithProperties},"get")});Object.defineProperty(rs,"objectHasProperty",{enumerable:!0,get:a(function(){return IAr.objectHasProperty},"get")});function SEa(t,e){return KA.calculateRetryDelay(t,e)}a(SEa,"calculateRetryDelay");function TEa(t,e){return KA.computeSha256Hash(t,e)}a(TEa,"computeSha256Hash");function IEa(t,e,r){return KA.computeSha256Hmac(t,e,r)}a(IEa,"computeSha256Hmac");function xEa(t,e){return KA.getRandomIntegerInclusive(t,e)}a(xEa,"getRandomIntegerInclusive");function wEa(t){return KA.isError(t)}a(wEa,"isError");function REa(t){return KA.isObject(t)}a(REa,"isObject");function PEa(){return KA.randomUUID()}a(PEa,"randomUUID");rs.isBrowser=KA.isBrowser;rs.isBun=KA.isBun;rs.isDeno=KA.isDeno;rs.isNode=KA.isNodeLike;rs.isNodeLike=KA.isNodeLike;rs.isNodeRuntime=KA.isNodeRuntime;rs.isReactNative=KA.isReactNative;rs.isWebWorker=KA.isWebWorker;function kEa(t,e){return KA.uint8ArrayToString(t,e)}a(kEa,"uint8ArrayToString");function DEa(t,e){return KA.stringToUint8Array(t,e)}a(DEa,"stringToUint8Array")});var Zpt=I(Jpt=>{"use strict";p();Object.defineProperty(Jpt,"__esModule",{value:!0});Jpt.Sanitizer=void 0;var NEa=Z5(),xAr="REDACTED",MEa=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],OEa=["api-version"],wAr=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=MEa.concat(e),r=OEa.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||(0,NEa.isObject)(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,xAr);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=xAr;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=xAr;return r}};Jpt.Sanitizer=wAr});var RAr=I(v0e=>{"use strict";p();Object.defineProperty(v0e,"__esModule",{value:!0});v0e.logPolicyName=void 0;v0e.logPolicy=FEa;var BEa=see(),LEa=Zpt();v0e.logPolicyName="logPolicy";function FEa(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:BEa.logger.info,n=new LEa.Sanitizer({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:v0e.logPolicyName,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(FEa,"logPolicy")});var PAr=I(C0e=>{"use strict";p();Object.defineProperty(C0e,"__esModule",{value:!0});C0e.redirectPolicyName=void 0;C0e.redirectPolicy=UEa;C0e.redirectPolicyName="redirectPolicy";var f_i=["GET","HEAD"];function UEa(t={}){let{maxRetries:e=20}=t;return{name:C0e.redirectPolicyName,async sendRequest(r,n){let o=await n(r);return p_i(n,o,e)}}}a(UEa,"redirectPolicy");async function p_i(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&f_i.includes(o.method)||s===302&&f_i.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{"use strict";p();Object.defineProperty(Xpt,"__esModule",{value:!0});Xpt.getHeaderName=QEa;Xpt.setPlatformSpecificData=qEa;var h_i=(wL(),ya(h7)),kAr=h_i.__importStar(require("node:os")),DAr=h_i.__importStar(require("node:process"));function QEa(){return"User-Agent"}a(QEa,"getHeaderName");async function qEa(t){if(DAr&&DAr.versions){let e=DAr.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${kAr.arch()}-${kAr.type()}-${kAr.release()})`)}a(qEa,"setPlatformSpecificData")});var FH=I(b0e=>{"use strict";p();Object.defineProperty(b0e,"__esModule",{value:!0});b0e.DEFAULT_RETRY_POLICY_COUNT=b0e.SDK_VERSION=void 0;b0e.SDK_VERSION="1.16.3";b0e.DEFAULT_RETRY_POLICY_COUNT=3});var NAr=I(eht=>{"use strict";p();Object.defineProperty(eht,"__esModule",{value:!0});eht.getUserAgentHeaderName=GEa;eht.getUserAgentValue=$Ea;var g_i=m_i(),jEa=FH();function HEa(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(HEa,"getUserAgentString");function GEa(){return(0,g_i.getHeaderName)()}a(GEa,"getUserAgentHeaderName");async function $Ea(t){let e=new Map;e.set("core-rest-pipeline",jEa.SDK_VERSION),await(0,g_i.setPlatformSpecificData)(e);let r=HEa(e);return t?`${t} ${r}`:r}a($Ea,"getUserAgentValue")});var MAr=I(S0e=>{"use strict";p();Object.defineProperty(S0e,"__esModule",{value:!0});S0e.userAgentPolicyName=void 0;S0e.userAgentPolicy=VEa;var y_i=NAr(),A_i=(0,y_i.getUserAgentHeaderName)();S0e.userAgentPolicyName="userAgentPolicy";function VEa(t={}){let e=(0,y_i.getUserAgentValue)(t.userAgentPrefix);return{name:S0e.userAgentPolicyName,async sendRequest(r,n){return r.headers.has(A_i)||r.headers.set(A_i,await e),n(r)}}}a(VEa,"userAgentPolicy")});var tht=I(T0e=>{"use strict";p();Object.defineProperty(T0e,"__esModule",{value:!0});T0e.isNodeReadableStream=E_i;T0e.isWebReadableStream=__i;T0e.isReadableStream=WEa;T0e.isBlob=zEa;function E_i(t){return!!(t&&typeof t.pipe=="function")}a(E_i,"isNodeReadableStream");function __i(t){return!!(t&&typeof t.getReader=="function"&&typeof t.tee=="function")}a(__i,"isWebReadableStream");function WEa(t){return E_i(t)||__i(t)}a(WEa,"isReadableStream");function zEa(t){return typeof t.stream=="function"}a(zEa,"isBlob")});var OAr=I(KNe=>{"use strict";p();Object.defineProperty(KNe,"__esModule",{value:!0});KNe.getRawContent=ZEa;KNe.createFileFromStream=XEa;KNe.createFile=e_a;var YEa=Z5(),KEa=tht(),v_i={arrayBuffer:a(()=>{throw new Error("Not implemented")},"arrayBuffer"),slice:a(()=>{throw new Error("Not implemented")},"slice"),text:a(()=>{throw new Error("Not implemented")},"text")},rht=Symbol("rawContent");function JEa(t){return typeof t[rht]=="function"}a(JEa,"hasRawContent");function ZEa(t){return JEa(t)?t[rht]():t.stream()}a(ZEa,"getRawContent");function XEa(t,e,r={}){var n,o,s,c;return Object.assign(Object.assign({},v_i),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:(c=r.size)!==null&&c!==void 0?c:-1,name:e,stream:a(()=>{let l=t();if((0,KEa.isNodeReadableStream)(l))throw new Error("Not supported: a Node stream was provided as input to createFileFromStream.");return l},"stream"),[rht]:t})}a(XEa,"createFileFromStream");function e_a(t,e,r={}){var n,o,s;return YEa.isNodeLike?Object.assign(Object.assign({},v_i),{type:(n=r.type)!==null&&n!==void 0?n:"",lastModified:(o=r.lastModified)!==null&&o!==void 0?o:new Date().getTime(),webkitRelativePath:(s=r.webkitRelativePath)!==null&&s!==void 0?s:"",size:t.byteLength,name:e,arrayBuffer:a(async()=>t.buffer,"arrayBuffer"),stream:a(()=>new Blob([t]).stream(),"stream"),[rht]:()=>t}):new File([t],e,r)}a(e_a,"createFile")});var S_i=I(LAr=>{"use strict";p();Object.defineProperty(LAr,"__esModule",{value:!0});LAr.concat=o_a;var a8=(wL(),ya(h7)),BAr=require("node:stream"),t_a=tht(),r_a=OAr();function C_i(){return a8.__asyncGenerator(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield a8.__await(e.read());if(r)return yield a8.__await(void 0);yield yield a8.__await(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(C_i,"streamAsyncIterator");function n_a(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=C_i.bind(t)),t.values||(t.values=C_i.bind(t))}a(n_a,"makeAsyncIterable");function i_a(t){return t instanceof ReadableStream?(n_a(t),BAr.Readable.fromWeb(t)):t}a(i_a,"ensureNodeStream");function b_i(t){return t instanceof Uint8Array?BAr.Readable.from(Buffer.from(t)):(0,t_a.isBlob)(t)?b_i((0,r_a.getRawContent)(t)):i_a(t)}a(b_i,"toStream");async function o_a(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(b_i);return BAr.Readable.from((function(){return a8.__asyncGenerator(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,a8.__asyncValues(d)),u;u=yield a8.__await(l.next()),r=u.done,!r;c=!0){s=u.value,c=!1;let f=s;yield yield a8.__await(f)}}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield a8.__await(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(o_a,"concat")});var FAr=I(I0e=>{"use strict";p();Object.defineProperty(I0e,"__esModule",{value:!0});I0e.multipartPolicyName=void 0;I0e.multipartPolicy=g_a;var cee=Z5(),s_a=S_i(),a_a=tht();function c_a(){return`----AzSDKFormBoundary${(0,cee.randomUUID)()}`}a(c_a,"generateBoundary");function l_a(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(l_a,"encodeHeaders");function u_a(t){return t instanceof Uint8Array?t.byteLength:(0,a_a.isBlob)(t)?t.size===-1?void 0:t.size:void 0}a(u_a,"getLength");function d_a(t){let e=0;for(let r of t){let n=u_a(r);if(n===void 0)return;e+=n}return e}a(d_a,"getTotalLength");async function f_a(t,e,r){let n=[(0,cee.stringToUint8Array)(`--${r}`,"utf-8"),...e.flatMap(s=>[(0,cee.stringToUint8Array)(`\r +`,"utf-8"),(0,cee.stringToUint8Array)(l_a(s.headers),"utf-8"),(0,cee.stringToUint8Array)(`\r +`,"utf-8"),s.body,(0,cee.stringToUint8Array)(`\r +--${r}`,"utf-8")]),(0,cee.stringToUint8Array)(`--\r \r -`,"utf-8")],o=j_a(n);o&&t.headers.set("Content-Length",o),t.body=await(0,L_a.concat)(n)}a(H_a,"buildRequestBody");M0e.multipartPolicyName="multipartPolicy";var G_a=70,$_a=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function V_a(t){if(t.length>G_a)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!$_a.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(V_a,"assertValidBoundary");function W_a(){return{name:M0e.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?V_a(n):n=U_a(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await H_a(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(W_a,"multipartPolicy")});var DAr=I(O0e=>{"use strict";p();Object.defineProperty(O0e,"__esModule",{value:!0});O0e.decompressResponsePolicyName=void 0;O0e.decompressResponsePolicy=z_a;O0e.decompressResponsePolicyName="decompressResponsePolicy";function z_a(){return{name:O0e.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(z_a,"decompressResponsePolicy")});var rht=I(tht=>{"use strict";p();Object.defineProperty(tht,"__esModule",{value:!0});tht.delay=J_a;tht.parseHeaderValueAsNumber=Z_a;var Y_a=iMe(),K_a="The operation was aborted.";function J_a(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new Y_a.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:K_a)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(J_a,"delay");function Z_a(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Z_a,"parseHeaderValueAsNumber")});var iht=I(nht=>{"use strict";p();Object.defineProperty(nht,"__esModule",{value:!0});nht.isThrottlingRetryResponse=tCa;nht.throttlingRetryStrategy=rCa;var X_a=rht(),NAr="Retry-After",eCa=["retry-after-ms","x-ms-retry-after-ms",NAr];function zEi(t){if(t&&[429,503].includes(t.status))try{for(let o of eCa){let s=(0,X_a.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===NAr?1e3:1)}let e=t.headers.get(NAr);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(zEi,"getRetryAfterInMs");function tCa(t){return Number.isFinite(zEi(t))}a(tCa,"isThrottlingRetryResponse");function rCa(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=zEi(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(rCa,"throttlingRetryStrategy")});var oht=I(aMe=>{"use strict";p();Object.defineProperty(aMe,"__esModule",{value:!0});aMe.exponentialRetryStrategy=aCa;aMe.isExponentialRetryResponse=YEi;aMe.isSystemError=KEi;var nCa=n4(),iCa=iht(),oCa=1e3,sCa=1e3*64;function aCa(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:oCa,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:sCa,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=KEi(u),f=d&&t.ignoreSystemErrors,h=YEi(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,iCa.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,nCa.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(aCa,"exponentialRetryStrategy");function YEi(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(YEi,"isExponentialRetryResponse");function KEi(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(KEi,"isSystemError")});var B0e=I(MAr=>{"use strict";p();Object.defineProperty(MAr,"__esModule",{value:!0});MAr.retryPolicy=fCa;var cCa=rht(),lCa=ift(),uCa=iMe(),JEi=VH(),ZEi=(0,lCa.createClientLogger)("core-rest-pipeline retryPolicy"),dCa="retryPolicy";function fCa(t,e={maxRetries:JEi.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||ZEi;return{name:dCa,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new uCa.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:JEi.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||ZEi;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,cCa.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(fCa,"retryPolicy")});var OAr=I(L0e=>{"use strict";p();Object.defineProperty(L0e,"__esModule",{value:!0});L0e.defaultRetryPolicyName=void 0;L0e.defaultRetryPolicy=ACa;var pCa=oht(),hCa=iht(),mCa=B0e(),gCa=VH();L0e.defaultRetryPolicyName="defaultRetryPolicy";function ACa(t={}){var e;return{name:L0e.defaultRetryPolicyName,sendRequest:(0,mCa.retryPolicy)([(0,hCa.throttlingRetryStrategy)(),(0,pCa.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:gCa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(ACa,"defaultRetryPolicy")});var cMe=I(LAr=>{"use strict";p();Object.defineProperty(LAr,"__esModule",{value:!0});LAr.createHttpHeaders=ECa;function sht(t){return t.toLowerCase()}a(sht,"normalizeName");function*yCa(t){for(let e of t.values())yield[e.name,e.value]}a(yCa,"headerIterator");var BAr=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(sht(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(sht(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(sht(e))}delete(e){this._headersMap.delete(sht(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return yCa(this._headersMap)}};function ECa(t){return new BAr(t)}a(ECa,"createHttpHeaders")});var FAr=I(F0e=>{"use strict";p();Object.defineProperty(F0e,"__esModule",{value:!0});F0e.formDataPolicyName=void 0;F0e.formDataPolicy=CCa;var e_i=n4(),XEi=cMe();F0e.formDataPolicyName="formDataPolicy";function _Ca(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(_Ca,"formDataToFormDataMap");function CCa(){return{name:F0e.formDataPolicyName,async sendRequest(t,e){if(e_i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=_Ca(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=vCa(t.formData):await bCa(t.formData,t),t.formData=void 0}return e(t)}}}a(CCa,"formDataPolicy");function vCa(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(vCa,"wwwFormUrlEncode");async function bCa(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,XEi.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,e_i.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,XEi.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(bCa,"prepareFormData")});var UAr=I(tR=>{"use strict";p();Object.defineProperty(tR,"__esModule",{value:!0});tR.globalNoProxyList=tR.proxyPolicyName=void 0;tR.loadNoProxy=o_i;tR.getDefaultProxySettings=NCa;tR.proxyPolicy=OCa;var SCa=vBt(),TCa=bBt(),ICa=uee(),xCa="HTTPS_PROXY",wCa="HTTP_PROXY",RCa="ALL_PROXY",kCa="NO_PROXY";tR.proxyPolicyName="proxyPolicy";tR.globalNoProxyList=[];var n_i=!1,PCa=new Map;function aht(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(aht,"getEnvironmentValue");function i_i(){if(!process)return;let t=aht(xCa),e=aht(RCa),r=aht(wCa);return t||e||r}a(i_i,"loadEnvironmentProxyValue");function DCa(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(DCa,"isBypassed");function o_i(){let t=aht(kCa);return n_i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(o_i,"loadNoProxy");function NCa(t){if(!t&&(t=i_i(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(NCa,"getDefaultProxySettings");function MCa(){let t=i_i();return t?new URL(t):void 0}a(MCa,"getDefaultProxySettingsInternal");function t_i(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(t_i,"getUrlFromProxySettings");function r_i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ICa.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new TCa.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new SCa.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(r_i,"setProxyAgentOnRequest");function OCa(t,e){n_i||tR.globalNoProxyList.push(...o_i());let r=t?t_i(t):MCa(),n={};return{name:tR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!DCa(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:tR.globalNoProxyList,e?.customNoProxyList?void 0:PCa)?r_i(o,n,r):o.proxySettings&&r_i(o,n,t_i(o.proxySettings)),s(o)}}}a(OCa,"proxyPolicy")});var QAr=I(U0e=>{"use strict";p();Object.defineProperty(U0e,"__esModule",{value:!0});U0e.setClientRequestIdPolicyName=void 0;U0e.setClientRequestIdPolicy=BCa;U0e.setClientRequestIdPolicyName="setClientRequestIdPolicy";function BCa(t="x-ms-client-request-id"){return{name:U0e.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(BCa,"setClientRequestIdPolicy")});var qAr=I(Q0e=>{"use strict";p();Object.defineProperty(Q0e,"__esModule",{value:!0});Q0e.tlsPolicyName=void 0;Q0e.tlsPolicy=LCa;Q0e.tlsPolicyName="tlsPolicy";function LCa(t){return{name:Q0e.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(LCa,"tlsPolicy")});var jAr=I(g8=>{"use strict";p();Object.defineProperty(g8,"__esModule",{value:!0});g8.TracingContextImpl=g8.knownContextKeys=void 0;g8.createTracingContext=FCa;g8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function FCa(t={}){let e=new cht(t.parentContext);return t.span&&(e=e.setValue(g8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(g8.knownContextKeys.namespace,t.namespace)),e}a(FCa,"createTracingContext");var cht=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};g8.TracingContextImpl=cht});var HAr=I(q0e=>{"use strict";p();Object.defineProperty(q0e,"__esModule",{value:!0});q0e.createDefaultTracingSpan=s_i;q0e.createDefaultInstrumenter=a_i;q0e.useInstrumenter=QCa;q0e.getInstrumenter=qCa;var UCa=jAr(),lht=gMt();function s_i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(s_i,"createDefaultTracingSpan");function a_i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:s_i(),tracingContext:(0,UCa.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(a_i,"createDefaultInstrumenter");function QCa(t){lht.state.instrumenterImplementation=t}a(QCa,"useInstrumenter");function qCa(){return lht.state.instrumenterImplementation||(lht.state.instrumenterImplementation=a_i()),lht.state.instrumenterImplementation}a(qCa,"getInstrumenter")});var c_i=I($Ar=>{"use strict";p();Object.defineProperty($Ar,"__esModule",{value:!0});$Ar.createTracingClient=jCa;var uht=HAr(),GAr=jAr();function jCa(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,uht.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(GAr.knownContextKeys.namespace)||(A=A.setValue(GAr.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(GAr.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,uht.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,uht.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,uht.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(jCa,"createTracingClient")});var l_i=I(j0e=>{"use strict";p();Object.defineProperty(j0e,"__esModule",{value:!0});j0e.createTracingClient=j0e.useInstrumenter=void 0;var HCa=HAr();Object.defineProperty(j0e,"useInstrumenter",{enumerable:!0,get:a(function(){return HCa.useInstrumenter},"get")});var GCa=c_i();Object.defineProperty(j0e,"createTracingClient",{enumerable:!0,get:a(function(){return GCa.createTracingClient},"get")})});var u_i=I(dht=>{"use strict";p();Object.defineProperty(dht,"__esModule",{value:!0});dht.custom=void 0;var $Ca=require("node:util");dht.custom=$Ca.inspect.custom});var fht=I(lMe=>{"use strict";p();Object.defineProperty(lMe,"__esModule",{value:!0});lMe.RestError=void 0;lMe.isRestError=KCa;var VCa=n4(),WCa=u_i(),zCa=Kpt(),YCa=new zCa.Sanitizer,H0e=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[WCa.custom](){return`RestError: ${this.message} - ${YCa.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};lMe.RestError=H0e;H0e.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";H0e.PARSE_ERROR="PARSE_ERROR";function KCa(t){return t instanceof H0e?!0:(0,VCa.isError)(t)&&t.name==="RestError"}a(KCa,"isRestError")});var VAr=I(G0e=>{"use strict";p();Object.defineProperty(G0e,"__esModule",{value:!0});G0e.tracingPolicyName=void 0;G0e.tracingPolicy=rva;var JCa=l_i(),ZCa=VH(),XCa=IAr(),pht=uee(),uMe=n4(),eva=fht(),tva=Kpt();G0e.tracingPolicyName="tracingPolicy";function rva(t={}){let e=(0,XCa.getUserAgentValue)(t.userAgentPrefix),r=new tva.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=nva();return{name:G0e.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=iva(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return sva(f,m),m}catch(m){throw ova(f,m),m}}}}a(rva,"tracingPolicy");function nva(){try{return(0,JCa.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:ZCa.SDK_VERSION})}catch(t){pht.logger.warning(`Error when creating the TracingClient: ${(0,uMe.getErrorMessage)(t)}`);return}}a(nva,"tryCreateTracingClient");function iva(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){pht.logger.warning(`Skipping creating a tracing span due to an error: ${(0,uMe.getErrorMessage)(n)}`);return}}a(iva,"tryCreateSpan");function ova(t,e){try{t.setStatus({status:"error",error:(0,uMe.isError)(e)?e:void 0}),(0,eva.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){pht.logger.warning(`Skipping tracing span processing due to an error: ${(0,uMe.getErrorMessage)(r)}`)}}a(ova,"tryProcessError");function sva(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){pht.logger.warning(`Skipping tracing span processing due to an error: ${(0,uMe.getErrorMessage)(r)}`)}}a(sva,"tryProcessResponse")});var p_i=I(WAr=>{"use strict";p();Object.defineProperty(WAr,"__esModule",{value:!0});WAr.createPipelineFromOptions=yva;var ava=vAr(),cva=Xgr(),lva=bAr(),uva=xAr(),d_i=PAr(),dva=DAr(),fva=OAr(),pva=FAr(),f_i=n4(),hva=UAr(),mva=QAr(),gva=qAr(),Ava=VAr();function yva(t){var e;let r=(0,cva.createEmptyPipeline)();return f_i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,gva.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,hva.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,dva.decompressResponsePolicy)())),r.addPolicy((0,pva.formDataPolicy)(),{beforePolicies:[d_i.multipartPolicyName]}),r.addPolicy((0,uva.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,mva.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,d_i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,fva.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Ava.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),f_i.isNodeLike&&r.addPolicy((0,lva.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,ava.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(yva,"createPipelineFromOptions")});var E_i=I(mht=>{"use strict";p();Object.defineProperty(mht,"__esModule",{value:!0});mht.getBodyLength=y_i;mht.createNodeHttpClient=Tva;var JAr=(OL(),Ca(E7)),zAr=JAr.__importStar(require("node:http")),YAr=JAr.__importStar(require("node:https")),h_i=JAr.__importStar(require("node:zlib")),Eva=require("node:stream"),m_i=iMe(),_va=cMe(),pMe=fht(),dMe=uee(),Cva={};function fMe(t){return t&&typeof t.pipe=="function"}a(fMe,"isReadableStream");function g_i(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(g_i,"isStreamComplete");function A_i(t){return t&&typeof t.byteLength=="number"}a(A_i,"isArrayBuffer");var hht=class extends Eva.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},KAr=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new m_i.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=y_i(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new hht(E);_.on("error",v=>{dMe.logger.error("Error in upload progress",v)}),fMe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=vva(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?bva(h,m):h;let y=e.onDownloadProgress;if(y){let E=new hht(y);E.on("error",_=>{dMe.logger.error("Error in download progress",_)}),f.pipe(E),f=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await Sva(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();fMe(d)&&(h=g_i(d));let m=Promise.resolve();fMe(f)&&(m=g_i(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{dMe.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?zAr.request(u,d):YAr.request(u,d);h.once("error",m=>{var g;f(new pMe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:pMe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new m_i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&fMe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):A_i(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(dMe.logger.error("Unrecognized body type",n),f(new pMe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?zAr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new zAr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return YAr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Cva,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(dMe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new YAr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function vva(t){let e=(0,_va.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(vva,"getResponseHeaders");function bva(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=h_i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=h_i.createInflate();return t.pipe(n),n}return t}a(bva,"getDecodedResponseStream");function Sva(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new pMe.RestError(`Error reading response as text: ${o.message}`,{code:pMe.RestError.PARSE_ERROR}))})})}a(Sva,"streamToText");function y_i(t){return t?Buffer.isBuffer(t)?t.length:fMe(t)?null:A_i(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(y_i,"getBodyLength");function Tva(){return new KAr}a(Tva,"createNodeHttpClient")});var __i=I(ZAr=>{"use strict";p();Object.defineProperty(ZAr,"__esModule",{value:!0});ZAr.createDefaultHttpClient=xva;var Iva=E_i();function xva(){return(0,Iva.createNodeHttpClient)()}a(xva,"createDefaultHttpClient")});var C_i=I(eyr=>{"use strict";p();Object.defineProperty(eyr,"__esModule",{value:!0});eyr.createPipelineRequest=kva;var wva=cMe(),Rva=n4(),XAr=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,wva.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,Rva.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function kva(t){return new XAr(t)}a(kva,"createPipelineRequest")});var v_i=I(hMe=>{"use strict";p();Object.defineProperty(hMe,"__esModule",{value:!0});hMe.exponentialRetryPolicyName=void 0;hMe.exponentialRetryPolicy=Mva;var Pva=oht(),Dva=B0e(),Nva=VH();hMe.exponentialRetryPolicyName="exponentialRetryPolicy";function Mva(t={}){var e;return(0,Dva.retryPolicy)([(0,Pva.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Nva.DEFAULT_RETRY_POLICY_COUNT})}a(Mva,"exponentialRetryPolicy")});var b_i=I($0e=>{"use strict";p();Object.defineProperty($0e,"__esModule",{value:!0});$0e.systemErrorRetryPolicyName=void 0;$0e.systemErrorRetryPolicy=Fva;var Ova=oht(),Bva=B0e(),Lva=VH();$0e.systemErrorRetryPolicyName="systemErrorRetryPolicy";function Fva(t={}){var e;return{name:$0e.systemErrorRetryPolicyName,sendRequest:(0,Bva.retryPolicy)([(0,Ova.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:Lva.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Fva,"systemErrorRetryPolicy")});var S_i=I(V0e=>{"use strict";p();Object.defineProperty(V0e,"__esModule",{value:!0});V0e.throttlingRetryPolicyName=void 0;V0e.throttlingRetryPolicy=jva;var Uva=iht(),Qva=B0e(),qva=VH();V0e.throttlingRetryPolicyName="throttlingRetryPolicy";function jva(t={}){var e;return{name:V0e.throttlingRetryPolicyName,sendRequest:(0,Qva.retryPolicy)([(0,Uva.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:qva.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(jva,"throttlingRetryPolicy")});var tyr=I(W0e=>{"use strict";p();Object.defineProperty(W0e,"__esModule",{value:!0});W0e.DEFAULT_CYCLER_OPTIONS=void 0;W0e.createTokenCycler=$va;var Hva=rht();W0e.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Gva(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a($va,"createTokenCycler")});var T_i=I(z0e=>{"use strict";p();Object.defineProperty(z0e,"__esModule",{value:!0});z0e.bearerTokenAuthenticationPolicyName=void 0;z0e.bearerTokenAuthenticationPolicy=Kva;var Vva=tyr(),Wva=uee();z0e.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function zva(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(zva,"defaultAuthorizeRequest");function Yva(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(Yva,"getChallenge");function Kva(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||Wva.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:zva,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,Vva.createTokenCycler)(r):()=>Promise.resolve(null);return{name:z0e.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&Yva(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(Kva,"bearerTokenAuthenticationPolicy")});var I_i=I(Y0e=>{"use strict";p();Object.defineProperty(Y0e,"__esModule",{value:!0});Y0e.ndJsonPolicyName=void 0;Y0e.ndJsonPolicy=Jva;Y0e.ndJsonPolicyName="ndJsonPolicy";function Jva(){return{name:Y0e.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` -`).join(""))}return e(t)}}}a(Jva,"ndJsonPolicy")});var w_i=I(pee=>{"use strict";p();Object.defineProperty(pee,"__esModule",{value:!0});pee.auxiliaryAuthenticationHeaderPolicyName=void 0;pee.auxiliaryAuthenticationHeaderPolicy=tba;var Zva=tyr(),Xva=uee();pee.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var x_i="x-ms-authorization-auxiliary";async function eba(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(eba,"sendAuthorizeRequest");function tba(t){let{credentials:e,scopes:r}=t,n=t.logger||Xva.logger,o=new WeakMap;return{name:pee.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${pee.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,Zva.createTokenCycler)(d),o.set(d,f)),l.push(eba({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${x_i} header will not be set.`),c(s)):(s.headers.set(x_i,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(tba,"auxiliaryAuthenticationHeaderPolicy")});var V_i=I(Cr=>{"use strict";p();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.createFileFromStream=Cr.createFile=Cr.auxiliaryAuthenticationHeaderPolicyName=Cr.auxiliaryAuthenticationHeaderPolicy=Cr.ndJsonPolicyName=Cr.ndJsonPolicy=Cr.bearerTokenAuthenticationPolicyName=Cr.bearerTokenAuthenticationPolicy=Cr.formDataPolicyName=Cr.formDataPolicy=Cr.tlsPolicyName=Cr.tlsPolicy=Cr.userAgentPolicyName=Cr.userAgentPolicy=Cr.defaultRetryPolicy=Cr.tracingPolicyName=Cr.tracingPolicy=Cr.retryPolicy=Cr.throttlingRetryPolicyName=Cr.throttlingRetryPolicy=Cr.systemErrorRetryPolicyName=Cr.systemErrorRetryPolicy=Cr.redirectPolicyName=Cr.redirectPolicy=Cr.getDefaultProxySettings=Cr.proxyPolicyName=Cr.proxyPolicy=Cr.multipartPolicyName=Cr.multipartPolicy=Cr.logPolicyName=Cr.logPolicy=Cr.setClientRequestIdPolicyName=Cr.setClientRequestIdPolicy=Cr.exponentialRetryPolicyName=Cr.exponentialRetryPolicy=Cr.decompressResponsePolicyName=Cr.decompressResponsePolicy=Cr.isRestError=Cr.RestError=Cr.createPipelineRequest=Cr.createHttpHeaders=Cr.createDefaultHttpClient=Cr.createPipelineFromOptions=Cr.createEmptyPipeline=void 0;var rba=Xgr();Object.defineProperty(Cr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return rba.createEmptyPipeline},"get")});var nba=p_i();Object.defineProperty(Cr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return nba.createPipelineFromOptions},"get")});var iba=__i();Object.defineProperty(Cr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return iba.createDefaultHttpClient},"get")});var oba=cMe();Object.defineProperty(Cr,"createHttpHeaders",{enumerable:!0,get:a(function(){return oba.createHttpHeaders},"get")});var sba=C_i();Object.defineProperty(Cr,"createPipelineRequest",{enumerable:!0,get:a(function(){return sba.createPipelineRequest},"get")});var R_i=fht();Object.defineProperty(Cr,"RestError",{enumerable:!0,get:a(function(){return R_i.RestError},"get")});Object.defineProperty(Cr,"isRestError",{enumerable:!0,get:a(function(){return R_i.isRestError},"get")});var k_i=DAr();Object.defineProperty(Cr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return k_i.decompressResponsePolicy},"get")});Object.defineProperty(Cr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return k_i.decompressResponsePolicyName},"get")});var P_i=v_i();Object.defineProperty(Cr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return P_i.exponentialRetryPolicy},"get")});Object.defineProperty(Cr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return P_i.exponentialRetryPolicyName},"get")});var D_i=QAr();Object.defineProperty(Cr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return D_i.setClientRequestIdPolicy},"get")});Object.defineProperty(Cr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return D_i.setClientRequestIdPolicyName},"get")});var N_i=vAr();Object.defineProperty(Cr,"logPolicy",{enumerable:!0,get:a(function(){return N_i.logPolicy},"get")});Object.defineProperty(Cr,"logPolicyName",{enumerable:!0,get:a(function(){return N_i.logPolicyName},"get")});var M_i=PAr();Object.defineProperty(Cr,"multipartPolicy",{enumerable:!0,get:a(function(){return M_i.multipartPolicy},"get")});Object.defineProperty(Cr,"multipartPolicyName",{enumerable:!0,get:a(function(){return M_i.multipartPolicyName},"get")});var ryr=UAr();Object.defineProperty(Cr,"proxyPolicy",{enumerable:!0,get:a(function(){return ryr.proxyPolicy},"get")});Object.defineProperty(Cr,"proxyPolicyName",{enumerable:!0,get:a(function(){return ryr.proxyPolicyName},"get")});Object.defineProperty(Cr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return ryr.getDefaultProxySettings},"get")});var O_i=bAr();Object.defineProperty(Cr,"redirectPolicy",{enumerable:!0,get:a(function(){return O_i.redirectPolicy},"get")});Object.defineProperty(Cr,"redirectPolicyName",{enumerable:!0,get:a(function(){return O_i.redirectPolicyName},"get")});var B_i=b_i();Object.defineProperty(Cr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return B_i.systemErrorRetryPolicy},"get")});Object.defineProperty(Cr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return B_i.systemErrorRetryPolicyName},"get")});var L_i=S_i();Object.defineProperty(Cr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return L_i.throttlingRetryPolicy},"get")});Object.defineProperty(Cr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return L_i.throttlingRetryPolicyName},"get")});var aba=B0e();Object.defineProperty(Cr,"retryPolicy",{enumerable:!0,get:a(function(){return aba.retryPolicy},"get")});var F_i=VAr();Object.defineProperty(Cr,"tracingPolicy",{enumerable:!0,get:a(function(){return F_i.tracingPolicy},"get")});Object.defineProperty(Cr,"tracingPolicyName",{enumerable:!0,get:a(function(){return F_i.tracingPolicyName},"get")});var cba=OAr();Object.defineProperty(Cr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return cba.defaultRetryPolicy},"get")});var U_i=xAr();Object.defineProperty(Cr,"userAgentPolicy",{enumerable:!0,get:a(function(){return U_i.userAgentPolicy},"get")});Object.defineProperty(Cr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return U_i.userAgentPolicyName},"get")});var Q_i=qAr();Object.defineProperty(Cr,"tlsPolicy",{enumerable:!0,get:a(function(){return Q_i.tlsPolicy},"get")});Object.defineProperty(Cr,"tlsPolicyName",{enumerable:!0,get:a(function(){return Q_i.tlsPolicyName},"get")});var q_i=FAr();Object.defineProperty(Cr,"formDataPolicy",{enumerable:!0,get:a(function(){return q_i.formDataPolicy},"get")});Object.defineProperty(Cr,"formDataPolicyName",{enumerable:!0,get:a(function(){return q_i.formDataPolicyName},"get")});var j_i=T_i();Object.defineProperty(Cr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return j_i.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(Cr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return j_i.bearerTokenAuthenticationPolicyName},"get")});var H_i=I_i();Object.defineProperty(Cr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return H_i.ndJsonPolicy},"get")});Object.defineProperty(Cr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return H_i.ndJsonPolicyName},"get")});var G_i=w_i();Object.defineProperty(Cr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return G_i.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(Cr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return G_i.auxiliaryAuthenticationHeaderPolicyName},"get")});var $_i=wAr();Object.defineProperty(Cr,"createFile",{enumerable:!0,get:a(function(){return $_i.createFile},"get")});Object.defineProperty(Cr,"createFileFromStream",{enumerable:!0,get:a(function(){return $_i.createFileFromStream},"get")})});var z_i=I((gMe,W_i)=>{"use strict";p();var lba=gMe&&gMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},uba=gMe&&gMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var mba=$l(),gba=qA(),Aba=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){mba.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||gba.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();Y_i.exports=Aba});var J_i=I(nyr=>{"use strict";p();Object.defineProperty(nyr,"__esModule",{value:!0});nyr.azureRoleEnvironmentTelemetryProcessor=yba;function yba(t,e){}a(yba,"azureRoleEnvironmentTelemetryProcessor")});var eCi=I(ght=>{"use strict";p();Object.defineProperty(ght,"__esModule",{value:!0});ght.samplingTelemetryProcessor=Eba;ght.getSamplingHashCode=X_i;var Z_i=_E();function Eba(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&Z_i.TelemetryType.Metric===Z_i.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=X_i(e.correlationContext.operation.id){"use strict";p();var _ba=A8&&A8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cba=A8&&A8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vba=A8&&A8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&_ba(e,t,r);return Cba(e,t),e};Object.defineProperty(A8,"__esModule",{value:!0});A8.performanceMetricsTelemetryProcessor=bba;var iyr=wpt(),oyr=vba(_E());function bba(t,e){switch(e&&e.addDocument(t),t.data.baseType){case oyr.TelemetryTypeString.Exception:iyr.countException();break;case oyr.TelemetryTypeString.Request:var r=t.data.baseData;iyr.countRequest(r.duration,r.success);break;case oyr.TelemetryTypeString.Dependency:var n=t.data.baseData;iyr.countDependency(n.duration,n.success);break}return!0}a(bba,"performanceMetricsTelemetryProcessor")});var rCi=I(N2=>{"use strict";p();var i4=N2&&N2.__assign||function(){return i4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var Rba=o4&&o4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yht=o4&&o4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rba(e,t,r)};Object.defineProperty(o4,"__esModule",{value:!0});yht(J_i(),o4);yht(eCi(),o4);yht(tCi(),o4);yht(rCi(),o4)});var syr=I((hcp,sCi)=>{"use strict";p();var Zi=_E(),Db=qA(),iCi=FH(),kba=$l(),Pba=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Zi.TelemetryType.Trace:c=t.createTraceData(e);break;case Zi.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Zi.TelemetryType.Event:c=t.createEventData(e);break;case Zi.TelemetryType.Exception:c=t.createExceptionData(e);break;case Zi.TelemetryType.Request:c=t.createRequestData(e);break;case Zi.TelemetryType.Metric:c=t.createMetricData(e);break;case Zi.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Zi.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Zi.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=Db.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Zi.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===Zi.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=iCi.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Zi.RequestData;e.id?c.id=e.id:c.id=Db.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=Db.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new Zi.Data;return l.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Zi.MetricData;n.metrics=[];var o=new Zi.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Zi.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Zi.AvailabilityData;e.id?o.id=e.id:o.id=Db.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Db.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Zi.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Db.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Zi.Data;return s.baseType=Zi.telemetryTypeToBaseType(Zi.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=iCi.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` -`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(oCi.regex.test(l)){var u=new oCi(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),oCi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Db.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Db.trim(n[2])||this.method,this.fileName=Db.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();sCi.exports=Pba});var aCi=I(WH=>{"use strict";p();var Dba=WH&&WH.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Nba=WH&&WH.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var Eht=EMe&&EMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},_ht=EMe&&EMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!yMe.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(zH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(zH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return Eht(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return _ht(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new qba.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(zH.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=Nb.stringify(g);typeof A=="string"&&(d+=A+` -`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),Uba.gzip(f,function(g,A){var y=A;g?(h._logWarn(Nb.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo(Nb.dumpObj(s)),s[Qba.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes($ba)&&b.statusCode===400&&(cyr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(Gba.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==Hba||b.statusCode==jba?h._statsbeat.countThrottle(zH.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(zH.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(zH.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var k=JSON.parse(T),D=[];k.errors&&(k.errors.forEach(function(B){(B.statusCode==429||B.statusCode==500||B.statusCode==503)&&D.push(e[B.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var L={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(zH.StatsbeatNetworkCategory.Breeze,o,L),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=Nb.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(zH.StatsbeatNetworkCategory.Breeze,o,b),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,Nb.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,Nb.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(Nb.dumpObj(b))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(Nb.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return Eht(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return _ht(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,y8.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+Nb.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,yMe.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+Nb.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,y8.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+Nb.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=hee.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,y8.writeFileAsync(l,Nb.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+Nb.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),ayr.existsSync(this._tempDir)||ayr.mkdirSync(this._tempDir),yMe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=y8.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=hee.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),ayr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+Nb.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return Eht(this,void 0,void 0,function(){var e,r,n,o,s,c;return _ht(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,y8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return hee.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=hee.join(this._tempDir,r),[4,y8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,y8.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return Eht(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return _ht(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,y8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return hee.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=hee.join(this._tempDir,e[r]),[4,y8.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();cCi.exports=Vba});var uCi=I(Cht=>{"use strict";p();Object.defineProperty(Cht,"__esModule",{value:!0});Cht.AzureVirtualMachine=void 0;var lCi=$l(),Wba=qA(),zba=x0e(),Yba="http://169.254.169.254/metadata/instance/compute",Kba="api-version=2017-12-01",Jba="format=json",Zba="UNREACH",Xba=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(Yba,"?").concat(Kba,"&").concat(Jba),l=(n={method:"GET"},n[zba.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=Wba.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){lCi.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(Zba)>-1?s.isVM=!1:lCi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();Cht.AzureVirtualMachine=Xba});var dCi=I(vht=>{"use strict";p();Object.defineProperty(vht,"__esModule",{value:!0});vht.NetworkStatsbeat=void 0;var e1a=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();vht.NetworkStatsbeat=e1a});var gCi=I((mee,mCi)=>{"use strict";p();var s4=mee&&mee.__assign||function(){return s4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(s4(s4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(s4(s4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();mCi.exports=l1a});var ECi=I((kcp,yCi)=>{"use strict";p();var u1a=require("url"),d1a=Kgr(),f1a=z_i(),p1a=_0e(),E8=_E(),h1a=K_i(),fyr=nCi(),ACi=FH(),m1a=gCi(),g1a=lyr(),pyr=qA(),bht=$l(),A1a=syr(),y1a=(function(){function t(e){this._telemetryProcessors=[];var r=new d1a(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new p1a,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new m1a(this.config,this.context),this._statsbeat.enable(!0));var n=new g1a(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new h1a(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,E8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,E8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,E8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,E8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!pyr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,E8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,E8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,E8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new u1a.URL(e.data).host}catch(r){e.target=null,bht.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,E8.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&E8.telemetryTypeToBaseType(r)){var n=A1a.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&fyr.samplingTelemetryProcessor(n,{correlationContext:ACi.CorrelationContextManager.getCurrentContext()}),fyr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(fyr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else bht.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(bht.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new f1a(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=ACi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var E1a=hyr&&hyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),_1a=ECi(),_Ci=Hgr(),C1a=x0e(),Sht=$l(),v1a=(function(t){E1a(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?_Ci.trackRequestSync(this,r):Sht.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Sht.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?_Ci.trackRequest(this,r):Sht.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?C1a.trackRequest(this,r):Sht.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(_1a);CCi.exports=v1a});var SCi=I(bCi=>{"use strict";p();Object.defineProperty(bCi,"__esModule",{value:!0})});var wCi=I(pt=>{"use strict";p();Object.defineProperty(pt,"__esModule",{value:!0});pt.Configuration=pt.liveMetricsClient=pt.defaultClient=pt.DistributedTracingModes=void 0;pt.setup=P1a;pt.start=xCi;pt.getCorrelationContext=N1a;pt.startOperation=M1a;pt.wrapWithCorrelationContext=O1a;pt.dispose=B1a;var gyr=FH(),b1a=syi(),S1a=cyi(),Ayr=wpt(),T1a=Rgr(),I1a=yyi(),x1a=Ryi(),w1a=x0e(),R1a=Hgr(),TCi=QX(),_Me=$l(),ICi=lEi(),yyr=dEi(),k1a=hEi();pt.TelemetryClient=vCi();pt.Contracts=_E();pt.azureFunctionsTypes=SCi();var myr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(myr||(pt.DistributedTracingModes=myr={}));var CMe,vMe,bMe,SMe,TMe,J0e,Z0e,gee,IMe,xMe,RT=!1,Tht;function P1a(t){return pt.defaultClient?_Me.info("The default client is already setup"):(pt.defaultClient=new pt.TelemetryClient(t),CMe=new b1a(pt.defaultClient),vMe=new S1a(pt.defaultClient),bMe=new Ayr(pt.defaultClient),SMe=new T1a(pt.defaultClient),TMe=new I1a(pt.defaultClient),J0e=new x1a(pt.defaultClient),gee=new R1a(pt.defaultClient),IMe=new w1a(pt.defaultClient),Z0e||(Z0e=new yyr.AutoCollectNativePerformance(pt.defaultClient)),xMe=new k1a.AzureFunctionsHook(pt.defaultClient)),Eyr}a(P1a,"setup");function D1a(){pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExternalLoggers==null&&(pt.defaultClient.config.enableAutoCollectExternalLoggers=!0),pt.defaultClient.config.enableAutoCollectConsole==null&&(pt.defaultClient.config.enableAutoCollectConsole=!1),pt.defaultClient.config.enableAutoCollectExceptions==null&&(pt.defaultClient.config.enableAutoCollectExceptions=!0),pt.defaultClient.config.enableAutoCollectPerformance==null&&(pt.defaultClient.config.enableAutoCollectPerformance=!0),pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),pt.defaultClient.config.enableAutoCollectHeartbeat==null&&(pt.defaultClient.config.enableAutoCollectHeartbeat=!0),pt.defaultClient.config.enableAutoCollectRequests==null&&(pt.defaultClient.config.enableAutoCollectRequests=!0),pt.defaultClient.config.enableAutoCollectDependencies==null&&(pt.defaultClient.config.enableAutoCollectDependencies=!0),pt.defaultClient.config.enableUseDiskRetryCaching==null&&(pt.defaultClient.config.enableUseDiskRetryCaching=!0),pt.defaultClient.config.enableAutoDependencyCorrelation==null&&(pt.defaultClient.config.enableAutoDependencyCorrelation=!0),pt.defaultClient.config.enableSendLiveMetrics==null&&(pt.defaultClient.config.enableSendLiveMetrics=!1),pt.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(pt.defaultClient.config.enableAutoCollectExtendedMetrics=!0),pt.defaultClient.config.enableWebInstrumentation==null&&(pt.defaultClient.config.enableWebInstrumentation=!1),pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(D1a,"_setDefaultConfig");function xCi(){if(pt.defaultClient){RT=!0,D1a(),CMe.enable(pt.defaultClient.config.enableAutoCollectExternalLoggers,pt.defaultClient.config.enableAutoCollectConsole),vMe.enable(pt.defaultClient.config.enableAutoCollectExceptions),bMe.enable(pt.defaultClient.config.enableAutoCollectPerformance),SMe.enable(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics),TMe.enable(pt.defaultClient.config.enableAutoCollectHeartbeat),gee.useAutoCorrelation(pt.defaultClient.config.enableAutoDependencyCorrelation,pt.defaultClient.config.enableUseAsyncHooks),gee.enable(pt.defaultClient.config.enableAutoCollectRequests),IMe.enable(pt.defaultClient.config.enableAutoCollectDependencies),J0e.enable(pt.defaultClient.config.enableWebInstrumentation,pt.defaultClient.config.webInstrumentationConnectionString),pt.defaultClient.config.enableSendLiveMetrics&&(pt.liveMetricsClient||(pt.liveMetricsClient=new ICi(pt.defaultClient.config,pt.defaultClient.context,pt.defaultClient.getAuthorizationHandler,pt.defaultClient),Tht=new Ayr(pt.liveMetricsClient,1e3,!0),pt.liveMetricsClient.addCollector(Tht),pt.defaultClient.quickPulseClient=pt.liveMetricsClient),pt.liveMetricsClient.enable(pt.defaultClient.config.enableSendLiveMetrics)),xMe.enable(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=yyr.AutoCollectNativePerformance.parseEnabled(pt.defaultClient.config.enableAutoCollectExtendedMetrics,pt.defaultClient.config);Z0e.enable(pt.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),pt.defaultClient&&pt.defaultClient.channel&&pt.defaultClient.channel.setUseDiskRetryCaching(pt.defaultClient.config.enableUseDiskRetryCaching,pt.defaultClient.config.enableResendInterval,pt.defaultClient.config.enableMaxBytesOnDisk)}else _Me.warn("Start cannot be called before setup");return Eyr}a(xCi,"start");function N1a(){return gyr.CorrelationContextManager.getCurrentContext()}a(N1a,"getCorrelationContext");function M1a(t,e){return gyr.CorrelationContextManager.startOperation(t,e)}a(M1a,"startOperation");function O1a(t,e){return gyr.CorrelationContextManager.wrapCallback(t,e)}a(O1a,"wrapWithCorrelationContext");var Eyr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return TCi.w3cEnabled=e===myr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExternalLoggers=e,pt.defaultClient.config.enableAutoCollectConsole=r,RT&&CMe.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectExceptions=e,RT&&vMe.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),pt.defaultClient){pt.defaultClient.config.enableAutoCollectPerformance=e;var n=yyr.AutoCollectNativePerformance.parseEnabled(r,pt.defaultClient.config);pt.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,RT&&(bMe.enable(e),Z0e.enable(pt.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,RT&&SMe.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectHeartbeat=e,RT&&TMe.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableWebInstrumentation=e,pt.defaultClient.config.webInstrumentationConnectionString=r,RT&&J0e.enable(pt.defaultClient.config.enableAutoWebSnippetInjection,pt.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableWebInstrumentation=e,pt.defaultClient.config.webInstrumentationConnectionString=r,RT&&J0e.enable(pt.defaultClient.config.enableWebInstrumentation,pt.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectRequests=e,RT&&gee.enable(e)),t},t.setAutoCollectDependencies=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectDependencies=e,RT&&IMe.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return pt.defaultClient&&(pt.defaultClient.config.enableAutoDependencyCorrelation=e,pt.defaultClient.config.enableUseAsyncHooks=r,RT&&gee.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return pt.defaultClient&&(pt.defaultClient.config.enableUseDiskRetryCaching=e,pt.defaultClient.config.enableResendInterval=r,pt.defaultClient.config.enableMaxBytesOnDisk=n,pt.defaultClient.channel&&pt.defaultClient.channel.setUseDiskRetryCaching(pt.defaultClient.config.enableUseDiskRetryCaching,pt.defaultClient.config.enableResendInterval,pt.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),_Me.enableDebug=e,_Me.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return pt.defaultClient&&(pt.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,RT&&xMe.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),pt.defaultClient?(!pt.liveMetricsClient&&e?(pt.liveMetricsClient=new ICi(pt.defaultClient.config,pt.defaultClient.context,pt.defaultClient.getAuthorizationHandler,pt.defaultClient),Tht=new Ayr(pt.liveMetricsClient,1e3,!0),pt.liveMetricsClient.addCollector(Tht),pt.defaultClient.quickPulseClient=pt.liveMetricsClient):pt.liveMetricsClient&&pt.liveMetricsClient.enable(e),pt.defaultClient.config.enableSendLiveMetrics=e,t):(_Me.warn("Live metrics client cannot be setup without the default client"),t)},t.start=xCi,t})();pt.Configuration=Eyr;function B1a(){TCi.w3cEnabled=!0,pt.defaultClient=null,RT=!1,CMe&&CMe.dispose(),vMe&&vMe.dispose(),bMe&&bMe.dispose(),SMe&&SMe.dispose(),TMe&&TMe.dispose(),J0e&&J0e.dispose(),Z0e&&Z0e.dispose(),gee&&gee.dispose(),IMe&&IMe.dispose(),pt.liveMetricsClient&&(pt.liveMetricsClient.enable(!1),pt.liveMetricsClient=void 0),xMe&&xMe.dispose()}a(B1a,"dispose")});var Cyr=I(rR=>{"use strict";p();var L1a=rR&&rR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1a=rR&&rR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RCi=rR&&rR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return j1a(e)?kCi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};rR.AzureInsightReporter=_yr;function H1a(t,e,r){let n=new U1a.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,PCi(t,e,n),n}a(H1a,"createAppInsightsClient");function PCi(t,e,r){r.commonProperties=G1a(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(PCi,"configureReporter");function G1a(t,e){return t=t||{},t.common_os=Iht.platform(),t.common_platformversion=Iht.release(),t.common_arch=Iht.arch(),t.common_cpu=Array.from(new Set(Iht.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(G1a,"decorateWithCommonProperties")});var DCi=I((Hcp,$1a)=>{$1a.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.51.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.123.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. +`,"utf-8")],o=d_a(n);o&&t.headers.set("Content-Length",o),t.body=await(0,s_a.concat)(n)}a(f_a,"buildRequestBody");I0e.multipartPolicyName="multipartPolicy";var p_a=70,h_a=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function m_a(t){if(t.length>p_a)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!h_a.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(m_a,"assertValidBoundary");function g_a(){return{name:I0e.multipartPolicyName,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?m_a(n):n=c_a(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await f_a(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(g_a,"multipartPolicy")});var UAr=I(x0e=>{"use strict";p();Object.defineProperty(x0e,"__esModule",{value:!0});x0e.decompressResponsePolicyName=void 0;x0e.decompressResponsePolicy=A_a;x0e.decompressResponsePolicyName="decompressResponsePolicy";function A_a(){return{name:x0e.decompressResponsePolicyName,async sendRequest(t,e){return t.method!=="HEAD"&&t.headers.set("Accept-Encoding","gzip,deflate"),e(t)}}}a(A_a,"decompressResponsePolicy")});var iht=I(nht=>{"use strict";p();Object.defineProperty(nht,"__esModule",{value:!0});nht.delay=__a;nht.parseHeaderValueAsNumber=v_a;var y_a=zNe(),E_a="The operation was aborted.";function __a(t,e,r){return new Promise((n,o)=>{let s,c,l=a(()=>o(new y_a.AbortError(r?.abortErrorMsg?r?.abortErrorMsg:E_a)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(__a,"delay");function v_a(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(v_a,"parseHeaderValueAsNumber")});var sht=I(oht=>{"use strict";p();Object.defineProperty(oht,"__esModule",{value:!0});oht.isThrottlingRetryResponse=S_a;oht.throttlingRetryStrategy=T_a;var C_a=iht(),QAr="Retry-After",b_a=["retry-after-ms","x-ms-retry-after-ms",QAr];function T_i(t){if(t&&[429,503].includes(t.status))try{for(let o of b_a){let s=(0,C_a.parseHeaderValueAsNumber)(t,o);if(s===0||s)return s*(o===QAr?1e3:1)}let e=t.headers.get(QAr);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(T_i,"getRetryAfterInMs");function S_a(t){return Number.isFinite(T_i(t))}a(S_a,"isThrottlingRetryResponse");function T_a(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=T_i(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(T_a,"throttlingRetryStrategy")});var aht=I(JNe=>{"use strict";p();Object.defineProperty(JNe,"__esModule",{value:!0});JNe.exponentialRetryStrategy=P_a;JNe.isExponentialRetryResponse=I_i;JNe.isSystemError=x_i;var I_a=Z5(),x_a=sht(),w_a=1e3,R_a=1e3*64;function P_a(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:w_a,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:R_a,s=n;return{name:"exponentialRetryStrategy",retry({retryCount:c,response:l,responseError:u}){let d=x_i(u),f=d&&t.ignoreSystemErrors,h=I_i(l),m=h&&t.ignoreHttpStatusCodes;if(l&&((0,x_a.isThrottlingRetryResponse)(l)||!h)||m||f)return{skipStrategy:!0};if(u&&!d&&!h)return{errorToThrow:u};let A=s*Math.pow(2,c),y=Math.min(o,A);return s=y/2+(0,I_a.getRandomIntegerInclusive)(0,y/2),{retryAfterInMs:s}}}}a(P_a,"exponentialRetryStrategy");function I_i(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(I_i,"isExponentialRetryResponse");function x_i(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(x_i,"isSystemError")});var w0e=I(qAr=>{"use strict";p();Object.defineProperty(qAr,"__esModule",{value:!0});qAr.retryPolicy=O_a;var k_a=iht(),D_a=sft(),N_a=zNe(),w_i=FH(),R_i=(0,D_a.createClientLogger)("core-rest-pipeline retryPolicy"),M_a="retryPolicy";function O_a(t,e={maxRetries:w_i.DEFAULT_RETRY_POLICY_COUNT}){let r=e.logger||R_i;return{name:M_a,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new N_a.AbortError;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:w_i.DEFAULT_RETRY_POLICY_COUNT)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||R_i;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await(0,k_a.delay)(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(O_a,"retryPolicy")});var jAr=I(R0e=>{"use strict";p();Object.defineProperty(R0e,"__esModule",{value:!0});R0e.defaultRetryPolicyName=void 0;R0e.defaultRetryPolicy=Q_a;var B_a=aht(),L_a=sht(),F_a=w0e(),U_a=FH();R0e.defaultRetryPolicyName="defaultRetryPolicy";function Q_a(t={}){var e;return{name:R0e.defaultRetryPolicyName,sendRequest:(0,F_a.retryPolicy)([(0,L_a.throttlingRetryStrategy)(),(0,B_a.exponentialRetryStrategy)(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:U_a.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(Q_a,"defaultRetryPolicy")});var ZNe=I(GAr=>{"use strict";p();Object.defineProperty(GAr,"__esModule",{value:!0});GAr.createHttpHeaders=j_a;function cht(t){return t.toLowerCase()}a(cht,"normalizeName");function*q_a(t){for(let e of t.values())yield[e.name,e.value]}a(q_a,"headerIterator");var HAr=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(cht(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(cht(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(cht(e))}delete(e){this._headersMap.delete(cht(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return q_a(this._headersMap)}};function j_a(t){return new HAr(t)}a(j_a,"createHttpHeaders")});var $Ar=I(P0e=>{"use strict";p();Object.defineProperty(P0e,"__esModule",{value:!0});P0e.formDataPolicyName=void 0;P0e.formDataPolicy=G_a;var k_i=Z5(),P_i=ZNe();P0e.formDataPolicyName="formDataPolicy";function H_a(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(H_a,"formDataToFormDataMap");function G_a(){return{name:P0e.formDataPolicyName,async sendRequest(t,e){if(k_i.isNodeLike&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=H_a(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=$_a(t.formData):await V_a(t.formData,t),t.formData=void 0}return e(t)}}}a(G_a,"formDataPolicy");function $_a(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a($_a,"wwwFormUrlEncode");async function V_a(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:(0,P_i.createHttpHeaders)({"Content-Disposition":`form-data; name="${o}"`}),body:(0,k_i.stringToUint8Array)(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=(0,P_i.createHttpHeaders)();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(V_a,"prepareFormData")});var VAr=I(eR=>{"use strict";p();Object.defineProperty(eR,"__esModule",{value:!0});eR.globalNoProxyList=eR.proxyPolicyName=void 0;eR.loadNoProxy=B_i;eR.getDefaultProxySettings=rva;eR.proxyPolicy=iva;var W_a=uBt(),z_a=dBt(),Y_a=see(),K_a="HTTPS_PROXY",J_a="HTTP_PROXY",Z_a="ALL_PROXY",X_a="NO_PROXY";eR.proxyPolicyName="proxyPolicy";eR.globalNoProxyList=[];var M_i=!1,eva=new Map;function lht(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(lht,"getEnvironmentValue");function O_i(){if(!process)return;let t=lht(K_a),e=lht(Z_a),r=lht(J_a);return t||e||r}a(O_i,"loadEnvironmentProxyValue");function tva(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(tva,"isBypassed");function B_i(){let t=lht(X_a);return M_i=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(B_i,"loadNoProxy");function rva(t){if(!t&&(t=O_i(),!t))return;let e=new URL(t);return{host:(e.protocol?e.protocol+"//":"")+e.hostname,port:Number.parseInt(e.port||"80"),username:e.username,password:e.password}}a(rva,"getDefaultProxySettings");function nva(){let t=O_i();return t?new URL(t):void 0}a(nva,"getDefaultProxySettingsInternal");function D_i(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(D_i,"getUrlFromProxySettings");function N_i(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&Y_a.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new z_a.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new W_a.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(N_i,"setProxyAgentOnRequest");function iva(t,e){M_i||eR.globalNoProxyList.push(...B_i());let r=t?D_i(t):nva(),n={};return{name:eR.proxyPolicyName,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!tva(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:eR.globalNoProxyList,e?.customNoProxyList?void 0:eva)?N_i(o,n,r):o.proxySettings&&N_i(o,n,D_i(o.proxySettings)),s(o)}}}a(iva,"proxyPolicy")});var WAr=I(k0e=>{"use strict";p();Object.defineProperty(k0e,"__esModule",{value:!0});k0e.setClientRequestIdPolicyName=void 0;k0e.setClientRequestIdPolicy=ova;k0e.setClientRequestIdPolicyName="setClientRequestIdPolicy";function ova(t="x-ms-client-request-id"){return{name:k0e.setClientRequestIdPolicyName,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(ova,"setClientRequestIdPolicy")});var zAr=I(D0e=>{"use strict";p();Object.defineProperty(D0e,"__esModule",{value:!0});D0e.tlsPolicyName=void 0;D0e.tlsPolicy=sva;D0e.tlsPolicyName="tlsPolicy";function sva(t){return{name:D0e.tlsPolicyName,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(sva,"tlsPolicy")});var YAr=I(c8=>{"use strict";p();Object.defineProperty(c8,"__esModule",{value:!0});c8.TracingContextImpl=c8.knownContextKeys=void 0;c8.createTracingContext=ava;c8.knownContextKeys={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function ava(t={}){let e=new uht(t.parentContext);return t.span&&(e=e.setValue(c8.knownContextKeys.span,t.span)),t.namespace&&(e=e.setValue(c8.knownContextKeys.namespace,t.namespace)),e}a(ava,"createTracingContext");var uht=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};c8.TracingContextImpl=uht});var KAr=I(N0e=>{"use strict";p();Object.defineProperty(N0e,"__esModule",{value:!0});N0e.createDefaultTracingSpan=L_i;N0e.createDefaultInstrumenter=F_i;N0e.useInstrumenter=lva;N0e.getInstrumenter=uva;var cva=YAr(),dht=iMt();function L_i(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(L_i,"createDefaultTracingSpan");function F_i(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:L_i(),tracingContext:(0,cva.createTracingContext)({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(F_i,"createDefaultInstrumenter");function lva(t){dht.state.instrumenterImplementation=t}a(lva,"useInstrumenter");function uva(){return dht.state.instrumenterImplementation||(dht.state.instrumenterImplementation=F_i()),dht.state.instrumenterImplementation}a(uva,"getInstrumenter")});var U_i=I(ZAr=>{"use strict";p();Object.defineProperty(ZAr,"__esModule",{value:!0});ZAr.createTracingClient=dva;var fht=KAr(),JAr=YAr();function dva(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=(0,fht.getInstrumenter)().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(JAr.knownContextKeys.namespace)||(A=A.setValue(JAr.knownContextKeys.namespace,e)),y.setAttribute("az.namespace",A.getValue(JAr.knownContextKeys.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return(0,fht.getInstrumenter)().withContext(d,f,...h)}a(c,"withContext");function l(d){return(0,fht.getInstrumenter)().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return(0,fht.getInstrumenter)().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(dva,"createTracingClient")});var Q_i=I(M0e=>{"use strict";p();Object.defineProperty(M0e,"__esModule",{value:!0});M0e.createTracingClient=M0e.useInstrumenter=void 0;var fva=KAr();Object.defineProperty(M0e,"useInstrumenter",{enumerable:!0,get:a(function(){return fva.useInstrumenter},"get")});var pva=U_i();Object.defineProperty(M0e,"createTracingClient",{enumerable:!0,get:a(function(){return pva.createTracingClient},"get")})});var q_i=I(pht=>{"use strict";p();Object.defineProperty(pht,"__esModule",{value:!0});pht.custom=void 0;var hva=require("node:util");pht.custom=hva.inspect.custom});var hht=I(XNe=>{"use strict";p();Object.defineProperty(XNe,"__esModule",{value:!0});XNe.RestError=void 0;XNe.isRestError=Eva;var mva=Z5(),gva=q_i(),Ava=Zpt(),yva=new Ava.Sanitizer,O0e=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}[gva.custom](){return`RestError: ${this.message} + ${yva.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`}};XNe.RestError=O0e;O0e.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";O0e.PARSE_ERROR="PARSE_ERROR";function Eva(t){return t instanceof O0e?!0:(0,mva.isError)(t)&&t.name==="RestError"}a(Eva,"isRestError")});var XAr=I(B0e=>{"use strict";p();Object.defineProperty(B0e,"__esModule",{value:!0});B0e.tracingPolicyName=void 0;B0e.tracingPolicy=Tva;var _va=Q_i(),vva=FH(),Cva=NAr(),mht=see(),eMe=Z5(),bva=hht(),Sva=Zpt();B0e.tracingPolicyName="tracingPolicy";function Tva(t={}){let e=(0,Cva.getUserAgentValue)(t.userAgentPrefix),r=new Sva.Sanitizer({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=Iva();return{name:B0e.tracingPolicyName,async sendRequest(o,s){var c,l;if(!n||!(!((c=o.tracingOptions)===null||c===void 0)&&c.tracingContext))return s(o);let u=await e,d={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":u,requestId:o.requestId};u&&(d["http.user_agent"]=u);let{span:f,tracingContext:h}=(l=xva(n,o,d))!==null&&l!==void 0?l:{};if(!f||!h)return s(o);try{let m=await n.withContext(h,s,o);return Rva(f,m),m}catch(m){throw wva(f,m),m}}}}a(Tva,"tracingPolicy");function Iva(){try{return(0,_va.createTracingClient)({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:vva.SDK_VERSION})}catch(t){mht.logger.warning(`Error when creating the TracingClient: ${(0,eMe.getErrorMessage)(t)}`);return}}a(Iva,"tryCreateTracingClient");function xva(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){mht.logger.warning(`Skipping creating a tracing span due to an error: ${(0,eMe.getErrorMessage)(n)}`);return}}a(xva,"tryCreateSpan");function wva(t,e){try{t.setStatus({status:"error",error:(0,eMe.isError)(e)?e:void 0}),(0,bva.isRestError)(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){mht.logger.warning(`Skipping tracing span processing due to an error: ${(0,eMe.getErrorMessage)(r)}`)}}a(wva,"tryProcessError");function Rva(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),t.setStatus({status:"success"}),t.end()}catch(r){mht.logger.warning(`Skipping tracing span processing due to an error: ${(0,eMe.getErrorMessage)(r)}`)}}a(Rva,"tryProcessResponse")});var G_i=I(eyr=>{"use strict";p();Object.defineProperty(eyr,"__esModule",{value:!0});eyr.createPipelineFromOptions=qva;var Pva=RAr(),kva=sAr(),Dva=PAr(),Nva=MAr(),j_i=FAr(),Mva=UAr(),Ova=jAr(),Bva=$Ar(),H_i=Z5(),Lva=VAr(),Fva=WAr(),Uva=zAr(),Qva=XAr();function qva(t){var e;let r=(0,kva.createEmptyPipeline)();return H_i.isNodeLike&&(t.tlsOptions&&r.addPolicy((0,Uva.tlsPolicy)(t.tlsOptions)),r.addPolicy((0,Lva.proxyPolicy)(t.proxyOptions)),r.addPolicy((0,Mva.decompressResponsePolicy)())),r.addPolicy((0,Bva.formDataPolicy)(),{beforePolicies:[j_i.multipartPolicyName]}),r.addPolicy((0,Nva.userAgentPolicy)(t.userAgentOptions)),r.addPolicy((0,Fva.setClientRequestIdPolicy)((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy((0,j_i.multipartPolicy)(),{afterPhase:"Deserialize"}),r.addPolicy((0,Ova.defaultRetryPolicy)(t.retryOptions),{phase:"Retry"}),r.addPolicy((0,Qva.tracingPolicy)(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),H_i.isNodeLike&&r.addPolicy((0,Dva.redirectPolicy)(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy((0,Pva.logPolicy)(t.loggingOptions),{afterPhase:"Sign"}),r}a(qva,"createPipelineFromOptions")});var K_i=I(Aht=>{"use strict";p();Object.defineProperty(Aht,"__esModule",{value:!0});Aht.getBodyLength=Y_i;Aht.createNodeHttpClient=zva;var iyr=(wL(),ya(h7)),tyr=iyr.__importStar(require("node:http")),ryr=iyr.__importStar(require("node:https")),$_i=iyr.__importStar(require("node:zlib")),jva=require("node:stream"),V_i=zNe(),Hva=ZNe(),nMe=hht(),tMe=see(),Gva={};function rMe(t){return t&&typeof t.pipe=="function"}a(rMe,"isReadableStream");function W_i(t){return new Promise(e=>{t.on("close",e),t.on("end",e),t.on("error",e)})}a(W_i,"isStreamComplete");function z_i(t){return t&&typeof t.byteLength=="number"}a(z_i,"isArrayBuffer");var ght=class extends jva.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},nyr=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new V_i.AbortError("The operation was aborted.");c=a(h=>{h.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}e.timeout>0&&setTimeout(()=>{s.abort()},e.timeout);let l=e.headers.get("Accept-Encoding"),u=l?.includes("gzip")||l?.includes("deflate"),d=typeof e.body=="function"?e.body():e.body;if(d&&!e.headers.has("Content-Length")){let h=Y_i(d);h!==null&&e.headers.set("Content-Length",h)}let f;try{if(d&&e.onUploadProgress){let E=e.onUploadProgress,_=new ght(E);_.on("error",v=>{tMe.logger.error("Error in upload progress",v)}),rMe(d)?d.pipe(_):_.end(d),d=_}let h=await this.makeRequest(e,s,d),m=$va(h),A={status:(r=h.statusCode)!==null&&r!==void 0?r:0,headers:m,request:e};if(e.method==="HEAD")return h.resume(),A;f=u?Vva(h,m):h;let y=e.onDownloadProgress;if(y){let E=new ght(y);E.on("error",_=>{tMe.logger.error("Error in download progress",_)}),f.pipe(E),f=E}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(A.status)?A.readableStreamBody=f:A.bodyAsText=await Wva(f),A}finally{if(e.abortSignal&&c){let h=Promise.resolve();rMe(d)&&(h=W_i(d));let m=Promise.resolve();rMe(f)&&(m=W_i(f)),Promise.all([h,m]).then(()=>{var g;c&&((g=e.abortSignal)===null||g===void 0||g.removeEventListener("abort",c))}).catch(g=>{tMe.logger.warning("Error when cleaning up abortListener on httpRequest",g)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let u={agent:(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})};return new Promise((d,f)=>{let h=c?tyr.request(u,d):ryr.request(u,d);h.once("error",m=>{var g;f(new nMe.RestError(m.message,{code:(g=m.code)!==null&&g!==void 0?g:nMe.RestError.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new V_i.AbortError("The operation was aborted.");h.destroy(m),f(m)}),n&&rMe(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):z_i(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(tMe.logger.error("Unrecognized body type",n),f(new nMe.RestError("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?tyr.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new tyr.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return ryr.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:Gva,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(tMe.logger.info("No cached TLS Agent exist, creating a new Agent"),c=new ryr.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function $va(t){let e=(0,Hva.createHttpHeaders)();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a($va,"getResponseHeaders");function Vva(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=$_i.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=$_i.createInflate();return t.pipe(n),n}return t}a(Vva,"getDecodedResponseStream");function Wva(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new nMe.RestError(`Error reading response as text: ${o.message}`,{code:nMe.RestError.PARSE_ERROR}))})})}a(Wva,"streamToText");function Y_i(t){return t?Buffer.isBuffer(t)?t.length:rMe(t)?null:z_i(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(Y_i,"getBodyLength");function zva(){return new nyr}a(zva,"createNodeHttpClient")});var J_i=I(oyr=>{"use strict";p();Object.defineProperty(oyr,"__esModule",{value:!0});oyr.createDefaultHttpClient=Kva;var Yva=K_i();function Kva(){return(0,Yva.createNodeHttpClient)()}a(Kva,"createDefaultHttpClient")});var Z_i=I(ayr=>{"use strict";p();Object.defineProperty(ayr,"__esModule",{value:!0});ayr.createPipelineRequest=Xva;var Jva=ZNe(),Zva=Z5(),syr=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:(0,Jva.createHttpHeaders)(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||(0,Zva.randomUUID)(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1}};function Xva(t){return new syr(t)}a(Xva,"createPipelineRequest")});var X_i=I(iMe=>{"use strict";p();Object.defineProperty(iMe,"__esModule",{value:!0});iMe.exponentialRetryPolicyName=void 0;iMe.exponentialRetryPolicy=nCa;var eCa=aht(),tCa=w0e(),rCa=FH();iMe.exponentialRetryPolicyName="exponentialRetryPolicy";function nCa(t={}){var e;return(0,tCa.retryPolicy)([(0,eCa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreSystemErrors:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:rCa.DEFAULT_RETRY_POLICY_COUNT})}a(nCa,"exponentialRetryPolicy")});var evi=I(L0e=>{"use strict";p();Object.defineProperty(L0e,"__esModule",{value:!0});L0e.systemErrorRetryPolicyName=void 0;L0e.systemErrorRetryPolicy=aCa;var iCa=aht(),oCa=w0e(),sCa=FH();L0e.systemErrorRetryPolicyName="systemErrorRetryPolicy";function aCa(t={}){var e;return{name:L0e.systemErrorRetryPolicyName,sendRequest:(0,oCa.retryPolicy)([(0,iCa.exponentialRetryStrategy)(Object.assign(Object.assign({},t),{ignoreHttpStatusCodes:!0}))],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:sCa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(aCa,"systemErrorRetryPolicy")});var tvi=I(F0e=>{"use strict";p();Object.defineProperty(F0e,"__esModule",{value:!0});F0e.throttlingRetryPolicyName=void 0;F0e.throttlingRetryPolicy=dCa;var cCa=sht(),lCa=w0e(),uCa=FH();F0e.throttlingRetryPolicyName="throttlingRetryPolicy";function dCa(t={}){var e;return{name:F0e.throttlingRetryPolicyName,sendRequest:(0,lCa.retryPolicy)([(0,cCa.throttlingRetryStrategy)()],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:uCa.DEFAULT_RETRY_POLICY_COUNT}).sendRequest}}a(dCa,"throttlingRetryPolicy")});var cyr=I(U0e=>{"use strict";p();Object.defineProperty(U0e,"__esModule",{value:!0});U0e.DEFAULT_CYCLER_OPTIONS=void 0;U0e.createTokenCycler=hCa;var fCa=iht();U0e.DEFAULT_CYCLER_OPTIONS={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function pCa(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(hCa,"createTokenCycler")});var rvi=I(Q0e=>{"use strict";p();Object.defineProperty(Q0e,"__esModule",{value:!0});Q0e.bearerTokenAuthenticationPolicyName=void 0;Q0e.bearerTokenAuthenticationPolicy=ECa;var mCa=cyr(),gCa=see();Q0e.bearerTokenAuthenticationPolicyName="bearerTokenAuthenticationPolicy";async function ACa(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(ACa,"defaultAuthorizeRequest");function yCa(t){let e=t.headers.get("WWW-Authenticate");if(t.status===401&&e)return e}a(yCa,"getChallenge");function ECa(t){var e;let{credential:r,scopes:n,challengeCallbacks:o}=t,s=t.logger||gCa.logger,c=Object.assign({authorizeRequest:(e=o?.authorizeRequest)!==null&&e!==void 0?e:ACa,authorizeRequestOnChallenge:o?.authorizeRequestOnChallenge},o),l=r?(0,mCa.createTokenCycler)(r):()=>Promise.resolve(null);return{name:Q0e.bearerTokenAuthenticationPolicyName,async sendRequest(u,d){if(!u.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await c.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:u,getAccessToken:l,logger:s});let f,h;try{f=await d(u)}catch(m){h=m,f=m.response}if(c.authorizeRequestOnChallenge&&f?.status===401&&yCa(f)&&await c.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:u,response:f,getAccessToken:l,logger:s}))return d(u);if(h)throw h;return f}}}a(ECa,"bearerTokenAuthenticationPolicy")});var nvi=I(q0e=>{"use strict";p();Object.defineProperty(q0e,"__esModule",{value:!0});q0e.ndJsonPolicyName=void 0;q0e.ndJsonPolicy=_Ca;q0e.ndJsonPolicyName="ndJsonPolicy";function _Ca(){return{name:q0e.ndJsonPolicyName,async sendRequest(t,e){if(typeof t.body=="string"&&t.body.startsWith("[")){let r=JSON.parse(t.body);Array.isArray(r)&&(t.body=r.map(n=>JSON.stringify(n)+` +`).join(""))}return e(t)}}}a(_Ca,"ndJsonPolicy")});var ovi=I(lee=>{"use strict";p();Object.defineProperty(lee,"__esModule",{value:!0});lee.auxiliaryAuthenticationHeaderPolicyName=void 0;lee.auxiliaryAuthenticationHeaderPolicy=SCa;var vCa=cyr(),CCa=see();lee.auxiliaryAuthenticationHeaderPolicyName="auxiliaryAuthenticationHeaderPolicy";var ivi="x-ms-authorization-auxiliary";async function bCa(t){var e,r;let{scopes:n,getAccessToken:o,request:s}=t,c={abortSignal:s.abortSignal,tracingOptions:s.tracingOptions};return(r=(e=await o(n,c))===null||e===void 0?void 0:e.token)!==null&&r!==void 0?r:""}a(bCa,"sendAuthorizeRequest");function SCa(t){let{credentials:e,scopes:r}=t,n=t.logger||CCa.logger,o=new WeakMap;return{name:lee.auxiliaryAuthenticationHeaderPolicyName,async sendRequest(s,c){if(!s.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs.");if(!e||e.length===0)return n.info(`${lee.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`),c(s);let l=[];for(let d of e){let f=o.get(d);f||(f=(0,vCa.createTokenCycler)(d),o.set(d,f)),l.push(bCa({scopes:Array.isArray(r)?r:[r],request:s,getAccessToken:f,logger:n}))}let u=(await Promise.all(l)).filter(d=>!!d);return u.length===0?(n.warning(`None of the auxiliary tokens are valid. ${ivi} header will not be set.`),c(s)):(s.headers.set(ivi,u.map(d=>`Bearer ${d}`).join(", ")),c(s))}}}a(SCa,"auxiliaryAuthenticationHeaderPolicy")});var bvi=I(vr=>{"use strict";p();Object.defineProperty(vr,"__esModule",{value:!0});vr.createFileFromStream=vr.createFile=vr.auxiliaryAuthenticationHeaderPolicyName=vr.auxiliaryAuthenticationHeaderPolicy=vr.ndJsonPolicyName=vr.ndJsonPolicy=vr.bearerTokenAuthenticationPolicyName=vr.bearerTokenAuthenticationPolicy=vr.formDataPolicyName=vr.formDataPolicy=vr.tlsPolicyName=vr.tlsPolicy=vr.userAgentPolicyName=vr.userAgentPolicy=vr.defaultRetryPolicy=vr.tracingPolicyName=vr.tracingPolicy=vr.retryPolicy=vr.throttlingRetryPolicyName=vr.throttlingRetryPolicy=vr.systemErrorRetryPolicyName=vr.systemErrorRetryPolicy=vr.redirectPolicyName=vr.redirectPolicy=vr.getDefaultProxySettings=vr.proxyPolicyName=vr.proxyPolicy=vr.multipartPolicyName=vr.multipartPolicy=vr.logPolicyName=vr.logPolicy=vr.setClientRequestIdPolicyName=vr.setClientRequestIdPolicy=vr.exponentialRetryPolicyName=vr.exponentialRetryPolicy=vr.decompressResponsePolicyName=vr.decompressResponsePolicy=vr.isRestError=vr.RestError=vr.createPipelineRequest=vr.createHttpHeaders=vr.createDefaultHttpClient=vr.createPipelineFromOptions=vr.createEmptyPipeline=void 0;var TCa=sAr();Object.defineProperty(vr,"createEmptyPipeline",{enumerable:!0,get:a(function(){return TCa.createEmptyPipeline},"get")});var ICa=G_i();Object.defineProperty(vr,"createPipelineFromOptions",{enumerable:!0,get:a(function(){return ICa.createPipelineFromOptions},"get")});var xCa=J_i();Object.defineProperty(vr,"createDefaultHttpClient",{enumerable:!0,get:a(function(){return xCa.createDefaultHttpClient},"get")});var wCa=ZNe();Object.defineProperty(vr,"createHttpHeaders",{enumerable:!0,get:a(function(){return wCa.createHttpHeaders},"get")});var RCa=Z_i();Object.defineProperty(vr,"createPipelineRequest",{enumerable:!0,get:a(function(){return RCa.createPipelineRequest},"get")});var svi=hht();Object.defineProperty(vr,"RestError",{enumerable:!0,get:a(function(){return svi.RestError},"get")});Object.defineProperty(vr,"isRestError",{enumerable:!0,get:a(function(){return svi.isRestError},"get")});var avi=UAr();Object.defineProperty(vr,"decompressResponsePolicy",{enumerable:!0,get:a(function(){return avi.decompressResponsePolicy},"get")});Object.defineProperty(vr,"decompressResponsePolicyName",{enumerable:!0,get:a(function(){return avi.decompressResponsePolicyName},"get")});var cvi=X_i();Object.defineProperty(vr,"exponentialRetryPolicy",{enumerable:!0,get:a(function(){return cvi.exponentialRetryPolicy},"get")});Object.defineProperty(vr,"exponentialRetryPolicyName",{enumerable:!0,get:a(function(){return cvi.exponentialRetryPolicyName},"get")});var lvi=WAr();Object.defineProperty(vr,"setClientRequestIdPolicy",{enumerable:!0,get:a(function(){return lvi.setClientRequestIdPolicy},"get")});Object.defineProperty(vr,"setClientRequestIdPolicyName",{enumerable:!0,get:a(function(){return lvi.setClientRequestIdPolicyName},"get")});var uvi=RAr();Object.defineProperty(vr,"logPolicy",{enumerable:!0,get:a(function(){return uvi.logPolicy},"get")});Object.defineProperty(vr,"logPolicyName",{enumerable:!0,get:a(function(){return uvi.logPolicyName},"get")});var dvi=FAr();Object.defineProperty(vr,"multipartPolicy",{enumerable:!0,get:a(function(){return dvi.multipartPolicy},"get")});Object.defineProperty(vr,"multipartPolicyName",{enumerable:!0,get:a(function(){return dvi.multipartPolicyName},"get")});var lyr=VAr();Object.defineProperty(vr,"proxyPolicy",{enumerable:!0,get:a(function(){return lyr.proxyPolicy},"get")});Object.defineProperty(vr,"proxyPolicyName",{enumerable:!0,get:a(function(){return lyr.proxyPolicyName},"get")});Object.defineProperty(vr,"getDefaultProxySettings",{enumerable:!0,get:a(function(){return lyr.getDefaultProxySettings},"get")});var fvi=PAr();Object.defineProperty(vr,"redirectPolicy",{enumerable:!0,get:a(function(){return fvi.redirectPolicy},"get")});Object.defineProperty(vr,"redirectPolicyName",{enumerable:!0,get:a(function(){return fvi.redirectPolicyName},"get")});var pvi=evi();Object.defineProperty(vr,"systemErrorRetryPolicy",{enumerable:!0,get:a(function(){return pvi.systemErrorRetryPolicy},"get")});Object.defineProperty(vr,"systemErrorRetryPolicyName",{enumerable:!0,get:a(function(){return pvi.systemErrorRetryPolicyName},"get")});var hvi=tvi();Object.defineProperty(vr,"throttlingRetryPolicy",{enumerable:!0,get:a(function(){return hvi.throttlingRetryPolicy},"get")});Object.defineProperty(vr,"throttlingRetryPolicyName",{enumerable:!0,get:a(function(){return hvi.throttlingRetryPolicyName},"get")});var PCa=w0e();Object.defineProperty(vr,"retryPolicy",{enumerable:!0,get:a(function(){return PCa.retryPolicy},"get")});var mvi=XAr();Object.defineProperty(vr,"tracingPolicy",{enumerable:!0,get:a(function(){return mvi.tracingPolicy},"get")});Object.defineProperty(vr,"tracingPolicyName",{enumerable:!0,get:a(function(){return mvi.tracingPolicyName},"get")});var kCa=jAr();Object.defineProperty(vr,"defaultRetryPolicy",{enumerable:!0,get:a(function(){return kCa.defaultRetryPolicy},"get")});var gvi=MAr();Object.defineProperty(vr,"userAgentPolicy",{enumerable:!0,get:a(function(){return gvi.userAgentPolicy},"get")});Object.defineProperty(vr,"userAgentPolicyName",{enumerable:!0,get:a(function(){return gvi.userAgentPolicyName},"get")});var Avi=zAr();Object.defineProperty(vr,"tlsPolicy",{enumerable:!0,get:a(function(){return Avi.tlsPolicy},"get")});Object.defineProperty(vr,"tlsPolicyName",{enumerable:!0,get:a(function(){return Avi.tlsPolicyName},"get")});var yvi=$Ar();Object.defineProperty(vr,"formDataPolicy",{enumerable:!0,get:a(function(){return yvi.formDataPolicy},"get")});Object.defineProperty(vr,"formDataPolicyName",{enumerable:!0,get:a(function(){return yvi.formDataPolicyName},"get")});var Evi=rvi();Object.defineProperty(vr,"bearerTokenAuthenticationPolicy",{enumerable:!0,get:a(function(){return Evi.bearerTokenAuthenticationPolicy},"get")});Object.defineProperty(vr,"bearerTokenAuthenticationPolicyName",{enumerable:!0,get:a(function(){return Evi.bearerTokenAuthenticationPolicyName},"get")});var _vi=nvi();Object.defineProperty(vr,"ndJsonPolicy",{enumerable:!0,get:a(function(){return _vi.ndJsonPolicy},"get")});Object.defineProperty(vr,"ndJsonPolicyName",{enumerable:!0,get:a(function(){return _vi.ndJsonPolicyName},"get")});var vvi=ovi();Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicy",{enumerable:!0,get:a(function(){return vvi.auxiliaryAuthenticationHeaderPolicy},"get")});Object.defineProperty(vr,"auxiliaryAuthenticationHeaderPolicyName",{enumerable:!0,get:a(function(){return vvi.auxiliaryAuthenticationHeaderPolicyName},"get")});var Cvi=OAr();Object.defineProperty(vr,"createFile",{enumerable:!0,get:a(function(){return Cvi.createFile},"get")});Object.defineProperty(vr,"createFileFromStream",{enumerable:!0,get:a(function(){return Cvi.createFileFromStream},"get")})});var Tvi=I((sMe,Svi)=>{"use strict";p();var DCa=sMe&&sMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},NCa=sMe&&sMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var FCa=jl(),UCa=VA(),QCa=(function(){function t(e,r,n,o){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=r,this._getBatchIntervalMs=n,this._sender=o}return a(t,"Channel"),t.prototype.setUseDiskRetryCaching=function(e,r,n){this._sender.setDiskRetryMode(e,r,n)},t.prototype.send=function(e){var r=this;if(!this._isDisabled()){if(!e){FCa.warn("Cannot send null/undefined telemetry");return}if(this._buffer.push(e),this._buffer.length>=this._getBatchSize()){this.triggerSend(!1);return}!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){r._timeoutHandle=null,r.triggerSend(!1)},this._getBatchIntervalMs()))}},t.prototype.triggerSend=function(e,r){var n=this._buffer.length<1;n||(e||UCa.isNodeExit?(this._sender.saveOnCrash(this._buffer),typeof r=="function"&&r("data saved on crash")):this._sender.send(this._buffer,r)),this._lastSend=+new Date,this._buffer=[],clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&typeof r=="function"&&r("no data to send")},t})();Ivi.exports=QCa});var wvi=I(uyr=>{"use strict";p();Object.defineProperty(uyr,"__esModule",{value:!0});uyr.azureRoleEnvironmentTelemetryProcessor=qCa;function qCa(t,e){}a(qCa,"azureRoleEnvironmentTelemetryProcessor")});var kvi=I(yht=>{"use strict";p();Object.defineProperty(yht,"__esModule",{value:!0});yht.samplingTelemetryProcessor=jCa;yht.getSamplingHashCode=Pvi;var Rvi=yE();function jCa(t,e){var r=t.sampleRate,n=!1;return r==null||r>=100||t.data&&Rvi.TelemetryType.Metric===Rvi.baseTypeToTelemetryType(t.data.baseType)?!0:(e.correlationContext&&e.correlationContext.operation?n=Pvi(e.correlationContext.operation.id){"use strict";p();var HCa=l8&&l8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GCa=l8&&l8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$Ca=l8&&l8.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HCa(e,t,r);return GCa(e,t),e};Object.defineProperty(l8,"__esModule",{value:!0});l8.performanceMetricsTelemetryProcessor=VCa;var dyr=Ppt(),fyr=$Ca(yE());function VCa(t,e){switch(e&&e.addDocument(t),t.data.baseType){case fyr.TelemetryTypeString.Exception:dyr.countException();break;case fyr.TelemetryTypeString.Request:var r=t.data.baseData;dyr.countRequest(r.duration,r.success);break;case fyr.TelemetryTypeString.Dependency:var n=t.data.baseData;dyr.countDependency(n.duration,n.success);break}return!0}a(VCa,"performanceMetricsTelemetryProcessor")});var Nvi=I(k2=>{"use strict";p();var X5=k2&&k2.__assign||function(){return X5=Object.assign||function(t){for(var e,r=1,n=arguments.length;r{"use strict";p();var ZCa=e4&&e4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_ht=e4&&e4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZCa(e,t,r)};Object.defineProperty(e4,"__esModule",{value:!0});_ht(wvi(),e4);_ht(kvi(),e4);_ht(Dvi(),e4);_ht(Nvi(),e4)});var pyr=I((ccp,Lvi)=>{"use strict";p();var Ji=yE(),Tb=VA(),Ovi=PH(),XCa=jl(),eba=(function(){function t(){}return a(t,"EnvelopeFactory"),t.createEnvelope=function(e,r,n,o,s){var c=null;switch(r){case Ji.TelemetryType.Trace:c=t.createTraceData(e);break;case Ji.TelemetryType.Dependency:c=t.createDependencyData(e);break;case Ji.TelemetryType.Event:c=t.createEventData(e);break;case Ji.TelemetryType.Exception:c=t.createExceptionData(e);break;case Ji.TelemetryType.Request:c=t.createRequestData(e);break;case Ji.TelemetryType.Metric:c=t.createMetricData(e);break;case Ji.TelemetryType.Availability:c=t.createAvailabilityData(e);break;case Ji.TelemetryType.PageView:c=t.createPageViewData(e);break}if(c&&c.baseData&&Ji.domainSupportsProperties(c.baseData)){if(n)if(!c.baseData.properties)c.baseData.properties=n;else for(var l in n)c.baseData.properties[l]||(c.baseData.properties[l]=n[l]);t.addAzureFunctionsCorrelationProperties(c.baseData.properties),c.baseData.properties&&(c.baseData.properties=Tb.validateStringMap(c.baseData.properties))}var u=s&&s.instrumentationKey||"",d=new Ji.Envelope;return d.data=c,d.iKey=u,d.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),d.tags=this.getTags(o,e.tagOverrides),d.time=new Date().toISOString(),d.ver=1,d.sampleRate=s?s.samplingPercentage:100,r===Ji.TelemetryType.Metric&&(d.sampleRate=100),d},t.addAzureFunctionsCorrelationProperties=function(e){var r=Ovi.CorrelationContextManager.getCurrentContext();if(r&&r.customProperties&&r.customProperties.getProperty instanceof Function){e=e||{};var n=r.customProperties.getProperty("InvocationId");n&&(e.InvocationId=n),n=r.customProperties.getProperty("ProcessId"),n&&(e.ProcessId=n),n=r.customProperties.getProperty("LogLevel"),n&&(e.LogLevel=n),n=r.customProperties.getProperty("Category"),n&&(e.Category=n),n=r.customProperties.getProperty("HostInstanceId"),n&&(e.HostInstanceId=n),n=r.customProperties.getProperty("AzFuncLiveLogsSessionId"),n&&(e.AzFuncLiveLogsSessionId=n)}},t.truncateProperties=function(e){if(e.properties)try{for(var r={},n=Object.keys(e.properties),o=Object.values(e.properties),s=0;s0,o.exceptions.push(c);var l=new Ji.Data;return l.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Exception),l.baseData=o,l},t.createRequestData=function(e){var r,n,o,s,c=new Ji.RequestData;e.id?c.id=e.id:c.id=Tb.w3cTraceId(),c.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),c.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),c.source=(o=e.source)===null||o===void 0?void 0:o.substring(0,1024),c.duration=Tb.msToTimeSpan(e.duration),c.responseCode=(s=e.resultCode?e.resultCode.toString():"0")===null||s===void 0?void 0:s.substring(0,1024),c.success=e.success,c.properties=this.truncateProperties(e),c.measurements=e.measurements;var l=new Ji.Data;return l.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Request),l.baseData=c,l},t.createMetricData=function(e){var r,n=new Ji.MetricData;n.metrics=[];var o=new Ji.DataPoint;o.count=isNaN(e.count)?1:e.count,o.kind=Ji.DataPointType.Aggregation,o.max=isNaN(e.max)?e.value:e.max,o.min=isNaN(e.min)?e.value:e.min,o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.stdDev=isNaN(e.stdDev)?0:e.stdDev,o.value=e.value,o.ns=e.namespace,n.metrics.push(o),n.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Metric),s.baseData=n,s},t.createAvailabilityData=function(e){var r,n,o=new Ji.AvailabilityData;e.id?o.id=e.id:o.id=Tb.w3cTraceId(),o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Tb.msToTimeSpan(e.duration),o.success=e.success,o.runLocation=e.runLocation,o.message=(n=e.message)===null||n===void 0?void 0:n.substring(0,8192),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.Availability),s.baseData=o,s},t.createPageViewData=function(e){var r,n,o=new Ji.PageViewData;o.name=(r=e.name)===null||r===void 0?void 0:r.substring(0,1024),o.duration=Tb.msToTimeSpan(e.duration),o.url=(n=e.url)===null||n===void 0?void 0:n.substring(0,2048),o.measurements=e.measurements,o.properties=this.truncateProperties(e);var s=new Ji.Data;return s.baseType=Ji.telemetryTypeToBaseType(Ji.TelemetryType.PageView),s.baseData=o,s},t.getTags=function(e,r){var n=Ovi.CorrelationContextManager.getCurrentContext(),o={};if(e&&e.tags)for(var s in e.tags)o[s]=e.tags[s];if(r)for(var s in r)o[s]=r[s];return n&&(o[e.keys.operationId]=o[e.keys.operationId]||n.operation.id,o[e.keys.operationName]=o[e.keys.operationName]||n.operation.name,o[e.keys.operationParentId]=o[e.keys.operationParentId]||n.operation.parentId),o},t.parseStack=function(e){var r=void 0;if(typeof e=="string"){var n=e.split(` +`);r=[];for(var o=0,s=0,c=0;c<=n.length;c++){var l=n[c];if(Bvi.regex.test(l)){var u=new Bvi(n[c],o++);s+=u.sizeInBytes,r.push(u)}}var d=32*1024;if(s>d)for(var f=0,h=r.length-1,m=0,g=f,A=h;fd){var _=A-g+1;r.splice(g,_);break}g=f,A=h,f++,h--}}return r},t})(),Bvi=(function(){function t(e,r){this.sizeInBytes=0,this.level=r,this.method="",this.assembly=Tb.trim(e);var n=e.match(t.regex);n&&n.length>=5&&(this.method=Tb.trim(n[2])||this.method,this.fileName=Tb.trim(n[4])||"",this.line=parseInt(n[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=t.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return a(t,"_StackFrame"),t.regex=/^(\s+at)?(.*?)(\@|\s\(|\s)([^\(\n]+):(\d+):(\d+)(\)?)$/,t.baseSize=58,t})();Lvi.exports=eba});var Fvi=I(UH=>{"use strict";p();var tba=UH&&UH.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},rba=UH&&UH.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]{"use strict";p();var vht=lMe&&lMe.__awaiter||function(t,e,r,n){function o(s){return s instanceof r?s:new r(function(c){c(s)})}return a(o,"adopt"),new(r||(r=Promise))(function(s,c){function l(f){try{d(n.next(f))}catch(h){c(h)}}a(l,"fulfilled");function u(f){try{d(n.throw(f))}catch(h){c(h)}}a(u,"rejected");function d(f){f.done?s(f.value):o(f.value).then(l,u)}a(d,"step"),d((n=n.apply(t,e||[])).next())})},Cht=lMe&&lMe.__generator||function(t,e){var r={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,o,s,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(f){return u([d,f])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,d[0]&&(r=0)),r;)try{if(n=1,o&&(s=d[0]&2?o.return:d[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,d[1])).done)return s;switch(o=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,o=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]=0&&(this._resendInterval=Math.floor(r)),typeof n=="number"&&n>=0&&(this._maxBytesOnDisk=Math.floor(n)),e&&!cMe.FileAccessControl.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,this._logWarn("Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")),this._enableDiskRetryMode?(this._statsbeat&&this._statsbeat.addFeature(QH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer||(this._fileCleanupTimer=setTimeout(function(){o._fileCleanupTask()},t.CLEANUP_TIMEOUT),this._fileCleanupTimer.unref())):(this._statsbeat&&this._statsbeat.removeFeature(QH.StatsbeatFeature.DISK_RETRY),this._fileCleanupTimer&&clearTimeout(this._fileCleanupTimer))},t.prototype.send=function(e,r){return vht(this,void 0,void 0,function(){var n,o,s,c,l,u,d,f,h=this;return Cht(this,function(m){switch(m.label){case 0:if(!(e&&e.length>0))return[3,5];if(n=this._redirectedHost||this._config.endpointUrl,o=new uba.URL(n).hostname,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}},c=this._getAuthorizationHandler?this._getAuthorizationHandler(this._config):null,!c)return[3,4];this._statsbeat&&this._statsbeat.addFeature(QH.StatsbeatFeature.AAD_HANDLING),m.label=1;case 1:return m.trys.push([1,3,,4]),[4,c.addAuthorizationHeader(s)];case 2:return m.sent(),[3,4];case 3:return l=m.sent(),u="Failed to get AAD bearer token for the Application.",this._enableDiskRetryMode&&(u+="This batch of telemetry items will be retried. ",this._storeToDisk(e)),u+="Error:"+l.toString(),this._logWarn(u),typeof r=="function"&&r(u),[2];case 4:if(d="",e.forEach(function(g){var A=Ib.stringify(g);typeof A=="string"&&(d+=A+` +`)}),d.length>0&&(d=d.substring(0,d.length-1)),d.length===0)return typeof r=="function"&&r("Empty batch of telemetry items. Nothing to send."),[2];f=Buffer.from?Buffer.from(d):new Buffer(d),cba.gzip(f,function(g,A){var y=A;g?(h._logWarn(Ib.dumpObj(g)),y=f,s.headers["Content-Length"]=f.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=A.length.toString()),h._logInfo(Ib.dumpObj(s)),s[lba.disableCollectionRequestOption]=!0;var E=+new Date,_=a(function(b){b.setEncoding("utf-8");var T="";b.on("data",function(w){T+=w}),b.on("end",function(){var w,R=+new Date,x=R-E;if(h._numConsecutiveFailures=0,T.includes(hba)&&b.statusCode===400&&(myr.warn("Instrumentation key was invalid, please check the iKey"),(w=h._shutdownStatsbeat)===null||w===void 0||w.call(h)),h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&(pba.includes(b.statusCode)?h._statsbeatHasReachedIngestionAtLeastOnce=!0:h._statsbeatFailedToIngest()),h._statsbeat&&(b.statusCode==fba||b.statusCode==dba?h._statsbeat.countThrottle(QH.StatsbeatNetworkCategory.Breeze,o,b.statusCode):h._statsbeat.countRequest(QH.StatsbeatNetworkCategory.Breeze,o,x,b.statusCode===200,b.statusCode)),h._enableDiskRetryMode){if(b.statusCode===200)h._resendTimer||(h._resendTimer=setTimeout(function(){h._resendTimer=null,h._sendFirstFileOnDisk()},h._resendInterval),h._resendTimer.unref());else if(h._isRetriable(b.statusCode))try{h._statsbeat&&h._statsbeat.countRetry(QH.StatsbeatNetworkCategory.Breeze,o,b.statusCode);var P=JSON.parse(T),D=[];P.errors&&(P.errors.forEach(function(L){(L.statusCode==429||L.statusCode==500||L.statusCode==503)&&D.push(e[L.index])}),D.length>0&&h._storeToDisk(D))}catch{h._storeToDisk(e)}}if(b.statusCode===307||b.statusCode===308)if(h._numConsecutiveRedirects++,h._numConsecutiveRedirects<10){var N=b.headers.location?b.headers.location.toString():null;N&&(h._redirectedHost=N,h.send(e,r))}else{var B={name:"Circular Redirect",message:"Error sending telemetry because of circular redirects."};h._statsbeat&&h._statsbeat.countException(QH.StatsbeatNetworkCategory.Breeze,o,B),typeof r=="function"&&r("Error sending telemetry because of circular redirects.")}else h._numConsecutiveRedirects=0,typeof r=="function"&&r(T),h._logInfo(T),typeof h._onSuccess=="function"&&h._onSuccess(T)})},"requestCallback"),v=Ib.makeRequest(h._config,n,s,_);v.setTimeout(t.HTTP_TIMEOUT,function(){h._requestTimedOut=!0,v.abort()}),v.on("error",function(b){if(h._isStatsbeatSender&&!h._statsbeatHasReachedIngestionAtLeastOnce&&h._statsbeatFailedToIngest(),h._numConsecutiveFailures++,h._statsbeat&&h._statsbeat.countException(QH.StatsbeatNetworkCategory.Breeze,o,b),!h._enableDiskRetryMode||h._numConsecutiveFailures>0&&h._numConsecutiveFailures%t.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var T="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";h._enableDiskRetryMode&&(T="Ingestion endpoint could not be reached ".concat(h._numConsecutiveFailures," consecutive times. There may be resulting telemetry loss. Most recent error:")),h._logWarn(T,Ib.dumpObj(b))}else{var T="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";h._logInfo(T,Ib.dumpObj(b))}h._onErrorHelper(b),typeof r=="function"&&(b?(h._requestTimedOut&&(b.name="telemetry timeout",b.message="telemetry request timed out"),r(Ib.dumpObj(b))):r("Error sending telemetry")),h._enableDiskRetryMode&&h._storeToDisk(e)}),v.write(y),v.end()}),m.label=5;case 5:return[2]}})})},t.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(Ib.stringify(e))},t.prototype._isRetriable=function(e){return e===206||e===401||e===403||e===408||e===429||e===500||e===502||e===503||e===504},t.prototype._logInfo=function(e){for(var r=[],n=1;n=3&&this._shutdownStatsbeat())},t.prototype._storeToDisk=function(e){return vht(this,void 0,void 0,function(){var r,n,o,s,c,l,u;return Cht(this,function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),this._logInfo("Checking existence of data storage directory: "+this._tempDir),[4,u8.confirmDirExists(this._tempDir)];case 1:return d.sent(),[3,3];case 2:return r=d.sent(),this._logWarn("Failed to create folder to put telemetry: "+Ib.dumpObj(r)),this._onErrorHelper(r),[2];case 3:return d.trys.push([3,5,,6]),[4,cMe.FileAccessControl.applyACLRules(this._tempDir)];case 4:return d.sent(),[3,6];case 5:return n=d.sent(),this._logWarn("Failed to apply file access control to folder: "+Ib.dumpObj(n)),this._onErrorHelper(n),[2];case 6:return d.trys.push([6,8,,9]),[4,u8.getShallowDirectorySize(this._tempDir)];case 7:return o=d.sent(),o>this._maxBytesOnDisk?(this._logWarn("Not saving data due to max size limit being met. Directory size in bytes is: "+o),[2]):[3,9];case 8:return s=d.sent(),this._logWarn("Failed to read directory for retriable telemetry: "+Ib.dumpObj(s)),this._onErrorHelper(s),[2];case 9:return d.trys.push([9,11,,12]),c="".concat(new Date().getTime(),".ai.json"),l=uee.join(this._tempDir,c),this._logInfo("saving data to disk at: "+l),[4,u8.writeFileAsync(l,Ib.stringify(e),{mode:384})];case 10:return d.sent(),[3,12];case 11:return u=d.sent(),this._logWarn("Failed to persist telemetry to disk: "+Ib.dumpObj(u)),this._onErrorHelper(u),[2];case 12:return[2]}})})},t.prototype._storeToDiskSync=function(e){try{this._logInfo("Checking existence of data storage directory: "+this._tempDir),hyr.existsSync(this._tempDir)||hyr.mkdirSync(this._tempDir),cMe.FileAccessControl.applyACLRulesSync(this._tempDir);var r=u8.getShallowDirectorySizeSync(this._tempDir);if(r>this._maxBytesOnDisk){this._logInfo("Not saving data due to max size limit being met. Directory size in bytes is: "+r);return}var n="".concat(new Date().getTime(),".ai.json"),o=uee.join(this._tempDir,n);this._logInfo("saving data before crash to disk at: "+o),hyr.writeFileSync(o,e,{mode:384})}catch(s){this._logWarn("Error while saving data to disk: "+Ib.dumpObj(s)),this._onErrorHelper(s)}},t.prototype._sendFirstFileOnDisk=function(){return vht(this,void 0,void 0,function(){var e,r,n,o,s,c;return Cht(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),[4,u8.readdirAsync(this._tempDir)];case 1:return e=l.sent(),e=e.filter(function(u){return uee.basename(u).indexOf(".ai.json")>-1}),e.length>0?(r=e[0],n=uee.join(this._tempDir,r),[4,u8.readFileAsync(n)]):[3,5];case 2:return o=l.sent(),[4,u8.unlinkAsync(n)];case 3:return l.sent(),s=JSON.parse(o.toString()),[4,this.send(s)];case 4:l.sent(),l.label=5;case 5:return[3,7];case 6:return c=l.sent(),this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.prototype._onErrorHelper=function(e){typeof this._onError=="function"&&this._onError(e)},t.prototype._fileCleanupTask=function(){return vht(this,void 0,void 0,function(){var e,r,n,o,s,c,l=this;return Cht(this,function(u){switch(u.label){case 0:return u.trys.push([0,6,,7]),[4,u8.readdirAsync(this._tempDir)];case 1:if(e=u.sent(),e=e.filter(function(d){return uee.basename(d).indexOf(".ai.json")>-1}),!(e.length>0))return[3,5];r=0,u.label=2;case 2:return rn,o?(s=uee.join(this._tempDir,e[r]),[4,u8.unlinkAsync(s).catch(function(d){l._onErrorHelper(d)})]):[3,4]):[3,5];case 3:u.sent(),u.label=4;case 4:return r++,[3,2];case 5:return[3,7];case 6:return c=u.sent(),c.code!="ENOENT"&&this._onErrorHelper(c),[3,7];case 7:return[2]}})})},t.TAG="Sender",t.WAIT_BETWEEN_RESEND=60*1e3,t.MAX_BYTES_ON_DISK=50*1024*1024,t.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,t.CLEANUP_TIMEOUT=3600*1e3,t.FILE_RETEMPTION_PERIOD=10080*60*1e3,t.TEMPDIR_PREFIX="appInsights-node",t.HTTP_TIMEOUT=2e4,t})();Uvi.exports=mba});var qvi=I(bht=>{"use strict";p();Object.defineProperty(bht,"__esModule",{value:!0});bht.AzureVirtualMachine=void 0;var Qvi=jl(),gba=VA(),Aba=E0e(),yba="http://169.254.169.254/metadata/instance/compute",Eba="api-version=2017-12-01",_ba="format=json",vba="UNREACH",Cba=(function(){function t(){}return a(t,"AzureVirtualMachine"),t.getAzureComputeMetadata=function(e,r){var n,o=this,s={},c="".concat(yba,"?").concat(Eba,"&").concat(_ba),l=(n={method:"GET"},n[Aba.disableCollectionRequestOption]=!0,n.headers={Metadata:"True"},n),u=gba.makeRequest(e,c,l,function(d){if(d.statusCode===200){s.isVM=!0;var f="";d.on("data",function(h){f+=h}),d.on("end",function(){try{var h=JSON.parse(f);s.id=h.vmId||"",s.subscriptionId=h.subscriptionId||"",s.osType=h.osType||""}catch(m){Qvi.info(t.TAG,m)}r(s)})}else r(s)},!1,!1);u&&(setTimeout(function(){o._requestTimedOut=!0,u.abort()},t.HTTP_TIMEOUT),u.on("error",function(d){o._requestTimedOut&&d&&(d.name="telemetry timeout",d.message="telemetry request timed out"),d&&d.message&&d.message.indexOf(vba)>-1?s.isVM=!1:Qvi.info(t.TAG,d),r(s)}),u.end())},t.HTTP_TIMEOUT=2500,t.TAG="AzureVirtualMachine",t})();bht.AzureVirtualMachine=Cba});var jvi=I(Sht=>{"use strict";p();Object.defineProperty(Sht,"__esModule",{value:!0});Sht.NetworkStatsbeat=void 0;var bba=(function(){function t(e,r){this.endpoint=e,this.host=r,this.totalRequestCount=0,this.totalSuccesfulRequestCount=0,this.totalFailedRequestCount=[],this.retryCount=[],this.exceptionCount=[],this.throttleCount=[],this.intervalRequestExecutionTime=0,this.lastIntervalRequestExecutionTime=0,this.lastTime=+new Date,this.lastRequestCount=0}return a(t,"NetworkStatsbeat"),t})();Sht.NetworkStatsbeat=bba});var Wvi=I((dee,Vvi)=>{"use strict";p();var t4=dee&&dee.__assign||function(){return t4=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]0&&s/o||0;if(n.lastIntervalRequestExecutionTime=n.intervalRequestExecutionTime,o>0){var l=Object.assign({endpoint:this._networkStatsbeatCollection[r].endpoint,host:this._networkStatsbeatCollection[r].host},e);this._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_DURATION,value:c,properties:l})}n.lastRequestCount=n.totalRequestCount,n.lastTime=n.time}},t.prototype._getShortHost=function(e){var r=e;try{var n=new RegExp(/^https?:\/\/(?:www\.)?([^\/.-]+)/),o=n.exec(e);o!=null&&o.length>1&&(r=o[1]),r=r.replace(".in.applicationinsights.azure.com","")}catch{}return r},t.prototype._trackRequestsCount=function(e){for(var r=this,n=a(function(l){s=o._networkStatsbeatCollection[l];var u=Object.assign({endpoint:s.endpoint,host:s.host},e);s.totalSuccesfulRequestCount>0&&(o._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_SUCCESS,value:s.totalSuccesfulRequestCount,properties:u}),s.totalSuccesfulRequestCount=0),s.totalFailedRequestCount.length>0&&(s.totalFailedRequestCount.forEach(function(d){u=Object.assign(t4(t4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.REQUEST_FAILURE,value:d.count,properties:u})}),s.totalFailedRequestCount=[]),s.retryCount.length>0&&(s.retryCount.forEach(function(d){u=Object.assign(t4(t4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.RETRY_COUNT,value:d.count,properties:u})}),s.retryCount=[]),s.throttleCount.length>0&&(s.throttleCount.forEach(function(d){u=Object.assign(t4(t4({},u),{statusCode:d.statusCode})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.THROTTLE_COUNT,value:d.count,properties:u})}),s.throttleCount=[]),s.exceptionCount.length>0&&(s.exceptionCount.forEach(function(d){u=Object.assign(t4(t4({},u),{exceptionType:d.exceptionType})),r._statbeatMetrics.push({name:ld.StatsbeatCounter.EXCEPTION_COUNT,value:d.count,properties:u})}),s.exceptionCount=[])},"_loop_1"),o=this,s,c=0;c0))return[3,2];for(e=[],r=0;r-1)return t.EU_CONNECTION_STRING;return t.NON_EU_CONNECTION_STRING},t.NON_EU_CONNECTION_STRING="InstrumentationKey=c4a29126-a7cb-47e5-b348-11414998b11e;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com",t.EU_CONNECTION_STRING="InstrumentationKey=7dc56bab-3c0c-4e9f-9ebb-d1acadee8d0f;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com",t.STATS_COLLECTION_SHORT_INTERVAL=9e5,t.STATS_COLLECTION_LONG_INTERVAL=864e5,t.STATS_COLLECTION_INITIAL_DELAY=15e3,t.TAG="Statsbeat",t})();Vvi.exports=Dba});var Kvi=I((Scp,Yvi)=>{"use strict";p();var Nba=require("url"),Mba=nAr(),Oba=Tvi(),Bba=f0e(),d8=yE(),Lba=xvi(),Eyr=Mvi(),zvi=PH(),Fba=Wvi(),Uba=gyr(),_yr=VA(),Tht=jl(),Qba=pyr(),qba=(function(){function t(e){this._telemetryProcessors=[];var r=new Mba(e);if(this.config=r,!this.config.instrumentationKey||this.config.instrumentationKey=="")throw new Error("Instrumentation key not found, please provide a connection string before starting Application Insights SDK.");this.context=new Bba,this.commonProperties={},this.authorizationHandler=null,this.config.disableStatsbeat||(this._statsbeat=new Fba(this.config,this.context),this._statsbeat.enable(!0));var n=new Uba(this.config,this.getAuthorizationHandler,null,null,this._statsbeat);this.channel=new Lba(function(){return r.disableAppInsights},function(){return r.maxBatchSize},function(){return r.maxBatchIntervalMs},n)}return a(t,"TelemetryClient"),t.prototype.trackAvailability=function(e){this.track(e,d8.TelemetryType.Availability)},t.prototype.trackPageView=function(e){this.track(e,d8.TelemetryType.PageView)},t.prototype.trackTrace=function(e){this.track(e,d8.TelemetryType.Trace)},t.prototype.trackMetric=function(e){this.track(e,d8.TelemetryType.Metric)},t.prototype.trackException=function(e){e&&e.exception&&!_yr.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,d8.TelemetryType.Exception)},t.prototype.trackEvent=function(e){this.track(e,d8.TelemetryType.Event)},t.prototype.trackRequest=function(e){this.track(e,d8.TelemetryType.Request)},t.prototype.trackDependency=function(e){if(e&&!e.target&&e.data)try{e.target=new Nba.URL(e.data).host}catch(r){e.target=null,Tht.warn(t.TAG,"The URL object is failed to create.",r)}this.track(e,d8.TelemetryType.Dependency)},t.prototype.flush=function(e){this.channel.triggerSend(e?!!e.isAppCrashing:!1,e?e.callback:void 0)},t.prototype.track=function(e,r){if(e&&d8.telemetryTypeToBaseType(r)){var n=Qba.createEnvelope(e,r,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var o=this.runTelemetryProcessors(n,e.contextObjects);o=o&&Eyr.samplingTelemetryProcessor(n,{correlationContext:zvi.CorrelationContextManager.getCurrentContext()}),Eyr.preAggregatedMetricsTelemetryProcessor(n,this.context),o&&(Eyr.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),this.channel.send(n))}else Tht.warn(t.TAG,"track() requires telemetry object and telemetryType to be specified.")},t.prototype.setAutoPopulateAzureProperties=function(e){},t.prototype.getAuthorizationHandler=function(e){return e&&e.aadTokenCredential?(this.authorizationHandler||(Tht.info(t.TAG,"Adding authorization handler"),this.authorizationHandler=new Oba(e.aadTokenCredential,e.aadAudience)),this.authorizationHandler):null},t.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},t.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},t.prototype.runTelemetryProcessors=function(e,r){var n=!0,o=this._telemetryProcessors.length;if(o===0)return n;r=r||{},r.correlationContext=zvi.CorrelationContextManager.getCurrentContext();for(var s=0;s{"use strict";p();var jba=vyr&&vyr.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Hba=Kvi(),Jvi=Kgr(),Gba=E0e(),Iht=jl(),$ba=(function(t){jba(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"NodeClient"),e.prototype.trackNodeHttpRequestSync=function(r){r&&r.request&&r.response&&r.duration?Jvi.trackRequestSync(this,r):Iht.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},e.prototype.trackNodeHttpRequest=function(r){(r.duration||r.error)&&Iht.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),r&&r.request&&r.response?Jvi.trackRequest(this,r):Iht.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},e.prototype.trackNodeHttpDependency=function(r){r&&r.request?Gba.trackRequest(this,r):Iht.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},e})(Hba);Zvi.exports=$ba});var tCi=I(eCi=>{"use strict";p();Object.defineProperty(eCi,"__esModule",{value:!0})});var oCi=I(At=>{"use strict";p();Object.defineProperty(At,"__esModule",{value:!0});At.Configuration=At.liveMetricsClient=At.defaultClient=At.DistributedTracingModes=void 0;At.setup=e1a;At.start=iCi;At.getCorrelationContext=r1a;At.startOperation=n1a;At.wrapWithCorrelationContext=i1a;At.dispose=o1a;var byr=PH(),Vba=Lyi(),Wba=Uyi(),Syr=Ppt(),zba=Bgr(),Yba=Yyi(),Kba=sEi(),Jba=E0e(),Zba=Kgr(),rCi=BX(),uMe=jl(),nCi=QEi(),Tyr=jEi(),Xba=$Ei();At.TelemetryClient=Xvi();At.Contracts=yE();At.azureFunctionsTypes=tCi();var Cyr;(function(t){t[t.AI=0]="AI",t[t.AI_AND_W3C=1]="AI_AND_W3C"})(Cyr||(At.DistributedTracingModes=Cyr={}));var dMe,fMe,pMe,hMe,mMe,H0e,G0e,fee,gMe,AMe,TT=!1,xht;function e1a(t){return At.defaultClient?uMe.info("The default client is already setup"):(At.defaultClient=new At.TelemetryClient(t),dMe=new Vba(At.defaultClient),fMe=new Wba(At.defaultClient),pMe=new Syr(At.defaultClient),hMe=new zba(At.defaultClient),mMe=new Yba(At.defaultClient),H0e=new Kba(At.defaultClient),fee=new Zba(At.defaultClient),gMe=new Jba(At.defaultClient),G0e||(G0e=new Tyr.AutoCollectNativePerformance(At.defaultClient)),AMe=new Xba.AzureFunctionsHook(At.defaultClient)),Iyr}a(e1a,"setup");function t1a(){At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers==null&&(At.defaultClient.config.enableAutoCollectExternalLoggers=!0),At.defaultClient.config.enableAutoCollectConsole==null&&(At.defaultClient.config.enableAutoCollectConsole=!1),At.defaultClient.config.enableAutoCollectExceptions==null&&(At.defaultClient.config.enableAutoCollectExceptions=!0),At.defaultClient.config.enableAutoCollectPerformance==null&&(At.defaultClient.config.enableAutoCollectPerformance=!0),At.defaultClient.config.enableAutoCollectPreAggregatedMetrics==null&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=!0),At.defaultClient.config.enableAutoCollectHeartbeat==null&&(At.defaultClient.config.enableAutoCollectHeartbeat=!0),At.defaultClient.config.enableAutoCollectRequests==null&&(At.defaultClient.config.enableAutoCollectRequests=!0),At.defaultClient.config.enableAutoCollectDependencies==null&&(At.defaultClient.config.enableAutoCollectDependencies=!0),At.defaultClient.config.enableUseDiskRetryCaching==null&&(At.defaultClient.config.enableUseDiskRetryCaching=!0),At.defaultClient.config.enableAutoDependencyCorrelation==null&&(At.defaultClient.config.enableAutoDependencyCorrelation=!0),At.defaultClient.config.enableSendLiveMetrics==null&&(At.defaultClient.config.enableSendLiveMetrics=!1),At.defaultClient.config.enableAutoCollectExtendedMetrics==null&&(At.defaultClient.config.enableAutoCollectExtendedMetrics=!0),At.defaultClient.config.enableWebInstrumentation==null&&(At.defaultClient.config.enableWebInstrumentation=!1),At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions==null&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=!1))}a(t1a,"_setDefaultConfig");function iCi(){if(At.defaultClient){TT=!0,t1a(),dMe.enable(At.defaultClient.config.enableAutoCollectExternalLoggers,At.defaultClient.config.enableAutoCollectConsole),fMe.enable(At.defaultClient.config.enableAutoCollectExceptions),pMe.enable(At.defaultClient.config.enableAutoCollectPerformance),hMe.enable(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics),mMe.enable(At.defaultClient.config.enableAutoCollectHeartbeat),fee.useAutoCorrelation(At.defaultClient.config.enableAutoDependencyCorrelation,At.defaultClient.config.enableUseAsyncHooks),fee.enable(At.defaultClient.config.enableAutoCollectRequests),gMe.enable(At.defaultClient.config.enableAutoCollectDependencies),H0e.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString),At.defaultClient.config.enableSendLiveMetrics&&(At.liveMetricsClient||(At.liveMetricsClient=new nCi(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),xht=new Syr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(xht),At.defaultClient.quickPulseClient=At.liveMetricsClient),At.liveMetricsClient.enable(At.defaultClient.config.enableSendLiveMetrics)),AMe.enable(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions);var t=Tyr.AutoCollectNativePerformance.parseEnabled(At.defaultClient.config.enableAutoCollectExtendedMetrics,At.defaultClient.config);G0e.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,t.disabledMetrics),At.defaultClient&&At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)}else uMe.warn("Start cannot be called before setup");return Iyr}a(iCi,"start");function r1a(){return byr.CorrelationContextManager.getCurrentContext()}a(r1a,"getCorrelationContext");function n1a(t,e){return byr.CorrelationContextManager.startOperation(t,e)}a(n1a,"startOperation");function i1a(t,e){return byr.CorrelationContextManager.wrapCallback(t,e)}a(i1a,"wrapWithCorrelationContext");var Iyr=(function(){function t(){}return a(t,"Configuration"),t.setDistributedTracingMode=function(e){return rCi.w3cEnabled=e===Cyr.AI_AND_W3C,t},t.setAutoCollectConsole=function(e,r){return r===void 0&&(r=!1),At.defaultClient&&(At.defaultClient.config.enableAutoCollectExternalLoggers=e,At.defaultClient.config.enableAutoCollectConsole=r,TT&&dMe.enable(e,r)),t},t.setAutoCollectExceptions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectExceptions=e,TT&&fMe.enable(e)),t},t.setAutoCollectPerformance=function(e,r){if(r===void 0&&(r=!0),At.defaultClient){At.defaultClient.config.enableAutoCollectPerformance=e;var n=Tyr.AutoCollectNativePerformance.parseEnabled(r,At.defaultClient.config);At.defaultClient.config.enableAutoCollectExtendedMetrics=n.isEnabled,TT&&(pMe.enable(e),G0e.enable(At.defaultClient.config.enableAutoCollectExtendedMetrics,n.disabledMetrics))}return t},t.setAutoCollectPreAggregatedMetrics=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectPreAggregatedMetrics=e,TT&&hMe.enable(e)),t},t.setAutoCollectHeartbeat=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectHeartbeat=e,TT&&mMe.enable(e)),t},t.enableAutoWebSnippetInjection=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,TT&&H0e.enable(At.defaultClient.config.enableAutoWebSnippetInjection,At.defaultClient.config.webSnippetConnectionString)),t},t.enableWebInstrumentation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableWebInstrumentation=e,At.defaultClient.config.webInstrumentationConnectionString=r,TT&&H0e.enable(At.defaultClient.config.enableWebInstrumentation,At.defaultClient.config.webInstrumentationConnectionString)),t},t.setAutoCollectRequests=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectRequests=e,TT&&fee.enable(e)),t},t.setAutoCollectDependencies=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectDependencies=e,TT&&gMe.enable(e)),t},t.setAutoDependencyCorrelation=function(e,r){return At.defaultClient&&(At.defaultClient.config.enableAutoDependencyCorrelation=e,At.defaultClient.config.enableUseAsyncHooks=r,TT&&fee.useAutoCorrelation(e,r)),t},t.setUseDiskRetryCaching=function(e,r,n){return At.defaultClient&&(At.defaultClient.config.enableUseDiskRetryCaching=e,At.defaultClient.config.enableResendInterval=r,At.defaultClient.config.enableMaxBytesOnDisk=n,At.defaultClient.channel&&At.defaultClient.channel.setUseDiskRetryCaching(At.defaultClient.config.enableUseDiskRetryCaching,At.defaultClient.config.enableResendInterval,At.defaultClient.config.enableMaxBytesOnDisk)),t},t.setInternalLogging=function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!0),uMe.enableDebug=e,uMe.disableWarnings=!r,t},t.setAutoCollectIncomingRequestAzureFunctions=function(e){return At.defaultClient&&(At.defaultClient.config.enableAutoCollectIncomingRequestAzureFunctions=e,TT&&AMe.enable(e)),t},t.setSendLiveMetrics=function(e){return e===void 0&&(e=!1),At.defaultClient?(!At.liveMetricsClient&&e?(At.liveMetricsClient=new nCi(At.defaultClient.config,At.defaultClient.context,At.defaultClient.getAuthorizationHandler,At.defaultClient),xht=new Syr(At.liveMetricsClient,1e3,!0),At.liveMetricsClient.addCollector(xht),At.defaultClient.quickPulseClient=At.liveMetricsClient):At.liveMetricsClient&&At.liveMetricsClient.enable(e),At.defaultClient.config.enableSendLiveMetrics=e,t):(uMe.warn("Live metrics client cannot be setup without the default client"),t)},t.start=iCi,t})();At.Configuration=Iyr;function o1a(){rCi.w3cEnabled=!0,At.defaultClient=null,TT=!1,dMe&&dMe.dispose(),fMe&&fMe.dispose(),pMe&&pMe.dispose(),hMe&&hMe.dispose(),mMe&&mMe.dispose(),H0e&&H0e.dispose(),G0e&&G0e.dispose(),fee&&fee.dispose(),gMe&&gMe.dispose(),At.liveMetricsClient&&(At.liveMetricsClient.enable(!1),At.liveMetricsClient=void 0),AMe&&AMe.dispose()}a(o1a,"dispose")});var wyr=I(tR=>{"use strict";p();var s1a=tR&&tR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),a1a=tR&&tR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),sCi=tR&&tR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this.client.flush({callback:a(()=>{e(void 0)},"callback")})})}massageEventName(e){return d1a(e)?aCi(e):e.includes(this.namespace)?e:`${this.namespace}/${e}`}};tR.AzureInsightReporter=xyr;function f1a(t,e,r){let n=new c1a.TelemetryClient(r);return n.config.enableAutoCollectRequests=!1,n.config.enableAutoCollectPerformance=!1,n.config.enableAutoCollectExceptions=!1,n.config.enableAutoCollectConsole=!1,n.config.enableAutoCollectDependencies=!1,n.config.noDiagnosticChannel=!0,cCi(t,e,n),n}a(f1a,"createAppInsightsClient");function cCi(t,e,r){r.commonProperties=p1a(r.commonProperties,e),r.context.tags[r.context.keys.cloudRoleInstance]="REDACTED",r.context.tags[r.context.keys.sessionId]=e.sessionId;let n=t.copilotTelemetryURL;n&&URL.canParse(n)&&(r.config.endpointUrl=n)}a(cCi,"configureReporter");function p1a(t,e){return t=t||{},t.common_os=wht.platform(),t.common_platformversion=wht.release(),t.common_arch=wht.arch(),t.common_cpu=Array.from(new Set(wht.cpus().map(r=>r.model))).join(),t.common_vscodemachineid=e.machineId,t.common_vscodesessionid=e.sessionId,t.client_deviceid=e.devDeviceId,t.common_uikind=e.uiKind,t.common_remotename=e.remoteName??"none",t.common_isnewappinstall="",t}a(p1a,"decorateWithCommonProperties")});var lCi=I((Lcp,h1a)=>{h1a.exports={name:"copilot-chat",displayName:"GitHub Copilot Chat",description:"AI chat features powered by Copilot",version:"0.51.0",build:"1",completionsCoreVersion:"1.378.1799",internalLargeStorageAriaKey:"ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917",ariaKey:"0c6ae279ed8443289764825290e4f9e2-1a736e7c-1324-4338-be46-fc2a58ae4d14-7255",buildType:"dev",publisher:"GitHub",homepage:"https://github.com/features/copilot?editor=vscode",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"https://github.com/microsoft/vscode-copilot-chat"},bugs:{url:"https://github.com/microsoft/vscode/issues"},qna:"https://github.com/github-community/community/discussions/categories/copilot",icon:"assets/copilot.png",pricing:"Trial",engines:{vscode:"^1.123.0",npm:">=9.0.0",node:">=22.14.0"},categories:["AI","Chat","Programming Languages","Machine Learning"],keywords:["ai","openai","codex","pilot","snippets","documentation","autocomplete","intellisense","refactor","javascript","python","typescript","php","go","golang","ruby","c++","c#","java","kotlin","co-pilot"],badges:[{url:"https://img.shields.io/badge/GitHub%20Copilot-Subscription%20Required-orange",href:"https://github.com/github-copilot/signup?editor=vscode",description:"%github.copilot.badge.signUp%"},{url:"https://img.shields.io/github/stars/github/copilot-docs?style=social",href:"https://github.com/github/copilot-docs",description:"%github.copilot.badge.star%"},{url:"https://img.shields.io/youtube/channel/views/UC7c3Kb6jYCRj4JOHHZTxKsQ?style=social",href:"https://www.youtube.com/@GitHub/search?query=copilot",description:"%github.copilot.badge.youtube%"},{url:"https://img.shields.io/twitter/follow/github?style=social",href:"https://twitter.com/github",description:"%github.copilot.badge.twitter%"}],activationEvents:["onStartupFinished","onLanguageModelChat:copilot","onUri","onFileSystem:ccreq","onFileSystem:ccsettings"],main:"./dist/extension",l10n:"./l10n",enabledApiProposals:["agentSessionsWorkspace","agentsWindowConfiguration","chatDebug","chatHooks","extensionsAny","newSymbolNamesProvider","interactive","codeActionAI","activeComment","commentReveal","contribCommentThreadAdditionalMenu","contribCommentsViewThreadMenus","contribChatEditorInlineGutterMenu","documentFiltersExclusive","embeddings","findTextInFiles","findTextInFiles2","languageModelToolSupportsModel","findFiles2","textSearchProvider","terminalDataWriteEvent","terminalExecuteCommandEvent","terminalSelection","terminalQuickFixProvider","mappedEditsProvider","aiRelatedInformation","aiSettingsSearch","chatParticipantAdditions","defaultChatParticipant","contribSourceControlInputBoxMenu","authLearnMore","testObserver","aiTextSearchProvider","chatParticipantPrivate","chatProvider","contribDebugCreateConfiguration","chatReferenceDiagnostic","textSearchProvider2","chatReferenceBinaryData","languageModelSystem","languageModelCapabilities","languageModelPricing","inlineCompletionsAdditions","chatStatusItem","chatInputNotification","taskProblemMatcherStatus","contribLanguageModelToolSets","textDocumentChangeReason","resolvers","taskExecutionTerminal","dataChannels","languageModelThinkingPart","chatSessionsProvider","devDeviceId","contribEditorContentMenu","chatPromptFiles","mcpServerDefinitions","tabInputMultiDiff","workspaceTrust","environmentPower","terminalTitle","toolInvocationApproveCombination","chatSessionCustomizationProvider"],contributes:{languageModelTools:[{name:"copilot_searchCodebase",toolReferenceName:"codebase",displayName:"%copilot.tools.searchCodebase.name%",icon:"$(folder)",userDescription:"%copilot.codebase.tool.description%",modelDescription:"Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.",tags:["codesearch","vscode_codesearch"],inputSchema:{type:"object",properties:{query:{type:"string",description:"The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments."}},required:["query"]}},{name:"execution_subagent",toolReferenceName:"executionSubagent",displayName:"%copilot.tools.executionSubagent.name%",icon:"$(play)",userDescription:"%copilot.tools.executionSubagent.description%",modelDescription:`Launch an iterative execution-focused subagent that performs an execution-based task. USE THIS INSTEAD OF RUNNING INDIVIDUAL COMMANDS WITH run_in_terminal EXCEPT IN THE RARE CASES THAT YOU NEED THE FULL OUTPUT OF A COMMAND. Here are some examples of how it can be used: - Run tests and filter the output to summarize which tests failed and why. @@ -792,49 +752,43 @@ EXAMPLES: **Note**: This is an advanced setting.`,tags:["advanced","experimental"]},"github.copilot.chat.reasoningEffortOverride":{type:["string","null"],default:null,markdownDescription:"Overrides the reasoning/thinking effort sent to model APIs. The configured value must match a reasoning-effort value supported by the selected model or endpoint (for example, `low`, `medium`, `high`, or other model-specific values). Used by evals.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced"]},"github.copilot.chat.anthropic.promptCaching.extendedTtl":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtl%"},"github.copilot.chat.anthropic.promptCaching.extendedTtlMessages":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.anthropic.promptCaching.extendedTtlMessages%"},"github.copilot.chat.modelCapabilityOverrides":{type:"object",default:{},markdownDescription:"%github.copilot.config.modelCapabilityOverrides%",additionalProperties:{type:"object",properties:{family:{type:"string",description:"Alias the model's family for capability routing (e.g. 'claude-opus-4.7')."}},additionalProperties:!1},tags:["advanced"]},"github.copilot.chat.installExtensionSkill.enabled":{type:"boolean",default:!1,tags:["advanced","experimental","onExp"],description:"%github.copilot.config.installExtensionSkill.enabled%"},"github.copilot.chat.debug.promptOverrideString":{type:["string","null"],default:null,markdownDescription:"YAML string that overrides the system prompt and/or tool descriptions sent to the model. When both this setting and `github.copilot.chat.debug.promptOverrideFile` are configured, this setting takes precedence.\n\n**Note**: This is an advanced debugging setting.",tags:["advanced","experimental"]},"github.copilot.chat.debug.promptOverrideFile":{type:["string","null"],default:null,markdownDescription:`Path to a YAML file that overrides the system prompt and/or tool descriptions sent to the model. -**Note**: This is an advanced debugging setting.`,tags:["advanced","experimental"]},"github.copilot.chat.edits.gemini3MultiReplaceString":{type:"boolean",default:!1,markdownDescription:"Enable the modern `multi_replace_string_in_file` edit tool when generating edits with Gemini 3 models.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.edits.batchReplaceStringDescriptions":{type:"boolean",default:!1,markdownDescription:"Update tool descriptions to promote `multi_replace_string_in_file` as the primary multi-edit tool.",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.expanded":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.expanded%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.chat":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.chat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.projectLabels.inline":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.projectLabels.inline%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.maxLocalIndexSize":{type:"number",default:1e5,markdownDescription:"%github.copilot.config.workspace.maxLocalIndexSize%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.enableCodeSearch":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.enableCodeSearch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.preferredEmbeddingsModel":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.preferredEmbeddingsModel%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.workspace.prototypeAdoCodeSearchEndpointOverride":{type:"string",default:"",markdownDescription:"%github.copilot.config.workspace.prototypeAdoCodeSearchEndpointOverride%",tags:["advanced","experimental"]},"github.copilot.chat.feedback.onChange":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.feedback.onChange%",tags:["advanced","experimental"]},"github.copilot.chat.review.intent":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.review.intent%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.summaryExperimentEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.summaryExperimentEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.variableFilteringEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.variableFilteringEnabled%",tags:["advanced","experimental"]},"github.copilot.chat.notebook.alternativeFormat":{type:"string",default:"xml",enum:["xml","markdown"],markdownDescription:"%github.copilot.config.notebook.alternativeFormat%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.notebook.alternativeNESFormat.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.notebook.alternativeNESFormat.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debugTerminalCommandPatterns":{type:"array",default:[],items:{type:"string"},markdownDescription:"%github.copilot.config.debugTerminalCommandPatterns%",tags:["advanced","experimental"]},"github.copilot.chat.localWorkspaceRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.localWorkspaceRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.editRecording.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.editRecording.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.inlineChat.reasoningEffort":{type:"string",default:"low",enum:["none","minimal","low","medium","high"],markdownDescription:"%github.copilot.config.inlineChat.reasoningEffort%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineChat.enableThinking":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineChat.enableThinking%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.debug.requestLogger.maxEntries":{type:"number",default:100,markdownDescription:"%github.copilot.config.debug.requestLogger.maxEntries%",tags:["advanced","experimental"]},"github.copilot.chat.inlineEdits.diagnosticsContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.diagnosticsContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.chatSessionContextProvider.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.inlineEdits.chatSessionContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.codesearch.agent.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.codesearch.agent.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.agent.temperature":{type:["number","null"],markdownDescription:"%github.copilot.config.agent.temperature%",tags:["advanced","experimental"]},"github.copilot.chat.agent.omitFileAttachmentContents":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.omitFileAttachmentContents%",tags:["advanced","experimental"]},"github.copilot.chat.agent.backgroundTodoAgent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.backgroundTodoAgent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.longToolCallCachePreservation.maxProbes":{type:"number",default:1,markdownDescription:"%github.copilot.config.agent.longToolCallCachePreservation.maxProbes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agent.largeToolResultsToDisk.thresholdBytes":{type:"number",default:8192,markdownDescription:"%github.copilot.config.agent.largeToolResultsToDisk.thresholdBytes%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextModelName":{type:"string",default:"gpt-4o-instant-apply-full-ft-v66-short",markdownDescription:"%github.copilot.config.instantApply.shortContextModelName%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.instantApply.shortContextLimit":{type:"number",default:8e3,markdownDescription:"%github.copilot.config.instantApply.shortContextLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.enableUserPreferences":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.enableUserPreferences%",tags:["advanced","experimental"]},"github.copilot.chat.skillTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.skill.enabled%",tags:["advanced","experimental"]},"github.copilot.chat.getChangedFilesTool.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.getChangedFilesTool.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.model":{type:"string",default:"gemini-3-flash",markdownDescription:"%github.copilot.config.executionSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.executionSubagent.useAgenticProxy%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.executionSubagent.toolCallLimit":{type:"number",default:10,markdownDescription:"%github.copilot.config.executionSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.summarizeAgentConversationHistoryThreshold":{type:["number","null"],markdownDescription:"%github.copilot.config.summarizeAgentConversationHistoryThreshold%",tags:["advanced","experimental"]},"github.copilot.chat.agentHistorySummarizationMode":{type:["string","null"],markdownDescription:"%github.copilot.config.agentHistorySummarizationMode%",tags:["advanced","experimental"]},"github.copilot.chat.useResponsesApiTruncation":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.useResponsesApiTruncation%",tags:["advanced","experimental"]},"github.copilot.chat.omitBaseAgentInstructions":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.omitBaseAgentInstructions%",tags:["advanced","experimental"]},"github.copilot.chat.promptFileContextProvider.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.promptFileContextProvider.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.tools.defaultToolsGrouped":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.tools.defaultToolsGrouped%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.gpt5AlternativePatch":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.gpt5AlternativePatch%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.triggerOnEditorChangeAfterSeconds":{type:["number","null"],default:10,markdownDescription:"%github.copilot.config.inlineEdits.triggerOnEditorChangeAfterSeconds%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.displayLine":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.displayLine%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens":{type:"number",default:3e3,markdownDescription:"%github.copilot.config.inlineEdits.nextCursorPrediction.currentFileMaxTokens%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.inlineEdits.renameSymbolSuggestions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.inlineEdits.renameSymbolSuggestions%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.preferredModel":{type:"string",default:"none",markdownDescription:"%github.copilot.config.nextEditSuggestions.preferredModel%",tags:["advanced","experimental","onExp"]},"github.copilot.nextEditSuggestions.eagerness":{type:"string",default:"auto",enum:["auto","low","medium","high"],enumItemLabels:["%github.copilot.config.nextEditSuggestions.eagerness.auto.label%","%github.copilot.config.nextEditSuggestions.eagerness.low.label%","%github.copilot.config.nextEditSuggestions.eagerness.medium.label%","%github.copilot.config.nextEditSuggestions.eagerness.high.label%"],enumDescriptions:["%github.copilot.config.nextEditSuggestions.eagerness.auto%","%github.copilot.config.nextEditSuggestions.eagerness.low%","%github.copilot.config.nextEditSuggestions.eagerness.medium%","%github.copilot.config.nextEditSuggestions.eagerness.high%"],markdownDescription:"%github.copilot.config.nextEditSuggestions.eagerness%",tags:["advanced","experimental"]},"github.copilot.chat.cli.mcp.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.mcp.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!0}},"github.copilot.chat.cli.branchSupport.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.branchSupport.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.showExternalSessions":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.showExternalSessions%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.planExitMode.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planExitMode.enabled%",tags:["advanced"]},"github.copilot.chat.cli.autoModel.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.autoModel.enabled%",tags:["advanced"]},"github.copilot.chat.agent.modelDetails.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.chat.agent.modelDetails.enabled%",tags:["advanced"]},"github.copilot.chat.cli.planCommand.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.planCommand.enabled%",tags:["advanced"]},"github.copilot.chat.cli.lazyLoadSessionItem.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.lazyLoadSessionItem.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.cli.aiGenerateBranchNames.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.aiGenerateBranchNames.enabled%",tags:["advanced"]},"github.copilot.chat.cli.forkSessions.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.forkSessions.enabled%",tags:["advanced"]},"github.copilot.chat.cli.isolationOption.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.isolationOption.enabled%",tags:["advanced"],agentsWindow:{default:!0}},"github.copilot.chat.cli.autoCommit.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.autoCommit.enabled%",tags:["advanced","experimental"],agentsWindow:{default:!1}},"github.copilot.chat.cli.sessionController.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionController.enabled%",tags:["advanced"],agentsWindow:{default:!1,readOnly:!0}},"github.copilot.chat.cli.thinkingEffort.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.thinkingEffort.enabled%",tags:["advanced"]},"github.copilot.chat.cli.sessionControllerForSessionsApp.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.cli.sessionControllerForSessionsApp.enabled%",tags:["advanced"]},"github.copilot.chat.cli.terminalLinks.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.terminalLinks.enabled%",tags:["advanced"]},"github.copilot.chat.cli.remote.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.cli.remote.enabled%",tags:["advanced"],agentsWindow:{default:!1}},"github.copilot.chat.searchSubagent.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.useAgenticProxy":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.useAgenticProxy%",tags:["advanced"]},"github.copilot.chat.searchSubagent.model":{type:"string",default:"",markdownDescription:"%github.copilot.config.searchSubagent.model%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.toolCallLimit":{type:"number",default:4,markdownDescription:"%github.copilot.config.searchSubagent.toolCallLimit%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.searchSubagent.thoroughnessEnabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.searchSubagent.thoroughnessEnabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.enabled%",deprecationMessage:"%github.copilot.config.chat.agentDebugLog.enabled.deprecated%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.enabled":{type:"boolean",default:!1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.enabled%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.flushIntervalMs":{type:"number",default:4e3,minimum:2e3,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.flushIntervalMs%",tags:["advanced","experimental"]},"github.copilot.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs":{type:"number",default:50,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxRetainedSessionLogs%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB":{type:"number",default:100,minimum:1,markdownDescription:"%github.copilot.config.chat.agentDebugLog.fileLogging.maxSessionLogSizeMB%",tags:["advanced","experimental","onExp"]},"github.copilot.chat.otel.enabled":{type:"boolean",default:!1,markdownDescription:"Enable OpenTelemetry trace/metric/log emission for Copilot Chat operations. Env var `COPILOT_OTEL_ENABLED` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.exporterType":{type:"string",enum:["otlp-grpc","otlp-http","console","file"],default:"otlp-http",markdownDescription:"OTel exporter type for Copilot Chat telemetry. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.otlpEndpoint":{type:"string",default:"http://localhost:4318",markdownDescription:"OTLP collector endpoint URL for Copilot Chat OTel data. Env var `OTEL_EXPORTER_OTLP_ENDPOINT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.captureContent":{type:"boolean",default:!1,markdownDescription:"Capture input/output messages, system instructions, and tool definitions in OTel telemetry. **Contains potentially sensitive data.** Env var `COPILOT_OTEL_CAPTURE_CONTENT` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.maxAttributeSizeChars":{type:"integer",default:0,minimum:0,markdownDescription:"Maximum size **in characters** for free-form OTel content attributes (prompts, responses, tool arguments/results, hook input/output). `0` (the default) disables truncation so backends without per-attribute size limits receive full JSON payloads. Set to a positive value when your OTel backend caps attribute size \u2014 consult your backend's documentation for its per-attribute limit. Truncated values are suffixed with `...[truncated, original N chars]`. Env var `COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS` takes precedence. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.outfile":{type:"string",default:"",markdownDescription:"File path for file-based OTel exporter output (JSON-lines). When set, overrides exporter type to `file`. Requires window reload.",tags:["advanced"]},"github.copilot.chat.otel.dbSpanExporter.enabled":{type:"boolean",default:!1,markdownDescription:"Enable SQLite DB span exporter. Persists OTel spans to a local SQLite database. Automatically enables OTel when set to true. Requires window reload.",tags:["advanced"]},"github.copilot.chat.workspace.codeSearchExternalIngest.enabled":{type:"boolean",default:!0,markdownDescription:"%github.copilot.config.workspace.codeSearchExternalIngest.enabled%",tags:["advanced","onExp"]}}}],submenus:[{id:"copilot/reviewComment/additionalActions/applyAndNext",label:"%github.copilot.submenu.reviewComment.applyAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discardAndNext",label:"%github.copilot.submenu.reviewComment.discardAndNext.label%"},{id:"copilot/reviewComment/additionalActions/discard",label:"%github.copilot.submenu.reviewComment.discard.label%"},{id:"github.copilot.chat.debug.filter",label:"Filter",icon:"$(filter)"},{id:"github.copilot.chat.debug.exportAllPromptLogsAsJson",label:"Export All Logs as JSON",icon:"$(file-export)"}],menus:{"editor/title":[{command:"github.copilot.debug.generateInlineEditTests",when:"resourceScheme == 'ccreq'"},{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && !config.notebook.globalToolbar",group:"navigation@10"},{command:"github.copilot.chat.copilotCLI.acceptDiff",group:"navigation@1",when:"github.copilot.chat.copilotCLI.hasActiveDiff"},{command:"github.copilot.chat.copilotCLI.rejectDiff",group:"navigation@2",when:"github.copilot.chat.copilotCLI.hasActiveDiff"}],"editor/title/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"explorer/context":[{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !explorerResourceIsFolder"}],"editor/context":[{command:"github.copilot.chat.fix",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted && !editorReadonly && editorSelectionHasDiagnostics",group:"1_chat@4"},{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && chatSetupCompleted",group:"1_chat@5"},{command:"github.copilot.chat.review",when:"config.github.copilot.chat.reviewSelection.enabled && !github.copilot.interactiveSession.disabled && chatSetupCompleted && resourceScheme != 'vscode-chat-code-block'",group:"1_chat@6"},{command:"github.copilot.chat.copilotCLI.addFileReference",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"},{command:"github.copilot.chat.copilotCLI.addSelection",group:"copilot",when:"github.copilot.chat.copilotCLI.hasSession && editorHasSelection && !inOutput && resourceScheme != 'vscode-webview' && resourceScheme != 'webview-panel'"}],"chat/editor/inlineGutter":[{command:"github.copilot.chat.explain",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && !inlineChatFileBelongsToChat",group:"2_chat@2"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled && editor.hasSelection && config.github.copilot.chat.reviewSelection.enabled && !inlineChatFileBelongsToChat",group:"2_chat@3"}],"chat/input/editing/sessionToolbar":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"navigation@0"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"chatSessionType == copilot-cloud-agent && !github.vscode-pull-request-github.activated && gitOpenRepositoryCount != 0",group:"navigation@0"}],"agents/changes/actions/primary":[{command:"github.copilot.sessions.initializeRepository",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == workspace && !sessions.hasGitRepository && !sessions.isAgentHostSession",group:"0_init@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@1"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && !sessions.isMergeBaseBranchProtected && !sessions.hasPullRequest && (sessions.hasUncommittedChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"1_merge@2"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@1"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.isolationMode == worktree && sessions.hasGitRepository && sessions.hasGitHubRemote && !sessions.hasPullRequest && sessions.hasBranchChanges && !sessions.isAgentHostSession",group:"2_pull_request@2"},{command:"github.copilot.sessions.commit",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@1"},{command:"github.copilot.sessions.commitAndSync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && !sessions.isAgentHostSession",group:"3_commit@2"},{command:"github.copilot.sessions.sync",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && sessions.hasUpstream && !sessions.hasUncommittedChanges && (sessions.hasIncomingChanges || sessions.hasOutgoingChanges) && !sessions.isAgentHostSession",group:"4_sync@1"},{command:"github.copilot.claude.sessions.initializeRepository",when:"chatSessionType == claude-code && isSessionsWindow && !sessions.hasGitRepository",group:"init@1"},{command:"github.copilot.claude.sessions.commit",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges",group:"commit@1"},{command:"github.copilot.claude.sessions.commitAndSync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && sessions.hasUncommittedChanges && sessions.hasUpstream",group:"commit@2"},{command:"github.copilot.claude.sessions.sync",when:"chatSessionType == claude-code && isSessionsWindow && sessions.hasGitRepository && !sessions.hasUncommittedChanges && sessions.hasUpstream",group:"sync@1"}],"agents/change/inline":[{command:"github.copilot.sessions.discardChanges",when:"chatSessionType == copilotcli && isSessionsWindow && sessions.hasGitRepository && !isActiveSessionArchived && !sessions.isAgentHostSession",group:"navigation@2"}],"chat/contextUsage/actions":[{command:"github.copilot.chat.compact"}],"chat/newSession":[{command:"github.copilot.cli.newSession",group:"4_recommendations@0"}],"testing/item/result":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],"testing/item/context":[{command:"github.copilot.tests.fixTestFailure.fromInline",when:"testResultState == failed && !testResultOutdated",group:"inline@2"}],commandPalette:[{command:"github.copilot.cli.openInCopilotCLI",when:"false"},{command:"github.copilot.debug.extensionState",when:"false"},{command:"github.copilot.cli.sessions.commitToWorktree",when:"false"},{command:"github.copilot.cli.sessions.commitToRepository",when:"false"},{command:"github.copilot.chat.triggerPermissiveSignIn",when:"false"},{command:"github.copilot.interactiveSession.feedback",when:"github.copilot-chat.activated && !github.copilot.interactiveSession.disabled"},{command:"github.copilot.debug.workbenchState",when:"true"},{command:"github.copilot.chat.rerunWithCopilotDebug",when:"false"},{command:"github.copilot.chat.startCopilotDebugCommand",when:"false"},{command:"github.copilot.git.generateCommitMessage",when:"false"},{command:"github.copilot.git.resolveMergeConflicts",when:"false"},{command:"github.copilot.chat.explain",when:"false"},{command:"github.copilot.chat.review",when:"!github.copilot.interactiveSession.disabled"},{command:"github.copilot.chat.review.apply",when:"false"},{command:"github.copilot.chat.review.applyAndNext",when:"false"},{command:"github.copilot.chat.review.discard",when:"false"},{command:"github.copilot.chat.review.discardAndNext",when:"false"},{command:"github.copilot.chat.review.discardAll",when:"false"},{command:"github.copilot.chat.review.stagedChanges",when:"false"},{command:"github.copilot.chat.review.unstagedChanges",when:"false"},{command:"github.copilot.chat.review.changes",when:"false"},{command:"github.copilot.chat.review.stagedFileChange",when:"false"},{command:"github.copilot.chat.review.unstagedFileChange",when:"false"},{command:"github.copilot.chat.review.previous",when:"false"},{command:"github.copilot.chat.review.next",when:"false"},{command:"github.copilot.chat.review.continueInInlineChat",when:"false"},{command:"github.copilot.chat.review.continueInChat",when:"false"},{command:"github.copilot.chat.review.markHelpful",when:"false"},{command:"github.copilot.chat.review.markUnhelpful",when:"false"},{command:"github.copilot.devcontainer.generateDevContainerConfig",when:"false"},{command:"github.copilot.tests.fixTestFailure",when:"false"},{command:"github.copilot.tests.fixTestFailure.fromInline",when:"false"},{command:"github.copilot.search.markHelpful",when:"false"},{command:"github.copilot.search.markUnhelpful",when:"false"},{command:"github.copilot.search.feedback",when:"false"},{command:"github.copilot.chat.debug.showElements",when:"false"},{command:"github.copilot.chat.debug.hideElements",when:"false"},{command:"github.copilot.chat.debug.showTools",when:"false"},{command:"github.copilot.chat.debug.hideTools",when:"false"},{command:"github.copilot.chat.debug.showNesRequests",when:"false"},{command:"github.copilot.chat.debug.hideNesRequests",when:"false"},{command:"github.copilot.chat.debug.showGhostRequests",when:"false"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"false"},{command:"github.copilot.chat.debug.exportLogItem",when:"false"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"false"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"false"},{command:"github.copilot.chat.mcp.setup.check",when:"false"},{command:"github.copilot.chat.mcp.setup.validatePackage",when:"false"},{command:"github.copilot.chat.mcp.setup.flow",when:"false"},{command:"github.copilot.chat.debug.showRawRequestBody",when:"false"},{command:"github.copilot.debug.showOutputChannel",when:"false"},{command:"github.copilot.cli.sessions.delete",when:"false"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.rename",when:"false"},{command:"github.copilot.claude.sessions.rename",when:"false"},{command:"github.copilot.cli.sessions.setTitle",when:"false"},{command:"github.copilot.cli.sessions.openRepository",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"false"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"false"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"false"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"false"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"false"},{command:"github.copilot.cloud.sessions.installPRExtension",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"false"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges.apply",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.merge",when:"false"},{command:"github.copilot.chat.mergeCopilotCLIAgentSessionChanges.mergeAndSync",when:"false"},{command:"github.copilot.chat.createPullRequestCopilotCLIAgentSession.createPR",when:"false"},{command:"github.copilot.chat.createDraftPullRequestCopilotCLIAgentSession.createDraftPR",when:"false"},{command:"github.copilot.chat.checkoutPullRequestReroute",when:"false"},{command:"github.copilot.chat.cloudSessions.openRepository",when:"false"},{command:"github.copilot.nes.captureExpected.start",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.nes.captureExpected.submit",when:"github.copilot.inlineEditsEnabled"},{command:"github.copilot.sessions.commit",when:"false"},{command:"github.copilot.sessions.commitAndSync",when:"false"},{command:"github.copilot.sessions.sync",when:"false"},{command:"github.copilot.sessions.discardChanges",when:"false"},{command:"github.copilot.sessions.refreshChanges",when:"false"},{command:"github.copilot.sessions.initializeRepository",when:"false"},{command:"github.copilot.claude.sessions.commit",when:"false"},{command:"github.copilot.claude.sessions.commitAndSync",when:"false"},{command:"github.copilot.claude.sessions.sync",when:"false"},{command:"github.copilot.claude.sessions.initializeRepository",when:"false"}],"view/title":[{submenu:"github.copilot.chat.debug.filter",when:"view == copilot-chat",group:"navigation"},{command:"github.copilot.chat.debug.exportAllPromptLogsAsJson",when:"view == copilot-chat",group:"export@1"},{command:"workbench.action.chat.openAgentDebugPanel",when:"view == copilot-chat",group:"3_show@0"},{command:"github.copilot.debug.showOutputChannel",when:"view == copilot-chat",group:"3_show@1"},{command:"github.copilot.debug.showChatLogView",when:"view == workbench.panel.chat.view.copilot",group:"3_show"}],"view/item/context":[{command:"github.copilot.chat.debug.showRawRequestBody",when:"view == copilot-chat && viewItem == request",group:"export@0"},{command:"github.copilot.chat.debug.exportLogItem",when:"view == copilot-chat && (viewItem == toolcall || viewItem == request)",group:"export@1"},{command:"github.copilot.chat.debug.exportPromptArchive",when:"view == copilot-chat && viewItem == chatprompt",group:"export@2"},{command:"github.copilot.chat.debug.exportPromptLogsAsJson",when:"view == copilot-chat && viewItem == chatprompt",group:"export@3"}],"searchPanel/aiResults/commands":[{command:"github.copilot.search.markHelpful",group:"inline@0",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.markUnhelpful",group:"inline@1",when:"aiResultsTitle && aiResultsRequested"},{command:"github.copilot.search.feedback",group:"inline@2",when:"aiResultsTitle && aiResultsRequested && github.copilot.debugReportFeedback"}],"comments/comment/title":[{command:"github.copilot.chat.review.markHelpful",group:"inline@0",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.markUnhelpful",group:"inline@1",when:"commentController == github-copilot-review"}],"commentsView/commentThread/context":[{command:"github.copilot.chat.review.apply",group:"context@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"context@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"context@3",when:"commentController == github-copilot-review"}],"comments/commentThread/additionalActions":[{submenu:"copilot/reviewComment/additionalActions/applyAndNext",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"chatSessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled",canDelegate:!0,requiresCustomModels:!0,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@keyv/sqlite":"^4.0.5","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@vitest/coverage-v8":"^3.2.4","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.27.2",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",keyv:"^5.3.2",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.58.2",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.11","ts-dedent":"^2.2.0",tsx:"^4.20.3",typescript:"^5.8.3","vite-plugin-top-level-await":"^1.5.0","vite-plugin-wasm":"^3.5.0",vitest:"^3.0.5","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"1.0.49","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",dompurify:"^3.4.1",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.1.1",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{"@aminya/node-gyp-build":"npm:node-gyp-build@4.8.1",string_decoder:"npm:string_decoder@1.2.0","node-gyp":"npm:node-gyp@10.3.1",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"}}});var wMe=I(Mb=>{"use strict";p();Object.defineProperty(Mb,"__esModule",{value:!0});Mb.vscodeEngineVersion=Mb.isPreRelease=Mb.isProduction=Mb.packageJson=void 0;Mb.packageJson=DCi();Mb.isProduction=Mb.packageJson.buildType!=="dev";Mb.isPreRelease=Mb.packageJson.isPreRelease||!Mb.isProduction;Mb.vscodeEngineVersion=Mb.packageJson.engines.vscode});var a4=I(Ob=>{"use strict";p();Object.defineProperty(Ob,"__esModule",{value:!0});Ob.isScenarioAutomation=Ob.AbstractEnvService=Ob.INativeEnvService=Ob.IEnvService=Ob.NameAndVersion=Ob.OperatingSystem=void 0;var MCi=rn(),OCi=QIe(),X0e=wMe(),NCi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(NCi||(Ob.OperatingSystem=NCi={}));var vyr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};Ob.NameAndVersion=vyr;Ob.IEnvService=(0,MCi.createServiceIdentifier)("IEnvService");Ob.INativeEnvService=(0,MCi.createServiceIdentifier)("INativeEnvService");var byr=class{static{a(this,"AbstractEnvService")}isProduction(){return X0e.isProduction}isPreRelease(){return X0e.isPreRelease}isSimulation(){return OCi.env.SIMULATION==="1"}getBuildType(){return X0e.packageJson.buildType}getVersion(){return X0e.packageJson.version}getBuild(){return X0e.packageJson.build}getName(){return X0e.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};Ob.AbstractEnvService=byr;Ob.isScenarioAutomation=OCi.env.IS_SCENARIO_AUTOMATION==="1"});var um=I(Aee=>{"use strict";p();Object.defineProperty(Aee,"__esModule",{value:!0});Aee.generateUuid=void 0;Aee.isUUID=W1a;Aee.prefixedUuid=z1a;var V1a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function W1a(t){return V1a.test(t)}a(W1a,"isUUID");Aee.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function z1a(t){return`${t}-${(0,Aee.generateUuid)()}`}a(z1a,"prefixedUuid")});var BCi=I(xht=>{"use strict";p();Object.defineProperty(xht,"__esModule",{value:!0});xht.CopilotConfigPrefix=void 0;xht.CopilotConfigPrefix="github.copilot"});var Tyr=I(M2=>{"use strict";p();var Y1a=M2&&M2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),K1a=M2&&M2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),J1a=M2&&M2.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(X1a,"transformEvent")});var vE=I(fn=>{"use strict";p();Object.defineProperty(fn,"__esModule",{value:!0});fn.apiVersion=fn.ICompletionsEditorAndPluginInfo=fn.BuildInfo=fn.InMemoryConfigProvider=fn.DefaultsOnlyConfigProvider=fn.ConfigProvider=fn.ICompletionsConfigProvider=fn.BuildType=fn.BlockMode=fn.ConfigKey=fn.packageJson=void 0;fn.shouldDoServerTrimming=rSa;fn.getConfigKeyRecursively=nSa;fn.getConfigDefaultForKey=FCi;fn.getOptionalConfigDefaultForKey=UCi;fn.getConfig=iSa;fn.dumpForTelemetry=oSa;fn.formatNameAndVersion=Ryr;fn.editorVersionHeaders=sSa;var wht=wMe();Object.defineProperty(fn,"packageJson",{enumerable:!0,get:a(function(){return wht.packageJson},"get")});var LCi=rn(),eSa=BCi(),tSa=Tyr();fn.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};var Rht;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Rht||(fn.BlockMode=Rht={}));function rSa(t){return[Rht.Server,Rht.ParsingAndServer].includes(t)}a(rSa,"shouldDoServerTrimming");var yee;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(yee||(fn.BuildType=yee={}));fn.ICompletionsConfigProvider=(0,LCi.createServiceIdentifier)("ICompletionsConfigProvider");var RMe=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};fn.ConfigProvider=RMe;var Iyr=class extends RMe{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return FCi(e)}getOptionalConfig(e){return UCi(e)}dumpForTelemetry(){return{}}};fn.DefaultsOnlyConfigProvider=Iyr;var xyr=class extends RMe{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new tSa.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[fn.ConfigKey.ShowEditorCompletions,fn.ConfigKey.EnableAutoCompletions,fn.ConfigKey.DelayCompletions,fn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};fn.InMemoryConfigProvider=xyr;function nSa(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(nSa,"getConfigKeyRecursively");function FCi(t){if(wyr.has(t))return wyr.get(t);throw new Error(`Missing config default value: ${eSa.CopilotConfigPrefix}.${t}`)}a(FCi,"getConfigDefaultForKey");function UCi(t){return wyr.get(t)}a(UCi,"getOptionalConfigDefaultForKey");var wyr=new Map([[fn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[fn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[fn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[fn.ConfigKey.RelatedFilesVSCode,!1],[fn.ConfigKey.IncludeNeighboringFiles,!1],[fn.ConfigKey.ExcludeRelatedFiles,!1],[fn.ConfigKey.ContextProviders,[]],[fn.ConfigKey.DebugSnippyOverrideUrl,""],[fn.ConfigKey.UseSubsetMatching,null],[fn.ConfigKey.ContextProviderTimeBudget,void 0],[fn.ConfigKey.DebugOverrideCapiUrl,""],[fn.ConfigKey.DebugTestOverrideCapiUrl,""],[fn.ConfigKey.DebugOverrideProxyUrl,""],[fn.ConfigKey.DebugTestOverrideProxyUrl,""],[fn.ConfigKey.DebugOverrideEngine,""],[fn.ConfigKey.AlwaysRequestMultiline,void 0],[fn.ConfigKey.CompletionsDebounce,void 0],[fn.ConfigKey.CompletionsDelay,void 0],[fn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[fn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[fn.ConfigKey.ShowEditorCompletions,void 0],[fn.ConfigKey.EnableAutoCompletions,void 0],[fn.ConfigKey.DelayCompletions,void 0],[fn.ConfigKey.FilterCompletions,void 0],[fn.ConfigKey.UseSplitContextPrompt,!0],[fn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[fn.ConfigKey.UserSelectedCompletionModel,""],[fn.ConfigKey.DebugOverrideEngineLegacy,""],[fn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[fn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[fn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[fn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[fn.ConfigKey.DebugFilterLogCategories,[]]]);function iSa(t,e){return t.get(fn.ICompletionsConfigProvider).getConfig(e)}a(iSa,"getConfig");function oSa(t){try{return t.get(fn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(oSa,"dumpForTelemetry");var kht=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===yee.NIGHTLY}static isProduction(){return this.getBuildType()!==yee.DEV}static getBuildType(){return wht.packageJson.buildType==="prod"?t.getVersion().length===15?yee.NIGHTLY:yee.PROD:yee.DEV}static getVersion(){return wht.packageJson.version}static getBuild(){return wht.packageJson.build}};fn.BuildInfo=kht;function Ryr({name:t,version:e}){return`${t}/${e}`}a(Ryr,"formatNameAndVersion");fn.ICompletionsEditorAndPluginInfo=(0,LCi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");fn.apiVersion="2025-05-01";function sSa(t){let e=t.get(fn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Ryr(e.getEditorInfo()),"Editor-Plugin-Version":Ryr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":kht.getVersion()}}a(sSa,"editorVersionHeaders")});var kyr=I(Pht=>{"use strict";p();Object.defineProperty(Pht,"__esModule",{value:!0});Pht.ExpServiceTelemetryNames=void 0;var QCi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(QCi||(Pht.ExpServiceTelemetryNames=QCi={}))});var Dht=I(eme=>{"use strict";p();Object.defineProperty(eme,"__esModule",{value:!0});eme.ExpConfig=eme.ExpTreatmentVariables=void 0;var aSa=Tg(),cSa=kyr(),qCi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(qCi||(eme.ExpTreatmentVariables=qCi={}));var Pyr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,aSa.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[cSa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};eme.ExpConfig=Pyr});var VA=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.ICompletionsFeaturesService=void 0;var lSa=rn();Nht.ICompletionsFeaturesService=(0,lSa.createServiceIdentifier)("ICompletionsFeaturesService")});var Mht=I(YH=>{"use strict";p();Object.defineProperty(YH,"__esModule",{value:!0});YH.FilterSettings=YH.Release=YH.Filter=void 0;var Eee;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(Eee||(YH.Filter=Eee={}));var jCi;(function(t){t.Stable="stable",t.Nightly="nightly"})(jCi||(YH.Release=jCi={}));var uSa={[Eee.CopilotClientTimeBucket]:"timeBucket",[Eee.CopilotOverrideEngine]:"engine",[Eee.CopilotRepository]:"repo",[Eee.CopilotFileType]:"fileType",[Eee.CopilotUserKind]:"userKind"},Dyr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=uSa[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};YH.FilterSettings=Dyr});var KH=I(dm=>{"use strict";p();Object.defineProperty(dm,"__esModule",{value:!0});dm.vString=fSa;dm.vNumber=hSa;dm.vBoolean=gSa;dm.vObjAny=ySa;dm.vUndefined=_Sa;dm.vNull=CSa;dm.vNullable=vSa;dm.vUnchecked=GCi;dm.vUnknown=bSa;dm.vRequired=SSa;dm.vObj=TSa;dm.vArray=ISa;dm.vTuple=xSa;dm.vUnion=$Ci;dm.vEnum=wSa;dm.vLiteral=RSa;dm.vLazy=kSa;var _ee=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},dSa=new _ee("string");function fSa(){return dSa}a(fSa,"vString");var pSa=new _ee("number");function hSa(){return pSa}a(hSa,"vNumber");var mSa=new _ee("boolean");function gSa(){return mSa}a(gSa,"vBoolean");var ASa=new _ee("object");function ySa(){return ASa}a(ySa,"vObjAny");var ESa=new _ee("undefined");function _Sa(){return ESa}a(_Sa,"vUndefined");var Nyr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},HCi=new Nyr;function CSa(){return HCi}a(CSa,"vNull");function vSa(t){return $Ci(t,HCi)}a(vSa,"vNullable");function GCi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(GCi,"vUnchecked");function bSa(){return GCi()}a(bSa,"vUnknown");function SSa(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(SSa,"vRequired");function TSa(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a(TSa,"vObj");function ISa(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(xSa,"vTuple");function $Ci(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a($Ci,"vUnion");function wSa(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(wSa,"vEnum");function RSa(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(RSa,"vLiteral");function kSa(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(kSa,"vLazy")});var Myr=I(kMe=>{"use strict";p();Object.defineProperty(kMe,"__esModule",{value:!0});kMe.ImportChanges=void 0;var PSa=KH(),Oht;(function(t){t.All="all",t.None="none"})(Oht||(kMe.ImportChanges=Oht={}));(function(t){t.VALIDATOR=(0,PSa.vEnum)(t.All,t.None)})(Oht||(kMe.ImportChanges=Oht={}))});var zCi=I(tme=>{"use strict";p();Object.defineProperty(tme,"__esModule",{value:!0});tme.JointCompletionsProviderTriggerChangeStrategy=tme.JointCompletionsProviderStrategy=void 0;var VCi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(VCi||(tme.JointCompletionsProviderStrategy=VCi={}));var WCi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(WCi||(tme.JointCompletionsProviderTriggerChangeStrategy=WCi={}))});var YCi=I(PMe=>{"use strict";p();Object.defineProperty(PMe,"__esModule",{value:!0});PMe.DocumentSwitchTriggerStrategy=void 0;var DSa=KH(),Bht;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(Bht||(PMe.DocumentSwitchTriggerStrategy=Bht={}));(function(t){t.VALIDATOR=(0,DSa.vEnum)(t.Always,t.AfterAcceptance)})(Bht||(PMe.DocumentSwitchTriggerStrategy=Bht={}))});var Oyr=I(DMe=>{"use strict";p();Object.defineProperty(DMe,"__esModule",{value:!0});DMe.DiffHistoryMergeStrategy=void 0;var NSa=KH(),Lht;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(Lht||(DMe.DiffHistoryMergeStrategy=Lht={}));(function(t){t.VALIDATOR=(0,NSa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(Lht||(DMe.DiffHistoryMergeStrategy=Lht={}))});var WA=I(En=>{"use strict";p();Object.defineProperty(En,"__esModule",{value:!0});En.SpeculativeRequestsAutoExpandEditWindowLines=En.SpeculativeRequestsCursorPlacement=En.DuplicateAdditionsMode=En.SpeculativeRequestsEnablement=En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=En.MODEL_CONFIGURATION_VALIDATOR=En.LINT_OPTIONS_VALIDATOR=En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=En.DEFAULT_OPTIONS=En.ResponseFormat=En.PromptingStrategy=En.EditIntent=En.EarlyDivergenceCancellationMode=En.AggressivenessLevel=En.AggressivenessSetting=En.LintOptionShowCode=En.LintOptionWarning=En.CurrentFileOptions=En.GlobalBudgetOptions=En.NeighborFilesOptions=En.RecentlyViewedDocumentsOptions=En.RecentFileClippingStrategy=En.IncludeLineNumbersOption=void 0;En.isPromptingStrategy=MSa;En.isAggressivenessStrategy=OSa;En.applyStrategyConfig=LSa;En.parseLintOptionString=FSa;En.parseUserHappinessScoreConfigurationString=USa;var XCi=Yu(),xn=KH(),Bb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(Bb||(En.IncludeLineNumbersOption=Bb={}));var Cee;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(Cee||(En.RecentFileClippingStrategy=Cee={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.AroundEditRange,t.Proportional)})(Cee||(En.RecentFileClippingStrategy=Cee={}));var Byr;(function(t){t.VALIDATOR=(0,xn.vObj)({nDocuments:(0,xn.vNumber)(),maxTokens:(0,xn.vNumber)(),includeViewedFiles:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(Bb.WithSpaceAfter,Bb.WithoutSpace,Bb.None),clippingStrategy:(0,xn.vEnum)(Cee.AroundEditRange,Cee.Proportional)})})(Byr||(En.RecentlyViewedDocumentsOptions=Byr={}));var KCi;(function(t){t.VALIDATOR=(0,xn.vObj)({enabled:(0,xn.vBoolean)(),maxTokens:(0,xn.vNumber)()})})(KCi||(En.NeighborFilesOptions=KCi={}));var JCi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(JCi||(En.GlobalBudgetOptions=JCi={}));var Lyr;(function(t){t.VALIDATOR=(0,xn.vObj)({maxTokens:(0,xn.vNumber)(),includeTags:(0,xn.vBoolean)(),includeLineNumbers:(0,xn.vEnum)(Bb.WithSpaceAfter,Bb.WithoutSpace,Bb.None),includeCursorTag:(0,xn.vBoolean)(),prioritizeAboveCursor:(0,xn.vBoolean)()})})(Lyr||(En.CurrentFileOptions=Lyr={}));var rme;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(rme||(En.LintOptionWarning=rme={}));var nme;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(nme||(En.LintOptionShowCode=nme={}));var Fht;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(Fht||(En.AggressivenessSetting=Fht={}));var JH;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(JH||(En.AggressivenessLevel=JH={}));var Uht;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(Uht||(En.EarlyDivergenceCancellationMode=Uht={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Cursor,t.EditWindow,t.Off)})(Uht||(En.EarlyDivergenceCancellationMode=Uht={}));(function(t){t.VALIDATOR=(0,xn.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return JH.Low;case t.Medium:return JH.Medium;case t.High:return JH.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(Fht||(En.AggressivenessSetting=Fht={}));var Qht;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(Qht||(En.EditIntent=Qht={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===JH.Medium||s===JH.High;case t.Low:return s===JH.High;default:(0,XCi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(Qht||(En.EditIntent=Qht={}));var Tl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(Tl||(En.PromptingStrategy=Tl={}));function MSa(t){return Object.values(Tl).includes(t)}a(MSa,"isPromptingStrategy");function OSa(t){return t===Tl.XtabAggressiveness||t===Tl.Xtab275Aggressiveness||t===Tl.Xtab275AggressivenessHighLow||t===Tl.Xtab275EditIntent||t===Tl.Xtab275EditIntentShort}a(OSa,"isAggressivenessStrategy");var qht;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(qht||(En.ResponseFormat=qht={}));(function(t){function e(r){switch(r){case Tl.UnifiedModel:case Tl.Codexv21NesUnified:case Tl.Nes41Miniv3:return t.UnifiedWithXml;case Tl.Xtab275:case Tl.XtabAggressiveness:case Tl.Xtab275Aggressiveness:case Tl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case Tl.PatchBased:case Tl.PatchBased01:case Tl.PatchBased02:case Tl.PatchBased02WithRecentLineNumbers:case Tl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case Tl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case Tl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case Tl.SimplifiedSystemPrompt:case Tl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,XCi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(qht||(En.ResponseFormat=qht={}));En.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:2e3,includeTags:!0,includeLineNumbers:Bb.None,includeCursorTag:!1,prioritizeAboveCursor:!1},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:Bb.None,clippingStrategy:Cee.AroundEditRange},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:nme.YES_WITH_SURROUNDING,tagName:"linter",warnings:rme.YES_IF_NO_ERRORS,nRecentFiles:0};En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var BSa={[Tl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[Tl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Bb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Bb.WithoutSpace},supportsNextCursorLinePrediction:!1},[Tl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Bb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Bb.None},supportsNextCursorLinePrediction:!1}};function LSa(t){let e=t.promptingStrategy===void 0?void 0:BSa[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(LSa,"applyStrategyConfig");En.LINT_OPTIONS_VALIDATOR=(0,xn.vObj)({tagName:(0,xn.vString)(),warnings:(0,xn.vEnum)(rme.YES,rme.NO,rme.YES_IF_NO_ERRORS),showCode:(0,xn.vEnum)(nme.NO,nme.YES,nme.YES_WITH_SURROUNDING),maxLints:(0,xn.vNumber)(),maxLineDistance:(0,xn.vNumber)(),nRecentFiles:(0,xn.vNumber)()});En.MODEL_CONFIGURATION_VALIDATOR=(0,xn.vObj)({modelName:(0,xn.vRequired)((0,xn.vString)()),promptingStrategy:(0,xn.vUnion)((0,xn.vEnum)(...Object.values(Tl)),(0,xn.vUndefined)()),includeTagsInCurrentFile:(0,xn.vRequired)((0,xn.vBoolean)()),includePostScript:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)()),currentFile:(0,xn.vUnion)(Lyr.VALIDATOR,(0,xn.vUndefined)()),recentlyViewedDocuments:(0,xn.vUnion)(Byr.VALIDATOR,(0,xn.vUndefined)()),lintOptions:(0,xn.vUnion)(En.LINT_OPTIONS_VALIDATOR,(0,xn.vUndefined)()),supportsNextCursorLinePrediction:(0,xn.vUnion)((0,xn.vBoolean)(),(0,xn.vUndefined)())});function FSa(t,e){try{let r=JSON.parse(t),n=En.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(FSa,"parseLintOptionString");En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var ZCi=(0,xn.vObj)({acceptedScore:(0,xn.vRequired)((0,xn.vNumber)()),rejectedScore:(0,xn.vRequired)((0,xn.vNumber)()),ignoredScore:(0,xn.vRequired)((0,xn.vNumber)()),highThreshold:(0,xn.vRequired)((0,xn.vNumber)()),mediumThreshold:(0,xn.vRequired)((0,xn.vNumber)()),includeIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),ignoredLimit:(0,xn.vRequired)((0,xn.vNumber)()),limitConsecutiveIgnored:(0,xn.vRequired)((0,xn.vBoolean)()),limitTotalIgnored:(0,xn.vRequired)((0,xn.vBoolean)())});function NMe(t,e,r){return t>=e&&t<=r}a(NMe,"isInRange");En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=ZCi.validate(t);if(e.error)return e;let r=e.content;return NMe(r.acceptedScore,0,1)?NMe(r.rejectedScore,0,1)?NMe(r.ignoredScore,0,1)?NMe(r.highThreshold,0,1)?NMe(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(ime,"__esModule",{value:!0});ime.TextReplacement=ime.TextEdit=void 0;var evi=El(),tvi=Yu(),zht=Ts(),Vht=Gh(),ZH=I_(),l0=qp(),Yht=Zpe(),rvi=CT(),Kht=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>lC.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new lC(e,r)])}static delete(e){return new t([new lC(e,"")])}static insert(e,r){return new t([new lC(l0.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,evi.compareBy)(n=>n.range,l0.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,tvi.assertFn)(()=>(0,tvi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new lC(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=Yht.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new ZH.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Wht(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new ZH.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof ZH.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof ZH.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Wht(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new ZH.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Wht(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Wht(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new rvi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new lC(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Yht.TextLength.ofText(s.text),l=ZH.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new zht.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` -`):typeof e=="string"?this.toString(new rvi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=l0.Range.fromPositions(new ZH.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=l0.Range.fromPositions(r.range.getEndPosition(),new ZH.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` -`)}};ime.TextEdit=Kht;var lC=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new zht.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c 1"},{command:"github.copilot.chat.review.apply",group:"inline@1",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"},{submenu:"copilot/reviewComment/additionalActions/discardAndNext",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments > 1"},{submenu:"copilot/reviewComment/additionalActions/discard",group:"inline@2",when:"commentController == github-copilot-review && github.copilot.chat.review.numberOfComments == 1"}],"copilot/reviewComment/additionalActions/applyAndNext":[{command:"github.copilot.chat.review.applyAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.apply",group:"inline@2",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discardAndNext":[{command:"github.copilot.chat.review.discardAndNext",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"copilot/reviewComment/additionalActions/discard":[{command:"github.copilot.chat.review.discard",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInInlineChat",group:"inline@3",when:"commentController == github-copilot-review"}],"comments/commentThread/title":[{command:"github.copilot.chat.review.previous",group:"inline@1",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.next",group:"inline@2",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.continueInChat",group:"inline@3",when:"commentController == github-copilot-review"},{command:"github.copilot.chat.review.discardAll",group:"inline@4",when:"commentController == github-copilot-review"}],"scm/title":[{command:"github.copilot.chat.review.changes",group:"navigation",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmProviderRootUri in github.copilot.chat.reviewDiff.enabledRootUris"}],"scm/sourceControl":[{command:"github.copilot.cli.openInCopilotCLI",group:"3_worktree@1",when:"scmProvider == git"}],"scm/resourceGroup/context":[{command:"github.copilot.chat.review.stagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index",group:"inline@-3"},{command:"github.copilot.chat.review.unstagedChanges",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree",group:"inline@-3"}],"scm/resourceState/context":[{command:"github.copilot.git.resolveMergeConflicts",when:"scmProvider == git && scmResourceGroup == merge && git.activeResourceHasMergeConflicts",group:"z_chat@1"},{command:"github.copilot.chat.review.stagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == index"},{command:"github.copilot.chat.review.unstagedFileChange",group:"3_copilot",when:"config.github.copilot.chat.reviewAgent.enabled && github.copilot.chat.reviewDiff.enabled && scmProvider == git && scmResourceGroup == workingTree"}],"scm/inputBox":[{command:"github.copilot.git.generateCommitMessage",when:"scmProvider == git && chatSetupCompleted"}],"testing/message/context":[{command:"github.copilot.tests.fixTestFailure",when:"testing.testItemHasUri",group:"inline@1"}],"issue/reporter":[{command:"github.copilot.report"}],"github.copilot.chat.debug.filter":[{command:"github.copilot.chat.debug.showElements",when:"github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.hideElements",when:"!github.copilot.chat.debug.elementsHidden",group:"commands@0"},{command:"github.copilot.chat.debug.showTools",when:"github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.hideTools",when:"!github.copilot.chat.debug.toolsHidden",group:"commands@1"},{command:"github.copilot.chat.debug.showNesRequests",when:"github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.hideNesRequests",when:"!github.copilot.chat.debug.nesRequestsHidden",group:"commands@2"},{command:"github.copilot.chat.debug.showGhostRequests",when:"github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"},{command:"github.copilot.chat.debug.hideGhostRequests",when:"!github.copilot.chat.debug.ghostRequestsHidden",group:"commands@3"}],"notebook/toolbar":[{command:"github.copilot.chat.notebook.enableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && !github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"},{command:"github.copilot.chat.notebook.disableFollowCellExecution",when:"config.github.copilot.chat.notebook.followCellExecution.enabled && github.copilot.notebookFollowInSessionEnabled && github.copilot.notebookAgentModeUsage && config.notebook.globalToolbar",group:"navigation/execute@15"}],"editor/content":[{command:"github.copilot.git.resolveMergeConflicts",group:"z_chat@1",when:"config.git.enabled && !git.missing && !isInDiffEditor && !isMergeEditor && resource in git.mergeChanges && git.activeResourceHasMergeConflicts && chatSetupCompleted"}],"multiDiffEditor/content":[{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"resourceScheme == copilotcli-worktree-changes && workbenchState != empty && !isSessionsWindow"}],"chat/chatSessions":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.delete",when:"chatSessionType == copilotcli",group:"1_edit@10"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"},{command:"github.copilot.cli.sessions.openWorktreeInNewWindow",when:"chatSessionType == copilotcli && !isSessionsWindow",group:"2_open@1"},{command:"github.copilot.cli.sessions.openWorktreeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@2"},{command:"github.copilot.cli.sessions.copyWorktreeBranchName",when:"chatSessionType == copilotcli",group:"2_open@3"},{command:"github.copilot.cli.sessions.resumeInTerminal",when:"chatSessionType == copilotcli",group:"2_open@4"},{command:"github.copilot.chat.applyCopilotCLIAgentSessionChanges",when:"chatSessionType == copilotcli && workbenchState != empty && !isSessionsWindow",group:"3_apply@0"},{command:"github.copilot.cloud.sessions.openInBrowser",when:"chatSessionType == copilot-cloud-agent",group:"navigation@10"},{command:"github.copilot.cloud.sessions.proxy.closeChatSessionPullRequest",when:"chatSessionType == copilot-cloud-agent",group:"1_edit@10"}],"chatSessions/item/context":[{command:"github.copilot.claude.sessions.rename",when:"chatSessionType == claude-code",group:"1_edit@4"},{command:"github.copilot.cli.sessions.rename",when:"chatSessionType == copilotcli",group:"1_edit@4"}],"chat/multiDiff/context":[{command:"github.copilot.cloud.sessions.installPRExtension",when:"chatSessionType == copilot-cloud-agent && !github.copilot.prExtensionInstalled",group:"inline@1"}],"chat/input/editing/sessionTitleToolbar":[{command:"github.copilot.sessions.refreshChanges",when:"chatSessionType == copilotcli && isSessionsWindow && !sessions.isAgentHostSession",group:"9_refresh@1"}],"chat/customizations/create":[{command:"copilot.claude.agents",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == agents",group:"navigation@1"},{command:"copilot.claude.hooks",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == hooks",group:"navigation@1"},{command:"copilot.claude.memory",when:"chatCustomizationSessionType == claude-code && chatCustomizationSection == instructions",group:"navigation@1"}]},icons:{"copilot-logo":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0041"}},"copilot-warning":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0042"}},"copilot-notconnected":{description:"%github.copilot.icon%",default:{fontPath:"assets/copilot.woff",fontCharacter:"\\0043"}}},iconFonts:[{id:"copilot-font",src:[{path:"assets/copilot.woff",format:"woff"}]}],terminalQuickFixes:[{id:"copilot-chat.fixWithCopilot",commandLineMatcher:".+",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0},kind:"explain"},{id:"copilot-chat.generateCommitMessage",commandLineMatcher:"git add .+",commandExitResult:"success",kind:"explain",outputMatcher:{anchor:"bottom",length:1,lineMatcher:".+",offset:0}},{id:"copilot-chat.terminalToDebugging",commandLineMatcher:".+",kind:"explain",commandExitResult:"error",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}},{id:"copilot-chat.terminalToDebuggingSuccess",commandLineMatcher:".+",kind:"explain",commandExitResult:"success",outputMatcher:{anchor:"bottom",length:1,lineMatcher:"",offset:0}}],languages:[{id:"ignore",filenamePatterns:[".copilotignore"],aliases:[]},{id:"markdown",extensions:[".copilotmd"]}],views:{"copilot-chat":[{id:"copilot-chat",name:"Chat Debug",icon:"assets/debug-icon.svg",when:"github.copilot.chat.showLogView"}],"context-inspector":[{id:"context-inspector",name:"Language Context Inspector",icon:"$(inspect)",when:"github.copilot.chat.showContextInspectorView"}]},viewsContainers:{activitybar:[{id:"copilot-chat",title:"Chat Debug",icon:"assets/debug-icon.svg"},{id:"context-inspector",title:"Language Context Inspector",icon:"$(inspect)"}]},configurationDefaults:{"workbench.editorAssociations":{"*.copilotmd":"vscode.markdown.preview.editor"}},keybindings:[{command:"github.copilot.chat.copilotCLI.addFileReference",key:"ctrl+shift+.",mac:"cmd+shift+.",when:"github.copilot.chat.copilotCLI.hasSession && editorTextFocus"},{command:"github.copilot.chat.rerunWithCopilotDebug",key:"ctrl+alt+.",mac:"cmd+alt+.",when:"github.copilot-chat.activated && terminalShellIntegrationEnabled && terminalFocus && !terminalAltBufferActive"},{command:"github.copilot.nes.captureExpected.confirm",key:"ctrl+enter",mac:"cmd+enter",when:"copilotNesCaptureMode && editorTextFocus"},{command:"github.copilot.nes.captureExpected.abort",key:"escape",when:"copilotNesCaptureMode && editorTextFocus"}],walkthroughs:[{id:"copilotWelcome",title:"%github.copilot.walkthrough.title%",description:"%github.copilot.walkthrough.description%",when:"!isWeb",steps:[{id:"copilot.setup.signIn",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.signIn.description%",when:"chatEntitlementSignedOut && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signInNoAction",title:"%github.copilot.walkthrough.setup.signIn.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatEntitlementSignedOut && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && !github.copilot.interactiveSession.individual.disabled && !github.copilot.interactiveSession.individual.expired && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUp",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.signUp.description%",when:"chatPlanCanSignUp && !view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.setup.signUpNoAction",title:"%github.copilot.walkthrough.setup.signUp.title%",description:"%github.copilot.walkthrough.setup.noAction.description%",when:"chatPlanCanSignUp && view.workbench.panel.chat.view.copilot.visible && !github.copilot-chat.activated && !github.copilot.offline && (github.copilot.interactiveSession.individual.disabled || github.copilot.interactiveSession.individual.expired) && !github.copilot.interactiveSession.enterprise.disabled && !github.copilot.interactiveSession.contactSupport && !github.copilot.interactiveSession.invalidToken && !github.copilot.interactiveSession.rateLimited && !github.copilot.interactiveSession.gitHubLoginFailed",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.panelChat",title:"%github.copilot.walkthrough.panelChat.title%",description:"%github.copilot.walkthrough.panelChat.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/workspace-hclight.mp4"},altText:"%github.copilot.walkthrough.panelChat.media.altText%"}},{id:"copilot.edits",title:"%github.copilot.walkthrough.edits.title%",description:"%github.copilot.walkthrough.edits.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/edits-hclight.mp4"},altText:"%github.copilot.walkthrough.edits.media.altText%"}},{id:"copilot.firstSuggest",title:"%github.copilot.walkthrough.firstSuggest.title%",description:"%github.copilot.walkthrough.firstSuggest.description%",when:"!chatEntitlementSignedOut || chatIsEnabled ",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/ghost-text-hclight.mp4"},altText:"%github.copilot.walkthrough.firstSuggest.media.altText%"}},{id:"copilot.inlineChatNotMac",title:"%github.copilot.walkthrough.inlineChatNotMac.title%",description:"%github.copilot.walkthrough.inlineChatNotMac.description%",when:"!isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatNotMac.media.altText%"}},{id:"copilot.inlineChatMac",title:"%github.copilot.walkthrough.inlineChatMac.title%",description:"%github.copilot.walkthrough.inlineChatMac.description%",when:"isMac && (!chatEntitlementSignedOut || chatIsEnabled )",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/inline-hclight.mp4"},altText:"%github.copilot.walkthrough.inlineChatMac.media.altText%"}},{id:"copilot.sparkle",title:"%github.copilot.walkthrough.sparkle.title%",description:"%github.copilot.walkthrough.sparkle.description%",when:"!chatEntitlementSignedOut || chatIsEnabled",media:{video:{dark:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit.mp4",light:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-light.mp4",hc:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hc.mp4",hcLight:"https://vscodewalkthroughs.z1.web.core.windows.net/v0.26/git-commit-hclight.mp4"},altText:"%github.copilot.walkthrough.sparkle.media.altText%"}}]}],jsonValidation:[{fileMatch:"settings.json",url:"ccsettings://root/schema.json"}],typescriptServerPlugins:[{name:"@vscode/copilot-typescript-server-plugin",enableForWorkspaceTypeScriptVersions:!0}],chatSessions:[{type:"claude-code",name:"claude",displayName:"Claude",icon:"$(claude)",welcomeTitle:"Claude Agent",welcomeMessage:"Powered by the same agent as Claude Code",inputPlaceholder:"Run local tasks with Claude, type `#` for adding context",order:3,description:"%github.copilot.session.providerDescription.claude%",when:"config.github.copilot.chat.claudeAgent.enabled",canDelegate:!0,requiresCustomModels:!0,capabilities:{supportsFileAttachments:!0,supportsImageAttachments:!0},commands:[{name:"init",description:"Initialize a new CLAUDE.md file with codebase documentation"},{name:"pr-comments",description:"Get comments from a GitHub pull request"},{name:"review",description:"Review a pull request"},{name:"security-review",description:"Complete a security review of the pending changes on the current branch"},{name:"simplify",description:"Review changed code for reuse, quality, and efficiency"},{name:"claude-api",description:"Help building with Claude API or Anthropic SDK"},{name:"agents",description:"Create and manage specialized Claude agents"},{name:"hooks",description:"Configure Claude Code hooks for tool execution and events"},{name:"memory",description:"Open memory files (CLAUDE.md) for editing"},{name:"compact",description:"Compact the conversation history to save context tokens"}]},{type:"copilotcli",name:"cli",displayName:"Copilot CLI",icon:"$(copilot)",welcomeTitle:"Copilot CLI",welcomeMessage:"Run tasks in the background with the Copilot CLI",inputPlaceholder:"Run tasks in the background with the Copilot CLI, type `#` for adding context",order:1,canDelegate:!0,description:"%github.copilot.session.providerDescription.background%",when:"config.github.copilot.chat.backgroundAgent.enabled",capabilities:{supportsFileAttachments:!0,supportsProblemAttachments:!0,supportsToolAttachments:!1,supportsImageAttachments:!0,supportsSymbolAttachments:!0,supportsSearchResultAttachments:!0,supportsSourceControlAttachments:!0,supportsPromptAttachments:!0,supportsHandOffs:!0},commands:[{name:"delegate",description:"Delegate chat session to cloud agent and create associated PR",when:"config.github.copilot.chat.cloudAgent.enabled"},{name:"compact",description:"%github.copilot.command.cli.compact.description%"},{name:"plan",description:"%github.copilot.command.cli.plan.description%",when:"config.github.copilot.chat.cli.planCommand.enabled"},{name:"fleet",description:"%github.copilot.command.cli.fleet.description%",when:"false"},{name:"remote",description:"%github.copilot.command.cli.remote.description%",when:"config.github.copilot.chat.cli.remote.enabled"}],customAgentTarget:"github-copilot",requiresCustomModels:!0,autoAttachReferences:!0,useRequestToPopulateBuiltInPickers:!0},{type:"copilot-cloud-agent",alternativeIds:["copilot-swe-agent"],name:"cloud",displayName:"Cloud",icon:"$(cloud)",welcomeTitle:"Cloud Agent",welcomeMessage:"Delegate tasks to the cloud",inputPlaceholder:"Delegate tasks to the cloud, type `#` for adding context",order:2,canDelegate:!0,description:"%github.copilot.session.providerDescription.cloud%",when:"config.github.copilot.chat.cloudAgent.enabled",capabilities:{supportsFileAttachments:!0},autoAttachReferences:!0}],chatAgents:[],chatPromptFiles:[{path:"./assets/prompts/plan.prompt.md",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-standup.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-cost-tips.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-improve.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-reindex.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]},{path:"./assets/prompts/chronicle-search.prompt.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],chatSkills:[{path:"./assets/prompts/skills/project-setup-info-local/SKILL.md",when:"!config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/project-setup-info-context7/SKILL.md",when:"config.github.copilot.chat.newWorkspace.useContext7",sessionTypes:["local"]},{path:"./assets/prompts/skills/install-vscode-extension/SKILL.md",when:"config.github.copilot.chat.installExtensionSkill.enabled && config.github.copilot.chat.newWorkspaceCreation.enabled",sessionTypes:["local"]},{path:"./assets/prompts/skills/get-search-view-results/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/troubleshoot/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/agent-customization/SKILL.md",sessionTypes:["local","copilotcli"]},{path:"./assets/prompts/skills/init/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-prompt/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-instructions/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-skill/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-agent/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/create-hook/SKILL.md",sessionTypes:["local"]},{path:"./assets/prompts/skills/chronicle/SKILL.md",when:"github.copilot.sessionSearch.enabled",sessionTypes:["local"]}],terminal:{profiles:[{icon:"copilot",id:"copilot-cli",title:"GitHub Copilot CLI",titleTemplate:"${sequence}"}]}},prettier:{useTabs:!0,tabWidth:4,singleQuote:!0},scripts:{postinstall:"tsx ./script/postinstall.ts",build:"node .esbuild.mts --sourcemaps",compile:"node .esbuild.mts --dev",watch:"npm-run-all -lp watch:esbuild watch:typecheck","watch:esbuild":"node .esbuild.mts --watch --dev","watch:typecheck":"npx tsgo --noEmit --watch --preserveWatchOutput --project tsconfig.json","watch:typecheck-extension":"npx tsgo --noEmit --watch --project tsconfig.json","watch:typecheck-extension-web":"npx tsgo --noEmit --watch --project tsconfig.worker.json","watch:typecheck-simulation-workbench":"npx tsgo --noEmit --watch --project test/simulation/workbench/tsconfig.json",typecheck:"npx tsgo --noEmit --project tsconfig.json && npx tsgo --noEmit --project test/simulation/workbench/tsconfig.json && npx tsgo --noEmit --project tsconfig.worker.json && npx tsgo --noEmit --project src/extension/completions-core/vscode-node/extension/src/copilotPanel/webView/tsconfig.json",lint:"npx eslint . --max-warnings=0","lint-staged":"npx eslint --max-warnings=0",tsfmt:"npx tsfmt -r --verify",test:"npm-run-all test:*","test:extension":"vscode-test","test:sanity":"vscode-test --sanity","test:unit":"vitest --run --pool=forks",vitest:"vitest",bench:"vitest bench",get_env:"tsx script/setup/getEnv.mts",get_token:"tsx script/setup/getToken.mts",prettier:"prettier --list-different --write --cache .",simulate:"node dist/simulationMain.js","simulate-require-cache":"node dist/simulationMain.js --require-cache","simulate-ci":"node dist/simulationMain.js --ci --require-cache","simulate-update-baseline":"node dist/simulationMain.js --update-baseline","simulate-gc":"node dist/simulationMain.js --require-cache --gc",setup:"npm run get_env && npm run get_token","setup:dotnet":"run-script-os","setup:dotnet:darwin:linux":"curl -O https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.sh && chmod u+x dotnet-install.sh && ./dotnet-install.sh --channel 10.0 && rm dotnet-install.sh","setup:dotnet:win32":'powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1 -OutFile dotnet-install.ps1; ./dotnet-install.ps1 -channel 10.0; Remove-Item dotnet-install.ps1"',"analyze-edits":"tsx script/analyzeEdits.ts","extract-chat-lib":"tsx script/build/extractChatLib.ts",create_venv:"tsx script/setup/createVenv.mts",package:"vsce package",web:"vscode-test-web --headless --extensionDevelopmentPath=. .","test:prompt":'mocha "src/extension/completions-core/vscode-node/prompt/**/test/**/*.test.{ts,tsx}"',"test:completions-core":"tsx src/extension/completions-core/vscode-node/extension/test/runTest.ts"},devDependencies:{"@azure/identity":"4.9.1","@azure/keyvault-secrets":"^4.10.0","@azure/msal-node":"^3.6.3","@c4312/scip":"^0.1.0","@fluentui/react-components":"^9.66.6","@fluentui/react-icons":"^2.0.305","@hediet/node-reload":"^0.8.0","@keyv/sqlite":"^4.0.5","@octokit/types":"^14.1.0","@stylistic/eslint-plugin":"^3.0.1","@types/eslint":"^9.0.0","@types/express":"^5.0.6","@types/google-protobuf":"^3.15.12","@types/js-yaml":"^4.0.9","@types/markdown-it":"^14.0.0","@types/minimist":"^1.2.5","@types/mocha":"^10.0.10","@types/node":"^22.16.3","@types/picomatch":"^4.0.0","@types/react":"17.0.44","@types/react-dom":"^18.2.17","@types/sinon":"^17.0.4","@types/source-map-support":"^0.5.10","@types/tar":"^6.1.13","@types/vinyl":"^2.0.12","@types/vscode-webview":"^1.57.5","@types/ws":"^8.5.3","@types/yargs":"^17.0.24","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.32.0","@typescript-eslint/typescript-estree":"^8.26.1","@vitest/coverage-v8":"^3.2.4","@vitest/snapshot":"^1.5.0","@vscode/debugadapter":"^1.68.0","@vscode/debugprotocol":"^1.68.0","@vscode/dts":"^0.4.1","@vscode/lsif-language-service":"^0.1.0-pre.4","@vscode/test-cli":"^0.0.11","@vscode/test-electron":"^2.5.2","@vscode/test-web":"^0.0.80","@vscode/vsce":"3.6.0",copyfiles:"^2.4.1","csv-parse":"^6.0.0",dotenv:"^17.2.0",electron:"^39.8.5",esbuild:"0.27.2",fastq:"^1.19.1",glob:"^11.1.0","js-yaml":"^4.1.1",keyv:"^5.3.2",minimist:"^1.2.8",mobx:"^6.13.7","mobx-react-lite":"^4.1.0",mocha:"^11.7.1","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","monaco-editor":"0.44.0","npm-run-all":"^4.1.5",open:"^10.1.2",openai:"^6.7.0",outdent:"^0.8.0",picomatch:"^4.0.4",playwright:"^1.58.2",prettier:"^3.6.2",react:"^17.0.2","react-dom":"17.0.2",rimraf:"^6.0.1","run-script-os":"^1.1.6",shiki:"~1.15.0",sinon:"^21.0.0","source-map-support":"^0.5.21",tar:"^7.5.11","ts-dedent":"^2.2.0",tsx:"^4.20.3",typescript:"^5.8.3","vite-plugin-top-level-await":"^1.5.0","vite-plugin-wasm":"^3.5.0",vitest:"^3.0.5","vscode-languageserver-protocol":"^3.17.5","vscode-languageserver-textdocument":"^1.0.12","vscode-languageserver-types":"^3.17.5",yaml:"^2.8.0",yargs:"^17.7.2",zod:"3.25.76"},dependencies:{"@anthropic-ai/claude-agent-sdk":"0.2.112","@anthropic-ai/sdk":"^0.82.0","@github/blackbird-external-ingest-utils":"^0.3.0","@github/copilot":"1.0.49","@google/genai":"^1.22.0","@humanwhocodes/gitignore-to-minimatch":"1.0.2","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.25.2","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.212.0","@opentelemetry/exporter-logs-otlp-grpc":"^0.214.0","@opentelemetry/exporter-logs-otlp-http":"^0.214.0","@opentelemetry/exporter-metrics-otlp-grpc":"^0.214.0","@opentelemetry/exporter-metrics-otlp-http":"^0.214.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.214.0","@opentelemetry/exporter-trace-otlp-http":"^0.214.0","@opentelemetry/resources":"^2.5.1","@opentelemetry/sdk-logs":"^0.212.0","@opentelemetry/sdk-metrics":"^2.5.1","@opentelemetry/sdk-trace-node":"^2.5.1","@opentelemetry/semantic-conventions":"^1.39.0","@sinclair/typebox":"^0.34.41","@vscode/copilot-api":"^0.4.3","@vscode/extension-telemetry":"^1.5.1","@vscode/l10n":"^0.0.18","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/tree-sitter-wasm":"0.0.5-php.2","@vscode/webview-ui-toolkit":"^1.3.1","@xterm/headless":"^5.5.0",ajv:"^8.18.0",applicationinsights:"^2.9.7","best-effort-json-parser":"^1.2.1",diff:"^8.0.3",dompurify:"^3.4.1",express:"^5.2.1",ignore:"^7.0.5",isbinaryfile:"^5.0.4","jsonc-parser":"^3.3.1","lru-cache":"^11.1.0","markdown-it":"^14.1.1",minimatch:"^10.2.1",undici:"^7.24.1","vscode-tas-client":"^0.1.84","web-tree-sitter":"^0.23.0"},overrides:{"@aminya/node-gyp-build":"npm:node-gyp-build@4.8.1",string_decoder:"npm:string_decoder@1.2.0","node-gyp":"npm:node-gyp@10.3.1",zod:"3.25.76"},vscodeCommit:"94c8e2adc50e26ef70af85a0de3a9efed757acaa",__metadata:{id:"7ec7d6e6-b89e-4cc5-a59b-d6c4d238246f",publisherId:{publisherId:"7c1c19cd-78eb-4dfb-8999-99caf7679002",publisherName:"github",displayName:"GitHub",flags:"verified"},publisherDisplayName:"GitHub"}}});var yMe=I(xb=>{"use strict";p();Object.defineProperty(xb,"__esModule",{value:!0});xb.vscodeEngineVersion=xb.isPreRelease=xb.isProduction=xb.packageJson=void 0;xb.packageJson=lCi();xb.isProduction=xb.packageJson.buildType!=="dev";xb.isPreRelease=xb.packageJson.isPreRelease||!xb.isProduction;xb.vscodeEngineVersion=xb.packageJson.engines.vscode});var r4=I(wb=>{"use strict";p();Object.defineProperty(wb,"__esModule",{value:!0});wb.isScenarioAutomation=wb.AbstractEnvService=wb.INativeEnvService=wb.IEnvService=wb.NameAndVersion=wb.OperatingSystem=void 0;var dCi=tn(),fCi=JSe(),$0e=yMe(),uCi;(function(t){t.Windows="Windows",t.Macintosh="Mac",t.Linux="Linux"})(uCi||(wb.OperatingSystem=uCi={}));var Ryr=class{static{a(this,"NameAndVersion")}constructor(e,r){this.name=e,this.version=r}format(){return`${this.name}/${this.version}`}};wb.NameAndVersion=Ryr;wb.IEnvService=(0,dCi.createServiceIdentifier)("IEnvService");wb.INativeEnvService=(0,dCi.createServiceIdentifier)("INativeEnvService");var Pyr=class{static{a(this,"AbstractEnvService")}isProduction(){return $0e.isProduction}isPreRelease(){return $0e.isPreRelease}isSimulation(){return fCi.env.SIMULATION==="1"}getBuildType(){return $0e.packageJson.buildType}getVersion(){return $0e.packageJson.version}getBuild(){return $0e.packageJson.build}getName(){return $0e.packageJson.name}getEditorVersionHeaders(){return{"Editor-Version":this.getEditorInfo().format(),"Editor-Plugin-Version":this.getEditorPluginInfo().format()}}};wb.AbstractEnvService=Pyr;wb.isScenarioAutomation=fCi.env.IS_SCENARIO_AUTOMATION==="1"});var fm=I(pee=>{"use strict";p();Object.defineProperty(pee,"__esModule",{value:!0});pee.generateUuid=void 0;pee.isUUID=g1a;pee.prefixedUuid=A1a;var m1a=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function g1a(t){return m1a.test(t)}a(g1a,"isUUID");pee.generateUuid=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let t=new Uint8Array(16),e=[];for(let r=0;r<256;r++)e.push(r.toString(16).padStart(2,"0"));return a(function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=0,o="";return o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+="-",o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o+=e[t[n++]],o},"generateUuid")})();function A1a(t){return`${t}-${(0,pee.generateUuid)()}`}a(A1a,"prefixedUuid")});var pCi=I(Rht=>{"use strict";p();Object.defineProperty(Rht,"__esModule",{value:!0});Rht.CopilotConfigPrefix=void 0;Rht.CopilotConfigPrefix="github.copilot"});var Dyr=I(D2=>{"use strict";p();var y1a=D2&&D2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E1a=D2&&D2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_1a=D2&&D2.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(n&&(r=r.bind(n)),t(a(c=>{let l=e(c);l!==void 0&&r(l)},"wrappedListener"),void 0,o))}a(C1a,"transformEvent")});var _E=I(dn=>{"use strict";p();Object.defineProperty(dn,"__esModule",{value:!0});dn.apiVersion=dn.ICompletionsEditorAndPluginInfo=dn.BuildInfo=dn.InMemoryConfigProvider=dn.DefaultsOnlyConfigProvider=dn.ConfigProvider=dn.ICompletionsConfigProvider=dn.BuildType=dn.BlockMode=dn.ConfigKey=dn.packageJson=void 0;dn.shouldDoServerTrimming=T1a;dn.getConfigKeyRecursively=I1a;dn.getConfigDefaultForKey=mCi;dn.getOptionalConfigDefaultForKey=gCi;dn.getConfig=x1a;dn.dumpForTelemetry=w1a;dn.formatNameAndVersion=Byr;dn.editorVersionHeaders=R1a;var Pht=yMe();Object.defineProperty(dn,"packageJson",{enumerable:!0,get:a(function(){return Pht.packageJson},"get")});var hCi=tn(),b1a=pCi(),S1a=Dyr();dn.ConfigKey={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",UseSplitContextPrompt:"internal.useSplitContextPrompt"};var kht;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(kht||(dn.BlockMode=kht={}));function T1a(t){return[kht.Server,kht.ParsingAndServer].includes(t)}a(T1a,"shouldDoServerTrimming");var hee;(function(t){t.DEV="dev",t.PROD="prod",t.NIGHTLY="nightly"})(hee||(dn.BuildType=hee={}));dn.ICompletionsConfigProvider=(0,hCi.createServiceIdentifier)("ICompletionsConfigProvider");var EMe=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}};dn.ConfigProvider=EMe;var Nyr=class extends EMe{static{a(this,"DefaultsOnlyConfigProvider")}constructor(){super(...arguments),this.onDidChangeCopilotSettings=()=>({dispose:a(()=>{},"dispose")})}getConfig(e){return mCi(e)}getOptionalConfig(e){return gCi(e)}dumpForTelemetry(){return{}}};dn.DefaultsOnlyConfigProvider=Nyr;var Myr=class extends EMe{static{a(this,"InMemoryConfigProvider")}constructor(e){super(),this.baseConfigProvider=e,this.copilotEmitter=new S1a.Emitter,this.onDidChangeCopilotSettings=this.copilotEmitter.event,this.overrides=new Map}setOverrides(e){this.overrides=e}clearOverrides(){this.overrides.clear()}getOptionalOverride(e){return this.overrides.get(e)}getConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getConfig(e)}getOptionalConfig(e){return this.getOptionalOverride(e)??this.baseConfigProvider.getOptionalConfig(e)}setConfig(e,r){this.setCopilotSettings({[e]:r})}setCopilotSettings(e){for(let[r,n]of Object.entries(e))n!==void 0?this.overrides.set(r,n):this.overrides.delete(r);this.copilotEmitter.fire(this)}dumpForTelemetry(){let e=this.baseConfigProvider.dumpForTelemetry();for(let r of[dn.ConfigKey.ShowEditorCompletions,dn.ConfigKey.EnableAutoCompletions,dn.ConfigKey.DelayCompletions,dn.ConfigKey.FilterCompletions]){let n=this.overrides.get(r);n!==void 0&&(e[r]=JSON.stringify(n))}return e}};dn.InMemoryConfigProvider=Myr;function I1a(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(I1a,"getConfigKeyRecursively");function mCi(t){if(Oyr.has(t))return Oyr.get(t);throw new Error(`Missing config default value: ${b1a.CopilotConfigPrefix}.${t}`)}a(mCi,"getConfigDefaultForKey");function gCi(t){return Oyr.get(t)}a(gCi,"getOptionalConfigDefaultForKey");var Oyr=new Map([[dn.ConfigKey.DebugOverrideCppHeadersEnableSwitch,!1],[dn.ConfigKey.RelatedFilesVSCodeCSharp,!1],[dn.ConfigKey.RelatedFilesVSCodeTypeScript,!1],[dn.ConfigKey.RelatedFilesVSCode,!1],[dn.ConfigKey.IncludeNeighboringFiles,!1],[dn.ConfigKey.ExcludeRelatedFiles,!1],[dn.ConfigKey.ContextProviders,[]],[dn.ConfigKey.DebugSnippyOverrideUrl,""],[dn.ConfigKey.UseSubsetMatching,null],[dn.ConfigKey.ContextProviderTimeBudget,void 0],[dn.ConfigKey.DebugOverrideCapiUrl,""],[dn.ConfigKey.DebugTestOverrideCapiUrl,""],[dn.ConfigKey.DebugOverrideProxyUrl,""],[dn.ConfigKey.DebugTestOverrideProxyUrl,""],[dn.ConfigKey.DebugOverrideEngine,""],[dn.ConfigKey.AlwaysRequestMultiline,void 0],[dn.ConfigKey.CompletionsDebounce,void 0],[dn.ConfigKey.CompletionsDelay,void 0],[dn.ConfigKey.ModelAlwaysTerminatesSingleline,void 0],[dn.ConfigKey.UseWorkspaceContextCoordinator,void 0],[dn.ConfigKey.ShowEditorCompletions,void 0],[dn.ConfigKey.EnableAutoCompletions,void 0],[dn.ConfigKey.DelayCompletions,void 0],[dn.ConfigKey.FilterCompletions,void 0],[dn.ConfigKey.UseSplitContextPrompt,!0],[dn.ConfigKey.Enable,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}],[dn.ConfigKey.UserSelectedCompletionModel,""],[dn.ConfigKey.DebugOverrideEngineLegacy,""],[dn.ConfigKey.DebugOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideProxyUrlLegacy,""],[dn.ConfigKey.DebugOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugTestOverrideCapiUrlLegacy,""],[dn.ConfigKey.DebugFilterLogCategories,[]]]);function x1a(t,e){return t.get(dn.ICompletionsConfigProvider).getConfig(e)}a(x1a,"getConfig");function w1a(t){try{return t.get(dn.ICompletionsConfigProvider).dumpForTelemetry()}catch(e){return console.error(`Error dumping config for telemetry: ${e}`),{}}}a(w1a,"dumpForTelemetry");var Dht=class t{static{a(this,"BuildInfo")}static isPreRelease(){return this.getBuildType()===hee.NIGHTLY}static isProduction(){return this.getBuildType()!==hee.DEV}static getBuildType(){return Pht.packageJson.buildType==="prod"?t.getVersion().length===15?hee.NIGHTLY:hee.PROD:hee.DEV}static getVersion(){return Pht.packageJson.version}static getBuild(){return Pht.packageJson.build}};dn.BuildInfo=Dht;function Byr({name:t,version:e}){return`${t}/${e}`}a(Byr,"formatNameAndVersion");dn.ICompletionsEditorAndPluginInfo=(0,hCi.createServiceIdentifier)("ICompletionsEditorAndPluginInfo");dn.apiVersion="2025-05-01";function R1a(t){let e=t.get(dn.ICompletionsEditorAndPluginInfo);return{"Editor-Version":Byr(e.getEditorInfo()),"Editor-Plugin-Version":Byr(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":Dht.getVersion()}}a(R1a,"editorVersionHeaders")});var Lyr=I(Nht=>{"use strict";p();Object.defineProperty(Nht,"__esModule",{value:!0});Nht.ExpServiceTelemetryNames=void 0;var ACi;(function(t){t.featuresTelemetryPropertyName="VSCode.ABExp.Features"})(ACi||(Nht.ExpServiceTelemetryNames=ACi={}))});var Mht=I(V0e=>{"use strict";p();Object.defineProperty(V0e,"__esModule",{value:!0});V0e.ExpConfig=V0e.ExpTreatmentVariables=void 0;var P1a=Ig(),k1a=Lyr(),yCi;(function(t){t.CustomEngine="copilotcustomengine",t.CustomEngineTargetEngine="copilotcustomenginetargetengine",t.OverrideBlockMode="copilotoverrideblockmode",t.SuffixPercent="CopilotSuffixPercent",t.CppHeadersEnableSwitch="copilotcppheadersenableswitch",t.UseSubsetMatching="copilotsubsetmatching",t.SuffixMatchThreshold="copilotsuffixmatchthreshold",t.MaxPromptCompletionTokens="maxpromptcompletionTokens",t.StableContextPercent="copilotstablecontextpercent",t.VolatileContextPercent="copilotvolatilecontextpercent",t.RelatedFilesVSCodeCSharp="copilotrelatedfilesvscodecsharp",t.RelatedFilesVSCodeTypeScript="copilotrelatedfilesvscodetypescript",t.RelatedFilesVSCode="copilotrelatedfilesvscode",t.ContextProviders="copilotcontextproviders",t.IncludeNeighboringFiles="copilotincludeneighboringfiles",t.ExcludeRelatedFiles="copilotexcluderelatedfiles",t.ContextProviderTimeBudget="copilotcontextprovidertimebudget",t.CppContextProviderParams="copilotcppContextProviderParams",t.CSharpContextProviderParams="copilotcsharpcontextproviderparams",t.JavaContextProviderParams="copilotjavacontextproviderparams",t.MultiLanguageContextProviderParams="copilotmultilanguagecontextproviderparams",t.TsContextProviderParams="copilottscontextproviderparams",t.CompletionsDebounce="copilotcompletionsdebounce",t.ElectronFetcher="copilotelectronfetcher",t.FetchFetcher="copilotfetchfetcher",t.AsyncCompletionsTimeout="copilotasynccompletionstimeout",t.EnablePromptContextProxyField="copilotenablepromptcontextproxyfield",t.ProgressiveReveal="copilotprogressivereveal",t.ModelAlwaysTerminatesSingleline="copilotmodelterminatesingleline",t.ProgressiveRevealLongLookaheadSize="copilotprogressivereveallonglookaheadsize",t.ProgressiveRevealShortLookaheadSize="copilotprogressiverevealshortlookaheadsize",t.MaxMultilineTokens="copilotmaxmultilinetokens",t.MultilineAfterAcceptLines="copilotmultilineafteracceptlines",t.CompletionsDelay="copilotcompletionsdelay",t.SingleLineUnlessAccepted="copilotsinglelineunlessaccepted"})(yCi||(V0e.ExpTreatmentVariables=yCi={}));var Fyr=class t{static{a(this,"ExpConfig")}constructor(e,r){this.variables=e,this.features=r}static createFallbackConfig(e,r){return(0,P1a.telemetryExpProblem)(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"")}addToTelemetry(e){e.properties[k1a.ExpServiceTelemetryNames.featuresTelemetryPropertyName]=this.features}};V0e.ExpConfig=Fyr});var JA=I(Oht=>{"use strict";p();Object.defineProperty(Oht,"__esModule",{value:!0});Oht.ICompletionsFeaturesService=void 0;var D1a=tn();Oht.ICompletionsFeaturesService=(0,D1a.createServiceIdentifier)("ICompletionsFeaturesService")});var Bht=I(qH=>{"use strict";p();Object.defineProperty(qH,"__esModule",{value:!0});qH.FilterSettings=qH.Release=qH.Filter=void 0;var mee;(function(t){t.ExtensionRelease="X-VSCode-ExtensionRelease",t.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",t.CopilotEngine="X-Copilot-Engine",t.CopilotOverrideEngine="X-Copilot-OverrideEngine",t.CopilotRepository="X-Copilot-Repository",t.CopilotFileType="X-Copilot-FileType",t.CopilotUserKind="X-Copilot-UserKind",t.CopilotDogfood="X-Copilot-Dogfood",t.CopilotCustomModel="X-Copilot-CustomModel",t.CopilotOrgs="X-Copilot-Orgs",t.CopilotCustomModelNames="X-Copilot-CustomModelNames",t.CopilotTrackingId="X-Copilot-CopilotTrackingId",t.CopilotClientVersion="X-Copilot-ClientVersion",t.CopilotRelatedPluginVersionCppTools="X-Copilot-RelatedPluginVersion-msvscodecpptools",t.CopilotRelatedPluginVersionCMakeTools="X-Copilot-RelatedPluginVersion-msvscodecmaketools",t.CopilotRelatedPluginVersionMakefileTools="X-Copilot-RelatedPluginVersion-msvscodemakefiletools",t.CopilotRelatedPluginVersionCSharpDevKit="X-Copilot-RelatedPluginVersion-msdotnettoolscsdevkit",t.CopilotRelatedPluginVersionPython="X-Copilot-RelatedPluginVersion-mspythonpython",t.CopilotRelatedPluginVersionPylance="X-Copilot-RelatedPluginVersion-mspythonvscodepylance",t.CopilotRelatedPluginVersionJavaPack="X-Copilot-RelatedPluginVersion-vscjavavscodejavapack",t.CopilotRelatedPluginVersionJavaManager="X-Copilot-RelatedPluginVersion-vscjavavscodejavadependency",t.CopilotRelatedPluginVersionTypescript="X-Copilot-RelatedPluginVersion-vscodetypescriptlanguagefeatures",t.CopilotRelatedPluginVersionTypescriptNext="X-Copilot-RelatedPluginVersion-msvscodevscodetypescriptnext",t.CopilotRelatedPluginVersionCSharp="X-Copilot-RelatedPluginVersion-msdotnettoolscsharp",t.CopilotRelatedPluginVersionGithubCopilotChat="X-Copilot-RelatedPluginVersion-githubcopilotchat",t.CopilotRelatedPluginVersionGithubCopilot="X-Copilot-RelatedPluginVersion-githubcopilot"})(mee||(qH.Filter=mee={}));var ECi;(function(t){t.Stable="stable",t.Nightly="nightly"})(ECi||(qH.Release=ECi={}));var N1a={[mee.CopilotClientTimeBucket]:"timeBucket",[mee.CopilotOverrideEngine]:"engine",[mee.CopilotRepository]:"repo",[mee.CopilotFileType]:"fileType",[mee.CopilotUserKind]:"userKind"},Uyr=class{static{a(this,"FilterSettings")}constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=N1a[r];o!==void 0&&(e.properties[o]=n)}}toHeaders(){return{...this.filters}}};qH.FilterSettings=Uyr});var jH=I(pm=>{"use strict";p();Object.defineProperty(pm,"__esModule",{value:!0});pm.vString=O1a;pm.vNumber=L1a;pm.vBoolean=U1a;pm.vObjAny=q1a;pm.vUndefined=H1a;pm.vNull=G1a;pm.vNullable=$1a;pm.vUnchecked=vCi;pm.vUnknown=V1a;pm.vRequired=W1a;pm.vObj=z1a;pm.vArray=Y1a;pm.vTuple=K1a;pm.vUnion=CCi;pm.vEnum=J1a;pm.vLiteral=Z1a;pm.vLazy=X1a;var gee=class{static{a(this,"TypeofValidator")}constructor(e){this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}toSchema(){return{type:this.type}}},M1a=new gee("string");function O1a(){return M1a}a(O1a,"vString");var B1a=new gee("number");function L1a(){return B1a}a(L1a,"vNumber");var F1a=new gee("boolean");function U1a(){return F1a}a(U1a,"vBoolean");var Q1a=new gee("object");function q1a(){return Q1a}a(q1a,"vObjAny");var j1a=new gee("undefined");function H1a(){return j1a}a(H1a,"vUndefined");var Qyr=class{static{a(this,"NullValidator")}validate(e){return e!==null?{content:void 0,error:{message:`Expected null, but got ${typeof e}`}}:{content:null,error:void 0}}toSchema(){return{type:"null"}}},_Ci=new Qyr;function G1a(){return _Ci}a(G1a,"vNull");function $1a(t){return CCi(t,_Ci)}a($1a,"vNullable");function vCi(){return{validate(t){return{content:t,error:void 0}},toSchema(){return{}}}}a(vCi,"vUnchecked");function V1a(){return vCi()}a(V1a,"vUnknown");function W1a(t){return{validate(e){return e===void 0?{content:void 0,error:{message:"Required field is missing"}}:t.validate(e)},toSchema(){return t.toSchema()},isRequired(){return!0}}}a(W1a,"vRequired");function z1a(t){return{validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};let r={};for(let n in t){let o=t[n],s=e[n],c=o.isRequired?.()??!1;if(c&&s===void 0)return{content:void 0,error:{message:`Required field '${n}' is missing`}};if(!c&&s===void 0)continue;let{content:l,error:u}=o.validate(s);if(u)return{content:void 0,error:{message:`Error in property '${n}': ${u.message}`}};r[n]=l}return{content:r,error:void 0}},toSchema(){let e=[],r={};for(let[o,s]of Object.entries(t))r[o]=s.toSchema(),s.isRequired?.()&&e.push(o);return{type:"object",properties:r,...e.length>0?{required:e}:{}}}}}a(z1a,"vObj");function Y1a(t){return{validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:"Expected array"}};let r=[];for(let n=0;ne.toSchema())}}}}a(K1a,"vTuple");function CCi(...t){return{validate(e){let r;for(let n of t){let{content:o,error:s}=n.validate(e);if(!s)return{content:o,error:void 0};r=s}return{content:void 0,error:r}},toSchema(){return{oneOf:t.map(e=>e.toSchema())}}}}a(CCi,"vUnion");function J1a(...t){return{validate(e){return t.indexOf(e)===-1?{content:void 0,error:{message:`Expected one of: ${t.join(", ")}`}}:{content:e,error:void 0}},toSchema(){return{enum:t}}}}a(J1a,"vEnum");function Z1a(t){return{validate(e){return e!==t?{content:void 0,error:{message:`Expected: ${t}`}}:{content:e,error:void 0}},toSchema(){return{const:t}}}}a(Z1a,"vLiteral");function X1a(t){return{validate(e){return t().validate(e)},toSchema(){return t().toSchema()}}}a(X1a,"vLazy")});var qyr=I(_Me=>{"use strict";p();Object.defineProperty(_Me,"__esModule",{value:!0});_Me.ImportChanges=void 0;var eSa=jH(),Lht;(function(t){t.All="all",t.None="none"})(Lht||(_Me.ImportChanges=Lht={}));(function(t){t.VALIDATOR=(0,eSa.vEnum)(t.All,t.None)})(Lht||(_Me.ImportChanges=Lht={}))});var TCi=I(W0e=>{"use strict";p();Object.defineProperty(W0e,"__esModule",{value:!0});W0e.JointCompletionsProviderTriggerChangeStrategy=W0e.JointCompletionsProviderStrategy=void 0;var bCi;(function(t){t.Regular="regular",t.CursorEndOfLine="cursorEndOfLine"})(bCi||(W0e.JointCompletionsProviderStrategy=bCi={}));var SCi;(function(t){t.NoTriggerOnRequestInFlight="noTriggerOnRequestInFlight",t.NoTriggerOnCompletionsRequestInFlight="noTriggerOnCompletionsRequestInFlight",t.AlwaysTrigger="alwaysTrigger"})(SCi||(W0e.JointCompletionsProviderTriggerChangeStrategy=SCi={}))});var ICi=I(vMe=>{"use strict";p();Object.defineProperty(vMe,"__esModule",{value:!0});vMe.DocumentSwitchTriggerStrategy=void 0;var tSa=jH(),Fht;(function(t){t.Always="always",t.AfterAcceptance="afterAcceptance"})(Fht||(vMe.DocumentSwitchTriggerStrategy=Fht={}));(function(t){t.VALIDATOR=(0,tSa.vEnum)(t.Always,t.AfterAcceptance)})(Fht||(vMe.DocumentSwitchTriggerStrategy=Fht={}))});var jyr=I(CMe=>{"use strict";p();Object.defineProperty(CMe,"__esModule",{value:!0});CMe.DiffHistoryMergeStrategy=void 0;var rSa=jH(),Uht;(function(t){t.SameStartLine="sameStartLine",t.Proximity="proximity",t.Hybrid="hybrid"})(Uht||(CMe.DiffHistoryMergeStrategy=Uht={}));(function(t){t.VALIDATOR=(0,rSa.vEnum)(t.SameStartLine,t.Proximity,t.Hybrid)})(Uht||(CMe.DiffHistoryMergeStrategy=Uht={}))});var ZA=I(En=>{"use strict";p();Object.defineProperty(En,"__esModule",{value:!0});En.SpeculativeRequestsAutoExpandEditWindowLines=En.SpeculativeRequestsCursorPlacement=En.DuplicateAdditionsMode=En.SpeculativeRequestsEnablement=En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR=En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION=En.MODEL_CONFIGURATION_VALIDATOR=En.LINT_OPTIONS_VALIDATOR=En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES=En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS=En.DEFAULT_OPTIONS=En.ResponseFormat=En.PromptingStrategy=En.EditIntent=En.EarlyDivergenceCancellationMode=En.AggressivenessLevel=En.AggressivenessSetting=En.LintOptionShowCode=En.LintOptionWarning=En.CurrentFileOptions=En.GlobalBudgetOptions=En.NeighborFilesOptions=En.RecentlyViewedDocumentsOptions=En.RecentFileClippingStrategy=En.IncludeLineNumbersOption=void 0;En.isPromptingStrategy=nSa;En.isAggressivenessStrategy=iSa;En.applyStrategyConfig=sSa;En.parseLintOptionString=aSa;En.parseUserHappinessScoreConfigurationString=cSa;var PCi=Gu(),In=jH(),Rb;(function(t){t.WithSpaceAfter="withSpaceAfter",t.WithoutSpace="withoutSpaceAfter",t.None="none"})(Rb||(En.IncludeLineNumbersOption=Rb={}));var Aee;(function(t){t.AroundEditRange="aroundEditRange",t.Proportional="proportional"})(Aee||(En.RecentFileClippingStrategy=Aee={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.AroundEditRange,t.Proportional)})(Aee||(En.RecentFileClippingStrategy=Aee={}));var Hyr;(function(t){t.VALIDATOR=(0,In.vObj)({nDocuments:(0,In.vNumber)(),maxTokens:(0,In.vNumber)(),includeViewedFiles:(0,In.vBoolean)(),includeLineNumbers:(0,In.vEnum)(Rb.WithSpaceAfter,Rb.WithoutSpace,Rb.None),clippingStrategy:(0,In.vEnum)(Aee.AroundEditRange,Aee.Proportional)})})(Hyr||(En.RecentlyViewedDocumentsOptions=Hyr={}));var xCi;(function(t){t.VALIDATOR=(0,In.vObj)({enabled:(0,In.vBoolean)(),maxTokens:(0,In.vNumber)()})})(xCi||(En.NeighborFilesOptions=xCi={}));var wCi;(function(t){t.DEFAULT_ORDER=["languageContext","recentlyViewedDocuments","neighborFiles","diffHistory"],t.DEFAULT_SHARES={recentlyViewedDocuments:2/6,languageContext:2/6,neighborFiles:1/6,diffHistory:1/6},t.DEFAULT_TOTAL_TOKENS=6e3})(wCi||(En.GlobalBudgetOptions=wCi={}));var Gyr;(function(t){t.VALIDATOR=(0,In.vObj)({maxTokens:(0,In.vNumber)(),includeTags:(0,In.vBoolean)(),includeLineNumbers:(0,In.vEnum)(Rb.WithSpaceAfter,Rb.WithoutSpace,Rb.None),includeCursorTag:(0,In.vBoolean)(),prioritizeAboveCursor:(0,In.vBoolean)()})})(Gyr||(En.CurrentFileOptions=Gyr={}));var z0e;(function(t){t.YES="yes",t.NO="no",t.YES_IF_NO_ERRORS="yesIfNoErrors"})(z0e||(En.LintOptionWarning=z0e={}));var Y0e;(function(t){t.YES="yes",t.NO="no",t.YES_WITH_SURROUNDING="yesWithSurroundingLines"})(Y0e||(En.LintOptionShowCode=Y0e={}));var Qht;(function(t){t.Default="auto",t.Low="low",t.Medium="medium",t.High="high"})(Qht||(En.AggressivenessSetting=Qht={}));var HH;(function(t){t.Low="low",t.Medium="medium",t.High="high"})(HH||(En.AggressivenessLevel=HH={}));var qht;(function(t){t.Cursor="cursor",t.EditWindow="editWindow",t.Off="off"})(qht||(En.EarlyDivergenceCancellationMode=qht={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.Cursor,t.EditWindow,t.Off)})(qht||(En.EarlyDivergenceCancellationMode=qht={}));(function(t){t.VALIDATOR=(0,In.vEnum)(t.Default,t.Low,t.Medium,t.High);function e(r){switch(r){case t.Low:return HH.Low;case t.Medium:return HH.Medium;case t.High:return HH.High;case t.Default:return}}a(e,"toLevel"),t.toLevel=e})(Qht||(En.AggressivenessSetting=Qht={}));var jht;(function(t){t.NoEdit="no_edit",t.Low="low",t.Medium="medium",t.High="high"})(jht||(En.EditIntent=jht={}));(function(t){function e(o){switch(o){case"no_edit":return t.NoEdit;case"low":return t.Low;case"medium":return t.Medium;case"high":return t.High;default:return t.High}}a(e,"fromString"),t.fromString=e;function r(o){switch(o){case"N":return t.NoEdit;case"L":return t.Low;case"M":return t.Medium;case"H":return t.High;default:return}}a(r,"fromShortName"),t.fromShortName=r;function n(o,s){switch(o){case t.NoEdit:return!1;case t.High:return!0;case t.Medium:return s===HH.Medium||s===HH.High;case t.Low:return s===HH.High;default:(0,PCi.assertNever)(o)}}a(n,"shouldShowEdit"),t.shouldShowEdit=n})(jht||(En.EditIntent=jht={}));var bl;(function(t){t.CopilotNesXtab="copilotNesXtab",t.UnifiedModel="xtabUnifiedModel",t.Codexv21NesUnified="codexv21nesUnified",t.Nes41Miniv3="nes41miniv3",t.SimplifiedSystemPrompt="simplifiedSystemPrompt",t.Xtab275="xtab275",t.XtabAggressiveness="xtabAggressiveness",t.Xtab275Aggressiveness="xtab275Aggressiveness",t.Xtab275AggressivenessHighLow="xtab275AggressivenessHighLow",t.PatchBased="patchBased",t.PatchBased01="patchBased01",t.PatchBased02="patchBased02",t.PatchBased02WithRecentLineNumbers="patchBased02WithRecentLineNumbers",t.PatchBased02WithoutRecentLineNumbers="patchBased02WithoutRecentLineNumbers",t.Xtab275EditIntent="xtab275EditIntent",t.Xtab275EditIntentShort="xtab275EditIntentShort"})(bl||(En.PromptingStrategy=bl={}));function nSa(t){return Object.values(bl).includes(t)}a(nSa,"isPromptingStrategy");function iSa(t){return t===bl.XtabAggressiveness||t===bl.Xtab275Aggressiveness||t===bl.Xtab275AggressivenessHighLow||t===bl.Xtab275EditIntent||t===bl.Xtab275EditIntentShort}a(iSa,"isAggressivenessStrategy");var Hht;(function(t){t.CodeBlock="codeBlock",t.UnifiedWithXml="unifiedWithXml",t.EditWindowOnly="editWindowOnly",t.CustomDiffPatch="customDiffPatch",t.EditWindowWithEditIntent="editWindowWithEditIntent",t.EditWindowWithEditIntentShort="editWindowWithEditIntentShort"})(Hht||(En.ResponseFormat=Hht={}));(function(t){function e(r){switch(r){case bl.UnifiedModel:case bl.Codexv21NesUnified:case bl.Nes41Miniv3:return t.UnifiedWithXml;case bl.Xtab275:case bl.XtabAggressiveness:case bl.Xtab275Aggressiveness:case bl.Xtab275AggressivenessHighLow:return t.EditWindowOnly;case bl.PatchBased:case bl.PatchBased01:case bl.PatchBased02:case bl.PatchBased02WithRecentLineNumbers:case bl.PatchBased02WithoutRecentLineNumbers:return t.CustomDiffPatch;case bl.Xtab275EditIntent:return t.EditWindowWithEditIntent;case bl.Xtab275EditIntentShort:return t.EditWindowWithEditIntentShort;case bl.SimplifiedSystemPrompt:case bl.CopilotNesXtab:case void 0:return t.CodeBlock;default:(0,PCi.assertNever)(r)}}a(e,"fromPromptingStrategy"),t.fromPromptingStrategy=e})(Hht||(En.ResponseFormat=Hht={}));En.DEFAULT_OPTIONS={promptingStrategy:void 0,currentFile:{maxTokens:2e3,includeTags:!0,includeLineNumbers:Rb.None,includeCursorTag:!1,prioritizeAboveCursor:!1},pagedClipping:{pageSize:10},recentlyViewedDocuments:{nDocuments:5,maxTokens:2e3,includeViewedFiles:!1,includeLineNumbers:Rb.None,clippingStrategy:Aee.AroundEditRange},languageContext:{enabled:!1,maxTokens:2e3,traitPosition:"after"},neighborFiles:{enabled:!1,maxTokens:1e3},diffHistory:{nEntries:25,maxTokens:1e3,onlyForDocsInPrompt:!1,useRelativePaths:!1},lintOptions:void 0,includePostScript:!0};En.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS={maxLineDistance:1e3,maxLints:5,showCode:Y0e.YES_WITH_SURROUNDING,tagName:"linter",warnings:z0e.YES_IF_NO_ERRORS,nRecentFiles:0};En.LANGUAGE_CONTEXT_ENABLED_LANGUAGES={prompt:!0,instructions:!0,chatagent:!0};var oSa={[bl.CopilotNesXtab]:{includeTagsInCurrentFile:!0},[bl.PatchBased02WithRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Rb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Rb.WithoutSpace},supportsNextCursorLinePrediction:!1},[bl.PatchBased02WithoutRecentLineNumbers]:{includeTagsInCurrentFile:!1,includePostScript:!0,currentFile:{includeLineNumbers:Rb.WithoutSpace},recentlyViewedDocuments:{includeLineNumbers:Rb.None},supportsNextCursorLinePrediction:!1}};function sSa(t){let e=t.promptingStrategy===void 0?void 0:oSa[t.promptingStrategy];if(!e)return t;let r=t.currentFile!==void 0||e.currentFile!==void 0,n=t.recentlyViewedDocuments!==void 0||e.recentlyViewedDocuments!==void 0,o=t.lintOptions!==void 0||e.lintOptions!==void 0;return{...t,...e,currentFile:r?{...t.currentFile,...e.currentFile}:void 0,recentlyViewedDocuments:n?{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments}:void 0,lintOptions:o?{...t.lintOptions,...e.lintOptions}:void 0}}a(sSa,"applyStrategyConfig");En.LINT_OPTIONS_VALIDATOR=(0,In.vObj)({tagName:(0,In.vString)(),warnings:(0,In.vEnum)(z0e.YES,z0e.NO,z0e.YES_IF_NO_ERRORS),showCode:(0,In.vEnum)(Y0e.NO,Y0e.YES,Y0e.YES_WITH_SURROUNDING),maxLints:(0,In.vNumber)(),maxLineDistance:(0,In.vNumber)(),nRecentFiles:(0,In.vNumber)()});En.MODEL_CONFIGURATION_VALIDATOR=(0,In.vObj)({modelName:(0,In.vRequired)((0,In.vString)()),promptingStrategy:(0,In.vUnion)((0,In.vEnum)(...Object.values(bl)),(0,In.vUndefined)()),includeTagsInCurrentFile:(0,In.vRequired)((0,In.vBoolean)()),includePostScript:(0,In.vUnion)((0,In.vBoolean)(),(0,In.vUndefined)()),currentFile:(0,In.vUnion)(Gyr.VALIDATOR,(0,In.vUndefined)()),recentlyViewedDocuments:(0,In.vUnion)(Hyr.VALIDATOR,(0,In.vUndefined)()),lintOptions:(0,In.vUnion)(En.LINT_OPTIONS_VALIDATOR,(0,In.vUndefined)()),supportsNextCursorLinePrediction:(0,In.vUnion)((0,In.vBoolean)(),(0,In.vUndefined)())});function aSa(t,e){try{let r=JSON.parse(t),n=En.LINT_OPTIONS_VALIDATOR.validate(r);if(n.error)throw new Error(`Lint options validation failed: ${n.error.message}`);return{...e,...n.content}}catch(r){throw new Error(`Failed to parse lint options string: ${r}`)}}a(aSa,"parseLintOptionString");En.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION={acceptedScore:1,rejectedScore:0,ignoredScore:.5,highThreshold:.7,mediumThreshold:.4,includeIgnored:!1,ignoredLimit:0,limitConsecutiveIgnored:!1,limitTotalIgnored:!0};var RCi=(0,In.vObj)({acceptedScore:(0,In.vRequired)((0,In.vNumber)()),rejectedScore:(0,In.vRequired)((0,In.vNumber)()),ignoredScore:(0,In.vRequired)((0,In.vNumber)()),highThreshold:(0,In.vRequired)((0,In.vNumber)()),mediumThreshold:(0,In.vRequired)((0,In.vNumber)()),includeIgnored:(0,In.vRequired)((0,In.vBoolean)()),ignoredLimit:(0,In.vRequired)((0,In.vNumber)()),limitConsecutiveIgnored:(0,In.vRequired)((0,In.vBoolean)()),limitTotalIgnored:(0,In.vRequired)((0,In.vBoolean)())});function bMe(t,e,r){return t>=e&&t<=r}a(bMe,"isInRange");En.USER_HAPPINESS_SCORE_CONFIGURATION_VALIDATOR={validate(t){let e=RCi.validate(t);if(e.error)return e;let r=e.content;return bMe(r.acceptedScore,0,1)?bMe(r.rejectedScore,0,1)?bMe(r.ignoredScore,0,1)?bMe(r.highThreshold,0,1)?bMe(r.mediumThreshold,0,1)?r.acceptedScore<=r.rejectedScore?{content:void 0,error:{message:"acceptedScore must be greater than rejectedScore to prevent division by zero"}}:r.ignoredScore{"use strict";p();Object.defineProperty(K0e,"__esModule",{value:!0});K0e.TextReplacement=K0e.TextEdit=void 0;var kCi=ml(),DCi=Gu(),Kht=bs(),zht=Oh(),GH=T_(),u0=Gp(),Jht=Kpe(),NCi=AT(),Zht=class t{static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>sv.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new sv(e,r)])}static delete(e){return new t([new sv(e,"")])}static insert(e,r){return new t([new sv(u0.Range.fromPositions(e,e),r)])}static fromParallelReplacementsUnsorted(e){let r=e.slice().sort((0,kCi.compareBy)(n=>n.range,u0.Range.compareRangesUsingStarts));return new t(r)}constructor(e){this.replacements=e,(0,DCi.assertFn)(()=>(0,DCi.checkAdjacentItems)(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new sv(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=Jht.TextLength.ofText(s.text);if(e.isBefore(l)){let d=new GH.Position(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return Yht(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new GH.Position(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof GH.Position?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof GH.Position?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return Yht(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new GH.Position(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=Yht(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=Yht(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new NCi.StringText(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new sv(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=Jht.TextLength.ofText(s.text),l=GH.Position.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Kht.BugIndicatingError;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}compose(e){let r=this.normalize(),n=e.normalize();if(r.replacements.length===0)return n;if(n.replacements.length===0)return r;let o=[],s=0,c=1,l=1,u=0,d=0,f=0,h=0,m=null,g=0,A=0,y=!1,E=!1,_=1,v=1;function b(){if(!y)if(sr.toString()).join(` +`):typeof e=="string"?this.toString(new NCi.StringText(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=u0.Range.fromPositions(new GH.Position(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=u0.Range.fromPositions(r.range.getEndPosition(),new GH.Position(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` +`)}};K0e.TextEdit=Zht;var sv=class t{static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Kht.BugIndicatingError;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c ${r.lineNumber},${r.column}): "${this.text}"`}};ime.TextReplacement=lC;function Wht(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return l0.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new zht.BugIndicatingError("start must be before end");return new l0.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Wht,"rangeFromPositions")});var eG=I(XH=>{"use strict";p();Object.defineProperty(XH,"__esModule",{value:!0});XH.SerializedLineReplacement=XH.LineReplacement=XH.LineEdit=void 0;var Fyr=El(),nvi=Yu(),QSa=Gh(),OMe=g2(),ovi=gE(),ome=I_(),sme=qp(),ame=MMe(),Jht=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>vee.deserialize(r)))}static fromStringEdit(e,r){let n=ame.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,Fyr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,nvi.assert)((0,nvi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new ovi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(OMe.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new OMe.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new vee(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,Fyr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew vee(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};XH.LineEdit=Jht;var vee=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(OMe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,QSa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(sme.Range.fromPositions(new ome.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(sme.Range.fromPositions(e.range.getEndPosition(),new ome.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new ome.Position(s,c)}else n=new ome.Position(1,1);let o=r.addToPosition(new ome.Position(1,1));return new ame.TextReplacement(sme.Range.fromPositions(n,o),"")}else return new ame.TextReplacement(new sme.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=(0,zht.commonPrefixLength)(r,n);r=r.substring(o),n=n.substring(o);let s=(0,zht.commonSuffixLength)(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}toString(){let e=this.range.getStartPosition(),r=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${r.lineNumber},${r.column}): "${this.text}"`}};K0e.TextReplacement=sv;function Yht(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return u0.Range.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Kht.BugIndicatingError("start must be before end");return new u0.Range(t.lineNumber,t.column,e.lineNumber,e.column)}a(Yht,"rangeFromPositions")});var VH=I($H=>{"use strict";p();Object.defineProperty($H,"__esModule",{value:!0});$H.SerializedLineReplacement=$H.LineReplacement=$H.LineEdit=void 0;var $yr=ml(),MCi=Gu(),lSa=Oh(),TMe=p2(),BCi=hE(),J0e=T_(),Z0e=Gp(),X0e=SMe(),Xht=class t{static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>yee.deserialize(r)))}static fromStringEdit(e,r){let n=X0e.TextEdit.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,$yr.numberComparator)),new t(r)}constructor(e){this.replacements=e,(0,MCi.assert)((0,MCi.checkAdjacentItems)(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new BCi.StringEdit(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(TMe.LineRange.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new TMe.LineRange(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new yee(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of(0,$yr.groupAdjacentBy)(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew yee(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}};$H.LineEdit=Xht;var yee=class t{static{a(this,"LineReplacement")}static deserialize(e){return new t(TMe.LineRange.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=(0,lSa.splitLines)(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Z0e.Range.fromPositions(new J0e.Position(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Z0e.Range.fromPositions(e.range.getEndPosition(),new J0e.Position(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new J0e.Position(s,c)}else n=new J0e.Position(1,1);let o=r.addToPosition(new J0e.Position(1,1));return new X0e.TextReplacement(Z0e.Range.fromPositions(n,o),"")}else return new X0e.TextReplacement(new Z0e.Range(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new ame.TextReplacement(sme.Range.fromPositions(new ome.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new sme.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new ame.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new ovi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(ivi||(XH.SerializedLineReplacement=ivi={}))});var Uyr=I(cme=>{"use strict";p();Object.defineProperty(cme,"__esModule",{value:!0});cme.ArrayMap=cme.ResponseProcessor=void 0;var qSa=Ts(),Zht=eG(),Xht=g2(),svi;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new e0t;for(let[y,E]of l.entries())h.add(E,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new Xht.LineRange(A.startLineIdx+1,l.length+1);yield new Zht.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[B,B]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let B=l[h],Q=f.newLines[0];if(B.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(_="found_significant_matches");g>=0&&(A=A.map(([B,Q])=>[B,Q-1]),A=A.filter(([B,Q])=>Q>=0&&h<=Q),A=A.filter(([B,Q])=>l[Q]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),k=x.length;if(R-k>1&&k>0)return;let D=[f.startLineIdx,b],N=new Xht.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new Zht.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(svi||(cme.ResponseProcessor=svi={}));var e0t=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};cme.ArrayMap=e0t});var cvi=I(t0t=>{"use strict";p();Object.defineProperty(t0t,"__esModule",{value:!0});t0t.AlternativeNotebookFormat=void 0;var avi;(function(t){t.json="json",t.xml="xml",t.text="text"})(avi||(t0t.AlternativeNotebookFormat=avi={}))});var Il=I(Ho=>{"use strict";p();var jSa=Ho&&Ho.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HSa=Ho&&Ho.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),LMe=Ho&&Ho.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):lvi.isObject(r)&&lvi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Ho.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,WSa.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Ho.AbstractConfigurationService=qyr;var r0t;function KSa(){if(!r0t){r0t=new Map;let e=zSa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)r0t.set(n,r[n].default)}return r0t}a(KSa,"getPackageJsonDefaults");function mvi(t,e,r){let n=`${Ho.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Ho.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=KSa(),c=s.has(n),l=s.get(n);if(c&&!VSa.equals(e,l))throw new Qyr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Qyr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(mvi,"toBaseConfig");var jyr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Ho.globalConfigRegistry=new jyr;var Hyr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new gvi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Ho.ConfigurationMigrationRegistry=new Hyr;function ot(t,e,r,n,o,s){if(e===1){let l={...mvi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Qyr.BugIndicatingError("Shared settings cannot be experiment based");return Ho.globalConfigRegistry.registerConfig(l),l}let c={...mvi(t,r,o),configType:0,validator:n};return Ho.globalConfigRegistry.registerConfig(c),c}a(ot,"defineSetting");function kt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?ot(t,e,r,n,o):ot(t,e,r,n,o,s)}a(kt,"defineTeamInternalSetting");function Wyr(t,e){Ho.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Ho.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Ho.CopilotConfigPrefix}.${t}`,{value:r}],[`${Ho.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(Wyr,"migrateSetting");function xg(t,e,r,n){return Wyr(e,t),ot(e,0,r,void 0,{...n,oldKey:t})}a(xg,"defineAndMigrateSetting");function fm(t,e,r,n,o){return Wyr(e,t),ot(e,1,r,void 0,{...n,oldKey:t},o)}a(fm,"defineAndMigrateExpSetting");Ho.HARD_TOOL_LIMIT=128;var Gyr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Gyr||(Ho.AuthProviderId=Gyr={}));var $yr;(function(t){t.Default="default",t.Minimal="minimal"})($yr||(Ho.AuthPermissionMode=$yr={}));var BMe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(BMe||(Ho.AzureAuthMode=BMe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(BMe||(Ho.AzureAuthMode=BMe={}));Ho.XTabProviderId="XtabProvider";var Vyr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=ot("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideCAPIUrl=ot("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=ot("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=ot("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=ot("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=ot("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=ot("advanced.authProvider",0,Gyr.GitHub),s.AuthPermissions=ot("advanced.authPermissions",0,$yr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=ot("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=ot("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=xg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=xg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=xg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=xg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=xg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=xg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=xg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=xg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=xg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=xg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=xg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=xg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=xg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=xg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=xg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=ot("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=ot("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=ot("chat.cli.autoModel.enabled",0,!1),s.CLIModelDetailsEnabled=ot("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=ot("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=ot("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=ot("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=ot("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=xg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLIBranchSupport=ot("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=ot("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=ot("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=ot("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=ot("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=ot("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=ot("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=ot("chat.cli.terminalLinks.enabled",0,!0),s.RequestLoggerMaxEntries=xg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=fm("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=fm("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=fm("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=fm("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=fm("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=ot("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=fm("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=fm("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",YSa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=fm("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=ot("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=ot("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=fm("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=fm("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=fm("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=fm("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=fm("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=ot("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=ot("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=ot("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=ot("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=ot("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=ot("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=ot("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=ot("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=ot("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=ot("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=ot("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=ot("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=fm("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=fm("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=fm("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=ot("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=ot("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=ot("nextEditSuggestions.eagerness",1,Iu.AggressivenessSetting.Default,Iu.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=fm("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=ot("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=ot("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=ot("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=ot("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=ot("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=ot("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=ot("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=ot("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=fm("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=fm("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=xg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=ot("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=ot("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=ot("chat.otel.enabled",0,!1),s.OTelExporterType=ot("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=ot("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=ot("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=ot("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=ot("chat.otel.outfile",0,""),s.OTelDbSpanExporter=ot("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=ot("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=ot("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=ot("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=ot("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=ot("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=ot("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return Wyr(l,c),ot(l,0,null,Iu.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=kt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=kt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=kt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=kt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,Ig.vBoolean)()),s.InlineEditsModelPickerEnabled=kt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,Ig.vBoolean)()),s.InlineEditsUseSlashModels=kt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=kt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=kt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,Ig.vBoolean)()),s.InlineEditsLogCancelledRequests=kt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,Ig.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=kt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,Ig.vString)()),s.InlineEditsNextCursorPredictionApiKey=kt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,Ig.vString)()),s.InlineEditsXtabProviderUrl=kt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,Ig.vString)()),s.InlineEditsXtabProviderApiKey=kt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,Ig.vString)()),s.InlineEditsNextCursorPredictionLintOptions=kt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Iu.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=kt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,Ig.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=kt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,Ig.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=kt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,Ig.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=kt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,Ig.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,O2.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=kt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=kt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=kt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=kt("chat.advanced.promptRenderer.trace",0,!1),s.AgentSandboxEnabled=kt("chat.advanced.agent.sandbox.enabled",1,!1),s.DebugCollectFetcherTelemetry=kt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=kt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=kt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=kt("chat.advanced.modelProviderPreference",0,void 0,(0,Ig.vString)()),s.UseVSCodeTelemetryLibForGH=kt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=kt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=kt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=kt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=kt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsEagerBackupRequest=kt("chat.advanced.inlineEdits.eagerBackupRequest",1,!1),s.InlineEditsDebounceUseCoreRequestTime=kt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=kt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=kt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=kt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=kt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=kt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=kt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=kt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=kt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=kt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=kt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=kt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=kt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=kt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,5,(0,Ig.vNumber)()),s.InlineEditsBackoffDebounceEnabled=kt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=kt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=kt("chat.advanced.inlineEdits.speculativeRequests",1,O2.SpeculativeRequestsEnablement.Off,O2.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=kt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,O2.SpeculativeRequestsCursorPlacement.AfterEditApplied,O2.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=kt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,O2.SpeculativeRequestsAutoExpandEditWindowLines.Off,O2.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=kt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=kt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=kt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,fvi.DocumentSwitchTriggerStrategy.AfterAcceptance,fvi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=kt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=kt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=kt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=kt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,Ig.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=kt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=kt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=kt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=kt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=kt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=kt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=kt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=kt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=kt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=kt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Iu.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=kt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Iu.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Iu.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,pvi.DiffHistoryMergeStrategy.SameStartLine,pvi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,Ig.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=kt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,Ig.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=kt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=kt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=kt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Iu.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Iu.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabPageSize=kt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Iu.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=kt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Iu.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Iu.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=kt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Iu.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabDiffOnlyForDocsInPrompt=kt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Iu.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=kt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Iu.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=kt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,hvi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=kt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,hvi.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=kt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,O2.EarlyDivergenceCancellationMode.Off,O2.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Iu.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Iu.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=kt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Iu.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=kt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Iu.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=kt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=kt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Iu.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=kt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=kt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=kt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,O2.DuplicateAdditionsMode.Off,O2.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=kt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=kt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=kt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=kt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=kt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=kt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=kt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsAllowImportChanges=kt("chat.advanced.inlineEdits.allowImportChanges",1,uvi.ImportChanges.None,uvi.ImportChanges.VALIDATOR),s.InlineEditsIgnoreWhenSuggestVisible=kt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=kt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=kt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,dvi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=kt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,dvi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=kt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=kt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=kt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=kt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=kt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=kt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=kt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=kt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=ot("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=ot("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=ot("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=ot("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=ot("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=kt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=kt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=kt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=kt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=kt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=ot("chat.planAgent.model",0,""),s.OllamaEndpoint=ot("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=ot("chat.azureModels",0,{}),s.CustomOAIModels=ot("chat.customOAIModels",0,{}),s.AzureAuthType=ot("chat.azureAuthType",0,BMe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=ot("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=ot("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=ot("chat.rateLimitAutoSwitchToAuto",0,!1,(0,Ig.vBoolean)()),t.UseAnthropicMessagesApi=ot("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=ot("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=ot("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=ot("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=ot("chat.responsesApi.promptCacheKey.enabled",1,!1),t.Updated53CodexPromptEnabled=ot("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=ot("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=ot("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=ot("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGpt55ReadFileTool=ot("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableGpt55EconomicalSearchAndEdit=ot("chat.gpt55EconomicalSearchAndEdit.enabled",1,!1),t.EnableGpt55LargePromptSections=ot("chat.gpt55LargePromptSections.enabled",1,!1),t.EnableChatImageUpload=ot("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=ot("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=ot("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=ot("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=ot("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=ot("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=ot("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=ot("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=ot("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=ot("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=ot("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=ot("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=ot("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=ot("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=ot("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=ot("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=ot("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=ot("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=ot("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=ot("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=ot("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=ot("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=ot("chat.scopeSelection",0,!1),t.EnableCodeActions=ot("editor.enableCodeActions",0,!0),t.LocaleOverride=ot("chat.localeOverride",0,"auto"),t.TerminalChatLocation=ot("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=ot("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=ot("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=ot("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=ot("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=ot("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=ot("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=ot("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=ot("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=ot("nextEditSuggestions.enabled",1,!0),t.InlineEditsEnableDiagnosticsProvider=ot("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=ot("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=ot("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=ot("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=ot("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=ot("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=ot("chat.virtualTools.threshold",1,Ho.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=ot("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=ot("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=ot("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=ot("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=ot("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=ot("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=ot("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=ot("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=ot("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=ot("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=ot("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=ot("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=ot("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=ot("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=ot("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=ot("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=ot("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=ot("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=ot("chat.cloudAgentBackend.version",0,"v1"),t.AdditionalReadAccessPaths=ot("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=ot("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=ot("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=ot("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=ot("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=ot("chat.askAgent.model",0,""),t.ExploreAgentEnabled=ot("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=ot("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=ot("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=ot("chat.localIndex.enabled",1,!1)})(Vyr||(Ho.ConfigKey=Vyr={}));function JSa(){return Object.values(Vyr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(JSa,"getAllConfigKeys");var ZSa=[];function XSa(t){return ZSa.push(t),t}a(XSa,"registerNextEditProviderId")});var pp=I(zA=>{"use strict";p();Object.defineProperty(zA,"__esModule",{value:!0});zA.LogMemory=zA.LogServiceImpl=zA.ConsoleLog=zA.LogTarget=zA.LogLevel=zA.ILogService=void 0;zA.collectErrorMessages=yvi;zA.collectSingleLineErrorMessage=rTa;zA.sanitizeNetworkErrorForTelemetry=nTa;var eTa=rn(),tTa=ko();zA.ILogService=(0,eTa.createServiceIdentifier)("ILogService");var bE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(bE||(zA.LogLevel=bE={}));var Avi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(Avi||(zA.LogTarget=Avi={}));var zyr=class{static{a(this,"ConsoleLog")}constructor(e,r=bE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===bE.Error?console.error(r,...n):e===bE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};zA.ConsoleLog=zyr;var Yyr=class extends tTa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new Kyr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};zA.LogServiceImpl=Yyr;var Kyr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){i0t.addLog(bE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(bE.Trace,e)}debug(e){this._logIt(bE.Debug,e)}info(e){this._logIt(bE.Info,e)}warn(e){this._logIt(bE.Warning,e)}error(e,r){this._logIt(bE.Error,yvi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new Jyr(this,e)}withExtraTarget(e){return new n0t(this,[e])}},Jyr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new n0t(this,[e],this._prefix)}},n0t=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(bE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(bE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(bE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(bE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(bE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function yvi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` +`).join("")),new X0e.TextReplacement(Z0e.Range.fromPositions(new J0e.Position(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Z0e.Range(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new X0e.TextReplacement(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new BCi.StringReplacement(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;rtypeof n=="string")}a(e,"is"),t.is=e})(OCi||($H.SerializedLineReplacement=OCi={}))});var Vyr=I(eme=>{"use strict";p();Object.defineProperty(eme,"__esModule",{value:!0});eme.ArrayMap=eme.ResponseProcessor=void 0;var uSa=bs(),e0t=VH(),t0t=p2(),LCi;(function(t){t.DEFAULT_DIFF_PARAMS={emitFastCursorLineChange:"off",nSignificantLinesToConverge:2,nLinesToConverge:3};function e(l){return l===!0?"additiveOnly":l===!1?"off":l}a(e,"mapEmitFastCursorLineChange"),t.mapEmitFastCursorLineChange=e;async function*r(l,u,d,f){let h=new r0t;for(let[y,E]of l.entries())h.add(E,y);let m=0,g=-1,A={k:"aligned"};for await(let y of u){if(++g,m>=l.length){switch(A.k){case"aligned":{A={k:"diverged",startLineIdx:m,newLines:[y]};break}case"diverged":A.newLines.push(y)}continue}if(A.k==="aligned"){if(l[m]===y){++m;continue}A={k:"diverged",startLineIdx:m,newLines:[]}}A.newLines.push(y);let E=c(l,d,h,A,m,f);E&&(yield E.singleLineEdit,m=E.convergenceEndIdx,A={k:"aligned"})}switch(A.k){case"diverged":{let y=new t0t.LineRange(A.startLineIdx+1,l.length+1);yield new e0t.LineReplacement(y,A.newLines);break}case"aligned":{if(mu.length)return!1;let d=0;for(let f=0;f[L,L]);if(A.length===0){if(m.emitFastCursorLineChange==="off"||h!==u||f.newLines.length>1)return;let L=l[h],j=f.newLines[0];if(L.trim()===""&&h+10&&v[0]-f.startLineIdx===f.newLines.length-1&&(_="found_significant_matches");g>=0&&(A=A.map(([L,j])=>[L,j-1]),A=A.filter(([L,j])=>j>=0&&h<=j),A=A.filter(([L,j])=>l[j]===f.newLines[g]),A.length!==0);--g)if(++y,n(f.newLines[g])&&++E,E===m.nSignificantLinesToConverge&&(_="found_significant_matches",v=A[0]),y===m.nLinesToConverge){_="found_matches",v=A[0];break}if(!_)return;let b=v[1],T=v[0],w=T-b+1,R=b-f.startLineIdx,x=f.newLines.slice(0,f.newLines.length-w),P=x.length;if(R-P>1&&P>0)return;let D=[f.startLineIdx,b],N=new t0t.LineRange(D[0]+1,D[1]+1);return{singleLineEdit:new e0t.LineReplacement(N,x),convergenceEndIdx:T+1}}a(c,"checkForConvergence")})(LCi||(eme.ResponseProcessor=LCi={}));var r0t=class{static{a(this,"ArrayMap")}constructor(){this.map=new Map}add(e,r){let n=this.map.get(e);n?n.push(r):this.map.set(e,[r])}get(e){return this.map.get(e)||[]}};eme.ArrayMap=r0t});var UCi=I(n0t=>{"use strict";p();Object.defineProperty(n0t,"__esModule",{value:!0});n0t.AlternativeNotebookFormat=void 0;var FCi;(function(t){t.json="json",t.xml="xml",t.text="text"})(FCi||(n0t.AlternativeNotebookFormat=FCi={}))});var Sl=I(Uo=>{"use strict";p();var dSa=Uo&&Uo.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fSa=Uo&&Uo.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xMe=Uo&&Uo.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{this._setUserInfo({isInternal:!!e.copilotToken?.isInternal})}))}getConfigMixedWithDefaults(e){if(e.options?.valueIgnoredForExternals&&!this._isInternal)return this.getDefaultValue(e);let r=this.getConfig(e);return r===void 0?this.getDefaultValue(e):QCi.isObject(r)&&QCi.isObject(e.defaultValue)?{...e.defaultValue,...r}:r}getDefaultValue(e){let r=this.getDefaultValueForConfig(e),n=r==null||r===!1||r===0||r==="";return e.defaultValue===void 0&&n?e.defaultValue:r!==void 0?r:e.defaultValue}_setUserInfo(e){if(this._isInternal===e.isInternal)return;let r=this._isInternal!==e.isInternal;this._isInternal=e.isInternal;let n=new Set;for(let o of Uo.globalConfigRegistry.configs.values())r&&o.options?.valueIgnoredForExternals&&n.add(o.fullyQualifiedId);n.size>0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(o=>{for(let s of n)if(s===o||s.startsWith(o+".")||o.startsWith(s+"."))return!0;return!1},"affectsConfiguration")})}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a(()=>!0,"affectsConfiguration")})}getConfigObservable(e){return this._getObservable_$show2FramesUp(e,()=>this.getConfig(e))}getExperimentBasedConfigObservable(e,r){return this._getObservable_$show2FramesUp(e,()=>this.getExperimentBasedConfig(e,r))}_getObservable_$show2FramesUp(e,r){let n=this.observables.get(e.id);return n||(n=(0,gSa.observableFromEventOpts)({debugName:a(()=>`Configuration Key "${e.id}"`,"debugName")},o=>this._register(this.onDidChangeConfiguration(s=>{s.affectsConfiguration(e.fullyQualifiedId)&&o(s)})),r),this.observables.set(e.id,n)),n}isConfigured(e,r){let n=this.inspectConfig(e,r);return n?.globalValue!==void 0||n?.globalLanguageValue!==void 0||n?.workspaceFolderValue!==void 0||n?.workspaceFolderLanguageValue!==void 0||n?.workspaceValue!==void 0||n?.workspaceLanguageValue!==void 0}getDefaultValueForConfig(e){}};Uo.AbstractConfigurationService=zyr;var i0t;function ESa(){if(!i0t){i0t=new Map;let e=ASa.packageJson.contributes.configuration.map(n=>n.properties),r=Object.assign({},...e);for(let n in r)i0t.set(n,r[n].default)}return i0t}a(ESa,"getPackageJsonDefaults");function VCi(t,e,r){let n=`${Uo.CopilotConfigPrefix}.${t}`,o=r?.oldKey?`${Uo.CopilotConfigPrefix}.${r.oldKey}`:void 0,s=ESa(),c=s.has(n),l=s.get(n);if(c&&!mSa.equals(e,l))throw new Wyr.BugIndicatingError(`The default value for setting ${t} is different in packageJson and in code`);if(c&&r?.valueIgnoredForExternals)throw new Wyr.BugIndicatingError(`The setting ${t} is public, it therefore cannot be restricted to internal!`);let u=n.startsWith("github.copilot.advanced.")?n.substring(24):void 0;return{id:t,oldId:r?.oldKey,isPublic:c,fullyQualifiedId:n,fullyQualifiedOldId:o,advancedSubKey:u,defaultValue:e,options:r}}a(VCi,"toBaseConfig");var Yyr=class{static{a(this,"ConfigRegistry")}constructor(){this.configs=new Map}registerConfig(e){this.configs.set(e.fullyQualifiedId,e)}};Uo.globalConfigRegistry=new Yyr;var Kyr=class{static{a(this,"ConfigurationMigrationRegistryImpl")}constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new WCi.Emitter,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e),this._onDidRegisterConfigurationMigrations.fire(e)}};Uo.ConfigurationMigrationRegistry=new Kyr;function dt(t,e,r,n,o,s){if(e===1){let l={...VCi(t,r,o),configType:1,experimentName:s?.experimentName,validator:n};if(l.advancedSubKey)throw new Wyr.BugIndicatingError("Shared settings cannot be experiment based");return Uo.globalConfigRegistry.registerConfig(l),l}let c={...VCi(t,r,o),configType:0,validator:n};return Uo.globalConfigRegistry.registerConfig(c),c}a(dt,"defineSetting");function Nt(t,e,r,n,o,s){return o={...o,valueIgnoredForExternals:!0},e===0?dt(t,e,r,n,o):dt(t,e,r,n,o,s)}a(Nt,"defineTeamInternalSetting");function eEr(t,e){Uo.ConfigurationMigrationRegistry.registerConfigurationMigrations([{key:`${Uo.CopilotConfigPrefix}.${e}`,migrateFn:a(async r=>[[`${Uo.CopilotConfigPrefix}.${t}`,{value:r}],[`${Uo.CopilotConfigPrefix}.${e}`,{value:void 0}]],"migrateFn")}])}a(eEr,"migrateSetting");function wg(t,e,r,n){return eEr(e,t),dt(e,0,r,void 0,{...n,oldKey:t})}a(wg,"defineAndMigrateSetting");function hm(t,e,r,n,o){return eEr(e,t),dt(e,1,r,void 0,{...n,oldKey:t},o)}a(hm,"defineAndMigrateExpSetting");Uo.HARD_TOOL_LIMIT=128;var Jyr;(function(t){t.GitHub="github",t.GitHubEnterprise="github-enterprise",t.Microsoft="microsoft"})(Jyr||(Uo.AuthProviderId=Jyr={}));var Zyr;(function(t){t.Default="default",t.Minimal="minimal"})(Zyr||(Uo.AuthPermissionMode=Zyr={}));var IMe;(function(t){t.EntraId="entraId",t.ApiKey="apiKey"})(IMe||(Uo.AzureAuthMode=IMe={}));(function(t){t.MICROSOFT_AUTH_PROVIDER="microsoft",t.COGNITIVE_SERVICES_SCOPE="https://cognitiveservices.azure.com/.default"})(IMe||(Uo.AzureAuthMode=IMe={}));Uo.XTabProviderId="XtabProvider";var Xyr;(function(t){let e;(function(s){s.DebugOverrideProxyUrl=dt("advanced.debug.overrideProxyUrl",0,void 0),s.DebugOverrideCAPIUrl=dt("advanced.debug.overrideCapiUrl",0,void 0),s.DebugUseNodeFetchFetcher=dt("advanced.debug.useNodeFetchFetcher",0,!0),s.DebugUseNodeFetcher=dt("advanced.debug.useNodeFetcher",0,!1),s.DebugUseElectronFetcher=dt("advanced.debug.useElectronFetcher",0,!0),s.DebugNodeFetchCache=dt("advanced.debug.nodeFetchCache",0,"memory"),s.AuthProvider=dt("advanced.authProvider",0,Jyr.GitHub),s.AuthPermissions=dt("advanced.authPermissions",0,Zyr.Default)})(e=t.Shared||(t.Shared={}));let r;(function(s){s.DebugPromptOverrideString=dt("chat.debug.promptOverrideString",0,null),s.DebugPromptOverrideFile=dt("chat.debug.promptOverrideFile",0,null),s.WorkspacePrototypeAdoCodeSearchEndpointOverride=wg("chat.advanced.workspace.prototypeAdoCodeSearchEndpointOverride","chat.workspace.prototypeAdoCodeSearchEndpointOverride",""),s.FeedbackOnChange=wg("chat.advanced.feedback.onChange","chat.feedback.onChange",!1),s.ReviewIntent=wg("chat.advanced.review.intent","chat.review.intent",!1),s.NotebookSummaryExperimentEnabled=wg("chat.advanced.notebook.summaryExperimentEnabled","chat.notebook.summaryExperimentEnabled",!1),s.NotebookVariableFilteringEnabled=wg("chat.advanced.notebook.variableFilteringEnabled","chat.notebook.variableFilteringEnabled",!1),s.TerminalToDebuggerPatterns=wg("chat.advanced.debugTerminalCommandPatterns","chat.debugTerminalCommandPatterns",[]),s.WorkspaceRecordingEnabled=wg("chat.advanced.localWorkspaceRecording.enabled","chat.localWorkspaceRecording.enabled",!1),s.EditRecordingEnabled=wg("chat.advanced.editRecording.enabled","chat.editRecording.enabled",!1),s.CodeSearchAgentEnabled=wg("chat.advanced.codesearch.agent.enabled","chat.codesearch.agent.enabled",!0),s.AgentTemperature=wg("chat.advanced.agent.temperature","chat.agent.temperature",void 0),s.EnableUserPreferences=wg("chat.advanced.enableUserPreferences","chat.enableUserPreferences",!1),s.SummarizeAgentConversationHistoryThreshold=wg("chat.advanced.summarizeAgentConversationHistoryThreshold","chat.summarizeAgentConversationHistoryThreshold",void 0),s.AgentHistorySummarizationMode=wg("chat.advanced.agentHistorySummarizationMode","chat.agentHistorySummarizationMode",void 0),s.UseResponsesApiTruncation=wg("chat.advanced.useResponsesApiTruncation","chat.useResponsesApiTruncation",!1),s.OmitBaseAgentInstructions=wg("chat.advanced.omitBaseAgentInstructions","chat.omitBaseAgentInstructions",!1),s.CLIShowExternalSessions=dt("chat.cli.showExternalSessions",0,!0),s.CLIPlanExitModeEnabled=dt("chat.cli.planExitMode.enabled",0,!0),s.CLIAutoModelEnabled=dt("chat.cli.autoModel.enabled",0,!1),s.CLIModelDetailsEnabled=dt("chat.agent.modelDetails.enabled",0,!0),s.CLIPlanCommandEnabled=dt("chat.cli.planCommand.enabled",0,!0),s.CLIChatLazyLoadSessionItem=dt("chat.cli.lazyLoadSessionItem.enabled",0,!0),s.CLIAIGenerateBranchNames=dt("chat.cli.aiGenerateBranchNames.enabled",0,!0),s.CLIForkSessionsEnabled=dt("chat.cli.forkSessions.enabled",0,!0),s.CLIMCPServerEnabled=wg("chat.advanced.cli.mcp.enabled","chat.cli.mcp.enabled",!0),s.CLIBranchSupport=dt("chat.cli.branchSupport.enabled",0,!1),s.CLIIsolationOption=dt("chat.cli.isolationOption.enabled",0,!0),s.CLIAutoCommitEnabled=dt("chat.cli.autoCommit.enabled",0,!0),s.CLISessionController=dt("chat.cli.sessionController.enabled",0,!1),s.CLIThinkingEffortEnabled=dt("chat.cli.thinkingEffort.enabled",0,!0),s.CLIRemoteEnabled=dt("chat.cli.remote.enabled",0,!0),s.CLISessionControllerForSessionsApp=dt("chat.cli.sessionControllerForSessionsApp.enabled",0,!1),s.CLITerminalLinks=dt("chat.cli.terminalLinks.enabled",0,!0),s.RequestLoggerMaxEntries=wg("chat.advanced.debug.requestLogger.maxEntries","chat.debug.requestLogger.maxEntries",100),s.ProjectLabelsExpanded=hm("chat.advanced.projectLabels.expanded","chat.projectLabels.expanded",!1),s.ProjectLabelsChat=hm("chat.advanced.projectLabels.chat","chat.projectLabels.chat",!1),s.ProjectLabelsInline=hm("chat.advanced.projectLabels.inline","chat.projectLabels.inline",!1),s.WorkspaceMaxLocalIndexSize=hm("chat.advanced.workspace.maxLocalIndexSize","chat.workspace.maxLocalIndexSize",1e5),s.WorkspaceEnableCodeSearch=hm("chat.advanced.workspace.enableCodeSearch","chat.workspace.enableCodeSearch",!0),s.WorkspaceEnableCodeSearchExternalIngest=dt("chat.workspace.codeSearchExternalIngest.enabled",1,!0,void 0,void 0,{experimentName:"copilotchat.config.chat.advanced.workspace.codeSearchExternalIngest.enabled"}),s.WorkspacePreferredEmbeddingsModel=hm("chat.advanced.workspace.preferredEmbeddingsModel","chat.workspace.preferredEmbeddingsModel",""),s.NotebookAlternativeDocumentFormat=hm("chat.advanced.notebook.alternativeFormat","chat.notebook.alternativeFormat",ySa.AlternativeNotebookFormat.xml),s.UseAlternativeNESNotebookFormat=hm("chat.advanced.notebook.alternativeNESFormat.enabled","chat.notebook.alternativeNESFormat.enabled",!1),s.InlineChatReasoningEffort=dt("chat.inlineChat.reasoningEffort",1,"low"),s.InlineChatEnableThinking=dt("chat.inlineChat.enableThinking",1,!1),s.InstantApplyShortModelName=hm("chat.advanced.instantApply.shortContextModelName","chat.instantApply.shortContextModelName","gpt-4o-instant-apply-full-ft-v66-short"),s.InstantApplyShortContextLimit=hm("chat.advanced.instantApply.shortContextLimit","chat.instantApply.shortContextLimit",8e3),s.PromptFileContext=hm("chat.advanced.promptFileContextProvider.enabled","chat.promptFileContextProvider.enabled",!0),s.DefaultToolsGrouped=hm("chat.advanced.tools.defaultToolsGrouped","chat.tools.defaultToolsGrouped",!1),s.Gpt5AlternativePatch=hm("chat.advanced.gpt5AlternativePatch","chat.gpt5AlternativePatch",!1),s.SearchSubagentToolEnabled=dt("chat.searchSubagent.enabled",1,!1),s.SearchSubagentUseAgenticProxy=dt("chat.searchSubagent.useAgenticProxy",1,!1),s.SearchSubagentModel=dt("chat.searchSubagent.model",1,""),s.SearchSubagentToolCallLimit=dt("chat.searchSubagent.toolCallLimit",1,4),s.SearchSubagentThoroughnessEnabled=dt("chat.searchSubagent.thoroughnessEnabled",1,!1),s.ExecutionSubagentToolEnabled=dt("chat.executionSubagent.enabled",1,!1),s.SkillToolEnabled=dt("chat.skillTool.enabled",1,!1),s.GetChangedFilesToolEnabled=dt("chat.getChangedFilesTool.enabled",1,!1),s.ExecutionSubagentUseAgenticProxy=dt("chat.executionSubagent.useAgenticProxy",1,!1),s.ExecutionSubagentModel=dt("chat.executionSubagent.model",1,"gemini-3-flash"),s.ExecutionSubagentToolCallLimit=dt("chat.executionSubagent.toolCallLimit",1,10),s.BackgroundTodoAgentEnabled=dt("chat.agent.backgroundTodoAgent.enabled",1,!1),s.InlineEditsTriggerOnEditorChangeAfterSeconds=hm("chat.advanced.inlineEdits.triggerOnEditorChangeAfterSeconds","chat.inlineEdits.triggerOnEditorChangeAfterSeconds",10),s.InlineEditsNextCursorPredictionDisplayLine=hm("chat.advanced.inlineEdits.nextCursorPrediction.displayLine","chat.inlineEdits.nextCursorPrediction.displayLine",!0),s.InlineEditsNextCursorPredictionCurrentFileMaxTokens=hm("chat.advanced.inlineEdits.nextCursorPrediction.currentFileMaxTokens","chat.inlineEdits.nextCursorPrediction.currentFileMaxTokens",3e3),s.InlineEditsRenameSymbolSuggestions=dt("chat.inlineEdits.renameSymbolSuggestions",1,!0),s.InlineEditsPreferredModel=dt("nextEditSuggestions.preferredModel",1,"none"),s.InlineEditsAggressiveness=dt("nextEditSuggestions.eagerness",1,Tu.AggressivenessSetting.Default,Tu.AggressivenessSetting.VALIDATOR),s.DiagnosticsContextProvider=hm("chat.advanced.inlineEdits.diagnosticsContextProvider.enabled","chat.inlineEdits.diagnosticsContextProvider.enabled",!1),s.ChatSessionContextProvider=dt("chat.inlineEdits.chatSessionContextProvider.enabled",1,!1),s.Gemini3MultiReplaceString=dt("chat.edits.gemini3MultiReplaceString",1,!1),s.BatchReplaceStringDescriptions=dt("chat.edits.batchReplaceStringDescriptions",1,!1),s.AgentOmitFileAttachmentContents=dt("chat.agent.omitFileAttachmentContents",1,!1),s.InstallExtensionSkillEnabled=dt("chat.installExtensionSkill.enabled",1,!1),s.LargeToolResultsToDiskEnabled=dt("chat.agent.largeToolResultsToDisk.enabled",1,!0),s.LargeToolResultsToDiskThreshold=dt("chat.agent.largeToolResultsToDisk.thresholdBytes",1,8*1024),s.DebugGitHubAuthFailWith=dt("chat.debug.githubAuthFailWith",0,null),s.AgentDebugLogEnabled=hm("agentDebugLog.enabled","chat.agentDebugLog.enabled",!1),s.ChatDebugFileLogging=hm("chat.chatDebug.fileLogging.enabled","chat.agentDebugLog.fileLogging.enabled",!1),s.ChatDebugFileLoggingFlushInterval=wg("chat.chatDebug.fileLogging.flushIntervalMs","chat.agentDebugLog.fileLogging.flushIntervalMs",4e3),s.ChatDebugFileLoggingMaxRetainedSessionLogs=dt("chat.agentDebugLog.fileLogging.maxRetainedSessionLogs",1,50),s.ChatDebugFileLoggingMaxSessionLogSizeMB=dt("chat.agentDebugLog.fileLogging.maxSessionLogSizeMB",1,100),s.OTelEnabled=dt("chat.otel.enabled",0,!1),s.OTelExporterType=dt("chat.otel.exporterType",0,"otlp-http"),s.OTelOtlpEndpoint=dt("chat.otel.otlpEndpoint",0,"http://localhost:4318"),s.OTelCaptureContent=dt("chat.otel.captureContent",0,!1),s.OTelMaxAttributeSizeChars=dt("chat.otel.maxAttributeSizeChars",0,0),s.OTelOutfile=dt("chat.otel.outfile",0,""),s.OTelDbSpanExporter=dt("chat.otel.dbSpanExporter.enabled",0,!1),s.ReasoningEffortOverride=dt("chat.reasoningEffortOverride",0,null),s.LongToolCallCachePreservation=dt("chat.agent.longToolCallCachePreservation.enabled",1,!1),s.LongToolCallCachePreservationMaxProbes=dt("chat.agent.longToolCallCachePreservation.maxProbes",1,1),s.AnthropicExtendedCacheTtl=dt("chat.anthropic.promptCaching.extendedTtl",1,!1),s.AnthropicExtendedCacheTtlMessages=dt("chat.anthropic.promptCaching.extendedTtlMessages",1,!1),s.ModelCapabilityOverrides=dt("chat.modelCapabilityOverrides",0,{}),s.InlineEditsXtabProviderModelConfiguration=(()=>{let c="chat.advanced.inlineEdits.xtabProvider.modelConfiguration",l="chat.inlineEdits.xtabProvider.modelConfiguration";return eEr(l,c),dt(l,0,null,Tu.MODEL_CONFIGURATION_VALIDATOR,{oldKey:c})})()})(r=t.Advanced||(t.Advanced={}));let n;(function(s){s.DebugOverrideChatMaxTokenNum=Nt("chat.advanced.debug.overrideChatMaxTokenNum",0,0),s.DebugReportFeedback=Nt("chat.advanced.debug.reportFeedback",0,!1),s.DisableRepoInfoTelemetry=Nt("chat.advanced.debug.disableRepoInfoTelemetry",0,!1),s.InlineEditsIgnoreCompletionsDisablement=Nt("chat.advanced.inlineEdits.ignoreCompletionsDisablement",0,!1,(0,xg.vBoolean)()),s.InlineEditsModelPickerEnabled=Nt("chat.advanced.inlineEdits.modelPicker.enabled",1,!1,(0,xg.vBoolean)()),s.InlineEditsUseSlashModels=Nt("chat.advanced.inlineEdits.useSlashModels",1,!0),s.InlineEditsLogContextRecorderEnabled=Nt("chat.advanced.inlineEdits.logContextRecorder.enabled",0,!1),s.InlineEditsHideInternalInterface=Nt("chat.advanced.inlineEdits.hideInternalInterface",0,!1,(0,xg.vBoolean)()),s.InlineEditsLogCancelledRequests=Nt("chat.advanced.inlineEdits.logCancelledRequests",0,!1,(0,xg.vBoolean)()),s.InlineEditsNextCursorPredictionUrl=Nt("chat.advanced.inlineEdits.nextCursorPrediction.url",0,void 0,(0,xg.vString)()),s.InlineEditsNextCursorPredictionApiKey=Nt("chat.advanced.inlineEdits.nextCursorPrediction.apiKey",0,void 0,(0,xg.vString)()),s.InlineEditsXtabProviderUrl=Nt("chat.advanced.inlineEdits.xtabProvider.url",0,void 0,(0,xg.vString)()),s.InlineEditsXtabProviderApiKey=Nt("chat.advanced.inlineEdits.xtabProvider.apiKey",0,void 0,(0,xg.vString)()),s.InlineEditsNextCursorPredictionLintOptions=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptions",0,void 0,Tu.LINT_OPTIONS_VALIDATOR),s.InlineEditsInlineCompletionsEnabled=Nt("chat.advanced.inlineEdits.inlineCompletions.enabled",0,!0,(0,xg.vBoolean)()),s.InlineEditsInlineCompletionsAdvanced=Nt("chat.advanced.inlineEdits.inlineCompletions.advancedDetection",1,!0,(0,xg.vBoolean)()),s.InlineEditsNesMimicGhostTextBehavior=Nt("chat.advanced.inlineEdits.nesMimicGhostTextBehavior",1,!1,(0,xg.vBoolean)()),s.InlineEditsXtabProviderUsePrediction=Nt("chat.advanced.inlineEdits.xtabProvider.usePrediction",1,!0,(0,xg.vBoolean)()),s.InlineEditsXtabLanguageContextEnabledLanguages=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabledLanguages",0,N2.LANGUAGE_CONTEXT_ENABLED_LANGUAGES),s.InlineEditsXtabLanguageContextTraitsPosition=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.traitsPosition",1,"before"),s.InlineEditsDiagnosticsExplorationEnabled=Nt("chat.advanced.inlineEdits.inlineEditsDiagnosticsExplorationEnabled",0,!1),s.InternalWelcomeHintEnabled=Nt("chat.advanced.welcomePageHint.enabled",0,!1),s.InlineChatUseCodeMapper=Nt("chat.advanced.inlineChat.useCodeMapper",0,!1),s.EnablePromptRendererTracing=Nt("chat.advanced.promptRenderer.trace",0,!1),s.AgentSandboxEnabled=Nt("chat.advanced.agent.sandbox.enabled",1,!1),s.DebugCollectFetcherTelemetry=Nt("chat.advanced.debug.collectFetcherTelemetry",1,!0),s.DebugShowNetworkStatus=Nt("chat.advanced.debug.showNetworkStatus",1,!1),s.GeminiFunctionCallingMode=Nt("chat.advanced.gemini.functionCallingMode",1,"validated"),s.ModelProviderPreference=Nt("chat.advanced.modelProviderPreference",0,void 0,(0,xg.vString)()),s.UseVSCodeTelemetryLibForGH=Nt("chat.advanced.telemetry.useVSCodeTelemetryLibForGH",1,!1),s.DebugExpUseNodeFetchFetcher=Nt("chat.advanced.debug.useNodeFetchFetcher",1,void 0),s.DebugExpUseNodeFetcher=Nt("chat.advanced.debug.useNodeFetcher",1,void 0),s.DebugExpUseElectronFetcher=Nt("chat.advanced.debug.useElectronFetcher",1,void 0),s.InlineEditsAsyncCompletions=Nt("chat.advanced.inlineEdits.asyncCompletions",1,!0),s.InlineEditsEagerBackupRequest=Nt("chat.advanced.inlineEdits.eagerBackupRequest",1,!1),s.InlineEditsDebounceUseCoreRequestTime=Nt("chat.advanced.inlineEdits.debounceUseCoreRequestTime",1,!1),s.InlineEditsYieldToCopilot=Nt("chat.advanced.inlineEdits.yieldToCopilot",1,!1),s.InlineEditsExcludedProviders=Nt("chat.advanced.inlineEdits.excludedProviders",1,void 0),s.InlineEditsEnableGhCompletionsProvider=Nt("chat.advanced.inlineEdits.githubCompletionsProvider.enabled",1,!1),s.InlineEditsCompletionsUrl=Nt("chat.advanced.inlineEdits.completionsProvider.url",1,void 0),s.InlineEditsDebounce=Nt("chat.advanced.inlineEdits.debounce",1,100),s.InlineEditsCacheCursorDistanceCheck=Nt("chat.advanced.inlineEdits.cacheCursorDistanceCheck",1,!1),s.InlineEditsCacheDelay=Nt("chat.advanced.inlineEdits.cacheDelay",1,200),s.InlineEditsSubsequentCacheDelay=Nt("chat.advanced.inlineEdits.subsequentCacheDelay",1,0),s.InlineEditsSpeculativeRequestDelay=Nt("chat.advanced.inlineEdits.speculativeRequestDelay",1,0),s.InlineEditsRebasedCacheDelay=Nt("chat.advanced.inlineEdits.rebasedCacheDelay",1,0),s.InlineEditsAbsorbSubsequenceTyping=Nt("chat.advanced.inlineEdits.absorbSubsequenceTyping",1,!1),s.InlineEditsReverseAgreement=Nt("chat.advanced.inlineEdits.reverseAgreement",1,!0),s.InlineEditsMaxImperfectAgreementLength=Nt("chat.advanced.inlineEdits.maxImperfectAgreementLength",1,5,(0,xg.vNumber)()),s.InlineEditsBackoffDebounceEnabled=Nt("chat.advanced.inlineEdits.backoffDebounceEnabled",1,!0),s.InlineEditsExtraDebounceEndOfLine=Nt("chat.advanced.inlineEdits.extraDebounceEndOfLine",1,2e3),s.InlineEditsSpeculativeRequests=Nt("chat.advanced.inlineEdits.speculativeRequests",1,N2.SpeculativeRequestsEnablement.Off,N2.SpeculativeRequestsEnablement.VALIDATOR),s.InlineEditsSpeculativeRequestsCursorPlacement=Nt("chat.advanced.inlineEdits.speculativeRequestsCursorPlacement",1,N2.SpeculativeRequestsCursorPlacement.AfterEditApplied,N2.SpeculativeRequestsCursorPlacement.VALIDATOR),s.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.speculativeRequestsAutoExpandEditWindowLines",1,N2.SpeculativeRequestsAutoExpandEditWindowLines.Off,N2.SpeculativeRequestsAutoExpandEditWindowLines.VALIDATOR),s.InlineEditsExtraDebounceInlineSuggestion=Nt("chat.advanced.inlineEdits.extraDebounceInlineSuggestion",1,0),s.InlineEditsDebounceOnSelectionChange=Nt("chat.advanced.inlineEdits.debounceOnSelectionChange",1,void 0),s.InlineEditsTriggerOnEditorChangeStrategy=Nt("chat.advanced.inlineEdits.triggerOnEditorChangeStrategy",1,HCi.DocumentSwitchTriggerStrategy.AfterAcceptance,HCi.DocumentSwitchTriggerStrategy.VALIDATOR),s.InlineEditsProviderId=Nt("chat.advanced.inlineEdits.providerId",1,void 0),s.InlineEditsUnification=Nt("chat.advanced.inlineEdits.unification",1,!1),s.InlineEditsNextCursorPredictionModelName=Nt("chat.advanced.inlineEdits.nextCursorPrediction.modelName",1,void 0),s.InlineEditsNextCursorPredictionUseEndpointProvider=Nt("chat.advanced.inlineEdits.nextCursorPrediction.useEndpointProvider",0,!1,(0,xg.vBoolean)()),s.InlineEditsNextCursorPredictionMaxResponseTokens=Nt("chat.advanced.inlineEdits.nextCursorPrediction.maxResponseTokens",1,40),s.InlineEditsNextCursorPredictionLintOptionsString=Nt("chat.advanced.inlineEdits.nextCursorPrediction.lintOptionsString",1,void 0),s.InlineEditsXtabProviderModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.modelConfigurationString",1,void 0),s.InlineEditsXtabProviderDefaultModelConfigurationString=Nt("chat.advanced.inlineEdits.xtabProvider.defaultModelConfigurationString",1,void 0),s.InlineEditsXtabProviderUseVaryingLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.useVaryingLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesAbove=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesAbove",1,void 0),s.InlineEditsXtabProviderNLinesBelow=Nt("chat.advanced.inlineEdits.xtabProvider.nLinesBelow",1,void 0),s.InlineEditsAutoExpandEditWindowLines=Nt("chat.advanced.inlineEdits.autoExpandEditWindowLines",1,10),s.InlineEditsXtabNRecentlyViewedDocuments=Nt("chat.advanced.inlineEdits.xtabProvider.nRecentlyViewedDocuments",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.nDocuments),s.InlineEditsXtabRecentlyViewedDocumentsMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.maxTokens",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.maxTokens),s.InlineEditsXtabRecentlyViewedIncludeLineNumbers=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.includeLineNumbers",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeLineNumbers),s.InlineEditsNextCursorPredictionRecentSnippetsIncludeLineNumbers=Nt("chat.advanced.inlineEdits.nextCursorPrediction.recentSnippets.includeLineNumbers",1,Tu.IncludeLineNumbersOption.None),s.InlineEditsXtabDiffNEntries=Nt("chat.advanced.inlineEdits.xtabProvider.diffNEntries",1,Tu.DEFAULT_OPTIONS.diffHistory.nEntries),s.InlineEditsXtabDiffMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.diffMaxTokens",1,Tu.DEFAULT_OPTIONS.diffHistory.maxTokens),s.InlineEditsXtabDiffMergeStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeStrategy",1,GCi.DiffHistoryMergeStrategy.SameStartLine,GCi.DiffHistoryMergeStrategy.VALIDATOR),s.InlineEditsXtabDiffMergeLineGap=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeLineGap",1,0,(0,xg.vNumber)()),s.InlineEditsXtabDiffMergeSplitAfterMs=Nt("chat.advanced.inlineEdits.xtabProvider.diffMergeSplitAfterMs",1,100,(0,xg.vNumber)()),s.InlineEditsXtabProviderEmitFastCursorLineChange=Nt("chat.advanced.inlineEdits.xtabProvider.emitFastCursorLineChange",1,"additiveOnly"),s.InlineEditsXtabIncludeViewedFiles=Nt("chat.advanced.inlineEdits.xtabProvider.includeViewedFiles",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.includeViewedFiles),s.InlineEditsXtabRecentlyViewedClippingStrategy=Nt("chat.advanced.inlineEdits.xtabProvider.recentlyViewedDocuments.clippingStrategy",1,Tu.DEFAULT_OPTIONS.recentlyViewedDocuments.clippingStrategy,Tu.RecentFileClippingStrategy.VALIDATOR),s.InlineEditsXtabPageSize=Nt("chat.advanced.inlineEdits.xtabProvider.pageSize",1,Tu.DEFAULT_OPTIONS.pagedClipping.pageSize),s.InlineEditsXtabEditWindowMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.editWindowMaxTokens",1,2e3),s.InlineEditsXtabIncludeTagsInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeTagsInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeTags),s.InlineEditsXtabIncludeLineNumbersInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeLineNumbersInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeLineNumbers),s.InlineEditsXtabIncludeCursorTagInCurrentFile=Nt("chat.advanced.inlineEdits.xtabProvider.includeCursorTagInCurrentFile",1,Tu.DEFAULT_OPTIONS.currentFile.includeCursorTag),s.InlineEditsXtabCurrentFileMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.currentFileMaxTokens",1,Tu.DEFAULT_OPTIONS.currentFile.maxTokens),s.InlineEditsXtabPrioritizeAboveCursor=Nt("chat.advanced.inlineEdits.xtabProvider.currentFile.prioritizeAboveCursor",1,Tu.DEFAULT_OPTIONS.currentFile.prioritizeAboveCursor),s.InlineEditsXtabDiffOnlyForDocsInPrompt=Nt("chat.advanced.inlineEdits.xtabProvider.diffOnlyForDocsInPrompt",1,Tu.DEFAULT_OPTIONS.diffHistory.onlyForDocsInPrompt),s.InlineEditsXtabDiffUseRelativePaths=Nt("chat.advanced.inlineEdits.xtabProvider.diffUseRelativePaths",1,Tu.DEFAULT_OPTIONS.diffHistory.useRelativePaths),s.InlineEditsXtabNNonSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nNonSignificantLinesToConverge",1,$Ci.ResponseProcessor.DEFAULT_DIFF_PARAMS.nLinesToConverge),s.InlineEditsXtabNSignificantLinesToConverge=Nt("chat.advanced.inlineEdits.xtabProvider.nSignificantLinesToConverge",1,$Ci.ResponseProcessor.DEFAULT_DIFF_PARAMS.nSignificantLinesToConverge),s.InlineEditsXtabEarlyCursorLineDivergenceCancellation=Nt("chat.advanced.inlineEdits.xtabProvider.earlyCursorLineDivergenceCancellation",1,N2.EarlyDivergenceCancellationMode.Off,N2.EarlyDivergenceCancellationMode.VALIDATOR),s.InlineEditsXtabLanguageContextEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.enabled",1,Tu.DEFAULT_OPTIONS.languageContext.enabled),s.InlineEditsXtabLanguageContextMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.languageContext.maxTokens",1,Tu.DEFAULT_OPTIONS.languageContext.maxTokens),s.InlineEditsXtabIncludeNeighborFiles=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.enabled",1,Tu.DEFAULT_OPTIONS.neighborFiles.enabled),s.InlineEditsXtabNeighborFilesMaxTokens=Nt("chat.advanced.inlineEdits.xtabProvider.neighborFiles.maxTokens",1,Tu.DEFAULT_OPTIONS.neighborFiles.maxTokens),s.InlineEditsXtabGlobalBudgetEnabled=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.enabled",1,!1),s.InlineEditsXtabGlobalBudgetTotalTokens=Nt("chat.advanced.inlineEdits.xtabProvider.globalBudget.totalTokens",1,Tu.GlobalBudgetOptions.DEFAULT_TOTAL_TOKENS),s.InlineEditsXtabMaxMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.maxMergeConflictLines",1,void 0),s.InlineEditsXtabOnlyMergeConflictLines=Nt("chat.advanced.inlineEdits.xtabProvider.onlyMergeConflictLines",1,!1),s.InlineEditsXtabDuplicateAdditionsMode=Nt("chat.advanced.inlineEdits.xtabProvider.diffPatch.duplicateAdditionsMode",1,N2.DuplicateAdditionsMode.Off,N2.DuplicateAdditionsMode.VALIDATOR),s.InlineEditsXtabAggressivenessLevel=Nt("chat.advanced.inlineEdits.xtabProvider.aggressivenessLevel",1,void 0),s.InlineEditsAggressivenessLowMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.lowMinResponseTimeMs",1,1500),s.InlineEditsAggressivenessMediumMinResponseTimeMs=Nt("chat.advanced.inlineEdits.aggressiveness.mediumMinResponseTimeMs",1,700),s.InlineEditsAggressivenessHighDebounceMs=Nt("chat.advanced.inlineEdits.aggressiveness.highDebounceMs",1,0),s.InlineEditsUserHappinessScoreConfigurationString=Nt("chat.advanced.inlineEdits.adaptiveAggressivenessConfigurationString",1,void 0),s.InlineEditsUndoInsertionFiltering=Nt("chat.advanced.inlineEdits.undoInsertionFiltering",1,"v1"),s.InlineEditsFilterOutEditsWithSubstrings=Nt("chat.advanced.inlineEdits.filterOutEditsWithSubstrings",1,"<|current_file_content|>,<|/current_file_content|>,<|diff_marker|>"),s.InlineEditsAllowImportChanges=Nt("chat.advanced.inlineEdits.allowImportChanges",1,qCi.ImportChanges.None,qCi.ImportChanges.VALIDATOR),s.InlineEditsIgnoreWhenSuggestVisible=Nt("chat.advanced.inlineEdits.ignoreWhenSuggestVisible",1,!0),s.InlineEditsJointCompletionsProviderEnabled=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.enabled",1,!1),s.InlineEditsJointCompletionsProviderStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.strategy",1,jCi.JointCompletionsProviderStrategy.Regular),s.InlineEditsJointCompletionsProviderTriggerChangeStrategy=Nt("chat.advanced.inlineEdits.jointCompletionsProvider.triggerChangeStrategy",1,jCi.JointCompletionsProviderTriggerChangeStrategy.NoTriggerOnCompletionsRequestInFlight),s.InstantApplyModelName=Nt("chat.advanced.instantApply.modelName",1,"gpt-4o-instant-apply-full-ft-v66"),s.VerifyTextDocumentChanges=Nt("chat.advanced.inlineEdits.verifyTextDocumentChanges",1,!1),s.UseAutoModeRouting=Nt("chat.advanced.useAutoModeRouter",1,!1),s.AutoModeRoutingMethod=Nt("chat.advanced.autoModeRoutingMethod",1,"",void 0,void 0,{experimentName:"copilotchat.autoModeRoutingMethod"}),s.InlineCompletionsDefaultDiagnosticsOptions=Nt("chat.advanced.inlineCompletions.defaultDiagnosticsOptionsString",1,void 0),s.RecordExpectedEditEnabled=Nt("chat.advanced.inlineEdits.recordExpectedEdit.enabled",0,!1),s.RecordExpectedEditOnReject=Nt("chat.advanced.inlineEdits.recordExpectedEdit.onReject",0,!1),s.ReadFileCodeFences=Nt("chat.advanced.readFileCodeFences",1,!1),s.EnableReadFileV2=dt("chat.advanced.enableReadFileV2",1,!1),s.AskAgent=dt("chat.advanced.enableAskAgent",1,!1),s.RetryNetworkErrors=dt("chat.advanced.enableRetryNetworkErrors",1,!0),s.RetryServerErrorStatusCodes=dt("chat.advanced.retryServerErrorStatusCodes",1,"500,502"),s.FallbackNodeFetchOnNetworkProcessCrash=dt("chat.advanced.enableFallbackNodeFetchOnNetworkProcessCrash",1,!0),s.ChatRequestPowerSaveBlocker=Nt("chat.advanced.chatRequestPowerSaveBlocker",1,!0),s.ResponsesApiWebSocketEnabled=Nt("chat.advanced.responsesApi.webSocket.enabled",1,!0),s.DebugSimulateWebSocketResponse=Nt("chat.advanced.debug.simulateWebSocketResponse",0,""),s.SessionSyncMaxEventsPerFlush=Nt("chat.advanced.sessionSync.maxEventsPerFlush",1,500),s.SessionSyncSafetyIntervalMs=Nt("chat.advanced.sessionSync.safetyIntervalMs",1,6e4)})(n=t.TeamInternal||(t.TeamInternal={}));let o;(function(s){s.PlanAgentModel=dt("chat.planAgent.model",0,""),s.OllamaEndpoint=dt("chat.byok.ollamaEndpoint",0,"http://localhost:11434"),s.AzureModels=dt("chat.azureModels",0,{}),s.CustomOAIModels=dt("chat.customOAIModels",0,{}),s.AzureAuthType=dt("chat.azureAuthType",0,IMe.EntraId)})(o=t.Deprecated||(t.Deprecated={})),t.Enable=dt("enable",0,{"*":!0,plaintext:!1,markdown:!1,scminput:!1}),t.selectedCompletionsModel=dt("selectedCompletionModel",0,""),t.RateLimitAutoSwitchToAuto=dt("chat.rateLimitAutoSwitchToAuto",0,!1,(0,xg.vBoolean)()),t.UseAnthropicMessagesApi=dt("chat.anthropic.useMessagesApi",1,!0),t.AnthropicContextEditingMode=dt("chat.anthropic.contextEditing.mode",1,"off"),t.ResponsesApiReasoningSummary=dt("chat.responsesApiReasoningSummary",1,"detailed"),t.ResponsesApiContextManagementEnabled=dt("chat.responsesApiContextManagement.enabled",1,!1),t.ResponsesApiPromptCacheKeyEnabled=dt("chat.responsesApi.promptCacheKey.enabled",1,!1),t.Updated53CodexPromptEnabled=dt("chat.updated53CodexPrompt.enabled",1,!0),t.Claude47OpusPromptEnabled=dt("chat.claude47OpusPrompt.enabled",1,!1),t.EnableGpt55GetChangedFilesTool=dt("chat.gpt55GetChangedFilesTool.enabled",1,!0),t.EnableGemini3GetChangedFilesTool=dt("chat.gemini3GetChangedFilesTool.enabled",1,!0),t.EnableGpt55ReadFileTool=dt("chat.gpt55ReadFileTool.enabled",1,!0),t.EnableGpt55EconomicalSearchAndEdit=dt("chat.gpt55EconomicalSearchAndEdit.enabled",1,!1),t.EnableGpt55LargePromptSections=dt("chat.gpt55LargePromptSections.enabled",1,!1),t.EnableChatImageUpload=dt("chat.imageUpload.enabled",1,!0),t.AnthropicWebSearchToolEnabled=dt("chat.anthropic.tools.websearch.enabled",1,!1),t.AnthropicWebSearchMaxUses=dt("chat.anthropic.tools.websearch.maxUses",0,5),t.AnthropicWebSearchAllowedDomains=dt("chat.anthropic.tools.websearch.allowedDomains",0,[]),t.AnthropicWebSearchBlockedDomains=dt("chat.anthropic.tools.websearch.blockedDomains",0,[]),t.AnthropicWebSearchUserLocation=dt("chat.anthropic.tools.websearch.userLocation",0,null),t.CodeGenerationInstructions=dt("chat.codeGeneration.instructions",0,[]),t.TestGenerationInstructions=dt("chat.testGeneration.instructions",0,[]),t.CommitMessageGenerationInstructions=dt("chat.commitMessageGeneration.instructions",0,[]),t.PullRequestDescriptionGenerationInstructions=dt("chat.pullRequestDescriptionGeneration.instructions",0,[]),t.SetupTests=dt("chat.setupTests.enabled",0,!0),t.TypeScriptLanguageContext=dt("chat.languageContext.typescript.enabled",1,!0),t.TypeScriptLanguageContextMode=dt("chat.languageContext.typescript.items",1,"double"),t.TypeScriptLanguageContextIncludeDocumentation=dt("chat.languageContext.typescript.includeDocumentation",1,!1),t.TypeScriptLanguageContextCacheTimeout=dt("chat.languageContext.typescript.cacheTimeout",1,500),t.TypeScriptLanguageContextFix=dt("chat.languageContext.fix.typescript.enabled",1,!1),t.TypeScriptLanguageContextInline=dt("chat.languageContext.inline.typescript.enabled",1,!1),t.UseInstructionFiles=dt("chat.codeGeneration.useInstructionFiles",0,!0),t.ReviewAgent=dt("chat.reviewAgent.enabled",0,!0),t.CodeFeedback=dt("chat.reviewSelection.enabled",0,!0),t.CodeFeedbackInstructions=dt("chat.reviewSelection.instructions",0,[]),t.UseProjectTemplates=dt("chat.useProjectTemplates",0,!0),t.ExplainScopeSelection=dt("chat.scopeSelection",0,!1),t.EnableCodeActions=dt("editor.enableCodeActions",0,!0),t.LocaleOverride=dt("chat.localeOverride",0,"auto"),t.TerminalChatLocation=dt("chat.terminalChatLocation",0,"chatView"),t.AutomaticRenameSuggestions=dt("renameSuggestions.triggerAutomatically",0,!0),t.TerminalToDebuggerEnabled=dt("chat.copilotDebugCommand.enabled",0,!0),t.CodeSearchAgentEnabled=dt("chat.codesearch.enabled",0,!1),t.ClaudeAgentEnabled=dt("chat.claudeAgent.enabled",0,!0),t.ClaudeAgentAllowDangerouslySkipPermissions=dt("chat.claudeAgent.allowDangerouslySkipPermissions",0,!1),t.ClaudeAgentAllowAutoPermissions=dt("chat.claudeAgent.allowAutoPermissions",1,!1),t.ClaudeAgentUseSdkExtension=dt("chat.claudeAgent.useSdkExtension",1,!1),t.ClaudeAgentSdkExtensionInstallTimeout=dt("chat.claudeAgent.sdkExtensionInstallTimeout",0,12e4),t.InlineEditsEnabled=dt("nextEditSuggestions.enabled",1,!0),t.InlineEditsEnableDiagnosticsProvider=dt("nextEditSuggestions.fixes",1,!0),t.InlineEditsAllowWhitespaceOnlyChanges=dt("nextEditSuggestions.allowWhitespaceOnlyChanges",1,!0),t.InlineEditsNextCursorPredictionEnabled=dt("nextEditSuggestions.extendedRange",1,!0,void 0,{oldKey:"chat.advanced.inlineEdits.nextCursorPrediction.enabled"}),t.NewWorkspaceCreationAgentEnabled=dt("chat.newWorkspaceCreation.enabled",0,!0),t.NewWorkspaceUseContext7=dt("chat.newWorkspace.useContext7",0,!1),t.SummarizeAgentConversationHistory=dt("chat.summarizeAgentConversationHistory.enabled",0,!0),t.VirtualToolThreshold=dt("chat.virtualTools.threshold",1,Uo.HARD_TOOL_LIMIT),t.CurrentEditorAgentContext=dt("chat.agent.currentEditorContext.enabled",0,!0),t.AutoFixDiagnostics=dt("chat.agent.autoFix",1,!1),t.NotebookFollowCellExecution=dt("chat.notebook.followCellExecution.enabled",0,!1),t.UseAlternativeNESNotebookFormat=dt("chat.notebook.enhancedNextEditSuggestions.enabled",1,!1),t.CustomInstructionsInSystemMessage=dt("chat.customInstructionsInSystemMessage",0,!0),t.EnableAlternateGptPrompt=dt("chat.alternateGptPrompt.enabled",1,!1),t.EnableAlternateGeminiModelFPrompt=dt("chat.alternateGeminiModelFPrompt.enabled",1,!1),t.EnableOrganizationCustomAgents=dt("chat.organizationCustomAgents.enabled",0,!0),t.EnableOrganizationInstructions=dt("chat.organizationInstructions.enabled",0,!0),t.CompletionsFetcher=dt("chat.completionsFetcher",1,void 0),t.NextEditSuggestionsFetcher=dt("chat.nesFetcher",1,void 0),t.GitHubMcpEnabled=dt("chat.githubMcpServer.enabled",1,!1),t.GitHubMcpToolsets=dt("chat.githubMcpServer.toolsets",0,["default"]),t.GitHubMcpReadonly=dt("chat.githubMcpServer.readonly",0,!1),t.GitHubMcpLockdown=dt("chat.githubMcpServer.lockdown",0,!1),t.GitHubMcpChannel=dt("chat.githubMcpServer.channel",0,"stable"),t.BackgroundAgentEnabled=dt("chat.backgroundAgent.enabled",0,!0),t.CloudAgentEnabled=dt("chat.cloudAgent.enabled",0,!0),t.CloudAgentBackendVersion=dt("chat.cloudAgentBackend.version",0,"v1"),t.AdditionalReadAccessPaths=dt("chat.additionalReadAccessPaths",0,[]),t.SwitchAgentEnabled=dt("chat.switchAgent.enabled",1,!1),t.PlanAgentAdditionalTools=dt("chat.planAgent.additionalTools",0,[]),t.ImplementAgentModel=dt("chat.implementAgent.model",0,""),t.AskAgentAdditionalTools=dt("chat.askAgent.additionalTools",0,[]),t.AskAgentModel=dt("chat.askAgent.model",0,""),t.ExploreAgentEnabled=dt("chat.exploreAgent.enabled",1,!0),t.ExploreAgentModel=dt("chat.exploreAgent.model",0,""),t.ViewImageToolEnabled=dt("chat.tools.viewImage.enabled",1,!0),t.LocalIndexEnabled=dt("chat.localIndex.enabled",1,!1)})(Xyr||(Uo.ConfigKey=Xyr={}));function _Sa(){return Object.values(Xyr).flatMap(t=>Object.values(t).map(e=>e.fullyQualifiedId))}a(_Sa,"getAllConfigKeys");var vSa=[];function CSa(t){return vSa.push(t),t}a(CSa,"registerNextEditProviderId")});var Ap=I(XA=>{"use strict";p();Object.defineProperty(XA,"__esModule",{value:!0});XA.LogMemory=XA.LogServiceImpl=XA.ConsoleLog=XA.LogTarget=XA.LogLevel=XA.ILogService=void 0;XA.collectErrorMessages=YCi;XA.collectSingleLineErrorMessage=TSa;XA.sanitizeNetworkErrorForTelemetry=ISa;var bSa=tn(),SSa=Io();XA.ILogService=(0,bSa.createServiceIdentifier)("ILogService");var vE;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(vE||(XA.LogLevel=vE={}));var zCi;(function(t){function e(r){return{logIt:r}}a(e,"fromCallback"),t.fromCallback=e})(zCi||(XA.LogTarget=zCi={}));var tEr=class{static{a(this,"ConsoleLog")}constructor(e,r=vE.Warning){this.prefix=e,this.minLogLevel=r}logIt(e,r,...n){this.prefix&&(r=`${this.prefix}${r}`),e===vE.Error?console.error(r,...n):e===vE.Warning?console.warn(r,...n):e>=this.minLogLevel&&console.log(r,...n)}};XA.ConsoleLog=tEr;var rEr=class extends SSa.Disposable{static{a(this,"LogServiceImpl")}constructor(e){super(),this.logger=new nEr(e)}trace(e){this.logger.trace(e)}debug(e){this.logger.debug(e)}info(e){this.logger.info(e)}warn(e){this.logger.warn(e)}error(e,r){this.logger.error(e,r)}show(e){this.logger.show(e)}createSubLogger(e){return this.logger.createSubLogger(e)}withExtraTarget(e){return this.logger.withExtraTarget(e)}};XA.LogServiceImpl=rEr;var nEr=class{static{a(this,"LoggerImpl")}constructor(e){this._logTargets=e}_logIt(e,r){s0t.addLog(vE[e],r),this._logTargets.forEach(n=>n.logIt(e,r))}trace(e){this._logIt(vE.Trace,e)}debug(e){this._logIt(vE.Debug,e)}info(e){this._logIt(vE.Info,e)}warn(e){this._logIt(vE.Warning,e)}error(e,r){this._logIt(vE.Error,YCi(e)+(r?`: ${r}`:""))}show(e){this._logTargets.forEach(r=>r.show?.(e))}createSubLogger(e){return new iEr(this,e)}withExtraTarget(e){return new o0t(this,[e])}},iEr=class t{static{a(this,"SubLogger")}constructor(e,r,n){this._parent=e;let s=(Array.isArray(r)?r:[r]).map(c=>`[${c}]`).join("");this._prefix=n?n+s:s}_prefixMessage(e){return`${this._prefix} ${e}`}trace(e){this._parent.trace(this._prefixMessage(e))}debug(e){this._parent.debug(this._prefixMessage(e))}info(e){this._parent.info(this._prefixMessage(e))}warn(e){this._parent.warn(this._prefixMessage(e))}error(e,r){let n=r?this._prefixMessage(r):this._prefix;this._parent.error(e,n)}show(e){this._parent.show(e)}createSubLogger(e){return new t(this._parent,e,this._prefix)}withExtraTarget(e){return new o0t(this,[e],this._prefix)}},o0t=class t{static{a(this,"LoggerWithExtraTargets")}constructor(e,r,n=""){this._parent=e,this._extraTargets=r,this._prefix=n}_notifyExtraTargets(e,r){let n=this._prefix?`${this._prefix} ${r}`:r;for(let o of this._extraTargets)try{o.logIt(e,n)}catch{}}trace(e){this._notifyExtraTargets(vE.Trace,e),this._parent.trace(e)}debug(e){this._notifyExtraTargets(vE.Debug,e),this._parent.debug(e)}info(e){this._notifyExtraTargets(vE.Info,e),this._parent.info(e)}warn(e){this._notifyExtraTargets(vE.Warning,e),this._parent.warn(e)}error(e,r){let n=typeof e=="string"?e:e.message||"Error",o=r?`${n}: ${r}`:n;this._notifyExtraTargets(vE.Error,o),this._parent.error(e,r)}show(e){this._parent.show(e);for(let r of this._extraTargets)try{r.show?.(e)}catch{}}createSubLogger(e){let r=Array.isArray(e)?e:[e],n=this._prefix+r.map(o=>`[${o}]`).join("");return new t(this._parent.createSubLogger(e),this._extraTargets,n)}withExtraTarget(e){return new t(this._parent,[...this._extraTargets,e],this._prefix)}};function YCi(t){let e=new Set;function r(n,o){if(!n||!["object","string"].includes(typeof n)||e.has(n))return"";e.add(n);let c=(typeof n=="string"?n:n.stack||n.message||n.code||"").toString?.()||"";return[c?`${c.split(` `).map(l=>`${o}${l}`).join(` `)} -`:"",n.chromiumDetails?`${o}${JSON.stringify(Evi(n.chromiumDetails))} -`:"",r(n.cause,o+" "),...Array.isArray(n.errors)?n.errors.map(l=>r(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(yvi,"collectErrorMessages");function rTa(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` -`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(Evi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(rTa,"collectSingleLineErrorMessage");function nTa(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(nTa,"sanitizeNetworkErrorForTelemetry");function Evi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(Evi,"extractChromiumDetails");var i0t=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};zA.LogMemory=i0t});var UMe=I(FMe=>{"use strict";p();Object.defineProperty(FMe,"__esModule",{value:!0});FMe.ICopilotTokenManager=void 0;FMe.nowSeconds=oTa;var iTa=rn();FMe.ICopilotTokenManager=(0,iTa.createServiceIdentifier)("ICopilotTokenManager");function oTa(){return Math.floor(Date.now()/1e3)}a(oTa,"nowSeconds")});var SE=I(u0=>{"use strict";p();var sTa=u0&&u0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},o0t=u0&&u0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(u0,"__esModule",{value:!0});u0.BaseAuthenticationService=u0.IAuthenticationService=u0.MinimalModeError=u0.GITHUB_SCOPE_ALIGNED=u0.GITHUB_SCOPE_READ_USER=u0.GITHUB_SCOPE_USER_EMAIL=void 0;u0.authProviderId=pTa;var aTa=rn(),Zyr=Sc(),cTa=ko(),lTa=HF(),bee=Il(),uTa=pp(),dTa=UMe(),fTa=_H();u0.GITHUB_SCOPE_USER_EMAIL=["user:email"];u0.GITHUB_SCOPE_READ_USER=["read:user"];u0.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var Xyr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};u0.MinimalModeError=Xyr;u0.IAuthenticationService=(0,aTa.createServiceIdentifier)("IAuthenticationService");var eEr=class extends cTa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new Zyr.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidAccessTokenChange=this._register(new Zyr.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new Zyr.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,lTa.derived)(s=>this._configurationService.getConfigObservable(bee.ConfigKey.Shared.AuthPermissions).read(s)===bee.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=r,this._copilotTokenError=void 0,r}catch(r){this._tokenStore.copilotToken=void 0;let n=this._copilotTokenError;throw this._copilotTokenError=r,n&&r&&n.message!==r.message&&this.fireAuthenticationChange("getCopilotToken error change"),r}}resetCopilotToken(e){this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e)}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=this._tokenStore.copilotToken,s=this._copilotTokenError,c=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let l of c)l.status==="rejected"&&this._logService.error(`Error getting a session: ${l.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed, minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken.");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}(o?.token!==this._tokenStore.copilotToken?.token||s?.message!==this._copilotTokenError?.message)&&(this._logService.debug("CopilotToken state changed, firing event."),this.fireAuthenticationChange("handleAuthChangeEvent")),this._logService.debug("Finished handling auth change event.")}};u0.BaseAuthenticationService=eEr;u0.BaseAuthenticationService=eEr=sTa([o0t(0,uTa.ILogService),o0t(1,fTa.ICopilotTokenStore),o0t(2,dTa.ICopilotTokenManager),o0t(3,bee.IConfigurationService)],eEr);function pTa(t){return t.getConfig(bee.ConfigKey.Shared.AuthProvider)===bee.AuthProviderId.GitHubEnterprise?bee.AuthProviderId.GitHubEnterprise:bee.AuthProviderId.GitHub}a(pTa,"authProviderId")});var s0t=I(tEr=>{"use strict";p();Object.defineProperty(tEr,"__esModule",{value:!0});tEr.onCopilotToken=hTa;function hTa(t,e){return t.onDidAuthenticationChange(()=>{let r=t.copilotToken;r&&e(r)})}a(hTa,"onCopilotToken")});var nEr=I(B2=>{"use strict";p();var mTa=B2&&B2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},gTa=B2&&B2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(B2,"__esModule",{value:!0});B2.TelemetryUserConfig=B2.ICompletionsTelemetryUserConfigService=void 0;var ATa=SE(),yTa=rn(),ETa=ko(),_Ta=s0t();function CTa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(CTa,"propertiesFromCopilotToken");B2.ICompletionsTelemetryUserConfigService=(0,yTa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var rEr=class extends ETa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,_Ta.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=CTa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};B2.TelemetryUserConfig=rEr;B2.TelemetryUserConfig=rEr=mTa([gTa(0,ATa.IAuthenticationService)],rEr)});var QMe=I(lme=>{"use strict";p();Object.defineProperty(lme,"__esModule",{value:!0});lme.PromiseQueue=lme.ICompletionsPromiseQueueService=void 0;var vTa=rn();lme.ICompletionsPromiseQueueService=(0,vTa.createServiceIdentifier)("completionsPromiseQueueService");var iEr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};lme.PromiseQueue=iEr});var Tg=I(ud=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.TelemetryReporters=ud.ICompletionsTelemetryReporters=ud.CopilotTelemetryReporter=ud.TelemetryWithExp=ud.TelemetryData=ud.TelemetryStore=void 0;ud.telemetrizePromptLength=MTa;ud.now=dme;ud.telemetry=pEr;ud.telemetryExpProblem=LTa;ud.telemetryRaw=UTa;ud.telemetryException=vvi;ud.telemetryCatch=QTa;ud.telemetryError=qTa;ud.logEngineCompletion=HTa;ud.logEnginePrompt=GTa;var bTa=a4(),STa=rn(),TTa=um(),cEr=Qs(),a0t=See(),c4=vE(),ITa=Dht(),xTa=VA(),wTa=Mht(),RTa=kyr(),lEr=nEr(),uEr=QMe(),kT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(kT||(ud.TelemetryStore=kT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(kT||(ud.TelemetryStore=kT={}));function ume(t){return t===kT.Enhanced}a(ume,"isEnhanced");var kTa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],qMe=8192,PTa=21,l4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[RTa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},dme())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=dme())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(xTa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(bTa.IEnvService),n=e.get(c4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,c4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,c4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${c4.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,c4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,c4.dumpForTelemetry)(e);r["copilot.build"]=c4.BuildInfo.getBuild(),r["copilot.buildType"]=c4.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(ume(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>qMe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+qMe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(MTa,"telemetrizePromptLength");function dme(){return performance.now()}a(dme,"now");function OTa(t){return Math.floor(t/1e3)}a(OTa,"nowSeconds");function fEr(t){return t.get(lEr.ICompletionsTelemetryUserConfigService).optedIn}a(fEr,"shouldSendEnhanced");function _vi(t){return t.get(lEr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(_vi,"shouldSendFinetuningTelemetry");function pEr(t,e,r,n){return t.get(uEr.ICompletionsPromiseQueueService).register(BTa(t,e,dme(),r?.extendedBy(),n))}a(pEr,"telemetry");async function BTa(t,e,r,n,o=kT.Standard){let s=t.get(a0t.ICompletionsTelemetryService),c=t.get(cEr.IInstantiationService),l=n||l4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!ume(o)||c.invokeFunction(fEr))&&dEr(s,o,e,l),ume(o)&&kTa.includes(e)&&c.invokeFunction(_vi)&&c.invokeFunction(NTa,o,e,l)}a(BTa,"_telemetry");function LTa(t,e){return t.get(uEr.ICompletionsPromiseQueueService).register(FTa(t,e,dme()))}a(LTa,"telemetryExpProblem");async function FTa(t,e,r){let n=t.get(a0t.ICompletionsTelemetryService),o="expProblem",s=l4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,kT.Standard,"SkipExp",r),dEr(n,kT.Standard,o,s)}a(FTa,"_telemetryExpProblem");function UTa(t,e,r,n){let o=t.get(a0t.ICompletionsTelemetryService),s={...r,...Cvi(t)};dEr(o,kT.Standard,e,{properties:s,measurements:n})}a(UTa,"telemetryRaw");function Cvi(t){let e=t.get(c4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,TTa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,c4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(lEr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(Cvi,"createRequiredProperties");function vvi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(vvi,"telemetryException");function QTa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){vvi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(QTa,"telemetryCatch");function qTa(t,e,r,n){return t.get(uEr.ICompletionsPromiseQueueService).register(jTa(t,e,dme(),r?.extendedBy(),n))}a(qTa,"telemetryError");async function jTa(t,e,r,n,o=kT.Standard){if(ume(o)&&!fEr(t))return;let s=t.get(cEr.IInstantiationService),c=n||l4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(DTa,o,e,c)}a(jTa,"_telemetryError");function HTa(t,e,r,n,o){let s=l4.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),pEr(t,"engine.completion",s,kT.Enhanced)}a(HTa,"logEngineCompletion");function GTa(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return pEr(t,"engine.prompt",o,kT.Enhanced)}a(GTa,"logEnginePrompt");var sEr=class{static{a(this,"CopilotTelemetryReporter")}};ud.CopilotTelemetryReporter=sEr;ud.ICompletionsTelemetryReporters=(0,STa.createServiceIdentifier)("ICompletionsTelemetryReporters");var aEr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=kT.Standard){return ume(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(fEr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};ud.TelemetryReporters=aEr});var See=I(L2=>{"use strict";p();var $Ta=L2&&L2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},VTa=L2&&L2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(L2,"__esModule",{value:!0});L2.CompletionsTelemetryServiceBridge=L2.ICompletionsTelemetryService=void 0;var WTa=o0(),hEr=Cyr(),zTa=rn(),jMe=Tg();L2.ICompletionsTelemetryService=(0,zTa.createServiceIdentifier)("completionsTelemetryService");var mEr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,hEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??jMe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??jMe.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return jMe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};L2.CompletionsTelemetryServiceBridge=mEr;L2.CompletionsTelemetryServiceBridge=mEr=$Ta([VTa(0,WTa.ITelemetryService)],mEr)});var bvi=I(fme=>{"use strict";p();Object.defineProperty(fme,"__esModule",{value:!0});fme.CopilotExtensionStatus=fme.ICompletionsExtensionStatus=void 0;var YTa=rn();fme.ICompletionsExtensionStatus=(0,YTa.createServiceIdentifier)("ICompletionsExtensionStatus");var gEr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};fme.CopilotExtensionStatus=gEr});var c0t=I(F2=>{"use strict";p();Object.defineProperty(F2,"__esModule",{value:!0});F2.CopilotToken=void 0;F2.containsInternalOrg=Svi;F2.containsVSCodeOrg=xvi;F2.validateTokenEnvelope=wvi;F2.isTokenEnvelope=tIa;F2.isErrorEnvelope=rIa;F2.isStandardErrorEnvelope=nIa;F2.createTestExtendedTokenInfo=iIa;var Fn=KH();function Svi(t){return Tvi(t)||Ivi(t)}a(Svi,"containsInternalOrg");function Tvi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(Tvi,"containsGitHubOrg");function Ivi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(Ivi,"containsMicrosoftOrg");function xvi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(xvi,"containsVSCodeOrg");var AEr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return Svi(this.organizationList)}get isMicrosoftInternal(){return Ivi(this.organizationList)}get isGitHubInternal(){return Tvi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||xvi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};F2.CopilotToken=AEr;var KTa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),notification_id:(0,Fn.vRequired)((0,Fn.vString)()),title:(0,Fn.vRequired)((0,Fn.vString)()),url:(0,Fn.vRequired)((0,Fn.vString)())}),JTa=(0,Fn.vObj)({can_signup_for_limited:(0,Fn.vNullable)((0,Fn.vBoolean)()),error_details:(0,Fn.vRequired)(KTa),message:(0,Fn.vRequired)((0,Fn.vString)()),reason:(0,Fn.vString)()}),ZTa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)()),sku:(0,Fn.vString)(),individual:(0,Fn.vBoolean)(),blackbird_clientside_indexing:(0,Fn.vBoolean)(),code_quote_enabled:(0,Fn.vBoolean)(),code_review_enabled:(0,Fn.vBoolean)(),codesearch:(0,Fn.vBoolean)(),copilotignore_enabled:(0,Fn.vBoolean)(),public_suggestions:(0,Fn.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Fn.vEnum)("enabled","disabled"),endpoints:(0,Fn.vObj)({api:(0,Fn.vString)(),"origin-tracker":(0,Fn.vString)(),proxy:(0,Fn.vString)(),telemetry:(0,Fn.vString)()}),enterprise_list:(0,Fn.vNullable)((0,Fn.vArray)((0,Fn.vNumber)())),limited_user_quotas:(0,Fn.vNullable)((0,Fn.vObj)({chat:(0,Fn.vRequired)((0,Fn.vNumber)()),completions:(0,Fn.vRequired)((0,Fn.vNumber)())})),limited_user_reset_date:(0,Fn.vNullable)((0,Fn.vNumber)()),organization_list:(0,Fn.vArray)((0,Fn.vString)())}),XTa=(0,Fn.vObj)({message:(0,Fn.vRequired)((0,Fn.vString)()),documentation_url:(0,Fn.vRequired)((0,Fn.vString)()),status:(0,Fn.vRequired)((0,Fn.vString)())}),eIa=(0,Fn.vObj)({token:(0,Fn.vRequired)((0,Fn.vString)()),expires_at:(0,Fn.vRequired)((0,Fn.vNumber)()),refresh_in:(0,Fn.vRequired)((0,Fn.vNumber)())});function wvi(t){let e=ZTa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=eIa.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(wvi,"validateTokenEnvelope");function tIa(t){return wvi(t).valid}a(tIa,"isTokenEnvelope");function rIa(t){return JTa.validate(t).error===void 0}a(rIa,"isErrorEnvelope");function nIa(t){return XTa.validate(t).error===void 0}a(nIa,"isStandardErrorEnvelope");function iIa(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(iIa,"createTestExtendedTokenInfo")});var pme=I(PT=>{"use strict";p();var oIa=PT&&PT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sIa=PT&&PT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(PT,"__esModule",{value:!0});PT.CopilotTokenManagerImpl=PT.ICompletionsCopilotTokenManager=PT.CopilotToken=void 0;var aIa=SE(),cIa=rn(),lIa=Xc(),uIa=ko(),dIa=c0t();Object.defineProperty(PT,"CopilotToken",{enumerable:!0,get:a(function(){return dIa.CopilotToken},"get")});PT.ICompletionsCopilotTokenManager=(0,cIa.createServiceIdentifier)("ICompletionsCopilotTokenManager");var yEr=class extends uIa.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new lIa.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidAuthenticationChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};PT.CopilotTokenManagerImpl=yEr;PT.CopilotTokenManagerImpl=yEr=oIa([sIa(1,aIa.IAuthenticationService)],yEr)});var l0t=I(hme=>{"use strict";p();Object.defineProperty(hme,"__esModule",{value:!0});hme.NoOpCitationManager=hme.ICompletionsCitationManager=void 0;var fIa=rn(),pIa=ko();hme.ICompletionsCitationManager=(0,fIa.createServiceIdentifier)("ICompletionsCitationManager");var EEr=class{static{a(this,"NoOpCitationManager")}register(){return pIa.Disposable.None}async handleIPCodeCitation(e){}};hme.NoOpCitationManager=EEr});var uC=I(wg=>{"use strict";p();Object.defineProperty(wg,"__esModule",{value:!0});wg.HasPropertyKey=hIa;wg.IsAsyncIterator=mIa;wg.IsArray=_Er;wg.IsBigInt=gIa;wg.IsBoolean=AIa;wg.IsDate=yIa;wg.IsFunction=EIa;wg.IsIterator=_Ia;wg.IsNull=CIa;wg.IsNumber=vIa;wg.IsObject=CEr;wg.IsRegExp=bIa;wg.IsString=SIa;wg.IsSymbol=TIa;wg.IsUint8Array=vEr;wg.IsUndefined=IIa;function hIa(t,e){return e in t}a(hIa,"HasPropertyKey");function mIa(t){return CEr(t)&&!_Er(t)&&!vEr(t)&&Symbol.asyncIterator in t}a(mIa,"IsAsyncIterator");function _Er(t){return Array.isArray(t)}a(_Er,"IsArray");function gIa(t){return typeof t=="bigint"}a(gIa,"IsBigInt");function AIa(t){return typeof t=="boolean"}a(AIa,"IsBoolean");function yIa(t){return t instanceof globalThis.Date}a(yIa,"IsDate");function EIa(t){return typeof t=="function"}a(EIa,"IsFunction");function _Ia(t){return CEr(t)&&!_Er(t)&&!vEr(t)&&Symbol.iterator in t}a(_Ia,"IsIterator");function CIa(t){return t===null}a(CIa,"IsNull");function vIa(t){return typeof t=="number"}a(vIa,"IsNumber");function CEr(t){return typeof t=="object"&&t!==null}a(CEr,"IsObject");function bIa(t){return t instanceof globalThis.RegExp}a(bIa,"IsRegExp");function SIa(t){return typeof t=="string"}a(SIa,"IsString");function TIa(t){return typeof t=="symbol"}a(TIa,"IsSymbol");function vEr(t){return t instanceof globalThis.Uint8Array}a(vEr,"IsUint8Array");function IIa(t){return t===void 0}a(IIa,"IsUndefined")});var Lb=I(_8=>{"use strict";p();var xIa=_8&&_8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wIa=_8&&_8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),RIa=_8&&_8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou0t(e))}a(kIa,"ArrayType");function PIa(t){return new Date(t.getTime())}a(PIa,"DateType");function DIa(t){return new Uint8Array(t)}a(DIa,"Uint8ArrayType");function NIa(t){return new RegExp(t.source,t.flags)}a(NIa,"RegExpType");function MIa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=u0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=u0t(t[r]);return e}a(MIa,"ObjectType");function u0t(t){return HMe.IsArray(t)?kIa(t):HMe.IsDate(t)?PIa(t):HMe.IsUint8Array(t)?DIa(t):HMe.IsRegExp(t)?NIa(t):HMe.IsObject(t)?MIa(t):t}a(u0t,"Visit");function OIa(t){return u0t(t)}a(OIa,"Clone")});var f0t=I(d0t=>{"use strict";p();Object.defineProperty(d0t,"__esModule",{value:!0});d0t.CloneRest=BIa;d0t.CloneType=kvi;var Rvi=Lb();function BIa(t){return t.map(e=>kvi(e))}a(BIa,"CloneRest");function kvi(t,e){return e===void 0?(0,Rvi.Clone)(t):(0,Rvi.Clone)({...e,...t})}a(kvi,"CloneType")});var bEr=I(tG=>{"use strict";p();var LIa=tG&&tG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pvi=tG&&tG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LIa(e,t,r)};Object.defineProperty(tG,"__esModule",{value:!0});Pvi(f0t(),tG);Pvi(Lb(),tG)});var p0t=I(ga=>{"use strict";p();Object.defineProperty(ga,"__esModule",{value:!0});ga.IsAsyncIterator=FIa;ga.IsIterator=UIa;ga.IsStandardObject=QIa;ga.IsInstanceObject=qIa;ga.IsPromise=jIa;ga.IsDate=HIa;ga.IsMap=GIa;ga.IsSet=$Ia;ga.IsRegExp=VIa;ga.IsTypedArray=WIa;ga.IsInt8Array=zIa;ga.IsUint8Array=YIa;ga.IsUint8ClampedArray=KIa;ga.IsInt16Array=JIa;ga.IsUint16Array=ZIa;ga.IsInt32Array=XIa;ga.IsUint32Array=exa;ga.IsFloat32Array=txa;ga.IsFloat64Array=rxa;ga.IsBigInt64Array=nxa;ga.IsBigUint64Array=ixa;ga.HasPropertyKey=oxa;ga.IsObject=GMe;ga.IsArray=Dvi;ga.IsUndefined=Nvi;ga.IsNull=Mvi;ga.IsBoolean=Ovi;ga.IsNumber=Bvi;ga.IsInteger=sxa;ga.IsBigInt=Lvi;ga.IsString=Fvi;ga.IsFunction=Uvi;ga.IsSymbol=Qvi;ga.IsValueType=axa;function FIa(t){return GMe(t)&&globalThis.Symbol.asyncIterator in t}a(FIa,"IsAsyncIterator");function UIa(t){return GMe(t)&&globalThis.Symbol.iterator in t}a(UIa,"IsIterator");function QIa(t){return GMe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(QIa,"IsStandardObject");function qIa(t){return GMe(t)&&!Dvi(t)&&Uvi(t.constructor)&&t.constructor.name!=="Object"}a(qIa,"IsInstanceObject");function jIa(t){return t instanceof globalThis.Promise}a(jIa,"IsPromise");function HIa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(HIa,"IsDate");function GIa(t){return t instanceof globalThis.Map}a(GIa,"IsMap");function $Ia(t){return t instanceof globalThis.Set}a($Ia,"IsSet");function VIa(t){return t instanceof globalThis.RegExp}a(VIa,"IsRegExp");function WIa(t){return globalThis.ArrayBuffer.isView(t)}a(WIa,"IsTypedArray");function zIa(t){return t instanceof globalThis.Int8Array}a(zIa,"IsInt8Array");function YIa(t){return t instanceof globalThis.Uint8Array}a(YIa,"IsUint8Array");function KIa(t){return t instanceof globalThis.Uint8ClampedArray}a(KIa,"IsUint8ClampedArray");function JIa(t){return t instanceof globalThis.Int16Array}a(JIa,"IsInt16Array");function ZIa(t){return t instanceof globalThis.Uint16Array}a(ZIa,"IsUint16Array");function XIa(t){return t instanceof globalThis.Int32Array}a(XIa,"IsInt32Array");function exa(t){return t instanceof globalThis.Uint32Array}a(exa,"IsUint32Array");function txa(t){return t instanceof globalThis.Float32Array}a(txa,"IsFloat32Array");function rxa(t){return t instanceof globalThis.Float64Array}a(rxa,"IsFloat64Array");function nxa(t){return t instanceof globalThis.BigInt64Array}a(nxa,"IsBigInt64Array");function ixa(t){return t instanceof globalThis.BigUint64Array}a(ixa,"IsBigUint64Array");function oxa(t,e){return e in t}a(oxa,"HasPropertyKey");function GMe(t){return t!==null&&typeof t=="object"}a(GMe,"IsObject");function Dvi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Dvi,"IsArray");function Nvi(t){return t===void 0}a(Nvi,"IsUndefined");function Mvi(t){return t===null}a(Mvi,"IsNull");function Ovi(t){return typeof t=="boolean"}a(Ovi,"IsBoolean");function Bvi(t){return typeof t=="number"}a(Bvi,"IsNumber");function sxa(t){return globalThis.Number.isInteger(t)}a(sxa,"IsInteger");function Lvi(t){return typeof t=="bigint"}a(Lvi,"IsBigInt");function Fvi(t){return typeof t=="string"}a(Fvi,"IsString");function Uvi(t){return typeof t=="function"}a(Uvi,"IsFunction");function Qvi(t){return typeof t=="symbol"}a(Qvi,"IsSymbol");function axa(t){return Lvi(t)||Ovi(t)||Mvi(t)||Bvi(t)||Fvi(t)||Qvi(t)||Nvi(t)}a(axa,"IsValueType")});var pm=I(Tee=>{"use strict";p();var cxa=Tee&&Tee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lxa=Tee&&Tee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cxa(e,t,r)};Object.defineProperty(Tee,"__esModule",{value:!0});lxa(p0t(),Tee)});var $Me=I(m0t=>{"use strict";p();Object.defineProperty(m0t,"__esModule",{value:!0});m0t.TypeSystemPolicy=void 0;var h0t=pm(),qvi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,h0t.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,h0t.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,h0t.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,h0t.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(qvi||(m0t.TypeSystemPolicy=qvi={}))});var jvi=I(C8=>{"use strict";p();var uxa=C8&&C8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dxa=C8&&C8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fxa=C8&&C8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;og0t(e))}a(pxa,"ImmutableArray");function hxa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=g0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=g0t(t[r]);return globalThis.Object.freeze(e)}a(hxa,"ImmutableObject");function g0t(t){return VMe.IsArray(t)?pxa(t):VMe.IsDate(t)?t:VMe.IsUint8Array(t)?t:VMe.IsRegExp(t)?t:VMe.IsObject(t)?hxa(t):t}a(g0t,"Immutable")});var Ti=I(SEr=>{"use strict";p();Object.defineProperty(SEr,"__esModule",{value:!0});SEr.CreateType=yxa;var mxa=$Me(),gxa=jvi(),Axa=Lb();function yxa(t,e){let r=e!==void 0?{...e,...t}:t;switch(mxa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,gxa.Immutable)(r);case"clone":return(0,Axa.Clone)(r);default:return r}}a(yxa,"CreateType")});var v8=I(Iee=>{"use strict";p();var Exa=Iee&&Iee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_xa=Iee&&Iee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Exa(e,t,r)};Object.defineProperty(Iee,"__esModule",{value:!0});_xa(Ti(),Iee)});var IEr=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.TypeBoxError=void 0;var TEr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};A0t.TypeBoxError=TEr});var bf=I(xee=>{"use strict";p();var Cxa=xee&&xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vxa=xee&&xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cxa(e,t,r)};Object.defineProperty(xee,"__esModule",{value:!0});vxa(IEr(),xee)});var WMe=I(nR=>{"use strict";p();Object.defineProperty(nR,"__esModule",{value:!0});nR.Kind=nR.Hint=nR.OptionalKind=nR.ReadonlyKind=nR.TransformKind=void 0;nR.TransformKind=Symbol.for("TypeBox.Transform");nR.ReadonlyKind=Symbol.for("TypeBox.Readonly");nR.OptionalKind=Symbol.for("TypeBox.Optional");nR.Hint=Symbol.for("TypeBox.Hint");nR.Kind=Symbol.for("TypeBox.Kind")});var _n=I(wee=>{"use strict";p();var bxa=wee&&wee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Sxa=wee&&wee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bxa(e,t,r)};Object.defineProperty(wee,"__esModule",{value:!0});Sxa(WMe(),wee)});var gs=I(ci=>{"use strict";p();var Txa=ci&&ci.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ixa=ci&&ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xxa=ci&&ci.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Uxa=Yn&&Yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qxa=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qxa=Yn&&Yn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(wEr,"IsControlCharacterFree");function Ibi(t){return REr(t)||Rg(t)}a(Ibi,"IsAdditionalProperties");function YMe(t){return ii.IsUndefined(t)||ii.IsBigInt(t)}a(YMe,"IsOptionalBigInt");function Wl(t){return ii.IsUndefined(t)||ii.IsNumber(t)}a(Wl,"IsOptionalNumber");function REr(t){return ii.IsUndefined(t)||ii.IsBoolean(t)}a(REr,"IsOptionalBoolean");function ll(t){return ii.IsUndefined(t)||ii.IsString(t)}a(ll,"IsOptionalString");function Gxa(t){return ii.IsUndefined(t)||ii.IsString(t)&&wEr(t)&&Tbi(t)}a(Gxa,"IsOptionalPattern");function $xa(t){return ii.IsUndefined(t)||ii.IsString(t)&&wEr(t)}a($xa,"IsOptionalFormat");function xbi(t){return ii.IsUndefined(t)||Rg(t)}a(xbi,"IsOptionalSchema");function Vxa(t){return ii.IsObject(t)&&t[u4.ReadonlyKind]==="Readonly"}a(Vxa,"IsReadonly");function Wxa(t){return ii.IsObject(t)&&t[u4.OptionalKind]==="Optional"}a(Wxa,"IsOptional");function wbi(t){return js(t,"Any")&&ll(t.$id)}a(wbi,"IsAny");function Rbi(t){return js(t,"Argument")&&ii.IsNumber(t.index)}a(Rbi,"IsArgument");function kbi(t){return js(t,"Array")&&t.type==="array"&&ll(t.$id)&&Rg(t.items)&&Wl(t.minItems)&&Wl(t.maxItems)&&REr(t.uniqueItems)&&xbi(t.contains)&&Wl(t.minContains)&&Wl(t.maxContains)}a(kbi,"IsArray");function Pbi(t){return js(t,"AsyncIterator")&&t.type==="AsyncIterator"&&ll(t.$id)&&Rg(t.items)}a(Pbi,"IsAsyncIterator");function Dbi(t){return js(t,"BigInt")&&t.type==="bigint"&&ll(t.$id)&&YMe(t.exclusiveMaximum)&&YMe(t.exclusiveMinimum)&&YMe(t.maximum)&&YMe(t.minimum)&&YMe(t.multipleOf)}a(Dbi,"IsBigInt");function Nbi(t){return js(t,"Boolean")&&t.type==="boolean"&&ll(t.$id)}a(Nbi,"IsBoolean");function Mbi(t){return js(t,"Computed")&&ii.IsString(t.target)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))}a(Mbi,"IsComputed");function Obi(t){return js(t,"Constructor")&&t.type==="Constructor"&&ll(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))&&Rg(t.returns)}a(Obi,"IsConstructor");function Bbi(t){return js(t,"Date")&&t.type==="Date"&&ll(t.$id)&&Wl(t.exclusiveMaximumTimestamp)&&Wl(t.exclusiveMinimumTimestamp)&&Wl(t.maximumTimestamp)&&Wl(t.minimumTimestamp)&&Wl(t.multipleOfTimestamp)}a(Bbi,"IsDate");function Lbi(t){return js(t,"Function")&&t.type==="Function"&&ll(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Rg(e))&&Rg(t.returns)}a(Lbi,"IsFunction");function zxa(t){return js(t,"Import")&&ii.HasPropertyKey(t,"$defs")&&ii.IsObject(t.$defs)&&y0t(t.$defs)&&ii.HasPropertyKey(t,"$ref")&&ii.IsString(t.$ref)&&t.$ref in t.$defs}a(zxa,"IsImport");function Fbi(t){return js(t,"Integer")&&t.type==="integer"&&ll(t.$id)&&Wl(t.exclusiveMaximum)&&Wl(t.exclusiveMinimum)&&Wl(t.maximum)&&Wl(t.minimum)&&Wl(t.multipleOf)}a(Fbi,"IsInteger");function y0t(t){return ii.IsObject(t)&&Object.entries(t).every(([e,r])=>wEr(e)&&Rg(r))}a(y0t,"IsProperties");function Ubi(t){return js(t,"Intersect")&&!(ii.IsString(t.type)&&t.type!=="object")&&ii.IsArray(t.allOf)&&t.allOf.every(e=>Rg(e)&&!o1i(e))&&ll(t.type)&&(REr(t.unevaluatedProperties)||xbi(t.unevaluatedProperties))&&ll(t.$id)}a(Ubi,"IsIntersect");function Qbi(t){return js(t,"Iterator")&&t.type==="Iterator"&&ll(t.$id)&&Rg(t.items)}a(Qbi,"IsIterator");function js(t,e){return ii.IsObject(t)&&u4.Kind in t&&t[u4.Kind]===e}a(js,"IsKindOf");function qbi(t){return KMe(t)&&ii.IsString(t.const)}a(qbi,"IsLiteralString");function jbi(t){return KMe(t)&&ii.IsNumber(t.const)}a(jbi,"IsLiteralNumber");function Yxa(t){return KMe(t)&&ii.IsBoolean(t.const)}a(Yxa,"IsLiteralBoolean");function KMe(t){return js(t,"Literal")&&ll(t.$id)&&Hbi(t.const)}a(KMe,"IsLiteral");function Hbi(t){return ii.IsBoolean(t)||ii.IsNumber(t)||ii.IsString(t)}a(Hbi,"IsLiteralValue");function Gbi(t){return js(t,"MappedKey")&&ii.IsArray(t.keys)&&t.keys.every(e=>ii.IsNumber(e)||ii.IsString(e))}a(Gbi,"IsMappedKey");function $bi(t){return js(t,"MappedResult")&&y0t(t.properties)}a($bi,"IsMappedResult");function Vbi(t){return js(t,"Never")&&ii.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Vbi,"IsNever");function Wbi(t){return js(t,"Not")&&Rg(t.not)}a(Wbi,"IsNot");function zbi(t){return js(t,"Null")&&t.type==="null"&&ll(t.$id)}a(zbi,"IsNull");function Ybi(t){return js(t,"Number")&&t.type==="number"&&ll(t.$id)&&Wl(t.exclusiveMaximum)&&Wl(t.exclusiveMinimum)&&Wl(t.maximum)&&Wl(t.minimum)&&Wl(t.multipleOf)}a(Ybi,"IsNumber");function Kbi(t){return js(t,"Object")&&t.type==="object"&&ll(t.$id)&&y0t(t.properties)&&Ibi(t.additionalProperties)&&Wl(t.minProperties)&&Wl(t.maxProperties)}a(Kbi,"IsObject");function Jbi(t){return js(t,"Promise")&&t.type==="Promise"&&ll(t.$id)&&Rg(t.item)}a(Jbi,"IsPromise");function Zbi(t){return js(t,"Record")&&t.type==="object"&&ll(t.$id)&&Ibi(t.additionalProperties)&&ii.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&Tbi(r[0])&&ii.IsObject(e.patternProperties)&&Rg(e.patternProperties[r[0]])})(t)}a(Zbi,"IsRecord");function Kxa(t){return ii.IsObject(t)&&u4.Hint in t&&t[u4.Hint]==="Recursive"}a(Kxa,"IsRecursive");function Xbi(t){return js(t,"Ref")&&ll(t.$id)&&ii.IsString(t.$ref)}a(Xbi,"IsRef");function e1i(t){return js(t,"RegExp")&&ll(t.$id)&&ii.IsString(t.source)&&ii.IsString(t.flags)&&Wl(t.maxLength)&&Wl(t.minLength)}a(e1i,"IsRegExp");function t1i(t){return js(t,"String")&&t.type==="string"&&ll(t.$id)&&Wl(t.minLength)&&Wl(t.maxLength)&&Gxa(t.pattern)&&$xa(t.format)}a(t1i,"IsString");function r1i(t){return js(t,"Symbol")&&t.type==="symbol"&&ll(t.$id)}a(r1i,"IsSymbol");function n1i(t){return js(t,"TemplateLiteral")&&t.type==="string"&&ii.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(n1i,"IsTemplateLiteral");function i1i(t){return js(t,"This")&&ll(t.$id)&&ii.IsString(t.$ref)}a(i1i,"IsThis");function o1i(t){return ii.IsObject(t)&&u4.TransformKind in t}a(o1i,"IsTransform");function s1i(t){return js(t,"Tuple")&&t.type==="array"&&ll(t.$id)&&ii.IsNumber(t.minItems)&&ii.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(ii.IsUndefined(t.items)&&ii.IsUndefined(t.additionalItems)&&t.minItems===0||ii.IsArray(t.items)&&t.items.every(e=>Rg(e)))}a(s1i,"IsTuple");function a1i(t){return js(t,"Undefined")&&t.type==="undefined"&&ll(t.$id)}a(a1i,"IsUndefined");function Jxa(t){return kEr(t)&&t.anyOf.every(e=>qbi(e)||jbi(e))}a(Jxa,"IsUnionLiteral");function kEr(t){return js(t,"Union")&&ll(t.$id)&&ii.IsObject(t)&&ii.IsArray(t.anyOf)&&t.anyOf.every(e=>Rg(e))}a(kEr,"IsUnion");function c1i(t){return js(t,"Uint8Array")&&t.type==="Uint8Array"&&ll(t.$id)&&Wl(t.minByteLength)&&Wl(t.maxByteLength)}a(c1i,"IsUint8Array");function l1i(t){return js(t,"Unknown")&&ll(t.$id)}a(l1i,"IsUnknown");function u1i(t){return js(t,"Unsafe")}a(u1i,"IsUnsafe");function d1i(t){return js(t,"Void")&&t.type==="void"&&ll(t.$id)}a(d1i,"IsVoid");function f1i(t){return ii.IsObject(t)&&u4.Kind in t&&ii.IsString(t[u4.Kind])&&!Hxa.includes(t[u4.Kind])}a(f1i,"IsKind");function Rg(t){return ii.IsObject(t)&&(wbi(t)||Rbi(t)||kbi(t)||Nbi(t)||Dbi(t)||Pbi(t)||Mbi(t)||Obi(t)||Bbi(t)||Lbi(t)||Fbi(t)||Ubi(t)||Qbi(t)||KMe(t)||Gbi(t)||$bi(t)||Vbi(t)||Wbi(t)||zbi(t)||Ybi(t)||Kbi(t)||Jbi(t)||Zbi(t)||Xbi(t)||e1i(t)||t1i(t)||r1i(t)||n1i(t)||i1i(t)||s1i(t)||a1i(t)||kEr(t)||c1i(t)||l1i(t)||u1i(t)||d1i(t)||f1i(t))}a(Rg,"IsSchema")});var DEr=I(Ub=>{"use strict";p();var Zxa=Ub&&Ub.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xxa=Ub&&Ub.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PEr=Ub&&Ub.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(NEr,"__esModule",{value:!0});NEr.Increment=ewa;function ewa(t){return(parseInt(t)+1).toString()}a(ewa,"Increment")});var m1i=I(Ree=>{"use strict";p();var twa=Ree&&Ree.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rwa=Ree&&Ree.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&twa(e,t,r)};Object.defineProperty(Ree,"__esModule",{value:!0});rwa(h1i(),Ree)});var g1i=I(hp=>{"use strict";p();Object.defineProperty(hp,"__esModule",{value:!0});hp.PatternNeverExact=hp.PatternStringExact=hp.PatternNumberExact=hp.PatternBooleanExact=hp.PatternNever=hp.PatternString=hp.PatternNumber=hp.PatternBoolean=void 0;hp.PatternBoolean="(true|false)";hp.PatternNumber="(0|[1-9][0-9]*)";hp.PatternString="(.*)";hp.PatternNever="(?!.*)";hp.PatternBooleanExact=`^${hp.PatternBoolean}$`;hp.PatternNumberExact=`^${hp.PatternNumber}$`;hp.PatternStringExact=`^${hp.PatternString}$`;hp.PatternNeverExact=`^${hp.PatternNever}$`});var JMe=I(kee=>{"use strict";p();var nwa=kee&&kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iwa=kee&&kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nwa(e,t,r)};Object.defineProperty(kee,"__esModule",{value:!0});iwa(g1i(),kee)});var A1i=I(rG=>{"use strict";p();Object.defineProperty(rG,"__esModule",{value:!0});rG.Entries=owa;rG.Clear=swa;rG.Delete=awa;rG.Has=cwa;rG.Set=lwa;rG.Get=uwa;var mme=new Map;function owa(){return new Map(mme)}a(owa,"Entries");function swa(){return mme.clear()}a(swa,"Clear");function awa(t){return mme.delete(t)}a(awa,"Delete");function cwa(t){return mme.has(t)}a(cwa,"Has");function lwa(t,e){mme.set(t,e)}a(lwa,"Set");function uwa(t){return mme.get(t)}a(uwa,"Get")});var y1i=I(nG=>{"use strict";p();Object.defineProperty(nG,"__esModule",{value:!0});nG.Entries=dwa;nG.Clear=fwa;nG.Delete=pwa;nG.Has=hwa;nG.Set=mwa;nG.Get=gwa;var gme=new Map;function dwa(){return new Map(gme)}a(dwa,"Entries");function fwa(){return gme.clear()}a(fwa,"Clear");function pwa(t){return gme.delete(t)}a(pwa,"Delete");function hwa(t){return gme.has(t)}a(hwa,"Has");function mwa(t,e){gme.set(t,e)}a(mwa,"Set");function gwa(t){return gme.get(t)}a(gwa,"Get")});var Ame=I(iR=>{"use strict";p();var Awa=iR&&iR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ywa=iR&&iR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E1i=iR&&iR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(d4,"__esModule",{value:!0});d4.SetIncludes=_1i;d4.SetIsSubset=Ewa;d4.SetDistinct=_wa;d4.SetIntersect=C1i;d4.SetUnion=Cwa;d4.SetComplement=vwa;d4.SetIntersectMany=Swa;d4.SetUnionMany=Twa;function _1i(t,e){return t.includes(e)}a(_1i,"SetIncludes");function Ewa(t,e){return t.every(r=>_1i(e,r))}a(Ewa,"SetIsSubset");function _wa(t){return[...new Set(t)]}a(_wa,"SetDistinct");function C1i(t,e){return t.filter(r=>e.includes(r))}a(C1i,"SetIntersect");function Cwa(t,e){return[...t,...e]}a(Cwa,"SetUnion");function vwa(t,e){return t.filter(r=>!e.includes(r))}a(vwa,"SetComplement");function bwa(t,e){return t.reduce((r,n)=>C1i(r,n),e)}a(bwa,"SetIntersectManyResolve");function Swa(t){return t.length===1?t[0]:t.length>1?bwa(t.slice(1),t[0]):[]}a(Swa,"SetIntersectMany");function Twa(t){let e=[];for(let r of t)e.push(...r);return e}a(Twa,"SetUnionMany")});var ZMe=I(Pee=>{"use strict";p();var Iwa=Pee&&Pee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xwa=Pee&&Pee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Iwa(e,t,r)};Object.defineProperty(Pee,"__esModule",{value:!0});xwa(v1i(),Pee)});var b1i=I(MEr=>{"use strict";p();Object.defineProperty(MEr,"__esModule",{value:!0});MEr.Any=kwa;var wwa=v8(),Rwa=_n();function kwa(t){return(0,wwa.CreateType)({[Rwa.Kind]:"Any"},t)}a(kwa,"Any")});var yme=I(Dee=>{"use strict";p();var Pwa=Dee&&Dee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Dwa=Dee&&Dee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pwa(e,t,r)};Object.defineProperty(Dee,"__esModule",{value:!0});Dwa(b1i(),Dee)});var S1i=I(OEr=>{"use strict";p();Object.defineProperty(OEr,"__esModule",{value:!0});OEr.Array=Owa;var Nwa=Ti(),Mwa=_n();function Owa(t,e){return(0,Nwa.CreateType)({[Mwa.Kind]:"Array",type:"array",items:t},e)}a(Owa,"Array")});var Eme=I(Nee=>{"use strict";p();var Bwa=Nee&&Nee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lwa=Nee&&Nee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bwa(e,t,r)};Object.defineProperty(Nee,"__esModule",{value:!0});Lwa(S1i(),Nee)});var T1i=I(BEr=>{"use strict";p();Object.defineProperty(BEr,"__esModule",{value:!0});BEr.Argument=Qwa;var Fwa=Ti(),Uwa=_n();function Qwa(t){return(0,Fwa.CreateType)({[Uwa.Kind]:"Argument",index:t})}a(Qwa,"Argument")});var E0t=I(Mee=>{"use strict";p();var qwa=Mee&&Mee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jwa=Mee&&Mee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qwa(e,t,r)};Object.defineProperty(Mee,"__esModule",{value:!0});jwa(T1i(),Mee)});var I1i=I(LEr=>{"use strict";p();Object.defineProperty(LEr,"__esModule",{value:!0});LEr.AsyncIterator=$wa;var Hwa=_n(),Gwa=Ti();function $wa(t,e){return(0,Gwa.CreateType)({[Hwa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a($wa,"AsyncIterator")});var _me=I(Oee=>{"use strict";p();var Vwa=Oee&&Oee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wwa=Oee&&Oee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vwa(e,t,r)};Object.defineProperty(Oee,"__esModule",{value:!0});Wwa(I1i(),Oee)});var x1i=I(FEr=>{"use strict";p();Object.defineProperty(FEr,"__esModule",{value:!0});FEr.Computed=Kwa;var zwa=v8(),Ywa=WMe();function Kwa(t,e,r){return(0,zwa.CreateType)({[Ywa.Kind]:"Computed",target:t,parameters:e},r)}a(Kwa,"Computed")});var iG=I(Bee=>{"use strict";p();var Jwa=Bee&&Bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zwa=Bee&&Bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jwa(e,t,r)};Object.defineProperty(Bee,"__esModule",{value:!0});Zwa(x1i(),Bee)});var _0t=I(UEr=>{"use strict";p();Object.defineProperty(UEr,"__esModule",{value:!0});UEr.Discard=eRa;function Xwa(t,e){let{[e]:r,...n}=t;return n}a(Xwa,"DiscardKey");function eRa(t,e){return e.reduce((r,n)=>Xwa(r,n),t)}a(eRa,"Discard")});var S8=I(Lee=>{"use strict";p();var tRa=Lee&&Lee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rRa=Lee&&Lee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tRa(e,t,r)};Object.defineProperty(Lee,"__esModule",{value:!0});rRa(_0t(),Lee)});var w1i=I(QEr=>{"use strict";p();Object.defineProperty(QEr,"__esModule",{value:!0});QEr.Never=oRa;var nRa=Ti(),iRa=_n();function oRa(t){return(0,nRa.CreateType)({[iRa.Kind]:"Never",not:{}},t)}a(oRa,"Never")});var d0=I(Fee=>{"use strict";p();var sRa=Fee&&Fee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aRa=Fee&&Fee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sRa(e,t,r)};Object.defineProperty(Fee,"__esModule",{value:!0});aRa(w1i(),Fee)});var R1i=I(qEr=>{"use strict";p();Object.defineProperty(qEr,"__esModule",{value:!0});qEr.MappedKey=uRa;var cRa=Ti(),lRa=_n();function uRa(t){return(0,cRa.CreateType)({[lRa.Kind]:"MappedKey",keys:t})}a(uRa,"MappedKey")});var HEr=I(jEr=>{"use strict";p();Object.defineProperty(jEr,"__esModule",{value:!0});jEr.MappedResult=pRa;var dRa=Ti(),fRa=_n();function pRa(t){return(0,dRa.CreateType)({[fRa.Kind]:"MappedResult",properties:t})}a(pRa,"MappedResult")});var k1i=I(GEr=>{"use strict";p();Object.defineProperty(GEr,"__esModule",{value:!0});GEr.Constructor=gRa;var hRa=Ti(),mRa=_n();function gRa(t,e,r){return(0,hRa.CreateType)({[mRa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(gRa,"Constructor")});var Cme=I(Uee=>{"use strict";p();var ARa=Uee&&Uee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yRa=Uee&&Uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ARa(e,t,r)};Object.defineProperty(Uee,"__esModule",{value:!0});yRa(k1i(),Uee)});var P1i=I($Er=>{"use strict";p();Object.defineProperty($Er,"__esModule",{value:!0});$Er.Function=CRa;var ERa=Ti(),_Ra=_n();function CRa(t,e,r){return(0,ERa.CreateType)({[_Ra.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(CRa,"Function")});var oG=I(Qee=>{"use strict";p();var vRa=Qee&&Qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bRa=Qee&&Qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vRa(e,t,r)};Object.defineProperty(Qee,"__esModule",{value:!0});bRa(P1i(),Qee)});var WEr=I(VEr=>{"use strict";p();Object.defineProperty(VEr,"__esModule",{value:!0});VEr.UnionCreate=IRa;var SRa=Ti(),TRa=_n();function IRa(t,e){return(0,SRa.CreateType)({[TRa.Kind]:"Union",anyOf:t},e)}a(IRa,"UnionCreate")});var O1i=I(zEr=>{"use strict";p();Object.defineProperty(zEr,"__esModule",{value:!0});zEr.UnionEvaluated=ORa;var xRa=Ti(),wRa=_n(),RRa=S8(),kRa=d0(),PRa=f4(),D1i=WEr(),M1i=gs();function DRa(t){return t.some(e=>(0,M1i.IsOptional)(e))}a(DRa,"IsUnionOptional");function N1i(t){return t.map(e=>(0,M1i.IsOptional)(e)?NRa(e):e)}a(N1i,"RemoveOptionalFromRest");function NRa(t){return(0,RRa.Discard)(t,[wRa.OptionalKind])}a(NRa,"RemoveOptionalFromType");function MRa(t,e){return DRa(t)?(0,PRa.Optional)((0,D1i.UnionCreate)(N1i(t),e)):(0,D1i.UnionCreate)(N1i(t),e)}a(MRa,"ResolveUnion");function ORa(t,e){return t.length===1?(0,xRa.CreateType)(t[0],e):t.length===0?(0,kRa.Never)(e):MRa(t,e)}a(ORa,"UnionEvaluated")});var L1i=I(B1i=>{"use strict";p();Object.defineProperty(B1i,"__esModule",{value:!0});var upp=_n()});var F1i=I(YEr=>{"use strict";p();Object.defineProperty(YEr,"__esModule",{value:!0});YEr.Union=URa;var BRa=d0(),LRa=Ti(),FRa=WEr();function URa(t,e){return t.length===0?(0,BRa.Never)(e):t.length===1?(0,LRa.CreateType)(t[0],e):(0,FRa.UnionCreate)(t,e)}a(URa,"Union")});var mp=I(T8=>{"use strict";p();var QRa=T8&&T8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KEr=T8&&T8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QRa(e,t,r)};Object.defineProperty(T8,"__esModule",{value:!0});KEr(O1i(),T8);KEr(L1i(),T8);KEr(F1i(),T8)});var C0t=I(vme=>{"use strict";p();Object.defineProperty(vme,"__esModule",{value:!0});vme.TemplateLiteralParserError=void 0;vme.TemplateLiteralParse=qee;vme.TemplateLiteralParseExact=YRa;var qRa=bf(),XMe=class extends qRa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};vme.TemplateLiteralParserError=XMe;function jRa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(jRa,"Unescape");function JEr(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(JEr,"IsNonEscaped");function I8(t,e){return JEr(t,e,"(")}a(I8,"IsOpenParen");function eOe(t,e){return JEr(t,e,")")}a(eOe,"IsCloseParen");function U1i(t,e){return JEr(t,e,"|")}a(U1i,"IsSeparator");function HRa(t){if(!(I8(t,0)&&eOe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(qee(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(qee(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(WRa,"Or");function zRa(t){function e(o,s){if(!I8(o,s))throw new XMe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(qee(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(zRa,"And");function qee(t){return HRa(t)?qee(GRa(t)):$Ra(t)?WRa(t):VRa(t)?zRa(t):{type:"const",const:jRa(t)}}a(qee,"TemplateLiteralParse");function YRa(t){return qee(t.slice(1,t.length-1))}a(YRa,"TemplateLiteralParseExact")});var ZEr=I(bme=>{"use strict";p();Object.defineProperty(bme,"__esModule",{value:!0});bme.TemplateLiteralFiniteError=void 0;bme.IsTemplateLiteralExpressionFinite=b0t;bme.IsTemplateLiteralFinite=tka;var KRa=C0t(),JRa=bf(),v0t=class extends JRa.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};bme.TemplateLiteralFiniteError=v0t;function ZRa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(ZRa,"IsNumberExpression");function XRa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(XRa,"IsBooleanExpression");function eka(t){return t.type==="const"&&t.const===".*"}a(eka,"IsStringExpression");function b0t(t){return ZRa(t)||eka(t)?!1:XRa(t)?!0:t.type==="and"?t.expr.every(e=>b0t(e)):t.type==="or"?t.expr.every(e=>b0t(e)):t.type==="const"?!0:(()=>{throw new v0t("Unknown expression type")})()}a(b0t,"IsTemplateLiteralExpressionFinite");function tka(t){let e=(0,KRa.TemplateLiteralParseExact)(t.pattern);return b0t(e)}a(tka,"IsTemplateLiteralFinite")});var XEr=I(Sme=>{"use strict";p();Object.defineProperty(Sme,"__esModule",{value:!0});Sme.TemplateLiteralGenerateError=void 0;Sme.TemplateLiteralExpressionGenerate=T0t;Sme.TemplateLiteralGenerate=cka;var rka=ZEr(),nka=C0t(),ika=bf(),S0t=class extends ika.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};Sme.TemplateLiteralGenerateError=S0t;function*Q1i(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of Q1i(t.slice(1)))yield`${e}${r}`}a(Q1i,"GenerateReduce");function*oka(t){return yield*Q1i(t.expr.map(e=>[...T0t(e)]))}a(oka,"GenerateAnd");function*ska(t){for(let e of t.expr)yield*T0t(e)}a(ska,"GenerateOr");function*aka(t){return yield t.const}a(aka,"GenerateConst");function*T0t(t){return t.type==="and"?yield*oka(t):t.type==="or"?yield*ska(t):t.type==="const"?yield*aka(t):(()=>{throw new S0t("Unknown expression")})()}a(T0t,"TemplateLiteralExpressionGenerate");function cka(t){let e=(0,nka.TemplateLiteralParseExact)(t.pattern);return(0,rka.IsTemplateLiteralExpressionFinite)(e)?[...T0t(e)]:[]}a(cka,"TemplateLiteralGenerate")});var q1i=I(e_r=>{"use strict";p();Object.defineProperty(e_r,"__esModule",{value:!0});e_r.Literal=dka;var lka=Ti(),uka=_n();function dka(t,e){return(0,lka.CreateType)({[uka.Kind]:"Literal",const:t,type:typeof t},e)}a(dka,"Literal")});var TE=I(jee=>{"use strict";p();var fka=jee&&jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pka=jee&&jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fka(e,t,r)};Object.defineProperty(jee,"__esModule",{value:!0});pka(q1i(),jee)});var j1i=I(t_r=>{"use strict";p();Object.defineProperty(t_r,"__esModule",{value:!0});t_r.Boolean=gka;var hka=_n(),mka=v8();function gka(t){return(0,mka.CreateType)({[hka.Kind]:"Boolean",type:"boolean"},t)}a(gka,"Boolean")});var tOe=I(Hee=>{"use strict";p();var Aka=Hee&&Hee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yka=Hee&&Hee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Aka(e,t,r)};Object.defineProperty(Hee,"__esModule",{value:!0});yka(j1i(),Hee)});var H1i=I(r_r=>{"use strict";p();Object.defineProperty(r_r,"__esModule",{value:!0});r_r.BigInt=Cka;var Eka=_n(),_ka=v8();function Cka(t){return(0,_ka.CreateType)({[Eka.Kind]:"BigInt",type:"bigint"},t)}a(Cka,"BigInt")});var Tme=I(Gee=>{"use strict";p();var vka=Gee&&Gee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),bka=Gee&&Gee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vka(e,t,r)};Object.defineProperty(Gee,"__esModule",{value:!0});bka(H1i(),Gee)});var G1i=I(n_r=>{"use strict";p();Object.defineProperty(n_r,"__esModule",{value:!0});n_r.Number=Ika;var Ska=Ti(),Tka=_n();function Ika(t){return(0,Ska.CreateType)({[Tka.Kind]:"Number",type:"number"},t)}a(Ika,"Number")});var sG=I($ee=>{"use strict";p();var xka=$ee&&$ee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wka=$ee&&$ee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xka(e,t,r)};Object.defineProperty($ee,"__esModule",{value:!0});wka(G1i(),$ee)});var $1i=I(i_r=>{"use strict";p();Object.defineProperty(i_r,"__esModule",{value:!0});i_r.String=Pka;var Rka=Ti(),kka=_n();function Pka(t){return(0,Rka.CreateType)({[kka.Kind]:"String",type:"string"},t)}a(Pka,"String")});var aG=I(Vee=>{"use strict";p();var Dka=Vee&&Vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Nka=Vee&&Vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dka(e,t,r)};Object.defineProperty(Vee,"__esModule",{value:!0});Nka($1i(),Vee)});var a_r=I(s_r=>{"use strict";p();Object.defineProperty(s_r,"__esModule",{value:!0});s_r.TemplateLiteralSyntax=jka;var rOe=TE(),Mka=tOe(),Oka=Tme(),Bka=sG(),Lka=aG(),Fka=mp(),Uka=d0();function*Qka(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,Mka.Boolean)():e==="number"?yield(0,Bka.Number)():e==="bigint"?yield(0,Oka.BigInt)():e==="string"?yield(0,Lka.String)():yield(()=>{let r=e.split("|").map(n=>(0,rOe.Literal)(n.trim()));return r.length===0?(0,Uka.Never)():r.length===1?r[0]:(0,Fka.UnionEvaluated)(r)})()}a(Qka,"FromUnion");function*qka(t){if(t[1]!=="{"){let e=(0,rOe.Literal)("$"),r=o_r(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(iOe,"__esModule",{value:!0});iOe.TemplateLiteralPatternError=void 0;iOe.TemplateLiteralPattern=Vka;var nOe=JMe(),Hka=_n(),Gka=bf(),cG=gs(),I0t=class extends Gka.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};iOe.TemplateLiteralPatternError=I0t;function $ka(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($ka,"Escape");function V1i(t,e){return(0,cG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,cG.IsUnion)(t)?`(${t.anyOf.map(r=>V1i(r,e)).join("|")})`:(0,cG.IsNumber)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsInteger)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsBigInt)(t)?`${e}${nOe.PatternNumber}`:(0,cG.IsString)(t)?`${e}${nOe.PatternString}`:(0,cG.IsLiteral)(t)?`${e}${$ka(t.const.toString())}`:(0,cG.IsBoolean)(t)?`${e}${nOe.PatternBoolean}`:(()=>{throw new I0t(`Unexpected Kind '${t[Hka.Kind]}'`)})()}a(V1i,"Visit");function Vka(t){return`^${t.map(e=>V1i(e,"")).join("")}$`}a(Vka,"TemplateLiteralPattern")});var W1i=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.TemplateLiteralToUnion=Kka;var Wka=mp(),zka=TE(),Yka=XEr();function Kka(t){let r=(0,Yka.TemplateLiteralGenerate)(t).map(n=>(0,zka.Literal)(n));return(0,Wka.UnionEvaluated)(r)}a(Kka,"TemplateLiteralToUnion")});var Y1i=I(u_r=>{"use strict";p();Object.defineProperty(u_r,"__esModule",{value:!0});u_r.TemplateLiteral=tPa;var Jka=Ti(),Zka=a_r(),z1i=c_r(),Xka=uC(),ePa=_n();function tPa(t,e){let r=(0,Xka.IsString)(t)?(0,z1i.TemplateLiteralPattern)((0,Zka.TemplateLiteralSyntax)(t)):(0,z1i.TemplateLiteralPattern)(t);return(0,Jka.CreateType)({[ePa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(tPa,"TemplateLiteral")});var U2=I(DT=>{"use strict";p();var rPa=DT&&DT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wee=DT&&DT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rPa(e,t,r)};Object.defineProperty(DT,"__esModule",{value:!0});Wee(ZEr(),DT);Wee(XEr(),DT);Wee(a_r(),DT);Wee(C0t(),DT);Wee(c_r(),DT);Wee(W1i(),DT);Wee(Y1i(),DT)});var x0t=I(d_r=>{"use strict";p();Object.defineProperty(d_r,"__esModule",{value:!0});d_r.IndexPropertyKeys=K1i;var nPa=U2(),oOe=gs();function iPa(t){return(0,nPa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(iPa,"FromTemplateLiteral");function oPa(t){let e=[];for(let r of t)e.push(...K1i(r));return e}a(oPa,"FromUnion");function sPa(t){return[t.toString()]}a(sPa,"FromLiteral");function K1i(t){return[...new Set((0,oOe.IsTemplateLiteral)(t)?iPa(t):(0,oOe.IsUnion)(t)?oPa(t.anyOf):(0,oOe.IsLiteral)(t)?sPa(t.const):(0,oOe.IsNumber)(t)?["[number]"]:(0,oOe.IsInteger)(t)?["[number]"]:[])]}a(K1i,"IndexPropertyKeys")});var p_r=I(f_r=>{"use strict";p();Object.defineProperty(f_r,"__esModule",{value:!0});f_r.IndexFromMappedResult=fPa;var aPa=f0(),cPa=x0t(),lPa=Q2();function uPa(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,lPa.Index)(t,(0,cPa.IndexPropertyKeys)(e[o]),r);return n}a(uPa,"FromProperties");function dPa(t,e,r){return uPa(t,e.properties,r)}a(dPa,"FromMappedResult");function fPa(t,e,r){let n=dPa(t,e,r);return(0,aPa.MappedResult)(n)}a(fPa,"IndexFromMappedResult")});var R0t=I(Ime=>{"use strict";p();Object.defineProperty(Ime,"__esModule",{value:!0});Ime.IndexFromPropertyKey=m_r;Ime.IndexFromPropertyKeys=eSi;Ime.IndexFromComputed=IPa;Ime.Index=xPa;var pPa=Ti(),hPa=bf(),Z1i=iG(),w0t=d0(),mPa=NT(),h_r=mp(),gPa=x0t(),APa=g_r(),yPa=p_r(),Qb=gs();function X1i(t,e){return t.map(r=>m_r(r,e))}a(X1i,"FromRest");function EPa(t){return t.filter(e=>!(0,Qb.IsNever)(e))}a(EPa,"FromIntersectRest");function _Pa(t,e){return(0,mPa.IntersectEvaluated)(EPa(X1i(t,e)))}a(_Pa,"FromIntersect");function CPa(t){return t.some(e=>(0,Qb.IsNever)(e))?[]:t}a(CPa,"FromUnionRest");function vPa(t,e){return(0,h_r.UnionEvaluated)(CPa(X1i(t,e)))}a(vPa,"FromUnion");function bPa(t,e){return e in t?t[e]:e==="[number]"?(0,h_r.UnionEvaluated)(t):(0,w0t.Never)()}a(bPa,"FromTuple");function SPa(t,e){return e==="[number]"?t:(0,w0t.Never)()}a(SPa,"FromArray");function TPa(t,e){return e in t?t[e]:(0,w0t.Never)()}a(TPa,"FromProperty");function m_r(t,e){return(0,Qb.IsIntersect)(t)?_Pa(t.allOf,e):(0,Qb.IsUnion)(t)?vPa(t.anyOf,e):(0,Qb.IsTuple)(t)?bPa(t.items??[],e):(0,Qb.IsArray)(t)?SPa(t.items,e):(0,Qb.IsObject)(t)?TPa(t.properties,e):(0,w0t.Never)()}a(m_r,"IndexFromPropertyKey");function eSi(t,e){return e.map(r=>m_r(t,r))}a(eSi,"IndexFromPropertyKeys");function J1i(t,e){return(0,h_r.UnionEvaluated)(eSi(t,e))}a(J1i,"FromSchema");function IPa(t,e){return(0,Z1i.Computed)("Index",[t,e])}a(IPa,"IndexFromComputed");function xPa(t,e,r){if((0,Qb.IsRef)(t)||(0,Qb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Qb.IsSchema)(t)||!(0,Qb.IsSchema)(e))throw new hPa.TypeBoxError(n);return(0,Z1i.Computed)("Index",[t,e])}return(0,Qb.IsMappedResult)(e)?(0,yPa.IndexFromMappedResult)(t,e,r):(0,Qb.IsMappedKey)(e)?(0,APa.IndexFromMappedKey)(t,e,r):(0,pPa.CreateType)((0,Qb.IsSchema)(e)?J1i(t,(0,gPa.IndexPropertyKeys)(e)):J1i(t,e),r)}a(xPa,"Index")});var g_r=I(A_r=>{"use strict";p();Object.defineProperty(A_r,"__esModule",{value:!0});A_r.IndexFromMappedKey=MPa;var wPa=R0t(),RPa=f0(),kPa=Lb();function PPa(t,e,r){return{[e]:(0,wPa.Index)(t,[e],(0,kPa.Clone)(r))}}a(PPa,"MappedIndexPropertyKey");function DPa(t,e,r){return e.reduce((n,o)=>({...n,...PPa(t,o,r)}),{})}a(DPa,"MappedIndexPropertyKeys");function NPa(t,e,r){return DPa(t,e.keys,r)}a(NPa,"MappedIndexProperties");function MPa(t,e,r){let n=NPa(t,e,r);return(0,RPa.MappedResult)(n)}a(MPa,"IndexFromMappedKey")});var Q2=I(p4=>{"use strict";p();var OPa=p4&&p4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k0t=p4&&p4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OPa(e,t,r)};Object.defineProperty(p4,"__esModule",{value:!0});k0t(g_r(),p4);k0t(p_r(),p4);k0t(x0t(),p4);k0t(R0t(),p4)});var tSi=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.Iterator=FPa;var BPa=Ti(),LPa=_n();function FPa(t,e){return(0,BPa.CreateType)({[LPa.Kind]:"Iterator",type:"Iterator",items:t},e)}a(FPa,"Iterator")});var xme=I(zee=>{"use strict";p();var UPa=zee&&zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QPa=zee&&zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UPa(e,t,r)};Object.defineProperty(zee,"__esModule",{value:!0});QPa(tSi(),zee)});var nSi=I(P0t=>{"use strict";p();Object.defineProperty(P0t,"__esModule",{value:!0});P0t.Object=void 0;var qPa=Ti(),rSi=_n(),jPa=gs();function HPa(t){return globalThis.Object.keys(t).filter(e=>!(0,jPa.IsOptional)(t[e]))}a(HPa,"RequiredArray");function GPa(t,e){let r=HPa(t),n=r.length>0?{[rSi.Kind]:"Object",type:"object",required:r,properties:t}:{[rSi.Kind]:"Object",type:"object",properties:t};return(0,qPa.CreateType)(n,e)}a(GPa,"_Object");P0t.Object=GPa});var dC=I(Yee=>{"use strict";p();var $Pa=Yee&&Yee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VPa=Yee&&Yee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Pa(e,t,r)};Object.defineProperty(Yee,"__esModule",{value:!0});VPa(nSi(),Yee)});var iSi=I(E_r=>{"use strict";p();Object.defineProperty(E_r,"__esModule",{value:!0});E_r.Promise=YPa;var WPa=Ti(),zPa=_n();function YPa(t,e){return(0,WPa.CreateType)({[zPa.Kind]:"Promise",type:"Promise",item:t},e)}a(YPa,"Promise")});var sOe=I(Kee=>{"use strict";p();var KPa=Kee&&Kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JPa=Kee&&Kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KPa(e,t,r)};Object.defineProperty(Kee,"__esModule",{value:!0});JPa(iSi(),Kee)});var C_r=I(__r=>{"use strict";p();Object.defineProperty(__r,"__esModule",{value:!0});__r.Readonly=i2a;var oSi=Ti(),sSi=_n(),ZPa=S8(),XPa=v_r(),e2a=gs();function t2a(t){return(0,oSi.CreateType)((0,ZPa.Discard)(t,[sSi.ReadonlyKind]))}a(t2a,"RemoveReadonly");function r2a(t){return(0,oSi.CreateType)({...t,[sSi.ReadonlyKind]:"Readonly"})}a(r2a,"AddReadonly");function n2a(t,e){return e===!1?t2a(t):r2a(t)}a(n2a,"ReadonlyWithFlag");function i2a(t,e){let r=e??!0;return(0,e2a.IsMappedResult)(t)?(0,XPa.ReadonlyFromMappedResult)(t,r):n2a(t,r)}a(i2a,"Readonly")});var v_r=I(b_r=>{"use strict";p();Object.defineProperty(b_r,"__esModule",{value:!0});b_r.ReadonlyFromMappedResult=l2a;var o2a=f0(),s2a=C_r();function a2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,s2a.Readonly)(t[n],e);return r}a(a2a,"FromProperties");function c2a(t,e){return a2a(t.properties,e)}a(c2a,"FromMappedResult");function l2a(t,e){let r=c2a(t,e);return(0,o2a.MappedResult)(r)}a(l2a,"ReadonlyFromMappedResult")});var uG=I(lG=>{"use strict";p();var u2a=lG&&lG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aSi=lG&&lG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u2a(e,t,r)};Object.defineProperty(lG,"__esModule",{value:!0});aSi(v_r(),lG);aSi(C_r(),lG)});var lSi=I(S_r=>{"use strict";p();Object.defineProperty(S_r,"__esModule",{value:!0});S_r.Tuple=f2a;var d2a=Ti(),cSi=_n();function f2a(t,e){return(0,d2a.CreateType)(t.length>0?{[cSi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[cSi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(f2a,"Tuple")});var x8=I(Jee=>{"use strict";p();var p2a=Jee&&Jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h2a=Jee&&Jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p2a(e,t,r)};Object.defineProperty(Jee,"__esModule",{value:!0});h2a(lSi(),Jee)});var mSi=I(D0t=>{"use strict";p();Object.defineProperty(D0t,"__esModule",{value:!0});D0t.MappedFunctionReturnType=hSi;D0t.Mapped=M2a;var T_r=_n(),uSi=S8(),m2a=Eme(),g2a=_me(),A2a=Cme(),y2a=oG(),E2a=Q2(),_2a=NT(),C2a=xme(),dSi=TE(),fSi=dC(),v2a=f4(),b2a=sOe(),S2a=uG(),T2a=x8(),I2a=mp(),x2a=ZMe(),w2a=HEr(),fC=gs();function pSi(t,e){return t in e?oR(t,e[t]):(0,w2a.MappedResult)(e)}a(pSi,"FromMappedResult");function R2a(t){return{[t]:(0,dSi.Literal)(t)}}a(R2a,"MappedKeyToKnownMappedResultProperties");function k2a(t){let e={};for(let r of t)e[r]=(0,dSi.Literal)(r);return e}a(k2a,"MappedKeyToUnknownMappedResultProperties");function P2a(t,e){return(0,x2a.SetIncludes)(e,t)?R2a(t):k2a(e)}a(P2a,"MappedKeyToMappedResultProperties");function D2a(t,e){let r=P2a(t,e);return pSi(t,r)}a(D2a,"FromMappedKey");function aOe(t,e){return e.map(r=>oR(t,r))}a(aOe,"FromRest");function N2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=oR(t,e[n]);return r}a(N2a,"FromProperties");function oR(t,e){let r={...e};return(0,fC.IsOptional)(e)?(0,v2a.Optional)(oR(t,(0,uSi.Discard)(e,[T_r.OptionalKind]))):(0,fC.IsReadonly)(e)?(0,S2a.Readonly)(oR(t,(0,uSi.Discard)(e,[T_r.ReadonlyKind]))):(0,fC.IsMappedResult)(e)?pSi(t,e.properties):(0,fC.IsMappedKey)(e)?D2a(t,e.keys):(0,fC.IsConstructor)(e)?(0,A2a.Constructor)(aOe(t,e.parameters),oR(t,e.returns),r):(0,fC.IsFunction)(e)?(0,y2a.Function)(aOe(t,e.parameters),oR(t,e.returns),r):(0,fC.IsAsyncIterator)(e)?(0,g2a.AsyncIterator)(oR(t,e.items),r):(0,fC.IsIterator)(e)?(0,C2a.Iterator)(oR(t,e.items),r):(0,fC.IsIntersect)(e)?(0,_2a.Intersect)(aOe(t,e.allOf),r):(0,fC.IsUnion)(e)?(0,I2a.Union)(aOe(t,e.anyOf),r):(0,fC.IsTuple)(e)?(0,T2a.Tuple)(aOe(t,e.items??[]),r):(0,fC.IsObject)(e)?(0,fSi.Object)(N2a(t,e.properties),r):(0,fC.IsArray)(e)?(0,m2a.Array)(oR(t,e.items),r):(0,fC.IsPromise)(e)?(0,b2a.Promise)(oR(t,e.item),r):e}a(oR,"FromSchemaType");function hSi(t,e){let r={};for(let n of t)r[n]=oR(n,e);return r}a(hSi,"MappedFunctionReturnType");function M2a(t,e,r){let n=(0,fC.IsSchema)(t)?(0,E2a.IndexPropertyKeys)(t):t,o=e({[T_r.Kind]:"MappedKey",keys:n}),s=hSi(n,o);return(0,fSi.Object)(s,r)}a(M2a,"Mapped")});var f0=I(w8=>{"use strict";p();var O2a=w8&&w8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),I_r=w8&&w8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O2a(e,t,r)};Object.defineProperty(w8,"__esModule",{value:!0});I_r(R1i(),w8);I_r(HEr(),w8);I_r(mSi(),w8)});var w_r=I(x_r=>{"use strict";p();Object.defineProperty(x_r,"__esModule",{value:!0});x_r.Optional=j2a;var gSi=Ti(),ASi=_n(),B2a=S8(),L2a=R_r(),F2a=gs();function U2a(t){return(0,gSi.CreateType)((0,B2a.Discard)(t,[ASi.OptionalKind]))}a(U2a,"RemoveOptional");function Q2a(t){return(0,gSi.CreateType)({...t,[ASi.OptionalKind]:"Optional"})}a(Q2a,"AddOptional");function q2a(t,e){return e===!1?U2a(t):Q2a(t)}a(q2a,"OptionalWithFlag");function j2a(t,e){let r=e??!0;return(0,F2a.IsMappedResult)(t)?(0,L2a.OptionalFromMappedResult)(t,r):q2a(t,r)}a(j2a,"Optional")});var R_r=I(k_r=>{"use strict";p();Object.defineProperty(k_r,"__esModule",{value:!0});k_r.OptionalFromMappedResult=W2a;var H2a=f0(),G2a=w_r();function $2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,G2a.Optional)(t[n],e);return r}a($2a,"FromProperties");function V2a(t,e){return $2a(t.properties,e)}a(V2a,"FromMappedResult");function W2a(t,e){let r=V2a(t,e);return(0,H2a.MappedResult)(r)}a(W2a,"OptionalFromMappedResult")});var f4=I(dG=>{"use strict";p();var z2a=dG&&dG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ySi=dG&&dG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z2a(e,t,r)};Object.defineProperty(dG,"__esModule",{value:!0});ySi(R_r(),dG);ySi(w_r(),dG)});var N_r=I(D_r=>{"use strict";p();Object.defineProperty(D_r,"__esModule",{value:!0});D_r.IntersectCreate=K2a;var Y2a=Ti(),ESi=_n(),P_r=gs();function K2a(t,e={}){let r=t.every(o=>(0,P_r.IsObject)(o)),n=(0,P_r.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,Y2a.CreateType)(e.unevaluatedProperties===!1||(0,P_r.IsSchema)(e.unevaluatedProperties)||r?{...n,[ESi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[ESi.Kind]:"Intersect",allOf:t},e)}a(K2a,"IntersectCreate")});var vSi=I(O_r=>{"use strict";p();Object.defineProperty(O_r,"__esModule",{value:!0});O_r.IntersectEvaluated=oDa;var J2a=_n(),Z2a=Ti(),X2a=S8(),eDa=d0(),tDa=f4(),_Si=N_r(),M_r=gs();function rDa(t){return t.every(e=>(0,M_r.IsOptional)(e))}a(rDa,"IsIntersectOptional");function nDa(t){return(0,X2a.Discard)(t,[J2a.OptionalKind])}a(nDa,"RemoveOptionalFromType");function CSi(t){return t.map(e=>(0,M_r.IsOptional)(e)?nDa(e):e)}a(CSi,"RemoveOptionalFromRest");function iDa(t,e){return rDa(t)?(0,tDa.Optional)((0,_Si.IntersectCreate)(CSi(t),e)):(0,_Si.IntersectCreate)(CSi(t),e)}a(iDa,"ResolveIntersect");function oDa(t,e={}){if(t.length===1)return(0,Z2a.CreateType)(t[0],e);if(t.length===0)return(0,eDa.Never)(e);if(t.some(r=>(0,M_r.IsTransform)(r)))throw new Error("Cannot intersect transform types");return iDa(t,e)}a(oDa,"IntersectEvaluated")});var SSi=I(bSi=>{"use strict";p();Object.defineProperty(bSi,"__esModule",{value:!0});var M0p=_n()});var TSi=I(B_r=>{"use strict";p();Object.defineProperty(B_r,"__esModule",{value:!0});B_r.Intersect=uDa;var sDa=Ti(),aDa=d0(),cDa=N_r(),lDa=gs();function uDa(t,e){if(t.length===1)return(0,sDa.CreateType)(t[0],e);if(t.length===0)return(0,aDa.Never)(e);if(t.some(r=>(0,lDa.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,cDa.IntersectCreate)(t,e)}a(uDa,"Intersect")});var NT=I(R8=>{"use strict";p();var dDa=R8&&R8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),L_r=R8&&R8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dDa(e,t,r)};Object.defineProperty(R8,"__esModule",{value:!0});L_r(vSi(),R8);L_r(SSi(),R8);L_r(TSi(),R8)});var ISi=I(F_r=>{"use strict";p();Object.defineProperty(F_r,"__esModule",{value:!0});F_r.Ref=mDa;var fDa=bf(),pDa=Ti(),hDa=_n();function mDa(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new fDa.TypeBoxError("Ref: $ref must be a string");return(0,pDa.CreateType)({[hDa.Kind]:"Ref",$ref:e},r)}a(mDa,"Ref")});var fG=I(Zee=>{"use strict";p();var gDa=Zee&&Zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ADa=Zee&&Zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gDa(e,t,r)};Object.defineProperty(Zee,"__esModule",{value:!0});ADa(ISi(),Zee)});var wSi=I(q_r=>{"use strict";p();Object.defineProperty(q_r,"__esModule",{value:!0});q_r.Awaited=Q_r;var yDa=Ti(),U_r=iG(),EDa=NT(),_Da=mp(),CDa=fG(),cOe=gs();function vDa(t,e){return(0,U_r.Computed)("Awaited",[(0,U_r.Computed)(t,e)])}a(vDa,"FromComputed");function bDa(t){return(0,U_r.Computed)("Awaited",[(0,CDa.Ref)(t)])}a(bDa,"FromRef");function SDa(t){return(0,EDa.Intersect)(xSi(t))}a(SDa,"FromIntersect");function TDa(t){return(0,_Da.Union)(xSi(t))}a(TDa,"FromUnion");function IDa(t){return Q_r(t)}a(IDa,"FromPromise");function xSi(t){return t.map(e=>Q_r(e))}a(xSi,"FromRest");function Q_r(t,e){return(0,yDa.CreateType)((0,cOe.IsComputed)(t)?vDa(t.target,t.parameters):(0,cOe.IsIntersect)(t)?SDa(t.allOf):(0,cOe.IsUnion)(t)?TDa(t.anyOf):(0,cOe.IsPromise)(t)?IDa(t.item):(0,cOe.IsRef)(t)?bDa(t.$ref):t,e)}a(Q_r,"Awaited")});var lOe=I(Xee=>{"use strict";p();var xDa=Xee&&Xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wDa=Xee&&Xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xDa(e,t,r)};Object.defineProperty(Xee,"__esModule",{value:!0});wDa(wSi(),Xee)});var M0t=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.KeyOfPropertyKeys=H_r;N0t.KeyOfPattern=ODa;var RSi=ZMe(),wme=gs();function kSi(t){let e=[];for(let r of t)e.push(H_r(r));return e}a(kSi,"FromRest");function RDa(t){let e=kSi(t);return(0,RSi.SetUnionMany)(e)}a(RDa,"FromIntersect");function kDa(t){let e=kSi(t);return(0,RSi.SetIntersectMany)(e)}a(kDa,"FromUnion");function PDa(t){return t.map((e,r)=>r.toString())}a(PDa,"FromTuple");function DDa(t){return["[number]"]}a(DDa,"FromArray");function NDa(t){return globalThis.Object.getOwnPropertyNames(t)}a(NDa,"FromProperties");function MDa(t){return j_r?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(MDa,"FromPatternProperties");function H_r(t){return(0,wme.IsIntersect)(t)?RDa(t.allOf):(0,wme.IsUnion)(t)?kDa(t.anyOf):(0,wme.IsTuple)(t)?PDa(t.items??[]):(0,wme.IsArray)(t)?DDa(t.items):(0,wme.IsObject)(t)?NDa(t.properties):(0,wme.IsRecord)(t)?MDa(t.patternProperties):[]}a(H_r,"KeyOfPropertyKeys");var j_r=!1;function ODa(t){j_r=!0;let e=H_r(t);return j_r=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(ODa,"KeyOfPattern")});var V_r=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.KeyOfPropertyKeysToRest=PSi;O0t.KeyOf=VDa;var BDa=Ti(),LDa=TE(),FDa=sG(),$_r=iG(),UDa=fG(),QDa=M0t(),qDa=mp(),jDa=W_r(),G_r=gs();function HDa(t,e){return(0,$_r.Computed)("KeyOf",[(0,$_r.Computed)(t,e)])}a(HDa,"FromComputed");function GDa(t){return(0,$_r.Computed)("KeyOf",[(0,UDa.Ref)(t)])}a(GDa,"FromRef");function $Da(t,e){let r=(0,QDa.KeyOfPropertyKeys)(t),n=PSi(r),o=(0,qDa.UnionEvaluated)(n);return(0,BDa.CreateType)(o,e)}a($Da,"KeyOfFromType");function PSi(t){return t.map(e=>e==="[number]"?(0,FDa.Number)():(0,LDa.Literal)(e))}a(PSi,"KeyOfPropertyKeysToRest");function VDa(t,e){return(0,G_r.IsComputed)(t)?HDa(t.target,t.parameters):(0,G_r.IsRef)(t)?GDa(t.$ref):(0,G_r.IsMappedResult)(t)?(0,jDa.KeyOfFromMappedResult)(t,e):$Da(t,e)}a(VDa,"KeyOf")});var W_r=I(z_r=>{"use strict";p();Object.defineProperty(z_r,"__esModule",{value:!0});z_r.KeyOfFromMappedResult=ZDa;var WDa=f0(),zDa=V_r(),YDa=Lb();function KDa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,zDa.KeyOf)(t[n],(0,YDa.Clone)(e));return r}a(KDa,"FromProperties");function JDa(t,e){return KDa(t.properties,e)}a(JDa,"FromMappedResult");function ZDa(t,e){let r=JDa(t,e);return(0,WDa.MappedResult)(r)}a(ZDa,"KeyOfFromMappedResult")});var DSi=I(Y_r=>{"use strict";p();Object.defineProperty(Y_r,"__esModule",{value:!0});Y_r.KeyOfPropertyEntries=tNa;var XDa=R0t(),eNa=M0t();function tNa(t){let e=(0,eNa.KeyOfPropertyKeys)(t),r=(0,XDa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(tNa,"KeyOfPropertyEntries")});var q2=I(h4=>{"use strict";p();var rNa=h4&&h4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B0t=h4&&h4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rNa(e,t,r)};Object.defineProperty(h4,"__esModule",{value:!0});B0t(W_r(),h4);B0t(DSi(),h4);B0t(M0t(),h4);B0t(V_r(),h4)});var NSi=I(K_r=>{"use strict";p();Object.defineProperty(K_r,"__esModule",{value:!0});K_r.Composite=pNa;var nNa=NT(),iNa=Q2(),oNa=q2(),sNa=dC(),aNa=ZMe(),cNa=gs();function lNa(t){let e=[];for(let r of t)e.push(...(0,oNa.KeyOfPropertyKeys)(r));return(0,aNa.SetDistinct)(e)}a(lNa,"CompositeKeys");function uNa(t){return t.filter(e=>!(0,cNa.IsNever)(e))}a(uNa,"FilterNever");function dNa(t,e){let r=[];for(let n of t)r.push(...(0,iNa.IndexFromPropertyKeys)(n,[e]));return uNa(r)}a(dNa,"CompositeProperty");function fNa(t,e){let r={};for(let n of e)r[n]=(0,nNa.IntersectEvaluated)(dNa(t,n));return r}a(fNa,"CompositeProperties");function pNa(t,e){let r=lNa(t),n=fNa(t,r);return(0,sNa.Object)(n,e)}a(pNa,"Composite")});var L0t=I(ete=>{"use strict";p();var hNa=ete&&ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mNa=ete&&ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hNa(e,t,r)};Object.defineProperty(ete,"__esModule",{value:!0});mNa(NSi(),ete)});var MSi=I(J_r=>{"use strict";p();Object.defineProperty(J_r,"__esModule",{value:!0});J_r.Date=yNa;var gNa=_n(),ANa=Ti();function yNa(t){return(0,ANa.CreateType)({[gNa.Kind]:"Date",type:"Date"},t)}a(yNa,"Date")});var uOe=I(tte=>{"use strict";p();var ENa=tte&&tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Na=tte&&tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ENa(e,t,r)};Object.defineProperty(tte,"__esModule",{value:!0});_Na(MSi(),tte)});var OSi=I(Z_r=>{"use strict";p();Object.defineProperty(Z_r,"__esModule",{value:!0});Z_r.Null=bNa;var CNa=Ti(),vNa=_n();function bNa(t){return(0,CNa.CreateType)({[vNa.Kind]:"Null",type:"null"},t)}a(bNa,"Null")});var dOe=I(rte=>{"use strict";p();var SNa=rte&&rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),TNa=rte&&rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SNa(e,t,r)};Object.defineProperty(rte,"__esModule",{value:!0});TNa(OSi(),rte)});var BSi=I(X_r=>{"use strict";p();Object.defineProperty(X_r,"__esModule",{value:!0});X_r.Symbol=wNa;var INa=Ti(),xNa=_n();function wNa(t){return(0,INa.CreateType)({[xNa.Kind]:"Symbol",type:"symbol"},t)}a(wNa,"Symbol")});var fOe=I(nte=>{"use strict";p();var RNa=nte&&nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kNa=nte&&nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RNa(e,t,r)};Object.defineProperty(nte,"__esModule",{value:!0});kNa(BSi(),nte)});var LSi=I(eCr=>{"use strict";p();Object.defineProperty(eCr,"__esModule",{value:!0});eCr.Undefined=NNa;var PNa=Ti(),DNa=_n();function NNa(t){return(0,PNa.CreateType)({[DNa.Kind]:"Undefined",type:"undefined"},t)}a(NNa,"Undefined")});var pOe=I(ite=>{"use strict";p();var MNa=ite&&ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ONa=ite&&ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MNa(e,t,r)};Object.defineProperty(ite,"__esModule",{value:!0});ONa(LSi(),ite)});var FSi=I(tCr=>{"use strict";p();Object.defineProperty(tCr,"__esModule",{value:!0});tCr.Uint8Array=FNa;var BNa=Ti(),LNa=_n();function FNa(t){return(0,BNa.CreateType)({[LNa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(FNa,"Uint8Array")});var hOe=I(ote=>{"use strict";p();var UNa=ote&&ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QNa=ote&&ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UNa(e,t,r)};Object.defineProperty(ote,"__esModule",{value:!0});QNa(FSi(),ote)});var USi=I(rCr=>{"use strict";p();Object.defineProperty(rCr,"__esModule",{value:!0});rCr.Unknown=HNa;var qNa=Ti(),jNa=_n();function HNa(t){return(0,qNa.CreateType)({[jNa.Kind]:"Unknown"},t)}a(HNa,"Unknown")});var pG=I(ste=>{"use strict";p();var GNa=ste&&ste.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Na=ste&&ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GNa(e,t,r)};Object.defineProperty(ste,"__esModule",{value:!0});$Na(USi(),ste)});var jSi=I(sCr=>{"use strict";p();Object.defineProperty(sCr,"__esModule",{value:!0});sCr.Const=iMa;var QSi=yme(),VNa=Tme(),WNa=uOe(),zNa=oG(),nCr=TE(),YNa=dOe(),qSi=dC(),KNa=fOe(),JNa=x8(),iCr=uG(),ZNa=pOe(),XNa=hOe(),eMa=pG(),tMa=v8(),qb=uC();function rMa(t){return t.map(e=>oCr(e,!1))}a(rMa,"FromArray");function nMa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,iCr.Readonly)(oCr(t[r],!1));return e}a(nMa,"FromProperties");function F0t(t,e){return e===!0?t:(0,iCr.Readonly)(t)}a(F0t,"ConditionalReadonly");function oCr(t,e){return(0,qb.IsAsyncIterator)(t)||(0,qb.IsIterator)(t)?F0t((0,QSi.Any)(),e):(0,qb.IsArray)(t)?(0,iCr.Readonly)((0,JNa.Tuple)(rMa(t))):(0,qb.IsUint8Array)(t)?(0,XNa.Uint8Array)():(0,qb.IsDate)(t)?(0,WNa.Date)():(0,qb.IsObject)(t)?F0t((0,qSi.Object)(nMa(t)),e):(0,qb.IsFunction)(t)?F0t((0,zNa.Function)([],(0,eMa.Unknown)()),e):(0,qb.IsUndefined)(t)?(0,ZNa.Undefined)():(0,qb.IsNull)(t)?(0,YNa.Null)():(0,qb.IsSymbol)(t)?(0,KNa.Symbol)():(0,qb.IsBigInt)(t)?(0,VNa.BigInt)():(0,qb.IsNumber)(t)||(0,qb.IsBoolean)(t)||(0,qb.IsString)(t)?(0,nCr.Literal)(t):(0,qSi.Object)({})}a(oCr,"FromValue");function iMa(t,e){return(0,tMa.CreateType)(oCr(t,!0),e)}a(iMa,"Const")});var U0t=I(ate=>{"use strict";p();var oMa=ate&&ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sMa=ate&&ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&oMa(e,t,r)};Object.defineProperty(ate,"__esModule",{value:!0});sMa(jSi(),ate)});var HSi=I(k8=>{"use strict";p();var aMa=k8&&k8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cMa=k8&&k8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),lMa=k8&&k8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var hMa=cte&&cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mMa=cte&&cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hMa(e,t,r)};Object.defineProperty(cte,"__esModule",{value:!0});mMa(HSi(),cte)});var GSi=I(aCr=>{"use strict";p();Object.defineProperty(aCr,"__esModule",{value:!0});aCr.Enum=_Ma;var gMa=TE(),AMa=_n(),yMa=mp(),EMa=uC();function _Ma(t,e){if((0,EMa.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,gMa.Literal)(s));return(0,yMa.Union)(o,{...e,[AMa.Hint]:"Enum"})}a(_Ma,"Enum")});var q0t=I(lte=>{"use strict";p();var CMa=lte&<e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vMa=lte&<e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CMa(e,t,r)};Object.defineProperty(lte,"__esModule",{value:!0});vMa(GSi(),lte)});var mCr=I(ute=>{"use strict";p();Object.defineProperty(ute,"__esModule",{value:!0});ute.ExtendsResult=ute.ExtendsResolverError=void 0;ute.ExtendsCheck=dOa;var $Si=yme(),bMa=oG(),fCr=sG(),lCr=aG(),SMa=pG(),VSi=U2(),Rme=JMe(),JSi=_n(),TMa=bf(),$e=DEr(),j0t=class extends TMa.TypeBoxError{static{a(this,"ExtendsResolverError")}};ute.ExtendsResolverError=j0t;var Dt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Dt||(ute.ExtendsResult=Dt={}));function sR(t){return t===Dt.False?t:Dt.True}a(sR,"IntoBooleanResult");function kme(t){throw new j0t(t)}a(kme,"Throw");function p0(t){return $e.TypeGuard.IsNever(t)||$e.TypeGuard.IsIntersect(t)||$e.TypeGuard.IsUnion(t)||$e.TypeGuard.IsUnknown(t)||$e.TypeGuard.IsAny(t)}a(p0,"IsStructuralRight");function h0(t,e){return $e.TypeGuard.IsNever(e)?eTi(t,e):$e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsUnknown(e)?iTi(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):kme("StructuralRight")}a(h0,"StructuralRight");function pCr(t,e){return Dt.True}a(pCr,"FromAnyRight");function IMa(t,e){return $e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>$e.TypeGuard.IsAny(r)||$e.TypeGuard.IsUnknown(r))?Dt.True:$e.TypeGuard.IsUnion(e)?Dt.Union:$e.TypeGuard.IsUnknown(e)||$e.TypeGuard.IsAny(e)?Dt.True:Dt.Union}a(IMa,"FromAny");function xMa(t,e){return $e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:$e.TypeGuard.IsNever(t)?Dt.True:Dt.False}a(xMa,"FromArrayRight");function wMa(t,e){return $e.TypeGuard.IsObject(e)&&G0t(e)?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsArray(e)?sR(ul(t.items,e.items)):Dt.False}a(wMa,"FromArray");function RMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsAsyncIterator(e)?sR(ul(t.items,e.items)):Dt.False}a(RMa,"FromAsyncIterator");function kMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsBigInt(e)?Dt.True:Dt.False}a(kMa,"FromBigInt");function ZSi(t,e){return $e.TypeGuard.IsLiteralBoolean(t)||$e.TypeGuard.IsBoolean(t)?Dt.True:Dt.False}a(ZSi,"FromBooleanRight");function PMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsBoolean(e)?Dt.True:Dt.False}a(PMa,"FromBoolean");function DMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Dt.False:t.parameters.every((r,n)=>sR(ul(e.parameters[n],r))===Dt.True)?sR(ul(t.returns,e.returns)):Dt.False:Dt.False}a(DMa,"FromConstructor");function NMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsDate(e)?Dt.True:Dt.False}a(NMa,"FromDate");function MMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Dt.False:t.parameters.every((r,n)=>sR(ul(e.parameters[n],r))===Dt.True)?sR(ul(t.returns,e.returns)):Dt.False:Dt.False}a(MMa,"FromFunction");function XSi(t,e){return $e.TypeGuard.IsLiteral(t)&&$e.ValueGuard.IsNumber(t.const)||$e.TypeGuard.IsNumber(t)||$e.TypeGuard.IsInteger(t)?Dt.True:Dt.False}a(XSi,"FromIntegerRight");function OMa(t,e){return $e.TypeGuard.IsInteger(e)||$e.TypeGuard.IsNumber(e)?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):Dt.False}a(OMa,"FromInteger");function H0t(t,e){return e.allOf.every(r=>ul(t,r)===Dt.True)?Dt.True:Dt.False}a(H0t,"FromIntersectRight");function BMa(t,e){return t.allOf.some(r=>ul(r,e)===Dt.True)?Dt.True:Dt.False}a(BMa,"FromIntersect");function LMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsIterator(e)?sR(ul(t.items,e.items)):Dt.False}a(LMa,"FromIterator");function FMa(t,e){return $e.TypeGuard.IsLiteral(e)&&e.const===t.const?Dt.True:p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsString(e)?nTi(t,e):$e.TypeGuard.IsNumber(e)?tTi(t,e):$e.TypeGuard.IsInteger(e)?XSi(t,e):$e.TypeGuard.IsBoolean(e)?ZSi(t,e):Dt.False}a(FMa,"FromLiteral");function eTi(t,e){return Dt.False}a(eTi,"FromNeverRight");function UMa(t,e){return Dt.True}a(UMa,"FromNever");function WSi(t){let[e,r]=[t,0];for(;$e.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,SMa.Unknown)()}a(WSi,"UnwrapTNot");function QMa(t,e){return $e.TypeGuard.IsNot(t)?ul(WSi(t),e):$e.TypeGuard.IsNot(e)?ul(t,WSi(e)):kme("Invalid fallthrough for Not")}a(QMa,"FromNot");function qMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsNull(e)?Dt.True:Dt.False}a(qMa,"FromNull");function tTi(t,e){return $e.TypeGuard.IsLiteralNumber(t)||$e.TypeGuard.IsNumber(t)||$e.TypeGuard.IsInteger(t)?Dt.True:Dt.False}a(tTi,"FromNumberRight");function jMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsInteger(e)||$e.TypeGuard.IsNumber(e)?Dt.True:Dt.False}a(jMa,"FromNumber");function jb(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(jb,"IsObjectPropertyCount");function zSi(t){return G0t(t)}a(zSi,"IsObjectStringLike");function YSi(t){return jb(t,0)||jb(t,1)&&"description"in t.properties&&$e.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&($e.TypeGuard.IsString(t.properties.description.anyOf[0])&&$e.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||$e.TypeGuard.IsString(t.properties.description.anyOf[1])&&$e.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(YSi,"IsObjectSymbolLike");function cCr(t){return jb(t,0)}a(cCr,"IsObjectNumberLike");function KSi(t){return jb(t,0)}a(KSi,"IsObjectBooleanLike");function HMa(t){return jb(t,0)}a(HMa,"IsObjectBigIntLike");function GMa(t){return jb(t,0)}a(GMa,"IsObjectDateLike");function $Ma(t){return G0t(t)}a($Ma,"IsObjectUint8ArrayLike");function VMa(t){let e=(0,fCr.Number)();return jb(t,0)||jb(t,1)&&"length"in t.properties&&sR(ul(t.properties.length,e))===Dt.True}a(VMa,"IsObjectFunctionLike");function WMa(t){return jb(t,0)}a(WMa,"IsObjectConstructorLike");function G0t(t){let e=(0,fCr.Number)();return jb(t,0)||jb(t,1)&&"length"in t.properties&&sR(ul(t.properties.length,e))===Dt.True}a(G0t,"IsObjectArrayLike");function zMa(t){let e=(0,bMa.Function)([(0,$Si.Any)()],(0,$Si.Any)());return jb(t,0)||jb(t,1)&&"then"in t.properties&&sR(ul(t.properties.then,e))===Dt.True}a(zMa,"IsObjectPromiseLike");function rTi(t,e){return ul(t,e)===Dt.False||$e.TypeGuard.IsOptional(t)&&!$e.TypeGuard.IsOptional(e)?Dt.False:Dt.True}a(rTi,"Property");function IE(t,e){return $e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:$e.TypeGuard.IsNever(t)||$e.TypeGuard.IsLiteralString(t)&&zSi(e)||$e.TypeGuard.IsLiteralNumber(t)&&cCr(e)||$e.TypeGuard.IsLiteralBoolean(t)&&KSi(e)||$e.TypeGuard.IsSymbol(t)&&YSi(e)||$e.TypeGuard.IsBigInt(t)&&HMa(e)||$e.TypeGuard.IsString(t)&&zSi(e)||$e.TypeGuard.IsSymbol(t)&&YSi(e)||$e.TypeGuard.IsNumber(t)&&cCr(e)||$e.TypeGuard.IsInteger(t)&&cCr(e)||$e.TypeGuard.IsBoolean(t)&&KSi(e)||$e.TypeGuard.IsUint8Array(t)&&$Ma(e)||$e.TypeGuard.IsDate(t)&&GMa(e)||$e.TypeGuard.IsConstructor(t)&&WMa(e)||$e.TypeGuard.IsFunction(t)&&VMa(e)?Dt.True:$e.TypeGuard.IsRecord(t)&&$e.TypeGuard.IsString(uCr(t))?e[JSi.Hint]==="Record"?Dt.True:Dt.False:$e.TypeGuard.IsRecord(t)&&$e.TypeGuard.IsNumber(uCr(t))&&jb(e,0)?Dt.True:Dt.False}a(IE,"FromObjectRight");function YMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!$e.TypeGuard.IsOptional(e.properties[r]))return Dt.False;if($e.TypeGuard.IsOptional(e.properties[r]))return Dt.True;if(rTi(t.properties[r],e.properties[r])===Dt.False)return Dt.False}return Dt.True})():Dt.False}a(YMa,"FromObject");function KMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)&&zMa(e)?Dt.True:$e.TypeGuard.IsPromise(e)?sR(ul(t.item,e.item)):Dt.False}a(KMa,"FromPromise");function uCr(t){return Rme.PatternNumberExact in t.patternProperties?(0,fCr.Number)():Rme.PatternStringExact in t.patternProperties?(0,lCr.String)():kme("Unknown record key pattern")}a(uCr,"RecordKey");function dCr(t){return Rme.PatternNumberExact in t.patternProperties?t.patternProperties[Rme.PatternNumberExact]:Rme.PatternStringExact in t.patternProperties?t.patternProperties[Rme.PatternStringExact]:kme("Unable to get record value schema")}a(dCr,"RecordValue");function aR(t,e){let[r,n]=[uCr(e),dCr(e)];return $e.TypeGuard.IsLiteralString(t)&&$e.TypeGuard.IsNumber(r)&&sR(ul(t,n))===Dt.True?Dt.True:$e.TypeGuard.IsUint8Array(t)&&$e.TypeGuard.IsNumber(r)||$e.TypeGuard.IsString(t)&&$e.TypeGuard.IsNumber(r)||$e.TypeGuard.IsArray(t)&&$e.TypeGuard.IsNumber(r)?ul(t,n):$e.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(rTi(n,t.properties[o])===Dt.False)return Dt.False;return Dt.True})():Dt.False}a(aR,"FromRecordRight");function JMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?ul(dCr(t),dCr(e)):Dt.False}a(JMa,"FromRecord");function ZMa(t,e){let r=$e.TypeGuard.IsRegExp(t)?(0,lCr.String)():t,n=$e.TypeGuard.IsRegExp(e)?(0,lCr.String)():e;return ul(r,n)}a(ZMa,"FromRegExp");function nTi(t,e){return $e.TypeGuard.IsLiteral(t)&&$e.ValueGuard.IsString(t.const)||$e.TypeGuard.IsString(t)?Dt.True:Dt.False}a(nTi,"FromStringRight");function XMa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsString(e)?Dt.True:Dt.False}a(XMa,"FromString");function eOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsSymbol(e)?Dt.True:Dt.False}a(eOa,"FromSymbol");function tOa(t,e){return $e.TypeGuard.IsTemplateLiteral(t)?ul((0,VSi.TemplateLiteralToUnion)(t),e):$e.TypeGuard.IsTemplateLiteral(e)?ul(t,(0,VSi.TemplateLiteralToUnion)(e)):kme("Invalid fallthrough for TemplateLiteral")}a(tOa,"FromTemplateLiteral");function rOa(t,e){return $e.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>ul(r,e.items)===Dt.True)}a(rOa,"IsArrayOfTuple");function nOa(t,e){return $e.TypeGuard.IsNever(t)?Dt.True:$e.TypeGuard.IsUnknown(t)?Dt.False:$e.TypeGuard.IsAny(t)?Dt.Union:Dt.False}a(nOa,"FromTupleRight");function iOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)&&G0t(e)||$e.TypeGuard.IsArray(e)&&rOa(t,e)?Dt.True:$e.TypeGuard.IsTuple(e)?$e.ValueGuard.IsUndefined(t.items)&&!$e.ValueGuard.IsUndefined(e.items)||!$e.ValueGuard.IsUndefined(t.items)&&$e.ValueGuard.IsUndefined(e.items)?Dt.False:$e.ValueGuard.IsUndefined(t.items)&&!$e.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>ul(r,e.items[n])===Dt.True)?Dt.True:Dt.False:Dt.False}a(iOa,"FromTuple");function oOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsUint8Array(e)?Dt.True:Dt.False}a(oOa,"FromUint8Array");function sOa(t,e){return p0(e)?h0(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsRecord(e)?aR(t,e):$e.TypeGuard.IsVoid(e)?lOa(t,e):$e.TypeGuard.IsUndefined(e)?Dt.True:Dt.False}a(sOa,"FromUndefined");function hCr(t,e){return e.anyOf.some(r=>ul(t,r)===Dt.True)?Dt.True:Dt.False}a(hCr,"FromUnionRight");function aOa(t,e){return t.anyOf.every(r=>ul(r,e)===Dt.True)?Dt.True:Dt.False}a(aOa,"FromUnion");function iTi(t,e){return Dt.True}a(iTi,"FromUnknownRight");function cOa(t,e){return $e.TypeGuard.IsNever(e)?eTi(t,e):$e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):$e.TypeGuard.IsString(e)?nTi(t,e):$e.TypeGuard.IsNumber(e)?tTi(t,e):$e.TypeGuard.IsInteger(e)?XSi(t,e):$e.TypeGuard.IsBoolean(e)?ZSi(t,e):$e.TypeGuard.IsArray(e)?xMa(t,e):$e.TypeGuard.IsTuple(e)?nOa(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsUnknown(e)?Dt.True:Dt.False}a(cOa,"FromUnknown");function lOa(t,e){return $e.TypeGuard.IsUndefined(t)||$e.TypeGuard.IsUndefined(t)?Dt.True:Dt.False}a(lOa,"FromVoidRight");function uOa(t,e){return $e.TypeGuard.IsIntersect(e)?H0t(t,e):$e.TypeGuard.IsUnion(e)?hCr(t,e):$e.TypeGuard.IsUnknown(e)?iTi(t,e):$e.TypeGuard.IsAny(e)?pCr(t,e):$e.TypeGuard.IsObject(e)?IE(t,e):$e.TypeGuard.IsVoid(e)?Dt.True:Dt.False}a(uOa,"FromVoid");function ul(t,e){return $e.TypeGuard.IsTemplateLiteral(t)||$e.TypeGuard.IsTemplateLiteral(e)?tOa(t,e):$e.TypeGuard.IsRegExp(t)||$e.TypeGuard.IsRegExp(e)?ZMa(t,e):$e.TypeGuard.IsNot(t)||$e.TypeGuard.IsNot(e)?QMa(t,e):$e.TypeGuard.IsAny(t)?IMa(t,e):$e.TypeGuard.IsArray(t)?wMa(t,e):$e.TypeGuard.IsBigInt(t)?kMa(t,e):$e.TypeGuard.IsBoolean(t)?PMa(t,e):$e.TypeGuard.IsAsyncIterator(t)?RMa(t,e):$e.TypeGuard.IsConstructor(t)?DMa(t,e):$e.TypeGuard.IsDate(t)?NMa(t,e):$e.TypeGuard.IsFunction(t)?MMa(t,e):$e.TypeGuard.IsInteger(t)?OMa(t,e):$e.TypeGuard.IsIntersect(t)?BMa(t,e):$e.TypeGuard.IsIterator(t)?LMa(t,e):$e.TypeGuard.IsLiteral(t)?FMa(t,e):$e.TypeGuard.IsNever(t)?UMa(t,e):$e.TypeGuard.IsNull(t)?qMa(t,e):$e.TypeGuard.IsNumber(t)?jMa(t,e):$e.TypeGuard.IsObject(t)?YMa(t,e):$e.TypeGuard.IsRecord(t)?JMa(t,e):$e.TypeGuard.IsString(t)?XMa(t,e):$e.TypeGuard.IsSymbol(t)?eOa(t,e):$e.TypeGuard.IsTuple(t)?iOa(t,e):$e.TypeGuard.IsPromise(t)?KMa(t,e):$e.TypeGuard.IsUint8Array(t)?oOa(t,e):$e.TypeGuard.IsUndefined(t)?sOa(t,e):$e.TypeGuard.IsUnion(t)?aOa(t,e):$e.TypeGuard.IsUnknown(t)?cOa(t,e):$e.TypeGuard.IsVoid(t)?uOa(t,e):kme(`Unknown left type operand '${t[JSi.Kind]}'`)}a(ul,"Visit");function dOa(t,e){return ul(t,e)}a(dOa,"ExtendsCheck")});var ACr=I(gCr=>{"use strict";p();Object.defineProperty(gCr,"__esModule",{value:!0});gCr.ExtendsFromMappedResult=AOa;var fOa=f0(),pOa=$0t(),hOa=Lb();function mOa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,pOa.Extends)(t[c],e,r,n,(0,hOa.Clone)(o));return s}a(mOa,"FromProperties");function gOa(t,e,r,n,o){return mOa(t.properties,e,r,n,o)}a(gOa,"FromMappedResult");function AOa(t,e,r,n,o){let s=gOa(t,e,r,n,o);return(0,fOa.MappedResult)(s)}a(AOa,"ExtendsFromMappedResult")});var $0t=I(ECr=>{"use strict";p();Object.defineProperty(ECr,"__esModule",{value:!0});ECr.Extends=vOa;var oTi=Ti(),yOa=mp(),yCr=mCr(),EOa=_Cr(),_Oa=ACr(),sTi=gs();function COa(t,e,r,n){let o=(0,yCr.ExtendsCheck)(t,e);return o===yCr.ExtendsResult.Union?(0,yOa.Union)([r,n]):o===yCr.ExtendsResult.True?r:n}a(COa,"ExtendsResolve");function vOa(t,e,r,n,o){return(0,sTi.IsMappedResult)(t)?(0,_Oa.ExtendsFromMappedResult)(t,e,r,n,o):(0,sTi.IsMappedKey)(t)?(0,oTi.CreateType)((0,EOa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,oTi.CreateType)(COa(t,e,r,n),o)}a(vOa,"Extends")});var _Cr=I(CCr=>{"use strict";p();Object.defineProperty(CCr,"__esModule",{value:!0});CCr.ExtendsFromMappedKey=kOa;var bOa=f0(),SOa=TE(),TOa=$0t(),IOa=Lb();function xOa(t,e,r,n,o){return{[t]:(0,TOa.Extends)((0,SOa.Literal)(t),e,r,n,(0,IOa.Clone)(o))}}a(xOa,"FromPropertyKey");function wOa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...xOa(c,e,r,n,o)}),{})}a(wOa,"FromPropertyKeys");function ROa(t,e,r,n,o){return wOa(t.keys,e,r,n,o)}a(ROa,"FromMappedKey");function kOa(t,e,r,n,o){let s=ROa(t,e,r,n,o);return(0,bOa.MappedResult)(s)}a(kOa,"ExtendsFromMappedKey")});var bCr=I(vCr=>{"use strict";p();Object.defineProperty(vCr,"__esModule",{value:!0});vCr.ExtendsUndefinedCheck=W0t;var V0t=_n();function POa(t){return t.allOf.every(e=>W0t(e))}a(POa,"Intersect");function DOa(t){return t.anyOf.some(e=>W0t(e))}a(DOa,"Union");function NOa(t){return!W0t(t.not)}a(NOa,"Not");function W0t(t){return t[V0t.Kind]==="Intersect"?POa(t):t[V0t.Kind]==="Union"?DOa(t):t[V0t.Kind]==="Not"?NOa(t):t[V0t.Kind]==="Undefined"}a(W0t,"ExtendsUndefinedCheck")});var dte=I(j2=>{"use strict";p();var MOa=j2&&j2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mOe=j2&&j2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MOa(e,t,r)};Object.defineProperty(j2,"__esModule",{value:!0});mOe(mCr(),j2);mOe(_Cr(),j2);mOe(ACr(),j2);mOe(bCr(),j2);mOe($0t(),j2)});var TCr=I(SCr=>{"use strict";p();Object.defineProperty(SCr,"__esModule",{value:!0});SCr.ExcludeFromTemplateLiteral=LOa;var OOa=z0t(),BOa=U2();function LOa(t,e){return(0,OOa.Exclude)((0,BOa.TemplateLiteralToUnion)(t),e)}a(LOa,"ExcludeFromTemplateLiteral")});var z0t=I(wCr=>{"use strict";p();Object.defineProperty(wCr,"__esModule",{value:!0});wCr.Exclude=HOa;var ICr=Ti(),FOa=mp(),UOa=d0(),Y0t=dte(),QOa=RCr(),qOa=TCr(),xCr=gs();function jOa(t,e){let r=t.filter(n=>(0,Y0t.ExtendsCheck)(n,e)===Y0t.ExtendsResult.False);return r.length===1?r[0]:(0,FOa.Union)(r)}a(jOa,"ExcludeRest");function HOa(t,e,r={}){return(0,xCr.IsTemplateLiteral)(t)?(0,ICr.CreateType)((0,qOa.ExcludeFromTemplateLiteral)(t,e),r):(0,xCr.IsMappedResult)(t)?(0,ICr.CreateType)((0,QOa.ExcludeFromMappedResult)(t,e),r):(0,ICr.CreateType)((0,xCr.IsUnion)(t)?jOa(t.anyOf,e):(0,Y0t.ExtendsCheck)(t,e)!==Y0t.ExtendsResult.False?(0,UOa.Never)():t,r)}a(HOa,"Exclude")});var RCr=I(kCr=>{"use strict";p();Object.defineProperty(kCr,"__esModule",{value:!0});kCr.ExcludeFromMappedResult=zOa;var GOa=f0(),$Oa=z0t();function VOa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,$Oa.Exclude)(t[n],e);return r}a(VOa,"FromProperties");function WOa(t,e){return VOa(t.properties,e)}a(WOa,"FromMappedResult");function zOa(t,e){let r=WOa(t,e);return(0,GOa.MappedResult)(r)}a(zOa,"ExcludeFromMappedResult")});var K0t=I(P8=>{"use strict";p();var YOa=P8&&P8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PCr=P8&&P8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YOa(e,t,r)};Object.defineProperty(P8,"__esModule",{value:!0});PCr(RCr(),P8);PCr(TCr(),P8);PCr(z0t(),P8)});var NCr=I(DCr=>{"use strict";p();Object.defineProperty(DCr,"__esModule",{value:!0});DCr.ExtractFromTemplateLiteral=ZOa;var KOa=J0t(),JOa=U2();function ZOa(t,e){return(0,KOa.Extract)((0,JOa.TemplateLiteralToUnion)(t),e)}a(ZOa,"ExtractFromTemplateLiteral")});var J0t=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Extract=i5a;var MCr=Ti(),XOa=mp(),e5a=d0(),Z0t=dte(),t5a=LCr(),r5a=NCr(),OCr=gs();function n5a(t,e){let r=t.filter(n=>(0,Z0t.ExtendsCheck)(n,e)!==Z0t.ExtendsResult.False);return r.length===1?r[0]:(0,XOa.Union)(r)}a(n5a,"ExtractRest");function i5a(t,e,r){return(0,OCr.IsTemplateLiteral)(t)?(0,MCr.CreateType)((0,r5a.ExtractFromTemplateLiteral)(t,e),r):(0,OCr.IsMappedResult)(t)?(0,MCr.CreateType)((0,t5a.ExtractFromMappedResult)(t,e),r):(0,MCr.CreateType)((0,OCr.IsUnion)(t)?n5a(t.anyOf,e):(0,Z0t.ExtendsCheck)(t,e)!==Z0t.ExtendsResult.False?t:(0,e5a.Never)(),r)}a(i5a,"Extract")});var LCr=I(FCr=>{"use strict";p();Object.defineProperty(FCr,"__esModule",{value:!0});FCr.ExtractFromMappedResult=l5a;var o5a=f0(),s5a=J0t();function a5a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,s5a.Extract)(t[n],e);return r}a(a5a,"FromProperties");function c5a(t,e){return a5a(t.properties,e)}a(c5a,"FromMappedResult");function l5a(t,e){let r=c5a(t,e);return(0,o5a.MappedResult)(r)}a(l5a,"ExtractFromMappedResult")});var X0t=I(D8=>{"use strict";p();var u5a=D8&&D8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UCr=D8&&D8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&u5a(e,t,r)};Object.defineProperty(D8,"__esModule",{value:!0});UCr(LCr(),D8);UCr(NCr(),D8);UCr(J0t(),D8)});var aTi=I(N8=>{"use strict";p();var d5a=N8&&N8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),f5a=N8&&N8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),p5a=N8&&N8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var y5a=fte&&fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),E5a=fte&&fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&y5a(e,t,r)};Object.defineProperty(fte,"__esModule",{value:!0});E5a(aTi(),fte)});var cTi=I(QCr=>{"use strict";p();Object.defineProperty(QCr,"__esModule",{value:!0});QCr.ReadonlyOptional=v5a;var _5a=uG(),C5a=f4();function v5a(t){return(0,_5a.Readonly)((0,C5a.Optional)(t))}a(v5a,"ReadonlyOptional")});var gOe=I(pte=>{"use strict";p();var b5a=pte&&pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),S5a=pte&&pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&b5a(e,t,r)};Object.defineProperty(pte,"__esModule",{value:!0});S5a(cTi(),pte)});var pTi=I(Pme=>{"use strict";p();Object.defineProperty(Pme,"__esModule",{value:!0});Pme.Record=q5a;Pme.RecordPattern=jCr;Pme.RecordKey=j5a;Pme.RecordValue=H5a;var T5a=Ti(),uTi=_n(),I5a=d0(),x5a=sG(),dTi=dC(),lTi=aG(),w5a=mp(),R5a=U2(),hte=JMe(),fTi=Q2(),k5a=uC(),m4=gs();function mte(t,e,r){return(0,T5a.CreateType)({[uTi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(mte,"RecordCreateFromPattern");function qCr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,dTi.Object)(n,{...r,[uTi.Hint]:"Record"})}a(qCr,"RecordCreateFromKeys");function P5a(t,e,r){return(0,R5a.IsTemplateLiteralFinite)(t)?qCr((0,fTi.IndexPropertyKeys)(t),e,r):mte(t.pattern,e,r)}a(P5a,"FromTemplateLiteralKey");function D5a(t,e,r){return qCr((0,fTi.IndexPropertyKeys)((0,w5a.Union)(t)),e,r)}a(D5a,"FromUnionKey");function N5a(t,e,r){return qCr([t.toString()],e,r)}a(N5a,"FromLiteralKey");function M5a(t,e,r){return mte(t.source,e,r)}a(M5a,"FromRegExpKey");function O5a(t,e,r){let n=(0,k5a.IsUndefined)(t.pattern)?hte.PatternStringExact:t.pattern;return mte(n,e,r)}a(O5a,"FromStringKey");function B5a(t,e,r){return mte(hte.PatternStringExact,e,r)}a(B5a,"FromAnyKey");function L5a(t,e,r){return mte(hte.PatternNeverExact,e,r)}a(L5a,"FromNeverKey");function F5a(t,e,r){return(0,dTi.Object)({true:e,false:e},r)}a(F5a,"FromBooleanKey");function U5a(t,e,r){return mte(hte.PatternNumberExact,e,r)}a(U5a,"FromIntegerKey");function Q5a(t,e,r){return mte(hte.PatternNumberExact,e,r)}a(Q5a,"FromNumberKey");function q5a(t,e,r={}){return(0,m4.IsUnion)(t)?D5a(t.anyOf,e,r):(0,m4.IsTemplateLiteral)(t)?P5a(t,e,r):(0,m4.IsLiteral)(t)?N5a(t.const,e,r):(0,m4.IsBoolean)(t)?F5a(t,e,r):(0,m4.IsInteger)(t)?U5a(t,e,r):(0,m4.IsNumber)(t)?Q5a(t,e,r):(0,m4.IsRegExp)(t)?M5a(t,e,r):(0,m4.IsString)(t)?O5a(t,e,r):(0,m4.IsAny)(t)?B5a(t,e,r):(0,m4.IsNever)(t)?L5a(t,e,r):(0,I5a.Never)(r)}a(q5a,"Record");function jCr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(jCr,"RecordPattern");function j5a(t){let e=jCr(t);return e===hte.PatternStringExact?(0,lTi.String)():e===hte.PatternNumberExact?(0,x5a.Number)():(0,lTi.String)({pattern:e})}a(j5a,"RecordKey");function H5a(t){return t.patternProperties[jCr(t)]}a(H5a,"RecordValue")});var Dme=I(gte=>{"use strict";p();var G5a=gte&>e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$5a=gte&>e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G5a(e,t,r)};Object.defineProperty(gte,"__esModule",{value:!0});$5a(pTi(),gte)});var mTi=I(g4=>{"use strict";p();var V5a=g4&&g4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W5a=g4&&g4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),hTi=g4&&g4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:p4a(t,e[n])}),{})}a(h4a,"FromProperties");function Nme(t,e){return e.map(r=>H2(t,r))}a(Nme,"FromTypes");function H2(t,e){return Hb.IsConstructor(e)?t4a(t,e):Hb.IsFunction(e)?r4a(t,e):Hb.IsIntersect(e)?n4a(t,e):Hb.IsUnion(e)?i4a(t,e):Hb.IsTuple(e)?o4a(t,e):Hb.IsArray(e)?s4a(t,e):Hb.IsAsyncIterator(e)?a4a(t,e):Hb.IsIterator(e)?c4a(t,e):Hb.IsPromise(e)?l4a(t,e):Hb.IsObject(e)?u4a(t,e):Hb.IsRecord(e)?d4a(t,e):Hb.IsArgument(e)?f4a(t,e):e}a(H2,"FromType");function m4a(t,e){return H2(e,(0,z5a.CloneType)(t))}a(m4a,"Instantiate")});var tmt=I(Ate=>{"use strict";p();var g4a=Ate&&Ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),A4a=Ate&&Ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&g4a(e,t,r)};Object.defineProperty(Ate,"__esModule",{value:!0});A4a(mTi(),Ate)});var gTi=I(GCr=>{"use strict";p();Object.defineProperty(GCr,"__esModule",{value:!0});GCr.Integer=_4a;var y4a=Ti(),E4a=_n();function _4a(t){return(0,y4a.CreateType)({[E4a.Kind]:"Integer",type:"integer"},t)}a(_4a,"Integer")});var rmt=I(yte=>{"use strict";p();var C4a=yte&&yte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v4a=yte&&yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4a(e,t,r)};Object.defineProperty(yte,"__esModule",{value:!0});v4a(gTi(),yte)});var VCr=I($Cr=>{"use strict";p();Object.defineProperty($Cr,"__esModule",{value:!0});$Cr.IntrinsicFromMappedKey=k4a;var b4a=f0(),S4a=Ete(),T4a=TE(),I4a=Lb();function x4a(t,e,r){return{[t]:(0,S4a.Intrinsic)((0,T4a.Literal)(t),e,(0,I4a.Clone)(r))}}a(x4a,"MappedIntrinsicPropertyKey");function w4a(t,e,r){return t.reduce((o,s)=>({...o,...x4a(s,e,r)}),{})}a(w4a,"MappedIntrinsicPropertyKeys");function R4a(t,e,r){return w4a(t.keys,e,r)}a(R4a,"MappedIntrinsicProperties");function k4a(t,e,r){let n=R4a(t,e,r);return(0,b4a.MappedResult)(n)}a(k4a,"IntrinsicFromMappedKey")});var Ete=I(WCr=>{"use strict";p();Object.defineProperty(WCr,"__esModule",{value:!0});WCr.Intrinsic=CTi;var P4a=Ti(),nmt=U2(),D4a=VCr(),ATi=TE(),yTi=mp(),imt=gs();function N4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(N4a,"ApplyUncapitalize");function M4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(M4a,"ApplyCapitalize");function O4a(t){return t.toUpperCase()}a(O4a,"ApplyUppercase");function B4a(t){return t.toLowerCase()}a(B4a,"ApplyLowercase");function L4a(t,e,r){let n=(0,nmt.TemplateLiteralParseExact)(t.pattern);if(!(0,nmt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:ETi(t.pattern,e)};let c=[...(0,nmt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,ATi.Literal)(d)),l=_Ti(c,e),u=(0,yTi.Union)(l);return(0,nmt.TemplateLiteral)([u],r)}a(L4a,"FromTemplateLiteral");function ETi(t,e){return typeof t=="string"?e==="Uncapitalize"?N4a(t):e==="Capitalize"?M4a(t):e==="Uppercase"?O4a(t):e==="Lowercase"?B4a(t):t:t.toString()}a(ETi,"FromLiteralValue");function _Ti(t,e){return t.map(r=>CTi(r,e))}a(_Ti,"FromRest");function CTi(t,e,r={}){return(0,imt.IsMappedKey)(t)?(0,D4a.IntrinsicFromMappedKey)(t,e,r):(0,imt.IsTemplateLiteral)(t)?L4a(t,e,r):(0,imt.IsUnion)(t)?(0,yTi.Union)(_Ti(t.anyOf,e),r):(0,imt.IsLiteral)(t)?(0,ATi.Literal)(ETi(t.const,e),r):(0,P4a.CreateType)(t,r)}a(CTi,"Intrinsic")});var vTi=I(zCr=>{"use strict";p();Object.defineProperty(zCr,"__esModule",{value:!0});zCr.Capitalize=U4a;var F4a=Ete();function U4a(t,e={}){return(0,F4a.Intrinsic)(t,"Capitalize",e)}a(U4a,"Capitalize")});var bTi=I(YCr=>{"use strict";p();Object.defineProperty(YCr,"__esModule",{value:!0});YCr.Lowercase=q4a;var Q4a=Ete();function q4a(t,e={}){return(0,Q4a.Intrinsic)(t,"Lowercase",e)}a(q4a,"Lowercase")});var STi=I(KCr=>{"use strict";p();Object.defineProperty(KCr,"__esModule",{value:!0});KCr.Uncapitalize=H4a;var j4a=Ete();function H4a(t,e={}){return(0,j4a.Intrinsic)(t,"Uncapitalize",e)}a(H4a,"Uncapitalize")});var TTi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.Uppercase=$4a;var G4a=Ete();function $4a(t,e={}){return(0,G4a.Intrinsic)(t,"Uppercase",e)}a($4a,"Uppercase")});var omt=I(cR=>{"use strict";p();var V4a=cR&&cR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mme=cR&&cR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V4a(e,t,r)};Object.defineProperty(cR,"__esModule",{value:!0});Mme(vTi(),cR);Mme(VCr(),cR);Mme(Ete(),cR);Mme(bTi(),cR);Mme(STi(),cR);Mme(TTi(),cR)});var XCr=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.OmitFromMappedResult=Z4a;var W4a=f0(),z4a=smt(),Y4a=Lb();function K4a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,z4a.Omit)(t[o],e,(0,Y4a.Clone)(r));return n}a(K4a,"FromProperties");function J4a(t,e,r){return K4a(t.properties,e,r)}a(J4a,"FromMappedResult");function Z4a(t,e,r){let n=J4a(t,e,r);return(0,W4a.MappedResult)(n)}a(Z4a,"OmitFromMappedResult")});var smt=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.Omit=hBa;var X4a=Ti(),eBa=_0t(),tBa=WMe(),evr=iG(),rBa=TE(),nBa=Q2(),iBa=NT(),ITi=mp(),xTi=dC(),oBa=nvr(),sBa=XCr(),M8=gs(),aBa=uC();function cBa(t,e){return t.map(r=>tvr(r,e))}a(cBa,"FromIntersect");function lBa(t,e){return t.map(r=>tvr(r,e))}a(lBa,"FromUnion");function uBa(t,e){let{[e]:r,...n}=t;return n}a(uBa,"FromProperty");function dBa(t,e){return e.reduce((r,n)=>uBa(r,n),t)}a(dBa,"FromProperties");function fBa(t,e,r){let n=(0,eBa.Discard)(t,[tBa.TransformKind,"$id","required","properties"]),o=dBa(r,e);return(0,xTi.Object)(o,n)}a(fBa,"FromObject");function pBa(t){let e=t.reduce((r,n)=>(0,M8.IsLiteralValue)(n)?[...r,(0,rBa.Literal)(n)]:r,[]);return(0,ITi.Union)(e)}a(pBa,"UnionFromPropertyKeys");function tvr(t,e){return(0,M8.IsIntersect)(t)?(0,iBa.Intersect)(cBa(t.allOf,e)):(0,M8.IsUnion)(t)?(0,ITi.Union)(lBa(t.anyOf,e)):(0,M8.IsObject)(t)?fBa(t,e,t.properties):(0,xTi.Object)({})}a(tvr,"OmitResolve");function hBa(t,e,r){let n=(0,aBa.IsArray)(e)?pBa(e):e,o=(0,M8.IsSchema)(e)?(0,nBa.IndexPropertyKeys)(e):e,s=(0,M8.IsRef)(t),c=(0,M8.IsRef)(e);return(0,M8.IsMappedResult)(t)?(0,sBa.OmitFromMappedResult)(t,o,r):(0,M8.IsMappedKey)(e)?(0,oBa.OmitFromMappedKey)(t,e,r):s&&c?(0,evr.Computed)("Omit",[t,n],r):!s&&c?(0,evr.Computed)("Omit",[t,n],r):s&&!c?(0,evr.Computed)("Omit",[t,n],r):(0,X4a.CreateType)({...tvr(t,o),...r})}a(hBa,"Omit")});var nvr=I(ivr=>{"use strict";p();Object.defineProperty(ivr,"__esModule",{value:!0});ivr.OmitFromMappedKey=CBa;var mBa=f0(),gBa=smt(),ABa=Lb();function yBa(t,e,r){return{[e]:(0,gBa.Omit)(t,[e],(0,ABa.Clone)(r))}}a(yBa,"FromPropertyKey");function EBa(t,e,r){return e.reduce((n,o)=>({...n,...yBa(t,o,r)}),{})}a(EBa,"FromPropertyKeys");function _Ba(t,e,r){return EBa(t,e.keys,r)}a(_Ba,"FromMappedKey");function CBa(t,e,r){let n=_Ba(t,e,r);return(0,mBa.MappedResult)(n)}a(CBa,"OmitFromMappedKey")});var AOe=I(O8=>{"use strict";p();var vBa=O8&&O8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ovr=O8&&O8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vBa(e,t,r)};Object.defineProperty(O8,"__esModule",{value:!0});ovr(nvr(),O8);ovr(XCr(),O8);ovr(smt(),O8)});var avr=I(svr=>{"use strict";p();Object.defineProperty(svr,"__esModule",{value:!0});svr.PickFromMappedResult=wBa;var bBa=f0(),SBa=amt(),TBa=Lb();function IBa(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,SBa.Pick)(t[o],e,(0,TBa.Clone)(r));return n}a(IBa,"FromProperties");function xBa(t,e,r){return IBa(t.properties,e,r)}a(xBa,"FromMappedResult");function wBa(t,e,r){let n=xBa(t,e,r);return(0,bBa.MappedResult)(n)}a(wBa,"PickFromMappedResult")});var amt=I(uvr=>{"use strict";p();Object.defineProperty(uvr,"__esModule",{value:!0});uvr.Pick=HBa;var RBa=Ti(),kBa=_0t(),cvr=iG(),PBa=NT(),DBa=TE(),wTi=dC(),RTi=mp(),NBa=Q2(),MBa=WMe(),B8=gs(),OBa=uC(),BBa=dvr(),LBa=avr();function FBa(t,e){return t.map(r=>lvr(r,e))}a(FBa,"FromIntersect");function UBa(t,e){return t.map(r=>lvr(r,e))}a(UBa,"FromUnion");function QBa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(QBa,"FromProperties");function qBa(t,e,r){let n=(0,kBa.Discard)(t,[MBa.TransformKind,"$id","required","properties"]),o=QBa(r,e);return(0,wTi.Object)(o,n)}a(qBa,"FromObject");function jBa(t){let e=t.reduce((r,n)=>(0,B8.IsLiteralValue)(n)?[...r,(0,DBa.Literal)(n)]:r,[]);return(0,RTi.Union)(e)}a(jBa,"UnionFromPropertyKeys");function lvr(t,e){return(0,B8.IsIntersect)(t)?(0,PBa.Intersect)(FBa(t.allOf,e)):(0,B8.IsUnion)(t)?(0,RTi.Union)(UBa(t.anyOf,e)):(0,B8.IsObject)(t)?qBa(t,e,t.properties):(0,wTi.Object)({})}a(lvr,"PickResolve");function HBa(t,e,r){let n=(0,OBa.IsArray)(e)?jBa(e):e,o=(0,B8.IsSchema)(e)?(0,NBa.IndexPropertyKeys)(e):e,s=(0,B8.IsRef)(t),c=(0,B8.IsRef)(e);return(0,B8.IsMappedResult)(t)?(0,LBa.PickFromMappedResult)(t,o,r):(0,B8.IsMappedKey)(e)?(0,BBa.PickFromMappedKey)(t,e,r):s&&c?(0,cvr.Computed)("Pick",[t,n],r):!s&&c?(0,cvr.Computed)("Pick",[t,n],r):s&&!c?(0,cvr.Computed)("Pick",[t,n],r):(0,RBa.CreateType)({...lvr(t,o),...r})}a(HBa,"Pick")});var dvr=I(fvr=>{"use strict";p();Object.defineProperty(fvr,"__esModule",{value:!0});fvr.PickFromMappedKey=KBa;var GBa=f0(),$Ba=amt(),VBa=Lb();function WBa(t,e,r){return{[e]:(0,$Ba.Pick)(t,[e],(0,VBa.Clone)(r))}}a(WBa,"FromPropertyKey");function zBa(t,e,r){return e.reduce((n,o)=>({...n,...WBa(t,o,r)}),{})}a(zBa,"FromPropertyKeys");function YBa(t,e,r){return zBa(t,e.keys,r)}a(YBa,"FromMappedKey");function KBa(t,e,r){let n=YBa(t,e,r);return(0,GBa.MappedResult)(n)}a(KBa,"PickFromMappedKey")});var yOe=I(L8=>{"use strict";p();var JBa=L8&&L8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),pvr=L8&&L8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&JBa(e,t,r)};Object.defineProperty(L8,"__esModule",{value:!0});pvr(dvr(),L8);pvr(avr(),L8);pvr(amt(),L8)});var mvr=I(F8=>{"use strict";p();var ZBa=F8&&F8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XBa=F8&&F8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),eLa=F8&&F8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oDTi(e))}a(kTi,"FromRest");function DTi(t){return pC.IsComputed(t)?lLa(t.target,t.parameters):pC.IsRef(t)?uLa(t.$ref):pC.IsIntersect(t)?(0,nLa.Intersect)(kTi(t.allOf)):pC.IsUnion(t)?(0,iLa.Union)(kTi(t.anyOf)):pC.IsObject(t)?fLa(t,t.properties):pC.IsBigInt(t)||pC.IsBoolean(t)||pC.IsInteger(t)||pC.IsLiteral(t)||pC.IsNull(t)||pC.IsNumber(t)||pC.IsString(t)||pC.IsSymbol(t)||pC.IsUndefined(t)?t:(0,PTi.Object)({})}a(DTi,"PartialResolve");function pLa(t,e){return pC.IsMappedResult(t)?(0,cLa.PartialFromMappedResult)(t,e):(0,tLa.CreateType)({...DTi(t),...e})}a(pLa,"Partial")});var gvr=I(Avr=>{"use strict";p();Object.defineProperty(Avr,"__esModule",{value:!0});Avr.PartialFromMappedResult=ELa;var hLa=f0(),mLa=mvr(),gLa=Lb();function ALa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,mLa.Partial)(t[n],(0,gLa.Clone)(e));return r}a(ALa,"FromProperties");function yLa(t,e){return ALa(t.properties,e)}a(yLa,"FromMappedResult");function ELa(t,e){let r=yLa(t,e);return(0,hLa.MappedResult)(r)}a(ELa,"PartialFromMappedResult")});var EOe=I(hG=>{"use strict";p();var _La=hG&&hG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NTi=hG&&hG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_La(e,t,r)};Object.defineProperty(hG,"__esModule",{value:!0});NTi(gvr(),hG);NTi(mvr(),hG)});var Evr=I(U8=>{"use strict";p();var CLa=U8&&U8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vLa=U8&&U8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bLa=U8&&U8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oFTi(e))}a(MTi,"FromRest");function FTi(t){return hC.IsComputed(t)?RLa(t.target,t.parameters):hC.IsRef(t)?kLa(t.$ref):hC.IsIntersect(t)?(0,TLa.Intersect)(MTi(t.allOf)):hC.IsUnion(t)?(0,ILa.Union)(MTi(t.anyOf)):hC.IsObject(t)?DLa(t,t.properties):hC.IsBigInt(t)||hC.IsBoolean(t)||hC.IsInteger(t)||hC.IsLiteral(t)||hC.IsNull(t)||hC.IsNumber(t)||hC.IsString(t)||hC.IsSymbol(t)||hC.IsUndefined(t)?t:(0,OTi.Object)({})}a(FTi,"RequiredResolve");function NLa(t,e){return hC.IsMappedResult(t)?(0,wLa.RequiredFromMappedResult)(t,e):(0,SLa.CreateType)({...FTi(t),...e})}a(NLa,"Required")});var _vr=I(Cvr=>{"use strict";p();Object.defineProperty(Cvr,"__esModule",{value:!0});Cvr.RequiredFromMappedResult=FLa;var MLa=f0(),OLa=Evr();function BLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,OLa.Required)(t[n],e);return r}a(BLa,"FromProperties");function LLa(t,e){return BLa(t.properties,e)}a(LLa,"FromMappedResult");function FLa(t,e){let r=LLa(t,e);return(0,MLa.MappedResult)(r)}a(FLa,"RequiredFromMappedResult")});var _Oe=I(mG=>{"use strict";p();var ULa=mG&&mG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UTi=mG&&mG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ULa(e,t,r)};Object.defineProperty(mG,"__esModule",{value:!0});UTi(_vr(),mG);UTi(Evr(),mG)});var HTi=I(G2=>{"use strict";p();var QLa=G2&&G2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qLa=G2&&G2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jLa=G2&&G2.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oYA.IsRef(r)?bvr(t,r.$ref):$b(t,r))}a(s3a,"DereferenceParameters");function bvr(t,e){return e in t?YA.IsRef(t[e])?bvr(t,t[e].$ref):$b(t,t[e]):(0,vvr.Never)()}a(bvr,"Dereference");function a3a(t){return(0,$La.Awaited)(t[0])}a(a3a,"FromAwaited");function c3a(t){return(0,zLa.Index)(t[0],t[1])}a(c3a,"FromIndex");function l3a(t){return(0,ZLa.KeyOf)(t[0])}a(l3a,"FromKeyOf");function u3a(t){return(0,r3a.Partial)(t[0])}a(u3a,"FromPartial");function d3a(t){return(0,e3a.Omit)(t[0],t[1])}a(d3a,"FromOmit");function f3a(t){return(0,t3a.Pick)(t[0],t[1])}a(f3a,"FromPick");function p3a(t){return(0,n3a.Required)(t[0])}a(p3a,"FromRequired");function h3a(t,e,r){let n=s3a(t,r);return e==="Awaited"?a3a(n):e==="Index"?c3a(n):e==="KeyOf"?l3a(n):e==="Partial"?u3a(n):e==="Omit"?d3a(n):e==="Pick"?f3a(n):e==="Required"?p3a(n):(0,vvr.Never)()}a(h3a,"FromComputed");function m3a(t,e){return(0,GLa.Array)($b(t,e))}a(m3a,"FromArray");function g3a(t,e){return(0,VLa.AsyncIterator)($b(t,e))}a(g3a,"FromAsyncIterator");function A3a(t,e,r){return(0,WLa.Constructor)(COe(t,e),$b(t,r))}a(A3a,"FromConstructor");function y3a(t,e,r){return(0,YLa.Function)(COe(t,e),$b(t,r))}a(y3a,"FromFunction");function E3a(t,e){return(0,KLa.Intersect)(COe(t,e))}a(E3a,"FromIntersect");function _3a(t,e){return(0,JLa.Iterator)($b(t,e))}a(_3a,"FromIterator");function C3a(t,e){return(0,XLa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:$b(t,e[n])}),{}))}a(C3a,"FromObject");function v3a(t,e){let[r,n]=[$b(t,(0,qTi.RecordValue)(e)),(0,qTi.RecordPattern)(e)],o=(0,HLa.CloneType)(e);return o.patternProperties[n]=r,o}a(v3a,"FromRecord");function b3a(t,e){return YA.IsRef(e)?{...bvr(t,e.$ref),[cmt.TransformKind]:e[cmt.TransformKind]}:e}a(b3a,"FromTransform");function S3a(t,e){return(0,i3a.Tuple)(COe(t,e))}a(S3a,"FromTuple");function T3a(t,e){return(0,o3a.Union)(COe(t,e))}a(T3a,"FromUnion");function COe(t,e){return e.map(r=>$b(t,r))}a(COe,"FromTypes");function $b(t,e){return YA.IsOptional(e)?(0,Gb.CreateType)($b(t,(0,QTi.Discard)(e,[cmt.OptionalKind])),e):YA.IsReadonly(e)?(0,Gb.CreateType)($b(t,(0,QTi.Discard)(e,[cmt.ReadonlyKind])),e):YA.IsTransform(e)?(0,Gb.CreateType)(b3a(t,e),e):YA.IsArray(e)?(0,Gb.CreateType)(m3a(t,e.items),e):YA.IsAsyncIterator(e)?(0,Gb.CreateType)(g3a(t,e.items),e):YA.IsComputed(e)?(0,Gb.CreateType)(h3a(t,e.target,e.parameters)):YA.IsConstructor(e)?(0,Gb.CreateType)(A3a(t,e.parameters,e.returns),e):YA.IsFunction(e)?(0,Gb.CreateType)(y3a(t,e.parameters,e.returns),e):YA.IsIntersect(e)?(0,Gb.CreateType)(E3a(t,e.allOf),e):YA.IsIterator(e)?(0,Gb.CreateType)(_3a(t,e.items),e):YA.IsObject(e)?(0,Gb.CreateType)(C3a(t,e.properties),e):YA.IsRecord(e)?(0,Gb.CreateType)(v3a(t,e)):YA.IsTuple(e)?(0,Gb.CreateType)(S3a(t,e.items||[]),e):YA.IsUnion(e)?(0,Gb.CreateType)(T3a(t,e.anyOf),e):e}a($b,"FromType");function jTi(t,e){return e in t?$b(t,t[e]):(0,vvr.Never)()}a(jTi,"ComputeType");function I3a(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:jTi(t,r)}),{})}a(I3a,"ComputeModuleProperties")});var $Ti=I(vOe=>{"use strict";p();Object.defineProperty(vOe,"__esModule",{value:!0});vOe.TModule=void 0;vOe.Module=R3a;var GTi=v8(),x3a=_n(),w3a=HTi(),lmt=class{static{a(this,"TModule")}constructor(e){let r=(0,w3a.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,GTi.CreateType)(this.$defs[e],r)};return(0,GTi.CreateType)({[x3a.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};vOe.TModule=lmt;function R3a(t){return new lmt(t)}a(R3a,"Module")});var umt=I(_te=>{"use strict";p();var k3a=_te&&_te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P3a=_te&&_te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&k3a(e,t,r)};Object.defineProperty(_te,"__esModule",{value:!0});P3a($Ti(),_te)});var VTi=I(Svr=>{"use strict";p();Object.defineProperty(Svr,"__esModule",{value:!0});Svr.Not=M3a;var D3a=Ti(),N3a=_n();function M3a(t,e){return(0,D3a.CreateType)({[N3a.Kind]:"Not",not:t},e)}a(M3a,"Not")});var dmt=I(Cte=>{"use strict";p();var O3a=Cte&&Cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),B3a=Cte&&Cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&O3a(e,t,r)};Object.defineProperty(Cte,"__esModule",{value:!0});B3a(VTi(),Cte)});var WTi=I(Q8=>{"use strict";p();var L3a=Q8&&Q8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F3a=Q8&&Q8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),U3a=Q8&&Q8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var G3a=vte&&vte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$3a=vte&&vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G3a(e,t,r)};Object.defineProperty(vte,"__esModule",{value:!0});$3a(WTi(),vte)});var YTi=I(Tvr=>{"use strict";p();Object.defineProperty(Tvr,"__esModule",{value:!0});Tvr.Recursive=K3a;var V3a=f0t(),W3a=Ti(),z3a=uC(),zTi=_n(),Y3a=0;function K3a(t,e={}){(0,z3a.IsUndefined)(e.$id)&&(e.$id=`T${Y3a++}`);let r=(0,V3a.CloneType)(t({[zTi.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,W3a.CreateType)({[zTi.Hint]:"Recursive",...r},e)}a(K3a,"Recursive")});var pmt=I(bte=>{"use strict";p();var J3a=bte&&bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Z3a=bte&&bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&J3a(e,t,r)};Object.defineProperty(bte,"__esModule",{value:!0});Z3a(YTi(),bte)});var KTi=I(Ivr=>{"use strict";p();Object.defineProperty(Ivr,"__esModule",{value:!0});Ivr.RegExp=rFa;var X3a=Ti(),eFa=uC(),tFa=_n();function rFa(t,e){let r=(0,eFa.IsString)(t)?new globalThis.RegExp(t):t;return(0,X3a.CreateType)({[tFa.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(rFa,"RegExp")});var hmt=I(Ste=>{"use strict";p();var nFa=Ste&&Ste.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iFa=Ste&&Ste.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nFa(e,t,r)};Object.defineProperty(Ste,"__esModule",{value:!0});iFa(KTi(),Ste)});var JTi=I(wvr=>{"use strict";p();Object.defineProperty(wvr,"__esModule",{value:!0});wvr.Rest=sFa;var xvr=gs();function oFa(t){return(0,xvr.IsIntersect)(t)?t.allOf:(0,xvr.IsUnion)(t)?t.anyOf:(0,xvr.IsTuple)(t)?t.items??[]:[]}a(oFa,"RestResolve");function sFa(t){return oFa(t)}a(sFa,"Rest")});var mmt=I(Tte=>{"use strict";p();var aFa=Tte&&Tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cFa=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aFa(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});cFa(JTi(),Tte)});var ZTi=I(q8=>{"use strict";p();var lFa=q8&&q8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uFa=q8&&q8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dFa=q8&&q8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var gFa=Ite&&Ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AFa=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gFa(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});AFa(ZTi(),Ite)});var eIi=I(XTi=>{"use strict";p();Object.defineProperty(XTi,"__esModule",{value:!0})});var rIi=I(tIi=>{"use strict";p();Object.defineProperty(tIi,"__esModule",{value:!0});var jEp=_n()});var iIi=I(gG=>{"use strict";p();var yFa=gG&&gG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nIi=gG&&gG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yFa(e,t,r)};Object.defineProperty(gG,"__esModule",{value:!0});nIi(eIi(),gG);nIi(rIi(),gG)});var sIi=I(oIi=>{"use strict";p();Object.defineProperty(oIi,"__esModule",{value:!0})});var aIi=I(xte=>{"use strict";p();var EFa=xte&&xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Fa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EFa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});_Fa(sIi(),xte)});var cIi=I(wte=>{"use strict";p();Object.defineProperty(wte,"__esModule",{value:!0});wte.TransformEncodeBuilder=wte.TransformDecodeBuilder=void 0;wte.Transform=vFa;var Amt=_n(),CFa=gs(),ymt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new Emt(this.schema,e)}};wte.TransformDecodeBuilder=ymt;var Emt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Amt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Amt.TransformKind].Decode(c)),"Decode")};return{...r,[Amt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Amt.TransformKind]:n}}Encode(e){return(0,CFa.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};wte.TransformEncodeBuilder=Emt;function vFa(t){return new ymt(t)}a(vFa,"Transform")});var _mt=I(Rte=>{"use strict";p();var bFa=Rte&&Rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SFa=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bFa(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});SFa(cIi(),Rte)});var uIi=I(Rvr=>{"use strict";p();Object.defineProperty(Rvr,"__esModule",{value:!0});Rvr.Unsafe=IFa;var TFa=Ti(),lIi=_n();function IFa(t={}){return(0,TFa.CreateType)({[lIi.Kind]:t[lIi.Kind]??"Unsafe"},t)}a(IFa,"Unsafe")});var bOe=I(kte=>{"use strict";p();var xFa=kte&&kte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wFa=kte&&kte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xFa(e,t,r)};Object.defineProperty(kte,"__esModule",{value:!0});wFa(uIi(),kte)});var dIi=I(kvr=>{"use strict";p();Object.defineProperty(kvr,"__esModule",{value:!0});kvr.Void=PFa;var RFa=Ti(),kFa=_n();function PFa(t){return(0,RFa.CreateType)({[kFa.Kind]:"Void",type:"void"},t)}a(PFa,"Void")});var Cmt=I(Pte=>{"use strict";p();var DFa=Pte&&Pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),NFa=Pte&&Pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&DFa(e,t,r)};Object.defineProperty(Pte,"__esModule",{value:!0});NFa(dIi(),Pte)});var Dvr=I(bmt=>{"use strict";p();Object.defineProperty(bmt,"__esModule",{value:!0});bmt.JsonTypeBuilder=void 0;var MFa=yme(),OFa=Eme(),BFa=tOe(),LFa=L0t(),FFa=U0t(),UFa=q0t(),QFa=K0t(),qFa=dte(),jFa=X0t(),HFa=Q2(),GFa=rmt(),$Fa=NT(),vmt=omt(),VFa=q2(),WFa=TE(),zFa=f0(),YFa=d0(),KFa=dmt(),JFa=dOe(),ZFa=umt(),XFa=sG(),e8a=dC(),t8a=AOe(),r8a=f4(),n8a=EOe(),i8a=yOe(),o8a=uG(),s8a=gOe(),a8a=Dme(),c8a=pmt(),l8a=fG(),u8a=_Oe(),d8a=mmt(),f8a=aG(),p8a=U2(),h8a=_mt(),m8a=x8(),g8a=mp(),A8a=pG(),y8a=bOe(),Pvr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,s8a.ReadonlyOptional)(e)}Readonly(e,r){return(0,o8a.Readonly)(e,r??!0)}Optional(e,r){return(0,r8a.Optional)(e,r??!0)}Any(e){return(0,MFa.Any)(e)}Array(e,r){return(0,OFa.Array)(e,r)}Boolean(e){return(0,BFa.Boolean)(e)}Capitalize(e,r){return(0,vmt.Capitalize)(e,r)}Composite(e,r){return(0,LFa.Composite)(e,r)}Const(e,r){return(0,FFa.Const)(e,r)}Enum(e,r){return(0,UFa.Enum)(e,r)}Exclude(e,r,n){return(0,QFa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,qFa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,jFa.Extract)(e,r,n)}Index(e,r,n){return(0,HFa.Index)(e,r,n)}Integer(e){return(0,GFa.Integer)(e)}Intersect(e,r){return(0,$Fa.Intersect)(e,r)}KeyOf(e,r){return(0,VFa.KeyOf)(e,r)}Literal(e,r){return(0,WFa.Literal)(e,r)}Lowercase(e,r){return(0,vmt.Lowercase)(e,r)}Mapped(e,r,n){return(0,zFa.Mapped)(e,r,n)}Module(e){return(0,ZFa.Module)(e)}Never(e){return(0,YFa.Never)(e)}Not(e,r){return(0,KFa.Not)(e,r)}Null(e){return(0,JFa.Null)(e)}Number(e){return(0,XFa.Number)(e)}Object(e,r){return(0,e8a.Object)(e,r)}Omit(e,r,n){return(0,t8a.Omit)(e,r,n)}Partial(e,r){return(0,n8a.Partial)(e,r)}Pick(e,r,n){return(0,i8a.Pick)(e,r,n)}Record(e,r,n){return(0,a8a.Record)(e,r,n)}Recursive(e,r){return(0,c8a.Recursive)(e,r)}Ref(...e){return(0,l8a.Ref)(e[0],e[1])}Required(e,r){return(0,u8a.Required)(e,r)}Rest(e){return(0,d8a.Rest)(e)}String(e){return(0,f8a.String)(e)}TemplateLiteral(e,r){return(0,p8a.TemplateLiteral)(e,r)}Transform(e){return(0,h8a.Transform)(e)}Tuple(e,r){return(0,m8a.Tuple)(e,r)}Uncapitalize(e,r){return(0,vmt.Uncapitalize)(e,r)}Union(e,r){return(0,g8a.Union)(e,r)}Unknown(e){return(0,A8a.Unknown)(e)}Unsafe(e){return(0,y8a.Unsafe)(e)}Uppercase(e,r){return(0,vmt.Uppercase)(e,r)}};bmt.JsonTypeBuilder=Pvr});var fIi=I(Pt=>{"use strict";p();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.Rest=Pt.Required=Pt.RegExp=Pt.Ref=Pt.Recursive=Pt.Record=Pt.ReadonlyOptional=Pt.Readonly=Pt.Promise=Pt.Pick=Pt.Partial=Pt.Parameters=Pt.Optional=Pt.Omit=Pt.Object=Pt.Number=Pt.Null=Pt.Not=Pt.Never=Pt.Module=Pt.Mapped=Pt.Literal=Pt.KeyOf=Pt.Iterator=Pt.Uppercase=Pt.Lowercase=Pt.Uncapitalize=Pt.Capitalize=Pt.Intersect=Pt.Integer=Pt.Instantiate=Pt.InstanceType=Pt.Index=Pt.Function=Pt.Extract=Pt.Extends=Pt.Exclude=Pt.Enum=Pt.Date=Pt.ConstructorParameters=Pt.Constructor=Pt.Const=Pt.Composite=Pt.Boolean=Pt.BigInt=Pt.Awaited=Pt.AsyncIterator=Pt.Array=Pt.Argument=Pt.Any=void 0;Pt.Void=Pt.Unsafe=Pt.Unknown=Pt.Union=Pt.Undefined=Pt.Uint8Array=Pt.Tuple=Pt.Transform=Pt.TemplateLiteral=Pt.Symbol=Pt.String=Pt.ReturnType=void 0;var E8a=yme();Object.defineProperty(Pt,"Any",{enumerable:!0,get:a(function(){return E8a.Any},"get")});var _8a=E0t();Object.defineProperty(Pt,"Argument",{enumerable:!0,get:a(function(){return _8a.Argument},"get")});var C8a=Eme();Object.defineProperty(Pt,"Array",{enumerable:!0,get:a(function(){return C8a.Array},"get")});var v8a=_me();Object.defineProperty(Pt,"AsyncIterator",{enumerable:!0,get:a(function(){return v8a.AsyncIterator},"get")});var b8a=lOe();Object.defineProperty(Pt,"Awaited",{enumerable:!0,get:a(function(){return b8a.Awaited},"get")});var S8a=Tme();Object.defineProperty(Pt,"BigInt",{enumerable:!0,get:a(function(){return S8a.BigInt},"get")});var T8a=tOe();Object.defineProperty(Pt,"Boolean",{enumerable:!0,get:a(function(){return T8a.Boolean},"get")});var I8a=L0t();Object.defineProperty(Pt,"Composite",{enumerable:!0,get:a(function(){return I8a.Composite},"get")});var x8a=U0t();Object.defineProperty(Pt,"Const",{enumerable:!0,get:a(function(){return x8a.Const},"get")});var w8a=Cme();Object.defineProperty(Pt,"Constructor",{enumerable:!0,get:a(function(){return w8a.Constructor},"get")});var R8a=Q0t();Object.defineProperty(Pt,"ConstructorParameters",{enumerable:!0,get:a(function(){return R8a.ConstructorParameters},"get")});var k8a=uOe();Object.defineProperty(Pt,"Date",{enumerable:!0,get:a(function(){return k8a.Date},"get")});var P8a=q0t();Object.defineProperty(Pt,"Enum",{enumerable:!0,get:a(function(){return P8a.Enum},"get")});var D8a=K0t();Object.defineProperty(Pt,"Exclude",{enumerable:!0,get:a(function(){return D8a.Exclude},"get")});var N8a=dte();Object.defineProperty(Pt,"Extends",{enumerable:!0,get:a(function(){return N8a.Extends},"get")});var M8a=X0t();Object.defineProperty(Pt,"Extract",{enumerable:!0,get:a(function(){return M8a.Extract},"get")});var O8a=oG();Object.defineProperty(Pt,"Function",{enumerable:!0,get:a(function(){return O8a.Function},"get")});var B8a=Q2();Object.defineProperty(Pt,"Index",{enumerable:!0,get:a(function(){return B8a.Index},"get")});var L8a=emt();Object.defineProperty(Pt,"InstanceType",{enumerable:!0,get:a(function(){return L8a.InstanceType},"get")});var F8a=tmt();Object.defineProperty(Pt,"Instantiate",{enumerable:!0,get:a(function(){return F8a.Instantiate},"get")});var U8a=rmt();Object.defineProperty(Pt,"Integer",{enumerable:!0,get:a(function(){return U8a.Integer},"get")});var Q8a=NT();Object.defineProperty(Pt,"Intersect",{enumerable:!0,get:a(function(){return Q8a.Intersect},"get")});var Smt=omt();Object.defineProperty(Pt,"Capitalize",{enumerable:!0,get:a(function(){return Smt.Capitalize},"get")});Object.defineProperty(Pt,"Uncapitalize",{enumerable:!0,get:a(function(){return Smt.Uncapitalize},"get")});Object.defineProperty(Pt,"Lowercase",{enumerable:!0,get:a(function(){return Smt.Lowercase},"get")});Object.defineProperty(Pt,"Uppercase",{enumerable:!0,get:a(function(){return Smt.Uppercase},"get")});var q8a=xme();Object.defineProperty(Pt,"Iterator",{enumerable:!0,get:a(function(){return q8a.Iterator},"get")});var j8a=q2();Object.defineProperty(Pt,"KeyOf",{enumerable:!0,get:a(function(){return j8a.KeyOf},"get")});var H8a=TE();Object.defineProperty(Pt,"Literal",{enumerable:!0,get:a(function(){return H8a.Literal},"get")});var G8a=f0();Object.defineProperty(Pt,"Mapped",{enumerable:!0,get:a(function(){return G8a.Mapped},"get")});var $8a=umt();Object.defineProperty(Pt,"Module",{enumerable:!0,get:a(function(){return $8a.Module},"get")});var V8a=d0();Object.defineProperty(Pt,"Never",{enumerable:!0,get:a(function(){return V8a.Never},"get")});var W8a=dmt();Object.defineProperty(Pt,"Not",{enumerable:!0,get:a(function(){return W8a.Not},"get")});var z8a=dOe();Object.defineProperty(Pt,"Null",{enumerable:!0,get:a(function(){return z8a.Null},"get")});var Y8a=sG();Object.defineProperty(Pt,"Number",{enumerable:!0,get:a(function(){return Y8a.Number},"get")});var K8a=dC();Object.defineProperty(Pt,"Object",{enumerable:!0,get:a(function(){return K8a.Object},"get")});var J8a=AOe();Object.defineProperty(Pt,"Omit",{enumerable:!0,get:a(function(){return J8a.Omit},"get")});var Z8a=f4();Object.defineProperty(Pt,"Optional",{enumerable:!0,get:a(function(){return Z8a.Optional},"get")});var X8a=fmt();Object.defineProperty(Pt,"Parameters",{enumerable:!0,get:a(function(){return X8a.Parameters},"get")});var e6a=EOe();Object.defineProperty(Pt,"Partial",{enumerable:!0,get:a(function(){return e6a.Partial},"get")});var t6a=yOe();Object.defineProperty(Pt,"Pick",{enumerable:!0,get:a(function(){return t6a.Pick},"get")});var r6a=sOe();Object.defineProperty(Pt,"Promise",{enumerable:!0,get:a(function(){return r6a.Promise},"get")});var n6a=uG();Object.defineProperty(Pt,"Readonly",{enumerable:!0,get:a(function(){return n6a.Readonly},"get")});var i6a=gOe();Object.defineProperty(Pt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return i6a.ReadonlyOptional},"get")});var o6a=Dme();Object.defineProperty(Pt,"Record",{enumerable:!0,get:a(function(){return o6a.Record},"get")});var s6a=pmt();Object.defineProperty(Pt,"Recursive",{enumerable:!0,get:a(function(){return s6a.Recursive},"get")});var a6a=fG();Object.defineProperty(Pt,"Ref",{enumerable:!0,get:a(function(){return a6a.Ref},"get")});var c6a=hmt();Object.defineProperty(Pt,"RegExp",{enumerable:!0,get:a(function(){return c6a.RegExp},"get")});var l6a=_Oe();Object.defineProperty(Pt,"Required",{enumerable:!0,get:a(function(){return l6a.Required},"get")});var u6a=mmt();Object.defineProperty(Pt,"Rest",{enumerable:!0,get:a(function(){return u6a.Rest},"get")});var d6a=gmt();Object.defineProperty(Pt,"ReturnType",{enumerable:!0,get:a(function(){return d6a.ReturnType},"get")});var f6a=aG();Object.defineProperty(Pt,"String",{enumerable:!0,get:a(function(){return f6a.String},"get")});var p6a=fOe();Object.defineProperty(Pt,"Symbol",{enumerable:!0,get:a(function(){return p6a.Symbol},"get")});var h6a=U2();Object.defineProperty(Pt,"TemplateLiteral",{enumerable:!0,get:a(function(){return h6a.TemplateLiteral},"get")});var m6a=_mt();Object.defineProperty(Pt,"Transform",{enumerable:!0,get:a(function(){return m6a.Transform},"get")});var g6a=x8();Object.defineProperty(Pt,"Tuple",{enumerable:!0,get:a(function(){return g6a.Tuple},"get")});var A6a=hOe();Object.defineProperty(Pt,"Uint8Array",{enumerable:!0,get:a(function(){return A6a.Uint8Array},"get")});var y6a=pOe();Object.defineProperty(Pt,"Undefined",{enumerable:!0,get:a(function(){return y6a.Undefined},"get")});var E6a=mp();Object.defineProperty(Pt,"Union",{enumerable:!0,get:a(function(){return E6a.Union},"get")});var _6a=pG();Object.defineProperty(Pt,"Unknown",{enumerable:!0,get:a(function(){return _6a.Unknown},"get")});var C6a=bOe();Object.defineProperty(Pt,"Unsafe",{enumerable:!0,get:a(function(){return C6a.Unsafe},"get")});var v6a=Cmt();Object.defineProperty(Pt,"Void",{enumerable:!0,get:a(function(){return v6a.Void},"get")})});var pIi=I(Tmt=>{"use strict";p();Object.defineProperty(Tmt,"__esModule",{value:!0});Tmt.JavaScriptTypeBuilder=void 0;var b6a=Dvr(),S6a=E0t(),T6a=_me(),I6a=lOe(),x6a=Tme(),w6a=Cme(),R6a=Q0t(),k6a=uOe(),P6a=oG(),D6a=emt(),N6a=tmt(),M6a=xme(),O6a=fmt(),B6a=sOe(),L6a=hmt(),F6a=gmt(),U6a=fOe(),Q6a=hOe(),q6a=pOe(),j6a=Cmt(),Nvr=class extends b6a.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,S6a.Argument)(e)}AsyncIterator(e,r){return(0,T6a.AsyncIterator)(e,r)}Awaited(e,r){return(0,I6a.Awaited)(e,r)}BigInt(e){return(0,x6a.BigInt)(e)}ConstructorParameters(e,r){return(0,R6a.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,w6a.Constructor)(e,r,n)}Date(e={}){return(0,k6a.Date)(e)}Function(e,r,n){return(0,P6a.Function)(e,r,n)}InstanceType(e,r){return(0,D6a.InstanceType)(e,r)}Instantiate(e,r){return(0,N6a.Instantiate)(e,r)}Iterator(e,r){return(0,M6a.Iterator)(e,r)}Parameters(e,r){return(0,O6a.Parameters)(e,r)}Promise(e,r){return(0,B6a.Promise)(e,r)}RegExp(e,r){return(0,L6a.RegExp)(e,r)}ReturnType(e,r){return(0,F6a.ReturnType)(e,r)}Symbol(e){return(0,U6a.Symbol)(e)}Undefined(e){return(0,q6a.Undefined)(e)}Uint8Array(e){return(0,Q6a.Uint8Array)(e)}Void(e){return(0,j6a.Void)(e)}};Tmt.JavaScriptTypeBuilder=Nvr});var hIi=I(Vb=>{"use strict";p();var H6a=Vb&&Vb.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G6a=Vb&&Vb.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$6a=Vb&&Vb.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var K6a=Xr&&Xr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mn=Xr&&Xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K6a(e,t,r)};Object.defineProperty(Xr,"__esModule",{value:!0});mn(bEr(),Xr);mn(v8(),Xr);mn(bf(),Xr);mn(DEr(),Xr);mn(m1i(),Xr);mn(JMe(),Xr);mn(Ame(),Xr);mn(ZMe(),Xr);mn(_n(),Xr);mn(yme(),Xr);mn(Eme(),Xr);mn(E0t(),Xr);mn(_me(),Xr);mn(lOe(),Xr);mn(Tme(),Xr);mn(tOe(),Xr);mn(L0t(),Xr);mn(U0t(),Xr);mn(Cme(),Xr);mn(Q0t(),Xr);mn(uOe(),Xr);mn(q0t(),Xr);mn(K0t(),Xr);mn(dte(),Xr);mn(X0t(),Xr);mn(oG(),Xr);mn(Q2(),Xr);mn(emt(),Xr);mn(tmt(),Xr);mn(rmt(),Xr);mn(NT(),Xr);mn(xme(),Xr);mn(omt(),Xr);mn(q2(),Xr);mn(TE(),Xr);mn(umt(),Xr);mn(f0(),Xr);mn(d0(),Xr);mn(dmt(),Xr);mn(dOe(),Xr);mn(sG(),Xr);mn(dC(),Xr);mn(AOe(),Xr);mn(f4(),Xr);mn(fmt(),Xr);mn(EOe(),Xr);mn(yOe(),Xr);mn(sOe(),Xr);mn(uG(),Xr);mn(gOe(),Xr);mn(Dme(),Xr);mn(pmt(),Xr);mn(fG(),Xr);mn(hmt(),Xr);mn(_Oe(),Xr);mn(mmt(),Xr);mn(gmt(),Xr);mn(iIi(),Xr);mn(aIi(),Xr);mn(aG(),Xr);mn(fOe(),Xr);mn(U2(),Xr);mn(_mt(),Xr);mn(x8(),Xr);mn(hOe(),Xr);mn(pOe(),Xr);mn(mp(),Xr);mn(pG(),Xr);mn(bOe(),Xr);mn(Cmt(),Xr);mn(hIi(),Xr)});var gIi=I(lR=>{"use strict";p();var J6a=lR&&lR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Z6a=lR&&lR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X6a=lR&&lR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var t9a=A4&&A4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),r9a=A4&&A4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),n9a=A4&&A4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(xmt,"__esModule",{value:!0});xmt.ContextItemOrigin=void 0;var EIi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(EIi||(xmt.ContextItemOrigin=EIi={}))});var vIi=I(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.RangeSchema=xu.WorkspaceFolder=xu.VersionedTextDocumentIdentifier=xu.TextEdit=xu.TextDocumentItem=xu.Range=xu.Position=xu.DocumentUri=xu.Disposable=xu.Command=xu.CancellationTokenSource=xu.CancellationToken=void 0;var wmt=Imt(),$2=ti();Object.defineProperty(xu,"CancellationToken",{enumerable:!0,get:a(function(){return $2.CancellationToken},"get")});Object.defineProperty(xu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return $2.CancellationTokenSource},"get")});Object.defineProperty(xu,"Command",{enumerable:!0,get:a(function(){return $2.Command},"get")});Object.defineProperty(xu,"Disposable",{enumerable:!0,get:a(function(){return $2.Disposable},"get")});Object.defineProperty(xu,"DocumentUri",{enumerable:!0,get:a(function(){return $2.DocumentUri},"get")});Object.defineProperty(xu,"Position",{enumerable:!0,get:a(function(){return $2.Position},"get")});Object.defineProperty(xu,"Range",{enumerable:!0,get:a(function(){return $2.Range},"get")});Object.defineProperty(xu,"TextDocumentItem",{enumerable:!0,get:a(function(){return $2.TextDocumentItem},"get")});Object.defineProperty(xu,"TextEdit",{enumerable:!0,get:a(function(){return $2.TextEdit},"get")});Object.defineProperty(xu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return $2.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(xu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return $2.WorkspaceFolder},"get")});var CIi=wmt.Type.Object({line:wmt.Type.Integer({minimum:0}),character:wmt.Type.Integer({minimum:0})});xu.RangeSchema=wmt.Type.Object({start:CIi,end:CIi})});var SIi=I(bIi=>{"use strict";p();Object.defineProperty(bIi,"__esModule",{value:!0})});var TOe=I(Sf=>{"use strict";p();var o9a=Sf&&Sf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SOe=Sf&&Sf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o9a(e,t,r)};Object.defineProperty(Sf,"__esModule",{value:!0});Sf.TextEdit=Sf.Range=Sf.Position=Sf.Disposable=Sf.CancellationTokenSource=Sf.CancellationToken=void 0;var Ome=ti();Object.defineProperty(Sf,"CancellationToken",{enumerable:!0,get:a(function(){return Ome.CancellationToken},"get")});Object.defineProperty(Sf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return Ome.CancellationTokenSource},"get")});Object.defineProperty(Sf,"Disposable",{enumerable:!0,get:a(function(){return Ome.Disposable},"get")});Object.defineProperty(Sf,"Position",{enumerable:!0,get:a(function(){return Ome.Position},"get")});Object.defineProperty(Sf,"Range",{enumerable:!0,get:a(function(){return Ome.Range},"get")});Object.defineProperty(Sf,"TextEdit",{enumerable:!0,get:a(function(){return Ome.TextEdit},"get")});SOe(gIi(),Sf);SOe(yIi(),Sf);SOe(_Ii(),Sf);SOe(vIi(),Sf);SOe(SIi(),Sf)});var Ovr=I(MT=>{"use strict";p();var s9a=MT&&MT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},TIi=MT&&MT.__param||function(t,e){return function(r,n){e(r,n,t)}},a9a=MT&&MT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(MT,"__esModule",{value:!0});MT.CompletionNotifier=MT.ICompletionsNotifierService=void 0;var c9a=a9a(require("events")),l9a=rn(),u9a=See(),d9a=TOe(),f9a=Tg(),p9a=QMe(),Rmt="CompletionRequested";MT.ICompletionsNotifierService=(0,l9a.createServiceIdentifier)("ICompletionsNotifierService");var Mvr=class{static{a(this,"CompletionNotifier")}#e=new c9a.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(Rmt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,f9a.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${Rmt}`);return this.#e.on(Rmt,r),d9a.Disposable.create(()=>this.#e.off(Rmt,r))}};MT.CompletionNotifier=Mvr;MT.CompletionNotifier=Mvr=s9a([TIi(0,p9a.ICompletionsPromiseQueueService),TIi(1,u9a.ICompletionsTelemetryService)],Mvr)});var Bvr=I(kmt=>{"use strict";p();Object.defineProperty(kmt,"__esModule",{value:!0});kmt.ICompletionsObservableWorkspace=void 0;var h9a=Qs();kmt.ICompletionsObservableWorkspace=(0,h9a.createDecorator)("ICompletionsObservableWorkspace")});var xl=I(V2=>{"use strict";p();Object.defineProperty(V2,"__esModule",{value:!0});V2.logger=V2.Logger=V2.ICompletionsLogTargetService=V2.LogLevel=void 0;var m9a=rn(),g9a=See(),A9a=Tg(),Dte;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(Dte||(V2.LogLevel=Dte={}));V2.ICompletionsLogTargetService=(0,m9a.createServiceIdentifier)("ICompletionsLogTargetService");var Pmt=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,Dte.DEBUG,...r)}info(e,...r){this.log(e,Dte.INFO,...r)}warn(e,...r){this.log(e,Dte.WARN,...r)}error(e,...r){this.log(e,Dte.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,A9a.telemetryException)(e.get(g9a.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(V2.ICompletionsLogTargetService),Dte.ERROR,`${o}:`,s)}};V2.Logger=Pmt;V2.logger=new Pmt("default")});var xIi=I(AG=>{"use strict";p();Object.defineProperty(AG,"__esModule",{value:!0});AG.INotificationService=AG.NullNotificationService=AG.ProgressLocation=void 0;var y9a=rn(),E9a=SP(),IIi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(IIi||(AG.ProgressLocation=IIi={}));var Lvr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},E9a.CancellationToken.None))}};AG.NullNotificationService=Lvr;AG.INotificationService=(0,y9a.createServiceIdentifier)("INotificationService")});var Uvr=I(W2=>{"use strict";p();var _9a=W2&&W2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},C9a=W2&&W2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(W2,"__esModule",{value:!0});W2.ExtensionNotificationSender=W2.ICompletionsNotificationSender=void 0;var v9a=xIi(),b9a=rn();W2.ICompletionsNotificationSender=(0,b9a.createServiceIdentifier)("ICompletionsNotificationSender");var Fvr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};W2.ExtensionNotificationSender=Fvr;W2.ExtensionNotificationSender=Fvr=_9a([C9a(0,v9a.INotificationService)],Fvr)});var jvr=I(z2=>{"use strict";p();var S9a=z2&&z2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Qvr=z2&&z2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(z2,"__esModule",{value:!0});z2.UserErrorNotifier=z2.ICompletionsUserErrorNotifierService=void 0;var T9a=a4(),I9a=rn(),x9a=Ku(),kIi=xl(),w9a=Uvr(),R9a=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],wIi="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",RIi="https://gh.io/copilot-network-errors";z2.ICompletionsUserErrorNotifierService=(0,I9a.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var qvr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&R9a.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new kIi.Logger("certificates").error(this._logTarget,`${wIi} Please visit ${RIi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(wIi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(x9a.URI.parse(RIi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};z2.UserErrorNotifier=qvr;z2.UserErrorNotifier=qvr=S9a([Qvr(0,kIi.ICompletionsLogTargetService),Qvr(1,w9a.ICompletionsNotificationSender),Qvr(2,T9a.IEnvService)],qvr)});var gp=I(Bme=>{"use strict";p();Object.defineProperty(Bme,"__esModule",{value:!0});Bme.NullExperimentationService=Bme.IExperimentationService=void 0;var k9a=rn(),P9a=Sc();Bme.IExperimentationService=(0,k9a.createServiceIdentifier)("IExperimentationService");var Hvr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new P9a.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};Bme.NullExperimentationService=Hvr});var yG=I(Wb=>{"use strict";p();Object.defineProperty(Wb,"__esModule",{value:!0});Wb.DEFAULT_PROMPT_ALLOCATION_PERCENT=Wb.DEFAULT_SUFFIX_MATCH_THRESHOLD=Wb.DEFAULT_NUM_SNIPPETS=Wb.DEFAULT_MAX_PROMPT_LENGTH=Wb.DEFAULT_MAX_COMPLETION_LENGTH=void 0;Wb.normalizeLanguageId=N9a;Wb.DEFAULT_MAX_COMPLETION_LENGTH=500;Wb.DEFAULT_MAX_PROMPT_LENGTH=8192-Wb.DEFAULT_MAX_COMPLETION_LENGTH;Wb.DEFAULT_NUM_SNIPPETS=4;Wb.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;Wb.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var D9a={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function N9a(t){return t=t.toLowerCase(),D9a[t]??t}a(N9a,"normalizeLanguageId")});var PIi=I(Gvr=>{"use strict";p();Object.defineProperty(Gvr,"__esModule",{value:!0});Gvr.getUserKind=O9a;function M9a(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(M9a,"findKnownOrg");function O9a(t){let e=t.organizationList??[];return M9a(e)??""}a(O9a,"getUserKind")});var IOe=I(y4=>{"use strict";p();Object.defineProperty(y4,"__esModule",{value:!0});y4.IEndpointProvider=y4.ModelSupportedEndpoint=void 0;y4.isEndpointEditToolName=F9a;y4.isChatModelInformation=U9a;y4.isEmbeddingModelInformation=Q9a;y4.isCompletionModelInformation=q9a;var B9a=rn(),L9a=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function F9a(t){return L9a.has(t)}a(F9a,"isEndpointEditToolName");var DIi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(DIi||(y4.ModelSupportedEndpoint=DIi={}));function U9a(t){return t.capabilities.type==="chat"}a(U9a,"isChatModelInformation");function Q9a(t){return t.capabilities.type==="embeddings"}a(Q9a,"isEmbeddingModelInformation");function q9a(t){return t.capabilities.type==="completion"}a(q9a,"isCompletionModelInformation");y4.IEndpointProvider=(0,B9a.createServiceIdentifier)("IEndpointProvider")});var MIi=I($vr=>{"use strict";p();Object.defineProperty($vr,"__esModule",{value:!0});$vr.getUserSelectedModelConfiguration=j9a;var NIi=vE();function j9a(t){let e=(0,NIi.getConfig)(t,NIi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(j9a,"getUserSelectedModelConfiguration")});var BIi=I(KA=>{"use strict";p();Object.defineProperty(KA,"__esModule",{value:!0});KA.isReadable=G9a;KA.isReadableStream=OIi;KA.isReadableBufferedStream=$9a;KA.newWriteableStream=xOe;KA.consumeReadable=V9a;KA.peekReadable=W9a;KA.consumeStream=z9a;KA.listenStream=Nmt;KA.peekStream=Y9a;KA.toStream=K9a;KA.emptyStream=J9a;KA.toReadable=Z9a;KA.transform=X9a;KA.prefixedReadable=eUa;KA.prefixedStream=tUa;var H9a=Ts(),Dmt=ko();function G9a(t){let e=t;return e?typeof e.read=="function":!1}a(G9a,"isReadable");function OIi(t){let e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(r=>typeof r=="function"):!1}a(OIi,"isReadableStream");function $9a(t){let e=t;return e?OIi(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}a($9a,"isReadableBufferedStream");function xOe(t,e){return new Vvr(t,e)}a(xOe,"newWriteableStream");var Vvr=class{static{a(this,"WriteableStreamImpl")}constructor(e,r){this.reducer=e,this.options=r,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(r=>this.pendingWritePromises.push(r))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(typeof e<"u"&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(r=>r(e))}emitError(e){this.listeners.error.length===0?(0,H9a.onUnexpectedError)(e):this.listeners.error.slice(0).forEach(r=>r(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,r){if(!this.state.destroyed)switch(e){case"data":this.listeners.data.push(r),this.resume();break;case"end":this.listeners.end.push(r),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(r),this.state.flowing&&this.flowErrors();break}}removeListener(e,r){if(this.state.destroyed)return;let n;switch(e){case"data":n=this.listeners.data;break;case"end":n=this.listeners.end;break;case"error":n=this.listeners.error;break}if(n){let o=n.indexOf(r);o>=0&&n.splice(o,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer=="function"){let r=this.reducer(this.buffer.data);this.emitData(r)}else for(let r of this.buffer.data)this.emitData(r);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(r=>r())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function V9a(t,e){let r=[],n;for(;(n=t.read())!==null;)r.push(n);return e(r)}a(V9a,"consumeReadable");function W9a(t,e,r){let n=[],o;for(;(o=t.read())!==null&&n.length0?e(n):{read:a(()=>{if(n.length>0)return n.shift();if(typeof o<"u"){let s=o;return o=void 0,s}return t.read()},"read")}}a(W9a,"peekReadable");function z9a(t,e){return new Promise((r,n)=>{let o=[];Nmt(t,{onData:a(s=>{e&&o.push(s)},"onData"),onError:a(s=>{e?n(s):r(void 0)},"onError"),onEnd:a(()=>{r(e?e(o):void 0)},"onEnd")})})}a(z9a,"consumeStream");function Nmt(t,e,r){t.on("error",n=>{r?.isCancellationRequested||e.onError(n)}),t.on("end",()=>{r?.isCancellationRequested||e.onEnd()}),t.on("data",n=>{r?.isCancellationRequested||e.onData(n)})}a(Nmt,"listenStream");function Y9a(t,e){return new Promise((r,n)=>{let o=new Dmt.DisposableStore,s=[],c=a(d=>{if(s.push(d),s.length>e)return o.dispose(),t.pause(),r({stream:t,buffer:s,ended:!1})},"dataListener"),l=a(d=>(o.dispose(),n(d)),"errorListener"),u=a(()=>(o.dispose(),r({stream:t,buffer:s,ended:!0})),"endListener");o.add((0,Dmt.toDisposable)(()=>t.removeListener("error",l))),t.on("error",l),o.add((0,Dmt.toDisposable)(()=>t.removeListener("end",u))),t.on("end",u),o.add((0,Dmt.toDisposable)(()=>t.removeListener("data",c))),t.on("data",c)})}a(Y9a,"peekStream");function K9a(t,e){let r=xOe(e);return r.end(t),r}a(K9a,"toStream");function J9a(){let t=xOe(()=>{throw new Error("not supported")});return t.end(),t}a(J9a,"emptyStream");function Z9a(t){let e=!1;return{read:a(()=>e?null:(e=!0,t),"read")}}a(Z9a,"toReadable");function X9a(t,e,r){let n=xOe(r);return Nmt(t,{onData:a(o=>n.write(e.data(o)),"onData"),onError:a(o=>n.error(e.error?e.error(o):o),"onError"),onEnd:a(()=>n.end(),"onEnd")}),n}a(X9a,"transform");function eUa(t,e,r){let n=!1;return{read:a(()=>{let o=e.read();return n?o:(n=!0,o!==null?r([t,o]):t)},"read")}}a(eUa,"prefixedReadable");function tUa(t,e,r){let n=!1,o=xOe(r);return Nmt(e,{onData:a(s=>n?o.write(s):(n=!0,o.write(r([t,s]))),"onData"),onError:a(s=>o.error(s),"onError"),onEnd:a(()=>{n||(n=!0,o.write(t)),o.end()},"onEnd")}),o}a(tUa,"prefixedStream")});var _G=I(gc=>{"use strict";p();var rUa=gc&&gc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),nUa=gc&&gc.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),iUa=gc&&gc.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;onew Uint8Array(256)),Wvr,zvr,xE=class t{static{a(this,"VSBuffer")}static alloc(e){return wOe?new t(Buffer.allocUnsafe(e)):new t(new Uint8Array(e))}static wrap(e){return wOe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new t(e)}static fromString(e,r){return!(r?.dontUseNodeBuffer||!1)&&wOe?new t(Buffer.from(e)):(Wvr||(Wvr=new TextEncoder),new t(Wvr.encode(e)))}static fromByteArray(e){let r=t.alloc(e.length);for(let n=0,o=e.length;n"u"){r=0;for(let s=0,c=e.length;sr===e.buffer[n])}};gc.VSBuffer=xE;function UIi(t,e,r=0){let n=e.byteLength,o=t.byteLength;if(n===0)return 0;if(n===1)return t.indexOf(e[0],r);if(n>o-r)return-1;let s=sUa.value;s.fill(e.length);for(let d=0;d>>0|t[e+1]<<8>>>0}a(aUa,"readUInt16LE");function cUa(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255}a(cUa,"writeUInt16LE");function QIi(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}a(QIi,"readUInt32BE");function qIi(t,e,r){t[r+3]=e,e=e>>>8,t[r+2]=e,e=e>>>8,t[r+1]=e,e=e>>>8,t[r]=e}a(qIi,"writeUInt32BE");function jIi(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}a(jIi,"readUInt32LE");function HIi(t,e,r){t[r+0]=e&255,e=e>>>8,t[r+1]=e&255,e=e>>>8,t[r+2]=e&255,e=e>>>8,t[r+3]=e&255}a(HIi,"writeUInt32LE");function GIi(t,e){return t[e]}a(GIi,"readUInt8");function $Ii(t,e,r){t[r]=e}a($Ii,"writeUInt8");function lUa(t){return EG.consumeReadable(t,e=>xE.concat(e))}a(lUa,"readableToBuffer");function uUa(t){return EG.toReadable(t)}a(uUa,"bufferToReadable");function VIi(t){return EG.consumeStream(t,e=>xE.concat(e))}a(VIi,"streamToBuffer");async function dUa(t){return t.ended?xE.concat(t.buffer):xE.concat([...t.buffer,await VIi(t.stream)])}a(dUa,"bufferedStreamToBuffer");function fUa(t){return EG.toStream(t,e=>xE.concat(e))}a(fUa,"bufferToStream");function pUa(t){return EG.transform(t,{data:a(e=>typeof e=="string"?xE.fromString(e):xE.wrap(e),"data")},e=>xE.concat(e))}a(pUa,"streamToBufferReadableStream");function hUa(t){return EG.newWriteableStream(e=>xE.concat(e),t)}a(hUa,"newWriteableBufferStream");function mUa(t,e){return EG.prefixedReadable(t,e,r=>xE.concat(r))}a(mUa,"prefixedBufferReadable");function gUa(t,e){return EG.prefixedStream(t,e,r=>xE.concat(r))}a(gUa,"prefixedBufferStream");function AUa(t){let e=0,r=0,n=0,o=new Uint8Array(Math.floor(t.length/4*3)),s=a(l=>{switch(r){case 3:o[n++]=e|l,r=0;break;case 2:o[n++]=e|l>>>2,e=l<<6,r=3;break;case 1:o[n++]=e|l>>>4,e=l<<4,r=2;break;default:e=l<<2,r=1}},"append");for(let l=0;l=65&&u<=90)s(u-65);else if(u>=97&&u<=122)s(u-97+26);else if(u>=48&&u<=57)s(u-48+52);else if(u===43||u===45)s(62);else if(u===47||u===95)s(63);else{if(u===61)break;throw new SyntaxError(`Unexpected base64 character ${t[l]}`)}}let c=n;for(;r>0;)s(0);return xE.wrap(o).slice(0,c)}a(AUa,"decodeBase64");var yUa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EUa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function _Ua({buffer:t},e=!0,r=!1){let n=r?EUa:yUa,o="",s=t.byteLength%3,c=0;for(;c>>2],o+=n[(l<<4|u>>>4)&63],o+=n[(u<<2|d>>>6)&63],o+=n[d&63]}if(s===1){let l=t[c+0];o+=n[l>>>2],o+=n[l<<4&63],e&&(o+="==")}else if(s===2){let l=t[c+0],u=t[c+1];o+=n[l>>>2],o+=n[(l<<4|u>>>4)&63],o+=n[u<<2&63],e&&(o+="=")}return o}a(_Ua,"encodeBase64");var LIi="0123456789abcdef";function CUa({buffer:t}){let e="";for(let r=0;r>>4],e+=LIi[n&15]}return e}a(CUa,"encodeHex");function vUa(t){if(t.length%2!==0)throw new SyntaxError("Hex string must have an even length");let e=new Uint8Array(t.length>>1);for(let r=0;r>1]=FIi(t,r++)<<4|FIi(t,r++);return xE.wrap(e)}a(vUa,"decodeHex");function FIi(t,e){let r=t.charCodeAt(e);if(r>=48&&r<=57)return r-48;if(r>=97&&r<=102)return r-87;if(r>=65&&r<=70)return r-55;throw new SyntaxError(`Invalid hex character at position ${e}`)}a(FIi,"decodeHexChar")});var WIi=I(Mmt=>{"use strict";p();Object.defineProperty(Mmt,"__esModule",{value:!0});Mmt.readVariableLengthQuantity=SUa;Mmt.writeVariableLengthQuantity=TUa;var bUa=_G();function SUa(t,e){let r=0,n=0,o;do o=t.readUInt8(e+n),r|=(o&127)<>>=7,t!==0&&(r|=128),e.push(r)}while(t!==0);return bUa.VSBuffer.fromByteArray(e)}a(TUa,"writeVariableLengthQuantity")});var Yvr=I(Omt=>{"use strict";p();Object.defineProperty(Omt,"__esModule",{value:!0});Omt.parseTikTokenBinary=void 0;var IUa=require("fs"),xUa=WIi(),wUa=_G(),RUa=a(t=>{let e=(0,IUa.readFileSync)(t),r=new Map;for(let n=0;n{"use strict";p();Object.defineProperty(Bmt,"__esModule",{value:!0});Bmt.CopilotPromptLoadFailure=void 0;var Kvr=class extends Error{static{a(this,"CopilotPromptLoadFailure")}constructor(e,r){super(e,{cause:r}),this.code="CopilotPromptLoadFailure"}};Bmt.CopilotPromptLoadFailure=Kvr});var Zvr=I(uR=>{"use strict";p();var kUa=uR&&uR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),PUa=uR&&uR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DUa=uR&&uR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Y2,"__esModule",{value:!0});Y2.initializeTokenizers=Y2.ApproximateTokenizer=Y2.TTokenizer=Y2.TokenizerName=void 0;Y2.getTokenizer=UUa;var Xvr=oGe(),BUa=Yvr(),LUa=Jvr(),FUa=Zvr(),E4;(function(t){t.cl100k="cl100k_base",t.o200k="o200k_base",t.mock="mock"})(E4||(Y2.TokenizerName=E4={}));var Lmt=new Map;function UUa(t=E4.o200k){let e=Lmt.get(t);return e!==void 0||(e=Lmt.get(E4.o200k),e!==void 0)?e:new Umt}a(UUa,"getTokenizer");var Fmt=class t{static{a(this,"TTokenizer")}constructor(e){this._tokenizer=e}static async create(e){try{let r=(0,Xvr.createTokenizer)((0,BUa.parseTikTokenBinary)((0,FUa.locateFile)(`${e}.tiktoken`)),(0,Xvr.getSpecialTokensByEncoder)(e),(0,Xvr.getRegexByEncoder)(e),32768);return new t(r)}catch(r){throw r instanceof Error?new LUa.CopilotPromptLoadFailure("Could not load tokenizer",r):r}}tokenize(e){return this._tokenizer.encode(e)}detokenize(e){return this._tokenizer.decode(e)}tokenLength(e){return this.tokenize(e).length}tokenizeStrings(e){return this.tokenize(e).map(n=>this.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` -`)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},QUa={[E4.cl100k]:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},[E4.o200k]:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},ebr=4,Umt=class{static{a(this,"ApproximateTokenizer")}constructor(e=E4.o200k,r){this.languageId=r,this.tokenizerName=e}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-ebr),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-ebr)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?QUa[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` -`)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};Y2.ApproximateTokenizer=Umt;async function KIi(t){try{let e=await Fmt.create(t);Lmt.set(t,e)}catch{}}a(KIi,"setTokenizer");Y2.initializeTokenizers=(async()=>{Lmt.set(E4.mock,new tbr),await Promise.all([KIi(E4.cl100k),KIi(E4.o200k)])})()});var Lme=I(Mte=>{"use strict";p();var qUa=Mte&&Mte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jUa=Mte&&Mte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qUa(e,t,r)};Object.defineProperty(Mte,"__esModule",{value:!0});jUa(JIi(),Mte)});var nbr=I(K2=>{"use strict";p();var HUa=K2&&K2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ROe=K2&&K2.__param||function(t,e){return function(r,n){e(r,n,t)}},kOe;Object.defineProperty(K2,"__esModule",{value:!0});K2.AvailableModelsManager=K2.ICompletionsModelManagerService=void 0;var GUa=SE(),$Ua=IOe(),VUa=rn(),WUa=ko(),zUa=Qs(),YUa=MIi(),KUa=Lme(),JUa=Tyr(),ZUa=s0t(),Qmt=vE(),XUa=VA(),ZIi=xl();K2.ICompletionsModelManagerService=(0,VUa.createServiceIdentifier)("ICompletionsModelManagerService");var e7a="gpt-41-copilot",rbr=kOe=class extends WUa.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new JUa.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,ZUa.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=kOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return e7a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=kOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return kOe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:KUa.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(YUa.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(ZIi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(Qmt.getConfig,Qmt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(Qmt.getConfig,Qmt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new CG(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new CG(s,"exp"):new CG(n,"modelpicker"):s?new CG(s,"exp"):this.customModels.length>0?new CG(this.customModels[0],"custommodel"):new CG(r,"default")}};K2.AvailableModelsManager=rbr;K2.AvailableModelsManager=rbr=kOe=HUa([ROe(1,zUa.IInstantiationService),ROe(2,XUa.ICompletionsFeaturesService),ROe(3,$Ua.IEndpointProvider),ROe(4,GUa.IAuthenticationService),ROe(5,ZIi.ICompletionsLogTargetService)],rbr);var CG=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var obr=I(ibr=>{"use strict";p();Object.defineProperty(ibr,"__esModule",{value:!0});ibr.getEngineRequestInfo=r7a;var t7a=nbr();function r7a(t,e=void 0){let r=t.get(t7a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(r7a,"getEngineRequestInfo")});var rxi=I(qmt=>{"use strict";p();Object.defineProperty(qmt,"__esModule",{value:!0});qmt.setupCompletionsExperimentationService=a7a;qmt.createCompletionsFilters=txi;var n7a=SE(),i7a=gp(),o7a=Qs(),XIi=PIi(),vG=vE(),s7a=obr(),dR=Mht();function a7a(t){let e=t.get(n7a.IAuthenticationService),r=t.get(o7a.IInstantiationService),n=e.onDidAuthenticationChange(()=>{r.invokeFunction(exi,e.copilotToken)});return exi(t,e.copilotToken),n}a(a7a,"setupCompletionsExperimentationService");function c7a(t){return vG.BuildInfo.getBuildType()===vG.BuildType.NIGHTLY?dR.Release.Nightly:dR.Release.Stable}a(c7a,"getPluginRelease");function exi(t,e){let r=t.get(i7a.IExperimentationService),n=txi(t,e);r.setCompletionsFilters(n)}a(exi,"updateCompletionsFilters");function txi(t,e){let r=new Map;if(r.set(dR.Filter.ExtensionRelease,c7a(t)),r.set(dR.Filter.CopilotOverrideEngine,(0,vG.getConfig)(t,vG.ConfigKey.DebugOverrideEngine)||(0,vG.getConfig)(t,vG.ConfigKey.DebugOverrideEngineLegacy)),r.set(dR.Filter.CopilotClientVersion,vG.BuildInfo.isProduction()?vG.BuildInfo.getVersion():"1.999.0"),e){let o=(0,XIi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(dR.Filter.CopilotUserKind,o),r.set(dR.Filter.CopilotCustomModel,s),r.set(dR.Filter.CopilotOrgs,c),r.set(dR.Filter.CopilotCustomModelNames,l),r.set(dR.Filter.CopilotTrackingId,u),r.set(dR.Filter.CopilotUserKind,(0,XIi.getUserKind)(e))}let n=(0,s7a.getEngineRequestInfo)(t).modelId;return r.set(dR.Filter.CopilotEngine,n),r}a(txi,"createCompletionsFilters")});var nxi=I(j8=>{"use strict";p();var l7a=j8&&j8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sbr=j8&&j8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(j8,"__esModule",{value:!0});j8.Features=void 0;var u7a=pp(),d7a=gp(),f7a=Qs(),Fme=yG(),p7a=pme(),abr=Tg(),h7a=rxi(),Oa=Dht(),m7a=Mht(),cbr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=abr.TelemetryData.createAndMarkAsIssued()){if(r instanceof abr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new abr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(Oa.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new Oa.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(h7a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new m7a.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SuffixMatchThreshold]??Fme.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(u7a.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MaxPromptCompletionTokens]??Fme.DEFAULT_MAX_PROMPT_LENGTH+Fme.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.StableContextPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.VolatileContextPercent]??Fme.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Oa.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};j8.Features=cbr;j8.Features=cbr=l7a([sbr(0,f7a.IInstantiationService),sbr(1,d7a.IExperimentationService),sbr(2,p7a.ICompletionsCopilotTokenManager)],cbr)});var bG=I(Ume=>{"use strict";p();Object.defineProperty(Ume,"__esModule",{value:!0});Ume.ICompletionsFileSystemService=Ume.FileType=void 0;var g7a=rn(),ixi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(ixi||(Ume.FileType=ixi={}));Ume.ICompletionsFileSystemService=(0,g7a.createServiceIdentifier)("ICompletionsFileSystemService")});var lbr=I(jmt=>{"use strict";p();Object.defineProperty(jmt,"__esModule",{value:!0});jmt.knownLanguages=void 0;jmt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var sxi=I(SG=>{"use strict";p();Object.defineProperty(SG,"__esModule",{value:!0});SG.knownFileExtensions=SG.templateLanguageLimitations=SG.knownTemplateLanguageExtensions=void 0;var oxi=lbr();SG.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];SG.templateLanguageLimitations={".php":[".blade"]};SG.knownFileExtensions=Object.keys(oxi.knownLanguages).flatMap(t=>oxi.knownLanguages[t].extensions)});var TG=I(J2=>{"use strict";p();Object.defineProperty(J2,"__esModule",{value:!0});J2.makeFsUri=C7a;J2.validateUri=v7a;J2.normalizeUri=b7a;J2.fsPath=uxi;J2.getFsPath=dxi;J2.getFsUri=S7a;J2.joinPath=T7a;J2.basename=w7a;J2.dirname=R7a;var A7a=require("os"),y7a=require("path"),E7a=xP(),POe=Ku();function cxi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+cxi(t.substring(3)):t}}a(cxi,"decodeURIComponentGraceful");var axi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _7a(t){return t.match(axi)?t.replace(axi,e=>cxi(e)):t}a(_7a,"percentDecode");function C7a(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return POe.URI.file(t).toString()}a(C7a,"makeFsUri");function DOe(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?POe.URI.parse(e[1]+e[2],!0):POe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(DOe,"parseUri");function v7a(t){return DOe(t),t}a(v7a,"validateUri");function b7a(t){try{return DOe(t).toString()}catch{return t}}a(b7a,"normalizeUri");var lxi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function uxi(t){let e=DOe(t);if(!lxi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,A7a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,y7a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(uxi,"fsPath");function dxi(t){try{return uxi(t)}catch{return}}a(dxi,"getFsPath");function S7a(t){let e=dxi(t);if(e)return POe.URI.file(e).toString()}a(S7a,"getFsUri");function T7a(t,...e){let r=POe.URI.joinPath(DOe(t),...e.map(I7a)).toString();return typeof t=="string"?r:{uri:r}}a(T7a,"joinPath");function I7a(t){return x7a(t)?t.replaceAll("\\","/"):t}a(I7a,"pathToURIPath");function x7a(t){return/^[^/\\]*\\/.test(t)}a(x7a,"isWinPath");function w7a(t){return _7a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(w7a,"basename");function R7a(t){let e=(0,E7a.dirname)(DOe(t)),r;return lxi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(R7a,"dirname")});var pxi=I(wE=>{"use strict";p();var k7a=wE&&wE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P7a=wE&&wE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),D7a=wE&&wE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&ubr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=ubr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Qme.has(e))return{languageId:Qme.get(e)[0],isGuess:!1};let n=dbr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Qme.has(e))return{languageId:Qme.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},pbr=class extends qme{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new Ote("cpp",r.isGuess,r.fileExtension):r}},hbr=class extends qme{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Ote(e.languageId,!0,""):this.delegate.detectLanguage(e)}};wE.languageDetection=new pbr(new hbr(new fbr));function O7a({uri:t,languageId:e}){let r=wE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(O7a,"detectLanguage")});var Hme=I(jme=>{"use strict";p();Object.defineProperty(jme,"__esModule",{value:!0});jme.CopilotTextDocument=jme.LocationFactory=void 0;var B7a=pxi(),L7a=TG(),NOe=(z3t(),Ca(Pln)),IG=NCe(),mbr=class{static{a(this,"LocationFactory")}static{this.range=IG.Range.create.bind(IG.Range)}static{this.position=IG.Position.create.bind(IG.Position)}};jme.LocationFactory=mbr;var gbr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=NOe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return NOe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=NOe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return NOe.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,B7a.detectLanguage)({uri:e,languageId:r})){return new t((0,L7a.normalizeUri)(e),NOe.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=IG.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=IG.Range.create(IG.Position.create(r,0),IG.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};jme.CopilotTextDocument=gbr});var OOe=I((Rvp,Axi)=>{"use strict";p();var Abr=Object.defineProperty,F7a=Object.getOwnPropertyDescriptor,U7a=Object.getOwnPropertyNames,Q7a=Object.prototype.hasOwnProperty,q7a=a((t,e)=>{for(var r in e)Abr(t,r,{get:e[r],enumerable:!0})},"__export"),j7a=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of U7a(e))!Q7a.call(t,o)&&o!==r&&Abr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=F7a(e,o))||n.enumerable});return t},"__copyProps"),H7a=a(t=>j7a(Abr({},"__esModule",{value:!0}),t),"__toCommonJS"),mxi={};q7a(mxi,{config:a(()=>z7a,"config"),t:a(()=>gxi,"t")});Axi.exports=H7a(mxi);var G7a=require("fs"),$7a=require("fs/promises");async function V7a(t){if(t.protocol==="file:")return await(0,$7a.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(V7a,"readFileFromUri");function W7a(t){return(0,G7a.readFileSync)(t,"utf8")}a(W7a,"readFileFromFsPath");var MOe;function z7a(t){if("contents"in t){typeof t.contents=="string"?MOe=JSON.parse(t.contents):MOe=t.contents;return}if("fsPath"in t){let e=W7a(t.fsPath),r=JSON.parse(e);MOe=hxi(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{V7a(e).then(o=>{try{let s=JSON.parse(o);MOe=hxi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(z7a,"config");function gxi(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=MOe?.[r];return s?typeof s=="string"?Hmt(s,o):s.comment?Hmt(s.message,o):Hmt(n,o):Hmt(n,o)}a(gxi,"t");var Y7a=/{([^}]+)}/g;function Hmt(t,e){return Object.keys(e).length===0?t:t.replace(Y7a,(r,n)=>e[n]??r)}a(Hmt,"format");function hxi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(hxi,"isBuiltinExtension")});var Bte=I(gC=>{"use strict";p();var K7a=gC&&gC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J7a=gC&&gC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Z7a=gC&&gC.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;or(l,o+" ")):[]].join("")}return a(r,"collect"),r(t,"").trim()}a(YCi,"collectErrorMessages");function TSa(t,e=!1){let r=new Set;function n(o){if(!o||!["object","string"].includes(typeof o)||r.has(o))return"";r.add(o);let l=((typeof o=="string"?o:o.message||o.code||"").toString?.()||"").trim().split(` +`).join(" "),u=[...e&&o.chromiumDetails?[JSON.stringify(KCi(o.chromiumDetails))]:[],...o.cause?[n(o.cause)]:[],...Array.isArray(o.errors)?o.errors.map(d=>n(d)):[]].join(", ");return u?`${l}: ${u}`:l}return a(n,"collect"),n(t)}a(TSa,"collectSingleLineErrorMessage");function ISa(t){return t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)[^\s]+@([^\s:\/]+)/gi,"$1@"),t=t.replace(/(\b(?:PROXY|HTTPS?|SOCKS[45]?)\s+)([a-zA-Z0-9][-a-zA-Z0-9.]*)/gi,"$1"),t=t.replace(/(\/\/)[^\s/]+@([^\s:\/]+)/g,"$1@"),t=t.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,""),t=t.replace(/(?"),t=t.replace(/(?"),t=t.replace(/\b([a-zA-Z0-9][-a-zA-Z0-9]*\.)+[a-zA-Z]{2,}\b/g,""),t}a(ISa,"sanitizeNetworkErrorForTelemetry");function KCi(t){if(!t||typeof t!="object")return{};if(t.is_request_error!==void 0&&t.session_state===void 0)return{is_request_error:t.is_request_error,network_process_crashed:t.network_process_crashed};let e={drain_error:t.drain_error,drain_description:t.drain_description,go_away_error:t.go_away_error,go_away_error_details:t.go_away_error_details,go_away_debug_data:t.go_away_debug_data,rst_stream_error:t.rst_stream_error,rst_stream_error_details:t.rst_stream_error_details,rst_stream_description:t.rst_stream_description,last_framer_error:t.last_framer_error,last_framer_error_details:t.last_framer_error_details,error_source:t.error_source,aliases_length:Array.isArray(t.aliases)?t.aliases.length:void 0};if(t.proxy){let n=[...String(t.proxy).matchAll(/([a-z][a-z0-9+.-]*):\/\//gi)].map(o=>o[1]);n.length>0&&(e.proxy_schemes=n)}if(t.in_flight_write&&typeof t.in_flight_write=="object"&&(e.in_flight_write={frame_type:t.in_flight_write.frame_type,frame_size:t.in_flight_write.frame_size,remaining_size:t.in_flight_write.remaining_size}),t.buffered_spdy_framer&&typeof t.buffered_spdy_framer=="object"&&(e.buffered_spdy_framer={frames_received:t.buffered_spdy_framer.frames_received,has_error:t.buffered_spdy_framer.has_error,message_fully_read:t.buffered_spdy_framer.message_fully_read}),t.session_state&&typeof t.session_state=="object"){let r=t.session_state;e.session_state={availability_state:r.availability_state,session_send_window:r.session_send_window,session_recv_window:r.session_recv_window,stream_initial_send_window:r.stream_initial_send_window,stream_initial_recv_window:r.stream_initial_recv_window,send_stalled_by_session_window:r.send_stalled_by_session_window,active_stream_count:r.active_stream_count,created_stream_count:r.created_stream_count,max_concurrent_streams:r.max_concurrent_streams,highest_stream_id_sent:r.highest_stream_id_sent,frames_sent:r.frames_sent,frames_received:r.frames_received,ping_in_flight:r.ping_in_flight,last_ping_sent_ms:r.last_ping_sent_ms,next_ping_id:r.next_ping_id,failed_ping_count:r.failed_ping_count,support_websocket:r.support_websocket,deprecate_http2_priorities:r.deprecate_http2_priorities,streams_initiated_count:r.streams_initiated_count,streams_abandoned_count:r.streams_abandoned_count,read_state:r.read_state,write_state:r.write_state,pending_create_stream_request_count:r.pending_create_stream_request_count,error:r.error,error_on_unavailable:r.error_on_unavailable,unacked_recv_window_bytes:r.unacked_recv_window_bytes,last_good_stream_id:r.last_good_stream_id,debug_stream_id:r.debug_stream_id,has_ping_based_connection_checking:r.has_ping_based_connection_checking,num_broken_connection_detection_requests:r.num_broken_connection_detection_requests,session_max_queued_capped_frames:r.session_max_queued_capped_frames,num_queued_capped_frames:r.num_queued_capped_frames,check_ping_status_pending:r.check_ping_status_pending,in_confirm_handshake:r.in_confirm_handshake,http2_end_stream_with_data_frame:r.http2_end_stream_with_data_frame,reused:r.reused,session_max_recv_window_size:r.session_max_recv_window_size,max_header_table_size:r.max_header_table_size,time_since_last_read_ms:r.time_since_last_read_ms,time_since_last_write_ms:r.time_since_last_write_ms,time_since_last_recv_window_update_ms:r.time_since_last_recv_window_update_ms}}if(t.tls_info&&typeof t.tls_info=="object"){let r=t.tls_info;e.tls_info={is_secure_connection:r.is_secure_connection,ssl_version:r.ssl_version,cipher_suite:r.cipher_suite,negotiated_alpn:r.negotiated_alpn,cert_status:r.cert_status,is_issued_by_known_root:r.is_issued_by_known_root,handshake_type:r.handshake_type,client_cert_sent:r.client_cert_sent,exchange_group:r.key_exchange_group,ct_compliance:r.ct_compliance,alps_negotiated:r.alps_negotiated}}if(t.socket_info&&typeof t.socket_info=="object"){let r=t.socket_info;e.socket_info={is_connected:r.is_connected,was_ever_used:r.was_ever_used,dns_lookup_duration_ms:r.dns_lookup_duration_ms,tcp_connect_duration_ms:r.tcp_connect_duration_ms,ssl_handshake_duration_ms:r.ssl_handshake_duration_ms,owned_socket:r.owned_socket,socket_reuse_type:r.socket_reuse_type}}return t.url_loader_error&&typeof t.url_loader_error=="object"&&(e.url_loader_error={is_request_error:t.url_loader_error.is_request_error,network_process_crashed:t.url_loader_error.network_process_crashed}),Array.isArray(t.active_stream_details)&&(e.active_stream_details=t.active_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),Array.isArray(t.closed_stream_details)&&(e.closed_stream_details=t.closed_stream_details.map(r=>({stream_id:r.stream_id,io_state:r.io_state,type:r.type,priority:r.priority,send_window_size:r.send_window_size,recv_window_size:r.recv_window_size,max_recv_window_size:r.max_recv_window_size,unacked_recv_window_bytes:r.unacked_recv_window_bytes,send_stalled_by_flow_control:r.send_stalled_by_flow_control,raw_sent_bytes:r.raw_sent_bytes,raw_received_bytes:r.raw_received_bytes,recv_bytes:r.recv_bytes,pending_send_status:r.pending_send_status,response_state:r.response_state,pending_send_data_remaining:r.pending_send_data_remaining,request_time_ms:r.request_time_ms,response_time_ms:r.response_time_ms}))),e}a(KCi,"extractChromiumDetails");var s0t=class{static{a(this,"LogMemory")}static{this._logs=[]}static{this._requestIds=[]}static{this.MAX_LOGS=50}static extractRequestIdFromMessage(e){let r=e.match(/request done: requestId: \[([0-9a-fA-F-]+)\] model deployment ID: \[/);if(r){let n=r[1];if(!this._requestIds.includes(n))return n}}static addLog(e,r){this._logs.length>=this.MAX_LOGS&&this._logs.shift(),this._logs.push(`${e}: ${r}`),this._requestIds.length>=this.MAX_LOGS&&this._requestIds.shift();let n=this.extractRequestIdFromMessage(r);n&&this._requestIds.push(n)}static getLogs(){return this._logs}static getRequestIds(){return this._requestIds}};XA.LogMemory=s0t});var RMe=I(wMe=>{"use strict";p();Object.defineProperty(wMe,"__esModule",{value:!0});wMe.ICopilotTokenManager=void 0;wMe.nowSeconds=wSa;var xSa=tn();wMe.ICopilotTokenManager=(0,xSa.createServiceIdentifier)("ICopilotTokenManager");function wSa(){return Math.floor(Date.now()/1e3)}a(wSa,"nowSeconds")});var CE=I(d0=>{"use strict";p();var RSa=d0&&d0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},a0t=d0&&d0.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(d0,"__esModule",{value:!0});d0.BaseAuthenticationService=d0.IAuthenticationService=d0.MinimalModeError=d0.GITHUB_SCOPE_ALIGNED=d0.GITHUB_SCOPE_READ_USER=d0.GITHUB_SCOPE_USER_EMAIL=void 0;d0.authProviderId=BSa;var PSa=tn(),oEr=_c(),kSa=Io(),DSa=BF(),Eee=Sl(),NSa=Ap(),MSa=RMe(),OSa=Y7();d0.GITHUB_SCOPE_USER_EMAIL=["user:email"];d0.GITHUB_SCOPE_READ_USER=["read:user"];d0.GITHUB_SCOPE_ALIGNED=["read:user","user:email","repo","workflow"];var sEr=class extends Error{static{a(this,"MinimalModeError")}constructor(){super("The authentication service is in minimal mode."),this.name="MinimalModeError"}};d0.MinimalModeError=sEr;d0.IAuthenticationService=(0,PSa.createServiceIdentifier)("IAuthenticationService");var aEr=class extends kSa.Disposable{static{a(this,"BaseAuthenticationService")}fireAuthenticationChange(e){let r=!!this.copilotToken;this._logService.info(`AuthenticationService: firing onDidAuthenticationChange from ${e}. Has token: ${r}`),this._onDidAuthenticationChange.fire()}constructor(e,r,n,o){super(),this._logService=e,this._tokenStore=r,this._tokenManager=n,this._configurationService=o,this._onDidAuthenticationChange=this._register(new oEr.Emitter),this.onDidAuthenticationChange=this._onDidAuthenticationChange.event,this._onDidAccessTokenChange=this._register(new oEr.Emitter),this.onDidAccessTokenChange=this._onDidAccessTokenChange.event,this._onDidAdoAuthenticationChange=this._register(new oEr.Emitter),this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event,this._isMinimalMode=(0,DSa.derived)(s=>this._configurationService.getConfigObservable(Eee.ConfigKey.Shared.AuthPermissions).read(s)===Eee.AuthPermissionMode.Minimal),this._register(n.onDidCopilotTokenRefresh(()=>{this._logService.debug("Handling CopilotToken refresh."),this._handleAuthChangeEvent()}))}get isMinimalMode(){return this._isMinimalMode.get()}get anyGitHubSession(){return this._anyGitHubSession}get hasCopilotTokenSource(){return!!this._anyGitHubSession}get permissiveGitHubSession(){return this._permissiveGitHubSession}get anyAdoSession(){return this._anyAdoSession}get copilotToken(){return this._tokenStore.copilotToken}async getCopilotToken(e){try{let r=await this._tokenManager.getCopilotToken(e);return this._tokenStore.copilotToken=r,this._copilotTokenError=void 0,r}catch(r){this._tokenStore.copilotToken=void 0;let n=this._copilotTokenError;throw this._copilotTokenError=r,n&&r&&n.message!==r.message&&this.fireAuthenticationChange("getCopilotToken error change"),r}}resetCopilotToken(e){this._tokenStore.copilotToken=void 0,this._tokenManager.resetCopilotToken(e)}async _handleAuthChangeEvent(){let e=this._anyGitHubSession,r=this._permissiveGitHubSession,n=this._anyAdoSession,o=this._tokenStore.copilotToken,s=this._copilotTokenError,c=await Promise.allSettled([this.getGitHubSession("any",{silent:!0}),this.getGitHubSession("permissive",{silent:!0}),this.getAnyAdoSession({silent:!0})]);for(let l of c)l.status==="rejected"&&this._logService.error(`Error getting a session: ${l.reason}`);if(e?.accessToken!==this._anyGitHubSession?.accessToken||r?.accessToken!==this._permissiveGitHubSession?.accessToken){this._onDidAccessTokenChange.fire(),this._logService.debug("Auth state changed, minting a new CopilotToken...");try{await this.getCopilotToken(!0)}catch{}this._logService.debug("Minted a new CopilotToken.");return}n?.accessToken!==this._anyAdoSession?.accessToken&&(this._logService.debug(`Ado auth state changed, firing event. Had token before: ${!!n?.accessToken}. Has token now: ${!!this._anyAdoSession?.accessToken}.`),this._onDidAdoAuthenticationChange.fire());try{await this.getCopilotToken()}catch{}(o?.token!==this._tokenStore.copilotToken?.token||s?.message!==this._copilotTokenError?.message)&&(this._logService.debug("CopilotToken state changed, firing event."),this.fireAuthenticationChange("handleAuthChangeEvent")),this._logService.debug("Finished handling auth change event.")}};d0.BaseAuthenticationService=aEr;d0.BaseAuthenticationService=aEr=RSa([a0t(0,NSa.ILogService),a0t(1,OSa.ICopilotTokenStore),a0t(2,MSa.ICopilotTokenManager),a0t(3,Eee.IConfigurationService)],aEr);function BSa(t){return t.getConfig(Eee.ConfigKey.Shared.AuthProvider)===Eee.AuthProviderId.GitHubEnterprise?Eee.AuthProviderId.GitHubEnterprise:Eee.AuthProviderId.GitHub}a(BSa,"authProviderId")});var c0t=I(cEr=>{"use strict";p();Object.defineProperty(cEr,"__esModule",{value:!0});cEr.onCopilotToken=LSa;function LSa(t,e){return t.onDidAuthenticationChange(()=>{let r=t.copilotToken;r&&e(r)})}a(LSa,"onCopilotToken")});var uEr=I(M2=>{"use strict";p();var FSa=M2&&M2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},USa=M2&&M2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M2,"__esModule",{value:!0});M2.TelemetryUserConfig=M2.ICompletionsTelemetryUserConfigService=void 0;var QSa=CE(),qSa=tn(),jSa=Io(),HSa=c0t();function GSa(t){let e=t.getTokenValue("tid"),r=t.organizationList,n=t.enterpriseList,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(GSa,"propertiesFromCopilotToken");M2.ICompletionsTelemetryUserConfigService=(0,qSa.createServiceIdentifier)("ICompletionsTelemetryUserConfigService");var lEr=class extends jSa.Disposable{static{a(this,"TelemetryUserConfig")}#e;constructor(e){super(),this.#e={},this.optedIn=!1,this.ftFlag="",this._register((0,HSa.onCopilotToken)(e,n=>this.updateFromToken(n)));let r=e.copilotToken;r&&this.updateFromToken(r)}getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=GSa(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};M2.TelemetryUserConfig=lEr;M2.TelemetryUserConfig=lEr=FSa([USa(0,QSa.IAuthenticationService)],lEr)});var PMe=I(tme=>{"use strict";p();Object.defineProperty(tme,"__esModule",{value:!0});tme.PromiseQueue=tme.ICompletionsPromiseQueueService=void 0;var $Sa=tn();tme.ICompletionsPromiseQueueService=(0,$Sa.createServiceIdentifier)("completionsPromiseQueueService");var dEr=class{static{a(this,"PromiseQueue")}constructor(){this.promises=new Set}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};tme.PromiseQueue=dEr});var Ig=I(ud=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.TelemetryReporters=ud.ICompletionsTelemetryReporters=ud.CopilotTelemetryReporter=ud.TelemetryWithExp=ud.TelemetryData=ud.TelemetryStore=void 0;ud.telemetrizePromptLength=nTa;ud.now=nme;ud.telemetry=_Er;ud.telemetryExpProblem=sTa;ud.telemetryRaw=cTa;ud.telemetryException=XCi;ud.telemetryCatch=lTa;ud.telemetryError=uTa;ud.logEngineCompletion=fTa;ud.logEnginePrompt=pTa;var VSa=r4(),WSa=tn(),zSa=fm(),mEr=Ms(),l0t=_ee(),n4=_E(),YSa=Mht(),KSa=JA(),JSa=Bht(),ZSa=Lyr(),gEr=uEr(),AEr=PMe(),IT;(function(t){t[t.Standard=0]="Standard",t[t.Enhanced=1]="Enhanced"})(IT||(ud.TelemetryStore=IT={}));(function(t){function e(r){return r===t.Enhanced}a(e,"isEnhanced"),t.isEnhanced=e})(IT||(ud.TelemetryStore=IT={}));function rme(t){return t===IT.Enhanced}a(rme,"isEnhanced");var XSa=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],kMe=8192,eTa=21,i4=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=[ZSa.ExpServiceTelemetryNames.featuresTelemetryPropertyName]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},nme())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=nme())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(KSa.ICompletionsFeaturesService).getFallbackExpAndFilters();n.addToTelemetry(this),r.addToTelemetry(this)}extendWithEditorAgnosticFields(e){let r=e.get(VSa.IEnvService),n=e.get(n4.ICompletionsEditorAndPluginInfo);this.properties.editor_version=(0,n4.formatNameAndVersion)(n.getEditorInfo()),this.properties.editor_plugin_version=(0,n4.formatNameAndVersion)(n.getEditorPluginInfo()),this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${n4.BuildInfo.getVersion()}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`),this.properties.common_extname=n.getEditorPluginInfo().name,this.properties.common_extversion=n.getEditorPluginInfo().version,this.properties.common_vscodeversion=(0,n4.formatNameAndVersion)(n.getEditorInfo())}extendWithConfigProperties(e){let r=(0,n4.dumpForTelemetry)(e);r["copilot.build"]=n4.BuildInfo.getBuild(),r["copilot.buildType"]=n4.BuildInfo.getBuildType(),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromProperties(e,r){if(rme(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>kMe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+kMe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(nTa,"telemetrizePromptLength");function nme(){return performance.now()}a(nme,"now");function iTa(t){return Math.floor(t/1e3)}a(iTa,"nowSeconds");function EEr(t){return t.get(gEr.ICompletionsTelemetryUserConfigService).optedIn}a(EEr,"shouldSendEnhanced");function JCi(t){return t.get(gEr.ICompletionsTelemetryUserConfigService).ftFlag!==""}a(JCi,"shouldSendFinetuningTelemetry");function _Er(t,e,r,n){return t.get(AEr.ICompletionsPromiseQueueService).register(oTa(t,e,nme(),r?.extendedBy(),n))}a(_Er,"telemetry");async function oTa(t,e,r,n,o=IT.Standard){let s=t.get(l0t.ICompletionsTelemetryService),c=t.get(mEr.IInstantiationService),l=n||i4.createAndMarkAsIssued({},{});await l.makeReadyForSending(t,o??!1,"IncludeExp",r),(!rme(o)||c.invokeFunction(EEr))&&yEr(s,o,e,l),rme(o)&&XSa.includes(e)&&c.invokeFunction(JCi)&&c.invokeFunction(rTa,o,e,l)}a(oTa,"_telemetry");function sTa(t,e){return t.get(AEr.ICompletionsPromiseQueueService).register(aTa(t,e,nme()))}a(sTa,"telemetryExpProblem");async function aTa(t,e,r){let n=t.get(l0t.ICompletionsTelemetryService),o="expProblem",s=i4.createAndMarkAsIssued(e,{});await s.makeReadyForSending(t,IT.Standard,"SkipExp",r),yEr(n,IT.Standard,o,s)}a(aTa,"_telemetryExpProblem");function cTa(t,e,r,n){let o=t.get(l0t.ICompletionsTelemetryService),s={...r,...ZCi(t)};yEr(o,IT.Standard,e,{properties:s,measurements:n})}a(cTa,"telemetryRaw");function ZCi(t){let e=t.get(n4.ICompletionsEditorAndPluginInfo),r={unique_id:(0,zSa.generateUuid)(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:(0,n4.formatNameAndVersion)(e.getEditorInfo())};return{...t.get(gEr.ICompletionsTelemetryUserConfigService).getProperties(),...r}}a(ZCi,"createRequiredProperties");function XCi(t,e,r){return t.sendGHTelemetryException(e,r||"")}a(XCi,"telemetryException");function lTa(t,e,r,n){let o=a(async(...s)=>{try{await r(...s)}catch(c){XCi(t,c,n)}},"wrapped");return(...s)=>e.register(o(...s))}a(lTa,"telemetryCatch");function uTa(t,e,r,n){return t.get(AEr.ICompletionsPromiseQueueService).register(dTa(t,e,nme(),r?.extendedBy(),n))}a(uTa,"telemetryError");async function dTa(t,e,r,n,o=IT.Standard){if(rme(o)&&!EEr(t))return;let s=t.get(mEr.IInstantiationService),c=n||i4.createAndMarkAsIssued({},{});await c.makeReadyForSending(t,o,"IncludeExp",r),s.invokeFunction(tTa,o,e,c)}a(dTa,"_telemetryError");function fTa(t,e,r,n,o){let s=i4.createAndMarkAsIssued({completionTextJson:JSON.stringify(e),choiceIndex:o.toString()});if(r.logprobs)for(let[c,l]of Object.entries(r.logprobs))s.properties["logprobs_"+c]=JSON.stringify(l)??"unset";return s.extendWithRequestId(n),_Er(t,"engine.completion",s,IT.Enhanced)}a(fTa,"logEngineCompletion");function pTa(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return _Er(t,"engine.prompt",o,IT.Enhanced)}a(pTa,"logEnginePrompt");var pEr=class{static{a(this,"CopilotTelemetryReporter")}};ud.CopilotTelemetryReporter=pEr;ud.ICompletionsTelemetryReporters=(0,WSa.createServiceIdentifier)("ICompletionsTelemetryReporters");var hEr=class{static{a(this,"TelemetryReporters")}getReporter(e,r=IT.Standard){return rme(r)?this.getEnhancedReporter(e):this.reporter}getEnhancedReporter(e){if(EEr(e))return this.reporterEnhanced}getFTReporter(e){}setReporter(e){this.reporter=e}setEnhancedReporter(e){this.reporterEnhanced=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterEnhanced,this.reporterFT];this.reporter=this.reporterEnhanced=this.reporterFT=void 0,await Promise.all(e.map(r=>r?.dispose()))}};ud.TelemetryReporters=hEr});var _ee=I(O2=>{"use strict";p();var hTa=O2&&O2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},mTa=O2&&O2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(O2,"__esModule",{value:!0});O2.CompletionsTelemetryServiceBridge=O2.ICompletionsTelemetryService=void 0;var gTa=Bh(),vEr=wyr(),ATa=tn(),DMe=Ig();O2.ICompletionsTelemetryService=(0,ATa.createServiceIdentifier)("completionsTelemetryService");var CEr=class{static{a(this,"CompletionsTelemetryServiceBridge")}constructor(e){this.telemetryService=e,this.reporter=void 0,this.enhancedReporter=void 0}sendGHTelemetryEvent(e,r,n,o){this.telemetryService.sendGHTelemetryEvent((0,vEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??DMe.TelemetryStore.Standard)?.sendTelemetryEvent(e,r,n)}sendEnhancedGHTelemetryEvent(e,r,n,o){this.telemetryService.sendEnhancedGHTelemetryEvent((0,vEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??DMe.TelemetryStore.Enhanced)?.sendTelemetryEvent(e,r,n)}sendGHTelemetryErrorEvent(e,r,n,o){this.telemetryService.sendGHTelemetryErrorEvent((0,vEr.wrapEventNameForPrefixRemoval)(`copilot/${e}`),r,n),this.getSpyReporters(o??DMe.TelemetryStore.Enhanced)?.sendTelemetryErrorEvent(e,r,n)}sendGHTelemetryException(e,r,n){this.telemetryService.sendGHTelemetryException(e,r),e instanceof Error&&this.getSpyReporters(n??DMe.TelemetryStore.Enhanced)?.sendTelemetryException(e,void 0,void 0)}setSpyReporters(e,r){this.reporter=e,this.enhancedReporter=r}clearSpyReporters(){this.reporter=void 0,this.enhancedReporter=void 0}getSpyReporters(e){return DMe.TelemetryStore.isEnhanced(e)?this.enhancedReporter:this.reporter}};O2.CompletionsTelemetryServiceBridge=CEr;O2.CompletionsTelemetryServiceBridge=CEr=hTa([mTa(0,gTa.ITelemetryService)],CEr)});var ebi=I(ime=>{"use strict";p();Object.defineProperty(ime,"__esModule",{value:!0});ime.CopilotExtensionStatus=ime.ICompletionsExtensionStatus=void 0;var yTa=tn();ime.ICompletionsExtensionStatus=(0,yTa.createServiceIdentifier)("ICompletionsExtensionStatus");var bEr=class{static{a(this,"CopilotExtensionStatus")}constructor(e="Normal",r,n=!1,o){this.kind=e,this.message=r,this.busy=n,this.command=o}};ime.CopilotExtensionStatus=bEr});var u0t=I(B2=>{"use strict";p();Object.defineProperty(B2,"__esModule",{value:!0});B2.CopilotToken=void 0;B2.containsInternalOrg=tbi;B2.containsVSCodeOrg=ibi;B2.validateTokenEnvelope=obi;B2.isTokenEnvelope=STa;B2.isErrorEnvelope=TTa;B2.isStandardErrorEnvelope=ITa;B2.createTestExtendedTokenInfo=xTa;var Un=jH();function tbi(t){return rbi(t)||nbi(t)}a(tbi,"containsInternalOrg");function rbi(t){let e=["4535c7beffc844b46bb1ed4aa04d759a"];for(let r of t)if(e.includes(r))return!0;return!1}a(rbi,"containsGitHubOrg");function nbi(t){let e=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"];for(let r of t)if(e.includes(r))return!0;return!1}a(nbi,"containsMicrosoftOrg");function ibi(t){let e=["551cca60ce19654d894e786220822482"];for(let r of t)if(e.includes(r))return!0;return!1}a(ibi,"containsVSCodeOrg");var SEr=class{static{a(this,"CopilotToken")}constructor(e){this._info=e,this.tokenMap=this.parseToken(e.token)}parseToken(e){let r=new Map,o=e?.split(":")[0]?.split(";");for(let s of o){let[c,l]=s.split("=");r.set(c,l)}return r}get token(){return this._info.token}get sku(){return this._info.sku}get isIndividual(){return this._info.individual??!1}get organizationList(){return this._info.organization_list||[]}get organizationLoginList(){return this._info.organization_login_list||[]}get enterpriseList(){return this._info.enterprise_list||[]}get endpoints(){return this._info.endpoints}get isInternal(){return tbi(this.organizationList)}get isMicrosoftInternal(){return nbi(this.organizationList)}get isGitHubInternal(){return rbi(this.organizationList)}get isFreeUser(){return this.sku==="free_limited_copilot"}get isNoAuthUser(){return this.sku==="no_auth_limited_copilot"}get isManagedPlan(){let e=this.copilotPlan;return e==="business"||e==="enterprise"}get isUsageBasedBilling(){return this._info.token_based_billing===!0}get isChatQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.chat??1)<=0}get isCompletionsQuotaExceeded(){return this.isFreeUser&&(this._info.limited_user_quotas?.completions??1)<=0}get codeQuoteEnabled(){return this._info.code_quote_enabled??!1}get isVscodeTeamMember(){return this._info.isVscodeTeamMember||ibi(this.organizationList)}get codexAgentEnabled(){return this._info.codex_agent_enabled??!1}get copilotPlan(){if(this.isFreeUser)return"free";let e=this._info.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get rawCopilotPlan(){return this.isFreeUser?"free":this._info.copilot_plan??"individual"}get quotaInfo(){return{quota_snapshots:this._info.quota_snapshots,quota_reset_date:this._info.quota_reset_date}}get tokenBasedBilling(){return this._info.token_based_billing}get username(){return this._info.username}isTelemetryEnabled(){return this._isTelemetryEnabled===void 0&&(this._isTelemetryEnabled=this._info.telemetry==="enabled"),this._isTelemetryEnabled}isPublicSuggestionsEnabled(){return this._isPublicSuggestionsEnabled===void 0&&(this._isPublicSuggestionsEnabled=this._info.public_suggestions==="enabled"),this._isPublicSuggestionsEnabled}isCopilotIgnoreEnabled(){return this._info.copilotignore_enabled??!1}get isCopilotCodeReviewEnabled(){return this._info.code_review_enabled??this.getTokenValue("ccr")==="1"}isEditorPreviewFeaturesEnabled(){return this.getTokenValue("editor_preview_features")!=="0"}isBlackbirdExternalIndexingEnabled(){return this.getTokenValue("blackbird_external_indexing")==="1"}isMcpEnabled(){return this.getTokenValue("mcp")!=="0"}isClientBYOKEnabled(){return this.getTokenValue("client_byok")==="1"}getTokenValue(e){return this.tokenMap.get(e)}isExpandedClientSideIndexingEnabled(){return this._info.blackbird_clientside_indexing===!0}isFcv1(){return this.tokenMap.get("fcv1")==="1"}isSn(){return this.tokenMap.get("sn")==="1"}};B2.CopilotToken=SEr;var ETa=(0,Un.vObj)({message:(0,Un.vRequired)((0,Un.vString)()),notification_id:(0,Un.vRequired)((0,Un.vString)()),title:(0,Un.vRequired)((0,Un.vString)()),url:(0,Un.vRequired)((0,Un.vString)())}),_Ta=(0,Un.vObj)({can_signup_for_limited:(0,Un.vNullable)((0,Un.vBoolean)()),error_details:(0,Un.vRequired)(ETa),message:(0,Un.vRequired)((0,Un.vString)()),reason:(0,Un.vString)()}),vTa=(0,Un.vObj)({token:(0,Un.vRequired)((0,Un.vString)()),expires_at:(0,Un.vRequired)((0,Un.vNumber)()),refresh_in:(0,Un.vRequired)((0,Un.vNumber)()),sku:(0,Un.vString)(),individual:(0,Un.vBoolean)(),blackbird_clientside_indexing:(0,Un.vBoolean)(),code_quote_enabled:(0,Un.vBoolean)(),code_review_enabled:(0,Un.vBoolean)(),codesearch:(0,Un.vBoolean)(),copilotignore_enabled:(0,Un.vBoolean)(),public_suggestions:(0,Un.vEnum)("enabled","disabled","unconfigured"),telemetry:(0,Un.vEnum)("enabled","disabled"),endpoints:(0,Un.vObj)({api:(0,Un.vString)(),"origin-tracker":(0,Un.vString)(),proxy:(0,Un.vString)(),telemetry:(0,Un.vString)()}),enterprise_list:(0,Un.vNullable)((0,Un.vArray)((0,Un.vNumber)())),limited_user_quotas:(0,Un.vNullable)((0,Un.vObj)({chat:(0,Un.vRequired)((0,Un.vNumber)()),completions:(0,Un.vRequired)((0,Un.vNumber)())})),limited_user_reset_date:(0,Un.vNullable)((0,Un.vNumber)()),organization_list:(0,Un.vArray)((0,Un.vString)())}),CTa=(0,Un.vObj)({message:(0,Un.vRequired)((0,Un.vString)()),documentation_url:(0,Un.vRequired)((0,Un.vString)()),status:(0,Un.vRequired)((0,Un.vString)())}),bTa=(0,Un.vObj)({token:(0,Un.vRequired)((0,Un.vString)()),expires_at:(0,Un.vRequired)((0,Un.vNumber)()),refresh_in:(0,Un.vRequired)((0,Un.vNumber)())});function obi(t){let e=vTa.validate(t);if(e.error===void 0)return{valid:!0,strategy:"strict",envelope:e.content};let r=e.error.message,n=bTa.validate(t);return n.error===void 0?{valid:!0,strategy:"fallback",strictError:r,envelope:t}:{valid:!1,strategy:"failed",strictError:r,fallbackError:n.error.message}}a(obi,"validateTokenEnvelope");function STa(t){return obi(t).valid}a(STa,"isTokenEnvelope");function TTa(t){return _Ta.validate(t).error===void 0}a(TTa,"isErrorEnvelope");function ITa(t){return CTa.validate(t).error===void 0}a(ITa,"isStandardErrorEnvelope");function xTa(t){return{token:"test-token",expires_at:0,refresh_in:0,sku:"free_limited_copilot",individual:!0,blackbird_clientside_indexing:!1,code_quote_enabled:!1,code_review_enabled:!1,codesearch:!1,copilotignore_enabled:!1,public_suggestions:"enabled",telemetry:"enabled",username:"testuser",isVscodeTeamMember:!1,copilot_plan:"free",organization_login_list:[],...t}}a(xTa,"createTestExtendedTokenInfo")});var ome=I(xT=>{"use strict";p();var wTa=xT&&xT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},RTa=xT&&xT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(xT,"__esModule",{value:!0});xT.CopilotTokenManagerImpl=xT.ICompletionsCopilotTokenManager=xT.CopilotToken=void 0;var PTa=CE(),kTa=tn(),DTa=zc(),NTa=Io(),MTa=u0t();Object.defineProperty(xT,"CopilotToken",{enumerable:!0,get:a(function(){return MTa.CopilotToken},"get")});xT.ICompletionsCopilotTokenManager=(0,kTa.createServiceIdentifier)("ICompletionsCopilotTokenManager");var TEr=class extends NTa.Disposable{static{a(this,"CopilotTokenManagerImpl")}get token(){return this.tokenRefetcher.trigger(()=>this.updateCachedToken()),this._token}constructor(e=!1,r){super(),this.primed=e,this.authenticationService=r,this.tokenRefetcher=new DTa.ThrottledDelayer(5e3),this.updateCachedToken(),this._register(this.authenticationService.onDidAuthenticationChange(()=>this.updateCachedToken()))}primeToken(){try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async getToken(){return this.updateCachedToken()}async updateCachedToken(){return this._token=await this.authenticationService.getCopilotToken(),this._token}resetToken(e){this.authenticationService.resetCopilotToken()}getLastToken(){return this.authenticationService.copilotToken}};xT.CopilotTokenManagerImpl=TEr;xT.CopilotTokenManagerImpl=TEr=wTa([RTa(1,PTa.IAuthenticationService)],TEr)});var d0t=I(sme=>{"use strict";p();Object.defineProperty(sme,"__esModule",{value:!0});sme.NoOpCitationManager=sme.ICompletionsCitationManager=void 0;var OTa=tn(),BTa=Io();sme.ICompletionsCitationManager=(0,OTa.createServiceIdentifier)("ICompletionsCitationManager");var IEr=class{static{a(this,"NoOpCitationManager")}register(){return BTa.Disposable.None}async handleIPCodeCitation(e){}};sme.NoOpCitationManager=IEr});var av=I(Rg=>{"use strict";p();Object.defineProperty(Rg,"__esModule",{value:!0});Rg.HasPropertyKey=LTa;Rg.IsAsyncIterator=FTa;Rg.IsArray=xEr;Rg.IsBigInt=UTa;Rg.IsBoolean=QTa;Rg.IsDate=qTa;Rg.IsFunction=jTa;Rg.IsIterator=HTa;Rg.IsNull=GTa;Rg.IsNumber=$Ta;Rg.IsObject=wEr;Rg.IsRegExp=VTa;Rg.IsString=WTa;Rg.IsSymbol=zTa;Rg.IsUint8Array=REr;Rg.IsUndefined=YTa;function LTa(t,e){return e in t}a(LTa,"HasPropertyKey");function FTa(t){return wEr(t)&&!xEr(t)&&!REr(t)&&Symbol.asyncIterator in t}a(FTa,"IsAsyncIterator");function xEr(t){return Array.isArray(t)}a(xEr,"IsArray");function UTa(t){return typeof t=="bigint"}a(UTa,"IsBigInt");function QTa(t){return typeof t=="boolean"}a(QTa,"IsBoolean");function qTa(t){return t instanceof globalThis.Date}a(qTa,"IsDate");function jTa(t){return typeof t=="function"}a(jTa,"IsFunction");function HTa(t){return wEr(t)&&!xEr(t)&&!REr(t)&&Symbol.iterator in t}a(HTa,"IsIterator");function GTa(t){return t===null}a(GTa,"IsNull");function $Ta(t){return typeof t=="number"}a($Ta,"IsNumber");function wEr(t){return typeof t=="object"&&t!==null}a(wEr,"IsObject");function VTa(t){return t instanceof globalThis.RegExp}a(VTa,"IsRegExp");function WTa(t){return typeof t=="string"}a(WTa,"IsString");function zTa(t){return typeof t=="symbol"}a(zTa,"IsSymbol");function REr(t){return t instanceof globalThis.Uint8Array}a(REr,"IsUint8Array");function YTa(t){return t===void 0}a(YTa,"IsUndefined")});var Pb=I(f8=>{"use strict";p();var KTa=f8&&f8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JTa=f8&&f8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZTa=f8&&f8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;of0t(e))}a(XTa,"ArrayType");function eIa(t){return new Date(t.getTime())}a(eIa,"DateType");function tIa(t){return new Uint8Array(t)}a(tIa,"Uint8ArrayType");function rIa(t){return new RegExp(t.source,t.flags)}a(rIa,"RegExpType");function nIa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=f0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=f0t(t[r]);return e}a(nIa,"ObjectType");function f0t(t){return NMe.IsArray(t)?XTa(t):NMe.IsDate(t)?eIa(t):NMe.IsUint8Array(t)?tIa(t):NMe.IsRegExp(t)?rIa(t):NMe.IsObject(t)?nIa(t):t}a(f0t,"Visit");function iIa(t){return f0t(t)}a(iIa,"Clone")});var h0t=I(p0t=>{"use strict";p();Object.defineProperty(p0t,"__esModule",{value:!0});p0t.CloneRest=oIa;p0t.CloneType=abi;var sbi=Pb();function oIa(t){return t.map(e=>abi(e))}a(oIa,"CloneRest");function abi(t,e){return e===void 0?(0,sbi.Clone)(t):(0,sbi.Clone)({...e,...t})}a(abi,"CloneType")});var PEr=I(WH=>{"use strict";p();var sIa=WH&&WH.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cbi=WH&&WH.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sIa(e,t,r)};Object.defineProperty(WH,"__esModule",{value:!0});cbi(h0t(),WH);cbi(Pb(),WH)});var m0t=I(pa=>{"use strict";p();Object.defineProperty(pa,"__esModule",{value:!0});pa.IsAsyncIterator=aIa;pa.IsIterator=cIa;pa.IsStandardObject=lIa;pa.IsInstanceObject=uIa;pa.IsPromise=dIa;pa.IsDate=fIa;pa.IsMap=pIa;pa.IsSet=hIa;pa.IsRegExp=mIa;pa.IsTypedArray=gIa;pa.IsInt8Array=AIa;pa.IsUint8Array=yIa;pa.IsUint8ClampedArray=EIa;pa.IsInt16Array=_Ia;pa.IsUint16Array=vIa;pa.IsInt32Array=CIa;pa.IsUint32Array=bIa;pa.IsFloat32Array=SIa;pa.IsFloat64Array=TIa;pa.IsBigInt64Array=IIa;pa.IsBigUint64Array=xIa;pa.HasPropertyKey=wIa;pa.IsObject=MMe;pa.IsArray=lbi;pa.IsUndefined=ubi;pa.IsNull=dbi;pa.IsBoolean=fbi;pa.IsNumber=pbi;pa.IsInteger=RIa;pa.IsBigInt=hbi;pa.IsString=mbi;pa.IsFunction=gbi;pa.IsSymbol=Abi;pa.IsValueType=PIa;function aIa(t){return MMe(t)&&globalThis.Symbol.asyncIterator in t}a(aIa,"IsAsyncIterator");function cIa(t){return MMe(t)&&globalThis.Symbol.iterator in t}a(cIa,"IsIterator");function lIa(t){return MMe(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(lIa,"IsStandardObject");function uIa(t){return MMe(t)&&!lbi(t)&&gbi(t.constructor)&&t.constructor.name!=="Object"}a(uIa,"IsInstanceObject");function dIa(t){return t instanceof globalThis.Promise}a(dIa,"IsPromise");function fIa(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(fIa,"IsDate");function pIa(t){return t instanceof globalThis.Map}a(pIa,"IsMap");function hIa(t){return t instanceof globalThis.Set}a(hIa,"IsSet");function mIa(t){return t instanceof globalThis.RegExp}a(mIa,"IsRegExp");function gIa(t){return globalThis.ArrayBuffer.isView(t)}a(gIa,"IsTypedArray");function AIa(t){return t instanceof globalThis.Int8Array}a(AIa,"IsInt8Array");function yIa(t){return t instanceof globalThis.Uint8Array}a(yIa,"IsUint8Array");function EIa(t){return t instanceof globalThis.Uint8ClampedArray}a(EIa,"IsUint8ClampedArray");function _Ia(t){return t instanceof globalThis.Int16Array}a(_Ia,"IsInt16Array");function vIa(t){return t instanceof globalThis.Uint16Array}a(vIa,"IsUint16Array");function CIa(t){return t instanceof globalThis.Int32Array}a(CIa,"IsInt32Array");function bIa(t){return t instanceof globalThis.Uint32Array}a(bIa,"IsUint32Array");function SIa(t){return t instanceof globalThis.Float32Array}a(SIa,"IsFloat32Array");function TIa(t){return t instanceof globalThis.Float64Array}a(TIa,"IsFloat64Array");function IIa(t){return t instanceof globalThis.BigInt64Array}a(IIa,"IsBigInt64Array");function xIa(t){return t instanceof globalThis.BigUint64Array}a(xIa,"IsBigUint64Array");function wIa(t,e){return e in t}a(wIa,"HasPropertyKey");function MMe(t){return t!==null&&typeof t=="object"}a(MMe,"IsObject");function lbi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(lbi,"IsArray");function ubi(t){return t===void 0}a(ubi,"IsUndefined");function dbi(t){return t===null}a(dbi,"IsNull");function fbi(t){return typeof t=="boolean"}a(fbi,"IsBoolean");function pbi(t){return typeof t=="number"}a(pbi,"IsNumber");function RIa(t){return globalThis.Number.isInteger(t)}a(RIa,"IsInteger");function hbi(t){return typeof t=="bigint"}a(hbi,"IsBigInt");function mbi(t){return typeof t=="string"}a(mbi,"IsString");function gbi(t){return typeof t=="function"}a(gbi,"IsFunction");function Abi(t){return typeof t=="symbol"}a(Abi,"IsSymbol");function PIa(t){return hbi(t)||fbi(t)||dbi(t)||pbi(t)||mbi(t)||Abi(t)||ubi(t)}a(PIa,"IsValueType")});var mm=I(vee=>{"use strict";p();var kIa=vee&&vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DIa=vee&&vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kIa(e,t,r)};Object.defineProperty(vee,"__esModule",{value:!0});DIa(m0t(),vee)});var OMe=I(A0t=>{"use strict";p();Object.defineProperty(A0t,"__esModule",{value:!0});A0t.TypeSystemPolicy=void 0;var g0t=mm(),ybi;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=(0,g0t.IsObject)(c);return t.AllowArrayObject?l:l&&!(0,g0t.IsArray)(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?(0,g0t.IsNumber)(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=(0,g0t.IsUndefined)(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(ybi||(A0t.TypeSystemPolicy=ybi={}))});var Ebi=I(p8=>{"use strict";p();var NIa=p8&&p8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MIa=p8&&p8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),OIa=p8&&p8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oy0t(e))}a(BIa,"ImmutableArray");function LIa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=y0t(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=y0t(t[r]);return globalThis.Object.freeze(e)}a(LIa,"ImmutableObject");function y0t(t){return BMe.IsArray(t)?BIa(t):BMe.IsDate(t)?t:BMe.IsUint8Array(t)?t:BMe.IsRegExp(t)?t:BMe.IsObject(t)?LIa(t):t}a(y0t,"Immutable")});var Si=I(kEr=>{"use strict";p();Object.defineProperty(kEr,"__esModule",{value:!0});kEr.CreateType=qIa;var FIa=OMe(),UIa=Ebi(),QIa=Pb();function qIa(t,e){let r=e!==void 0?{...e,...t}:t;switch(FIa.TypeSystemPolicy.InstanceMode){case"freeze":return(0,UIa.Immutable)(r);case"clone":return(0,QIa.Clone)(r);default:return r}}a(qIa,"CreateType")});var h8=I(Cee=>{"use strict";p();var jIa=Cee&&Cee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HIa=Cee&&Cee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jIa(e,t,r)};Object.defineProperty(Cee,"__esModule",{value:!0});HIa(Si(),Cee)});var NEr=I(E0t=>{"use strict";p();Object.defineProperty(E0t,"__esModule",{value:!0});E0t.TypeBoxError=void 0;var DEr=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};E0t.TypeBoxError=DEr});var Sf=I(bee=>{"use strict";p();var GIa=bee&&bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ia=bee&&bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GIa(e,t,r)};Object.defineProperty(bee,"__esModule",{value:!0});$Ia(NEr(),bee)});var LMe=I(rR=>{"use strict";p();Object.defineProperty(rR,"__esModule",{value:!0});rR.Kind=rR.Hint=rR.OptionalKind=rR.ReadonlyKind=rR.TransformKind=void 0;rR.TransformKind=Symbol.for("TypeBox.Transform");rR.ReadonlyKind=Symbol.for("TypeBox.Readonly");rR.OptionalKind=Symbol.for("TypeBox.Optional");rR.Hint=Symbol.for("TypeBox.Hint");rR.Kind=Symbol.for("TypeBox.Kind")});var _n=I(See=>{"use strict";p();var VIa=See&&See.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WIa=See&&See.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VIa(e,t,r)};Object.defineProperty(See,"__esModule",{value:!0});WIa(LMe(),See)});var ms=I(li=>{"use strict";p();var zIa=li&&li.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YIa=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),KIa=li&&li.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var cxa=Yn&&Yn.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lxa=Yn&&Yn.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),uxa=Yn&&Yn.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=7&&r<=13||r===27||r===127)return!1}return!0}a(OEr,"IsControlCharacterFree");function n1i(t){return BEr(t)||Pg(t)}a(n1i,"IsAdditionalProperties");function UMe(t){return ii.IsUndefined(t)||ii.IsBigInt(t)}a(UMe,"IsOptionalBigInt");function Gl(t){return ii.IsUndefined(t)||ii.IsNumber(t)}a(Gl,"IsOptionalNumber");function BEr(t){return ii.IsUndefined(t)||ii.IsBoolean(t)}a(BEr,"IsOptionalBoolean");function al(t){return ii.IsUndefined(t)||ii.IsString(t)}a(al,"IsOptionalString");function pxa(t){return ii.IsUndefined(t)||ii.IsString(t)&&OEr(t)&&r1i(t)}a(pxa,"IsOptionalPattern");function hxa(t){return ii.IsUndefined(t)||ii.IsString(t)&&OEr(t)}a(hxa,"IsOptionalFormat");function i1i(t){return ii.IsUndefined(t)||Pg(t)}a(i1i,"IsOptionalSchema");function mxa(t){return ii.IsObject(t)&&t[o4.ReadonlyKind]==="Readonly"}a(mxa,"IsReadonly");function gxa(t){return ii.IsObject(t)&&t[o4.OptionalKind]==="Optional"}a(gxa,"IsOptional");function o1i(t){return Us(t,"Any")&&al(t.$id)}a(o1i,"IsAny");function s1i(t){return Us(t,"Argument")&&ii.IsNumber(t.index)}a(s1i,"IsArgument");function a1i(t){return Us(t,"Array")&&t.type==="array"&&al(t.$id)&&Pg(t.items)&&Gl(t.minItems)&&Gl(t.maxItems)&&BEr(t.uniqueItems)&&i1i(t.contains)&&Gl(t.minContains)&&Gl(t.maxContains)}a(a1i,"IsArray");function c1i(t){return Us(t,"AsyncIterator")&&t.type==="AsyncIterator"&&al(t.$id)&&Pg(t.items)}a(c1i,"IsAsyncIterator");function l1i(t){return Us(t,"BigInt")&&t.type==="bigint"&&al(t.$id)&&UMe(t.exclusiveMaximum)&&UMe(t.exclusiveMinimum)&&UMe(t.maximum)&&UMe(t.minimum)&&UMe(t.multipleOf)}a(l1i,"IsBigInt");function u1i(t){return Us(t,"Boolean")&&t.type==="boolean"&&al(t.$id)}a(u1i,"IsBoolean");function d1i(t){return Us(t,"Computed")&&ii.IsString(t.target)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Pg(e))}a(d1i,"IsComputed");function f1i(t){return Us(t,"Constructor")&&t.type==="Constructor"&&al(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Pg(e))&&Pg(t.returns)}a(f1i,"IsConstructor");function p1i(t){return Us(t,"Date")&&t.type==="Date"&&al(t.$id)&&Gl(t.exclusiveMaximumTimestamp)&&Gl(t.exclusiveMinimumTimestamp)&&Gl(t.maximumTimestamp)&&Gl(t.minimumTimestamp)&&Gl(t.multipleOfTimestamp)}a(p1i,"IsDate");function h1i(t){return Us(t,"Function")&&t.type==="Function"&&al(t.$id)&&ii.IsArray(t.parameters)&&t.parameters.every(e=>Pg(e))&&Pg(t.returns)}a(h1i,"IsFunction");function Axa(t){return Us(t,"Import")&&ii.HasPropertyKey(t,"$defs")&&ii.IsObject(t.$defs)&&_0t(t.$defs)&&ii.HasPropertyKey(t,"$ref")&&ii.IsString(t.$ref)&&t.$ref in t.$defs}a(Axa,"IsImport");function m1i(t){return Us(t,"Integer")&&t.type==="integer"&&al(t.$id)&&Gl(t.exclusiveMaximum)&&Gl(t.exclusiveMinimum)&&Gl(t.maximum)&&Gl(t.minimum)&&Gl(t.multipleOf)}a(m1i,"IsInteger");function _0t(t){return ii.IsObject(t)&&Object.entries(t).every(([e,r])=>OEr(e)&&Pg(r))}a(_0t,"IsProperties");function g1i(t){return Us(t,"Intersect")&&!(ii.IsString(t.type)&&t.type!=="object")&&ii.IsArray(t.allOf)&&t.allOf.every(e=>Pg(e)&&!B1i(e))&&al(t.type)&&(BEr(t.unevaluatedProperties)||i1i(t.unevaluatedProperties))&&al(t.$id)}a(g1i,"IsIntersect");function A1i(t){return Us(t,"Iterator")&&t.type==="Iterator"&&al(t.$id)&&Pg(t.items)}a(A1i,"IsIterator");function Us(t,e){return ii.IsObject(t)&&o4.Kind in t&&t[o4.Kind]===e}a(Us,"IsKindOf");function y1i(t){return QMe(t)&&ii.IsString(t.const)}a(y1i,"IsLiteralString");function E1i(t){return QMe(t)&&ii.IsNumber(t.const)}a(E1i,"IsLiteralNumber");function yxa(t){return QMe(t)&&ii.IsBoolean(t.const)}a(yxa,"IsLiteralBoolean");function QMe(t){return Us(t,"Literal")&&al(t.$id)&&_1i(t.const)}a(QMe,"IsLiteral");function _1i(t){return ii.IsBoolean(t)||ii.IsNumber(t)||ii.IsString(t)}a(_1i,"IsLiteralValue");function v1i(t){return Us(t,"MappedKey")&&ii.IsArray(t.keys)&&t.keys.every(e=>ii.IsNumber(e)||ii.IsString(e))}a(v1i,"IsMappedKey");function C1i(t){return Us(t,"MappedResult")&&_0t(t.properties)}a(C1i,"IsMappedResult");function b1i(t){return Us(t,"Never")&&ii.IsObject(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(b1i,"IsNever");function S1i(t){return Us(t,"Not")&&Pg(t.not)}a(S1i,"IsNot");function T1i(t){return Us(t,"Null")&&t.type==="null"&&al(t.$id)}a(T1i,"IsNull");function I1i(t){return Us(t,"Number")&&t.type==="number"&&al(t.$id)&&Gl(t.exclusiveMaximum)&&Gl(t.exclusiveMinimum)&&Gl(t.maximum)&&Gl(t.minimum)&&Gl(t.multipleOf)}a(I1i,"IsNumber");function x1i(t){return Us(t,"Object")&&t.type==="object"&&al(t.$id)&&_0t(t.properties)&&n1i(t.additionalProperties)&&Gl(t.minProperties)&&Gl(t.maxProperties)}a(x1i,"IsObject");function w1i(t){return Us(t,"Promise")&&t.type==="Promise"&&al(t.$id)&&Pg(t.item)}a(w1i,"IsPromise");function R1i(t){return Us(t,"Record")&&t.type==="object"&&al(t.$id)&&n1i(t.additionalProperties)&&ii.IsObject(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&r1i(r[0])&&ii.IsObject(e.patternProperties)&&Pg(e.patternProperties[r[0]])})(t)}a(R1i,"IsRecord");function Exa(t){return ii.IsObject(t)&&o4.Hint in t&&t[o4.Hint]==="Recursive"}a(Exa,"IsRecursive");function P1i(t){return Us(t,"Ref")&&al(t.$id)&&ii.IsString(t.$ref)}a(P1i,"IsRef");function k1i(t){return Us(t,"RegExp")&&al(t.$id)&&ii.IsString(t.source)&&ii.IsString(t.flags)&&Gl(t.maxLength)&&Gl(t.minLength)}a(k1i,"IsRegExp");function D1i(t){return Us(t,"String")&&t.type==="string"&&al(t.$id)&&Gl(t.minLength)&&Gl(t.maxLength)&&pxa(t.pattern)&&hxa(t.format)}a(D1i,"IsString");function N1i(t){return Us(t,"Symbol")&&t.type==="symbol"&&al(t.$id)}a(N1i,"IsSymbol");function M1i(t){return Us(t,"TemplateLiteral")&&t.type==="string"&&ii.IsString(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(M1i,"IsTemplateLiteral");function O1i(t){return Us(t,"This")&&al(t.$id)&&ii.IsString(t.$ref)}a(O1i,"IsThis");function B1i(t){return ii.IsObject(t)&&o4.TransformKind in t}a(B1i,"IsTransform");function L1i(t){return Us(t,"Tuple")&&t.type==="array"&&al(t.$id)&&ii.IsNumber(t.minItems)&&ii.IsNumber(t.maxItems)&&t.minItems===t.maxItems&&(ii.IsUndefined(t.items)&&ii.IsUndefined(t.additionalItems)&&t.minItems===0||ii.IsArray(t.items)&&t.items.every(e=>Pg(e)))}a(L1i,"IsTuple");function F1i(t){return Us(t,"Undefined")&&t.type==="undefined"&&al(t.$id)}a(F1i,"IsUndefined");function _xa(t){return LEr(t)&&t.anyOf.every(e=>y1i(e)||E1i(e))}a(_xa,"IsUnionLiteral");function LEr(t){return Us(t,"Union")&&al(t.$id)&&ii.IsObject(t)&&ii.IsArray(t.anyOf)&&t.anyOf.every(e=>Pg(e))}a(LEr,"IsUnion");function U1i(t){return Us(t,"Uint8Array")&&t.type==="Uint8Array"&&al(t.$id)&&Gl(t.minByteLength)&&Gl(t.maxByteLength)}a(U1i,"IsUint8Array");function Q1i(t){return Us(t,"Unknown")&&al(t.$id)}a(Q1i,"IsUnknown");function q1i(t){return Us(t,"Unsafe")}a(q1i,"IsUnsafe");function j1i(t){return Us(t,"Void")&&t.type==="void"&&al(t.$id)}a(j1i,"IsVoid");function H1i(t){return ii.IsObject(t)&&o4.Kind in t&&ii.IsString(t[o4.Kind])&&!fxa.includes(t[o4.Kind])}a(H1i,"IsKind");function Pg(t){return ii.IsObject(t)&&(o1i(t)||s1i(t)||a1i(t)||u1i(t)||l1i(t)||c1i(t)||d1i(t)||f1i(t)||p1i(t)||h1i(t)||m1i(t)||g1i(t)||A1i(t)||QMe(t)||v1i(t)||C1i(t)||b1i(t)||S1i(t)||T1i(t)||I1i(t)||x1i(t)||w1i(t)||R1i(t)||P1i(t)||k1i(t)||D1i(t)||N1i(t)||M1i(t)||O1i(t)||L1i(t)||F1i(t)||LEr(t)||U1i(t)||Q1i(t)||q1i(t)||j1i(t)||H1i(t))}a(Pg,"IsSchema")});var UEr=I(Db=>{"use strict";p();var vxa=Db&&Db.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Cxa=Db&&Db.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FEr=Db&&Db.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(QEr,"__esModule",{value:!0});QEr.Increment=bxa;function bxa(t){return(parseInt(t)+1).toString()}a(bxa,"Increment")});var V1i=I(Tee=>{"use strict";p();var Sxa=Tee&&Tee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Txa=Tee&&Tee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sxa(e,t,r)};Object.defineProperty(Tee,"__esModule",{value:!0});Txa($1i(),Tee)});var W1i=I(yp=>{"use strict";p();Object.defineProperty(yp,"__esModule",{value:!0});yp.PatternNeverExact=yp.PatternStringExact=yp.PatternNumberExact=yp.PatternBooleanExact=yp.PatternNever=yp.PatternString=yp.PatternNumber=yp.PatternBoolean=void 0;yp.PatternBoolean="(true|false)";yp.PatternNumber="(0|[1-9][0-9]*)";yp.PatternString="(.*)";yp.PatternNever="(?!.*)";yp.PatternBooleanExact=`^${yp.PatternBoolean}$`;yp.PatternNumberExact=`^${yp.PatternNumber}$`;yp.PatternStringExact=`^${yp.PatternString}$`;yp.PatternNeverExact=`^${yp.PatternNever}$`});var qMe=I(Iee=>{"use strict";p();var Ixa=Iee&&Iee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xxa=Iee&&Iee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Ixa(e,t,r)};Object.defineProperty(Iee,"__esModule",{value:!0});xxa(W1i(),Iee)});var z1i=I(zH=>{"use strict";p();Object.defineProperty(zH,"__esModule",{value:!0});zH.Entries=wxa;zH.Clear=Rxa;zH.Delete=Pxa;zH.Has=kxa;zH.Set=Dxa;zH.Get=Nxa;var ame=new Map;function wxa(){return new Map(ame)}a(wxa,"Entries");function Rxa(){return ame.clear()}a(Rxa,"Clear");function Pxa(t){return ame.delete(t)}a(Pxa,"Delete");function kxa(t){return ame.has(t)}a(kxa,"Has");function Dxa(t,e){ame.set(t,e)}a(Dxa,"Set");function Nxa(t){return ame.get(t)}a(Nxa,"Get")});var Y1i=I(YH=>{"use strict";p();Object.defineProperty(YH,"__esModule",{value:!0});YH.Entries=Mxa;YH.Clear=Oxa;YH.Delete=Bxa;YH.Has=Lxa;YH.Set=Fxa;YH.Get=Uxa;var cme=new Map;function Mxa(){return new Map(cme)}a(Mxa,"Entries");function Oxa(){return cme.clear()}a(Oxa,"Clear");function Bxa(t){return cme.delete(t)}a(Bxa,"Delete");function Lxa(t){return cme.has(t)}a(Lxa,"Has");function Fxa(t,e){cme.set(t,e)}a(Fxa,"Set");function Uxa(t){return cme.get(t)}a(Uxa,"Get")});var lme=I(nR=>{"use strict";p();var Qxa=nR&&nR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qxa=nR&&nR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),K1i=nR&&nR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(s4,"__esModule",{value:!0});s4.SetIncludes=J1i;s4.SetIsSubset=jxa;s4.SetDistinct=Hxa;s4.SetIntersect=Z1i;s4.SetUnion=Gxa;s4.SetComplement=$xa;s4.SetIntersectMany=Wxa;s4.SetUnionMany=zxa;function J1i(t,e){return t.includes(e)}a(J1i,"SetIncludes");function jxa(t,e){return t.every(r=>J1i(e,r))}a(jxa,"SetIsSubset");function Hxa(t){return[...new Set(t)]}a(Hxa,"SetDistinct");function Z1i(t,e){return t.filter(r=>e.includes(r))}a(Z1i,"SetIntersect");function Gxa(t,e){return[...t,...e]}a(Gxa,"SetUnion");function $xa(t,e){return t.filter(r=>!e.includes(r))}a($xa,"SetComplement");function Vxa(t,e){return t.reduce((r,n)=>Z1i(r,n),e)}a(Vxa,"SetIntersectManyResolve");function Wxa(t){return t.length===1?t[0]:t.length>1?Vxa(t.slice(1),t[0]):[]}a(Wxa,"SetIntersectMany");function zxa(t){let e=[];for(let r of t)e.push(...r);return e}a(zxa,"SetUnionMany")});var jMe=I(xee=>{"use strict";p();var Yxa=xee&&xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kxa=xee&&xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yxa(e,t,r)};Object.defineProperty(xee,"__esModule",{value:!0});Kxa(X1i(),xee)});var eSi=I(qEr=>{"use strict";p();Object.defineProperty(qEr,"__esModule",{value:!0});qEr.Any=Xxa;var Jxa=h8(),Zxa=_n();function Xxa(t){return(0,Jxa.CreateType)({[Zxa.Kind]:"Any"},t)}a(Xxa,"Any")});var ume=I(wee=>{"use strict";p();var ewa=wee&&wee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),twa=wee&&wee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ewa(e,t,r)};Object.defineProperty(wee,"__esModule",{value:!0});twa(eSi(),wee)});var tSi=I(jEr=>{"use strict";p();Object.defineProperty(jEr,"__esModule",{value:!0});jEr.Array=iwa;var rwa=Si(),nwa=_n();function iwa(t,e){return(0,rwa.CreateType)({[nwa.Kind]:"Array",type:"array",items:t},e)}a(iwa,"Array")});var dme=I(Ree=>{"use strict";p();var owa=Ree&&Ree.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),swa=Ree&&Ree.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&owa(e,t,r)};Object.defineProperty(Ree,"__esModule",{value:!0});swa(tSi(),Ree)});var rSi=I(HEr=>{"use strict";p();Object.defineProperty(HEr,"__esModule",{value:!0});HEr.Argument=lwa;var awa=Si(),cwa=_n();function lwa(t){return(0,awa.CreateType)({[cwa.Kind]:"Argument",index:t})}a(lwa,"Argument")});var v0t=I(Pee=>{"use strict";p();var uwa=Pee&&Pee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dwa=Pee&&Pee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uwa(e,t,r)};Object.defineProperty(Pee,"__esModule",{value:!0});dwa(rSi(),Pee)});var nSi=I(GEr=>{"use strict";p();Object.defineProperty(GEr,"__esModule",{value:!0});GEr.AsyncIterator=hwa;var fwa=_n(),pwa=Si();function hwa(t,e){return(0,pwa.CreateType)({[fwa.Kind]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(hwa,"AsyncIterator")});var fme=I(kee=>{"use strict";p();var mwa=kee&&kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gwa=kee&&kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mwa(e,t,r)};Object.defineProperty(kee,"__esModule",{value:!0});gwa(nSi(),kee)});var iSi=I($Er=>{"use strict";p();Object.defineProperty($Er,"__esModule",{value:!0});$Er.Computed=Ewa;var Awa=h8(),ywa=LMe();function Ewa(t,e,r){return(0,Awa.CreateType)({[ywa.Kind]:"Computed",target:t,parameters:e},r)}a(Ewa,"Computed")});var KH=I(Dee=>{"use strict";p();var _wa=Dee&&Dee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vwa=Dee&&Dee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_wa(e,t,r)};Object.defineProperty(Dee,"__esModule",{value:!0});vwa(iSi(),Dee)});var C0t=I(VEr=>{"use strict";p();Object.defineProperty(VEr,"__esModule",{value:!0});VEr.Discard=bwa;function Cwa(t,e){let{[e]:r,...n}=t;return n}a(Cwa,"DiscardKey");function bwa(t,e){return e.reduce((r,n)=>Cwa(r,n),t)}a(bwa,"Discard")});var g8=I(Nee=>{"use strict";p();var Swa=Nee&&Nee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Twa=Nee&&Nee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Swa(e,t,r)};Object.defineProperty(Nee,"__esModule",{value:!0});Twa(C0t(),Nee)});var oSi=I(WEr=>{"use strict";p();Object.defineProperty(WEr,"__esModule",{value:!0});WEr.Never=wwa;var Iwa=Si(),xwa=_n();function wwa(t){return(0,Iwa.CreateType)({[xwa.Kind]:"Never",not:{}},t)}a(wwa,"Never")});var f0=I(Mee=>{"use strict";p();var Rwa=Mee&&Mee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pwa=Mee&&Mee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rwa(e,t,r)};Object.defineProperty(Mee,"__esModule",{value:!0});Pwa(oSi(),Mee)});var sSi=I(zEr=>{"use strict";p();Object.defineProperty(zEr,"__esModule",{value:!0});zEr.MappedKey=Nwa;var kwa=Si(),Dwa=_n();function Nwa(t){return(0,kwa.CreateType)({[Dwa.Kind]:"MappedKey",keys:t})}a(Nwa,"MappedKey")});var KEr=I(YEr=>{"use strict";p();Object.defineProperty(YEr,"__esModule",{value:!0});YEr.MappedResult=Bwa;var Mwa=Si(),Owa=_n();function Bwa(t){return(0,Mwa.CreateType)({[Owa.Kind]:"MappedResult",properties:t})}a(Bwa,"MappedResult")});var aSi=I(JEr=>{"use strict";p();Object.defineProperty(JEr,"__esModule",{value:!0});JEr.Constructor=Uwa;var Lwa=Si(),Fwa=_n();function Uwa(t,e,r){return(0,Lwa.CreateType)({[Fwa.Kind]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(Uwa,"Constructor")});var pme=I(Oee=>{"use strict";p();var Qwa=Oee&&Oee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qwa=Oee&&Oee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qwa(e,t,r)};Object.defineProperty(Oee,"__esModule",{value:!0});qwa(aSi(),Oee)});var cSi=I(ZEr=>{"use strict";p();Object.defineProperty(ZEr,"__esModule",{value:!0});ZEr.Function=Gwa;var jwa=Si(),Hwa=_n();function Gwa(t,e,r){return(0,jwa.CreateType)({[Hwa.Kind]:"Function",type:"Function",parameters:t,returns:e},r)}a(Gwa,"Function")});var JH=I(Bee=>{"use strict";p();var $wa=Bee&&Bee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vwa=Bee&&Bee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$wa(e,t,r)};Object.defineProperty(Bee,"__esModule",{value:!0});Vwa(cSi(),Bee)});var e_r=I(XEr=>{"use strict";p();Object.defineProperty(XEr,"__esModule",{value:!0});XEr.UnionCreate=Ywa;var Wwa=Si(),zwa=_n();function Ywa(t,e){return(0,Wwa.CreateType)({[zwa.Kind]:"Union",anyOf:t},e)}a(Ywa,"UnionCreate")});var fSi=I(t_r=>{"use strict";p();Object.defineProperty(t_r,"__esModule",{value:!0});t_r.UnionEvaluated=iRa;var Kwa=Si(),Jwa=_n(),Zwa=g8(),Xwa=f0(),eRa=a4(),lSi=e_r(),dSi=ms();function tRa(t){return t.some(e=>(0,dSi.IsOptional)(e))}a(tRa,"IsUnionOptional");function uSi(t){return t.map(e=>(0,dSi.IsOptional)(e)?rRa(e):e)}a(uSi,"RemoveOptionalFromRest");function rRa(t){return(0,Zwa.Discard)(t,[Jwa.OptionalKind])}a(rRa,"RemoveOptionalFromType");function nRa(t,e){return tRa(t)?(0,eRa.Optional)((0,lSi.UnionCreate)(uSi(t),e)):(0,lSi.UnionCreate)(uSi(t),e)}a(nRa,"ResolveUnion");function iRa(t,e){return t.length===1?(0,Kwa.CreateType)(t[0],e):t.length===0?(0,Xwa.Never)(e):nRa(t,e)}a(iRa,"UnionEvaluated")});var hSi=I(pSi=>{"use strict";p();Object.defineProperty(pSi,"__esModule",{value:!0});var ipp=_n()});var mSi=I(r_r=>{"use strict";p();Object.defineProperty(r_r,"__esModule",{value:!0});r_r.Union=cRa;var oRa=f0(),sRa=Si(),aRa=e_r();function cRa(t,e){return t.length===0?(0,oRa.Never)(e):t.length===1?(0,sRa.CreateType)(t[0],e):(0,aRa.UnionCreate)(t,e)}a(cRa,"Union")});var Ep=I(A8=>{"use strict";p();var lRa=A8&&A8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n_r=A8&&A8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lRa(e,t,r)};Object.defineProperty(A8,"__esModule",{value:!0});n_r(fSi(),A8);n_r(hSi(),A8);n_r(mSi(),A8)});var b0t=I(hme=>{"use strict";p();Object.defineProperty(hme,"__esModule",{value:!0});hme.TemplateLiteralParserError=void 0;hme.TemplateLiteralParse=Lee;hme.TemplateLiteralParseExact=yRa;var uRa=Sf(),HMe=class extends uRa.TypeBoxError{static{a(this,"TemplateLiteralParserError")}};hme.TemplateLiteralParserError=HMe;function dRa(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(dRa,"Unescape");function i_r(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(i_r,"IsNonEscaped");function y8(t,e){return i_r(t,e,"(")}a(y8,"IsOpenParen");function GMe(t,e){return i_r(t,e,")")}a(GMe,"IsCloseParen");function gSi(t,e){return i_r(t,e,"|")}a(gSi,"IsSeparator");function fRa(t){if(!(y8(t,0)&&GMe(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(Lee(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(Lee(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(gRa,"Or");function ARa(t){function e(o,s){if(!y8(o,s))throw new HMe("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(Lee(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(ARa,"And");function Lee(t){return fRa(t)?Lee(pRa(t)):hRa(t)?gRa(t):mRa(t)?ARa(t):{type:"const",const:dRa(t)}}a(Lee,"TemplateLiteralParse");function yRa(t){return Lee(t.slice(1,t.length-1))}a(yRa,"TemplateLiteralParseExact")});var o_r=I(mme=>{"use strict";p();Object.defineProperty(mme,"__esModule",{value:!0});mme.TemplateLiteralFiniteError=void 0;mme.IsTemplateLiteralExpressionFinite=T0t;mme.IsTemplateLiteralFinite=SRa;var ERa=b0t(),_Ra=Sf(),S0t=class extends _Ra.TypeBoxError{static{a(this,"TemplateLiteralFiniteError")}};mme.TemplateLiteralFiniteError=S0t;function vRa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(vRa,"IsNumberExpression");function CRa(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(CRa,"IsBooleanExpression");function bRa(t){return t.type==="const"&&t.const===".*"}a(bRa,"IsStringExpression");function T0t(t){return vRa(t)||bRa(t)?!1:CRa(t)?!0:t.type==="and"?t.expr.every(e=>T0t(e)):t.type==="or"?t.expr.every(e=>T0t(e)):t.type==="const"?!0:(()=>{throw new S0t("Unknown expression type")})()}a(T0t,"IsTemplateLiteralExpressionFinite");function SRa(t){let e=(0,ERa.TemplateLiteralParseExact)(t.pattern);return T0t(e)}a(SRa,"IsTemplateLiteralFinite")});var s_r=I(gme=>{"use strict";p();Object.defineProperty(gme,"__esModule",{value:!0});gme.TemplateLiteralGenerateError=void 0;gme.TemplateLiteralExpressionGenerate=x0t;gme.TemplateLiteralGenerate=kRa;var TRa=o_r(),IRa=b0t(),xRa=Sf(),I0t=class extends xRa.TypeBoxError{static{a(this,"TemplateLiteralGenerateError")}};gme.TemplateLiteralGenerateError=I0t;function*ASi(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of ASi(t.slice(1)))yield`${e}${r}`}a(ASi,"GenerateReduce");function*wRa(t){return yield*ASi(t.expr.map(e=>[...x0t(e)]))}a(wRa,"GenerateAnd");function*RRa(t){for(let e of t.expr)yield*x0t(e)}a(RRa,"GenerateOr");function*PRa(t){return yield t.const}a(PRa,"GenerateConst");function*x0t(t){return t.type==="and"?yield*wRa(t):t.type==="or"?yield*RRa(t):t.type==="const"?yield*PRa(t):(()=>{throw new I0t("Unknown expression")})()}a(x0t,"TemplateLiteralExpressionGenerate");function kRa(t){let e=(0,IRa.TemplateLiteralParseExact)(t.pattern);return(0,TRa.IsTemplateLiteralExpressionFinite)(e)?[...x0t(e)]:[]}a(kRa,"TemplateLiteralGenerate")});var ySi=I(a_r=>{"use strict";p();Object.defineProperty(a_r,"__esModule",{value:!0});a_r.Literal=MRa;var DRa=Si(),NRa=_n();function MRa(t,e){return(0,DRa.CreateType)({[NRa.Kind]:"Literal",const:t,type:typeof t},e)}a(MRa,"Literal")});var bE=I(Fee=>{"use strict";p();var ORa=Fee&&Fee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),BRa=Fee&&Fee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ORa(e,t,r)};Object.defineProperty(Fee,"__esModule",{value:!0});BRa(ySi(),Fee)});var ESi=I(c_r=>{"use strict";p();Object.defineProperty(c_r,"__esModule",{value:!0});c_r.Boolean=URa;var LRa=_n(),FRa=h8();function URa(t){return(0,FRa.CreateType)({[LRa.Kind]:"Boolean",type:"boolean"},t)}a(URa,"Boolean")});var $Me=I(Uee=>{"use strict";p();var QRa=Uee&&Uee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qRa=Uee&&Uee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QRa(e,t,r)};Object.defineProperty(Uee,"__esModule",{value:!0});qRa(ESi(),Uee)});var _Si=I(l_r=>{"use strict";p();Object.defineProperty(l_r,"__esModule",{value:!0});l_r.BigInt=GRa;var jRa=_n(),HRa=h8();function GRa(t){return(0,HRa.CreateType)({[jRa.Kind]:"BigInt",type:"bigint"},t)}a(GRa,"BigInt")});var Ame=I(Qee=>{"use strict";p();var $Ra=Qee&&Qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),VRa=Qee&&Qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$Ra(e,t,r)};Object.defineProperty(Qee,"__esModule",{value:!0});VRa(_Si(),Qee)});var vSi=I(u_r=>{"use strict";p();Object.defineProperty(u_r,"__esModule",{value:!0});u_r.Number=YRa;var WRa=Si(),zRa=_n();function YRa(t){return(0,WRa.CreateType)({[zRa.Kind]:"Number",type:"number"},t)}a(YRa,"Number")});var ZH=I(qee=>{"use strict";p();var KRa=qee&&qee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),JRa=qee&&qee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&KRa(e,t,r)};Object.defineProperty(qee,"__esModule",{value:!0});JRa(vSi(),qee)});var CSi=I(d_r=>{"use strict";p();Object.defineProperty(d_r,"__esModule",{value:!0});d_r.String=ePa;var ZRa=Si(),XRa=_n();function ePa(t){return(0,ZRa.CreateType)({[XRa.Kind]:"String",type:"string"},t)}a(ePa,"String")});var XH=I(jee=>{"use strict";p();var tPa=jee&&jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rPa=jee&&jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tPa(e,t,r)};Object.defineProperty(jee,"__esModule",{value:!0});rPa(CSi(),jee)});var h_r=I(p_r=>{"use strict";p();Object.defineProperty(p_r,"__esModule",{value:!0});p_r.TemplateLiteralSyntax=dPa;var VMe=bE(),nPa=$Me(),iPa=Ame(),oPa=ZH(),sPa=XH(),aPa=Ep(),cPa=f0();function*lPa(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield(0,nPa.Boolean)():e==="number"?yield(0,oPa.Number)():e==="bigint"?yield(0,iPa.BigInt)():e==="string"?yield(0,sPa.String)():yield(()=>{let r=e.split("|").map(n=>(0,VMe.Literal)(n.trim()));return r.length===0?(0,cPa.Never)():r.length===1?r[0]:(0,aPa.UnionEvaluated)(r)})()}a(lPa,"FromUnion");function*uPa(t){if(t[1]!=="{"){let e=(0,VMe.Literal)("$"),r=f_r(t.slice(1));return yield*[e,...r]}for(let e=2;e{"use strict";p();Object.defineProperty(zMe,"__esModule",{value:!0});zMe.TemplateLiteralPatternError=void 0;zMe.TemplateLiteralPattern=mPa;var WMe=qMe(),fPa=_n(),pPa=Sf(),eG=ms(),w0t=class extends pPa.TypeBoxError{static{a(this,"TemplateLiteralPatternError")}};zMe.TemplateLiteralPatternError=w0t;function hPa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(hPa,"Escape");function bSi(t,e){return(0,eG.IsTemplateLiteral)(t)?t.pattern.slice(1,t.pattern.length-1):(0,eG.IsUnion)(t)?`(${t.anyOf.map(r=>bSi(r,e)).join("|")})`:(0,eG.IsNumber)(t)?`${e}${WMe.PatternNumber}`:(0,eG.IsInteger)(t)?`${e}${WMe.PatternNumber}`:(0,eG.IsBigInt)(t)?`${e}${WMe.PatternNumber}`:(0,eG.IsString)(t)?`${e}${WMe.PatternString}`:(0,eG.IsLiteral)(t)?`${e}${hPa(t.const.toString())}`:(0,eG.IsBoolean)(t)?`${e}${WMe.PatternBoolean}`:(()=>{throw new w0t(`Unexpected Kind '${t[fPa.Kind]}'`)})()}a(bSi,"Visit");function mPa(t){return`^${t.map(e=>bSi(e,"")).join("")}$`}a(mPa,"TemplateLiteralPattern")});var SSi=I(g_r=>{"use strict";p();Object.defineProperty(g_r,"__esModule",{value:!0});g_r.TemplateLiteralToUnion=EPa;var gPa=Ep(),APa=bE(),yPa=s_r();function EPa(t){let r=(0,yPa.TemplateLiteralGenerate)(t).map(n=>(0,APa.Literal)(n));return(0,gPa.UnionEvaluated)(r)}a(EPa,"TemplateLiteralToUnion")});var ISi=I(A_r=>{"use strict";p();Object.defineProperty(A_r,"__esModule",{value:!0});A_r.TemplateLiteral=SPa;var _Pa=Si(),vPa=h_r(),TSi=m_r(),CPa=av(),bPa=_n();function SPa(t,e){let r=(0,CPa.IsString)(t)?(0,TSi.TemplateLiteralPattern)((0,vPa.TemplateLiteralSyntax)(t)):(0,TSi.TemplateLiteralPattern)(t);return(0,_Pa.CreateType)({[bPa.Kind]:"TemplateLiteral",type:"string",pattern:r},e)}a(SPa,"TemplateLiteral")});var L2=I(wT=>{"use strict";p();var TPa=wT&&wT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Hee=wT&&wT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TPa(e,t,r)};Object.defineProperty(wT,"__esModule",{value:!0});Hee(o_r(),wT);Hee(s_r(),wT);Hee(h_r(),wT);Hee(b0t(),wT);Hee(m_r(),wT);Hee(SSi(),wT);Hee(ISi(),wT)});var R0t=I(y_r=>{"use strict";p();Object.defineProperty(y_r,"__esModule",{value:!0});y_r.IndexPropertyKeys=xSi;var IPa=L2(),YMe=ms();function xPa(t){return(0,IPa.TemplateLiteralGenerate)(t).map(r=>r.toString())}a(xPa,"FromTemplateLiteral");function wPa(t){let e=[];for(let r of t)e.push(...xSi(r));return e}a(wPa,"FromUnion");function RPa(t){return[t.toString()]}a(RPa,"FromLiteral");function xSi(t){return[...new Set((0,YMe.IsTemplateLiteral)(t)?xPa(t):(0,YMe.IsUnion)(t)?wPa(t.anyOf):(0,YMe.IsLiteral)(t)?RPa(t.const):(0,YMe.IsNumber)(t)?["[number]"]:(0,YMe.IsInteger)(t)?["[number]"]:[])]}a(xSi,"IndexPropertyKeys")});var __r=I(E_r=>{"use strict";p();Object.defineProperty(E_r,"__esModule",{value:!0});E_r.IndexFromMappedResult=OPa;var PPa=p0(),kPa=R0t(),DPa=F2();function NPa(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=(0,DPa.Index)(t,(0,kPa.IndexPropertyKeys)(e[o]),r);return n}a(NPa,"FromProperties");function MPa(t,e,r){return NPa(t,e.properties,r)}a(MPa,"FromMappedResult");function OPa(t,e,r){let n=MPa(t,e,r);return(0,PPa.MappedResult)(n)}a(OPa,"IndexFromMappedResult")});var k0t=I(yme=>{"use strict";p();Object.defineProperty(yme,"__esModule",{value:!0});yme.IndexFromPropertyKey=C_r;yme.IndexFromPropertyKeys=kSi;yme.IndexFromComputed=YPa;yme.Index=KPa;var BPa=Si(),LPa=Sf(),RSi=KH(),P0t=f0(),FPa=RT(),v_r=Ep(),UPa=R0t(),QPa=b_r(),qPa=__r(),Nb=ms();function PSi(t,e){return t.map(r=>C_r(r,e))}a(PSi,"FromRest");function jPa(t){return t.filter(e=>!(0,Nb.IsNever)(e))}a(jPa,"FromIntersectRest");function HPa(t,e){return(0,FPa.IntersectEvaluated)(jPa(PSi(t,e)))}a(HPa,"FromIntersect");function GPa(t){return t.some(e=>(0,Nb.IsNever)(e))?[]:t}a(GPa,"FromUnionRest");function $Pa(t,e){return(0,v_r.UnionEvaluated)(GPa(PSi(t,e)))}a($Pa,"FromUnion");function VPa(t,e){return e in t?t[e]:e==="[number]"?(0,v_r.UnionEvaluated)(t):(0,P0t.Never)()}a(VPa,"FromTuple");function WPa(t,e){return e==="[number]"?t:(0,P0t.Never)()}a(WPa,"FromArray");function zPa(t,e){return e in t?t[e]:(0,P0t.Never)()}a(zPa,"FromProperty");function C_r(t,e){return(0,Nb.IsIntersect)(t)?HPa(t.allOf,e):(0,Nb.IsUnion)(t)?$Pa(t.anyOf,e):(0,Nb.IsTuple)(t)?VPa(t.items??[],e):(0,Nb.IsArray)(t)?WPa(t.items,e):(0,Nb.IsObject)(t)?zPa(t.properties,e):(0,P0t.Never)()}a(C_r,"IndexFromPropertyKey");function kSi(t,e){return e.map(r=>C_r(t,r))}a(kSi,"IndexFromPropertyKeys");function wSi(t,e){return(0,v_r.UnionEvaluated)(kSi(t,e))}a(wSi,"FromSchema");function YPa(t,e){return(0,RSi.Computed)("Index",[t,e])}a(YPa,"IndexFromComputed");function KPa(t,e,r){if((0,Nb.IsRef)(t)||(0,Nb.IsRef)(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!(0,Nb.IsSchema)(t)||!(0,Nb.IsSchema)(e))throw new LPa.TypeBoxError(n);return(0,RSi.Computed)("Index",[t,e])}return(0,Nb.IsMappedResult)(e)?(0,qPa.IndexFromMappedResult)(t,e,r):(0,Nb.IsMappedKey)(e)?(0,QPa.IndexFromMappedKey)(t,e,r):(0,BPa.CreateType)((0,Nb.IsSchema)(e)?wSi(t,(0,UPa.IndexPropertyKeys)(e)):wSi(t,e),r)}a(KPa,"Index")});var b_r=I(S_r=>{"use strict";p();Object.defineProperty(S_r,"__esModule",{value:!0});S_r.IndexFromMappedKey=nka;var JPa=k0t(),ZPa=p0(),XPa=Pb();function eka(t,e,r){return{[e]:(0,JPa.Index)(t,[e],(0,XPa.Clone)(r))}}a(eka,"MappedIndexPropertyKey");function tka(t,e,r){return e.reduce((n,o)=>({...n,...eka(t,o,r)}),{})}a(tka,"MappedIndexPropertyKeys");function rka(t,e,r){return tka(t,e.keys,r)}a(rka,"MappedIndexProperties");function nka(t,e,r){let n=rka(t,e,r);return(0,ZPa.MappedResult)(n)}a(nka,"IndexFromMappedKey")});var F2=I(c4=>{"use strict";p();var ika=c4&&c4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),D0t=c4&&c4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ika(e,t,r)};Object.defineProperty(c4,"__esModule",{value:!0});D0t(b_r(),c4);D0t(__r(),c4);D0t(R0t(),c4);D0t(k0t(),c4)});var DSi=I(T_r=>{"use strict";p();Object.defineProperty(T_r,"__esModule",{value:!0});T_r.Iterator=aka;var oka=Si(),ska=_n();function aka(t,e){return(0,oka.CreateType)({[ska.Kind]:"Iterator",type:"Iterator",items:t},e)}a(aka,"Iterator")});var Eme=I(Gee=>{"use strict";p();var cka=Gee&&Gee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lka=Gee&&Gee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cka(e,t,r)};Object.defineProperty(Gee,"__esModule",{value:!0});lka(DSi(),Gee)});var MSi=I(N0t=>{"use strict";p();Object.defineProperty(N0t,"__esModule",{value:!0});N0t.Object=void 0;var uka=Si(),NSi=_n(),dka=ms();function fka(t){return globalThis.Object.keys(t).filter(e=>!(0,dka.IsOptional)(t[e]))}a(fka,"RequiredArray");function pka(t,e){let r=fka(t),n=r.length>0?{[NSi.Kind]:"Object",type:"object",required:r,properties:t}:{[NSi.Kind]:"Object",type:"object",properties:t};return(0,uka.CreateType)(n,e)}a(pka,"_Object");N0t.Object=pka});var cv=I($ee=>{"use strict";p();var hka=$ee&&$ee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),mka=$ee&&$ee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hka(e,t,r)};Object.defineProperty($ee,"__esModule",{value:!0});mka(MSi(),$ee)});var OSi=I(I_r=>{"use strict";p();Object.defineProperty(I_r,"__esModule",{value:!0});I_r.Promise=yka;var gka=Si(),Aka=_n();function yka(t,e){return(0,gka.CreateType)({[Aka.Kind]:"Promise",type:"Promise",item:t},e)}a(yka,"Promise")});var KMe=I(Vee=>{"use strict";p();var Eka=Vee&&Vee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_ka=Vee&&Vee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Eka(e,t,r)};Object.defineProperty(Vee,"__esModule",{value:!0});_ka(OSi(),Vee)});var w_r=I(x_r=>{"use strict";p();Object.defineProperty(x_r,"__esModule",{value:!0});x_r.Readonly=xka;var BSi=Si(),LSi=_n(),vka=g8(),Cka=R_r(),bka=ms();function Ska(t){return(0,BSi.CreateType)((0,vka.Discard)(t,[LSi.ReadonlyKind]))}a(Ska,"RemoveReadonly");function Tka(t){return(0,BSi.CreateType)({...t,[LSi.ReadonlyKind]:"Readonly"})}a(Tka,"AddReadonly");function Ika(t,e){return e===!1?Ska(t):Tka(t)}a(Ika,"ReadonlyWithFlag");function xka(t,e){let r=e??!0;return(0,bka.IsMappedResult)(t)?(0,Cka.ReadonlyFromMappedResult)(t,r):Ika(t,r)}a(xka,"Readonly")});var R_r=I(P_r=>{"use strict";p();Object.defineProperty(P_r,"__esModule",{value:!0});P_r.ReadonlyFromMappedResult=Dka;var wka=p0(),Rka=w_r();function Pka(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,Rka.Readonly)(t[n],e);return r}a(Pka,"FromProperties");function kka(t,e){return Pka(t.properties,e)}a(kka,"FromMappedResult");function Dka(t,e){let r=kka(t,e);return(0,wka.MappedResult)(r)}a(Dka,"ReadonlyFromMappedResult")});var rG=I(tG=>{"use strict";p();var Nka=tG&&tG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FSi=tG&&tG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nka(e,t,r)};Object.defineProperty(tG,"__esModule",{value:!0});FSi(R_r(),tG);FSi(w_r(),tG)});var QSi=I(k_r=>{"use strict";p();Object.defineProperty(k_r,"__esModule",{value:!0});k_r.Tuple=Oka;var Mka=Si(),USi=_n();function Oka(t,e){return(0,Mka.CreateType)(t.length>0?{[USi.Kind]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[USi.Kind]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(Oka,"Tuple")});var E8=I(Wee=>{"use strict";p();var Bka=Wee&&Wee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lka=Wee&&Wee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bka(e,t,r)};Object.defineProperty(Wee,"__esModule",{value:!0});Lka(QSi(),Wee)});var VSi=I(M0t=>{"use strict";p();Object.defineProperty(M0t,"__esModule",{value:!0});M0t.MappedFunctionReturnType=$Si;M0t.Mapped=n2a;var D_r=_n(),qSi=g8(),Fka=dme(),Uka=fme(),Qka=pme(),qka=JH(),jka=F2(),Hka=RT(),Gka=Eme(),jSi=bE(),HSi=cv(),$ka=a4(),Vka=KMe(),Wka=rG(),zka=E8(),Yka=Ep(),Kka=jMe(),Jka=KEr(),lv=ms();function GSi(t,e){return t in e?iR(t,e[t]):(0,Jka.MappedResult)(e)}a(GSi,"FromMappedResult");function Zka(t){return{[t]:(0,jSi.Literal)(t)}}a(Zka,"MappedKeyToKnownMappedResultProperties");function Xka(t){let e={};for(let r of t)e[r]=(0,jSi.Literal)(r);return e}a(Xka,"MappedKeyToUnknownMappedResultProperties");function e2a(t,e){return(0,Kka.SetIncludes)(e,t)?Zka(t):Xka(e)}a(e2a,"MappedKeyToMappedResultProperties");function t2a(t,e){let r=e2a(t,e);return GSi(t,r)}a(t2a,"FromMappedKey");function JMe(t,e){return e.map(r=>iR(t,r))}a(JMe,"FromRest");function r2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=iR(t,e[n]);return r}a(r2a,"FromProperties");function iR(t,e){let r={...e};return(0,lv.IsOptional)(e)?(0,$ka.Optional)(iR(t,(0,qSi.Discard)(e,[D_r.OptionalKind]))):(0,lv.IsReadonly)(e)?(0,Wka.Readonly)(iR(t,(0,qSi.Discard)(e,[D_r.ReadonlyKind]))):(0,lv.IsMappedResult)(e)?GSi(t,e.properties):(0,lv.IsMappedKey)(e)?t2a(t,e.keys):(0,lv.IsConstructor)(e)?(0,Qka.Constructor)(JMe(t,e.parameters),iR(t,e.returns),r):(0,lv.IsFunction)(e)?(0,qka.Function)(JMe(t,e.parameters),iR(t,e.returns),r):(0,lv.IsAsyncIterator)(e)?(0,Uka.AsyncIterator)(iR(t,e.items),r):(0,lv.IsIterator)(e)?(0,Gka.Iterator)(iR(t,e.items),r):(0,lv.IsIntersect)(e)?(0,Hka.Intersect)(JMe(t,e.allOf),r):(0,lv.IsUnion)(e)?(0,Yka.Union)(JMe(t,e.anyOf),r):(0,lv.IsTuple)(e)?(0,zka.Tuple)(JMe(t,e.items??[]),r):(0,lv.IsObject)(e)?(0,HSi.Object)(r2a(t,e.properties),r):(0,lv.IsArray)(e)?(0,Fka.Array)(iR(t,e.items),r):(0,lv.IsPromise)(e)?(0,Vka.Promise)(iR(t,e.item),r):e}a(iR,"FromSchemaType");function $Si(t,e){let r={};for(let n of t)r[n]=iR(n,e);return r}a($Si,"MappedFunctionReturnType");function n2a(t,e,r){let n=(0,lv.IsSchema)(t)?(0,jka.IndexPropertyKeys)(t):t,o=e({[D_r.Kind]:"MappedKey",keys:n}),s=$Si(n,o);return(0,HSi.Object)(s,r)}a(n2a,"Mapped")});var p0=I(_8=>{"use strict";p();var i2a=_8&&_8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N_r=_8&&_8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i2a(e,t,r)};Object.defineProperty(_8,"__esModule",{value:!0});N_r(sSi(),_8);N_r(KEr(),_8);N_r(VSi(),_8)});var O_r=I(M_r=>{"use strict";p();Object.defineProperty(M_r,"__esModule",{value:!0});M_r.Optional=d2a;var WSi=Si(),zSi=_n(),o2a=g8(),s2a=B_r(),a2a=ms();function c2a(t){return(0,WSi.CreateType)((0,o2a.Discard)(t,[zSi.OptionalKind]))}a(c2a,"RemoveOptional");function l2a(t){return(0,WSi.CreateType)({...t,[zSi.OptionalKind]:"Optional"})}a(l2a,"AddOptional");function u2a(t,e){return e===!1?c2a(t):l2a(t)}a(u2a,"OptionalWithFlag");function d2a(t,e){let r=e??!0;return(0,a2a.IsMappedResult)(t)?(0,s2a.OptionalFromMappedResult)(t,r):u2a(t,r)}a(d2a,"Optional")});var B_r=I(L_r=>{"use strict";p();Object.defineProperty(L_r,"__esModule",{value:!0});L_r.OptionalFromMappedResult=g2a;var f2a=p0(),p2a=O_r();function h2a(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,p2a.Optional)(t[n],e);return r}a(h2a,"FromProperties");function m2a(t,e){return h2a(t.properties,e)}a(m2a,"FromMappedResult");function g2a(t,e){let r=m2a(t,e);return(0,f2a.MappedResult)(r)}a(g2a,"OptionalFromMappedResult")});var a4=I(nG=>{"use strict";p();var A2a=nG&&nG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),YSi=nG&&nG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&A2a(e,t,r)};Object.defineProperty(nG,"__esModule",{value:!0});YSi(B_r(),nG);YSi(O_r(),nG)});var Q_r=I(U_r=>{"use strict";p();Object.defineProperty(U_r,"__esModule",{value:!0});U_r.IntersectCreate=E2a;var y2a=Si(),KSi=_n(),F_r=ms();function E2a(t,e={}){let r=t.every(o=>(0,F_r.IsObject)(o)),n=(0,F_r.IsSchema)(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return(0,y2a.CreateType)(e.unevaluatedProperties===!1||(0,F_r.IsSchema)(e.unevaluatedProperties)||r?{...n,[KSi.Kind]:"Intersect",type:"object",allOf:t}:{...n,[KSi.Kind]:"Intersect",allOf:t},e)}a(E2a,"IntersectCreate")});var XSi=I(j_r=>{"use strict";p();Object.defineProperty(j_r,"__esModule",{value:!0});j_r.IntersectEvaluated=w2a;var _2a=_n(),v2a=Si(),C2a=g8(),b2a=f0(),S2a=a4(),JSi=Q_r(),q_r=ms();function T2a(t){return t.every(e=>(0,q_r.IsOptional)(e))}a(T2a,"IsIntersectOptional");function I2a(t){return(0,C2a.Discard)(t,[_2a.OptionalKind])}a(I2a,"RemoveOptionalFromType");function ZSi(t){return t.map(e=>(0,q_r.IsOptional)(e)?I2a(e):e)}a(ZSi,"RemoveOptionalFromRest");function x2a(t,e){return T2a(t)?(0,S2a.Optional)((0,JSi.IntersectCreate)(ZSi(t),e)):(0,JSi.IntersectCreate)(ZSi(t),e)}a(x2a,"ResolveIntersect");function w2a(t,e={}){if(t.length===1)return(0,v2a.CreateType)(t[0],e);if(t.length===0)return(0,b2a.Never)(e);if(t.some(r=>(0,q_r.IsTransform)(r)))throw new Error("Cannot intersect transform types");return x2a(t,e)}a(w2a,"IntersectEvaluated")});var tTi=I(eTi=>{"use strict";p();Object.defineProperty(eTi,"__esModule",{value:!0});var w0p=_n()});var rTi=I(H_r=>{"use strict";p();Object.defineProperty(H_r,"__esModule",{value:!0});H_r.Intersect=N2a;var R2a=Si(),P2a=f0(),k2a=Q_r(),D2a=ms();function N2a(t,e){if(t.length===1)return(0,R2a.CreateType)(t[0],e);if(t.length===0)return(0,P2a.Never)(e);if(t.some(r=>(0,D2a.IsTransform)(r)))throw new Error("Cannot intersect transform types");return(0,k2a.IntersectCreate)(t,e)}a(N2a,"Intersect")});var RT=I(v8=>{"use strict";p();var M2a=v8&&v8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G_r=v8&&v8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&M2a(e,t,r)};Object.defineProperty(v8,"__esModule",{value:!0});G_r(XSi(),v8);G_r(tTi(),v8);G_r(rTi(),v8)});var nTi=I($_r=>{"use strict";p();Object.defineProperty($_r,"__esModule",{value:!0});$_r.Ref=F2a;var O2a=Sf(),B2a=Si(),L2a=_n();function F2a(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new O2a.TypeBoxError("Ref: $ref must be a string");return(0,B2a.CreateType)({[L2a.Kind]:"Ref",$ref:e},r)}a(F2a,"Ref")});var iG=I(zee=>{"use strict";p();var U2a=zee&&zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Q2a=zee&&zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U2a(e,t,r)};Object.defineProperty(zee,"__esModule",{value:!0});Q2a(nTi(),zee)});var oTi=I(z_r=>{"use strict";p();Object.defineProperty(z_r,"__esModule",{value:!0});z_r.Awaited=W_r;var q2a=Si(),V_r=KH(),j2a=RT(),H2a=Ep(),G2a=iG(),ZMe=ms();function $2a(t,e){return(0,V_r.Computed)("Awaited",[(0,V_r.Computed)(t,e)])}a($2a,"FromComputed");function V2a(t){return(0,V_r.Computed)("Awaited",[(0,G2a.Ref)(t)])}a(V2a,"FromRef");function W2a(t){return(0,j2a.Intersect)(iTi(t))}a(W2a,"FromIntersect");function z2a(t){return(0,H2a.Union)(iTi(t))}a(z2a,"FromUnion");function Y2a(t){return W_r(t)}a(Y2a,"FromPromise");function iTi(t){return t.map(e=>W_r(e))}a(iTi,"FromRest");function W_r(t,e){return(0,q2a.CreateType)((0,ZMe.IsComputed)(t)?$2a(t.target,t.parameters):(0,ZMe.IsIntersect)(t)?W2a(t.allOf):(0,ZMe.IsUnion)(t)?z2a(t.anyOf):(0,ZMe.IsPromise)(t)?Y2a(t.item):(0,ZMe.IsRef)(t)?V2a(t.$ref):t,e)}a(W_r,"Awaited")});var XMe=I(Yee=>{"use strict";p();var K2a=Yee&&Yee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J2a=Yee&&Yee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K2a(e,t,r)};Object.defineProperty(Yee,"__esModule",{value:!0});J2a(oTi(),Yee)});var B0t=I(O0t=>{"use strict";p();Object.defineProperty(O0t,"__esModule",{value:!0});O0t.KeyOfPropertyKeys=K_r;O0t.KeyOfPattern=iDa;var sTi=jMe(),_me=ms();function aTi(t){let e=[];for(let r of t)e.push(K_r(r));return e}a(aTi,"FromRest");function Z2a(t){let e=aTi(t);return(0,sTi.SetUnionMany)(e)}a(Z2a,"FromIntersect");function X2a(t){let e=aTi(t);return(0,sTi.SetIntersectMany)(e)}a(X2a,"FromUnion");function eDa(t){return t.map((e,r)=>r.toString())}a(eDa,"FromTuple");function tDa(t){return["[number]"]}a(tDa,"FromArray");function rDa(t){return globalThis.Object.getOwnPropertyNames(t)}a(rDa,"FromProperties");function nDa(t){return Y_r?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(nDa,"FromPatternProperties");function K_r(t){return(0,_me.IsIntersect)(t)?Z2a(t.allOf):(0,_me.IsUnion)(t)?X2a(t.anyOf):(0,_me.IsTuple)(t)?eDa(t.items??[]):(0,_me.IsArray)(t)?tDa(t.items):(0,_me.IsObject)(t)?rDa(t.properties):(0,_me.IsRecord)(t)?nDa(t.patternProperties):[]}a(K_r,"KeyOfPropertyKeys");var Y_r=!1;function iDa(t){Y_r=!0;let e=K_r(t);return Y_r=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(iDa,"KeyOfPattern")});var X_r=I(L0t=>{"use strict";p();Object.defineProperty(L0t,"__esModule",{value:!0});L0t.KeyOfPropertyKeysToRest=cTi;L0t.KeyOf=mDa;var oDa=Si(),sDa=bE(),aDa=ZH(),Z_r=KH(),cDa=iG(),lDa=B0t(),uDa=Ep(),dDa=evr(),J_r=ms();function fDa(t,e){return(0,Z_r.Computed)("KeyOf",[(0,Z_r.Computed)(t,e)])}a(fDa,"FromComputed");function pDa(t){return(0,Z_r.Computed)("KeyOf",[(0,cDa.Ref)(t)])}a(pDa,"FromRef");function hDa(t,e){let r=(0,lDa.KeyOfPropertyKeys)(t),n=cTi(r),o=(0,uDa.UnionEvaluated)(n);return(0,oDa.CreateType)(o,e)}a(hDa,"KeyOfFromType");function cTi(t){return t.map(e=>e==="[number]"?(0,aDa.Number)():(0,sDa.Literal)(e))}a(cTi,"KeyOfPropertyKeysToRest");function mDa(t,e){return(0,J_r.IsComputed)(t)?fDa(t.target,t.parameters):(0,J_r.IsRef)(t)?pDa(t.$ref):(0,J_r.IsMappedResult)(t)?(0,dDa.KeyOfFromMappedResult)(t,e):hDa(t,e)}a(mDa,"KeyOf")});var evr=I(tvr=>{"use strict";p();Object.defineProperty(tvr,"__esModule",{value:!0});tvr.KeyOfFromMappedResult=vDa;var gDa=p0(),ADa=X_r(),yDa=Pb();function EDa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,ADa.KeyOf)(t[n],(0,yDa.Clone)(e));return r}a(EDa,"FromProperties");function _Da(t,e){return EDa(t.properties,e)}a(_Da,"FromMappedResult");function vDa(t,e){let r=_Da(t,e);return(0,gDa.MappedResult)(r)}a(vDa,"KeyOfFromMappedResult")});var lTi=I(rvr=>{"use strict";p();Object.defineProperty(rvr,"__esModule",{value:!0});rvr.KeyOfPropertyEntries=SDa;var CDa=k0t(),bDa=B0t();function SDa(t){let e=(0,bDa.KeyOfPropertyKeys)(t),r=(0,CDa.IndexFromPropertyKeys)(t,e);return e.map((n,o)=>[e[o],r[o]])}a(SDa,"KeyOfPropertyEntries")});var U2=I(l4=>{"use strict";p();var TDa=l4&&l4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F0t=l4&&l4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TDa(e,t,r)};Object.defineProperty(l4,"__esModule",{value:!0});F0t(evr(),l4);F0t(lTi(),l4);F0t(B0t(),l4);F0t(X_r(),l4)});var uTi=I(nvr=>{"use strict";p();Object.defineProperty(nvr,"__esModule",{value:!0});nvr.Composite=BDa;var IDa=RT(),xDa=F2(),wDa=U2(),RDa=cv(),PDa=jMe(),kDa=ms();function DDa(t){let e=[];for(let r of t)e.push(...(0,wDa.KeyOfPropertyKeys)(r));return(0,PDa.SetDistinct)(e)}a(DDa,"CompositeKeys");function NDa(t){return t.filter(e=>!(0,kDa.IsNever)(e))}a(NDa,"FilterNever");function MDa(t,e){let r=[];for(let n of t)r.push(...(0,xDa.IndexFromPropertyKeys)(n,[e]));return NDa(r)}a(MDa,"CompositeProperty");function ODa(t,e){let r={};for(let n of e)r[n]=(0,IDa.IntersectEvaluated)(MDa(t,n));return r}a(ODa,"CompositeProperties");function BDa(t,e){let r=DDa(t),n=ODa(t,r);return(0,RDa.Object)(n,e)}a(BDa,"Composite")});var U0t=I(Kee=>{"use strict";p();var LDa=Kee&&Kee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FDa=Kee&&Kee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LDa(e,t,r)};Object.defineProperty(Kee,"__esModule",{value:!0});FDa(uTi(),Kee)});var dTi=I(ivr=>{"use strict";p();Object.defineProperty(ivr,"__esModule",{value:!0});ivr.Date=qDa;var UDa=_n(),QDa=Si();function qDa(t){return(0,QDa.CreateType)({[UDa.Kind]:"Date",type:"Date"},t)}a(qDa,"Date")});var eOe=I(Jee=>{"use strict";p();var jDa=Jee&&Jee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),HDa=Jee&&Jee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jDa(e,t,r)};Object.defineProperty(Jee,"__esModule",{value:!0});HDa(dTi(),Jee)});var fTi=I(ovr=>{"use strict";p();Object.defineProperty(ovr,"__esModule",{value:!0});ovr.Null=VDa;var GDa=Si(),$Da=_n();function VDa(t){return(0,GDa.CreateType)({[$Da.Kind]:"Null",type:"null"},t)}a(VDa,"Null")});var tOe=I(Zee=>{"use strict";p();var WDa=Zee&&Zee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zDa=Zee&&Zee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WDa(e,t,r)};Object.defineProperty(Zee,"__esModule",{value:!0});zDa(fTi(),Zee)});var pTi=I(svr=>{"use strict";p();Object.defineProperty(svr,"__esModule",{value:!0});svr.Symbol=JDa;var YDa=Si(),KDa=_n();function JDa(t){return(0,YDa.CreateType)({[KDa.Kind]:"Symbol",type:"symbol"},t)}a(JDa,"Symbol")});var rOe=I(Xee=>{"use strict";p();var ZDa=Xee&&Xee.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XDa=Xee&&Xee.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZDa(e,t,r)};Object.defineProperty(Xee,"__esModule",{value:!0});XDa(pTi(),Xee)});var hTi=I(avr=>{"use strict";p();Object.defineProperty(avr,"__esModule",{value:!0});avr.Undefined=rNa;var eNa=Si(),tNa=_n();function rNa(t){return(0,eNa.CreateType)({[tNa.Kind]:"Undefined",type:"undefined"},t)}a(rNa,"Undefined")});var nOe=I(ete=>{"use strict";p();var nNa=ete&&ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iNa=ete&&ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nNa(e,t,r)};Object.defineProperty(ete,"__esModule",{value:!0});iNa(hTi(),ete)});var mTi=I(cvr=>{"use strict";p();Object.defineProperty(cvr,"__esModule",{value:!0});cvr.Uint8Array=aNa;var oNa=Si(),sNa=_n();function aNa(t){return(0,oNa.CreateType)({[sNa.Kind]:"Uint8Array",type:"Uint8Array"},t)}a(aNa,"Uint8Array")});var iOe=I(tte=>{"use strict";p();var cNa=tte&&tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lNa=tte&&tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cNa(e,t,r)};Object.defineProperty(tte,"__esModule",{value:!0});lNa(mTi(),tte)});var gTi=I(lvr=>{"use strict";p();Object.defineProperty(lvr,"__esModule",{value:!0});lvr.Unknown=fNa;var uNa=Si(),dNa=_n();function fNa(t){return(0,uNa.CreateType)({[dNa.Kind]:"Unknown"},t)}a(fNa,"Unknown")});var oG=I(rte=>{"use strict";p();var pNa=rte&&rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hNa=rte&&rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pNa(e,t,r)};Object.defineProperty(rte,"__esModule",{value:!0});hNa(gTi(),rte)});var ETi=I(pvr=>{"use strict";p();Object.defineProperty(pvr,"__esModule",{value:!0});pvr.Const=xNa;var ATi=ume(),mNa=Ame(),gNa=eOe(),ANa=JH(),uvr=bE(),yNa=tOe(),yTi=cv(),ENa=rOe(),_Na=E8(),dvr=rG(),vNa=nOe(),CNa=iOe(),bNa=oG(),SNa=h8(),Mb=av();function TNa(t){return t.map(e=>fvr(e,!1))}a(TNa,"FromArray");function INa(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=(0,dvr.Readonly)(fvr(t[r],!1));return e}a(INa,"FromProperties");function Q0t(t,e){return e===!0?t:(0,dvr.Readonly)(t)}a(Q0t,"ConditionalReadonly");function fvr(t,e){return(0,Mb.IsAsyncIterator)(t)||(0,Mb.IsIterator)(t)?Q0t((0,ATi.Any)(),e):(0,Mb.IsArray)(t)?(0,dvr.Readonly)((0,_Na.Tuple)(TNa(t))):(0,Mb.IsUint8Array)(t)?(0,CNa.Uint8Array)():(0,Mb.IsDate)(t)?(0,gNa.Date)():(0,Mb.IsObject)(t)?Q0t((0,yTi.Object)(INa(t)),e):(0,Mb.IsFunction)(t)?Q0t((0,ANa.Function)([],(0,bNa.Unknown)()),e):(0,Mb.IsUndefined)(t)?(0,vNa.Undefined)():(0,Mb.IsNull)(t)?(0,yNa.Null)():(0,Mb.IsSymbol)(t)?(0,ENa.Symbol)():(0,Mb.IsBigInt)(t)?(0,mNa.BigInt)():(0,Mb.IsNumber)(t)||(0,Mb.IsBoolean)(t)||(0,Mb.IsString)(t)?(0,uvr.Literal)(t):(0,yTi.Object)({})}a(fvr,"FromValue");function xNa(t,e){return(0,SNa.CreateType)(fvr(t,!0),e)}a(xNa,"Const")});var q0t=I(nte=>{"use strict";p();var wNa=nte&&nte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RNa=nte&&nte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wNa(e,t,r)};Object.defineProperty(nte,"__esModule",{value:!0});RNa(ETi(),nte)});var _Ti=I(C8=>{"use strict";p();var PNa=C8&&C8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kNa=C8&&C8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),DNa=C8&&C8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var LNa=ite&&ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),FNa=ite&&ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LNa(e,t,r)};Object.defineProperty(ite,"__esModule",{value:!0});FNa(_Ti(),ite)});var vTi=I(hvr=>{"use strict";p();Object.defineProperty(hvr,"__esModule",{value:!0});hvr.Enum=HNa;var UNa=bE(),QNa=_n(),qNa=Ep(),jNa=av();function HNa(t,e){if((0,jNa.IsUndefined)(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>(0,UNa.Literal)(s));return(0,qNa.Union)(o,{...e,[QNa.Hint]:"Enum"})}a(HNa,"Enum")});var H0t=I(ote=>{"use strict";p();var GNa=ote&&ote.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Na=ote&&ote.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GNa(e,t,r)};Object.defineProperty(ote,"__esModule",{value:!0});$Na(vTi(),ote)});var Cvr=I(ste=>{"use strict";p();Object.defineProperty(ste,"__esModule",{value:!0});ste.ExtendsResult=ste.ExtendsResolverError=void 0;ste.ExtendsCheck=MMa;var CTi=ume(),VNa=JH(),Evr=ZH(),gvr=XH(),WNa=oG(),bTi=L2(),vme=qMe(),wTi=_n(),zNa=Sf(),et=UEr(),G0t=class extends zNa.TypeBoxError{static{a(this,"ExtendsResolverError")}};ste.ExtendsResolverError=G0t;var Ot;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Ot||(ste.ExtendsResult=Ot={}));function oR(t){return t===Ot.False?t:Ot.True}a(oR,"IntoBooleanResult");function Cme(t){throw new G0t(t)}a(Cme,"Throw");function h0(t){return et.TypeGuard.IsNever(t)||et.TypeGuard.IsIntersect(t)||et.TypeGuard.IsUnion(t)||et.TypeGuard.IsUnknown(t)||et.TypeGuard.IsAny(t)}a(h0,"IsStructuralRight");function m0(t,e){return et.TypeGuard.IsNever(e)?kTi(t,e):et.TypeGuard.IsIntersect(e)?$0t(t,e):et.TypeGuard.IsUnion(e)?vvr(t,e):et.TypeGuard.IsUnknown(e)?OTi(t,e):et.TypeGuard.IsAny(e)?_vr(t,e):Cme("StructuralRight")}a(m0,"StructuralRight");function _vr(t,e){return Ot.True}a(_vr,"FromAnyRight");function YNa(t,e){return et.TypeGuard.IsIntersect(e)?$0t(t,e):et.TypeGuard.IsUnion(e)&&e.anyOf.some(r=>et.TypeGuard.IsAny(r)||et.TypeGuard.IsUnknown(r))?Ot.True:et.TypeGuard.IsUnion(e)?Ot.Union:et.TypeGuard.IsUnknown(e)||et.TypeGuard.IsAny(e)?Ot.True:Ot.Union}a(YNa,"FromAny");function KNa(t,e){return et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:et.TypeGuard.IsNever(t)?Ot.True:Ot.False}a(KNa,"FromArrayRight");function JNa(t,e){return et.TypeGuard.IsObject(e)&&V0t(e)?Ot.True:h0(e)?m0(t,e):et.TypeGuard.IsArray(e)?oR(cl(t.items,e.items)):Ot.False}a(JNa,"FromArray");function ZNa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsAsyncIterator(e)?oR(cl(t.items,e.items)):Ot.False}a(ZNa,"FromAsyncIterator");function XNa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsBigInt(e)?Ot.True:Ot.False}a(XNa,"FromBigInt");function RTi(t,e){return et.TypeGuard.IsLiteralBoolean(t)||et.TypeGuard.IsBoolean(t)?Ot.True:Ot.False}a(RTi,"FromBooleanRight");function eMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsBoolean(e)?Ot.True:Ot.False}a(eMa,"FromBoolean");function tMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsConstructor(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>oR(cl(e.parameters[n],r))===Ot.True)?oR(cl(t.returns,e.returns)):Ot.False:Ot.False}a(tMa,"FromConstructor");function rMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsDate(e)?Ot.True:Ot.False}a(rMa,"FromDate");function nMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsFunction(e)?t.parameters.length>e.parameters.length?Ot.False:t.parameters.every((r,n)=>oR(cl(e.parameters[n],r))===Ot.True)?oR(cl(t.returns,e.returns)):Ot.False:Ot.False}a(nMa,"FromFunction");function PTi(t,e){return et.TypeGuard.IsLiteral(t)&&et.ValueGuard.IsNumber(t.const)||et.TypeGuard.IsNumber(t)||et.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(PTi,"FromIntegerRight");function iMa(t,e){return et.TypeGuard.IsInteger(e)||et.TypeGuard.IsNumber(e)?Ot.True:h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):Ot.False}a(iMa,"FromInteger");function $0t(t,e){return e.allOf.every(r=>cl(t,r)===Ot.True)?Ot.True:Ot.False}a($0t,"FromIntersectRight");function oMa(t,e){return t.allOf.some(r=>cl(r,e)===Ot.True)?Ot.True:Ot.False}a(oMa,"FromIntersect");function sMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsIterator(e)?oR(cl(t.items,e.items)):Ot.False}a(sMa,"FromIterator");function aMa(t,e){return et.TypeGuard.IsLiteral(e)&&e.const===t.const?Ot.True:h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsString(e)?MTi(t,e):et.TypeGuard.IsNumber(e)?DTi(t,e):et.TypeGuard.IsInteger(e)?PTi(t,e):et.TypeGuard.IsBoolean(e)?RTi(t,e):Ot.False}a(aMa,"FromLiteral");function kTi(t,e){return Ot.False}a(kTi,"FromNeverRight");function cMa(t,e){return Ot.True}a(cMa,"FromNever");function STi(t){let[e,r]=[t,0];for(;et.TypeGuard.IsNot(e);)e=e.not,r+=1;return r%2===0?e:(0,WNa.Unknown)()}a(STi,"UnwrapTNot");function lMa(t,e){return et.TypeGuard.IsNot(t)?cl(STi(t),e):et.TypeGuard.IsNot(e)?cl(t,STi(e)):Cme("Invalid fallthrough for Not")}a(lMa,"FromNot");function uMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsNull(e)?Ot.True:Ot.False}a(uMa,"FromNull");function DTi(t,e){return et.TypeGuard.IsLiteralNumber(t)||et.TypeGuard.IsNumber(t)||et.TypeGuard.IsInteger(t)?Ot.True:Ot.False}a(DTi,"FromNumberRight");function dMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsInteger(e)||et.TypeGuard.IsNumber(e)?Ot.True:Ot.False}a(dMa,"FromNumber");function Ob(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(Ob,"IsObjectPropertyCount");function TTi(t){return V0t(t)}a(TTi,"IsObjectStringLike");function ITi(t){return Ob(t,0)||Ob(t,1)&&"description"in t.properties&&et.TypeGuard.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(et.TypeGuard.IsString(t.properties.description.anyOf[0])&&et.TypeGuard.IsUndefined(t.properties.description.anyOf[1])||et.TypeGuard.IsString(t.properties.description.anyOf[1])&&et.TypeGuard.IsUndefined(t.properties.description.anyOf[0]))}a(ITi,"IsObjectSymbolLike");function mvr(t){return Ob(t,0)}a(mvr,"IsObjectNumberLike");function xTi(t){return Ob(t,0)}a(xTi,"IsObjectBooleanLike");function fMa(t){return Ob(t,0)}a(fMa,"IsObjectBigIntLike");function pMa(t){return Ob(t,0)}a(pMa,"IsObjectDateLike");function hMa(t){return V0t(t)}a(hMa,"IsObjectUint8ArrayLike");function mMa(t){let e=(0,Evr.Number)();return Ob(t,0)||Ob(t,1)&&"length"in t.properties&&oR(cl(t.properties.length,e))===Ot.True}a(mMa,"IsObjectFunctionLike");function gMa(t){return Ob(t,0)}a(gMa,"IsObjectConstructorLike");function V0t(t){let e=(0,Evr.Number)();return Ob(t,0)||Ob(t,1)&&"length"in t.properties&&oR(cl(t.properties.length,e))===Ot.True}a(V0t,"IsObjectArrayLike");function AMa(t){let e=(0,VNa.Function)([(0,CTi.Any)()],(0,CTi.Any)());return Ob(t,0)||Ob(t,1)&&"then"in t.properties&&oR(cl(t.properties.then,e))===Ot.True}a(AMa,"IsObjectPromiseLike");function NTi(t,e){return cl(t,e)===Ot.False||et.TypeGuard.IsOptional(t)&&!et.TypeGuard.IsOptional(e)?Ot.False:Ot.True}a(NTi,"Property");function SE(t,e){return et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:et.TypeGuard.IsNever(t)||et.TypeGuard.IsLiteralString(t)&&TTi(e)||et.TypeGuard.IsLiteralNumber(t)&&mvr(e)||et.TypeGuard.IsLiteralBoolean(t)&&xTi(e)||et.TypeGuard.IsSymbol(t)&&ITi(e)||et.TypeGuard.IsBigInt(t)&&fMa(e)||et.TypeGuard.IsString(t)&&TTi(e)||et.TypeGuard.IsSymbol(t)&&ITi(e)||et.TypeGuard.IsNumber(t)&&mvr(e)||et.TypeGuard.IsInteger(t)&&mvr(e)||et.TypeGuard.IsBoolean(t)&&xTi(e)||et.TypeGuard.IsUint8Array(t)&&hMa(e)||et.TypeGuard.IsDate(t)&&pMa(e)||et.TypeGuard.IsConstructor(t)&&gMa(e)||et.TypeGuard.IsFunction(t)&&mMa(e)?Ot.True:et.TypeGuard.IsRecord(t)&&et.TypeGuard.IsString(Avr(t))?e[wTi.Hint]==="Record"?Ot.True:Ot.False:et.TypeGuard.IsRecord(t)&&et.TypeGuard.IsNumber(Avr(t))&&Ob(e,0)?Ot.True:Ot.False}a(SE,"FromObjectRight");function yMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!et.TypeGuard.IsOptional(e.properties[r]))return Ot.False;if(et.TypeGuard.IsOptional(e.properties[r]))return Ot.True;if(NTi(t.properties[r],e.properties[r])===Ot.False)return Ot.False}return Ot.True})():Ot.False}a(yMa,"FromObject");function EMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)&&AMa(e)?Ot.True:et.TypeGuard.IsPromise(e)?oR(cl(t.item,e.item)):Ot.False}a(EMa,"FromPromise");function Avr(t){return vme.PatternNumberExact in t.patternProperties?(0,Evr.Number)():vme.PatternStringExact in t.patternProperties?(0,gvr.String)():Cme("Unknown record key pattern")}a(Avr,"RecordKey");function yvr(t){return vme.PatternNumberExact in t.patternProperties?t.patternProperties[vme.PatternNumberExact]:vme.PatternStringExact in t.patternProperties?t.patternProperties[vme.PatternStringExact]:Cme("Unable to get record value schema")}a(yvr,"RecordValue");function sR(t,e){let[r,n]=[Avr(e),yvr(e)];return et.TypeGuard.IsLiteralString(t)&&et.TypeGuard.IsNumber(r)&&oR(cl(t,n))===Ot.True?Ot.True:et.TypeGuard.IsUint8Array(t)&&et.TypeGuard.IsNumber(r)||et.TypeGuard.IsString(t)&&et.TypeGuard.IsNumber(r)||et.TypeGuard.IsArray(t)&&et.TypeGuard.IsNumber(r)?cl(t,n):et.TypeGuard.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(NTi(n,t.properties[o])===Ot.False)return Ot.False;return Ot.True})():Ot.False}a(sR,"FromRecordRight");function _Ma(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?cl(yvr(t),yvr(e)):Ot.False}a(_Ma,"FromRecord");function vMa(t,e){let r=et.TypeGuard.IsRegExp(t)?(0,gvr.String)():t,n=et.TypeGuard.IsRegExp(e)?(0,gvr.String)():e;return cl(r,n)}a(vMa,"FromRegExp");function MTi(t,e){return et.TypeGuard.IsLiteral(t)&&et.ValueGuard.IsString(t.const)||et.TypeGuard.IsString(t)?Ot.True:Ot.False}a(MTi,"FromStringRight");function CMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsString(e)?Ot.True:Ot.False}a(CMa,"FromString");function bMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsSymbol(e)?Ot.True:Ot.False}a(bMa,"FromSymbol");function SMa(t,e){return et.TypeGuard.IsTemplateLiteral(t)?cl((0,bTi.TemplateLiteralToUnion)(t),e):et.TypeGuard.IsTemplateLiteral(e)?cl(t,(0,bTi.TemplateLiteralToUnion)(e)):Cme("Invalid fallthrough for TemplateLiteral")}a(SMa,"FromTemplateLiteral");function TMa(t,e){return et.TypeGuard.IsArray(e)&&t.items!==void 0&&t.items.every(r=>cl(r,e.items)===Ot.True)}a(TMa,"IsArrayOfTuple");function IMa(t,e){return et.TypeGuard.IsNever(t)?Ot.True:et.TypeGuard.IsUnknown(t)?Ot.False:et.TypeGuard.IsAny(t)?Ot.Union:Ot.False}a(IMa,"FromTupleRight");function xMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)&&V0t(e)||et.TypeGuard.IsArray(e)&&TMa(t,e)?Ot.True:et.TypeGuard.IsTuple(e)?et.ValueGuard.IsUndefined(t.items)&&!et.ValueGuard.IsUndefined(e.items)||!et.ValueGuard.IsUndefined(t.items)&&et.ValueGuard.IsUndefined(e.items)?Ot.False:et.ValueGuard.IsUndefined(t.items)&&!et.ValueGuard.IsUndefined(e.items)||t.items.every((r,n)=>cl(r,e.items[n])===Ot.True)?Ot.True:Ot.False:Ot.False}a(xMa,"FromTuple");function wMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsUint8Array(e)?Ot.True:Ot.False}a(wMa,"FromUint8Array");function RMa(t,e){return h0(e)?m0(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsRecord(e)?sR(t,e):et.TypeGuard.IsVoid(e)?DMa(t,e):et.TypeGuard.IsUndefined(e)?Ot.True:Ot.False}a(RMa,"FromUndefined");function vvr(t,e){return e.anyOf.some(r=>cl(t,r)===Ot.True)?Ot.True:Ot.False}a(vvr,"FromUnionRight");function PMa(t,e){return t.anyOf.every(r=>cl(r,e)===Ot.True)?Ot.True:Ot.False}a(PMa,"FromUnion");function OTi(t,e){return Ot.True}a(OTi,"FromUnknownRight");function kMa(t,e){return et.TypeGuard.IsNever(e)?kTi(t,e):et.TypeGuard.IsIntersect(e)?$0t(t,e):et.TypeGuard.IsUnion(e)?vvr(t,e):et.TypeGuard.IsAny(e)?_vr(t,e):et.TypeGuard.IsString(e)?MTi(t,e):et.TypeGuard.IsNumber(e)?DTi(t,e):et.TypeGuard.IsInteger(e)?PTi(t,e):et.TypeGuard.IsBoolean(e)?RTi(t,e):et.TypeGuard.IsArray(e)?KNa(t,e):et.TypeGuard.IsTuple(e)?IMa(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsUnknown(e)?Ot.True:Ot.False}a(kMa,"FromUnknown");function DMa(t,e){return et.TypeGuard.IsUndefined(t)||et.TypeGuard.IsUndefined(t)?Ot.True:Ot.False}a(DMa,"FromVoidRight");function NMa(t,e){return et.TypeGuard.IsIntersect(e)?$0t(t,e):et.TypeGuard.IsUnion(e)?vvr(t,e):et.TypeGuard.IsUnknown(e)?OTi(t,e):et.TypeGuard.IsAny(e)?_vr(t,e):et.TypeGuard.IsObject(e)?SE(t,e):et.TypeGuard.IsVoid(e)?Ot.True:Ot.False}a(NMa,"FromVoid");function cl(t,e){return et.TypeGuard.IsTemplateLiteral(t)||et.TypeGuard.IsTemplateLiteral(e)?SMa(t,e):et.TypeGuard.IsRegExp(t)||et.TypeGuard.IsRegExp(e)?vMa(t,e):et.TypeGuard.IsNot(t)||et.TypeGuard.IsNot(e)?lMa(t,e):et.TypeGuard.IsAny(t)?YNa(t,e):et.TypeGuard.IsArray(t)?JNa(t,e):et.TypeGuard.IsBigInt(t)?XNa(t,e):et.TypeGuard.IsBoolean(t)?eMa(t,e):et.TypeGuard.IsAsyncIterator(t)?ZNa(t,e):et.TypeGuard.IsConstructor(t)?tMa(t,e):et.TypeGuard.IsDate(t)?rMa(t,e):et.TypeGuard.IsFunction(t)?nMa(t,e):et.TypeGuard.IsInteger(t)?iMa(t,e):et.TypeGuard.IsIntersect(t)?oMa(t,e):et.TypeGuard.IsIterator(t)?sMa(t,e):et.TypeGuard.IsLiteral(t)?aMa(t,e):et.TypeGuard.IsNever(t)?cMa(t,e):et.TypeGuard.IsNull(t)?uMa(t,e):et.TypeGuard.IsNumber(t)?dMa(t,e):et.TypeGuard.IsObject(t)?yMa(t,e):et.TypeGuard.IsRecord(t)?_Ma(t,e):et.TypeGuard.IsString(t)?CMa(t,e):et.TypeGuard.IsSymbol(t)?bMa(t,e):et.TypeGuard.IsTuple(t)?xMa(t,e):et.TypeGuard.IsPromise(t)?EMa(t,e):et.TypeGuard.IsUint8Array(t)?wMa(t,e):et.TypeGuard.IsUndefined(t)?RMa(t,e):et.TypeGuard.IsUnion(t)?PMa(t,e):et.TypeGuard.IsUnknown(t)?kMa(t,e):et.TypeGuard.IsVoid(t)?NMa(t,e):Cme(`Unknown left type operand '${t[wTi.Kind]}'`)}a(cl,"Visit");function MMa(t,e){return cl(t,e)}a(MMa,"ExtendsCheck")});var Svr=I(bvr=>{"use strict";p();Object.defineProperty(bvr,"__esModule",{value:!0});bvr.ExtendsFromMappedResult=QMa;var OMa=p0(),BMa=W0t(),LMa=Pb();function FMa(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=(0,BMa.Extends)(t[c],e,r,n,(0,LMa.Clone)(o));return s}a(FMa,"FromProperties");function UMa(t,e,r,n,o){return FMa(t.properties,e,r,n,o)}a(UMa,"FromMappedResult");function QMa(t,e,r,n,o){let s=UMa(t,e,r,n,o);return(0,OMa.MappedResult)(s)}a(QMa,"ExtendsFromMappedResult")});var W0t=I(Ivr=>{"use strict";p();Object.defineProperty(Ivr,"__esModule",{value:!0});Ivr.Extends=$Ma;var BTi=Si(),qMa=Ep(),Tvr=Cvr(),jMa=xvr(),HMa=Svr(),LTi=ms();function GMa(t,e,r,n){let o=(0,Tvr.ExtendsCheck)(t,e);return o===Tvr.ExtendsResult.Union?(0,qMa.Union)([r,n]):o===Tvr.ExtendsResult.True?r:n}a(GMa,"ExtendsResolve");function $Ma(t,e,r,n,o){return(0,LTi.IsMappedResult)(t)?(0,HMa.ExtendsFromMappedResult)(t,e,r,n,o):(0,LTi.IsMappedKey)(t)?(0,BTi.CreateType)((0,jMa.ExtendsFromMappedKey)(t,e,r,n,o)):(0,BTi.CreateType)(GMa(t,e,r,n),o)}a($Ma,"Extends")});var xvr=I(wvr=>{"use strict";p();Object.defineProperty(wvr,"__esModule",{value:!0});wvr.ExtendsFromMappedKey=XMa;var VMa=p0(),WMa=bE(),zMa=W0t(),YMa=Pb();function KMa(t,e,r,n,o){return{[t]:(0,zMa.Extends)((0,WMa.Literal)(t),e,r,n,(0,YMa.Clone)(o))}}a(KMa,"FromPropertyKey");function JMa(t,e,r,n,o){return t.reduce((s,c)=>({...s,...KMa(c,e,r,n,o)}),{})}a(JMa,"FromPropertyKeys");function ZMa(t,e,r,n,o){return JMa(t.keys,e,r,n,o)}a(ZMa,"FromMappedKey");function XMa(t,e,r,n,o){let s=ZMa(t,e,r,n,o);return(0,VMa.MappedResult)(s)}a(XMa,"ExtendsFromMappedKey")});var Pvr=I(Rvr=>{"use strict";p();Object.defineProperty(Rvr,"__esModule",{value:!0});Rvr.ExtendsUndefinedCheck=Y0t;var z0t=_n();function eOa(t){return t.allOf.every(e=>Y0t(e))}a(eOa,"Intersect");function tOa(t){return t.anyOf.some(e=>Y0t(e))}a(tOa,"Union");function rOa(t){return!Y0t(t.not)}a(rOa,"Not");function Y0t(t){return t[z0t.Kind]==="Intersect"?eOa(t):t[z0t.Kind]==="Union"?tOa(t):t[z0t.Kind]==="Not"?rOa(t):t[z0t.Kind]==="Undefined"}a(Y0t,"ExtendsUndefinedCheck")});var ate=I(Q2=>{"use strict";p();var nOa=Q2&&Q2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oOe=Q2&&Q2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&nOa(e,t,r)};Object.defineProperty(Q2,"__esModule",{value:!0});oOe(Cvr(),Q2);oOe(xvr(),Q2);oOe(Svr(),Q2);oOe(Pvr(),Q2);oOe(W0t(),Q2)});var Dvr=I(kvr=>{"use strict";p();Object.defineProperty(kvr,"__esModule",{value:!0});kvr.ExcludeFromTemplateLiteral=sOa;var iOa=K0t(),oOa=L2();function sOa(t,e){return(0,iOa.Exclude)((0,oOa.TemplateLiteralToUnion)(t),e)}a(sOa,"ExcludeFromTemplateLiteral")});var K0t=I(Ovr=>{"use strict";p();Object.defineProperty(Ovr,"__esModule",{value:!0});Ovr.Exclude=fOa;var Nvr=Si(),aOa=Ep(),cOa=f0(),J0t=ate(),lOa=Bvr(),uOa=Dvr(),Mvr=ms();function dOa(t,e){let r=t.filter(n=>(0,J0t.ExtendsCheck)(n,e)===J0t.ExtendsResult.False);return r.length===1?r[0]:(0,aOa.Union)(r)}a(dOa,"ExcludeRest");function fOa(t,e,r={}){return(0,Mvr.IsTemplateLiteral)(t)?(0,Nvr.CreateType)((0,uOa.ExcludeFromTemplateLiteral)(t,e),r):(0,Mvr.IsMappedResult)(t)?(0,Nvr.CreateType)((0,lOa.ExcludeFromMappedResult)(t,e),r):(0,Nvr.CreateType)((0,Mvr.IsUnion)(t)?dOa(t.anyOf,e):(0,J0t.ExtendsCheck)(t,e)!==J0t.ExtendsResult.False?(0,cOa.Never)():t,r)}a(fOa,"Exclude")});var Bvr=I(Lvr=>{"use strict";p();Object.defineProperty(Lvr,"__esModule",{value:!0});Lvr.ExcludeFromMappedResult=AOa;var pOa=p0(),hOa=K0t();function mOa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,hOa.Exclude)(t[n],e);return r}a(mOa,"FromProperties");function gOa(t,e){return mOa(t.properties,e)}a(gOa,"FromMappedResult");function AOa(t,e){let r=gOa(t,e);return(0,pOa.MappedResult)(r)}a(AOa,"ExcludeFromMappedResult")});var Z0t=I(b8=>{"use strict";p();var yOa=b8&&b8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Fvr=b8&&b8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yOa(e,t,r)};Object.defineProperty(b8,"__esModule",{value:!0});Fvr(Bvr(),b8);Fvr(Dvr(),b8);Fvr(K0t(),b8)});var Qvr=I(Uvr=>{"use strict";p();Object.defineProperty(Uvr,"__esModule",{value:!0});Uvr.ExtractFromTemplateLiteral=vOa;var EOa=X0t(),_Oa=L2();function vOa(t,e){return(0,EOa.Extract)((0,_Oa.TemplateLiteralToUnion)(t),e)}a(vOa,"ExtractFromTemplateLiteral")});var X0t=I(Hvr=>{"use strict";p();Object.defineProperty(Hvr,"__esModule",{value:!0});Hvr.Extract=xOa;var qvr=Si(),COa=Ep(),bOa=f0(),emt=ate(),SOa=Gvr(),TOa=Qvr(),jvr=ms();function IOa(t,e){let r=t.filter(n=>(0,emt.ExtendsCheck)(n,e)!==emt.ExtendsResult.False);return r.length===1?r[0]:(0,COa.Union)(r)}a(IOa,"ExtractRest");function xOa(t,e,r){return(0,jvr.IsTemplateLiteral)(t)?(0,qvr.CreateType)((0,TOa.ExtractFromTemplateLiteral)(t,e),r):(0,jvr.IsMappedResult)(t)?(0,qvr.CreateType)((0,SOa.ExtractFromMappedResult)(t,e),r):(0,qvr.CreateType)((0,jvr.IsUnion)(t)?IOa(t.anyOf,e):(0,emt.ExtendsCheck)(t,e)!==emt.ExtendsResult.False?t:(0,bOa.Never)(),r)}a(xOa,"Extract")});var Gvr=I($vr=>{"use strict";p();Object.defineProperty($vr,"__esModule",{value:!0});$vr.ExtractFromMappedResult=DOa;var wOa=p0(),ROa=X0t();function POa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,ROa.Extract)(t[n],e);return r}a(POa,"FromProperties");function kOa(t,e){return POa(t.properties,e)}a(kOa,"FromMappedResult");function DOa(t,e){let r=kOa(t,e);return(0,wOa.MappedResult)(r)}a(DOa,"ExtractFromMappedResult")});var tmt=I(S8=>{"use strict";p();var NOa=S8&&S8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vvr=S8&&S8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NOa(e,t,r)};Object.defineProperty(S8,"__esModule",{value:!0});Vvr(Gvr(),S8);Vvr(Qvr(),S8);Vvr(X0t(),S8)});var FTi=I(T8=>{"use strict";p();var MOa=T8&&T8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),OOa=T8&&T8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),BOa=T8&&T8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var qOa=cte&&cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),jOa=cte&&cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qOa(e,t,r)};Object.defineProperty(cte,"__esModule",{value:!0});jOa(FTi(),cte)});var UTi=I(Wvr=>{"use strict";p();Object.defineProperty(Wvr,"__esModule",{value:!0});Wvr.ReadonlyOptional=$Oa;var HOa=rG(),GOa=a4();function $Oa(t){return(0,HOa.Readonly)((0,GOa.Optional)(t))}a($Oa,"ReadonlyOptional")});var sOe=I(lte=>{"use strict";p();var VOa=lte&<e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),WOa=lte&<e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&VOa(e,t,r)};Object.defineProperty(lte,"__esModule",{value:!0});WOa(UTi(),lte)});var GTi=I(bme=>{"use strict";p();Object.defineProperty(bme,"__esModule",{value:!0});bme.Record=u5a;bme.RecordPattern=Yvr;bme.RecordKey=d5a;bme.RecordValue=f5a;var zOa=Si(),qTi=_n(),YOa=f0(),KOa=ZH(),jTi=cv(),QTi=XH(),JOa=Ep(),ZOa=L2(),ute=qMe(),HTi=F2(),XOa=av(),u4=ms();function dte(t,e,r){return(0,zOa.CreateType)({[qTi.Kind]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(dte,"RecordCreateFromPattern");function zvr(t,e,r){let n={};for(let o of t)n[o]=e;return(0,jTi.Object)(n,{...r,[qTi.Hint]:"Record"})}a(zvr,"RecordCreateFromKeys");function e5a(t,e,r){return(0,ZOa.IsTemplateLiteralFinite)(t)?zvr((0,HTi.IndexPropertyKeys)(t),e,r):dte(t.pattern,e,r)}a(e5a,"FromTemplateLiteralKey");function t5a(t,e,r){return zvr((0,HTi.IndexPropertyKeys)((0,JOa.Union)(t)),e,r)}a(t5a,"FromUnionKey");function r5a(t,e,r){return zvr([t.toString()],e,r)}a(r5a,"FromLiteralKey");function n5a(t,e,r){return dte(t.source,e,r)}a(n5a,"FromRegExpKey");function i5a(t,e,r){let n=(0,XOa.IsUndefined)(t.pattern)?ute.PatternStringExact:t.pattern;return dte(n,e,r)}a(i5a,"FromStringKey");function o5a(t,e,r){return dte(ute.PatternStringExact,e,r)}a(o5a,"FromAnyKey");function s5a(t,e,r){return dte(ute.PatternNeverExact,e,r)}a(s5a,"FromNeverKey");function a5a(t,e,r){return(0,jTi.Object)({true:e,false:e},r)}a(a5a,"FromBooleanKey");function c5a(t,e,r){return dte(ute.PatternNumberExact,e,r)}a(c5a,"FromIntegerKey");function l5a(t,e,r){return dte(ute.PatternNumberExact,e,r)}a(l5a,"FromNumberKey");function u5a(t,e,r={}){return(0,u4.IsUnion)(t)?t5a(t.anyOf,e,r):(0,u4.IsTemplateLiteral)(t)?e5a(t,e,r):(0,u4.IsLiteral)(t)?r5a(t.const,e,r):(0,u4.IsBoolean)(t)?a5a(t,e,r):(0,u4.IsInteger)(t)?c5a(t,e,r):(0,u4.IsNumber)(t)?l5a(t,e,r):(0,u4.IsRegExp)(t)?n5a(t,e,r):(0,u4.IsString)(t)?i5a(t,e,r):(0,u4.IsAny)(t)?o5a(t,e,r):(0,u4.IsNever)(t)?s5a(t,e,r):(0,YOa.Never)(r)}a(u5a,"Record");function Yvr(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(Yvr,"RecordPattern");function d5a(t){let e=Yvr(t);return e===ute.PatternStringExact?(0,QTi.String)():e===ute.PatternNumberExact?(0,KOa.Number)():(0,QTi.String)({pattern:e})}a(d5a,"RecordKey");function f5a(t){return t.patternProperties[Yvr(t)]}a(f5a,"RecordValue")});var Sme=I(fte=>{"use strict";p();var p5a=fte&&fte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h5a=fte&&fte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p5a(e,t,r)};Object.defineProperty(fte,"__esModule",{value:!0});h5a(GTi(),fte)});var VTi=I(d4=>{"use strict";p();var m5a=d4&&d4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),g5a=d4&&d4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$Ti=d4&&d4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o({...r,[n]:B5a(t,e[n])}),{})}a(L5a,"FromProperties");function Tme(t,e){return e.map(r=>q2(t,r))}a(Tme,"FromTypes");function q2(t,e){return Bb.IsConstructor(e)?S5a(t,e):Bb.IsFunction(e)?T5a(t,e):Bb.IsIntersect(e)?I5a(t,e):Bb.IsUnion(e)?x5a(t,e):Bb.IsTuple(e)?w5a(t,e):Bb.IsArray(e)?R5a(t,e):Bb.IsAsyncIterator(e)?P5a(t,e):Bb.IsIterator(e)?k5a(t,e):Bb.IsPromise(e)?D5a(t,e):Bb.IsObject(e)?N5a(t,e):Bb.IsRecord(e)?M5a(t,e):Bb.IsArgument(e)?O5a(t,e):e}a(q2,"FromType");function F5a(t,e){return q2(e,(0,A5a.CloneType)(t))}a(F5a,"Instantiate")});var nmt=I(pte=>{"use strict";p();var U5a=pte&&pte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Q5a=pte&&pte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U5a(e,t,r)};Object.defineProperty(pte,"__esModule",{value:!0});Q5a(VTi(),pte)});var WTi=I(Jvr=>{"use strict";p();Object.defineProperty(Jvr,"__esModule",{value:!0});Jvr.Integer=H5a;var q5a=Si(),j5a=_n();function H5a(t){return(0,q5a.CreateType)({[j5a.Kind]:"Integer",type:"integer"},t)}a(H5a,"Integer")});var imt=I(hte=>{"use strict";p();var G5a=hte&&hte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$5a=hte&&hte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&G5a(e,t,r)};Object.defineProperty(hte,"__esModule",{value:!0});$5a(WTi(),hte)});var Xvr=I(Zvr=>{"use strict";p();Object.defineProperty(Zvr,"__esModule",{value:!0});Zvr.IntrinsicFromMappedKey=X5a;var V5a=p0(),W5a=mte(),z5a=bE(),Y5a=Pb();function K5a(t,e,r){return{[t]:(0,W5a.Intrinsic)((0,z5a.Literal)(t),e,(0,Y5a.Clone)(r))}}a(K5a,"MappedIntrinsicPropertyKey");function J5a(t,e,r){return t.reduce((o,s)=>({...o,...K5a(s,e,r)}),{})}a(J5a,"MappedIntrinsicPropertyKeys");function Z5a(t,e,r){return J5a(t.keys,e,r)}a(Z5a,"MappedIntrinsicProperties");function X5a(t,e,r){let n=Z5a(t,e,r);return(0,V5a.MappedResult)(n)}a(X5a,"IntrinsicFromMappedKey")});var mte=I(eCr=>{"use strict";p();Object.defineProperty(eCr,"__esModule",{value:!0});eCr.Intrinsic=ZTi;var e4a=Si(),omt=L2(),t4a=Xvr(),zTi=bE(),YTi=Ep(),smt=ms();function r4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(r4a,"ApplyUncapitalize");function n4a(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(n4a,"ApplyCapitalize");function i4a(t){return t.toUpperCase()}a(i4a,"ApplyUppercase");function o4a(t){return t.toLowerCase()}a(o4a,"ApplyLowercase");function s4a(t,e,r){let n=(0,omt.TemplateLiteralParseExact)(t.pattern);if(!(0,omt.IsTemplateLiteralExpressionFinite)(n))return{...t,pattern:KTi(t.pattern,e)};let c=[...(0,omt.TemplateLiteralExpressionGenerate)(n)].map(d=>(0,zTi.Literal)(d)),l=JTi(c,e),u=(0,YTi.Union)(l);return(0,omt.TemplateLiteral)([u],r)}a(s4a,"FromTemplateLiteral");function KTi(t,e){return typeof t=="string"?e==="Uncapitalize"?r4a(t):e==="Capitalize"?n4a(t):e==="Uppercase"?i4a(t):e==="Lowercase"?o4a(t):t:t.toString()}a(KTi,"FromLiteralValue");function JTi(t,e){return t.map(r=>ZTi(r,e))}a(JTi,"FromRest");function ZTi(t,e,r={}){return(0,smt.IsMappedKey)(t)?(0,t4a.IntrinsicFromMappedKey)(t,e,r):(0,smt.IsTemplateLiteral)(t)?s4a(t,e,r):(0,smt.IsUnion)(t)?(0,YTi.Union)(JTi(t.anyOf,e),r):(0,smt.IsLiteral)(t)?(0,zTi.Literal)(KTi(t.const,e),r):(0,e4a.CreateType)(t,r)}a(ZTi,"Intrinsic")});var XTi=I(tCr=>{"use strict";p();Object.defineProperty(tCr,"__esModule",{value:!0});tCr.Capitalize=c4a;var a4a=mte();function c4a(t,e={}){return(0,a4a.Intrinsic)(t,"Capitalize",e)}a(c4a,"Capitalize")});var eIi=I(rCr=>{"use strict";p();Object.defineProperty(rCr,"__esModule",{value:!0});rCr.Lowercase=u4a;var l4a=mte();function u4a(t,e={}){return(0,l4a.Intrinsic)(t,"Lowercase",e)}a(u4a,"Lowercase")});var tIi=I(nCr=>{"use strict";p();Object.defineProperty(nCr,"__esModule",{value:!0});nCr.Uncapitalize=f4a;var d4a=mte();function f4a(t,e={}){return(0,d4a.Intrinsic)(t,"Uncapitalize",e)}a(f4a,"Uncapitalize")});var rIi=I(iCr=>{"use strict";p();Object.defineProperty(iCr,"__esModule",{value:!0});iCr.Uppercase=h4a;var p4a=mte();function h4a(t,e={}){return(0,p4a.Intrinsic)(t,"Uppercase",e)}a(h4a,"Uppercase")});var amt=I(aR=>{"use strict";p();var m4a=aR&&aR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ime=aR&&aR.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&m4a(e,t,r)};Object.defineProperty(aR,"__esModule",{value:!0});Ime(XTi(),aR);Ime(Xvr(),aR);Ime(mte(),aR);Ime(eIi(),aR);Ime(tIi(),aR);Ime(rIi(),aR)});var sCr=I(oCr=>{"use strict";p();Object.defineProperty(oCr,"__esModule",{value:!0});oCr.OmitFromMappedResult=v4a;var g4a=p0(),A4a=cmt(),y4a=Pb();function E4a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,A4a.Omit)(t[o],e,(0,y4a.Clone)(r));return n}a(E4a,"FromProperties");function _4a(t,e,r){return E4a(t.properties,e,r)}a(_4a,"FromMappedResult");function v4a(t,e,r){let n=_4a(t,e,r);return(0,g4a.MappedResult)(n)}a(v4a,"OmitFromMappedResult")});var cmt=I(lCr=>{"use strict";p();Object.defineProperty(lCr,"__esModule",{value:!0});lCr.Omit=L4a;var C4a=Si(),b4a=C0t(),S4a=LMe(),aCr=KH(),T4a=bE(),I4a=F2(),x4a=RT(),nIi=Ep(),iIi=cv(),w4a=uCr(),R4a=sCr(),I8=ms(),P4a=av();function k4a(t,e){return t.map(r=>cCr(r,e))}a(k4a,"FromIntersect");function D4a(t,e){return t.map(r=>cCr(r,e))}a(D4a,"FromUnion");function N4a(t,e){let{[e]:r,...n}=t;return n}a(N4a,"FromProperty");function M4a(t,e){return e.reduce((r,n)=>N4a(r,n),t)}a(M4a,"FromProperties");function O4a(t,e,r){let n=(0,b4a.Discard)(t,[S4a.TransformKind,"$id","required","properties"]),o=M4a(r,e);return(0,iIi.Object)(o,n)}a(O4a,"FromObject");function B4a(t){let e=t.reduce((r,n)=>(0,I8.IsLiteralValue)(n)?[...r,(0,T4a.Literal)(n)]:r,[]);return(0,nIi.Union)(e)}a(B4a,"UnionFromPropertyKeys");function cCr(t,e){return(0,I8.IsIntersect)(t)?(0,x4a.Intersect)(k4a(t.allOf,e)):(0,I8.IsUnion)(t)?(0,nIi.Union)(D4a(t.anyOf,e)):(0,I8.IsObject)(t)?O4a(t,e,t.properties):(0,iIi.Object)({})}a(cCr,"OmitResolve");function L4a(t,e,r){let n=(0,P4a.IsArray)(e)?B4a(e):e,o=(0,I8.IsSchema)(e)?(0,I4a.IndexPropertyKeys)(e):e,s=(0,I8.IsRef)(t),c=(0,I8.IsRef)(e);return(0,I8.IsMappedResult)(t)?(0,R4a.OmitFromMappedResult)(t,o,r):(0,I8.IsMappedKey)(e)?(0,w4a.OmitFromMappedKey)(t,e,r):s&&c?(0,aCr.Computed)("Omit",[t,n],r):!s&&c?(0,aCr.Computed)("Omit",[t,n],r):s&&!c?(0,aCr.Computed)("Omit",[t,n],r):(0,C4a.CreateType)({...cCr(t,o),...r})}a(L4a,"Omit")});var uCr=I(dCr=>{"use strict";p();Object.defineProperty(dCr,"__esModule",{value:!0});dCr.OmitFromMappedKey=G4a;var F4a=p0(),U4a=cmt(),Q4a=Pb();function q4a(t,e,r){return{[e]:(0,U4a.Omit)(t,[e],(0,Q4a.Clone)(r))}}a(q4a,"FromPropertyKey");function j4a(t,e,r){return e.reduce((n,o)=>({...n,...q4a(t,o,r)}),{})}a(j4a,"FromPropertyKeys");function H4a(t,e,r){return j4a(t,e.keys,r)}a(H4a,"FromMappedKey");function G4a(t,e,r){let n=H4a(t,e,r);return(0,F4a.MappedResult)(n)}a(G4a,"OmitFromMappedKey")});var aOe=I(x8=>{"use strict";p();var $4a=x8&&x8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fCr=x8&&x8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&$4a(e,t,r)};Object.defineProperty(x8,"__esModule",{value:!0});fCr(uCr(),x8);fCr(sCr(),x8);fCr(cmt(),x8)});var hCr=I(pCr=>{"use strict";p();Object.defineProperty(pCr,"__esModule",{value:!0});pCr.PickFromMappedResult=J4a;var V4a=p0(),W4a=lmt(),z4a=Pb();function Y4a(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=(0,W4a.Pick)(t[o],e,(0,z4a.Clone)(r));return n}a(Y4a,"FromProperties");function K4a(t,e,r){return Y4a(t.properties,e,r)}a(K4a,"FromMappedResult");function J4a(t,e,r){let n=K4a(t,e,r);return(0,V4a.MappedResult)(n)}a(J4a,"PickFromMappedResult")});var lmt=I(ACr=>{"use strict";p();Object.defineProperty(ACr,"__esModule",{value:!0});ACr.Pick=fBa;var Z4a=Si(),X4a=C0t(),mCr=KH(),eBa=RT(),tBa=bE(),oIi=cv(),sIi=Ep(),rBa=F2(),nBa=LMe(),w8=ms(),iBa=av(),oBa=yCr(),sBa=hCr();function aBa(t,e){return t.map(r=>gCr(r,e))}a(aBa,"FromIntersect");function cBa(t,e){return t.map(r=>gCr(r,e))}a(cBa,"FromUnion");function lBa(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(lBa,"FromProperties");function uBa(t,e,r){let n=(0,X4a.Discard)(t,[nBa.TransformKind,"$id","required","properties"]),o=lBa(r,e);return(0,oIi.Object)(o,n)}a(uBa,"FromObject");function dBa(t){let e=t.reduce((r,n)=>(0,w8.IsLiteralValue)(n)?[...r,(0,tBa.Literal)(n)]:r,[]);return(0,sIi.Union)(e)}a(dBa,"UnionFromPropertyKeys");function gCr(t,e){return(0,w8.IsIntersect)(t)?(0,eBa.Intersect)(aBa(t.allOf,e)):(0,w8.IsUnion)(t)?(0,sIi.Union)(cBa(t.anyOf,e)):(0,w8.IsObject)(t)?uBa(t,e,t.properties):(0,oIi.Object)({})}a(gCr,"PickResolve");function fBa(t,e,r){let n=(0,iBa.IsArray)(e)?dBa(e):e,o=(0,w8.IsSchema)(e)?(0,rBa.IndexPropertyKeys)(e):e,s=(0,w8.IsRef)(t),c=(0,w8.IsRef)(e);return(0,w8.IsMappedResult)(t)?(0,sBa.PickFromMappedResult)(t,o,r):(0,w8.IsMappedKey)(e)?(0,oBa.PickFromMappedKey)(t,e,r):s&&c?(0,mCr.Computed)("Pick",[t,n],r):!s&&c?(0,mCr.Computed)("Pick",[t,n],r):s&&!c?(0,mCr.Computed)("Pick",[t,n],r):(0,Z4a.CreateType)({...gCr(t,o),...r})}a(fBa,"Pick")});var yCr=I(ECr=>{"use strict";p();Object.defineProperty(ECr,"__esModule",{value:!0});ECr.PickFromMappedKey=EBa;var pBa=p0(),hBa=lmt(),mBa=Pb();function gBa(t,e,r){return{[e]:(0,hBa.Pick)(t,[e],(0,mBa.Clone)(r))}}a(gBa,"FromPropertyKey");function ABa(t,e,r){return e.reduce((n,o)=>({...n,...gBa(t,o,r)}),{})}a(ABa,"FromPropertyKeys");function yBa(t,e,r){return ABa(t,e.keys,r)}a(yBa,"FromMappedKey");function EBa(t,e,r){let n=yBa(t,e,r);return(0,pBa.MappedResult)(n)}a(EBa,"PickFromMappedKey")});var cOe=I(R8=>{"use strict";p();var _Ba=R8&&R8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),_Cr=R8&&R8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ba(e,t,r)};Object.defineProperty(R8,"__esModule",{value:!0});_Cr(yCr(),R8);_Cr(hCr(),R8);_Cr(lmt(),R8)});var CCr=I(P8=>{"use strict";p();var vBa=P8&&P8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CBa=P8&&P8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bBa=P8&&P8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;olIi(e))}a(aIi,"FromRest");function lIi(t){return uv.IsComputed(t)?DBa(t.target,t.parameters):uv.IsRef(t)?NBa(t.$ref):uv.IsIntersect(t)?(0,IBa.Intersect)(aIi(t.allOf)):uv.IsUnion(t)?(0,xBa.Union)(aIi(t.anyOf)):uv.IsObject(t)?OBa(t,t.properties):uv.IsBigInt(t)||uv.IsBoolean(t)||uv.IsInteger(t)||uv.IsLiteral(t)||uv.IsNull(t)||uv.IsNumber(t)||uv.IsString(t)||uv.IsSymbol(t)||uv.IsUndefined(t)?t:(0,cIi.Object)({})}a(lIi,"PartialResolve");function BBa(t,e){return uv.IsMappedResult(t)?(0,kBa.PartialFromMappedResult)(t,e):(0,SBa.CreateType)({...lIi(t),...e})}a(BBa,"Partial")});var bCr=I(SCr=>{"use strict";p();Object.defineProperty(SCr,"__esModule",{value:!0});SCr.PartialFromMappedResult=jBa;var LBa=p0(),FBa=CCr(),UBa=Pb();function QBa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,FBa.Partial)(t[n],(0,UBa.Clone)(e));return r}a(QBa,"FromProperties");function qBa(t,e){return QBa(t.properties,e)}a(qBa,"FromMappedResult");function jBa(t,e){let r=qBa(t,e);return(0,LBa.MappedResult)(r)}a(jBa,"PartialFromMappedResult")});var lOe=I(sG=>{"use strict";p();var HBa=sG&&sG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uIi=sG&&sG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HBa(e,t,r)};Object.defineProperty(sG,"__esModule",{value:!0});uIi(bCr(),sG);uIi(CCr(),sG)});var ICr=I(k8=>{"use strict";p();var GBa=k8&&k8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ba=k8&&k8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VBa=k8&&k8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;omIi(e))}a(dIi,"FromRest");function mIi(t){return dv.IsComputed(t)?ZBa(t.target,t.parameters):dv.IsRef(t)?XBa(t.$ref):dv.IsIntersect(t)?(0,zBa.Intersect)(dIi(t.allOf)):dv.IsUnion(t)?(0,YBa.Union)(dIi(t.anyOf)):dv.IsObject(t)?tLa(t,t.properties):dv.IsBigInt(t)||dv.IsBoolean(t)||dv.IsInteger(t)||dv.IsLiteral(t)||dv.IsNull(t)||dv.IsNumber(t)||dv.IsString(t)||dv.IsSymbol(t)||dv.IsUndefined(t)?t:(0,fIi.Object)({})}a(mIi,"RequiredResolve");function rLa(t,e){return dv.IsMappedResult(t)?(0,JBa.RequiredFromMappedResult)(t,e):(0,WBa.CreateType)({...mIi(t),...e})}a(rLa,"Required")});var xCr=I(wCr=>{"use strict";p();Object.defineProperty(wCr,"__esModule",{value:!0});wCr.RequiredFromMappedResult=aLa;var nLa=p0(),iLa=ICr();function oLa(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=(0,iLa.Required)(t[n],e);return r}a(oLa,"FromProperties");function sLa(t,e){return oLa(t.properties,e)}a(sLa,"FromMappedResult");function aLa(t,e){let r=sLa(t,e);return(0,nLa.MappedResult)(r)}a(aLa,"RequiredFromMappedResult")});var uOe=I(aG=>{"use strict";p();var cLa=aG&&aG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gIi=aG&&aG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cLa(e,t,r)};Object.defineProperty(aG,"__esModule",{value:!0});gIi(xCr(),aG);gIi(ICr(),aG)});var _Ii=I(j2=>{"use strict";p();var lLa=j2&&j2.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uLa=j2&&j2.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dLa=j2&&j2.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oey.IsRef(r)?PCr(t,r.$ref):Fb(t,r))}a(RLa,"DereferenceParameters");function PCr(t,e){return e in t?ey.IsRef(t[e])?PCr(t,t[e].$ref):Fb(t,t[e]):(0,RCr.Never)()}a(PCr,"Dereference");function PLa(t){return(0,hLa.Awaited)(t[0])}a(PLa,"FromAwaited");function kLa(t){return(0,ALa.Index)(t[0],t[1])}a(kLa,"FromIndex");function DLa(t){return(0,vLa.KeyOf)(t[0])}a(DLa,"FromKeyOf");function NLa(t){return(0,TLa.Partial)(t[0])}a(NLa,"FromPartial");function MLa(t){return(0,bLa.Omit)(t[0],t[1])}a(MLa,"FromOmit");function OLa(t){return(0,SLa.Pick)(t[0],t[1])}a(OLa,"FromPick");function BLa(t){return(0,ILa.Required)(t[0])}a(BLa,"FromRequired");function LLa(t,e,r){let n=RLa(t,r);return e==="Awaited"?PLa(n):e==="Index"?kLa(n):e==="KeyOf"?DLa(n):e==="Partial"?NLa(n):e==="Omit"?MLa(n):e==="Pick"?OLa(n):e==="Required"?BLa(n):(0,RCr.Never)()}a(LLa,"FromComputed");function FLa(t,e){return(0,pLa.Array)(Fb(t,e))}a(FLa,"FromArray");function ULa(t,e){return(0,mLa.AsyncIterator)(Fb(t,e))}a(ULa,"FromAsyncIterator");function QLa(t,e,r){return(0,gLa.Constructor)(dOe(t,e),Fb(t,r))}a(QLa,"FromConstructor");function qLa(t,e,r){return(0,yLa.Function)(dOe(t,e),Fb(t,r))}a(qLa,"FromFunction");function jLa(t,e){return(0,ELa.Intersect)(dOe(t,e))}a(jLa,"FromIntersect");function HLa(t,e){return(0,_La.Iterator)(Fb(t,e))}a(HLa,"FromIterator");function GLa(t,e){return(0,CLa.Object)(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:Fb(t,e[n])}),{}))}a(GLa,"FromObject");function $La(t,e){let[r,n]=[Fb(t,(0,yIi.RecordValue)(e)),(0,yIi.RecordPattern)(e)],o=(0,fLa.CloneType)(e);return o.patternProperties[n]=r,o}a($La,"FromRecord");function VLa(t,e){return ey.IsRef(e)?{...PCr(t,e.$ref),[umt.TransformKind]:e[umt.TransformKind]}:e}a(VLa,"FromTransform");function WLa(t,e){return(0,xLa.Tuple)(dOe(t,e))}a(WLa,"FromTuple");function zLa(t,e){return(0,wLa.Union)(dOe(t,e))}a(zLa,"FromUnion");function dOe(t,e){return e.map(r=>Fb(t,r))}a(dOe,"FromTypes");function Fb(t,e){return ey.IsOptional(e)?(0,Lb.CreateType)(Fb(t,(0,AIi.Discard)(e,[umt.OptionalKind])),e):ey.IsReadonly(e)?(0,Lb.CreateType)(Fb(t,(0,AIi.Discard)(e,[umt.ReadonlyKind])),e):ey.IsTransform(e)?(0,Lb.CreateType)(VLa(t,e),e):ey.IsArray(e)?(0,Lb.CreateType)(FLa(t,e.items),e):ey.IsAsyncIterator(e)?(0,Lb.CreateType)(ULa(t,e.items),e):ey.IsComputed(e)?(0,Lb.CreateType)(LLa(t,e.target,e.parameters)):ey.IsConstructor(e)?(0,Lb.CreateType)(QLa(t,e.parameters,e.returns),e):ey.IsFunction(e)?(0,Lb.CreateType)(qLa(t,e.parameters,e.returns),e):ey.IsIntersect(e)?(0,Lb.CreateType)(jLa(t,e.allOf),e):ey.IsIterator(e)?(0,Lb.CreateType)(HLa(t,e.items),e):ey.IsObject(e)?(0,Lb.CreateType)(GLa(t,e.properties),e):ey.IsRecord(e)?(0,Lb.CreateType)($La(t,e)):ey.IsTuple(e)?(0,Lb.CreateType)(WLa(t,e.items||[]),e):ey.IsUnion(e)?(0,Lb.CreateType)(zLa(t,e.anyOf),e):e}a(Fb,"FromType");function EIi(t,e){return e in t?Fb(t,t[e]):(0,RCr.Never)()}a(EIi,"ComputeType");function YLa(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:EIi(t,r)}),{})}a(YLa,"ComputeModuleProperties")});var CIi=I(fOe=>{"use strict";p();Object.defineProperty(fOe,"__esModule",{value:!0});fOe.TModule=void 0;fOe.Module=ZLa;var vIi=h8(),KLa=_n(),JLa=_Ii(),dmt=class{static{a(this,"TModule")}constructor(e){let r=(0,JLa.ComputeModuleProperties)(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:(0,vIi.CreateType)(this.$defs[e],r)};return(0,vIi.CreateType)({[KLa.Kind]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};fOe.TModule=dmt;function ZLa(t){return new dmt(t)}a(ZLa,"Module")});var fmt=I(gte=>{"use strict";p();var XLa=gte&>e.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),e3a=gte&>e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XLa(e,t,r)};Object.defineProperty(gte,"__esModule",{value:!0});e3a(CIi(),gte)});var bIi=I(kCr=>{"use strict";p();Object.defineProperty(kCr,"__esModule",{value:!0});kCr.Not=n3a;var t3a=Si(),r3a=_n();function n3a(t,e){return(0,t3a.CreateType)({[r3a.Kind]:"Not",not:t},e)}a(n3a,"Not")});var pmt=I(Ate=>{"use strict";p();var i3a=Ate&&Ate.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o3a=Ate&&Ate.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&i3a(e,t,r)};Object.defineProperty(Ate,"__esModule",{value:!0});o3a(bIi(),Ate)});var SIi=I(D8=>{"use strict";p();var s3a=D8&&D8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),a3a=D8&&D8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),c3a=D8&&D8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var p3a=yte&&yte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),h3a=yte&&yte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p3a(e,t,r)};Object.defineProperty(yte,"__esModule",{value:!0});h3a(SIi(),yte)});var IIi=I(DCr=>{"use strict";p();Object.defineProperty(DCr,"__esModule",{value:!0});DCr.Recursive=E3a;var m3a=h0t(),g3a=Si(),A3a=av(),TIi=_n(),y3a=0;function E3a(t,e={}){(0,A3a.IsUndefined)(e.$id)&&(e.$id=`T${y3a++}`);let r=(0,m3a.CloneType)(t({[TIi.Kind]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,(0,g3a.CreateType)({[TIi.Hint]:"Recursive",...r},e)}a(E3a,"Recursive")});var mmt=I(Ete=>{"use strict";p();var _3a=Ete&&Ete.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v3a=Ete&&Ete.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_3a(e,t,r)};Object.defineProperty(Ete,"__esModule",{value:!0});v3a(IIi(),Ete)});var xIi=I(NCr=>{"use strict";p();Object.defineProperty(NCr,"__esModule",{value:!0});NCr.RegExp=T3a;var C3a=Si(),b3a=av(),S3a=_n();function T3a(t,e){let r=(0,b3a.IsString)(t)?new globalThis.RegExp(t):t;return(0,C3a.CreateType)({[S3a.Kind]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(T3a,"RegExp")});var gmt=I(_te=>{"use strict";p();var I3a=_te&&_te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x3a=_te&&_te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I3a(e,t,r)};Object.defineProperty(_te,"__esModule",{value:!0});x3a(xIi(),_te)});var wIi=I(OCr=>{"use strict";p();Object.defineProperty(OCr,"__esModule",{value:!0});OCr.Rest=R3a;var MCr=ms();function w3a(t){return(0,MCr.IsIntersect)(t)?t.allOf:(0,MCr.IsUnion)(t)?t.anyOf:(0,MCr.IsTuple)(t)?t.items??[]:[]}a(w3a,"RestResolve");function R3a(t){return w3a(t)}a(R3a,"Rest")});var Amt=I(vte=>{"use strict";p();var P3a=vte&&vte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),k3a=vte&&vte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&P3a(e,t,r)};Object.defineProperty(vte,"__esModule",{value:!0});k3a(wIi(),vte)});var RIi=I(N8=>{"use strict";p();var D3a=N8&&N8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N3a=N8&&N8.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M3a=N8&&N8.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var U3a=Cte&&Cte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Q3a=Cte&&Cte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U3a(e,t,r)};Object.defineProperty(Cte,"__esModule",{value:!0});Q3a(RIi(),Cte)});var kIi=I(PIi=>{"use strict";p();Object.defineProperty(PIi,"__esModule",{value:!0})});var NIi=I(DIi=>{"use strict";p();Object.defineProperty(DIi,"__esModule",{value:!0});var BEp=_n()});var OIi=I(cG=>{"use strict";p();var q3a=cG&&cG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MIi=cG&&cG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&q3a(e,t,r)};Object.defineProperty(cG,"__esModule",{value:!0});MIi(kIi(),cG);MIi(NIi(),cG)});var LIi=I(BIi=>{"use strict";p();Object.defineProperty(BIi,"__esModule",{value:!0})});var FIi=I(bte=>{"use strict";p();var j3a=bte&&bte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),H3a=bte&&bte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&j3a(e,t,r)};Object.defineProperty(bte,"__esModule",{value:!0});H3a(LIi(),bte)});var UIi=I(Ste=>{"use strict";p();Object.defineProperty(Ste,"__esModule",{value:!0});Ste.TransformEncodeBuilder=Ste.TransformDecodeBuilder=void 0;Ste.Transform=$3a;var Emt=_n(),G3a=ms(),_mt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new vmt(this.schema,e)}};Ste.TransformDecodeBuilder=_mt;var vmt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Emt.TransformKind].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Emt.TransformKind].Decode(c)),"Decode")};return{...r,[Emt.TransformKind]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Emt.TransformKind]:n}}Encode(e){return(0,G3a.IsTransform)(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};Ste.TransformEncodeBuilder=vmt;function $3a(t){return new _mt(t)}a($3a,"Transform")});var Cmt=I(Tte=>{"use strict";p();var V3a=Tte&&Tte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),W3a=Tte&&Tte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&V3a(e,t,r)};Object.defineProperty(Tte,"__esModule",{value:!0});W3a(UIi(),Tte)});var qIi=I(BCr=>{"use strict";p();Object.defineProperty(BCr,"__esModule",{value:!0});BCr.Unsafe=Y3a;var z3a=Si(),QIi=_n();function Y3a(t={}){return(0,z3a.CreateType)({[QIi.Kind]:t[QIi.Kind]??"Unsafe"},t)}a(Y3a,"Unsafe")});var pOe=I(Ite=>{"use strict";p();var K3a=Ite&&Ite.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J3a=Ite&&Ite.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&K3a(e,t,r)};Object.defineProperty(Ite,"__esModule",{value:!0});J3a(qIi(),Ite)});var jIi=I(LCr=>{"use strict";p();Object.defineProperty(LCr,"__esModule",{value:!0});LCr.Void=eFa;var Z3a=Si(),X3a=_n();function eFa(t){return(0,Z3a.CreateType)({[X3a.Kind]:"Void",type:"void"},t)}a(eFa,"Void")});var bmt=I(xte=>{"use strict";p();var tFa=xte&&xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rFa=xte&&xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tFa(e,t,r)};Object.defineProperty(xte,"__esModule",{value:!0});rFa(jIi(),xte)});var UCr=I(Tmt=>{"use strict";p();Object.defineProperty(Tmt,"__esModule",{value:!0});Tmt.JsonTypeBuilder=void 0;var nFa=ume(),iFa=dme(),oFa=$Me(),sFa=U0t(),aFa=q0t(),cFa=H0t(),lFa=Z0t(),uFa=ate(),dFa=tmt(),fFa=F2(),pFa=imt(),hFa=RT(),Smt=amt(),mFa=U2(),gFa=bE(),AFa=p0(),yFa=f0(),EFa=pmt(),_Fa=tOe(),vFa=fmt(),CFa=ZH(),bFa=cv(),SFa=aOe(),TFa=a4(),IFa=lOe(),xFa=cOe(),wFa=rG(),RFa=sOe(),PFa=Sme(),kFa=mmt(),DFa=iG(),NFa=uOe(),MFa=Amt(),OFa=XH(),BFa=L2(),LFa=Cmt(),FFa=E8(),UFa=Ep(),QFa=oG(),qFa=pOe(),FCr=class{static{a(this,"JsonTypeBuilder")}ReadonlyOptional(e){return(0,RFa.ReadonlyOptional)(e)}Readonly(e,r){return(0,wFa.Readonly)(e,r??!0)}Optional(e,r){return(0,TFa.Optional)(e,r??!0)}Any(e){return(0,nFa.Any)(e)}Array(e,r){return(0,iFa.Array)(e,r)}Boolean(e){return(0,oFa.Boolean)(e)}Capitalize(e,r){return(0,Smt.Capitalize)(e,r)}Composite(e,r){return(0,sFa.Composite)(e,r)}Const(e,r){return(0,aFa.Const)(e,r)}Enum(e,r){return(0,cFa.Enum)(e,r)}Exclude(e,r,n){return(0,lFa.Exclude)(e,r,n)}Extends(e,r,n,o,s){return(0,uFa.Extends)(e,r,n,o,s)}Extract(e,r,n){return(0,dFa.Extract)(e,r,n)}Index(e,r,n){return(0,fFa.Index)(e,r,n)}Integer(e){return(0,pFa.Integer)(e)}Intersect(e,r){return(0,hFa.Intersect)(e,r)}KeyOf(e,r){return(0,mFa.KeyOf)(e,r)}Literal(e,r){return(0,gFa.Literal)(e,r)}Lowercase(e,r){return(0,Smt.Lowercase)(e,r)}Mapped(e,r,n){return(0,AFa.Mapped)(e,r,n)}Module(e){return(0,vFa.Module)(e)}Never(e){return(0,yFa.Never)(e)}Not(e,r){return(0,EFa.Not)(e,r)}Null(e){return(0,_Fa.Null)(e)}Number(e){return(0,CFa.Number)(e)}Object(e,r){return(0,bFa.Object)(e,r)}Omit(e,r,n){return(0,SFa.Omit)(e,r,n)}Partial(e,r){return(0,IFa.Partial)(e,r)}Pick(e,r,n){return(0,xFa.Pick)(e,r,n)}Record(e,r,n){return(0,PFa.Record)(e,r,n)}Recursive(e,r){return(0,kFa.Recursive)(e,r)}Ref(...e){return(0,DFa.Ref)(e[0],e[1])}Required(e,r){return(0,NFa.Required)(e,r)}Rest(e){return(0,MFa.Rest)(e)}String(e){return(0,OFa.String)(e)}TemplateLiteral(e,r){return(0,BFa.TemplateLiteral)(e,r)}Transform(e){return(0,LFa.Transform)(e)}Tuple(e,r){return(0,FFa.Tuple)(e,r)}Uncapitalize(e,r){return(0,Smt.Uncapitalize)(e,r)}Union(e,r){return(0,UFa.Union)(e,r)}Unknown(e){return(0,QFa.Unknown)(e)}Unsafe(e){return(0,qFa.Unsafe)(e)}Uppercase(e,r){return(0,Smt.Uppercase)(e,r)}};Tmt.JsonTypeBuilder=FCr});var HIi=I(Mt=>{"use strict";p();Object.defineProperty(Mt,"__esModule",{value:!0});Mt.Rest=Mt.Required=Mt.RegExp=Mt.Ref=Mt.Recursive=Mt.Record=Mt.ReadonlyOptional=Mt.Readonly=Mt.Promise=Mt.Pick=Mt.Partial=Mt.Parameters=Mt.Optional=Mt.Omit=Mt.Object=Mt.Number=Mt.Null=Mt.Not=Mt.Never=Mt.Module=Mt.Mapped=Mt.Literal=Mt.KeyOf=Mt.Iterator=Mt.Uppercase=Mt.Lowercase=Mt.Uncapitalize=Mt.Capitalize=Mt.Intersect=Mt.Integer=Mt.Instantiate=Mt.InstanceType=Mt.Index=Mt.Function=Mt.Extract=Mt.Extends=Mt.Exclude=Mt.Enum=Mt.Date=Mt.ConstructorParameters=Mt.Constructor=Mt.Const=Mt.Composite=Mt.Boolean=Mt.BigInt=Mt.Awaited=Mt.AsyncIterator=Mt.Array=Mt.Argument=Mt.Any=void 0;Mt.Void=Mt.Unsafe=Mt.Unknown=Mt.Union=Mt.Undefined=Mt.Uint8Array=Mt.Tuple=Mt.Transform=Mt.TemplateLiteral=Mt.Symbol=Mt.String=Mt.ReturnType=void 0;var jFa=ume();Object.defineProperty(Mt,"Any",{enumerable:!0,get:a(function(){return jFa.Any},"get")});var HFa=v0t();Object.defineProperty(Mt,"Argument",{enumerable:!0,get:a(function(){return HFa.Argument},"get")});var GFa=dme();Object.defineProperty(Mt,"Array",{enumerable:!0,get:a(function(){return GFa.Array},"get")});var $Fa=fme();Object.defineProperty(Mt,"AsyncIterator",{enumerable:!0,get:a(function(){return $Fa.AsyncIterator},"get")});var VFa=XMe();Object.defineProperty(Mt,"Awaited",{enumerable:!0,get:a(function(){return VFa.Awaited},"get")});var WFa=Ame();Object.defineProperty(Mt,"BigInt",{enumerable:!0,get:a(function(){return WFa.BigInt},"get")});var zFa=$Me();Object.defineProperty(Mt,"Boolean",{enumerable:!0,get:a(function(){return zFa.Boolean},"get")});var YFa=U0t();Object.defineProperty(Mt,"Composite",{enumerable:!0,get:a(function(){return YFa.Composite},"get")});var KFa=q0t();Object.defineProperty(Mt,"Const",{enumerable:!0,get:a(function(){return KFa.Const},"get")});var JFa=pme();Object.defineProperty(Mt,"Constructor",{enumerable:!0,get:a(function(){return JFa.Constructor},"get")});var ZFa=j0t();Object.defineProperty(Mt,"ConstructorParameters",{enumerable:!0,get:a(function(){return ZFa.ConstructorParameters},"get")});var XFa=eOe();Object.defineProperty(Mt,"Date",{enumerable:!0,get:a(function(){return XFa.Date},"get")});var e8a=H0t();Object.defineProperty(Mt,"Enum",{enumerable:!0,get:a(function(){return e8a.Enum},"get")});var t8a=Z0t();Object.defineProperty(Mt,"Exclude",{enumerable:!0,get:a(function(){return t8a.Exclude},"get")});var r8a=ate();Object.defineProperty(Mt,"Extends",{enumerable:!0,get:a(function(){return r8a.Extends},"get")});var n8a=tmt();Object.defineProperty(Mt,"Extract",{enumerable:!0,get:a(function(){return n8a.Extract},"get")});var i8a=JH();Object.defineProperty(Mt,"Function",{enumerable:!0,get:a(function(){return i8a.Function},"get")});var o8a=F2();Object.defineProperty(Mt,"Index",{enumerable:!0,get:a(function(){return o8a.Index},"get")});var s8a=rmt();Object.defineProperty(Mt,"InstanceType",{enumerable:!0,get:a(function(){return s8a.InstanceType},"get")});var a8a=nmt();Object.defineProperty(Mt,"Instantiate",{enumerable:!0,get:a(function(){return a8a.Instantiate},"get")});var c8a=imt();Object.defineProperty(Mt,"Integer",{enumerable:!0,get:a(function(){return c8a.Integer},"get")});var l8a=RT();Object.defineProperty(Mt,"Intersect",{enumerable:!0,get:a(function(){return l8a.Intersect},"get")});var Imt=amt();Object.defineProperty(Mt,"Capitalize",{enumerable:!0,get:a(function(){return Imt.Capitalize},"get")});Object.defineProperty(Mt,"Uncapitalize",{enumerable:!0,get:a(function(){return Imt.Uncapitalize},"get")});Object.defineProperty(Mt,"Lowercase",{enumerable:!0,get:a(function(){return Imt.Lowercase},"get")});Object.defineProperty(Mt,"Uppercase",{enumerable:!0,get:a(function(){return Imt.Uppercase},"get")});var u8a=Eme();Object.defineProperty(Mt,"Iterator",{enumerable:!0,get:a(function(){return u8a.Iterator},"get")});var d8a=U2();Object.defineProperty(Mt,"KeyOf",{enumerable:!0,get:a(function(){return d8a.KeyOf},"get")});var f8a=bE();Object.defineProperty(Mt,"Literal",{enumerable:!0,get:a(function(){return f8a.Literal},"get")});var p8a=p0();Object.defineProperty(Mt,"Mapped",{enumerable:!0,get:a(function(){return p8a.Mapped},"get")});var h8a=fmt();Object.defineProperty(Mt,"Module",{enumerable:!0,get:a(function(){return h8a.Module},"get")});var m8a=f0();Object.defineProperty(Mt,"Never",{enumerable:!0,get:a(function(){return m8a.Never},"get")});var g8a=pmt();Object.defineProperty(Mt,"Not",{enumerable:!0,get:a(function(){return g8a.Not},"get")});var A8a=tOe();Object.defineProperty(Mt,"Null",{enumerable:!0,get:a(function(){return A8a.Null},"get")});var y8a=ZH();Object.defineProperty(Mt,"Number",{enumerable:!0,get:a(function(){return y8a.Number},"get")});var E8a=cv();Object.defineProperty(Mt,"Object",{enumerable:!0,get:a(function(){return E8a.Object},"get")});var _8a=aOe();Object.defineProperty(Mt,"Omit",{enumerable:!0,get:a(function(){return _8a.Omit},"get")});var v8a=a4();Object.defineProperty(Mt,"Optional",{enumerable:!0,get:a(function(){return v8a.Optional},"get")});var C8a=hmt();Object.defineProperty(Mt,"Parameters",{enumerable:!0,get:a(function(){return C8a.Parameters},"get")});var b8a=lOe();Object.defineProperty(Mt,"Partial",{enumerable:!0,get:a(function(){return b8a.Partial},"get")});var S8a=cOe();Object.defineProperty(Mt,"Pick",{enumerable:!0,get:a(function(){return S8a.Pick},"get")});var T8a=KMe();Object.defineProperty(Mt,"Promise",{enumerable:!0,get:a(function(){return T8a.Promise},"get")});var I8a=rG();Object.defineProperty(Mt,"Readonly",{enumerable:!0,get:a(function(){return I8a.Readonly},"get")});var x8a=sOe();Object.defineProperty(Mt,"ReadonlyOptional",{enumerable:!0,get:a(function(){return x8a.ReadonlyOptional},"get")});var w8a=Sme();Object.defineProperty(Mt,"Record",{enumerable:!0,get:a(function(){return w8a.Record},"get")});var R8a=mmt();Object.defineProperty(Mt,"Recursive",{enumerable:!0,get:a(function(){return R8a.Recursive},"get")});var P8a=iG();Object.defineProperty(Mt,"Ref",{enumerable:!0,get:a(function(){return P8a.Ref},"get")});var k8a=gmt();Object.defineProperty(Mt,"RegExp",{enumerable:!0,get:a(function(){return k8a.RegExp},"get")});var D8a=uOe();Object.defineProperty(Mt,"Required",{enumerable:!0,get:a(function(){return D8a.Required},"get")});var N8a=Amt();Object.defineProperty(Mt,"Rest",{enumerable:!0,get:a(function(){return N8a.Rest},"get")});var M8a=ymt();Object.defineProperty(Mt,"ReturnType",{enumerable:!0,get:a(function(){return M8a.ReturnType},"get")});var O8a=XH();Object.defineProperty(Mt,"String",{enumerable:!0,get:a(function(){return O8a.String},"get")});var B8a=rOe();Object.defineProperty(Mt,"Symbol",{enumerable:!0,get:a(function(){return B8a.Symbol},"get")});var L8a=L2();Object.defineProperty(Mt,"TemplateLiteral",{enumerable:!0,get:a(function(){return L8a.TemplateLiteral},"get")});var F8a=Cmt();Object.defineProperty(Mt,"Transform",{enumerable:!0,get:a(function(){return F8a.Transform},"get")});var U8a=E8();Object.defineProperty(Mt,"Tuple",{enumerable:!0,get:a(function(){return U8a.Tuple},"get")});var Q8a=iOe();Object.defineProperty(Mt,"Uint8Array",{enumerable:!0,get:a(function(){return Q8a.Uint8Array},"get")});var q8a=nOe();Object.defineProperty(Mt,"Undefined",{enumerable:!0,get:a(function(){return q8a.Undefined},"get")});var j8a=Ep();Object.defineProperty(Mt,"Union",{enumerable:!0,get:a(function(){return j8a.Union},"get")});var H8a=oG();Object.defineProperty(Mt,"Unknown",{enumerable:!0,get:a(function(){return H8a.Unknown},"get")});var G8a=pOe();Object.defineProperty(Mt,"Unsafe",{enumerable:!0,get:a(function(){return G8a.Unsafe},"get")});var $8a=bmt();Object.defineProperty(Mt,"Void",{enumerable:!0,get:a(function(){return $8a.Void},"get")})});var GIi=I(xmt=>{"use strict";p();Object.defineProperty(xmt,"__esModule",{value:!0});xmt.JavaScriptTypeBuilder=void 0;var V8a=UCr(),W8a=v0t(),z8a=fme(),Y8a=XMe(),K8a=Ame(),J8a=pme(),Z8a=j0t(),X8a=eOe(),e6a=JH(),t6a=rmt(),r6a=nmt(),n6a=Eme(),i6a=hmt(),o6a=KMe(),s6a=gmt(),a6a=ymt(),c6a=rOe(),l6a=iOe(),u6a=nOe(),d6a=bmt(),QCr=class extends V8a.JsonTypeBuilder{static{a(this,"JavaScriptTypeBuilder")}Argument(e){return(0,W8a.Argument)(e)}AsyncIterator(e,r){return(0,z8a.AsyncIterator)(e,r)}Awaited(e,r){return(0,Y8a.Awaited)(e,r)}BigInt(e){return(0,K8a.BigInt)(e)}ConstructorParameters(e,r){return(0,Z8a.ConstructorParameters)(e,r)}Constructor(e,r,n){return(0,J8a.Constructor)(e,r,n)}Date(e={}){return(0,X8a.Date)(e)}Function(e,r,n){return(0,e6a.Function)(e,r,n)}InstanceType(e,r){return(0,t6a.InstanceType)(e,r)}Instantiate(e,r){return(0,r6a.Instantiate)(e,r)}Iterator(e,r){return(0,n6a.Iterator)(e,r)}Parameters(e,r){return(0,i6a.Parameters)(e,r)}Promise(e,r){return(0,o6a.Promise)(e,r)}RegExp(e,r){return(0,s6a.RegExp)(e,r)}ReturnType(e,r){return(0,a6a.ReturnType)(e,r)}Symbol(e){return(0,c6a.Symbol)(e)}Undefined(e){return(0,u6a.Undefined)(e)}Uint8Array(e){return(0,l6a.Uint8Array)(e)}Void(e){return(0,d6a.Void)(e)}};xmt.JavaScriptTypeBuilder=QCr});var $Ii=I(Ub=>{"use strict";p();var f6a=Ub&&Ub.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p6a=Ub&&Ub.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h6a=Ub&&Ub.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var E6a=Xr&&Xr.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hn=Xr&&Xr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E6a(e,t,r)};Object.defineProperty(Xr,"__esModule",{value:!0});hn(PEr(),Xr);hn(h8(),Xr);hn(Sf(),Xr);hn(UEr(),Xr);hn(V1i(),Xr);hn(qMe(),Xr);hn(lme(),Xr);hn(jMe(),Xr);hn(_n(),Xr);hn(ume(),Xr);hn(dme(),Xr);hn(v0t(),Xr);hn(fme(),Xr);hn(XMe(),Xr);hn(Ame(),Xr);hn($Me(),Xr);hn(U0t(),Xr);hn(q0t(),Xr);hn(pme(),Xr);hn(j0t(),Xr);hn(eOe(),Xr);hn(H0t(),Xr);hn(Z0t(),Xr);hn(ate(),Xr);hn(tmt(),Xr);hn(JH(),Xr);hn(F2(),Xr);hn(rmt(),Xr);hn(nmt(),Xr);hn(imt(),Xr);hn(RT(),Xr);hn(Eme(),Xr);hn(amt(),Xr);hn(U2(),Xr);hn(bE(),Xr);hn(fmt(),Xr);hn(p0(),Xr);hn(f0(),Xr);hn(pmt(),Xr);hn(tOe(),Xr);hn(ZH(),Xr);hn(cv(),Xr);hn(aOe(),Xr);hn(a4(),Xr);hn(hmt(),Xr);hn(lOe(),Xr);hn(cOe(),Xr);hn(KMe(),Xr);hn(rG(),Xr);hn(sOe(),Xr);hn(Sme(),Xr);hn(mmt(),Xr);hn(iG(),Xr);hn(gmt(),Xr);hn(uOe(),Xr);hn(Amt(),Xr);hn(ymt(),Xr);hn(OIi(),Xr);hn(FIi(),Xr);hn(XH(),Xr);hn(rOe(),Xr);hn(L2(),Xr);hn(Cmt(),Xr);hn(E8(),Xr);hn(iOe(),Xr);hn(nOe(),Xr);hn(Ep(),Xr);hn(oG(),Xr);hn(pOe(),Xr);hn(bmt(),Xr);hn($Ii(),Xr)});var WIi=I(cR=>{"use strict";p();var _6a=cR&&cR.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),v6a=cR&&cR.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C6a=cR&&cR.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var S6a=f4&&f4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),T6a=f4&&f4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),I6a=f4&&f4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Rmt,"__esModule",{value:!0});Rmt.ContextItemOrigin=void 0;var KIi;(function(t){function e(r){return r==="request"||r==="update"}a(e,"is"),t.is=e})(KIi||(Rmt.ContextItemOrigin=KIi={}))});var XIi=I(Iu=>{"use strict";p();Object.defineProperty(Iu,"__esModule",{value:!0});Iu.RangeSchema=Iu.WorkspaceFolder=Iu.VersionedTextDocumentIdentifier=Iu.TextEdit=Iu.TextDocumentItem=Iu.Range=Iu.Position=Iu.DocumentUri=Iu.Disposable=Iu.Command=Iu.CancellationTokenSource=Iu.CancellationToken=void 0;var Pmt=wmt(),H2=ei();Object.defineProperty(Iu,"CancellationToken",{enumerable:!0,get:a(function(){return H2.CancellationToken},"get")});Object.defineProperty(Iu,"CancellationTokenSource",{enumerable:!0,get:a(function(){return H2.CancellationTokenSource},"get")});Object.defineProperty(Iu,"Command",{enumerable:!0,get:a(function(){return H2.Command},"get")});Object.defineProperty(Iu,"Disposable",{enumerable:!0,get:a(function(){return H2.Disposable},"get")});Object.defineProperty(Iu,"DocumentUri",{enumerable:!0,get:a(function(){return H2.DocumentUri},"get")});Object.defineProperty(Iu,"Position",{enumerable:!0,get:a(function(){return H2.Position},"get")});Object.defineProperty(Iu,"Range",{enumerable:!0,get:a(function(){return H2.Range},"get")});Object.defineProperty(Iu,"TextDocumentItem",{enumerable:!0,get:a(function(){return H2.TextDocumentItem},"get")});Object.defineProperty(Iu,"TextEdit",{enumerable:!0,get:a(function(){return H2.TextEdit},"get")});Object.defineProperty(Iu,"VersionedTextDocumentIdentifier",{enumerable:!0,get:a(function(){return H2.VersionedTextDocumentIdentifier},"get")});Object.defineProperty(Iu,"WorkspaceFolder",{enumerable:!0,get:a(function(){return H2.WorkspaceFolder},"get")});var ZIi=Pmt.Type.Object({line:Pmt.Type.Integer({minimum:0}),character:Pmt.Type.Integer({minimum:0})});Iu.RangeSchema=Pmt.Type.Object({start:ZIi,end:ZIi})});var txi=I(exi=>{"use strict";p();Object.defineProperty(exi,"__esModule",{value:!0})});var mOe=I(Tf=>{"use strict";p();var w6a=Tf&&Tf.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hOe=Tf&&Tf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w6a(e,t,r)};Object.defineProperty(Tf,"__esModule",{value:!0});Tf.TextEdit=Tf.Range=Tf.Position=Tf.Disposable=Tf.CancellationTokenSource=Tf.CancellationToken=void 0;var xme=ei();Object.defineProperty(Tf,"CancellationToken",{enumerable:!0,get:a(function(){return xme.CancellationToken},"get")});Object.defineProperty(Tf,"CancellationTokenSource",{enumerable:!0,get:a(function(){return xme.CancellationTokenSource},"get")});Object.defineProperty(Tf,"Disposable",{enumerable:!0,get:a(function(){return xme.Disposable},"get")});Object.defineProperty(Tf,"Position",{enumerable:!0,get:a(function(){return xme.Position},"get")});Object.defineProperty(Tf,"Range",{enumerable:!0,get:a(function(){return xme.Range},"get")});Object.defineProperty(Tf,"TextEdit",{enumerable:!0,get:a(function(){return xme.TextEdit},"get")});hOe(WIi(),Tf);hOe(YIi(),Tf);hOe(JIi(),Tf);hOe(XIi(),Tf);hOe(txi(),Tf)});var jCr=I(PT=>{"use strict";p();var R6a=PT&&PT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},rxi=PT&&PT.__param||function(t,e){return function(r,n){e(r,n,t)}},P6a=PT&&PT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(PT,"__esModule",{value:!0});PT.CompletionNotifier=PT.ICompletionsNotifierService=void 0;var k6a=P6a(require("events")),D6a=tn(),N6a=_ee(),M6a=mOe(),O6a=Ig(),B6a=PMe(),kmt="CompletionRequested";PT.ICompletionsNotifierService=(0,D6a.createServiceIdentifier)("ICompletionsNotifierService");var qCr=class{static{a(this,"CompletionNotifier")}#e=new k6a.default;constructor(e,r){this.completionsPromiseQueue=e,this.completionsTelemetryService=r}notifyRequest(e,r,n,o,s){return this.#e.emit(kmt,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=(0,O6a.telemetryCatch)(this.completionsTelemetryService,this.completionsPromiseQueue,e,`event.${kmt}`);return this.#e.on(kmt,r),M6a.Disposable.create(()=>this.#e.off(kmt,r))}};PT.CompletionNotifier=qCr;PT.CompletionNotifier=qCr=R6a([rxi(0,B6a.ICompletionsPromiseQueueService),rxi(1,N6a.ICompletionsTelemetryService)],qCr)});var HCr=I(Dmt=>{"use strict";p();Object.defineProperty(Dmt,"__esModule",{value:!0});Dmt.ICompletionsObservableWorkspace=void 0;var L6a=Ms();Dmt.ICompletionsObservableWorkspace=(0,L6a.createDecorator)("ICompletionsObservableWorkspace")});var Tl=I(G2=>{"use strict";p();Object.defineProperty(G2,"__esModule",{value:!0});G2.logger=G2.Logger=G2.ICompletionsLogTargetService=G2.LogLevel=void 0;var F6a=tn(),U6a=_ee(),Q6a=Ig(),wte;(function(t){t[t.DEBUG=4]="DEBUG",t[t.INFO=3]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=1]="ERROR"})(wte||(G2.LogLevel=wte={}));G2.ICompletionsLogTargetService=(0,F6a.createServiceIdentifier)("ICompletionsLogTargetService");var Nmt=class{static{a(this,"Logger")}constructor(e){this.category=e}log(e,r,...n){e.logIt(r,this.category,...n)}debug(e,...r){this.log(e,wte.DEBUG,...r)}info(e,...r){this.log(e,wte.INFO,...r)}warn(e,...r){this.log(e,wte.WARN,...r)}error(e,...r){this.log(e,wte.ERROR,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),(0,Q6a.telemetryException)(e.get(U6a.ICompletionsTelemetryService),r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e.get(G2.ICompletionsLogTargetService),wte.ERROR,`${o}:`,s)}};G2.Logger=Nmt;G2.logger=new Nmt("default")});var ixi=I(lG=>{"use strict";p();Object.defineProperty(lG,"__esModule",{value:!0});lG.INotificationService=lG.NullNotificationService=lG.ProgressLocation=void 0;var q6a=tn(),j6a=ik(),nxi;(function(t){t[t.SourceControl=1]="SourceControl",t[t.Window=10]="Window",t[t.Notification=15]="Notification"})(nxi||(lG.ProgressLocation=nxi={}));var GCr=class{static{a(this,"NullNotificationService")}showInformationMessage(e,r,...n){return Promise.resolve(void 0)}showWarningMessage(e,...r){return Promise.resolve(void 0)}showQuotaExceededDialog(e){return Promise.resolve()}withProgress(e,r){return Promise.resolve(r({report:a(()=>{},"report")},j6a.CancellationToken.None))}};lG.NullNotificationService=GCr;lG.INotificationService=(0,q6a.createServiceIdentifier)("INotificationService")});var VCr=I($2=>{"use strict";p();var H6a=$2&&$2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},G6a=$2&&$2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($2,"__esModule",{value:!0});$2.ExtensionNotificationSender=$2.ICompletionsNotificationSender=void 0;var $6a=ixi(),V6a=tn();$2.ICompletionsNotificationSender=(0,V6a.createServiceIdentifier)("ICompletionsNotificationSender");var $Cr=class{static{a(this,"ExtensionNotificationSender")}constructor(e){this.notificationService=e}async showWarningMessage(e,...r){let n=await this.notificationService.showWarningMessage(e,...r.map(o=>o.title));if(n!==void 0)return{title:n}}};$2.ExtensionNotificationSender=$Cr;$2.ExtensionNotificationSender=$Cr=H6a([G6a(0,$6a.INotificationService)],$Cr)});var YCr=I(V2=>{"use strict";p();var W6a=V2&&V2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WCr=V2&&V2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V2,"__esModule",{value:!0});V2.UserErrorNotifier=V2.ICompletionsUserErrorNotifierService=void 0;var z6a=r4(),Y6a=tn(),K6a=Vu(),axi=Tl(),J6a=VCr(),Z6a=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],oxi="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",sxi="https://gh.io/copilot-network-errors";V2.ICompletionsUserErrorNotifierService=(0,Y6a.createServiceIdentifier)("ICompletionsUserErrorNotifierService");var zCr=class{static{a(this,"UserErrorNotifier")}constructor(e,r,n){this._logTarget=e,this._notificationSender=r,this._env=n,this.notifiedErrorCodes=[]}notifyUser(e){if(!(e instanceof Error))return;let r=e;r.code&&Z6a.includes(r.code)&&!this.didNotifyBefore(r.code)&&(this.notifiedErrorCodes.push(r.code),this.displayCertificateErrorNotification(r))}async displayCertificateErrorNotification(e){new axi.Logger("certificates").error(this._logTarget,`${oxi} Please visit ${sxi} to learn more. Original cause:`,e);let r={title:"Learn more"};return this._notificationSender.showWarningMessage(oxi,r).then(n=>{if(n?.title===r.title)return this._env.openExternal(K6a.URI.parse(sxi))})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};V2.UserErrorNotifier=zCr;V2.UserErrorNotifier=zCr=W6a([WCr(0,axi.ICompletionsLogTargetService),WCr(1,J6a.ICompletionsNotificationSender),WCr(2,z6a.IEnvService)],zCr)});var _p=I(wme=>{"use strict";p();Object.defineProperty(wme,"__esModule",{value:!0});wme.NullExperimentationService=wme.IExperimentationService=void 0;var X6a=tn(),e9a=_c();wme.IExperimentationService=(0,X6a.createServiceIdentifier)("IExperimentationService");var KCr=class{static{a(this,"NullExperimentationService")}constructor(){this._onDidTreatmentsChange=new e9a.Emitter,this.onDidTreatmentsChange=this._onDidTreatmentsChange.event}async hasTreatments(){return Promise.resolve()}async hasAccountBasedTreatments(){return Promise.resolve()}getTreatmentVariable(e){}async setCompletionsFilters(e){}};wme.NullExperimentationService=KCr});var uG=I(Qb=>{"use strict";p();Object.defineProperty(Qb,"__esModule",{value:!0});Qb.DEFAULT_PROMPT_ALLOCATION_PERCENT=Qb.DEFAULT_SUFFIX_MATCH_THRESHOLD=Qb.DEFAULT_NUM_SNIPPETS=Qb.DEFAULT_MAX_PROMPT_LENGTH=Qb.DEFAULT_MAX_COMPLETION_LENGTH=void 0;Qb.normalizeLanguageId=r9a;Qb.DEFAULT_MAX_COMPLETION_LENGTH=500;Qb.DEFAULT_MAX_PROMPT_LENGTH=8192-Qb.DEFAULT_MAX_COMPLETION_LENGTH;Qb.DEFAULT_NUM_SNIPPETS=4;Qb.DEFAULT_SUFFIX_MATCH_THRESHOLD=10;Qb.DEFAULT_PROMPT_ALLOCATION_PERCENT={prefix:35,suffix:15,stableContext:35,volatileContext:15};var t9a={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function r9a(t){return t=t.toLowerCase(),t9a[t]??t}a(r9a,"normalizeLanguageId")});var cxi=I(JCr=>{"use strict";p();Object.defineProperty(JCr,"__esModule",{value:!0});JCr.getUserKind=i9a;function n9a(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(n9a,"findKnownOrg");function i9a(t){let e=t.organizationList??[];return n9a(e)??""}a(i9a,"getUserKind")});var gOe=I(p4=>{"use strict";p();Object.defineProperty(p4,"__esModule",{value:!0});p4.IEndpointProvider=p4.ModelSupportedEndpoint=void 0;p4.isEndpointEditToolName=a9a;p4.isChatModelInformation=c9a;p4.isEmbeddingModelInformation=l9a;p4.isCompletionModelInformation=u9a;var o9a=tn(),s9a=new Set(["find-replace","multi-find-replace","apply-patch","code-rewrite"]);function a9a(t){return s9a.has(t)}a(a9a,"isEndpointEditToolName");var lxi;(function(t){t.ChatCompletions="/chat/completions",t.Responses="/responses",t.WebSocketResponses="ws:/responses",t.Messages="/v1/messages"})(lxi||(p4.ModelSupportedEndpoint=lxi={}));function c9a(t){return t.capabilities.type==="chat"}a(c9a,"isChatModelInformation");function l9a(t){return t.capabilities.type==="embeddings"}a(l9a,"isEmbeddingModelInformation");function u9a(t){return t.capabilities.type==="completion"}a(u9a,"isCompletionModelInformation");p4.IEndpointProvider=(0,o9a.createServiceIdentifier)("IEndpointProvider")});var dxi=I(ZCr=>{"use strict";p();Object.defineProperty(ZCr,"__esModule",{value:!0});ZCr.getUserSelectedModelConfiguration=d9a;var uxi=_E();function d9a(t){let e=(0,uxi.getConfig)(t,uxi.ConfigKey.UserSelectedCompletionModel);return typeof e=="string"&&e.length>0?e:null}a(d9a,"getUserSelectedModelConfiguration")});var Rme=I(Rte=>{"use strict";p();var f9a=Rte&&Rte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),p9a=Rte&&Rte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f9a(e,t,r)};Object.defineProperty(Rte,"__esModule",{value:!0});p9a(fFt(),Rte)});var ebr=I(W2=>{"use strict";p();var h9a=W2&&W2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},AOe=W2&&W2.__param||function(t,e){return function(r,n){e(r,n,t)}},yOe;Object.defineProperty(W2,"__esModule",{value:!0});W2.AvailableModelsManager=W2.ICompletionsModelManagerService=void 0;var m9a=CE(),g9a=gOe(),A9a=tn(),y9a=Io(),E9a=Ms(),_9a=dxi(),v9a=Rme(),C9a=Dyr(),b9a=c0t(),Mmt=_E(),S9a=JA(),fxi=Tl();W2.ICompletionsModelManagerService=(0,A9a.createServiceIdentifier)("ICompletionsModelManagerService");var T9a="gpt-41-copilot",XCr=yOe=class extends y9a.Disposable{static{a(this,"AvailableModelsManager")}constructor(e=!0,r,n,o,s,c){super(),this._instantiationService=r,this._featuresService=n,this._endpointProvider=o,this._logService=c,this.fetchedModelData=[],this.customModels=[],this.editorPreviewFeaturesDisabled=!1,this._onDidChangeModels=this._register(new C9a.Emitter),this.onDidChangeModels=this._onDidChangeModels.event,e&&this._register((0,b9a.onCopilotToken)(s,()=>this.refreshAvailableModels()))}async refreshAvailableModels(){await this.refreshModels()}getDefaultModelId(){if(this.fetchedModelData){let e=yOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return T9a}async refreshModels(){let e=await this._endpointProvider.getAllCompletionModels(!0);e&&(this.fetchedModelData=e,this._onDidChangeModels.fire())}getGenericCompletionModels(){let e=yOe.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return yOe.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:v9a.TokenizerName.o200k}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=this._instantiationService.invokeFunction(_9a.getUserSelectedModelConfiguration);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&this._logService.logIt(fxi.LogLevel.INFO,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=this._instantiationService.invokeFunction(Mmt.getConfig,Mmt.ConfigKey.DebugOverrideEngine)||this._instantiationService.invokeFunction(Mmt.getConfig,Mmt.ConfigKey.DebugOverrideEngineLegacy);if(o)return new dG(o,"override");let s=e?this._featuresService.customEngine(e):void 0,c=e?this._featuresService.customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new dG(s,"exp"):new dG(n,"modelpicker"):s?new dG(s,"exp"):this.customModels.length>0?new dG(this.customModels[0],"custommodel"):new dG(r,"default")}};W2.AvailableModelsManager=XCr;W2.AvailableModelsManager=XCr=yOe=h9a([AOe(1,E9a.IInstantiationService),AOe(2,S9a.ICompletionsFeaturesService),AOe(3,g9a.IEndpointProvider),AOe(4,m9a.IAuthenticationService),AOe(5,fxi.ICompletionsLogTargetService)],XCr);var dG=class{static{a(this,"ModelRequestInfo")}constructor(e,r){this.modelId=e,this.modelChoiceSource=r}get headers(){return{}}}});var rbr=I(tbr=>{"use strict";p();Object.defineProperty(tbr,"__esModule",{value:!0});tbr.getEngineRequestInfo=x9a;var I9a=ebr();function x9a(t,e=void 0){let r=t.get(I9a.ICompletionsModelManagerService),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(x9a,"getEngineRequestInfo")});var gxi=I(Omt=>{"use strict";p();Object.defineProperty(Omt,"__esModule",{value:!0});Omt.setupCompletionsExperimentationService=D9a;Omt.createCompletionsFilters=mxi;var w9a=CE(),R9a=_p(),P9a=Ms(),pxi=cxi(),fG=_E(),k9a=rbr(),lR=Bht();function D9a(t){let e=t.get(w9a.IAuthenticationService),r=t.get(P9a.IInstantiationService),n=e.onDidAuthenticationChange(()=>{r.invokeFunction(hxi,e.copilotToken)});return hxi(t,e.copilotToken),n}a(D9a,"setupCompletionsExperimentationService");function N9a(t){return fG.BuildInfo.getBuildType()===fG.BuildType.NIGHTLY?lR.Release.Nightly:lR.Release.Stable}a(N9a,"getPluginRelease");function hxi(t,e){let r=t.get(R9a.IExperimentationService),n=mxi(t,e);r.setCompletionsFilters(n)}a(hxi,"updateCompletionsFilters");function mxi(t,e){let r=new Map;if(r.set(lR.Filter.ExtensionRelease,N9a(t)),r.set(lR.Filter.CopilotOverrideEngine,(0,fG.getConfig)(t,fG.ConfigKey.DebugOverrideEngine)||(0,fG.getConfig)(t,fG.ConfigKey.DebugOverrideEngineLegacy)),r.set(lR.Filter.CopilotClientVersion,fG.BuildInfo.isProduction()?fG.BuildInfo.getVersion():"1.999.0"),e){let o=(0,pxi.getUserKind)(e),s=e.getTokenValue("ft")??"",c=e.getTokenValue("ol")??"",l=e.getTokenValue("cml")??"",u=e.getTokenValue("tid")??"";r.set(lR.Filter.CopilotUserKind,o),r.set(lR.Filter.CopilotCustomModel,s),r.set(lR.Filter.CopilotOrgs,c),r.set(lR.Filter.CopilotCustomModelNames,l),r.set(lR.Filter.CopilotTrackingId,u),r.set(lR.Filter.CopilotUserKind,(0,pxi.getUserKind)(e))}let n=(0,k9a.getEngineRequestInfo)(t).modelId;return r.set(lR.Filter.CopilotEngine,n),r}a(mxi,"createCompletionsFilters")});var Axi=I(M8=>{"use strict";p();var M9a=M8&&M8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},nbr=M8&&M8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M8,"__esModule",{value:!0});M8.Features=void 0;var O9a=Ap(),B9a=_p(),L9a=Ms(),Pme=uG(),F9a=ome(),ibr=Ig(),U9a=gxi(),Da=Mht(),Q9a=Bht(),obr=class{static{a(this,"Features")}constructor(e,r,n){this.instantiationService=e,this.experimentationService=r,this.copilotTokenManager=n,this.includeNeighboringFilesDefault=new Map,this.excludeRelatedFilesDefault=new Map}async updateExPValuesAndAssignments(e,r=ibr.TelemetryData.createAndMarkAsIssued()){if(r instanceof ibr.TelemetryWithExp)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let n=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),{filters:o,exp:s}=this.createExpConfigAndFilters(n);return new ibr.TelemetryWithExp(r.properties,r.measurements,r.issuedTime,{filters:o,exp:s})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){return await this.updateExPValuesAndAssignments(e,r)}createExpConfigAndFilters(e){let r={};for(let u of Object.values(Da.ExpTreatmentVariables)){let d=this.experimentationService.getTreatmentVariable(u);d!==void 0&&(r[u]=d)}let n=Object.entries(r).map(([u,d])=>u+(d?"":"cf")),o=new Da.ExpConfig(r,n.join(";")),s=this.instantiationService.invokeFunction(U9a.createCompletionsFilters,e),c={};for(let[u,d]of s.entries())c[u]=d;return{filters:new Q9a.FilterSettings(c),exp:o}}async getFallbackExpAndFilters(){let e=this.copilotTokenManager.token??await this.copilotTokenManager.getToken();return this.createExpConfigAndFilters(e)}overrideBlockMode(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.OverrideBlockMode]||void 0}customEngine(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CustomEngine]??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CustomEngineTargetEngine]}suffixPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SuffixPercent]??Pme.DEFAULT_PROMPT_ALLOCATION_PERCENT.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SuffixMatchThreshold]??Pme.DEFAULT_SUFFIX_MATCH_THRESHOLD}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CppHeadersEnableSwitch]??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCodeCSharp]??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCodeTypeScript]??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.RelatedFilesVSCode]??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ContextProviders]??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e,r){let n=r.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ContextProviderTimeBudget]??150;return n||(this.getContextProviderExpSettings(e)?.timeBudget??150)}setIncludeNeighboringFilesDefault(e,r){this.includeNeighboringFilesDefault.set(e,r)}includeNeighboringFiles(e,r){return r.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.IncludeNeighboringFiles]??!1?!0:this.getContextProviderExpSettings(e)?.includeNeighboringFiles??this.includeNeighboringFilesDefault.get(e)??!1}setExcludeRelatedFilesDefault(e,r){this.excludeRelatedFilesDefault.set(e,r)}excludeRelatedFiles(e,r){return r.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ExcludeRelatedFiles]??!1?!0:this.getContextProviderExpSettings(e)?.excludeRelatedFiles??this.excludeRelatedFilesDefault.get(e)??!1}getContextProviderExpSettings(e){let r=this.experimentationService.getTreatmentVariable(`config.github.copilot.chat.contextprovider.${e}`);if(typeof r=="string")try{let n=JSON.parse(r),o=this.getProviderIDs(n);return delete n.id,delete n.ids,Object.assign({ids:o},{includeNeighboringFiles:!1,excludeRelatedFiles:!1,timeBudget:150},n)}catch{this.instantiationService.invokeFunction(o=>{o.get(O9a.ILogService).error(`Failed to parse context provider exp settings for language ${e}`)});return}else return}getProviderIDs(e){let r=[];if(typeof e.id=="string"&&e.id.length>0&&r.push(e.id),Array.isArray(e.ids))for(let n of e.ids)typeof n=="string"&&n.length>0&&r.push(n);return r}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MaxPromptCompletionTokens]??Pme.DEFAULT_MAX_PROMPT_LENGTH+Pme.DEFAULT_MAX_COMPLETION_LENGTH}stableContextPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.StableContextPercent]??Pme.DEFAULT_PROMPT_ALLOCATION_PERCENT.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.VolatileContextPercent]??Pme.DEFAULT_PROMPT_ALLOCATION_PERCENT.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CppContextProviderParams]}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CSharpContextProviderParams]}javaContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.JavaContextProviderParams]}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MultiLanguageContextProviderParams]}tsContextProviderParams(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.TsContextProviderParams]}completionsDebounce(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CompletionsDebounce]}enableElectronFetcher(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ElectronFetcher]??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.FetchFetcher]??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.AsyncCompletionsTimeout]??200}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveReveal]??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ModelAlwaysTerminatesSingleline]??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveRevealLongLookaheadSize]??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.ProgressiveRevealShortLookaheadSize]??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MaxMultilineTokens]??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.MultilineAfterAcceptLines]??1}completionsDelay(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.CompletionsDelay]??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables[Da.ExpTreatmentVariables.SingleLineUnlessAccepted]??!1}};M8.Features=obr;M8.Features=obr=M9a([nbr(0,L9a.IInstantiationService),nbr(1,B9a.IExperimentationService),nbr(2,F9a.ICompletionsCopilotTokenManager)],obr)});var pG=I(kme=>{"use strict";p();Object.defineProperty(kme,"__esModule",{value:!0});kme.ICompletionsFileSystemService=kme.FileType=void 0;var q9a=tn(),yxi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(yxi||(kme.FileType=yxi={}));kme.ICompletionsFileSystemService=(0,q9a.createServiceIdentifier)("ICompletionsFileSystemService")});var sbr=I(Bmt=>{"use strict";p();Object.defineProperty(Bmt,"__esModule",{value:!0});Bmt.knownLanguages=void 0;Bmt.knownLanguages={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}}});var _xi=I(hG=>{"use strict";p();Object.defineProperty(hG,"__esModule",{value:!0});hG.knownFileExtensions=hG.templateLanguageLimitations=hG.knownTemplateLanguageExtensions=void 0;var Exi=sbr();hG.knownTemplateLanguageExtensions=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"];hG.templateLanguageLimitations={".php":[".blade"]};hG.knownFileExtensions=Object.keys(Exi.knownLanguages).flatMap(t=>Exi.knownLanguages[t].extensions)});var mG=I(z2=>{"use strict";p();Object.defineProperty(z2,"__esModule",{value:!0});z2.makeFsUri=V9a;z2.validateUri=W9a;z2.normalizeUri=z9a;z2.fsPath=Sxi;z2.getFsPath=Txi;z2.getFsUri=Y9a;z2.joinPath=K9a;z2.basename=X9a;z2.dirname=eUa;var j9a=require("os"),H9a=require("path"),G9a=ak(),EOe=Vu();function Cxi(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+Cxi(t.substring(3)):t}}a(Cxi,"decodeURIComponentGraceful");var vxi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function $9a(t){return t.match(vxi)?t.replace(vxi,e=>Cxi(e)):t}a($9a,"percentDecode");function V9a(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return EOe.URI.file(t).toString()}a(V9a,"makeFsUri");function _Oe(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?EOe.URI.parse(e[1]+e[2],!0):EOe.URI.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(_Oe,"parseUri");function W9a(t){return _Oe(t),t}a(W9a,"validateUri");function z9a(t){try{return _Oe(t).toString()}catch{return t}}a(z9a,"normalizeUri");var bxi=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function Sxi(t){let e=_Oe(t);if(!bxi.has(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,j9a.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,H9a.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(Sxi,"fsPath");function Txi(t){try{return Sxi(t)}catch{return}}a(Txi,"getFsPath");function Y9a(t){let e=Txi(t);if(e)return EOe.URI.file(e).toString()}a(Y9a,"getFsUri");function K9a(t,...e){let r=EOe.URI.joinPath(_Oe(t),...e.map(J9a)).toString();return typeof t=="string"?r:{uri:r}}a(K9a,"joinPath");function J9a(t){return Z9a(t)?t.replaceAll("\\","/"):t}a(J9a,"pathToURIPath");function Z9a(t){return/^[^/\\]*\\/.test(t)}a(Z9a,"isWinPath");function X9a(t){return $9a((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(X9a,"basename");function eUa(t){let e=(0,G9a.dirname)(_Oe(t)),r;return bxi.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(eUa,"dirname")});var xxi=I(TE=>{"use strict";p();var tUa=TE&&TE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rUa=TE&&TE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nUa=TE&&TE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0&&abr.knownFileExtensions.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=abr.templateLanguageLimitations[e];return!n||n.includes(r)}detectLanguageId(e,r){if(Dme.has(e))return{languageId:Dme.get(e)[0],isGuess:!1};let n=cbr.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),Dme.has(e))return{languageId:Dme.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},ubr=class extends Nme{static{a(this,"GroupingLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){let r=this.delegate.detectLanguage(e),n=r.languageId;return n==="c"||n==="cpp"?new Pte("cpp",r.isGuess,r.fileExtension):r}},dbr=class extends Nme{static{a(this,"ClientProvidedLanguageDetection")}constructor(e){super(),this.delegate=e}detectLanguage(e){return e.uri.startsWith("untitled:")||e.uri.startsWith("vscode-notebook-cell:")?new Pte(e.languageId,!0,""):this.delegate.detectLanguage(e)}};TE.languageDetection=new ubr(new dbr(new lbr));function sUa({uri:t,languageId:e}){let r=TE.languageDetection.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(sUa,"detectLanguage")});var Ome=I(Mme=>{"use strict";p();Object.defineProperty(Mme,"__esModule",{value:!0});Mme.CopilotTextDocument=Mme.LocationFactory=void 0;var aUa=xxi(),cUa=mG(),vOe=(u9t(),ya(vpn)),gG=vve(),fbr=class{static{a(this,"LocationFactory")}static{this.range=gG.Range.create.bind(gG.Range)}static{this.position=gG.Position.create.bind(gG.Position)}};Mme.LocationFactory=fbr;var pbr=class t{static{a(this,"CopilotTextDocument")}constructor(e,r,n){this.uri=e,this._textDocument=r,this.detectedLanguageId=n}static withChanges(e,r,n){let o=vOe.TextDocument.create(e.clientUri,e.clientLanguageId,n,e.getText());return vOe.TextDocument.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=vOe.TextDocument.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return vOe.TextDocument.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=(0,aUa.detectLanguage)({uri:e,languageId:r})){return new t((0,cUa.normalizeUri)(e),vOe.TextDocument.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=gG.Range.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=gG.Range.create(gG.Position.create(r,0),gG.Position.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};Mme.CopilotTextDocument=pbr});var bOe=I((rCp,kxi)=>{"use strict";p();var hbr=Object.defineProperty,lUa=Object.getOwnPropertyDescriptor,uUa=Object.getOwnPropertyNames,dUa=Object.prototype.hasOwnProperty,fUa=a((t,e)=>{for(var r in e)hbr(t,r,{get:e[r],enumerable:!0})},"__export"),pUa=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of uUa(e))!dUa.call(t,o)&&o!==r&&hbr(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=lUa(e,o))||n.enumerable});return t},"__copyProps"),hUa=a(t=>pUa(hbr({},"__esModule",{value:!0}),t),"__toCommonJS"),Rxi={};fUa(Rxi,{config:a(()=>EUa,"config"),t:a(()=>Pxi,"t")});kxi.exports=hUa(Rxi);var mUa=require("fs"),gUa=require("fs/promises");async function AUa(t){if(t.protocol==="file:")return await(0,gUa.readFile)(t,"utf8");if(t.protocol==="http:"||t.protocol==="https:"){let e=await fetch(t.toString(),{headers:{"Accept-Encoding":"gzip, deflate",Accept:"application/json"},redirect:"follow"});if(!e.ok){let n=`Unexpected ${e.status} response while trying to read ${t}`;try{n+=`: ${await e.text()}`}catch{}throw new Error(n)}return await e.text()}throw new Error("Unsupported protocol")}a(AUa,"readFileFromUri");function yUa(t){return(0,mUa.readFileSync)(t,"utf8")}a(yUa,"readFileFromFsPath");var COe;function EUa(t){if("contents"in t){typeof t.contents=="string"?COe=JSON.parse(t.contents):COe=t.contents;return}if("fsPath"in t){let e=yUa(t.fsPath),r=JSON.parse(e);COe=wxi(r)?r.contents.bundle:r;return}if(t.uri){let e=t.uri;return typeof t.uri=="string"&&(e=new URL(t.uri)),new Promise((r,n)=>{AUa(e).then(o=>{try{let s=JSON.parse(o);COe=wxi(s)?s.contents.bundle:s,r()}catch(s){n(s)}}).catch(o=>{n(o)})})}}a(EUa,"config");function Pxi(...t){let e=t[0],r,n,o;if(typeof e=="string")r=e,n=e,t.splice(0,1),o=!t||typeof t[0]!="object"?t:t[0];else if(e instanceof Array){let c=t.slice(1);if(e.length!==c.length+1)throw new Error("expected a string as the first argument to l10n.t");let l=e[0];for(let u=1;u0&&(r+=`/${Array.isArray(e.comment)?e.comment.join(""):e.comment}`),o=e.args??{};let s=COe?.[r];return s?typeof s=="string"?Lmt(s,o):s.comment?Lmt(s.message,o):Lmt(n,o):Lmt(n,o)}a(Pxi,"t");var _Ua=/{([^}]+)}/g;function Lmt(t,e){return Object.keys(e).length===0?t:t.replace(_Ua,(r,n)=>e[n]??r)}a(Lmt,"format");function wxi(t){return typeof t?.contents?.bundle=="object"&&typeof t?.version=="string"}a(wxi,"isBuiltinExtension")});var kte=I(pv=>{"use strict";p();var vUa=pv&&pv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CUa=pv&&pv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bUa=pv&&pv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Ebr,"__esModule",{value:!0});Ebr.isDocumentValid=iQa;var rQa=Bte(),nQa=Ku();async function iQa(t,e){return await t.get(rQa.IIgnoreService).isCopilotIgnored(nQa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(iQa,"isDocumentValid")});var zb=I(Z2=>{"use strict";p();var oQa=Z2&&Z2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yxi=Z2&&Z2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Z2,"__esModule",{value:!0});Z2.TextDocumentManager=Z2.ICompletionsTextDocumentManagerService=void 0;var sQa=rn(),aQa=Qs(),cQa=bG(),Exi=_br(),Gme=TG();Z2.ICompletionsTextDocumentManagerService=(0,sQa.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var Cbr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction(Exi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,Gme.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction(Exi.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,Gme.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,Gme.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,Gme.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,Gme.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,Gme.basename)(r)}};Z2.TextDocumentManager=Cbr;Z2.TextDocumentManager=Cbr=oQa([yxi(0,aQa.IInstantiationService),yxi(1,cQa.ICompletionsFileSystemService)],Cbr)});var Sbr=I(X2=>{"use strict";p();var lQa=X2&&X2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vbr=X2&&X2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X2,"__esModule",{value:!0});X2.FileReader=X2.ICompletionsFileReaderService=void 0;var uQa=rn(),dQa=Qs(),fQa=bG(),pQa=Hme(),hQa=zb(),mQa=_br(),gQa=TG();X2.ICompletionsFileReaderService=(0,uQa.createServiceIdentifier)("ICompletionsFileReaderService");var bbr=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,gQa.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(mQa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:pQa.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};X2.FileReader=bbr;X2.FileReader=bbr=lQa([vbr(0,hQa.ICompletionsTextDocumentManagerService),vbr(1,dQa.IInstantiationService),vbr(2,fQa.ICompletionsFileSystemService)],bbr)});var H8=I(Gmt=>{"use strict";p();Object.defineProperty(Gmt,"__esModule",{value:!0});Gmt.LRUCacheMap=void 0;var Tbr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};Gmt.LRUCacheMap=Tbr});var LOe=I(BOe=>{"use strict";p();Object.defineProperty(BOe,"__esModule",{value:!0});BOe.Deferred=void 0;BOe.delay=AQa;var Ibr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};BOe.Deferred=Ibr;function AQa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(AQa,"delay")});var _xi=I($me=>{"use strict";p();Object.defineProperty($me,"__esModule",{value:!0});$me.ReplaySubject=$me.Subject=void 0;var $mt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};$me.Subject=$mt;var xbr=class extends $mt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};$me.ReplaySubject=xbr});var kbr=I(eD=>{"use strict";p();var yQa=eD&&eD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Cxi=eD&&eD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eD,"__esModule",{value:!0});eD.AsyncCompletionManager=eD.ICompletionsAsyncManagerService=void 0;var EQa=rn(),_Qa=VA(),CQa=H8(),vxi=xl(),vQa=LOe(),bQa=_xi(),Lte;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Lte||(Lte={}));eD.ICompletionsAsyncManagerService=(0,EQa.createServiceIdentifier)("ICompletionsAsyncManagerService");var Rbr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new vxi.Logger("AsyncCompletionManager"),this.requests=new CQa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(wbr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new bQa.ReplaySubject;return this.requests.set(e,{state:Lte.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Lte.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new vQa.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(wbr(r,n,f)){if(f.state===Lte.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)wbr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Lte.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};eD.AsyncCompletionManager=Rbr;eD.AsyncCompletionManager=Rbr=yQa([Cxi(0,_Qa.ICompletionsFeaturesService),Cxi(1,vxi.ICompletionsLogTargetService)],Rbr);function wbr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Lte.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(wbr,"isCandidate")});var bxi=I(Vmt=>{"use strict";p();Object.defineProperty(Vmt,"__esModule",{value:!0});Vmt.LRURadixTrie=void 0;var Pbr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new FOe,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new FOe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new FOe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(Vme,"__esModule",{value:!0});Vme.CompletionsCache=Vme.ICompletionsCacheService=void 0;var SQa=rn(),Sxi=bxi();Vme.ICompletionsCacheService=(0,SQa.createServiceIdentifier)("ICompletionsCacheService");var Dbr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new Sxi.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new Sxi.LRURadixTrie(100)}};Vme.CompletionsCache=Dbr});var Txi=I(Wme=>{"use strict";p();Object.defineProperty(Wme,"__esModule",{value:!0});Wme.BlockMode=void 0;Wme.shouldDoParsingTrimming=TQa;Wme.shouldDoServerTrimming=IQa;var Fte;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Fte||(Wme.BlockMode=Fte={}));function TQa(t){return[Fte.Parsing,Fte.ParsingAndServer,Fte.MoreMultiline].includes(t)}a(TQa,"shouldDoParsingTrimming");function IQa(t){return[Fte.Server,Fte.ParsingAndServer].includes(t)}a(IQa,"shouldDoServerTrimming")});var Ute=I(OT=>{"use strict";p();var xQa=OT&&OT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(OT,"__esModule",{value:!0});OT.WASMLanguage=void 0;OT.isSupportedLanguageId=RQa;OT.languageIdToWasmLanguage=Lbr;OT.getLanguage=xxi;OT.parseTreeSitter=PQa;OT.parseTreeSitterIncludingVersion=wxi;OT.getBlockCloseToken=DQa;OT.queryPythonIsDocstring=OQa;var Mbr=xQa(ice()),wQa=Jvr(),Ixi=Zvr(),dd;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(dd||(OT.WASMLanguage=dd={}));var Obr={python:dd.Python,javascript:dd.JavaScript,javascriptreact:dd.JavaScript,jsx:dd.JavaScript,typescript:dd.TypeScript,typescriptreact:dd.TSX,go:dd.Go,ruby:dd.Ruby,csharp:dd.CSharp,java:dd.Java,php:dd.Php,c:dd.Cpp,cpp:dd.Cpp};function RQa(t){return t in Obr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(RQa,"isSupportedLanguageId");function Lbr(t){if(!(t in Obr))throw new Error(`Unrecognized language: ${t}`);return Obr[t]}a(Lbr,"languageIdToWasmLanguage");var Nbr=new Map;async function kQa(t){let e;try{e=await(0,Ixi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new wQa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return Mbr.default.Language.load(e)}a(kQa,"loadWasmLanguage");function xxi(t){let e=Lbr(t);if(!Nbr.has(e)){let r=kQa(e);Nbr.set(e,r)}return Nbr.get(e)}a(xxi,"getLanguage");var Bbr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function PQa(t,e){return(await wxi(t,e))[0]}a(PQa,"parseTreeSitter");async function wxi(t,e){await Mbr.default.init({locateFile:a(s=>(0,Ixi.locateFile)(s),"locateFile")});let r;try{r=new Mbr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new Bbr(`Could not init Parse for language <${t}>`,s):s}let n=await xxi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(wxi,"parseTreeSitterIncludingVersion");function DQa(t){switch(Lbr(t)){case dd.Python:return null;case dd.JavaScript:case dd.TypeScript:case dd.TSX:case dd.Go:case dd.CSharp:case dd.Java:case dd.Php:case dd.Cpp:return"}";case dd.Ruby:return"end"}}a(DQa,"getBlockCloseToken");function NQa(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(NQa,"innerQuery");var MQa=[`[ +**Note:** Some files were excluded from the context due to content exclusion rules. Click [here](https://docs.github.com/en/copilot/managing-github-copilot-in-your-organization/configuring-content-exclusions-for-github-copilot) to learn more.`);pv.IIgnoreService=(0,TUa.createServiceIdentifier)("IIgnoreService");var mbr=class t{static{a(this,"NullIgnoreService")}static{this.Instance=new t}dispose(){}get isEnabled(){return!1}get isRegexExclusionsEnabled(){return!1}async init(){}async isCopilotIgnored(e){return!1}async asMinimatchPattern(){}};pv.NullIgnoreService=mbr;async function IUa(t,e){let r=[];for(let n of e)await t.isCopilotIgnored(n)||r.push(n);return r}a(IUa,"filterIngoredResources")});var Abr=I(gbr=>{"use strict";p();Object.defineProperty(gbr,"__esModule",{value:!0});gbr.isDocumentValid=RUa;var xUa=kte(),wUa=Vu();async function RUa(t,e){return await t.get(xUa.IIgnoreService).isCopilotIgnored(wUa.URI.parse(e.uri))?{status:"invalid",reason:"Document is blocked by repository policy"}:{status:"valid"}}a(RUa,"isDocumentValid")});var qb=I(Y2=>{"use strict";p();var PUa=Y2&&Y2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Dxi=Y2&&Y2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Y2,"__esModule",{value:!0});Y2.TextDocumentManager=Y2.ICompletionsTextDocumentManagerService=void 0;var kUa=tn(),DUa=Ms(),NUa=pG(),Nxi=Abr(),Bme=mG();Y2.ICompletionsTextDocumentManagerService=(0,kUa.createServiceIdentifier)("ICompletionsTextDocumentManagerService");var ybr=class{static{a(this,"TextDocumentManager")}constructor(e,r){this.instantiationService=e,this.fileSystem=r}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.instantiationService.invokeFunction(Nxi.isDocumentValid,n)).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=(0,Bme.normalizeUri)(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async validateTextDocument(e){return await this.instantiationService.invokeFunction(Nxi.isDocumentValid,e)}async getTextDocumentValidation(e){try{return await this.validateTextDocument(e)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(e);return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.fileSystem.stat(e)).size>5*1024*1024)return}catch{return}return await this.fileSystem.readFileString(e)}getWorkspaceFolder(e){let r=(0,Bme.normalizeUri)(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith((0,Bme.normalizeUri)(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=(0,Bme.normalizeUri)(e.uri);for(let n of this.getWorkspaceFolders()){let o=(0,Bme.normalizeUri)(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return(0,Bme.basename)(r)}};Y2.TextDocumentManager=ybr;Y2.TextDocumentManager=ybr=PUa([Dxi(0,DUa.IInstantiationService),Dxi(1,NUa.ICompletionsFileSystemService)],ybr)});var vbr=I(K2=>{"use strict";p();var MUa=K2&&K2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ebr=K2&&K2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(K2,"__esModule",{value:!0});K2.FileReader=K2.ICompletionsFileReaderService=void 0;var OUa=tn(),BUa=Ms(),LUa=pG(),FUa=Ome(),UUa=qb(),QUa=Abr(),qUa=mG();K2.ICompletionsFileReaderService=(0,OUa.createServiceIdentifier)("ICompletionsFileReaderService");var _br=class{static{a(this,"FileReader")}constructor(e,r,n){this.documentManagerService=e,this.instantiationService=r,this.fileSystemService=n}getRelativePath(e){return this.documentManagerService.getRelativePath(e)??(0,qUa.basename)(e.uri)}getOrReadTextDocument(e){return this.readFile(e.uri)}getOrReadTextDocumentWithFakeClientProperties(e){return this.readFile(e.uri)}async readFile(e){let r=await this.documentManagerService.getTextDocumentWithValidation({uri:e});if(r.status!=="notfound")return r;try{if(await this.getFileSizeMB(e)>1)return{status:"notfound",message:"File too large"};let o=await this.doReadFile(e),s=await this.instantiationService.invokeFunction(QUa.isDocumentValid,{uri:e});return s.status==="valid"?{status:"valid",document:FUa.CopilotTextDocument.create(e,"UNKNOWN",-1,o)}:s}catch{return{status:"notfound",message:"File not found"}}}async doReadFile(e){return await this.fileSystemService.readFileString(e)}async getFileSizeMB(e){return(await this.fileSystemService.stat(e)).size/1024/1024}};K2.FileReader=_br;K2.FileReader=_br=MUa([Ebr(0,UUa.ICompletionsTextDocumentManagerService),Ebr(1,BUa.IInstantiationService),Ebr(2,LUa.ICompletionsFileSystemService)],_br)});var O8=I(Fmt=>{"use strict";p();Object.defineProperty(Fmt,"__esModule",{value:!0});Fmt.LRUCacheMap=void 0;var Cbr=class{static{a(this,"LRUCacheMap")}constructor(e=10){if(this.valueMap=new Map,e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}};Fmt.LRUCacheMap=Cbr});var TOe=I(SOe=>{"use strict";p();Object.defineProperty(SOe,"__esModule",{value:!0});SOe.Deferred=void 0;SOe.delay=jUa;var bbr=class{static{a(this,"Deferred")}constructor(){this.resolve=()=>{},this.reject=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}};SOe.Deferred=bbr;function jUa(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(jUa,"delay")});var Mxi=I(Lme=>{"use strict";p();Object.defineProperty(Lme,"__esModule",{value:!0});Lme.ReplaySubject=Lme.Subject=void 0;var Umt=class{static{a(this,"Subject")}constructor(){this.observers=new Set}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}};Lme.Subject=Umt;var Sbr=class extends Umt{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};Lme.ReplaySubject=Sbr});var xbr=I(J2=>{"use strict";p();var HUa=J2&&J2.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Oxi=J2&&J2.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(J2,"__esModule",{value:!0});J2.AsyncCompletionManager=J2.ICompletionsAsyncManagerService=void 0;var GUa=tn(),$Ua=JA(),VUa=O8(),Bxi=Tl(),WUa=TOe(),zUa=Mxi(),Dte;(function(t){t[t.Completed=0]="Completed",t[t.Error=1]="Error",t[t.Pending=2]="Pending"})(Dte||(Dte={}));J2.ICompletionsAsyncManagerService=(0,GUa.createServiceIdentifier)("ICompletionsAsyncManagerService");var Ibr=class{static{a(this,"AsyncCompletionManager")}#e;constructor(e,r){this.featuresService=e,this.logTarget=r,this.#e=new Bxi.Logger("AsyncCompletionManager"),this.requests=new VUa.LRUCacheMap(100),this.mostRecentRequestId=""}clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Tbr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.logTarget,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new zUa.ReplaySubject;return this.requests.set(e,{state:Dte.Pending,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.logTarget,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:Dte.Completed,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.logTarget,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.featuresService.asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.logTarget,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.logTarget,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.logTarget,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new WUa.Deferred,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.logTarget,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(Tbr(r,n,f)){if(f.state===Dte.Completed){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.logTarget,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)Tbr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==Dte.Completed&&(this.#e.debug(this.logTarget,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};J2.AsyncCompletionManager=Ibr;J2.AsyncCompletionManager=Ibr=HUa([Oxi(0,$Ua.ICompletionsFeaturesService),Oxi(1,Bxi.ICompletionsLogTargetService)],Ibr);function Tbr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===Dte.Completed?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(Tbr,"isCandidate")});var Lxi=I(Qmt=>{"use strict";p();Object.defineProperty(Qmt,"__esModule",{value:!0});Qmt.LRURadixTrie=void 0;var wbr=class{static{a(this,"LRURadixTrie")}constructor(e){this.maxSize=e,this.root=new IOe,this.leafNodes=new Set}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new IOe;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new IOe;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touched{"use strict";p();Object.defineProperty(Fme,"__esModule",{value:!0});Fme.CompletionsCache=Fme.ICompletionsCacheService=void 0;var YUa=tn(),Fxi=Lxi();Fme.ICompletionsCacheService=(0,YUa.createServiceIdentifier)("ICompletionsCacheService");var Rbr=class{static{a(this,"CompletionsCache")}constructor(){this.cache=new Fxi.LRURadixTrie(100)}findAll(e,r){return this.cache.findAll(e).flatMap(({remainingKey:n,value:o})=>o.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new Fxi.LRURadixTrie(100)}};Fme.CompletionsCache=Rbr});var Uxi=I(Ume=>{"use strict";p();Object.defineProperty(Ume,"__esModule",{value:!0});Ume.BlockMode=void 0;Ume.shouldDoParsingTrimming=KUa;Ume.shouldDoServerTrimming=JUa;var Nte;(function(t){t.Parsing="parsing",t.Server="server",t.ParsingAndServer="parsingandserver",t.MoreMultiline="moremultiline"})(Nte||(Ume.BlockMode=Nte={}));function KUa(t){return[Nte.Parsing,Nte.ParsingAndServer,Nte.MoreMultiline].includes(t)}a(KUa,"shouldDoParsingTrimming");function JUa(t){return[Nte.Server,Nte.ParsingAndServer].includes(t)}a(JUa,"shouldDoServerTrimming")});var Mte=I(kT=>{"use strict";p();var ZUa=kT&&kT.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kT,"__esModule",{value:!0});kT.WASMLanguage=void 0;kT.isSupportedLanguageId=e7a;kT.languageIdToWasmLanguage=Mbr;kT.getLanguage=qxi;kT.parseTreeSitter=r7a;kT.parseTreeSitterIncludingVersion=jxi;kT.getBlockCloseToken=n7a;kT.queryPythonIsDocstring=s7a;var kbr=ZUa(Yae()),XUa=aFt(),Qxi=cFt(),dd;(function(t){t.Python="python",t.JavaScript="javascript",t.TypeScript="typescript",t.TSX="tsx",t.Go="go",t.Ruby="ruby",t.CSharp="c-sharp",t.Java="java",t.Php="php",t.Cpp="cpp"})(dd||(kT.WASMLanguage=dd={}));var Dbr={python:dd.Python,javascript:dd.JavaScript,javascriptreact:dd.JavaScript,jsx:dd.JavaScript,typescript:dd.TypeScript,typescriptreact:dd.TSX,go:dd.Go,ruby:dd.Ruby,csharp:dd.CSharp,java:dd.Java,php:dd.Php,c:dd.Cpp,cpp:dd.Cpp};function e7a(t){return t in Dbr&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(e7a,"isSupportedLanguageId");function Mbr(t){if(!(t in Dbr))throw new Error(`Unrecognized language: ${t}`);return Dbr[t]}a(Mbr,"languageIdToWasmLanguage");var Pbr=new Map;async function t7a(t){let e;try{e=await(0,Qxi.readFile)(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new XUa.CopilotPromptLoadFailure(`Could not load tree-sitter-${t}.wasm`,r):r}return kbr.default.Language.load(e)}a(t7a,"loadWasmLanguage");function qxi(t){let e=Mbr(t);if(!Pbr.has(e)){let r=t7a(e);Pbr.set(e,r)}return Pbr.get(e)}a(qxi,"getLanguage");var Nbr=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function r7a(t,e){return(await jxi(t,e))[0]}a(r7a,"parseTreeSitter");async function jxi(t,e){await kbr.default.init({locateFile:a(s=>(0,Qxi.locateFile)(s),"locateFile")});let r;try{r=new kbr.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new Nbr(`Could not init Parse for language <${t}>`,s):s}let n=await qxi(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(jxi,"parseTreeSitterIncludingVersion");function n7a(t){switch(Mbr(t)){case dd.Python:return null;case dd.JavaScript:case dd.TypeScript:case dd.TSX:case dd.Go:case dd.CSharp:case dd.Java:case dd.Php:case dd.Cpp:return"}";case dd.Ruby:return"end"}}a(n7a,"getBlockCloseToken");function i7a(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(i7a,"innerQuery");var o7a=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function OQa(t){return NQa([MQa],t).length===1}a(OQa,"queryPythonIsDocstring")});var $br=I(Jme=>{"use strict";p();Object.defineProperty(Jme,"__esModule",{value:!0});Jme.StatementTree=Jme.StatementNode=void 0;var BQa=Ute(),tD=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function s7a(t){return i7a([o7a],t).length===1}a(s7a,"queryPythonIsDocstring")});var jbr=I(Hme=>{"use strict";p();Object.defineProperty(Hme,"__esModule",{value:!0});Hme.StatementTree=Hme.StatementNode=void 0;var a7a=Mte(),Z2=class{static{a(this,"StatementNode")}constructor(e){this.node=e,this.children=[],this.collapsed=!1}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{static{a(this,"StatementTree")}static isSupported(e){return zme.languageIds.has(e)||Yme.languageIds.has(e)||QOe.languageIds.has(e)||Kme.languageIds.has(e)||qOe.languageIds.has(e)||jOe.languageIds.has(e)||HOe.languageIds.has(e)||GOe.languageIds.has(e)||$Oe.languageIds.has(e)}static isTrimmedByDefault(e){return zme.languageIds.has(e)||Yme.languageIds.has(e)||Kme.languageIds.has(e)}static create(e,r,n,o){if(zme.languageIds.has(e))return new zme(e,r,n,o);if(Yme.languageIds.has(e))return new Yme(e,r,n,o);if(QOe.languageIds.has(e))return new QOe(e,r,n,o);if(Kme.languageIds.has(e))return new Kme(e,r,n,o);if(HOe.languageIds.has(e))return new HOe(e,r,n,o);if(qOe.languageIds.has(e))return new qOe(e,r,n,o);if(jOe.languageIds.has(e))return new jOe(e,r,n,o);if(GOe.languageIds.has(e))return new GOe(e,r,n,o);if($Oe.languageIds.has(e))return new $Oe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,BQa.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}};Hme.StatementNode=Z2;var uR=class{static{a(this,"StatementTree")}static isSupported(e){return Qme.languageIds.has(e)||qme.languageIds.has(e)||wOe.languageIds.has(e)||jme.languageIds.has(e)||ROe.languageIds.has(e)||POe.languageIds.has(e)||kOe.languageIds.has(e)||DOe.languageIds.has(e)||NOe.languageIds.has(e)}static isTrimmedByDefault(e){return Qme.languageIds.has(e)||qme.languageIds.has(e)||jme.languageIds.has(e)}static create(e,r,n,o){if(Qme.languageIds.has(e))return new Qme(e,r,n,o);if(qme.languageIds.has(e))return new qme(e,r,n,o);if(wOe.languageIds.has(e))return new wOe(e,r,n,o);if(jme.languageIds.has(e))return new jme(e,r,n,o);if(kOe.languageIds.has(e))return new kOe(e,r,n,o);if(ROe.languageIds.has(e))return new ROe(e,r,n,o);if(POe.languageIds.has(e))return new POe(e,r,n,o);if(DOe.languageIds.has(e))return new DOe(e,r,n,o);if(NOe.languageIds.has(e))return new NOe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}constructor(e,r,n,o){this.languageId=e,this.text=r,this.startOffset=n,this.endOffset=o,this.statements=[]}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await(0,a7a.parseTreeSitter)(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}};Jme.StatementTree=fR;var Wmt=class t extends tD{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},zme=class extends fR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new Wmt(e)}getStatementQueryText(){return`[ +`)}};Hme.StatementTree=uR;var qmt=class t extends Z2{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},Qme=class extends uR{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new qmt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -857,7 +811,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (labeled_statement) (method_definition) (field_definition) - ] @statement`}},Yme=class extends fR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new Wmt(e)}getStatementQueryText(){return`[ + ] @statement`}},qme=class extends uR{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new qmt(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -880,7 +834,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},Fbr=class t extends tD{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},QOe=class extends fR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new Fbr(e)}getStatementQueryText(){return`[ + ] @statement`}},Obr=class t extends Z2{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},wOe=class extends uR{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new Obr(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -906,24 +860,24 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (decorated_definition) (match_statement) (block) - ] @statement`}},Ubr=class t extends tD{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Kme=class extends fR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new Ubr(e)}getStatementQueryText(){return`[ + ] @statement`}},Bbr=class t extends Z2{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},jme=class extends uR{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new Bbr(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},Qbr=class t extends tD{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},qOe=class extends fR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Qbr(e)}getStatementQueryText(){return`[ + ] @statement`}},Lbr=class t extends Z2{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},ROe=class extends uR{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new Lbr(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},qbr=class t extends tD{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},jOe=class extends fR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new qbr(e)}getStatementQueryText(){return`[ + ] @statement`}},Fbr=class t extends Z2{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},POe=class extends uR{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new Fbr(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},jbr=class t extends tD{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},HOe=class extends fR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new jbr(e)}getStatementQueryText(){return`[ + ] @statement`}},Ubr=class t extends Z2{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},kOe=class extends uR{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new Ubr(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -936,7 +890,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (block) (static_initializer) (constructor_declaration) - ] @statement`}},Hbr=class t extends tD{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},GOe=class extends fR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new Hbr(e)}getStatementQueryText(){return`[ + ] @statement`}},Qbr=class t extends Z2{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},DOe=class extends uR{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new Qbr(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -948,7 +902,7 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (declaration) (accessor_declaration) (block) - ] @statement`}},Gbr=class t extends tD{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},$Oe=class extends fR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new Gbr(e)}getStatementQueryText(){return`[ + ] @statement`}},qbr=class t extends Z2{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},NOe=class extends uR{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new qbr(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -985,30 +939,30 @@ ${r}+- `:"";return e+this.description+o}}};Jme.StatementNode=tD;var fR=class{sta (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}}});var Zme=I(rD=>{"use strict";p();Object.defineProperty(rD,"__esModule",{value:!0});rD.BlockPositionType=rD.TerseBlockTrimmer=rD.VerboseBlockTrimmer=rD.BlockTrimmer=void 0;rD.getBlockPositionType=LQa;var zmt=$br(),VOe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return zmt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return zmt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=zmt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};rD.BlockTrimmer=VOe;var Vbr=class extends VOe{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};rD.VerboseBlockTrimmer=Vbr;var Wbr=class extends VOe{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var FQa=nD&&nD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Rxi=nD&&nD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(nD,"__esModule",{value:!0});nD.ConfigBlockModeConfig=nD.ICompletionsBlockModeConfig=void 0;var UQa=rn(),QQa=Qs(),_4=Txi(),Pxi=Ute(),kxi=vE(),qQa=VA(),jQa=Zme(),HQa=$br();nD.ICompletionsBlockModeConfig=(0,UQa.createServiceIdentifier)("ICompletionsBlockModeConfig");var Ybr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return zbr(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(kxi.getConfig,kxi.ConfigKey.AlwaysRequestMultiline)??o)||jQa.BlockTrimmer.isTrimmedByDefault(e)?zbr(_4.BlockMode.MoreMultiline,e):e==="ruby"?_4.BlockMode.Parsing:(0,Pxi.isSupportedLanguageId)(e)?_4.BlockMode.ParsingAndServer:_4.BlockMode.Server}};nD.ConfigBlockModeConfig=Ybr;nD.ConfigBlockModeConfig=Ybr=FQa([Rxi(0,QQa.IInstantiationService),Rxi(1,qQa.ICompletionsFeaturesService)],Ybr);function GQa(t){return[_4.BlockMode.Parsing,_4.BlockMode.ParsingAndServer,_4.BlockMode.MoreMultiline].includes(t)}a(GQa,"blockModeRequiresTreeSitter");function zbr(t,e){return t===_4.BlockMode.MoreMultiline&&HQa.StatementTree.isSupported(e)?t:GQa(t)&&!(0,Pxi.isSupportedLanguageId)(e)?_4.BlockMode.Server:t}a(zbr,"toApplicableBlockMode")});var xG=I(Ymt=>{"use strict";p();Object.defineProperty(Ymt,"__esModule",{value:!0});Ymt.ResultType=void 0;var Dxi;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(Dxi||(Ymt.ResultType=Dxi={}))});var Zbr=I(Xme=>{"use strict";p();Object.defineProperty(Xme,"__esModule",{value:!0});Xme.CurrentGhostText=Xme.ICompletionsCurrentGhostText=void 0;var $Qa=rn(),VQa=xG();Xme.ICompletionsCurrentGhostText=(0,$Qa.createServiceIdentifier)("ICompletionsCurrentGhostText");var Jbr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==VQa.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&Nxi(this.choices[0].completionText,n))return WQa(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};Xme.CurrentGhostText=Jbr;function WQa(t,e){return t.filter(r=>Nxi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(WQa,"adjustChoicesStart");function Nxi(t,e){return t.startsWith(e)&&t.length>e.length}a(Nxi,"startsWithAndExceeds")});var Mxi=I($8=>{"use strict";p();var zQa=$8&&$8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},YQa=$8&&$8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($8,"__esModule",{value:!0});$8.ChangeTracker=void 0;var KQa=zb(),Xbr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};$8.ChangeTracker=Xbr;$8.ChangeTracker=Xbr=zQa([YQa(2,KQa.ICompletionsTextDocumentManagerService)],Xbr)});var t1r=I(WOe=>{"use strict";p();Object.defineProperty(WOe,"__esModule",{value:!0});WOe.CompletionState=void 0;WOe.createCompletionState=JQa;var e1r=TOe(),Kmt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??e1r.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(ege,"__esModule",{value:!0});ege.SpeculativeRequestCache=ege.ICompletionsSpeculativeRequestCache=void 0;var ZQa=rn(),XQa=H8();ege.ICompletionsSpeculativeRequestCache=(0,ZQa.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var r1r=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new XQa.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};ege.SpeculativeRequestCache=r1r});var tge=I(AC=>{"use strict";p();Object.defineProperty(AC,"__esModule",{value:!0});AC.logger=AC.GHOST_TEXT_CATEGORY=void 0;AC.telemetryShown=tqa;AC.telemetryAccepted=rqa;AC.telemetryRejected=nqa;AC.mkCanceledResultTelemetry=iqa;AC.mkBasicResultTelemetry=oqa;AC.handleGhostTextResultTelemetry=sqa;AC.resultTypeToString=n1r;var Oxi=xl(),Qte=Tg(),zOe=xG(),eqa=Jmt();AC.GHOST_TEXT_CATEGORY="ghostText";AC.logger=new Oxi.Logger("getCompletions");function tqa(t,e){t.get(eqa.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=n1r(e.resultType),(0,Qte.telemetry)(t,"ghostText.shown",e.telemetry)}a(tqa,"telemetryShown");function rqa(t,e,r){let n=e+".accepted";(0,Qte.telemetry)(t,n,r)}a(rqa,"telemetryAccepted");function nqa(t,e,r){let n=e+".rejected";(0,Qte.telemetry)(t,n,r)}a(nqa,"telemetryRejected");function iqa(t,e={}){return{...e,telemetryBlob:t}}a(iqa,"mkCanceledResultTelemetry");function oqa(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(oqa,"mkBasicResultTelemetry");function sqa(t,e){let r=t.get(Oxi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Qte.now)()-e.telemetryBlob.issuedTime,o=n1r(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` -${f.toFixed(2)} ${d}`).join("")??"";return AC.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Qte.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(AC.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Qte.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Qte.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(sqa,"handleGhostTextResultTelemetry");function n1r(t){switch(t){case zOe.ResultType.Network:return"network";case zOe.ResultType.Cache:return"cache";case zOe.ResultType.Cycling:return"cycling";case zOe.ResultType.TypingAsSuggested:return"typingAsSuggested";case zOe.ResultType.Async:return"async"}}a(n1r,"resultTypeToString")});var Fxi=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.getBlockParser=egt;rge.isEmptyBlockStart=uqa;rge.isBlockBodyFinished=dqa;rge.getNodeStart=fqa;var wG=Ute(),Zmt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,wG.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Xmt=class extends Zmt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex{"use strict";p();Object.defineProperty(X2,"__esModule",{value:!0});X2.BlockPositionType=X2.TerseBlockTrimmer=X2.VerboseBlockTrimmer=X2.BlockTrimmer=void 0;X2.getBlockPositionType=c7a;var jmt=jbr(),MOe=class{static{a(this,"BlockTrimmer")}static isSupported(e){return jmt.StatementTree.isSupported(e)}static isTrimmedByDefault(e){return jmt.StatementTree.isTrimmedByDefault(e)}constructor(e,r,n){this.languageId=e,this.prefix=r,this.completion=n}async withParsedStatementTree(e){let r=jmt.StatementTree.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length);await r.build();try{return await e(r)}finally{r[Symbol.dispose]()}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};X2.BlockTrimmer=MOe;var Hbr=class extends MOe{static{a(this,"VerboseBlockTrimmer")}constructor(e,r,n,o=10){super(e,r,n),this.lineLimit=o;let s=[...this.completion.matchAll(/\n/g)];s.length>=this.lineLimit&&this.lineLimit>0?this.offsetLimit=s[this.lineLimit-1].index:this.offsetLimit=void 0}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=this.getStatementAtCursor(e),n=this.getContainingBlockOffset(r);return this.isWithinLimit(n)||(n=this.trimToBlankLine(n)),this.isWithinLimit(n)||(n=this.trimToStatement(r,n)),n})}isWithinLimit(e){return this.offsetLimit===void 0||e!==void 0&&e<=this.offsetLimit}trimToBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)].reverse();for(;r.length>0&&!this.isWithinLimit(e);)e=r.pop().index;return e}trimToStatement(e,r){let n=this.prefix.length,o=this.prefix.length+(this.offsetLimit??this.completion.length),s=e,c=e?.nextSibling;for(;c&&c.node.endIndex<=o&&!this.hasNonStatementContentAfter(s);)s=c,c=c.nextSibling;return s&&s===e&&s.node.endIndex<=n&&(s=c),s&&s.node.endIndex>o?this.trimToStatement(s.children[0],this.asCompletionOffset(s.node.endIndex)):this.asCompletionOffset(s?.node?.endIndex)??r}};X2.VerboseBlockTrimmer=Hbr;var Gbr=class extends MOe{static{a(this,"TerseBlockTrimmer")}constructor(e,r,n,o=3,s=7){super(e,r,n),this.lineLimit=o,this.lookAhead=s;let c=[...this.completion.matchAll(/\n/g)],l=this.lineLimit+this.lookAhead;c.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=c[this.lineLimit-1].index),c.length>=l&&l>0&&(this.lookAheadOffset=c[l-1].index)}async getCompletionTrimOffset(){return await this.withParsedStatementTree(e=>{let r=e.statementAt(this.stmtStartPos()),n=this.getContainingBlockOffset(r);return n=this.trimAtFirstBlankLine(n),r&&(n=this.trimAtStatementChange(r,n)),this.limitOffset&&this.lookAheadOffset&&(n===void 0||n>this.lookAheadOffset)?this.limitOffset:n})}stmtStartPos(){let e=this.completion.match(/\S/);return e&&e.index!==void 0?this.prefix.length+e.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(e){let r=[...this.trimmedCompletion(e).matchAll(/\r?\n\s*\r?\n/g)];for(;r.length>0&&(e===void 0||e>r[0].index);){let n=r.shift();if(this.completion.substring(0,n.index).trim()!=="")return n.index}return e}trimAtStatementChange(e,r){let n=this.prefix.length,o=this.prefix.length+(r??this.completion.length);if(e.node.endIndex>n&&this.isCompoundStatement(e))return e.nextSibling&&e.node.endIndexn&&s.node.endIndex{"use strict";p();var l7a=eD&&eD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Hxi=eD&&eD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(eD,"__esModule",{value:!0});eD.ConfigBlockModeConfig=eD.ICompletionsBlockModeConfig=void 0;var u7a=tn(),d7a=Ms(),h4=Uxi(),$xi=Mte(),Gxi=_E(),f7a=JA(),p7a=Gme(),h7a=jbr();eD.ICompletionsBlockModeConfig=(0,u7a.createServiceIdentifier)("ICompletionsBlockModeConfig");var Vbr=class{static{a(this,"ConfigBlockModeConfig")}constructor(e,r){this.instantiationService=e,this.featuresService=r}forLanguage(e,r){let n=this.featuresService.overrideBlockMode(r);if(n)return $br(n,e);let o=this.featuresService.enableProgressiveReveal(r);return(this.instantiationService.invokeFunction(Gxi.getConfig,Gxi.ConfigKey.AlwaysRequestMultiline)??o)||p7a.BlockTrimmer.isTrimmedByDefault(e)?$br(h4.BlockMode.MoreMultiline,e):e==="ruby"?h4.BlockMode.Parsing:(0,$xi.isSupportedLanguageId)(e)?h4.BlockMode.ParsingAndServer:h4.BlockMode.Server}};eD.ConfigBlockModeConfig=Vbr;eD.ConfigBlockModeConfig=Vbr=l7a([Hxi(0,d7a.IInstantiationService),Hxi(1,f7a.ICompletionsFeaturesService)],Vbr);function m7a(t){return[h4.BlockMode.Parsing,h4.BlockMode.ParsingAndServer,h4.BlockMode.MoreMultiline].includes(t)}a(m7a,"blockModeRequiresTreeSitter");function $br(t,e){return t===h4.BlockMode.MoreMultiline&&h7a.StatementTree.isSupported(e)?t:m7a(t)&&!(0,$xi.isSupportedLanguageId)(e)?h4.BlockMode.Server:t}a($br,"toApplicableBlockMode")});var AG=I(Hmt=>{"use strict";p();Object.defineProperty(Hmt,"__esModule",{value:!0});Hmt.ResultType=void 0;var Vxi;(function(t){t[t.Network=0]="Network",t[t.Cache=1]="Cache",t[t.TypingAsSuggested=2]="TypingAsSuggested",t[t.Cycling=3]="Cycling",t[t.Async=4]="Async"})(Vxi||(Hmt.ResultType=Vxi={}))});var Ybr=I($me=>{"use strict";p();Object.defineProperty($me,"__esModule",{value:!0});$me.CurrentGhostText=$me.ICompletionsCurrentGhostText=void 0;var g7a=tn(),A7a=AG();$me.ICompletionsCurrentGhostText=(0,g7a.createServiceIdentifier)("ICompletionsCurrentGhostText");var zbr=class{static{a(this,"CurrentGhostText")}constructor(){this.choices=[]}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==A7a.ResultType.TypingAsSuggested&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&Wxi(this.choices[0].completionText,n))return y7a(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};$me.CurrentGhostText=zbr;function y7a(t,e){return t.filter(r=>Wxi(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(y7a,"adjustChoicesStart");function Wxi(t,e){return t.startsWith(e)&&t.length>e.length}a(Wxi,"startsWithAndExceeds")});var zxi=I(L8=>{"use strict";p();var E7a=L8&&L8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_7a=L8&&L8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(L8,"__esModule",{value:!0});L8.ChangeTracker=void 0;var v7a=qb(),Kbr=class{static{a(this,"ChangeTracker")}get offset(){return this._offset}constructor(e,r,n){this._referenceCount=0,this._isDisposed=!1,this._offset=r,this._tracker=n.onDidChangeTextDocument(o=>{if(o.document.uri===e){for(let s of o.contentChanges)if(s.rangeOffset+s.rangeLength<=this.offset){let c=s.text.length-s.rangeLength;this._offset=this._offset+c}}})}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};L8.ChangeTracker=Kbr;L8.ChangeTracker=Kbr=E7a([_7a(2,v7a.ICompletionsTextDocumentManagerService)],Kbr)});var Zbr=I(OOe=>{"use strict";p();Object.defineProperty(OOe,"__esModule",{value:!0});OOe.CompletionState=void 0;OOe.createCompletionState=C7a;var Jbr=mOe(),Gmt=class t{static{a(this,"CompletionState")}constructor(e,r,n=[],o,s,c){this._textDocument=e,this._position=r,this.originalPosition=o??Jbr.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{"use strict";p();Object.defineProperty(Vme,"__esModule",{value:!0});Vme.SpeculativeRequestCache=Vme.ICompletionsSpeculativeRequestCache=void 0;var b7a=tn(),S7a=O8();Vme.ICompletionsSpeculativeRequestCache=(0,b7a.createServiceIdentifier)("ICompletionsSpeculativeRequestCache");var Xbr=class{static{a(this,"SpeculativeRequestCache")}constructor(){this.cache=new S7a.LRUCacheMap(100)}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};Vme.SpeculativeRequestCache=Xbr});var Wme=I(hv=>{"use strict";p();Object.defineProperty(hv,"__esModule",{value:!0});hv.logger=hv.GHOST_TEXT_CATEGORY=void 0;hv.telemetryShown=I7a;hv.telemetryAccepted=x7a;hv.telemetryRejected=w7a;hv.mkCanceledResultTelemetry=R7a;hv.mkBasicResultTelemetry=P7a;hv.handleGhostTextResultTelemetry=k7a;hv.resultTypeToString=e1r;var Yxi=Tl(),Ote=Ig(),BOe=AG(),T7a=$mt();hv.GHOST_TEXT_CATEGORY="ghostText";hv.logger=new Yxi.Logger("getCompletions");function I7a(t,e){t.get(T7a.ICompletionsSpeculativeRequestCache).request(e.clientCompletionId),e.telemetry.markAsDisplayed(),e.telemetry.properties.reason=e1r(e.resultType),(0,Ote.telemetry)(t,"ghostText.shown",e.telemetry)}a(I7a,"telemetryShown");function x7a(t,e,r){let n=e+".accepted";(0,Ote.telemetry)(t,n,r)}a(x7a,"telemetryAccepted");function w7a(t,e,r){let n=e+".rejected";(0,Ote.telemetry)(t,n,r)}a(w7a,"telemetryRejected");function R7a(t,e={}){return{...e,telemetryBlob:t}}a(R7a,"mkCanceledResultTelemetry");function P7a(t){let e={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId};return t.properties.sku!==void 0&&(e.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(e.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(e.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(e.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(e.clientCompletionId=t.properties.clientCompletionId),e}a(P7a,"mkBasicResultTelemetry");function k7a(t,e){let r=t.get(Yxi.ICompletionsLogTargetService);if(e.type!=="promptOnly"){if(e.type==="success"){let n=(0,Ote.now)()-e.telemetryBlob.issuedTime,o=e1r(e.resultType),s=JSON.stringify(e.performanceMetrics),c={...e.telemetryData,reason:o,performanceMetrics:s},{foundOffset:l}=e.telemetryBlob.measurements,u=e.performanceMetrics?.map(([d,f])=>` +${f.toFixed(2)} ${d}`).join("")??"";return hv.logger.debug(r,`ghostText produced from ${o} in ${Math.round(n)}ms with foundOffset ${l}${u}`),(0,Ote.telemetryRaw)(t,"ghostText.produced",c,{timeToProduceMs:n,foundOffset:l}),e.value}if(hv.logger.debug(r,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){(0,Ote.telemetry)(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}(0,Ote.telemetryRaw)(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(k7a,"handleGhostTextResultTelemetry");function e1r(t){switch(t){case BOe.ResultType.Network:return"network";case BOe.ResultType.Cache:return"cache";case BOe.ResultType.Cycling:return"cycling";case BOe.ResultType.TypingAsSuggested:return"typingAsSuggested";case BOe.ResultType.Async:return"async"}}a(e1r,"resultTypeToString")});var Zxi=I(zme=>{"use strict";p();Object.defineProperty(zme,"__esModule",{value:!0});zme.getBlockParser=zmt;zme.isEmptyBlockStart=O7a;zme.isBlockBodyFinished=B7a;zme.getNodeStart=L7a;var yG=Mte(),Vmt=class{static{a(this,"BaseBlockParser")}constructor(e,r,n){this.languageId=e,this.nodeMatch=r,this.nodeTypesWithBlockOrStmtChild=n}async getNodeMatchAtPosition(e,r,n){let o=await(0,yG.parseTreeSitter)(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u===""?c.namedChildren[0]:c.childForFieldName(u))?.type===l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type===this.nodeMatch[o.type]);if(s){if(this.languageId==="python"&&s.parent){let c=s.parent.type===":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type==="comment";){let u=l.startPosition.row===s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Wmt=class extends Vmt{static{a(this,"RegexBasedBlockParser")}constructor(e,r,n,o,s){super(e,o,s),this.blockEmptyMatch=r,this.lineMatch=n}isBlockStart(e){return this.lineMatch.test(e.trimStart())}async isBlockBodyEmpty(e,r){let n=await this.getNextBlockAtPosition(e,r,o=>{o.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(Lxi,"rewindToNearestNonWs");function Bxi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(Bxi,"indent");function cqa(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=Bxi(t,r),o=Bxi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(cqa,"outdented");var C4=class extends Zmt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,wG.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},lqa={python:new C4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new C4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new C4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new C4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Xmt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Xmt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new C4("csharp",{},new Map([]),[],"block",null,!0),java:new C4("java",{},new Map([]),[],"block",null,!0),php:new C4("php",{},new Map([]),[],"block",null,!0),cpp:new C4("cpp",{},new Map([]),[],"block",null,!0)};function egt(t){if(!(0,wG.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return lqa[(0,wG.languageIdToWasmLanguage)(t)]}a(egt,"getBlockParser");async function uqa(t,e,r){return(0,wG.isSupportedLanguageId)(t)?egt(t).isEmptyBlockStart(e,r):!1}a(uqa,"isEmptyBlockStart");async function dqa(t,e,r,n){if((0,wG.isSupportedLanguageId)(t))return egt(t).isBlockBodyFinished(e,r,n)}a(dqa,"isBlockBodyFinished");async function fqa(t,e,r){if((0,wG.isSupportedLanguageId)(t))return egt(t).getNodeStart(e,r)}a(fqa,"getNodeStart")});var ngt=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.parsingBlockFinished=pqa;RG.isEmptyBlockStartUtil=hqa;RG.getNodeStartUtil=mqa;RG.contextIndentation=Eqa;RG.contextIndentationFromText=Uxi;RG.indentationBlockFinished=vqa;var i1r=Fxi(),rgt=Hme();function pqa(t,e){let r=t.getText(rgt.LocationFactory.range(rgt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,i1r.isBlockBodyFinished)(o,r,s,n)}a(pqa,"parsingBlockFinished");function hqa(t,e){return(0,i1r.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(hqa,"isEmptyBlockStartUtil");async function mqa(t,e,r){let o=t.getText(rgt.LocationFactory.range(rgt.LocationFactory.position(0,0),e))+r,s=await(0,i1r.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(mqa,"getNodeStartUtil");var gqa=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),Aqa=new RegExp(`^(${gqa.join("|")})`);function yqa(t){return Aqa.test(t.trimLeft().toLowerCase())}a(yqa,"isContinuationLine");function tgt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(tgt,"indentationOfLine");function Eqa(t,e){let r=t.getText(),n=t.offsetAt(e);return Uxi(r,n,t.detectedLanguageId)}a(Eqa,"contextIndentation");function Uxi(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(D7a,"getLineAtOffset");function Jxi(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(Jxi,"rewindToNearestNonWs");function Kxi(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(Kxi,"indent");function N7a(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=Kxi(t,r),o=Kxi(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(N7a,"outdented");var m4=class extends Vmt{static{a(this,"TreeSitterBasedBlockParser")}constructor(e,r,n,o,s,c,l){super(e,r,n),this.startKeywords=o,this.blockNodeType=s,this.emptyStatementType=c,this.curlyBraceLanguage=l}isBlockEmpty(e,r){let n=e.text.trim();return this.curlyBraceLanguage&&(n.startsWith("{")&&(n=n.slice(1)),n.endsWith("}")&&(n=n.slice(0,-1)),n=n.trim()),!!(n.length===0||this.languageId==="python"&&(e.parent?.type==="class_definition"||e.parent?.type==="function_definition")&&e.children.length===1&&(0,yG.queryPythonIsDocstring)(e.parent))}async isEmptyBlockStart(e,r){if(r>e.length)throw new RangeError("Invalid offset");for(let s=r;sg.type===";")&&f.endIndex<=r}f=f.parent}}let c=null,l=null,u=null,d=s;for(;d!==null;){if(d.type===this.blockNodeType){l=d;break}if(this.nodeMatch[d.type]){u=d;break}if(d.type==="ERROR"){c=d;break}d=d.parent}if(l!==null){if(!l.parent||!this.nodeMatch[l.parent.type])return!1;if(this.languageId==="python"){let f=l.previousSibling;if(f!==null&&f.hasError&&(f.text.startsWith('"""')||f.text.startsWith("'''")))return!0}return this.isBlockEmpty(l,r)}if(c!==null){if(c.previousSibling?.type==="module"||c.previousSibling?.type==="internal_module"||c.previousSibling?.type==="def")return!0;if(this.languageId==="python"&&o>=14&&c.hasError&&(c.text.startsWith('"')||c.text.startsWith("'"))){let g=c.parent?.type;if(g==="function_definition"||g==="class_definition"||g==="module")return!0}let f=[...c.children].reverse(),h=f.find(g=>this.startKeywords.includes(g.type)),m=f.find(g=>g.type===this.blockNodeType);if(h){switch(this.languageId){case"python":{h.type==="try"&&s.type==="identifier"&&s.text.length>4&&(m=f.find(y=>y.hasError)?.children.find(y=>y.type==="block"));let g,A=0;for(let y of c.children){if(y.type===":"&&A===0){g=y;break}y.type==="("&&(A+=1),y.type===")"&&(A-=1)}if(g&&h.endIndex<=g.startIndex&&g.nextSibling){if(h.type==="def"){let y=g.nextSibling;if(y.type==='"'||y.type==="'"||y.type==="ERROR"&&(y.text==='"""'||y.text==="'''"))return!0}return!1}break}case"javascript":{if(h.type==="class")if(o<=13){if(f.find(E=>E.type==="formal_parameters"))return!0}else{let y=c.children;for(let E=0;Ey.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}case"typescript":{let g=f.find(y=>y.type==="{");if(g&&g.startIndex>h.endIndex&&g.nextSibling!==null||f.find(y=>y.type==="do")&&h.type==="while"||h.type==="=>"&&h.nextSibling&&h.nextSibling.type!=="{")return!1;break}}return m&&m.startIndex>h.endIndex?this.isBlockEmpty(m,r):!0}}if(u!==null){let f=this.nodeMatch[u.type],h=u.children.slice().reverse().find(m=>m.type===f);if(h)return this.isBlockEmpty(h,r);if(this.nodeTypesWithBlockOrStmtChild.has(u.type)){let m=this.nodeTypesWithBlockOrStmtChild.get(u.type),g=m===""?u.children[0]:u.childForFieldName(m);if(g&&g.type!==this.blockNodeType&&g.type!==this.emptyStatementType)return!1}return!0}return!1}finally{n.delete()}}},M7a={python:new m4("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new m4("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new m4("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new m4("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Wmt("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Wmt("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new m4("csharp",{},new Map([]),[],"block",null,!0),java:new m4("java",{},new Map([]),[],"block",null,!0),php:new m4("php",{},new Map([]),[],"block",null,!0),cpp:new m4("cpp",{},new Map([]),[],"block",null,!0)};function zmt(t){if(!(0,yG.isSupportedLanguageId)(t))throw new Error(`Language ${t} is not supported`);return M7a[(0,yG.languageIdToWasmLanguage)(t)]}a(zmt,"getBlockParser");async function O7a(t,e,r){return(0,yG.isSupportedLanguageId)(t)?zmt(t).isEmptyBlockStart(e,r):!1}a(O7a,"isEmptyBlockStart");async function B7a(t,e,r,n){if((0,yG.isSupportedLanguageId)(t))return zmt(t).isBlockBodyFinished(e,r,n)}a(B7a,"isBlockBodyFinished");async function L7a(t,e,r){if((0,yG.isSupportedLanguageId)(t))return zmt(t).getNodeStart(e,r)}a(L7a,"getNodeStart")});var Jmt=I(EG=>{"use strict";p();Object.defineProperty(EG,"__esModule",{value:!0});EG.parsingBlockFinished=F7a;EG.isEmptyBlockStartUtil=U7a;EG.getNodeStartUtil=Q7a;EG.contextIndentation=G7a;EG.contextIndentationFromText=Xxi;EG.indentationBlockFinished=W7a;var t1r=Zxi(),Kmt=Ome();function F7a(t,e){let r=t.getText(Kmt.LocationFactory.range(Kmt.LocationFactory.position(0,0),e)),n=t.offsetAt(e),o=t.detectedLanguageId;return s=>(0,t1r.isBlockBodyFinished)(o,r,s,n)}a(F7a,"parsingBlockFinished");function U7a(t,e){return(0,t1r.isEmptyBlockStart)(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(U7a,"isEmptyBlockStartUtil");async function Q7a(t,e,r){let o=t.getText(Kmt.LocationFactory.range(Kmt.LocationFactory.position(0,0),e))+r,s=await(0,t1r.getNodeStart)(t.detectedLanguageId,o,t.offsetAt(e));if(s)return t.positionAt(s)}a(Q7a,"getNodeStartUtil");var q7a=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),j7a=new RegExp(`^(${q7a.join("|")})`);function H7a(t){return j7a.test(t.trimLeft().toLowerCase())}a(H7a,"isContinuationLine");function Ymt(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Ymt,"indentationOfLine");function G7a(t,e){let r=t.getText(),n=t.offsetAt(e);return Xxi(r,n,t.detectedLanguageId)}a(G7a,"contextIndentation");function Xxi(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=tgt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=tgt(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Ymt(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Ymt(n[f]);if(h!==void 0&&h{let n=Cqa(r,t,e);return n==="continue"?void 0:n}}a(vqa,"indentationBlockFinished")});var YOe=I(kg=>{"use strict";p();Object.defineProperty(kg,"__esModule",{value:!0});kg.languageMarkers=void 0;kg.mdCodeBlockLangToLanguageId=bqa;kg.isShebangLine=Iqa;kg.hasLanguageMarker=qxi;kg.comment=jxi;kg.commentBlockAsSingles=xqa;kg.getLanguageMarker=wqa;kg.getPathMarker=Rqa;kg.newLineEnded=kqa;kg.getLanguage=Pqa;kg.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var o1r={};for(let[t,e]of Object.entries(kg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)o1r[r]=t;else o1r[t]=t;function bqa(t){return o1r[t]}a(bqa,"mdCodeBlockLangToLanguageId");var Sqa={start:"//",end:""},Tqa=["php","plaintext"],s1r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function Iqa(t){return Object.values(s1r).includes(t.trim())}a(Iqa,"isShebangLine");function qxi({source:t}){return t.startsWith("#!")||t.startsWith("{let n=V7a(r,t,e);return n==="continue"?void 0:n}}a(W7a,"indentationBlockFinished")});var LOe=I(kg=>{"use strict";p();Object.defineProperty(kg,"__esModule",{value:!0});kg.languageMarkers=void 0;kg.mdCodeBlockLangToLanguageId=z7a;kg.isShebangLine=J7a;kg.hasLanguageMarker=twi;kg.comment=rwi;kg.commentBlockAsSingles=Z7a;kg.getLanguageMarker=X7a;kg.getPathMarker=eQa;kg.newLineEnded=tQa;kg.getLanguage=rQa;kg.languageMarkers={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}};var r1r={};for(let[t,e]of Object.entries(kg.languageMarkers))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)r1r[r]=t;else r1r[t]=t;function z7a(t){return r1r[t]}a(z7a,"mdCodeBlockLangToLanguageId");var Y7a={start:"//",end:""},K7a=["php","plaintext"],n1r={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function J7a(t){return Object.values(n1r).includes(t.trim())}a(J7a,"isShebangLine");function twi({source:t}){return t.startsWith("#!")||t.startsWith("jxi(s,e)).join(` +`).map(s=>rwi(s,e)).join(` `);return r?o+` -`:o}a(xqa,"commentBlockAsSingles");function wqa(t){let{languageId:e}=t;return Tqa.indexOf(e)===-1&&!qxi(t)?e in s1r?s1r[e]:`Language: ${e}`:""}a(wqa,"getLanguageMarker");function Rqa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(Rqa,"getPathMarker");function kqa(t){return t===""||t.endsWith(` +`:o}a(Z7a,"commentBlockAsSingles");function X7a(t){let{languageId:e}=t;return K7a.indexOf(e)===-1&&!twi(t)?e in n1r?n1r[e]:`Language: ${e}`:""}a(X7a,"getLanguageMarker");function eQa(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(eQa,"getPathMarker");function tQa(t){return t===""||t.endsWith(` `)?t:t+` -`}a(kqa,"newLineEnded");function Pqa(t){return Qxi(typeof t=="string"?t:"plaintext")}a(Pqa,"getLanguage");function Qxi(t){return kg.languageMarkers[t]!==void 0?{languageId:t,...kg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(Qxi,"_getLanguage")});var c1r=I(a1r=>{"use strict";p();Object.defineProperty(a1r,"__esModule",{value:!0});a1r.getCursorContext=Mqa;var Hxi=Lme(),Dqa={tokenizerName:Hxi.TokenizerName.o200k};function Nqa(t){return{...Dqa,...t}}a(Nqa,"cursorContextOptions");function Mqa(t,e={}){let r=Nqa(e),n=(0,Hxi.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`}a(tQa,"newLineEnded");function rQa(t){return ewi(typeof t=="string"?t:"plaintext")}a(rQa,"getLanguage");function ewi(t){return kg.languageMarkers[t]!==void 0?{languageId:t,...kg.languageMarkers[t]}:{languageId:t,lineComment:{start:"//",end:""}}}a(ewi,"_getLanguage")});var o1r=I(i1r=>{"use strict";p();Object.defineProperty(i1r,"__esModule",{value:!0});i1r.getCursorContext=oQa;var nwi=Rme(),nQa={tokenizerName:nwi.TokenizerName.o200k};function iQa(t){return{...nQa,...t}}a(iQa,"cursorContextOptions");function oQa(t,e={}){let r=iQa(e),n=(0,nwi.getTokenizer)(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(Mqa,"getCursorContext")});var l1r=I(qte=>{"use strict";p();Object.defineProperty(qte,"__esModule",{value:!0});qte.SnippetSemantics=qte.SnippetProviderType=void 0;qte.announceSnippet=Bqa;var Gxi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(Gxi||(qte.SnippetProviderType=Gxi={}));var Yb;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(Yb||(qte.SnippetSemantics=Yb={}));var Oqa={[Yb.Function]:"function",[Yb.Snippet]:"snippet",[Yb.Snippets]:"snippets",[Yb.Variable]:"variable",[Yb.Parameter]:"parameter",[Yb.Method]:"method",[Yb.Class]:"class",[Yb.Module]:"module",[Yb.Alias]:"alias",[Yb.Enum]:"enum member",[Yb.Interface]:"interface"};function Bqa(t){let e=Oqa[t.semantics],r=[Yb.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(Bqa,"announceSnippet")});var p1r=I(Hte=>{"use strict";p();Object.defineProperty(Hte,"__esModule",{value:!0});Hte.WindowedMatcher=Hte.SortOptions=void 0;Hte.splitIntoWords=Wxi;var $xi=l1r(),u1r=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}},jte;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(jte||(Hte.SortOptions=jte={}));var d1r=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=Uqa.get(e.languageId)??Fqa}tokenize(e){return new Set(Wxi(e).filter(r=>!this.stopsForLanguage.has(r)))}},Vxi=new u1r(20),f1r=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new d1r(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=jte.Descending){return r===jte.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===jte.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=jte.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=Vxi.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(Wxi,"splitIntoWords");var Lqa=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),Fqa=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...Lqa]),Uqa=new Map([])});var h1r=I(pR=>{"use strict";p();Object.defineProperty(pR,"__esModule",{value:!0});pR.virtualNode=Qqa;pR.lineNode=qqa;pR.blankNode=jqa;pR.topNode=Hqa;pR.isBlank=Gqa;pR.isLine=$qa;pR.isVirtual=zxi;pR.isTop=Yxi;pR.cutTreeAfterLine=Vqa;pR.duplicateTree=Wqa;function Qqa(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(Qqa,"virtualNode");function qqa(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(qqa,"lineNode");function jqa(t){return{type:"blank",lineNumber:t,subs:[]}}a(jqa,"blankNode");function Hqa(t){return{type:"top",indentation:-1,subs:t??[]}}a(Hqa,"topNode");function Gqa(t){return t.type==="blank"}a(Gqa,"isBlank");function $qa(t){return t.type==="line"}a($qa,"isLine");function zxi(t){return t.type==="virtual"}a(zxi,"isVirtual");function Yxi(t){return t.type==="top"}a(Yxi,"isTop");function Vqa(t,e){function r(n){if(!zxi(n)&&!Yxi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(v4,"__esModule",{value:!0});v4.clearLabels=zqa;v4.clearLabelsIf=Yqa;v4.mapLabels=g1r;v4.resetLineNumbers=Kqa;v4.visitTree=KOe;v4.visitTreeConditionally=Jqa;v4.foldTree=Zqa;v4.rebuildTree=Xqa;var m1r=h1r();function zqa(t){return KOe(t,e=>{e.label=void 0},"bottomUp"),t}a(zqa,"clearLabels");function Yqa(t,e){return KOe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Yqa,"clearLabelsIf");function g1r(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>g1r(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>g1r(r,e)),label:t.label?e(t.label):void 0}}}a(g1r,"mapLabels");function Kqa(t){let e=0;function r(n){!(0,m1r.isVirtual)(n)&&!(0,m1r.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),KOe(t,r,"topDown")}a(Kqa,"resetLineNumbers");function KOe(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(KOe,"visitTree");function Jqa(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a(Jqa,"visitTreeConditionally");function Zqa(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),KOe(t,s,n),o}a(Zqa,"foldTree");function Xqa(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,m1r.topNode)()}a(Xqa,"rebuildTree")});var twi=I(iD=>{"use strict";p();Object.defineProperty(iD,"__esModule",{value:!0});iD.parseRaw=Kxi;iD.labelLines=Jxi;iD.labelVirtualInherited=eja;iD.buildLabelRules=Zxi;iD.combineClosersAndOpeners=Xxi;iD.groupBlocks=tja;iD.flattenVirtual=rja;iD.registerLanguageSpecificParser=oja;iD.parseTree=sja;var Pg=h1r(),nge=A1r();function Kxi(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,Pg.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,nge.visitTree)(t,r,"bottomUp")}a(Jxi,"labelLines");function eja(t){function e(r){if((0,Pg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Pg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,nge.visitTree)(t,e,"bottomUp")}a(eja,"labelVirtualInherited");function Zxi(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(Zxi,"buildLabelRules");function Xxi(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,Pg.isLine)(l)||(0,Pg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Pg.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,Pg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Pg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,nge.rebuildTree)(t,e);return(0,nge.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(Xxi,"combineClosersAndOpeners");function tja(t,e=Pg.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,Pg.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(igt,"__esModule",{value:!0});igt.getBasicWindowDelineations=cja;igt.getIndentationWindowsDelineations=lja;var rwi=A1r(),aja=twi();function cja(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(lja,"getIndentationWindowsDelineations")});var iwi=I(JOe=>{"use strict";p();Object.defineProperty(JOe,"__esModule",{value:!0});JOe.FixedWindowSizeJaccardMatcher=void 0;JOe.computeScore=nwi;var uja=c1r(),dja=p1r(),fja=y1r(),E1r=class t extends dja.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,fja.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,uja.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return nwi(e,r)}};JOe.FixedWindowSizeJaccardMatcher=E1r;function nwi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(nwi,"computeScore")});var swi=I(ogt=>{"use strict";p();Object.defineProperty(ogt,"__esModule",{value:!0});ogt.BlockTokenSubsetMatcher=void 0;var pja=Ute(),owi=c1r(),hja=p1r(),mja=y1r(),_1r=class t extends hja.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,mja.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,owi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,owi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return gja(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,pja.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};ogt.BlockTokenSubsetMatcher=_1r;function gja(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(gja,"computeScore")});var sgt=I(oD=>{"use strict";p();Object.defineProperty(oD,"__esModule",{value:!0});oD.defaultCppSimilarFilesOptions=oD.nullSimilarFilesOptions=oD.conservativeFilesOptions=oD.defaultSimilarFilesOptions=void 0;oD.getSimilarSnippets=Sja;var Aja=iwi(),yja=swi(),Eja=0,_ja=60,Cja=4,vja=1,awi=20,cwi=1e4;oD.defaultSimilarFilesOptions={snippetLength:_ja,threshold:Eja,maxTopSnippets:Cja,maxCharPerFile:cwi,maxNumberOfFiles:awi,maxSnippetsPerFile:vja,useSubsetMatching:!1};oD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:cwi,maxNumberOfFiles:awi,maxSnippetsPerFile:1};oD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};oD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function bja(t,e){return(e.useSubsetMatching?yja.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):Aja.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(bja,"getMatcher");async function Sja(t,e,r){let n=bja(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(Sja,"getSimilarSnippets")});var uwi=I(agt=>{"use strict";p();Object.defineProperty(agt,"__esModule",{value:!0});agt.getCppSimilarFilesOptions=Ija;agt.getCppNumberOfSnippets=xja;var lwi=sgt(),Tja=cgt();function Ija(t,e){return{...lwi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,Tja.useSubsetMatching)(t,e)}}a(Ija,"getCppSimilarFilesOptions");function xja(t){return lwi.defaultCppSimilarFilesOptions.maxTopSnippets}a(xja,"getCppNumberOfSnippets")});var cgt=I(ZOe=>{"use strict";p();Object.defineProperty(ZOe,"__esModule",{value:!0});ZOe.getSimilarFilesOptions=Dja;ZOe.getNumberOfSnippets=Mja;ZOe.useSubsetMatching=pwi;var wja=yG(),Rja=sgt(),dwi=vE(),kja=Dht(),fwi=uwi(),Pja=new Map([["cpp",fwi.getCppSimilarFilesOptions]]);function Dja(t,e,r){let n=Pja.get(r);return n?n(t,e):{...Rja.defaultSimilarFilesOptions,useSubsetMatching:pwi(t,e)}}a(Dja,"getSimilarFilesOptions");var Nja=new Map([["cpp",fwi.getCppNumberOfSnippets]]);function Mja(t,e){let r=Nja.get(e);return r?r(t):wja.DEFAULT_NUM_SNIPPETS}a(Mja,"getNumberOfSnippets");function pwi(t,e){return(e.filtersAndExp.exp.variables[kja.ExpTreatmentVariables.UseSubsetMatching]||(0,dwi.getConfig)(t,dwi.ConfigKey.UseSubsetMatching))??!1}a(pwi,"useSubsetMatching")});var XOe=I(Gte=>{"use strict";p();Object.defineProperty(Gte,"__esModule",{value:!0});Gte.convertToAPIChoice=Fja;Gte.getTemperatureForSamples=qja;Gte.getStops=Hja;Gte.getTopP=Gja;Gte.getMaxSolutionTokens=$ja;var Oja=um(),Bja=yG(),hwi=xl(),Lja=Tg();function Fja(t,e,r,n,o,s,c){return(0,Lja.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:Uja(t,r),meanAlternativeLogProb:Qja(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,Oja.generateUuid)(),finishReason:r.finish_reason}}a(Fja,"convertToAPIChoice");function Uja(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){hwi.logger.exception(t,r,"Error calculating mean prob")}}a(Uja,"calculateMeanLogProb");function Qja(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){hwi.logger.exception(t,r,"Error calculating mean prob")}}a(Qja,"calculateMeanAlternativeLogProb");function qja(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(qja,"getTemperatureForSamples");var jja={markdown:[` +`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(oQa,"getCursorContext")});var s1r=I(Bte=>{"use strict";p();Object.defineProperty(Bte,"__esModule",{value:!0});Bte.SnippetSemantics=Bte.SnippetProviderType=void 0;Bte.announceSnippet=aQa;var iwi;(function(t){t.SimilarFiles="similar-files",t.Path="path"})(iwi||(Bte.SnippetProviderType=iwi={}));var jb;(function(t){t.Function="function",t.Snippet="snippet",t.Snippets="snippets",t.Variable="variable",t.Parameter="parameter",t.Method="method",t.Class="class",t.Module="module",t.Alias="alias",t.Enum="enum member",t.Interface="interface"})(jb||(Bte.SnippetSemantics=jb={}));var sQa={[jb.Function]:"function",[jb.Snippet]:"snippet",[jb.Snippets]:"snippets",[jb.Variable]:"variable",[jb.Parameter]:"parameter",[jb.Method]:"method",[jb.Class]:"class",[jb.Module]:"module",[jb.Alias]:"alias",[jb.Enum]:"enum member",[jb.Interface]:"interface"};function aQa(t){let e=sQa[t.semantics],r=[jb.Snippets].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(aQa,"announceSnippet")});var u1r=I(Fte=>{"use strict";p();Object.defineProperty(Fte,"__esModule",{value:!0});Fte.WindowedMatcher=Fte.SortOptions=void 0;Fte.splitIntoWords=awi;var owi=s1r(),a1r=class{static{a(this,"FifoCache")}constructor(e){this.keys=[],this.cache={},this.size=e}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}},Lte;(function(t){t.Ascending="ascending",t.Descending="descending",t.None="none"})(Lte||(Fte.SortOptions=Lte={}));var c1r=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=uQa.get(e.languageId)??lQa}tokenize(e){return new Set(awi(e).filter(r=>!this.stopsForLanguage.has(r)))}},swi=new a1r(20),l1r=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new c1r(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r=Lte.Descending){return r===Lte.Ascending?e.sort((n,o)=>n.score>o.score?1:-1):r===Lte.Descending?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r=Lte.Descending){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=swi.get(s)??[],l=c.length===0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(awi,"splitIntoWords");var cQa=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),lQa=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...cQa]),uQa=new Map([])});var d1r=I(dR=>{"use strict";p();Object.defineProperty(dR,"__esModule",{value:!0});dR.virtualNode=dQa;dR.lineNode=fQa;dR.blankNode=pQa;dR.topNode=hQa;dR.isBlank=mQa;dR.isLine=gQa;dR.isVirtual=cwi;dR.isTop=lwi;dR.cutTreeAfterLine=AQa;dR.duplicateTree=yQa;function dQa(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(dQa,"virtualNode");function fQa(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(fQa,"lineNode");function pQa(t){return{type:"blank",lineNumber:t,subs:[]}}a(pQa,"blankNode");function hQa(t){return{type:"top",indentation:-1,subs:t??[]}}a(hQa,"topNode");function mQa(t){return t.type==="blank"}a(mQa,"isBlank");function gQa(t){return t.type==="line"}a(gQa,"isLine");function cwi(t){return t.type==="virtual"}a(cwi,"isVirtual");function lwi(t){return t.type==="top"}a(lwi,"isTop");function AQa(t,e){function r(n){if(!cwi(n)&&!lwi(n)&&n.lineNumber===e)return n.subs=[],!0;for(let o=0;o{"use strict";p();Object.defineProperty(g4,"__esModule",{value:!0});g4.clearLabels=EQa;g4.clearLabelsIf=_Qa;g4.mapLabels=p1r;g4.resetLineNumbers=vQa;g4.visitTree=FOe;g4.visitTreeConditionally=CQa;g4.foldTree=bQa;g4.rebuildTree=SQa;var f1r=d1r();function EQa(t){return FOe(t,e=>{e.label=void 0},"bottomUp"),t}a(EQa,"clearLabels");function _Qa(t,e){return FOe(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(_Qa,"clearLabelsIf");function p1r(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>p1r(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>p1r(r,e)),label:t.label?e(t.label):void 0}}}a(p1r,"mapLabels");function vQa(t){let e=0;function r(n){!(0,f1r.isVirtual)(n)&&!(0,f1r.isTop)(n)&&(n.lineNumber=e,e++)}a(r,"visitor"),FOe(t,r,"topDown")}a(vQa,"resetLineNumbers");function FOe(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(FOe,"visitTree");function CQa(t,e,r){function n(o){if(r==="topDown"&&!e(o))return!1;let s=!0;return o.subs.forEach(c=>{s=s&&n(c)}),r==="bottomUp"&&(s=s&&e(o)),s}a(n,"_visit"),n(t)}a(CQa,"visitTreeConditionally");function bQa(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),FOe(t,s,n),o}a(bQa,"foldTree");function SQa(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:(0,f1r.topNode)()}a(SQa,"rebuildTree")});var mwi=I(tD=>{"use strict";p();Object.defineProperty(tD,"__esModule",{value:!0});tD.parseRaw=uwi;tD.labelLines=dwi;tD.labelVirtualInherited=TQa;tD.buildLabelRules=fwi;tD.combineClosersAndOpeners=pwi;tD.groupBlocks=IQa;tD.flattenVirtual=xQa;tD.registerLanguageSpecificParser=PQa;tD.parseTree=kQa;var Dg=d1r(),Yme=h1r();function uwi(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[(0,Dg.lineNode)(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),(0,Yme.visitTree)(t,r,"bottomUp")}a(dwi,"labelLines");function TQa(t){function e(r){if((0,Dg.isVirtual)(r)&&r.label===void 0){let n=r.subs.filter(o=>!(0,Dg.isBlank)(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),(0,Yme.visitTree)(t,e,"bottomUp")}a(TQa,"labelVirtualInherited");function fwi(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(fwi,"buildLabelRules");function pwi(t){let e=a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&((0,Dg.isLine)(l)||(0,Dg.isVirtual)(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&(0,Dg.isBlank)(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[(0,Dg.virtualNode)(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),(0,Dg.isBlank)(l)||(s=l)}return n.subs=o,n},"rebuilder"),r=(0,Yme.rebuildTree)(t,e);return(0,Yme.clearLabelsIf)(t,n=>n==="newVirtual"),r}a(pwi,"combineClosersAndOpeners");function IQa(t,e=Dg.isBlank,r){let n=a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=(0,Dg.virtualNode)(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{"use strict";p();Object.defineProperty(Zmt,"__esModule",{value:!0});Zmt.getBasicWindowDelineations=NQa;Zmt.getIndentationWindowsDelineations=MQa;var gwi=h1r(),DQa=mwi();function NQa(t,e){let r=[],n=e.length;if(n===0)return[];if(n{if(c.type==="blank"){c.label={totalLength:1,firstLineAfter:c.lineNumber+1};return}let l=c.type==="line"?1:0,u=c.type==="line"?c.lineNumber+1:NaN;function d(A){return A===-1?u-l:c.subs[A].label.firstLineAfter-c.subs[A].label.totalLength}a(d,"getStartLine");function f(A,y){return A===0?y+1:c.subs[A-1].label.firstLineAfter}a(f,"getEndLine");let h=c.type==="line"?-1:0,m=c.type==="line"?1:0,g=0;for(let A=0;A=0&&hn){let y=d(h),E=f(A,y),_=g===A?E:f(g,y);for(r<=E-y&&o.push([y,_]);m>n;)m-=h===-1?c.type==="line"?1:0:c.subs[h].label.totalLength,h++}}if(hc[0]-l[0]||c[1]-l[1]).filter((c,l,u)=>l===0||c[0]!==u[l-1][0]||c[1]!==u[l-1][1])}a(MQa,"getIndentationWindowsDelineations")});var ywi=I(UOe=>{"use strict";p();Object.defineProperty(UOe,"__esModule",{value:!0});UOe.FixedWindowSizeJaccardMatcher=void 0;UOe.computeScore=Awi;var OQa=o1r(),BQa=u1r(),LQa=m1r(),g1r=class t extends BQa.WindowedMatcher{static{a(this,"FixedWindowSizeJaccardMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,LQa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,OQa.getCursorContext)(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return Awi(e,r)}};UOe.FixedWindowSizeJaccardMatcher=g1r;function Awi(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(Awi,"computeScore")});var _wi=I(Xmt=>{"use strict";p();Object.defineProperty(Xmt,"__esModule",{value:!0});Xmt.BlockTokenSubsetMatcher=void 0;var FQa=Mte(),Ewi=o1r(),UQa=u1r(),QQa=m1r(),A1r=class t extends UQa.WindowedMatcher{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=e=>({to:a(r=>new t(r,e),"to")})}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return(0,QQa.getBasicWindowDelineations)(this.windowLength,e)}_getCursorContextInfo(e){return(0,Ewi.getCursorContext)(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):(0,Ewi.getCursorContext)(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return qQa(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await(0,FQa.parseTreeSitter)(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};Xmt.BlockTokenSubsetMatcher=A1r;function qQa(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(qQa,"computeScore")});var egt=I(rD=>{"use strict";p();Object.defineProperty(rD,"__esModule",{value:!0});rD.defaultCppSimilarFilesOptions=rD.nullSimilarFilesOptions=rD.conservativeFilesOptions=rD.defaultSimilarFilesOptions=void 0;rD.getSimilarSnippets=YQa;var jQa=ywi(),HQa=_wi(),GQa=0,$Qa=60,VQa=4,WQa=1,vwi=20,Cwi=1e4;rD.defaultSimilarFilesOptions={snippetLength:$Qa,threshold:GQa,maxTopSnippets:VQa,maxCharPerFile:Cwi,maxNumberOfFiles:vwi,maxSnippetsPerFile:WQa,useSubsetMatching:!1};rD.conservativeFilesOptions={snippetLength:10,threshold:.3,maxTopSnippets:1,maxCharPerFile:Cwi,maxNumberOfFiles:vwi,maxSnippetsPerFile:1};rD.nullSimilarFilesOptions={snippetLength:0,threshold:1,maxTopSnippets:0,maxCharPerFile:0,maxNumberOfFiles:0,maxSnippetsPerFile:0};rD.defaultCppSimilarFilesOptions={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function zQa(t,e){return(e.useSubsetMatching?HQa.BlockTokenSubsetMatcher.FACTORY(e.snippetLength):jQa.FixedWindowSizeJaccardMatcher.FACTORY(e.snippetLength)).to(t)}a(zQa,"getMatcher");async function YQa(t,e,r){let n=zQa(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(YQa,"getSimilarSnippets")});var Swi=I(tgt=>{"use strict";p();Object.defineProperty(tgt,"__esModule",{value:!0});tgt.getCppSimilarFilesOptions=JQa;tgt.getCppNumberOfSnippets=ZQa;var bwi=egt(),KQa=rgt();function JQa(t,e){return{...bwi.defaultCppSimilarFilesOptions,useSubsetMatching:(0,KQa.useSubsetMatching)(t,e)}}a(JQa,"getCppSimilarFilesOptions");function ZQa(t){return bwi.defaultCppSimilarFilesOptions.maxTopSnippets}a(ZQa,"getCppNumberOfSnippets")});var rgt=I(QOe=>{"use strict";p();Object.defineProperty(QOe,"__esModule",{value:!0});QOe.getSimilarFilesOptions=nqa;QOe.getNumberOfSnippets=oqa;QOe.useSubsetMatching=xwi;var XQa=uG(),eqa=egt(),Twi=_E(),tqa=Mht(),Iwi=Swi(),rqa=new Map([["cpp",Iwi.getCppSimilarFilesOptions]]);function nqa(t,e,r){let n=rqa.get(r);return n?n(t,e):{...eqa.defaultSimilarFilesOptions,useSubsetMatching:xwi(t,e)}}a(nqa,"getSimilarFilesOptions");var iqa=new Map([["cpp",Iwi.getCppNumberOfSnippets]]);function oqa(t,e){let r=iqa.get(e);return r?r(t):XQa.DEFAULT_NUM_SNIPPETS}a(oqa,"getNumberOfSnippets");function xwi(t,e){return(e.filtersAndExp.exp.variables[tqa.ExpTreatmentVariables.UseSubsetMatching]||(0,Twi.getConfig)(t,Twi.ConfigKey.UseSubsetMatching))??!1}a(xwi,"useSubsetMatching")});var qOe=I(Ute=>{"use strict";p();Object.defineProperty(Ute,"__esModule",{value:!0});Ute.convertToAPIChoice=lqa;Ute.getTemperatureForSamples=fqa;Ute.getStops=hqa;Ute.getTopP=mqa;Ute.getMaxSolutionTokens=gqa;var sqa=fm(),aqa=uG(),wwi=Tl(),cqa=Ig();function lqa(t,e,r,n,o,s,c){return(0,cqa.logEngineCompletion)(t,e,r,o,n),{completionText:e,meanLogProb:uqa(t,r),meanAlternativeLogProb:dqa(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:(0,sqa.generateUuid)(),finishReason:r.finish_reason}}a(lqa,"convertToAPIChoice");function uqa(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){wwi.logger.exception(t,r,"Error calculating mean prob")}}a(uqa,"calculateMeanLogProb");function dqa(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){wwi.logger.exception(t,r,"Error calculating mean prob")}}a(dqa,"calculateMeanAlternativeLogProb");function fqa(t,e){return t.isRunningInTest()||e<=1?0:e<10?.2:e<20?.4:.8}a(fqa,"getTemperatureForSamples");var pqa={markdown:[` `],python:[` @@ -1016,31 +970,31 @@ def `,` class `,` if `,` -#`]};function Hja(t){return jja[t??""]??[` +#`]};function hqa(t){return pqa[t??""]??[` -`,"\n```"]}a(Hja,"getStops");function Gja(){return 1}a(Gja,"getTopP");function $ja(){return Bja.DEFAULT_MAX_COMPLETION_LENGTH}a($ja,"getMaxSolutionTokens")});var b4=I(e5e=>{"use strict";p();Object.defineProperty(e5e,"__esModule",{value:!0});e5e.Fragment=gwi;e5e.jsx=mwi;e5e.jsxs=mwi;function mwi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(mwi,"functionComponentFunction");function gwi(t){return{type:"f",children:t}}a(gwi,"fragmentFunction");gwi.isFragmentFunction=!0});var sD=I(C1r=>{"use strict";p();Object.defineProperty(C1r,"__esModule",{value:!0});C1r.es5ClassCompat=Vja;function Vja(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(Vja,"es5ClassCompat")});var ige=I(Vte=>{"use strict";p();var Wja=Vte&&Vte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$te;Object.defineProperty(Vte,"__esModule",{value:!0});Vte.Position=void 0;var lgt=Ts(),zja=sD(),v1r=$te=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,lgt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new $te(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,lgt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new $te(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};Vte.Position=v1r;Vte.Position=v1r=$te=Wja([zja.es5ClassCompat],v1r)});var S4=I(kG=>{"use strict";p();var Yja=kG&&kG.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},V8;Object.defineProperty(kG,"__esModule",{value:!0});kG.Range=void 0;kG.getDebugDescriptionOfRange=Awi;var Kja=Ts(),Jja=sD(),yC=ige(),b1r=V8=class{static{a(this,"Range")}static isRange(e){return e instanceof V8?!0:!e||typeof e!="object"?!1:yC.Position.isPosition(e.start)&&yC.Position.isPosition(e.end)}static of(e){if(e instanceof V8)return e;if(this.isRange(e))return new V8(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new yC.Position(e,r),c=new yC.Position(n,o)):yC.Position.isPosition(e)&&yC.Position.isPosition(r)&&(s=yC.Position.of(e),c=yC.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return V8.isRange(e)?this.contains(e.start)&&this.contains(e.end):yC.Position.isPosition(e)?!(yC.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=yC.Position.Max(e.start,this._start),n=yC.Position.Min(e.end,this._end);if(!r.isAfter(n))return new V8(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=yC.Position.Min(e.start,this._start),n=yC.Position.Max(e.end,this.end);return new V8(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,Kja.illegalArgument)();let n;return e?yC.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new V8(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return Awi(this)}};kG.Range=b1r;kG.Range=b1r=V8=Yja([Jja.es5ClassCompat],b1r);function Awi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(Awi,"getDebugDescriptionOfRange")});var T1r=I(Kb=>{"use strict";p();var _wi=Kb&&Kb.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(Kb,"__esModule",{value:!0});Kb.Diagnostic=Kb.DiagnosticRelatedInformation=Kb.DiagnosticSeverity=Kb.DiagnosticTag=void 0;var ywi=El(),Zja=Ku(),Cwi=sD(),vwi=S4(),Ewi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(Ewi||(Kb.DiagnosticTag=Ewi={}));var ugt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(ugt||(Kb.DiagnosticSeverity=ugt={}));var dgt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&vwi.Range.isRange(e.location.range)&&Zja.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};Kb.DiagnosticRelatedInformation=dgt;Kb.DiagnosticRelatedInformation=dgt=_wi([Cwi.es5ClassCompat],dgt);var S1r=class{static{a(this,"Diagnostic")}constructor(e,r,n=ugt.Error){if(!vwi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:ugt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,ywi.equals)(e.tags,r.tags)&&(0,ywi.equals)(e.relatedInformation,r.relatedInformation,dgt.isEqual)}};Kb.Diagnostic=S1r;Kb.Diagnostic=S1r=_wi([Cwi.es5ClassCompat],S1r)});var w1r=I(Wte=>{"use strict";p();var Xja=Wte&&Wte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},I1r;Object.defineProperty(Wte,"__esModule",{value:!0});Wte.Location=void 0;var eHa=Ku(),tHa=sD(),rHa=ige(),fgt=S4(),x1r=I1r=class{static{a(this,"Location")}static isLocation(e){return e instanceof I1r?!0:e?fgt.Range.isRange(e.range)&&eHa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(fgt.Range.isRange(r))this.range=fgt.Range.of(r);else if(rHa.Position.isPosition(r))this.range=new fgt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Wte.Location=x1r;Wte.Location=x1r=I1r=Xja([tHa.es5ClassCompat],x1r)});var bwi=I(D1r=>{"use strict";p();Object.defineProperty(D1r,"__esModule",{value:!0});D1r.getKoreanAltChars=nHa;function nHa(t){let e=iHa(t);if(e&&e.length>0)return new Uint32Array(e)}a(nHa,"getKoreanAltChars");var Jb=0,PG=new Uint32Array(10);function iHa(t){if(Jb=0,T4(t,R1r,4352),Jb>0||(T4(t,k1r,4449),Jb>0)||(T4(t,P1r,4520),Jb>0)||(T4(t,zte,12593),Jb))return PG.subarray(0,Jb);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return PG.subarray(0,Jb)}}a(iHa,"disassembleKorean");function T4(t,e,r){t>=r&&t>8&&(PG[Jb++]=t>>8&255),t>>16&&(PG[Jb++]=t>>16&255))}a(oHa,"addCodesToBuffer");var R1r=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),k1r=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),P1r=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),zte=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var Iwi=I(oge=>{"use strict";p();Object.defineProperty(oge,"__esModule",{value:!0});oge.tryNormalizeToBase=void 0;oge.normalizeNFC=aHa;oge.normalizeNFD=Swi;var N1r=bP(),sHa=new N1r.LRUCache(1e4);function aHa(t){return Twi(t,"NFC",sHa)}a(aHa,"normalizeNFC");var cHa=new N1r.LRUCache(1e4);function Swi(t){return Twi(t,"NFD",cHa)}a(Swi,"normalizeNFD");var lHa=/[^\u0000-\u0080]/;function Twi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return lHa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(Twi,"normalize");oge.tryNormalizeToBase=(function(){let t=new N1r.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=Swi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var Vwi=I(ac=>{"use strict";p();var uHa=ac&&ac.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dHa=ac&&ac.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fHa=ac&&ac.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(Nwi,"_matchesPrefix");function Mwi(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(Mwi,"matchesContiguousSubString");function mHa(t,e){if(t.length>e.length)return null;t=(0,mgt.tryNormalizeToBase)(t),e=(0,mgt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(mHa,"matchesBaseContiguousSubString");function Owi(t,e){return t.length>e.length?null:B1r(t.toLowerCase(),e.toLowerCase(),0,0)}a(Owi,"matchesSubString");function B1r(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=B1r(t,e,r+1,n+1))?G1r({start:n,end:n+1},o):null}return B1r(t,e,r,n+1)}a(B1r,"_matchesSubString");function j1r(t){return 97<=t&&t<=122}a(j1r,"isLower");function n5e(t){return 65<=t&&t<=90}a(n5e,"isUpper");function H1r(t){return 48<=t&&t<=57}a(H1r,"isNumber");function Bwi(t){return t===32||t===9||t===10||t===13}a(Bwi,"isWhitespace");var Lwi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>Lwi.add(t.charCodeAt(0)));function ggt(t){return Bwi(t)||Lwi.has(t)}a(ggt,"isWordSeparator");function xwi(t,e){return t===e||ggt(t)&&ggt(e)}a(xwi,"charactersMatch");var M1r=new Map;function wwi(t){if(M1r.has(t))return M1r.get(t);let e,r=(0,hHa.getKoreanAltChars)(t);return r&&(e=r),M1r.set(t,e),e}a(wwi,"getAlternateCodes");function Fwi(t){return j1r(t)||n5e(t)||H1r(t)}a(Fwi,"isAlphanumeric");function G1r(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(G1r,"join");function Uwi(t,e){for(let r=e;r0&&!Fwi(t.charCodeAt(r-1)))return r}return t.length}a(Uwi,"nextAnchor");function L1r(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=L1r(t,e,r+1,n+1);!o&&(s=Uwi(e,s)).6}a(AHa,"isUpperCaseWord");function yHa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(yHa,"isCamelCaseWord");function EHa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=gHa(e);if(!yHa(r)){if(!AHa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&ggt(t.charCodeAt(r-1)))return r;return t.length}a(Qwi,"nextWord");var vHa=q1r(ac.matchesPrefix,$1r,Mwi),bHa=q1r(ac.matchesPrefix,$1r,Owi),kwi=new pHa.LRUCache(1e4);function SHa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=kwi.get(t);n||(n=new RegExp(Q1r.convertSimple2RegExpPattern(t),"i"),kwi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?bHa(t,e):vHa(t,e)}a(SHa,"matchesFuzzy");function THa(t,e){let r=r5e(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?qwi(r):null}a(THa,"matchesFuzzy2");function IHa(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(qwi,"createMatches");var NG=128;function V1r(){let t=[],e=[];for(let r=0;r<=NG;r++)e[r]=0;for(let r=0;r<=NG;r++)t.push(e.slice(0));return t}a(V1r,"initTable");function jwi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(jwi,"initArr");var Hwi=jwi(2*NG),U1r=jwi(2*NG),I4=V1r(),DG=V1r(),t5e=V1r(),xHa=!1;function O1r(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} +`,"\n```"]}a(hqa,"getStops");function mqa(){return 1}a(mqa,"getTopP");function gqa(){return aqa.DEFAULT_MAX_COMPLETION_LENGTH}a(gqa,"getMaxSolutionTokens")});var A4=I(jOe=>{"use strict";p();Object.defineProperty(jOe,"__esModule",{value:!0});jOe.Fragment=Pwi;jOe.jsx=Rwi;jOe.jsxs=Rwi;function Rwi(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(Rwi,"functionComponentFunction");function Pwi(t){return{type:"f",children:t}}a(Pwi,"fragmentFunction");Pwi.isFragmentFunction=!0});var nD=I(y1r=>{"use strict";p();Object.defineProperty(y1r,"__esModule",{value:!0});y1r.es5ClassCompat=Aqa;function Aqa(t){return Object.assign(t,{apply:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let n=r.length===1?[]:r[1];return Reflect.construct(t,n,r[0].constructor)}},"apply"),call:a(function(...r){if(r.length===0)return Reflect.construct(t,[]);{let[n,...o]=r;return Reflect.construct(t,o,n.constructor)}},"call")})}a(Aqa,"es5ClassCompat")});var Kme=I(qte=>{"use strict";p();var yqa=qte&&qte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Qte;Object.defineProperty(qte,"__esModule",{value:!0});qte.Position=void 0;var ngt=bs(),Eqa=nD(),E1r=Qte=class{static{a(this,"Position")}static Min(...e){if(e.length===0)throw new TypeError;let r=e[0];for(let n=1;ne.line?1:this._charactere._character?1:0}translate(e,r=0){if(e===null||r===null)throw(0,ngt.illegalArgument)();let n;return typeof e>"u"?n=0:typeof e=="number"?n=e:(n=typeof e.lineDelta=="number"?e.lineDelta:0,r=typeof e.characterDelta=="number"?e.characterDelta:0),n===0&&r===0?this:new Qte(this.line+n,this.character+r)}with(e,r=this.character){if(e===null||r===null)throw(0,ngt.illegalArgument)();let n;return typeof e>"u"?n=this.line:typeof e=="number"?n=e:(n=typeof e.line=="number"?e.line:this.line,r=typeof e.character=="number"?e.character:this.character),n===this.line&&r===this.character?this:new Qte(n,r)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};qte.Position=E1r;qte.Position=E1r=Qte=yqa([Eqa.es5ClassCompat],E1r)});var y4=I(_G=>{"use strict";p();var _qa=_G&&_G.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},F8;Object.defineProperty(_G,"__esModule",{value:!0});_G.Range=void 0;_G.getDebugDescriptionOfRange=kwi;var vqa=bs(),Cqa=nD(),mv=Kme(),_1r=F8=class{static{a(this,"Range")}static isRange(e){return e instanceof F8?!0:!e||typeof e!="object"?!1:mv.Position.isPosition(e.start)&&mv.Position.isPosition(e.end)}static of(e){if(e instanceof F8)return e;if(this.isRange(e))return new F8(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new mv.Position(e,r),c=new mv.Position(n,o)):mv.Position.isPosition(e)&&mv.Position.isPosition(r)&&(s=mv.Position.of(e),c=mv.Position.of(r)),!s||!c)throw new Error("Invalid arguments");s.isBefore(c)?(this._start=s,this._end=c):(this._start=c,this._end=s)}contains(e){return F8.isRange(e)?this.contains(e.start)&&this.contains(e.end):mv.Position.isPosition(e)?!(mv.Position.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){let r=mv.Position.Max(e.start,this._start),n=mv.Position.Min(e.end,this._end);if(!r.isAfter(n))return new F8(r,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let r=mv.Position.Min(e.start,this._start),n=mv.Position.Max(e.end,this.end);return new F8(r,n)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,r=this.end){if(e===null||r===null)throw(0,vqa.illegalArgument)();let n;return e?mv.Position.isPosition(e)?n=e:(n=e.start||this.start,r=e.end||this.end):n=this.start,n.isEqual(this._start)&&r.isEqual(this.end)?this:new F8(n,r)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return kwi(this)}};_G.Range=_1r;_G.Range=_1r=F8=_qa([Cqa.es5ClassCompat],_1r);function kwi(t){return t.isEmpty?`[${t.start.line}:${t.start.character})`:`[${t.start.line}:${t.start.character} -> ${t.end.line}:${t.end.character})`}a(kwi,"getDebugDescriptionOfRange")});var C1r=I(Hb=>{"use strict";p();var Mwi=Hb&&Hb.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};Object.defineProperty(Hb,"__esModule",{value:!0});Hb.Diagnostic=Hb.DiagnosticRelatedInformation=Hb.DiagnosticSeverity=Hb.DiagnosticTag=void 0;var Dwi=ml(),bqa=Vu(),Owi=nD(),Bwi=y4(),Nwi;(function(t){t[t.Unnecessary=1]="Unnecessary",t[t.Deprecated=2]="Deprecated"})(Nwi||(Hb.DiagnosticTag=Nwi={}));var igt;(function(t){t[t.Hint=3]="Hint",t[t.Information=2]="Information",t[t.Warning=1]="Warning",t[t.Error=0]="Error"})(igt||(Hb.DiagnosticSeverity=igt={}));var ogt=class{static{a(this,"DiagnosticRelatedInformation")}static is(e){return e?typeof e.message=="string"&&e.location&&Bwi.Range.isRange(e.location.range)&&bqa.URI.isUri(e.location.uri):!1}constructor(e,r){this.location=e,this.message=r}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.location.range.isEqual(r.location.range)&&e.location.uri.toString()===r.location.uri.toString()}};Hb.DiagnosticRelatedInformation=ogt;Hb.DiagnosticRelatedInformation=ogt=Mwi([Owi.es5ClassCompat],ogt);var v1r=class{static{a(this,"Diagnostic")}constructor(e,r,n=igt.Error){if(!Bwi.Range.isRange(e))throw new TypeError("range must be set");if(!r)throw new TypeError("message must be set");this.range=e,this.message=r,this.severity=n}toJSON(){return{severity:igt[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,r){return e===r?!0:!e||!r?!1:e.message===r.message&&e.severity===r.severity&&e.code===r.code&&e.severity===r.severity&&e.source===r.source&&e.range.isEqual(r.range)&&(0,Dwi.equals)(e.tags,r.tags)&&(0,Dwi.equals)(e.relatedInformation,r.relatedInformation,ogt.isEqual)}};Hb.Diagnostic=v1r;Hb.Diagnostic=v1r=Mwi([Owi.es5ClassCompat],v1r)});var T1r=I(jte=>{"use strict";p();var Sqa=jte&&jte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},b1r;Object.defineProperty(jte,"__esModule",{value:!0});jte.Location=void 0;var Tqa=Vu(),Iqa=nD(),xqa=Kme(),sgt=y4(),S1r=b1r=class{static{a(this,"Location")}static isLocation(e){return e instanceof b1r?!0:e?sgt.Range.isRange(e.range)&&Tqa.URI.isUri(e.uri):!1}constructor(e,r){if(this.uri=e,r)if(sgt.Range.isRange(r))this.range=sgt.Range.of(r);else if(xqa.Position.isPosition(r))this.range=new sgt.Range(r,r);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};jte.Location=S1r;jte.Location=S1r=b1r=Sqa([Iqa.es5ClassCompat],S1r)});var Lwi=I(R1r=>{"use strict";p();Object.defineProperty(R1r,"__esModule",{value:!0});R1r.getKoreanAltChars=wqa;function wqa(t){let e=Rqa(t);if(e&&e.length>0)return new Uint32Array(e)}a(wqa,"getKoreanAltChars");var Gb=0,vG=new Uint32Array(10);function Rqa(t){if(Gb=0,E4(t,I1r,4352),Gb>0||(E4(t,x1r,4449),Gb>0)||(E4(t,w1r,4520),Gb>0)||(E4(t,Hte,12593),Gb))return vG.subarray(0,Gb);if(t>=44032&&t<=55203){let e=t-44032,r=e%588,n=Math.floor(e/588),o=Math.floor(r/28),s=r%28-1;if(n=0&&(s0)return vG.subarray(0,Gb)}}a(Rqa,"disassembleKorean");function E4(t,e,r){t>=r&&t>8&&(vG[Gb++]=t>>8&255),t>>16&&(vG[Gb++]=t>>16&255))}a(Pqa,"addCodesToBuffer");var I1r=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),x1r=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),w1r=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Hte=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108])});var Qwi=I(Jme=>{"use strict";p();Object.defineProperty(Jme,"__esModule",{value:!0});Jme.tryNormalizeToBase=void 0;Jme.normalizeNFC=Dqa;Jme.normalizeNFD=Fwi;var P1r=XP(),kqa=new P1r.LRUCache(1e4);function Dqa(t){return Uwi(t,"NFC",kqa)}a(Dqa,"normalizeNFC");var Nqa=new P1r.LRUCache(1e4);function Fwi(t){return Uwi(t,"NFD",Nqa)}a(Fwi,"normalizeNFD");var Mqa=/[^\u0000-\u0080]/;function Uwi(t,e,r){if(!t)return t;let n=r.get(t);if(n)return n;let o;return Mqa.test(t)?o=t.normalize(e):o=t,r.set(t,o),o}a(Uwi,"normalize");Jme.tryNormalizeToBase=(function(){let t=new P1r.LRUCache(1e4),e=/[\u0300-\u036f]/g;return function(r){let n=t.get(r);if(n)return n;let o=Fwi(r).replace(e,""),s=(o.length===r.length?o:r).toLowerCase();return t.set(r,s),s}})()});var sRi=I(ac=>{"use strict";p();var Oqa=ac&&ac.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Bqa=ac&&ac.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Lqa=ac&&ac.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o0?[{start:0,end:e.length}]:[]:null}a(Wwi,"_matchesPrefix");function zwi(t,e){if(t.length>e.length)return null;let r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?null:[{start:r,end:r+t.length}]}a(zwi,"matchesContiguousSubString");function Qqa(t,e){if(t.length>e.length)return null;t=(0,lgt.tryNormalizeToBase)(t),e=(0,lgt.tryNormalizeToBase)(e);let r=e.indexOf(t);return r===-1?null:[{start:r,end:r+t.length}]}a(Qqa,"matchesBaseContiguousSubString");function Ywi(t,e){return t.length>e.length?null:N1r(t.toLowerCase(),e.toLowerCase(),0,0)}a(Ywi,"matchesSubString");function N1r(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]===e[n]){let o=null;return(o=N1r(t,e,r+1,n+1))?q1r({start:n,end:n+1},o):null}return N1r(t,e,r,n+1)}a(N1r,"_matchesSubString");function U1r(t){return 97<=t&&t<=122}a(U1r,"isLower");function $Oe(t){return 65<=t&&t<=90}a($Oe,"isUpper");function Q1r(t){return 48<=t&&t<=57}a(Q1r,"isNumber");function Kwi(t){return t===32||t===9||t===10||t===13}a(Kwi,"isWhitespace");var Jwi=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>Jwi.add(t.charCodeAt(0)));function ugt(t){return Kwi(t)||Jwi.has(t)}a(ugt,"isWordSeparator");function qwi(t,e){return t===e||ugt(t)&&ugt(e)}a(qwi,"charactersMatch");var k1r=new Map;function jwi(t){if(k1r.has(t))return k1r.get(t);let e,r=(0,Uqa.getKoreanAltChars)(t);return r&&(e=r),k1r.set(t,e),e}a(jwi,"getAlternateCodes");function Zwi(t){return U1r(t)||$Oe(t)||Q1r(t)}a(Zwi,"isAlphanumeric");function q1r(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}a(q1r,"join");function Xwi(t,e){for(let r=e;r0&&!Zwi(t.charCodeAt(r-1)))return r}return t.length}a(Xwi,"nextAnchor");function M1r(t,e,r,n){if(r===t.length)return[];if(n===e.length)return null;if(t[r]!==e[n].toLowerCase())return null;{let o=null,s=n+1;for(o=M1r(t,e,r+1,n+1);!o&&(s=Xwi(e,s)).6}a(jqa,"isUpperCaseWord");function Hqa(t){let{upperPercent:e,lowerPercent:r,alphaPercent:n,numericPercent:o}=t;return r>.2&&e<.8&&n>.6&&o<.2}a(Hqa,"isCamelCaseWord");function Gqa(t){let e=0,r=0,n=0,o=0;for(let s=0;s60&&(e=e.substring(0,60));let r=qqa(e);if(!Hqa(r)){if(!jqa(r))return null;e=e.toLowerCase()}let n=null,o=0;for(t=t.toLowerCase();o0&&ugt(t.charCodeAt(r-1)))return r;return t.length}a(eRi,"nextWord");var Wqa=F1r(ac.matchesPrefix,j1r,zwi),zqa=F1r(ac.matchesPrefix,j1r,Ywi),Gwi=new Fqa.LRUCache(1e4);function Yqa(t,e,r=!1){if(typeof t!="string"||typeof e!="string")return null;let n=Gwi.get(t);n||(n=new RegExp(L1r.convertSimple2RegExpPattern(t),"i"),Gwi.set(t,n));let o=n.exec(e);return o?[{start:o.index,end:o.index+o[0].length}]:r?zqa(t,e):Wqa(t,e)}a(Yqa,"matchesFuzzy");function Kqa(t,e){let r=GOe(t,t.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?tRi(r):null}a(Kqa,"matchesFuzzy2");function Jqa(t,e,r,n,o,s){let c=Math.min(13,t.length);for(;r"u")return[];let e=[],r=t[1];for(let n=t.length-1;n>1;n--){let o=t[n]+r,s=e[e.length-1];s&&s.end===o?s.end=o+1:e.push({start:o,end:o+1})}return e}a(tRi,"createMatches");var bG=128;function H1r(){let t=[],e=[];for(let r=0;r<=bG;r++)e[r]=0;for(let r=0;r<=bG;r++)t.push(e.slice(0));return t}a(H1r,"initTable");function rRi(t){let e=[];for(let r=0;r<=t;r++)e[r]=0;return e}a(rRi,"initArr");var nRi=rRi(2*bG),B1r=rRi(2*bG),_4=H1r(),CG=H1r(),HOe=H1r(),Zqa=!1;function D1r(t,e,r,n,o){function s(l,u,d=" "){for(;l.lengths(l,3)).join("|")} `;for(let l=0;l<=r;l++)l===0?c+=" |":c+=`${e[l-1]}|`,c+=t[l].slice(0,o+1).map(u=>s(u.toString(),3)).join("|")+` -`;return c}a(O1r,"printTable");function wHa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(O1r(DG,t,t.length,r,r.length)),console.log(O1r(t5e,t,t.length,r,r.length)),console.log(O1r(I4,t,t.length,r,r.length))}a(wHa,"printTables");function pgt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Q1r.isEmojiImprecise(r)}}a(pgt,"isSeparatorAtPos");function Pwi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a(Pwi,"isWhitespaceAtPos");function hgt(t,e,r){return e[t]!==r[t]}a(hgt,"isUpperCaseAtPos");function Gwi(t,e,r,n,o,s,c=!1){for(;eNG?NG:t.length,u=n.length>NG?NG:n.length;if(r>=l||s>=u||l-r>u-s||!Gwi(e,r,l,o,s,u,!0))return;RHa(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=k?DG[d][f-1]+(I4[d][f-1]>0?-5:0):0,N=m>v+1&&I4[d][f-1]>0,L=N?DG[d][f-2]+(I4[d][f-2]>0?-5:0):0;if(N&&(!k||L>=D)&&(!R||L>=x))DG[d][f]=L,t5e[d][f]=3,I4[d][f]=0;else if(k&&(!R||D>=x))DG[d][f]=D,t5e[d][f]=2,I4[d][f]=0;else if(R)DG[d][f]=x,t5e[d][f]=1,I4[d][f]=I4[d-1][f-1]+1;else throw new Error("not possible")}}if(xHa&&wHa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[DG[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=t5e[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!hgt(v+s-1,n,o)&&y+1>I4[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(r5e,"fuzzyScore");function RHa(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(U1r[c]=l,c--),l--}a(RHa,"_fillInMaxWordMatchPos");function kHa(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:hgt(c,o,s)&&(c===0||!hgt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):pgt(s,c)&&(c===0||!pgt(s,c-1))?h=5:(pgt(s,c-1)||Pwi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=hgt(c,o,s)||pgt(s,c-1)||Pwi(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(kHa,"_doScore");function PHa(t,e,r,n,o,s,c){return $wi(t,e,r,n,o,s,!0,c)}a(PHa,"fuzzyScoreGracefulAggressive");function DHa(t,e,r,n,o,s,c){return $wi(t,e,r,n,o,s,!1,c)}a(DHa,"fuzzyScoreGraceful");function $wi(t,e,r,n,o,s,c,l){let u=r5e(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a($wi,"fuzzyScoreWithPermutations");function NHa(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(NHa,"nextTypoPermutation")});var zwi=I(MG=>{"use strict";p();Object.defineProperty(MG,"__esModule",{value:!0});MG.escapeIcons=LHa;MG.markdownEscapeEscapedIcons=UHa;MG.stripIcons=qHa;MG.getCodiconAriaLabel=jHa;MG.parseLabelWithIcons=HHa;MG.matchesFuzzyIconAware=GHa;var Wwi=Vwi(),MHa=Gh(),z1r=Spr(),OHa="$(",Y1r=new RegExp(`\\$\\(${z1r.ThemeIcon.iconNameExpression}(?:${z1r.ThemeIcon.iconModifierExpression})?\\)`,"g"),BHa=new RegExp(`(\\\\)?${Y1r.source}`,"g");function LHa(t){return t.replace(BHa,(e,r)=>r?e:`\\${e}`)}a(LHa,"escapeIcons");var FHa=new RegExp(`\\\\${Y1r.source}`,"g");function UHa(t){return t.replace(FHa,e=>`\\${e}`)}a(UHa,"markdownEscapeEscapedIcons");var QHa=new RegExp(`(\\s)?(\\\\)?${Y1r.source}(\\s)?`,"g");function qHa(t){return t.indexOf(OHa)===-1?t:t.replace(QHa,(e,r,n,o)=>n?e:r||o||"")}a(qHa,"stripIcons");function jHa(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(jHa,"getCodiconAriaLabel");var W1r=new RegExp(`\\$\\(${z1r.ThemeIcon.iconNameCharacter}+\\)`,"g");function HHa(t){W1r.lastIndex=0;let e="",r=[],n=0;for(;;){let o=W1r.lastIndex,s=W1r.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(JA,"__esModule",{value:!0});JA.MarkdownString=void 0;JA.isEmptyMarkdownString=Ywi;JA.isMarkdownString=Kwi;JA.markdownStringEqual=KHa;JA.escapeMarkdownSyntaxTokens=_gt;JA.escapeMarkdownLinkLabel=JHa;JA.appendEscapedMarkdownCodeBlockFence=Jwi;JA.appendEscapedMarkdownInlineCode=ZHa;JA.escapeDoubleQuotes=XHa;JA.removeMarkdownEscapes=eGa;JA.parseHrefAndDimensions=tGa;JA.createMarkdownLink=Zwi;JA.createMarkdownCommandLink=rGa;JA.createCommandUri=Xwi;var $Ha=Ts(),VHa=zwi(),WHa=yK(),zHa=xP(),YHa=Gh(),ygt=Ku(),Egt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?ygt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,$Ha.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=_gt(this.supportThemeIcons?(0,VHa.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ +`;return c}a(D1r,"printTable");function Xqa(t,e,r,n){t=t.substr(e),r=r.substr(n),console.log(D1r(CG,t,t.length,r,r.length)),console.log(D1r(HOe,t,t.length,r,r.length)),console.log(D1r(_4,t,t.length,r,r.length))}a(Xqa,"printTables");function agt(t,e){if(e<0||e>=t.length)return!1;let r=t.codePointAt(e);switch(r){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!L1r.isEmojiImprecise(r)}}a(agt,"isSeparatorAtPos");function $wi(t,e){if(e<0||e>=t.length)return!1;switch(t.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}a($wi,"isWhitespaceAtPos");function cgt(t,e,r){return e[t]!==r[t]}a(cgt,"isUpperCaseAtPos");function iRi(t,e,r,n,o,s,c=!1){for(;ebG?bG:t.length,u=n.length>bG?bG:n.length;if(r>=l||s>=u||l-r>u-s||!iRi(e,r,l,o,s,u,!0))return;eja(l,u,r,s,e,o);let d=1,f=1,h=r,m=s,g=[!1];for(d=1,h=r;hv,D=P?CG[d][f-1]+(_4[d][f-1]>0?-5:0):0,N=m>v+1&&_4[d][f-1]>0,B=N?CG[d][f-2]+(_4[d][f-2]>0?-5:0):0;if(N&&(!P||B>=D)&&(!R||B>=x))CG[d][f]=B,HOe[d][f]=3,_4[d][f]=0;else if(P&&(!R||D>=x))CG[d][f]=D,HOe[d][f]=2,_4[d][f]=0;else if(R)CG[d][f]=x,HOe[d][f]=1,_4[d][f]=_4[d-1][f-1]+1;else throw new Error("not possible")}}if(Zqa&&Xqa(t,r,n,s),!g[0]&&!c.firstMatchCanBeWeak)return;d--,f--;let A=[CG[d][f],s],y=0,E=0;for(;d>=1;){let v=f;do{let b=HOe[d][v];if(b===3)v=v-2;else if(b===2)v=v-1;else break}while(v>=1);y>1&&e[r+d-1]===o[s+f-1]&&!cgt(v+s-1,n,o)&&y+1>_4[d][v]&&(v=f),v===f?y++:y=1,E||(E=v),d--,f=v-1,A.push(f)}u-s===l&&c.boostFullMatch&&(A[0]+=2);let _=E-l;return A[0]-=_,A}a(GOe,"fuzzyScore");function eja(t,e,r,n,o,s){let c=t-1,l=e-1;for(;c>=r&&l>=n;)o[c]===s[l]&&(B1r[c]=l,c--),l--}a(eja,"_fillInMaxWordMatchPos");function tja(t,e,r,n,o,s,c,l,u,d,f){if(e[r]!==s[c])return Number.MIN_SAFE_INTEGER;let h=1,m=!1;return c===r-n?h=t[r]===o[c]?7:5:cgt(c,o,s)&&(c===0||!cgt(c-1,o,s))?(h=t[r]===o[c]?7:5,m=!0):agt(s,c)&&(c===0||!agt(s,c-1))?h=5:(agt(s,c-1)||$wi(s,c-1))&&(h=5,m=!0),h>1&&r===n&&(f[0]=!0),m||(m=cgt(c,o,s)||agt(s,c-1)||$wi(s,c-1)),r===n?c>u&&(h-=m?3:5):d?h+=m?2:0:h+=m?0:1,c+1===l&&(h-=m?3:5),h}a(tja,"_doScore");function rja(t,e,r,n,o,s,c){return oRi(t,e,r,n,o,s,!0,c)}a(rja,"fuzzyScoreGracefulAggressive");function nja(t,e,r,n,o,s,c){return oRi(t,e,r,n,o,s,!1,c)}a(nja,"fuzzyScoreGraceful");function oRi(t,e,r,n,o,s,c,l){let u=GOe(t,e,r,n,o,s,l);if(u&&!c)return u;if(t.length>=3){let d=Math.min(7,t.length-1);for(let f=r+1;fu[0])&&(u=m))}}}return u}a(oRi,"fuzzyScoreWithPermutations");function ija(t,e){if(e+1>=t.length)return;let r=t[e],n=t[e+1];if(r!==n)return t.slice(0,e)+n+r+t.slice(e+2)}a(ija,"nextTypoPermutation")});var cRi=I(SG=>{"use strict";p();Object.defineProperty(SG,"__esModule",{value:!0});SG.escapeIcons=cja;SG.markdownEscapeEscapedIcons=uja;SG.stripIcons=fja;SG.getCodiconAriaLabel=pja;SG.parseLabelWithIcons=hja;SG.matchesFuzzyIconAware=mja;var aRi=sRi(),oja=Oh(),$1r=Mpr(),sja="$(",V1r=new RegExp(`\\$\\(${$1r.ThemeIcon.iconNameExpression}(?:${$1r.ThemeIcon.iconModifierExpression})?\\)`,"g"),aja=new RegExp(`(\\\\)?${V1r.source}`,"g");function cja(t){return t.replace(aja,(e,r)=>r?e:`\\${e}`)}a(cja,"escapeIcons");var lja=new RegExp(`\\\\${V1r.source}`,"g");function uja(t){return t.replace(lja,e=>`\\${e}`)}a(uja,"markdownEscapeEscapedIcons");var dja=new RegExp(`(\\s)?(\\\\)?${V1r.source}(\\s)?`,"g");function fja(t){return t.indexOf(sja)===-1?t:t.replace(dja,(e,r,n,o)=>n?e:r||o||"")}a(fja,"stripIcons");function pja(t){return t?t.replace(/\$\((.*?)\)/g,(e,r)=>` ${r} `).trim():""}a(pja,"getCodiconAriaLabel");var G1r=new RegExp(`\\$\\(${$1r.ThemeIcon.iconNameCharacter}+\\)`,"g");function hja(t){G1r.lastIndex=0;let e="",r=[],n=0;for(;;){let o=G1r.lastIndex,s=G1r.exec(t),c=t.substring(o,s?.index);if(c.length>0){e+=c;for(let l=0;l{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.MarkdownString=void 0;ty.isEmptyMarkdownString=lRi;ty.isMarkdownString=uRi;ty.markdownStringEqual=vja;ty.escapeMarkdownSyntaxTokens=hgt;ty.escapeMarkdownLinkLabel=Cja;ty.appendEscapedMarkdownCodeBlockFence=dRi;ty.appendEscapedMarkdownInlineCode=bja;ty.escapeDoubleQuotes=Sja;ty.removeMarkdownEscapes=Tja;ty.parseHrefAndDimensions=Ija;ty.createMarkdownLink=fRi;ty.createMarkdownCommandLink=xja;ty.createCommandUri=pRi;var gja=bs(),Aja=cRi(),yja=uY(),Eja=ak(),_ja=Oh(),fgt=Vu(),pgt=class t{static{a(this,"MarkdownString")}static lift(e){let r=new t(e.value,e);return r.uris=e.uris,r.baseUri=e.baseUri?fgt.URI.revive(e.baseUri):void 0,r}constructor(e="",r=!1){if(this.value=e,typeof this.value!="string")throw(0,gja.illegalArgument)("value");typeof r=="boolean"?(this.isTrusted=r,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=r.isTrusted??void 0,this.supportThemeIcons=r.supportThemeIcons??!1,this.supportHtml=r.supportHtml??!1,this.supportAlertSyntax=r.supportAlertSyntax??!1)}appendText(e,r=0){return this.value+=hgt(this.supportThemeIcons?(0,Aja.escapeIcons)(e):e).replace(/([ \t]+)/g,(n,o)=>" ".repeat(o.length)).replace(/\>/gm,"\\>").replace(/\n/g,r===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,r){return this.value+=` -${Jwi(r,e)} -`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,YHa.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};JA.MarkdownString=Egt;function Ywi(t){return Kwi(t)?!t.value:Array.isArray(t)?t.every(Ywi):!0}a(Ywi,"isEmptyMarkdownString");function Kwi(t){return t instanceof Egt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(Kwi,"isMarkdownString");function KHa(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,zHa.isEqual)(ygt.URI.from(t.baseUri),ygt.URI.from(e.baseUri)))}a(KHa,"markdownStringEqual");function _gt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(_gt,"escapeMarkdownSyntaxTokens");function JHa(t){return t.replace(/[\\\]]/g,"\\$&")}a(JHa,"escapeMarkdownLinkLabel");function Jwi(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` -`)}a(Jwi,"appendEscapedMarkdownCodeBlockFence");function ZHa(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(ZHa,"appendEscapedMarkdownInlineCode");function XHa(t){return t.replace(/"/g,""")}a(XHa,"escapeDoubleQuotes");function eGa(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(eGa,"removeMarkdownEscapes");function tGa(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(tGa,"parseHrefAndDimensions");function Zwi(t,e,r,n=!0){return`[${n?_gt(t):t}](${e}${r?` "${_gt(r)}"`:""})`}a(Zwi,"createMarkdownLink");function rGa(t,e=!0){let r=Xwi(t.id,...t.arguments||[]).toString();return Zwi(t.text,r,t.tooltip,e)}a(rGa,"createMarkdownCommandLink");function Xwi(t,...e){return ygt.URI.from({scheme:WHa.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(Xwi,"createCommandUri")});var Z1r=I(Yte=>{"use strict";p();var nGa=Yte&&Yte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},K1r;Object.defineProperty(Yte,"__esModule",{value:!0});Yte.MarkdownString=void 0;var iGa=eRi(),oGa=sD(),J1r=K1r=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof K1r?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new iGa.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};Yte.MarkdownString=J1r;Yte.MarkdownString=J1r=K1r=nGa([oGa.es5ClassCompat],J1r)});var nRi=I(W8=>{"use strict";p();Object.defineProperty(W8,"__esModule",{value:!0});W8.Mimes=void 0;W8.getMediaOrTextMime=aGa;W8.getMediaMime=rRi;W8.getExtensionForMimeType=cGa;W8.normalizeMimeType=uGa;W8.isTextStreamMime=dGa;var tRi=hA();W8.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var sGa={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},X1r={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function aGa(t){let e=(0,tRi.extname)(t),r=sGa[e.toLowerCase()];return r!==void 0?r:rRi(t)}a(aGa,"getMediaOrTextMime");function rRi(t){let e=(0,tRi.extname)(t),r=X1r[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(rRi,"getMediaMime");function cGa(t){for(let e in X1r){let r=X1r[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(cGa,"getExtensionForMimeType");var lGa=/^(.+)\/(.+?)(;.+)?$/;function uGa(t,e){let r=lGa.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(uGa,"normalizeMimeType");function dGa(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(dGa,"isTextStreamMime")});var sRi=I(hm=>{"use strict";p();var fGa=hm&&hm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},OG;Object.defineProperty(hm,"__esModule",{value:!0});hm.NotebookCellOutput=hm.NotebookCellOutputItem=hm.NotebookEdit=hm.NotebookData=hm.NotebookCellData=hm.NotebookRange=hm.NotebookCellKind=void 0;var pGa=sD(),iRi=Ts(),Cgt=nRi(),hGa=um(),oRi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(oRi||(hm.NotebookCellKind=oRi={}));var Kte=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,iRi.illegalArgument)("start must be positive");if(r<0)throw(0,iRi.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};hm.NotebookRange=Kte;var eSr=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};hm.NotebookCellData=eSr;var tSr=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};hm.NotebookData=tSr;var rSr=OG=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof OG?!0:e?Kte.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new OG(e,r)}static insertCells(e,r){return new OG(new Kte(e,e),r)}static deleteCells(e){return new OG(e,[])}static updateCellMetadata(e,r){let n=new OG(new Kte(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new OG(new Kte(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};hm.NotebookEdit=rSr;hm.NotebookEdit=rSr=OG=fGa([pGa.es5ClassCompat],rSr);var nSr=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=Cgt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,Cgt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};hm.NotebookCellOutputItem=nSr;var iSr=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,hGa.generateUuid)(),this.metadata=r??n)}};hm.NotebookCellOutput=iSr});var cRi=I(LG=>{"use strict";p();var mGa=LG&&LG.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},oSr;Object.defineProperty(LG,"__esModule",{value:!0});LG.Selection=void 0;LG.getDebugDescriptionOfSelection=aRi;var gGa=sD(),BG=ige(),sSr=S4(),aSr=oSr=class extends sSr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof oSr?!0:!e||typeof e!="object"?!1:sSr.Range.isRange(e)&&BG.Position.isPosition(e.anchor)&&BG.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new BG.Position(e,r),c=new BG.Position(n,o)):BG.Position.isPosition(e)&&BG.Position.isPosition(r)&&(s=BG.Position.of(e),c=BG.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return aRi(this)}};LG.Selection=aSr;LG.Selection=aSr=oSr=mGa([gGa.es5ClassCompat],aSr);function aRi(t){let e=(0,sSr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(aRi,"getDebugDescriptionOfSelection")});var lSr=I(Zte=>{"use strict";p();var AGa=Zte&&Zte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Jte;Object.defineProperty(Zte,"__esModule",{value:!0});Zte.SnippetString=void 0;var yGa=sD(),cSr=Jte=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Jte?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Jte._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new Jte;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Jte._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new Jte;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};Zte.SnippetString=cSr;Zte.SnippetString=cSr=Jte=AGa([yGa.es5ClassCompat],cSr)});var dSr=I(vgt=>{"use strict";p();Object.defineProperty(vgt,"__esModule",{value:!0});vgt.SnippetTextEdit=void 0;var EGa=lSr(),lRi=S4(),uSr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?lRi.Range.isRange(e.range)&&EGa.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new lRi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};vgt.SnippetTextEdit=uSr});var fRi=I(aD=>{"use strict";p();var _Ga=aD&&aD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fSr;Object.defineProperty(aD,"__esModule",{value:!0});aD.SymbolInformation=aD.SymbolTag=aD.SymbolKind=void 0;var CGa=sD(),uRi=w1r(),vGa=S4(),pSr;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(pSr||(aD.SymbolKind=pSr={}));var dRi;(function(t){t[t.Deprecated=1]="Deprecated"})(dRi||(aD.SymbolTag=dRi={}));var hSr=fSr=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof uRi.Location?this.location=o:n instanceof vGa.Range&&(this.location=new uRi.Location(o,n)),fSr.validate(this)}toJSON(){return{name:this.name,kind:pSr[this.kind],location:this.location,containerName:this.containerName}}};aD.SymbolInformation=hSr;aD.SymbolInformation=hSr=fSr=_Ga([CGa.es5ClassCompat],hSr)});var ASr=I(z8=>{"use strict";p();var bGa=z8&&z8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Xte;Object.defineProperty(z8,"__esModule",{value:!0});z8.TextEdit=z8.EndOfLine=void 0;var mSr=Ts(),SGa=sD(),pRi=ige(),bgt=S4(),hRi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(hRi||(z8.EndOfLine=hRi={}));var gSr=Xte=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof Xte?!0:!e||typeof e!="object"?!1:bgt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new Xte(e,r)}static insert(e,r){return Xte.replace(new bgt.Range(e,e),r)}static delete(e){return Xte.replace(e,"")}static setEndOfLine(e){let r=new Xte(new bgt.Range(new pRi.Position(0,0),new pRi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!bgt.Range.isRange(e))throw(0,mSr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,mSr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,mSr.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};z8.TextEdit=gSr;z8.TextEdit=gSr=Xte=bGa([SGa.es5ClassCompat],gSr)});var IRi=I(St=>{"use strict";p();Object.defineProperty(St,"__esModule",{value:!0});St.ChatResponseClearToPreviousToolInvocationReason=St.ChatRequestEditedFileEventKind=St.ChatInputNotificationSeverity=St.ChatErrorLevel=St.AISearchKeyword=St.TextSearchMatch2=St.ExcludeSettingOptions=St.LanguageModelPromptTsxPart=St.ChatImageMimeType=St.LanguageModelDataPart2=St.LanguageModelDataPart=St.LanguageModelThinkingPart=St.LanguageModelTextPart2=St.LanguageModelPartAudience=St.LanguageModelTextPart=St.LanguageModelToolResult2=St.LanguageModelToolResult=St.ChatReferenceBinaryData=St.ChatReferenceDiagnostic=St.ChatRequestNotebookData=St.ChatRequestEditorData=St.ChatResponseTurn=St.ChatRequestTurn2=St.ChatRequestTurn=St.ChatResponseQuestionCarouselPart=St.ChatQuestion=St.ChatQuestionType=St.ChatResponseConfirmationPart=St.ChatResponseWorkspaceEditPart=St.ChatResponseNotebookEditPart=St.ChatResponseTextEditPart=St.ChatResponseMarkdownWithVulnerabilitiesPart=St.ChatResponseCommandButtonPart=St.ChatResponseCodeCitationPart=St.ChatResponsePullRequestPart=St.ChatResponseExtensionsPart=St.ChatResponseMovePart=St.ChatResponseReferencePart2=St.ChatResponseReferencePart=St.ChatResponseInfoPart=St.ChatResponseWarningPart=St.ChatResponseProgressPart2=St.ChatResponseExternalEditPart=St.ChatResponseHookPart=St.ChatResponseThinkingProgressPart=St.ChatResponseProgressPart=St.ChatResponseAnchorPart=St.ChatResponseFileTreePart=St.ChatResponseCodeblockUriPart=St.ChatResponseMarkdownPart=void 0;St.McpHttpServerDefinition=St.McpStdioServerDefinition=St.ChatResource=St.LanguageModelError=St.ChatSessionStatus=St.ChatResponseTurn2=St.ChatSubagentToolInvocationData=St.ChatToolInvocationPart=St.McpToolInvocationContentData=St.LanguageModelChatMessage=St.LanguageModelChatToolMode=St.LanguageModelChatMessageRole=St.LanguageModelToolResultPart2=St.LanguageModelToolResultPart=St.LanguageModelToolCallPart=St.LanguageModelToolMCPSource=St.LanguageModelToolExtensionSource=void 0;var mRi=_G(),xgt=Z1r(),ySr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseMarkdownPart=ySr;var ESr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};St.ChatResponseCodeblockUriPart=ESr;var _Sr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};St.ChatResponseFileTreePart=_Sr;var CSr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};St.ChatResponseAnchorPart=CSr;var vSr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};St.ChatResponseProgressPart=vSr;var bSr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};St.ChatResponseThinkingProgressPart=bSr;var SSr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};St.ChatResponseHookPart=SSr;var TSr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};St.ChatResponseExternalEditPart=TSr;var ISr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};St.ChatResponseProgressPart2=ISr;var xSr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseWarningPart=xSr;var wSr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new xgt.MarkdownString(e):e}};St.ChatResponseInfoPart=wSr;var RSr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};St.ChatResponseReferencePart=RSr;var kSr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};St.ChatResponseReferencePart2=kSr;var PSr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};St.ChatResponseMovePart=PSr;var DSr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};St.ChatResponseExtensionsPart=DSr;var NSr=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};St.ChatResponsePullRequestPart=NSr;var MSr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};St.ChatResponseCodeCitationPart=MSr;var OSr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};St.ChatResponseCommandButtonPart=OSr;var BSr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new xgt.MarkdownString(e):e,this.vulnerabilities=r}};St.ChatResponseMarkdownWithVulnerabilitiesPart=BSr;var LSr=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};St.ChatResponseTextEditPart=LSr;var FSr=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};St.ChatResponseNotebookEditPart=FSr;var USr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};St.ChatResponseWorkspaceEditPart=USr;var QSr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};St.ChatResponseConfirmationPart=QSr;var gRi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(gRi||(St.ChatQuestionType=gRi={}));var qSr=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};St.ChatQuestion=qSr;var jSr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};St.ChatResponseQuestionCarouselPart=jSr;var HSr=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};St.ChatRequestTurn=HSr;var GSr=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};St.ChatRequestTurn2=GSr;var $Sr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};St.ChatResponseTurn=$Sr;var VSr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};St.ChatRequestEditorData=VSr;var WSr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};St.ChatRequestNotebookData=WSr;var zSr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};St.ChatReferenceDiagnostic=zSr;var YSr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};St.ChatReferenceBinaryData=YSr;var KSr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};St.LanguageModelToolResult=KSr;var JSr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};St.LanguageModelToolResult2=JSr;var Sgt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};St.LanguageModelTextPart=Sgt;var ARi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(ARi||(St.LanguageModelPartAudience=ARi={}));var ZSr=class extends Sgt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};St.LanguageModelTextPart2=ZSr;var XSr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};St.LanguageModelThinkingPart=XSr;var Tgt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(mRi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(mRi.VSBuffer.fromString(e).buffer,"text/plain")}};St.LanguageModelDataPart=Tgt;var eTr=class extends Tgt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};St.LanguageModelDataPart2=eTr;var yRi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(yRi||(St.ChatImageMimeType=yRi={}));var tTr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};St.LanguageModelPromptTsxPart=tTr;var ERi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(ERi||(St.ExcludeSettingOptions=ERi={}));var rTr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};St.TextSearchMatch2=rTr;var nTr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};St.AISearchKeyword=nTr;var _Ri;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(_Ri||(St.ChatErrorLevel=_Ri={}));var CRi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(CRi||(St.ChatInputNotificationSeverity=CRi={}));var vRi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(vRi||(St.ChatRequestEditedFileEventKind=vRi={}));var bRi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(bRi||(St.ChatResponseClearToPreviousToolInvocationReason=bRi={}));var iTr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};St.LanguageModelToolExtensionSource=iTr;var oTr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};St.LanguageModelToolMCPSource=oTr;var sTr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};St.LanguageModelToolCallPart=sTr;var aTr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};St.LanguageModelToolResultPart=aTr;var cTr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};St.LanguageModelToolResultPart2=cTr;var Igt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(Igt||(St.LanguageModelChatMessageRole=Igt={}));var SRi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(SRi||(St.LanguageModelChatToolMode=SRi={}));var lTr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(Igt.User,e,r)}static Assistant(e,r){return new t(Igt.Assistant,e,r)}};St.LanguageModelChatMessage=lTr;var uTr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};St.McpToolInvocationContentData=uTr;var dTr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};St.ChatToolInvocationPart=dTr;var fTr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};St.ChatSubagentToolInvocationData=fTr;var pTr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};St.ChatResponseTurn2=pTr;var TRi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(TRi||(St.ChatSessionStatus=TRi={}));var hTr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};St.LanguageModelError=hTr;var mTr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};St.ChatResource=mTr;var gTr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};St.McpStdioServerDefinition=gTr;var ATr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};St.McpHttpServerDefinition=ATr});var RRi=I(FG=>{"use strict";p();Object.defineProperty(FG,"__esModule",{value:!0});FG.TextDocumentChangeReason=FG.TextEditorSelectionChangeKind=FG.WorkspaceEdit=void 0;var TGa=El(),IGa=bP(),xGa=S4(),wGa=dSr(),RGa=ASr(),yTr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new RGa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new xGa.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,wGa.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(Ap,"__esModule",{value:!0});Ap.FileType=Ap.ChatSessionStatus=Ap.ChatLocation=Ap.ChatVariableLevel=Ap.ExtensionMode=Ap.DiagnosticSeverity=Ap.TextEditorRevealType=Ap.TextEditorLineNumbersStyle=Ap.TextEditorCursorStyle=Ap.InteractiveEditorResponseFeedbackKind=void 0;var kRi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(kRi||(Ap.InteractiveEditorResponseFeedbackKind=kRi={}));var PRi;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})(PRi||(Ap.TextEditorCursorStyle=PRi={}));var DRi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(DRi||(Ap.TextEditorLineNumbersStyle=DRi={}));var NRi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(NRi||(Ap.TextEditorRevealType=NRi={}));var MRi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(MRi||(Ap.DiagnosticSeverity=MRi={}));var ORi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(ORi||(Ap.ExtensionMode=ORi={}));var BRi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(BRi||(Ap.ChatVariableLevel=BRi={}));var LRi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(LRi||(Ap.ChatLocation=LRi={}));var FRi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(FRi||(Ap.ChatSessionStatus=FRi={}));var URi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(URi||(Ap.FileType=URi={}))});var jRi=I(ETr=>{"use strict";p();Object.defineProperty(ETr,"__esModule",{value:!0});ETr.t=kGa;function kGa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return qRi({message:e,args:r})}return qRi(t[0])}a(kGa,"t");function qRi(t){let{message:e,args:r}=t;return DGa(e,r??{})}a(qRi,"getMessage");var PGa=/{([^}]+)}/g;function DGa(t,e){return t.replace(PGa,(r,n)=>e[n]??r)}a(DGa,"format2")});var $Ri=I(UG=>{"use strict";p();Object.defineProperty(UG,"__esModule",{value:!0});UG.NewSymbolName=UG.NewSymbolNameTriggerKind=UG.NewSymbolNameTag=void 0;var HRi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(HRi||(UG.NewSymbolNameTag=HRi={}));var GRi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(GRi||(UG.NewSymbolNameTriggerKind=GRi={}));var _Tr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};UG.NewSymbolName=_Tr});var WRi=I(wgt=>{"use strict";p();Object.defineProperty(wgt,"__esModule",{value:!0});wgt.TerminalShellExecutionCommandLineConfidence=void 0;var VRi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(VRi||(wgt.TerminalShellExecutionCommandLineConfidence=VRi={}))});var zRi=I(sge=>{"use strict";p();Object.defineProperty(sge,"__esModule",{value:!0});sge.ThemeColor=sge.ThemeIcon=void 0;var CTr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};sge.ThemeIcon=CTr;var vTr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};sge.ThemeColor=vTr});var mm=I((yTp,ZRi)=>{"use strict";p();var NGa=SP(),MGa=Sc(),OGa=Ku(),YRi=T1r(),BGa=w1r(),LGa=Z1r(),i5e=sRi(),FGa=ige(),UGa=S4(),QGa=cRi(),qGa=lSr(),jGa=dSr(),KRi=fRi(),JRi=ASr(),Nn=IRi(),bTr=RRi(),QG=QRi(),HGa=jRi(),STr=$Ri(),GGa=WRi(),$Ga=zRi(),VGa={Position:FGa.Position,Range:UGa.Range,Selection:QGa.Selection,EventEmitter:MGa.Emitter,CancellationTokenSource:NGa.CancellationTokenSource,Diagnostic:YRi.Diagnostic,Location:BGa.Location,DiagnosticRelatedInformation:YRi.DiagnosticRelatedInformation,TextEdit:JRi.TextEdit,WorkspaceEdit:bTr.WorkspaceEdit,Uri:OGa.URI,MarkdownString:LGa.MarkdownString,DiagnosticSeverity:QG.DiagnosticSeverity,TextEditorCursorStyle:QG.TextEditorCursorStyle,TextEditorLineNumbersStyle:QG.TextEditorLineNumbersStyle,TextEditorRevealType:QG.TextEditorRevealType,EndOfLine:JRi.EndOfLine,l10n:{t:HGa.t},ExtensionMode:QG.ExtensionMode,ChatVariableLevel:QG.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Nn.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Nn.ChatResponseMarkdownPart,ChatResponseFileTreePart:Nn.ChatResponseFileTreePart,ChatResponseAnchorPart:Nn.ChatResponseAnchorPart,ChatResponseMovePart:Nn.ChatResponseMovePart,ChatResponseExtensionsPart:Nn.ChatResponseExtensionsPart,ChatResponseProgressPart:Nn.ChatResponseProgressPart,ChatResponseProgressPart2:Nn.ChatResponseProgressPart2,ChatResponseWarningPart:Nn.ChatResponseWarningPart,ChatResponseInfoPart:Nn.ChatResponseInfoPart,ChatResponseHookPart:Nn.ChatResponseHookPart,ChatResponseReferencePart:Nn.ChatResponseReferencePart,ChatResponseReferencePart2:Nn.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Nn.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Nn.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Nn.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Nn.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Nn.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Nn.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Nn.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Nn.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Nn.ChatResponseConfirmationPart,ChatQuestion:Nn.ChatQuestion,ChatQuestionType:Nn.ChatQuestionType,ChatResponseQuestionCarouselPart:Nn.ChatResponseQuestionCarouselPart,ChatRequestTurn:Nn.ChatRequestTurn,ChatResponseTurn:Nn.ChatResponseTurn,ChatRequestEditorData:Nn.ChatRequestEditorData,ChatRequestNotebookData:Nn.ChatRequestNotebookData,NewSymbolName:STr.NewSymbolName,NewSymbolNameTag:STr.NewSymbolNameTag,NewSymbolNameTriggerKind:STr.NewSymbolNameTriggerKind,ChatLocation:QG.ChatLocation,SymbolInformation:KRi.SymbolInformation,LanguageModelToolResult:Nn.LanguageModelToolResult,ExtendedLanguageModelToolResult:Nn.LanguageModelToolResult,LanguageModelToolResult2:Nn.LanguageModelToolResult2,LanguageModelPromptTsxPart:Nn.LanguageModelPromptTsxPart,LanguageModelTextPart:Nn.LanguageModelTextPart,LanguageModelDataPart:Nn.LanguageModelDataPart,LanguageModelToolExtensionSource:Nn.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Nn.LanguageModelToolMCPSource,ChatReferenceBinaryData:Nn.ChatReferenceBinaryData,ChatReferenceDiagnostic:Nn.ChatReferenceDiagnostic,TextSearchMatch2:Nn.TextSearchMatch2,AISearchKeyword:Nn.AISearchKeyword,ExcludeSettingOptions:Nn.ExcludeSettingOptions,NotebookCellKind:i5e.NotebookCellKind,NotebookRange:i5e.NotebookRange,NotebookEdit:i5e.NotebookEdit,NotebookCellData:i5e.NotebookCellData,NotebookData:i5e.NotebookData,ChatErrorLevel:Nn.ChatErrorLevel,ChatInputNotificationSeverity:Nn.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:GGa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Nn.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Nn.ChatResponsePullRequestPart,LanguageModelTextPart2:Nn.LanguageModelTextPart2,LanguageModelDataPart2:Nn.LanguageModelDataPart2,LanguageModelThinkingPart:Nn.LanguageModelThinkingPart,LanguageModelPartAudience:Nn.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Nn.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Nn.LanguageModelToolCallPart,LanguageModelToolResultPart:Nn.LanguageModelToolResultPart,LanguageModelToolResultPart2:Nn.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Nn.LanguageModelChatMessageRole,LanguageModelChatMessage:Nn.LanguageModelChatMessage,LanguageModelChatToolMode:Nn.LanguageModelChatToolMode,TextEditorSelectionChangeKind:bTr.TextEditorSelectionChangeKind,TextDocumentChangeReason:bTr.TextDocumentChangeReason,ChatToolInvocationPart:Nn.ChatToolInvocationPart,ChatSubagentToolInvocationData:Nn.ChatSubagentToolInvocationData,McpToolInvocationContentData:Nn.McpToolInvocationContentData,ChatResponseTurn2:Nn.ChatResponseTurn2,ChatRequestTurn2:Nn.ChatRequestTurn2,LanguageModelError:Nn.LanguageModelError,SymbolKind:KRi.SymbolKind,SnippetString:qGa.SnippetString,SnippetTextEdit:jGa.SnippetTextEdit,FileType:QG.FileType,ChatSessionStatus:Nn.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Nn.McpHttpServerDefinition,McpStdioServerDefinition:Nn.McpStdioServerDefinition,ThemeIcon:$Ga.ThemeIcon};ZRi.exports=VGa});var XRi=I(age=>{"use strict";p();Object.defineProperty(age,"__esModule",{value:!0});age.UseData=age.UseState=void 0;var TTr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};age.UseState=TTr;var ITr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};age.UseData=ITr});var tki=I(Rgt=>{"use strict";p();Object.defineProperty(Rgt,"__esModule",{value:!0});Rgt.VirtualPromptReconciler=void 0;var eki=XRi(),xTr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(WGa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new RTr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new wTr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};Rgt.VirtualPromptReconciler=xTr;var wTr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},RTr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new eki.UseState(e.state),this.dataHook=new eki.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function WGa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(WGa,"isFragmentFunction")});var rki=I(kgt=>{"use strict";p();Object.defineProperty(kgt,"__esModule",{value:!0});kgt.VirtualPrompt=void 0;var zGa=tki(),kTr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new zGa.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};kgt.VirtualPrompt=kTr});var Y8=I(Pgt=>{"use strict";p();Object.defineProperty(Pgt,"__esModule",{value:!0});Pgt.Text=YGa;Pgt.Chunk=KGa;function YGa(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(YGa,"Text");function KGa(t){return t.children}a(KGa,"Chunk")});var qG=I(K8=>{"use strict";p();Object.defineProperty(K8,"__esModule",{value:!0});K8.PerCompletionContextProviderStatistics=K8.ContextProviderStatistics=K8.ICompletionsContextProviderService=void 0;K8.componentStatisticsToPromptMatcher=XGa;var JGa=rn(),ZGa=H8();K8.ICompletionsContextProviderService=(0,JGa.createServiceIdentifier)("ICompletionsContextProviderService");var PTr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Dgt){this.createStatistics=e,this.statistics=new ZGa.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};K8.ContextProviderStatistics=PTr;var Dgt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};K8.PerCompletionContextProviderStatistics=Dgt;function XGa(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(XGa,"componentStatisticsToPromptMatcher")});var a5e=I(s5e=>{"use strict";p();Object.defineProperty(s5e,"__esModule",{value:!0});s5e.filterContextItemsByType=n$a;s5e.filterSupportedContextItems=i$a;s5e.addOrValidateContextItemsIDs=s$a;var e$a=mm(),t$a=Ku(),DTr=um(),r$a=TOe(),NTr=xl(),o5e;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!r$a.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(o5e||(o5e={}));var MTr;(function(t){function e(r){if(!o5e.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(MTr||(MTr={}));var OTr;(function(t){function e(r){if(!o5e.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(OTr||(OTr={}));var BTr;(function(t){function e(r){if(!o5e.is(r))return!1;let n=r;if(!t$a.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof e$a.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(BTr||(BTr={}));var LTr;(function(t){function e(r){if(MTr.is(r))return"Trait";if(OTr.is(r))return"CodeSnippet";if(BTr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(LTr||(LTr={}));function n$a(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(n$a,"filterContextItemsByType");function i$a(t){let e=[],r=0;return t.forEach(n=>{let o=LTr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(i$a,"filterSupportedContextItems");function o$a(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(o$a,"validateContextItemId");function s$a(t,e){let r=new Set,n=t.get(NTr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,DTr.generateUuid)();if(!o$a(c)){let l=(0,DTr.generateUuid)();NTr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,DTr.generateUuid)();NTr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(s$a,"addOrValidateContextItemsIDs")});var FTr=I(Ngt=>{"use strict";p();Object.defineProperty(Ngt,"__esModule",{value:!0});Ngt.getCodeSnippetsFromContextItems=d$a;Ngt.addRelativePathToCodeSnippets=f$a;var a$a=zb(),c$a=qG(),l$a=a5e(),u$a="content_excluded";async function d$a(t,e,r,n){let o=(0,l$a.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(c$a.ICompletionsContextProviderService),u=t.get(a$a.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,u$a]]),g}).map(h=>h.data)}a(d$a,"getCodeSnippetsFromContextItems");function f$a(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(f$a,"addRelativePathToCodeSnippets")});var UTr=I(Bgt=>{"use strict";p();Object.defineProperty(Bgt,"__esModule",{value:!0});Bgt.CodeSnippets=void 0;var Mgt=b4(),Ogt=Y8(),p$a=J8(),h$a=FTr(),m$a=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(p$a.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,h$a.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,Mgt.jsx)(Ogt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,Mgt.jsx)(Ogt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(cge,"__esModule",{value:!0});cge.CompletionsContext=nki;cge.StableCompletionsContext=iki;cge.AdditionalCompletionsContext=oki;cge.isContextNode=g$a;function nki(t){return t.children}a(nki,"CompletionsContext");function iki(t){return t.children}a(iki,"StableCompletionsContext");function oki(t){return t.children}a(oki,"AdditionalCompletionsContext");function g$a(t){return t.name===nki.name||t.name===iki.name||t.name===oki.name}a(g$a,"isContextNode")});var qTr=I(l5e=>{"use strict";p();Object.defineProperty(l5e,"__esModule",{value:!0});l5e.SnapshotWalker=void 0;l5e.defaultTransformers=ski;var A$a=Y8(),QTr=class{static{a(this,"SnapshotWalker")}constructor(e,r=ski()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};l5e.SnapshotWalker=QTr;function ski(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===A$a.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(ski,"defaultTransformers")});var aki=I(jTr=>{"use strict";p();Object.defineProperty(jTr,"__esModule",{value:!0});jTr.findEditDistanceScore=y$a;function y$a(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(cD,"__esModule",{value:!0});cD.MAX_EDIT_DISTANCE_LENGTH=void 0;cD.CurrentFile=v$a;cD.BeforeCursor=$Tr;cD.AfterCursor=VTr;cD.DocumentPrefix=b$a;cD.DocumentSuffix=S$a;var hR=b4(),lge=Y8(),E$a=yG(),_$a=aki(),C$a=Lme(),HTr=J8();cD.MAX_EDIT_DISTANCE_LENGTH=50;function GTr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(GTr,"approximateMaxCharacters");function v$a(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(HTr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=GTr(c);return(0,hR.jsxs)(hR.Fragment,{children:[(0,hR.jsx)($Tr,{document:r,position:o,maxCharacters:m}),(0,hR.jsx)(VTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(v$a,"CurrentFile");function $Tr(t){if(t.document===void 0||t.position===void 0)return(0,hR.jsx)(lge.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,hR.jsx)(lge.Text,{children:e})}a($Tr,"BeforeCursor");function VTr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,hR.jsx)(lge.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,hR.jsx)(lge.Text,{});if(r===s)return(0,hR.jsx)(lge.Text,{children:r});let c=s;if(r!==""){let l=(0,C$a.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,cD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,cD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,_$a.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??E$a.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,hR.jsx)(lge.Text,{children:c})}a(VTr,"AfterCursor");function b$a(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(HTr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=GTr(c);return(0,hR.jsx)($Tr,{document:r,position:o,maxCharacters:u})}a(b$a,"DocumentPrefix");function S$a(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(HTr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=GTr(c);return(0,hR.jsx)(VTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(S$a,"DocumentSuffix")});var zTr=I(ere=>{"use strict";p();Object.defineProperty(ere,"__esModule",{value:!0});ere.WishlistElision=void 0;ere.makePrompt=T$a;ere.makePrefixPrompt=I$a;ere.makeContextPrompt=x$a;var WTr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};ere.WishlistElision=WTr;function T$a(t){return t.map(e=>e.elidedValue).join("")}a(T$a,"makePrompt");function I$a(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(I$a,"makePrefixPrompt");function x$a(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(x$a,"makeContextPrompt")});var JTr=I(jG=>{"use strict";p();Object.defineProperty(jG,"__esModule",{value:!0});jG.transformers=jG.CompletionsPromptRenderer=void 0;jG.normalizeLineEndings=KTr;var dki=qTr(),cki=YOe(),lki=Lme(),w$a=c5e(),Lgt=u5e(),uki=zTr(),R$a=5,YTr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=uki.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??lki.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new uki.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,lki.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...k$a([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-R$a:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new dki.SnapshotWalker(e,jG.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===Lgt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:KTr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,cki.isShebangLine)(f.value)?y=A:y=(0,cki.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:KTr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${Lgt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};jG.CompletionsPromptRenderer=YTr;jG.transformers=[...(0,dki.defaultTransformers)(),(t,e,r)=>(0,w$a.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===Lgt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===Lgt.AfterCursor.name?{...r,type:"suffix"}:r];function k$a(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(k$a,"computeComponentStatistics");function KTr(t){return t.replace(/\r\n?/g,` -`)}a(KTr,"normalizeLineEndings")});var Fgt=I(uge=>{"use strict";p();Object.defineProperty(uge,"__esModule",{value:!0});uge.ILanguageContextProviderService=uge.ProviderTarget=void 0;var P$a=rn(),fki;(function(t){t.NES="nes",t.Completions="completions"})(fki||(uge.ProviderTarget=fki={}));uge.ILanguageContextProviderService=(0,P$a.createServiceIdentifier)("ILanguageContextProviderService")});var tre=I(dge=>{"use strict";p();Object.defineProperty(dge,"__esModule",{value:!0});dge.RuntimeMode=dge.ICompletionsRuntimeModeService=void 0;var D$a=rn();dge.ICompletionsRuntimeModeService=(0,D$a.createServiceIdentifier)("completionsRuntimeModeService");var ZTr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:pki(r,n),verboseLogging:M$a(r,n),testMode:e,simulation:N$a(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};dge.RuntimeMode=ZTr;function pki(t,e){return t.includes("--debug")||XTr(e,"DEBUG")}a(pki,"determineDebugFlag");function N$a(t){return XTr(t,"SIMULATION")}a(N$a,"determineSimulationFlag");function M$a(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||XTr(e,"VERBOSE")||pki(t,e)}a(M$a,"determineVerboseLoggingEnabled");function XTr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(XTr,"determineEnvFlagEnabled")});var Aki=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.eventToPromise=O$a;d5e.isArrayOfT=gki;d5e.resolveAll=L$a;var hki=LOe();async function O$a(t){let e=new hki.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(O$a,"eventToPromise");async function B$a(t){if(t.isCancellationRequested)return;let e=new hki.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(B$a,"cancellationTokenToPromise");async function mki(t,e){if(e){let r=B$a(e);await Promise.race([t,r])}else await t}a(mki,"raceCancellation");function gki(t){return Array.isArray(t)}a(gki,"isArrayOfT");async function L$a(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await F$a(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(L$a,"resolveAll");async function F$a(t,e){let r;return t instanceof Promise?r=await U$a(t,e):r=await Q$a(t,e),r}a(F$a,"resolve");async function U$a(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:gki(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await mki(o,e),n.resolutionTime=performance.now()-r,n}a(U$a,"resolvePromise");async function Q$a(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await mki(o,e),n.resolutionTime=performance.now()-r,n}a(Q$a,"resolveIterable")});var yki=I(tIr=>{"use strict";p();Object.defineProperty(tIr,"__esModule",{value:!0});tIr.fillInCppVSCodeActiveExperiments=G$a;var q$a=VA(),eIr=xl(),j$a={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},H$a="ms-vscode.cpptools";function G$a(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(H$a))&&$$a(t,r,n)}a(G$a,"fillInCppVSCodeActiveExperiments");function $$a(t,e,r){try{let n=t.get(q$a.ICompletionsFeaturesService),o=t.get(eIr.ICompletionsLogTargetService),s=j$a,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){eIr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){eIr.logger.exception(t,n,"fillInCppActiveExperiments")}}a($$a,"addActiveExperiments")});var _ki=I(rIr=>{"use strict";p();Object.defineProperty(rIr,"__esModule",{value:!0});rIr.fillInCSharpActiveExperiments=W$a;var V$a=VA(),Eki=xl();function W$a(t,e,r){let n=t.get(V$a.ICompletionsFeaturesService),o=t.get(Eki.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return Eki.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(W$a,"fillInCSharpActiveExperiments")});var Cki=I(HG=>{"use strict";p();Object.defineProperty(HG,"__esModule",{value:!0});HG.multiLanguageContextProviderParamsDefault=void 0;HG.fillInMultiLanguageActiveExperiments=K$a;HG.getMultiLanguageContextProviderParamsFromActiveExperiments=X$a;var z$a=VA(),nIr=xl(),Y$a="fallbackContextProvider";HG.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function K$a(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Y$a))&&J$a(t,r,n)}a(K$a,"fillInMultiLanguageActiveExperiments");function J$a(t,e,r){try{let n=Z$a(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){nIr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(J$a,"addActiveExperiments");function Z$a(t,e){let r=HG.multiLanguageContextProviderParamsDefault,n=t.get(nIr.ICompletionsLogTargetService),s=t.get(z$a.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){nIr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(Z$a,"getMultiLanguageContextProviderParamsFromExp");function X$a(t){let e={...HG.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(X$a,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var bki=I(fge=>{"use strict";p();Object.defineProperty(fge,"__esModule",{value:!0});fge.TS_CONTEXT_PROVIDER_ID=void 0;fge.fillInTsActiveExperiments=tVa;var eVa=VA(),vki=xl();fge.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function tVa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(fge.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(vki.ICompletionsLogTargetService),s=t.get(eVa.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return vki.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(tVa,"fillInTsActiveExperiments")});var qgt=I(wl=>{"use strict";p();var cIr=wl&&wl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lD=wl&&wl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(wl,"__esModule",{value:!0});wl.DefaultDiagnosticSettings=wl.CachedContextProviderRegistry=wl.MutableContextProviderRegistry=wl.CoreContextProviderRegistry=wl.DefaultContextProvidersContainer=wl.ICompletionsDefaultContextProviders=wl.ICompletionsContextProviderRegistryService=void 0;wl.telemetrizeContextItems=uVa;wl.matchContextItems=dVa;wl.useContextProviderAPI=pVa;wl.getDefaultDiagnosticSettings=mVa;var rVa=ti(),Ski=Il(),lIr=Fgt(),nVa=gp(),xki=rn(),iVa=Ts(),uIr=Qs(),Ugt=vE(),wki=VA(),oVa=H8(),Z8=xl(),dIr=tre(),Tki=Aki(),sVa=yki(),aVa=_ki(),cVa=Cki(),lVa=bki(),Iki=a5e(),Rki=qG();wl.ICompletionsContextProviderRegistryService=(0,xki.createServiceIdentifier)("ICompletionsContextProviderRegistryService");wl.ICompletionsDefaultContextProviders=(0,xki.createServiceIdentifier)("ICompletionsDefaultContextProviders");var iIr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};wl.DefaultContextProvidersContainer=iIr;var Qgt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([lIr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return Z8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(aVa.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return Z8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(sVa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(cVa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(lVa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new rVa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(hVa,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,Tki.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,iVa.isCancellationError)(x.reason)||Z8.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let k=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(Z8.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let Q=w.resolver.resolveOnTimeout(v);(0,Tki.isArrayOfT)(Q)?k.push(...Q):Q&&k.push(Q),k.length>0&&(x.status="partial")}catch(Q){Z8.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,Q)}let[D,N]=(0,Iki.filterSupportedContextItems)(k);N&&Z8.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let L=this.instantiationService.invokeFunction(Iki.addOrValidateContextItemsIDs,D),B={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:L};u.push(B)}b.setLastResolution(w.id,x.status)}else Z8.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(kki,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};wl.CoreContextProviderRegistry=Qgt;wl.CoreContextProviderRegistry=Qgt=cIr([lD(1,lIr.ILanguageContextProviderService),lD(2,dIr.ICompletionsRuntimeModeService),lD(3,uIr.IInstantiationService),lD(4,Z8.ICompletionsLogTargetService),lD(5,Rki.ICompletionsContextProviderService)],Qgt);var oIr=class extends Qgt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};wl.MutableContextProviderRegistry=oIr;wl.MutableContextProviderRegistry=oIr=cIr([lD(1,lIr.ILanguageContextProviderService),lD(2,dIr.ICompletionsRuntimeModeService),lD(3,uIr.IInstantiationService),lD(4,Z8.ICompletionsLogTargetService),lD(5,Rki.ICompletionsContextProviderService)],oIr);var sIr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new oVa.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};wl.CachedContextProviderRegistry=sIr;wl.CachedContextProviderRegistry=sIr=cIr([lD(2,uIr.IInstantiationService)],sIr);function uVa(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(uVa,"telemetrizeContextItems");function dVa(t){return t.matchScore>0&&t.resolution!=="error"}a(dVa,"matchContextItems");function kki(t,e,r){let n=fVa(t,e,r),o=(0,Ugt.getConfig)(t,Ugt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(wl.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(kki,"getActiveContextProviders");function fVa(t,e,r){if(t.get(dIr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(wki.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(fVa,"getExpContextProviders");function pVa(t,e,r){return kki(t,e,r).length>0}a(pVa,"useContextProviderAPI");function hVa(t,e,r){let n=(0,Ugt.getConfig)(t,Ugt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(wki.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(hVa,"getContextProviderTimeBudget");var aIr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(aIr||(wl.DefaultDiagnosticSettings=aIr={}));function mVa(t){let e=t.get(Ski.IConfigurationService),r=t.get(nVa.IExperimentationService),n=e.getExperimentBasedConfig(Ski.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return aIr.from(n)}a(mVa,"getDefaultDiagnosticSettings")});var jgt=I(uD=>{"use strict";p();var gVa=uD&&uD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},AVa=uD&&uD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(uD,"__esModule",{value:!0});uD.ContextProviderBridge=uD.ICompletionsContextProviderBridgeService=void 0;var yVa=rn(),EVa=H8(),_Va=qgt();uD.ICompletionsContextProviderBridgeService=(0,yVa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var fIr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new EVa.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};uD.ContextProviderBridge=fIr;uD.ContextProviderBridge=fIr=gVa([AVa(0,_Va.ICompletionsContextProviderRegistryService)],fIr)});var mIr=I(Hgt=>{"use strict";p();Object.defineProperty(Hgt,"__esModule",{value:!0});Hgt.Diagnostics=void 0;var pIr=b4(),CVa=mm(),hIr=Y8(),vVa=yG(),bVa=J8();function SVa(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(SVa,"getCode");function TVa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(TVa,"getRelativePath");var IVa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(bVa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,vVa.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,pIr.jsx)(hIr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${TVa(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=SVa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,pIr.jsx)(hIr.Text,{children:`${_.line+1}:${_.character+1} - ${CVa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,pIr.jsx)(hIr.Chunk,{children:m})})},"Diagnostics");Hgt.Diagnostics=IVa});var gIr=I($gt=>{"use strict";p();Object.defineProperty($gt,"__esModule",{value:!0});$gt.DocumentMarker=void 0;var Ggt=b4(),Pki=Y8(),Dki=YOe(),xVa=J8(),wVa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(xVa.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,Ggt.jsx)(RVa,{docInfo:s}):(0,Ggt.jsx)(kVa,{docInfo:s})}},"DocumentMarker");$gt.DocumentMarker=wVa;var RVa=a(t=>(0,Ggt.jsx)(Pki.Text,{children:(0,Dki.getPathMarker)(t.docInfo)}),"PathMarker"),kVa=a(t=>(0,Ggt.jsx)(Pki.Text,{children:(0,Dki.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var AIr=I(f5e=>{"use strict";p();Object.defineProperty(f5e,"__esModule",{value:!0});f5e.RecentEdits=void 0;f5e.editIsTooCloseToCursor=Oki;var Nki=b4(),Mki=Y8(),Vgt=YOe(),PVa=J8();function Oki(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(Oki,"editIsTooCloseToCursor");var DVa=a((t,e)=>{let[r,n]=e.useState();return e.useData(PVa.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(Oki(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,Vgt.newLineEnded)(`File: ${T}`)+(0,Vgt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,Vgt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,Vgt.newLineEnded)("End of recent edits");n(h)}),r?(0,Nki.jsx)(Mki.Chunk,{children:(0,Nki.jsx)(Mki.Text,{children:r})}):void 0},"RecentEdits");f5e.RecentEdits=DVa});var Bki=I(x4=>{"use strict";p();Object.defineProperty(x4,"__esModule",{value:!0});x4.registerDocumentTracker=x4.accessTimes=void 0;x4.sortByAccessTimes=OVa;var NVa=H8(),MVa=zb();x4.accessTimes=new NVa.LRUCacheMap;function OVa(t){return[...t].sort((e,r)=>{let n=x4.accessTimes.get(e.uri)??0;return(x4.accessTimes.get(r.uri)??0)-n})}a(OVa,"sortByAccessTimes");var BVa=a(t=>t.get(MVa.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&x4.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");x4.registerDocumentTracker=BVa});var Lki=I(X8=>{"use strict";p();var LVa=X8&&X8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},FVa=X8&&X8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(X8,"__esModule",{value:!0});X8.OpenTabFiles=void 0;var UVa=Bki(),QVa=zb(),yIr=pge(),EIr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>yIr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,yIr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,UVa.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(yIr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};X8.OpenTabFiles=EIr;X8.OpenTabFiles=EIr=LVa([FVa(0,QVa.ICompletionsTextDocumentManagerService)],EIr)});var Fki=I(_Ir=>{"use strict";p();Object.defineProperty(_Ir,"__esModule",{value:!0});_Ir.shortCircuit=qVa;function qVa(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(qVa,"shortCircuit")});var Zgt=I(Rl=>{"use strict";p();var jVa=Rl&&Rl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Wgt=Rl&&Rl.__param||function(t,e){return function(r,n){e(r,n,t)}},CIr;Object.defineProperty(Rl,"__esModule",{value:!0});Rl.RelatedFilesProvider=Rl.ICompletionsRelatedFilesProviderService=Rl.relatedFilesLogger=Rl.PromiseExpirationCacheMap=Rl.EmptyRelatedFilesResponse=void 0;Rl.getRelatedFilesAndTraits=ZVa;var HVa=Bte(),GVa=rn(),$Va=Ku(),SIr=Qs(),VVa=bG(),WVa=H8(),Jgt=xl(),zVa=Tg(),YVa=Fki();Rl.EmptyRelatedFilesResponse={entries:[],traits:[]};var zgt={entries:new Map,traits:[]},Ygt=class extends WVa.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampRl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};Rl.RelatedFilesProvider=vIr;Rl.RelatedFilesProvider=vIr=CIr=jVa([Wgt(0,SIr.IInstantiationService),Wgt(1,HVa.IIgnoreService),Wgt(2,Jgt.ICompletionsLogTargetService),Wgt(3,VVa.ICompletionsFileSystemService)],vIr);var JVa=3,p5e=new Ygt(KVa);async function Uki(t,e,r,n,o){let s=t.get(SIr.IInstantiationService),c=t.get(Jgt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>Rl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(p5e.bumpRetryCount(e.uri)>=JVa?u=zgt:u=void 0);let d=performance.now()-l;if(Rl.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new Kgt;return u}a(Uki,"getRelatedFiles");var bIr=a(function(t,e,r,n,o){let s=`${e.uri}`;if(p5e.has(s))return p5e.get(s);let c=Uki(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw p5e.delete(s),l})),p5e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");bIr=(0,YVa.shortCircuit)(bIr,200,zgt);async function ZVa(t,e,r,n,o,s=!1){let c=t.get(SIr.IInstantiationService),l=t.get(Jgt.ICompletionsLogTargetService),u=t.get(Rl.ICompletionsRelatedFilesProviderService),d=zgt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(Uki,f,r,n,u):await c.invokeFunction(bIr,f,r,n,u)}catch(f){d=zgt,f instanceof Kgt&&c.invokeFunction(zVa.telemetry,"getRelatedFilesList",r)}return Rl.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(ZVa,"getRelatedFilesAndTraits")});var pge=I(GG=>{"use strict";p();Object.defineProperty(GG,"__esModule",{value:!0});GG.NeighborSource=GG.NeighboringFileType=void 0;GG.considerNeighborFile=nWa;GG.isIncludeNeighborFilesActive=iWa;var XVa=Qs(),Qki=yG(),jki=VA(),eWa=xl(),tWa=zb(),rWa=Lki(),Xgt=Zgt(),qki;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(qki||(GG.NeighboringFileType=qki={}));function nWa(t,e){return(0,Qki.normalizeLanguageId)(t)===(0,Qki.normalizeLanguageId)(e)}a(nWa,"considerNeighborFile");var TIr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(jki.ICompletionsFeaturesService),d=e.get(eWa.ICompletionsLogTargetService),f=e.get(XVa.IInstantiationService),h=e.get(tWa.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(rWa.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return Xgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return Xgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Xgt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Xgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};GG.NeighborSource=TIr;function iWa(t,e,r){return t.get(jki.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(iWa,"isIncludeNeighborFilesActive")});var xIr=I(eAt=>{"use strict";p();Object.defineProperty(eAt,"__esModule",{value:!0});eAt.SimilarFiles=void 0;var hge=b4(),IIr=Y8(),oWa=sgt(),sWa=l1r(),aWa=cgt(),cWa=J8(),lWa=mge(),Hki=pge(),uWa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(cWa.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=Hki.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await Hki.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(lWa.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,sWa.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(aWa.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,oWa.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,hge.jsxs)(hge.Fragment,{children:[...o.map((u,d)=>(0,hge.jsx)(dWa,{snippet:u}))]})},"SimilarFiles");eAt.SimilarFiles=uWa;var dWa=a((t,e)=>(0,hge.jsxs)(IIr.Chunk,{children:[(0,hge.jsx)(IIr.Text,{children:t.snippet.headline}),(0,hge.jsx)(IIr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var Jki=I(BT=>{"use strict";p();Object.defineProperty(BT,"__esModule",{value:!0});BT.getAllRecentEditsByTimestamp=fWa;BT.findChangeSpan=wIr;BT.getDiff=$ki;BT.unifiedDiff=Vki;BT.findReplaceDiff=Wki;BT.editsOverlap=zki;BT.updateEdits=Yki;BT.buildIncomingEdit=RIr;BT.trimOldFilesFromState=Kki;BT.recentEditsReducer=mWa;BT.summarizeEdit=gWa;function fWa(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(fWa,"getAllRecentEditsByTimestamp");function wIr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(wIr,"findChangeSpan");function $ki(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a($ki,"getDiff");function pWa(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(pWa,"measureDiffSize");function Vki(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` +${dRi(r,e)} +`,this}appendLink(e,r,n){return this.value+="[",this.value+=this._escape(r,"]"),this.value+="](",this.value+=this._escape(String(e),")"),n&&(this.value+=` "${this._escape(this._escape(n,'"'),")")}"`),this.value+=")",this}_escape(e,r){let n=new RegExp((0,_ja.escapeRegExpCharacters)(r),"g");return e.replace(n,(o,s)=>e.charAt(s-1)!=="\\"?`\\${o}`:o)}};ty.MarkdownString=pgt;function lRi(t){return uRi(t)?!t.value:Array.isArray(t)?t.every(lRi):!0}a(lRi,"isEmptyMarkdownString");function uRi(t){return t instanceof pgt?!0:t&&typeof t=="object"?typeof t.value=="string"&&(typeof t.isTrusted=="boolean"||typeof t.isTrusted=="object"||t.isTrusted===void 0)&&(typeof t.supportThemeIcons=="boolean"||t.supportThemeIcons===void 0)&&(typeof t.supportAlertSyntax=="boolean"||t.supportAlertSyntax===void 0):!1}a(uRi,"isMarkdownString");function vja(t,e){return t===e?!0:!t||!e?!1:t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||!!t.baseUri&&!!e.baseUri&&(0,Eja.isEqual)(fgt.URI.from(t.baseUri),fgt.URI.from(e.baseUri)))}a(vja,"markdownStringEqual");function hgt(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}a(hgt,"escapeMarkdownSyntaxTokens");function Cja(t){return t.replace(/[\\\]]/g,"\\$&")}a(Cja,"escapeMarkdownLinkLabel");function dRi(t,e){let r=t.match(/^`+/gm)?.reduce((o,s)=>o.length>s.length?o:s).length??0,n=r>=3?r+1:3;return[`${"`".repeat(n)}${e}`,t,`${"`".repeat(n)}`].join(` +`)}a(dRi,"appendEscapedMarkdownCodeBlockFence");function bja(t){let e=Math.max(0,...(t.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(e+1),o=t.startsWith("`")||t.endsWith("`")?` ${t} `:t;return`${r}${o}${r}`}a(bja,"appendEscapedMarkdownInlineCode");function Sja(t){return t.replace(/"/g,""")}a(Sja,"escapeDoubleQuotes");function Tja(t){return t&&t.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}a(Tja,"removeMarkdownEscapes");function Ija(t){let e=[],r=t.split("|").map(o=>o.trim());t=r[0];let n=r[1];if(n){let o=/height=(\d+)/.exec(n),s=/width=(\d+)/.exec(n),c=o?o[1]:"",l=s?s[1]:"",u=isFinite(parseInt(l)),d=isFinite(parseInt(c));u&&e.push(`width="${l}"`),d&&e.push(`height="${c}"`)}return{href:t,dimensions:e}}a(Ija,"parseHrefAndDimensions");function fRi(t,e,r,n=!0){return`[${n?hgt(t):t}](${e}${r?` "${hgt(r)}"`:""})`}a(fRi,"createMarkdownLink");function xja(t,e=!0){let r=pRi(t.id,...t.arguments||[]).toString();return fRi(t.text,r,t.tooltip,e)}a(xja,"createMarkdownCommandLink");function pRi(t,...e){return fgt.URI.from({scheme:yja.Schemas.command,path:t,query:e.length?encodeURIComponent(JSON.stringify(e)):void 0})}a(pRi,"createCommandUri")});var Y1r=I(Gte=>{"use strict";p();var wja=Gte&&Gte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},W1r;Object.defineProperty(Gte,"__esModule",{value:!0});Gte.MarkdownString=void 0;var Rja=hRi(),Pja=nD(),z1r=W1r=class{static{a(this,"MarkdownString")}#e;static isMarkdownString(e){return e instanceof W1r?!0:!e||typeof e!="object"?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,r=!1){this.#e=new Rja.MarkdownString(e,{supportThemeIcons:r})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,r){return this.#e.appendCodeblock(r??"",e),this}};Gte.MarkdownString=z1r;Gte.MarkdownString=z1r=W1r=wja([Pja.es5ClassCompat],z1r)});var ARi=I(U8=>{"use strict";p();Object.defineProperty(U8,"__esModule",{value:!0});U8.Mimes=void 0;U8.getMediaOrTextMime=Dja;U8.getMediaMime=gRi;U8.getExtensionForMimeType=Nja;U8.normalizeMimeType=Oja;U8.isTextStreamMime=Bja;var mRi=fA();U8.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list",html:"text/html"});var kja={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},K1r={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":["image/jpg","image/jpeg"],".jpeg":["image/jpg","image/jpeg"],".jpg":["image/jpg","image/jpeg"],".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function Dja(t){let e=(0,mRi.extname)(t),r=kja[e.toLowerCase()];return r!==void 0?r:gRi(t)}a(Dja,"getMediaOrTextMime");function gRi(t){let e=(0,mRi.extname)(t),r=K1r[e.toLowerCase()];return Array.isArray(r)?r[0]:r}a(gRi,"getMediaMime");function Nja(t){for(let e in K1r){let r=K1r[e];if(Array.isArray(r)?r.includes(t):r===t)return e}}a(Nja,"getExtensionForMimeType");var Mja=/^(.+)\/(.+?)(;.+)?$/;function Oja(t,e){let r=Mja.exec(t);return r?`${r[1].toLowerCase()}/${r[2].toLowerCase()}${r[3]??""}`:e?void 0:t}a(Oja,"normalizeMimeType");function Bja(t){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(t)}a(Bja,"isTextStreamMime")});var _Ri=I(gm=>{"use strict";p();var Lja=gm&&gm.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},TG;Object.defineProperty(gm,"__esModule",{value:!0});gm.NotebookCellOutput=gm.NotebookCellOutputItem=gm.NotebookEdit=gm.NotebookData=gm.NotebookCellData=gm.NotebookRange=gm.NotebookCellKind=void 0;var Fja=nD(),yRi=bs(),mgt=ARi(),Uja=fm(),ERi;(function(t){t[t.Markup=1]="Markup",t[t.Code=2]="Code"})(ERi||(gm.NotebookCellKind=ERi={}));var $te=class t{static{a(this,"NotebookRange")}static isNotebookRange(e){return e instanceof t?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,r){if(e<0)throw(0,yRi.illegalArgument)("start must be positive");if(r<0)throw(0,yRi.illegalArgument)("end must be positive");e<=r?(this._start=e,this._end=r):(this._start=r,this._end=e)}with(e){let r=this._start,n=this._end;return e.start!==void 0&&(r=e.start),e.end!==void 0&&(n=e.end),r===this._start&&n===this._end?this:new t(r,n)}};gm.NotebookRange=$te;var J1r=class t{static{a(this,"NotebookCellData")}static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(r=>t.isNotebookCellData(r))}static isNotebookCellData(e){return!0}constructor(e,r,n,o,s,c,l){this.kind=e,this.value=r,this.languageId=n,this.mime=o,this.outputs=s??[],this.metadata=c,this.executionSummary=l,t.validate(this)}};gm.NotebookCellData=J1r;var Z1r=class{static{a(this,"NotebookData")}constructor(e){this.cells=e}};gm.NotebookData=Z1r;var X1r=TG=class{static{a(this,"NotebookEdit")}static isNotebookCellEdit(e){return e instanceof TG?!0:e?$te.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,r){return new TG(e,r)}static insertCells(e,r){return new TG(new $te(e,e),r)}static deleteCells(e){return new TG(e,[])}static updateCellMetadata(e,r){let n=new TG(new $te(e,e),[]);return n.newCellMetadata=r,n}static updateNotebookMetadata(e){let r=new TG(new $te(0,0),[]);return r.newNotebookMetadata=e,r}constructor(e,r){this.range=e,this.newCells=r}};gm.NotebookEdit=X1r;gm.NotebookEdit=X1r=TG=Lja([Fja.es5ClassCompat],X1r);var eSr=class t{static{a(this,"NotebookCellOutputItem")}static isNotebookCellOutputItem(e){return e instanceof t?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){let r={name:e.name,message:e.message,stack:e.stack};return t.json(r,"application/vnd.code.notebook.error")}static stdout(e){return t.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return t.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,r="application/octet-stream"){return new t(e,r)}static#e=new TextEncoder;static text(e,r=mgt.Mimes.text){let n=t.#e.encode(String(e));return new t(n,r)}static json(e,r="text/x-json"){let n=JSON.stringify(e,void 0," ");return t.text(n,r)}constructor(e,r){this.data=e,this.mime=r;let n=(0,mgt.normalizeMimeType)(r,!0);if(!n)throw new Error(`INVALID mime type: ${r}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}};gm.NotebookCellOutputItem=eSr;var tSr=class t{static{a(this,"NotebookCellOutput")}static isNotebookCellOutput(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,r=!1){let n=new Set,o=new Set;for(let s=0;s!o.has(c))}constructor(e,r,n){this.items=t.ensureUniqueMimeTypes(e,!0),typeof r=="string"?(this.id=r,this.metadata=n):(this.id=(0,Uja.generateUuid)(),this.metadata=r??n)}};gm.NotebookCellOutput=tSr});var CRi=I(xG=>{"use strict";p();var Qja=xG&&xG.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},rSr;Object.defineProperty(xG,"__esModule",{value:!0});xG.Selection=void 0;xG.getDebugDescriptionOfSelection=vRi;var qja=nD(),IG=Kme(),nSr=y4(),iSr=rSr=class extends nSr.Range{static{a(this,"Selection")}static isSelection(e){return e instanceof rSr?!0:!e||typeof e!="object"?!1:nSr.Range.isRange(e)&&IG.Position.isPosition(e.anchor)&&IG.Position.isPosition(e.active)&&typeof e.isReversed=="boolean"}get anchor(){return this._anchor}get active(){return this._active}constructor(e,r,n,o){let s,c;if(typeof e=="number"&&typeof r=="number"&&typeof n=="number"&&typeof o=="number"?(s=new IG.Position(e,r),c=new IG.Position(n,o)):IG.Position.isPosition(e)&&IG.Position.isPosition(r)&&(s=IG.Position.of(e),c=IG.Position.of(r)),!s||!c)throw new Error("Invalid arguments");super(s,c),this._anchor=s,this._active=c}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return vRi(this)}};xG.Selection=iSr;xG.Selection=iSr=rSr=Qja([qja.es5ClassCompat],iSr);function vRi(t){let e=(0,nSr.getDebugDescriptionOfRange)(t);return t.isEmpty||(t.active.isEqual(t.start)?e=`|${e}`:e=`${e}|`),e}a(vRi,"getDebugDescriptionOfSelection")});var sSr=I(Wte=>{"use strict";p();var jja=Wte&&Wte.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Vte;Object.defineProperty(Wte,"__esModule",{value:!0});Wte.SnippetString=void 0;var Hja=nD(),oSr=Vte=class{static{a(this,"SnippetString")}static isSnippetString(e){return e instanceof Vte?!0:!e||typeof e!="object"?!1:typeof e.value=="string"}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Vte._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,r=this._tabstop++){if(typeof e=="function"){let n=new Vte;n._tabstop=this._tabstop,e(n),this._tabstop=n._tabstop,e=n.value}else e=Vte._escape(e);return this.value+="${",this.value+=r,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,r=this._tabstop++){let n=e.map(o=>o.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=r,this.value+="|",this.value+=n,this.value+="|}",this}appendVariable(e,r){if(typeof r=="function"){let n=new Vte;n._tabstop=this._tabstop,r(n),this._tabstop=n._tabstop,r=n.value}else typeof r=="string"&&(r=r.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,r&&(this.value+=":",this.value+=r),this.value+="}",this}};Wte.SnippetString=oSr;Wte.SnippetString=oSr=Vte=jja([Hja.es5ClassCompat],oSr)});var cSr=I(ggt=>{"use strict";p();Object.defineProperty(ggt,"__esModule",{value:!0});ggt.SnippetTextEdit=void 0;var Gja=sSr(),bRi=y4(),aSr=class t{static{a(this,"SnippetTextEdit")}static isSnippetTextEdit(e){return e instanceof t?!0:e?bRi.Range.isRange(e.range)&&Gja.SnippetString.isSnippetString(e.snippet):!1}static replace(e,r){return new t(e,r)}static insert(e,r){return t.replace(new bRi.Range(e,e),r)}constructor(e,r){this.range=e,this.snippet=r}};ggt.SnippetTextEdit=aSr});var IRi=I(iD=>{"use strict";p();var $ja=iD&&iD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},lSr;Object.defineProperty(iD,"__esModule",{value:!0});iD.SymbolInformation=iD.SymbolTag=iD.SymbolKind=void 0;var Vja=nD(),SRi=T1r(),Wja=y4(),uSr;(function(t){t[t.File=0]="File",t[t.Module=1]="Module",t[t.Namespace=2]="Namespace",t[t.Package=3]="Package",t[t.Class=4]="Class",t[t.Method=5]="Method",t[t.Property=6]="Property",t[t.Field=7]="Field",t[t.Constructor=8]="Constructor",t[t.Enum=9]="Enum",t[t.Interface=10]="Interface",t[t.Function=11]="Function",t[t.Variable=12]="Variable",t[t.Constant=13]="Constant",t[t.String=14]="String",t[t.Number=15]="Number",t[t.Boolean=16]="Boolean",t[t.Array=17]="Array",t[t.Object=18]="Object",t[t.Key=19]="Key",t[t.Null=20]="Null",t[t.EnumMember=21]="EnumMember",t[t.Struct=22]="Struct",t[t.Event=23]="Event",t[t.Operator=24]="Operator",t[t.TypeParameter=25]="TypeParameter"})(uSr||(iD.SymbolKind=uSr={}));var TRi;(function(t){t[t.Deprecated=1]="Deprecated"})(TRi||(iD.SymbolTag=TRi={}));var dSr=lSr=class{static{a(this,"SymbolInformation")}static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,r,n,o,s){this.name=e,this.kind=r,this.containerName=s,typeof n=="string"&&(this.containerName=n),o instanceof SRi.Location?this.location=o:n instanceof Wja.Range&&(this.location=new SRi.Location(o,n)),lSr.validate(this)}toJSON(){return{name:this.name,kind:uSr[this.kind],location:this.location,containerName:this.containerName}}};iD.SymbolInformation=dSr;iD.SymbolInformation=dSr=lSr=$ja([Vja.es5ClassCompat],dSr)});var hSr=I(Q8=>{"use strict";p();var zja=Q8&&Q8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zte;Object.defineProperty(Q8,"__esModule",{value:!0});Q8.TextEdit=Q8.EndOfLine=void 0;var fSr=bs(),Yja=nD(),xRi=Kme(),Agt=y4(),wRi;(function(t){t[t.LF=1]="LF",t[t.CRLF=2]="CRLF"})(wRi||(Q8.EndOfLine=wRi={}));var pSr=zte=class{static{a(this,"TextEdit")}static isTextEdit(e){return e instanceof zte?!0:!e||typeof e!="object"?!1:Agt.Range.isRange(e)&&typeof e.newText=="string"}static replace(e,r){return new zte(e,r)}static insert(e,r){return zte.replace(new Agt.Range(e,e),r)}static delete(e){return zte.replace(e,"")}static setEndOfLine(e){let r=new zte(new Agt.Range(new xRi.Position(0,0),new xRi.Position(0,0)),"");return r.newEol=e,r}get range(){return this._range}set range(e){if(e&&!Agt.Range.isRange(e))throw(0,fSr.illegalArgument)("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw(0,fSr.illegalArgument)("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw(0,fSr.illegalArgument)("newEol");this._newEol=e}constructor(e,r){this._range=e,this._newText=r}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};Q8.TextEdit=pSr;Q8.TextEdit=pSr=zte=zja([Yja.es5ClassCompat],pSr)});var QRi=I(xt=>{"use strict";p();Object.defineProperty(xt,"__esModule",{value:!0});xt.ChatResponseClearToPreviousToolInvocationReason=xt.ChatRequestEditedFileEventKind=xt.ChatInputNotificationSeverity=xt.ChatErrorLevel=xt.AISearchKeyword=xt.TextSearchMatch2=xt.ExcludeSettingOptions=xt.LanguageModelPromptTsxPart=xt.ChatImageMimeType=xt.LanguageModelDataPart2=xt.LanguageModelDataPart=xt.LanguageModelThinkingPart=xt.LanguageModelTextPart2=xt.LanguageModelPartAudience=xt.LanguageModelTextPart=xt.LanguageModelToolResult2=xt.LanguageModelToolResult=xt.ChatReferenceBinaryData=xt.ChatReferenceDiagnostic=xt.ChatRequestNotebookData=xt.ChatRequestEditorData=xt.ChatResponseTurn=xt.ChatRequestTurn2=xt.ChatRequestTurn=xt.ChatResponseQuestionCarouselPart=xt.ChatQuestion=xt.ChatQuestionType=xt.ChatResponseConfirmationPart=xt.ChatResponseWorkspaceEditPart=xt.ChatResponseNotebookEditPart=xt.ChatResponseTextEditPart=xt.ChatResponseMarkdownWithVulnerabilitiesPart=xt.ChatResponseCommandButtonPart=xt.ChatResponseCodeCitationPart=xt.ChatResponsePullRequestPart=xt.ChatResponseExtensionsPart=xt.ChatResponseMovePart=xt.ChatResponseReferencePart2=xt.ChatResponseReferencePart=xt.ChatResponseInfoPart=xt.ChatResponseWarningPart=xt.ChatResponseProgressPart2=xt.ChatResponseExternalEditPart=xt.ChatResponseHookPart=xt.ChatResponseThinkingProgressPart=xt.ChatResponseProgressPart=xt.ChatResponseAnchorPart=xt.ChatResponseFileTreePart=xt.ChatResponseCodeblockUriPart=xt.ChatResponseMarkdownPart=void 0;xt.McpHttpServerDefinition=xt.McpStdioServerDefinition=xt.ChatResource=xt.LanguageModelError=xt.ChatSessionStatus=xt.ChatResponseTurn2=xt.ChatSubagentToolInvocationData=xt.ChatToolInvocationPart=xt.McpToolInvocationContentData=xt.LanguageModelChatMessage=xt.LanguageModelChatToolMode=xt.LanguageModelChatMessageRole=xt.LanguageModelToolResultPart2=xt.LanguageModelToolResultPart=xt.LanguageModelToolCallPart=xt.LanguageModelToolMCPSource=xt.LanguageModelToolExtensionSource=void 0;var RRi=k7(),vgt=Y1r(),mSr=class{static{a(this,"ChatResponseMarkdownPart")}constructor(e){this.value=typeof e=="string"?new vgt.MarkdownString(e):e}};xt.ChatResponseMarkdownPart=mSr;var gSr=class{static{a(this,"ChatResponseCodeblockUriPart")}constructor(e,r,n){this.value=e,this.undoStopId=n}};xt.ChatResponseCodeblockUriPart=gSr;var ASr=class{static{a(this,"ChatResponseFileTreePart")}constructor(e,r){this.value=e,this.baseUri=r}};xt.ChatResponseFileTreePart=ASr;var ySr=class{static{a(this,"ChatResponseAnchorPart")}constructor(e,r){this.value=e,this.title=r}};xt.ChatResponseAnchorPart=ySr;var ESr=class{static{a(this,"ChatResponseProgressPart")}constructor(e){this.value=e}};xt.ChatResponseProgressPart=ESr;var _Sr=class{static{a(this,"ChatResponseThinkingProgressPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.ChatResponseThinkingProgressPart=_Sr;var vSr=class{static{a(this,"ChatResponseHookPart")}constructor(e,r,n,o){this.hookType=e,this.stopReason=r,this.systemMessage=n,this.metadata=o}};xt.ChatResponseHookPart=vSr;var CSr=class{static{a(this,"ChatResponseExternalEditPart")}constructor(e,r){this.uris=e,this.callback=r,this.applied=new Promise(n=>{this.didGetApplied=n})}};xt.ChatResponseExternalEditPart=CSr;var bSr=class{static{a(this,"ChatResponseProgressPart2")}constructor(e,r){this.value=e,this.task=r}};xt.ChatResponseProgressPart2=bSr;var SSr=class{static{a(this,"ChatResponseWarningPart")}constructor(e){this.value=typeof e=="string"?new vgt.MarkdownString(e):e}};xt.ChatResponseWarningPart=SSr;var TSr=class{static{a(this,"ChatResponseInfoPart")}constructor(e){this.value=typeof e=="string"?new vgt.MarkdownString(e):e}};xt.ChatResponseInfoPart=TSr;var ISr=class{static{a(this,"ChatResponseReferencePart")}constructor(e){this.value=e}};xt.ChatResponseReferencePart=ISr;var xSr=class{static{a(this,"ChatResponseReferencePart2")}constructor(e,r,n){this.value=e,this.iconPath=r,this.options=n}};xt.ChatResponseReferencePart2=xSr;var wSr=class{static{a(this,"ChatResponseMovePart")}constructor(e,r){this.uri=e,this.range=r}};xt.ChatResponseMovePart=wSr;var RSr=class{static{a(this,"ChatResponseExtensionsPart")}constructor(e){this.extensions=e}};xt.ChatResponseExtensionsPart=RSr;var PSr=class{static{a(this,"ChatResponsePullRequestPart")}constructor(e,r,n,o,s){"command"in e&&typeof e.command=="string"?this.command=e:(this.uri=e,this.command={title:"View Pull Request",command:"vscode.open",arguments:[e]}),this.title=r,this.description=n,this.author=o,this.linkTag=s}};xt.ChatResponsePullRequestPart=PSr;var kSr=class{static{a(this,"ChatResponseCodeCitationPart")}constructor(e,r,n){this.value=e,this.license=r,this.snippet=n}};xt.ChatResponseCodeCitationPart=kSr;var DSr=class{static{a(this,"ChatResponseCommandButtonPart")}constructor(e){this.value=e}};xt.ChatResponseCommandButtonPart=DSr;var NSr=class{static{a(this,"ChatResponseMarkdownWithVulnerabilitiesPart")}constructor(e,r){this.value=typeof e=="string"?new vgt.MarkdownString(e):e,this.vulnerabilities=r}};xt.ChatResponseMarkdownWithVulnerabilitiesPart=NSr;var MSr=class{static{a(this,"ChatResponseTextEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};xt.ChatResponseTextEditPart=MSr;var OSr=class{static{a(this,"ChatResponseNotebookEditPart")}constructor(e,r){this.uri=e,r===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(r)?r:[r]}};xt.ChatResponseNotebookEditPart=OSr;var BSr=class{static{a(this,"ChatResponseWorkspaceEditPart")}constructor(e){this.edits=e}};xt.ChatResponseWorkspaceEditPart=BSr;var LSr=class{static{a(this,"ChatResponseConfirmationPart")}constructor(e,r,n,o){this.title=e,this.message=r,this.data=n,this.buttons=o}};xt.ChatResponseConfirmationPart=LSr;var PRi;(function(t){t[t.Text=1]="Text",t[t.SingleSelect=2]="SingleSelect",t[t.MultiSelect=3]="MultiSelect"})(PRi||(xt.ChatQuestionType=PRi={}));var FSr=class{static{a(this,"ChatQuestion")}constructor(e,r,n,o){this.id=e,this.type=r,this.title=n,o&&(this.message=o.message,this.options=o.options,this.defaultValue=o.defaultValue,this.allowFreeformInput=o.allowFreeformInput)}};xt.ChatQuestion=FSr;var USr=class{static{a(this,"ChatResponseQuestionCarouselPart")}constructor(e,r){this.questions=e,this.allowSkip=r??!1}};xt.ChatResponseQuestionCarouselPart=USr;var QSr=class{static{a(this,"ChatRequestTurn")}constructor(e,r,n,o,s){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s}};xt.ChatRequestTurn=QSr;var qSr=class{static{a(this,"ChatRequestTurn2")}constructor(e,r,n,o,s,c,l,u,d){this.prompt=e,this.command=r,this.references=n,this.participant=o,this.toolReferences=s,this.editedFileEvents=c,this.id=l,this.modelId=u,this.modeInstructions2=d}};xt.ChatRequestTurn2=qSr;var jSr=class{static{a(this,"ChatResponseTurn")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn=jSr;var HSr=class{static{a(this,"ChatRequestEditorData")}constructor(e,r,n,o){this.editor=e,this.document=r,this.selection=n,this.wholeRange=o}};xt.ChatRequestEditorData=HSr;var GSr=class{static{a(this,"ChatRequestNotebookData")}constructor(e){this.cell=e}};xt.ChatRequestNotebookData=GSr;var $Sr=class{static{a(this,"ChatReferenceDiagnostic")}constructor(e){this.diagnostics=e}};xt.ChatReferenceDiagnostic=$Sr;var VSr=class{static{a(this,"ChatReferenceBinaryData")}constructor(e,r){this.mimeType=e,this.data=r}};xt.ChatReferenceBinaryData=VSr;var WSr=class{static{a(this,"LanguageModelToolResult")}constructor(e){this.content=e}};xt.LanguageModelToolResult=WSr;var zSr=class{static{a(this,"LanguageModelToolResult2")}constructor(e){this.content=e}};xt.LanguageModelToolResult2=zSr;var ygt=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}};xt.LanguageModelTextPart=ygt;var kRi;(function(t){t[t.Assistant=0]="Assistant",t[t.User=1]="User",t[t.Extension=2]="Extension"})(kRi||(xt.LanguageModelPartAudience=kRi={}));var YSr=class extends ygt{static{a(this,"LanguageModelTextPart2")}constructor(e,r){super(e),this.audience=r}};xt.LanguageModelTextPart2=YSr;var KSr=class{static{a(this,"LanguageModelThinkingPart")}constructor(e,r,n){this.value=e,this.id=r,this.metadata=n}};xt.LanguageModelThinkingPart=KSr;var Egt=class t{static{a(this,"LanguageModelDataPart")}constructor(e,r){this.mimeType=r,this.data=e}static image(e,r){return new t(e,r)}static json(e){let r=JSON.stringify(e,void 0," ");return new t(RRi.VSBuffer.fromString(r).buffer,"json")}static text(e){return new t(RRi.VSBuffer.fromString(e).buffer,"text/plain")}};xt.LanguageModelDataPart=Egt;var JSr=class extends Egt{static{a(this,"LanguageModelDataPart2")}constructor(e,r,n){super(e,r),this.audience=n}};xt.LanguageModelDataPart2=JSr;var DRi;(function(t){t.PNG="image/png",t.JPEG="image/jpeg",t.GIF="image/gif",t.WEBP="image/webp",t.BMP="image/bmp"})(DRi||(xt.ChatImageMimeType=DRi={}));var ZSr=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};xt.LanguageModelPromptTsxPart=ZSr;var NRi;(function(t){t[t.None=1]="None",t[t.FilesExclude=2]="FilesExclude",t[t.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(NRi||(xt.ExcludeSettingOptions=NRi={}));var XSr=class{static{a(this,"TextSearchMatch2")}constructor(e,r,n){this.uri=e,this.ranges=r,this.previewText=n}};xt.TextSearchMatch2=XSr;var eTr=class{static{a(this,"AISearchKeyword")}constructor(e){this.keyword=e}};xt.AISearchKeyword=eTr;var MRi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(MRi||(xt.ChatErrorLevel=MRi={}));var ORi;(function(t){t[t.Info=0]="Info",t[t.Warning=1]="Warning",t[t.Error=2]="Error"})(ORi||(xt.ChatInputNotificationSeverity=ORi={}));var BRi;(function(t){t[t.Keep=1]="Keep",t[t.Undo=2]="Undo",t[t.UserModification=3]="UserModification"})(BRi||(xt.ChatRequestEditedFileEventKind=BRi={}));var LRi;(function(t){t[t.NoReason=0]="NoReason",t[t.FilteredContentRetry=1]="FilteredContentRetry",t[t.CopyrightContentRetry=2]="CopyrightContentRetry"})(LRi||(xt.ChatResponseClearToPreviousToolInvocationReason=LRi={}));var tTr=class{static{a(this,"LanguageModelToolExtensionSource")}constructor(e,r){this.id=e,this.label=r}};xt.LanguageModelToolExtensionSource=tTr;var rTr=class{static{a(this,"LanguageModelToolMCPSource")}constructor(e,r,n){this.label=e,this.name=r,this.instructions=n}};xt.LanguageModelToolMCPSource=rTr;var nTr=class{static{a(this,"LanguageModelToolCallPart")}constructor(e,r,n){this.callId=e,this.name=r,this.input=n}};xt.LanguageModelToolCallPart=nTr;var iTr=class{static{a(this,"LanguageModelToolResultPart")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart=iTr;var oTr=class{static{a(this,"LanguageModelToolResultPart2")}constructor(e,r,n){this.callId=e,this.content=r,this.isError=n??!1}};xt.LanguageModelToolResultPart2=oTr;var _gt;(function(t){t[t.User=1]="User",t[t.Assistant=2]="Assistant",t[t.System=3]="System"})(_gt||(xt.LanguageModelChatMessageRole=_gt={}));var FRi;(function(t){t[t.Auto=1]="Auto",t[t.Required=2]="Required"})(FRi||(xt.LanguageModelChatToolMode=FRi={}));var sTr=class t{static{a(this,"LanguageModelChatMessage")}constructor(e,r,n){this.role=e,this.content=typeof r=="string"?[{type:"text",value:r}]:r,this.name=n}static User(e,r){return new t(_gt.User,e,r)}static Assistant(e,r){return new t(_gt.Assistant,e,r)}};xt.LanguageModelChatMessage=sTr;var aTr=class{static{a(this,"McpToolInvocationContentData")}constructor(e,r){this.data=e,this.mimeType=r}};xt.McpToolInvocationContentData=aTr;var cTr=class{static{a(this,"ChatToolInvocationPart")}constructor(e,r,n){this.toolName=e,this.toolCallId=r,this.isError=typeof n=="string"?!0:n}};xt.ChatToolInvocationPart=cTr;var lTr=class{static{a(this,"ChatSubagentToolInvocationData")}constructor(e,r,n,o){this.description=e,this.agentName=r,this.prompt=n,this.result=o}};xt.ChatSubagentToolInvocationData=lTr;var uTr=class{static{a(this,"ChatResponseTurn2")}constructor(e,r,n,o){this.response=e,this.result=r,this.participant=n,this.command=o}};xt.ChatResponseTurn2=uTr;var URi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress",t[t.NeedsInput=3]="NeedsInput"})(URi||(xt.ChatSessionStatus=URi={}));var dTr=class t extends Error{static{a(this,"LanguageModelError")}static#e="LanguageModelError";static NotFound(e){return new t(e,t.NotFound.name)}static NoPermissions(e){return new t(e,t.NoPermissions.name)}static Blocked(e){return new t(e,t.Blocked.name)}constructor(e,r,n){super(e,{cause:n}),this.name=t.#e,this.code=r??""}};xt.LanguageModelError=dTr;var fTr=class{static{a(this,"ChatResource")}constructor(e){this.uri=e}};xt.ChatResource=fTr;var pTr=class{static{a(this,"McpStdioServerDefinition")}constructor(e,r,n,o,s){this.label=e,this.command=r,this.args=n??[],this.env=o??{},this.version=s}};xt.McpStdioServerDefinition=pTr;var hTr=class{static{a(this,"McpHttpServerDefinition")}constructor(e,r,n,o){this.label=e,this.uri=r,this.headers=n??{},this.version=o}};xt.McpHttpServerDefinition=hTr});var HRi=I(wG=>{"use strict";p();Object.defineProperty(wG,"__esModule",{value:!0});wG.TextDocumentChangeReason=wG.TextEditorSelectionChangeKind=wG.WorkspaceEdit=void 0;var Kja=ml(),Jja=XP(),Zja=y4(),Xja=cSr(),eHa=hSr(),mTr=class{static{a(this,"WorkspaceEdit")}constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,r,n,o){this._edits.push({_type:1,from:e,to:r,options:n,metadata:o})}createFile(e,r,n){this._edits.push({_type:1,from:void 0,to:e,options:r,metadata:n})}deleteFile(e,r,n){this._edits.push({_type:1,from:e,to:void 0,options:r,metadata:n})}replace(e,r,n,o){this._edits.push({_type:2,uri:e,edit:new eHa.TextEdit(r,n),metadata:o})}insert(e,r,n,o){this.replace(e,new Zja.Range(r,r),n,o)}delete(e,r,n){this.replace(e,r,"",n)}has(e){return this._edits.some(r=>r._type===2&&r.uri.toString()===e.toString())}set(e,r){if(r)for(let n of r){if(!n)continue;let o,s;Array.isArray(n)?(o=n[0],s=n[1]):o=n,Xja.SnippetTextEdit.isSnippetTextEdit(o)?this._edits.push({_type:6,uri:e,range:o.range,edit:o.snippet,metadata:s}):this._edits.push({_type:2,uri:e,edit:o,metadata:s})}else{for(let n=0;n{"use strict";p();Object.defineProperty(vp,"__esModule",{value:!0});vp.FileType=vp.ChatSessionStatus=vp.ChatLocation=vp.ChatVariableLevel=vp.ExtensionMode=vp.DiagnosticSeverity=vp.TextEditorRevealType=vp.TextEditorLineNumbersStyle=vp.TextEditorCursorStyle=vp.InteractiveEditorResponseFeedbackKind=void 0;var GRi;(function(t){t[t.Unhelpful=0]="Unhelpful",t[t.Helpful=1]="Helpful",t[t.Undone=2]="Undone",t[t.Accepted=3]="Accepted",t[t.Bug=4]="Bug"})(GRi||(vp.InteractiveEditorResponseFeedbackKind=GRi={}));var $Ri;(function(t){t[t.Line=1]="Line",t[t.Block=2]="Block",t[t.Underline=3]="Underline",t[t.LineThin=4]="LineThin",t[t.BlockOutline=5]="BlockOutline",t[t.UnderlineThin=6]="UnderlineThin"})($Ri||(vp.TextEditorCursorStyle=$Ri={}));var VRi;(function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.Relative=2]="Relative",t[t.Interval=3]="Interval"})(VRi||(vp.TextEditorLineNumbersStyle=VRi={}));var WRi;(function(t){t[t.Default=0]="Default",t[t.InCenter=1]="InCenter",t[t.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",t[t.AtTop=3]="AtTop"})(WRi||(vp.TextEditorRevealType=WRi={}));var zRi;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Information=2]="Information",t[t.Hint=3]="Hint"})(zRi||(vp.DiagnosticSeverity=zRi={}));var YRi;(function(t){t[t.Production=1]="Production",t[t.Development=2]="Development",t[t.Test=3]="Test"})(YRi||(vp.ExtensionMode=YRi={}));var KRi;(function(t){t[t.Short=1]="Short",t[t.Medium=2]="Medium",t[t.Full=3]="Full"})(KRi||(vp.ChatVariableLevel=KRi={}));var JRi;(function(t){t[t.Panel=1]="Panel",t[t.Terminal=2]="Terminal",t[t.Notebook=3]="Notebook",t[t.Editor=4]="Editor"})(JRi||(vp.ChatLocation=JRi={}));var ZRi;(function(t){t[t.Failed=0]="Failed",t[t.Completed=1]="Completed",t[t.InProgress=2]="InProgress"})(ZRi||(vp.ChatSessionStatus=ZRi={}));var XRi;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(XRi||(vp.FileType=XRi={}))});var rPi=I(gTr=>{"use strict";p();Object.defineProperty(gTr,"__esModule",{value:!0});gTr.t=tHa;function tHa(...t){if(typeof t[0]=="string"){let e=t.shift(),r=!t||typeof t[0]!="object"?t:t[0];return tPi({message:e,args:r})}return tPi(t[0])}a(tHa,"t");function tPi(t){let{message:e,args:r}=t;return nHa(e,r??{})}a(tPi,"getMessage");var rHa=/{([^}]+)}/g;function nHa(t,e){return t.replace(rHa,(r,n)=>e[n]??r)}a(nHa,"format2")});var oPi=I(RG=>{"use strict";p();Object.defineProperty(RG,"__esModule",{value:!0});RG.NewSymbolName=RG.NewSymbolNameTriggerKind=RG.NewSymbolNameTag=void 0;var nPi;(function(t){t[t.AIGenerated=1]="AIGenerated"})(nPi||(RG.NewSymbolNameTag=nPi={}));var iPi;(function(t){t[t.Invoke=0]="Invoke",t[t.Automatic=1]="Automatic"})(iPi||(RG.NewSymbolNameTriggerKind=iPi={}));var ATr=class{static{a(this,"NewSymbolName")}constructor(e,r){this.newSymbolName=e,this.tags=r}};RG.NewSymbolName=ATr});var aPi=I(Cgt=>{"use strict";p();Object.defineProperty(Cgt,"__esModule",{value:!0});Cgt.TerminalShellExecutionCommandLineConfidence=void 0;var sPi;(function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"})(sPi||(Cgt.TerminalShellExecutionCommandLineConfidence=sPi={}))});var cPi=I(Zme=>{"use strict";p();Object.defineProperty(Zme,"__esModule",{value:!0});Zme.ThemeColor=Zme.ThemeIcon=void 0;var yTr=class t{static{a(this,"ThemeIcon")}constructor(e,r){this.id=e,this.color=r}static isThemeIcon(e){return!(e instanceof t)}};Zme.ThemeIcon=yTr;var ETr=class{static{a(this,"ThemeColor")}constructor(e){this.id=e}};Zme.ThemeColor=ETr});var Am=I(($Sp,fPi)=>{"use strict";p();var iHa=ik(),oHa=_c(),sHa=Vu(),lPi=C1r(),aHa=T1r(),cHa=Y1r(),VOe=_Ri(),lHa=Kme(),uHa=y4(),dHa=CRi(),fHa=sSr(),pHa=cSr(),uPi=IRi(),dPi=hSr(),Mn=QRi(),_Tr=HRi(),PG=ePi(),hHa=rPi(),vTr=oPi(),mHa=aPi(),gHa=cPi(),AHa={Position:lHa.Position,Range:uHa.Range,Selection:dHa.Selection,EventEmitter:oHa.Emitter,CancellationTokenSource:iHa.CancellationTokenSource,Diagnostic:lPi.Diagnostic,Location:aHa.Location,DiagnosticRelatedInformation:lPi.DiagnosticRelatedInformation,TextEdit:dPi.TextEdit,WorkspaceEdit:_Tr.WorkspaceEdit,Uri:sHa.URI,MarkdownString:cHa.MarkdownString,DiagnosticSeverity:PG.DiagnosticSeverity,TextEditorCursorStyle:PG.TextEditorCursorStyle,TextEditorLineNumbersStyle:PG.TextEditorLineNumbersStyle,TextEditorRevealType:PG.TextEditorRevealType,EndOfLine:dPi.EndOfLine,l10n:{t:hHa.t},ExtensionMode:PG.ExtensionMode,ChatVariableLevel:PG.ChatVariableLevel,ChatResponseClearToPreviousToolInvocationReason:Mn.ChatResponseClearToPreviousToolInvocationReason,ChatResponseMarkdownPart:Mn.ChatResponseMarkdownPart,ChatResponseFileTreePart:Mn.ChatResponseFileTreePart,ChatResponseAnchorPart:Mn.ChatResponseAnchorPart,ChatResponseMovePart:Mn.ChatResponseMovePart,ChatResponseExtensionsPart:Mn.ChatResponseExtensionsPart,ChatResponseProgressPart:Mn.ChatResponseProgressPart,ChatResponseProgressPart2:Mn.ChatResponseProgressPart2,ChatResponseWarningPart:Mn.ChatResponseWarningPart,ChatResponseInfoPart:Mn.ChatResponseInfoPart,ChatResponseHookPart:Mn.ChatResponseHookPart,ChatResponseReferencePart:Mn.ChatResponseReferencePart,ChatResponseReferencePart2:Mn.ChatResponseReferencePart2,ChatResponseCodeCitationPart:Mn.ChatResponseCodeCitationPart,ChatResponseCommandButtonPart:Mn.ChatResponseCommandButtonPart,ChatResponseExternalEditPart:Mn.ChatResponseExternalEditPart,ChatResponseMarkdownWithVulnerabilitiesPart:Mn.ChatResponseMarkdownWithVulnerabilitiesPart,ChatResponseCodeblockUriPart:Mn.ChatResponseCodeblockUriPart,ChatResponseTextEditPart:Mn.ChatResponseTextEditPart,ChatResponseNotebookEditPart:Mn.ChatResponseNotebookEditPart,ChatResponseWorkspaceEditPart:Mn.ChatResponseWorkspaceEditPart,ChatResponseConfirmationPart:Mn.ChatResponseConfirmationPart,ChatQuestion:Mn.ChatQuestion,ChatQuestionType:Mn.ChatQuestionType,ChatResponseQuestionCarouselPart:Mn.ChatResponseQuestionCarouselPart,ChatRequestTurn:Mn.ChatRequestTurn,ChatResponseTurn:Mn.ChatResponseTurn,ChatRequestEditorData:Mn.ChatRequestEditorData,ChatRequestNotebookData:Mn.ChatRequestNotebookData,NewSymbolName:vTr.NewSymbolName,NewSymbolNameTag:vTr.NewSymbolNameTag,NewSymbolNameTriggerKind:vTr.NewSymbolNameTriggerKind,ChatLocation:PG.ChatLocation,SymbolInformation:uPi.SymbolInformation,LanguageModelToolResult:Mn.LanguageModelToolResult,ExtendedLanguageModelToolResult:Mn.LanguageModelToolResult,LanguageModelToolResult2:Mn.LanguageModelToolResult2,LanguageModelPromptTsxPart:Mn.LanguageModelPromptTsxPart,LanguageModelTextPart:Mn.LanguageModelTextPart,LanguageModelDataPart:Mn.LanguageModelDataPart,LanguageModelToolExtensionSource:Mn.LanguageModelToolExtensionSource,LanguageModelToolMCPSource:Mn.LanguageModelToolMCPSource,ChatReferenceBinaryData:Mn.ChatReferenceBinaryData,ChatReferenceDiagnostic:Mn.ChatReferenceDiagnostic,TextSearchMatch2:Mn.TextSearchMatch2,AISearchKeyword:Mn.AISearchKeyword,ExcludeSettingOptions:Mn.ExcludeSettingOptions,NotebookCellKind:VOe.NotebookCellKind,NotebookRange:VOe.NotebookRange,NotebookEdit:VOe.NotebookEdit,NotebookCellData:VOe.NotebookCellData,NotebookData:VOe.NotebookData,ChatErrorLevel:Mn.ChatErrorLevel,ChatInputNotificationSeverity:Mn.ChatInputNotificationSeverity,TerminalShellExecutionCommandLineConfidence:mHa.TerminalShellExecutionCommandLineConfidence,ChatRequestEditedFileEventKind:Mn.ChatRequestEditedFileEventKind,ChatResponsePullRequestPart:Mn.ChatResponsePullRequestPart,LanguageModelTextPart2:Mn.LanguageModelTextPart2,LanguageModelDataPart2:Mn.LanguageModelDataPart2,LanguageModelThinkingPart:Mn.LanguageModelThinkingPart,LanguageModelPartAudience:Mn.LanguageModelPartAudience,ChatResponseThinkingProgressPart:Mn.ChatResponseThinkingProgressPart,LanguageModelToolCallPart:Mn.LanguageModelToolCallPart,LanguageModelToolResultPart:Mn.LanguageModelToolResultPart,LanguageModelToolResultPart2:Mn.LanguageModelToolResultPart2,LanguageModelChatMessageRole:Mn.LanguageModelChatMessageRole,LanguageModelChatMessage:Mn.LanguageModelChatMessage,LanguageModelChatToolMode:Mn.LanguageModelChatToolMode,TextEditorSelectionChangeKind:_Tr.TextEditorSelectionChangeKind,TextDocumentChangeReason:_Tr.TextDocumentChangeReason,ChatToolInvocationPart:Mn.ChatToolInvocationPart,ChatSubagentToolInvocationData:Mn.ChatSubagentToolInvocationData,McpToolInvocationContentData:Mn.McpToolInvocationContentData,ChatResponseTurn2:Mn.ChatResponseTurn2,ChatRequestTurn2:Mn.ChatRequestTurn2,LanguageModelError:Mn.LanguageModelError,SymbolKind:uPi.SymbolKind,SnippetString:fHa.SnippetString,SnippetTextEdit:pHa.SnippetTextEdit,FileType:PG.FileType,ChatSessionStatus:Mn.ChatSessionStatus,authentication:{getSession:a(async()=>{throw new Error("authentication.getSession not mocked in test")},"getSession")},McpHttpServerDefinition:Mn.McpHttpServerDefinition,McpStdioServerDefinition:Mn.McpStdioServerDefinition,ThemeIcon:gHa.ThemeIcon};fPi.exports=AHa});var pPi=I(Xme=>{"use strict";p();Object.defineProperty(Xme,"__esModule",{value:!0});Xme.UseData=Xme.UseState=void 0;var CTr=class{static{a(this,"UseState")}constructor(e){this.states=e,this.currentIndex=0,this.stateChanged=!1}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}};Xme.UseState=CTr;var bTr=class{static{a(this,"UseData")}constructor(e){this.measureUpdateTime=e,this.consumers=[]}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};Xme.UseData=bTr});var mPi=I(bgt=>{"use strict";p();Object.defineProperty(bgt,"__esModule",{value:!0});bgt.VirtualPromptReconciler=void 0;var hPi=pPi(),STr=class{static{a(this,"VirtualPromptReconciler")}constructor(e){this.lifecycleData=new Map,this.vTree=this.virtualizeElement(e,"$",0)}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(yHa(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new ITr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new TTr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}};bgt.VirtualPromptReconciler=STr;var TTr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},ITr=class{static{a(this,"PromptElementLifecycle")}constructor(e){this.lifecycleData=e,this.stateHook=new hPi.UseState(e.state),this.dataHook=new hPi.UseData(r=>{e._updateTimeMs=r})}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function yHa(t){return typeof t=="function"&&"isFragmentFunction"in t}a(yHa,"isFragmentFunction")});var gPi=I(Sgt=>{"use strict";p();Object.defineProperty(Sgt,"__esModule",{value:!0});Sgt.VirtualPrompt=void 0;var EHa=mPi(),xTr=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new EHa.VirtualPromptReconciler(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};Sgt.VirtualPrompt=xTr});var q8=I(Tgt=>{"use strict";p();Object.defineProperty(Tgt,"__esModule",{value:!0});Tgt.Text=_Ha;Tgt.Chunk=vHa;function _Ha(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(_Ha,"Text");function vHa(t){return t.children}a(vHa,"Chunk")});var kG=I(j8=>{"use strict";p();Object.defineProperty(j8,"__esModule",{value:!0});j8.PerCompletionContextProviderStatistics=j8.ContextProviderStatistics=j8.ICompletionsContextProviderService=void 0;j8.componentStatisticsToPromptMatcher=SHa;var CHa=tn(),bHa=O8();j8.ICompletionsContextProviderService=(0,CHa.createServiceIdentifier)("ICompletionsContextProviderService");var wTr=class{static{a(this,"ContextProviderStatistics")}constructor(e=()=>new Igt){this.createStatistics=e,this.statistics=new bHa.LRUCacheMap(25)}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}};j8.ContextProviderStatistics=wTr;var Igt=class{static{a(this,"PerCompletionContextProviderStatistics")}constructor(){this._expectations=new Map,this._lastResolution=new Map,this._statistics=new Map,this.opportunityId=void 0}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}setOpportunityId(e){this.opportunityId=e}get(e){return this._statistics.get(e)}getAllUsageStatistics(){return this._statistics.entries()}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};j8.PerCompletionContextProviderStatistics=Igt;function SHa(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(SHa,"componentStatisticsToPromptMatcher")});var YOe=I(zOe=>{"use strict";p();Object.defineProperty(zOe,"__esModule",{value:!0});zOe.filterContextItemsByType=wHa;zOe.filterSupportedContextItems=RHa;zOe.addOrValidateContextItemsIDs=kHa;var THa=Am(),IHa=Vu(),RTr=fm(),xHa=mOe(),PTr=Tl(),WOe;(function(t){function e(r){return!(r.importance!==void 0&&(typeof r.importance!="number"||!Number.isInteger(r.importance)||r.importance<0||r.importance>100)||r.id!==void 0&&typeof r.id!="string"||r.origin!==void 0&&!xHa.ContextItemOrigin.is(r.origin))}a(e,"is"),t.is=e})(WOe||(WOe={}));var kTr;(function(t){function e(r){if(!WOe.is(r))return!1;let n=r;return typeof n.name=="string"&&typeof n.value=="string"}a(e,"is"),t.is=e})(kTr||(kTr={}));var DTr;(function(t){function e(r){if(!WOe.is(r))return!1;let n=r;if(typeof n.uri!="string"||typeof n.value!="string")return!1;if(n.additionalUris===void 0)return!0;if(!Array.isArray(n.additionalUris))return!1;for(let o of n.additionalUris)if(typeof o!="string")return!1;return!0}a(e,"is"),t.is=e})(DTr||(DTr={}));var NTr;(function(t){function e(r){if(!WOe.is(r))return!1;let n=r;if(!IHa.URI.isUri(n.uri)||!Array.isArray(n.values))return!1;for(let o of n.values)if(!(o instanceof THa.Diagnostic))return!1;return!0}a(e,"is"),t.is=e})(NTr||(NTr={}));var MTr;(function(t){function e(r){if(kTr.is(r))return"Trait";if(DTr.is(r))return"CodeSnippet";if(NTr.is(r))return"DiagnosticBag"}a(e,"is"),t.is=e})(MTr||(MTr={}));function wHa(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(wHa,"filterContextItemsByType");function RHa(t){let e=[],r=0;return t.forEach(n=>{let o=MTr.is(n);o!==void 0?e.push({...n,type:o}):r++}),[e,r]}a(RHa,"filterSupportedContextItems");function PHa(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(PHa,"validateContextItemId");function kHa(t,e){let r=new Set,n=t.get(PTr.ICompletionsLogTargetService),o=[];for(let s of e){let c=s.id??(0,RTr.generateUuid)();if(!PHa(c)){let l=(0,RTr.generateUuid)();PTr.logger.error(n,`Invalid context item ID ${c}, replacing with ${l}`),c=l}if(r.has(c)){let l=(0,RTr.generateUuid)();PTr.logger.error(n,`Duplicate context item ID ${c}, replacing with ${l}`),c=l}r.add(c),o.push({...s,id:c})}return o}a(kHa,"addOrValidateContextItemsIDs")});var OTr=I(xgt=>{"use strict";p();Object.defineProperty(xgt,"__esModule",{value:!0});xgt.getCodeSnippetsFromContextItems=BHa;xgt.addRelativePathToCodeSnippets=LHa;var DHa=qb(),NHa=kG(),MHa=YOe(),OHa="content_excluded";async function BHa(t,e,r,n){let o=(0,MHa.filterContextItemsByType)(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(h=>h.data.map(m=>(s.add(m.uri),m.additionalUris?.forEach(g=>s.add(g)),{providerId:h.providerId,data:m}))),l=t.get(NHa.ICompletionsContextProviderService),u=t.get(DHa.ICompletionsTextDocumentManagerService),d=new Map;await Promise.all(Array.from(s).map(async h=>{d.set(h,await u.getTextDocumentValidation({uri:h}))}));let f=l.getStatisticsForCompletion(e);return c.filter(h=>{let g=[h.data.uri,...h.data.additionalUris??[]].every(A=>d.get(A)?.status==="valid");return g?f.addExpectations(h.providerId,[[h.data,"included"]]):f.addExpectations(h.providerId,[[h.data,OHa]]),g}).map(h=>h.data)}a(BHa,"getCodeSnippetsFromContextItems");function LHa(t,e){return e.map(r=>({snippet:r,relativePath:t.getRelativePath(r)}))}a(LHa,"addRelativePathToCodeSnippets")});var BTr=I(Pgt=>{"use strict";p();Object.defineProperty(Pgt,"__esModule",{value:!0});Pgt.CodeSnippets=void 0;var wgt=A4(),Rgt=q8(),FHa=H8(),UHa=OTr(),QHa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(FHa.isCompletionRequestData,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=(0,UHa.addRelativePathToCodeSnippets)(t.tdms,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push((0,wgt.jsx)(Rgt.Text,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push((0,wgt.jsx)(Rgt.Text,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&m{"use strict";p();Object.defineProperty(ege,"__esModule",{value:!0});ege.CompletionsContext=APi;ege.StableCompletionsContext=yPi;ege.AdditionalCompletionsContext=EPi;ege.isContextNode=qHa;function APi(t){return t.children}a(APi,"CompletionsContext");function yPi(t){return t.children}a(yPi,"StableCompletionsContext");function EPi(t){return t.children}a(EPi,"AdditionalCompletionsContext");function qHa(t){return t.name===APi.name||t.name===yPi.name||t.name===EPi.name}a(qHa,"isContextNode")});var FTr=I(JOe=>{"use strict";p();Object.defineProperty(JOe,"__esModule",{value:!0});JOe.SnapshotWalker=void 0;JOe.defaultTransformers=_Pi;var jHa=q8(),LTr=class{static{a(this,"SnapshotWalker")}constructor(e,r=_Pi()){this.snapshot=e,this.transformers=r}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};JOe.SnapshotWalker=LTr;function _Pi(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===jHa.Chunk.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(_Pi,"defaultTransformers")});var vPi=I(UTr=>{"use strict";p();Object.defineProperty(UTr,"__esModule",{value:!0});UTr.findEditDistanceScore=HHa;function HHa(t,e){if(t.length===0||e.length===0)return{score:t.length+e.length};let r=Array.from({length:t.length}).map(()=>Array.from({length:e.length}).map(()=>0));for(let n=0;n{"use strict";p();Object.defineProperty(oD,"__esModule",{value:!0});oD.MAX_EDIT_DISTANCE_LENGTH=void 0;oD.CurrentFile=WHa;oD.BeforeCursor=jTr;oD.AfterCursor=HTr;oD.DocumentPrefix=zHa;oD.DocumentSuffix=YHa;var fR=A4(),tge=q8(),GHa=uG(),$Ha=vPi(),VHa=Rme(),QTr=H8();oD.MAX_EDIT_DISTANCE_LENGTH=50;function qTr(t){let e=t*4,r=t*.1;return Math.floor(e+r)}a(qTr,"approximateMaxCharacters");function WHa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(QTr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=qTr(c);return(0,fR.jsxs)(fR.Fragment,{children:[(0,fR.jsx)(jTr,{document:r,position:o,maxCharacters:m}),(0,fR.jsx)(HTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(WHa,"CurrentFile");function jTr(t){if(t.document===void 0||t.position===void 0)return(0,fR.jsx)(tge.Text,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),(0,fR.jsx)(tge.Text,{children:e})}a(jTr,"BeforeCursor");function HTr(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return(0,fR.jsx)(tge.Text,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return(0,fR.jsx)(tge.Text,{});if(r===s)return(0,fR.jsx)(tge.Text,{children:r});let c=s;if(r!==""){let l=(0,VHa.getTokenizer)(t.tokenizer),u=l.takeFirstTokens(s,oD.MAX_EDIT_DISTANCE_LENGTH),d=l.takeFirstTokens(r,oD.MAX_EDIT_DISTANCE_LENGTH);u.tokens.length>0&&d.tokens.length>0&&u.tokens[0]===d.tokens[0]&&100*(0,$Ha.findEditDistanceScore)(u.tokens,d.tokens)?.score<(t.suffixMatchThreshold??GHa.DEFAULT_SUFFIX_MATCH_THRESHOLD)*u.tokens.length&&(c=r)}return c!==r&&n(c),(0,fR.jsx)(tge.Text,{children:c})}a(HTr,"AfterCursor");function zHa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(QTr.isCompletionRequestData,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=qTr(c);return(0,fR.jsx)(jTr,{document:r,position:o,maxCharacters:u})}a(zHa,"DocumentPrefix");function YHa(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(QTr.isCompletionRequestData,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=qTr(c);return(0,fR.jsx)(HTr,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(YHa,"DocumentSuffix")});var $Tr=I(Yte=>{"use strict";p();Object.defineProperty(Yte,"__esModule",{value:!0});Yte.WishlistElision=void 0;Yte.makePrompt=KHa;Yte.makePrefixPrompt=JHa;Yte.makeContextPrompt=ZHa;var GTr=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};Yte.WishlistElision=GTr;function KHa(t){return t.map(e=>e.elidedValue).join("")}a(KHa,"makePrompt");function JHa(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(JHa,"makePrefixPrompt");function ZHa(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(ZHa,"makeContextPrompt")});var zTr=I(DG=>{"use strict";p();Object.defineProperty(DG,"__esModule",{value:!0});DG.transformers=DG.CompletionsPromptRenderer=void 0;DG.normalizeLineEndings=WTr;var TPi=FTr(),CPi=LOe(),bPi=Rme(),XHa=KOe(),kgt=ZOe(),SPi=$Tr(),eGa=5,VTr=class{static{a(this,"CompletionsPromptRenderer")}constructor(){this.renderId=0,this.formatPrefix=SPi.makePrompt}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??bPi.TokenizerName.o200k,{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new SPi.WishlistElision,{blocks:[y,...E]}=A.elide(u,h,d,m,(0,bPi.getTokenizer)(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...tGa([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length===0||s===0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-eGa:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new TPi.SnapshotWalker(e,DG.transformers).walkSnapshot((f,h,m)=>{if(f===e||(f.name===kgt.CurrentFile.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:WTr(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:(0,CPi.isShebangLine)(f.value)?y=A:y=(0,CPi.commentBlockAsSingles)(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:WTr(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${kgt.CurrentFile.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}};DG.CompletionsPromptRenderer=VTr;DG.transformers=[...(0,TPi.defaultTransformers)(),(t,e,r)=>(0,XHa.isContextNode)(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===kgt.BeforeCursor.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===kgt.AfterCursor.name?{...r,type:"suffix"}:r];function tGa(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(tGa,"computeComponentStatistics");function WTr(t){return t.replace(/\r\n?/g,` +`)}a(WTr,"normalizeLineEndings")});var Dgt=I(rge=>{"use strict";p();Object.defineProperty(rge,"__esModule",{value:!0});rge.ILanguageContextProviderService=rge.ProviderTarget=void 0;var rGa=tn(),IPi;(function(t){t.NES="nes",t.Completions="completions"})(IPi||(rge.ProviderTarget=IPi={}));rge.ILanguageContextProviderService=(0,rGa.createServiceIdentifier)("ILanguageContextProviderService")});var Kte=I(nge=>{"use strict";p();Object.defineProperty(nge,"__esModule",{value:!0});nge.RuntimeMode=nge.ICompletionsRuntimeModeService=void 0;var nGa=tn();nge.ICompletionsRuntimeModeService=(0,nGa.createServiceIdentifier)("completionsRuntimeModeService");var YTr=class t{static{a(this,"RuntimeMode")}constructor(e){this.flags=e}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:xPi(r,n),verboseLogging:oGa(r,n),testMode:e,simulation:iGa(n)})}isRunningInTest(){return this.flags.testMode}shouldFailForDebugPurposes(){return this.isRunningInTest()}isDebugEnabled(){return this.flags.debug}isVerboseLoggingEnabled(){return this.flags.verboseLogging}isRunningInSimulation(){return this.flags.simulation}};nge.RuntimeMode=YTr;function xPi(t,e){return t.includes("--debug")||KTr(e,"DEBUG")}a(xPi,"determineDebugFlag");function iGa(t){return KTr(t,"SIMULATION")}a(iGa,"determineSimulationFlag");function oGa(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||KTr(e,"VERBOSE")||xPi(t,e)}a(oGa,"determineVerboseLoggingEnabled");function KTr(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(KTr,"determineEnvFlagEnabled")});var kPi=I(XOe=>{"use strict";p();Object.defineProperty(XOe,"__esModule",{value:!0});XOe.eventToPromise=sGa;XOe.isArrayOfT=PPi;XOe.resolveAll=cGa;var wPi=TOe();async function sGa(t){let e=new wPi.Deferred,r=t(n=>{e.resolve(n),r.dispose()});return e.promise}a(sGa,"eventToPromise");async function aGa(t){if(t.isCancellationRequested)return;let e=new wPi.Deferred,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(aGa,"cancellationTokenToPromise");async function RPi(t,e){if(e){let r=aGa(e);await Promise.race([t,r])}else await t}a(RPi,"raceCancellation");function PPi(t){return Array.isArray(t)}a(PPi,"isArrayOfT");async function cGa(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await lGa(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(cGa,"resolveAll");async function lGa(t,e){let r;return t instanceof Promise?r=await uGa(t,e):r=await dGa(t,e),r}a(lGa,"resolve");async function uGa(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:PPi(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await RPi(o,e),n.resolutionTime=performance.now()-r,n}a(uGa,"resolvePromise");async function dGa(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!=="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await RPi(o,e),n.resolutionTime=performance.now()-r,n}a(dGa,"resolveIterable")});var DPi=I(ZTr=>{"use strict";p();Object.defineProperty(ZTr,"__esModule",{value:!0});ZTr.fillInCppVSCodeActiveExperiments=mGa;var fGa=JA(),JTr=Tl(),pGa={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},hGa="ms-vscode.cpptools";function mGa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(hGa))&&gGa(t,r,n)}a(mGa,"fillInCppVSCodeActiveExperiments");function gGa(t,e,r){try{let n=t.get(fGa.ICompletionsFeaturesService),o=t.get(JTr.ICompletionsLogTargetService),s=pGa,c=n.cppContextProviderParams(r);if(c)try{s=JSON.parse(c)}catch(l){JTr.logger.error(o,"Failed to parse cppContextProviderParams",l)}else{let l=n.getContextProviderExpSettings("cpp")?.params;l&&(s={...l})}for(let[l,u]of Object.entries(s))e.set(l,u)}catch(n){JTr.logger.exception(t,n,"fillInCppActiveExperiments")}}a(gGa,"addActiveExperiments")});var MPi=I(XTr=>{"use strict";p();Object.defineProperty(XTr,"__esModule",{value:!0});XTr.fillInCSharpActiveExperiments=yGa;var AGa=JA(),NPi=Tl();function yGa(t,e,r){let n=t.get(AGa.ICompletionsFeaturesService),o=t.get(NPi.ICompletionsLogTargetService);try{let s=n.csharpContextProviderParams(r);if(s){let c=JSON.parse(s);for(let[l,u]of Object.entries(c))e.set(l,u)}else{let c=n.getContextProviderExpSettings("csharp")?.params;if(c)for(let[l,u]of Object.entries(c))e.set(l,u)}}catch(s){return NPi.logger.debug(o,"Failed to get the active C# experiments for the Context Provider API",s),!1}return!0}a(yGa,"fillInCSharpActiveExperiments")});var OPi=I(NG=>{"use strict";p();Object.defineProperty(NG,"__esModule",{value:!0});NG.multiLanguageContextProviderParamsDefault=void 0;NG.fillInMultiLanguageActiveExperiments=vGa;NG.getMultiLanguageContextProviderParamsFromActiveExperiments=SGa;var EGa=JA(),eIr=Tl(),_Ga="fallbackContextProvider";NG.multiLanguageContextProviderParamsDefault={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function vGa(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(_Ga))&&CGa(t,r,n)}a(vGa,"fillInMultiLanguageActiveExperiments");function CGa(t,e,r){try{let n=bGa(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){eIr.logger.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(CGa,"addActiveExperiments");function bGa(t,e){let r=NG.multiLanguageContextProviderParamsDefault,n=t.get(eIr.ICompletionsLogTargetService),s=t.get(EGa.ICompletionsFeaturesService).multiLanguageContextProviderParams(e);if(s)try{r=JSON.parse(s)}catch(c){eIr.logger.error(n,"Failed to parse multiLanguageContextProviderParams",c)}return r}a(bGa,"getMultiLanguageContextProviderParamsFromExp");function SGa(t){let e={...NG.multiLanguageContextProviderParamsDefault};return t.has("mlcpMaxContextItems")&&(e.mlcpMaxContextItems=Number(t.get("mlcpMaxContextItems"))),t.has("mlcpMaxSymbolMatches")&&(e.mlcpMaxSymbolMatches=Number(t.get("mlcpMaxSymbolMatches"))),t.has("mlcpEnableImports")&&(e.mlcpEnableImports=String(t.get("mlcpEnableImports"))==="true"),e}a(SGa,"getMultiLanguageContextProviderParamsFromActiveExperiments")});var LPi=I(ige=>{"use strict";p();Object.defineProperty(ige,"__esModule",{value:!0});ige.TS_CONTEXT_PROVIDER_ID=void 0;ige.fillInTsActiveExperiments=IGa;var TGa=JA(),BPi=Tl();ige.TS_CONTEXT_PROVIDER_ID="typescript-ai-context-provider";function IGa(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(ige.TS_CONTEXT_PROVIDER_ID)))return!1;let o=t.get(BPi.ICompletionsLogTargetService),s=t.get(TGa.ICompletionsFeaturesService);try{let c=s.tsContextProviderParams(n);if(c){let l=JSON.parse(c);for(let[u,d]of Object.entries(l))r.set(u,d)}else{let l=s.getContextProviderExpSettings("typescript")?.params;if(l)for(let[u,d]of Object.entries(l))r.set(u,d)}}catch(c){return BPi.logger.debug(o,"Failed to get the active TypeScript experiments for the Context Provider API",c),!1}return!0}a(IGa,"fillInTsActiveExperiments")});var Ogt=I(Il=>{"use strict";p();var oIr=Il&&Il.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sD=Il&&Il.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Il,"__esModule",{value:!0});Il.DefaultDiagnosticSettings=Il.CachedContextProviderRegistry=Il.MutableContextProviderRegistry=Il.CoreContextProviderRegistry=Il.DefaultContextProvidersContainer=Il.ICompletionsDefaultContextProviders=Il.ICompletionsContextProviderRegistryService=void 0;Il.telemetrizeContextItems=OGa;Il.matchContextItems=BGa;Il.useContextProviderAPI=FGa;Il.getDefaultDiagnosticSettings=QGa;var xGa=ei(),FPi=Sl(),sIr=Dgt(),wGa=_p(),qPi=tn(),RGa=bs(),aIr=Ms(),Ngt=_E(),jPi=JA(),PGa=O8(),G8=Tl(),cIr=Kte(),UPi=kPi(),kGa=DPi(),DGa=MPi(),NGa=OPi(),MGa=LPi(),QPi=YOe(),HPi=kG();Il.ICompletionsContextProviderRegistryService=(0,qPi.createServiceIdentifier)("ICompletionsContextProviderRegistryService");Il.ICompletionsDefaultContextProviders=(0,qPi.createServiceIdentifier)("ICompletionsDefaultContextProviders");var tIr=class{static{a(this,"DefaultContextProvidersContainer")}constructor(){this.ids=[]}add(e){this.ids.push(e)}getIds(){return this.ids}};Il.DefaultContextProvidersContainer=tIr;var Mgt=class{static{a(this,"CoreContextProviderRegistry")}constructor(e,r,n,o,s,c){this.match=e,this.registryService=r,this.runtimeMode=n,this.instantiationService=o,this.logTarget=s,this.contextProviderStatistics=c}registerContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}unregisterContextProvider(e){throw new Error("Should not be call. Use ILanguageContextProviderService")}get providers(){return this.registryService.getAllProviders([sIr.ProviderTarget.Completions]).slice()}async resolveAllProviders(e,r,n,o,s,c){if(s?.isCancellationRequested)return G8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];let l=new Map;this.instantiationService.invokeFunction(DGa.fillInCSharpActiveExperiments,l,o);let u=[],d=this.providers;if(d.length===0)return u;let f=await this.matchProviders(d,n,o),h=f.filter(w=>w[1]>0);if(f.filter(w=>w[1]<=0).forEach(([w,R])=>{let x={providerId:w.id,matchScore:R,resolution:"none",resolutionTimeMs:0,data:[]};u.push(x)}),h.length===0)return u;if(s?.isCancellationRequested)return G8.logger.debug(this.logTarget,"Resolving context providers cancelled"),[];this.instantiationService.invokeFunction(kGa.fillInCppVSCodeActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(NGa.fillInMultiLanguageActiveExperiments,h.map(w=>w[0].id),l,o),this.instantiationService.invokeFunction(MGa.fillInTsActiveExperiments,h.map(w=>w[0].id),l,o);let g=new xGa.CancellationTokenSource;if(s){let w=s.onCancellationRequested(R=>{g.cancel(),w.dispose()})}let A=this.runtimeMode.isDebugEnabled()&&!this.runtimeMode.isRunningInSimulation()?0:this.instantiationService.invokeFunction(UGa,n.languageId,o),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:e,opportunityId:r,documentContext:n,activeExperiments:l,timeBudget:A,timeoutEnd:y,data:c};for(let[w]of h){let R=this.contextProviderStatistics.getPreviousStatisticsForCompletion(e)?.get(w.id);R&&(v.previousUsageStatistics=R);let x=w.resolver.resolve(v,g.token);_.set(w.id,x)}let b=this.contextProviderStatistics.getStatisticsForCompletion(e);b.setOpportunityId(r);let T=await(0,UPi.resolveAll)(_,g.token);E&&clearTimeout(E);for(let[w,R]of h){let x=T.get(w.id);if(x){if(x.status==="error")(0,RGa.isCancellationError)(x.reason)||G8.logger.error(this.logTarget,`Error resolving context from ${w.id}: `,x.reason),u.push({providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:[]});else{let P=[...x.value??[]];if((x.status==="none"||x.status==="partial")&&(G8.logger.info(this.logTarget,`Context provider ${w.id} exceeded time budget of ${A}ms`),w.resolver.resolveOnTimeout))try{let j=w.resolver.resolveOnTimeout(v);(0,UPi.isArrayOfT)(j)?P.push(...j):j&&P.push(j),P.length>0&&(x.status="partial")}catch(j){G8.logger.error(this.logTarget,`Error in fallback logic for context provider ${w.id}: `,j)}let[D,N]=(0,QPi.filterSupportedContextItems)(P);N&&G8.logger.error(this.logTarget,`Dropped ${N} context items from ${w.id} due to invalid schema`);let B=this.instantiationService.invokeFunction(QPi.addOrValidateContextItemsIDs,D),L={providerId:w.id,matchScore:R,resolution:x.status,resolutionTimeMs:x.resolutionTime,data:B};u.push(L)}b.setLastResolution(w.id,x.status)}else G8.logger.error(this.logTarget,`Context provider ${w.id} not found in results`)}return u.sort((w,R)=>R.matchScore-w.matchScore)}async matchProviders(e,r,n){let o=this.instantiationService.invokeFunction(GPi,r.languageId,n),s=o.length===1&&o[0]==="*";return await Promise.all(e.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.instantiationService,l.selector,r);return[l,u]}))}};Il.CoreContextProviderRegistry=Mgt;Il.CoreContextProviderRegistry=Mgt=oIr([sD(1,sIr.ILanguageContextProviderService),sD(2,cIr.ICompletionsRuntimeModeService),sD(3,aIr.IInstantiationService),sD(4,G8.ICompletionsLogTargetService),sD(5,HPi.ICompletionsContextProviderService)],Mgt);var rIr=class extends Mgt{static{a(this,"MutableContextProviderRegistry")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,c),this._providers=[]}registerContextProvider(e){if(e.id.includes(",")||e.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${e.id} is invalid.`);if(this._providers.find(r=>r.id===e.id))throw new Error(`A context provider with id ${e.id} has already been registered`);this._providers.push(e)}unregisterContextProvider(e){this._providers=this._providers.filter(r=>r.id!==e)}get providers(){return this._providers.slice().concat(super.providers)}};Il.MutableContextProviderRegistry=rIr;Il.MutableContextProviderRegistry=rIr=oIr([sD(1,sIr.ILanguageContextProviderService),sD(2,cIr.ICompletionsRuntimeModeService),sD(3,aIr.IInstantiationService),sD(4,G8.ICompletionsLogTargetService),sD(5,HPi.ICompletionsContextProviderService)],rIr);var nIr=class{static{a(this,"CachedContextProviderRegistry")}constructor(e,r,n){this._cachedContextItems=new PGa.LRUCacheMap(5),this.delegate=n.createInstance(e,r)}registerContextProvider(e){this.delegate.registerContextProvider(e)}unregisterContextProvider(e){this.delegate.unregisterContextProvider(e)}get providers(){return this.delegate.providers}async resolveAllProviders(e,r,n,o,s,c){let l=this._cachedContextItems.get(e);if(e&&l&&l.length>0)return l;let u=await this.delegate.resolveAllProviders(e,r,n,o,s,c);return u.length>0&&e&&this._cachedContextItems.set(e,u),u}};Il.CachedContextProviderRegistry=nIr;Il.CachedContextProviderRegistry=nIr=oIr([sD(2,aIr.IInstantiationService)],nIr);function OGa(t,e,r){let n=t.getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(OGa,"telemetrizeContextItems");function BGa(t){return t.matchScore>0&&t.resolution!=="error"}a(BGa,"matchContextItems");function GPi(t,e,r){let n=LGa(t,e,r),o=(0,Ngt.getConfig)(t,Ngt.ConfigKey.ContextProviders)??[];if(n.length===1&&n[0]==="*"||o.length===1&&o[0]==="*")return["*"];let s=t.get(Il.ICompletionsDefaultContextProviders).getIds();return Array.from(new Set([...s,...n,...o]))}a(GPi,"getActiveContextProviders");function LGa(t,e,r){if(t.get(cIr.ICompletionsRuntimeModeService).isDebugEnabled())return["*"];let n=t.get(jPi.ICompletionsFeaturesService),o=n.contextProviders(r),s=n.getContextProviderExpSettings(e);if(s!==void 0)for(let c of s.ids)o.includes(c)||o.push(c);return o}a(LGa,"getExpContextProviders");function FGa(t,e,r){return GPi(t,e,r).length>0}a(FGa,"useContextProviderAPI");function UGa(t,e,r){let n=(0,Ngt.getConfig)(t,Ngt.ConfigKey.ContextProviderTimeBudget);return n!==void 0&&typeof n=="number"?n:t.get(jPi.ICompletionsFeaturesService).contextProviderTimeBudget(e,r)}a(UGa,"getContextProviderTimeBudget");var iIr;(function(t){function e(n){if(n)try{let o=JSON.parse(n);if(o.warnings===void 0&&o.maxDiagnostics===void 0&&o.maxLineDistance===void 0)return;let s=r(o),c=typeof o.maxLineDistance=="number"&&o.maxLineDistance>=0?o.maxLineDistance:10,l=typeof o.maxDiagnostics=="number"&&o.maxDiagnostics>0?o.maxDiagnostics:5;return{warnings:s,maxLineDistance:c,maxDiagnostics:l}}catch{return}}a(e,"from"),t.from=e;function r(n){let o=n?.warnings;return o==="yes"||o==="no"||o==="yesIfNoErrors"?o:"no"}a(r,"getWarnings")})(iIr||(Il.DefaultDiagnosticSettings=iIr={}));function QGa(t){let e=t.get(FPi.IConfigurationService),r=t.get(wGa.IExperimentationService),n=e.getExperimentBasedConfig(FPi.ConfigKey.TeamInternal.InlineCompletionsDefaultDiagnosticsOptions,r);if(typeof n=="string")return iIr.from(n)}a(QGa,"getDefaultDiagnosticSettings")});var Bgt=I(aD=>{"use strict";p();var qGa=aD&&aD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},jGa=aD&&aD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(aD,"__esModule",{value:!0});aD.ContextProviderBridge=aD.ICompletionsContextProviderBridgeService=void 0;var HGa=tn(),GGa=O8(),$Ga=Ogt();aD.ICompletionsContextProviderBridgeService=(0,HGa.createServiceIdentifier)("ICompletionsContextProviderBridgeService");var lIr=class{static{a(this,"ContextProviderBridge")}constructor(e){this.contextProviderRegistry=e,this.scheduledResolutions=new GGa.LRUCacheMap(25)}schedule(e,r,n,o,s,c){let{textDocument:l,originalPosition:u,originalOffset:d,originalVersion:f,editsWithPosition:h}=e,m=this.contextProviderRegistry.resolveAllProviders(r,n,{uri:l.uri,languageId:l.detectedLanguageId,version:f,offset:d,position:u,proposedEdits:h.length>0?h:void 0},o,s,c?.data);this.scheduledResolutions.set(r,m)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};aD.ContextProviderBridge=lIr;aD.ContextProviderBridge=lIr=qGa([jGa(0,$Ga.ICompletionsContextProviderRegistryService)],lIr)});var fIr=I(Lgt=>{"use strict";p();Object.defineProperty(Lgt,"__esModule",{value:!0});Lgt.Diagnostics=void 0;var uIr=A4(),VGa=Am(),dIr=q8(),WGa=uG(),zGa=H8();function YGa(t){if(t.code!==void 0){if(typeof t.code=="string")return t.code;if(typeof t.code=="number")return t.code.toString();if(typeof t.code=="object"&&t.code!==null&&t.code.value)return t.code.value.toString()}}a(YGa,"getCode");function KGa(t,e){return t.getRelativePath({uri:e.uri.toString()})??e.uri.path}a(KGa,"getRelativePath");var JGa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(),[u,d]=e.useState();if(e.useData(zGa.isCompletionRequestData,h=>{h.diagnostics!==r&&n(h.diagnostics);let m=(0,WGa.normalizeLanguageId)(h.document.detectedLanguageId);m!==o&&s(m),h.position!==c&&l(h.position),h.document.uri!==u?.uri&&d(h.document)}),!r||r.length===0||!o)return;let f=r.filter(h=>h.values.length>0);if(f.length!==0)return f.sort((h,m)=>(m.importance??0)-(h.importance??0)),f.reverse(),f.map(h=>{let m=[];m.push((0,uIr.jsx)(dIr.Text,{source:h,children:`Consider the following ${o} diagnostics from ${KGa(t.tdms,h)}:`},h.id));let g=h.values;return u!==void 0&&u.uri.toString()===h.uri.toString()&&c!==void 0&&(g=h.values.slice(),g.sort((A,y)=>{let E=Math.abs(A.range.start.line-c.line),_=Math.abs(y.range.start.line-c.line);return E-_})),g.forEach(A=>{let y="",E=YGa(A);E!==void 0&&(y=` ${A.source?A.source.toUpperCase():""}${E}`);let _=A.range.start;m.push((0,uIr.jsx)(dIr.Text,{children:`${_.line+1}:${_.character+1} - ${VGa.DiagnosticSeverity[A.severity].toLowerCase()}${y}: ${A.message}`}))}),(0,uIr.jsx)(dIr.Chunk,{children:m})})},"Diagnostics");Lgt.Diagnostics=JGa});var pIr=I(Ugt=>{"use strict";p();Object.defineProperty(Ugt,"__esModule",{value:!0});Ugt.DocumentMarker=void 0;var Fgt=A4(),$Pi=q8(),VPi=LOe(),ZGa=H8(),XGa=a((t,e)=>{let[r,n]=e.useState();if(e.useData(ZGa.isCompletionRequestData,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.tdms.getRelativePath(r),s={uri:r.uri,source:r.getText(),relativePath:o,languageId:r.detectedLanguageId},c=t.tdms.findNotebook(r);return s.relativePath&&!c?(0,Fgt.jsx)(e$a,{docInfo:s}):(0,Fgt.jsx)(t$a,{docInfo:s})}},"DocumentMarker");Ugt.DocumentMarker=XGa;var e$a=a(t=>(0,Fgt.jsx)($Pi.Text,{children:(0,VPi.getPathMarker)(t.docInfo)}),"PathMarker"),t$a=a(t=>(0,Fgt.jsx)($Pi.Text,{children:(0,VPi.getLanguageMarker)(t.docInfo)}),"LanguageMarker")});var hIr=I(e5e=>{"use strict";p();Object.defineProperty(e5e,"__esModule",{value:!0});e5e.RecentEdits=void 0;e5e.editIsTooCloseToCursor=YPi;var WPi=A4(),zPi=q8(),Qgt=LOe(),r$a=H8();function YPi(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(YPi,"editIsTooCloseToCursor");var n$a=a((t,e)=>{let[r,n]=e.useState();return e.useData(r$a.isCompletionRequestData,async o=>{if(!o.document)return;let s=t.recentEditsProvider;if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.tdms,f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(YPi(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift((0,Qgt.newLineEnded)(`File: ${T}`)+(0,Qgt.newLineEnded)(b))}}if(f.length===0){n(void 0);return}let h=(0,Qgt.newLineEnded)("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+(0,Qgt.newLineEnded)("End of recent edits");n(h)}),r?(0,WPi.jsx)(zPi.Chunk,{children:(0,WPi.jsx)(zPi.Text,{children:r})}):void 0},"RecentEdits");e5e.RecentEdits=n$a});var KPi=I(v4=>{"use strict";p();Object.defineProperty(v4,"__esModule",{value:!0});v4.registerDocumentTracker=v4.accessTimes=void 0;v4.sortByAccessTimes=s$a;var i$a=O8(),o$a=qb();v4.accessTimes=new i$a.LRUCacheMap;function s$a(t){return[...t].sort((e,r)=>{let n=v4.accessTimes.get(e.uri)??0;return(v4.accessTimes.get(r.uri)??0)-n})}a(s$a,"sortByAccessTimes");var a$a=a(t=>t.get(o$a.ICompletionsTextDocumentManagerService).onDidFocusTextDocument(e=>{e.document&&v4.accessTimes.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");v4.registerDocumentTracker=a$a});var JPi=I($8=>{"use strict";p();var c$a=$8&&$8.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},l$a=$8&&$8.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty($8,"__esModule",{value:!0});$8.OpenTabFiles=void 0;var u$a=KPi(),d$a=qb(),mIr=oge(),gIr=class{static{a(this,"OpenTabFiles")}constructor(e){this.docManager=e}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>mIr.NeighborSource.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&(0,mIr.considerNeighborFile)(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs((0,u$a.sortByAccessTimes)(await this.docManager.textDocuments()),e,r,n),s.set(mIr.NeighboringFileType.OpenTabs,Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};$8.OpenTabFiles=gIr;$8.OpenTabFiles=gIr=c$a([l$a(0,d$a.ICompletionsTextDocumentManagerService)],gIr)});var ZPi=I(AIr=>{"use strict";p();Object.defineProperty(AIr,"__esModule",{value:!0});AIr.shortCircuit=f$a;function f$a(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(f$a,"shortCircuit")});var Vgt=I(xl=>{"use strict";p();var p$a=xl&&xl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},qgt=xl&&xl.__param||function(t,e){return function(r,n){e(r,n,t)}},yIr;Object.defineProperty(xl,"__esModule",{value:!0});xl.RelatedFilesProvider=xl.ICompletionsRelatedFilesProviderService=xl.relatedFilesLogger=xl.PromiseExpirationCacheMap=xl.EmptyRelatedFilesResponse=void 0;xl.getRelatedFilesAndTraits=b$a;var h$a=kte(),m$a=tn(),g$a=Vu(),vIr=Ms(),A$a=pG(),y$a=O8(),$gt=Tl(),E$a=Ig(),_$a=ZPi();xl.EmptyRelatedFilesResponse={entries:[],traits:[]};var jgt={entries:new Map,traits:[]},Hgt=class extends y$a.LRUCacheMap{static{a(this,"PromiseExpirationCacheMap")}constructor(e,r=120*1e3){super(e),this.defaultEvictionTimeMs=r,this._cacheTimestamps=new Map}bumpRetryCount(e){let r=this._cacheTimestamps.get(e);return r?++r.retryCount:(this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),0)}has(e){return this.isValid(e)?super.has(e):(this.deleteExpiredEntry(e),!1)}get(e){let r=super.get(e);if(this.isValid(e))return r;this.deleteExpiredEntry(e)}set(e,r){let n=super.set(e,r);return this.isValid(e)||this._cacheTimestamps.set(e,{timestamp:Date.now(),retryCount:0}),n}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(e){let r=this._cacheTimestamps.get(e);return r!==void 0&&Date.now()-r.timestampxl.relatedFilesLogger.exception(o,n,"isContentExcluded"))}return!0}static dropBOM(e){return e.charCodeAt(0)===65279?e.slice(1):e}};xl.RelatedFilesProvider=EIr;xl.RelatedFilesProvider=EIr=yIr=p$a([qgt(0,vIr.IInstantiationService),qgt(1,h$a.IIgnoreService),qgt(2,$gt.ICompletionsLogTargetService),qgt(3,A$a.ICompletionsFileSystemService)],EIr);var C$a=3,t5e=new Hgt(v$a);async function XPi(t,e,r,n,o){let s=t.get(vIr.IInstantiationService),c=t.get($gt.ICompletionsLogTargetService),l=performance.now(),u;try{u=await o.getRelatedFiles(e,r,n)}catch(f){s.invokeFunction(h=>xl.relatedFilesLogger.exception(h,f,".getRelatedFiles")),u=void 0}u===void 0&&(t5e.bumpRetryCount(e.uri)>=C$a?u=jgt:u=void 0);let d=performance.now()-l;if(xl.relatedFilesLogger.debug(c,u!==void 0?`Fetched ${[...u.entries.values()].map(f=>f.size).reduce((f,h)=>f+h,0)} related files for '${e.uri}' in ${d}ms.`:`Failing fetching files for '${e.uri}' in ${d}ms.`),u===void 0)throw new Ggt;return u}a(XPi,"getRelatedFiles");var _Ir=a(function(t,e,r,n,o){let s=`${e.uri}`;if(t5e.has(s))return t5e.get(s);let c=XPi(t,e,r,n,o);return c instanceof Promise&&(c=c.catch(l=>{throw t5e.delete(s),l})),t5e.set(s,c),c},"getRelatedFilesWithCacheAndTimeout");_Ir=(0,_$a.shortCircuit)(_Ir,200,jgt);async function b$a(t,e,r,n,o,s=!1){let c=t.get(vIr.IInstantiationService),l=t.get($gt.ICompletionsLogTargetService),u=t.get(xl.ICompletionsRelatedFilesProviderService),d=jgt;try{let f={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};d=s?await c.invokeFunction(XPi,f,r,n,u):await c.invokeFunction(_Ir,f,r,n,u)}catch(f){d=jgt,f instanceof Ggt&&c.invokeFunction(E$a.telemetry,"getRelatedFilesList",r)}return xl.relatedFilesLogger.debug(l,d!=null?`Fetched following traits ${d.traits.map(f=>`{${f.name} : ${f.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),d}a(b$a,"getRelatedFilesAndTraits")});var oge=I(MG=>{"use strict";p();Object.defineProperty(MG,"__esModule",{value:!0});MG.NeighborSource=MG.NeighboringFileType=void 0;MG.considerNeighborFile=w$a;MG.isIncludeNeighborFilesActive=R$a;var S$a=Ms(),eki=uG(),rki=JA(),T$a=Tl(),I$a=qb(),x$a=JPi(),Wgt=Vgt(),tki;(function(t){t.None="none",t.OpenTabs="opentabs",t.CursorMostRecent="cursormostrecent",t.CursorMostCount="cursormostcount",t.WorkspaceSharingSameFolder="workspacesharingsamefolder",t.WorkspaceSmallestPathDist="workspacesmallestpathdist",t.OpenTabsAndCocommitted="opentabsandcocommitted",t.RelatedCSharp="related/csharp",t.RelatedCSharpRoslyn="related/csharproslyn",t.RelatedCpp="related/cpp",t.RelatedTypeScript="related/typescript",t.RelatedCppSemanticCodeContext="related/cppsemanticcodecontext",t.RelatedOther="related/other"})(tki||(MG.NeighboringFileType=tki={}));function w$a(t,e){return(0,eki.normalizeLanguageId)(t)===(0,eki.normalizeLanguageId)(e)}a(w$a,"considerNeighborFile");var CIr=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(rki.ICompletionsFeaturesService),d=e.get(T$a.ICompletionsLogTargetService),f=e.get(S$a.IInstantiationService),h=e.get(I$a.ICompletionsTextDocumentManagerService);t.instance===void 0&&(t.instance=f.createInstance(x$a.OpenTabFiles));let m={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(u.excludeRelatedFiles(n,o))return m;let g=await h.getTextDocument({uri:r});if(!g)return Wgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),m;let A=h.getWorkspaceFolder(g);if(!A)return Wgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),m;let y=await f.invokeFunction(Wgt.getRelatedFilesAndTraits,g,o,s,c,l);return y.entries.size===0?(Wgt.relatedFilesLogger.debug(d,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),m.traits.push(...y.traits),m):(y.entries.forEach((E,_)=>{let v=[];E.forEach((b,T)=>{let w=t.getRelativePath(T,A.uri);if(!w||m.docs.has(T))return;let R={relativePath:w,uri:T,source:b};v.unshift(R),m.docs.set(T,R)}),v.length>0&&m.neighborSource.set(_,v.map(b=>b.uri.toString()))}),m.traits.push(...y.traits),m)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};MG.NeighborSource=CIr;function R$a(t,e,r){return t.get(rki.ICompletionsFeaturesService).includeNeighboringFiles(e,r)}a(R$a,"isIncludeNeighborFilesActive")});var SIr=I(zgt=>{"use strict";p();Object.defineProperty(zgt,"__esModule",{value:!0});zgt.SimilarFiles=void 0;var sge=A4(),bIr=q8(),P$a=egt(),k$a=s1r(),D$a=rgt(),N$a=H8(),M$a=age(),nki=oge(),O$a=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(N$a.isCompletionRequestData,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=nki.NeighborSource.defaultEmptyResult();u.turnOffSimilarFiles||(d=await t.instantiationService.invokeFunction(async h=>await nki.NeighborSource.getNeighborFilesAndTraits(h,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data)));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=t.instantiationService.invokeFunction(M$a.getPromptOptions,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...(0,k$a.announceSnippet)(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||t.instantiationService.invokeFunction(D$a.getSimilarFilesOptions,d,f.detectedLanguageId),y=t.tdms.getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await(0,P$a.getSimilarSnippets)(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),(0,sge.jsxs)(sge.Fragment,{children:[...o.map((u,d)=>(0,sge.jsx)(B$a,{snippet:u}))]})},"SimilarFiles");zgt.SimilarFiles=O$a;var B$a=a((t,e)=>(0,sge.jsxs)(bIr.Chunk,{children:[(0,sge.jsx)(bIr.Text,{children:t.snippet.headline}),(0,sge.jsx)(bIr.Text,{children:t.snippet.snippet})]}),"SimilarFile")});var dki=I(DT=>{"use strict";p();Object.defineProperty(DT,"__esModule",{value:!0});DT.getAllRecentEditsByTimestamp=L$a;DT.findChangeSpan=TIr;DT.getDiff=oki;DT.unifiedDiff=ski;DT.findReplaceDiff=aki;DT.editsOverlap=cki;DT.updateEdits=lki;DT.buildIncomingEdit=IIr;DT.trimOldFilesFromState=uki;DT.recentEditsReducer=Q$a;DT.summarizeEdit=q$a;function L$a(t){return Object.values(t).flatMap(e=>e.edits).sort((e,r)=>e.timestamp-r.timestamp)}a(L$a,"getAllRecentEditsByTimestamp");function TIr(t,e){let r=0;for(;r=r&&o>=r&&t[n]===e[o];)n--,o--;return r>n&&r>o?null:{start:r,endPrev:n,endNew:o}}a(TIr,"findChangeSpan");function oki(t,e,r,n,o,s,c){let l=Math.max(0,n-c),u=Math.min(r.length,s+c+1);return{file:t,pre:l,post:u,before:e.slice(l,n),removed:e.slice(n,o+1),added:r.slice(n,s+1),after:r.slice(s+1,u)}}a(oki,"getDiff");function F$a(t){return[...t.before,...t.removed,...t.added,...t.after].reduce((r,n)=>r+n.length+1,0)}a(F$a,"measureDiffSize");function ski(t,e=!1,r=!1,n=!1){let o=[];o.push(`--- a/${t.file}`),o.push(`+++ b/${t.file}`);let s=t.before.length+t.removed.length+t.after.length,c=t.before.length+t.added.length+t.after.length;o.push(`@@ -${t.pre+1},${s} +${t.pre+1},${c} @@`);for(let l of t.before)o.push(" "+l);if(r)for(let l of t.added)o.push("+"+l);if(!e){let l=n?" --- IGNORE ---":"";for(let u of t.removed)o.push("-"+u+l)}if(!r)for(let l of t.added)o.push("+"+l);for(let l of t.after)o.push(" "+l);return o.join(` `)+` -`}a(Vki,"unifiedDiff");function hWa(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` -`)}a(hWa,"aidersDiff");function Wki(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` -`)}a(Wki,"findReplaceDiff");function Gki(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(Gki,"applyEditsToLines");function zki(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a(zki,"editsOverlap");function Yki(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(zki(r,c,o.editMergeLineDistance)){let u=Gki(t.split(` -`),s.slice(0,-1)),d=wIr(u,n);d&&(r=RIr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=Gki(t.split(` +`}a(ski,"unifiedDiff");function U$a(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=[];return c.push(">>>>>>> SEARCH"),c.push(...r),e?c.push("..."):c.push(...n),c.push(...s),c.push("======="),c.push(...r),c.push(...o),c.push(...s),c.push("<<<<<<<<< REPLACE"),c.join(` +`)}a(U$a,"aidersDiff");function aki(t,e=!1){let{before:r,removed:n,added:o,after:s}=t,c=e?["..."]:n.map(f=>`${f} --- DO NOT REPLY WITH CODE FROM THIS LINE ---`),l=[...r,...c,...s],u=[...r,...o,...s],d=[];return d.push("--- User edited code: ---"),d.push(...l),c.length===0?d.push(`--- and added ${o.length} line${o.length===1?"":"s"} to make: ---`):o.length===0?d.push(`--- and deleted ${c.length} line${c.length===1?"":"s"} to make: ---`):d.push("--- and replaced it with: ---"),d.push(...u),d.push("--- End of edit ---"),d.join(` +`)}a(aki,"findReplaceDiff");function iki(t,e){for(let r of e){let n=t.slice(0,r.startLine),o=t.slice(r.endLine+1),s=r.diff.added?r.diff.added:[];t=[...n,...s,...o]}return t}a(iki,"applyEditsToLines");function cki(t,e,r){let{added:n}=e.diff,o=e.startLine,s=e.startLine+n.length,c=t.startLine,l=t.endLine+1;return c<=s+r&&l>=o-r}a(cki,"editsOverlap");function lki(t,e,r,n,o){let s=[...e];if(s.length>0){let c=s[s.length-1];if(cki(r,c,o.editMergeLineDistance)){let u=iki(t.split(` +`),s.slice(0,-1)),d=TIr(u,n);d&&(r=IIr(r.file,u,n,d,o),s=[...s.slice(0,-1),r])}else s.push(r)}else s.push(r);if(s.length>o.maxEdits){let c=s.slice(0,s.length-o.maxEdits);s=s.slice(s.length-o.maxEdits,s.length),t=iki(t.split(` `),c).join(` -`)}return{originalContent:t,edits:s}}a(Yki,"updateEdits");function RIr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=$ki(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(RIr,"buildIncomingEdit");function Kki(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` +`)}return{originalContent:t,edits:s}}a(lki,"updateEdits");function IIr(t,e,r,n,o){let{start:s,endPrev:c,endNew:l}=n;if(!o||typeof o.diffContextLines!="number")throw new Error("Invalid configuration passed to buildIncomingEdit");let u=oki(t,e,r,s,c,l,o.diffContextLines);return{file:t,startLine:s,endLine:c,diff:u,timestamp:performance.now()}}a(IIr,"buildIncomingEdit");function uki(t,e){let r={...t},n=Object.entries(t).filter(([s])=>t[s].edits.length).sort(([s,c],[l,u])=>c.edits[c.edits.length-1].timestamp-u.edits[u.edits.length-1].timestamp),o=Math.max(0,n.length-e);if(o)for(let s=0;s2*1024*1024)return t;let o=t[e];if(!o)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};if(o.currentContent===r)return t;let s=o.currentContent.split(` `),c=r.split(` -`),l=wIr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=RIr(e,s,c,l,n);if(pWa(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=Yki(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return Kki(h,n.maxFiles)}a(mWa,"recentEditsReducer");function gWa(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=hWa(t.diff);else if(e.summarizationFormat==="diff")o=Vki(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=Wki(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(gWa,"summarizeEdit")});var tAt=I(dD=>{"use strict";p();var AWa=dD&&dD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yWa=dD&&dD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(dD,"__esModule",{value:!0});dD.FullRecentEditsProvider=dD.ICompletionsRecentEditsProviderService=void 0;var EWa=B5(),_Wa=rn(),CWa=ko(),vWa=HF(),bWa=Bvr(),kIr=Jki();dD.ICompletionsRecentEditsProviderService=(0,_Wa.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var SWa=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),PIr=class extends CWa.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},SWa)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,kIr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,kIr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,kIr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,vWa.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,EWa.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};dD.FullRecentEditsProvider=PIr;dD.FullRecentEditsProvider=PIr=AWa([yWa(1,bWa.ICompletionsObservableWorkspace)],PIr)});var DIr=I(nAt=>{"use strict";p();Object.defineProperty(nAt,"__esModule",{value:!0});nAt.Traits=void 0;var rAt=b4(),Zki=Y8(),TWa=yG(),IWa=J8(),xWa=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(IWa.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,TWa.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,rAt.jsxs)(rAt.Fragment,{children:[(0,rAt.jsx)(Zki.Text,{children:`Consider this related information: -`}),...r.map(c=>(0,rAt.jsx)(Zki.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");nAt.Traits=xWa});var tPi=I(NIr=>{"use strict";p();Object.defineProperty(NIr,"__esModule",{value:!0});NIr.splitContextCompletionsPrompt=LWa;var mR=b4(),wWa=Qs(),RWa=zb(),kWa=tAt(),PWa=UTr(),Xki=c5e(),ePi=u5e(),DWa=mIr(),NWa=gIr(),MWa=AIr(),OWa=xIr(),BWa=DIr();function LWa(t){let e=t.get(wWa.IInstantiationService),r=t.get(RWa.ICompletionsTextDocumentManagerService),n=t.get(kWa.ICompletionsRecentEditsProviderService);return(0,mR.jsxs)(mR.Fragment,{children:[(0,mR.jsxs)(Xki.StableCompletionsContext,{children:[(0,mR.jsx)(NWa.DocumentMarker,{tdms:r,weight:.7}),(0,mR.jsx)(BWa.Traits,{weight:.6}),(0,mR.jsx)(DWa.Diagnostics,{tdms:r,weight:.65}),(0,mR.jsx)(PWa.CodeSnippets,{tdms:r,weight:.9}),(0,mR.jsx)(OWa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,mR.jsx)(ePi.DocumentSuffix,{weight:1}),(0,mR.jsx)(Xki.AdditionalCompletionsContext,{children:(0,mR.jsx)(MWa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,mR.jsx)(ePi.DocumentPrefix,{weight:1})]})}a(LWa,"splitContextCompletionsPrompt")});var oPi=I(oAt=>{"use strict";p();Object.defineProperty(oAt,"__esModule",{value:!0});oAt.SplitContextPromptRenderer=void 0;var FWa=qTr(),UWa=c5e(),iAt=JTr(),rPi=u5e(),nPi=zTr(),iPi=0;function QWa(){iPi=0}a(QWa,"resetContextIndex");function qWa(){return iPi++}a(qWa,"getNextContextIndex");var MIr=class extends iAt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=nPi.makePrefixPrompt,this.formatContext=nPi.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(QWa(),new FWa.SnapshotWalker(e,jWa).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===rPi.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,iAt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,iAt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${rPi.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};oAt.SplitContextPromptRenderer=MIr;var jWa=[...iAt.transformers,(t,e,r)=>(0,UWa.isContextNode)(t)?{...r,index:qWa()}:r]});var $G=I(e6=>{"use strict";p();Object.defineProperty(e6,"__esModule",{value:!0});e6.AbstractLanguageDiagnosticsService=e6.ILanguageDiagnosticsService=void 0;e6.rangeSpanningDiagnostics=$Wa;e6.isError=VWa;e6.getDiagnosticsAtSelection=WWa;var HWa=rn(),GWa=xP(),OIr=mm();e6.ILanguageDiagnosticsService=(0,HWa.createServiceIdentifier)("ILanguageDiagnosticService");var BIr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,GWa.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};e6.AbstractLanguageDiagnosticsService=BIr;function $Wa(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a($Wa,"rangeSpanningDiagnostics");function VWa(t){return t.severity===OIr.DiagnosticSeverity.Error}a(VWa,"isError");function WWa(t,e,r=[OIr.DiagnosticSeverity.Error,OIr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(WWa,"getDiagnosticsAtSelection")});var aPi=I(LIr=>{"use strict";p();Object.defineProperty(LIr,"__esModule",{value:!0});LIr.getDiagnosticsFromContextItems=JWa;var zWa=zb(),sPi=qG(),YWa=a5e(),KWa="content_excluded";async function JWa(t,e,r){let n=(0,YWa.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)ZWa(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(sPi.ICompletionsContextProviderService),l=t.get(zWa.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,KWa]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(JWa,"getDiagnosticsFromContextItems");function ZWa(t,e,r,n){let o=t.get(sPi.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(ZWa,"setupExpectationsForDiagnosticBags")});var cPi=I(sAt=>{"use strict";p();Object.defineProperty(sAt,"__esModule",{value:!0});sAt.getTraitsFromContextItems=rza;sAt.ReportTraitsTelemetry=oza;var XWa=Tg(),eza=qG(),tza=a5e();function rza(t,e,r){let n=(0,tza.filterContextItemsByType)(r,"Trait");for(let s of n)nza(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(rza,"getTraitsFromContextItems");function nza(t,e,r,n){let o=t.get(eza.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(nza,"setupExpectationsForTraits");var iza=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function oza(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=iza.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,XWa.telemetry)(t,e,l)}}a(oza,"ReportTraitsTelemetry")});var J8=I(Xb=>{"use strict";p();var fPi=Xb&&Xb.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Zb=Xb&&Xb.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.TestComponentsCompletionsPromptFactory=Xb.ComponentsCompletionsPromptFactory=Xb.PromptOrdering=void 0;Xb.isCompletionRequestData=Sza;var w4=b4(),lPi=mm(),jIr=xl(),pPi=Bte(),FIr=Ku(),HIr=Qs(),hPi=See(),uPi=rki(),sza=Tg(),aza=zb(),cza=UTr(),lza=c5e(),uza=JTr(),mPi=jgt(),dza=u5e(),fza=mIr(),pza=gIr(),hza=AIr(),mza=xIr(),gza=tPi(),Aza=oPi(),yza=DIr(),gPi=$G(),Eza=um(),h5e=qgt(),_za=FTr(),Cza=aPi(),dPi=cPi(),GIr=qG(),fD=mge(),vza=tAt(),bza=pge();function Sza(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(Sza,"isCompletionRequestData");var VG;(function(t){t.Default="default",t.SplitContext="splitContext"})(VG||(Xb.PromptOrdering=VG={}));var UIr={[VG.Default]:{promptFunction:APi,renderer:uza.CompletionsPromptRenderer},[VG.SplitContext]:{promptFunction:gza.splitContextCompletionsPrompt,renderer:Aza.SplitContextPromptRenderer}};function APi(t){let e=t.get(aza.ICompletionsTextDocumentManagerService),r=t.get(HIr.IInstantiationService),n=t.get(vza.ICompletionsRecentEditsProviderService);return(0,w4.jsxs)(w4.Fragment,{children:[(0,w4.jsxs)(lza.CompletionsContext,{children:[(0,w4.jsx)(pza.DocumentMarker,{tdms:e,weight:.7}),(0,w4.jsx)(yza.Traits,{weight:.6}),(0,w4.jsx)(fza.Diagnostics,{tdms:e,weight:.65}),(0,w4.jsx)(cza.CodeSnippets,{tdms:e,weight:.9}),(0,w4.jsx)(mza.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,w4.jsx)(hza.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,w4.jsx)(dza.CurrentFile,{weight:1})]})}a(APi,"defaultCompletionsPrompt");var aAt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??VG.Default,this.virtualPrompt=e??new uPi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(fD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?VG.SplitContext:VG.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return fD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return fD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return fD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,fD.trimLastLine)(b.prefix),R={...b,prefix:T},x,k=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(h5e.useContextProviderAPI,k,n)){let N=(0,GIr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,h5e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),jIr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(h5e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(h5e.matchContextItems);this.instantiationService.invokeFunction(Tza,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(dPi.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(dPi.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction(_za.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(Cza.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(h5e.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return fD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(FIr.URI.parse(e.uri)))return fD._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,sza.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),fD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new uPi.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=UIr[this.promptOrdering]?.promptFunction??APi;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=UIr[this.promptOrdering]??UIr[VG.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(FIr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===lPi.DiagnosticSeverity.Error?d.push(_):_.severity===lPi.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:FIr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,Eza.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};aAt=fPi([Zb(2,HIr.IInstantiationService),Zb(3,hPi.ICompletionsTelemetryService),Zb(4,pPi.IIgnoreService),Zb(5,mPi.ICompletionsContextProviderBridgeService),Zb(6,jIr.ICompletionsLogTargetService),Zb(7,GIr.ICompletionsContextProviderService),Zb(8,gPi.ILanguageDiagnosticsService)],aAt);var QIr=class extends aAt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};Xb.ComponentsCompletionsPromptFactory=QIr;Xb.ComponentsCompletionsPromptFactory=QIr=fPi([Zb(0,HIr.IInstantiationService),Zb(1,hPi.ICompletionsTelemetryService),Zb(2,pPi.IIgnoreService),Zb(3,mPi.ICompletionsContextProviderBridgeService),Zb(4,jIr.ICompletionsLogTargetService),Zb(5,GIr.ICompletionsContextProviderService),Zb(6,gPi.ILanguageDiagnosticsService)],QIr);var qIr=class extends aAt{static{a(this,"TestComponentsCompletionsPromptFactory")}};Xb.TestComponentsCompletionsPromptFactory=qIr;function Tza(t,e,r,n){let o=["cpp","c"];return(0,bza.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(Tza,"similarFilesEnabled")});var KIr=I(RE=>{"use strict";p();var yPi=RE&&RE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},EPi=RE&&RE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(RE,"__esModule",{value:!0});RE.TestCompletionsPromptFactory=RE.CompletionsPromptFactory=RE.DEFAULT_PROMPT_TIMEOUT=RE.ICompletionsPromptFactoryService=void 0;var Iza=ti(),_Pi=Qs(),$Ir=mge(),xza=J8(),wza=rn();RE.ICompletionsPromptFactoryService=(0,wza.createServiceIdentifier)("ICompletionsPromptFactoryService");var VIr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return $Ir._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return $Ir._promptError}}};RE.DEFAULT_PROMPT_TIMEOUT=1200;var WIr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new Iza.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s($Ir._promptTimeout)},RE.DEFAULT_PROMPT_TIMEOUT)})])}},cAt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new VIr(new WIr(n.createInstance(xza.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};cAt=yPi([EPi(2,_Pi.IInstantiationService)],cAt);var zIr=class extends cAt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};RE.CompletionsPromptFactory=zIr;RE.CompletionsPromptFactory=zIr=yPi([EPi(0,_Pi.IInstantiationService)],zIr);var YIr=class extends cAt{static{a(this,"TestCompletionsPromptFactory")}};RE.TestCompletionsPromptFactory=YIr});var mge=I(nh=>{"use strict";p();Object.defineProperty(nh,"__esModule",{value:!0});nh.PromptResponse=nh._promptTimeout=nh._promptCancelled=nh._promptError=nh._copilotContentExclusion=nh._contextTooShort=nh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=nh.MIN_PROMPT_CHARS=void 0;nh.trimLastLine=Oza;nh.extractPrompt=Bza;nh.getPromptOptions=Uza;var Rza=YOe(),kza=VA(),CPi=cgt(),Pza=XOe(),Dza=zb(),Nza=KIr(),Mza=pge();nh.MIN_PROMPT_CHARS=10;nh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];nh._contextTooShort={type:"contextTooShort"};nh._copilotContentExclusion={type:"copilotContentExclusion"};nh._promptError={type:"promptError"};nh._promptCancelled={type:"promptCancelled"};nh._promptTimeout={type:"promptTimeout"};var vPi;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` +`),l=TIr(s,c);if(!l)return{...t,[e]:{...o,currentContent:r}};let u=IIr(e,s,c,l,n);if(F$a(u.diff)>n.maxCharsPerEdit)return{...t,[e]:{originalContent:r,currentContent:r,edits:[]}};let{originalContent:d,edits:f}=lki(o.originalContent,o.edits,u,c,n),h={...t,[e]:{originalContent:d,currentContent:r,edits:f}};return uki(h,n.maxFiles)}a(Q$a,"recentEditsReducer");function q$a(t,e){let r=t.diff.removed.filter(s=>s.trim().length>0),n=t.diff.added.filter(s=>s.trim().length>0),o;if(e.removeDeletedLines&&n.length===0)o=null;else if(r.length===0&&n.length===0)o=null;else if(r.join("").trim()===n.join("").trim())o=null;else if(t.diff.added.length>e.maxLinesPerEdit||t.diff.removed.length>e.maxLinesPerEdit)o=null;else if(e.summarizationFormat==="aiders-diff")o=U$a(t.diff);else if(e.summarizationFormat==="diff")o=ski(t.diff,e.removeDeletedLines,e.insertionsBeforeDeletions,e.appendNoReplyMarker);else if(e.summarizationFormat==="find-replace")o=aki(t.diff);else throw new Error(`Unknown summarization format: ${e.summarizationFormat}`);return o}a(q$a,"summarizeEdit")});var Ygt=I(cD=>{"use strict";p();var j$a=cD&&cD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},H$a=cD&&cD.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(cD,"__esModule",{value:!0});cD.FullRecentEditsProvider=cD.ICompletionsRecentEditsProviderService=void 0;var G$a=P5(),$$a=tn(),V$a=Io(),W$a=BF(),z$a=HCr(),xIr=dki();cD.ICompletionsRecentEditsProviderService=(0,$$a.createServiceIdentifier)("ICompletionsRecentEditsProviderService");var Y$a=Object.freeze({maxFiles:20,maxEdits:8,diffContextLines:3,editMergeLineDistance:1,maxCharsPerEdit:2e3,debounceTimeout:500,summarizationFormat:"diff",removeDeletedLines:!1,insertionsBeforeDeletions:!0,appendNoReplyMarker:!0,activeDocDistanceLimitFromCursor:100,maxLinesPerEdit:10}),wIr=class extends V$a.Disposable{static{a(this,"FullRecentEditsProvider")}constructor(e,r){super(),this.observableWorkspace=r,this._started=!1,this.recentEditMap={},this.recentEdits=[],this.recentEditSummaries=new WeakMap,this.debounceTimeouts={},this._config=e??Object.assign({},Y$a)}get config(){return this._config}isEnabled(){return!0}getRecentEdits(){return this.recentEdits}getEditSummary(e){return this.recentEditSummaries.get(e)??null}updateRecentEdits(e,r){this.recentEditMap=(0,xIr.recentEditsReducer)(this.recentEditMap,e,r,this._config),this.recentEdits=(0,xIr.getAllRecentEditsByTimestamp)(this.recentEditMap),this.recentEdits.forEach(n=>{if(!this.recentEditSummaries.has(n)){let o=(0,xIr.summarizeEdit)(n,this._config);this.recentEditSummaries.set(n,o)}})}start(){this._started||(this._started=!0,(0,W$a.mapObservableArrayCached)(this,this.observableWorkspace.openDocuments,(e,r)=>{r.add((0,G$a.autorunWithChanges)(this,{value:e.value,selection:e.selection,languageId:e.languageId},n=>{if(n.value.changes.length>0){let o=n.value.previous?.value,s=n.value.value.value,c=e.id.toString();clearTimeout(this.debounceTimeouts[c]),!this.recentEditMap[c]&&o?this.updateRecentEdits(c,o):this._config.debounceTimeout===0?this.updateRecentEdits(c,s):this.debounceTimeouts[c]=setTimeout(()=>{this.updateRecentEdits(c,s)},this._config.debounceTimeout??500)}}))},e=>e.id).recomputeInitiallyAndOnChange(this._store))}};cD.FullRecentEditsProvider=wIr;cD.FullRecentEditsProvider=wIr=j$a([H$a(1,z$a.ICompletionsObservableWorkspace)],wIr)});var RIr=I(Jgt=>{"use strict";p();Object.defineProperty(Jgt,"__esModule",{value:!0});Jgt.Traits=void 0;var Kgt=A4(),fki=q8(),K$a=uG(),J$a=H8(),Z$a=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(J$a.isCompletionRequestData,c=>{c.traits!==r&&n(c.traits);let l=(0,K$a.normalizeLanguageId)(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return(0,Kgt.jsxs)(Kgt.Fragment,{children:[(0,Kgt.jsx)(fki.Text,{children:`Consider this related information: +`}),...r.map(c=>(0,Kgt.jsx)(fki.Text,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");Jgt.Traits=Z$a});var mki=I(PIr=>{"use strict";p();Object.defineProperty(PIr,"__esModule",{value:!0});PIr.splitContextCompletionsPrompt=cVa;var pR=A4(),X$a=Ms(),eVa=qb(),tVa=Ygt(),rVa=BTr(),pki=KOe(),hki=ZOe(),nVa=fIr(),iVa=pIr(),oVa=hIr(),sVa=SIr(),aVa=RIr();function cVa(t){let e=t.get(X$a.IInstantiationService),r=t.get(eVa.ICompletionsTextDocumentManagerService),n=t.get(tVa.ICompletionsRecentEditsProviderService);return(0,pR.jsxs)(pR.Fragment,{children:[(0,pR.jsxs)(pki.StableCompletionsContext,{children:[(0,pR.jsx)(iVa.DocumentMarker,{tdms:r,weight:.7}),(0,pR.jsx)(aVa.Traits,{weight:.6}),(0,pR.jsx)(nVa.Diagnostics,{tdms:r,weight:.65}),(0,pR.jsx)(rVa.CodeSnippets,{tdms:r,weight:.9}),(0,pR.jsx)(sVa.SimilarFiles,{tdms:r,instantiationService:e,weight:.8})]}),(0,pR.jsx)(hki.DocumentSuffix,{weight:1}),(0,pR.jsx)(pki.AdditionalCompletionsContext,{children:(0,pR.jsx)(oVa.RecentEdits,{tdms:r,recentEditsProvider:n,weight:.99})}),(0,pR.jsx)(hki.DocumentPrefix,{weight:1})]})}a(cVa,"splitContextCompletionsPrompt")});var Eki=I(Xgt=>{"use strict";p();Object.defineProperty(Xgt,"__esModule",{value:!0});Xgt.SplitContextPromptRenderer=void 0;var lVa=FTr(),uVa=KOe(),Zgt=zTr(),gki=ZOe(),Aki=$Tr(),yki=0;function dVa(){yki=0}a(dVa,"resetContextIndex");function fVa(){return yki++}a(fVa,"getNextContextIndex");var kIr=class extends Zgt.CompletionsPromptRenderer{static{a(this,"SplitContextPromptRenderer")}constructor(){super(...arguments),this.formatPrefix=Aki.makePrefixPrompt,this.formatContext=Aki.makeContextPrompt}processSnapshot(e,r){let n=[],o=[],s=[],c=!1;if(dVa(),new lVa.SnapshotWalker(e,pVa).walkSnapshot((d,f,h)=>{if(d===e||(d.statistics.updateDataTimeMs&&d.statistics.updateDataTimeMs>0&&s.push({componentPath:d.path,updateDataTimeMs:d.statistics.updateDataTimeMs}),d.name===gki.BeforeCursor.name&&(c=!0),d.value===void 0||d.value===""))return!0;let m=h.chunks,g=h.type;if(g==="suffix")o.push({value:(0,Zgt.normalizeLineEndings)(d.value),type:"suffix",weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source});else{let A=g==="prefix",y=A||d.value.endsWith(r)?d.value:d.value+r;n.push({type:A?"prefix":"context",value:(0,Zgt.normalizeLineEndings)(y),weight:h.weight,componentPath:d.path,nodeStatistics:d.statistics,chunks:m,source:h.source,index:A?void 0:h.index})}return!0}),!c)throw new Error(`Node of type ${gki.BeforeCursor.name} not found`);if(o.length>1)throw new Error("Only one suffix is allowed");let u=o.length===1?o[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:n,suffixBlock:u,componentStatistics:s}}};Xgt.SplitContextPromptRenderer=kIr;var pVa=[...Zgt.transformers,(t,e,r)=>(0,uVa.isContextNode)(t)?{...r,index:fVa()}:r]});var OG=I(V8=>{"use strict";p();Object.defineProperty(V8,"__esModule",{value:!0});V8.AbstractLanguageDiagnosticsService=V8.ILanguageDiagnosticsService=void 0;V8.rangeSpanningDiagnostics=gVa;V8.isError=AVa;V8.getDiagnosticsAtSelection=yVa;var hVa=tn(),mVa=ak(),DIr=Am();V8.ILanguageDiagnosticsService=(0,hVa.createServiceIdentifier)("ILanguageDiagnosticService");var NIr=class{static{a(this,"AbstractLanguageDiagnosticsService")}waitForNewDiagnostics(e,r,n=5e3){let o,s,c;return new Promise(l=>{o=r.onCancellationRequested(()=>l([])),c=setTimeout(()=>l(this.getDiagnostics(e)),n),s=this.onDidChangeDiagnostics(u=>{for(let d of u.uris)if((0,mVa.isEqual)(d,e)){l(this.getDiagnostics(e));break}})}).finally(()=>{o.dispose(),s.dispose(),clearTimeout(c)})}};V8.AbstractLanguageDiagnosticsService=NIr;function gVa(t){return t.map(e=>e.range).reduce((e,r)=>e.union(r))}a(gVa,"rangeSpanningDiagnostics");function AVa(t){return t.severity===DIr.DiagnosticSeverity.Error}a(AVa,"isError");function yVa(t,e,r=[DIr.DiagnosticSeverity.Error,DIr.DiagnosticSeverity.Warning]){return t.find(n=>n.range.contains(e)&&r.includes(n.severity))}a(yVa,"getDiagnosticsAtSelection")});var vki=I(MIr=>{"use strict";p();Object.defineProperty(MIr,"__esModule",{value:!0});MIr.getDiagnosticsFromContextItems=CVa;var EVa=qb(),_ki=kG(),_Va=YOe(),vVa="content_excluded";async function CVa(t,e,r){let n=(0,_Va.filterContextItemsByType)(r,"DiagnosticBag");for(let h of n)bVa(t,e,h.data,h.providerId);let o=new Set,s=[];for(let h of n)for(let m of h.data)o.add(m.uri.toString()),s.push({providerId:h.providerId,bag:m});if(s.length===0)return[];let c=t.get(_ki.ICompletionsContextProviderService),l=t.get(EVa.ICompletionsTextDocumentManagerService),u=new Map;await Promise.all(Array.from(o).map(async h=>{u.set(h,await l.getTextDocumentValidation({uri:h}))}));let d=c.getStatisticsForCompletion(e);return s.filter(h=>{let m=u.get(h.bag.uri.toString())?.status==="valid";return m?d.addExpectations(h.providerId,[[h.bag,"included"]]):d.addExpectations(h.providerId,[[h.bag,vVa]]),m}).map(h=>h.bag).sort((h,m)=>(h.importance??0)-(m.importance??0))}a(CVa,"getDiagnosticsFromContextItems");function bVa(t,e,r,n){let o=t.get(_ki.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(bVa,"setupExpectationsForDiagnosticBags")});var Cki=I(eAt=>{"use strict";p();Object.defineProperty(eAt,"__esModule",{value:!0});eAt.getTraitsFromContextItems=xVa;eAt.ReportTraitsTelemetry=PVa;var SVa=Ig(),TVa=kG(),IVa=YOe();function xVa(t,e,r){let n=(0,IVa.filterContextItemsByType)(r,"Trait");for(let s of n)wVa(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(xVa,"getTraitsFromContextItems");function wVa(t,e,r,n){let o=t.get(TVa.ICompletionsContextProviderService).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(wVa,"setupExpectationsForTraits");var RVa=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function PVa(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=RVa.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return(0,SVa.telemetry)(t,e,l)}}a(PVa,"ReportTraitsTelemetry")});var H8=I(Vb=>{"use strict";p();var Iki=Vb&&Vb.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$b=Vb&&Vb.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Vb,"__esModule",{value:!0});Vb.TestComponentsCompletionsPromptFactory=Vb.ComponentsCompletionsPromptFactory=Vb.PromptOrdering=void 0;Vb.isCompletionRequestData=YVa;var C4=A4(),bki=Am(),UIr=Tl(),xki=kte(),OIr=Vu(),QIr=Ms(),wki=_ee(),Ski=gPi(),kVa=Ig(),DVa=qb(),NVa=BTr(),MVa=KOe(),OVa=zTr(),Rki=Bgt(),BVa=ZOe(),LVa=fIr(),FVa=pIr(),UVa=hIr(),QVa=SIr(),qVa=mki(),jVa=Eki(),HVa=RIr(),Pki=OG(),GVa=fm(),r5e=Ogt(),$Va=OTr(),VVa=vki(),Tki=Cki(),qIr=kG(),lD=age(),WVa=Ygt(),zVa=oge();function YVa(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(YVa,"isCompletionRequestData");var BG;(function(t){t.Default="default",t.SplitContext="splitContext"})(BG||(Vb.PromptOrdering=BG={}));var BIr={[BG.Default]:{promptFunction:kki,renderer:OVa.CompletionsPromptRenderer},[BG.SplitContext]:{promptFunction:qVa.splitContextCompletionsPrompt,renderer:jVa.SplitContextPromptRenderer}};function kki(t){let e=t.get(DVa.ICompletionsTextDocumentManagerService),r=t.get(QIr.IInstantiationService),n=t.get(WVa.ICompletionsRecentEditsProviderService);return(0,C4.jsxs)(C4.Fragment,{children:[(0,C4.jsxs)(MVa.CompletionsContext,{children:[(0,C4.jsx)(FVa.DocumentMarker,{tdms:e,weight:.7}),(0,C4.jsx)(HVa.Traits,{weight:.6}),(0,C4.jsx)(LVa.Diagnostics,{tdms:e,weight:.65}),(0,C4.jsx)(NVa.CodeSnippets,{tdms:e,weight:.9}),(0,C4.jsx)(QVa.SimilarFiles,{tdms:e,instantiationService:r,weight:.8}),(0,C4.jsx)(UVa.RecentEdits,{tdms:e,recentEditsProvider:n,weight:.99})]}),(0,C4.jsx)(BVa.CurrentFile,{weight:1})]})}a(kki,"defaultCompletionsPrompt");var tAt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l,u,d){this.instantiationService=n,this.completionsTelemetryService=o,this.ignoreService=s,this.contextProviderBridge=c,this.logTarget=l,this.contextProviderStatistics=u,this.languageDiagnosticsService=d,this.promptOrdering=r??BG.Default,this.virtualPrompt=e??new Ski.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=this.instantiationService.invokeFunction(lD.getPromptOptions,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?BG.SplitContext:BG.Default;this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,diagnostics:A,turnOffSimilarFiles:y,resolvedContextItems:E}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,A,n,y,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return lD._promptCancelled;let _=this.virtualPrompt.snapshot(s),v=_.status;if(v==="cancelled")return lD._promptCancelled;if(v==="error")return this.errorPrompt(_.error);let b=this.renderer.render(_.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(b.status==="cancelled")return lD._promptCancelled;if(b.status==="error")return this.errorPrompt(b.error);let[T,w]=(0,lD.trimLastLine)(b.prefix),R={...b,prefix:T},x,P=r.textDocument.detectedLanguageId;if(this.instantiationService.invokeFunction(r5e.useContextProviderAPI,P,n)){let N=(0,qIr.componentStatisticsToPromptMatcher)(b.metadata.componentStatistics);this.contextProviderStatistics.getStatisticsForCompletion(e).computeMatch(N),x=(0,r5e.telemetrizeContextItems)(this.contextProviderStatistics,e,E),UIr.logger.debug(this.logTarget,`Context providers telemetry: '${JSON.stringify(x)}'`)}let D=performance.now();return this.resetIfEmpty(b),this.successPrompt(R,D,h,w,x)}async updateComponentData(e,r,n,o,s,c,l,u,d,f={},h,m){let g=this.createRequestData(e,r,c,d,f,u,n,o,s,l,h,m);await this.pipe.pump(g)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d,f=!1;if(this.instantiationService.invokeFunction(r5e.useContextProviderAPI,r.textDocument.detectedLanguageId,n)){c=await this.contextProviderBridge.resolution(e);let{textDocument:m}=r,g=c.filter(r5e.matchContextItems);this.instantiationService.invokeFunction(KVa,m.detectedLanguageId,g,n)||(f=!0),l=await this.instantiationService.invokeFunction(Tki.getTraitsFromContextItems,e,g),this.instantiationService.invokeFunction(Tki.ReportTraitsTelemetry,"contextProvider.traits",l,m.detectedLanguageId,m.detectedLanguageId,n),u=await this.instantiationService.invokeFunction($Va.getCodeSnippetsFromContextItems,e,g,m.detectedLanguageId),d=await this.instantiationService.invokeFunction(VVa.getDiagnosticsFromContextItems,e,g)}let h=this.instantiationService.invokeFunction(r5e.getDefaultDiagnosticSettings);return d=this.addDefaultDiagnosticBag(c,d,e,r,h),{traits:l,codeSnippets:u,diagnostics:d,turnOffSimilarFiles:f,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return lD._promptCancelled;if(await this.ignoreService.isCopilotIgnored(OIr.URI.parse(e.uri)))return lD._copilotContentExclusion;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return(0,kVa.telemetryException)(this.completionsTelemetryService,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),lD._promptError}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new Ski.VirtualPrompt(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){let e=BIr[this.promptOrdering]?.promptFunction??kki;return this.instantiationService.invokeFunction(e)}getRenderer(){let e=BIr[this.promptOrdering]??BIr[BG.Default];return new e.renderer}addDefaultDiagnosticBag(e,r,n,o,s){if(s===void 0)return r;let c=o.textDocument;if(r!==void 0&&r.some(_=>_.uri.toString()===c.uri))return r;let l=performance.now(),u=this.languageDiagnosticsService.getDiagnostics(OIr.URI.parse(c.uri));if(u.length===0)return r;let d=[],f=[],h=s.warnings==="yes"||s.warnings==="yesIfNoErrors",m=o.position;for(let _ of u)Math.abs(_.range.start.line-m.line)<=s.maxLineDistance&&(_.severity===bki.DiagnosticSeverity.Error?d.push(_):_.severity===bki.DiagnosticSeverity.Warning&&h&&f.push(_));let g=[...d,...s.warnings==="yes"||s.warnings==="yesIfNoErrors"&&d.length===0?f:[]];if(g.length===0)return r;g.sort((_,v)=>{let b=Math.abs(_.range.start.line-m.line),T=Math.abs(v.range.start.line-m.line);return b-T});let A={type:"DiagnosticBag",uri:OIr.URI.parse(c.uri),values:g.slice(0,s.maxDiagnostics),id:(0,GVa.generateUuid)()},y="copilot.chat.defaultDiagnostics",E=this.contextProviderStatistics.getStatisticsForCompletion(n);return E.addExpectations(y,[[A,"included"]]),e.push({providerId:y,matchScore:10,resolution:"full",resolutionTimeMs:performance.now()-l,data:[A]}),E.setLastResolution(y,"full"),r===void 0?[A]:(r.push(A),r)}};tAt=Iki([$b(2,QIr.IInstantiationService),$b(3,wki.ICompletionsTelemetryService),$b(4,xki.IIgnoreService),$b(5,Rki.ICompletionsContextProviderBridgeService),$b(6,UIr.ICompletionsLogTargetService),$b(7,qIr.ICompletionsContextProviderService),$b(8,Pki.ILanguageDiagnosticsService)],tAt);var LIr=class extends tAt{static{a(this,"ComponentsCompletionsPromptFactory")}constructor(e,r,n,o,s,c,l){super(void 0,void 0,e,r,n,o,s,c,l)}};Vb.ComponentsCompletionsPromptFactory=LIr;Vb.ComponentsCompletionsPromptFactory=LIr=Iki([$b(0,QIr.IInstantiationService),$b(1,wki.ICompletionsTelemetryService),$b(2,xki.IIgnoreService),$b(3,Rki.ICompletionsContextProviderBridgeService),$b(4,UIr.ICompletionsLogTargetService),$b(5,qIr.ICompletionsContextProviderService),$b(6,Pki.ILanguageDiagnosticsService)],LIr);var FIr=class extends tAt{static{a(this,"TestComponentsCompletionsPromptFactory")}};Vb.TestComponentsCompletionsPromptFactory=FIr;function KVa(t,e,r,n){let o=["cpp","c"];return(0,zVa.isIncludeNeighborFilesActive)(t,e,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(KVa,"similarFilesEnabled")});var WIr=I(IE=>{"use strict";p();var Dki=IE&&IE.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Nki=IE&&IE.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(IE,"__esModule",{value:!0});IE.TestCompletionsPromptFactory=IE.CompletionsPromptFactory=IE.DEFAULT_PROMPT_TIMEOUT=IE.ICompletionsPromptFactoryService=void 0;var JVa=ei(),Mki=Ms(),jIr=age(),ZVa=H8(),XVa=tn();IE.ICompletionsPromptFactoryService=(0,XVa.createServiceIdentifier)("ICompletionsPromptFactoryService");var HIr=class{static{a(this,"SequentialCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){return this.lastPromise=this.promptAsync(e,r),this.lastPromise}async promptAsync(e,r){if(await this.lastPromise,r?.isCancellationRequested)return jIr._promptCancelled;try{return await this.delegate.prompt(e,r)}catch{return jIr._promptError}}};IE.DEFAULT_PROMPT_TIMEOUT=1200;var GIr=class{static{a(this,"TimeoutHandlingCompletionsPromptFactory")}constructor(e){this.delegate=e}async prompt(e,r){let n=new JVa.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(jIr._promptTimeout)},IE.DEFAULT_PROMPT_TIMEOUT)})])}},rAt=class{static{a(this,"BaseComponentsCompletionsPromptFactory")}constructor(e,r,n){this.delegate=new HIr(new GIr(n.createInstance(ZVa.TestComponentsCompletionsPromptFactory,e,r)))}prompt(e,r){return this.delegate.prompt(e,r)}};rAt=Dki([Nki(2,Mki.IInstantiationService)],rAt);var $Ir=class extends rAt{static{a(this,"CompletionsPromptFactory")}constructor(e){super(void 0,void 0,e)}};IE.CompletionsPromptFactory=$Ir;IE.CompletionsPromptFactory=$Ir=Dki([Nki(0,Mki.IInstantiationService)],$Ir);var VIr=class extends rAt{static{a(this,"TestCompletionsPromptFactory")}};IE.TestCompletionsPromptFactory=VIr});var age=I(sh=>{"use strict";p();Object.defineProperty(sh,"__esModule",{value:!0});sh.PromptResponse=sh._promptTimeout=sh._promptCancelled=sh._promptError=sh._copilotContentExclusion=sh._contextTooShort=sh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=sh.MIN_PROMPT_CHARS=void 0;sh.trimLastLine=sWa;sh.extractPrompt=aWa;sh.getPromptOptions=uWa;var eWa=LOe(),tWa=JA(),Oki=rgt(),rWa=qOe(),nWa=qb(),iWa=WIr(),oWa=oge();sh.MIN_PROMPT_CHARS=10;sh.MIN_PROMPT_EXCLUDED_LANGUAGE_IDS=["scminput"];sh._contextTooShort={type:"contextTooShort"};sh._copilotContentExclusion={type:"copilotContentExclusion"};sh._promptError={type:"promptError"};sh._promptCancelled={type:"promptCancelled"};sh._promptTimeout={type:"promptTimeout"};var Bki;(function(t){function e(r){return r.type==="prompt"?[{header:"PREFIX",content:r.prompt.prefix},{header:"SUFFIX",content:r.prompt.suffix},{header:"CONTEXT",content:(r.prompt.context||[]).join(` --- `)},{header:"FIM",content:"Is Fim enabled: "+r.prompt.isFimEnabled},{header:"TOKENS",content:`Prefix tokens: ${r.prompt.prefixTokens} Suffix tokens: ${r.prompt.suffixTokens}`},{header:"NEIGHBORS",content:Array.from(r.neighborSource.entries()).map(([n,o])=>`neighboring file type: ${n} @@ -1050,14 +1004,14 @@ ${o.join(", ")}`).join(` --- ${n.content} ---------------`).join(` -`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(vPi||(nh.PromptResponse=vPi={}));function Oza(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(Oza,"trimLastLine");function Bza(t,e,r,n,o,s={}){let l=t.get(Dza.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=Fza(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(Nza.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(Bza,"extractPrompt");function Lza(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,Rza.commentBlockAsSingles)(n,e)}a(Lza,"addNeighboringCellsToPrompt");function Fza(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>Lza(l,r.document.detectedLanguageId)).join(` +`):JSON.stringify(r,null," ")}a(e,"toString"),t.toString=e})(Bki||(sh.PromptResponse=Bki={}));function sWa(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length===n?o:t,s]}a(sWa,"trimLastLine");function aWa(t,e,r,n,o,s={}){let l=t.get(nWa.ICompletionsTextDocumentManagerService).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);return l&&u&&(r=lWa(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys(),t.get(iWa.ICompletionsPromptFactoryService).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:!0}},o)}a(aWa,"extractPrompt");function cWa(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:(0,eWa.commentBlockAsSingles)(n,e)}a(cWa,"addNeighboringCellsToPrompt");function lWa(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>cWa(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(Fza,"applyEditsForNotebook");function Uza(t,e,r){let n=t.get(kza.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,Pza.getMaxSolutionTokens)(),c=(0,CPi.getNumberOfSnippets)(e,r),l=(0,CPi.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(Uza,"getPromptOptions")});var TPi=I(WG=>{"use strict";p();Object.defineProperty(WG,"__esModule",{value:!0});WG.TypeSystem=WG.TypeSystemDuplicateFormat=WG.TypeSystemDuplicateTypeKind=void 0;var lAt=Ame(),Qza=bOe(),qza=_n(),SPi=bf(),uAt=class extends SPi.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};WG.TypeSystemDuplicateTypeKind=uAt;var dAt=class extends SPi.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};WG.TypeSystemDuplicateFormat=dAt;var bPi;(function(t){function e(n,o){if(lAt.TypeRegistry.Has(n))throw new uAt(n);return lAt.TypeRegistry.Set(n,o),(s={})=>(0,Qza.Unsafe)({...s,[qza.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(lAt.FormatRegistry.Has(n))throw new dAt(n);return lAt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(bPi||(WG.TypeSystem=bPi={}))});var JIr=I(zG=>{"use strict";p();var jza=zG&&zG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IPi=zG&&zG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jza(e,t,r)};Object.defineProperty(zG,"__esModule",{value:!0});IPi($Me(),zG);IPi(TPi(),zG)});var ZIr=I(m5e=>{"use strict";p();Object.defineProperty(m5e,"__esModule",{value:!0});m5e.DefaultErrorFunction=xPi;m5e.SetErrorFunction=Gza;m5e.GetErrorFunction=$za;var Hza=_n(),Un=XIr();function xPi(t){switch(t.errorType){case Un.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case Un.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Un.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Un.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Un.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Un.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case Un.ValueErrorType.Array:return"Expected array";case Un.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case Un.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.BigInt:return"Expected bigint";case Un.ValueErrorType.Boolean:return"Expected boolean";case Un.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Un.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Un.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Un.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Un.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Un.ValueErrorType.Date:return"Expected Date";case Un.ValueErrorType.Function:return"Expected function";case Un.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Integer:return"Expected integer";case Un.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case Un.ValueErrorType.Intersect:return"Expected all values to match";case Un.ValueErrorType.Iterator:return"Expected Iterator";case Un.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Un.ValueErrorType.Never:return"Never";case Un.ValueErrorType.Not:return"Value should not match";case Un.ValueErrorType.Null:return"Expected null";case Un.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Un.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Un.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Un.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Un.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Un.ValueErrorType.Number:return"Expected number";case Un.ValueErrorType.Object:return"Expected object";case Un.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case Un.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Un.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Un.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case Un.ValueErrorType.Promise:return"Expected Promise";case Un.ValueErrorType.RegExp:return"Expected string to match regular expression";case Un.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Un.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Un.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Un.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Un.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Un.ValueErrorType.String:return"Expected string";case Un.ValueErrorType.Symbol:return"Expected symbol";case Un.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Un.ValueErrorType.Tuple:return"Expected tuple";case Un.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Un.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Un.ValueErrorType.Uint8Array:return"Expected Uint8Array";case Un.ValueErrorType.Undefined:return"Expected undefined";case Un.ValueErrorType.Union:return"Expected union value";case Un.ValueErrorType.Void:return"Expected void";case Un.ValueErrorType.Kind:return`Expected kind '${t.schema[Hza.Kind]}'`;default:return"Unknown error type"}}a(xPi,"DefaultErrorFunction");var wPi=xPi;function Gza(t){wPi=t}a(Gza,"SetErrorFunction");function $za(){return wPi}a($za,"GetErrorFunction")});var PPi=I(gge=>{"use strict";p();Object.defineProperty(gge,"__esModule",{value:!0});gge.TypeDereferenceError=void 0;gge.Pushref=Yza;gge.Deref=kPi;var Vza=bf(),RPi=_n(),Wza=p0t(),fAt=class extends Vza.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};gge.TypeDereferenceError=fAt;function zza(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new fAt(t);return kPi(r,e)}a(zza,"Resolve");function Yza(t,e){return!(0,Wza.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Yza,"Pushref");function kPi(t,e){return t[RPi.Kind]==="This"||t[RPi.Kind]==="Ref"?zza(t,e):t}a(kPi,"Deref")});var pD=I(rre=>{"use strict";p();var Kza=rre&&rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Jza=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kza(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});Jza(PPi(),rre)});var OPi=I(g5e=>{"use strict";p();Object.defineProperty(g5e,"__esModule",{value:!0});g5e.ValueHashError=void 0;g5e.Hash=hYa;var hD=pm(),Zza=bf(),pAt=class extends Zza.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};g5e.ValueHashError=pAt;var LT;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(LT||(LT={}));var Age=BigInt("14695981039346656037"),[Xza,eYa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],tYa=Array.from({length:256}).map((t,e)=>BigInt(e)),DPi=new Float64Array(1),NPi=new DataView(DPi.buffer),MPi=new Uint8Array(DPi.buffer);function*rYa(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(rYa,"NumberToBytes");function nYa(t){kE(LT.Array);for(let e of t)yge(e)}a(nYa,"ArrayType");function iYa(t){kE(LT.Boolean),kE(t?1:0)}a(iYa,"BooleanType");function oYa(t){kE(LT.BigInt),NPi.setBigInt64(0,t);for(let e of MPi)kE(e)}a(oYa,"BigIntType");function sYa(t){kE(LT.Date),yge(t.getTime())}a(sYa,"DateType");function aYa(t){kE(LT.Null)}a(aYa,"NullType");function cYa(t){kE(LT.Number),NPi.setFloat64(0,t);for(let e of MPi)kE(e)}a(cYa,"NumberType");function lYa(t){kE(LT.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())yge(e),yge(t[e])}a(lYa,"ObjectType");function uYa(t){kE(LT.String);for(let e=0;e{"use strict";p();var mYa=nre&&nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),gYa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mYa(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});gYa(OPi(),nre)});var txr=I(_5e=>{"use strict";p();Object.defineProperty(_5e,"__esModule",{value:!0});_5e.ValueCheckUnknownTypeError=void 0;_5e.Check=nKa;var y5e=JIr(),exr=pD(),AYa=A5e(),Ege=_n(),BPi=q2(),yYa=dte(),E5e=Ame(),EYa=bf(),_Ya=d0(),m0=pm(),CYa=gs(),hAt=class extends EYa.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};_5e.ValueCheckUnknownTypeError=hAt;function vYa(t){return t[Ege.Kind]==="Any"||t[Ege.Kind]==="Unknown"}a(vYa,"IsAnyOrUnknown");function ea(t){return t!==void 0}a(ea,"IsDefined");function bYa(t,e,r){return!0}a(bYa,"FromAny");function SYa(t,e,r){return!0}a(SYa,"FromArgument");function TYa(t,e,r){if(!(0,m0.IsArray)(r)||ea(t.minItems)&&!(r.length>=t.minItems)||ea(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Dg(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,AYa.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(ea(t.contains)||(0,m0.IsNumber)(t.minContains)||(0,m0.IsNumber)(t.maxContains)))return!0;let n=ea(t.contains)?t.contains:(0,_Ya.Never)(),o=r.reduce((s,c)=>Dg(n,e,c)?s+1:s,0);return!(o===0||(0,m0.IsNumber)(t.minContains)&&ot.maxContains)}a(TYa,"FromArray");function IYa(t,e,r){return(0,m0.IsAsyncIterator)(r)}a(IYa,"FromAsyncIterator");function xYa(t,e,r){return!(!(0,m0.IsBigInt)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(xYa,"FromBigInt");function wYa(t,e,r){return(0,m0.IsBoolean)(r)}a(wYa,"FromBoolean");function RYa(t,e,r){return Dg(t.returns,e,r.prototype)}a(RYa,"FromConstructor");function kYa(t,e,r){return!(!(0,m0.IsDate)(r)||ea(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||ea(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||ea(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||ea(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(kYa,"FromDate");function PYa(t,e,r){return(0,m0.IsFunction)(r)}a(PYa,"FromFunction");function DYa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Dg(o,[...e,...n],r)}a(DYa,"FromImport");function NYa(t,e,r){return!(!(0,m0.IsInteger)(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(NYa,"FromInteger");function MYa(t,e,r){let n=t.allOf.every(o=>Dg(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,BPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,CYa.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,BPi.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Dg(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(MYa,"FromIntersect");function OYa(t,e,r){return(0,m0.IsIterator)(r)}a(OYa,"FromIterator");function BYa(t,e,r){return r===t.const}a(BYa,"FromLiteral");function LYa(t,e,r){return!1}a(LYa,"FromNever");function FYa(t,e,r){return!Dg(t.not,e,r)}a(FYa,"FromNot");function UYa(t,e,r){return(0,m0.IsNull)(r)}a(UYa,"FromNull");function QYa(t,e,r){return!(!y5e.TypeSystemPolicy.IsNumberLike(r)||ea(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||ea(t.minimum)&&!(r>=t.minimum)||ea(t.maximum)&&!(r<=t.maximum)||ea(t.multipleOf)&&r%t.multipleOf!==0)}a(QYa,"FromNumber");function qYa(t,e,r){if(!y5e.TypeSystemPolicy.IsObjectLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Dg(s,e,r[o])||((0,yYa.ExtendsUndefinedCheck)(s)||vYa(s))&&!(o in r))return!1}else if(y5e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Dg(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Dg(t.additionalProperties,e,r[s])):!0}a(qYa,"FromObject");function jYa(t,e,r){return(0,m0.IsPromise)(r)}a(jYa,"FromPromise");function HYa(t,e,r){if(!y5e.TypeSystemPolicy.IsRecordLike(r)||ea(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||ea(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Dg(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Dg(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(HYa,"FromRecord");function GYa(t,e,r){return Dg((0,exr.Deref)(t,e),e,r)}a(GYa,"FromRef");function $Ya(t,e,r){let n=new RegExp(t.source,t.flags);return ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a($Ya,"FromRegExp");function VYa(t,e,r){return!(0,m0.IsString)(r)||ea(t.minLength)&&!(r.length>=t.minLength)||ea(t.maxLength)&&!(r.length<=t.maxLength)||ea(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:ea(t.format)?E5e.FormatRegistry.Has(t.format)?E5e.FormatRegistry.Get(t.format)(r):!1:!0}a(VYa,"FromString");function WYa(t,e,r){return(0,m0.IsSymbol)(r)}a(WYa,"FromSymbol");function zYa(t,e,r){return(0,m0.IsString)(r)&&new RegExp(t.pattern).test(r)}a(zYa,"FromTemplateLiteral");function YYa(t,e,r){return Dg((0,exr.Deref)(t,e),e,r)}a(YYa,"FromThis");function KYa(t,e,r){if(!(0,m0.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nDg(n,e,r))}a(ZYa,"FromUnion");function XYa(t,e,r){return!(!(0,m0.IsUint8Array)(r)||ea(t.maxByteLength)&&!(r.length<=t.maxByteLength)||ea(t.minByteLength)&&!(r.length>=t.minByteLength))}a(XYa,"FromUint8Array");function eKa(t,e,r){return!0}a(eKa,"FromUnknown");function tKa(t,e,r){return y5e.TypeSystemPolicy.IsVoidLike(r)}a(tKa,"FromVoid");function rKa(t,e,r){return E5e.TypeRegistry.Has(t[Ege.Kind])?E5e.TypeRegistry.Get(t[Ege.Kind])(t,r):!1}a(rKa,"FromKind");function Dg(t,e,r){let n=ea(t.$id)?(0,exr.Pushref)(t,e):e,o=t;switch(o[Ege.Kind]){case"Any":return bYa(o,n,r);case"Argument":return SYa(o,n,r);case"Array":return TYa(o,n,r);case"AsyncIterator":return IYa(o,n,r);case"BigInt":return xYa(o,n,r);case"Boolean":return wYa(o,n,r);case"Constructor":return RYa(o,n,r);case"Date":return kYa(o,n,r);case"Function":return PYa(o,n,r);case"Import":return DYa(o,n,r);case"Integer":return NYa(o,n,r);case"Intersect":return MYa(o,n,r);case"Iterator":return OYa(o,n,r);case"Literal":return BYa(o,n,r);case"Never":return LYa(o,n,r);case"Not":return FYa(o,n,r);case"Null":return UYa(o,n,r);case"Number":return QYa(o,n,r);case"Object":return qYa(o,n,r);case"Promise":return jYa(o,n,r);case"Record":return HYa(o,n,r);case"Ref":return GYa(o,n,r);case"RegExp":return $Ya(o,n,r);case"String":return VYa(o,n,r);case"Symbol":return WYa(o,n,r);case"TemplateLiteral":return zYa(o,n,r);case"This":return YYa(o,n,r);case"Tuple":return KYa(o,n,r);case"Undefined":return JYa(o,n,r);case"Union":return ZYa(o,n,r);case"Uint8Array":return XYa(o,n,r);case"Unknown":return eKa(o,n,r);case"Void":return tKa(o,n,r);default:if(!E5e.TypeRegistry.Has(o[Ege.Kind]))throw new hAt(o);return rKa(o,n,r)}}a(Dg,"Visit");function nKa(...t){return t.length===3?Dg(t[0],t[1],t[2]):Dg(t[0],[],t[1])}a(nKa,"Check")});var FT=I(ire=>{"use strict";p();var iKa=ire&&ire.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oKa=ire&&ire.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iKa(e,t,r)};Object.defineProperty(ire,"__esModule",{value:!0});oKa(txr(),ire)});var XIr=I(r6=>{"use strict";p();Object.defineProperty(r6,"__esModule",{value:!0});r6.ValueErrorIterator=r6.ValueErrorsUnknownTypeError=r6.ValueErrorType=void 0;r6.Errors=VKa;var C5e=JIr(),LPi=q2(),mAt=Ame(),sKa=bCr(),aKa=ZIr(),cKa=bf(),FPi=pD(),lKa=A5e(),uKa=FT(),rxr=_n(),dKa=d0(),ih=pm(),en;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(en||(r6.ValueErrorType=en={}));var gAt=class extends cKa.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};r6.ValueErrorsUnknownTypeError=gAt;function t6(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(t6,"EscapeKey");function ta(t){return t!==void 0}a(ta,"IsDefined");var v5e=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};r6.ValueErrorIterator=v5e;function an(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,aKa.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(an,"Create");function*fKa(t,e,r,n){}a(fKa,"FromAny");function*pKa(t,e,r,n){}a(pKa,"FromArgument");function*hKa(t,e,r,n){if(!(0,ih.IsArray)(n))return yield an(en.Array,t,r,n);ta(t.minItems)&&!(n.length>=t.minItems)&&(yield an(en.ArrayMinItems,t,r,n)),ta(t.maxItems)&&!(n.length<=t.maxItems)&&(yield an(en.ArrayMaxItems,t,r,n));for(let c=0;cNg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield an(en.ArrayContains,t,r,n)),(0,ih.IsNumber)(t.minContains)&&st.maxContains&&(yield an(en.ArrayMaxContains,t,r,n))}a(hKa,"FromArray");function*mKa(t,e,r,n){(0,ih.IsAsyncIterator)(n)||(yield an(en.AsyncIterator,t,r,n))}a(mKa,"FromAsyncIterator");function*gKa(t,e,r,n){if(!(0,ih.IsBigInt)(n))return yield an(en.BigInt,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.BigIntExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.BigIntMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.BigIntMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield an(en.BigIntMultipleOf,t,r,n))}a(gKa,"FromBigInt");function*AKa(t,e,r,n){(0,ih.IsBoolean)(n)||(yield an(en.Boolean,t,r,n))}a(AKa,"FromBoolean");function*yKa(t,e,r,n){yield*Ng(t.returns,e,r,n.prototype)}a(yKa,"FromConstructor");function*EKa(t,e,r,n){if(!(0,ih.IsDate)(n))return yield an(en.Date,t,r,n);ta(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield an(en.DateExclusiveMinimumTimestamp,t,r,n)),ta(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield an(en.DateMaximumTimestamp,t,r,n)),ta(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield an(en.DateMinimumTimestamp,t,r,n)),ta(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield an(en.DateMultipleOfTimestamp,t,r,n))}a(EKa,"FromDate");function*_Ka(t,e,r,n){(0,ih.IsFunction)(n)||(yield an(en.Function,t,r,n))}a(_Ka,"FromFunction");function*CKa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Ng(s,[...e,...o],r,n)}a(CKa,"FromImport");function*vKa(t,e,r,n){if(!(0,ih.IsInteger)(n))return yield an(en.Integer,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.IntegerExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.IntegerMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.IntegerMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(en.IntegerMultipleOf,t,r,n))}a(vKa,"FromInteger");function*bKa(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Ng(s,e,r,n))o=!0,yield c;if(o)return yield an(en.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,LPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield an(en.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,LPi.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Ng(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(bKa,"FromIntersect");function*SKa(t,e,r,n){(0,ih.IsIterator)(n)||(yield an(en.Iterator,t,r,n))}a(SKa,"FromIterator");function*TKa(t,e,r,n){n!==t.const&&(yield an(en.Literal,t,r,n))}a(TKa,"FromLiteral");function*IKa(t,e,r,n){yield an(en.Never,t,r,n)}a(IKa,"FromNever");function*xKa(t,e,r,n){Ng(t.not,e,r,n).next().done===!0&&(yield an(en.Not,t,r,n))}a(xKa,"FromNot");function*wKa(t,e,r,n){(0,ih.IsNull)(n)||(yield an(en.Null,t,r,n))}a(wKa,"FromNull");function*RKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsNumberLike(n))return yield an(en.Number,t,r,n);ta(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield an(en.NumberExclusiveMinimum,t,r,n)),ta(t.maximum)&&!(n<=t.maximum)&&(yield an(en.NumberMaximum,t,r,n)),ta(t.minimum)&&!(n>=t.minimum)&&(yield an(en.NumberMinimum,t,r,n)),ta(t.multipleOf)&&n%t.multipleOf!==0&&(yield an(en.NumberMultipleOf,t,r,n))}a(RKa,"FromNumber");function*kKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsObjectLike(n))return yield an(en.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(en.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(en.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield an(en.ObjectRequiredProperty,t.properties[l],`${r}/${t6(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield an(en.ObjectAdditionalProperties,t,`${r}/${t6(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Ng(t.additionalProperties,e,`${r}/${t6(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Ng(u,e,`${r}/${t6(l)}`,n[l]),(0,sKa.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield an(en.ObjectRequiredProperty,u,`${r}/${t6(l)}`,void 0))):C5e.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Ng(u,e,`${r}/${t6(l)}`,n[l]))}}a(kKa,"FromObject");function*PKa(t,e,r,n){(0,ih.IsPromise)(n)||(yield an(en.Promise,t,r,n))}a(PKa,"FromPromise");function*DKa(t,e,r,n){if(!C5e.TypeSystemPolicy.IsRecordLike(n))return yield an(en.Object,t,r,n);ta(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield an(en.ObjectMinProperties,t,r,n)),ta(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield an(en.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*Ng(s,e,`${r}/${t6(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Ng(t.additionalProperties,e,`${r}/${t6(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield an(en.ObjectAdditionalProperties,t,`${r}/${t6(l)}`,u)}}a(DKa,"FromRecord");function*NKa(t,e,r,n){yield*Ng((0,FPi.Deref)(t,e),e,r,n)}a(NKa,"FromRef");function*MKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);if(ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(en.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(en.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield an(en.RegExp,t,r,n)}a(MKa,"FromRegExp");function*OKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);ta(t.minLength)&&!(n.length>=t.minLength)&&(yield an(en.StringMinLength,t,r,n)),ta(t.maxLength)&&!(n.length<=t.maxLength)&&(yield an(en.StringMaxLength,t,r,n)),(0,ih.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield an(en.StringPattern,t,r,n))),(0,ih.IsString)(t.format)&&(mAt.FormatRegistry.Has(t.format)?mAt.FormatRegistry.Get(t.format)(n)||(yield an(en.StringFormat,t,r,n)):yield an(en.StringFormatUnknown,t,r,n))}a(OKa,"FromString");function*BKa(t,e,r,n){(0,ih.IsSymbol)(n)||(yield an(en.Symbol,t,r,n))}a(BKa,"FromSymbol");function*LKa(t,e,r,n){if(!(0,ih.IsString)(n))return yield an(en.String,t,r,n);new RegExp(t.pattern).test(n)||(yield an(en.StringPattern,t,r,n))}a(LKa,"FromTemplateLiteral");function*FKa(t,e,r,n){yield*Ng((0,FPi.Deref)(t,e),e,r,n)}a(FKa,"FromThis");function*UKa(t,e,r,n){if(!(0,ih.IsArray)(n))return yield an(en.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield an(en.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield an(en.TupleLength,t,r,n);if(t.items)for(let o=0;onew v5e(Ng(s,e,r,n)));yield an(en.Union,t,r,n,o)}a(qKa,"FromUnion");function*jKa(t,e,r,n){if(!(0,ih.IsUint8Array)(n))return yield an(en.Uint8Array,t,r,n);ta(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield an(en.Uint8ArrayMaxByteLength,t,r,n)),ta(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield an(en.Uint8ArrayMinByteLength,t,r,n))}a(jKa,"FromUint8Array");function*HKa(t,e,r,n){}a(HKa,"FromUnknown");function*GKa(t,e,r,n){C5e.TypeSystemPolicy.IsVoidLike(n)||(yield an(en.Void,t,r,n))}a(GKa,"FromVoid");function*$Ka(t,e,r,n){mAt.TypeRegistry.Get(t[rxr.Kind])(t,n)||(yield an(en.Kind,t,r,n))}a($Ka,"FromKind");function*Ng(t,e,r,n){let o=ta(t.$id)?[...e,t]:e,s=t;switch(s[rxr.Kind]){case"Any":return yield*fKa(s,o,r,n);case"Argument":return yield*pKa(s,o,r,n);case"Array":return yield*hKa(s,o,r,n);case"AsyncIterator":return yield*mKa(s,o,r,n);case"BigInt":return yield*gKa(s,o,r,n);case"Boolean":return yield*AKa(s,o,r,n);case"Constructor":return yield*yKa(s,o,r,n);case"Date":return yield*EKa(s,o,r,n);case"Function":return yield*_Ka(s,o,r,n);case"Import":return yield*CKa(s,o,r,n);case"Integer":return yield*vKa(s,o,r,n);case"Intersect":return yield*bKa(s,o,r,n);case"Iterator":return yield*SKa(s,o,r,n);case"Literal":return yield*TKa(s,o,r,n);case"Never":return yield*IKa(s,o,r,n);case"Not":return yield*xKa(s,o,r,n);case"Null":return yield*wKa(s,o,r,n);case"Number":return yield*RKa(s,o,r,n);case"Object":return yield*kKa(s,o,r,n);case"Promise":return yield*PKa(s,o,r,n);case"Record":return yield*DKa(s,o,r,n);case"Ref":return yield*NKa(s,o,r,n);case"RegExp":return yield*MKa(s,o,r,n);case"String":return yield*OKa(s,o,r,n);case"Symbol":return yield*BKa(s,o,r,n);case"TemplateLiteral":return yield*LKa(s,o,r,n);case"This":return yield*FKa(s,o,r,n);case"Tuple":return yield*UKa(s,o,r,n);case"Undefined":return yield*QKa(s,o,r,n);case"Union":return yield*qKa(s,o,r,n);case"Uint8Array":return yield*jKa(s,o,r,n);case"Unknown":return yield*HKa(s,o,r,n);case"Void":return yield*GKa(s,o,r,n);default:if(!mAt.TypeRegistry.Has(s[rxr.Kind]))throw new gAt(t);return yield*$Ka(s,o,r,n)}}a(Ng,"Visit");function VKa(...t){let e=t.length===3?Ng(t[0],t[1],"",t[2]):Ng(t[0],[],"",t[1]);return new v5e(e)}a(VKa,"Errors")});var _ge=I(YG=>{"use strict";p();var WKa=YG&&YG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UPi=YG&&YG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WKa(e,t,r)};Object.defineProperty(YG,"__esModule",{value:!0});UPi(XIr(),YG);UPi(ZIr(),YG)});var GPi=I(n6=>{"use strict";p();var zKa=n6&&n6.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},qPi=n6&&n6.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nxr,AAt,jPi;Object.defineProperty(n6,"__esModule",{value:!0});n6.AssertError=void 0;n6.Assert=JKa;var HPi=_ge(),YKa=IEr(),KKa=txr(),yAt=class extends YKa.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),nxr.add(this),AAt.set(this,void 0),zKa(this,AAt,e,"f"),this.error=r}Errors(){return new HPi.ValueErrorIterator(qPi(this,nxr,"m",jPi).call(this))}};n6.AssertError=yAt;AAt=new WeakMap,nxr=new WeakSet,jPi=a(function*(){this.error&&(yield this.error),yield*qPi(this,AAt,"f")},"_AssertError_Iterator");function QPi(t,e,r){if(!(0,KKa.Check)(t,e,r))throw new yAt((0,HPi.Errors)(t,e,r))}a(QPi,"AssertValue");function JKa(...t){return t.length===3?QPi(t[0],t[1],t[2]):QPi(t[0],[],t[1])}a(JKa,"Assert")});var EAt=I(ore=>{"use strict";p();var ZKa=ore&&ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),XKa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZKa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});XKa(GPi(),ore)});var $Pi=I(ixr=>{"use strict";p();Object.defineProperty(ixr,"__esModule",{value:!0});ixr.Clone=Cge;var sre=pm();function eJa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Cge(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Cge(t[r]);return e}a(eJa,"FromObject");function tJa(t){return t.map(e=>Cge(e))}a(tJa,"FromArray");function rJa(t){return t.slice()}a(rJa,"FromTypedArray");function nJa(t){return new Map(Cge([...t.entries()]))}a(nJa,"FromMap");function iJa(t){return new Set(Cge([...t.entries()]))}a(iJa,"FromSet");function oJa(t){return new Date(t.toISOString())}a(oJa,"FromDate");function Cge(t){if((0,sre.IsArray)(t))return tJa(t);if((0,sre.IsDate)(t))return oJa(t);if((0,sre.IsTypedArray)(t))return rJa(t);if((0,sre.IsMap)(t))return nJa(t);if((0,sre.IsSet)(t))return iJa(t);if((0,sre.IsObject)(t))return eJa(t);if((0,sre.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Cge,"Clone")});var mD=I(are=>{"use strict";p();var sJa=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),aJa=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sJa(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});aJa($Pi(),are)});var YPi=I(b5e=>{"use strict";p();Object.defineProperty(b5e,"__esModule",{value:!0});b5e.ValueCreateError=void 0;b5e.Create=zJa;var Ba=pm(),cJa=FT(),lJa=mD(),oxr=pD(),VPi=U2(),uJa=Ame(),WPi=_n(),dJa=bf(),fJa=p0t(),e1=class extends dJa.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};b5e.ValueCreateError=e1;function Ja(t){return(0,fJa.IsFunction)(t)?t():(0,lJa.Clone)(t)}a(Ja,"FromDefault");function pJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(pJa,"FromAny");function hJa(t,e){return{}}a(hJa,"FromArgument");function mJa(t,e){if(t.uniqueItems===!0&&!(0,Ba.HasPropertyKey)(t,"default"))throw new e1(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Ba.HasPropertyKey)(t,"default"))throw new e1(t,"Array with the contains constraint requires a default value");return"default"in t?Ja(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>UT(t.items,e)):[]}a(mJa,"FromArray");function gJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):(async function*(){})()}a(gJa,"FromAsyncIterator");function AJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):BigInt(0)}a(AJa,"FromBigInt");function yJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):!1}a(yJa,"FromBoolean");function EJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=UT(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(EJa,"FromConstructor");function _Ja(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(_Ja,"FromDate");function CJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):()=>UT(t.returns,e)}a(CJa,"FromFunction");function vJa(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return UT(n,[...e,...r])}a(vJa,"FromImport");function bJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(bJa,"FromInteger");function SJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=t.allOf.reduce((n,o)=>{let s=UT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,cJa.Check)(t,e,r))throw new e1(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(SJa,"FromIntersect");function TJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):(function*(){})()}a(TJa,"FromIterator");function IJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.const}a(IJa,"FromLiteral");function xJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"Never types cannot be created. Consider using a default value.")}a(xJa,"FromNever");function wJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"Not types must have a default value")}a(wJa,"FromNot");function RJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):null}a(RJa,"FromNull");function kJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minimum!==void 0?t.minimum:0}a(kJa,"FromNumber");function PJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=UT(s,e));return n}}a(PJa,"FromObject");function DJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):Promise.resolve(UT(t.item,e))}a(DJa,"FromPromise");function NJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(NJa,"FromRecord");function MJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):UT((0,oxr.Deref)(t,e),e)}a(MJa,"FromRef");function OJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"RegExp types cannot be created. Consider using a default value.")}a(OJa,"FromRegExp");function BJa(t,e){if(t.pattern!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new e1(t,"String types with formats must specify a default value")}else return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(BJa,"FromString");function LJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(LJa,"FromSymbol");function FJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);if(!(0,VPi.IsTemplateLiteralFinite)(t))throw new e1(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,VPi.TemplateLiteralGenerate)(t)[0]}a(FJa,"FromTemplateLiteral");function UJa(t,e){if(zPi++>WJa)throw new e1(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):UT((0,oxr.Deref)(t,e),e)}a(UJa,"FromThis");function QJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>UT(t.items[n],e))}a(QJa,"FromTuple");function qJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default)}a(qJa,"FromUndefined");function jJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return UT(t.anyOf[0],e)}a(jJa,"FromUnion");function HJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(HJa,"FromUint8Array");function GJa(t,e){return(0,Ba.HasPropertyKey)(t,"default")?Ja(t.default):{}}a(GJa,"FromUnknown");function $Ja(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default)}a($Ja,"FromVoid");function VJa(t,e){if((0,Ba.HasPropertyKey)(t,"default"))return Ja(t.default);throw new Error("User defined types must specify a default value")}a(VJa,"FromKind");function UT(t,e){let r=(0,oxr.Pushref)(t,e),n=t;switch(n[WPi.Kind]){case"Any":return pJa(n,r);case"Argument":return hJa(n,r);case"Array":return mJa(n,r);case"AsyncIterator":return gJa(n,r);case"BigInt":return AJa(n,r);case"Boolean":return yJa(n,r);case"Constructor":return EJa(n,r);case"Date":return _Ja(n,r);case"Function":return CJa(n,r);case"Import":return vJa(n,r);case"Integer":return bJa(n,r);case"Intersect":return SJa(n,r);case"Iterator":return TJa(n,r);case"Literal":return IJa(n,r);case"Never":return xJa(n,r);case"Not":return wJa(n,r);case"Null":return RJa(n,r);case"Number":return kJa(n,r);case"Object":return PJa(n,r);case"Promise":return DJa(n,r);case"Record":return NJa(n,r);case"Ref":return MJa(n,r);case"RegExp":return OJa(n,r);case"String":return BJa(n,r);case"Symbol":return LJa(n,r);case"TemplateLiteral":return FJa(n,r);case"This":return UJa(n,r);case"Tuple":return QJa(n,r);case"Undefined":return qJa(n,r);case"Union":return jJa(n,r);case"Uint8Array":return HJa(n,r);case"Unknown":return GJa(n,r);case"Void":return $Ja(n,r);default:if(!uJa.TypeRegistry.Has(n[WPi.Kind]))throw new e1(n,"Unknown type");return VJa(n,r)}}a(UT,"Visit");var WJa=512,zPi=0;function zJa(...t){return zPi=0,t.length===2?UT(t[0],t[1]):UT(t[0],[])}a(zJa,"Create")});var _At=I(cre=>{"use strict";p();var YJa=cre&&cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KJa=cre&&cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YJa(e,t,r)};Object.defineProperty(cre,"__esModule",{value:!0});KJa(YPi(),cre)});var XPi=I(I5e=>{"use strict";p();Object.defineProperty(I5e,"__esModule",{value:!0});I5e.ValueCastError=void 0;I5e.Cast=ZPi;var gR=pm(),JJa=bf(),CAt=_n(),KG=_At(),QT=FT(),lre=mD(),T5e=pD(),S5e=class extends JJa.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};I5e.ValueCastError=S5e;function KPi(t,e,r){if(t[CAt.Kind]==="Object"&&typeof r=="object"&&!(0,gR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[CAt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,QT.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[CAt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,T5e.Deref)(s,e)).map(s=>KPi(s,e,r));return Math.max(...o)}else return(0,QT.Check)(t,e,r)?1:0}a(KPi,"ScoreUnion");function ZJa(t,e,r){let n=t.anyOf.map(c=>(0,T5e.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=KPi(c,e,r);l>s&&(o=c,s=l)}return o}a(ZJa,"SelectUnion");function XJa(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,lre.Clone)(t.default);{let n=ZJa(t,e,r);return ZPi(n,e,r)}}a(XJa,"CastUnion");function eZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):(0,KG.Create)(t,e)}a(eZa,"DefaultClone");function tZa(t,e,r){return(0,QT.Check)(t,e,r)?r:(0,KG.Create)(t,e)}a(tZa,"Default");function rZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,lre.Clone)(r);let n=(0,gR.IsArray)(r)?(0,lre.Clone)(r):(0,KG.Create)(t,e),o=(0,gR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,gR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>gD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,QT.Check)(t,e,l))throw new S5e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(rZa,"FromArray");function nZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,KG.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=gD(c,e,r.prototype[s]));return o}a(nZa,"FromConstructor");function iZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return gD(o,[...e,...n],r)}a(iZa,"FromImport");function JPi(t,e){return(0,gR.IsObject)(t)&&!(0,gR.IsObject)(e)||!(0,gR.IsObject)(t)&&(0,gR.IsObject)(e)?t:!(0,gR.IsObject)(t)||!(0,gR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?JPi(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(JPi,"IntersectAssign");function oZa(t,e,r){if((0,QT.Check)(t,e,r))return r;let n=(0,KG.Create)(t,e),o=JPi(n,r);return(0,QT.Check)(t,e,o)?o:n}a(oZa,"FromIntersect");function sZa(t,e,r){throw new S5e(t,"Never types cannot be cast")}a(sZa,"FromNever");function aZa(t,e,r){if((0,QT.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,KG.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=gD(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=gD(t.additionalProperties,e,r[c]))}return o}a(aZa,"FromObject");function cZa(t,e,r){if((0,QT.Check)(t,e,r))return(0,lre.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,KG.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=gD(o,e,l);return s}a(cZa,"FromRecord");function lZa(t,e,r){return gD((0,T5e.Deref)(t,e),e,r)}a(lZa,"FromRef");function uZa(t,e,r){return gD((0,T5e.Deref)(t,e),e,r)}a(uZa,"FromThis");function dZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):(0,gR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>gD(n,e,r[o])):(0,KG.Create)(t,e)}a(dZa,"FromTuple");function fZa(t,e,r){return(0,QT.Check)(t,e,r)?(0,lre.Clone)(r):XJa(t,e,r)}a(fZa,"FromUnion");function gD(t,e,r){let n=(0,gR.IsString)(t.$id)?(0,T5e.Pushref)(t,e):e,o=t;switch(t[CAt.Kind]){case"Array":return rZa(o,n,r);case"Constructor":return nZa(o,n,r);case"Import":return iZa(o,n,r);case"Intersect":return oZa(o,n,r);case"Never":return sZa(o,n,r);case"Object":return aZa(o,n,r);case"Record":return cZa(o,n,r);case"Ref":return lZa(o,n,r);case"This":return uZa(o,n,r);case"Tuple":return dZa(o,n,r);case"Union":return fZa(o,n,r);case"Date":case"Symbol":case"Uint8Array":return eZa(t,e,r);default:return tZa(o,n,r)}}a(gD,"Visit");function ZPi(...t){return t.length===3?gD(t[0],t[1],t[2]):gD(t[0],[],t[1])}a(ZPi,"Cast")});var vAt=I(ure=>{"use strict";p();var pZa=ure&&ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hZa=ure&&ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pZa(e,t,r)};Object.defineProperty(ure,"__esModule",{value:!0});hZa(XPi(),ure)});var t2i=I(axr=>{"use strict";p();Object.defineProperty(axr,"__esModule",{value:!0});axr.Clean=xZa;var mZa=q2(),bAt=FT(),gZa=mD(),sxr=pD(),e2i=_n(),AD=pm(),SAt=gs();function AZa(t){return(0,SAt.IsKind)(t)&&t[e2i.Kind]!=="Unsafe"}a(AZa,"IsCheckable");function yZa(t,e,r){return(0,AD.IsArray)(r)?r.map(n=>t1(t.items,e,n)):r}a(yZa,"FromArray");function EZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return t1(o,[...e,...n],r)}a(EZa,"FromImport");function _Za(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>t1(l,e,(0,gZa.Clone)(r))).reduce((l,u)=>(0,AD.IsObject)(u)?{...l,...u}:u,{});if(!(0,AD.IsObject)(r)||!(0,AD.IsObject)(s)||!(0,SAt.IsKind)(n))return s;let c=(0,mZa.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,bAt.Check)(n,e,r[l])&&(s[l]=t1(n,e,r[l]));return s}a(_Za,"FromIntersect");function CZa(t,e,r){if(!(0,AD.IsObject)(r)||(0,AD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,AD.HasPropertyKey)(t.properties,o)){r[o]=t1(t.properties[o],e,r[o]);continue}if((0,SAt.IsKind)(n)&&(0,bAt.Check)(n,e,r[o])){r[o]=t1(n,e,r[o]);continue}delete r[o]}return r}a(CZa,"FromObject");function vZa(t,e,r){if(!(0,AD.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=t1(c,e,r[u]);continue}if((0,SAt.IsKind)(n)&&(0,bAt.Check)(n,e,r[u])){r[u]=t1(n,e,r[u]);continue}delete r[u]}return r}a(vZa,"FromRecord");function bZa(t,e,r){return t1((0,sxr.Deref)(t,e),e,r)}a(bZa,"FromRef");function SZa(t,e,r){return t1((0,sxr.Deref)(t,e),e,r)}a(SZa,"FromThis");function TZa(t,e,r){if(!(0,AD.IsArray)(r))return r;if((0,AD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(TZa,"FromTuple");function IZa(t,e,r){for(let n of t.anyOf)if(AZa(n)&&(0,bAt.Check)(n,e,r))return t1(n,e,r);return r}a(IZa,"FromUnion");function t1(t,e,r){let n=(0,AD.IsString)(t.$id)?(0,sxr.Pushref)(t,e):e,o=t;switch(o[e2i.Kind]){case"Array":return yZa(o,n,r);case"Import":return EZa(o,n,r);case"Intersect":return _Za(o,n,r);case"Object":return CZa(o,n,r);case"Record":return vZa(o,n,r);case"Ref":return bZa(o,n,r);case"This":return SZa(o,n,r);case"Tuple":return TZa(o,n,r);case"Union":return IZa(o,n,r);default:return r}}a(t1,"Visit");function xZa(...t){return t.length===3?t1(t[0],t[1],t[2]):t1(t[0],[],t[1])}a(xZa,"Clean")});var TAt=I(dre=>{"use strict";p();var wZa=dre&&dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RZa=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wZa(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});RZa(t2i(),dre)});var s2i=I(lxr=>{"use strict";p();Object.defineProperty(lxr,"__esModule",{value:!0});lxr.Convert=fXa;var kZa=mD(),r2i=FT(),cxr=pD(),PZa=_n(),La=pm();function IAt(t){return(0,La.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(IAt,"IsStringNumeric");function DZa(t){return(0,La.IsBigInt)(t)||(0,La.IsBoolean)(t)||(0,La.IsNumber)(t)}a(DZa,"IsValueToString");function x5e(t){return t===!0||(0,La.IsNumber)(t)&&t===1||(0,La.IsBigInt)(t)&&t===BigInt("1")||(0,La.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(x5e,"IsValueTrue");function w5e(t){return t===!1||(0,La.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,La.IsBigInt)(t)&&t===BigInt("0")||(0,La.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(w5e,"IsValueFalse");function NZa(t){return(0,La.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(NZa,"IsTimeStringWithTimeZone");function MZa(t){return(0,La.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(MZa,"IsTimeStringWithoutTimeZone");function OZa(t){return(0,La.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(OZa,"IsDateTimeStringWithTimeZone");function BZa(t){return(0,La.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(BZa,"IsDateTimeStringWithoutTimeZone");function LZa(t){return(0,La.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(LZa,"IsDateString");function FZa(t,e){let r=i2i(t);return r===e?r:t}a(FZa,"TryConvertLiteralString");function UZa(t,e){let r=o2i(t);return r===e?r:t}a(UZa,"TryConvertLiteralNumber");function QZa(t,e){let r=n2i(t);return r===e?r:t}a(QZa,"TryConvertLiteralBoolean");function qZa(t,e){return(0,La.IsString)(t.const)?FZa(e,t.const):(0,La.IsNumber)(t.const)?UZa(e,t.const):(0,La.IsBoolean)(t.const)?QZa(e,t.const):e}a(qZa,"TryConvertLiteral");function n2i(t){return x5e(t)?!0:w5e(t)?!1:t}a(n2i,"TryConvertBoolean");function jZa(t){let e=a(r=>r.split(".")[0],"truncateInteger");return IAt(t)?BigInt(e(t)):(0,La.IsNumber)(t)?BigInt(Math.trunc(t)):w5e(t)?BigInt(0):x5e(t)?BigInt(1):t}a(jZa,"TryConvertBigInt");function i2i(t){return(0,La.IsSymbol)(t)&&t.description!==void 0?t.description.toString():DZa(t)?t.toString():t}a(i2i,"TryConvertString");function o2i(t){return IAt(t)?parseFloat(t):x5e(t)?1:w5e(t)?0:t}a(o2i,"TryConvertNumber");function HZa(t){return IAt(t)?parseInt(t):(0,La.IsNumber)(t)?Math.trunc(t):x5e(t)?1:w5e(t)?0:t}a(HZa,"TryConvertInteger");function GZa(t){return(0,La.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(GZa,"TryConvertNull");function $Za(t){return(0,La.IsString)(t)&&t==="undefined"?void 0:t}a($Za,"TryConvertUndefined");function VZa(t){return(0,La.IsDate)(t)?t:(0,La.IsNumber)(t)?new Date(t):x5e(t)?new Date(1):w5e(t)?new Date(0):IAt(t)?new Date(parseInt(t)):MZa(t)?new Date(`1970-01-01T${t}.000Z`):NZa(t)?new Date(`1970-01-01T${t}`):BZa(t)?new Date(`${t}.000Z`):OZa(t)?new Date(t):LZa(t)?new Date(`${t}T00:00:00.000Z`):t}a(VZa,"TryConvertDate");function WZa(t,e,r){return((0,La.IsArray)(r)?r:[r]).map(o=>yD(t.items,e,o))}a(WZa,"FromArray");function zZa(t,e,r){return jZa(r)}a(zZa,"FromBigInt");function YZa(t,e,r){return n2i(r)}a(YZa,"FromBoolean");function KZa(t,e,r){return VZa(r)}a(KZa,"FromDate");function JZa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return yD(o,[...e,...n],r)}a(JZa,"FromImport");function ZZa(t,e,r){return HZa(r)}a(ZZa,"FromInteger");function XZa(t,e,r){return t.allOf.reduce((n,o)=>yD(o,e,n),r)}a(XZa,"FromIntersect");function eXa(t,e,r){return qZa(t,r)}a(eXa,"FromLiteral");function tXa(t,e,r){return GZa(r)}a(tXa,"FromNull");function rXa(t,e,r){return o2i(r)}a(rXa,"FromNumber");function nXa(t,e,r){if(!(0,La.IsObject)(r)||(0,La.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,La.HasPropertyKey)(r,n)&&(r[n]=yD(t.properties[n],e,r[n]));return r}a(nXa,"FromObject");function iXa(t,e,r){if(!((0,La.IsObject)(r)&&!(0,La.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=yD(s,e,l);return r}a(iXa,"FromRecord");function oXa(t,e,r){return yD((0,cxr.Deref)(t,e),e,r)}a(oXa,"FromRef");function sXa(t,e,r){return i2i(r)}a(sXa,"FromString");function aXa(t,e,r){return(0,La.IsString)(r)||(0,La.IsNumber)(r)?Symbol(r):r}a(aXa,"FromSymbol");function cXa(t,e,r){return yD((0,cxr.Deref)(t,e),e,r)}a(cXa,"FromThis");function lXa(t,e,r){return(0,La.IsArray)(r)&&!(0,La.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var pXa=fre&&fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hXa=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pXa(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});hXa(s2i(),fre)});var u2i=I(pre=>{"use strict";p();Object.defineProperty(pre,"__esModule",{value:!0});pre.TransformDecodeError=pre.TransformDecodeCheckError=void 0;pre.TransformDecode=xXa;var mXa=$Me(),a2i=_n(),c2i=bf(),l2i=q2(),dxr=pD(),gXa=FT(),i6=pm(),R5e=gs(),uxr=class extends c2i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};pre.TransformDecodeCheckError=uxr;var wAt=class extends c2i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};pre.TransformDecodeError=wAt;function qd(t,e,r){try{return(0,R5e.IsTransform)(t)?t[a2i.TransformKind].Decode(r):r}catch(n){throw new wAt(t,e,r,n)}}a(qd,"Default");function AXa(t,e,r,n){return(0,i6.IsArray)(n)?qd(t,r,n.map((o,s)=>ED(t.items,e,`${r}/${s}`,o))):qd(t,r,n)}a(AXa,"FromArray");function yXa(t,e,r,n){if(!(0,i6.IsObject)(n)||(0,i6.IsValueType)(n))return qd(t,r,n);let o=(0,l2i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=ED(h,e,`${r}/${f}`,c[f]));if(!(0,R5e.IsTransform)(t.unevaluatedProperties))return qd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=qd(u,`${r}/${f}`,d[f]));return qd(t,r,d)}a(yXa,"FromIntersect");function EXa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ED(s,[...e,...o],r,n);return qd(t,r,c)}a(EXa,"FromImport");function _Xa(t,e,r,n){return qd(t,r,ED(t.not,e,r,n))}a(_Xa,"FromNot");function CXa(t,e,r,n){if(!(0,i6.IsObject)(n))return qd(t,r,n);let o=(0,l2i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,i6.HasPropertyKey)(s,d)&&((0,i6.IsUndefined)(s[d])&&(!(0,R5e.IsUndefined)(t.properties[d])||mXa.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=ED(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,R5e.IsSchema)(t.additionalProperties))return qd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=qd(l,`${r}/${d}`,u[d]));return qd(t,r,u)}a(CXa,"FromObject");function vXa(t,e,r,n){if(!(0,i6.IsObject)(n))return qd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=ED(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,R5e.IsSchema)(t.additionalProperties))return qd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=qd(u,`${r}/${f}`,d[f]));return qd(t,r,d)}a(vXa,"FromRecord");function bXa(t,e,r,n){let o=(0,dxr.Deref)(t,e);return qd(t,r,ED(o,e,r,n))}a(bXa,"FromRef");function SXa(t,e,r,n){let o=(0,dxr.Deref)(t,e);return qd(t,r,ED(o,e,r,n))}a(SXa,"FromThis");function TXa(t,e,r,n){return(0,i6.IsArray)(n)&&(0,i6.IsArray)(t.items)?qd(t,r,t.items.map((o,s)=>ED(o,e,`${r}/${s}`,n[s]))):qd(t,r,n)}a(TXa,"FromTuple");function IXa(t,e,r,n){for(let o of t.anyOf){if(!(0,gXa.Check)(o,e,n))continue;let s=ED(o,e,r,n);return qd(t,r,s)}return qd(t,r,n)}a(IXa,"FromUnion");function ED(t,e,r,n){let o=(0,dxr.Pushref)(t,e),s=t;switch(t[a2i.Kind]){case"Array":return AXa(s,o,r,n);case"Import":return EXa(s,o,r,n);case"Intersect":return yXa(s,o,r,n);case"Not":return _Xa(s,o,r,n);case"Object":return CXa(s,o,r,n);case"Record":return vXa(s,o,r,n);case"Ref":return bXa(s,o,r,n);case"Symbol":return qd(s,r,n);case"This":return SXa(s,o,r,n);case"Tuple":return TXa(s,o,r,n);case"Union":return IXa(s,o,r,n);default:return qd(s,r,n)}}a(ED,"Visit");function xXa(t,e,r){return ED(t,e,"",r)}a(xXa,"TransformDecode")});var m2i=I(hre=>{"use strict";p();Object.defineProperty(hre,"__esModule",{value:!0});hre.TransformEncodeError=hre.TransformEncodeCheckError=void 0;hre.TransformEncode=UXa;var wXa=$Me(),f2i=_n(),p2i=bf(),h2i=q2(),pxr=pD(),d2i=FT(),JG=pm(),k5e=gs(),fxr=class extends p2i.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};hre.TransformEncodeCheckError=fxr;var RAt=class extends p2i.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};hre.TransformEncodeError=RAt;function ZA(t,e,r){try{return(0,k5e.IsTransform)(t)?t[f2i.TransformKind].Encode(r):r}catch(n){throw new RAt(t,e,r,n)}}a(ZA,"Default");function RXa(t,e,r,n){let o=ZA(t,r,n);return(0,JG.IsArray)(o)?o.map((s,c)=>_D(t.items,e,`${r}/${c}`,s)):o}a(RXa,"FromArray");function kXa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ZA(t,r,n);return _D(s,[...e,...o],r,c)}a(kXa,"FromImport");function PXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.IsObject)(n)||(0,JG.IsValueType)(n))return o;let s=(0,h2i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=_D(m,e,`${r}/${h}`,l[h]));if(!(0,k5e.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=ZA(d,`${r}/${h}`,f[h]));return f}a(PXa,"FromIntersect");function DXa(t,e,r,n){return ZA(t.not,r,ZA(t,r,n))}a(DXa,"FromNot");function NXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.IsObject)(o))return o;let s=(0,h2i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,JG.HasPropertyKey)(c,f)&&((0,JG.IsUndefined)(c[f])&&(!(0,k5e.IsUndefined)(t.properties[f])||wXa.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=_D(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,k5e.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=ZA(u,`${r}/${f}`,d[f]));return d}a(NXa,"FromObject");function MXa(t,e,r,n){let o=ZA(t,r,n);if(!(0,JG.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=_D(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,k5e.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=ZA(d,`${r}/${h}`,f[h]));return f}a(MXa,"FromRecord");function OXa(t,e,r,n){let o=(0,pxr.Deref)(t,e),s=_D(o,e,r,n);return ZA(t,r,s)}a(OXa,"FromRef");function BXa(t,e,r,n){let o=(0,pxr.Deref)(t,e),s=_D(o,e,r,n);return ZA(t,r,s)}a(BXa,"FromThis");function LXa(t,e,r,n){let o=ZA(t,r,n);return(0,JG.IsArray)(t.items)?t.items.map((s,c)=>_D(s,e,`${r}/${c}`,o[c])):[]}a(LXa,"FromTuple");function FXa(t,e,r,n){for(let o of t.anyOf){if(!(0,d2i.Check)(o,e,n))continue;let s=_D(o,e,r,n);return ZA(t,r,s)}for(let o of t.anyOf){let s=_D(o,e,r,n);if((0,d2i.Check)(t,e,s))return ZA(t,r,s)}return ZA(t,r,n)}a(FXa,"FromUnion");function _D(t,e,r,n){let o=(0,pxr.Pushref)(t,e),s=t;switch(t[f2i.Kind]){case"Array":return RXa(s,o,r,n);case"Import":return kXa(s,o,r,n);case"Intersect":return PXa(s,o,r,n);case"Not":return DXa(s,o,r,n);case"Object":return NXa(s,o,r,n);case"Record":return MXa(s,o,r,n);case"Ref":return OXa(s,o,r,n);case"This":return BXa(s,o,r,n);case"Tuple":return LXa(s,o,r,n);case"Union":return FXa(s,o,r,n);default:return ZA(s,r,n)}}a(_D,"Visit");function UXa(t,e,r){return _D(t,e,"",r)}a(UXa,"TransformEncode")});var g2i=I(gxr=>{"use strict";p();Object.defineProperty(gxr,"__esModule",{value:!0});gxr.HasTransform=nec;var mxr=pD(),QXa=_n(),g0=gs(),qXa=pm();function jXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(jXa,"FromArray");function HXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(HXa,"FromAsyncIterator");function GXa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a(GXa,"FromConstructor");function $Xa(t,e){return(0,g0.IsTransform)(t)||gm(t.returns,e)||t.parameters.some(r=>gm(r,e))}a($Xa,"FromFunction");function VXa(t,e){return(0,g0.IsTransform)(t)||(0,g0.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>gm(r,e))}a(VXa,"FromIntersect");function WXa(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,g0.IsTransform)(t)||gm(n,[...r,...e])}a(WXa,"FromImport");function zXa(t,e){return(0,g0.IsTransform)(t)||gm(t.items,e)}a(zXa,"FromIterator");function YXa(t,e){return(0,g0.IsTransform)(t)||gm(t.not,e)}a(YXa,"FromNot");function KXa(t,e){return(0,g0.IsTransform)(t)||Object.values(t.properties).some(r=>gm(r,e))||(0,g0.IsSchema)(t.additionalProperties)&&gm(t.additionalProperties,e)}a(KXa,"FromObject");function JXa(t,e){return(0,g0.IsTransform)(t)||gm(t.item,e)}a(JXa,"FromPromise");function ZXa(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,g0.IsTransform)(t)||gm(n,e)||(0,g0.IsSchema)(t.additionalProperties)&&(0,g0.IsTransform)(t.additionalProperties)}a(ZXa,"FromRecord");function XXa(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,mxr.Deref)(t,e),e)}a(XXa,"FromRef");function eec(t,e){return(0,g0.IsTransform)(t)?!0:gm((0,mxr.Deref)(t,e),e)}a(eec,"FromThis");function tec(t,e){return(0,g0.IsTransform)(t)||!(0,qXa.IsUndefined)(t.items)&&t.items.some(r=>gm(r,e))}a(tec,"FromTuple");function rec(t,e){return(0,g0.IsTransform)(t)||t.anyOf.some(r=>gm(r,e))}a(rec,"FromUnion");function gm(t,e){let r=(0,mxr.Pushref)(t,e),n=t;if(t.$id&&hxr.has(t.$id))return!1;switch(t.$id&&hxr.add(t.$id),t[QXa.Kind]){case"Array":return jXa(n,r);case"AsyncIterator":return HXa(n,r);case"Constructor":return GXa(n,r);case"Function":return $Xa(n,r);case"Import":return WXa(n,r);case"Intersect":return VXa(n,r);case"Iterator":return zXa(n,r);case"Not":return YXa(n,r);case"Object":return KXa(n,r);case"Promise":return JXa(n,r);case"Record":return ZXa(n,r);case"Ref":return XXa(n,r);case"This":return eec(n,r);case"Tuple":return tec(n,r);case"Union":return rec(n,r);default:return(0,g0.IsTransform)(t)}}a(gm,"Visit");var hxr=new Set;function nec(t,e){return hxr.clear(),gm(t,e)}a(nec,"HasTransform")});var P5e=I(o6=>{"use strict";p();var iec=o6&&o6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Axr=o6&&o6.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&iec(e,t,r)};Object.defineProperty(o6,"__esModule",{value:!0});Axr(u2i(),o6);Axr(m2i(),o6);Axr(g2i(),o6)});var A2i=I(Exr=>{"use strict";p();Object.defineProperty(Exr,"__esModule",{value:!0});Exr.Decode=aec;var yxr=P5e(),oec=FT(),sec=_ge();function aec(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,oec.Check)(e,r,n))throw new yxr.TransformDecodeCheckError(e,n,(0,sec.Errors)(e,r,n).First());return(0,yxr.HasTransform)(e,r)?(0,yxr.TransformDecode)(e,r,n):n}a(aec,"Decode")});var _xr=I(mre=>{"use strict";p();var cec=mre&&mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lec=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cec(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});lec(A2i(),mre)});var E2i=I(bxr=>{"use strict";p();Object.defineProperty(bxr,"__esModule",{value:!0});bxr.Default=bec;var uec=FT(),y2i=mD(),vxr=pD(),dec=_n(),r1=pm(),fec=gs();function s6(t,e){let r=(0,r1.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,r1.IsFunction)(r)?r():(0,y2i.Clone)(r);return(0,r1.IsUndefined)(e)?n:(0,r1.IsObject)(e)&&(0,r1.IsObject)(n)?Object.assign(n,e):e}a(s6,"ValueOrDefault");function Cxr(t){return(0,fec.IsKind)(t)&&"default"in t}a(Cxr,"HasDefaultProperty");function pec(t,e,r){if((0,r1.IsArray)(r)){for(let o=0;o{let c=EC(s,e,n);return(0,r1.IsObject)(c)?{...o,...c}:c},{})}a(gec,"FromIntersect");function Aec(t,e,r){let n=s6(t,r);if(!(0,r1.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=EC(t.properties[s],e,n[s]);(0,r1.IsUndefined)(c)||(n[s]=EC(t.properties[s],e,n[s]))}if(!Cxr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=EC(t.additionalProperties,e,n[s]));return n}a(Aec,"FromObject");function yec(t,e,r){let n=s6(t,r);if(!(0,r1.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&Cxr(c)&&(n[u]=EC(c,e,n[u]));if(!Cxr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=EC(o,e,n[u]));return n}a(yec,"FromRecord");function Eec(t,e,r){return EC((0,vxr.Deref)(t,e),e,s6(t,r))}a(Eec,"FromRef");function _ec(t,e,r){return EC((0,vxr.Deref)(t,e),e,r)}a(_ec,"FromThis");function Cec(t,e,r){let n=s6(t,r);if(!(0,r1.IsArray)(n)||(0,r1.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var Sec=gre&&gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Tec=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Sec(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});Tec(E2i(),gre)});var v2i=I(CD=>{"use strict";p();Object.defineProperty(CD,"__esModule",{value:!0});CD.ValuePointerRootDeleteError=CD.ValuePointerRootSetError=void 0;CD.Format=D5e;CD.Set=Iec;CD.Delete=xec;CD.Has=wec;CD.Get=Rec;var C2i=bf(),PAt=class extends C2i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};CD.ValuePointerRootSetError=PAt;var DAt=class extends C2i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};CD.ValuePointerRootDeleteError=DAt;function _2i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(_2i,"Escape");function*D5e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var kec=R4&&R4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pec=R4&&R4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Dec=R4&&R4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Sxr,"__esModule",{value:!0});Sxr.Equal=MAt;var a6=pm();function Nec(t,e){if(!(0,a6.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>MAt(t[o],e[o]))}a(Nec,"ObjectType");function Mec(t,e){return(0,a6.IsDate)(e)&&t.getTime()===e.getTime()}a(Mec,"DateType");function Oec(t,e){return!(0,a6.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>MAt(r,e[n]))}a(Oec,"ArrayType");function Bec(t,e){return!(0,a6.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>MAt(r,e[n]))}a(Bec,"TypedArrayType");function Lec(t,e){return t===e}a(Lec,"ValueType");function MAt(t,e){if((0,a6.IsDate)(t))return Mec(t,e);if((0,a6.IsTypedArray)(t))return Bec(t,e);if((0,a6.IsArray)(t))return Oec(t,e);if((0,a6.IsObject)(t))return Nec(t,e);if((0,a6.IsValueType)(t))return Lec(t,e);throw new Error("ValueEquals: Unable to compare value")}a(MAt,"Equal")});var x2i=I(XA=>{"use strict";p();Object.defineProperty(XA,"__esModule",{value:!0});XA.ValueDiffError=XA.Edit=XA.Delete=XA.Update=XA.Insert=void 0;XA.Diff=$ec;XA.Patch=zec;var k4=pm(),Ixr=NAt(),xxr=mD(),Fec=Txr(),Uec=bf(),wxr=TE(),Rxr=dC(),kxr=aG(),S2i=pG(),Qec=mp();XA.Insert=(0,Rxr.Object)({type:(0,wxr.Literal)("insert"),path:(0,kxr.String)(),value:(0,S2i.Unknown)()});XA.Update=(0,Rxr.Object)({type:(0,wxr.Literal)("update"),path:(0,kxr.String)(),value:(0,S2i.Unknown)()});XA.Delete=(0,Rxr.Object)({type:(0,wxr.Literal)("delete"),path:(0,kxr.String)()});XA.Edit=(0,Qec.Union)([XA.Insert,XA.Update,XA.Delete]);var N5e=class extends Uec.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};XA.ValueDiffError=N5e;function OAt(t,e){return{type:"update",path:t,value:e}}a(OAt,"CreateUpdate");function T2i(t,e){return{type:"insert",path:t,value:e}}a(T2i,"CreateInsert");function I2i(t){return{type:"delete",path:t}}a(I2i,"CreateDelete");function b2i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new N5e(t,"Cannot diff objects with symbols")}a(b2i,"AssertDiffable");function*qec(t,e,r){if(b2i(e),b2i(r),!(0,k4.IsStandardObject)(r))return yield OAt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,k4.HasPropertyKey)(e,s)||(yield T2i(`${t}/${s}`,r[s]));for(let s of n)(0,k4.HasPropertyKey)(r,s)&&((0,Fec.Equal)(e,r)||(yield*BAt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,k4.HasPropertyKey)(r,s)||(yield I2i(`${t}/${s}`))}a(qec,"ObjectType");function*jec(t,e,r){if(!(0,k4.IsArray)(r))return yield OAt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(Vec,"IsRootUpdate");function Wec(t){return t.length===0}a(Wec,"IsIdentity");function zec(t,e){if(Vec(e))return(0,xxr.Clone)(e[0].value);if(Wec(e))return(0,xxr.Clone)(t);let r=(0,xxr.Clone)(t);for(let n of e)switch(n.type){case"insert":{Ixr.ValuePointer.Set(r,n.path,n.value);break}case"update":{Ixr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{Ixr.ValuePointer.Delete(r,n.path);break}}return r}a(zec,"Patch")});var Pxr=I(Are=>{"use strict";p();var Yec=Are&&Are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kec=Are&&Are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yec(e,t,r)};Object.defineProperty(Are,"__esModule",{value:!0});Kec(x2i(),Are)});var w2i=I(Nxr=>{"use strict";p();Object.defineProperty(Nxr,"__esModule",{value:!0});Nxr.Encode=Xec;var Dxr=P5e(),Jec=FT(),Zec=_ge();function Xec(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Dxr.HasTransform)(e,r)?(0,Dxr.TransformEncode)(e,r,n):n;if(!(0,Jec.Check)(e,r,o))throw new Dxr.TransformEncodeCheckError(e,o,(0,Zec.Errors)(e,r,o).First());return o}a(Xec,"Encode")});var Mxr=I(yre=>{"use strict";p();var etc=yre&&yre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ttc=yre&&yre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&etc(e,t,r)};Object.defineProperty(yre,"__esModule",{value:!0});ttc(w2i(),yre)});var Oxr=I(Ere=>{"use strict";p();var rtc=Ere&&Ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ntc=Ere&&Ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rtc(e,t,r)};Object.defineProperty(Ere,"__esModule",{value:!0});ntc(Txr(),Ere)});var k2i=I(O5e=>{"use strict";p();Object.defineProperty(O5e,"__esModule",{value:!0});O5e.ValueMutateError=void 0;O5e.Mutate=utc;var vD=pm(),FAt=NAt(),Bxr=mD(),itc=bf();function LAt(t){return(0,vD.IsObject)(t)&&!(0,vD.IsArray)(t)}a(LAt,"IsStandardObject");var M5e=class extends itc.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};O5e.ValueMutateError=M5e;function otc(t,e,r,n){if(!LAt(r))FAt.ValuePointer.Set(t,e,(0,Bxr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)Lxr(t,`${e}/${c}`,r[c],n[c])}}a(otc,"ObjectType");function stc(t,e,r,n){if(!(0,vD.IsArray)(r))FAt.ValuePointer.Set(t,e,(0,Bxr.Clone)(n));else{for(let o=0;o{"use strict";p();var dtc=_re&&_re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ftc=_re&&_re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dtc(e,t,r)};Object.defineProperty(_re,"__esModule",{value:!0});ftc(k2i(),_re)});var D2i=I(bD=>{"use strict";p();Object.defineProperty(bD,"__esModule",{value:!0});bD.ParseDefault=bD.ParseRegistry=bD.ParseError=void 0;bD.Parse=Ctc;var ptc=bf(),UAt=P5e(),htc=EAt(),mtc=vAt(),gtc=TAt(),Atc=mD(),ytc=xAt(),Etc=kAt(),P2i=pm(),B5e=class extends ptc.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};bD.ParseError=B5e;var Uxr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,htc.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,mtc.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,gtc.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,Atc.Clone)(l)],["Convert",(s,c,l)=>(0,ytc.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,UAt.HasTransform)(s,c)?(0,UAt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,Etc.Default)(s,c,l)],["Encode",(s,c,l)=>(0,UAt.HasTransform)(s,c)?(0,UAt.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(Uxr||(bD.ParseRegistry=Uxr={}));bD.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function _tc(t,e,r,n){return t.reduce((o,s)=>{let c=Uxr.Get(s);if((0,P2i.IsUndefined)(c))throw new B5e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(_tc,"ParseValue");function Ctc(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,P2i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[bD.ParseDefault,t[0],t[1],t[2]]:t.length===2?[bD.ParseDefault,t[0],[],t[1]]:(()=>{throw new B5e("Invalid Arguments")})();return _tc(e,r,n,o)}a(Ctc,"Parse")});var Qxr=I(Cre=>{"use strict";p();var vtc=Cre&&Cre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),btc=Cre&&Cre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vtc(e,t,r)};Object.defineProperty(Cre,"__esModule",{value:!0});btc(D2i(),Cre)});var M2i=I(As=>{"use strict";p();Object.defineProperty(As,"__esModule",{value:!0});As.Parse=As.Mutate=As.Hash=As.Equal=As.Encode=As.Edit=As.Patch=As.Diff=As.Default=As.Decode=As.Create=As.Convert=As.Clone=As.Clean=As.Check=As.Cast=As.Assert=As.ValueErrorIterator=As.Errors=void 0;var N2i=_ge();Object.defineProperty(As,"Errors",{enumerable:!0,get:a(function(){return N2i.Errors},"get")});Object.defineProperty(As,"ValueErrorIterator",{enumerable:!0,get:a(function(){return N2i.ValueErrorIterator},"get")});var Stc=EAt();Object.defineProperty(As,"Assert",{enumerable:!0,get:a(function(){return Stc.Assert},"get")});var Ttc=vAt();Object.defineProperty(As,"Cast",{enumerable:!0,get:a(function(){return Ttc.Cast},"get")});var Itc=FT();Object.defineProperty(As,"Check",{enumerable:!0,get:a(function(){return Itc.Check},"get")});var xtc=TAt();Object.defineProperty(As,"Clean",{enumerable:!0,get:a(function(){return xtc.Clean},"get")});var wtc=mD();Object.defineProperty(As,"Clone",{enumerable:!0,get:a(function(){return wtc.Clone},"get")});var Rtc=xAt();Object.defineProperty(As,"Convert",{enumerable:!0,get:a(function(){return Rtc.Convert},"get")});var ktc=_At();Object.defineProperty(As,"Create",{enumerable:!0,get:a(function(){return ktc.Create},"get")});var Ptc=_xr();Object.defineProperty(As,"Decode",{enumerable:!0,get:a(function(){return Ptc.Decode},"get")});var Dtc=kAt();Object.defineProperty(As,"Default",{enumerable:!0,get:a(function(){return Dtc.Default},"get")});var qxr=Pxr();Object.defineProperty(As,"Diff",{enumerable:!0,get:a(function(){return qxr.Diff},"get")});Object.defineProperty(As,"Patch",{enumerable:!0,get:a(function(){return qxr.Patch},"get")});Object.defineProperty(As,"Edit",{enumerable:!0,get:a(function(){return qxr.Edit},"get")});var Ntc=Mxr();Object.defineProperty(As,"Encode",{enumerable:!0,get:a(function(){return Ntc.Encode},"get")});var Mtc=Oxr();Object.defineProperty(As,"Equal",{enumerable:!0,get:a(function(){return Mtc.Equal},"get")});var Otc=A5e();Object.defineProperty(As,"Hash",{enumerable:!0,get:a(function(){return Otc.Hash},"get")});var Btc=Fxr();Object.defineProperty(As,"Mutate",{enumerable:!0,get:a(function(){return Btc.Mutate},"get")});var Ltc=Qxr();Object.defineProperty(As,"Parse",{enumerable:!0,get:a(function(){return Ltc.Parse},"get")})});var O2i=I(P4=>{"use strict";p();var Ftc=P4&&P4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Utc=P4&&P4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Qtc=P4&&P4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var qtc=Hc&&Hc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Mg=Hc&&Hc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qtc(e,t,r)};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.Value=Hc.ValueErrorIterator=Hc.ValueErrorType=void 0;var B2i=_ge();Object.defineProperty(Hc,"ValueErrorType",{enumerable:!0,get:a(function(){return B2i.ValueErrorType},"get")});Object.defineProperty(Hc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return B2i.ValueErrorIterator},"get")});Mg(pm(),Hc);Mg(EAt(),Hc);Mg(vAt(),Hc);Mg(FT(),Hc);Mg(TAt(),Hc);Mg(mD(),Hc);Mg(xAt(),Hc);Mg(_At(),Hc);Mg(_xr(),Hc);Mg(kAt(),Hc);Mg(Pxr(),Hc);Mg(Mxr(),Hc);Mg(Oxr(),Hc);Mg(A5e(),Hc);Mg(Fxr(),Hc);Mg(Qxr(),Hc);Mg(NAt(),Hc);Mg(P5e(),Hc);var jtc=O2i();Object.defineProperty(Hc,"Value",{enumerable:!0,get:a(function(){return jtc.Value},"get")})});var F2i=I(QAt=>{"use strict";p();Object.defineProperty(QAt,"__esModule",{value:!0});QAt.assertShape=void 0;var L2i=jxr(),Htc=a((t,e)=>{if(L2i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...L2i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");QAt.assertShape=Htc});var vre={};wi(vre,{CAPIClient:()=>Ytc,RequestType:()=>Q2i});async function Wtc(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function ztc(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var Gtc,Hxr,L5e,$tc,Vtc,Q2i,Ytc,bre=me(()=>{p();Gtc=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},Hxr=class U2i{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||U2i.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};Hxr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",Hxr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";L5e=Hxr,$tc=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(lWa,"applyEditsForNotebook");function uWa(t,e,r){let n=t.get(tWa.ICompletionsFeaturesService),s=n.maxPromptCompletionTokens(e)-(0,rWa.getMaxSolutionTokens)(),c=(0,Oki.getNumberOfSnippets)(e,r),l=(0,Oki.getSimilarFilesOptions)(t,e,r),u=n.suffixPercent(e),d=n.suffixMatchThreshold(e);if(u<0||u>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${u}`);if(d<0||d>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${d}`);return{maxPromptLength:s,similarFilesOptions:l,numberOfSnippets:c,suffixPercent:u,suffixMatchThreshold:d}}a(uWa,"getPromptOptions")});var Uki=I(LG=>{"use strict";p();Object.defineProperty(LG,"__esModule",{value:!0});LG.TypeSystem=LG.TypeSystemDuplicateFormat=LG.TypeSystemDuplicateTypeKind=void 0;var nAt=lme(),dWa=pOe(),fWa=_n(),Fki=Sf(),iAt=class extends Fki.TypeBoxError{static{a(this,"TypeSystemDuplicateTypeKind")}constructor(e){super(`Duplicate type kind '${e}' detected`)}};LG.TypeSystemDuplicateTypeKind=iAt;var oAt=class extends Fki.TypeBoxError{static{a(this,"TypeSystemDuplicateFormat")}constructor(e){super(`Duplicate string format '${e}' detected`)}};LG.TypeSystemDuplicateFormat=oAt;var Lki;(function(t){function e(n,o){if(nAt.TypeRegistry.Has(n))throw new iAt(n);return nAt.TypeRegistry.Set(n,o),(s={})=>(0,dWa.Unsafe)({...s,[fWa.Kind]:n})}a(e,"Type"),t.Type=e;function r(n,o){if(nAt.FormatRegistry.Has(n))throw new oAt(n);return nAt.FormatRegistry.Set(n,o),n}a(r,"Format"),t.Format=r})(Lki||(LG.TypeSystem=Lki={}))});var zIr=I(FG=>{"use strict";p();var pWa=FG&&FG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Qki=FG&&FG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pWa(e,t,r)};Object.defineProperty(FG,"__esModule",{value:!0});Qki(OMe(),FG);Qki(Uki(),FG)});var YIr=I(n5e=>{"use strict";p();Object.defineProperty(n5e,"__esModule",{value:!0});n5e.DefaultErrorFunction=qki;n5e.SetErrorFunction=mWa;n5e.GetErrorFunction=gWa;var hWa=_n(),Qn=KIr();function qki(t){switch(t.errorType){case Qn.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case Qn.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Qn.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Qn.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Qn.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Qn.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case Qn.ValueErrorType.Array:return"Expected array";case Qn.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case Qn.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Qn.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Qn.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Qn.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Qn.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Qn.ValueErrorType.BigInt:return"Expected bigint";case Qn.ValueErrorType.Boolean:return"Expected boolean";case Qn.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Qn.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Qn.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Qn.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Qn.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Qn.ValueErrorType.Date:return"Expected Date";case Qn.ValueErrorType.Function:return"Expected function";case Qn.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Qn.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Qn.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Qn.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Qn.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Qn.ValueErrorType.Integer:return"Expected integer";case Qn.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case Qn.ValueErrorType.Intersect:return"Expected all values to match";case Qn.ValueErrorType.Iterator:return"Expected Iterator";case Qn.ValueErrorType.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Qn.ValueErrorType.Never:return"Never";case Qn.ValueErrorType.Not:return"Value should not match";case Qn.ValueErrorType.Null:return"Expected null";case Qn.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Qn.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Qn.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Qn.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Qn.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Qn.ValueErrorType.Number:return"Expected number";case Qn.ValueErrorType.Object:return"Expected object";case Qn.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case Qn.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Qn.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Qn.ValueErrorType.ObjectRequiredProperty:return"Expected required property";case Qn.ValueErrorType.Promise:return"Expected Promise";case Qn.ValueErrorType.RegExp:return"Expected string to match regular expression";case Qn.ValueErrorType.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Qn.ValueErrorType.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Qn.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Qn.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Qn.ValueErrorType.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Qn.ValueErrorType.String:return"Expected string";case Qn.ValueErrorType.Symbol:return"Expected symbol";case Qn.ValueErrorType.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Qn.ValueErrorType.Tuple:return"Expected tuple";case Qn.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Qn.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Qn.ValueErrorType.Uint8Array:return"Expected Uint8Array";case Qn.ValueErrorType.Undefined:return"Expected undefined";case Qn.ValueErrorType.Union:return"Expected union value";case Qn.ValueErrorType.Void:return"Expected void";case Qn.ValueErrorType.Kind:return`Expected kind '${t.schema[hWa.Kind]}'`;default:return"Unknown error type"}}a(qki,"DefaultErrorFunction");var jki=qki;function mWa(t){jki=t}a(mWa,"SetErrorFunction");function gWa(){return jki}a(gWa,"GetErrorFunction")});var $ki=I(cge=>{"use strict";p();Object.defineProperty(cge,"__esModule",{value:!0});cge.TypeDereferenceError=void 0;cge.Pushref=_Wa;cge.Deref=Gki;var AWa=Sf(),Hki=_n(),yWa=m0t(),sAt=class extends AWa.TypeBoxError{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};cge.TypeDereferenceError=sAt;function EWa(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new sAt(t);return Gki(r,e)}a(EWa,"Resolve");function _Wa(t,e){return!(0,yWa.IsString)(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(_Wa,"Pushref");function Gki(t,e){return t[Hki.Kind]==="This"||t[Hki.Kind]==="Ref"?EWa(t,e):t}a(Gki,"Deref")});var uD=I(Jte=>{"use strict";p();var vWa=Jte&&Jte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),CWa=Jte&&Jte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vWa(e,t,r)};Object.defineProperty(Jte,"__esModule",{value:!0});CWa($ki(),Jte)});var Yki=I(i5e=>{"use strict";p();Object.defineProperty(i5e,"__esModule",{value:!0});i5e.ValueHashError=void 0;i5e.Hash=UWa;var dD=mm(),bWa=Sf(),aAt=class extends bWa.TypeBoxError{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}};i5e.ValueHashError=aAt;var NT;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(NT||(NT={}));var lge=BigInt("14695981039346656037"),[SWa,TWa]=[BigInt("1099511628211"),BigInt("18446744073709551616")],IWa=Array.from({length:256}).map((t,e)=>BigInt(e)),Vki=new Float64Array(1),Wki=new DataView(Vki.buffer),zki=new Uint8Array(Vki.buffer);function*xWa(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(xWa,"NumberToBytes");function wWa(t){xE(NT.Array);for(let e of t)uge(e)}a(wWa,"ArrayType");function RWa(t){xE(NT.Boolean),xE(t?1:0)}a(RWa,"BooleanType");function PWa(t){xE(NT.BigInt),Wki.setBigInt64(0,t);for(let e of zki)xE(e)}a(PWa,"BigIntType");function kWa(t){xE(NT.Date),uge(t.getTime())}a(kWa,"DateType");function DWa(t){xE(NT.Null)}a(DWa,"NullType");function NWa(t){xE(NT.Number),Wki.setFloat64(0,t);for(let e of zki)xE(e)}a(NWa,"NumberType");function MWa(t){xE(NT.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())uge(e),uge(t[e])}a(MWa,"ObjectType");function OWa(t){xE(NT.String);for(let e=0;e{"use strict";p();var QWa=Zte&&Zte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qWa=Zte&&Zte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&QWa(e,t,r)};Object.defineProperty(Zte,"__esModule",{value:!0});qWa(Yki(),Zte)});var ZIr=I(c5e=>{"use strict";p();Object.defineProperty(c5e,"__esModule",{value:!0});c5e.ValueCheckUnknownTypeError=void 0;c5e.Check=wza;var s5e=zIr(),JIr=uD(),jWa=o5e(),dge=_n(),Kki=U2(),HWa=ate(),a5e=lme(),GWa=Sf(),$Wa=f0(),g0=mm(),VWa=ms(),cAt=class extends GWa.TypeBoxError{static{a(this,"ValueCheckUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};c5e.ValueCheckUnknownTypeError=cAt;function WWa(t){return t[dge.Kind]==="Any"||t[dge.Kind]==="Unknown"}a(WWa,"IsAnyOrUnknown");function Js(t){return t!==void 0}a(Js,"IsDefined");function zWa(t,e,r){return!0}a(zWa,"FromAny");function YWa(t,e,r){return!0}a(YWa,"FromArgument");function KWa(t,e,r){if(!(0,g0.IsArray)(r)||Js(t.minItems)&&!(r.length>=t.minItems)||Js(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Ng(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=(0,jWa.Hash)(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(Js(t.contains)||(0,g0.IsNumber)(t.minContains)||(0,g0.IsNumber)(t.maxContains)))return!0;let n=Js(t.contains)?t.contains:(0,$Wa.Never)(),o=r.reduce((s,c)=>Ng(n,e,c)?s+1:s,0);return!(o===0||(0,g0.IsNumber)(t.minContains)&&ot.maxContains)}a(KWa,"FromArray");function JWa(t,e,r){return(0,g0.IsAsyncIterator)(r)}a(JWa,"FromAsyncIterator");function ZWa(t,e,r){return!(!(0,g0.IsBigInt)(r)||Js(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Js(t.maximum)&&!(r<=t.maximum)||Js(t.minimum)&&!(r>=t.minimum)||Js(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(ZWa,"FromBigInt");function XWa(t,e,r){return(0,g0.IsBoolean)(r)}a(XWa,"FromBoolean");function eza(t,e,r){return Ng(t.returns,e,r.prototype)}a(eza,"FromConstructor");function tza(t,e,r){return!(!(0,g0.IsDate)(r)||Js(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||Js(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||Js(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||Js(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(tza,"FromDate");function rza(t,e,r){return(0,g0.IsFunction)(r)}a(rza,"FromFunction");function nza(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Ng(o,[...e,...n],r)}a(nza,"FromImport");function iza(t,e,r){return!(!(0,g0.IsInteger)(r)||Js(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Js(t.maximum)&&!(r<=t.maximum)||Js(t.minimum)&&!(r>=t.minimum)||Js(t.multipleOf)&&r%t.multipleOf!==0)}a(iza,"FromInteger");function oza(t,e,r){let n=t.allOf.every(o=>Ng(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp((0,Kki.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if((0,VWa.IsSchema)(t.unevaluatedProperties)){let o=new RegExp((0,Kki.KeyOfPattern)(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Ng(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(oza,"FromIntersect");function sza(t,e,r){return(0,g0.IsIterator)(r)}a(sza,"FromIterator");function aza(t,e,r){return r===t.const}a(aza,"FromLiteral");function cza(t,e,r){return!1}a(cza,"FromNever");function lza(t,e,r){return!Ng(t.not,e,r)}a(lza,"FromNot");function uza(t,e,r){return(0,g0.IsNull)(r)}a(uza,"FromNull");function dza(t,e,r){return!(!s5e.TypeSystemPolicy.IsNumberLike(r)||Js(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Js(t.minimum)&&!(r>=t.minimum)||Js(t.maximum)&&!(r<=t.maximum)||Js(t.multipleOf)&&r%t.multipleOf!==0)}a(dza,"FromNumber");function fza(t,e,r){if(!s5e.TypeSystemPolicy.IsObjectLike(r)||Js(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Js(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Ng(s,e,r[o])||((0,HWa.ExtendsUndefinedCheck)(s)||WWa(s))&&!(o in r))return!1}else if(s5e.TypeSystemPolicy.IsExactOptionalProperty(r,o)&&!Ng(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Ng(t.additionalProperties,e,r[s])):!0}a(fza,"FromObject");function pza(t,e,r){return(0,g0.IsPromise)(r)}a(pza,"FromPromise");function hza(t,e,r){if(!s5e.TypeSystemPolicy.IsRecordLike(r)||Js(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Js(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Ng(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Ng(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(hza,"FromRecord");function mza(t,e,r){return Ng((0,JIr.Deref)(t,e),e,r)}a(mza,"FromRef");function gza(t,e,r){let n=new RegExp(t.source,t.flags);return Js(t.minLength)&&!(r.length>=t.minLength)||Js(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(gza,"FromRegExp");function Aza(t,e,r){return!(0,g0.IsString)(r)||Js(t.minLength)&&!(r.length>=t.minLength)||Js(t.maxLength)&&!(r.length<=t.maxLength)||Js(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:Js(t.format)?a5e.FormatRegistry.Has(t.format)?a5e.FormatRegistry.Get(t.format)(r):!1:!0}a(Aza,"FromString");function yza(t,e,r){return(0,g0.IsSymbol)(r)}a(yza,"FromSymbol");function Eza(t,e,r){return(0,g0.IsString)(r)&&new RegExp(t.pattern).test(r)}a(Eza,"FromTemplateLiteral");function _za(t,e,r){return Ng((0,JIr.Deref)(t,e),e,r)}a(_za,"FromThis");function vza(t,e,r){if(!(0,g0.IsArray)(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nNg(n,e,r))}a(bza,"FromUnion");function Sza(t,e,r){return!(!(0,g0.IsUint8Array)(r)||Js(t.maxByteLength)&&!(r.length<=t.maxByteLength)||Js(t.minByteLength)&&!(r.length>=t.minByteLength))}a(Sza,"FromUint8Array");function Tza(t,e,r){return!0}a(Tza,"FromUnknown");function Iza(t,e,r){return s5e.TypeSystemPolicy.IsVoidLike(r)}a(Iza,"FromVoid");function xza(t,e,r){return a5e.TypeRegistry.Has(t[dge.Kind])?a5e.TypeRegistry.Get(t[dge.Kind])(t,r):!1}a(xza,"FromKind");function Ng(t,e,r){let n=Js(t.$id)?(0,JIr.Pushref)(t,e):e,o=t;switch(o[dge.Kind]){case"Any":return zWa(o,n,r);case"Argument":return YWa(o,n,r);case"Array":return KWa(o,n,r);case"AsyncIterator":return JWa(o,n,r);case"BigInt":return ZWa(o,n,r);case"Boolean":return XWa(o,n,r);case"Constructor":return eza(o,n,r);case"Date":return tza(o,n,r);case"Function":return rza(o,n,r);case"Import":return nza(o,n,r);case"Integer":return iza(o,n,r);case"Intersect":return oza(o,n,r);case"Iterator":return sza(o,n,r);case"Literal":return aza(o,n,r);case"Never":return cza(o,n,r);case"Not":return lza(o,n,r);case"Null":return uza(o,n,r);case"Number":return dza(o,n,r);case"Object":return fza(o,n,r);case"Promise":return pza(o,n,r);case"Record":return hza(o,n,r);case"Ref":return mza(o,n,r);case"RegExp":return gza(o,n,r);case"String":return Aza(o,n,r);case"Symbol":return yza(o,n,r);case"TemplateLiteral":return Eza(o,n,r);case"This":return _za(o,n,r);case"Tuple":return vza(o,n,r);case"Undefined":return Cza(o,n,r);case"Union":return bza(o,n,r);case"Uint8Array":return Sza(o,n,r);case"Unknown":return Tza(o,n,r);case"Void":return Iza(o,n,r);default:if(!a5e.TypeRegistry.Has(o[dge.Kind]))throw new cAt(o);return xza(o,n,r)}}a(Ng,"Visit");function wza(...t){return t.length===3?Ng(t[0],t[1],t[2]):Ng(t[0],[],t[1])}a(wza,"Check")});var MT=I(Xte=>{"use strict";p();var Rza=Xte&&Xte.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Pza=Xte&&Xte.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Rza(e,t,r)};Object.defineProperty(Xte,"__esModule",{value:!0});Pza(ZIr(),Xte)});var KIr=I(z8=>{"use strict";p();Object.defineProperty(z8,"__esModule",{value:!0});z8.ValueErrorIterator=z8.ValueErrorsUnknownTypeError=z8.ValueErrorType=void 0;z8.Errors=AYa;var l5e=zIr(),Jki=U2(),lAt=lme(),kza=Pvr(),Dza=YIr(),Nza=Sf(),Zki=uD(),Mza=o5e(),Oza=MT(),XIr=_n(),Bza=f0(),ah=mm(),en;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(en||(z8.ValueErrorType=en={}));var uAt=class extends Nza.TypeBoxError{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};z8.ValueErrorsUnknownTypeError=uAt;function W8(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(W8,"EscapeKey");function Zs(t){return t!==void 0}a(Zs,"IsDefined");var u5e=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};z8.ValueErrorIterator=u5e;function sn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:(0,Dza.GetErrorFunction)()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(sn,"Create");function*Lza(t,e,r,n){}a(Lza,"FromAny");function*Fza(t,e,r,n){}a(Fza,"FromArgument");function*Uza(t,e,r,n){if(!(0,ah.IsArray)(n))return yield sn(en.Array,t,r,n);Zs(t.minItems)&&!(n.length>=t.minItems)&&(yield sn(en.ArrayMinItems,t,r,n)),Zs(t.maxItems)&&!(n.length<=t.maxItems)&&(yield sn(en.ArrayMaxItems,t,r,n));for(let c=0;cMg(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield sn(en.ArrayContains,t,r,n)),(0,ah.IsNumber)(t.minContains)&&st.maxContains&&(yield sn(en.ArrayMaxContains,t,r,n))}a(Uza,"FromArray");function*Qza(t,e,r,n){(0,ah.IsAsyncIterator)(n)||(yield sn(en.AsyncIterator,t,r,n))}a(Qza,"FromAsyncIterator");function*qza(t,e,r,n){if(!(0,ah.IsBigInt)(n))return yield sn(en.BigInt,t,r,n);Zs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.BigIntExclusiveMinimum,t,r,n)),Zs(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.BigIntMaximum,t,r,n)),Zs(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.BigIntMinimum,t,r,n)),Zs(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield sn(en.BigIntMultipleOf,t,r,n))}a(qza,"FromBigInt");function*jza(t,e,r,n){(0,ah.IsBoolean)(n)||(yield sn(en.Boolean,t,r,n))}a(jza,"FromBoolean");function*Hza(t,e,r,n){yield*Mg(t.returns,e,r,n.prototype)}a(Hza,"FromConstructor");function*Gza(t,e,r,n){if(!(0,ah.IsDate)(n))return yield sn(en.Date,t,r,n);Zs(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield sn(en.DateExclusiveMinimumTimestamp,t,r,n)),Zs(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield sn(en.DateMaximumTimestamp,t,r,n)),Zs(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield sn(en.DateMinimumTimestamp,t,r,n)),Zs(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield sn(en.DateMultipleOfTimestamp,t,r,n))}a(Gza,"FromDate");function*$za(t,e,r,n){(0,ah.IsFunction)(n)||(yield sn(en.Function,t,r,n))}a($za,"FromFunction");function*Vza(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Mg(s,[...e,...o],r,n)}a(Vza,"FromImport");function*Wza(t,e,r,n){if(!(0,ah.IsInteger)(n))return yield sn(en.Integer,t,r,n);Zs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.IntegerExclusiveMinimum,t,r,n)),Zs(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.IntegerMaximum,t,r,n)),Zs(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.IntegerMinimum,t,r,n)),Zs(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(en.IntegerMultipleOf,t,r,n))}a(Wza,"FromInteger");function*zza(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Mg(s,e,r,n))o=!0,yield c;if(o)return yield sn(en.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp((0,Jki.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield sn(en.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp((0,Jki.KeyOfPattern)(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Mg(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(zza,"FromIntersect");function*Yza(t,e,r,n){(0,ah.IsIterator)(n)||(yield sn(en.Iterator,t,r,n))}a(Yza,"FromIterator");function*Kza(t,e,r,n){n!==t.const&&(yield sn(en.Literal,t,r,n))}a(Kza,"FromLiteral");function*Jza(t,e,r,n){yield sn(en.Never,t,r,n)}a(Jza,"FromNever");function*Zza(t,e,r,n){Mg(t.not,e,r,n).next().done===!0&&(yield sn(en.Not,t,r,n))}a(Zza,"FromNot");function*Xza(t,e,r,n){(0,ah.IsNull)(n)||(yield sn(en.Null,t,r,n))}a(Xza,"FromNull");function*eYa(t,e,r,n){if(!l5e.TypeSystemPolicy.IsNumberLike(n))return yield sn(en.Number,t,r,n);Zs(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield sn(en.NumberExclusiveMinimum,t,r,n)),Zs(t.maximum)&&!(n<=t.maximum)&&(yield sn(en.NumberMaximum,t,r,n)),Zs(t.minimum)&&!(n>=t.minimum)&&(yield sn(en.NumberMinimum,t,r,n)),Zs(t.multipleOf)&&n%t.multipleOf!==0&&(yield sn(en.NumberMultipleOf,t,r,n))}a(eYa,"FromNumber");function*tYa(t,e,r,n){if(!l5e.TypeSystemPolicy.IsObjectLike(n))return yield sn(en.Object,t,r,n);Zs(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(en.ObjectMinProperties,t,r,n)),Zs(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(en.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield sn(en.ObjectRequiredProperty,t.properties[l],`${r}/${W8(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield sn(en.ObjectAdditionalProperties,t,`${r}/${W8(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Mg(t.additionalProperties,e,`${r}/${W8(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Mg(u,e,`${r}/${W8(l)}`,n[l]),(0,kza.ExtendsUndefinedCheck)(t)&&!(l in n)&&(yield sn(en.ObjectRequiredProperty,u,`${r}/${W8(l)}`,void 0))):l5e.TypeSystemPolicy.IsExactOptionalProperty(n,l)&&(yield*Mg(u,e,`${r}/${W8(l)}`,n[l]))}}a(tYa,"FromObject");function*rYa(t,e,r,n){(0,ah.IsPromise)(n)||(yield sn(en.Promise,t,r,n))}a(rYa,"FromPromise");function*nYa(t,e,r,n){if(!l5e.TypeSystemPolicy.IsRecordLike(n))return yield sn(en.Object,t,r,n);Zs(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield sn(en.ObjectMinProperties,t,r,n)),Zs(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield sn(en.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*Mg(s,e,`${r}/${W8(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Mg(t.additionalProperties,e,`${r}/${W8(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield sn(en.ObjectAdditionalProperties,t,`${r}/${W8(l)}`,u)}}a(nYa,"FromRecord");function*iYa(t,e,r,n){yield*Mg((0,Zki.Deref)(t,e),e,r,n)}a(iYa,"FromRef");function*oYa(t,e,r,n){if(!(0,ah.IsString)(n))return yield sn(en.String,t,r,n);if(Zs(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(en.StringMinLength,t,r,n)),Zs(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(en.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield sn(en.RegExp,t,r,n)}a(oYa,"FromRegExp");function*sYa(t,e,r,n){if(!(0,ah.IsString)(n))return yield sn(en.String,t,r,n);Zs(t.minLength)&&!(n.length>=t.minLength)&&(yield sn(en.StringMinLength,t,r,n)),Zs(t.maxLength)&&!(n.length<=t.maxLength)&&(yield sn(en.StringMaxLength,t,r,n)),(0,ah.IsString)(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield sn(en.StringPattern,t,r,n))),(0,ah.IsString)(t.format)&&(lAt.FormatRegistry.Has(t.format)?lAt.FormatRegistry.Get(t.format)(n)||(yield sn(en.StringFormat,t,r,n)):yield sn(en.StringFormatUnknown,t,r,n))}a(sYa,"FromString");function*aYa(t,e,r,n){(0,ah.IsSymbol)(n)||(yield sn(en.Symbol,t,r,n))}a(aYa,"FromSymbol");function*cYa(t,e,r,n){if(!(0,ah.IsString)(n))return yield sn(en.String,t,r,n);new RegExp(t.pattern).test(n)||(yield sn(en.StringPattern,t,r,n))}a(cYa,"FromTemplateLiteral");function*lYa(t,e,r,n){yield*Mg((0,Zki.Deref)(t,e),e,r,n)}a(lYa,"FromThis");function*uYa(t,e,r,n){if(!(0,ah.IsArray)(n))return yield sn(en.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield sn(en.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield sn(en.TupleLength,t,r,n);if(t.items)for(let o=0;onew u5e(Mg(s,e,r,n)));yield sn(en.Union,t,r,n,o)}a(fYa,"FromUnion");function*pYa(t,e,r,n){if(!(0,ah.IsUint8Array)(n))return yield sn(en.Uint8Array,t,r,n);Zs(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield sn(en.Uint8ArrayMaxByteLength,t,r,n)),Zs(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield sn(en.Uint8ArrayMinByteLength,t,r,n))}a(pYa,"FromUint8Array");function*hYa(t,e,r,n){}a(hYa,"FromUnknown");function*mYa(t,e,r,n){l5e.TypeSystemPolicy.IsVoidLike(n)||(yield sn(en.Void,t,r,n))}a(mYa,"FromVoid");function*gYa(t,e,r,n){lAt.TypeRegistry.Get(t[XIr.Kind])(t,n)||(yield sn(en.Kind,t,r,n))}a(gYa,"FromKind");function*Mg(t,e,r,n){let o=Zs(t.$id)?[...e,t]:e,s=t;switch(s[XIr.Kind]){case"Any":return yield*Lza(s,o,r,n);case"Argument":return yield*Fza(s,o,r,n);case"Array":return yield*Uza(s,o,r,n);case"AsyncIterator":return yield*Qza(s,o,r,n);case"BigInt":return yield*qza(s,o,r,n);case"Boolean":return yield*jza(s,o,r,n);case"Constructor":return yield*Hza(s,o,r,n);case"Date":return yield*Gza(s,o,r,n);case"Function":return yield*$za(s,o,r,n);case"Import":return yield*Vza(s,o,r,n);case"Integer":return yield*Wza(s,o,r,n);case"Intersect":return yield*zza(s,o,r,n);case"Iterator":return yield*Yza(s,o,r,n);case"Literal":return yield*Kza(s,o,r,n);case"Never":return yield*Jza(s,o,r,n);case"Not":return yield*Zza(s,o,r,n);case"Null":return yield*Xza(s,o,r,n);case"Number":return yield*eYa(s,o,r,n);case"Object":return yield*tYa(s,o,r,n);case"Promise":return yield*rYa(s,o,r,n);case"Record":return yield*nYa(s,o,r,n);case"Ref":return yield*iYa(s,o,r,n);case"RegExp":return yield*oYa(s,o,r,n);case"String":return yield*sYa(s,o,r,n);case"Symbol":return yield*aYa(s,o,r,n);case"TemplateLiteral":return yield*cYa(s,o,r,n);case"This":return yield*lYa(s,o,r,n);case"Tuple":return yield*uYa(s,o,r,n);case"Undefined":return yield*dYa(s,o,r,n);case"Union":return yield*fYa(s,o,r,n);case"Uint8Array":return yield*pYa(s,o,r,n);case"Unknown":return yield*hYa(s,o,r,n);case"Void":return yield*mYa(s,o,r,n);default:if(!lAt.TypeRegistry.Has(s[XIr.Kind]))throw new uAt(t);return yield*gYa(s,o,r,n)}}a(Mg,"Visit");function AYa(...t){let e=t.length===3?Mg(t[0],t[1],"",t[2]):Mg(t[0],[],"",t[1]);return new u5e(e)}a(AYa,"Errors")});var fge=I(UG=>{"use strict";p();var yYa=UG&&UG.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Xki=UG&&UG.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yYa(e,t,r)};Object.defineProperty(UG,"__esModule",{value:!0});Xki(KIr(),UG);Xki(YIr(),UG)});var i2i=I(Y8=>{"use strict";p();var EYa=Y8&&Y8.__classPrivateFieldSet||function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},t2i=Y8&&Y8.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},exr,dAt,r2i;Object.defineProperty(Y8,"__esModule",{value:!0});Y8.AssertError=void 0;Y8.Assert=CYa;var n2i=fge(),_Ya=NEr(),vYa=ZIr(),fAt=class extends _Ya.TypeBoxError{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),exr.add(this),dAt.set(this,void 0),EYa(this,dAt,e,"f"),this.error=r}Errors(){return new n2i.ValueErrorIterator(t2i(this,exr,"m",r2i).call(this))}};Y8.AssertError=fAt;dAt=new WeakMap,exr=new WeakSet,r2i=a(function*(){this.error&&(yield this.error),yield*t2i(this,dAt,"f")},"_AssertError_Iterator");function e2i(t,e,r){if(!(0,vYa.Check)(t,e,r))throw new fAt((0,n2i.Errors)(t,e,r))}a(e2i,"AssertValue");function CYa(...t){return t.length===3?e2i(t[0],t[1],t[2]):e2i(t[0],[],t[1])}a(CYa,"Assert")});var pAt=I(ere=>{"use strict";p();var bYa=ere&&ere.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),SYa=ere&&ere.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bYa(e,t,r)};Object.defineProperty(ere,"__esModule",{value:!0});SYa(i2i(),ere)});var o2i=I(txr=>{"use strict";p();Object.defineProperty(txr,"__esModule",{value:!0});txr.Clone=pge;var tre=mm();function TYa(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=pge(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=pge(t[r]);return e}a(TYa,"FromObject");function IYa(t){return t.map(e=>pge(e))}a(IYa,"FromArray");function xYa(t){return t.slice()}a(xYa,"FromTypedArray");function wYa(t){return new Map(pge([...t.entries()]))}a(wYa,"FromMap");function RYa(t){return new Set(pge([...t.entries()]))}a(RYa,"FromSet");function PYa(t){return new Date(t.toISOString())}a(PYa,"FromDate");function pge(t){if((0,tre.IsArray)(t))return IYa(t);if((0,tre.IsDate)(t))return PYa(t);if((0,tre.IsTypedArray)(t))return xYa(t);if((0,tre.IsMap)(t))return wYa(t);if((0,tre.IsSet)(t))return RYa(t);if((0,tre.IsObject)(t))return TYa(t);if((0,tre.IsValueType)(t))return t;throw new Error("ValueClone: Unable to clone value")}a(pge,"Clone")});var fD=I(rre=>{"use strict";p();var kYa=rre&&rre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),DYa=rre&&rre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kYa(e,t,r)};Object.defineProperty(rre,"__esModule",{value:!0});DYa(o2i(),rre)});var l2i=I(d5e=>{"use strict";p();Object.defineProperty(d5e,"__esModule",{value:!0});d5e.ValueCreateError=void 0;d5e.Create=EKa;var Na=mm(),NYa=MT(),MYa=fD(),rxr=uD(),s2i=L2(),OYa=lme(),a2i=_n(),BYa=Sf(),LYa=m0t(),Wb=class extends BYa.TypeBoxError{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};d5e.ValueCreateError=Wb;function Ka(t){return(0,LYa.IsFunction)(t)?t():(0,MYa.Clone)(t)}a(Ka,"FromDefault");function FYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):{}}a(FYa,"FromAny");function UYa(t,e){return{}}a(UYa,"FromArgument");function QYa(t,e){if(t.uniqueItems===!0&&!(0,Na.HasPropertyKey)(t,"default"))throw new Wb(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!(0,Na.HasPropertyKey)(t,"default"))throw new Wb(t,"Array with the contains constraint requires a default value");return"default"in t?Ka(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>OT(t.items,e)):[]}a(QYa,"FromArray");function qYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):(async function*(){})()}a(qYa,"FromAsyncIterator");function jYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):BigInt(0)}a(jYa,"FromBigInt");function HYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):!1}a(HYa,"FromBoolean");function GYa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);{let r=OT(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(GYa,"FromConstructor");function $Ya(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a($Ya,"FromDate");function VYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):()=>OT(t.returns,e)}a(VYa,"FromFunction");function WYa(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return OT(n,[...e,...r])}a(WYa,"FromImport");function zYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.minimum!==void 0?t.minimum:0}a(zYa,"FromInteger");function YYa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);{let r=t.allOf.reduce((n,o)=>{let s=OT(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!(0,NYa.Check)(t,e,r))throw new Wb(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(YYa,"FromIntersect");function KYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):(function*(){})()}a(KYa,"FromIterator");function JYa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.const}a(JYa,"FromLiteral");function ZYa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Wb(t,"Never types cannot be created. Consider using a default value.")}a(ZYa,"FromNever");function XYa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Wb(t,"Not types must have a default value")}a(XYa,"FromNot");function eKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):null}a(eKa,"FromNull");function tKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.minimum!==void 0?t.minimum:0}a(tKa,"FromNumber");function rKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=OT(s,e));return n}}a(rKa,"FromObject");function nKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):Promise.resolve(OT(t.item,e))}a(nKa,"FromPromise");function iKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):{}}a(iKa,"FromRecord");function oKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):OT((0,rxr.Deref)(t,e),e)}a(oKa,"FromRef");function sKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Wb(t,"RegExp types cannot be created. Consider using a default value.")}a(sKa,"FromRegExp");function aKa(t,e){if(t.pattern!==void 0){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Wb(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Wb(t,"String types with formats must specify a default value")}else return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(aKa,"FromString");function cKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(cKa,"FromSymbol");function lKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);if(!(0,s2i.IsTemplateLiteralFinite)(t))throw new Wb(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return(0,s2i.TemplateLiteralGenerate)(t)[0]}a(lKa,"FromTemplateLiteral");function uKa(t,e){if(c2i++>yKa)throw new Wb(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):OT((0,rxr.Deref)(t,e),e)}a(uKa,"FromThis");function dKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>OT(t.items[n],e))}a(dKa,"FromTuple");function fKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default)}a(fKa,"FromUndefined");function pKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return OT(t.anyOf[0],e)}a(pKa,"FromUnion");function hKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(hKa,"FromUint8Array");function mKa(t,e){return(0,Na.HasPropertyKey)(t,"default")?Ka(t.default):{}}a(mKa,"FromUnknown");function gKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default)}a(gKa,"FromVoid");function AKa(t,e){if((0,Na.HasPropertyKey)(t,"default"))return Ka(t.default);throw new Error("User defined types must specify a default value")}a(AKa,"FromKind");function OT(t,e){let r=(0,rxr.Pushref)(t,e),n=t;switch(n[a2i.Kind]){case"Any":return FYa(n,r);case"Argument":return UYa(n,r);case"Array":return QYa(n,r);case"AsyncIterator":return qYa(n,r);case"BigInt":return jYa(n,r);case"Boolean":return HYa(n,r);case"Constructor":return GYa(n,r);case"Date":return $Ya(n,r);case"Function":return VYa(n,r);case"Import":return WYa(n,r);case"Integer":return zYa(n,r);case"Intersect":return YYa(n,r);case"Iterator":return KYa(n,r);case"Literal":return JYa(n,r);case"Never":return ZYa(n,r);case"Not":return XYa(n,r);case"Null":return eKa(n,r);case"Number":return tKa(n,r);case"Object":return rKa(n,r);case"Promise":return nKa(n,r);case"Record":return iKa(n,r);case"Ref":return oKa(n,r);case"RegExp":return sKa(n,r);case"String":return aKa(n,r);case"Symbol":return cKa(n,r);case"TemplateLiteral":return lKa(n,r);case"This":return uKa(n,r);case"Tuple":return dKa(n,r);case"Undefined":return fKa(n,r);case"Union":return pKa(n,r);case"Uint8Array":return hKa(n,r);case"Unknown":return mKa(n,r);case"Void":return gKa(n,r);default:if(!OYa.TypeRegistry.Has(n[a2i.Kind]))throw new Wb(n,"Unknown type");return AKa(n,r)}}a(OT,"Visit");var yKa=512,c2i=0;function EKa(...t){return c2i=0,t.length===2?OT(t[0],t[1]):OT(t[0],[])}a(EKa,"Create")});var hAt=I(nre=>{"use strict";p();var _Ka=nre&&nre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vKa=nre&&nre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Ka(e,t,r)};Object.defineProperty(nre,"__esModule",{value:!0});vKa(l2i(),nre)});var p2i=I(h5e=>{"use strict";p();Object.defineProperty(h5e,"__esModule",{value:!0});h5e.ValueCastError=void 0;h5e.Cast=f2i;var hR=mm(),CKa=Sf(),mAt=_n(),QG=hAt(),BT=MT(),ire=fD(),p5e=uD(),f5e=class extends CKa.TypeBoxError{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};h5e.ValueCastError=f5e;function u2i(t,e,r){if(t[mAt.Kind]==="Object"&&typeof r=="object"&&!(0,hR.IsNull)(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[mAt.Kind]==="Literal"&&u.const===r[l]?100:0,f=(0,BT.Check)(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[mAt.Kind]==="Union"){let o=t.anyOf.map(s=>(0,p5e.Deref)(s,e)).map(s=>u2i(s,e,r));return Math.max(...o)}else return(0,BT.Check)(t,e,r)?1:0}a(u2i,"ScoreUnion");function bKa(t,e,r){let n=t.anyOf.map(c=>(0,p5e.Deref)(c,e)),[o,s]=[n[0],0];for(let c of n){let l=u2i(c,e,r);l>s&&(o=c,s=l)}return o}a(bKa,"SelectUnion");function SKa(t,e,r){if("default"in t)return typeof r=="function"?t.default:(0,ire.Clone)(t.default);{let n=bKa(t,e,r);return f2i(n,e,r)}}a(SKa,"CastUnion");function TKa(t,e,r){return(0,BT.Check)(t,e,r)?(0,ire.Clone)(r):(0,QG.Create)(t,e)}a(TKa,"DefaultClone");function IKa(t,e,r){return(0,BT.Check)(t,e,r)?r:(0,QG.Create)(t,e)}a(IKa,"Default");function xKa(t,e,r){if((0,BT.Check)(t,e,r))return(0,ire.Clone)(r);let n=(0,hR.IsArray)(r)?(0,ire.Clone)(r):(0,QG.Create)(t,e),o=(0,hR.IsNumber)(t.minItems)&&n.lengthnull)]:n,c=((0,hR.IsNumber)(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>pD(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!(0,BT.Check)(t,e,l))throw new f5e(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(xKa,"FromArray");function wKa(t,e,r){if((0,BT.Check)(t,e,r))return(0,QG.Create)(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=pD(c,e,r.prototype[s]));return o}a(wKa,"FromConstructor");function RKa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return pD(o,[...e,...n],r)}a(RKa,"FromImport");function d2i(t,e){return(0,hR.IsObject)(t)&&!(0,hR.IsObject)(e)||!(0,hR.IsObject)(t)&&(0,hR.IsObject)(e)?t:!(0,hR.IsObject)(t)||!(0,hR.IsObject)(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?d2i(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(d2i,"IntersectAssign");function PKa(t,e,r){if((0,BT.Check)(t,e,r))return r;let n=(0,QG.Create)(t,e),o=d2i(n,r);return(0,BT.Check)(t,e,o)?o:n}a(PKa,"FromIntersect");function kKa(t,e,r){throw new f5e(t,"Never types cannot be cast")}a(kKa,"FromNever");function DKa(t,e,r){if((0,BT.Check)(t,e,r))return r;if(r===null||typeof r!="object")return(0,QG.Create)(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=pD(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=pD(t.additionalProperties,e,r[c]))}return o}a(DKa,"FromObject");function NKa(t,e,r){if((0,BT.Check)(t,e,r))return(0,ire.Clone)(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return(0,QG.Create)(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=pD(o,e,l);return s}a(NKa,"FromRecord");function MKa(t,e,r){return pD((0,p5e.Deref)(t,e),e,r)}a(MKa,"FromRef");function OKa(t,e,r){return pD((0,p5e.Deref)(t,e),e,r)}a(OKa,"FromThis");function BKa(t,e,r){return(0,BT.Check)(t,e,r)?(0,ire.Clone)(r):(0,hR.IsArray)(r)?t.items===void 0?[]:t.items.map((n,o)=>pD(n,e,r[o])):(0,QG.Create)(t,e)}a(BKa,"FromTuple");function LKa(t,e,r){return(0,BT.Check)(t,e,r)?(0,ire.Clone)(r):SKa(t,e,r)}a(LKa,"FromUnion");function pD(t,e,r){let n=(0,hR.IsString)(t.$id)?(0,p5e.Pushref)(t,e):e,o=t;switch(t[mAt.Kind]){case"Array":return xKa(o,n,r);case"Constructor":return wKa(o,n,r);case"Import":return RKa(o,n,r);case"Intersect":return PKa(o,n,r);case"Never":return kKa(o,n,r);case"Object":return DKa(o,n,r);case"Record":return NKa(o,n,r);case"Ref":return MKa(o,n,r);case"This":return OKa(o,n,r);case"Tuple":return BKa(o,n,r);case"Union":return LKa(o,n,r);case"Date":case"Symbol":case"Uint8Array":return TKa(t,e,r);default:return IKa(o,n,r)}}a(pD,"Visit");function f2i(...t){return t.length===3?pD(t[0],t[1],t[2]):pD(t[0],[],t[1])}a(f2i,"Cast")});var gAt=I(ore=>{"use strict";p();var FKa=ore&&ore.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UKa=ore&&ore.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FKa(e,t,r)};Object.defineProperty(ore,"__esModule",{value:!0});UKa(p2i(),ore)});var m2i=I(ixr=>{"use strict";p();Object.defineProperty(ixr,"__esModule",{value:!0});ixr.Clean=ZKa;var QKa=U2(),AAt=MT(),qKa=fD(),nxr=uD(),h2i=_n(),hD=mm(),yAt=ms();function jKa(t){return(0,yAt.IsKind)(t)&&t[h2i.Kind]!=="Unsafe"}a(jKa,"IsCheckable");function HKa(t,e,r){return(0,hD.IsArray)(r)?r.map(n=>zb(t.items,e,n)):r}a(HKa,"FromArray");function GKa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return zb(o,[...e,...n],r)}a(GKa,"FromImport");function $Ka(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>zb(l,e,(0,qKa.Clone)(r))).reduce((l,u)=>(0,hD.IsObject)(u)?{...l,...u}:u,{});if(!(0,hD.IsObject)(r)||!(0,hD.IsObject)(s)||!(0,yAt.IsKind)(n))return s;let c=(0,QKa.KeyOfPropertyKeys)(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||(0,AAt.Check)(n,e,r[l])&&(s[l]=zb(n,e,r[l]));return s}a($Ka,"FromIntersect");function VKa(t,e,r){if(!(0,hD.IsObject)(r)||(0,hD.IsArray)(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if((0,hD.HasPropertyKey)(t.properties,o)){r[o]=zb(t.properties[o],e,r[o]);continue}if((0,yAt.IsKind)(n)&&(0,AAt.Check)(n,e,r[o])){r[o]=zb(n,e,r[o]);continue}delete r[o]}return r}a(VKa,"FromObject");function WKa(t,e,r){if(!(0,hD.IsObject)(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=zb(c,e,r[u]);continue}if((0,yAt.IsKind)(n)&&(0,AAt.Check)(n,e,r[u])){r[u]=zb(n,e,r[u]);continue}delete r[u]}return r}a(WKa,"FromRecord");function zKa(t,e,r){return zb((0,nxr.Deref)(t,e),e,r)}a(zKa,"FromRef");function YKa(t,e,r){return zb((0,nxr.Deref)(t,e),e,r)}a(YKa,"FromThis");function KKa(t,e,r){if(!(0,hD.IsArray)(r))return r;if((0,hD.IsUndefined)(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(KKa,"FromTuple");function JKa(t,e,r){for(let n of t.anyOf)if(jKa(n)&&(0,AAt.Check)(n,e,r))return zb(n,e,r);return r}a(JKa,"FromUnion");function zb(t,e,r){let n=(0,hD.IsString)(t.$id)?(0,nxr.Pushref)(t,e):e,o=t;switch(o[h2i.Kind]){case"Array":return HKa(o,n,r);case"Import":return GKa(o,n,r);case"Intersect":return $Ka(o,n,r);case"Object":return VKa(o,n,r);case"Record":return WKa(o,n,r);case"Ref":return zKa(o,n,r);case"This":return YKa(o,n,r);case"Tuple":return KKa(o,n,r);case"Union":return JKa(o,n,r);default:return r}}a(zb,"Visit");function ZKa(...t){return t.length===3?zb(t[0],t[1],t[2]):zb(t[0],[],t[1])}a(ZKa,"Clean")});var EAt=I(sre=>{"use strict";p();var XKa=sre&&sre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),eJa=sre&&sre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XKa(e,t,r)};Object.defineProperty(sre,"__esModule",{value:!0});eJa(m2i(),sre)});var _2i=I(sxr=>{"use strict";p();Object.defineProperty(sxr,"__esModule",{value:!0});sxr.Convert=LJa;var tJa=fD(),g2i=MT(),oxr=uD(),rJa=_n(),Ma=mm();function _At(t){return(0,Ma.IsString)(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(_At,"IsStringNumeric");function nJa(t){return(0,Ma.IsBigInt)(t)||(0,Ma.IsBoolean)(t)||(0,Ma.IsNumber)(t)}a(nJa,"IsValueToString");function m5e(t){return t===!0||(0,Ma.IsNumber)(t)&&t===1||(0,Ma.IsBigInt)(t)&&t===BigInt("1")||(0,Ma.IsString)(t)&&(t.toLowerCase()==="true"||t==="1")}a(m5e,"IsValueTrue");function g5e(t){return t===!1||(0,Ma.IsNumber)(t)&&(t===0||Object.is(t,-0))||(0,Ma.IsBigInt)(t)&&t===BigInt("0")||(0,Ma.IsString)(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(g5e,"IsValueFalse");function iJa(t){return(0,Ma.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(iJa,"IsTimeStringWithTimeZone");function oJa(t){return(0,Ma.IsString)(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(oJa,"IsTimeStringWithoutTimeZone");function sJa(t){return(0,Ma.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(sJa,"IsDateTimeStringWithTimeZone");function aJa(t){return(0,Ma.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(aJa,"IsDateTimeStringWithoutTimeZone");function cJa(t){return(0,Ma.IsString)(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(cJa,"IsDateString");function lJa(t,e){let r=y2i(t);return r===e?r:t}a(lJa,"TryConvertLiteralString");function uJa(t,e){let r=E2i(t);return r===e?r:t}a(uJa,"TryConvertLiteralNumber");function dJa(t,e){let r=A2i(t);return r===e?r:t}a(dJa,"TryConvertLiteralBoolean");function fJa(t,e){return(0,Ma.IsString)(t.const)?lJa(e,t.const):(0,Ma.IsNumber)(t.const)?uJa(e,t.const):(0,Ma.IsBoolean)(t.const)?dJa(e,t.const):e}a(fJa,"TryConvertLiteral");function A2i(t){return m5e(t)?!0:g5e(t)?!1:t}a(A2i,"TryConvertBoolean");function pJa(t){let e=a(r=>r.split(".")[0],"truncateInteger");return _At(t)?BigInt(e(t)):(0,Ma.IsNumber)(t)?BigInt(Math.trunc(t)):g5e(t)?BigInt(0):m5e(t)?BigInt(1):t}a(pJa,"TryConvertBigInt");function y2i(t){return(0,Ma.IsSymbol)(t)&&t.description!==void 0?t.description.toString():nJa(t)?t.toString():t}a(y2i,"TryConvertString");function E2i(t){return _At(t)?parseFloat(t):m5e(t)?1:g5e(t)?0:t}a(E2i,"TryConvertNumber");function hJa(t){return _At(t)?parseInt(t):(0,Ma.IsNumber)(t)?Math.trunc(t):m5e(t)?1:g5e(t)?0:t}a(hJa,"TryConvertInteger");function mJa(t){return(0,Ma.IsString)(t)&&t.toLowerCase()==="null"?null:t}a(mJa,"TryConvertNull");function gJa(t){return(0,Ma.IsString)(t)&&t==="undefined"?void 0:t}a(gJa,"TryConvertUndefined");function AJa(t){return(0,Ma.IsDate)(t)?t:(0,Ma.IsNumber)(t)?new Date(t):m5e(t)?new Date(1):g5e(t)?new Date(0):_At(t)?new Date(parseInt(t)):oJa(t)?new Date(`1970-01-01T${t}.000Z`):iJa(t)?new Date(`1970-01-01T${t}`):aJa(t)?new Date(`${t}.000Z`):sJa(t)?new Date(t):cJa(t)?new Date(`${t}T00:00:00.000Z`):t}a(AJa,"TryConvertDate");function yJa(t,e,r){return((0,Ma.IsArray)(r)?r:[r]).map(o=>mD(t.items,e,o))}a(yJa,"FromArray");function EJa(t,e,r){return pJa(r)}a(EJa,"FromBigInt");function _Ja(t,e,r){return A2i(r)}a(_Ja,"FromBoolean");function vJa(t,e,r){return AJa(r)}a(vJa,"FromDate");function CJa(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return mD(o,[...e,...n],r)}a(CJa,"FromImport");function bJa(t,e,r){return hJa(r)}a(bJa,"FromInteger");function SJa(t,e,r){return t.allOf.reduce((n,o)=>mD(o,e,n),r)}a(SJa,"FromIntersect");function TJa(t,e,r){return fJa(t,r)}a(TJa,"FromLiteral");function IJa(t,e,r){return mJa(r)}a(IJa,"FromNull");function xJa(t,e,r){return E2i(r)}a(xJa,"FromNumber");function wJa(t,e,r){if(!(0,Ma.IsObject)(r)||(0,Ma.IsArray)(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))(0,Ma.HasPropertyKey)(r,n)&&(r[n]=mD(t.properties[n],e,r[n]));return r}a(wJa,"FromObject");function RJa(t,e,r){if(!((0,Ma.IsObject)(r)&&!(0,Ma.IsArray)(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=mD(s,e,l);return r}a(RJa,"FromRecord");function PJa(t,e,r){return mD((0,oxr.Deref)(t,e),e,r)}a(PJa,"FromRef");function kJa(t,e,r){return y2i(r)}a(kJa,"FromString");function DJa(t,e,r){return(0,Ma.IsString)(r)||(0,Ma.IsNumber)(r)?Symbol(r):r}a(DJa,"FromSymbol");function NJa(t,e,r){return mD((0,oxr.Deref)(t,e),e,r)}a(NJa,"FromThis");function MJa(t,e,r){return(0,Ma.IsArray)(r)&&!(0,Ma.IsUndefined)(t.items)?r.map((o,s)=>s{"use strict";p();var FJa=are&&are.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),UJa=are&&are.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&FJa(e,t,r)};Object.defineProperty(are,"__esModule",{value:!0});UJa(_2i(),are)});var S2i=I(cre=>{"use strict";p();Object.defineProperty(cre,"__esModule",{value:!0});cre.TransformDecodeError=cre.TransformDecodeCheckError=void 0;cre.TransformDecode=ZJa;var QJa=OMe(),v2i=_n(),C2i=Sf(),b2i=U2(),cxr=uD(),qJa=MT(),K8=mm(),A5e=ms(),axr=class extends C2i.TypeBoxError{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};cre.TransformDecodeCheckError=axr;var CAt=class extends C2i.TypeBoxError{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};cre.TransformDecodeError=CAt;function Ud(t,e,r){try{return(0,A5e.IsTransform)(t)?t[v2i.TransformKind].Decode(r):r}catch(n){throw new CAt(t,e,r,n)}}a(Ud,"Default");function jJa(t,e,r,n){return(0,K8.IsArray)(n)?Ud(t,r,n.map((o,s)=>gD(t.items,e,`${r}/${s}`,o))):Ud(t,r,n)}a(jJa,"FromArray");function HJa(t,e,r,n){if(!(0,K8.IsObject)(n)||(0,K8.IsValueType)(n))return Ud(t,r,n);let o=(0,b2i.KeyOfPropertyEntries)(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=gD(h,e,`${r}/${f}`,c[f]));if(!(0,A5e.IsTransform)(t.unevaluatedProperties))return Ud(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Ud(u,`${r}/${f}`,d[f]));return Ud(t,r,d)}a(HJa,"FromIntersect");function GJa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=gD(s,[...e,...o],r,n);return Ud(t,r,c)}a(GJa,"FromImport");function $Ja(t,e,r,n){return Ud(t,r,gD(t.not,e,r,n))}a($Ja,"FromNot");function VJa(t,e,r,n){if(!(0,K8.IsObject)(n))return Ud(t,r,n);let o=(0,b2i.KeyOfPropertyKeys)(t),s={...n};for(let d of o)(0,K8.HasPropertyKey)(s,d)&&((0,K8.IsUndefined)(s[d])&&(!(0,A5e.IsUndefined)(t.properties[d])||QJa.TypeSystemPolicy.IsExactOptionalProperty(s,d))||(s[d]=gD(t.properties[d],e,`${r}/${d}`,s[d])));if(!(0,A5e.IsSchema)(t.additionalProperties))return Ud(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=Ud(l,`${r}/${d}`,u[d]));return Ud(t,r,u)}a(VJa,"FromObject");function WJa(t,e,r,n){if(!(0,K8.IsObject)(n))return Ud(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=gD(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!(0,A5e.IsSchema)(t.additionalProperties))return Ud(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=Ud(u,`${r}/${f}`,d[f]));return Ud(t,r,d)}a(WJa,"FromRecord");function zJa(t,e,r,n){let o=(0,cxr.Deref)(t,e);return Ud(t,r,gD(o,e,r,n))}a(zJa,"FromRef");function YJa(t,e,r,n){let o=(0,cxr.Deref)(t,e);return Ud(t,r,gD(o,e,r,n))}a(YJa,"FromThis");function KJa(t,e,r,n){return(0,K8.IsArray)(n)&&(0,K8.IsArray)(t.items)?Ud(t,r,t.items.map((o,s)=>gD(o,e,`${r}/${s}`,n[s]))):Ud(t,r,n)}a(KJa,"FromTuple");function JJa(t,e,r,n){for(let o of t.anyOf){if(!(0,qJa.Check)(o,e,n))continue;let s=gD(o,e,r,n);return Ud(t,r,s)}return Ud(t,r,n)}a(JJa,"FromUnion");function gD(t,e,r,n){let o=(0,cxr.Pushref)(t,e),s=t;switch(t[v2i.Kind]){case"Array":return jJa(s,o,r,n);case"Import":return GJa(s,o,r,n);case"Intersect":return HJa(s,o,r,n);case"Not":return $Ja(s,o,r,n);case"Object":return VJa(s,o,r,n);case"Record":return WJa(s,o,r,n);case"Ref":return zJa(s,o,r,n);case"Symbol":return Ud(s,r,n);case"This":return YJa(s,o,r,n);case"Tuple":return KJa(s,o,r,n);case"Union":return JJa(s,o,r,n);default:return Ud(s,r,n)}}a(gD,"Visit");function ZJa(t,e,r){return gD(t,e,"",r)}a(ZJa,"TransformDecode")});var R2i=I(lre=>{"use strict";p();Object.defineProperty(lre,"__esModule",{value:!0});lre.TransformEncodeError=lre.TransformEncodeCheckError=void 0;lre.TransformEncode=uZa;var XJa=OMe(),I2i=_n(),x2i=Sf(),w2i=U2(),uxr=uD(),T2i=MT(),qG=mm(),y5e=ms(),lxr=class extends x2i.TypeBoxError{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}};lre.TransformEncodeCheckError=lxr;var bAt=class extends x2i.TypeBoxError{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};lre.TransformEncodeError=bAt;function ry(t,e,r){try{return(0,y5e.IsTransform)(t)?t[I2i.TransformKind].Encode(r):r}catch(n){throw new bAt(t,e,r,n)}}a(ry,"Default");function eZa(t,e,r,n){let o=ry(t,r,n);return(0,qG.IsArray)(o)?o.map((s,c)=>AD(t.items,e,`${r}/${c}`,s)):o}a(eZa,"FromArray");function tZa(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=ry(t,r,n);return AD(s,[...e,...o],r,c)}a(tZa,"FromImport");function rZa(t,e,r,n){let o=ry(t,r,n);if(!(0,qG.IsObject)(n)||(0,qG.IsValueType)(n))return o;let s=(0,w2i.KeyOfPropertyEntries)(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=AD(m,e,`${r}/${h}`,l[h]));if(!(0,y5e.IsTransform)(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=ry(d,`${r}/${h}`,f[h]));return f}a(rZa,"FromIntersect");function nZa(t,e,r,n){return ry(t.not,r,ry(t,r,n))}a(nZa,"FromNot");function iZa(t,e,r,n){let o=ry(t,r,n);if(!(0,qG.IsObject)(o))return o;let s=(0,w2i.KeyOfPropertyKeys)(t),c={...o};for(let f of s)(0,qG.HasPropertyKey)(c,f)&&((0,qG.IsUndefined)(c[f])&&(!(0,y5e.IsUndefined)(t.properties[f])||XJa.TypeSystemPolicy.IsExactOptionalProperty(c,f))||(c[f]=AD(t.properties[f],e,`${r}/${f}`,c[f])));if(!(0,y5e.IsSchema)(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=ry(u,`${r}/${f}`,d[f]));return d}a(iZa,"FromObject");function oZa(t,e,r,n){let o=ry(t,r,n);if(!(0,qG.IsObject)(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=AD(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!(0,y5e.IsSchema)(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=ry(d,`${r}/${h}`,f[h]));return f}a(oZa,"FromRecord");function sZa(t,e,r,n){let o=(0,uxr.Deref)(t,e),s=AD(o,e,r,n);return ry(t,r,s)}a(sZa,"FromRef");function aZa(t,e,r,n){let o=(0,uxr.Deref)(t,e),s=AD(o,e,r,n);return ry(t,r,s)}a(aZa,"FromThis");function cZa(t,e,r,n){let o=ry(t,r,n);return(0,qG.IsArray)(t.items)?t.items.map((s,c)=>AD(s,e,`${r}/${c}`,o[c])):[]}a(cZa,"FromTuple");function lZa(t,e,r,n){for(let o of t.anyOf){if(!(0,T2i.Check)(o,e,n))continue;let s=AD(o,e,r,n);return ry(t,r,s)}for(let o of t.anyOf){let s=AD(o,e,r,n);if((0,T2i.Check)(t,e,s))return ry(t,r,s)}return ry(t,r,n)}a(lZa,"FromUnion");function AD(t,e,r,n){let o=(0,uxr.Pushref)(t,e),s=t;switch(t[I2i.Kind]){case"Array":return eZa(s,o,r,n);case"Import":return tZa(s,o,r,n);case"Intersect":return rZa(s,o,r,n);case"Not":return nZa(s,o,r,n);case"Object":return iZa(s,o,r,n);case"Record":return oZa(s,o,r,n);case"Ref":return sZa(s,o,r,n);case"This":return aZa(s,o,r,n);case"Tuple":return cZa(s,o,r,n);case"Union":return lZa(s,o,r,n);default:return ry(s,r,n)}}a(AD,"Visit");function uZa(t,e,r){return AD(t,e,"",r)}a(uZa,"TransformEncode")});var P2i=I(pxr=>{"use strict";p();Object.defineProperty(pxr,"__esModule",{value:!0});pxr.HasTransform=wZa;var fxr=uD(),dZa=_n(),A0=ms(),fZa=mm();function pZa(t,e){return(0,A0.IsTransform)(t)||ym(t.items,e)}a(pZa,"FromArray");function hZa(t,e){return(0,A0.IsTransform)(t)||ym(t.items,e)}a(hZa,"FromAsyncIterator");function mZa(t,e){return(0,A0.IsTransform)(t)||ym(t.returns,e)||t.parameters.some(r=>ym(r,e))}a(mZa,"FromConstructor");function gZa(t,e){return(0,A0.IsTransform)(t)||ym(t.returns,e)||t.parameters.some(r=>ym(r,e))}a(gZa,"FromFunction");function AZa(t,e){return(0,A0.IsTransform)(t)||(0,A0.IsTransform)(t.unevaluatedProperties)||t.allOf.some(r=>ym(r,e))}a(AZa,"FromIntersect");function yZa(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return(0,A0.IsTransform)(t)||ym(n,[...r,...e])}a(yZa,"FromImport");function EZa(t,e){return(0,A0.IsTransform)(t)||ym(t.items,e)}a(EZa,"FromIterator");function _Za(t,e){return(0,A0.IsTransform)(t)||ym(t.not,e)}a(_Za,"FromNot");function vZa(t,e){return(0,A0.IsTransform)(t)||Object.values(t.properties).some(r=>ym(r,e))||(0,A0.IsSchema)(t.additionalProperties)&&ym(t.additionalProperties,e)}a(vZa,"FromObject");function CZa(t,e){return(0,A0.IsTransform)(t)||ym(t.item,e)}a(CZa,"FromPromise");function bZa(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return(0,A0.IsTransform)(t)||ym(n,e)||(0,A0.IsSchema)(t.additionalProperties)&&(0,A0.IsTransform)(t.additionalProperties)}a(bZa,"FromRecord");function SZa(t,e){return(0,A0.IsTransform)(t)?!0:ym((0,fxr.Deref)(t,e),e)}a(SZa,"FromRef");function TZa(t,e){return(0,A0.IsTransform)(t)?!0:ym((0,fxr.Deref)(t,e),e)}a(TZa,"FromThis");function IZa(t,e){return(0,A0.IsTransform)(t)||!(0,fZa.IsUndefined)(t.items)&&t.items.some(r=>ym(r,e))}a(IZa,"FromTuple");function xZa(t,e){return(0,A0.IsTransform)(t)||t.anyOf.some(r=>ym(r,e))}a(xZa,"FromUnion");function ym(t,e){let r=(0,fxr.Pushref)(t,e),n=t;if(t.$id&&dxr.has(t.$id))return!1;switch(t.$id&&dxr.add(t.$id),t[dZa.Kind]){case"Array":return pZa(n,r);case"AsyncIterator":return hZa(n,r);case"Constructor":return mZa(n,r);case"Function":return gZa(n,r);case"Import":return yZa(n,r);case"Intersect":return AZa(n,r);case"Iterator":return EZa(n,r);case"Not":return _Za(n,r);case"Object":return vZa(n,r);case"Promise":return CZa(n,r);case"Record":return bZa(n,r);case"Ref":return SZa(n,r);case"This":return TZa(n,r);case"Tuple":return IZa(n,r);case"Union":return xZa(n,r);default:return(0,A0.IsTransform)(t)}}a(ym,"Visit");var dxr=new Set;function wZa(t,e){return dxr.clear(),ym(t,e)}a(wZa,"HasTransform")});var E5e=I(J8=>{"use strict";p();var RZa=J8&&J8.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hxr=J8&&J8.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&RZa(e,t,r)};Object.defineProperty(J8,"__esModule",{value:!0});hxr(S2i(),J8);hxr(R2i(),J8);hxr(P2i(),J8)});var k2i=I(gxr=>{"use strict";p();Object.defineProperty(gxr,"__esModule",{value:!0});gxr.Decode=DZa;var mxr=E5e(),PZa=MT(),kZa=fge();function DZa(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]];if(!(0,PZa.Check)(e,r,n))throw new mxr.TransformDecodeCheckError(e,n,(0,kZa.Errors)(e,r,n).First());return(0,mxr.HasTransform)(e,r)?(0,mxr.TransformDecode)(e,r,n):n}a(DZa,"Decode")});var Axr=I(ure=>{"use strict";p();var NZa=ure&&ure.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),MZa=ure&&ure.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NZa(e,t,r)};Object.defineProperty(ure,"__esModule",{value:!0});MZa(k2i(),ure)});var N2i=I(_xr=>{"use strict";p();Object.defineProperty(_xr,"__esModule",{value:!0});_xr.Default=zZa;var OZa=MT(),D2i=fD(),Exr=uD(),BZa=_n(),Yb=mm(),LZa=ms();function Z8(t,e){let r=(0,Yb.HasPropertyKey)(t,"default")?t.default:void 0,n=(0,Yb.IsFunction)(r)?r():(0,D2i.Clone)(r);return(0,Yb.IsUndefined)(e)?n:(0,Yb.IsObject)(e)&&(0,Yb.IsObject)(n)?Object.assign(n,e):e}a(Z8,"ValueOrDefault");function yxr(t){return(0,LZa.IsKind)(t)&&"default"in t}a(yxr,"HasDefaultProperty");function FZa(t,e,r){if((0,Yb.IsArray)(r)){for(let o=0;o{let c=gv(s,e,n);return(0,Yb.IsObject)(c)?{...o,...c}:c},{})}a(qZa,"FromIntersect");function jZa(t,e,r){let n=Z8(t,r);if(!(0,Yb.IsObject)(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=gv(t.properties[s],e,n[s]);(0,Yb.IsUndefined)(c)||(n[s]=gv(t.properties[s],e,n[s]))}if(!yxr(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=gv(t.additionalProperties,e,n[s]));return n}a(jZa,"FromObject");function HZa(t,e,r){let n=Z8(t,r);if(!(0,Yb.IsObject)(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&yxr(c)&&(n[u]=gv(c,e,n[u]));if(!yxr(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=gv(o,e,n[u]));return n}a(HZa,"FromRecord");function GZa(t,e,r){return gv((0,Exr.Deref)(t,e),e,Z8(t,r))}a(GZa,"FromRef");function $Za(t,e,r){return gv((0,Exr.Deref)(t,e),e,r)}a($Za,"FromThis");function VZa(t,e,r){let n=Z8(t,r);if(!(0,Yb.IsArray)(n)||(0,Yb.IsUndefined)(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;c{"use strict";p();var YZa=dre&&dre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),KZa=dre&&dre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&YZa(e,t,r)};Object.defineProperty(dre,"__esModule",{value:!0});KZa(N2i(),dre)});var B2i=I(yD=>{"use strict";p();Object.defineProperty(yD,"__esModule",{value:!0});yD.ValuePointerRootDeleteError=yD.ValuePointerRootSetError=void 0;yD.Format=_5e;yD.Set=JZa;yD.Delete=ZZa;yD.Has=XZa;yD.Get=eXa;var O2i=Sf(),TAt=class extends O2i.TypeBoxError{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}};yD.ValuePointerRootSetError=TAt;var IAt=class extends O2i.TypeBoxError{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};yD.ValuePointerRootDeleteError=IAt;function M2i(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(M2i,"Escape");function*_5e(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;n{"use strict";p();var tXa=b4&&b4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rXa=b4&&b4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),nXa=b4&&b4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(vxr,"__esModule",{value:!0});vxr.Equal=wAt;var X8=mm();function iXa(t,e){if(!(0,X8.IsObject)(e))return!1;let r=[...Object.keys(t),...Object.getOwnPropertySymbols(t)],n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)];return r.length!==n.length?!1:r.every(o=>wAt(t[o],e[o]))}a(iXa,"ObjectType");function oXa(t,e){return(0,X8.IsDate)(e)&&t.getTime()===e.getTime()}a(oXa,"DateType");function sXa(t,e){return!(0,X8.IsArray)(e)||t.length!==e.length?!1:t.every((r,n)=>wAt(r,e[n]))}a(sXa,"ArrayType");function aXa(t,e){return!(0,X8.IsTypedArray)(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>wAt(r,e[n]))}a(aXa,"TypedArrayType");function cXa(t,e){return t===e}a(cXa,"ValueType");function wAt(t,e){if((0,X8.IsDate)(t))return oXa(t,e);if((0,X8.IsTypedArray)(t))return aXa(t,e);if((0,X8.IsArray)(t))return sXa(t,e);if((0,X8.IsObject)(t))return iXa(t,e);if((0,X8.IsValueType)(t))return cXa(t,e);throw new Error("ValueEquals: Unable to compare value")}a(wAt,"Equal")});var q2i=I(ny=>{"use strict";p();Object.defineProperty(ny,"__esModule",{value:!0});ny.ValueDiffError=ny.Edit=ny.Delete=ny.Update=ny.Insert=void 0;ny.Diff=gXa;ny.Patch=EXa;var S4=mm(),bxr=xAt(),Sxr=fD(),lXa=Cxr(),uXa=Sf(),Txr=bE(),Ixr=cv(),xxr=XH(),F2i=oG(),dXa=Ep();ny.Insert=(0,Ixr.Object)({type:(0,Txr.Literal)("insert"),path:(0,xxr.String)(),value:(0,F2i.Unknown)()});ny.Update=(0,Ixr.Object)({type:(0,Txr.Literal)("update"),path:(0,xxr.String)(),value:(0,F2i.Unknown)()});ny.Delete=(0,Ixr.Object)({type:(0,Txr.Literal)("delete"),path:(0,xxr.String)()});ny.Edit=(0,dXa.Union)([ny.Insert,ny.Update,ny.Delete]);var v5e=class extends uXa.TypeBoxError{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};ny.ValueDiffError=v5e;function RAt(t,e){return{type:"update",path:t,value:e}}a(RAt,"CreateUpdate");function U2i(t,e){return{type:"insert",path:t,value:e}}a(U2i,"CreateInsert");function Q2i(t){return{type:"delete",path:t}}a(Q2i,"CreateDelete");function L2i(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new v5e(t,"Cannot diff objects with symbols")}a(L2i,"AssertDiffable");function*fXa(t,e,r){if(L2i(e),L2i(r),!(0,S4.IsStandardObject)(r))return yield RAt(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)(0,S4.HasPropertyKey)(e,s)||(yield U2i(`${t}/${s}`,r[s]));for(let s of n)(0,S4.HasPropertyKey)(r,s)&&((0,lXa.Equal)(e,r)||(yield*PAt(`${t}/${s}`,e[s],r[s])));for(let s of n)(0,S4.HasPropertyKey)(r,s)||(yield Q2i(`${t}/${s}`))}a(fXa,"ObjectType");function*pXa(t,e,r){if(!(0,S4.IsArray)(r))return yield RAt(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(AXa,"IsRootUpdate");function yXa(t){return t.length===0}a(yXa,"IsIdentity");function EXa(t,e){if(AXa(e))return(0,Sxr.Clone)(e[0].value);if(yXa(e))return(0,Sxr.Clone)(t);let r=(0,Sxr.Clone)(t);for(let n of e)switch(n.type){case"insert":{bxr.ValuePointer.Set(r,n.path,n.value);break}case"update":{bxr.ValuePointer.Set(r,n.path,n.value);break}case"delete":{bxr.ValuePointer.Delete(r,n.path);break}}return r}a(EXa,"Patch")});var wxr=I(fre=>{"use strict";p();var _Xa=fre&&fre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vXa=fre&&fre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_Xa(e,t,r)};Object.defineProperty(fre,"__esModule",{value:!0});vXa(q2i(),fre)});var j2i=I(Pxr=>{"use strict";p();Object.defineProperty(Pxr,"__esModule",{value:!0});Pxr.Encode=SXa;var Rxr=E5e(),CXa=MT(),bXa=fge();function SXa(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=(0,Rxr.HasTransform)(e,r)?(0,Rxr.TransformEncode)(e,r,n):n;if(!(0,CXa.Check)(e,r,o))throw new Rxr.TransformEncodeCheckError(e,o,(0,bXa.Errors)(e,r,o).First());return o}a(SXa,"Encode")});var kxr=I(pre=>{"use strict";p();var TXa=pre&&pre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),IXa=pre&&pre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&TXa(e,t,r)};Object.defineProperty(pre,"__esModule",{value:!0});IXa(j2i(),pre)});var Dxr=I(hre=>{"use strict";p();var xXa=hre&&hre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),wXa=hre&&hre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xXa(e,t,r)};Object.defineProperty(hre,"__esModule",{value:!0});wXa(Cxr(),hre)});var G2i=I(b5e=>{"use strict";p();Object.defineProperty(b5e,"__esModule",{value:!0});b5e.ValueMutateError=void 0;b5e.Mutate=OXa;var ED=mm(),DAt=xAt(),Nxr=fD(),RXa=Sf();function kAt(t){return(0,ED.IsObject)(t)&&!(0,ED.IsArray)(t)}a(kAt,"IsStandardObject");var C5e=class extends RXa.TypeBoxError{static{a(this,"ValueMutateError")}constructor(e){super(e)}};b5e.ValueMutateError=C5e;function PXa(t,e,r,n){if(!kAt(r))DAt.ValuePointer.Set(t,e,(0,Nxr.Clone)(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)Mxr(t,`${e}/${c}`,r[c],n[c])}}a(PXa,"ObjectType");function kXa(t,e,r,n){if(!(0,ED.IsArray)(r))DAt.ValuePointer.Set(t,e,(0,Nxr.Clone)(n));else{for(let o=0;o{"use strict";p();var BXa=mre&&mre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),LXa=mre&&mre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BXa(e,t,r)};Object.defineProperty(mre,"__esModule",{value:!0});LXa(G2i(),mre)});var V2i=I(_D=>{"use strict";p();Object.defineProperty(_D,"__esModule",{value:!0});_D.ParseDefault=_D.ParseRegistry=_D.ParseError=void 0;_D.Parse=VXa;var FXa=Sf(),NAt=E5e(),UXa=pAt(),QXa=gAt(),qXa=EAt(),jXa=fD(),HXa=vAt(),GXa=SAt(),$2i=mm(),S5e=class extends FXa.TypeBoxError{static{a(this,"ParseError")}constructor(e){super(e)}};_D.ParseError=S5e;var Bxr;(function(t){let e=new Map([["Assert",(s,c,l)=>((0,UXa.Assert)(s,c,l),l)],["Cast",(s,c,l)=>(0,QXa.Cast)(s,c,l)],["Clean",(s,c,l)=>(0,qXa.Clean)(s,c,l)],["Clone",(s,c,l)=>(0,jXa.Clone)(l)],["Convert",(s,c,l)=>(0,HXa.Convert)(s,c,l)],["Decode",(s,c,l)=>(0,NAt.HasTransform)(s,c)?(0,NAt.TransformDecode)(s,c,l):l],["Default",(s,c,l)=>(0,GXa.Default)(s,c,l)],["Encode",(s,c,l)=>(0,NAt.HasTransform)(s,c)?(0,NAt.TransformEncode)(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(Bxr||(_D.ParseRegistry=Bxr={}));_D.ParseDefault=["Clone","Clean","Default","Convert","Assert","Decode"];function $Xa(t,e,r,n){return t.reduce((o,s)=>{let c=Bxr.Get(s);if((0,$2i.IsUndefined)(c))throw new S5e(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a($Xa,"ParseValue");function VXa(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?(0,$2i.IsArray)(t[0])?[t[0],t[1],[],t[2]]:[_D.ParseDefault,t[0],t[1],t[2]]:t.length===2?[_D.ParseDefault,t[0],[],t[1]]:(()=>{throw new S5e("Invalid Arguments")})();return $Xa(e,r,n,o)}a(VXa,"Parse")});var Lxr=I(gre=>{"use strict";p();var WXa=gre&&gre.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zXa=gre&&gre.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WXa(e,t,r)};Object.defineProperty(gre,"__esModule",{value:!0});zXa(V2i(),gre)});var z2i=I(gs=>{"use strict";p();Object.defineProperty(gs,"__esModule",{value:!0});gs.Parse=gs.Mutate=gs.Hash=gs.Equal=gs.Encode=gs.Edit=gs.Patch=gs.Diff=gs.Default=gs.Decode=gs.Create=gs.Convert=gs.Clone=gs.Clean=gs.Check=gs.Cast=gs.Assert=gs.ValueErrorIterator=gs.Errors=void 0;var W2i=fge();Object.defineProperty(gs,"Errors",{enumerable:!0,get:a(function(){return W2i.Errors},"get")});Object.defineProperty(gs,"ValueErrorIterator",{enumerable:!0,get:a(function(){return W2i.ValueErrorIterator},"get")});var YXa=pAt();Object.defineProperty(gs,"Assert",{enumerable:!0,get:a(function(){return YXa.Assert},"get")});var KXa=gAt();Object.defineProperty(gs,"Cast",{enumerable:!0,get:a(function(){return KXa.Cast},"get")});var JXa=MT();Object.defineProperty(gs,"Check",{enumerable:!0,get:a(function(){return JXa.Check},"get")});var ZXa=EAt();Object.defineProperty(gs,"Clean",{enumerable:!0,get:a(function(){return ZXa.Clean},"get")});var XXa=fD();Object.defineProperty(gs,"Clone",{enumerable:!0,get:a(function(){return XXa.Clone},"get")});var eec=vAt();Object.defineProperty(gs,"Convert",{enumerable:!0,get:a(function(){return eec.Convert},"get")});var tec=hAt();Object.defineProperty(gs,"Create",{enumerable:!0,get:a(function(){return tec.Create},"get")});var rec=Axr();Object.defineProperty(gs,"Decode",{enumerable:!0,get:a(function(){return rec.Decode},"get")});var nec=SAt();Object.defineProperty(gs,"Default",{enumerable:!0,get:a(function(){return nec.Default},"get")});var Fxr=wxr();Object.defineProperty(gs,"Diff",{enumerable:!0,get:a(function(){return Fxr.Diff},"get")});Object.defineProperty(gs,"Patch",{enumerable:!0,get:a(function(){return Fxr.Patch},"get")});Object.defineProperty(gs,"Edit",{enumerable:!0,get:a(function(){return Fxr.Edit},"get")});var iec=kxr();Object.defineProperty(gs,"Encode",{enumerable:!0,get:a(function(){return iec.Encode},"get")});var oec=Dxr();Object.defineProperty(gs,"Equal",{enumerable:!0,get:a(function(){return oec.Equal},"get")});var sec=o5e();Object.defineProperty(gs,"Hash",{enumerable:!0,get:a(function(){return sec.Hash},"get")});var aec=Oxr();Object.defineProperty(gs,"Mutate",{enumerable:!0,get:a(function(){return aec.Mutate},"get")});var cec=Lxr();Object.defineProperty(gs,"Parse",{enumerable:!0,get:a(function(){return cec.Parse},"get")})});var Y2i=I(T4=>{"use strict";p();var lec=T4&&T4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),uec=T4&&T4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),dec=T4&&T4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var fec=Qc&&Qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Og=Qc&&Qc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fec(e,t,r)};Object.defineProperty(Qc,"__esModule",{value:!0});Qc.Value=Qc.ValueErrorIterator=Qc.ValueErrorType=void 0;var K2i=fge();Object.defineProperty(Qc,"ValueErrorType",{enumerable:!0,get:a(function(){return K2i.ValueErrorType},"get")});Object.defineProperty(Qc,"ValueErrorIterator",{enumerable:!0,get:a(function(){return K2i.ValueErrorIterator},"get")});Og(mm(),Qc);Og(pAt(),Qc);Og(gAt(),Qc);Og(MT(),Qc);Og(EAt(),Qc);Og(fD(),Qc);Og(vAt(),Qc);Og(hAt(),Qc);Og(Axr(),Qc);Og(SAt(),Qc);Og(wxr(),Qc);Og(kxr(),Qc);Og(Dxr(),Qc);Og(o5e(),Qc);Og(Oxr(),Qc);Og(Lxr(),Qc);Og(xAt(),Qc);Og(E5e(),Qc);var pec=Y2i();Object.defineProperty(Qc,"Value",{enumerable:!0,get:a(function(){return pec.Value},"get")})});var Z2i=I(MAt=>{"use strict";p();Object.defineProperty(MAt,"__esModule",{value:!0});MAt.assertShape=void 0;var J2i=Uxr(),hec=a((t,e)=>{if(J2i.Value.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...J2i.Value.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");MAt.assertShape=hec});var Are={};xi(Are,{CAPIClient:()=>_ec,RequestType:()=>eDi});async function yec(t){if(!t)return;let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),s=Array.from(new Uint8Array(o)).map(c=>c.toString(16).padStart(2,"0")).join("");return`${r}.${s}`}function Eec(t){return new Set(["ChatCompletions","ChatResponses","ChatMessages","CAPIEmbeddings","Models","RemoteAgent","CodeReviewAgent","RemoteAgentChat","ListSkills","SearchSkill","ModelPolicy","ListModel","AutoModels","CopilotSessionLogs","CopilotSessionDetails","CopilotSessions","CopilotAgentJob","CCAModelsList","CopilotCustomAgents","CopilotAgentMemory","ModelRouter"]).has(t)}var mec,Qxr,T5e,gec,Aec,eDi,_ec,yre=_e(()=>{p();mec=class{static{a(this,"y")}async fetch(t,e){let r={method:e.method||"GET",headers:e.headers,signal:e.signal};e.json?(r.body=JSON.stringify(e.json),r.headers={"Content-Type":"application/json",...r.headers}):e.body&&(r.body=e.body);let n,o;e.timeout&&!e.signal&&(o=new AbortController,r.signal=o.signal,n=setTimeout(()=>{o.abort()},e.timeout));try{let s=await fetch(t,r);return n&&clearTimeout(n),s}catch(s){throw n&&clearTimeout(n),s}}async fetchWithPagination(t,e){let r=[],n=e.pageSize??20,o=e.startPage??1,s=!1;do{let c=e.buildUrl(t,n,o),l=await this.fetch(c,e);if(!l.ok)return r;let u=await l.json(),d=e.getItemsFromResponse(u);r.push(...d),s=d.length===n,o++}while(s);return r}createWebSocket(t,e){return{webSocket:new WebSocket(t)}}},Qxr=class X2i{static{a(this,"h")}constructor(){this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com",this._originTrackerUrl="https://origin-tracker.githubusercontent.com",this._dotcomAPIUrl=this._getDotComAPIUrl(),this._proxyBaseUrl=this._getProxyUrl(void 0),this._capiBaseUrl=this._getCAPIUrl(void 0)}updateDomains(e,r){let n=this._dotcomAPIUrl,o=this._capiBaseUrl,s=this._telemetryBaseUrl,c=this._proxyBaseUrl;return this._enterpriseUrlConfig!==r&&(this._enterpriseUrlConfig=r,this._dotcomAPIUrl=this._getDotComAPIUrl()),e?(this._proxyBaseUrl=this._getProxyUrl(e),this._capiBaseUrl=this._getCAPIUrl(e),this._telemetryBaseUrl=e.endpoints.telemetry||"https://copilot-telemetry.githubusercontent.com",e.endpoints["origin-tracker"]&&(this._originTrackerUrl=e.endpoints["origin-tracker"])):(this._capiBaseUrl="https://api.githubcopilot.com",this._telemetryBaseUrl="https://copilot-telemetry.githubusercontent.com"),{dotcomUrlChanged:n!==this._dotcomAPIUrl,capiUrlChanged:o!==this._capiBaseUrl,telemetryUrlChanged:s!==this._telemetryBaseUrl,proxyUrlChanged:c!==this._proxyBaseUrl}}_getDotComAPIUrl(){if(this._enterpriseUrlConfig)try{let e=new URL(this._enterpriseUrlConfig);return`${e.protocol}//api.${e.hostname}${e.port?":"+e.port:""}`}catch(e){return console.warn("Failed to parse enterprise URL config:",this._enterpriseUrlConfig,e),"https://api.github.com"}return"https://api.github.com"}_getCAPIUrl(e){return e&&e.endpoints.api||"https://api.githubcopilot.com"}_getProxyUrl(e){return e&&e.endpoints.proxy||X2i.DEFAULT_PROXY_BASE_URL}get proxyBaseURL(){return this._proxyBaseUrl}get capiBaseURL(){return this._capiBaseUrl}get capiChatURL(){return`${this._capiBaseUrl}/chat/completions`}get capiResponsesURL(){return`${this._capiBaseUrl}/responses`}get capiMessagesURL(){return`${this._capiBaseUrl}/v1/messages`}get capiEmbeddingsURL(){return`${this._capiBaseUrl}/embeddings`}get capiModelsURL(){return`${this._capiBaseUrl}/models`}get capiAutoModelURL(){return`${this.capiModelsURL}/session`}get capiModelRouterURL(){return`${this.capiAutoModelURL}/intent`}get embeddingsModelURL(){return`${this.embeddingsURL}/models`}get chunksURL(){return`${this.dotComAPIURL}/chunks`}get embeddingsURL(){return`${this.dotComAPIURL}/embeddings`}get embeddingsCodeSearchURL(){return`${this.dotComAPIURL}/embeddings/code/search`}get telemetryURL(){return`${this._telemetryBaseUrl}/telemetry`}get remoteAgentsURL(){return`${this._capiBaseUrl}/agents`}get listSkillsURL(){return`${this._capiBaseUrl}/skills`}get searchSkillURL(){return`${this._capiBaseUrl}/search`}get contentExclusionURL(){return`${this._dotcomAPIUrl}/copilot_internal/content_exclusion`}get copilotUserInfoURL(){return`${this._dotcomAPIUrl}/copilot_internal/user`}get tokenURL(){return this._dotcomAPIUrl+"/copilot_internal/v2/token"}get tokenNoAuthURL(){return`${this._dotcomAPIUrl}/copilot_internal/v2/nltoken`}get dotComAPIURL(){return this._dotcomAPIUrl}get originTrackerURL(){return this._originTrackerUrl}get chatAttachmentUploadURL(){return"https://uploads.github.com/copilot/chat/attachments"}get copilotAgentSessionsURL(){return`${this._capiBaseUrl}/agents/sessions`}get copilotAgentJobsURL(){return`${this._capiBaseUrl}/agents/swe`}get copilotAgentTasksURL(){return`${this._dotcomAPIUrl}/cmc_internal/api/agents`}get CCAModelsURL(){return`${this._capiBaseUrl}/agents/swe/models`}get copilotCustomAgentsURL(){return`${this._capiBaseUrl}/agents/swe/custom-agents`}get copilotAgentMemoryURL(){return`${this._capiBaseUrl}/agents/swe/internal/memory/v0`}};Qxr.DEFAULT_PROXY_BASE_URL="https://copilot-proxy.githubusercontent.com",Qxr.CAPI_MODEL_LAB_URL="https://api-model-lab.githubcopilot.com";T5e=Qxr,gec=`The \u201C@vscode/copilot-api\u201D npm Module Terms and Conditions ("Terms") are a legal agreement between you (either as an individual or on behalf of an entity) and GitHub, Inc. regarding your use of \u201C@vscode/copilot-api\u201D npm library and associated documentation (collectively, the "Software"). By using the Software, you accept these Terms. Please read all of these Terms; in many cases, provisions set forth later in the Terms limit and qualify provisions set forth earlier in the Terms. If you do not accept these Terms, do not download, install, use, or copy the Software. IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. @@ -1099,169 +1053,169 @@ Subject to the foregoing clause (ii), GitHub will only be liable for slight negl This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. -It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,Vtc=`I have read and agree to the following license terms: +It also applies even if GitHub knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.`,Aec=`I have read and agree to the following license terms: -${$tc} -`,Q2i=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(Q2i||{});a(Wtc,"v");a(ztc,"_");Ytc=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===Vtc&&(this._licenseCheckSucceeded=!0),this._domainService=new L5e,this._fetcherService=r??new Gtc,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${L5e.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!ztc(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await Wtc(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var ey=I(_C=>{"use strict";p();Object.defineProperty(_C,"__esModule",{value:!0});_C.DestroyableStream=_C.HeadersImpl=_C.Response=_C.NO_FETCH_TELEMETRY=_C.IFetcherService=void 0;_C.jsonVerboseError=Jtc;_C.isAbortError=q2i;_C.safeGetHostname=Ztc;var Ktc=rn();_C.IFetcherService=(0,Ktc.createServiceIdentifier)("IFetcherService");_C.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var Gxr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!q2i(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new qAt(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};_C.Response=Gxr;var $xr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};_C.HeadersImpl=$xr;var qAt=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};_C.DestroyableStream=qAt;async function Jtc(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` +${gec} +`,eDi=(t=>(t.CopilotToken="CopilotToken",t.CopilotNLToken="CopilotNLToken",t.ChatCompletions="ChatCompletions",t.ChatResponses="ChatResponses",t.ChatMessages="ChatMessages",t.ProxyCompletions="ProxyCompletions",t.ProxyChatCompletions="ProxyChatCompletions",t.RemoteAgent="RemoteAgent",t.RemoteAgentChat="RemoteAgentChat",t.CodeReviewAgent="CodeReviewAgent",t.CAPIEmbeddings="CAPIEmbeddings",t.DotcomEmbeddings="DotcomEmbeddings",t.EmbeddingsModels="EmbeddingsModels",t.Models="Models",t.AutoModels="AutoModels",t.Chunks="Chunks",t.EmbeddingsCodeSearch="EmbeddingsCodeSearch",t.ListSkills="ListSkills",t.SearchSkill="SearchSkill",t.ContentExclusion="ContentExclusion",t.Telemetry="Telemetry",t.CopilotUserInfo="CopilotUserInfo",t.ModelPolicy="ModelPolicy",t.ListModel="ListModel",t.SnippyMatch="SnippyMatch",t.SnippyFilesForMatch="SnippyFlesForMatch",t.CodingGuidelines="CodingGuidelines",t.EmbeddingsIndex="EmbedingsIndex",t.ChatAttachmentUpload="ChatAttachmentUpload",t.CopilotSessionLogs="CopilotSessionLogs",t.CopilotSessionDetails="CopilotSessionDetails",t.CopilotSessions="CopilotSessions",t.CopilotAgentJob="CopilotAgentJob",t.CCAModelsList="CCAModelsList",t.CopilotCustomAgents="CopilotCustomAgents",t.CopilotCustomAgentsDetail="CopilotCustomAgentsDetail",t.OrgCustomInstructions="OrgCustomInstructions",t.CopilotAgentMemory="CopilotAgentMemory",t.CopilotAgentJobEnabled="CopilotAgentJobEnabled",t.AgentTask="AgentTask",t.ModelRouter="ModelRouter",t))(eDi||{});a(yec,"v");a(Eec,"_");_ec=class{static{a(this,"f")}constructor(t,e,r,n,o){if(this._extensionInfo=t,this._integrationId=o,this._licenseCheckSucceeded=!1,e&&e===Aec&&(this._licenseCheckSucceeded=!0),this._domainService=new T5e,this._fetcherService=r??new mec,this._hmacSecret=n,this._integrationId==="vscode-chat"||this._integrationId==="code-oss")throw new Error(`Integration ID ${this._integrationId} is reserved and cannot be used.`)}updateDomains(t,e){return t&&t.sku&&(this._copilotSku=t.sku),this._domainService.updateDomains(t,e)}async makeRequest(t,e){let{type:r}=e;await this._mixinHeaders(t,e);let n={...t,callSite:t.callSite??r};switch(r){case"CopilotToken":return this._fetcherService.fetch(this._domainService.tokenURL,n);case"CopilotNLToken":return this._fetcherService.fetch(this._domainService.tokenNoAuthURL,n);case"ProxyCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/v1/engines/gpt-4o-copilot/completions`,n);case"ProxyChatCompletions":return this._fetcherService.fetch(`${this._domainService.proxyBaseURL}/chat/completions`,n);case"RemoteAgent":return this._fetcherService.fetch(this._domainService.remoteAgentsURL,n);case"CodeReviewAgent":return this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/github-code-review`,n);case"CAPIEmbeddings":return this._fetcherService.fetch(this._domainService.capiEmbeddingsURL,n);case"DotcomEmbeddings":return this._fetcherService.fetch(this._domainService.embeddingsURL,n);case"EmbeddingsModels":return this._fetcherService.fetch(this._domainService.embeddingsModelURL,n);case"Chunks":return this._fetcherService.fetch(this._domainService.chunksURL,n);case"EmbeddingsCodeSearch":return this._fetcherService.fetch(this._domainService.embeddingsCodeSearchURL,n);case"ListSkills":return this._fetcherService.fetch(this._domainService.listSkillsURL,n);case"Telemetry":return this._fetcherService.fetch(this._domainService.telemetryURL,n);case"CopilotUserInfo":return this._fetcherService.fetch(this._domainService.copilotUserInfoURL,n);case"SnippyMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/Match`,n);case"SnippyFlesForMatch":return this._fetcherService.fetch(`${this._domainService.originTrackerURL}/twirp/github.snippy.v1.SnippyAPI/FilesForMatch`,n);case"EmbedingsIndex":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for EmbeddingsIndex request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/embeddings_index`,n);case"CodingGuidelines":if(!("repoWithOwner"in e))throw new Error("repoWithOwner is required for CodingGuidelines request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/repos/${e.repoWithOwner}/copilot_internal/coding_guidelines`,n);case"AutoModels":return this._fetcherService.fetch(this._domainService.capiAutoModelURL,n);case"ModelRouter":return this._fetcherService.fetch(this._domainService.capiModelRouterURL,n);case"Models":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${T5e.CAPI_MODEL_LAB_URL}/models`,n):this._fetcherService.fetch(this._domainService.capiModelsURL,n);case"ChatCompletions":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${T5e.CAPI_MODEL_LAB_URL}/chat/completions`,n):this._fetcherService.fetch(this._domainService.capiChatURL,n);case"ChatResponses":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${T5e.CAPI_MODEL_LAB_URL}/responses`,n):this._fetcherService.fetch(this._domainService.capiResponsesURL,n);case"ChatMessages":return"isModelLab"in e&&e.isModelLab?this._fetcherService.fetch(`${T5e.CAPI_MODEL_LAB_URL}/v1/messages`,n):this._fetcherService.fetch(this._domainService.capiMessagesURL,n);case"ContentExclusion":if(!("repos"in e))throw new Error("Repos are required for ContentExclusion request");return this._fetcherService.fetch(this._prepareContentExclusionUrl(e.repos),n);case"RemoteAgentChat":return"slug"in e&&e.slug?this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/${e.slug}?chat`,n):this._fetcherService.fetch(`${this._domainService.remoteAgentsURL}/chat`,n);case"SearchSkill":if(!("slug"in e))throw new Error("Skill slug is required for SearchSkill request");return this._fetcherService.fetch(`${this._domainService.searchSkillURL}/${e.slug}`,n);case"ModelPolicy":if(!("modelId"in e))throw new Error("Model ID is required for ModelPolicy request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}/policy`,n);case"ListModel":if(!("modelId"in e))throw new Error("Model ID is required for ListModel request");return this._fetcherService.fetch(`${this._domainService.capiModelsURL}/${e.modelId}`,n);case"ChatAttachmentUpload":if(!("uploadName"in e)||!("mimeType"in e))throw new Error("uploadName and mimeType are required for ChatAttachmentUpload request");return this._fetcherService.fetch(`${this._domainService.chatAttachmentUploadURL}?name=${e.uploadName}&content_type=${e.mimeType}`,n);case"CopilotSessionLogs":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionLogs request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}/logs`,n);case"CopilotSessionDetails":if(!("sessionId"in e))throw new Error("sessionId is required for CopilotSessionDetails request");return this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/${e.sessionId}`,n);case"CopilotSessions":let o={...n,getItemsFromResponse:a(s=>{let c=s;return c&&Array.isArray(c.sessions)?c.sessions:[]},"getItemsFromResponse"),buildUrl:a((s,c,l)=>{let u=new URL(s);return u.searchParams.set("page_size",c.toString()),u.searchParams.set("page_number",l.toString()),"resourceState"in e&&e.resourceState&&u.searchParams.set("resource_state",e.resourceState),"nwo"in e&&e.nwo&&u.searchParams.set("repo_nwo",e.nwo),u.toString()},"buildUrl")};return"prId"in e&&e.prId?this._fetcherService.fetch(`${this._domainService.copilotAgentSessionsURL}/resource/pull/${e.prId}`,n):this._fetcherService.fetchWithPagination(this._domainService.copilotAgentSessionsURL,o);case"CopilotAgentJob":if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJob request");if("jobId"in e&&e.jobId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/${e.jobId}`,n)}if("sessionId"in e&&e.sessionId){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}/session/${e.sessionId}`,n)}if("payload"in e&&e.payload){let s="apiVersion"in e&&e.apiVersion||"v1";return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/${s}/jobs/${e.owner}/${e.repo}`,n)}throw new Error("jobId or sessionId is required for CopilotAgentJob request");case"CCAModelsList":return this._fetcherService.fetch(this._domainService.CCAModelsURL,n);case"CopilotCustomAgents":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}`);return"target"in e&&e.target&&s.searchParams.set("target",e.target),"exclude_invalid_config"in e&&e.exclude_invalid_config!==void 0&&s.searchParams.set("exclude_invalid_config",e.exclude_invalid_config.toString()),"dedupe"in e&&e.dedupe!==void 0&&s.searchParams.set("dedupe",e.dedupe.toString()),"include_sources"in e&&e.include_sources&&s.searchParams.set("include_sources",e.include_sources.join(",")),this._fetcherService.fetch(s.toString(),n)}case"CopilotCustomAgentsDetail":{if(!("owner"in e)||!("repo"in e)||!("customAgentName"in e))throw new Error("owner, repo and customAgentName are required for CopilotCustomAgents request");let s=new URL(`${this._domainService.copilotCustomAgentsURL}/${e.owner}/${e.repo}/${e.customAgentName}`);return"version"in e&&e.version&&s.searchParams.set("version",e.version),this._fetcherService.fetch(s.toString(),n)}case"OrgCustomInstructions":if(!("orgLogin"in e))throw new Error("orgLogin is required for OrgCustomInstructions request");return this._fetcherService.fetch(`${this._domainService.dotComAPIURL}/copilot_internal/org_custom_instructions/${e.orgLogin}`,n);case"CopilotAgentMemory":{if(!("repo"in e))throw new Error("repo is required for CopilotAgentMemory request");let s="action"in e?e.action:"",c=`${this._domainService.copilotAgentMemoryURL}/${e.repo}`;return s&&(c+=`/${s}`,s==="recent"&&"limit"in e&&e.limit!==void 0&&(c+=`?limit=${e.limit}`)),this._fetcherService.fetch(c,n)}case"CopilotAgentJobEnabled":{if(!("owner"in e)||!("repo"in e))throw new Error("owner and repo are required for CopilotAgentJobEnabled request");return this._fetcherService.fetch(`${this._domainService.copilotAgentJobsURL}/v1/jobs/${e.owner}/${e.repo}/enabled`,n)}case"AgentTask":return this._fetcherService.fetch(this._buildAgentTaskURL(e),n);default:throw new Error(`Unsupported request type: ${r}`)}}_buildAgentTaskURL(t){let e=this._domainService.copilotAgentTasksURL,{action:r,owner:n,repo:o,taskId:s,searchParams:c}=t,l=a(()=>{if(!s)throw new Error(`taskId is required for AgentTask action "${r}"`);return s},"l"),u=a(()=>{if(!n||!o)throw new Error(`owner and repo are required for AgentTask action "${r}"`);return{owner:n,repo:o}},"g"),d;switch(r){case"create":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"list":d="/tasks";break;case"list-for-repo":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks`;break}case"get":d=`/tasks/${l()}`;break;case"events":d=`/tasks/${l()}/events`;break;case"steer":d=`/tasks/${l()}/steer`;break;case"create-pr":{let h=u();d=`/repos/${h.owner}/${h.repo}/tasks/${l()}/pulls`;break}case"archive":d=`/tasks/${l()}/archive`;break;case"unarchive":d=`/tasks/${l()}/unarchive`;break;default:{let h=r;throw new Error(`Unsupported AgentTask action: ${h}`)}}let f=`${e}${d}`;if(c){let h=new URLSearchParams;for(let[g,A]of Object.entries(c))A!=null&&h.set(g,String(A));let m=h.toString();m&&(f+=`?${m}`)}return f}async createResponsesWebSocket(t){return await this._mixinHeaders(t,{type:"ChatResponses"}),this._fetcherService.createWebSocket(this._domainService.capiResponsesURL,t)}_prepareContentExclusionUrl(t){let e=t.join(","),r=new URL(this._domainService.contentExclusionURL);return t.length!==0&&r.searchParams.set("repos",e),r.searchParams.set("scope","repo"),r.toString()}async _mixinHeaders(t,e){if(!Eec(e.type))return;let r=t.headers||{};r["X-GitHub-Api-Version"]="2026-06-01",r["VScode-SessionId"]=this._extensionInfo.sessionId,r["VScode-MachineId"]=this._extensionInfo.machineId,r["Editor-Device-Id"]=this._extensionInfo.deviceId,r["Editor-Plugin-Version"]=`copilot-chat/${this._extensionInfo.version}`,r["Editor-Version"]=`vscode/${this._extensionInfo.vscodeVersion}`;let n="";t.suppressIntegrationId||(n="code-oss",this._integrationId&&this._hmacSecret?n=this._integrationId:this._copilotSku==="no_auth_limited_copilot"?n="vscode-nl":this._licenseCheckSucceeded&&this._extensionInfo.buildType==="prod"?n="vscode-chat":this._extensionInfo.buildType==="dev"&&this._hmacSecret&&(n="vscode-chat-dev"),r["Copilot-Integration-Id"]=n),n==="vscode-chat-dev"&&(r["Request-Hmac"]=await yec(this._hmacSecret)),t.headers=r}get copilotTelemetryURL(){return this._domainService.telemetryURL}get dotcomAPIURL(){return this._domainService.dotComAPIURL}get capiPingURL(){return`${this._domainService.capiBaseURL}/_ping`}get proxyBaseURL(){return this._domainService.proxyBaseURL}get originTrackerURL(){return this._domainService.originTrackerURL}get snippyMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/Match"}get snippyFilesForMatchPath(){return"twirp/github.snippy.v1.SnippyAPI/FilesForMatch"}}});var iy=I(Av=>{"use strict";p();Object.defineProperty(Av,"__esModule",{value:!0});Av.DestroyableStream=Av.HeadersImpl=Av.Response=Av.NO_FETCH_TELEMETRY=Av.IFetcherService=void 0;Av.jsonVerboseError=Cec;Av.isAbortError=tDi;Av.safeGetHostname=bec;var vec=tn();Av.IFetcherService=(0,vec.createServiceIdentifier)("IFetcherService");Av.NO_FETCH_TELEMETRY="NO_FETCH_TELEMETRY";var qxr=class t{static{a(this,"Response")}get bytesReceived(){return this._bytesReceived}constructor(e,r,n,o,s,c,l,u,d){this.status=e,this.statusText=r,this.headers=n,this.fetcher=s,this._reportEvent=c,this._internalId=l,this._hostname=u,this.cacheStatus=d,this.ok=this.status>=200&&this.status<300,this._bytesReceived=0;let f={transform:a((g,A)=>{this._bytesReceived+=g.length,A.enqueue(g)},"transform"),flush:a(()=>{this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:"success",phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,bytesReceived:this._bytesReceived})},"flush"),cancel:a(g=>{let A=g&&!tDi(g)?"error":"cancel";this._reportEvent({internalId:this._internalId,timestamp:Date.now(),outcome:A,phase:"responseStreaming",fetcher:this.fetcher,hostname:this._hostname,reason:g,bytesReceived:this._bytesReceived})},"cancel")},h=new TransformStream(f),m=o??new ReadableStream({start(g){g.close()}});this.body=new OAt(m.pipeThrough(h))}static fromText(e,r,n,o,s){return new t(e,r,n,new ReadableStream({start(c){c.enqueue(new TextEncoder().encode(o)),c.close()}}),s,()=>{},"in-memory","in-memory")}async text(){let e=[];for await(let s of this.body)e.push(s);let r=e.reduce((s,c)=>s+c.length,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.length;return new TextDecoder().decode(n)}async json(){return JSON.parse(await this.text())}};Av.Response=qxr;var jxr=class t{static{a(this,"HeadersImpl")}constructor(e){this._record=e}static fromMap(e){return new t(Object.fromEntries(e))}get(e){let r=this._record[e];return Array.isArray(r)?r[0]:r??null}[Symbol.iterator](){let e=Object.keys(this._record),r=0;return{next:a(()=>{if(r>=e.length)return{done:!0,value:void 0};let n=e[r++];return{done:!1,value:[n,this.get(n)]}},"next")}}};Av.HeadersImpl=jxr;var OAt=class t{static{a(this,"DestroyableStream")}constructor(e){this.stream=e}toReadableStream(){return this.stream}pipeThrough(e){let r=new t(this.stream.pipeThrough(e));return this.pipedHead=r,r}async*[Symbol.asyncIterator](){this.reader=this.stream.getReader();try{for(;;){let{done:e,value:r}=await this.reader.read();if(e)break;yield r}}finally{this.reader.releaseLock(),this.reader=void 0}}destroy(){return this.pipedHead?this.pipedHead.destroy():this.reader?this.reader.cancel():this.stream.cancel()}};Av.DestroyableStream=OAt;async function Cec(t){let e=await t.text();try{return JSON.parse(e)}catch(r){let n=e.split(` `),o=n.length>50?[...n.slice(0,25),"[...]",...n.slice(n.length-25)].join(` -`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(Jtc,"jsonVerboseError");function q2i(t){return t&&t.name==="AbortError"}a(q2i,"isAbortError");function Ztc(t){try{return new URL(t).hostname}catch{return"unknown"}}a(Ztc,"safeGetHostname")});var j2i=I(vge=>{"use strict";p();Object.defineProperty(vge,"__esModule",{value:!0});vge.INTEGRATION_ID=vge.LICENSE_AGREEMENT=void 0;vge.LICENSE_AGREEMENT=void 0;vge.INTEGRATION_ID="code-oss"});var PE=I(bge=>{"use strict";p();Object.defineProperty(bge,"__esModule",{value:!0});bge.ICAPIClientService=bge.BaseCAPIClientService=void 0;var F5e=(bre(),Ca(vre)),Xtc=rn(),erc=ey(),trc=j2i(),Vxr=class extends F5e.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},trc.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===F5e.RequestType.Telemetry||r.type===F5e.RequestType.ChatCompletions||r.type===F5e.RequestType.ChatMessages||r.type===F5e.RequestType.ChatResponses)&&(e.callSite=erc.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};bge.BaseCAPIClientService=Vxr;bge.ICAPIClientService=(0,Xtc.createServiceIdentifier)("ICAPIClientService")});var HAt=I(jAt=>{"use strict";p();Object.defineProperty(jAt,"__esModule",{value:!0});jAt.getEndpointUrl=arc;jAt.getLastKnownEndpoints=crc;var rrc=SE(),nrc=PE(),ZG=vE(),irc=tre(),orc=TG();function G2i(t){let e=t.get(nrc.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(G2i,"getDefaultEndpoints");function H2i(t,e,r){if(r!==void 0&&t.get(irc.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,ZG.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,ZG.getConfig)(t,n);if(o)return o}}a(H2i,"urlConfigOverride");function src(t,e){switch(e){case"proxy":return H2i(t,[ZG.ConfigKey.DebugOverrideProxyUrl,ZG.ConfigKey.DebugOverrideProxyUrlLegacy],[ZG.ConfigKey.DebugTestOverrideProxyUrl,ZG.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!ZG.BuildInfo.isProduction())return H2i(t,[ZG.ConfigKey.DebugSnippyOverrideUrl])}}a(src,"getEndpointOverrideUrl");function arc(t,e,r,...n){let o=src(t,r)??(e.endpoints?e.endpoints[r]:void 0)??G2i(t)[r];return(0,orc.joinPath)(o,...n)}a(arc,"getEndpointUrl");function crc(t){return t.get(rrc.IAuthenticationService).copilotToken?.endpoints??G2i(t)}a(crc,"getLastKnownEndpoints")});var zxr=I(U5e=>{"use strict";p();Object.defineProperty(U5e,"__esModule",{value:!0});U5e.Response=void 0;U5e.isAbortError=urc;var lrc=ey();Object.defineProperty(U5e,"Response",{enumerable:!0,get:a(function(){return lrc.Response},"get")});var Wxr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function urc(t){return!t||typeof t!="object"?!1:t instanceof Wxr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(urc,"isAbortError")});var Sge=I(Am=>{"use strict";p();var drc=Am&&Am.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),frc=Am&&Am.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},prc=Am&&Am.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&drc(e,t,r)},Yxr=Am&&Am.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Am,"__esModule",{value:!0});Am.Fetcher=Am.CompletionsFetcher=Am.ICompletionsFetcherService=void 0;Am.isInterruptedNetworkError=Arc;prc(zxr(),Am);var $2i=Il(),hrc=ey(),mrc=gp(),grc=rn();Am.ICompletionsFetcherService=(0,grc.createServiceIdentifier)("ICompletionsFetcherService");var Kxr=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig($2i.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};Am.CompletionsFetcher=Kxr;Am.CompletionsFetcher=Kxr=frc([Yxr(0,$2i.IConfigurationService),Yxr(1,hrc.IFetcherService),Yxr(2,mrc.IExperimentationService)],Kxr);var Jxr=class{static{a(this,"Fetcher")}getImplementation(){return this}};Am.Fetcher=Jxr;function Arc(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(Arc,"isInterruptedNetworkError")});var V2i=I(Tge=>{"use strict";p();Object.defineProperty(Tge,"__esModule",{value:!0});Tge.FeatureName=Tge.OutputPaneShowCommand=void 0;Tge.OutputPaneShowCommand="codereferencing.showOutputPane2";Tge.FeatureName="code-referencing"});var Q5e=I(GAt=>{"use strict";p();Object.defineProperty(GAt,"__esModule",{value:!0});GAt.codeReferenceLogger=void 0;var yrc=xl(),Erc=V2i();GAt.codeReferenceLogger=new yrc.Logger(Erc.FeatureName)});var Y2i=I(WAt=>{"use strict";p();Object.defineProperty(WAt,"__esModule",{value:!0});WAt.ConnectionState=void 0;var _rc=Qs(),Crc=xl(),vrc=HAt(),brc=Sge(),q5e=Q5e(),Src=3e3,Zxr=2,W2i=256,z2i=Math.log(W2i)/Math.log(Zxr)/Zxr,SD={connection:"disabled",maxAttempts:z2i,retryAttempts:0,initialWait:!1},$At,VAt=[];function Trc(){if($At)return $At;function t(_){return VAt.push(_),()=>{let v=VAt.indexOf(_);v!==-1&&VAt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of VAt)_()}a(e,"afterUpdateConnection");function r(_){SD.connection!==_&&(SD.connection=_,e())}a(r,"updateConnection");function n(){return SD.connection==="connected"}a(n,"isConnected");function o(){return SD.connection==="disconnected"}a(o,"isDisconnected");function s(){return SD.connection==="retry"}a(s,"isRetrying");function c(){return SD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){SD.initialWait!==_&&(SD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Src){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return SD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Crc.ICompletionsLogTargetService),T=_.get(brc.ICompletionsFetcherService),w=_.get(_rc.IInstantiationService);q5e.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>W2i){q5e.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let k=a(async()=>{SD.retryAttempts=Math.min(SD.retryAttempts+1,z2i);try{q5e.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(vrc.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{q5e.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{k()},x*1e3)}a(R,"succeedOrRetry"),q5e.codeReferenceLogger.info(b,"Attempting to reconnect."),R(Zxr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),$At={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},$At}a(Trc,"registerConnectionState");WAt.ConnectionState=Trc()});var J2i=I(Og=>{"use strict";p();Object.defineProperty(Og,"__esModule",{value:!0});Og.ErrorMessages=Og.ErrorReasons=void 0;Og.getErrorType=K2i;Og.createErrorResponse=Irc;Og.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};Og.ErrorMessages={[Og.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Og.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Og.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function K2i(t){return t===401?Og.ErrorReasons.Unauthorized:t===400?Og.ErrorReasons.BadArguments:t===404?Og.ErrorReasons.NotFound:t===429?Og.ErrorReasons.RateLimit:t>=500&&t<600?Og.ErrorReasons.InternalError:t>=600?Og.ErrorReasons.ConnectionError:Og.ErrorReasons.Unknown}a(K2i,"getErrorType");function Irc(t,e,r={}){return{kind:"failure",reason:K2i(Number(t)),code:Number(t),msg:e,meta:r}}a(Irc,"createErrorResponse")});var nwr=I(D4=>{"use strict";p();Object.defineProperty(D4,"__esModule",{value:!0});D4.NoopTelemetryReporter=D4.snippyTelemetry=D4.matchNotificationTelemetry=D4.copilotOutputLogTelemetry=void 0;var xrc=xl(),DE=Tg(),wrc=Q5e(),Rrc=/^[1-6][0-9][0-9]$/,krc=/([A-Z][a-z]+)/,Prc="code_referencing",Ige=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[Prc,this.baseKey,...e].join(".")}},Xxr=class extends Ige{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=DE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(DE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=DE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(DE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=DE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(DE.telemetry,n,r)}};D4.copilotOutputLogTelemetry=new Xxr;var ewr=class extends Ige{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=DE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(DE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=DE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(DE.telemetry,o,n)}};D4.matchNotificationTelemetry=new ewr;var twr=class extends Ige{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=DE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(DE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=DE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(DE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(Rrc)){e.invokeFunction(l=>wrc.codeReferenceLogger.debug(l.get(xrc.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(krc).filter(l=>!!l).join("_").toLowerCase(),c=DE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(DE.telemetryError,this.buildKey(s,r),c)}};D4.snippyTelemetry=new twr;var rwr=class extends Ige{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};D4.NoopTelemetryReporter=rwr});var Z2i=I(iwr=>{"use strict";p();Object.defineProperty(iwr,"__esModule",{value:!0});iwr.call=Qrc;var Drc=Qs(),Nrc=pme(),Mrc=vE(),Orc=xl(),Brc=HAt(),Lrc=Sge(),xge=Y2i(),oh=J2i(),Frc=Q5e(),Urc=nwr();async function Qrc(t,e,r,n){let o,s=t.get(Orc.ICompletionsLogTargetService),c=t.get(Drc.IInstantiationService),l=t.get(Nrc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return xge.ConnectionState.setDisconnected(),(0,oh.createErrorResponse)(401,oh.ErrorMessages[oh.ErrorReasons.Unauthorized])}if(Frc.codeReferenceLogger.info(s,`Calling ${e}`),xge.ConnectionState.isRetrying())return(0,oh.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(xge.ConnectionState.isDisconnected())return(0,oh.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(Lrc.ICompletionsFetcherService).fetch((0,Brc.getEndpointUrl)(_,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,Mrc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(xge.ConnectionState.enableRetry),(0,oh.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw Urc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,oh.getErrorType)(A),E=m||"unknown error";switch(y){case oh.ErrorReasons.Unauthorized:return(0,oh.createErrorResponse)(h,oh.ErrorMessages[oh.ErrorReasons.Unauthorized],g);case oh.ErrorReasons.BadArguments:return(0,oh.createErrorResponse)(h,E,g);case oh.ErrorReasons.RateLimit:return c.invokeFunction(_=>xge.ConnectionState.enableRetry(_,60*1e3)),(0,oh.createErrorResponse)(h,oh.ErrorMessages.RateLimitError,g);case oh.ErrorReasons.InternalError:return c.invokeFunction(_=>xge.ConnectionState.enableRetry(_)),(0,oh.createErrorResponse)(h,oh.ErrorMessages[oh.ErrorReasons.InternalError],g);default:return(0,oh.createErrorResponse)(h,E,g)}}a(Qrc,"call")});var owr=I(n1=>{"use strict";p();Object.defineProperty(n1,"__esModule",{value:!0});n1.FileMatchResponse=n1.FileMatchRequest=n1.MatchResponse=n1.MatchRequest=n1.MatchError=void 0;var Aa=Imt();n1.MatchError=Aa.Type.Object({kind:Aa.Type.Literal("failure"),reason:Aa.Type.String(),code:Aa.Type.Number(),msg:Aa.Type.String(),meta:Aa.Type.Optional(Aa.Type.Any())});var qrc=Aa.Type.Object({matched_source:Aa.Type.String(),occurrences:Aa.Type.String(),capped:Aa.Type.Boolean(),cursor:Aa.Type.String(),github_url:Aa.Type.String()});n1.MatchRequest=Aa.Type.Object({source:Aa.Type.String()});var jrc=Aa.Type.Object({snippets:Aa.Type.Array(qrc)});n1.MatchResponse=Aa.Type.Union([jrc,n1.MatchError]);n1.FileMatchRequest=Aa.Type.Object({cursor:Aa.Type.String()});var Hrc=Aa.Type.Object({commit_id:Aa.Type.String(),license:Aa.Type.String(),nwo:Aa.Type.String(),path:Aa.Type.String(),url:Aa.Type.String()}),Grc=Aa.Type.Object({has_next_page:Aa.Type.Boolean(),cursor:Aa.Type.String()}),$rc=Aa.Type.Object({count:Aa.Type.Record(Aa.Type.String(),Aa.Type.String())}),Vrc=Aa.Type.Object({file_matches:Aa.Type.Array(Hrc),page_info:Grc,license_stats:$rc});n1.FileMatchResponse=Aa.Type.Union([Vrc,n1.MatchError])});var rDi=I(N4=>{"use strict";p();var Wrc=N4&&N4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zrc=N4&&N4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X2i=N4&&N4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(c6,"__esModule",{value:!0});c6.MinTokenLength=void 0;c6.lexemeLength=nDi;c6.offsetLastLexemes=Zrc;c6.hasMinLexemeLength=Xrc;var j5e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");c6.MinTokenLength=65;function nDi(t){let e=0,r;j5e.lastIndex=0;do if(r=j5e.exec(t),r&&(e+=1),e>=c6.MinTokenLength)break;while(r);return e}a(nDi,"lexemeLength");function Jrc(t,e){let r=0,n;j5e.lastIndex=0;do if(n=j5e.exec(t),n&&(r+=1,r>=e))return j5e.lastIndex;while(n);return t.length}a(Jrc,"offsetFirstLexemes");function Zrc(t,e){let r=t.split("").reverse().join(""),n=Jrc(r,e);return r.length-n}a(Zrc,"offsetLastLexemes");function Xrc(t){return nDi(t)>=c6.MinTokenLength}a(Xrc,"hasMinLexemeLength")});var uDi=I(l6=>{"use strict";p();var enc=l6&&l6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tnc=l6&&l6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),cDi=l6&&l6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;osDi(E,()=>oDi.Match(E,f)));if(!h||aDi(h)||!h.snippets.length){swr.codeReferenceLogger.info(s,"No match found");return}swr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>sDi(T,()=>oDi.FilesForMatch(T,{cursor:E.cursor})));if(!_||aDi(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(lnc,"fetchCitations")});var gDi=I(XG=>{"use strict";p();Object.defineProperty(XG,"__esModule",{value:!0});XG.editDistance=fDi;XG.emptyLexDictionary=pDi;XG.reverseLexDictionary=hDi;XG.lexGeneratorWords=mDi;XG.lexicalAnalyzer=awr;XG.lexEditDistance=unc;function fDi(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(mDi,"lexGeneratorWords");function awr(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(awr,"lexicalAnalyzer");function dDi(t){return t!==" "}a(dDi,"notSingleSpace");function unc(t,e,r=mDi){let[n,o]=awr(t,pDi(),r,dDi),[s,c]=awr(e,o,r,dDi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=hDi(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=fDi(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(unc,"lexEditDistance")});var cwr=I(Sre=>{"use strict";p();Object.defineProperty(Sre,"__esModule",{value:!0});Sre.PartialAcceptTriggerKind=void 0;Sre.computeCompCharLen=dnc;Sre.countLines=fnc;Sre.computeCompletionText=pnc;var ADi;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(ADi||(Sre.PartialAcceptTriggerKind=ADi={}));function dnc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(dnc,"computeCompCharLen");function fnc(t){return t.length===0?0:t.split(` -`).length}a(fnc,"countLines");function pnc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(pnc,"computeCompletionText")});var xDi=I(ZAt=>{"use strict";p();Object.defineProperty(ZAt,"__esModule",{value:!0});ZAt.postRejectionTasks=Tnc;ZAt.postInsertionTasks=Inc;var JAt=Qs(),_Di=See(),hnc=pme(),KAt=Mxi(),mnc=l0t(),gnc=t1r(),CDi=Sbr(),vDi=tge(),Rge=xl(),yDi=ngt(),Anc=mge(),ync=uDi(),EDi=gDi(),Enc=cwr(),e$=Tg(),_nc=zb(),bDi=QMe(),Cnc=tre(),t$=new Rge.Logger("postInsertion"),SDi=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],TDi=50,vnc=1500,bnc=.5,Snc=500,lwr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function IDi(t,e,r,n,o){let s=t.get(JAt.IInstantiationService),c=t.get(Rge.ICompletionsLogTargetService),l=await t.get(CDi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return t$.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(Anc.extractPrompt,r.properties.headerRequestId,(0,gnc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,yDi.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,yDi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Snc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(IDi,"captureCode");function Tnc(t,e,r,n,o){let s=t.get(Rge.ICompletionsLogTargetService),c=t.get(JAt.IInstantiationService),l=t.get(_Di.ICompletionsTelemetryService),u=t.get(bDi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{t$.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(vDi.telemetryRejected,e,g)});let d=c.createInstance(KAt.ChangeTracker,n,r-1),f=c.createInstance(KAt.ChangeTracker,n,r),h=a(async m=>{t$.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(IDi,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});t$.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(e$.telemetry,e+".capturedAfterRejected",v,e$.TelemetryStore.Enhanced)},"checkInCode");SDi.filter(m=>m.captureRejection).map(m=>d.push((0,e$.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Tnc,"postRejectionTasks");function Inc(t,e,r,n,o,s,c,l){let u=t.get(Rge.ICompletionsLogTargetService),d=t.get(JAt.IInstantiationService),f=t.get(bDi.ICompletionsPromiseQueueService),h=t.get(_Di.ICompletionsTelemetryService),m=t.get(Cnc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});t$.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(vDi.telemetryAccepted,e,g);let A=r;r=(0,Enc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(KAt.ChangeTracker,o,n),_=d.createInstance(KAt.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(knc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(lwr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:lwr.captureCode,captureRejection:lwr.captureRejection});f.register(b)}else SDi.map(b=>E.push((0,e$.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,e$.telemetryCatch)(h,f,xnc,"post insertion citation check")(b,o,A,r,n,l))}a(Inc,"postInsertionTasks");async function xnc(t,e,r,n,o,s){let c=t.get(Rge.ICompletionsLogTargetService),l=t.get(_nc.ICompletionsTextDocumentManagerService),u=t.get(hnc.ICompletionsCopilotTokenManager),d=t.get(mnc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,ync.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=uwr(f.getText(),n,TDi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=wnc(r.length,n.length,h.start_offset);if(m===void 0){t$.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+Rnc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(xnc,"citationCheck");function wnc(t,e,r){if(!(ee))return r}a(wnc,"computeCitationStart");function Rnc(t,e,r){return e{"use strict";p();Object.defineProperty(ty,"__esModule",{value:!0});ty.LastGhostText=ty.ICompletionsLastGhostText=void 0;ty.rejectLastShown=kDi;ty.setLastShown=Mnc;ty.handleGhostTextShown=Onc;ty.handleGhostTextPostInsert=Lnc;ty.handlePartialGhostTextPostInsert=Fnc;var Pnc=rn(),wDi=xl(),fwr=xDi(),XAt=cwr(),RDi=xG(),pwr=tge(),Dnc=new wDi.Logger("ghostText");ty.ICompletionsLastGhostText=(0,Pnc.createServiceIdentifier)("ICompletionsLastGhostText");var dwr=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};ty.LastGhostText=dwr;function Nnc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(Nnc,"computeRejectedCompletions");function kDi(t,e){let r=t.get(ty.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=Nnc(r);n.length>0&&(0,fwr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(kDi,"rejectLastShown");function Mnc(t,e,r,n){let o=t.get(ty.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==RDi.ResultType.TypingAsSuggested&&kDi(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(Mnc,"setLastShown");function Onc(t,e){let r=t.get(wDi.ICompletionsLogTargetService),n=t.get(ty.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==RDi.ResultType.Network;Dnc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,pwr.telemetryShown)(t,e)}}a(Onc,"handleGhostTextShown");function Bnc(t,e,r){let n=t.get(ty.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,XAt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,XAt.countLines)(e.displayText));let o=(0,XAt.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(Bnc,"handleLineAcceptance");function Lnc(t,e){let r=t.get(ty.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,XAt.countLines)(e.displayText)},r.resetState(),(0,fwr.postInsertionTasks)(t,pwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(Lnc,"handleGhostTextPostInsert");function Fnc(t,e,r){let n=t.get(ty.ICompletionsLastGhostText);Bnc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,fwr.postInsertionTasks)(t,pwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(Fnc,"handlePartialGhostTextPostInsert")});var PDi=I(mwr=>{"use strict";p();Object.defineProperty(mwr,"__esModule",{value:!0});mwr.normalizeIndentCharacter=Unc;function Unc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`):e;throw r.message=`${r.message}. Response: ${o}`,r}}a(Cec,"jsonVerboseError");function tDi(t){return t&&t.name==="AbortError"}a(tDi,"isAbortError");function bec(t){try{return new URL(t).hostname}catch{return"unknown"}}a(bec,"safeGetHostname")});var rDi=I(hge=>{"use strict";p();Object.defineProperty(hge,"__esModule",{value:!0});hge.INTEGRATION_ID=hge.LICENSE_AGREEMENT=void 0;hge.LICENSE_AGREEMENT=void 0;hge.INTEGRATION_ID="code-oss"});var wE=I(mge=>{"use strict";p();Object.defineProperty(mge,"__esModule",{value:!0});mge.ICAPIClientService=mge.BaseCAPIClientService=void 0;var I5e=(yre(),ya(Are)),Sec=tn(),Tec=iy(),Iec=rDi(),Hxr=class extends I5e.CAPIClient{static{a(this,"BaseCAPIClientService")}constructor(e,r,n,o){super({machineId:o.machineId,deviceId:o.devDeviceId,sessionId:o.sessionId,vscodeVersion:o.vscodeVersion,buildType:o.getBuildType(),name:o.getName(),version:o.getVersion()},Iec.LICENSE_AGREEMENT,n,e,r)}makeRequest(e,r){return this.abExpContext&&(e.headers||(e.headers={}),e.headers["VScode-ABExpContext"]=this.abExpContext,e.headers["X-Copilot-Client-Exp-Assignment-Context"]=this.abExpContext),(r.type===I5e.RequestType.Telemetry||r.type===I5e.RequestType.ChatCompletions||r.type===I5e.RequestType.ChatMessages||r.type===I5e.RequestType.ChatResponses)&&(e.callSite=Tec.NO_FETCH_TELEMETRY),super.makeRequest(e,r)}};mge.BaseCAPIClientService=Hxr;mge.ICAPIClientService=(0,Sec.createServiceIdentifier)("ICAPIClientService")});var LAt=I(BAt=>{"use strict";p();Object.defineProperty(BAt,"__esModule",{value:!0});BAt.getEndpointUrl=Dec;BAt.getLastKnownEndpoints=Nec;var xec=CE(),wec=wE(),jG=_E(),Rec=Kte(),Pec=mG();function iDi(t){let e=t.get(wec.ICAPIClientService);return{proxy:e.proxyBaseURL,"origin-tracker":e.originTrackerURL}}a(iDi,"getDefaultEndpoints");function nDi(t,e,r){if(r!==void 0&&t.get(Rec.ICompletionsRuntimeModeService).isRunningInTest()){for(let n of r){let o=(0,jG.getConfig)(t,n);if(o)return o}return}for(let n of e){let o=(0,jG.getConfig)(t,n);if(o)return o}}a(nDi,"urlConfigOverride");function kec(t,e){switch(e){case"proxy":return nDi(t,[jG.ConfigKey.DebugOverrideProxyUrl,jG.ConfigKey.DebugOverrideProxyUrlLegacy],[jG.ConfigKey.DebugTestOverrideProxyUrl,jG.ConfigKey.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!jG.BuildInfo.isProduction())return nDi(t,[jG.ConfigKey.DebugSnippyOverrideUrl])}}a(kec,"getEndpointOverrideUrl");function Dec(t,e,r,...n){let o=kec(t,r)??(e.endpoints?e.endpoints[r]:void 0)??iDi(t)[r];return(0,Pec.joinPath)(o,...n)}a(Dec,"getEndpointUrl");function Nec(t){return t.get(xec.IAuthenticationService).copilotToken?.endpoints??iDi(t)}a(Nec,"getLastKnownEndpoints")});var $xr=I(x5e=>{"use strict";p();Object.defineProperty(x5e,"__esModule",{value:!0});x5e.Response=void 0;x5e.isAbortError=Oec;var Mec=iy();Object.defineProperty(x5e,"Response",{enumerable:!0,get:a(function(){return Mec.Response},"get")});var Gxr=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function Oec(t){return!t||typeof t!="object"?!1:t instanceof Gxr||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(Oec,"isAbortError")});var gge=I(Em=>{"use strict";p();var Bec=Em&&Em.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Lec=Em&&Em.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Fec=Em&&Em.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Bec(e,t,r)},Vxr=Em&&Em.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Em,"__esModule",{value:!0});Em.Fetcher=Em.CompletionsFetcher=Em.ICompletionsFetcherService=void 0;Em.isInterruptedNetworkError=jec;Fec($xr(),Em);var oDi=Sl(),Uec=iy(),Qec=_p(),qec=tn();Em.ICompletionsFetcherService=(0,qec.createServiceIdentifier)("ICompletionsFetcherService");var Wxr=class{static{a(this,"CompletionsFetcher")}constructor(e,r,n){this.configurationService=e,this.fetcherService=r,this.experimentationService=n}getImplementation(){return this}fetch(e,r){let n=this.configurationService.getExperimentBasedConfig(oDi.ConfigKey.CompletionsFetcher,this.experimentationService)||void 0,o=n?{...r,useFetcher:n}:r;return this.fetcherService.fetch(e,{...o,callSite:o.callSite??"completions-core"})}disconnectAll(){return this.fetcherService.disconnectAll()}};Em.CompletionsFetcher=Wxr;Em.CompletionsFetcher=Wxr=Lec([Vxr(0,oDi.IConfigurationService),Vxr(1,Uec.IFetcherService),Vxr(2,Qec.IExperimentationService)],Wxr);var zxr=class{static{a(this,"Fetcher")}getImplementation(){return this}};Em.Fetcher=zxr;function jec(t){return t instanceof Error?t.message==="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code==="ECONNRESET"||t.code==="ETIMEDOUT"||t.code==="ERR_HTTP2_INVALID_SESSION":!1:!1}a(jec,"isInterruptedNetworkError")});var sDi=I(Age=>{"use strict";p();Object.defineProperty(Age,"__esModule",{value:!0});Age.FeatureName=Age.OutputPaneShowCommand=void 0;Age.OutputPaneShowCommand="codereferencing.showOutputPane2";Age.FeatureName="code-referencing"});var w5e=I(FAt=>{"use strict";p();Object.defineProperty(FAt,"__esModule",{value:!0});FAt.codeReferenceLogger=void 0;var Hec=Tl(),Gec=sDi();FAt.codeReferenceLogger=new Hec.Logger(Gec.FeatureName)});var lDi=I(qAt=>{"use strict";p();Object.defineProperty(qAt,"__esModule",{value:!0});qAt.ConnectionState=void 0;var $ec=Ms(),Vec=Tl(),Wec=LAt(),zec=gge(),R5e=w5e(),Yec=3e3,Yxr=2,aDi=256,cDi=Math.log(aDi)/Math.log(Yxr)/Yxr,vD={connection:"disabled",maxAttempts:cDi,retryAttempts:0,initialWait:!1},UAt,QAt=[];function Kec(){if(UAt)return UAt;function t(_){return QAt.push(_),()=>{let v=QAt.indexOf(_);v!==-1&&QAt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of QAt)_()}a(e,"afterUpdateConnection");function r(_){vD.connection!==_&&(vD.connection=_,e())}a(r,"updateConnection");function n(){return vD.connection==="connected"}a(n,"isConnected");function o(){return vD.connection==="disconnected"}a(o,"isDisconnected");function s(){return vD.connection==="retry"}a(s,"isRetrying");function c(){return vD.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){vD.initialWait!==_&&(vD.initialWait=_)}a(h,"setInitialWait");function m(_,v=Yec){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return vD.initialWait}a(g,"isInitialWait");async function A(_,v){let b=_.get(Vec.ICompletionsLogTargetService),T=_.get(zec.ICompletionsFetcherService),w=_.get($ec.IInstantiationService);R5e.codeReferenceLogger.info(b,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);function R(x){if(x>aDi){R5e.codeReferenceLogger.info(b,"Max retry time reached, disabling."),f();return}let P=a(async()=>{vD.retryAttempts=Math.min(vD.retryAttempts+1,cDi);try{R5e.codeReferenceLogger.info(b,`Pinging service after ${x} second(s)`);let D=await T.fetch(new URL("_ping",w.invokeFunction(Wec.getLastKnownEndpoints)["origin-tracker"]).href,{callSite:"snippy-ping",method:"GET",headers:{"content-type":"application/json"}});if(D.status!==200||!D.ok)R(x**2);else{R5e.codeReferenceLogger.info(b,"Successfully reconnected."),l();return}}catch{R(x**2)}},"tryAgain");setTimeout(()=>{P()},x*1e3)}a(R,"succeedOrRetry"),R5e.codeReferenceLogger.info(b,"Attempting to reconnect."),R(Yxr)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),UAt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},UAt}a(Kec,"registerConnectionState");qAt.ConnectionState=Kec()});var dDi=I(Bg=>{"use strict";p();Object.defineProperty(Bg,"__esModule",{value:!0});Bg.ErrorMessages=Bg.ErrorReasons=void 0;Bg.getErrorType=uDi;Bg.createErrorResponse=Jec;Bg.ErrorReasons={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"};Bg.ErrorMessages={[Bg.ErrorReasons.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Bg.ErrorReasons.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Bg.ErrorReasons.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function uDi(t){return t===401?Bg.ErrorReasons.Unauthorized:t===400?Bg.ErrorReasons.BadArguments:t===404?Bg.ErrorReasons.NotFound:t===429?Bg.ErrorReasons.RateLimit:t>=500&&t<600?Bg.ErrorReasons.InternalError:t>=600?Bg.ErrorReasons.ConnectionError:Bg.ErrorReasons.Unknown}a(uDi,"getErrorType");function Jec(t,e,r={}){return{kind:"failure",reason:uDi(Number(t)),code:Number(t),msg:e,meta:r}}a(Jec,"createErrorResponse")});var ewr=I(I4=>{"use strict";p();Object.defineProperty(I4,"__esModule",{value:!0});I4.NoopTelemetryReporter=I4.snippyTelemetry=I4.matchNotificationTelemetry=I4.copilotOutputLogTelemetry=void 0;var Zec=Tl(),RE=Ig(),Xec=w5e(),etc=/^[1-6][0-9][0-9]$/,ttc=/([A-Z][a-z]+)/,rtc="code_referencing",yge=class{static{a(this,"CodeQuoteTelemetry")}constructor(e){this.baseKey=e}buildKey(...e){return[rtc,this.baseKey,...e].join(".")}},Kxr=class extends yge{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({instantiationService:e}){let r=this.buildKey("open","count"),n=RE.TelemetryData.createAndMarkAsIssued();e.invokeFunction(RE.telemetry,r,n)}handleFocus({instantiationService:e}){let r=RE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("focus","count");e.invokeFunction(RE.telemetry,n,r)}handleWrite({instantiationService:e}){let r=RE.TelemetryData.createAndMarkAsIssued(),n=this.buildKey("write","count");e.invokeFunction(RE.telemetry,n,r)}};I4.copilotOutputLogTelemetry=new Kxr;var Jxr=class extends yge{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({instantiationService:e,actor:r}){let n=RE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");e.invokeFunction(RE.telemetry,o,n)}handleDismiss({instantiationService:e,actor:r}){let n=RE.TelemetryData.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");e.invokeFunction(RE.telemetry,o,n)}};I4.matchNotificationTelemetry=new Jxr;var Zxr=class extends yge{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({instantiationService:e,origin:r,reason:n}){let o=RE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(RE.telemetryError,this.buildKey("unexpectedError"),o)}handleCompletionMissing({instantiationService:e,origin:r,reason:n}){let o=RE.TelemetryData.createAndMarkAsIssued({origin:r,reason:n});e.invokeFunction(RE.telemetryError,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({instantiationService:e,origin:r,reason:n,message:o}){if(!r.match(etc)){e.invokeFunction(l=>Xec.codeReferenceLogger.debug(l.get(Zec.ICompletionsLogTargetService),"Invalid status code, not sending telemetry",{origin:r}));return}let s=n.split(ttc).filter(l=>!!l).join("_").toLowerCase(),c=RE.TelemetryData.createAndMarkAsIssued({message:o});e.invokeFunction(RE.telemetryError,this.buildKey(s,r),c)}};I4.snippyTelemetry=new Zxr;var Xxr=class extends yge{static{a(this,"NoopTelemetryReporter")}constructor(e=""){super(e)}telemetry(...e){}telemetryError(...e){}};I4.NoopTelemetryReporter=Xxr});var fDi=I(twr=>{"use strict";p();Object.defineProperty(twr,"__esModule",{value:!0});twr.call=dtc;var ntc=Ms(),itc=ome(),otc=_E(),stc=Tl(),atc=LAt(),ctc=gge(),Ege=lDi(),ch=dDi(),ltc=w5e(),utc=ewr();async function dtc(t,e,r,n){let o,s=t.get(stc.ICompletionsLogTargetService),c=t.get(ntc.IInstantiationService),l=t.get(itc.ICompletionsCopilotTokenManager);try{o=l.token??await l.getToken()}catch{return Ege.ConnectionState.setDisconnected(),(0,ch.createErrorResponse)(401,ch.ErrorMessages[ch.ErrorReasons.Unauthorized])}if(ltc.codeReferenceLogger.info(s,`Calling ${e}`),Ege.ConnectionState.isRetrying())return(0,ch.createErrorResponse)(600,"Attempting to reconnect to the public code matching service.");if(Ege.ConnectionState.isDisconnected())return(0,ch.createErrorResponse)(601,"The public code matching service is offline.");let u;try{u=await c.invokeFunction(_=>_.get(ctc.ICompletionsFetcherService).fetch((0,atc.getEndpointUrl)(_,o,"origin-tracker",e),{callSite:"snippy-network",method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...(0,otc.editorVersionHeaders)(_)},signal:n}))}catch{return c.invokeFunction(Ege.ConnectionState.enableRetry),(0,ch.createErrorResponse)(602,"Network error detected. Check your internet connection.")}let d;try{d=await u.json()}catch(_){let v=_.message;throw utc.snippyTelemetry.handleUnexpectedError({instantiationService:c,origin:"snippyNetwork",reason:v}),_}if(u.ok)return{kind:"success",...d};let f={...d,code:Number(u.status)},{code:h,msg:m,meta:g}=f,A=Number(h),y=(0,ch.getErrorType)(A),E=m||"unknown error";switch(y){case ch.ErrorReasons.Unauthorized:return(0,ch.createErrorResponse)(h,ch.ErrorMessages[ch.ErrorReasons.Unauthorized],g);case ch.ErrorReasons.BadArguments:return(0,ch.createErrorResponse)(h,E,g);case ch.ErrorReasons.RateLimit:return c.invokeFunction(_=>Ege.ConnectionState.enableRetry(_,60*1e3)),(0,ch.createErrorResponse)(h,ch.ErrorMessages.RateLimitError,g);case ch.ErrorReasons.InternalError:return c.invokeFunction(_=>Ege.ConnectionState.enableRetry(_)),(0,ch.createErrorResponse)(h,ch.ErrorMessages[ch.ErrorReasons.InternalError],g);default:return(0,ch.createErrorResponse)(h,E,g)}}a(dtc,"call")});var rwr=I(Kb=>{"use strict";p();Object.defineProperty(Kb,"__esModule",{value:!0});Kb.FileMatchResponse=Kb.FileMatchRequest=Kb.MatchResponse=Kb.MatchRequest=Kb.MatchError=void 0;var ha=wmt();Kb.MatchError=ha.Type.Object({kind:ha.Type.Literal("failure"),reason:ha.Type.String(),code:ha.Type.Number(),msg:ha.Type.String(),meta:ha.Type.Optional(ha.Type.Any())});var ftc=ha.Type.Object({matched_source:ha.Type.String(),occurrences:ha.Type.String(),capped:ha.Type.Boolean(),cursor:ha.Type.String(),github_url:ha.Type.String()});Kb.MatchRequest=ha.Type.Object({source:ha.Type.String()});var ptc=ha.Type.Object({snippets:ha.Type.Array(ftc)});Kb.MatchResponse=ha.Type.Union([ptc,Kb.MatchError]);Kb.FileMatchRequest=ha.Type.Object({cursor:ha.Type.String()});var htc=ha.Type.Object({commit_id:ha.Type.String(),license:ha.Type.String(),nwo:ha.Type.String(),path:ha.Type.String(),url:ha.Type.String()}),mtc=ha.Type.Object({has_next_page:ha.Type.Boolean(),cursor:ha.Type.String()}),gtc=ha.Type.Object({count:ha.Type.Record(ha.Type.String(),ha.Type.String())}),Atc=ha.Type.Object({file_matches:ha.Type.Array(htc),page_info:mtc,license_stats:gtc});Kb.FileMatchResponse=ha.Type.Union([Atc,Kb.MatchError])});var gDi=I(x4=>{"use strict";p();var ytc=x4&&x4.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Etc=x4&&x4.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),pDi=x4&&x4.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(e6,"__esModule",{value:!0});e6.MinTokenLength=void 0;e6.lexemeLength=ADi;e6.offsetLastLexemes=btc;e6.hasMinLexemeLength=Stc;var P5e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu");e6.MinTokenLength=65;function ADi(t){let e=0,r;P5e.lastIndex=0;do if(r=P5e.exec(t),r&&(e+=1),e>=e6.MinTokenLength)break;while(r);return e}a(ADi,"lexemeLength");function Ctc(t,e){let r=0,n;P5e.lastIndex=0;do if(n=P5e.exec(t),n&&(r+=1,r>=e))return P5e.lastIndex;while(n);return t.length}a(Ctc,"offsetFirstLexemes");function btc(t,e){let r=t.split("").reverse().join(""),n=Ctc(r,e);return r.length-n}a(btc,"offsetLastLexemes");function Stc(t){return ADi(t)>=e6.MinTokenLength}a(Stc,"hasMinLexemeLength")});var SDi=I(t6=>{"use strict";p();var Ttc=t6&&t6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Itc=t6&&t6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),CDi=t6&&t6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o_Di(E,()=>EDi.Match(E,f)));if(!h||vDi(h)||!h.snippets.length){nwr.codeReferenceLogger.info(s,"No match found");return}nwr.codeReferenceLogger.info(s,"Match found");let{snippets:m}=h,g=m.map(async E=>{let _=await o.invokeFunction(T=>_Di(T,()=>EDi.FilesForMatch(T,{cursor:E.cursor})));if(!_||vDi(_))return;let v=_.file_matches,b=_.license_stats;return{match:E,files:v,licenseStats:b}}),y=(await Promise.all(g)).filter(E=>E!==void 0);if(y.length)for(let E of y){let _=new Set(Object.keys(E.licenseStats?.count??{}));_.has("NOASSERTION")&&(_.delete("NOASSERTION"),_.add("unknown"));let v=Array.from(_).sort(),b=n,T=n+E.match.matched_source.length,w=u.positionAt(b),R=u.positionAt(T);await l.handleIPCodeCitation({inDocumentUri:e,offsetStart:b,offsetEnd:T,version:u.version,location:{start:w,end:R},matchingText:f,details:v.map(x=>({license:x,url:E.match.github_url}))})}}a(Mtc,"fetchCitations")});var PDi=I(HG=>{"use strict";p();Object.defineProperty(HG,"__esModule",{value:!0});HG.editDistance=IDi;HG.emptyLexDictionary=xDi;HG.reverseLexDictionary=wDi;HG.lexGeneratorWords=RDi;HG.lexicalAnalyzer=iwr;HG.lexEditDistance=Otc;function IDi(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(RDi,"lexGeneratorWords");function iwr(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(iwr,"lexicalAnalyzer");function TDi(t){return t!==" "}a(TDi,"notSingleSpace");function Otc(t,e,r=RDi){let[n,o]=iwr(t,xDi(),r,TDi),[s,c]=iwr(e,o,r,TDi);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=wDi(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v===0&&b.endsWith(d)||v===u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=IDi(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(Otc,"lexEditDistance")});var owr=I(Ere=>{"use strict";p();Object.defineProperty(Ere,"__esModule",{value:!0});Ere.PartialAcceptTriggerKind=void 0;Ere.computeCompCharLen=Btc;Ere.countLines=Ltc;Ere.computeCompletionText=Ftc;var kDi;(function(t){t[t.Unknown=0]="Unknown",t[t.Word=1]="Word",t[t.Line=2]="Line",t[t.Suggest=3]="Suggest"})(kDi||(Ere.PartialAcceptTriggerKind=kDi={}));function Btc(t,e){return t.compType==="partial"?t.acceptedLength:e.length}a(Btc,"computeCompCharLen");function Ltc(t){return t.length===0?0:t.split(` +`).length}a(Ltc,"countLines");function Ftc(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(Ftc,"computeCompletionText")});var qDi=I(VAt=>{"use strict";p();Object.defineProperty(VAt,"__esModule",{value:!0});VAt.postRejectionTasks=Ktc;VAt.postInsertionTasks=Jtc;var $At=Ms(),MDi=_ee(),Utc=ome(),GAt=zxi(),Qtc=d0t(),qtc=Zbr(),ODi=vbr(),BDi=Wme(),vge=Tl(),DDi=Jmt(),jtc=age(),Htc=SDi(),NDi=PDi(),Gtc=owr(),GG=Ig(),$tc=qb(),LDi=PMe(),Vtc=Kte(),$G=new vge.Logger("postInsertion"),FDi=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],UDi=50,Wtc=1500,ztc=.5,Ytc=500,swr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function QDi(t,e,r,n,o){let s=t.get($At.IInstantiationService),c=t.get(vge.ICompletionsLogTargetService),l=await t.get(ODi.ICompletionsFileReaderService).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(l.status!=="valid")return $G.info(c,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let u=l.document,d=u.getText(),f=d.substring(0,n),h=u.positionAt(n),m=await s.invokeFunction(jtc.extractPrompt,r.properties.headerRequestId,(0,qtc.createCompletionState)(u,h),r),g=m.type==="prompt"?m.prompt:{prefix:f,suffix:"",isFimEnabled:!1};if(g.isFimEnabled&&o!==void 0){let A=d.substring(n,o);return g.suffix=d.substring(o),{prompt:g,capturedCode:A,terminationOffset:0}}else{let A=d.substring(n),y=(0,DDi.contextIndentationFromText)(f,n,u.detectedLanguageId),_=(0,DDi.indentationBlockFinished)(y,void 0)(A),v=Math.min(d.length,n+(_?_*2:Ytc)),b=d.substring(n,v);return{prompt:g,capturedCode:b,terminationOffset:_??-1}}}a(QDi,"captureCode");function Ktc(t,e,r,n,o){let s=t.get(vge.ICompletionsLogTargetService),c=t.get($At.IInstantiationService),l=t.get(MDi.ICompletionsTelemetryService),u=t.get(LDi.ICompletionsPromiseQueueService);o.forEach(({completionText:m,completionTelemetryData:g})=>{$G.debug(s,`${e}.rejected choiceIndex: ${g.properties.choiceIndex}`),c.invokeFunction(BDi.telemetryRejected,e,g)});let d=c.createInstance(GAt.ChangeTracker,n,r-1),f=c.createInstance(GAt.ChangeTracker,n,r),h=a(async m=>{$G.debug(s,`Original offset: ${r}, Tracked offset: ${d.offset}`);let{completionTelemetryData:g}=o[0],{prompt:A,capturedCode:y,terminationOffset:E}=await c.invokeFunction(QDi,n,g,d.offset+1,f.offset),_={hypotheticalPromptJson:JSON.stringify({prefix:A.prefix,context:A.context}),hypotheticalPromptSuffixJson:JSON.stringify(A.suffix)},v=g.extendedBy({..._,capturedCodeJson:JSON.stringify(y)},{timeout:m.seconds,insertionOffset:r,trackedOffset:d.offset,terminationOffsetInCapturedCode:E});$G.debug(s,`${e}.capturedAfterRejected choiceIndex: ${g.properties.choiceIndex}`,v),c.invokeFunction(GG.telemetry,e+".capturedAfterRejected",v,GG.TelemetryStore.Enhanced)},"checkInCode");FDi.filter(m=>m.captureRejection).map(m=>d.push((0,GG.telemetryCatch)(l,u,()=>h(m),"postRejectionTasks"),m.seconds*1e3))}a(Ktc,"postRejectionTasks");function Jtc(t,e,r,n,o,s,c,l){let u=t.get(vge.ICompletionsLogTargetService),d=t.get($At.IInstantiationService),f=t.get(LDi.ICompletionsPromiseQueueService),h=t.get(MDi.ICompletionsTelemetryService),m=t.get(Vtc.ICompletionsRuntimeModeService),g=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});$G.debug(u,`${e}.accepted choiceIndex: ${g.properties.choiceIndex}`),d.invokeFunction(BDi.telemetryAccepted,e,g);let A=r;r=(0,Gtc.computeCompletionText)(r,c);let y=r.trim(),E=d.createInstance(GAt.ChangeTracker,o,n),_=d.createInstance(GAt.ChangeTracker,o,n+r.length),v=a(async b=>{await d.invokeFunction(trc,e,y,n,o,b,g,E,_)},"stillInCodeCheck");if(swr.triggerPostInsertionSynchroneously&&m.isRunningInTest()){let b=v({seconds:0,captureCode:swr.captureCode,captureRejection:swr.captureRejection});f.register(b)}else FDi.map(b=>E.push((0,GG.telemetryCatch)(h,f,()=>v(b),"postInsertionTasks"),b.seconds*1e3));d.invokeFunction(b=>(0,GG.telemetryCatch)(h,f,Ztc,"post insertion citation check")(b,o,A,r,n,l))}a(Jtc,"postInsertionTasks");async function Ztc(t,e,r,n,o,s){let c=t.get(vge.ICompletionsLogTargetService),l=t.get($tc.ICompletionsTextDocumentManagerService),u=t.get(Utc.ICompletionsCopilotTokenManager),d=t.get(Qtc.ICompletionsCitationManager);if(!s||(s.ip_code_citations?.length??0)<1){if(u.getLastToken()?.getTokenValue("sn")==="1")return;await(0,Htc.fetchCitations)(t,e,n,o);return}let f=await l.getTextDocument({uri:e});if(f){let h=awr(f.getText(),n,UDi,o);h.stillInCodeHeuristic&&(o=h.foundOffset)}for(let h of s.ip_code_citations){let m=Xtc(r.length,n.length,h.start_offset);if(m===void 0){$G.info(c,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let g=o+m,A=f?.positionAt(g),y=o+erc(r.length,n.length,h.stop_offset),E=f?.positionAt(y),_=A&&E?f?.getText({start:A,end:E}):"";await d.handleIPCodeCitation({inDocumentUri:e,offsetStart:g,offsetEnd:y,version:f?.version,location:A&&E?{start:A,end:E}:void 0,matchingText:_,details:h.details.citations})}}a(Ztc,"citationCheck");function Xtc(t,e,r){if(!(ee))return r}a(Xtc,"computeCitationStart");function erc(t,e,r){return e{"use strict";p();Object.defineProperty(oy,"__esModule",{value:!0});oy.LastGhostText=oy.ICompletionsLastGhostText=void 0;oy.rejectLastShown=GDi;oy.setLastShown=orc;oy.handleGhostTextShown=src;oy.handleGhostTextPostInsert=crc;oy.handlePartialGhostTextPostInsert=lrc;var rrc=tn(),jDi=Tl(),lwr=qDi(),WAt=owr(),HDi=AG(),uwr=Wme(),nrc=new jDi.Logger("ghostText");oy.ICompletionsLastGhostText=(0,rrc.createServiceIdentifier)("ICompletionsLastGhostText");var cwr=class{static{a(this,"LastGhostText")}constructor(){this.#r=[],this.linesAccepted=0}#e;#t;#r;get position(){return this.#e}get shownCompletions(){return this.#r||[]}get uri(){return this.#t}resetState(){this.#t=void 0,this.#e=void 0,this.#r=[],this.resetPartialAcceptanceState()}setState({uri:e},r){this.#t=e,this.#e=r,this.#r=[]}resetPartialAcceptanceState(){this.partiallyAcceptedLength=0,this.totalLength=void 0,this.linesLeft=void 0,this.linesAccepted=0}};oy.LastGhostText=cwr;function irc(t){let e=[];return t.shownCompletions.forEach(r=>{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(irc,"computeRejectedCompletions");function GDi(t,e){let r=t.get(oy.ICompletionsLastGhostText);if(!r.position||!r.uri)return;let n=irc(r);n.length>0&&(0,lwr.postRejectionTasks)(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(GDi,"rejectLastShown");function orc(t,e,r,n){let o=t.get(oy.ICompletionsLastGhostText);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==HDi.ResultType.TypingAsSuggested&&GDi(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(orc,"setLastShown");function src(t,e){let r=t.get(jDi.ICompletionsLogTargetService),n=t.get(oy.ICompletionsLastGhostText);if(n.index=e.index,!n.shownCompletions.find(o=>o.index===e.index)&&(e.uri===n.uri&&n.position?.line===e.position.line&&n.position?.character===e.position.character&&n.shownCompletions.push(e),e.displayText)){let o=e.resultType!==HDi.ResultType.Network;nrc.debug(r,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${o}`),e.telemetry.measurements.compCharLen=e.displayText.length,(0,uwr.telemetryShown)(t,e)}}a(src,"handleGhostTextShown");function arc(t,e,r){let n=t.get(oy.ICompletionsLastGhostText);n.linesLeft===void 0&&(n.linesAccepted=(0,WAt.countLines)(e.insertText.substring(0,r)),n.linesLeft=(0,WAt.countLines)(e.displayText));let o=(0,WAt.countLines)(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(arc,"handleLineAcceptance");function crc(t,e){let r=t.get(oy.ICompletionsLastGhostText),n;return r.partiallyAcceptedLength?n={compType:"full",acceptedLength:(r.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:r.linesAccepted+(r.linesLeft??0)}:n={compType:"full",acceptedLength:e.displayText.length,acceptedLines:(0,WAt.countLines)(e.displayText)},r.resetState(),(0,lwr.postInsertionTasks)(t,uwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,n,e.copilotAnnotations)}a(crc,"handleGhostTextPostInsert");function lrc(t,e,r){let n=t.get(oy.ICompletionsLastGhostText);arc(t,e,r);let o={compType:"partial",acceptedLength:n.partiallyAcceptedLength||0,acceptedLines:n.linesAccepted};return(0,lwr.postInsertionTasks)(t,uwr.GHOST_TEXT_CATEGORY,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(lrc,"handlePartialGhostTextPostInsert")});var $Di=I(fwr=>{"use strict";p();Object.defineProperty(fwr,"__esModule",{value:!0});fwr.normalizeIndentCharacter=urc;function urc(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(Unc,"normalizeIndentCharacter")});var DDi=I(gwr=>{"use strict";p();Object.defineProperty(gwr,"__esModule",{value:!0});gwr.completionsFromGhostTextResults=Hnc;var Qnc=um(),eyt=Hme(),qnc=PDi(),jnc=xG();function Hnc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=eyt.LocationFactory.range(eyt.LocationFactory.position(n.line,0),eyt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,qnc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=eyt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,Qnc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===jnc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(Hnc,"completionsFromGhostTextResults")});var Ewr=I(TD=>{"use strict";p();var Gnc=TD&&TD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$nc=TD&&TD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Vnc=TD&&TD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(Wnc,"createRequestHMAC");async function znc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a(znc,"createSha256Hash");var Awr=new Map;function Ync(t){if(Awr.has(t))return Awr.get(t);let e=Knc(t);return Awr.set(t,e),e}a(Ync,"getCachedSha256Hash");function Knc(t){let e=new ywr;return e.update(t),e.digest()}a(Knc,"createSha256HashSyncInsecure");function r$(t,e=32){return t instanceof ArrayBuffer?(0,NDi.encodeHex)(NDi.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(r$,"toHexString");function M4(t,e){return(t>>>e|t<<32-e)>>>0}a(M4,"rightRotate");var ywr=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(tyt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),r$(this._h0)+r$(this._h1)+r$(this._h2)+r$(this._h3)+r$(this._h4)+r$(this._h5)+r$(this._h6)+r$(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),E=M4(A,7)^M4(A,18)^A>>>3,_=M4(y,17)^M4(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=M4(u,6)^M4(u,11)^M4(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=M4(o,2)^M4(o,13)^M4(o,22),_=o&s^o&c^s&c,v=E+_>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var _wr=I(ryt=>{"use strict";p();Object.defineProperty(ryt,"__esModule",{value:!0});ryt.isInlineSuggestionFromTextAfterCursor=MDi;ryt.determineIsInlineSuggestionPosition=Jnc;function MDi(t){let e=Znc(t),r=Xnc(t);if(!(e&&!r))return e&&r}a(MDi,"isInlineSuggestionFromTextAfterCursor");function Jnc(t){let e=t.textAfterCursor();return MDi(e)}a(Jnc,"determineIsInlineSuggestionPosition");function Znc(t){return t.trim().length!==0}a(Znc,"isMiddleOfTheLineFromTextAfterCursor");function Xnc(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Xnc,"isValidMiddleOfTheLineFromTextAfterCursor")});var iyt=I(n$=>{"use strict";p();Object.defineProperty(n$,"__esModule",{value:!0});n$.NoOpStatusReporter=n$.StatusReporter=n$.ICompletionsStatusReporter=void 0;var eic=rn();n$.ICompletionsStatusReporter=(0,eic.createServiceIdentifier)("ICompletionsStatusReporter");var nyt=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};n$.StatusReporter=nyt;var Cwr=class extends nyt{static{a(this,"NoOpStatusReporter")}didChange(){}};n$.NoOpStatusReporter=Cwr});var Iwr=I(ry=>{"use strict";p();Object.defineProperty(ry,"__esModule",{value:!0});ry.AdoRepoId=ry.GithubRepoId=ry.IGitService=void 0;ry.getGitHubRepoInfoFromContext=nic;ry.getOrderedRepoInfosFromContext=iic;ry.getOrderedRemoteUrlsFromContext=bwr;ry.parseRemoteUrl=Swr;ry.toGithubNwo=ODi;ry.toGithubWebUrl=oic;ry.getGithubRepoIdFromFetchUrl=Twr;ry.getAdoRepoIdFromFetchUrl=BDi;ry.normalizeFetchUrl=sic;var tic=rn(),vwr=Gh(),ric=Ku();ry.IGitService=(0,tic.createServiceIdentifier)("IGitService");function nic(t){for(let e of bwr(t))if(e){let r=Twr(e);if(r)return{id:r,remoteUrl:e}}}a(nic,"getGitHubRepoInfoFromContext");function*iic(t){for(let e of bwr(t)){let r=Twr(e)??BDi(e);r&&(yield{repoId:r,fetchUrl:e})}}a(iic,"getOrderedRepoInfosFromContext");function bwr(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(bwr,"getOrderedRemoteUrlsFromContext");function Swr(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=ric.URI.parse(t),r=e.authority,n=e.path;if(!((0,vwr.equalsIgnoreCase)(e.scheme,"ssh")||(0,vwr.equalsIgnoreCase)(e.scheme,"https")||(0,vwr.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(Swr,"parseRemoteUrl");var oyt=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return ODi(this)}};ry.GithubRepoId=oyt;function ODi(t){return`${t.org}/${t.repo}`.toLowerCase()}a(ODi,"toGithubNwo");function oic(t){return`https://${t.host}/${t.org}/${t.repo}`}a(oic,"toGithubWebUrl");function Twr(t){let e=Swr(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new oyt(s[1],s[2],o):void 0}a(Twr,"getGithubRepoIdFromFetchUrl");var kge=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};ry.AdoRepoId=kge;function BDi(t){let e=Swr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new kge(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new kge(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new kge(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(BDi,"getAdoRepoIdFromFetchUrl");function sic(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a(sic,"normalizeFetchUrl")});var Rwr=I(Tre=>{"use strict";p();Object.defineProperty(Tre,"__esModule",{value:!0});Tre.ComputationStatus=void 0;Tre.tryGetGitHubNWO=lic;Tre.extractRepoInfoInBackground=uic;Tre.extractRepoInfo=LDi;var xwr=Iwr(),aic=bG(),cic=H8(),H5e=TG();function lic(t){if(t!==void 0&&t!==G5e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(lic,"tryGetGitHubNWO");function uic(t,e){let r=(0,H5e.dirname)(e);return dic(t,r)}a(uic,"extractRepoInfoInBackground");var dic=mic(LDi,1e4);async function LDi(t,e){let r=t.get(aic.ICompletionsFileSystemService),n=(0,H5e.getFsUri)(e);if(!n)return;let o=await pic(r,n);if(!o)return;let s=(0,H5e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=hic(c)??"",u=fic(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(LDi,"extractRepoInfo");function fic(t){let e=(0,xwr.parseRemoteUrl)(t);if(!e)return;let r=(0,xwr.getGithubRepoIdFromFetchUrl)(t)??(0,xwr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(fic,"parseRepoUrl");async function pic(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return G5e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new wwr(d)),n.delete(c)}),G5e.PENDING}}a(mic,"computeInBackgroundAndMemoize")});var UDi=I(kwr=>{"use strict";p();Object.defineProperty(kwr,"__esModule",{value:!0});kwr.isRepetitive=Aic;var gic=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function Aic(t){let e=t.slice();return e.reverse(),FDi(e)||FDi(e.filter(r=>r.trim().length>0))}a(Aic,"isRepetitive");function FDi(t){let e=yic(t);for(let r of gic){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(yic,"kmp_prefix_function")});var qDi=I($5e=>{"use strict";p();Object.defineProperty($5e,"__esModule",{value:!0});$5e.maybeSnipCompletionImpl=QDi;$5e.postProcessChoiceInContext=Sic;$5e.checkSuffix=Tic;var Eic=Ute(),Ire=Tg(),_ic=UDi();function Cic(t,e,r,n){let o="}";try{o=(0,Eic.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return QDi({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Cic,"maybeSnipCompletion");function QDi(t,e,r,n){let o=vic(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(QDi,"maybeSnipCompletionImpl");function vic(t){let e=t.includes(`\r +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(urc,"normalizeIndentCharacter")});var VDi=I(pwr=>{"use strict";p();Object.defineProperty(pwr,"__esModule",{value:!0});pwr.completionsFromGhostTextResults=hrc;var drc=fm(),zAt=Ome(),frc=$Di(),prc=AG();function hrc(t,e,r,n,o,s){let c=r.lineAt(n),l=t.map(u=>{let d=zAt.LocationFactory.range(zAt.LocationFactory.position(n.line,0),zAt.LocationFactory.position(n.line,n.character+u.suffixCoverage)),f="";if(o&&(u.completion=(0,frc.normalizeIndentCharacter)(o,u.completion,c.isEmptyOrWhitespace)),c.isEmptyOrWhitespace&&(u.completion.displayNeedsWsOffset||u.completion.completionText.startsWith(c.text)))f=u.completion.completionText;else{let m=zAt.LocationFactory.range(d.start,n);f=r.getText(m)+u.completion.displayText}return{uuid:(0,drc.generateUuid)(),insertText:f,range:d,uri:r.uri,index:u.completion.completionIndex,telemetry:u.telemetry,displayText:u.completion.displayText,position:n,offset:r.offsetAt(n),resultType:e,copilotAnnotations:u.copilotAnnotations,clientCompletionId:u.clientCompletionId}});if(e===prc.ResultType.TypingAsSuggested&&s!==void 0){let u=l.find(d=>d.index===s);if(u){let d=l.filter(f=>f.index!==s);l=[u,...d]}}return l}a(hrc,"completionsFromGhostTextResults")});var gwr=I(CD=>{"use strict";p();var mrc=CD&&CD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),grc=CD&&CD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Arc=CD&&CD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ou.toString(16).padStart(2,"0")).join("");return`${r}.${l}`}a(yrc,"createRequestHMAC");async function Erc(t){let e=typeof t=="string"?new TextEncoder().encode(t):t,r=await crypto.subtle.digest("SHA-256",e),n=new Uint8Array(r),o="";for(let s of n)o+=s.toString(16).padStart(2,"0");return o}a(Erc,"createSha256Hash");var hwr=new Map;function _rc(t){if(hwr.has(t))return hwr.get(t);let e=vrc(t);return hwr.set(t,e),e}a(_rc,"getCachedSha256Hash");function vrc(t){let e=new mwr;return e.update(t),e.digest()}a(vrc,"createSha256HashSyncInsecure");function VG(t,e=32){return t instanceof ArrayBuffer?(0,WDi.encodeHex)(WDi.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(VG,"toHexString");function w4(t,e){return(t>>>e|t<<32-e)>>>0}a(w4,"rightRotate");var mwr=class t{static{a(this,"StringSHA256Insecure")}static{this._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]}static{this._bigBlock32=new DataView(new ArrayBuffer(256))}constructor(){this._h0=1779033703,this._h1=3144134277,this._h2=1013904242,this._h3=2773480762,this._h4=1359893119,this._h5=2600822924,this._h6=528734635,this._h7=1541459225,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(YAt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),VG(this._h0)+VG(this._h1)+VG(this._h2)+VG(this._h3)+VG(this._h4)+VG(this._h5)+VG(this._h6)+VG(this._h7)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV,n=t._k;for(let m=0;m<64;m+=4)e.setUint32(m,r.getUint32(m,!1),!1);for(let m=16;m<64;m++){let g=m*4,A=e.getUint32((m-15)*4,!1),y=e.getUint32((m-2)*4,!1),E=w4(A,7)^w4(A,18)^A>>>3,_=w4(y,17)^w4(y,19)^y>>>10,v=e.getUint32((m-16)*4,!1),b=e.getUint32((m-7)*4,!1);e.setUint32(g,v+E+b+_>>>0,!1)}let o=this._h0,s=this._h1,c=this._h2,l=this._h3,u=this._h4,d=this._h5,f=this._h6,h=this._h7;for(let m=0;m<64;m++){let g=w4(u,6)^w4(u,11)^w4(u,25),A=u&d^~u&f,y=h+g+A+n[m]+e.getUint32(m*4,!1)>>>0,E=w4(o,2)^w4(o,13)^w4(o,22),_=o&s^o&c^s&c,v=E+_>>>0;h=f,f=d,d=u,u=l+y>>>0,l=c,c=s,s=o,o=y+v>>>0}this._h0=this._h0+o>>>0,this._h1=this._h1+s>>>0,this._h2=this._h2+c>>>0,this._h3=this._h3+l>>>0,this._h4=this._h4+u>>>0,this._h5=this._h5+d>>>0,this._h6=this._h6+f>>>0,this._h7=this._h7+h>>>0}}});var Awr=I(KAt=>{"use strict";p();Object.defineProperty(KAt,"__esModule",{value:!0});KAt.isInlineSuggestionFromTextAfterCursor=zDi;KAt.determineIsInlineSuggestionPosition=Crc;function zDi(t){let e=brc(t),r=Src(t);if(!(e&&!r))return e&&r}a(zDi,"isInlineSuggestionFromTextAfterCursor");function Crc(t){let e=t.textAfterCursor();return zDi(e)}a(Crc,"determineIsInlineSuggestionPosition");function brc(t){return t.trim().length!==0}a(brc,"isMiddleOfTheLineFromTextAfterCursor");function Src(t){let e=t.trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(e)}a(Src,"isValidMiddleOfTheLineFromTextAfterCursor")});var ZAt=I(WG=>{"use strict";p();Object.defineProperty(WG,"__esModule",{value:!0});WG.NoOpStatusReporter=WG.StatusReporter=WG.ICompletionsStatusReporter=void 0;var Trc=tn();WG.ICompletionsStatusReporter=(0,Trc.createServiceIdentifier)("ICompletionsStatusReporter");var JAt=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;get busy(){return this.#e>0}withProgress(e){return this.#t==="Warning"&&this.forceNormal(),this.#e++===0&&this.#o(),e().finally(()=>{--this.#e===0&&this.#o()})}forceStatus(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#o())}forceNormal(){this.#t!=="Inactive"&&this.forceStatus("Normal")}setError(e,r){this.forceStatus("Error",e,r)}setWarning(e){this.#t!=="Error"&&this.forceStatus("Warning",e)}setInactive(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatus("Inactive",e)}clearInactive(){this.#t==="Inactive"&&this.forceStatus("Normal")}#o(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChange(e)}};WG.StatusReporter=JAt;var ywr=class extends JAt{static{a(this,"NoOpStatusReporter")}didChange(){}};WG.NoOpStatusReporter=ywr});var bwr=I(sy=>{"use strict";p();Object.defineProperty(sy,"__esModule",{value:!0});sy.AdoRepoId=sy.GithubRepoId=sy.IGitService=void 0;sy.getGitHubRepoInfoFromContext=wrc;sy.getOrderedRepoInfosFromContext=Rrc;sy.getOrderedRemoteUrlsFromContext=_wr;sy.parseRemoteUrl=vwr;sy.toGithubNwo=YDi;sy.toGithubWebUrl=Prc;sy.getGithubRepoIdFromFetchUrl=Cwr;sy.getAdoRepoIdFromFetchUrl=KDi;sy.normalizeFetchUrl=krc;var Irc=tn(),Ewr=Oh(),xrc=Vu();sy.IGitService=(0,Irc.createServiceIdentifier)("IGitService");function wrc(t){for(let e of _wr(t))if(e){let r=Cwr(e);if(r)return{id:r,remoteUrl:e}}}a(wrc,"getGitHubRepoInfoFromContext");function*Rrc(t){for(let e of _wr(t)){let r=Cwr(e)??KDi(e);r&&(yield{repoId:r,fetchUrl:e})}}a(Rrc,"getOrderedRepoInfosFromContext");function _wr(t){let e=new Set;if(t.remoteFetchUrls?.length===1)return e.add(t.remoteFetchUrls[0]),e;let r=t.remotes.findIndex(o=>o===t.upstreamRemote);if(r!==-1){let o=t.remoteFetchUrls?.[r];o&&e.add(o)}let n=t.remotes.findIndex(o=>o==="origin");if(n!==-1){let o=t.remoteFetchUrls?.[n];o&&e.add(o)}for(let o of t.remoteFetchUrls??[])o&&e.add(o);return e}a(_wr,"getOrderedRemoteUrlsFromContext");function vwr(t){t=t.trim();try{if(/^[\w\d\-]+@/i.test(t)){let u=t.split(":");if(u.length!==2)return;t="ssh://"+u[0]+"/"+u[1]}let e=xrc.URI.parse(t),r=e.authority,n=e.path;if(!((0,Ewr.equalsIgnoreCase)(e.scheme,"ssh")||(0,Ewr.equalsIgnoreCase)(e.scheme,"https")||(0,Ewr.equalsIgnoreCase)(e.scheme,"http")))return;let o=r.split("@");if(o.length>2)return;let s=o.at(-1);if(!s)return;let c=s.toLowerCase().replace(/:\d+$/,"");return{host:c.replace(/^[\w\-]+-/,"").replace(/-[\w\-]+$/,""),rawHost:c,path:n}}catch{return}}a(vwr,"parseRemoteUrl");var XAt=class t{static{a(this,"GithubRepoId")}static parse(e){let r=e.split("/");if(r.length===2)return new t(r[0],r[1])}constructor(e,r,n="github.com"){this.org=e,this.repo=r,this.host=n,this.type="github"}toString(){return YDi(this)}};sy.GithubRepoId=XAt;function YDi(t){return`${t.org}/${t.repo}`.toLowerCase()}a(YDi,"toGithubNwo");function Prc(t){return`https://${t.host}/${t.org}/${t.repo}`}a(Prc,"toGithubWebUrl");function Cwr(t){let e=vwr(t);if(!e)return;let n=["github.com","ghe.com"].find(c=>e.host===c||e.host.endsWith("."+c));if(!n)return;let o=n==="ghe.com"?e.rawHost:"github.com",s=e.path.match(/^\/?([^/]+)\/([^/]+?)(\/|\.git\/?)?$/i);return s?new XAt(s[1],s[2],o):void 0}a(Cwr,"getGithubRepoIdFromFetchUrl");var Cge=class{static{a(this,"AdoRepoId")}constructor(e,r,n){this.org=e,this.project=r,this.repo=n,this.type="ado"}toString(){return`${this.org}/${this.project}/${this.repo}`.toLowerCase()}};sy.AdoRepoId=Cge;function KDi(t){let e=vwr(t);if(e){if(e.host==="dev.azure.com"){let r=e.path.match(/^\/?(?[^/]+)\/(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new Cge(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host==="ssh.dev.azure.com"){let r=e.path.match(/^\/?v3\/(?[^/]+)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return r?.groups?new Cge(r.groups.org,r.groups.project,r.groups.repo):void 0}if(e.host.endsWith(".visualstudio.com")){let r=e.host.match(/^(?[^\.]+)\.visualstudio\.com$/i);if(!r?.groups)return;let n=e.path.match(/^\/(v3\/)(?[^/]+?)\/(?[^/]+?)\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i)??e.path.match(/^\/?((?[^/]+?)\/)?(?[^/]+?)\/_git\/(?:_(?:optimized|full)\/)?(?[^/]+?)(\.git|\/)?$/i);return n?.groups?new Cge(r.groups.org,n.groups.project,n.groups.repo):void 0}}}a(KDi,"getAdoRepoIdFromFetchUrl");function krc(t){if(/^[\w\d\-]+@[\w\d\.\-]+:/.test(t))return t=t.replace(/([\w\d\-]+)@([\w\d\.\-]+):(.+)/,"https://$2/$3"),t;let e;try{e=new URL(t)}catch{return t}let r=e.pathname.match(/^\/scm\/scm\.git/),n=new URL("https://"+e.hostname+e.pathname);return!r&&/^\/scm\/[^/]/.test(n.pathname)&&(n.pathname=n.pathname.replace(/^\/scm\//,"/")),n.toString()}a(krc,"normalizeFetchUrl")});var Iwr=I(_re=>{"use strict";p();Object.defineProperty(_re,"__esModule",{value:!0});_re.ComputationStatus=void 0;_re.tryGetGitHubNWO=Mrc;_re.extractRepoInfoInBackground=Orc;_re.extractRepoInfo=JDi;var Swr=bwr(),Drc=pG(),Nrc=O8(),k5e=mG();function Mrc(t){if(t!==void 0&&t!==D5e.PENDING&&t.repoId?.type==="github")return(t.repoId.org+"/"+t.repoId.repo).toLowerCase()}a(Mrc,"tryGetGitHubNWO");function Orc(t,e){let r=(0,k5e.dirname)(e);return Brc(t,r)}a(Orc,"extractRepoInfoInBackground");var Brc=Qrc(JDi,1e4);async function JDi(t,e){let r=t.get(Drc.ICompletionsFileSystemService),n=(0,k5e.getFsUri)(e);if(!n)return;let o=await Frc(r,n);if(!o)return;let s=(0,k5e.joinPath)(o,".git","config"),c;try{c=await r.readFileString(s)}catch{return}let l=Urc(c)??"",u=Lrc(l),d={uri:o};return u===void 0?{baseFolder:d,url:l,hostname:"",pathname:"",repoId:void 0}:{baseFolder:d,url:l,hostname:u.host,pathname:u.path,repoId:u.repoId}}a(JDi,"extractRepoInfo");function Lrc(t){let e=(0,Swr.parseRemoteUrl)(t);if(!e)return;let r=(0,Swr.getGithubRepoIdFromFetchUrl)(t)??(0,Swr.getAdoRepoIdFromFetchUrl)(t);return{...e,repoId:r}}a(Lrc,"parseRepoUrl");async function Frc(t,e){let r=e+"_add_to_make_longer";for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return D5e.PENDING;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new Twr(d)),n.delete(c)}),D5e.PENDING}}a(Qrc,"computeInBackgroundAndMemoize")});var XDi=I(xwr=>{"use strict";p();Object.defineProperty(xwr,"__esModule",{value:!0});xwr.isRepetitive=jrc;var qrc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function jrc(t){let e=t.slice();return e.reverse(),ZDi(e)||ZDi(e.filter(r=>r.trim().length>0))}a(jrc,"isRepetitive");function ZDi(t){let e=Hrc(t);for(let r of qrc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Hrc,"kmp_prefix_function")});var tNi=I(N5e=>{"use strict";p();Object.defineProperty(N5e,"__esModule",{value:!0});N5e.maybeSnipCompletionImpl=eNi;N5e.postProcessChoiceInContext=Yrc;N5e.checkSuffix=Krc;var Grc=Mte(),vre=Ig(),$rc=XDi();function Vrc(t,e,r,n){let o="}";try{o=(0,Grc.getBlockCloseToken)(e.detectedLanguageId)??"}"}catch{}return eNi({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(Vrc,"maybeSnipCompletion");function eNi(t,e,r,n){let o=Wrc(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(eNi,"maybeSnipCompletionImpl");function Wrc(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(vic,"splitByNewLine");function bic(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(Tic,"checkSuffix")});var $Di=I(i$=>{"use strict";p();Object.defineProperty(i$,"__esModule",{value:!0});i$.DocumentLogEntry=void 0;i$.serializeOffsetRange=Iic;i$.deserializeOffsetRange=xic;i$.serializeEdit=wic;i$.deserializeEdit=Ric;var jDi=gE(),GDi=sd(),HDi;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(HDi||(i$.DocumentLogEntry=HDi={}));function Iic(t){return[t.start,t.endExclusive]}a(Iic,"serializeOffsetRange");function xic(t){return new GDi.OffsetRange(t[0],t[1])}a(xic,"deserializeOffsetRange");function wic(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(wic,"serializeEdit");function Ric(t){return jDi.StringEdit.create(t.map(e=>jDi.StringReplacement.replace(new GDi.OffsetRange(e[0],e[1]),e[2])))}a(Ric,"deserializeEdit")});var Pge=I(A0=>{"use strict";p();Object.defineProperty(A0,"__esModule",{value:!0});A0.StatelessNextEditTelemetryBuilder=A0.StatelessNextEditResult=A0.NoNextEditReason=A0.FilteredOutReason=A0.StatelessNextEditDocument=A0.StatelessNextEditRequest=A0.RequestEditWindowWithCursorJump=A0.RequestEditWindow=A0.WithStatelessProviderTelemetry=void 0;var VDi=Gx(),Pwr=Yu(),kic=Xc(),Pic=SP(),Dic=gE(),Nic=CT(),Mic=$Di(),Oic=ypr(),Dwr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};A0.WithStatelessProviderTelemetry=Dwr;var Nwr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};A0.RequestEditWindow=Nwr;var Mwr=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};A0.RequestEditWindowWithCursorJump=Mwr;var Owr=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new Pic.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=Dic.StringEdit.empty,this._result=new kic.DeferredPromise,(0,Pwr.assert)(o.length>0),(0,Pwr.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest +`;return{lines:t.split(e),newLineCharacter:e}}a(Wrc,"splitByNewLine");function zrc(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(Krc,"checkSuffix")});var oNi=I(zG=>{"use strict";p();Object.defineProperty(zG,"__esModule",{value:!0});zG.DocumentLogEntry=void 0;zG.serializeOffsetRange=Jrc;zG.deserializeOffsetRange=Zrc;zG.serializeEdit=Xrc;zG.deserializeEdit=enc;var rNi=hE(),iNi=sd(),nNi;(function(t){function e(r){return!!r&&typeof r=="object"&&"id"in r&&"time"in r}a(e,"is"),t.is=e})(nNi||(zG.DocumentLogEntry=nNi={}));function Jrc(t){return[t.start,t.endExclusive]}a(Jrc,"serializeOffsetRange");function Zrc(t){return new iNi.OffsetRange(t[0],t[1])}a(Zrc,"deserializeOffsetRange");function Xrc(t){return t.replacements.map(e=>[e.replaceRange.start,e.replaceRange.endExclusive,e.newText])}a(Xrc,"serializeEdit");function enc(t){return rNi.StringEdit.create(t.map(e=>rNi.StringReplacement.replace(new iNi.OffsetRange(e[0],e[1]),e[2])))}a(enc,"deserializeEdit")});var bge=I(y0=>{"use strict";p();Object.defineProperty(y0,"__esModule",{value:!0});y0.StatelessNextEditTelemetryBuilder=y0.StatelessNextEditResult=y0.NoNextEditReason=y0.FilteredOutReason=y0.StatelessNextEditDocument=y0.StatelessNextEditRequest=y0.RequestEditWindowWithCursorJump=y0.RequestEditWindow=y0.WithStatelessProviderTelemetry=void 0;var sNi=Hx(),wwr=Gu(),tnc=zc(),rnc=ik(),nnc=hE(),inc=AT(),onc=oNi(),snc=wpr(),Rwr=class{static{a(this,"WithStatelessProviderTelemetry")}constructor(e,r){this.v=e,this.telemetryBuilder=r}};y0.WithStatelessProviderTelemetry=Rwr;var Pwr=class{static{a(this,"RequestEditWindow")}constructor(e){this.window=e}containsCursor(e){return this.window.containsRange(e)}};y0.RequestEditWindow=Pwr;var kwr=class{static{a(this,"RequestEditWindowWithCursorJump")}constructor(e,r){this.window=e,this.originalWindow=r}containsCursor(e){return this.window.containsRange(e)||this.originalWindow.containsRange(e)}};y0.RequestEditWindowWithCursorJump=kwr;var Dwr=class t{static{a(this,"StatelessNextEditRequest")}static{this.ID=0}get result(){return this._result.p}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g){this.headerRequestId=e,this.opportunityId=r,this.documentBeforeEdits=n,this.documents=o,this.activeDocumentIdx=s,this.xtabEditHistory=c,this.firstEdit=l,this.expandedEditWindowNLines=u,this.isSpeculative=d,this.logContext=f,this.recordingBookmark=h,this.recording=m,this.providerRequestStartDateTime=g,this.seqid=String(++t.ID),this.cancellationTokenSource=new rnc.CancellationTokenSource,this.liveDependentants=0,this.fetchIssued=!1,this.intermediateUserEdit=nnc.StringEdit.empty,this._result=new tnc.DeferredPromise,(0,wwr.assert)(o.length>0),(0,wwr.assert)(s>=0&&sr.id===e)!==void 0}getActiveDocument(){return this.documents[this.activeDocumentIdx]}serialize(){return{id:this.headerRequestId,documents:this.documents.map(e=>e.serialize()),activeDocumentIdx:this.activeDocumentIdx,recording:this.recording}}toString(){return this.toMarkdown()}toMarkdown(){return`### StatelessNextEditRequest ${this.documents.map((r,n)=>` * [${n+1}/${this.documents.length}] ${n===this.activeDocumentIdx?"(active document) ":""}`+r.toMarkdown()).join(` -`)}`}};A0.StatelessNextEditRequest=Owr;var Bwr=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new Nic.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,Mic.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** +`)}`}};y0.StatelessNextEditRequest=Dwr;var Nwr=class{static{a(this,"StatelessNextEditDocument")}constructor(e,r,n,o,s,c,l,u=void 0){this.id=e,this.workspaceRoot=r,this.languageId=n,this.documentLinesBeforeEdit=o,this.recentEdit=s,this.documentBeforeEdits=c,this.recentEdits=l,this.lastSelectionInAfterEdit=u,this.documentAfterEdits=new inc.StringText(this.recentEdits.apply(this.documentBeforeEdits.value)),this.documentAfterEditsLines=this.documentAfterEdits.getLines()}serialize(){return{id:this.id.uri,workspaceRoot:this.workspaceRoot?.toString(),languageId:this.languageId,documentLinesBeforeEdit:this.documentLinesBeforeEdit,recentEdit:this.recentEdit.serialize(),documentBeforeEdits:this.documentBeforeEdits.value,recentEdits:this.recentEdits.serialize(),lastSelectionInAfterEdit:this.lastSelectionInAfterEdit===void 0?void 0:(0,onc.serializeOffsetRange)(this.lastSelectionInAfterEdit)}}toString(){return this.toMarkdown()}toMarkdown(){let e=[];return e.push(`StatelessNextEditDocument: **${this.id.uri}** `),e.push("```patch"),e.push(this.recentEdit.humanReadablePatch(this.documentLinesBeforeEdit)),e.push("```"),e.push(""),e.join(` -`)}};A0.StatelessNextEditDocument=Bwr;var WDi;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(WDi||(A0.FilteredOutReason=WDi={}));var O4;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(O4||(A0.NoNextEditReason=O4={}));var Lwr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=VDi.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=VDi.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};A0.StatelessNextEditResult=Lwr;var Fwr=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,Oic.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` -`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof O4.ActiveDocumentHasNoEdits||e.err instanceof O4.NoSuggestions||(e.err instanceof O4.GotCancelled||e.err instanceof O4.FilteredOut||e.err instanceof O4.PromptTooLarge?d=e.err.message:e.err instanceof O4.FetchFailure||e.err instanceof O4.Uncategorized||e.err instanceof O4.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,Pwr.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,diffTokensInPrompt:this._diffTokensInPrompt,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};A0.StatelessNextEditTelemetryBuilder=Fwr});var zDi=I(syt=>{"use strict";p();Object.defineProperty(syt,"__esModule",{value:!0});syt.StreamCopilotAnnotations=void 0;var Uwr=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};syt.StreamCopilotAnnotations=Uwr});var ayt=I(o$=>{"use strict";p();Object.defineProperty(o$,"__esModule",{value:!0});o$.ICompletionsFetchService=o$.CompletionsFetchError=o$.Completions=void 0;var Bic=rn(),YDi;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(YDi||(o$.Completions=YDi={}));var Qwr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};o$.CompletionsFetchError=Qwr;o$.ICompletionsFetchService=(0,Bic.createServiceIdentifier)("ICompletionsFetchService")});var V5e=I(Dge=>{"use strict";p();Object.defineProperty(Dge,"__esModule",{value:!0});Dge.CacheType=Dge.CustomDataPartMimeTypes=void 0;var KDi;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(KDi||(Dge.CustomDataPartMimeTypes=KDi={}));Dge.CacheType="ephemeral"});var jwr=I(W5e=>{"use strict";p();Object.defineProperty(W5e,"__esModule",{value:!0});W5e.ThinkingDataContainer=void 0;W5e.rawPartAsThinkingData=Fic;var Lic=wo(),JDi=V5e(),qwr=class extends Lic.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:JDi.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};W5e.ThinkingDataContainer=qwr;function Fic(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===JDi.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(Fic,"rawPartAsThinkingData")});var u6=I(CC=>{"use strict";p();Object.defineProperty(CC,"__esModule",{value:!0});CC.FilterReason=CC.FinishedCompletionReason=CC.ChatRole=CC.modelsWithoutResponsesContextManagement=CC.openAIContextManagementCompactionType=void 0;CC.isApiUsage=qic;CC.getCAPITextPart=tNi;CC.rawMessageToCAPI=rNi;var cyt=wo(),Uic=qTe(),Qic=jwr();function qic(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(qic,"isApiUsage");CC.openAIContextManagementCompactionType="compaction";CC.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var ZDi;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(ZDi||(CC.ChatRole=ZDi={}));function tNi(t){return Array.isArray(t)?t.map(e=>tNi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(tNi,"getCAPITextPart");function rNi(t,e){if(Array.isArray(t))return t.map(n=>rNi(n,e));let r=(0,cyt.toMode)(cyt.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===Uic.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===cyt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,Qic.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(rNi,"rawMessageToCAPI");var XDi;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(XDi||(CC.FinishedCompletionReason=XDi={}));var eNi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(eNi||(CC.FilterReason=eNi={}))});var f6=I(d6=>{"use strict";p();Object.defineProperty(d6,"__esModule",{value:!0});d6.getRequestId=Hic;d6.isCopilotAnnotation=Gic;d6.isCodeCitationAnnotation=$ic;d6.isCopilotWebReference=Vic;d6.isOpenAIContextManagementResponse=Wic;d6.isAnthropicContextManagementResponse=zic;d6.isOpenAiFunctionTool=Yic;var jic=u6();function Hic(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(Hic,"getRequestId");function Gic(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(Gic,"isCopilotAnnotation");function $ic(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a($ic,"isCodeCitationAnnotation");function Vic(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(Vic,"isCopilotWebReference");function Wic(t){return"type"in t&&t.type===jic.openAIContextManagementCompactionType}a(Wic,"isOpenAIContextManagementResponse");function zic(t){return"applied_edits"in t}a(zic,"isAnthropicContextManagementResponse");function Yic(t){return t.function!==void 0}a(Yic,"isOpenAiFunctionTool")});var nNi=I(ID=>{"use strict";p();Object.defineProperty(ID,"__esModule",{value:!0});ID.asyncIterableMap=Kic;ID.asyncIterableFilter=Jic;ID.asyncIterableMapFilter=Zic;ID.asyncIterableFromArray=Xic;ID.asyncIterableToArray=eoc;ID.asyncIterableConcat=toc;ID.asyncIterableCount=roc;ID.iterableMap=noc;ID.iterableMapFilter=ioc;async function*Kic(t,e){for await(let r of t)yield e(r)}a(Kic,"asyncIterableMap");async function*Jic(t,e){for await(let r of t)await e(r)&&(yield r)}a(Jic,"asyncIterableFilter");async function*Zic(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(Zic,"asyncIterableMapFilter");async function*Xic(t){for(let e of t)yield Promise.resolve(e)}a(Xic,"asyncIterableFromArray");async function eoc(t){let e=[];for await(let r of t)e.push(r);return e}a(eoc,"asyncIterableToArray");async function*toc(...t){for(let e of t)yield*e}a(toc,"asyncIterableConcat");async function roc(t){let e=0;for await(let r of t)e++;return e}a(roc,"asyncIterableCount");function*noc(t,e){for(let r of t)yield e(r)}a(noc,"iterableMap");function*ioc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(ioc,"iterableMapFilter")});var iNi=I(Hwr=>{"use strict";p();Object.defineProperty(Hwr,"__esModule",{value:!0});Hwr.getKey=soc;function ooc(t,e){return t!==null&&typeof t=="object"&&e in t}a(ooc,"hasKey");function soc(t,e){return ooc(t,e)?t[e]:void 0}a(soc,"getKey")});var Wwr=I(y0=>{"use strict";p();var aoc=y0&&y0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},s$=y0&&y0.__param||function(t,e){return function(r,n){e(r,n,t)}},Gwr;Object.defineProperty(y0,"__esModule",{value:!0});y0.LiveOpenAIFetcher=y0.CMDQuotaExceeded=y0.OpenAIFetcher=y0.ICompletionsOpenAIFetcherService=y0.CopilotUiKind=void 0;y0.sanitizeRequestOptionTelemetry=uNi;y0.postProcessChoices=dNi;var coc=SE(),loc=zDi(),uoc=a4(),Y5e=ayt(),doc=f6(),oNi=o0(),foc=rn(),poc=Yu(),hoc=SP(),moc=cO(),goc=um(),Aoc=Qs(),yoc=pme(),Eoc=s0t(),sNi=vE(),_oc=nNi(),lNi=xl(),Coc=HAt(),aNi=Sge(),voc=iyt(),boc=Rwr(),qT=Tg(),Soc=LOe(),Toc=tre(),z5e=iNi(),lyt=XOe(),Bg=new lNi.Logger("fetchCompletions"),uyt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(uyt||(y0.CopilotUiKind=uyt={}));function Ioc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Ioc,"getProcessingTime");function xoc(t){switch(t){case uyt.GhostText:return"copilot-ghost";case uyt.Panel:return"copilot-panel"}}a(xoc,"uiKindToIntent");y0.ICompletionsOpenAIFetcherService=(0,foc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var dyt=class{static{a(this,"OpenAIFetcher")}};y0.OpenAIFetcher=dyt;function woc(t,e,r,n){return(0,Coc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(woc,"getProxyEngineUrl");function uNi(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(uNi,"sanitizeRequestOptionTelemetry");function dNi(t){return(0,_oc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(dNi,"postProcessChoices");y0.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var $wr=Gwr=class extends dyt{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,lyt.getMaxSolutionTokens)(),temperature:(0,lyt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,lyt.getTopP)(),n:e.count,stop:(0,lyt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,boc.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,Soc.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(woc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,qT.telemetrizePromptLength)(u));uNi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(qT.telemetry,"request.sent",y);let E=xoc(m),_;_={...g,...this.instantiationService.invokeFunction(sNi.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=sNi.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new moc.StopWatch,b=o??hoc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof Y5e.Completions.Unexpected&&(0,aNi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(qT.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof Y5e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(qT.telemetry,"networking.cancelRequest",qT.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(qT.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof Y5e.Completions.UnsuccessfulResponse){let k=(0,doc.getRequestId)(x.headers);y.extendWithRequestId(k),k.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(oNi.ITelemetryService).setSharedProperty("capi.assignmentcontext",k.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),Bg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),Bg.debug(this.logTargetService,"request.response properties",y.properties),Bg.debug(this.logTargetService,"request.response measurements",y.measurements),Bg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(qT.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof Y5e.Completions.Unexpected){let k=x.error;if((0,aNi.isAbortError)(k))throw this.instantiationService.invokeFunction(qT.telemetry,"request.cancel",y),k;this.statusReporter.setWarning((0,z5e.getKey)(k,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(qT.telemetry,"request.shownWarning",D),y.properties.message=String((0,z5e.getKey)(k,"name")??""),y.properties.code=String((0,z5e.getKey)(k,"code")??""),y.properties.errno=String((0,z5e.getKey)(k,"errno")??""),y.properties.type=String((0,z5e.getKey)(k,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,Bg.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(k)} after ${N}ms`),Bg.debug(this.logTargetService,"request.error properties",y.properties),Bg.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(qT.telemetry,"request.error",y),k}else(0,poc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(oNi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let k=v.elapsed();y.measurements.totalTimeMs=k;let D=200;Bg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${k}ms`),y.properties.status=String(D),Bg.debug(this.logTargetService,"request.response properties",y.properties),Bg.debug(this.logTargetService,"request.response measurements",y.measurements),Bg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(qT.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(k=>Bg.exception(k,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=Gwr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:dNi(R),getProcessingTime:a(()=>Ioc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(qT.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,goc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:y0.CMDQuotaExceeded,title:"Learn More"});let l=(0,Eoc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),Bg.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(cNi(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Bg.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else cNi(n)?(Bg.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(qT.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",Bg.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(Bg.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Bg.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};y0.LiveOpenAIFetcher=$wr;y0.LiveOpenAIFetcher=$wr=Gwr=aoc([s$(0,Aoc.IInstantiationService),s$(1,Toc.ICompletionsRuntimeModeService),s$(2,lNi.ICompletionsLogTargetService),s$(3,yoc.ICompletionsCopilotTokenManager),s$(4,voc.ICompletionsStatusReporter),s$(5,coc.IAuthenticationService),s$(6,Y5e.ICompletionsFetchService),s$(7,uoc.IEnvService)],$wr);function cNi(t){return t.status>=400&&t.status<500}a(cNi,"isClientError");var Vwr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new loc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var Ywr=I(zwr=>{"use strict";p();Object.defineProperty(zwr,"__esModule",{value:!0});zwr.appendToCache=Roc;function Roc(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(Roc,"appendToCache")});var gNi=I(jd=>{"use strict";p();var koc=jd&&jd.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},xre=jd&&jd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jd,"__esModule",{value:!0});jd.CompletionsFromNetwork=jd.logger=void 0;jd.postProcessChoices=fyt;jd.makeGhostAPIChoice=mNi;jd.telemetryPerformance=Xwr;var K5e=Pge(),Poc=L_(),J5e=Gx(),Doc=Yu(),Noc=CT(),Moc=Qs(),fNi=vE(),Ooc=jvr(),Boc=VA(),hNi=xl(),Loc=zxr(),Jwr=Wwr(),Foc=XOe(),Uoc=Tg(),Qoc=tre(),qoc=Zme(),Kwr=Ywr(),joc=UOe(),pNi=xG(),xD=tge();jd.logger=new hNi.Logger("ghostText");var Zwr=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return jd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,xD.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return jd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,xD.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return jd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,xD.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(Xwr,"performance",h,c,l),jd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=fyt(h);m&&((0,Kwr.appendToCache)(this.completionsCacheService,e,m),jd.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;jd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=fyt(y,A);E&&(A.push(E),(0,Kwr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[mNi(m,{forceSingleLine:!1}),g],telemetryData:(0,xD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:pNi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,xD.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return jd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,xD.mkCanceledResultTelemetry)(r)};let h=fyt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,Kwr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(Xwr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,xD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:pNi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new K5e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=J5e.Result.ok(void 0);break;case"canceled":f=J5e.Result.error(new K5e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=J5e.Result.error(new K5e.NoNextEditReason.NoSuggestions(new Noc.StringText(""),void 0));break;case"failed":f=J5e.Result.error(new K5e.NoNextEditReason.Uncategorized(Poc.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=J5e.Result.error(new K5e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,Doc.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){jd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,Foc.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,fNi.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===fNi.BlockMode.MoreMultiline&&qoc.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` -`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:Jwr.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:Jwr.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,xD.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(jd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,xD.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,Loc.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,xD.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>jd.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,xD.mkBasicResultTelemetry)(r)}}}};jd.CompletionsFromNetwork=Zwr;jd.CompletionsFromNetwork=Zwr=koc([xre(0,Moc.IInstantiationService),xre(1,Jwr.ICompletionsOpenAIFetcherService),xre(2,Boc.ICompletionsFeaturesService),xre(3,Qoc.ICompletionsRuntimeModeService),xre(4,hNi.ICompletionsLogTargetService),xre(5,joc.ICompletionsCacheService),xre(6,Ooc.ICompletionsUserErrorNotifierService)],Zwr);function fyt(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(fyt,"postProcessChoices");function mNi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`)}};y0.StatelessNextEditDocument=Nwr;var aNi;(function(t){t.LowLogProbSuggestions="lowLogProbSuggestions",t.EnforcingNextEditOptions="enforcingNextEditOptions",t.PromptTooLarge="promptTooLarge",t.Uncategorized="uncategorized"})(aNi||(y0.FilteredOutReason=aNi={}));var R4;(function(t){class e{static{a(this,"NoNextEditReason")}}class r extends e{static{a(this,"ActiveDocumentHasNoEdits")}constructor(){super(...arguments),this.kind="activeDocumentHasNoEdits"}toString(){return this.kind}}t.ActiveDocumentHasNoEdits=r;class n extends e{static{a(this,"NoSuggestions")}constructor(h,m,g,A){super(),this.documentBeforeEdits=h,this.window=m,this.nextCursorPosition=g,this.nextCursorDocumentId=A,this.kind="noSuggestions"}toString(){return this.kind}}t.NoSuggestions=n;class o extends e{static{a(this,"GotCancelled")}constructor(h){super(),this.message=h,this.kind="gotCancelled"}toString(){return`${this.kind}:${this.message}`}}t.GotCancelled=o;class s extends e{static{a(this,"FetchFailure")}constructor(h){super(),this.error=h,this.kind="fetchFailure"}toString(){return`${this.kind}:${this.error.message}`}}t.FetchFailure=s;class c extends e{static{a(this,"FilteredOut")}constructor(h){super(),this.message=h,this.kind="filteredOut"}toString(){return`${this.kind}:${this.message}`}}t.FilteredOut=c;class l extends e{static{a(this,"PromptTooLarge")}constructor(h){super(),this.message=h,this.kind="promptTooLarge"}toString(){return`${this.kind}:${this.message}`}}t.PromptTooLarge=l;class u extends e{static{a(this,"Uncategorized")}constructor(h){super(),this.error=h,this.kind="uncategorized"}toString(){return`${this.kind}:${this.error.message}`}}t.Uncategorized=u;class d extends e{static{a(this,"Unexpected")}constructor(h){super(),this.error=h,this.kind="unexpected"}toString(){return`${this.kind}:${this.error.message}`}}t.Unexpected=d})(R4||(y0.NoNextEditReason=R4={}));var Mwr=class t{static{a(this,"StatelessNextEditResult")}static noEdit(e,r){let n=sNi.Result.error(e),o=r.build(n);return new t(n,o)}static streaming(e){let r=sNi.Result.ok(void 0),n=e.build(r);return new t(r,n)}constructor(e,r){this.nextEdit=e,this.telemetry=r}};y0.StatelessNextEditResult=Mwr;var Owr=class{static{a(this,"StatelessNextEditTelemetryBuilder")}constructor(e){this._nextCursorPrediction={nextCursorLineError:void 0,nextCursorLineDistance:void 0,isCrossFile:void 0},this.startTime=Date.now(),this.requestUuid=e}build(e){let n=Date.now()-this.startTime,o=this._prompt?JSON.stringify(this._prompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,s=this._prompt?(0,snc.stringifyChatMessages)(this._prompt):void 0,c=s?.split(` +`).length,l=s?.length,u=e.isOk()?void 0:e.err.kind,d;return e.isError()&&(e.err instanceof R4.ActiveDocumentHasNoEdits||e.err instanceof R4.NoSuggestions||(e.err instanceof R4.GotCancelled||e.err instanceof R4.FilteredOut||e.err instanceof R4.PromptTooLarge?d=e.err.message:e.err instanceof R4.FetchFailure||e.err instanceof R4.Uncategorized||e.err instanceof R4.Unexpected?d=e.err.error.stack?e.err.error.stack:e.err.error.message:(0,wwr.assertNever)(e.err))),{hadStatelessNextEditProviderCall:!0,noNextEditReasonKind:u,noNextEditReasonMessage:d,statelessNextEditProviderDuration:n,logProbThreshold:this._logProbThreshold,mergeConflictExpanded:this._mergeConflictExpanded,nLinesOfCurrentFileInPrompt:this._nLinesOfCurrentFileInPrompt,modelName:this._modelName,prompt:o,promptLineCount:c,promptCharCount:l,isCursorAtEndOfLine:this._isCursorAtLineEnd,isInlineSuggestion:this._isInlineSuggestion,debounceTime:this._debounceTime,artificialDelay:this._artificialDelay,fetchStartedAt:this._fetchStartedAt,hadLowLogProbSuggestion:this._hadLowLogProbSuggestion,response:this._response,nEditsSuggested:this._nEditsSuggested,nextEditLogprob:this._nextEditLogProb,nextCursorPrediction:this._nextCursorPrediction,lineDistanceToMostRecentEdit:this._lineDistanceToMostRecentEdit,xtabAggressivenessLevel:this._xtabAggressivenessLevel,xtabUserHappinessScore:this._xtabUserHappinessScore,userAggressivenessSetting:this._userAggressivenessSetting,editIntent:this._editIntent,editIntentParseError:this._editIntentParseError,cursorJumpModelName:this._cursorJumpModelName,cursorJumpPrompt:this._cursorJumpPrompt?JSON.stringify(this._cursorJumpPrompt.map(({role:f,content:h})=>({role:f,content:h}))):void 0,cursorJumpResponse:this._cursorJumpResponse,nDiffsInPrompt:this._nDiffsInPrompt,diffTokensInPrompt:this._diffTokensInPrompt,nNeighborSnippetsComputed:this._nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:this._nNeighborSnippetsInPrompt,neighborSnippetIndicesInPrompt:this._neighborSnippetIndicesInPrompt,lintErrors:this._lintErrors,terminalOutput:this._terminalOutput,similarFilesContext:this._similarFilesContext,modelConfig:this._modelConfig}}setLogProbThreshold(e){return this._logProbThreshold=e,this}setMergeConflictExpanded(e){return this._mergeConflictExpanded=e,this}setHadLowLogProbSuggestion(e){return this._hadLowLogProbSuggestion=e,this}setNLinesOfCurrentFileInPrompt(e){return this._nLinesOfCurrentFileInPrompt=e,this}setModelName(e){return this._modelName=e,this}setPrompt(e){return this._prompt=e,this}setIsCursorAtLineEnd(e){return this._isCursorAtLineEnd=e,this}setIsInlineSuggestion(e){return this._isInlineSuggestion=e,this}setDebounceTime(e){return this._debounceTime=e,this}setArtificialDelay(e){return this._artificialDelay=e,this}setFetchStartedAt(){return this._fetchStartedAt=Date.now(),this}get fetchStartedAt(){return this._fetchStartedAt}setResponse(e){return this._response=e.then(({response:r,ttft:n})=>{let o=Date.now()-this._fetchStartedAt,s=r.type;return{ttft:n,response:r,fetchTime:o,fetchResult:s}}),this}setCursorJumpModelName(e){return this._cursorJumpModelName=e,this}setCursorJumpPrompt(e){return this._cursorJumpPrompt=e,this}setCursorJumpResponse(e){return this._cursorJumpResponse=e,this}setNextEditLogProb(e){return this._nextEditLogProb=e,this}setNEditsSuggested(e){return this._nEditsSuggested=e,this}setLineDistanceToMostRecentEdit(e){return this._lineDistanceToMostRecentEdit=e,this}setNextCursorLineError(e){return this._nextCursorPrediction.nextCursorLineError=e,this}setNextCursorLineDistance(e){return this._nextCursorPrediction.nextCursorLineDistance=e,this}setNextCursorIsCrossFile(e){return this._nextCursorPrediction.isCrossFile=e,this}setXtabAggressivenessLevel(e){return this._xtabAggressivenessLevel=e,this}setXtabUserHappinessScore(e){return this._xtabUserHappinessScore=e,this}setUserAggressivenessSetting(e){return this._userAggressivenessSetting=e,this}setEditIntent(e){return this._editIntent=e,this}setEditIntentParseError(e){return this._editIntentParseError=e,this}setNDiffsInPrompt(e){return this._nDiffsInPrompt=e,this}setDiffTokensInPrompt(e){return this._diffTokensInPrompt=e,this}setNNeighborSnippetsComputed(e){return this._nNeighborSnippetsComputed=e,this}setNNeighborSnippetsInPrompt(e){return this._nNeighborSnippetsInPrompt=e,this}setNeighborSnippetIndicesInPrompt(e){return this._neighborSnippetIndicesInPrompt=JSON.stringify(e),this}setLintErrors(e){return this._lintErrors=e,this}setTerminalOutput(e){return this._terminalOutput=e,this}setSimilarFilesContext(e){return this._similarFilesContext=e,this}setModelConfig(e){return this._modelConfig=e,this}};y0.StatelessNextEditTelemetryBuilder=Owr});var cNi=I(eyt=>{"use strict";p();Object.defineProperty(eyt,"__esModule",{value:!0});eyt.StreamCopilotAnnotations=void 0;var Bwr=class{static{a(this,"StreamCopilotAnnotations")}constructor(){this.current={}}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}};eyt.StreamCopilotAnnotations=Bwr});var tyt=I(YG=>{"use strict";p();Object.defineProperty(YG,"__esModule",{value:!0});YG.ICompletionsFetchService=YG.CompletionsFetchError=YG.Completions=void 0;var anc=tn(),lNi;(function(t){class e{static{a(this,"RequestCancelled")}constructor(){this.kind="cancelled"}}t.RequestCancelled=e;class r{static{a(this,"UnsuccessfulResponse")}constructor(s,c,l,u){this.status=s,this.statusText=c,this.headers=l,this.text=u,this.kind="not-200-status"}}t.UnsuccessfulResponse=r;class n{static{a(this,"Unexpected")}constructor(s){this.error=s,this.kind="unexpected"}}t.Unexpected=n})(lNi||(YG.Completions=lNi={}));var Lwr=class extends Error{static{a(this,"CompletionsFetchError")}constructor(e,r,n){super(n),this.type=e,this.requestId=r}};YG.CompletionsFetchError=Lwr;YG.ICompletionsFetchService=(0,anc.createServiceIdentifier)("ICompletionsFetchService")});var M5e=I(Sge=>{"use strict";p();Object.defineProperty(Sge,"__esModule",{value:!0});Sge.CacheType=Sge.CustomDataPartMimeTypes=void 0;var uNi;(function(t){t.CacheControl="cache_control",t.StatefulMarker="stateful_marker",t.ThinkingData="thinking",t.ContextManagement="context_management",t.PhaseData="phase_data",t.Usage="usage"})(uNi||(Sge.CustomDataPartMimeTypes=uNi={}));Sge.CacheType="ephemeral"});var Uwr=I(O5e=>{"use strict";p();Object.defineProperty(O5e,"__esModule",{value:!0});O5e.ThinkingDataContainer=void 0;O5e.rawPartAsThinkingData=lnc;var cnc=xo(),dNi=M5e(),Fwr=class extends cnc.PromptElement{static{a(this,"ThinkingDataContainer")}render(){let{thinking:e}=this.props,r={type:dNi.CustomDataPartMimeTypes.ThinkingData,thinking:e};return vscpp("opaque",{value:r,tokenUsage:e.tokens})}};O5e.ThinkingDataContainer=Fwr;function lnc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===dNi.CustomDataPartMimeTypes.ThinkingData&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(lnc,"rawPartAsThinkingData")});var r6=I(yv=>{"use strict";p();Object.defineProperty(yv,"__esModule",{value:!0});yv.FilterReason=yv.FinishedCompletionReason=yv.ChatRole=yv.modelsWithoutResponsesContextManagement=yv.openAIContextManagementCompactionType=void 0;yv.isApiUsage=fnc;yv.getCAPITextPart=mNi;yv.rawMessageToCAPI=gNi;var ryt=xo(),unc=NSe(),dnc=Uwr();function fnc(t){return typeof t.prompt_tokens=="number"&&typeof t.completion_tokens=="number"&&typeof t.total_tokens=="number"}a(fnc,"isApiUsage");yv.openAIContextManagementCompactionType="compaction";yv.modelsWithoutResponsesContextManagement=new Set(["gpt-5","gpt-5.1","gpt-5.2"]);var fNi;(function(t){t.System="system",t.User="user",t.Assistant="assistant",t.Function="function",t.Tool="tool"})(fNi||(yv.ChatRole=fNi={}));function mNi(t){return Array.isArray(t)?t.map(e=>mNi(e)).join(""):typeof t=="string"?t:typeof t=="object"&&"text"in t?t.text:""}a(mNi,"getCAPITextPart");function gNi(t,e){if(Array.isArray(t))return t.map(n=>gNi(n,e));let r=(0,ryt.toMode)(ryt.OutputMode.OpenAI,t);if("copilot_references"in t&&(r.copilot_references=t.copilot_references),"copilot_confirmations"in t&&(r.copilot_confirmations=t.copilot_confirmations),typeof r.content=="string")r.content=r.content.trimEnd();else for(let n=0;nn.type===unc.ChatCompletionContentPartKind.CacheBreakpoint)&&(r.copilot_cache_control={type:"ephemeral"});for(let n of t.content)if(n.type===ryt.Raw.ChatCompletionContentPartKind.Opaque){let o=(0,dnc.rawPartAsThinkingData)(n);e&&o&&e(r,o)}return r}a(gNi,"rawMessageToCAPI");var pNi;(function(t){t.Stop="stop",t.Length="length",t.FunctionCall="function_call",t.ToolCalls="tool_calls",t.ContentFilter="content_filter",t.ServerError="error",t.ClientTrimmed="client-trimmed",t.ClientIterationDone="Iteration Done",t.ClientDone="DONE"})(pNi||(yv.FinishedCompletionReason=pNi={}));var hNi;(function(t){t.Hate="hate",t.SelfHarm="self_harm",t.Sexual="sexual",t.Violence="violence",t.Copyright="snippy",t.Prompt="prompt"})(hNi||(yv.FilterReason=hNi={}))});var i6=I(n6=>{"use strict";p();Object.defineProperty(n6,"__esModule",{value:!0});n6.getRequestId=hnc;n6.isCopilotAnnotation=mnc;n6.isCodeCitationAnnotation=gnc;n6.isCopilotWebReference=Anc;n6.isOpenAIContextManagementResponse=ync;n6.isAnthropicContextManagementResponse=Enc;n6.isOpenAiFunctionTool=_nc;var pnc=r6();function hnc(t,e){let r=t.get("X-Copilot-Experiment")||"",n=t.get("x-copilot-api-exp-assignment-context")||"";return{headerRequestId:t.get("x-request-id")||"",gitHubRequestId:t.get("x-github-request-id")||"",completionId:e&&e.id?e.id:"",created:e&&e.created?e.created:0,serverExperiments:r&&n?`${r};${n}`:r||n,deploymentId:t.get("azureml-model-deployment")||""}}a(hnc,"getRequestId");function mnc(t){if(typeof t!="object"||t===null||!("details"in t))return!1;let{details:e}=t;return typeof e=="object"&&e!==null&&"type"in e&&"description"in e&&typeof e.type=="string"&&typeof e.description=="string"}a(mnc,"isCopilotAnnotation");function gnc(t){if(typeof t!="object"||t===null||!("citations"in t))return!1;let{citations:e}=t;return typeof e=="object"&&e!==null&&"url"in e&&"license"in e&&typeof e.url=="string"&&typeof e.license=="string"}a(gnc,"isCodeCitationAnnotation");function Anc(t){return typeof t=="object"&&!!t&&"title"in t&&"excerpt"in t&&"url"in t}a(Anc,"isCopilotWebReference");function ync(t){return"type"in t&&t.type===pnc.openAIContextManagementCompactionType}a(ync,"isOpenAIContextManagementResponse");function Enc(t){return"applied_edits"in t}a(Enc,"isAnthropicContextManagementResponse");function _nc(t){return t.function!==void 0}a(_nc,"isOpenAiFunctionTool")});var ANi=I(bD=>{"use strict";p();Object.defineProperty(bD,"__esModule",{value:!0});bD.asyncIterableMap=vnc;bD.asyncIterableFilter=Cnc;bD.asyncIterableMapFilter=bnc;bD.asyncIterableFromArray=Snc;bD.asyncIterableToArray=Tnc;bD.asyncIterableConcat=Inc;bD.asyncIterableCount=xnc;bD.iterableMap=wnc;bD.iterableMapFilter=Rnc;async function*vnc(t,e){for await(let r of t)yield e(r)}a(vnc,"asyncIterableMap");async function*Cnc(t,e){for await(let r of t)await e(r)&&(yield r)}a(Cnc,"asyncIterableFilter");async function*bnc(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(bnc,"asyncIterableMapFilter");async function*Snc(t){for(let e of t)yield Promise.resolve(e)}a(Snc,"asyncIterableFromArray");async function Tnc(t){let e=[];for await(let r of t)e.push(r);return e}a(Tnc,"asyncIterableToArray");async function*Inc(...t){for(let e of t)yield*e}a(Inc,"asyncIterableConcat");async function xnc(t){let e=0;for await(let r of t)e++;return e}a(xnc,"asyncIterableCount");function*wnc(t,e){for(let r of t)yield e(r)}a(wnc,"iterableMap");function*Rnc(t,e){for(let r of t){let n=e(r);n!==void 0&&(yield n)}}a(Rnc,"iterableMapFilter")});var yNi=I(Qwr=>{"use strict";p();Object.defineProperty(Qwr,"__esModule",{value:!0});Qwr.getKey=knc;function Pnc(t,e){return t!==null&&typeof t=="object"&&e in t}a(Pnc,"hasKey");function knc(t,e){return Pnc(t,e)?t[e]:void 0}a(knc,"getKey")});var Gwr=I(E0=>{"use strict";p();var Dnc=E0&&E0.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KG=E0&&E0.__param||function(t,e){return function(r,n){e(r,n,t)}},qwr;Object.defineProperty(E0,"__esModule",{value:!0});E0.LiveOpenAIFetcher=E0.CMDQuotaExceeded=E0.OpenAIFetcher=E0.ICompletionsOpenAIFetcherService=E0.CopilotUiKind=void 0;E0.sanitizeRequestOptionTelemetry=SNi;E0.postProcessChoices=TNi;var Nnc=CE(),Mnc=cNi(),Onc=r4(),L5e=tyt(),Bnc=i6(),ENi=Bh(),Lnc=tn(),Fnc=Gu(),Unc=ik(),Qnc=NM(),qnc=fm(),jnc=Ms(),Hnc=ome(),Gnc=c0t(),_Ni=_E(),$nc=ANi(),bNi=Tl(),Vnc=LAt(),vNi=gge(),Wnc=ZAt(),znc=Iwr(),LT=Ig(),Ync=TOe(),Knc=Kte(),B5e=yNi(),nyt=qOe(),Lg=new bNi.Logger("fetchCompletions"),iyt;(function(t){t.GhostText="ghostText",t.Panel="synthesize"})(iyt||(E0.CopilotUiKind=iyt={}));function Jnc(t){let e=t.get("openai-processing-ms");return e?parseInt(e,10):0}a(Jnc,"getProcessingTime");function Znc(t){switch(t){case iyt.GhostText:return"copilot-ghost";case iyt.Panel:return"copilot-panel"}}a(Znc,"uiKindToIntent");E0.ICompletionsOpenAIFetcherService=(0,Lnc.createServiceIdentifier)("ICompletionsOpenAIFetcherService");var oyt=class{static{a(this,"OpenAIFetcher")}};E0.OpenAIFetcher=oyt;function Xnc(t,e,r,n){return(0,Vnc.getEndpointUrl)(t,e,"proxy","v1/engines",r,n)}a(Xnc,"getProxyEngineUrl");function SNi(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(SNi,"sanitizeRequestOptionTelemetry");function TNi(t){return(0,$nc.asyncIterableFilter)(t,e=>e.completionText.trim().length>0)}a(TNi,"postProcessChoices");E0.CMDQuotaExceeded="github.copilot.completions.quotaExceeded";var jwr=qwr=class extends oyt{static{a(this,"LiveOpenAIFetcher")}#e;constructor(e,r,n,o,s,c,l,u){super(),this.instantiationService=e,this.runtimeModeService=r,this.logTargetService=n,this.copilotTokenManager=o,this.statusReporter=s,this.authenticationService=c,this.fetchService=l,this.envService=u}async fetchAndStreamCompletions(e,r,n,o){if(this.#e)return{type:"canceled",reason:this.#e};let s="completions",c=this.copilotTokenManager.token??await this.copilotTokenManager.getToken(),l={prompt:e.prompt.prefix,suffix:e.prompt.suffix,max_tokens:(0,nyt.getMaxSolutionTokens)(),temperature:(0,nyt.getTemperatureForSamples)(this.runtimeModeService,e.count),top_p:(0,nyt.getTopP)(),n:e.count,stop:(0,nyt.getStops)(e.languageId),stream:!0,extra:e.extra};{e.requestLogProbs&&(l.logprobs=2);let u=(0,znc.tryGetGitHubNWO)(e.repoInfo);if(u!==void 0&&(l.nwo=u),e.postOptions&&Object.assign(l,e.postOptions),e.prompt.context&&e.prompt.context.length>0&&(l.extra.context=e.prompt.context),await(0,Ync.delay)(0),o?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"}}{let u=e.prompt,d=e.engineModelId,f=e.ourRequestId,h=r,m=e.uiKind,g=e.headers,A=this.instantiationService.invokeFunction(Xnc,c,d,s),y=h.extendedBy({endpoint:s,engineName:d,uiKind:m},(0,LT.telemetrizePromptLength)(u));SNi(l,y,["prompt","suffix"],["context"]),y.properties.headerRequestId=f,this.instantiationService.invokeFunction(LT.telemetry,"request.sent",y);let E=Znc(m),_;_={...g,...this.instantiationService.invokeFunction(_Ni.editorVersionHeaders)},_["Openai-Organization"]="github-copilot",_["X-Request-Id"]=f,_["VScode-SessionId"]=this.envService.sessionId,_["VScode-MachineId"]=this.envService.machineId,_["X-GitHub-Api-Version"]=_Ni.apiVersion,E&&(_["OpenAI-Intent"]=E);let v=new Qnc.StopWatch,b=o??Unc.CancellationToken.None,T=await this.fetchService.fetch(A,c.token,l,f,b,_).then(w=>w.isError()&&w.err instanceof L5e.Completions.Unexpected&&(0,vNi.isInterruptedNetworkError)(w.err.error)?(this.instantiationService.invokeFunction(LT.telemetry,"networking.disconnectAll"),this.fetchService.disconnectAll().then(()=>this.fetchService.fetch(A,c.token,l,f,b,_))):w);try{if(T.isError()){let x=T.err;if(x instanceof L5e.Completions.RequestCancelled)return this.instantiationService.invokeFunction(LT.telemetry,"networking.cancelRequest",LT.TelemetryData.createAndMarkAsIssued({headerRequestId:f})),this.instantiationService.invokeFunction(LT.telemetry,"request.cancel",y),{type:"canceled",reason:"during fetch request"};if(x instanceof L5e.Completions.UnsuccessfulResponse){let P=(0,Bnc.getRequestId)(x.headers);y.extendWithRequestId(P),P.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(ENi.ITelemetryService).setSharedProperty("capi.assignmentcontext",P.serverExperiments));let D=v.elapsed();return y.measurements.totalTimeMs=D,y.properties.status=String(x.status),Lg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${x.status} status after ${D}ms`),Lg.debug(this.logTargetService,"request.response properties",y.properties),Lg.debug(this.logTargetService,"request.response measurements",y.measurements),Lg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(LT.telemetry,"request.response",y),this.handleError(this.statusReporter,y,{status:x.status,text:x.text,headers:x.headers},c)}else if(x instanceof L5e.Completions.Unexpected){let P=x.error;if((0,vNi.isAbortError)(P))throw this.instantiationService.invokeFunction(LT.telemetry,"request.cancel",y),P;this.statusReporter.setWarning((0,B5e.getKey)(P,"message")??"");let D=y.extendedBy({error:"Network exception"});this.instantiationService.invokeFunction(LT.telemetry,"request.shownWarning",D),y.properties.message=String((0,B5e.getKey)(P,"name")??""),y.properties.code=String((0,B5e.getKey)(P,"code")??""),y.properties.errno=String((0,B5e.getKey)(P,"errno")??""),y.properties.type=String((0,B5e.getKey)(P,"type")??"");let N=v.elapsed();throw y.measurements.totalTimeMs=N,Lg.info(this.logTargetService,`Request ${f} at <${A}> rejected with ${String(P)} after ${N}ms`),Lg.debug(this.logTargetService,"request.error properties",y.properties),Lg.debug(this.logTargetService,"request.error measurements",y.measurements),this.instantiationService.invokeFunction(LT.telemetry,"request.error",y),P}else(0,Fnc.assertNever)(x)}let w=T.val;{let x=w.requestId;y.extendWithRequestId(x),x.serverExperiments&&this.instantiationService.invokeFunction(N=>N.get(ENi.ITelemetryService).setSharedProperty("capi.assignmentcontext",x.serverExperiments));let P=v.elapsed();y.measurements.totalTimeMs=P;let D=200;Lg.info(this.logTargetService,`Request ${f} at <${A}> finished with ${D} status after ${P}ms`),y.properties.status=String(D),Lg.debug(this.logTargetService,"request.response properties",y.properties),Lg.debug(this.logTargetService,"request.response measurements",y.measurements),Lg.debug(this.logTargetService,"prompt:",u),this.instantiationService.invokeFunction(LT.telemetry,"request.response",y)}if(o?.isCancellationRequested){try{await w.destroy()}catch(x){this.instantiationService.invokeFunction(P=>Lg.exception(P,x,"Error destroying stream"))}return{type:"canceled",reason:"after fetch request"}}let R=qwr.convertStreamToApiChoices(w,n,r,o);return{type:"success",choices:TNi(R),getProcessingTime:a(()=>Jnc(w.headers),"getProcessingTime")}}finally{this.instantiationService.invokeFunction(LT.logEnginePrompt,u,y)}}}static async*convertStreamToApiChoices(e,r,n,o){let s=a((l,u,d,f,h)=>({choiceIndex:l,completionText:u,requestId:e.requestId,finishReason:d,tokens:f.chunks,numTokens:f.chunks.length,blockFinished:h,telemetryData:n,clientCompletionId:(0,qnc.generateUuid)(),meanLogProb:void 0,meanAlternativeLogProb:void 0,copilotAnnotations:f.annotations.current}),"createAPIChoice"),c=[];try{for await(let l of e.stream){if(o?.isCancellationRequested)return;for(let u=0;u-1,y;if((m||A)&&(y=await r(f.accumulator.responseSoFar,{index:d,text:f.accumulator.responseSoFar,finished:m,requestId:e.requestId,telemetryData:n,annotations:f.accumulator.annotations,getAPIJsonData:a(()=>({text:f.accumulator.responseSoFar,tokens:f.accumulator.chunks,finish_reason:f.accumulator.finishReason??"stop",copilot_annotations:f.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested))return;if(m&&(y===void 0||typeof y!="object"?y={yieldSolution:!0,continueStreaming:!1}:(y.yieldSolution=!0,y.continueStreaming=!1)),y!==void 0&&(typeof y=="number"||y.yieldSolution)){let E=m||typeof y=="number"||y!==void 0&&!y.continueStreaming;f.isFinished=E;let _=l.choices[u].finish_reason;_&&(f.accumulator.finishReason=_);let v=typeof y=="number"?y:y&&y.finishOffset!==void 0?y.finishOffset:void 0,b=v===void 0?f.accumulator.responseSoFar:f.accumulator.responseSoFar.slice(0,v);if(f.yielded||(f.yielded=!0,yield s(d,b,f.accumulator.finishReason??"stop",f.accumulator,v!==void 0)),o?.isCancellationRequested)return}}}for(let[l,u]of c.entries())if(!u.isFinished){if(await r(u.accumulator.responseSoFar,{index:l,text:u.accumulator.responseSoFar,finished:!0,requestId:e.requestId,telemetryData:n,annotations:u.accumulator.annotations,getAPIJsonData:a(()=>({text:u.accumulator.responseSoFar,tokens:u.accumulator.chunks,finish_reason:u.accumulator.finishReason??"stop",copilot_annotations:u.accumulator.annotations.current}),"getAPIJsonData")}),o?.isCancellationRequested)return;if(u.yielded)continue;if(u.yielded=!0,yield s(l,u.accumulator.responseSoFar,u.accumulator.finishReason??"stop",u.accumulator,!1),o?.isCancellationRequested)return}}finally{try{await e.destroy()}catch{}}}async handleError(e,r,n,o){let s=await n.text();if(n.status===402){this.#e="monthly free code completions exhausted",e.setError("Completions limit reached",{command:E0.CMDQuotaExceeded,title:"Learn More"});let l=(0,Gnc.onCopilotToken)(this.authenticationService,u=>{this.#e=void 0,u.isCompletionsQuotaExceeded||(e.forceNormal(),l.dispose())});return{type:"failed",reason:this.#e}}if(n.status===466)return e.setError(s),Lg.info(this.logTargetService,s),{type:"failed",reason:`client not supported: ${s}`};if(CNi(n)&&!n.headers.get("x-github-request-id")){let c=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Lg.error(this.logTargetService,c),e.setWarning(c),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else CNi(n)?(Lg.warn(this.logTargetService,`Response status was ${n.status}:`,s),e.setWarning(`Last response was a ${n.status} error: ${s}`),r.properties.error=`Response status was ${n.status}: ${s}`):(e.setWarning(`Last response was a ${n.status} error`),r.properties.error=`Response status was ${n.status}`);return r.properties.status=String(n.status),this.instantiationService.invokeFunction(LT.telemetry,"request.shownWarning",r),n.status===401||n.status===403?(this.copilotTokenManager.resetToken(n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`}):n.status===429?(setTimeout(()=>{this.#e=void 0},10*1e3),this.#e="rate limited",Lg.warn(this.logTargetService,"Rate limited by server. Denying completions for the next 10 seconds."),{type:"failed",reason:this.#e}):n.status===499?(Lg.info(this.logTargetService,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Lg.error(this.logTargetService,"Unhandled status from server:",n.status,s),{type:"failed",reason:`unhandled status from server: ${n.status} ${s}`})}};E0.LiveOpenAIFetcher=jwr;E0.LiveOpenAIFetcher=jwr=qwr=Dnc([KG(0,jnc.IInstantiationService),KG(1,Knc.ICompletionsRuntimeModeService),KG(2,bNi.ICompletionsLogTargetService),KG(3,Hnc.ICompletionsCopilotTokenManager),KG(4,Wnc.ICompletionsStatusReporter),KG(5,Nnc.IAuthenticationService),KG(6,L5e.ICompletionsFetchService),KG(7,Onc.IEnvService)],jwr);function CNi(t){return t.status>=400&&t.status<500}a(CNi,"isClientError");var Hwr=class{static{a(this,"CompletionAccumulator")}constructor(){this._chunks=[],this._responseSoFar="",this._finishReason=null,this.annotations=new Mnc.StreamCopilotAnnotations}get responseSoFar(){return this._responseSoFar}get chunks(){return this._chunks}set finishReason(e){this._finishReason=e}get finishReason(){return this._finishReason}append(e){let r=e.text;r&&(this._chunks.push(r),this._responseSoFar=this._responseSoFar+r),e.copilot_annotations&&this.annotations.update(e.copilot_annotations)}}});var Vwr=I($wr=>{"use strict";p();Object.defineProperty($wr,"__esModule",{value:!0});$wr.appendToCache=eic;function eic(t,e,r){t.append(e.prefix,e.prompt.suffix,r)}a(eic,"appendToCache")});var PNi=I(Qd=>{"use strict";p();var tic=Qd&&Qd.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Cre=Qd&&Qd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Qd,"__esModule",{value:!0});Qd.CompletionsFromNetwork=Qd.logger=void 0;Qd.postProcessChoices=syt;Qd.makeGhostAPIChoice=RNi;Qd.telemetryPerformance=Kwr;var F5e=bge(),ric=O_(),U5e=Hx(),nic=Gu(),iic=AT(),oic=Ms(),INi=_E(),sic=YCr(),aic=JA(),wNi=Tl(),cic=$xr(),zwr=Gwr(),lic=qOe(),uic=Ig(),dic=Kte(),fic=Gme(),Wwr=Vwr(),pic=xOe(),xNi=AG(),SD=Wme();Qd.logger=new wNi.Logger("ghostText");var Ywr=class{static{a(this,"CompletionsFromNetwork")}constructor(e,r,n,o,s,c,l){this.instantiationService=e,this.fetcherService=r,this.featuresService=n,this.runtimeMode=o,this.logTarget=s,this.completionsCacheService=c,this.userErrorNotifier=l}async getCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"completions",async(c,l,u)=>{let f=await u[Symbol.asyncIterator]().next();if(f.done)return Qd.logger.debug(this.logTarget,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:(0,SD.mkBasicResultTelemetry)(r)};if(n?.isCancellationRequested)return Qd.logger.debug(this.logTarget,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:(0,SD.mkCanceledResultTelemetry)(r)};let h=f.value;if(h===void 0)return Qd.logger.debug(this.logTarget,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:(0,SD.mkBasicResultTelemetry)(r)};this.instantiationService.invokeFunction(Kwr,"performance",h,c,l),Qd.logger.debug(this.logTarget,`Awaited first result, id: ${h.choiceIndex}`);let m=syt(h);m&&((0,Wwr.appendToCache)(this.completionsCacheService,e,m),Qd.logger.debug(this.logTarget,`GhostText first completion (index ${m?.choiceIndex}): ${JSON.stringify(m?.completionText)}`));let g=(async()=>{let A=m!==void 0?[m]:[];for await(let y of u){if(y===void 0)continue;Qd.logger.debug(this.logTarget,`GhostText later completion (index ${y?.choiceIndex}): ${JSON.stringify(y.completionText)}`);let E=syt(y,A);E&&(A.push(E),(0,Wwr.appendToCache)(this.completionsCacheService,e,E))}})();return this.runtimeMode.isRunningInTest()&&await g,m?{type:"success",value:[RNi(m,{forceSingleLine:!1}),g],telemetryData:(0,SD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:xNi.ResultType.Network}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:(0,SD.mkBasicResultTelemetry)(r)}})}async getAllCompletionsFromNetwork(e,r,n,o,s){return this.genericGetCompletionsFromNetwork(e,r,n,o,s,"all completions",async(c,l,u)=>{let d=[];for await(let f of u){if(n?.isCancellationRequested)return Qd.logger.debug(this.logTarget,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:(0,SD.mkCanceledResultTelemetry)(r)};let h=syt(f,d);h&&d.push(h)}if(d.length>0){for(let f of d)(0,Wwr.appendToCache)(this.completionsCacheService,e,f);this.instantiationService.invokeFunction(Kwr,"cyclingPerformance",d[0],c,l)}return{type:"success",value:[d,Promise.resolve()],telemetryData:(0,SD.mkBasicResultTelemetry)(r),telemetryBlob:r,resultType:xNi.ResultType.Cycling}})}async genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){let u=new F5e.StatelessNextEditTelemetryBuilder(e.ourRequestId),d=await this._genericGetCompletionsFromNetwork(e,r,n,o,u,c,l),f;switch(d.type){case"success":f=U5e.Result.ok(void 0);break;case"canceled":f=U5e.Result.error(new F5e.NoNextEditReason.GotCancelled(d.reason));break;case"empty":f=U5e.Result.error(new F5e.NoNextEditReason.NoSuggestions(new iic.StringText(""),void 0));break;case"failed":f=U5e.Result.error(new F5e.NoNextEditReason.Uncategorized(ric.ErrorUtils.fromUnknown(d.reason)));break;case"abortedBeforeIssued":case"promptOnly":f=U5e.Result.error(new F5e.NoNextEditReason.GotCancelled(d.reason));break;default:(0,nic.assertNever)(d)}return s.setStatelessNextEditTelemetry(u.build(f)),d}async _genericGetCompletionsFromNetwork(e,r,n,o,s,c,l){Qd.logger.debug(this.logTarget,`Getting ${c} from network`),r=r.extendedBy(),s.setModelName(e.engineModelId);let u=e.isCycling?3:1,d=(0,lic.getTemperatureForSamples)(this.runtimeMode,u),f={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:(0,INi.shouldDoServerTrimming)(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},h={n:u,temperature:d,code_annotations:!1},m=this.featuresService.modelAlwaysTerminatesSingleline(r),g=e.blockMode===INi.BlockMode.MoreMultiline&&fic.BlockTrimmer.isSupported(e.languageId)&&!m;!e.multiline&&!g?h.stop=[` +`]:e.stop&&(h.stop=e.stop),e.maxTokens!==void 0&&(h.max_tokens=e.maxTokens);let A=Date.now(),y={endpoint:"completions",uiKind:zwr.CopilotUiKind.GhostText,temperature:JSON.stringify(d),n:JSON.stringify(u),stop:JSON.stringify(h.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,y);try{let E={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:u,uiKind:zwr.CopilotUiKind.GhostText,postOptions:h,headers:e.headers,extra:f},_=await this.fetcherService.fetchAndStreamCompletions(E,r,o,n);return _.type==="failed"?{type:"failed",reason:_.reason,telemetryData:(0,SD.mkBasicResultTelemetry)(r)}:_.type==="canceled"?(Qd.logger.debug(this.logTarget,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:_.reason,telemetryData:(0,SD.mkCanceledResultTelemetry)(r)}):l(A,_.getProcessingTime(),_.choices)}catch(E){if((0,cic.isAbortError)(E))return{type:"canceled",reason:"network request aborted",telemetryData:(0,SD.mkCanceledResultTelemetry)(r,{cancelledNetworkRequest:!0})};if(this.instantiationService.invokeFunction(_=>Qd.logger.exception(_,E,"Error on ghost text request")),this.userErrorNotifier.notifyUser(E),this.runtimeMode.shouldFailForDebugPurposes())throw E;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:(0,SD.mkBasicResultTelemetry)(r)}}}};Qd.CompletionsFromNetwork=Ywr;Qd.CompletionsFromNetwork=Ywr=tic([Cre(0,oic.IInstantiationService),Cre(1,zwr.ICompletionsOpenAIFetcherService),Cre(2,aic.ICompletionsFeaturesService),Cre(3,dic.ICompletionsRuntimeModeService),Cre(4,wNi.ICompletionsLogTargetService),Cre(5,pic.ICompletionsCacheService),Cre(6,sic.ICompletionsUserErrorNotifierService)],Ywr);function syt(t,e){if(e||(e=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&e.findIndex(r=>r.completionText.trim()===t.completionText.trim())===-1)return t}a(syt,"postProcessChoices");function RNi(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(mNi,"makeGhostAPIChoice");function Xwr(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,Uoc.telemetry)(t,`ghostText.${e}`,l)}a(Xwr,"telemetryPerformance")});var ANi=I(pyt=>{"use strict";p();Object.defineProperty(pyt,"__esModule",{value:!0});pyt.contextualFilterCharacterMap=void 0;pyt.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var yNi=I(eRr=>{"use strict";p();Object.defineProperty(eRr,"__esModule",{value:!0});eRr.multilineModelPredict=Hoc;function Hoc(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let Q;t[183]>1e-35?Q=-.05753337139158443:t[308]>1e-35?Q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?Q=-.10477869875380448:Q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?Q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?Q=-.04442302951713574:Q=.00012409888451734224:Q=-.092199119633697:t[225]>1e-35?Q=.13773072450201831:t[0]>2882.5000000000005?Q=.0028540012229920533:t[298]>1e-35?Q=.07134486044361629:Q=.014297412329837425:t[145]>1e-35?Q=.05608385321902638:t[92]>1e-35?Q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?Q=-.0039957800609801315:Q=.0776927564241081:t[203]>1e-35?Q=-.05502900859432093:t[105]>1e-35?Q=.06062892720841595:Q=-.009574839629252128:t[31]>1e-35?Q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?Q=.08818126313644752:t[8]>161.50000000000003?Q=.014353968957885408:Q=-.022240738532827903:t[210]>1e-35?Q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?Q=-.043902062079383485:Q=-.014741559220396223:Q=-.00934935734853194:t[6]>32.50000000000001?Q=.1514593126307404:Q=.010771222510801532:t[10]>22.500000000000004?Q=.01412495209334078:Q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let F;t[294]>1e-35?F=-.0384794324818203:t[266]>1e-35?F=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?F=.07432960094940501:F=-.035248735855751855:t[134]>1e-35?F=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?F=-.01706896375068821:F=.08212247914968074:t[2]>59.50000000000001?F=-.09546478958824225:t[6]>53.50000000000001?F=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?F=.02816463285971267:F=.15449139016588445:F=-.10199787406123524:F=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?F=-.13924786681478077:F=-.0072772442570213335:t[39]>1e-35?F=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?F=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?F=-.11174465335620831:F=.00013144040097180107:F=-.08493919336681105:t[42]>1e-35?F=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?F=-.015540659878839153:F=-.14442609417300142:t[21]>1e-35?F=-.025251979447574083:F=.0023698372645272847:t[18]>1e-35?F=.07269739695712212:t[8]>2592.5000000000005?F=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?F=-.01835130329646532:t[9]>45.50000000000001?F=.02023047454629885:F=.16469378262221102:F=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let W;t[183]>1e-35?t[17]>1e-35?W=.030100940443356424:t[10]>1.5000000000000002?W=-.10861112216742408:W=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?W=-.032062878390325456:W=-.10808232631806887:t[8]>1641.5000000000002?W=-.06147013392655731:t[4]>12.500000000000002?W=.03324767551088266:t[145]>1e-35?W=.028851633810612017:W=-.054871239091792784:t[134]>1e-35?W=-.023813968121342108:t[266]>1e-35?W=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?W=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?W=-.025350325484720576:W=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?W=.056817276537534815:W=-.07674158463557636:W=-.06335553143454145:t[1]>56.50000000000001?W=.16390494217299284:W=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?W=.041717597065890205:W=-.10357913492269129:t[10]>29.500000000000004?W=.1365512866715726:W=.020600048310575665:W=.09708785634773187:W=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?W=-.03146213719547347:W=.11784024316238083:W=-.050940520532045355:W=-.047988344143075616:t[191]>1e-35?W=.028764654731460032:W=.0011911575567860023;let V;t[294]>1e-35?t[10]>50.50000000000001?V=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?V=-.05103908560370243:V=.05002066201169583:V=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?V=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?V=.127983140816313:V=-.05436534163636867:V=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?V=-.009504203657088933:t[8]>819.5000000000001?V=.18689664822602375:V=.03635576744011826:V=-.029862411809998525:t[223]>1e-35?V=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?V=-.09405026597863717:t[0]>4153.500000000001?V=.053577663326799765:V=-.05062127873995668:V=.06512222894425874:t[39]>1e-35?V=-.04985311717827547:t[51]>1e-35?V=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?V=-.02860634573675884:V=.08863753005590103:V=.11158892111063744:t[0]>655.5000000000001?V=-.031005736641654926:V=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?V=-.00843386136334982:V=-.05273594615999777:V=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?V=-.015774115523598486:V=.10147367091236065:V=-.048307000563071016:V=.002118376117677254;let G;t[8]>1014.5000000000001?t[9]>137.50000000000003?G=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?G=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?G=.07211107542565391:G=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?G=-.0751486415451188:t[1]>59.50000000000001?G=.13459005084554104:G=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?G=.06715575425741895:G=-.005895690393702183:t[8]>2915.5000000000005?G=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?G=-.00029068886245881074:G=.0613467393188786:t[148]>1e-35?G=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?G=.003887223773199377:G=-.08553893131979015:G=.025654192706396767:G=-.05651733979610658:G=-.02039913645229667:t[2]>7.500000000000001?G=-.1058450646728524:G=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?G=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?G=.1283258201586378:G=-.01718135372229775:G=-.07702452408491414:t[125]>1e-35?G=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?G=.04273051857848212:G=-.04533122948101463:t[2]>196.50000000000003?G=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?G=.0231032972703664:G=-.04807386814498683:G=.002729435991332102;let Y;t[179]>1e-35?Y=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?Y=.026484626664041125:t[10]>1.5000000000000002?Y=-.10187000872941615:Y=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Y=.09574540795390041:Y=-.06454986703691233:Y=-.11411849349353141:t[266]>1e-35?Y=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?Y=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?Y=-.04403391373512386:Y=.1132928075412222:t[2]>47.50000000000001?Y=-.09700191391838056:Y=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?Y=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?Y=-.001668912999010927:Y=-.02363511102970245:t[8]>58.50000000000001?Y=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?Y=.0911011436534449:t[1]>28.500000000000004?Y=-.07192390493729035:Y=.06913818091291246:Y=-.012312625373699222:Y=.06784496312307986:Y=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?Y=.0026564453057705273:Y=-.025425772389361445:t[122]>1e-35?Y=-.12046786388602149:t[0]>3183.5000000000005?Y=.01162092842804907:t[91]>1e-35?Y=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?Y=-.0001647792543020228:Y=-.023664538532907665:Y=.01609078206180752;let re;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?re=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?re=-.017696526862422682:re=.1450050954613223:re=-.05406930069823832:re=-.08308700260259043:t[120]>1e-35?re=.058316269489189415:t[297]>1e-35?t[94]>1e-35?re=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?re=.038431826961746934:re=-.05937462906539856:t[9]>65.50000000000001?re=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?re=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?re=-.09579030954062734:re=.025064711572811746:re=.02579440518821548:re=.1044440128091862:re=-.058348633139536844:re=.07766788227934436:re=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?re=.07463684068207214:re=.18244269035484484:t[6]>39.50000000000001?re=-.06050050067471004:re=.05787759066913493:re=.010783225857972171:re=.1674891243602606:t[4]>9.500000000000002?re=-.004814132027475892:re=-.14543299413454813:re=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?re=-.07634466313617769:re=.0287825335169114:re=-.06894721943300268:re=-.00023988459059521937;let j;t[131]>1e-35?t[1]>93.50000000000001?j=-.05706887458825395:t[2]>1.5000000000000002?j=.011446637886629108:j=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?j=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?j=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?j=.026278724448495064:j=.17053138400480508:t[0]>4463.500000000001?j=-.06482289890096041:j=.03026516489536295:j=-.031785170717683144:j=.1312690622980455:t[13]>1e-35?j=.14336922540461444:j=.03523850945454039:j=-.015407465968975714:t[39]>1e-35?j=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?j=-.0659975068798723:j=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?j=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?j=.057409156184759516:j=.2024322059866388:j=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?j=.010648654146284154:t[308]>1e-35?j=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?j=.12364025998551711:j=-.02247495081065243:t[1]>22.500000000000004?j=-.0726295464624251:j=.03481895086048152:t[0]>4331.500000000001?j=-.04775443357020673:j=.07172377425057568:t[2]>89.50000000000001?j=-.11782645274716962:j=.00010092665257989378;let X;t[147]>1e-35?X=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?X=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?X=-.016101990375700172:t[0]>2579.5000000000005?X=-.13045089661551845:X=-.02874367814784938:X=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?X=.17084176915326055:X=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?X=.10591712319944074:X=-.024082167264285:X=.16497698867036126:X=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?X=-.021012910475524206:X=-.13058422554298485:t[0]>1102.5000000000002?X=.10955864175201457:X=-.03566689354348996:t[1]>11.500000000000002?X=-.02093884208606101:X=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?X=-.013861861436128482:X=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?X=.10163873449625677:X=-.02779270277623805:t[1]>26.500000000000004?X=-.08035058228527389:X=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?X=-.007028075523033826:X=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?X=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?X=-.0032075580718124892:X=-.04442829143298883:X=-.06597073245775804:X=.0015594090939337751;let ie;t[223]>1e-35?t[8]>668.5000000000001?ie=-.12803889879260094:ie=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ie=.08967966612917375:t[1]>39.50000000000001?ie=-.059791671514498074:ie=.05648934961902822:t[2]>59.50000000000001?ie=-.08633234097449628:t[6]>53.50000000000001?ie=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ie=.025606129643140924:ie=.13835395886271978:ie=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ie=-.09975506556937946:t[10]>36.50000000000001?ie=-.09427724661655643:t[10]>24.500000000000004?ie=.07329330653410447:ie=-.02271182965807972:ie=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ie=-.05082091374050816:ie=.1687114435254966:t[0]>2314.5000000000005?ie=-.06422664016383926:ie=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ie=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ie=-.1274167728754332:ie=.01308079126447365:t[4]>73.50000000000001?ie=.13854015371106546:t[4]>48.50000000000001?ie=-.03684255740123261:t[6]>45.50000000000001?ie=.10329912215813097:t[10]>77.50000000000001?ie=-.08630788656925215:ie=.031022006843800853:t[1]>25.500000000000004?ie=-.08278381528048026:ie=.06664374548141594:t[84]>1e-35?ie=-.05624227409079396:ie=.00012184182357340415;let we;t[179]>1e-35?we=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?we=-.07595415373151816:we=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?we=.022822510448266862:we=.17491569312933697:we=-.058362287133533565:t[2]>2.5000000000000004?we=-.03633895806364428:we=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?we=-.07294848747514579:we=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?we=-.07009535282685533:t[8]>2640.0000000000005?we=-.051761240111316276:t[131]>1e-35?we=-.06245774419231631:we=.03495606662854905:we=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?we=.0015036626973581122:we=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?we=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?we=.022343994371919224:we=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?we=.07724450228328664:t[0]>3853.5000000000005?we=-.15671707454435677:t[10]>28.500000000000004?we=-.10179090671841723:we=.014878216919760927:we=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?we=.14054154485273487:we=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?we=-.08632985141410315:we=.005524157938954954:we=-.08802502622523681:we=-.0004649168897260341;let Ae;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?Ae=-.007458687464321174:Ae=-.09444966249102484:t[1]>23.500000000000004?Ae=.08564129697360716:Ae=-.07105002902845851:Ae=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?Ae=-.10326216566705966:t[1]>26.500000000000004?Ae=.0050539832484585365:Ae=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?Ae=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?Ae=.05783632021087773:t[10]>17.500000000000004?Ae=-.06720598671764105:t[1]>47.50000000000001?Ae=.097495825172558:Ae=-.013372242800584872:Ae=-.06463226787713715:t[42]>1e-35?Ae=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?Ae=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?Ae=.11051270080118503:Ae=.027719462817590454:t[8]>597.5000000000001?Ae=-.08441503592016869:Ae=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?Ae=-.12190088985091102:Ae=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?Ae=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?Ae=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?Ae=.016585157185448045:Ae=-.11032043771149425:Ae=.01586986028570486:t[8]>388.50000000000006?Ae=-.10592413013261853:Ae=.04930703248769364:t[13]>1e-35?Ae=.003621937787920821:Ae=-.0013786331198611841;let De;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?De=.009769895322846493:De=-.10620052926943656:t[9]>19.500000000000004?De=.03781202525403449:t[9]>14.500000000000002?De=-.11485785321365344:t[9]>6.500000000000001?De=.07677177833073881:t[0]>4342.500000000001?De=-.07079285609687631:t[49]>1e-35?De=.06156814809246001:De=-.014788509042554625:De=-.032659201618470655:t[5]>5207.500000000001?De=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?De=-.03094160322187924:t[1]>29.500000000000004?De=.09474646043921069:De=.023445783928231618:De=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?De=-.07164443768784848:t[1]>29.500000000000004?De=.089473622509272:t[8]>597.5000000000001?De=-.08155349903101317:De=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?De=-.004003900679358653:t[190]>1e-35?De=-.09236113461485262:t[8]>3198.5000000000005?De=-.0124130160451179:De=.018453070064009328:t[15]>1e-35?De=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?De=-.0009580759587680961:De=-.03227283036698222:De=.01369287669536875:t[1]>50.50000000000001?De=-.04213060332500437:t[35]>1e-35?De=-.11508095777767471:t[190]>1e-35?De=-.08611884672400155:t[297]>1e-35?De=.05723551879433584:De=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let J;t[3]>7.500000000000001?J=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?J=.03642374718166293:J=.16379973756366603:J=-.03946685266127979:t[186]>1e-35?J=.07618896623420895:t[96]>1e-35?J=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?J=-.022822371600847505:J=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?J=.044416424920571296:J=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?J=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?J=.1061937286809567:t[7]>54.50000000000001?J=.11487507743121311:t[8]>819.5000000000001?J=-.07181278009001418:t[10]>25.500000000000004?J=.13499019430369633:t[1]>31.500000000000004?J=.09032979489780704:J=-.12754166393372374:t[9]>37.50000000000001?J=-.05093963635361407:J=-.005026651151683848:t[9]>2.5000000000000004?J=.07619735785573735:J=.012363301341532136:t[26]>1e-35?J=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?J=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?J=-.10764172927882483:J=.01890760098464703:J=.06573095405846417:t[8]>634.5000000000001?J=-.00783575973273707:J=-.050612689680229306:t[1]>22.500000000000004?J=-.0016842490401359626:J=.0738227088444087:J=-.02663970950432175;let z;t[31]>1e-35?t[8]>17.500000000000004?z=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?z=.007191286124908192:z=-.09347881647636902:t[10]>1.5000000000000002?z=.07938758708008091:z=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?z=.12321804057595996:z=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?z=-.04644244754790671:z=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?z=.0706108609273337:t[2]>40.50000000000001?z=-.028046629962303716:z=-.06497613993109329:z=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?z=-.03056331974267756:z=-.11886389712497057:z=.053364962175658184:t[8]>2233.5000000000005?z=-.0448152521157682:z=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?z=.03818796510453344:z=.23673992112982362:z=.02858814226507374:t[10]>44.50000000000001?z=-.1125863771551199:z=.009129996952394916:t[1]>7.500000000000001?z=-.004374525302461639:z=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?z=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?z=-.13677189943034931:t[10]>2.5000000000000004?z=.039591891437078086:z=-.09312596849507347:z=-.02423172142089822:z=.0009836986075266283;let le;t[189]>1e-35?t[0]>5269.500000000001?le=-.103183298350443:t[2]>51.50000000000001?le=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?le=-.05186168947388339:le=.0496996365539082:t[10]>23.500000000000004?le=.1404445738719:t[93]>1e-35?le=.0027146310074558505:t[5]>3821.5000000000005?le=.002153033152069652:t[4]>2.5000000000000004?le=.007663539551317215:le=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?le=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?le=-.021479467709980358:le=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?le=.021660293256233334:le=-.0927396152303864:le=.0665074081601698:t[0]>1550.5000000000002?le=.08972407105958534:le=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?le=.06761927942466854:le=-.015762168112653286:t[17]>1e-35?le=.10311304131145381:le=-.017672785252336027:le=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?le=-.10638321435298535:le=.0007073011744385905:t[18]>1e-35?le=-.027056185501334325:t[145]>1e-35?le=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?le=.09762140519655171:t[9]>110.50000000000001?le=-.06581942957595835:t[6]>54.50000000000001?le=.04959634035251596:le=.0022616298654554207:le=-.007437620924990854;let K;t[179]>1e-35?K=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?K=.1470294450403005:K=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?K=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?K=.07965955447707423:t[10]>10.500000000000002?K=-.09236156404262426:K=.03396273196231458:K=-.13246465021467432:K=.07092822261735353:K=-.08753829085942:K=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?K=.004705878789890202:K=.13775378964952867:K=-.04770928980587811:t[10]>29.500000000000004?K=.011221519891071544:t[0]>3853.5000000000005?K=.06365381191628273:K=.15506252245336827:t[1]>37.50000000000001?K=-.07254777021042061:K=.026514587757252385:t[308]>1e-35?K=.04115804816617256:t[10]>26.500000000000004?K=.02077721353011946:t[5]>3548.5000000000005?K=-.1280907116663952:K=-.021974774274438:t[306]>1e-35?K=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?K=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?K=-.005710865560475598:t[94]>1e-35?K=-.06751507982853555:K=.027250040757588703:t[9]>52.50000000000001?K=.07060357924595577:K=-.030297760713011795:K=-.0006005400085266517;let ae;t[113]>1e-35?ae=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ae=-.06996356565314456:ae=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ae=-.08317707559926495:t[21]>1e-35?ae=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ae=-.010538203005984922:ae=.08454819465349446:t[9]>124.50000000000001?ae=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ae=-.08542251249346582:t[9]>50.50000000000001?ae=-.023428882537657472:ae=.010042500833979073:ae=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ae=.03006025206979096:t[9]>108.50000000000001?ae=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ae=.04222035773042132:ae=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ae=-.07209095448054853:ae=.028065954981903313:ae=.08714651929917122:ae=-.006678820669279169:t[10]>40.50000000000001?ae=.006982396294941626:ae=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ae=-.09351114982645548:t[4]>3.5000000000000004?ae=-.004837550129223451:ae=-.08324141237464677:t[303]>1e-35?ae=.10703037493990825:t[9]>156.50000000000003?ae=-.10803018621648303:t[116]>1e-35?ae=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ae=.10261721665006701:ae=.018994509090668264:ae=.0011244262442038839;let Me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Me=-.08404263465005328:t[0]>3682.5000000000005?Me=.041259223920298876:t[1]>29.500000000000004?Me=-.09541257493441671:Me=.001482192721625409:Me=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Me=-.08268996098437432:t[230]>1e-35?Me=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Me=-913218977737457e-19:t[4]>10.500000000000002?Me=-.056334165674005156:t[127]>1e-35?Me=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Me=-.04231200150318989:t[10]>42.50000000000001?Me=.10182973257894812:Me=.015934763950068445:Me=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Me=-.041117068322885315:Me=.1167767830037126:Me=.13611206992387337:t[10]>41.50000000000001?Me=-.07120286010564107:Me=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Me=-.07702290997669524:t[198]>1e-35?Me=.08776558554437136:Me=-.008290740324975692:t[2]>32.50000000000001?Me=.07198457624219955:Me=.005463113714361629:Me=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Me=.03295785445437507:Me=.15140250150674536:Me=-.035613213948910254:t[186]>1e-35?Me=.06849425535860769:t[96]>1e-35?Me=.06028225812727254:Me=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let se;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?se=-.01386103677247845:se=.11386694333005128:t[4]>27.500000000000004?se=-.021862617610091336:t[2]>31.500000000000004?se=.0828858469030438:se=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?se=.11303635767048735:se=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?se=-.04238798044549342:se=.022091190130494303:t[5]>5082.500000000001?se=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?se=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?se=-.04291104140431434:t[17]>1e-35?se=.11256797532342613:se=-.017206916368289193:se=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?se=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?se=.03581712466863222:se=.14770264307668884:t[8]>73.50000000000001?se=-.13093289429740068:se=.042461737442702936:t[52]>1e-35?se=.0501831919044939:se=-.010450249720465756:se=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?se=.0005381332165438493:se=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?se=.04849637311285226:se=-.036671377119808564:t[0]>421.50000000000006?se=.00020968499911058945:se=.11636422423182405:se=-.12687837788222575:se=.0012774367867215346;let Ie;t[120]>1e-35?Ie=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ie=-.042799574885345304:Ie=.07412430171193245:Ie=-.11248270469336048:t[193]>1e-35?Ie=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ie=.028911612178122104:Ie=.12326369727728437:t[0]>4091.5000000000005?Ie=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ie=.1159839898100149:Ie=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ie=-.0216343737351583:Ie=-.1220272260878369:t[2]>18.500000000000004?Ie=.09152924475072398:t[8]>55.50000000000001?Ie=.039508716651005665:Ie=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ie=.06793009902674053:Ie=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ie=-.04391068849624096:Ie=.04009967593394672:t[8]>1085.5000000000002?Ie=-.024773826356034825:Ie=-.13919707884246582:Ie=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ie=-.11567917501901476:Ie=-.006813640337684114:t[3]>7.500000000000001?Ie=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ie=-.001754586408351048:Ie=-.055422422450722056:Ie=-.06090032532532226:t[0]>5269.500000000001?Ie=.11787981735983527:Ie=-.00198119768540783:Ie=.00210412924303036;let _e;t[294]>1e-35?t[10]>50.50000000000001?_e=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?_e=-.06063239096209816:_e=.03317022411417386:_e=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?_e=-.013608609329298802:_e=.09078000157330264:t[99]>1e-35?_e=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?_e=-.07536137260189814:_e=.006253266595455118:t[10]>28.500000000000004?_e=-.006106041147592768:t[9]>156.50000000000003?_e=-.11828932797811101:t[94]>1e-35?_e=-.02566078479505714:t[303]>1e-35?_e=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?_e=-.08401252789168523:t[5]>4244.500000000001?_e=.026372887658499107:t[1]>16.500000000000004?_e=-.027836756345634026:_e=.09205362097909099:_e=.00934612788718244:t[203]>1e-35?_e=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?_e=-.09580979052540028:t[1]>50.50000000000001?_e=-.06402211827281554:_e=.08342858760095972:t[2]>36.50000000000001?_e=.008114897658204584:t[92]>1e-35?_e=.09541587072672864:_e=-.022342147210555434:_e=-.01660492519175128:_e=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?_e=.15846731118501817:_e=.039498507912023195:t[245]>1e-35?_e=.07008718676813333:_e=.0019806389728814727;let Re;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Re=-.01192072916082109:Re=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Re=.06874032717466054:t[4]>40.50000000000001?Re=-.07752510020707537:t[1]>76.50000000000001?Re=-.09944032260703917:t[8]>1381.5000000000002?Re=-.054466635810800745:t[1]>32.50000000000001?Re=.05974084520839573:Re=-.0384718740755954:Re=-.11374190719134032:t[0]>2151.5000000000005?Re=-.13703645155803298:Re=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Re=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Re=.013539805885738608:Re=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Re=.09941880179344399:Re=-.01608127391210995:Re=.08025226531247417:t[9]>67.50000000000001?Re=.13525448212444113:t[6]>61.50000000000001?Re=-.05511099182158894:t[94]>1e-35?Re=-.06821509831783572:t[128]>1e-35?Re=.11361314817714643:Re=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Re=-.09954181329804547:t[197]>1e-35?Re=.10102833149755386:t[188]>1e-35?Re=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Re=-.03781554214742005:Re=.09927933385592314:Re=-.020006000056720083:Re=-.10520473615957895:Re=-.12006990846253787:Re=-.00026111570975317574;let Je;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?Je=-.019188245509744628:Je=-.13354864350075848:t[0]>2461.5000000000005?Je=.051885477468354396:Je=-.0833581968852119:Je=.08233441701532287:Je=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?Je=.09926337893072812:Je=-.027753610497327715:t[0]>1972.5000000000002?Je=-.09780045823152517:Je=.032380915168504935:Je=.11502632261226381:t[17]>1e-35?Je=-.06094965899579662:t[10]>40.50000000000001?Je=-.07500475582440802:Je=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?Je=-.09584538995220808:Je=-.00908705814304442:Je=.03203281520813893:t[10]>49.50000000000001?Je=-.03146271513986384:t[2]>63.50000000000001?Je=.13172001315536286:t[224]>1e-35?Je=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?Je=.09521549382082259:Je=-.04414925613522197:t[0]>1847.5000000000002?Je=-.09118580379557353:Je=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?Je=.03525144509943896:Je=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?Je=-.04766112322938157:t[2]>10.500000000000002?Je=.0728516504357201:Je=-.05049625965272536:Je=-.10868663055825774:Je=.0005382613419948969;let Xe;t[147]>1e-35?t[1]>53.50000000000001?Xe=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Xe=-.030504020655417463:Xe=.07102458639110094:Xe=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?Xe=.055304563442710876:t[1]>53.50000000000001?Xe=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?Xe=-.1568835288372895:Xe=-.0279829124400056:Xe=.04493843959601833:Xe=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?Xe=-.054133834303687026:t[9]>48.50000000000001?Xe=.11263810289007213:t[9]>9.500000000000002?Xe=-.02202034562838259:t[4]>45.50000000000001?Xe=-.03410927569045158:Xe=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?Xe=-.029687297407295893:Xe=.10673602850001934:t[4]>42.50000000000001?Xe=.0036275562945108117:Xe=-.0760789221330622:Xe=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Xe=.08274426793676076:Xe=-.07076234425516396:Xe=.13890177606150175:Xe=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?Xe=-.09250637750836187:Xe=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?Xe=-.01897867921812603:Xe=.04890781705365262:Xe=-.11569892307597907:t[2]>106.50000000000001?Xe=.09032697440623969:Xe=.00047935919155035045;let Ct;t[115]>1e-35?Ct=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Ct=-.10131179514695865:t[8]>938.5000000000001?Ct=.10203729808015481:Ct=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Ct=.03574015165562999:Ct=-.07763042506449493:Ct=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Ct=.0665706259130275:Ct=-.06586817559309924:Ct=.11925564412287476:Ct=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Ct=.046017146627455346:Ct=-.08623321630086885:t[8]>1765.5000000000002?Ct=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Ct=.11143827902215087:Ct=-.01817808730473413:Ct=.16980985030210127:Ct=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Ct=.010168994879727824:Ct=-.09099594488792513:t[9]>1.5000000000000002?Ct=.0533459678147928:Ct=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Ct=-.062346959148773695:t[1]>47.50000000000001?Ct=-.0021578343835599316:t[2]>27.500000000000004?Ct=.19567373210166172:Ct=.07851555379116423:t[18]>1e-35?Ct=.03711549097804649:t[8]>359.50000000000006?Ct=.012492346746905587:t[4]>20.500000000000004?Ct=.047511695735697544:Ct=-.07999269063948773:Ct=6802045404471004e-20;let Ot;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Ot=.0011484728213539738:Ot=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Ot=-.09828874964938798:t[8]>1586.5000000000002?Ot=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Ot=.011938269926919522:Ot=.17541983715953954:t[19]>1e-35?Ot=.023002786011088672:Ot=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Ot=.06508934844183291:Ot=-.10168553534835639:Ot=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Ot=.021140806225203937:Ot=-.1167833342453639:t[2]>33.50000000000001?Ot=.13163585734056618:Ot=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Ot=.06314479201263888:Ot=-.09639088327091713:t[10]>29.500000000000004?Ot=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Ot=40577156464836036e-21:Ot=.12322387121810757:Ot=-.03697224045046014:t[1]>22.500000000000004?Ot=.016474835887320276:Ot=.16919298733903063:Ot=.07633203630214054:Ot=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ot=.14150493354700563:Ot=-.01831155354975749:t[1]>28.500000000000004?Ot=-.07952557178685365:t[10]>28.500000000000004?Ot=.0665695554984927:Ot=-.053640139319277094:Ot=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ee;t[71]>1e-35?t[4]>17.500000000000004?Ee=.12586844370423247:Ee=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ee=-.08474891624263797:t[8]>125.50000000000001?Ee=.08125086980439704:Ee=-.04082085238068532:t[0]>3863.5000000000005?Ee=.020481535807469208:Ee=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ee=-.019110200161573936:Ee=-.12387719685855114:t[0]>1102.5000000000002?Ee=.08376595701957407:Ee=-.031821919580524834:t[9]>4.500000000000001?Ee=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ee=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ee=.1349841206807871:Ee=.011864053595560297:t[1]>41.50000000000001?Ee=-.08203662486612544:t[2]>18.500000000000004?Ee=-.009541865642346947:Ee=.08345043168501759:t[2]>10.500000000000002?Ee=-.09585031818030947:Ee=.019432330487099865:Ee=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ee=.11951517733981365:Ee=-.016651014735738538:t[1]>28.500000000000004?Ee=-.07410922545030711:t[10]>28.500000000000004?Ee=.05886430683844788:Ee=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ee=.04802269879144705:Ee=-.026208212831796737:t[4]>45.50000000000001?Ee=-.03227476944664786:Ee=.05124575625622705:Ee=.00020506696916003137;let Qe;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?Qe=-.03042091758483443:t[10]>14.500000000000002?Qe=.09816619204768777:Qe=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?Qe=-.02381165060401718:Qe=-.10950361804974783:Qe=.03538211665111128:t[212]>1e-35?t[19]>1e-35?Qe=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?Qe=-.06371052144380579:Qe=.0835500621252692:Qe=-.10408255929333915:t[1]>74.50000000000001?Qe=.13208968122712403:t[1]>64.50000000000001?Qe=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?Qe=.09922816902423433:Qe=.016366955328796718:Qe=.1592412560903584:t[1]>39.50000000000001?Qe=.05409467990258923:Qe=-.08260633210459611:Qe=-.06307205775247567:t[9]>36.50000000000001?Qe=.040253940015648144:Qe=.14202568969471283:Qe=-.028761848341594044:Qe=.08994073058773508:t[0]>807.5000000000001?Qe=-.043427848826323195:Qe=.04573516446846493:t[20]>1e-35?t[188]>1e-35?Qe=-.0758877731600639:t[23]>1e-35?Qe=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?Qe=.08124700978741987:Qe=.013296063087086852:t[7]>5.500000000000001?Qe=-.01640196088612987:Qe=-.12685498840146067:Qe=-.0004940792382459551;let nt;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?nt=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?nt=.08513773825688947:nt=-.1184664832315282:nt=.05676963535893477:nt=.14263843210340613:nt=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?nt=-.10669720555606924:nt=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?nt=.0664744575868955:nt=-.08469256188890871:nt=-.026746678040592144:t[281]>1e-35?nt=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?nt=.012131807587207655:nt=-.12776015795398743:nt=.04320472481083551:nt=.08390980661550446:t[10]>227.50000000000003?nt=-.09771783809101153:t[10]>130.50000000000003?nt=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?nt=-.07610698254064358:t[8]>902.5000000000001?nt=-.03136381213599649:t[131]>1e-35?nt=.0704821739127936:t[224]>1e-35?nt=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?nt=.10431473040024908:t[8]>841.5000000000001?nt=.07304745320500514:nt=-.038011541882439825:nt=-.01679746695007364:t[0]>3129.5000000000005?nt=.05589952587431965:t[210]>1e-35?nt=.06227198085800842:nt=-.0011341890997947812:t[8]>740.5000000000001?nt=.04817300084412584:nt=-.000577001010789238;let mt;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?mt=-.10504730480402079:t[5]>3341.5000000000005?mt=.11087894671081754:mt=-.0406668834674614:mt=.03308382165616109:t[8]>104.50000000000001?mt=-.10431436764549162:mt=.0073928337244891455:t[4]>34.50000000000001?mt=-.10571751512748416:mt=-.006081128814142983:t[13]>1e-35?mt=.1299673566095023:t[4]>60.50000000000001?mt=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?mt=.04857126072645073:mt=-.03431365358104773:t[4]>16.500000000000004?mt=.04101865986596709:mt=.16480274980378218:t[10]>26.500000000000004?mt=.03673978504199255:t[10]>9.500000000000002?mt=-.10996402743800027:t[308]>1e-35?mt=.0553693735082498:mt=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?mt=.010902983761213922:mt=.1325118659895645:mt=-.064362945508595:t[1]>66.50000000000001?mt=.033416767779331176:mt=-.054080316225040496:t[42]>1e-35?mt=-.07762364337810815:t[10]>1089.5000000000002?mt=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?mt=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?mt=.0220102041325908:mt=-.06516708740003069:mt=.012833498905748267:t[224]>1e-35?mt=-.007038418272997865:mt=.00037666304316290967;let xe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?xe=.07554189644995735:xe=-.052089349455904946:xe=-.10148206848169845:t[113]>1e-35?xe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?xe=.07172653627995676:xe=-.07602959317610998:xe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?xe=-.0399322883690891:xe=.06523495517476098:xe=-.10358715295743802:t[193]>1e-35?xe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?xe=.015928764772252406:xe=.1341513061552287:xe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?xe=-.033592997607280156:xe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?xe=-.08402551858097379:xe=.017401984506038796:t[1]>25.500000000000004?xe=.13337205393591278:xe=-.01160208350090984:xe=.06708317942315471:t[8]>227.50000000000003?xe=-.08486943882418681:xe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?xe=-.10496268177586783:xe=-.020921489532370493:xe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?xe=.11639296062157028:xe=-.004275784356569115:t[32]>1e-35?xe=-.07297384970166025:xe=.006026841626381599:xe=.002034611134960428;let He;t[248]>1e-35?He=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?He=-.06455513326540585:t[1]>29.500000000000004?He=.07718474591552532:t[4]>7.500000000000001?He=.040139336931404826:He=-.09685734690563386:He=.00015327283570347363:t[9]>88.50000000000001?He=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?He=-.04077257804338707:He=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?He=.03778141591008941:He=-.06459919920634845:He=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?He=.14063930759326346:t[0]>179.50000000000003?He=.07287482250668585:t[8]>1180.5000000000002?He=-.14419393112726253:t[10]>28.500000000000004?He=-.07993142770099469:t[17]>1e-35?He=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?He=.05527969663610186:He=-.10824385941441346:t[3]>11.500000000000002?He=.12358502961047915:He=-.017509147119622873:t[0]>74.50000000000001?He=-.014907705458730486:t[8]>95.50000000000001?He=-.02225118168342062:He=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?He=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?He=.04962819555610421:He=-.07213577821855309:He=.09139529824708481:t[19]>1e-35?He=.013439401088345224:He=-.049274647207292056:He=.10531673719686951;let Ze;t[40]>1e-35?t[0]>1937.5000000000002?Ze=-.06421671152073961:Ze=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Ze=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Ze=-.03520420769287065:t[8]>1085.5000000000002?Ze=-.019817352506127633:Ze=.11444439424520964:Ze=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Ze=-.010490117519863269:Ze=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Ze=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Ze=.06619344145920268:t[0]>4091.5000000000005?Ze=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ze=.10016091391222309:Ze=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Ze=-.019511460451434884:Ze=-.11643672465055221:t[2]>18.500000000000004?Ze=.07848228087333317:t[8]>55.50000000000001?Ze=.032583027899956235:Ze=-.11209832692153521:t[11]>1e-35?Ze=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Ze=-.09996887746328006:t[9]>2.5000000000000004?Ze=.02157682011863397:Ze=-.05247727848991843:Ze=.07409150201483244:t[1]>38.50000000000001?Ze=-.11378466075449625:t[224]>1e-35?Ze=-.10741749127732923:t[1]>26.500000000000004?Ze=.07343136534146562:Ze=-.07013573628594773:t[25]>1e-35?Ze=-.04626669734164317:Ze=.05518333197956482:Ze=.00032434010867555516;let at;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?at=.026313251010808853:at=-.08997339150292381:at=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?at=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?at=.0905155504503746:t[8]>1049.5000000000002?at=-.062312558183394054:t[8]>719.5000000000001?at=.09583836191410239:t[0]>3719.5000000000005?at=-.0778097309430818:at=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?at=-.12920865648544927:t[0]>2699.5000000000005?at=-.07086587879041864:at=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?at=-.11377786322600797:at=-.009486325820117998:t[1]>55.50000000000001?at=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?at=-.07938291201004219:t[2]>36.50000000000001?at=.01520046732530246:at=.13649854049662832:at=-.07145015938528873:t[8]>407.50000000000006?at=-.00350257360822279:at=.11332047082193297:at=-.10060624458629897:at=.05429496612497562:t[8]>1446.5000000000002?at=.006073419197482838:at=-.08718676350883998:at=-.11532497988252638:at=.10766270463068293:t[34]>1e-35?at=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?at=-.0004109812623829506:at=.021601073497455662:at=-7343540098965853e-20;let ct;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ct=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?ct=.05995640200798119:t[0]>3443.5000000000005?ct=-.14698883458733583:ct=-.030039164579240187:t[189]>1e-35?ct=-.06086763220538141:t[1]>86.50000000000001?ct=-.05096727866142538:t[4]>64.50000000000001?ct=.11240554253834577:t[4]>45.50000000000001?ct=-.030279760168394117:t[6]>45.50000000000001?ct=.10161088917815142:t[10]>77.50000000000001?ct=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?ct=-.06672020005240323:ct=.08831457502630258:t[8]>2592.5000000000005?ct=-.052617701047376654:t[10]>29.500000000000004?ct=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?ct=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?ct=-.064099222705728:ct=.044332487521538365:t[0]>2882.5000000000005?ct=.031099546885005065:ct=.12938467051623853:t[0]>4221.500000000001?ct=-.0928676413498701:t[9]>30.500000000000004?ct=-.05781824812803708:ct=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?ct=-.06648105454098469:ct=.05985487552383097:ct=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?ct=.05282385499619401:t[1]>66.50000000000001?ct=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?ct=.027885690791379255:ct=-.08407126408362446:ct=.014432924125571093:ct=-9903435845205118e-20;let ut;t[76]>1e-35?ut=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?ut=.013633653464240465:ut=-.10164319411983509:ut=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?ut=.00632864847804078:ut=-.08393000368134668:ut=.07870508617440916:t[284]>1e-35?ut=.1092302727710421:ut=-.0025505047582483234:t[248]>1e-35?ut=.07101822393621864:t[274]>1e-35?ut=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?ut=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?ut=.025081789181021243:ut=-.014813325803582618:t[9]>33.50000000000001?ut=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?ut=.11926990418060353:ut=.01852125513565268:ut=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?ut=-.1178464984373743:t[283]>1e-35?ut=.043370859226927405:t[5]>4320.500000000001?ut=-.01103141226366587:t[8]>1104.5000000000002?ut=-.023053423988095886:ut=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?ut=.000579145585864887:ut=.03389152834202143:t[128]>1e-35?ut=-.14527722052568462:t[210]>1e-35?ut=-.08915971541902741:t[7]>9.500000000000002?ut=-.03307314577076116:t[18]>1e-35?ut=-.05521712302023565:ut=.009315605032770029:ut=.0036332551852289933;let ee;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?ee=-.07583539600416284:t[188]>1e-35?ee=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?ee=-.011038193049597113:ee=.08154028164397753:t[1]>85.50000000000001?ee=.10259361975201933:ee=.011640408330521594:ee=-.00023319159023748508:t[92]>1e-35?ee=.13771692859530546:ee=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?ee=.09967230141007705:t[30]>1e-35?ee=-.08888529037551285:ee=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?ee=.08284665960761373:ee=-.029292565021289504:t[7]>7.500000000000001?ee=-.09945093355204493:ee=-.008381393701708593:t[20]>1e-35?ee=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?ee=.07585582641438211:t[8]>284.50000000000006?ee=-.029387993239886723:ee=.07716738177321587:t[1]>18.500000000000004?ee=.026745348497993746:ee=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?ee=.02337306890530338:ee=-.10390355904767366:ee=.07390521199638532:ee=-.06788247515155237:ee=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?ee=-.06360325615644084:ee=.04342192339836601:ee=-.10598779152030145:ee=.05253384605768211;let pe;t[3]>7.500000000000001?t[157]>1e-35?pe=-.07514182877923786:pe=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?pe=.028692053800951845:pe=.14081686716133598:pe=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?pe=.0037139292567243084:pe=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?pe=.01202688580305612:pe=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?pe=.043935495082738626:pe=-.05639305759669704:t[247]>1e-35?pe=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?pe=.10331836202616368:pe=.0006926658459781341:t[96]>1e-35?pe=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?pe=-.0741403257305367:pe=.022900127535540854:t[7]>3.5000000000000004?pe=.038110741403836294:pe=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?pe=-.09552842289807008:t[1]>27.500000000000004?pe=.012505935885798007:pe=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?pe=-.1046104767723845:pe=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?pe=.023466328488582572:pe=.11730925774586994:pe=-.04771965631104874:pe=.17059689880751394:pe=-.08181850955999449:t[26]>1e-35?pe=-.12727482696678769:pe=-.014343123272734182;let ke;t[147]>1e-35?t[1]>53.50000000000001?ke=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?ke=-.02763546051134888:ke=.06423344777499343:ke=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?ke=.049825139823021586:t[7]>22.500000000000004?ke=-.01131680751379858:t[0]>2579.5000000000005?ke=-.10673674485369694:ke=-.015387212937189957:ke=.04347325151148724:t[179]>1e-35?ke=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ke=.0650355590939066:ke=-.0473332870892226:ke=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?ke=.11139543329789044:t[126]>1e-35?ke=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?ke=.06370903833231022:t[10]>29.500000000000004?ke=.03415223859607161:t[10]>3.5000000000000004?ke=-.07415518117873297:ke=-.0014119203473324082:ke=.12617652343819508:t[9]>41.50000000000001?ke=-.10311145857176976:t[8]>2757.5000000000005?ke=-.08106484219011428:t[7]>71.50000000000001?ke=-.09783384432091176:t[1]>88.50000000000001?ke=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?ke=-.008884084501608536:ke=.061339437777743616:ke=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?ke=.01526664064166223:ke=.13534828515415498:ke=-.06985484465894776:ke=.0005758961943178744;let Le;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Le=-.029152732370514342:Le=.07173628916139178:t[1]>36.50000000000001?Le=-.08859111297255318:Le=.0018030071815630785:Le=.13652461563759322:Le=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Le=-.07145140450454163:t[21]>1e-35?Le=-.07422841663493233:Le=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Le=.11864240653986852:t[3]>33.50000000000001?Le=-.08821209591953476:Le=.05706392280054726:Le=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Le=.01953613016837112:Le=-.059781039130025006:t[148]>1e-35?Le=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Le=.07207826841738371:t[202]>1e-35?Le=.08163917539410503:Le=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Le=-.06858280496900336:Le=-.1781828899516648:Le=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Le=.018232649414147116:Le=-.04419781124222661:Le=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Le=.11452368095776105:Le=-.036496437259924026:Le=-.040445338739465486:Le=.0816572651001145:Le=-.08968914517368663:Le=.0002826343082585516;let Ve;t[189]>1e-35?t[0]>5269.500000000001?Ve=-.08839493050459957:t[10]>85.50000000000001?Ve=.10046908365702462:t[8]>2592.5000000000005?Ve=-.09632233975926387:t[8]>2000.5000000000002?Ve=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?Ve=.035504970430426296:t[1]>31.500000000000004?Ve=-.1133764813142531:Ve=-.01138280942244812:t[8]>1125.5000000000002?Ve=.09800530246229806:Ve=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?Ve=.07316772160107896:Ve=-.059095014819051765:Ve=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?Ve=-.09150209066166894:t[8]>3084.0000000000005?Ve=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?Ve=-.04449234460408263:Ve=.05568837973347338:Ve=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?Ve=.12741077850267066:Ve=.007372371864985329:t[2]>39.50000000000001?Ve=.02295917234617787:Ve=.14966532083907075:t[1]>39.50000000000001?Ve=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?Ve=-.02511861881285652:t[1]>27.500000000000004?Ve=.08683660011672288:Ve=.02956214835267301:t[9]>15.500000000000002?Ve=-.016538805462996232:Ve=.04352738094981517:Ve=-.05561856645643868:t[9]>170.50000000000003?Ve=-.07996752635874248:t[179]>1e-35?Ve=-.09065975936933919:Ve=-.00042817975060427177;let tt;t[39]>1e-35?t[4]>25.500000000000004?tt=.03443173196222934:tt=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?tt=-.0013415395759330318:tt=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?tt=.002297618040307216:tt=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?tt=-.015297257305397608:tt=.09651828834062742:tt=-.06636003334371929:t[10]>11.500000000000002?tt=.17631616138309397:t[0]>1639.5000000000002?tt=3804386478092585e-20:tt=-.09099296398683193:tt=-.06874415876172972:t[0]>2151.5000000000005?tt=-.1311264883406766:tt=.00809052010141122:t[253]>1e-35?tt=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?tt=.045038497754638605:tt=-.07770167665661752:tt=-.08596294280650517:tt=.08538655727027213:tt=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?tt=.054627956617973275:t[1]>61.50000000000001?tt=-.11994465088415499:t[4]>8.500000000000002?tt=.06676200239406452:tt=-.027503148069376867:t[8]>676.5000000000001?tt=-.10363964928357075:t[4]>8.500000000000002?tt=-.07589816227175682:tt=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?tt=.009093153189012338:tt=-.06119765876605404:tt=.0004668642103528348;let vt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?vt=-.10100794502567233:vt=.08000205636470442:vt=-.11945419826856896:t[113]>1e-35?vt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?vt=.1224302423880318:vt=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?vt=.0019277012166729114:t[1]>28.500000000000004?vt=-.054445821715687494:vt=.045645722976713245:t[30]>1e-35?vt=.13402660155331655:vt=.008921176001777645:vt=-.058547426505451076:vt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?vt=-.13526418192218206:vt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?vt=.0007263224246135398:vt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?vt=-.11575657261278308:vt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?vt=-.01995960178292952:vt=.11216586049153021:vt=-.10050961087149474:vt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?vt=.10303451081526649:vt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?vt=-.043799548968209395:vt=-.12451444314954115:t[4]>12.500000000000002?vt=-.03838117361958468:vt=.06504990789767144:t[57]>1e-35?vt=.06890006938293915:vt=.0003914274695562949;let Nt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?Nt=.004271749009686975:Nt=-.10523878297127605:Nt=.04633982158107851:Nt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?Nt=-.08655730561951676:t[8]>919.5000000000001?Nt=-.0676453705610183:t[7]>18.500000000000004?Nt=-.027787974193650575:Nt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?Nt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?Nt=-.03473877164537313:t[8]>719.5000000000001?Nt=.10471053866934404:Nt=.008236107678382981:t[4]>57.50000000000001?Nt=.09412219478825269:t[10]>66.50000000000001?Nt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?Nt=-.040681323751002293:Nt=.06374650297561021:Nt=.12884615227401788:t[10]>5.500000000000001?Nt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?Nt=-.05474068967150784:Nt=.03744700650806603:Nt=-.07846396348680855:t[1]>42.50000000000001?Nt=.018972315810821302:Nt=.10953621007604744:t[5]>4439.500000000001?Nt=.010999776705494586:t[1]>40.50000000000001?Nt=-.12394200059775967:t[10]>2.5000000000000004?Nt=.013528093962849453:Nt=-.09222088417048682:Nt=-.12662967149701485:Nt=.09327296405849603:t[3]>99.50000000000001?Nt=-.013581954439986752:Nt=.0005526498251862075;let Vt;t[187]>1e-35?t[243]>1e-35?Vt=-.08392792551692502:t[10]>68.50000000000001?Vt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?Vt=-.0825306209711224:Vt=.049559996084532945:Vt=-.1064938580886302:Vt=.03353240732240275:Vt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Vt=.16966001471529374:t[1]>57.50000000000001?Vt=-.005772777673676247:Vt=.09383677041525058:t[8]>747.5000000000001?Vt=.054068175469351235:Vt=-.049968216310277036:t[8]>753.5000000000001?Vt=-.0679383555784074:t[4]>8.500000000000002?Vt=-.059757341189735386:Vt=.05701083682780414:Vt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Vt=.05820296128730006:Vt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Vt=.15340611616954566:Vt=.04385036188666874:t[0]>4449.500000000001?Vt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Vt=.004840354641006495:Vt=.09967827580276283:Vt=.11605363537391578:t[9]>19.500000000000004?Vt=-.0735831692725717:Vt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Vt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Vt=-.02442182361342386:Vt=.10334853004243093:Vt=-.030431948680167104:Vt=-956078595250818e-19;let It;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?It=-.040232505718244854:t[0]>3030.5000000000005?It=.0634109586813073:It=-.04043617034245621:It=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?It=-.007859096946435131:It=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?It=.05515771679628051:It=-.04214471312668263:It=-.09589322222261765:t[193]>1e-35?It=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?It=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?It=-.08152604001147906:t[11]>1e-35?It=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?It=.13100930780107503:t[10]>25.500000000000004?It=.05921074710011526:It=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?It=.0009447118243153454:It=-.09820565036865991:It=.057146909749745546:t[0]>2115.5000000000005?It=-.12331216726611678:It=.007281983677694285:t[2]>56.50000000000001?It=.012310154675612615:It=-.08873665774670461:t[6]>25.500000000000004?It=.134708740821879:t[9]>5.500000000000001?It=-.0805901581148979:t[224]>1e-35?It=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?It=.10842593386554122:t[2]>13.500000000000002?It=.06466798320378395:It=-.08578130788886655:It=-.03590892078300114:It=.0003499894043880708;let Be;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?Be=.10839808814624702:Be=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?Be=-.007478368069393829:Be=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?Be=.04035247751736232:t[0]>4255.500000000001?Be=-.1310865624507367:t[0]>4004.5000000000005?Be=.06647367311982634:Be=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?Be=-.011618902907510411:Be=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?Be=.09356028223727986:Be=-.03811765057032162:Be=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?Be=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?Be=.1146142460964847:t[1]>62.50000000000001?Be=-.09679869865322362:t[9]>71.50000000000001?Be=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?Be=-.039046426387852974:Be=.04558778688367152:Be=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?Be=.03261697816211156:t[15]>1e-35?Be=.02586252542264368:t[2]>14.500000000000002?Be=-.016420452667484604:Be=-.1011799626006976:Be=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?Be=.010193588102560583:Be=.11748729525930773:Be=-.04468162226743652:Be=-.028365274393617957:t[71]>1e-35?Be=.05115139346588793:Be=-.0001510425316936658;let oe;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?oe=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?oe=.020637047900190317:oe=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?oe=-.04632587527094407:oe=.08603684785510396:oe=-.05101401015448496:oe=.025466432054358498:oe=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?oe=.020385355430046367:oe=.12032592051335252:oe=-.012387370292173013:t[2]>23.500000000000004?oe=-.12568545484492677:oe=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?oe=.043528764484784536:oe=.14352071657196003:oe=-.009332833816977268:oe=.11186782227735846:oe=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?oe=-.05649104643152564:oe=.03884200719305747:t[42]>1e-35?oe=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?oe=-.04103416502526736:oe=.04881823954656287:t[4]>15.500000000000002?oe=.009342724662897898:t[0]>3969.5000000000005?oe=-.025637309961309498:oe=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?oe=-.08185697075265091:t[0]>2215.5000000000005?oe=.030063975892297354:t[0]>807.5000000000001?oe=-.03924325550733229:oe=.0415330999189793:oe=-.00024374664461674863;let ve;t[3]>7.500000000000001?ve=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ve=.025798416259686565:ve=.13251610353146012:ve=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?ve=-.11098564237775424:ve=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?ve=.15347826616466054:t[3]>4.500000000000001?ve=.10379320730958941:ve=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?ve=.03159791088468647:ve=-.10612873364104258:ve=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?ve=-.02335760775001469:ve=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?ve=-.011164334474672973:ve=-.06594044410501655:t[207]>1e-35?ve=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?ve=-.01725821503981916:ve=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?ve=-.04226531631656534:ve=-.14409800530171432:ve=-.03245576341206398:t[8]>4214.500000000001?ve=.0895409165534886:t[247]>1e-35?ve=-.06506383629143335:t[118]>1e-35?ve=-.07214270121257443:t[8]>546.5000000000001?ve=-.004385020865473831:ve=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?ve=.046278501133958524:ve=-.030835570926968044:t[0]>493.50000000000006?ve=-.12794504651610425:ve=.009415039807550776;let Se;t[304]>1e-35?Se=-.04717777269217453:t[76]>1e-35?Se=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Se=-.09648224457374217:t[132]>1e-35?Se=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Se=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Se=.10838431695638147:t[230]>1e-35?Se=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Se=.050071316251979:Se=-.006356941111525215:t[6]>8.500000000000002?Se=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Se=.10217402850540398:Se=-.048840949025349197:Se=-.03668313197909846:t[7]>39.50000000000001?Se=-.0562642841496003:t[10]>2.5000000000000004?Se=.09749777369987417:Se=-.04848223121417616:t[0]>5453.500000000001?Se=.08316648226133942:Se=-.0261979698267618:t[212]>1e-35?Se=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Se=.04837009746506856:Se=-.09184360565631328:Se=.0032411047845613606:t[0]>4733.500000000001?Se=.0977378556864798:Se=.010776545559325588:Se=-.012483310473120218:Se=-.049284121449103935:Se=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Se=-.08380361910948711:Se=.07375088778585813:Se=-.1084864186071348:Se=.0007819503469605476;let de;t[7]>17.500000000000004?t[115]>1e-35?de=.08741852531696623:t[167]>1e-35?de=.10078975495600809:de=-.0018324767784017562:t[290]>1e-35?de=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?de=.1379733311640402:de=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?de=-.09360083033774169:de=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?de=-.015599362579530679:t[0]>4593.500000000001?de=-.12029549262691491:de=-.018917032256501397:de=.04632831686576592:de=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?de=-.05894883236412263:de=.05213944998315824:de=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?de=.07577412405680808:de=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?de=-.0277076900736147:t[1]>65.50000000000001?de=-.023587471585763506:de=.10184896592433082:de=-.057699270527916825:de=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?de=.06566902102799584:t[10]>25.500000000000004?de=-.07033633753181047:de=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?de=-.08108035861059537:de=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?de=-.12431182772561139:de=.01886235886984271:de=.0025579594894418116;let te;t[8]>2915.5000000000005?t[101]>1e-35?te=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?te=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?te=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?te=.0687641681341721:t[10]>102.50000000000001?te=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?te=-.06762578396473291:t[10]>65.50000000000001?te=-.05226727783610509:t[282]>1e-35?te=.09911438410640917:t[19]>1e-35?te=.06915156336429933:te=-.006565637886508241:te=-.08344300251849307:te=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?te=.19428463865406298:te=.016073883020956765:t[13]>1e-35?te=.06864077097923665:te=-.01388867527034731:t[0]>1847.5000000000002?te=.004655280608161356:t[1]>40.50000000000001?te=.031406054057765996:te=.12798062439212832:te=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?te=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?te=-.0706095614785733:te=.04227164041372561:te=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?te=-.07139533369873902:te=.008952586782921625:te=.06086212582180936:te=-.0816938490403437:te=-.051224901945956025:te=-.10525399124186095:te=.000270924147208224;let Fe;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Fe=.029186512383291244:t[7]>1.5000000000000002?Fe=-.14984127276725573:t[1]>40.50000000000001?Fe=.032757060730648144:Fe=-.07675575422749602:t[6]>8.500000000000002?Fe=.10599766037117893:Fe=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.051394622947855385:Fe=.03237141302699347:Fe=.12526173027943244:Fe=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Fe=-.07383912482657777:t[0]>5147.500000000001?Fe=.07008813937042091:t[10]>38.50000000000001?Fe=-.06779203808365307:Fe=-.013782769999524498:Fe=.0880038869117715:Fe=-.12846294176070952:t[281]>1e-35?Fe=-.06810806903850834:t[10]>227.50000000000003?Fe=-.08937977001661111:t[10]>130.50000000000003?Fe=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.011036530162093841:Fe=-.11500797478569702:Fe=.03702229366129399:Fe=.07242026683784307:t[189]>1e-35?Fe=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Fe=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Fe=-.02608892716555304:Fe=.09609599320761308:t[9]>105.50000000000001?Fe=-.06848127135991534:Fe=.0023675721254089715:t[86]>1e-35?Fe=-.11049635625500497:Fe=-.004847764219432233;let et;t[125]>1e-35?t[0]>3969.5000000000005?et=-.09462233499115416:et=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?et=-.030700661288166148:et=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?et=.03149547314036763:et=-.08166208257451366:t[0]>5850.500000000001?et=-.10228136324773157:t[102]>1e-35?et=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?et=.01782894842128785:t[13]>1e-35?et=.002680190260979968:et=.1773965720476949:t[2]>72.50000000000001?et=.09090831938627947:t[1]>59.50000000000001?et=-.12297206702816128:t[0]>4977.500000000001?et=.09899015653118268:et=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?et=-.0675900954187773:et=.012336403425364092:et=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?et=-.02671721777458802:et=-.09242452991958029:t[284]>1e-35?et=-.08585691288582491:et=.013332890564324447:t[4]>14.500000000000002?et=-.005245022074799553:t[23]>1e-35?et=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?et=-.09289852307936758:t[116]>1e-35?et=-.09686573010015055:t[8]>804.5000000000001?et=.03812547148215318:et=.005162744968176633:t[9]>43.50000000000001?et=-.059246106396159376:et=.050370113808135275:et=.000794041852811028;let Ht;t[3]>7.500000000000001?Ht=.0004981426543104341:t[9]>114.50000000000001?Ht=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Ht=-.019061766497948867:Ht=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Ht=-.006044199577160493:Ht=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Ht=.11486607015912494:t[9]>16.500000000000004?Ht=-.08686820858087294:Ht=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Ht=-.022230207980026437:Ht=.1056683690528792:Ht=-.05859530800943035:Ht=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Ht=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Ht=-.05177544573528314:Ht=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Ht=.15159657923771555:Ht=-.0060542654587671055:t[9]>5.500000000000001?Ht=-.042808028205051786:t[1]>48.50000000000001?Ht=-.010449538258110742:Ht=.10026907521968294:Ht=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Ht=-.02272452389409874:Ht=-.11202691218244319:t[5]>1809.5000000000002?Ht=-.04460413584255906:Ht=.08196329474205256:t[10]>69.50000000000001?Ht=.10221481166238167:Ht=.0004063052701699382:t[243]>1e-35?Ht=-.07563941678849846:t[18]>1e-35?Ht=.02563513231103432:Ht=-.004740081147303786;let mr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?mr=.057446442918106:mr=-.04404018270156349:mr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?mr=-.05930486238817954:t[1]>29.500000000000004?mr=.06955866121256543:t[8]>597.5000000000001?mr=-.06538593556505168:mr=.06212512595497445:mr=.00021102929959182257:t[9]>90.50000000000001?mr=.0958061289119631:t[102]>1e-35?mr=.07172059675638813:t[1]>47.50000000000001?mr=-.03879798603977766:t[297]>1e-35?mr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?mr=.003805910996312012:mr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?mr=.11252376801858695:t[288]>1e-35?mr=-.10293901912180432:mr=.014669268837893872:t[1]>42.50000000000001?mr=-.05988274123836837:t[145]>1e-35?mr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?mr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?mr=-.03366718308159971:mr=.11936550608549797:t[1]>31.500000000000004?mr=-.07454716789539667:mr=.027859650621164217:t[10]>10.500000000000002?mr=-.11806374092321247:mr=-.03506042229223101:mr=-.0007080765837654515:t[10]>6.500000000000001?mr=-.028077713664996503:t[2]>7.500000000000001?mr=.15803724124216814:mr=.0351381284833169:mr=-.07877953381054767;let or;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?or=.14144941521975005:or=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?or=.10514088112381886:t[7]>18.500000000000004?or=-.10370643555956745:or=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?or=-.0508129468802936:t[224]>1e-35?or=-.037816066368733595:t[10]>43.50000000000001?or=.07793408602607932:or=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?or=.036972453794202324:or=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?or=.09475302525132188:or=-.03580104945898193:or=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?or=-.1282448778804823:or=-.014395808269207212:or=-.008940927190750592:or=-.1459118815453748:t[0]>4897.500000000001?or=-.09733068457286576:t[1]>57.50000000000001?or=.06575271409540207:or=-.019556422817450115:or=-.10623959222984136:t[18]>1e-35?or=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?or=.008125645893104896:or=-.11084368630465868:or=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?or=-.05854904579626861:t[4]>5.500000000000001?or=.02985784951394175:or=-.03247600140149334:or=-.11152899295304973:or=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let wm=Goc(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+k+D+N+L+B+Q+M+O+q+F+U+W+V+G+Y+re+j+X+ie+we+Ae+De+Te+Z+J+z+le+K+ae+Me+ne+se+Ie+_e+Re+Je+Xe+Ct+Ot+$t+Gt+Ee+Qe+nt+mt+xe+He+Ze+at+ct+ut+ee+pe+ke+Le+Ve+tt+vt+Nt+Vt+It+Be+oe+ve+Se+de+te+Fe+et+Ht+mr+or+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(Hoc,"multilineModelPredict");function Goc(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(Goc,"sigmoid")});var _Ni=I(c$=>{"use strict";p();Object.defineProperty(c$,"__esModule",{value:!0});c$.MultilineModelFeatures=c$.PromptFeatures=void 0;c$.hasComment=tRr;c$.requestMultilineScore=zoc;var a$=ANi(),$oc=yNi(),Voc={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},ENi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function tRr(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(Voc[r]??[]).some(l=>s.includes(l))}a(tRr,"hasComment");var Z5e=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=tRr(e,-2,r),this.rstripSecondToLastLineHasComment=tRr(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)[0]}return r}a(RNi,"makeGhostAPIChoice");function Kwr(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),(0,uic.telemetry)(t,`ghostText.${e}`,l)}a(Kwr,"telemetryPerformance")});var kNi=I(ayt=>{"use strict";p();Object.defineProperty(ayt,"__esModule",{value:!0});ayt.contextualFilterCharacterMap=void 0;ayt.contextualFilterCharacterMap={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95}});var DNi=I(Jwr=>{"use strict";p();Object.defineProperty(Jwr,"__esModule",{value:!0});Jwr.multilineModelPredict=hic;function hic(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let B;t[308]>1e-35?B=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?B=.023223358334607133:B=-.04383410185346742:B=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?B=.023406489302867494:B=-.085521220804058:B=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?B=.028120059780969632:B=-.04211009474298743:t[294]>1e-35?B=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?B=-.0993035220737934:B=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?B=.029770210551187937:B=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?B=.06421359317599738:B=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?B=.024368404612215164:B=-.04045232374803373:t[131]>1e-35?B=.017372701982485795:t[120]>1e-35?B=.08812710275150198:t[18]>1e-35?t[90]>1e-35?B=.18451364351180236:t[7]>33.50000000000001?B=-.03850813130183531:t[195]>1e-35?B=.06966114053446336:t[3]>16.500000000000004?B=-.0012869181693341211:t[0]>4242.500000000001?B=-.054625548611291035:B=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?B=.006302103427145562:B=.13967622319898698:t[121]>1e-35?B=-.038798585213145644:t[5]>4544.500000000001?B=-.08050498033009466:B=-.002986974112681435;let L;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?L=-.03461119351456781:L=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?L=-.12404435523286539:L=-.0034376913880382956:L=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?L=.0037507103585310234:L=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?L=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?L=-.04832024079663151:t[37]>1e-35?L=-.037103393468366934:L=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?L=.032539071163832034:t[5]>1643.5000000000002?L=.036408625378035665:t[0]>1500.5000000000002?L=-.1346358322854993:L=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?L=-.1133991164577881:t[9]>52.50000000000001?L=-.024478640359723122:L=.03673777861098756:L=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?L=.002583438691776944:L=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?L=-.02141222346712401:L=.06392462314316179:t[4]>12.500000000000002?L=.08700122294434816:t[8]>267.50000000000006?L=.056923170082743224:L=-.07716309825583327:t[32]>1e-35?L=-.03961343943752142:L=.002674914122888783:t[1]>42.50000000000001?L=-.05217539654421676:t[145]>1e-35?L=.09553630282946368:L=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let $;t[8]>1014.5000000000001?t[9]>137.50000000000003?$=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?$=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?$=.07211107542565391:$=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?$=-.0751486415451188:t[1]>59.50000000000001?$=.13459005084554104:$=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?$=.06715575425741895:$=-.005895690393702183:t[8]>2915.5000000000005?$=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?$=-.00029068886245881074:$=.0613467393188786:t[148]>1e-35?$=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?$=.003887223773199377:$=-.08553893131979015:$=.025654192706396767:$=-.05651733979610658:$=-.02039913645229667:t[2]>7.500000000000001?$=-.1058450646728524:$=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?$=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?$=.1283258201586378:$=-.01718135372229775:$=-.07702452408491414:t[125]>1e-35?$=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?$=.04273051857848212:$=-.04533122948101463:t[2]>196.50000000000003?$=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?$=.0231032972703664:$=-.04807386814498683:$=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Oe;t[179]>1e-35?Oe=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Oe=-.07595415373151816:Oe=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Oe=.022822510448266862:Oe=.17491569312933697:Oe=-.058362287133533565:t[2]>2.5000000000000004?Oe=-.03633895806364428:Oe=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Oe=-.07294848747514579:Oe=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Oe=-.07009535282685533:t[8]>2640.0000000000005?Oe=-.051761240111316276:t[131]>1e-35?Oe=-.06245774419231631:Oe=.03495606662854905:Oe=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Oe=.0015036626973581122:Oe=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Oe=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Oe=.022343994371919224:Oe=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Oe=.07724450228328664:t[0]>3853.5000000000005?Oe=-.15671707454435677:t[10]>28.500000000000004?Oe=-.10179090671841723:Oe=.014878216919760927:Oe=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Oe=.14054154485273487:Oe=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Oe=-.08632985141410315:Oe=.005524157938954954:Oe=-.08802502622523681:Oe=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let Fe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Fe=.009769895322846493:Fe=-.10620052926943656:t[9]>19.500000000000004?Fe=.03781202525403449:t[9]>14.500000000000002?Fe=-.11485785321365344:t[9]>6.500000000000001?Fe=.07677177833073881:t[0]>4342.500000000001?Fe=-.07079285609687631:t[49]>1e-35?Fe=.06156814809246001:Fe=-.014788509042554625:Fe=-.032659201618470655:t[5]>5207.500000000001?Fe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Fe=-.03094160322187924:t[1]>29.500000000000004?Fe=.09474646043921069:Fe=.023445783928231618:Fe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Fe=-.07164443768784848:t[1]>29.500000000000004?Fe=.089473622509272:t[8]>597.5000000000001?Fe=-.08155349903101317:Fe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Fe=-.004003900679358653:t[190]>1e-35?Fe=-.09236113461485262:t[8]>3198.5000000000005?Fe=-.0124130160451179:Fe=.018453070064009328:t[15]>1e-35?Fe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Fe=-.0009580759587680961:Fe=-.03227283036698222:Fe=.01369287669536875:t[1]>50.50000000000001?Fe=-.04213060332500437:t[35]>1e-35?Fe=-.11508095777767471:t[190]>1e-35?Fe=-.08611884672400155:t[297]>1e-35?Fe=.05723551879433584:Fe=-.004829340082311461;let Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let pe;t[189]>1e-35?t[0]>5269.500000000001?pe=-.103183298350443:t[2]>51.50000000000001?pe=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?pe=-.05186168947388339:pe=.0496996365539082:t[10]>23.500000000000004?pe=.1404445738719:t[93]>1e-35?pe=.0027146310074558505:t[5]>3821.5000000000005?pe=.002153033152069652:t[4]>2.5000000000000004?pe=.007663539551317215:pe=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?pe=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?pe=-.021479467709980358:pe=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?pe=.021660293256233334:pe=-.0927396152303864:pe=.0665074081601698:t[0]>1550.5000000000002?pe=.08972407105958534:pe=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?pe=.06761927942466854:pe=-.015762168112653286:t[17]>1e-35?pe=.10311304131145381:pe=-.017672785252336027:pe=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?pe=-.10638321435298535:pe=.0007073011744385905:t[18]>1e-35?pe=-.027056185501334325:t[145]>1e-35?pe=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?pe=.09762140519655171:t[9]>110.50000000000001?pe=-.06581942957595835:t[6]>54.50000000000001?pe=.04959634035251596:pe=.0022616298654554207:pe=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let Et;t[115]>1e-35?Et=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Et=-.10131179514695865:t[8]>938.5000000000001?Et=.10203729808015481:Et=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Et=.03574015165562999:Et=-.07763042506449493:Et=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Et=.0665706259130275:Et=-.06586817559309924:Et=.11925564412287476:Et=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Et=.046017146627455346:Et=-.08623321630086885:t[8]>1765.5000000000002?Et=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Et=.11143827902215087:Et=-.01817808730473413:Et=.16980985030210127:Et=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Et=.010168994879727824:Et=-.09099594488792513:t[9]>1.5000000000000002?Et=.0533459678147928:Et=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Et=-.062346959148773695:t[1]>47.50000000000001?Et=-.0021578343835599316:t[2]>27.500000000000004?Et=.19567373210166172:Et=.07851555379116423:t[18]>1e-35?Et=.03711549097804649:t[8]>359.50000000000006?Et=.012492346746905587:t[4]>20.500000000000004?Et=.047511695735697544:Et=-.07999269063948773:Et=6802045404471004e-20;let kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let Gt;t[76]>1e-35?Gt=-.06814884255939921:t[179]>1e-35?Gt=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Gt=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Gt=.004193658608848433:Gt=-.1066968975983452:t[8]>302.50000000000006?Gt=.05476730110440451:Gt=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Gt=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Gt=.013555772109446666:Gt=-.09856116699770784:Gt=.0284329611813383:t[2]>52.50000000000001?Gt=.04008708444763762:t[9]>29.500000000000004?Gt=-.1289599546008197:Gt=-.018566534248335896:t[8]>747.5000000000001?Gt=.02236484980076122:Gt=.1148871655157582:t[8]>3084.0000000000005?Gt=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Gt=.03164751204281298:Gt=.11752140436184891:t[9]>42.50000000000001?Gt=-.07180559595410106:t[22]>1e-35?Gt=.09325040416256854:Gt=-.016041122807939914:Gt=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Gt=-.010718250133458515:Gt=.09818827994853763:Gt=.010180038981174032:Gt=-.039472162599295535:t[9]>170.50000000000003?Gt=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Gt=-.08674788057474031:Gt=.02077653508548371:Gt=-.0003536561382007414;let jt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?jt=.018337297491457794:jt=-.05926206443180149:jt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?jt=.10747078482128616:t[126]>1e-35?jt=-.10550625192391357:t[7]>71.50000000000001?jt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?jt=.1317396472229434:jt=-.025035791351328947:jt=-.0728334305864372:t[8]>963.5000000000001?jt=.023642201723096064:jt=.183010326734258:t[128]>1e-35?jt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?jt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?jt=-.1088876900335281:jt=.02758317023002635:jt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?jt=-.01928020117446408:jt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?jt=.07893723375925096:jt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?jt=-.10301657587280551:jt=.005787463140224318:jt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?jt=-.019296977889522397:jt=-.07274529751752634:t[1]>30.500000000000004?jt=-.050368901143148286:jt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?jt=.0015332402792773946:jt=.09930153676749967:jt=-.06370844564357069:jt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.000577001010789238;let Ue;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Ue=-.10504730480402079:t[5]>3341.5000000000005?Ue=.11087894671081754:Ue=-.0406668834674614:Ue=.03308382165616109:t[8]>104.50000000000001?Ue=-.10431436764549162:Ue=.0073928337244891455:t[4]>34.50000000000001?Ue=-.10571751512748416:Ue=-.006081128814142983:t[13]>1e-35?Ue=.1299673566095023:t[4]>60.50000000000001?Ue=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Ue=.04857126072645073:Ue=-.03431365358104773:t[4]>16.500000000000004?Ue=.04101865986596709:Ue=.16480274980378218:t[10]>26.500000000000004?Ue=.03673978504199255:t[10]>9.500000000000002?Ue=-.10996402743800027:t[308]>1e-35?Ue=.0553693735082498:Ue=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Ue=.010902983761213922:Ue=.1325118659895645:Ue=-.064362945508595:t[1]>66.50000000000001?Ue=.033416767779331176:Ue=-.054080316225040496:t[42]>1e-35?Ue=-.07762364337810815:t[10]>1089.5000000000002?Ue=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Ue=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Ue=.0220102041325908:Ue=-.06516708740003069:Ue=.012833498905748267:t[224]>1e-35?Ue=-.007038418272997865:Ue=.00037666304316290967;let de;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?de=.07554189644995735:de=-.052089349455904946:de=-.10148206848169845:t[113]>1e-35?de=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?de=.07172653627995676:de=-.07602959317610998:de=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?de=-.0399322883690891:de=.06523495517476098:de=-.10358715295743802:t[193]>1e-35?de=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?de=.015928764772252406:de=.1341513061552287:de=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?de=-.033592997607280156:de=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?de=-.08402551858097379:de=.017401984506038796:t[1]>25.500000000000004?de=.13337205393591278:de=-.01160208350090984:de=.06708317942315471:t[8]>227.50000000000003?de=-.08486943882418681:de=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?de=-.10496268177586783:de=-.020921489532370493:de=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?de=.11639296062157028:de=-.004275784356569115:t[32]>1e-35?de=-.07297384970166025:de=.006026841626381599:de=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Le;t[40]>1e-35?t[0]>1937.5000000000002?Le=-.06421671152073961:Le=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Le=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Le=-.03520420769287065:t[8]>1085.5000000000002?Le=-.019817352506127633:Le=.11444439424520964:Le=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Le=-.010490117519863269:Le=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Le=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Le=.06619344145920268:t[0]>4091.5000000000005?Le=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Le=.10016091391222309:Le=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Le=-.019511460451434884:Le=-.11643672465055221:t[2]>18.500000000000004?Le=.07848228087333317:t[8]>55.50000000000001?Le=.032583027899956235:Le=-.11209832692153521:t[11]>1e-35?Le=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Le=-.09996887746328006:t[9]>2.5000000000000004?Le=.02157682011863397:Le=-.05247727848991843:Le=.07409150201483244:t[1]>38.50000000000001?Le=-.11378466075449625:t[224]>1e-35?Le=-.10741749127732923:t[1]>26.500000000000004?Le=.07343136534146562:Le=-.07013573628594773:t[25]>1e-35?Le=-.04626669734164317:Le=.05518333197956482:Le=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.0036332551852289933;let Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let he;t[147]>1e-35?t[1]>53.50000000000001?he=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?he=-.02763546051134888:he=.06423344777499343:he=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?he=.049825139823021586:t[7]>22.500000000000004?he=-.01131680751379858:t[0]>2579.5000000000005?he=-.10673674485369694:he=-.015387212937189957:he=.04347325151148724:t[179]>1e-35?he=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?he=.0650355590939066:he=-.0473332870892226:he=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?he=.11139543329789044:t[126]>1e-35?he=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?he=.06370903833231022:t[10]>29.500000000000004?he=.03415223859607161:t[10]>3.5000000000000004?he=-.07415518117873297:he=-.0014119203473324082:he=.12617652343819508:t[9]>41.50000000000001?he=-.10311145857176976:t[8]>2757.5000000000005?he=-.08106484219011428:t[7]>71.50000000000001?he=-.09783384432091176:t[1]>88.50000000000001?he=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?he=-.008884084501608536:he=.061339437777743616:he=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?he=.01526664064166223:he=.13534828515415498:he=-.06985484465894776:he=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let Xe;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?Xe=-.10100794502567233:Xe=.08000205636470442:Xe=-.11945419826856896:t[113]>1e-35?Xe=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?Xe=.1224302423880318:Xe=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?Xe=.0019277012166729114:t[1]>28.500000000000004?Xe=-.054445821715687494:Xe=.045645722976713245:t[30]>1e-35?Xe=.13402660155331655:Xe=.008921176001777645:Xe=-.058547426505451076:Xe=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?Xe=-.13526418192218206:Xe=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?Xe=.0007263224246135398:Xe=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?Xe=-.11575657261278308:Xe=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?Xe=-.01995960178292952:Xe=.11216586049153021:Xe=-.10050961087149474:Xe=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Xe=.10303451081526649:Xe=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?Xe=-.043799548968209395:Xe=-.12451444314954115:t[4]>12.500000000000002?Xe=-.03838117361958468:Xe=.06504990789767144:t[57]>1e-35?Xe=.06890006938293915:Xe=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ge;t[7]>17.500000000000004?t[115]>1e-35?ge=.08741852531696623:t[167]>1e-35?ge=.10078975495600809:ge=-.0018324767784017562:t[290]>1e-35?ge=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ge=.1379733311640402:ge=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ge=-.09360083033774169:ge=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ge=-.015599362579530679:t[0]>4593.500000000001?ge=-.12029549262691491:ge=-.018917032256501397:ge=.04632831686576592:ge=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ge=-.05894883236412263:ge=.05213944998315824:ge=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ge=.07577412405680808:ge=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ge=-.0277076900736147:t[1]>65.50000000000001?ge=-.023587471585763506:ge=.10184896592433082:ge=-.057699270527916825:ge=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ge=.06566902102799584:t[10]>25.500000000000004?ge=-.07033633753181047:ge=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ge=-.08108035861059537:ge=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ge=-.12431182772561139:ge=.01886235886984271:ge=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let $t;t[3]>7.500000000000001?$t=.0004981426543104341:t[9]>114.50000000000001?$t=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?$t=-.019061766497948867:$t=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?$t=-.006044199577160493:$t=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?$t=.11486607015912494:t[9]>16.500000000000004?$t=-.08686820858087294:$t=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?$t=-.022230207980026437:$t=.1056683690528792:$t=-.05859530800943035:$t=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?$t=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?$t=-.05177544573528314:$t=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?$t=.15159657923771555:$t=-.0060542654587671055:t[9]>5.500000000000001?$t=-.042808028205051786:t[1]>48.50000000000001?$t=-.010449538258110742:$t=.10026907521968294:$t=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?$t=-.02272452389409874:$t=-.11202691218244319:t[5]>1809.5000000000002?$t=-.04460413584255906:$t=.08196329474205256:t[10]>69.50000000000001?$t=.10221481166238167:$t=.0004063052701699382:t[243]>1e-35?$t=-.07563941678849846:t[18]>1e-35?$t=.02563513231103432:$t=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let sr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?sr=.14144941521975005:sr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?sr=.10514088112381886:t[7]>18.500000000000004?sr=-.10370643555956745:sr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?sr=-.0508129468802936:t[224]>1e-35?sr=-.037816066368733595:t[10]>43.50000000000001?sr=.07793408602607932:sr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?sr=.036972453794202324:sr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?sr=.09475302525132188:sr=-.03580104945898193:sr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?sr=-.1282448778804823:sr=-.014395808269207212:sr=-.008940927190750592:sr=-.1459118815453748:t[0]>4897.500000000001?sr=-.09733068457286576:t[1]>57.50000000000001?sr=.06575271409540207:sr=-.019556422817450115:sr=-.10623959222984136:t[18]>1e-35?sr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?sr=.008125645893104896:sr=-.11084368630465868:sr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?sr=-.05854904579626861:t[4]>5.500000000000001?sr=.02985784951394175:sr=-.03247600140149334:sr=-.11152899295304973:sr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let Pm=mic(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+B+L+j+M+O+q+Q+U+z+W+$+J+ne+H+re+ae+Oe+ve+Fe+Pe+Z+ee+K+pe+X+ue+qe+ie+le+Ne+we+Be+tt+st+Et+kt+Gt+jt+Ie+F+be+Ue+de+Se+Le+te+Te+Ge+Y+se+he+Ce+He+$e+Xe+ct+bt+ht+We+ce+Re+Me+ge+oe+ze+at+$t+gr+sr+Mr+Hr+Gr+zt+_r);return[1-Pm,Pm]}a(hic,"multilineModelPredict");function mic(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(mic,"sigmoid")});var MNi=I(ZG=>{"use strict";p();Object.defineProperty(ZG,"__esModule",{value:!0});ZG.MultilineModelFeatures=ZG.PromptFeatures=void 0;ZG.hasComment=Zwr;ZG.requestMultilineScore=Eic;var JG=kNi(),gic=DNi(),Aic={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},NNi={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function Zwr(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(Aic[r]??[]).some(l=>s.includes(l))}a(Zwr,"hasComment");var Q5e=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=Zwr(e,-2,r),this.rstripSecondToLastLineHasComment=Zwr(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};c$.PromptFeatures=Z5e;var hyt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Z5e(e,n),this.suffixFeatures=new Z5e(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(ENi).length+1).fill(0);r[ENi[this.language]??0]=1;let n=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);n[a$.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);o[a$.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);s[a$.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(a$.contextualFilterCharacterMap).length+1).fill(0);return c[a$.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};c$.MultilineModelFeatures=hyt;function Woc(t,e){return new hyt(t.prefix,t.suffix,e)}a(Woc,"constructMultilineFeatures");function zoc(t,e){let r=Woc(t,e).constructFeatures();return(0,$oc.multilineModelPredict)(r)[1]}a(zoc,"requestMultilineScore")});var CNi=I(p6=>{"use strict";p();var Yoc=p6&&p6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Koc=p6&&p6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(p6,"__esModule",{value:!0});p6.StreamedCompletionSplitter=void 0;var Joc=Qs(),Zoc=XOe(),Xoc=Zme(),rRr=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},nRr=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new rRr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new Xoc.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(Zoc.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p6.StreamedCompletionSplitter=nRr;p6.StreamedCompletionSplitter=nRr=Yoc([Koc(5,Joc.IInstantiationService)],nRr)});var RNi=I(iRr=>{"use strict";p();Object.defineProperty(iRr,"__esModule",{value:!0});iRr.getGhostTextStrategy=ssc;var xNi=Qs(),vNi=Ute(),wD=vE(),wNi=VA(),myt=ngt(),bNi=Tg(),esc=Hme(),X5e=Zme(),tsc=Ywr(),rsc=UOe(),nsc=Kbr(),isc=_Ni(),osc=CNi(),SNi=20;function TNi(t){return e=>{let r=e?.split(` +`),n=r.length,o=r[0],s=r[n-1];return s===""&&n>1&&(s=r[n-2]),[o,s]}};ZG.PromptFeatures=Q5e;var cyt=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Q5e(e,n),this.suffixFeatures=new Q5e(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(NNi).length+1).fill(0);r[NNi[this.language]??0]=1;let n=new Array(Object.keys(JG.contextualFilterCharacterMap).length+1).fill(0);n[JG.contextualFilterCharacterMap[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(JG.contextualFilterCharacterMap).length+1).fill(0);o[JG.contextualFilterCharacterMap[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(JG.contextualFilterCharacterMap).length+1).fill(0);s[JG.contextualFilterCharacterMap[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(JG.contextualFilterCharacterMap).length+1).fill(0);return c[JG.contextualFilterCharacterMap[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};ZG.MultilineModelFeatures=cyt;function yic(t,e){return new cyt(t.prefix,t.suffix,e)}a(yic,"constructMultilineFeatures");function Eic(t,e){let r=yic(t,e).constructFeatures();return(0,gic.multilineModelPredict)(r)[1]}a(Eic,"requestMultilineScore")});var ONi=I(o6=>{"use strict";p();var _ic=o6&&o6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vic=o6&&o6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(o6,"__esModule",{value:!0});o6.StreamedCompletionSplitter=void 0;var Cic=Ms(),bic=qOe(),Sic=Gme(),Xwr=class t{static{a(this,"StreamingCompletion")}constructor(e,r){this.index=e,this.documentPrefix=r,this.startOffset=0,this.text="",this.trimCount=0}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},eRr=class{static{a(this,"StreamedCompletionSplitter")}constructor(e,r,n,o,s,c){this.prefix=e,this.languageId=r,this.initialSingleLine=n,this.trimmerLookahead=o,this.cacheFunction=s,this.instantiationService=c,this.lineLimit=3,this.completions=new Map}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new Xwr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new Sic.TerseBlockTrimmer(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=this.instantiationService.invokeFunction(bic.convertToAPIChoice,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};o6.StreamedCompletionSplitter=eRr;o6.StreamedCompletionSplitter=eRr=_ic([vic(5,Cic.IInstantiationService)],eRr)});var HNi=I(tRr=>{"use strict";p();Object.defineProperty(tRr,"__esModule",{value:!0});tRr.getGhostTextStrategy=kic;var qNi=Ms(),BNi=Mte(),TD=_E(),jNi=JA(),lyt=Jmt(),LNi=Ig(),Tic=Ome(),q5e=Gme(),Iic=Vwr(),xic=xOe(),wic=Wbr(),Ric=MNi(),Pic=ONi(),FNi=20;function UNi(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(TNi,"takeNLines");async function ssc(t,e,r,n,o,s,c){let l=t.get(xNi.IInstantiationService),u=t.get(wNi.ICompletionsFeaturesService),d=t.get(nsc.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case wD.BlockMode.Server:return s?{blockMode:wD.BlockMode.Parsing,requestMultiline:!0,finishedCb:TNi(f),stop:[` +`).length}}a(UNi,"takeNLines");async function kic(t,e,r,n,o,s,c){let l=t.get(qNi.IInstantiationService),u=t.get(jNi.ICompletionsFeaturesService),d=t.get(wic.ICompletionsBlockModeConfig),f=u.multilineAfterAcceptLines(c),h=d.forLanguage(e.textDocument.detectedLanguageId,c);switch(h){case TD.BlockMode.Server:return s?{blockMode:TD.BlockMode.Parsing,requestMultiline:!0,finishedCb:UNi(f),stop:[` -`],maxTokens:SNi*f}:{blockMode:wD.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case wD.BlockMode.Parsing:case wD.BlockMode.ParsingAndServer:case wD.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(asc,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=esc.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(INi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:wD.BlockMode.Parsing,requestMultiline:!0,finishedCb:TNi(f),stop:[` +`],maxTokens:FNi*f}:{blockMode:TD.BlockMode.Server,requestMultiline:!0,finishedCb:a(m=>{},"finishedCb")};case TD.BlockMode.Parsing:case TD.BlockMode.ParsingAndServer:case TD.BlockMode.MoreMultiline:default:{let m;try{m=await l.invokeFunction(Dic,h,e.textDocument,e.position,o,s,n)}catch{m={requestMultiline:!1}}if(!s&&m.requestMultiline&&u.singleLineUnlessAccepted(c)&&(m.requestMultiline=!1),m.requestMultiline){let g;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?g=Tic.LocationFactory.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):g=e.position,{blockMode:h,requestMultiline:!0,...l.invokeFunction(QNi,h,e.textDocument,g,m.blockPosition,r,!0,n.prompt,c)}}if(s){let g={blockMode:TD.BlockMode.Parsing,requestMultiline:!0,finishedCb:UNi(f),stop:[` -`],maxTokens:SNi*f};return h===wD.BlockMode.MoreMultiline&&(g.blockMode=wD.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(INi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(ssc,"getGhostTextStrategy");function INi(t,e,r,n,o,s,c,l,u){let d=t.get(wNi.ICompletionsFeaturesService),f=t.get(xNi.IInstantiationService);if(c&&e===wD.BlockMode.MoreMultiline&&X5e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===X5e.BlockPositionType.EmptyBlock||o===X5e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(rsc.ICompletionsCacheService);return{finishedCb:f.createInstance(osc.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,tsc.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,myt.parsingBlockFinished)(r,n):h=>{}}}a(INi,"buildFinishedCallback");async function asc(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,bNi.telemetry)(t,"ghostText.longFileMultilineSkip",bNi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===wD.BlockMode.MoreMultiline&&X5e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,X5e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&csc(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,vNi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,myt.isEmptyBlockStartUtil)(r,n):o&&(0,vNi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,myt.isEmptyBlockStartUtil)(r,n)||await(0,myt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,isc.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(asc,"shouldRequestMultiline");function csc(t,e){return e.lineAt(t).text.trim().length===0}a(csc,"isNewLine")});var ONi=I(AR=>{"use strict";p();var lsc=AR&&AR.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},RD=AR&&AR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(AR,"__esModule",{value:!0});AR.ForceMultiLine=AR.GhostTextComputer=void 0;AR.getGhostText=ksc;var PNi=pp(),usc=o0(),dsc=Ewr(),fsc=um(),DNi=Qs(),psc=_wr(),hsc=Lme(),msc=TOe(),gsc=Ovr(),t4e=vE(),uRr=VA(),Asc=xl(),ysc=Sge(),Esc=obr(),_sc=iyt(),Csc=jgt(),vsc=qG(),bsc=ngt(),oRr=mge(),aRr=Rwr(),sRr=qDi(),Nge=Tg(),gyt=Hme(),kNi=LOe(),Ssc=kbr(),Tsc=Zme(),Isc=UOe(),cRr=gNi(),NNi=Zbr(),xsc=RNi(),l$=xG(),sh=tge(),wsc={isCycling:!1,promptOnly:!1,isSpeculative:!1};function Rsc(t,e,r){let n=t.get(uRr.ICompletionsFeaturesService),o=(0,t4e.getConfig)(t,t4e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,Nge.now)()-r.issuedTime;return Math.max(0,o-s)}a(Rsc,"getRemainingDebounceMs");function e4e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(e4e,"isCompletionRequestCancelled");var Ayt=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,fsc.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(Osc,e.textDocument,l,n);await hsc.initializeTokenizers.catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,ysc.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,sh.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let b=(0,Nge.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),e4e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};let g=Dsc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Esc.getEngineRequestInfo,n),y={...wsc,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(oRr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(oRr.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,sh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(Rsc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,kNi.delay)(_),e4e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,sh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,oRr.trimLastLine)(e.textDocument.getText(gyt.LocationFactory.range(gyt.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(xsc.getGhostTextStrategy,e,v,E,g,b,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(Psc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(aRr.extractRepoInfoInBackground,e.textDocument.uri),k={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,bsc.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};k.headers={...k.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(Lsc,e.textDocument,k,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let W=!w.requestMultiline;R=[[(0,cRr.makeGhostAPIChoice)(U[0],{forceSingleLine:W})],l$.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(e4e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,sh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===t4e.BlockMode.MoreMultiline&&Tsc.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(U=>this.instantiationService.invokeFunction(sRr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===l$.ResultType.Cache||R[1]===l$.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,sh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,sh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(cRr.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let W=await U.getAllCompletionsFromNetwork(k,D,o,w.finishedCb,l);if(W.type==="success"){d.trace(`Cycling network request returned ${W.value[0].length} choices`);let V=R?.[0]??[];W.value[0].forEach(G=>{V.findIndex(Y=>Y.completionText.trim()===G.completionText.trim())===-1&&V.push(G)}),d.trace(`After deduplication: ${V.length} unique choices`),R=[V,l$.ResultType.Cycling]}else if(R===void 0)return W}else{d.trace("Initiating network request for completions");let W=a((re,j)=>(this.asyncCompletionManager.updateCompletion(r,re),w.finishedCb(re,j)),"finishedCb"),V=new msc.CancellationTokenSource,G=U.getCompletionsFromNetwork(k,D,V.token,W,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,V,G);let Y=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(Y===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[Y[0]],l$.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,sh.mkBasicResultTelemetry)(D)};let[L,B]=R;d.trace(`Final choices: ${L.length} from ${(0,sh.resultTypeToString)(B)}`);let Q=L.map(U=>this.instantiationService.invokeFunction(sRr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${Q.length} choices`);let M=this.instantiationService.invokeFunction(t4e.getConfig,t4e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,Nge.now)()-n.issuedTime,q=Math.max(M-O,0);if(B!==l$.ResultType.TypingAsSuggested&&!y.isCycling&&q>0&&(d.debug(`Waiting ${q}ms before returning completion`),await(0,kNi.delay)(q),e4e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,sh.mkCanceledResultTelemetry)(D)};let F=[];for(let U of Q){let W=Bsc(e.textDocument,k,U,D),V=g?(0,sRr.checkSuffix)(e.textDocument,e.position,U):0,Y={completion:Nsc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:W,isMiddleOfTheLine:g,suffixCoverage:V,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};F.push(Y)}return D.properties.clientCompletionId=F[0]?.clientCompletionId,D.measurements.foundOffset=F?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${F.length} results from ${(0,sh.resultTypeToString)(B)} at ${D.measurements.foundOffset} offset`),e4e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,sh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,Q,B)),l.setHeaderRequestId(Q[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${F.length} results`),{type:"success",value:[F,B],telemetryData:(0,sh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:B,performanceMetrics:h})})}};AR.GhostTextComputer=Ayt;AR.GhostTextComputer=Ayt=lsc([RD(0,DNi.IInstantiationService),RD(1,usc.ITelemetryService),RD(2,gsc.ICompletionsNotifierService),RD(3,Csc.ICompletionsContextProviderBridgeService),RD(4,NNi.ICompletionsCurrentGhostText),RD(5,vsc.ICompletionsContextProviderService),RD(6,Ssc.ICompletionsAsyncManagerService),RD(7,uRr.ICompletionsFeaturesService),RD(8,Asc.ICompletionsLogTargetService),RD(9,_sc.ICompletionsStatusReporter),RD(10,PNi.ILogService)],Ayt);async function ksc(t,e,r,n,o,s,c){return t.get(DNi.IInstantiationService).createInstance(Ayt).getGhostText(e,r,n,o,s,c)}a(ksc,"getGhostText");function Psc(t,e,r,n){let s=t.get(NNi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=Msc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),l$.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,l$.ResultType.Cache]}a(Psc,"getLocalInlineSuggestion");function Dsc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,psc.isInlineSuggestionFromTextAfterCursor)(n)}a(Dsc,"isInlineSuggestion");var lRr=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};AR.ForceMultiLine=lRr;function Nsc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(Nsc,"adjustLeadingWhitespace");function Msc(t,e,r,n){let o=t.get(PNi.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Isc.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,cRr.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(Msc,"getCompletionsFromCache");async function Osc(t,e,r,n){let o=t.get(uRr.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=Nge.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(Osc,"createTelemetryWithExp");function Bsc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` -`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,MNi(l,t),l.extendWithRequestId(o),l}a(Bsc,"telemetryWithAddData");function Lsc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);MNi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===aRr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==aRr.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(gyt.LocationFactory.range(h.range.start,n)),g=e.getText(gyt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,dsc.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,Nge.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return(0,Nge.telemetry)(t,"ghostText.issued",_),d}a(Lsc,"telemetryIssued");function MNi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(MNi,"addDocumentTelemetry")});var UNi=I(h6=>{"use strict";p();var Fsc=h6&&h6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dRr=h6&&h6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(h6,"__esModule",{value:!0});h6.GhostText=void 0;var BNi=ti(),Usc=Qs(),Qsc=t1r(),qsc=DDi(),LNi=ONi(),jsc=hwr(),Hsc=xG(),Gsc=Jmt(),FNi=tge(),$sc=xl(),fRr=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){Vsc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,Qsc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(FNi.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(LNi.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(jsc.setLastShown,e.textDocument,e.position,f),m=(0,qsc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==Hsc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(LNi.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:E}=A.range,_=BNi.Range.create(y,BNi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};h6.GhostText=fRr;h6.GhostText=fRr=Fsc([dRr(0,Usc.IInstantiationService),dRr(1,$sc.ICompletionsLogTargetService),dRr(2,Gsc.ICompletionsSpeculativeRequestCache)],fRr);function Vsc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});FNi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Vsc,"logCompletionLocation")});var QNi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.LocalFileSystem=void 0;var yyt=require("fs"),Wsc=require("path"),Eyt=bG(),pRr=TG(),hRr=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await yyt.promises.readFile((0,pRr.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,pRr.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,pRr.fsPath)(e),n=await yyt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,Wsc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await yyt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await yyt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=Eyt.FileType.Unknown;return e.isFile()&&(o=Eyt.FileType.File),e.isDirectory()&&(o=Eyt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=Eyt.FileType.SymbolicLink),o}};_yt.LocalFileSystem=hRr});var GNi=I(m6=>{"use strict";p();var zsc=m6&&m6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},r4e=m6&&m6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m6,"__esModule",{value:!0});m6.CompositeRelatedFilesProvider=void 0;var Ysc=Bte(),Ksc=Qs(),Mge=vE(),Jsc=VA(),Zsc=bG(),Xsc=xl(),n4e=pge(),wre=Zgt(),qNi=["cpp","c","cuda-cpp"],jNi=["typescript","javascript","typescriptreact","javascriptreact"],HNi=["csharp"],eac=new Map([...qNi.map(t=>[t,n4e.NeighboringFileType.RelatedCpp]),...jNi.map(t=>[t,n4e.NeighboringFileType.RelatedTypeScript]),...HNi.map(t=>[t,n4e.NeighboringFileType.RelatedCSharpRoslyn])]);function tac(t){return eac.get(t)??n4e.NeighboringFileType.RelatedOther}a(tac,"getNeighboringFileType");var mRr=class extends wre.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(tac(s)===n4e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),wre.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),wre.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return wre.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),wre.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return wre.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)wre.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return HNi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCodeCSharp):jNi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCodeTypeScript):qNi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(Mge.getConfig,Mge.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};m6.CompositeRelatedFilesProvider=mRr;m6.CompositeRelatedFilesProvider=mRr=zsc([r4e(0,Ksc.IInstantiationService),r4e(1,Ysc.IIgnoreService),r4e(2,Jsc.ICompletionsFeaturesService),r4e(3,Xsc.ICompletionsLogTargetService),r4e(4,Zsc.ICompletionsFileSystemService)],mRr)});var Cyt=I(Rre=>{"use strict";p();Object.defineProperty(Rre,"__esModule",{value:!0});Rre.PositionOffsetTransformer=Rre.PositionOffsetTransformerBase=void 0;Rre.ensureDependenciesAreSet=iac;var $Ni=gE(),VNi=MMe(),rac=Vct(),nac=Zpe(),WNi=Vct();Object.defineProperty(Rre,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return WNi.PositionOffsetTransformerBase},"get")});Object.defineProperty(Rre,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return WNi.PositionOffsetTransformer},"get")});(0,rac._setPositionOffsetTransformerDependencies)({StringEdit:$Ni.StringEdit,StringReplacement:$Ni.StringReplacement,TextReplacement:VNi.TextReplacement,TextEdit:VNi.TextEdit,TextLength:nac.TextLength});function iac(){}a(iac,"ensureDependenciesAreSet")});var byt=I(vyt=>{"use strict";p();Object.defineProperty(vyt,"__esModule",{value:!0});vyt.RootedLineEdit=void 0;var zNi=eG(),oac=Cyt(),sac=kD();(0,oac.ensureDependenciesAreSet)();var gRr=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=zNi.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new sac.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new zNi.LineEdit(r))}};vyt.RootedLineEdit=gRr});var kD=I(u$=>{"use strict";p();Object.defineProperty(u$,"__esModule",{value:!0});u$.Edits=u$.SingleEdits=u$.RootedEdit=void 0;var YNi=Yu(),aac=eG(),Oge=gE(),KNi=yRr(),cac=byt(),i4e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return aac.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,YNi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,YNi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return cac.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};u$.RootedEdit=i4e;var ARr=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return Oge.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new Syt(Oge.StringEdit,this.edits.map(e=>e.toEdit()))}};u$.SingleEdits=ARr;var Syt=class t{static{a(this,"Edits")}static single(e){return new t(Oge.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=Oge.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(Oge.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,KNi.serializeStringEdit)(e))}static deserialize(e){return new t(Oge.StringEdit,e.map(r=>(0,KNi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=i4e.toLineEdit(new i4e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` +`],maxTokens:FNi*f};return h===TD.BlockMode.MoreMultiline&&(g.blockMode=TD.BlockMode.MoreMultiline),g}return{blockMode:h,requestMultiline:!1,...l.invokeFunction(QNi,h,e.textDocument,e.position,m.blockPosition,r,!1,n.prompt,c)}}}}a(kic,"getGhostTextStrategy");function QNi(t,e,r,n,o,s,c,l,u){let d=t.get(jNi.ICompletionsFeaturesService),f=t.get(qNi.IInstantiationService);if(c&&e===TD.BlockMode.MoreMultiline&&q5e.BlockTrimmer.isSupported(r.detectedLanguageId)){let h=o===q5e.BlockPositionType.EmptyBlock||o===q5e.BlockPositionType.BlockEnd?d.longLookaheadSize(u):d.shortLookaheadSize(u),m=t.get(xic.ICompletionsCacheService);return{finishedCb:f.createInstance(Pic.StreamedCompletionSplitter,s,r.detectedLanguageId,!1,h,(A,y)=>{let E={prefix:s+A,prompt:{...l,prefix:l.prefix+A}};(0,Iic.appendToCache)(m,E,y)}).getFinishedCallback(),maxTokens:d.maxMultilineTokens(u)}}return{finishedCb:c?(0,lyt.parsingBlockFinished)(r,n):h=>{}}}a(QNi,"buildFinishedCallback");async function Dic(t,e,r,n,o,s,c){if(r.lineCount>=8e3)(0,LNi.telemetry)(t,"ghostText.longFileMultilineSkip",LNi.TelemetryData.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e===TD.BlockMode.MoreMultiline&&q5e.BlockTrimmer.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await(0,q5e.getBlockPositionType)(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&Nic(n,r))return{requestMultiline:!0};let u=!1;return!o&&(0,BNi.isSupportedLanguageId)(r.detectedLanguageId)?u=await(0,lyt.isEmptyBlockStartUtil)(r,n):o&&(0,BNi.isSupportedLanguageId)(r.detectedLanguageId)&&(u=await(0,lyt.isEmptyBlockStartUtil)(r,n)||await(0,lyt.isEmptyBlockStartUtil)(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=(0,Ric.requestMultilineScore)(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(Dic,"shouldRequestMultiline");function Nic(t,e){return e.lineAt(t).text.trim().length===0}a(Nic,"isNewLine")});var YNi=I(mR=>{"use strict";p();var Mic=mR&&mR.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},ID=mR&&mR.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(mR,"__esModule",{value:!0});mR.ForceMultiLine=mR.GhostTextComputer=void 0;mR.getGhostText=toc;var $Ni=Ap(),Oic=Bh(),Bic=gwr(),Lic=fm(),VNi=Ms(),Fic=Awr(),Uic=Rme(),Qic=mOe(),qic=jCr(),H5e=_E(),aRr=JA(),jic=Tl(),Hic=gge(),Gic=rbr(),$ic=ZAt(),Vic=Bgt(),Wic=kG(),zic=Jmt(),rRr=age(),iRr=Iwr(),nRr=tNi(),Tge=Ig(),uyt=Ome(),GNi=TOe(),Yic=xbr(),Kic=Gme(),Jic=xOe(),oRr=PNi(),WNi=Ybr(),Zic=HNi(),XG=AG(),lh=Wme(),Xic={isCycling:!1,promptOnly:!1,isSpeculative:!1};function eoc(t,e,r){let n=t.get(aRr.ICompletionsFeaturesService),o=(0,H5e.getConfig)(t,H5e.ConfigKey.CompletionsDebounce)??n.completionsDebounce(r)??e.debounceMs;if(o===void 0)return 0;let s=(0,Tge.now)()-r.issuedTime;return Math.max(0,o-s)}a(eoc,"getRemainingDebounceMs");function j5e(t,e,r){return r?.isCancellationRequested||e!==t.currentRequestId}a(j5e,"isCompletionRequestCancelled");var dyt=class{static{a(this,"GhostTextComputer")}constructor(e,r,n,o,s,c,l,u,d,f,h){this.instantiationService=e,this.telemetryService=r,this.notifierService=n,this.contextProviderBridge=o,this.currentGhostText=s,this.contextproviderStatistics=c,this.asyncCompletionManager=l,this.completionsFeaturesService=u,this.logTarget=d,this.statusReporter=f,this.logService=h}async getGhostText(e,r,n,o,s,c){let l=(0,Lic.generateUuid)();s.setHeaderRequestId(l);let u=c.createSubLogger(["GhostTextComputer#getGhostText"]);this.currentGhostText.currentRequestId=l;let d=await this.instantiationService.invokeFunction(soc,e.textDocument,l,n);await Uic.initializeTokenizers.catch(()=>{});try{this.contextProviderBridge.schedule(e,l,n?.opportunityId??"",d,r,n),this.notifierService.notifyRequest(e,l,d,r,n);let f=await this.getGhostTextWithoutAbortHandling(e,l,d,r,n,o,s,u),h=this.contextproviderStatistics.getStatisticsForCompletion(l),m=n?.opportunityId??"unknown";for(let[g,A]of h.getAllUsageStatistics())this.telemetryService.sendMSFTTelemetryEvent("context-provider.completion-stats",{requestId:l,opportunityId:m,providerId:g,resolution:A.resolution,usage:A.usage,usageDetails:JSON.stringify(A.usageDetails)},{});return f}catch(f){if((0,Hic.isAbortError)(f))return{type:"canceled",reason:"aborted at unknown location",telemetryData:(0,lh.mkCanceledResultTelemetry)(d,{cancelledNetworkRequest:!0})};throw f}}async getGhostTextWithoutAbortHandling(e,r,n,o,s,c,l,u){let d=u.createSubLogger(["GhostTextComputer#getGhostTextWithoutAbortHandling"]),f=n.issuedTime,h=[];function m(v){let b=(0,Tge.now)();h.push([v,b-f]),f=b}if(a(m,"recordPerformance"),m("telemetry"),j5e(this.currentGhostText,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};let g=noc(e.textDocument,e.position);if(g===void 0)return d.debug("Completions do not trigger in the middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};let A=this.instantiationService.invokeFunction(Gic.getEngineRequestInfo,n),y={...Xic,...s,tokenizer:A.tokenizer},E=await this.instantiationService.invokeFunction(rRr.extractPrompt,r,e,n,void 0,y);if(m("prompt"),c.setPrompt(rRr.PromptResponse.toString(E)),E.type==="copilotContentExclusion")return d.debug("Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};if(E.type==="contextTooShort")return d.debug("Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};if(E.type==="promptError")return d.debug("Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};if(y.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:E};if(E.type==="promptCancelled")return d.debug("Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};if(E.type==="promptTimeout")return d.debug("Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};if(E.prompt.prefix.length===0&&E.prompt.suffix.length===0)return d.debug("Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:(0,lh.mkBasicResultTelemetry)(n)};let _=this.instantiationService.invokeFunction(eoc,y,n);return _>0&&(d.debug(`Debouncing ghost text request for ${_}ms`),await(0,GNi.delay)(_),j5e(this.currentGhostText,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:(0,lh.mkBasicResultTelemetry)(n)}:this.statusReporter.withProgress(async()=>{let[v]=(0,rRr.trimLastLine)(e.textDocument.getText(uyt.LocationFactory.range(uyt.LocationFactory.position(0,0),e.position)));d.trace(`Starting ghost text computation, prefix length: ${v.length}`);let b=this.currentGhostText.hasAcceptedCurrentCompletion(v,E.prompt.suffix);d.trace(`hasAcceptedCurrentCompletion: ${b}`);let T=E.prompt,w=await this.instantiationService.invokeFunction(Zic.getGhostTextStrategy,e,v,E,g,b,n);m("strategy"),d.trace(`Ghost text strategy: blockMode=${w.blockMode}, requestMultiline=${w.requestMultiline}, stop=${w.stop}, maxTokens=${w.maxTokens}`);let R=this.instantiationService.invokeFunction(roc,v,T,w.requestMultiline);d.trace(`Local cache lookup: ${R?`found ${R[0].length} choices`:"no cached choices"}`),m("cache");let x=this.instantiationService.invokeFunction(iRr.extractRepoInfoInBackground,e.textDocument.uri),P={blockMode:w.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:x,engineModelId:A.modelId,ourRequestId:r,prefix:v,prompt:E.prompt,multiline:w.requestMultiline,indentation:(0,zic.contextIndentation)(e.textDocument,e.position),isCycling:y.isCycling,headers:A.headers,stop:w.stop,maxTokens:w.maxTokens,afterAccept:b};P.headers={...P.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":y.isSpeculative?"true":"false"};let D=this.instantiationService.invokeFunction(coc,e.textDocument,P,e.position,E,n,A,y);if(R===void 0&&!y.isCycling&&this.asyncCompletionManager.shouldWaitForAsyncCompletions(v,E.prompt)){d.trace("No cached choices, waiting for async completions from in-flight request");let U=await this.asyncCompletionManager.getFirstMatchingRequestWithTimeout(r,v,E.prompt,y.isSpeculative,D);if(m("asyncWait"),U){d.trace("Received choice from async completion");let z=!w.requestMultiline;R=[[(0,oRr.makeGhostAPIChoice)(U[0],{forceSingleLine:z})],XG.ResultType.Async]}else d.trace("No matching async completion found within timeout");if(j5e(this.currentGhostText,r,o))return d.debug("Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:(0,lh.mkBasicResultTelemetry)(D)}}else d.trace("Skipping wait for async completions");let N=w.blockMode===H5e.BlockMode.MoreMultiline&&Kic.BlockTrimmer.isSupported(e.textDocument.detectedLanguageId);if(R!==void 0&&(d.trace(`Post-processing ${R[0].length} cached choices, isMoreMultiline=${N}`),R[0]=R[0].map(U=>this.instantiationService.invokeFunction(nRr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0)),R&&(R[1]===XG.ResultType.Cache||R[1]===XG.ResultType.TypingAsSuggested)&&(l.setIsFromCache(),c.markAsFromCache()),R!==void 0&&R[0].length===0)return d.trace(`Found empty inline suggestions locally via ${(0,lh.resultTypeToString)(R[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:(0,lh.mkBasicResultTelemetry)(D)};if(R!==void 0&&R[0].length>0&&(!y.isCycling||R[0].length>1))d.trace(`Found inline suggestions locally via ${(0,lh.resultTypeToString)(R[1])}`);else{d.trace(`Going to network, isCycling=${y.isCycling}`);let U=this.instantiationService.createInstance(oRr.CompletionsFromNetwork);if(y.isCycling){d.trace("Fetching all completions for cycling request");let z=await U.getAllCompletionsFromNetwork(P,D,o,w.finishedCb,l);if(z.type==="success"){d.trace(`Cycling network request returned ${z.value[0].length} choices`);let W=R?.[0]??[];z.value[0].forEach($=>{W.findIndex(J=>J.completionText.trim()===$.completionText.trim())===-1&&W.push($)}),d.trace(`After deduplication: ${W.length} unique choices`),R=[W,XG.ResultType.Cycling]}else if(R===void 0)return z}else{d.trace("Initiating network request for completions");let z=a((ne,H)=>(this.asyncCompletionManager.updateCompletion(r,ne),w.finishedCb(ne,H)),"finishedCb"),W=new Qic.CancellationTokenSource,$=U.getCompletionsFromNetwork(P,D,W.token,z,l);this.asyncCompletionManager.queueCompletionRequest(r,v,E.prompt,W,$);let J=await this.asyncCompletionManager.getFirstMatchingRequest(r,v,E.prompt,y.isSpeculative);if(J===void 0)return d.trace("Network request returned no results"),{type:"empty",reason:"received no results from async completions",telemetryData:(0,lh.mkBasicResultTelemetry)(D)};d.trace("Received completion from network request"),R=[[J[0]],XG.ResultType.Async]}m("network")}if(R===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:(0,lh.mkBasicResultTelemetry)(D)};let[B,L]=R;d.trace(`Final choices: ${B.length} from ${(0,lh.resultTypeToString)(L)}`);let j=B.map(U=>this.instantiationService.invokeFunction(nRr.postProcessChoiceInContext,e.textDocument,e.position,U,N,d)).filter(U=>U!==void 0);d.trace(`Post-processed to ${j.length} choices`);let M=this.instantiationService.invokeFunction(H5e.getConfig,H5e.ConfigKey.CompletionsDelay)??this.completionsFeaturesService.completionsDelay(n),O=(0,Tge.now)()-n.issuedTime,q=Math.max(M-O,0);if(L!==XG.ResultType.TypingAsSuggested&&!y.isCycling&&q>0&&(d.debug(`Waiting ${q}ms before returning completion`),await(0,GNi.delay)(q),j5e(this.currentGhostText,r,o)))return d.debug("Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:(0,lh.mkCanceledResultTelemetry)(D)};let Q=[];for(let U of j){let z=aoc(e.textDocument,P,U,D),W=g?(0,nRr.checkSuffix)(e.textDocument,e.position,U):0,J={completion:ioc(U.choiceIndex,U.completionText,E.trailingWs),telemetry:z,isMiddleOfTheLine:g,suffixCoverage:W,copilotAnnotations:U.copilotAnnotations,clientCompletionId:U.clientCompletionId};Q.push(J)}return D.properties.clientCompletionId=Q[0]?.clientCompletionId,D.measurements.foundOffset=Q?.[0]?.telemetry?.measurements?.foundOffset??-1,d.debug(`Produced ${Q.length} results from ${(0,lh.resultTypeToString)(L)} at ${D.measurements.foundOffset} offset`),j5e(this.currentGhostText,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:(0,lh.mkCanceledResultTelemetry)(D)}:(y.isSpeculative||(d.trace("Updating current ghost text as request is not speculative"),this.currentGhostText.setGhostText(v,E.prompt.suffix,j,L)),l.setHeaderRequestId(j[0]?.requestId.headerRequestId??r),m("complete"),d.trace(`Ghost text computation complete, returning ${Q.length} results`),{type:"success",value:[Q,L],telemetryData:(0,lh.mkBasicResultTelemetry)(D),telemetryBlob:D,resultType:L,performanceMetrics:h})})}};mR.GhostTextComputer=dyt;mR.GhostTextComputer=dyt=Mic([ID(0,VNi.IInstantiationService),ID(1,Oic.ITelemetryService),ID(2,qic.ICompletionsNotifierService),ID(3,Vic.ICompletionsContextProviderBridgeService),ID(4,WNi.ICompletionsCurrentGhostText),ID(5,Wic.ICompletionsContextProviderService),ID(6,Yic.ICompletionsAsyncManagerService),ID(7,aRr.ICompletionsFeaturesService),ID(8,jic.ICompletionsLogTargetService),ID(9,$ic.ICompletionsStatusReporter),ID(10,$Ni.ILogService)],dyt);async function toc(t,e,r,n,o,s,c){return t.get(VNi.IInstantiationService).createInstance(dyt).getGhostText(e,r,n,o,s,c)}a(toc,"getGhostText");function roc(t,e,r,n){let s=t.get(WNi.ICompletionsCurrentGhostText).getCompletionsForUserTyping(e,r.suffix),c=ooc(t,e,r.suffix,n);if(s&&s.length>0){let l=(c??[]).filter(u=>!s.some(d=>d.completionText===u.completionText));return[s.concat(l),XG.ResultType.TypingAsSuggested]}if(c&&c.length>0)return[c,XG.ResultType.Cache]}a(roc,"getLocalInlineSuggestion");function noc(t,e){let n=t.lineAt(e).text.substring(e.character);return(0,Fic.isInlineSuggestionFromTextAfterCursor)(n)}a(noc,"isInlineSuggestion");var sRr=class t{static{a(this,"ForceMultiLine")}static{this.default=new t}constructor(e=!1){this.requestMultilineOverride=e}};mR.ForceMultiLine=sRr;function ioc(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(ioc,"adjustLeadingWhitespace");function ooc(t,e,r,n){let o=t.get($Ni.ILogService).createSubLogger(["getCompletionsFromCache"]),s=t.get(Jic.ICompletionsCacheService).findAll(e,r);return s.length===0?(o.debug("Found no completions in cache"),[]):(o.debug(`Found ${s.length} completions in cache`),s.map(c=>(0,oRr.makeGhostAPIChoice)(c,{forceSingleLine:!n})))}a(ooc,"getCompletionsFromCache");async function soc(t,e,r,n){let o=t.get(aRr.ICompletionsFeaturesService),s={headerRequestId:r};n?.opportunityId&&(s.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(s.completionsActive="true"),n?.isSpeculative&&(s.reason="speculative");let c=Tge.TelemetryData.createAndMarkAsIssued(s);return await o.updateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},c)}a(soc,"createTelemetryWithExp");function aoc(t,e,r,n){let o=r.requestId,s={choiceIndex:r.choiceIndex.toString(),clientCompletionId:r.clientCompletionId};r.generatedChoiceIndex!==void 0&&(s.originalChoiceIndex=s.choiceIndex,s.choiceIndex=(1e4*(r.generatedChoiceIndex+1)+r.choiceIndex).toString());let c={compCharLen:r.completionText.length,numLines:r.completionText.trim().split(` +`).length};r.meanLogProb&&(c.meanLogProb=r.meanLogProb),r.meanAlternativeLogProb&&(c.meanAlternativeLogProb=r.meanAlternativeLogProb);let l=r.telemetryData.extendedBy(s,c);return l.issuedTime=n.issuedTime,l.measurements.timeToProduceMs=performance.now()-n.issuedTime,zNi(l,t),l.extendWithRequestId(o),l}a(aoc,"telemetryWithAddData");function coc(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);zNi(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===iRr.ComputationStatus.PENDING?"pending":"available",f!==void 0&&f!==iRr.ComputationStatus.PENDING&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,f.repoId?.type==="github"?(d.properties.gitRepoOwner=f.repoId.org,d.properties.gitRepoName=f.repoId.repo):f.repoId?.type==="ado"&&(d.properties.gitRepoOwner=f.repoId.project,d.properties.gitRepoName=f.repoId.repo),d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(uyt.LocationFactory.range(h.range.start,n)),g=e.getText(uyt.LocationFactory.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,Bic.createSha256Hash)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...(0,Tge.telemetrizePromptLength)(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return(0,Tge.telemetry)(t,"ghostText.issued",_),d}a(coc,"telemetryIssued");function zNi(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(zNi,"addDocumentTelemetry")});var XNi=I(s6=>{"use strict";p();var loc=s6&&s6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},cRr=s6&&s6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(s6,"__esModule",{value:!0});s6.GhostText=void 0;var KNi=ei(),uoc=Ms(),doc=Zbr(),foc=VDi(),JNi=YNi(),poc=dwr(),hoc=AG(),moc=$mt(),ZNi=Wme(),goc=Tl(),lRr=class{static{a(this,"GhostText")}constructor(e,r,n){this.instantiationService=e,this.logTargetService=r,this.speculativeRequestCache=n}async getInlineCompletions(e,r,n,o={},s,c,l){Aoc(this.logTargetService,e,r);let u=await this.getInlineCompletionsResult((0,doc.createCompletionState)(e,r),n,o,s,c,l);return this.instantiationService.invokeFunction(ZNi.handleGhostTextResultTelemetry,u)}async getInlineCompletionsResult(e,r,n={},o,s,c){let l=0;n.selectedCompletionInfo?.text&&!n.selectedCompletionInfo.text.includes(")")&&(e=e.addSelectedCompletionInfo(n.selectedCompletionInfo),l=e.position.character-n.selectedCompletionInfo.range.end.character);let u=await this.instantiationService.invokeFunction(JNi.getGhostText,e,r,n,o,s,c);if(u.type!=="success")return u;let[d,f]=u.value;if(r.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:u.telemetryBlob}};let h=this.instantiationService.invokeFunction(poc.setLastShown,e.textDocument,e.position,f),m=(0,foc.completionsFromGhostTextResults)(d,f,e.textDocument,e.position,n.formattingOptions,h);if(m.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:u.telemetryData};if(f!==hoc.ResultType.TypingAsSuggested){e=e.applyEdits([{newText:m[0].insertText,range:m[0].range}]);let A={isSpeculative:!0,opportunityId:n.opportunityId},y=a(()=>this.instantiationService.invokeFunction(JNi.getGhostText,e,void 0,A,o,s,c),"fn");this.speculativeRequestCache.set(m[0].clientCompletionId,y)}let g=m.map(A=>{let{start:y,end:E}=A.range,_=KNi.Range.create(y,KNi.Position.create(E.line,E.character-l));return{...A,range:_}});return{...u,value:g}}};s6.GhostText=lRr;s6.GhostText=lRr=loc([cRr(0,uoc.IInstantiationService),cRr(1,goc.ICompletionsLogTargetService),cRr(2,moc.ICompletionsSpeculativeRequestCache)],lRr);function Aoc(t,e,r){let n=e.getText({start:{line:Math.max(r.line-1,0),character:0},end:r}),o=e.getText({start:r,end:{line:Math.min(r.line+2,e.lineCount-1),character:e.lineCount-1>r.line?0:r.character}});ZNi.logger.debug(t,`Requesting for ${e.uri} at ${r.line}:${r.character}`,`between ${JSON.stringify(n)} and ${JSON.stringify(o)}.`)}a(Aoc,"logCompletionLocation")});var eMi=I(hyt=>{"use strict";p();Object.defineProperty(hyt,"__esModule",{value:!0});hyt.LocalFileSystem=void 0;var fyt=require("fs"),yoc=require("path"),pyt=pG(),uRr=mG(),dRr=class{static{a(this,"LocalFileSystem")}async readFileString(e){return(await fyt.promises.readFile((0,uRr.fsPath)(e))).toString()}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink((0,uRr.fsPath)(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=(0,uRr.fsPath)(e),n=await fyt.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,yoc.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await fyt.promises.lstat(e);if(r.isSymbolicLink())try{let n=await fyt.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=pyt.FileType.Unknown;return e.isFile()&&(o=pyt.FileType.File),e.isDirectory()&&(o=pyt.FileType.Directory),r.isSymbolicLink()&&n&&(o|=pyt.FileType.SymbolicLink),o}};hyt.LocalFileSystem=dRr});var iMi=I(a6=>{"use strict";p();var Eoc=a6&&a6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},G5e=a6&&a6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(a6,"__esModule",{value:!0});a6.CompositeRelatedFilesProvider=void 0;var _oc=kte(),voc=Ms(),Ige=_E(),Coc=JA(),boc=pG(),Soc=Tl(),$5e=oge(),bre=Vgt(),tMi=["cpp","c","cuda-cpp"],rMi=["typescript","javascript","typescriptreact","javascriptreact"],nMi=["csharp"],Toc=new Map([...tMi.map(t=>[t,$5e.NeighboringFileType.RelatedCpp]),...rMi.map(t=>[t,$5e.NeighboringFileType.RelatedTypeScript]),...nMi.map(t=>[t,$5e.NeighboringFileType.RelatedCSharpRoslyn])]);function Ioc(t){return Toc.get(t)??$5e.NeighboringFileType.RelatedOther}a(Ioc,"getNeighboringFileType");var fRr=class extends bre.RelatedFilesProvider{static{a(this,"CompositeRelatedFilesProvider")}constructor(e,r,n,o,s){super(e,r,o,s),this.featuresService=n,this.providers=new Map,this.telemetrySent=!1,this.reportedUnknownProviders=new Set}async getRelatedFilesResponse(e,r,n){let o=Date.now(),s=e.clientLanguageId.toLowerCase();if(Ioc(s)===$5e.NeighboringFileType.RelatedOther&&!this.reportedUnknownProviders.has(s)&&(this.reportedUnknownProviders.add(s),bre.relatedFilesLogger.warn(this.logTarget,`unknown language ${s}`)),this.relatedFilesTelemetry(r),bre.relatedFilesLogger.debug(this.logTarget,`Fetching related files for ${e.uri}`),!this.isActive(s,r))return bre.relatedFilesLogger.debug(this.logTarget,"language-server related-files experiment is not active."),bre.EmptyRelatedFilesResponse;let l=this.providers.get(s);if(!l)return bre.EmptyRelatedFilesResponse;try{return this.convert(e.uri,l,o,r,n)}catch{this.relatedFileNonresponseTelemetry(s,r);return}}async convert(e,r,n,o,s){s||(s={isCancellationRequested:!1,onCancellationRequested:a(()=>({dispose(){}}),"onCancellationRequested")});let c={entries:[],traits:[]},l=r.size>0;for(let u of r.values()){let d=await u.callback(e,{flags:{}},s);if(d){l=!1,c.entries.push(...d.entries),d.traits&&c.traits.push(...d.traits);for(let f of d.entries)for(let h of f.uris)bre.relatedFilesLogger.debug(this.logTarget,h.toString())}}return this.performanceTelemetry(Date.now()-n,o),l?void 0:c}registerRelatedFilesProvider(e,r,n){let o=this.providers.get(r);o?o.set(e,{extensionId:e,languageId:r,callback:n}):this.providers.set(r,new Map([[e,{extensionId:e,languageId:r,callback:n}]]))}unregisterRelatedFilesProvider(e,r,n){let o=this.providers.get(r);if(o){let s=o.get(e);s&&s.callback===n&&o.delete(e)}}isActive(e,r){return nMi.includes(e)?this.featuresService.relatedFilesVSCodeCSharp(r)||this.instantiationService.invokeFunction(Ige.getConfig,Ige.ConfigKey.RelatedFilesVSCodeCSharp):rMi.includes(e)?this.featuresService.relatedFilesVSCodeTypeScript(r)||this.instantiationService.invokeFunction(Ige.getConfig,Ige.ConfigKey.RelatedFilesVSCodeTypeScript):tMi.includes(e)?this.featuresService.cppHeadersEnableSwitch(r):this.featuresService.relatedFilesVSCode(r)||this.instantiationService.invokeFunction(Ige.getConfig,Ige.ConfigKey.RelatedFilesVSCode)}relatedFilesTelemetry(e){}relatedFileNonresponseTelemetry(e,r){}performanceTelemetry(e,r){}};a6.CompositeRelatedFilesProvider=fRr;a6.CompositeRelatedFilesProvider=fRr=Eoc([G5e(0,voc.IInstantiationService),G5e(1,_oc.IIgnoreService),G5e(2,Coc.ICompletionsFeaturesService),G5e(3,Soc.ICompletionsLogTargetService),G5e(4,boc.ICompletionsFileSystemService)],fRr)});var myt=I(Sre=>{"use strict";p();Object.defineProperty(Sre,"__esModule",{value:!0});Sre.PositionOffsetTransformer=Sre.PositionOffsetTransformerBase=void 0;Sre.ensureDependenciesAreSet=Roc;var oMi=hE(),sMi=SMe(),xoc=Jct(),woc=Kpe(),aMi=Jct();Object.defineProperty(Sre,"PositionOffsetTransformerBase",{enumerable:!0,get:a(function(){return aMi.PositionOffsetTransformerBase},"get")});Object.defineProperty(Sre,"PositionOffsetTransformer",{enumerable:!0,get:a(function(){return aMi.PositionOffsetTransformer},"get")});(0,xoc._setPositionOffsetTransformerDependencies)({StringEdit:oMi.StringEdit,StringReplacement:oMi.StringReplacement,TextReplacement:sMi.TextReplacement,TextEdit:sMi.TextEdit,TextLength:woc.TextLength});function Roc(){}a(Roc,"ensureDependenciesAreSet")});var Ayt=I(gyt=>{"use strict";p();Object.defineProperty(gyt,"__esModule",{value:!0});gyt.RootedLineEdit=void 0;var cMi=VH(),Poc=myt(),koc=xD();(0,Poc.ensureDependenciesAreSet)();var pRr=class t{static{a(this,"RootedLineEdit")}static fromEdit(e){let r=cMi.LineEdit.fromStringEdit(e.edit,e.base);return new t(e.base,r)}constructor(e,r){this.base=e,this.edit=r}toString(){return this.edit.humanReadablePatch(this.base.getLines())}toEdit(){return this.edit.toEdit(this.base)}toRootedEdit(){return new koc.RootedEdit(this.base,this.toEdit())}getEditedState(){let e=this.base.getLines();return this.edit.apply(e)}removeCommonSuffixPrefixLines(){let e=a(n=>!n.lineRange.isEmpty||n.newLines.length>0,"isNotEmptyEdit"),r=this.edit.replacements.map(n=>n.removeCommonSuffixPrefixLines(this.base)).filter(n=>e(n));return new t(this.base,new cMi.LineEdit(r))}};gyt.RootedLineEdit=pRr});var xD=I(e$=>{"use strict";p();Object.defineProperty(e$,"__esModule",{value:!0});e$.Edits=e$.SingleEdits=e$.RootedEdit=void 0;var lMi=Gu(),Doc=VH(),xge=hE(),uMi=mRr(),Noc=Ayt(),V5e=class t{static{a(this,"RootedEdit")}static toLineEdit(e){return Doc.LineEdit.fromStringEdit(e.edit,e.base)}constructor(e,r){this.base=e,this.edit=r}getEditedState(){return this.edit.applyOnText(this.base)}rebase(e){return(0,lMi.assertFn)(()=>null.base.equals(e.applyOnText(this.base))),(0,lMi.assertFn)(()=>null.edit.applyOnText(null.base).equals(this.edit.applyOnText(e.applyOnText(this.base)))),null}toString(){return Noc.RootedLineEdit.fromEdit(this).toString()}normalize(){return new t(this.base,this.edit.normalizeOnSource(this.base.value))}equals(e){return this.base.equals(e.base)&&this.edit.equals(e.edit)}};e$.RootedEdit=V5e;var hRr=class{static{a(this,"SingleEdits")}constructor(e){this.edits=e}compose(){return xge.StringEdit.compose(this.edits.map(e=>e.toEdit()))}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}toEdits(){return new yyt(xge.StringEdit,this.edits.map(e=>e.toEdit()))}};e$.SingleEdits=hRr;var yyt=class t{static{a(this,"Edits")}static single(e){return new t(xge.StringEdit,[e])}constructor(e,r){this._editType=e,this.edits=r}compose(){let e=new this._editType([]);for(let r of this.edits)e=e.compose(r);return e}add(e){return new t(this._editType,[...this.edits,e])}apply(e){return this.compose().apply(e)}isEmpty(){return this.edits.length===0}swap(e){let r=e,n=[];for(let o of this.edits){let s=xge.BaseStringEdit.trySwap(r,o);if(!s)return;n.push(s.e1),r=s.e2}return{edits:new t(xge.StringEdit,n),editLast:r}}serialize(){return this.edits.map(e=>(0,uMi.serializeStringEdit)(e))}static deserialize(e){return new t(xge.StringEdit,e.map(r=>(0,uMi.deserializeStringEdit)(r)))}toHumanReadablePatch(e){let r=e,n=[];for(let o of this.edits){let s=V5e.toLineEdit(new V5e(r,o));n.push(s.humanReadablePatch(r.getLines())),r=o.applyOnText(r)}return n.join(` --- -`)}};u$.Edits=Syt});var yRr=I(Bge=>{"use strict";p();Object.defineProperty(Bge,"__esModule",{value:!0});Bge.serializeStringEdit=dac;Bge.serializeSingleEdit=XNi;Bge.deserializeStringEdit=fac;Bge.decomposeStringEdit=hac;var lac=Ts(),ZNi=gE(),uac=sd(),JNi=kD();function dac(t){return t.replacements.map(e=>XNi(e))}a(dac,"serializeStringEdit");function XNi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(XNi,"serializeSingleEdit");function fac(t){return new ZNi.StringEdit(t.map(e=>pac(e)))}a(fac,"deserializeStringEdit");function pac(t){return new ZNi.StringReplacement(new uac.OffsetRange(t[0],t[1]),t[2])}a(pac,"deserializeSingleEdit");function hac(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new JNi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,lac.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(Tyt,"__esModule",{value:!0});Tyt.DebugRecorderBookmark=void 0;var ERr=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};Tyt.DebugRecorderBookmark=ERr});var nMi=I(Iyt=>{"use strict";p();Object.defineProperty(Iyt,"__esModule",{value:!0});Iyt.DebugRecorder=void 0;var mac=yRr(),gac=eMi(),Aac=B5(),yac=qDe(),tMi=El(),rMi=ko(),Eac=yK(),_ac=HF(),Cac=hA(),vac=um(),bac=CT(),_Rr=class extends rMi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=yac.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,_ac.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new CRr(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,Aac.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,rMi.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,vac.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,tMi.compareBy)(n=>n.sortTime,tMi.numberComparator)),r.map(n=>n.entry)}createBookmark(){return new gac.DebugRecorderBookmark(this.getNow())}};Iyt.DebugRecorder=_Rr;var CRr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,Cac.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Eac.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new bac.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(n++,o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,mac.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}}});var iMi=I(xyt=>{"use strict";p();Object.defineProperty(xyt,"__esModule",{value:!0});xyt.CapturingToken=void 0;var vRr=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};xyt.CapturingToken=vRr});var oMi=I(bRr=>{"use strict";p();Object.defineProperty(bRr,"__esModule",{value:!0});bRr.secondsToHumanReadableTime=Sac;function Sac(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(Sac,"secondsToHumanReadableTime")});var yR=I(Hd=>{"use strict";p();var Tac=Hd&&Hd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Iac=Hd&&Hd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),xac=Hd&&Hd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(wge,"__esModule",{value:!0});wge.serializeStringEdit=Boc;wge.serializeSingleEdit=pMi;wge.deserializeStringEdit=Loc;wge.decomposeStringEdit=Uoc;var Moc=bs(),fMi=hE(),Ooc=sd(),dMi=xD();function Boc(t){return t.replacements.map(e=>pMi(e))}a(Boc,"serializeStringEdit");function pMi(t){return[t.replaceRange.start,t.replaceRange.endExclusive,t.newText]}a(pMi,"serializeSingleEdit");function Loc(t){return new fMi.StringEdit(t.map(e=>Foc(e)))}a(Loc,"deserializeStringEdit");function Foc(t){return new fMi.StringReplacement(new Ooc.OffsetRange(t[0],t[1]),t[2])}a(Foc,"deserializeSingleEdit");function Uoc(t,e){if(e===void 0){let o=[],s=0;for(let c of t.replacements)o.push(c.delta(s)),s+=c.newText.length-c.replaceRange.length;return new dMi.SingleEdits(o)}if(t.replacements.length!==e.arrayLength)throw(0,Moc.illegalArgument)(`Number of edits ${t.replacements.length} does not match ${e.arrayLength}`);let r=[],n=t.replacements.slice();for(let o=0;o{"use strict";p();Object.defineProperty(Eyt,"__esModule",{value:!0});Eyt.DebugRecorderBookmark=void 0;var gRr=class{static{a(this,"DebugRecorderBookmark")}constructor(e){this.timeMs=e}};Eyt.DebugRecorderBookmark=gRr});var AMi=I(_yt=>{"use strict";p();Object.defineProperty(_yt,"__esModule",{value:!0});_yt.DebugRecorder=void 0;var Qoc=mRr(),qoc=hMi(),joc=P5(),Hoc=DDe(),mMi=ml(),gMi=Io(),Goc=uY(),$oc=BF(),Voc=fA(),Woc=fm(),zoc=AT(),ARr=class extends gMi.Disposable{static{a(this,"DebugRecorder")}constructor(e,r=Hoc.now){super(),this._workspace=e,this.getNow=r,this._id=0,this._documentHistories=new Map,(0,$oc.mapObservableArrayCached)(this,this._workspace.openDocuments,(n,o)=>{let s=this._workspace.getWorkspaceRoot(n.id);if(!s)return;if(!this._workspaceRoot)this._workspaceRoot=s;else if(this._workspaceRoot.toString()!==s.toString())return;let c=new yRr(s,n.id,n.value.get().value,this._id++,n.languageId.get(),()=>this.getTimestamp());this._documentHistories.set(c.docId,c),o.add((0,joc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);for(let u of l.value.changes)c.handleEdit(u);l.selection.changes.length>0&&c.handleSelections(l.selection.value)})),o.add((0,gMi.toDisposable)(()=>{this._documentHistories.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getTimestamp(){let e=this.getNow();return this._lastTimestamp!==void 0&&e<=this._lastTimestamp&&(e=this._lastTimestamp+1),this._lastTimestamp=e,e}getRecentLog(e=void 0){if(!this._workspaceRoot)return;let r=[];r.push({entry:{documentType:"workspaceRecording@1.0",kind:"header",repoRootUri:this._workspaceRoot.toString(),time:this.getNow(),uuid:(0,Woc.generateUuid)()},sortTime:0});for(let n of this._documentHistories.values())r.push(...n.getDocumentLog(e));return r.sort((0,mMi.compareBy)(n=>n.sortTime,mMi.numberComparator)),r.map(n=>n.entry)}createBookmark(){return new qoc.DebugRecorderBookmark(this.getNow())}};_yt.DebugRecorder=ARr;var yRr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s,c){this.workspaceUri=e,this.docId=r,this.id=o,this.languageId=s,this.getNow=c,this._edits=[],this.relativePath=(()=>{let l=(0,Voc.relative)(this.workspaceUri.path,this.docId.path);return this.docId.toUri().scheme===Goc.Schemas.vscodeNotebookCell?`${l}#${this.docId.fragment}`:l})(),this._baseValue=new zoc.StringText(n),this.creationTime=this.getNow(),this._baseValueTime=this.creationTime}handleSelections(e){this._edits.push({kind:"selections",selections:e,instant:this.getNow()})}handleEdit(e){e.isEmpty()||(this._edits.push({kind:"edit",edit:e,instant:this.getNow()}),this.cleanUpHistory())}cleanUpHistory(){let r=this.getNow()-3e5;for(;this._edits.length>0&&this._edits[0].instante.timeMs)break;if(n++,o.kind==="selections"){let s=o.selections.map(c=>[c.start,c.endExclusive]);r.push({entry:{kind:"selectionChanged",id:this.id,selection:s,time:o.instant},sortTime:o.instant})}else r.push({entry:{kind:"changed",id:this.id,v:n,edit:(0,Qoc.serializeStringEdit)(o.edit),time:o.instant},sortTime:o.instant})}return r}}});var yMi=I(vyt=>{"use strict";p();Object.defineProperty(vyt,"__esModule",{value:!0});vyt.CapturingToken=void 0;var ERr=class{static{a(this,"CapturingToken")}constructor(e,r,n,o,s,c,l){this.label=e,this.icon=r,this.subAgentInvocationId=n,this.subAgentName=o,this.chatSessionId=s,this.parentChatSessionId=c,this.debugLogLabel=l}};vyt.CapturingToken=ERr});var EMi=I(_Rr=>{"use strict";p();Object.defineProperty(_Rr,"__esModule",{value:!0});_Rr.secondsToHumanReadableTime=Yoc;function Yoc(t){if(t<90)return`${t} seconds`;let e=Math.floor(t/60);if(t<=5400)return`${e} minutes`;let r=Math.floor(e/60),n=e%60,o=`${r} hours`;return n>0&&(o+=` ${n} minutes`),o}a(Yoc,"secondsToHumanReadableTime")});var gR=I(qd=>{"use strict";p();var Koc=qd&&qd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Joc=qd&&qd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Zoc=qd&&qd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(B4,"__esModule",{value:!0});B4.PendingLoggedChatRequest=B4.IRequestLogger=B4.ChatRequestScheme=void 0;B4.resolveMarkdownContent=Oac;B4.resolveMarkdownIcon=Bac;var uMi=yR(),Nac=rn(),Mac=sd(),SRr=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new Mac.OffsetRange(n.index,n.index+o.length)}})}};B4.ChatRequestScheme=SRr;B4.IRequestLogger=(0,Nac.createServiceIdentifier)("IRequestLogger");function Oac(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(Oac,"resolveMarkdownContent");function Bac(t){return typeof t.icon=="function"?t.icon():t.icon}a(Bac,"resolveMarkdownIcon");var TRr=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},IRr=class extends TRr{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===uMi.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===uMi.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};B4.PendingLoggedChatRequest=IRr});var wRr=I(Fge=>{"use strict";p();Object.defineProperty(Fge,"__esModule",{value:!0});Fge.NullSnippyService=Fge.ISnippyService=void 0;var Lac=rn();Fge.ISnippyService=(0,Lac.createServiceIdentifier)("ISnippyService");var xRr=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};Fge.NullSnippyService=xRr});var PRr=I(Uge=>{"use strict";p();Object.defineProperty(Uge,"__esModule",{value:!0});Uge.MovedText=Uge.LinesDiff=void 0;var RRr=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};Uge.LinesDiff=RRr;var kRr=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};Uge.MovedText=kRr});var kyt=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.RangeMapping=DD.DetailedLineRangeMapping=DD.LineRangeMapping=void 0;DD.lineRangeMappingFromRangeMappings=Uac;DD.getLineRangeMapping=hMi;DD.lineRangeMappingFromChange=Qac;var Fac=El(),dMi=Yu(),Ryt=Ts(),i1=g2(),PD=I_(),L4=qp(),pMi=MMe(),o4e=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new i1.LineRange(s,u.original.startLineNumber),new i1.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new i1.LineRange(s,r+1),new i1.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new g6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Ryt.BugIndicatingError("not a valid diff");return new g6(new L4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new g6(new L4.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new L4.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(fMi(this.original.endLineNumberExclusive,e)&&fMi(this.modified.endLineNumberExclusive,r))return new g6(new L4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new L4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new g6(L4.Range.fromPositions(new PD.Position(this.original.startLineNumber,1),Qge(new PD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L4.Range.fromPositions(new PD.Position(this.modified.startLineNumber,1),Qge(new PD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new g6(L4.Range.fromPositions(Qge(new PD.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Qge(new PD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),L4.Range.fromPositions(Qge(new PD.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Qge(new PD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Ryt.BugIndicatingError}};DD.LineRangeMapping=o4e;function Qge(t,e){if(t.lineNumber<1)return new PD.Position(1,1);if(t.lineNumber>e.length)return new PD.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new PD.Position(t.lineNumber,r.length+1):t}a(Qge,"normalizePosition");function fMi(t,e){return t>=1&&t<=e.length}a(fMi,"isValidLineNumber");var s4e=class t extends o4e{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new pMi.TextEdit(n)}static fromRangeMappings(e){let r=i1.LineRange.join(e.map(o=>i1.LineRange.fromRangeInclusive(o.originalRange))),n=i1.LineRange.join(e.map(o=>i1.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};DD.DetailedLineRangeMapping=s4e;var g6=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Ryt.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new pMi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};DD.RangeMapping=g6;function Uac(t,e,r,n=!1){let o=[];for(let s of(0,Fac.groupAdjacentBy)(t.map(c=>hMi(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new s4e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,dMi.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,dMi.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new i1.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new i1.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new s4e(s,c,[t])}a(hMi,"getLineRangeMapping");function Qac(t){let e;t.originalEndLineNumber===0?e=new i1.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new i1.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new i1.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new i1.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new o4e(e,r)}a(Qac,"lineRangeMappingFromChange")});var jge=I(ER=>{"use strict";p();Object.defineProperty(ER,"__esModule",{value:!0});ER.DateTimeout=ER.InfiniteTimeout=ER.OffsetPair=ER.SequenceDiff=ER.DiffAlgorithmResult=void 0;var qac=El(),mMi=Ts(),qge=sd(),DRr=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new a4e(qge.OffsetRange.ofLength(e.length),qge.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new a4e(qge.OffsetRange.ofLength(e.length),qge.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};ER.DiffAlgorithmResult=DRr;var a4e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,qac.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():kre.zero,s?s.getStarts():new kre(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new qge.OffsetRange(e.offset1,r.offset1),new qge.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new mMi.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new kre(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new kre(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};ER.SequenceDiff=a4e;var kre=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};ER.OffsetPair=kre;var NRr=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};ER.InfiniteTimeout=NRr;var MRr=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new mMi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};ER.DateTimeout=MRr});var Pyt=I(Pre=>{"use strict";p();Object.defineProperty(Pre,"__esModule",{value:!0});Pre.LineRangeFragment=Pre.Array2D=void 0;Pre.isSpace=jac;var ORr=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};Pre.Array2D=ORr;function jac(t){return t===32||t===9}a(jac,"isSpace");var BRr=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(Dyt,"__esModule",{value:!0});Dyt.DynamicProgrammingDiffing=void 0;var gMi=sd(),c4e=jge(),LRr=Pyt(),FRr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=c4e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return c4e.DiffAlgorithmResult.trivial(e,r);let s=new LRr.Array2D(e.length,r.length),c=new LRr.Array2D(e.length,r.length),l=new LRr.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let b=Math.max(E,_,v);if(b===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new c4e.SequenceDiff(new gMi.OffsetRange(A+1,d),new gMi.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new c4e.DiffAlgorithmResult(u,!1)}};Dyt.DynamicProgrammingDiffing=FRr});var jRr=I(Myt=>{"use strict";p();Object.defineProperty(Myt,"__esModule",{value:!0});Myt.MyersDiffAlgorithm=void 0;var yMi=sd(),l4e=jge(),URr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=l4e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return l4e.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new Nyt(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new l4e.SequenceDiff(new yMi.OffsetRange(y,g),new yMi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new l4e.DiffAlgorithmResult(m,!1)}};Myt.MyersDiffAlgorithm=URr;var Nyt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},QRr=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},qRr=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var $Rr=I(Byt=>{"use strict";p();Object.defineProperty(Byt,"__esModule",{value:!0});Byt.LinesSliceCharSequence=void 0;var HRr=ZQ(),Oyt=sd(),Hac=I_(),EMi=qp(),Gac=Pyt(),GRr=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=vMi(e>0?this.elements[e-1]:-1),n=vMi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new Hac.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?EMi.Range.fromPositions(n,n):EMi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!Hge(this.elements[e]))return;let r=e;for(;r>0&&Hge(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!Hge(this.elements[e]))return;let r=e;for(;r>0&&Hge(this.elements[r-1])&&!_Mi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,HRr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Oyt.OffsetRange(r,n)}};Byt.LinesSliceCharSequence=GRr;function Hge(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(Hge,"isWordChar");function _Mi(t){return t>=65&&t<=90}a(_Mi,"isUpperCase");var $ac={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function CMi(t){return $ac[t]}a(CMi,"getCategoryBoundaryScore");function vMi(t){return t===10?8:t===13?7:(0,Gac.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(vMi,"getCategory")});var IMi=I(VRr=>{"use strict";p();Object.defineProperty(VRr,"__esModule",{value:!0});VRr.computeMovedLines=Yac;var Vac=jge(),Lyt=kyt(),F4=El(),u4e=ZQ(),Wac=bP(),o1=g2(),bMi=$Rr(),Fyt=Pyt(),zac=jRr(),SMi=qp();function Yac(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=Jac(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=Zac(u,n,o,e,r,s);return(0,F4.pushMany)(c,d),c=Xac(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` -`).length>=15&&Kac(h,g=>g.length>=2)>=2}),c=ecc(t,c),c}a(Yac,"computeMovedLines");function Kac(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(Kac,"countWhere");function Jac(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Fyt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Fyt.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new Lyt.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a(Jac,"computeMovesFromSimpleDeletionsToSimpleInsertions");function Zac(t,e,r,n,o,s){let c=[],l=new Wac.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,F4.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===E.endLineNumberExclusive){T.originalLineRange=new o1.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new o1.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,F4.reverseOrder)((0,F4.compareBy)(m=>m.modifiedLineRange.length,F4.numberComparator)));let d=new o1.LineRangeSet,f=new o1.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new Lyt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,F4.compareBy)(m=>m.original.startLineNumber,F4.numberComparator));let h=new u4e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,u4e.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!TMi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new o1.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new o1.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!TMi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new o1.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new o1.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new Lyt.LineRangeMapping(new o1.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new o1.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(Zac,"computeUnchangedMoves");function TMi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new zac.MyersDiffAlgorithm().compute(new bMi.LinesSliceCharSequence([t],new SMi.Range(1,1,1,t.length),!1),new bMi.LinesSliceCharSequence([e],new SMi.Range(1,1,1,e.length),!1),r),s=0,c=Vac.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Fyt.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(TMi,"areLinesSimilar");function Xac(t){if(t.length===0)return t;t.sort((0,F4.compareBy)(r=>r.original.startLineNumber,F4.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(Xac,"joinCloseConsecutiveMoves");function ecc(t,e){let r=new u4e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(Dre,"__esModule",{value:!0});Dre.optimizeSequenceDiffs=rcc;Dre.removeShortMatches=icc;Dre.extendDiffsToEntireWordIfAppropriate=occ;Dre.removeVeryShortMatchingLinesBetweenDiffs=acc;Dre.removeVeryShortMatchingTextBetweenLongDiffs=ccc;var tcc=El(),U4=sd(),Q4=jge();function rcc(t,e,r){let n=r;return n=xMi(t,e,n),n=xMi(t,e,n),n=ncc(t,e,n),n}a(rcc,"optimizeSequenceDiffs");function xMi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(xMi,"joinSequenceDiffsByShifting");function ncc(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(wMi,"shiftDiffToBetterPosition");function icc(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new Q4.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(icc,"removeShortMatches");function occ(t,e,r,n,o=!1){let s=Q4.SequenceDiff.invert(r,t.length),c=[],l=new Q4.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new Q4.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return scc(r,c)}a(occ,"extendDiffsToEntireWordIfAppropriate");function scc(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(scc,"mergeSequenceDiffs");function acc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a(acc,"removeVeryShortMatchingLinesBetweenDiffs");function ccc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,k=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function L(B){return Math.min(B,N)}return a(L,"cap"),Math.pow(Math.pow(L(v*40+b),1.5)+Math.pow(L(T*40+w),1.5),1.5)+Math.pow(Math.pow(L(R*40+x),1.5)+Math.pow(L(k*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,tcc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new U4.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new U4.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=Q4.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():Q4.OffsetPair.zero,d?d.getStarts():Q4.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(ccc,"removeVeryShortMatchingTextBetweenLongDiffs")});var PMi=I(Uyt=>{"use strict";p();Object.defineProperty(Uyt,"__esModule",{value:!0});Uyt.LineSequence=void 0;var WRr=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:kMi(this.lines[e-1]),n=e===this.lines.length?0:kMi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};Uyt.LineSequence=WRr;function kMi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.DefaultLinesDiffComputer=void 0;var lcc=El(),DMi=Yu(),jyt=g2(),NMi=sd(),MMi=qp(),Qyt=CT(),qyt=PRr(),Mre=kyt(),q4=jge(),ucc=AMi(),dcc=jRr(),fcc=IMi(),Nre=RMi(),OMi=PMi(),BMi=$Rr(),zRr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new ucc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new dcc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,lcc.equals)(e,r,(x,k)=>x===k))return new qyt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new qyt.LinesDiff([new Mre.DetailedLineRangeMapping(new jyt.LineRange(1,e.length+1),new jyt.LineRange(1,r.length+1),[new Mre.RangeMapping(new MMi.Range(1,1,e.length,e[e.length-1].length+1),new MMi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?q4.InfiniteTimeout.instance:new q4.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let k=c.get(x);return k===void 0&&(k=c.size,c.set(x,k)),k}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new OMi.LineSequence(u,e),h=new OMi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,k)=>e[x]===r[k]?r[k].length===0?.1:1+Math.log(1+r[k].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,Nre.optimizeSequenceDiffs)(f,h,g),g=(0,Nre.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let k=0;kx.seq1Range.start-_===x.seq2Range.start-v);let k=x.seq1Range.start-_;E(k),_=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}E(e.length-_);let b=new Qyt.ArrayText(e),T=new Qyt.ArrayText(r),w=(0,Mre.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,DMi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let L=N[D.lineNumber-1];return!(D.column<1||D.column>L.length+1)}a(x,"validatePosition");function k(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(k,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!k(D.modified,r)||!k(D.original,e))return!1}return!0}),new qyt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,fcc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new q4.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Mre.lineRangeMappingFromRangeMappings)(m.mappings,new Qyt.ArrayText(r),new Qyt.ArrayText(n),!0);return new qyt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=pcc(n).toRangeMapping2(e,r),d=new BMi.LinesSliceCharSequence(e,u.originalRange,s),f=new BMi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.optimizeSequenceDiffs)(d,f,g),m&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&q4.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,Nre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&q4.SequenceDiff.assertSorted(g)),g=(0,Nre.removeShortMatches)(d,f,g),m&&q4.SequenceDiff.assertSorted(g),g=(0,Nre.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&q4.SequenceDiff.assertSorted(g);let A=g.map(y=>new Mre.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Mre.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};Hyt.DefaultLinesDiffComputer=zRr;function pcc(t){return new Mre.LineRangeMapping(new jyt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new jyt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(pcc,"toLineRangeMapping")});var KRr=I(vC=>{"use strict";p();Object.defineProperty(vC,"__esModule",{value:!0});vC.EditDataWithIndex=vC.maxImperfectAgreementLength=vC.maxAgreementOffset=void 0;vC.tryRebase=ycc;vC.checkEditConsistency=FMi;vC.tryRebaseStringEdits=_cc;var hcc=kD(),mcc=L_(),NE=gE(),Gge=sd(),LMi=CT(),gcc=YRr(),Acc=!1;vC.maxAgreementOffset=10;vC.maxImperfectAgreementLength=5;var Gyt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};vC.EditDataWithIndex=Gyt;function ycc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:vC.maxImperfectAgreementLength}){let f=Date.now();try{return Ecc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${mcc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(ycc,"tryRebase");function Ecc(t,e,r,n,o,s,c,l,u,d){if(!FMi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthNE.AnnotatedStringEdit.create(E))),g=UMi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=NE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new hcc.SingleEdits(r).apply(t)!==NE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Ecc,"_tryRebase");function FMi(t,e,r,n,o=Acc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(FMi,"checkEditConsistency");function _cc(t,e,r,n,o={maxImperfectAgreementLength:vC.maxImperfectAgreementLength}){return UMi(t,e.mapData(s=>new NE.VoidEditData),r,n,o)?.toStringEdit()}a(_cc,"tryRebaseStringEdits");function UMi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new NE.AnnotatedStringReplacement(Gge.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Scc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new NE.AnnotatedStringReplacement(new Gge.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uvC.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-_.length),x=y.newText.substring(R);x.length>0&&c.push(new NE.AnnotatedStringReplacement(Gge.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function bcc(t){return vcc.has(t)}a(bcc,"isAutoClosePair");function Scc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uvC.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&bcc(l)&&Ccc(l,e.newText.substring(o))?o:-1}a(Scc,"agreementIndexOf");function Tcc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new gcc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new LMi.StringText(t),f=new LMi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new NE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Tcc,"computeDiff")});var qMi=I($yt=>{"use strict";p();Object.defineProperty($yt,"__esModule",{value:!0});$yt.RejectionCollector=void 0;var Icc=B5(),QMi=ko(),xcc=y2(),JRr=class extends QMi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new ekr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,xcc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new ZRr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Icc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,QMi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};$yt.RejectionCollector=JRr;var ZRr=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new XRr(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},XRr=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},ekr=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var rkr=I($ge=>{"use strict";p();Object.defineProperty($ge,"__esModule",{value:!0});$ge.DisposablesLRUCache=$ge.LRUCache=void 0;var d4e=class{static{a(this,"Node")}constructor(e,r){this.prev=null,this.next=null,this.key=e,this.value=r}},Vyt=class{static{a(this,"LRUCache")}constructor(e=10){if(e<1)throw new Error("Cache size must be at least 1");this._capacity=e,this._cache=new Map,this._head=new d4e("",null),this._tail=new d4e("",null),this._head.next=this._tail,this._tail.prev=this._head}_addNode(e){e.prev=this._head,e.next=this._head.next,this._head.next.prev=e,this._head.next=e}_removeNode(e){let r=e.prev,n=e.next;r.next=n,n.prev=r}_moveToHead(e){this._removeNode(e),this._addNode(e)}_popTail(){let e=this._tail.prev;return this._removeNode(e),e}clear(){this._cache.clear(),this._head.next=this._tail,this._tail.prev=this._head}deleteKey(e){let r=this._cache.get(e);if(r)return this._removeNode(r),this._cache.delete(e),r.value}get(e){let r=this._cache.get(e);if(r)return this._moveToHead(r),r.value}keys(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.key),r=r.next;return e}getValues(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push(r.value),r=r.next;return e}put(e,r){let n=this._cache.get(e);if(n)n.value=r,this._moveToHead(n);else if(n=new d4e(e,r),this._cache.set(e,n),this._addNode(n),this._cache.size>this._capacity){let o=this._popTail();return this._cache.delete(o.key),[o.key,o.value]}}entries(){let e=[],r=this._head.next;for(;r!==this._tail;)e.push([r.key,r.value]),r=r.next;return e}};$ge.LRUCache=Vyt;var tkr=class{static{a(this,"DisposablesLRUCache")}constructor(e){this.actual=new Vyt(e)}dispose(){this.clear()}clear(){let e=this.actual.getValues();for(let r of e)r.dispose();this.actual.clear()}deleteKey(e){let r=this.actual.deleteKey(e);r&&r.dispose()}get(e){return this.actual.get(e)}keys(){return this.actual.keys()}getValues(){return this.actual.getValues()}put(e,r){let n=this.actual.put(e,r);n&&n[1].dispose()}};$ge.DisposablesLRUCache=tkr});var jMi=I(zyt=>{"use strict";p();Object.defineProperty(zyt,"__esModule",{value:!0});zyt.RebaseFailureInfo=void 0;var wcc=gE(),nkr=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new wcc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` -`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${Wyt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Wyt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Wyt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${Wyt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` -`)}};zyt.RebaseFailureInfo=nkr;function Wyt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(Wyt,"toBacktickLiteral")});var GMi=I(Kyt=>{"use strict";p();Object.defineProperty(Kyt,"__esModule",{value:!0});Kyt.NextEditCache=void 0;var f4e=Il(),Rcc=B5(),kcc=rkr(),HMi=ko(),Pcc=HF(),Yyt=KRr(),Dcc=jMi(),ikr=class extends HMi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new kcc.LRUCache(50),(0,Pcc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new okr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,Rcc.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(f4e.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,HMi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(f4e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(f4e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(f4e.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(f4e.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};Kyt.NextEditCache=ikr;var okr=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,Yyt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,Yyt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,Yyt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new Dcc.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,Yyt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var $Mi=I(Jyt=>{"use strict";p();Object.defineProperty(Jyt,"__esModule",{value:!0});Jyt.NextEditResult=void 0;var skr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};Jyt.NextEditResult=skr});var VMi=I(Zyt=>{"use strict";p();Object.defineProperty(Zyt,"__esModule",{value:!0});Zyt.SpeculativeRequestManager=void 0;var Ncc=ko(),akr=class extends Ncc.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var Mcc=jT&&jT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},p4e=jT&&jT.__param||function(t,e){return function(r,n){e(r,n,t)}},ckr;Object.defineProperty(jT,"__esModule",{value:!0});jT.NextEditFetchRequest=jT.NextEditProvider=jT.NesOutcome=void 0;var Occ=require("path"),bC=Il(),Vge=kD(),g4e=byt(),h4e=WA(),Bcc=Kut(),Tf=Pge(),Lcc=B5(),lkr=pp(),Fcc=iMi(),Ucc=Lge(),Qcc=wRr(),qcc=gp(),m4e=L_(),Lg=Gx(),WMi=Yu(),Xyt=Xc(),jcc=DKe(),fkr=Ts(),eEt=ko(),zMi=y2(),YMi=cO(),Hcc=BS(),eOi=um(),KMi=eG(),Ore=gE(),Gcc=I_(),ukr=sd(),JMi=CT(),$cc=KRr(),Vcc=qMi(),Wcc=GMi(),tEt=$Mi(),zcc=VMi();function Ycc(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new ukr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(Ycc,"computeReducedWindow");function ZMi(t,e){let n=new g4e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r -`)?new Ore.StringEdit(n.replacements.map(o=>new Ore.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r -`)))):n}a(ZMi,"convertLineEditToEdit");function XMi(t,e){return new jcc.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:Ore.StringEdit.empty,nextEdits:[],docId:n}}}throw new fkr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Ore.StringEdit.empty,nextEdits:[],docId:n}})}a(XMi,"createDocStateLookupMap");var A4e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(A4e||(jT.NesOutcome=A4e={}));var dkr=ckr=class extends eEt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new Vcc.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new Wcc.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new zcc.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,zMi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,zMi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,eEt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new YMi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(lkr.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(m4e.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new fkr.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let L=A.rebasedEdit??A.edit;return L&&this._rejectionCollector.reject(e,L),new tEt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let L=A.rebasedEdit||A.edit;L&&(y={actualEdit:L,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let L=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new y4e(r.requestUuid,c,L,!1),u.setHeaderRequestId(v.headerRequestId);let B=f.value.get();d.trace("awaiting firstEdit promise");let Q=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),Q.isError())d.trace(`failed to fetch next edit ${Q.err.toString()}`),u.setStatus(`noEdit:${Q.err.kind}`),_=Q.err;else if(b=Q.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&B.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let F=Q.val.rebasedEdit||Q.val.edit;F?(d.trace("fetch succeeded"),c.setResponseResults([F]),y={actualEdit:F,isFromCursorJump:Q.val.isFromCursorJump},R=Q.val.isFromSpeculativeRequest??!1,x=Q.val.baseCacheEntry??Q.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof Tf.NoNextEditReason.FetchFailure||_ instanceof Tf.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof Tf.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new tEt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof Tf.NoNextEditReason.GotCancelled&&c.setIsSkipped();let k=new tEt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),k;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),k;c.setResult(g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(h,new Ore.StringEdit([y.actualEdit])))),(0,WMi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new tEt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,Xyt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),k):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService),isEagerBackupRequest:this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsEagerBackupRequest,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new Tf.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return Lg.Result.error(new Tf.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:E,L=w?"speculative":"async";if(N){let B=await this._joinNextEditRequest(R,L,c,g,l);return c.setStatelessNextEditTelemetry(B.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):B.nextEdit.isError()?B.nextEdit:R.firstEdit.p}else if(n.isEagerBackupRequest){d.trace("starting eager backup request in parallel with rebase attempt"),this._pendingStatelessNextEditRequest=null;let B=this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),Q=a(()=>{B.then(F=>F.nextEditRequest.cancellationTokenSource.cancel()).catch(()=>{})},"cancelBackupRequest"),M=await this._joinNextEditRequest(R,L,c,g,l),O=await R.firstEdit.p;if(O.isOk()&&O.val.edit){let F=this._nextEditCache.tryRebaseCacheEntry(O.val,h,m);if(F.edit)return d.trace("rebase succeeded, cancelling eager backup request"),Q(),c.setStatelessNextEditTelemetry(M.telemetry),Lg.Result.ok(F.edit);this._logRebaseFailure(F.failureInfo,g)}if(l.isCancellationRequested)return d.trace("cancelled after rebase failed (eager backup path)"),Q(),c.setStatelessNextEditTelemetry(M.telemetry),Lg.Result.error(new Tf.NoNextEditReason.GotCancelled("afterFailedRebase"));d.trace("rebase failed, using eager backup request");let q=await B;return c.setStatelessNextEditTelemetry(q.nextEditResult.telemetry),q.nextEditResult.nextEdit.isError()?q.nextEditResult.nextEdit:q.nextEditRequest.firstEdit.p}else{let B=await this._joinNextEditRequest(R,L,c,g,l),Q=await R.firstEdit.p;if(Q.isOk()&&Q.val.edit){let q=this._nextEditCache.tryRebaseCacheEntry(Q.val,h,m);if(q.edit)return c.setStatelessNextEditTelemetry(B.telemetry),Lg.Result.ok(q.edit);this._logRebaseFailure(q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(B.telemetry),Lg.Result.error(new Tf.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let q=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(q.telemetry),q.nextEdit.isError()?q.nextEdit:O.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),k=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:k.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=this._debugRecorder?.getRecentLog(),m=e.log,g=Kcc(n.getDocumentAndIdx(d)),A=r.selection.get()[0],y=n.documents.map(B=>this._processDoc(B)),E=this._xtabHistoryTracker.getHistory(),_=new Xyt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new Tf.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(B=>B.nextEditDoc),g.idx,E,_,v,!1,m,e.log.recordingBookmark,h,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),m.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,Lcc.autorunWithChanges)(this,{value:r.value},B=>{B.value.changes.forEach(Q=>{b.intermediateUserEdit&&!Q.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(Q),(0,$cc.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,B.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=XMi(y,E),k=this._statelessNextEditProvider.provideNextEdit(b,f,m,b.cancellationTokenSource.token),D=-1,N=a((B,Q)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(B.targetDocument??d),q=B.edit,F=new KMi.LineEdit([q]),W=ZMi(F,O.baseDocState).tryRebase(O.editsSoFar);if(W===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(Lg.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(W);let V;if(W.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(W.replacements.length>1)M.trace(`WARNING: ${D} has ${W.replacements.length} edits, but expected only 1`);else{let G=W.replacements[0];O.nextEdits.push(G),V=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?B.window:void 0,G,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:B.isFromCursorJump,originalEditWindow:B.originalWindow,cursorOffset:O.docId===d?A?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),m.setResult(new g4e.RootedLineEdit(O.docContents,F)),_.complete(V?Lg.Result.ok(V):Lg.Result.error(new Tf.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=W.applyOnText(O.docContents),V},"processEdit"),L=a((B,Q)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&B instanceof Tf.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${B.kind}`),B instanceof Tf.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:W,window:V}=B,G=V?Ycc(V,A,W):void 0;this._nextEditCache.setNoNextEdit(d,W,G,e)}_.isSettled||_.complete(Lg.Result.error(B));let q=x.get(d).nextEdits.length>0?Lg.Result.ok(void 0):Lg.Result.error(B),F=new Tf.StatelessNextEditResult(q,Q);b.setResult(F),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),F},"handleStreamEnd");try{let B=await k.next();if(B.done){let Q=B.value.v;T=L(Q,B.value.telemetryBuilder)}else{let Q=B.value.v,M=B.value.telemetryBuilder;N(Q,M),(async()=>{try{for(B=await k.next();!B.done;){let q=B.value.v;N(q,B.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),B=await k.next()}let O=B.value.v;L(O,B.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${m4e.ErrorUtils.toString(O)}`);let q=new Tf.NoNextEditReason.Unexpected(m4e.ErrorUtils.fromUnknown(O));L(q,M)}})(),T=new Tf.StatelessNextEditResult(Lg.Result.ok(void 0),M)}}catch(B){throw b.setResultError(B),B}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new eEt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Xyt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,eEt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===h4e.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new Bcc.InlineEditRequestLogContext(n.uri,0,void 0),s=new YMi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(lkr.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new ukr.OffsetRange(d,d),h=[f],m=new Vge.RootedEdit(r.documentBeforeEdits,new Ore.StringEdit([r.edit])),g=new JMi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===h4e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=ckr.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let b=new y4e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,eOi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),k=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:k})}}catch(T){c.trace(`speculative request failed: ${m4e.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let E=new JMi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let L=this._workspace.getWorkspaceRoot(h),B=new Ore.StringEdit([l]),Q=g4e.RootedLineEdit.fromEdit(new Vge.RootedEdit(r.value.get(),B)).removeCommonSuffixPrefixLines().edit,M=new Tf.StatelessNextEditDocument(h,L,N.languageId,r.value.get().getLines(),Q,r.value.get(),Vge.Edits.single(B),n);return{recentEdit:new Vge.RootedEdit(r.value.get(),B),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new Xyt.DeferredPromise,w=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case h4e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(bC.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,WMi.assertNever)(w)}let x=new Tf.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,E,_.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let k=`NES | spec | ${(0,Occ.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new Fcc.CapturingToken(k,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,k);try{await this._runSpeculativeProviderCall(x,_,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=XMi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(Lg.Result.error(g.value.v)),e.setResult(new Tf.StatelessNextEditResult(Lg.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=d.get(A.targetDocument??n),E=A.edit,_=new KMi.LineEdit([E]),b=ZMi(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(Lg.Result.ok(w)),e.setResult(new Tf.StatelessNextEditResult(Lg.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(Lg.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new Tf.StatelessNextEditResult(Lg.Result.error(new Tf.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${m4e.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=A4e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=A4e.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};jT.NextEditProvider=dkr;jT.NextEditProvider=dkr=ckr=Mcc([p4e(5,bC.IConfigurationService),p4e(6,Qcc.ISnippyService),p4e(7,lkr.ILogService),p4e(8,qcc.IExperimentationService),p4e(9,Ucc.IRequestLogger)],dkr);function Kcc(t){if(!t)throw new fkr.BugIndicatingError("expected value to be defined, but it was not");return t}a(Kcc,"assertDefined");var y4e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,eOi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};jT.NextEditFetchRequest=y4e});var uOi=I(ah=>{"use strict";p();Object.defineProperty(ah,"__esModule",{value:!0});ah.GLOB_SPLIT=ah.GLOBSTAR=void 0;ah.getEmptyExpression=tlc;ah.splitGlobAware=mkr;ah.isEmptyPattern=llc;ah.match=hlc;ah.parse=aOi;ah.isRelativePattern=cOi;ah.getBasenameTerms=mlc;ah.getPathTerms=glc;ah.patternsEquals=Elc;var Jcc=El(),hkr=Xc(),Zcc=JQt(),Xcc=bP(),d$=hA(),elc=eq(),E4e=Gh();function tlc(){return Object.create(null)}a(tlc,"getEmptyExpression");ah.GLOBSTAR="**";ah.GLOB_SPLIT="/";var rEt="[/\\\\]",nEt="[^/\\\\]",rlc=/\//g;function rOi(t,e){switch(t){case 0:return"";case 1:return`${nEt}*?`;default:return`(?:${rEt}|${nEt}+${rEt}${e?`|${rEt}${nEt}+`:""})*?`}}a(rOi,"starsToRegExp");function mkr(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(mkr,"splitGlobAware");function sOi(t){if(!t)return"";let e="",r=mkr(t,ah.GLOB_SPLIT);if(r.every(n=>n===ah.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===ah.GLOBSTAR){if(n)return;e+=rOi(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===ah.GLOB_SPLIT?h="":h=(0,E4e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${mkr(l,",").map(g=>sOi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=nEt;continue;case"*":e+=rOi(1);continue;default:e+=(0,E4e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?E4e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,Zcc.isEqualOrParent)(u,d,e.ignoreCase??!elc.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=nOi.get(s);if(c)return iOi(c,t,o);let l;return nlc.test(r)?c=ulc(r.substring(4),r,o):(l=ilc.exec(pkr(r,o)))?c=dlc(l[1],r,o):(e.trimForExclusions?slc:olc).test(r)?c=flc(r,o):(l=alc.exec(pkr(r,o)))?c=oOi(l[1].substring(1),r,!0,o):(l=clc.exec(pkr(r,o)))?c=oOi(l[1],r,!1,o):c=plc(r,o),nOi.set(s,c),iOi(c,t,o)}a(Akr,"parsePattern");function iOi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,E4e.ltrim)(o.substring(e.base.length),d$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(iOi,"wrapRelativePattern");function pkr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(pkr,"trimForExclusions");function ulc(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(ulc,"trivia1");function dlc(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(dlc,"trivia2");function flc(t,e){let r=lOi(t.slice(1,-1).split(",").map(l=>Akr(l,e)).filter(l=>l!==ND),t),n=r.length;if(!n)return ND;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(flc,"trivia3");function oOi(t,e,r,n){let o=d$.sep===d$.posix.sep,s=o?t:t.replace(rlc,d$.sep),c=d$.sep+s,l=d$.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(oOi,"trivia4and5");function plc(t,e){try{let r=new RegExp(`^${sOi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return ND}}a(plc,"toRegExp");function hlc(t,e,r){return!t||typeof e!="string"?!1:aOi(t,r)(e)}a(hlc,"match");function aOi(t,e={}){if(!t)return gkr;if(typeof t=="string"||cOi(t)){let r=Akr(t,e);if(r===ND)return gkr;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return Alc(t,e)}a(aOi,"parse");function cOi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(cOi,"isRelativePattern");function mlc(t){return t.allBasenames||[]}a(mlc,"getBasenameTerms");function glc(t){return t.allPaths||[]}a(glc,"getPathTerms");function Alc(t,e){let r=lOi(Object.getOwnPropertyNames(t).map(l=>ylc(l,t[l],e)).filter(l=>l!==ND)),n=r.length;if(!n)return ND;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Alc,"parsedExpression");function ylc(t,e,r){if(e===!1)return ND;let n=Akr(t,r);if(n===ND)return ND;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,hkr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(ylc,"parseExpressionPattern");function lOi(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(lOi,"aggregateBasenameMatches");function Elc(t,e){return(0,Jcc.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(Elc,"patternsEquals")});var oEt=I(kl=>{"use strict";p();var _lc=kl&&kl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Clc=kl&&kl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),vlc=kl&&kl.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,dOi.isEqual)(r.uri,t)||r.uri.path===t.path||Ekr(t,r))}a(ykr,"findNotebook");function Ekr(t,e){if(t.scheme===_4e.Schemas.vscodeNotebookCell||t.scheme===_4e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,dOi.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(Ekr,"findCell");function blc(t,e){if(t.scheme!==_4e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=fOi(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(blc,"getNotebookCellOutput");function fOi(t,e){let r=ykr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=Ekr(t,r);return n===void 0?[r,void 0]:[r,n]}a(fOi,"getNotebookAndCellFromUri");function Slc(t){return t.scheme===_4e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Slc,"isNotebookCellOrNotebookChatInput");function Tlc(t){return t.scheme===_4e.Schemas.vscodeNotebookCell}a(Tlc,"isNotebookCell");function Ilc(t){return t.path.endsWith(".ipynb")}a(Ilc,"isJupyterNotebookUri");function xlc(t){return t.notebookType==="jupyter-notebook"}a(xlc,"isJupyterNotebook");function wlc(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(wlc,"serializeNotebookDocument");function Rlc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a(Rlc,"extractNotebookOutline");function pOi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||mOi(e.include))}a(pOi,"isDocumentExcludePattern");function hOi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(hOi,"isFilenamePattern");function mOi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(mOi,"isRelativePattern");function klc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(klc,"isNotebookEditorContribution");function Plc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(Plc,"extractEditorAssociation");function gOi(t,e){if(typeof e=="string"&&Wge.match(e.toLowerCase(),(0,zge.basename)(t.fsPath).toLowerCase()))return!0;if(pOi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Wge.match(r,(0,zge.basename)(t.fsPath).toLowerCase()))return!(n&&Wge.match(n,(0,zge.basename)(t.fsPath).toLowerCase()))}return hOi(e)&&Wge.match(e.filenamePattern,(0,zge.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Wge.match(e.excludeFileNamePattern,(0,zge.basename)(t.fsPath).toLowerCase())):!1}a(gOi,"notebookSelectorMatches");function AOi(t,e){let r=[];for(let n of e)n.filenamePattern&&Wge.match(n.filenamePattern.toLowerCase(),(0,zge.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(AOi,"getNotebookEditorAssociations");function Dlc(t,e,r,n){if(ykr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>gOi(t,l)));if(o.length===0)return!1;let s=AOi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??iEt.default)===iEt.default)}a(Dlc,"_hasSupportedNotebooks")});var vOi=I(SC=>{"use strict";p();var Nlc=SC&&SC.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Mlc=SC&&SC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(SC,"__esModule",{value:!0});SC.TelemetrySender=SC.NextEditProviderTelemetryBuilder=SC.DiagnosticsTelemetryBuilder=SC.LlmNESTelemetryBuilder=void 0;var yOi=yR(),Olc=B5(),COi=o0(),Blc=oEt(),Llc=Xc(),sEt=ko(),Flc=yK(),EOi=HF(),_Oi=mm(),aEt=class extends sEt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===Flc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,Blc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(_Oi.Uri.parse(g.id.uri));if(y){let v=y.state.HEAD?.upstream?.remote,b=y.state.remotes.find(T=>T.name===v);b?.fetchUrl&&(d=b.pushUrl||b.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(_Oi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?.state.HEAD?.upstream?.remote,T=v?.state.remotes.find(w=>w.name===b);T?.fetchUrl&&E.add(T.fetchUrl),T?.pushUrl&&E.add(T.pushUrl)}f=[...E]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,Olc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};SC.LlmNESTelemetryBuilder=aEt;var cEt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};SC.DiagnosticsTelemetryBuilder=cEt;var _kr=class t extends sEt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new aEt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new cEt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};SC.NextEditProviderTelemetryBuilder=_kr;var Ckr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new sEt.DisposableStore,this._disposalTracker=new sEt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new Llc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,EOi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,EOi.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},vkr=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new Ckr(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:k,isNextEditorVisible:D,acceptance:N,disposalReason:L,logProbThreshold:B,documentsCount:Q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:F,hadLowLogProbSuggestion:U,nEditsSuggested:W,lineDistanceToMostRecentEdit:V,isCursorAtEndOfLine:G,isInlineSuggestion:Y,debounceTime:re,artificialDelay:j,hasNextEdit:X,notebookCellMarkerCount:ie,notebookCellMarkerIndex:we,notebookId:Ae,notebookCellLines:De,nextEditLogprob:Te,supersededByOpportunityId:Z,noNextEditReasonKind:J,noNextEditReasonMessage:z,fetchStartedAfterMs:le,response:K,configIsDiagnosticsNESEnabled:ae,isNaturalLanguageDominated:Me,diagnosticType:ne,diagnosticDroppedReasons:se,diagnosticHasExistingSameFileImport:Ie,diagnosticIsLocalImport:_e,diagnosticAlternativeImportsCount:Re,diagnosticDistanceToUnknownDiagnostic:Je,diagnosticDistanceToAlternativeDiagnostic:Xe,diagnosticHasAlternativeDiagnosticForSameRange:Ct,hadDiagnosticsNES:Ot,hadLlmNES:$t,pickedNES:Gt,xtabAggressivenessLevel:Ee,xtabUserHappinessScore:Qe,userAggressivenessSetting:nt,modelConfig:mt}=e,xe,He,Ze,at;if(K!==void 0){let{response:ct,ttft:ut,fetchResult:ee,fetchTime:pe}=await K;ct.type===yOi.ChatFetchResponseType.Success&&(xe=ct.usage),He=ut,Ze=ee,at=pe}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:L,supersededByOpportunityId:Z,noNextEditReasonKind:J,noNextEditReasonMessage:z,fetchResult:Ze,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ne,diagnosticDroppedReasons:se,pickedNES:Gt,notebookType:b,notebookId:Ae,notebookCellLines:De,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ee,userAggressivenessSetting:nt,modelConfig:mt,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(k),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:ie>0?1:0,notebookCellMarkerCount:ie,notebookCellMarkerIndex:we,logProbThreshold:B,documentsCount:Q,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:F,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:W,lineDistanceToMostRecentEdit:V,isCursorAtEndOfLine:this._boolToNum(G),isInlineSuggestion:this._boolToNum(Y),debounceTime:re,artificialDelay:j,fetchStartedAfterMs:le,ttft:He,fetchTime:at,promptTokens:xe?.prompt_tokens,responseTokens:xe?.completion_tokens,cachedTokens:xe?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:xe?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:xe?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(X),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:Te,hadDiagnosticsNES:this._boolToNum(Ot),hadLlmNES:this._boolToNum($t),configIsDiagnosticsNESEnabled:this._boolToNum(ae),isNaturalLanguageDominated:this._boolToNum(Me),diagnosticHasExistingSameFileImport:this._boolToNum(Ie),diagnosticIsLocalImport:this._boolToNum(_e),diagnosticAlternativeImportsCount:Re,diagnosticDistanceToUnknownDiagnostic:Je,diagnosticDistanceToAlternativeDiagnostic:Xe,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Ct),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:Qe,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent("copilot-nes/provideInlineEdit",e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,k=await T?.catch(()=>{});this._telemetryService.sendEnhancedGHTelemetryEvent("copilot-nes/provideInlineEdit",(0,COi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==yOi.ChatFetchResponseType.Success?void 0:x.response.value,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:k,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};SC.TelemetrySender=vkr;SC.TelemetrySender=vkr=Nlc([Mlc(1,COi.ITelemetryService)],vkr)});var Skr=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.NullPowerService=Yge.IPowerService=void 0;var bOi=Sc(),Ulc=Qs();Yge.IPowerService=(0,Ulc.createDecorator)("IPowerService");var bkr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=bOi.Event.None,this.onDidResume=bOi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Yge.NullPowerService=bkr});var A6=I(f$=>{"use strict";p();Object.defineProperty(f$,"__esModule",{value:!0});f$.FetchStreamRecorder=f$.FetchStreamSource=f$.IChatMLFetcher=void 0;var Qlc=rn(),qlc=Xc();f$.IChatMLFetcher=(0,Qlc.createServiceIdentifier)("IChatMLFetcher");var Tkr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new qlc.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};f$.FetchStreamSource=Tkr;var Ikr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}constructor(e){this.deltas=[],this.callback=async(r,n,o)=>{this._firstTokenEmittedTime===void 0&&(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)&&(this._firstTokenEmittedTime=Date.now());let s=e?await e(r,n,o):void 0;return this.deltas.push(o),s}}};f$.FetchStreamRecorder=Ikr});var xkr=I(lEt=>{"use strict";p();Object.defineProperty(lEt,"__esModule",{value:!0});lEt.IChatQuotaService=void 0;var jlc=rn();lEt.IChatQuotaService=(0,jlc.createServiceIdentifier)("IChatQuotaService")});var wkr=I(uEt=>{"use strict";p();Object.defineProperty(uEt,"__esModule",{value:!0});uEt.IConversationOptions=void 0;var Hlc=rn();uEt.IConversationOptions=(0,Hlc.createServiceIdentifier)("ConversationOptions")});var C4e=I(Kge=>{"use strict";p();Object.defineProperty(Kge,"__esModule",{value:!0});Kge.getTextPart=$lc;Kge.toTextPart=SOi;Kge.toTextParts=Vlc;Kge.roleToString=Wlc;var Bre=wo(),Glc=Yu();function $lc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===Bre.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===Bre.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a($lc,"getTextPart");function SOi(t){return{type:Bre.Raw.ChatCompletionContentPartKind.Text,text:t}}a(SOi,"toTextPart");function Vlc(t){return[SOi(t)]}a(Vlc,"toTextParts");function Wlc(t){switch(t){case Bre.Raw.ChatRole.System:return"system";case Bre.Raw.ChatRole.User:return"user";case Bre.Raw.ChatRole.Assistant:return"assistant";case Bre.Raw.ChatRole.Tool:return"tool";default:(0,Glc.assertNever)(t,`unknown role (${t})`)}}a(Wlc,"roleToString")});var kkr=I(Jge=>{"use strict";p();Object.defineProperty(Jge,"__esModule",{value:!0});Jge.InteractionService=Jge.IInteractionService=void 0;var zlc=rn(),TOi=um();Jge.IInteractionService=(0,zlc.createServiceIdentifier)("IInteractionService");var Rkr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,TOi.generateUuid)()}startInteraction(){this._interactionId=(0,TOi.generateUuid)()}get interactionId(){return this._interactionId}};Jge.InteractionService=Rkr});var Dkr=I(dEt=>{"use strict";p();Object.defineProperty(dEt,"__esModule",{value:!0});dEt.SSEParser=void 0;var Pkr=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(P4,"__esModule",{value:!0});P4.PendingLoggedChatRequest=P4.IRequestLogger=P4.ChatRequestScheme=void 0;P4.resolveMarkdownContent=ssc;P4.resolveMarkdownIcon=asc;var SMi=gR(),isc=tn(),osc=sd(),vRr=class t{static{a(this,"ChatRequestScheme")}static{this.chatRequestScheme="ccreq"}static buildUri(e,r="markdown"){let n;return r==="markdown"?n="copilotmd":r==="json"?n="json":n="request.json",e.kind==="latest"?`${t.chatRequestScheme}:latest.${n}`:`${t.chatRequestScheme}:${e.id}.${n}`}static parseUri(e){if(e===this.buildUri({kind:"latest"},"markdown"))return{data:{kind:"latest"},format:"markdown"};if(e===this.buildUri({kind:"latest"},"json"))return{data:{kind:"latest"},format:"json"};if(e===this.buildUri({kind:"latest"},"rawrequest"))return{data:{kind:"latest"},format:"rawrequest"};let r=e.match(/ccreq:([^\s]+)\.copilotmd/);if(r)return{data:{kind:"request",id:r[1]},format:"markdown"};let n=e.match(/ccreq:([^\s]+)\.request\.json/);if(n)return{data:{kind:"request",id:n[1]},format:"rawrequest"};let o=e.match(/ccreq:([^\s]+)\.json/);if(o)return{data:{kind:"request",id:o[1]},format:"json"}}static findAllUris(e){let r=/(ccreq:[^\s]+\.(copilotmd|json|request\.json))/g;return[...e.matchAll(r)].map(n=>{let o=n[1];return{uri:o,range:new osc.OffsetRange(n.index,n.index+o.length)}})}};P4.ChatRequestScheme=vRr;P4.IRequestLogger=(0,isc.createServiceIdentifier)("IRequestLogger");function ssc(t){return typeof t.markdownContent=="function"?t.markdownContent():t.markdownContent}a(ssc,"resolveMarkdownContent");function asc(t){return typeof t.icon=="function"?t.icon():t.icon}a(asc,"resolveMarkdownIcon");var CRr=class{static{a(this,"AbstractPendingLoggedRequest")}constructor(e,r,n,o){this._logbook=e,this._debugName=r,this._chatEndpoint=n,this._chatParams=o,this._timeToFirstToken=void 0,this._time=new Date}markTimeToFirstToken(e){this._timeToFirstToken=e}resolveWithCancelation(){this._logbook.addEntry({type:"ChatMLCancelation",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata})}},bRr=class extends CRr{static{a(this,"PendingLoggedChatRequest")}constructor(e,r,n,o){super(e,r,n,o)}resolve(e,r){e.type===SMi.ChatFetchResponseType.Success?this._logbook.addEntry({type:"ChatMLSuccess",debugName:this._debugName,usage:e.usage,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e,deltas:r}):this._logbook.addEntry({type:e.type===SMi.ChatFetchResponseType.Canceled?"ChatMLCancelation":"ChatMLFailure",debugName:this._debugName,chatEndpoint:this._chatEndpoint,chatParams:this._chatParams,startTime:this._time,endTime:new Date,timeToFirstToken:this._timeToFirstToken,isConversationRequest:this._chatParams.isConversationRequest,customMetadata:this._chatParams.customMetadata,result:e})}};P4.PendingLoggedChatRequest=bRr});var TRr=I(Pge=>{"use strict";p();Object.defineProperty(Pge,"__esModule",{value:!0});Pge.NullSnippyService=Pge.ISnippyService=void 0;var csc=tn();Pge.ISnippyService=(0,csc.createServiceIdentifier)("ISnippyService");var SRr=class{static{a(this,"NullSnippyService")}async handlePostInsertion(){}};Pge.NullSnippyService=SRr});var wRr=I(kge=>{"use strict";p();Object.defineProperty(kge,"__esModule",{value:!0});kge.MovedText=kge.LinesDiff=void 0;var IRr=class{static{a(this,"LinesDiff")}constructor(e,r,n){this.changes=e,this.moves=r,this.hitTimeout=n}};kge.LinesDiff=IRr;var xRr=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};kge.MovedText=xRr});var Syt=I(RD=>{"use strict";p();Object.defineProperty(RD,"__esModule",{value:!0});RD.RangeMapping=RD.DetailedLineRangeMapping=RD.LineRangeMapping=void 0;RD.lineRangeMappingFromRangeMappings=usc;RD.getLineRangeMapping=wMi;RD.lineRangeMappingFromChange=dsc;var lsc=ml(),TMi=Gu(),byt=bs(),Jb=p2(),wD=T_(),k4=Gp(),xMi=SMe(),W5e=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new Jb.LineRange(s,u.original.startLineNumber),new Jb.LineRange(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Jb.LineRange(s,r+1),new Jb.LineRange(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new c6(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new byt.BugIndicatingError("not a valid diff");return new c6(new k4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new c6(new k4.Range(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new k4.Range(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(IMi(this.original.endLineNumberExclusive,e)&&IMi(this.modified.endLineNumberExclusive,r))return new c6(new k4.Range(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new k4.Range(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new c6(k4.Range.fromPositions(new wD.Position(this.original.startLineNumber,1),Dge(new wD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),k4.Range.fromPositions(new wD.Position(this.modified.startLineNumber,1),Dge(new wD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new c6(k4.Range.fromPositions(Dge(new wD.Position(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),Dge(new wD.Position(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),k4.Range.fromPositions(Dge(new wD.Position(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),Dge(new wD.Position(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new byt.BugIndicatingError}};RD.LineRangeMapping=W5e;function Dge(t,e){if(t.lineNumber<1)return new wD.Position(1,1);if(t.lineNumber>e.length)return new wD.Position(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new wD.Position(t.lineNumber,r.length+1):t}a(Dge,"normalizePosition");function IMi(t,e){return t>=1&&t<=e.length}a(IMi,"isValidLineNumber");var z5e=class t extends W5e{static{a(this,"DetailedLineRangeMapping")}static toTextEdit(e,r){let n=[];for(let o of e)for(let s of o.innerChanges??[]){let c=s.toTextEdit(r);n.push(c)}return new xMi.TextEdit(n)}static fromRangeMappings(e){let r=Jb.LineRange.join(e.map(o=>Jb.LineRange.fromRangeInclusive(o.originalRange))),n=Jb.LineRange.join(e.map(o=>Jb.LineRange.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}};RD.DetailedLineRangeMapping=z5e;var c6=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new byt.BugIndicatingError("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new xMi.TextReplacement(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};RD.RangeMapping=c6;function usc(t,e,r,n=!1){let o=[];for(let s of(0,lsc.groupAdjacentBy)(t.map(c=>wMi(c,e,r)),(c,l)=>c.original.intersectsOrTouches(l.original)||c.modified.intersectsOrTouches(l.modified))){let c=s[0],l=s[s.length-1];o.push(new z5e(c.original.join(l.original),c.modified.join(l.modified),s.map(u=>u.innerChanges[0])))}return(0,TMi.assertFn)(()=>!n&&o.length>0&&(o[0].modified.startLineNumber!==o[0].original.startLineNumber||r.length.lineCount-o[o.length-1].modified.endLineNumberExclusive!==e.length.lineCount-o[o.length-1].original.endLineNumberExclusive)?!1:(0,TMi.checkAdjacentItems)(o,(s,c)=>c.original.startLineNumber-s.original.endLineNumberExclusive===c.modified.startLineNumber-s.modified.endLineNumberExclusive&&s.original.endLineNumberExclusive=r.getLineLength(t.modifiedRange.startLineNumber)&&t.originalRange.startColumn-1>=e.getLineLength(t.originalRange.startLineNumber)&&t.originalRange.startLineNumber<=t.originalRange.endLineNumber+o&&t.modifiedRange.startLineNumber<=t.modifiedRange.endLineNumber+o&&(n=1);let s=new Jb.LineRange(t.originalRange.startLineNumber+n,t.originalRange.endLineNumber+1+o),c=new Jb.LineRange(t.modifiedRange.startLineNumber+n,t.modifiedRange.endLineNumber+1+o);return new z5e(s,c,[t])}a(wMi,"getLineRangeMapping");function dsc(t){let e;t.originalEndLineNumber===0?e=new Jb.LineRange(t.originalStartLineNumber+1,t.originalStartLineNumber+1):e=new Jb.LineRange(t.originalStartLineNumber,t.originalEndLineNumber+1);let r;return t.modifiedEndLineNumber===0?r=new Jb.LineRange(t.modifiedStartLineNumber+1,t.modifiedStartLineNumber+1):r=new Jb.LineRange(t.modifiedStartLineNumber,t.modifiedEndLineNumber+1),new W5e(e,r)}a(dsc,"lineRangeMappingFromChange")});var Mge=I(AR=>{"use strict";p();Object.defineProperty(AR,"__esModule",{value:!0});AR.DateTimeout=AR.InfiniteTimeout=AR.OffsetPair=AR.SequenceDiff=AR.DiffAlgorithmResult=void 0;var fsc=ml(),RMi=bs(),Nge=sd(),RRr=class t{static{a(this,"DiffAlgorithmResult")}static trivial(e,r){return new t([new Y5e(Nge.OffsetRange.ofLength(e.length),Nge.OffsetRange.ofLength(r.length))],!1)}static trivialTimedOut(e,r){return new t([new Y5e(Nge.OffsetRange.ofLength(e.length),Nge.OffsetRange.ofLength(r.length))],!0)}constructor(e,r){this.diffs=e,this.hitTimeout=r}};AR.DiffAlgorithmResult=RRr;var Y5e=class t{static{a(this,"SequenceDiff")}static invert(e,r){let n=[];return(0,fsc.forEachAdjacent)(e,(o,s)=>{n.push(t.fromOffsetPairs(o?o.getEndExclusives():Tre.zero,s?s.getStarts():new Tre(r,(o?o.seq2Range.endExclusive-o.seq1Range.endExclusive:0)+r)))}),n}static fromOffsetPairs(e,r){return new t(new Nge.OffsetRange(e.offset1,r.offset1),new Nge.OffsetRange(e.offset2,r.offset2))}static assertSorted(e){let r;for(let n of e){if(r&&!(r.seq1Range.endExclusive<=n.seq1Range.start&&r.seq2Range.endExclusive<=n.seq2Range.start))throw new RMi.BugIndicatingError("Sequence diffs must be sorted");r=n}}constructor(e,r){this.seq1Range=e,this.seq2Range=r}swap(){return new t(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new t(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new t(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new t(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new t(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersectsOrTouches(e){return this.seq1Range.intersectsOrTouches(e.seq1Range)||this.seq2Range.intersectsOrTouches(e.seq2Range)}intersect(e){let r=this.seq1Range.intersect(e.seq1Range),n=this.seq2Range.intersect(e.seq2Range);if(!(!r||!n))return new t(r,n)}getStarts(){return new Tre(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Tre(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}};AR.SequenceDiff=Y5e;var Tre=class t{static{a(this,"OffsetPair")}static{this.zero=new t(0,0)}static{this.max=new t(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,r){this.offset1=e,this.offset2=r}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return e===0?this:new t(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}};AR.OffsetPair=Tre;var PRr=class t{static{a(this,"InfiniteTimeout")}static{this.instance=new t}isValid(){return!0}};AR.InfiniteTimeout=PRr;var kRr=class{static{a(this,"DateTimeout")}constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new RMi.BugIndicatingError("timeout must be positive")}isValid(){return!(Date.now()-this.startTime!0,this.valid=!0}};AR.DateTimeout=kRr});var Tyt=I(Ire=>{"use strict";p();Object.defineProperty(Ire,"__esModule",{value:!0});Ire.LineRangeFragment=Ire.Array2D=void 0;Ire.isSpace=psc;var DRr=class{static{a(this,"Array2D")}constructor(e,r){this.width=e,this.height=r,this.array=[],this.array=new Array(e*r)}get(e,r){return this.array[e+r*this.width]}set(e,r,n){this.array[e+r*this.width]=n}};Ire.Array2D=DRr;function psc(t){return t===32||t===9}a(psc,"isSpace");var NRr=class t{static{a(this,"LineRangeFragment")}static{this.chrKeys=new Map}static getKey(e){let r=this.chrKeys.get(e);return r===void 0&&(r=this.chrKeys.size,this.chrKeys.set(e,r)),r}constructor(e,r,n){this.range=e,this.lines=r,this.source=n,this.histogram=[];let o=0;for(let s=e.startLineNumber-1;s{"use strict";p();Object.defineProperty(Iyt,"__esModule",{value:!0});Iyt.DynamicProgrammingDiffing=void 0;var PMi=sd(),K5e=Mge(),MRr=Tyt(),ORr=class{static{a(this,"DynamicProgrammingDiffing")}compute(e,r,n=K5e.InfiniteTimeout.instance,o){if(e.length===0||r.length===0)return K5e.DiffAlgorithmResult.trivial(e,r);let s=new MRr.Array2D(e.length,r.length),c=new MRr.Array2D(e.length,r.length),l=new MRr.Array2D(e.length,r.length);for(let A=0;A0&&y>0&&c.get(A-1,y-1)===3&&(v+=l.get(A-1,y-1)),v+=o?o(A,y):1):v=-1;let b=Math.max(E,_,v);if(b===v){let T=A>0&&y>0?l.get(A-1,y-1):0;l.set(A,y,T+1),c.set(A,y,3)}else b===E?(l.set(A,y,0),c.set(A,y,1)):b===_&&(l.set(A,y,0),c.set(A,y,2));s.set(A,y,b)}let u=[],d=e.length,f=r.length;function h(A,y){(A+1!==d||y+1!==f)&&u.push(new K5e.SequenceDiff(new PMi.OffsetRange(A+1,d),new PMi.OffsetRange(y+1,f))),d=A,f=y}a(h,"reportDecreasingAligningPositions");let m=e.length-1,g=r.length-1;for(;m>=0&&g>=0;)c.get(m,g)===3?(h(m,g),m--,g--):c.get(m,g)===1?m--:g--;return h(-1,-1),u.reverse(),new K5e.DiffAlgorithmResult(u,!1)}};Iyt.DynamicProgrammingDiffing=ORr});var URr=I(wyt=>{"use strict";p();Object.defineProperty(wyt,"__esModule",{value:!0});wyt.MyersDiffAlgorithm=void 0;var DMi=sd(),J5e=Mge(),BRr=class{static{a(this,"MyersDiffAlgorithm")}compute(e,r,n=J5e.InfiniteTimeout.instance){if(e.length===0||r.length===0)return J5e.DiffAlgorithmResult.trivial(e,r);let o=e,s=r;function c(y,E){for(;yo.length||w>s.length)continue;let R=c(T,w);u.set(f,R);let x=T===v?d.get(f+1):d.get(f-1);if(d.set(f,R!==T?new xyt(x,T,w,R-T):x),u.get(f)===o.length&&u.get(f)-f===s.length)break e}}let h=d.get(f),m=[],g=o.length,A=s.length;for(;;){let y=h?h.x+h.length:0,E=h?h.y+h.length:0;if((y!==g||E!==A)&&m.push(new J5e.SequenceDiff(new DMi.OffsetRange(y,g),new DMi.OffsetRange(E,A))),!h)break;g=h.x,A=h.y,h=h.prev}return m.reverse(),new J5e.DiffAlgorithmResult(m,!1)}};wyt.MyersDiffAlgorithm=BRr;var xyt=class{static{a(this,"SnakePath")}constructor(e,r,n,o){this.prev=e,this.x=r,this.y=n,this.length=o}},LRr=class{static{a(this,"FastInt32Array")}constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){if(e<0){if(e=-e-1,e>=this.negativeArr.length){let n=this.negativeArr;this.negativeArr=new Int32Array(n.length*2),this.negativeArr.set(n)}this.negativeArr[e]=r}else{if(e>=this.positiveArr.length){let n=this.positiveArr;this.positiveArr=new Int32Array(n.length*2),this.positiveArr.set(n)}this.positiveArr[e]=r}}},FRr=class{static{a(this,"FastArrayNegativeIndices")}constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,r){e<0?(e=-e-1,this.negativeArr[e]=r):this.positiveArr[e]=r}}});var jRr=I(Pyt=>{"use strict";p();Object.defineProperty(Pyt,"__esModule",{value:!0});Pyt.LinesSliceCharSequence=void 0;var QRr=w7(),Ryt=sd(),hsc=T_(),NMi=Gp(),msc=Tyt(),qRr=class{static{a(this,"LinesSliceCharSequence")}constructor(e,r,n){this.lines=e,this.range=r,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let o=this.range.startLineNumber;o<=this.range.endLineNumber;o++){let s=e[o-1],c=0;o===this.range.startLineNumber&&this.range.startColumn>1&&(c=this.range.startColumn-1,s=s.substring(c)),this.lineStartOffsets.push(c);let l=0;if(!n){let d=s.trimStart();l=s.length-d.length,s=d.trimEnd()}this.trimmedWsLengthsByLineIdx.push(l);let u=o===this.range.endLineNumber?Math.min(this.range.endColumn-1-c-l,s.length):s.length;for(let d=0;dString.fromCharCode(r)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let r=BMi(e>0?this.elements[e-1]:-1),n=BMi(es<=e),o=e-this.firstElementOffsetByLineIdx[n];return new hsc.Position(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+o+(o===0&&r==="left"?0:this.trimmedWsLengthsByLineIdx[n]))}translateRange(e){let r=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(r)?NMi.Range.fromPositions(n,n):NMi.Range.fromPositions(r,n)}findWordContaining(e){if(e<0||e>=this.elements.length||!Oge(this.elements[e]))return;let r=e;for(;r>0&&Oge(this.elements[r-1]);)r--;let n=e;for(;n=this.elements.length||!Oge(this.elements[e]))return;let r=e;for(;r>0&&Oge(this.elements[r-1])&&!MMi(this.elements[r]);)r--;let n=e;for(;no<=e.start)??0,n=(0,QRr.findFirstMonotonous)(this.firstElementOffsetByLineIdx,o=>e.endExclusive<=o)??this.elements.length;return new Ryt.OffsetRange(r,n)}};Pyt.LinesSliceCharSequence=qRr;function Oge(t){return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57}a(Oge,"isWordChar");function MMi(t){return t>=65&&t<=90}a(MMi,"isUpperCase");var gsc={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function OMi(t){return gsc[t]}a(OMi,"getCategoryBoundaryScore");function BMi(t){return t===10?8:t===13?7:(0,msc.isSpace)(t)?6:t>=97&&t<=122?0:t>=65&&t<=90?1:t>=48&&t<=57?2:t===-1?3:t===44||t===59?5:4}a(BMi,"getCategory")});var QMi=I(HRr=>{"use strict";p();Object.defineProperty(HRr,"__esModule",{value:!0});HRr.computeMovedLines=_sc;var Asc=Mge(),kyt=Syt(),D4=ml(),Z5e=w7(),ysc=XP(),Zb=p2(),LMi=jRr(),Dyt=Tyt(),Esc=URr(),FMi=Gp();function _sc(t,e,r,n,o,s){let{moves:c,excludedChanges:l}=Csc(t,e,r,s);if(!s.isValid())return[];let u=t.filter(f=>!l.has(f)),d=bsc(u,n,o,e,r,s);return(0,D4.pushMany)(c,d),c=Ssc(c),c=c.filter(f=>{let h=f.original.toOffsetRange().slice(e).map(g=>g.trim());return h.join(` +`).length>=15&&vsc(h,g=>g.length>=2)>=2}),c=Tsc(t,c),c}a(_sc,"computeMovedLines");function vsc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(vsc,"countWhere");function Csc(t,e,r,n){let o=[],s=t.filter(u=>u.modified.isEmpty&&u.original.length>=3).map(u=>new Dyt.LineRangeFragment(u.original,e,u)),c=new Set(t.filter(u=>u.original.isEmpty&&u.modified.length>=3).map(u=>new Dyt.LineRangeFragment(u.modified,r,u))),l=new Set;for(let u of s){let d=-1,f;for(let h of c){let m=u.computeSimilarity(h);m>d&&(d=m,f=h)}if(d>.9&&f&&(c.delete(f),o.push(new kyt.LineRangeMapping(u.range,f.range)),l.add(u.source),l.add(f.source)),!n.isValid())return{moves:o,excludedChanges:l}}return{moves:o,excludedChanges:l}}a(Csc,"computeMovesFromSimpleDeletionsToSimpleInsertions");function bsc(t,e,r,n,o,s){let c=[],l=new ysc.SetMap;for(let m of t)for(let g=m.original.startLineNumber;gm.modified.startLineNumber,D4.numberComparator));for(let m of t){let g=[];for(let A=m.modified.startLineNumber;A{for(let T of g)if(T.originalLineRange.endLineNumberExclusive+1===v.endLineNumberExclusive&&T.modifiedLineRange.endLineNumberExclusive+1===E.endLineNumberExclusive){T.originalLineRange=new Zb.LineRange(T.originalLineRange.startLineNumber,v.endLineNumberExclusive),T.modifiedLineRange=new Zb.LineRange(T.modifiedLineRange.startLineNumber,E.endLineNumberExclusive),_.push(T);return}let b={modifiedLineRange:E,originalLineRange:v};u.push(b),_.push(b)}),g=_}if(!s.isValid())return[]}u.sort((0,D4.reverseOrder)((0,D4.compareBy)(m=>m.modifiedLineRange.length,D4.numberComparator)));let d=new Zb.LineRangeSet,f=new Zb.LineRangeSet;for(let m of u){let g=m.modifiedLineRange.startLineNumber-m.originalLineRange.startLineNumber,A=d.subtractFrom(m.modifiedLineRange),y=f.subtractFrom(m.originalLineRange).getWithDelta(g),E=A.getIntersection(y);for(let _ of E.ranges){if(_.length<3)continue;let v=_,b=_.delta(-g);c.push(new kyt.LineRangeMapping(b,v)),d.addRange(v),f.addRange(b)}}c.sort((0,D4.compareBy)(m=>m.original.startLineNumber,D4.numberComparator));let h=new Z5e.MonotonousArray(t);for(let m=0;mR.original.startLineNumber<=g.original.startLineNumber),y=(0,Z5e.findLastMonotonous)(t,R=>R.modified.startLineNumber<=g.modified.startLineNumber),E=Math.max(g.original.startLineNumber-A.original.startLineNumber,g.modified.startLineNumber-y.modified.startLineNumber),_=h.findLastMonotonous(R=>R.original.startLineNumberR.modified.startLineNumbern.length||x>o.length||d.contains(x)||f.contains(R)||!UMi(n[R-1],o[x-1],s))break}T>0&&(f.addRange(new Zb.LineRange(g.original.startLineNumber-T,g.original.startLineNumber)),d.addRange(new Zb.LineRange(g.modified.startLineNumber-T,g.modified.startLineNumber)));let w;for(w=0;wn.length||x>o.length||d.contains(x)||f.contains(R)||!UMi(n[R-1],o[x-1],s))break}w>0&&(f.addRange(new Zb.LineRange(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+w)),d.addRange(new Zb.LineRange(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+w))),(T>0||w>0)&&(c[m]=new kyt.LineRangeMapping(new Zb.LineRange(g.original.startLineNumber-T,g.original.endLineNumberExclusive+w),new Zb.LineRange(g.modified.startLineNumber-T,g.modified.endLineNumberExclusive+w)))}return c}a(bsc,"computeUnchangedMoves");function UMi(t,e,r){if(t.trim()===e.trim())return!0;if(t.length>300&&e.length>300)return!1;let o=new Esc.MyersDiffAlgorithm().compute(new LMi.LinesSliceCharSequence([t],new FMi.Range(1,1,1,t.length),!1),new LMi.LinesSliceCharSequence([e],new FMi.Range(1,1,1,e.length),!1),r),s=0,c=Asc.SequenceDiff.invert(o.diffs,t.length);for(let f of c)f.seq1Range.forEach(h=>{(0,Dyt.isSpace)(t.charCodeAt(h))||s++});function l(f){let h=0;for(let m=0;me.length?t:e);return s/u>.6&&u>10}a(UMi,"areLinesSimilar");function Ssc(t){if(t.length===0)return t;t.sort((0,D4.compareBy)(r=>r.original.startLineNumber,D4.numberComparator));let e=[t[0]];for(let r=1;r=0&&c>=0&&s+c<=2){e[e.length-1]=n.join(o);continue}e.push(o)}return e}a(Ssc,"joinCloseConsecutiveMoves");function Tsc(t,e){let r=new Z5e.MonotonousArray(t);return e=e.filter(n=>{let o=r.findLastMonotonous(l=>l.original.startLineNumberl.modified.startLineNumber{"use strict";p();Object.defineProperty(xre,"__esModule",{value:!0});xre.optimizeSequenceDiffs=xsc;xre.removeShortMatches=Rsc;xre.extendDiffsToEntireWordIfAppropriate=Psc;xre.removeVeryShortMatchingLinesBetweenDiffs=Dsc;xre.removeVeryShortMatchingTextBetweenLongDiffs=Nsc;var Isc=ml(),N4=sd(),M4=Mge();function xsc(t,e,r){let n=r;return n=qMi(t,e,n),n=qMi(t,e,n),n=wsc(t,e,n),n}a(xsc,"optimizeSequenceDiffs");function qMi(t,e,r){if(r.length===0)return r;let n=[];n.push(r[0]);for(let s=1;s0&&(l=l.delta(d))}o.push(l)}return n.length>0&&o.push(n[n.length-1]),o}a(qMi,"joinSequenceDiffsByShifting");function wsc(t,e,r){if(!t.getBoundaryScore||!e.getBoundaryScore)return r;for(let n=0;n0?r[n-1]:void 0,s=r[n],c=n+1=n.start&&t.seq2Range.start-c>=o.start&&r.isStronglyEqual(t.seq2Range.start-c,t.seq2Range.endExclusive-c)&&c<100;)c++;c--;let l=0;for(;t.seq1Range.start+ld&&(d=A,u=f)}return t.delta(u)}a(jMi,"shiftDiffToBetterPosition");function Rsc(t,e,r){let n=[];for(let o of r){let s=n[n.length-1];if(!s){n.push(o);continue}o.seq1Range.start-s.seq1Range.endExclusive<=2||o.seq2Range.start-s.seq2Range.endExclusive<=2?n[n.length-1]=new M4.SequenceDiff(s.seq1Range.join(o.seq1Range),s.seq2Range.join(o.seq2Range)):n.push(o)}return n}a(Rsc,"removeShortMatches");function Psc(t,e,r,n,o=!1){let s=M4.SequenceDiff.invert(r,t.length),c=[],l=new M4.OffsetPair(0,0);function u(f,h){if(f.offset10;){let v=s[0];if(!(v.seq1Range.intersects(A.seq1Range)||v.seq2Range.intersects(A.seq2Range)))break;let T=n(t,v.seq1Range.start),w=n(e,v.seq2Range.start),R=new M4.SequenceDiff(T,w),x=R.intersect(v);if(E+=x.seq1Range.length,_+=x.seq2Range.length,A=A.join(R),A.seq1Range.endExclusive>=v.seq1Range.endExclusive)s.shift();else break}(o&&E+_0;){let f=s.shift();f.seq1Range.isEmpty||(u(f.getStarts(),f),u(f.getEndExclusives().delta(-1),f))}return ksc(r,c)}a(Psc,"extendDiffsToEntireWordIfAppropriate");function ksc(t,e){let r=[];for(;t.length>0||e.length>0;){let n=t[0],o=e[0],s;n&&(!o||n.seq1Range.start0&&r[r.length-1].seq1Range.endExclusive>=s.seq1Range.start?r[r.length-1]=r[r.length-1].join(s):r.push(s)}return r}a(ksc,"mergeSequenceDiffs");function Dsc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let c=[n[0]];for(let l=1;l5||g.seq1Range.length+g.seq2Range.length>5)};a(f,"shouldJoinDiffs");let u=n[l],d=c[c.length-1];f(d,u)?(s=!0,c[c.length-1]=c[c.length-1].join(u)):c.push(u)}n=c}while(o++<10&&s);return n}a(Dsc,"removeVeryShortMatchingLinesBetweenDiffs");function Nsc(t,e,r){let n=r;if(n.length===0)return n;let o=0,s;do{s=!1;let l=[n[0]];for(let u=1;u5||y.length>500)return!1;let _=t.getText(y).trim();if(_.length>20||_.split(/\r\n|\r|\n/).length>1)return!1;let v=t.countLinesIn(g.seq1Range),b=g.seq1Range.length,T=e.countLinesIn(g.seq2Range),w=g.seq2Range.length,R=t.countLinesIn(A.seq1Range),x=A.seq1Range.length,P=e.countLinesIn(A.seq2Range),D=A.seq2Range.length,N=130;function B(L){return Math.min(L,N)}return a(B,"cap"),Math.pow(Math.pow(B(v*40+b),1.5)+Math.pow(B(T*40+w),1.5),1.5)+Math.pow(Math.pow(B(R*40+x),1.5)+Math.pow(B(P*40+D),1.5),1.5)>(N**1.5)**1.5*1.3};a(h,"shouldJoinDiffs");let d=n[u],f=l[l.length-1];h(f,d)?(s=!0,l[l.length-1]=l[l.length-1].join(d)):l.push(d)}n=l}while(o++<10&&s);let c=[];return(0,Isc.forEachWithNeighbors)(n,(l,u,d)=>{let f=u;function h(_){return _.length>0&&_.trim().length<=3&&u.seq1Range.length+u.seq2Range.length>100}a(h,"shouldMarkAsChanged");let m=t.extendToFullLines(u.seq1Range),g=t.getText(new N4.OffsetRange(m.start,u.seq1Range.start));h(g)&&(f=f.deltaStart(-g.length));let A=t.getText(new N4.OffsetRange(u.seq1Range.endExclusive,m.endExclusive));h(A)&&(f=f.deltaEnd(A.length));let y=M4.SequenceDiff.fromOffsetPairs(l?l.getEndExclusives():M4.OffsetPair.zero,d?d.getStarts():M4.OffsetPair.max),E=f.intersect(y);c.length>0&&E.getStarts().equals(c[c.length-1].getEndExclusives())?c[c.length-1]=c[c.length-1].join(E):c.push(E)}),c}a(Nsc,"removeVeryShortMatchingTextBetweenLongDiffs")});var $Mi=I(Nyt=>{"use strict";p();Object.defineProperty(Nyt,"__esModule",{value:!0});Nyt.LineSequence=void 0;var GRr=class{static{a(this,"LineSequence")}constructor(e,r){this.trimmedHash=e,this.lines=r}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){let r=e===0?0:GMi(this.lines[e-1]),n=e===this.lines.length?0:GMi(this.lines[e]);return 1e3-(r+n)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,r){return this.lines[e]===this.lines[r]}};Nyt.LineSequence=GRr;function GMi(t){let e=0;for(;e{"use strict";p();Object.defineProperty(Lyt,"__esModule",{value:!0});Lyt.DefaultLinesDiffComputer=void 0;var Msc=ml(),VMi=Gu(),Byt=p2(),WMi=sd(),zMi=Gp(),Myt=AT(),Oyt=wRr(),Rre=Syt(),O4=Mge(),Osc=kMi(),Bsc=URr(),Lsc=QMi(),wre=HMi(),YMi=$Mi(),KMi=jRr(),$Rr=class{static{a(this,"DefaultLinesDiffComputer")}constructor(){this.dynamicProgrammingDiffing=new Osc.DynamicProgrammingDiffing,this.myersDiffingAlgorithm=new Bsc.MyersDiffAlgorithm}computeDiff(e,r,n){if(e.length<=1&&(0,Msc.equals)(e,r,(x,P)=>x===P))return new Oyt.LinesDiff([],[],!1);if(e.length===1&&e[0].length===0||r.length===1&&r[0].length===0)return new Oyt.LinesDiff([new Rre.DetailedLineRangeMapping(new Byt.LineRange(1,e.length+1),new Byt.LineRange(1,r.length+1),[new Rre.RangeMapping(new zMi.Range(1,1,e.length,e[e.length-1].length+1),new zMi.Range(1,1,r.length,r[r.length-1].length+1))])],[],!1);let o=n.maxComputationTimeMs===0?O4.InfiniteTimeout.instance:new O4.DateTimeout(n.maxComputationTimeMs),s=!n.ignoreTrimWhitespace,c=new Map;function l(x){let P=c.get(x);return P===void 0&&(P=c.size,c.set(x,P)),P}a(l,"getOrCreateHash");let u=e.map(x=>l(x.trim())),d=r.map(x=>l(x.trim())),f=new YMi.LineSequence(u,e),h=new YMi.LineSequence(d,r),m=f.length+h.length<1700?this.dynamicProgrammingDiffing.compute(f,h,o,(x,P)=>e[x]===r[P]?r[P].length===0?.1:1+Math.log(1+r[P].length):.99):this.myersDiffingAlgorithm.compute(f,h,o),g=m.diffs,A=m.hitTimeout;g=(0,wre.optimizeSequenceDiffs)(f,h,g),g=(0,wre.removeVeryShortMatchingLinesBetweenDiffs)(f,h,g);let y=[],E=a(x=>{if(s)for(let P=0;Px.seq1Range.start-_===x.seq2Range.start-v);let P=x.seq1Range.start-_;E(P),_=x.seq1Range.endExclusive,v=x.seq2Range.endExclusive;let D=this.refineDiff(e,r,x,o,s,n);D.hitTimeout&&(A=!0);for(let N of D.mappings)y.push(N)}E(e.length-_);let b=new Myt.ArrayText(e),T=new Myt.ArrayText(r),w=(0,Rre.lineRangeMappingFromRangeMappings)(y,b,T),R=[];return n.computeMoves&&(R=this.computeMoves(w,e,r,u,d,o,s,n)),(0,VMi.assertFn)(()=>{function x(D,N){if(D.lineNumber<1||D.lineNumber>N.length)return!1;let B=N[D.lineNumber-1];return!(D.column<1||D.column>B.length+1)}a(x,"validatePosition");function P(D,N){return!(D.startLineNumber<1||D.startLineNumber>N.length+1||D.endLineNumberExclusive<1||D.endLineNumberExclusive>N.length+1)}a(P,"validateRange");for(let D of w){if(!D.innerChanges)return!1;for(let N of D.innerChanges)if(!(x(N.modifiedRange.getStartPosition(),r)&&x(N.modifiedRange.getEndPosition(),r)&&x(N.originalRange.getStartPosition(),e)&&x(N.originalRange.getEndPosition(),e)))return!1;if(!P(D.modified,r)||!P(D.original,e))return!1}return!0}),new Oyt.LinesDiff(w,R,A)}computeMoves(e,r,n,o,s,c,l,u){return(0,Lsc.computeMovedLines)(e,r,n,o,s,c).map(h=>{let m=this.refineDiff(r,n,new O4.SequenceDiff(h.original.toOffsetRange(),h.modified.toOffsetRange()),c,l,u),g=(0,Rre.lineRangeMappingFromRangeMappings)(m.mappings,new Myt.ArrayText(r),new Myt.ArrayText(n),!0);return new Oyt.MovedText(h,g)})}refineDiff(e,r,n,o,s,c){let u=Fsc(n).toRangeMapping2(e,r),d=new KMi.LinesSliceCharSequence(e,u.originalRange,s),f=new KMi.LinesSliceCharSequence(r,u.modifiedRange,s),h=d.length+f.length<500?this.dynamicProgrammingDiffing.compute(d,f,o):this.myersDiffingAlgorithm.compute(d,f,o),m=!1,g=h.diffs;m&&O4.SequenceDiff.assertSorted(g),g=(0,wre.optimizeSequenceDiffs)(d,f,g),m&&O4.SequenceDiff.assertSorted(g),g=(0,wre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findWordContaining(E)),m&&O4.SequenceDiff.assertSorted(g),c.extendToSubwords&&(g=(0,wre.extendDiffsToEntireWordIfAppropriate)(d,f,g,(y,E)=>y.findSubWordContaining(E),!0),m&&O4.SequenceDiff.assertSorted(g)),g=(0,wre.removeShortMatches)(d,f,g),m&&O4.SequenceDiff.assertSorted(g),g=(0,wre.removeVeryShortMatchingTextBetweenLongDiffs)(d,f,g),m&&O4.SequenceDiff.assertSorted(g);let A=g.map(y=>new Rre.RangeMapping(d.translateRange(y.seq1Range),f.translateRange(y.seq2Range)));return m&&Rre.RangeMapping.assertSorted(A),{mappings:A,hitTimeout:h.hitTimeout}}};Lyt.DefaultLinesDiffComputer=$Rr;function Fsc(t){return new Rre.LineRangeMapping(new Byt.LineRange(t.seq1Range.start+1,t.seq1Range.endExclusive+1),new Byt.LineRange(t.seq2Range.start+1,t.seq2Range.endExclusive+1))}a(Fsc,"toLineRangeMapping")});var WRr=I(Ev=>{"use strict";p();Object.defineProperty(Ev,"__esModule",{value:!0});Ev.EditDataWithIndex=Ev.maxImperfectAgreementLength=Ev.maxAgreementOffset=void 0;Ev.tryRebase=Hsc;Ev.checkEditConsistency=ZMi;Ev.tryRebaseStringEdits=$sc;var Usc=xD(),Qsc=O_(),PE=hE(),Bge=sd(),JMi=AT(),qsc=VRr(),jsc=!1;Ev.maxAgreementOffset=10;Ev.maxImperfectAgreementLength=5;var Fyt=class{static{a(this,"EditDataWithIndex")}constructor(e){this.index=e}join(e){if(this.index===e.index)return this}};Ev.EditDataWithIndex=Fyt;function Hsc(t,e,r,n,o,s,c,l,u,d={maxImperfectAgreementLength:Ev.maxImperfectAgreementLength}){let f=Date.now();try{return Gsc(t,e,r,n,o,s,c,l,u,d)}catch(h){return u.trace(`Rebase error: ${Qsc.ErrorUtils.toString(h)}`),"error"}finally{u.trace(`Rebase duration: ${Date.now()-f}ms`)}}a(Hsc,"tryRebase");function Gsc(t,e,r,n,o,s,c,l,u,d){if(!ZMi(t,o,s,u,!0))return"inconsistentEdits";let f=o.removeCommonSuffixAndPrefix(t),h=c[0];if(e&&h&&!f.applyToOffsetRangeOrUndefined(e)?.containsRange(h))return"outsideEditWindow";if(n.lengthPE.AnnotatedStringEdit.create(E))),g=XMi(t,m,f,l,d);if(!g)return"rebaseFailed";let A=g.replacements.reduce((E,_)=>((E[_.data.index]||=[]).push(_),E),[]),y=[];for(let E=0;ER>0?s.substring(x[R-1].replaceRange.endExclusive,w.replaceRange.start)+w.newText:w.newText).join(""),T=PE.StringReplacement.replace(v,b);T.removeCommonSuffixAndPrefix(s).isEmpty||y.push({rebasedEdit:T,rebasedEditIndex:E})}return l==="strict"&&y.length>0&&new Usc.SingleEdits(r).apply(t)!==PE.StringEdit.create(y.map(E=>E.rebasedEdit)).apply(s)?(u.trace("Result consistency check failed"),"inconsistentEdits"):y}a(Gsc,"_tryRebase");function ZMi(t,e,r,n,o=jsc){if(!o)return!0;let s=e.apply(t)===r;return s||n.trace("Edit consistency check failed"),s}a(ZMi,"checkEditConsistency");function $sc(t,e,r,n,o={maxImperfectAgreementLength:Ev.maxImperfectAgreementLength}){return XMi(t,e.mapData(s=>new PE.VoidEditData),r,n,o)?.toStringEdit()}a($sc,"tryRebaseStringEdits");function XMi(t,e,r,n,o){let s=r.removeCommonSuffixAndPrefix(t),c=[],l=0,u=0,d=0;for(;uf.replaceRange.start){let g=t.substring(f.replaceRange.start,m.replaceRange.start),A=g+m.newText;A.endsWith(g)&&(m=new PE.AnnotatedStringReplacement(Bge.OffsetRange.fromTo(f.replaceRange.start,m.replaceRange.endExclusive-g.length),A.substring(0,A.length-g.length),m.data))}else if(u===e.replacements.length-1&&m.replaceRange.endExclusive=f.newText.length){let g=0,A=0,y=f,E;for(;y&&m.replaceRange.containsRange(y.replaceRange);){if(A=Ysc(t,m,y,E,A,n,o),A===-1)return;g+=y.newText.length-y.replaceRange.length,E=y,y=s.replacements[++l]}c.push(new PE.AnnotatedStringReplacement(new Bge.OffsetRange(m.replaceRange.start+d,m.replaceRange.endExclusive+d+g),m.newText,m.data)),u++,d+=g}else if(o.reverseAgreement&&h.replaceRange.equals(f.replaceRange)){let g=0,A;for(;uEv.maxAgreementOffset||b-g>0&&v.length>o.maxImperfectAgreementLength);if(b!==-1&&!T){g=b+v.length,A=y,u++;continue}let w=f.newText.substring(g);if(w.length>0&&v.startsWith(w)){let R=Math.max(0,w.length-_.length),x=y.newText.substring(R);x.length>0&&c.push(new PE.AnnotatedStringReplacement(Bge.OffsetRange.emptyAt(f.replaceRange.start+d+f.newText.length),x,y.data)),g=f.newText.length,A=y,u++;break}return}if(g0&&!f.newText.substring(g).startsWith(E))return}l++,d+=f.newText.length-f.replaceRange.length}else return;else if(h.replaceRange.start",'""',"''","``"]);function zsc(t){return Wsc.has(t)}a(zsc,"isAutoClosePair");function Ysc(t,e,r,n,o,s,c){let l=r.newText,u=n?n.replaceRange.endExclusive:e.replaceRange.start;uEv.maxAgreementOffset||d>0&&r.newText.length>c.maxImperfectAgreementLength);return d!==-1&&!f?d+r.newText.length:c.absorbSubsequenceTyping&&zsc(l)&&Vsc(l,e.newText.substring(o))?o:-1}a(Ysc,"agreementIndexOf");function Ksc(t,e,r,n,o){let s=t.split(/\r\n|\r|\n/),c=e.split(/\r\n|\r|\n/),u=new qsc.DefaultLinesDiffComputer().computeDiff(s,c,o);if(u.hitTimeout)return;let d=new JMi.StringText(t),f=new JMi.StringText(e);return u.changes.map(h=>(h.innerChanges||[]).map(m=>{let g=d.getTransformer().getOffsetRange(m.originalRange),A=f.getValueOfRange(m.modifiedRange);return new PE.AnnotatedStringReplacement(g.delta(r),A,n)})).flat()}a(Ksc,"computeDiff")});var tOi=I(Uyt=>{"use strict";p();Object.defineProperty(Uyt,"__esModule",{value:!0});Uyt.RejectionCollector=void 0;var Jsc=P5(),eOi=Io(),Zsc=m2(),zRr=class extends eOi.Disposable{static{a(this,"RejectionCollector")}constructor(e,r){super(),this.workspace=e,this._garbageCollector=this._register(new JRr(20)),this._documentCaches=new Map,this._logger=r.createSubLogger(["NES","RejectionCollector"]),(0,Zsc.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=new YRr(n,this._garbageCollector,this._logger);this._documentCaches.set(s.doc.id,s),o.add((0,Jsc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},c=>{for(let l of c.value.changes)s.handleEdit(l,c.value.value)})),o.add((0,eOi.toDisposable)(()=>{this._documentCaches.delete(n.id)}))}).recomputeInitiallyAndOnChange(this._store)}reject(e,r){let n=this._documentCaches.get(e);if(!n){this._logger.trace(`Rejecting, no document cache: ${r}`);return}let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value);this._logger.trace(`Rejecting: ${o}`),n.reject(o)}isRejected(e,r){let n=this._documentCaches.get(e);if(!n)return this._logger.trace(`Checking rejection, no document cache: ${r}`),!1;let o=r.removeCommonSuffixAndPrefix(n.doc.value.get().value),s=n.isRejected(o);return this._logger.trace(`Checking rejection, ${s?"rejected":"not rejected"}: ${o}`),s}clear(){this._garbageCollector.clear()}};Uyt.RejectionCollector=zRr;var YRr=class{static{a(this,"DocumentRejectionTracker")}constructor(e,r,n){this.doc=e,this._garbageCollector=r,this._logger=n,this._rejectedEdits=new Set}handleEdit(e,r){for(let n of[...this._rejectedEdits])n.handleEdit(e,r)}reject(e){if(this.isRejected(e))return;let r=new KRr(e.toEdit(),()=>{this._logger.trace(`Evicting: ${e}`),this._rejectedEdits.delete(r)});this._rejectedEdits.add(r),this._garbageCollector.put(r)}isRejected(e){for(let r of this._rejectedEdits)if(r.isRejected(e))return!0;return!1}},KRr=class{static{a(this,"RejectedEdit")}constructor(e,r){this._edit=e,this._onDispose=r}handleEdit(e,r){let n=this._edit.tryRebase(e);n?this._edit=n.removeCommonSuffixAndPrefix(r.value):this.dispose()}isRejected(e){return this._edit.equals(e.toEdit())}dispose(){this._onDispose()}},JRr=class{static{a(this,"LRUGarbageCollector")}constructor(e){this._maxSize=e,this._disposables=[]}put(e){this._disposables.push(e),this._disposables.length>this._maxSize&&this._disposables.shift().dispose()}clear(){for(let e of this._disposables)e.dispose();this._disposables=[]}dispose(){this.clear()}}});var rOi=I(qyt=>{"use strict";p();Object.defineProperty(qyt,"__esModule",{value:!0});qyt.RebaseFailureInfo=void 0;var Xsc=hE(),ZRr=class{static{a(this,"RebaseFailureInfo")}constructor(e,r,n,o,s,c,l){this.originalDocument=e,this.editWindow=r,this.originalEdits=n,this.userEditSince=o,this.currentDocument=s,this.currentSelection=c,this.nesRebaseConfigs=l}toMarkdown(){let e=[];e.push("### Original Document"),e.push("```"),e.push(this.originalDocument),e.push("```"),e.push(""),e.push("### Suggested Edits");for(let r=0;r0&&(e.push(""),e.push(`### Cursor: ${this.currentSelection.map(r=>r.toString()).join(", ")}`)),e.push(""),e.push("### Document Intended After Suggested Edits"),e.push("```");try{let r=new Xsc.StringEdit(this.originalEdits.slice()).apply(this.originalDocument);e.push(r)}catch{e.push("")}return e.push("```"),e.push(""),e.push("### Copy-Pasteable Test"),e.push("```typescript"),e.push(this._generateTest()),e.push("```"),e.join(` +`)}_generateTest(){let e=[];e.push("test('rebase failure (auto-generated)', () => {"),e.push(` const originalDocument = ${Qyt(this.originalDocument)};`),e.push(" const originalEdits = [");for(let o of this.originalEdits)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Qyt(o.newText)}),`);e.push(" ];"),e.push(" const userEditSince = StringEdit.create([");for(let o of this.userEditSince.replacements)e.push(` StringReplacement.replace(new OffsetRange(${o.replaceRange.start}, ${o.replaceRange.endExclusive}), ${Qyt(o.newText)}),`);e.push(" ]);"),e.push(` const currentDocumentContent = ${Qyt(this.currentDocument)};`),this.editWindow?e.push(` const editWindow = new OffsetRange(${this.editWindow.start}, ${this.editWindow.endExclusive});`):e.push(" const editWindow = undefined;"),e.push(` const currentSelection = [${this.currentSelection.map(o=>`new OffsetRange(${o.start}, ${o.endExclusive})`).join(", ")}];`);let r=[];return this.nesRebaseConfigs.absorbSubsequenceTyping&&r.push(`absorbSubsequenceTyping: ${this.nesRebaseConfigs.absorbSubsequenceTyping}`),this.nesRebaseConfigs.reverseAgreement&&r.push(`reverseAgreement: ${this.nesRebaseConfigs.reverseAgreement}`),r.push(`maxImperfectAgreementLength: ${this.nesRebaseConfigs.maxImperfectAgreementLength}`),e.push(` const nesConfigs = { ${r.join(", ")} };`),e.push(""),e.push(" const logger = new TestLogService();"),e.push(" expect(userEditSince.apply(originalDocument)).toBe(currentDocumentContent);"),e.push(" expect(tryRebase(originalDocument, editWindow, originalEdits, [], userEditSince, currentDocumentContent, currentSelection, 'strict', logger, nesConfigs)).toMatchInlineSnapshot();"),e.push("});"),e.join(` +`)}};qyt.RebaseFailureInfo=ZRr;function Qyt(t){return"`"+t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")+"`"}a(Qyt,"toBacktickLiteral")});var iOi=I(Hyt=>{"use strict";p();Object.defineProperty(Hyt,"__esModule",{value:!0});Hyt.NextEditCache=void 0;var X5e=Sl(),eac=P5(),tac=o8t(),nOi=Io(),rac=BF(),jyt=WRr(),nac=rOi(),XRr=class extends nOi.Disposable{static{a(this,"NextEditCache")}constructor(e,r,n,o){super(),this.workspace=e,this._logService=r,this._configService=n,this._expService=o,this._documentCaches=new Map,this._sharedCache=new tac.LRUCache(50),(0,rac.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{let l=new ePr(this,s.id,s,this._sharedCache,this._logService);this._documentCaches.set(l.docId,l),c.add((0,eac.autorunWithChanges)(this,{value:s.value},u=>{for(let d of u.value.changes)d.isEmpty()||l.handleEdit(d);if(this._configService.getExperimentBasedConfig(X5e.ConfigKey.Advanced.InlineEditsTriggerOnEditorChangeAfterSeconds,this._expService)!==void 0)for(let[d,f]of this._sharedCache.entries())f.docId!==s.id&&this._sharedCache.deleteKey(d)})),c.add((0,nOi.toDisposable)(()=>{this._documentCaches.delete(s.id)}))}).recomputeInitiallyAndOnChange(this._store)}setKthNextEdit(e,r,n,o,s,c,l,u,d){let f=this._documentCaches.get(e);if(f)return f.setKthNextEdit(r,n,o,c,l,s,u,d)}setNoNextEdit(e,r,n,o){let s=this._documentCaches.get(e);s&&s.setNoNextEdit(r,n,o)}_getNesRebaseConfigs(){let e=this._configService.getExperimentBasedConfig(X5e.ConfigKey.TeamInternal.InlineEditsMaxImperfectAgreementLength,this._expService);return{absorbSubsequenceTyping:this._configService.getExperimentBasedConfig(X5e.ConfigKey.TeamInternal.InlineEditsAbsorbSubsequenceTyping,this._expService),reverseAgreement:this._configService.getExperimentBasedConfig(X5e.ConfigKey.TeamInternal.InlineEditsReverseAgreement,this._expService),maxImperfectAgreementLength:typeof e=="number"?Math.max(0,e):e}}lookupNextEdit(e,r,n){let o=this._documentCaches.get(e);if(!o)return;let s=this._configService.getExperimentBasedConfig(X5e.ConfigKey.TeamInternal.InlineEditsCacheCursorDistanceCheck,this._expService)??!1;return o.lookupNextEdit(r,n,this._getNesRebaseConfigs(),s)}tryRebaseCacheEntry(e,r,n){let o=this._documentCaches.get(e.docId);return o?o.tryRebaseCacheEntry(e,r,n,this._getNesRebaseConfigs()):{edit:void 0}}rejectedNextEdit(e){this._sharedCache.getValues().filter(r=>r.source.headerRequestId===e).forEach(r=>r.rejected=!0)}isRejectedNextEdit(e,r,n){let o=this._documentCaches.get(e);return o?o.isRejectedNextEdit(r,n):!1}evictedCachedEdit(e){let r=this._documentCaches.get(e.docId);r&&r.evictedCachedEdit(e)}clear(){this._documentCaches.forEach(e=>e.clear()),this._sharedCache.clear()}};Hyt.NextEditCache=XRr;var ePr=class{static{a(this,"DocumentEditCache")}constructor(e,r,n,o,s){this._nextEditCache=e,this.docId=r,this._doc=n,this._sharedCache=o,this._trackedCachedEdits=[],this._logger=s.createSubLogger(["NES","DocumentEditCache"])}handleEdit(e){let r=this._logger.createSubLogger("handleEdit");for(let n of this._trackedCachedEdits)n.userEditSince&&(n.userEditSince=n.userEditSince.compose(e),n.rebaseFailed=!1,(0,jyt.checkEditConsistency)(n.documentBeforeEdit.value,n.userEditSince,this._doc.value.get().value,r)||(n.userEditSince=void 0))}evictedCachedEdit(e){let r=this._trackedCachedEdits.indexOf(e);r!==-1&&this._trackedCachedEdits.splice(r,1)}clear(){this._trackedCachedEdits.length=0}setKthNextEdit(e,r,n,o,s,c,l,u){let d=this._getKey(e.value),f={docId:this.docId,edit:n,edits:o,detailedEdits:[],userEditSince:s,subsequentN:c,source:l,documentBeforeEdit:e,editWindow:r,originalEditWindow:u.originalEditWindow,cacheTime:Date.now(),isFromCursorJump:u.isFromCursorJump,cursorOffsetAtCacheTime:u.cursorOffset};s&&((0,jyt.checkEditConsistency)(f.documentBeforeEdit.value,s,this._doc.value.get().value,this._logger.createSubLogger("setKthNextEdit"))?this._trackedCachedEdits.unshift(f):f.userEditSince=void 0);let h=this._sharedCache.get(d);h&&this.evictedCachedEdit(h);let m=this._sharedCache.put(d,f);return m&&this._nextEditCache.evictedCachedEdit(m[1]),f}setNoNextEdit(e,r,n){let o=this._getKey(e.value),s={docId:this.docId,edit:void 0,edits:[],detailedEdits:[],source:n,documentBeforeEdit:e,editWindow:r,cacheTime:Date.now(),isFromCursorJump:!1},c=this._sharedCache.get(o);c&&this.evictedCachedEdit(c);let l=this._sharedCache.put(o,s);l&&this._nextEditCache.evictedCachedEdit(l[1])}lookupNextEdit(e,r,n,o=!1){let s=this._getKey(e.value),c=this._sharedCache.get(s);if(c){let l=c.editWindow,u=c.originalEditWindow,d=r[0],f=l?.containsRange(d),h=u?.containsRange(d);if(l&&!f&&!h)return;if(o&&c.edit&&(c.subsequentN===void 0||c.subsequentN===0)&&c.cursorOffsetAtCacheTime!==void 0&&d){let m=e.getTransformer(),g=m.getPosition(c.edit.replaceRange.start).lineNumber,A=m.getPosition(c.cursorOffsetAtCacheTime).lineNumber,y=m.getPosition(d.start).lineNumber;if(Math.abs(y-g)>Math.abs(A-g))return c.rejected=!0,c}return c}for(let l of this._trackedCachedEdits){let u=this.tryRebaseCacheEntry(l,e,r,n);if(u.edit)return u.edit}}tryRebaseCacheEntry(e,r,n,o){let s=this._logger.createSubLogger("tryRebaseCacheEntry");if(e.userEditSince&&!e.rebaseFailed){let c=e.edits||(e.edit?[e.edit]:[]),l=e.originalEditWindow?[e.editWindow,e.originalEditWindow]:[e.editWindow];for(let u of l){let d=(0,jyt.tryRebase)(e.documentBeforeEdit.value,u,c,e.detailedEdits,e.userEditSince,r.value,n,"strict",s,o);if(d==="rebaseFailed")return e.rebaseFailed=!0,{edit:void 0,failureInfo:new nac.RebaseFailureInfo(e.documentBeforeEdit.value,u,c,e.userEditSince,r.value,n,o)};if(d==="inconsistentEdits"||d==="error")return e.userEditSince=void 0,{edit:void 0};if(d==="outsideEditWindow")continue;if(d.length)return!e.rejected&&this.isRejectedNextEdit(r,d[0].rebasedEdit)&&(e.rejected=!0),{edit:{...e,...d[0],baseCacheEntry:e}};if(!c.length)return{edit:e}}}return{edit:void 0}}isRejectedNextEdit(e,r){let n=this._logger.createSubLogger("isRejectedNextEdit"),o=r.removeCommonSuffixAndPrefix(e.value);for(let s of this._trackedCachedEdits.filter(c=>c.rejected)){if(!s.userEditSince)continue;let c=s.edits||(s.edit?[s.edit]:[]);if(!c.length)continue;let l=(0,jyt.tryRebase)(s.documentBeforeEdit.value,void 0,c,s.detailedEdits,s.userEditSince,e.value,[],"lenient",n);if(typeof l=="string")continue;if(l.some(d=>d.rebasedEdit.removeCommonSuffixAndPrefix(e.value).equals(o)))return n.trace("Found rejected edit that matches current edit"),!0}return!1}_getKey(e){return JSON.stringify([this.docId.uri,e])}}});var oOi=I(Gyt=>{"use strict";p();Object.defineProperty(Gyt,"__esModule",{value:!0});Gyt.NextEditResult=void 0;var tPr=class{static{a(this,"NextEditResult")}constructor(e,r,n){this.requestId=e,this.source=r,this.result=n}};Gyt.NextEditResult=tPr});var sOi=I($yt=>{"use strict";p();Object.defineProperty($yt,"__esModule",{value:!0});$yt.SpeculativeRequestManager=void 0;var iac=Io(),rPr=class extends iac.Disposable{static{a(this,"SpeculativeRequestManager")}constructor(e){super(),this._logger=e,this._pending=null,this._scheduled=null}get pending(){return this._pending}setPending(e){this._pending&&this._pending.request!==e.request&&this._cancelPending("replaced"),this._pending=e}consumePending(){this._pending=null}schedule(e){this._scheduled=e}clearScheduled(){this._scheduled=null}consumeScheduled(e){if(this._scheduled?.headerRequestId!==e)return null;let r=this._scheduled;return this._scheduled=null,r}cancelAll(e){this._scheduled=null,this._cancelPending(e)}cancelIfMismatch(e,r,n){this._pending&&(this._pending.docId!==e||this._pending.postEditContent!==r)&&this._cancelPending(n)}onDocumentClosed(e){this._scheduled?.suggestion.result?.targetDocumentId===e&&(this._scheduled=null),this._pending?.docId===e&&this._cancelPending("documentClosed")}onActiveDocumentChanged(e,r){let n=this._pending;if(!n||n.docId!==e)return;if(r.length{"use strict";p();var oac=FT&&FT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},e4e=FT&&FT.__param||function(t,e){return function(r,n){e(r,n,t)}},nPr;Object.defineProperty(FT,"__esModule",{value:!0});FT.NextEditFetchRequest=FT.NextEditProvider=FT.NesOutcome=void 0;var sac=require("path"),_v=Sl(),Lge=xD(),n4e=Ayt(),t4e=ZA(),aac=Zut(),If=bge(),cac=P5(),iPr=Ap(),lac=yMi(),uac=Rge(),dac=TRr(),fac=_p(),r4e=O_(),Fg=Hx(),aOi=Gu(),Vyt=zc(),pac=R$e(),aPr=bs(),Wyt=Io(),cOi=m2(),lOi=NM(),hac=dS(),hOi=fm(),uOi=VH(),Pre=hE(),mac=T_(),oPr=sd(),dOi=AT(),gac=WRr(),Aac=tOi(),yac=iOi(),zyt=oOi(),Eac=sOi();function _ac(t,e,r){if(!e)return t;let n=e.endExclusive,o=r.getTransformer(),s=o.getPosition(n),c=o.getOffset(s.with(void 0,1)),l=o.getOffset(s.with(void 0,o.getLineLength(s.lineNumber)+1)),u=o.getOffset(o.getPosition(t.start).delta(1)),d=o.getPosition(t.endExclusive).delta(-2),f=o.getOffset(d.column>1?d.with(void 0,o.getLineLength(d.lineNumber)+1):d);return new oPr.OffsetRange(Math.min(u,c),Math.max(f,l))}a(_ac,"computeReducedWindow");function fOi(t,e){let n=new n4e.RootedLineEdit(e,t).toEdit();return e.value.includes(`\r +`)?new Pre.StringEdit(n.replacements.map(o=>new Pre.StringReplacement(o.replaceRange,o.newText.replace(/\n/g,`\r +`)))):n}a(fOi,"convertLineEditToEdit");function pOi(t,e){return new pac.CachedFunction(n=>{let o=t.find(s=>s.nextEditDoc.id===n);if(!o){for(let s=e.length-1;s>=0;s--){let c=e[s];if(c.docId===n&&c.kind==="edit"){let l=c.edit.getEditedState();return{baseDocState:l,docContents:l,editsSoFar:Pre.StringEdit.empty,nextEdits:[],docId:n}}}throw new aPr.BugIndicatingError}return{baseDocState:o.documentAfterEdits,docContents:o.documentAfterEdits,editsSoFar:Pre.StringEdit.empty,nextEdits:[],docId:n}})}a(pOi,"createDocStateLookupMap");var i4e;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(i4e||(FT.NesOutcome=i4e={}));var sPr=nPr=class extends Wyt.Disposable{static{a(this,"NextEditProvider")}get lastRejectionTime(){return this._lastRejectionTime}get lastTriggerTime(){return this._lastTriggerTime}get lastOutcome(){return this._lastOutcome}constructor(e,r,n,o,s,c,l,u,d,f){super(),this._workspace=e,this._statelessNextEditProvider=r,this._historyContextProvider=n,this._xtabHistoryTracker=o,this._debugRecorder=s,this._configService=c,this._snippyService=l,this._logService=u,this._expService=d,this._requestLogger=f,this.ID=this._statelessNextEditProvider.ID,this._rejectionCollector=this._register(new Aac.RejectionCollector(this._workspace,this._logService)),this._pendingStatelessNextEditRequest=null,this._lastShownTime=0,this._lastShownSuggestionId=void 0,this._lastRejectionTime=0,this._lastTriggerTime=0,this._shouldExpandEditWindow=!1,this._logger=this._logService.createSubLogger(["NES","NextEditProvider"]),this._nextEditCache=new yac.NextEditCache(this._workspace,this._logService,this._configService,this._expService),this._specManager=this._register(new Eac.SpeculativeRequestManager(this._logger.createSubLogger("SpeculativeRequestManager"))),(0,cOi.mapObservableArrayCached)(this,this._workspace.openDocuments,(h,m)=>{m.add((0,cOi.runOnChange)(h.value,g=>{this._cancelPendingRequestDueToDocChange(h.id,g)})),m.add((0,Wyt.toDisposable)(()=>this._specManager.onDocumentClosed(h.id)))}).recomputeInitiallyAndOnChange(this._store)}_cancelPendingRequestDueToDocChange(e,r){if(this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService)||this._pendingStatelessNextEditRequest===null)return;let o=this._pendingStatelessNextEditRequest.getActiveDocument();o.id===e&&o.documentAfterEdits.value!==r.value&&this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel()}async getNextEdit(e,r,n,o,s){let c=Date.now();this._lastTriggerTime=c;let l=new lOi.StopWatch,u=this._logger.createSubLogger(r.requestUuid.substring(4,8)).withExtraTarget(iPr.LogTarget.fromCallback((h,m)=>{n.trace(`[${Math.floor(l.elapsed()).toString().padStart(4," ")}ms] ${m}`)})),d=this._shouldExpandEditWindow;n.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let f;try{f=await this._getNextEditCanThrow(e,r,c,d,u,n,o,s)}catch(h){throw n.setError(h),s.setNextEditProviderError(r4e.ErrorUtils.toString(h)),h}finally{s.markEndTime()}return this._lastNextEditResult=f,f}async _getNextEditCanThrow(e,r,n,o,s,c,l,u){let d=s.createSubLogger("_getNextEdit");d.trace(`invoked with trigger id = ${r.changeHint===void 0?"undefined":`uuid = ${r.changeHint.data.uuid}, reason = ${r.changeHint.data.reason}`}`);let f=this._workspace.getDocument(e);if(!f)throw d.trace(`Document "${e.baseName}" not found`),new aPr.BugIndicatingError(`Document "${e.baseName}" not found`);let h=f.value.get(),m=f.selection.get(),g=this.determineNesConfigs(u,c),A=this._nextEditCache.lookupNextEdit(e,h,m);if(A?.rejected){d.trace("cached edit was previously rejected"),u.setStatus("previouslyRejectedCache"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected();let B=A.rebasedEdit??A.edit;return B&&this._rejectionCollector.reject(e,B),new zyt.NextEditResult(c.requestId,A.source,void 0)}let y,E,_,v,b=e,T=!1,w=!1,R=!1,x;if(A){d.trace("using cached edit");let B=A.rebasedEdit||A.edit;B&&(y={actualEdit:B,isFromCursorJump:A.isFromCursorJump}),T=!!A.rebasedEdit,w=A.subsequentN!==void 0&&A.subsequentN>0,R=A.source.isSpeculative,v=A.source,c.setIsCachedResult(A.source.log),E=h,u.setHeaderRequestId(v.headerRequestId),u.setIsFromCache(),u.setSubsequentEditOrder(A.rebasedEditIndex??A.subsequentN),c.recordingBookmark=v.log.recordingBookmark,x=A.baseCacheEntry??A}else{d.trace(`fetching next edit with shouldExpandEditWindow=${o}`);let B=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsDebounceUseCoreRequestTime,this._expService)?r.requestIssuedDateTime??void 0:void 0;v=new o4e(r.requestUuid,c,B,!1),u.setHeaderRequestId(v.headerRequestId);let L=f.value.get();d.trace("awaiting firstEdit promise");let j=await this.fetchNextEdit(v,f,g,o,d,u,l);d.trace("resolved firstEdit promise");let M=`First edit latency: ${Date.now()-this._lastTriggerTime} ms`;if(c.addLog(M),d.trace(M),j.isError())d.trace(`failed to fetch next edit ${j.err.toString()}`),u.setStatus(`noEdit:${j.err.kind}`),_=j.err;else if(b=j.val.docId??b,E=(b?this._workspace.getDocument(b):f).value.get(),b===f.id&&L.value!==E.value)d.trace("document changed while fetching next edit"),u.setStatus("docChanged"),c.setIsSkipped();else{let Q=j.val.rebasedEdit||j.val.edit;Q?(d.trace("fetch succeeded"),c.setResponseResults([Q]),y={actualEdit:Q,isFromCursorJump:j.val.isFromCursorJump},R=j.val.isFromSpeculativeRequest??!1,x=j.val.baseCacheEntry??j.val):(d.trace("empty edits"),u.setStatus("emptyEdits"))}}if(_ instanceof If.NoNextEditReason.FetchFailure||_ instanceof If.NoNextEditReason.Unexpected)throw d.trace(`has throwing error: ${_.error}`),_.error;if(_ instanceof If.NoNextEditReason.NoSuggestions)if(_.nextCursorPosition===void 0)c.markAsNoSuggestions();else return u.setStatus("emptyEditsButHasNextCursorPosition"),new zyt.NextEditResult(c.requestId,v,{jumpToPosition:_.nextCursorPosition,targetDocumentId:_.nextCursorDocumentId,documentBeforeEdits:h,isFromCursorJump:!1,isSubsequentEdit:!1});else _ instanceof If.NoNextEditReason.GotCancelled&&c.setIsSkipped();let P=new zyt.NextEditResult(c.requestId,v,void 0);if(!y)return d.trace("had no edit"),P;if(l.isCancellationRequested)return d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P;if(this._rejectionCollector.isRejected(b,y.actualEdit)||E&&this._nextEditCache.isRejectedNextEdit(b,E,y.actualEdit))return d.trace("edit was previously rejected"),u.setStatus("previouslyRejected"),u.setWasPreviouslyRejected(),c.markAsPreviouslyRejected(),P;c.setResult(n4e.RootedLineEdit.fromEdit(new Lge.RootedEdit(h,new Pre.StringEdit([y.actualEdit])))),(0,aOi.assert)(E!==void 0,"should be defined if edit is defined"),u.setStatus("notAccepted");let D=new zyt.NextEditResult(c.requestId,v,{edit:y.actualEdit,isFromCursorJump:y.isFromCursorJump,documentBeforeEdits:E,targetDocumentId:b,isSubsequentEdit:w,cacheEntry:x});u.setHasNextEdit(!0);let N=this.computeMinimumResponseDelay({triggerTime:n,isRebasedCachedEdit:T,isSubsequentCachedEdit:w,isFromSpeculativeRequest:R,enforceCacheDelay:r.enforceCacheDelay},d);return N>0&&(await(0,Vyt.timeout)(N),l.isCancellationRequested)?(d.trace("cancelled"),u.setStatus("noEdit:gotCancelled"),P):(d.trace("returning next edit result"),D)}determineNesConfigs(e,r){let n={isAsyncCompletions:this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsAsyncCompletions,this._expService),isEagerBackupRequest:this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsEagerBackupRequest,this._expService)};return e.setNESConfigs({...n}),r.addCodeblockToLog(JSON.stringify(n,null," ")),n}_processDoc(e){let r=e.lastEdit.base.getLines(),n=e.lastEdits,o=n4e.RootedLineEdit.fromEdit(new Lge.RootedEdit(e.lastEdit.base,e.lastEdits.compose())).removeCommonSuffixPrefixLines().edit,s=e.lastEdit.base,c=e.lastSelection,l=this._workspace.getWorkspaceRoot(e.docId),u=new If.StatelessNextEditDocument(e.docId,l,e.languageId,r,o,s,n,c);return{recentEdit:e.lastEdit,nextEditDoc:u,documentAfterEdits:u.documentAfterEdits}}async fetchNextEdit(e,r,n,o,s,c,l){let u=r.id,d=s.createSubLogger("fetchNextEdit"),f=this._historyContextProvider.getHistoryContext(u);if(!f)return Fg.Result.error(new If.NoNextEditReason.Unexpected(new Error("DocumentMissingInHistoryContext")));let h=r.value.get(),m=r.selection.get(),g=e.log;g.setRecentEdit(f);let A=m.at(0),y=a(N=>!N.requestEditWindow||!A||N.requestEditWindow.containsCursor(A),"cursorInRequestEditWindow"),E=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value,_=!this._pendingStatelessNextEditRequest||y(this._pendingStatelessNextEditRequest),v=(E||n.isAsyncCompletions)&&_&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0,b=this._specManager.pending,T=b?.docId===u&&b?.postEditContent===h.value&&!b.request.cancellationTokenSource.token.isCancellationRequested&&y(b.request),w=T?b?.request:void 0,R=w??v;if(R){w?(d.trace(`reusing speculative pending request (opportunityId=${w.opportunityId}, headerRequestId=${w.headerRequestId})`),this._specManager.consumePending()):d.trace(`reusing in-flight pending request (opportunityId=${R.opportunityId}, headerRequestId=${R.headerRequestId})`);let N=w?T:E,B=w?"speculative":"async";if(N){let L=await this._joinNextEditRequest(R,B,c,g,l);return c.setStatelessNextEditTelemetry(L.telemetry),w?(await R.firstEdit.p).map(M=>({...M,isFromSpeculativeRequest:!0})):L.nextEdit.isError()?L.nextEdit:R.firstEdit.p}else if(n.isEagerBackupRequest){d.trace("starting eager backup request in parallel with rebase attempt"),this._pendingStatelessNextEditRequest=null;let L=this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),j=a(()=>{L.then(Q=>Q.nextEditRequest.cancellationTokenSource.cancel()).catch(()=>{})},"cancelBackupRequest"),M=await this._joinNextEditRequest(R,B,c,g,l),O=await R.firstEdit.p;if(O.isOk()&&O.val.edit){let Q=this._nextEditCache.tryRebaseCacheEntry(O.val,h,m);if(Q.edit)return d.trace("rebase succeeded, cancelling eager backup request"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Fg.Result.ok(Q.edit);this._logRebaseFailure(Q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("cancelled after rebase failed (eager backup path)"),j(),c.setStatelessNextEditTelemetry(M.telemetry),Fg.Result.error(new If.NoNextEditReason.GotCancelled("afterFailedRebase"));d.trace("rebase failed, using eager backup request");let q=await L;return c.setStatelessNextEditTelemetry(q.nextEditResult.telemetry),q.nextEditResult.nextEdit.isError()?q.nextEditResult.nextEdit:q.nextEditRequest.firstEdit.p}else{let L=await this._joinNextEditRequest(R,B,c,g,l),j=await R.firstEdit.p;if(j.isOk()&&j.val.edit){let q=this._nextEditCache.tryRebaseCacheEntry(j.val,h,m);if(q.edit)return c.setStatelessNextEditTelemetry(L.telemetry),Fg.Result.ok(q.edit);this._logRebaseFailure(q.failureInfo,g)}if(l.isCancellationRequested)return d.trace("document changed after rebase failed"),c.setStatelessNextEditTelemetry(L.telemetry),Fg.Result.error(new If.NoNextEditReason.GotCancelled("afterFailedRebase"));let O=h.value===this._pendingStatelessNextEditRequest?.documentBeforeEdits.value&&!this._pendingStatelessNextEditRequest?.cancellationTokenSource.token.isCancellationRequested&&this._pendingStatelessNextEditRequest||void 0;if(O){d.trace("reusing 2nd existing next edit request after rebase failed");let q=await this._joinNextEditRequest(O,"async",c,g,l);return c.setStatelessNextEditTelemetry(q.telemetry),q.nextEdit.isError()?q.nextEdit:O.firstEdit.p}d.trace("creating new next edit request after rebase failed")}}let x=await this._executeNewNextEditRequest(e,r,f,n,o,d,c,l),P=x.nextEditRequest,D=x.nextEditResult;return c.setStatelessNextEditTelemetry(D.telemetry),D.nextEdit.isError()?D.nextEdit:P.firstEdit.p}async _joinNextEditRequest(e,r,n,o,s){n.setHeaderRequestId(e.headerRequestId),n.setReusedRequest(r),n.setRequest(e),o.setRequestInput(e),o.setIsReusedInFlightResult(e.logContext);let c=this._hookupCancellation(e,s);try{return await e.result}finally{c.dispose()}}_logRebaseFailure(e,r){e&&r.setRebaseFailure(e)}async _executeNewNextEditRequest(e,r,n,o,s,c,l,u){let d=r.id,f=c.createSubLogger("_executeNewNextEditRequest"),h=this._debugRecorder?.getRecentLog(),m=e.log,g=vac(n.getDocumentAndIdx(d)),A=r.selection.get()[0],y=n.documents.map(L=>this._processDoc(L)),E=this._xtabHistoryTracker.getHistory(),_=new Vyt.DeferredPromise,v=s?this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0,b=new If.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,r.value.get(),y.map(L=>L.nextEditDoc),g.idx,E,_,v,!1,m,e.log.recordingBookmark,h,e.providerRequestStartDateTime),T;this._pendingStatelessNextEditRequest&&(this._pendingStatelessNextEditRequest.cancellationTokenSource.cancel(),this._pendingStatelessNextEditRequest=null,this._specManager.clearScheduled()),this._specManager.cancelIfMismatch(d,b.documentBeforeEdits.value,"superseded"),this._pendingStatelessNextEditRequest=b;let w=a(()=>{this._pendingStatelessNextEditRequest===b&&(this._pendingStatelessNextEditRequest=null)},"removeFromPending");l.setRequest(b),l.setStatus("requested"),m.setRequestInput(b);let R=this._hookupCancellation(b,u,o.isAsyncCompletions?(0,cac.autorunWithChanges)(this,{value:r.value},L=>{L.value.changes.forEach(j=>{b.intermediateUserEdit&&!j.isEmpty()&&(b.intermediateUserEdit=b.intermediateUserEdit.compose(j),(0,gac.checkEditConsistency)(b.documentBeforeEdits.value,b.intermediateUserEdit,L.value.value.value,f)||(b.intermediateUserEdit=void 0))})}):void 0),x=pOi(y,E),P=this._statelessNextEditProvider.provideNextEdit(b,f,m,b.cancellationTokenSource.token),D=-1,N=a((L,j)=>{++D;let M=f.createSubLogger("processEdit");M.trace(`processing edit #${D} (starts at 0)`),M.trace("resetting shouldExpandEditWindow to false due to receiving an edit"),this._shouldExpandEditWindow=!1;let O=x.get(L.targetDocument??d),q=L.edit,Q=new uOi.LineEdit([q]),z=fOi(Q,O.baseDocState).tryRebase(O.editsSoFar);if(z===void 0){M.trace(`edit ${D} is undefined after rebasing`),_.isSettled||_.complete(Fg.Result.error(new If.NoNextEditReason.Uncategorized(new Error("Rebased edit is undefined"))));return}O.editsSoFar=O.editsSoFar.compose(z);let W;if(z.replacements.length===0)M.trace(`WARNING: ${D} has no edits`);else if(z.replacements.length>1)M.trace(`WARNING: ${D} has ${z.replacements.length} edits, but expected only 1`);else{let $=z.replacements[0];O.nextEdits.push($),W=this._nextEditCache.setKthNextEdit(O.docId,O.docContents,D===0?L.window:void 0,$,D,D===0?O.nextEdits:void 0,D===0?b.intermediateUserEdit:void 0,e,{isFromCursorJump:L.isFromCursorJump,originalEditWindow:L.originalWindow,cursorOffset:O.docId===d?A?.start:void 0}),M.trace(`populated cache for ${D}`)}return _.isSettled||(M.trace("resolving firstEdit promise"),m.setResult(new n4e.RootedLineEdit(O.docContents,Q)),_.complete(W?Fg.Result.ok(W):Fg.Result.error(new If.NoNextEditReason.Unexpected(new Error("No cached edit"))))),O.docContents=z.applyOnText(O.docContents),W},"processEdit"),B=a((L,j)=>{let M=f.createSubLogger("streamEnd");if(D===-1&&L instanceof If.NoNextEditReason.NoSuggestions&&(M.trace("resetting shouldExpandEditWindow to false due to NoSuggestions"),this._shouldExpandEditWindow=!1),x.get(d).nextEdits.length)M.trace(`${x.get(d).nextEdits.length} edits returned`);else if(M.trace(`no edit, reason: ${L.kind}`),L instanceof If.NoNextEditReason.NoSuggestions){let{documentBeforeEdits:z,window:W}=L,$=W?_ac(W,A,z):void 0;this._nextEditCache.setNoNextEdit(d,z,$,e)}_.isSettled||_.complete(Fg.Result.error(L));let q=x.get(d).nextEdits.length>0?Fg.Result.ok(void 0):Fg.Result.error(L),Q=new If.StatelessNextEditResult(q,j);b.setResult(Q),R.dispose(),w();let U=this._specManager.consumeScheduled(b.headerRequestId);return U&&this._triggerSpeculativeRequest(U.suggestion),Q},"handleStreamEnd");try{let L=await P.next();if(L.done){let j=L.value.v;T=B(j,L.value.telemetryBuilder)}else{let j=L.value.v,M=L.value.telemetryBuilder;N(j,M),(async()=>{try{for(L=await P.next();!L.done;){let q=L.value.v;N(q,L.value.telemetryBuilder),this._specManager.consumeScheduled(b.headerRequestId),L=await P.next()}let O=L.value.v;B(O,L.value.telemetryBuilder)}catch(O){f.trace(`Error while streaming further edits: ${r4e.ErrorUtils.toString(O)}`);let q=new If.NoNextEditReason.Unexpected(r4e.ErrorUtils.fromUnknown(O));B(q,M)}})(),T=new If.StatelessNextEditResult(Fg.Result.ok(void 0),M)}}catch(L){throw b.setResultError(L),L}return{nextEditRequest:b,nextEditResult:T}}_hookupCancellation(e,r,n){let o=new Wyt.DisposableStore,s=!1,c=a(()=>{s||(s=!0,e.liveDependentants--)},"removeDependant"),l=o.add(new Vyt.TimeoutTimer);return o.add(r.onCancellationRequested(()=>{if(c(),!(e.liveDependentants>0)){if(!e.fetchIssued){e.cancellationTokenSource.cancel(),n?.dispose();return}l.setIfNotSet(()=>{e.liveDependentants>0||(e.cancellationTokenSource.cancel(),n?.dispose())},1e3)}})),o.add((0,Wyt.toDisposable)(()=>{c(),e.liveDependentants===0&&n?.dispose()})),e.liveDependentants++,o}computeMinimumResponseDelay({triggerTime:e,isRebasedCachedEdit:r,isSubsequentCachedEdit:n,isFromSpeculativeRequest:o,enforceCacheDelay:s},c){if(!s)return c.trace("[minimumDelay] no minimum delay enforced due to enforceCacheDelay being false"),0;let l=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsCacheDelay,this._expService),u=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsRebasedCacheDelay,this._expService),d=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsSubsequentCacheDelay,this._expService),f=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestDelay,this._expService),h=l;r&&u!==void 0?h=u:n&&d!==void 0?h=d:o&&f!==void 0&&(h=f);let m=Date.now()-e,g=Math.max(0,h-m);return c.trace(`[minimumDelay] expected delay: ${h}ms, effective delay: ${g}. isRebasedCachedEdit: ${r} (rebasedCacheDelay: ${u}), isSubsequentCachedEdit: ${n} (subsequentCacheDelay: ${d}), isFromSpeculativeRequest: ${o} (speculativeRequestDelay: ${f})`),g}handleShown(e){if(this._lastShownTime=Date.now(),this._lastShownSuggestionId=e.requestId,this._lastOutcome=void 0,this._specManager.clearScheduled(),this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsSpeculativeRequests,this._expService)===t4e.SpeculativeRequestsEnablement.On){let n=this._pendingStatelessNextEditRequest;n&&n.headerRequestId===e.source.headerRequestId?this._specManager.schedule({suggestion:e,headerRequestId:n.headerRequestId}):this._triggerSpeculativeRequest(e)}}async _triggerSpeculativeRequest(e){let r=e.result;if(!r?.edit)return;let n=r.targetDocumentId;if(!n)return;let o=new aac.InlineEditRequestLogContext(n.uri,0,void 0),s=new lOi.StopWatch,c=this._logger.createSubLogger("_triggerSpeculativeRequest").withExtraTarget(iPr.LogTarget.fromCallback((T,w)=>{o.trace(`[${Math.floor(s.elapsed()).toString().padStart(4," ")}ms] ${w}`)})),l=r.edit.replace(r.documentBeforeEdits.value),u=r.edit.removeCommonSuffixPrefix(r.documentBeforeEdits.value),d=u.replaceRange.start+u.newText.length,f=new oPr.OffsetRange(d,d),h=[f],m=new Lge.RootedEdit(r.documentBeforeEdits,new Pre.StringEdit([r.edit])),g=new dOi.StringText(l),A=this._nextEditCache.lookupNextEdit(n,g,h),y=f;if(A)if(A.edit){c.trace("already have cached edit for post-edit state");return}else if(A.editWindow){c.trace("have cached no-suggestions entry for post-edit state, but it has an edit window. Checking if shifting selection based on cursor placement config can yield a cached edit");let T=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsCursorPlacement,this._expService);if(T===t4e.SpeculativeRequestsCursorPlacement.AfterEditWindow)if(c.trace("cursor placement config is AfterEditWindow, shifting selection to after edit window"),y=nPr.shiftSelectionAfterEditWindow(g,A.editWindow),A=this._nextEditCache.lookupNextEdit(n,g,[y]),A?.edit){c.trace("already have cached edit for post-edit state (after shifting selection)");return}else c.trace("no cached edit even after shifting selection");else c.trace(`cursor placement config is ${T}, not shifting selection`)}else{c.trace("already have cached no-suggestions entry for post-edit state");return}if(this._pendingStatelessNextEditRequest?.documentBeforeEdits.value===l){c.trace("already have pending request for post-edit state");return}let E=this._specManager.pending;if(E?.docId===n&&E?.postEditContent===l){c.trace("already have speculative request for post-edit state");return}let _=this._workspace.getDocument(n);if(!_){c.trace("document not found for speculative request");return}let v=this._historyContextProvider.getHistoryContext(n);if(!v){c.trace("no history context for speculative request");return}let b=new o4e(`sp-${e.source.opportunityId}`,o,void 0,!0,`sp-${(0,hOi.generateUuid)()}`);c.trace(`triggering speculative request for post-edit state (opportunityId=${b.opportunityId}, headerRequestId=${b.headerRequestId})`);try{let T=await this._createSpeculativeRequest(b,_,y,v,l,m,r.edit,{triggeredBySpeculativeRequest:e.source.isSpeculative,isSubsequentEdit:e.result?.isSubsequentEdit??!1},c);if(T){let w=r.documentBeforeEdits.value,R=w.slice(0,u.replaceRange.start),x=w.slice(u.replaceRange.endExclusive),P=u.newText;this._specManager.setPending({request:T,docId:n,postEditContent:l,trajectoryPrefix:R,trajectorySuffix:x,trajectoryNewText:P})}}catch(T){c.trace(`speculative request failed: ${r4e.ErrorUtils.toString(T)}`)}}async _createSpeculativeRequest(e,r,n,o,s,c,l,{triggeredBySpeculativeRequest:u,isSubsequentEdit:d},f){let h=r.id,m=this._debugRecorder?.getRecentLog(),g=e.log;g.setStatelessNextEditProviderId(this._statelessNextEditProvider.ID);let A=f.createSubLogger("_createSpeculativeRequest"),y=o.getDocumentAndIdx(h);if(!y){A.trace("active doc not found in history context");return}let E=new dOi.StringText(s),_=o.documents.map(N=>{if(N.docId!==h)return this._processDoc(N);{let B=this._workspace.getWorkspaceRoot(h),L=new Pre.StringEdit([l]),j=n4e.RootedLineEdit.fromEdit(new Lge.RootedEdit(r.value.get(),L)).removeCommonSuffixPrefixLines().edit,M=new If.StatelessNextEditDocument(h,B,N.languageId,r.value.get().getLines(),j,r.value.get(),Lge.Edits.single(L),n);return{recentEdit:new Lge.RootedEdit(r.value.get(),L),nextEditDoc:M,documentAfterEdits:E}}}),v=this._xtabHistoryTracker.getHistory(),b={kind:"edit",docId:h,edit:c};v.push(b);let T=new Vyt.DeferredPromise,w=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsSpeculativeRequestsAutoExpandEditWindowLines,this._expService),R;switch(w){case t4e.SpeculativeRequestsAutoExpandEditWindowLines.Off:R=void 0;break;case t4e.SpeculativeRequestsAutoExpandEditWindowLines.Always:R=this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService);break;case t4e.SpeculativeRequestsAutoExpandEditWindowLines.Smart:{R=u||d?this._configService.getExperimentBasedConfig(_v.ConfigKey.TeamInternal.InlineEditsAutoExpandEditWindowLines,this._expService):void 0;break}default:(0,aOi.assertNever)(w)}let x=new If.StatelessNextEditRequest(e.headerRequestId,e.opportunityId,E,_.map(N=>N.nextEditDoc),y.idx,v,T,R,!0,g,void 0,m,void 0);g.setRequestInput(x),A.trace("starting speculative provider call");let P=`NES | spec | ${(0,sac.basename)(r.id.toUri().fsPath)} (v${r.version.get()})`,D=new lac.CapturingToken(P,void 0);return this._requestLogger.captureInvocation(D,async()=>{this._addLiveLogContextEntry(g,P);try{await this._runSpeculativeProviderCall(x,_,h,e,n.start,A)}catch(N){g.setError(N)}finally{g.markCompleted()}}),x}async _runSpeculativeProviderCall(e,r,n,o,s,c){let l=c.createSubLogger("_runSpeculativeProviderCall"),u=e.xtabEditHistory,d=pOi(r,u),f=o.log,h=this._statelessNextEditProvider.provideNextEdit(e,l,f,e.cancellationTokenSource.token),m=-1;try{let g=await h.next();g.done?(e.firstEdit.complete(Fg.Result.error(g.value.v)),e.setResult(new If.StatelessNextEditResult(Fg.Result.error(g.value.v),g.value.telemetryBuilder)),f.markAsNoSuggestions(),l.trace("speculative request completed with no edits")):(async()=>{for(;!g.done;){++m;let A=g.value.v,y=d.get(A.targetDocument??n),E=A.edit,_=new uOi.LineEdit([E]),b=fOi(_,y.baseDocState).tryRebase(y.editsSoFar);if(b===void 0){l.trace(`speculative edit ${m} rebasing failed`),g=await h.next();continue}if(y.editsSoFar=y.editsSoFar.compose(b),b.replacements.length===1){let T=b.replacements[0];y.nextEdits.push(T);let w=this._nextEditCache.setKthNextEdit(y.docId,y.docContents,m===0?A.window:void 0,T,m,m===0?y.nextEdits:void 0,void 0,o,{isFromCursorJump:A.isFromCursorJump,originalEditWindow:A.originalWindow,cursorOffset:y.docId===n?s:void 0});!e.firstEdit.isSettled&&w&&(e.firstEdit.complete(Fg.Result.ok(w)),e.setResult(new If.StatelessNextEditResult(Fg.Result.ok(void 0),g.value.telemetryBuilder)),f.setResponseResults([T])),l.trace(`cached speculative edit ${m}`)}y.docContents=b.applyOnText(y.docContents),g=await h.next()}})().finally(()=>{e.firstEdit.isSettled||(e.firstEdit.complete(Fg.Result.error(new If.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits")))),e.setResult(new If.StatelessNextEditResult(Fg.Result.error(new If.NoNextEditReason.Uncategorized(new Error("Speculative request ended without edits"))),g.value.telemetryBuilder)),f.markAsNoSuggestions())}),l.trace(`speculative request completed with ${m+1} edits`)}catch(g){l.trace(`speculative provider call error: ${r4e.ErrorUtils.toString(g)}`)}}static shiftSelectionAfterEditWindow(e,r){let n=e.getTransformer(),o=n.getPosition(r.endExclusive-1),s=o.lineNumber+11e3&&r.result.edit&&(this._rejectionCollector.reject(e,r.result.edit),this._nextEditCache.rejectedNextEdit(r.source.headerRequestId)),this._lastRejectionTime=Date.now(),this._lastOutcome=i4e.Rejected,this._statelessNextEditProvider.handleRejection?.()}handleIgnored(e,r,n){this._lastOutcome=i4e.Ignored,this._lastShownSuggestionId===r.requestId&&!(n!==void 0)&&(this._specManager.cancelAll("ignoredDismissed"),this._statelessNextEditProvider.handleIgnored?.())}async runSnippy(e,r){r.result===void 0||r.result.edit===void 0||this._snippyService.handlePostInsertion(e.toUri(),r.result.documentBeforeEdits,r.result.edit)}_addLiveLogContextEntry(e,r){this._requestLogger.addEntry({type:"MarkdownContentRequest",debugName:r??e.getDebugName(),icon:a(()=>e.getIcon(),"icon"),startTimeMs:e.time,markdownContent:a(()=>e.toLogDocument(),"markdownContent"),onDidChange:e.onDidChange,isVisible:a(()=>e.includeInLogTree,"isVisible")})}clearCache(){this._nextEditCache.clear(),this._rejectionCollector.clear(),this._specManager.cancelAll("cacheCleared")}};FT.NextEditProvider=sPr;FT.NextEditProvider=sPr=nPr=oac([e4e(5,_v.IConfigurationService),e4e(6,dac.ISnippyService),e4e(7,iPr.ILogService),e4e(8,fac.IExperimentationService),e4e(9,uac.IRequestLogger)],sPr);function vac(t){if(!t)throw new aPr.BugIndicatingError("expected value to be defined, but it was not");return t}a(vac,"assertDefined");var o4e=class{static{a(this,"NextEditFetchRequest")}constructor(e,r,n,o,s=(0,hOi.generateUuid)()){this.opportunityId=e,this.log=r,this.providerRequestStartDateTime=n,this.isSpeculative=o,this.headerRequestId=s}};FT.NextEditFetchRequest=o4e});var SOi=I(uh=>{"use strict";p();Object.defineProperty(uh,"__esModule",{value:!0});uh.GLOB_SPLIT=uh.GLOBSTAR=void 0;uh.getEmptyExpression=Iac;uh.splitGlobAware=uPr;uh.isEmptyPattern=Mac;uh.match=Uac;uh.parse=vOi;uh.isRelativePattern=COi;uh.getBasenameTerms=Qac;uh.getPathTerms=qac;uh.patternsEquals=Gac;var Cac=ml(),lPr=zc(),bac=F8t(),Sac=XP(),t$=fA(),Tac=G7(),s4e=Oh();function Iac(){return Object.create(null)}a(Iac,"getEmptyExpression");uh.GLOBSTAR="**";uh.GLOB_SPLIT="/";var Yyt="[/\\\\]",Kyt="[^/\\\\]",xac=/\//g;function gOi(t,e){switch(t){case 0:return"";case 1:return`${Kyt}*?`;default:return`(?:${Yyt}|${Kyt}+${Yyt}${e?`|${Yyt}${Kyt}+`:""})*?`}}a(gOi,"starsToRegExp");function uPr(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(uPr,"splitGlobAware");function _Oi(t){if(!t)return"";let e="",r=uPr(t,uh.GLOB_SPLIT);if(r.every(n=>n===uh.GLOBSTAR))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===uh.GLOBSTAR){if(n)return;e+=gOi(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===uh.GLOB_SPLIT?h="":h=(0,s4e.escapeRegExpCharacters)(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${uPr(l,",").map(g=>_Oi(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Kyt;continue;case"*":e+=gOi(1);continue;default:e+=(0,s4e.escapeRegExpCharacters)(f)}}su===d,endsWith:n?s4e.endsWithIgnoreCase:(u,d)=>u.endsWith(d),isEqualOrParent:a((u,d)=>(0,bac.isEqualOrParent)(u,d,e.ignoreCase??!Tac.isLinux),"isEqualOrParent")},s=`${n?r.toLowerCase():r}_${!!e.trimForExclusions}_${n}`,c=AOi.get(s);if(c)return yOi(c,t,o);let l;return wac.test(r)?c=Oac(r.substring(4),r,o):(l=Rac.exec(cPr(r,o)))?c=Bac(l[1],r,o):(e.trimForExclusions?kac:Pac).test(r)?c=Lac(r,o):(l=Dac.exec(cPr(r,o)))?c=EOi(l[1].substring(1),r,!0,o):(l=Nac.exec(cPr(r,o)))?c=EOi(l[1],r,!1,o):c=Fac(r,o),AOi.set(s,c),yOi(c,t,o)}a(fPr,"parsePattern");function yOi(t,e,r){if(typeof e=="string")return t;let n=a(function(o,s){return r.isEqualOrParent(o,e.base)?t((0,s4e.ltrim)(o.substring(e.base.length),t$.sep),s):null},"wrappedPattern");return n.allBasenames=t.allBasenames,n.allPaths=t.allPaths,n.basenames=t.basenames,n.patterns=t.patterns,n}a(yOi,"wrapRelativePattern");function cPr(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substring(0,t.length-2):t}a(cPr,"trimForExclusions");function Oac(t,e,r){return function(n,o){return typeof n=="string"&&r.endsWith(n,t)?e:null}}a(Oac,"trivia1");function Bac(t,e,r){let n=`/${t}`,o=`\\${t}`,s=a(function(l,u){return typeof l!="string"?null:u?r.equals(u,t)?e:null:r.equals(l,t)||r.endsWith(l,n)||r.endsWith(l,o)?e:null},"parsedPattern"),c=[t];return s.basenames=c,s.patterns=[e],s.allBasenames=c,s}a(Bac,"trivia2");function Lac(t,e){let r=bOi(t.slice(1,-1).split(",").map(l=>fPr(l,e)).filter(l=>l!==PD),t),n=r.length;if(!n)return PD;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Lac,"trivia3");function EOi(t,e,r,n){let o=t$.sep===t$.posix.sep,s=o?t:t.replace(xac,t$.sep),c=t$.sep+s,l=t$.posix.sep+t,u;return r?u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||n.endsWith(d,c)||!o&&(n.equals(d,t)||n.endsWith(d,l)))?e:null},"parsedPattern"):u=a(function(d,f){return typeof d=="string"&&(n.equals(d,s)||!o&&n.equals(d,t))?e:null},"parsedPattern"),u.allPaths=[(r?"*/":"./")+t],u}a(EOi,"trivia4and5");function Fac(t,e){try{let r=new RegExp(`^${_Oi(t)}$`,e.ignoreCase?"i":void 0);return function(n){return r.lastIndex=0,typeof n=="string"&&r.test(n)?t:null}}catch{return PD}}a(Fac,"toRegExp");function Uac(t,e,r){return!t||typeof e!="string"?!1:vOi(t,r)(e)}a(Uac,"match");function vOi(t,e={}){if(!t)return dPr;if(typeof t=="string"||COi(t)){let r=fPr(t,e);if(r===PD)return dPr;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return jac(t,e)}a(vOi,"parse");function COi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(COi,"isRelativePattern");function Qac(t){return t.allBasenames||[]}a(Qac,"getBasenameTerms");function qac(t){return t.allPaths||[]}a(qac,"getPathTerms");function jac(t,e){let r=bOi(Object.getOwnPropertyNames(t).map(l=>Hac(l,t[l],e)).filter(l=>l!==PD)),n=r.length;if(!n)return PD;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(jac,"parsedExpression");function Hac(t,e,r){if(e===!1)return PD;let n=fPr(t,r);if(n===PD)return PD;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return(0,lPr.isThenable)(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Hac,"parseExpressionPattern");function bOi(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substring(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(bOi,"aggregateBasenameMatches");function Gac(t,e){return(0,Cac.equals)(t,e,(r,n)=>typeof r=="string"&&typeof n=="string"?r===n:typeof r!="string"&&typeof n!="string"?r.base===n.base&&r.pattern===n.pattern:!1)}a(Gac,"patternsEquals")});var Zyt=I(wl=>{"use strict";p();var $ac=wl&&wl.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Vac=wl&&wl.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Wac=wl&&wl.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o(0,TOi.isEqual)(r.uri,t)||r.uri.path===t.path||hPr(t,r))}a(pPr,"findNotebook");function hPr(t,e){if(t.scheme===a4e.Schemas.vscodeNotebookCell||t.scheme===a4e.Schemas.vscodeNotebookCellOutput){let r=e.getCells().findIndex(n=>(0,TOi.isEqual)(n.document.uri,t)||n.document.uri.fragment===t.fragment&&n.document.uri.path===t.path);if(r!==-1)return e.getCells()[r]}}a(hPr,"findCell");function zac(t,e){if(t.scheme!==a4e.Schemas.vscodeNotebookCellOutput)return;let r=new URLSearchParams(t.query),[n,o]=IOi(t,e);if(!o||!o.outputs.length)return;let s=(r.get("outputIndex")?parseInt(r.get("outputIndex")||"",10):void 0)||0;if(!(s>o.outputs.length-1))return[n,o,o.outputs[s]]}a(zac,"getNotebookCellOutput");function IOi(t,e){let r=pPr(t,e)||e.find(o=>o.uri.path===t.path);if(!r)return[void 0,void 0];let n=hPr(t,r);return n===void 0?[r,void 0]:[r,n]}a(IOi,"getNotebookAndCellFromUri");function Yac(t){return t.scheme===a4e.Schemas.vscodeNotebookCell||t.scheme==="untitled"&&t.fragment.startsWith("notebook-chat-input")}a(Yac,"isNotebookCellOrNotebookChatInput");function Kac(t){return t.scheme===a4e.Schemas.vscodeNotebookCell}a(Kac,"isNotebookCell");function Jac(t){return t.path.endsWith(".ipynb")}a(Jac,"isJupyterNotebookUri");function Zac(t){return t.notebookType==="jupyter-notebook"}a(Zac,"isJupyterNotebook");function Xac(t,e={}){return JSON.stringify({cells:t.getCells().map(r=>({uri_fragment:e.cell_uri_fragment?r.document.uri.fragment:void 0,cell_type:r.kind,source:r.document.getText().split(/\r?\n/)}))})}a(Xac,"serializeNotebookDocument");function ecc(t){try{let e=t.replace(/\n/g,""),n=/```(?:json)?(.+)/g.exec(e);if(n){let o=n[1],s=o.indexOf("```"),c=s===-1?o:o.substring(0,s);return JSON.parse(c)}}catch{}}a(ecc,"extractNotebookOutline");function xOi(t){let e=t;return typeof e=="object"&&e!==null&&(typeof e.include=="string"||ROi(e.include))}a(xOi,"isDocumentExcludePattern");function wOi(t){let e=t;return typeof e=="object"&&e!==null&&typeof e.filenamePattern=="string"}a(wOi,"isFilenamePattern");function ROi(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(ROi,"isRelativePattern");function tcc(t){let e=t;return!!e&&!!e.type&&!!e.displayName&&!!e.selector}a(tcc,"isNotebookEditorContribution");function rcc(t){let e=[];for(let[r,n]of Object.entries(t))n&&e.push({filenamePattern:r,viewType:n});return e}a(rcc,"extractEditorAssociation");function POi(t,e){if(typeof e=="string"&&Fge.match(e.toLowerCase(),(0,Uge.basename)(t.fsPath).toLowerCase()))return!0;if(xOi(e)){let r=e.include,n=e.exclude;if(!r)return!1;if(Fge.match(r,(0,Uge.basename)(t.fsPath).toLowerCase()))return!(n&&Fge.match(n,(0,Uge.basename)(t.fsPath).toLowerCase()))}return wOi(e)&&Fge.match(e.filenamePattern,(0,Uge.basename)(t.fsPath).toLowerCase())?!(e.excludeFileNamePattern&&Fge.match(e.excludeFileNamePattern,(0,Uge.basename)(t.fsPath).toLowerCase())):!1}a(POi,"notebookSelectorMatches");function kOi(t,e){let r=[];for(let n of e)n.filenamePattern&&Fge.match(n.filenamePattern.toLowerCase(),(0,Uge.basename)(t.fsPath).toLowerCase())&&r.push({filenamePattern:n.filenamePattern,viewType:n.viewType});return r}a(kOi,"getNotebookEditorAssociations");function ncc(t,e,r,n){if(pPr(t,e))return!0;let o=r.filter(c=>c.selector.some(l=>POi(t,l)));if(o.length===0)return!1;let s=kOi(t,n);for(let c of s)if(o.some(l=>l.type===c.viewType))return!0;return!!o.some(c=>(c.priority??Jyt.default)===Jyt.default)}a(ncc,"_hasSupportedNotebooks")});var BOi=I(vv=>{"use strict";p();var icc=vv&&vv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},occ=vv&&vv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(vv,"__esModule",{value:!0});vv.TelemetrySender=vv.NextEditProviderTelemetryBuilder=vv.DiagnosticsTelemetryBuilder=vv.LlmNESTelemetryBuilder=void 0;var DOi=gR(),scc=P5(),OOi=Bh(),acc=Zyt(),ccc=zc(),Xyt=Io(),lcc=uY(),NOi=BF(),MOi=Am(),eEt=class extends Xyt.Disposable{static{a(this,"LlmNESTelemetryBuilder")}build(e){let r,n,o,s,c,l=!1,u,d,f;if(this._request){let g=this._request.getActiveDocument();r=this._request.documents.length,n=this._request.documents.reduce((y,E)=>y+E.recentEdits.edits.length,0),o=g.recentEdits.edits.length,s=g.languageId,c=g.documentAfterEditsLines.length,l=g.id.toUri().scheme===lcc.Schemas.vscodeNotebookCell||this._notebookService?.hasSupportedNotebooks(g.id.toUri())||!1,u=this._workspaceService===void 0?void 0:(0,acc.findNotebook)(g.id.toUri(),this._workspaceService.notebookDocuments)?.notebookType;let A=this._gitExtensionService?.getExtensionApi();if(A){let y=A.getRepository(MOi.Uri.parse(g.id.uri));if(y){let v=y.state.HEAD?.upstream?.remote,b=y.state.remotes.find(T=>T.name===v);b?.fetchUrl&&(d=b.pushUrl||b.fetchUrl)}let E=new Set,_=[...new Set(this._request.documents.map(v=>A.getRepository(MOi.Uri.parse(v.id.uri))).filter(Boolean))];for(let v of _){let b=v?.state.HEAD?.upstream?.remote,T=v?.state.remotes.find(w=>w.name===b);T?.fetchUrl&&E.add(T.fetchUrl),T?.pushUrl&&E.add(T.pushUrl)}f=[...E]}}let h;if(e&&this.editCollectingInfo!==void 0){let g=this.editCollectingInfo.originalDoc.value,A;if(this._debugRecorder&&this._requestBookmark){let y=this._debugRecorder.getRecentLog(),E=JSON.stringify(y)?.length||0;A={entries:E>200*1024?void 0:y,entriesSize:E,requestTime:this._requestBookmark.timeMs}}h={text:g.length>200*1024?void 0:g,textLength:g.length,selection:this.editCollectingInfo.originalSelection.map(y=>({start:y.start,endExclusive:y.endExclusive})),edits:this.editCollectingInfo.edits.map(y=>y.edit.replacements.map(E=>({time:y.time.toISOString(),start:E.replaceRange.start,endExclusive:E.replaceRange.endExclusive,newText:E.newText}))).flat(),tags:[],recording:A}}let m=this._statelessNextEditTelemetry?.fetchStartedAt===void 0?void 0:this._statelessNextEditTelemetry.fetchStartedAt-this._startTime;return{providerId:this._providerId,headerRequestId:this._headerRequestId,nextEditProviderDuration:this._duration,isFromCache:this._isFromCache,reusedRequest:this._reusedRequest,subsequentEditOrder:this._subsequentEditOrder,documentsCount:r,editsCount:n,activeDocumentEditsCount:o,activeDocumentLanguageId:s,activeDocumentOriginalLineCount:c,fetchStartedAfterMs:m,hasNextEdit:this._hasNextEdit,wasPreviouslyRejected:this._wasPreviouslyRejected,isNotebook:l,notebookType:u,status:this._status,nextEditProviderError:this._nextEditProviderError,alternativeAction:h,...this._statelessNextEditTelemetry,activeDocumentRepository:d,repositoryUrls:f,nesConfigs:this._nesConfigs}}get originalSelectionLine(){return this.editCollectingInfo?.originalSelectionLine}constructor(e,r,n,o,s,c,l){super(),this._gitExtensionService=e,this._notebookService=r,this._workspaceService=n,this._providerId=o,this._doc=s,this._debugRecorder=c,this._requestBookmark=l,this._isFromCache=!1,this._hasNextEdit=!1,this._wasPreviouslyRejected=!1,this._status="new",this._startTime=Date.now(),this._doc&&(this.editCollectingInfo={originalDoc:this._doc.value.get(),originalSelection:this._doc.selection.get(),originalSelectionLine:this._doc.primarySelectionLine.get(),edits:[]},this._store.add((0,scc.autorunWithChanges)(this,{value:this._doc.value},u=>{let d=new Date;u.value.changes.forEach(f=>{this.editCollectingInfo?.edits.push({time:d,edit:f})})})))}setNESConfigs(e){return this._nesConfigs=e,this}setHeaderRequestId(e){return this._headerRequestId=e,this}setIsFromCache(){return this._isFromCache=!0,this}setReusedRequest(e){return this._reusedRequest=e,this}setSubsequentEditOrder(e){return this._subsequentEditOrder=e,this}setRequest(e){return this._request=e,this}setStatelessNextEditTelemetry(e){return this._statelessNextEditTelemetry=e,this}setHasNextEdit(e){return this._hasNextEdit=e,this}setWasPreviouslyRejected(){return this._wasPreviouslyRejected=!0,this}markEndTime(){return this._duration=Date.now()-this._startTime,this}setStatus(e){return this._status=e,this}setNextEditProviderError(e){return this._nextEditProviderError=e,this}};vv.LlmNESTelemetryBuilder=eEt;var tEt=class{static{a(this,"DiagnosticsTelemetryBuilder")}constructor(){this._droppedReasons=[]}build(){let e=this._droppedReasons.length>0?JSON.stringify(this._droppedReasons):void 0;return{diagnosticType:this._type,diagnosticDroppedReasons:e,diagnosticAlternativeImportsCount:this._diagnosticRunTelemetry?.alternativeImportsCount,diagnosticHasExistingSameFileImport:this._diagnosticRunTelemetry?.hasExistingSameFileImport,diagnosticIsLocalImport:this._diagnosticRunTelemetry?.isLocalImport,diagnosticDistanceToUnknownDiagnostic:this._diagnosticRunTelemetry?.distanceToUnknownDiagnostic,diagnosticDistanceToAlternativeDiagnostic:this._diagnosticRunTelemetry?.distanceToAlternativeDiagnostic,diagnosticHasAlternativeDiagnosticForSameRange:this._diagnosticRunTelemetry?.hasAlternativeDiagnosticForSameRange}}populate(e){this._droppedReasons.forEach(r=>e.addDroppedReason(r)),this._type&&e.setType(this._type),this._diagnosticRunTelemetry&&e.setDiagnosticRunTelemetry(this._diagnosticRunTelemetry)}setType(e){return this._type=e,this}addDroppedReason(e){return this._droppedReasons.push(e),this}setDiagnosticRunTelemetry(e){return this._diagnosticRunTelemetry=e,this}};vv.DiagnosticsTelemetryBuilder=tEt;var mPr=class t extends Xyt.Disposable{static{a(this,"NextEditProviderTelemetryBuilder")}static{this.providerIdToReqN=new Map}get isSent(){return this._isSent}markAsSent(){this._isSent=!0}build(e){let r=this._nesBuilder.build(e),n=this._diagnosticsBuilder.build();return{...r,...n,opportunityId:this._opportunityId||"",requestN:this._requestN,isShown:this._isShown,acceptance:this._acceptance,disposalReason:this._disposalReason,supersededByOpportunityId:this._supersededByOpportunityId,pickedNES:this._nesTypePicked,hadLlmNES:this._hadLlmNES,isMultilineEdit:this._isMultilineEdit,isEolDifferent:this._isEolDifferent,isActiveDocument:this._isActiveDocument,isNextEditorVisible:this._isNextEditorVisible,isNextEditorRangeVisible:this._isNextEditorRangeVisible,isNESForAnotherDoc:this._isNESForAnotherDoc,notebookId:this._notebookId,notebookCellLines:this._notebookCellLines,notebookCellMarkerCount:this._notebookCellMarkerCount,notebookCellMarkerIndex:this._notebookCellMarkerIndex,hadDiagnosticsNES:this._hadDiagnosticsNES,configIsDiagnosticsNESEnabled:this._configIsDiagnosticsNESEnabled,isNaturalLanguageDominated:this._isNaturalLanguageDominated,postProcessingOutcome:this._postProcessingOutcome,userTypingDisagreed:this._userTypingDisagreed}}get nesBuilder(){return this._nesBuilder}get diagnosticsBuilder(){return this._diagnosticsBuilder}constructor(e,r,n,o,s,c,l){super(),this.doc=s,this._isSent=!1,this._isShown=!1,this._acceptance="notAccepted",this._disposalReason=void 0,this._supersededByOpportunityId=void 0,this._userTypingDisagreed=void 0,this._notebookCellMarkerCount=0,this._notebookCellMarkerIndex=-1,this._isNESForAnotherDoc=!1,this._hadLlmNES=!1,this._hadDiagnosticsNES=!1,this._configIsDiagnosticsNESEnabled=!1,this._isNaturalLanguageDominated=!1;let u=t.providerIdToReqN.get(o)||0;this._requestN=++u,t.providerIdToReqN.set(o,u),this._nesBuilder=this._register(new eEt(e,r,n,o,s,c,l)),this._diagnosticsBuilder=new tEt}setOpportunityId(e){return this._opportunityId=e,this}setAsShown(){return this._isShown=!0,this}setAcceptance(e){return this._acceptance=e,this}setDisposalReason(e){return this._disposalReason=e,this}setSupersededBy(e){return this._supersededByOpportunityId=e,this}setUserTypingDisagreed(e){return this._userTypingDisagreed=e,this}setPickedNESType(e){return this._nesTypePicked=e,this}setIsActiveDocument(e){return this._isActiveDocument=e,this}setNotebookCellMarkerCount(e){return this._notebookCellMarkerCount=e,this}setIsMultilineEdit(e){return this._isMultilineEdit=e,this}setIsEolDifferent(e){return this._isEolDifferent=e,this}setIsNextEditorVisible(e){return this._isNextEditorVisible=e,this}setIsNextEditorRangeVisible(e){return this._isNextEditorRangeVisible=e,this}setNotebookId(e){return this._notebookId=e,this}setNotebookCellLines(e){return this._notebookCellLines=e,this}setNotebookCellMarkerIndex(e){return this._notebookCellMarkerIndex=e,this}setIsNESForOtherEditor(e){return this._isNESForAnotherDoc=e,this}setHadLlmNES(e){return this._hadLlmNES=e,this}setHadDiagnosticsNES(e){return this._hadDiagnosticsNES=e,this}setStatus(e){return this._nesBuilder.setStatus(e),this}setConfigIsDiagnosticsNESEnabled(e){return this._configIsDiagnosticsNESEnabled=e,this}setIsNaturalLanguageDominated(e){return this._isNaturalLanguageDominated=e,this}setPostProcessingOutcome(e){let r=e.displayLocation?{label:e.displayLocation.label,range:e.displayLocation.range.toString()}:void 0;return this._postProcessingOutcome=JSON.stringify({suggestedEdit:e.edit.toString(),isInlineCompletion:e.isInlineCompletion,displayLocation:r}),this}};vv.NextEditProviderTelemetryBuilder=mPr;var gPr=class{static{a(this,"IdleDetector")}get isDisposed(){return this._store.isDisposed}constructor(e,r,n){this._onIdle=r,this._onUserJump=n,this._store=new Xyt.DisposableStore,this._disposalTracker=new Xyt.RefCountedDisposable(this._store),this._selectionSnapshots=new Map,this._lastEditTime=0;let o=5e3,s=this._store.add(new ccc.RunOnceScheduler(()=>{this._onIdle(o)},o));this._idleScheduler=s;let c=!0;this._store.add((0,NOi.autorun)(u=>{if(e.onDidOpenDocumentChange.read(u),c){c=!1;return}this._lastEditTime=Date.now(),s.schedule()}));let l=!0;this._store.add((0,NOi.autorunHandleChanges)({owner:this,changeTracker:{createChangeSummary:a(()=>({removed:[]}),"createChangeSummary"),handleChange:a((u,d)=>(u.didChange(e.openDocuments)&&(d.removed=u.change.removed),!0),"handleChange")}},(u,d)=>{if(this._store.isDisposed)return;let f=e.openDocuments.read(u);for(let h of f)h.primarySelectionLine.read(u);if(l){l=!1;for(let h of f)this._selectionSnapshots.set(h.id.uri,h.primarySelectionLine.get());return}for(let h of d.removed)this._selectionSnapshots.delete(h.id.uri);if(!(Date.now()-this._lastEditTime<200))for(let h of f){let m=h.id.uri,g=h.primarySelectionLine.get();if(this._selectionSnapshots.get(m)!==g){this._selectionSnapshots.set(m,g),this._onUserJump(m,g);return}}}))}scheduleIdleTimer(){this._idleScheduler?.schedule()}acquire(){this._disposalTracker.acquire()}release(){this._disposalTracker.release()}forceDispose(){this._store.dispose()}},APr=class{static{a(this,"TelemetrySender")}constructor(e,r){this._workspace=e,this._telemetryService=r,this._map=new Map}scheduleSendingEnhancedTelemetry(e,r){let n=this._map.get(e);n&&(n.builder!==r&&n.builder.dispose(),this._removeEntry(e,n));let o=setTimeout(()=>{this._enterIdleDetection(e,r)},120*1e3);this._map.set(e,{builder:r,timeout:o})}_enterIdleDetection(e,r){let n=this._workspace;if(!n){this._buildAndSendEnhancedTelemetry(e,r,{reason:"idle",details:{idleTimeoutMs:0}});return}this._idleDetector?this._idleDetector.acquire():this._idleDetector=new gPr(n,l=>this._sendAllPendingInIdlePhase({reason:"idle",details:{idleTimeoutMs:l}}),(l,u)=>this._sendAllPendingInIdlePhaseWithJump(l,u)),this._idleDetector.scheduleIdleTimer();let o=3e4,s=setTimeout(()=>{this._sendForEntry(e,{reason:"hard_cap",details:{hardCapTimeoutMs:o}})},o),c=this._map.get(e);c&&(c.hardCapTimeout=s)}_releaseIdleDetector(){this._idleDetector?.release(),this._idleDetector?.isDisposed&&(this._idleDetector=void 0)}_sendAllPendingInIdlePhase(e){let r=[];for(let[n,o]of this._map)o.hardCapTimeout!==void 0&&r.push(n);for(let n of r)this._sendForEntry(n,e)}_sendAllPendingInIdlePhaseWithJump(e,r){let n=[];for(let[o,s]of this._map)s.hardCapTimeout!==void 0&&n.push([o,s.builder]);for(let[o,s]of n){let c=s.doc?.id.uri,l=s.nesBuilder.originalSelectionLine,u=c!==void 0&&l!==void 0?{file:c,line:l}:void 0;this._sendForEntry(o,{reason:"user_jump",details:{from:u,to:{file:e,line:r}}})}}_sendForEntry(e,r){let n=this._map.get(e);if(!n)return;n.hardCapTimeout!==void 0&&(clearTimeout(n.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e);let o;try{o=n.builder.build(!0)}finally{n.builder.dispose()}this._doSendEnhancedTelemetry(o,r)}_removeEntry(e,r){clearTimeout(r.timeout),r.hardCapTimeout!==void 0&&(clearTimeout(r.hardCapTimeout),this._releaseIdleDetector()),this._map.delete(e)}_buildAndSendEnhancedTelemetry(e,r,n){let o;this._map.delete(e);try{o=r.build(!0)}finally{r.dispose()}this._doSendEnhancedTelemetry(o,n)}sendTelemetry(e,r){if(e){let o=this._map.get(e);o&&this._removeEntry(e,o)}let n=r.build(!0);r.isSent||(this._doSendTelemetry(n),r.markAsSent()),this._doSendEnhancedTelemetry(n,void 0)}sendTelemetryForBuilder(e){if(e.isSent)return;let r=e.build(!1);this._doSendTelemetry(r),e.markAsSent()}async _doSendTelemetry(e){let{opportunityId:r,headerRequestId:n,requestN:o,providerId:s,modelName:c,hadStatelessNextEditProviderCall:l,statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:f,reusedRequest:h,subsequentEditOrder:m,activeDocumentLanguageId:g,activeDocumentOriginalLineCount:A,nLinesOfCurrentFileInPrompt:y,wasPreviouslyRejected:E,isShown:_,isNotebook:v,notebookType:b,isNESForAnotherDoc:T,isActiveDocument:w,isEolDifferent:R,isMultilineEdit:x,isNextEditorRangeVisible:P,isNextEditorVisible:D,acceptance:N,disposalReason:B,logProbThreshold:L,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:Q,hadLowLogProbSuggestion:U,nEditsSuggested:z,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:$,isInlineSuggestion:J,debounceTime:ne,artificialDelay:H,hasNextEdit:re,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Oe,notebookId:ve,notebookCellLines:Fe,nextEditLogprob:Pe,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchStartedAfterMs:pe,response:X,configIsDiagnosticsNESEnabled:ue,isNaturalLanguageDominated:qe,diagnosticType:ie,diagnosticDroppedReasons:le,diagnosticHasExistingSameFileImport:Ne,diagnosticIsLocalImport:we,diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:Et,hadDiagnosticsNES:kt,hadLlmNES:Gt,pickedNES:jt,xtabAggressivenessLevel:Ie,xtabUserHappinessScore:F,userAggressivenessSetting:be,modelConfig:Ue}=e,de,Se,Le,te;if(X!==void 0){let{response:Te,ttft:Ge,fetchResult:Y,fetchTime:se}=await X;Te.type===DOi.ChatFetchResponseType.Success&&(de=Te.usage),Se=Ge,Le=Y,te=se}this._sendTelemetryToBoth({opportunityId:r,headerRequestId:n,providerId:s,modelName:c,activeDocumentLanguageId:g,mergeConflictExpanded:e.mergeConflictExpanded,acceptance:N,disposalReason:B,supersededByOpportunityId:Z,noNextEditReasonKind:ee,noNextEditReasonMessage:K,fetchResult:Le,nextEditProviderError:e.nextEditProviderError,reusedRequest:h,diagnosticType:ie,diagnosticDroppedReasons:le,pickedNES:jt,notebookType:b,notebookId:ve,notebookCellLines:Fe,nextCursorLineError:e.nextCursorPrediction?.nextCursorLineError,xtabAggressivenessLevel:Ie,userAggressivenessSetting:be,modelConfig:Ue,neighborSnippetIndicesInPrompt:e.neighborSnippetIndicesInPrompt},{requestN:o,hadStatelessNextEditProviderCall:this._boolToNum(l),statelessNextEditProviderDuration:u,nextEditProviderDuration:d,isFromCache:this._boolToNum(f),subsequentEditOrder:m,activeDocumentOriginalLineCount:A,activeDocumentNLinesInPrompt:y,wasPreviouslyRejected:this._boolToNum(E),isShown:this._boolToNum(_),isNotebook:this._boolToNum(v),isNESForAnotherDoc:this._boolToNum(T),isActiveDocument:this._boolToNum(w),isEolDifferent:this._boolToNum(R),isMultilineEdit:this._boolToNum(x),isNextEditorRangeVisible:this._boolToNum(P),isNextEditorVisible:this._boolToNum(D),hasNotebookCellMarker:ae>0?1:0,notebookCellMarkerCount:ae,notebookCellMarkerIndex:Oe,logProbThreshold:L,documentsCount:j,editsCount:M,activeDocumentEditsCount:O,promptLineCount:q,promptCharCount:Q,hadLowLogProbSuggestion:this._boolToNum(U),nEditsSuggested:z,lineDistanceToMostRecentEdit:W,isCursorAtEndOfLine:this._boolToNum($),isInlineSuggestion:this._boolToNum(J),debounceTime:ne,artificialDelay:H,fetchStartedAfterMs:pe,ttft:Se,fetchTime:te,promptTokens:de?.prompt_tokens,responseTokens:de?.completion_tokens,cachedTokens:de?.prompt_tokens_details?.cached_tokens,acceptedPredictionTokens:de?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:de?.completion_tokens_details?.rejected_prediction_tokens,hasNextEdit:this._boolToNum(re),userTypingDisagreed:this._boolToNum(e.userTypingDisagreed),nextEditLogprob:Pe,hadDiagnosticsNES:this._boolToNum(kt),hadLlmNES:this._boolToNum(Gt),configIsDiagnosticsNESEnabled:this._boolToNum(ue),isNaturalLanguageDominated:this._boolToNum(qe),diagnosticHasExistingSameFileImport:this._boolToNum(Ne),diagnosticIsLocalImport:this._boolToNum(we),diagnosticAlternativeImportsCount:Be,diagnosticDistanceToUnknownDiagnostic:tt,diagnosticDistanceToAlternativeDiagnostic:st,diagnosticHasAlternativeDiagnosticForSameRange:this._boolToNum(Et),nextCursorLineDistance:e.nextCursorPrediction?.nextCursorLineDistance,xtabUserHappinessScore:F,nDiffsInPrompt:e.nDiffsInPrompt,diffTokensInPrompt:e.diffTokensInPrompt,nNeighborSnippetsComputed:e.nNeighborSnippetsComputed,nNeighborSnippetsInPrompt:e.nNeighborSnippetsInPrompt})}_sendTelemetryToBoth(e,r){this._telemetryService.sendMSFTTelemetryEvent("provideInlineEdit",e,r),this._telemetryService.sendGHTelemetryEvent("copilot-nes/provideInlineEdit",e,r)}async _doSendEnhancedTelemetry(e,r){let{opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,status:l,modelName:u,prompt:d,response:f,alternativeAction:h,postProcessingOutcome:m,activeDocumentRepository:g,repositoryUrls:A,cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:T,modelConfig:w,isFromCache:R}=e,x=f===void 0?f:await f,P=await T?.catch(()=>{});this._telemetryService.sendEnhancedGHTelemetryEvent("copilot-nes/provideInlineEdit",(0,OOi.multiplexProperties)({opportunityId:n,headerRequestId:o,providerId:s,activeDocumentLanguageId:c,suggestionStatus:l,modelName:u,prompt:d,modelResponse:x===void 0||x.response.type!==DOi.ChatFetchResponseType.Success?void 0:x.response.value,alternativeAction:h?JSON.stringify({...h,enhancedTelemetrySendingReason:r}):void 0,enhancedTelemetrySendingReason:!h&&r?JSON.stringify(r):void 0,postProcessingOutcome:m,activeDocumentRepository:g,repositories:JSON.stringify(A),cursorJumpModelName:y,cursorJumpPrompt:E,cursorJumpResponse:_,lintErrors:v,terminalOutput:b,similarFilesContext:P,modelConfig:w}),{isFromCache:this._boolToNum(R)})}_boolToNum(e){return e===void 0?void 0:e?1:0}dispose(){for(let e of this._map.values())clearTimeout(e.timeout),e.hardCapTimeout!==void 0&&clearTimeout(e.hardCapTimeout),e.builder.dispose();this._map.clear(),this._idleDetector&&(this._idleDetector.forceDispose(),this._idleDetector=void 0)}};vv.TelemetrySender=APr;vv.TelemetrySender=APr=icc([occ(1,OOi.ITelemetryService)],APr)});var EPr=I(Qge=>{"use strict";p();Object.defineProperty(Qge,"__esModule",{value:!0});Qge.NullPowerService=Qge.IPowerService=void 0;var LOi=_c(),ucc=Ms();Qge.IPowerService=(0,ucc.createDecorator)("IPowerService");var yPr=class{static{a(this,"NullPowerService")}constructor(){this.onDidSuspend=LOi.Event.None,this.onDidResume=LOi.Event.None}acquirePowerSaveBlocker(){return{dispose:a(()=>{},"dispose")}}};Qge.NullPowerService=yPr});var l6=I(r$=>{"use strict";p();Object.defineProperty(r$,"__esModule",{value:!0});r$.FetchStreamRecorder=r$.FetchStreamSource=r$.IChatMLFetcher=void 0;var dcc=tn(),fcc=zc();r$.IChatMLFetcher=(0,dcc.createServiceIdentifier)("IChatMLFetcher");var _Pr=class{static{a(this,"FetchStreamSource")}get stream(){return this._stream.asyncIterable}constructor(){this._stream=new fcc.AsyncIterableSource,this._seenAnnotationTypes=new Set}pause(){this._paused??=[]}unpause(){let e=this._paused;if(e){this._paused=void 0;for(let r of e)r?this.update(r.text,r.delta):this.resolve()}}update(e,r){if(this._paused){this._paused.push({text:e,delta:r});return}r.codeVulnAnnotations&&(!((e.match(/(^|\n)```/g)?.length??0)%2===1)||e.match(/(^|\n)```\w*\s*$/))&&(r.codeVulnAnnotations=void 0),r.codeVulnAnnotations&&(r.codeVulnAnnotations=r.codeVulnAnnotations.filter(n=>!this._seenAnnotationTypes.has(n.details.type)),r.codeVulnAnnotations.forEach(n=>this._seenAnnotationTypes.add(n.details.type))),this._stream.emitOne({delta:r})}resolve(){if(this._paused){this._paused.push(void 0);return}this._stream.resolve()}reject(e){this._paused=void 0,this._stream.reject(e)}};r$.FetchStreamSource=_Pr;var vPr=class{static{a(this,"FetchStreamRecorder")}get firstTokenEmittedTime(){return this._firstTokenEmittedTime}constructor(e){this.deltas=[],this.callback=async(r,n,o)=>{this._firstTokenEmittedTime===void 0&&(o.text||o.beginToolCalls||typeof o.thinking?.text=="string"&&o.thinking?.text||o.thinking?.text?.length||o.copilotToolCalls||o.copilotToolCallStreamUpdates)&&(this._firstTokenEmittedTime=Date.now());let s=e?await e(r,n,o):void 0;return this.deltas.push(o),s}}};r$.FetchStreamRecorder=vPr});var CPr=I(rEt=>{"use strict";p();Object.defineProperty(rEt,"__esModule",{value:!0});rEt.IChatQuotaService=void 0;var pcc=tn();rEt.IChatQuotaService=(0,pcc.createServiceIdentifier)("IChatQuotaService")});var bPr=I(nEt=>{"use strict";p();Object.defineProperty(nEt,"__esModule",{value:!0});nEt.IConversationOptions=void 0;var hcc=tn();nEt.IConversationOptions=(0,hcc.createServiceIdentifier)("ConversationOptions")});var c4e=I(qge=>{"use strict";p();Object.defineProperty(qge,"__esModule",{value:!0});qge.getTextPart=gcc;qge.toTextPart=FOi;qge.toTextParts=Acc;qge.roleToString=ycc;var kre=xo(),mcc=Gu();function gcc(t){return t?typeof t=="string"?t:Array.isArray(t)?t.map(e=>e.type===kre.Raw.ChatCompletionContentPartKind.Text||e.type==="text"?e.text:"").join(""):t.type===kre.Raw.ChatCompletionContentPartKind.Text?t.text:"":""}a(gcc,"getTextPart");function FOi(t){return{type:kre.Raw.ChatCompletionContentPartKind.Text,text:t}}a(FOi,"toTextPart");function Acc(t){return[FOi(t)]}a(Acc,"toTextParts");function ycc(t){switch(t){case kre.Raw.ChatRole.System:return"system";case kre.Raw.ChatRole.User:return"user";case kre.Raw.ChatRole.Assistant:return"assistant";case kre.Raw.ChatRole.Tool:return"tool";default:(0,mcc.assertNever)(t,`unknown role (${t})`)}}a(ycc,"roleToString")});var TPr=I(jge=>{"use strict";p();Object.defineProperty(jge,"__esModule",{value:!0});jge.InteractionService=jge.IInteractionService=void 0;var Ecc=tn(),UOi=fm();jge.IInteractionService=(0,Ecc.createServiceIdentifier)("IInteractionService");var SPr=class{static{a(this,"InteractionService")}constructor(){this._interactionId=(0,UOi.generateUuid)()}startInteraction(){this._interactionId=(0,UOi.generateUuid)()}get interactionId(){return this._interactionId}};jge.InteractionService=SPr});var xPr=I(iEt=>{"use strict";p();Object.defineProperty(iEt,"__esModule",{value:!0});iEt.SSEParser=void 0;var IPr=class{static{a(this,"SSEParser")}constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{"use strict";p();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.getModelCapabilityOverride=tuc;Xi.getModelId=p$;Xi.isHiddenModelA=ruc;Xi.isHiddenModelB=Nkr;Xi.isHiddenModelE=fEt;Xi.isHiddenModelF=pEt;Xi.isHiddenFamilyH=hEt;Xi.isHiddenModelK=nuc;Xi.isGpt54=Mkr;Xi.isGpt55=Okr;Xi.isGpt55EconomicalSearchAndEditExp=iuc;Xi.isGpt55LargePromptSectionsExp=ouc;Xi.isHiddenModelM=b4e;Xi.isGpt53Codex=Bkr;Xi.isVSCModelA=mEt;Xi.isVSCModelB=gEt;Xi.isVSCModelReplaceStringSet=S4e;Xi.isVSCModelC=suc;Xi.isVSCModelD=auc;Xi.isGpt52CodexFamily=Lkr;Xi.isGpt52Family=Fkr;Xi.modelPrefersInstructionsInUserMessage=cuc;Xi.modelPrefersInstructionsAfterHistory=luc;Xi.modelSupportsApplyPatch=uuc;Xi.modelPrefersJsonNotebookRepresentation=duc;Xi.modelSupportsReplaceString=fuc;Xi.modelSupportsMultiReplaceString=MOi;Xi.modelCanUseReplaceStringExclusively=puc;Xi.modelShouldUseReplaceStringHealing=huc;Xi.modelCanUseMcpResultImageURL=muc;Xi.modelCanUseImageURL=guc;Xi.modelSupportsPDFDocuments=Auc;Xi.modelCanUseApplyPatchExclusively=yuc;Xi.modelNeedsStrongReplaceStringHint=Euc;Xi.modelSupportsSimplifiedApplyPatchInstructions=_uc;Xi.isAnthropicFamily=T4e;Xi.isGeminiFamily=Ukr;Xi.isMinimaxFamily=AEt;Xi.isGpt5PlusFamily=yEt;Xi.isGptCodexFamily=Cuc;Xi.isGpt5Family=vuc;Xi.isGptFamily=buc;Xi.isGpt51Family=Suc;Xi.getVerbosityForModelSync=Tuc;Xi.modelSupportsToolSearch=Iuc;Xi.modelSupportsContextEditing=xuc;var _0=Ewr(),v4e=Il(),POi=gp(),Ylc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],DOi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],IOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],xOi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],wOi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],ROi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],kOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],Klc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],Jlc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],Zlc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],NOi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",Xlc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],euc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function tuc(t,e){return e.getConfig(v4e.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(tuc,"getModelCapabilityOverride");function p$(t){return"id"in t?t.id:t.model}a(p$,"getModelId");function ruc(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Ylc.includes(e)}a(ruc,"isHiddenModelA");function Nkr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return DOi.includes(e)}a(Nkr,"isHiddenModelB");function fEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Klc.includes(e)}a(fEt,"isHiddenModelE");function pEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Jlc.includes(e)}a(pEt,"isHiddenModelF");function hEt(t){let e=(0,_0.getCachedSha256Hash)(t.family);return Xlc.includes(e)}a(hEt,"isHiddenFamilyH");function nuc(t){return(0,_0.getCachedSha256Hash)(t.family)===NOi}a(nuc,"isHiddenModelK");function Mkr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||Zlc.includes(e)}a(Mkr,"isGpt54");function Okr(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||DOi.includes(e)}a(Okr,"isGpt55");function iuc(t,e){let r=t.get(v4e.IConfigurationService),n=t.get(POi.IExperimentationService);return Okr(e)&&r.getExperimentBasedConfig(v4e.ConfigKey.EnableGpt55EconomicalSearchAndEdit,n)}a(iuc,"isGpt55EconomicalSearchAndEditExp");function ouc(t,e){let r=t.get(v4e.IConfigurationService),n=t.get(POi.IExperimentationService);return Okr(e)&&r.getExperimentBasedConfig(v4e.ConfigKey.EnableGpt55LargePromptSections,n)}a(ouc,"isGpt55LargePromptSectionsExp");function b4e(t){let e=(0,_0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return euc.includes(e)}a(b4e,"isHiddenModelM");function Bkr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(Bkr,"isGpt53Codex");function mEt(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return IOi.includes(e)||IOi.includes(r)}a(mEt,"isVSCModelA");function gEt(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return xOi.includes(e)||xOi.includes(r)}a(gEt,"isVSCModelB");function S4e(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return kOi.includes(e)||kOi.includes(r)}a(S4e,"isVSCModelReplaceStringSet");function suc(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return wOi.includes(e)||wOi.includes(r)}a(suc,"isVSCModelC");function auc(t){let e=(0,_0.getCachedSha256Hash)(p$(t)),r=(0,_0.getCachedSha256Hash)(t.family);return ROi.includes(e)||ROi.includes(r)}a(auc,"isVSCModelD");function Lkr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(Lkr,"isGpt52CodexFamily");function Fkr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(Fkr,"isGpt52Family");function cuc(t){return t.includes("claude-3.5-sonnet")}a(cuc,"modelPrefersInstructionsInUserMessage");function luc(t){return t.includes("claude-3.5-sonnet")}a(luc,"modelPrefersInstructionsAfterHistory");function uuc(t){return S4e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||Lkr(t.family)||Bkr(t.family)||mEt(t)||gEt(t)||Fkr(t.family)||Mkr(t)||Nkr(t)||b4e(t)}a(uuc,"modelSupportsApplyPatch");function duc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||Lkr(t.family)||Bkr(t.family)||Fkr(t.family)||Mkr(t)||Nkr(t)||b4e(t)}a(duc,"modelPrefersJsonNotebookRepresentation");function fuc(t){return Ukr(t)||t.family.includes("grok-code")||MOi(t)||pEt(t)||AEt(t)||hEt(t)}a(fuc,"modelSupportsReplaceString");function MOi(t){return T4e(t)||fEt(t)||S4e(t)||AEt(t)||hEt(t)}a(MOi,"modelSupportsMultiReplaceString");function puc(t){return T4e(t)||t.family.includes("grok-code")||fEt(t)||t.family.toLowerCase().includes("gemini-3")||S4e(t)||pEt(t)||AEt(t)||hEt(t)}a(puc,"modelCanUseReplaceStringExclusively");function huc(t){return t.family.includes("gemini-2")}a(huc,"modelShouldUseReplaceStringHealing");function muc(t){return!T4e(t)&&!fEt(t)}a(muc,"modelCanUseMcpResultImageURL");function guc(t){return!0}a(guc,"modelCanUseImageURL");function Auc(t){return T4e(t)||yEt(t)||b4e(t)}a(Auc,"modelSupportsPDFDocuments");function yuc(t){return S4e(t)?!1:yEt(t)||mEt(t)||gEt(t)}a(yuc,"modelCanUseApplyPatchExclusively");function Euc(t){return Ukr(t)||pEt(t)}a(Euc,"modelNeedsStrongReplaceStringHint");function _uc(t){return yEt(t)||mEt(t)||gEt(t)}a(_uc,"modelSupportsSimplifiedApplyPatchInstructions");function T4e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(T4e,"isAnthropicFamily");function Ukr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,_0.getCachedSha256Hash)(e)===NOi}a(Ukr,"isGeminiFamily");function AEt(t){return t.family.toLowerCase().includes("minimax")}a(AEt,"isMinimaxFamily");function yEt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(yEt,"isGpt5PlusFamily");function Cuc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(Cuc,"isGptCodexFamily");function vuc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(vuc,"isGpt5Family");function buc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(buc,"isGptFamily");function Suc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Suc,"isGpt51Family");function Tuc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(Tuc,"getVerbosityForModelSync");function Iuc(t){let e=typeof t=="string"?t:p$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4-6")||!s.startsWith("claude-opus-4-1")&&s.startsWith("claude-opus-4-")},"matches");return n(e)||n(r)||b4e(r)}a(Iuc,"modelSupportsToolSearch");function xuc(t){let e=typeof t=="string"?t:p$(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(xuc,"modelSupportsContextEditing")});var CEt=I(_R=>{"use strict";p();Object.defineProperty(_R,"__esModule",{value:!0});_R.CUSTOM_TOOL_SEARCH_NAME=void 0;_R.modelSupportsInterleavedThinking=Ruc;_R.modelSupportsMemory=kuc;_R.isAnthropicContextEditingEnabled=Puc;_R.modelSupportsExtendedCacheTtl=OOi;_R.isExtendedCacheTtlEnabled=Duc;_R.isExtendedCacheTtlMessagesEnabled=Nuc;_R.buildContextManagement=BOi;_R.getContextManagementFromConfig=Muc;var _Et=Il(),EEt=I4e(),wuc=yR();_R.CUSTOM_TOOL_SEARCH_NAME="tool_search";function Ruc(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a(Ruc,"modelSupportsInterleavedThinking");function kuc(t){let e=typeof t=="string"?t:(0,EEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(kuc,"modelSupportsMemory");function Puc(t,e,r){return(typeof t=="string"?(0,EEt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,EEt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(_Et.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(Puc,"isAnthropicContextEditingEnabled");function OOi(t){let e=typeof t=="string"?t:(0,EEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(OOi,"modelSupportsExtendedCacheTtl");function Duc(t,e,r,n,o){return!OOi(t)||n!==wuc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(_Et.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(Duc,"isExtendedCacheTtlEnabled");function Nuc(t,e,r){return t?e.getExperimentBasedConfig(_Et.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(Nuc,"isExtendedCacheTtlMessagesEnabled");function BOi(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(BOi,"buildContextManagement");function Muc(t,e,r){let n=t.getExperimentBasedConfig(_Et.ConfigKey.AnthropicContextEditingMode,e);return BOi(n,r)}a(Muc,"getContextManagementFromConfig")});var Qkr=I(vEt=>{"use strict";p();Object.defineProperty(vEt,"__esModule",{value:!0});vEt.IToolDeferralService=void 0;var Ouc=rn();vEt.IToolDeferralService=(0,Ouc.createServiceIdentifier)("IToolDeferralService")});var Gkr=I(ME=>{"use strict";p();var Buc=ME&&ME.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Luc=ME&&ME.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Fuc=ME&&ME.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oTEt(n,r),e)}a(quc,"arrayHash");function juc(t,e){return e=j4(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=Hkr(n,r),TEt(t[n],r)),e)}a(juc,"objectHash");var Huc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new SEt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof jkr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Zge)},"hashAsync");ME.hashAsync=Huc;function qkr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(qkr,"leftRotate");function Zge(t,e=32){return t instanceof ArrayBuffer?(0,jkr.encodeHex)(jkr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Zge,"toHexString");var SEt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(bEt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Zge(this._h0)+Zge(this._h1)+Zge(this._h2)+Zge(this._h3)+Zge(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,qkr(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=qkr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=qkr(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};ME.StringSHA1=SEt});var Xge=I(x4e=>{"use strict";p();Object.defineProperty(x4e,"__esModule",{value:!0});x4e.TelemetryData=void 0;x4e.eventPropertiesToSimpleObject=$uc;var Guc=um(),$kr=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];Vuc(r,this.properties)}};x4e.TelemetryData=$kr;function $uc(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a($uc,"eventPropertiesToSimpleObject");function Vuc(t,e){e.unique_id=(0,Guc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Vuc,"addRequiredProperties")});var LOi=I(Vkr=>{"use strict";p();Object.defineProperty(Vkr,"__esModule",{value:!0});Vkr.extractThinkingDeltaFromChoice=Yuc;function Wuc(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(Wuc,"getThinkingDeltaText");function zuc(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(zuc,"getThinkingDeltaId");function Yuc(t){let e=t.message||t.delta;if(!e)return;let r=zuc(e),n=Wuc(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(Yuc,"extractThinkingDeltaFromChoice")});var wEt=I(Lre=>{"use strict";p();Object.defineProperty(Lre,"__esModule",{value:!0});Lre.SSEProcessor=void 0;Lre.splitChunk=UOi;Lre.convertToAPIJsonData=Zuc;Lre.sendCommunicationErrorTelemetry=eAe;var IEt=pp(),FOi=Xge(),Kuc=LOi(),xEt=f6(),C0=u6(),w4e=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},Wkr=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},zkr=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new Wkr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function UOi(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!==""),r]}a(UOi,"splitChunk");var Ykr=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,xEt.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new zkr,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,C0.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,C0.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=UOi(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),eAe(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&Juc(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),eAe(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new w4e(h.model||""),reason:C0.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),eAe(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,xEt.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,xEt.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(xEt.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),E!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await _({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new w4e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===C0.FinishedCompletionReason.FunctionCall||g.finish_reason===C0.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===C0.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===C0.FinishedCompletionReason.ToolCalls||g.finish_reason===C0.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??C0.FinishedCompletionReason.ClientTrimmed,filterReason:Xuc(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:C0.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),eAe(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),eAe(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?C0.FinishedCompletionReason.FunctionCall:C0.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:C0.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Lre.SSEProcessor=Ykr;function Juc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Juc,"isCopilotConfirmation");function Zuc(t){return{text:t.text.join(""),tokens:t.text}}a(Zuc,"convertToAPIJsonData");function Xuc(t){if(t.finish_reason===C0.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return C0.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return C0.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return C0.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return C0.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return C0.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return C0.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(Xuc,"choiceToFilterReason");function eAe(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=FOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:IEt.LogLevel[IEt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=FOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:IEt.LogLevel[IEt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a(eAe,"sendCommunicationErrorTelemetry")});var P4e=I(tAe=>{"use strict";p();Object.defineProperty(tAe,"__esModule",{value:!0});tAe.sendEngineMessagesLengthTelemetry=GOi;tAe.sendEngineMessagesTelemetry=$Oi;tAe.sendResponsesApiCompactionTelemetry=ddc;tAe.prepareChatCompletionForReturn=fdc;var edc=wo(),jOi=Gkr(),kEt=bP(),HOi=um(),tdc=C4e(),Jkr=o0(),k4e=Xge(),rdc=u6(),ndc=wEt();function GOi(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=k4e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,Jkr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,Jkr.multiplexProperties)(d.properties),d.measurements)}a(GOi,"sendEngineMessagesLengthTelemetry");var QOi=new kEt.LRUCache(1e3),qOi=new kEt.LRUCache(500),R4e=new kEt.LRUCache(1e3),REt={headerRequestId:null},Kkr=new kEt.LRUCache(100);function idc(t){let e=R4e.get(t);if(e!==void 0){let r=e+1;return R4e.set(t,r),r}else return R4e.set(t,1),1}a(idc,"updateHeaderRequestIdTracker");function odc(t){let e=Kkr.get(t);if(e!==void 0){let r=e+1;return Kkr.set(t,r),r}else return Kkr.set(t,1),1}a(odc,"updateConversationTracker");function sdc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,jOi.hash)(n).toString(),l=qOi.get(c);if(!l)l=(0,HOi.generateUuid)(),qOi.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(D4e,"__esModule",{value:!0});D4e.CompactionDataContainer=void 0;D4e.rawPartAsCompactionData=hdc;var pdc=wo(),VOi=V5e(),Zkr=class extends pdc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:VOi.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};D4e.CompactionDataContainer=Zkr;function hdc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===VOi.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(hdc,"rawPartAsCompactionData")});var YOi=I(N4e=>{"use strict";p();Object.defineProperty(N4e,"__esModule",{value:!0});N4e.PhaseDataContainer=void 0;N4e.rawPartAsPhaseData=gdc;var mdc=wo(),zOi=V5e(),Xkr=class extends mdc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:zOi.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};N4e.PhaseDataContainer=Xkr;function gdc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===zOi.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(gdc,"rawPartAsPhaseData")});var ZOi=I(H4=>{"use strict";p();Object.defineProperty(H4,"__esModule",{value:!0});H4.StatefulMarkerContainer=void 0;H4.rawPartAsStatefulMarker=JOi;H4.encodeStatefulMarker=Adc;H4.decodeStatefulMarker=ydc;H4.getAllStatefulMarkersAndIndicies=rPr;H4.getStatefulMarkerAndIndex=Edc;H4.getIndexOfStatefulMarker=_dc;var ePr=wo(),KOi=V5e(),tPr=class extends ePr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:KOi.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};H4.StatefulMarkerContainer=tPr;function JOi(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===KOi.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(JOi,"rawPartAsStatefulMarker");function Adc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(Adc,"encodeStatefulMarker");function ydc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(ydc,"decodeStatefulMarker");function*rPr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===ePr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===ePr.Raw.ChatCompletionContentPartKind.Opaque){let o=JOi(n);o&&(yield{statefulMarker:o,index:e})}}}}a(rPr,"getAllStatefulMarkersAndIndicies");function Edc(t,e){for(let r of rPr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Edc,"getStatefulMarkerAndIndex");function _dc(t,e){for(let r of rPr(e))if(r.statefulMarker.marker===t)return r.index}a(_dc,"getIndexOfStatefulMarker")});var t5i=I(y6=>{"use strict";p();var Cdc=y6&&y6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vdc=y6&&y6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),e5i=y6&&y6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.getModelCapabilityOverride=Icc;Zi.getModelId=n$;Zi.isHiddenModelA=xcc;Zi.isHiddenModelB=wPr;Zi.isHiddenModelE=oEt;Zi.isHiddenModelF=sEt;Zi.isHiddenFamilyH=aEt;Zi.isHiddenModelK=wcc;Zi.isGpt54=RPr;Zi.isGpt55=PPr;Zi.isGpt55EconomicalSearchAndEditExp=Rcc;Zi.isGpt55LargePromptSectionsExp=Pcc;Zi.isHiddenModelM=u4e;Zi.isGpt53Codex=kPr;Zi.isVSCModelA=cEt;Zi.isVSCModelB=lEt;Zi.isVSCModelReplaceStringSet=d4e;Zi.isVSCModelC=kcc;Zi.isVSCModelD=Dcc;Zi.isGpt52CodexFamily=DPr;Zi.isGpt52Family=NPr;Zi.modelPrefersInstructionsInUserMessage=Ncc;Zi.modelPrefersInstructionsAfterHistory=Mcc;Zi.modelSupportsApplyPatch=Occ;Zi.modelPrefersJsonNotebookRepresentation=Bcc;Zi.modelSupportsReplaceString=Lcc;Zi.modelSupportsMultiReplaceString=zOi;Zi.modelCanUseReplaceStringExclusively=Fcc;Zi.modelShouldUseReplaceStringHealing=Ucc;Zi.modelCanUseMcpResultImageURL=Qcc;Zi.modelCanUseImageURL=qcc;Zi.modelSupportsPDFDocuments=jcc;Zi.modelCanUseApplyPatchExclusively=Hcc;Zi.modelNeedsStrongReplaceStringHint=Gcc;Zi.modelSupportsSimplifiedApplyPatchInstructions=$cc;Zi.isAnthropicFamily=f4e;Zi.isGeminiFamily=MPr;Zi.isMinimaxFamily=uEt;Zi.isGpt5PlusFamily=dEt;Zi.isGptCodexFamily=Vcc;Zi.isGpt5Family=Wcc;Zi.isGptFamily=zcc;Zi.isGpt51Family=Ycc;Zi.getVerbosityForModelSync=Kcc;Zi.modelSupportsToolSearch=Jcc;Zi.modelSupportsContextEditing=Zcc;var v0=gwr(),l4e=Sl(),$Oi=_p(),_cc=["a99dd17dfee04155d863268596b7f6dd36d0a6531cd326348dbe7416142a21a3","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95"],VOi=["1f48b3271e760c69ab2b17dcae5f5c661fa5b644c5976a8a99b23e05ae3cb6d6","ffc50c70661c227edf8daae6f8dbed2dd0645386c12d43bc7fc44da166e043bd","257c934076307881132be702a901618969591f0e11e1df51b22b1d4010f0a0d0"],QOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7"],qOi=["6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c"],jOi=["0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73"],HOi=["e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],GOi=["6db59e9bfe6e2ce608c0ee0ade075c64e4d054f05305e3034481234703381bb5","6b0f165d0590bf8d508540a796b4fda77bf6a0a4ed4e8524d5451b1913100a95","d7b81f23b6ab47d41130359bc203a6c653bba461b3da0185406353ce2b3abfa7","1cdd4febbc7ee6b1abe0fbdd42217744c5912c79366db4befd91698b46c40a3c","0425aeda24d2fd93e2a879c4d813e4f3997aa444f1f4a633241236f9f773df73","e82ff0e2d4e4bae1f012dc599d520f8d61becfc4762f3717577b270be199db92"],vcc=["6013de0381f648b7f21518885c02b40b7583adfb33c6d9b64d3aed52c3934798"],Ccc=["ab45e8474269b026f668d49860b36850122e18a50d5ea38f3fefdae08261865c","9542d5c077c2bc379f92be32272b14be8b94a8841323465db0d5b3d6f4f0dab0"],bcc=["0a4346f806b28b3ce94905c3ac56fcd5ee2337d8613161696aba52eb0c3551cc","2a7b79b0151aa44a0abee17adc0e18df1c07d8d15d7affa989c3b3afb6bee0a0","f3c2984127dd2db50a555194925ca0d55c3c7b676e889c9406b2e6875a67e29c","5a81e6aa7556585ba7c569881d1103683adc9e0124ff7952df423afba2f167b5"],WOi="a62e299160a1075d9973c28a7aa77f446c21c09887c7aa65c11022918cf83eda",Scc=["70fcded3f255d368e868cc807d8838a62108bfa5c86ce7d37966f58cda229e33"],Tcc=["0902565c0c0fe145633a1f246ae551acc0f621249ef050428eba357fbd4655ee"];function Icc(t,e){return e.getConfig(l4e.ConfigKey.Advanced.ModelCapabilityOverrides)?.[t]}a(Icc,"getModelCapabilityOverride");function n$(t){return"id"in t?t.id:t.model}a(n$,"getModelId");function xcc(t){let e=(0,v0.getCachedSha256Hash)(t.family);return _cc.includes(e)}a(xcc,"isHiddenModelA");function wPr(t){let e=(0,v0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return VOi.includes(e)}a(wPr,"isHiddenModelB");function oEt(t){let e=(0,v0.getCachedSha256Hash)(t.family);return vcc.includes(e)}a(oEt,"isHiddenModelE");function sEt(t){let e=(0,v0.getCachedSha256Hash)(t.family);return Ccc.includes(e)}a(sEt,"isHiddenModelF");function aEt(t){let e=(0,v0.getCachedSha256Hash)(t.family);return Scc.includes(e)}a(aEt,"isHiddenFamilyH");function wcc(t){return(0,v0.getCachedSha256Hash)(t.family)===WOi}a(wcc,"isHiddenModelK");function RPr(t){let e=(0,v0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.4")||bcc.includes(e)}a(RPr,"isGpt54");function PPr(t){let e=(0,v0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return(typeof t=="string"?t:t.family).startsWith("gpt-5.5")||VOi.includes(e)}a(PPr,"isGpt55");function Rcc(t,e){let r=t.get(l4e.IConfigurationService),n=t.get($Oi.IExperimentationService);return PPr(e)&&r.getExperimentBasedConfig(l4e.ConfigKey.EnableGpt55EconomicalSearchAndEdit,n)}a(Rcc,"isGpt55EconomicalSearchAndEditExp");function Pcc(t,e){let r=t.get(l4e.IConfigurationService),n=t.get($Oi.IExperimentationService);return PPr(e)&&r.getExperimentBasedConfig(l4e.ConfigKey.EnableGpt55LargePromptSections,n)}a(Pcc,"isGpt55LargePromptSectionsExp");function u4e(t){let e=(0,v0.getCachedSha256Hash)(typeof t=="string"?t:t.family);return Tcc.includes(e)}a(u4e,"isHiddenModelM");function kPr(t){return(typeof t=="string"?t:t.family).startsWith("gpt-5.3-codex")}a(kPr,"isGpt53Codex");function cEt(t){let e=(0,v0.getCachedSha256Hash)(n$(t)),r=(0,v0.getCachedSha256Hash)(t.family);return QOi.includes(e)||QOi.includes(r)}a(cEt,"isVSCModelA");function lEt(t){let e=(0,v0.getCachedSha256Hash)(n$(t)),r=(0,v0.getCachedSha256Hash)(t.family);return qOi.includes(e)||qOi.includes(r)}a(lEt,"isVSCModelB");function d4e(t){let e=(0,v0.getCachedSha256Hash)(n$(t)),r=(0,v0.getCachedSha256Hash)(t.family);return GOi.includes(e)||GOi.includes(r)}a(d4e,"isVSCModelReplaceStringSet");function kcc(t){let e=(0,v0.getCachedSha256Hash)(n$(t)),r=(0,v0.getCachedSha256Hash)(t.family);return jOi.includes(e)||jOi.includes(r)}a(kcc,"isVSCModelC");function Dcc(t){let e=(0,v0.getCachedSha256Hash)(n$(t)),r=(0,v0.getCachedSha256Hash)(t.family);return HOi.includes(e)||HOi.includes(r)}a(Dcc,"isVSCModelD");function DPr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2-codex"}a(DPr,"isGpt52CodexFamily");function NPr(t){return(typeof t=="string"?t:t.family)==="gpt-5.2"}a(NPr,"isGpt52Family");function Ncc(t){return t.includes("claude-3.5-sonnet")}a(Ncc,"modelPrefersInstructionsInUserMessage");function Mcc(t){return t.includes("claude-3.5-sonnet")}a(Mcc,"modelPrefersInstructionsAfterHistory");function Occ(t){return d4e(t)?!1:t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||DPr(t.family)||kPr(t.family)||cEt(t)||lEt(t)||NPr(t.family)||RPr(t)||wPr(t)||u4e(t)}a(Occ,"modelSupportsApplyPatch");function Bcc(t){return t.family.startsWith("gpt")&&!t.family.includes("gpt-4o")||t.family==="o4-mini"||DPr(t.family)||kPr(t.family)||NPr(t.family)||RPr(t)||wPr(t)||u4e(t)}a(Bcc,"modelPrefersJsonNotebookRepresentation");function Lcc(t){return MPr(t)||t.family.includes("grok-code")||zOi(t)||sEt(t)||uEt(t)||aEt(t)}a(Lcc,"modelSupportsReplaceString");function zOi(t){return f4e(t)||oEt(t)||d4e(t)||uEt(t)||aEt(t)}a(zOi,"modelSupportsMultiReplaceString");function Fcc(t){return f4e(t)||t.family.includes("grok-code")||oEt(t)||t.family.toLowerCase().includes("gemini-3")||d4e(t)||sEt(t)||uEt(t)||aEt(t)}a(Fcc,"modelCanUseReplaceStringExclusively");function Ucc(t){return t.family.includes("gemini-2")}a(Ucc,"modelShouldUseReplaceStringHealing");function Qcc(t){return!f4e(t)&&!oEt(t)}a(Qcc,"modelCanUseMcpResultImageURL");function qcc(t){return!0}a(qcc,"modelCanUseImageURL");function jcc(t){return f4e(t)||dEt(t)||u4e(t)}a(jcc,"modelSupportsPDFDocuments");function Hcc(t){return d4e(t)?!1:dEt(t)||cEt(t)||lEt(t)}a(Hcc,"modelCanUseApplyPatchExclusively");function Gcc(t){return MPr(t)||sEt(t)}a(Gcc,"modelNeedsStrongReplaceStringHint");function $cc(t){return dEt(t)||cEt(t)||lEt(t)}a($cc,"modelSupportsSimplifiedApplyPatchInstructions");function f4e(t){return t.family.startsWith("claude")||t.family.startsWith("Anthropic")}a(f4e,"isAnthropicFamily");function MPr(t){let e=typeof t=="string"?t:t.family;return e.toLowerCase().startsWith("gemini")||(0,v0.getCachedSha256Hash)(e)===WOi}a(MPr,"isGeminiFamily");function uEt(t){return t.family.toLowerCase().includes("minimax")}a(uEt,"isMinimaxFamily");function dEt(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5"):!1}a(dEt,"isGpt5PlusFamily");function Vcc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return!!e.startsWith("gpt-")&&e.includes("-codex")}a(Vcc,"isGptCodexFamily");function Wcc(t){if(!t)return!1;let e=typeof t=="string"?t:t.family;return e==="gpt-5"||e==="gpt-5-mini"||e==="gpt-5-codex"}a(Wcc,"isGpt5Family");function zcc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-"):!1}a(zcc,"isGptFamily");function Ycc(t){return t?!!(typeof t=="string"?t:t.family).startsWith("gpt-5.1"):!1}a(Ycc,"isGpt51Family");function Kcc(t){if(t.family==="gpt-5.1"||t.family==="gpt-5-mini")return"low"}a(Kcc,"getVerbosityForModelSync");function Jcc(t){let e=typeof t=="string"?t:n$(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s==="gpt-5-4"||s==="gpt-5-5"||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4-6")||!s.startsWith("claude-opus-4-1")&&s.startsWith("claude-opus-4-")},"matches");return n(e)||n(r)||u4e(r)}a(Jcc,"modelSupportsToolSearch");function Zcc(t){let e=typeof t=="string"?t:n$(t),r=typeof t=="string"?t:t.family,n=a(l=>l.toLowerCase().replace(/\./g,"-"),"normalize"),o=n(e),s=n(r);if(o.includes("1m")||s.includes("1m"))return!1;let c=a(l=>l.startsWith("claude-haiku-4-5")||l.startsWith("claude-sonnet-4-6")||l.startsWith("claude-sonnet-4-5")||l.startsWith("claude-sonnet-4")||l.startsWith("claude-opus-4-6")||l.startsWith("claude-opus-4-5")||l.startsWith("claude-opus-4-1")||l.startsWith("claude-opus-4"),"matches");return c(o)||c(s)}a(Zcc,"modelSupportsContextEditing")});var hEt=I(yR=>{"use strict";p();Object.defineProperty(yR,"__esModule",{value:!0});yR.CUSTOM_TOOL_SEARCH_NAME=void 0;yR.modelSupportsInterleavedThinking=elc;yR.modelSupportsMemory=tlc;yR.isAnthropicContextEditingEnabled=rlc;yR.modelSupportsExtendedCacheTtl=YOi;yR.isExtendedCacheTtlEnabled=nlc;yR.isExtendedCacheTtlMessagesEnabled=ilc;yR.buildContextManagement=KOi;yR.getContextManagementFromConfig=olc;var pEt=Sl(),fEt=p4e(),Xcc=gR();yR.CUSTOM_TOOL_SEARCH_NAME="tool_search";function elc(t){let e=t.toLowerCase().replace(/\./g,"-");return e.startsWith("claude-sonnet-4-5")||e.startsWith("claude-sonnet-4")||e.startsWith("claude-haiku-4-5")||e.startsWith("claude-opus-4-5")}a(elc,"modelSupportsInterleavedThinking");function tlc(t){let e=typeof t=="string"?t:(0,fEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-haiku-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-sonnet-4")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-opus-4-1")||s.startsWith("claude-opus-4")},"matches");return n(e)||n(r)}a(tlc,"modelSupportsMemory");function rlc(t,e,r){return(typeof t=="string"?(0,fEt.modelSupportsContextEditing)(t):t.supportsContextEditing??(0,fEt.modelSupportsContextEditing)(t.model))?e.getExperimentBasedConfig(pEt.ConfigKey.AnthropicContextEditingMode,r)!=="off":!1}a(rlc,"isAnthropicContextEditingEnabled");function YOi(t){let e=typeof t=="string"?t:(0,fEt.getModelId)(t),r=typeof t=="string"?t:t.family,n=a(o=>{let s=o.toLowerCase().replace(/\./g,"-");return s.startsWith("claude-opus-4-7")||s.startsWith("claude-opus-4-6")||s.startsWith("claude-opus-4-5")||s.startsWith("claude-sonnet-4-6")||s.startsWith("claude-sonnet-4-5")||s.startsWith("claude-haiku-4-5")},"matches");return n(e)||n(r)}a(YOi,"modelSupportsExtendedCacheTtl");function nlc(t,e,r,n,o){return!YOi(t)||n!==Xcc.ChatLocation.Agent||o?!1:e.getExperimentBasedConfig(pEt.ConfigKey.Advanced.AnthropicExtendedCacheTtl,r)}a(nlc,"isExtendedCacheTtlEnabled");function ilc(t,e,r){return t?e.getExperimentBasedConfig(pEt.ConfigKey.Advanced.AnthropicExtendedCacheTtlMessages,r):!1}a(ilc,"isExtendedCacheTtlMessagesEnabled");function KOi(t,e){if(t==="off")return;let r=[];return(t==="clear-thinking"||t==="clear-both")&&e&&r.push({type:"clear_thinking_20251015",keep:{type:"thinking_turns",value:1}}),(t==="clear-tooluse"||t==="clear-both")&&r.push({type:"clear_tool_uses_20250919",trigger:{type:"input_tokens",value:1e5},keep:{type:"tool_uses",value:3}}),r.length>0?{edits:r}:void 0}a(KOi,"buildContextManagement");function olc(t,e,r){let n=t.getExperimentBasedConfig(pEt.ConfigKey.AnthropicContextEditingMode,e);return KOi(n,r)}a(olc,"getContextManagementFromConfig")});var OPr=I(mEt=>{"use strict";p();Object.defineProperty(mEt,"__esModule",{value:!0});mEt.IToolDeferralService=void 0;var slc=tn();mEt.IToolDeferralService=(0,slc.createServiceIdentifier)("IToolDeferralService")});var UPr=I(kE=>{"use strict";p();var alc=kE&&kE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),clc=kE&&kE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),llc=kE&&kE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oyEt(n,r),e)}a(flc,"arrayHash");function plc(t,e){return e=B4(181387,e),Object.keys(t).sort().reduce((r,n)=>(r=FPr(n,r),yEt(t[n],r)),e)}a(plc,"objectHash");var hlc=a(t=>{if(typeof t=="string"&&t.length<250){let r=new AEt;return r.update(t),Promise.resolve(r.digest())}let e;return typeof t=="string"?e=new TextEncoder().encode(t):t instanceof LPr.VSBuffer?e=t.buffer:e=t,crypto.subtle.digest("sha-1",e).then(Hge)},"hashAsync");kE.hashAsync=hlc;function BPr(t,e,r=32){let n=r-e,o=~((1<>>n)>>>0}a(BPr,"leftRotate");function Hge(t,e=32){return t instanceof ArrayBuffer?(0,LPr.encodeHex)(LPr.VSBuffer.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}a(Hge,"toHexString");var AEt=class t{static{a(this,"StringSHA1")}static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let r=e.length;if(r===0)return;let n=this._buff,o=this._buffLen,s=this._leftoverHighSurrogate,c,l;for(s!==0?(c=s,l=-1,s=0):(c=e.charCodeAt(0),l=0);;){let u=c;if(gEt.isHighSurrogate(c))if(l+1>>6,e[r++]=128|(n&63)>>>0):n<65536?(e[r++]=224|(n&61440)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0):(e[r++]=240|(n&1835008)>>>18,e[r++]=128|(n&258048)>>>12,e[r++]=128|(n&4032)>>>6,e[r++]=128|(n&63)>>>0),r>=64&&(this._step(),r-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),r}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Hge(this._h0)+Hge(this._h1)+Hge(this._h2)+Hge(this._h3)+Hge(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e=t._bigBlock32,r=this._buffDV;for(let h=0;h<64;h+=4)e.setUint32(h,r.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)e.setUint32(h,BPr(e.getUint32(h-12,!1)^e.getUint32(h-32,!1)^e.getUint32(h-56,!1)^e.getUint32(h-64,!1),1),!1);let n=this._h0,o=this._h1,s=this._h2,c=this._h3,l=this._h4,u,d,f;for(let h=0;h<80;h++)h<20?(u=o&s|~o&c,d=1518500249):h<40?(u=o^s^c,d=1859775393):h<60?(u=o&s|o&c|s&c,d=2400959708):(u=o^s^c,d=3395469782),f=BPr(n,5)+u+l+d+e.getUint32(h*4,!1)&4294967295,l=c,c=s,s=BPr(o,30),o=n,n=f;this._h0=this._h0+n&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+s&4294967295,this._h3=this._h3+c&4294967295,this._h4=this._h4+l&4294967295}};kE.StringSHA1=AEt});var Gge=I(h4e=>{"use strict";p();Object.defineProperty(h4e,"__esModule",{value:!0});h4e.TelemetryData=void 0;h4e.eventPropertiesToSimpleObject=glc;var mlc=fm(),QPr=class t{static{a(this,"TelemetryData")}static{this.keysExemptedFromSanitization=["VSCode.ABExp.Features","abexp.assignmentcontext"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},Date.now())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=Date.now())}extendWithEditorAgnosticFields(e){this.properties.editor_version=e.getEditorInfo().format(),this.properties.editor_plugin_version=e.getEditorPluginInfo().format(),this.properties.client_machineid=e.machineId,this.properties.client_sessionid=e.sessionId,this.properties.copilot_version=`copilot/${e.getVersion()}`,this.properties.common_extname=e.getEditorPluginInfo().name,this.properties.common_extversion=e.getEditorPluginInfo().version,this.properties.common_vscodeversion=e.getEditorInfo().format()}extendWithConfigProperties(e,r,n){let o=e.dumpConfig();o["copilot.build"]=r.getBuild(),o["copilot.buildType"]=r.getBuildType(),n.trackingId&&(o["copilot.trackingId"]=n.trackingId),n.organizationsList&&(o.organizations_list=n.organizationsList),n.enterpriseList&&(o.enterprise_list=n.enterpriseList),this.properties={...this.properties,...o}}extendWithRequestId(e){let r={completionId:e.completionId,created:e.created.toString(),headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetry=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(e)return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetry.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}updateTimeSinceIssuedAndDisplayed(){let e=Date.now()-this.issuedTime;if(this.measurements.timeSinceIssuedMs===void 0&&(this.measurements.timeSinceIssuedMs=e),this.measurements.timeSinceDisplayedMs===void 0&&this.displayedTime!==void 0){let r=Date.now()-this.displayedTime;this.measurements.timeSinceDisplayedMs=r}}makeReadyForSending(e,r,n){this.extendWithConfigProperties(e,r,n),this.extendWithEditorAgnosticFields(r),this.sanitizeKeys(),this.updateTimeSinceIssuedAndDisplayed();for(let o in this.properties)this.properties[o]===void 0&&delete this.properties[o];Alc(r,this.properties)}};h4e.TelemetryData=QPr;function glc(t){if(!t)return;let e={};for(let r in t){let n=t[r];n&&(n.value?e[r]=n.value:e[r]=n)}return e}a(glc,"eventPropertiesToSimpleObject");function Alc(t,e){e.unique_id=(0,mlc.generateUuid)(),e.common_extname=t.getEditorPluginInfo().name,e.common_extversion=t.getEditorPluginInfo().version,e.common_vscodeversion=t.getEditorInfo().format()}a(Alc,"addRequiredProperties")});var JOi=I(qPr=>{"use strict";p();Object.defineProperty(qPr,"__esModule",{value:!0});qPr.extractThinkingDeltaFromChoice=_lc;function ylc(t){if(!t)return"";if(t.cot_summary)return t.cot_summary;if(t.reasoning_text)return t.reasoning_text;if(t.reasoning_content)return t.reasoning_content;if(t.reasoning)return t.reasoning;if(t.thinking)return t.thinking}a(ylc,"getThinkingDeltaText");function Elc(t){if(t){if(t.cot_id)return t.cot_id;if(t.reasoning_opaque)return t.reasoning_opaque;if(t.signature)return t.signature}}a(Elc,"getThinkingDeltaId");function _lc(t){let e=t.message||t.delta;if(!e)return;let r=Elc(e),n=ylc(e);if(e.reasoning_opaque)return{id:e.reasoning_opaque,text:n,encrypted:e.reasoning_opaque};if(r&&n)return{id:r,text:n};if(n)return{text:n};if(r)return{id:r}}a(_lc,"extractThinkingDeltaFromChoice")});var vEt=I(Dre=>{"use strict";p();Object.defineProperty(Dre,"__esModule",{value:!0});Dre.SSEProcessor=void 0;Dre.splitChunk=XOi;Dre.convertToAPIJsonData=blc;Dre.sendCommunicationErrorTelemetry=$ge;var EEt=Ap(),ZOi=Gge(),vlc=JOi(),_Et=i6(),C0=r6(),m4e=class t{static{a(this,"APIJsonDataStreaming")}constructor(e){this.model=e,this._text=[],this._newText=[]}get text(){return this._text}append(e){if(e.text){let r=t._removeCR(e.text);this._text.push(r),this._newText.push(r)}if(e.delta?.content){let r=t._removeCR(e.delta.content);this._text.push(r),this._newText.push(r)}if(e.delta?.function_call&&(e.delta.function_call.name||e.delta.function_call.arguments)){let r=t._removeCR(e.delta.function_call.arguments);this._text.push(r),this._newText.push(r)}}flush(){let e=this._newText.join("");return this._newText=[],e}static _removeCR(e){return e.replace(/\r$/g,"")}toJSON(){return{text:this._text,newText:this._newText}}},jPr=class{static{a(this,"StreamingToolCall")}constructor(){this.arguments=""}update(e){let r=!1;return e.id&&(this.id=e.id),e.function?.name&&(this.name=e.function.name),e.function?.arguments&&(this.arguments+=e.function.arguments,r=!0),r}},HPr=class{static{a(this,"StreamingToolCalls")}constructor(){this.toolCalls=[]}getToolCalls(){return this.toolCalls.map(e=>({name:e.name,arguments:e.arguments,id:e.id}))}hasToolCalls(){return this.toolCalls.length>0}update(e){let r=[];return e.delta?.tool_calls?.forEach(n=>{let o;n.id&&(o=this.toolCalls.find(c=>c.id===n.id)),o||(o=this.toolCalls.at(-1)),(!o||n.id&&o.id&&o.id!==n.id)&&(o=new jPr,this.toolCalls.push(o)),o.update(n)&&o.name&&r.push({name:o.name,arguments:o.arguments,id:o.id})}),r}};function XOi(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!==""),r]}a(XOi,"splitChunk");var GPr=class t{static{a(this,"SSEProcessor")}constructor(e,r,n,o,s,c){this.logService=e,this.telemetryService=r,this.expectedNumChoices=n,this.response=o,this.body=s,this.cancellationToken=c,this.requestId=(0,_Et.getRequestId)(this.response.headers),this.solutions={},this.completedFunctionCallIdxs=new Map,this.functionCalls={},this.toolCalls=new HPr,this.functionCallName=void 0}static async create(e,r,n,o,s){let c=o.body.pipeThrough(new TextDecoderStream);return new t(e,r,n,o,c,s)}async*processSSE(e=async()=>{}){try{if(this.expectedNumChoices>1)for await(let r of this.processSSEInner(e))(0,C0.isApiUsage)(r)||(yield r);else{let r,n;for await(let o of this.processSSEInner(e))(0,C0.isApiUsage)(o)?n=o:r=o;if(await this.maybeCancel("after receiving the completion, but maybe before we got the usage"))return;r&&(r.usage=n,yield r)}}finally{await this.cancel(),this.logService.info(`request done: requestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`)}}async*processSSEInner(e){let r="",n=!1,o=!0,s=!1;for await(let c of this.body){if(await this.maybeCancel("after awaiting body chunk"))return;let[l,u]=XOi(r+c.toString());r=u;for(let d of l){if(d.startsWith(":"))continue;let f=d.slice(5).trim();if(f==="[DONE]"){yield*this.finishSolutions();return}let h;try{h=JSON.parse(f)}catch{this.logService.error(`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:${d}`),$ge(this.telemetryService,`Error parsing JSON stream data for request id ${this.requestId.headerRequestId}:`,d);continue}if(h.usage&&(h.copilot_usage&&typeof h.copilot_usage.total_nano_aiu=="number"&&(h.usage.copilot_usage=h.copilot_usage),yield h.usage),h.copilot_confirmation&&Clc(h.copilot_confirmation)&&await e("",0,{text:"",copilotConfirmation:h.copilot_confirmation}),!h.choices){!h.copilot_references&&!h.copilot_confirmation&&(h.error!==void 0?(this.logService.error(`Error in response for request id ${this.requestId.headerRequestId}:${h.error.message}`),$ge(this.telemetryService,`Error in response for request id ${this.requestId.headerRequestId}:`,h.error.message),yield{index:0,finishOffset:void 0,solution:new m4e(h.model||""),reason:C0.FinishedCompletionReason.ServerError,error:h.error,requestId:this.requestId}):(this.logService.error(`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`),$ge(this.telemetryService,`Unexpected response with no choices or error for request id ${this.requestId.headerRequestId}`))),h.copilot_errors&&await e("",0,{text:"",copilotErrors:h.copilot_errors}),h.copilot_references&&await e("",0,{text:"",copilotReferences:h.copilot_references});continue}this.requestId.created===0&&(this.requestId=(0,_Et.getRequestId)(this.response.headers,h),this.requestId.created===0&&h.choices?.length&&(this.requestId.created=Math.floor(Date.now()/1e3)));for(let m=0;m(T?.vulnAnnotations&&(!Array.isArray(T.vulnAnnotations)||!T.vulnAnnotations.every(w=>(0,_Et.isCopilotAnnotation)(w)))&&(T.vulnAnnotations=void 0),T?.ipCodeCitations&&(!Array.isArray(T.ipCodeCitations)||!T.ipCodeCitations.every(_Et.isCodeCitationAnnotation))&&(T.ipCodeCitations=void 0),E=await e(y.text.join(""),g.index,{text:y.flush(),logprobs:g.logprobs,codeVulnAnnotations:T?.vulnAnnotations,ipCitations:T?.ipCodeCitations,copilotReferences:T?.references,copilotToolCalls:T?.toolCalls,copilotToolCallStreamUpdates:T?.toolCallStreamUpdates,_deprecatedCopilotFunctionCalls:T?.functionCalls,beginToolCalls:T?.beginToolCalls,copilotErrors:T?.errors,thinking:A??T?.thinking}),E!==void 0&&(n=!0),await this.maybeCancel("after awaiting finishedCb")),"emitSolution"),v=!0;if(g.delta?.tool_calls){if(!this.toolCalls.hasToolCalls()){let R=g.delta.tool_calls.at(0),x=R?.function?.name;if(x&&(y.text.length&&y.append({index:0,delta:{content:" "}}),await _({beginToolCalls:[{name:x,id:R?.id}]})))continue}let w=this.toolCalls.update(g);if(w.length&&await _({toolCallStreamUpdates:w}))continue}else if(g.delta?.copilot_annotations?.CodeVulnerability||g.delta?.copilot_annotations?.IPCodeCitations){if(await _()||!n&&(y.append(g),await _({vulnAnnotations:g.delta?.copilot_annotations?.CodeVulnerability,ipCodeCitations:g.delta?.copilot_annotations?.IPCodeCitations})))continue}else if(g.delta?.role==="function"){if(g.delta.content)try{let T=JSON.parse(g.delta.content);if(Array.isArray(T)&&await _({references:T}))continue}catch(T){this.logService.error(`Error parsing function references: ${JSON.stringify(T)}`)}}else if(g.delta?.function_call&&(g.delta.function_call.name||g.delta.function_call.arguments))o=!1,this.functionCallName??=g.delta.function_call.name,this.functionCalls[this.functionCallName]??=new m4e(h.model),this.functionCalls[this.functionCallName].append(g);else if((g.finish_reason===C0.FinishedCompletionReason.FunctionCall||g.finish_reason===C0.FinishedCompletionReason.Stop)&&this.functionCallName){let T=this.functionCalls[this.functionCallName],w={name:this.functionCallName,arguments:T.flush()};this.completedFunctionCallIdxs.set(g.index,"function");try{if(await _({functionCalls:[w]}))continue}catch(R){this.logService.error(R)}if(this.functionCalls[this.functionCallName]=null,this.functionCallName=void 0,g.finish_reason===C0.FinishedCompletionReason.FunctionCall)continue}else v=!1;if((g.finish_reason===C0.FinishedCompletionReason.ToolCalls||g.finish_reason===C0.FinishedCompletionReason.Stop)&&this.toolCalls.hasToolCalls()){v=!0;let T=this.toolCalls.getToolCalls();this.completedFunctionCallIdxs.set(g.index,"tool");let w=T.length>0?T[0].id:void 0;try{if(await _({toolCalls:T,thinking:w&&s?{metadata:{toolId:w}}:void 0}))continue}catch(R){this.logService.error(R)}}if(!(!v&&(y.append(g),await _())||!(g.finish_reason||E!==void 0))){if(yield{solution:y,finishOffset:E,reason:g.finish_reason??C0.FinishedCompletionReason.ClientTrimmed,filterReason:Slc(g),requestId:this.requestId,index:g.index},await this.maybeCancel("after yielding finished choice"))return;o&&(this.solutions[g.index]=null)}}}}for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l!==null&&(yield{solution:l,finishOffset:void 0,reason:C0.FinishedCompletionReason.ClientIterationDone,requestId:this.requestId,index:u},await this.maybeCancel("after yielding after iteration done")))return}if(r.length>0&&!n)try{let c=JSON.parse(r);c.error!==void 0&&(this.logService.error(c.error,`Error in response: ${c.error.message}`),$ge(this.telemetryService,`Error in response: ${c.error.message}`,c.error))}catch{this.logService.error(`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`),$ge(this.telemetryService,`Error parsing extraData for request id ${this.requestId.headerRequestId}: ${r}`)}}async*finishSolutions(){for(let[e,r]of Object.entries(this.solutions)){let n=Number(e);if(r!==null){if(this.completedFunctionCallIdxs.has(n)){yield{solution:r,finishOffset:void 0,reason:this.completedFunctionCallIdxs.get(n)==="function"?C0.FinishedCompletionReason.FunctionCall:C0.FinishedCompletionReason.ToolCalls,requestId:this.requestId,index:n};continue}if(yield{solution:r,finishOffset:void 0,reason:C0.FinishedCompletionReason.ClientDone,requestId:this.requestId,index:n},await this.maybeCancel("after yielding on DONE"))return}}}async maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(this.logService.debug("Cancelled: "+e),await this.cancel(),!0):!1}async cancel(){await this.response.body.destroy()}logChoice(e){let r={...e};delete r.index,delete r.content_filter_results,delete r.content_filter_offsets,this.logService.trace(`choice ${JSON.stringify(r)}`)}};Dre.SSEProcessor=GPr;function Clc(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(Clc,"isCopilotConfirmation");function blc(t){return{text:t.text.join(""),tokens:t.text}}a(blc,"convertToAPIJsonData");function Slc(t){if(t.finish_reason===C0.FinishedCompletionReason.ContentFilter){if(t.delta?.copilot_annotations?.TextCopyright)return C0.FilterReason.Copyright;if(t.delta?.copilot_annotations?.Sexual||t.delta?.copilot_annotations?.SexualPattern)return C0.FilterReason.Sexual;if(t.delta?.copilot_annotations?.Violence)return C0.FilterReason.Violence;if(t.delta?.copilot_annotations?.HateSpeech||t.delta?.copilot_annotations?.HateSpeechPattern)return C0.FilterReason.Hate;if(t.delta?.copilot_annotations?.SelfHarm)return C0.FilterReason.SelfHarm;if(t.delta?.copilot_annotations?.PromptPromBlockList)return C0.FilterReason.Prompt;if(t.content_filter_results){for(let e of Object.keys(t.content_filter_results))if(t.content_filter_results[e]?.filtered)return e}}}a(Slc,"choiceToFilterReason");function $ge(t,e,r){let n=[e,r],o=n.length>0?JSON.stringify(n):"no msg",s=ZOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:EEt.LogLevel[EEt.LogLevel.Error],message:o});t.sendEnhancedGHTelemetryErrorEvent("log",s.properties,s.measurements);let c=ZOi.TelemetryData.createAndMarkAsIssued({context:"fetch",level:EEt.LogLevel[EEt.LogLevel.Error],message:"[redacted]"});t.sendGHTelemetryErrorEvent("log",c.properties,c.measurements)}a($ge,"sendCommunicationErrorTelemetry")});var y4e=I(Vge=>{"use strict";p();Object.defineProperty(Vge,"__esModule",{value:!0});Vge.sendEngineMessagesLengthTelemetry=i5i;Vge.sendEngineMessagesTelemetry=o5i;Vge.sendResponsesApiCompactionTelemetry=Blc;Vge.prepareChatCompletionForReturn=Llc;var Tlc=xo(),r5i=UPr(),bEt=XP(),n5i=fm(),Ilc=c4e(),VPr=Bh(),A4e=Gge(),xlc=r6(),wlc=vEt();function i5i(t,e,r,n,o){let s=n?"output":"input",c=r.properties.modelCallId;if(!c){o?.warn("[TELEMETRY] modelCallId not found in telemetryData, input/output messages cannot be linked");return}let l=e.map(f=>{let h={...f,content:typeof f.content=="string"?f.content.length:Array.isArray(f.content)?f.content.reduce((m,g)=>typeof g=="string"?m+g.length:g.type==="text"?m+(g.text?.length||0):m,0):0};return"tool_calls"in f&&f.tool_calls&&Array.isArray(f.tool_calls)&&(h.tool_calls=f.tool_calls.map(m=>({...m,function:m.function?{...m.function,arguments:typeof m.function.arguments=="string"?m.function.arguments.length:m.function.arguments}:m.function}))),h}),u={};for(let[f,h]of Object.entries(r.properties))if(f.startsWith("request.option.tools"))if(typeof h=="string")try{let m=JSON.parse(h);Array.isArray(m)?u[f]=m.length.toString():u[f]=h.length.toString()}catch{u[f]=h.length.toString()}else Array.isArray(h)?u[f]=h.length.toString():u[f]="0";else u[f]=h;let d=A4e.TelemetryData.createAndMarkAsIssued({...u,messagesJson:JSON.stringify(l),message_direction:s,modelCallId:c},r.measurements);t.sendEnhancedGHTelemetryEvent("engine.messages.length",(0,VPr.multiplexProperties)(d.properties),d.measurements),t.sendInternalMSFTTelemetryEvent("engine.messages.length",(0,VPr.multiplexProperties)(d.properties),d.measurements)}a(i5i,"sendEngineMessagesLengthTelemetry");var e5i=new bEt.LRUCache(1e3),t5i=new bEt.LRUCache(500),g4e=new bEt.LRUCache(1e3),CEt={headerRequestId:null},$Pr=new bEt.LRUCache(100);function Rlc(t){let e=g4e.get(t);if(e!==void 0){let r=e+1;return g4e.set(t,r),r}else return g4e.set(t,1),1}a(Rlc,"updateHeaderRequestIdTracker");function Plc(t){let e=$Pr.get(t);if(e!==void 0){let r=e+1;return $Pr.set(t,r),r}else return $Pr.set(t,1),1}a(Plc,"updateConversationTracker");function klc(t,e,r){let n={};for(let[h,m]of Object.entries(e.properties))h.startsWith("request.option.")&&(n[h]=m);if(Object.keys(n).length===0)return;let o=e.properties.conversationId||e.properties.sessionId||"unknown",s=e.properties.headerRequestId||"unknown",c=(0,r5i.hash)(n).toString(),l=t5i.get(c);if(!l)l=(0,n5i.generateUuid)(),t5i.set(c,l);else return l;let u=JSON.stringify(n),d=8e3,f=[];for(let h=0;h{"use strict";p();Object.defineProperty(E4e,"__esModule",{value:!0});E4e.CompactionDataContainer=void 0;E4e.rawPartAsCompactionData=Ulc;var Flc=xo(),s5i=M5e(),WPr=class extends Flc.PromptElement{static{a(this,"CompactionDataContainer")}render(){let{compaction:e}=this.props,r={type:s5i.CustomDataPartMimeTypes.ContextManagement,compaction:e};return vscpp("opaque",{value:r})}};E4e.CompactionDataContainer=WPr;function Ulc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===s5i.CustomDataPartMimeTypes.ContextManagement&&r.compaction&&typeof r.compaction=="object")return r.compaction}a(Ulc,"rawPartAsCompactionData")});var l5i=I(_4e=>{"use strict";p();Object.defineProperty(_4e,"__esModule",{value:!0});_4e.PhaseDataContainer=void 0;_4e.rawPartAsPhaseData=qlc;var Qlc=xo(),c5i=M5e(),zPr=class extends Qlc.PromptElement{static{a(this,"PhaseDataContainer")}render(){let{phase:e}=this.props,r={type:c5i.CustomDataPartMimeTypes.PhaseData,phase:e};return vscpp("opaque",{value:r})}};_4e.PhaseDataContainer=zPr;function qlc(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===c5i.CustomDataPartMimeTypes.PhaseData&&typeof r.phase=="string")return r.phase}a(qlc,"rawPartAsPhaseData")});var f5i=I(L4=>{"use strict";p();Object.defineProperty(L4,"__esModule",{value:!0});L4.StatefulMarkerContainer=void 0;L4.rawPartAsStatefulMarker=d5i;L4.encodeStatefulMarker=jlc;L4.decodeStatefulMarker=Hlc;L4.getAllStatefulMarkersAndIndicies=JPr;L4.getStatefulMarkerAndIndex=Glc;L4.getIndexOfStatefulMarker=$lc;var YPr=xo(),u5i=M5e(),KPr=class extends YPr.PromptElement{static{a(this,"StatefulMarkerContainer")}render(){let{statefulMarker:e}=this.props,r={type:u5i.CustomDataPartMimeTypes.StatefulMarker,value:e};return vscpp("opaque",{value:r})}};L4.StatefulMarkerContainer=KPr;function d5i(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===u5i.CustomDataPartMimeTypes.StatefulMarker&&typeof r.value=="object")return r.value}a(d5i,"rawPartAsStatefulMarker");function jlc(t,e){return new TextEncoder().encode(t+"\\"+e)}a(jlc,"encodeStatefulMarker");function Hlc(t){let e=new TextDecoder().decode(t),[r,n]=e.split("\\");return{modelId:r,marker:n}}a(Hlc,"decodeStatefulMarker");function*JPr(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.role===YPr.Raw.ChatRole.Assistant){for(let n of r.content)if(n.type===YPr.Raw.ChatCompletionContentPartKind.Opaque){let o=d5i(n);o&&(yield{statefulMarker:o,index:e})}}}}a(JPr,"getAllStatefulMarkersAndIndicies");function Glc(t,e){for(let r of JPr(e))if(r.statefulMarker.modelId===t)return{statefulMarker:r.statefulMarker.marker,index:r.index}}a(Glc,"getStatefulMarkerAndIndex");function $lc(t,e){for(let r of JPr(e))if(r.statefulMarker.marker===t)return r.index}a($lc,"getIndexOfStatefulMarker")});var m5i=I(u6=>{"use strict";p();var Vlc=u6&&u6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Wlc=u6&&u6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),h5i=u6&&u6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";p();var Tdc=TC&&TC.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Idc=TC&&TC.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(TC,"__esModule",{value:!0});TC.OpenAIResponsesProcessor=void 0;TC.getResponsesApiCompactionThreshold=c5i;TC.createResponsesRequestBody=qdc;TC.getResponsesApiCompactionThresholdFromBody=jdc;TC.responseApiInputToRawMessagesForLogging=Jdc;TC.processResponseFromChatEndpoint=sfc;TC.sendCompletionOutputTelemetry=d5i;var eo=wo(),uPr=El(),xdc=Xc(),wdc=_G(),Rdc=_3(),kdc=Dkr(),G4=BS(),Pdc=um(),r5i=yR(),rAe=Il(),Ddc=pp(),E6=CEt(),Ndc=f6(),If=u6(),Mdc=Qkr(),aPr=P4e(),Odc=_6(),Bdc=gp(),Ldc=I4e(),dPr=WOi(),Fdc=YOi(),n5i=ZOi(),Udc=jwr(),Qdc=t5i();function c5i(t,e,r){if(t.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!If.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(c5i,"getResponsesApiCompactionThreshold");function qdc(t,e,r,n){let o=t.get(rAe.IConfigurationService),s=t.get(Bdc.IExperimentationService),c=(0,Ldc.getVerbosityForModelSync)(n),l=c5i(o,s,n),u=Hdc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(B=>B.function.name===E6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===r5i.ChatLocation.Agent||e.location===r5i.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(Mdc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let B of e.requestOptions.tools)!B.function.name||B.function.name.length===0||B.function.name===E6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(B.function.name)||E.push({...B.function,type:"function",strict:!1,parameters:B.function.parameters||{}});let _=[...E];A&&_.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(B=>[B.function.name,B])):void 0,b=A?B=>!y.isNonDeferredTool(B):void 0,T={model:r,...Gdc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(T.context_management=[{type:If.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(rAe.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,k=o.getConfig(rAe.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?k||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R;return(D||N)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(rAe.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(qdc,"createResponsesRequestBody");function jdc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===If.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(jdc,"getResponsesApiCompactionThresholdFromBody");function Hdc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(Odc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(Hdc,"resolveWebSocketStatefulMarker");function Gdc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=Vdc(e),d=u!==void 0?$dc(e[u]):void 0,f,h;if(n)h=(0,n5i.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,n5i.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===eo.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===E6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===eo.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===eo.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of i5i(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case eo.Raw.ChatRole.Assistant:if(E.content.length){y.push(...Kdc(E.content)),y.push(...zdc(E.content));let _=E.content.map(Wdc).filter(G4.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:Ydc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===E6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case eo.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===eo.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?i5i(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===eo.Raw.ChatCompletionContentPartKind.Document).map(l5i).filter(G4.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case eo.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(o5i).filter(G4.isDefined)});break;case eo.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(o5i).filter(G4.isDefined)});break}return{input:y,previous_response_id:f}}a(Gdc,"rawMessagesToResponseAPI");function i5i(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==E6.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(i5i,"buildToolSearchOutputTools");function $dc(t){if(t.role!==eo.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,dPr.rawPartAsCompactionData)(r));if(e.length)return{role:eo.Raw.ChatRole.Assistant,content:e}}a($dc,"createCompactionRoundTripMessage");function Vdc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===eo.Raw.ChatCompletionContentPartKind.Opaque&&(0,dPr.rawPartAsCompactionData)(n))return e}}a(Vdc,"getLatestCompactionMessageIndex");function l5i(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(l5i,"rawDocumentToResponsesInputFile");function o5i(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case eo.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case eo.Raw.ChatCompletionContentPartKind.Document:return l5i(t);case eo.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(o5i,"rawContentToResponsesContent");function Wdc(t){switch(t.type){case eo.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(Wdc,"rawContentToResponsesAssistantContent");function zdc(t){return(0,uPr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Udc.rawPartAsThinkingData)(e);if(r)return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(zdc,"extractThinkingData");function Ydc(t){for(let e of t)if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,Fdc.rawPartAsPhaseData)(e);if(r)return r}}a(Ydc,"extractPhaseData");function Kdc(t){return(0,uPr.coalesce)(t.map(e=>{if(e.type===eo.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,dPr.rawPartAsCompactionData)(e);if(r)return{type:If.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(Kdc,"extractCompactionData");function Jdc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:eo.Raw.ChatRole.System,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:eo.Raw.ChatRole.User,content:sPr(s.content).map(PEt).filter(G4.isDefined)});break;case"system":case"developer":n(),e.push({role:eo.Raw.ChatRole.System,content:sPr(s.content).map(PEt).filter(G4.isDefined)});break;case"assistant":n(),Zdc(s)?e.push({role:eo.Raw.ChatRole.Assistant,content:s.content.map(efc).filter(G4.isDefined)}):Xdc(s)&&e.push({role:eo.Raw.ChatRole.Assistant,content:sPr(s.content).map(PEt).filter(G4.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=tfc(s.output);e.push({role:eo.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:eo.Raw.ChatRole.Assistant,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` +`),e.info(`[responsesAPI] Dumping SSE stream to ${s}`),new ekr(s)}catch{return p5i}}a(Ylc,"createResponsesStreamDumper")});var IEt=I(Cv=>{"use strict";p();var Klc=Cv&&Cv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Jlc=Cv&&Cv.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Cv,"__esModule",{value:!0});Cv.OpenAIResponsesProcessor=void 0;Cv.getResponsesApiCompactionThreshold=C5i;Cv.createResponsesRequestBody=fuc;Cv.getResponsesApiCompactionThresholdFromBody=puc;Cv.responseApiInputToRawMessagesForLogging=Cuc;Cv.processResponseFromChatEndpoint=kuc;Cv.sendCompletionOutputTelemetry=T5i;var Xi=xo(),okr=ml(),Zlc=zc(),Xlc=k7(),euc=BL(),tuc=xPr(),F4=dS(),ruc=fm(),g5i=gR(),Wge=Sl(),nuc=Ap(),d6=hEt(),iuc=i6(),xf=r6(),ouc=OPr(),rkr=y4e(),suc=f6(),auc=_p(),cuc=p4e(),skr=a5i(),luc=l5i(),A5i=f5i(),uuc=Uwr(),duc=m5i();function C5i(t,e,r){if(t.getExperimentBasedConfig(Wge.ConfigKey.ResponsesApiContextManagementEnabled,e)&&!xf.modelsWithoutResponsesContextManagement.has(r.family))return r.modelMaxPromptTokens>0?Math.floor(r.modelMaxPromptTokens*.9):5e4}a(C5i,"getResponsesApiCompactionThreshold");function fuc(t,e,r,n){let o=t.get(Wge.IConfigurationService),s=t.get(auc.IExperimentationService),c=(0,cuc.getVerbosityForModelSync)(n),l=C5i(o,s,n),u=huc(t,e),d=!!e.ignoreStatefulMarker||!!e.useWebSocket,f=!!e.modeChanged,h=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(L=>L.function.name===d6.CUSTOM_TOOL_SEARCH_NAME),m=e.location===g5i.ChatLocation.Agent||e.location===g5i.ChatLocation.MessagesProxy,g=e.telemetryProperties?.subType?.startsWith("subagent")??!1,A=h&&m&&!g,y=A?t.get(ouc.IToolDeferralService):void 0,E=[];if(e.requestOptions?.tools)for(let L of e.requestOptions.tools)!L.function.name||L.function.name.length===0||L.function.name===d6.CUSTOM_TOOL_SEARCH_NAME||A&&!y.isNonDeferredTool(L.function.name)||E.push({...L.function,type:"function",strict:!1,parameters:L.function.parameters||{}});let _=[...E];A&&_.unshift({type:"tool_search",execution:"client",description:"Search for relevant tools by describing what you need. Returns tool definitions for tools matching your query.",parameters:{type:"object",properties:{query:{type:"string",description:"Natural language description of what tool capability you are looking for."}},required:["query"]}});let v=e.requestOptions?.tools?new Map(e.requestOptions.tools.map(L=>[L.function.name,L])):void 0,b=A?L=>!y.isNonDeferredTool(L):void 0,T={model:r,...muc(r,e.messages,d,u,{toolsMap:v,shouldLoadToolFromToolSearch:b,modeChanged:f}),stream:!0,tools:_.length>0?_:void 0,max_output_tokens:e.postOptions.max_tokens,tool_choice:typeof e.postOptions.tool_choice=="object"?{type:"function",name:e.postOptions.tool_choice.function.name}:e.postOptions.tool_choice,top_logprobs:e.postOptions.logprobs?3:void 0,store:!1,text:c?{verbosity:c}:void 0};l!==void 0&&(T.context_management=[{type:xf.openAIContextManagementCompactionType,compact_threshold:l}]),T.truncation=o.getConfig(Wge.ConfigKey.Advanced.UseResponsesApiTruncation)?"auto":"disabled";let w=e.modelCapabilities?.enableThinking===!1,R=o.getExperimentBasedConfig(Wge.ConfigKey.ResponsesApiReasoningSummary,s),x=n.family==="gpt-5.3-codex-spark-preview"||w,P=o.getConfig(Wge.ConfigKey.Advanced.ReasoningEffortOverride),D=n.supportsReasoningEffort?.length?P||e.modelCapabilities?.reasoningEffort||"medium":void 0,N=R==="off"||x?void 0:R;return(D||N)&&(T.reasoning={...D?{effort:D}:{},...N?{summary:N}:{}}),T.include=["reasoning.encrypted_content"],o.getExperimentBasedConfig(Wge.ConfigKey.ResponsesApiPromptCacheKeyEnabled,s)&&e.conversationId&&(T.prompt_cache_key=`${e.conversationId}:${n.family}`),T}a(fuc,"createResponsesRequestBody");function puc(t){let e=t.context_management;if(Array.isArray(e)){for(let r of e)if(r.type===xf.openAIContextManagementCompactionType&&typeof r.compact_threshold=="number")return r.compact_threshold}}a(puc,"getResponsesApiCompactionThresholdFromBody");function huc(t,e){if(e.ignoreStatefulMarker||!e.useWebSocket||!e.conversationId)return;let r=t.get(suc.IChatWebSocketManager),n=r.getSummarizedAtRoundId(e.conversationId);if(e.summarizedAtRoundId===n)return r.getStatefulMarker(e.conversationId)}a(huc,"resolveWebSocketStatefulMarker");function muc(t,e,r,n,o={}){let{toolsMap:s,shouldLoadToolFromToolSearch:c,modeChanged:l=!1}=o,u=Auc(e),d=u!==void 0?guc(e[u]):void 0,f,h;if(n)h=(0,A5i.getIndexOfStatefulMarker)(n,e),h!==void 0&&(f=n);else if(!r){let E=(0,A5i.getStatefulMarkerAndIndex)(t,e);E&&(f=E.statefulMarker,h=E.index)}l&&(f=void 0,h=void 0);let m=new Set,g=new Set;if(h!==void 0||u!==void 0){for(let E of e)if(E.role===Xi.Raw.ChatRole.Assistant&&E.toolCalls)for(let _ of E.toolCalls)_.function.name===d6.CUSTOM_TOOL_SEARCH_NAME&&m.add(_.id);else if(E.role===Xi.Raw.ChatRole.Tool&&E.toolCallId&&m.has(E.toolCallId)&&s){let _=E.content.filter(v=>v.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(v=>v.text).join("");for(let v of y5i(_,s,c))g.add(v.name)}}h!==void 0?(e=e.slice(h+1),u!==void 0&&(u>h?e=e.slice(u-(h+1)):d&&(e=[d,...e]))):u!==void 0&&(e=e.slice(u));let y=[];for(let E of e)switch(E.role){case Xi.Raw.ChatRole.Assistant:if(E.content.length){y.push(...vuc(E.content)),y.push(...Euc(E.content));let _=E.content.map(yuc).filter(F4.isDefined);if(_.length){let v={role:"assistant",content:_,type:"message",phase:_uc(E.content)};y.push(v)}}if(E.toolCalls)for(let _ of E.toolCalls)if(_.function.name===d6.CUSTOM_TOOL_SEARCH_NAME){m.add(_.id);let v={};try{v=JSON.parse(_.function.arguments||"{}")}catch{}y.push({type:"tool_search_call",execution:"client",call_id:_.id,status:"completed",arguments:v})}else{let v=g.has(_.function.name)?_.function.name:void 0;y.push({type:"function_call",name:_.function.name,arguments:_.function.arguments,call_id:_.id,...v?{namespace:v}:{}})}break;case Xi.Raw.ChatRole.Tool:if(E.toolCallId)if(m.has(E.toolCallId)){let _=E.content.filter(b=>b.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(b=>b.text).join(""),v=s?y5i(_,s,c):[];for(let b of v)g.add(b.name);y.push({type:"tool_search_output",execution:"client",call_id:E.toolCallId,status:"completed",tools:v})}else{let _=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Text).map(T=>T.text).join(""),v=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Image).map(T=>({type:"input_image",detail:T.imageUrl.detail||"auto",image_url:T.imageUrl.url})),b=E.content.filter(T=>T.type===Xi.Raw.ChatCompletionContentPartKind.Document).map(b5i).filter(F4.isDefined);y.push({type:"function_call_output",call_id:E.toolCallId,output:_}),v.length&&y.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...v]}),b.length&&y.push({role:"user",content:[{type:"input_text",text:"PDF associated with the above tool call:"},...b]})}break;case Xi.Raw.ChatRole.User:y.push({role:"user",content:E.content.map(E5i).filter(F4.isDefined)});break;case Xi.Raw.ChatRole.System:y.push({role:"system",content:E.content.map(E5i).filter(F4.isDefined)});break}return{input:y,previous_response_id:f}}a(muc,"rawMessagesToResponseAPI");function y5i(t,e,r){let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(o=>typeof o=="string"&&o!==d6.CUSTOM_TOOL_SEARCH_NAME&&e.has(o)&&r?.(o)===!0).map(o=>{let s=e.get(o);return{type:"function",name:s.function.name,description:s.function.description||"",defer_loading:!0,parameters:s.function.parameters||{type:"object",properties:{}},strict:!1}}):[]}a(y5i,"buildToolSearchOutputTools");function guc(t){if(t.role!==Xi.Raw.ChatRole.Assistant)return;let e=t.content.filter(r=>r.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,skr.rawPartAsCompactionData)(r));if(e.length)return{role:Xi.Raw.ChatRole.Assistant,content:e}}a(guc,"createCompactionRoundTripMessage");function Auc(t){for(let e=t.length-1;e>=0;e--){let r=t[e];for(let n of r.content)if(n.type===Xi.Raw.ChatCompletionContentPartKind.Opaque&&(0,skr.rawPartAsCompactionData)(n))return e}}a(Auc,"getLatestCompactionMessageIndex");function b5i(t){if(t.documentData.mediaType==="application/pdf")return{type:"input_file",filename:"document.pdf",file_data:`data:${t.documentData.mediaType};base64,${t.documentData.data}`}}a(b5i,"rawDocumentToResponsesInputFile");function E5i(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:return{type:"input_text",text:t.text};case Xi.Raw.ChatCompletionContentPartKind.Image:return{type:"input_image",detail:t.imageUrl.detail||"auto",image_url:t.imageUrl.url};case Xi.Raw.ChatCompletionContentPartKind.Document:return b5i(t);case Xi.Raw.ChatCompletionContentPartKind.Opaque:{let e=t.value;if(e.type==="input_text"||e.type==="input_image"||e.type==="input_file")return e}}}a(E5i,"rawContentToResponsesContent");function yuc(t){switch(t.type){case Xi.Raw.ChatCompletionContentPartKind.Text:if(t.text.trim())return{type:"output_text",text:t.text}}}a(yuc,"rawContentToResponsesAssistantContent");function Euc(t){return(0,okr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,uuc.rawPartAsThinkingData)(e);if(r)return{type:"reasoning",id:r.id,summary:[],encrypted_content:r.encrypted}}}))}a(Euc,"extractThinkingData");function _uc(t){for(let e of t)if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,luc.rawPartAsPhaseData)(e);if(r)return r}}a(_uc,"extractPhaseData");function vuc(t){return(0,okr.coalesce)(t.map(e=>{if(e.type===Xi.Raw.ChatCompletionContentPartKind.Opaque){let r=(0,skr.rawPartAsCompactionData)(e);if(r)return{type:xf.openAIContextManagementCompactionType,id:r.id,encrypted_content:r.encrypted_content}}}))}a(vuc,"extractCompactionData");function Cuc(t){let e=[],r=[],n=a(()=>{r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)})},"flushPendingFunctionCalls");t.instructions&&e.push({role:Xi.Raw.ChatRole.System,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.instructions}]});let o=typeof t.input=="string"?[{role:"user",content:t.input,type:"message"}]:t.input??[];for(let s of o)if("role"in s)switch(s.role){case"user":n(),e.push({role:Xi.Raw.ChatRole.User,content:tkr(s.content).map(SEt).filter(F4.isDefined)});break;case"system":case"developer":n(),e.push({role:Xi.Raw.ChatRole.System,content:tkr(s.content).map(SEt).filter(F4.isDefined)});break;case"assistant":n(),buc(s)?e.push({role:Xi.Raw.ChatRole.Assistant,content:s.content.map(Tuc).filter(F4.isDefined)}):Suc(s)&&e.push({role:Xi.Raw.ChatRole.Assistant,content:tkr(s.content).map(SEt).filter(F4.isDefined)});break}else if("type"in s)switch(s.type){case"function_call":r.push({id:s.call_id,type:"function",function:{name:s.name,arguments:s.arguments}});break;case"function_call_output":{n();let c=Iuc(s.output);e.push({role:Xi.Raw.ChatRole.Tool,content:c,toolCallId:s.call_id});break}case"reasoning":n(),e.push({role:Xi.Raw.ChatRole.Assistant,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`Reasoning summary: ${s.summary.map(c=>c.text).join(` -`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:E6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:eo.Raw.ChatRole.Tool,content:[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:eo.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(Jdc,"responseApiInputToRawMessagesForLogging");function Zdc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(Zdc,"isResponseOutputMessage");function Xdc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(Xdc,"isResponseInputItemMessage");function sPr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(sPr,"ensureContentArray");function PEt(t){switch(t.type){case"input_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:eo.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(PEt,"responseContentToRawContent");function efc(t){switch(t.type){case"output_text":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(efc,"responseOutputToRawContent");function tfc(t){return typeof t=="string"?[{type:eo.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,uPr.coalesce)(t.map(PEt))}a(tfc,"responseFunctionOutputToRawContents");function cPr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===If.openAIContextManagementCompactionType}a(cPr,"isCompactionItem");function rfc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(rfc,"hasOutputItem");function nfc(t){return"response"in t&&Array.isArray(t.response.output)}a(nfc,"hasResponseOutput");function ifc(t){return t.output_index}a(ifc,"getOutputItemIndex");function lPr(t){return cPr(t)}a(lPr,"isCompactionOutputItem");function u5i(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(lPr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&lPr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(u5i,"getLatestCompactionOutput");function ofc(t,e){let r=u5i(t,e);return r?t.filter((n,o)=>!lPr(n)||o===r.outputIndex):t}a(ofc,"keepLatestCompactionOutput");async function sfc(t,e,r,n,o,s,c,l){return new xdc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,Pdc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,Ndc.getRequestId)(n.headers),m=t.createInstance(DEt,c,e,d,f,h,l),g=(0,Qdc.createResponsesStreamDumper)(d,r),A=new kdc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(d5i(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(sfc,"processResponseFromChatEndpoint");function d5i(t,e,r,n){let o=(0,If.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,aPr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(d5i,"sendCompletionOutputTelemetry");function afc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return If.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return If.FilterReason.SelfHarm;if(o.includes("sexual"))return If.FilterReason.Sexual;if(o.includes("violence"))return If.FilterReason.Violence;if(o.includes("hate"))return If.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return If.FilterReason.Hate;if(s.self_harm?.filtered)return If.FilterReason.SelfHarm;if(s.sexual?.filtered)return If.FilterReason.Sexual;if(s.violence?.filtered)return If.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return If.FilterReason.Copyright;if(r.source_type==="prompt")return If.FilterReason.Prompt}a(afc,"extractFilterReasonFromContentFilters");function s5i(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(s5i,"mapResponsesApiError");var DEt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(rfc(e)&&cPr(e.item)){let n=ifc(e);r.push({item:e.item,outputIndex:n})}if(nfc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` +`)}`}]});break;default:{let c=s;if(c.type==="tool_search_call")r.push({id:c.call_id,type:"function",function:{name:d6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(c.arguments??{})}});else if(c.type==="tool_search_output"){n();let l=c.tools.map(u=>u.name);e.push({role:Xi.Raw.ChatRole.Tool,content:[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:JSON.stringify(l)}],toolCallId:c.call_id})}break}}return r.length>0&&e.push({role:Xi.Raw.ChatRole.Assistant,content:[],toolCalls:r.splice(0)}),e}a(Cuc,"responseApiInputToRawMessagesForLogging");function buc(t){return"role"in t&&t.role==="assistant"&&"type"in t&&t.type==="message"&&"content"in t&&Array.isArray(t.content)}a(buc,"isResponseOutputMessage");function Suc(t){return"role"in t&&t.role==="assistant"&&(!("type"in t)||t.type!=="message")}a(Suc,"isResponseInputItemMessage");function tkr(t){return typeof t=="string"?[{type:"input_text",text:t}]:t}a(tkr,"ensureContentArray");function SEt(t){switch(t.type){case"input_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"input_image":return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:t.image_url||"",detail:t.detail==="auto"?void 0:t.detail??void 0}};case"input_file":return{type:Xi.Raw.ChatCompletionContentPartKind.Opaque,value:`[File Input - Filename: ${t.filename||"unknown"}]`}}}a(SEt,"responseContentToRawContent");function Tuc(t){switch(t.type){case"output_text":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t.text};case"refusal":return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:`[Refusal: ${t.refusal}]`}}}a(Tuc,"responseOutputToRawContent");function Iuc(t){return typeof t=="string"?[{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:t}]:(0,okr.coalesce)(t.map(SEt))}a(Iuc,"responseFunctionOutputToRawContents");function nkr(t){return typeof t=="object"&&t!==null&&"type"in t&&String(t.type)===xf.openAIContextManagementCompactionType}a(nkr,"isCompactionItem");function xuc(t){return"item"in t&&"output_index"in t&&typeof t.output_index=="number"}a(xuc,"hasOutputItem");function wuc(t){return"response"in t&&Array.isArray(t.response.output)}a(wuc,"hasResponseOutput");function Ruc(t){return t.output_index}a(Ruc,"getOutputItemIndex");function ikr(t){return nkr(t)}a(ikr,"isCompactionOutputItem");function S5i(t,e){let r;for(let n=t.length-1;n>=0;n--){let o=t[n];if(ikr(o)){r={item:o,outputIndex:n};break}}if(e!==void 0){let n=t[e];if(n&&ikr(n)&&(!r||e>=r.outputIndex))return{item:n,outputIndex:e}}return r}a(S5i,"getLatestCompactionOutput");function Puc(t,e){let r=S5i(t,e);return r?t.filter((n,o)=>!ikr(n)||o===r.outputIndex):t}a(Puc,"keepLatestCompactionOutput");async function kuc(t,e,r,n,o,s,c,l){return new Zlc.AsyncIterableObject(async u=>{let d=n.headers.get("X-Request-ID")??(0,ruc.generateUuid)(),f=n.headers.get("x-github-request-id")??"",{serverExperiments:h}=(0,iuc.getRequestId)(n.headers),m=t.createInstance(TEt,c,e,d,f,h,l),g=(0,duc.createResponsesStreamDumper)(d,r),A=new tuc.SSEParser(y=>{try{if(r.trace(`SSE: ${y.data}`),y.data==="[DONE]")return;let E=JSON.parse(y.data),_={type:y.type,...E};g.logEvent(_);let v=m.push(_,s);v&&(T5i(e,r,v,c),u.emitOne(v))}catch(E){u.reject(E)}});for await(let y of n.body)A.feed(y)},async()=>{await n.body.destroy()})}a(kuc,"processResponseFromChatEndpoint");function T5i(t,e,r,n){let o=(0,xf.rawMessageToCAPI)(r.message),s=n;r.usage&&(s=n.extendedBy({},{promptTokens:r.usage.prompt_tokens,completionTokens:r.usage.completion_tokens,totalTokens:r.usage.total_tokens,...r.usage.prompt_tokens_details&&{cachedTokens:r.usage.prompt_tokens_details.cached_tokens},...r.usage.completion_tokens_details&&{reasoningTokens:r.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:r.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:r.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,rkr.sendEngineMessagesTelemetry)(t,[o],s,!0,e)}a(T5i,"sendCompletionOutputTelemetry");function Duc(t){if(!t)return;let e=t.filter(c=>c.blocked),r=e.find(c=>c.source_type==="completion")??e[0];if(!r)return;let o=r.content_filter_raw?.find(c=>c.action==="BLOCK"&&c.result===!0)?.label?.toLowerCase()??"";if(o.includes("copyright"))return xf.FilterReason.Copyright;if(o.includes("selfharm")||o.includes("self_harm"))return xf.FilterReason.SelfHarm;if(o.includes("sexual"))return xf.FilterReason.Sexual;if(o.includes("violence"))return xf.FilterReason.Violence;if(o.includes("hate"))return xf.FilterReason.Hate;let s=r.content_filter_results??{};if(s.hate?.filtered)return xf.FilterReason.Hate;if(s.self_harm?.filtered)return xf.FilterReason.SelfHarm;if(s.sexual?.filtered)return xf.FilterReason.Sexual;if(s.violence?.filtered)return xf.FilterReason.Violence;if(s.protected_material_text?.filtered||s.protected_material_code?.filtered)return xf.FilterReason.Copyright;if(r.source_type==="prompt")return xf.FilterReason.Prompt}a(Duc,"extractFilterReasonFromContentFilters");function _5i(t){if(t)return{code:0,message:t.message??"",metadata:{code:t.code}}}a(_5i,"mapResponsesApiError");var TEt=class{static{a(this,"OpenAIResponsesProcessor")}constructor(e,r,n,o,s,c,l){this.telemetryData=e,this.telemetryService=r,this.requestId=n,this.ghRequestId=o,this.serverExperiments=s,this.compactionThreshold=c,this.logService=l,this.textAccumulator="",this.hasReceivedReasoningSummary=!1,this.sawCompactionMessage=!1,this.toolCallInfo=new Map}getCompactionItemsInChunk(e){let r=[];if(xuc(e)&&nkr(e.item)){let n=Ruc(e);r.push({item:e.item,outputIndex:n})}if(wuc(e))for(let n=0;n{this.textAccumulator+=s.text,r(this.textAccumulator,0,s)},"onProgress"),o=this.getCompactionItemsInChunk(e);if(e.type!=="response.completed")for(let{item:s,outputIndex:c}of o)this.captureCompactionItem(s,c,n);switch(e.type){case"error":return n({text:"",copilotErrors:[{agent:"openai",code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||void 0}]});case"response.output_text.delta":{let s=e;this.lastTextDeltaOutputIndex!==void 0&&s.output_index!==this.lastTextDeltaOutputIndex&&n({text:` -`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new Rdc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...a5i(c,l),top_logprobs:l.top_logprobs?.map(u=>a5i(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:E6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:E6.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:E6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=ofc(s.response.output,this.latestCompactionOutputIndex),l=u5i(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,aPr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,aPr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:If.FinishedCompletionReason.Stop,message:{role:eo.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(G4.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=If.FinishedCompletionReason.Length:c==="content_filter"?(l=If.FinishedCompletionReason.ContentFilter,u=afc(s.content_filters)):l=If.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:s5i(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,If.FinishedCompletionReason.ServerError,{error:s5i(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:eo.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:eo.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:eo.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(G4.isDefined)}}}};TC.OpenAIResponsesProcessor=DEt;TC.OpenAIResponsesProcessor=DEt=Tdc([Idc(6,Ddc.ILogService)],DEt);function a5i(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,wdc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(a5i,"mapLogProp")});var f5i=I(MEt=>{"use strict";p();Object.defineProperty(MEt,"__esModule",{value:!0});MEt.ChatWebSocketTelemetrySender=void 0;var fPr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};MEt.ChatWebSocketTelemetrySender=fPr});var _6=I(s1=>{"use strict";p();var cfc=s1&&s1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},OEt=s1&&s1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(s1,"__esModule",{value:!0});s1.ChatWebSocketManager=s1.NullChatWebSocketManager=s1.IChatWebSocketManager=void 0;s1.isCAPIWebSocketError=APr;var lfc=rn(),ufc=Ts(),BEt=Sc(),p5i=ko(),h5i=Il(),dfc=PE(),nAe=pp(),ffc=o0(),pfc=ey(),hfc=NEt(),h$=f5i();s1.IChatWebSocketManager=(0,lfc.createServiceIdentifier)("IChatWebSocketManager");var pPr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};s1.NullChatWebSocketManager=pPr;function APr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(APr,"isCAPIWebSocketError");var mfc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function gfc(t){return mfc[t.type]}a(gfc,"getStreamTerminatingOutcome");var hPr=class extends p5i.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new mPr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};s1.ChatWebSocketManager=hPr;s1.ChatWebSocketManager=hPr=cfc([OEt(0,nAe.ILogService),OEt(1,dfc.ICAPIClientService),OEt(2,ffc.ITelemetryService),OEt(3,h5i.IConfigurationService)],hPr);function LEt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(LEt,"wsCloseCodeToString");var mPr=class extends p5i.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new BEt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new pfc.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),h$.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,nAe.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,nAe.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),h$.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=LEt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),h$.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,nAe.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),h$.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!APr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=LEt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),h$.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,nAe.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),h$.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,hfc.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new gPr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:q,closeReason:F,serverErrorMessage:U,serverErrorCode:W})=>{this._activeRequest===x&&(this._activeRequest=void 0);let V=Date.now()-(this._connectedTime??Date.now()),G=Date.now()-E,Y=this._totalSentMessageCount-_,re=this._totalReceivedMessageCount-v,j=this._totalSentCharacters-b,X=this._totalReceivedCharacters-T;h$.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:O,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:V,requestDurationMs:G,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:Y,requestReceivedMessageCount:re,requestSentCharacters:j,requestReceivedCharacters:X,closeCode:q,closeReason:F,serverErrorMessage:U,serverErrorCode:W})}),this._activeRequest=x;let k=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>k.dispose()).catch(()=>{});let{stream:D,...N}=e,L={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},B=JSON.stringify(L),Q=B.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=Q;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${Q})`),h$.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:Q,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(B),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},gPr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new BEt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new BEt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new BEt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig(h5i.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,nAe.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),APr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=gfc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${LEt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${LEt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new ufc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var EPr=I($4=>{"use strict";p();Object.defineProperty($4,"__esModule",{value:!0});$4.getImageDimensions=Afc;$4.getImageDimensionsFromBytes=yfc;$4.getPngDimensions=m5i;$4.getGifDimensions=g5i;$4.getJpegDimensions=A5i;$4.getWebPDimensions=C5i;$4.getMimeType=S5i;$4.extractImageAttributes=Cfc;function Afc(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(S5i(e)){case"image/png":return m5i(e);case"image/gif":return g5i(e);case"image/jpeg":case"image/jpg":return A5i(e);case"image/webp":return C5i(e);default:throw new Error("Unsupported image format")}}a(Afc,"getImageDimensions");function yfc(t,e){switch(Efc(e)){case"image/png":return y5i(t);case"image/gif":return E5i(t);case"image/jpeg":case"image/jpg":return _5i(t);case"image/webp":return v5i(t);default:throw new Error("Unsupported image format")}}a(yfc,"getImageDimensionsFromBytes");function m5i(t){return y5i(FEt(t.slice(0,50)))}a(m5i,"getPngDimensions");function g5i(t){return E5i(FEt(t.slice(0,50)))}a(g5i,"getGifDimensions");function A5i(t){return _5i(FEt(t))}a(A5i,"getJpegDimensions");function y5i(t){if(!b5i(t,0,[137,80,78,71]))throw new Error("Not a valid PNG image.");let e=new DataView(t.buffer,t.byteOffset+16,8);return{width:e.getUint32(0,!1),height:e.getUint32(4,!1)}}a(y5i,"getPngDimensionsFromBytes");function E5i(t){if(!yPr(t,0,"GIF8"))throw new Error("Not a valid GIF image.");let e=new DataView(t.buffer,t.byteOffset+6,4);return{width:e.getUint16(0,!0),height:e.getUint16(2,!0)}}a(E5i,"getGifDimensionsFromBytes");function _5i(t){if(!b5i(t,0,[255,216]))throw new Error("Not a valid JPEG image.");let e=t.length,r=2;for(;r+3=65472&&n<=65474){let s=new DataView(t.buffer,t.byteOffset+r+5,4);return{height:s.getUint16(0,!1),width:s.getUint16(2,!1)}}r+=2+o}throw new Error("JPEG dimensions not found")}a(_5i,"getJpegDimensionsFromBytes");function C5i(t){return v5i(FEt(t))}a(C5i,"getWebPDimensions");function v5i(t){if(!yPr(t,0,"RIFF")||!yPr(t,8,"WEBP"))throw new Error("Not a valid WebP image.");let e=_fc(t,12,4);if(e==="VP8 "){let r=(t[26]|t[27]<<8)&16383,n=(t[28]|t[29]<<8)&16383;return{width:r,height:n}}else if(e==="VP8L"){let r=(t[21]|t[22]<<8)&16383,n=(t[23]|t[24]<<8)&16383;return{width:r,height:n}}else if(e==="VP8X"){let r=((t[24]|t[25]<<8|t[26]<<16)&16777215)+1,n=((t[27]|t[28]<<8|t[29]<<16)&16777215)+1;return{width:r,height:n}}else throw new Error("Unsupported WebP format.")}a(v5i,"getWebPDimensionsFromBytes");function Efc(t){return t?.toLowerCase().split(";")[0].trim()}a(Efc,"normalizeMimeType");function FEt(t){let e=atob(t);return Uint8Array.from(e,r=>r.codePointAt(0)??0)}a(FEt,"base64ToBytes");function b5i(t,e,r){for(let n=0;n]+?)>?\)/,n=/{"use strict";p();Object.defineProperty(UEt,"__esModule",{value:!0});UEt.TokenizerType=void 0;var T5i;(function(t){t.CL100K="cl100k_base",t.O200K="o200k_base",t.Llama3="llama3"})(T5i||(UEt.TokenizerType=T5i={}))});var CPr=I(Fre=>{"use strict";p();Object.defineProperty(Fre,"__esModule",{value:!0});Fre.WorkerWithRpcProxy=Fre.RcpResponseHandler=void 0;Fre.createRpcProxy=I5i;var vfc=require("worker_threads"),QEt=class{static{a(this,"RcpResponseHandler")}constructor(){this.nextId=1,this.handlers=new Map}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};Fre.RcpResponseHandler=QEt;function I5i(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(I5i,"createRpcProxy");var _Pr=class{static{a(this,"WorkerWithRpcProxy")}constructor(e,r,n){this.responseHandler=new QEt,this.worker=new vfc.Worker(e,r),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){this.worker.postMessage({id:o.id,err:s})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=I5i((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};Fre.WorkerWithRpcProxy=_Pr});var x5i=I(CR=>{"use strict";p();Object.defineProperty(CR,"__esModule",{value:!0});CR.SlidingWindowAverage=CR.MovingAverage=CR.Counter=void 0;CR.clamp=Sfc;CR.rot=Tfc;CR.isPointWithinTriangle=Ifc;CR.randomChance=xfc;var bfc=Yu();function Sfc(t,e,r){return Math.min(Math.max(t,e),r)}a(Sfc,"clamp");function Tfc(t,e){return(e+t%e)%e}a(Tfc,"rot");var vPr=class{static{a(this,"Counter")}constructor(){this._next=0}getNext(){return this._next++}};CR.Counter=vPr;var bPr=class{static{a(this,"MovingAverage")}constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}};CR.MovingAverage=bPr;var SPr=class{static{a(this,"SlidingWindowAverage")}constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){let r=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=r,this._sum+=e,this._n=0&&w>=0&&T+w<1}a(Ifc,"isPointWithinTriangle");function xfc(t){return(0,bfc.assert)(t>=0&&t<=1,"p must be between 0 and 1"),Math.random(){"use strict";p();Object.defineProperty(jEt,"__esModule",{value:!0});jEt.TikTokenImpl=void 0;var TPr=oGe(),qEt=x5i(),wfc=cO(),Rfc=Yvr(),IPr=class t{static{a(this,"TikTokenImpl")}constructor(){this._values=[],this._stats={encodeDuration:new qEt.MovingAverage,textLength:new qEt.MovingAverage,callCount:0}}static get instance(){return this._instance||(this._instance=new t),this._instance}init(e,r,n){let o=this._values.length,s=n?Rfc.parseTikTokenBinary:c=>c;return this._values.push((0,TPr.createTokenizer)(s(e),(0,TPr.getSpecialTokensByEncoder)(r),(0,TPr.getRegexByEncoder)(r),64e3)),o}encode(e,r,n){let o=wfc.StopWatch.create(!0),s=this._values[e].encode(r,n);return this._stats.callCount+=1,this._stats.encodeDuration.update(o.elapsed()),this._stats.textLength.update(r.length),s}destroy(e){this._values[e]=void 0}resetStats(){let e=this._stats,r={callCount:e.callCount,encodeDuration:e.encodeDuration.value,textLength:e.textLength.value};return this._stats.encodeDuration=new qEt.MovingAverage,this._stats.textLength=new qEt.MovingAverage,this._stats.callCount=0,r}};jEt.TikTokenImpl=IPr});var Ure=I(yp=>{"use strict";p();var P5i=yp&&yp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},D5i=yp&&yp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(yp,"__esModule",{value:!0});yp.TokenizerProvider=yp.BaseTokensPerName=yp.BaseTokensPerMessage=yp.BaseTokensPerCompletion=yp.ITokenizerProvider=void 0;yp.calculateImageTokenCost=kPr;yp.estimateDocumentTokenCost=M5i;var m$=wo(),kfc=rkr(),Pfc=EPr(),Dfc=rn(),R5i=iAe(),Nfc=CPr(),Mfc=Yu(),k5i=_3(),xPr=ko(),HEt=hA(),N5i=o0(),wPr=w5i();yp.ITokenizerProvider=(0,Dfc.createServiceIdentifier)("ITokenizerProvider");yp.BaseTokensPerCompletion=3;yp.BaseTokensPerMessage=3;yp.BaseTokensPerName=1;var RPr=class{static{a(this,"TokenizerProvider")}constructor(e,r){this._cl100kTokenizer=new k5i.Lazy(()=>new GEt(e,(0,HEt.join)(__dirname,"./cl100k_base.tiktoken"),"cl100k_base",r)),this._o200kTokenizer=new k5i.Lazy(()=>new GEt(e,(0,HEt.join)(__dirname,"./o200k_base.tiktoken"),"o200k_base",r))}dispose(){this._cl100kTokenizer.rawValue?.dispose(),this._o200kTokenizer.rawValue?.dispose()}acquireTokenizer(e){switch(e.tokenizer){case R5i.TokenizerType.CL100K:return this._cl100kTokenizer.value;case R5i.TokenizerType.O200K:return this._o200kTokenizer.value;default:throw new Error(`Unknown tokenizer: ${e.tokenizer}`)}}};yp.TokenizerProvider=RPr;yp.TokenizerProvider=RPr=P5i([D5i(1,N5i.ITelemetryService)],RPr);var GEt=class extends xPr.Disposable{static{a(this,"BPETokenizer")}constructor(e,r,n,o){super(),this._useWorker=e,this._tokenFilePath=r,this._encoderName=n,this._telemetryService=o,this._cache=new kfc.LRUCache(5e3),this.baseTokensPerMessage=yp.BaseTokensPerMessage,this.baseTokensPerName=yp.BaseTokensPerName,this.mode=m$.OutputMode.Raw}async countMessagesTokens(e){let r=yp.BaseTokensPerMessage;for(let n of e)r+=await this.countMessageTokens(n);return r}async tokenize(e){return(await this.ensureTokenizer()).encode(e)}async tokenLength(e){if(typeof e=="string")return this._textTokenLength(e);switch(e.type){case m$.Raw.ChatCompletionContentPartKind.Text:return this._textTokenLength(e.text);case m$.Raw.ChatCompletionContentPartKind.Opaque:return e.tokenUsage||0;case m$.Raw.ChatCompletionContentPartKind.Image:if(e.imageUrl.url.startsWith("data:image/"))try{return kPr(e.imageUrl.url,e.imageUrl.detail)}catch{return this._textTokenLength(e.imageUrl.url)}return this._textTokenLength(e.imageUrl.url);case m$.Raw.ChatCompletionContentPartKind.CacheBreakpoint:return 0;case m$.Raw.ChatCompletionContentPartKind.Document:return M5i(e.documentData.data);default:(0,Mfc.assertNever)(e,`unknown content part (${JSON.stringify(e)})`)}}async _textTokenLength(e){if(!e)return 0;let r=this._cache.get(e);return r||(r=(await this.tokenize(e)).length,this._cache.put(e,r)),r}async countMessageTokens(e){return this.baseTokensPerMessage+await this.countMessageObjectTokens((0,m$.toMode)(m$.OutputMode.OpenAI,e))}async countToolTokens(e){let n=0;e.length&&(n+=16);let o=8;for(let s of e)n+=o,n+=await this.countObjectTokens({name:s.name,description:s.description,parameters:s.inputSchema});return Math.floor(n*1.1)}async countMessageObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))if(o){if(typeof o=="string")r+=await this.tokenLength(o);else if(o){let s=o;if(s.type==="text")r+=await this.tokenLength(s.text);else if(s.type==="image_url"&&s.image_url)if(s.image_url.url.startsWith("data:image/"))try{r+=kPr(s.image_url.url,s.image_url.detail)}catch{r+=await this.tokenLength(s.image_url.url)}else r+=await this.tokenLength(s.image_url.url);else{let c=await this.countMessageObjectTokens(o);n==="tool_calls"&&(c=Math.floor(c*1.5)),r+=c}}n==="name"&&o!==void 0&&(r+=this.baseTokensPerName)}return r}async countObjectTokens(e){let r=0;for(let[n,o]of Object.entries(e))o&&(r+=await this.tokenLength(n),typeof o=="string"?r+=await this.tokenLength(o):o&&(r+=await this.countMessageObjectTokens(o)));return r}ensureTokenizer(){return this._tokenizer??=this.doInitTokenizer(),this._tokenizer}async doInitTokenizer(){let e=(0,HEt.basename)(__dirname)==="dist";if(this._useWorker){let r=(0,HEt.join)(__dirname,"tikTokenizerWorker.js"),n=new Nfc.WorkerWithRpcProxy(r,{name:`TikToken worker (${this._encoderName})`}),o=await n.proxy.init(this._tokenFilePath,this._encoderName,e),s=(0,xPr.toDisposable)(()=>{n.terminate(),this._store.deleteAndLeak(s),this._tokenizer=void 0}),c;return{encode:a((l,u)=>{let d=n.proxy.encode(o,l,u);return clearTimeout(c),c=setTimeout(()=>s.dispose(),15e3),Math.random()<1/1e3&&n.proxy.resetStats().then(f=>{this._telemetryService.sendMSFTTelemetryEvent("tokenizer.stats",void 0,f)}),d},"encode")}}else{let r=wPr.TikTokenImpl.instance.init(this._tokenFilePath,this._encoderName,e),n=(0,xPr.toDisposable)(()=>{wPr.TikTokenImpl.instance.destroy(r),this._store.deleteAndLeak(n),this._tokenizer=void 0});return this._store.add(n),{encode:a(async(o,s)=>wPr.TikTokenImpl.instance.encode(r,o,s),"encode")}}}};GEt=P5i([D5i(3,N5i.ITelemetryService)],GEt);function kPr(t,e){let{width:r,height:n}=(0,Pfc.getImageDimensions)(t);if(e==="low")return 85;if(r>2048||n>2048){let c=2048/Math.max(r,n);r=Math.round(r*c),n=Math.round(n*c)}let o=768/Math.min(r,n);return r=Math.round(r*o),n=Math.round(n*o),Math.ceil(r/512)*Math.ceil(n/512)*170+85}a(kPr,"calculateImageTokenCost");function M5i(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(M5i,"estimateDocumentTokenCost")});var g$=I(oAe=>{"use strict";p();Object.defineProperty(oAe,"__esModule",{value:!0});oAe.IDomainService=oAe.FEEDBACK_URL=void 0;var Ofc=rn();oAe.FEEDBACK_URL="https://aka.ms/microsoft/vscode-copilot-release";oAe.IDomainService=(0,Ofc.createServiceIdentifier)("IDomainService")});var $Et=I(HT=>{"use strict";p();Object.defineProperty(HT,"__esModule",{value:!0});HT.HeaderContributors=HT.IHeaderContributors=HT.userAgentLibraryHeader=void 0;HT.stringifyUrlOrRequestMetadata=Gfc;HT.createCapiRequestBody=$fc;HT.canRetryOnceNetworkError=B5i;HT.postRequest=Vfc;HT.getRequest=Wfc;var Bfc=rn(),Lfc=iAe(),Ffc=Ts(),Ufc=PE(),Qfc=o0(),qfc=ey(),jfc=u6();HT.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var Hfc=30*1e3;function Gfc(t){return typeof t=="string"?t:JSON.stringify(t)}a(Gfc,"stringifyUrlOrRequestMetadata");function $fc(t,e,r){let n={messages:(0,jfc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a($fc,"createCapiRequestBody");function O5i(t,e){let r=t.get(qfc.IFetcherService),n=t.get(Qfc.ITelemetryService),o=t.get(Ufc.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:Lfc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:Hfc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return typeof E.urlOrRequestMetadata=="string"?r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&B5i(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new Ffc.CancellationError:R}):o.makeRequest(T,E.urlOrRequestMetadata)}a(O5i,"networkRequest");function B5i(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(B5i,"canRetryOnceNetworkError");function Vfc(t,e){return O5i(t,{...e,requestType:"POST"})}a(Vfc,"postRequest");function Wfc(t,e){return O5i(t,{...e,requestType:"GET"})}a(Wfc,"getRequest");HT.IHeaderContributors=(0,Bfc.createServiceIdentifier)("headerContributors");var PPr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};HT.HeaderContributors=PPr});var Q5i=I(GT=>{"use strict";p();var zfc=GT&>.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Yfc=GT&>.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Kfc=GT&>.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;or.charAt(0).toUpperCase()+r.slice(1)),enumDescriptions:t.map(r=>{switch(r){case"none":return Ep.t("No reasoning applied");case"minimal":return Ep.t("Minimal reasoning for fastest responses");case"low":return Ep.t("Faster responses with less reasoning");case"medium":return Ep.t("Balanced reasoning and speed");case"high":return Ep.t("Greater reasoning depth but slower");case"xhigh":return Ep.t("Highest reasoning depth but slowest");case"max":return Ep.t("Absolute maximum capability with no constraints");default:return r}}),default:U5i(t,e),group:"navigation"}}a(Jfc,"buildReasoningEffortSchemaProperty");function Zfc(t){let e=t.name.toLowerCase(),r=t.family.toLowerCase();if(r.includes("claude")||e.includes("claude")){if(e.includes("opus"))return Ep.t("Most capable Claude model. Excellent for complex analysis, coding tasks, and nuanced creative writing.");if(e.includes("sonnet"))return Ep.t("Balanced Claude model offering strong performance for everyday coding and chat tasks at faster speeds.");if(e.includes("haiku"))return Ep.t("Fastest and most compact Claude model. Ideal for quick responses and simple tasks.")}if(r.includes("gpt")||e.includes("gpt")||r.includes("codex")||e.includes("codex"))return e.includes("codex")||r.includes("codex")?Ep.t("OpenAI Codex model specialized for code generation, debugging, and software development tasks."):e.includes("mini")?Ep.t("Lightweight GPT model for quick responses and simple tasks with low latency."):e.includes("copilot")?Ep.t("GPT model fine-tuned for Copilot code completions."):e.includes("4o")?Ep.t("Optimized GPT-4 model with faster responses and multimodal capabilities."):e.includes("4.1")?Ep.t("Enhanced GPT-4 model with improved instruction following and coding performance."):Ep.t("OpenAI GPT model for coding and general assistance.");if(r.includes("gemini")||e.includes("gemini"))return e.includes("flash")?Ep.t("Fast and efficient Gemini model optimized for quick responses and high throughput."):e.includes("pro")?Ep.t("Google's advanced Gemini Pro model with strong reasoning and coding capabilities."):Ep.t("Google Gemini model with balanced performance for coding and general assistance.");if(r.includes("grok")||e.includes("grok"))return Ep.t("xAI Grok model optimized for fast code generation and development tasks.")}a(Zfc,"getModelCapabilitiesDescription");function L5i(t){return t<.01?t.toExponential(2):t.toFixed(4).replace(/\.?0+$/,"")}a(L5i,"formatAicPrice");function Xfc(t){return Ep.t("In: {0} \xB7 Out: {1} AICs/1M tokens",L5i(t.default.inputPrice),L5i(t.default.outputPrice))}a(Xfc,"formatPricingLabel");var F5i=1e6,DPr=1e9;function epc(t){if(!t)return;let e=t.batch_size??F5i,r=F5i/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/DPr*r,outputPrice:t.output_price/DPr*r,cachePrice:t.cache_price!==void 0?t.cache_price/DPr*r:void 0}}}a(epc,"normalizeTokenPrices")});var t4i=I(ny=>{"use strict";p();var tpc=ny&&ny.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},q5i=ny&&ny.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ny,"__esModule",{value:!0});ny.AnthropicMessagesProcessor=void 0;ny.buildToolInputSchema=z5i;ny.createMessagesRequestBody=spc;ny.rawMessagesToMessagesAPI=Y5i;ny.clearAllCacheControl=K5i;ny.addToolsAndSystemCacheControl=J5i;ny.addMessagesApiCacheControl=Z5i;ny.processResponseFromMessagesEndpoint=lpc;ny.processNonStreamingResponseFromMessagesEndpoint=e4i;var MD=wo(),H5i=Xc(),rpc=Dkr(),NPr=um(),npc=yR(),j5i=Il(),G5i=pp(),sAe=CEt(),$5i=f6(),M4e=u6(),ipc=Qkr(),V5i=P4e(),opc=gp(),W5i=o0();function z5i(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(z5i,"buildToolInputSchema");function spc(t,e,r,n){let o=t.get(j5i.IConfigurationService),s=t.get(opc.IExperimentationService),c=t.get(ipc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===sAe.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let L=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),B={name:N.function.name,description:N.function.description||"",input_schema:z5i(N.function.parameters),...L?{defer_loading:!0}:{}};(L?d:u).push(B)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let L=e.postOptions.max_tokens??1024,B=n.minThinkingBudget??1024,Q=16e30?new Set(f.map(N=>N.name)):void 0,b=Y5i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,sAe.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,k=(0,sAe.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;K5i(b),Z5i(b,k),J5i(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:npc.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(spc,"createMessagesRequestBody");function Y5i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case MD.Raw.ChatRole.System:{n.push(...VEt(c.content).filter(l=>l.type==="text"));break}case MD.Raw.ChatRole.User:{let l=VEt(c.content);l.length>0&&r.push({role:"user",content:l});break}case MD.Raw.ChatRole.Assistant:{let l=VEt(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case MD.Raw.ChatRole.Tool:{if(c.toolCallId){let l=VEt(c.content),u=!1;for(let g of l)O4e(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===sAe.CUSTOM_TOOL_SEARCH_NAME?apc(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(Y5i,"rawMessagesToMessagesAPI");function apc(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(apc,"tryParseToolReferences");function VEt(t){let e=[],r=!1;for(let n of t){switch(n.type){case MD.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case MD.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case MD.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&O4e(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case MD.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case MD.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;s&&o.thinking.encrypted?e.push({type:"thinking",thinking:s,signature:o.thinking.encrypted}):o.thinking.encrypted&&!s&&e.push({type:"redacted_thinking",data:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);O4e(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(VEt,"rawContentToAnthropicContent");function O4e(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(O4e,"contentBlockSupportsCacheControl");function K5i(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(K5i,"clearAllCacheControl");function J5i(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a(J5i,"addToolsAndSystemCacheControl");function Z5i(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&O4e(c))&&(cpc(s,e),n++)}}a(Z5i,"addMessagesApiCacheControl");function cpc(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&O4e(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(cpc,"markLastCacheableBlock");async function lpc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new H5i.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,NPr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,$5i.getRequestId)(n.headers),h=t.createInstance(WEt,s,u,d,f),m=new rpc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,M4e.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,V5i.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):e4i(e,r,n,o,s)}a(lpc,"processResponseFromMessagesEndpoint");function upc(t){switch(t){case"refusal":return M4e.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return M4e.FinishedCompletionReason.Length;default:return M4e.FinishedCompletionReason.Stop}}a(upc,"mapStopReason");function X5i(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(X5i,"buildAnthropicCompletion");async function e4i(t,e,r,n,o){return new H5i.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,$5i.getRequestId)(r.headers),u=c||(0,NPr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,E=X5i({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,M4e.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,V5i.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(e4i,"processNonStreamingResponseFromMessagesEndpoint");var WEt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,NPr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return X5i({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};ny.AnthropicMessagesProcessor=WEt;ny.AnthropicMessagesProcessor=WEt=tpc([q5i(4,G5i.ILogService),q5i(5,W5i.ITelemetryService)],WEt)});var r4i=I(C6=>{"use strict";p();var dpc=C6&&C6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),fpc=C6&&C6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ppc=C6&&C6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===Qre.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(hpc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===Qre.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===Qre.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Qre.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Qre.Raw.ChatCompletionContentPartKind.Text,text:mpc})})}a(gpc,"filterHistoryImages")});var qre=I(a1=>{"use strict";p();var a4i=a1&&a1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},v0=a1&&a1.__param||function(t,e){return function(r,n){e(r,n,t)}},BPr;Object.defineProperty(a1,"__esModule",{value:!0});a1.RemoteAgentChatEndpoint=a1.ChatEndpoint=void 0;a1.defaultChatResponseProcessor=FPr;a1.defaultNonStreamChatResponseProcessor=g4i;var MPr=(bre(),Ca(vre)),n4i=wo(),c4i=Xc(),i4i=MJe(),Apc=um(),l4i=Qs(),ypc=SE(),u4i=A6(),Epc=yR(),_pc=C4e(),aAe=Il(),d4i=pp(),o4i=CEt(),Cpc=f6(),vpc=ey(),bpc=$Et(),Spc=P4e(),f4i=_6(),Tpc=wEt(),p4i=gp(),Ipc=o0(),h4i=Ure(),xpc=PE(),B4e=I4e(),m4i=g$(),L4e=IOe(),wpc=Q5i(),s4i=t4i(),OPr=NEt(),Rpc=r4i();async function FPr(t,e,r,n,o,s,c){let u=(await Tpc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return c4i.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,Spc.prepareChatCompletionForReturn)(t,e,f,s)})}a(FPr,"defaultChatResponseProcessor");async function g4i(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,_pc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Apc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,Cpc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return c4i.AsyncIterableObject.fromArray(s)}a(g4i,"defaultNonStreamChatResponseProcessor");var zEt=BPr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,B4e.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,wpc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice??0,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice??0,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,B4e.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,B4e.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(aAe.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,o4i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,o4i.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:MPr.RequestType.ChatResponses}:this.useMessagesApi?{type:MPr.RequestType.ChatMessages}:{type:MPr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(L4e.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(L4e.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(L4e.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(L4e.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(aAe.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(L4e.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===n4i.OpenAI.ChatRole.System?{role:n4i.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(OPr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(s4i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,bpc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,B4e.isAnthropicFamily)(this))return 20;if((0,B4e.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Rpc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(aAe.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,OPr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,OPr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,s4i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?FPr(e,r,n,o,s,c,l):g4i(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(aAe.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===Epc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(BPr,(0,i4i.mixin)((0,i4i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};a1.ChatEndpoint=zEt;a1.ChatEndpoint=zEt=BPr=a4i([v0(1,m4i.IDomainService),v0(2,u4i.IChatMLFetcher),v0(3,h4i.ITokenizerProvider),v0(4,l4i.IInstantiationService),v0(5,aAe.IConfigurationService),v0(6,p4i.IExperimentationService),v0(7,f4i.IChatWebSocketManager),v0(8,d4i.ILogService)],zEt);var LPr=class extends zEt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return FPr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};a1.RemoteAgentChatEndpoint=LPr;a1.RemoteAgentChatEndpoint=LPr=a4i([v0(2,m4i.IDomainService),v0(3,xpc.ICAPIClientService),v0(4,vpc.IFetcherService),v0(5,Ipc.ITelemetryService),v0(6,ypc.IAuthenticationService),v0(7,u4i.IChatMLFetcher),v0(8,h4i.ITokenizerProvider),v0(9,l4i.IInstantiationService),v0(10,aAe.IConfigurationService),v0(11,p4i.IExperimentationService),v0(12,f4i.IChatWebSocketManager),v0(13,d4i.ILogService)],LPr)});var A4i=I(VT=>{"use strict";p();var kpc=VT&&VT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$T=VT&&VT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(VT,"__esModule",{value:!0});VT.CopilotUtilityChatEndpoint=VT.CopilotUtilitySmallChatEndpoint=VT.CopilotChatEndpoint=void 0;var Ppc=Qs(),Dpc=SE(),Npc=A6(),Mpc=Il(),Opc=a4(),Bpc=pp(),Lpc=ey(),Fpc=_6(),Upc=gp(),Qpc=o0(),qpc=Ure(),jpc=PE(),Hpc=g$(),Gpc=qre(),F4e=class extends Gpc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};VT.CopilotChatEndpoint=F4e;VT.CopilotChatEndpoint=F4e=kpc([$T(1,Hpc.IDomainService),$T(2,jpc.ICAPIClientService),$T(3,Lpc.IFetcherService),$T(4,Opc.IEnvService),$T(5,Qpc.ITelemetryService),$T(6,Dpc.IAuthenticationService),$T(7,Npc.IChatMLFetcher),$T(8,qpc.ITokenizerProvider),$T(9,Ppc.IInstantiationService),$T(10,Mpc.IConfigurationService),$T(11,Upc.IExperimentationService),$T(12,Fpc.IChatWebSocketManager),$T(13,Bpc.ILogService)],F4e);var UPr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(F4e,n)}};VT.CopilotUtilitySmallChatEndpoint=UPr;var QPr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(F4e,n)}};VT.CopilotUtilityChatEndpoint=QPr});var qPr=I(V4=>{"use strict";p();var $pc=V4&&V4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WT=V4&&V4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(V4,"__esModule",{value:!0});V4.AutoChatEndpoint=void 0;V4.isAutoModel=chc;var Vpc=Qs(),Wpc=SE(),zpc=A6(),Ypc=Il(),Kpc=a4(),Jpc=pp(),Zpc=ey(),Xpc=_6(),ehc=gp(),thc=o0(),rhc=Ure(),nhc=PE(),ihc=g$(),ohc=qre(),shc=A4i(),U4e=class extends shc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){super(ahc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};V4.AutoChatEndpoint=U4e;V4.AutoChatEndpoint=U4e=$pc([WT(4,ihc.IDomainService),WT(5,nhc.ICAPIClientService),WT(6,Zpc.IFetcherService),WT(7,Kpc.IEnvService),WT(8,thc.ITelemetryService),WT(9,Wpc.IAuthenticationService),WT(10,zpc.IChatMLFetcher),WT(11,rhc.ITokenizerProvider),WT(12,Vpc.IInstantiationService),WT(13,Ypc.IConfigurationService),WT(14,ehc.IExperimentationService),WT(15,Xpc.IChatWebSocketManager),WT(16,Jpc.ILogService)],U4e);function ahc(t,e,r){let n;t instanceof ohc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(ahc,"calculateAutoModelInfo");function chc(t){return t&&(t.model===U4e.pseudoModelId||t instanceof U4e)?1:-1}a(chc,"isAutoModel")});var HPr=I(Q4e=>{"use strict";p();Object.defineProperty(Q4e,"__esModule",{value:!0});Q4e.getImageTelemetryEventMeasurements=lhc;Q4e.getImageTelemetryMeasurementsFromMessages=uhc;Q4e.getImageTelemetryMeasurementsFromReferences=dhc;var v4i=EPr(),y4i="screenshot-focused-window";function b4i(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(b4i,"createEmptyImageTelemetryMeasurements");function lhc(t){return t.imageCount>0?t:{}}a(lhc,"getImageTelemetryEventMeasurements");function uhc(t){let e=b4i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=_hc(n,"imageUrl"),s=jPr(o,"url");if(!s)continue;let c=fhc(s,jPr(o,"mediaType"));c&&S4i(e,c)}return e}a(uhc,"getImageTelemetryMeasurementsFromMessages");function dhc(t){let e=b4i();for(let r of t??[]){let n=cAe(r.value);if(!n)continue;let o=jPr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=_4i(n.data)??_4i(n.value);S4i(e,{mimeType:o,byteLength:s?.byteLength??C4i(n.data)??C4i(n.value),dimensions:mhc(s,o),source:ghc(r,n)})}return e}a(dhc,"getImageTelemetryMeasurementsFromReferences");function S4i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),phc(t,e.dimensions),T4i(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(S4i,"addImageTelemetryInput");function fhc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:Ahc(r[2]),dimensions:hhc(t),source:"unknown"}}a(fhc,"getImageTelemetryInputFromUrl");function phc(t,e){if(!e||!E4i(e.width)||!E4i(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(phc,"addImageDimensions");function E4i(t){return Number.isFinite(t)&&t>0}a(E4i,"isValidDimension");function hhc(t){try{return(0,v4i.getImageDimensions)(t)}catch{return}}a(hhc,"getImageDimensionsFromDataUrl");function mhc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||T4i(r)==="unknown"))try{return(0,v4i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(mhc,"getImageDimensionsFromBytes");function T4i(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(T4i,"normalizeMimeType");function ghc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===y4i||e.id===y4i?"screenshot":e.isURL===!1?"file":"unknown"}a(ghc,"getImageSourceFromReference");function Ahc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(Ahc,"getBase64ByteLength");function _4i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=cAe(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(yhc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Ehc))return new Uint8Array(o)}a(_4i,"getByteData");function yhc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(yhc,"isArrayIndexKey");function Ehc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Ehc,"isByteValue");function C4i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=cAe(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(C4i,"getByteLength");function _hc(t,e){return cAe(cAe(t)?.[e])}a(_hc,"getObjectProperty");function jPr(t,e){let r=cAe(t)?.[e];return typeof r=="string"?r:void 0}a(jPr,"getStringProperty");function cAe(t){return typeof t=="object"&&t!==null?t:void 0}a(cAe,"asRecord")});var w4i=I(lAe=>{"use strict";p();Object.defineProperty(lAe,"__esModule",{value:!0});lAe.ChatFailKind=lAe.FetchResponseKind=void 0;var I4i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(I4i||(lAe.FetchResponseKind=I4i={}));var x4i;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(x4i||(lAe.ChatFailKind=x4i={}))});var q4e=I(wu=>{"use strict";p();Object.defineProperty(wu,"__esModule",{value:!0});wu.FILE_TOOL_NAMES=wu.SHELL_TOOL_NAMES=wu.TOOL_PARAM_COMMAND_MAX_LEN=wu.GitHubCopilotAttr=wu.CopilotCliSdkAttr=wu.StdAttr=wu.CopilotChatAttr=wu.GenAiAttr=wu.GenAiToolType=wu.GenAiTokenType=wu.GenAiProviderName=wu.GenAiOperationName=void 0;wu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};wu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};wu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};wu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};wu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};wu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};wu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};wu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};wu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};wu.TOOL_PARAM_COMMAND_MAX_LEN=256;wu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);wu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var $Pr=I(vR=>{"use strict";p();Object.defineProperty(vR,"__esModule",{value:!0});vR.truncateForOTel=Chc;vR.toInputMessages=vhc;vR.toOutputMessages=bhc;vR.toSystemInstructions=Shc;vR.extractTextFromContent=GPr;vR.collectSystemTextsFromRequestBody=Thc;vR.normalizeProviderMessages=Ihc;vR.toToolDefinitions=P4i;vR.stringifyToolDefinitionsForOTel=Nhc;vR.stringifyToolsRawForTelemetry=Mhc;function Chc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(Chc,"truncateForOTel");function vhc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(vhc,"toInputMessages");function bhc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(bhc,"toOutputMessages");function Shc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(Shc,"toSystemInstructions");function GPr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` -`):""}a(GPr,"extractTextFromContent");function Thc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=GPr(n.content);o&&e.push(o)}}if(e.length===0){let n=GPr(t.system??t.instructions);n&&e.push(n)}return e}a(Thc,"collectSystemTextsFromRequestBody");function Ihc(t){return t.map(e=>{switch(e.type){case"function_call":return xhc(e);case"function_call_output":return whc(e);case"tool_search_output":return Rhc(e);case"reasoning":return khc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a(Ihc,"normalizeProviderMessages");function xhc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(xhc,"normalizeResponsesFunctionCall");function whc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(whc,"normalizeResponsesFunctionCallOutput");function Rhc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(Rhc,"normalizeResponsesToolSearchOutput");function khc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(khc,"normalizeResponsesReasoning");function P4i(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(P4i,"toToolDefinitions");var R4i=new WeakMap,k4i=new WeakMap,YEt,KEt;function Phc(t){return YEt!==void 0&&YEt===t?YEt:(YEt=t,t)}a(Phc,"internToolDefsString");function Dhc(t){return KEt!==void 0&&KEt===t?KEt:(KEt=t,t)}a(Dhc,"internToolsRawString");function Nhc(t){if(!t||t.length===0)return;let e=R4i.get(t);if(e!==void 0)return e;let r=P4i(t);if(!r)return;let n=Phc(JSON.stringify(r));return R4i.set(t,n),n}a(Nhc,"stringifyToolDefinitionsForOTel");function Mhc(t){if(!t)return;let e=k4i.get(t);if(e!==void 0)return e;let r=Dhc(JSON.stringify(t));return k4i.set(t,r),r}a(Mhc,"stringifyToolsRawForTelemetry")});var VPr=I(JEt=>{"use strict";p();Object.defineProperty(JEt,"__esModule",{value:!0});JEt.resolveWorkspaceOTelMetadata=Ohc;JEt.workspaceMetadataToOTelAttributes=Lhc;var D4i=xP(),N4i=Iwr(),A$=q4e();function Ohc(t,e){let r=t.activeRepository?.get();return r?Bhc(r,e):{}}a(Ohc,"resolveWorkspaceOTelMetadata");function Bhc(t,e){let r,n=Array.from((0,N4i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,N4i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,D4i.isEqualOrParent)(e,t.rootUri)&&(o=(0,D4i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Bhc,"buildWorkspaceMetadata");function Lhc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[A$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[A$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[A$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[A$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[A$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[A$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=Fhc(t.remoteUrl);r&&(e[A$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[A$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Lhc,"workspaceMetadataToOTelAttributes");function Fhc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a(Fhc,"extractGitHubOrg")});var M4i=I(bR=>{"use strict";p();Object.defineProperty(bR,"__esModule",{value:!0});bR.emitInferenceDetailsEvent=Uhc;bR.emitSessionStartEvent=Qhc;bR.emitToolCallEvent=qhc;bR.emitAgentTurnEvent=jhc;bR.emitEditFeedbackEvent=Hhc;bR.emitEditHunkActionEvent=Ghc;bR.emitInlineDoneEvent=$hc;bR.emitEditSurvivalEvent=Vhc;bR.emitUserFeedbackEvent=Whc;bR.emitCloudSessionInvokeEvent=zhc;var b0=q4e(),uAe=$Pr(),ZEt=VPr();function Uhc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[b0.GenAiAttr.OPERATION_NAME]:b0.GenAiOperationName.CHAT,[b0.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[b0.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[b0.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[b0.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[b0.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[b0.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[b0.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[b0.GenAiAttr.INPUT_MESSAGES]=(0,uAe.truncateForOTel)(JSON.stringify(c?(0,uAe.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,uAe.toSystemInstructions)(c);l!==void 0&&(o[b0.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,uAe.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,uAe.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[b0.GenAiAttr.TOOL_DEFINITIONS]=(0,uAe.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Uhc,"emitInferenceDetailsEvent");function Qhc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[b0.GenAiAttr.REQUEST_MODEL]:r,[b0.GenAiAttr.AGENT_NAME]:n})}a(Qhc,"emitSessionStartEvent");function qhc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[b0.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[b0.StdAttr.ERROR_TYPE]:o}:{}})}a(qhc,"emitToolCallEvent");function jhc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[b0.GenAiAttr.USAGE_INPUT_TOKENS]:r,[b0.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(jhc,"emitAgentTurnEvent");function Hhc(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,ZEt.workspaceMetadataToOTelAttributes)(u)})}a(Hhc,"emitEditFeedbackEvent");function Ghc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,ZEt.workspaceMetadataToOTelAttributes)(l)})}a(Ghc,"emitEditHunkActionEvent");function $hc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,ZEt.workspaceMetadataToOTelAttributes)(l)})}a($hc,"emitInlineDoneEvent");function Vhc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,ZEt.workspaceMetadataToOTelAttributes)(l)})}a(Vhc,"emitEditSurvivalEvent");function Whc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(Whc,"emitUserFeedbackEvent");function zhc(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(zhc,"emitCloudSessionInvokeEvent")});var O4i=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.GenAiMetrics=void 0;var Gc=q4e(),WPr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[Gc.GenAiAttr.OPERATION_NAME]:n.operationName,[Gc.GenAiAttr.PROVIDER_NAME]:n.providerName,[Gc.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[Gc.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[Gc.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[Gc.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[Gc.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[Gc.GenAiAttr.OPERATION_NAME]:o.operationName,[Gc.GenAiAttr.PROVIDER_NAME]:o.providerName,[Gc.GenAiAttr.TOKEN_TYPE]:n,[Gc.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[Gc.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[Gc.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[Gc.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[Gc.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[Gc.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[Gc.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[Gc.GenAiAttr.REQUEST_MODEL]:r})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Gc.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[Gc.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[Gc.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[Gc.CopilotChatAttr.EDIT_SOURCE]:r,[Gc.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[Gc.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r})}static incrementCloudPrReadyCount(e){e.incrementCounter("copilot_chat.cloud.pr_ready.count")}};XEt.GenAiMetrics=WPr});var YPr=I(e_t=>{"use strict";p();Object.defineProperty(e_t,"__esModule",{value:!0});e_t.NoopOTelService=void 0;var B4i=Sc(),L4i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},zPr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=B4i.Event.None,this.onDidEmitSpanEvent=B4i.Event.None,this.config=e}startSpan(e,r){return L4i}startActiveSpan(e,r,n){return n(L4i)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};e_t.NoopOTelService=zPr});var KPr=I(jre=>{"use strict";p();Object.defineProperty(jre,"__esModule",{value:!0});jre.DEFAULT_OTLP_ENDPOINT=void 0;jre.resolveOTelConfig=Jhc;jre.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function Yhc(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(Yhc,"parseResourceAttributes");function Khc(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(Khc,"parseOtlpEndpoint");function Jhc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return F4i(t);let r=t.settingDbSpanExporter??!1,n=(j4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(j4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return F4i(t);let s;j4e(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??jre.DEFAULT_OTLP_ENDPOINT,d=Khc(u,l)??jre.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=j4e(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=Zhc(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=j4e(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=Yhc(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(Jhc,"resolveOTelConfig");function F4i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(F4i,"createDisabledConfig");function j4e(t){if(t!==void 0)return t==="true"||t==="1"}a(j4e,"envBool");function Zhc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(Zhc,"parseMaxAttributeSizeChars")});var r_t=I(t_t=>{"use strict";p();Object.defineProperty(t_t,"__esModule",{value:!0});t_t.IOTelService=void 0;var Xhc=rn();t_t.IOTelService=(0,Xhc.createServiceIdentifier)("IOTelService")});var U4i=I(JPr=>{"use strict";p();Object.defineProperty(JPr,"__esModule",{value:!0});JPr.normalizeResponseModel=e0c;function e0c(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(e0c,"normalizeResponseModel")});var j4i=I(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.workspaceMetadataToOTelAttributes=Br.resolveWorkspaceOTelMetadata=Br.normalizeResponseModel=Br.IOTelService=Br.DEFAULT_OTLP_ENDPOINT=Br.resolveOTelConfig=Br.NoopOTelService=Br.truncateForOTel=Br.toToolDefinitions=Br.toSystemInstructions=Br.toOutputMessages=Br.toInputMessages=Br.stringifyToolsRawForTelemetry=Br.stringifyToolDefinitionsForOTel=Br.normalizeProviderMessages=Br.extractTextFromContent=Br.collectSystemTextsFromRequestBody=Br.GenAiMetrics=Br.emitUserFeedbackEvent=Br.emitToolCallEvent=Br.emitSessionStartEvent=Br.emitInlineDoneEvent=Br.emitInferenceDetailsEvent=Br.emitEditSurvivalEvent=Br.emitEditHunkActionEvent=Br.emitEditFeedbackEvent=Br.emitCloudSessionInvokeEvent=Br.emitAgentTurnEvent=Br.TOOL_PARAM_COMMAND_MAX_LEN=Br.StdAttr=Br.SHELL_TOOL_NAMES=Br.GitHubCopilotAttr=Br.GenAiToolType=Br.GenAiTokenType=Br.GenAiProviderName=Br.GenAiOperationName=Br.GenAiAttr=Br.FILE_TOOL_NAMES=Br.CopilotCliSdkAttr=Br.CopilotChatAttr=void 0;var SR=q4e();Object.defineProperty(Br,"CopilotChatAttr",{enumerable:!0,get:a(function(){return SR.CopilotChatAttr},"get")});Object.defineProperty(Br,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return SR.CopilotCliSdkAttr},"get")});Object.defineProperty(Br,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return SR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Br,"GenAiAttr",{enumerable:!0,get:a(function(){return SR.GenAiAttr},"get")});Object.defineProperty(Br,"GenAiOperationName",{enumerable:!0,get:a(function(){return SR.GenAiOperationName},"get")});Object.defineProperty(Br,"GenAiProviderName",{enumerable:!0,get:a(function(){return SR.GenAiProviderName},"get")});Object.defineProperty(Br,"GenAiTokenType",{enumerable:!0,get:a(function(){return SR.GenAiTokenType},"get")});Object.defineProperty(Br,"GenAiToolType",{enumerable:!0,get:a(function(){return SR.GenAiToolType},"get")});Object.defineProperty(Br,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return SR.GitHubCopilotAttr},"get")});Object.defineProperty(Br,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return SR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Br,"StdAttr",{enumerable:!0,get:a(function(){return SR.StdAttr},"get")});Object.defineProperty(Br,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return SR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var W4=M4i();Object.defineProperty(Br,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return W4.emitAgentTurnEvent},"get")});Object.defineProperty(Br,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return W4.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Br,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return W4.emitEditFeedbackEvent},"get")});Object.defineProperty(Br,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return W4.emitEditHunkActionEvent},"get")});Object.defineProperty(Br,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return W4.emitEditSurvivalEvent},"get")});Object.defineProperty(Br,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return W4.emitInferenceDetailsEvent},"get")});Object.defineProperty(Br,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return W4.emitInlineDoneEvent},"get")});Object.defineProperty(Br,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return W4.emitSessionStartEvent},"get")});Object.defineProperty(Br,"emitToolCallEvent",{enumerable:!0,get:a(function(){return W4.emitToolCallEvent},"get")});Object.defineProperty(Br,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return W4.emitUserFeedbackEvent},"get")});var t0c=O4i();Object.defineProperty(Br,"GenAiMetrics",{enumerable:!0,get:a(function(){return t0c.GenAiMetrics},"get")});var z4=$Pr();Object.defineProperty(Br,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return z4.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Br,"extractTextFromContent",{enumerable:!0,get:a(function(){return z4.extractTextFromContent},"get")});Object.defineProperty(Br,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return z4.normalizeProviderMessages},"get")});Object.defineProperty(Br,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return z4.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Br,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return z4.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Br,"toInputMessages",{enumerable:!0,get:a(function(){return z4.toInputMessages},"get")});Object.defineProperty(Br,"toOutputMessages",{enumerable:!0,get:a(function(){return z4.toOutputMessages},"get")});Object.defineProperty(Br,"toSystemInstructions",{enumerable:!0,get:a(function(){return z4.toSystemInstructions},"get")});Object.defineProperty(Br,"toToolDefinitions",{enumerable:!0,get:a(function(){return z4.toToolDefinitions},"get")});Object.defineProperty(Br,"truncateForOTel",{enumerable:!0,get:a(function(){return z4.truncateForOTel},"get")});var r0c=YPr();Object.defineProperty(Br,"NoopOTelService",{enumerable:!0,get:a(function(){return r0c.NoopOTelService},"get")});var Q4i=KPr();Object.defineProperty(Br,"resolveOTelConfig",{enumerable:!0,get:a(function(){return Q4i.resolveOTelConfig},"get")});Object.defineProperty(Br,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return Q4i.DEFAULT_OTLP_ENDPOINT},"get")});var n0c=r_t();Object.defineProperty(Br,"IOTelService",{enumerable:!0,get:a(function(){return n0c.IOTelService},"get")});var i0c=U4i();Object.defineProperty(Br,"normalizeResponseModel",{enumerable:!0,get:a(function(){return i0c.normalizeResponseModel},"get")});var q4i=VPr();Object.defineProperty(Br,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return q4i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Br,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return q4i.workspaceMetadataToOTelAttributes},"get")})});var e2r=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.AbstractRequestLogger=void 0;y$.getCurrentCapturingToken=c0c;y$.storeCapturingTokenForCorrelation=l0c;y$.retrieveCapturingTokenByCorrelation=u0c;y$.runWithCapturingToken=d0c;var o0c=require("async_hooks"),s0c=Lge(),a0c=ko(),H4e=new o0c.AsyncLocalStorage,ZPr=new Map;function c0c(){return H4e.getStore()}a(c0c,"getCurrentCapturingToken");function l0c(t){let e=H4e.getStore();e&&ZPr.set(t,e)}a(l0c,"storeCapturingTokenForCorrelation");function u0c(t){let e=ZPr.get(t);return e&&ZPr.delete(t),e}a(u0c,"retrieveCapturingTokenByCorrelation");function d0c(t,e){return H4e.run(t,e)}a(d0c,"runWithCapturingToken");var XPr=class extends a0c.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return H4e.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new s0c.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return H4e.getStore()}};y$.AbstractRequestLogger=XPr});var H4i=I(t2r=>{"use strict";p();Object.defineProperty(t2r,"__esModule",{value:!0});t2r.isEncryptedThinkingDelta=f0c;function f0c(t){return t.encrypted!==void 0}a(f0c,"isEncryptedThinkingDelta")});var $4i=I(n_t=>{"use strict";p();Object.defineProperty(n_t,"__esModule",{value:!0});n_t.calculateLineRepetitionStats=h0c;n_t.isRepetitive=m0c;var p0c=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function h0c(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` -`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(h0c,"calculateLineRepetitionStats");function m0c(t){let e=t.slice();return e.reverse(),G4i(e)||G4i(e.filter(r=>r.trim().length>0))}a(m0c,"isRepetitive");function G4i(t){let e=g0c(t);for(let r of p0c){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(g0c,"kmp_prefix_function")});var r2r=I(Y4=>{"use strict";p();var A0c=Y4&&Y4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},E$=Y4&&Y4.__param||function(t,e){return function(r,n){e(r,n,t)}},TR;Object.defineProperty(Y4,"__esModule",{value:!0});Y4.OpenAIEndpoint=void 0;Y4.isBYOKModel=R0c;var y0c=A6(),V4i=yR(),W4i=Il(),E0c=g$(),_0c=qre(),C0c=pp(),v0c=f6(),b0c=$Et(),S0c=_6(),T0c=gp(),I0c=Ure(),x0c=Qs();function w0c(t){return t.type===V4i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===V4i.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded +`}),this.lastTextDeltaOutputIndex=s.output_index;let c=new euc.Lazy(()=>new TextEncoder().encode(s.delta));return n({text:s.delta,logprobs:s.logprobs&&{content:s.logprobs.map(l=>({...v5i(c,l),top_logprobs:l.top_logprobs?.map(u=>v5i(c,u))||[]}))}})}case"response.output_item.added":if(e.item.type==="function_call")this.toolCallInfo.set(e.output_index,{name:e.item.name,callId:e.item.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:e.item.name,id:e.item.call_id}]});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.set(e.output_index,{name:d6.CUSTOM_TOOL_SEARCH_NAME,callId:s.call_id,arguments:""}),n({text:"",beginToolCalls:[{name:d6.CUSTOM_TOOL_SEARCH_NAME,id:s.call_id}]}))}return;case"response.function_call_arguments.delta":{let s=this.toolCallInfo.get(e.output_index);s&&(s.arguments+=e.delta,n({text:"",copilotToolCallStreamUpdates:[{id:s.callId,name:s.name,arguments:s.arguments}]}));return}case"response.output_item.done":if(e.item.type==="function_call")this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:e.item.call_id,name:e.item.name,arguments:e.item.arguments}],phase:e.item.phase});else if(e.item.type.toString()==="tool_search_call"){let s=e.item;s.execution==="client"&&s.call_id&&(this.toolCallInfo.delete(e.output_index),n({text:"",copilotToolCalls:[{id:s.call_id,name:d6.CUSTOM_TOOL_SEARCH_NAME,arguments:JSON.stringify(s.arguments??{})}]}))}else e.item.type==="reasoning"?n({text:"",thinking:e.item.encrypted_content?{id:e.item.id,text:this.hasReceivedReasoningSummary?void 0:e.item.summary.map(s=>s.text),encrypted:e.item.encrypted_content}:void 0}):e.item.type==="message"&&n({text:"",phase:e.item.phase});return;case"response.reasoning_summary_text.delta":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id,text:e.delta}});case"response.reasoning_summary_part.done":return this.hasReceivedReasoningSummary=!0,n({text:"",thinking:{id:e.item_id}});case"response.completed":{let s=e,c=Puc(s.response.output,this.latestCompactionOutputIndex),l=S5i(c,this.latestCompactionOutputIndex),u=l?.item,d=this.latestCompactionItem;u&&(this.sawCompactionMessage=!0,this.latestCompactionOutputIndex=l.outputIndex);let f=u&&(!d||d.id!==u.id||d.encrypted_content!==u.encrypted_content);if(u&&(this.latestCompactionItem=u),this.compactionThreshold!==void 0&&this.sawCompactionMessage){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,rkr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"compaction_returned",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled. headerRequestId=${this.requestId}`)}else if(this.compactionThreshold!==void 0&&(e.response.usage?.input_tokens??0)>=this.compactionThreshold){let h=e.response.usage?.input_tokens??0,m=e.response.usage?.total_tokens??0;(0,rkr.sendResponsesApiCompactionTelemetry)(this.telemetryService,{outcome:"threshold_met_no_compaction",headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,model:e.response.model},{compactThreshold:this.compactionThreshold,promptTokens:h,totalTokens:m}),this.logService.debug(`[responsesAPI_compaction] Compaction enabled but context not compacted after threshold was met. headerRequestId=${this.requestId}, gitHubRequestId=${this.ghRequestId}, promptTokens=${h}, totalTokens=${m}`)}return n({text:"",statefulMarker:e.response.id,contextManagement:f?u:void 0}),{blockFinished:!0,choiceIndex:0,model:e.response.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.response.id,created:e.response.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:{prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0},copilot_usage:s.copilot_usage?.total_nano_aiu!==void 0?s.copilot_usage:void 0},finishReason:xf.FinishedCompletionReason.Stop,message:{role:Xi.Raw.ChatRole.Assistant,content:c.map(h=>{if(h.type==="message")return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:h.content.map(m=>m.type==="output_text"?m.text:m.refusal).join("")};if(h.type==="image_generation_call"&&h.result)return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:h.result}}}).filter(F4.isDefined)}}}case"response.incomplete":{let s=e.response,c=s.incomplete_details?.reason,l,u;return c==="max_output_tokens"?l=xf.FinishedCompletionReason.Length:c==="content_filter"?(l=xf.FinishedCompletionReason.ContentFilter,u=Duc(s.content_filters)):l=xf.FinishedCompletionReason.ServerError,this.buildTerminalCompletion(s,l,{filterReason:u,error:_5i(s.error)})}case"response.failed":{let s=e.response;return this.buildTerminalCompletion(s,xf.FinishedCompletionReason.ServerError,{error:_5i(s.error)})}}}buildTerminalCompletion(e,r,n={}){let o=e.output??[];return{blockFinished:!0,choiceIndex:0,model:e.model,tokens:[],telemetryData:this.telemetryData,requestId:{headerRequestId:this.requestId,gitHubRequestId:this.ghRequestId,completionId:e.id,created:e.created_at,deploymentId:"",serverExperiments:this.serverExperiments},usage:e.usage?{prompt_tokens:e.usage.input_tokens??0,completion_tokens:e.usage.output_tokens??0,total_tokens:e.usage.total_tokens??0,prompt_tokens_details:{cached_tokens:e.usage.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.usage.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}}:void 0,finishReason:r,filterReason:n.filterReason,error:n.error,message:{role:Xi.Raw.ChatRole.Assistant,content:o.map(s=>{if(s.type==="message")return{type:Xi.Raw.ChatCompletionContentPartKind.Text,text:s.content.map(c=>c.type==="output_text"?c.text:c.refusal).join("")};if(s.type==="image_generation_call"&&s.result)return{type:Xi.Raw.ChatCompletionContentPartKind.Image,imageUrl:{url:s.result}}}).filter(F4.isDefined)}}}};Cv.OpenAIResponsesProcessor=TEt;Cv.OpenAIResponsesProcessor=TEt=Klc([Jlc(6,nuc.ILogService)],TEt);function v5i(t,e){let r=[];if(e.token){let n=new TextEncoder().encode(e.token),o=t.value,s=(0,Xlc.binaryIndexOf)(o,n);s!==-1&&(r=[s,s+n.length])}return{token:e.token,bytes:r,logprob:e.logprob}}a(v5i,"mapLogProp")});var I5i=I(xEt=>{"use strict";p();Object.defineProperty(xEt,"__esModule",{value:!0});xEt.ChatWebSocketTelemetrySender=void 0;var akr=class{static{a(this,"ChatWebSocketTelemetrySender")}static sendConnectedTelemetry(e,r){e.sendTelemetryEvent("websocket.connected",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId},{connectDurationMs:r.connectDurationMs})}static sendConnectErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.connectError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,error:r.error,responseStatusText:r.responseStatusText,networkError:r.networkError},{connectDurationMs:r.connectDurationMs,responseStatusCode:r.responseStatusCode})}static sendCloseTelemetry(e,r){e.sendTelemetryEvent("websocket.close",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{hadActiveRequest:r.hadActiveRequest?1:0,closeCode:r.closeCode,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.error",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendCloseDuringSetupTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.closeDuringSetup",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,gitHubRequestId:r.gitHubRequestId,closeReason:r.closeReason,closeEventReason:r.closeEventReason,closeEventWasClean:r.closeEventWasClean},{closeCode:r.closeCode,connectDurationMs:r.connectDurationMs})}static sendRequestSentTelemetry(e,r){e.sendTelemetryEvent("websocket.requestSent",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,sentMessageCharacters:r.sentMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendMessageParseErrorTelemetry(e,r){e.sendTelemetryErrorEvent("websocket.messageParseError",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,error:r.error},{hadActiveRequest:r.hadActiveRequest?1:0,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,receivedMessageCharacters:r.receivedMessageCharacters,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,connectionDurationMs:r.connectionDurationMs})}static sendRequestOutcomeTelemetry(e,r){e.sendTelemetryEvent("websocket.requestOutcome",{github:!0,microsoft:!0},{conversationId:r.conversationId,initiatingRequestId:r.initiatingRequestId,turnId:r.turnId,previousTurnId:r.previousTurnId,requestId:r.requestId,gitHubRequestId:r.gitHubRequestId,modelId:r.modelId,requestOutcome:r.requestOutcome,closeReason:r.closeReason,serverErrorMessage:r.serverErrorMessage,serverErrorCode:r.serverErrorCode},{hadActiveRequest:r.hadActiveRequest?1:0,statefulMarkerMatched:r.statefulMarkerMatched?1:0,previousResponseIdUnset:r.previousResponseIdUnset?1:0,hasCompactionData:r.hasCompactionData?1:0,summarizedAtRoundIdSet:r.summarizedAtRoundIdSet?1:0,summarizedAtRoundIdMatched:r.summarizedAtRoundIdMatched?1:0,modeChanged:r.modeChanged===void 0?-1:r.modeChanged?1:0,compactionThreshold:r.compactionThreshold,promptTokenCount:r.promptTokenCount,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,totalSentMessageCount:r.totalSentMessageCount,totalReceivedMessageCount:r.totalReceivedMessageCount,totalSentCharacters:r.totalSentCharacters,totalReceivedCharacters:r.totalReceivedCharacters,requestSentMessageCount:r.requestSentMessageCount,requestReceivedMessageCount:r.requestReceivedMessageCount,requestSentCharacters:r.requestSentCharacters,requestReceivedCharacters:r.requestReceivedCharacters,connectionDurationMs:r.connectionDurationMs,requestDurationMs:r.requestDurationMs,closeCode:r.closeCode})}};xEt.ChatWebSocketTelemetrySender=akr});var f6=I(Xb=>{"use strict";p();var Nuc=Xb&&Xb.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wEt=Xb&&Xb.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.ChatWebSocketManager=Xb.NullChatWebSocketManager=Xb.IChatWebSocketManager=void 0;Xb.isCAPIWebSocketError=fkr;var Muc=tn(),Ouc=bs(),REt=_c(),x5i=Io(),w5i=Sl(),Buc=wE(),zge=Ap(),Luc=Bh(),Fuc=iy(),Uuc=IEt(),i$=I5i();Xb.IChatWebSocketManager=(0,Muc.createServiceIdentifier)("IChatWebSocketManager");var ckr=class{static{a(this,"NullChatWebSocketManager")}getOrCreateConnection(e,r,n){throw new Error("WebSocket not available")}hasActiveConnection(e){return!1}getStatefulMarker(e){}getSummarizedAtRoundId(e){}closeConnection(e){}closeAll(){}};Xb.NullChatWebSocketManager=ckr;function fkr(t){return t.type==="error"&&"error"in t&&typeof t.error?.code=="string"}a(fkr,"isCAPIWebSocketError");var Quc={"response.completed":"completed","response.failed":"response_failed","response.incomplete":"response_incomplete","response.cancelled":"response_cancelled",error:"upstream_error"};function quc(t){return Quc[t.type]}a(quc,"getStreamTerminatingOutcome");var lkr=class extends x5i.Disposable{static{a(this,"ChatWebSocketManager")}constructor(e,r,n,o){super(),this._logService=e,this._capiClientService=r,this._telemetryService=n,this._configurationService=o,this._connections=new Map}getOrCreateConnection(e,r,n){let o=this._connections.get(e);if(o?.isOpen)return o;o&&(this._logService.debug(`[ChatWebSocketManager] Replacing closed connection for conversation ${e}`),o.dispose(),this._connections.delete(e));let s=new ukr(this._capiClientService,this._logService,this._telemetryService,this._configurationService,e,r,n);return this._logService.debug(`[ChatWebSocketManager] Creating new connection for conversation ${e}`),this._connections.set(e,s),s.onDidDispose(()=>{this._connections.get(e)===s&&this._connections.delete(e)}),s}hasActiveConnection(e){return!!this._connections.get(e)?.isOpen}getStatefulMarker(e){let r=this._connections.get(e);return r?.isOpen?r.statefulMarker:void 0}getSummarizedAtRoundId(e){let r=this._connections.get(e);return r?.isOpen?r.summarizedAtRoundId:void 0}closeConnection(e){let r=this._connections.get(e);r&&(r.hasActiveRequest?this._logService.warn(`[ChatWebSocketManager] Closing connection for conversation ${e} while turn ${r.turnId} still has an active request`):this._logService.debug(`[ChatWebSocketManager] Closing connection for conversation ${e}`),r.dispose(),this._connections.delete(e))}closeAll(){for(let e of this._connections.values())e.dispose();this._connections.clear()}dispose(){this.closeAll(),super.dispose()}};Xb.ChatWebSocketManager=lkr;Xb.ChatWebSocketManager=lkr=Nuc([wEt(0,zge.ILogService),wEt(1,Buc.ICAPIClientService),wEt(2,Luc.ITelemetryService),wEt(3,w5i.IConfigurationService)],lkr);function PEt(t){switch(t){case 1e3:return"Normal Closure";case 1001:return"Going Away";case 1002:return"Protocol Error";case 1003:return"Unsupported Data";case 1005:return"No Status Received";case 1006:return"Abnormal Closure";case 1007:return"Invalid Payload";case 1008:return"Policy Violation";case 1009:return"Message Too Big";case 1010:return"Missing Extension";case 1011:return"Internal Error";case 1012:return"Service Restart";case 1013:return"Try Again Later";case 1014:return"Bad Gateway";case 1015:return"TLS Handshake Failed";default:return"Unknown"}}a(PEt,"wsCloseCodeToString");var ukr=class extends x5i.Disposable{static{a(this,"ChatWebSocketConnection")}constructor(e,r,n,o,s,c,l){super(),this._capiClientService=e,this._logService=r,this._telemetryService=n,this._configurationService=o,this._conversationId=s,this._headers=c,this._initiatingRequestId=l,this._state=2,this._onDidDispose=this._register(new REt.Emitter),this.onDidDispose=this._onDidDispose.event,this._totalSentMessageCount=0,this._totalReceivedMessageCount=0,this._totalSentCharacters=0,this._totalReceivedCharacters=0,this._responseHeaders=new Fuc.HeadersImpl({}),this._hadActiveRequest=!1}get isOpen(){return this._state===1&&!!this._ws}get hasActiveRequest(){return!!this._activeRequest}get turnId(){return this._turnId}get statefulMarker(){return this._statefulMarker}get summarizedAtRoundId(){return this._summarizedAtRoundId}get responseHeaders(){return this._responseHeaders}get responseStatusCode(){return this._responseStatusCode}get responseStatusText(){return this._responseStatusText}get gitHubRequestId(){return this._responseHeaders.get("x-github-request-id")||""}async connect(){if(this._state===1)return;this._state=0,this._connectStartTime=Date.now(),this._logService.debug(`[ChatWebSocketManager] Connecting WebSocket for conversation ${this._conversationId}`);let e=await this._capiClientService.createResponsesWebSocket({headers:this._headers});return new Promise((r,n)=>{let o=e.webSocket,s=a(()=>{u(),this._state=1,this._connectedTime=Date.now(),this._ws=o,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText,this._setupMessageHandlers(o);let d=this._connectedTime-(this._connectStartTime??this._connectedTime);this._logService.debug(`[ChatWebSocketManager] Connected for conversation ${this._conversationId}`),i$.ChatWebSocketTelemetrySender.sendConnectedTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,connectDurationMs:d}),r()},"onOpen"),c=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=d.error?`${d.message}: ${(0,zge.collectSingleLineErrorMessage)(d.error)}`:d.message||"WebSocket error",h=d.error?.cause??e.networkError,m=h?(0,zge.collectSingleLineErrorMessage)(h):void 0,g=Date.now()-(this._connectStartTime??Date.now());this._logService.error(`[ChatWebSocketManager] Connection error for conversation ${this._conversationId}: ${f}${m?` (cause: ${m})`:""}`),i$.ChatWebSocketTelemetrySender.sendConnectErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,error:f,connectDurationMs:g,responseStatusCode:this._responseStatusCode,responseStatusText:this._responseStatusText,networkError:m}),n(new Error(f))},"onError"),l=a(d=>{u(),this._state=2,this._responseHeaders=e.responseHeaders,this._responseStatusCode=e.responseStatusCode,this._responseStatusText=e.responseStatusText;let f=Date.now()-(this._connectStartTime??Date.now()),h=PEt(d.code);this._logService.debug(`[ChatWebSocketManager] Connection closed during setup for conversation ${this._conversationId} (code: ${d.code} ${h}, reason: ${d.reason||""}, wasClean: ${d.wasClean})`),i$.ChatWebSocketTelemetrySender.sendCloseDuringSetupTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,gitHubRequestId:this.gitHubRequestId,closeCode:d.code,closeReason:h,closeEventReason:d.reason,closeEventWasClean:String(d.wasClean),connectDurationMs:f}),n(new Error("WebSocket closed during connection setup"))},"onClose"),u=a(()=>{o.removeEventListener("open",s),o.removeEventListener("error",c),o.removeEventListener("close",l)},"cleanup");o.addEventListener("open",s),o.addEventListener("error",c),o.addEventListener("close",l)})}_setupMessageHandlers(e){e.addEventListener("message",r=>{if(typeof r.data!="string")return;let n=r.data.length;this._totalReceivedMessageCount+=1,this._totalReceivedCharacters+=n;let o=Date.now()-(this._connectedTime??Date.now()),s;try{s=JSON.parse(r.data)}catch(c){let l=(0,zge.collectSingleLineErrorMessage)(c)||"Failed to parse websocket message";this._logService.error(`[ChatWebSocketManager] Failed to parse message for conversation ${this._conversationId} turn ${this._turnId}: ${l}`),i$.ChatWebSocketTelemetrySender.sendMessageParseErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:l,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,receivedMessageCharacters:n,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});return}!fkr(s)&&s.type==="response.completed"&&(this._statefulMarker=s.response.id,this._summarizedAtRoundId=this._activeRequest?.summarizedAtRoundId),this._activeRequest?.handleEvent(s)}),e.addEventListener("close",r=>{this._state=2;let n=Date.now()-(this._connectedTime??Date.now()),o=PEt(r.code);this._logService.debug(`[ChatWebSocketManager] Connection closed for conversation ${this._conversationId} turn ${this._turnId} (code: ${r.code} ${o}, reason: ${r.reason||""}, wasClean: ${r.wasClean})`),i$.ChatWebSocketTelemetrySender.sendCloseTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,closeCode:r.code,closeReason:o,closeEventReason:r.reason,closeEventWasClean:String(r.wasClean),connectionDurationMs:n,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters});let s=this._pendingErrorMessage;this._pendingErrorMessage=void 0,this._activeRequest?.handleConnectionClose(r.code,r.reason,s),this._activeRequest=void 0}),e.addEventListener("error",r=>{let n=r.error?`${r.message}: ${(0,zge.collectSingleLineErrorMessage)(r.error)}`:r.message||"WebSocket error",o=Date.now()-(this._connectedTime??Date.now());this._logService.error(`[ChatWebSocketManager] Error for conversation ${this._conversationId} turn ${this._turnId}: ${n}`),i$.ChatWebSocketTelemetrySender.sendErrorTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:this._turnId,previousTurnId:this._previousTurnId,hadActiveRequest:this._hadActiveRequest,requestId:this._activeRequest?.requestId,gitHubRequestId:this.gitHubRequestId,modelId:this._activeRequest?.modelId,error:n,connectionDurationMs:o,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._pendingErrorMessage??=n})}sendRequest(e,r,n){if(!this._ws||this._state!==1)throw new Error("WebSocket is not connected");let o=this._statefulMarker===e.previous_response_id,s=e.previous_response_id===void 0,c=e.input?.some(O=>O?.type==="compaction")??!1,l=r.summarizedAtRoundId!==void 0,u=r.summarizedAtRoundId===this._summarizedAtRoundId,d=(0,Uuc.getResponsesApiCompactionThresholdFromBody)(e),f=this._statefulMarker?.slice(0,5).concat("...")??"",h=e.previous_response_id?.slice(0,5).concat("...")??"";o?this._logService.trace(`[ChatWebSocketManager] WebSocket stateful marker matches previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`):this._logService.debug(`[ChatWebSocketManager] WebSocket stateful marker (${f}) does not match previous_response_id (${h}), summarizedAtRoundIdMatched: ${u}`);let m=!!this._activeRequest;m?(this._logService.warn(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} while turn ${this._turnId} still has an active request`),this._activeRequest.handleSuperseded()):this._logService.debug(`[ChatWebSocketManager] New request for conversation ${this._conversationId} turn ${r.turnId} (previous turn: ${this._turnId})`);let g=this._turnId,A=r.turnId;this._previousTurnId=g,this._turnId=A,this._hadActiveRequest=m;let y=r.requestId,E=Date.now(),_=this._totalSentMessageCount,v=this._totalReceivedMessageCount,b=this._totalSentCharacters,T=this._totalReceivedCharacters,w=r.countTokens(),R=-1;w.then(O=>{R=O},()=>{R=-2});let x=new dkr(y,r.model,r.summarizedAtRoundId,this._configurationService,this._logService);x.onDidSettle(({outcome:O,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})=>{this._activeRequest===x&&(this._activeRequest=void 0);let W=Date.now()-(this._connectedTime??Date.now()),$=Date.now()-E,J=this._totalSentMessageCount-_,ne=this._totalReceivedMessageCount-v,H=this._totalSentCharacters-b,re=this._totalReceivedCharacters-T;i$.ChatWebSocketTelemetrySender.sendRequestOutcomeTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,requestOutcome:O,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,promptTokenCount:R,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:W,requestDurationMs:$,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters,requestSentMessageCount:J,requestReceivedMessageCount:ne,requestSentCharacters:H,requestReceivedCharacters:re,closeCode:q,closeReason:Q,serverErrorMessage:U,serverErrorCode:z})}),this._activeRequest=x;let P=n.onCancellationRequested(()=>{this._activeRequest===x&&(x.handleCancellation(),this._activeRequest=void 0)});x.done.finally(()=>P.dispose()).catch(()=>{});let{stream:D,...N}=e,B={type:"response.create",...N,initiator:r.userInitiated?"user":"agent"},L=JSON.stringify(B),j=L.length;this._totalSentMessageCount+=1,this._totalSentCharacters+=j;let M=Date.now()-(this._connectedTime??Date.now());return this._logService.debug(`[ChatWebSocketManager] Sending request for conversation ${this._conversationId} turn ${this._turnId} (totalSentMessageCount: ${this._totalSentMessageCount}, sentMessageCharacters: ${j})`),i$.ChatWebSocketTelemetrySender.sendRequestSentTelemetry(this._telemetryService,{conversationId:this._conversationId,initiatingRequestId:this._initiatingRequestId,turnId:A,previousTurnId:g,hadActiveRequest:m,requestId:y,gitHubRequestId:this.gitHubRequestId,modelId:r.model,statefulMarkerMatched:o,previousResponseIdUnset:s,hasCompactionData:c,summarizedAtRoundIdSet:l,summarizedAtRoundIdMatched:u,modeChanged:r.modeChanged,compactionThreshold:d,tokenCountMax:r.tokenCountMax,modelMaxPromptTokens:r.modelMaxPromptTokens,connectionDurationMs:M,totalSentMessageCount:this._totalSentMessageCount,totalReceivedMessageCount:this._totalReceivedMessageCount,sentMessageCharacters:j,totalSentCharacters:this._totalSentCharacters,totalReceivedCharacters:this._totalReceivedCharacters}),this._ws.send(L),x}dispose(){this._activeRequest?.handleConnectionDisposed(),this._activeRequest=void 0,this._ws&&(this._ws.close(),this._ws=void 0),this._state=2,this._onDidDispose.fire(),super.dispose()}},dkr=class{static{a(this,"ChatWebSocketActiveRequest")}constructor(e,r,n,o,s){this.requestId=e,this.modelId=r,this.summarizedAtRoundId=n,this._configurationService=o,this._logService=s,this._onEvent=new REt.Emitter,this.onEvent=this._onEvent.event,this._onCAPIError=new REt.Emitter,this.onCAPIError=this._onCAPIError.event,this._onError=new REt.Emitter,this.onError=this._onError.event,this._firstEventSettled=!1,this._settled=!1,this.done=new Promise((c,l)=>{this._resolve=c,this._reject=l}),this.firstEvent=new Promise((c,l)=>{this._resolveFirstEvent=c,this._rejectFirstEvent=l})}onDidSettle(e){this._onDidSettle=e}handleEvent(e){if(this._settled)return;let r=this._configurationService.getConfig(w5i.ConfigKey.TeamInternal.DebugSimulateWebSocketResponse);if(r)try{e=JSON.parse(r),this._logService.info(`[ChatWebSocketManager] Simulating WebSocket response event: ${r}`)}catch(o){this._logService.error(`[ChatWebSocketManager] Failed to parse simulated WebSocket response: ${(0,zge.collectSingleLineErrorMessage)(o)}`)}if(this._firstEventSettled||(this._firstEventSettled=!0,this._resolveFirstEvent(e)),fkr(e)){this._finalizeCAPIError(e);return}this._onEvent.fire(e);let n=quc(e);n&&this._finalizeSuccess(n)}handleConnectionClose(e,r,n){if(this._settled)return;let o=n?new Error(`${n} (close code: ${e} ${PEt(e)}${r?`, reason: ${r}`:""})`):new Error(`WebSocket closed (code: ${e} ${PEt(e)}${r?`, reason: ${r}`:""})`);this._finalizeError("connection_closed",o,e,r)}handleSuperseded(){this._settled||this._finalizeError("superseded",new Error("Request superseded by new request"))}handleCancellation(){this._settled||this._finalizeError("canceled",new Ouc.CancellationError)}handleConnectionDisposed(){this._settled||this._finalizeError("connection_disposed",new Error("Connection disposed"))}_finalizeSuccess(e){this._settled=!0,this._onDidSettle?.({outcome:e}),this._resolve(),this._dispose()}_finalizeCAPIError(e){let{code:r,message:n}=e.error;this._onCAPIError.fire(e),this._settled=!0,this._onDidSettle?.({outcome:"error_response",serverErrorMessage:n,serverErrorCode:r}),this._reject(new Error(`${n} (${r})`)),this._dispose()}_finalizeError(e,r,n,o,s,c){this._firstEventSettled||(this._firstEventSettled=!0,this._rejectFirstEvent(r)),this._onError.fire(r),this._settled=!0,this._onDidSettle?.({outcome:e,closeCode:n,closeReason:o,serverErrorMessage:s,serverErrorCode:c}),this._reject(r),this._dispose()}_dispose(){this._onEvent.dispose(),this._onCAPIError.dispose(),this._onError.dispose()}}});var o$=I(Yge=>{"use strict";p();Object.defineProperty(Yge,"__esModule",{value:!0});Yge.IDomainService=Yge.FEEDBACK_URL=void 0;var juc=tn();Yge.FEEDBACK_URL="https://aka.ms/microsoft/vscode-copilot-release";Yge.IDomainService=(0,juc.createServiceIdentifier)("IDomainService")});var kEt=I(UT=>{"use strict";p();Object.defineProperty(UT,"__esModule",{value:!0});UT.HeaderContributors=UT.IHeaderContributors=UT.userAgentLibraryHeader=void 0;UT.stringifyUrlOrRequestMetadata=Juc;UT.createCapiRequestBody=Zuc;UT.canRetryOnceNetworkError=P5i;UT.postRequest=Xuc;UT.getRequest=edc;var Huc=tn(),Guc=Ice(),$uc=bs(),Vuc=wE(),Wuc=Bh(),zuc=iy(),Yuc=r6();UT.userAgentLibraryHeader="X-VSCode-User-Agent-Library-Version";var Kuc=30*1e3;function Juc(t){return typeof t=="string"?t:JSON.stringify(t)}a(Juc,"stringifyUrlOrRequestMetadata");function Zuc(t,e,r){let n={messages:(0,Yuc.rawMessageToCAPI)(t.messages,r),model:e};return t.postOptions&&Object.assign(n,t.postOptions),n}a(Zuc,"createCapiRequestBody");function R5i(t,e){let r=t.get(zuc.IFetcherService),n=t.get(Wuc.ITelemetryService),o=t.get(Vuc.ICAPIClientService),{requestType:s,endpointOrUrl:c,secretKey:l,intent:u,requestId:d,body:f,additionalHeaders:h,cancelToken:m,useFetcher:g,canRetryOnce:A=!0,location:y}=e,E=typeof c=="string"||"type"in c?{modelMaxPromptTokens:0,urlOrRequestMetadata:c,family:"",tokenizer:Guc.TokenizerType.O200K,acquireTokenizer:a(()=>{throw new Error("Method not implemented.")},"acquireTokenizer"),name:"",version:""}:c,_=e.interactionTypeOverride??u,v={...l?{Authorization:`Bearer ${l}`}:{},"X-Request-Id":d,"OpenAI-Intent":u,"X-GitHub-Api-Version":"2026-01-09",...h,...E.getExtraHeaders?E.getExtraHeaders(y,e.interactionTypeOverride):{}};v["X-Interaction-Type"]=_,v["X-Agent-Task-Id"]=d,E.interceptBody&&E.interceptBody(f);let b=E.getEndpointFetchOptions?.(),T={callSite:`network-request-${u}`,method:s,headers:v,json:f,timeout:Kuc,useFetcher:g,suppressIntegrationId:b?.suppressIntegrationId};if(m){let w=r.makeAbortController();m.onCancellationRequested(()=>{n.sendGHTelemetryEvent("networking.cancelRequest",{headerRequestId:d}),w.abort()}),T.signal=w.signal}return typeof E.urlOrRequestMetadata=="string"?r.fetch(E.urlOrRequestMetadata,T).catch(R=>{if(A&&P5i(R))return n.sendGHTelemetryEvent("networking.disconnectAll"),r.disconnectAll().then(()=>r.fetch(E.urlOrRequestMetadata,T));throw r.isAbortError(R)?new $uc.CancellationError:R}):o.makeRequest(T,E.urlOrRequestMetadata)}a(R5i,"networkRequest");function P5i(t){return["ECONNRESET","ETIMEDOUT","ERR_CONNECTION_RESET","ERR_NETWORK_CHANGED","ERR_HTTP2_INVALID_SESSION","ERR_HTTP2_STREAM_CANCEL","ERR_HTTP2_GOAWAY_SESSION","ERR_HTTP2_PROTOCOL_ERROR","ERR_FAILED"].includes(t?.code)}a(P5i,"canRetryOnceNetworkError");function Xuc(t,e){return R5i(t,{...e,requestType:"POST"})}a(Xuc,"postRequest");function edc(t,e){return R5i(t,{...e,requestType:"GET"})}a(edc,"getRequest");UT.IHeaderContributors=(0,Huc.createServiceIdentifier)("headerContributors");var pkr=class{static{a(this,"HeaderContributors")}constructor(){this.contributors=[]}add(e){this.contributors.push(e)}remove(e){let r=this.contributors.indexOf(e);r!==-1&&this.contributors.splice(r,1)}contributeHeaders(e){for(let r of this.contributors)r.contributeHeaderValues(e)}size(){return this.contributors.length}};UT.HeaderContributors=pkr});var M5i=I(QT=>{"use strict";p();var tdc=QT&&QT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),rdc=QT&&QT.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ndc=QT&&QT.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;or.charAt(0).toUpperCase()+r.slice(1)),enumDescriptions:t.map(r=>{switch(r){case"none":return Cp.t("No reasoning applied");case"minimal":return Cp.t("Minimal reasoning for fastest responses");case"low":return Cp.t("Faster responses with less reasoning");case"medium":return Cp.t("Balanced reasoning and speed");case"high":return Cp.t("Greater reasoning depth but slower");case"xhigh":return Cp.t("Highest reasoning depth but slowest");case"max":return Cp.t("Absolute maximum capability with no constraints");default:return r}}),default:N5i(t,e),group:"navigation"}}a(idc,"buildReasoningEffortSchemaProperty");function odc(t){let e=t.name.toLowerCase(),r=t.family.toLowerCase();if(r.includes("claude")||e.includes("claude")){if(e.includes("opus"))return Cp.t("Most capable Claude model. Excellent for complex analysis, coding tasks, and nuanced creative writing.");if(e.includes("sonnet"))return Cp.t("Balanced Claude model offering strong performance for everyday coding and chat tasks at faster speeds.");if(e.includes("haiku"))return Cp.t("Fastest and most compact Claude model. Ideal for quick responses and simple tasks.")}if(r.includes("gpt")||e.includes("gpt")||r.includes("codex")||e.includes("codex"))return e.includes("codex")||r.includes("codex")?Cp.t("OpenAI Codex model specialized for code generation, debugging, and software development tasks."):e.includes("mini")?Cp.t("Lightweight GPT model for quick responses and simple tasks with low latency."):e.includes("copilot")?Cp.t("GPT model fine-tuned for Copilot code completions."):e.includes("4o")?Cp.t("Optimized GPT-4 model with faster responses and multimodal capabilities."):e.includes("4.1")?Cp.t("Enhanced GPT-4 model with improved instruction following and coding performance."):Cp.t("OpenAI GPT model for coding and general assistance.");if(r.includes("gemini")||e.includes("gemini"))return e.includes("flash")?Cp.t("Fast and efficient Gemini model optimized for quick responses and high throughput."):e.includes("pro")?Cp.t("Google's advanced Gemini Pro model with strong reasoning and coding capabilities."):Cp.t("Google Gemini model with balanced performance for coding and general assistance.");if(r.includes("grok")||e.includes("grok"))return Cp.t("xAI Grok model optimized for fast code generation and development tasks.")}a(odc,"getModelCapabilitiesDescription");function k5i(t){return t<.01?t.toExponential(2):t.toFixed(4).replace(/\.?0+$/,"")}a(k5i,"formatAicPrice");function sdc(t){return Cp.t("In: {0} \xB7 Out: {1} AICs/1M tokens",k5i(t.default.inputPrice),k5i(t.default.outputPrice))}a(sdc,"formatPricingLabel");var D5i=1e6,hkr=1e9;function adc(t){if(!t)return;let e=t.batch_size??D5i,r=D5i/e,n=t.default;if(n&&n.input_price!==void 0&&n.output_price!==void 0){let o={inputPrice:n.input_price*r,outputPrice:n.output_price*r,cachePrice:n.cache_price!==void 0?n.cache_price*r:void 0,contextMax:n.context_max},s,c=t.long_context;if(c&&c.input_price!==void 0&&c.output_price!==void 0){let l={inputPrice:c.input_price*r,outputPrice:c.output_price*r,cachePrice:c.cache_price!==void 0?c.cache_price*r:void 0,contextMax:c.context_max};(l.inputPrice!==o.inputPrice||l.outputPrice!==o.outputPrice||l.cachePrice!==o.cachePrice)&&(s=l)}return{default:o,longContext:s}}if(!(t.input_price===void 0||t.output_price===void 0))return{default:{inputPrice:t.input_price/hkr*r,outputPrice:t.output_price/hkr*r,cachePrice:t.cache_price!==void 0?t.cache_price/hkr*r:void 0}}}a(adc,"normalizeTokenPrices")});var Y5i=I(ay=>{"use strict";p();var cdc=ay&&ay.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},O5i=ay&&ay.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(ay,"__esModule",{value:!0});ay.AnthropicMessagesProcessor=void 0;ay.buildToolInputSchema=j5i;ay.createMessagesRequestBody=pdc;ay.rawMessagesToMessagesAPI=H5i;ay.clearAllCacheControl=G5i;ay.addToolsAndSystemCacheControl=$5i;ay.addMessagesApiCacheControl=V5i;ay.processResponseFromMessagesEndpoint=gdc;ay.processNonStreamingResponseFromMessagesEndpoint=z5i;var kD=xo(),L5i=zc(),ldc=xPr(),mkr=fm(),udc=gR(),B5i=Sl(),F5i=Ap(),Kge=hEt(),U5i=i6(),v4e=r6(),ddc=OPr(),Q5i=y4e(),fdc=_p(),q5i=Bh();function j5i(t){if(!t)return{type:"object",properties:{}};let{$schema:e,...r}=t;return{type:"object",properties:{},...r}}a(j5i,"buildToolInputSchema");function pdc(t,e,r,n){let o=t.get(B5i.IConfigurationService),s=t.get(fdc.IExperimentationService),c=t.get(ddc.IToolDeferralService),l=!!n.supportsToolSearch&&!!e.requestOptions?.tools?.some(N=>N.function.name===Kge.CUSTOM_TOOL_SEARCH_NAME),u=[],d=[];if(e.requestOptions?.tools)for(let N of e.requestOptions.tools){if(!N.function.name||N.function.name.length===0)continue;let B=e.modelCapabilities?.enableToolSearch&&l&&!c.isNonDeferredTool(N.function.name),L={name:N.function.name,description:N.function.description||"",input_schema:j5i(N.function.parameters),...B?{defer_loading:!0}:{}};(B?d:u).push(L)}let f=[...u,...d],h=e.modelCapabilities?.reasoningEffort,m;if(e.modelCapabilities?.enableThinking){if(n.supportsAdaptiveThinking)m={type:"adaptive",display:"summarized"};else if(n.maxThinkingBudget&&n.minThinkingBudget){let B=e.postOptions.max_tokens??1024,L=n.minThinkingBudget??1024,j=16e30?new Set(f.map(N=>N.name)):void 0,b=H5i(e.messages,l?v:void 0),T=e.interactionTypeOverride==="conversation-subagent",w=(0,Kge.isExtendedCacheTtlEnabled)(n,o,s,e.location,T),R=w?"1h":void 0,P=(0,Kge.isExtendedCacheTtlMessagesEnabled)(w,o,s)?"1h":void 0;G5i(b),V5i(b,P),$5i(f,b,R);let D=b.messages.at(-1);return D&&D.role==="assistant"&&(E.warn(`[messagesAPI] Trailing assistant message detected \u2014 appending synthetic user message to prevent prefill error. Total messages: ${b.messages.length}`),_.sendMSFTTelemetryEvent("messagesApi.trailingAssistantGuard",{model:r,location:udc.ChatLocation.toString(e.location)},{messageCount:b.messages.length}),b.messages.push({role:"user",content:[{type:"text",text:"Please continue."}]})),{model:r,...b,stream:e.requestOptions?.stream??!0,tools:f.length>0?f:void 0,max_tokens:e.postOptions.max_tokens,thinking:m,...A?{output_config:{effort:A}}:{},...y?{context_management:y}:{}}}a(pdc,"createMessagesRequestBody");function H5i(t,e){let r=[],n=[],o=new Map;for(let c of t)switch(c.role){case kD.Raw.ChatRole.System:{n.push(...DEt(c.content).filter(l=>l.type==="text"));break}case kD.Raw.ChatRole.User:{let l=DEt(c.content);l.length>0&&r.push({role:"user",content:l});break}case kD.Raw.ChatRole.Assistant:{let l=DEt(c.content);if(c.toolCalls)for(let u of c.toolCalls){let d={};try{d=JSON.parse(u.function.arguments)}catch{}l.push({type:"tool_use",id:u.id,name:u.function.name,input:d}),o.set(u.id,u.function.name)}l.length>0&&r.push({role:"assistant",content:l});break}case kD.Raw.ChatRole.Tool:{if(c.toolCallId){let l=DEt(c.content),u=!1;for(let g of l)C4e(g)&&g.cache_control&&(u=!0,delete g.cache_control);let h=(e&&o.get(c.toolCallId)===Kge.CUSTOM_TOOL_SEARCH_NAME?hdc(l,e):void 0)??l.filter(g=>(g.type==="text"||g.type==="image"||g.type==="document")&&!(g.type==="text"&&g.text.trim()==="")),m={type:"tool_result",tool_use_id:c.toolCallId,content:h.length>0?h:void 0};u&&(m.cache_control={type:"ephemeral"}),r.push({role:"user",content:[m]})}break}}let s=[];for(let c of r){let l=s[s.length-1];if(l&&l.role===c.role){let u=Array.isArray(l.content)?l.content:[{type:"text",text:l.content}],d=Array.isArray(c.content)?c.content:[{type:"text",text:c.content}];l.content=[...u,...d]}else s.push(c)}return{messages:s,...n.length?{system:n}:{}}}a(H5i,"rawMessagesToMessagesAPI");function hdc(t,e){if(t.length!==1||t[0].type!=="text")return;let r;try{r=JSON.parse(t[0].text)}catch{return}if(Array.isArray(r))return r.filter(n=>typeof n=="string"&&(!e||e.has(n))).map(n=>({type:"tool_reference",tool_name:n}))}a(hdc,"tryParseToolReferences");function DEt(t){let e=[],r=!1;for(let n of t){switch(n.type){case kD.Raw.ChatCompletionContentPartKind.Text:n.text.trim()&&e.push({type:"text",text:n.text});break;case kD.Raw.ChatCompletionContentPartKind.Image:{let o=n.imageUrl.url,s=o.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);s?e.push({type:"image",source:{type:"base64",media_type:s[1],data:s[2]}}):o.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:o}});break}case kD.Raw.ChatCompletionContentPartKind.CacheBreakpoint:{let o=e.at(-1);o&&C4e(o)?o.cache_control={type:"ephemeral"}:r=!0;break}case kD.Raw.ChatCompletionContentPartKind.Document:{n.documentData.mediaType==="application/pdf"&&e.push({type:"document",source:{type:"base64",media_type:"application/pdf",data:n.documentData.data}});break}case kD.Raw.ChatCompletionContentPartKind.Opaque:{if(n.value&&typeof n.value=="object"&&"type"in n.value){let o=n.value;if(o.type==="thinking"&&o.thinking){let s=Array.isArray(o.thinking.text)?o.thinking.text.join(""):o.thinking.text;s&&o.thinking.encrypted?e.push({type:"thinking",thinking:s,signature:o.thinking.encrypted}):o.thinking.encrypted&&!s&&e.push({type:"redacted_thinking",data:o.thinking.encrypted})}}break}}if(r&&e.length>0){let o=e.at(-1);C4e(o)&&(o.cache_control={type:"ephemeral"},r=!1)}}return e}a(DEt,"rawContentToAnthropicContent");function C4e(t){return t.type!=="thinking"&&t.type!=="redacted_thinking"}a(C4e,"contentBlockSupportsCacheControl");function G5i(t){if(t.system)for(let e of t.system)delete e.cache_control;for(let e of t.messages)if(Array.isArray(e.content))for(let r of e.content)typeof r=="object"&&"cache_control"in r&&delete r.cache_control}a(G5i,"clearAllCacheControl");function $5i(t,e,r){let n=r?{type:"ephemeral",ttl:r}:{type:"ephemeral"};for(let s=t.length-1;s>=0;s--)if(!t[s].defer_loading){t[s].cache_control=n;break}let o=e.system?.at(-1);o&&!o.cache_control&&(o.cache_control=n)}a($5i,"addToolsAndSystemCacheControl");function V5i(t,e){let r=t.messages,n=0;for(let o=r.length-1;o>=0&&n<2;o--){let s=r[o];Array.isArray(s.content)&&s.content.some(c=>typeof c=="object"&&C4e(c))&&(mdc(s,e),n++)}}a(V5i,"addMessagesApiCacheControl");function mdc(t,e){if(Array.isArray(t.content))for(let r=t.content.length-1;r>=0;r--){let n=t.content[r];if(typeof n=="object"&&C4e(n)){n.cache_control=e?{type:"ephemeral",ttl:e}:{type:"ephemeral"};return}}}a(mdc,"markLastCacheableBlock");async function gdc(t,e,r,n,o,s){return(n.headers.get("content-type")??"").includes("text/event-stream")?new L5i.AsyncIterableObject(async l=>{let u=n.headers.get("X-Request-ID")??(0,mkr.generateUuid)(),d=n.headers.get("x-github-request-id")??"",{serverExperiments:f}=(0,U5i.getRequestId)(n.headers),h=t.createInstance(NEt,s,u,d,f),m=new ldc.SSEParser(g=>{try{r.trace(`[messagesAPI]SSE: ${g.data}`);let A=g.data?.trim();if(!A||A==="[DONE]")return;let y=JSON.parse(A),E=y.type??g.type;if(!E)return;let _=h.push({...y,type:E},o);if(_){r.info(`[messagesAPI] message ${_.choiceIndex} returned. finish reason: [${_.finishReason}]`);let v=s.extendedBy({completionChoiceFinishReason:_.finishReason,headerRequestId:_.requestId.headerRequestId});e.sendGHTelemetryEvent("completion.finishReason",v.properties,v.measurements);let b=(0,v4e.rawMessageToCAPI)(_.message),T=s;_.usage&&(T=s.extendedBy({},{promptTokens:_.usage.prompt_tokens,completionTokens:_.usage.completion_tokens,totalTokens:_.usage.total_tokens,..._.usage.prompt_tokens_details&&{cachedTokens:_.usage.prompt_tokens_details.cached_tokens},..._.usage.completion_tokens_details&&{reasoningTokens:_.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:_.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:_.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Q5i.sendEngineMessagesTelemetry)(e,[b],T,!0,r),l.emitOne(_)}}catch(A){l.reject(A)}});for await(let g of n.body)m.feed(g)},async()=>{await n.body.destroy()}):z5i(e,r,n,o,s)}a(gdc,"processResponseFromMessagesEndpoint");function Adc(t){switch(t){case"refusal":return v4e.FinishedCompletionReason.ClientDone;case"max_tokens":case"model_context_window_exceeded":return v4e.FinishedCompletionReason.Length;default:return v4e.FinishedCompletionReason.Stop}}a(Adc,"mapStopReason");function W5i(t,e){let r=t.inputTokens+t.cacheCreationTokens+t.cacheReadTokens;return r0?{toolCalls:t.toolCalls.map(n=>({id:n.id,type:"function",function:{name:n.name,arguments:n.arguments}}))}:{}}}}a(W5i,"buildAnthropicCompletion");async function z5i(t,e,r,n,o){return new L5i.AsyncIterableObject(async s=>{let{headerRequestId:c,serverExperiments:l}=(0,U5i.getRequestId)(r.headers),u=c||(0,mkr.generateUuid)(),d=r.headers.get("x-github-request-id")??"",f=await r.text(),h;try{h=JSON.parse(f)}catch(T){s.reject(new Error(`Failed to parse non-streaming Anthropic response: ${T instanceof Error?T.message:String(T)}`));return}if(h.type==="error"){s.reject(new Error(`Anthropic API error: ${h.error?.message??"Unknown error"}`));return}let m="",g=[];for(let T of h.content??[])switch(T.type){case"text":m+=T.text;break;case"tool_use":g.push({id:T.id,name:T.name,arguments:JSON.stringify(T.input)});break;case"thinking":case"redacted_thinking":break;default:{let w=T.type;e.warn(`[messagesAPI] non-streaming: unknown content_block type '${w}' for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.unknownContentBlock",{requestId:u,model:h.model,blockType:w});break}}let A={text:m,...g.length>0?{copilotToolCalls:g.map(T=>({id:T.id,name:T.name,arguments:T.arguments}))}:{}};await n(m,0,A),h.stop_reason==="refusal"&&(e.warn(`[messagesAPI] non-streaming: Refusal received for model ${h.model}`),t.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:u,model:h.model,category:"unknown"}));let y=h.usage,E=W5i({model:h.model,messageId:h.id,stopReason:h.stop_reason,textContent:m,toolCalls:g,inputTokens:y?.input_tokens??0,outputTokens:y?.output_tokens??0,cacheCreationTokens:y?.cache_creation_input_tokens??0,cacheCreation1hTokens:y?.cache_creation?.ephemeral_1h_input_tokens,cacheCreation5mTokens:y?.cache_creation?.ephemeral_5m_input_tokens,cacheReadTokens:y?.cache_read_input_tokens??0,thinkingTokens:y?.output_tokens_details?.thinking_tokens,requestId:u,ghRequestId:d,serverExperiments:l,telemetryData:o},e);e.info(`[messagesAPI] non-streaming message returned. finish reason: [${E.finishReason}]`);let _=o.extendedBy({completionChoiceFinishReason:E.finishReason,headerRequestId:E.requestId.headerRequestId});t.sendGHTelemetryEvent("completion.finishReason",_.properties,_.measurements);let v=(0,v4e.rawMessageToCAPI)(E.message),b=o;E.usage&&(b=o.extendedBy({},{promptTokens:E.usage.prompt_tokens,completionTokens:E.usage.completion_tokens,totalTokens:E.usage.total_tokens,...E.usage.prompt_tokens_details&&{cachedTokens:E.usage.prompt_tokens_details.cached_tokens},...E.usage.completion_tokens_details&&{reasoningTokens:E.usage.completion_tokens_details.reasoning_tokens,acceptedPredictionTokens:E.usage.completion_tokens_details.accepted_prediction_tokens,rejectedPredictionTokens:E.usage.completion_tokens_details.rejected_prediction_tokens}})),(0,Q5i.sendEngineMessagesTelemetry)(t,[v],b,!0,e),s.emitOne(E)},async()=>{await r.body.destroy()})}a(z5i,"processNonStreamingResponseFromMessagesEndpoint");var NEt=class{static{a(this,"AnthropicMessagesProcessor")}constructor(e,r,n,o,s,c){this.telemetryData=e,this.requestId=r,this.ghRequestId=n,this.serverExperiments=o,this.logService=s,this.telemetryService=c,this.textAccumulator="",this.toolCallAccumulator=new Map,this.thinkingAccumulator=new Map,this.completedToolCalls=[],this.messageId="",this.model="",this.inputTokens=0,this.outputTokens=0,this.cacheCreationTokens=0,this.cacheReadTokens=0}extractIPCodeCitations(e){if(!e?.IPCodeCitations?.length)return[];let r=new Set,n=[];for(let o of e.IPCodeCitations){let s=o.citations;if(!s)continue;let{url:c,license:l,snippet:u}=s;typeof c!="string"||c.trim()===""||typeof l!="string"||l.trim()===""||typeof u!="string"||u.trim()===""||r.has(c)||(r.add(c),n.push({citations:{url:c,license:l,snippet:u}}))}return n.length>0&&this.logService.trace(`[messagesAPI] IP code citations found: ${n.length} unique citations`),n}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,0,o)},"onProgress");switch(e.type){case"message_start":e.message&&(this.messageId=e.message.id,this.model=e.message.model,this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheCreation1hTokens=e.message.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.message.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0,this.thinkingTokens=e.message.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens);return;case"content_block_start":if(e.content_block?.type==="tool_use"&&e.index!==void 0){let o=e.content_block.id||(0,mkr.generateUuid)();this.toolCallAccumulator.set(e.index,{id:o,name:e.content_block.name||"",arguments:""}),this.textAccumulator.length&&n({text:" "}),n({text:"",beginToolCalls:[{name:e.content_block.name||"",id:o}]})}else if(e.content_block?.type==="thinking"&&e.index!==void 0)this.thinkingAccumulator.set(e.index,{thinking:"",signature:""});else if(e.content_block?.type==="redacted_thinking"&&e.index!==void 0){let o=e.content_block.data;n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:o}})}return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text){let o=this.extractIPCodeCitations(e.copilot_annotations);return o.length>0?n({text:e.delta.text,ipCitations:o}):n({text:e.delta.text})}else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);return o&&(o.thinking+=e.delta.thinking),n({text:"",thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json,n({text:"",copilotToolCallStreamUpdates:[{id:o.id,name:o.name,arguments:o.arguments}]}))}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),n({text:"",copilotToolCalls:[{id:o.id,name:o.name,arguments:o.arguments}]}),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&s.signature&&(n({text:"",thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":if(e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheCreation1hTokens=e.usage.cache_creation?.ephemeral_1h_input_tokens??this.cacheCreation1hTokens,this.cacheCreation5mTokens=e.usage.cache_creation?.ephemeral_5m_input_tokens??this.cacheCreation5mTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens,this.thinkingTokens=e.usage.output_tokens_details?.thinking_tokens??this.thinkingTokens),e.copilot_usage&&typeof e.copilot_usage.total_nano_aiu=="number"&&(this.copilotUsage=e.copilot_usage),e.context_management)return this.contextManagementResponse=e.context_management,n({text:"",contextManagement:e.context_management});e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.delta?.stop_details&&(this.stopDetails=e.delta.stop_details);return;case"message_stop":{if(this.contextManagementResponse){let o=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_input_tokens||0),0),s=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_tool_uses||0),0),c=this.contextManagementResponse.applied_edits.reduce((l,u)=>l+(u.cleared_thinking_turns||0),0);this.logService.trace(`[messagesAPI] Anthropic context editing applied: cleared ${o} tokens, ${s} tool uses.`),this.telemetryService.sendMSFTTelemetryEvent("contextEditingApplied",{requestId:this.requestId,interactionId:this.requestId,model:this.model},{clearedTokens:o,clearedToolUses:s,clearedThinkingTurns:c})}if(this.stopReason==="refusal"){let o=this.stopDetails?.category??"unknown";this.logService.warn(`[messagesAPI] Refusal received: category='${o}' for model ${this.model}`),this.telemetryService.sendMSFTTelemetryEvent("messagesApi.refusal",{requestId:this.requestId,model:this.model,category:o})}return W5i({model:this.model,messageId:this.messageId,stopReason:this.stopReason,textContent:this.textAccumulator,toolCalls:this.completedToolCalls,inputTokens:this.inputTokens,outputTokens:this.outputTokens,cacheCreationTokens:this.cacheCreationTokens,cacheCreation1hTokens:this.cacheCreation1hTokens,cacheCreation5mTokens:this.cacheCreation5mTokens,cacheReadTokens:this.cacheReadTokens,thinkingTokens:this.thinkingTokens,requestId:this.requestId,ghRequestId:this.ghRequestId,serverExperiments:this.serverExperiments,telemetryData:this.telemetryData,copilotUsage:this.copilotUsage},this.logService)}case"error":{let o=e.error?.message||"Unknown error";return n({text:"",copilotErrors:[{agent:"anthropic",code:"unknown",message:o,type:"error",identifier:void 0}]})}}}};ay.AnthropicMessagesProcessor=NEt;ay.AnthropicMessagesProcessor=NEt=cdc([O5i(4,F5i.ILogService),O5i(5,q5i.ITelemetryService)],NEt)});var K5i=I(p6=>{"use strict";p();var ydc=p6&&p6.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Edc=p6&&p6.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),_dc=p6&&p6.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=0;l--)if(t[l].role===Nre.Raw.ChatRole.User){r=l;break}r===-1&&t.length>0&&(r=t.length-1);let n=0;for(let l=Math.max(r,0);le)throw new Error(vdc.t("Too many images in request: {0} images provided, but the model supports a maximum of {1} images.",n,e));let s=e-n,c=new Map;for(let l=r-1;l>=0;l--)if(Array.isArray(t[l].content)){for(let u=t[l].content.length-1;u>=0;u--)if(t[l].content[u].type===Nre.Raw.ChatCompletionContentPartKind.Image){let d=`${l}:${u}`;s>0?(c.set(d,!0),s--):c.set(d,!1)}}return t.map((l,u)=>u>=r||!Array.isArray(l.content)||!l.content.some(d=>d.type===Nre.Raw.ChatCompletionContentPartKind.Image)?l:{...l,content:l.content.map((d,f)=>d.type!==Nre.Raw.ChatCompletionContentPartKind.Image||c.get(`${u}:${f}`)?d:{type:Nre.Raw.ChatCompletionContentPartKind.Text,text:Cdc})})}a(bdc,"filterHistoryImages")});var Mre=I(e1=>{"use strict";p();var t4i=e1&&e1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},b0=e1&&e1.__param||function(t,e){return function(r,n){e(r,n,t)}},ykr;Object.defineProperty(e1,"__esModule",{value:!0});e1.RemoteAgentChatEndpoint=e1.ChatEndpoint=void 0;e1.defaultChatResponseProcessor=_kr;e1.defaultNonStreamChatResponseProcessor=u4i;var gkr=(yre(),ya(Are)),J5i=xo(),r4i=zc(),Z5i=PJe(),Sdc=fm(),n4i=Ms(),Tdc=CE(),i4i=l6(),Idc=gR(),xdc=c4e(),Jge=Sl(),o4i=Ap(),X5i=hEt(),wdc=i6(),Rdc=iy(),Pdc=kEt(),kdc=y4e(),s4i=f6(),Ddc=vEt(),a4i=_p(),Ndc=Bh(),c4i=J7(),Mdc=wE(),b4e=p4e(),l4i=o$(),S4e=gOe(),Odc=M5i(),e4i=Y5i(),Akr=IEt(),Bdc=K5i();async function _kr(t,e,r,n,o,s,c){let u=(await Ddc.SSEProcessor.create(e,t,n,r,c)).processSSE(o);return r4i.AsyncIterableObject.map(u,f=>{let h=f.reason??"client-trimmed",m=s.extendedBy({completionChoiceFinishReason:h,headerRequestId:f.requestId.headerRequestId});return t.sendGHTelemetryEvent("completion.finishReason",m.properties,m.measurements),(0,kdc.prepareChatCompletionForReturn)(t,e,f,s)})}a(_kr,"defaultChatResponseProcessor");async function u4i(t,e,r){let n=await t.text(),o=JSON.parse(n),s=[];for(let c=0;c<(o?.choices?.length||0);c++){let l=o.choices[c],u={role:l.message.role,content:l.message.content,name:l.message.name,toolCalls:l.message.toolCalls??l.message.tool_calls},d=(0,xdc.getTextPart)(u.content),f=t.headers.get("X-Request-ID")??(0,Sdc.generateUuid)(),h=t.headers.get("x-github-request-id")??"",{serverExperiments:m}=(0,wdc.getRequestId)(t.headers),g={blockFinished:!1,choiceIndex:c,model:o.model,filterReason:void 0,finishReason:l.finish_reason,message:u,usage:o.usage,tokens:[],requestId:{headerRequestId:f,gitHubRequestId:h,completionId:o.id,created:o.created,deploymentId:"",serverExperiments:m},telemetryData:r},A=[];for(let y of u.toolCalls??[])A.push({name:y.function?.name??"",arguments:y.function?.arguments??"",id:y.id??""});await e(d,c,{text:d,copilotToolCalls:A}),s.push(g)}return r4i.AsyncIterableObject.fromArray(s)}a(u4i,"defaultNonStreamChatResponseProcessor");var MEt=ykr=class{static{a(this,"ChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d){this.modelMetadata=e,this._domainService=r,this._chatMLFetcher=n,this._tokenizerProvider=o,this._instantiationService=s,this._configurationService=c,this._expService=l,this._chatWebSocketService=u,this._maxTokens=e.capabilities.limits?.max_prompt_tokens??8192,this._maxOutputTokens=e.capabilities.limits?.max_output_tokens??4096,this.model=e.id,this.modelProvider=e.vendor,this.name=e.name,this.version=e.version;let f=(0,b4e.getModelCapabilityOverride)(this.model,this._configurationService);this.family=f?.family??e.capabilities.family,this.tokenizer=e.capabilities.tokenizer,this.showInModelPicker=e.model_picker_enabled,this.isPremium=e.billing?.is_premium,this.multiplier=e.billing?.multiplier,this.restrictedToSkus=e.billing?.restricted_to;let h=(0,Odc.normalizeTokenPrices)(e.billing?.token_prices);this.tokenPricing=h?{default:{inputPrice:h.default.inputPrice,outputPrice:h.default.outputPrice,cacheReadTokenPrice:h.default.cachePrice??0,contextMax:h.default.contextMax},longContext:h.longContext?{inputPrice:h.longContext.inputPrice,outputPrice:h.longContext.outputPrice,cacheReadTokenPrice:h.longContext.cachePrice??0,contextMax:h.longContext.contextMax}:void 0}:void 0,this.priceCategory=e.model_picker_price_category,this.isFallback=e.is_chat_fallback,this.supportsToolCalls=!!e.capabilities.supports.tool_calls,this.supportsVision=!!e.capabilities.supports.vision,this.supportsPrediction=!!e.capabilities.supports.prediction,this.supportsAdaptiveThinking=e.capabilities.supports.adaptive_thinking,this.minThinkingBudget=e.capabilities.supports.min_thinking_budget,this.maxThinkingBudget=e.capabilities.supports.max_thinking_budget,this.supportsReasoningEffort=e.capabilities.supports.reasoning_effort,this.supportsToolSearch=e.capabilities.supports.tool_search??(0,b4e.modelSupportsToolSearch)(this),this.supportsContextEditing=e.capabilities.supports.context_editing??(0,b4e.modelSupportsContextEditing)(this),this._supportsStreaming=!!e.capabilities.supports.streaming,this.customModel=e.custom_model,this.maxPromptImages=e.capabilities.limits?.vision?.max_prompt_images}getExtraHeaders(e,r){let n={...this.modelMetadata.requestHeaders};if(this.useMessagesApi){let o=this._configurationService.getConfig(Jge.ConfigKey.TeamInternal.ModelProviderPreference);o&&(n["X-Model-Provider-Preference"]=o)}return Object.assign(n,this.getAnthropicBetaHeader(e,r)),n}getAnthropicBetaHeader(e,r){if(!this.useMessagesApi)return{};let n=[];this.supportsAdaptiveThinking||n.push("interleaved-thinking-2025-05-14"),this.supportsToolSearch&&n.push("advanced-tool-use-2025-11-20"),(0,X5i.isAnthropicContextEditingEnabled)(this,this._configurationService,this._expService)&&n.push("context-management-2025-06-27");let o=r==="conversation-subagent";return(0,X5i.isExtendedCacheTtlEnabled)(this,this._configurationService,this._expService,e,o)&&n.push("extended-cache-ttl-2025-04-11"),n.length>0?{"anthropic-beta":n.join(",")}:{}}get modelMaxPromptTokens(){return this._maxTokens}get maxOutputTokens(){return this._maxOutputTokens}get urlOrRequestMetadata(){return this.modelMetadata.urlOrRequestMetadata??(this.useResponsesApi?{type:gkr.RequestType.ChatResponses}:this.useMessagesApi?{type:gkr.RequestType.ChatMessages}:{type:gkr.RequestType.ChatCompletions})}get useResponsesApi(){return this.modelMetadata.supported_endpoints&&!this.modelMetadata.supported_endpoints.includes(S4e.ModelSupportedEndpoint.ChatCompletions)&&this.modelMetadata.supported_endpoints.includes(S4e.ModelSupportedEndpoint.Responses)?!0:!!this.modelMetadata.supported_endpoints?.includes(S4e.ModelSupportedEndpoint.Responses)}get useWebSocketResponsesApi(){return!!this.modelMetadata.supported_endpoints?.includes(S4e.ModelSupportedEndpoint.WebSocketResponses)}get useMessagesApi(){return!!(this._configurationService.getExperimentBasedConfig(Jge.ConfigKey.UseAnthropicMessagesApi,this._expService)&&this.modelMetadata.supported_endpoints?.includes(S4e.ModelSupportedEndpoint.Messages))}get degradationReason(){return this.modelMetadata.warning_messages?.at(0)?.message??this.modelMetadata.info_messages?.at(0)?.message}get apiType(){return this.useResponsesApi?"responses":this.useMessagesApi?"messages":"chatCompletions"}interceptBody(e){if(e&&!this.supportsToolCalls&&delete e.tools,e&&!this._supportsStreaming&&(e.stream=!1),e?.messages&&(this.family.startsWith("o1")||this.model==="o1"||this.model==="o1-mini")){let r=e.messages.map(n=>n.role===J5i.OpenAI.ChatRole.System?{role:J5i.OpenAI.ChatRole.User,content:n.content}:n);e.messages=r}}createRequestBody(e){let r=this.getImageLimit();if(r!==void 0&&(e={...e,messages:this.validateAndFilterImages(e.messages,r)}),this.useResponsesApi){let n=this._instantiationService.invokeFunction(Akr.createResponsesRequestBody,e,this.model,this);return this.customizeResponsesBody(n)}else if(this.useMessagesApi){let n=this._instantiationService.invokeFunction(e4i.createMessagesRequestBody,e,this.model,this);return this.customizeMessagesBody(n)}else{let n=(0,Pdc.createCapiRequestBody)(e,this.model,this.getCompletionsCallback());return this.customizeCapiBody(n,e)}}getImageLimit(){if(this.useMessagesApi&&(0,b4e.isAnthropicFamily)(this))return 20;if((0,b4e.isGeminiFamily)(this))return 10}validateAndFilterImages(e,r){return(0,Bdc.filterHistoryImages)(e,r)}getCompletionsCallback(){}customizeMessagesBody(e){return e}customizeResponsesBody(e){return e}customizeCapiBody(e,r){if(!!r.requestOptions?.tools?.length&&this.family.toLowerCase().includes("gemini-3")){let o=this._configurationService.getExperimentBasedConfig(Jge.ConfigKey.TeamInternal.GeminiFunctionCallingMode,this._expService);o&&typeof e.tool_choice!="object"&&(e.tool_choice=o)}return e}async processResponseFromChatEndpoint(e,r,n,o,s,c,l){if(this.useResponsesApi){let u=(0,Akr.getResponsesApiCompactionThreshold)(this._configurationService,this._expService,this);return(0,Akr.processResponseFromChatEndpoint)(this._instantiationService,e,r,n,o,s,c,u)}else return this.useMessagesApi?(0,e4i.processResponseFromMessagesEndpoint)(this._instantiationService,e,r,n,s,c):this._supportsStreaming?_kr(e,r,n,o,s,c,l):u4i(n,s,c)}acquireTokenizer(){return this._tokenizerProvider.acquireTokenizer(this)}async makeChatRequest2(e,r){let n=e.useWebSocket??!!(e.turnId&&e.conversationId&&this.useWebSocketResponsesApi&&this._configurationService.getExperimentBasedConfig(Jge.ConfigKey.TeamInternal.ResponsesApiWebSocketEnabled,this._expService)),o=e.ignoreStatefulMarker??!(n&&e.conversationId&&e.turnId&&this._chatWebSocketService.hasActiveConnection(e.conversationId)),s=await this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:o},r);return s.type===Idc.ChatFetchResponseType.InvalidStatefulMarker?this._makeChatRequest2({...e,useWebSocket:n,ignoreStatefulMarker:!0},r):s}async _makeChatRequest2(e,r){return this._chatMLFetcher.fetchOne({requestOptions:{},...e,endpoint:this},r)}async makeChatRequest(e,r,n,o,s,c,l,u,d){return this.makeChatRequest2({debugName:e,messages:r,finishedCb:n,location:s,source:c,requestOptions:l,userInitiatedRequest:u,telemetryProperties:d},o)}cloneWithTokenOverride(e){return this._instantiationService.createInstance(ykr,(0,Z5i.mixin)((0,Z5i.deepClone)(this.modelMetadata),{capabilities:{limits:{max_prompt_tokens:e}}}))}};e1.ChatEndpoint=MEt;e1.ChatEndpoint=MEt=ykr=t4i([b0(1,l4i.IDomainService),b0(2,i4i.IChatMLFetcher),b0(3,c4i.ITokenizerProvider),b0(4,n4i.IInstantiationService),b0(5,Jge.IConfigurationService),b0(6,a4i.IExperimentationService),b0(7,s4i.IChatWebSocketManager),b0(8,o4i.ILogService)],MEt);var Ekr=class extends MEt{static{a(this,"RemoteAgentChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,n,u,d,f,h,m,g,A),this._requestMetadata=r}processResponseFromChatEndpoint(e,r,n,o,s,c,l,u){return _kr(e,r,n,2,s,c,l)}get urlOrRequestMetadata(){return this._requestMetadata}};e1.RemoteAgentChatEndpoint=Ekr;e1.RemoteAgentChatEndpoint=Ekr=t4i([b0(2,l4i.IDomainService),b0(3,Mdc.ICAPIClientService),b0(4,Rdc.IFetcherService),b0(5,Ndc.ITelemetryService),b0(6,Tdc.IAuthenticationService),b0(7,i4i.IChatMLFetcher),b0(8,c4i.ITokenizerProvider),b0(9,n4i.IInstantiationService),b0(10,Jge.IConfigurationService),b0(11,a4i.IExperimentationService),b0(12,s4i.IChatWebSocketManager),b0(13,o4i.ILogService)],Ekr)});var d4i=I(jT=>{"use strict";p();var Ldc=jT&&jT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},qT=jT&&jT.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(jT,"__esModule",{value:!0});jT.CopilotUtilityChatEndpoint=jT.CopilotUtilitySmallChatEndpoint=jT.CopilotChatEndpoint=void 0;var Fdc=Ms(),Udc=CE(),Qdc=l6(),qdc=Sl(),jdc=r4(),Hdc=Ap(),Gdc=iy(),$dc=f6(),Vdc=_p(),Wdc=Bh(),zdc=J7(),Ydc=wE(),Kdc=o$(),Jdc=Mre(),T4e=class extends Jdc.ChatEndpoint{static{a(this,"CopilotChatEndpoint")}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A){super(e,r,u,d,f,h,m,g,A)}getCompletionsCallback(){return(e,r)=>{r&&r.id&&(e.reasoning_opaque=r.id,e.reasoning_text=Array.isArray(r.text)?r.text.join(""):r.text)}}};jT.CopilotChatEndpoint=T4e;jT.CopilotChatEndpoint=T4e=Ldc([qT(1,Kdc.IDomainService),qT(2,Ydc.ICAPIClientService),qT(3,Gdc.IFetcherService),qT(4,jdc.IEnvService),qT(5,Wdc.ITelemetryService),qT(6,Udc.IAuthenticationService),qT(7,Qdc.IChatMLFetcher),qT(8,zdc.ITokenizerProvider),qT(9,Fdc.IInstantiationService),qT(10,qdc.IConfigurationService),qT(11,Vdc.IExperimentationService),qT(12,$dc.IChatWebSocketManager),qT(13,Hdc.ILogService)],T4e);var vkr=class t{static{a(this,"CopilotUtilitySmallChatEndpoint")}static{this.capiFamily="gpt-4o-mini"}static async resolve(e,r){let n=await e.getChatModelFromCapiFamily(t.capiFamily);return r.createInstance(T4e,n)}};jT.CopilotUtilitySmallChatEndpoint=vkr;var Ckr=class{static{a(this,"CopilotUtilityChatEndpoint")}static async resolve(e,r){let n=await e.getCopilotUtilityModel();return r.createInstance(T4e,n)}};jT.CopilotUtilityChatEndpoint=Ckr});var bkr=I(U4=>{"use strict";p();var Zdc=U4&&U4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HT=U4&&U4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(U4,"__esModule",{value:!0});U4.AutoChatEndpoint=void 0;U4.isAutoModel=mfc;var Xdc=Ms(),efc=CE(),tfc=l6(),rfc=Sl(),nfc=r4(),ifc=Ap(),ofc=iy(),sfc=f6(),afc=_p(),cfc=Bh(),lfc=J7(),ufc=wE(),dfc=o$(),ffc=Mre(),pfc=d4i(),I4e=class extends pfc.CopilotChatEndpoint{static{a(this,"AutoChatEndpoint")}static{this.pseudoModelId="auto"}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){super(hfc(e,r,n),s,c,l,u,d,f,h,m,g,A,y,E,_),this.discountRange=o}};U4.AutoChatEndpoint=I4e;U4.AutoChatEndpoint=I4e=Zdc([HT(4,dfc.IDomainService),HT(5,ufc.ICAPIClientService),HT(6,ofc.IFetcherService),HT(7,nfc.IEnvService),HT(8,cfc.ITelemetryService),HT(9,efc.IAuthenticationService),HT(10,tfc.IChatMLFetcher),HT(11,lfc.ITokenizerProvider),HT(12,Xdc.IInstantiationService),HT(13,rfc.IConfigurationService),HT(14,afc.IExperimentationService),HT(15,sfc.IChatWebSocketManager),HT(16,ifc.ILogService)],I4e);function hfc(t,e,r){let n;t instanceof ffc.ChatEndpoint?n=t.modelMetadata:n={id:t.model,vendor:t.modelProvider,name:t.name,version:t.version,model_picker_enabled:t.showInModelPicker,is_chat_default:!0,is_chat_fallback:t.isFallback,capabilities:{type:"chat",family:t.family,tokenizer:t.tokenizer,limits:{max_prompt_tokens:t.modelMaxPromptTokens,max_output_tokens:t.maxOutputTokens},supports:{tool_calls:t.supportsToolCalls,vision:t.supportsVision,prediction:t.supportsPrediction,streaming:!0}},billing:t.isPremium!==void 0||t.multiplier!==void 0||t.restrictedToSkus!==void 0?{is_premium:t.isPremium??!1,multiplier:t.multiplier??0,restricted_to:t.restrictedToSkus}:void 0,custom_model:t.customModel};let o=t.multiplier!==void 0?Math.round(t.multiplier*(1-r)*100)/100:void 0;return{...n,warning_messages:void 0,model_picker_enabled:!0,info_messages:void 0,billing:{is_premium:n.billing?.is_premium,multiplier:o,restricted_to:n.billing?.restricted_to},requestHeaders:{...n.requestHeaders||{},"Copilot-Session-Token":e}}}a(hfc,"calculateAutoModelInfo");function mfc(t){return t&&(t.model===I4e.pseudoModelId||t instanceof I4e)?1:-1}a(mfc,"isAutoModel")});var Tkr=I(x4e=>{"use strict";p();Object.defineProperty(x4e,"__esModule",{value:!0});x4e.getImageTelemetryEventMeasurements=gfc;x4e.getImageTelemetryMeasurementsFromMessages=Afc;x4e.getImageTelemetryMeasurementsFromReferences=yfc;var g4i=a8t(),f4i="screenshot-focused-window";function A4i(){return{imageCount:0,totalImageBytes:0,maxImageBytes:0,maxImageWidth:0,maxImageHeight:0,maxImagePixels:0,totalImagePixels:0,imagePngCount:0,imageJpegCount:0,imageGifCount:0,imageWebpCount:0,imageUnknownMimeCount:0,imageClipboardCount:0,imageScreenshotCount:0,imageFileCount:0,imageUrlCount:0,imageUnknownSourceCount:0}}a(A4i,"createEmptyImageTelemetryMeasurements");function gfc(t){return t.imageCount>0?t:{}}a(gfc,"getImageTelemetryEventMeasurements");function Afc(t){let e=A4i();for(let r of t??[])if(Array.isArray(r.content))for(let n of r.content){let o=xfc(n,"imageUrl"),s=Skr(o,"url");if(!s)continue;let c=Efc(s,Skr(o,"mediaType"));c&&y4i(e,c)}return e}a(Afc,"getImageTelemetryMeasurementsFromMessages");function yfc(t){let e=A4i();for(let r of t??[]){let n=Zge(r.value);if(!n)continue;let o=Skr(n,"mimeType");if(!o?.toLowerCase().startsWith("image/"))continue;let s=h4i(n.data)??h4i(n.value);y4i(e,{mimeType:o,byteLength:s?.byteLength??m4i(n.data)??m4i(n.value),dimensions:Cfc(s,o),source:bfc(r,n)})}return e}a(yfc,"getImageTelemetryMeasurementsFromReferences");function y4i(t,e){t.imageCount++;let r=e.byteLength??0;switch(t.totalImageBytes+=r,t.maxImageBytes=Math.max(t.maxImageBytes,r),_fc(t,e.dimensions),E4i(e.mimeType)){case"png":t.imagePngCount++;break;case"jpeg":t.imageJpegCount++;break;case"gif":t.imageGifCount++;break;case"webp":t.imageWebpCount++;break;default:t.imageUnknownMimeCount++}switch(e.source){case"clipboard":t.imageClipboardCount++;break;case"screenshot":t.imageScreenshotCount++;break;case"file":t.imageFileCount++;break;case"url":t.imageUrlCount++;break;default:t.imageUnknownSourceCount++}}a(y4i,"addImageTelemetryInput");function Efc(t,e){if(!t.startsWith("data:"))return t.startsWith("https://")?{mimeType:e,source:"url"}:void 0;let r=/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/.exec(t);if(r)return{mimeType:e??r[1],byteLength:Sfc(r[2]),dimensions:vfc(t),source:"unknown"}}a(Efc,"getImageTelemetryInputFromUrl");function _fc(t,e){if(!e||!p4i(e.width)||!p4i(e.height))return;let r=e.width*e.height;!Number.isFinite(r)||r<=0||(t.maxImageWidth=Math.max(t.maxImageWidth,e.width),t.maxImageHeight=Math.max(t.maxImageHeight,e.height),t.maxImagePixels=Math.max(t.maxImagePixels,r),t.totalImagePixels+=r)}a(_fc,"addImageDimensions");function p4i(t){return Number.isFinite(t)&&t>0}a(p4i,"isValidDimension");function vfc(t){try{return(0,g4i.getImageDimensions)(t)}catch{return}}a(vfc,"getImageDimensionsFromDataUrl");function Cfc(t,e){let r=e?.toLowerCase().split(";")[0].trim();if(!(!t||E4i(r)==="unknown"))try{return(0,g4i.getImageDimensionsFromBytes)(t,r)}catch{return}}a(Cfc,"getImageDimensionsFromBytes");function E4i(t){switch(t?.toLowerCase().split(";")[0].trim()){case"image/png":return"png";case"image/jpeg":case"image/jpg":return"jpeg";case"image/gif":return"gif";case"image/webp":return"webp";default:return"unknown"}}a(E4i,"normalizeMimeType");function bfc(t,e){return e.isPasted===!0?"clipboard":e.isURL===!0?"url":t.id===f4i||e.id===f4i?"screenshot":e.isURL===!1?"file":"unknown"}a(bfc,"getImageSourceFromReference");function Sfc(t){let e=t.trim(),r=0;return e.endsWith("==")?r=2:e.endsWith("=")&&(r=1),Math.max(0,Math.floor(e.length*3/4)-r)}a(Sfc,"getBase64ByteLength");function h4i(t){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=Zge(t);if(!e)return;let r=Object.keys(e);if(!r.length||!r.every(Tfc))return;let n=[...r];n.sort((s,c)=>Number(s)-Number(c));let o=n.map(s=>e[s]);if(o.every(Ifc))return new Uint8Array(o)}a(h4i,"getByteData");function Tfc(t){let e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t}a(Tfc,"isArrayIndexKey");function Ifc(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=255}a(Ifc,"isByteValue");function m4i(t){if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t.byteLength;let r=Zge(t)?.byteLength;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}a(m4i,"getByteLength");function xfc(t,e){return Zge(Zge(t)?.[e])}a(xfc,"getObjectProperty");function Skr(t,e){let r=Zge(t)?.[e];return typeof r=="string"?r:void 0}a(Skr,"getStringProperty");function Zge(t){return typeof t=="object"&&t!==null?t:void 0}a(Zge,"asRecord")});var C4i=I(Xge=>{"use strict";p();Object.defineProperty(Xge,"__esModule",{value:!0});Xge.ChatFailKind=Xge.FetchResponseKind=void 0;var _4i;(function(t){t.Success="success",t.Failed="failed",t.Canceled="canceled"})(_4i||(Xge.FetchResponseKind=_4i={}));var v4i;(function(t){t.OffTopic="offTopic",t.TokenExpiredOrInvalid="tokenExpiredOrInvalid",t.ServerCanceled="serverCanceled",t.ClientNotSupported="clientNotSupported",t.RateLimited="rateLimited",t.QuotaExceeded="quotaExceeded",t.ExtensionBlocked="extensionBlocked",t.ServerError="serverError",t.ContentFilter="contentFilter",t.AgentUnauthorized="unauthorized",t.AgentFailedDependency="failedDependency",t.ValidationFailed="validationFailed",t.InvalidPreviousResponseId="invalidPreviousResponseId",t.NotFound="notFound",t.Unknown="unknown"})(v4i||(Xge.ChatFailKind=v4i={}))});var w4e=I(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.FILE_TOOL_NAMES=xu.SHELL_TOOL_NAMES=xu.TOOL_PARAM_COMMAND_MAX_LEN=xu.GitHubCopilotAttr=xu.CopilotCliSdkAttr=xu.StdAttr=xu.CopilotChatAttr=xu.GenAiAttr=xu.GenAiToolType=xu.GenAiTokenType=xu.GenAiProviderName=xu.GenAiOperationName=void 0;xu.GenAiOperationName={CHAT:"chat",INVOKE_AGENT:"invoke_agent",EXECUTE_TOOL:"execute_tool",EMBEDDINGS:"embeddings",CONTENT_EVENT:"content_event",EXECUTE_HOOK:"execute_hook"};xu.GenAiProviderName={GITHUB:"github",OPENAI:"openai",ANTHROPIC:"anthropic",AZURE_AI_OPENAI:"azure.ai.openai",GEMINI:"gemini"};xu.GenAiTokenType={INPUT:"input",OUTPUT:"output"};xu.GenAiToolType={FUNCTION:"function",EXTENSION:"extension"};xu.GenAiAttr={OPERATION_NAME:"gen_ai.operation.name",PROVIDER_NAME:"gen_ai.provider.name",REQUEST_MODEL:"gen_ai.request.model",REQUEST_TEMPERATURE:"gen_ai.request.temperature",REQUEST_MAX_TOKENS:"gen_ai.request.max_tokens",REQUEST_TOP_P:"gen_ai.request.top_p",REQUEST_FREQUENCY_PENALTY:"gen_ai.request.frequency_penalty",REQUEST_PRESENCE_PENALTY:"gen_ai.request.presence_penalty",REQUEST_SEED:"gen_ai.request.seed",REQUEST_STOP_SEQUENCES:"gen_ai.request.stop_sequences",RESPONSE_MODEL:"gen_ai.response.model",RESPONSE_ID:"gen_ai.response.id",RESPONSE_FINISH_REASONS:"gen_ai.response.finish_reasons",USAGE_INPUT_TOKENS:"gen_ai.usage.input_tokens",USAGE_OUTPUT_TOKENS:"gen_ai.usage.output_tokens",USAGE_CACHE_READ_INPUT_TOKENS:"gen_ai.usage.cache_read.input_tokens",USAGE_CACHE_CREATION_INPUT_TOKENS:"gen_ai.usage.cache_creation.input_tokens",USAGE_REASONING_TOKENS:"gen_ai.usage.reasoning_tokens",USAGE_REASONING_OUTPUT_TOKENS:"gen_ai.usage.reasoning.output_tokens",CONVERSATION_ID:"gen_ai.conversation.id",OUTPUT_TYPE:"gen_ai.output.type",TOKEN_TYPE:"gen_ai.token.type",AGENT_NAME:"gen_ai.agent.name",AGENT_ID:"gen_ai.agent.id",AGENT_VERSION:"gen_ai.agent.version",AGENT_DESCRIPTION:"gen_ai.agent.description",TOOL_NAME:"gen_ai.tool.name",TOOL_TYPE:"gen_ai.tool.type",TOOL_CALL_ID:"gen_ai.tool.call.id",TOOL_DESCRIPTION:"gen_ai.tool.description",TOOL_CALL_ARGUMENTS:"gen_ai.tool.call.arguments",TOOL_CALL_RESULT:"gen_ai.tool.call.result",INPUT_MESSAGES:"gen_ai.input.messages",OUTPUT_MESSAGES:"gen_ai.output.messages",SYSTEM_INSTRUCTIONS:"gen_ai.system_instructions",TOOL_DEFINITIONS:"gen_ai.tool.definitions"};xu.CopilotChatAttr={LOCATION:"copilot_chat.location",INTENT:"copilot_chat.intent",TURN_INDEX:"copilot_chat.turn.index",TURN_COUNT:"copilot_chat.turn_count",TOOL_CALL_ROUND:"copilot_chat.tool_call_round",API_TYPE:"copilot_chat.api_type",FETCHER:"copilot_chat.fetcher",DEBUG_NAME:"copilot_chat.debug_name",ENDPOINT_TYPE:"copilot_chat.endpoint_type",MAX_PROMPT_TOKENS:"copilot_chat.request.max_prompt_tokens",TIME_TO_FIRST_TOKEN:"copilot_chat.time_to_first_token",SESSION_ID:"copilot_chat.session_id",SERVER_REQUEST_ID:"copilot_chat.server_request_id",CANCELED:"copilot_chat.canceled",REASONING_CONTENT:"copilot_chat.reasoning_content",USER_REQUEST:"copilot_chat.user_request",REQUEST_OPTIONS:"copilot_chat.request.options",REQUEST_SHAPE:"copilot_chat.request.shape",PROMPT_CONTEXT:"copilot_chat.prompt_context",PROMPT_INSTRUCTIONS:"copilot_chat.prompt_instructions",CHAT_SESSION_ID:"copilot_chat.chat_session_id",PARENT_CHAT_SESSION_ID:"copilot_chat.parent_chat_session_id",DEBUG_LOG_LABEL:"copilot_chat.debug_log_label",MARKDOWN_CONTENT:"copilot_chat.markdown_content",EDIT_SOURCE:"copilot_chat.edit.source",EDIT_OUTCOME:"copilot_chat.edit.outcome",LANGUAGE_ID:"copilot_chat.language_id",TIME_DELAY_MS:"copilot_chat.time_delay_ms",HAS_REMAINING_EDITS:"copilot_chat.has_remaining_edits",REPO_HEAD_BRANCH_NAME:"copilot_chat.repo.head_branch_name",REPO_HEAD_COMMIT_HASH:"copilot_chat.repo.head_commit_hash",REPO_REMOTE_URL:"copilot_chat.repo.remote_url",FILE_RELATIVE_PATH:"copilot_chat.file.relative_path",HOOK_TYPE:"copilot_chat.hook_type",HOOK_INPUT:"copilot_chat.hook_input",HOOK_OUTPUT:"copilot_chat.hook_output",HOOK_RESULT_KIND:"copilot_chat.hook_result_kind",MODE_NAME:"copilot_chat.mode_name",TOTAL_COST_USD:"copilot_chat.total_cost_usd",COPILOT_USAGE_NANO_AIU:"copilot_chat.copilot_usage_nano_aiu"};xu.StdAttr={ERROR_TYPE:"error.type",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port"};xu.CopilotCliSdkAttr={HOOK_TYPE:"github.copilot.hook.type",HOOK_INVOCATION_ID:"github.copilot.hook.invocation_id"};xu.GitHubCopilotAttr={AGENT_TYPE:"github.copilot.agent.type",GIT_REPOSITORY:"github.copilot.git.repository",GIT_BRANCH:"github.copilot.git.branch",GIT_COMMIT_SHA:"github.copilot.git.commit_sha",GITHUB_ORG:"github.copilot.github.org",HOOK_DECISION:"github.copilot.hook.decision",HOOK_DURATION_SECONDS:"github.copilot.hook.duration",HOOK_TOOL_NAMES:"github.copilot.hook.tool_names",MCP_SERVER_NAME_HASH:"github.copilot.mcp.server.name_hash",MCP_SERVER_NAME:"github.copilot.mcp.server.name",TOOL_PARAM_COMMAND:"github.copilot.tool.parameters.command",TOOL_PARAM_FILE_PATH:"github.copilot.tool.parameters.file_path",TOOL_PARAM_EDIT_TYPE:"github.copilot.tool.parameters.edit_type",TOOL_PARAM_SKILL_NAME:"github.copilot.tool.parameters.skill_name",TOOL_PARAM_MCP_SERVER_NAME_HASH:"github.copilot.tool.parameters.mcp_server_name_hash",TOOL_PARAM_MCP_SERVER_NAME:"github.copilot.tool.parameters.mcp_server_name",TOOL_PARAM_MCP_TOOL_NAME:"github.copilot.tool.parameters.mcp_tool_name"};xu.TOOL_PARAM_COMMAND_MAX_LEN=256;xu.SHELL_TOOL_NAMES=new Set(["bash","powershell","local_shell","runInTerminal","run_in_terminal","Bash"]);xu.FILE_TOOL_NAMES=new Set(["view","create","edit","str_replace","str_replace_editor","insert","readFile","createFile","replaceString","applyPatch","read_file","create_file","apply_patch","insert_edit_into_file","replace_string_in_file","multi_replace_string_in_file","edit_notebook_file","Read","Edit","MultiEdit","Write","NotebookEdit"])});var xkr=I(ER=>{"use strict";p();Object.defineProperty(ER,"__esModule",{value:!0});ER.truncateForOTel=wfc;ER.toInputMessages=Rfc;ER.toOutputMessages=Pfc;ER.toSystemInstructions=kfc;ER.extractTextFromContent=Ikr;ER.collectSystemTextsFromRequestBody=Dfc;ER.normalizeProviderMessages=Nfc;ER.toToolDefinitions=T4i;ER.stringifyToolDefinitionsForOTel=Qfc;ER.stringifyToolsRawForTelemetry=qfc;function wfc(t,e=0){if(e<=0||t.length<=e)return t;let r=`...[truncated, original ${t.length} chars]`;return e<=r.length?t.substring(0,e):t.substring(0,e-r.length)+r}a(wfc,"truncateForOTel");function Rfc(t){return t.map(e=>{let r=[];if(e.role==="tool"&&e.tool_call_id)return r.push({type:"tool_call_response",id:e.tool_call_id,response:e.content??""}),{role:e.role,parts:r};if(e.content&&r.push({type:"text",content:e.content}),e.tool_calls)for(let n of e.tool_calls){let o;try{o=JSON.parse(n.function.arguments)}catch{o=n.function.arguments}r.push({type:"tool_call",id:n.id,name:n.function.name,arguments:o})}return{role:e.role,parts:r}})}a(Rfc,"toInputMessages");function Pfc(t){return t.map(e=>{let r=[],n=e.message;if(n?.content&&r.push({type:"text",content:n.content}),n?.tool_calls)for(let o of n.tool_calls){let s;try{s=JSON.parse(o.function.arguments)}catch{s=o.function.arguments}r.push({type:"tool_call",id:o.id,name:o.function.name,arguments:s})}return{role:n?.role??"assistant",parts:r,finish_reason:e.finish_reason}})}a(Pfc,"toOutputMessages");function kfc(t){if(t===void 0)return;let r=(Array.isArray(t)?t:[t]).filter(n=>typeof n=="string"&&n.length>0).map(n=>({type:"text",content:n}));return r.length>0?r:void 0}a(kfc,"toSystemInstructions");function Ikr(t){return typeof t=="string"?t:Array.isArray(t)?t.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"){let r=e;if(typeof r.text=="string")return r.text;if(typeof r.content=="string")return r.content}return""}).filter(e=>e.length>0).join(` +`):""}a(Ikr,"extractTextFromContent");function Dfc(t){let e=[],r=t.messages??t.input;if(r){for(let n of r)if(n.role==="system"){let o=Ikr(n.content);o&&e.push(o)}}if(e.length===0){let n=Ikr(t.system??t.instructions);n&&e.push(n)}return e}a(Dfc,"collectSystemTextsFromRequestBody");function Nfc(t){return t.map(e=>{switch(e.type){case"function_call":return Mfc(e);case"function_call_output":return Ofc(e);case"tool_search_output":return Bfc(e);case"reasoning":return Lfc(e)}let n=e.role,o=[],s=e.content;if(n==="tool"&&typeof e.tool_call_id=="string")return o.push({type:"tool_call_response",id:e.tool_call_id,response:s??""}),{role:n,parts:o};if(typeof s=="string"&&s.length>0)o.push({type:"text",content:s});else if(Array.isArray(s))for(let l of s){if(!l||typeof l!="object")continue;let u=l;switch(u.type){case"text":case"input_text":case"output_text":typeof u.text=="string"&&o.push({type:"text",content:u.text});break;case"tool_use":o.push({type:"tool_call",id:String(u.id??""),name:String(u.name??""),arguments:u.input});break;case"tool_result":o.push({type:"tool_call_response",id:String(u.tool_use_id??""),response:u.content??""});break;case"thinking":typeof u.thinking=="string"&&o.push({type:"reasoning",content:u.thinking});break;default:o.push({type:"text",content:JSON.stringify(u)});break}}let c=e.tool_calls;if(Array.isArray(c))for(let l of c){if(!l||typeof l!="object")continue;let u=l,d=u.function;if(d){let f;try{f=typeof d.arguments=="string"?JSON.parse(d.arguments):d.arguments}catch{f=d.arguments}o.push({type:"tool_call",id:String(u.id??""),name:String(d.name??""),arguments:f})}}return{role:n,parts:o}})}a(Nfc,"normalizeProviderMessages");function Mfc(t){let e=t.arguments;if(typeof e=="string")try{e=JSON.parse(e)}catch{}return{role:"assistant",parts:[{type:"tool_call",id:String(t.call_id??t.id??""),name:String(t.name??""),arguments:e}]}}a(Mfc,"normalizeResponsesFunctionCall");function Ofc(t){let e=t.output,r;return typeof e=="string"?r=e:Array.isArray(e)?r=e.map(n=>n&&typeof n=="object"&&typeof n.text=="string"?n.text:JSON.stringify(n)).join(""):r=e??"",{role:"tool",parts:[{type:"tool_call_response",id:String(t.call_id??t.id??""),response:r}]}}a(Ofc,"normalizeResponsesFunctionCallOutput");function Bfc(t){let e=Object.prototype.hasOwnProperty.call(t,"tools")&&t.tools!==void 0,r={type:"tool_search_output",id:String(t.call_id??t.id??""),status:typeof t.status=="string"?t.status:void 0};return e&&(r.tools=t.tools),{role:"tool_search",parts:[r]}}a(Bfc,"normalizeResponsesToolSearchOutput");function Lfc(t){let e=[],r=t.summary;if(Array.isArray(r))for(let n of r)n&&typeof n=="object"&&typeof n.text=="string"&&e.push({type:"reasoning",content:n.text});else typeof r=="string"&&e.push({type:"reasoning",content:r});return typeof t.encrypted_content=="string"&&e.push({type:"reasoning",content:t.encrypted_content}),{role:"assistant",parts:e}}a(Lfc,"normalizeResponsesReasoning");function T4i(t){if(!t||t.length===0)return;let e=[];for(let r of t){let n=r.function?.name??r.name;if(!n)continue;let o=r.function?.description??r.description,s=r.function?.parameters??r.parameters??r.input_schema??r.inputSchema;e.push({type:"function",name:n,description:o,parameters:s})}return e.length>0?e:void 0}a(T4i,"toToolDefinitions");var b4i=new WeakMap,S4i=new WeakMap,OEt,BEt;function Ffc(t){return OEt!==void 0&&OEt===t?OEt:(OEt=t,t)}a(Ffc,"internToolDefsString");function Ufc(t){return BEt!==void 0&&BEt===t?BEt:(BEt=t,t)}a(Ufc,"internToolsRawString");function Qfc(t){if(!t||t.length===0)return;let e=b4i.get(t);if(e!==void 0)return e;let r=T4i(t);if(!r)return;let n=Ffc(JSON.stringify(r));return b4i.set(t,n),n}a(Qfc,"stringifyToolDefinitionsForOTel");function qfc(t){if(!t)return;let e=S4i.get(t);if(e!==void 0)return e;let r=Ufc(JSON.stringify(t));return S4i.set(t,r),r}a(qfc,"stringifyToolsRawForTelemetry")});var wkr=I(LEt=>{"use strict";p();Object.defineProperty(LEt,"__esModule",{value:!0});LEt.resolveWorkspaceOTelMetadata=jfc;LEt.workspaceMetadataToOTelAttributes=Gfc;var I4i=ak(),x4i=bwr(),s$=w4e();function jfc(t,e){let r=t.activeRepository?.get();return r?Hfc(r,e):{}}a(jfc,"resolveWorkspaceOTelMetadata");function Hfc(t,e){let r,n=Array.from((0,x4i.getOrderedRepoInfosFromContext)(t))[0];n?.fetchUrl&&(r=(0,x4i.normalizeFetchUrl)(n.fetchUrl));let o;return e&&(0,I4i.isEqualOrParent)(e,t.rootUri)&&(o=(0,I4i.relativePath)(t.rootUri,e)),{headBranchName:t.headBranchName,headCommitHash:t.headCommitHash,remoteUrl:r,fileRelativePath:o}}a(Hfc,"buildWorkspaceMetadata");function Gfc(t){if(!t)return{};let e={};if(t.headBranchName&&(e[s$.CopilotChatAttr.REPO_HEAD_BRANCH_NAME]=t.headBranchName,e[s$.GitHubCopilotAttr.GIT_BRANCH]=t.headBranchName),t.headCommitHash&&(e[s$.CopilotChatAttr.REPO_HEAD_COMMIT_HASH]=t.headCommitHash,e[s$.GitHubCopilotAttr.GIT_COMMIT_SHA]=t.headCommitHash),t.remoteUrl){e[s$.CopilotChatAttr.REPO_REMOTE_URL]=t.remoteUrl,e[s$.GitHubCopilotAttr.GIT_REPOSITORY]=t.remoteUrl;let r=$fc(t.remoteUrl);r&&(e[s$.GitHubCopilotAttr.GITHUB_ORG]=r)}return t.fileRelativePath&&(e[s$.CopilotChatAttr.FILE_RELATIVE_PATH]=t.fileRelativePath),e}a(Gfc,"workspaceMetadataToOTelAttributes");function $fc(t){return t.match(/github\.com[/:]([^/]+)\/[^/]+\/?$/i)?.[1]}a($fc,"extractGitHubOrg")});var w4i=I(_R=>{"use strict";p();Object.defineProperty(_R,"__esModule",{value:!0});_R.emitInferenceDetailsEvent=Vfc;_R.emitSessionStartEvent=Wfc;_R.emitToolCallEvent=zfc;_R.emitAgentTurnEvent=Yfc;_R.emitEditFeedbackEvent=Kfc;_R.emitEditHunkActionEvent=Jfc;_R.emitInlineDoneEvent=Zfc;_R.emitEditSurvivalEvent=Xfc;_R.emitUserFeedbackEvent=epc;_R.emitCloudSessionInvokeEvent=tpc;var S0=w4e(),eAe=xkr(),FEt=wkr();function Vfc(t,e,r,n){let o={"event.name":"gen_ai.client.inference.operation.details",[S0.GenAiAttr.OPERATION_NAME]:S0.GenAiOperationName.CHAT,[S0.GenAiAttr.REQUEST_MODEL]:e.model};if(r&&(r.model&&(o[S0.GenAiAttr.RESPONSE_MODEL]=r.model),r.id&&(o[S0.GenAiAttr.RESPONSE_ID]=r.id),r.finishReasons&&(o[S0.GenAiAttr.RESPONSE_FINISH_REASONS]=r.finishReasons),r.inputTokens!==void 0&&(o[S0.GenAiAttr.USAGE_INPUT_TOKENS]=r.inputTokens),r.outputTokens!==void 0&&(o[S0.GenAiAttr.USAGE_OUTPUT_TOKENS]=r.outputTokens)),e.temperature!==void 0&&(o[S0.GenAiAttr.REQUEST_TEMPERATURE]=e.temperature),e.maxTokens!==void 0&&(o[S0.GenAiAttr.REQUEST_MAX_TOKENS]=e.maxTokens),n&&(o[S0.StdAttr.ERROR_TYPE]=n.type),t.config.captureContent){let s=t.config.maxAttributeSizeChars;if(e.messages!==void 0){let c=Array.isArray(e.messages)?e.messages:void 0;o[S0.GenAiAttr.INPUT_MESSAGES]=(0,eAe.truncateForOTel)(JSON.stringify(c?(0,eAe.normalizeProviderMessages)(c):e.messages),s)}if(e.systemMessage!==void 0){let c=typeof e.systemMessage=="string"?e.systemMessage:JSON.stringify(e.systemMessage),l=(0,eAe.toSystemInstructions)(c);l!==void 0&&(o[S0.GenAiAttr.SYSTEM_INSTRUCTIONS]=(0,eAe.truncateForOTel)(JSON.stringify(l),s))}if(e.tools!==void 0){let c=(0,eAe.stringifyToolsRawForTelemetry)(e.tools);c!==void 0&&(o[S0.GenAiAttr.TOOL_DEFINITIONS]=(0,eAe.truncateForOTel)(c,s))}}t.emitLogRecord(`GenAI inference: ${e.model}`,o)}a(Vfc,"emitInferenceDetailsEvent");function Wfc(t,e,r,n){t.emitLogRecord("copilot_chat.session.start",{"event.name":"copilot_chat.session.start","session.id":e,[S0.GenAiAttr.REQUEST_MODEL]:r,[S0.GenAiAttr.AGENT_NAME]:n})}a(Wfc,"emitSessionStartEvent");function zfc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.tool.call: ${e}`,{"event.name":"copilot_chat.tool.call",[S0.GenAiAttr.TOOL_NAME]:e,duration_ms:r,success:n,...o?{[S0.StdAttr.ERROR_TYPE]:o}:{}})}a(zfc,"emitToolCallEvent");function Yfc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.agent.turn: ${e}`,{"event.name":"copilot_chat.agent.turn","turn.index":e,[S0.GenAiAttr.USAGE_INPUT_TOKENS]:r,[S0.GenAiAttr.USAGE_OUTPUT_TOKENS]:n,tool_call_count:o})}a(Yfc,"emitAgentTurnEvent");function Kfc(t,e,r,n,o,s,c,l,u){t.emitLogRecord(`copilot_chat.edit.feedback: ${e}`,{"event.name":"copilot_chat.edit.feedback",outcome:e,language_id:r,participant:n,request_id:o,edit_surface:s,has_remaining_edits:c,is_notebook:l,...(0,FEt.workspaceMetadataToOTelAttributes)(u)})}a(Kfc,"emitEditFeedbackEvent");function Jfc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.hunk.action: ${e}`,{"event.name":"copilot_chat.edit.hunk.action",outcome:e,language_id:r,request_id:n,line_count:o,lines_added:s,lines_removed:c,...(0,FEt.workspaceMetadataToOTelAttributes)(l)})}a(Jfc,"emitEditHunkActionEvent");function Zfc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.inline.done: ${e?"accepted":"rejected"}`,{"event.name":"copilot_chat.inline.done",accepted:e,language_id:r,edit_count:n,edit_line_count:o,reply_type:s,is_notebook:c,...(0,FEt.workspaceMetadataToOTelAttributes)(l)})}a(Zfc,"emitInlineDoneEvent");function Xfc(t,e,r,n,o,s,c,l){t.emitLogRecord(`copilot_chat.edit.survival: ${e}`,{"event.name":"copilot_chat.edit.survival",edit_source:e,survival_rate_four_gram:r,survival_rate_no_revert:n,time_delay_ms:o,did_branch_change:s,request_id:c,...(0,FEt.workspaceMetadataToOTelAttributes)(l)})}a(Xfc,"emitEditSurvivalEvent");function epc(t,e,r,n,o){t.emitLogRecord(`copilot_chat.user.feedback: ${e}`,{"event.name":"copilot_chat.user.feedback",rating:e,participant:r,conversation_id:n,request_id:o})}a(epc,"emitUserFeedbackEvent");function tpc(t,e,r,n){t.emitLogRecord(`copilot_chat.cloud.session.invoke: ${e}`,{"event.name":"copilot_chat.cloud.session.invoke",partner_agent:e,model:r,request_id:n})}a(tpc,"emitCloudSessionInvokeEvent")});var R4i=I(UEt=>{"use strict";p();Object.defineProperty(UEt,"__esModule",{value:!0});UEt.GenAiMetrics=void 0;var qc=w4e(),Rkr=class{static{a(this,"GenAiMetrics")}static recordOperationDuration(e,r,n){e.recordMetric("gen_ai.client.operation.duration",r,{[qc.GenAiAttr.OPERATION_NAME]:n.operationName,[qc.GenAiAttr.PROVIDER_NAME]:n.providerName,[qc.GenAiAttr.REQUEST_MODEL]:n.requestModel,...n.responseModel?{[qc.GenAiAttr.RESPONSE_MODEL]:n.responseModel}:{},...n.serverAddress?{[qc.StdAttr.SERVER_ADDRESS]:n.serverAddress}:{},...n.serverPort?{[qc.StdAttr.SERVER_PORT]:n.serverPort}:{},...n.errorType?{[qc.StdAttr.ERROR_TYPE]:n.errorType}:{}})}static recordTokenUsage(e,r,n,o){e.recordMetric("gen_ai.client.token.usage",r,{[qc.GenAiAttr.OPERATION_NAME]:o.operationName,[qc.GenAiAttr.PROVIDER_NAME]:o.providerName,[qc.GenAiAttr.TOKEN_TYPE]:n,[qc.GenAiAttr.REQUEST_MODEL]:o.requestModel,...o.responseModel?{[qc.GenAiAttr.RESPONSE_MODEL]:o.responseModel}:{},...o.serverAddress?{[qc.StdAttr.SERVER_ADDRESS]:o.serverAddress}:{}})}static recordToolCallCount(e,r,n){e.incrementCounter("copilot_chat.tool.call.count",1,{[qc.GenAiAttr.TOOL_NAME]:r,success:n})}static recordToolCallDuration(e,r,n){e.recordMetric("copilot_chat.tool.call.duration",n,{[qc.GenAiAttr.TOOL_NAME]:r})}static recordAgentDuration(e,r,n){e.recordMetric("copilot_chat.agent.invocation.duration",n,{[qc.GenAiAttr.AGENT_NAME]:r})}static recordAgentTurnCount(e,r,n){e.recordMetric("copilot_chat.agent.turn.count",n,{[qc.GenAiAttr.AGENT_NAME]:r})}static recordTimeToFirstToken(e,r,n){e.recordMetric("copilot_chat.time_to_first_token",n,{[qc.GenAiAttr.REQUEST_MODEL]:r})}static incrementSessionCount(e){e.incrementCounter("copilot_chat.session.count")}static recordEditAcceptance(e,r,n,o){e.incrementCounter("copilot_chat.edit.acceptance.count",1,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[qc.CopilotChatAttr.LANGUAGE_ID]:o}:{}})}static recordChatEditOutcome(e,r,n,o,s){e.incrementCounter("copilot_chat.chat_edit.outcome.count",1,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.EDIT_OUTCOME]:n,...o?{[qc.CopilotChatAttr.LANGUAGE_ID]:o}:{},...s!==void 0?{[qc.CopilotChatAttr.HAS_REMAINING_EDITS]:s}:{}})}static recordEditSurvivalFourGram(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.four_gram",n,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.TIME_DELAY_MS]:o})}static recordEditSurvivalNoRevert(e,r,n,o){e.recordMetric("copilot_chat.edit.survival.no_revert",n,{[qc.CopilotChatAttr.EDIT_SOURCE]:r,[qc.CopilotChatAttr.TIME_DELAY_MS]:o})}static incrementLinesOfCode(e,r,n,o){e.incrementCounter("copilot_chat.lines_of_code.count",o,{type:r,...n?{[qc.CopilotChatAttr.LANGUAGE_ID]:n}:{}})}static incrementUserActionCount(e,r){e.incrementCounter("copilot_chat.user.action.count",1,{action:r})}static incrementUserFeedbackCount(e,r){e.incrementCounter("copilot_chat.user.feedback.count",1,{rating:r})}static incrementAgentEditResponseCount(e,r){e.incrementCounter("copilot_chat.agent.edit_response.count",1,{outcome:r})}static incrementAgentSummarizationCount(e,r){e.incrementCounter("copilot_chat.agent.summarization.count",1,{outcome:r})}static incrementPullRequestCount(e){e.incrementCounter("copilot_chat.pull_request.count")}static incrementCloudSessionCount(e,r){e.incrementCounter("copilot_chat.cloud.session.count",1,{partner_agent:r})}static incrementCloudPrReadyCount(e){e.incrementCounter("copilot_chat.cloud.pr_ready.count")}};UEt.GenAiMetrics=Rkr});var kkr=I(QEt=>{"use strict";p();Object.defineProperty(QEt,"__esModule",{value:!0});QEt.NoopOTelService=void 0;var P4i=_c(),k4i={setAttribute(){},setAttributes(){},setStatus(){},recordException(){},addEvent(){},getSpanContext(){},end(){}},Pkr=class{static{a(this,"NoopOTelService")}constructor(e){this.onDidCompleteSpan=P4i.Event.None,this.onDidEmitSpanEvent=P4i.Event.None,this.config=e}startSpan(e,r){return k4i}startActiveSpan(e,r,n){return n(k4i)}getActiveTraceContext(){}storeTraceContext(e,r){}getStoredTraceContext(e){}runWithTraceContext(e,r){return r()}recordMetric(e,r,n){}incrementCounter(e,r,n){}emitLogRecord(e,r){}async flush(){}async shutdown(){}injectCompletedSpan(e){}};QEt.NoopOTelService=Pkr});var Dkr=I(Ore=>{"use strict";p();Object.defineProperty(Ore,"__esModule",{value:!0});Ore.DEFAULT_OTLP_ENDPOINT=void 0;Ore.resolveOTelConfig=ipc;Ore.DEFAULT_OTLP_ENDPOINT="http://localhost:4318";function rpc(t){if(!t)return{};let e={};for(let r of t.split(",")){let n=r.indexOf("=");if(n>0){let o=r.substring(0,n).trim(),s=r.substring(n+1).trim();o&&(e[o]=s)}}return e}a(rpc,"parseResourceAttributes");function npc(t,e){if(!t)return;let r=t.replace(/^["']|["']$/g,"");try{let n=new URL(r);return e==="grpc"?n.origin:n.href}catch{return}}a(npc,"parseOtlpEndpoint");function ipc(t){let{env:e}=t;if(t.vscodeTelemetryLevel==="off")return D4i(t);let r=t.settingDbSpanExporter??!1,n=(R4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)||r,o=(R4e(e.COPILOT_OTEL_ENABLED)??t.settingEnabled??!!e.OTEL_EXPORTER_OTLP_ENDPOINT)===!0;if(!n)return D4i(t);let s;R4e(e.COPILOT_OTEL_ENABLED)===!0?s="envVar":t.settingEnabled===!0?s="setting":e.OTEL_EXPORTER_OTLP_ENDPOINT?s="otlpEndpointEnvVar":s="dbSpanExporterOnly";let l=(e.OTEL_EXPORTER_OTLP_PROTOCOL??e.COPILOT_OTEL_PROTOCOL)==="grpc"?"grpc":"http",u=e.COPILOT_OTEL_ENDPOINT??e.OTEL_EXPORTER_OTLP_ENDPOINT??t.settingOtlpEndpoint??Ore.DEFAULT_OTLP_ENDPOINT,d=npc(u,l)??Ore.DEFAULT_OTLP_ENDPOINT,f=e.COPILOT_OTEL_FILE_EXPORTER_PATH??t.settingOutfile,h;f?h="file":t.settingExporterType?h=t.settingExporterType:h=l==="grpc"?"otlp-grpc":"otlp-http";let m=R4e(e.COPILOT_OTEL_CAPTURE_CONTENT)??t.settingCaptureContent??!1,g=opc(e.COPILOT_OTEL_MAX_ATTRIBUTE_SIZE_CHARS)??t.settingMaxAttributeSizeChars??0,A=new Set(["trace","debug","info","warn","error"]),y=e.COPILOT_OTEL_LOG_LEVEL,E=y&&A.has(y)?y:"info",_=R4e(e.COPILOT_OTEL_HTTP_INSTRUMENTATION)??!1,v=e.OTEL_SERVICE_NAME??"copilot-chat",b=rpc(e.OTEL_RESOURCE_ATTRIBUTES);return Object.freeze({enabled:!0,enabledExplicitly:o,enabledVia:s,exporterType:h,otlpEndpoint:d,otlpProtocol:l,captureContent:m,maxAttributeSizeChars:g<0?0:g,fileExporterPath:f,dbSpanExporter:r,logLevel:E,httpInstrumentation:_,serviceName:v,serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:b})}a(ipc,"resolveOTelConfig");function D4i(t){return Object.freeze({enabled:!1,enabledExplicitly:!1,enabledVia:"disabled",exporterType:"otlp-http",otlpEndpoint:"",otlpProtocol:"http",captureContent:!1,maxAttributeSizeChars:0,dbSpanExporter:!1,logLevel:"info",httpInstrumentation:!1,serviceName:"copilot-chat",serviceVersion:t.extensionVersion,sessionId:t.sessionId,resourceAttributes:{}})}a(D4i,"createDisabledConfig");function R4e(t){if(t!==void 0)return t==="true"||t==="1"}a(R4e,"envBool");function opc(t){if(t===void 0||t==="")return;let e=Number(t);if(Number.isSafeInteger(e))return e}a(opc,"parseMaxAttributeSizeChars")});var jEt=I(qEt=>{"use strict";p();Object.defineProperty(qEt,"__esModule",{value:!0});qEt.IOTelService=void 0;var spc=tn();qEt.IOTelService=(0,spc.createServiceIdentifier)("IOTelService")});var N4i=I(Nkr=>{"use strict";p();Object.defineProperty(Nkr,"__esModule",{value:!0});Nkr.normalizeResponseModel=apc;function apc(t,e){if(!e)return;if(!t)return e;let r=a(s=>s.replace(/\./g,"-").toLowerCase(),"canonical"),n=r(t),o=r(e);return n===o||n.startsWith(o+"-")?t:e}a(apc,"normalizeResponseModel")});var B4i=I(Lr=>{"use strict";p();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.workspaceMetadataToOTelAttributes=Lr.resolveWorkspaceOTelMetadata=Lr.normalizeResponseModel=Lr.IOTelService=Lr.DEFAULT_OTLP_ENDPOINT=Lr.resolveOTelConfig=Lr.NoopOTelService=Lr.truncateForOTel=Lr.toToolDefinitions=Lr.toSystemInstructions=Lr.toOutputMessages=Lr.toInputMessages=Lr.stringifyToolsRawForTelemetry=Lr.stringifyToolDefinitionsForOTel=Lr.normalizeProviderMessages=Lr.extractTextFromContent=Lr.collectSystemTextsFromRequestBody=Lr.GenAiMetrics=Lr.emitUserFeedbackEvent=Lr.emitToolCallEvent=Lr.emitSessionStartEvent=Lr.emitInlineDoneEvent=Lr.emitInferenceDetailsEvent=Lr.emitEditSurvivalEvent=Lr.emitEditHunkActionEvent=Lr.emitEditFeedbackEvent=Lr.emitCloudSessionInvokeEvent=Lr.emitAgentTurnEvent=Lr.TOOL_PARAM_COMMAND_MAX_LEN=Lr.StdAttr=Lr.SHELL_TOOL_NAMES=Lr.GitHubCopilotAttr=Lr.GenAiToolType=Lr.GenAiTokenType=Lr.GenAiProviderName=Lr.GenAiOperationName=Lr.GenAiAttr=Lr.FILE_TOOL_NAMES=Lr.CopilotCliSdkAttr=Lr.CopilotChatAttr=void 0;var vR=w4e();Object.defineProperty(Lr,"CopilotChatAttr",{enumerable:!0,get:a(function(){return vR.CopilotChatAttr},"get")});Object.defineProperty(Lr,"CopilotCliSdkAttr",{enumerable:!0,get:a(function(){return vR.CopilotCliSdkAttr},"get")});Object.defineProperty(Lr,"FILE_TOOL_NAMES",{enumerable:!0,get:a(function(){return vR.FILE_TOOL_NAMES},"get")});Object.defineProperty(Lr,"GenAiAttr",{enumerable:!0,get:a(function(){return vR.GenAiAttr},"get")});Object.defineProperty(Lr,"GenAiOperationName",{enumerable:!0,get:a(function(){return vR.GenAiOperationName},"get")});Object.defineProperty(Lr,"GenAiProviderName",{enumerable:!0,get:a(function(){return vR.GenAiProviderName},"get")});Object.defineProperty(Lr,"GenAiTokenType",{enumerable:!0,get:a(function(){return vR.GenAiTokenType},"get")});Object.defineProperty(Lr,"GenAiToolType",{enumerable:!0,get:a(function(){return vR.GenAiToolType},"get")});Object.defineProperty(Lr,"GitHubCopilotAttr",{enumerable:!0,get:a(function(){return vR.GitHubCopilotAttr},"get")});Object.defineProperty(Lr,"SHELL_TOOL_NAMES",{enumerable:!0,get:a(function(){return vR.SHELL_TOOL_NAMES},"get")});Object.defineProperty(Lr,"StdAttr",{enumerable:!0,get:a(function(){return vR.StdAttr},"get")});Object.defineProperty(Lr,"TOOL_PARAM_COMMAND_MAX_LEN",{enumerable:!0,get:a(function(){return vR.TOOL_PARAM_COMMAND_MAX_LEN},"get")});var Q4=w4i();Object.defineProperty(Lr,"emitAgentTurnEvent",{enumerable:!0,get:a(function(){return Q4.emitAgentTurnEvent},"get")});Object.defineProperty(Lr,"emitCloudSessionInvokeEvent",{enumerable:!0,get:a(function(){return Q4.emitCloudSessionInvokeEvent},"get")});Object.defineProperty(Lr,"emitEditFeedbackEvent",{enumerable:!0,get:a(function(){return Q4.emitEditFeedbackEvent},"get")});Object.defineProperty(Lr,"emitEditHunkActionEvent",{enumerable:!0,get:a(function(){return Q4.emitEditHunkActionEvent},"get")});Object.defineProperty(Lr,"emitEditSurvivalEvent",{enumerable:!0,get:a(function(){return Q4.emitEditSurvivalEvent},"get")});Object.defineProperty(Lr,"emitInferenceDetailsEvent",{enumerable:!0,get:a(function(){return Q4.emitInferenceDetailsEvent},"get")});Object.defineProperty(Lr,"emitInlineDoneEvent",{enumerable:!0,get:a(function(){return Q4.emitInlineDoneEvent},"get")});Object.defineProperty(Lr,"emitSessionStartEvent",{enumerable:!0,get:a(function(){return Q4.emitSessionStartEvent},"get")});Object.defineProperty(Lr,"emitToolCallEvent",{enumerable:!0,get:a(function(){return Q4.emitToolCallEvent},"get")});Object.defineProperty(Lr,"emitUserFeedbackEvent",{enumerable:!0,get:a(function(){return Q4.emitUserFeedbackEvent},"get")});var cpc=R4i();Object.defineProperty(Lr,"GenAiMetrics",{enumerable:!0,get:a(function(){return cpc.GenAiMetrics},"get")});var q4=xkr();Object.defineProperty(Lr,"collectSystemTextsFromRequestBody",{enumerable:!0,get:a(function(){return q4.collectSystemTextsFromRequestBody},"get")});Object.defineProperty(Lr,"extractTextFromContent",{enumerable:!0,get:a(function(){return q4.extractTextFromContent},"get")});Object.defineProperty(Lr,"normalizeProviderMessages",{enumerable:!0,get:a(function(){return q4.normalizeProviderMessages},"get")});Object.defineProperty(Lr,"stringifyToolDefinitionsForOTel",{enumerable:!0,get:a(function(){return q4.stringifyToolDefinitionsForOTel},"get")});Object.defineProperty(Lr,"stringifyToolsRawForTelemetry",{enumerable:!0,get:a(function(){return q4.stringifyToolsRawForTelemetry},"get")});Object.defineProperty(Lr,"toInputMessages",{enumerable:!0,get:a(function(){return q4.toInputMessages},"get")});Object.defineProperty(Lr,"toOutputMessages",{enumerable:!0,get:a(function(){return q4.toOutputMessages},"get")});Object.defineProperty(Lr,"toSystemInstructions",{enumerable:!0,get:a(function(){return q4.toSystemInstructions},"get")});Object.defineProperty(Lr,"toToolDefinitions",{enumerable:!0,get:a(function(){return q4.toToolDefinitions},"get")});Object.defineProperty(Lr,"truncateForOTel",{enumerable:!0,get:a(function(){return q4.truncateForOTel},"get")});var lpc=kkr();Object.defineProperty(Lr,"NoopOTelService",{enumerable:!0,get:a(function(){return lpc.NoopOTelService},"get")});var M4i=Dkr();Object.defineProperty(Lr,"resolveOTelConfig",{enumerable:!0,get:a(function(){return M4i.resolveOTelConfig},"get")});Object.defineProperty(Lr,"DEFAULT_OTLP_ENDPOINT",{enumerable:!0,get:a(function(){return M4i.DEFAULT_OTLP_ENDPOINT},"get")});var upc=jEt();Object.defineProperty(Lr,"IOTelService",{enumerable:!0,get:a(function(){return upc.IOTelService},"get")});var dpc=N4i();Object.defineProperty(Lr,"normalizeResponseModel",{enumerable:!0,get:a(function(){return dpc.normalizeResponseModel},"get")});var O4i=wkr();Object.defineProperty(Lr,"resolveWorkspaceOTelMetadata",{enumerable:!0,get:a(function(){return O4i.resolveWorkspaceOTelMetadata},"get")});Object.defineProperty(Lr,"workspaceMetadataToOTelAttributes",{enumerable:!0,get:a(function(){return O4i.workspaceMetadataToOTelAttributes},"get")})});var Bkr=I(a$=>{"use strict";p();Object.defineProperty(a$,"__esModule",{value:!0});a$.AbstractRequestLogger=void 0;a$.getCurrentCapturingToken=mpc;a$.storeCapturingTokenForCorrelation=gpc;a$.retrieveCapturingTokenByCorrelation=Apc;a$.runWithCapturingToken=ypc;var fpc=require("async_hooks"),ppc=Rge(),hpc=Io(),P4e=new fpc.AsyncLocalStorage,Mkr=new Map;function mpc(){return P4e.getStore()}a(mpc,"getCurrentCapturingToken");function gpc(t){let e=P4e.getStore();e&&Mkr.set(t,e)}a(gpc,"storeCapturingTokenForCorrelation");function Apc(t){let e=Mkr.get(t);return e&&Mkr.delete(t),e}a(Apc,"retrieveCapturingTokenByCorrelation");function ypc(t,e){return P4e.run(t,e)}a(ypc,"runWithCapturingToken");var Okr=class extends hpc.Disposable{static{a(this,"AbstractRequestLogger")}get promptRendererTracing(){return!1}captureInvocation(e,r){return P4e.run(e,()=>r())}logContentExclusionRules(e,r,n){}logChatRequest(e,r,n){return new ppc.PendingLoggedChatRequest(this,e,r,n)}enableWorkspaceEditTracing(){}disableWorkspaceEditTracing(){}get currentRequest(){return P4e.getStore()}};a$.AbstractRequestLogger=Okr});var L4i=I(Lkr=>{"use strict";p();Object.defineProperty(Lkr,"__esModule",{value:!0});Lkr.isEncryptedThinkingDelta=Epc;function Epc(t){return t.encrypted!==void 0}a(Epc,"isEncryptedThinkingDelta")});var U4i=I(HEt=>{"use strict";p();Object.defineProperty(HEt,"__esModule",{value:!0});HEt.calculateLineRepetitionStats=vpc;HEt.isRepetitive=Cpc;var _pc=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60},{max_token_sequence_length:60,last_tokens_to_consider:120}];function vpc(t){if(t.length===0)return{numberOfRepetitions:0,mostRepeatedLine:"",totalLines:0};let e=new Map,r=t.split(` +`);for(let s of r){if(s=s.trim(),s.length===0)continue;let c=e.get(s)||0;e.set(s,c+1)}let n="",o=0;for(let[s,c]of e.entries())c>o&&(o=c,n=s);return{numberOfRepetitions:o,mostRepeatedLine:n,totalLines:r.length}}a(vpc,"calculateLineRepetitionStats");function Cpc(t){let e=t.slice();return e.reverse(),F4i(e)||F4i(e.filter(r=>r.trim().length>0))}a(Cpc,"isRepetitive");function F4i(t){let e=bpc(t);for(let r of _pc){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(bpc,"kmp_prefix_function")});var Fkr=I(j4=>{"use strict";p();var Spc=j4&&j4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},c$=j4&&j4.__param||function(t,e){return function(r,n){e(r,n,t)}},CR;Object.defineProperty(j4,"__esModule",{value:!0});j4.OpenAIEndpoint=void 0;j4.isBYOKModel=Bpc;var Tpc=l6(),Q4i=gR(),q4i=Sl(),Ipc=o$(),xpc=Mre(),wpc=Ap(),Rpc=i6(),Ppc=kEt(),kpc=f6(),Dpc=_p(),Npc=J7(),Mpc=Ms();function Opc(t){return t.type===Q4i.ChatFetchResponseType.Failed&&t.streamError?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:JSON.stringify(t.streamError)}:t.type===Q4i.ChatFetchResponseType.RateLimited?{type:t.type,requestId:t.requestId,serverRequestId:t.serverRequestId,reason:t.capiError?`Rate limit exceeded -`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(w0c,"hydrateBYOKErrorMessages");function R0c(t){return t?t instanceof i_t||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(R0c,"isBYOKModel");var i_t=class extends _0c.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{TR=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return TR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>TR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${TR._maxCustomHeaderCount}. Only first ${TR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=TR._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>TR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${TR._maxHeaderNameLength} characters, skipping.`);continue}if(!TR._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>TR._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,b0c.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(W4i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,v0c.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(TR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return w0c(o)}};Y4.OpenAIEndpoint=i_t;Y4.OpenAIEndpoint=i_t=TR=A0c([E$(3,E0c.IDomainService),E$(4,y0c.IChatMLFetcher),E$(5,I0c.ITokenizerProvider),E$(6,x0c.IInstantiationService),E$(7,W4i.IConfigurationService),E$(8,T0c.IExperimentationService),E$(9,S0c.IChatWebSocketManager),E$(10,C0c.ILogService)],i_t)});var z4i=I(OD=>{"use strict";p();Object.defineProperty(OD,"__esModule",{value:!0});OD.EXTENSION_ID=OD.agentsToCommands=OD.GITHUB_PLATFORM_AGENT=void 0;OD.getAgentForIntent=P0c;var k0c=yR();OD.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";OD.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function P0c(t,e){if(Object.keys(OD.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(OD.agentsToCommands))if(!(e===k0c.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(P0c,"getAgentForIntent");OD.EXTENSION_ID="GitHub.copilot-chat"});var J4i=I(o_t=>{"use strict";p();Object.defineProperty(o_t,"__esModule",{value:!0});o_t.ChatMLFetcherTelemetrySender=void 0;var Y4i=qPr(),n2r=HPr(),K4i=r2r();function D0c(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(D0c,"getTurnFromBaseTelemetry");var i2r=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){e.sendTelemetryEvent("response.success",{github:!0,microsoft:!0},{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:b,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:D0c(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,n2r.getImageTelemetryEventMeasurements)(g),isBYOK:(0,K4i.isBYOKModel)(c),isAuto:(0,Y4i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,isVisionRequest:D,isBYOK:N,isAuto:L,bytesReceived:B,issuedTime:Q,imageTelemetryMeasurements:M}){e.sendTelemetryEvent("response.cancelled",{github:!0,microsoft:!0},{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:k,timeToComplete:k,issuedTime:Q,isVisionRequest:D,...(0,n2r.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:L,bytesReceived:B,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:E,suspendEventSeen:_,resumeEventSeen:v}){e.sendTelemetryEvent("response.error",{github:!0,microsoft:!0},{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,n2r.getImageTelemetryEventMeasurements)(f),isBYOK:(0,K4i.isBYOKModel)(o),isAuto:(0,Y4i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}};o_t.ChatMLFetcherTelemetrySender=i2r});var oBi=I(YT=>{"use strict";p();var N0c=YT&&YT.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},IC=YT&&YT.__param||function(t,e){return function(r,n){e(r,n,t)}},l2r;Object.defineProperty(YT,"__esModule",{value:!0});YT.ChatMLFetcherImpl=YT.AbstractChatMLFetcher=void 0;YT.createTelemetryData=iBi;YT.locationToIntent=l_t;var M0c=wo(),O0c=SE(),B0c=A6(),L0c=xkr(),Vn=yR(),F0c=wkr(),G4e=C4e(),U0c=kkr(),_$=Il(),Q0c=PE(),s_t=qPr(),$4e=NEt(),q0c=HPr(),u2r=pp(),o2r=f6(),j0c=ey(),a_t=$Et(),zT=u6(),Z4i=P4e(),nBi=_6(),X4i=wEt(),pn=w4i(),wn=j4i(),H0c=r_t(),G0c=Lge(),s2r=e2r(),$0c=gp(),d2r=o0(),fAe=Xge(),V0c=H4i(),c_t=$4i(),W0c=L_(),eBi=Xc(),tBi=Ts(),z0c=Sc(),Y0c=ko(),K0c=Gh(),a2r=um(),J0c=Qs(),rBi=r2r(),Z0c=z4i(),X0c=Skr(),dAe=J4i(),u_t=class extends Y0c.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new z0c.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===Vn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};YT.AbstractChatMLFetcher=u_t;var f2r=class extends u_t{static{a(this,"ChatMLFetcherImpl")}static{l2r=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:E,ignoreStatefulMarker:_}=e,v=m??l_t(c);E&&this._consecutiveWebSocketRetryFallbacks>=l2r._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,a2r.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:_,requestId:T,postOptions:R}),k=(0,q0c.getImageTelemetryMeasurementsFromMessages)(l),D=fAe.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Vn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),L=-1,B=new B0c.FetchStreamRecorder(s),Q=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,q,F,U,W,V,G,Y;try{let re,j=emc(e.messages,R,o,this._configurationService,this._experimentationService);if(!j.isValid)re={type:pn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:pn.ChatFailKind.ValidationFailed,reason:j.reason};else{let ie,we=a(()=>ie??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),Ae;try{Ae=await this._authenticationService.getCopilotToken()}catch{}O=Ae?.username??this._authenticationService.copilotToken?.username;let De=await this._fetchAndStreamChat(o,x,D,B.callback,u.secretKey,Ae,e.location,T,R.n,r,we,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(re=De.result,q=De.fetcher,F=De.bytesReceived,U=De.statusCode,W=De.suspendEventSeen,V=De.resumeEventSeen,G=De.modelCallId,Y=De.otelSpan,Y?.setAttribute(wn.GenAiAttr.AGENT_NAME,n),Y){let J=(x.messages??x.input)?.filter(ae=>ae.role==="user"),z=J?.[J.length-1];if(z?.content){let ae=typeof z.content=="string"?z.content:JSON.stringify(z.content);Y.setAttribute(wn.CopilotChatAttr.USER_REQUEST,(0,wn.truncateForOTel)(ae,this._otelService.config.maxAttributeSizeChars))}let le=(0,wn.collectSystemTextsFromRequestBody)(x),K=(0,wn.toSystemInstructions)(le);K&&Y.setAttribute(wn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,wn.truncateForOTel)(JSON.stringify(K),this._otelService.config.maxAttributeSizeChars))}if(Y){let Z=x.messages??x.input;if(Z){let K=Z.filter(ae=>ae.role!=="system");Y.setAttribute(wn.GenAiAttr.INPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify((0,wn.normalizeProviderMessages)(K)),this._otelService.config.maxAttributeSizeChars))}let J=(0,wn.stringifyToolDefinitionsForOTel)(x.tools);J&&Y.setAttribute(wn.GenAiAttr.TOOL_DEFINITIONS,(0,wn.truncateForOTel)(J,this._otelService.config.maxAttributeSizeChars));let z=tmc(x);z&&Y.setAttribute(wn.CopilotChatAttr.REQUEST_OPTIONS,(0,wn.truncateForOTel)(JSON.stringify(z),this._otelService.config.maxAttributeSizeChars));let le=rmc(x);le&&Y.setAttribute(wn.CopilotChatAttr.REQUEST_SHAPE,(0,wn.truncateForOTel)(JSON.stringify(le),this._otelService.config.maxAttributeSizeChars))}L=await we();let Te=d?.extensionId??Z0c.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:Te},tokenCount:L})}let X=Date.now()-D.issuedTime;switch(N?.markTimeToFirstToken(X),re.type){case pn.FetchResponseKind.Success:{let ie=await this.processSuccessfulResponse(re,l,k,x,T,w,L,X,B,D,o,h,v,b,q,F,W,V,G);if(ie.type===Vn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){B.callback("",0,{text:"",retryReason:ie.category});let we=ie.value[0];if(we){let Ae=ie.category===zT.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${we} +`+JSON.stringify(t.capiError):"Rate limit exceeded",rateLimitKey:"",retryAfter:void 0,isAuto:!1,capiError:t.capiError}:t}a(Opc,"hydrateBYOKErrorMessages");function Bpc(t){return t?t instanceof GEt||t.isExtensionContributed?1:t.customModel?2:-1:-1}a(Bpc,"isBYOKModel");var GEt=class extends xpc.ChatEndpoint{static{a(this,"OpenAIEndpoint")}static{CR=this}static{this._reservedHeaders=new Set(["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","date","dnt","expect","host","keep-alive","origin","permissions-policy","referer","te","trailer","transfer-encoding","upgrade","user-agent","via","forwarded","x-forwarded-for","x-forwarded-host","x-forwarded-proto","api-key","authorization","content-type","openai-intent","x-github-api-version","x-initiator","x-interaction-id","x-interaction-type","x-onbehalf-extension-id","x-request-id","x-vscode-user-agent-library-version"])}static{this._validHeaderNamePattern=/^[!#$%&'*+\-.0-9A-Z^_`a-z|~]+$/}static{this._maxHeaderNameLength=256}static{this._maxHeaderValueLength=8192}static{this._maxCustomHeaderCount=20}constructor(e,r,n,o,s,c,l,u,d,f,h){super(e,o,s,c,l,u,d,f,h),this._apiKey=r,this._modelUrl=n,this.instantiationService=l,this.logService=h,this.ownsAuthorization=!0,this._customHeaders=this._sanitizeCustomHeaders(e.requestHeaders)}_isReservedHeader(e){return CR._reservedHeaders.has(e)}_sanitizeCustomHeaders(e){if(!e)return{};let r=Object.entries(e);r.length>CR._maxCustomHeaderCount&&this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has ${r.length} custom headers, exceeding limit of ${CR._maxCustomHeaderCount}. Only first ${CR._maxCustomHeaderCount} will be processed.`);let n={},o=0;for(let[s,c]of r){if(o>=CR._maxCustomHeaderCount)break;let l=s.trim();if(!l){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has empty header name, skipping.`);continue}if(l.length>CR._maxHeaderNameLength){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has header name exceeding ${CR._maxHeaderNameLength} characters, skipping.`);continue}if(!CR._validHeaderNamePattern.test(l)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid header name format: '${l}', Skipping.`);continue}let u=l.toLowerCase();if(this._isReservedHeader(u)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to override reserved header '${l}', skipping.`);continue}if(u.startsWith("proxy-")||u.startsWith("sec-")){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden header pattern '${l}', skipping.`);continue}if(u==="x-http-method"||u==="x-http-method-override"||u==="x-method-override"){let f=["connect","trace","track"],h=String(c).toLowerCase().trim();if(f.includes(h)){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' attempted to set forbidden method '${h}' in header '${l}', skipping.`);continue}}let d=this._sanitizeHeaderValue(c);if(d===void 0){this.logService.warn(`[OpenAIEndpoint] Model '${this.modelMetadata.id}' has invalid value for header '${l}': '${c}', skipping.`);continue}n[l]=d,o++}return n}_sanitizeHeaderValue(e){if(typeof e!="string")return;let r=e.trim();if(!(r.length>CR._maxHeaderValueLength)&&!/[\x00-\x1F\x7F]/.test(r)&&!/[\u200B-\u200D\u202A-\u202E\uFEFF]/.test(r))return r}createRequestBody(e){if(this.useResponsesApi){let r=!!this.modelMetadata.zeroDataRetentionEnabled;e.ignoreStatefulMarker=e.ignoreStatefulMarker||r;let n=super.createRequestBody(e);return n.store=!r,n.n=void 0,n.stream_options=void 0,this.modelMetadata.capabilities.supports.thinking||(n.reasoning=void 0,n.include=void 0),n.previous_response_id&&(!n.previous_response_id.startsWith("resp_")||r)&&(n.previous_response_id=void 0),this._applyReasoningEffort(n,e),n}else{if(this.useMessagesApi)return super.createRequestBody(e);{let r=!!this.modelMetadata.capabilities.supports.thinking,n=a((s,c)=>{if(c&&c.id){s.cot_id=c.id;let l=Array.isArray(c.text)?c.text.join(""):c.text;s.cot_summary=l,r&&(s.reasoning_content=l,s.reasoning=l)}},"callback"),o=(0,Ppc.createCapiRequestBody)(e,this.model,n);return this._applyReasoningEffort(o,e),o}}}_applyReasoningEffort(e,r){let n=this.supportsReasoningEffort;if(!n?.length)return;let o=this.modelMetadata.reasoningEffortFormat??(this.useResponsesApi?"responses":"chat-completions"),c=this._configurationService.getConfig(q4i.ConfigKey.Advanced.ReasoningEffortOverride)||r.modelCapabilities?.reasoningEffort||e.reasoning?.effort||e.reasoning_effort,l=c&&n.includes(c)?c:void 0;if(e.reasoning){let{effort:u,...d}=e.reasoning;e.reasoning=Object.keys(d).length>0?d:void 0}e.reasoning_effort=void 0,l&&(o==="responses"?e.reasoning={...e.reasoning,effort:l}:e.reasoning_effort=l)}interceptBody(e){super.interceptBody(e),e?.tools?.length===0&&delete e.tools,e?.tools&&(e.tools=e.tools.map(r=>((0,Rpc.isOpenAiFunctionTool)(r)&&r.function.parameters===void 0&&(r.function.parameters={type:"object",properties:{}}),r))),e&&(this.modelMetadata.capabilities.supports.thinking&&(delete e.temperature,!this.useMessagesApi&&!this.useResponsesApi&&(e.max_completion_tokens=e.max_tokens,delete e.max_tokens)),this.useMessagesApi||delete e.max_tokens,!this.useResponsesApi&&!this.useMessagesApi&&e.stream&&(e.stream_options={include_usage:!0}))}get urlOrRequestMetadata(){return this._modelUrl}getExtraHeaders(){let e={"Content-Type":"application/json"};this._modelUrl.includes("openai.azure")?e["api-key"]=this._apiKey:e.Authorization=`Bearer ${this._apiKey}`;for(let[r,n]of Object.entries(this._customHeaders))e[r]=n;return e}cloneWithTokenOverride(e){let r={...this.modelMetadata,maxInputTokens:e};return this.instantiationService.createInstance(CR,r,this._apiKey,this._modelUrl)}async makeChatRequest2(e,r){let n={...e,ignoreStatefulMarker:e.ignoreStatefulMarker??!1},o=await super.makeChatRequest2(n,r);return Opc(o)}};j4.OpenAIEndpoint=GEt;j4.OpenAIEndpoint=GEt=CR=Spc([c$(3,Ipc.IDomainService),c$(4,Tpc.IChatMLFetcher),c$(5,Npc.ITokenizerProvider),c$(6,Mpc.IInstantiationService),c$(7,q4i.IConfigurationService),c$(8,Dpc.IExperimentationService),c$(9,kpc.IChatWebSocketManager),c$(10,wpc.ILogService)],GEt)});var j4i=I(DD=>{"use strict";p();Object.defineProperty(DD,"__esModule",{value:!0});DD.EXTENSION_ID=DD.agentsToCommands=DD.GITHUB_PLATFORM_AGENT=void 0;DD.getAgentForIntent=Fpc;var Lpc=gR();DD.GITHUB_PLATFORM_AGENT="github.copilot-dynamic.platform";DD.agentsToCommands={editAgent:{explain:"explain",edit:"edit",review:"review",tests:"tests",fix:"fix",new:"new",newNotebook:"newNotebook",semanticSearch:"semanticSearch",setupTests:"setupTests",compact:"editAgent"},vscode:{search:"search"},terminal:{explain:"terminalExplain"},editor:{doc:"doc",fix:"fix",explain:"explain",review:"review",tests:"tests",edit:"edit",generate:"generate"}};function Fpc(t,e){if(Object.keys(DD.agentsToCommands).includes(t))return{agent:t};for(let[r,n]of Object.entries(DD.agentsToCommands))if(!(e===Lpc.ChatLocation.Editor&&r!=="editor")&&Object.values(n).includes(t))return{agent:r,command:t}}a(Fpc,"getAgentForIntent");DD.EXTENSION_ID="GitHub.copilot-chat"});var $4i=I($Et=>{"use strict";p();Object.defineProperty($Et,"__esModule",{value:!0});$Et.ChatMLFetcherTelemetrySender=void 0;var H4i=bkr(),Ukr=Tkr(),G4i=Fkr();function Upc(t){let e=t.properties.turnIndex;if(typeof e!="string")return;let r=Number(e);return Number.isFinite(r)?r:void 0}a(Upc,"getTurnFromBaseTelemetry");var Qkr=class{static{a(this,"ChatMLFetcherTelemetrySender")}static sendSuccessTelemetry(e,{chatCompletion:r,baseTelemetry:n,userInitiatedRequest:o,interactionType:s,chatEndpointInfo:c,requestBody:l,maxResponseTokens:u,promptTokenCount:d,timeToFirstToken:f,timeToFirstTokenEmitted:h,hasImageMessages:m,imageTelemetryMeasurements:g,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}){e.sendTelemetryEvent("response.success",{github:!0,microsoft:!0},{reason:r.finishReason,filterReason:r.filterReason,source:n?.properties.messageSource??"unknown",initiatorType:o?"user":"agent",requestKind:s,conversationId:n?.properties.conversationId,model:c?.model,modelInvoked:r.model,apiType:c?.apiType,requestId:r.requestId.headerRequestId,gitHubRequestId:r.requestId.gitHubRequestId,associatedRequestId:n?.properties.associatedRequestId,parentRequestId:n?.properties.parentRequestId,reasoningEffort:l.reasoning?.effort??l.output_config?.effort,reasoningSummary:l.reasoning?.summary,modelCallId:b,...n?.properties.subType?{subType:n.properties.subType}:{},...n?.properties.parentModelCallId?{parentModelCallId:n.properties.parentModelCallId}:{},...n?.properties.iterationNumber?{iterationNumber:n.properties.iterationNumber}:{},...y?{fetcher:y}:{},transport:A,...n?.properties.retryAfterError?{retryAfterError:n.properties.retryAfterError}:{},...n?.properties.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.properties.retryAfterErrorGitHubRequestId}:{},...n?.properties.connectivityTestError?{connectivityTestError:n.properties.connectivityTestError}:{},...n?.properties.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.properties.connectivityTestErrorGitHubRequestId}:{},...n?.properties.retryAfterFilterCategory?{retryAfterFilterCategory:n.properties.retryAfterFilterCategory}:{}},{turn:Upc(n),totalTokenMax:c?.modelMaxPromptTokens??-1,tokenCountMax:u,promptTokenCount:r.usage?.prompt_tokens,promptCacheTokenCount:r.usage?.prompt_tokens_details?.cached_tokens,promptCacheCreation1hTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_1h_input_tokens,promptCacheCreation5mTokenCount:r.usage?.prompt_tokens_details?.anthropic_cache_creation?.ephemeral_5m_input_tokens,clientPromptTokenCount:d,tokenCount:r.usage?.total_tokens,reasoningTokens:r.usage?.completion_tokens_details?.reasoning_tokens,acceptedPredictionTokens:r.usage?.completion_tokens_details?.accepted_prediction_tokens,rejectedPredictionTokens:r.usage?.completion_tokens_details?.rejected_prediction_tokens,completionTokens:r.usage?.completion_tokens,timeToFirstToken:f,timeToFirstTokenEmitted:h,timeToComplete:Date.now()-n.issuedTime,issuedTime:n.issuedTime,isVisionRequest:m?1:-1,...(0,Ukr.getImageTelemetryEventMeasurements)(g),isBYOK:(0,G4i.isBYOKModel)(c),isAuto:(0,H4i.isAutoModel)(c),bytesReceived:E,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendCancellationTelemetry(e,{source:r,requestId:n,model:o,apiType:s,transport:c,interactionType:l,conversationId:u,associatedRequestId:d,parentRequestId:f,retryAfterError:h,retryAfterErrorGitHubRequestId:m,connectivityTestError:g,connectivityTestErrorGitHubRequestId:A,retryAfterFilterCategory:y,fetcher:E,suspendEventSeen:_,resumeEventSeen:v},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,isVisionRequest:D,isBYOK:N,isAuto:B,bytesReceived:L,issuedTime:j,imageTelemetryMeasurements:M}){e.sendTelemetryEvent("response.cancelled",{github:!0,microsoft:!0},{apiType:s,source:r,requestId:n,model:o,requestKind:l,conversationId:u,associatedRequestId:d,parentRequestId:f,...E?{fetcher:E}:{},transport:c,...h?{retryAfterError:h}:{},...m?{retryAfterErrorGitHubRequestId:m}:{},...g?{connectivityTestError:g}:{},...A?{connectivityTestErrorGitHubRequestId:A}:{},...y?{retryAfterFilterCategory:y}:{}},{totalTokenMax:b,promptTokenCount:T,tokenCountMax:w,timeToFirstToken:R,timeToFirstTokenEmitted:x,timeToCancelled:P,timeToComplete:P,issuedTime:j,isVisionRequest:D,...(0,Ukr.getImageTelemetryEventMeasurements)(M),isBYOK:N,isAuto:B,bytesReceived:L,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}static sendResponseErrorTelemetry(e,{processed:r,telemetryProperties:n,chatEndpointInfo:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:d,imageTelemetryMeasurements:f,transport:h,interactionType:m,fetcher:g,bytesReceived:A,issuedTime:y,wasRetried:E,suspendEventSeen:_,resumeEventSeen:v}){e.sendTelemetryEvent("response.error",{github:!0,microsoft:!0},{type:r.type,reason:r.reasonDetail||r.reason,source:n?.messageSource??"unknown",requestKind:m,requestId:r.requestId,gitHubRequestId:r.serverRequestId,model:o.model,apiType:o.apiType,conversationId:n?.conversationId,reasoningEffort:s.reasoning?.effort??s.output_config?.effort,reasoningSummary:s.reasoning?.summary,...g?{fetcher:g}:{},transport:h,associatedRequestId:n?.associatedRequestId,parentRequestId:n?.parentRequestId,...n?.retryAfterError?{retryAfterError:n.retryAfterError}:{},...n?.retryAfterErrorGitHubRequestId?{retryAfterErrorGitHubRequestId:n.retryAfterErrorGitHubRequestId}:{},...n?.connectivityTestError?{connectivityTestError:n.connectivityTestError}:{},...n?.connectivityTestErrorGitHubRequestId?{connectivityTestErrorGitHubRequestId:n.connectivityTestErrorGitHubRequestId}:{},...n?.retryAfterFilterCategory?{retryAfterFilterCategory:n.retryAfterFilterCategory}:{}},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:c,tokenCountMax:l,timeToFirstToken:u,timeToComplete:Date.now()-y,issuedTime:y,isVisionRequest:d?1:-1,...(0,Ukr.getImageTelemetryEventMeasurements)(f),isBYOK:(0,G4i.isBYOKModel)(o),isAuto:(0,H4i.isAutoModel)(o),wasRetried:E?1:0,bytesReceived:A,suspendEventSeen:_?1:0,resumeEventSeen:v?1:0})}};$Et.ChatMLFetcherTelemetrySender=Qkr});var X4i=I($T=>{"use strict";p();var Qpc=$T&&$T.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},bv=$T&&$T.__param||function(t,e){return function(r,n){e(r,n,t)}},$kr;Object.defineProperty($T,"__esModule",{value:!0});$T.ChatMLFetcherImpl=$T.AbstractChatMLFetcher=void 0;$T.createTelemetryData=Z4i;$T.locationToIntent=YEt;var qpc=xo(),jpc=CE(),Hpc=l6(),Gpc=CPr(),Wn=gR(),$pc=bPr(),k4e=c4e(),Vpc=TPr(),l$=Sl(),Wpc=wE(),VEt=bkr(),D4e=IEt(),zpc=Tkr(),Vkr=Ap(),qkr=i6(),Ypc=iy(),WEt=kEt(),GT=r6(),V4i=y4e(),J4i=f6(),W4i=vEt(),fn=C4i(),xn=B4i(),Kpc=jEt(),Jpc=Rge(),jkr=Bkr(),Zpc=_p(),Wkr=Bh(),rAe=Gge(),Xpc=L4i(),zEt=U4i(),ehc=O_(),z4i=zc(),Y4i=bs(),thc=_c(),rhc=Io(),nhc=Oh(),Hkr=fm(),ihc=Ms(),K4i=Fkr(),ohc=j4i(),shc=EPr(),tAe=$4i(),KEt=class extends rhc.Disposable{static{a(this,"AbstractChatMLFetcher")}constructor(e){super(),this.options=e,this._onDidMakeChatMLRequest=this._register(new thc.Emitter),this.onDidMakeChatMLRequest=this._onDidMakeChatMLRequest.event}preparePostOptions(e){return{temperature:this.options.temperature,top_p:this.options.topP,stream:!0,...e}}async fetchOne(e,r){let n=await this.fetchMany({...e,requestOptions:{...e.requestOptions,n:1}},r);return n.type===Wn.ChatFetchResponseType.Success?{...n,value:n.value[0]}:n}};$T.AbstractChatMLFetcher=KEt;var zkr=class extends KEt{static{a(this,"ChatMLFetcherImpl")}static{$kr=this}static{this._maxConsecutiveWebSocketFallbacks=3}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){super(d),this._fetcherService=e,this._telemetryService=r,this._requestLogger=n,this._logService=o,this._authenticationService=s,this._interactionService=c,this._chatQuotaService=l,this._capiClientService=u,this._configurationService=f,this._experimentationService=h,this._powerService=m,this._instantiationService=g,this._webSocketManager=A,this._otelService=y,this.connectivityCheckDelays=[1e3,1e4,1e4],this._consecutiveWebSocketRetryFallbacks=0}async fetchMany(e,r){let{debugName:n,endpoint:o,finishedCb:s,location:c,messages:l,requestOptions:u,source:d,telemetryProperties:f,userInitiatedRequest:h,interactionTypeOverride:m,conversationId:g,turnId:A,topLevelTurnId:y,useWebSocket:E,ignoreStatefulMarker:_}=e,v=m??YEt(c);E&&this._consecutiveWebSocketRetryFallbacks>=$kr._maxConsecutiveWebSocketFallbacks&&(this._logService.debug(`[ChatWebSocketManager] Disabling WebSocket for request due to ${this._consecutiveWebSocketRetryFallbacks} consecutive WebSocket failures with successful HTTP fallback.`),E=!1,_=!0),f||(f={}),f.messageSource||(f.messageSource=n);let b=E?"websocket":"http",T=f.requestId??f.messageId??(0,Hkr.generateUuid)(),w=o.maxOutputTokens;u?.prediction||(u={max_tokens:w,...u}),u.prediction?.content||delete u.prediction;let R=this.preparePostOptions(u),x=o.createRequestBody({...e,ignoreStatefulMarker:_,requestId:T,postOptions:R}),P=(0,zpc.getImageTelemetryMeasurementsFromMessages)(l),D=rAe.TelemetryData.createAndMarkAsIssued({...f,...g?{conversationId:g}:{},headerRequestId:T,baseModel:o.model,uiKind:Wn.ChatLocation.toString(c)}),N=this._requestLogger.logChatRequest(n,o,{messages:e.messages,model:o.model,ourRequestId:T,location:e.location,body:x,ignoreStatefulMarker:_,isConversationRequest:e.isConversationRequest,customMetadata:e.customMetadata}),B=-1,L=new Hpc.FetchStreamRecorder(s),j=e.enableRetryOnError??e.enableRetryOnFilter,M=e.canRetryOnceWithoutRollback??!(e.enableRetryOnFilter||e.enableRetryOnError),O,q,Q,U,z,W,$,J;try{let ne,H=ahc(e.messages,R,o,this._configurationService,this._experimentationService);if(!H.isValid)ne={type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.ChatFailKind.ValidationFailed,reason:H.reason};else{let ae,Oe=a(()=>ae??=o.acquireTokenizer().countMessagesTokens(l),"countTokens"),ve;try{ve=await this._authenticationService.getCopilotToken()}catch{}O=ve?.username??this._authenticationService.copilotToken?.username;let Fe=await this._fetchAndStreamChat(o,x,D,L.callback,u.secretKey,ve,e.location,T,R.n,r,Oe,h,E,A,g,f,e.useFetcher,M,m,e.summarizedAtRoundId,e.modeChanged);if(ne=Fe.result,q=Fe.fetcher,Q=Fe.bytesReceived,U=Fe.statusCode,z=Fe.suspendEventSeen,W=Fe.resumeEventSeen,$=Fe.modelCallId,J=Fe.otelSpan,J?.setAttribute(xn.GenAiAttr.AGENT_NAME,n),J){let ee=(x.messages??x.input)?.filter(ue=>ue.role==="user"),K=ee?.[ee.length-1];if(K?.content){let ue=typeof K.content=="string"?K.content:JSON.stringify(K.content);J.setAttribute(xn.CopilotChatAttr.USER_REQUEST,(0,xn.truncateForOTel)(ue,this._otelService.config.maxAttributeSizeChars))}let pe=(0,xn.collectSystemTextsFromRequestBody)(x),X=(0,xn.toSystemInstructions)(pe);X&&J.setAttribute(xn.GenAiAttr.SYSTEM_INSTRUCTIONS,(0,xn.truncateForOTel)(JSON.stringify(X),this._otelService.config.maxAttributeSizeChars))}if(J){let Z=x.messages??x.input;if(Z){let X=Z.filter(ue=>ue.role!=="system");J.setAttribute(xn.GenAiAttr.INPUT_MESSAGES,(0,xn.truncateForOTel)(JSON.stringify((0,xn.normalizeProviderMessages)(X)),this._otelService.config.maxAttributeSizeChars))}let ee=(0,xn.stringifyToolDefinitionsForOTel)(x.tools);ee&&J.setAttribute(xn.GenAiAttr.TOOL_DEFINITIONS,(0,xn.truncateForOTel)(ee,this._otelService.config.maxAttributeSizeChars));let K=chc(x);K&&J.setAttribute(xn.CopilotChatAttr.REQUEST_OPTIONS,(0,xn.truncateForOTel)(JSON.stringify(K),this._otelService.config.maxAttributeSizeChars));let pe=lhc(x);pe&&J.setAttribute(xn.CopilotChatAttr.REQUEST_SHAPE,(0,xn.truncateForOTel)(JSON.stringify(pe),this._otelService.config.maxAttributeSizeChars))}B=await Oe();let Pe=d?.extensionId??ohc.EXTENSION_ID;this._onDidMakeChatMLRequest.fire({messages:l,model:o.model,source:{extensionId:Pe},tokenCount:B})}let re=Date.now()-D.issuedTime;switch(N?.markTimeToFirstToken(re),ne.type){case fn.FetchResponseKind.Success:{let ae=await this.processSuccessfulResponse(ne,l,P,x,T,w,B,re,L,D,o,h,v,b,q,Q,z,W,$);if(ae.type===Wn.ChatFetchResponseType.FilteredRetry){if(e.enableRetryOnFilter){L.callback("",0,{text:"",retryReason:ae.category});let Oe=ae.value[0];if(Oe){let ve=ae.category===GT.FilterReason.Copyright?`The previous response (copied below) was filtered due to being too similar to existing public code. Please suggest something similar in function that does not match public code. Here's the previous response: ${Oe} -`:`The previous response (copied below) was filtered due to triggering our content safety filters, which looks for hateful, self-harm, sexual, or violent content. Please suggest something similar in content that does not trigger these filters. Here's the previous response: ${we} +`:`The previous response (copied below) was filtered due to triggering our content safety filters, which looks for hateful, self-harm, sexual, or violent content. Please suggest something similar in content that does not trigger these filters. Here's the previous response: ${Oe} -`,De=[...l,{role:M0c.Raw.ChatRole.User,content:(0,G4e.toTextParts)(Ae)}],Te=await this.fetchMany({...e,debugName:"retry-"+n,messages:De,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ie.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:Q},r);if(N?.resolve(Te,B.deltas),Te.type===Vn.ChatFetchResponseType.Success)return Te}}return{type:Vn.ChatFetchResponseType.Filtered,category:ie.category,reason:"Response got filtered.",requestId:ie.requestId,serverRequestId:ie.serverRequestId}}if(N?.resolve(ie,B.deltas),ie.type===Vn.ChatFetchResponseType.Success&&ie.usage){typeof ie.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ie.usage.copilot_usage.total_nano_aiu,y??A);let we=(0,wn.normalizeResponseModel)(o.model,ie.resolvedModel),Ae={operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:we};ie.usage.prompt_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ie.usage.prompt_tokens,"input",Ae),ie.usage.completion_tokens&&wn.GenAiMetrics.recordTokenUsage(this._otelService,ie.usage.completion_tokens,"output",Ae),Y?.setAttributes({[wn.GenAiAttr.USAGE_INPUT_TOKENS]:ie.usage.prompt_tokens??0,[wn.GenAiAttr.USAGE_OUTPUT_TOKENS]:ie.usage.completion_tokens??0,[wn.GenAiAttr.RESPONSE_MODEL]:we??o.model,[wn.GenAiAttr.RESPONSE_ID]:ie.requestId,[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ie.usage.prompt_tokens_details?.cached_tokens?{[wn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ie.usage.prompt_tokens_details.cached_tokens}:{},...ie.usage.prompt_tokens_details?.cache_creation_input_tokens?{[wn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ie.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[wn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:X,...ie.serverRequestId?{[wn.CopilotChatAttr.SERVER_REQUEST_ID]:ie.serverRequestId}:{},...ie.usage.completion_tokens_details?.reasoning_tokens?{[wn.GenAiAttr.USAGE_REASONING_TOKENS]:ie.usage.completion_tokens_details.reasoning_tokens,[wn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ie.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ie.usage.copilot_usage?.total_nano_aiu=="number"?{[wn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ie.usage.copilot_usage.total_nano_aiu}:{}})}if(Y&&ie.type===Vn.ChatFetchResponseType.Success){let we=B.deltas.map(Z=>Z.text).join(""),Ae=B.deltas.filter(Z=>Z.copilotToolCalls?.length).flatMap(Z=>Z.copilotToolCalls.map(J=>({type:"tool_call",id:J.id,name:J.name,arguments:J.arguments}))),De=[];if(we&&De.push({type:"text",content:we}),De.push(...Ae),De.length>0&&Y.setAttribute(wn.GenAiAttr.OUTPUT_MESSAGES,(0,wn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:De}]),this._otelService.config.maxAttributeSizeChars)),B.deltas.some(Z=>Z.thinking)){let J=B.deltas.filter(z=>z.thinking&&!(0,V0c.isEncryptedThinkingDelta)(z.thinking)&&z.thinking.text).map(z=>{let le=z.thinking;return"encrypted"in le?"":Array.isArray(le.text)?le.text.join(""):le.text??""}).join("");Y.setAttribute(wn.CopilotChatAttr.REASONING_CONTENT,(0,wn.truncateForOTel)(J||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}return(0,wn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ie.type===Vn.ChatFetchResponseType.Success?{id:ie.requestId,model:(0,wn.normalizeResponseModel)(o.model,ie.resolvedModel),finishReasons:["stop"],inputTokens:ie.usage?.prompt_tokens,outputTokens:ie.usage?.completion_tokens}:void 0),Y?.end(),Y=void 0,X>0&&wn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,X/1e3),E&&ie.type===Vn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ie}case pn.FetchResponseKind.Canceled:return dAe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:W,resumeEventSeen:V},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:X,timeToFirstTokenEmitted:D&&B.firstTokenEmittedTime?B.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,rBi.isBYOKModel)(o),isAuto:(0,s_t.isAutoModel)(o),bytesReceived:F,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}),N?.resolveWithCancelation(),Y?.setAttributes({[wn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[wn.CopilotChatAttr.CANCELED]:!0}),Y?.end(),Y=void 0,this.processCanceledResponse(re,T,B,f);case pn.FetchResponseKind.Failed:{let ie=this.processFailedResponse(re,T,(0,s_t.isAutoModel)(o)===1),Ae=this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(Z=>parseInt(Z.trim(),10)),De=Q&&U!==void 0&&Ae.includes(U),Te=Q&&E&&(re.failKind===pn.ChatFailKind.ServerError||re.failKind===pn.ChatFailKind.Unknown);if(De||Te){let{retryResult:Z}=await this._retryAfterError({opts:e,processed:ie,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:X,transport:b,actualFetcher:q,bytesReceived:F,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:W,resumeEventSeen:V,interactionType:v});if(Z)return Z}return dAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ie,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:X,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:b,interactionType:v,fetcher:q,bytesReceived:F,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:W,resumeEventSeen:V}),N?.resolve(ie),ie}}}catch(re){Y&&(Y.setStatus(2,re instanceof Error?re.message:String(re)),Y.setAttribute(wn.StdAttr.ERROR_TYPE,re instanceof Error?re.constructor.name:"Error"),Y.setAttribute(wn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),Y.recordException(re),Y.end());let j=Date.now()-D.issuedTime;re.fetcherId&&(q=re.fetcherId),re.suspendEventSeen&&(W=!0),re.resumeEventSeen&&(V=!0);let X=this.processError(re,T,re.gitHubRequestId,O,(0,s_t.isAutoModel)(o)===1),ie=Q&&X.type===Vn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),we=Q&&E&&(X.type===Vn.ChatFetchResponseType.NetworkError||X.type===Vn.ChatFetchResponseType.Failed);if(ie||we){let{retryResult:Ae,connectivityTestError:De,connectivityTestErrorGitHubRequestId:Te}=await this._retryAfterError({opts:e,processed:X,telemetryProperties:f,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToError:j,transport:b,actualFetcher:q,bytesReceived:re.bytesReceived,baseTelemetry:D,streamRecorder:B,imageTelemetryMeasurements:k,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:W,resumeEventSeen:V,interactionType:v});if(Ae)return Ae;f={...f,connectivityTestError:De,connectivityTestErrorGitHubRequestId:Te}}return X.type===Vn.ChatFetchResponseType.Canceled?dAe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:W,resumeEventSeen:V},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:L,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:j,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,rBi.isBYOKModel)(o),isAuto:(0,s_t.isAutoModel)(o),bytesReceived:re.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:k}):dAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:X,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:L,maxResponseTokens:w,timeToFirstToken:j,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:k,transport:b,interactionType:v,fetcher:q,bytesReceived:re.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:W,resumeEventSeen:V}),N?.resolve(X),X}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,u2r.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,k=this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Vn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&k,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let L=await this._checkNetworkConnectivity(N),B=L.connectivityTestError?this.scrubErrorDetail(L.connectivityTestError,b):void 0,Q=L.connectivityTestErrorGitHubRequestId;if(!L.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:B,connectivityTestErrorGitHubRequestId:Q};dAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:B,connectivityTestErrorGitHubRequestId:Q},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===Vn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:B,connectivityTestErrorGitHubRequestId:Q}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){let x=this._configurationService.getExperimentBasedConfig(_$.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Vn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,k=!1,D=!1,N=this._powerService.onDidSuspend(()=>{k=!0,this._logService.info(`System suspended during streaming request ${u} (${Vn.ChatLocation.toString(l)})`)}),L=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Vn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w),suspendEventSeen:k||void 0,resumeEventSeen:D||void 0}}catch(B){throw k&&(B.suspendEventSeen=!0),D&&(B.resumeEventSeen=!0),B}finally{N.dispose(),L.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:pn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,s2r.getCurrentCapturingToken)()?.chatSessionId,k=(0,s2r.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,s2r.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[wn.GenAiAttr.OPERATION_NAME]:wn.GenAiOperationName.CHAT,[wn.GenAiAttr.PROVIDER_NAME]:wn.GenAiProviderName.GITHUB,[wn.GenAiAttr.REQUEST_MODEL]:e.model,[wn.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[wn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[wn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[wn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[wn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[wn.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[wn.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[wn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...k?{[wn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:k}:{},...D?{[wn.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),L=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let Q=(0,a_t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${Q} due to missing key`),(0,X4i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${Q} due to missing key`),{result:{type:pn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:pn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(B){throw N.setStatus(2,B instanceof Error?B.message:String(B)),N.setAttribute(wn.StdAttr.ERROR_TYPE,B instanceof Error?B.constructor.name:"Error"),N.recordException(B),B}finally{let B=(Date.now()-L)/1e3;wn.GenAiMetrics.recordOperationDuration(this._otelService,B,{operationName:wn.GenAiOperationName.CHAT,providerName:wn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=l_t(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,a2r.generateUuid)(),R=fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,o2r.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,wn.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,d2r.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let k=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:E},f),N=n.extendedBy({modelCallId:w}),L=this._instantiationService.createInstance($4e.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,$4e.getResponsesApiCompactionThresholdFromBody)(r)),B=new eBi.AsyncIterableObject(async M=>{try{await new Promise((q,F)=>{D.onEvent(U=>{let W=L.push(U,o);if(W&&((0,$4e.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,W,N),M.emitOne(W)),U.type==="response.completed"){let V=U.copilot_quota_snapshots;V&&typeof V=="object"&&this._chatQuotaService.processQuotaSnapshots(V)}}),D.onCAPIError(U=>{let W=new Error(`${U.error.message} (${U.error.code})`);W.gitHubRequestId=x.gitHubRequestId,W.capiWebSocketError=U,F(W)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,tBi.isCancellationError)(U)){F(U);return}let W=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",W.properties,W.measurements);let V=Date.now()-k;R.measurements.totalTimeMs=V,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${V} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),F(U)}),D.done.then(q,F)});let O=Date.now()-k;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let q=(0,$4e.responseApiInputToRawMessagesForLogging)(r);O=(0,zT.rawMessageToCAPI)(q)}catch(q){this._logService.error("Failed to convert Response API input to messages for telemetry:",q),O=[]}(0,Z4i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),Q=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:pn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,nBi.isCAPIWebSocketError)(Q)){let M=Date.now()-k;return R.measurements.totalTimeMs=M,R.properties.error=`${Q.error.message} (${Q.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(Q,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:pn.FetchResponseKind.Success,chatCompletions:B},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,a2r.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:pn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=iBi(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new eBi.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:pn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,wn.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,d2r.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,wn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=l_t(s);return this._instantiationService.invokeFunction(a_t.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,o2r.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,a_t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,a_t.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,$4e.responseApiInputToRawMessagesForLogging)(n);E=(0,zT.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,Z4i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,o2r.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service +`,Fe=[...l,{role:qpc.Raw.ChatRole.User,content:(0,k4e.toTextParts)(ve)}],Pe=await this.fetchMany({...e,debugName:"retry-"+n,messages:Fe,finishedCb:s,location:c,endpoint:o,source:d,requestOptions:u,userInitiatedRequest:!1,telemetryProperties:{...f,retryAfterFilterCategory:ae.category??"uncategorized"},enableRetryOnFilter:!1,canRetryOnceWithoutRollback:!1,enableRetryOnError:j},r);if(N?.resolve(Pe,L.deltas),Pe.type===Wn.ChatFetchResponseType.Success)return Pe}}return{type:Wn.ChatFetchResponseType.Filtered,category:ae.category,reason:"Response got filtered.",requestId:ae.requestId,serverRequestId:ae.serverRequestId}}if(N?.resolve(ae,L.deltas),ae.type===Wn.ChatFetchResponseType.Success&&ae.usage){typeof ae.usage.copilot_usage?.total_nano_aiu=="number"&&A&&v!=="conversation-background"&&this._chatQuotaService.setLastCopilotUsage(ae.usage.copilot_usage.total_nano_aiu,y??A);let Oe=(0,xn.normalizeResponseModel)(o.model,ae.resolvedModel),ve={operationName:xn.GenAiOperationName.CHAT,providerName:xn.GenAiProviderName.GITHUB,requestModel:o.model,responseModel:Oe};ae.usage.prompt_tokens&&xn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.prompt_tokens,"input",ve),ae.usage.completion_tokens&&xn.GenAiMetrics.recordTokenUsage(this._otelService,ae.usage.completion_tokens,"output",ve),J?.setAttributes({[xn.GenAiAttr.USAGE_INPUT_TOKENS]:ae.usage.prompt_tokens??0,[xn.GenAiAttr.USAGE_OUTPUT_TOKENS]:ae.usage.completion_tokens??0,[xn.GenAiAttr.RESPONSE_MODEL]:Oe??o.model,[xn.GenAiAttr.RESPONSE_ID]:ae.requestId,[xn.GenAiAttr.RESPONSE_FINISH_REASONS]:["stop"],...ae.usage.prompt_tokens_details?.cached_tokens?{[xn.GenAiAttr.USAGE_CACHE_READ_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cached_tokens}:{},...ae.usage.prompt_tokens_details?.cache_creation_input_tokens?{[xn.GenAiAttr.USAGE_CACHE_CREATION_INPUT_TOKENS]:ae.usage.prompt_tokens_details.cache_creation_input_tokens}:{},[xn.CopilotChatAttr.TIME_TO_FIRST_TOKEN]:re,...ae.serverRequestId?{[xn.CopilotChatAttr.SERVER_REQUEST_ID]:ae.serverRequestId}:{},...ae.usage.completion_tokens_details?.reasoning_tokens?{[xn.GenAiAttr.USAGE_REASONING_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens,[xn.GenAiAttr.USAGE_REASONING_OUTPUT_TOKENS]:ae.usage.completion_tokens_details.reasoning_tokens}:{},...typeof ae.usage.copilot_usage?.total_nano_aiu=="number"?{[xn.CopilotChatAttr.COPILOT_USAGE_NANO_AIU]:ae.usage.copilot_usage.total_nano_aiu}:{}})}if(J&&ae.type===Wn.ChatFetchResponseType.Success){let Oe=L.deltas.map(Z=>Z.text).join(""),ve=L.deltas.filter(Z=>Z.copilotToolCalls?.length).flatMap(Z=>Z.copilotToolCalls.map(ee=>({type:"tool_call",id:ee.id,name:ee.name,arguments:ee.arguments}))),Fe=[];if(Oe&&Fe.push({type:"text",content:Oe}),Fe.push(...ve),Fe.length>0&&J.setAttribute(xn.GenAiAttr.OUTPUT_MESSAGES,(0,xn.truncateForOTel)(JSON.stringify([{role:"assistant",parts:Fe}]),this._otelService.config.maxAttributeSizeChars)),L.deltas.some(Z=>Z.thinking)){let ee=L.deltas.filter(K=>K.thinking&&!(0,Xpc.isEncryptedThinkingDelta)(K.thinking)&&K.thinking.text).map(K=>{let pe=K.thinking;return"encrypted"in pe?"":Array.isArray(pe.text)?pe.text.join(""):pe.text??""}).join("");J.setAttribute(xn.CopilotChatAttr.REASONING_CONTENT,(0,xn.truncateForOTel)(ee||"[encrypted]",this._otelService.config.maxAttributeSizeChars))}}return(0,xn.emitInferenceDetailsEvent)(this._otelService,{model:o.model,temperature:u?.temperature,maxTokens:u?.max_tokens},ae.type===Wn.ChatFetchResponseType.Success?{id:ae.requestId,model:(0,xn.normalizeResponseModel)(o.model,ae.resolvedModel),finishReasons:["stop"],inputTokens:ae.usage?.prompt_tokens,outputTokens:ae.usage?.completion_tokens}:void 0),J?.end(),J=void 0,re>0&&xn.GenAiMetrics.recordTimeToFirstToken(this._otelService,o.model,re/1e3),E&&ae.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks=0),ae}case fn.FetchResponseKind.Canceled:return tAe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:z,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:B,tokenCountMax:w,timeToFirstToken:re,timeToFirstTokenEmitted:D&&L.firstTokenEmittedTime?L.firstTokenEmittedTime-D.issuedTime:-1,timeToCancelled:Date.now()-D.issuedTime,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,K4i.isBYOKModel)(o),isAuto:(0,VEt.isAutoModel)(o),bytesReceived:Q,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}),N?.resolveWithCancelation(),J?.setAttributes({[xn.GenAiAttr.RESPONSE_FINISH_REASONS]:["cancelled"],[xn.CopilotChatAttr.CANCELED]:!0}),J?.end(),J=void 0,this.processCanceledResponse(ne,T,L,f);case fn.FetchResponseKind.Failed:{let ae=this.processFailedResponse(ne,T,(0,VEt.isAutoModel)(o)===1),ve=this._configurationService.getExperimentBasedConfig(l$.ConfigKey.TeamInternal.RetryServerErrorStatusCodes,this._experimentationService).split(",").map(Z=>parseInt(Z.trim(),10)),Fe=j&&U!==void 0&&ve.includes(U),Pe=j&&E&&(ne.failKind===fn.ChatFailKind.ServerError||ne.failKind===fn.ChatFailKind.Unknown);if(Fe||Pe){let{retryResult:Z}=await this._retryAfterError({opts:e,processed:ae,telemetryProperties:f,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToError:re,transport:b,actualFetcher:q,bytesReceived:Q,baseTelemetry:D,streamRecorder:L,imageTelemetryMeasurements:P,retryReason:"server_error",debugNamePrefix:"retry-server-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:W,interactionType:v});if(Z)return Z}return tAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:ae,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToFirstToken:re,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:q,bytesReceived:Q,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,resumeEventSeen:W}),N?.resolve(ae),ae}}}catch(ne){J&&(J.setStatus(2,ne instanceof Error?ne.message:String(ne)),J.setAttribute(xn.StdAttr.ERROR_TYPE,ne instanceof Error?ne.constructor.name:"Error"),J.setAttribute(xn.GenAiAttr.RESPONSE_FINISH_REASONS,["error"]),J.recordException(ne),J.end());let H=Date.now()-D.issuedTime;ne.fetcherId&&(q=ne.fetcherId),ne.suspendEventSeen&&(z=!0),ne.resumeEventSeen&&(W=!0);let re=this.processError(ne,T,ne.gitHubRequestId,O,(0,VEt.isAutoModel)(o)===1),ae=j&&re.type===Wn.ChatFetchResponseType.NetworkError&&this._configurationService.getExperimentBasedConfig(l$.ConfigKey.TeamInternal.RetryNetworkErrors,this._experimentationService),Oe=j&&E&&(re.type===Wn.ChatFetchResponseType.NetworkError||re.type===Wn.ChatFetchResponseType.Failed);if(ae||Oe){let{retryResult:ve,connectivityTestError:Fe,connectivityTestErrorGitHubRequestId:Pe}=await this._retryAfterError({opts:e,processed:re,telemetryProperties:f,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToError:H,transport:b,actualFetcher:q,bytesReceived:ne.bytesReceived,baseTelemetry:D,streamRecorder:L,imageTelemetryMeasurements:P,retryReason:"network_error",debugNamePrefix:"retry-error-",pendingLoggedChatRequest:N,token:r,usernameToScrub:O,suspendEventSeen:z,resumeEventSeen:W,interactionType:v});if(ve)return ve;f={...f,connectivityTestError:Fe,connectivityTestErrorGitHubRequestId:Pe}}return re.type===Wn.ChatFetchResponseType.Canceled?tAe.ChatMLFetcherTelemetrySender.sendCancellationTelemetry(this._telemetryService,{source:f.messageSource??"unknown",requestId:T,model:o.model,apiType:o.apiType,transport:b,interactionType:v,conversationId:f.conversationId??g,associatedRequestId:f.associatedRequestId,parentRequestId:f.parentRequestId,retryAfterError:f.retryAfterError,retryAfterErrorGitHubRequestId:f.retryAfterErrorGitHubRequestId,connectivityTestError:f.connectivityTestError,connectivityTestErrorGitHubRequestId:f.connectivityTestErrorGitHubRequestId,retryAfterFilterCategory:f.retryAfterFilterCategory,fetcher:q,suspendEventSeen:z,resumeEventSeen:W},{totalTokenMax:o.modelMaxPromptTokens??-1,promptTokenCount:B,tokenCountMax:w,timeToFirstToken:void 0,timeToCancelled:H,isVisionRequest:this.filterImageMessages(l)?1:-1,isBYOK:(0,K4i.isBYOKModel)(o),isAuto:(0,VEt.isAutoModel)(o),bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,imageTelemetryMeasurements:P}):tAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:re,telemetryProperties:f,chatEndpointInfo:o,requestBody:x,tokenCount:B,maxResponseTokens:w,timeToFirstToken:H,isVisionRequest:this.filterImageMessages(l),imageTelemetryMeasurements:P,transport:b,interactionType:v,fetcher:q,bytesReceived:ne.bytesReceived,issuedTime:D.issuedTime,wasRetried:!1,suspendEventSeen:z,resumeEventSeen:W}),N?.resolve(re),re}}async _checkNetworkConnectivity(e){let r=this.connectivityCheckDelays,n,o;for(let s of r){this._logService.info(`Waiting ${s}ms before pinging CAPI to check network connectivity...`),await new Promise(c=>setTimeout(c,s));try{let c=this._capiClientService.dotcomAPIURL!=="https://api.github.com",l=this._capiClientService.capiPingURL,u=await this._getAuthHeaders(c,l),d=await this._fetcherService.fetch(l,{headers:u,useFetcher:e,callSite:"capi-ping"});if(d.status>=200&&d.status<300)return this._logService.info("CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o};n=`Status ${d.status}: ${d.statusText}`,o=d.headers.get("x-github-request-id")??"",this._logService.info(`CAPI ping returned status ${d.status}, retrying ping...`)}catch(c){n=(0,Vkr.collectSingleLineErrorMessage)(c,!0),o=void 0,this._logService.info(`CAPI ping failed with error, retrying ping: ${n}`)}}return{retryRequest:!1,connectivityTestError:n,connectivityTestErrorGitHubRequestId:o}}async _getAuthHeaders(e,r){let n={};if(e){let o="";if(r===this._capiClientService.dotcomAPIURL)o=this._authenticationService.anyGitHubSession?.accessToken||"";else try{o=(await this._authenticationService.getCopilotToken()).token}catch{o=""}n.Authorization=`Bearer ${o}`}return n}async _retryAfterError(e){let{opts:r,processed:n,telemetryProperties:o,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToError:u,transport:d,actualFetcher:f,bytesReceived:h,baseTelemetry:m,streamRecorder:g,imageTelemetryMeasurements:A,retryReason:y,debugNamePrefix:E,pendingLoggedChatRequest:_,token:v,usernameToScrub:b,suspendEventSeen:T,resumeEventSeen:w,interactionType:R}=e,x=["darwin","linux"].includes(process.platform)&&n.reason.indexOf("net::ERR_NETWORK_CHANGED")!==-1,P=this._configurationService.getExperimentBasedConfig(l$.ConfigKey.TeamInternal.FallbackNodeFetchOnNetworkProcessCrash,this._experimentationService),D=n.type===Wn.ChatFetchResponseType.NetworkError&&n.isNetworkProcessCrash===!0&&P,N=x||D?"node-fetch":r.useFetcher;this._logService.info(`Retrying chat request with ${N||"default"} fetcher after: ${n.reasonDetail||n.reason}`);let B=await this._checkNetworkConnectivity(N),L=B.connectivityTestError?this.scrubErrorDetail(B.connectivityTestError,b):void 0,j=B.connectivityTestErrorGitHubRequestId;if(!B.retryRequest)return this._logService.info("Not retrying chat request as network connectivity could not be re-established."),{connectivityTestError:L,connectivityTestErrorGitHubRequestId:j};tAe.ChatMLFetcherTelemetrySender.sendResponseErrorTelemetry(this._telemetryService,{processed:n,telemetryProperties:o,chatEndpointInfo:r.endpoint,requestBody:s,tokenCount:c,maxResponseTokens:l,timeToFirstToken:u,isVisionRequest:this.filterImageMessages(r.messages),imageTelemetryMeasurements:A,transport:d,interactionType:R,fetcher:f,bytesReceived:h,issuedTime:m.issuedTime,wasRetried:!0,suspendEventSeen:T,resumeEventSeen:w}),g.callback("",0,{text:"",retryReason:y});let M=await this.fetchMany({...r,useWebSocket:!1,ignoreStatefulMarker:r.useWebSocket||r.ignoreStatefulMarker,debugName:E+r.debugName,userInitiatedRequest:!1,telemetryProperties:{...o,retryAfterError:n.reasonDetail||n.reason,retryAfterErrorGitHubRequestId:n.serverRequestId,connectivityTestError:L,connectivityTestErrorGitHubRequestId:j},enableRetryOnError:!1,useFetcher:N},v);return _?.resolve(M,g.deltas),r.useWebSocket&&M.type===Wn.ChatFetchResponseType.Success&&(this._consecutiveWebSocketRetryFallbacks++,this._logService.info(`[ChatWebSocketManager] WebSocket request failed with successful HTTP fallback (${this._consecutiveWebSocketRetryFallbacks} consecutive).`),r.conversationId&&this._webSocketManager.closeConnection(r.conversationId)),{retryResult:M,connectivityTestError:L,connectivityTestErrorGitHubRequestId:j}}async _fetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){let x=this._configurationService.getExperimentBasedConfig(l$.ConfigKey.TeamInternal.ChatRequestPowerSaveBlocker,this._experimentationService)&&l!==Wn.ChatLocation.Other?this._powerService.acquirePowerSaveBlocker():void 0,P=!1,D=!1,N=this._powerService.onDidSuspend(()=>{P=!0,this._logService.info(`System suspended during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)}),B=this._powerService.onDidResume(()=>{D=!0,this._logService.info(`System resumed during streaming request ${u} (${Wn.ChatLocation.toString(l)})`)});try{return{...await this._doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w),suspendEventSeen:P||void 0,resumeEventSeen:D||void 0}}catch(L){throw P&&(L.suspendEventSeen=!0),D&&(L.resumeEventSeen=!0),L}finally{N.dispose(),B.dispose(),x?.dispose()}}async _doFetchAndStreamChat(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w){if(f.isCancellationRequested)return{result:{type:fn.FetchResponseKind.Canceled,reason:"before fetch request"}};let R=typeof e.urlOrRequestMetadata=="string"?(()=>{try{return new URL(e.urlOrRequestMetadata).hostname}catch{return}})():void 0,x=(0,jkr.getCurrentCapturingToken)()?.chatSessionId,P=(0,jkr.getCurrentCapturingToken)()?.parentChatSessionId,D=(0,jkr.getCurrentCapturingToken)()?.debugLogLabel,N=this._otelService.startSpan(`chat ${e.model}`,{kind:2,attributes:{[xn.GenAiAttr.OPERATION_NAME]:xn.GenAiOperationName.CHAT,[xn.GenAiAttr.PROVIDER_NAME]:xn.GenAiProviderName.GITHUB,[xn.GenAiAttr.REQUEST_MODEL]:e.model,[xn.GenAiAttr.CONVERSATION_ID]:E?.requestId??u,[xn.GenAiAttr.REQUEST_MAX_TOKENS]:r.max_tokens??r.max_output_tokens??r.max_completion_tokens??2048,...r.temperature!==void 0?{[xn.GenAiAttr.REQUEST_TEMPERATURE]:r.temperature}:{},...r.top_p!==void 0?{[xn.GenAiAttr.REQUEST_TOP_P]:r.top_p}:{},[xn.CopilotChatAttr.MAX_PROMPT_TOKENS]:e.modelMaxPromptTokens,...R?{[xn.StdAttr.SERVER_ADDRESS]:R}:{},...y?{[xn.CopilotChatAttr.SESSION_ID]:y}:{},...x?{[xn.CopilotChatAttr.CHAT_SESSION_ID]:x}:{},...P?{[xn.CopilotChatAttr.PARENT_CHAT_SESSION_ID]:P}:{},...D?{[xn.CopilotChatAttr.DEBUG_LOG_LABEL]:D}:{}}}),B=Date.now();try{if(this._logService.debug(`modelMaxPromptTokens ${e.modelMaxPromptTokens}`),this._logService.debug(`modelMaxResponseTokens ${r.max_tokens??2048}`),this._logService.debug(`chat model ${e.model}`),e.ownsAuthorization||(s??=c?.token),!s&&!e.ownsAuthorization){let j=(0,WEt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata);return this._logService.error(`Failed to send request to ${j} due to missing key`),(0,W4i.sendCommunicationErrorTelemetry)(this._telemetryService,`Failed to send request to ${j} due to missing key`),{result:{type:fn.FetchResponseKind.Failed,modelRequestId:void 0,failKind:fn.ChatFailKind.TokenExpiredOrInvalid,reason:"key is missing"}}}return g&&A&&y?{...await this._doFetchViaWebSocket(e,r,n,o,s,l,u,A,y,f,h,m,E,b,T,w),otelSpan:N}:{...await this._doFetchViaHttp(e,r,n,o,s,l,u,d,f,m,E,_,v,b),otelSpan:N}}catch(L){throw N.setStatus(2,L instanceof Error?L.message:String(L)),N.setAttribute(xn.StdAttr.ERROR_TYPE,L instanceof Error?L.constructor.name:"Error"),N.recordException(L),L}finally{let L=(Date.now()-B)/1e3;xn.GenAiMetrics.recordOperationDuration(this._otelService,L,{operationName:xn.GenAiOperationName.CHAT,providerName:xn.GenAiProviderName.GITHUB,requestModel:e.model})}}async _doFetchViaWebSocket(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=YEt(c),v=A??_,b={...s?{Authorization:`Bearer ${s}`}:{},"X-Request-Id":l,"OpenAI-Intent":_,"X-GitHub-Api-Version":"2025-05-01","X-Interaction-Id":this._interactionService.interactionId,...e.getExtraHeaders?e.getExtraHeaders(c,A):{}};b["X-Interaction-Type"]=v,b["X-Agent-Task-Id"]=l,r.messages?.some(M=>Array.isArray(M.content)?M.content.some(O=>"image_url"in O):!1)&&e.supportsVision&&(b["Copilot-Vision-Request"]="true");let T=this._webSocketManager.getOrCreateConnection(d,b,l);try{await T.connect()}catch(M){throw M.gitHubRequestId=T.gitHubRequestId,M}let w=(0,Hkr.generateUuid)(),R=rAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(c),transport:"websocket",...g,modelCallId:w},{maxTokenWindow:e.modelMaxPromptTokens}),x=(0,qkr.getRequestId)(T.responseHeaders);x.headerRequestId=l,R.extendWithRequestId(x),x.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",x.serverExperiments);for(let[M,O]of Object.entries(r))if(!(M==="messages"||M==="input")){if(M==="tools"){R.properties[`request.option.${M}`]=(0,xn.stringifyToolsRawForTelemetry)(O)??"undefined";continue}R.properties[`request.option.${M}`]=JSON.stringify(O)??"undefined"}this._telemetryService.sendGHTelemetryEvent("request.sent",R.properties,R.measurements),r.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,Wkr.multiplexProperties)({headerRequestId:l,conversationId:d,messagesJson:(0,xn.stringifyToolsRawForTelemetry)(r.tools)}),R.measurements);let P=Date.now(),D=T.sendRequest(r,{userInitiated:!!m,turnId:u,requestId:l,model:e.model,countTokens:h,tokenCountMax:e.maxOutputTokens,modelMaxPromptTokens:e.modelMaxPromptTokens,summarizedAtRoundId:y,modeChanged:E},f),N=n.extendedBy({modelCallId:w}),B=this._instantiationService.createInstance(D4e.OpenAIResponsesProcessor,N,this._telemetryService,x.headerRequestId,x.gitHubRequestId,x.serverExperiments,(0,D4e.getResponsesApiCompactionThresholdFromBody)(r)),L=new z4i.AsyncIterableObject(async M=>{try{await new Promise((q,Q)=>{D.onEvent(U=>{let z=B.push(U,o);if(z&&((0,D4e.sendCompletionOutputTelemetry)(this._telemetryService,this._logService,z,N),M.emitOne(z)),U.type==="response.completed"){let W=U.copilot_quota_snapshots;W&&typeof W=="object"&&this._chatQuotaService.processQuotaSnapshots(W)}}),D.onCAPIError(U=>{let z=new Error(`${U.error.message} (${U.error.code})`);z.gitHubRequestId=x.gitHubRequestId,z.capiWebSocketError=U,Q(z)}),D.onError(U=>{if(U.gitHubRequestId=x.gitHubRequestId,(0,Y4i.isCancellationError)(U)){Q(U);return}let z=R.extendedBy({error:U.message});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",z.properties,z.measurements);let W=Date.now()-P;R.measurements.totalTimeMs=W,R.properties.error=U.message,this._logService.debug(`request.error: [websocket], took ${W} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),Q(U)}),D.done.then(q,Q)});let O=Date.now()-P;R.measurements.totalTimeMs=O,this._logService.debug(`request.response: [websocket], took ${O} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",R.properties,R.measurements)}finally{let O=r.messages;if((!O||O.length===0)&&r.input)try{let q=(0,D4e.responseApiInputToRawMessagesForLogging)(r);O=(0,GT.rawMessageToCAPI)(q)}catch(q){this._logService.error("Failed to convert Response API input to messages for telemetry:",q),O=[]}(0,V4i.sendEngineMessagesTelemetry)(this._telemetryService,O??[],R,!1,this._logService)}}),j=await D.firstEvent;if(f.isCancellationRequested)return{result:{type:fn.FetchResponseKind.Canceled,reason:"after first WebSocket event"}};if((0,J4i.isCAPIWebSocketError)(j)){let M=Date.now()-P;return R.measurements.totalTimeMs=M,R.properties.error=`${j.error.message} (${j.error.code})`,this._logService.debug(`request.error: [websocket capi error], took ${M} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",R.properties,R.measurements),{result:await this._handleWebSocketCAPIError(j,x)}}return this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),{result:{type:fn.FetchResponseKind.Success,chatCompletions:L},modelCallId:w}}async _doFetchViaHttp(e,r,n,o,s,c,l,u,d,f,h,m,g,A){let y=(0,Hkr.generateUuid)(),E=await this._fetchWithInstrumentation(e,l,r,s,c,d,f,{...h,modelCallId:y},m,g,A);if(d.isCancellationRequested){try{await E.body.destroy()}catch(T){this._logService.error(T,"Error destroying stream"),this._telemetryService.sendGHTelemetryException(T,"Error destroying stream")}return{result:{type:fn.FetchResponseKind.Canceled,reason:"after fetch request"},fetcher:E.fetcher,bytesReceived:E.bytesReceived}}if(E.status===200&&this._authenticationService.copilotToken?.isFreeUser&&this._authenticationService.copilotToken?.isChatQuotaExceeded&&this._authenticationService.resetCopilotToken(),E.status!==200){let T=Z4i(e,c,l);return this._logService.info("Request ID for failed request: "+l),{result:await this._handleError(T,E,l),fetcher:E.fetcher,bytesReceived:E.bytesReceived,statusCode:E.status}}let _=n.extendedBy({modelCallId:y}),v,b=E.headers.get("x-github-request-id")??"";try{let T=await e.processResponseFromChatEndpoint(this._telemetryService,this._logService,E,u??1,o,_,d,c);v=new z4i.AsyncIterableObject(async w=>{try{for await(let R of T)w.emitOne(R)}catch(R){throw R.fetcherId=E.fetcher,R.gitHubRequestId=b,R.bytesReceived=E.bytesReceived,R}})}catch(T){throw T.fetcherId=E.fetcher,T.gitHubRequestId=b,T.bytesReceived=E.bytesReceived,T}return E.headers.get("Copilot-Edits-Session")&&(this._authenticationService.speculativeDecodingEndpointToken=E.headers.get("Copilot-Edits-Session")??void 0),this._chatQuotaService.processQuotaHeaders(E.headers),{result:{type:fn.FetchResponseKind.Success,chatCompletions:v},fetcher:E.fetcher,bytesReceived:E.bytesReceived,modelCallId:y}}async _fetchWithInstrumentation(e,r,n,o,s,c,l,u,d,f,h){let m={"X-Interaction-Id":this._interactionService.interactionId,"X-Initiator":l?"user":"agent"};n.messages?.some(E=>Array.isArray(E.content)?E.content.some(_=>"image_url"in _):!1)&&e.supportsVision&&(m["Copilot-Vision-Request"]="true");let g=rAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(s),transport:"http",...u},{maxTokenWindow:e.modelMaxPromptTokens});for(let[E,_]of Object.entries(n))if(!(E==="messages"||E==="input")){if(E==="tools"){g.properties[`request.option.${E}`]=(0,xn.stringifyToolsRawForTelemetry)(_)??"undefined";continue}g.properties[`request.option.${E}`]=JSON.stringify(_)??"undefined"}g.properties.headerRequestId=r,this._telemetryService.sendGHTelemetryEvent("request.sent",g.properties,g.measurements),n.tools&&this._telemetryService.sendEnhancedGHTelemetryEvent("request.options.tools",(0,Wkr.multiplexProperties)({headerRequestId:r,conversationId:u?.conversationId,messagesJson:(0,xn.stringifyToolsRawForTelemetry)(n.tools)}),g.measurements);let A=Date.now(),y=YEt(s);return this._instantiationService.invokeFunction(WEt.postRequest,{endpointOrUrl:e,secretKey:o,intent:y,requestId:r,body:n,additionalHeaders:m,cancelToken:c,useFetcher:d,canRetryOnce:f,location:s,interactionTypeOverride:h}).then(E=>{let _=E.headers.get("apim-request-id");_&&this._logService.debug(`APIM request id: ${_}`);let v=E.headers.get("x-github-request-id");v&&this._logService.debug(`GH request id: ${v}`);let b=(0,qkr.getRequestId)(E.headers);b.headerRequestId=b.headerRequestId||r,g.extendWithRequestId(b),b.serverExperiments&&this._telemetryService.setSharedProperty("capi.assignmentcontext",b.serverExperiments);let T=Date.now()-A;return g.measurements.totalTimeMs=T,this._logService.debug(`request.response: [${(0,WEt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}], took ${T} ms`),this._telemetryService.sendGHTelemetryEvent("request.response",g.properties,g.measurements),E}).catch(E=>{if(this._fetcherService.isAbortError(E))throw E;let _=g.extendedBy({error:"Network exception"});this._telemetryService.sendGHTelemetryEvent("request.shownWarning",_.properties,_.measurements),g.properties.code=String(E.code??""),g.properties.errno=String(E.errno??""),g.properties.message=String(E.message??""),g.properties.type=String(E.type??"");let v=Date.now()-A;throw g.measurements.totalTimeMs=v,this._logService.debug(`request.response: [${(0,WEt.stringifyUrlOrRequestMetadata)(e.urlOrRequestMetadata)}] took ${v} ms`),this._telemetryService.sendGHTelemetryEvent("request.error",g.properties,g.measurements),E}).finally(()=>{let E=n.messages;if((!E||E.length===0)&&n.input)try{let _=(0,D4e.responseApiInputToRawMessagesForLogging)(n);E=(0,GT.rawMessageToCAPI)(_)}catch(_){this._logService.error("Failed to convert Response API input to messages for telemetry:",_),E=[]}(0,V4i.sendEngineMessagesTelemetry)(this._telemetryService,E??[],g,!1,this._logService)})}async _handleError(e,r,n){let o=(0,qkr.getRequestId)(r.headers);n=o.headerRequestId||n,o.headerRequestId=n,this._chatQuotaService.processQuotaHeaders(r.headers),e.properties.error=`Response status was ${r.status}`,e.properties.status=String(r.status),this._telemetryService.sendGHTelemetryEvent("request.shownWarning",e.properties,e.measurements);let s=await r.text(),c;try{c=JSON.parse(s),c=c?.error??c}catch{}let l=`Server error: ${r.status}`,u=`${l} ${s}`;if(this._logService.error(u),400<=r.status&&r.status<500){if(r.status===400&&s.includes("off_topic"))return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.OffTopic,reason:"filtered as off_topic by intent classifier: message was not programming related"};if(r.status===401&&s.includes("authorize_url")&&c?.authorize_url)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.AgentUnauthorized,reason:r.statusText||r.statusText,data:c};if(r.status===400&&c?.code==="previous_response_not_found")return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.InvalidPreviousResponseId,reason:c.message||"Invalid previous response ID",data:c};if(r.status===401||r.status===403)return this._authenticationService.resetCopilotToken(r.status),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.TokenExpiredOrInvalid,reason:c?.message||`token expired or invalid: ${r.status}`};if(r.status===402){this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(r.status),await this._authenticationService.getCopilotToken());let d=r.headers.get("retry-after"),h=a(m=>{if(!m)return;let g=new Date(m);if(!isNaN(g.getDate()))return g;let A=parseInt(m,10);if(!isNaN(A))return new Date(Date.now()+A*1e3)},"convertToDate")(d);return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.QuotaExceeded,reason:c?.message??"Free tier quota exceeded",data:{capiError:c,retryAfter:h}}}if(r.status===404){let d;return c?d=JSON.stringify(c):d=s,{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.NotFound,reason:d}}if(r.status===422)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ContentFilter,reason:`Filtered by Responsible AI Service -`+s};if(r.status===424)return{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,X4i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:pn.FetchResponseKind.Failed,modelRequestId:o,failKind:pn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b){let T=[];for await(let k of e.chatCompletions)dAe.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:k,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(k,f?.properties)||T.push(k);let w=new Set([zT.FinishedCompletionReason.Stop,zT.FinishedCompletionReason.ClientTrimmed,zT.FinishedCompletionReason.FunctionCall,zT.FinishedCompletionReason.ToolCalls]),R=T.filter(k=>w.has(k.finishReason));if(R.length>=1)return{type:Vn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(k=>(0,G4e.getTextPart)(k.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case zT.FinishedCompletionReason.ContentFilter:return{type:Vn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??zT.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(k=>(0,G4e.getTextPart)(k.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case zT.FinishedCompletionReason.Length:return{type:Vn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,G4e.getTextPart)(x.message.content)};case zT.FinishedCompletionReason.ServerError:return{type:Vn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Vn.ChatFetchResponseType.Unknown,reason:Vn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,c_t.calculateLineRepetitionStats)((0,G4e.getTextPart)(e.message.content)),o=(0,c_t.isRepetitive)(e.tokens);if(o){let s=fAe.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,c_t.calculateLineRepetitionStats)(o);if((0,c_t.isRepetitive)(s)){let d=fAe.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Vn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===pn.ChatFailKind.RateLimited)return{type:Vn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===pn.ChatFailKind.QuotaExceeded)return{type:Vn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===pn.ChatFailKind.OffTopic)return{type:Vn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===pn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Vn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ServerError)return{type:Vn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ContentFilter)return{type:Vn.ChatFetchResponseType.PromptFiltered,reason:s,category:zT.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.AgentUnauthorized)return{type:Vn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.AgentFailedDependency)return{type:Vn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===pn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Vn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===pn.ChatFailKind.NotFound?{type:Vn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===pn.ChatFailKind.InvalidPreviousResponseId?{type:Vn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Vn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Vn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,tBi.isCancellationError)(e))return{type:Vn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:Vn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(W0c.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,u2r.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Vn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Vn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Vn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:pn.FetchResponseKind.Failed,modelRequestId:r,failKind:pn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Vn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Vn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Vn.ChatFetchResponseType.PromptFiltered,reason:c,category:zT.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Vn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Vn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Vn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,K0c.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};YT.ChatMLFetcherImpl=f2r;YT.ChatMLFetcherImpl=f2r=l2r=N0c([IC(0,j0c.IFetcherService),IC(1,d2r.ITelemetryService),IC(2,G0c.IRequestLogger),IC(3,u2r.ILogService),IC(4,O0c.IAuthenticationService),IC(5,U0c.IInteractionService),IC(6,L0c.IChatQuotaService),IC(7,Q0c.ICAPIClientService),IC(8,F0c.IConversationOptions),IC(9,_$.IConfigurationService),IC(10,$0c.IExperimentationService),IC(11,X0c.IPowerService),IC(12,J0c.IInstantiationService),IC(13,nBi.IChatWebSocketManager),IC(14,H0c.IOTelService)],f2r);function emc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:c2r("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:c2r("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:c2r("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>_$.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${_$.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-_$.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(emc,"isValidChatPayload");function c2r(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(c2r,"asUnexpected");function iBi(t,e,r){return fAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Vn.ChatLocation.toString(e),headerRequestId:r})}a(iBi,"createTelemetryData");function l_t(t){switch(t){case Vn.ChatLocation.Panel:return"conversation-panel";case Vn.ChatLocation.Editor:return"conversation-inline";case Vn.ChatLocation.EditingSession:return"conversation-edits";case Vn.ChatLocation.Notebook:return"conversation-notebook";case Vn.ChatLocation.Terminal:return"conversation-terminal";case Vn.ChatLocation.Other:return"conversation-other";case Vn.ChatLocation.Agent:return"conversation-agent";case Vn.ChatLocation.ResponsesProxy:return"responses-proxy";case Vn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(l_t,"locationToIntent");function tmc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a(tmc,"pickCacheRelevantRequestOptions");function rmc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(rmc,"pickRequestShapeMetadata")});var h2r=I(pAe=>{"use strict";p();Object.defineProperty(pAe,"__esModule",{value:!0});pAe.NullSimilarFilesContextService=pAe.ISimilarFilesContextService=void 0;var nmc=rn();pAe.ISimilarFilesContextService=(0,nmc.createServiceIdentifier)("ISimilarFilesContextService");var p2r=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};pAe.NullSimilarFilesContextService=p2r});var m2r=I(d_t=>{"use strict";p();Object.defineProperty(d_t,"__esModule",{value:!0});d_t.IDiffService=void 0;var imc=rn();d_t.IDiffService=(0,imc.createServiceIdentifier)("IDiffService")});var sBi=I(g2r=>{"use strict";p();Object.defineProperty(g2r,"__esModule",{value:!0});g2r.createProxyXtabEndpoint=cmc;var omc=(bre(),Ca(vre)),smc=iAe(),amc=qre();function cmc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:omc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:smc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(amc.ChatEndpoint,r)}a(cmc,"createProxyXtabEndpoint")});var Hre=I(f_t=>{"use strict";p();Object.defineProperty(f_t,"__esModule",{value:!0});f_t.DocumentId=void 0;var lmc=DKe(),aBi=hA(),umc=Ku(),A2r=class t{static{a(this,"DocumentId")}static{this._cache=new lmc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=umc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,aBi.basename)(this.uri)}get extension(){return(0,aBi.extname)(this.uri)}toUri(){return this._uri}};f_t.DocumentId=A2r});var y2r=I(p_t=>{"use strict";p();Object.defineProperty(p_t,"__esModule",{value:!0});p_t.NextCursorLinePrediction=void 0;var cBi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(cBi||(p_t.NextCursorLinePrediction=cBi={}))});var h_t=I(C$=>{"use strict";p();Object.defineProperty(C$,"__esModule",{value:!0});C$.NullUndesiredModelsManager=C$.IUndesiredModelsManager=C$.IInlineEditsModelService=void 0;var lBi=rn(),dmc=Sc();C$.IInlineEditsModelService=(0,lBi.createServiceIdentifier)("IInlineEditsModelService");C$.IUndesiredModelsManager=(0,lBi.createServiceIdentifier)("IUndesiredModelsManager");var E2r=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=dmc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};C$.NullUndesiredModelsManager=E2r});var uBi=I(v6=>{"use strict";p();Object.defineProperty(v6,"__esModule",{value:!0});v6.IgnoreWhitespaceOnlyChanges=v6.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;v6.editWouldDeleteWhatWasJustInserted=fmc;v6.editIsDeletion=v2r;v6.editWouldDeleteWhatWasJustInserted2=pmc;var _2r=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};v6.IgnoreWhitespaceOnlyChanges=C2r;function fmc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!v2r(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(fmc,"editWouldDeleteWhatWasJustInserted");function v2r(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(v2r,"editIsDeletion");function pmc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!v2r(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(pmc,"editWouldDeleteWhatWasJustInserted2")});var S2r=I(hAe=>{"use strict";p();Object.defineProperty(hAe,"__esModule",{value:!0});hAe.NulSimulationTestContext=hAe.ISimulationTestContext=void 0;var hmc=rn();hAe.ISimulationTestContext=(0,hmc.createServiceIdentifier)("ISimulationTestContext");var b2r=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};hAe.NulSimulationTestContext=b2r});function Gre(t,e=!1){let r=t.length,n=0,o="",s=0,c=16,l=0,u=0,d=0,f=0,h=0;function m(b,T){let w=0,R=0;for(;w=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` -`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(V4e(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(T2r(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(T2r(b));return c=15}if(V4e(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` -`),l++,d=n,c=14;switch(b){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function T2r(t){return t===32||t===9}function V4e(t){return t===10||t===13}function mAe(t){return t>=48&&t<=57}var dBi,m_t=me(()=>{"use strict";p();a(Gre,"createScanner");a(T2r,"isWhiteSpace");a(V4e,"isLineBreak");a(mAe,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(dBi||(dBi={}))});var KT,gAe,I2r,fBi,pBi=me(()=>{p();KT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),gAe=200,I2r={" ":{"\n":new Array(gAe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(gAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(gAe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}," ":{"\n":new Array(gAe).fill(0).map((t,e)=>` -`+" ".repeat(e)),"\r":new Array(gAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(gAe).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}},fBi=[` +`+s};if(r.status===424)return{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.AgentFailedDependency,reason:s};if(r.status===429){let d=s;return d=c?.message??c?.code,s.includes("extension_blocked")&&c?.code==="extension_blocked"&&c?.type==="rate_limit_error"?{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ExtensionBlocked,reason:"Extension blocked",data:{...c?.message,retryAfter:r.headers.get("retry-after")}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.RateLimited,reason:d,data:{retryAfter:r.headers.get("retry-after"),rateLimitKey:r.headers.get("x-ratelimit-exceeded"),capiError:c}}}if(r.status===466)return this._logService.info(s),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ClientNotSupported,reason:`client not supported: ${s}`};if(r.status===499)return this._logService.info("Cancelled by server"),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerCanceled,reason:"canceled by server"}}else if(500<=r.status&&r.status<600)return r.status===503?{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.RateLimited,reason:"Upstream provider rate limit hit",data:{retryAfter:null,rateLimitKey:null,capiError:{code:"upstream_provider_rate_limit",message:s}}}:{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.ServerError,reason:l};return this._logService.error(`Request Failed: ${r.status} ${s}`),(0,W4i.sendCommunicationErrorTelemetry)(this._telemetryService,"Unhandled status from server: "+r.status,s),{type:fn.FetchResponseKind.Failed,modelRequestId:o,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${r.status} ${s}`}}async processSuccessfulResponse(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b){let T=[];for await(let P of e.chatCompletions)tAe.ChatMLFetcherTelemetrySender.sendSuccessTelemetry(this._telemetryService,{chatCompletion:P,baseTelemetry:f,userInitiatedRequest:m,interactionType:g,chatEndpointInfo:h,requestBody:o,maxResponseTokens:c,promptTokenCount:l,timeToFirstToken:u,timeToFirstTokenEmitted:f&&d.firstTokenEmittedTime?d.firstTokenEmittedTime-f.issuedTime:-1,hasImageMessages:this.filterImageMessages(r),imageTelemetryMeasurements:n,transport:A,fetcher:y,bytesReceived:E,suspendEventSeen:_,resumeEventSeen:v,modelCallId:b}),this.isRepetitive(P,f?.properties)||T.push(P);let w=new Set([GT.FinishedCompletionReason.Stop,GT.FinishedCompletionReason.ClientTrimmed,GT.FinishedCompletionReason.FunctionCall,GT.FinishedCompletionReason.ToolCalls]),R=T.filter(P=>w.has(P.finishReason));if(R.length>=1)return{type:Wn.ChatFetchResponseType.Success,resolvedModel:R[0].model,usage:R.length===1?R[0].usage:void 0,value:R.map(P=>(0,k4e.getTextPart)(P.message.content)),requestId:s,serverRequestId:R[0].requestId.headerRequestId,modelCallId:b};let x=T.at(0);switch(x?.finishReason){case GT.FinishedCompletionReason.ContentFilter:return{type:Wn.ChatFetchResponseType.FilteredRetry,category:x.filterReason??GT.FilterReason.Copyright,reason:"Response got filtered.",value:T.map(P=>(0,k4e.getTextPart)(P.message.content)),requestId:s,serverRequestId:x.requestId.headerRequestId};case GT.FinishedCompletionReason.Length:return{type:Wn.ChatFetchResponseType.Length,reason:"Response too long.",requestId:s,serverRequestId:x.requestId.headerRequestId,truncatedValue:(0,k4e.getTextPart)(x.message.content)};case GT.FinishedCompletionReason.ServerError:return{type:Wn.ChatFetchResponseType.Failed,reason:"Server error. Stream terminated",requestId:s,serverRequestId:x.requestId.headerRequestId,streamError:x.error}}return{type:Wn.ChatFetchResponseType.Unknown,reason:Wn.RESPONSE_CONTAINED_NO_CHOICES,requestId:s,serverRequestId:x?.requestId.headerRequestId}}filterImageMessages(e){return e?.some(r=>Array.isArray(r.content)?r.content.some(n=>"imageUrl"in n):!1)}isRepetitive(e,r){let n=(0,zEt.calculateLineRepetitionStats)((0,k4e.getTextPart)(e.message.content)),o=(0,zEt.isRepetitive)(e.tokens);if(o){let s=rAe.TelemetryData.createAndMarkAsIssued();s.extendWithRequestId(e.requestId);let c=s.extendedBy(r);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",c.properties,c.measurements)}return n.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:e.requestId.headerRequestId,finishReason:e.finishReason},{numberOfRepetitions:n.numberOfRepetitions,lengthOfLine:n.mostRepeatedLine.length,totalLines:n.totalLines}),o}checkRepetitionInDeltas(e,r,n){let o=e.filter(u=>u.text?.length>0).map(u=>u.text).join("");if(!o||o.trim().length===0)return;let s=o.split(/\s+/).filter(u=>u.length>0),c=(0,zEt.calculateLineRepetitionStats)(o);if((0,zEt.isRepetitive)(s)){let d=rAe.TelemetryData.createAndMarkAsIssued().extendedBy(n);this._telemetryService.sendEnhancedGHTelemetryEvent("conversation.repetition.detected",d.properties,d.measurements)}c.numberOfRepetitions>=10&&this._telemetryService.sendMSFTTelemetryEvent("conversation.repetition.detected",{requestId:r,finishReason:"canceled"},{numberOfRepetitions:c.numberOfRepetitions,lengthOfLine:c.mostRepeatedLine.length,totalLines:c.totalLines})}processCanceledResponse(e,r,n,o){return n&&n.deltas.length>0&&this.checkRepetitionInDeltas(n.deltas,r,o),{type:Wn.ChatFetchResponseType.Canceled,reason:e.reason,requestId:r,serverRequestId:void 0}}processFailedResponse(e,r,n){let o=e.modelRequestId?.gitHubRequestId,s=e.reason;if(e.failKind===fn.ChatFailKind.RateLimited)return{type:Wn.ChatFetchResponseType.RateLimited,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,rateLimitKey:e.data?.rateLimitKey||"",isAuto:n,capiError:e.data?.capiError};if(e.failKind===fn.ChatFailKind.QuotaExceeded)return{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:s,requestId:r,serverRequestId:o,retryAfter:e.data?.retryAfter,capiError:e.data?.capiError};if(e.failKind===fn.ChatFailKind.OffTopic)return{type:Wn.ChatFetchResponseType.OffTopic,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.TokenExpiredOrInvalid||e.failKind===fn.ChatFailKind.ClientNotSupported||s.includes("Bad request: "))return{type:Wn.ChatFetchResponseType.BadRequest,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ServerError)return{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ContentFilter)return{type:Wn.ChatFetchResponseType.PromptFiltered,reason:s,category:GT.FilterReason.Prompt,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentUnauthorized)return{type:Wn.ChatFetchResponseType.AgentUnauthorized,reason:s,authorizationUrl:e.data.authorize_url,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.AgentFailedDependency)return{type:Wn.ChatFetchResponseType.AgentFailedDependency,reason:s,requestId:r,serverRequestId:o};if(e.failKind===fn.ChatFailKind.ExtensionBlocked){let c=typeof e.data?.retryAfter=="number"?e.data.retryAfter:300;return{type:Wn.ChatFetchResponseType.ExtensionBlocked,reason:s,requestId:r,retryAfter:c,learnMoreLink:e.data?.learnMoreLink??"",serverRequestId:o}}return e.failKind===fn.ChatFailKind.NotFound?{type:Wn.ChatFetchResponseType.NotFound,reason:s,requestId:r,serverRequestId:o}:e.failKind===fn.ChatFailKind.InvalidPreviousResponseId?{type:Wn.ChatFetchResponseType.InvalidStatefulMarker,reason:s,requestId:r,serverRequestId:o}:{type:Wn.ChatFetchResponseType.Failed,reason:s,requestId:r,serverRequestId:o}}processError(e,r,n,o,s){let c=e?.capiWebSocketError;if(c)return this._handleWebSocketError(c,r,n,s);let l=this._fetcherService;if(l.isAbortError(e))return{type:Wn.ChatFetchResponseType.Canceled,reason:"network request aborted",requestId:r,serverRequestId:n};if((0,Y4i.isCancellationError)(e))return{type:Wn.ChatFetchResponseType.Canceled,reason:"Got a cancellation error",requestId:r,serverRequestId:n};if(e&&(e instanceof Error&&e.message==="Premature close"||typeof e=="object"&&e.code==="ERR_STREAM_PREMATURE_CLOSE"))return{type:Wn.ChatFetchResponseType.Canceled,reason:"Stream closed prematurely",requestId:r,serverRequestId:n};this._logService.error(ehc.ErrorUtils.fromUnknown(e),"Error on conversation request"),this._telemetryService.sendGHTelemetryException(e,"Error on conversation request");let u=l.getUserMessageForFetcherError(e),d=(0,Vkr.collectSingleLineErrorMessage)(e,!0),f=this.scrubErrorDetail(d,o);if(l.isInternetDisconnectedError(e))return{type:Wn.ChatFetchResponseType.NetworkError,reason:"It appears you're not connected to the internet, please check your network connection and try again.",reasonDetail:f,requestId:r,serverRequestId:n};if(l.isFetcherError(e)){let h=l.isNetworkProcessCrashedError(e);return{type:Wn.ChatFetchResponseType.NetworkError,reason:u,reasonDetail:f,requestId:r,serverRequestId:n,...h?{isNetworkProcessCrash:!0}:{}}}else return{type:Wn.ChatFetchResponseType.Failed,reason:"Error on conversation request. Check the log for more details.",reasonDetail:f,requestId:r,serverRequestId:n}}async _handleWebSocketCAPIError(e,r){let{code:n,message:o}=e.error,s={code:n,message:o},c=n.split(":")[0];return this._logService.error(`WebSocket CAPI error: ${o} (${n})`),c==="rate_limited"||c==="user_model_rate_limited"||c==="user_global_rate_limited"||c==="integration_rate_limited"||c==="model_overloaded"||c==="agent_mode_limit_exceeded"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.RateLimited,reason:o,data:{capiError:s}}:c==="quota_exceeded"||c==="free_quota_exceeded"||c==="overage_limit_reached"||c==="billing_not_configured"||c==="additional_spend_limit_reached"?(this._authenticationService.copilotToken?.isChatQuotaExceeded||(this._authenticationService.resetCopilotToken(402),await this._authenticationService.getCopilotToken()),{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.QuotaExceeded,reason:o,data:{capiError:s}}):n==="content_filter"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ContentFilter,reason:o}:n==="not_found"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.NotFound,reason:o}:n==="request_too_large"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:n==="service_unavailable"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o}`}:n==="bad_request"?{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.Unknown,reason:`Request Failed: ${n} ${o}`}:{type:fn.FetchResponseKind.Failed,modelRequestId:r,failKind:fn.ChatFailKind.ServerError,reason:`Request Failed: ${n} ${o||"WebSocket server error"}`}}_handleWebSocketError(e,r,n,o){let{code:s,message:c}=e.error,l={code:s,message:c},u=s.split(":")[0];return u==="rate_limited"||u==="user_model_rate_limited"||u==="user_global_rate_limited"||u==="integration_rate_limited"||u==="model_overloaded"||u==="agent_mode_limit_exceeded"?{type:Wn.ChatFetchResponseType.RateLimited,reason:c,requestId:r,serverRequestId:n,retryAfter:void 0,rateLimitKey:"",isAuto:o,capiError:l}:u==="quota_exceeded"||u==="free_quota_exceeded"||u==="overage_limit_reached"||u==="billing_not_configured"||u==="additional_spend_limit_reached"?{type:Wn.ChatFetchResponseType.QuotaExceeded,reason:c,requestId:r,serverRequestId:n,capiError:l,retryAfter:void 0}:s==="content_filter"?{type:Wn.ChatFetchResponseType.PromptFiltered,reason:c,category:GT.FilterReason.Prompt,requestId:r,serverRequestId:n}:s==="not_found"?{type:Wn.ChatFetchResponseType.NotFound,reason:c,requestId:r,serverRequestId:n}:s==="bad_request"?{type:Wn.ChatFetchResponseType.BadRequest,reason:c,requestId:r,serverRequestId:n}:{type:Wn.ChatFetchResponseType.Failed,reason:`Request Failed: ${s} ${c||"WebSocket server error"}`,requestId:r,serverRequestId:n}}scrubErrorDetail(e,r){if(r){let n=new RegExp((0,nhc.escapeRegExpCharacters)(r),"ig");e=e.replaceAll(n,"")}return e.replaceAll(/(?<=logged in as )(?!)[^\s]+/ig,"!!")}};$T.ChatMLFetcherImpl=zkr;$T.ChatMLFetcherImpl=zkr=$kr=Qpc([bv(0,Ypc.IFetcherService),bv(1,Wkr.ITelemetryService),bv(2,Jpc.IRequestLogger),bv(3,Vkr.ILogService),bv(4,jpc.IAuthenticationService),bv(5,Vpc.IInteractionService),bv(6,Gpc.IChatQuotaService),bv(7,Wpc.ICAPIClientService),bv(8,$pc.IConversationOptions),bv(9,l$.IConfigurationService),bv(10,Zpc.IExperimentationService),bv(11,shc.IPowerService),bv(12,ihc.IInstantiationService),bv(13,J4i.IChatWebSocketManager),bv(14,Kpc.IOTelService)],zkr);function ahc(t,e,r,n,o){if(t.length===0)return{isValid:!1,reason:Gkr("No messages provided")};if(e?.max_tokens&&e?.max_tokens<1)return{isValid:!1,reason:Gkr("Invalid response token parameter")};let s=/^[a-zA-Z0-9_-]+$/;return e?.functions?.some(c=>!c.name.match(s))||e?.function_call?.name&&!e.function_call.name.match(s)?{isValid:!1,reason:Gkr("Function names must match ^[a-zA-Z0-9_-]+$")}:e?.tools&&e.tools.length>l$.HARD_TOOL_LIMIT&&!r.supportsToolSearch?{isValid:!1,reason:`Tool limit exceeded (${e.tools.length}/${l$.HARD_TOOL_LIMIT}). Click "Configure Tools" in the chat input to disable ${e.tools.length-l$.HARD_TOOL_LIMIT} tools and retry.`}:{isValid:!0,reason:""}}a(ahc,"isValidChatPayload");function Gkr(t){return`Prompt failed validation with the reason: ${t}. Please file an issue.`}a(Gkr,"asUnexpected");function Z4i(t,e,r){return rAe.TelemetryData.createAndMarkAsIssued({endpoint:"completions",engineName:"chat",uiKind:Wn.ChatLocation.toString(e),headerRequestId:r})}a(Z4i,"createTelemetryData");function YEt(t){switch(t){case Wn.ChatLocation.Panel:return"conversation-panel";case Wn.ChatLocation.Editor:return"conversation-inline";case Wn.ChatLocation.EditingSession:return"conversation-edits";case Wn.ChatLocation.Notebook:return"conversation-notebook";case Wn.ChatLocation.Terminal:return"conversation-terminal";case Wn.ChatLocation.Other:return"conversation-other";case Wn.ChatLocation.Agent:return"conversation-agent";case Wn.ChatLocation.ResponsesProxy:return"responses-proxy";case Wn.ChatLocation.MessagesProxy:return"messages-proxy"}}a(YEt,"locationToIntent");function chc(t){let e={};for(let r of["tool_choice","reasoning","reasoning_effort","thinking","thinking_budget","output_config","response_format","text","truncation","context_management","frequency_penalty","presence_penalty","top_logprobs","logit_bias","store","stream","stream_options","prediction","seed","parallel_tool_calls","service_tier","metadata","verbosity","snippy","state","intent","intent_threshold","include"]){let n=t[r];n!==void 0&&(e[r]=n)}return Object.keys(e).length>0?e:void 0}a(chc,"pickCacheRelevantRequestOptions");function lhc(t){let e={};return Array.isArray(t.input)?(e.api="responses",e.inputItemCount=t.input.length,e.inputItemTypes=t.input.map(r=>{if(r&&typeof r=="object"){let n=r.type;if(typeof n=="string")return n}return"unknown"})):Array.isArray(t.messages)&&(e.api="messages",e.messageCount=t.messages.length),typeof t.previous_response_id=="string"&&(e.hasPreviousResponseId=!0),Object.keys(e).length>0?e:void 0}a(lhc,"pickRequestShapeMetadata")});var Kkr=I(nAe=>{"use strict";p();Object.defineProperty(nAe,"__esModule",{value:!0});nAe.NullSimilarFilesContextService=nAe.ISimilarFilesContextService=void 0;var uhc=tn();nAe.ISimilarFilesContextService=(0,uhc.createServiceIdentifier)("ISimilarFilesContextService");var Ykr=class{static{a(this,"NullSimilarFilesContextService")}async compute(){}async getSnippetsForPrompt(){}};nAe.NullSimilarFilesContextService=Ykr});var Jkr=I(JEt=>{"use strict";p();Object.defineProperty(JEt,"__esModule",{value:!0});JEt.IDiffService=void 0;var dhc=tn();JEt.IDiffService=(0,dhc.createServiceIdentifier)("IDiffService")});var eBi=I(Zkr=>{"use strict";p();Object.defineProperty(Zkr,"__esModule",{value:!0});Zkr.createProxyXtabEndpoint=mhc;var fhc=(yre(),ya(Are)),phc=Ice(),hhc=Mre();function mhc(t,e){let r={id:e??"copilot-nes-xtab",urlOrRequestMetadata:{type:fhc.RequestType.ProxyChatCompletions},name:"xtab-proxy",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-proxy",tokenizer:phc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}};return t.createInstance(hhc.ChatEndpoint,r)}a(mhc,"createProxyXtabEndpoint")});var Bre=I(ZEt=>{"use strict";p();Object.defineProperty(ZEt,"__esModule",{value:!0});ZEt.DocumentId=void 0;var ghc=R$e(),tBi=fA(),Ahc=Vu(),Xkr=class t{static{a(this,"DocumentId")}static{this._cache=new ghc.CachedFunction({getCacheKey:JSON.stringify},e=>new t(e.uri))}static create(e){return t._cache.get({uri:e})}constructor(e){this.uri=e,this._uri=Ahc.URI.parse(this.uri)}get path(){return this._uri.path}get fragment(){return this._uri.fragment}toString(){return this.uri}get baseName(){return(0,tBi.basename)(this.uri)}get extension(){return(0,tBi.extname)(this.uri)}toUri(){return this._uri}};ZEt.DocumentId=Xkr});var e2r=I(XEt=>{"use strict";p();Object.defineProperty(XEt,"__esModule",{value:!0});XEt.NextCursorLinePrediction=void 0;var rBi;(function(t){t.Jump="jump",t.OnlyWithEdit="onlyWithEdit"})(rBi||(XEt.NextCursorLinePrediction=rBi={}))});var e_t=I(u$=>{"use strict";p();Object.defineProperty(u$,"__esModule",{value:!0});u$.NullUndesiredModelsManager=u$.IUndesiredModelsManager=u$.IInlineEditsModelService=void 0;var nBi=tn(),yhc=_c();u$.IInlineEditsModelService=(0,nBi.createServiceIdentifier)("IInlineEditsModelService");u$.IUndesiredModelsManager=(0,nBi.createServiceIdentifier)("IUndesiredModelsManager");var t2r=class{static{a(this,"NullUndesiredModelsManager")}constructor(){this.onDidChange=yhc.Event.None}isUndesiredModelId(e){return!1}addUndesiredModelId(e){return Promise.resolve()}removeUndesiredModelId(e){return Promise.resolve()}};u$.NullUndesiredModelsManager=t2r});var iBi=I(h6=>{"use strict";p();Object.defineProperty(h6,"__esModule",{value:!0});h6.IgnoreWhitespaceOnlyChanges=h6.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges=void 0;h6.editWouldDeleteWhatWasJustInserted=Ehc;h6.editIsDeletion=i2r;h6.editWouldDeleteWhatWasJustInserted2=_hc;var r2r=class t{static{a(this,"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges")}static filterEdit(e,r){return r.filter(o=>!t._isWhitespaceOnlyChange(o,e.documentAfterEditsLines))}static _isWhitespaceOnlyChange(e,r){let n=e.lineRange.toOffsetRange().slice(r),o=e.newLines,s=o.length===0;if(s&&n.every(c=>c.trim()==="")||!s&&o.every(c=>c.trim()===""))return!0;if(n.length!==o.length)return!1;for(let c=0;c!t._isFormattingOnlyChange(e.documentAfterEditsLines,n))}static _isFormattingOnlyChange(e,r){let n=r.lineRange.toOffsetRange().slice(e).join("").replace(/\s/g,""),o=r.newLines.join("").replace(/\s/g,"");return n===o}};h6.IgnoreWhitespaceOnlyChanges=n2r;function Ehc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!i2r(r))return!1;for(let n=t.recentEdits.edits.length-1;n>=0;n--){let o=t.recentEdits.edits[n],s=r.tryRebase(o);if(!s)return!0;r=s}return!1}a(Ehc,"editWouldDeleteWhatWasJustInserted");function i2r(t){let e=t.replacements.reduce((n,o)=>n+o.replaceRange.length,0);return t.replacements.reduce((n,o)=>n+o.newText.length,0)===0&&e>0}a(i2r,"editIsDeletion");function _hc(t,e){let r=e.toEdit(t.documentAfterEdits);if(r=r.normalizeOnSource(t.documentAfterEdits.value),!i2r(r))return!1;let n=t.documentAfterEdits.value;for(let o=t.recentEdits.edits.length-1;o>=0;o--){let c=t.recentEdits.edits[o].inverse(n);if(c.equals(r))return!0;n=c.apply(n)}return!1}a(_hc,"editWouldDeleteWhatWasJustInserted2")});var s2r=I(iAe=>{"use strict";p();Object.defineProperty(iAe,"__esModule",{value:!0});iAe.NulSimulationTestContext=iAe.ISimulationTestContext=void 0;var vhc=tn();iAe.ISimulationTestContext=(0,vhc.createServiceIdentifier)("ISimulationTestContext");var o2r=class{static{a(this,"NulSimulationTestContext")}constructor(){this.isInSimulationTests=!1}async writeFile(e,r,n){return""}};iAe.NulSimulationTestContext=o2r});function Lre(t,e=!1){let r=t.length,n=0,o="",s=0,c=16,l=0,u=0,d=0,f=0,h=0;function m(b,T){let w=0,R=0;for(;w=48&&x<=57)R=R*16+x-48;else if(x>=65&&x<=70)R=R*16+x-65+10;else if(x>=97&&x<=102)R=R*16+x-97+10;else break;n++,w++}return w=r){b+=t.substring(T,n),h=2;break}let w=t.charCodeAt(n);if(w===34){b+=t.substring(T,n),n++;break}if(w===92){if(b+=t.substring(T,n),n++,n>=r){h=2;break}switch(t.charCodeAt(n++)){case 34:b+='"';break;case 92:b+="\\";break;case 47:b+="/";break;case 98:b+="\b";break;case 102:b+="\f";break;case 110:b+=` +`;break;case 114:b+="\r";break;case 116:b+=" ";break;case 117:let x=m(4,!0);x>=0?b+=String.fromCharCode(x):h=4;break;default:h=5}T=n;continue}if(w>=0&&w<=31)if(N4e(w)){b+=t.substring(T,n),h=2;break}else h=6;n++}return b}a(y,"scanString");function E(){if(o="",h=0,s=n,u=l,f=d,n>=r)return s=r,c=17;let b=t.charCodeAt(n);if(a2r(b)){do n++,o+=String.fromCharCode(b),b=t.charCodeAt(n);while(a2r(b));return c=15}if(N4e(b))return n++,o+=String.fromCharCode(b),b===13&&t.charCodeAt(n)===10&&(n++,o+=` +`),l++,d=n,c=14;switch(b){case 123:return n++,c=1;case 125:return n++,c=2;case 91:return n++,c=3;case 93:return n++,c=4;case 58:return n++,c=6;case 44:return n++,c=5;case 34:return n++,o=y(),c=10;case 47:let T=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n=12&&b<=15);return b}return a(v,"scanNextNonTrivia"),{setPosition:g,getPosition:a(()=>n,"getPosition"),scan:e?v:E,getToken:a(()=>c,"getToken"),getTokenValue:a(()=>o,"getTokenValue"),getTokenOffset:a(()=>s,"getTokenOffset"),getTokenLength:a(()=>n-s,"getTokenLength"),getTokenStartLine:a(()=>u,"getTokenStartLine"),getTokenStartCharacter:a(()=>s-f,"getTokenStartCharacter"),getTokenError:a(()=>h,"getTokenError")}}function a2r(t){return t===32||t===9}function N4e(t){return t===10||t===13}function oAe(t){return t>=48&&t<=57}var oBi,t_t=_e(()=>{"use strict";p();a(Lre,"createScanner");a(a2r,"isWhiteSpace");a(N4e,"isLineBreak");a(oAe,"isDigit");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(oBi||(oBi={}))});var VT,sAe,c2r,sBi,aBi=_e(()=>{p();VT=new Array(20).fill(0).map((t,e)=>" ".repeat(e)),sAe=200,c2r={" ":{"\n":new Array(sAe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(sAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(sAe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}," ":{"\n":new Array(sAe).fill(0).map((t,e)=>` +`+" ".repeat(e)),"\r":new Array(sAe).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":new Array(sAe).fill(0).map((t,e)=>`\r +`+" ".repeat(e))}},sBi=[` `,"\r",`\r -`]});function g_t(t,e,r){let n,o,s,c,l;if(e){for(c=e.offset,l=c+e.length,s=c;s>0&&!W4e(t,s-1);)s--;let w=l;for(;w1)return AAe(u,f)+AAe(m,n+h);let w=m.length*(n+h);return!d||w>I2r[g][u].length?u+AAe(m,n+h):w<=0?u:I2r[g][u][w]}a(E,"newLinesAndIndent");function _(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(AAe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?KT[m.length*n]:AAe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",k=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(KT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,k=R===12,x=k?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=KT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=KT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=KT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=KT[1];break;case 12:x=E();break;case 13:f>0?x=E():k||(x=KT[1]);break;case 6:r.keepLines&&f>0?x=E():k||(x=KT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!k&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!k?x=KT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function AAe(t,e){let r="";for(let n=0;n0&&!M4e(t,s-1);)s--;let w=l;for(;w1)return aAe(u,f)+aAe(m,n+h);let w=m.length*(n+h);return!d||w>c2r[g][u].length?u+aAe(m,n+h):w<=0?u:c2r[g][u][w]}a(E,"newLinesAndIndent");function _(){let w=A.scan();for(f=0;w===15||w===14;)w===14&&r.keepLines?f+=1:w===14&&(f=1),w=A.scan();return y=w===16||A.getTokenError()!==0,w}a(_,"scanNext");let v=[];function b(w,R,x){!y&&(!e||Rc)&&t.substring(R,x)!==w&&v.push({offset:R,length:x-R,content:w})}a(b,"addEdit");let T=_();if(r.keepLines&&f>0&&b(aAe(u,f),0,0),T!==17){let w=A.getTokenOffset()+s,R=m.length*n<20&&r.insertSpaces?VT[m.length*n]:aAe(m,n);b(R,s,w)}for(;T!==17;){let w=A.getTokenOffset()+A.getTokenLength()+s,R=_(),x="",P=!1;for(;f===0&&(R===12||R===13);){let N=A.getTokenOffset()+s;b(VT[1],w,N),w=A.getTokenOffset()+A.getTokenLength()+s,P=R===12,x=P?E():"",R=_()}if(R===2)T!==1&&h--,r.keepLines&&f>0||!r.keepLines&&T!==1?x=E():r.keepLines&&(x=VT[1]);else if(R===4)T!==3&&h--,r.keepLines&&f>0||!r.keepLines&&T!==3?x=E():r.keepLines&&(x=VT[1]);else{switch(T){case 3:case 1:h++,r.keepLines&&f>0||!r.keepLines?x=E():x=VT[1];break;case 5:r.keepLines&&f>0||!r.keepLines?x=E():x=VT[1];break;case 12:x=E();break;case 13:f>0?x=E():P||(x=VT[1]);break;case 6:r.keepLines&&f>0?x=E():P||(x=VT[1]);break;case 10:r.keepLines&&f>0?x=E():R===6&&!P&&(x="");break;case 7:case 8:case 9:case 11:case 2:case 4:r.keepLines&&f>0?x=E():(R===12||R===13)&&!P?x=VT[1]:R!==5&&R!==17&&(y=!0);break;case 16:y=!0;break}f>0&&(R===12||R===13)&&(x=E())}R===17&&(r.keepLines&&f>0?x=E():x=r.insertFinalNewline?u:"");let D=A.getTokenOffset()+s;b(x,w,D),T=R}return v}function aAe(t,e){let r="";for(let n=0;n{"use strict";p();m_t();pBi();a(g_t,"format");a(AAe,"repeat");a(gmc,"computeIndentLevel");a(Amc,"getEOL");a(W4e,"isEOL")});function hBi(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{K4e(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function y_t(t,e=[],r=z4e.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),K4e(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:ABi(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function Y4e(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function w2r(t){if(!t.parent||!t.parent.children)return[];let e=w2r(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function A_t(t){switch(t.type){case"array":return t.children.map(A_t);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=A_t(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Emc(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,O=[],q=[]){if(b(M),O.length+q.length>0){let F=n.getToken();for(;F!==17;){if(O.indexOf(F)!==-1){R();break}else if(q.indexOf(F)!==-1)break;F=R()}}}a(x,"handleError");function k(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(k,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(k(!1),n.getToken()===6?(_(":"),R(),Q()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function L(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(L,"parseObject");function B(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,Q()||x(4,[],[4,5]),O=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(B,"parseArray");function Q(){switch(n.getToken()){case 3:return B();case 1:return L();case 10:return k(!0);default:return D()}}return a(Q,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):Q()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function gBi(t,e){let r=Gre(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function ABi(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var z4e,k2r=me(()=>{"use strict";p();m_t();(function(t){t.DEFAULT={allowTrailingComma:!1}})(z4e||(z4e={}));a(hBi,"getLocation");a(mBi,"parse");a(y_t,"parseTree");a(Y4e,"findNodeAtLocation");a(w2r,"getNodePath");a(A_t,"getNodeValue");a(Emc,"contains");a(R2r,"findNodeAtOffset");a(K4e,"visit");a(gBi,"stripComments");a(ABi,"getNodeType")});function yBi(t,e,r,n){let o=e.slice(),c=y_t(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=Y4e(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=Y4e(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return $re(t,{offset:h,length:m-h,content:""},n)}else return $re(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return $re(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return $re(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return $re(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return $re(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return $re(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function $re(t,e,r){if(!r.formattingOptions)return[e];let n=E_t(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!W4e(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=E_t(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function E_t(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var EBi=me(()=>{"use strict";p();x2r();k2r();a(yBi,"setProperty");a($re,"withFormatting");a(E_t,"applyEdit")});var _Bi={};wi(_Bi,{ParseErrorCode:()=>N2r,ScanError:()=>P2r,SyntaxKind:()=>D2r,applyEdits:()=>Omc,createScanner:()=>vmc,findNodeAtLocation:()=>Imc,findNodeAtOffset:()=>xmc,format:()=>Nmc,getLocation:()=>bmc,getNodePath:()=>wmc,getNodeValue:()=>Rmc,modify:()=>Mmc,parse:()=>Smc,parseTree:()=>Tmc,printParseErrorCode:()=>Dmc,stripComments:()=>Pmc,visit:()=>kmc});function Dmc(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function Nmc(t,e,r){return g_t(t,e,r)}function Mmc(t,e,r,n){return yBi(t,e,r,n)}function Omc(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=E_t(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var vmc,P2r,D2r,bmc,Smc,Tmc,Imc,xmc,wmc,Rmc,kmc,Pmc,N2r,CBi=me(()=>{"use strict";p();x2r();EBi();m_t();k2r();vmc=Gre;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(P2r||(P2r={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(D2r||(D2r={}));bmc=hBi,Smc=mBi,Tmc=y_t,Imc=Y4e,xmc=R2r,wmc=w2r,Rmc=A_t,kmc=K4e,Pmc=gBi;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(N2r||(N2r={}));a(Dmc,"printParseErrorCode");a(Nmc,"format");a(Mmc,"modify");a(Omc,"applyEdits")});var C_t=I(__t=>{"use strict";p();Object.defineProperty(__t,"__esModule",{value:!0});__t.BaseAlternativeNotebookContentProvider=void 0;var M2r=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};__t.BaseAlternativeNotebookContentProvider=M2r});var B2r=I(BD=>{"use strict";p();Object.defineProperty(BD,"__esModule",{value:!0});BD.DEFAULT_WORD_REGEXP=BD.USUAL_WORD_SEPARATORS=void 0;BD.ensureValidWordDefinition=vBi;BD.setDefaultGetWordAtTextConfig=Qmc;BD.getWordAtText=bBi;var Bmc=cQt(),Lmc=ko(),Fmc=Ele();BD.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Umc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of BD.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Umc,"createWordRegExp");BD.DEFAULT_WORD_REGEXP=Umc();function vBi(t){let e=BD.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(vBi,"ensureValidWordDefinition");var O2r=new Fmc.LinkedList;O2r.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Qmc(t){let e=O2r.unshift(t);return(0,Lmc.toDisposable)(e)}a(Qmc,"setDefaultGetWordAtTextConfig");function bBi(t,e,r,n,o){if(e=vBi(e),o||(o=Bmc.Iterable.first(O2r)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),bBi(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=qmc(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a(bBi,"getWordAtText");function qmc(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(qmc,"_findRegexMatchEnclosingPosition")});var SBi=I(v_t=>{"use strict";p();Object.defineProperty(v_t,"__esModule",{value:!0});v_t.toUint8=jmc;v_t.toUint32=Hmc;function jmc(t){return t<0?0:t>255?255:t|0}a(jmc,"toUint8");function Hmc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Hmc,"toUint32")});var TBi=I(v$=>{"use strict";p();Object.defineProperty(v$,"__esModule",{value:!0});v$.PrefixSumIndexOfResult=v$.ConstantTimePrefixSumComputer=v$.PrefixSumComputer=void 0;var Gmc=El(),yAe=SBi(),L2r=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,yAe.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,yAe.toUint32)(e),r=(0,yAe.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,yAe.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new EAe(o,e-c)}};v$.PrefixSumComputer=L2r;var F2r=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new EAe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new EAe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,Gmc.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};v$.ConstantTimePrefixSumComputer=F2r;var EAe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};v$.PrefixSumIndexOfResult=EAe});var Q2r=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.PositionOffsetTransformer=void 0;var IBi=Gh(),xBi=gE(),$mc=sd(),Vmc=TBi(),Vre=mm(),U2r=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,IBi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r +`}function M4e(t,e){return`\r +`.indexOf(t.charAt(e))!==-1}var l2r=_e(()=>{"use strict";p();t_t();aBi();a(r_t,"format");a(aAe,"repeat");a(bhc,"computeIndentLevel");a(Shc,"getEOL");a(M4e,"isEOL")});function cBi(t,e){let r=[],n=new Object,o,s={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function l(u,d,f,h){s.value=u,s.offset=d,s.length=f,s.type=h,s.colonOffset=void 0,o=s}a(l,"setPreviousNode");try{L4e(t,{onObjectBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,c=e>u,r.push("")},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{if(e{if(e<=u)throw n;o=void 0,r.pop()},"onObjectEnd"),onArrayBegin:a((u,d)=>{if(e<=u)throw n;o=void 0,r.push(0)},"onArrayBegin"),onArrayEnd:a((u,d)=>{if(e<=u)throw n;o=void 0,r.pop()},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{if(e{if(e<=d)throw n;if(u===":"&&o&&o.type==="property")o.colonOffset=d,c=!1,o=void 0;else if(u===","){let h=r[r.length-1];typeof h=="number"?r[r.length-1]=h+1:(c=!0,r[r.length-1]=""),o=void 0}},"onSeparator")})}catch(u){if(u!==n)throw u}return{path:r,previousNode:o,isAtPropertyKey:c,matches:a(u=>{let d=0;for(let f=0;d{let u={};c(u),s.push(o),o=u,n=null},"onObjectBegin"),onObjectProperty:a(u=>{n=u},"onObjectProperty"),onObjectEnd:a(()=>{o=s.pop()},"onObjectEnd"),onArrayBegin:a(()=>{let u=[];c(u),s.push(o),o=u,n=null},"onArrayBegin"),onArrayEnd:a(()=>{o=s.pop()},"onArrayEnd"),onLiteralValue:c,onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r),o[0]}function i_t(t,e=[],r=O4e.DEFAULT){let n={type:"array",offset:-1,length:-1,children:[],parent:void 0};function o(u){n.type==="property"&&(n.length=u-n.offset,n=n.parent)}a(o,"ensurePropertyComplete");function s(u){return n.children.push(u),u}a(s,"onValue"),L4e(t,{onObjectBegin:a(u=>{n=s({type:"object",offset:u,length:-1,parent:n,children:[]})},"onObjectBegin"),onObjectProperty:a((u,d,f)=>{n=s({type:"property",offset:d,length:-1,parent:n,children:[]}),n.children.push({type:"string",value:u,offset:d,length:f,parent:n})},"onObjectProperty"),onObjectEnd:a((u,d)=>{o(u+d),n.length=u+d-n.offset,n=n.parent,o(u+d)},"onObjectEnd"),onArrayBegin:a((u,d)=>{n=s({type:"array",offset:u,length:-1,parent:n,children:[]})},"onArrayBegin"),onArrayEnd:a((u,d)=>{n.length=u+d-n.offset,n=n.parent,o(u+d)},"onArrayEnd"),onLiteralValue:a((u,d,f)=>{s({type:dBi(u),offset:d,length:f,parent:n,value:u}),o(d+f)},"onLiteralValue"),onSeparator:a((u,d,f)=>{n.type==="property"&&(u===":"?n.colonOffset=d:u===","&&o(d))},"onSeparator"),onError:a((u,d,f)=>{e.push({error:u,offset:d,length:f})},"onError")},r);let l=n.children[0];return l&&delete l.parent,l}function B4e(t,e){if(!t)return;let r=t;for(let n of e)if(typeof n=="string"){if(r.type!=="object"||!Array.isArray(r.children))return;let o=!1;for(let s of r.children)if(Array.isArray(s.children)&&s.children[0].value===n&&s.children.length===2){r=s.children[1],o=!0;break}if(!o)return}else{let o=n;if(r.type!=="array"||o<0||!Array.isArray(r.children)||o>=r.children.length)return;r=r.children[o]}return r}function u2r(t){if(!t.parent||!t.parent.children)return[];let e=u2r(t.parent);if(t.parent.type==="property"){let r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){let r=t.parent.children.indexOf(t);r!==-1&&e.push(r)}return e}function n_t(t){switch(t.type){case"array":return t.children.map(n_t);case"object":let e=Object.create(null);for(let r of t.children){let n=r.children[1];n&&(e[r.children[0].value]=n_t(n))}return e;case"null":case"string":case"number":case"boolean":return t.value;default:return}}function Ihc(t,e,r=!1){return e>=t.offset&&es===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(c,"toNoArgVisit");function l(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}a(l,"toOneArgVisit");function u(M){return M?O=>s===0&&M(O,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}a(u,"toOneArgVisitWithPath");function d(M){return M?()=>{s>0?s++:M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(s=1)}:()=>!0}a(d,"toBeginVisit");function f(M){return M?()=>{s>0&&s--,s===0&&M(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}a(f,"toEndVisit");let h=d(e.onObjectBegin),m=u(e.onObjectProperty),g=f(e.onObjectEnd),A=d(e.onArrayBegin),y=f(e.onArrayEnd),E=u(e.onLiteralValue),_=l(e.onSeparator),v=c(e.onComment),b=l(e.onError),T=r&&r.disallowComments,w=r&&r.allowTrailingComma;function R(){for(;;){let M=n.scan();switch(n.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:T||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(M){case 12:case 13:T?x(10):v();break;case 16:x(1);break;case 15:case 14:break;default:return M}}}a(R,"scanNext");function x(M,O=[],q=[]){if(b(M),O.length+q.length>0){let Q=n.getToken();for(;Q!==17;){if(O.indexOf(Q)!==-1){R();break}else if(q.indexOf(Q)!==-1)break;Q=R()}}}a(x,"handleError");function P(M){let O=n.getTokenValue();return M?E(O):(m(O),o.push(O)),R(),!0}a(P,"parseString");function D(){switch(n.getToken()){case 11:let M=n.getTokenValue(),O=Number(M);isNaN(O)&&(x(2),O=0),E(O);break;case 7:E(null);break;case 8:E(!0);break;case 9:E(!1);break;default:return!1}return R(),!0}a(D,"parseLiteral");function N(){return n.getToken()!==10?(x(3,[],[2,5]),!1):(P(!1),n.getToken()===6?(_(":"),R(),j()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}a(N,"parseProperty");function B(){h(),R();let M=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(M||x(4,[],[]),_(","),R(),n.getToken()===2&&w)break}else M&&x(6,[],[]);N()||x(4,[],[2,5]),M=!0}return g(),n.getToken()!==2?x(7,[2],[]):R(),!0}a(B,"parseObject");function L(){A(),R();let M=!0,O=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(O||x(4,[],[]),_(","),R(),n.getToken()===4&&w)break}else O&&x(6,[],[]);M?(o.push(0),M=!1):o[o.length-1]++,j()||x(4,[],[4,5]),O=!0}return y(),M||o.pop(),n.getToken()!==4?x(8,[4],[]):R(),!0}a(L,"parseArray");function j(){switch(n.getToken()){case 3:return L();case 1:return B();case 10:return P(!0);default:return D()}}return a(j,"parseValue"),R(),n.getToken()===17?r.allowEmptyContent?!0:(x(4,[],[]),!1):j()?(n.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function uBi(t,e){let r=Lre(t),n=[],o,s=0,c;do switch(c=r.getPosition(),o=r.scan(),o){case 12:case 13:case 17:s!==c&&n.push(t.substring(s,c)),e!==void 0&&n.push(r.getTokenValue().replace(/[^\r\n]/g,e)),s=r.getPosition();break}while(o!==17);return n.join("")}function dBi(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}var O4e,f2r=_e(()=>{"use strict";p();t_t();(function(t){t.DEFAULT={allowTrailingComma:!1}})(O4e||(O4e={}));a(cBi,"getLocation");a(lBi,"parse");a(i_t,"parseTree");a(B4e,"findNodeAtLocation");a(u2r,"getNodePath");a(n_t,"getNodeValue");a(Ihc,"contains");a(d2r,"findNodeAtOffset");a(L4e,"visit");a(uBi,"stripComments");a(dBi,"getNodeType")});function fBi(t,e,r,n){let o=e.slice(),c=i_t(t,[]),l,u;for(;o.length>0&&(u=o.pop(),l=B4e(c,o),l===void 0&&r!==void 0);)typeof u=="string"?r={[u]:r}:r=[r];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){let d=B4e(l,[u]);if(d!==void 0)if(r===void 0){if(!d.parent)throw new Error("Malformed AST");let f=l.children.indexOf(d.parent),h,m=d.parent.offset+d.parent.length;if(f>0){let g=l.children[f-1];h=g.offset+g.length}else h=l.offset+1,l.children.length>1&&(m=l.children[1].offset);return Fre(t,{offset:h,length:m-h,content:""},n)}else return Fre(t,{offset:d.offset,length:d.length,content:JSON.stringify(r)},n);else{if(r===void 0)return[];let f=`${JSON.stringify(u)}: ${JSON.stringify(r)}`,h=n.getInsertionIndex?n.getInsertionIndex(l.children.map(g=>g.children[0].value)):l.children.length,m;if(h>0){let g=l.children[h-1];m={offset:g.offset+g.length,length:0,content:","+f}}else l.children.length===0?m={offset:l.offset+1,length:0,content:f}:m={offset:l.offset+1,length:0,content:f+","};return Fre(t,m,n)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){let d=u;if(d===-1){let f=`${JSON.stringify(r)}`,h;if(l.children.length===0)h={offset:l.offset+1,length:0,content:f};else{let m=l.children[l.children.length-1];h={offset:m.offset+m.length,length:0,content:","+f}}return Fre(t,h,n)}else if(r===void 0&&l.children.length>=0){let f=u,h=l.children[f],m;if(l.children.length===1)m={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===f){let g=l.children[f-1],A=g.offset+g.length,y=l.offset+l.length;m={offset:A,length:y-2-A,content:""}}else m={offset:h.offset,length:l.children[f+1].offset-h.offset,content:""};return Fre(t,m,n)}else if(r!==void 0){let f,h=`${JSON.stringify(r)}`;if(!n.isArrayInsertion&&l.children.length>u){let m=l.children[u];f={offset:m.offset,length:m.length,content:h}}else if(l.children.length===0||u===0)f={offset:l.offset+1,length:0,content:l.children.length===0?h:h+","};else{let m=u>l.children.length?l.children.length:u,g=l.children[m-1];f={offset:g.offset+g.length,length:0,content:","+h}}return Fre(t,f,n)}else throw new Error(`Can not ${r===void 0?"remove":n.isArrayInsertion?"insert":"modify"} Array index ${d} as length is not sufficient`)}else throw new Error(`Can not add ${typeof u!="number"?"index":"property"} to parent of type ${l.type}`);else{if(r===void 0)throw new Error("Can not delete in empty document");return Fre(t,{offset:c?c.offset:0,length:c?c.length:0,content:JSON.stringify(r)},n)}}function Fre(t,e,r){if(!r.formattingOptions)return[e];let n=o_t(t,e),o=e.offset,s=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;o>0&&!M4e(n,o-1);)o--;for(;s=0;u--){let d=c[u];n=o_t(n,d),o=Math.min(o,d.offset),s=Math.max(s,d.offset+d.length),s+=d.content.length-d.length}let l=t.length-(n.length-s)-o;return[{offset:o,length:l,content:n.substring(o,s)}]}function o_t(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}var pBi=_e(()=>{"use strict";p();l2r();f2r();a(fBi,"setProperty");a(Fre,"withFormatting");a(o_t,"applyEdit")});var hBi={};xi(hBi,{ParseErrorCode:()=>m2r,ScanError:()=>p2r,SyntaxKind:()=>h2r,applyEdits:()=>jhc,createScanner:()=>Rhc,findNodeAtLocation:()=>Nhc,findNodeAtOffset:()=>Mhc,format:()=>Qhc,getLocation:()=>Phc,getNodePath:()=>Ohc,getNodeValue:()=>Bhc,modify:()=>qhc,parse:()=>khc,parseTree:()=>Dhc,printParseErrorCode:()=>Uhc,stripComments:()=>Fhc,visit:()=>Lhc});function Uhc(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return""}function Qhc(t,e,r){return r_t(t,e,r)}function qhc(t,e,r,n){return fBi(t,e,r,n)}function jhc(t,e){let r=e.slice(0).sort((o,s)=>{let c=o.offset-s.offset;return c===0?o.length-s.length:c}),n=t.length;for(let o=r.length-1;o>=0;o--){let s=r[o];if(s.offset+s.length<=n)t=o_t(t,s);else throw new Error("Overlapping edit");n=s.offset}return t}var Rhc,p2r,h2r,Phc,khc,Dhc,Nhc,Mhc,Ohc,Bhc,Lhc,Fhc,m2r,mBi=_e(()=>{"use strict";p();l2r();pBi();t_t();f2r();Rhc=Lre;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(p2r||(p2r={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(h2r||(h2r={}));Phc=cBi,khc=lBi,Dhc=i_t,Nhc=B4e,Mhc=d2r,Ohc=u2r,Bhc=n_t,Lhc=L4e,Fhc=uBi;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(m2r||(m2r={}));a(Uhc,"printParseErrorCode");a(Qhc,"format");a(qhc,"modify");a(jhc,"applyEdits")});var a_t=I(s_t=>{"use strict";p();Object.defineProperty(s_t,"__esModule",{value:!0});s_t.BaseAlternativeNotebookContentProvider=void 0;var g2r=class{static{a(this,"BaseAlternativeNotebookContentProvider")}constructor(e){this.kind=e}};s_t.BaseAlternativeNotebookContentProvider=g2r});var y2r=I(ND=>{"use strict";p();Object.defineProperty(ND,"__esModule",{value:!0});ND.DEFAULT_WORD_REGEXP=ND.USUAL_WORD_SEPARATORS=void 0;ND.ensureValidWordDefinition=gBi;ND.setDefaultGetWordAtTextConfig=Whc;ND.getWordAtText=ABi;var Hhc=G3t(),Ghc=Io(),$hc=dce();ND.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Vhc(t=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(let r of ND.USUAL_WORD_SEPARATORS)t.indexOf(r)>=0||(e+="\\"+r);return e+="\\s]+)",new RegExp(e,"g")}a(Vhc,"createWordRegExp");ND.DEFAULT_WORD_REGEXP=Vhc();function gBi(t){let e=ND.DEFAULT_WORD_REGEXP;if(t&&t instanceof RegExp)if(t.global)e=t;else{let r="g";t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),e=new RegExp(t.source,r)}return e.lastIndex=0,e}a(gBi,"ensureValidWordDefinition");var A2r=new $hc.LinkedList;A2r.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Whc(t){let e=A2r.unshift(t);return(0,Ghc.toDisposable)(e)}a(Whc,"setDefaultGetWordAtTextConfig");function ABi(t,e,r,n,o){if(e=gBi(e),o||(o=Hhc.Iterable.first(A2r)),r.length>o.maxLen){let d=t-o.maxLen/2;return d<0?d=0:n+=d,r=r.substring(d,t+o.maxLen/2),ABi(t,e,r,n,o)}let s=Date.now(),c=t-1-n,l=-1,u=null;for(let d=1;!(Date.now()-s>=o.timeBudget);d++){let f=c-o.windowSize*d;e.lastIndex=Math.max(0,f);let h=zhc(e,r,c,l);if(!h&&u||(u=h,f<=0))break;l=f}if(u){let d={word:u[0],startColumn:n+1+u.index,endColumn:n+1+u.index+u[0].length};return e.lastIndex=0,d}return null}a(ABi,"getWordAtText");function zhc(t,e,r,n){let o;for(;o=t.exec(e);){let s=o.index||0;if(s<=r&&t.lastIndex>=r)return o;if(n>0&&s>n)return null}return null}a(zhc,"_findRegexMatchEnclosingPosition")});var yBi=I(c_t=>{"use strict";p();Object.defineProperty(c_t,"__esModule",{value:!0});c_t.toUint8=Yhc;c_t.toUint32=Khc;function Yhc(t){return t<0?0:t>255?255:t|0}a(Yhc,"toUint8");function Khc(t){return t<0?0:t>4294967295?4294967295:t|0}a(Khc,"toUint32")});var EBi=I(d$=>{"use strict";p();Object.defineProperty(d$,"__esModule",{value:!0});d$.PrefixSumIndexOfResult=d$.ConstantTimePrefixSumComputer=d$.PrefixSumComputer=void 0;var Jhc=ml(),cAe=yBi(),E2r=class{static{a(this,"PrefixSumComputer")}constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,r){e=(0,cAe.toUint32)(e);let n=this.values,o=this.prefixSum,s=r.length;return s===0?!1:(this.values=new Uint32Array(n.length+s),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+s),this.values.set(r,e),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,r){return e=(0,cAe.toUint32)(e),r=(0,cAe.toUint32)(r),this.values[e]===r?!1:(this.values[e]=r,e-1=n.length)return!1;let s=n.length-e;return r>=s&&(r=s),r===0?!1:(this.values=new Uint32Array(n.length-r),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+r),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(o.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=(0,cAe.toUint32)(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let r=this.prefixSumValidIndex[0]+1;r===0&&(this.prefixSum[0]=this.values[0],r++),e>=this.values.length&&(e=this.values.length-1);for(let n=r;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let r=0,n=this.values.length-1,o=0,s=0,c=0;for(;r<=n;)if(o=r+(n-r)/2|0,s=this.prefixSum[o],c=s-this.values[o],e=s)r=o+1;else break;return new lAe(o,e-c)}};d$.PrefixSumComputer=E2r;var _2r=class{static{a(this,"ConstantTimePrefixSumComputer")}constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let r=this._indexBySum[e];if(r===void 0){let o=Math.max(0,this._values.length-1),s=o>0?this._prefixSum[o-1]:0;return new lAe(o,e-s)}let n=r>0?this._prefixSum[r-1]:0;return new lAe(r,e-n)}removeValues(e,r){this._values.splice(e,r),this._invalidate(e)}insertValues(e,r){this._values=(0,Jhc.arrayInsert)(this._values,e,r),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,r=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=o+n;for(let s=0;s0?this._prefixSum[this._values.length-1]:0,this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,r){this._values[e]!==r&&(this._values[e]=r,this._invalidate(e))}};d$.ConstantTimePrefixSumComputer=_2r;var lAe=class{static{a(this,"PrefixSumIndexOfResult")}constructor(e,r){this.index=e,this.remainder=r,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=r}};d$.PrefixSumIndexOfResult=lAe});var C2r=I(l_t=>{"use strict";p();Object.defineProperty(l_t,"__esModule",{value:!0});l_t.PositionOffsetTransformer=void 0;var _Bi=Oh(),vBi=hE(),Zhc=sd(),Xhc=EBi(),Ure=Am(),v2r=class{static{a(this,"PositionOffsetTransformer")}constructor(e){this._lines=(0,_Bi.splitLines)(e),this._eol=e.charAt(this._lines[0].length)==="\r"?`\r `:` -`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,IBi.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew Vre.TextEdit(this.validateRange(n.range),n.newText));return new xBi.StringEdit(r.map(n=>new xBi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Vre.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Vre.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new Vre.Position(r,n):e}validateRange(e){return new Vre.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};b_t.PositionOffsetTransformer=U2r});var j2r=I(Wre=>{"use strict";p();Object.defineProperty(Wre,"__esModule",{value:!0});Wre.SnapshotDocumentLine=Wre.TextDocumentSnapshot=void 0;Wre.isTextDocumentSnapshotJSON=zmc;var S_t=BS(),RBi=Ku(),wBi=B2r(),_Ae=mm(),Wmc=Q2r();function zmc(t){return!t||typeof t!="object"?!1:(0,RBi.isUriComponents)(t.uri)&&(0,S_t.isString)(t._text)&&(0,S_t.isString)(t.languageId)&&(0,S_t.isNumber)(t.version)&&(0,S_t.isNumber)(t.eol)}a(zmc,"isTextDocumentSnapshotJSON");var q2r=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,RBi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new Wmc.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof _Ae.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new T_t(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,wBi.getWordAtText)(r.character+1,wBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new _Ae.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new _Ae.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new _Ae.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Wre.TextDocumentSnapshot=q2r;var T_t=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new _Ae.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new _Ae.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};Wre.SnapshotDocumentLine=T_t});var w_t=I(x_t=>{"use strict";p();Object.defineProperty(x_t,"__esModule",{value:!0});x_t.AlternativeNotebookDocument=void 0;var kBi=B2r(),I_t=mm(),Ymc=Q2r(),Kmc=j2r(),H2r=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new Ymc.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,kBi.getWordAtText)(r.character+1,kBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new I_t.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof I_t.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new Kmc.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new I_t.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new I_t.Position(r,n):e}};x_t.AlternativeNotebookDocument=H2r});var R_t=I(CAe=>{"use strict";p();Object.defineProperty(CAe,"__esModule",{value:!0});CAe.isUri=Zmc;CAe.isLocation=G2r;CAe.toLocation=Xmc;CAe.isSymbolInformation=egc;var J4e=mm(),Jmc=Ku();function Zmc(t){return Jmc.URI.isUri(t)}a(Zmc,"isUri");function G2r(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(G2r,"isLocation");function Xmc(t){if(G2r(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new J4e.Location(t.uri,new J4e.Range(new J4e.Position(e.line,e.character),new J4e.Position(r.line,r.character)))}else if(G2r(t)&&t.range instanceof J4e.Range)return t}a(Xmc,"toLocation");function egc(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(egc,"isSymbolInformation")});var eBe=I(iy=>{"use strict";p();Object.defineProperty(iy,"__esModule",{value:!0});iy.CellIdPatternRe=iy.EOL=iy.LineOfText=void 0;iy.summarize=rgc;iy.notebookCellToCellData=ngc;iy.getCellIdMap=igc;iy.normalizeCellId=ogc;iy.getNotebookId=sgc;iy.getCellId=W2r;iy.getDefaultLanguage=cgc;iy.requestHasNotebookRefs=ugc;iy.parseAndCleanStack=dgc;var PBi=R_t(),OBi=Gkr(),tgc=Gh(),DBi=Ku(),V2r=mm(),$2r=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};iy.LineOfText=$2r;iy.EOL=` -`;function rgc(t){let e=t.kind===V2r.NotebookCellKind.Code?"code":"markdown",r=W2r(t),n=agc(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(rgc,"summarize");function ngc(t){let e=new V2r.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a(ngc,"notebookCellToCellData");function igc(t){let e=new Map;return t.getCells().forEach(r=>{e.set(W2r(r),r)}),e}a(igc,"getCellIdMap");var NBi=new WeakMap,X4e=8,Z4e="#VSC-";iy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${X4e}})\\b`,"gi");function ogc(t){return t.startsWith(Z4e)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===X4e+3?`${Z4e}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===X4e+7?`${Z4e}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===X4e?`${Z4e}${t}`:t}a(ogc,"normalizeCellId");var MBi=new WeakMap;function sgc(t){let e=MBi.get(t);if(e)return e;let r=new OBi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),MBi.set(t,e),e}a(sgc,"getNotebookId");function W2r(t){let e=NBi.get(t);if(e)return e;let r=new OBi.StringSHA1;return r.update(t.document.uri.toString()),e=`${Z4e}${r.digest().substring(0,X4e)}`,NBi.set(t,e),e}a(W2r,"getCellId");function agc(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(agc,"getCellCode");function cgc(t){let e=t.getCells().find(r=>r.kind===V2r.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(cgc,"getDefaultLanguage");var lgc=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function ugc(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&lgc.some(o=>n.includes(o))?!0:t.references.some(o=>(0,PBi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,DBi.isUriComponents)(o.value)?e.hasSupportedNotebooks(DBi.URI.revive(o.value)):(0,PBi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(ugc,"requestHasNotebookRefs");function dgc(t){try{let e=JSON.parse(t);return(0,tgc.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(dgc,"parseAndCleanStack")});var FBi=I(tBe=>{"use strict";p();Object.defineProperty(tBe,"__esModule",{value:!0});tBe.AlternativeJsonNotebookContentProvider=void 0;tBe.isJsonContent=ggc;var fgc=(CBi(),Ca(_Bi)),pgc=Xc(),BBi=Ku(),LD=mm(),hgc=C_t(),mgc=w_t(),vAe=eBe(),LBi=4;function ggc(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(ggc,"isJsonContent");var k_t=class extends mgc.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,vAe.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new LD.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new LD.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},z2r=class extends hgc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new k_t(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==LD.NotebookCellKind.Markup:!0).map(c=>{let l=(0,vAe.summarize)(c),u=Agc(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,LBi);return new k_t(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,vAe.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,LBi).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(vAe.EOL)}parseAlternateContentImpl(e,r,n){return new pgc.AsyncIterableObject(async o=>{let s=BBi.URI.isUri(e)?new Map:(0,vAe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:LD.NotebookCellKind.Code,source:[]},f=BBi.URI.isUri(e)?"python":(0,vAe.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?LD.NotebookCellKind.Markup:LD.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,fgc.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=LD.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?LD.NotebookCellKind.Code:LD.NotebookCellKind.Markup,d.kind===LD.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=LD.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let k=typeof y=="string"?y:`${y||""}`;k.endsWith(` -`)&&(k=k.substr(0,k.length-1)),d.source.push(k)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};tBe.AlternativeJsonNotebookContentProvider=z2r;function Agc(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(Agc,"getCellCode")});var K2r=I(b$=>{"use strict";p();Object.defineProperty(b$,"__esModule",{value:!0});b$.wellKnownLanguages=void 0;b$.getLanguage=UBi;b$.getLanguageForResource=_gc;var ygc=xP(),Egc=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});b$.wellKnownLanguages=new Map(Object.entries(Egc).map(([t,e])=>[t,{languageId:t,...e}]));function UBi(t){return Y2r(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(UBi,"getLanguage");function Y2r(t){return b$.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(Y2r,"_getLanguage");function _gc(t){let e=(0,ygc.extname)(t).toLowerCase();for(let r of b$.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return UBi("plaintext")}a(_gc,"getLanguageForResource")});var jBi=I(S$=>{"use strict";p();Object.defineProperty(S$,"__esModule",{value:!0});S$.AlternativeTextNotebookContentProvider=void 0;S$.generateCellTextMarker=X2r;S$.lineMightHaveCellMarker=eDr;S$.getBlockComment=SAe;S$.getLineCommentStart=TAe;var Z2r=K2r(),Cgc=R_t(),vgc=ZQ(),bAe=mm(),bgc=C_t(),Sgc=w_t(),S0=eBe();function X2r(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(X2r,"generateCellTextMarker");function eDr(t){return t.toLowerCase().includes("vscode.cell")}a(eDr,"lineMightHaveCellMarker");var P_t=class extends Sgc.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,S0.summarize)(e),o=TAe(this.notebook),s=X2r(n,o),c=e.document.eol===bAe.EndOfLine.LF?1:2,l=SAe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===bAe.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,vgc.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},J2r=class extends bgc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(S0.EOL);return r.length&&eDr(r[0])?(r.shift(),r.join(S0.EOL)):e}getSummaryOfStructure(e,r,n){let o=SAe(e),s=TAe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,S0.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(QBi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(S0.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Cgc.isUri)(e),s=o?(0,S0.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=TAe(o?e:void 0),m=SAe(o?e:void 0),g=o?(0,Z2r.getLanguage)((0,S0.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?qBi(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:bAe.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?bAe.NotebookCellKind.Markup:bAe.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=SAe(r),o=TAe(r),s=(0,S0.getCellIdMap)(r),c=[],l=e.split(S0.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=S0.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+S0.EOL.length}return new P_t(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==bAe.NotebookCellKind.Markup:!0).map(d=>(0,S0.summarize)(d)),o=SAe(e),s=TAe(e),c=n.map(d=>({...QBi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(S0.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new P_t(l,u,e)}};S$.AlternativeTextNotebookContentProvider=J2r;function QBi(t,e,r){let n=X2r(t,e),o=t.source.join(S0.EOL),s=t.language==="markdown"?`${n}${S0.EOL}${r[0]}${S0.EOL}`:`${n}${S0.EOL}`;return{content:t.language==="markdown"?`${s}${o}${S0.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(QBi,"generateAlternativeCellTextContent");function SAe(t){return t?(0,Z2r.getLanguage)((0,S0.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(SAe,"getBlockComment");function TAe(t){return t&&(0,Z2r.getLanguage)((0,S0.getDefaultLanguage)(t)).lineComment.start||"#"}a(TAe,"getLineCommentStart");function qBi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:eDr(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(qBi,"extractCellParts")});var $Bi=I(iBe=>{"use strict";p();Object.defineProperty(iBe,"__esModule",{value:!0});iBe.AlternativeXmlNotebookContentProvider=void 0;iBe.isXmlContent=GBi;var Tgc=K2r(),Igc=R_t(),xgc=ZQ(),rBe=mm(),wgc=C_t(),Rgc=w_t(),OE=eBe(),nBe="`}a(tDr,"generateCellMarker");function GBi(t){return t.includes(nBe)||t.includes(T$)||t.includes(D_t)}a(GBi,"isXmlContent");var N_t=class extends Rgc.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,OE.summarize)(e),o=tDr(n),s=e.document.eol===rBe.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,xgc.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},rDr=class extends wgc.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(OE.EOL);return r.length&&(r[0].startsWith(nBe)||r[0].startsWith(D_t))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(T$)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(T$))),r.join(OE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,OE.summarize)(c);o.push(tDr(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(T$)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(OE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,Igc.isUri)(e),s=o?(0,OE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,Tgc.getLanguage)((0,OE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(nBe)||g.startsWith(D_t))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(T$)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:rBe.NotebookCellKind.Code},y=HBi(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?rBe.NotebookCellKind.Markup:rBe.NotebookCellKind.Code),yield A}else g.startsWith(T$)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(T$),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,OE.getCellIdMap)(r),o=[],s=e.split(OE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=OE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+OE.EOL.length}return new N_t(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==rBe.NotebookCellKind.Markup:!0).map(l=>(0,OE.summarize)(l)).map(l=>{let d=`${tDr(l)}${OE.EOL}`;return{content:`${d}${l.source.join(OE.EOL)}${OE.EOL}${T$}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(OE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new N_t(s,c,e)}};iBe.AlternativeXmlNotebookContentProvider=rDr;function HBi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(GBi(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(HBi,"extractCellParts")});var KBi=I(c1=>{"use strict";p();var Pgc=c1&&c1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},VBi=c1&&c1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(c1,"__esModule",{value:!0});c1.AlternativeNotebookContentService=c1.IAlternativeNotebookContentService=void 0;c1.getAlternativeNotebookDocumentProvider=iDr;c1.inferAlternativeNotebookContentFormat=Fgc;c1.getAltNotebookRange=Ugc;var Dgc=oEt(),Ngc=rn(),Mgc=mm(),WBi=Il(),Ogc=I4e(),Bgc=gp(),zBi=FBi(),Lgc=jBi(),YBi=$Bi();function iDr(t){switch(t){case"xml":return new YBi.AlternativeXmlNotebookContentProvider;case"text":return new Lgc.AlternativeTextNotebookContentProvider;case"json":return new zBi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(iDr,"getAlternativeNotebookDocumentProvider");function Fgc(t){return(0,YBi.isXmlContent)(t)?"xml":(0,zBi.isJsonContent)(t)?"json":"text"}a(Fgc,"inferAlternativeNotebookContentFormat");c1.IAlternativeNotebookContentService=(0,Ngc.createServiceIdentifier)("IAlternativeNotebookContentService");var nDr=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,Ogc.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(WBi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return iDr(e)}};c1.AlternativeNotebookContentService=nDr;c1.AlternativeNotebookContentService=nDr=Pgc([VBi(0,WBi.IConfigurationService),VBi(1,Bgc.IExperimentationService)],nDr);function Ugc(t,e,r,n){let o=(0,Dgc.findCell)(e,r);if(!o)return;let s=iDr(n).getAlternativeDocument(r);return new Mgc.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(Ugc,"getAltNotebookRange")});var ZBi=I(oBe=>{"use strict";p();Object.defineProperty(oBe,"__esModule",{value:!0});oBe.NotebookDocumentSnapshot=void 0;oBe.isNotebookDocumentSnapshotJSON=jgc;var M_t=BS(),Qgc=Ku(),oDr=mm(),JBi=KBi(),qgc=eBe();function jgc(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,Qgc.isUriComponents)(t.uri)&&(0,M_t.isString)(t._text)&&(0,M_t.isString)(t.languageId)&&(0,M_t.isNumber)(t.version)&&(0,M_t.isString)(t.alternativeFormat)}a(jgc,"isNotebookDocumentSnapshotJSON");var sDr=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,JBi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,JBi.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,qgc.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new oDr.Selection(0,0,this.lineCount,0)}getWholeRange(){return new oDr.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof oDr.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};oBe.NotebookDocumentSnapshot=sDr});var cDr=I(xC=>{"use strict";p();var Hgc=xC&&xC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Ggc=xC&&xC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$gc=xC&&xC.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,XBi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return Zgc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,Vgc.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return Jgc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>XBi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};xC.AbstractWorkspaceService=O_t;function Xgc(t,e){let r=t.getWorkspaceFolder(e);return r?Ygc.posix.relative(r.path,e.path):e.path}a(Xgc,"getWorkspaceFileDisplayPath");var aDr=class extends O_t{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new zgc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new I$.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new I$.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new I$.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};xC.NullWorkspaceService=aDr});var fDr=I(zre=>{"use strict";p();Object.defineProperty(zre,"__esModule",{value:!0});zre.BatchedProcessor=zre.TaskQueue=void 0;zre.raceFilter=eAc;var lDr=Xc(),eLi=Ts(),uDr=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new lDr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new lDr.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new eLi.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new eLi.CancellationError)}};zre.TaskQueue=uDr;var dDr=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new lDr.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};zre.BatchedProcessor=dDr;function eAc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(eAc,"raceFilter")});var pDr=I(IAe=>{"use strict";p();Object.defineProperty(IAe,"__esModule",{value:!0});IAe.AsyncIterUtilsExt=IAe.AsyncIterUtils=void 0;var tLi;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})(tLi||(IAe.AsyncIterUtils=tLi={}));var rLi;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(rLi||(IAe.AsyncIterUtilsExt=rLi={}))});var mDr=I(hDr=>{"use strict";p();Object.defineProperty(hDr,"__esModule",{value:!0});hDr.backwardCompatSetting=tAc;function tAc(t,e){return e(t)}a(tAc,"backwardCompatSetting")});var iLi=I(JT=>{"use strict";p();Object.defineProperty(JT,"__esModule",{value:!0});JT.LineWithTokens=JT.Token=void 0;JT.getOrDeduceSelectionFromLastEdit=nAc;JT.clipTokensToRange=nLi;JT.clipTokensToRangeAndAdjustOffsets=oAc;JT.removeTokensInRangeAndAdjustOffsets=sAc;JT.getTokensFromLogProbs=aAc;JT.getTokensFromLinesWithTokens=cAc;JT.mergeOffsetRangesAtDistance=lAc;var rAc=Ts(),xAe=sd();function nAc(t){let e=new xAe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):iAc(t)}a(nAc,"getOrDeduceSelectionFromLastEdit");function iAc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new xAe.OffsetRange(c,c))}a(iAc,"deduceSelectionFromLastEdit");var B_t=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new xAe.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};JT.Token=B_t;function nLi(t,e){return t.filter(r=>e.intersects(r.range))}a(nLi,"clipTokensToRange");function oAc(t,e){return nLi(t,e).map(r=>r.deltaOffset(-e.start))}a(oAc,"clipTokensToRangeAndAdjustOffsets");function sAc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(sAc,"removeTokensInRangeAndAdjustOffsets");function aAc(t,e){let r=e;return t.content.map(n=>{let o=new B_t(n.token,n.logprob,r);return r+=o.range.length,o})}a(aAc,"getTokensFromLogProbs");var gDr=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r +`;let r=new Uint32Array(this._lines.length);for(let n=0;n=0;n--){let o=r[n],s=this.toRange(o.replaceRange);this._acceptDeleteRange(s),this._acceptInsertText(s.start,o.newText)}}_acceptDeleteRange(e){if(e.start.line===e.end.line){if(e.start.character===e.end.character)return;this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.start.line].substring(e.end.character));return}this._setLineText(e.start.line,this._lines[e.start.line].substring(0,e.start.character)+this._lines[e.end.line].substring(e.end.character)),this._lines.splice(e.start.line+1,e.end.line-e.start.line),this._lineStarts.removeValues(e.start.line+1,e.end.line-e.start.line)}_acceptInsertText(e,r){if(r.length===0)return;let n=(0,_Bi.splitLines)(r);if(n.length===1){this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]+this._lines[e.line].substring(e.character));return}n[n.length-1]+=this._lines[e.line].substring(e.character),this._setLineText(e.line,this._lines[e.line].substring(0,e.character)+n[0]);let o=new Uint32Array(n.length-1);for(let s=1;snew Ure.TextEdit(this.validateRange(n.range),n.newText));return new vBi.StringEdit(r.map(n=>new vBi.StringReplacement(this.toOffsetRange(n.range),n.newText)))}toTextEdits(e){return e.replacements.map(r=>new Ure.TextEdit(this.toRange(r.replaceRange),r.newText))}validatePosition(e){if(!(e instanceof Ure.Position))throw new Error("Invalid argument");if(this._lines.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this._lines.length)r=this._lines.length-1,n=this._lines[r].length,o=!0;else{let s=this._lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new Ure.Position(r,n):e}validateRange(e){return new Ure.Range(this.validatePosition(e.start),this.validatePosition(e.end))}};l_t.PositionOffsetTransformer=v2r});var S2r=I(Qre=>{"use strict";p();Object.defineProperty(Qre,"__esModule",{value:!0});Qre.SnapshotDocumentLine=Qre.TextDocumentSnapshot=void 0;Qre.isTextDocumentSnapshotJSON=t0c;var u_t=dS(),bBi=Vu(),CBi=y2r(),uAe=Am(),e0c=C2r();function t0c(t){return!t||typeof t!="object"?!1:(0,bBi.isUriComponents)(t.uri)&&(0,u_t.isString)(t._text)&&(0,u_t.isString)(t.languageId)&&(0,u_t.isNumber)(t.version)&&(0,u_t.isNumber)(t.eol)}a(t0c,"isTextDocumentSnapshotJSON");var b2r=class t{static{a(this,"TextDocumentSnapshot")}static create(e){return new t(e,e.uri,e.getText(),e.languageId,e.eol,e.version)}static fromNewText(e,r){return new t(r instanceof t?r.document:r,r.uri,e,r.languageId,r.eol,r.version+1)}static fromJSON(e,r){return new t(e,bBi.URI.from(r.uri),r._text,r.languageId,r.eol,r.version)}get transformer(){return this._transformer||(this._transformer=new e0c.PositionOffsetTransformer(this._text)),this._transformer}get fileName(){return this.uri.fsPath}get isUntitled(){return this.uri.scheme==="untitled"}get lineCount(){return this.lines.length}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}constructor(e,r,n,o,s,c){this._transformer=null,this._lines=null,this.document=e,this.uri=r,this._text=n,this.languageId=o,this.eol=s,this.version=c}lineAt(e){let r;if(e instanceof uAe.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new d_t(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.version===this.document.version?this.document.offsetAt(e):(e=this.validatePosition(e),this.transformer.getOffset(e))}positionAt(e){return this.version===this.document.version?this.document.positionAt(e):(e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e))}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){if(this.version===this.document.version)return this.document.getText(e);let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,CBi.getWordAtText)(r.character+1,CBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new uAe.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new uAe.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new uAe.Position(r,n):e}toJSON(){return{uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,eol:this.eol,_text:this._text}}};Qre.TextDocumentSnapshot=b2r;var d_t=class{static{a(this,"SnapshotDocumentLine")}constructor(e,r,n){this._line=e,this._text=r,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new uAe.Range(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new uAe.Range(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}};Qre.SnapshotDocumentLine=d_t});var h_t=I(p_t=>{"use strict";p();Object.defineProperty(p_t,"__esModule",{value:!0});p_t.AlternativeNotebookDocument=void 0;var SBi=y2r(),f_t=Am(),r0c=C2r(),n0c=S2r(),T2r=class{static{a(this,"AlternativeNotebookDocument")}get transformer(){return this._transformer||(this._transformer=new r0c.PositionOffsetTransformer(this._text)),this._transformer}getText(e){return e?this._getTextInRange(e):this._text}_getTextInRange(e){let r=this.validateRange(e);if(r.isEmpty)return"";let n=this.transformer.toOffsetRange(r);return this._text.substring(n.start,n.endExclusive)}constructor(e,r){this._text=e,this.notebook=r,this._transformer=null,this._lines=null}positionToOffset(e){return e=this.validatePosition(e),this.transformer.getOffset(e)}getWordRangeAtPosition(e){let r=this.validatePosition(e),n=(0,SBi.getWordAtText)(r.character+1,SBi.DEFAULT_WORD_REGEXP,this.lines[r.line],0);if(n)return new f_t.Range(r.line,n.startColumn-1,r.line,n.endColumn-1)}get lines(){return this._lines||(this._lines=this._text.split(/\r\n|\r|\n/g)),this._lines}get lineCount(){return this.lines.length}lineAt(e){let r;if(e instanceof f_t.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return new n0c.SnapshotDocumentLine(r,this.lines[r],r===this.lines.length-1)}offsetAt(e){return this.transformer.getOffset(e)}positionAt(e){return e=Math.floor(e),e=Math.max(0,e),this.transformer.getPosition(e)}validateRange(e){let r=this.validatePosition(e.start),n=this.validatePosition(e.end);return r===e.start&&n===e.end?e:new f_t.Range(r.line,r.character,n.line,n.character)}validatePosition(e){if(this._text.length===0)return e.with(0,0);let{line:r,character:n}=e,o=!1;if(r<0)r=0,n=0,o=!0;else if(r>=this.lines.length)r=this.lines.length-1,n=this.lines[r].length,o=!0;else{let s=this.lines[r].length;n<0?(n=0,o=!0):n>s&&(n=s,o=!0)}return o?new f_t.Position(r,n):e}};p_t.AlternativeNotebookDocument=T2r});var m_t=I(dAe=>{"use strict";p();Object.defineProperty(dAe,"__esModule",{value:!0});dAe.isUri=o0c;dAe.isLocation=I2r;dAe.toLocation=s0c;dAe.isSymbolInformation=a0c;var F4e=Am(),i0c=Vu();function o0c(t){return i0c.URI.isUri(t)}a(o0c,"isUri");function I2r(t){return t&&typeof t=="object"&&"uri"in t&&"range"in t}a(I2r,"isLocation");function s0c(t){if(I2r(t)&&Array.isArray(t.range)&&t.range.length===2){let e=t.range[0],r=t.range[1];return new F4e.Location(t.uri,new F4e.Range(new F4e.Position(e.line,e.character),new F4e.Position(r.line,r.character)))}else if(I2r(t)&&t.range instanceof F4e.Range)return t}a(s0c,"toLocation");function a0c(t){return t&&typeof t=="object"&&"name"in t&&"containerName"in t}a(a0c,"isSymbolInformation")});var q4e=I(cy=>{"use strict";p();Object.defineProperty(cy,"__esModule",{value:!0});cy.CellIdPatternRe=cy.EOL=cy.LineOfText=void 0;cy.summarize=l0c;cy.notebookCellToCellData=u0c;cy.getCellIdMap=d0c;cy.normalizeCellId=f0c;cy.getNotebookId=p0c;cy.getCellId=R2r;cy.getDefaultLanguage=m0c;cy.requestHasNotebookRefs=A0c;cy.parseAndCleanStack=y0c;var TBi=m_t(),RBi=UPr(),c0c=Oh(),IBi=Vu(),w2r=Am(),x2r=class{static{a(this,"LineOfText")}constructor(e){this.__lineOfTextBrand=void 0,this.value=e.replace(/\r$/,"")}};cy.LineOfText=x2r;cy.EOL=` +`;function l0c(t){let e=t.kind===w2r.NotebookCellKind.Code?"code":"markdown",r=R2r(t),n=h0c(t.document);return{cell_type:e,id:r,language:t.document.languageId,source:n,index:t.index}}a(l0c,"summarize");function u0c(t){let e=new w2r.NotebookCellData(t.kind,t.document.getText(),t.document.languageId);return e.metadata=t.metadata,e.executionSummary=t.executionSummary,t.outputs.length&&(e.outputs=[...t.outputs]),e}a(u0c,"notebookCellToCellData");function d0c(t){let e=new Map;return t.getCells().forEach(r=>{e.set(R2r(r),r)}),e}a(d0c,"getCellIdMap");var xBi=new WeakMap,Q4e=8,U4e="#VSC-";cy.CellIdPatternRe=new RegExp(`(\\s+|^|\\b|\\W)(#VSC-[a-f0-9]{${Q4e}})\\b`,"gi");function f0c(t){return t.startsWith(U4e)?t:t.startsWith("VSC-")?`#${t}`:t.startsWith("#V-")&&t.length===Q4e+3?`${U4e}${t.substring(3)}`:t.toLowerCase().startsWith("vscode-")&&t.length===Q4e+7?`${U4e}${t.substring(7)}`:t.startsWith("-")?`#VSC${t}`:t.length===Q4e?`${U4e}${t}`:t}a(f0c,"normalizeCellId");var wBi=new WeakMap;function p0c(t){let e=wBi.get(t);if(e)return e;let r=new RBi.StringSHA1;return r.update(t.uri.toString()),e=r.digest(),wBi.set(t,e),e}a(p0c,"getNotebookId");function R2r(t){let e=xBi.get(t);if(e)return e;let r=new RBi.StringSHA1;return r.update(t.document.uri.toString()),e=`${U4e}${r.digest().substring(0,Q4e)}`,xBi.set(t,e),e}a(R2r,"getCellId");function h0c(t){return t.lineCount===0?[]:new Array(t.lineCount).fill("").map((e,r)=>t.lineAt(r).text)}a(h0c,"getCellCode");function m0c(t){let e=t.getCells().find(r=>r.kind===w2r.NotebookCellKind.Code);if(e)return e.document.languageId;if(t.notebookType==="jupyter-notebook")return t.metadata?.language_info?.name||t.metadata?.kernelspec?.language||"python"}a(m0c,"getDefaultLanguage");var g0c=["jupyter","notebook","cell.","cells."," cell ","cells","notebook cell"];function A0c(t,e,r){let n=(t.prompt||"").toLowerCase();return r?.checkPromptAsWell&&g0c.some(o=>n.includes(o))?!0:t.references.some(o=>(0,TBi.isLocation)(o.value)?e.hasSupportedNotebooks(o.value.uri):(0,IBi.isUriComponents)(o.value)?e.hasSupportedNotebooks(IBi.URI.revive(o.value)):(0,TBi.isUri)(o.value)?e.hasSupportedNotebooks(o.value):!1)}a(A0c,"requestHasNotebookRefs");function y0c(t){try{let e=JSON.parse(t);return(0,c0c.removeAnsiEscapeCodes)(e?.stack||e.message||"")||e.message||e.name||t}catch{return t}}a(y0c,"parseAndCleanStack")});var DBi=I(j4e=>{"use strict";p();Object.defineProperty(j4e,"__esModule",{value:!0});j4e.AlternativeJsonNotebookContentProvider=void 0;j4e.isJsonContent=b0c;var E0c=(mBi(),ya(hBi)),_0c=zc(),PBi=Vu(),MD=Am(),v0c=a_t(),C0c=h_t(),fAe=q4e(),kBi=4;function b0c(t){return!!(t.startsWith("{")||t.trim().startsWith("{")||(t.includes("{")||t.includes("}"))&&t.includes('"source":')&&t.includes('"cell_type":'))}a(b0c,"isJsonContent");var g_t=class extends C0c.AlternativeNotebookDocument{static{a(this,"AlternativeJsonDocument")}fromCellPosition(e,r){let n=(0,fAe.getCellId)(e),o=this.getText(),s=" ",c=`"id": "${n}",`,l=o.indexOf('"source": [',o.indexOf(c)),u=this.positionAt(l).line+1,d=e.document.getText(new MD.Range(r.line,0,r.line,r.character)),f=`${s}${JSON.stringify(d).slice(0,-1)}`,h=r.line+u;return new MD.Position(h,f.length)}toCellPosition(e){throw new Error("Method not implemented.")}},P2r=class extends v0c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeJsonNotebookContentProvider")}constructor(){super("json")}stripCellMarkers(e){return e}parseAlternateContent(e,r,n){return this.parseAlternateContentImpl(e,r,n)}getAlternativeDocumentFromText(e,r){return new g_t(e,r)}getAlternativeDocument(e,r){let o={cells:e.getCells().filter(c=>r?c.kind!==MD.NotebookCellKind.Markup:!0).map(c=>{let l=(0,fAe.summarize)(c),u=S0c(c.document);return{cell_type:l.cell_type,id:l.id,metadata:{language:l.language},source:u}})},s=JSON.stringify(o,void 0,kBi);return new g_t(s,e)}getSummaryOfStructure(e,r,n){let o=["{",' "cells: ['],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,fAe.summarize)(c);l.source.length&&l.source[0].trim().length?l.source=[l.source[0],s]:l.source.length&&l.source.some(d=>d.trim().length)?l.source=[s,l.source.filter(d=>d.trim().length)[0],s]:l.source=[s];let u=JSON.stringify(l,void 0,kBi).split(/\r?\n/).map(d=>` ${d}`);o.push(...u),o.push(",")}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.push(" ]"),o.push("}"),o.join(fAe.EOL)}parseAlternateContentImpl(e,r,n){return new _0c.AsyncIterableObject(async o=>{let s=PBi.URI.isUri(e)?new Map:(0,fAe.getCellIdMap)(e),c=new Set,l="",u=-1,d={index:-1,startOffset:-1,endOffset:-1,kind:MD.NotebookCellKind.Code,source:[]},f=PBi.URI.isUri(e)?"python":(0,fAe.getDefaultLanguage)(e),h=a(g=>{d.language=d.language||f,d.id&&s.get(d.id)?.document.languageId===d.language?c.has(d.id)?d.id="":c.add(d.id):d.id="";let A=s.get(d.id);d.uri=A?.document.uri,d.kind=A?.kind||(d.language==="markdown"?MD.NotebookCellKind.Markup:MD.NotebookCellKind.Code),o.emitOne({index:d.index,type:"start",kind:d.kind,language:d.language,uri:d.uri,id:d.id}),d.source.forEach(y=>o.emitOne({index:d.index,type:"line",line:y})),o.emitOne({index:d.index,type:"end"})},"emitCell"),m=0;for await(let g of r){if(n.isCancellationRequested)break;let A=g.value;l+=A,(0,E0c.visit)(l,{onObjectEnd(y,E,_,v){m=y},onLiteralValue:a((y,E,_,v,b,T)=>{if(u>=E)return;let w=T();if(w.length<2||w.shift()!=="cells")return;let R=w.shift();if(typeof R!="number")return;let x=w.shift();if(u=E,d.index!==-1&&d.index!==R&&(h(E),d.startOffset=E,d.id=void 0,d.kind=MD.NotebookCellKind.Code,d.source=[],d.uri=void 0,d.language=void 0),d.index=R,x==="cell_type")d.kind=y==="code"?MD.NotebookCellKind.Code:MD.NotebookCellKind.Markup,d.kind===MD.NotebookCellKind.Markup&&(d.language="markdown");else if(x==="id")d.id=y;else if(x==="metadata"&&w[0]==="id")d.id=y;else if(x==="metadata"&&w[0]==="language")d.language=y,d.language==="markdown"&&(d.kind=MD.NotebookCellKind.Markup);else if(x==="source"&&w.length&&typeof w[0]=="number"){w[0]===0&&(d.startOffset=E);let P=typeof y=="string"?y:`${y||""}`;P.endsWith(` +`)&&(P=P.substr(0,P.length-1)),d.source.push(P)}},"onLiteralValue")})}d.index!==-1&&h(m)})}};j4e.AlternativeJsonNotebookContentProvider=P2r;function S0c(t){if(t.lineCount===0)return[];if(t.lineCount===1)return[t.lineAt(0).text];let e=t.lineCount;return new Array(e).fill("").map((r,n)=>t.lineAt(n).text)}a(S0c,"getCellCode")});var D2r=I(f$=>{"use strict";p();Object.defineProperty(f$,"__esModule",{value:!0});f$.wellKnownLanguages=void 0;f$.getLanguage=NBi;f$.getLanguageForResource=x0c;var T0c=ak(),I0c=Object.freeze({abap:{lineComment:{start:"'"},markdownLanguageIds:["abap","sap-abap"]},bat:{lineComment:{start:"REM"},alternativeLineComments:[{start:"::"}],aliases:["Batch","bat"],extensions:[".bat",".cmd"]},bibtex:{lineComment:{start:"%"},aliases:["BibTeX","bibtex"],extensions:[".bib"]},blade:{lineComment:{start:"#"}},c:{lineComment:{start:"//"},aliases:["C","c"],extensions:[".c",".i"],markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";"},aliases:["Clojure","clojure"],extensions:[".clj",".cljs",".cljc",".cljx",".clojure",".edn"],markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//"},aliases:["CoffeeScript","coffeescript","coffee"],extensions:[".coffee",".cson",".iced"],markdownLanguageIds:["coffeescript","coffee","cson","iced"],blockComment:["###","###"]},cpp:{lineComment:{start:"//"},aliases:["C++","Cpp","cpp"],extensions:[".cpp",".cc",".cxx",".c++",".hpp",".hh",".hxx",".h++",".h",".ii",".ino",".inl",".ipp",".ixx",".tpp",".txx",".hpp.in",".h.in"],markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"],blockComment:["/*","*/"]},csharp:{lineComment:{start:"//"},aliases:["C#","csharp"],extensions:[".cs",".csx",".cake"],markdownLanguageIds:["csharp","cs"],blockComment:["/*","*/"]},css:{lineComment:{start:"/*",end:"*/"},aliases:["CSS","css"],extensions:[".css"],blockComment:["/*","*/"]},dart:{lineComment:{start:"//"},aliases:["Dart"],extensions:[".dart"],blockComment:["/*","*/"]},dockerfile:{lineComment:{start:"#"},aliases:["Docker","Dockerfile","Containerfile"],extensions:[".dockerfile",".containerfile"],markdownLanguageIds:["dockerfile","docker"]},elixir:{lineComment:{start:"#"}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%"},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//"},aliases:["F#","FSharp","fsharp"],extensions:[".fs",".fsi",".fsx",".fsscript"],markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"],blockComment:["(*","*)"]},go:{lineComment:{start:"//"},aliases:["Go"],extensions:[".go"],markdownLanguageIds:["go","golang"],blockComment:["/*","*/"]},groovy:{lineComment:{start:"//"},aliases:["Groovy","groovy"],extensions:[".groovy",".gvy",".gradle",".jenkinsfile",".nf"],blockComment:["/*","*/"]},haml:{lineComment:{start:"-#"}},handlebars:{lineComment:{start:"{{!",end:"}}"},extensions:[".hbs",".handlebars"],markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"],blockComment:["{{!--","--}}"]},haskell:{lineComment:{start:"--"},markdownLanguageIds:["haskell","hs"]},html:{lineComment:{start:""},aliases:["HTML","htm","html","xhtml"],extensions:[".html",".htm",".shtml",".xhtml",".xht",".mdoc",".jsp",".asp",".aspx",".jshtm",".volt",".ejs",".rhtml"],markdownLanguageIds:["html","xhtml"],blockComment:[""]},ini:{lineComment:{start:";"},blockComment:[";"," "]},java:{lineComment:{start:"//"},extensions:[".java",".class"],markdownLanguageIds:["java","jsp"],blockComment:["/*","*/"]},javascript:{lineComment:{start:"//"},aliases:["JavaScript","javascript","js"],extensions:[".js",".es6",".mjs",".cjs",".pac"],markdownLanguageIds:["javascript","js"],blockComment:["/*","*/"]},javascriptreact:{lineComment:{start:"//"},aliases:["JavaScript JSX","JavaScript React","jsx"],extensions:[".jsx"],markdownLanguageIds:["jsx"]},json:{extensions:[".json"],lineComment:{start:"//"},blockComment:["/*","*/"]},jsonc:{lineComment:{start:"//"}},jsx:{lineComment:{start:"//"},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#"},aliases:["Julia","julia"],extensions:[".jl"],markdownLanguageIds:["julia","jl"],blockComment:["#=","=#"]},kotlin:{lineComment:{start:"//"},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%"},aliases:["LaTeX","latex"],extensions:[".tex",".ltx",".ctx"],markdownLanguageIds:["tex"]},less:{lineComment:{start:"//"},aliases:["Less","less"],extensions:[".less"],blockComment:["/*","*/"]},lua:{lineComment:{start:"--"},aliases:["Lua","lua"],extensions:[".lua"],markdownLanguageIds:["lua","pluto"],blockComment:["--[[","]]"]},makefile:{lineComment:{start:"#"},aliases:["Makefile","makefile"],extensions:[".mak",".mk"],markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:""},alternativeLineComments:[{start:"[]: #"}],aliases:["Markdown","markdown"],extensions:[".md",".mkd",".mdwn",".mdown",".markdown",".markdn",".mdtxt",".mdtext",".workbook"],markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//"},aliases:["Objective-C"],extensions:[".m"],markdownLanguageIds:["objectivec","mm","objc","obj-c"],blockComment:["/*","*/"]},"objective-cpp":{lineComment:{start:"//"},aliases:["Objective-C++"],extensions:[".mm"],markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#"},aliases:["Perl","perl"],extensions:[".pl",".pm",".pod",".t",".PL",".psgi"],markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//"},aliases:["PHP","php"],extensions:[".php",".php4",".php5",".phtml",".ctp"],blockComment:["/*","*/"]},powershell:{lineComment:{start:"#"},aliases:["PowerShell","powershell","ps","ps1"],extensions:[".ps1",".psm1",".psd1",".pssc",".psrc"],markdownLanguageIds:["powershell","ps","ps1"],blockComment:["<#","#>"]},pug:{lineComment:{start:"//"}},python:{lineComment:{start:"#"},aliases:["Python","py"],extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi",".pyi",".ipy",".pyt"],markdownLanguageIds:["python","py","gyp"],blockComment:['"""','"""']},ql:{lineComment:{start:"//"}},r:{lineComment:{start:"#"},aliases:["R","r"],extensions:[".r",".rhistory",".rprofile",".rt"]},razor:{lineComment:{start:""},aliases:["Razor","razor"],extensions:[".cshtml",".razor"],markdownLanguageIds:["cshtml","razor","razor-cshtml"],blockComment:[""]},ruby:{lineComment:{start:"#"},aliases:["Ruby","rb"],extensions:[".rb",".rbx",".rjs",".gemspec",".rake",".ru",".erb",".podspec",".rbi"],markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"],blockComment:["=begin","=end"]},rust:{lineComment:{start:"//"},aliases:["Rust","rust"],extensions:[".rs"],markdownLanguageIds:["rust","rs"],blockComment:["/*","*/"]},sass:{lineComment:{start:"//"}},scala:{lineComment:{start:"//"}},scss:{lineComment:{start:"//"},aliases:["SCSS","scss"],extensions:[".scss"],blockComment:["/*","*/"]},shellscript:{lineComment:{start:"#"},aliases:["Shell Script","shellscript","bash","fish","sh","zsh","ksh","csh"],extensions:[".sh",".bash",".bashrc",".bash_aliases",".bash_profile",".bash_login",".ebuild",".profile",".bash_logout",".xprofile",".xsession",".xsessionrc",".Xsession",".zsh",".zshrc",".zprofile",".zlogin",".zlogout",".zshenv",".zsh-theme",".fish",".ksh",".csh",".cshrc",".tcshrc",".yashrc",".yash_profile"],markdownLanguageIds:["bash","sh","zsh"]},slim:{lineComment:{start:"/"}},solidity:{lineComment:{start:"//"},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--"},aliases:["SQL"],extensions:[".sql",".dsql"],blockComment:["/*","*/"]},stylus:{lineComment:{start:"//"}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//"},aliases:["Swift","swift"],extensions:[".swift"],blockComment:["/*","*/"]},terraform:{lineComment:{start:"#"}},tex:{lineComment:{start:"%"},aliases:["TeX","tex"],extensions:[".sty",".cls",".bbx",".cbx"]},typescript:{lineComment:{start:"//"},aliases:["TypeScript","ts","typescript"],extensions:[".ts",".cts",".mts"],markdownLanguageIds:["typescript","ts"],blockComment:["/*","*/"]},typescriptreact:{lineComment:{start:"//"},aliases:["TypeScript JSX","TypeScript React","tsx"],extensions:[".tsx"],markdownLanguageIds:["tsx"],blockComment:["/*","*/"]},vb:{lineComment:{start:"'"},aliases:["Visual Basic","vb"],extensions:[".vb",".brs",".vbs",".bas",".vba"],markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//"}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//"},extensions:[".vue"]},xml:{lineComment:{start:""},aliases:["XML","xml"],extensions:[".xml",".xsd",".ascx",".atom",".axml",".axaml",".bpmn",".cpt",".csl",".csproj",".csproj.user",".dita",".ditamap",".dtd",".ent",".mod",".dtml",".fsproj",".fxml",".iml",".isml",".jmx",".launch",".menu",".mxml",".nuspec",".opml",".owl",".proj",".props",".pt",".publishsettings",".pubxml",".pubxml.user",".rbxlx",".rbxmx",".rdf",".rng",".rss",".shproj",".storyboard",".svg",".targets",".tld",".tmx",".vbproj",".vbproj.user",".vcxproj",".vcxproj.filters",".wsdl",".wxi",".wxl",".wxs",".xaml",".xbl",".xib",".xlf",".xliff",".xpdl",".xul",".xoml"],blockComment:[""]},xsl:{lineComment:{start:""},aliases:["XSL","xsl"],extensions:[".xsl",".xslt"]},yaml:{lineComment:{start:"#"},markdownLanguageIds:["yaml","yml"]}});f$.wellKnownLanguages=new Map(Object.entries(I0c).map(([t,e])=>[t,{languageId:t,...e}]));function NBi(t){return k2r(typeof t=="string"?t:typeof t>"u"?"plaintext":t.languageId)}a(NBi,"getLanguage");function k2r(t){return f$.wellKnownLanguages.get(t.toLowerCase())??{languageId:t,lineComment:{start:"//"}}}a(k2r,"_getLanguage");function x0c(t){let e=(0,T0c.extname)(t).toLowerCase();for(let r of f$.wellKnownLanguages.values())if(r.extensions?.includes(e))return r;return NBi("plaintext")}a(x0c,"getLanguageForResource")});var BBi=I(p$=>{"use strict";p();Object.defineProperty(p$,"__esModule",{value:!0});p$.AlternativeTextNotebookContentProvider=void 0;p$.generateCellTextMarker=O2r;p$.lineMightHaveCellMarker=B2r;p$.getBlockComment=hAe;p$.getLineCommentStart=mAe;var M2r=D2r(),w0c=m_t(),R0c=w7(),pAe=Am(),P0c=a_t(),k0c=h_t(),T0=q4e();function O2r(t,e){let r=t.id?`[id=${t.id}] `:"";return`${e}%% vscode.cell ${r}[language=${t.language}]`}a(O2r,"generateCellTextMarker");function B2r(t){return t.toLowerCase().includes("vscode.cell")}a(B2r,"lineMightHaveCellMarker");var A_t=class extends k0c.AlternativeNotebookDocument{static{a(this,"AlternativeTextDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,T0.summarize)(e),o=mAe(this.notebook),s=O2r(n,o),c=e.document.eol===pAe.EndOfLine.LF?1:2,l=hAe(this.notebook),u=this.getText(),d=e.document.offsetAt(r),f=e.kind===pAe.NotebookCellKind.Markup?l[0].length+c:0,h=u.indexOf(s)+s.length+c+f+d;return this.positionAt(h)}toCellPosition(e){let r=this.offsetAt(e),n=(0,R0c.findLast)(this.cellOffsetMap,s=>s.sourceOffset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.sourceOffset);return{cell:n.cell,position:o}}},N2r=class extends P0c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeTextNotebookContentProvider")}constructor(){super("text")}stripCellMarkers(e){let r=e.split(T0.EOL);return r.length&&B2r(r[0])?(r.shift(),r.join(T0.EOL)):e}getSummaryOfStructure(e,r,n){let o=hAe(e),s=mAe(e),c=`${s} ${n}`,l=[];return e.getCells().forEach(u=>{if(r.includes(u)){let d=(0,T0.summarize)(u);d.source.length&&d.source[0].trim().length?d.source=[d.source[0],c]:d.source.length&&d.source.some(f=>f.trim().length)?d.source=[c,d.source.filter(f=>f.trim().length)[0],c]:d.source=[c],l.push(MBi(d,s,o).content)}else(!l.length||l[l.length-1]!==c)&&l.push(c)}),l.join(T0.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,w0c.isUri)(e),s=o?(0,T0.getCellIdMap)(e):new Map,c=!1,l=!1,u=!1,d=!1,f=-1,h=mAe(o?e:void 0),m=hAe(o?e:void 0),g=o?(0,M2r.getLanguage)((0,T0.getDefaultLanguage)(e)).languageId:void 0,A=new Set;for await(let y of r){if(n.isCancellationRequested)break;let E=y.value,_=E.startsWith(`${h}%% [`)&&E.trimEnd().endsWith("]"),v=E.startsWith(`${h}%% vscode.cell`),b=v||_?OBi(E,g):void 0;if((v||_)&&b?.language){u&&(u=!1);let T={index:-1,uri:void 0,language:void 0,kind:pAe.NotebookCellKind.Code,emitted:!1,type:"start"};T.index=f+=1,T.emitted=!1,b.id&&s.get(b.id)?.document.languageId===b.language?A.has(b.id)?b.id="":A.add(b.id):b.id="";let w=s.get(b.id);T.id=b.id,T.language=b.language,T.uri=w?.document.uri,T.kind=w?.kind||(T.language==="markdown"?pAe.NotebookCellKind.Markup:pAe.NotebookCellKind.Code),c=T.language==="markdown",l=!1,d&&(yield{index:f-1,type:"end"}),d=!0,yield T;continue}d&&(c?l?E===m[1]?(l=!1,u=!0):yield{index:f,line:E,type:"line"}:E===m[0]?l=!0:yield{index:f,line:E,type:"line"}:yield{index:f,line:E,type:"line"})}d&&(yield{index:f,type:"end"})}getAlternativeDocumentFromText(e,r){let n=hAe(r),o=mAe(r),s=(0,T0.getCellIdMap)(r),c=[],l=e.split(T0.EOL),u=0;for(let d=0;dy.document.languageId===g.language&&!c.some(E=>E.cell===y));if(A){let y=u,E=T0.EOL.length,_=g.language==="markdown",v=y+f.length+E+(_?n[0].length+E:0);c.push({offset:y,sourceOffset:v,cell:A})}}}u+=f.length+T0.EOL.length}return new A_t(e,c,r)}getAlternativeDocument(e,r){let n=e.getCells().filter(d=>r?d.kind!==pAe.NotebookCellKind.Markup:!0).map(d=>(0,T0.summarize)(d)),o=hAe(e),s=mAe(e),c=n.map(d=>({...MBi(d,s,o),cell:e.cellAt(d.index)})),l=c.map(d=>d.content).join(T0.EOL),u=c.map(d=>{let f=l.indexOf(d.content),h=f+d.prefix.length;return{offset:f,sourceOffset:h,cell:e.cellAt(d.cell.index)}});return new A_t(l,u,e)}};p$.AlternativeTextNotebookContentProvider=N2r;function MBi(t,e,r){let n=O2r(t,e),o=t.source.join(T0.EOL),s=t.language==="markdown"?`${n}${T0.EOL}${r[0]}${T0.EOL}`:`${n}${T0.EOL}`;return{content:t.language==="markdown"?`${s}${o}${T0.EOL}${r[1]}`:`${s}${o}`,prefix:s}}a(MBi,"generateAlternativeCellTextContent");function hAe(t){return t?(0,M2r.getLanguage)((0,T0.getDefaultLanguage)(t)).blockComment??["```","```"]:['"""','"""']}a(hAe,"getBlockComment");function mAe(t){return t&&(0,M2r.getLanguage)((0,T0.getDefaultLanguage)(t)).lineComment.start||"#"}a(mAe,"getLineCommentStart");function OBi(t,e){let r=t.match(/\[id=(.+?)\]/),n=t.match(/\[language=(.+?)\]/);return n?{id:r?r[1].trim():"",language:n[1].trim()}:B2r(t)&&typeof e=="string"?{id:r?r[1].trim():"",language:e}:void 0}a(OBi,"extractCellParts")});var UBi=I($4e=>{"use strict";p();Object.defineProperty($4e,"__esModule",{value:!0});$4e.AlternativeXmlNotebookContentProvider=void 0;$4e.isXmlContent=FBi;var D0c=D2r(),N0c=m_t(),M0c=w7(),H4e=Am(),O0c=a_t(),B0c=h_t(),DE=q4e(),G4e="`}a(L2r,"generateCellMarker");function FBi(t){return t.includes(G4e)||t.includes(h$)||t.includes(y_t)}a(FBi,"isXmlContent");var E_t=class extends B0c.AlternativeNotebookDocument{static{a(this,"AlternativeXmlDocument")}constructor(e,r,n){super(e,n),this.cellOffsetMap=r}fromCellPosition(e,r){let n=(0,DE.summarize)(e),o=L2r(n),s=e.document.eol===H4e.EndOfLine.LF?1:2,c=this.getText(),l=e.document.offsetAt(r),u=c.indexOf(o)+o.length+s+l;return this.positionAt(u)}toCellPosition(e){let r=this.offsetAt(e),n=(0,M0c.findLast)(this.cellOffsetMap,s=>s.offset<=r);if(!n)return;let o=n.cell.document.positionAt(r-n.offset);return{cell:n.cell,position:o}}},F2r=class extends O0c.BaseAlternativeNotebookContentProvider{static{a(this,"AlternativeXmlNotebookContentProvider")}constructor(){super("xml")}stripCellMarkers(e){let r=e.split(DE.EOL);return r.length&&(r[0].startsWith(G4e)||r[0].startsWith(y_t))&&r.shift(),r.length&&r[r.length-1].trim().endsWith(h$)&&(r[r.length-1]=r[r.length-1].substring(0,r[r.length-1].lastIndexOf(h$))),r.join(DE.EOL)}getSummaryOfStructure(e,r,n){let o=[],s=`// ${n}`;return e.getCells().forEach(c=>{if(r.includes(c)){let l=(0,DE.summarize)(c);o.push(L2r(l)),l.source.length&&l.source[0].trim().length?(o.push(l.source[0]),o.push(s)):l.source.length&&l.source.some(u=>u.trim().length)?l.source=[s,l.source.filter(u=>u.trim().length)[0],s]:o.push(s),o.push(h$)}else(!o.length||o[o.length-1]!==s)&&o.push(s)}),o.join(DE.EOL)}async*parseAlternateContent(e,r,n){let o=!(0,N0c.isUri)(e),s=o?(0,DE.getCellIdMap)(e):new Map,c=-1,l=!1,u=new Set,d=!1,f,h=o?(0,D0c.getLanguage)((0,DE.getDefaultLanguage)(e)).languageId:void 0;for await(let m of r){if(n.isCancellationRequested)break;let g=m.value;if((g.startsWith(G4e)||g.startsWith(y_t))&&(c<0||l||d&&f)){!l&&d&&f&&(f.line=f.line.substring(0,f.line.lastIndexOf(h$)),yield f,yield{type:"end",index:f.index}),d=!1,f=void 0,c+=1,l=!1;let A={type:"start",index:c,uri:void 0,language:void 0,kind:H4e.NotebookCellKind.Code},y=LBi(g,h);y.id&&s.get(y.id)?.document.languageId===y.language?u.has(y.id)?y.id="":u.add(y.id):y.id="";let E=s.get(y.id)?.document.languageId===y.language?s.get(y.id):void 0;A.id=y.id,A.language=y.language,A.uri=E?.document.uri,A.kind=E?.kind||(A.language==="markdown"?H4e.NotebookCellKind.Markup:H4e.NotebookCellKind.Code),yield A}else g.startsWith(h$)?(d&&f&&(yield f),l=!0,d=!1,f=void 0,yield{type:"end",index:c}):c>=0&&(d&&f&&(yield f,f=void 0),d=g.endsWith(h$),d?f={type:"line",index:c,line:g}:yield{type:"line",index:c,line:g})}}getAlternativeDocumentFromText(e,r){let n=(0,DE.getCellIdMap)(r),o=[],s=e.split(DE.EOL),c=0;for(let l=0;lh.document.languageId===d.language&&!o.some(m=>m.cell===h));if(f){let h=DE.EOL.length,m=c+u.length+h;o.push({offset:m,cell:f})}}c+=u.length+DE.EOL.length}return new E_t(e,o,r)}getAlternativeDocument(e,r){let o=e.getCells().filter(l=>r?l.kind!==H4e.NotebookCellKind.Markup:!0).map(l=>(0,DE.summarize)(l)).map(l=>{let d=`${L2r(l)}${DE.EOL}`;return{content:`${d}${l.source.join(DE.EOL)}${DE.EOL}${h$}`,prefix:d,cell:e.cellAt(l.index)}}),s=o.map(l=>l.content).join(DE.EOL),c=o.map(l=>({offset:s.indexOf(l.content)+l.prefix.length,cell:l.cell}));return new E_t(s,c,e)}};$4e.AlternativeXmlNotebookContentProvider=F2r;function LBi(t,e){let r=t.match(/id="([^"]+)"/),n=t.match(/language="([^"]+)"/);if(!n){if(FBi(t)&&typeof e=="string")return{id:r?r[1].trim():"",language:e};throw new Error(`Invalid cell part in ${t}`)}return{id:r?r[1].trim():"",language:n[1].trim()}}a(LBi,"extractCellParts")});var GBi=I(t1=>{"use strict";p();var F0c=t1&&t1.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},QBi=t1&&t1.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(t1,"__esModule",{value:!0});t1.AlternativeNotebookContentService=t1.IAlternativeNotebookContentService=void 0;t1.getAlternativeNotebookDocumentProvider=Q2r;t1.inferAlternativeNotebookContentFormat=$0c;t1.getAltNotebookRange=V0c;var U0c=Zyt(),Q0c=tn(),q0c=Am(),qBi=Sl(),j0c=p4e(),H0c=_p(),jBi=DBi(),G0c=BBi(),HBi=UBi();function Q2r(t){switch(t){case"xml":return new HBi.AlternativeXmlNotebookContentProvider;case"text":return new G0c.AlternativeTextNotebookContentProvider;case"json":return new jBi.AlternativeJsonNotebookContentProvider;default:throw new Error(`Unsupported kind '${t}'`)}}a(Q2r,"getAlternativeNotebookDocumentProvider");function $0c(t){return(0,HBi.isXmlContent)(t)?"xml":(0,jBi.isJsonContent)(t)?"json":"text"}a($0c,"inferAlternativeNotebookContentFormat");t1.IAlternativeNotebookContentService=(0,Q0c.createServiceIdentifier)("IAlternativeNotebookContentService");var U2r=class{static{a(this,"AlternativeNotebookContentService")}constructor(e,r){this.configurationService=e,this.experimentationService=r}getFormat(e){return e&&(0,j0c.modelPrefersJsonNotebookRepresentation)(e)?"json":this.configurationService.getExperimentBasedConfig(qBi.ConfigKey.Advanced.NotebookAlternativeDocumentFormat,this.experimentationService)}create(e){return Q2r(e)}};t1.AlternativeNotebookContentService=U2r;t1.AlternativeNotebookContentService=U2r=F0c([QBi(0,qBi.IConfigurationService),QBi(1,H0c.IExperimentationService)],U2r);function V0c(t,e,r,n){let o=(0,U0c.findCell)(e,r);if(!o)return;let s=Q2r(n).getAlternativeDocument(r);return new q0c.Range(s.fromCellPosition(o,t.start),s.fromCellPosition(o,t.end))}a(V0c,"getAltNotebookRange")});var VBi=I(V4e=>{"use strict";p();Object.defineProperty(V4e,"__esModule",{value:!0});V4e.NotebookDocumentSnapshot=void 0;V4e.isNotebookDocumentSnapshotJSON=Y0c;var __t=dS(),W0c=Vu(),q2r=Am(),$Bi=GBi(),z0c=q4e();function Y0c(t){return!t||typeof t!="object"?!1:t.type==="notebook"&&(0,W0c.isUriComponents)(t.uri)&&(0,__t.isString)(t._text)&&(0,__t.isString)(t.languageId)&&(0,__t.isNumber)(t.version)&&(0,__t.isString)(t.alternativeFormat)}a(Y0c,"isNotebookDocumentSnapshotJSON");var j2r=class t{static{a(this,"NotebookDocumentSnapshot")}static create(e,r){let n=e.uri,o=e.version,s=(0,$Bi.getAlternativeNotebookDocumentProvider)(r).getAlternativeDocument(e);return new t(e,n,o,r,s)}static fromNewText(e,r){let n=(0,$Bi.getAlternativeNotebookDocumentProvider)(r.alternativeFormat).getAlternativeDocumentFromText(e,r.document);return new t(r.document,r.uri,r.version,r.alternativeFormat,n)}static fromJSON(e,r){return t.create(e,r.alternativeFormat)}constructor(e,r,n,o,s){this.alternativeFormat=o,this._alternativeDocument=s,this.type="notebook",this.document=e,this.uri=r,this.version=n,this.languageId=o==="text"?(0,z0c.getDefaultLanguage)(e)||"python":o}getText(e){return this._alternativeDocument.getText(e)}getSelection(){return new q2r.Selection(0,0,this.lineCount,0)}getWholeRange(){return new q2r.Range(0,0,this.lineCount,0)}get lines(){return this._alternativeDocument.lines}get lineCount(){return this._alternativeDocument.lineCount}lineAt(e){let r;if(e instanceof q2r.Position)r=e.line;else if(typeof e=="number")r=e;else throw new Error("Invalid argument");if(r<0||r>=this.lines.length)throw new Error("Illegal value for `line`");return this._alternativeDocument.lineAt(r)}offsetAt(e){return this._alternativeDocument.offsetAt(e)}positionAt(e){return this._alternativeDocument.positionAt(e)}validateRange(e){return this._alternativeDocument.validateRange(e)}validatePosition(e){return this._alternativeDocument.validatePosition(e)}toJSON(){return{type:"notebook",uri:this.uri.toJSON(),languageId:this.languageId,version:this.version,_text:this._alternativeDocument.getText(),alternativeFormat:this.alternativeFormat}}};V4e.NotebookDocumentSnapshot=j2r});var G2r=I(Sv=>{"use strict";p();var K0c=Sv&&Sv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),J0c=Sv&&Sv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Z0c=Sv&&Sv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o"u"&&(r=this.getWorkspaceFolders().length>1);let c=(0,WBi.relativePath)(s,n);return r&&(c=`${this.getWorkspaceFolderName(s)}/${c}`),c}async openTextDocumentAndSnapshot(e){let r=await this.openTextDocument(e);return omc.TextDocumentSnapshot.create(r)}async openNotebookDocumentAndSnapshot(e,r){let n=(0,X0c.findNotebook)(e,this.notebookDocuments)||await this.openNotebookDocument(e);return imc.NotebookDocumentSnapshot.create(n,r)}getWorkspaceFolder(e){return this.getWorkspaceFolders().find(r=>WBi.extUriBiasedIgnorePathCase.isEqualOrParent(e,r))}};Sv.AbstractWorkspaceService=v_t;function smc(t,e){let r=t.getWorkspaceFolder(e);return r?rmc.posix.relative(r.path,e.path):e.path}a(smc,"getWorkspaceFileDisplayPath");var H2r=class extends v_t{static{a(this,"NullWorkspaceService")}constructor(e=[],r=[],n=[]){super(),this.disposables=new tmc.DisposableStore,this.didOpenTextDocumentEmitter=this.disposables.add(new m$.Emitter),this.didCloseTextDocumentEmitter=this.disposables.add(new m$.Emitter),this.didOpenNotebookDocumentEmitter=this.disposables.add(new m$.Emitter),this.didCloseNotebookDocumentEmitter=this.disposables.add(new m$.Emitter),this.didChangeTextDocumentEmitter=this.disposables.add(new m$.Emitter),this.didChangeWorkspaceFoldersEmitter=this.disposables.add(new m$.Emitter),this.didChangeNotebookDocumentEmitter=this.disposables.add(new m$.Emitter),this.didChangeTextEditorSelectionEmitter=this.disposables.add(new m$.Emitter),this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event,this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event,this.onDidOpenNotebookDocument=this.didOpenNotebookDocumentEmitter.event,this.onDidCloseNotebookDocument=this.didCloseNotebookDocumentEmitter.event,this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event,this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event,this.onDidChangeNotebookDocument=this.didChangeNotebookDocumentEmitter.event,this.onDidChangeTextEditorSelection=this.didChangeTextEditorSelectionEmitter.event,this._textDocuments=[],this._notebookDocuments=[],this.workspaceFolder=e,this._textDocuments=r,this._notebookDocuments=n}get textDocuments(){return this._textDocuments}showTextDocument(e){return Promise.resolve()}async openTextDocument(e){let r=this.textDocuments.find(n=>n.uri.toString()===e.toString());if(r)return r;throw new Error(`Unknown document: ${e}`)}async openNotebookDocument(e,r){if(typeof e=="string")throw new Error("Not implemented");{let n=this.notebookDocuments.find(o=>o.uri.toString()===e.toString());if(n)return n;throw new Error(`Unknown notebook: ${e}`)}}get notebookDocuments(){return this._notebookDocuments}getWorkspaceFolders(){return this.workspaceFolder}getWorkspaceFolderName(e){return"default"}ensureWorkspaceIsFullyLoaded(){return Promise.resolve()}showWorkspaceFolderPicker(){return Promise.resolve(void 0)}applyEdit(){return Promise.resolve(!0)}dispose(){this.disposables.dispose()}isResourceTrusted(e){return Promise.resolve(!0)}requestResourceTrust(e){return Promise.resolve(!0)}requestWorkspaceTrust(e){return Promise.resolve(!0)}};Sv.NullWorkspaceService=H2r});var z2r=I(qre=>{"use strict";p();Object.defineProperty(qre,"__esModule",{value:!0});qre.BatchedProcessor=qre.TaskQueue=void 0;qre.raceFilter=amc;var $2r=zc(),zBi=bs(),V2r=class{static{a(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let r=new $2r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),r.p}scheduleSkipIfCleared(e){let r=new $2r.DeferredPromise;return this._pendingTasks.push({task:e,deferred:r,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),r.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new zBi.BugIndicatingError;this._runningTask=e.task;try{let r=await e.task();e.deferred.complete(r)}catch(r){e.deferred.error(r)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let r of e)r.setUndefinedWhenCleared?r.deferred.complete(void 0):r.deferred.error(new zBi.CancellationError)}};qre.TaskQueue=V2r;var W2r=class{static{a(this,"BatchedProcessor")}constructor(e,r){this._fn=e,this._waitingTimeMs=r,this._queue=[],this._timeout=null}request(e){this._timeout===null&&(this._timeout=setTimeout(()=>this._flush(),this._waitingTimeMs));let r=new $2r.DeferredPromise;return this._queue.push({arg:e,promise:r}),r.p}async _flush(){let e=this._queue;this._queue=[],this._timeout=null;let r=e.map(o=>o.arg),n;try{n=await this._fn(r)}catch(o){for(let s of e)s.promise.error(o);return}for(let[o,s]of n.entries())e[o].promise.complete(s)}};qre.BatchedProcessor=W2r;function amc(t,e){return new Promise((r,n)=>{if(t.length===0){r(void 0);return}let o=!1,s=t.length;for(let c of t)c.then(l=>{s--,o||(e(l)?(o=!0,r(l)):s===0&&r(void 0))}).catch(n)})}a(amc,"raceFilter")});var Y2r=I(gAe=>{"use strict";p();Object.defineProperty(gAe,"__esModule",{value:!0});gAe.AsyncIterUtilsExt=gAe.AsyncIterUtils=void 0;var YBi;(function(t){async function*e(d,f){for await(let h of d)yield f(h)}a(e,"map"),t.map=e;async function*r(d,f,h){let m=d[Symbol.asyncIterator](),g;for(;!(g=await m.next()).done;)yield f(g.value);return h(g.value)}a(r,"mapWithReturn"),t.mapWithReturn=r;async function*n(d,f){for await(let h of d)f(h)&&(yield h)}a(n,"filter"),t.filter=n;async function o(d){let f=[];for await(let h of d)f.push(h);return f}a(o,"toArray"),t.toArray=o;async function*s(d){for(let f of d)yield f}a(s,"fromArray"),t.fromArray=s;async function*c(d,f){for(let h of d)yield h;return f}a(c,"fromArrayWithReturn"),t.fromArrayWithReturn=c;async function l(d){let f=d[Symbol.asyncIterator](),h=[],m;for(;!(m=await f.next()).done;)h.push(m.value);return[h,m.value]}a(l,"toArrayWithReturn"),t.toArrayWithReturn=l;async function u(d){let f=d[Symbol.asyncIterator](),h;do h=await f.next();while(!h.done);return h.value}a(u,"drainUntilReturn"),t.drainUntilReturn=u})(YBi||(gAe.AsyncIterUtils=YBi={}));var KBi;(function(t){async function*e(r){let n=null;for await(let o of r){n??="",n+=o;let s=n.split(/\r?\n/);n=s.pop()??"",yield*s}n!==null&&(yield n)}a(e,"splitLines"),t.splitLines=e})(KBi||(gAe.AsyncIterUtilsExt=KBi={}))});var J2r=I(K2r=>{"use strict";p();Object.defineProperty(K2r,"__esModule",{value:!0});K2r.backwardCompatSetting=cmc;function cmc(t,e){return e(t)}a(cmc,"backwardCompatSetting")});var ZBi=I(WT=>{"use strict";p();Object.defineProperty(WT,"__esModule",{value:!0});WT.LineWithTokens=WT.Token=void 0;WT.getOrDeduceSelectionFromLastEdit=umc;WT.clipTokensToRange=JBi;WT.clipTokensToRangeAndAdjustOffsets=fmc;WT.removeTokensInRangeAndAdjustOffsets=pmc;WT.getTokensFromLogProbs=hmc;WT.getTokensFromLinesWithTokens=mmc;WT.mergeOffsetRangesAtDistance=gmc;var lmc=bs(),AAe=sd();function umc(t){let e=new AAe.OffsetRange(0,0);return t.lastSelectionInAfterEdit&&!t.lastSelectionInAfterEdit.equals(e)?t.documentAfterEdits.getTransformer().getRange(t.lastSelectionInAfterEdit):dmc(t)}a(umc,"getOrDeduceSelectionFromLastEdit");function dmc(t){let e=t.recentEdits.edits.at(-1);if(e===void 0)return null;let r=e.replacements.at(-1);if(r===void 0)return null;let n=r.replaceRange,s=r.newText.length-n.length,c=n.endExclusive+s;return t.documentAfterEdits.getTransformer().getRange(new AAe.OffsetRange(c,c))}a(dmc,"deduceSelectionFromLastEdit");var C_t=class t{static{a(this,"Token")}get id(){return this.text+"_"+this.range.toString()}constructor(e,r,n){this.text=e,this.value=r,this.range=new AAe.OffsetRange(n,n+e.length)}equals(e){return this.range.equals(e.range)&&this.text===e.text}deltaOffset(e){return new t(this.text,this.value,this.range.start+e)}};WT.Token=C_t;function JBi(t,e){return t.filter(r=>e.intersects(r.range))}a(JBi,"clipTokensToRange");function fmc(t,e){return JBi(t,e).map(r=>r.deltaOffset(-e.start))}a(fmc,"clipTokensToRangeAndAdjustOffsets");function pmc(t,e){let r=[];for(let n of t)e.containsRange(n.range)||(n.range.start>e.start&&(n=n.deltaOffset(-e.length)),r.push(n));return r}a(pmc,"removeTokensInRangeAndAdjustOffsets");function hmc(t,e){let r=e;return t.content.map(n=>{let o=new C_t(n.token,n.logprob,r);return r+=o.range.length,o})}a(hmc,"getTokensFromLogProbs");var Z2r=class t{static{a(this,"LineWithTokens")}static stringEquals(e,r){return e._text===r._text}static fromText(e,r){r=r??[];let n=[];for(;;){let o=e.indexOf(`\r `),s=e.indexOf(` `),c=o===-1?s:s===-1?o:Math.min(o,s),l=o!==-1?`\r `:s===-1?void 0:` `;if(l===void 0){n.push(new t(e,r,` -`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};JT.LineWithTokens=gDr;function cAc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(cAc,"getTokensFromLinesWithTokens");function lAc(t,e){if(e<0)throw new rAc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new xAe.OffsetRange(o.start-e,o.endExclusive+e)),n=new xAe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new xAe.OffsetRange(o.start+e,o.endExclusive-e))}a(lAc,"mergeOffsetRangesAtDistance")});var oLi=I(L_t=>{"use strict";p();Object.defineProperty(L_t,"__esModule",{value:!0});L_t.DelaySession=void 0;var ADr=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};L_t.DelaySession=ADr});var lLi=I(_p=>{"use strict";p();var uAc=_p&&_p.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},F_t=_p&&_p.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(_p,"__esModule",{value:!0});_p.UserInteractionMonitor=_p.MAX_INTERACTIONS_STORED=_p.MAX_INTERACTIONS_CONSIDERED=_p.ActionKind=void 0;_p.getWindowWithIgnoredLimit=aLi;_p.getUserHappinessScore=cLi;var wAe=Il(),Yre=WA(),dAc=pp(),fAc=gp(),pAc=o0(),sLi=L_(),hAc=oLi(),ZT;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(ZT||(_p.ActionKind=ZT={}));_p.MAX_INTERACTIONS_CONSIDERED=10;_p.MAX_INTERACTIONS_STORED=30;function aLi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-_p.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length<_p.MAX_INTERACTIONS_CONSIDERED;u--){let d=t[u];if(d.kind===ZT.Ignored){let f=!1;if(r&&c>=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(aLi,"getWindowWithIgnoredLimit");function cLi(t,e){if(t.length===0)return .5;let r=aLi(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/_p.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(cLi,"getUserHappinessScore");var yDr=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(ZT.Accepted)}handleRejection(){this._recordUserAction(ZT.Rejected)}handleIgnored(){this._recordUserAction(ZT.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===ZT.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-_p.MAX_INTERACTIONS_STORED),e!==ZT.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-_p.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new hAc.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===ZT.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=Yre.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(wAe.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=Yre.AggressivenessLevel.High:c>=s.mediumThreshold?o=Yre.AggressivenessLevel.Medium:o=Yre.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=wAe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return Yre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,Yre.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:sLi.ErrorUtils.toString(sLi.ErrorUtils.fromUnknown(n)),configValue:r}),Yre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return cLi(this._recentUserActionsForAggressiveness,e)}};_p.UserInteractionMonitor=yDr;_p.UserInteractionMonitor=yDr=uAc([F_t(0,wAe.IConfigurationService),F_t(1,fAc.IExperimentationService),F_t(2,dAc.ILogService),F_t(3,pAc.ITelemetryService)],yDr)});var uLi=I(EDr=>{"use strict";p();Object.defineProperty(EDr,"__esModule",{value:!0});EDr.isImportStatement=mAc;function mAc(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(mAc,"isImportStatement")});var pLi=I(U_t=>{"use strict";p();Object.defineProperty(U_t,"__esModule",{value:!0});U_t.IgnoreImportChangesAspect=void 0;var dLi=Myr(),gAc=El(),fLi=uLi(),_Dr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,fLi.isImportStatement)(o,r))||AAc(e,n).some(o=>(0,fLi.isImportStatement)(o,r))}static filterEdit(e,r,n=dLi.ImportChanges.None){if(n===dLi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};U_t.IgnoreImportChangesAspect=_Dr;function AAc(t,e){return(0,gAc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(AAc,"getOldLines")});var vDr=I(Q_t=>{"use strict";p();Object.defineProperty(Q_t,"__esModule",{value:!0});Q_t.FetchStreamError=void 0;var CDr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};Q_t.FetchStreamError=CDr});var hLi=I(q_t=>{"use strict";p();Object.defineProperty(q_t,"__esModule",{value:!0});q_t.DiagnosticData=void 0;var yAc=xP(),bDr=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,yAc.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};q_t.DiagnosticData=bDr});var x$=I(RAe=>{"use strict";p();Object.defineProperty(RAe,"__esModule",{value:!0});RAe.ResponseTags=RAe.PromptTags=void 0;var mLi;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(mLi||(RAe.PromptTags=mLi={}));var gLi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(gLi||(RAe.ResponseTags=gLi={}))});var wDr=I(b6=>{"use strict";p();var EAc=b6&&b6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},_Ac=b6&&b6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(b6,"__esModule",{value:!0});b6.LintErrors=void 0;var CAc=hLi(),IR=WA(),vAc=$G(),bAc=Ts(),SDr=xP(),SAc=qp(),yLi=sd(),TAc=mm(),IAc=x$(),IDr=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new SAc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,SDr.isEqual)(n,s)?H_t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new xDr(s,l.message,l.severity===TAc.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=kAc(n,e.maxLineDistance),n=ALi(n),n=TDr(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,SDr.isEqual)(l.documentUri,o)?e:{...e,showCode:IR.LintOptionShowCode.NO};return j_t(l,this._document.lines,d)}).join(` -`),c=IAc.PromptTags.createLintTag(e.tagName);return`${c.start} +`));break}let u=c+l.length,d=e.substring(0,c),f=r.filter(h=>h.range.start0);n.push(new t(d,f,l)),e=e.substring(u),r=r.map(h=>h.deltaOffset(-u)).filter(h=>h.range.endExclusive>0)}return n}get text(){return this._text}get tokens(){return this._tokens}get length(){return this._text.length}get lengthWithEOL(){return this._text.length+this._eol.length}get eol(){return this._eol}constructor(e,r,n){this._text=e,this._tokens=r,this._eol=n}trim(){return this.trimStart().trimEnd()}trimStart(){let e=this._text.trimStart(),r=this._text.length-e.length,n=this._tokens.map(o=>o.deltaOffset(-r)).filter(o=>o.range.endExclusive>0);return new t(e,n,this._eol)}trimEnd(){let e=this._text.trimEnd(),r=this._tokens.filter(n=>n.range.starts.deltaOffset(-e)).filter(s=>s.range.endExclusive>0&&s.range.startr.equals(e.tokens[n]))}dropTokens(e){return new t(this._text,this._tokens.filter(r=>!e.some(n=>r.equals(n))),this._eol)}findTokens(e){return this._tokens.filter(e)}};WT.LineWithTokens=Z2r;function mmc(t){let e=0,r=[];for(let s of t){let c=s.text+s.eol;r.push(...s.tokens.map(l=>l.deltaOffset(e))),e+=c.length}let n=[],o=new Set;for(let s of r)o.has(s.id)||(o.add(s.id),n.push(s));return n}a(mmc,"getTokensFromLinesWithTokens");function gmc(t,e){if(e<0)throw new lmc.BugIndicatingError("Distance must be positive");let r=t.map(o=>new AAe.OffsetRange(o.start-e,o.endExclusive+e)),n=new AAe.OffsetRangeSet;for(let o of r)n.addRange(o);return n.ranges.map(o=>new AAe.OffsetRange(o.start+e,o.endExclusive-e))}a(gmc,"mergeOffsetRangesAtDistance")});var XBi=I(b_t=>{"use strict";p();Object.defineProperty(b_t,"__esModule",{value:!0});b_t.DelaySession=void 0;var X2r=class{static{a(this,"DelaySession")}constructor(e,r,n=Date.now()){this.baseDebounceTime=e,this.expectedTotalTime=r,this.providerInvocationTime=n,this.extraDebounce=0}setExtraDebounce(e){this.extraDebounce=e}setBaseDebounceTime(e){this.baseDebounceTime=e}setExpectedTotalTime(e){this.expectedTotalTime=e}getDebounceTime(){let r=(this.expectedTotalTime===void 0?this.baseDebounceTime:Math.min(this.baseDebounceTime,this.expectedTotalTime))+this.extraDebounce,n=Date.now()-this.providerInvocationTime;return Math.max(0,r-n)}getArtificialDelay(){if(this.expectedTotalTime===void 0)return 0;let e=Date.now()-this.providerInvocationTime;return Math.max(0,this.expectedTotalTime-e)}};b_t.DelaySession=X2r});var nLi=I(bp=>{"use strict";p();var Amc=bp&&bp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},S_t=bp&&bp.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(bp,"__esModule",{value:!0});bp.UserInteractionMonitor=bp.MAX_INTERACTIONS_STORED=bp.MAX_INTERACTIONS_CONSIDERED=bp.ActionKind=void 0;bp.getWindowWithIgnoredLimit=tLi;bp.getUserHappinessScore=rLi;var yAe=Sl(),jre=ZA(),ymc=Ap(),Emc=_p(),_mc=Bh(),eLi=O_(),vmc=XBi(),zT;(function(t){t.Accepted="accepted",t.Rejected="rejected",t.Ignored="ignored"})(zT||(bp.ActionKind=zT={}));bp.MAX_INTERACTIONS_CONSIDERED=10;bp.MAX_INTERACTIONS_STORED=30;function tLi(t,e){let{limitConsecutiveIgnored:r,limitTotalIgnored:n,ignoredLimit:o}=e;if(!r&&!n)return t.slice(-bp.MAX_INTERACTIONS_CONSIDERED);let s=[],c=0,l=0;for(let u=t.length-1;u>=0&&s.length=o&&(f=!0),n&&l>=o&&(f=!0),f)continue;c++,l++}else c=0;s.push(d)}return s.reverse(),s}a(tLi,"getWindowWithIgnoredLimit");function rLi(t,e){if(t.length===0)return .5;let r=tLi(t,e);if(r.length===0)return .5;let n=0,o=0,s=0;for(let u=0;u0?n/o:.5,l=s/bp.MAX_INTERACTIONS_CONSIDERED;return .5+(c-.5)*l}a(rLi,"getUserHappinessScore");var eDr=class{static{a(this,"UserInteractionMonitor")}constructor(e,r,n,o){this._configurationService=e,this._experimentationService=r,this._logService=n,this._telemetryService=o,this._recentUserActionsForAggressiveness=[],this._recentUserActionsForTiming=[],this._lastActionWasAcceptance=!1}handleAcceptance(){this._recordUserAction(zT.Accepted)}handleRejection(){this._recordUserAction(zT.Rejected)}handleIgnored(){this._recordUserAction(zT.Ignored)}get wasLastActionAcceptance(){return this._lastActionWasAcceptance}_recordUserAction(e){let r=Date.now();this._lastActionWasAcceptance=e===zT.Accepted,this._recentUserActionsForAggressiveness.push({time:r,kind:e}),this._recentUserActionsForAggressiveness=this._recentUserActionsForAggressiveness.slice(-bp.MAX_INTERACTIONS_STORED),e!==zT.Ignored&&(this._recentUserActionsForTiming.push({time:r,kind:e}),this._recentUserActionsForTiming=this._recentUserActionsForTiming.slice(-bp.MAX_INTERACTIONS_CONSIDERED))}createDelaySession(e){let r=this._configurationService.getExperimentBasedConfig(yAe.ConfigKey.TeamInternal.InlineEditsDebounce,this._experimentationService),o=this._configurationService.getExperimentBasedConfig(yAe.ConfigKey.TeamInternal.InlineEditsBackoffDebounceEnabled,this._experimentationService)?this._getExpectedTotalTime(r):void 0;return new vmc.DelaySession(r,o,e)}_getExpectedTotalTime(e){let l=Date.now(),u=1;for(let f of this._recentUserActionsForTiming){let h=l-f.time;if(h>6e5)continue;let m=Math.exp(-h/6e5),g=f.kind===zT.Rejected?1.5:.8;u*=1+(g-1)*m}let d=e*u;return d=Math.min(3e3,Math.max(50,d)),d}getAggressivenessLevel(){let e=this._configurationService.getExperimentBasedConfig(yAe.ConfigKey.Advanced.InlineEditsAggressiveness,this._experimentationService),r=jre.AggressivenessSetting.toLevel(e);if(r!==void 0)return{aggressivenessLevel:r,userHappinessScore:void 0};let n=this._configurationService.getExperimentBasedConfig(yAe.ConfigKey.TeamInternal.InlineEditsXtabAggressivenessLevel,this._experimentationService);if(n!==void 0)return{aggressivenessLevel:n,userHappinessScore:void 0};let o,s=this._getUserHappinessScoreConfiguration(),c=this._getUserHappinessScore(s);return c>=s.highThreshold?o=jre.AggressivenessLevel.High:c>=s.mediumThreshold?o=jre.AggressivenessLevel.Medium:o=jre.AggressivenessLevel.Low,{aggressivenessLevel:o,userHappinessScore:c}}_getUserHappinessScoreConfiguration(){let e=yAe.ConfigKey.TeamInternal.InlineEditsUserHappinessScoreConfigurationString,r=this._configurationService.getExperimentBasedConfig(e,this._experimentationService);if(r===void 0)return jre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION;try{return(0,jre.parseUserHappinessScoreConfigurationString)(r)}catch(n){return this._logService.error(n,"Failed to parse user happiness score configuration, using default config"),this._telemetryService.sendMSFTTelemetryEvent("incorrectNesAdaptiveAggressivenessConfig",{configName:e.id,errorMessage:eLi.ErrorUtils.toString(eLi.ErrorUtils.fromUnknown(n)),configValue:r}),jre.DEFAULT_USER_HAPPINESS_SCORE_CONFIGURATION}}_getUserHappinessScore(e){return rLi(this._recentUserActionsForAggressiveness,e)}};bp.UserInteractionMonitor=eDr;bp.UserInteractionMonitor=eDr=Amc([S_t(0,yAe.IConfigurationService),S_t(1,Emc.IExperimentationService),S_t(2,ymc.ILogService),S_t(3,_mc.ITelemetryService)],eDr)});var iLi=I(tDr=>{"use strict";p();Object.defineProperty(tDr,"__esModule",{value:!0});tDr.isImportStatement=Cmc;function Cmc(t,e){switch(e){case"java":return!!t.match(/^\s*import\s/);case"typescript":case"typescriptreact":case"javascript":case"javascriptreact":return!!t.match(/^\s*import[\s{*]|^\s*[var|const|let].*=\s*require\(/);case"php":return!!t.match(/^\s*use/);case"rust":return!!t.match(/^\s*use\s+[\w:{}, ]+\s*(as\s+\w+)?;/);case"python":return!!t.match(/^\s*from\s+[\w.]+\s+import\s+[\w, *]+$/)||!!t.match(/^\s*import\s+[\w, ]+$/);default:return!1}}a(Cmc,"isImportStatement")});var aLi=I(T_t=>{"use strict";p();Object.defineProperty(T_t,"__esModule",{value:!0});T_t.IgnoreImportChangesAspect=void 0;var oLi=qyr(),bmc=ml(),sLi=iLi(),rDr=class t{static{a(this,"IgnoreImportChangesAspect")}static isImportChange(e,r,n){return e.newLines.some(o=>(0,sLi.isImportStatement)(o,r))||Smc(e,n).some(o=>(0,sLi.isImportStatement)(o,r))}static filterEdit(e,r,n=oLi.ImportChanges.None){if(n===oLi.ImportChanges.All)return r;let o=e.languageId,s=e.documentLinesBeforeEdit;return r.filter(l=>!t.isImportChange(l,o,s))}};T_t.IgnoreImportChangesAspect=rDr;function Smc(t,e){return(0,bmc.coalesce)(t.lineRange.mapToLineArray(r=>e[r-1]))}a(Smc,"getOldLines")});var iDr=I(I_t=>{"use strict";p();Object.defineProperty(I_t,"__esModule",{value:!0});I_t.FetchStreamError=void 0;var nDr=class extends Error{static{a(this,"FetchStreamError")}constructor(e){super("Fetch stream failed"),this.reason=e}};I_t.FetchStreamError=nDr});var cLi=I(x_t=>{"use strict";p();Object.defineProperty(x_t,"__esModule",{value:!0});x_t.DiagnosticData=void 0;var Tmc=ak(),oDr=class{static{a(this,"DiagnosticData")}constructor(e,r,n,o,s,c){this.documentUri=e,this.message=r,this.severity=n,this.range=o,this.code=s,this.source=c}toString(){return`${this.severity.toUpperCase()}: ${this.message} (${this.range})`}equals(e){return(0,Tmc.isEqual)(this.documentUri,e.documentUri)&&this.message===e.message&&this.severity===e.severity&&this.range.equals(e.range)&&this.code===e.code&&this.source===e.source}};x_t.DiagnosticData=oDr});var g$=I(EAe=>{"use strict";p();Object.defineProperty(EAe,"__esModule",{value:!0});EAe.ResponseTags=EAe.PromptTags=void 0;var lLi;(function(t){t.CURSOR="<|cursor|>";function e(n){return{start:`<|${n}|>`,end:`<|/${n}|>`}}a(e,"createTag"),t.EDIT_WINDOW=e("code_to_edit"),t.AREA_AROUND=e("area_around_code_to_edit"),t.CURRENT_FILE=e("current_file_content"),t.CURSOR_LOCATION=e("cursor_location"),t.EDIT_HISTORY=e("edit_diff_history"),t.RECENT_FILES=e("recently_viewed_code_snippets"),t.RECENT_FILE=e("recently_viewed_code_snippet");function r(n){return e(n)}a(r,"createLintTag"),t.createLintTag=r})(lLi||(EAe.PromptTags=lLi={}));var uLi;(function(t){t.NO_EDIT="",t.NO_CHANGE={start:""},t.EDIT={start:"",end:""},t.INSERT={start:"",end:""}})(uLi||(EAe.ResponseTags=uLi={}))});var uDr=I(m6=>{"use strict";p();var Imc=m6&&m6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},xmc=m6&&m6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(m6,"__esModule",{value:!0});m6.LintErrors=void 0;var wmc=cLi(),bR=ZA(),Rmc=OG(),Pmc=bs(),sDr=ak(),kmc=Gp(),fLi=sd(),Dmc=Am(),Nmc=g$(),cDr=class{static{a(this,"LintErrors")}constructor(e,r,n,o){this._documentId=e,this._document=r,this._langDiagService=n,this._xtabHistory=o}_diagnostics(e){let r=e?[[e,this._langDiagService.getDiagnostics(e)]]:this._langDiagService.getAllDiagnostics(),n=this._documentId.toUri();return r.map(o=>{let[s,c]=o;return c.map(l=>{let u=new kmc.Range(l.range.start.line+1,l.range.start.character+1,l.range.end.line+1,l.range.end.character+1),d=(0,sDr.isEqual)(n,s)?R_t.fromPositions(u.getStartPosition(),this._document.cursorPosition):void 0;return new lDr(s,l.message,l.severity===Dmc.DiagnosticSeverity.Error?"error":"warning",d,u,this._document.transformer.getOffsetRange(u),l.code&&typeof l.code!="number"&&typeof l.code!="string"?l.code.value:l.code,l.source)})}).flat()}_getRelevantDiagnostics(e,r){let n=this._diagnostics(r);return n=Lmc(n,e.maxLineDistance),n=dLi(n),n=aDr(n,e.warnings),n.slice(0,e.maxLints)}getFormattedLintErrors(e){let r=this._getRelevantDiagnostics(e,this._documentId.toUri()),n;if(e.nRecentFiles>0&&this._xtabHistory){let l=this._collectRecentFileUris(e.nRecentFiles),u=this._getRecentFileDiagnostics(l,e);n=[...r,...u].slice(0,e.maxLints)}else n=r;this._previousFormttedDiagnostics=n;let o=this._documentId.toUri(),s=n.map(l=>{let d=(0,sDr.isEqual)(l.documentUri,o)?e:{...e,showCode:bR.LintOptionShowCode.NO};return w_t(l,this._document.lines,d)}).join(` +`),c=Nmc.PromptTags.createLintTag(e.tagName);return`${c.start} ${s} -${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=TDr(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new bAc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,SDr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===IR.LintOptionShowCode.NO)continue;if(ELi(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:IR.LintOptionWarning.YES,showCode:IR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=TDr(r,IR.LintOptionWarning.YES),r=ALi(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:j_t(o,this._document.lines,e),formattedCode:j_t(o,this._document.lines,{...e,showCode:IR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:j_t(o,this._document.lines,{...e,showCode:IR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};b6.LintErrors=IDr;b6.LintErrors=IDr=EAc([_Ac(2,vAc.ILanguageDiagnosticsService)],IDr);function j_t(t,e,r){let n=xAc(t,t.documentRange);if(r.showCode===IR.LintOptionShowCode.NO)return n;let o=wAc(t.documentRange,r,e);return n+` +${c.end}`}_collectRecentFileUris(e){if(!this._xtabHistory)return[];let r=[],n=new Set,o=this._documentId;for(let s=this._xtabHistory.length-1;s>=0;--s){let c=this._xtabHistory[s];if(!(c.docId===o||n.has(c.docId))&&(r.push(c.docId.toUri()),n.add(c.docId),r.length>=e))break}return r}_getRecentFileDiagnostics(e,r){let n=[];for(let o of e){let s=this._diagnostics(o);s=aDr(s,r.warnings),s=s.slice().sort((c,l)=>c.documentRange.startLineNumber-l.documentRange.startLineNumber),n.push(...s)}return n}lineNumberInPreviousFormattedPrompt(e,r){if(!this._previousFormttedDiagnostics)throw new Pmc.BugIndicatingError("No previous formatted diagnostics available to check line number against.");let n=this._documentId.toUri();for(let o of this._previousFormttedDiagnostics){if(!(0,sDr.isEqual)(o.documentUri,n))continue;if(o.documentRange.getStartPosition().lineNumber-1===r)return!0;if(e.showCode===bR.LintOptionShowCode.NO)continue;if(pLi(o.documentRange,e).contains(r))return!0}return!1}getData(){let e={tagName:"telemetry",warnings:bR.LintOptionWarning.YES,showCode:bR.LintOptionShowCode.NO,maxLints:Number.MAX_SAFE_INTEGER,maxLineDistance:Number.MAX_SAFE_INTEGER,nRecentFiles:0},r=this._diagnostics(void 0);r=aDr(r,bR.LintOptionWarning.YES),r=dLi(r),r=r.slice(0,20);let n=r.map(o=>({uri:o.documentUri.toString(),line:o.documentRange.startLineNumber,column:o.documentRange.startColumn,endLine:o.documentRange.endLineNumber,endColumn:o.documentRange.endColumn,severity:o.severity,message:o.message,code:o.code,source:o.source,lineDistance:o.distance?.lineDistance,formatted:w_t(o,this._document.lines,e),formattedCode:w_t(o,this._document.lines,{...e,showCode:bR.LintOptionShowCode.YES}),formattedCodeWithSurrounding:w_t(o,this._document.lines,{...e,showCode:bR.LintOptionShowCode.YES_WITH_SURROUNDING})}));return JSON.stringify(n)}};m6.LintErrors=cDr;m6.LintErrors=cDr=Imc([xmc(2,Rmc.ILanguageDiagnosticsService)],cDr);function w_t(t,e,r){let n=Mmc(t,t.documentRange);if(r.showCode===bR.LintOptionShowCode.NO)return n;let o=Omc(t.documentRange,r,e);return n+` `+o.join(` -`)}a(j_t,"formatSingleDiagnostic");function xAc(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(xAc,"formatDiagnosticMessage");function wAc(t,e,r){let o=ELi(t,e).intersect(new yLi.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(kAc,"filterDiagnosticsByDistance");function ALi(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:H_t.compareFn(e.distance,r.distance))}a(ALi,"sortDiagnosticsByDistance");function TDr(t,e){switch(e){case IR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case IR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case IR.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(TDr,"filterDiagnosticsBySeverity");var H_t=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},xDr=class extends CAc.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var kAe=I(G_t=>{"use strict";p();Object.defineProperty(G_t,"__esModule",{value:!0});G_t.toUniquePath=DAc;G_t.countTokensForLines=NAc;var PAc=yK();function DAc(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===PAc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(DAc,"toUniquePath");function NAc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(NAc,"countTokensForLines")});var _Li=I(RDr=>{"use strict";p();Object.defineProperty(RDr,"__esModule",{value:!0});RDr.getEditDiffHistory=BAc;var MAc=kD(),w$=El(),OAc=kAe();function BAc(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let E=LAc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` +`)}a(w_t,"formatSingleDiagnostic");function Mmc(t,e){let r="";t.code&&(r=` ${t.source?t.source.toUpperCase():""}${t.code}`);let n=e.getStartPosition();return`${n.lineNumber-1}:${n.column-1} - ${t.severity}${r}: ${t.message}`}a(Mmc,"formatDiagnosticMessage");function Omc(t,e,r){let o=pLi(t,e).intersect(new fLi.OffsetRange(0,r.length));if(!o)return[];let s=[];for(let c=o.start;cr.distance?.lineDistance!==void 0&&r.distance.lineDistance<=e)}a(Lmc,"filterDiagnosticsByDistance");function dLi(t){return t.slice().sort((e,r)=>e.distance===void 0&&r.distance===void 0?0:e.distance===void 0?1:r.distance===void 0?-1:R_t.compareFn(e.distance,r.distance))}a(dLi,"sortDiagnosticsByDistance");function aDr(t,e){switch(e){case bR.LintOptionWarning.NO:return t.filter(r=>r.severity==="error");case bR.LintOptionWarning.YES:return t.filter(r=>r.severity==="error"||r.severity==="warning");case bR.LintOptionWarning.YES_IF_NO_ERRORS:{let r=t.filter(n=>n.severity==="error");return r.length>0?r:t.filter(n=>n.severity==="error"||n.severity==="warning")}}}a(aDr,"filterDiagnosticsBySeverity");var R_t=class t{static{a(this,"CursorDistance")}static compareFn(e,r){return e.lineDistance!==r.lineDistance?e.lineDistance-r.lineDistance:e.columnDistance-r.columnDistance}static fromPositions(e,r){return new t(Math.abs(e.lineNumber-r.lineNumber),Math.abs(e.column-r.column))}constructor(e,r){this.lineDistance=e,this.columnDistance=r}},lDr=class extends wmc.DiagnosticData{static{a(this,"DiagnosticDataWithDistance")}constructor(e,r,n,o,s,c,l,u){super(e,r,n,c,l,u),this.distance=o,this.documentRange=s}}});var _Ae=I(P_t=>{"use strict";p();Object.defineProperty(P_t,"__esModule",{value:!0});P_t.toUniquePath=Umc;P_t.countTokensForLines=Qmc;var Fmc=uY();function Umc(t,e){let r=t.path,n=e===void 0?void 0:e.endsWith("/")?e:e+"/",o=n!==void 0&&r.startsWith(n)?r.substring(n.length):r;return t.toUri().scheme===Fmc.Schemas.vscodeNotebookCell?`${o}#${t.fragment}`:o}a(Umc,"toUniquePath");function Qmc(t,e){return t.reduce((r,n)=>r+e(n)+1,0)}a(Qmc,"countTokensForLines")});var hLi=I(dDr=>{"use strict";p();Object.defineProperty(dDr,"__esModule",{value:!0});dDr.getEditDiffHistory=Hmc;var qmc=xD(),A$=ml(),jmc=_Ae();function Hmc(t,e,r,n,{onlyForDocsInPrompt:o,maxTokens:s,nEntries:c,useRelativePaths:l}){let u=l?t.workspaceRoot?.path:void 0,d=e.slice().reverse(),f=s,h=0,m=[];for(let y of d){if(m.length>=c)break;if(y.kind==="visibleRanges"||o&&!r.has(y.docId))continue;let E=Gmc(y,u);if(E===null)continue;let _=n(E);if(f-=_,f<0)break;h+=_,m.push(E)}let g=m.reverse(),A=g.join(` `);return g.length>0&&(A+=` -`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(BAc,"getEditDiffHistory");function LAc(t,e){let r=[],n=MAc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,w$.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,w$.pushMany)(r,d.map(g=>`-${g}`)),(0,w$.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,OAc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,w$.pushMany)(c,r),c.join(` -`)}a(LAc,"generateDocDiff")});var kDr=I(R$=>{"use strict";p();Object.defineProperty(R$,"__esModule",{value:!0});R$.count=FAc;R$.findInsertionIndexInSortedArray=UAc;R$.max=QAc;R$.filterMap=qAc;R$.min=jAc;R$.batchArrayElements=HAc;function FAc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a(FAc,"count");function UAc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(UAc,"findInsertionIndexInSortedArray");function QAc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(QAc,"max");function qAc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(qAc,"filterMap");function jAc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var GAc=BE&&BE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),$Ac=BE&&BE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),VAc=BE&&BE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oBDr(A.entries)):d=bLi(e,t.id,c,l).map(A=>TLi(A));let{snippets:f,docsInPrompt:h}=PLi(d,n,o);r&&ILi(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=xLi(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` +`),{promptPiece:A,nDiffs:m.length,totalTokens:h}}a(Hmc,"getEditDiffHistory");function Gmc(t,e){let r=[],n=qmc.RootedEdit.toLineEdit(t.edit),o=t.edit.base.getLines();for(let u of(0,A$.groupAdjacentBy)(n.replacements,(d,f)=>d.lineRange.endLineNumberExclusive>=f.lineRange.startLineNumber)){let d=[],f=[],h=u[0].lineRange.startLineNumber;for(let g of u){if(hg.trim().length===0)&&f.every(g=>g.trim().length===0)||d.length===f.length&&d.every((g,A)=>g===f[A]))continue;let m=u[0].lineRange.startLineNumber-1;r.push(`@@ -${m},${d.length} +${m},${f.length} @@`),(0,A$.pushMany)(r,d.map(g=>`-${g}`)),(0,A$.pushMany)(r,f.map(g=>`+${g}`))}if(r.length===0)return null;let s=(0,jmc.toUniquePath)(t.docId,e),c=[`--- ${s}`,`+++ ${s}`];return(0,A$.pushMany)(c,r),c.join(` +`)}a(Gmc,"generateDocDiff")});var fDr=I(y$=>{"use strict";p();Object.defineProperty(y$,"__esModule",{value:!0});y$.count=$mc;y$.findInsertionIndexInSortedArray=Vmc;y$.max=Wmc;y$.filterMap=zmc;y$.min=Ymc;y$.batchArrayElements=Kmc;function $mc(t,e){let r=0;for(let n of t)e(n)&&r++;return r}a($mc,"count");function Vmc(t,e,r){let n=0,o=t.length;for(;n>>1;r(t[s],e)?n=s+1:o=s}return n}a(Vmc,"findInsertionIndexInSortedArray");function Wmc(t,e){if(t.length===0)return;let r=t[0];for(let n=1;n0&&(r=o)}return r}a(Wmc,"max");function zmc(t,e){let r=[];for(let n of t){let o=e(n);o!=null&&r.push(o)}return r}a(zmc,"filterMap");function Ymc(t){if(t.length===0)return 1/0;let e=t[0];for(let r=1;r{"use strict";p();var Jmc=NE&&NE.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Zmc=NE&&NE.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Xmc=NE&&NE.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oyDr(A.entries)):d=ALi(e,t.id,c,l).map(A=>ELi(A));let{snippets:f,docsInPrompt:h}=TLi(d,n,o);r&&_Li(r,f,o.languageContext.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers);let m;return o.neighborFiles.enabled&&s&&s.length>0&&(m=vLi(s,f,h,o.neighborFiles.maxTokens,n,o.recentlyViewedDocuments.includeLineNumbers)),{codeSnippets:f.join(` -`),documents:h,neighborSnippetsResult:m}}a(ZAc,"getRecentCodeSnippets");function XAc(t,e,r){switch(e){case PDr.IncludeLineNumbersOption.WithSpaceAfter:return t.map((n,o)=>`${r+o}| ${n}`);case PDr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case PDr.IncludeLineNumbersOption.None:return t;default:(0,zAc.assertNever)(e)}}a(XAc,"formatLinesWithLineNumbers");function $_t(t,e,r){let n=(0,MDr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=XAc(e,r.includeLineNumbers,r.startLineOffset).join(` -`);return[CLi.PromptTags.RECENT_FILE.start,o,c,CLi.PromptTags.RECENT_FILE.end].join(` -`)}a($_t,"formatCodeSnippet");function bLi(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a(bLi,"collectRecentDocuments");function SLi(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(SLi,"collectRecentDocumentsGrouped");function eyc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===NDr.RecentFileClippingStrategy.Proportional?SLi(e,t.id,n,o).map(u=>BDr(u.entries)):bLi(e,t.id,n,o).map(l=>TLi(l))}a(eyc,"prepareRecentCodeSnippets");function ODr(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(ODr,"selectFocalRangesWithinSpanCap");function TLi(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(TLi,"historyEntryToCodeSnippet");function BDr(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(BDr,"historyEntriesToCodeSnippet");function ILi(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===WAc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=DDr.DocumentId.create(l.uri.toString());e.push($_t(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(ILi,"appendLanguageContextSnippets");function xLi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=DDr.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push($_t(DDr.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(xLi,"appendNeighborFileSnippets");function wLi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,MDr.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push($_t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(wLi,"clipFullDocument");function RLi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=ODr(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let E=y*r,_=Math.min(E+r,h.length);A+=(0,MDr.countTokensForLines)(h.slice(E,_),n)}return A}a(RLi,"computeFocalPageCost");function kLi(t,e,r,n,o,s,c){if(n<=0)return;let l=t.content.getTransformer(),u=e*3,d=ODr(t.focalRanges,b=>l.getPosition(b).lineNumber,u);if(d.length===0)return n;let f=Math.min(...d.map(b=>b.start)),h=Math.max(...d.map(b=>b.endExclusive-1)),m=l.getPosition(f),g=l.getPosition(h),{firstPageIdx:A,lastPageIdxIncl:y,budgetLeft:E}=(0,JAc.expandRangeToPageRange)(t.content.getLines(),new KAc.OffsetRange(m.lineNumber-1,g.lineNumber),e,n,o,!1);if(E===n||E<0)return;let _=A*e,v=t.content.getLines().slice(_,(y+1)*e);return c.docsInPrompt.add(t.id),c.snippets.push($_t(t.id,v,{truncated:v.lengthy.focalRanges!==void 0&&y.focalRanges.length>0?RLi(y.content,y.focalRanges,n,e)??0:0),u=t.length,d=l.reduce((y,E)=>y+E,0);for(;u>0&&d>s;)u--,d-=l[u];if(u===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let f=s-d,h=t.slice(0,u).map(y=>y.editEntryCount??1),m=h.reduce((y,E)=>y+E,0),g=h.map(y=>Math.floor(f*(y/m))),A=0;for(let y=0;y0)A=kLi(E,n,_.length,v,e,c,o)??v;else{let b=(0,vLi.batchArrayElements)(_,n);A=wLi(E,b,_.length,v,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-A}}a(ryc,"buildCodeSnippetsWithProportionalBudget")});var V_t=I(Gd=>{"use strict";p();var nyc=Gd&&Gd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),iyc=Gd&&Gd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),oyc=Gd&&Gd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o`${r+o}| ${n}`);case pDr.IncludeLineNumbersOption.WithoutSpace:return t.map((n,o)=>`${r+o}|${n}`);case pDr.IncludeLineNumbersOption.None:return t;default:(0,tgc.assertNever)(e)}}a(sgc,"formatLinesWithLineNumbers");function k_t(t,e,r){let n=(0,gDr.toUniquePath)(t,void 0),o=r.truncated?`code_snippet_file_path: ${n} (truncated)`:`code_snippet_file_path: ${n}`,c=sgc(e,r.includeLineNumbers,r.startLineOffset).join(` +`);return[mLi.PromptTags.RECENT_FILE.start,o,c,mLi.PromptTags.RECENT_FILE.end].join(` +`)}a(k_t,"formatCodeSnippet");function ALi(t,e,r,n){let o=[],s=new Set;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!(!r&&l.kind==="visibleRanges")&&!(l.docId===e||s.has(l.docId))&&(o.push(l),s.add(l.docId),o.length>=n))break}return o}a(ALi,"collectRecentDocuments");function yLi(t,e,r,n){let o=[],s=new Map;for(let c=t.length-1;c>=0;--c){let l=t[c];if(!r&&l.kind==="visibleRanges"||l.docId===e)continue;let u=s.get(l.docId);if(u)u.push(l);else{if(o.length>=n)continue;o.push(l.docId),s.set(l.docId,[l])}}return o.map(c=>({docId:c,entries:s.get(c)}))}a(yLi,"collectRecentDocumentsGrouped");function agc(t,e,r){let{includeViewedFiles:n,nDocuments:o,clippingStrategy:s}=r.recentlyViewedDocuments;return s===mDr.RecentFileClippingStrategy.Proportional?yLi(e,t.id,n,o).map(u=>yDr(u.entries)):ALi(e,t.id,n,o).map(l=>ELi(l))}a(agc,"prepareRecentCodeSnippets");function ADr(t,e,r){if(t.length<=1)return t;let n=[t[0]],o=e(t[0].start),s=e(Math.max(t[0].start,t[0].endExclusive-1));for(let c=1;cr)break;n.push(l),o=f,s=h}return n}a(ADr,"selectFocalRangesWithinSpanCap");function ELi(t){if(t.kind==="edit"){let e=t.edit.edit.applyOnText(t.edit.base);return{id:t.docId,content:e,focalRanges:t.edit.edit.getNewRanges(),editEntryCount:1}}return{id:t.docId,content:t.documentContent,focalRanges:t.visibleRanges}}a(ELi,"historyEntryToCodeSnippet");function yDr(t){let e=t[0],r=e.kind==="edit"?e.edit.edit.applyOnText(e.edit.base):e.documentContent,n=[];for(let s of t)s.kind==="edit"&&n.push(s);let o=[];for(let s=0;s=0;l--)c=c.map(u=>n[l].edit.edit.applyToOffsetRange(u));o.push(...c)}return{id:e.docId,content:r,focalRanges:o.length>0?o:void 0,editEntryCount:Math.max(n.length,1)}}a(yDr,"historyEntriesToCodeSnippet");function _Li(t,e,r,n,o){let s=r;for(let c of t.items){if(c.onTimeout)continue;let l=c.context;if(l.kind===egc.ContextKind.Snippet){let u=l.value,d=r-n(u);if(d<0)break;let f=hDr.DocumentId.create(l.uri.toString());e.push(k_t(f,u.split(/\r?\n/),{truncated:!1,includeLineNumbers:o,startLineOffset:0})),r=d}}return s-r}a(_Li,"appendLanguageContextSnippets");function vLi(t,e,r,n,o,s){let c=n,l=[];for(let d=t.length-1;d>=0;d--){let f=t[d],h=hDr.DocumentId.create(f.uri);if(r.has(h))continue;let m=n-o(f.snippet);m<0||(l.push({snippet:f,originalIndex:d}),r.add(h),n=m)}for(let d=l.length-1;d>=0;d--){let f=l[d].snippet;e.push(k_t(hDr.DocumentId.create(f.uri),f.snippet.split(/\r?\n/),{truncated:!1,includeLineNumbers:s,startLineOffset:f.lineRange.startLine}))}let u=l.map(d=>d.originalIndex).sort((d,f)=>d-f);return{nComputed:t.length,nIncluded:l.length,includedIndices:u,tokensConsumed:c-n}}a(vLi,"appendNeighborFileSnippets");function CLi(t,e,r,n,o,s,c){let l=n,u=[];for(let d of e){let f=l-(0,gDr.countTokensForLines)(d,o);if(f<0)break;u.push(...d),l=f}if(u.length>0){let d=u.length!==r;c.docsInPrompt.add(t.id),c.snippets.push(k_t(t.id,u,{truncated:d,includeLineNumbers:s,startLineOffset:0}))}return l}a(CLi,"clipFullDocument");function bLi(t,e,r,n){let o=t.getTransformer(),s=r*3,c=ADr(e,y=>o.getPosition(y).lineNumber,s);if(c.length===0)return;let l=Math.min(...c.map(y=>y.start)),u=Math.max(...c.map(y=>y.endExclusive-1)),d=o.getPosition(l).lineNumber,f=o.getPosition(u).lineNumber,h=t.getLines(),m=Math.floor((d-1)/r),g=Math.floor((f-1)/r),A=0;for(let y=m;y<=g;y++){let E=y*r,_=Math.min(E+r,h.length);A+=(0,gDr.countTokensForLines)(h.slice(E,_),n)}return A}a(bLi,"computeFocalPageCost");function SLi(t,e,r,n,o,s,c){if(n<=0)return;let l=t.content.getTransformer(),u=e*3,d=ADr(t.focalRanges,b=>l.getPosition(b).lineNumber,u);if(d.length===0)return n;let f=Math.min(...d.map(b=>b.start)),h=Math.max(...d.map(b=>b.endExclusive-1)),m=l.getPosition(f),g=l.getPosition(h),{firstPageIdx:A,lastPageIdxIncl:y,budgetLeft:E}=(0,igc.expandRangeToPageRange)(t.content.getLines(),new ngc.OffsetRange(m.lineNumber-1,g.lineNumber),e,n,o,!1);if(E===n||E<0)return;let _=A*e,v=t.content.getLines().slice(_,(y+1)*e);return c.docsInPrompt.add(t.id),c.snippets.push(k_t(t.id,v,{truncated:v.lengthy.focalRanges!==void 0&&y.focalRanges.length>0?bLi(y.content,y.focalRanges,n,e)??0:0),u=t.length,d=l.reduce((y,E)=>y+E,0);for(;u>0&&d>s;)u--,d-=l[u];if(u===0)return{snippets:[],docsInPrompt:new Set,tokensConsumed:0};let f=s-d,h=t.slice(0,u).map(y=>y.editEntryCount??1),m=h.reduce((y,E)=>y+E,0),g=h.map(y=>Math.floor(f*(y/m))),A=0;for(let y=0;y0)A=SLi(E,n,_.length,v,e,c,o)??v;else{let b=(0,gLi.batchArrayElements)(_,n);A=CLi(E,b,_.length,v,e,c,o)}}return{snippets:o.snippets.reverse(),docsInPrompt:o.docsInPrompt,tokensConsumed:s-A}}a(lgc,"buildCodeSnippetsWithProportionalBudget")});var D_t=I(jd=>{"use strict";p();var ugc=jd&&jd.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),dgc=jd&&jd.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),fgc=jd&&jd.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;of.add(k)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,sBe.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,sBe.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,BLi.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,z_t.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` +${o}`;break}let D=d.promptingStrategy!==$l.PromptingStrategy.Nes41Miniv3&&d.promptingStrategy!==$l.PromptingStrategy.Codexv21NesUnified&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased01&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02WithRecentLineNumbers&&d.promptingStrategy!==$l.PromptingStrategy.PatchBased02WithoutRecentLineNumbers?ygc(x):x;return{prompt:(Egc(v,D,d.languageContext.traitPosition)+T).trim(),nDiffsInPrompt:E,diffTokensInPrompt:_,neighborSnippetsResult:A}}a(mgc,"getUserPrompt");function ggc(t,e,r,n,o,s,c){Agc(c);let l=[],u=[],d=[],f=new Set;f.add(t.id);let h,m="",g=0,A=0,y=(0,W4e.prepareRecentCodeSnippets)(t,e,o),E=0;for(let v of c.order){let b=c.shares[v]??0,T=Math.max(0,Math.floor(E+c.totalTokens*b)),w=0;switch(v){case"recentlyViewedDocuments":{let R={...o,recentlyViewedDocuments:{...o.recentlyViewedDocuments,maxTokens:T}},x=(0,W4e.buildCodeSnippetsUsingPagedClipping)(y,n,R);l.push(...x.snippets),x.docsInPrompt.forEach(P=>f.add(P)),w=x.tokensConsumed;break}case"languageContext":{r&&(w=(0,W4e.appendLanguageContextSnippets)(r,u,T,n,o.recentlyViewedDocuments.includeLineNumbers));break}case"neighborFiles":{o.neighborFiles.enabled&&s&&s.length>0&&(h=(0,W4e.appendNeighborFileSnippets)(s,d,f,T,n,o.recentlyViewedDocuments.includeLineNumbers),w=h.tokensConsumed);break}case"diffHistory":{let R={...o.diffHistory,maxTokens:T},x=(0,PLi.getEditDiffHistory)(t,e,f,n,R);m=x.promptPiece,g=x.nDiffs,A=x.totalTokens,w=x.totalTokens;break}default:(0,M_t.assertNever)(v)}E=Math.max(0,T-w)}return{codeSnippets:[...l,...u,...d].join(` -`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(lyc,"runGlobalBudgetCascade");function uyc(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(uyc,"validateGlobalBudget");function dyc(t){return`\`\`\` +`),documents:f,neighborSnippetsResult:h,editDiffHistory:m,nDiffsInPrompt:g,diffTokensInPrompt:A}}a(ggc,"runGlobalBudgetCascade");function Agc(t){let e=new Set;for(let c of t.order){if(e.has(c))throw new Error(`globalBudget.order contains duplicate part '${c}'`);if(e.add(c),typeof t.shares[c]!="number")throw new Error(`globalBudget.shares is missing entry for '${c}'`)}let r=t.order.indexOf("recentlyViewedDocuments"),n=t.order.indexOf("neighborFiles");if(r!==-1&&n!==-1&&nc+t.shares[l],0);if(Math.abs(o-1)>.001)throw new Error(`globalBudget.shares across order must sum to ~1, got ${o}`)}a(Agc,"validateGlobalBudget");function ygc(t){return`\`\`\` ${t} -\`\`\``}a(dyc,"wrapInBackticks");function fyc(t,e,r){return r==="before"?MLi(t,e,2):MLi(e,t,2)}a(fyc,"addRelatedInformation");function MLi(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` +\`\`\``}a(ygc,"wrapInBackticks");function Egc(t,e,r){return r==="before"?wLi(t,e,2):wLi(e,t,2)}a(Egc,"addRelatedInformation");function wLi(t,e,r){let n=0;for(let s=t.length-1;s>=0&&t[s]===` `;s--)n++;for(let s=0;s, , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case zl.PromptingStrategy.Xtab275EditIntentShort:case zl.PromptingStrategy.Xtab275EditIntent:case zl.PromptingStrategy.Xtab275:o=n;break;case zl.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275Aggressiveness:o=`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===zl.AggressivenessLevel.Medium?n:`${n} -<|aggressive|>${r}<|/aggressive|>`;break;case zl.PromptingStrategy.PatchBased:o='Output a modified diff style format with the changes you want. Each change patch must start with `:` and then include some non empty "anchor lines" preceded by `-` and the new lines meant to replace them preceded by `+`. Put your changes in the order that makes the most sense, for example edits inside the code_to_edit region and near the user\'s <|cursor|> should always be prioritized. Output "" if you don\'t have a good edit candidate.';break;case zl.PromptingStrategy.SimplifiedSystemPrompt:case zl.PromptingStrategy.CopilotNesXtab:case void 0:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${ch.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${ch.PromptTags.EDIT_WINDOW.start}\` and \`${ch.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. +`.repeat(o)+e).trim()}a(wLi,"appendWithNewLineIfNeeded");function _gc(t,e,r){let n=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${dh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${dh.PromptTags.EDIT_WINDOW.start}\` and \`${dh.PromptTags.EDIT_WINDOW.end}\` tags, but do not include the tags themselves. Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Don't include the line numbers or the form #| in your response. Do not skip any lines. Do not be lazy.`,o;switch(t){case $l.PromptingStrategy.PatchBased01:case $l.PromptingStrategy.Codexv21NesUnified:break;case $l.PromptingStrategy.PatchBased02:case $l.PromptingStrategy.PatchBased02WithRecentLineNumbers:case $l.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:o="The developer was working on a section of code within the `current_file_content` - carefully note their `cursor_location` marked with `<|cursor|>`. Using the given `recently_viewed_code_snippets`, `current_file_content`, `edit_diff_history`, and `cursor_location`, please continue the developer's work. Output a modified diff format with a sequence of intuitive next changes, where each patch must start with `:`. Order changes by priority and flow; for instance, edits adjacent to the user's cursor should always be prioritized, followed by lines near the cursor, followed by lines farther away. If there are no good edit candidates, output the empty string \"\". Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. Adhere meticulously to the diff format.";break;case $l.PromptingStrategy.UnifiedModel:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${dh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Start your response with , , or . If you are making an edit, start with and then provide the rewritten code window followed by . If you are inserting new code, start with and then provide only the new code that will be inserted at the cursor position followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case $l.PromptingStrategy.Nes41Miniv3:o=`The developer was working on a section of code within the tags <|code_to_edit|> in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`<|cursor|>\`, please continue the developer's work. Update the <|code_to_edit|> section by predicting and completing the changes they would have made next. Start your response with or . If you are making an edit, start with and then provide the rewritten code window followed by . If no changes are necessary, reply only with . Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;break;case $l.PromptingStrategy.Xtab275EditIntentShort:case $l.PromptingStrategy.Xtab275EditIntent:case $l.PromptingStrategy.Xtab275:o=n;break;case $l.PromptingStrategy.XtabAggressiveness:o=`<|aggressive|>${r}<|/aggressive|>`;break;case $l.PromptingStrategy.Xtab275Aggressiveness:o=`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case $l.PromptingStrategy.Xtab275AggressivenessHighLow:o=r===$l.AggressivenessLevel.Medium?n:`${n} +<|aggressive|>${r}<|/aggressive|>`;break;case $l.PromptingStrategy.PatchBased:o='Output a modified diff style format with the changes you want. Each change patch must start with `:` and then include some non empty "anchor lines" preceded by `-` and the new lines meant to replace them preceded by `+`. Put your changes in the order that makes the most sense, for example edits inside the code_to_edit region and near the user\'s <|cursor|> should always be prioritized. Output "" if you don\'t have a good edit candidate.';break;case $l.PromptingStrategy.SimplifiedSystemPrompt:case $l.PromptingStrategy.CopilotNesXtab:case void 0:o=`The developer was working on a section of code within the tags \`code_to_edit\` in the file located at \`${e}\`. Using the given \`recently_viewed_code_snippets\`, \`current_file_content\`, \`edit_diff_history\`, \`area_around_code_to_edit\`, and the cursor position marked as \`${dh.PromptTags.CURSOR}\`, please continue the developer's work. Update the \`code_to_edit\` section by predicting and completing the changes they would have made next. Provide the revised code that was between the \`${dh.PromptTags.EDIT_WINDOW.start}\` and \`${dh.PromptTags.EDIT_WINDOW.end}\` tags with the following format, but do not include the tags themselves. \`\`\` // Your revised code goes here -\`\`\``;break;default:(0,z_t.assertNever)(t)}return o===void 0?"":` +\`\`\``;break;default:(0,M_t.assertNever)(t)}return o===void 0?"":` -${o}`}a(pyc,"getPostScript");function hyc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===syc.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: +${o}`}a(_gc,"getPostScript");function vgc(t){if(t===void 0)return"";let e=t.items.filter(n=>n.context.kind===pgc.ContextKind.Trait).map(n=>n.context);if(e.length===0)return"";let r=[];for(let n of e)r.push(`${n.name}: ${n.value}`);return`Consider this related information: ${r.join(` -`)}`}a(hyc,"getRelatedInformation");function myc(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(myc,"truncateCode");Gd.N_LINES_ABOVE=2;Gd.N_LINES_BELOW=5;Gd.N_LINES_AS_CONTEXT=15;function LLi(t,e,r,n,o,s){let c=Math.ceil(t.length/r);function l(m){let g=m*r,A=Math.min(g+r,t.length),y=t.slice(g,A);return(0,QDr.countTokensForLines)(y,o)}a(l,"computeTokensForPage");let u=Math.floor(e.start/r),d=Math.floor((e.endExclusive-1)/r),f=n-(0,ayc.range)(u,d+1).reduce((m,g)=>m+l(g),0);if(f<0)return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:f};let h=f;if(s){h=f;for(let m=u-1;m>=0&&h>0;--m){let g=l(m),A=h-g;if(A<0)break;u=m,h=A}for(let m=d+1;m0;++m){let g=l(m),A=h-g;if(A<0)break;d=m,h=A}}else{let m=Math.floor(f/2);h=m;for(let g=u-1;g>=0&&h>0;--g){let A=l(g),y=h-A;if(y<0)break;u=g,h=y}h=m;for(let g=d+1;g0;++g){let A=l(g),y=h-A;if(y<0)break;d=g,h=y}}return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:h}}a(LLi,"expandRangeToPageRange");function FLi(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,QDr.countTokensForLines)(s,r);if(c<0)return FDr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=LLi(t,e,n,c,r,o.prioritizeAboveCursor),d=l*n,f=(u+1)*n;return FDr.Result.ok(new OLi.OffsetRange(d,f))}a(FLi,"clipPreservingRange");var W_t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};Gd.ClippedDocument=W_t;function ULi(t,e,r,n,o,s){let c=FLi(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new OLi.OffsetRange(l.start,l.start+u.length);return FDr.Result.ok(new W_t(u,d))}a(ULi,"createTaggedCurrentFileContentUsingPagedClipping");function LDr(t,e){switch(e){case PAe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case PAe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case PAe.IncludeLineNumbersOption.None:return[...t];default:(0,z_t.assertNever)(e)}}a(LDr,"addLineNumbers");function gyc(t,e,r,n,o,s){let c=NLi.StringEdit.single(NLi.StringReplacement.insert(t.cursorOffset,ch.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=LDr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[ch.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),ch.PromptTags.EDIT_WINDOW.start,...u,ch.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),ch.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=LDr(f,s.includeLineNumbers.currentFileContent),m=LDr(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return ULi(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` -`)}))}a(gyc,"constructTaggedFile")});var QLi=I(xR=>{"use strict";p();Object.defineProperty(xR,"__esModule",{value:!0});xR.xtab275SystemPrompt=xR.simplifiedPrompt=xR.nes41Miniv3SystemPrompt=xR.unifiedModelSystemPrompt=xR.systemPromptTemplate=void 0;var k$=x$();xR.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${k$.PromptTags.EDIT_WINDOW.start} and ${k$.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +`)}`}a(vgc,"getRelatedInformation");function Cgc(t,e,r){if(!t.length)return[0,0];let n=r*4,o=0,s=e?t.length-1:0;for(;o=t.length)break;return e?[s+1,t.length]:[0,s]}a(Cgc,"truncateCode");jd.N_LINES_ABOVE=2;jd.N_LINES_BELOW=5;jd.N_LINES_AS_CONTEXT=15;function kLi(t,e,r,n,o,s){let c=Math.ceil(t.length/r);function l(m){let g=m*r,A=Math.min(g+r,t.length),y=t.slice(g,A);return(0,CDr.countTokensForLines)(y,o)}a(l,"computeTokensForPage");let u=Math.floor(e.start/r),d=Math.floor((e.endExclusive-1)/r),f=n-(0,hgc.range)(u,d+1).reduce((m,g)=>m+l(g),0);if(f<0)return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:f};let h=f;if(s){h=f;for(let m=u-1;m>=0&&h>0;--m){let g=l(m),A=h-g;if(A<0)break;u=m,h=A}for(let m=d+1;m0;++m){let g=l(m),A=h-g;if(A<0)break;d=m,h=A}}else{let m=Math.floor(f/2);h=m;for(let g=u-1;g>=0&&h>0;--g){let A=l(g),y=h-A;if(y<0)break;u=g,h=y}h=m;for(let g=d+1;g0;++g){let A=l(g),y=h-A;if(y<0)break;d=g,h=y}}return{firstPageIdx:u,lastPageIdxIncl:d,budgetLeft:h}}a(kLi,"expandRangeToPageRange");function DLi(t,e,r,n,o){let s=t.slice(e.start,e.endExclusive),c=o.maxTokens-(0,CDr.countTokensForLines)(s,r);if(c<0)return _Dr.Result.error("outOfBudget");let{firstPageIdx:l,lastPageIdxIncl:u}=kLi(t,e,n,c,r,o.prioritizeAboveCursor),d=l*n,f=(u+1)*n;return _Dr.Result.ok(new RLi.OffsetRange(d,f))}a(DLi,"clipPreservingRange");var N_t=class{static{a(this,"ClippedDocument")}constructor(e,r){this.lines=e,this.keptRange=r}};jd.ClippedDocument=N_t;function NLi(t,e,r,n,o,s){let c=DLi(t,r,n,o,s);if(c.isError())return c;let l=c.val,u=[...t.slice(l.start,r.start),...e,...t.slice(r.endExclusive,l.endExclusive)],d=new RLi.OffsetRange(l.start,l.start+u.length);return _Dr.Result.ok(new N_t(u,d))}a(NLi,"createTaggedCurrentFileContentUsingPagedClipping");function EDr(t,e){switch(e){case vAe.IncludeLineNumbersOption.WithSpaceAfter:return t.map((r,n)=>`${n}| ${r}`);case vAe.IncludeLineNumbersOption.WithoutSpace:return t.map((r,n)=>`${n}|${r}`);case vAe.IncludeLineNumbersOption.None:return[...t];default:(0,M_t.assertNever)(e)}}a(EDr,"addLineNumbers");function bgc(t,e,r,n,o,s){let c=xLi.StringEdit.single(xLi.StringReplacement.insert(t.cursorOffset,dh.PromptTags.CURSOR)).applyOnText(t.content).getLines(),l=EDr(c,s.includeLineNumbers.areaAroundCodeToEdit),u=l.slice(e.start,e.endExclusive),d=[dh.PromptTags.AREA_AROUND.start,...l.slice(r.start,e.start),dh.PromptTags.EDIT_WINDOW.start,...u,dh.PromptTags.EDIT_WINDOW.end,...l.slice(e.endExclusive,r.endExclusive),dh.PromptTags.AREA_AROUND.end],f=n.currentFile.includeCursorTag?c:t.lines,h=EDr(f,s.includeLineNumbers.currentFileContent),m=EDr(t.lines,s.includeLineNumbers.currentFileContent),g;if(n.currentFile.includeTags&&s.includeLineNumbers.currentFileContent===s.includeLineNumbers.areaAroundCodeToEdit)g=d;else{let y=h.slice(e.start,e.endExclusive);g=[...h.slice(r.start,e.start),...y,...h.slice(e.endExclusive,r.endExclusive)]}return NLi(m,g,r,o,n.pagedClipping.pageSize,n.currentFile).map(y=>({clippedTaggedCurrentDoc:y,areaAroundCodeToEdit:d.join(` +`)}))}a(bgc,"constructTaggedFile")});var MLi=I(SR=>{"use strict";p();Object.defineProperty(SR,"__esModule",{value:!0});SR.xtab275SystemPrompt=SR.simplifiedPrompt=SR.nes41Miniv3SystemPrompt=SR.unifiedModelSystemPrompt=SR.systemPromptTemplate=void 0;var E$=g$();SR.systemPromptTemplate=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the ${E$.PromptTags.EDIT_WINDOW.start} and ${E$.PromptTags.EDIT_WINDOW.end} tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1269,9 +1223,9 @@ You have access to the following information to help you make informed suggestio - current_file_content: The content of the file the developer is currently working on, providing the broader context of the code. Line numbers in the form #| are included to help you understand the edit diff history. - edit_diff_history: A record of changes made to the code, helping you understand the evolution of the code and the developer's intentions. These changes are listed from oldest to latest. It's possible a lot of old edit diff history is entirely irrelevant to the developer's change. - area_around_code_to_edit: The context showing the code surrounding the section to be edited. -- cursor position marked as ${k$.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. +- cursor position marked as ${E$.PromptTags.CURSOR}: Indicates where the developer's cursor is currently located, which can be crucial for understanding what part of the code they are focusing on. -Your task is to predict and complete the changes the developer would have made next in the ${k$.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. +Your task is to predict and complete the changes the developer would have made next in the ${E$.PromptTags.EDIT_WINDOW.start} section. The developer may have stopped in the middle of typing. Your goal is to keep the developer on the path that you think they're following. Some examples include further implementing a class, method, or variable, or improving the quality of the code. Make sure the developer doesn't get distracted and ensure your suggestion is relevant. Consider what changes need to be made next, if any. If you think changes should be made, ask yourself if this is truly what needs to happen. If you are confident about it, then proceed with the changes. # Steps @@ -1282,9 +1236,9 @@ Your task is to predict and complete the changes the developer would have made n # Output Format -- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${k$.PromptTags.EDIT_WINDOW.start} and ${k$.PromptTags.EDIT_WINDOW.end} tags. +- Provide only the revised code within the tags. If no changes are necessary, simply return the original code from within the ${E$.PromptTags.EDIT_WINDOW.start} and ${E$.PromptTags.EDIT_WINDOW.end} tags. - There are line numbers in the form #| in the code displayed to you above, but these are just for your reference. Please do not include the numbers of the form #| in your response. -- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${k$.PromptTags.EDIT_WINDOW.start} or ${k$.PromptTags.EDIT_WINDOW.end} tags. +- Ensure that you do not output duplicate code that exists outside of these tags. The output should be the revised code that was between these tags and should not include the ${E$.PromptTags.EDIT_WINDOW.start} or ${E$.PromptTags.EDIT_WINDOW.end} tags. \`\`\` // Your revised code goes here @@ -1294,7 +1248,7 @@ Your task is to predict and complete the changes the developer would have made n - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. - Avoid undoing or reverting the developer's last change unless there are obvious typos or errors. -- Don't include the line numbers of the form #| in your response.`;xR.unifiedModelSystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Don't include the line numbers of the form #| in your response.`;SR.unifiedModelSystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1323,7 +1277,7 @@ Your task is to predict and complete the changes the developer would have made n # Notes - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. -- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;xR.nes41Miniv3SystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;SR.nes41Miniv3SystemPrompt=`Your role as an AI assistant is to help developers complete their code tasks by assisting in editing specific sections of code marked by the <|code_to_edit|> and <|/code_to_edit|> tags, while adhering to Microsoft's content policies and avoiding the creation of content that violates copyrights. You have access to the following information to help you make informed suggestions: @@ -1351,15 +1305,15 @@ Your task is to predict and complete the changes the developer would have made n # Notes - Apologize with "Sorry, I can't assist with that." for requests that may breach Microsoft content guidelines. -- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;xR.simplifiedPrompt="Predict next code edit based on the context given by the user.";xR.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var K_t=I(P$=>{"use strict";p();Object.defineProperty(P$,"__esModule",{value:!0});P$.NullTerminalService=P$.ITerminalService=void 0;P$.isTerminalService=Eyc;P$.isNullTerminalService=_yc;var Ayc=rn(),Y_t=Sc(),yyc=ko();P$.ITerminalService=(0,Ayc.createServiceIdentifier)("ITerminalService");var qDr=class t extends yyc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new Y_t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new Y_t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new Y_t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new Y_t.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};P$.NullTerminalService=qDr;function Eyc(t){return t&&typeof t.createTerminal=="function"}a(Eyc,"isTerminalService");function _yc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(_yc,"isNullTerminalService")});var qLi=I(S6=>{"use strict";p();var Cyc=S6&&S6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},vyc=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.TerminalMonitor=void 0;var byc=K_t(),Syc=ko(),aBe=2e3,jDr=class extends Syc.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:Tyc(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,aBe*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=aBe?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,aBe/2),contentEnd:n.slice(-aBe/2),length:n.length,truncatedChars:n.length-aBe},terminalCount:r};return JSON.stringify(s)}};S6.TerminalMonitor=jDr;S6.TerminalMonitor=jDr=Cyc([vyc(0,byc.ITerminalService)],jDr);function Tyc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(Tyc,"formatCwd")});var jLi=I(J_t=>{"use strict";p();Object.defineProperty(J_t,"__esModule",{value:!0});J_t.CurrentDocument=void 0;var Iyc=Ts(),HDr=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new Iyc.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};J_t.CurrentDocument=HDr});var VLi=I(Z_t=>{"use strict";p();Object.defineProperty(Z_t,"__esModule",{value:!0});Z_t.getCurrentLine=wyc;Z_t.isModelLineCompatible=Ryc;var HLi=I_(),xyc=Cyt();function wyc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new HLi.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?Pyc(n,o,e,r):!1}a(Ryc,"isModelLineCompatible");var kyc=new Set(["()","[]","{}","<>",'""',"''","``"]);function Pyc(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&$Li(t.inserted,e.inserted):$Li(t.inserted,e.inserted)}a(Pyc,"isUserEditCompatibleWithModelEdit");function $Li(t,e){return e.startsWith(t)?!0:kyc.has(t)?Dyc(t,e):!1}a($Li,"isUserTypingCompatibleWithModelText");function Dyc(t,e){let r=0;for(let n=0;n{"use strict";p();var Nyc=FD&&FD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Myc=FD&&FD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Oyc=FD&&FD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(Lyc,"parseEditIntentFromStreamShortName");async function Fyc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=X_t.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=X_t.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let E=await c.next();for(;!E.done;)yield E.value,E=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a(Fyc,"parseEditIntentFromStreamTags")});var tCt=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.linesWithBackticksRemoved=Qyc;DAe.constructMessages=qyc;DAe.charCount=jyc;DAe.findMergeConflictMarkersRange=Hyc;var $Dr=wo(),WLi=C4e(),Uyc=sd();async function*Qyc(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(Qyc,"linesWithBackticksRemoved");function qyc({systemMsg:t,userMsg:e}){return[{role:$Dr.Raw.ChatRole.System,content:(0,WLi.toTextParts)(t)},{role:$Dr.Raw.ChatRole.User,content:(0,WLi.toTextParts)(e)}]}a(qyc,"constructMessages");function jyc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===$Dr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(jyc,"charCount");function Hyc(t,e,r){for(let n=e.start;n>>>>>>"))return new Uyc.OffsetRange(n,o+1)}}a(Hyc,"findMergeConflictMarkersRange")});var KLi=I(D$=>{"use strict";p();Object.defineProperty(D$,"__esModule",{value:!0});D$.ResponseParseResult=void 0;D$.handleEditWindowOnly=Vyc;D$.handleCodeBlock=Wyc;D$.handleEditWindowWithEditIntent=zyc;D$.handleUnifiedWithXml=Yyc;var cBe=Pge(),zLi=eG(),YLi=g2(),NAe=x$(),Gyc=GDr(),$yc=tCt(),K4;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(K4||(D$.ResponseParseResult=K4={}));function Vyc(t){return new K4.EditWindowLines(t)}a(Vyc,"handleEditWindowOnly");function Wyc(t){return new K4.EditWindowLines((0,$yc.linesWithBackticksRemoved)(t))}a(Wyc,"handleCodeBlock");async function zyc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,Gyc.parseEditIntentFromStream)(t,e,r);return new K4.EditWindowLines(o,{intent:n,parseError:s})}a(zyc,"handleEditWindowWithEditIntent");async function Yyc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new K4.Done(new cBe.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===NAe.ResponseTags.NO_CHANGE.start)return new K4.Done(new cBe.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===NAe.ResponseTags.INSERT.start)return new K4.DirectEdits(Kyc(o,e,r));if(c===NAe.ResponseTags.EDIT.start){let l=Jyc(o);return new K4.EditWindowLines(l)}return new K4.Done(new cBe.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(Yyc,"handleUnifiedWithXml");async function*Kyc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorOriginalLinesOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(NAe.ResponseTags.INSERT.end))return new cBe.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new zLi.LineReplacement(new YLi.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(NAe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new zLi.LineReplacement(new YLi.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new cBe.NoNextEditReason.NoSuggestions(r,l)}a(Kyc,"generateInsertEdits");async function*Jyc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(NAe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(Jyc,"generateEditLines")});var r3i=I(Jre=>{"use strict";p();Object.defineProperty(Jre,"__esModule",{value:!0});Jre.XtabCustomDiffPatchResponseHandler=Jre.DuplicateAdditionsMode=void 0;Jre.tryRemoveDuplicateAdditions=t3i;var JLi=Hre(),Kre=WA();Object.defineProperty(Jre,"DuplicateAdditionsMode",{enumerable:!0,get:a(function(){return Kre.DuplicateAdditionsMode},"get")});var ZLi=Pge(),Zyc=L_(),Xyc=El(),eEc=hA(),XLi=Ku(),e3i=eG(),tEc=g2(),rEc=vDr(),nEc=kAe(),iEc=x$(),rCt=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` -`)}};function VDr(t){return t.trim().length>1}a(VDr,"isMeaningfulLine");function t3i(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,Xyc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&VDr(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&VDr(c[0])&&VDr(c[1])){let l=c[0],u=c[1];for(let d=1;d{"use strict";p();var oEc=T6&&T6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wR=T6&&T6.__param||function(t,e){return function(r,n){e(r,n,t)}},nCt;Object.defineProperty(T6,"__esModule",{value:!0});T6.XtabEndpoint=void 0;var sEc=SE(),aEc=A6(),zDr=Il(),cEc=PE(),lEc=g$(),uEc=qre(),dEc=pp(),fEc=ey(),pEc=_6(),hEc=gp(),mEc=o0(),gEc=Ure(),AEc=iAe(),yEc=Qs(),YDr=class extends uEc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{nCt=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:AEc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let E=n?{...nCt.chatModelInfo,id:n}:nCt.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(zDr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(zDr.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};T6.XtabEndpoint=YDr;T6.XtabEndpoint=YDr=nCt=oEc([wR(3,zDr.IConfigurationService),wR(4,lEc.IDomainService),wR(5,fEc.IFetcherService),wR(6,cEc.ICAPIClientService),wR(7,mEc.ITelemetryService),wR(8,sEc.IAuthenticationService),wR(9,aEc.IChatMLFetcher),wR(10,gEc.ITokenizerProvider),wR(11,yEc.IInstantiationService),wR(12,hEc.IExperimentationService),wR(13,pEc.IChatWebSocketManager),wR(14,dEc.ILogService)],YDr)});var iCt=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.NullProxyModelsService=MAe.IProxyModelsService=void 0;var EEc=rn(),_Ec=Sc();MAe.IProxyModelsService=(0,EEc.createServiceIdentifier)("IProxyModelsService");var KDr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=_Ec.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};MAe.NullProxyModelsService=KDr});var i3i=I(wC=>{"use strict";p();var CEc=wC&&wC.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vEc=wC&&wC.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bEc=wC&&wC.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},SEc=wC&&wC.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof D=="boolean"?D?sCt.IncludeLineNumbersOption.WithSpaceAfter:sCt.IncludeLineNumbersOption.None:D),A=new ZDr.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,d.lines,f,e.langCtx,e.aggressivenessLevel,m,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:h,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:g}}),{prompt:y}=(0,ZDr.getUserPrompt)(A),E=(0,LEc.constructMessages)({systemMsg:c,userMsg:y});n?.setCursorJumpPrompt(E);let _=this.determineModelName();n?.setCursorJumpModelName(_);let v=await this.resolveEndpoint(_,s);if(!v)return UD.Result.fromString("endpointNotResolved");let{endpoint:b,usesResponsesApi:T}=v,w=this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),R=this.configService.getExperimentBasedConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),x={max_tokens:T?Math.max(R,2048):R};w&&(x={...x,secretKey:w});let k=await b.makeChatRequest2({messages:E,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:JDr.ChatLocation.Other,requestOptions:x},o);if(k.type!==JDr.ChatFetchResponseType.Success)return k.type===JDr.ChatFetchResponseType.NotFound&&(s.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),UD.Result.fromString(`fetchError:${k.type}`);try{n?.setCursorJumpResponse(k.value);let D=k.value.trim();return this.parseResponse(D,d.keptRange)}catch(D){return s.trace(`Failed to parse predicted line number from response '${k.value}': ${D}`),UD.Result.fromString(`failedToParseLine:"${k.value}". Error ${DEc.ErrorUtils.fromUnknown(D).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(xEc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:TEc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:NEc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??FEc}determineLintOptions(){let e=this.configService.getConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(QD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,aCt.parseLintOptionString)(r,aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):aCt.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=UEc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return UD.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?UD.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?UD.Result.fromString("crossFileEmptyFilePath"):UD.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?UD.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(UEc,"stripThinkTags")});var v3i=I(Cp=>{"use strict";p();var QEc=Cp&&Cp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qEc=Cp&&Cp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jEc=Cp&&Cp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HEc=Cp&&Cp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this.ID=I6.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(f_c.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(A_c.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(C_c.XtabNextCursorPredictor,I6.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new ws.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new ws.NoNextEditReason.ActiveDocumentHasNoEdits;return new ws.WithStatelessProviderTelemetry(h,s.build(uCt.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,B$.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new ws.WithStatelessProviderTelemetry(d.value,s.build(uCt.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof ws.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new ws.WithStatelessProviderTelemetry(f,s.build(uCt.Result.error(f)))}catch(c){let l=M$.ErrorUtils.fromUnknown(c),u=new ws.NoNextEditReason.Unexpected(l);return new ws.WithStatelessProviderTelemetry(u,s.build(uCt.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,d_c.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new ws.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new eNr.Position(r.endLineNumber,r.endColumn),E=new y_c.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=y3i(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new fCt.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new ws.RequestEditWindowWithCursorJump(w,l):new ws.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,g3i.countTokensForLines)(R,I6.computeTokens)>x)return new ws.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Te=>Te.includes(f3i.PromptTags.CURSOR)),N=(0,O$.constructTaggedFile)(E,v,_,m,I6.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:ra.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new ws.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:L,areaAroundCodeToEdit:B}=N.val;f.setNLinesOfCurrentFileInPrompt(L.lines.length);let{aggressivenessLevel:Q,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(Q),M!==void 0&&f.setXtabUserHappinessScore(M);let q=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let F=m.neighborFiles.enabled?await(0,N$.raceCancellation)((0,N$.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new m_c.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),W=new O$.PromptPieces(E,v,_,h,e.xtabEditHistory,L.lines,B,q,Q,U,I6.computeTokens,m,F),{prompt:V,nDiffsInPrompt:G,diffTokensInPrompt:Y,neighborSnippetsResult:re}=(0,O$.getUserPrompt)(W);f.setNDiffsInPrompt(G),f.setDiffTokensInPrompt(Y),re&&(f.setNNeighborSnippetsComputed(re.nComputed),f.setNNeighborSnippetsInPrompt(re.nIncluded),f.setNeighborSnippetIndicesInPrompt(re.includedIndices));let j=ra.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),X=this.getPredictedOutput(h,R,j),ie=(0,tNr.constructMessages)({systemMsg:E3i(m.promptingStrategy),userMsg:V});d.setPrompt(ie),f.setPrompt(ie);let we=3e4*4;if((0,tNr.charCount)(ie)>we)return new ws.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Te=U.getData();f.setLintErrors(Te),d.setDiagnosticsData(Te);let Z=this.terminalMonitor.getData();f.setTerminalOutput(Z),d.setTerminalData(Z)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let De={endpoint:A,modelServiceConfig:g,messages:ie,clippedTaggedCurrentDoc:L,editWindowInfo:{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:b,editWindowLineRange:v},promptPieces:W,prediction:X,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,De,{shouldRemoveCursorTagFromResponse:D,responseFormat:j},{aggressivenessLevel:Q,userHappinessScore:M},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,h_c.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,RC.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[RC.AggressivenessSetting.Low]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[RC.AggressivenessSetting.Medium]:{minResponseConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[RC.AggressivenessSetting.High]:{debounceConfigKey:vi.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[RC.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,m3i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new u_c.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let b=[v.uri,...v.additionalUris??[]];return!!await(0,r_c.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===s3i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,N$.raceCancellation)((0,N$.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===s3i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(M$.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,E]=this.filterEdit(e.getActiveDocument(),[A]);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof ws.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new i_c.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(vi.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new GEc.FetchStreamSource,E=new o_c.StopWatch,_="",v,b=new N$.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:I6.ID,messages:r,finishedCb:a(async(k,D,N)=>{b.isSettled||b.complete(),v===void 0&&k!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(k,N),_=k,m.setResponse(_)},"finishedCb"),location:xf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(k=>({response:k,ttft:v}))),m.setFullResponse(T.then(k=>k.type===xf.ChatFetchResponseType.Success?k.value:void 0)),T.then(k=>{k.type!==xf.ChatFetchResponseType.Success?y.reject(new d3i.FetchStreamError(oNr(k))):y.resolve()}).catch(k=>{m.setError(M$.ErrorUtils.fromUnknown(k)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(M$.ErrorUtils.fromUnknown(k))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==xf.ChatFetchResponseType.Success)return w.type===xf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,L$.ModelNotFound.INSTANCE):w.type===xf.ChatFetchResponseType.Unknown&&w.reason===xf.RESPONSE_CONTAINED_NO_CHOICES?new L$.FetchFailure(new ws.NoNextEditReason.NoSuggestions(u,l)):new L$.FetchFailure(oNr(w));let R=a3i.AsyncIterUtilsExt.splitLines(a3i.AsyncIterUtils.map(y.stream,k=>k.delta.text)),x=(async function*(){let k=0;for await(let D of R){let N=`Line ${k++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(f3i.PromptTags.CURSOR,""):D}})();return new L$.Lines(x,()=>_,E)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:x,editWindowLineRange:k}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof L$.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof L$.FetchFailure)return N.reason;let{linesStream:L,getResponseSoFar:B,fetchRequestStopWatch:Q}=N,M=s instanceof B$.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case ra.ResponseFormat.EditWindowOnly:{O=(0,Zre.handleEditWindowOnly)(L);break}case ra.ResponseFormat.CodeBlock:{O=(0,Zre.handleCodeBlock)(L);break}case ra.ResponseFormat.EditWindowWithEditIntent:case ra.ResponseFormat.EditWindowWithEditIntentShort:{let re=n.responseFormat===ra.ResponseFormat.EditWindowWithEditIntentShort?h3i.EditIntentParseMode.ShortName:h3i.EditIntentParseMode.Tags;O=await(0,Zre.handleEditWindowWithEditIntent)(L,h,re);break}case ra.ResponseFormat.CustomDiffPatch:{let re=e.getActiveDocument(),j=v.currentDocument,ie=j.lines[E.keptRange.endExclusive-1].length,we=j.transformer.getOffsetRange(new fCt.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,ie+1)),Ae=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService);O=new Zre.ResponseParseResult.DirectEdits(E_c.XtabCustomDiffPatchResponseHandler.handleResponse(L,j,re.id,re.workspaceRoot,we,h,Ae));break}case ra.ResponseFormat.UnifiedWithXml:{O=await(0,Zre.handleUnifiedWithXml)(L,{editWindowLines:R,editWindowLineRange:k,cursorOriginalLinesOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,BAe.assertNever)(n.responseFormat)}if(O instanceof Zre.ResponseParseResult.Done)return O.reason;if(O instanceof Zre.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:re,parseError:j}=O.editIntentMetadata;if(g.setEditIntent(re),j&&g.setEditIntentParseError(j),!ra.EditIntent.shouldShowEdit(re,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${re}" with aggressiveness "${v.aggressivenessLevel}"`),new ws.NoNextEditReason.FilteredOut(`editIntent:${re} aggressivenessLevel:${v.aggressivenessLevel}`)}let q=O.lines,F={emitFastCursorLineChange:o3i.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${Q.elapsed()} ms`);let U=(0,n_c.backwardCompatSetting)(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),re=>{switch(re){case!1:case void 0:return RC.EarlyDivergenceCancellationMode.Off;case!0:return RC.EarlyDivergenceCancellationMode.Cursor;case RC.EarlyDivergenceCancellationMode.Off:case RC.EarlyDivergenceCancellationMode.Cursor:case RC.EarlyDivergenceCancellationMode.EditWindow:return re;default:return RC.EarlyDivergenceCancellationMode.Off}}),W=!1,V=U===RC.EarlyDivergenceCancellationMode.Off?q:S_c(q,x,e,k,R,d,l,re=>{W=re},U),G=0,Y=!1;for await(let re of o3i.ResponseProcessor.diff(R,V,x,F)){if(W)break;h.trace(`ResponseProcessor streamed edit #${G} with latency ${Q.elapsed()} ms`);let j=[];if(re.lineRange.startLineNumber===re.lineRange.endLineNumberExclusive||re.newLines.length===0||re.lineRange.endLineNumberExclusive-re.lineRange.startLineNumber===1&&re.newLines.length===1){let X=new dCt.LineReplacement(new u3i.LineRange(re.lineRange.startLineNumber+k.start,re.lineRange.endLineNumberExclusive+k.start),re.newLines);j.push(X)}else{let X=R.slice(re.lineRange.startLineNumber-1,re.lineRange.endLineNumberExclusive-1).join(` -`),ie=await this.diffService.computeDiff(X,re.newLines.join(` -`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${G} with latency ${Q.elapsed()} ms`);let we=k.start+re.lineRange.startLineNumber;for(let Ae of ie.changes){let De=new dCt.LineReplacement(new u3i.LineRange(we+Ae.original.startLineNumber-1,we+Ae.original.endLineNumberExclusive-1),re.newLines.slice(Ae.modified.startLineNumber-1,Ae.modified.endLineNumberExclusive-1));j.push(De)}}m.setResponse(B());for(let X of j){if(h.trace(`extracting edit #${G}: ${X.toString()}`),!Y){Y=!0;let ie=this.determineArtificialDelayMs(c,h,g);if(ie&&(await(0,N$.timeout)(ie),h.trace(`Artificial delay of ${ie} ms completed`),u.isCancellationRequested))return new ws.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:X,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},G++}}return W?new ws.NoNextEditReason.GotCancelled(U===RC.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(q){return q instanceof d3i.FetchStreamError?q.reason:(m.setError(q),new ws.NoNextEditReason.Unexpected(M$.ErrorUtils.fromUnknown(q)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof B$.Retrying)return m;if(rNr(e))return l.trace("Skipping cursor prediction: user typed during request"),new ws.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,l,u,s);if(s.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(rNr(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new ws.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=I6.getNextCursorColumn(b);switch(g){case cCt.NextCursorLinePrediction.Jump:{let w=new eNr.Position(v,T);return new ws.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case cCt.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new fCt.Range(v,T,v,T),n,o,s,new B$.Retrying("cursorJump"),d);default:(0,BAe.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,c3i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,c3i.isAbsolute)(e.filePath)?l3i.URI.file(e.filePath):l3i.URI.joinPath(m,e.filePath),A=zEc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new eNr.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case cCt.NextCursorLinePrediction.Jump:return new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case cCt.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${M$.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new ws.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new ws.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(rNr(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new ws.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new a_c.StringText(_.getText()),b=new ws.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,KEc.LanguageId.create(_.languageId),v.getLines(),dCt.LineEdit.empty,v,new YEc.Edits(s_c.StringEdit,[])),T=new ws.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new N$.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new fCt.Range(y,1,y,1),s,c,l,new B$.Retrying("cursorJump"),f)}default:(0,BAe.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??O$.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${O$.N_LINES_BELOW}`),u=O$.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new nNr.OffsetRange(d,f),g=(0,tNr.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new nNr.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...ra.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:sNr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService)},languageContext:_3i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(vi.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:ra.GlobalBudgetOptions.DEFAULT_ORDER,shares:ra.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=ra.applyStrategyConfig(n);return{promptOptions:sNr(r,o),modelServiceConfig:o}}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(__c.XtabEndpoint,r,n,e):(0,VEc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n){return this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService)?{type:"content",content:C3i(e,r,n)}:void 0}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof B$.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,N$.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r){let n=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsAllowImportChanges,this.expService),o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:p_c.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:lCt.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(vi.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:lCt.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=lCt.editWouldDeleteWhatWasJustInserted;break;case"v2":l=lCt.editWouldDeleteWhatWasJustInserted2;break;default:(0,BAe.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new dCt.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(vi.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:A3i(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Cp.XtabProvider=iNr;Cp.XtabProvider=iNr=I6=jEc([qD(0,JEc.IInlineEditsModelService),qD(1,XEc.ISimulationTestContext),qD(2,l_c.IInstantiationService),qD(3,t_c.IWorkspaceService),qD(4,$Ec.IDiffService),qD(5,vi.IConfigurationService),qD(6,e_c.IExperimentationService),qD(7,m3i.ILanguageContextProviderService),qD(8,ZEc.ILanguageDiagnosticsService),qD(9,WEc.IIgnoreService),qD(10,g_c.ISimilarFilesContextService)],iNr);function A3i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(A3i,"filterOutEditsWithSubstrings");function y3i(t){let e=t.cursorLineOffset,r=Math.max(0,e-O$.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+O$.N_LINES_AS_CONTEXT+1);return new nNr.OffsetRange(r,n)}a(y3i,"computeAreaAroundEditWindowLinesRange");function oNr(t){switch(t.type){case xf.ChatFetchResponseType.Canceled:return new ws.NoNextEditReason.GotCancelled("afterFetchCall");case xf.ChatFetchResponseType.OffTopic:case xf.ChatFetchResponseType.Filtered:case xf.ChatFetchResponseType.PromptFiltered:case xf.ChatFetchResponseType.Length:case xf.ChatFetchResponseType.RateLimited:case xf.ChatFetchResponseType.QuotaExceeded:case xf.ChatFetchResponseType.ExtensionBlocked:case xf.ChatFetchResponseType.AgentUnauthorized:case xf.ChatFetchResponseType.AgentFailedDependency:case xf.ChatFetchResponseType.InvalidStatefulMarker:return new ws.NoNextEditReason.Uncategorized(M$.ErrorUtils.fromUnknown(t));case xf.ChatFetchResponseType.BadRequest:case xf.ChatFetchResponseType.NotFound:case xf.ChatFetchResponseType.Failed:case xf.ChatFetchResponseType.NetworkError:case xf.ChatFetchResponseType.Unknown:return new ws.NoNextEditReason.FetchFailure(M$.ErrorUtils.fromUnknown(t))}}a(oNr,"mapChatFetcherErrorToNoNextEditReason");function sNr(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?b_c(t.lintOptions,e.lintOptions):t.lintOptions}}a(sNr,"overrideModelConfig");var v_c={...ra.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function b_c(t,e){return{...t??v_c,...e}}a(b_c,"mergeLintOptions");function E3i(t){switch(t){case ra.PromptingStrategy.UnifiedModel:return lBe.unifiedModelSystemPrompt;case ra.PromptingStrategy.Codexv21NesUnified:case ra.PromptingStrategy.SimplifiedSystemPrompt:return lBe.simplifiedPrompt;case ra.PromptingStrategy.PatchBased:case ra.PromptingStrategy.PatchBased01:case ra.PromptingStrategy.PatchBased02:case ra.PromptingStrategy.PatchBased02WithRecentLineNumbers:case ra.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case ra.PromptingStrategy.Xtab275:case ra.PromptingStrategy.XtabAggressiveness:case ra.PromptingStrategy.Xtab275Aggressiveness:case ra.PromptingStrategy.Xtab275AggressivenessHighLow:case ra.PromptingStrategy.Xtab275EditIntent:case ra.PromptingStrategy.Xtab275EditIntentShort:return lBe.xtab275SystemPrompt;case ra.PromptingStrategy.Nes41Miniv3:return lBe.nes41Miniv3SystemPrompt;case ra.PromptingStrategy.CopilotNesXtab:case void 0:return lBe.systemPromptTemplate;default:(0,BAe.assertNever)(t)}}a(E3i,"pickSystemPrompt");function _3i(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(_3i,"determineLanguageContextOptions");function C3i(t,e,r){if(r===ra.ResponseFormat.UnifiedWithXml)return["",...e,""].join(` -`);if(r===ra.ResponseFormat.EditWindowOnly)return e.join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...e].join(` -`);if(r===ra.ResponseFormat.EditWindowWithEditIntentShort)return["H",...e].join(` -`);if(r===ra.ResponseFormat.CodeBlock)return["```",...e,"```"].join(` -`);if(r===ra.ResponseFormat.CustomDiffPatch){let n=t.workspaceRoot?.path;return`${(0,g3i.toUniquePath)(t.id,n)}:`}else(0,BAe.assertNever)(r)}a(C3i,"getPredictionContents");async function*S_c(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new c_c.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case RC.EarlyDivergenceCancellationMode.Cursor:return E===e;case RC.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,p3i.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,p3i.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(S_c,"linesWithIntermediateEditDivergenceCheck")});var b3i=I(J4=>{"use strict";p();var T_c=J4&&J4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},pCt=J4&&J4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(J4,"__esModule",{value:!0});J4.StaticGitHubAuthenticationService=void 0;J4.setCopilotToken=k_c;var I_c=Il(),x_c=pp(),hCt=SE(),w_c=UMe(),R_c=_H(),mCt=class extends hCt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:hCt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:hCt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new hCt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireAuthenticationChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};J4.StaticGitHubAuthenticationService=mCt;J4.StaticGitHubAuthenticationService=mCt=T_c([pCt(1,x_c.ILogService),pCt(2,R_c.ICopilotTokenStore),pCt(3,w_c.ICopilotTokenManager),pCt(4,I_c.IConfigurationService)],mCt);function k_c(t,e){if(!(t instanceof mCt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(k_c,"setCopilotToken")});var w3i=I(kC=>{"use strict";p();Object.defineProperty(kC,"__esModule",{value:!0});kC.GraphQLErrorType=void 0;kC.getErrorCode=I3i;kC.derivePullRequestState=P_c;kC.makeGitHubAPIRequest=x3i;kC.makeGitHubGraphQLRequest=LAe;kC.makeSearchGraphQLRequest=D_c;kC.getPullRequestFromGlobalId=N_c;kC.addPullRequestCommentGraphQLRequest=M_c;kC.closePullRequest=O_c;kC.makeGitHubAPIRequestWithPagination=B_c;kC.getAssignableActorsWithSuggestedActors=L_c;kC.getAssignableActorsWithAssignableUsers=F_c;function S3i(t){return typeof t=="object"&&t!==null}a(S3i,"isObject");var T3i;(function(t){t.Unprocessable="UNPROCESSABLE"})(T3i||(kC.GraphQLErrorType=T3i={}));function I3i(t){if(!S3i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(S3i(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(I3i,"getErrorCode");function P_c(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(P_c,"derivePullRequestState");async function x3i(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let b=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),b}catch{return}}a(x3i,"makeGitHubAPIRequest");async function LAe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(LAe,"makeGitHubGraphQLRequest");async function D_c(t,e,r,n,o,s,c=20){let l=` +- Avoid undoing or reverting the developer's last change unless there are obvious typos or errors.`;SR.simplifiedPrompt="Predict next code edit based on the context given by the user.";SR.xtab275SystemPrompt=`Predict the next code edit based on user context, following Microsoft content policies and avoiding copyright violations. If a request may breach guidelines, reply: "Sorry, I can't assist with that."`});var B_t=I(_$=>{"use strict";p();Object.defineProperty(_$,"__esModule",{value:!0});_$.NullTerminalService=_$.ITerminalService=void 0;_$.isTerminalService=Igc;_$.isNullTerminalService=xgc;var Sgc=tn(),O_t=_c(),Tgc=Io();_$.ITerminalService=(0,Sgc.createServiceIdentifier)("ITerminalService");var bDr=class t extends Tgc.Disposable{static{a(this,"NullTerminalService")}constructor(){super(...arguments),this._onDidWriteTerminalData=this._register(new O_t.Emitter),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidChangeTerminalShellIntegration=this._register(new O_t.Emitter),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidEndTerminalShellExecution=this._register(new O_t.Emitter),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._onDidCloseTerminal=this._register(new O_t.Emitter),this.onDidCloseTerminal=this._onDidCloseTerminal.event}static{this.Instance=new t}get terminalBuffer(){return""}get terminalLastCommand(){}get terminalSelection(){return""}get terminalShellType(){return""}async getCwdForSession(e){return Promise.resolve(void 0)}async getCopilotTerminals(e){return Promise.resolve([])}getTerminalsWithSessionInfo(){throw new Error("Method not implemented.")}getToolTerminalForSession(e){throw new Error("Method not implemented.")}async associateTerminalWithSession(e,r,n){Promise.resolve()}createTerminal(e,r,n){return{}}get terminals(){return[]}getBufferForTerminal(e,r){return""}getBufferWithPid(e,r){return Promise.resolve("")}getLastCommandForTerminal(e){}contributePath(e,r,n,o){}removePathContribution(e){}};_$.NullTerminalService=bDr;function Igc(t){return t&&typeof t.createTerminal=="function"}a(Igc,"isTerminalService");function xgc(t){return t&&typeof t.createTerminal=="function"&&t.createTerminal()===void 0}a(xgc,"isNullTerminalService")});var OLi=I(g6=>{"use strict";p();var wgc=g6&&g6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Rgc=g6&&g6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(g6,"__esModule",{value:!0});g6.TerminalMonitor=void 0;var Pgc=B_t(),kgc=Io(),z4e=2e3,SDr=class extends kgc.Disposable{static{a(this,"TerminalMonitor")}constructor(e){super(),this._terminalService=e,this._register(this._terminalService.onDidEndTerminalShellExecution(r=>{this._recordTerminalActivity(r)})),this._register(this._terminalService.onDidCloseTerminal(r=>{this._lastActivity?.terminal===r&&(this._lastActivity=void 0)}))}_recordTerminalActivity(e){let r=e.execution;this._lastActivity={terminal:e.terminal,terminalName:e.terminal.name,commandLine:r.commandLine?.value,cwd:Dgc(r.cwd),exitCode:e.exitCode,timestamp:Date.now()}}getData(){let e=Date.now(),r=this._terminalService.terminals.length;if(!this._lastActivity)return JSON.stringify({terminalCount:r});let n=this._terminalService.getBufferForTerminal(this._lastActivity.terminal,z4e*2),o=e-this._lastActivity.timestamp,s={terminalName:this._lastActivity.terminalName,commandLine:this._lastActivity.commandLine,cwd:this._lastActivity.cwd,exitCode:this._lastActivity.exitCode,msAgo:o,buffer:n.length<=z4e?{fits:!0,content:n,length:n.length}:{fits:!1,contentStart:n.slice(0,z4e/2),contentEnd:n.slice(-z4e/2),length:n.length,truncatedChars:n.length-z4e},terminalCount:r};return JSON.stringify(s)}};g6.TerminalMonitor=SDr;g6.TerminalMonitor=SDr=wgc([Rgc(0,Pgc.ITerminalService)],SDr);function Dgc(t){if(t!==void 0)return typeof t=="string"?t:t.fsPath}a(Dgc,"formatCwd")});var BLi=I(L_t=>{"use strict";p();Object.defineProperty(L_t,"__esModule",{value:!0});L_t.CurrentDocument=void 0;var Ngc=bs(),TDr=class{static{a(this,"CurrentDocument")}constructor(e,r){this.content=e,this.cursorPosition=r,this.lines=e.getLines(),this.transformer=e.getTransformer(),this.cursorOffset=this.transformer.getOffset(r),this.cursorLineOffset=this.cursorPosition.lineNumber-1}lineWithCursor(){let e=this.lines.at(this.cursorLineOffset);if(e===void 0)throw new Ngc.BugIndicatingError(`CurrentDocument#lineWithCursor: cursor is out of bounds: cursor: ${this.cursorLineOffset}, doc line count: ${this.lines.length}`);return e}textAfterCursor(){return this.lineWithCursor().substring(this.cursorPosition.column-1)}isCursorAtEndOfLine(){return this.textAfterCursor().match(/^\s*$/)!==null}};L_t.CurrentDocument=TDr});var QLi=I(F_t=>{"use strict";p();Object.defineProperty(F_t,"__esModule",{value:!0});F_t.getCurrentLine=Ogc;F_t.isModelLineCompatible=Bgc;var LLi=T_(),Mgc=myt();function Ogc(t,e,r,n){let o=e+1,s=t.textLength.lineCount+1;if(o<1||o>s)return;let c=t.getOffset(new LLi.Position(o,1)),l=0;for(let A of r.replacements)if(A.replaceRange.endExclusive<=c)l+=A.newText.length-A.replaceRange.length;else{if(A.replaceRange.start=o.startOffset&&n.endOffset<=o.endOffset?Fgc(n,o,e,r):!1}a(Bgc,"isModelLineCompatible");var Lgc=new Set(["()","[]","{}","<>",'""',"''","``"]);function Fgc(t,e,r,n){return t.replaced.length>0?r===n?!0:t.startOffset===e.startOffset&&t.endOffset===e.endOffset&&t.replaced===e.replaced&&t.inserted.length>0&&ULi(t.inserted,e.inserted):ULi(t.inserted,e.inserted)}a(Fgc,"isUserEditCompatibleWithModelEdit");function ULi(t,e){return e.startsWith(t)?!0:Lgc.has(t)?Ugc(t,e):!1}a(ULi,"isUserTypingCompatibleWithModelText");function Ugc(t,e){let r=0;for(let n=0;n{"use strict";p();var Qgc=OD&&OD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),qgc=OD&&OD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jgc=OD&&OD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o ${r}`);let d=(async function*(){let f=await o.next();for(;!f.done;)yield f.value,f=await o.next()})();return{editIntent:r,remainingLinesStream:d,parseError:n}}n=`unknownIntentValue:${c}`,e.warn(`Edit intent parse error: ${n} (using Xtab275EditIntentShort prompting strategy). Defaulting to High (always show). First line was: "${c.substring(0,100)}..."`);let u=(async function*(){yield s.value;let d=await o.next();for(;!d.done;)yield d.value,d=await o.next()})();return{editIntent:r,remainingLinesStream:u,parseError:n}}a(Ggc,"parseEditIntentFromStreamShortName");async function $gc(t,e){let r="<|edit_intent|>",n="<|/edit_intent|>",o=U_t.EditIntent.High,s,c=t[Symbol.asyncIterator](),l=await c.next();if(l.done){s="emptyResponse",e.warn("Empty response stream, no edit_intent tag found");let m=(async function*(){})();return{editIntent:o,remainingLinesStream:m,parseError:s}}let u=l.value,d=u.indexOf(r),f=u.indexOf(n);if(d!==-1&&f!==-1&&f>d){let m=u.substring(d+r.length,f).trim().toLowerCase();["no_edit","low","medium","high"].includes(m)||(s=`unknownIntentValue:${m}`,e.warn(`Unknown edit_intent value: "${m}", defaulting to High`)),o=U_t.EditIntent.fromString(m),e.trace(`Parsed edit_intent from first line: "${m}" -> ${o}`);let A=u.substring(f+n.length),y=(async function*(){A.trim()!==""&&(yield A);let E=await c.next();for(;!E.done;)yield E.value,E=await c.next()})();return{editIntent:o,remainingLinesStream:y,parseError:s}}d!==-1&&f===-1?s="malformedTag:startWithoutEnd":d===-1&&f!==-1?s="malformedTag:endWithoutStart":s="noTagFound",e.warn(`Edit intent parse error: ${s} (using Xtab275EditIntent prompting strategy). Defaulting to High (always show). First line was: "${u.substring(0,100)}..."`);let h=(async function*(){yield u;let m=await c.next();for(;!m.done;)yield m.value,m=await c.next()})();return{editIntent:o,remainingLinesStream:h,parseError:s}}a($gc,"parseEditIntentFromStreamTags")});var q_t=I(CAe=>{"use strict";p();Object.defineProperty(CAe,"__esModule",{value:!0});CAe.linesWithBackticksRemoved=Wgc;CAe.constructMessages=zgc;CAe.charCount=Ygc;CAe.findMergeConflictMarkersRange=Kgc;var xDr=xo(),qLi=c4e(),Vgc=sd();async function*Wgc(t){let e=-1,r;for await(let n of t)if(++e,r&&(yield r,r=void 0),n.match(/^```[a-z]*$/)){if(e===0)continue;r=n}else yield n}a(Wgc,"linesWithBackticksRemoved");function zgc({systemMsg:t,userMsg:e}){return[{role:xDr.Raw.ChatRole.System,content:(0,qLi.toTextParts)(t)},{role:xDr.Raw.ChatRole.User,content:(0,qLi.toTextParts)(e)}]}a(zgc,"constructMessages");function Ygc(t){return t.reduce((r,n)=>r+n.content.reduce((o,s)=>o+(s.type===xDr.Raw.ChatCompletionContentPartKind.Text?s.text.length:0),0),0)}a(Ygc,"charCount");function Kgc(t,e,r){for(let n=e.start;n>>>>>>"))return new Vgc.OffsetRange(n,o+1)}}a(Kgc,"findMergeConflictMarkersRange")});var GLi=I(v$=>{"use strict";p();Object.defineProperty(v$,"__esModule",{value:!0});v$.ResponseParseResult=void 0;v$.handleEditWindowOnly=Xgc;v$.handleCodeBlock=eAc;v$.handleEditWindowWithEditIntent=tAc;v$.handleUnifiedWithXml=rAc;var Y4e=bge(),jLi=VH(),HLi=p2(),bAe=g$(),Jgc=IDr(),Zgc=q_t(),H4;(function(t){class e{static{a(this,"EditWindowLines")}constructor(s,c){this.lines=s,this.editIntentMetadata=c}}t.EditWindowLines=e;class r{static{a(this,"Done")}constructor(s){this.reason=s}}t.Done=r;class n{static{a(this,"DirectEdits")}constructor(s){this.stream=s}}t.DirectEdits=n})(H4||(v$.ResponseParseResult=H4={}));function Xgc(t){return new H4.EditWindowLines(t)}a(Xgc,"handleEditWindowOnly");function eAc(t){return new H4.EditWindowLines((0,Zgc.linesWithBackticksRemoved)(t))}a(eAc,"handleCodeBlock");async function tAc(t,e,r){let{editIntent:n,remainingLinesStream:o,parseError:s}=await(0,Jgc.parseEditIntentFromStream)(t,e,r);return new H4.EditWindowLines(o,{intent:n,parseError:s})}a(tAc,"handleEditWindowWithEditIntent");async function rAc(t,e,r,n){let o=t[Symbol.asyncIterator](),s=await o.next();if(s.done)return new H4.Done(new Y4e.NoNextEditReason.NoSuggestions(r,e.editWindow));let c=s.value.trim();if(c===bAe.ResponseTags.NO_CHANGE.start)return new H4.Done(new Y4e.NoNextEditReason.NoSuggestions(r,e.editWindow));if(c===bAe.ResponseTags.INSERT.start)return new H4.DirectEdits(nAc(o,e,r));if(c===bAe.ResponseTags.EDIT.start){let l=iAc(o);return new H4.EditWindowLines(l)}return new H4.Done(new Y4e.NoNextEditReason.Unexpected(new Error(`unexpected tag ${c}`)))}a(rAc,"handleUnifiedWithXml");async function*nAc(t,e,r){let{editWindowLines:n,editWindowLineRange:o,cursorOriginalLinesOffset:s,cursorColumnZeroBased:c,editWindow:l,originalEditWindow:u,targetDocument:d,isFromCursorJump:f}=e,h=await t.next();if(h.done||h.value.includes(bAe.ResponseTags.INSERT.end))return new Y4e.NoNextEditReason.NoSuggestions(r,l);let m=n[s];yield{edit:new jLi.LineReplacement(new HLi.LineRange(o.start+s+1,o.start+s+2),[m.slice(0,c)+h.value+m.slice(c)]),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d};let A=[],y=await t.next();for(;!y.done&&!y.value.includes(bAe.ResponseTags.INSERT.end);)A.push(y.value),y=await t.next();let E=o.start+s+2;return yield{edit:new jLi.LineReplacement(new HLi.LineRange(E,E),A),isFromCursorJump:f,window:l,originalWindow:u,targetDocument:d},new Y4e.NoNextEditReason.NoSuggestions(r,l)}a(nAc,"generateInsertEdits");async function*iAc(t){let e=await t.next();for(;!e.done;){if(e.value.includes(bAe.ResponseTags.EDIT.end))return;yield e.value,e=await t.next()}}a(iAc,"generateEditLines")});var KLi=I(Gre=>{"use strict";p();Object.defineProperty(Gre,"__esModule",{value:!0});Gre.XtabCustomDiffPatchResponseHandler=Gre.DuplicateAdditionsMode=void 0;Gre.tryRemoveDuplicateAdditions=YLi;var $Li=Bre(),Hre=ZA();Object.defineProperty(Gre,"DuplicateAdditionsMode",{enumerable:!0,get:a(function(){return Hre.DuplicateAdditionsMode},"get")});var VLi=bge(),oAc=O_(),sAc=ml(),aAc=fA(),WLi=Vu(),zLi=VH(),cAc=p2(),lAc=iDr(),uAc=_Ae(),dAc=g$(),j_t=class t{static{a(this,"Patch")}constructor(e,r){this.filePath=e,this.lineNumZeroBased=r,this.removedLines=[],this.addedLines=[]}static ofLine(e){let r=e.match(/^(.+):(\d+)$/);if(!r)return null;let[,n,o]=r;return new t(n,parseInt(o,10))}addLine(e){let r=e.slice(1);return e.startsWith("-")?(this.removedLines.push(r),!0):e.startsWith("+")?(this.addedLines.push(r),!0):!1}toString(){return[`${this.filePath}:${this.lineNumZeroBased}`,...this.removedLines.map(e=>`-${e}`),...this.addedLines.map(e=>`+${e}`)].join(` +`)}};function wDr(t){return t.trim().length>1}a(wDr,"isMeaningfulLine");function YLi(t,e){let r=t.newLines;if(r.length===0)return;let n=t.lineRange.endLineNumberExclusive,o=e.lineRange.endLineNumberExclusive-1,s=Math.min(o+1,n+r.length),c=[];for(let l=n;l=1;l--){let u=r.slice(-l);if((0,sAc.equals)(u,c.slice(0,l)))return{kind:"suffix",newAdditions:r.slice(0,r.length-l),removedLines:u}}if(r[0]===c[0]&&wDr(r[0]))return{kind:"prefix",newAdditions:r.slice(1),removedLines:r.slice(0,1)};if(r.length>=3&&c.length>=2&&wDr(c[0])&&wDr(c[1])){let l=c[0],u=c[1];for(let d=1;d{"use strict";p();var fAc=A6&&A6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},TR=A6&&A6.__param||function(t,e){return function(r,n){e(r,n,t)}},H_t;Object.defineProperty(A6,"__esModule",{value:!0});A6.XtabEndpoint=void 0;var pAc=CE(),hAc=l6(),PDr=Sl(),mAc=wE(),gAc=o$(),AAc=Mre(),yAc=Ap(),EAc=iy(),_Ac=f6(),vAc=_p(),CAc=Bh(),bAc=J7(),SAc=Ice(),TAc=Ms(),kDr=class extends AAc.ChatEndpoint{static{a(this,"XtabEndpoint")}static{H_t=this}static{this.chatModelInfo={id:"xtab-4o-mini-finetuned",name:"xtab-4o-mini-finetuned",vendor:"xtab",model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"unknown",capabilities:{type:"chat",family:"xtab-4o-mini-finetuned",tokenizer:SAc.TokenizerType.O200K,limits:{max_prompt_tokens:12285,max_output_tokens:4096},supports:{streaming:!0,parallel_tool_calls:!1,tool_calls:!1,vision:!1,prediction:!0}}}}constructor(e,r,n,o,s,c,l,u,d,f,h,m,g,A,y){let E=n?{...H_t.chatModelInfo,id:n}:H_t.chatModelInfo;super(E,s,f,h,m,o,g,A,y),this._url=e,this._apiKey=r,this._configService=o}get urlOrRequestMetadata(){return this._configService.getConfig(PDr.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl)||this._url}getExtraHeaders(){let e=this._configService.getConfig(PDr.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey)||this._apiKey;if(!e){let r=`Missing API key for custom URL (${this.urlOrRequestMetadata}). Provide the API key using vscode setting \`github.copilot.chat.advanced.inlineEdits.xtabProvider.apiKey\` or, if in simulations using \`--nes-api-key\` or \`--config-file\``;throw console.error(r),new Error(r)}return{Authorization:`Bearer ${e}`,"api-key":e}}};A6.XtabEndpoint=kDr;A6.XtabEndpoint=kDr=H_t=fAc([TR(3,PDr.IConfigurationService),TR(4,gAc.IDomainService),TR(5,EAc.IFetcherService),TR(6,mAc.ICAPIClientService),TR(7,CAc.ITelemetryService),TR(8,pAc.IAuthenticationService),TR(9,hAc.IChatMLFetcher),TR(10,bAc.ITokenizerProvider),TR(11,TAc.IInstantiationService),TR(12,vAc.IExperimentationService),TR(13,_Ac.IChatWebSocketManager),TR(14,yAc.ILogService)],kDr)});var G_t=I(SAe=>{"use strict";p();Object.defineProperty(SAe,"__esModule",{value:!0});SAe.NullProxyModelsService=SAe.IProxyModelsService=void 0;var IAc=tn(),xAc=_c();SAe.IProxyModelsService=(0,IAc.createServiceIdentifier)("IProxyModelsService");var DDr=class{static{a(this,"NullProxyModelsService")}constructor(){this.onModelListUpdated=xAc.Event.None}get models(){}get nesModels(){}get cursorJumpModels(){}get instantApplyModels(){}};SAe.NullProxyModelsService=DDr});var ZLi=I(Tv=>{"use strict";p();var wAc=Tv&&Tv.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),RAc=Tv&&Tv.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),PAc=Tv&&Tv.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},kAc=Tv&&Tv.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;otypeof D=="boolean"?D?V_t.IncludeLineNumbersOption.WithSpaceAfter:V_t.IncludeLineNumbersOption.None:D),A=new MDr.PromptPieces(e.currentDocument,e.editWindowLinesRange,e.areaAroundEditWindowLinesRange,e.activeDoc,e.xtabHistory,d.lines,f,e.langCtx,e.aggressivenessLevel,m,this.computeTokens,{...e.opts,includePostScript:!1,lintOptions:h,recentlyViewedDocuments:{...e.opts.recentlyViewedDocuments,includeLineNumbers:g}}),{prompt:y}=(0,MDr.getUserPrompt)(A),E=(0,GAc.constructMessages)({systemMsg:c,userMsg:y});n?.setCursorJumpPrompt(E);let _=this.determineModelName();n?.setCursorJumpModelName(_);let v=await this.resolveEndpoint(_,s);if(!v)return BD.Result.fromString("endpointNotResolved");let{endpoint:b,usesResponsesApi:T}=v,w=this.configService.getConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionApiKey),R=this.configService.getExperimentBasedConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionMaxResponseTokens,this.expService),x={max_tokens:T?Math.max(R,2048):R};w&&(x={...x,secretKey:w});let P=await b.makeChatRequest2({messages:E,debugName:"nes.nextCursorPosition",finishedCb:void 0,location:NDr.ChatLocation.Other,requestOptions:x},o);if(P.type!==NDr.ChatFetchResponseType.Success)return P.type===NDr.ChatFetchResponseType.NotFound&&(s.trace("Next cursor position prediction endpoint not found; disabling predictor for current session."),this.isDisabled=!0),BD.Result.fromString(`fetchError:${P.type}`);try{n?.setCursorJumpResponse(P.value);let D=P.value.trim();return this.parseResponse(D,d.keptRange)}catch(D){return s.trace(`Failed to parse predicted line number from response '${P.value}': ${D}`),BD.Result.fromString(`failedToParseLine:"${P.value}". Error ${UAc.ErrorUtils.fromUnknown(D).message}`)}}async resolveEndpoint(e,r){if(this.configService.getConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUseEndpointProvider)){let c=(await this.endpointProvider.getAllChatEndpoints()).find(u=>u.model===e||u.family===e);if(!c){r.trace(`Could not find endpoint for model '${e}' via endpoint provider`);return}let l=c.apiType==="responses";return{endpoint:c,usesResponsesApi:l}}let o=this.configService.getConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionUrl);return{endpoint:this.instaService.createInstance(MAc.ChatEndpoint,{id:e,name:"nes.nextCursorPosition",vendor:e,urlOrRequestMetadata:o||{type:DAc.RequestType.ProxyChatCompletions},model_picker_enabled:!1,is_chat_default:!1,is_chat_fallback:!1,version:"",capabilities:{type:"chat",family:"",tokenizer:QAc.TokenizerType.CL100K,limits:void 0,supports:{parallel_tool_calls:!1,tool_calls:!1,streaming:!0,vision:!1,prediction:!1,thinking:!1}}}),usesResponsesApi:!1}}determineModelName(){return this.configService.getExperimentBasedConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionModelName,this.expService)??this.proxyModelsService.cursorJumpModels?.[0]?.name??$Ac}determineLintOptions(){let e=this.configService.getConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptions);if(e)return{...W_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,...e};let r=this.configService.getExperimentBasedConfig(LD.ConfigKey.TeamInternal.InlineEditsNextCursorPredictionLintOptionsString,this.expService);return r?(0,W_t.parseLintOptionString)(r,W_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS):W_t.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS}parseResponse(e,r){let n=VAc(e),o=parseInt(n,10);if(!isNaN(o)&&String(o)===n)return this.parseSameFileLineNumber(o,r);let s=n.lastIndexOf(":");if(s<=0)return BD.Result.fromString("gotNaN");let c=n.substring(0,s),l=n.substring(s+1),u=parseInt(l,10);return isNaN(u)||u<0?BD.Result.fromString("crossFileInvalidLineNumber"):c.trim().length===0?BD.Result.fromString("crossFileEmptyFilePath"):BD.Result.ok({kind:"differentFile",filePath:c.trim(),lineNumber:u})}parseSameFileLineNumber(e,r){return e<0?BD.Result.fromString("negativeLineNumber"):e[\s\S]*?<\/think>\s*/g,"");return e.trimStart().startsWith("")&&(e=""),e.trim()}a(VAc,"stripThinkTags")});var g3i=I(Sp=>{"use strict";p();var WAc=Sp&&Sp.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),zAc=Sp&&Sp.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),YAc=Sp&&Sp.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},KAc=Sp&&Sp.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oMath.floor(e.length/4)}constructor(e,r,n,o,s,c,l,u,d,f,h){this.modelService=e,this.simulationCtx=r,this.instaService=n,this.workspaceService=o,this.diffService=s,this.configService=c,this.expService=l,this.langCtxService=u,this.langDiagService=d,this.ignoreService=f,this.similarFilesContextService=h,this.ID=y6.ID,this.forceUseDefaultModel=!1,this.userInteractionMonitor=this.instaService.createInstance(Eyc.UserInteractionMonitor),this.terminalMonitor=this.instaService.createInstance(Syc.TerminalMonitor),this.nextCursorPredictor=this.instaService.createInstance(wyc.XtabNextCursorPredictor,y6.computeTokens)}handleAcceptance(){this.userInteractionMonitor.handleAcceptance()}handleRejection(){this.userInteractionMonitor.handleRejection()}handleIgnored(){this.userInteractionMonitor.handleIgnored()}async*provideNextEdit(e,r,n,o){let s=new Is.StatelessNextEditTelemetryBuilder(e.headerRequestId);n.setProviderStartTime();try{if(e.xtabEditHistory.length===0){let h=new Is.NoNextEditReason.ActiveDocumentHasNoEdits;return new Is.WithStatelessProviderTelemetry(h,s.build(K_t.Result.error(h)))}let c=this.userInteractionMonitor.createDelaySession(e.providerRequestStartDateTime),l={tracer:r,logContext:n,telemetry:s},u=this.doGetNextEdit(e,c,l,o,T$.NotRetrying.INSTANCE),d=await u.next();for(;!d.done;)yield new Is.WithStatelessProviderTelemetry(d.value,s.build(K_t.Result.ok(void 0))),d=await u.next();let f=d.value;return f instanceof Is.NoNextEditReason.GotCancelled&&n.setIsSkipped(),new Is.WithStatelessProviderTelemetry(f,s.build(K_t.Result.error(f)))}catch(c){let l=b$.ErrorUtils.fromUnknown(c),u=new Is.NoNextEditReason.Unexpected(l);return new Is.WithStatelessProviderTelemetry(u,s.build(K_t.Result.error(u)))}finally{n.setProviderEndTime()}}doGetNextEdit(e,r,n,o,s){return this.doGetNextEditWithSelection(e,(0,yyc.getOrDeduceSelectionFromLastEdit)(e.getActiveDocument()),r,n,o,s)}async*doGetNextEditWithSelection(e,r,n,o,s,c,l){let u=o.tracer.createSubLogger(["XtabProvider","doGetNextEditWithSelection"]),{logContext:d,telemetry:f}=o,h=e.getActiveDocument();if(r===null)return new Is.NoNextEditReason.Uncategorized(new Error("NoSelection"));let{promptOptions:m,modelServiceConfig:g}=this.determineModelConfiguration(h);f.setModelConfig(JSON.stringify(g));let A=this.getEndpointWithLogging(m.modelName,d,f),y=new BDr.Position(r.endLineNumber,r.endColumn),E=new Tyc.CurrentDocument(h.documentAfterEdits,y);this._configureDebounceTimings(e,E,m,f,n,u);let _=f3i(E),v=this.computeEditWindowLinesRange(E,e,u,f),b=Math.max(0,E.cursorLineOffset-v.start),T=E.transformer.getLineLength(v.endExclusive),w=E.transformer.getOffsetRange(new Z_t.Range(v.start+1,1,v.endExclusive,T+1));e.requestEditWindow=l?new Is.RequestEditWindowWithCursorJump(w,l):new Is.RequestEditWindow(w);let R=E.lines.slice(v.start,v.endExclusive),x=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabEditWindowMaxTokens,this.expService);if(x!==void 0&&(0,u3i.countTokensForLines)(R,y6.computeTokens)>x)return new Is.NoNextEditReason.PromptTooLarge("editWindow");let D=!R.some(Pe=>Pe.includes(s3i.PromptTags.CURSOR)),N=(0,S$.constructTaggedFile)(E,v,_,m,y6.computeTokens,{includeLineNumbers:{areaAroundCodeToEdit:Xs.IncludeLineNumbersOption.None,currentFileContent:m.currentFile.includeLineNumbers}});if(N.isError())return new Is.NoNextEditReason.PromptTooLarge("currentFile");let{clippedTaggedCurrentDoc:B,areaAroundCodeToEdit:L}=N.val;f.setNLinesOfCurrentFileInPrompt(B.lines.length);let{aggressivenessLevel:j,userHappinessScore:M}=this.userInteractionMonitor.getAggressivenessLevel(),O=this.configService.getExperimentBasedConfig(Ci.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService);f.setUserAggressivenessSetting(O),f.setXtabAggressivenessLevel(j),M!==void 0&&f.setXtabUserHappinessScore(M);let q=await this.getAndProcessLanguageContext(e,n,h,y,m,{tracer:u,logContext:d,telemetry:f},s);if(s.isCancellationRequested)return new Is.NoNextEditReason.GotCancelled("afterLanguageContextAwait");let Q=m.neighborFiles.enabled?await(0,C$.raceCancellation)((0,C$.raceTimeout)(this.similarFilesContextService.getSnippetsForPrompt(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset),n.getDebounceTime()),s):void 0;if(s.isCancellationRequested)return new Is.NoNextEditReason.GotCancelled("afterNeighborSnippetsAwait");let U=new Cyc.LintErrors(h.id,E,this.langDiagService,e.xtabEditHistory),z=new S$.PromptPieces(E,v,_,h,e.xtabEditHistory,B.lines,L,q,j,U,y6.computeTokens,m,Q),{prompt:W,nDiffsInPrompt:$,diffTokensInPrompt:J,neighborSnippetsResult:ne}=(0,S$.getUserPrompt)(z);f.setNDiffsInPrompt($),f.setDiffTokensInPrompt(J),ne&&(f.setNNeighborSnippetsComputed(ne.nComputed),f.setNNeighborSnippetsInPrompt(ne.nIncluded),f.setNeighborSnippetIndicesInPrompt(ne.includedIndices));let H=Xs.ResponseFormat.fromPromptingStrategy(m.promptingStrategy),re=this.getPredictedOutput(h,R,H),ae=(0,LDr.constructMessages)({systemMsg:p3i(m.promptingStrategy),userMsg:W});d.setPrompt(ae),f.setPrompt(ae);let Oe=3e4*4;if((0,LDr.charCount)(ae)>Oe)return new Is.NoNextEditReason.PromptTooLarge("final");if(await this.debounce(n,c,u,f,s),s.isCancellationRequested)return new Is.NoNextEditReason.GotCancelled("afterDebounce");Promise.resolve().then(()=>{let Pe=U.getData();f.setLintErrors(Pe),d.setDiagnosticsData(Pe);let Z=this.terminalMonitor.getData();f.setTerminalOutput(Z),d.setTerminalData(Z)}),f.setSimilarFilesContext(this.similarFilesContextService.compute(h.id.uri,h.languageId,h.documentAfterEdits.value,E.cursorOffset)),e.fetchIssued=!0;let Fe={endpoint:A,modelServiceConfig:g,messages:ae,clippedTaggedCurrentDoc:B,editWindowInfo:{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:b,editWindowLineRange:v},promptPieces:z,prediction:re,originalEditWindow:l};return yield*this.streamEditsWithFiltering(e,Fe,{shouldRemoveCursorTagFromResponse:D,responseFormat:H},{aggressivenessLevel:j,userHappinessScore:M},c,n,{tracer:u,logContext:d,telemetry:f},s)}_configureDebounceTimings(e,r,n,o,s,c){let l=r.isCursorAtEndOfLine();o.setIsCursorAtLineEnd(l);let u=(0,vyc.determineIsInlineSuggestionPosition)(r);if(o.setIsInlineSuggestion(!!u),e.isSpeculative)c.trace("No extra debounce applied for speculative request");else{let d=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsExtraDebounceInlineSuggestion,this.expService);u&&d>0?(c.trace("Debouncing for inline suggestion position"),s.setExtraDebounce(d)):l?(c.trace("Debouncing for cursor at end of line"),s.setExtraDebounce(this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsExtraDebounceEndOfLine,this.expService))):c.trace("No extra debounce applied")}(0,Iv.isAggressivenessStrategy)(n.promptingStrategy)||this._applyAggressivenessSettings(s,c)}_applyAggressivenessSettings(e,r){let n=this.configService.getExperimentBasedConfig(Ci.ConfigKey.Advanced.InlineEditsAggressiveness,this.expService),s={[Iv.AggressivenessSetting.Low]:{minResponseConfigKey:Ci.ConfigKey.TeamInternal.InlineEditsAggressivenessLowMinResponseTimeMs},[Iv.AggressivenessSetting.Medium]:{minResponseConfigKey:Ci.ConfigKey.TeamInternal.InlineEditsAggressivenessMediumMinResponseTimeMs},[Iv.AggressivenessSetting.High]:{debounceConfigKey:Ci.ConfigKey.TeamInternal.InlineEditsAggressivenessHighDebounceMs},[Iv.AggressivenessSetting.Default]:void 0}[n];if(s){if(s.debounceConfigKey){let c=this.configService.getExperimentBasedConfig(s.debounceConfigKey,this.expService);e.setBaseDebounceTime(c),r.trace(`Aggressiveness ${n}: debounce set to ${c}ms`)}if(s.minResponseConfigKey){if(this.userInteractionMonitor.wasLastActionAcceptance){r.trace(`Aggressiveness ${n}: skipping min response time (last action was acceptance)`);return}let c=this.configService.getExperimentBasedConfig(s.minResponseConfigKey,this.expService);e.setExpectedTotalTime(c),r.trace(`Aggressiveness ${n}: min response time set to ${c}ms`)}}}getAndProcessLanguageContext(e,r,n,o,s,c,l){let u=this.configService.getConfig(Ci.ConfigKey.TeamInternal.InlineEditsLogContextRecorderEnabled);if(!s.languageContext.enabled&&!u)return Promise.resolve(void 0);let d=this.getLanguageContext(e,r,n,o,c,l);return u&&d.then(f=>{f&&c.logContext.setLanguageContext(f)}),s.languageContext.enabled?d:Promise.resolve(void 0)}async getLanguageContext(e,r,n,o,s,c){try{let l=this.workspaceService.textDocuments.find(v=>v.uri.toString()===n.id.uri);if(l===void 0||this.langCtxService.getContextProviders(l,l3i.ProviderTarget.NES).length<1)return;let d=r.getDebounceTime(),f=new Ayc.Position(o.lineNumber-1,o.column-1),h={opportunityId:e.opportunityId,completionId:e.headerRequestId,documentContext:{uri:l.uri.toString(),languageId:l.languageId,version:l.version,offset:l.offsetAt(f),position:f},activeExperiments:new Map,timeBudget:d,timeoutEnd:Date.now()+d,source:"nes"},m=a(async v=>{let b=[v.uri,...v.additionalUris??[]];return!!await(0,lyc.raceFilter)(b.map(w=>this.ignoreService.isCopilotIgnored(w)),w=>w)},"isSnippetIgnored"),g=[],A=a(async()=>{let v=this.langCtxService.getContextItems(l,h,c);for await(let b of v)b.kind===e3i.ContextKind.Snippet&&await m(b)||g.push({context:b,timeStamp:Date.now(),onTimeout:!1})},"getContextPromise"),y=Date.now();if(await(0,C$.raceCancellation)((0,C$.raceTimeout)(A(),d),c),c.isCancellationRequested)return;let E=Date.now(),_=this.langCtxService.getContextItemsOnTimeout(l,h);for(let v of _)v.kind===e3i.ContextKind.Snippet&&await m(v)||g.push({context:v,timeStamp:E,onTimeout:!0});return{start:y,end:E,items:g}}catch(l){s.logContext.setError(b$.ErrorUtils.fromUnknown(l)),s.tracer.trace(`Failed to fetch language context: ${l}`);return}}async*streamEditsWithFiltering(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEditsWithFiltering"),f={...l,tracer:d},h=this.streamEdits(e,r,n,o,s,c,f,u),m=0,g=await h.next();for(;!g.done;){let A=g.value.edit,[y,E]=this.filterEdit(e.getActiveDocument(),[A]);y.length===0?d.trace(`Filtered out an edit: ${A.toString()} using ${E.join(", ")} filter(s)`):(d.trace(`Yielding an edit: ${A.toString()}`),yield g.value,m++),g=await h.next()}return m===0&&g.value instanceof Is.NoNextEditReason.NoSuggestions?yield*this.doGetNextEditsWithCursorJump(e,r,c,l,u,s):g.value}async*streamEdits(e,r,n,o,s,c,l,u){let d=l.tracer.createSubLogger("streamEdits"),f=new dyc.CancellationTokenSource(u),h=f.token;try{return yield*this._streamEditsImpl(e,r,n,o,s,c,{...l,tracer:d},u,f,h)}finally{f.dispose()}}async _performFetch(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=f,A=this.configService.getExperimentBasedConfig(Ci.ConfigKey.NextEditSuggestionsFetcher,this.expService)||void 0,y=new JAc.FetchStreamSource,E=new fyc.StopWatch,_="",v,b=new C$.DeferredPromise;m.setHeaderRequestId(o),g.setFetchStartedAt(),m.setFetchStartTime();let T=e.makeChatRequest2({debugName:y6.ID,messages:r,finishedCb:a(async(P,D,N)=>{b.isSettled||b.complete(),v===void 0&&P!==""&&(v=E.elapsed(),m.addLog(`TTFT ${v} ms`)),y.update(P,N),_=P,m.setResponse(_)},"finishedCb"),location:wf.ChatLocation.Other,source:void 0,requestOptions:{temperature:0,stream:!0,prediction:n},userInitiatedRequest:void 0,telemetryProperties:{requestId:o},useFetcher:A,customMetadata:{aggressivenessLevel:s.aggressivenessLevel,userHappinessScore:s.userHappinessScore}},d);g.setResponse(T.then(P=>({response:P,ttft:v}))),m.setFullResponse(T.then(P=>P.type===wf.ChatFetchResponseType.Success?P.value:void 0)),T.then(P=>{P.type!==wf.ChatFetchResponseType.Success?y.reject(new o3i.FetchStreamError(qDr(P))):y.resolve()}).catch(P=>{m.setError(b$.ErrorUtils.fromUnknown(P)),m.addLog("ChatMLFetcher fetch call threw -- this's UNEXPECTED!"),y.reject(b$.ErrorUtils.fromUnknown(P))}).finally(()=>{m.setFetchEndTime(),b.isSettled||b.complete(),m.setResponse(_)});let w=await Promise.race([b.p,T]);if(w&&w.type!==wf.ChatFetchResponseType.Success)return w.type===wf.ChatFetchResponseType.NotFound&&!this.forceUseDefaultModel?(this.forceUseDefaultModel=!0,I$.ModelNotFound.INSTANCE):w.type===wf.ChatFetchResponseType.Unknown&&w.reason===wf.RESPONSE_CONTAINED_NO_CHOICES?new I$.FetchFailure(new Is.NoNextEditReason.NoSuggestions(u,l)):new I$.FetchFailure(qDr(w));let R=t3i.AsyncIterUtilsExt.splitLines(t3i.AsyncIterUtils.map(y.stream,P=>P.delta.text)),x=(async function*(){let P=0;for await(let D of R){let N=`Line ${P++} emitted with latency ${E.elapsed()} ms`;h.trace(N),yield c?D.replaceAll(s3i.PromptTags.CURSOR,""):D}})();return new I$.Lines(x,()=>_,E)}async*_streamEditsImpl(e,r,n,o,s,c,l,u,d,f){let{tracer:h,logContext:m,telemetry:g}=l,{endpoint:A,messages:y,clippedTaggedCurrentDoc:E,editWindowInfo:_,promptPieces:v,prediction:b,originalEditWindow:T}=r,{editWindow:w,editWindowLines:R,cursorOriginalLinesOffset:x,editWindowLineRange:P}=_,D=e.getActiveDocument().id,N=await this._performFetch(A,y,b,e.headerRequestId,o,n.shouldRemoveCursorTagFromResponse,w,e.documentBeforeEdits,f,l);if(N instanceof I$.ModelNotFound)return yield*this.doGetNextEdit(e,c,l,u,s);if(N instanceof I$.FetchFailure)return N.reason;let{linesStream:B,getResponseSoFar:L,fetchRequestStopWatch:j}=N,M=s instanceof T$.Retrying&&s.reason==="cursorJump",O;try{switch(n.responseFormat){case Xs.ResponseFormat.EditWindowOnly:{O=(0,$re.handleEditWindowOnly)(B);break}case Xs.ResponseFormat.CodeBlock:{O=(0,$re.handleCodeBlock)(B);break}case Xs.ResponseFormat.EditWindowWithEditIntent:case Xs.ResponseFormat.EditWindowWithEditIntentShort:{let ne=n.responseFormat===Xs.ResponseFormat.EditWindowWithEditIntentShort?c3i.EditIntentParseMode.ShortName:c3i.EditIntentParseMode.Tags;O=await(0,$re.handleEditWindowWithEditIntent)(B,h,ne);break}case Xs.ResponseFormat.CustomDiffPatch:{let ne=e.getActiveDocument(),H=v.currentDocument,ae=H.lines[E.keptRange.endExclusive-1].length,Oe=H.transformer.getOffsetRange(new Z_t.Range(E.keptRange.start+1,1,E.keptRange.endExclusive,ae+1)),ve=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabDuplicateAdditionsMode,this.expService);O=new $re.ResponseParseResult.DirectEdits(Iyc.XtabCustomDiffPatchResponseHandler.handleResponse(B,H,ne.id,ne.workspaceRoot,Oe,h,ve));break}case Xs.ResponseFormat.UnifiedWithXml:{O=await(0,$re.handleUnifiedWithXml)(B,{editWindowLines:R,editWindowLineRange:P,cursorOriginalLinesOffset:x,cursorColumnZeroBased:v.currentDocument.cursorPosition.column-1,editWindow:w,originalEditWindow:T,targetDocument:D,isFromCursorJump:M},e.documentBeforeEdits,h);break}default:(0,IAe.assertNever)(n.responseFormat)}if(O instanceof $re.ResponseParseResult.Done)return O.reason;if(O instanceof $re.ResponseParseResult.DirectEdits)return yield*O.stream;if(O.editIntentMetadata){let{intent:ne,parseError:H}=O.editIntentMetadata;if(g.setEditIntent(ne),H&&g.setEditIntentParseError(H),!Xs.EditIntent.shouldShowEdit(ne,v.aggressivenessLevel))return h.trace(`Filtered out edit due to edit intent "${ne}" with aggressiveness "${v.aggressivenessLevel}"`),new Is.NoNextEditReason.FilteredOut(`editIntent:${ne} aggressivenessLevel:${v.aggressivenessLevel}`)}let q=O.lines,Q={emitFastCursorLineChange:XLi.ResponseProcessor.mapEmitFastCursorLineChange(this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderEmitFastCursorLineChange,this.expService)),nLinesToConverge:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabNNonSignificantLinesToConverge,this.expService),nSignificantLinesToConverge:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabNSignificantLinesToConverge,this.expService)};h.trace(`starting to diff stream against edit window lines with latency ${j.elapsed()} ms`);let U=(0,uyc.backwardCompatSetting)(this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabEarlyCursorLineDivergenceCancellation,this.expService),ne=>{switch(ne){case!1:case void 0:return Iv.EarlyDivergenceCancellationMode.Off;case!0:return Iv.EarlyDivergenceCancellationMode.Cursor;case Iv.EarlyDivergenceCancellationMode.Off:case Iv.EarlyDivergenceCancellationMode.Cursor:case Iv.EarlyDivergenceCancellationMode.EditWindow:return ne;default:return Iv.EarlyDivergenceCancellationMode.Off}}),z=!1,W=U===Iv.EarlyDivergenceCancellationMode.Off?q:kyc(q,x,e,P,R,d,l,ne=>{z=ne},U),$=0,J=!1;for await(let ne of XLi.ResponseProcessor.diff(R,W,x,Q)){if(z)break;h.trace(`ResponseProcessor streamed edit #${$} with latency ${j.elapsed()} ms`);let H=[];if(ne.lineRange.startLineNumber===ne.lineRange.endLineNumberExclusive||ne.newLines.length===0||ne.lineRange.endLineNumberExclusive-ne.lineRange.startLineNumber===1&&ne.newLines.length===1){let re=new J_t.LineReplacement(new i3i.LineRange(ne.lineRange.startLineNumber+P.start,ne.lineRange.endLineNumberExclusive+P.start),ne.newLines);H.push(re)}else{let re=R.slice(ne.lineRange.startLineNumber-1,ne.lineRange.endLineNumberExclusive-1).join(` +`),ae=await this.diffService.computeDiff(re,ne.newLines.join(` +`),{ignoreTrimWhitespace:!1,maxComputationTimeMs:0,computeMoves:!1});h.trace(`Ran diff for #${$} with latency ${j.elapsed()} ms`);let Oe=P.start+ne.lineRange.startLineNumber;for(let ve of ae.changes){let Fe=new J_t.LineReplacement(new i3i.LineRange(Oe+ve.original.startLineNumber-1,Oe+ve.original.endLineNumberExclusive-1),ne.newLines.slice(ve.modified.startLineNumber-1,ve.modified.endLineNumberExclusive-1));H.push(Fe)}}m.setResponse(L());for(let re of H){if(h.trace(`extracting edit #${$}: ${re.toString()}`),!J){J=!0;let ae=this.determineArtificialDelayMs(c,h,g);if(ae&&(await(0,C$.timeout)(ae),h.trace(`Artificial delay of ${ae} ms completed`),u.isCancellationRequested))return new Is.NoNextEditReason.GotCancelled("afterArtificialDelay")}yield{edit:re,isFromCursorJump:M,window:w,originalWindow:T,targetDocument:D},$++}}return z?new Is.NoNextEditReason.GotCancelled(U===Iv.EarlyDivergenceCancellationMode.Cursor?"cursorLineDiverged":"editWindowLineDiverged"):new Is.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,w)}catch(q){return q instanceof o3i.FetchStreamError?q.reason:(m.setError(q),new Is.NoNextEditReason.Unexpected(b$.ErrorUtils.fromUnknown(q)))}}async*doGetNextEditsWithCursorJump(e,r,n,o,s,c){let{tracer:l,telemetry:u}=o,{editWindowInfo:{editWindow:d},modelServiceConfig:f,promptPieces:h}=r,m=new Is.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d),g=this.nextCursorPredictor.determineEnablement(f.supportsNextCursorLinePrediction);if(g===void 0||c instanceof T$.Retrying)return m;if(FDr(e))return l.trace("Skipping cursor prediction: user typed during request"),new Is.NoNextEditReason.GotCancelled("beforeNextCursorPredictionFetchUserTyped");let A=await this.nextCursorPredictor.predictNextCursorPosition(h,l,u,s);if(s.isCancellationRequested)return new Is.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetch");if(FDr(e))return l.trace("Skipping cursor prediction: user typed during prediction fetch"),new Is.NoNextEditReason.GotCancelled("afterNextCursorPredictionFetchUserTyped");if(A.isError())return l.trace(`Predicted next cursor line error: ${A.err.message}`),u.setNextCursorLineError(A.err.message),m;let y=A.val;if(y.kind==="differentFile")return yield*this.handleCrossFilePrediction(y,g,e,r,n,o,s);let E=y.lineNumber,_=E-h.currentDocument.cursorLineOffset;if(u.setNextCursorLineDistance(_),u.setNextCursorIsCrossFile(!1),l.trace(`Predicted next cursor line: ${E}`),E>=h.currentDocument.lines.length)return l.trace("Predicted next cursor line error: exceedsDocumentLines"),u.setNextCursorLineError("exceedsDocumentLines"),m;if(h.editWindowLinesRange.contains(E))return l.trace("Predicted next cursor line error: withinEditWindow"),u.setNextCursorLineError("withinEditWindow"),m;let v=E+1,b=h.activeDoc.documentAfterEditsLines.at(E),T=y6.getNextCursorColumn(b);switch(g){case z_t.NextCursorLinePrediction.Jump:{let w=new BDr.Position(v,T);return new Is.NoNextEditReason.NoSuggestions(e.documentBeforeEdits,d,w)}case z_t.NextCursorLinePrediction.OnlyWithEdit:return yield*this.doGetNextEditWithSelection(e,new Z_t.Range(v,T,v,T),n,o,s,new T$.Retrying("cursorJump"),d);default:(0,IAe.assertNever)(g)}}async*handleCrossFilePrediction(e,r,n,o,s,c,l){let{tracer:u,telemetry:d}=c,{editWindowInfo:{editWindow:f},promptPieces:h}=o,m=h.activeDoc.workspaceRoot;if(!m&&!(0,r3i.isAbsolute)(e.filePath))return u.trace("Predicted cross-file cursor jump error: noWorkspaceRoot"),d.setNextCursorLineError("crossFile:noWorkspaceRoot"),new Is.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f);let g=(0,r3i.isAbsolute)(e.filePath)?n3i.URI.file(e.filePath):n3i.URI.joinPath(m,e.filePath),A=tyc.DocumentId.create(g.toString()),y=e.lineNumber+1,E=new BDr.Position(y,1);switch(d.setNextCursorIsCrossFile(!0),u.trace(`Predicted cross-file cursor jump: ${e.filePath}:${e.lineNumber}`),r){case z_t.NextCursorLinePrediction.Jump:return new Is.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A);case z_t.NextCursorLinePrediction.OnlyWithEdit:{let _;try{_=await this.workspaceService.openTextDocument(g)}catch(w){return u.trace(`Failed to open target file for cross-file edit: ${b$.ErrorUtils.fromUnknown(w).message}`),d.setNextCursorLineError("crossFile:failedToOpenFile"),new Is.NoNextEditReason.NoSuggestions(n.documentBeforeEdits,f,E,A)}if(l.isCancellationRequested)return new Is.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocument");if(FDr(n))return u.trace("Skipping cross-file edit: user typed during openTextDocument"),new Is.NoNextEditReason.GotCancelled("afterCrossFileOpenTextDocumentUserTyped");let v=new hyc.StringText(_.getText()),b=new Is.StatelessNextEditDocument(A,h.activeDoc.workspaceRoot,nyc.LanguageId.create(_.languageId),v.getLines(),J_t.LineEdit.empty,v,new ryc.Edits(pyc.StringEdit,[])),T=new Is.StatelessNextEditRequest(n.headerRequestId,n.opportunityId,v,[b],0,n.xtabEditHistory,new C$.DeferredPromise,n.expandedEditWindowNLines,n.isSpeculative,n.logContext,n.recordingBookmark,n.recording,n.providerRequestStartDateTime);return yield*this.doGetNextEditWithSelection(T,new Z_t.Range(y,1,y,1),s,c,l,new T$.Retrying("cursorJump"),f)}default:(0,IAe.assertNever)(r)}}computeEditWindowLinesRange(e,r,n,o){let s=e.lines,c=e.cursorLineOffset,l;if(this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderUseVaryingLinesAbove,this.expService)){l=0;for(let g=0;g<8;++g){let A=c-g;if(A<0)break;if(s[A].trim()!==""){l=g;break}}}else l=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesAbove,this.expService)??S$.N_LINES_ABOVE;let u;if(r.expandedEditWindowNLines!==void 0)n.trace(`Using expanded nLinesBelow: ${r.expandedEditWindowNLines}`),u=r.expandedEditWindowNLines;else{let m=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderNLinesBelow,this.expService);m!==void 0?(n.trace(`Using overridden nLinesBelow: ${m}`),u=m):(n.trace(`Using default nLinesBelow: ${S$.N_LINES_BELOW}`),u=S$.N_LINES_BELOW)}let d=Math.max(0,c-l),f=Math.min(s.length,c+u+1),h=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabMaxMergeConflictLines,this.expService);if(h){let m=new UDr.OffsetRange(d,f),g=(0,LDr.findMergeConflictMarkersRange)(s,m,h);if(g){let A=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabOnlyMergeConflictLines,this.expService);o.setMergeConflictExpanded(A?"only":"normal"),A?(n.trace(`Expanding edit window to include ONLY merge conflict markers: ${g.toString()}`),d=g.start,f=g.endExclusive):(n.trace(`Expanding edit window to include merge conflict markers: ${g.toString()}; edit window range [${d}, ${f})`),f=Math.max(f,g.endExclusive))}}return new UDr.OffsetRange(d,f)}determineModelConfiguration(e){if(this.forceUseDefaultModel){let s={modelName:void 0,...Xs.DEFAULT_OPTIONS},c=this.modelService.defaultModelConfiguration();return{promptOptions:jDr(s,c),modelServiceConfig:c}}let r={modelName:void 0,promptingStrategy:void 0,currentFile:{maxTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabCurrentFileMaxTokens,this.expService),includeTags:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabIncludeTagsInCurrentFile,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabIncludeLineNumbersInCurrentFile,this.expService),includeCursorTag:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabIncludeCursorTagInCurrentFile,this.expService),prioritizeAboveCursor:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabPrioritizeAboveCursor,this.expService)},pagedClipping:{pageSize:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabPageSize,this.expService)},recentlyViewedDocuments:{nDocuments:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabNRecentlyViewedDocuments,this.expService),maxTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedDocumentsMaxTokens,this.expService),includeViewedFiles:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabIncludeViewedFiles,this.expService),includeLineNumbers:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedIncludeLineNumbers,this.expService),clippingStrategy:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabRecentlyViewedClippingStrategy,this.expService)},languageContext:h3i(e.languageId,{enabled:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabled,this.expService),enabledLanguages:this.configService.getConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextEnabledLanguages),enableAllContextProviders:this.configService.getExperimentBasedConfig(Ci.ConfigKey.Advanced.DiagnosticsContextProvider,this.expService)||this.configService.getExperimentBasedConfig(Ci.ConfigKey.Advanced.ChatSessionContextProvider,this.expService),maxTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextMaxTokens,this.expService),traitPosition:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabLanguageContextTraitsPosition,this.expService)}),neighborFiles:{enabled:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabIncludeNeighborFiles,this.expService),maxTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabNeighborFilesMaxTokens,this.expService)},diffHistory:{nEntries:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this.expService),maxTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabDiffMaxTokens,this.expService),onlyForDocsInPrompt:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabDiffOnlyForDocsInPrompt,this.expService),useRelativePaths:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabDiffUseRelativePaths,this.expService)},lintOptions:void 0,includePostScript:!0,globalBudget:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetEnabled,this.expService)?{totalTokens:this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabGlobalBudgetTotalTokens,this.expService),order:Xs.GlobalBudgetOptions.DEFAULT_ORDER,shares:Xs.GlobalBudgetOptions.DEFAULT_SHARES}:void 0},n=this.modelService.selectedModelConfiguration(),o=Xs.applyStrategyConfig(n);return{promptOptions:jDr(r,o),modelServiceConfig:o}}getEndpointWithLogging(e,r,n){let o=this.getEndpoint(e);return r.setEndpointInfo(typeof o.urlOrRequestMetadata=="string"?o.urlOrRequestMetadata:JSON.stringify(o.urlOrRequestMetadata.type),o.model),n.setModelName(o.model),o}getEndpoint(e){let r=this.configService.getConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderUrl),n=this.configService.getConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderApiKey);return r!==void 0&&n!==void 0?this.instaService.createInstance(xyc.XtabEndpoint,r,n,e):(0,XAc.createProxyXtabEndpoint)(this.instaService,e)}getPredictedOutput(e,r,n){return this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsXtabProviderUsePrediction,this.expService)?{type:"content",content:m3i(e,r,n)}:void 0}async debounce(e,r,n,o,s){if(this.simulationCtx.isInSimulationTests)return;if(r instanceof T$.Retrying){n.trace("Skipping debounce on retry");return}let c=e.getDebounceTime();n.trace(`Debouncing for ${c} ms`),o.setDebounceTime(c);try{await(0,C$.timeout)(c,s)}catch{}}determineArtificialDelayMs(e,r,n){if(this.simulationCtx.isInSimulationTests)return;let o=e.getArtificialDelay();if(!(o<=0))return r.trace(`Enforcing artificial delay of ${o} ms`),n.setArtificialDelay(o),o}filterEdit(e,r){let n=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsAllowImportChanges,this.expService),o=[l=>({filterName:"IgnoreImportChangesAspect",filteredEdits:_yc.IgnoreImportChangesAspect.filterEdit(e,l,n)}),l=>({filterName:"IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges",filteredEdits:Y_t.IgnoreEmptyLineAndLeadingTrailingWhitespaceChanges.filterEdit(e,l)})];this.configService.getExperimentBasedConfig(Ci.ConfigKey.InlineEditsAllowWhitespaceOnlyChanges,this.expService)||o.push(l=>({filterName:"IgnoreWhitespaceOnlyChanges",filteredEdits:Y_t.IgnoreWhitespaceOnlyChanges.filterEdit(e,l)}));let s=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsUndoInsertionFiltering,this.expService);if(s!==void 0){let l;switch(s){case"v1":l=Y_t.editWouldDeleteWhatWasJustInserted;break;case"v2":l=Y_t.editWouldDeleteWhatWasJustInserted2;break;default:(0,IAe.assertNever)(s)}o.push(u=>({filterName:`UndoInsertionFiltering:${s}`,filteredEdits:l(e,new J_t.LineEdit(u))?[]:u}))}let c=this.configService.getExperimentBasedConfig(Ci.ConfigKey.TeamInternal.InlineEditsFilterOutEditsWithSubstrings,this.expService);if(c){let l=c.split(",").map(u=>u.trim()).filter(u=>u.length>0);o.push(u=>({filterName:"FilterOutEditsWithSubstrings",filteredEdits:d3i(u,l)}))}return o.reduce(([l,u],d)=>{let f=d(l);return f.filteredEdits.length===l.length?[l,u]:[f.filteredEdits,[...u,f.filterName]]},[r,[]])}static getNextCursorColumn(e){return(e?.match(/^(\s*)/)?.at(1)?.length??0)+1}};Sp.XtabProvider=QDr;Sp.XtabProvider=QDr=y6=YAc([FD(0,iyc.IInlineEditsModelService),FD(1,syc.ISimulationTestContext),FD(2,gyc.IInstantiationService),FD(3,cyc.IWorkspaceService),FD(4,ZAc.IDiffService),FD(5,Ci.IConfigurationService),FD(6,ayc.IExperimentationService),FD(7,l3i.ILanguageContextProviderService),FD(8,oyc.ILanguageDiagnosticsService),FD(9,eyc.IIgnoreService),FD(10,byc.ISimilarFilesContextService)],QDr);function d3i(t,e){return t.filter(r=>r.newLines.every(n=>e.every(o=>!n.includes(o))))}a(d3i,"filterOutEditsWithSubstrings");function f3i(t){let e=t.cursorLineOffset,r=Math.max(0,e-S$.N_LINES_AS_CONTEXT),n=Math.min(t.lines.length,e+S$.N_LINES_AS_CONTEXT+1);return new UDr.OffsetRange(r,n)}a(f3i,"computeAreaAroundEditWindowLinesRange");function qDr(t){switch(t.type){case wf.ChatFetchResponseType.Canceled:return new Is.NoNextEditReason.GotCancelled("afterFetchCall");case wf.ChatFetchResponseType.OffTopic:case wf.ChatFetchResponseType.Filtered:case wf.ChatFetchResponseType.PromptFiltered:case wf.ChatFetchResponseType.Length:case wf.ChatFetchResponseType.RateLimited:case wf.ChatFetchResponseType.QuotaExceeded:case wf.ChatFetchResponseType.ExtensionBlocked:case wf.ChatFetchResponseType.AgentUnauthorized:case wf.ChatFetchResponseType.AgentFailedDependency:case wf.ChatFetchResponseType.InvalidStatefulMarker:return new Is.NoNextEditReason.Uncategorized(b$.ErrorUtils.fromUnknown(t));case wf.ChatFetchResponseType.BadRequest:case wf.ChatFetchResponseType.NotFound:case wf.ChatFetchResponseType.Failed:case wf.ChatFetchResponseType.NetworkError:case wf.ChatFetchResponseType.Unknown:return new Is.NoNextEditReason.FetchFailure(b$.ErrorUtils.fromUnknown(t))}}a(qDr,"mapChatFetcherErrorToNoNextEditReason");function jDr(t,e){return{...t,modelName:e.modelName,promptingStrategy:e.promptingStrategy,includePostScript:e.includePostScript??t.includePostScript,currentFile:{...t.currentFile,...e.currentFile,includeTags:e.includeTagsInCurrentFile},recentlyViewedDocuments:{...t.recentlyViewedDocuments,...e.recentlyViewedDocuments},lintOptions:e.lintOptions?Pyc(t.lintOptions,e.lintOptions):t.lintOptions}}a(jDr,"overrideModelConfig");var Ryc={...Xs.DEFAULT_CURSOR_PREDICTION_LINT_OPTIONS,maxLineDistance:10};function Pyc(t,e){return{...t??Ryc,...e}}a(Pyc,"mergeLintOptions");function p3i(t){switch(t){case Xs.PromptingStrategy.UnifiedModel:return K4e.unifiedModelSystemPrompt;case Xs.PromptingStrategy.Codexv21NesUnified:case Xs.PromptingStrategy.SimplifiedSystemPrompt:return K4e.simplifiedPrompt;case Xs.PromptingStrategy.PatchBased:case Xs.PromptingStrategy.PatchBased01:case Xs.PromptingStrategy.PatchBased02:case Xs.PromptingStrategy.PatchBased02WithRecentLineNumbers:case Xs.PromptingStrategy.PatchBased02WithoutRecentLineNumbers:case Xs.PromptingStrategy.Xtab275:case Xs.PromptingStrategy.XtabAggressiveness:case Xs.PromptingStrategy.Xtab275Aggressiveness:case Xs.PromptingStrategy.Xtab275AggressivenessHighLow:case Xs.PromptingStrategy.Xtab275EditIntent:case Xs.PromptingStrategy.Xtab275EditIntentShort:return K4e.xtab275SystemPrompt;case Xs.PromptingStrategy.Nes41Miniv3:return K4e.nes41Miniv3SystemPrompt;case Xs.PromptingStrategy.CopilotNesXtab:case void 0:return K4e.systemPromptTemplate;default:(0,IAe.assertNever)(t)}}a(p3i,"pickSystemPrompt");function h3i(t,{enabled:e,enabledLanguages:r,maxTokens:n,enableAllContextProviders:o,traitPosition:s}){return t in r?{enabled:r[t],maxTokens:n,traitPosition:s}:o?{enabled:!0,maxTokens:n,traitPosition:s}:{enabled:e,maxTokens:n,traitPosition:s}}a(h3i,"determineLanguageContextOptions");function m3i(t,e,r){if(r===Xs.ResponseFormat.UnifiedWithXml)return["",...e,""].join(` +`);if(r===Xs.ResponseFormat.EditWindowOnly)return e.join(` +`);if(r===Xs.ResponseFormat.EditWindowWithEditIntent)return["<|edit_intent|>high<|/edit_intent|>",...e].join(` +`);if(r===Xs.ResponseFormat.EditWindowWithEditIntentShort)return["H",...e].join(` +`);if(r===Xs.ResponseFormat.CodeBlock)return["```",...e,"```"].join(` +`);if(r===Xs.ResponseFormat.CustomDiffPatch){let n=t.workspaceRoot?.path;return`${(0,u3i.toUniquePath)(t.id,n)}:`}else(0,IAe.assertNever)(r)}a(m3i,"getPredictionContents");async function*kyc(t,e,r,n,o,s,{tracer:c},l,u){let d=r.intermediateUserEdit;if(!d||d.isEmpty()){yield*t;return}let f=r.documentBeforeEdits.getTransformer(),h=d.apply(f.text),m=new myc.PositionOffsetTransformer(h),g={currentDoc:h,currentTransformer:m},A=a(E=>{if(E>=o.length)return!1;switch(u){case Iv.EarlyDivergenceCancellationMode.Cursor:return E===e;case Iv.EarlyDivergenceCancellationMode.EditWindow:return!0}},"shouldCheckLine"),y=0;for await(let E of t){if(A(y)){let _=n.start+y,v=(0,a3i.getCurrentLine)(f,_,d,g);if(v!==void 0){let b=o[y];if(v!==b&&!(0,a3i.isModelLineCompatible)(b,v,E)){l(!0),c.trace(`Line ${y} DIVERGED (mode=${u}): model="${E}" current="${v}"`),s.cancel();return}}}yield E,y++}}a(kyc,"linesWithIntermediateEditDivergenceCheck")});var A3i=I(G4=>{"use strict";p();var Dyc=G4&&G4.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},X_t=G4&&G4.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(G4,"__esModule",{value:!0});G4.StaticGitHubAuthenticationService=void 0;G4.setCopilotToken=Lyc;var Nyc=Sl(),Myc=Ap(),evt=CE(),Oyc=RMe(),Byc=Y7(),tvt=class extends evt.BaseAuthenticationService{static{a(this,"StaticGitHubAuthenticationService")}constructor(e,r,n,o,s){super(r,n,o,s),this.tokenProvider=e;let c=this;this._anyGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:evt.GITHUB_SCOPE_USER_EMAIL,account:{id:"user",label:"User"}}:void 0,this._permissiveGitHubSession=e?{get id(){return c.tokenProvider()},get accessToken(){return c.tokenProvider()},scopes:evt.GITHUB_SCOPE_ALIGNED,account:{id:"user",label:"User"}}:void 0}get hasCopilotTokenSource(){return!0}async getGitHubSession(e,r){if(e==="permissive"){if(this.isMinimalMode){if(r.createIfNone||r.forceNewSession)throw new evt.MinimalModeError;return}return this._permissiveGitHubSession}else return this._anyGitHubSession}async getCopilotToken(e){return await super.getCopilotToken(e)}setCopilotToken(e){this._tokenStore.copilotToken=e,this.fireAuthenticationChange("setCopilotToken")}getAnyAdoSession(e){return Promise.resolve(void 0)}getAdoAccessTokenBase64(e){return Promise.resolve(void 0)}};G4.StaticGitHubAuthenticationService=tvt;G4.StaticGitHubAuthenticationService=tvt=Dyc([X_t(1,Myc.ILogService),X_t(2,Byc.ICopilotTokenStore),X_t(3,Oyc.ICopilotTokenManager),X_t(4,Nyc.IConfigurationService)],tvt);function Lyc(t,e){if(!(t instanceof tvt))throw new Error("This function should only be used with StaticGitHubAuthenticationService");t.setCopilotToken(e)}a(Lyc,"setCopilotToken")});var C3i=I(xv=>{"use strict";p();Object.defineProperty(xv,"__esModule",{value:!0});xv.GraphQLErrorType=void 0;xv.getErrorCode=_3i;xv.derivePullRequestState=Fyc;xv.makeGitHubAPIRequest=v3i;xv.makeGitHubGraphQLRequest=xAe;xv.makeSearchGraphQLRequest=Uyc;xv.getPullRequestFromGlobalId=Qyc;xv.addPullRequestCommentGraphQLRequest=qyc;xv.closePullRequest=jyc;xv.makeGitHubAPIRequestWithPagination=Hyc;xv.getAssignableActorsWithSuggestedActors=Gyc;xv.getAssignableActorsWithAssignableUsers=$yc;function y3i(t){return typeof t=="object"&&t!==null}a(y3i,"isObject");var E3i;(function(t){t.Unprocessable="UNPROCESSABLE"})(E3i||(xv.GraphQLErrorType=E3i={}));function _3i(t){if(!y3i(t))return;if(t.status!==void 0)return String(t.status);let e=t.networkError;if(y3i(e)&&e.statusCode!==void 0)return String(e.statusCode);let r=t.graphQLErrors;if(Array.isArray(r)&&r.length>0){let n=r[0];if(n){if(n.extensions?.code!==void 0)return String(n.extensions.code);if(n.type!==void 0)return String(n.type)}}if(t.code!==void 0)return String(t.code);if(typeof t.name=="string"&&t.name)return t.name}a(_3i,"getErrorCode");function Fyc(t){let e=t.state?.toUpperCase();return e==="MERGED"?"merged":e==="CLOSED"?"closed":t.isDraft?"draft":"open"}a(Fyc,"derivePullRequestState");async function v3i(t,e,r,n,o,s,c,l){let{body:u,version:d,type:f="json",userAgent:h,accept:m,additionalHeaders:g,returnStatusCodeOnError:A=!1,silent404:y=!1,callSite:E="github-api-rest"}=l??{},_={Accept:m??"application/vnd.github+json",...g};c&&(_.Authorization=`Bearer ${c}`),d&&(_["X-GitHub-Api-Version"]=d),h&&(_["User-Agent"]=h);let v=await t.fetch(`${n}/${o}`,{method:s,headers:_,body:u?JSON.stringify(u):void 0,callSite:E});if(!v.ok)return y&&v.status===404||e.error(`[GitHubAPI] ${s} ${n}/${o} - Status: ${v?.status}`),A?{status:v.status}:void 0;try{let b=f==="json"?await v.json():await v.text(),T=Number(v.headers.get("x-ratelimit-remaining")),w=`[RateLimit] REST rate limit remaining: ${T}, ${o}`;return T<1e3?(e.warn(w),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:T.toString()})):e.debug(w),b}catch{return}}a(v3i,"makeGitHubAPIRequest");async function xAe(t,e,r,n,o,s,c,l="github-api-graphql"){let u={Accept:"application/vnd.github+json","Content-Type":"application/json"};s&&(u.Authorization=`Bearer ${s}`);let d=JSON.stringify({query:o,variables:c}),f=await t.fetch(`${n}/graphql`,{method:"POST",headers:u,body:d,callSite:l});if(!f.ok){e.debug(`[GitHubAPI] GraphQL request to ${n}/graphql failed with status ${f.status}`);return}try{let h=await f.json(),m=Number(f.headers.get("x-ratelimit-remaining")),g=`[RateLimit] GraphQL rate limit remaining: ${m}, query: ${o}`;return m<1e3?(e.warn(g),r.sendMSFTTelemetryEvent("githubAPI.approachingRateLimit",{rateLimit:m.toString()})):e.debug(g),h}catch{return}}a(xAe,"makeGitHubGraphQLRequest");async function Uyc(t,e,r,n,o,s,c=20){let l=` query FetchCopilotAgentPullRequests($searchQuery: String!, $first: Int!, $after: String) { search(query: $searchQuery, type: ISSUE, first: $first, after: $after) { nodes { @@ -1401,7 +1355,7 @@ Your task is to predict and complete the changes the developer would have made n issueCount } } - `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await LAe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(D_c,"makeSearchGraphQLRequest");async function N_c(t,e,r,n,o,s){let c=` + `;e.debug(`[FolderRepositoryManager+0] Fetch pull request category ${s}`);let d=await xAe(t,e,r,n,l,o,{searchQuery:s,first:c},"github-graphql-search-prs"),f=d?.data?.search?.nodes??[];return e.debug(`[GitHubAPI] FetchCopilotAgentPullRequests: host=${n}, searchQuery=${s}, resultCount=${f.length}, errors=${JSON.stringify(d?.errors)}`),f}a(Uyc,"makeSearchGraphQLRequest");async function Qyc(t,e,r,n,o,s){let c=` query GetPullRequestGlobal($globalId: ID!) { node(id: $globalId) { ... on PullRequest { @@ -1436,7 +1390,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await LAe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=I3i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(N_c,"getPullRequestFromGlobalId");async function M_c(t,e,r,n,o,s,c){let l=` + `;e.debug(`[GitHubAPI] Fetch pull request by global ID ${s}`);let u=await xAe(t,e,r,n,c,o,{globalId:s},"github-graphql-get-pr-by-id"),d=u?.data?.node;if(e.debug(`[GitHubAPI] GetPullRequestGlobal: host=${n}, globalId=${s}, found=${!!d}, prNumber=${d?.number}, errors=${JSON.stringify(u?.errors)}`),!d){let f={requestFailed:String(u===void 0)},h=_3i(u?.errors?.[0]);h&&(f.errorCode=h),r.sendMSFTTelemetryErrorEvent("pr.getPullRequestFromGlobalIdFailed",f)}return d}a(Qyc,"getPullRequestFromGlobalId");async function qyc(t,e,r,n,o,s,c){let l=` mutation AddPullRequestComment($pullRequestId: ID!, $body: String!) { addComment(input: {subjectId: $pullRequestId, body: $body}) { commentEdge { @@ -1452,7 +1406,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await LAe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(M_c,"addPullRequestCommentGraphQLRequest");async function O_c(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await x3i(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(O_c,"closePullRequest");async function B_c(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(B_c,"makeGitHubAPIRequestWithPagination");async function L_c(t,e,r,n,o,s,c){let l=` + `;return e.debug(`[GitHubAPI] Adding comment to pull request ${s}`),(await xAe(t,e,r,n,l,o,{pullRequestId:s,body:c},"github-graphql-add-pr-comment"))?.data?.addComment?.commentEdge?.node||null}a(qyc,"addPullRequestCommentGraphQLRequest");async function jyc(t,e,r,n,o,s,c,l){e.debug(`[GitHubAPI] Closing pull request ${s}/${c}#${l}`);let u=await v3i(t,e,r,n,`repos/${s}/${c}/pulls/${l}`,"POST",o,{body:{state:"closed"},version:"2022-11-28",callSite:"github-rest-close-pr"}),d=u?.state==="closed";return d?e.debug(`[GitHubAPI] Successfully closed pull request ${s}/${c}#${l}`):e.error(`[GitHubAPI] Failed to close pull request ${s}/${c}#${l}. Its state is ${u?.state}`),d}a(jyc,"closePullRequest");async function Hyc(t,e,r,n,o,s){let c=!1,l=[],u=20,d=1;do{let f=await t.fetch(`${r}/${n}?page_size=${u}&page_number=${d}&resource_state=draft,open&repo_nwo=${o}`,{headers:{Authorization:`Bearer ${s}`,Accept:"application/json"},callSite:"github-api-sessions"});if(!f.ok)return e.error(`[GitHubAPI] Failed to fetch sessions: ${f.status} ${f.statusText}`),l;let h=await f.json();l.push(...h.sessions),c=h.sessions.length===u,d++}while(c);return l}a(Hyc,"makeGitHubAPIRequestWithPagination");async function Gyc(t,e,r,n,o,s,c){let l=` query GetSuggestedActors($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { suggestedActors( @@ -1473,7 +1427,7 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await LAe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(L_c,"getAssignableActorsWithSuggestedActors");async function F_c(t,e,r,n,o,s,c){let l=` + `,u=[],d=null,f=!0;for(;f;){let m=await xAe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-suggested-actors");if(!m?.data?.repository?.suggestedActors)break;let g=m.data.repository.suggestedActors;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(Gyc,"getAssignableActorsWithSuggestedActors");async function $yc(t,e,r,n,o,s,c){let l=` query GetAssignableUsers($owner: String!, $name: String!, $first: Int!, $after: String) { repository(owner: $owner, name: $name) { assignableUsers(first: $first, after: $after) { @@ -1490,27 +1444,27 @@ Your task is to predict and complete the changes the developer would have made n } } } - `,u=[],d=null,f=!0;for(;f;){let m=await LAe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a(F_c,"getAssignableActorsWithAssignableUsers")});var P3i=I(RR=>{"use strict";p();Object.defineProperty(RR,"__esModule",{value:!0});RR.BaseOctoKitService=RR.PermissiveAuthRequiredError=RR.VSCodeTeamId=RR.IOctoKitService=RR.IGithubRepositoryService=void 0;var k3i=rn(),R3i=_G(),x6=w3i();RR.IGithubRepositoryService=(0,k3i.createServiceIdentifier)("IGithubRepositoryService");RR.IOctoKitService=(0,k3i.createServiceIdentifier)("IOctoKitService");RR.VSCodeTeamId=1682102;var aNr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};RR.PermissiveAuthRequiredError=aNr;var cNr=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,x6.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,x6.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,x6.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async closePullRequestWithToken(e,r,n,o){return(0,x6.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,x6.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,R3i.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(gCt,"__esModule",{value:!0});gCt.NullBaseOctoKitService=void 0;var U_c=P3i(),lNr=class extends U_c.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};gCt.NullBaseOctoKitService=lNr});var B3i=I(Pl=>{"use strict";p();var bCt=Pl&&Pl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Ru=Pl&&Pl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.CopilotTokenManagerFromGitHubToken=Pl.CopilotTokenManagerFromDeviceId=Pl.RefreshableCopilotTokenManager=Pl.StaticExtendedTokenInfoCopilotTokenManager=Pl.FixedCopilotTokenManager=Pl.BaseCopilotTokenManager=Pl.tokenErrorString=void 0;Pl.createStaticGitHubTokenProvider=q_c;Pl.getOrCreateTestingCopilotTokenManager=j_c;var uNr=(bre(),Ca(vre)),Q_c=Sc(),N3i=ko(),ACt=qut(),O3i=Il(),SCt=PE(),TCt=g$(),UAe=a4(),ICt=D3i(),xCt=pp(),dBe=ey(),wCt=o0(),M3i=Xge(),w6=c0t(),yCt=UMe();Pl.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function q_c(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(UAe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Pl.tokenErrorString)}}a(q_c,"createStaticGitHubTokenProvider");function j_c(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new ACt.SyncDescriptor(_Ct,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new ACt.SyncDescriptor(vCt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new ACt.SyncDescriptor(ECt,[process.env.GITHUB_PAT]);if(UAe.isScenarioAutomation)return new ACt.SyncDescriptor(CCt,[t]);throw new Error(Pl.tokenErrorString)}a(j_c,"getOrCreateTestingCopilotTokenManager");var FAe=class extends N3i.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new Q_c.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,N3i.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=M3i.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,yCt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,w6.containsVSCodeOrg)(s.organization_list??[])},d=M3i.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,yCt.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:uNr.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:uNr.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,dBe.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,w6.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,w6.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,w6.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:uNr.RequestType.CopilotUserInfo})).json()}};Pl.BaseCopilotTokenManager=FAe;var ECt=class extends FAe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ICt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,w6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,w6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new w6.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.FixedCopilotTokenManager=ECt;Pl.FixedCopilotTokenManager=ECt=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,SCt.ICAPIClientService),Ru(4,TCt.IDomainService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService)],ECt);var _Ct=class extends FAe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new ICt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new w6.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Pl.StaticExtendedTokenInfoCopilotTokenManager=_Ct;Pl.StaticExtendedTokenInfoCopilotTokenManager=_Ct=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,SCt.ICAPIClientService),Ru(4,TCt.IDomainService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService)],_Ct);var uBe=class extends FAe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,yCt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new w6.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,yCt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Pl.RefreshableCopilotTokenManager=uBe;var CCt=class extends uBe{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new ICt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Pl.CopilotTokenManagerFromDeviceId=CCt;Pl.CopilotTokenManagerFromDeviceId=CCt=bCt([Ru(1,xCt.ILogService),Ru(2,wCt.ITelemetryService),Ru(3,TCt.IDomainService),Ru(4,SCt.ICAPIClientService),Ru(5,dBe.IFetcherService),Ru(6,UAe.IEnvService),Ru(7,O3i.IConfigurationService)],CCt);var vCt=class extends uBe{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new ICt.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Pl.CopilotTokenManagerFromGitHubToken=vCt;Pl.CopilotTokenManagerFromGitHubToken=vCt=bCt([Ru(2,xCt.ILogService),Ru(3,wCt.ITelemetryService),Ru(4,TCt.IDomainService),Ru(5,SCt.ICAPIClientService),Ru(6,dBe.IFetcherService),Ru(7,UAe.IEnvService),Ru(8,O3i.IConfigurationService)],vCt)});var L3i=I(R6=>{"use strict";p();var H_c=R6&&R6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},dNr=R6&&R6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(R6,"__esModule",{value:!0});R6.ChatQuotaService=void 0;var G_c=(bre(),Ca(vre)),$_c=Sc(),V_c=ko(),W_c=SE(),z_c=PE(),Y_c=pp(),fNr=class extends V_c.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new $_c.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidAuthenticationChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:G_c.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};R6.ChatQuotaService=fNr;R6.ChatQuotaService=fNr=H_c([dNr(0,W_c.IAuthenticationService),dNr(1,Y_c.ILogService),dNr(2,z_c.ICAPIClientService)],fNr)});var U3i=I(RCt=>{"use strict";p();Object.defineProperty(RCt,"__esModule",{value:!0});RCt.DefaultsOnlyConfigurationService=void 0;var F3i=Il(),pNr=class extends F3i.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=F3i.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};RCt.DefaultsOnlyConfigurationService=pNr});var q3i=I(kCt=>{"use strict";p();Object.defineProperty(kCt,"__esModule",{value:!0});kCt.computeDiff=J_c;kCt.computeDiffSync=Q3i;var K_c=YRr();async function J_c(t,e,r){return Q3i(t,e,r)}a(J_c,"computeDiff");function Q3i(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new K_c.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(Q3i,"computeDiffSync")});var $3i=I(jD=>{"use strict";p();var Z_c=jD&&jD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),X_c=jD&&jD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),G3i=jD&&jD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=oCc([j3i.join(__dirname,"diffWorker.js"),j3i.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new eCc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await iCc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:gNr(o.changes),moves:o.moves.map(c=>new nCc.MovedText(new hNr.LineRangeMapping(new PCt.LineRange(c[0],c[1]),new PCt.LineRange(c[2],c[3])),gNr(c[4])))}}};jD.DiffServiceImpl=mNr;function gNr(t){return t.map(e=>new hNr.DetailedLineRangeMapping(new PCt.LineRange(e[0],e[1]),new PCt.LineRange(e[2],e[3]),e[4]?.map(r=>new hNr.RangeMapping(new H3i.Range(r[0],r[1],r[2],r[3]),new H3i.Range(r[4],r[5],r[6],r[7])))))}a(gNr,"toLineRangeMappings");function oCc(t){for(let e of t)if((0,rCc.existsSync)(e))return e}a(oCc,"firstExistingPath")});var W3i=I(k6=>{"use strict";p();var sCc=k6&&k6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},V3i=k6&&k6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(k6,"__esModule",{value:!0});k6.CAPIClientImpl=void 0;var aCc=a4(),cCc=ey(),lCc=PE(),ANr=class extends lCc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};k6.CAPIClientImpl=ANr;k6.CAPIClientImpl=ANr=sCc([V3i(0,cCc.IFetcherService),V3i(1,aCc.IEnvService)],ANr)});var Y3i=I(P6=>{"use strict";p();var uCc=P6&&P6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},yNr=P6&&P6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(P6,"__esModule",{value:!0});P6.DomainService=void 0;var dCc=Sc(),fCc=ko(),pCc=_H(),QAe=Il(),hCc=PE(),z3i="github-enterprise.uri",ENr=class extends fCc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new dCc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${QAe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(z3i))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(QAe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(QAe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(QAe.ConfigKey.Shared.AuthProvider)===QAe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(z3i):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};P6.DomainService=ENr;P6.DomainService=ENr=uCc([yNr(0,QAe.IConfigurationService),yNr(1,pCc.ICopilotTokenStore),yNr(2,hCc.ICAPIClientService)],ENr)});var K3i=I(qAe=>{"use strict";p();Object.defineProperty(qAe,"__esModule",{value:!0});qAe.NullNativeEnvService=qAe.NullEnvService=void 0;var mCc=Sc(),gCc=Ku(),DCt=a4(),ACc=wMe(),NCt=class t extends DCt.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return mCc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return DCt.OperatingSystem.Linux}getEditorInfo(){return new DCt.NameAndVersion("simulation-tests-editor",ACc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new DCt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};qAe.NullEnvService=NCt;var _Nr=class extends NCt{static{a(this,"NullNativeEnvService")}get userHome(){return gCc.URI.file("/home/testuser")}};qAe.NullNativeEnvService=_Nr});var CNr=I(MCt=>{"use strict";p();Object.defineProperty(MCt,"__esModule",{value:!0});MCt.IGitExtensionService=void 0;var yCc=rn();MCt.IGitExtensionService=(0,yCc.createServiceIdentifier)("IGitExtensionService")});var J3i=I(OCt=>{"use strict";p();Object.defineProperty(OCt,"__esModule",{value:!0});OCt.NullGitExtensionService=void 0;var ECc=Sc(),vNr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=ECc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};OCt.NullGitExtensionService=vNr});var Z3i=I(D6=>{"use strict";p();var _Cc=D6&&D6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},CCc=D6&&D6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(D6,"__esModule",{value:!0});D6.ObservableGit=void 0;var vCc=ko(),F$=y2(),bCc=CNr(),bNr=class extends vCc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,F$.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,F$.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,F$.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,F$.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,F$.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,F$.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,F$.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,F$.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};D6.ObservableGit=bNr;D6.ObservableGit=bNr=_Cc([CCc(0,bCc.IGitExtensionService)],bNr)});var LCt=I(Dl=>{"use strict";p();Object.defineProperty(Dl,"__esModule",{value:!0});Dl.lengthZero=void 0;Dl.lengthDiff=ICc;Dl.lengthIsZero=xCc;Dl.toLength=Xre;Dl.lengthToObj=wCc;Dl.lengthGetLineCount=RCc;Dl.lengthGetColumnCountIfZeroLineCount=kCc;Dl.lengthAdd=eFi;Dl.sumLengths=PCc;Dl.lengthEquals=DCc;Dl.lengthDiffNonNegative=NCc;Dl.lengthLessThan=MCc;Dl.lengthLessThanEqual=OCc;Dl.lengthGreaterThanEqual=BCc;Dl.lengthToPosition=LCc;Dl.positionToLength=FCc;Dl.lengthsToRange=UCc;Dl.lengthOfRange=QCc;Dl.lengthCompare=qCc;Dl.lengthOfString=jCc;Dl.lengthOfStringObj=HCc;Dl.lengthHash=GCc;Dl.lengthMax=$Cc;var X3i=Gh(),SCc=I_(),TCc=qp(),BCt=Zpe();function ICc(t,e,r,n){return t!==r?Xre(r-t,n):Xre(0,n-e)}a(ICc,"lengthDiff");Dl.lengthZero=0;function xCc(t){return t===0}a(xCc,"lengthIsZero");var LE=2**26;function Xre(t,e){return t*LE+e}a(Xre,"toLength");function wCc(t){let e=t,r=Math.floor(e/LE),n=e-r*LE;return new BCt.TextLength(r,n)}a(wCc,"lengthToObj");function RCc(t){return Math.floor(t/LE)}a(RCc,"lengthGetLineCount");function kCc(t){return t}a(kCc,"lengthGetColumnCountIfZeroLineCount");function eFi(t,e){let r=t+e;return e>=LE&&(r=r-t%LE),r}a(eFi,"lengthAdd");function PCc(t,e){return t.reduce((r,n)=>eFi(r,e(n)),Dl.lengthZero)}a(PCc,"sumLengths");function DCc(t,e){return t===e}a(DCc,"lengthEquals");function NCc(t,e){let r=t,n=e;if(n-r<=0)return Dl.lengthZero;let s=Math.floor(r/LE),c=Math.floor(n/LE),l=n-c*LE;if(s===c){let u=r-s*LE;return Xre(0,l-u)}else return Xre(c-s,l)}a(NCc,"lengthDiffNonNegative");function MCc(t,e){return t=e}a(BCc,"lengthGreaterThanEqual");function LCc(t){let e=t,r=Math.floor(e/LE),n=e-r*LE;return new SCc.Position(r+1,n+1)}a(LCc,"lengthToPosition");function FCc(t){return Xre(t.lineNumber-1,t.column-1)}a(FCc,"positionToLength");function UCc(t,e){let r=t,n=Math.floor(r/LE),o=r-n*LE,s=e,c=Math.floor(s/LE),l=s-c*LE;return new TCc.Range(n+1,o+1,c+1,l+1)}a(UCc,"lengthsToRange");function QCc(t){return t.startLineNumber===t.endLineNumber?new BCt.TextLength(0,t.endColumn-t.startColumn):new BCt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(QCc,"lengthOfRange");function qCc(t,e){return t-e}a(qCc,"lengthCompare");function jCc(t){let e=(0,X3i.splitLines)(t);return Xre(e.length-1,e[e.length-1].length)}a(jCc,"lengthOfString");function HCc(t){let e=(0,X3i.splitLines)(t);return new BCt.TextLength(e.length-1,e[e.length-1].length)}a(HCc,"lengthOfStringObj");function GCc(t){return t}a(GCc,"lengthHash");function $Cc(t,e){return t>e?t:e}a($Cc,"lengthMax")});var INr=I(FCt=>{"use strict";p();Object.defineProperty(FCt,"__esModule",{value:!0});FCt.TextEditInfo=void 0;var SNr=LCt(),TNr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,SNr.lengthToObj)(this.startOffset)}...${(0,SNr.lengthToObj)(this.endOffset)}) -> ${(0,SNr.lengthToObj)(this.newLength)}`}};FCt.TextEditInfo=TNr});var rFi=I(xNr=>{"use strict";p();Object.defineProperty(xNr,"__esModule",{value:!0});xNr.combineTextEditInfos=zCc;var VCc=El(),ym=LCt(),WCc=INr();function zCc(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new VCc.ArrayQueue(tFi(t)),n=tFi(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,ym.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,ym.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,ym.lengthIsZero)(d)||f.push(new fBe(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,ym.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new WCc.TextEditInfo(m.startOffset,f,(0,ym.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=ym.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,ym.sumLengths)(f,g=>g.lengthBefore),m=(0,ym.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,ym.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(zCc,"combineTextEditInfos");var fBe=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,ym.lengthDiffNonNegative)(e,this.lengthAfter);return(0,ym.lengthEquals)(r,ym.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,ym.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,ym.lengthToObj)(this.lengthBefore)} -> ${(0,ym.lengthToObj)(this.lengthAfter)}`}};function tFi(t){let e=[],r=ym.lengthZero;for(let n of t){let o=(0,ym.lengthDiffNonNegative)(r,n.startOffset);(0,ym.lengthIsZero)(o)||e.push(new fBe(!1,o,o));let s=(0,ym.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new fBe(!0,s,n.newLength)),r=n.endOffset}return e}a(tFi,"toLengthMapping")});var iFi=I(jAe=>{"use strict";p();Object.defineProperty(jAe,"__esModule",{value:!0});jAe.SingleTextEditLength=jAe.TextLengthEdit=void 0;var YCc=qp(),nFi=Zpe(),KCc=rFi(),pBe=LCt(),JCc=INr(),wNr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new hBe(n.range,nFi.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,pBe.lengthToObj)(n.newLength);return new hBe((0,pBe.lengthsToRange)(n.startOffset,n.endOffset),new nFi.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new JCc.TextEditInfo((0,pBe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,pBe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,pBe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,KCc.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return YCc.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};jAe.TextLengthEdit=wNr;var hBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};jAe.SingleTextEditLength=hBe});var oFi=I(HAe=>{"use strict";p();Object.defineProperty(HAe,"__esModule",{value:!0});HAe.DocumentHistory=HAe.HistoryContext=void 0;var ZCc=Yu(),XCc=kD(),RNr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,ZCc.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};HAe.HistoryContext=RNr;var kNr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new XCc.RootedEdit(this.base,this.lastEdits.compose())}};HAe.DocumentHistory=kNr});var dFi=I(GAe=>{"use strict";p();Object.defineProperty(GAe,"__esModule",{value:!0});GAe.NesHistoryContextProvider=void 0;GAe.sum=gBe;GAe.editExtends=uFi;var sFi=ko(),aFi=y2(),evc=BS(),mBe=gE(),tvc=MMe(),rvc=CT(),UCt=kD(),nvc=byt(),cFi=iFi(),ivc=B5(),ABe=qDe(),lFi=oFi(),PNr=class extends sFi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new NNr(50),this._register((0,aFi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,ABe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,aFi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new DNr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,ivc.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,sFi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new lFi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,ABe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};GAe.NesHistoryContextProvider=PNr;var DNr=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new rvc.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=tvc.TextEdit.fromStringEdit(e,this._currentValue),o=cFi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return gBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&uFi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,ABe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,ABe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new UCt.Edits(mBe.StringEdit,this._edits.map(o=>o.edit));return{history:new lFi.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=mBe.StringEdit.empty,o=cFi.TextLengthEdit.empty,s,c=0,l=mBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,ABe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,evc.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=gBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||gBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||gBe(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=mBe.StringEdit.trySwap(u.edit,l);if(b)l=b.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),E=UCt.RootedEdit.toLineEdit(new UCt.RootedEdit(r,y)),v=new nvc.RootedLineEdit(r,E).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new UCt.Edits(mBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function gBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(gBe,"sum");function uFi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>ovc(n.replaceRange,r))}a(uFi,"editExtends");function ovc(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(ovc,"doesTouch");var NNr=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var hFi=I(HD=>{"use strict";p();var svc=HD&&HD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},fFi=HD&&HD.__param||function(t,e){return function(r,n){e(r,n,t)}},ONr;Object.defineProperty(HD,"__esModule",{value:!0});HD.NesXtabHistoryTracker=HD.XtabEditMergeStrategy=void 0;var BNr=Yu(),avc=ko(),cvc=Ele(),lvc=y2(),uvc=HF(),qCt=Il(),dvc=gp(),QCt=kD(),N6=Oyr(),fvc=B5(),MNr=qDe(),LNr;(function(t){t.sameStartLine={kind:N6.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:N6.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:N6.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case N6.DiffHistoryMergeStrategy.Proximity:return e(s);case N6.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case N6.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,BNr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(LNr||(HD.XtabEditMergeStrategy=LNr={}));function pFi(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(pFi,"areLineEditsWithinProximity");var FNr=class extends avc.Disposable{static{a(this,"NesXtabHistoryTracker")}static{ONr=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new cvc.LinkedList,this.maxHistorySize=r??ONr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,uvc.derived)(s=>LNr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(qCt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,lvc.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,fvc.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,MNr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case N6.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case N6.DiffHistoryMergeStrategy.Proximity:return pFi(r,e,o.lineGap);case N6.DiffHistoryMergeStrategy.Hybrid:return(0,MNr.now)()-n<=o.splitAfterMs&&pFi(r,e,o.lineGap)}}handleEdits(e,r){(0,BNr.assert)(r.previous!==void 0,"Document has previous version"),(0,BNr.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new QCt.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=QCt.RootedEdit.toLineEdit(l),d=QCt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new QCt.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,MNr.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};HD.NesXtabHistoryTracker=FNr;HD.NesXtabHistoryTracker=FNr=ONr=svc([fFi(2,qCt.IConfigurationService),fFi(3,dvc.IExperimentationService)],FNr)});var mFi=I(jCt=>{"use strict";p();Object.defineProperty(jCt,"__esModule",{value:!0});jCt.IVSCodeExtensionContext=void 0;var pvc=rn();jCt.IVSCodeExtensionContext=(0,pvc.createServiceIdentifier)("IVSCodeExtensionContext")});var bFi=I($D=>{"use strict";p();var EFi=$D&&$D.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},U$=$D&&$D.__param||function(t,e){return function(r,n){e(r,n,t)}},EBe;Object.defineProperty($D,"__esModule",{value:!0});$D.UndesiredModels=$D.InlineEditsModelService=void 0;var hvc=kDr(),_Fi=fDr(),gFi=L_(),mvc=El(),AFi=Yu(),CFi=Sc(),vFi=ko(),$Ae=y2(),gvc=_H(),GD=Il(),Avc=mFi(),yvc=pp(),Evc=iCt(),_vc=gp(),Cvc=o0(),yBe=WA(),vvc=h_t(),QNr=class extends vFi.Disposable{static{a(this,"InlineEditsModelService")}static{EBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:yBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:yBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:yBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,$Ae.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,$Ae.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(GD.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(GD.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,$Ae.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new _Fi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,$Ae.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,$Ae.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,$Ae.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=CFi.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(GD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(GD.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(GD.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,GD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,hvc.filterMap)(r,f=>{if((0,yBe.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,mvc.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return UNr(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return UNr(r[0])}return UNr(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,AFi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,GD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?EBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?EBe.COPILOT_NES_CALLISTO:EBe.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,AFi.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=yBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=gFi.ErrorUtils.toString(gFi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};$D.InlineEditsModelService=QNr;$D.InlineEditsModelService=QNr=EBe=EFi([U$(0,gvc.ICopilotTokenStore),U$(1,Evc.IProxyModelsService),U$(2,vvc.IUndesiredModelsManager),U$(3,GD.IConfigurationService),U$(4,_vc.IExperimentationService),U$(5,Cvc.ITelemetryService),U$(6,yvc.ILogService)],QNr);function UNr(t){let{source:e,...r}=t;return r}a(UNr,"toModelConfiguration");var yFi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends vFi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new CFi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new _Fi.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=EFi([U$(0,Avc.IVSCodeExtensionContext)],r),t.Manager=r})(yFi||($D.UndesiredModels=yFi={}))});var SFi=I(HCt=>{"use strict";p();Object.defineProperty(HCt,"__esModule",{value:!0});HCt.NullLanguageContextProviderService=void 0;var bvc=ko(),qNr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return bvc.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};HCt.NullLanguageContextProviderService=qNr});var TFi=I(GCt=>{"use strict";p();Object.defineProperty(GCt,"__esModule",{value:!0});GCt.TestLanguageDiagnosticsService=void 0;var Svc=Sc(),Tvc=bP(),Ivc=$G(),jNr=class extends Ivc.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new Tvc.ResourceMap,this._onDidChangeDiagnostics=new Svc.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};GCt.TestLanguageDiagnosticsService=jNr});var IFi=I(VCt=>{"use strict";p();Object.defineProperty(VCt,"__esModule",{value:!0});VCt.ResponseStream=void 0;var xvc=L_(),$Ct=Gx(),wvc=Xc(),Rvc=BS(),HNr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new wvc.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return $Ct.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return $Ct.Result.error(l)}}),this.stream=kvc(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,Rvc.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};VCt.ResponseStream=HNr;async function*kvc(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=xvc.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?$Ct.Result.error(n):$Ct.Result.ok(r))}}a(kvc,"streamWithAggregation")});var xFi=I(GNr=>{"use strict";p();Object.defineProperty(GNr,"__esModule",{value:!0});GNr.jsonlStreamToCompletions=Pvc;async function*Pvc(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(Pvc,"jsonlStreamToCompletions")});var RFi=I(M6=>{"use strict";p();var Dvc=M6&&M6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},$Nr=M6&&M6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(M6,"__esModule",{value:!0});M6.CompletionsFetchService=void 0;var Nvc=pDr(),wFi=L_(),ene=Gx(),Mvc=Cpr(),Ovc=SE(),Bvc=f6(),Lvc=ey(),Fvc=Lge(),Q$=ayt(),Uvc=IFi(),Qvc=xFi(),VNr=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=ene.Result.error(new Q$.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=Nvc.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,Qvc.jsonlStreamToCompletions)(f),m=new Uvc.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=ene.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new Q$.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>jvc(d.val.body).catch(()=>"")),h=ene.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),ene.Result.error(new Q$.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=qvc(u,s);return ene.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,Bvc.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return ene.Result.error(new Q$.Completions.RequestCancelled);let l=wFi.ErrorUtils.fromUnknown(c);return ene.Result.error(new Q$.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof Q$.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof Q$.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof Q$.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:Mvc.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` -`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};M6.CompletionsFetchService=VNr;M6.CompletionsFetchService=VNr=Dvc([$Nr(0,Ovc.IAuthenticationService),$Nr(1,Lvc.IFetcherService),$Nr(2,Fvc.IRequestLogger)],VNr);async function*qvc(t,e){try{for await(let r of t)yield r}catch(r){throw wFi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(qvc,"streamWithCleanup");async function jvc(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(jvc,"collectAsyncIterableToString")});var PFi=I(WCt=>{"use strict";p();Object.defineProperty(WCt,"__esModule",{value:!0});WCt.WireTypes=void 0;var q$=KH(),kFi;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,q$.vObj)({promptStrategy:(0,q$.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,q$.vObj)({serviceType:(0,q$.vString)(),name:(0,q$.vString)(),provider:(0,q$.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,q$.vObj)({models:(0,q$.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(kFi||(WCt.WireTypes=kFi={}))});var NFi=I(O6=>{"use strict";p();var Hvc=O6&&O6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},zCt=O6&&O6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(O6,"__esModule",{value:!0});O6.ProxyModelsService=void 0;var Gvc=require("util"),WNr=L_(),$vc=SP(),Vvc=Sc(),Wvc=ko(),DFi=y2(),zvc=_H(),Yvc=PE(),Kvc=PFi(),Jvc=pp(),Zvc=ey(),zNr=class extends Wvc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new Vvc.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,DFi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,DFi.autorun)(c=>{let l=s.read(c),u=new $vc.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,Gvc.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=WNr.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=WNr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=Kvc.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=WNr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};O6.ProxyModelsService=zNr;O6.ProxyModelsService=zNr=Hvc([zCt(0,zvc.ICopilotTokenStore),zCt(1,Yvc.ICAPIClientService),zCt(2,Zvc.IFetcherService),zCt(3,Jvc.ILogService)],zNr)});var MFi=I(YCt=>{"use strict";p();Object.defineProperty(YCt,"__esModule",{value:!0});YCt.NullRequestLogger=void 0;var Xvc=e2r(),ebc=Sc(),YNr=class extends Xvc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=ebc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};YCt.NullRequestLogger=YNr});var uMr=I(fd=>{"use strict";p();var iMr=fd&&fd.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},VD=fd&&fd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fd,"__esModule",{value:!0});fd.SimpleExperimentationService=fd.LogLevel=fd.ILanguageContextProviderService=fd.IIgnoreService=fd.IExperimentationService=fd.IEndpointProvider=fd.ICAPIClientService=fd.IAuthenticationService=void 0;fd.createNESProvider=Wbc;fd.createInlineCompletionsProvider=Ybc;var tbc=Nti(),OFi=See(),BFi=bvi(),LFi=pme(),rbc=l0t(),FFi=Ovr(),nbc=Bvr(),PC=vE(),UFi=jvr(),ibc=nxi(),obc=VA(),QFi=Sbr(),sbc=bG(),qFi=kbr(),jFi=UOe(),HFi=Kbr(),GFi=Zbr(),$Fi=hwr(),JNr=Jmt(),abc=UNi(),cbc=QNi(),_Be=xl(),lbc=Sge(),ubc=Uvr(),VFi=Wwr(),WFi=nbr(),zFi=iyt(),YFi=KIr(),KFi=jgt(),CBe=qgt(),JFi=qG(),ZFi=tAt(),dbc=GNi(),fbc=Zgt(),XFi=nEr(),e8i=zb(),t8i=QMe(),r8i=tre(),pbc=nMi(),hbc=tOi(),ZNr=vOi(),n8i=Skr(),mbc=oBi(),i8i=h2r(),gbc=v3i(),oMr=SE();Object.defineProperty(fd,"IAuthenticationService",{enumerable:!0,get:a(function(){return oMr.IAuthenticationService},"get")});var Abc=UMe(),o8i=_H(),ybc=b3i(),Ebc=B3i(),_bc=A6(),Cbc=xkr(),vbc=L3i(),bbc=wkr(),s8i=kkr(),Z4=Il(),Sbc=U3i(),Tbc=m2r(),Ibc=$3i(),sMr=PE();Object.defineProperty(fd,"ICAPIClientService",{enumerable:!0,get:a(function(){return sMr.ICAPIClientService},"get")});var xbc=g$(),aMr=IOe();Object.defineProperty(fd,"IEndpointProvider",{enumerable:!0,get:a(function(){return aMr.IEndpointProvider},"get")});var p8i=W3i(),wbc=Y3i(),tne=a4(),Rbc=K3i(),kbc=CNr(),h8i=J3i(),vBe=Bte();Object.defineProperty(fd,"IIgnoreService",{enumerable:!0,get:a(function(){return vBe.IIgnoreService},"get")});var Pbc=Hre(),Dbc=Kut(),KNr=h_t(),Nbc=Z3i(),Mbc=dFi(),Obc=hFi(),Bbc=bFi(),cMr=Fgt();Object.defineProperty(fd,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return cMr.ILanguageContextProviderService},"get")});var m8i=SFi(),g8i=$G(),A8i=TFi(),WD=pp(),Lbc=ayt(),Fbc=RFi(),lMr=ey(),a8i=_6(),Ubc=YPr(),Qbc=KPr(),qbc=r_t(),jbc=iCt(),Hbc=NFi(),y8i=Lge(),E8i=MFi(),c8i=S2r(),l8i=wRr(),SBe=gp();Object.defineProperty(fd,"IExperimentationService",{enumerable:!0,get:a(function(){return SBe.IExperimentationService},"get")});var _8i=o0(),u8i=Xge(),Gbc=Cyr(),d8i=K_t(),f8i=Ure(),XNr=cDr(),C8i=rn(),$bc=SP(),bBe=Sc(),XCt=ko(),Vbc=um(),hi=qut(),v8i=Qs(),rne;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(rne||(fd.LogLevel=rne={}));function Wbc(t){return zbc(t).createInstance(eMr,t)}a(Wbc,"createNESProvider");var eMr=class extends XCt.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(gbc.XtabProvider),l=r.createInstance(Nbc.ObservableGit),u=new Mbc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig(Z4.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new Obc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new pbc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(hbc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(ZNr.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=Pbc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Vbc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Dbc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new ZNr.NextEditProviderTelemetryBuilder(new h8i.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof nne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Z4.globalConfigRegistry.configs.get(`${Z4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};eMr=iMr([VD(1,v8i.IInstantiationService),VD(2,SBe.IExperimentationService),VD(3,Z4.IConfigurationService),VD(4,XNr.IWorkspaceService)],eMr);function zbc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new C8i.InstantiationServiceBuilder;s.define(Z4.IConfigurationService,new hi.SyncDescriptor(KCt,[t.configOverrides??new Map])),s.define(SBe.IExperimentationService,new hi.SyncDescriptor(nne,[t.waitForTreatmentVariables])),s.define(c8i.ISimulationTestContext,new hi.SyncDescriptor(c8i.NulSimulationTestContext)),s.define(XNr.IWorkspaceService,new hi.SyncDescriptor(XNr.NullWorkspaceService)),s.define(Tbc.IDiffService,new hi.SyncDescriptor(Ibc.DiffServiceImpl,[!1])),s.define(WD.ILogService,new hi.SyncDescriptor(WD.LogServiceImpl,[[o||new WD.ConsoleLog(void 0,WD.LogLevel.Trace)]])),s.define(kbc.IGitExtensionService,new hi.SyncDescriptor(h8i.NullGitExtensionService)),s.define(cMr.ILanguageContextProviderService,new hi.SyncDescriptor(m8i.NullLanguageContextProviderService)),s.define(g8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(A8i.TestLanguageDiagnosticsService)),s.define(vBe.IIgnoreService,new hi.SyncDescriptor(vBe.NullIgnoreService)),s.define(l8i.ISnippyService,new hi.SyncDescriptor(l8i.NullSnippyService)),s.define(xbc.IDomainService,new hi.SyncDescriptor(wbc.DomainService)),s.define(sMr.ICAPIClientService,new hi.SyncDescriptor(p8i.CAPIClientImpl)),s.define(o8i.ICopilotTokenStore,new hi.SyncDescriptor(o8i.CopilotTokenStore)),s.define(tne.IEnvService,new hi.SyncDescriptor(Rbc.NullEnvService)),s.define(lMr.IFetcherService,new hi.SyncDescriptor(JCt,[e])),s.define(_8i.ITelemetryService,new hi.SyncDescriptor(ZCt,[n])),s.define(oMr.IAuthenticationService,new hi.SyncDescriptor(ybc.StaticGitHubAuthenticationService,[(0,Ebc.createStaticGitHubTokenProvider)()])),s.define(Abc.ICopilotTokenManager,r),s.define(n8i.IPowerService,new hi.SyncDescriptor(n8i.NullPowerService)),s.define(_bc.IChatMLFetcher,new hi.SyncDescriptor(mbc.ChatMLFetcherImpl)),s.define(a8i.IChatWebSocketManager,new hi.SyncDescriptor(a8i.NullChatWebSocketManager)),s.define(qbc.IOTelService,new Ubc.NoopOTelService((0,Qbc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(Cbc.IChatQuotaService,new hi.SyncDescriptor(vbc.ChatQuotaService)),s.define(s8i.IInteractionService,new hi.SyncDescriptor(s8i.InteractionService)),s.define(y8i.IRequestLogger,new hi.SyncDescriptor(E8i.NullRequestLogger)),s.define(f8i.ITokenizerProvider,new hi.SyncDescriptor(f8i.TokenizerProvider,[!1])),s.define(bbc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(jbc.IProxyModelsService,new hi.SyncDescriptor(Hbc.ProxyModelsService)),s.define(KNr.IInlineEditsModelService,new hi.SyncDescriptor(Bbc.InlineEditsModelService)),s.define(KNr.IUndesiredModelsManager,t.undesiredModelsManager||new hi.SyncDescriptor(KNr.NullUndesiredModelsManager)),s.define(d8i.ITerminalService,t.terminalService||new hi.SyncDescriptor(d8i.NullTerminalService)),s.define(i8i.ISimilarFilesContextService,new hi.SyncDescriptor(i8i.NullSimilarFilesContextService)),s.define(aMr.IEndpointProvider,new tMr);let c=new PC.InMemoryConfigProvider(new PC.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(PC.ICompletionsConfigProvider,c),s.seal()}a(zbc,"setupServices");var KCt=class extends Sbc.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},tMr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=bBe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},nne=class extends XCt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new bBe.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};fd.SimpleExperimentationService=nne;fd.SimpleExperimentationService=nne=iMr([VD(1,Z4.IConfigurationService)],nne);var JCt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=bBe.Event.None,this.onDidCompleteFetch=bBe.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new lMr.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},ZCt=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,u8i.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,u8i.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function Ybc(t){return Kbc(t).createInstance(rMr)}a(Ybc,"createInlineCompletionsProvider");var rMr=class extends XCt.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(abc.GhostText)}updateTreatmentVariables(e){this._expService instanceof nne&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=Z4.globalConfigRegistry.configs.get(`${Z4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof PC.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new ZNr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??$bc.CancellationToken.None,o,new tbc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};rMr=iMr([VD(0,v8i.IInstantiationService),VD(1,SBe.IExperimentationService),VD(2,JNr.ICompletionsSpeculativeRequestCache),VD(3,WD.ILogService),VD(4,Z4.IConfigurationService),VD(5,PC.ICompletionsConfigProvider)],rMr);var nMr=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,Gbc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function Kbc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new WD.ConsoleLog(void 0,WD.LogLevel.Trace),f=new C8i.InstantiationServiceBuilder;f.define(_Be.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case _Be.LogLevel.DEBUG:return rne.Debug;case _Be.LogLevel.INFO:return rne.Info;case _Be.LogLevel.WARN:return rne.Warning;case _Be.LogLevel.ERROR:return rne.Error;default:return rne.Info}}}),f.define(oMr.IAuthenticationService,r),f.define(WD.ILogService,new hi.SyncDescriptor(WD.LogServiceImpl,[[d||new WD.ConsoleLog(void 0,WD.LogLevel.Trace)]])),f.define(vBe.IIgnoreService,t.ignoreService||new vBe.NullIgnoreService),f.define(_8i.ITelemetryService,new hi.SyncDescriptor(ZCt,[new nMr(c)])),f.define(Z4.IConfigurationService,new hi.SyncDescriptor(KCt,[t.configOverrides??new Map])),f.define(SBe.IExperimentationService,new hi.SyncDescriptor(nne,[t.waitForTreatmentVariables])),f.define(aMr.IEndpointProvider,t.endpointProvider),f.define(sMr.ICAPIClientService,t.capiClientService||new hi.SyncDescriptor(p8i.CAPIClientImpl)),f.define(lMr.IFetcherService,new hi.SyncDescriptor(JCt,[e])),f.define(OFi.ICompletionsTelemetryService,new hi.SyncDescriptor(OFi.CompletionsTelemetryServiceBridge)),f.define(r8i.ICompletionsRuntimeModeService,r8i.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(jFi.ICompletionsCacheService,new jFi.CompletionsCache);let h=new PC.InMemoryConfigProvider(new PC.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(PC.ICompletionsConfigProvider,h),f.define($Fi.ICompletionsLastGhostText,new $Fi.LastGhostText),f.define(GFi.ICompletionsCurrentGhostText,new GFi.CurrentGhostText),f.define(JNr.ICompletionsSpeculativeRequestCache,new JNr.SpeculativeRequestCache),f.define(ubc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(PC.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(BFi.ICompletionsExtensionStatus,new BFi.CopilotExtensionStatus),f.define(obc.ICompletionsFeaturesService,new hi.SyncDescriptor(ibc.Features)),f.define(nbc.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(zFi.ICompletionsStatusReporter,new class extends zFi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(LFi.ICompletionsCopilotTokenManager,new hi.SyncDescriptor(LFi.CopilotTokenManagerImpl,[!1])),f.define(e8i.ICompletionsTextDocumentManagerService,new hi.SyncDescriptor(class extends e8i.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(QFi.ICompletionsFileReaderService,new hi.SyncDescriptor(QFi.FileReader)),f.define(HFi.ICompletionsBlockModeConfig,new hi.SyncDescriptor(HFi.ConfigBlockModeConfig)),f.define(XFi.ICompletionsTelemetryUserConfigService,new hi.SyncDescriptor(XFi.TelemetryUserConfig)),f.define(ZFi.ICompletionsRecentEditsProviderService,new hi.SyncDescriptor(ZFi.FullRecentEditsProvider,[void 0])),f.define(FFi.ICompletionsNotifierService,new hi.SyncDescriptor(FFi.CompletionNotifier)),f.define(VFi.ICompletionsOpenAIFetcherService,new hi.SyncDescriptor(VFi.LiveOpenAIFetcher)),f.define(Lbc.ICompletionsFetchService,new hi.SyncDescriptor(Fbc.CompletionsFetchService)),f.define(WFi.ICompletionsModelManagerService,new hi.SyncDescriptor(WFi.AvailableModelsManager,[!0])),f.define(qFi.ICompletionsAsyncManagerService,new hi.SyncDescriptor(qFi.AsyncCompletionManager)),f.define(KFi.ICompletionsContextProviderBridgeService,new hi.SyncDescriptor(KFi.ContextProviderBridge)),f.define(UFi.ICompletionsUserErrorNotifierService,new hi.SyncDescriptor(UFi.UserErrorNotifier)),f.define(fbc.ICompletionsRelatedFilesProviderService,new hi.SyncDescriptor(dbc.CompositeRelatedFilesProvider)),f.define(sbc.ICompletionsFileSystemService,new cbc.LocalFileSystem),f.define(CBe.ICompletionsContextProviderRegistryService,new hi.SyncDescriptor(CBe.CachedContextProviderRegistry,[CBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(t8i.ICompletionsPromiseQueueService,new t8i.PromiseQueue),f.define(rbc.ICompletionsCitationManager,new class{register(){return XCt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define(JFi.ICompletionsContextProviderService,new JFi.ContextProviderStatistics),f.define(YFi.ICompletionsPromptFactoryService,new hi.SyncDescriptor(YFi.CompletionsPromptFactory)),f.define(lbc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(CBe.ICompletionsDefaultContextProviders,new CBe.DefaultContextProvidersContainer),f.define(tne.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=bBe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?tne.OperatingSystem.Macintosh:process.platform==="win32"?tne.OperatingSystem.Windows:tne.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return PC.BuildInfo.isProduction()}isPreRelease(){return PC.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return PC.BuildInfo.getBuildType()===PC.BuildType.DEV?"dev":"prod"}getVersion(){return PC.BuildInfo.getVersion()}getBuild(){return PC.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new tne.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new tne.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(cMr.ILanguageContextProviderService,t.languageContextProvider??new m8i.NullLanguageContextProviderService),f.define(g8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(A8i.TestLanguageDiagnosticsService)),f.define(y8i.IRequestLogger,new hi.SyncDescriptor(E8i.NullRequestLogger)),f.seal()}a(Kbc,"setupCompletionServices")});function Lt(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function ye(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var l1=me(()=>{p();a(Lt,"__classPrivateFieldSet");a(ye,"__classPrivateFieldGet")});var ZAe,dvt=me(()=>{p();ZAe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return ZAe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function Q6(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var NBe,XAe=me(()=>{p();a(Q6,"isAbortError");NBe=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var dr,lh,oy,j$,eye,tye,rye,nye,iye,oye,sye,aye,cye,wf=me(()=>{p();XAe();dr=class extends Error{static{a(this,"AnthropicError")}},lh=class t extends dr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new j$({message:n,cause:NBe(r)});let s=r,c=s?.error?.type;return e===400?new tye(e,s,n,o,c):e===401?new rye(e,s,n,o,c):e===403?new nye(e,s,n,o,c):e===404?new iye(e,s,n,o,c):e===409?new oye(e,s,n,o,c):e===422?new sye(e,s,n,o,c):e===429?new aye(e,s,n,o,c):e>=500?new cye(e,s,n,o,c):new t(e,s,n,o,c)}},oy=class extends lh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},j$=class extends lh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},eye=class extends j${static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},tye=class extends lh{static{a(this,"BadRequestError")}},rye=class extends lh{static{a(this,"AuthenticationError")}},nye=class extends lh{static{a(this,"PermissionDeniedError")}},iye=class extends lh{static{a(this,"NotFoundError")}},oye=class extends lh{static{a(this,"ConflictError")}},sye=class extends lh{static{a(this,"UnprocessableEntityError")}},aye=class extends lh{static{a(this,"RateLimitError")}},cye=class extends lh{static{a(this,"InternalServerError")}}});function fvt(t){return typeof t!="object"?{}:t??{}}function HMr(t){if(!t)return!0;for(let e in t)return!1;return!0}function R6i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var LSc,w6i,FE,jMr,k6i,pvt,X4=me(()=>{p();wf();LSc=/^[a-z][a-z0-9+.-]*:/i,w6i=a(t=>LSc.test(t),"isAbsoluteURL"),FE=a(t=>(FE=Array.isArray,FE(t)),"isArray"),jMr=FE;a(fvt,"maybeObj");a(HMr,"isEmptyObj");a(R6i,"hasOwn");k6i=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new dr(`${t} must be an integer`);if(e<0)throw new dr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),pvt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var YD,lye=me(()=>{p();YD=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var kR,MBe=me(()=>{p();kR="0.98.0"});function FSc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function QSc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var M6i,USc,P6i,D6i,N6i,OBe,hvt=me(()=>{p();MBe();M6i=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a(FSc,"getDetectedPlatform");USc=a(()=>{let t=FSc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":D6i(Deno.build.os),"X-Stainless-Arch":P6i(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":D6i(globalThis.process.platform??"unknown"),"X-Stainless-Arch":P6i(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=QSc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":kR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(QSc,"getBrowserInfo");P6i=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),D6i=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),OBe=a(()=>N6i??(N6i=USc()),"getPlatformHeaders")});function O6i(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function GMr(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function mvt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return GMr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function BBe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function B6i(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var uye=me(()=>{p();a(O6i,"getDefaultFetch");a(GMr,"makeReadableStream");a(mvt,"ReadableStreamFrom");a(BBe,"ReadableStreamToAsyncIterable");a(B6i,"CancelReadableStream")});var L6i,F6i=me(()=>{p();L6i=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var $Mr,VMr,WMr,U6i,zMr=me(()=>{p();$Mr="RFC3986",VMr=a(t=>String(t),"default_formatter"),WMr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:VMr},U6i="RFC1738"});function q6i(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function KMr(t,e){if(FE(t)){let r=[];for(let n=0;n{p();zMr();X4();gvt=a((t,e)=>(gvt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),gvt(t,e)),"has"),eB=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),YMr=1024,Q6i=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=YMr?s.slice(l,l+YMr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===U6i&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=eB[h];continue}if(h<2048){d[d.length]=eB[192|h>>6]+eB[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=eB[224|h>>12]+eB[128|h>>6&63]+eB[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=eB[240|h>>18]+eB[128|h>>12&63]+eB[128|h>>6&63]+eB[128|h&63]}c+=d.join("")}return c},"encode");a(q6i,"is_buffer");a(KMr,"maybe_map")});function HSc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function V6i(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(JMr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(JMr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&FE(v)&&(v=KMr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,Em.encoder,E,"key",g):e;v=""}if(HSc(v)||q6i(v)){if(u){let N=y?e:u(e,Em.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,Em.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&FE(v))y&&u&&(v=KMr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(FE(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let k=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&FE(v)&&v.length===1?k+"[]":k;if(o&&FE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:Em.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Em.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Em.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Em.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Em.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Em.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Em.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Em.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Em.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Em.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Em.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Em.strictNullHandling}}function W6i(t,e={}){let r=t,n=GSc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):FE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=G6i[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var G6i,$6i,H6i,Em,JMr,z6i=me(()=>{p();j6i();zMr();X4();G6i={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},$6i=a(function(t,e){Array.prototype.push.apply(t,FE(e)?e:[e])},"push_to_array"),Em={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Q6i,encodeValuesOnly:!1,format:$Mr,formatter:VMr,indices:!1,serializeDate(t){return(H6i??(H6i=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(HSc,"is_non_nullish_primitive");JMr={};a(V6i,"inner_stringify");a(GSc,"normalize_stringify_options");a(W6i,"stringify")});function Y6i(t){return W6i(t,{arrayFormat:"brackets"})}var ZMr=me(()=>{p();z6i();a(Y6i,"stringifyQuery")});function yvt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new $c(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new $c(`Refusing to send credential over non-https token endpoint "${t}"`)}async function Evt(t,e){let r=await WSc(t),n;try{n=JSON.parse(r)}catch{throw new $c(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,u1(r),e)}if(!n.access_token)throw new $c(`Token endpoint response missing access_token: ${JSON.stringify(u1(n))}`,t.status,u1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new $c(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,u1(n),e);return n}function u1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=XMr?t:t.slice(0,XMr)+`... <${t.length-XMr} more chars>`}return JSON.stringify(u1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))VSc.has(r)&&(e[r]=n);return e}return null}async function _vt(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new $c(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new $c(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function Cvt(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function WSc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>K6i){let l=K6i-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var J6i,Z6i,Avt,ine,X6i,e9i,dye,t9i,K6i,XMr,VSc,$c,fye=me(()=>{p();wf();J6i="urn:ietf:params:oauth:grant-type:jwt-bearer",Z6i="refresh_token",Avt="/v1/oauth/token",ine="oauth-2025-04-20",X6i="oidc-federation-2026-04-01",e9i=120,dye=30,t9i=5,K6i=1<<20;a(yvt,"requireSecureTokenEndpoint");a(Evt,"parseTokenResponse");XMr=2e3,VSc=new Set(["error","error_description","error_uri"]);a(u1,"redactSensitive");a(_vt,"checkCredentialsFileSafety");a(Cvt,"writeCredentialsFileAtomic");a(WSc,"readLimitedText");$c=class extends dr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function KD(){return Math.floor(Date.now()/1e3)}var LBe=me(()=>{p();a(KD,"nowAsSeconds")});var vvt,r9i=me(()=>{p();fye();LBe();vvt=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-KD();return n>e9i?r.token:n>dye?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||KD()-this.lastAdvisoryError{this.lastAdvisoryError=KD(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var ya,FBe=me(()=>{p();ya=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function o9i(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function pye(t){let e;return(n9i??(e=new globalThis.TextEncoder,n9i=e.encode.bind(e)))(t)}function eOr(t){let e;return(i9i??(e=new globalThis.TextDecoder,i9i=e.decode.bind(e)))(t)}var n9i,i9i,bvt=me(()=>{p();a(o9i,"concatBytes");a(pye,"encodeUTF8");a(eOr,"decodeUTF8")});var s9i=me(()=>{p();wf();bvt()});function UBe(){}function Svt(t,e,r){return!e||Tvt[t]>Tvt[r]?UBe:e[t].bind(e)}function dl(t){let e=t.logger,r=t.logLevel??"off";if(!e)return zSc;let n=a9i.get(e);if(n&&n[0]===r)return n[1];let o={error:Svt("error",e,r),warn:Svt("warn",e,r),info:Svt("info",e,r),debug:Svt("debug",e,r)};return a9i.set(e,[r,o]),o}var Tvt,tOr,zSc,a9i,q6,j6=me(()=>{p();X4();Tvt={off:0,error:200,warn:300,info:400,debug:500},tOr=a((t,e,r)=>{if(t){if(R6i(Tvt,t))return t;dl(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(Tvt))}`)}},"parseLogLevel");a(UBe,"noop");a(Svt,"makeLogFn");zSc={error:UBe,warn:UBe,info:UBe,debug:UBe},a9i=new WeakMap;a(dl,"loggerFor");q6=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var rOr=me(()=>{p();X4();s9i();FBe();j6();dvt();lye();ZMr()});function c9i(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!YSc.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var Ivt,YSc,l9i,u9i,nOr,KSc,d9i,iOr=me(()=>{p();hvt();rOr();Ivt="1.0",YSc=/^[A-Za-z0-9_.-]+$/;a(c9i,"validateProfileName");l9i=a(async t=>{var e,r;let n=await nOr();if(n===null)return null;let o=t??await d9i();if(o===null)return null;c9i(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=ya("ANTHROPIC_ORGANIZATION_ID"),m=ya("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=ya("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:ya("ANTHROPIC_WORKSPACE_ID"),base_url:ya("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:ya("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:ya("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=ya("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=ya("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=ya("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=ya("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=ya("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=ya("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=ya("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),u9i=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await nOr();if(!r)return null;let n=e??await d9i();return n?(c9i(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),nOr=a(async()=>{if(!KSc())return null;let t=await import("node:path"),e=ya("ANTHROPIC_CONFIG_DIR");if(e)return e;if(OBe()["X-Stainless-OS"]==="Windows"){let s=ya("APPDATA");if(s)return t.join(s,"Anthropic");let c=ya("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=ya("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=ya("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),KSc=a(()=>{let t=OBe()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),d9i=a(async()=>{let t=await nOr();if(!t)return null;let e=ya("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function oOr(t){if(!t)throw new dr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new dr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new dr(`Identity token file at ${t} is empty`);return n}}function f9i(t){if(!t)throw new dr("Identity token value is empty");return()=>t}var p9i=me(()=>{p();wf();a(oOr,"identityTokenFromFile");a(f9i,"identityTokenFromValue")});function h9i(t){return async()=>{yvt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new $c(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:J6i,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${Avt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ine},${X6i}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${kR} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new $c(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=u1(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new $c(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await Evt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new $c(`Token endpoint response missing required fields: ${JSON.stringify(u1(c))}`,o.status,u1(c),s);return{token:c.access_token,expiresAt:KD()+l}}}var m9i=me(()=>{p();fye();LBe();MBe();a(h9i,"oidcFederationProvider")});function g9i(t){return async e=>{let r=await import("node:fs");await _vt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new $c(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new $c(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new $c(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||KD()"");throw new $c(`User OAuth refresh failed (HTTP ${f.status}): ${u1(E)}`,f.status,u1(E),h)}let m=await Evt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new $c(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(u1(m))}`,f.status,u1(m),h);let A=KD()+g,y=m.refresh_token||l;return await Cvt(t.credentialsPath,{...o,version:Ivt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var A9i=me(()=>{p();iOr();fye();LBe();MBe();a(g9i,"userOAuthProvider")});function sOr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=JSc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function y9i(t,e){let r=await l9i(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await u9i(n,e)??void 0}};return sOr(s,t)}function JSc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=ZSc(o);if(!s)throw new $c("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new $c("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new $c("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=h9i({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?XSc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new $c("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return g9i({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new $c(`authentication.type "${o}" is not a known authentication type`)}}}function ZSc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new $c(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new $c('identity_token.source "file" requires a non-empty path');return oOr(t.identity_token.path)}let e=ya("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return oOr(e);let r=ya("ANTHROPIC_IDENTITY_TOKEN");return r?f9i(r):null}function XSc(t,e,r,n){return async o=>{let s=await import("node:fs");await _vt(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||KD(){p();FBe();iOr();fye();LBe();p9i();m9i();A9i();a(sOr,"resolveCredentialsFromConfig");a(y9i,"defaultCredentials");a(JSc,"buildProvider");a(ZSc,"resolveIdentityTokenProvider");a(XSc,"cachedExchangeProvider")});function eTc(t,e){for(let o=e??0;o{p();l1();bvt();H6=class{static{a(this,"LineDecoder")}constructor(){eI.set(this,void 0),tI.set(this,void 0),Lt(this,eI,new Uint8Array,"f"),Lt(this,tI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?pye(e):e;Lt(this,eI,o9i([ye(this,eI,"f"),r]),"f");let n=[],o;for(;(o=eTc(ye(this,eI,"f"),ye(this,tI,"f")))!=null;){if(o.carriage&&ye(this,tI,"f")==null){Lt(this,tI,o.index,"f");continue}if(ye(this,tI,"f")!=null&&(o.index!==ye(this,tI,"f")+1||o.carriage)){n.push(eOr(ye(this,eI,"f").subarray(0,ye(this,tI,"f")-1))),Lt(this,eI,ye(this,eI,"f").subarray(ye(this,tI,"f")),"f"),Lt(this,tI,null,"f");continue}let s=ye(this,tI,"f")!==null?o.preceding-1:o.preceding,c=eOr(ye(this,eI,"f").subarray(0,s));n.push(c),Lt(this,eI,ye(this,eI,"f").subarray(o.index),"f"),Lt(this,tI,null,"f")}return n}flush(){return ye(this,eI,"f").length?this.decode(` -`):[]}};eI=new WeakMap,tI=new WeakMap;H6.NEWLINE_CHARS=new Set([` -`,"\r"]);H6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(eTc,"findNewlineIndex");a(_9i,"findDoubleNewlineIndex")});async function*tTc(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new dr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new dr("Attempted to iterate over a response with no body");let r=new cOr,n=new H6,o=BBe(t.body);for await(let s of rTc(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*rTc(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?pye(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=_9i(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function nTc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var QBe,tB,cOr,lOr=me(()=>{p();l1();wf();uye();aOr();uye();XAe();X4();bvt();j6();wf();tB=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,QBe.set(this,void 0),this.controller=r,Lt(this,QBe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?dl(n):console;async function*c(){if(o)throw new dr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of tTc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=pvt(u.data)??u.data,f=d?.error?.type;throw new lh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(Q6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new H6,u=BBe(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new dr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(Q6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(QBe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,ye(this,QBe,"f")),new t(()=>o(r),this.controller,ye(this,QBe,"f"))]}toReadableStream(){let e=this,r;return GMr({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=pye(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(tTc,"_iterSSEMessages");a(rTc,"iterSSEChunks");cOr=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=nTc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(nTc,"partition")});async function xvt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return dl(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):tB.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return uOr(m,r)}return await r.text()})();return dl(t).debug(`[${n}] response parsed`,q6({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function uOr(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var dOr=me(()=>{p();lOr();j6();a(xvt,"defaultParseResponse");a(uOr,"addRequestID")});var qBe,one,wvt=me(()=>{p();l1();dOr();one=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=xvt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,qBe.set(this,void 0),Lt(this,qBe,e,"f")}_thenUnwrap(e){return new t(ye(this,qBe,"f"),this.responsePromise,async(r,n)=>uOr(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(ye(this,qBe,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};qBe=new WeakMap});var Rvt,kvt,jBe,PR,Ea,pd=me(()=>{p();l1();wf();dOr();wvt();X4();kvt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){Rvt.set(this,void 0),Lt(this,Rvt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new dr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ye(this,Rvt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Rvt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},jBe=class extends one{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await xvt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},PR=class extends kvt{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...fvt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...fvt(this.options.query),after_id:e}}:null}},Ea=class extends kvt{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...fvt(this.options.query),page:e}}:null}}});function sne(t,e,r){return pOr(),new File(t,e??"unknown_file",r)}function HBe(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function oTc(t){let e=typeof t=="function"?t:t.fetch,r=C9i.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return C9i.set(e,n),n}var pOr,hOr,hye,C9i,sTc,aTc,fOr,mye=me(()=>{p();uye();pOr=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(sne,"makeFile");a(HBe,"getName");hOr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),hye=a(async(t,e,r=!0)=>({...t,body:await sTc(t.body,e,r)}),"multipartFormRequestOptions"),C9i=new WeakMap;a(oTc,"supportsFormData");sTc=a(async(t,e,r=!0)=>{if(!await oTc(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>fOr(n,o,s,r))),n},"createForm"),aTc=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),fOr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,sne([await r.blob()],HBe(r,n),o))}else if(hOr(r))t.append(e,sne([await new Response(mvt(r)).blob()],HBe(r,n)));else if(aTc(r))t.append(e,sne([r],HBe(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>fOr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>fOr(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function Pvt(t,e,r){if(pOr(),t=await t,e||(e=HBe(t,!0)),cTc(t))return t instanceof File&&e==null&&r==null?t:sne([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(lTc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),sne(await mOr(o),e,r)}let n=await mOr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return sne(n,e,r)}async function mOr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(v9i(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(hOr(t))for await(let r of t)e.push(...await mOr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${uTc(t)}`)}return e}function uTc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var v9i,cTc,lTc,b9i=me(()=>{p();mye();mye();v9i=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),cTc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&v9i(t),"isFileLike"),lTc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(Pvt,"toFile");a(mOr,"getBytes");a(uTc,"propsForError")});var gOr=me(()=>{p();b9i()});var S9i=me(()=>{p()});var mi,Ml=me(()=>{p();mi=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*fTc(t){if(!t)return;if(T9i in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():jMr(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=jMr(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var T9i,At,Ac=me(()=>{p();X4();T9i=Symbol.for("brand.privateNullableHeaders");a(fTc,"iterateHeaders");At=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of fTc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[T9i]:!0,values:e,nulls:r}},"buildHeaders")});function Dvt(t){return typeof t=="object"&&t!==null&&GBe in t}function AOr(t,e){let r=new Set;if(t)for(let n of t)Dvt(n)&&r.add(n[GBe]);if(e){for(let n of e)if(Dvt(n)&&r.add(n[GBe]),Array.isArray(n.content))for(let o of n.content)Dvt(o)&&r.add(o[GBe])}return Array.from(r)}function Nvt(t,e){let r=AOr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function I9i(t){return Dvt(t)?{"x-stainless-helper":t[GBe]}:{}}var GBe,$Be=me(()=>{p();GBe=Symbol("anthropic.sdk.stainlessHelper");a(Dvt,"wasCreatedByStainlessHelper");a(AOr,"collectStainlessHelpers");a(Nvt,"stainlessHelperHeader");a(I9i,"stainlessHelperHeaderFromFile")});function w9i(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var x9i,pTc,nr,Rf=me(()=>{p();wf();a(w9i,"encodeURIPath");x9i=Object.freeze(Object.create(null)),pTc=a((t=w9i)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??x9i)??x9i)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new dr(`Path parameters result in path with invalid segments: + `,u=[],d=null,f=!0;for(;f;){let m=await xAe(t,e,r,n,l,o,{owner:s,name:c,first:100,after:d},"github-graphql-assignable-users");if(!m?.data?.repository?.assignableUsers)break;let g=m.data.repository.assignableUsers;u.push(...g.nodes),f=g.pageInfo.hasNextPage,d=g.pageInfo.endCursor}return u}a($yc,"getAssignableActorsWithAssignableUsers")});var T3i=I(IR=>{"use strict";p();Object.defineProperty(IR,"__esModule",{value:!0});IR.BaseOctoKitService=IR.PermissiveAuthRequiredError=IR.VSCodeTeamId=IR.IOctoKitService=IR.IGithubRepositoryService=void 0;var S3i=tn(),b3i=k7(),E6=C3i();IR.IGithubRepositoryService=(0,S3i.createServiceIdentifier)("IGithubRepositoryService");IR.IOctoKitService=(0,S3i.createServiceIdentifier)("IOctoKitService");IR.VSCodeTeamId=1682102;var HDr=class extends Error{static{a(this,"PermissiveAuthRequiredError")}constructor(){super("Permissive authentication is required"),this.name="PermissiveAuthRequiredError"}};IR.PermissiveAuthRequiredError=HDr;var GDr=class t{static{a(this,"BaseOctoKitService")}static{this._outageStatusCacheTTL=300*1e3}static{this._userReposScopeCacheTTL=300*1e3}constructor(e,r,n,o){this._capiClientService=e,this._fetcherService=r,this._logService=n,this._telemetryService=o}async getCurrentAuthedUserWithToken(e){return this._makeGHAPIRequest("user","GET",e,void 0,void 0,"github-rest-get-user")}async getGitHubOutageStatus(){let e=Date.now();if(this._cachedOutageStatus&&e-this._cachedOutageStatus.timestampl.headRefName===n)}async addPullRequestCommentWithToken(e,r,n){return(0,E6.addPullRequestCommentGraphQLRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,n,e,r)}async createPullRequestWithToken(e,r,n,o,s,c,l,u){let d=await this._makeGHAPIRequest(`repos/${e}/${r}/pulls`,"POST",u,{title:n,body:o,head:s,base:c,draft:l});if(!d?.html_url||typeof d.number!="number")throw new Error(`Failed to create pull request for ${e}/${r}`);return{url:d.html_url,number:d.number}}async getPullRequestFromSessionWithToken(e,r){return(0,E6.getPullRequestFromGlobalId)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,r,e)}async getPullRequestFilesWithToken(e,r,n,o){return await(0,E6.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,`repos/${e}/${r}/pulls/${n}/files`,"GET",o,{version:"2022-11-28",callSite:"github-rest-get-pr-files"})||[]}async closePullRequestWithToken(e,r,n,o){return(0,E6.closePullRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,o,e,r,n)}async getFileContentWithToken(e,r,n,o,s){let c=`repos/${e}/${r}/contents/${o}?ref=${encodeURIComponent(n)}`,l=await(0,E6.makeGitHubAPIRequest)(this._fetcherService,this._logService,this._telemetryService,this._capiClientService.dotcomAPIURL,c,"GET",s,{callSite:"github-rest-get-file-content"});if(!l||Array.isArray(l))throw new Error("Unable to fetch file content");let u=l;if(u.content&&u.encoding==="base64")return(0,b3i.decodeBase64)(u.content.replace(/\n/g,"")).toString();if(u.sha){let d=await this.getBlobContentWithToken(e,r,u.sha,s);if(d)return d}return this._logService.error(`Failed to get file content for ${e}/${r}/${o} at ref ${n}`),""}async getUserOrganizationsWithToken(e,r=100){let n=await this._makeGHAPIRequest(`user/orgs?per_page=${r}`,"GET",e,void 0,void 0,"github-rest-get-user-orgs");return!n||!Array.isArray(n)?[]:n.map(o=>o.login)}async isUserMemberOfOrgWithToken(e,r){try{let n=await this._makeGHAPIRequest(`user/memberships/orgs/${encodeURIComponent(e)}`,"GET",r,void 0,void 0,"github-rest-check-org-membership");return n&&(n.state==="active"||n.state==="pending")}catch{return!1}}async getOrganizationRepositoriesWithToken(e,r,n=100){let o=await this._makeGHAPIRequest(`orgs/${e}/repos?per_page=${n}&sort=updated`,"GET",r,void 0,{silent404:!0},"github-rest-get-org-repos");return!o||!Array.isArray(o)||o.length===0?[]:o.map(s=>s.name)}async getUserRepositoriesWithToken(e,r){let n=r?.trim();if(n)return this.searchUserRepositoriesWithToken(e,n);let o=await this._makeGHAPIRequest("user/repos?per_page=100&sort=updated&affiliation=owner,collaborator,organization_member","GET",e,void 0,void 0,"github-rest-get-user-repos");return!o||!Array.isArray(o)?[]:o.filter(s=>s.permissions?.push).map(s=>({owner:s.owner.login,name:s.name}))}async searchUserRepositoriesWithToken(e,r){let n=await this._getUserReposSearchScope(e);if(!n)return[];let o=encodeURIComponent(`${r} in:name fork:true ${n}`),s=await this._makeGHAPIRequest(`search/repositories?q=${o}&sort=updated&per_page=100`,"GET",e,void 0,void 0,"github-rest-search-repos");return!s||!Array.isArray(s.items)?[]:s.items.filter(c=>c.permissions?.push).map(c=>({owner:c.owner.login,name:c.name}))}async _getUserReposSearchScope(e){let r=Date.now();if(this._cachedUserReposScope&&this._cachedUserReposScope.token===e&&r-this._cachedUserReposScope.timestamp{"use strict";p();Object.defineProperty(rvt,"__esModule",{value:!0});rvt.NullBaseOctoKitService=void 0;var Vyc=T3i(),$Dr=class extends Vyc.BaseOctoKitService{static{a(this,"NullBaseOctoKitService")}async getGitHubOutageStatus(){return 0}async getCurrentAuthedUser(){}async getCurrentAuthedUserWithToken(e){return{avatar_url:"",login:"NullUser",name:"Null User"}}async _makeGHAPIRequest(e,r,n,o,s,c){}};rvt.NullBaseOctoKitService=$Dr});var P3i=I(Rl=>{"use strict";p();var lvt=Rl&&Rl.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wu=Rl&&Rl.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(Rl,"__esModule",{value:!0});Rl.CopilotTokenManagerFromGitHubToken=Rl.CopilotTokenManagerFromDeviceId=Rl.RefreshableCopilotTokenManager=Rl.StaticExtendedTokenInfoCopilotTokenManager=Rl.FixedCopilotTokenManager=Rl.BaseCopilotTokenManager=Rl.tokenErrorString=void 0;Rl.createStaticGitHubTokenProvider=zyc;Rl.getOrCreateTestingCopilotTokenManager=Yyc;var VDr=(yre(),ya(Are)),Wyc=_c(),x3i=Io(),nvt=Y$e(),R3i=Sl(),uvt=wE(),dvt=o$(),RAe=r4(),fvt=I3i(),pvt=Ap(),Z4e=iy(),hvt=Bh(),w3i=Gge(),_6=u0t(),ivt=RMe();Rl.tokenErrorString='Tests: either GITHUB_PAT, GITHUB_OAUTH_TOKEN, or GITHUB_OAUTH_TOKEN+VSCODE_COPILOT_CHAT_TOKEN must be set unless running from an IS_SCENARIO_AUTOMATION environment. Run "npm run get_token" to get credentials.';function zyc(){let t=process.env.GITHUB_PAT,e=process.env.GITHUB_OAUTH_TOKEN;if(!(RAe.isScenarioAutomation&&!t&&!e))return()=>{if(t)return t;if(e)return e;throw new Error(Rl.tokenErrorString)}}a(zyc,"createStaticGitHubTokenProvider");function Yyc(t){if(process.env.VSCODE_COPILOT_CHAT_TOKEN)return new nvt.SyncDescriptor(svt,[process.env.VSCODE_COPILOT_CHAT_TOKEN]);if(process.env.GITHUB_OAUTH_TOKEN)return new nvt.SyncDescriptor(cvt,[process.env.GITHUB_OAUTH_TOKEN,"unknown"]);if(process.env.GITHUB_PAT)return new nvt.SyncDescriptor(ovt,[process.env.GITHUB_PAT]);if(RAe.isScenarioAutomation)return new nvt.SyncDescriptor(avt,[t]);throw new Error(Rl.tokenErrorString)}a(Yyc,"getOrCreateTestingCopilotTokenManager");var wAe=class extends x3i.Disposable{static{a(this,"BaseCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(),this._baseOctokitservice=e,this._logService=r,this._telemetryService=n,this._domainService=o,this._capiClientService=s,this._fetcherService=c,this._envService=l,this._isDisposed=!1,this._copilotTokenRefreshEmitter=this._register(new Wyc.Emitter),this.onDidCopilotTokenRefresh=this._copilotTokenRefreshEmitter.event,this._register((0,x3i.toDisposable)(()=>this._isDisposed=!0))}get copilotToken(){return this._copilotToken}set copilotToken(e){e!==this._copilotToken&&(this._copilotToken=e,this._copilotTokenRefreshEmitter.fire())}resetCopilotToken(e){e!==void 0&&this._telemetryService.sendGHTelemetryEvent("auth.reset_token_"+e),this._logService.debug(`Resetting copilot token on HTTP error ${e||"unknown"}`),this.copilotToken=void 0}async authFromGitHubToken(e,r){return this.doAuthFromGitHubTokenOrDevDeviceId({githubToken:e,ghUsername:r})}async authFromDevDeviceId(e){return this.doAuthFromGitHubTokenOrDevDeviceId({devDeviceId:e})}async doAuthFromGitHubTokenOrDevDeviceId(e){this._telemetryService.sendGHTelemetryEvent("auth.new_login");let r,n,o;try{"githubToken"in e?(o=e.ghUsername,[r,n]=await Promise.all([this.fetchCopilotTokenFromGitHubToken(e.githubToken),this.fetchCopilotUserInfo(e.githubToken)])):r=await this.fetchCopilotTokenFromDevDeviceId(e.devDeviceId)}catch(f){return this._logService.warn("Failed to get copilot token due to fetch throwing: "+(f.message||String(f))),{kind:"failure",reason:"RequestFailed",message:f.message||String(f)}}if(!r.ok){this._logService.warn(`Failed to get copilot token due to status ${r.status} ${r.statusText}`);let f=w3i.TelemetryData.createAndMarkAsIssued({status:r.status.toString(),status_text:r.statusText});if(this._telemetryService.sendGHTelemetryErrorEvent("auth.invalid_token",f.properties,f.measurements),r.status===401)return this._logService.warn("Failed to get copilot token due to 401 status"),this._telemetryService.sendGHTelemetryErrorEvent("auth.unknown_401"),{kind:"failure",reason:"HTTP401"}}if(r.kind==="error-envelope")return this._logService.warn(`Failed to get copilot token due to: ${r.body.error_details.message}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"NotAuthorized",...r.body.error_details};if(r.kind==="error")return r.body.message?.startsWith("API rate limit exceeded")?(this._logService.warn("Failed to get copilot token due to exceeding API rate limit"),this._telemetryService.sendGHTelemetryErrorEvent("auth.rate_limited"),{kind:"failure",reason:"RateLimited"}):(this._logService.warn(`Failed to get copilot token due to: ${r.body.message}`),{kind:"failure",reason:"NotAuthorized"});if(r.kind==="parse-failed")return this._logService.warn(`Failed to get copilot token due to: ${r.parseError}`),this._telemetryService.sendGHTelemetryErrorEvent("auth.request_read_failed"),{kind:"failure",reason:"ParseFailed",message:r.parseError};let s=r.body,c=s.expires_at;s.expires_at=(0,ivt.nowSeconds)()+s.refresh_in+60;let l=o??"unknown",u={...s,copilot_plan:n?.copilot_plan??s.sku??"",quota_snapshots:n?.quota_snapshots,quota_reset_date:n?.quota_reset_date,codex_agent_enabled:n?.codex_agent_enabled,token_based_billing:n?.token_based_billing,organization_login_list:n?.organization_login_list??[],username:l,isVscodeTeamMember:(0,_6.containsVSCodeOrg)(s.organization_list??[])},d=w3i.TelemetryData.createAndMarkAsIssued({},{adjusted_expires_at:s.expires_at,expires_at:c,current_time:(0,ivt.nowSeconds)()});return this._telemetryService.sendGHTelemetryEvent("auth.new_token",d.properties,d.measurements),{kind:"success",...u}}async fetchCopilotTokenFromGitHubToken(e){let r={callSite:"copilot-token-github",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:VDr.RequestType.CopilotToken});return this.parseTokenResponse(n)}async fetchCopilotTokenFromDevDeviceId(e){let r={callSite:"copilot-token-device",headers:{"X-GitHub-Api-Version":"2025-04-01","Editor-Device-Id":`${e}`},retryFallbacks:!0,expectJSON:!0},n=await this._capiClientService.makeRequest(r,{type:VDr.RequestType.CopilotNLToken});return this.parseTokenResponse(n)}async parseTokenResponse(e){let r={ok:e.ok,status:e.status,statusText:e.statusText},n;try{n=await(0,Z4e.jsonVerboseError)(e)}catch(s){return{...r,body:void 0,kind:"parse-failed",parseError:s.message||String(s)}}let o=(0,_6.validateTokenEnvelope)(n);return o.valid?(this.sendTokenValidationTelemetry(o),{...r,body:o.envelope,kind:"token"}):(0,_6.isErrorEnvelope)(n)?{...r,body:n,kind:"error-envelope"}:(0,_6.isStandardErrorEnvelope)(n)?{...r,body:n,kind:"error"}:(this.sendTokenValidationTelemetry(o),{...r,body:void 0,kind:"parse-failed",parseError:"Response is not valid: "+JSON.stringify(n)})}sendTokenValidationTelemetry(e){e.strategy!=="strict"&&this._telemetryService.sendMSFTTelemetryEvent("copilotTokenFetching.validation",{strategy:e.strategy,strictError:e.strictError,fallbackError:e.fallbackError})}async fetchCopilotUserInfo(e){let r={callSite:"copilot-token-user-info",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0};return await(await this._capiClientService.makeRequest(r,{type:VDr.RequestType.CopilotUserInfo})).json()}};Rl.BaseCopilotTokenManager=wAe;var ovt=class extends wAe{static{a(this,"FixedCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new fvt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l),this._completionsToken=e,this.copilotToken=(0,_6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}set completionsToken(e){this._completionsToken=e,this.copilotToken=(0,_6.createTestExtendedTokenInfo)({token:e,username:"fixedTokenManager",copilot_plan:"unknown"})}get completionsToken(){return this._completionsToken}async getCopilotToken(){return new _6.CopilotToken(this.copilotToken)}async checkCopilotToken(){return{status:"OK"}}};Rl.FixedCopilotTokenManager=ovt;Rl.FixedCopilotTokenManager=ovt=lvt([wu(1,pvt.ILogService),wu(2,hvt.ITelemetryService),wu(3,uvt.ICAPIClientService),wu(4,dvt.IDomainService),wu(5,Z4e.IFetcherService),wu(6,RAe.IEnvService)],ovt);var svt=class extends wAe{static{a(this,"StaticExtendedTokenInfoCopilotTokenManager")}constructor(e,r,n,o,s,c,l){super(new fvt.NullBaseOctoKitService(o,c,r,n),r,n,s,o,c,l);let u=Buffer.from(e,"base64").toString("utf8");this._initialToken=JSON.parse(u)}async getCopilotToken(){return this.copilotToken||(this.copilotToken={...this._initialToken}),new _6.CopilotToken(this._initialToken)}async checkCopilotToken(){return{status:"OK"}}};Rl.StaticExtendedTokenInfoCopilotTokenManager=svt;Rl.StaticExtendedTokenInfoCopilotTokenManager=svt=lvt([wu(1,pvt.ILogService),wu(2,hvt.ITelemetryService),wu(3,uvt.ICAPIClientService),wu(4,dvt.IDomainService),wu(5,Z4e.IFetcherService),wu(6,RAe.IEnvService)],svt);var J4e=class extends wAe{static{a(this,"RefreshableCopilotTokenManager")}async getCopilotToken(e){if(!this.copilotToken||this.copilotToken.expires_at<(0,ivt.nowSeconds)()+300||e){let r=await this.authenticateAndGetToken();if(r.kind==="failure")throw Error(`Failed to get copilot token: ${r.reason.toString()} ${r.message??""}`);this.copilotToken={...r}}return new _6.CopilotToken(this.copilotToken)}async checkCopilotToken(){if(!this.copilotToken||this.copilotToken.expires_at<(0,ivt.nowSeconds)()){let r=await this.authenticateAndGetToken();if(r.kind==="failure")return r;this.copilotToken={...r}}return{status:"OK"}}};Rl.RefreshableCopilotTokenManager=J4e;var avt=class extends J4e{static{a(this,"CopilotTokenManagerFromDeviceId")}constructor(e,r,n,o,s,c,l,u){super(new fvt.NullBaseOctoKitService(s,c,r,n),r,n,o,s,c,l),this.deviceId=e,this.configurationService=u}async authenticateAndGetToken(){return this.authFromDevDeviceId(this.deviceId)}};Rl.CopilotTokenManagerFromDeviceId=avt;Rl.CopilotTokenManagerFromDeviceId=avt=lvt([wu(1,pvt.ILogService),wu(2,hvt.ITelemetryService),wu(3,dvt.IDomainService),wu(4,uvt.ICAPIClientService),wu(5,Z4e.IFetcherService),wu(6,RAe.IEnvService),wu(7,R3i.IConfigurationService)],avt);var cvt=class extends J4e{static{a(this,"CopilotTokenManagerFromGitHubToken")}constructor(e,r,n,o,s,c,l,u,d){super(new fvt.NullBaseOctoKitService(c,l,n,o),n,o,s,c,l,u),this.githubToken=e,this.githubUsername=r,this.configurationService=d}async authenticateAndGetToken(){return this.authFromGitHubToken(this.githubToken,this.githubUsername)}};Rl.CopilotTokenManagerFromGitHubToken=cvt;Rl.CopilotTokenManagerFromGitHubToken=cvt=lvt([wu(2,pvt.ILogService),wu(3,hvt.ITelemetryService),wu(4,dvt.IDomainService),wu(5,uvt.ICAPIClientService),wu(6,Z4e.IFetcherService),wu(7,RAe.IEnvService),wu(8,R3i.IConfigurationService)],cvt)});var k3i=I(v6=>{"use strict";p();var Kyc=v6&&v6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},WDr=v6&&v6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(v6,"__esModule",{value:!0});v6.ChatQuotaService=void 0;var Jyc=(yre(),ya(Are)),Zyc=_c(),Xyc=Io(),eEc=CE(),tEc=wE(),rEc=Ap(),zDr=class extends Xyc.Disposable{static{a(this,"ChatQuotaService")}constructor(e,r,n){super(),this._authService=e,this._logService=r,this._capiClientService=n,this._turnCredits=new Map,this._onDidChange=this._register(new Zyc.Emitter),this.onDidChange=this._onDidChange.event,this._rateLimitInfo={session:void 0,weekly:void 0},this._register(this._authService.onDidAuthenticationChange(()=>{this._processUserInfoQuotaSnapshot(this._authService.copilotToken?.quotaInfo)}))}get quotaInfo(){return this._quotaInfo}get rateLimitInfo(){return this._rateLimitInfo}get quotaExhausted(){return!this._quotaInfo||this._quotaInfo.additionalUsageEnabled?!1:this._quotaInfo.unlimited?!this._quotaInfo.hasQuota:this._quotaInfo.percentRemaining<=0}get additionalUsageEnabled(){return this._quotaInfo?this._quotaInfo.additionalUsageEnabled:!1}getCreditsForTurn(e){return this._turnCredits.get(e)}setLastCopilotUsage(e,r){let n=e/1e9;n>0&&this._turnCredits.set(r,(this._turnCredits.get(r)??0)+n)}resetTurnCredits(e){this._turnCredits.delete(e)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(e){let r=this._authService.copilotToken?.isFreeUser?e.get("x-quota-snapshot-chat"):e.get("x-quota-snapshot-premium_models")||e.get("x-quota-snapshot-premium_interactions");if(!r)return;let n=this._processHeaderValue(r);if(!n)return;this._quotaInfo=n,this._logService.trace(`[ChatQuota] processQuotaHeaders: ${JSON.stringify(n)}`);let o=e.get("x-usage-ratelimit-session"),s=e.get("x-usage-ratelimit-weekly");this._rateLimitInfo.session=o?this._processHeaderValue(o):void 0,this._rateLimitInfo.weekly=s?this._processHeaderValue(s):void 0,this._onDidChange.fire()}processQuotaSnapshots(e){let r=this._authService.copilotToken?.isFreeUser?e.chat:e.premium_models??e.premium_interactions;if(r)try{let n=parseInt(r.entitlement,10),o=r.reset_date?new Date(r.reset_date):(()=>{let s=new Date;return s.setMonth(s.getMonth()+1),s})();this._quotaInfo={quota:n,unlimited:n===-1,hasQuota:r.has_quota??!0,percentRemaining:r.percent_remaining,additionalUsageUsed:r.overage_count,additionalUsageEnabled:r.overage_permitted,resetDate:o},this._logService.trace(`[ChatQuota] processQuotaSnapshots: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}catch(n){console.error("Failed to process quota snapshots",n)}}async refreshQuota(){let e=this._authService.anyGitHubSession?.accessToken;if(e)try{let r={callSite:"copilot-quota-refresh",headers:{Authorization:`token ${e}`,"X-GitHub-Api-Version":"2025-04-01"},retryFallbacks:!0,expectJSON:!0},o=await(await this._capiClientService.makeRequest(r,{type:Jyc.RequestType.CopilotUserInfo})).json();this._processUserInfoQuotaSnapshot(o),this._logService.trace("[ChatQuota] refreshQuota: fetched up-to-date quota data")}catch(r){this._logService.trace(`[ChatQuota] refreshQuota: failed to fetch quota data: ${r}`)}}_processHeaderValue(e){try{let r=new URLSearchParams(e),n=parseInt(r.get("ent")||"0",10),o=parseFloat(r.get("ov")||"0.0"),s=r.get("ovPerm")==="true",c=parseFloat(r.get("rem")||"0.0"),l=r.get("rst"),u;return l?u=new Date(l):(u=new Date,u.setMonth(u.getMonth()+1)),{quota:n,unlimited:n===-1,hasQuota:!0,percentRemaining:c,additionalUsageUsed:o,additionalUsageEnabled:s,resetDate:u}}catch(r){console.error("Failed to parse quota header",r);return}}_processUserInfoQuotaSnapshot(e){if(!e||!e.quota_snapshots||!e.quota_reset_date)return;let r=this._authService.copilotToken?.isFreeUser?e.quota_snapshots.chat:e.quota_snapshots.premium_interactions;this._quotaInfo={unlimited:r.unlimited,hasQuota:r.has_quota??!0,additionalUsageEnabled:r.overage_permitted,additionalUsageUsed:r.overage_count,quota:r.entitlement,resetDate:new Date(e.quota_reset_date),percentRemaining:r.percent_remaining},this._logService.trace(`[ChatQuota] processUserInfoQuotaSnapshot: ${JSON.stringify(this._quotaInfo)}`),this._onDidChange.fire()}};v6.ChatQuotaService=zDr;v6.ChatQuotaService=zDr=Kyc([WDr(0,eEc.IAuthenticationService),WDr(1,rEc.ILogService),WDr(2,tEc.ICAPIClientService)],zDr)});var N3i=I(mvt=>{"use strict";p();Object.defineProperty(mvt,"__esModule",{value:!0});mvt.DefaultsOnlyConfigurationService=void 0;var D3i=Sl(),YDr=class extends D3i.AbstractConfigurationService{static{a(this,"DefaultsOnlyConfigurationService")}getConfig(e){return this.getDefaultValue(e)}inspectConfig(e,r){return{defaultValue:this.getDefaultValue(e)}}setConfig(e,r,n){return Promise.resolve()}getNonExtensionConfig(e){}getExperimentBasedConfig(e,r,n){if(e.experimentName){let c=r.getTreatmentVariable(e.experimentName);if(c!==void 0)return c}let o=r.getTreatmentVariable(`copilotchat.config.${e.id}`);if(o!==void 0)return o;let s=r.getTreatmentVariable(`config.${e.fullyQualifiedId}`);if(s!==void 0)return s;if(e.fullyQualifiedOldId){let c=r.getTreatmentVariable(`copilotchat.config.${e.oldId}`);if(c!==void 0)return c;let l=r.getTreatmentVariable(`config.${e.fullyQualifiedOldId}`);if(l!==void 0)return l}return this.getDefaultValue(e)}updateExperimentBasedConfiguration(e){e.length!==0&&this._onDidChangeConfiguration.fire({affectsConfiguration:a((r,n)=>{if(e.some(s=>s.startsWith(`config.${r}`)))return!0;let o=D3i.globalConfigRegistry.configs.get(r)?.fullyQualifiedOldId;return!!(o&&e.some(s=>s.startsWith(`config.${o}`)))},"affectsConfiguration")})}dumpConfig(){return{}}};mvt.DefaultsOnlyConfigurationService=YDr});var O3i=I(gvt=>{"use strict";p();Object.defineProperty(gvt,"__esModule",{value:!0});gvt.computeDiff=iEc;gvt.computeDiffSync=M3i;var nEc=VRr();async function iEc(t,e,r){return M3i(t,e,r)}a(iEc,"computeDiff");function M3i(t,e,r){let n=t.split(/\r\n|\r|\n/),o=e.split(/\r\n|\r|\n/),c=new nEc.DefaultLinesDiffComputer().computeDiff(n,o,r),l=c.changes.length>0?!1:t===e;function u(d){return d.map(f=>[f.original.startLineNumber,f.original.endLineNumberExclusive,f.modified.startLineNumber,f.modified.endLineNumberExclusive,f.innerChanges?.map(h=>[h.originalRange.startLineNumber,h.originalRange.startColumn,h.originalRange.endLineNumber,h.originalRange.endColumn,h.modifiedRange.startLineNumber,h.modifiedRange.startColumn,h.modifiedRange.endLineNumber,h.modifiedRange.endColumn])])}return a(u,"getLineChanges"),{identical:l,quitEarly:c.hitTimeout,changes:u(c.changes),moves:c.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}a(M3i,"computeDiffSync")});var U3i=I(UD=>{"use strict";p();var oEc=UD&&UD.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),sEc=UD&&UD.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),F3i=UD&&UD.__importStar||(function(){var t=a(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{let r=fEc([B3i.join(__dirname,"diffWorker.js"),B3i.join(__dirname,"../../../../dist/diffWorker.js")]);if(r===void 0)throw new Error("DiffServiceImpl: worker file not found");return new aEc.WorkerWithRpcProxy(r,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=this._useWorker?await this._worker.value.proxy.computeDiff(e,r,n):await dEc.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:ZDr(o.changes),moves:o.moves.map(c=>new uEc.MovedText(new KDr.LineRangeMapping(new Avt.LineRange(c[0],c[1]),new Avt.LineRange(c[2],c[3])),ZDr(c[4])))}}};UD.DiffServiceImpl=JDr;function ZDr(t){return t.map(e=>new KDr.DetailedLineRangeMapping(new Avt.LineRange(e[0],e[1]),new Avt.LineRange(e[2],e[3]),e[4]?.map(r=>new KDr.RangeMapping(new L3i.Range(r[0],r[1],r[2],r[3]),new L3i.Range(r[4],r[5],r[6],r[7])))))}a(ZDr,"toLineRangeMappings");function fEc(t){for(let e of t)if((0,lEc.existsSync)(e))return e}a(fEc,"firstExistingPath")});var q3i=I(C6=>{"use strict";p();var pEc=C6&&C6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Q3i=C6&&C6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(C6,"__esModule",{value:!0});C6.CAPIClientImpl=void 0;var hEc=r4(),mEc=iy(),gEc=wE(),XDr=class extends gEc.BaseCAPIClientService{static{a(this,"CAPIClientImpl")}constructor(e,r){super(process.env.HMAC_SECRET,process.env.VSCODE_COPILOT_INTEGRATION_ID,e,r)}};C6.CAPIClientImpl=XDr;C6.CAPIClientImpl=XDr=pEc([Q3i(0,mEc.IFetcherService),Q3i(1,hEc.IEnvService)],XDr)});var H3i=I(b6=>{"use strict";p();var AEc=b6&&b6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},eNr=b6&&b6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(b6,"__esModule",{value:!0});b6.DomainService=void 0;var yEc=_c(),EEc=Io(),_Ec=Y7(),PAe=Sl(),vEc=wE(),j3i="github-enterprise.uri",tNr=class extends EEc.Disposable{static{a(this,"DomainService")}constructor(e,r,n){super(),this._configurationService=e,this._tokenStore=r,this._capiClientService=n,this._onDidChangeDomains=this._register(new yEc.Emitter),this.onDidChangeDomains=this._onDidChangeDomains.event,this._register(this._configurationService.onDidChangeConfiguration(o=>this._onDidConfigChangeHandler(o))),this._processCopilotToken(this._tokenStore.copilotToken),this._register(this._tokenStore.onDidStoreUpdate(()=>this._processCopilotToken(this._tokenStore.copilotToken)))}_onDidConfigChangeHandler(e){(e.affectsConfiguration(`${PAe.CopilotConfigPrefix}.advanced`)||e.affectsConfiguration(j3i))&&this._processCAPIModuleChange(this._tokenStore.copilotToken)}_processCAPIModuleChange(e){let r=this._configurationService.getConfig(PAe.ConfigKey.Shared.DebugOverrideCAPIUrl);r&&r.endsWith("/")&&(r=r.slice(0,-1));let n=this._configurationService.getConfig(PAe.ConfigKey.Shared.DebugOverrideProxyUrl);n&&(n=n.replace(/\/$/,""));let o=this._configurationService.getConfig(PAe.ConfigKey.Shared.AuthProvider)===PAe.AuthProviderId.GitHubEnterprise?this._configurationService.getNonExtensionConfig(j3i):void 0,s={endpoints:{api:r||e?.endpoints?.api,proxy:n||e?.endpoints?.proxy,telemetry:e?.endpoints?.telemetry,"origin-tracker":e?.endpoints?.["origin-tracker"]},sku:e?.sku||"unknown"},c=this._capiClientService.updateDomains(s,o);(c.capiUrlChanged||c.proxyUrlChanged||c.telemetryUrlChanged||c.dotcomUrlChanged)&&this._onDidChangeDomains.fire({capiUrlChanged:c.capiUrlChanged,telemetryUrlChanged:c.telemetryUrlChanged,proxyUrlChanged:c.proxyUrlChanged,dotcomUrlChanged:c.dotcomUrlChanged})}_processCopilotToken(e){this._processCAPIModuleChange(e)}};b6.DomainService=tNr;b6.DomainService=tNr=AEc([eNr(0,PAe.IConfigurationService),eNr(1,_Ec.ICopilotTokenStore),eNr(2,vEc.ICAPIClientService)],tNr)});var G3i=I(kAe=>{"use strict";p();Object.defineProperty(kAe,"__esModule",{value:!0});kAe.NullNativeEnvService=kAe.NullEnvService=void 0;var CEc=_c(),bEc=Vu(),yvt=r4(),SEc=yMe(),Evt=class t extends yvt.AbstractEnvService{static{a(this,"NullEnvService")}constructor(){super(...arguments),this.language="en"}static{this.Instance=new t}get extensionId(){return"test-extension-id"}get vscodeVersion(){return"test-version"}get isActive(){return!0}get onDidChangeWindowState(){return CEc.Event.None}get sessionId(){return"test-session"}get machineId(){return"test-machine"}get devDeviceId(){return"test-dev-device"}get remoteName(){}get uiKind(){return"desktop"}get uriScheme(){return"code-null"}get appRoot(){return""}get shell(){return"zsh"}get OS(){return yvt.OperatingSystem.Linux}getEditorInfo(){return new yvt.NameAndVersion("simulation-tests-editor",SEc.packageJson.engines.vscode.match(/\d+\.\d+/)?.[0]??"1.89")}getEditorPluginInfo(){return new yvt.NameAndVersion("simulation-tests-plugin","2")}openExternal(e){return Promise.resolve(!1)}};kAe.NullEnvService=Evt;var rNr=class extends Evt{static{a(this,"NullNativeEnvService")}get userHome(){return bEc.URI.file("/home/testuser")}};kAe.NullNativeEnvService=rNr});var nNr=I(_vt=>{"use strict";p();Object.defineProperty(_vt,"__esModule",{value:!0});_vt.IGitExtensionService=void 0;var TEc=tn();_vt.IGitExtensionService=(0,TEc.createServiceIdentifier)("IGitExtensionService")});var $3i=I(vvt=>{"use strict";p();Object.defineProperty(vvt,"__esModule",{value:!0});vvt.NullGitExtensionService=void 0;var IEc=_c(),iNr=class{static{a(this,"NullGitExtensionService")}constructor(){this.onDidChange=IEc.Event.None,this.extensionAvailable=!1}getExtensionApi(){}};vvt.NullGitExtensionService=iNr});var V3i=I(S6=>{"use strict";p();var xEc=S6&&S6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},wEc=S6&&S6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(S6,"__esModule",{value:!0});S6.ObservableGit=void 0;var REc=Io(),x$=m2(),PEc=nNr(),oNr=class extends REc.Disposable{static{a(this,"ObservableGit")}constructor(e){super(),this._gitExtensionService=e,this._gitApi=(0,x$.observableFromEvent)(this,r=>this._gitExtensionService.onDidChange(r),()=>this._gitExtensionService.getExtensionApi()),this.branch=(0,x$.observableValue)("branchName",void 0),this.init()}async init(){let e=await(0,x$.waitForState)(this._gitApi);if(this._store.isDisposed)return;let r=(0,x$.observableFromEvent)(this,n=>e.onDidOpenRepository(n),()=>e.repositories??[]);await(0,x$.waitForState)(r,n=>n.length>0,void 0),!this._store.isDisposed&&(0,x$.mapObservableArrayCached)(this,r,(n,o)=>{let s=(0,x$.observableFromEvent)(c=>n.state.onDidChange(c),()=>n.state.HEAD?.name);o.add((0,x$.autorunWithStore)((c,l)=>{this.branch.set(s.read(c),void 0)}))},n=>n.rootUri.toString()).recomputeInitiallyAndOnChange(this._store)}};S6.ObservableGit=oNr;S6.ObservableGit=oNr=xEc([wEc(0,PEc.IGitExtensionService)],oNr)});var bvt=I(Pl=>{"use strict";p();Object.defineProperty(Pl,"__esModule",{value:!0});Pl.lengthZero=void 0;Pl.lengthDiff=NEc;Pl.lengthIsZero=MEc;Pl.toLength=Vre;Pl.lengthToObj=OEc;Pl.lengthGetLineCount=BEc;Pl.lengthGetColumnCountIfZeroLineCount=LEc;Pl.lengthAdd=z3i;Pl.sumLengths=FEc;Pl.lengthEquals=UEc;Pl.lengthDiffNonNegative=QEc;Pl.lengthLessThan=qEc;Pl.lengthLessThanEqual=jEc;Pl.lengthGreaterThanEqual=HEc;Pl.lengthToPosition=GEc;Pl.positionToLength=$Ec;Pl.lengthsToRange=VEc;Pl.lengthOfRange=WEc;Pl.lengthCompare=zEc;Pl.lengthOfString=YEc;Pl.lengthOfStringObj=KEc;Pl.lengthHash=JEc;Pl.lengthMax=ZEc;var W3i=Oh(),kEc=T_(),DEc=Gp(),Cvt=Kpe();function NEc(t,e,r,n){return t!==r?Vre(r-t,n):Vre(0,n-e)}a(NEc,"lengthDiff");Pl.lengthZero=0;function MEc(t){return t===0}a(MEc,"lengthIsZero");var ME=2**26;function Vre(t,e){return t*ME+e}a(Vre,"toLength");function OEc(t){let e=t,r=Math.floor(e/ME),n=e-r*ME;return new Cvt.TextLength(r,n)}a(OEc,"lengthToObj");function BEc(t){return Math.floor(t/ME)}a(BEc,"lengthGetLineCount");function LEc(t){return t}a(LEc,"lengthGetColumnCountIfZeroLineCount");function z3i(t,e){let r=t+e;return e>=ME&&(r=r-t%ME),r}a(z3i,"lengthAdd");function FEc(t,e){return t.reduce((r,n)=>z3i(r,e(n)),Pl.lengthZero)}a(FEc,"sumLengths");function UEc(t,e){return t===e}a(UEc,"lengthEquals");function QEc(t,e){let r=t,n=e;if(n-r<=0)return Pl.lengthZero;let s=Math.floor(r/ME),c=Math.floor(n/ME),l=n-c*ME;if(s===c){let u=r-s*ME;return Vre(0,l-u)}else return Vre(c-s,l)}a(QEc,"lengthDiffNonNegative");function qEc(t,e){return t=e}a(HEc,"lengthGreaterThanEqual");function GEc(t){let e=t,r=Math.floor(e/ME),n=e-r*ME;return new kEc.Position(r+1,n+1)}a(GEc,"lengthToPosition");function $Ec(t){return Vre(t.lineNumber-1,t.column-1)}a($Ec,"positionToLength");function VEc(t,e){let r=t,n=Math.floor(r/ME),o=r-n*ME,s=e,c=Math.floor(s/ME),l=s-c*ME;return new DEc.Range(n+1,o+1,c+1,l+1)}a(VEc,"lengthsToRange");function WEc(t){return t.startLineNumber===t.endLineNumber?new Cvt.TextLength(0,t.endColumn-t.startColumn):new Cvt.TextLength(t.endLineNumber-t.startLineNumber,t.endColumn-1)}a(WEc,"lengthOfRange");function zEc(t,e){return t-e}a(zEc,"lengthCompare");function YEc(t){let e=(0,W3i.splitLines)(t);return Vre(e.length-1,e[e.length-1].length)}a(YEc,"lengthOfString");function KEc(t){let e=(0,W3i.splitLines)(t);return new Cvt.TextLength(e.length-1,e[e.length-1].length)}a(KEc,"lengthOfStringObj");function JEc(t){return t}a(JEc,"lengthHash");function ZEc(t,e){return t>e?t:e}a(ZEc,"lengthMax")});var cNr=I(Svt=>{"use strict";p();Object.defineProperty(Svt,"__esModule",{value:!0});Svt.TextEditInfo=void 0;var sNr=bvt(),aNr=class{static{a(this,"TextEditInfo")}constructor(e,r,n){this.startOffset=e,this.endOffset=r,this.newLength=n}toString(){return`[${(0,sNr.lengthToObj)(this.startOffset)}...${(0,sNr.lengthToObj)(this.endOffset)}) -> ${(0,sNr.lengthToObj)(this.newLength)}`}};Svt.TextEditInfo=aNr});var K3i=I(lNr=>{"use strict";p();Object.defineProperty(lNr,"__esModule",{value:!0});lNr.combineTextEditInfos=t_c;var XEc=ml(),_m=bvt(),e_c=cNr();function t_c(t,e){if(t.length===0)return e;if(e.length===0)return t;let r=new XEc.ArrayQueue(Y3i(t)),n=Y3i(e);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let o=r.dequeue();function s(d){if(d===void 0){let h=r.takeWhile(m=>!0)||[];return o&&h.unshift(o),h}let f=[];for(;o&&!(0,_m.lengthIsZero)(d);){let[h,m]=o.splitAt(d);f.push(h),d=(0,_m.lengthDiffNonNegative)(h.lengthAfter,d),o=m??r.dequeue()}return(0,_m.lengthIsZero)(d)||f.push(new X4e(!1,d,d)),f}a(s,"nextS0ToS1MapWithS1LengthOf");let c=[];function l(d,f,h){if(c.length>0&&(0,_m.lengthEquals)(c[c.length-1].endOffset,d)){let m=c[c.length-1];c[c.length-1]=new e_c.TextEditInfo(m.startOffset,f,(0,_m.lengthAdd)(m.newLength,h))}else c.push({startOffset:d,endOffset:f,newLength:h})}a(l,"pushEdit");let u=_m.lengthZero;for(let d of n){let f=s(d.lengthBefore);if(d.modified){let h=(0,_m.sumLengths)(f,g=>g.lengthBefore),m=(0,_m.lengthAdd)(u,h);l(u,m,d.lengthAfter),u=m}else for(let h of f){let m=u;u=(0,_m.lengthAdd)(u,h.lengthBefore),h.modified&&l(m,u,h.lengthAfter)}}return c}a(t_c,"combineTextEditInfos");var X4e=class t{static{a(this,"LengthMapping")}constructor(e,r,n){this.modified=e,this.lengthBefore=r,this.lengthAfter=n}splitAt(e){let r=(0,_m.lengthDiffNonNegative)(e,this.lengthAfter);return(0,_m.lengthEquals)(r,_m.lengthZero)?[this,void 0]:this.modified?[new t(this.modified,this.lengthBefore,e),new t(this.modified,_m.lengthZero,r)]:[new t(this.modified,e,e),new t(this.modified,r,r)]}toString(){return`${this.modified?"M":"U"}:${(0,_m.lengthToObj)(this.lengthBefore)} -> ${(0,_m.lengthToObj)(this.lengthAfter)}`}};function Y3i(t){let e=[],r=_m.lengthZero;for(let n of t){let o=(0,_m.lengthDiffNonNegative)(r,n.startOffset);(0,_m.lengthIsZero)(o)||e.push(new X4e(!1,o,o));let s=(0,_m.lengthDiffNonNegative)(n.startOffset,n.endOffset);e.push(new X4e(!0,s,n.newLength)),r=n.endOffset}return e}a(Y3i,"toLengthMapping")});var Z3i=I(DAe=>{"use strict";p();Object.defineProperty(DAe,"__esModule",{value:!0});DAe.SingleTextEditLength=DAe.TextLengthEdit=void 0;var r_c=Gp(),J3i=Kpe(),n_c=K3i(),eBe=bvt(),i_c=cNr(),uNr=class t{static{a(this,"TextLengthEdit")}static{this.empty=new t([])}static fromTextEdit(e){let r=e.replacements.map(n=>new tBe(n.range,J3i.TextLength.ofText(n.text)));return new t(r)}static _fromTextEditInfo(e){let r=e.map(n=>{let o=(0,eBe.lengthToObj)(n.newLength);return new tBe((0,eBe.lengthsToRange)(n.startOffset,n.endOffset),new J3i.TextLength(o.lineCount,o.columnCount))});return new t(r)}constructor(e){this.edits=e}_toTextEditInfo(){return this.edits.map(e=>new i_c.TextEditInfo((0,eBe.toLength)(e.range.startLineNumber-1,e.range.startColumn-1),(0,eBe.toLength)(e.range.endLineNumber-1,e.range.endColumn-1),(0,eBe.toLength)(e.newLength.lineCount,e.newLength.columnCount)))}compose(e){let r=this._toTextEditInfo(),n=e._toTextEditInfo(),o=(0,n_c.combineTextEditInfos)(r,n);return t._fromTextEditInfo(o)}getRange(){if(this.edits.length!==0)return r_c.Range.fromPositions(this.edits[0].range.getStartPosition(),this.edits.at(-1).range.getEndPosition())}toString(){return`[${this.edits.join(", ")}]`}};DAe.TextLengthEdit=uNr;var tBe=class{static{a(this,"SingleTextEditLength")}constructor(e,r){this.range=e,this.newLength=r}toString(){return`{ range: ${this.range}, newLength: ${this.newLength} }`}};DAe.SingleTextEditLength=tBe});var X3i=I(NAe=>{"use strict";p();Object.defineProperty(NAe,"__esModule",{value:!0});NAe.DocumentHistory=NAe.HistoryContext=void 0;var o_c=Gu(),s_c=xD(),dNr=class{static{a(this,"HistoryContext")}constructor(e){this.documents=e,(0,o_c.assert)(e.length>0)}getMostRecentDocument(){return this.documents.at(-1)}getDocument(e){return this.documents.find(r=>r.docId===e)}getDocumentAndIdx(e){let r=this.documents.findIndex(n=>n.docId===e);if(r!==-1)return{doc:this.documents[r],idx:r}}};NAe.HistoryContext=dNr;var fNr=class{static{a(this,"DocumentHistory")}constructor(e,r,n,o,s){this.docId=e,this.languageId=r,this.base=n,this.lastEdits=o,this.lastSelection=s,this.lastEdit=new s_c.RootedEdit(this.base,this.lastEdits.compose())}};NAe.DocumentHistory=fNr});var oFi=I(MAe=>{"use strict";p();Object.defineProperty(MAe,"__esModule",{value:!0});MAe.NesHistoryContextProvider=void 0;MAe.sum=nBe;MAe.editExtends=iFi;var eFi=Io(),tFi=m2(),a_c=dS(),rBe=hE(),c_c=SMe(),l_c=AT(),Tvt=xD(),u_c=Ayt(),rFi=Z3i(),d_c=P5(),iBe=DDe(),nFi=X3i(),pNr=class extends eFi.Disposable{static{a(this,"NesHistoryContextProvider")}constructor(e,r){super(),this._documentState=new Map,this._lastDocuments=new mNr(50),this._register((0,tFi.autorun)(n=>{n.readObservable(r.branch)!==void 0&&(this._lastGitCheckout=(0,iBe.now)(),this._documentState.forEach(s=>s.applyAllEdits()))})),(0,tFi.mapObservableArrayCached)(this,e.openDocuments,(n,o)=>{let s=n.selection.get().at(0),c=new hNr(n.id,n.value.get().value,n.languageId.get(),s);this._documentState.set(c.docId,c),s&&this._lastDocuments.push(c),o.add((0,d_c.autorunWithChanges)(this,{value:n.value,selection:n.selection,languageId:n.languageId},l=>{l.languageId.changes.length>0&&(c.languageId=l.languageId.value);let u=this._isAwaitingGitCheckoutCooldown();for(let d of l.value.changes)this._lastDocuments.push(c),c.handleEdit(d,u);l.selection.changes.length>0&&(c.handleSelection(l.selection.value.at(0)),this._lastDocuments.push(c))})),o.add((0,eFi.toDisposable)(()=>{let l=this._documentState.get(n.id);l&&this._lastDocuments.remove(l),this._documentState.delete(n.id)}))},n=>n.id).recomputeInitiallyAndOnChange(this._store)}getHistoryContext(e){let r=this._documentState.get(e);if(!r||!this._lastDocuments.has(r))return;let n=[],o=!1,s=5;for(let c of this._lastDocuments.getItemsReversed()){let l=c.getRecentEdit(s);if(l!==void 0&&(l.editCount===0&&o||(c.docId===e&&(o=!0),n.push(l.history),s-=l.editCount,s<=0)))break}if(n.reverse(),!!n.some(c=>c.docId===e))return new nFi.HistoryContext(n)}_isAwaitingGitCheckoutCooldown(){if(!this._lastGitCheckout)return!1;let e=(0,iBe.now)()-this._lastGitCheckout<2*1e3;return e||(this._lastGitCheckout=void 0),e}};MAe.NesHistoryContextProvider=pNr;var hNr=class t{static{a(this,"DocumentState")}static{this.MAX_EDITED_LINES_PER_EDIT=10}static{this.MAX_EDITED_CHARS_PER_EDIT=5e3}constructor(e,r,n,o){this.docId=e,this.languageId=n,this._edits=[],this._isUserDocument=!1,this._baseValue=new l_c.StringText(r),this._currentValue=this._baseValue,this.handleSelection(o)}getSelection(){return this._selection}handleSelection(e){e&&(this._isUserDocument=!0),this._selection=e}handleEdit(e,r){if(e.isEmpty())return;this._currentValue=e.applyOnText(this._currentValue);let n=c_c.TextEdit.fromStringEdit(e,this._currentValue),o=rFi.TextLengthEdit.fromTextEdit(n);if(r){this._baseValue=this._currentValue,this._edits=[];return}function s(l){return nBe(l.replacements,u=>u.newText.length)}a(s,"editInsertSize");let c=this._edits.at(-1);c&&s(c.edit)<200&&iFi(e,c.edit)?(c.edit=c.edit.compose(e),c.textLengthEdit=c.textLengthEdit.compose(o),c.instant=(0,iBe.now)(),c.edit.isEmpty()&&this._edits.pop()):this._edits.push({edit:e,textLengthEdit:o,instant:(0,iBe.now)()})}getRecentEdit(e){if(!this._isUserDocument)return;let{editCount:r}=this._applyStaleEdits(e),n=new Tvt.Edits(rBe.StringEdit,this._edits.map(o=>o.edit));return{history:new nFi.DocumentHistory(this.docId,this.languageId,this._baseValue,n,this._selection),editCount:r}}applyAllEdits(){this._baseValue=this._currentValue,this._edits=[]}_applyStaleEdits(e){let r=this._currentValue,n=rBe.StringEdit.empty,o=rFi.TextLengthEdit.empty,s,c=0,l=rBe.StringEdit.empty;for(s=this._edits.length-1;s>=0;s--){let u=this._edits[s];if((0,iBe.now)()-u.instant>600*1e3)break;let d=u.textLengthEdit.compose(o),f=d.getRange();if((0,a_c.assertType)(f,"we only compose non-empty Edits"),f.endLineNumber-f.startLineNumber>100)break;let h=nBe(u.textLengthEdit.edits,b=>b.range.endLineNumber-b.range.startLineNumber+b.newLength.lineCount);if(h>t.MAX_EDITED_LINES_PER_EDIT||nBe(u.edit.replacements,b=>b.newText.length)>t.MAX_EDITED_CHARS_PER_EDIT||nBe(u.edit.replacements,b=>b.replaceRange.length)>t.MAX_EDITED_CHARS_PER_EDIT)break;if(s===this._edits.length-1)l=u.edit;else{let b=rBe.StringEdit.trySwap(u.edit,l);if(b)l=b.e1;else{if(h>=2)break;l=u.edit.compose(l)}}r=u.edit.inverse(r.value).applyOnText(r);let y=u.edit.compose(n),E=Tvt.RootedEdit.toLineEdit(new Tvt.RootedEdit(r,y)),v=new u_c.RootedLineEdit(r,E).removeCommonSuffixPrefixLines().edit.replacements.length;if(v>e)break;c=v,n=y,o=d}for(let u=0;u<=s;u++){let d=this._edits[u];this._baseValue=d.edit.applyOnText(this._baseValue)}return this._edits=this._edits.slice(s+1),{editCount:c}}toString(){return new Tvt.Edits(rBe.StringEdit,this._edits.map(e=>e.edit)).toHumanReadablePatch(this._baseValue)}};function nBe(t,e){let r=0;for(let n of t)r+=e(n);return r}a(nBe,"sum");function iFi(t,e){let r=e.getNewRanges();return t.replacements.every(n=>f_c(n.replaceRange,r))}a(iFi,"editExtends");function f_c(t,e){return e.some(r=>t.start===r.endExclusive||t.endExclusive===r.start)}a(f_c,"doesTouch");var mNr=class{static{a(this,"FifoSet")}constructor(e){this.maxSize=e,this._arr=[]}push(e){let r=this._arr.indexOf(e);r!==-1?this._arr.splice(r,1):this._arr.length>=this.maxSize&&this._arr.shift(),this._arr.push(e)}remove(e){let r=this._arr.indexOf(e);r!==-1&&this._arr.splice(r,1)}getItemsReversed(){let e=[...this._arr];return e.reverse(),e}has(e){return this._arr.indexOf(e)!==-1}}});var cFi=I(QD=>{"use strict";p();var p_c=QD&&QD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},sFi=QD&&QD.__param||function(t,e){return function(r,n){e(r,n,t)}},ANr;Object.defineProperty(QD,"__esModule",{value:!0});QD.NesXtabHistoryTracker=QD.XtabEditMergeStrategy=void 0;var yNr=Gu(),h_c=Io(),m_c=dce(),g_c=m2(),A_c=BF(),xvt=Sl(),y_c=_p(),Ivt=xD(),T6=jyr(),E_c=P5(),gNr=DDe(),ENr;(function(t){t.sameStartLine={kind:T6.DiffHistoryMergeStrategy.SameStartLine};function e(o){return{kind:T6.DiffHistoryMergeStrategy.Proximity,lineGap:o}}a(e,"proximity"),t.proximity=e;function r(o,s){return{kind:T6.DiffHistoryMergeStrategy.Hybrid,lineGap:o,splitAfterMs:s}}a(r,"hybrid"),t.hybrid=r;function n(o,s,c){switch(o){case T6.DiffHistoryMergeStrategy.Proximity:return e(s);case T6.DiffHistoryMergeStrategy.Hybrid:return r(s,c);case T6.DiffHistoryMergeStrategy.SameStartLine:return t.sameStartLine;default:(0,yNr.assertNever)(o)}}a(n,"fromConfig"),t.fromConfig=n})(ENr||(QD.XtabEditMergeStrategy=ENr={}));function aFi(t,e,r){if(t.isEmpty()||e.isEmpty())return!1;for(let n of t.replacements)if(!e.replacements.some(s=>n.lineRange.distanceToRange(s.lineRange)<=r))return!1;return!0}a(aFi,"areLineEditsWithinProximity");var _Nr=class extends h_c.Disposable{static{a(this,"NesXtabHistoryTracker")}static{ANr=this}static{this.MAX_HISTORY_SIZE=50}constructor(e,r,n,o){super(),this._configurationService=n,this._expService=o,this.idToEntry=new Map,this.history=new m_c.LinkedList,this.maxHistorySize=r??ANr.MAX_HISTORY_SIZE,this.mergeStrategy=(0,A_c.derived)(s=>ENr.fromConfig(this._configurationService.getExperimentBasedConfigObservable(xvt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeStrategy,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(xvt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeLineGap,this._expService).read(s),this._configurationService.getExperimentBasedConfigObservable(xvt.ConfigKey.TeamInternal.InlineEditsXtabDiffMergeSplitAfterMs,this._expService).read(s))),(0,g_c.mapObservableArrayCached)(this,e.openDocuments,(s,c)=>{c.add((0,E_c.autorunWithChanges)(this,{rootedEdits:s.value,visibleRanges:s.visibleRanges},l=>{l.rootedEdits.changes.length>0&&l.rootedEdits.previous!==void 0?this.handleEdits(s,l.rootedEdits):this.handleVisibleRangesChange(s,l.visibleRanges)}))},s=>s.id).recomputeInitiallyAndOnChange(this._store)}getHistory(){return[...this.history]}handleVisibleRangesChange(e,r){if(r.value.length===0)return;let n=this.idToEntry.get(e.id);if(n!==void 0){if(n.entry.kind==="edit")return;n.removeFromHistory()}let o={docId:e.id,kind:"visibleRanges",visibleRanges:r.value,documentContent:e.value.get()},s=this.history.push(o);this.idToEntry.set(e.id,{entry:o,removeFromHistory:s,lastEditTimestamp:(0,gNr.now)()}),this.compactHistory()}shouldMerge(e,r,n){let o=this.mergeStrategy.get();switch(o.kind){case T6.DiffHistoryMergeStrategy.SameStartLine:return!r.isEmpty()&&!e.isEmpty()&&e.replacements[0].lineRange.startLineNumber===r.replacements[0].lineRange.startLineNumber;case T6.DiffHistoryMergeStrategy.Proximity:return aFi(r,e,o.lineGap);case T6.DiffHistoryMergeStrategy.Hybrid:return(0,gNr.now)()-n<=o.splitAfterMs&&aFi(r,e,o.lineGap)}}handleEdits(e,r){(0,yNr.assert)(r.previous!==void 0,"Document has previous version"),(0,yNr.assert)(r.changes.length===1,`Expected 1 edit change but got ${r.changes.length}`);let n=r.changes[0];if(n.replacements.length===0)return;let o=this.idToEntry.get(e.id),s=r.previous,c=new Ivt.RootedEdit(s,n);if(o===void 0){this.pushToHistory(e.id,c);return}if(o.entry.kind==="visibleRanges"){o.removeFromHistory(),this.pushToHistory(e.id,c);return}let l=o.entry.edit,u=Ivt.RootedEdit.toLineEdit(l),d=Ivt.RootedEdit.toLineEdit(c);if(this.shouldMerge(u,d,o.lastEditTimestamp)){o.removeFromHistory();let f=l.edit.compose(n),h=new Ivt.RootedEdit(l.base,f);this.pushToHistory(e.id,h)}else this.pushToHistory(e.id,c)}pushToHistory(e,r){let n={docId:e,kind:"edit",edit:r},o=this.history.push(n);this.idToEntry.set(e,{entry:n,removeFromHistory:o,lastEditTimestamp:(0,gNr.now)()}),this.compactHistory()}compactHistory(){if(this.history.size>this.maxHistorySize){let e=this.history.shift();if(e!==void 0){let r=this.idToEntry.get(e.docId);r!==void 0&&e===r.entry&&this.idToEntry.delete(e.docId)}}}};QD.NesXtabHistoryTracker=_Nr;QD.NesXtabHistoryTracker=_Nr=ANr=p_c([sFi(2,xvt.IConfigurationService),sFi(3,y_c.IExperimentationService)],_Nr)});var lFi=I(wvt=>{"use strict";p();Object.defineProperty(wvt,"__esModule",{value:!0});wvt.IVSCodeExtensionContext=void 0;var __c=tn();wvt.IVSCodeExtensionContext=(0,__c.createServiceIdentifier)("IVSCodeExtensionContext")});var AFi=I(jD=>{"use strict";p();var pFi=jD&&jD.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},w$=jD&&jD.__param||function(t,e){return function(r,n){e(r,n,t)}},sBe;Object.defineProperty(jD,"__esModule",{value:!0});jD.UndesiredModels=jD.InlineEditsModelService=void 0;var v_c=fDr(),hFi=z2r(),uFi=O_(),C_c=ml(),dFi=Gu(),mFi=_c(),gFi=Io(),OAe=m2(),b_c=Y7(),qD=Sl(),S_c=lFi(),T_c=Ap(),I_c=G_t(),x_c=_p(),w_c=Bh(),oBe=ZA(),R_c=e_t(),CNr=class extends gFi.Disposable{static{a(this,"InlineEditsModelService")}static{sBe=this}static{this.COPILOT_NES_XTAB_MODEL={modelName:"copilot-nes-xtab",promptingStrategy:oBe.PromptingStrategy.CopilotNesXtab,includeTagsInCurrentFile:!0,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_OCT={modelName:"copilot-nes-oct",promptingStrategy:oBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}static{this.COPILOT_NES_CALLISTO={modelName:"nes-callisto",promptingStrategy:oBe.PromptingStrategy.Xtab275,includeTagsInCurrentFile:!1,source:"hardCodedDefault",lintOptions:void 0}}constructor(e,r,n,o,s,c,l){super(),this._tokenStore=e,this._proxyModelsService=r,this._undesiredModelsManager=n,this._configService=o,this._expService=s,this._telemetryService=c,this._logService=l,this._copilotTokenObs=(0,OAe.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken),this._fetchedModelsObs=(0,OAe.observableFromEvent)(this,this._proxyModelsService.onModelListUpdated,()=>this._proxyModelsService.nesModels),this._preferredModelNameObs=this._configService.getExperimentBasedConfigObservable(qD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService),this._localModelConfigObs=this._configService.getConfigObservable(qD.ConfigKey.Advanced.InlineEditsXtabProviderModelConfiguration),this._expBasedModelConfigObs=this._configService.getExperimentBasedConfigObservable(qD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString,this._expService),this._defaultModelConfigObs=this._configService.getExperimentBasedConfigObservable(qD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString,this._expService),this._useSlashModelsObs=this._configService.getExperimentBasedConfigObservable(qD.ConfigKey.TeamInternal.InlineEditsUseSlashModels,this._expService),this._undesiredModelsObs=(0,OAe.observableFromEvent)(this,this._undesiredModelsManager.onDidChange,()=>this._undesiredModelsManager),this._setModelQueue=new hFi.TaskQueue,this._logger=l.createSubLogger(["NES","ModelsService"]);let u=this._logger.createSubLogger("constructor");this._modelsObs=(0,OAe.derived)(d=>(u.trace("computing models"),this.aggregateModels({copilotToken:this._copilotTokenObs.read(d),fetchedNesModels:this._fetchedModelsObs.read(d),localModelConfig:this._localModelConfigObs.read(d),modelConfigString:this._expBasedModelConfigObs.read(d),defaultModelConfigString:this._defaultModelConfigObs.read(d),useSlashModels:this._useSlashModelsObs.read(d)}))).recomputeInitiallyAndOnChange(this._store),this._currentModelObs=(0,OAe.derived)(d=>{u.trace("computing current model");let f=this._undesiredModelsObs.read(d);return this._pickModel({preferredModelName:this._preferredModelNameObs.read(d),models:this._modelsObs.read(d),undesiredModelsManager:f})}).recomputeInitiallyAndOnChange(this._store),this._modelInfoObs=(0,OAe.derived)(d=>(u.trace("computing model info"),{models:this._modelsObs.read(d),currentModelId:this._currentModelObs.read(d).modelName})).recomputeInitiallyAndOnChange(this._store),this.onModelListUpdated=mFi.Event.fromObservableLight(this._modelInfoObs)}get modelInfo(){let e=this._modelsObs.get().map(n=>({id:n.modelName,name:n.modelName})),r=this._currentModelObs.get();return{models:e,currentModelId:r.modelName}}setCurrentModelId(e){return this._setModelQueue.schedule(()=>this._setCurrentModelIdCore(e))}async _setCurrentModelIdCore(e){if(this._configService.getExperimentBasedConfig(qD.ConfigKey.Advanced.InlineEditsPreferredModel,this._expService)===e)return;let o=this._currentModelObs.get(),s=this._modelsObs.get(),c=s.find(u=>u.modelName===e);if(c===void 0){this._logService.error(`New preferred model id ${e} not found in model list.`);return}o.source==="expConfig"&&await this._undesiredModelsManager.addUndesiredModelId(o.modelName),this._undesiredModelsManager.isUndesiredModelId(e)&&await this._undesiredModelsManager.removeUndesiredModelId(e);let l=this._pickModel({preferredModelName:"none",models:s,undesiredModelsManager:this._undesiredModelsManager});c.source==="expConfig"||e===l.modelName&&!s.some(u=>u.source==="expConfig")?(this._logger.trace(`New preferred model id ${e} is the same as the default model, resetting user setting.`),await this._configService.setConfig(qD.ConfigKey.Advanced.InlineEditsPreferredModel,"none")):(this._logger.trace(`New preferred model id ${e} is different from the default model, updating user setting to ${e}.`),await this._configService.setConfig(qD.ConfigKey.Advanced.InlineEditsPreferredModel,e))}aggregateModels({copilotToken:e,fetchedNesModels:r,localModelConfig:n,modelConfigString:o,defaultModelConfigString:s,useSlashModels:c}){let l=this._logger.createSubLogger("aggregateModels"),u=[];if(n&&(u.some(d=>d.modelName===n.modelName)?l.trace("Local model configuration already exists in the model list, skipping."):(l.trace(`Adding local model configuration: ${n.modelName}`),u.push({...n,source:"localConfig"}))),o){l.trace("Parsing modelConfigurationString...");let d=this.parseModelConfigString(o,qD.ConfigKey.TeamInternal.InlineEditsXtabProviderModelConfigurationString);d&&!u.some(f=>f.modelName===d.modelName)?(l.trace(`Adding model from modelConfigurationString: ${d.modelName}`),u.push({...d,source:"expConfig"})):l.trace("No valid model found in modelConfigurationString.")}if(c&&r&&r.length>0){l.trace(`Processing ${r.length} fetched models...`);let d=(0,v_c.filterMap)(r,f=>{if((0,oBe.isPromptingStrategy)(f.capabilities.promptStrategy)){if(u.some(h=>h.modelName===f.name)){l.trace(`Fetched model ${f.name} already exists in the model list, skipping.`);return}return{modelName:f.name,promptingStrategy:f.capabilities.promptStrategy,includeTagsInCurrentFile:!1,source:"fetched",lintOptions:void 0}}});l.trace(`Adding ${d.length} fetched models after filtering.`),(0,C_c.pushMany)(u,d)}else{l.trace(`adding built-in default model: useSlashModels ${c}, fetchedNesModels ${r?.length??"undefined"}`);let d=this.determineDefaultModel(e,s);d&&(u.some(f=>f.modelName===d.modelName)?l.trace("Default model configuration already exists in the model list, skipping."):(l.trace(`Adding default model configuration: ${d.modelName}`),u.push(d)))}return u}selectedModelConfiguration(){return vNr(this._currentModelObs.get())}defaultModelConfiguration(){let e=this._modelsObs.get();if(e&&e.length>0){let r=e.filter(n=>!this.isConfiguredModel(n));if(r.length>0)return vNr(r[0])}return vNr(this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get()))}isConfiguredModel(e){switch(e.source){case"localConfig":case"expConfig":case"expDefaultConfig":return!0;case"fetched":case"hardCodedDefault":return!1;default:(0,dFi.assertNever)(e.source)}}determineDefaultModel(e,r){if(r){let n=this.parseModelConfigString(r,qD.ConfigKey.TeamInternal.InlineEditsXtabProviderDefaultModelConfigurationString);if(n)return{...n,source:"expDefaultConfig"}}return e?.isFcv1()?sBe.COPILOT_NES_XTAB_MODEL:e?.isFreeUser||e?.isNoAuthUser?sBe.COPILOT_NES_CALLISTO:sBe.COPILOT_NES_OCT}_pickModel({preferredModelName:e,models:r,undesiredModelsManager:n}){let o=r.find(l=>l.source==="expConfig");if(o)if(n.isUndesiredModelId(o.modelName))this._logger.trace(`Exp-configured model ${o.modelName} is marked as undesired by the user. Skipping.`);else return o;if(e!=="none"){let l=r.find(u=>u.modelName===e);if(l)return l}(0,dFi.softAssert)(r.length>0,"InlineEdits model list should have at least one model");let c=r.at(0);return c||this.determineDefaultModel(this._copilotTokenObs.get(),this._defaultModelConfigObs.get())}parseModelConfigString(e,r){let n;try{let o=JSON.parse(e),s=oBe.MODEL_CONFIGURATION_VALIDATOR.validate(o);if(!s.error)return s.content;n=s.error.message}catch(o){n=uFi.ErrorUtils.toString(uFi.ErrorUtils.fromUnknown(o))}this._telemetryService.sendMSFTTelemetryEvent("incorrectNesModelConfig",{configName:r.id,errorMessage:n,configValue:e})}};jD.InlineEditsModelService=CNr;jD.InlineEditsModelService=CNr=sBe=pFi([w$(0,b_c.ICopilotTokenStore),w$(1,I_c.IProxyModelsService),w$(2,R_c.IUndesiredModelsManager),w$(3,qD.IConfigurationService),w$(4,x_c.IExperimentationService),w$(5,w_c.ITelemetryService),w$(6,T_c.ILogService)],CNr);function vNr(t){let{source:e,...r}=t;return r}a(vNr,"toModelConfiguration");var fFi;(function(t){let e="copilot.chat.nextEdits.undesiredModelIds",r=class extends gFi.Disposable{static{a(this,"Manager")}constructor(o){super(),this._vscodeExtensionContext=o,this._onDidChange=this._register(new mFi.Emitter),this.onDidChange=this._onDidChange.event,this._queue=new hFi.TaskQueue}isUndesiredModelId(o){return this._getModels().includes(o)}addUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels();s.includes(o)||(s.push(o),await this._setModels(s),this._onDidChange.fire())})}removeUndesiredModelId(o){return this._queue.schedule(async()=>{let s=this._getModels(),c=s.indexOf(o);c!==-1&&(s.splice(c,1),await this._setModels(s),this._onDidChange.fire())})}_getModels(){return this._vscodeExtensionContext.globalState.get(e)??[]}_setModels(o){return new Promise((s,c)=>{this._vscodeExtensionContext.globalState.update(e,o).then(s,c)})}};r=pFi([w$(0,S_c.IVSCodeExtensionContext)],r),t.Manager=r})(fFi||(jD.UndesiredModels=fFi={}))});var yFi=I(Rvt=>{"use strict";p();Object.defineProperty(Rvt,"__esModule",{value:!0});Rvt.NullLanguageContextProviderService=void 0;var P_c=Io(),bNr=class{static{a(this,"NullLanguageContextProviderService")}registerContextProvider(e,r){return P_c.Disposable.None}getAllProviders(){return[]}getContextProviders(e){return[]}getContextItems(e,r,n){return{[Symbol.asyncIterator]:async function*(){}}}getContextItemsOnTimeout(e,r){return[]}};Rvt.NullLanguageContextProviderService=bNr});var EFi=I(Pvt=>{"use strict";p();Object.defineProperty(Pvt,"__esModule",{value:!0});Pvt.TestLanguageDiagnosticsService=void 0;var k_c=_c(),D_c=XP(),N_c=OG(),SNr=class extends N_c.AbstractLanguageDiagnosticsService{static{a(this,"TestLanguageDiagnosticsService")}constructor(){super(...arguments),this.diagnosticsMap=new D_c.ResourceMap,this._onDidChangeDiagnostics=new k_c.Emitter,this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}setDiagnostics(e,r){this.diagnosticsMap.set(e,r),this._onDidChangeDiagnostics.fire({uris:[e]})}getDiagnostics(e){return this.diagnosticsMap.get(e)||[]}getAllDiagnostics(){return Array.from(this.diagnosticsMap.entries())}};Pvt.TestLanguageDiagnosticsService=SNr});var _Fi=I(Dvt=>{"use strict";p();Object.defineProperty(Dvt,"__esModule",{value:!0});Dvt.ResponseStream=void 0;var M_c=O_(),kvt=Hx(),O_c=zc(),B_c=dS(),TNr=class t{static{a(this,"ResponseStream")}constructor(e,r,n,o){this.fetcherResponse=e,this.requestId=n,this.headers=o;let s=new O_c.DeferredPromise;this.aggregatedStream=s.p,this.response=this.aggregatedStream.then(c=>{if(c.isError())return c;try{return kvt.Result.ok(t.aggregateCompletionsStream(c.val))}catch(l){return kvt.Result.error(l)}}),this.stream=L_c(r,s)}async destroy(){await this.fetcherResponse.body.destroy()}static aggregateCompletionsStream(e){let r="",n=null,o=null,s;for(let d of e){let f=d.choices[0];r+=f.text??"",f.logprobs&&(o===null?o={tokens:[...f.logprobs.tokens],token_logprobs:[...f.logprobs.token_logprobs],text_offset:[...f.logprobs.text_offset],top_logprobs:[...f.logprobs.top_logprobs]}:(o.tokens.push(...f.logprobs.tokens),o.token_logprobs.push(...f.logprobs.token_logprobs),o.text_offset.push(...f.logprobs.text_offset),o.top_logprobs.push(...f.logprobs.top_logprobs))),d.usage&&(s===void 0?s={completion_tokens:d.usage.completion_tokens,prompt_tokens:d.usage.prompt_tokens,total_tokens:d.usage.total_tokens,completion_tokens_details:{audio_tokens:d.usage.completion_tokens_details.audio_tokens,reasoning_tokens:d.usage.completion_tokens_details.reasoning_tokens},prompt_tokens_details:{audio_tokens:d.usage.prompt_tokens_details.audio_tokens,reasoning_tokens:d.usage.prompt_tokens_details.reasoning_tokens}}:(s.completion_tokens+=d.usage.completion_tokens,s.prompt_tokens+=d.usage.prompt_tokens,s.total_tokens+=d.usage.total_tokens,s.completion_tokens_details.audio_tokens+=d.usage.completion_tokens_details.audio_tokens,s.completion_tokens_details.reasoning_tokens+=d.usage.completion_tokens_details.reasoning_tokens,s.prompt_tokens_details.audio_tokens+=d.usage.prompt_tokens_details.audio_tokens,s.prompt_tokens_details.reasoning_tokens+=d.usage.prompt_tokens_details.reasoning_tokens)),f.finish_reason&&((0,B_c.assertType)(n===null,"cannot already have finishReason if just seeing choice.finish_reason"),n=f.finish_reason)}if(e.length===0)throw new Error("Response is empty!");let c=e[0];return{choices:[{index:0,finish_reason:n,logprobs:o,text:r}],system_fingerprint:c.system_fingerprint,object:c.object,usage:s}}};Dvt.ResponseStream=TNr;async function*L_c(t,e){let r=[],n;try{for await(let o of t)r.push(o),yield o}catch(o){throw n=M_c.ErrorUtils.fromUnknown(o),n}finally{e.complete(n?kvt.Result.error(n):kvt.Result.ok(r))}}a(L_c,"streamWithAggregation")});var vFi=I(INr=>{"use strict";p();Object.defineProperty(INr,"__esModule",{value:!0});INr.jsonlStreamToCompletions=F_c;async function*F_c(t){for await(let e of t)if(e.trim()!=="data: [DONE]"&&e.startsWith("data: ")){let r=JSON.parse(e.substring(6));if(r.error)throw new Error(r.error.message);yield r}}a(F_c,"jsonlStreamToCompletions")});var bFi=I(I6=>{"use strict";p();var U_c=I6&&I6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},xNr=I6&&I6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(I6,"__esModule",{value:!0});I6.CompletionsFetchService=void 0;var Q_c=Y2r(),CFi=O_(),Wre=Hx(),q_c=kpr(),j_c=CE(),H_c=i6(),G_c=iy(),$_c=Rge(),R$=tyt(),V_c=_Fi(),W_c=vFi(),wNr=class{static{a(this,"CompletionsFetchService")}constructor(e,r,n){this.authService=e,this.fetcherService=r,this.requestLogger=n}disconnectAll(){return this.fetcherService.disconnectAll()}async fetch(e,r,n,o,s,c){let l=Date.now();if(s.isCancellationRequested){let f=Wre.Result.error(new R$.Completions.RequestCancelled);return this._logCompletionsRequest(e,n,o,l,f),f}let u={requestId:o,headers:this.getHeaders(o,r,c),body:JSON.stringify({...n,stream:!0})},d=await this._fetchFromUrl(e,u,s);if(d.isError())return this._logCompletionsRequest(e,n,o,l,d),d;if(d.val.status===200){let f=Q_c.AsyncIterUtilsExt.splitLines(d.val.body),h=(0,W_c.jsonlStreamToCompletions)(f),m=new V_c.ResponseStream(d.val.response,h,d.val.requestId,d.val.headers),g=Wre.Result.ok(m);return this._logCompletionsRequest(e,n,o,l,g),g}else{let f=new R$.Completions.UnsuccessfulResponse(d.val.status,d.val.statusText,d.val.headers,()=>Y_c(d.val.body).catch(()=>"")),h=Wre.Result.error(f);return this._logCompletionsRequest(e,n,o,l,h),h}}async _fetchFromUrl(e,r,n){let o=this.fetcherService.makeAbortController(),s=n.onCancellationRequested(()=>{o.abort()});try{let c={headers:r.headers,body:r.body,signal:o.signal,method:"POST",callSite:"nes-completions"},l=await this.fetcherService.fetch(e,c);if(l.status===200&&this.authService.copilotToken?.isFreeUser&&this.authService.copilotToken?.isChatQuotaExceeded&&this.authService.resetCopilotToken(),l.status!==200)return l.status===402&&(this.authService.copilotToken?.isCompletionsQuotaExceeded||(this.authService.resetCopilotToken(l.status),await this.authService.getCopilotToken())),Wre.Result.error(new R$.Completions.UnsuccessfulResponse(l.status,l.statusText,l.headers,()=>l.text().catch(()=>"")));let u=l.body.pipeThrough(new TextDecoderStream),d=z_c(u,s);return Wre.Result.ok({status:l.status,statusText:l.statusText,headers:l.headers,body:d,requestId:(0,H_c.getRequestId)(l.headers),response:l})}catch(c){if(s.dispose(),c instanceof Error&&c.message==="This operation was aborted")return Wre.Result.error(new R$.Completions.RequestCancelled);let l=CFi.ErrorUtils.fromUnknown(c);return Wre.Result.error(new R$.Completions.Unexpected(l))}}_logCompletionsRequest(e,r,n,o,s){if(s.isOk())s.val.response.then(l=>{let u=l.isOk()?"success":"failed";this._emitCompletionsLogEntry(e,r,n,o,u,l)});else{let c=s.err;c instanceof R$.Completions.RequestCancelled?this._emitCompletionsLogEntry(e,r,n,o,"cancelled",void 0):c instanceof R$.Completions.UnsuccessfulResponse?this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,`${c.status} ${c.statusText}`):c instanceof R$.Completions.Unexpected&&this._emitCompletionsLogEntry(e,r,n,o,"failed",void 0,c.error.message)}}_emitCompletionsLogEntry(e,r,n,o,s,c,l){let u=Date.now()-o,d=[];if(d.push("> \u{1F6A8} Note: This log may contain personal information such as the contents of your files. Please review the contents carefully before sharing."),d.push("# completions"),d.push(""),d.push("- [Metadata](#metadata)"),d.push("- [Prompt](#prompt)"),r.suffix&&d.push("- [Suffix](#suffix)"),d.push("- [Response](#response)"),d.push(""),d.push("## Metadata"),d.push("
"),d.push(`url              : ${e}`),d.push(`requestId        : ${n}`),d.push(`model            : ${r.model??"(default)"}`),d.push(`maxTokens        : ${r.max_tokens}`),d.push(`temperature      : ${r.temperature}`),d.push(`top_p            : ${r.top_p}`),d.push(`n                : ${r.n}`),d.push(`duration         : ${u}ms`),d.push("
"),d.push(""),d.push("## Prompt"),d.push("~~~"),d.push(r.prompt),d.push("~~~"),r.suffix&&(d.push(""),d.push("## Suffix"),d.push("~~~"),d.push(r.suffix),d.push("~~~")),d.push(""),d.push("## Response"),s==="cancelled")d.push("## CANCELED");else if(s==="failed")d.push(`## FAILED: ${l}`);else if(c)if(c.isOk()){let h=c.val,m=h.choices[0]?.text??"",g=h.choices[0]?.finish_reason??"unknown";d.push("~~~"),d.push(m||""),d.push("~~~"),d.push(""),d.push("
"),d.push(`finishReason     : ${g}`),h.usage&&(d.push(`promptTokens     : ${h.usage.prompt_tokens}`),d.push(`completionTokens : ${h.usage.completion_tokens}`),d.push(`totalTokens      : ${h.usage.total_tokens}`)),d.push("
")}else d.push(`## FAILED: stream error - ${c.err.message}`);let f=s==="success"?void 0:q_c.Codicon.error;this.requestLogger.addEntry({type:"MarkdownContentRequest",debugName:"Completions Request",startTimeMs:o,icon:f,markdownContent:d.join(` +`)})}getHeaders(e,r,n={}){return{"Content-Type":"application/json","x-policy-id":"nil",Authorization:"Bearer "+r,"X-Request-Id":e,"X-GitHub-Api-Version":"2025-04-01",...n}}};I6.CompletionsFetchService=wNr;I6.CompletionsFetchService=wNr=U_c([xNr(0,j_c.IAuthenticationService),xNr(1,G_c.IFetcherService),xNr(2,$_c.IRequestLogger)],wNr);async function*z_c(t,e){try{for await(let r of t)yield r}catch(r){throw CFi.ErrorUtils.fromUnknown(r)}finally{e.dispose()}}a(z_c,"streamWithCleanup");async function Y_c(t){let e=[];for await(let r of t)e.push(r);return e.join("")}a(Y_c,"collectAsyncIterableToString")});var TFi=I(Nvt=>{"use strict";p();Object.defineProperty(Nvt,"__esModule",{value:!0});Nvt.WireTypes=void 0;var P$=jH(),SFi;(function(t){let e;(function(o){function s(c){return!!c&&typeof c=="object"&&typeof c.promptStrategy=="string"}a(s,"is"),o.is=s,o.validator=(0,P$.vObj)({promptStrategy:(0,P$.vString)()})})(e=t.Capabilities||(t.Capabilities={}));let r;(function(o){o.validator=(0,P$.vObj)({serviceType:(0,P$.vString)(),name:(0,P$.vString)(),provider:(0,P$.vString)(),capabilities:e.validator});function s(c){return!!c&&typeof c=="object"&&typeof c.serviceType=="string"&&typeof c.name=="string"&&typeof c.provider=="string"&&e.is(c.capabilities)}a(s,"is"),o.is=s})(r=t.Model||(t.Model={}));let n;(function(o){o.validator=(0,P$.vObj)({models:(0,P$.vArray)(r.validator)});function s(c){return!!c&&typeof c=="object"&&Array.isArray(c.models)&&c.models.every(r.is)}a(s,"is"),o.is=s})(n=t.ModelList||(t.ModelList={}))})(SFi||(Nvt.WireTypes=SFi={}))});var xFi=I(x6=>{"use strict";p();var K_c=x6&&x6.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},Mvt=x6&&x6.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(x6,"__esModule",{value:!0});x6.ProxyModelsService=void 0;var J_c=require("util"),RNr=O_(),Z_c=ik(),X_c=_c(),evc=Io(),IFi=m2(),tvc=Y7(),rvc=wE(),nvc=TFi(),ivc=Ap(),ovc=iy(),PNr=class extends evc.Disposable{static{a(this,"ProxyModelsService")}constructor(e,r,n,o){super(),this._tokenStore=e,this._capiClient=r,this._fetchService=n,this._logService=o,this._onModelListUpdated=this._register(new X_c.Emitter),this.onModelListUpdated=this._onModelListUpdated.event;let s=(0,IFi.observableFromEvent)(this,this._tokenStore.onDidStoreUpdate,()=>this._tokenStore.copilotToken);this._register((0,IFi.autorun)(c=>{let l=s.read(c),u=new Z_c.CancellationTokenSource;this._fetchLatestModels(l,u.token).then(d=>{d!==void 0&&(u.token.isCancellationRequested||(0,J_c.isDeepStrictEqual)(this._models,d)||(this._models=d,this._onModelListUpdated.fire()))}).catch(d=>{let f=RNr.ErrorUtils.fromUnknown(d);this._logService.error(f,"Failed to fetch models in autorun")}),c.store.add({dispose:a(()=>u.dispose(!0),"dispose")})}))}get models(){return this._models}get nesModels(){return this._models?.models.filter(e=>e.serviceType==="NESChat")}get cursorJumpModels(){return this._models?.models.filter(e=>e.serviceType==="CursorJumpChat")}get instantApplyModels(){return this._models?.models.filter(e=>e.serviceType==="InstantApplyChat")}async _fetchLatestModels(e,r){if(!e)return;let n=`${this._capiClient.proxyBaseURL}/models`,o=this._fetchService.makeAbortController(),s=r.onCancellationRequested(()=>o.abort()),c;try{c=await this._fetchService.fetch(n,{headers:{Authorization:`Bearer ${e.token}`},method:"GET",timeout:1e4,callSite:"proxy-models",signal:o.signal})}catch(l){let u=RNr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to fetch model list");return}finally{s.dispose()}if(!c.ok){this._logService.error(`Failed to fetch model list: ${c.status} ${c.statusText}`);return}try{let l=await c.json(),u=nvc.WireTypes.ModelList.validator.validate(l);if(u.error)throw new Error(`Invalid /models response data: ${u.error.message}`);return u.content}catch(l){let u=RNr.ErrorUtils.fromUnknown(l);this._logService.error(u,"Failed to process /models response");return}}};x6.ProxyModelsService=PNr;x6.ProxyModelsService=PNr=K_c([Mvt(0,tvc.ICopilotTokenStore),Mvt(1,rvc.ICAPIClientService),Mvt(2,ovc.IFetcherService),Mvt(3,ivc.ILogService)],PNr)});var wFi=I(Ovt=>{"use strict";p();Object.defineProperty(Ovt,"__esModule",{value:!0});Ovt.NullRequestLogger=void 0;var svc=Bkr(),avc=_c(),kNr=class extends svc.AbstractRequestLogger{static{a(this,"NullRequestLogger")}constructor(){super(...arguments),this.onDidChangeRequests=avc.Event.None}addPromptTrace(){}addEntry(e){}getRequests(){return[]}getRequestById(e){}logModelListCall(e,r,n){}logToolCall(e,r,n,o){}};Ovt.NullRequestLogger=kNr});var VNr=I(fd=>{"use strict";p();var QNr=fd&&fd.__decorate||function(t,e,r,n){var o=arguments.length,s=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(c=t[l])&&(s=(o<3?c(s):o>3?c(e,r,s):c(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},HD=fd&&fd.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(fd,"__esModule",{value:!0});fd.SimpleExperimentationService=fd.LogLevel=fd.ILanguageContextProviderService=fd.IIgnoreService=fd.IExperimentationService=fd.IEndpointProvider=fd.ICAPIClientService=fd.IAuthenticationService=void 0;fd.createNESProvider=eCc;fd.createInlineCompletionsProvider=rCc;var cvc=dri(),RFi=_ee(),PFi=ebi(),kFi=ome(),lvc=d0t(),DFi=jCr(),uvc=HCr(),wv=_E(),NFi=YCr(),dvc=Axi(),fvc=JA(),MFi=vbr(),pvc=pG(),OFi=xbr(),BFi=xOe(),LFi=Wbr(),FFi=Ybr(),UFi=dwr(),NNr=$mt(),hvc=XNi(),mvc=eMi(),aBe=Tl(),gvc=gge(),Avc=VCr(),QFi=Gwr(),qFi=ebr(),jFi=ZAt(),HFi=WIr(),GFi=Bgt(),cBe=Ogt(),$Fi=kG(),VFi=Ygt(),yvc=iMi(),Evc=Vgt(),WFi=uEr(),zFi=qb(),YFi=PMe(),KFi=Kte(),_vc=AMi(),vvc=mOi(),MNr=BOi(),JFi=EPr(),Cvc=X4i(),ZFi=Kkr(),bvc=g3i(),qNr=CE();Object.defineProperty(fd,"IAuthenticationService",{enumerable:!0,get:a(function(){return qNr.IAuthenticationService},"get")});var Svc=RMe(),XFi=Y7(),Tvc=A3i(),Ivc=P3i(),xvc=l6(),wvc=CPr(),Rvc=k3i(),Pvc=bPr(),e8i=TPr(),$4=Sl(),kvc=N3i(),Dvc=Jkr(),Nvc=U3i(),jNr=wE();Object.defineProperty(fd,"ICAPIClientService",{enumerable:!0,get:a(function(){return jNr.ICAPIClientService},"get")});var Mvc=o$(),HNr=gOe();Object.defineProperty(fd,"IEndpointProvider",{enumerable:!0,get:a(function(){return HNr.IEndpointProvider},"get")});var a8i=q3i(),Ovc=H3i(),zre=r4(),Bvc=G3i(),Lvc=nNr(),c8i=$3i(),lBe=kte();Object.defineProperty(fd,"IIgnoreService",{enumerable:!0,get:a(function(){return lBe.IIgnoreService},"get")});var Fvc=Bre(),Uvc=Zut(),DNr=e_t(),Qvc=V3i(),qvc=oFi(),jvc=cFi(),Hvc=AFi(),GNr=Dgt();Object.defineProperty(fd,"ILanguageContextProviderService",{enumerable:!0,get:a(function(){return GNr.ILanguageContextProviderService},"get")});var l8i=yFi(),u8i=OG(),d8i=EFi(),GD=Ap(),Gvc=tyt(),$vc=bFi(),$Nr=iy(),t8i=f6(),Vvc=kkr(),Wvc=Dkr(),zvc=jEt(),Yvc=G_t(),Kvc=xFi(),f8i=Rge(),p8i=wFi(),r8i=s2r(),n8i=TRr(),dBe=_p();Object.defineProperty(fd,"IExperimentationService",{enumerable:!0,get:a(function(){return dBe.IExperimentationService},"get")});var h8i=Bh(),i8i=Gge(),Jvc=wyr(),o8i=B_t(),s8i=J7(),ONr=G2r(),m8i=tn(),Zvc=ik(),uBe=_c(),Uvt=Io(),Xvc=fm(),hi=Y$e(),g8i=Ms(),Yre;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(Yre||(fd.LogLevel=Yre={}));function eCc(t){return tCc(t).createInstance(BNr,t)}a(eCc,"createNESProvider");var BNr=class extends Uvt.Disposable{static{a(this,"NESProvider")}constructor(e,r,n,o,s){super(),this._options=e,this._expService=n,this._configurationService=o,this._workspaceService=s;let c=r.createInstance(bvc.XtabProvider),l=r.createInstance(Qvc.ObservableGit),u=new qvc.NesHistoryContextProvider(this._options.workspace,l),d=this._configurationService.getExperimentBasedConfig($4.ConfigKey.TeamInternal.InlineEditsXtabDiffNEntries,this._expService),f=new jvc.NesXtabHistoryTracker(this._options.workspace,d,o,n);this._debugRecorder=this._register(new _vc.DebugRecorder(this._options.workspace)),this._nextEditProvider=r.createInstance(vvc.NextEditProvider,this._options.workspace,c,u,f,this._debugRecorder),this._telemetrySender=this._register(r.createInstance(MNr.TelemetrySender,this._options.workspace))}getId(){return this._nextEditProvider.ID}handleShown(e){e.telemetryBuilder.setAsShown(),this._nextEditProvider.handleShown(e.internalResult)}handleAcceptance(e){e.telemetryBuilder.setAcceptance("accepted"),e.telemetryBuilder.setStatus("accepted"),this._nextEditProvider.handleAcceptance(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleRejection(e){e.telemetryBuilder.setAcceptance("rejected"),e.telemetryBuilder.setStatus("rejected"),this._nextEditProvider.handleRejection(e.docId,e.internalResult),this.handleEndOfLifetime(e)}handleIgnored(e,r){r&&e.telemetryBuilder.setSupersededBy(r.requestUuid),this._nextEditProvider.handleIgnored(e.docId,e.internalResult,r?.internalResult),this.handleEndOfLifetime(e)}handleEndOfLifetime(e){try{this._telemetrySender.sendTelemetryForBuilder(e.telemetryBuilder)}finally{e.telemetryBuilder.dispose()}}async getNextEdit(e,r){let n=Fvc.DocumentId.create(e.toString()),o={triggerKind:1,selectedCompletionInfo:void 0,requestUuid:(0,Xvc.generateUuid)(),requestIssuedDateTime:Date.now(),earliestShownDateTime:Date.now()+200,enforceCacheDelay:!0},s=new Uvc.InlineEditRequestLogContext(e.toString(),1,o),c=this._options.workspace.getDocument(n);if(!c)throw new Error("DocumentNotFound");let l=new MNr.NextEditProviderTelemetryBuilder(new c8i.NullGitExtensionService,void 0,this._workspaceService,this._nextEditProvider.ID,c,this._debugRecorder,s.recordingBookmark);l.setOpportunityId(o.requestUuid);try{let u=await this._nextEditProvider.getNextEdit(n,o,s,r,l.nesBuilder);return{result:u.result?.edit?{newText:u.result.edit.newText,range:u.result.edit.replaceRange,...u.result.targetDocumentId?{targetDocumentUri:u.result.targetDocumentId.uri}:{}}:void 0,docId:n,requestUuid:o.requestUuid,internalResult:u,telemetryBuilder:l}}catch(u){try{this._telemetrySender.sendTelemetryForBuilder(l)}finally{l.dispose()}throw u}}updateTreatmentVariables(e){this._expService instanceof Kre&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=$4.globalConfigRegistry.configs.get(`${$4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}}};BNr=QNr([HD(1,g8i.IInstantiationService),HD(2,dBe.IExperimentationService),HD(3,$4.IConfigurationService),HD(4,ONr.IWorkspaceService)],BNr);function tCc(t){let{fetcher:e,copilotTokenManager:r,telemetrySender:n,logTarget:o}=t,s=new m8i.InstantiationServiceBuilder;s.define($4.IConfigurationService,new hi.SyncDescriptor(Bvt,[t.configOverrides??new Map])),s.define(dBe.IExperimentationService,new hi.SyncDescriptor(Kre,[t.waitForTreatmentVariables])),s.define(r8i.ISimulationTestContext,new hi.SyncDescriptor(r8i.NulSimulationTestContext)),s.define(ONr.IWorkspaceService,new hi.SyncDescriptor(ONr.NullWorkspaceService)),s.define(Dvc.IDiffService,new hi.SyncDescriptor(Nvc.DiffServiceImpl,[!1])),s.define(GD.ILogService,new hi.SyncDescriptor(GD.LogServiceImpl,[[o||new GD.ConsoleLog(void 0,GD.LogLevel.Trace)]])),s.define(Lvc.IGitExtensionService,new hi.SyncDescriptor(c8i.NullGitExtensionService)),s.define(GNr.ILanguageContextProviderService,new hi.SyncDescriptor(l8i.NullLanguageContextProviderService)),s.define(u8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(d8i.TestLanguageDiagnosticsService)),s.define(lBe.IIgnoreService,new hi.SyncDescriptor(lBe.NullIgnoreService)),s.define(n8i.ISnippyService,new hi.SyncDescriptor(n8i.NullSnippyService)),s.define(Mvc.IDomainService,new hi.SyncDescriptor(Ovc.DomainService)),s.define(jNr.ICAPIClientService,new hi.SyncDescriptor(a8i.CAPIClientImpl)),s.define(XFi.ICopilotTokenStore,new hi.SyncDescriptor(XFi.CopilotTokenStore)),s.define(zre.IEnvService,new hi.SyncDescriptor(Bvc.NullEnvService)),s.define($Nr.IFetcherService,new hi.SyncDescriptor(Lvt,[e])),s.define(h8i.ITelemetryService,new hi.SyncDescriptor(Fvt,[n])),s.define(qNr.IAuthenticationService,new hi.SyncDescriptor(Tvc.StaticGitHubAuthenticationService,[(0,Ivc.createStaticGitHubTokenProvider)()])),s.define(Svc.ICopilotTokenManager,r),s.define(JFi.IPowerService,new hi.SyncDescriptor(JFi.NullPowerService)),s.define(xvc.IChatMLFetcher,new hi.SyncDescriptor(Cvc.ChatMLFetcherImpl)),s.define(t8i.IChatWebSocketManager,new hi.SyncDescriptor(t8i.NullChatWebSocketManager)),s.define(zvc.IOTelService,new Vvc.NoopOTelService((0,Wvc.resolveOTelConfig)({env:{},extensionVersion:"0.0.0",sessionId:"chatlib"}))),s.define(wvc.IChatQuotaService,new hi.SyncDescriptor(Rvc.ChatQuotaService)),s.define(e8i.IInteractionService,new hi.SyncDescriptor(e8i.InteractionService)),s.define(f8i.IRequestLogger,new hi.SyncDescriptor(p8i.NullRequestLogger)),s.define(s8i.ITokenizerProvider,new hi.SyncDescriptor(s8i.TokenizerProvider,[!1])),s.define(Pvc.IConversationOptions,{_serviceBrand:void 0,maxResponseTokens:void 0,temperature:.1,topP:1,rejectionMessage:"Sorry, but I can only assist with programming related questions."}),s.define(Yvc.IProxyModelsService,new hi.SyncDescriptor(Kvc.ProxyModelsService)),s.define(DNr.IInlineEditsModelService,new hi.SyncDescriptor(Hvc.InlineEditsModelService)),s.define(DNr.IUndesiredModelsManager,t.undesiredModelsManager||new hi.SyncDescriptor(DNr.NullUndesiredModelsManager)),s.define(o8i.ITerminalService,t.terminalService||new hi.SyncDescriptor(o8i.NullTerminalService)),s.define(ZFi.ISimilarFilesContextService,new hi.SyncDescriptor(ZFi.NullSimilarFilesContextService)),s.define(HNr.IEndpointProvider,new LNr);let c=new wv.InMemoryConfigProvider(new wv.DefaultsOnlyConfigProvider);return t.configOverrides&&c.setOverrides(t.configOverrides),s.define(wv.ICompletionsConfigProvider,c),s.seal()}a(tCc,"setupServices");var Bvt=class extends kvc.DefaultsOnlyConfigurationService{static{a(this,"OverridableConfigurationService")}constructor(e){super(),this._overrides=e}async setConfig(e,r,n){if(this._overrides.get(e.id)===r)return;r===void 0?this._overrides.delete(e.id):this._overrides.set(e.id,r);let s=e.fullyQualifiedId;this._onDidChangeConfiguration.fire({affectsConfiguration:a(c=>s===c||s.startsWith(c+".")||c.startsWith(s+"."),"affectsConfiguration")})}getConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.getConfig(e):n.content}return r}return super.getConfig(e)}getExperimentBasedConfig(e,r){if(this._overrides.has(e.id)){let n=this._overrides.get(e.id);if(e.validator){let o=e.validator.validate(n);return o.error?super.getExperimentBasedConfig(e,r):o.content}return n}return super.getExperimentBasedConfig(e,r)}inspectConfig(e){if(this._overrides.has(e.id)){let r=this._overrides.get(e.id);if(e.validator){let n=e.validator.validate(r);return n.error?super.inspectConfig(e):{defaultValue:n.content}}return{defaultValue:r}}return super.inspectConfig(e)}},LNr=class{static{a(this,"NullEndpointProvider")}constructor(){this.onDidModelsRefresh=uBe.Event.None}async getAllCompletionModels(){return[]}async getAllChatEndpoints(){return[]}async getChatEndpoint(){throw new Error("not implemented")}async getEmbeddingsEndpoint(){throw new Error("not implemented")}},Kre=class extends Uvt.Disposable{static{a(this,"SimpleExperimentationService")}constructor(e,r){if(super(),this._configurationService=r,this.variables={},this._onDidTreatmentsChange=this._register(new uBe.Emitter),this.onDidTreatmentsChange=this._onDidTreatmentsChange.event,e){let n;this.waitFor=new Promise(o=>{n=o}),this.resolveWaitFor=n}else this.waitFor=Promise.resolve(),this.resolveWaitFor=()=>{}}async hasTreatments(){return this.waitFor}getTreatmentVariable(e){return this.variables[e]}async setCompletionsFilters(e){}updateTreatmentVariables(e){let r=[];for(let[n,o]of Object.entries(e))this.variables[n]!==o&&(this.variables[n]=o,r.push(n));for(let n of Object.keys(this.variables))Object.hasOwn(e,n)||(delete this.variables[n],r.push(n));r.length>0&&(this._onDidTreatmentsChange.fire({affectedTreatmentVariables:r}),this._configurationService.updateExperimentBasedConfiguration(r)),this.resolveWaitFor()}};fd.SimpleExperimentationService=Kre;fd.SimpleExperimentationService=Kre=QNr([HD(1,$4.IConfigurationService)],Kre);var Lvt=class{static{a(this,"SingleFetcherService")}constructor(e){this._fetcher=e,this.onDidFetch=uBe.Event.None,this.onDidCompleteFetch=uBe.Event.None}fetchWithPagination(e,r){return this._fetcher.fetchWithPagination(e,r)}getUserAgentLibrary(){return this._fetcher.getUserAgentLibrary()}fetch(e,r){return this._fetcher.fetch(e,r)}createWebSocket(e,r){return{webSocket:new WebSocket(e,r),responseHeaders:new $Nr.HeadersImpl({}),responseStatusCode:void 0,responseStatusText:void 0,networkError:void 0}}disconnectAll(){return this._fetcher.disconnectAll()}makeAbortController(){return this._fetcher.makeAbortController()}isAbortError(e){return this._fetcher.isAbortError(e)}isInternetDisconnectedError(e){return this._fetcher.isInternetDisconnectedError(e)}isFetcherError(e){return this._fetcher.isFetcherError(e)}isNetworkProcessCrashedError(e){return this._fetcher.isNetworkProcessCrashedError(e)}getUserMessageForFetcherError(e){return this._fetcher.getUserMessageForFetcherError(e)}},Fvt=class{static{a(this,"SimpleTelemetryService")}constructor(e){this._telemetrySender=e}dispose(){}sendInternalMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryEvent(e,r,n){}sendMSFTTelemetryErrorEvent(e,r,n){}sendGHTelemetryEvent(e,r,n){this._telemetrySender.sendTelemetryEvent(e,(0,i8i.eventPropertiesToSimpleObject)(r),n)}sendGHTelemetryErrorEvent(e,r,n){}sendGHTelemetryException(e,r){}sendTelemetryEvent(e,r,n,o){}sendTelemetryErrorEvent(e,r,n,o){}setSharedProperty(e,r){}setAdditionalExpAssignments(e){}postEvent(e,r){}sendEnhancedGHTelemetryEvent(e,r,n){this._telemetrySender.sendEnhancedTelemetryEvent&&this._telemetrySender.sendEnhancedTelemetryEvent(e,(0,i8i.eventPropertiesToSimpleObject)(r),n)}sendEnhancedGHTelemetryErrorEvent(e,r,n){}};function rCc(t){return nCc(t).createInstance(FNr)}a(rCc,"createInlineCompletionsProvider");var FNr=class extends Uvt.Disposable{static{a(this,"InlineCompletionsProvider")}constructor(e,r,n,o,s,c){super(),this._insta=e,this._expService=r,this._speculativeRequestCache=n,this._logService=o,this._configurationService=s,this._completionsConfigProvider=c,this._register(e),this.ghostText=this._insta.createInstance(hvc.GhostText)}updateTreatmentVariables(e){this._expService instanceof Kre&&this._expService.updateTreatmentVariables(e)}async setConfigs(e){for(let[r,n]of e){let o=$4.globalConfigRegistry.configs.get(`${$4.CopilotConfigPrefix}.${r}`);o&&await this._configurationService.setConfig(o,n)}this._completionsConfigProvider instanceof wv.InMemoryConfigProvider&&this._completionsConfigProvider.setCopilotSettings(Object.fromEntries(e))}async getInlineCompletions(e,r,n,o){let s=new MNr.LlmNESTelemetryBuilder(void 0,void 0,void 0,"ghostText",void 0);return await this.ghostText.getInlineCompletions(e,r,n??Zvc.CancellationToken.None,o,new cvc.GhostTextLogContext(e.uri,e.version,void 0),s,this._logService)}async inlineCompletionShown(e){return await this._speculativeRequestCache.request(e)}};FNr=QNr([HD(0,g8i.IInstantiationService),HD(1,dBe.IExperimentationService),HD(2,NNr.ICompletionsSpeculativeRequestCache),HD(3,GD.ILogService),HD(4,$4.IConfigurationService),HD(5,wv.ICompletionsConfigProvider)],FNr);var UNr=class{static{a(this,"UnwrappingTelemetrySender")}constructor(e){this.sender=e}sendTelemetryEvent(e,r,n){this.sender.sendTelemetryEvent(this.normalizeEventName(e),r,n)}sendEnhancedTelemetryEvent(e,r,n){this.sender.sendEnhancedTelemetryEvent&&this.sender.sendEnhancedTelemetryEvent(this.normalizeEventName(e),r,n)}normalizeEventName(e){let r=(0,Jvc.unwrapEventNameFromPrefix)(e),n=r.match(/^[^/]+\/(.*)/);return n?n[1]:r}};function nCc(t){let{fetcher:e,authService:r,statusHandler:n,documentManager:o,workspace:s,telemetrySender:c,urlOpener:l,editorSession:u}=t,d=t.logTarget||new GD.ConsoleLog(void 0,GD.LogLevel.Trace),f=new m8i.InstantiationServiceBuilder;f.define(aBe.ICompletionsLogTargetService,new class{logIt(m,g,...A){d.logIt(this.toExternalLogLevel(m),g,...A)}toExternalLogLevel(m){switch(m){case aBe.LogLevel.DEBUG:return Yre.Debug;case aBe.LogLevel.INFO:return Yre.Info;case aBe.LogLevel.WARN:return Yre.Warning;case aBe.LogLevel.ERROR:return Yre.Error;default:return Yre.Info}}}),f.define(qNr.IAuthenticationService,r),f.define(GD.ILogService,new hi.SyncDescriptor(GD.LogServiceImpl,[[d||new GD.ConsoleLog(void 0,GD.LogLevel.Trace)]])),f.define(lBe.IIgnoreService,t.ignoreService||new lBe.NullIgnoreService),f.define(h8i.ITelemetryService,new hi.SyncDescriptor(Fvt,[new UNr(c)])),f.define($4.IConfigurationService,new hi.SyncDescriptor(Bvt,[t.configOverrides??new Map])),f.define(dBe.IExperimentationService,new hi.SyncDescriptor(Kre,[t.waitForTreatmentVariables])),f.define(HNr.IEndpointProvider,t.endpointProvider),f.define(jNr.ICAPIClientService,t.capiClientService||new hi.SyncDescriptor(a8i.CAPIClientImpl)),f.define($Nr.IFetcherService,new hi.SyncDescriptor(Lvt,[e])),f.define(RFi.ICompletionsTelemetryService,new hi.SyncDescriptor(RFi.CompletionsTelemetryServiceBridge)),f.define(KFi.ICompletionsRuntimeModeService,KFi.RuntimeMode.fromEnvironment(t.isRunningInTest??!1)),f.define(BFi.ICompletionsCacheService,new BFi.CompletionsCache);let h=new wv.InMemoryConfigProvider(new wv.DefaultsOnlyConfigProvider);return t.configOverrides&&h.setOverrides(t.configOverrides),f.define(wv.ICompletionsConfigProvider,h),f.define(UFi.ICompletionsLastGhostText,new UFi.LastGhostText),f.define(FFi.ICompletionsCurrentGhostText,new FFi.CurrentGhostText),f.define(NNr.ICompletionsSpeculativeRequestCache,new NNr.SpeculativeRequestCache),f.define(Avc.ICompletionsNotificationSender,new class{async showWarningMessage(m,...g){return await t.notificationSender.showWarningMessage(m,...g)}}),f.define(wv.ICompletionsEditorAndPluginInfo,new class{getEditorInfo(){return t.editorInfo}getEditorPluginInfo(){return t.editorPluginInfo}getRelatedPluginInfo(){return t.relatedPluginInfo}}),f.define(PFi.ICompletionsExtensionStatus,new PFi.CopilotExtensionStatus),f.define(fvc.ICompletionsFeaturesService,new hi.SyncDescriptor(dvc.Features)),f.define(uvc.ICompletionsObservableWorkspace,new class{get openDocuments(){return s.openDocuments}getWorkspaceRoot(m){return s.getWorkspaceRoot(m)}getFirstOpenDocument(){return s.getFirstOpenDocument()}getDocument(m){return s.getDocument(m)}}),f.define(jFi.ICompletionsStatusReporter,new class extends jFi.StatusReporter{didChange(m){n.didChange(m)}}),f.define(kFi.ICompletionsCopilotTokenManager,new hi.SyncDescriptor(kFi.CopilotTokenManagerImpl,[!1])),f.define(zFi.ICompletionsTextDocumentManagerService,new hi.SyncDescriptor(class extends zFi.TextDocumentManager{constructor(){super(...arguments),this.onDidChangeTextDocument=o.onDidChangeTextDocument,this.onDidOpenTextDocument=o.onDidOpenTextDocument,this.onDidCloseTextDocument=o.onDidCloseTextDocument,this.onDidFocusTextDocument=o.onDidFocusTextDocument,this.onDidChangeWorkspaceFolders=o.onDidChangeWorkspaceFolders}getTextDocumentsUnsafe(){return o.getTextDocumentsUnsafe()}findNotebook(m){return o.findNotebook(m)}getWorkspaceFolders(){return o.getWorkspaceFolders()}})),f.define(MFi.ICompletionsFileReaderService,new hi.SyncDescriptor(MFi.FileReader)),f.define(LFi.ICompletionsBlockModeConfig,new hi.SyncDescriptor(LFi.ConfigBlockModeConfig)),f.define(WFi.ICompletionsTelemetryUserConfigService,new hi.SyncDescriptor(WFi.TelemetryUserConfig)),f.define(VFi.ICompletionsRecentEditsProviderService,new hi.SyncDescriptor(VFi.FullRecentEditsProvider,[void 0])),f.define(DFi.ICompletionsNotifierService,new hi.SyncDescriptor(DFi.CompletionNotifier)),f.define(QFi.ICompletionsOpenAIFetcherService,new hi.SyncDescriptor(QFi.LiveOpenAIFetcher)),f.define(Gvc.ICompletionsFetchService,new hi.SyncDescriptor($vc.CompletionsFetchService)),f.define(qFi.ICompletionsModelManagerService,new hi.SyncDescriptor(qFi.AvailableModelsManager,[!0])),f.define(OFi.ICompletionsAsyncManagerService,new hi.SyncDescriptor(OFi.AsyncCompletionManager)),f.define(GFi.ICompletionsContextProviderBridgeService,new hi.SyncDescriptor(GFi.ContextProviderBridge)),f.define(NFi.ICompletionsUserErrorNotifierService,new hi.SyncDescriptor(NFi.UserErrorNotifier)),f.define(Evc.ICompletionsRelatedFilesProviderService,new hi.SyncDescriptor(yvc.CompositeRelatedFilesProvider)),f.define(pvc.ICompletionsFileSystemService,new mvc.LocalFileSystem),f.define(cBe.ICompletionsContextProviderRegistryService,new hi.SyncDescriptor(cBe.CachedContextProviderRegistry,[cBe.CoreContextProviderRegistry,(m,g,A)=>t.contextProviderMatch(g,A)])),f.define(YFi.ICompletionsPromiseQueueService,new YFi.PromiseQueue),f.define(lvc.ICompletionsCitationManager,new class{register(){return Uvt.Disposable.None}async handleIPCodeCitation(m){if(t.citationHandler)return await t.citationHandler.handleIPCodeCitation(m)}}),f.define($Fi.ICompletionsContextProviderService,new $Fi.ContextProviderStatistics),f.define(HFi.ICompletionsPromptFactoryService,new hi.SyncDescriptor(HFi.CompletionsPromptFactory)),f.define(gvc.ICompletionsFetcherService,new class{getImplementation(){return this}fetch(m,g){return e.fetch(m,g)}disconnectAll(){return e.disconnectAll()}}),f.define(cBe.ICompletionsDefaultContextProviders,new cBe.DefaultContextProvidersContainer),f.define(zre.IEnvService,new class{constructor(){this.language=void 0,this.sessionId=u.sessionId,this.machineId=u.machineId,this.devDeviceId=u.machineId,this.vscodeVersion=t.editorInfo.version,this.isActive=!0,this.onDidChangeWindowState=uBe.Event.None,this.remoteName=u.remoteName,this.uiKind=u.uiKind==="web"?"web":"desktop",this.OS=process.platform==="darwin"?zre.OperatingSystem.Macintosh:process.platform==="win32"?zre.OperatingSystem.Windows:zre.OperatingSystem.Linux,this.uriScheme="",this.extensionId=t.editorPluginInfo.name,this.appRoot=t.editorInfo.root??"",this.shell=""}isProduction(){return wv.BuildInfo.isProduction()}isPreRelease(){return wv.BuildInfo.isPreRelease()}isSimulation(){return t.isRunningInTest===!0}getBuildType(){return wv.BuildInfo.getBuildType()===wv.BuildType.DEV?"dev":"prod"}getVersion(){return wv.BuildInfo.getVersion()}getBuild(){return wv.BuildInfo.getBuild()}getName(){return t.editorInfo.name}getEditorInfo(){return new zre.NameAndVersion(t.editorInfo.name,t.editorInfo.version)}getEditorPluginInfo(){return new zre.NameAndVersion(t.editorPluginInfo.name,t.editorPluginInfo.version)}async openExternal(m){return await l.open(m.toString()),!0}}),f.define(GNr.ILanguageContextProviderService,t.languageContextProvider??new l8i.NullLanguageContextProviderService),f.define(u8i.ILanguageDiagnosticsService,t.languageDiagnosticsService||new hi.SyncDescriptor(d8i.TestLanguageDiagnosticsService)),f.define(f8i.IRequestLogger,new hi.SyncDescriptor(p8i.NullRequestLogger)),f.seal()}a(nCc,"setupCompletionServices")});function Ft(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function xe(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var r1=_e(()=>{p();a(Ft,"__classPrivateFieldSet");a(xe,"__classPrivateFieldGet")});var jAe,Jvt=_e(()=>{p();jAe=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return jAe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"uuid4")});function D6(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var _Be,HAe=_e(()=>{p();a(D6,"isAbortError");_Be=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)},"castToError")});var fr,fh,ly,k$,GAe,$Ae,VAe,WAe,zAe,YAe,KAe,JAe,ZAe,Rf=_e(()=>{p();HAe();fr=class extends Error{static{a(this,"AnthropicError")}},fh=class t extends fr{static{a(this,"APIError")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new k$({message:n,cause:_Be(r)});let s=r,c=s?.error?.type;return e===400?new $Ae(e,s,n,o,c):e===401?new VAe(e,s,n,o,c):e===403?new WAe(e,s,n,o,c):e===404?new zAe(e,s,n,o,c):e===409?new YAe(e,s,n,o,c):e===422?new KAe(e,s,n,o,c):e===429?new JAe(e,s,n,o,c):e>=500?new ZAe(e,s,n,o,c):new t(e,s,n,o,c)}},ly=class extends fh{static{a(this,"APIUserAbortError")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},k$=class extends fh{static{a(this,"APIConnectionError")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},GAe=class extends k${static{a(this,"APIConnectionTimeoutError")}constructor({message:e}={}){super({message:e??"Request timed out."})}},$Ae=class extends fh{static{a(this,"BadRequestError")}},VAe=class extends fh{static{a(this,"AuthenticationError")}},WAe=class extends fh{static{a(this,"PermissionDeniedError")}},zAe=class extends fh{static{a(this,"NotFoundError")}},YAe=class extends fh{static{a(this,"ConflictError")}},KAe=class extends fh{static{a(this,"UnprocessableEntityError")}},JAe=class extends fh{static{a(this,"RateLimitError")}},ZAe=class extends fh{static{a(this,"InternalServerError")}}});function Zvt(t){return typeof t!="object"?{}:t??{}}function TMr(t){if(!t)return!0;for(let e in t)return!1;return!0}function b6i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var Gbc,C6i,OE,SMr,S6i,Xvt,V4=_e(()=>{p();Rf();Gbc=/^[a-z][a-z0-9+.-]*:/i,C6i=a(t=>Gbc.test(t),"isAbsoluteURL"),OE=a(t=>(OE=Array.isArray,OE(t)),"isArray"),SMr=OE;a(Zvt,"maybeObj");a(TMr,"isEmptyObj");a(b6i,"hasOwn");S6i=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new fr(`${t} must be an integer`);if(e<0)throw new fr(`${t} must be a positive integer`);return e},"validatePositiveInteger"),Xvt=a(t=>{try{return JSON.parse(t)}catch{return}},"safeJSON")});var VD,XAe=_e(()=>{p();VD=a((t,e)=>new Promise(r=>{if(e?.aborted)return r();let n=a(()=>{clearTimeout(o),r()},"onAbort"),o=setTimeout(()=>{e?.removeEventListener("abort",n),r()},t);e?.addEventListener("abort",n,{once:!0})}),"sleep")});var xR,vBe=_e(()=>{p();xR="0.98.0"});function $bc(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function Wbc(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}var w6i,Vbc,T6i,I6i,x6i,CBe,eCt=_e(()=>{p();vBe();w6i=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","isRunningInBrowser");a($bc,"getDetectedPlatform");Vbc=a(()=>{let t=$bc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xR,"X-Stainless-OS":I6i(Deno.build.os),"X-Stainless-Arch":T6i(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xR,"X-Stainless-OS":I6i(globalThis.process.platform??"unknown"),"X-Stainless-Arch":T6i(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=Wbc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":xR,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"getPlatformProperties");a(Wbc,"getBrowserInfo");T6i=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","normalizeArch"),I6i=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"normalizePlatform"),CBe=a(()=>x6i??(x6i=Vbc()),"getPlatformHeaders")});function R6i(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function IMr(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function tCt(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return IMr({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function bBe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function P6i(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var eye=_e(()=>{p();a(R6i,"getDefaultFetch");a(IMr,"makeReadableStream");a(tCt,"ReadableStreamFrom");a(bBe,"ReadableStreamToAsyncIterable");a(P6i,"CancelReadableStream")});var k6i,D6i=_e(()=>{p();k6i=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"FallbackEncoder")});var xMr,wMr,RMr,N6i,PMr=_e(()=>{p();xMr="RFC3986",wMr=a(t=>String(t),"default_formatter"),RMr={RFC1738:a(t=>String(t).replace(/%20/g,"+"),"RFC1738"),RFC3986:wMr},N6i="RFC1738"});function O6i(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function DMr(t,e){if(OE(t)){let r=[];for(let n=0;n{p();PMr();V4();rCt=a((t,e)=>(rCt=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),rCt(t,e)),"has"),W4=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),kMr=1024,M6i=a((t,e,r,n,o)=>{if(t.length===0)return t;let s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),r==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});let c="";for(let l=0;l=kMr?s.slice(l,l+kMr):s,d=[];for(let f=0;f=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===N6i&&(h===40||h===41)){d[d.length]=u.charAt(f);continue}if(h<128){d[d.length]=W4[h];continue}if(h<2048){d[d.length]=W4[192|h>>6]+W4[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=W4[224|h>>12]+W4[128|h>>6&63]+W4[128|h&63];continue}f+=1,h=65536+((h&1023)<<10|u.charCodeAt(f)&1023),d[d.length]=W4[240|h>>18]+W4[128|h>>12&63]+W4[128|h>>6&63]+W4[128|h&63]}c+=d.join("")}return c},"encode");a(O6i,"is_buffer");a(DMr,"maybe_map")});function Kbc(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function Q6i(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_){let v=t,b=_,T=0,w=!1;for(;(b=b.get(NMr))!==void 0&&!w;){let N=b.get(t);if(T+=1,typeof N<"u"){if(N===T)throw new RangeError("Cyclic object value");w=!0}typeof b.get(NMr)>"u"&&(T=0)}if(typeof d=="function"?v=d(e,v):v instanceof Date?v=m?.(v):r==="comma"&&OE(v)&&(v=DMr(v,function(N){return N instanceof Date?m?.(N):N})),v===null){if(s)return u&&!y?u(e,vm.encoder,E,"key",g):e;v=""}if(Kbc(v)||O6i(v)){if(u){let N=y?e:u(e,vm.encoder,E,"key",g);return[A?.(N)+"="+A?.(u(v,vm.encoder,E,"value",g))]}return[A?.(e)+"="+A?.(String(v))]}let R=[];if(typeof v>"u")return R;let x;if(r==="comma"&&OE(v))y&&u&&(v=DMr(v,u)),x=[{value:v.length>0?v.join(",")||null:void 0}];else if(OE(d))x=d;else{let N=Object.keys(v);x=f?N.sort(f):N}let P=l?String(e).replace(/\./g,"%2E"):String(e),D=n&&OE(v)&&v.length===1?P+"[]":P;if(o&&OE(v)&&v.length===0)return D+"[]";for(let N=0;N"u"?t.encodeDotInKeys?!0:vm.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:vm.addQueryPrefix,allowDots:c,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:vm.allowEmptyArrays,arrayFormat:s,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:vm.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?vm.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:vm.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:vm.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:vm.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:vm.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:vm.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:vm.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:vm.strictNullHandling}}function q6i(t,e={}){let r=t,n=Jbc(e),o,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):OE(n.filter)&&(s=n.filter,o=s);let c=[];if(typeof r!="object"||r===null)return"";let l=F6i[n.arrayFormat],u=l==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let d=new WeakMap;for(let m=0;m0?h+f:""}var F6i,U6i,L6i,vm,NMr,j6i=_e(()=>{p();B6i();PMr();V4();F6i={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},U6i=a(function(t,e){Array.prototype.push.apply(t,OE(e)?e:[e])},"push_to_array"),vm={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:M6i,encodeValuesOnly:!1,format:xMr,formatter:wMr,indices:!1,serializeDate(t){return(L6i??(L6i=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};a(Kbc,"is_non_nullish_primitive");NMr={};a(Q6i,"inner_stringify");a(Jbc,"normalize_stringify_options");a(q6i,"stringify")});function H6i(t){return q6i(t,{arrayFormat:"brackets"})}var MMr=_e(()=>{p();j6i();a(H6i,"stringifyQuery")});function iCt(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new jc(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new jc(`Refusing to send credential over non-https token endpoint "${t}"`)}async function oCt(t,e){let r=await e1c(t),n;try{n=JSON.parse(r)}catch{throw new jc(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,n1(r),e)}if(!n.access_token)throw new jc(`Token endpoint response missing access_token: ${JSON.stringify(n1(n))}`,t.status,n1(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new jc(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,n1(n),e);return n}function n1(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=OMr?t:t.slice(0,OMr)+`... <${t.length-OMr} more chars>`}return JSON.stringify(n1(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))Xbc.has(r)&&(e[r]=n);return e}return null}async function sCt(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new jc(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new jc(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function aCt(t,e){let r=await import("node:fs"),o=(await import("node:path")).dirname(t);await r.promises.mkdir(o,{recursive:!0,mode:448});let s=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let c=await r.promises.open(s,"w",384);try{await c.writeFile(JSON.stringify(e,null,2)),await c.sync()}finally{await c.close()}await r.promises.rename(s,t)}catch(c){throw await r.promises.unlink(s).catch(()=>{}),c}try{let c=await r.promises.open(o,"r");try{await c.sync()}finally{await c.close()}}catch{}}async function e1c(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>G6i){let l=G6i-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}var $6i,V6i,nCt,Jre,W6i,z6i,tye,Y6i,G6i,OMr,Xbc,jc,rye=_e(()=>{p();Rf();$6i="urn:ietf:params:oauth:grant-type:jwt-bearer",V6i="refresh_token",nCt="/v1/oauth/token",Jre="oauth-2025-04-20",W6i="oidc-federation-2026-04-01",z6i=120,tye=30,Y6i=5,G6i=1<<20;a(iCt,"requireSecureTokenEndpoint");a(oCt,"parseTokenResponse");OMr=2e3,Xbc=new Set(["error","error_description","error_uri"]);a(n1,"redactSensitive");a(sCt,"checkCredentialsFileSafety");a(aCt,"writeCredentialsFileAtomic");a(e1c,"readLimitedText");jc=class extends fr{static{a(this,"WorkloadIdentityError")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}}});function WD(){return Math.floor(Date.now()/1e3)}var SBe=_e(()=>{p();a(WD,"nowAsSeconds")});var cCt,K6i=_e(()=>{p();rye();SBe();cCt=class{static{a(this,"TokenCache")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-WD();return n>z6i?r.token:n>tye?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||WD()-this.lastAdvisoryError{this.lastAdvisoryError=WD(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}}});var ma,TBe=_e(()=>{p();ma=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"readEnv")});function X6i(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function nye(t){let e;return(J6i??(e=new globalThis.TextEncoder,J6i=e.encode.bind(e)))(t)}function BMr(t){let e;return(Z6i??(e=new globalThis.TextDecoder,Z6i=e.decode.bind(e)))(t)}var J6i,Z6i,lCt=_e(()=>{p();a(X6i,"concatBytes");a(nye,"encodeUTF8");a(BMr,"decodeUTF8")});var e9i=_e(()=>{p();Rf();lCt()});function IBe(){}function uCt(t,e,r){return!e||dCt[t]>dCt[r]?IBe:e[t].bind(e)}function ll(t){let e=t.logger,r=t.logLevel??"off";if(!e)return t1c;let n=t9i.get(e);if(n&&n[0]===r)return n[1];let o={error:uCt("error",e,r),warn:uCt("warn",e,r),info:uCt("info",e,r),debug:uCt("debug",e,r)};return t9i.set(e,[r,o]),o}var dCt,LMr,t1c,t9i,N6,M6=_e(()=>{p();V4();dCt={off:0,error:200,warn:300,info:400,debug:500},LMr=a((t,e,r)=>{if(t){if(b6i(dCt,t))return t;ll(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(dCt))}`)}},"parseLogLevel");a(IBe,"noop");a(uCt,"makeLogFn");t1c={error:IBe,warn:IBe,info:IBe,debug:IBe},t9i=new WeakMap;a(ll,"loggerFor");N6=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="api-key"||e.toLowerCase()==="x-api-key"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"formatRequestDetails")});var FMr=_e(()=>{p();V4();e9i();TBe();M6();Jvt();XAe();MMr()});function r9i(t){if(!t)throw new Error("profile name is empty");if(t==="."||t==="..")throw new Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw new Error(`profile name "${t}" must not contain path separators`);if(!r1c.test(t))throw new Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}var fCt,r1c,n9i,i9i,UMr,n1c,o9i,QMr=_e(()=>{p();eCt();FMr();fCt="1.0",r1c=/^[A-Za-z0-9_.-]+$/;a(r9i,"validateProfileName");n9i=a(async t=>{var e,r;let n=await UMr();if(n===null)return null;let o=t??await o9i();if(o===null)return null;r9i(o);let s=await import("node:fs"),l=(await import("node:path")).join(n,"configs",`${o}.json`),u;try{u=await s.promises.readFile(l,"utf-8")}catch(h){if(h?.code!=="ENOENT")throw new Error(`failed to read config file ${l}: ${h}`);u=null}if(u===null){let h=ma("ANTHROPIC_ORGANIZATION_ID"),m=ma("ANTHROPIC_IDENTITY_TOKEN_FILE"),g=ma("ANTHROPIC_FEDERATION_RULE_ID");return g&&h?{fromFile:!1,config:{organization_id:h,workspace_id:ma("ANTHROPIC_WORKSPACE_ID"),base_url:ma("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:g,service_account_id:ma("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:m?{source:"file",path:m}:void 0,scope:ma("ANTHROPIC_SCOPE")}}}:null}let d;try{d=JSON.parse(u)}catch(h){throw new Error(`failed to parse config file ${l}: ${h}`)}if(!d.authentication)throw new Error(`config file ${l} is missing "authentication"`);let f=d.authentication.type;if(f!=="oidc_federation"&&f!=="user_oauth")throw new Error(`authentication.type "${f}" is not a known authentication type`);if(d.organization_id??(d.organization_id=ma("ANTHROPIC_ORGANIZATION_ID")),d.workspace_id??(d.workspace_id=ma("ANTHROPIC_WORKSPACE_ID")),d.base_url??(d.base_url=ma("ANTHROPIC_BASE_URL")),(e=d.authentication).scope??(e.scope=ma("ANTHROPIC_SCOPE")),d.authentication.type==="oidc_federation"){if(!d.authentication.identity_token){let h=ma("ANTHROPIC_IDENTITY_TOKEN_FILE");h&&(d.authentication.identity_token={source:"file",path:h})}d.authentication.federation_rule_id||(d.authentication.federation_rule_id=ma("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=d.authentication).service_account_id??(r.service_account_id=ma("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:d,fromFile:!0}},"loadConfigWithSource"),i9i=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await UMr();if(!r)return null;let n=e??await o9i();return n?(r9i(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"getCredentialsPath"),UMr=a(async()=>{if(!n1c())return null;let t=await import("node:path"),e=ma("ANTHROPIC_CONFIG_DIR");if(e)return e;if(CBe()["X-Stainless-OS"]==="Windows"){let s=ma("APPDATA");if(s)return t.join(s,"Anthropic");let c=ma("USERPROFILE");return c?t.join(c,"AppData","Roaming","Anthropic"):null}let n=ma("XDG_CONFIG_HOME");if(n)return t.join(n,"anthropic");let o=ma("HOME");return o?t.join(o,".config","anthropic"):null},"getRootConfigPath"),n1c=a(()=>{let t=CBe()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"supportsLocalConfigFiles"),o9i=a(async()=>{let t=await UMr();if(!t)return null;let e=ma("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),o=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(o,"utf-8")).trim()||"default"}catch(s){if(s?.code!=="ENOENT")throw new Error(`failed to read ${o}: ${s}`);return"default"}},"getActiveProfileName")});function qMr(t){if(!t)throw new fr("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new fr(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new fr(`Identity token file at ${t} is empty`);return n}}function s9i(t){if(!t)throw new fr("Identity token value is empty");return()=>t}var a9i=_e(()=>{p();Rf();a(qMr,"identityTokenFromFile");a(s9i,"identityTokenFromValue")});function c9i(t){return async()=>{iCt(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16*1024)throw new jc(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:$6i,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${nCt}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${Jre},${W6i}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${xR} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new jc(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=n1(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new jc(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await oCt(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new jc(`Token endpoint response missing required fields: ${JSON.stringify(n1(c))}`,o.status,n1(c),s);return{token:c.access_token,expiresAt:WD()+l}}}var l9i=_e(()=>{p();rye();SBe();vBe();a(c9i,"oidcFederationProvider")});function u9i(t){return async e=>{let r=await import("node:fs");await sCt(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new jc(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new jc(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new jc(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||WD()"");throw new jc(`User OAuth refresh failed (HTTP ${f.status}): ${n1(E)}`,f.status,n1(E),h)}let m=await oCt(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new jc(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(n1(m))}`,f.status,n1(m),h);let A=WD()+g,y=m.refresh_token||l;return await aCt(t.credentialsPath,{...o,version:fCt,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}var d9i=_e(()=>{p();QMr();rye();SBe();vBe();a(u9i,"userOAuthProvider")});function jMr(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=i1c(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function f9i(t,e){let r=await n9i(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await i9i(n,e)??void 0}};return jMr(s,t)}function i1c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=o1c(o);if(!s)throw new jc("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new jc("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new jc("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=c9i({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?s1c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new jc("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return u9i({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new jc(`authentication.type "${o}" is not a known authentication type`)}}}function o1c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new jc(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new jc('identity_token.source "file" requires a non-empty path');return qMr(t.identity_token.path)}let e=ma("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return qMr(e);let r=ma("ANTHROPIC_IDENTITY_TOKEN");return r?s9i(r):null}function s1c(t,e,r,n){return async o=>{let s=await import("node:fs");await sCt(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||WD(){p();TBe();QMr();rye();SBe();a9i();l9i();d9i();a(jMr,"resolveCredentialsFromConfig");a(f9i,"defaultCredentials");a(i1c,"buildProvider");a(o1c,"resolveIdentityTokenProvider");a(s1c,"cachedExchangeProvider")});function a1c(t,e){for(let o=e??0;o{p();r1();lCt();O6=class{static{a(this,"LineDecoder")}constructor(){KT.set(this,void 0),JT.set(this,void 0),Ft(this,KT,new Uint8Array,"f"),Ft(this,JT,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?nye(e):e;Ft(this,KT,X6i([xe(this,KT,"f"),r]),"f");let n=[],o;for(;(o=a1c(xe(this,KT,"f"),xe(this,JT,"f")))!=null;){if(o.carriage&&xe(this,JT,"f")==null){Ft(this,JT,o.index,"f");continue}if(xe(this,JT,"f")!=null&&(o.index!==xe(this,JT,"f")+1||o.carriage)){n.push(BMr(xe(this,KT,"f").subarray(0,xe(this,JT,"f")-1))),Ft(this,KT,xe(this,KT,"f").subarray(xe(this,JT,"f")),"f"),Ft(this,JT,null,"f");continue}let s=xe(this,JT,"f")!==null?o.preceding-1:o.preceding,c=BMr(xe(this,KT,"f").subarray(0,s));n.push(c),Ft(this,KT,xe(this,KT,"f").subarray(o.index),"f"),Ft(this,JT,null,"f")}return n}flush(){return xe(this,KT,"f").length?this.decode(` +`):[]}};KT=new WeakMap,JT=new WeakMap;O6.NEWLINE_CHARS=new Set([` +`,"\r"]);O6.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(a1c,"findNewlineIndex");a(h9i,"findDoubleNewlineIndex")});async function*c1c(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");let r=new GMr,n=new O6,o=bBe(t.body);for await(let s of l1c(o))for(let c of n.decode(s)){let l=r.decode(c);l&&(yield l)}for(let s of n.flush()){let c=r.decode(s);c&&(yield c)}}async function*l1c(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?nye(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let s;for(;(s=h9i(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function u1c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var xBe,z4,GMr,$Mr=_e(()=>{p();r1();Rf();eye();HMr();eye();HAe();V4();lCt();M6();Rf();z4=class t{static{a(this,"Stream")}constructor(e,r,n){this.iterator=e,xBe.set(this,void 0),this.controller=r,Ft(this,xBe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?ll(n):console;async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of c1c(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="user.tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="session.updated"||u.event==="span.model_request_start"||u.event==="span.model_request_end"||u.event==="span.outcome_evaluation_start"||u.event==="span.outcome_evaluation_ongoing"||u.event==="span.outcome_evaluation_end"||u.event==="user.define_outcome"||u.event==="agent.thread_message_received"||u.event==="agent.thread_message_sent"||u.event==="agent.session_thread_message_received"||u.event==="agent.session_thread_message_sent"||u.event==="session.thread_created"||u.event==="session.thread_status_created"||u.event==="session.thread_status_running"||u.event==="session.thread_status_idle"||u.event==="session.thread_status_rescheduled"||u.event==="session.thread_status_terminated")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=Xvt(u.data)??u.data,f=d?.error?.type;throw new fh(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(D6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new O6,u=bBe(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"iterLines");async function*c(){if(o)throw new fr("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(D6(u))return;throw u}finally{l||r.abort()}}return a(c,"iterator"),new t(c,r,n)}[(xBe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"teeIterator");return[new t(()=>o(e),this.controller,xe(this,xBe,"f")),new t(()=>o(r),this.controller,xe(this,xBe,"f"))]}toReadableStream(){let e=this,r;return IMr({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=nye(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(c1c,"_iterSSEMessages");a(l1c,"iterSSEChunks");GMr=class{static{a(this,"SSEDecoder")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=u1c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(u1c,"partition")});async function pCt(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return ll(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):z4.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let m=await r.json();return VMr(m,r)}return await r.text()})();return ll(t).debug(`[${n}] response parsed`,N6({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function VMr(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}var WMr=_e(()=>{p();$Mr();M6();a(pCt,"defaultParseResponse");a(VMr,"addRequestID")});var wBe,Zre,hCt=_e(()=>{p();r1();WMr();Zre=class t extends Promise{static{a(this,"APIPromise")}constructor(e,r,n=pCt){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,wBe.set(this,void 0),Ft(this,wBe,e,"f")}_thenUnwrap(e){return new t(xe(this,wBe,"f"),this.responsePromise,async(r,n)=>VMr(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(xe(this,wBe,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};wBe=new WeakMap});var mCt,gCt,RBe,wR,ga,pd=_e(()=>{p();r1();Rf();WMr();hCt();V4();gCt=class{static{a(this,"AbstractPage")}constructor(e,r,n,o){mCt.set(this,void 0),Ft(this,mCt,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new fr("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await xe(this,mCt,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(mCt=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},RBe=class extends Zre{static{a(this,"PagePromise")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await pCt(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},wR=class extends gCt{static{a(this,"Page")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...Zvt(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...Zvt(this.options.query),after_id:e}}:null}},ga=class extends gCt{static{a(this,"PageCursor")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...Zvt(this.options.query),page:e}}:null}}});function Xre(t,e,r){return YMr(),new File(t,e??"unknown_file",r)}function PBe(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function f1c(t){let e=typeof t=="function"?t:t.fetch,r=m9i.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return m9i.set(e,n),n}var YMr,KMr,iye,m9i,p1c,h1c,zMr,oye=_e(()=>{p();eye();YMr=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"checkFileSupport");a(Xre,"makeFile");a(PBe,"getName");KMr=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","isAsyncIterable"),iye=a(async(t,e,r=!0)=>({...t,body:await p1c(t.body,e,r)}),"multipartFormRequestOptions"),m9i=new WeakMap;a(f1c,"supportsFormData");p1c=a(async(t,e,r=!0)=>{if(!await f1c(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>zMr(n,o,s,r))),n},"createForm"),h1c=a(t=>t instanceof Blob&&"name"in t,"isNamedBlob"),zMr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,Xre([await r.blob()],PBe(r,n),o))}else if(KMr(r))t.append(e,Xre([await new Response(tCt(r)).blob()],PBe(r,n)));else if(h1c(r))t.append(e,Xre([r],PBe(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>zMr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>zMr(t,`${e}[${o}]`,s,n)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"addFormValue")});async function ACt(t,e,r){if(YMr(),t=await t,e||(e=PBe(t,!0)),m1c(t))return t instanceof File&&e==null&&r==null?t:Xre([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(g1c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),Xre(await JMr(o),e,r)}let n=await JMr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return Xre(n,e,r)}async function JMr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(g9i(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(KMr(t))for await(let r of t)e.push(...await JMr(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${A1c(t)}`)}return e}function A1c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var g9i,m1c,g1c,A9i=_e(()=>{p();oye();oye();g9i=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","isBlobLike"),m1c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&g9i(t),"isFileLike"),g1c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","isResponseLike");a(ACt,"toFile");a(JMr,"getBytes");a(A1c,"propsForError")});var ZMr=_e(()=>{p();A9i()});var y9i=_e(()=>{p()});var mi,Dl=_e(()=>{p();mi=class{static{a(this,"APIResource")}constructor(e){this._client=e}}});function*E1c(t){if(!t)return;if(E9i in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():SMr(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let s=SMr(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}var E9i,vt,gc=_e(()=>{p();V4();E9i=Symbol.for("brand.privateNullableHeaders");a(E1c,"iterateHeaders");vt=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of E1c(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[E9i]:!0,values:e,nulls:r}},"buildHeaders")});function yCt(t){return typeof t=="object"&&t!==null&&kBe in t}function XMr(t,e){let r=new Set;if(t)for(let n of t)yCt(n)&&r.add(n[kBe]);if(e){for(let n of e)if(yCt(n)&&r.add(n[kBe]),Array.isArray(n.content))for(let o of n.content)yCt(o)&&r.add(o[kBe])}return Array.from(r)}function ECt(t,e){let r=XMr(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function _9i(t){return yCt(t)?{"x-stainless-helper":t[kBe]}:{}}var kBe,DBe=_e(()=>{p();kBe=Symbol("anthropic.sdk.stainlessHelper");a(yCt,"wasCreatedByStainlessHelper");a(XMr,"collectStainlessHelpers");a(ECt,"stainlessHelperHeader");a(_9i,"stainlessHelperHeaderFromFile")});function C9i(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var v9i,_1c,nr,Pf=_e(()=>{p();Rf();a(C9i,"encodeURIPath");v9i=Object.freeze(Object.create(null)),_1c=a((t=C9i)=>a(function(r,...n){if(r.length===1)return r[0];let o=!1,s=[],c=r.reduce((f,h,m)=>{/[?#]/.test(h)&&(o=!0);let g=n[m],A=(o?encodeURIComponent:t)(""+g);return m!==n.length&&(g==null||typeof g=="object"&&g.toString===Object.getPrototypeOf(Object.getPrototypeOf(g.hasOwnProperty??v9i)??v9i)?.toString)&&(A=g+"",s.push({start:f.length+h.length,length:A.length,error:`Value of type ${Object.prototype.toString.call(g).slice(8,-1)} is not a valid path parameter`})),f+h+(m===n.length?"":A)},""),l=c.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,d;for(;(d=u.exec(l))!==null;)s.push({start:d.index,length:d[0].length,error:`Value "${d[0]}" can't be safely passed as a path parameter`});if(s.sort((f,h)=>f.start-h.start),s.length>0){let f=0,h=s.reduce((m,g)=>{let A=" ".repeat(g.start-f),y="^".repeat(g.length);return f=g.start+g.length,m+A+y},"");throw new fr(`Path parameters result in path with invalid segments: ${s.map(m=>m.error).join(` `)} ${c} -${h}`)}return c},"path"),"createPathTagFunction"),nr=pTc(w9i)});var gye,yOr=me(()=>{p();Ml();pd();Ac();$Be();mye();Rf();gye=class extends mi{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",PR,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/files/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/files/${e}/content?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/files/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",hye({body:o,...r,headers:At([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},I9i(o.file),r?.headers])},this._client))}}});var Aye,EOr=me(()=>{p();Ml();pd();Ac();Rf();Aye=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}?beta=true`,{...n,headers:At([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",PR,{query:o,...r,headers:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var yye,_Or=me(()=>{p();Ml();pd();Ac();Rf();yye=class extends mi{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/user_profiles/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var k9i=I(Mvt=>{"use strict";p();Object.defineProperty(Mvt,"__esModule",{value:!0});Mvt.timingSafeEqual=void 0;function R9i(t,e=""){if(!t)throw new Error(e)}a(R9i,"assert");function ATc(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),R9i(t instanceof DataView),R9i(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var yTc=rI&&rI.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(rI,"__esModule",{value:!0});var T0=256,COr=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&T0,l|=d&T0,l|=f&T0,l|=h&T0;if(c>>4,l|=u&T0,l|=d&T0),c>>2,l|=f&T0),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=T0;return r+=(42-e&e-44)>>>8&-T0+e-43+62,r+=(46-e&e-48)>>>8&-T0+e-47+63,r+=(47-e&e-58)>>>8&-T0+e-48+52,r+=(64-e&e-91)>>>8&-T0+e-65+0,r+=(96-e&e-123)>>>8&-T0+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();rI.Coder=COr;var VBe=new COr;function ETc(t){return VBe.encode(t)}a(ETc,"encode");rI.encode=ETc;function _Tc(t){return VBe.decode(t)}a(_Tc,"decode");rI.decode=_Tc;var P9i=(function(t){yTc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=T0;return n+=(44-r&r-46)>>>8&-T0+r-45+62,n+=(94-r&r-96)>>>8&-T0+r-95+63,n+=(47-r&r-58)>>>8&-T0+r-48+52,n+=(64-r&r-91)>>>8&-T0+r-65+0,n+=(96-r&r-123)>>>8&-T0+r-97+26,n},e})(COr);rI.URLSafeCoder=P9i;var D9i=new P9i;function CTc(t){return D9i.encode(t)}a(CTc,"encodeURLSafe");rI.encodeURLSafe=CTc;function vTc(t){return D9i.decode(t)}a(vTc,"decodeURLSafe");rI.decodeURLSafe=vTc;rI.encodedLength=function(t){return VBe.encodedLength(t)};rI.maxDecodedLength=function(t){return VBe.maxDecodedLength(t)};rI.decodedLength=function(t){return VBe.decodedLength(t)}});var O9i=I((M9i,Ovt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof Ovt=="object"&&typeof Ovt.exports=="object"?Ovt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(M9i,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var E,_,v,b,T,w,R,x,k,D,N,L,B;y>=64;){for(E=m[0],_=m[1],v=m[2],b=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)k=h[D-2],L=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,k=h[D-15],B=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,h[D]=(L+h[D-7]|0)+(B+h[D-16]|0);for(D=0;D<64;D++)L=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,B=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+L|0,b=v,v=_,_=E,E=L+B|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(Eye,"__esModule",{value:!0});Eye.Webhook=Eye.WebhookVerificationError=void 0;var bTc=k9i(),B9i=N9i(),STc=O9i(),L9i=300,vOr=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},H$=class t extends vOr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};Eye.WebhookVerificationError=H$;var Bvt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=B9i.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new H$("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,bTc.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new H$("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${B9i.encode(STc.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new H$("Invalid Signature Headers");if(r-n>L9i)throw new H$("Message timestamp too old");if(n>r+L9i)throw new H$("Message timestamp too new");return new Date(n*1e3)}};Eye.Webhook=Bvt;Bvt.prefix="whsec_"});var U9i,_ye,bOr=me(()=>{p();Ml();U9i=ce(F9i(),1),_ye=class extends mi{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new U9i.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var Cye,SOr=me(()=>{p();Ml();pd();Ac();Rf();Cye=class extends mi{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/agents/${e}/versions?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var ane,TOr=me(()=>{p();Ml();SOr();SOr();pd();Ac();Rf();ane=class extends mi{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new Cye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(nr`/v1/agents/${e}?beta=true`,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/agents/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/agents/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ane.Versions=Cye});function cne(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var Lvt=me(()=>{p();a(cne,"linkAbort")});function G$(t,e){return t instanceof lh&&t.status===e}function Q9i(t){return t instanceof lh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function $$(t){return Q9i(t)&&!G$(t,408)&&!G$(t,409)&&!G$(t,429)}function q9i(t,e,r){return Math.min(e*2**t,r)}function IOr(t,e){return t+Math.random()*(e-t)}function j9i(t){return t*(1-Math.random()*.25)}var WBe=me(()=>{p();wf();a(G$,"isStatus");a(Q9i,"is4xx");a($$,"isFatal4xx");a(q9i,"backoff");a(IOr,"jitter");a(j9i,"applyJitter")});function Fvt(t,{authToken:e,helper:r}){if(!e)throw new dr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=At([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var xOr=me(()=>{p();wf();Ac();a(Fvt,"copyClientForHelper")});function PTc(t){return q9i(t,RTc,kTc)}function DTc(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${ZAe()}`:ZAe()}var vye,Uvt,DR,Qvt,qvt,jvt,zBe,YBe,bye,wTc,RTc,kTc,V$,Hvt=me(()=>{p();l1();wf();j6();lye();dvt();Lvt();Ac();WBe();xOr();WBe();wTc=999,RTc=1e3,kTc=6e4,V$=class{static{a(this,"WorkPoller")}constructor(e){vye.set(this,void 0),Uvt.set(this,!1),DR.set(this,void 0),Qvt.set(this,void 0),qvt.set(this,void 0),jvt.set(this,void 0),zBe.set(this,void 0),YBe.set(this,void 0),bye.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??DTc(),Lt(this,vye,Fvt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Lt(this,qvt,e.autoStop??!0,"f"),Lt(this,jvt,e.drain??!1,"f"),Lt(this,zBe,e.blockMs===void 0?wTc:e.blockMs,"f"),Lt(this,YBe,e.reclaimOlderThanMs??null,"f"),Lt(this,bye,e.requestOptions,"f"),Lt(this,DR,new AbortController,"f"),Lt(this,Qvt,cne(e.signal,ye(this,DR,"f")),"f")}get signal(){return ye(this,DR,"f").signal}abort(){ye(this,DR,"f").abort()}async*[(vye=new WeakMap,Uvt=new WeakMap,DR=new WeakMap,Qvt=new WeakMap,qvt=new WeakMap,jvt=new WeakMap,zBe=new WeakMap,YBe=new WeakMap,bye=new WeakMap,Symbol.asyncIterator)](){if(ye(this,Uvt,"f"))throw new dr("Cannot iterate over a consumed WorkPoller");Lt(this,Uvt,!0,"f");let e=dl(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!ye(this,DR,"f").signal.aborted;){let n;try{n=await ye(this,vye,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...ye(this,zBe,"f")!==null?{block_ms:ye(this,zBe,"f")}:{},...ye(this,YBe,"f")!==null?{reclaim_older_than_ms:ye(this,YBe,"f")}:{}},{headers:At([ye(this,bye,"f")?.headers]),signal:ye(this,DR,"f").signal})}catch(o){if(ye(this,DR,"f").signal.aborted)return;if($$(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=j9i(PTc(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await YD(s,ye(this,DR,"f").signal);continue}if(r=0,n==null){if(ye(this,jvt,"f"))return;await YD(IOr(1e3,3e3),ye(this,DR,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await ye(this,vye,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:At([ye(this,bye,"f")?.headers]),signal:ye(this,DR,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(ye(this,qvt,"f"))try{await ye(this,vye,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:At([ye(this,bye,"f")?.headers])})}catch(o){G$(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{ye(this,Qvt,"f").call(this)}}};a(PTc,"backoff");a(DTc,"defaultWorkerId")});var Sye,W$,Tye,Gvt,H9i=me(()=>{p();l1();Gvt=class{static{a(this,"AsyncQueue")}constructor(){Sye.set(this,[]),W$.set(this,[]),Tye.set(this,!1)}push(e){if(ye(this,Tye,"f"))return!1;let r=ye(this,W$,"f").shift();return r?r({done:!1,value:e}):ye(this,Sye,"f").push(e),!0}close(){if(!ye(this,Tye,"f"))for(Lt(this,Tye,!0,"f");ye(this,W$,"f").length>0;)ye(this,W$,"f").shift()({done:!0,value:void 0})}next(e){return ye(this,Sye,"f").length>0?Promise.resolve({done:!1,value:ye(this,Sye,"f").shift()}):ye(this,Tye,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=ye(this,W$,"f").indexOf(n);s>=0&&ye(this,W$,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");ye(this,W$,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return ye(this,Sye,"f").shift()}};Sye=new WeakMap,W$=new WeakMap,Tye=new WeakMap});var Co,lne=me(()=>{p();Co=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function wOr(t){return"name"in t?t.name:t.mcp_server_name}function NTc(t){return t instanceof Co?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function G9i(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:NTc(n),isError:!0}}}var $9i=me(()=>{p();lne();a(wOr,"toolName");a(NTc,"toolErrorContent");a(G9i,"runRunnableTool")});function Z9i(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function UTc(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function QTc(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var _m,$vt,sy,Vvt,JBe,zvt,UE,Iye,rB,une,G6,ZBe,xye,Wvt,X9i,V9i,W9i,z9i,ROr,KBe,kOr,Y9i,eUi,MTc,K9i,OTc,BTc,LTc,J9i,FTc,z$,Yvt=me(()=>{p();l1();wf();j6();lye();WBe();Lvt();H9i();Ac();$9i();MTc="SessionToolRunner",K9i=500,OTc=1e4,BTc=12e4,LTc=3e4,J9i=3,FTc=6e4;a(Z9i,"isEndTurnIdle");z$=class{static{a(this,"SessionToolRunner")}constructor(e,r){_m.add(this),$vt.set(this,!1),sy.set(this,void 0),Vvt.set(this,void 0),JBe.set(this,void 0),zvt.set(this,void 0),UE.set(this,void 0),Iye.set(this,new Set),rB.set(this,new Set),une.set(this,new Gvt),G6.set(this,0),ZBe.set(this,null),xye.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??FTc,Lt(this,UE,dl(r.client),"f"),Lt(this,zvt,new Map(r.tools.map(n=>[wOr(n),n])),"f"),Lt(this,sy,new AbortController,"f"),Lt(this,Vvt,cne(r.signal,ye(this,sy,"f")),"f"),Lt(this,JBe,r.requestOptions,"f")}get signal(){return ye(this,sy,"f").signal}abort(){ye(this,sy,"f").abort()}async*[($vt=new WeakMap,sy=new WeakMap,Vvt=new WeakMap,JBe=new WeakMap,zvt=new WeakMap,UE=new WeakMap,Iye=new WeakMap,rB=new WeakMap,une=new WeakMap,G6=new WeakMap,ZBe=new WeakMap,xye=new WeakMap,_m=new WeakSet,Symbol.asyncIterator)](){if(ye(this,$vt,"f"))throw new dr("Cannot iterate over a consumed SessionToolRunner");Lt(this,$vt,!0,"f"),ye(this,UE,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=ye(this,_m,"m",X9i).call(this).catch(r=>{ye(this,sy,"f").signal.aborted||ye(this,UE,"f").error("stream loop failed",{error:String(r)}),ye(this,sy,"f").abort()});try{for(;;){let n=await ye(this,une,"f").next(ye(this,sy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=ye(this,une,"f").tryShift())!==void 0;)yield r}finally{ye(this,sy,"f").abort(),ye(this,_m,"m",KBe).call(this),await e;try{await ye(this,_m,"m",eUi).call(this)}catch(r){ye(this,UE,"f").warn("drain failed",{error:String(r)})}ye(this,une,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){ye(this,UE,"f").warn("tool.close failed",{tool:wOr(r),error:String(n)})}ye(this,Vvt,"f").call(this)}}};Wvt=a(function(){return{...ye(this,JBe,"f"),headers:At([{"x-stainless-helper":MTc},ye(this,JBe,"f")?.headers]),signal:ye(this,sy,"f").signal}},"_SessionToolRunner_requestOptions"),X9i=a(async function(){let e=ye(this,sy,"f"),r=K9i;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},ye(this,_m,"m",Wvt).call(this));await ye(this,_m,"m",V9i).call(this);for await(let o of n)if(r=K9i,await ye(this,_m,"m",z9i).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),$$(n))throw ye(this,UE,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;ye(this,UE,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await YD(r,e.signal),r=Math.min(r*2,OTc)}},"_SessionToolRunner_streamLoop"),V9i=a(async function(){let e=ye(this,sy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},ye(this,_m,"m",Wvt).call(this)))ye(this,_m,"m",W9i).call(this,s,r),n=Z9i(s)}catch(s){e.signal.throwIfAborted(),ye(this,UE,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)ye(this,Iye,"f").delete(c.id);return}let o=r.filter(s=>!ye(this,rB,"f").has(s.id));n&&o.length===0?ye(this,_m,"m",ROr).call(this):ye(this,_m,"m",KBe).call(this);for(let s of o)await ye(this,_m,"m",kOr).call(this,s)},"_SessionToolRunner_reconcile"),W9i=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(ye(this,Iye,"f").add(e.id),ye(this,rB,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?ye(this,rB,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&ye(this,rB,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),z9i=a(async function(e){switch(Z9i(e)?ye(this,_m,"m",ROr).call(this):ye(this,_m,"m",KBe).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return ye(this,Iye,"f").has(e.id)||(ye(this,Iye,"f").add(e.id),await ye(this,_m,"m",kOr).call(this,e)),!1;case"user.tool_result":return ye(this,rB,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return ye(this,rB,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return ye(this,UE,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),ye(this,sy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),ROr=a(function(){ye(this,_m,"m",KBe).call(this),!(this.maxIdleMs<=0)&&Lt(this,xye,setTimeout(()=>{ye(this,UE,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),ye(this,sy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),KBe=a(function(){ye(this,xye,"f")!==void 0&&(clearTimeout(ye(this,xye,"f")),Lt(this,xye,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),kOr=a(async function(e){var r,n;if(!ye(this,rB,"f").has(e.id)){ye(this,UE,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Lt(this,G6,(r=ye(this,G6,"f"),r++,r),"f");try{let o=ye(this,zvt,"f").get(e.name);if(!o){ye(this,UE,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),ye(this,une,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=cne(ye(this,sy,"f").signal,l),d=setTimeout(()=>l.abort(),BTc);try{let m=await G9i(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=UTc(e,c,QTc(s)),h=await ye(this,_m,"m",Y9i).call(this,f,e.id);ye(this,une,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Lt(this,G6,(n=ye(this,G6,"f"),n--,n),"f"),ye(this,G6,"f")===0&&ye(this,ZBe,"f")?.call(this)}}},"_SessionToolRunner_execute"),Y9i=a(async function(e,r){let n=ye(this,sy,"f"),o;for(let s=0;sLt(this,ZBe,e,"f")),YD(LTc)]),Lt(this,ZBe,null,"f"),ye(this,G6,"f")>0&&ye(this,UE,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(UTc,"buildResultEvent");a(QTc,"toSessionContent")});var tUi=me(()=>{p();rOr()});function dne(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var rUi=me(()=>{p();POr();tUi();a(dne,"betaTool")});function wye(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var DOr=me(()=>{p();a(wye,"promiseWithResolvers")});async function jTc(t){try{return await nI.realpath(t)}catch{return t}}async function HTc(t){let e=[],r=t;for(;;){let n;try{n=await nI.realpath(r)}catch{let o=!1;try{o=(await nI.lstat(r)).isSymbolicLink()}catch{}if(o){r=Cm.resolve(Cm.dirname(r),await nI.readlink(r));continue}let s=Cm.dirname(r);if(s===r)return t;e.push(Cm.basename(r)),r=s;continue}return e.length?Cm.join(n,...e.reverse()):n}}async function iUi(t,e,r){let n=r?.allowOutside??!1;if(Cm.isAbsolute(e)){if(!n)throw new Co(`absolute path ${JSON.stringify(e)} not permitted`);return Cm.resolve(e)}let o=await jTc(Cm.resolve(t)),s=Cm.resolve(o,e);if(n)return s;let c=await HTc(s),l=o.endsWith(Cm.sep)?o:o+Cm.sep;if(c!==o&&!c.startsWith(l))throw new Co(`path ${JSON.stringify(e)} escapes workdir`);return c}async function NOr(t,e){let r=Cm.dirname(t),n=Cm.join(r,`.tmp-${process.pid}-${(0,nUi.randomUUID)()}`),o;try{o=await nI.open(n,"wx",qTc),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await nI.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await nI.unlink(n).catch(()=>{}),s}}function eLe(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var nI,Cm,nUi,XBe,qTc,MOr=me(()=>{p();nI=ce(require("node:fs/promises"),1),Cm=ce(require("node:path"),1),nUi=require("node:crypto");lne();XBe=493,qTc=420;a(jTc,"realpathOrSelf");a(HTc,"canonicalize");a(iUi,"confineToRoot");a(NOr,"atomicWriteFile");a(eLe,"fsErrorMessage")});async function uUi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=dl(e),o=await e.beta.sessions.retrieve(r),s=ay.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await BOr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=ay.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=ay.resolve(s,f);if(h!==s&&!h.startsWith(s+ay.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await d1.rm(h,{recursive:!0,force:!0}),await d1.mkdir(h,{recursive:!0,mode:XBe}),c.push(h),await LOr(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await d1.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function BOr(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new dr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function $Tc(t){for(let e of t.split(` -`)){let r=e.trim();if(r&&(ay.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new dr(`refusing to extract unsafe archive member: ${r}`)}}function VTc(t){for(let e of t.split(` -`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new dr("refusing to extract archive with symlink/hardlink/device member")}}async function OOr(t,e){try{let{stdout:r}=await GTc(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new dr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function WTc(t){let e,r=!1;for(let n of t.split(` -`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function LOr(t,e){let r=ay.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new dr("skill download response had no body");await(0,lUi.pipeline)(cUi.Readable.fromWeb(t.body),oUi.createWriteStream(r));let n=ay.join(ay.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await zTc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await OOr(c,s?["-Z1",r]:["-tf",r]);$Tc(l),VTc(await OOr(c,s?["-Z",r]:["-tvf",r]));let u=WTc(l);await d1.mkdir(n,{recursive:!0,mode:XBe}),await OOr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?ay.join(n,u):n;for(let f of await d1.readdir(d))await d1.rename(ay.join(d,f),ay.join(e,f))}finally{await d1.rm(r,{force:!0}),await d1.rm(n,{recursive:!0,force:!0})}}async function zTc(t,e){let r=await d1.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var d1,oUi,ay,sUi,aUi,cUi,lUi,GTc,dUi=me(()=>{p();d1=ce(require("node:fs/promises"),1),oUi=ce(require("node:fs"),1),ay=ce(require("node:path"),1),sUi=require("node:child_process"),aUi=require("node:util"),cUi=require("node:stream"),lUi=require("node:stream/promises");wf();j6();MOr();GTc=(0,aUi.promisify)(sUi.execFile);a(uUi,"setupSkills");a(BOr,"resolveSkillVersion");a($Tc,"assertSafeMemberNames");a(VTc,"assertNoSpecialMembers");a(OOr,"runArchiveTool");a(WTc,"archiveTopDir");a(LOr,"extractSkillArchive");a(zTc,"readHead")});var SUi={};wi(SUi,{BashSession:()=>Jvt,betaAgentToolset20260401:()=>XTc,betaBashTool:()=>yUi,betaEditTool:()=>CUi,betaGlobTool:()=>vUi,betaGrepTool:()=>bUi,betaReadTool:()=>EUi,betaWriteTool:()=>_Ui,extractSkillArchive:()=>LOr,resolvePath:()=>Rye,resolveSkillVersion:()=>BOr,setupSkills:()=>uUi});function XTc(t){return[yUi(t),EUi(t),_Ui(t),CUi(t),vUi(t),bUi(t)]}function Rye(t,e){return iUi(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function eIc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function yUi(t){let e,r=Promise.resolve();return dne({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=wye();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new Co("bash: command is required")}e??(e=new Jvt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??AUi,signal:c?.signal});if(f!==0)throw new Co(d||`exit ${f}`);return d}catch(d){throw d instanceof Co?d:(e.close(),e=void 0,new Co(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function EUi(t){return dne({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new Co("read: file_path is required");let n=await Rye(t,e),o;try{let f=await QE.stat(n);if(!f.isFile())throw new Co(`read: ${e} is not a regular file`);if(f.size>UOr)throw new Co(`read: ${e} is ${f.size} bytes, exceeds ${UOr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await QE.readFile(n,"utf8")}catch(f){throw f instanceof Co?f:new Co(`read: ${eLe(f,e)}`)}if(!r)return o;if(r.length!==2)throw new Co("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` +${h}`)}return c},"path"),"createPathTagFunction"),nr=_1c(C9i)});var sye,eOr=_e(()=>{p();Dl();pd();gc();DBe();oye();Pf();sye=class extends mi{static{a(this,"Files")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",wR,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/files/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/files/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",iye({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},_9i(o.file),r?.headers])},this._client))}}});var aye,tOr=_e(()=>{p();Dl();pd();gc();Pf();aye=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}?beta=true`,{...n,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",wR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var cye,rOr=_e(()=>{p();Dl();pd();gc();Pf();cye=class extends mi{static{a(this,"UserProfiles")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/user_profiles/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}}});var S9i=I(_Ct=>{"use strict";p();Object.defineProperty(_Ct,"__esModule",{value:!0});_Ct.timingSafeEqual=void 0;function b9i(t,e=""){if(!t)throw new Error(e)}a(b9i,"assert");function S1c(t,e){if(t.byteLength!==e.byteLength)return!1;t instanceof DataView||(t=new DataView(ArrayBuffer.isView(t)?t.buffer:t)),e instanceof DataView||(e=new DataView(ArrayBuffer.isView(e)?e.buffer:e)),b9i(t instanceof DataView),b9i(e instanceof DataView);let r=t.byteLength,n=0,o=-1;for(;++o{"use strict";p();var T1c=ZT&&ZT.__extends||(function(){var t=a(function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])},t(e,r)},"extendStatics");return function(e,r){t(e,r);function n(){this.constructor=e}a(n,"__"),e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})();Object.defineProperty(ZT,"__esModule",{value:!0});var I0=256,nOr=(function(){function t(e){e===void 0&&(e="="),this._paddingCharacter=e}return a(t,"Coder"),t.prototype.encodedLength=function(e){return this._paddingCharacter?(e+2)/3*4|0:(e*8+5)/6|0},t.prototype.encode=function(e){for(var r="",n=0;n>>18&63),r+=this._encodeByte(o>>>12&63),r+=this._encodeByte(o>>>6&63),r+=this._encodeByte(o>>>0&63)}var s=e.length-n;if(s>0){var o=e[n]<<16|(s===2?e[n+1]<<8:0);r+=this._encodeByte(o>>>18&63),r+=this._encodeByte(o>>>12&63),s===2?r+=this._encodeByte(o>>>6&63):r+=this._paddingCharacter||"",r+=this._paddingCharacter||""}return r},t.prototype.maxDecodedLength=function(e){return this._paddingCharacter?e/4*3|0:(e*6+7)/8|0},t.prototype.decodedLength=function(e){return this.maxDecodedLength(e.length-this._getPaddingLength(e))},t.prototype.decode=function(e){if(e.length===0)return new Uint8Array(0);for(var r=this._getPaddingLength(e),n=e.length-r,o=new Uint8Array(this.maxDecodedLength(n)),s=0,c=0,l=0,u=0,d=0,f=0,h=0;c>>4,o[s++]=d<<4|f>>>2,o[s++]=f<<6|h,l|=u&I0,l|=d&I0,l|=f&I0,l|=h&I0;if(c>>4,l|=u&I0,l|=d&I0),c>>2,l|=f&I0),c>>8&6,r+=51-e>>>8&-75,r+=61-e>>>8&-15,r+=62-e>>>8&3,String.fromCharCode(r)},t.prototype._decodeChar=function(e){var r=I0;return r+=(42-e&e-44)>>>8&-I0+e-43+62,r+=(46-e&e-48)>>>8&-I0+e-47+63,r+=(47-e&e-58)>>>8&-I0+e-48+52,r+=(64-e&e-91)>>>8&-I0+e-65+0,r+=(96-e&e-123)>>>8&-I0+e-97+26,r},t.prototype._getPaddingLength=function(e){var r=0;if(this._paddingCharacter){for(var n=e.length-1;n>=0&&e[n]===this._paddingCharacter;n--)r++;if(e.length<4||r>2)throw new Error("Base64Coder: incorrect padding")}return r},t})();ZT.Coder=nOr;var NBe=new nOr;function I1c(t){return NBe.encode(t)}a(I1c,"encode");ZT.encode=I1c;function x1c(t){return NBe.decode(t)}a(x1c,"decode");ZT.decode=x1c;var T9i=(function(t){T1c(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return a(e,"URLSafeCoder"),e.prototype._encodeByte=function(r){var n=r;return n+=65,n+=25-r>>>8&6,n+=51-r>>>8&-75,n+=61-r>>>8&-13,n+=62-r>>>8&49,String.fromCharCode(n)},e.prototype._decodeChar=function(r){var n=I0;return n+=(44-r&r-46)>>>8&-I0+r-45+62,n+=(94-r&r-96)>>>8&-I0+r-95+63,n+=(47-r&r-58)>>>8&-I0+r-48+52,n+=(64-r&r-91)>>>8&-I0+r-65+0,n+=(96-r&r-123)>>>8&-I0+r-97+26,n},e})(nOr);ZT.URLSafeCoder=T9i;var I9i=new T9i;function w1c(t){return I9i.encode(t)}a(w1c,"encodeURLSafe");ZT.encodeURLSafe=w1c;function R1c(t){return I9i.decode(t)}a(R1c,"decodeURLSafe");ZT.decodeURLSafe=R1c;ZT.encodedLength=function(t){return NBe.encodedLength(t)};ZT.maxDecodedLength=function(t){return NBe.maxDecodedLength(t)};ZT.decodedLength=function(t){return NBe.decodedLength(t)}});var R9i=I((w9i,vCt)=>{p();(function(t,e){var r={};e(r);var n=r.default;for(var o in r)n[o]=r[o];typeof vCt=="object"&&typeof vCt.exports=="object"?vCt.exports=n:typeof define=="function"&&define.amd?define(function(){return n}):t.sha256=n})(w9i,function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(h,m,g,A,y){for(var E,_,v,b,T,w,R,x,P,D,N,B,L;y>=64;){for(E=m[0],_=m[1],v=m[2],b=m[3],T=m[4],w=m[5],R=m[6],x=m[7],D=0;D<16;D++)N=A+D*4,h[D]=(g[N]&255)<<24|(g[N+1]&255)<<16|(g[N+2]&255)<<8|g[N+3]&255;for(D=16;D<64;D++)P=h[D-2],B=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=h[D-15],L=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,h[D]=(B+h[D-7]|0)+(L+h[D-16]|0);for(D=0;D<64;D++)B=(((T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7))+(T&w^~T&R)|0)+(x+(e[D]+h[D]|0)|0)|0,L=((E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10))+(E&_^E&v^_&v)|0,x=R,R=w,w=T,T=b+B|0,b=v,v=_,_=E,E=B+L|0;m[0]+=E,m[1]+=_,m[2]+=v,m[3]+=b,m[4]+=T,m[5]+=w,m[6]+=R,m[7]+=x,A+=64,y-=64}return A}a(r,"hashBlocks");var n=(function(){function h(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(h,"Hash"),h.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},h.prototype.clean=function(){for(var m=0;m0){for(;this.bufferLength<64&&g>0;)this.buffer[this.bufferLength++]=m[A++],g--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(g>=64&&(A=r(this.temp,this.state,m,A,g),g%=64);g>0;)this.buffer[this.bufferLength++]=m[A++],g--;return this},h.prototype.finish=function(m){if(!this.finished){var g=this.bytesHashed,A=this.bufferLength,y=g/536870912|0,E=g<<3,_=g%64<56?64:128;this.buffer[A]=128;for(var v=A+1;v<_-8;v++)this.buffer[v]=0;this.buffer[_-8]=y>>>24&255,this.buffer[_-7]=y>>>16&255,this.buffer[_-6]=y>>>8&255,this.buffer[_-5]=y>>>0&255,this.buffer[_-4]=E>>>24&255,this.buffer[_-3]=E>>>16&255,this.buffer[_-2]=E>>>8&255,this.buffer[_-1]=E>>>0&255,r(this.temp,this.state,this.buffer,0,_),this.finished=!0}for(var v=0;v<8;v++)m[v*4+0]=this.state[v]>>>24&255,m[v*4+1]=this.state[v]>>>16&255,m[v*4+2]=this.state[v]>>>8&255,m[v*4+3]=this.state[v]>>>0&255;return this},h.prototype.digest=function(){var m=new Uint8Array(this.digestLength);return this.finish(m),m},h.prototype._saveState=function(m){for(var g=0;gthis.blockSize)new n().update(m).finish(g).clean();else for(var A=0;A1&&m.update(h),g&&m.update(g),m.update(A),m.finish(h),A[0]++}a(l,"fillBuffer");var u=new Uint8Array(t.digestLength);function d(h,m,g,A){m===void 0&&(m=u),A===void 0&&(A=32);for(var y=new Uint8Array([1]),E=c(m,h),_=new o(E),v=new Uint8Array(_.digestLength),b=v.length,T=new Uint8Array(A),w=0;w>>24&255,_[1]=R>>>16&255,_[2]=R>>>8&255,_[3]=R>>>0&255,y.reset(),y.update(m),y.update(_),y.finish(b);for(var x=0;x{"use strict";p();Object.defineProperty(lye,"__esModule",{value:!0});lye.Webhook=lye.WebhookVerificationError=void 0;var P1c=S9i(),P9i=x9i(),k1c=R9i(),k9i=300,iOr=class t extends Error{static{a(this,"ExtendableError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="ExtendableError",this.stack=new Error(e).stack}},D$=class t extends iOr{static{a(this,"WebhookVerificationError")}constructor(e){super(e),Object.setPrototypeOf(this,t.prototype),this.name="WebhookVerificationError"}};lye.WebhookVerificationError=D$;var CCt=class t{static{a(this,"Webhook")}constructor(e,r){if(!e)throw new Error("Secret can't be empty.");if(r?.format==="raw")e instanceof Uint8Array?this.key=e:this.key=Uint8Array.from(e,n=>n.charCodeAt(0));else{if(typeof e!="string")throw new Error("Expected secret to be of type string");e.startsWith(t.prefix)&&(e=e.substring(t.prefix.length)),this.key=P9i.decode(e)}}verify(e,r){let n={};for(let m of Object.keys(r))n[m.toLowerCase()]=r[m];let o=n["webhook-id"],s=n["webhook-signature"],c=n["webhook-timestamp"];if(!s||!o||!c)throw new D$("Missing required headers");let l=this.verifyTimestamp(c),d=this.sign(o,l,e).split(",")[1],f=s.split(" "),h=new globalThis.TextEncoder;for(let m of f){let[g,A]=m.split(",");if(g==="v1"&&(0,P1c.timingSafeEqual)(h.encode(A),h.encode(d)))return JSON.parse(e.toString())}throw new D$("No matching signature found")}sign(e,r,n){if(typeof n!="string")if(n.constructor.name==="Buffer")n=n.toString();else throw new Error("Expected payload to be of type string or Buffer.");let o=new TextEncoder,s=Math.floor(r.getTime()/1e3),c=o.encode(`${e}.${s}.${n}`);return`v1,${P9i.encode(k1c.hmac(this.key,c))}`}verifyTimestamp(e){let r=Math.floor(Date.now()/1e3),n=parseInt(e,10);if(isNaN(n))throw new D$("Invalid Signature Headers");if(r-n>k9i)throw new D$("Message timestamp too old");if(n>r+k9i)throw new D$("Message timestamp too new");return new Date(n*1e3)}};lye.Webhook=CCt;CCt.prefix="whsec_"});var N9i,uye,oOr=_e(()=>{p();Dl();N9i=fe(D9i(),1),uye=class extends mi{static{a(this,"Webhooks")}unwrap(e,{headers:r,key:n}){if(r!==void 0){let o=n===void 0?this._client.webhookKey:n;if(o===null)throw new Error("Webhook key must not be null in order to unwrap");new N9i.Webhook(o).verify(e,r)}return JSON.parse(e)}}});var dye,sOr=_e(()=>{p();Dl();pd();gc();Pf();dye=class extends mi{static{a(this,"Versions")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/agents/${e}/versions?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var ene,aOr=_e(()=>{p();Dl();sOr();sOr();pd();gc();Pf();ene=class extends mi{static{a(this,"Agents")}constructor(){super(...arguments),this.versions=new dye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(nr`/v1/agents/${e}?beta=true`,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/agents/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/agents/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};ene.Versions=dye});function tne(t,e){if(!t)return()=>{};if(t.aborted)return e.abort(),()=>{};let r=a(()=>e.abort(),"onAbort");return t.addEventListener("abort",r),()=>t.removeEventListener("abort",r)}var bCt=_e(()=>{p();a(tne,"linkAbort")});function N$(t,e){return t instanceof fh&&t.status===e}function M9i(t){return t instanceof fh&&typeof t.status=="number"&&t.status>=400&&t.status<500}function M$(t){return M9i(t)&&!N$(t,408)&&!N$(t,409)&&!N$(t,429)}function O9i(t,e,r){return Math.min(e*2**t,r)}function cOr(t,e){return t+Math.random()*(e-t)}function B9i(t){return t*(1-Math.random()*.25)}var MBe=_e(()=>{p();Rf();a(N$,"isStatus");a(M9i,"is4xx");a(M$,"isFatal4xx");a(O9i,"backoff");a(cOr,"jitter");a(B9i,"applyJitter")});function SCt(t,{authToken:e,helper:r}){if(!e)throw new fr(`copyClientForHelper: expected a non-empty authToken but received ${JSON.stringify(e)}`);let n=t,o=n._options.defaultHeaders,s=n._authState?.extraHeaders,c=s?Object.fromEntries(Object.entries(s).filter(([u])=>{let d=u.toLowerCase();return d!=="authorization"&&d!=="x-api-key"})):void 0,l=vt([c,o,{"x-stainless-helper":r}]);return t.withOptions({apiKey:null,authToken:e,baseURL:t.baseURL,credentials:void 0,defaultHeaders:l})}var lOr=_e(()=>{p();Rf();gc();a(SCt,"copyClientForHelper")});function F1c(t){return O9i(t,B1c,L1c)}function U1c(){let e=globalThis.process?.env?.HOSTNAME;return e?`${e}-${jAe()}`:jAe()}var fye,TCt,RR,ICt,xCt,wCt,OBe,BBe,pye,O1c,B1c,L1c,O$,RCt=_e(()=>{p();r1();Rf();M6();XAe();Jvt();bCt();gc();MBe();lOr();MBe();O1c=999,B1c=1e3,L1c=6e4,O$=class{static{a(this,"WorkPoller")}constructor(e){fye.set(this,void 0),TCt.set(this,!1),RR.set(this,void 0),ICt.set(this,void 0),xCt.set(this,void 0),wCt.set(this,void 0),OBe.set(this,void 0),BBe.set(this,void 0),pye.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.workerId=e.workerId??U1c(),Ft(this,fye,SCt(e.client,{authToken:e.environmentKey,helper:"environments-work-poller"}),"f"),Ft(this,xCt,e.autoStop??!0,"f"),Ft(this,wCt,e.drain??!1,"f"),Ft(this,OBe,e.blockMs===void 0?O1c:e.blockMs,"f"),Ft(this,BBe,e.reclaimOlderThanMs??null,"f"),Ft(this,pye,e.requestOptions,"f"),Ft(this,RR,new AbortController,"f"),Ft(this,ICt,tne(e.signal,xe(this,RR,"f")),"f")}get signal(){return xe(this,RR,"f").signal}abort(){xe(this,RR,"f").abort()}async*[(fye=new WeakMap,TCt=new WeakMap,RR=new WeakMap,ICt=new WeakMap,xCt=new WeakMap,wCt=new WeakMap,OBe=new WeakMap,BBe=new WeakMap,pye=new WeakMap,Symbol.asyncIterator)](){if(xe(this,TCt,"f"))throw new fr("Cannot iterate over a consumed WorkPoller");Ft(this,TCt,!0,"f");let e=ll(this.client);e.info("poller starting",{component:"work-poller",environment_id:this.environmentId});try{let r=0;for(;!xe(this,RR,"f").signal.aborted;){let n;try{n=await xe(this,fye,"f").beta.environments.work.poll(this.environmentId,{"Anthropic-Worker-ID":this.workerId,...xe(this,OBe,"f")!==null?{block_ms:xe(this,OBe,"f")}:{},...xe(this,BBe,"f")!==null?{reclaim_older_than_ms:xe(this,BBe,"f")}:{}},{headers:vt([xe(this,pye,"f")?.headers]),signal:xe(this,RR,"f").signal})}catch(o){if(xe(this,RR,"f").signal.aborted)return;if(M$(o))throw e.error("poll failed permanently, stopping poller",{error:String(o)}),o;let s=B9i(F1c(r));e.warn("poll failed, backing off",{error:String(o),backoff_ms:s}),r++,await VD(s,xe(this,RR,"f").signal);continue}if(r=0,n==null){if(xe(this,wCt,"f"))return;await VD(cOr(1e3,3e3),xe(this,RR,"f").signal);continue}e.info("claimed work",{component:"work-poller",environment_id:this.environmentId,work_id:n.id,work_type:n.data.type});try{await xe(this,fye,"f").beta.environments.work.ack(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,pye,"f")?.headers]),signal:xe(this,RR,"f").signal})}catch(o){e.error("ack failed",{work_id:n.id,error:String(o)});continue}try{yield n}finally{if(xe(this,xCt,"f"))try{await xe(this,fye,"f").beta.environments.work.stop(n.id,{environment_id:n.environment_id},{headers:vt([xe(this,pye,"f")?.headers])})}catch(o){N$(o,409)||e.warn("stop failed",{work_id:n.id,error:String(o)})}}}}finally{xe(this,ICt,"f").call(this)}}};a(F1c,"backoff");a(U1c,"defaultWorkerId")});var hye,B$,mye,PCt,L9i=_e(()=>{p();r1();PCt=class{static{a(this,"AsyncQueue")}constructor(){hye.set(this,[]),B$.set(this,[]),mye.set(this,!1)}push(e){if(xe(this,mye,"f"))return!1;let r=xe(this,B$,"f").shift();return r?r({done:!1,value:e}):xe(this,hye,"f").push(e),!0}close(){if(!xe(this,mye,"f"))for(Ft(this,mye,!0,"f");xe(this,B$,"f").length>0;)xe(this,B$,"f").shift()({done:!0,value:void 0})}next(e){return xe(this,hye,"f").length>0?Promise.resolve({done:!1,value:xe(this,hye,"f").shift()}):xe(this,mye,"f")||e?.aborted?Promise.resolve({done:!0,value:void 0}):new Promise(r=>{let n=a(s=>{e?.removeEventListener("abort",o),r(s)},"waiter"),o=a(()=>{let s=xe(this,B$,"f").indexOf(n);s>=0&&xe(this,B$,"f").splice(s,1),r({done:!0,value:void 0})},"onAbort");xe(this,B$,"f").push(n),e?.addEventListener("abort",o,{once:!0})})}tryShift(){return xe(this,hye,"f").shift()}};hye=new WeakMap,B$=new WeakMap,mye=new WeakMap});var _o,rne=_e(()=>{p();_o=class extends Error{static{a(this,"ToolError")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}}});function uOr(t){return"name"in t?t.name:t.mcp_server_name}function Q1c(t){return t instanceof _o?t.content:`Error: ${t instanceof Error?t.message:String(t)}`}async function F9i(t,e,r){try{let n=t.parse?t.parse(e):e;return{content:await t.run(n,r),isError:!1}}catch(n){return{content:Q1c(n),isError:!0}}}var U9i=_e(()=>{p();rne();a(uOr,"toolName");a(Q1c,"toolErrorContent");a(F9i,"runRunnableTool")});function V9i(t){return t.type==="session.status_idle"&&t.stop_reason?.type==="end_turn"}function V1c(t,e,r){return t.type==="agent.custom_tool_use"?{type:"user.custom_tool_result",custom_tool_use_id:t.id,is_error:e,content:r}:{type:"user.tool_result",tool_use_id:t.id,is_error:e,content:r}}function W1c(t){if(typeof t=="string")return[{type:"text",text:t||"(no output)"}];let e=t.map(r=>r.type==="text"?{type:"text",text:r.text||"(no output)"}:r.type==="image"||r.type==="document"?r:r.type==="search_result"?{type:"search_result",source:r.source,title:r.title,content:r.content.map(n=>({type:"text",text:n.text})),citations:{enabled:r.citations?.enabled??!1}}:{type:"text",text:JSON.stringify(r)});return e.length>0?e:[{type:"text",text:"(no output)"}]}var Cm,kCt,uy,DCt,FBe,MCt,BE,gye,Y4,nne,B6,UBe,Aye,NCt,W9i,Q9i,q9i,j9i,dOr,LBe,fOr,H9i,z9i,q1c,G9i,j1c,H1c,G1c,$9i,$1c,L$,OCt=_e(()=>{p();r1();Rf();M6();XAe();MBe();bCt();L9i();gc();U9i();q1c="SessionToolRunner",G9i=500,j1c=1e4,H1c=12e4,G1c=3e4,$9i=3,$1c=6e4;a(V9i,"isEndTurnIdle");L$=class{static{a(this,"SessionToolRunner")}constructor(e,r){Cm.add(this),kCt.set(this,!1),uy.set(this,void 0),DCt.set(this,void 0),FBe.set(this,void 0),MCt.set(this,void 0),BE.set(this,void 0),gye.set(this,new Set),Y4.set(this,new Set),nne.set(this,new PCt),B6.set(this,0),UBe.set(this,null),Aye.set(this,void 0),this.client=r.client,this.sessionId=e,this.tools=r.tools,this.maxIdleMs=r.maxIdleMs??$1c,Ft(this,BE,ll(r.client),"f"),Ft(this,MCt,new Map(r.tools.map(n=>[uOr(n),n])),"f"),Ft(this,uy,new AbortController,"f"),Ft(this,DCt,tne(r.signal,xe(this,uy,"f")),"f"),Ft(this,FBe,r.requestOptions,"f")}get signal(){return xe(this,uy,"f").signal}abort(){xe(this,uy,"f").abort()}async*[(kCt=new WeakMap,uy=new WeakMap,DCt=new WeakMap,FBe=new WeakMap,MCt=new WeakMap,BE=new WeakMap,gye=new WeakMap,Y4=new WeakMap,nne=new WeakMap,B6=new WeakMap,UBe=new WeakMap,Aye=new WeakMap,Cm=new WeakSet,Symbol.asyncIterator)](){if(xe(this,kCt,"f"))throw new fr("Cannot iterate over a consumed SessionToolRunner");Ft(this,kCt,!0,"f"),xe(this,BE,"f").info("session tool runner starting",{component:"session-tool-runner",session_id:this.sessionId});let e=xe(this,Cm,"m",W9i).call(this).catch(r=>{xe(this,uy,"f").signal.aborted||xe(this,BE,"f").error("stream loop failed",{error:String(r)}),xe(this,uy,"f").abort()});try{for(;;){let n=await xe(this,nne,"f").next(xe(this,uy,"f").signal);if(n.done)break;yield n.value}await e;let r;for(;(r=xe(this,nne,"f").tryShift())!==void 0;)yield r}finally{xe(this,uy,"f").abort(),xe(this,Cm,"m",LBe).call(this),await e;try{await xe(this,Cm,"m",z9i).call(this)}catch(r){xe(this,BE,"f").warn("drain failed",{error:String(r)})}xe(this,nne,"f").close();for(let r of this.tools)try{await r.close?.()}catch(n){xe(this,BE,"f").warn("tool.close failed",{tool:uOr(r),error:String(n)})}xe(this,DCt,"f").call(this)}}};NCt=a(function(){return{...xe(this,FBe,"f"),headers:vt([{"x-stainless-helper":q1c},xe(this,FBe,"f")?.headers]),signal:xe(this,uy,"f").signal}},"_SessionToolRunner_requestOptions"),W9i=a(async function(){let e=xe(this,uy,"f"),r=G9i;for(;!e.signal.aborted;){try{let n=await this.client.beta.sessions.events.stream(this.sessionId,{},xe(this,Cm,"m",NCt).call(this));await xe(this,Cm,"m",Q9i).call(this);for await(let o of n)if(r=G9i,await xe(this,Cm,"m",j9i).call(this,o))return}catch(n){if(e.signal.throwIfAborted(),M$(n))throw xe(this,BE,"f").error("permanent stream failure, shutting down",{error:String(n)}),e.abort(),n;xe(this,BE,"f").warn("stream disconnected, reconnecting",{error:String(n),backoff_ms:r})}e.signal.throwIfAborted(),await VD(r,e.signal),r=Math.min(r*2,j1c)}},"_SessionToolRunner_streamLoop"),Q9i=a(async function(){let e=xe(this,uy,"f"),r=[],n=!1;try{for await(let s of this.client.beta.sessions.events.list(this.sessionId,{limit:1e3},xe(this,Cm,"m",NCt).call(this)))xe(this,Cm,"m",q9i).call(this,s,r),n=V9i(s)}catch(s){e.signal.throwIfAborted(),xe(this,BE,"f").warn("reconcile list failed",{error:String(s)});for(let c of r)xe(this,gye,"f").delete(c.id);return}let o=r.filter(s=>!xe(this,Y4,"f").has(s.id));n&&o.length===0?xe(this,Cm,"m",dOr).call(this):xe(this,Cm,"m",LBe).call(this);for(let s of o)await xe(this,Cm,"m",fOr).call(this,s)},"_SessionToolRunner_reconcile"),q9i=a(function(e,r){e.type==="agent.tool_use"||e.type==="agent.custom_tool_use"?(xe(this,gye,"f").add(e.id),xe(this,Y4,"f").has(e.id)||r.push(e)):e.type==="user.tool_result"?xe(this,Y4,"f").add(e.tool_use_id):e.type==="user.custom_tool_result"&&xe(this,Y4,"f").add(e.custom_tool_use_id)},"_SessionToolRunner_ingestHistory"),j9i=a(async function(e){switch(V9i(e)?xe(this,Cm,"m",dOr).call(this):xe(this,Cm,"m",LBe).call(this),e.type){case"agent.tool_use":case"agent.custom_tool_use":return xe(this,gye,"f").has(e.id)||(xe(this,gye,"f").add(e.id),await xe(this,Cm,"m",fOr).call(this,e)),!1;case"user.tool_result":return xe(this,Y4,"f").add(e.tool_use_id),!1;case"user.custom_tool_result":return xe(this,Y4,"f").add(e.custom_tool_use_id),!1;case"session.status_terminated":case"session.deleted":return xe(this,BE,"f").info("session terminated",{component:"session-tool-runner",session_id:this.sessionId}),xe(this,uy,"f").abort(),!0;default:return!1}},"_SessionToolRunner_handleStreamEvent"),dOr=a(function(){xe(this,Cm,"m",LBe).call(this),!(this.maxIdleMs<=0)&&Ft(this,Aye,setTimeout(()=>{xe(this,BE,"f").info("session idle after end_turn; stopping",{component:"session-tool-runner",session_id:this.sessionId,max_idle_ms:this.maxIdleMs}),xe(this,uy,"f").abort()},this.maxIdleMs),"f")},"_SessionToolRunner_armIdleTimer"),LBe=a(function(){xe(this,Aye,"f")!==void 0&&(clearTimeout(xe(this,Aye,"f")),Ft(this,Aye,void 0,"f"))},"_SessionToolRunner_disarmIdleTimer"),fOr=a(async function(e){var r,n;if(!xe(this,Y4,"f").has(e.id)){xe(this,BE,"f").info("executing tool",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),Ft(this,B6,(r=xe(this,B6,"f"),r++,r),"f");try{let o=xe(this,MCt,"f").get(e.name);if(!o){xe(this,BE,"f").info("tool not owned by this runner; leaving the tool_use_id pending for its owner",{component:"session-tool-runner",session_id:this.sessionId,tool:e.name,tool_use_id:e.id}),xe(this,nne,"f").push({event:e,toolUseId:e.id,name:e.name,isError:!1,posted:!1});return}let s,c,l=new AbortController,u=tne(xe(this,uy,"f").signal,l),d=setTimeout(()=>l.abort(),H1c);try{let m=await F9i(o,e.input,{toolUse:e,toolUseBlock:e,signal:l.signal});s=m.content,c=m.isError}finally{clearTimeout(d),u()}let f=V1c(e,c,W1c(s)),h=await xe(this,Cm,"m",H9i).call(this,f,e.id);xe(this,nne,"f").push({event:e,result:f,toolUseId:e.id,name:e.name,isError:c,posted:h})}finally{Ft(this,B6,(n=xe(this,B6,"f"),n--,n),"f"),xe(this,B6,"f")===0&&xe(this,UBe,"f")?.call(this)}}},"_SessionToolRunner_execute"),H9i=a(async function(e,r){let n=xe(this,uy,"f"),o;for(let s=0;s<$9i;s++){n.signal.throwIfAborted();try{return await this.client.beta.sessions.events.send(this.sessionId,{events:[e]},xe(this,Cm,"m",NCt).call(this)),xe(this,Y4,"f").add(r),!0}catch(c){if(o=c,M$(c))break;s<$9i-1&&await VD((s+1)*1e3,n.signal)}}return xe(this,BE,"f").error("failed to send tool result",{tool_use_id:r,error:String(o)}),!1},"_SessionToolRunner_sendResult"),z9i=a(async function(){xe(this,B6,"f")!==0&&(await Promise.race([new Promise(e=>Ft(this,UBe,e,"f")),VD(G1c)]),Ft(this,UBe,null,"f"),xe(this,B6,"f")>0&&xe(this,BE,"f").warn("drain timeout exceeded"))},"_SessionToolRunner_drain");a(V1c,"buildResultEvent");a(W1c,"toSessionContent")});var Y9i=_e(()=>{p();FMr()});function ine(t){if(t.inputSchema.type!=="object")throw new Error(`JSON schema for tool "${t.name}" must be an object, but got ${t.inputSchema.type}`);return{type:"custom",name:t.name,input_schema:t.inputSchema,description:t.description,run:t.run,parse:a(e=>e,"parse"),...t.close?{close:t.close}:{}}}var K9i=_e(()=>{p();pOr();Y9i();a(ine,"betaTool")});function yye(){let t,e;return{promise:new Promise((n,o)=>{t=n,e=o}),resolve:t,reject:e}}var hOr=_e(()=>{p();a(yye,"promiseWithResolvers")});async function Y1c(t){try{return await XT.realpath(t)}catch{return t}}async function K1c(t){let e=[],r=t;for(;;){let n;try{n=await XT.realpath(r)}catch{let o=!1;try{o=(await XT.lstat(r)).isSymbolicLink()}catch{}if(o){r=bm.resolve(bm.dirname(r),await XT.readlink(r));continue}let s=bm.dirname(r);if(s===r)return t;e.push(bm.basename(r)),r=s;continue}return e.length?bm.join(n,...e.reverse()):n}}async function Z9i(t,e,r){let n=r?.allowOutside??!1;if(bm.isAbsolute(e)){if(!n)throw new _o(`absolute path ${JSON.stringify(e)} not permitted`);return bm.resolve(e)}let o=await Y1c(bm.resolve(t)),s=bm.resolve(o,e);if(n)return s;let c=await K1c(s),l=o.endsWith(bm.sep)?o:o+bm.sep;if(c!==o&&!c.startsWith(l))throw new _o(`path ${JSON.stringify(e)} escapes workdir`);return c}async function mOr(t,e){let r=bm.dirname(t),n=bm.join(r,`.tmp-${process.pid}-${(0,J9i.randomUUID)()}`),o;try{o=await XT.open(n,"wx",z1c),await o.writeFile(e,"utf-8"),await o.sync(),await o.close(),o=void 0,await XT.rename(n,t)}catch(s){throw o&&await o.close().catch(()=>{}),await XT.unlink(n).catch(()=>{}),s}}function qBe(t,e){switch(t?.code){case"ENOENT":return`${e}: no such file or directory`;case"EACCES":case"EPERM":return`${e}: permission denied`;case"ENOTDIR":return`${e}: not a directory`;case"EISDIR":return`${e}: is a directory`;case"ELOOP":return`${e}: too many levels of symbolic links`;case"ENAMETOOLONG":return`${e}: file name too long`;case"ENOSPC":return`${e}: no space left on device`;case"EMFILE":case"ENFILE":return`${e}: too many open files`;default:return`${e}: ${t instanceof Error?t.message:String(t)}`}}var XT,bm,J9i,QBe,z1c,gOr=_e(()=>{p();XT=fe(require("node:fs/promises"),1),bm=fe(require("node:path"),1),J9i=require("node:crypto");rne();QBe=493,z1c=420;a(Y1c,"realpathOrSelf");a(K1c,"canonicalize");a(Z9i,"confineToRoot");a(mOr,"atomicWriteFile");a(qBe,"fsErrorMessage")});async function iUi(t){let{client:e,sessionId:r}=t;if(!e||!r)return async()=>{};let n=ll(e),o=await e.beta.sessions.retrieve(r),s=dy.resolve(t.workdir,"skills"),c=[];for(let l of o.agent.skills)try{let u=await yOr(e,l.skill_id,l.version),d=await e.beta.skills.versions.retrieve(u,{skill_id:l.skill_id}),f=dy.basename(d.name.trim());(f===""||f==="."||f==="..")&&(f=l.skill_id);let h=dy.resolve(s,f);if(h!==s&&!h.startsWith(s+dy.sep)){n.warn("skill name escapes the skills dir; skipping",{component:"agent-tool-context",name:d.name});continue}let m=await e.beta.skills.versions.download(u,{skill_id:l.skill_id});await i1.rm(h,{recursive:!0,force:!0}),await i1.mkdir(h,{recursive:!0,mode:QBe}),c.push(h),await EOr(m,h),n.info("downloaded skill",{component:"agent-tool-context",skill_id:l.skill_id,version:u,dest:h})}catch(u){n.warn("failed to download skill",{component:"agent-tool-context",skill_id:l.skill_id,error:String(u)})}return async()=>{for(let l of c)await i1.rm(l,{recursive:!0,force:!0}).catch(u=>{n.warn("failed to clean up skill",{component:"agent-tool-context",dest:l,error:String(u)})})}}async function yOr(t,e,r){if(/^\d+$/.test(r))return r;let n;for await(let o of t.beta.skills.versions.list(e))/^\d+$/.test(o.version)&&(n===void 0||BigInt(o.version)>BigInt(n))&&(n=o.version);if(n===void 0)throw new fr(`skill ${JSON.stringify(e)} has no concrete version to resolve ${JSON.stringify(r)} against`);return n}function Z1c(t){for(let e of t.split(` +`)){let r=e.trim();if(r&&(dy.isAbsolute(r)||r.split(/[\\/]/).includes("..")))throw new fr(`refusing to extract unsafe archive member: ${r}`)}}function X1c(t){for(let e of t.split(` +`)){let r=e.trimStart()[0];if(r==="l"||r==="h"||r==="b"||r==="c"||r==="p"||r==="s")throw new fr("refusing to extract archive with symlink/hardlink/device member")}}async function AOr(t,e){try{let{stdout:r}=await J1c(t,e);return r}catch(r){throw r!=null&&typeof r=="object"&&r.code==="ENOENT"?new fr(`skill extraction requires the \`${t}\` command, but it was not found on PATH`):r}}function eSc(t){let e,r=!1;for(let n of t.split(` +`)){let o=n.trim().split("/").filter(c=>c!==""&&c!==".");if(o.length===0)continue;let s=o[0];if(e===void 0)e=s;else if(s!==e)return"";o.length>1&&(r=!0)}return e!==void 0&&r?e:""}async function EOr(t,e){let r=dy.join(e,`.skill-archive-${process.pid}-${Date.now()}`);if(!t.body)throw new fr("skill download response had no body");await(0,nUi.pipeline)(rUi.Readable.fromWeb(t.body),X9i.createWriteStream(r));let n=dy.join(dy.dirname(e),`.skill-stage-${process.pid}-${Date.now()}`);try{let o=await tSc(r,4),s=o.length>=4&&o[0]===80&&o[1]===75&&o[2]===3&&o[3]===4,c=s?"unzip":"tar",l=await AOr(c,s?["-Z1",r]:["-tf",r]);Z1c(l),X1c(await AOr(c,s?["-Z",r]:["-tvf",r]));let u=eSc(l);await i1.mkdir(n,{recursive:!0,mode:QBe}),await AOr(c,s?["-oq",r,"-d",n]:["-xf",r,"-C",n]);let d=u?dy.join(n,u):n;for(let f of await i1.readdir(d))await i1.rename(dy.join(d,f),dy.join(e,f))}finally{await i1.rm(r,{force:!0}),await i1.rm(n,{recursive:!0,force:!0})}}async function tSc(t,e){let r=await i1.open(t,"r");try{let n=Buffer.alloc(e),{bytesRead:o}=await r.read(n,0,e,0);return n.subarray(0,o)}finally{await r.close()}}var i1,X9i,dy,eUi,tUi,rUi,nUi,J1c,oUi=_e(()=>{p();i1=fe(require("node:fs/promises"),1),X9i=fe(require("node:fs"),1),dy=fe(require("node:path"),1),eUi=require("node:child_process"),tUi=require("node:util"),rUi=require("node:stream"),nUi=require("node:stream/promises");Rf();M6();gOr();J1c=(0,tUi.promisify)(eUi.execFile);a(iUi,"setupSkills");a(yOr,"resolveSkillVersion");a(Z1c,"assertSafeMemberNames");a(X1c,"assertNoSpecialMembers");a(AOr,"runArchiveTool");a(eSc,"archiveTopDir");a(EOr,"extractSkillArchive");a(tSc,"readHead")});var yUi={};xi(yUi,{BashSession:()=>LCt,betaAgentToolset20260401:()=>sSc,betaBashTool:()=>fUi,betaEditTool:()=>mUi,betaGlobTool:()=>gUi,betaGrepTool:()=>AUi,betaReadTool:()=>pUi,betaWriteTool:()=>hUi,extractSkillArchive:()=>EOr,resolvePath:()=>Eye,resolveSkillVersion:()=>yOr,setupSkills:()=>iUi});function sSc(t){return[fUi(t),pUi(t),hUi(t),mUi(t),gUi(t),AUi(t)]}function Eye(t,e){return Z9i(t.workdir,e,{allowOutside:t.unrestrictedPaths??!1})}function aSc(){let t={};for(let[e,r]of Object.entries(process.env))e.startsWith("ANTHROPIC_")||(t[e]=r);return t}function fUi(t){let e,r=Promise.resolve();return ine({name:"bash",description:"Run a bash command in a persistent shell. State (cwd, env vars) persists across calls.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The command to run"},restart:{type:"boolean",description:"Restart the persistent shell before running"},timeout_ms:{type:"integer",description:"Per-call timeout in milliseconds"}}},run:a(async({command:n,restart:o,timeout_ms:s},c)=>{let l=r,u=yye();r=u.promise;try{await l}catch{}try{if(o&&(e?.close(),e=void 0),!n){if(o)return"bash session restarted";throw new _o("bash: command is required")}e??(e=new LCt(t.workdir,t.env));try{let{output:d,exitCode:f}=await e.exec(n,{timeoutMs:s??dUi,signal:c?.signal});if(f!==0)throw new _o(d||`exit ${f}`);return d}catch(d){throw d instanceof _o?d:(e.close(),e=void 0,new _o(`bash: ${d instanceof Error?d.message:String(d)}`))}}finally{u.resolve()}},"run"),close:a(()=>{e?.close(),e=void 0},"close")})}function pUi(t){return ine({name:"read",description:"Read a UTF-8 text file relative to the workdir.",inputSchema:{type:"object",properties:{file_path:{type:"string"},view_range:{type:"array",items:{type:"integer"},description:"[start_line, end_line] 1-indexed inclusive"}},required:["file_path"]},run:a(async({file_path:e,view_range:r})=>{if(!e)throw new _o("read: file_path is required");let n=await Eye(t,e),o;try{let f=await LE.stat(n);if(!f.isFile())throw new _o(`read: ${e} is not a regular file`);if(f.size>vOr)throw new _o(`read: ${e} is ${f.size} bytes, exceeds ${vOr}-byte limit. Use bash (head/tail/sed) to read a slice.`);o=await LE.readFile(n,"utf8")}catch(f){throw f instanceof _o?f:new _o(`read: ${qBe(f,e)}`)}if(!r)return o;if(r.length!==2)throw new _o("read: view_range must be [start_line, end_line]");let[s,c]=r,l=o.split(` `),u=Math.max(0,s-1),d=c>0?c:l.length;return l.slice(u,d).join(` -`)},"run")})}function _Ui(t){return dne({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new Co("write: file_path is required");let n=await Rye(t,e);try{await QE.mkdir(kf.dirname(n),{recursive:!0,mode:XBe}),await NOr(n,r??"")}catch(o){throw new Co(`write: ${eLe(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function CUi(t){return dne({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new Co("edit: file_path is required");if(!r)throw new Co("edit: old_string is required");let s=await Rye(t,e),c;try{let d=await QE.stat(s);if(!d.isFile())throw new Co(`edit: ${e} is not a regular file`);if(d.size>pUi)throw new Co(`edit: ${e} is ${d.size} bytes, exceeds ${pUi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await QE.readFile(s,"utf8")}catch(d){throw d instanceof Co?d:new Co(`edit: ${eLe(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new Co(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new Co(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await NOr(s,u)}catch(d){throw new Co(`edit: write: ${eLe(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function vUi(t){return dne({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new Co("glob: pattern is required");let n=kf.resolve(t.workdir),o=e;if(kf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new Co("glob: absolute pattern not permitted");n=kf.parse(e).root,o=kf.relative(n,e)}else r&&(n=await Rye(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new Co('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of ZTc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=kf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!nIc(n,l))continue;let u=0;try{u=(await QE.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new Co(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,KTc).map(c=>c.path).join(` -`))},"run")})}function bUi(t){return dne({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new Co("grep: pattern is required");let o=kf.resolve(t.workdir);r&&(o=await Rye(t,r));let s=await aIc();return s?tIc(s,e,o,n?.signal):rIc(e,o,n?.signal)},"run")})}function tIc(t,e,r,n){return new Promise((o,s)=>{let c=QOr.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>rLe&&(d=!0,l=l.slice(0,rLe),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new Co("grep: aborted"));if(d)return o(l+` -[output truncated at ${rLe} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new Co(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new Co("grep: aborted"));s(new Co(`grep: rg failed: ${f.message}`))})})}async function rIc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new Co(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=rLe,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${rLe} bytes]`),!1):(o.push(u),!0)),"push");if((await QE.stat(e).catch(()=>null))?.isFile()?await hUi(e,n,c):await sIc(e,"",u=>hUi(kf.join(e,u),n,c),r),r?.aborted)throw new Co("grep: aborted");return o.length===0?"no matches":o.join(` -`)}async function hUi(t,e,r){let n=Zvt.createReadStream(t,{encoding:"utf8"}),o=gUi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>YTc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function nIc(t,e){let r=kf.relative(t,e);return r===""||!r.startsWith(".."+kf.sep)&&r!==".."&&!kf.isAbsolute(r)}async function sIc(t,e,r,n){let o=oIc;async function s(c,l){if(l>iIc)return!0;if(n?.aborted)return!1;let u;try{u=await QE.readdir(kf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?kf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function aIc(){let t=(process.env.PATH??"").split(kf.delimiter);for(let e of t){let r=kf.join(e,"rg");try{return await QE.access(r,Zvt.constants.X_OK),r}catch{}}return null}var QE,Zvt,kf,QOr,mUi,gUi,Kvt,NC,f1,tLe,fne,NR,FOr,fUi,AUi,UOr,pUi,rLe,YTc,KTc,JTc,ZTc,Jvt,iIc,oIc,TUi=me(()=>{p();l1();QE=ce(require("node:fs/promises"),1),Zvt=ce(require("node:fs"),1),kf=ce(require("node:path"),1),QOr=ce(require("node:child_process"),1),mUi=ce(require("node:crypto"),1),gUi=ce(require("node:readline"),1);wf();lne();rUi();DOr();MOr();dUi();fUi=100*1024,AUi=12e4,UOr=256*1024,pUi=UOr,rLe=100*1024,YTc=2e3,KTc=200,JTc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,ZTc=QE.glob;a(XTc,"betaAgentToolset20260401");a(Rye,"resolvePath");a(eIc,"scrubbedShellEnv");Jvt=class{static{a(this,"BashSession")}constructor(e,r=eIc()){Kvt.add(this),NC.set(this,void 0),f1.set(this,""),tLe.set(this,!1),fne.set(this,!1),NR.set(this,null),Lt(this,NC,QOr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),ye(this,NC,"f").stdout.setEncoding("utf8"),ye(this,NC,"f").stderr.setEncoding("utf8"),ye(this,NC,"f").stdout.on("data",n=>ye(this,Kvt,"m",FOr).call(this,n)),ye(this,NC,"f").stderr.on("data",n=>ye(this,Kvt,"m",FOr).call(this,n)),ye(this,NC,"f").once("close",()=>{Lt(this,fne,!0,"f");let n=ye(this,NR,"f");Lt(this,NR,null,"f"),n?.resolve()})}get closed(){return ye(this,fne,"f")}async exec(e,r={}){if(ye(this,fne,"f"))throw new dr("bash session terminated");let n=r.timeoutMs??AUi,o=r.signal;if(o?.aborted)throw new dr("bash command aborted");Lt(this,f1,"","f"),Lt(this,tLe,!1,"f");let s=`__ANT_CMD_${mUi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} +`)},"run")})}function hUi(t){return ine({name:"write",description:"Write a UTF-8 text file relative to the workdir, creating parent directories as needed.",inputSchema:{type:"object",properties:{file_path:{type:"string"},content:{type:"string"}},required:["file_path","content"]},run:a(async({file_path:e,content:r})=>{if(!e)throw new _o("write: file_path is required");let n=await Eye(t,e);try{await LE.mkdir(kf.dirname(n),{recursive:!0,mode:QBe}),await mOr(n,r??"")}catch(o){throw new _o(`write: ${qBe(o,e)}`)}return`wrote ${Buffer.byteLength(r??"")} bytes to ${e}`},"run")})}function mUi(t){return ine({name:"edit",description:"Replace old_string with new_string in a file. old_string must be unique unless replace_all.",inputSchema:{type:"object",properties:{file_path:{type:"string"},old_string:{type:"string"},new_string:{type:"string"},replace_all:{type:"boolean"}},required:["file_path","old_string","new_string"]},run:a(async({file_path:e,old_string:r,new_string:n,replace_all:o})=>{if(!e)throw new _o("edit: file_path is required");if(!r)throw new _o("edit: old_string is required");let s=await Eye(t,e),c;try{let d=await LE.stat(s);if(!d.isFile())throw new _o(`edit: ${e} is not a regular file`);if(d.size>aUi)throw new _o(`edit: ${e} is ${d.size} bytes, exceeds ${aUi}-byte limit. Use bash (sed/awk) to edit a large file.`);c=await LE.readFile(s,"utf8")}catch(d){throw d instanceof _o?d:new _o(`edit: ${qBe(d,e)}`)}let l=c.split(r).length-1;if(l===0)throw new _o(`edit: old_string not found in ${e}`);let u;if(o)u=c.split(r).join(n);else{if(l>1)throw new _o(`edit: old_string appears ${l} times in ${e} (must be unique)`);u=c.replace(r,()=>n)}try{await mOr(s,u)}catch(d){throw new _o(`edit: write: ${qBe(d,e)}`)}return`edited ${e} (${o?l:1} replacement(s))`},"run")})}function gUi(t){return ine({name:"glob",description:"Match files under the workdir against a glob pattern. Results are mtime-sorted, newest first.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string",description:"Directory to search in. Defaults to the workdir."}},required:["pattern"]},run:a(async({pattern:e,path:r})=>{if(!e)throw new _o("glob: pattern is required");let n=kf.resolve(t.workdir),o=e;if(kf.isAbsolute(e)){if(!t.unrestrictedPaths)throw new _o("glob: absolute pattern not permitted");n=kf.parse(e).root,o=kf.relative(n,e)}else r&&(n=await Eye(t,r));if(!t.unrestrictedPaths&&o.split(/[\\/]/).includes(".."))throw new _o('glob: ".." is not permitted in the pattern');let s=[];try{for await(let c of oSc(o,{cwd:n,withFileTypes:!0,exclude:a(l=>l.name===".git"||l.name==="node_modules","exclude")})){if(!c.isFile())continue;let l=kf.join(c.parentPath,c.name);if(!t.unrestrictedPaths&&!uSc(n,l))continue;let u=0;try{u=(await LE.stat(l)).mtimeMs}catch{}s.push({path:l,mtime:u})}}catch(c){throw new _o(`glob: ${c instanceof Error?c.message:String(c)}`)}return s.length===0?"no matches":(s.sort((c,l)=>l.mtime-c.mtime),s.slice(0,nSc).map(c=>c.path).join(` +`))},"run")})}function AUi(t){return ine({name:"grep",description:"Search file contents for a regex. Uses ripgrep if available, otherwise a built-in walker.",inputSchema:{type:"object",properties:{pattern:{type:"string"},path:{type:"string"}},required:["pattern"]},run:a(async({pattern:e,path:r},n)=>{if(!e)throw new _o("grep: pattern is required");let o=kf.resolve(t.workdir);r&&(o=await Eye(t,r));let s=await hSc();return s?cSc(s,e,o,n?.signal):lSc(e,o,n?.signal)},"run")})}function cSc(t,e,r,n){return new Promise((o,s)=>{let c=COr.spawn(t,["-n","--no-heading","-e",e,"--",r],{...n?{signal:n}:{}}),l="",u="",d=!1;c.stdout.on("data",f=>{d||(l+=f,l.length>HBe&&(d=!0,l=l.slice(0,HBe),c.kill("SIGKILL")))}),c.stderr.on("data",f=>u+=f),c.on("close",f=>{if(n?.aborted)return s(new _o("grep: aborted"));if(d)return o(l+` +[output truncated at ${HBe} bytes]`);if(f===0)return o(l);if(f===1)return o("no matches");s(new _o(`grep: rg failed: ${u||`exit ${f}`}`))}),c.on("error",f=>{if(n?.aborted)return s(new _o("grep: aborted"));s(new _o(`grep: rg failed: ${f.message}`))})})}async function lSc(t,e,r){let n;try{n=new RegExp(t)}catch(u){throw new _o(`grep: invalid regex: ${u instanceof Error?u.message:String(u)}`)}let o=[],s=HBe,c=a(u=>(s-=u.length+1,s<0?(o.push(`[output truncated at ${HBe} bytes]`),!1):(o.push(u),!0)),"push");if((await LE.stat(e).catch(()=>null))?.isFile()?await cUi(e,n,c):await pSc(e,"",u=>cUi(kf.join(e,u),n,c),r),r?.aborted)throw new _o("grep: aborted");return o.length===0?"no matches":o.join(` +`)}async function cUi(t,e,r){let n=FCt.createReadStream(t,{encoding:"utf8"}),o=uUi.createInterface({input:n,crlfDelay:1/0}),s=0;try{for await(let c of o)if(s++,!(c.length>rSc)&&e.test(c)&&!r(`${t}:${s}:${c}`))return!1}catch{}finally{n.destroy()}return!0}function uSc(t,e){let r=kf.relative(t,e);return r===""||!r.startsWith(".."+kf.sep)&&r!==".."&&!kf.isAbsolute(r)}async function pSc(t,e,r,n){let o=fSc;async function s(c,l){if(l>dSc)return!0;if(n?.aborted)return!1;let u;try{u=await LE.readdir(kf.join(t,c),{withFileTypes:!0})}catch{return!0}for(let d of u){if(d.name===".git"||d.name==="node_modules")continue;if(o--<=0||n?.aborted)return!1;let f=c?kf.join(c,d.name):d.name;if(d.isDirectory()){if(!await s(f,l+1))return!1}else if(d.isFile()&&await r(f)===!1)return!1}return!0}a(s,"inner"),await s(e,0)}async function hSc(){let t=(process.env.PATH??"").split(kf.delimiter);for(let e of t){let r=kf.join(e,"rg");try{return await LE.access(r,FCt.constants.X_OK),r}catch{}}return null}var LE,FCt,kf,COr,lUi,uUi,BCt,Pv,o1,jBe,one,PR,_Or,sUi,dUi,vOr,aUi,HBe,rSc,nSc,iSc,oSc,LCt,dSc,fSc,EUi=_e(()=>{p();r1();LE=fe(require("node:fs/promises"),1),FCt=fe(require("node:fs"),1),kf=fe(require("node:path"),1),COr=fe(require("node:child_process"),1),lUi=fe(require("node:crypto"),1),uUi=fe(require("node:readline"),1);Rf();rne();K9i();hOr();gOr();oUi();sUi=100*1024,dUi=12e4,vOr=256*1024,aUi=vOr,HBe=100*1024,rSc=2e3,nSc=200,iSc=/\x1b\[[0-9;?]*[ -/]*[@-~]/g,oSc=LE.glob;a(sSc,"betaAgentToolset20260401");a(Eye,"resolvePath");a(aSc,"scrubbedShellEnv");LCt=class{static{a(this,"BashSession")}constructor(e,r=aSc()){BCt.add(this),Pv.set(this,void 0),o1.set(this,""),jBe.set(this,!1),one.set(this,!1),PR.set(this,null),Ft(this,Pv,COr.spawn("/bin/bash",["--noprofile","--norc"],{cwd:e,env:{...r,PS1:"",PS2:"",TERM:"dumb"},stdio:["pipe","pipe","pipe"],detached:!0}),"f"),xe(this,Pv,"f").stdout.setEncoding("utf8"),xe(this,Pv,"f").stderr.setEncoding("utf8"),xe(this,Pv,"f").stdout.on("data",n=>xe(this,BCt,"m",_Or).call(this,n)),xe(this,Pv,"f").stderr.on("data",n=>xe(this,BCt,"m",_Or).call(this,n)),xe(this,Pv,"f").once("close",()=>{Ft(this,one,!0,"f");let n=xe(this,PR,"f");Ft(this,PR,null,"f"),n?.resolve()})}get closed(){return xe(this,one,"f")}async exec(e,r={}){if(xe(this,one,"f"))throw new fr("bash session terminated");let n=r.timeoutMs??dUi,o=r.signal;if(o?.aborted)throw new fr("bash command aborted");Ft(this,o1,"","f"),Ft(this,jBe,!1,"f");let s=`__ANT_CMD_${lUi.randomUUID()}_DONE__`,c=`${s.slice(0,8)}''${s.slice(8)}`,l=`{ ${e} } &1; printf '\\n${c}%d\\n' $? -`;if(ye(this,NC,"f").stdin.write(l),ye(this,f1,"f").indexOf(s)<0){let{promise:g,resolve:A}=wye();Lt(this,NR,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new dr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new dr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),Lt(this,NR,null,"f")}}let u=ye(this,f1,"f").indexOf(s);if(u<0)throw new dr("bash session terminated");let f=ye(this,f1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=ye(this,f1,"f").slice(0,u).replace(JTc,"").replace(/\n+$/,"");return ye(this,tLe,"f")&&(m=`[output truncated] -${m}`),{output:m,exitCode:h}}close(){if(ye(this,fne,"f"))return;Lt(this,fne,!0,"f");let e=ye(this,NR,"f");Lt(this,NR,null,"f"),e?.resolve(),ye(this,NC,"f").stdout.destroy(),ye(this,NC,"f").stderr.destroy(),ye(this,NC,"f").stdin.destroy();try{process.kill(-ye(this,NC,"f").pid,"SIGKILL")}catch{ye(this,NC,"f").kill("SIGKILL")}ye(this,NC,"f").unref()}};NC=new WeakMap,f1=new WeakMap,tLe=new WeakMap,fne=new WeakMap,NR=new WeakMap,Kvt=new WeakSet,FOr=a(function(e){if(Lt(this,f1,ye(this,f1,"f")+e,"f"),ye(this,f1,"f").length>fUi&&(Lt(this,f1,ye(this,f1,"f").slice(ye(this,f1,"f").length-fUi),"f"),Lt(this,tLe,!0,"f")),ye(this,NR,"f")&&ye(this,f1,"f").indexOf(ye(this,NR,"f").sentinel)>=0){let r=ye(this,NR,"f");Lt(this,NR,null,"f"),r.resolve()}},"_BashSession_append");a(yUi,"betaBashTool");a(EUi,"betaReadTool");a(_Ui,"betaWriteTool");a(CUi,"betaEditTool");a(vUi,"betaGlobTool");a(bUi,"betaGrepTool");a(tIc,"runRipgrep");a(rIc,"runWalkGrep");a(hUi,"grepFile");a(nIc,"isWithin");iIc=40,oIc=5e4;a(sIc,"walk");a(aIc,"findRg")});async function lIc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:At([n?.headers])})}catch(o){G$(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function uIc(t,e,r,n,o){let s=IUi,c=cIc,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:At([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,IUi))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),$$(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await YD(s,r.signal),r.signal.throwIfAborted(),await l()}var Xvt,nLe,qOr,IUi,cIc,kye,jOr=me(()=>{p();l1();wf();j6();FBe();lye();WBe();Lvt();Ac();Yvt();Hvt();xOr();IUi=3e4,cIc="NO_HEARTBEAT",kye=class{static{a(this,"EnvironmentWorker")}constructor(e){Xvt.add(this),nLe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,Lt(this,nLe,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new dr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??ye(this,nLe,"f"),s=new V$({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await ye(this,Xvt,"m",qOr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??ya("ANTHROPIC_WORK_ID"),n=e?.environmentId??ya("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??ya("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??ya("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new dr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new dr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new dr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new dr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await ye(this,Xvt,"m",qOr).call(this,c,s,e?.signal??ye(this,nLe,"f"))}};nLe=new WeakMap,Xvt=new WeakSet,qOr=a(async function(e,r,n){let o=dl(this.client),s=Fvt(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(TUi(),SUi)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=cne(n,h),g=uIc(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new z$(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await lIc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(lIc,"forceStop");a(uIc,"heartbeatLoop")});var Y$,HOr=me(()=>{p();Ml();pd();Ac();Rf();Hvt();jOr();Hvt();jOr();Y$=class extends mi{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(nr`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/environments/${e}/work?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:At([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(nr`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new V$({...e,client:this._client})}worker(e){return new kye({...e,client:this._client})}};Y$.WorkPoller=V$;Y$.EnvironmentWorker=kye});var pne,GOr=me(()=>{p();Ml();HOr();HOr();pd();Ac();Rf();pne=class extends mi{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new Y$(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/environments/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/environments/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/environments/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/environments/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};pne.Work=Y$});var Pye,$Or=me(()=>{p();Ml();pd();Ac();Rf();Pye=class extends mi{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(nr`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:At([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memories?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:At([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Dye,VOr=me(()=>{p();Ml();pd();Ac();Rf();Dye=class extends mi{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memory_versions?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(nr`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var K$,WOr=me(()=>{p();Ml();$Or();$Or();VOr();VOr();pd();Ac();Rf();K$=class extends mi{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new Pye(this._client),this.memoryVersions=new Dye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};K$.Memories=Pye;K$.MemoryVersions=Dye});var Nye=me(()=>{p();wf()});var Mye,zOr=me(()=>{p();wf();uye();aOr();Mye=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new H6;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new dr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new dr("Attempted to iterate over a response with no body");return new t(BBe(e.body),r)}}});var Oye,YOr=me(()=>{p();Ml();pd();Ac();zOr();Nye();Rf();Oye=class extends mi{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",PR,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new dr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:At([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Mye.fromResponse(l.response,l.controller))}}});var ebt,KOr=me(()=>{p();ebt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function xUi(t){return t?.output_format??t?.output_config?.format}function JOr(t,e,r){let n=xUi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:ZOr(t,e,r)}function ZOr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=AIc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function AIc(t,e){let r=xUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var XOr=me(()=>{p();wf();a(xUi,"getOutputFormat");a(JOr,"maybeParseBetaMessage");a(ZOr,"parseBetaMessage");a(AIc,"parseBetaOutputFormat")});var yIc,Bye,EIc,_Ic,tbt,e5r=me(()=>{p();yIc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),Bye(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),Bye(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),Bye(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),Bye(t);break;case"delimiter":return t=t.slice(0,t.length-1),Bye(t);break}return t},"strip"),EIc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),_Ic=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),tbt=a(t=>JSON.parse(_Ic(EIc(Bye(yIc(t))))),"partialParse")});var t5r=me(()=>{p();lOr()});function PUi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var MR,J$,Lye,iLe,rbt,oLe,sLe,nbt,aLe,$6,cLe,ibt,obt,hne,sbt,abt,lLe,r5r,wUi,cbt,n5r,i5r,o5r,RUi,kUi,lbt,DUi=me(()=>{p();l1();e5r();Nye();XAe();t5r();XOr();kUi="__json_buf";a(PUi,"tracksToolInput");lbt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){MR.add(this),this.messages=[],this.receivedMessages=[],J$.set(this,void 0),Lye.set(this,null),this.controller=new AbortController,iLe.set(this,void 0),rbt.set(this,()=>{}),oLe.set(this,()=>{}),sLe.set(this,void 0),nbt.set(this,()=>{}),aLe.set(this,()=>{}),$6.set(this,{}),cLe.set(this,!1),ibt.set(this,!1),obt.set(this,!1),hne.set(this,!1),sbt.set(this,void 0),abt.set(this,void 0),lLe.set(this,void 0),cbt.set(this,n=>{if(Lt(this,ibt,!0,"f"),Q6(n)&&(n=new oy),n instanceof oy)return Lt(this,obt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Lt(this,iLe,new Promise((n,o)=>{Lt(this,rbt,n,"f"),Lt(this,oLe,o,"f")}),"f"),Lt(this,sLe,new Promise((n,o)=>{Lt(this,nbt,n,"f"),Lt(this,aLe,o,"f")}),"f"),ye(this,iLe,"f").catch(()=>{}),ye(this,sLe,"f").catch(()=>{}),Lt(this,Lye,e,"f"),Lt(this,lLe,r?.logger??console,"f")}get response(){return ye(this,sbt,"f")}get request_id(){return ye(this,abt,"f")}async withResponse(){Lt(this,hne,!0,"f");let e=await ye(this,iLe,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Lt(s,Lye,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},ye(this,cbt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ye(this,MR,"m",n5r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)ye(this,MR,"m",i5r).call(this,u);if(l.controller.signal?.aborted)throw new oy;ye(this,MR,"m",o5r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Lt(this,sbt,e,"f"),Lt(this,abt,e?.headers.get("request-id"),"f"),ye(this,rbt,"f").call(this,e),this._emit("connect"))}get ended(){return ye(this,cLe,"f")}get errored(){return ye(this,ibt,"f")}get aborted(){return ye(this,obt,"f")}abort(){this.controller.abort()}on(e,r){return(ye(this,$6,"f")[e]||(ye(this,$6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ye(this,$6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(ye(this,$6,"f")[e]||(ye(this,$6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Lt(this,hne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Lt(this,hne,!0,"f"),await ye(this,sLe,"f")}get currentMessage(){return ye(this,J$,"f")}async finalMessage(){return await this.done(),ye(this,MR,"m",r5r).call(this)}async finalText(){return await this.done(),ye(this,MR,"m",wUi).call(this)}_emit(e,...r){if(ye(this,cLe,"f"))return;e==="end"&&(Lt(this,cLe,!0,"f"),ye(this,nbt,"f").call(this));let n=ye(this,$6,"f")[e];if(n&&(ye(this,$6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ye(this,hne,"f")&&!n?.length&&Promise.reject(o),ye(this,oLe,"f").call(this,o),ye(this,aLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ye(this,hne,"f")&&!n?.length&&Promise.reject(o),ye(this,oLe,"f").call(this,o),ye(this,aLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ye(this,MR,"m",r5r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{ye(this,MR,"m",n5r).call(this),this._connected(null);let s=tB.fromReadableStream(e,this.controller);for await(let c of s)ye(this,MR,"m",i5r).call(this,c);if(s.controller.signal?.aborted)throw new oy;ye(this,MR,"m",o5r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(J$=new WeakMap,Lye=new WeakMap,iLe=new WeakMap,rbt=new WeakMap,oLe=new WeakMap,sLe=new WeakMap,nbt=new WeakMap,aLe=new WeakMap,$6=new WeakMap,cLe=new WeakMap,ibt=new WeakMap,obt=new WeakMap,hne=new WeakMap,sbt=new WeakMap,abt=new WeakMap,lLe=new WeakMap,cbt=new WeakMap,MR=new WeakSet,r5r=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),wUi=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new dr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),n5r=a(function(){this.ended||Lt(this,J$,void 0,"f")},"_BetaMessageStream_beginRequest"),i5r=a(function(r){if(this.ended)return;let n=ye(this,MR,"m",RUi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{PUi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(JOr(n,ye(this,Lye,"f"),{logger:ye(this,lLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Lt(this,J$,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),o5r=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=ye(this,J$,"f");if(!r)throw new dr("request ended without sending any chunks");return Lt(this,J$,void 0,"f"),JOr(r,ye(this,Lye,"f"),{logger:ye(this,lLe,"f")})},"_BetaMessageStream_endRequest"),RUi=a(function(r){let n=ye(this,J$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&PUi(o)){let s=o[kUi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,kUi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=tbt(s)}catch(l){let u=new dr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);ye(this,cbt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new tB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var NUi,MUi=me(()=>{p();NUi=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +`;if(xe(this,Pv,"f").stdin.write(l),xe(this,o1,"f").indexOf(s)<0){let{promise:g,resolve:A}=yye();Ft(this,PR,{sentinel:s,resolve:A},"f");let y,E;try{await Promise.race([g,new Promise((_,v)=>{y=setTimeout(()=>v(new fr(`bash command timed out after ${n}ms`)),n)}),new Promise((_,v)=>{o&&(E=a(()=>v(new fr("bash command aborted")),"onAbort"),o.addEventListener("abort",E,{once:!0}))})])}finally{y&&clearTimeout(y),E&&o&&o.removeEventListener("abort",E),Ft(this,PR,null,"f")}}let u=xe(this,o1,"f").indexOf(s);if(u<0)throw new fr("bash session terminated");let f=xe(this,o1,"f").slice(u+s.length).match(/^(-?\d+)/),h=f?parseInt(f[1],10):-1,m=xe(this,o1,"f").slice(0,u).replace(iSc,"").replace(/\n+$/,"");return xe(this,jBe,"f")&&(m=`[output truncated] +${m}`),{output:m,exitCode:h}}close(){if(xe(this,one,"f"))return;Ft(this,one,!0,"f");let e=xe(this,PR,"f");Ft(this,PR,null,"f"),e?.resolve(),xe(this,Pv,"f").stdout.destroy(),xe(this,Pv,"f").stderr.destroy(),xe(this,Pv,"f").stdin.destroy();try{process.kill(-xe(this,Pv,"f").pid,"SIGKILL")}catch{xe(this,Pv,"f").kill("SIGKILL")}xe(this,Pv,"f").unref()}};Pv=new WeakMap,o1=new WeakMap,jBe=new WeakMap,one=new WeakMap,PR=new WeakMap,BCt=new WeakSet,_Or=a(function(e){if(Ft(this,o1,xe(this,o1,"f")+e,"f"),xe(this,o1,"f").length>sUi&&(Ft(this,o1,xe(this,o1,"f").slice(xe(this,o1,"f").length-sUi),"f"),Ft(this,jBe,!0,"f")),xe(this,PR,"f")&&xe(this,o1,"f").indexOf(xe(this,PR,"f").sentinel)>=0){let r=xe(this,PR,"f");Ft(this,PR,null,"f"),r.resolve()}},"_BashSession_append");a(fUi,"betaBashTool");a(pUi,"betaReadTool");a(hUi,"betaWriteTool");a(mUi,"betaEditTool");a(gUi,"betaGlobTool");a(AUi,"betaGrepTool");a(cSc,"runRipgrep");a(lSc,"runWalkGrep");a(cUi,"grepFile");a(uSc,"isWithin");dSc=40,fSc=5e4;a(pSc,"walk");a(hSc,"findRg")});async function gSc(t,e,r,n){try{await t.beta.environments.work.stop(e.id,{environment_id:e.environment_id,force:!0},{...n,headers:vt([n?.headers])})}catch(o){N$(o,409)||r.error("force-stop on exit failed",{work_id:e.id,error:String(o)})}}async function ASc(t,e,r,n,o){let s=_Ui,c=mSc,l=a(async()=>{try{let u=await t.beta.environments.work.heartbeat(e.id,{environment_id:e.environment_id,expected_last_heartbeat:c},{...o,headers:vt([o?.headers]),signal:r.signal});c=u.last_heartbeat,u.ttl_seconds>0&&(s=Math.max(1e3,Math.min(u.ttl_seconds*1e3/2,_Ui))),(u.state==="stopping"||u.state==="stopped")&&(n.info("heartbeat signals shutdown",{work_id:e.id,state:u.state}),r.abort()),u.lease_extended||(n.warn("lease not extended, shutting down",{work_id:e.id}),r.abort())}catch(u){if(r.signal.throwIfAborted(),M$(u))throw n.error("permanent heartbeat failure",{work_id:e.id,error:String(u)}),r.abort(),u;n.warn("transient heartbeat failure",{work_id:e.id,error:String(u)})}},"beat");for(await l();!r.signal.aborted;)await VD(s,r.signal),r.signal.throwIfAborted(),await l()}var UCt,GBe,bOr,_Ui,mSc,_ye,SOr=_e(()=>{p();r1();Rf();M6();TBe();XAe();MBe();bCt();gc();OCt();RCt();lOr();_Ui=3e4,mSc="NO_HEARTBEAT",_ye=class{static{a(this,"EnvironmentWorker")}constructor(e){UCt.add(this),GBe.set(this,void 0),this.client=e.client,this.environmentId=e.environmentId,this.environmentKey=e.environmentKey,this.tools=e.tools,this.workdir=e.workdir??process.cwd(),this.unrestrictedPaths=e.unrestrictedPaths,this.maxIdleMs=e.maxIdleMs,this.workerId=e.workerId,this.requestOptions=e.requestOptions,Ft(this,GBe,e.signal,"f")}async run(e){let{environmentId:r,environmentKey:n}=this;if(r===void 0||n===void 0)throw new fr("EnvironmentWorker.run: environmentId and environmentKey are required to poll for work");let o=e??xe(this,GBe,"f"),s=new O$({client:this.client,environmentId:r,environmentKey:n,...this.workerId!==void 0?{workerId:this.workerId}:{},...o?{signal:o}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},autoStop:!1});for await(let c of s)await xe(this,UCt,"m",bOr).call(this,c,n,s.signal)}async handleItem(e){let r=e?.workId??ma("ANTHROPIC_WORK_ID"),n=e?.environmentId??ma("ANTHROPIC_ENVIRONMENT_ID"),o=e?.sessionId??ma("ANTHROPIC_SESSION_ID"),s=e?.environmentKey??this.environmentKey??ma("ANTHROPIC_ENVIRONMENT_KEY");if(!r)throw new fr("handleItem: workId is required \u2014 pass it or set ANTHROPIC_WORK_ID");if(!n)throw new fr("handleItem: environmentId is required \u2014 pass it or set ANTHROPIC_ENVIRONMENT_ID");if(!o)throw new fr("handleItem: sessionId is required \u2014 pass it or set ANTHROPIC_SESSION_ID");if(!s)throw new fr("handleItem: environmentKey is required \u2014 pass it, construct the worker with it, or set ANTHROPIC_ENVIRONMENT_KEY");let c={id:r,environment_id:n,data:{type:"session",id:o}};await xe(this,UCt,"m",bOr).call(this,c,s,e?.signal??xe(this,GBe,"f"))}};GBe=new WeakMap,UCt=new WeakSet,bOr=a(async function(e,r,n){let o=ll(this.client),s=SCt(this.client,{authToken:r,helper:"environments-worker"}),c=e.data.id,l={workdir:this.workdir,client:this.client,sessionId:c,...this.unrestrictedPaths!==void 0?{unrestrictedPaths:this.unrestrictedPaths}:{}},u=await Promise.resolve().then(()=>(EUi(),yUi)),d=a(async()=>{},"cleanupSkills");try{d=await u.setupSkills(l)}catch(A){o.warn("skill setup failed",{session_id:c,work_id:e.id,error:String(A)})}let f=typeof this.tools=="function"?this.tools(l):this.tools??u.betaAgentToolset20260401(l),h=new AbortController,m=tne(n,h),g=ASc(s,e,h,o,this.requestOptions).catch(A=>{h.signal.aborted||o.error("heartbeat loop failed",{work_id:e.id,error:String(A)}),h.abort()});try{let A=new L$(c,{client:s,tools:f,...this.maxIdleMs!==void 0?{maxIdleMs:this.maxIdleMs}:{},...this.requestOptions!==void 0?{requestOptions:this.requestOptions}:{},signal:h.signal});for await(let y of A);}finally{h.abort(),m(),await g,await d().catch(A=>{o.warn("skill cleanup failed",{session_id:c,work_id:e.id,error:String(A)})}),await gSc(s,e,o,this.requestOptions)}},"_EnvironmentWorker_handleItem");a(gSc,"forceStop");a(ASc,"heartbeatLoop")});var F$,TOr=_e(()=>{p();Dl();pd();gc();Pf();RCt();SOr();RCt();SOr();F$=class extends mi{static{a(this,"Work")}retrieve(e,r,n){let{environment_id:o,betas:s}=r;return this._client.get(nr`/v1/environments/${o}/work/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/environments/${e}/work?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}ack(e,r,n){let{environment_id:o,betas:s}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/ack?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}heartbeat(e,r,n){let{environment_id:o,desired_ttl_seconds:s,expected_last_heartbeat:c,betas:l}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/heartbeat?beta=true`,{query:{desired_ttl_seconds:s,expected_last_heartbeat:c},...n,headers:vt([{"anthropic-beta":[...l??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poll(e,r={},n){let{betas:o,"Anthropic-Worker-ID":s,...c}=r??{};return this._client.get(nr`/v1/environments/${e}/work/poll?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString(),...s!=null?{"Anthropic-Worker-ID":s}:void 0},n?.headers])})}stats(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/environments/${e}/work/stats?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stop(e,r,n){let{environment_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/environments/${o}/work/${e}/stop?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}poller(e){return new O$({...e,client:this._client})}worker(e){return new _ye({...e,client:this._client})}};F$.WorkPoller=O$;F$.EnvironmentWorker=_ye});var sne,IOr=_e(()=>{p();Dl();TOr();TOr();pd();gc();Pf();sne=class extends mi{static{a(this,"Environments")}constructor(){super(...arguments),this.work=new F$(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/environments/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/environments/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/environments/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};sne.Work=F$});var vye,xOr=_e(()=>{p();Dl();pd();gc();Pf();vye=class extends mi{static{a(this,"Memories")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(nr`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memories?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(nr`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:vt([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Cye,wOr=_e(()=>{p();Dl();pd();gc();Pf();Cye=class extends mi{static{a(this,"MemoryVersions")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(nr`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/memory_stores/${e}/memory_versions?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(nr`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var U$,ROr=_e(()=>{p();Dl();xOr();xOr();wOr();wOr();pd();gc();Pf();U$=class extends mi{static{a(this,"MemoryStores")}constructor(){super(...arguments),this.memories=new vye(this._client),this.memoryVersions=new Cye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/memory_stores/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};U$.Memories=vye;U$.MemoryVersions=Cye});var bye=_e(()=>{p();Rf()});var Sye,POr=_e(()=>{p();Rf();eye();HMr();Sye=class t{static{a(this,"JSONLDecoder")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new O6;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new fr("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new fr("Attempted to iterate over a response with no body");return new t(bBe(e.body),r)}}});var Tye,kOr=_e(()=>{p();Dl();pd();gc();POr();bye();Pf();Tye=class extends mi{static{a(this,"Batches")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",wR,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/messages/batches/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:vt([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>Sye.fromResponse(l.response,l.controller))}}});var QCt,DOr=_e(()=>{p();QCt={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function vUi(t){return t?.output_format??t?.output_config?.format}function NOr(t,e,r){let n=vUi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:MOr(t,e,r)}function MOr(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=SSc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function SSc(t,e){let r=vUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var OOr=_e(()=>{p();Rf();a(vUi,"getOutputFormat");a(NOr,"maybeParseBetaMessage");a(MOr,"parseBetaMessage");a(SSc,"parseBetaOutputFormat")});var TSc,Iye,ISc,xSc,qCt,BOr=_e(()=>{p();TSc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),Iye(t);break;case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),Iye(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),Iye(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),Iye(t);break;case"delimiter":return t=t.slice(0,t.length-1),Iye(t);break}return t},"strip"),ISc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"unstrip"),xSc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"generate"),qCt=a(t=>JSON.parse(xSc(ISc(Iye(TSc(t))))),"partialParse")});var LOr=_e(()=>{p();$Mr()});function TUi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}var kR,Q$,xye,$Be,jCt,VBe,WBe,HCt,zBe,L6,YBe,GCt,$Ct,ane,VCt,WCt,KBe,FOr,CUi,zCt,UOr,QOr,qOr,bUi,SUi,YCt,IUi=_e(()=>{p();r1();BOr();bye();HAe();LOr();OOr();SUi="__json_buf";a(TUi,"tracksToolInput");YCt=class t{static{a(this,"BetaMessageStream")}constructor(e,r){kR.add(this),this.messages=[],this.receivedMessages=[],Q$.set(this,void 0),xye.set(this,null),this.controller=new AbortController,$Be.set(this,void 0),jCt.set(this,()=>{}),VBe.set(this,()=>{}),WBe.set(this,void 0),HCt.set(this,()=>{}),zBe.set(this,()=>{}),L6.set(this,{}),YBe.set(this,!1),GCt.set(this,!1),$Ct.set(this,!1),ane.set(this,!1),VCt.set(this,void 0),WCt.set(this,void 0),KBe.set(this,void 0),zCt.set(this,n=>{if(Ft(this,GCt,!0,"f"),D6(n)&&(n=new ly),n instanceof ly)return Ft(this,$Ct,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),Ft(this,$Be,new Promise((n,o)=>{Ft(this,jCt,n,"f"),Ft(this,VBe,o,"f")}),"f"),Ft(this,WBe,new Promise((n,o)=>{Ft(this,HCt,n,"f"),Ft(this,zBe,o,"f")}),"f"),xe(this,$Be,"f").catch(()=>{}),xe(this,WBe,"f").catch(()=>{}),Ft(this,xye,e,"f"),Ft(this,KBe,r?.logger??console,"f")}get response(){return xe(this,VCt,"f")}get request_id(){return xe(this,WCt,"f")}async withResponse(){Ft(this,ane,!0,"f");let e=await xe(this,$Be,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Ft(s,xye,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,zCt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{xe(this,kR,"m",UOr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)xe(this,kR,"m",QOr).call(this,u);if(l.controller.signal?.aborted)throw new ly;xe(this,kR,"m",qOr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Ft(this,VCt,e,"f"),Ft(this,WCt,e?.headers.get("request-id"),"f"),xe(this,jCt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,YBe,"f")}get errored(){return xe(this,GCt,"f")}get aborted(){return xe(this,$Ct,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,L6,"f")[e]||(xe(this,L6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,L6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(xe(this,L6,"f")[e]||(xe(this,L6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Ft(this,ane,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Ft(this,ane,!0,"f"),await xe(this,WBe,"f")}get currentMessage(){return xe(this,Q$,"f")}async finalMessage(){return await this.done(),xe(this,kR,"m",FOr).call(this)}async finalText(){return await this.done(),xe(this,kR,"m",CUi).call(this)}_emit(e,...r){if(xe(this,YBe,"f"))return;e==="end"&&(Ft(this,YBe,!0,"f"),xe(this,HCt,"f").call(this));let n=xe(this,L6,"f")[e];if(n&&(xe(this,L6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,ane,"f")&&!n?.length&&Promise.reject(o),xe(this,VBe,"f").call(this,o),xe(this,zBe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,ane,"f")&&!n?.length&&Promise.reject(o),xe(this,VBe,"f").call(this,o),xe(this,zBe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,kR,"m",FOr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{xe(this,kR,"m",UOr).call(this),this._connected(null);let s=z4.fromReadableStream(e,this.controller);for await(let c of s)xe(this,kR,"m",QOr).call(this,c);if(s.controller.signal?.aborted)throw new ly;xe(this,kR,"m",qOr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(Q$=new WeakMap,xye=new WeakMap,$Be=new WeakMap,jCt=new WeakMap,VBe=new WeakMap,WBe=new WeakMap,HCt=new WeakMap,zBe=new WeakMap,L6=new WeakMap,YBe=new WeakMap,GCt=new WeakMap,$Ct=new WeakMap,ane=new WeakMap,VCt=new WeakMap,WCt=new WeakMap,KBe=new WeakMap,zCt=new WeakMap,kR=new WeakSet,FOr=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_BetaMessageStream_getFinalMessage"),CUi=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_BetaMessageStream_getFinalText"),UOr=a(function(){this.ended||Ft(this,Q$,void 0,"f")},"_BetaMessageStream_beginRequest"),QOr=a(function(r){if(this.ended)return;let n=xe(this,kR,"m",bUi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{TUi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}case"compaction_delta":{o.type==="compaction"&&o.content&&this._emit("compaction",o.content);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(NOr(n,xe(this,xye,"f"),{logger:xe(this,KBe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Ft(this,Q$,n,"f");break}case"content_block_start":case"message_delta":break}},"_BetaMessageStream_addStreamEvent"),qOr=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,Q$,"f");if(!r)throw new fr("request ended without sending any chunks");return Ft(this,Q$,void 0,"f"),NOr(r,xe(this,xye,"f"),{logger:xe(this,KBe,"f")})},"_BetaMessageStream_endRequest"),bUi=a(function(r){let n=xe(this,Q$,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.container=r.delta.container,n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,n.context_management=r.context_management,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),r.usage.iterations!=null&&(n.usage.iterations=r.usage.iterations),n;case"content_block_start":return n.content.push(r.content_block),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&TUi(o)){let s=o[SUi]||"";s+=r.delta.partial_json;let c={...o};if(Object.defineProperty(c,SUi,{value:s,enumerable:!1,writable:!0}),s)try{c.input=qCt(s)}catch(l){let u=new fr(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${l}. JSON: ${s}`);xe(this,zCt,"f").call(this,u)}n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}case"compaction_delta":{o?.type==="compaction"&&(n.content[r.index]={...o,content:(o.content||"")+r.delta.content});break}default:r.delta}return n}case"content_block_stop":return n}},"_BetaMessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new z4(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var xUi,wUi=_e(()=>{p();xUi=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1532,65 +1486,65 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`});async function vIc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof Co?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var uLe,Fye,mne,vm,p1,iI,V6,Z$,dLe,OUi,s5r,Uye,a5r=me(()=>{p();l1();lne();wf();Ac();DOr();MUi();$Be();Uye=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){uLe.add(this),this.client=e,Fye.set(this,!1),mne.set(this,!1),vm.set(this,void 0),p1.set(this,void 0),iI.set(this,void 0),V6.set(this,void 0),Z$.set(this,void 0),dLe.set(this,0),Lt(this,vm,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...AOr(r.tools,r.messages)].join(", ");Lt(this,p1,{...n,headers:At([{"x-stainless-helper":s},n?.headers])},"f"),Lt(this,Z$,wye(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(Fye=new WeakMap,mne=new WeakMap,vm=new WeakMap,p1=new WeakMap,iI=new WeakMap,V6=new WeakMap,Z$=new WeakMap,dLe=new WeakMap,uLe=new WeakSet,OUi=a(async function(){let r=ye(this,vm,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(ye(this,iI,"f")!==void 0)try{let d=await ye(this,iI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:ye(this,vm,"f").params.max_tokens},{signal:ye(this,p1,"f").signal,headers:At([ye(this,p1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new dr("Expected text response for compaction");return ye(this,vm,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(ye(this,Fye,"f"))throw new dr("Cannot iterate over a consumed stream");Lt(this,Fye,!0,"f"),Lt(this,mne,!0,"f"),Lt(this,V6,void 0,"f");try{for(;;){let r;try{if(ye(this,vm,"f").params.max_iterations&&ye(this,dLe,"f")>=ye(this,vm,"f").params.max_iterations)break;Lt(this,mne,!1,"f"),Lt(this,V6,void 0,"f"),Lt(this,dLe,(e=ye(this,dLe,"f"),e++,e),"f"),Lt(this,iI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=ye(this,vm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},ye(this,p1,"f")),Lt(this,iI,r.finalMessage(),"f"),ye(this,iI,"f").catch(()=>{}),yield r):(Lt(this,iI,this.client.beta.messages.create({...s,stream:!1},ye(this,p1,"f")),"f"),yield ye(this,iI,"f")),!await ye(this,uLe,"m",OUi).call(this)){if(!ye(this,mne,"f")){let{role:u,content:d}=await ye(this,iI,"f");ye(this,vm,"f").params.messages.push({role:u,content:d})}let l=await ye(this,uLe,"m",s5r).call(this,ye(this,vm,"f").params.messages.at(-1));if(l)ye(this,vm,"f").params.messages.push(l);else if(!ye(this,mne,"f"))break}}finally{r&&r.abort()}}if(!ye(this,iI,"f"))throw new dr("ToolRunner concluded without a message from the server");ye(this,Z$,"f").resolve(await ye(this,iI,"f"))}catch(r){throw Lt(this,Fye,!1,"f"),ye(this,Z$,"f").promise.catch(()=>{}),ye(this,Z$,"f").reject(r),Lt(this,Z$,wye(),"f"),r}}setMessagesParams(e){typeof e=="function"?ye(this,vm,"f").params=e(ye(this,vm,"f").params):ye(this,vm,"f").params=e,Lt(this,mne,!0,"f"),Lt(this,V6,void 0,"f")}setRequestOptions(e){typeof e=="function"?Lt(this,p1,e(ye(this,p1,"f")),"f"):Lt(this,p1,{...ye(this,p1,"f"),...e},"f")}async generateToolResponse(e=ye(this,p1,"f").signal){let r=await ye(this,iI,"f")??this.params.messages.at(-1);return r?ye(this,uLe,"m",s5r).call(this,r,e):null}done(){return ye(this,Z$,"f").promise}async runUntilDone(){if(!ye(this,Fye,"f"))for await(let e of this);return this.done()}get params(){return ye(this,vm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};s5r=a(async function(e,r=ye(this,p1,"f").signal){return ye(this,V6,"f")!==void 0?ye(this,V6,"f"):(Lt(this,V6,vIc(ye(this,vm,"f").params,e,{...ye(this,p1,"f"),signal:r}),"f"),ye(this,V6,"f"))},"_BetaToolRunner_generateToolResponse");a(vIc,"generateToolResponse")});function LUi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new dr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var BUi,bIc,W6,c5r=me(()=>{p();Nye();YOr();Ml();KOr();Ac();$Be();XOr();DUi();a5r();lne();YOr();a5r();lne();BUi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},bIc=["claude-mythos-preview","claude-opus-4-6"],W6=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Oye(this._client)}create(e,r){let n=LUi(e),{betas:o,...s}=n;s.model in BUi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${BUi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),bIc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=ebt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=Nvt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:At([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:At([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>ZOr(n,e,{logger:this._client.logger??console}))}stream(e,r){return lbt.createMessage(this,e,r)}countTokens(e,r){let n=LUi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:At([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Uye(this._client,e,r)}};a(LUi,"transformOutputFormat");W6.Batches=Oye;W6.BetaToolRunner=Uye;W6.ToolError=Co});var gne,l5r=me(()=>{p();Ml();pd();Ac();Rf();Yvt();Yvt();gne=class extends mi{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/events?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new z$(e,{...r,client:this._client})}};gne.SessionToolRunner=z$});var Qye,u5r=me(()=>{p();Ml();pd();Ac();Rf();Qye=class extends mi{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/resources?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var qye,d5r=me(()=>{p();Ml();pd();Ac();Rf();qye=class extends mi{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(nr`/v1/sessions/${o}/threads/${e}/events?beta=true`,Ea,{query:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var Ane,f5r=me(()=>{p();Ml();d5r();d5r();pd();Ac();Rf();Ane=class extends mi{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new qye(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/threads?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(nr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Ane.Events=qye});var z6,p5r=me(()=>{p();Ml();l5r();l5r();u5r();u5r();f5r();f5r();pd();Ac();Rf();z6=class extends mi{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new gne(this._client),this.resources=new Qye(this._client),this.threads=new Ane(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/sessions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};z6.Events=gne;z6.Resources=Qye;z6.Threads=Ane});var jye,h5r=me(()=>{p();Ml();pd();Ac();mye();Rf();jye=class extends mi{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(nr`/v1/skills/${e}/versions?beta=true`,hye({body:s,...n,headers:At([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/skills/${e}/versions?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(nr`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var yne,m5r=me(()=>{p();Ml();h5r();h5r();pd();Ac();mye();Rf();yne=class extends mi{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new jye(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",hye({body:o,...r,headers:At([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/skills/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/skills/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};yne.Versions=jye});var Hye,g5r=me(()=>{p();Ml();pd();Ac();Rf();Hye=class extends mi{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/vaults/${e}/credentials?beta=true`,Ea,{query:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:At([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var Ene,A5r=me(()=>{p();Ml();g5r();g5r();pd();Ac();Rf();Ene=class extends mi{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new Hye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/vaults/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",Ea,{query:o,...r,headers:At([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/vaults/${e}?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:At([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Ene.Credentials=Hye});var Fg,y5r=me(()=>{p();Ml();yOr();yOr();EOr();EOr();_Or();_Or();bOr();bOr();TOr();TOr();GOr();GOr();WOr();WOr();c5r();c5r();p5r();p5r();m5r();m5r();A5r();A5r();Fg=class extends mi{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new Aye(this._client),this.messages=new W6(this._client),this.agents=new ane(this._client),this.environments=new pne(this._client),this.sessions=new z6(this._client),this.vaults=new Ene(this._client),this.memoryStores=new K$(this._client),this.files=new gye(this._client),this.skills=new yne(this._client),this.webhooks=new _ye(this._client),this.userProfiles=new yye(this._client)}};Fg.Models=Aye;Fg.Messages=W6;Fg.Agents=ane;Fg.Environments=pne;Fg.Sessions=z6;Fg.Vaults=Ene;Fg.MemoryStores=K$;Fg.Files=gye;Fg.Skills=yne;Fg.Webhooks=_ye;Fg.UserProfiles=yye});var _ne,E5r=me(()=>{p();Ml();Ac();_ne=class extends mi{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function FUi(t){return t?.output_config?.format}function _5r(t,e,r){let n=FUi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:C5r(t,e,r)}function C5r(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=MIc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function MIc(t,e){let r=FUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new dr(`Failed to parse structured output: ${n}`)}}var v5r=me(()=>{p();wf();a(FUi,"getOutputFormat");a(_5r,"maybeParseMessage");a(C5r,"parseMessage");a(MIc,"parseOutputFormat")});function jUi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var OR,X$,Gye,fLe,ubt,pLe,hLe,dbt,mLe,Y6,gLe,fbt,pbt,Cne,hbt,mbt,ALe,b5r,UUi,S5r,T5r,I5r,x5r,QUi,qUi,gbt,HUi=me(()=>{p();l1();XAe();Nye();t5r();e5r();v5r();qUi="__json_buf";a(jUi,"tracksToolInput");gbt=class t{static{a(this,"MessageStream")}constructor(e,r){OR.add(this),this.messages=[],this.receivedMessages=[],X$.set(this,void 0),Gye.set(this,null),this.controller=new AbortController,fLe.set(this,void 0),ubt.set(this,()=>{}),pLe.set(this,()=>{}),hLe.set(this,void 0),dbt.set(this,()=>{}),mLe.set(this,()=>{}),Y6.set(this,{}),gLe.set(this,!1),fbt.set(this,!1),pbt.set(this,!1),Cne.set(this,!1),hbt.set(this,void 0),mbt.set(this,void 0),ALe.set(this,void 0),S5r.set(this,n=>{if(Lt(this,fbt,!0,"f"),Q6(n)&&(n=new oy),n instanceof oy)return Lt(this,pbt,!0,"f"),this._emit("abort",n);if(n instanceof dr)return this._emit("error",n);if(n instanceof Error){let o=new dr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new dr(String(n)))}),Lt(this,fLe,new Promise((n,o)=>{Lt(this,ubt,n,"f"),Lt(this,pLe,o,"f")}),"f"),Lt(this,hLe,new Promise((n,o)=>{Lt(this,dbt,n,"f"),Lt(this,mLe,o,"f")}),"f"),ye(this,fLe,"f").catch(()=>{}),ye(this,hLe,"f").catch(()=>{}),Lt(this,Gye,e,"f"),Lt(this,ALe,r?.logger??console,"f")}get response(){return ye(this,hbt,"f")}get request_id(){return ye(this,mbt,"f")}async withResponse(){Lt(this,Cne,!0,"f");let e=await ye(this,fLe,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Lt(s,Gye,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},ye(this,S5r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ye(this,OR,"m",T5r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)ye(this,OR,"m",I5r).call(this,u);if(l.controller.signal?.aborted)throw new oy;ye(this,OR,"m",x5r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Lt(this,hbt,e,"f"),Lt(this,mbt,e?.headers.get("request-id"),"f"),ye(this,ubt,"f").call(this,e),this._emit("connect"))}get ended(){return ye(this,gLe,"f")}get errored(){return ye(this,fbt,"f")}get aborted(){return ye(this,pbt,"f")}abort(){this.controller.abort()}on(e,r){return(ye(this,Y6,"f")[e]||(ye(this,Y6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ye(this,Y6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(ye(this,Y6,"f")[e]||(ye(this,Y6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Lt(this,Cne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Lt(this,Cne,!0,"f"),await ye(this,hLe,"f")}get currentMessage(){return ye(this,X$,"f")}async finalMessage(){return await this.done(),ye(this,OR,"m",b5r).call(this)}async finalText(){return await this.done(),ye(this,OR,"m",UUi).call(this)}_emit(e,...r){if(ye(this,gLe,"f"))return;e==="end"&&(Lt(this,gLe,!0,"f"),ye(this,dbt,"f").call(this));let n=ye(this,Y6,"f")[e];if(n&&(ye(this,Y6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ye(this,Cne,"f")&&!n?.length&&Promise.reject(o),ye(this,pLe,"f").call(this,o),ye(this,mLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ye(this,Cne,"f")&&!n?.length&&Promise.reject(o),ye(this,pLe,"f").call(this,o),ye(this,mLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ye(this,OR,"m",b5r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{ye(this,OR,"m",T5r).call(this),this._connected(null);let s=tB.fromReadableStream(e,this.controller);for await(let c of s)ye(this,OR,"m",I5r).call(this,c);if(s.controller.signal?.aborted)throw new oy;ye(this,OR,"m",x5r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(X$=new WeakMap,Gye=new WeakMap,fLe=new WeakMap,ubt=new WeakMap,pLe=new WeakMap,hLe=new WeakMap,dbt=new WeakMap,mLe=new WeakMap,Y6=new WeakMap,gLe=new WeakMap,fbt=new WeakMap,pbt=new WeakMap,Cne=new WeakMap,hbt=new WeakMap,mbt=new WeakMap,ALe=new WeakMap,S5r=new WeakMap,OR=new WeakSet,b5r=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),UUi=a(function(){if(this.receivedMessages.length===0)throw new dr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new dr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),T5r=a(function(){this.ended||Lt(this,X$,void 0,"f")},"_MessageStream_beginRequest"),I5r=a(function(r){if(this.ended)return;let n=ye(this,OR,"m",QUi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{jUi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(_5r(n,ye(this,Gye,"f"),{logger:ye(this,ALe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Lt(this,X$,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),x5r=a(function(){if(this.ended)throw new dr("stream has ended, this shouldn't happen");let r=ye(this,X$,"f");if(!r)throw new dr("request ended without sending any chunks");return Lt(this,X$,void 0,"f"),_5r(r,ye(this,Gye,"f"),{logger:ye(this,ALe,"f")})},"_MessageStream_endRequest"),QUi=a(function(r){let n=ye(this,X$,"f");if(r.type==="message_start"){if(n)throw new dr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new dr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&jUi(o)){let s=o[qUi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,qUi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=tbt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new tB(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var $ye,w5r=me(()=>{p();Ml();pd();Ac();zOr();Nye();Rf();$ye=class extends mi{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(nr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",PR,{query:e,...r})}delete(e,r){return this._client.delete(nr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(nr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new dr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:At([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Mye.fromResponse(s.response,s.controller))}}});var eV,GUi,BIc,R5r=me(()=>{p();Ml();Ac();$Be();HUi();v5r();w5r();w5r();KOr();eV=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new $ye(this._client)}create(e,r){e.model in GUi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${GUi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),BIc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=ebt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=Nvt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:At([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>C5r(n,e,{logger:this._client.logger??console}))}stream(e,r){return gbt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},GUi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},BIc=["claude-mythos-preview","claude-opus-4-6"];eV.Batches=$ye});var vne,k5r=me(()=>{p();Ml();pd();Ac();Rf();vne=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}`,{...n,headers:At([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",PR,{query:o,...r,headers:At([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var $Ui=me(()=>{p();S9i();y5r();E5r();R5r();k5r()});var P5r,D5r,Abt,VUi,WUi,zUi,Pf,nB,N5r=me(()=>{p();l1();dvt();X4();lye();XAe();hvt();uye();F6i();ZMr();MBe();wf();fye();r9i();E9i();pd();gOr();$Ui();wvt();E5r();k5r();y5r();R5r();hvt();Ac();FBe();j6();X4();WUi="\\n\\nHuman:",zUi="\\n\\nAssistant:",Pf=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=ya("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=ya("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(P5r.add(this),this._requestAuthFlags=new WeakMap,Abt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:ya("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:ya("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&M6i())throw new dr(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`});async function RSc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(s=>s.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async s=>{let c=t.tools.find(l=>("name"in l?l.name:l.mcp_server_name)===s.name);if(!c||!("run"in c))return{type:"tool_result",tool_use_id:s.id,content:`Error: Tool '${s.name}' not found`,is_error:!0};try{let l=s.input;"parse"in c&&c.parse&&(l=c.parse(l));let u=await c.run(l,{toolUse:s,toolUseBlock:s,signal:r?.signal});return{type:"tool_result",tool_use_id:s.id,content:u}}catch(l){return{type:"tool_result",tool_use_id:s.id,content:l instanceof _o?l.content:`Error: ${l instanceof Error?l.message:String(l)}`,is_error:!0}}}))}}var JBe,wye,cne,Sm,s1,eI,F6,q$,ZBe,RUi,jOr,Rye,HOr=_e(()=>{p();r1();rne();Rf();gc();hOr();wUi();DBe();Rye=class{static{a(this,"BetaToolRunner")}constructor(e,r,n){JBe.add(this),this.client=e,wye.set(this,!1),cne.set(this,!1),Sm.set(this,void 0),s1.set(this,void 0),eI.set(this,void 0),F6.set(this,void 0),q$.set(this,void 0),ZBe.set(this,0),Ft(this,Sm,{params:{...r,messages:structuredClone(r.messages)}},"f");let s=["BetaToolRunner",...XMr(r.tools,r.messages)].join(", ");Ft(this,s1,{...n,headers:vt([{"x-stainless-helper":s},n?.headers])},"f"),Ft(this,q$,yye(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(wye=new WeakMap,cne=new WeakMap,Sm=new WeakMap,s1=new WeakMap,eI=new WeakMap,F6=new WeakMap,q$=new WeakMap,ZBe=new WeakMap,JBe=new WeakSet,RUi=a(async function(){let r=xe(this,Sm,"f").params.compactionControl;if(!r||!r.enabled)return!1;let n=0;if(xe(this,eI,"f")!==void 0)try{let d=await xe(this,eI,"f");n=d.usage.input_tokens+(d.usage.cache_creation_input_tokens??0)+(d.usage.cache_read_input_tokens??0)+d.usage.output_tokens}catch{return!1}let o=r.contextTokenThreshold??1e5;if(nh.type!=="tool_use");f.length===0?l.pop():d.content=f}}let u=await this.client.beta.messages.create({model:s,messages:[...l,{role:"user",content:[{type:"text",text:c}]}],max_tokens:xe(this,Sm,"f").params.max_tokens},{signal:xe(this,s1,"f").signal,headers:vt([xe(this,s1,"f").headers,{"x-stainless-helper":"compaction"}])});if(u.content[0]?.type!=="text")throw new fr("Expected text response for compaction");return xe(this,Sm,"f").params.messages=[{role:"user",content:u.content}],!0},"_BetaToolRunner_checkAndCompact"),Symbol.asyncIterator)](){var e;if(xe(this,wye,"f"))throw new fr("Cannot iterate over a consumed stream");Ft(this,wye,!0,"f"),Ft(this,cne,!0,"f"),Ft(this,F6,void 0,"f");try{for(;;){let r;try{if(xe(this,Sm,"f").params.max_iterations&&xe(this,ZBe,"f")>=xe(this,Sm,"f").params.max_iterations)break;Ft(this,cne,!1,"f"),Ft(this,F6,void 0,"f"),Ft(this,ZBe,(e=xe(this,ZBe,"f"),e++,e),"f"),Ft(this,eI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=xe(this,Sm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},xe(this,s1,"f")),Ft(this,eI,r.finalMessage(),"f"),xe(this,eI,"f").catch(()=>{}),yield r):(Ft(this,eI,this.client.beta.messages.create({...s,stream:!1},xe(this,s1,"f")),"f"),yield xe(this,eI,"f")),!await xe(this,JBe,"m",RUi).call(this)){if(!xe(this,cne,"f")){let{role:u,content:d}=await xe(this,eI,"f");xe(this,Sm,"f").params.messages.push({role:u,content:d})}let l=await xe(this,JBe,"m",jOr).call(this,xe(this,Sm,"f").params.messages.at(-1));if(l)xe(this,Sm,"f").params.messages.push(l);else if(!xe(this,cne,"f"))break}}finally{r&&r.abort()}}if(!xe(this,eI,"f"))throw new fr("ToolRunner concluded without a message from the server");xe(this,q$,"f").resolve(await xe(this,eI,"f"))}catch(r){throw Ft(this,wye,!1,"f"),xe(this,q$,"f").promise.catch(()=>{}),xe(this,q$,"f").reject(r),Ft(this,q$,yye(),"f"),r}}setMessagesParams(e){typeof e=="function"?xe(this,Sm,"f").params=e(xe(this,Sm,"f").params):xe(this,Sm,"f").params=e,Ft(this,cne,!0,"f"),Ft(this,F6,void 0,"f")}setRequestOptions(e){typeof e=="function"?Ft(this,s1,e(xe(this,s1,"f")),"f"):Ft(this,s1,{...xe(this,s1,"f"),...e},"f")}async generateToolResponse(e=xe(this,s1,"f").signal){let r=await xe(this,eI,"f")??this.params.messages.at(-1);return r?xe(this,JBe,"m",jOr).call(this,r,e):null}done(){return xe(this,q$,"f").promise}async runUntilDone(){if(!xe(this,wye,"f"))for await(let e of this);return this.done()}get params(){return xe(this,Sm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};jOr=a(async function(e,r=xe(this,s1,"f").signal){return xe(this,F6,"f")!==void 0?xe(this,F6,"f"):(Ft(this,F6,RSc(xe(this,Sm,"f").params,e,{...xe(this,s1,"f"),signal:r}),"f"),xe(this,F6,"f"))},"_BetaToolRunner_generateToolResponse");a(RSc,"generateToolResponse")});function kUi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new fr("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}var PUi,PSc,U6,GOr=_e(()=>{p();bye();kOr();Dl();DOr();gc();DBe();OOr();IUi();HOr();rne();kOr();HOr();rne();PUi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},PSc=["claude-mythos-preview","claude-opus-4-6"],U6=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Tye(this._client)}create(e,r){let n=kUi(e),{betas:o,...s}=n;s.model in PUi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${PUi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),PSc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=QCt[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=ECt(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:vt([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>MOr(n,e,{logger:this._client.logger??console}))}stream(e,r){return YCt.createMessage(this,e,r)}countTokens(e,r){let n=kUi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:vt([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new Rye(this._client,e,r)}};a(kUi,"transformOutputFormat");U6.Batches=Tye;U6.BetaToolRunner=Rye;U6.ToolError=_o});var lne,$Or=_e(()=>{p();Dl();pd();gc();Pf();OCt();OCt();lne=class extends mi{static{a(this,"Events")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/events?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}toolRunner(e,r){return new L$(e,{...r,client:this._client})}};lne.SessionToolRunner=L$});var Pye,VOr=_e(()=>{p();Dl();pd();gc();Pf();Pye=class extends mi{static{a(this,"Resources")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/resources?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(nr`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var kye,WOr=_e(()=>{p();Dl();pd();gc();Pf();kye=class extends mi{static{a(this,"Events")}list(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.getAPIList(nr`/v1/sessions/${o}/threads/${e}/events?beta=true`,ga,{query:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/threads/${e}/stream?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}}});var une,zOr=_e(()=>{p();Dl();WOr();WOr();pd();gc();Pf();une=class extends mi{static{a(this,"Threads")}constructor(){super(...arguments),this.events=new kye(this._client)}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(nr`/v1/sessions/${o}/threads/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/sessions/${e}/threads?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{session_id:o,betas:s}=r;return this._client.post(nr`/v1/sessions/${o}/threads/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};une.Events=kye});var Q6,YOr=_e(()=>{p();Dl();$Or();$Or();VOr();VOr();zOr();zOr();pd();gc();Pf();Q6=class extends mi{static{a(this,"Sessions")}constructor(){super(...arguments),this.events=new lne(this._client),this.resources=new Pye(this._client),this.threads=new une(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/sessions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/sessions/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};Q6.Events=lne;Q6.Resources=Pye;Q6.Threads=une});var Dye,KOr=_e(()=>{p();Dl();pd();gc();oye();Pf();Dye=class extends mi{static{a(this,"Versions")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(nr`/v1/skills/${e}/versions?beta=true`,iye({body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/skills/${e}/versions?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(nr`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}download(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(nr`/v1/skills/${o}/versions/${e}/content?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var dne,JOr=_e(()=>{p();Dl();KOr();KOr();pd();gc();oye();Pf();dne=class extends mi{static{a(this,"Skills")}constructor(){super(...arguments),this.versions=new Dye(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",iye({body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/skills/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};dne.Versions=Dye});var Nye,ZOr=_e(()=>{p();Dl();pd();gc();Pf();Nye=class extends mi{static{a(this,"Credentials")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(nr`/v1/vaults/${e}/credentials?beta=true`,ga,{query:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(nr`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}mcpOAuthValidate(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(nr`/v1/vaults/${o}/credentials/${e}/mcp_oauth_validate?beta=true`,{...n,headers:vt([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}}});var fne,XOr=_e(()=>{p();Dl();ZOr();ZOr();pd();gc();Pf();fne=class extends mi{static{a(this,"Vaults")}constructor(){super(...arguments),this.credentials=new Nye(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(nr`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",ga,{query:o,...r,headers:vt([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(nr`/v1/vaults/${e}?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(nr`/v1/vaults/${e}/archive?beta=true`,{...n,headers:vt([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};fne.Credentials=Nye});var Ug,e5r=_e(()=>{p();Dl();eOr();eOr();tOr();tOr();rOr();rOr();oOr();oOr();aOr();aOr();IOr();IOr();ROr();ROr();GOr();GOr();YOr();YOr();JOr();JOr();XOr();XOr();Ug=class extends mi{static{a(this,"Beta")}constructor(){super(...arguments),this.models=new aye(this._client),this.messages=new U6(this._client),this.agents=new ene(this._client),this.environments=new sne(this._client),this.sessions=new Q6(this._client),this.vaults=new fne(this._client),this.memoryStores=new U$(this._client),this.files=new sye(this._client),this.skills=new dne(this._client),this.webhooks=new uye(this._client),this.userProfiles=new cye(this._client)}};Ug.Models=aye;Ug.Messages=U6;Ug.Agents=ene;Ug.Environments=sne;Ug.Sessions=Q6;Ug.Vaults=fne;Ug.MemoryStores=U$;Ug.Files=sye;Ug.Skills=dne;Ug.Webhooks=uye;Ug.UserProfiles=cye});var pne,t5r=_e(()=>{p();Dl();gc();pne=class extends mi{static{a(this,"Completions")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}}});function DUi(t){return t?.output_config?.format}function r5r(t,e,r){let n=DUi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:n5r(t,e,r)}function n5r(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=qSc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function qSc(t,e){let r=DUi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new fr(`Failed to parse structured output: ${n}`)}}var i5r=_e(()=>{p();Rf();a(DUi,"getOutputFormat");a(r5r,"maybeParseMessage");a(n5r,"parseMessage");a(qSc,"parseOutputFormat")});function BUi(t){return t.type==="tool_use"||t.type==="server_tool_use"}var DR,j$,Mye,XBe,KCt,eLe,tLe,JCt,rLe,q6,nLe,ZCt,XCt,hne,ebt,tbt,iLe,o5r,NUi,s5r,a5r,c5r,l5r,MUi,OUi,rbt,LUi=_e(()=>{p();r1();HAe();bye();LOr();BOr();i5r();OUi="__json_buf";a(BUi,"tracksToolInput");rbt=class t{static{a(this,"MessageStream")}constructor(e,r){DR.add(this),this.messages=[],this.receivedMessages=[],j$.set(this,void 0),Mye.set(this,null),this.controller=new AbortController,XBe.set(this,void 0),KCt.set(this,()=>{}),eLe.set(this,()=>{}),tLe.set(this,void 0),JCt.set(this,()=>{}),rLe.set(this,()=>{}),q6.set(this,{}),nLe.set(this,!1),ZCt.set(this,!1),XCt.set(this,!1),hne.set(this,!1),ebt.set(this,void 0),tbt.set(this,void 0),iLe.set(this,void 0),s5r.set(this,n=>{if(Ft(this,ZCt,!0,"f"),D6(n)&&(n=new ly),n instanceof ly)return Ft(this,XCt,!0,"f"),this._emit("abort",n);if(n instanceof fr)return this._emit("error",n);if(n instanceof Error){let o=new fr(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new fr(String(n)))}),Ft(this,XBe,new Promise((n,o)=>{Ft(this,KCt,n,"f"),Ft(this,eLe,o,"f")}),"f"),Ft(this,tLe,new Promise((n,o)=>{Ft(this,JCt,n,"f"),Ft(this,rLe,o,"f")}),"f"),xe(this,XBe,"f").catch(()=>{}),xe(this,tLe,"f").catch(()=>{}),Ft(this,Mye,e,"f"),Ft(this,iLe,r?.logger??console,"f")}get response(){return xe(this,ebt,"f")}get request_id(){return xe(this,tbt,"f")}async withResponse(){Ft(this,hne,!0,"f");let e=await xe(this,XBe,"f");if(!e)throw new Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return Ft(s,Mye,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},xe(this,s5r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{xe(this,DR,"m",a5r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)xe(this,DR,"m",c5r).call(this,u);if(l.controller.signal?.aborted)throw new ly;xe(this,DR,"m",l5r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(Ft(this,ebt,e,"f"),Ft(this,tbt,e?.headers.get("request-id"),"f"),xe(this,KCt,"f").call(this,e),this._emit("connect"))}get ended(){return xe(this,nLe,"f")}get errored(){return xe(this,ZCt,"f")}get aborted(){return xe(this,XCt,"f")}abort(){this.controller.abort()}on(e,r){return(xe(this,q6,"f")[e]||(xe(this,q6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=xe(this,q6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(xe(this,q6,"f")[e]||(xe(this,q6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Ft(this,hne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Ft(this,hne,!0,"f"),await xe(this,tLe,"f")}get currentMessage(){return xe(this,j$,"f")}async finalMessage(){return await this.done(),xe(this,DR,"m",o5r).call(this)}async finalText(){return await this.done(),xe(this,DR,"m",NUi).call(this)}_emit(e,...r){if(xe(this,nLe,"f"))return;e==="end"&&(Ft(this,nLe,!0,"f"),xe(this,JCt,"f").call(this));let n=xe(this,q6,"f")[e];if(n&&(xe(this,q6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!xe(this,hne,"f")&&!n?.length&&Promise.reject(o),xe(this,eLe,"f").call(this,o),xe(this,rLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!xe(this,hne,"f")&&!n?.length&&Promise.reject(o),xe(this,eLe,"f").call(this,o),xe(this,rLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",xe(this,DR,"m",o5r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{xe(this,DR,"m",a5r).call(this),this._connected(null);let s=z4.fromReadableStream(e,this.controller);for await(let c of s)xe(this,DR,"m",c5r).call(this,c);if(s.controller.signal?.aborted)throw new ly;xe(this,DR,"m",l5r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(j$=new WeakMap,Mye=new WeakMap,XBe=new WeakMap,KCt=new WeakMap,eLe=new WeakMap,tLe=new WeakMap,JCt=new WeakMap,rLe=new WeakMap,q6=new WeakMap,nLe=new WeakMap,ZCt=new WeakMap,XCt=new WeakMap,hne=new WeakMap,ebt=new WeakMap,tbt=new WeakMap,iLe=new WeakMap,s5r=new WeakMap,DR=new WeakSet,o5r=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"_MessageStream_getFinalMessage"),NUi=a(function(){if(this.receivedMessages.length===0)throw new fr("stream ended without producing a Message with role=assistant");let r=this.receivedMessages.at(-1).content.filter(n=>n.type==="text").map(n=>n.text);if(r.length===0)throw new fr("stream ended without producing a content block with type=text");return r.join(" ")},"_MessageStream_getFinalText"),a5r=a(function(){this.ended||Ft(this,j$,void 0,"f")},"_MessageStream_beginRequest"),c5r=a(function(r){if(this.ended)return;let n=xe(this,DR,"m",MUi).call(this,r);switch(this._emit("streamEvent",r,n),r.type){case"content_block_delta":{let o=n.content.at(-1);switch(r.delta.type){case"text_delta":{o.type==="text"&&this._emit("text",r.delta.text,o.text||"");break}case"citations_delta":{o.type==="text"&&this._emit("citation",r.delta.citation,o.citations??[]);break}case"input_json_delta":{BUi(o)&&o.input&&this._emit("inputJson",r.delta.partial_json,o.input);break}case"thinking_delta":{o.type==="thinking"&&this._emit("thinking",r.delta.thinking,o.thinking);break}case"signature_delta":{o.type==="thinking"&&this._emit("signature",o.signature);break}default:r.delta}break}case"message_stop":{this._addMessageParam(n),this._addMessage(r5r(n,xe(this,Mye,"f"),{logger:xe(this,iLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",n.content.at(-1));break}case"message_start":{Ft(this,j$,n,"f");break}case"content_block_start":case"message_delta":break}},"_MessageStream_addStreamEvent"),l5r=a(function(){if(this.ended)throw new fr("stream has ended, this shouldn't happen");let r=xe(this,j$,"f");if(!r)throw new fr("request ended without sending any chunks");return Ft(this,j$,void 0,"f"),r5r(r,xe(this,Mye,"f"),{logger:xe(this,iLe,"f")})},"_MessageStream_endRequest"),MUi=a(function(r){let n=xe(this,j$,"f");if(r.type==="message_start"){if(n)throw new fr(`Unexpected event order, got ${r.type} before receiving "message_stop"`);return r.message}if(!n)throw new fr(`Unexpected event order, got ${r.type} before "message_start"`);switch(r.type){case"message_stop":return n;case"message_delta":return n.stop_reason=r.delta.stop_reason,n.stop_sequence=r.delta.stop_sequence,n.usage.output_tokens=r.usage.output_tokens,r.usage.input_tokens!=null&&(n.usage.input_tokens=r.usage.input_tokens),r.usage.cache_creation_input_tokens!=null&&(n.usage.cache_creation_input_tokens=r.usage.cache_creation_input_tokens),r.usage.cache_read_input_tokens!=null&&(n.usage.cache_read_input_tokens=r.usage.cache_read_input_tokens),r.usage.server_tool_use!=null&&(n.usage.server_tool_use=r.usage.server_tool_use),n;case"content_block_start":return n.content.push({...r.content_block}),n;case"content_block_delta":{let o=n.content.at(r.index);switch(r.delta.type){case"text_delta":{o?.type==="text"&&(n.content[r.index]={...o,text:(o.text||"")+r.delta.text});break}case"citations_delta":{o?.type==="text"&&(n.content[r.index]={...o,citations:[...o.citations??[],r.delta.citation]});break}case"input_json_delta":{if(o&&BUi(o)){let s=o[OUi]||"";s+=r.delta.partial_json;let c={...o};Object.defineProperty(c,OUi,{value:s,enumerable:!1,writable:!0}),s&&(c.input=qCt(s)),n.content[r.index]=c}break}case"thinking_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,thinking:o.thinking+r.delta.thinking});break}case"signature_delta":{o?.type==="thinking"&&(n.content[r.index]={...o,signature:r.delta.signature});break}default:r.delta}return n}case"content_block_stop":return n}},"_MessageStream_accumulateMessage"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((s,c)=>r.push({resolve:s,reject:c})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new z4(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var Oye,u5r=_e(()=>{p();Dl();pd();gc();POr();bye();Pf();Oye=class extends mi{static{a(this,"Batches")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(nr`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",wR,{query:e,...r})}delete(e,r){return this._client.delete(nr`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(nr`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new fr(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:vt([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>Sye.fromResponse(s.response,s.controller))}}});var H$,FUi,HSc,d5r=_e(()=>{p();Dl();gc();DBe();LUi();i5r();u5r();u5r();DOr();H$=class extends mi{static{a(this,"Messages")}constructor(){super(...arguments),this.batches=new Oye(this._client)}create(e,r){e.model in FUi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${FUi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),HSc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=QCt[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=ECt(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:vt([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>n5r(n,e,{logger:this._client.logger??console}))}stream(e,r){return rbt.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},FUi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},HSc=["claude-mythos-preview","claude-opus-4-6"];H$.Batches=Oye});var mne,f5r=_e(()=>{p();Dl();pd();gc();Pf();mne=class extends mi{static{a(this,"Models")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(nr`/v1/models/${e}`,{...n,headers:vt([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",wR,{query:o,...r,headers:vt([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}}});var UUi=_e(()=>{p();y9i();e5r();t5r();d5r();f5r()});var p5r,h5r,nbt,QUi,qUi,jUi,Df,K4,m5r=_e(()=>{p();r1();Jvt();V4();XAe();HAe();eCt();eye();D6i();MMr();vBe();Rf();rye();K6i();p9i();pd();ZMr();UUi();hCt();t5r();f5r();e5r();d5r();eCt();gc();TBe();M6();V4();qUi="\\n\\nHuman:",jUi="\\n\\nAssistant:",Df=class{static{a(this,"BaseAnthropic")}get credentials(){return this._authState.provider}constructor({baseURL:e=ma("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,webhookKey:o=ma("ANTHROPIC_WEBHOOK_SIGNING_KEY")??null,...s}={}){if(p5r.add(this),this._requestAuthFlags=new WeakMap,nbt.set(this,void 0),r===void 0&&(r=s.profile!=null?null:ma("ANTHROPIC_API_KEY")??null),n===void 0&&(n=s.profile!=null?null:ma("ANTHROPIC_AUTH_TOKEN")??null),s.profile!=null&&(s.credentials!=null||s.config!=null))throw new TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let c={apiKey:r,authToken:n,webhookKey:o,...s,baseURL:e||"https://api.anthropic.com"};if(!c.dangerouslyAllowBrowser&&w6i())throw new fr(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??D5r.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=tOr(c.logLevel,"ClientOptions.logLevel",this)??tOr(ya("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??O6i(),Lt(this,Abt,L6i,"f");let u=ya("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` -`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=sOr(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{dl(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{dl(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new vvt(e,r=>{dl(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await y9i(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new dr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,At([{Authorization:`Bearer ${r}`}])}return At([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return At([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return At([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return Y6i(e)}getUserAgent(){return`${this.constructor.name}/JS ${kR}`}defaultIdempotencyKey(){return`stainless-node-retry-${ZAe()}`}makeStatusError(e,r,n,o){return lh.generate(e,r,n,o)}buildURL(e,r,n){let o=!ye(this,P5r,"m",VUi).call(this)&&n||this.baseURL,s=w6i(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!HMr(c)||!HMr(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new dr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(ine)||o.append("anthropic-beta",ine),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new one(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(dl(this).debug(`[${d}] sending request`,q6({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new oy;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(NBe),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new oy;let v=Q6(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,q6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw dl(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),dl(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,q6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new eye:new j$({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await B6i(g.body),dl(this).info(`${E} - ${x}`),dl(this).debug(`[${d}] response error (${x})`,q6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";dl(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>NBe(x).message),T=pvt(b),w=T?void 0:b;throw dl(this).debug(`[${d}] response error (${v})`,q6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return dl(this).info(E),dl(this).debug(`[${d}] response start`,q6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new jBe(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await YD(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new dr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&k6i("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=At([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...OBe(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=At([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:mvt(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:ye(this,Abt,"f").call(this,{body:e,headers:n})}};D5r=Pf,Abt=new WeakMap,P5r=new WeakSet,VUi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Pf.Anthropic=D5r;Pf.HUMAN_PROMPT=WUi;Pf.AI_PROMPT=zUi;Pf.DEFAULT_TIMEOUT=6e5;Pf.AnthropicError=dr;Pf.APIError=lh;Pf.APIConnectionError=j$;Pf.APIConnectionTimeoutError=eye;Pf.APIUserAbortError=oy;Pf.NotFoundError=iye;Pf.ConflictError=oye;Pf.RateLimitError=aye;Pf.BadRequestError=tye;Pf.AuthenticationError=rye;Pf.InternalServerError=cye;Pf.PermissionDeniedError=nye;Pf.UnprocessableEntityError=sye;Pf.toFile=Pvt;nB=class extends Pf{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new _ne(this),this.messages=new eV(this),this.models=new vne(this),this.beta=new Fg(this)}};nB.Completions=_ne;nB.Messages=eV;nB.Models=vne;nB.Beta=Fg});var POr=me(()=>{p();N5r();gOr();wvt();N5r();pd();wf()});var p4r=I((e1h,Dqi)=>{p();var NLe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,UPc=typeof AbortController=="function",o1t=UPc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new Rqi}abort(){this.signal.dispatchEvent("abort")}},QPc=typeof AbortSignal=="function",qPc=typeof o1t.AbortSignal=="function",Rqi=QPc?AbortSignal:qPc?o1t.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},d4r=new Set,c4r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;s1t(r)&&f4r(r,`${t} option`,`options.${e}`,lEe)},"deprecatedOption"),l4r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(s1t(r)){let{prototype:n}=lEe,{get:o}=Object.getOwnPropertyDescriptor(n,t);f4r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),jPc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(s1t(r)){let{prototype:n}=lEe,{get:o}=Object.getOwnPropertyDescriptor(n,t);f4r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),kqi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),s1t=a(t=>!d4r.has(t),"shouldWarn"),f4r=a((t,e,r,n)=>{d4r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;kqi(o,"DeprecationWarning",t,n)},"warn"),xne=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Pqi=a(t=>xne(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?cEe:null:null,"getUintArray"),cEe=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},u4r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=Pqi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},lEe=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!xne(r))throw new TypeError("max option must be a nonnegative integer");let R=r?Pqi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&E!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new u4r(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!_,this.maxSize!==0){if(!xne(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=xne(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!xne(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";s1t(x)&&(d4r.add(x),kqi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&c4r("stale","allowStale"),T&&c4r("maxAge","ttl"),b&&c4r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new cEe(this.max),this.starts=new cEe(this.max),this.setItemTTL=(n,o,s=NLe.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?NLe.now():0};let e=0,r=a(()=>{let n=NLe.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new cEe(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!xne(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!xne(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return l4r("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=NLe.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=NLe.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new o1t,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return l4r("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return l4r("reset","clear"),this.clear}get length(){return jPc("length","size"),this.size}static get AbortController(){return o1t}static get AbortSignal(){return Rqi}};Dqi.exports=lEe});var g4r=I((n1h,Nqi)=>{"use strict";p();var MLe=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},h4r=class extends MLe{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},m4r=class extends MLe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};Nqi.exports={FetchBaseError:MLe,FetchError:h4r,AbortError:m4r}});var Z6=I((s1h,Oqi)=>{"use strict";p();var{constants:{MAX_LENGTH:HPc}}=require("buffer"),{pipeline:a1t,PassThrough:GPc}=require("stream"),{promisify:$Pc}=require("util"),{createGunzip:VPc,createInflate:WPc,createBrotliDecompress:zPc,constants:{Z_SYNC_FLUSH:Mqi}}=require("zlib"),YPc=Wk()("helix-fetch:utils"),KPc=$Pc(a1t),JPc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),ZPc=a((t,e,r,n)=>{if(!JPc(t,e))return r;let o=a(s=>{s&&(YPc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return a1t(r,VPc({flush:Mqi,finishFlush:Mqi}),o);case"deflate":case"x-deflate":return a1t(r,WPc(),o);case"br":return a1t(r,zPc(),o);default:return r}},"decodeStream"),XPc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),c1t=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?e2c(t,e):t2c(t,e);default:return 0}},"calcSize"),e2c=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:c1t(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),t2c=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=c1t(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=c1t(t[o],e)}),r},"calcObjectSize"),r2c=a(t=>c1t(t,new WeakSet),"sizeof"),n2c=a(async t=>{let e=new GPc,r=0,n=[];return e.on("data",o=>{if(r+o.length>HPc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await KPc(t,e),Buffer.concat(n,r)},"streamToBuffer");Oqi.exports={decodeStream:ZPc,isPlainObject:XPc,sizeof:r2c,streamToBuffer:n2c}});var u1t=I((l1h,Uqi)=>{"use strict";p();var{PassThrough:Bqi,Readable:X6}=require("stream"),{types:{isAnyArrayBuffer:Fqi}}=require("util"),{FetchError:i2c,FetchBaseError:o2c}=g4r(),{streamToBuffer:s2c}=Z6(),a2c=Buffer.alloc(0),FR=Symbol("Body internals"),c2c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),Lqi=a(async t=>{if(t[FR].disturbed)throw new TypeError("Already read");if(t[FR].error)throw new TypeError(`Stream had error: ${t[FR].error.message}`);t[FR].disturbed=!0;let{stream:e}=t[FR];return e===null?a2c:s2c(e)},"consume"),l1t=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=X6.from(e.toString()):e instanceof X6?r=e:Buffer.isBuffer(e)?r=X6.from(e):Fqi(e)?r=X6.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=X6.from(e):r=X6.from(String(e)),this[FR]={stream:r,disturbed:!1,error:null},e instanceof X6&&r.on("error",n=>{let o=n instanceof o2c?n:new i2c(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[FR].error=o})}get body(){return this[FR].stream}get bodyUsed(){return this[FR].disturbed}async buffer(){return Lqi(this)}async arrayBuffer(){return c2c(await this.buffer())}async text(){return(await Lqi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(l1t.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var l2c=a(t=>{if(t[FR].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[FR],r=e;if(e instanceof X6){r=new Bqi;let n=new Bqi;e.pipe(r),e.pipe(n),t[FR].stream=n}return r},"cloneStream"),u2c=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||Fqi(t)||t instanceof X6?null:"text/plain; charset=utf-8","guessContentType");Uqi.exports={Body:l1t,cloneStream:l2c,guessContentType:u2c}});var uEe=I((f1h,Hqi)=>{"use strict";p();var{validateHeaderName:Qqi,validateHeaderValue:qqi}=require("http"),{isPlainObject:d2c}=Z6(),e9=Symbol("Headers internals"),OLe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof Qqi=="function")Qqi(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),jqi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof qqi=="function")qqi(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),d1t=class t{static{a(this,"Headers")}constructor(e={}){if(this[e9]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(d2c(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[e9].map.set(OLe(e),jqi(r,e))}has(e){return this[e9].map.has(OLe(e))}get(e){let r=this[e9].map.get(OLe(e));return r===void 0?null:r}append(e,r){let n=OLe(e),o=jqi(r,e),s=this[e9].map.get(n);this[e9].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[e9].map.delete(OLe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[e9].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[e9].map)}};Object.defineProperties(d1t.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));Hqi.exports={Headers:d1t}});var A4r=I((m1h,Gqi)=>{"use strict";p();var{EventEmitter:f2c}=require("events"),nN=Symbol("AbortSignal internals"),dEe=class{static{a(this,"AbortSignal")}constructor(){this[nN]={eventEmitter:new f2c,onabort:null,aborted:!1}}get aborted(){return this[nN].aborted}get onabort(){return this[nN].onabort}set onabort(e){this[nN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[nN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[nN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[nN][n]=="function"&&this[n](r),this[nN].eventEmitter.emit(e,r)}fire(){this[nN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(dEe.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var p1t=class extends dEe{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[nN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[nN].timerId)}};Object.defineProperties(p1t.prototype,{clear:{enumerable:!0}});var f1t=Symbol("AbortController internals"),h1t=class{static{a(this,"AbortController")}constructor(){this[f1t]={signal:new dEe}}get signal(){return this[f1t].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[f1t].signal.aborted||this[f1t].signal.fire()}};Object.defineProperties(h1t.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});Gqi.exports={AbortController:h1t,AbortSignal:dEe,TimeoutSignal:p1t}});var BLe=I((y1h,Wqi)=>{"use strict";p();var{randomBytes:p2c}=require("crypto"),{Readable:h2c}=require("stream"),E4r=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),m2c=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),$qi=a(t=>`--${t}--\r +`);this.baseURL=c.baseURL,this._baseURLIsExplicit=s.__baseURLIsExplicit??!!e,this.timeout=c.timeout??h5r.DEFAULT_TIMEOUT,this.logger=c.logger??console;let l="warn";this.logLevel=l,this.logLevel=LMr(c.logLevel,"ClientOptions.logLevel",this)??LMr(ma("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??l,this.fetchOptions=c.fetchOptions,this.maxRetries=c.maxRetries??2,this.fetch=c.fetch??R6i(),Ft(this,nbt,k6i,"f");let u=ma("ANTHROPIC_CUSTOM_HEADERS");if(u){let f={};for(let h of u.split(` +`)){let m=h.indexOf(":");m>=0&&(f[h.substring(0,m).trim()]=h.substring(m+1).trim())}c.defaultHeaders={...f,...c.defaultHeaders}}let d=s.__auth;if(delete c.__auth,delete c.__baseURLIsExplicit,this._options=c,this.apiKey=typeof r=="string"?r:null,this.authToken=n,this.webhookKey=o,d)this._authState=d,!this._baseURLIsExplicit&&d.baseURL&&(this.baseURL=d.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let f=c.credentials??null;if(f)this._authState.provider=f,this._authState.tokenCache=this._makeTokenCache(f);else if(c.config!=null){let h=jMr(c.config,this._credentialResolverOptions());this._authState.provider=h.provider,this._authState.tokenCache=this._makeTokenCache(h.provider),this._authState.extraHeaders=h.extraHeaders,this._applyCredentialBaseURL(h.baseURL)}else c.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(c.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,this._baseURLIsExplicit||(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{ll(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{ll(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new cCt(e,r=>{ll(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,webhookKey:this.webhookKey,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await f9i(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new fr(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw new Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,vt([{Authorization:`Bearer ${r}`}])}return vt([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return vt([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return vt([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return H6i(e)}getUserAgent(){return`${this.constructor.name}/JS ${xR}`}defaultIdempotencyKey(){return`stainless-node-retry-${jAe()}`}makeStatusError(e,r,n,o){return fh.generate(e,r,n,o)}buildURL(e,r,n){let o=!xe(this,p5r,"m",QUi).call(this)&&n||this.baseURL,s=C6i(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!TMr(c)||!TMr(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600*1e3}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[c,l]of Object.entries(this._authState.extraHeaders))o.has(c)||o.set(c,l);o.get("anthropic-beta")?.split(",").map(c=>c.trim())?.includes(Jre)||o.append("anthropic-beta",Jre),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new Zre(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(ll(this).debug(`[${d}] sending request`,N6({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new ly;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(_Be),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new ly;let v=D6(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return ll(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),ll(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,N6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw ll(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),ll(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,N6({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new GAe:new k$({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let x=`retrying, ${r} attempts remaining`;return await P6i(g.body),ll(this).info(`${E} - ${x}`),ll(this).debug(`[${d}] response error (${x})`,N6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";ll(this).info(`${E} - ${v}`);let b=await g.text().catch(x=>_Be(x).message),T=Xvt(b),w=T?void 0:b;throw ll(this).debug(`[${d}] response error (${v})`,N6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return ll(this).info(E),ll(this).debug(`[${d}] response start`,N6({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new RBe(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await VD(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let s=r-e,c=Math.min(.5*Math.pow(2,s),8),l=1-Math.random()*.25;return c*l*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new fr("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&S6i("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=vt([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...CBe(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=vt([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:tCt(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:xe(this,nbt,"f").call(this,{body:e,headers:n})}};h5r=Df,nbt=new WeakMap,p5r=new WeakSet,QUi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"_BaseAnthropic_baseURLOverridden");Df.Anthropic=h5r;Df.HUMAN_PROMPT=qUi;Df.AI_PROMPT=jUi;Df.DEFAULT_TIMEOUT=6e5;Df.AnthropicError=fr;Df.APIError=fh;Df.APIConnectionError=k$;Df.APIConnectionTimeoutError=GAe;Df.APIUserAbortError=ly;Df.NotFoundError=zAe;Df.ConflictError=YAe;Df.RateLimitError=JAe;Df.BadRequestError=$Ae;Df.AuthenticationError=VAe;Df.InternalServerError=ZAe;Df.PermissionDeniedError=WAe;Df.UnprocessableEntityError=KAe;Df.toFile=ACt;K4=class extends Df{static{a(this,"Anthropic")}constructor(){super(...arguments),this.completions=new pne(this),this.messages=new H$(this),this.models=new mne(this),this.beta=new Ug(this)}};K4.Completions=pne;K4.Messages=H$;K4.Models=mne;K4.Beta=Ug});var pOr=_e(()=>{p();m5r();ZMr();hCt();m5r();pd();Rf()});var Y5r=I((hbh,Iqi)=>{p();var _Le=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,VRc=typeof AbortController=="function",Vbt=VRc?AbortController:class{static{a(this,"AbortController")}constructor(){this.signal=new bqi}abort(){this.signal.dispatchEvent("abort")}},WRc=typeof AbortSignal=="function",zRc=typeof Vbt.AbortSignal=="function",bqi=WRc?AbortSignal:zRc?Vbt.AbortController:class{static{a(this,"AbortSignal")}constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(e){if(e==="abort"){this.aborted=!0;let r={type:e,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(e,r){e==="abort"&&this._listeners.push(r)}removeEventListener(e,r){e==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},W5r=new Set,G5r=a((t,e)=>{let r=`LRU_CACHE_OPTION_${t}`;Wbt(r)&&z5r(r,`${t} option`,`options.${e}`,Xye)},"deprecatedOption"),$5r=a((t,e)=>{let r=`LRU_CACHE_METHOD_${t}`;if(Wbt(r)){let{prototype:n}=Xye,{get:o}=Object.getOwnPropertyDescriptor(n,t);z5r(r,`${t} method`,`cache.${e}()`,o)}},"deprecatedMethod"),YRc=a((t,e)=>{let r=`LRU_CACHE_PROPERTY_${t}`;if(Wbt(r)){let{prototype:n}=Xye,{get:o}=Object.getOwnPropertyDescriptor(n,t);z5r(r,`${t} property`,`cache.${e}`,o)}},"deprecatedProperty"),Sqi=a((...t)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...t):console.error(...t)},"emitWarning"),Wbt=a(t=>!W5r.has(t),"shouldWarn"),z5r=a((t,e,r,n)=>{W5r.add(t);let o=`The ${e} is deprecated. Please use ${r} instead.`;Sqi(o,"DeprecationWarning",t,n)},"warn"),_ne=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),Tqi=a(t=>_ne(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Zye:null:null,"getUintArray"),Zye=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},V5r=class{static{a(this,"Stack")}constructor(e){if(e===0)return[];let r=Tqi(e);this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Xye=class t{static{a(this,"LRUCache")}constructor(e={}){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,sizeCalculation:A,fetchMethod:y,fetchContext:E,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:v}=e,{length:b,maxAge:T,stale:w}=e instanceof t?{}:e;if(r!==0&&!_ne(r))throw new TypeError("max option must be a nonnegative integer");let R=r?Tqi(r):Array;if(!R)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=g,this.sizeCalculation=A||b,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&E!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new R(r),this.prev=new R(r),this.head=0,this.tail=0,this.free=new V5r(r),this.initialFill=1,this.size=0,typeof d=="function"&&(this.dispose=d),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!_,this.maxSize!==0){if(!_ne(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!w,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=_ne(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||T||0,this.ttl){if(!_ne(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let x="LRU_CACHE_UNBOUNDED";Wbt(x)&&(W5r.add(x),Sqi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,t))}w&&G5r("stale","allowStale"),T&&G5r("maxAge","ttl"),b&&G5r("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Zye(this.max),this.starts=new Zye(this.max),this.setItemTTL=(n,o,s=_Le.now())=>{if(this.starts[n]=o!==0?s:0,this.ttls[n]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},o+1);c.unref&&c.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?_Le.now():0};let e=0,r=a(()=>{let n=_Le.now();if(this.ttlResolution>0){e=n;let o=setTimeout(()=>e=0,this.ttlResolution);o.unref&&o.unref()}return n},"getNow");this.getRemainingTTL=n=>{let o=this.keyMap.get(n);return o===void 0?0:this.ttls[o]===0||this.starts[o]===0?1/0:this.starts[o]+this.ttls[o]-(e||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(e||r())-this.starts[n]>this.ttls[n]}updateItemAge(e){}setItemTTL(e,r,n){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new Zye(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,r,n,o)=>{if(!_ne(n))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(n=o(r,e),!_ne(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(e,r)=>{this.sizes[e]=r;let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0);this.calculatedSize+=this.sizes[e]}}removeItemSize(e){}addItemSize(e,r){}requireSize(e,r,n,o){if(n||o)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((e||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(let e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(let e of this.indexes())yield this.keyList[e]}*rkeys(){for(let e of this.rindexes())yield this.keyList[e]}*values(){for(let e of this.indexes())yield this.valList[e]}*rvalues(){for(let e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.indexes())if(e(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(e,r=this){for(let n of this.indexes())e.call(r,this.valList[n],this.keyList[n],this)}rforEach(e,r=this){for(let n of this.rindexes())e.call(r,this.valList[n],this.keyList[n],this)}get prune(){return $5r("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),e=!0);return e}dump(){let e=[];for(let r of this.indexes({allowStale:!0})){let n=this.keyList[r],o=this.valList[r],c={value:this.isBackgroundFetch(o)?o.__staleWhileFetching:o};if(this.ttls){c.ttl=this.ttls[r];let l=_Le.now()-this.starts[r];c.start=Math.floor(Date.now()-l)}this.sizes&&(c.size=this.sizes[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=_Le.now()-o}this.set(r,n.value,n)}}dispose(e,r,n){}set(e,r,{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(c=this.requireSize(e,r,c,l),this.maxSize&&c>this.maxSize)return this;let d=this.size===0?void 0:this.keyMap.get(e);if(d===void 0)d=this.newIndex(),this.keyList[d]=e,this.valList[d]=r,this.keyMap.set(e,d),this.next[this.tail]=d,this.prev[d]=this.tail,this.tail=d,this.size++,this.addItemSize(d,c),u=!1;else{let f=this.valList[d];r!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,e,"set"),this.disposeAfter&&this.disposed.push([f,e,"set"])),this.removeItemSize(d),this.valList[d]=r,this.addItemSize(d,c)),this.moveToTail(d)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(d,n,o),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let r=this.head,n=this.keyList[r],o=this.valList[r];return this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,n,"evict"),this.disposeAfter&&this.disposed.push([o,n,"evict"])),this.removeItemSize(r),e&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(e,{updateAgeOnHas:r=this.updateAgeOnHas}={}){let n=this.keyMap.get(e);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(e,{allowStale:r=this.allowStale}={}){let n=this.keyMap.get(e);if(n!==void 0&&(r||!this.isStale(n))){let o=this.valList[n];return this.isBackgroundFetch(o)?o.__staleWhileFetching:o}}backgroundFetch(e,r,n,o){let s=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(s))return s;let c=new Vbt,l={signal:c.signal,options:n,context:o},u=a(m=>(c.signal.aborted||this.set(e,m,l.options),m),"cb"),d=a(m=>{if(this.valList[r]===h&&(!n.noDeleteOnFetchRejection||h.__staleWhileFetching===void 0?this.delete(e):this.valList[r]=h.__staleWhileFetching),h.__returned===h)throw m},"eb"),f=a(m=>m(this.fetchMethod(e,s,l)),"pcall"),h=new Promise(f).then(u,d);return h.__abortController=c,h.__staleWhileFetching=s,h.__returned=null,r===void 0?(this.set(e,h,l.options),r=this.keyMap.get(e)):this.valList[r]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:h=this.fetchContext,forceRefresh:m=!1}={}){if(!this.fetchMethod)return this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o});let g={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f},A=this.keyMap.get(e);if(A===void 0){let y=this.backgroundFetch(e,A,g,h);return y.__returned=y}else{let y=this.valList[A];if(this.isBackgroundFetch(y))return r&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!m&&!this.isStale(A))return this.moveToTail(A),n&&this.updateItemAge(A),y;let E=this.backgroundFetch(e,A,g,h);return r&&E.__staleWhileFetching!==void 0?E.__staleWhileFetching:E.__returned=E}}get(e,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet}={}){let s=this.keyMap.get(e);if(s!==void 0){let c=this.valList[s],l=this.isBackgroundFetch(c);return this.isStale(s)?l?r?c.__staleWhileFetching:void 0:(o||this.delete(e),r?c:void 0):l?void 0:(this.moveToTail(s),n&&this.updateItemAge(s),c)}}connect(e,r){this.prev[r]=e,this.next[e]=r}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return $5r("del","delete"),this.delete}delete(e){let r=!1;if(this.size!==0){let n=this.keyMap.get(e);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);let o=this.valList[n];this.isBackgroundFetch(o)?o.__abortController.abort():(this.dispose(o,e,"delete"),this.disposeAfter&&this.disposed.push([o,e,"delete"])),this.keyMap.delete(e),this.keyList[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(let e of this.rindexes({allowStale:!0})){let r=this.valList[e];if(this.isBackgroundFetch(r))r.__abortController.abort();else{let n=this.keyList[e];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return $5r("reset","clear"),this.clear}get length(){return YRc("length","size"),this.size}static get AbortController(){return Vbt}static get AbortSignal(){return bqi}};Iqi.exports=Xye});var Z5r=I((Abh,xqi)=>{"use strict";p();var vLe=class extends Error{static{a(this,"FetchBaseError")}constructor(e,r,n){super(e),this.type=r,this._name=n}get name(){return this._name}get[Symbol.toStringTag](){return this._name}},K5r=class extends vLe{static{a(this,"FetchError")}constructor(e,r,n){super(e,r,"FetchError"),n&&(this.code=n.code,this.errno=n.errno,this.erroredSysCall=n.syscall)}},J5r=class extends vLe{static{a(this,"AbortError")}constructor(e,r="aborted"){super(e,r,"AbortError")}};xqi.exports={FetchBaseError:vLe,FetchError:K5r,AbortError:J5r}});var G6=I((_bh,Rqi)=>{"use strict";p();var{constants:{MAX_LENGTH:KRc}}=require("buffer"),{pipeline:zbt,PassThrough:JRc}=require("stream"),{promisify:ZRc}=require("util"),{createGunzip:XRc,createInflate:ePc,createBrotliDecompress:tPc,constants:{Z_SYNC_FLUSH:wqi}}=require("zlib"),rPc=GP()("helix-fetch:utils"),nPc=ZRc(zbt),iPc=a((t,e)=>t===204||t===304||+e["content-length"]==0?!1:/^\s*(?:(x-)?deflate|(x-)?gzip|br)\s*$/.test(e["content-encoding"]),"canDecode"),oPc=a((t,e,r,n)=>{if(!iPc(t,e))return r;let o=a(s=>{s&&(rPc(`encountered error while decoding stream: ${s}`),n(s))},"cb");switch(e["content-encoding"].trim()){case"gzip":case"x-gzip":return zbt(r,XRc({flush:wqi,finishFlush:wqi}),o);case"deflate":case"x-deflate":return zbt(r,ePc(),o);case"br":return zbt(r,tPc(),o);default:return r}},"decodeStream"),sPc=a(t=>{if(!t||typeof t!="object"||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},"isPlainObject"),Ybt=a((t,e)=>{if(Buffer.isBuffer(t))return t.length;switch(typeof t){case"string":return t.length*2;case"boolean":return 4;case"number":return 8;case"symbol":return Symbol.keyFor(t)?Symbol.keyFor(t).length*2:(t.toString().length-8)*2;case"object":return Array.isArray(t)?aPc(t,e):cPc(t,e);default:return 0}},"calcSize"),aPc=a((t,e)=>(e.add(t),t.map(r=>e.has(r)?0:Ybt(r,e)).reduce((r,n)=>r+n,0)),"calcArraySize"),cPc=a((t,e)=>{if(t==null)return 0;e.add(t);let r=0,n=[];for(let o in t)n.push(o);return n.push(...Object.getOwnPropertySymbols(t)),n.forEach(o=>{if(r+=Ybt(o,e),typeof t[o]=="object"&&t[o]!==null){if(e.has(t[o]))return;e.add(t[o])}r+=Ybt(t[o],e)}),r},"calcObjectSize"),lPc=a(t=>Ybt(t,new WeakSet),"sizeof"),uPc=a(async t=>{let e=new JRc,r=0,n=[];return e.on("data",o=>{if(r+o.length>KRc)throw new Error("Buffer.constants.MAX_SIZE exceeded");n.push(o),r+=o.length}),await nPc(t,e),Buffer.concat(n,r)},"streamToBuffer");Rqi.exports={decodeStream:oPc,isPlainObject:sPc,sizeof:lPc,streamToBuffer:uPc}});var Jbt=I((bbh,Nqi)=>{"use strict";p();var{PassThrough:Pqi,Readable:$6}=require("stream"),{types:{isAnyArrayBuffer:Dqi}}=require("util"),{FetchError:dPc,FetchBaseError:fPc}=Z5r(),{streamToBuffer:pPc}=G6(),hPc=Buffer.alloc(0),OR=Symbol("Body internals"),mPc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),kqi=a(async t=>{if(t[OR].disturbed)throw new TypeError("Already read");if(t[OR].error)throw new TypeError(`Stream had error: ${t[OR].error.message}`);t[OR].disturbed=!0;let{stream:e}=t[OR];return e===null?hPc:pPc(e)},"consume"),Kbt=class{static{a(this,"Body")}constructor(e){let r;e==null?r=null:e instanceof URLSearchParams?r=$6.from(e.toString()):e instanceof $6?r=e:Buffer.isBuffer(e)?r=$6.from(e):Dqi(e)?r=$6.from(Buffer.from(e)):typeof e=="string"||e instanceof String?r=$6.from(e):r=$6.from(String(e)),this[OR]={stream:r,disturbed:!1,error:null},e instanceof $6&&r.on("error",n=>{let o=n instanceof fPc?n:new dPc(`Invalid response body while trying to fetch ${this.url}: ${n.message}`,"system",n);this[OR].error=o})}get body(){return this[OR].stream}get bodyUsed(){return this[OR].disturbed}async buffer(){return kqi(this)}async arrayBuffer(){return mPc(await this.buffer())}async text(){return(await kqi(this)).toString()}async json(){return JSON.parse(await this.text())}};Object.defineProperties(Kbt.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});var gPc=a(t=>{if(t[OR].disturbed)throw new TypeError("Cannot clone: already read");let{stream:e}=t[OR],r=e;if(e instanceof $6){r=new Pqi;let n=new Pqi;e.pipe(r),e.pipe(n),t[OR].stream=n}return r},"cloneStream"),APc=a(t=>t===null?null:typeof t=="string"?"text/plain; charset=utf-8":t instanceof URLSearchParams?"application/x-www-form-urlencoded; charset=utf-8":Buffer.isBuffer(t)||Dqi(t)||t instanceof $6?null:"text/plain; charset=utf-8","guessContentType");Nqi.exports={Body:Kbt,cloneStream:gPc,guessContentType:APc}});var eEe=I((Ibh,Lqi)=>{"use strict";p();var{validateHeaderName:Mqi,validateHeaderValue:Oqi}=require("http"),{isPlainObject:yPc}=G6(),V6=Symbol("Headers internals"),CLe=a(t=>{let e=typeof t!="string"?String(t):t;if(typeof Mqi=="function")Mqi(e);else if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let r=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),r}return e.toLowerCase()},"normalizeName"),Bqi=a((t,e)=>{let r=typeof t!="string"?String(t):t;if(typeof Oqi=="function")Oqi(e,r);else if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}return r},"normalizeValue"),Zbt=class t{static{a(this,"Headers")}constructor(e={}){if(this[V6]={map:new Map},e instanceof t)e.forEach((r,n)=>{this.append(n,r)});else if(Array.isArray(e))e.forEach(([r,n])=>{this.append(r,n)});else if(yPc(e))for(let[r,n]of Object.entries(e))this.append(r,n)}set(e,r){this[V6].map.set(CLe(e),Bqi(r,e))}has(e){return this[V6].map.has(CLe(e))}get(e){let r=this[V6].map.get(CLe(e));return r===void 0?null:r}append(e,r){let n=CLe(e),o=Bqi(r,e),s=this[V6].map.get(n);this[V6].map.set(n,s?`${s}, ${o}`:o)}delete(e){this[V6].map.delete(CLe(e))}forEach(e,r){for(let n of this.keys())e.call(r,this.get(n),n)}keys(){return Array.from(this[V6].map.keys()).sort()}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return this.constructor.name}plain(){return Object.fromEntries(this[V6].map)}};Object.defineProperties(Zbt.prototype,["append","delete","entries","forEach","get","has","keys","set","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));Lqi.exports={Headers:Zbt}});var X5r=I((Rbh,Fqi)=>{"use strict";p();var{EventEmitter:EPc}=require("events"),eN=Symbol("AbortSignal internals"),tEe=class{static{a(this,"AbortSignal")}constructor(){this[eN]={eventEmitter:new EPc,onabort:null,aborted:!1}}get aborted(){return this[eN].aborted}get onabort(){return this[eN].onabort}set onabort(e){this[eN].onabort=e}get[Symbol.toStringTag](){return this.constructor.name}removeEventListener(e,r){this[eN].eventEmitter.removeListener(e,r)}addEventListener(e,r){this[eN].eventEmitter.on(e,r)}dispatchEvent(e){let r={type:e,target:this},n=`on${e}`;typeof this[eN][n]=="function"&&this[n](r),this[eN].eventEmitter.emit(e,r)}fire(){this[eN].aborted=!0,this.dispatchEvent("abort")}};Object.defineProperties(tEe.prototype,{addEventListener:{enumerable:!0},removeEventListener:{enumerable:!0},dispatchEvent:{enumerable:!0},aborted:{enumerable:!0},onabort:{enumerable:!0}});var e1t=class extends tEe{static{a(this,"TimeoutSignal")}constructor(e){if(!Number.isInteger(e))throw new TypeError(`Expected an integer, got ${typeof e}`);super(),this[eN].timerId=setTimeout(()=>{this.fire()},e)}clear(){clearTimeout(this[eN].timerId)}};Object.defineProperties(e1t.prototype,{clear:{enumerable:!0}});var Xbt=Symbol("AbortController internals"),t1t=class{static{a(this,"AbortController")}constructor(){this[Xbt]={signal:new tEe}}get signal(){return this[Xbt].signal}get[Symbol.toStringTag](){return this.constructor.name}abort(){this[Xbt].signal.aborted||this[Xbt].signal.fire()}};Object.defineProperties(t1t.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}});Fqi.exports={AbortController:t1t,AbortSignal:tEe,TimeoutSignal:e1t}});var bLe=I((Dbh,qqi)=>{"use strict";p();var{randomBytes:_Pc}=require("crypto"),{Readable:vPc}=require("stream"),t4r=a(t=>typeof t=="object"&&["arrayBuffer","stream","text","slice","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&typeof t.type=="string"&&typeof t.size=="number"&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),"isBlob"),CPc=a(t=>t!=null&&typeof t=="object"&&["append","delete","get","getAll","has","set","keys","values","entries","constructor"].map(e=>typeof t[e]).filter(e=>e!=="function").length===0&&t[Symbol.toStringTag]==="FormData","isFormData"),Uqi=a(t=>`--${t}--\r \r -`,"getFooter"),Vqi=a((t,e,r)=>{let n="";return n+=`--${t}\r -`,n+=`Content-Disposition: form-data; name="${e}"`,E4r(r)&&(n+=`; filename="${r.name}"\r +`,"getFooter"),Qqi=a((t,e,r)=>{let n="";return n+=`--${t}\r +`,n+=`Content-Disposition: form-data; name="${e}"`,t4r(r)&&(n+=`; filename="${r.name}"\r `,n+=`Content-Type: ${r.type||"application/octet-stream"}`),`${n}\r \r -`},"getHeader");async function*g2c(t,e){for(let[r,n]of t)yield Vqi(e,r,n),E4r(n)?yield*n.stream():yield n,yield`\r -`;yield $qi(e)}a(g2c,"formDataIterator");var A2c=a((t,e)=>{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(Vqi(e,n,o)),r+=E4r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r -`);return r+=Buffer.byteLength($qi(e)),r},"getFormDataLength"),y4r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=p2c(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=A2c(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return h2c.from(g2c(this.fd,this.boundary))}};Wqi.exports={isFormData:m2c,FormDataSerializer:y4r}});var Yqi=I((v1h,zqi)=>{"use strict";p();var{AbortSignal:C1h}=A4r(),{Body:y2c,cloneStream:E2c,guessContentType:_2c}=u1t(),{Headers:C2c}=uEe(),{isPlainObject:v2c}=Z6(),{isFormData:b2c,FormDataSerializer:S2c}=BLe(),T2c=20,sV=Symbol("Request internals"),m1t=class t extends y2c{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?E2c(n):null),l=new C2c(r.headers||n&&n.headers||{});if(b2c(c)&&!l.has("content-type")){let h=new S2c(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(v2c(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=_2c(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[sV]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=T2c:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[sV].method}get url(){return this[sV].parsedURL.toString()}get headers(){return this[sV].headers}get redirect(){return this[sV].redirect}get cache(){return this[sV].cache}get signal(){return this[sV].signal}clone(){return new t(this)}get init(){return this[sV].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(m1t.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});zqi.exports={Request:m1t}});var _4r=I((T1h,Kqi)=>{"use strict";p();var{Body:I2c,cloneStream:x2c,guessContentType:w2c}=u1t(),{Headers:R2c}=uEe(),{isPlainObject:k2c}=Z6(),{isFormData:P2c,FormDataSerializer:D2c}=BLe(),iN=Symbol("Response internals"),g1t=class t extends I2c{static{a(this,"Response")}constructor(e=null,r={}){let n=new R2c(r.headers),o=e;if(P2c(o)&&!n.has("content-type")){let s=new D2c(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if(k2c(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=w2c(o);s&&n.set("content-type",s)}super(o),this[iN]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[iN].url||""}get status(){return this[iN].status}get statusText(){return this[iN].statusText}get ok(){return this[iN].status>=200&&this[iN].status<300}get redirected(){return this[iN].counter>0}get headers(){return this[iN].headers}get httpVersion(){return this[iN].httpVersion}get decoded(){return this[iN].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(x2c(this),{...this[iN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(g1t.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Kqi.exports={Response:g1t}});var Zqi=I((R1h,Jqi)=>{"use strict";p();var N2c=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),M2c=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),O2c=new Set([500,502,503,504]),B2c={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},L2c={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function wne(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(wne,"toNumberOrZero");function F2c(t){return t?O2c.has(t.status):!0}a(F2c,"isErrorResponse");function C4r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(C4r,"parseCacheControl");function U2c(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(U2c,"formatCacheControl");Jqi.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=C4r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=C4r(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":U2c(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&M2c.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||N2c.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=C4r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)B2c[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return wne(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return wne(this._rescc["s-maxage"])}if(this._rescc["max-age"])return wne(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+wne(this._rescc["stale-if-error"]),n=e+wne(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+wne(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+wne(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&F2c(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!L2c[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var rji=I((D1h,tji)=>{"use strict";p();var Q2c=Zqi(),{Headers:q2c}=uEe(),Xqi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),eji=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),v4r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new Q2c(Xqi(e),eji(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(Xqi(e))}responseHeaders(e){return new q2c(this.policy.responseHeaders(eji(e)))}timeToLive(){return this.policy.timeToLive()}};tji.exports=v4r});var oji=I((O1h,iji)=>{"use strict";p();var{Readable:j2c}=require("stream"),{Headers:nji}=uEe(),{Response:H2c}=_4r(),aV=Symbol("CacheableResponse internals"),G2c=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),b4r=class t extends H2c{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new nji(r.headers);this[aV]={headers:n,bufferedBody:e}}get headers(){return this[aV].headers}set headers(e){if(e instanceof nji)this[aV].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return j2c.from(this[aV].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[aV].bufferedBody}async arrayBuffer(){return G2c(this[aV].bufferedBody)}async text(){return this[aV].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[aV].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},$2c=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new b4r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");iji.exports={cacheableResponse:$2c}});var A1t=I((F1h,sji)=>{"use strict";p();var S4r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};sji.exports={RequestAbortedError:S4r}});var dji=I((q1h,uji)=>{"use strict";p();var cji=require("http"),lji=require("https"),{Readable:V2c}=require("stream"),t9=Wk()("helix-fetch:h1"),{RequestAbortedError:aji}=A1t(),{decodeStream:W2c}=Z6(),z2c=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new lji.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new cji.Agent(n),r.httpAgent):void 0},"getAgent"),Y2c=a(t=>{t.h1={}},"setupContext"),K2c=a(async({h1:t})=>{t.httpAgent&&(t9("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(t9("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),J2c=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?W2c(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),Z2c=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?lji:cji,o=z2c(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{t9(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{t9(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{t9(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new aji),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new aji);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(J2c(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(t9(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(t9(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof V2c?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");uji.exports={request:Z2c,setupContext:Y2c,resetContext:K2c}});var mji=I((G1h,hji)=>{"use strict";p();var{connect:X2c,constants:eDc}=require("http2"),{Readable:tDc}=require("stream"),hd=Wk()("helix-fetch:h2"),{RequestAbortedError:fji}=A1t(),{decodeStream:rDc}=Z6(),{NGHTTP2_CANCEL:LLe}=eDc,nDc=300*1e3,iDc=5e3,oDc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),sDc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),hd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),pji=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?rDc(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),aDc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=iDc}}}=t,d=o[":path"],f=`${e}${d}`;hd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(LLe)},"rejectPush")),n.on("push",(h,m)=>{hd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{hd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(LLe)}),l&&l(f,o,pji(h,n,r))}),n.on("aborted",()=>{hd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{hd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{hd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),cDc=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=nDc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),L={...u,rejectUnauthorized:N};E&&!E.inUse&&(L.createConnection=()=>(hd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=X2c(n,{...L,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{hd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{hd(`session ${n} established`),hd(`caching session ${n}`),d[n]=w}),w.on("localSettings",Q=>{hd(`session ${n} localSettings: ${JSON.stringify(Q)}`)}),w.on("remoteSettings",Q=>{hd(`session ${n} remoteSettings: ${JSON.stringify(Q)}`)}),w.once("close",()=>{hd(`session ${n} closed`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.once("error",Q=>{hd(`session ${n} encountered error: ${Q}`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(Q,M,O)=>{hd(`session ${n} encountered frameError: type: ${Q}, code: ${M}, id: ${O}`)}),w.once("goaway",(Q,M,O)=>{hd(`session ${n} received GOAWAY frame: errorCode: ${Q}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(Q,M,O)=>{aDc(t,n,v,Q,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(hd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());hd(`${A} ${e.host}${l}`);let R,{signal:x}=g,k=a(()=>{x.removeEventListener("abort",k),T(new fji),R&&R.close(LLe)},"onAbortSignal");if(x){if(x.aborted){T(new fji);return}x.addEventListener("abort",k)}let D=a(N=>{hd(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),b(pji(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",k),R.rstCode!==LLe&&(hd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(LLe),T(N))}),R.once("frameError",(N,L,B)=>{w.off("error",D),hd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${L}, id: ${B}`)}),R.on("push",(N,L)=>{hd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${L}`)}),_ instanceof tDc?_.pipe(R):(_&&R.write(_),R.end())})},"request");hji.exports={request:cDc,setupContext:oDc,resetContext:sDc}});var Aji=I((W1h,gji)=>{"use strict";p();var{EventEmitter:lDc}=require("events"),uDc=a(()=>{let t={},e=new lDc;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");gji.exports=uDc});var yji=I((K1h,dDc)=>{dDc.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var bji=I((J1h,vji)=>{"use strict";p();var{Readable:fDc}=require("stream"),pDc=require("tls"),{types:{isAnyArrayBuffer:hDc}}=require("util"),mDc=p4r(),T4r=Wk()("helix-fetch:core"),{RequestAbortedError:y1t}=A1t(),I4r=dji(),E1t=mji(),gDc=Aji(),{isPlainObject:ADc}=Z6(),{isFormData:yDc,FormDataSerializer:EDc}=BLe(),{version:_Dc}=yji(),x4r="h2",w4r="h2c",R4r="http/1.0",Rne="http/1.1",CDc=100,vDc=3600*1e3,bDc=[x4r,Rne,R4r],SDc=`helix-fetch/${_Dc}`,TDc={method:"GET",compress:!0,decode:!0},Eji=0,_ji=gDc(),Cji=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new y1t;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new y1t);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof y1t||(T4r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=pDc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),Eji+=1,s.id=Eji,s.secureConnecting=!1,T4r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),IDc=a(async(t,e)=>{let r=await _ji.acquire(t.origin);try{return r||(r=await Cji(t,e)),r}finally{_ji.release(t.origin,r)}},"connect"),xDc=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=Rne,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=w4r,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await IDc(e,d);return o=f.alpnProtocol,o||(o=Rne),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),wDc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),RDc=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await Cji(e,d);return{protocol:f.alpnProtocol||Rne,socket:f}}return{protocol:l.alpnProtocol||Rne,socket:l}},"getProtocolAndSocketFromFactory"),kDc=a(async(t,e,r)=>{let n=new URL(e),o={...TDc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=wDc(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(yDc(o.body)){let d=new EDc(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":ADc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):hDc(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof fDc||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await RDc(t.socketFactory,n,o,t.alpnProtocols):await xDc(t,n,c);switch(T4r(`${n.host} -> ${l}`),l){case x4r:try{return await E1t.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case w4r:return E1t.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case R4r:case Rne:return I4r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),PDc=a(async t=>(t.alpnCache.clear(),Promise.all([I4r.resetContext(t),E1t.resetContext(t)])),"resetContext"),DDc=a(t=>{let{options:{alpnProtocols:e=bDc,alpnCacheTTL:r=vDc,alpnCacheSize:n=CDc,userAgent:o=SDc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new mDc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,I4r.setupContext(t),E1t.setupContext(t)},"setupContext");vji.exports={request:kDc,setupContext:DDc,resetContext:PDc,RequestAbortedError:y1t,ALPN_HTTP2:x4r,ALPN_HTTP2C:w4r,ALPN_HTTP1_1:Rne,ALPN_HTTP1_0:R4r}});var Tji=I((eSh,Sji)=>{"use strict";p();var NDc=Wk()("helix-fetch:core"),{request:MDc,setupContext:ODc,resetContext:BDc,RequestAbortedError:LDc,ALPN_HTTP2:FDc,ALPN_HTTP2C:UDc,ALPN_HTTP1_1:QDc,ALPN_HTTP1_0:qDc}=bji(),k4r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},ODc(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:LDc,ALPN_HTTP2:FDc,ALPN_HTTP2C:UDc,ALPN_HTTP1_1:QDc,ALPN_HTTP1_0:qDc}}async request(e,r){return MDc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return NDc("resetting context"),BDc(this)}};Sji.exports=new k4r().api()});var kji=I((nSh,Rji)=>{"use strict";p();var{EventEmitter:jDc}=require("events"),{Readable:FLe}=require("stream"),P4r=Wk()("helix-fetch"),HDc=p4r(),{Body:GDc}=u1t(),{Headers:O4r}=uEe(),{Request:kne}=Yqi(),{Response:N4r}=_4r(),{FetchBaseError:$Dc,FetchError:ULe,AbortError:_1t}=g4r(),{AbortController:VDc,AbortSignal:WDc,TimeoutSignal:zDc}=A4r(),YDc=rji(),{cacheableResponse:KDc}=oji(),{sizeof:JDc}=Z6(),{isFormData:ZDc}=BLe(),{context:XDc,RequestAbortedError:eNc}=Tji(),Iji=["GET","HEAD"],tNc=500,rNc=100*1024*1024,D4r="push",xji=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof kne&&typeof r>"u"?e:new kne(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new _1t("The operation was aborted.");throw o.init.body instanceof FLe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof FLe)&&!ZDc(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof FLe&&m.destroy(w),w instanceof TypeError?w:w instanceof eNc?new _1t("The operation was aborted."):new ULe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new _1t("The operation was aborted.");o.init.body instanceof FLe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new ULe(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new ULe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new O4r(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof FLe)throw l&&l.removeEventListener("abort",A),new ULe("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),xji(t,new kne(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new N4r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),wji=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!Iji.includes(e.method))return r;let n=new YDc(e,r,{shared:!1});if(n.storable()){let o=await KDc(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),nNc=a(async(t,e,r)=>{let n=new kne(e,r);if(t.options.maxCacheSize!==0&&Iji.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new O4r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await xji(t,n);return n.cache!=="no-store"?wji(t,n,s):s},"cachingFetch"),iNc=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),oNc=a(t=>new zDc(t),"timeoutSignal"),M4r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:rNc,o=tNc;n===0&&(n=1,o=1);let s=a(({response:l},u)=>JDc(l),"sizeCalculation");this.cache=new HDc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new jDc,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new N4r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=XDc(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:GDc,Headers:O4r,Request:kne,Response:N4r,AbortController:VDc,AbortSignal:WDc,FetchBaseError:$Dc,FetchError:ULe,AbortError:_1t,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:iNc,timeoutSignal:oNc,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return nNc(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(D4r,e)}offPush(e){return this.eventEmitter.off(D4r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){P4r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new kne(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(P4r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){P4r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await wji(this,new kne(e,{headers:r}),n);this.eventEmitter.emit(D4r,e,o)}};Rji.exports=new M4r().api()});var Dji=I((sSh,Pji)=>{"use strict";p();Pji.exports=kji()});var eHi=I((lxh,Xji)=>{"use strict";p();function Zji(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(Zji,"validateParameter");function DNc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(DNc,"hasOwnProperty");function NNc(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(NNc,"defineOperation");Xji.exports={defineOperation:NNc,validateParameter:Zji}});var q4r=I((fxh,nHi)=>{"use strict";p();var AEe=g8e()("kerberos"),gEe=AEe.KerberosClient,tHi=AEe.KerberosServer,lV=eHi().defineOperation,MNc=1,ONc=2,BNc=4,LNc=8,FNc=16,UNc=32,QNc=64,qNc=128,jNc=256,rHi=0,HNc=9,GNc=6;gEe.prototype.step=lV(gEe.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);gEe.prototype.wrap=lV(gEe.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);gEe.prototype.unwrap=lV(gEe.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);tHi.prototype.step=lV(tHi.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var $Nc=lV(AEe.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),VNc=lV(AEe.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),WNc=lV(AEe.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:rHi}},{name:"callback",type:"function",required:!1}]),zNc=lV(AEe.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);nHi.exports={initializeClient:WNc,initializeServer:zNc,principalDetails:VNc,checkPassword:$Nc,GSS_C_DELEG_FLAG:MNc,GSS_C_MUTUAL_FLAG:ONc,GSS_C_REPLAY_FLAG:BNc,GSS_C_SEQUENCE_FLAG:LNc,GSS_C_CONF_FLAG:FNc,GSS_C_INTEG_FLAG:UNc,GSS_C_ANON_FLAG:QNc,GSS_C_PROT_READY_FLAG:qNc,GSS_C_TRANS_FLAG:jNc,GSS_C_NO_OID:rHi,GSS_MECH_OID_KRB5:HNc,GSS_MECH_OID_SPNEGO:GNc}});var iHi=I((hxh,YNc)=>{YNc.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var sHi=I((mxh,oHi)=>{"use strict";p();var KNc=require("dns"),JNc=q4r(),j4r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=ZNc(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();KNc.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;JNc.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function ZNc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=XNc(t),r(null,o)})}}a(ZNc,"firstTransition");function XNc(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=eMc(t),r(null,o||"")})}}a(XNc,"secondTransition");function eMc(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=tMc(t),r(null,c)})})}}a(eMc,"thirdTransition");function tMc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(tMc,"fourthTransition");oHi.exports={MongoAuthProcess:j4r}});var cHi=I((yxh,jLe)=>{"use strict";p();var aHi=q4r();jLe.exports=aHi;jLe.exports.Kerberos=aHi;jLe.exports.version=iHi().version;jLe.exports.processes={MongoAuthProcess:sHi().MongoAuthProcess}});var QXi={};wi(QXi,{AbortError:()=>g1,DirectConnectError:()=>GR,DirectConnectTransport:()=>WLr,EXIT_REASONS:()=>Q5c,HOOK_EVENTS:()=>zTt,InMemorySessionStore:()=>zBr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>q5c,createSdkMcpServer:()=>EGc,deleteSession:()=>Ezc,filterEscalatingDefaultMode:()=>izc,foldSessionSummary:()=>NVi,forkSession:()=>_zc,getSessionInfo:()=>gzc,getSessionMessages:()=>hzc,getSubagentMessages:()=>Szc,importSessionToStore:()=>Czc,listSessions:()=>mzc,listSubagents:()=>bzc,parseDirectConnectUrl:()=>vGc,query:()=>fzc,renameSession:()=>Azc,resolveSettings:()=>szc,startup:()=>pzc,tagSession:()=>yzc,tool:()=>yGc});function oOc(t){return this[t]}function lOc(t,e){this[t]=cOc.bind(null,e)}function WBr(t=F5c){let e=new AbortController;return(0,wVi.setMaxListeners)(t,e.signal),e}function RVi(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function U5c(t,e){t(Error(e))}function Qne(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(U5c,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function A3r(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` -`," ").trim();if(!c)continue;let l=H5c.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!j5c.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function NVi(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=W5c(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}z5c(c,l);for(let[d,f]of Object.entries(G5c)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function $5c(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=fV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=fV(r.customTitle)||fV(r.aiTitle)||void 0,s=o||fV(r.lastPrompt)||fV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:fV(r.gitBranch)||void 0,cwd:fV(r.cwd)||e||void 0,tag:fV(r.tag)||void 0,createdAt:V5c(r.createdAt)}:null}function fV(t){return typeof t=="string"?t:void 0}function V5c(t){return typeof t=="number"?t:void 0}function W5c(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function z5c(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=A3r(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function MVi(){return process.versions.bun!==void 0}function HE(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function tFe(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function t4c(t){var e=X5c.call(t,VLe),r=t[VLe];try{t[VLe]=void 0;var n=!0}catch{}var o=e4c.call(t);return n&&(e?t[VLe]=r:delete t[VLe]),o}function o4c(t){return i4c.call(t)}function l4c(t){return t==null?t===void 0?c4c:a4c:eGi&&eGi in Object(t)?r4c(t):s4c(t)}function u4c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function m4c(t){if(!p9(t))return!1;var e=rFe(t);return e==f4c||e==p4c||e==d4c||e==h4c}function A4c(t){return!!tGi&&tGi in t}function C4c(t){if(t!=null){try{return _4c.call(t)}catch{}try{return t+""}catch{}}return""}function k4c(t){if(!p9(t)||y4c(t))return!1;var e=y3r(t)?R4c:S4c;return e.test(v4c(t))}function D4c(t,e){return t?.[e]}function M4c(t,e){var r=N4c(t,e);return P4c(r)?r:void 0}function B4c(){this.__data__=I3e?I3e(null):{},this.size=0}function F4c(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function H4c(t){var e=this.__data__;if(I3e){var r=e[t];return r===Q4c?void 0:r}return j4c.call(e,t)?e[t]:void 0}function W4c(t){var e=this.__data__;return I3e?e[t]!==void 0:V4c.call(e,t)}function K4c(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=I3e&&e===void 0?Y4c:e,this}function p_e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function uBc(t,e){var r=this.__data__,n=KTt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function h_e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function BBc(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function jVi(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function HVi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return jVi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function b3r(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function LBc(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function UBc(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new xi(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function $Vi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new Jl(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new Jl(`Refusing to send credential over non-https token endpoint "${t}"`)}async function VVi(t,e){let r=await VBc(t),n;try{n=JSON.parse(r)}catch{throw new Jl(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,$R(r),e)}if(!n.access_token)throw new Jl(`Token endpoint response missing access_token: ${JSON.stringify($R(n))}`,t.status,$R(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new Jl(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,$R(n),e);return n}function $R(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=mBr?t:t.slice(0,mBr)+`... <${t.length-mBr} more chars>`}return JSON.stringify($R(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))$Bc.has(r)&&(e[r]=n);return e}return null}async function WVi(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new Jl(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new Jl(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function zVi(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function VBc(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>cGi){let l=cGi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function qne(){return Math.floor(Date.now()/1e3)}function WBc(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function T3r(t){let e;return(lGi??(e=new globalThis.TextEncoder,lGi=e.encode.bind(e)))(t)}function dGi(t){let e;return(uGi??(e=new globalThis.TextDecoder,uGi=e.decode.bind(e)))(t)}function p3e(){}function K1t(t,e,r){return!e||DSt[t]>DSt[r]?p3e:e[t].bind(e)}function Ug(t){let e=t.logger,r=t.logLevel??"off";if(!e)return zBc;let n=pGi.get(e);if(n&&n[0]===r)return n[1];let o={error:K1t("error",e,r),warn:K1t("warn",e,r),info:K1t("info",e,r),debug:K1t("debug",e,r)};return pGi.set(e,[r,o]),o}function KVi(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!YBc.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function hGi(t){if(!t)throw new xi("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new xi(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new xi(`Identity token file at ${t} is empty`);return n}}function XBc(t){if(!t)throw new xi("Identity token value is empty");return()=>t}function eLc(t){return async()=>{$Vi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new Jl(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:QBc,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${GVi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${PSt},${jBc}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${_V} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new Jl(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=$R(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new Jl(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await VVi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new Jl(`Token endpoint response missing required fields: ${JSON.stringify($R(c))}`,o.status,$R(c),s);return{token:c.access_token,expiresAt:qne()+l}}}function tLc(t){return async e=>{let r=await import("node:fs");await WVi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new Jl(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new Jl(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new Jl(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||qne()"");throw new Jl(`User OAuth refresh failed (HTTP ${f.status}): ${$R(E)}`,f.status,$R(E),h)}let m=await VVi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new Jl(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify($R(m))}`,f.status,$R(m),h);let A=qne()+g,y=m.refresh_token||l;return await zVi(t.credentialsPath,{...o,version:YVi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function ZVi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=nLc(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function rLc(t,e){let r=await KBc(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await JBc(n,e)??void 0}};return ZVi(s,t)}function nLc(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=iLc(o);if(!s)throw new Jl("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new Jl("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new Jl("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=eLc({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?oLc(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new Jl("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return tLc({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new Jl(`authentication.type "${o}" is not a known authentication type`)}}}function iLc(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new Jl(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new Jl('identity_token.source "file" requires a non-empty path');return hGi(t.identity_token.path)}let e=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return hGi(e);let r=Yl("ANTHROPIC_IDENTITY_TOKEN");return r?XBc(r):null}function oLc(t,e,r,n){return async o=>{let s=await import("node:fs");await WVi(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||qne()0&&(yield e)}function uLc(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function XVi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Ug(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Wne.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return eWi(u,r)}return await r.text()})();return Ug(t).debug(`[${n}] response parsed`,Fne({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function eWi(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function FEe(t,e,r){return tWi(),new File(t,e??"unknown_file",r)}function gSt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function dLc(t){let e=typeof t=="function"?t:t.fetch,r=mGi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return mGi.set(e,n),n}async function gLc(t,e,r){if(tWi(),t=await t,e||(e=gSt(t,!0)),hLc(t))return t instanceof File&&e==null&&r==null?t:FEe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(mLc(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),FEe(await rLr(o),e,r)}let n=await rLr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return FEe(n,e,r)}async function rLr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(nWi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(rWi(t))for await(let r of t)e.push(...await rLr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${ALc(t)}`)}return e}function ALc(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*yLc(t){if(!t)return;if(iWi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():nGi(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=nGi(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function oWi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function ASt(t){return typeof t=="object"&&t!==null&&v3e in t}function sWi(t,e){let r=new Set;if(t)for(let n of t)ASt(n)&&r.add(n[v3e]);if(e){for(let n of e)if(ASt(n)&&r.add(n[v3e]),Array.isArray(n.content))for(let o of n.content)ASt(o)&&r.add(o[v3e])}return Array.from(r)}function aWi(t,e){let r=sWi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function _Lc(t){return ASt(t)?{"x-stainless-helper":t[v3e]}:{}}function lWi(t){return t?.output_format??t?.output_config?.format}function AGi(t,e,r){let n=lWi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:uWi(t,e,r)}function uWi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=CLc(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function CLc(t,e){let r=lWi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new xi(`Failed to parse structured output: ${n}`)}}function CGi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function bGi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function xLc(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof GSt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function TGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new xi("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function fWi(t){return t?.output_config?.format}function IGi(t,e,r){let n=fWi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:pWi(t,e,r)}function pWi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=RLc(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function RLc(t,e){let r=fWi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new xi(`Failed to parse structured output: ${n}`)}}function kGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function nFe(t){return t instanceof Error?t:Error(String(t))}function ESt(t){return t instanceof Error?t.message:String(t)}function pI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function iFe(t){return pI(t)==="ENOENT"}function mWi(t){return pI(t)==="EISDIR"}function NLc(t){let e=pI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function BLc(t,e,r){let n=`${t}.tmp.${(0,yWi.randomBytes)(4).toString("hex")}`;try{await(0,cB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,cB.rename)(n,t)}catch(o){let s=pI(o);if(s!==void 0&&MLc.has(s)){try{await(0,cB.copyFile)(n,t)}catch(c){throw OLc.has(pI(c)??"")&&await(0,cB.unlink)(t).catch(()=>{}),c}await(0,cB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,cB.unlink)(n).catch(()=>{}),o}}function XSt(){return LLc.getStore()??new cLr}function EWi(){if(wEe)return wEe;if(!HE(process.env.DEBUG_CLAUDE_AGENT_SDK))return jne=null,wEe=Promise.resolve(),wEe;let t=(0,aLr.join)(g_e(),"debug");return jne=(0,aLr.join)(t,`sdk-${(0,gWi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${jne} -`),wEe=XSt().mkdir(t).catch(()=>{}),wEe}function FLc(){return EWi(),jne??null}function jR(t){if(jne===null)return;let e=`${new Date().toISOString()} ${t} -`;EWi().then(()=>{jne&&XSt().append(jne,e).catch(()=>{})})}function ULc(){this.__data__=new JTt,this.size=0}function qLc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function HLc(t){return this.__data__.get(t)}function $Lc(t){return this.__data__.has(t)}function zLc(t,e){var r=this.__data__;if(r instanceof JTt){var n=r.__data__;if(!LVi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=C3c}function W3c(t){return y_e(t)&&P3r(t.length)&&!!md[rFe(t)]}function Y3c(t){return function(e){return t(e)}}function rFc(t,e){var r=IV(t),n=!r&&D3e(t),o=!r&&!n&&k3r(t),s=!r&&!n&&!o&&SWi(t),c=r||n||o||s,l=c?o3c(t.length,String):[],u=l.length;for(var d in t)(e||tFc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||XTt(d,u)))&&l.push(d);return l}function oFc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||iFc;return t===r}function sFc(t,e){return function(r){return t(e(r))}}function cFc(t){return t!=null&&P3r(t.length)&&!y3r(t)}function lFc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function pFc(t){if(!p9(t))return uFc(t);var e=TWi(t),r=[];for(var n in t)n=="constructor"&&(e||!fFc.call(t,n))||r.push(n);return r}function mFc(t){return D3r(t)?nFc(t,!0):hFc(t)}function AFc(t,e){if(e)return t.slice();var r=t.length,n=FGi?FGi(r):new t.constructor(r);return t.copy(n),n}function yFc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function R8c(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function P8c(t){return k8c.register(t)}function N8c(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function M8c(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function O8c(t,e){if(!e)return!0;let r=N8c(t);return M8c(r,e)}function B8c(t){return/^[\\/]{2}/.test(t)}function L8c(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function HGi(t){try{return L8c(MWi.realpathSync.native(t))}catch{return null}}function F8c(t,e){let r=(0,lB.resolve)(e).toLowerCase(),n=(0,lB.resolve)(t).toLowerCase();if((0,lB.dirname)(n)===r||n.startsWith(r+lB.sep))return!0;let o=HGi(e)?.toLowerCase();if(o==null)return!1;let s=HGi((0,lB.dirname)((0,lB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+lB.sep)}function OWi(t,e){if(B8c(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function hI(){return Q8c}function q8c(t,e){t.destroyed||t.write(e)}function j8c(t){q8c(process.stderr,t)}function H8c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function G8c(t,e,r=e+"s"){return t===1?e:r}function $8c(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function Y8c(t){return z8c.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function K8c(t){VGi??=Y8c(!0);for(let e of VGi)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function tIt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function e6c(t){if(!pLr()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=X8c();return O8c(t,e)}async function FWi(t,e,r=r6c){if(c3e<0?c3e=await(0,VE.stat)(t).then(n=>n.size).catch(()=>0):c3e+=e,!(c3e<=r||xBr)){xBr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,VE.rename)(t,n)}catch(o){iFe(o)||(await(0,VE.unlink)(n).catch(()=>{}),await(0,VE.rename)(t,n).catch(()=>(0,VE.unlink)(t).catch(()=>{})))}c3e=0}finally{xBr=!1}}}function UWi(t){return hLr=(0,eie.join)(t,`${NWi()}.txt`),hLr}async function n6c(t,e,r,n){t&&await(0,VE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,VE.appendFile)(r,n)}catch(s){if(!mWi(s))throw s;o=UWi(r),await(0,VE.appendFile)(o,n)}await FWi(o,Buffer.byteLength(n)).catch(mLr),qWi()}function mLr(){}function i6c(){if(!dSt){let t=null;dSt=w8c({writeFn:a(e=>{let r=QWi(),n=(0,eie.dirname)(r),o=t!==n;if(t=n,pLr()){if(o)try{hI().mkdirSync(n)}catch{}let s=r;try{hI().appendFileSync(r,e)}catch(c){if(!mWi(c))throw c;s=UWi(r),hI().appendFileSync(s,e)}FWi(s,Buffer.byteLength(e)).catch(mLr),qWi();return}IBr=IBr.then(n6c.bind(null,o,n,r,e)).catch(mLr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:pLr()}),P8c(async()=>{dSt?.dispose(),await IBr})}return dSt}function Kl(t,{level:e}={level:"debug"}){if(fLr[e]t.endsWith(e))}function h6c(t,e){return(0,PVi.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function m6c(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function g6c(t,e=process.platform,r=process.arch,n=jWi.existsSync,o=m6c()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${REe}-linux-${r}-android`]:e==="linux"?o?[`${REe}-linux-${r}-musl`,`${REe}-linux-${r}`]:[`${REe}-linux-${r}`,`${REe}-linux-${r}-musl`]:[`${REe}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function A6c(){return{eventQueue:[],sink:null}}function F3r(t,e){let r=y6c;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function HWi(t){F3r("tengu_feature_ok",{feature_name:t})}function GWi(t,e,r){F3r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function E6c(t,e,r){F3r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function s9(t,e,r){try{let n=await e();return HWi(t),n}catch(n){throw GWi(t,r?.(n)??"error"),n}}function C6c(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function S3e(t){if(typeof t=="string")return C6c(t);if(Array.isArray(t))return t.map(S3e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[S3e(r)]=S3e(n);return e}return t}function v6c(){return process.platform==="win32"}function S6c(t){let e=wBr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,KWi.join)(r,"System32","where.exe");try{let o=(0,YWi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:b6c,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!F8c(c,s))return wBr.set(t,c),c;return null}catch(o){return T6c(o)&&wBr.set(t,null),null}}function T6c(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function I6c(t){return!v6c()||t.includes("/")||t.includes("\\")?t:S6c(t)}async function oFe(t){let e=I6c("git");if(e===null)return[];try{let{stdout:r}=await x6c(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` -`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function w6c(t){let e=0;for(let r=0;ro&&(n=JWi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function CLr(t,e){let r=(0,VWi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` -`)||await(0,_Lr.once)(r,"drain");r.end(),await(0,_Lr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function ZWi(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=A3r(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function k6c(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=A3r(r,e);if(n!==void 0)return n}return e.commandFallback}async function XWi(t){try{let e=await(0,lN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(u9),o=await e.read(n,0,u9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-u9),l=s;if(c>0){let u=await e.read(n,0,u9,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function P6c(t){return Math.abs(w6c(t)).toString(36)}function sFe(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=N3e?e:`${e.slice(0,N3e)}-${P6c(t)}`}function PV(){return(0,WEe.join)(g_e(),"projects")}function D6c(t){return(0,WEe.join)(PV(),sFe(t))}async function aFe(t){try{return(await(0,lN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function aN(t){let e=D6c(t),r=[];try{await(0,lN.readdir)(e),r.push(e)}catch{}let n=sFe(t);if(n.length<=N3e)return r;let o=n.slice(0,N3e)+"-",s=PV();try{for(let c of await(0,lN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,WEe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function rIt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,WEe.join)(c,r);try{let d=await(0,lN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await aFe(e);for(let u of await aN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await aN(u)){let f=await n(d,u);if(f)return f}return}let o=PV(),s;try{s=await(0,lN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,WEe.join)(o,c),void 0);if(l)return l}}function B6c(){return O6c??=Buffer.from('"compact_boundary"')}function ezi(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function Hne(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function oTt(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function Q6c(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(M3e);if(o===-1||o>=r)return 0;let s=o+1;if(oTt(n,sTt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function H6c(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function G6c(t){if(t.carryLen>0){let e=t.carryBuf;oTt(e,sTt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Hne(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==M3e&&Hne(t.out,F6c,0,1),Hne(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function $6c(t,e){let r=B6c(),n=N6c,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,lN.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=q6c(o,f,r);j6c(o,f,s,h.lastSnapStart,h.lastSnapEnd),H6c(o,f,h.trailStart),o.bufFileOff+=h.trailStart}G6c(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function V6c(t,e){try{return e>M6c&&!HE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await $6c(t,e)).postBoundaryBuf:await(0,$Wi.readFile)(t)}catch{return null}}function W6c(t){let e=[];try{let o=Vd(e,zd`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=a6c(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{Wd(e,r,n)}}function z6c(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==A.headUuid&&e.set(E,{..._,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),K6c(e,d,f)}function kBr(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function Y6c(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function K6c(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=kBr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=kBr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(Y6c(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=kBr(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function J6c(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function tzi(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function rzi(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function Z6c(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return nzi(r,e)}function nzi(t,e){let r=z6c(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>J6c(s,n)).map(s=>tzi(s));return rzi(o,e)}async function X6c(t,e){if(!uh(t))return[];let r=await rIt(t,e?.dir);if(!r)return[];let n=await V6c(r.filePath,r.fileSize);return n?nzi(W6c(n),e):[]}function nIt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` -`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=HR(o,"customTitle")||HR(n,"customTitle")||HR(o,"aiTitle")||HR(n,"aiTitle")||void 0,f=ZWi(n)||void 0,h=RBr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||HR(o,"lastPrompt")||HR(o,"summary")||f;if(!g)return null;let A=HR(o,"gitBranch")||RBr(n,"gitBranch")||void 0,y=RBr(n,"cwd")||r||void 0,E=o.split(` -`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&HR(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function y3e(t,e,r){let n;try{n=await(0,E_e.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=uh(o.slice(0,-6));if(!s)return null;let c=(0,__e.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,E_e.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function izi(t){let e=await XWi(t.filePath);if(!e)return null;let r=nIt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function t9c(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function r9c(t,e,r){t.sort(t9c);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function i9c(t,e,r){let n=await aFe(t),o;if(e)try{o=await oFe(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await aN(n))h.push(...await y3e(m,r,n));return h}let s=PV(),c=process.platform==="win32",l=o.map(h=>{let m=sFe(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,E_e.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await aN(n))h.push(...await y3e(m,r,n));return h}let d=[],f=new Set;for(let h of await aN(n)){let m=(0,__e.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await y3e(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=N3e&&m.startsWith(A+"-")){f.add(m),d.push(...await y3e((0,__e.join)(s,h.name),r,g));break}}}return d}async function o9c(t){let e=PV(),r;try{r=await(0,E_e.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>y3e((0,__e.join)(e,n.name),t)))).flat()}async function s9c(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await i9c(e,o??!0,c):await o9c(c);return c?r9c(l,r,s):n9c(l)}async function a9c(t,e={}){let r=uh(t);if(!r)return;let n=await rIt(r,e.dir);if(!n)return;let o=await XWi(n.filePath);if(o)return nIt(r,o,n.projectPath)??void 0}async function c9c(t,e,r={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=I0({type:"custom-title",customTitle:e.trim(),sessionId:t})+` -`;await ozi(t,n,r)}async function l9c(t,e,r={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=S3e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=I0({type:"tag",tag:e??"",sessionId:t})+` -`;await ozi(t,n,r)}async function u9c(t,e={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await d9c(e)){let n=(0,Gne.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,uB.stat)(n))}catch(s){let c=pI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,uB.rm)(n,{force:!0}),await(0,uB.rm)((0,Gne.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function d9c(t){if(t.dir){let r=await aFe(t.dir),n=await aN(r),o;try{o=await oFe(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await aN(s));return n}let e=PV();try{return(await(0,uB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Gne.join)(e,r.name))}catch{return[]}}async function ozi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await aFe(r.dir);for(let u of await aN(c))if(await PBr((0,Gne.join)(u,n),e))return;let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await aN(u))if(await PBr((0,Gne.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=PV(),s;try{s=await(0,uB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await PBr((0,Gne.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function PBr(t,e){let r;try{r=await(0,uB.open)(t,vLr.constants.O_WRONLY|vLr.constants.O_APPEND)}catch(n){let o=pI(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function f9c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await XSt().readBytes((0,aTt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await aFe(e);for(let u of await aN(c)){let d=await n(u);if(d)return d}let l;try{l=await oFe(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await aN(u)){let f=await n(d);if(f)return f}return null}let o=PV(),s;try{s=await XSt().list(o)}catch{return null}for(let c of s){let l=await n((0,aTt.join)(o,c));if(l)return l}return null}function h9c(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{szi(hN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function m9c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||szi(o,e,r,n);return{transcript:r,contentReplacements:n}}function szi(t,e,r,n){p9c.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function g9c(t,e={}){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!uh(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await f9c(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=A9c(r.buf,t,e);return await CLr((0,aTt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function A9c(t,e,r){let n=h9c(t,e);return azi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,u9)),c=t.toString("utf-8",Math.max(0,o-u9));return HR(c,"customTitle")||HR(s,"customTitle")||HR(c,"aiTitle")||HR(s,"aiTitle")||ZWi(s)})}function y9c(t,e,r){let n=m9c(t,e);return azi(n,e,r,()=>E9c(t))}function E9c(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||k6c(t)||void 0}function azi(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,E3e.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,E3e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,E3e.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,E3e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function czi(t,e){let r=await rIt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,cTt.join)(n,"subagents")}async function lzi(t){let e=[];async function r(n){let o;try{o=await(0,O3e.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,cTt.join)(n,s.name)})}else s.isDirectory()&&await r((0,cTt.join)(n,s.name))}return a(r,"J"),await r(t),e}function _9c(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=hN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function C9c(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function v9c(t,e){if(!uh(t))return[];let r=await czi(t,e?.dir);return r?(await lzi(r)).map(n=>n.agentId):[]}async function b9c(t,e,r){if(!uh(t))return[];if(!e)return[];let n=await czi(t,r?.dir);if(!n)return[];let o=(await lzi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,O3e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=hN(await(0,O3e.readFile)(l,"utf-8")).toolUseId}catch{}return uzi(s,r,c)}function uzi(t,e,r){if(t.length===0)return[];let n=_9c(t),o=C9c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>tzi(s,r));return rzi(o,e)}function pzi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function hzi(t){return[...new Set(t)]}function S9c(){return"prod"}function k9c(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function D9c(){let t=(()=>{switch(S9c()){case"local":return k9c();case"staging":return R9c??YGi;case"prod":return YGi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!P9c.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function M9c(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):g_e(),o=r?"":`-${(0,dzi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${D9c().OAUTH_FILE_SUFFIX}${t}${o}`}function B9c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,fzi.userInfo)().username}catch{t="claude-code-user"}return O9c.test(t)?t:"claude-code-user"}function bLr(){return F9c}function ln(t,e){let r=bLr(),n=SLr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===B3e?void 0:B3e].filter(o=>!!o)});t.common.issues.push(n)}function Yo(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function Azi(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function tUc(t){return new RegExp(`^${Azi(t)}$`)}function rUc(t){let e=`${gzi}T${Azi(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function nUc(t,e){return!!((e==="v4"||!e)&&z9c.test(t)||(e==="v6"||!e)&&K9c.test(t))}function iUc(t,e){if(!G9c.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function oUc(t,e){return!!((e==="v4"||!e)&&Y9c.test(t)||(e==="v6"||!e)&&J9c.test(t))}function sUc(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function NEe(t){if(t instanceof mI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=zR.create(NEe(n))}return new mI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof wV?new wV({...t._def,type:NEe(t.element)}):t instanceof zR?zR.create(NEe(t.unwrap())):t instanceof m9?m9.create(NEe(t.unwrap())):t instanceof h9?h9.create(t.items.map(e=>NEe(e))):t}function ILr(t,e){let r=yV(t),n=yV(e);if(t===e)return{valid:!0,data:t};if(r===Rn.object&&n===Rn.object){let o=lc.objectKeys(e),s=lc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=ILr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===Rn.array&&n===Rn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function QC(t){return t&&Object.assign(fTt,t),fTt}function cUc(t){return t}function lUc(t){return t}function uUc(t){}function dUc(t){throw Error()}function fUc(t){}function q3r(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function $r(t,e="|"){return t.map(r=>os(r)).join(e)}function vzi(t,e){return typeof e=="bigint"?e.toString():e}function iIt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function tie(t){return t==null}function oIt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function bzi(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function Vc(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function j3r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function pUc(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function hUc(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function yUc(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function os(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Izi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function EUc(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return mN(t,{...t._zod.def,shape:r,checks:[]})}function _Uc(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return mN(t,{...t._zod.def,shape:r,checks:[]})}function CUc(t,e){if(!z3e(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return j3r(this,"shape",n),n},checks:[]};return mN(t,r)}function vUc(t,e){return mN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return j3r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function bUc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return mN(e,{...e._zod.def,shape:o,checks:[]})}function SUc(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return mN(e,{...e._zod.def,shape:o,checks:[]})}function UEe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function C3e(t){return typeof t=="string"?t:t?.message}function dN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=C3e(t.inst?._zod.def?.error?.(t))??C3e(e?.error?.(t))??C3e(r.customError?.(t))??C3e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function sIt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function aIt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Rzi(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function TUc(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function $3r(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function V3r(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Dzi(n.path)}`);return e.join(` -`)}function Hzi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Xzi(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function eYi(t){return new RegExp(`^${Xzi(t)}$`)}function tYi(t){let e=Xzi({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Jzi}T(?:${n})$`)}function e$i(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues))}function tFr(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function JYi(t){if(!Z3r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return tFr(r)}function eKi(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function t$i(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues)),e.value[r]=t.value}function fSt(t,e,r){t.issues.length&&e.issues.push(...VR(r,t.issues)),e.value[r]=t.value}function r$i(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...VR(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function n$i(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>dN(s,n,QC())))}),e}function kLr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(z3e(t)&&z3e(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=kLr(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;ndN(l,c,QC()))})),e.issues.length&&(pTt.has(typeof n)?r.issues.push(...VR(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>dN(l,c,QC()))})),r.value.set(t.value,e.value)}function s$i(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function a$i(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function c$i(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function l$i(t,e,r){return UEe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function u$i(t){return t.value=Object.freeze(t.value),t}function d$i(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Rzi(o))}}function LUc(){return{localeError:BUc()}}function UUc(){return{localeError:FUc()}}function f$i(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function qUc(){return{localeError:QUc()}}function HUc(){return{localeError:jUc()}}function $Uc(){return{localeError:GUc()}}function WUc(){return{localeError:VUc()}}function NKi(){return{localeError:YUc()}}function ZUc(){return{localeError:JUc()}}function e7c(){return{localeError:XUc()}}function r7c(){return{localeError:t7c()}}function i7c(){return{localeError:n7c()}}function s7c(){return{localeError:o7c()}}function c7c(){return{localeError:a7c()}}function u7c(){return{localeError:l7c()}}function f7c(){return{localeError:d7c()}}function h7c(){return{localeError:p7c()}}function g7c(){return{localeError:m7c()}}function y7c(){return{localeError:A7c()}}function _7c(){return{localeError:E7c()}}function v7c(){return{localeError:C7c()}}function S7c(){return{localeError:b7c()}}function I7c(){return{localeError:T7c()}}function w7c(){return{localeError:x7c()}}function k7c(){return{localeError:R7c()}}function D7c(){return{localeError:P7c()}}function M7c(){return{localeError:N7c()}}function B7c(){return{localeError:O7c()}}function F7c(){return{localeError:L7c()}}function p$i(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function Q7c(){return{localeError:U7c()}}function j7c(){return{localeError:q7c()}}function G7c(){return{localeError:H7c()}}function V7c(){return{localeError:$7c()}}function z7c(){return{localeError:W7c()}}function J7c(){return{localeError:K7c()}}function X7c(){return{localeError:Z7c()}}function tQc(){return{localeError:eQc()}}function nQc(){return{localeError:rQc()}}function oQc(){return{localeError:iQc()}}function aQc(){return{localeError:sQc()}}function dFr(){return new Y3e}function BKi(t,e){return new t({type:"string",...Ir(e)})}function LKi(t,e){return new t({type:"string",coerce:!0,...Ir(e)})}function fFr(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ir(e)})}function yTt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ir(e)})}function pFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ir(e)})}function hFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ir(e)})}function mFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ir(e)})}function gFr(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ir(e)})}function AFr(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ir(e)})}function yFr(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ir(e)})}function EFr(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ir(e)})}function _Fr(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ir(e)})}function CFr(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ir(e)})}function vFr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ir(e)})}function bFr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ir(e)})}function SFr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ir(e)})}function TFr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ir(e)})}function IFr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ir(e)})}function xFr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ir(e)})}function wFr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ir(e)})}function RFr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ir(e)})}function kFr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ir(e)})}function PFr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ir(e)})}function DFr(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ir(e)})}function UKi(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ir(e)})}function QKi(t,e){return new t({type:"string",format:"date",check:"string_format",...Ir(e)})}function qKi(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ir(e)})}function jKi(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ir(e)})}function HKi(t,e){return new t({type:"number",checks:[],...Ir(e)})}function GKi(t,e){return new t({type:"number",coerce:!0,checks:[],...Ir(e)})}function $Ki(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ir(e)})}function VKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Ir(e)})}function WKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Ir(e)})}function zKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Ir(e)})}function YKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Ir(e)})}function KKi(t,e){return new t({type:"boolean",...Ir(e)})}function JKi(t,e){return new t({type:"boolean",coerce:!0,...Ir(e)})}function ZKi(t,e){return new t({type:"bigint",...Ir(e)})}function XKi(t,e){return new t({type:"bigint",coerce:!0,...Ir(e)})}function eJi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ir(e)})}function tJi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ir(e)})}function rJi(t,e){return new t({type:"symbol",...Ir(e)})}function nJi(t,e){return new t({type:"undefined",...Ir(e)})}function iJi(t,e){return new t({type:"null",...Ir(e)})}function oJi(t){return new t({type:"any"})}function ETt(t){return new t({type:"unknown"})}function sJi(t,e){return new t({type:"never",...Ir(e)})}function aJi(t,e){return new t({type:"void",...Ir(e)})}function cJi(t,e){return new t({type:"date",...Ir(e)})}function lJi(t,e){return new t({type:"date",coerce:!0,...Ir(e)})}function uJi(t,e){return new t({type:"nan",...Ir(e)})}function Jne(t,e){return new X3r({check:"less_than",...Ir(e),value:t,inclusive:!1})}function cN(t,e){return new X3r({check:"less_than",...Ir(e),value:t,inclusive:!0})}function Zne(t,e){return new eFr({check:"greater_than",...Ir(e),value:t,inclusive:!1})}function dI(t,e){return new eFr({check:"greater_than",...Ir(e),value:t,inclusive:!0})}function dJi(t){return Zne(0,t)}function fJi(t){return Jne(0,t)}function pJi(t){return cN(0,t)}function hJi(t){return dI(0,t)}function K3e(t,e){return new fYi({check:"multiple_of",...Ir(e),value:t})}function dIt(t,e){return new mYi({check:"max_size",...Ir(e),maximum:t})}function J3e(t,e){return new gYi({check:"min_size",...Ir(e),minimum:t})}function NFr(t,e){return new AYi({check:"size_equals",...Ir(e),size:t})}function fIt(t,e){return new yYi({check:"max_length",...Ir(e),maximum:t})}function c_e(t,e){return new EYi({check:"min_length",...Ir(e),minimum:t})}function pIt(t,e){return new _Yi({check:"length_equals",...Ir(e),length:t})}function MFr(t,e){return new CYi({check:"string_format",format:"regex",...Ir(e),pattern:t})}function OFr(t){return new vYi({check:"string_format",format:"lowercase",...Ir(t)})}function BFr(t){return new bYi({check:"string_format",format:"uppercase",...Ir(t)})}function LFr(t,e){return new SYi({check:"string_format",format:"includes",...Ir(e),includes:t})}function FFr(t,e){return new TYi({check:"string_format",format:"starts_with",...Ir(e),prefix:t})}function UFr(t,e){return new IYi({check:"string_format",format:"ends_with",...Ir(e),suffix:t})}function mJi(t,e,r){return new xYi({check:"property",property:t,schema:e,...Ir(r)})}function QFr(t,e){return new wYi({check:"mime_type",mime:t,...Ir(e)})}function nie(t){return new RYi({check:"overwrite",tx:t})}function qFr(t){return nie(e=>e.normalize(t))}function jFr(){return nie(t=>t.trim())}function HFr(){return nie(t=>t.toLowerCase())}function GFr(){return nie(t=>t.toUpperCase())}function $Fr(t,e,r){return new t({type:"array",element:e,...Ir(r)})}function cQc(t,e,r){return new t({type:"union",options:e,...Ir(r)})}function lQc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Ir(n)})}function uQc(t,e,r){return new t({type:"intersection",left:e,right:r})}function gJi(t,e,r,n){let o=r instanceof bo;return new t({type:"tuple",items:e,rest:o?r:null,...Ir(o?n:r)})}function dQc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Ir(n)})}function fQc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Ir(n)})}function pQc(t,e,r){return new t({type:"set",valueType:e,...Ir(r)})}function hQc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Ir(r)})}function mQc(t,e,r){return new t({type:"enum",entries:e,...Ir(r)})}function gQc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Ir(r)})}function AJi(t,e){return new t({type:"file",...Ir(e)})}function AQc(t,e){return new t({type:"transform",transform:e})}function yQc(t,e){return new t({type:"optional",innerType:e})}function EQc(t,e){return new t({type:"nullable",innerType:e})}function _Qc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function CQc(t,e,r){return new t({type:"nonoptional",innerType:e,...Ir(r)})}function vQc(t,e){return new t({type:"success",innerType:e})}function bQc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function SQc(t,e,r){return new t({type:"pipe",in:e,out:r})}function TQc(t,e){return new t({type:"readonly",innerType:e})}function IQc(t,e,r){return new t({type:"template_literal",parts:e,...Ir(r)})}function xQc(t,e){return new t({type:"lazy",getter:e})}function wQc(t,e){return new t({type:"promise",innerType:e})}function yJi(t,e,r){let n=Ir(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function EJi(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Ir(r)})}function _Ji(t,e){let r=Ir(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??lFr,u=t.Boolean??nFr,d=t.String??uFe,f=new(t.Transform??cFr)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function CJi(t,e,r,n={}){let o=Ir(n),s={...Ir(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function vJi(t){return new _Tt({type:"function",input:Array.isArray(t?.input)?gJi(uIt,t?.input):t?.input??$Fr(oFr,ETt(ATt)),output:t?.output??ETt(ATt)})}function VFr(t,e){if(t instanceof Y3e){let n=new Z3e(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new Z3e(e);return r.process(t),r.emit(t,e)}function Sm(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Sm(n.element,r);case"object":{for(let o in n.shape)if(Sm(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Sm(o,r))return!0;return!1}case"intersection":return Sm(n.left,r)||Sm(n.right,r);case"tuple":{for(let o of n.items)if(Sm(o,r))return!0;return!!(n.rest&&Sm(n.rest,r))}case"record":return Sm(n.keyType,r)||Sm(n.valueType,r);case"map":return Sm(n.keyType,r)||Sm(n.valueType,r);case"set":return Sm(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Sm(n.innerType,r);case"lazy":return Sm(n.getter(),r);case"default":return Sm(n.innerType,r);case"prefault":return Sm(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Sm(n.in,r)||Sm(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function h$i(t,e){let r={type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},...Hs.normalizeParams(e)};return new PQc(r)}function fB(t){return!!t._zod}function OEe(t){let e=Object.values(t);if(e.length===0)return h$i({});let r=e.every(fB),n=e.every(o=>!fB(o));if(r)return h$i(t);if(n)return aUc(t);throw Error("Mixed Zod versions detected in object shape.")}function T3e(t,e){return fB(t)?cIt(t,e):t.safeParse(e)}async function NBr(t,e){return fB(t)?await lIt(t,e):await t.safeParseAsync(e)}function dFe(t){if(!t)return;let e;if(fB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function l3e(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return OEe(t)}}if(fB(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function MBr(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function DQc(t){return t.description}function NQc(t){if(fB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function bJi(t){if(fB(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function SJi(t){return UKi(zFr,t)}function TJi(t){return QKi(YFr,t)}function IJi(t){return qKi(KFr,t)}function xJi(t){return jKi(JFr,t)}function bt(t){return BKi(hIt,t)}function OQc(t){return fFr(XFr,t)}function BQc(t){return yTt(CTt,t)}function LQc(t){return pFr(f9,t)}function FQc(t){return hFr(f9,t)}function UQc(t){return mFr(f9,t)}function QQc(t){return gFr(f9,t)}function qQc(t){return AFr(e8r,t)}function jQc(t){return yFr(t8r,t)}function HQc(t){return EFr(r8r,t)}function GQc(t){return _Fr(n8r,t)}function $Qc(t){return CFr(i8r,t)}function VQc(t){return vFr(o8r,t)}function WQc(t){return bFr(s8r,t)}function zQc(t){return SFr(a8r,t)}function YQc(t){return TFr(c8r,t)}function KQc(t){return IFr(l8r,t)}function JQc(t){return xFr(u8r,t)}function ZQc(t){return wFr(d8r,t)}function XQc(t){return RFr(f8r,t)}function eqc(t){return kFr(p8r,t)}function tqc(t){return PFr(h8r,t)}function rqc(t){return DFr(m8r,t)}function nqc(t,e,r={}){return CJi(NJi,t,e,r)}function Dc(t){return HKi(mIt,t)}function PLr(t){return $Ki(C_e,t)}function iqc(t){return VKi(C_e,t)}function oqc(t){return WKi(C_e,t)}function sqc(t){return zKi(C_e,t)}function aqc(t){return YKi(C_e,t)}function Tm(t){return KKi(gIt,t)}function cqc(t){return ZKi(AIt,t)}function lqc(t){return eJi(g8r,t)}function uqc(t){return tJi(g8r,t)}function dqc(t){return rJi(MJi,t)}function fqc(t){return nJi(OJi,t)}function A8r(t){return iJi(BJi,t)}function pqc(){return oJi(LJi)}function Kd(){return ETt(FJi)}function yIt(t){return sJi(UJi,t)}function hqc(t){return aJi(QJi,t)}function mqc(t){return cJi(y8r,t)}function _a(t,e){return $Fr(qJi,t,e)}function gqc(t){let e=t._zod.def.shape;return ei(Object.keys(e))}function Cn(t,e){let r={type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},...Hs.normalizeParams(e)};return new EIt(r)}function Aqc(t,e){return new EIt({type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},catchall:yIt(),...Hs.normalizeParams(e)})}function LC(t,e){return new EIt({type:"object",get shape(){return Hs.assignProp(this,"shape",{...t}),this.shape},catchall:Kd(),...Hs.normalizeParams(e)})}function Xl(t,e){return new E8r({type:"union",options:t,...Hs.normalizeParams(e)})}function _8r(t,e,r){return new jJi({type:"union",options:e,discriminator:t,...Hs.normalizeParams(r)})}function _It(t,e){return new HJi({type:"intersection",left:t,right:e})}function yqc(t,e,r){let n=e instanceof bo,o=n?r:e;return new GJi({type:"tuple",items:t,rest:n?e:null,...Hs.normalizeParams(o)})}function Zl(t,e,r){return new C8r({type:"record",keyType:t,valueType:e,...Hs.normalizeParams(r)})}function Eqc(t,e,r){return new C8r({type:"record",keyType:Xl([t,yIt()]),valueType:e,...Hs.normalizeParams(r)})}function _qc(t,e,r){return new $Ji({type:"map",keyType:t,valueType:e,...Hs.normalizeParams(r)})}function Cqc(t,e){return new VJi({type:"set",valueType:t,...Hs.normalizeParams(e)})}function _1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new X3e({type:"enum",entries:r,...Hs.normalizeParams(e)})}function vqc(t,e){return new X3e({type:"enum",entries:t,...Hs.normalizeParams(e)})}function ei(t,e){return new WJi({type:"literal",values:Array.isArray(t)?t:[t],...Hs.normalizeParams(e)})}function bqc(t){return AJi(zJi,t)}function b8r(t){return new v8r({type:"transform",transform:t})}function gd(t){return new S8r({type:"optional",innerType:t})}function vTt(t){return new YJi({type:"nullable",innerType:t})}function Sqc(t){return gd(vTt(t))}function JJi(t,e){return new KJi({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function XJi(t,e){return new ZJi({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function eZi(t,e){return new T8r({type:"nonoptional",innerType:t,...Hs.normalizeParams(e)})}function Tqc(t){return new tZi({type:"success",innerType:t})}function nZi(t,e){return new rZi({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Iqc(t){return uJi(iZi,t)}function bTt(t,e){return new I8r({type:"pipe",in:t,out:e})}function sZi(t){return new oZi({type:"readonly",innerType:t})}function xqc(t,e){return new aZi({type:"template_literal",parts:t,...Hs.normalizeParams(e)})}function lZi(t){return new cZi({type:"lazy",getter:t})}function wqc(t){return new uZi({type:"promise",innerType:t})}function dZi(t,e){let r=new dh({check:"custom",...Hs.normalizeParams(e)});return r._zod.check=t,r}function fZi(t,e){return yJi(CIt,t??(()=>!0),e)}function pZi(t,e={}){return EJi(CIt,t,e)}function hZi(t,e){let r=dZi(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Hs.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Hs.issue(s))}},t(n.value,n)),e);return r}function Rqc(t,e={error:`Input not instance of ${t.name}`}){let r=new CIt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Hs.normalizeParams(e)});return r._zod.bag.Class=t,r}function Pqc(t){let e=lZi(()=>Xl([bt(t),Dc(),Tm(),A8r(),_a(e),Zl(bt(),e)]));return e}function x8r(t,e){return bTt(b8r(t),e)}function Nqc(t){QC({customError:t})}function Mqc(){return QC().customError}function Oqc(t){return LKi(hIt,t)}function Bqc(t){return GKi(mIt,t)}function Lqc(t){return JKi(gIt,t)}function Fqc(t){return XKi(AIt,t)}function Uqc(t){return lJi(y8r,t)}function hHc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function mHc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Lne(t){return t==="completed"||t==="failed"||t==="cancelled"}function NZi(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function fl(t,e,r,n,o){t[e]=r,NZi(t,e,n,o)}function E1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?MZi(e,t.currentPath):e.join("/")}}function bHc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==vr.ZodAny&&(r.items=Pc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&fl(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&fl(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(fl(r,"minItems",t.exactLength.value,t.exactLength.message,e),fl(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function SHc(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function THc(){return{type:"boolean"}}function OZi(t,e){return Pc(t.type._def,e)}function BZi(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>BZi(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return xHc(t,e)}}function wHc(t,e){return{...Pc(t.innerType._def,e),default:t.defaultValue()}}function RHc(t,e){return e.effectStrategy==="input"?Pc(t.schema._def,e):E1(e)}function kHc(t){return{type:"string",enum:Array.from(t.values)}}function DHc(t,e){let r=[Pc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Pc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(PHc(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function NHc(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function LZi(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":fl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":sN(r,"email",n.message,e);break;case"format:idn-email":sN(r,"idn-email",n.message,e);break;case"pattern:zod":BC(r,oN.email,n.message,e);break}break;case"url":sN(r,"uri",n.message,e);break;case"uuid":sN(r,"uuid",n.message,e);break;case"regex":BC(r,n.regex,n.message,e);break;case"cuid":BC(r,oN.cuid,n.message,e);break;case"cuid2":BC(r,oN.cuid2,n.message,e);break;case"startsWith":BC(r,RegExp(`^${BBr(n.value,e)}`),n.message,e);break;case"endsWith":BC(r,RegExp(`${BBr(n.value,e)}$`),n.message,e);break;case"datetime":sN(r,"date-time",n.message,e);break;case"date":sN(r,"date",n.message,e);break;case"time":sN(r,"time",n.message,e);break;case"duration":sN(r,"duration",n.message,e);break;case"length":fl(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),fl(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{BC(r,RegExp(BBr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&sN(r,"ipv4",n.message,e),n.version!=="v4"&&sN(r,"ipv6",n.message,e);break}case"base64url":BC(r,oN.base64url,n.message,e);break;case"jwt":BC(r,oN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&BC(r,oN.ipv4Cidr,n.message,e),n.version!=="v4"&&BC(r,oN.ipv6Cidr,n.message,e);break}case"emoji":BC(r,oN.emoji(),n.message,e);break;case"ulid":{BC(r,oN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{sN(r,"binary",n.message,e);break}case"contentEncoding:base64":{fl(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{BC(r,oN.base64,n.message,e);break}}break}case"nanoid":BC(r,oN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function BBr(t,e){return e.patternStrategy==="escape"?OHc(t):t}function OHc(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):fl(t,"format",e,r,n)}function BC(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:A$i(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):fl(t,"pattern",A$i(e,n),r,n)}function A$i(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u{let r=0;for(let[n,o]of t)r+=Buffer.byteLength(Qqi(e,n,o)),r+=t4r(o)?o.size:Buffer.byteLength(String(o)),r+=Buffer.byteLength(`\r +`);return r+=Buffer.byteLength(Uqi(e)),r},"getFormDataLength"),e4r=class{static{a(this,"FormDataSerializer")}constructor(e){this.fd=e,this.boundary=_Pc(8).toString("hex")}length(){return typeof this._length>"u"&&(this._length=SPc(this.fd,this.boundary)),this._length}contentType(){return`multipart/form-data; boundary=${this.boundary}`}stream(){return vPc.from(bPc(this.fd,this.boundary))}};qqi.exports={isFormData:CPc,FormDataSerializer:e4r}});var Hqi=I((Bbh,jqi)=>{"use strict";p();var{AbortSignal:Obh}=X5r(),{Body:TPc,cloneStream:IPc,guessContentType:xPc}=Jbt(),{Headers:wPc}=eEe(),{isPlainObject:RPc}=G6(),{isFormData:PPc,FormDataSerializer:kPc}=bLe(),DPc=20,Y$=Symbol("Request internals"),r1t=class t extends TPc{static{a(this,"Request")}constructor(e,r={}){let n=e instanceof t?e:null,o=n?new URL(n.url):new URL(e),s=r.method||n&&n.method||"GET";if(s=s.toUpperCase(),(r.body!=null||n&&n.body!==null)&&["GET","HEAD"].includes(s))throw new TypeError("Request with GET/HEAD method cannot have body");let c=r.body||(n&&n.body?IPc(n):null),l=new wPc(r.headers||n&&n.headers||{});if(PPc(c)&&!l.has("content-type")){let h=new kPc(c);c=h.stream(),l.set("content-type",h.contentType()),!l.has("transfer-encoding")&&!l.has("content-length")&&l.set("content-length",h.length())}if(!l.has("content-type"))if(RPc(c))c=JSON.stringify(c),l.set("content-type","application/json");else{let h=xPc(c);h&&l.set("content-type",h)}super(c);let u=n?n.signal:null;"signal"in r&&(u=r.signal);let d=r.redirect||n&&n.redirect||"follow";if(!["follow","error","manual"].includes(d))throw new TypeError(`'${d}' is not a valid redirect option`);let f=r.cache||n&&n.cache||"default";if(!["default","no-store","reload","no-cache","force-cache","only-if-cached"].includes(f))throw new TypeError(`'${f}' is not a valid cache option`);this[Y$]={init:{...r},method:s,redirect:d,cache:f,headers:l,parsedURL:o,signal:u},r.follow===void 0?!n||n.follow===void 0?this.follow=DPc:this.follow=n.follow:this.follow=r.follow,this.counter=r.counter||n&&n.counter||0,r.compress===void 0?!n||n.compress===void 0?this.compress=!0:this.compress=n.compress:this.compress=r.compress,r.decode===void 0?!n||n.decode===void 0?this.decode=!0:this.decode=n.decode:this.decode=r.decode}get method(){return this[Y$].method}get url(){return this[Y$].parsedURL.toString()}get headers(){return this[Y$].headers}get redirect(){return this[Y$].redirect}get cache(){return this[Y$].cache}get signal(){return this[Y$].signal}clone(){return new t(this)}get init(){return this[Y$].init}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(r1t.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},cache:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}});jqi.exports={Request:r1t}});var r4r=I((Ubh,Gqi)=>{"use strict";p();var{Body:NPc,cloneStream:MPc,guessContentType:OPc}=Jbt(),{Headers:BPc}=eEe(),{isPlainObject:LPc}=G6(),{isFormData:FPc,FormDataSerializer:UPc}=bLe(),tN=Symbol("Response internals"),n1t=class t extends NPc{static{a(this,"Response")}constructor(e=null,r={}){let n=new BPc(r.headers),o=e;if(FPc(o)&&!n.has("content-type")){let s=new UPc(o);o=s.stream(),n.set("content-type",s.contentType()),!n.has("transfer-encoding")&&!n.has("content-length")&&n.set("content-length",s.length())}if(o!==null&&!n.has("content-type"))if(LPc(o))o=JSON.stringify(o),n.set("content-type","application/json");else{let s=OPc(o);s&&n.set("content-type",s)}super(o),this[tN]={url:r.url,status:r.status||200,statusText:r.statusText||"",headers:n,httpVersion:r.httpVersion,decoded:r.decoded,counter:r.counter}}get url(){return this[tN].url||""}get status(){return this[tN].status}get statusText(){return this[tN].statusText}get ok(){return this[tN].status>=200&&this[tN].status<300}get redirected(){return this[tN].counter>0}get headers(){return this[tN].headers}get httpVersion(){return this[tN].httpVersion}get decoded(){return this[tN].decoded}static redirect(e,r=302){if(![301,302,303,307,308].includes(r))throw new RangeError("Invalid status code");return new t(null,{headers:{location:new URL(e).toString()},status:r})}clone(){if(this.bodyUsed)throw new TypeError("Cannot clone: already read");return new t(MPc(this),{...this[tN]})}get[Symbol.toStringTag](){return this.constructor.name}};Object.defineProperties(n1t.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});Gqi.exports={Response:n1t}});var Vqi=I((Hbh,$qi)=>{"use strict";p();var QPc=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),qPc=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),jPc=new Set([500,502,503,504]),HPc={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},GPc={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function vne(t){let e=parseInt(t,10);return isFinite(e)?e:0}a(vne,"toNumberOrZero");function $Pc(t){return t?jPc.has(t.status):!0}a($Pc,"isErrorResponse");function n4r(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let n of r){let[o,s]=n.split(/=/,2);e[o.trim()]=s===void 0?!0:s.trim().replace(/^"|"$/g,"")}return e}a(n4r,"parseCacheControl");function VPc(t){let e=[];for(let r in t){let n=t[r];e.push(n===!0?r:r+"="+n)}if(e.length)return e.join(", ")}a(VPc,"formatCacheControl");$qi.exports=class{static{a(this,"CachePolicy")}constructor(e,r,{shared:n,cacheHeuristic:o,immutableMinTimeToLive:s,ignoreCargoCult:c,_fromObject:l}={}){if(l){this._fromObject(l);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=n!==!1,this._cacheHeuristic=o!==void 0?o:.1,this._immutableMinTtl=s!==void 0?s:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=n4r(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=n4r(e.headers["cache-control"]),c&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":VPc(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&qPc.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||QPc.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=n4r(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let n of r)if(e.headers[n]!==this._reqHeaders[n])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let n in e)HPc[n]||(r[n]=e[n]);if(e.connection){let n=e.connection.trim().split(/\s*,\s*/);for(let o of n)delete r[o]}if(r.warning){let n=r.warning.split(/,/).filter(o=>!/^\s*1[0-9][0-9]/.test(o));n.length?r.warning=n.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return vne(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return vne(this._rescc["s-maxage"])}if(this._rescc["max-age"])return vne(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let n=Date.parse(this._resHeaders.expires);return Number.isNaN(n)||nn)return Math.max(e,(r-n)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+vne(this._rescc["stale-if-error"]),n=e+vne(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,n)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+vne(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+vne(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let o=r["if-none-match"].split(/,/).filter(s=>!/^\s*W\//.test(s));o.length?r["if-none-match"]=o.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&$Pc(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let n=!1;if(r.status!==void 0&&r.status!=304?n=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?n=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?n=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?n=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(n=!0),!n)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let o={};for(let c in this._resHeaders)o[c]=c in r.headers&&!GPc[c]?r.headers[c]:this._resHeaders[c];let s=Object.assign({},r,{status:this._status,method:this._method,headers:o});return{policy:new this.constructor(e,s,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Kqi=I((Vbh,Yqi)=>{"use strict";p();var WPc=Vqi(),{Headers:zPc}=eEe(),Wqi=a(t=>({url:t.url,method:t.method,headers:t.headers.plain()}),"convertRequest"),zqi=a(t=>({status:t.status,headers:t.headers.plain()}),"convertResponse"),i4r=class{static{a(this,"CachePolicyWrapper")}constructor(e,r,n){this.policy=new WPc(Wqi(e),zqi(r),n)}storable(){return this.policy.storable()}satisfiesWithoutRevalidation(e){return this.policy.satisfiesWithoutRevalidation(Wqi(e))}responseHeaders(e){return new zPc(this.policy.responseHeaders(zqi(e)))}timeToLive(){return this.policy.timeToLive()}};Yqi.exports=i4r});var Xqi=I((Ybh,Zqi)=>{"use strict";p();var{Readable:YPc}=require("stream"),{Headers:Jqi}=eEe(),{Response:KPc}=r4r(),K$=Symbol("CacheableResponse internals"),JPc=a(t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"toArrayBuffer"),o4r=class t extends KPc{static{a(this,"CacheableResponse")}constructor(e,r){super(e,r);let n=new Jqi(r.headers);this[K$]={headers:n,bufferedBody:e}}get headers(){return this[K$].headers}set headers(e){if(e instanceof Jqi)this[K$].headers=e;else throw new TypeError("instance of Headers expected")}get body(){return YPc.from(this[K$].bufferedBody)}get bodyUsed(){return!1}async buffer(){return this[K$].bufferedBody}async arrayBuffer(){return JPc(this[K$].bufferedBody)}async text(){return this[K$].bufferedBody.toString()}async json(){return JSON.parse(await this.text())}clone(){let{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l}=this;return new t(this[K$].bufferedBody,{url:e,status:r,statusText:n,headers:o,httpVersion:s,decoded:c,counter:l})}get[Symbol.toStringTag](){return this.constructor.name}},ZPc=a(async t=>{let e=await t.buffer(),{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u}=t;return new o4r(e,{url:r,status:n,statusText:o,headers:s,httpVersion:c,decoded:l,counter:u})},"cacheableResponse");Zqi.exports={cacheableResponse:ZPc}});var i1t=I((Zbh,eji)=>{"use strict";p();var s4r=class extends Error{static{a(this,"RequestAbortedError")}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};eji.exports={RequestAbortedError:s4r}});var oji=I((t1h,iji)=>{"use strict";p();var rji=require("http"),nji=require("https"),{Readable:XPc}=require("stream"),W6=GP()("helix-fetch:h1"),{RequestAbortedError:tji}=i1t(),{decodeStream:ekc}=G6(),tkc=a((t,e)=>{let{h1:r,options:{h1:n,rejectUnauthorized:o}}=t;return e==="https:"?r.httpsAgent?r.httpsAgent:n||typeof o=="boolean"?(r.httpsAgent=new nji.Agent(typeof o=="boolean"?{...n||{},rejectUnauthorized:o}:n),r.httpsAgent):void 0:r.httpAgent?r.httpAgent:n?(r.httpAgent=new rji.Agent(n),r.httpAgent):void 0},"getAgent"),rkc=a(t=>{t.h1={}},"setupContext"),nkc=a(async({h1:t})=>{t.httpAgent&&(W6("resetContext: destroying httpAgent"),t.httpAgent.destroy(),delete t.httpAgent),t.httpsAgent&&(W6("resetContext: destroying httpsAgent"),t.httpsAgent.destroy(),delete t.httpsAgent)},"resetContext"),ikc=a((t,e,r)=>{let{statusCode:n,statusMessage:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u}=t,d=e?ekc(n,u,t,r):t;return{statusCode:n,statusText:o,httpVersion:s,httpVersionMajor:c,httpVersionMinor:l,headers:u,readable:d,decoded:!!(e&&d!==t)}},"createResponse"),okc=a(async(t,e,r)=>{let{request:n}=e.protocol==="https:"?nji:rji,o=tkc(t,e.protocol),s={...r,agent:o},{socket:c,body:l}=s;return c&&(delete s.socket,c.assigned||(c.assigned=!0,o?s.agent=new Proxy(o,{get:a((u,d)=>d==="createConnection"&&!c.inUse?(f,h)=>{W6(`agent reusing socket #${c.id} (${c.servername})`),c.inUse=!0,h(null,c)}:u[d],"get")}):s.createConnection=(u,d)=>{W6(`reusing socket #${c.id} (${c.servername})`),c.inUse=!0,d(null,c)})),new Promise((u,d)=>{W6(`${s.method} ${e.href}`);let f,{signal:h}=s,m=a(()=>{h.removeEventListener("abort",m),c&&!c.inUse&&(W6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),d(new tji),f&&f.abort()},"onAbortSignal");if(h){if(h.aborted){d(new tji);return}h.addEventListener("abort",m)}f=n(e,s),f.once("response",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(W6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),u(ikc(g,s.decode,d))}),f.once("error",g=>{h&&h.removeEventListener("abort",m),c&&!c.inUse&&(W6(`discarding redundant socket used for ALPN: #${c.id} ${c.servername}`),c.destroy()),f.aborted||(W6(`${s.method} ${e.href} failed with: ${g.message}`),f.abort(),d(g))}),l instanceof XPc?l.pipe(f):(l&&f.write(l),f.end())})},"h1Request");iji.exports={request:okc,setupContext:rkc,resetContext:nkc}});var lji=I((i1h,cji)=>{"use strict";p();var{connect:skc,constants:akc}=require("http2"),{Readable:ckc}=require("stream"),hd=GP()("helix-fetch:h2"),{RequestAbortedError:sji}=i1t(),{decodeStream:lkc}=G6(),{NGHTTP2_CANCEL:SLe}=akc,ukc=300*1e3,dkc=5e3,fkc=a(t=>{t.h2={sessionCache:{}}},"setupContext"),pkc=a(async({h2:t})=>Promise.all(Object.values(t.sessionCache).map(e=>new Promise(r=>{e.on("close",r),hd(`resetContext: destroying session (socket #${e.socket&&e.socket.id}, ${e.socket&&e.socket.servername})`),e.destroy()}))),"resetContext"),aji=a((t,e,r,n=()=>{})=>{let o={...t},s=o[":status"];delete o[":status"];let c=r?lkc(s,t,e,n):e;return{statusCode:s,statusText:"",httpVersion:"2.0",httpVersionMajor:2,httpVersionMinor:0,headers:o,readable:c,decoded:!!(r&&c!==e)}},"createResponse"),hkc=a((t,e,r,n,o,s)=>{let{options:{h2:{pushPromiseHandler:c,pushHandler:l,pushedStreamIdleTimeout:u=dkc}}}=t,d=o[":path"],f=`${e}${d}`;hd(`received PUSH_PROMISE: ${f}, stream #${n.id}, headers: ${JSON.stringify(o)}, flags: ${s}`),c&&c(f,o,a(()=>{n.close(SLe)},"rejectPush")),n.on("push",(h,m)=>{hd(`received push headers for ${e}${d}, stream #${n.id}, headers: ${JSON.stringify(h)}, flags: ${m}`),n.setTimeout(u,()=>{hd(`closing pushed stream #${n.id} after ${u} ms of inactivity`),n.close(SLe)}),l&&l(f,o,aji(h,n,r))}),n.on("aborted",()=>{hd(`pushed stream #${n.id} aborted`)}),n.on("error",h=>{hd(`pushed stream #${n.id} encountered error: ${h}`)}),n.on("frameError",(h,m,g)=>{hd(`pushed stream #${n.id} encountered frameError: type: ${h}, code: ${m}, id: ${g}`)})},"handlePush"),mkc=a(async(t,e,r)=>{let{origin:n,pathname:o,search:s,hash:c}=e,l=`${o}${s}${c}`,{options:{h2:u={}},h2:{sessionCache:d}}=t,{idleSessionTimeout:f=ukc,pushPromiseHandler:h,pushHandler:m}=u,g={...r},{method:A,headers:y,socket:E,body:_,decode:v}=g;return E&&delete g.socket,y.host&&(y[":authority"]=y.host,delete y.host),new Promise((b,T)=>{let w=d[n];if(!w||w.closed||w.destroyed){let N=!(t.options.rejectUnauthorized===!1||u.rejectUnauthorized===!1),B={...u,rejectUnauthorized:N};E&&!E.inUse&&(B.createConnection=()=>(hd(`reusing socket #${E.id} (${E.servername})`),E.inUse=!0,E)),w=skc(n,{...B,settings:{enablePush:!!(h||m)}}),w.setMaxListeners(1e3),w.setTimeout(f,()=>{hd(`closing session ${n} after ${f} ms of inactivity`),w.close()}),w.once("connect",()=>{hd(`session ${n} established`),hd(`caching session ${n}`),d[n]=w}),w.on("localSettings",j=>{hd(`session ${n} localSettings: ${JSON.stringify(j)}`)}),w.on("remoteSettings",j=>{hd(`session ${n} remoteSettings: ${JSON.stringify(j)}`)}),w.once("close",()=>{hd(`session ${n} closed`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.once("error",j=>{hd(`session ${n} encountered error: ${j}`),d[n]===w&&(hd(`discarding cached session ${n}`),delete d[n])}),w.on("frameError",(j,M,O)=>{hd(`session ${n} encountered frameError: type: ${j}, code: ${M}, id: ${O}`)}),w.once("goaway",(j,M,O)=>{hd(`session ${n} received GOAWAY frame: errorCode: ${j}, lastStreamID: ${M}, opaqueData: ${O?O.toString():void 0}`)}),w.on("stream",(j,M,O)=>{hkc(t,n,v,j,M,O)})}else E&&E.id!==w.socket.id&&!E.inUse&&(hd(`discarding redundant socket used for ALPN: #${E.id} ${E.servername}`),E.destroy());hd(`${A} ${e.host}${l}`);let R,{signal:x}=g,P=a(()=>{x.removeEventListener("abort",P),T(new sji),R&&R.close(SLe)},"onAbortSignal");if(x){if(x.aborted){T(new sji);return}x.addEventListener("abort",P)}let D=a(N=>{hd(`session ${n} encountered error during ${g.method} ${e.href}: ${N}`),T(N)},"onSessionError");w.once("error",D),R=w.request({":method":A,":path":l,...y}),R.once("response",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),b(aji(N,R,g.decode,T))}),R.once("error",N=>{w.off("error",D),x&&x.removeEventListener("abort",P),R.rstCode!==SLe&&(hd(`${g.method} ${e.href} failed with: ${N.message}`),R.close(SLe),T(N))}),R.once("frameError",(N,B,L)=>{w.off("error",D),hd(`encountered frameError during ${g.method} ${e.href}: type: ${N}, code: ${B}, id: ${L}`)}),R.on("push",(N,B)=>{hd(`received 'push' event: headers: ${JSON.stringify(N)}, flags: ${B}`)}),_ instanceof ckc?_.pipe(R):(_&&R.write(_),R.end())})},"request");cji.exports={request:mkc,setupContext:fkc,resetContext:pkc}});var dji=I((a1h,uji)=>{"use strict";p();var{EventEmitter:gkc}=require("events"),Akc=a(()=>{let t={},e=new gkc;return e.setMaxListeners(0),{acquire:a(r=>new Promise(n=>{if(!t[r]){t[r]=!0,n();return}let o=a(s=>{t[r]||(t[r]=!0,e.removeListener(r,o),n(s))},"tryAcquire");e.on(r,o)}),"acquire"),release:a((r,n)=>{Reflect.deleteProperty(t,r),setImmediate(()=>e.emit(r,n))},"release")}},"lock");uji.exports=Akc});var fji=I((u1h,ykc)=>{ykc.exports={name:"@adobe/helix-fetch",version:"3.1.1",description:"Light-weight Fetch implementation transparently supporting both HTTP/1(.1) and HTTP/2",main:"src/index.js",scripts:{test:"nyc mocha",lint:"./node_modules/.bin/eslint .","semantic-release":"semantic-release"},mocha:{timeout:"5000",recursive:"true",reporter:"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},engines:{node:">=12.0"},types:"src/index.d.ts",exports:{import:"./src/index.mjs",require:"./src/index.js"},repository:{type:"git",url:"https://github.com/adobe/helix-fetch"},author:"",license:"Apache-2.0",bugs:{url:"https://github.com/adobe/helix-fetch/issues"},homepage:"https://github.com/adobe/helix-fetch#readme",keywords:["fetch","whatwg","Fetch API","http","https","http2","h2","promise","async","request","RFC 7234","7234","caching","cache"],dependencies:{debug:"4.3.4","http-cache-semantics":"^4.1.1","lru-cache":"7.13.1"},devDependencies:{"@adobe/eslint-config-helix":"1.3.2","@semantic-release/changelog":"6.0.1","@semantic-release/git":"10.0.1",chai:"4.3.6","chai-as-promised":"7.1.1","chai-bytes":"0.1.2","chai-iterator":"3.0.2",eslint:"8.21.0","eslint-plugin-header":"3.1.1","eslint-plugin-import":"2.26.0","formdata-node":"4.3.3","lint-staged":"13.0.3",mocha:"10.0.0","mocha-multi-reporters":"1.5.1",nock:"13.2.9",nyc:"15.1.0","parse-cache-control":"1.0.1",pem:"1.14.6",proxy:"^1.0.2","semantic-release":"19.0.3",sinon:"14.0.0","stream-buffers":"3.0.2",tunnel:"^0.0.6"},"lint-staged":{"*.js":"eslint"},config:{commitizen:{path:"node_modules/cz-conventional-changelog"},ghooks:{"pre-commit":"npx lint-staged"}}}});var Aji=I((d1h,gji)=>{"use strict";p();var{Readable:Ekc}=require("stream"),_kc=require("tls"),{types:{isAnyArrayBuffer:vkc}}=require("util"),Ckc=Y5r(),a4r=GP()("helix-fetch:core"),{RequestAbortedError:o1t}=i1t(),c4r=oji(),s1t=lji(),bkc=dji(),{isPlainObject:Skc}=G6(),{isFormData:Tkc,FormDataSerializer:Ikc}=bLe(),{version:xkc}=fji(),l4r="h2",u4r="h2c",d4r="http/1.0",Cne="http/1.1",wkc=100,Rkc=3600*1e3,Pkc=[l4r,Cne,d4r],kkc=`helix-fetch/${xkc}`,Dkc={method:"GET",compress:!0,decode:!0},pji=0,hji=bkc(),mji=a((t,e)=>new Promise((r,n)=>{let{signal:o}=e,s,c=a(()=>{o.removeEventListener("abort",c);let d=new o1t;n(d),s&&s.destroy(d)},"onAbortSignal");if(o){if(o.aborted){n(new o1t);return}o.addEventListener("abort",c)}let l=+t.port||443,u=a(d=>{o&&o.removeEventListener("abort",c),d instanceof o1t||(a4r(`connecting to ${t.hostname}:${l} failed with: ${d.message}`),n(d))},"onError");s=_kc.connect(l,t.hostname,e),s.once("secureConnect",()=>{o&&o.removeEventListener("abort",c),s.off("error",u),pji+=1,s.id=pji,s.secureConnecting=!1,a4r(`established TLS connection: #${s.id} (${s.servername})`),r(s)}),s.once("error",u)}),"connectTLS"),Nkc=a(async(t,e)=>{let r=await hji.acquire(t.origin);try{return r||(r=await mji(t,e)),r}finally{hji.release(t.origin,r)}},"connect"),Mkc=a(async(t,e,r)=>{let n=`${e.protocol}//${e.host}`,o=t.alpnCache.get(n);if(o)return{protocol:o};switch(e.protocol){case"http:":return o=Cne,t.alpnCache.set(n,o),{protocol:o};case"http2:":return o=u4r,t.alpnCache.set(n,o),{protocol:o};case"https:":break;default:throw new TypeError(`unsupported protocol: ${e.protocol}`)}let{options:{rejectUnauthorized:s,h1:c={},h2:l={}}}=t,u=!(s===!1||c.rejectUnauthorized===!1||l.rejectUnauthorized===!1),d={servername:e.hostname,ALPNProtocols:t.alpnProtocols,signal:r,rejectUnauthorized:u};t.options.ca&&(d.ca=t.options.ca);let f=await Nkc(e,d);return o=f.alpnProtocol,o||(o=Cne),t.alpnCache.set(n,o),{protocol:o,socket:f}},"determineProtocol"),Okc=a(t=>{let e={};return Object.keys(t).forEach(r=>{e[r.toLowerCase()]=t[r]}),e},"sanitizeHeaders"),Bkc=a(async(t,e,r,n)=>{let o=e.protocol==="https:",s;e.port?s=e.port:o?s=443:s=80;let c={...r,host:e.host,hostname:e.hostname,port:s},l=await t(c);if(o){let d={...c,ALPNProtocols:n};d.socket=l,d.servername=c.host;let f=await mji(e,d);return{protocol:f.alpnProtocol||Cne,socket:f}}return{protocol:l.alpnProtocol||Cne,socket:l}},"getProtocolAndSocketFromFactory"),Lkc=a(async(t,e,r)=>{let n=new URL(e),o={...Dkc,...r||{}};typeof o.method=="string"&&(o.method=o.method.toUpperCase()),o.headers=Okc(o.headers||{}),o.headers.host===void 0&&(o.headers.host=n.host),t.userAgent&&o.headers["user-agent"]===void 0&&(o.headers["user-agent"]=t.userAgent);let s;if(o.body instanceof URLSearchParams)s="application/x-www-form-urlencoded; charset=utf-8",o.body=o.body.toString();else if(Tkc(o.body)){let d=new Ikc(o.body);s=d.contentType(),o.body=d.stream(),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(d.length()))}else typeof o.body=="string"||o.body instanceof String?s="text/plain; charset=utf-8":Skc(o.body)?(o.body=JSON.stringify(o.body),s="application/json"):vkc(o.body)&&(o.body=Buffer.from(o.body));o.headers["content-type"]===void 0&&s!==void 0&&(o.headers["content-type"]=s),o.body!=null&&(o.body instanceof Ekc||(!(typeof o.body=="string"||o.body instanceof String)&&!Buffer.isBuffer(o.body)&&(o.body=String(o.body)),o.headers["transfer-encoding"]===void 0&&o.headers["content-length"]===void 0&&(o.headers["content-length"]=String(Buffer.isBuffer(o.body)?o.body.length:Buffer.byteLength(o.body,"utf-8"))))),o.headers.accept===void 0&&(o.headers.accept="*/*"),o.body==null&&["POST","PUT"].includes(o.method)&&(o.headers["content-length"]="0"),o.compress&&o.headers["accept-encoding"]===void 0&&(o.headers["accept-encoding"]="gzip,deflate,br");let{signal:c}=o,{protocol:l,socket:u=null}=t.socketFactory?await Bkc(t.socketFactory,n,o,t.alpnProtocols):await Mkc(t,n,c);switch(a4r(`${n.host} -> ${l}`),l){case l4r:try{return await s1t.request(t,n,u?{...o,socket:u}:o)}catch(d){let{code:f,message:h}=d;throw f==="ERR_HTTP2_ERROR"&&h==="Protocol error"&&t.alpnCache.delete(`${n.protocol}//${n.host}`),d}case u4r:return s1t.request(t,new URL(`http://${n.host}${n.pathname}${n.hash}${n.search}`),u?{...o,socket:u}:o);case d4r:case Cne:return c4r.request(t,n,u?{...o,socket:u}:o);default:throw new TypeError(`unsupported protocol: ${l}`)}},"request"),Fkc=a(async t=>(t.alpnCache.clear(),Promise.all([c4r.resetContext(t),s1t.resetContext(t)])),"resetContext"),Ukc=a(t=>{let{options:{alpnProtocols:e=Pkc,alpnCacheTTL:r=Rkc,alpnCacheSize:n=wkc,userAgent:o=kkc,socketFactory:s}}=t;t.alpnProtocols=e,t.alpnCache=new Ckc({max:n,ttl:r}),t.userAgent=o,t.socketFactory=s,c4r.setupContext(t),s1t.setupContext(t)},"setupContext");gji.exports={request:Lkc,setupContext:Ukc,resetContext:Fkc,RequestAbortedError:o1t,ALPN_HTTP2:l4r,ALPN_HTTP2C:u4r,ALPN_HTTP1_1:Cne,ALPN_HTTP1_0:d4r}});var Eji=I((h1h,yji)=>{"use strict";p();var Qkc=GP()("helix-fetch:core"),{request:qkc,setupContext:jkc,resetContext:Hkc,RequestAbortedError:Gkc,ALPN_HTTP2:$kc,ALPN_HTTP2C:Vkc,ALPN_HTTP1_1:Wkc,ALPN_HTTP1_0:zkc}=Aji(),f4r=class t{static{a(this,"RequestContext")}constructor(e){this.options={...e||{}},jkc(this)}api(){return{request:a(async(e,r)=>this.request(e,r),"request"),context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),reset:a(async()=>this.reset(),"reset"),RequestAbortedError:Gkc,ALPN_HTTP2:$kc,ALPN_HTTP2C:Vkc,ALPN_HTTP1_1:Wkc,ALPN_HTTP1_0:zkc}}async request(e,r){return qkc(this,e,r)}setCA(e){this.options.ca=e}async reset(){return Qkc("resetting context"),Hkc(this)}};yji.exports=new f4r().api()});var Sji=I((A1h,bji)=>{"use strict";p();var{EventEmitter:Ykc}=require("events"),{Readable:TLe}=require("stream"),p4r=GP()("helix-fetch"),Kkc=Y5r(),{Body:Jkc}=Jbt(),{Headers:A4r}=eEe(),{Request:bne}=Hqi(),{Response:m4r}=r4r(),{FetchBaseError:Zkc,FetchError:ILe,AbortError:a1t}=Z5r(),{AbortController:Xkc,AbortSignal:e2c,TimeoutSignal:t2c}=X5r(),r2c=Kqi(),{cacheableResponse:n2c}=Xqi(),{sizeof:i2c}=G6(),{isFormData:o2c}=bLe(),{context:s2c,RequestAbortedError:a2c}=Eji(),_ji=["GET","HEAD"],c2c=500,l2c=100*1024*1024,h4r="push",vji=a(async(t,e,r)=>{let{request:n}=t.context,o=e instanceof bne&&typeof r>"u"?e:new bne(e,r),{method:s,body:c,signal:l,compress:u,decode:d,follow:f,redirect:h,init:{body:m}}=o,g;if(l&&l.aborted){let w=new a1t("The operation was aborted.");throw o.init.body instanceof TLe&&o.init.body.destroy(w),w}try{g=await n(o.url,{...r,method:s,headers:o.headers.plain(),body:m&&!(m instanceof TLe)&&!o2c(m)?m:c,compress:u,decode:d,follow:f,redirect:h,signal:l})}catch(w){throw m instanceof TLe&&m.destroy(w),w instanceof TypeError?w:w instanceof a2c?new a1t("The operation was aborted."):new ILe(w.message,"system",w)}let A=a(()=>{l.removeEventListener("abort",A);let w=new a1t("The operation was aborted.");o.init.body instanceof TLe&&o.init.body.destroy(w),g.readable.emit("error",w)},"abortHandler");l&&l.addEventListener("abort",A);let{statusCode:y,statusText:E,httpVersion:_,headers:v,readable:b,decoded:T}=g;if([301,302,303,307,308].includes(y)){let{location:w}=v,R=w==null?null:new URL(w,o.url);switch(o.redirect){case"manual":break;case"error":throw l&&l.removeEventListener("abort",A),new ILe(`uri requested responds with a redirect, redirect mode is set to 'error': ${o.url}`,"no-redirect");case"follow":{if(R===null)break;if(o.counter>=o.follow)throw l&&l.removeEventListener("abort",A),new ILe(`maximum redirect reached at: ${o.url}`,"max-redirect");let x={headers:new A4r(o.headers),follow:o.follow,compress:o.compress,decode:o.decode,counter:o.counter+1,method:o.method,body:o.body,signal:o.signal};if(y!==303&&o.body&&o.init.body instanceof TLe)throw l&&l.removeEventListener("abort",A),new ILe("Cannot follow redirect with body being a readable stream","unsupported-redirect");return(y===303||(y===301||y===302)&&o.method==="POST")&&(x.method="GET",x.body=void 0,x.headers.delete("content-length")),l&&l.removeEventListener("abort",A),vji(t,new bne(R,x))}default:}}return l&&(b.once("end",()=>{l.removeEventListener("abort",A)}),b.once("error",()=>{l.removeEventListener("abort",A)})),new m4r(b,{url:o.url,status:y,statusText:E,headers:v,httpVersion:_,decoded:T,counter:o.counter})},"fetch"),Cji=a(async(t,e,r)=>{if(t.options.maxCacheSize===0||!_ji.includes(e.method))return r;let n=new r2c(e,r,{shared:!1});if(n.storable()){let o=await n2c(r);return t.cache.set(e.url,{policy:n,response:o},n.timeToLive()),o}else return r},"cacheResponse"),u2c=a(async(t,e,r)=>{let n=new bne(e,r);if(t.options.maxCacheSize!==0&&_ji.includes(n.method)&&!["no-store","reload"].includes(n.cache)){let{policy:c,response:l}=t.cache.get(n.url)||{};if(c&&c.satisfiesWithoutRevalidation(n)){l.headers=new A4r(c.responseHeaders(l));let u=l.clone();return u.fromCache=!0,u}}let s=await vji(t,n);return n.cache!=="no-store"?Cji(t,n,s):s},"cachingFetch"),d2c=a((t,e={})=>{let r=new URL(t);if(typeof e!="object"||Array.isArray(e))throw new TypeError("qs: object expected");return Object.entries(e).forEach(([n,o])=>{Array.isArray(o)?o.forEach(s=>r.searchParams.append(n,s)):r.searchParams.append(n,o)}),r.href},"createUrl"),f2c=a(t=>new t2c(t),"timeoutSignal"),g4r=class t{static{a(this,"FetchContext")}constructor(e){this.options={...e};let{maxCacheSize:r}=this.options,n=typeof r=="number"&&r>=0?r:l2c,o=c2c;n===0&&(n=1,o=1);let s=a(({response:l},u)=>i2c(l),"sizeCalculation");this.cache=new Kkc({max:o,maxSize:n,sizeCalculation:s}),this.eventEmitter=new Ykc,this.options.h2=this.options.h2||{},typeof this.options.h2.enablePush>"u"&&(this.options.h2.enablePush=!0);let{enablePush:c}=this.options.h2;c&&(this.options.h2.pushPromiseHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(h=>h.startsWith(":")).forEach(h=>delete f[h]),this.pushPromiseHandler(l,f,d)},this.options.h2.pushHandler=(l,u,d)=>{let f={...u};Object.keys(f).filter(_=>_.startsWith(":")).forEach(_=>delete f[_]);let{statusCode:h,statusText:m,httpVersion:g,headers:A,readable:y,decoded:E}=d;this.pushHandler(l,f,new m4r(y,{url:l,status:h,statusText:m,headers:A,httpVersion:g,decoded:E}))}),this.context=s2c(this.options)}api(){return{fetch:a(async(e,r)=>this.fetch(e,r),"fetch"),Body:Jkc,Headers:A4r,Request:bne,Response:m4r,AbortController:Xkc,AbortSignal:e2c,FetchBaseError:Zkc,FetchError:ILe,AbortError:a1t,context:a((e={})=>new t(e).api(),"context"),setCA:a(e=>this.setCA(e),"setCA"),noCache:a((e={})=>new t({...e,maxCacheSize:0}).api(),"noCache"),h1:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1"),keepAlive:a((e={})=>new t({...e,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAlive"),h1NoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1]}).api(),"h1NoCache"),keepAliveNoCache:a((e={})=>new t({...e,maxCacheSize:0,alpnProtocols:[this.context.ALPN_HTTP1_1],h1:{keepAlive:!0}}).api(),"keepAliveNoCache"),reset:a(async()=>this.context.reset(),"reset"),onPush:a(e=>this.onPush(e),"onPush"),offPush:a(e=>this.offPush(e),"offPush"),createUrl:d2c,timeoutSignal:f2c,clearCache:a(()=>this.clearCache(),"clearCache"),cacheStats:a(()=>this.cacheStats(),"cacheStats"),ALPN_HTTP2:this.context.ALPN_HTTP2,ALPN_HTTP2C:this.context.ALPN_HTTP2C,ALPN_HTTP1_1:this.context.ALPN_HTTP1_1,ALPN_HTTP1_0:this.context.ALPN_HTTP1_0}}async fetch(e,r){return u2c(this,e,r)}setCA(e){this.options.ca=e,this.context.setCA(e)}onPush(e){return this.eventEmitter.on(h4r,e)}offPush(e){return this.eventEmitter.off(h4r,e)}clearCache(){this.cache.clear()}cacheStats(){return{size:this.cache.calculatedSize,count:this.cache.size}}pushPromiseHandler(e,r,n){p4r(`received server push promise: ${e}, headers: ${JSON.stringify(r)}`);let o=new bne(e,{headers:r}),{policy:s}=this.cache.get(e)||{};s&&s.satisfiesWithoutRevalidation(o)&&(p4r(`already cached, reject push promise: ${e}, headers: ${JSON.stringify(r)}`),n())}async pushHandler(e,r,n){p4r(`caching resource pushed by server: ${e}, reqHeaders: ${JSON.stringify(r)}, status: ${n.status}, respHeaders: ${JSON.stringify(n.headers)}`);let o=await Cji(this,new bne(e,{headers:r}),n);this.eventEmitter.emit(h4r,e,o)}};bji.exports=new g4r().api()});var Iji=I((_1h,Tji)=>{"use strict";p();Tji.exports=Sji()});var zji=I((bIh,Wji)=>{"use strict";p();function Vji(t,e,r){let n=e[r];if(t==null&&n.required===!1)return;if(t==null)throw new TypeError(`Required parameter \`${n.name}\` missing`);let o=typeof t;if(n.type&&o!==n.type){if(n.required===!1&&e.slice(r).some(s=>s.type===o))return!1;throw new TypeError(`Invalid type for parameter \`${n.name}\`, expected \`${n.type}\` but found \`${typeof t}\``)}return!0}a(Vji,"validateParameter");function U2c(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(U2c,"hasOwnProperty");function Q2c(t,e){return function(){let r=Array.prototype.slice.call(arguments),n=[];for(let s=0,c=0;s{n.push((l,u)=>{if(l)return c(l);s(u)}),t.apply(this,n)});t.apply(this,n)}}a(Q2c,"defineOperation");Wji.exports={defineOperation:Q2c,validateParameter:Vji}});var b4r=I((IIh,Jji)=>{"use strict";p();var aEe=r8e()("kerberos"),sEe=aEe.KerberosClient,Yji=aEe.KerberosServer,Z$=zji().defineOperation,q2c=1,j2c=2,H2c=4,G2c=8,$2c=16,V2c=32,W2c=64,z2c=128,Y2c=256,Kji=0,K2c=9,J2c=6;sEe.prototype.step=Z$(sEe.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);sEe.prototype.wrap=Z$(sEe.prototype.wrap,[{name:"challenge",type:"string"},{name:"options",type:"object"},{name:"callback",type:"function",required:!1}]);sEe.prototype.unwrap=Z$(sEe.prototype.unwrap,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);Yji.prototype.step=Z$(Yji.prototype.step,[{name:"challenge",type:"string"},{name:"callback",type:"function",required:!1}]);var Z2c=Z$(aEe.checkPassword,[{name:"username",type:"string"},{name:"password",type:"string"},{name:"service",type:"string"},{name:"defaultRealm",type:"string",required:!1},{name:"callback",type:"function",required:!1}]),X2c=Z$(aEe.principalDetails,[{name:"service",type:"string"},{name:"hostname",type:"string"},{name:"callback",type:"function",required:!1}]),eDc=Z$(aEe.initializeClient,[{name:"service",type:"string"},{name:"options",type:"object",default:{mechOID:Kji}},{name:"callback",type:"function",required:!1}]),tDc=Z$(aEe.initializeServer,[{name:"service",type:"string"},{name:"callback",type:"function",required:!1}]);Jji.exports={initializeClient:eDc,initializeServer:tDc,principalDetails:X2c,checkPassword:Z2c,GSS_C_DELEG_FLAG:q2c,GSS_C_MUTUAL_FLAG:j2c,GSS_C_REPLAY_FLAG:H2c,GSS_C_SEQUENCE_FLAG:G2c,GSS_C_CONF_FLAG:$2c,GSS_C_INTEG_FLAG:V2c,GSS_C_ANON_FLAG:W2c,GSS_C_PROT_READY_FLAG:z2c,GSS_C_TRANS_FLAG:Y2c,GSS_C_NO_OID:Kji,GSS_MECH_OID_KRB5:K2c,GSS_MECH_OID_SPNEGO:J2c}});var Zji=I((wIh,rDc)=>{rDc.exports={name:"kerberos",version:"2.2.0",description:"Kerberos library for Node.js",main:"lib/index.js",files:["lib","src","binding.gyp","HISTORY.md","README.md"],repository:{type:"git",url:"https://github.com/mongodb-js/kerberos.git"},keywords:["kerberos","security","authentication"],author:{name:"The MongoDB NodeJS Team",email:"dbx-node@mongodb.com"},bugs:{url:"https://jira.mongodb.org/projects/NODE/issues/"},dependencies:{bindings:"^1.5.0","node-addon-api":"^6.1.0","prebuild-install":"^7.1.2"},devDependencies:{"@types/node":"^22.2.0",chai:"^4.4.1","chai-string":"^1.5.0",chalk:"^4.1.2","clang-format":"^1.8.0","dmd-clear":"^0.1.2",eslint:"^9.9.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.1","jsdoc-to-markdown":"^8.0.3",mocha:"^10.7.3",mongodb:"^6.8.0","node-gyp":"^10.1.0",prebuild:"^13.0.0",prettier:"^3.3.3",request:"^2.88.2"},overrides:{prebuild:{"node-gyp":"$node-gyp"}},scripts:{install:"prebuild-install --runtime napi || node-gyp rebuild","format-cxx":"clang-format -i 'src/**/*'","format-js":"ESLINT_USE_FLAT_CONFIG=false eslint lib test --fix","check:lint":"ESLINT_USE_FLAT_CONFIG=false eslint lib test",precommit:"check-clang-format",docs:"jsdoc2md --template etc/README.hbs --plugin dmd-clear --files lib/kerberos.js > README.md",test:"mocha test",prebuild:"prebuild --runtime napi --strip --verbose --all"},engines:{node:">=12.9.0"},binary:{napi_versions:[4]},license:"Apache-2.0",readmeFilename:"README.md"}});var eHi=I((RIh,Xji)=>{"use strict";p();var nDc=require("dns"),iDc=b4r(),S4r=class{static{a(this,"MongoAuthProcess")}constructor(e,r,n,o){o=o||{},this.host=e,this.port=r,this.serviceName=n||o.gssapiServiceName||"mongodb",this.canonicalizeHostName=typeof o.gssapiCanonicalizeHostName=="boolean"?o.gssapiCanonicalizeHostName:!1,this._transition=oDc(this),this.retries=10}init(e,r,n){let o=this;this.username=e,this.password=r;function s(c,l,u){if(!c)return u();nDc.resolveCname(l,(d,f)=>{if(d)return u(d);Array.isArray(f)&&f.length>0&&(o.host=f[0]),u()})}a(s,"performGssapiCanonicalizeHostName"),s(this.canonicalizeHostName,this.host,c=>{if(c)return n(c);let l={};r!=null&&Object.assign(l,{user:e,password:r});let u=process.platform==="win32"?`${this.serviceName}/${this.host}`:`${this.serviceName}@${this.host}`;iDc.initializeClient(u,l,(d,f)=>{if(d)return n(d,null);o.client=f,n(null,f)})})}transition(e,r){if(this._transition==null)return r(new Error("Transition finished"));this._transition(e,r)}};function oDc(t){return(e,r)=>{t.client.step("",(n,o)=>{if(n)return r(n);t._transition=sDc(t),r(null,o)})}}a(oDc,"firstTransition");function sDc(t){return(e,r)=>{t.client.step(e,(n,o)=>{if(n&&t.retries===0)return r(n);if(n)return t.retries=t.retries-1,t.transition(e,r);t._transition=aDc(t),r(null,o||"")})}}a(sDc,"secondTransition");function aDc(t){return(e,r)=>{t.client.unwrap(e,(n,o)=>{if(n)return r(n,!1);t.client.wrap(o,{user:t.username},(s,c)=>{if(s)return r(s,!1);t._transition=cDc(t),r(null,c)})})}}a(aDc,"thirdTransition");function cDc(t){return(e,r)=>{t._transition=null,r(null,!0)}}a(cDc,"fourthTransition");Xji.exports={MongoAuthProcess:S4r}});var rHi=I((DIh,RLe)=>{"use strict";p();var tHi=b4r();RLe.exports=tHi;RLe.exports.Kerberos=tHi;RLe.exports.version=Zji().version;RLe.exports.processes={MongoAuthProcess:eHi().MongoAuthProcess}});var xXi={};xi(xXi,{AbortError:()=>l1,DirectConnectError:()=>qR,DirectConnectTransport:()=>TLr,EXIT_REASONS:()=>OMc,HOOK_EVENTS:()=>MTt,InMemorySessionStore:()=>IBr,SYSTEM_PROMPT_DYNAMIC_BOUNDARY:()=>BMc,createSdkMcpServer:()=>hjc,deleteSession:()=>hVc,filterEscalatingDefaultMode:()=>X$c,foldSessionSummary:()=>_Vi,forkSession:()=>mVc,getSessionInfo:()=>dVc,getSessionMessages:()=>lVc,getSubagentMessages:()=>EVc,importSessionToStore:()=>gVc,listSessions:()=>uVc,listSubagents:()=>yVc,parseDirectConnectUrl:()=>Ajc,query:()=>aVc,renameSession:()=>fVc,resolveSettings:()=>tVc,startup:()=>cVc,tagSession:()=>pVc,tool:()=>pjc});function eNc(t){return this[t]}function iNc(t,e){this[t]=nNc.bind(null,e)}function TBr(t=NMc){let e=new AbortController;return(0,mVi.setMaxListeners)(t,e.signal),e}function gVi(t,e,r){return new Promise((n,o)=>{if(e?.aborted){r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n();return}let s=setTimeout((l,u,d)=>{l?.removeEventListener("abort",u),d()},t,e,c,n);function c(){clearTimeout(s),r?.throwOnAbort||r?.abortError?o(r.abortError?.()??Error("aborted")):n()}a(c,"G"),e?.addEventListener("abort",c,{once:!0}),r?.unref&&s.unref()})}function MMc(t,e){t(Error(e))}function Nne(t,e,r){let n,o=new Promise((s,c)=>{n=setTimeout(MMc,e,c,r),typeof n=="object"&&n.unref?.()});return Promise.race([t,o]).finally(()=>{n!==void 0&&clearTimeout(n)})}function YLr(t,e){if(t.type!=="user"||t.isMeta===!0||t.isCompactSummary===!0)return;let r=t.message;if(!r)return;let n=r.content,o=[];if(typeof n=="string")o.push(n);else if(Array.isArray(n)){for(let s of n)if(!(!s||typeof s!="object")){if(s.type==="tool_result")return;s.type==="text"&&typeof s.text=="string"&&o.push(s.text)}}for(let s of o){let c=s.replaceAll(` +`," ").trim();if(!c)continue;let l=FMc.exec(c);if(l){e.commandFallback||(e.commandFallback=l[1]);continue}let u=/([\s\S]*?)<\/bash-input>/.exec(c);if(u)return`! ${u[1].trim()}`;if(!LMc.test(c))return c.length>200&&(c=c.slice(0,200).trim()+"\u2026"),c}}function _Vi(t,e,r,n){let o=n?.mtime??t?.mtime??0,s=t!==void 0?{sessionId:t.sessionId,mtime:o,data:{...t.data}}:{sessionId:e.sessionId,mtime:o,data:{}},c=s.data;for(let l of r){let u=jMc(l.timestamp);if(c.isSidechain===void 0&&(c.isSidechain=l.isSidechain===!0),c.createdAt===void 0&&u!==void 0&&(c.createdAt=u),c.cwd===void 0){let d=l.cwd;typeof d=="string"&&d&&(c.cwd=d)}HMc(c,l);for(let[d,f]of Object.entries(UMc)){let h=l[d];typeof h=="string"&&(c[f]=h)}if(l.type==="tag"){let d=l.tag;typeof d=="string"&&d?c.tag=d:delete c.tag}}return s}function QMc(t,e){let r=t.data;if(r.isSidechain===!0)return null;let n=tV(r.firstPromptLocked===!0?r.firstPrompt:r.commandFallback)||void 0,o=tV(r.customTitle)||tV(r.aiTitle)||void 0,s=o||tV(r.lastPrompt)||tV(r.summaryHint)||n;return s?{sessionId:t.sessionId,summary:s,lastModified:t.mtime,fileSize:void 0,customTitle:o,firstPrompt:n,gitBranch:tV(r.gitBranch)||void 0,cwd:tV(r.cwd)||e||void 0,tag:tV(r.tag)||void 0,createdAt:qMc(r.createdAt)}:null}function tV(t){return typeof t=="string"?t:void 0}function qMc(t){return typeof t=="number"?t:void 0}function jMc(t){if(typeof t!="string")return;let e=Date.parse(t);return Number.isNaN(e)?void 0:e}function HMc(t,e){if(t.firstPromptLocked)return;let r={commandFallback:t.commandFallback??""},n=YLr(e,r);r.commandFallback&&!t.commandFallback&&(t.commandFallback=r.commandFallback),n!==void 0&&(t.firstPrompt=n,t.firstPromptLocked=!0)}function vVi(){return process.versions.bun!==void 0}function QE(t){if(!t)return!1;if(typeof t=="boolean")return t;let e=String(t).toLowerCase().trim();return["1","true","yes","on"].includes(e)}function q3e(){let t=new Set;return{subscribe(e){return t.add(e),()=>{t.delete(e)}},emit(...e){let r;for(let n of t)try{n(...e)}catch(o){(r??=[]).push(o)}if(r)throw r.length===1?r[0]:AggregateError(r,"Signal listener(s) threw")},clear(){t.clear()}}}function KMc(t){var e=zMc.call(t,DLe),r=t[DLe];try{t[DLe]=void 0;var n=!0}catch{}var o=YMc.call(t);return n&&(e?t[DLe]=r:delete t[DLe]),o}function eOc(t){return XMc.call(t)}function iOc(t){return t==null?t===void 0?nOc:rOc:qHi&&qHi in Object(t)?JMc(t):tOc(t)}function oOc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function uOc(t){if(!o9(t))return!1;var e=j3e(t);return e==aOc||e==cOc||e==sOc||e==lOc}function fOc(t){return!!jHi&&jHi in t}function gOc(t){if(t!=null){try{return mOc.call(t)}catch{}try{return t+""}catch{}}return""}function TOc(t){if(!o9(t)||pOc(t))return!1;var e=KLr(t)?SOc:EOc;return e.test(AOc(t))}function xOc(t,e){return t?.[e]}function ROc(t,e){var r=wOc(t,e);return IOc(r)?r:void 0}function kOc(){this.__data__=f3e?f3e(null):{},this.size=0}function NOc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function FOc(t){var e=this.__data__;if(f3e){var r=e[t];return r===OOc?void 0:r}return LOc.call(e,t)?e[t]:void 0}function jOc(t){var e=this.__data__;return f3e?e[t]!==void 0:qOc.call(e,t)}function $Oc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=f3e&&e===void 0?GOc:e,this}function t_e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1}function o5c(t,e){var r=this.__data__,n=BTt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function r_e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,s=n[2]||0,c=n[3]||0;return{browser:e,version:`${o}.${s}.${c}`}}}return null}function k5c(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function RVi(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function PVi(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return RVi({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function t3r(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function D5c(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}function M5c(t){return Object.entries(t).filter(([e,r])=>typeof r<"u").map(([e,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(e)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(e)}=`;throw new Ii(`Cannot stringify type ${typeof r}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}function DVi(t){if(!t)return;let e;try{e=new URL(t)}catch(n){throw new zl(`Invalid token endpoint base URL "${t}": ${n}`)}if(e.protocol==="https:")return;let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(!(e.protocol==="http:"&&(r==="localhost"||r==="127.0.0.1"||r==="::1")))throw new zl(`Refusing to send credential over non-https token endpoint "${t}"`)}async function NVi(t,e){let r=await q5c(t),n;try{n=JSON.parse(r)}catch{throw new zl(`Token endpoint returned non-JSON response (status ${t.status})`,t.status,jR(r),e)}if(!n.access_token)throw new zl(`Token endpoint response missing access_token: ${JSON.stringify(jR(n))}`,t.status,jR(n),e);if(n.token_type&&n.token_type.toLowerCase()!=="bearer")throw new zl(`Token endpoint response: unsupported token_type "${n.token_type}" (want Bearer)`,t.status,jR(n),e);return n}function jR(t){if(t==null)return t;if(typeof t=="string"){let e;try{e=JSON.parse(t)}catch{return t.length<=W4r?t:t.slice(0,W4r)+`... <${t.length-W4r} more chars>`}return JSON.stringify(jR(e))}if(typeof t=="object"&&!Array.isArray(t)){let e={};for(let[r,n]of Object.entries(t))Q5c.has(r)&&(e[r]=n);return e}return null}async function MVi(t,e=r=>console.warn(`anthropic-sdk: ${r}`)){if(typeof process>"u"||process.platform==="win32")return;let r=await import("node:fs"),n=t,o;try{n=await r.promises.realpath(t),o=await r.promises.stat(n)}catch{return}let s=o.mode&511;if(s&18)throw new zl(`Credentials file at ${n} is group/world-writable (mode 0o${s.toString(8)}); this allows other local users to plant tokens. Run \`chmod 600 ${n}\`.`);if(s&36)throw new zl(`Credentials file at ${n} is group/world-readable (mode 0o${s.toString(8)}); run \`chmod 600 ${n}\` before retrying.`);typeof process.getuid=="function"&&o.uid!==process.getuid()&&e(`credentials file at ${n} is owned by uid ${o.uid} (current process uid ${process.getuid()}); verify this is intentional.`)}async function OVi(t,e){let r=await import("node:fs"),n=(await import("node:path")).dirname(t);await r.promises.mkdir(n,{recursive:!0,mode:448});let o=`${t}.${process.pid}.${Math.random().toString(36).slice(2)}.tmp`;try{let s=await r.promises.open(o,"w",384);try{await s.writeFile(JSON.stringify(e,null,2)),await s.sync()}finally{await s.close()}await r.promises.rename(o,t)}catch(s){throw await r.promises.unlink(o).catch(()=>{}),s}try{let s=await r.promises.open(n,"r");try{await s.sync()}finally{await s.close()}}catch{}}async function q5c(t){if(!t.body)return"";let e=t.body.getReader(),r=[],n=0;for(;;){let{done:s,value:c}=await e.read();if(s)break;if(n+c.length>YHi){let l=YHi-n;l>0&&r.push(c.subarray(0,l)),await e.cancel();break}r.push(c),n+=c.length}let o;if(r.length===1)o=r[0];else{o=new Uint8Array(r.reduce((c,l)=>c+l.length,0));let s=0;for(let c of r)o.set(c,s),s+=c.length}return new TextDecoder("utf-8").decode(o)}function Mne(){return Math.floor(Date.now()/1e3)}function j5c(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function n3r(t){let e;return(KHi??(e=new globalThis.TextEncoder,KHi=e.encode.bind(e)))(t)}function ZHi(t){let e;return(JHi??(e=new globalThis.TextDecoder,JHi=e.decode.bind(e)))(t)}function XLe(){}function B1t(t,e,r){return!e||ySt[t]>ySt[r]?XLe:e[t].bind(e)}function Qg(t){let e=t.logger,r=t.logLevel??"off";if(!e)return H5c;let n=eGi.get(e);if(n&&n[0]===r)return n[1];let o={error:B1t("error",e,r),warn:B1t("warn",e,r),info:B1t("info",e,r),debug:B1t("debug",e,r)};return eGi.set(e,[r,o]),o}function LVi(t){if(!t)throw Error("profile name is empty");if(t==="."||t==="..")throw Error(`profile name "${t}" is not allowed`);if(t.includes("/")||t.includes("\\"))throw Error(`profile name "${t}" must not contain path separators`);if(!G5c.test(t))throw Error(`profile name "${t}" contains disallowed characters (allowed: letters, digits, '_', '.', '-')`)}function tGi(t){if(!t)throw new Ii("Identity token file path is empty");return async()=>{let e=await import("node:fs"),r;try{r=await e.promises.readFile(t,"utf-8")}catch(o){throw new Ii(`Failed to read identity token file at ${t}: ${o}`)}let n=r.trim();if(!n)throw new Ii(`Identity token file at ${t} is empty`);return n}}function z5c(t){if(!t)throw new Ii("Identity token value is empty");return()=>t}function Y5c(t){return async()=>{DVi(t.baseURL);let e=await t.identityTokenProvider();if(e.length>16384)throw new zl(`Identity token is ${Math.ceil(e.length/1024)} KiB, exceeds the 16 KiB assertion limit`);let r={grant_type:O5c,assertion:e,federation_rule_id:t.federationRuleId,organization_id:t.organizationId};t.serviceAccountId&&(r.service_account_id=t.serviceAccountId),t.workspaceId&&(r.workspace_id=t.workspaceId);let n=`${t.baseURL}${kVi}`,o;try{o=await t.fetch(n,{method:"POST",headers:{"Content-Type":"application/json","anthropic-beta":`${ASt},${L5c}`,"User-Agent":t.userAgent||`anthropic-sdk-typescript/${lV} oidcFederationProvider`},body:JSON.stringify(r)})}catch(u){throw new zl(`Failed to reach token endpoint ${n}: ${u}`)}let s=o.headers.get("Request-Id");if(!o.ok){let u=await o.text().catch(()=>""),d=jR(u),f="";throw o.status===401&&(f=` Ensure your federation rule matches your identity token. ${t.workspaceId?"":"If your federation rule is scoped to multiple workspaces, set the ANTHROPIC_WORKSPACE_ID environment variable, the 'workspace_id' config key, or the `workspaceId` option. "}View your authentication events in the Workload identity page of Claude Console for more details.`),new zl(`Token exchange failed with status ${o.status}${s?` (request-id ${s})`:""}: ${d}${f}`,o.status,d,s)}let c=await NVi(o,s),l=Number(c.expires_in);if(!Number.isFinite(l))throw new zl(`Token endpoint response missing required fields: ${JSON.stringify(jR(c))}`,o.status,jR(c),s);return{token:c.access_token,expiresAt:Mne()+l}}}function K5c(t){return async e=>{let r=await import("node:fs");await MVi(t.credentialsPath,t.onSafetyWarning);let n;try{n=await r.promises.readFile(t.credentialsPath,"utf-8")}catch(E){throw new zl(`Credentials file not found at ${t.credentialsPath}: ${E}`)}let o;try{o=JSON.parse(n)}catch(E){throw new zl(`Credentials file at ${t.credentialsPath} is not valid JSON: ${E}`)}let s=o.access_token;if(!s)throw new zl(`Credentials file at ${t.credentialsPath} must include 'access_token'`);let c=o.expires_at;if(!e?.forceRefresh&&(c==null||Mne()"");throw new zl(`User OAuth refresh failed (HTTP ${f.status}): ${jR(E)}`,f.status,jR(E),h)}let m=await NVi(f,h),g=Number(m.expires_in);if(!Number.isFinite(g))throw new zl(`User OAuth refresh response missing or invalid expires_in: ${JSON.stringify(jR(m))}`,f.status,jR(m),h);let A=Mne()+g,y=m.refresh_token||l;return await OVi(t.credentialsPath,{...o,version:BVi,type:"oauth_token",access_token:m.access_token,expires_at:A,refresh_token:y}),{token:m.access_token,expiresAt:A}}}function UVi(t,e){let r=t.authentication.credentials_path??null,n=(t.base_url||e.baseURL).replace(/\/+$/,""),o=Z5c(t,r,n,e),s={};return t.workspace_id&&t.authentication.type==="user_oauth"&&(s["anthropic-workspace-id"]=t.workspace_id),{provider:o,extraHeaders:s,baseURL:t.base_url||void 0}}async function J5c(t,e){let r=await $5c(e);if(!r)return null;let{config:n,fromFile:o}=r,s=n.authentication.credentials_path||!o?n:{...n,authentication:{...n.authentication,credentials_path:await V5c(n,e)??void 0}};return UVi(s,t)}function Z5c(t,e,r,n){switch(t.authentication.type){case"oidc_federation":{let o=t.authentication,s=X5c(o);if(!s)throw new zl("oidc_federation config requires an identity token (set authentication.identity_token, ANTHROPIC_IDENTITY_TOKEN_FILE, or ANTHROPIC_IDENTITY_TOKEN)");if(!o.federation_rule_id)throw new zl("oidc_federation config requires 'federation_rule_id'. Set it in authentication.federation_rule_id in your profile, or via ANTHROPIC_FEDERATION_RULE_ID (profile takes precedence).");if(!t.organization_id)throw new zl("oidc_federation config requires organization_id (set ANTHROPIC_ORGANIZATION_ID or config.organization_id)");let c=Y5c({identityTokenProvider:s,federationRuleId:o.federation_rule_id,organizationId:t.organization_id,serviceAccountId:o.service_account_id,workspaceId:t.workspace_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent});return e?e4c(c,e,n.onCacheWriteError,n.onSafetyWarning):c}case"user_oauth":{if(!e)throw new zl("user_oauth config requires authentication.credentials_path (or load via a profile so it defaults to /credentials/.json)");return K5c({credentialsPath:e,clientId:t.authentication.client_id,baseURL:r,fetch:n.fetch,userAgent:n.userAgent,onSafetyWarning:n.onSafetyWarning})}default:{let o=t.authentication.type;throw new zl(`authentication.type "${o}" is not a known authentication type`)}}}function X5c(t){if(t.identity_token){let n=t.identity_token.source;if(n!=="file")throw new zl(`identity_token.source "${n}" is not supported by this SDK version (only "file")`);if(!t.identity_token.path)throw new zl('identity_token.source "file" requires a non-empty path');return tGi(t.identity_token.path)}let e=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE");if(e)return tGi(e);let r=Vl("ANTHROPIC_IDENTITY_TOKEN");return r?z5c(r):null}function e4c(t,e,r,n){return async o=>{let s=await import("node:fs");await MVi(e,n);let c;try{let u=await s.promises.readFile(e,"utf-8");c=JSON.parse(u);let d=c?.access_token;if(d&&!o?.forceRefresh){let f=c?.expires_at;if(f==null||Mne()0&&(yield e)}function o4c(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}async function QVi(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:s}=e,c=await(async()=>{if(e.options.stream)return Qg(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller):Qne.fromSSEResponse(r,e.controller);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let l=r.headers.get("content-type")?.split(";")[0]?.trim();if(l?.includes("application/json")||l?.endsWith("+json")){if(r.headers.get("content-length")==="0")return;let u=await r.json();return qVi(u,r)}return await r.text()})();return Qg(t).debug(`[${n}] response parsed`,kne({retryOfRequestLogID:o,url:r.url,status:r.status,body:c,durationMs:Date.now()-s})),c}function qVi(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("request-id"),enumerable:!1})}function IEe(t,e,r){return jVi(),new File(t,e??"unknown_file",r)}function rSt(t,e){let r=typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"";return e?r.split(/[\\/]/).pop()||void 0:r}function s4c(t){let e=typeof t=="function"?t:t.fetch,r=rGi.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,s=new FormData;return s.toString()!==await new o(s).text()}catch{return!0}})();return rGi.set(e,n),n}async function d4c(t,e,r){if(jVi(),t=await t,e||(e=rSt(t,!0)),l4c(t))return t instanceof File&&e==null&&r==null?t:IEe([await t.arrayBuffer()],e??t.name,{type:t.type,lastModified:t.lastModified,...r});if(u4c(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),IEe(await MBr(o),e,r)}let n=await MBr(t);if(!r?.type){let o=n.find(s=>typeof s=="object"&&"type"in s&&s.type);typeof o=="string"&&(r={...r,type:o})}return IEe(n,e,r)}async function MBr(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(GVi(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(HVi(t))for await(let r of t)e.push(...await MBr(r));else{let r=t?.constructor?.name;throw Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${f4c(t)}`)}return e}function f4c(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(e=>`"${e}"`).join(", ")}]`}function*p4c(t){if(!t)return;if($Vi in t){let{values:n,nulls:o}=t;yield*n.entries();for(let s of o)yield[s,null];return}let e=!1,r;t instanceof Headers?r=t.entries():GHi(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw TypeError("expected header name to be a string");let s=GHi(n[1])?n[1]:[n[1]],c=!1;for(let l of s)l!==void 0&&(e&&!c&&(c=!0,yield[o,null]),yield[o,l])}}function VVi(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}function nSt(t){return typeof t=="object"&&t!==null&&c3e in t}function WVi(t,e){let r=new Set;if(t)for(let n of t)nSt(n)&&r.add(n[c3e]);if(e){for(let n of e)if(nSt(n)&&r.add(n[c3e]),Array.isArray(n.content))for(let o of n.content)nSt(o)&&r.add(o[c3e])}return Array.from(r)}function zVi(t,e){let r=WVi(t,e);return r.length===0?{}:{"x-stainless-helper":r.join(", ")}}function m4c(t){return nSt(t)?{"x-stainless-helper":t[c3e]}:{}}function KVi(t){return t?.output_format??t?.output_config?.format}function iGi(t,e,r){let n=KVi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>{if(o.type==="text"){let s=Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(s,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return o}),parsed_output:null}:JVi(t,e,r)}function JVi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=g4c(e,s.text);n===null&&(n=c);let l=Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1});return Object.defineProperty(l,"parsed",{get(){return r.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),c},enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function g4c(t,e){let r=KVi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ii(`Failed to parse structured output: ${n}`)}}function cGi(t){return t.type==="tool_use"||t.type==="server_tool_use"||t.type==="mcp_tool_use"}function uGi(){let t,e;return{promise:new Promise((r,n)=>{t=r,e=n}),resolve:t,reject:e}}async function C4c(t,e=t.messages.at(-1),r){if(!e||e.role!=="assistant"||!e.content||typeof e.content=="string")return null;let n=e.content.filter(o=>o.type==="tool_use");return n.length===0?null:{role:"user",content:await Promise.all(n.map(async o=>{let s=t.tools.find(c=>("name"in c?c.name:c.mcp_server_name)===o.name);if(!s||!("run"in s))return{type:"tool_result",tool_use_id:o.id,content:`Error: Tool '${o.name}' not found`,is_error:!0};try{let c=o.input;"parse"in s&&s.parse&&(c=s.parse(c));let l=await s.run(c,{toolUseBlock:o,signal:r?.signal});return{type:"tool_result",tool_use_id:o.id,content:l}}catch(c){return{type:"tool_result",tool_use_id:o.id,content:c instanceof PSt?c.content:`Error: ${c instanceof Error?c.message:String(c)}`,is_error:!0}}}))}}function fGi(t){if(!t.output_format)return t;if(t.output_config?.format)throw new Ii("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:e,...r}=t;return{...r,output_config:{...t.output_config,format:e}}}function XVi(t){return t?.output_config?.format}function pGi(t,e,r){let n=XVi(e);return!e||!("parse"in(n??{}))?{...t,content:t.content.map(o=>o.type==="text"?Object.defineProperty({...o},"parsed_output",{value:null,enumerable:!1}):o),parsed_output:null}:eWi(t,e,r)}function eWi(t,e,r){let n=null,o=t.content.map(s=>{if(s.type==="text"){let c=S4c(e,s.text);return n===null&&(n=c),Object.defineProperty({...s},"parsed_output",{value:c,enumerable:!1})}return s});return{...t,content:o,parsed_output:n}}function S4c(t,e){let r=XVi(t);if(r?.type!=="json_schema")return null;try{return"parse"in r?r.parse(e):JSON.parse(e)}catch(n){throw new Ii(`Failed to parse structured output: ${n}`)}}function AGi(t){return t.type==="tool_use"||t.type==="server_tool_use"}function H3e(t){return t instanceof Error?t:Error(String(t))}function oSt(t){return t instanceof Error?t.message:String(t)}function lI(t){if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code}function G3e(t){return lI(t)==="ENOENT"}function rWi(t){return lI(t)==="EISDIR"}function w4c(t){let e=lI(t);return e==="ENOENT"||e==="EACCES"||e==="EPERM"||e==="ENOTDIR"||e==="ELOOP"||e==="EROFS"}async function k4c(t,e,r){let n=`${t}.tmp.${(0,oWi.randomBytes)(4).toString("hex")}`;try{await(0,tB.writeFile)(n,e,{encoding:"utf8",mode:r});try{await(0,tB.rename)(n,t)}catch(o){let s=lI(o);if(s!==void 0&&R4c.has(s)){try{await(0,tB.copyFile)(n,t)}catch(c){throw P4c.has(lI(c)??"")&&await(0,tB.unlink)(t).catch(()=>{}),c}await(0,tB.unlink)(n).catch(()=>{})}else throw o}}catch(o){throw await(0,tB.unlink)(n).catch(()=>{}),o}}function USt(){return D4c.getStore()??new QBr}function sWi(){if(gEe)return gEe;if(!QE(process.env.DEBUG_CLAUDE_AGENT_SDK))return One=null,gEe=Promise.resolve(),gEe;let t=(0,UBr.join)(i_e(),"debug");return One=(0,UBr.join)(t,`sdk-${(0,nWi.randomUUID)()}.txt`),process.stderr.write(`SDK debug logs: ${One} +`),gEe=USt().mkdir(t).catch(()=>{}),gEe}function N4c(){return sWi(),One??null}function UR(t){if(One===null)return;let e=`${new Date().toISOString()} ${t} +`;sWi().then(()=>{One&&USt().append(One,e).catch(()=>{})})}function M4c(){this.__data__=new LTt,this.size=0}function B4c(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function F4c(t){return this.__data__.get(t)}function Q4c(t){return this.__data__.has(t)}function H4c(t,e){var r=this.__data__;if(r instanceof LTt){var n=r.__data__;if(!SVi||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=gBc}function jBc(t){return s_e(t)&&l3r(t.length)&&!!md[j3e(t)]}function GBc(t){return function(e){return t(e)}}function JBc(t,e){var r=mV(t),n=!r&&y3e(t),o=!r&&!n&&c3r(t),s=!r&&!n&&!o&&dWi(t),c=r||n||o||s,l=c?eBc(t.length,String):[],u=l.length;for(var d in t)(e||KBc.call(t,d))&&!(c&&(d=="length"||o&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||UTt(d,u)))&&l.push(d);return l}function eLc(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||XBc;return t===r}function tLc(t,e){return function(r){return t(e(r))}}function nLc(t){return t!=null&&l3r(t.length)&&!KLr(t)}function iLc(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function cLc(t){if(!o9(t))return oLc(t);var e=fWi(t),r=[];for(var n in t)n=="constructor"&&(e||!aLc.call(t,n))||r.push(n);return r}function uLc(t){return u3r(t)?ZBc(t,!0):lLc(t)}function fLc(t,e){if(e)return t.slice();var r=t.length,n=TGi?TGi(r):new t.constructor(r);return t.copy(n),n}function pLc(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r{let y=u;u=null,y&&f(y.join(""))})}return a(g,"N"),{write(A){if(o){f(A);return}s.push(A),c+=A.length,m(),(s.length>=r||c>=n)&&g()},flush:h,dispose(){h()}}}function S3c(t){return typeof t=="function"?t:Symbol.asyncDispose in t?()=>t[Symbol.asyncDispose]():()=>t[Symbol.dispose]()}function I3c(t){return T3c.register(t)}function w3c(t){let e=[],r=t.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])e.push("mcp"),e.push(r[1].toLowerCase());else{let s=t.match(/^([^:[]+):/);s&&s[1]&&e.push(s[1].trim().toLowerCase())}let n=t.match(/^\[([^\]]+)]/);n&&n[1]&&e.push(n[1].trim().toLowerCase()),t.toLowerCase().includes("1p event:")&&e.push("1p");let o=t.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(o&&o[1]){let s=o[1].trim().toLowerCase();s.length<30&&!s.includes(" ")&&e.push(s)}return Array.from(new Set(e))}function R3c(t,e){return e?t.length===0?!1:e.isExclusive?!t.some(r=>e.exclude.includes(r)):t.some(r=>e.include.includes(r)):!0}function P3c(t,e){if(!e)return!0;let r=w3c(t);return R3c(r,e)}function k3c(t){return/^[\\/]{2}/.test(t)}function D3c(t){return t.startsWith("\\\\?\\UNC\\")?"\\\\"+t.slice(8):t.startsWith("\\\\?\\")&&t.length>=7&&t[5]===":"?t.slice(4):t}function PGi(t){try{return D3c(vWi.realpathSync.native(t))}catch{return null}}function N3c(t,e){let r=(0,rB.resolve)(e).toLowerCase(),n=(0,rB.resolve)(t).toLowerCase();if((0,rB.dirname)(n)===r||n.startsWith(r+rB.sep))return!0;let o=PGi(e)?.toLowerCase();if(o==null)return!1;let s=PGi((0,rB.dirname)((0,rB.resolve)(t)))?.toLowerCase();return s==null?!0:s===o||s.startsWith(o+rB.sep)}function CWi(t,e){if(k3c(e))return{resolvedPath:e,isSymlink:!1,isCanonical:!1};try{let r=t.lstatSync(e);if(r.isFIFO()||r.isSocket()||r.isCharacterDevice()||r.isBlockDevice())return{resolvedPath:e,isSymlink:!1,isCanonical:!1};let n=t.realpathSync(e);return{resolvedPath:n,isSymlink:n!==e,isCanonical:!0}}catch{return{resolvedPath:e,isSymlink:!1,isCanonical:!1}}}function uI(){return O3c}function B3c(t,e){t.destroyed||t.write(e)}function L3c(t){B3c(process.stderr,t)}function F3c(t){return t.charAt(0).toUpperCase()+t.slice(1)}function U3c(t,e,r=e+"s"){return t===1?e:r}function Q3c(t,e){let r=t.indexOf(e);return r===-1?t:t.slice(0,r)}function G3c(t){return H3c.map(e=>({id:e.id,confidence:e.confidence,re:new RegExp(e.source,t?(e.flags??"").replace("g","")+"g":e.flags??"")}))}function $3c(t){NGi??=G3c(!0);for(let e of NGi)t=t.replace(e.re,(r,n)=>{if(typeof n!="string")return"[REDACTED]";let o=n.length>=2&&(n[0]==='"'||n[0]==="'")&&n.at(-1)===n[0]?n[0]:"",s=r.lastIndexOf(n);return`${r.slice(0,s)}${o}[REDACTED]${o}${r.slice(s+n.length)}`});return t}function qTt(){return typeof process<"u"&&Array.isArray(process.argv)?process.argv:[]}function Y3c(t){if(!$Br()||typeof process>"u"||typeof process.versions>"u"||typeof process.versions.node>"u")return!1;let e=z3c();return P3c(t,e)}async function TWi(t,e,r=J3c){if(zLe<0?zLe=await(0,HE.stat)(t).then(n=>n.size).catch(()=>0):zLe+=e,!(zLe<=r||oBr)){oBr=!0;try{let n=t.endsWith(".txt")?`${t.slice(0,-4)}.1.txt`:`${t}.1`;try{await(0,HE.rename)(t,n)}catch(o){G3e(o)||(await(0,HE.unlink)(n).catch(()=>{}),await(0,HE.rename)(t,n).catch(()=>(0,HE.unlink)(t).catch(()=>{})))}zLe=0}finally{oBr=!1}}}function IWi(t){return VBr=(0,Wne.join)(t,`${_Wi()}.txt`),VBr}async function Z3c(t,e,r,n){t&&await(0,HE.mkdir)(e,{recursive:!0}).catch(()=>{});let o=r;try{await(0,HE.appendFile)(r,n)}catch(s){if(!rWi(s))throw s;o=IWi(r),await(0,HE.appendFile)(o,n)}await TWi(o,Buffer.byteLength(n)).catch(WBr),wWi()}function WBr(){}function X3c(){if(!J1t){let t=null;J1t=b3c({writeFn:a(e=>{let r=xWi(),n=(0,Wne.dirname)(r),o=t!==n;if(t=n,$Br()){if(o)try{uI().mkdirSync(n)}catch{}let s=r;try{uI().appendFileSync(r,e)}catch(c){if(!rWi(c))throw c;s=IWi(r),uI().appendFileSync(s,e)}TWi(s,Buffer.byteLength(e)).catch(WBr),wWi();return}iBr=iBr.then(Z3c.bind(null,o,n,r,e)).catch(WBr)},"writeFn"),flushIntervalMs:1e3,maxBufferSize:100,immediateMode:$Br()}),I3c(async()=>{J1t?.dispose(),await iBr})}return J1t}function Wl(t,{level:e}={level:"debug"}){if(GBr[e]t.endsWith(e))}function lFc(t,e){return(0,yVi.existsSync)(t)?e?`Claude Code native binary at ${t} exists but failed to launch.`:`Claude Code executable at ${t} exists but failed to launch.`:e?`Claude Code native binary not found at ${t}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${t}. Is options.pathToClaudeCodeExecutable set?`}function uFc(){if(process.platform!=="linux")return!1;let t=typeof process.report?.getReport=="function"?process.report.getReport():null;return t!=null&&t.header?.glibcVersionRuntime===void 0}function dFc(t,e=process.platform,r=process.arch,n=RWi.existsSync,o=uFc()){let s=e==="win32"?".exe":"",c=(e==="android"?[`${AEe}-linux-${r}-android`]:e==="linux"?o?[`${AEe}-linux-${r}-musl`,`${AEe}-linux-${r}`]:[`${AEe}-linux-${r}`,`${AEe}-linux-${r}-musl`]:[`${AEe}-${e}-${r}`]).map(l=>`${l}/claude${s}`);for(let l of c)try{let u=t(l);if(n(u))return u}catch{}return null}function fFc(){return{eventQueue:[],sink:null}}function g3r(t,e){let r=pFc;if(r.sink===null){r.eventQueue.push({eventName:t,metadata:e,async:!1});return}r.sink.logEvent(t,e)}function PWi(t){g3r("tengu_feature_ok",{feature_name:t})}function kWi(t,e,r){g3r("tengu_feature_bad",{feature_name:t,error_code:e,...r})}function hFc(t,e,r){g3r("tengu_feature_sad",{feature_name:t,error_code:e,...r})}async function Z6(t,e,r){try{let n=await e();return PWi(t),n}catch(n){throw kWi(t,r?.(n)??"error"),n}}function gFc(t){let e=t,r="",n=0,o=10;for(;e!==r&&n=o)throw Error(`Unicode sanitization reached maximum iterations (${o}) for input: ${t.slice(0,100)}`);return e}function u3e(t){if(typeof t=="string")return gFc(t);if(Array.isArray(t))return t.map(u3e);if(t!==null&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[u3e(r)]=u3e(n);return e}return t}function AFc(){return process.platform==="win32"}function EFc(t){let e=sBr.get(t);if(e!==void 0)return e;let r=process.env.SYSTEMROOT||"C:\\Windows",n=(0,LWi.join)(r,"System32","where.exe");try{let o=(0,BWi.execFileSync)(n,[t],{stdio:"pipe",encoding:"utf8",timeout:yFc,windowsHide:!0,env:process.env}).trim().split(/\r?\n/).filter(Boolean),s=process.cwd();for(let c of o)if(!N3c(c,s))return sBr.set(t,c),c;return null}catch(o){return _Fc(o)&&sBr.set(t,null),null}}function _Fc(t){if(t===null||typeof t!="object")return!1;let e="status"in t?t.status:void 0,r="signal"in t?t.signal:void 0,n="code"in t?t.code:void 0;return e===1&&!r&&!n}function vFc(t){return!AFc()||t.includes("/")||t.includes("\\")?t:EFc(t)}async function $3e(t){let e=vFc("git");if(e===null)return[];try{let{stdout:r}=await CFc(e,["worktree","list","--porcelain"],{cwd:t,timeout:5e3});return r?r.split(` +`).filter(n=>n.startsWith("worktree ")).map(n=>n.slice(9).normalize("NFC")):[]}catch{return[]}}function bFc(t){let e=0;for(let r=0;ro&&(n=FWi(t.slice(u,d)),o=l);break}d++}c=d+1}}return n}async function XBr(t,e){let r=(0,NWi.createWriteStream)(t,{mode:384});try{for(let n of e)r.write(JSON.stringify(n)+` +`)||await(0,ZBr.once)(r,"drain");r.end(),await(0,ZBr.once)(r,"finish")}catch(n){throw r.destroy(),n}}function UWi(t){let e=0,r={commandFallback:""};for(;e=0?t.slice(e,n):t.slice(e);if(e=n>=0?n+1:t.length,!(!o.includes('"type":"user"')&&!o.includes('"type": "user"'))&&!o.includes('"tool_result"')&&!(o.includes('"isMeta":true')||o.includes('"isMeta": true'))&&!(o.includes('"isCompactSummary":true')||o.includes('"isCompactSummary": true')))try{let s=JSON.parse(o),c=YLr(s,r);if(c!==void 0)return c}catch{continue}}return r.commandFallback}function TFc(t){let e={commandFallback:""};for(let r of t){if(typeof r!="object"||r===null)continue;let n=YLr(r,e);if(n!==void 0)return n}return e.commandFallback}async function QWi(t){try{let e=await(0,sN.open)(t,"r");try{let r=await e.stat(),n=Buffer.allocUnsafe(r9),o=await e.read(n,0,r9,0);if(o.bytesRead===0)return null;let s=n.toString("utf8",0,o.bytesRead),c=Math.max(0,r.size-r9),l=s;if(c>0){let u=await e.read(n,0,r9,c);l=n.toString("utf8",0,u.bytesRead)}return{mtime:r.mtime.getTime(),size:r.size,head:s,tail:l}}finally{await e.close()}}catch{return null}}function IFc(t){return Math.abs(bFc(t)).toString(36)}function V3e(t){let e=t.replace(/[^a-zA-Z0-9]/g,"-");return e.length<=E3e?e:`${e.slice(0,E3e)}-${IFc(t)}`}function _V(){return(0,OEe.join)(i_e(),"projects")}function xFc(t){return(0,OEe.join)(_V(),V3e(t))}async function W3e(t){try{return(await(0,sN.realpath)(t)).normalize("NFC")}catch{return t.normalize("NFC")}}async function iN(t){let e=xFc(t),r=[];try{await(0,sN.readdir)(e),r.push(e)}catch{}let n=V3e(t);if(n.length<=E3e)return r;let o=n.slice(0,E3e)+"-",s=_V();try{for(let c of await(0,sN.readdir)(s,{withFileTypes:!0})){if(!c.isDirectory()||!c.name.startsWith(o))continue;let l=(0,OEe.join)(s,c.name);l!==e&&r.push(l)}}catch{}return r}async function jTt(t,e){let r=`${t}.jsonl`;async function n(c,l){let u=(0,OEe.join)(c,r);try{let d=await(0,sN.stat)(u);if(d.size>0)return{filePath:u,projectPath:l,fileSize:d.size}}catch{}}if(a(n,"Y"),e){let c=await W3e(e);for(let u of await iN(c)){let d=await n(u,c);if(d)return d}let l;try{l=await $3e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await iN(u)){let f=await n(d,u);if(f)return f}return}let o=_V(),s;try{s=await(0,sN.readdir)(o)}catch{return}for(let c of s){let l=await n((0,OEe.join)(o,c),void 0);if(l)return l}}function kFc(){return PFc??=Buffer.from('"compact_boundary"')}function qWi(t){try{let e=JSON.parse(t);return e.type!=="system"||e.subtype!=="compact_boundary"?null:{hasPreservedSegment:!!(e.compactMetadata?.preservedSegment||e.compactMetadata?.preservedMessages)}}catch{return null}}function Bne(t,e,r,n){let o=n-r;if(!(o<=0)){if(t.len+o>t.buf.length){let s=Buffer.allocUnsafe(Math.min(Math.max(t.buf.length*2,t.len+o),t.cap));t.buf.copy(s,0,0,t.len),t.buf=s}e.copy(t.buf,t.len,r,n),t.len+=o}}function $St(t,e,r,n){return n-r>=e.length&&t.compare(e,0,e.length,r,r+e.length)===0}function OFc(t,e,r){if(t.straddleSnapCarryLen=0,t.straddleSnapTailEnd=0,t.carryLen===0)return 0;let n=t.carryBuf,o=e.indexOf(_3e);if(o===-1||o>=r)return 0;let s=o+1;if($St(n,VSt,0,t.carryLen))t.straddleSnapCarryLen=t.carryLen,t.straddleSnapTailEnd=s,t.lastSnapSrc=null;else{if(t.carryLen=s&&nt.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),e.copy(t.lastSnapBuf,0,n,o),t.lastSnapSrc=t.lastSnapBuf):t.straddleSnapCarryLen>0&&(t.lastSnapLen=t.straddleSnapCarryLen+t.straddleSnapTailEnd,(t.lastSnapBuf===void 0||t.lastSnapLen>t.lastSnapBuf.length)&&(t.lastSnapBuf=Buffer.allocUnsafe(t.lastSnapLen)),t.carryBuf.copy(t.lastSnapBuf,0,0,t.straddleSnapCarryLen),r.copy(t.lastSnapBuf,t.straddleSnapCarryLen,0,t.straddleSnapTailEnd),t.lastSnapSrc=t.lastSnapBuf)}function FFc(t,e,r){t.carryLen=e.length-r,t.carryLen>0&&((t.carryBuf===void 0||t.carryLen>t.carryBuf.length)&&(t.carryBuf=Buffer.allocUnsafe(t.carryLen)),e.copy(t.carryBuf,0,r,e.length))}function UFc(t){if(t.carryLen>0){let e=t.carryBuf;$St(e,VSt,0,t.carryLen)?(t.lastSnapSrc=e,t.lastSnapLen=t.carryLen):Bne(t.out,e,0,t.carryLen)}t.lastSnapSrc&&(t.out.len>0&&t.out.buf[t.out.len-1]!==_3e&&Bne(t.out,NFc,0,1),Bne(t.out,t.lastSnapSrc,0,t.lastSnapLen))}async function QFc(t,e){let r=kFc(),n=wFc,o={out:{buf:Buffer.allocUnsafe(Math.min(e,8388608)),len:0,cap:e+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},s=Buffer.allocUnsafe(n),c=await(0,sN.open)(t,"r");try{let l=0;for(;l0){let m=o.carryLen+(u-d);f=Buffer.allocUnsafe(m),o.carryBuf.copy(f,0,0,o.carryLen),s.copy(f,o.carryLen,d,u)}else f=s.subarray(d,u);let h=BFc(o,f,r);LFc(o,f,s,h.lastSnapStart,h.lastSnapEnd),FFc(o,f,h.trailStart),o.bufFileOff+=h.trailStart}UFc(o)}finally{await c.close()}return{boundaryStartOffset:o.boundaryStartOffset,postBoundaryBuf:o.out.buf.subarray(0,o.out.len),hasPreservedSegment:o.hasPreservedSegment}}async function qFc(t,e){try{return e>RFc&&!QE(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP)?(await QFc(t,e)).postBoundaryBuf:await(0,DWi.readFile)(t)}catch{return null}}function jFc(t){let e=[];try{let o=Gd(e,Vd`parseTranscriptEntries(${t.length} bytes)`,0),s=[],c=10,l=t.length,u=0;for(;u=d)continue;let h=t.toString("utf-8",f,d);try{let m=rFc(h),g=m.type;(g==="user"||g==="assistant"||g==="progress"||g==="system"||g==="attachment")&&typeof m.uuid=="string"&&s.push(m)}catch{}}return s}catch(o){var r=o,n=1}finally{$d(e,r,n)}}function HFc(t){let e=new Map;for(let m of t)e.set(m.uuid,m);for(let m of e.values()){if(m.type!=="system"||m.subtype!=="compact_boundary")continue;let g=m.compactMetadata?.preservedMessages,A=m.compactMetadata?.preservedSegment;if(g){if(g.uuids.length===0||g.uuids.some(v=>!e.has(v)))continue;let y=g.anchorUuid;for(let v of g.uuids){let b=e.get(v);e.set(v,{...b,parentUuid:y}),y=v}let E=g.uuids[0],_=g.uuids.at(-1);for(let[v,b]of e)b.parentUuid===g.anchorUuid&&v!==E&&e.set(v,{...b,parentUuid:_})}else if(A){let y=e.get(A.headUuid);y&&e.set(A.headUuid,{...y,parentUuid:A.anchorUuid});for(let[E,_]of e)_.parentUuid===A.anchorUuid&&E!==A.headUuid&&e.set(E,{..._,parentUuid:A.tailUuid})}}let r=new Map;for(let m=0;m!n.has(m.uuid)),s=[];for(let m of o){let g=m,A=new Set;for(;g&&!A.has(g.uuid);){if(A.add(g.uuid),g.type==="user"||g.type==="assistant"){s.push(g);break}g=g.parentUuid?e.get(g.parentUuid):void 0}}if(s.length===0)return[];let c=s.filter(m=>!m.isSidechain&&!m.teamName&&!m.isMeta),l=a(m=>m.reduce((g,A)=>(r.get(A.uuid)??-1)>(r.get(g.uuid)??-1)?A:g),"U"),u=c.length>0?l(c):l(s),d=[],f=new Set,h=e.get(u.uuid);for(;h&&!f.has(h.uuid);)f.add(h.uuid),d.push(h),h=h.parentUuid?e.get(h.parentUuid):void 0;return d.reverse(),$Fc(e,d,f)}function cBr(t){if(t.type!=="assistant")return;let e=t.message;if(typeof e!="object"||e===null)return;let r=e.id;return typeof r=="string"?r:void 0}function GFc(t){if(t.type!=="user"||!t.parentUuid)return!1;let e=t.message;if(typeof e!="object"||e===null)return!1;let r=e.content;return Array.isArray(r)?r.some(n=>typeof n=="object"&&n!==null&&n.type==="tool_result"):!1}function $Fc(t,e,r){let n=e.filter(h=>h.type==="assistant");if(n.length===0)return e;let o=new Map;for(let h of n){let m=cBr(h);m&&o.set(m,h)}let s=new Map,c=new Map;for(let h of t.values()){let m=cBr(h);if(m){let g=s.get(m);g?g.push(h):s.set(m,[h])}else if(GFc(h)){let g=h.parentUuid,A=c.get(g);A?A.push(h):c.set(g,[h])}}let l=new Set,u=new Map,d=0;for(let h of n){let m=cBr(h);if(!m||l.has(m))continue;l.add(m);let g=s.get(m)??[h],A=g.filter(b=>!r.has(b.uuid)),y=[];for(let b of g){let T=c.get(b.uuid);if(T)for(let w of T)r.has(w.uuid)||y.push(w)}if(A.length===0&&y.length===0)continue;let E=a((b,T)=>(b.timestamp??"").localeCompare(T.timestamp??""),"D");A.sort(E),y.sort(E);let _=o.get(m),v=[...A,...y];for(let b of v)r.add(b.uuid);d+=v.length,u.set(_.uuid,v)}if(d===0)return e;let f=[];for(let h of e){f.push(h);let m=u.get(h.uuid);m&&f.push(...m)}return f}function VFc(t,e){if(!(t.type==="user"||t.type==="assistant")){if(!(t.type==="system"&&e))return!1}return!(t.isMeta||t.isSidechain||t.teamName)}function jWi(t,e){return{type:t.type,uuid:t.uuid,session_id:t.sessionId,message:t.message,parent_tool_use_id:e??null,timestamp:t.timestamp}}function HWi(t,e){let r=e?.offset??0;return e?.limit!==void 0&&e.limit>0?t.slice(r,r+e.limit):r>0?t.slice(r):t}function WFc(t,e){let r=[];for(let n of t){if(typeof n!="object"||n===null)continue;let o=n,s=o.type;(s==="user"||s==="assistant"||s==="progress"||s==="system"||s==="attachment")&&typeof o.uuid=="string"&&r.push(o)}return GWi(r,e)}function GWi(t,e){let r=HFc(t),n=e?.includeSystemMessages??!1,o=r.filter(s=>VFc(s,n)).map(s=>jWi(s));return HWi(o,e)}async function zFc(t,e){if(!ph(t))return[];let r=await jTt(t,e?.dir);if(!r)return[];let n=await qFc(r.filePath,r.fileSize);return n?GWi(jFc(n),e):[]}function HTt(t,e,r){let{head:n,tail:o,mtime:s,size:c}=e,l=n.indexOf(` +`),u=l>=0?n.slice(0,l):n;if(u.includes('"isSidechain":true')||u.includes('"isSidechain": true'))return null;let d=QR(o,"customTitle")||QR(n,"customTitle")||QR(o,"aiTitle")||QR(n,"aiTitle")||void 0,f=UWi(n)||void 0,h=aBr(n,"timestamp"),m;if(h){let v=Date.parse(h);Number.isNaN(v)||(m=v)}let g=d||QR(o,"lastPrompt")||QR(o,"summary")||f;if(!g)return null;let A=QR(o,"gitBranch")||aBr(n,"gitBranch")||void 0,y=aBr(n,"cwd")||r||void 0,E=o.split(` +`).findLast(v=>v.includes('"type":"tag"')&&v.includes('"tag":"')),_=E&&QR(E,"tag")||void 0;return{sessionId:t,summary:g,lastModified:s,fileSize:c,customTitle:d,firstPrompt:f,gitBranch:A,cwd:y,tag:_,createdAt:m}}async function i3e(t,e,r){let n;try{n=await(0,a_e.readdir)(t)}catch{return[]}return(await Promise.all(n.map(async o=>{if(!o.endsWith(".jsonl"))return null;let s=ph(o.slice(0,-6));if(!s)return null;let c=(0,c_e.join)(t,o);if(!e)return{sessionId:s,filePath:c,mtime:0,projectPath:r};try{let l=await(0,a_e.stat)(c);return{sessionId:s,filePath:c,mtime:l.mtime.getTime(),projectPath:r}}catch{return null}}))).filter(o=>o!==null)}async function $Wi(t){let e=await QWi(t.filePath);if(!e)return null;let r=HTt(t.sessionId,e,t.projectPath);return r?(t.mtime&&(r.lastModified=t.mtime),r):null}function KFc(t,e){return e.mtime!==t.mtime?e.mtime-t.mtime:e.sessionIdt.sessionId?1:0}async function JFc(t,e,r){t.sort(KFc);let n=[],o=e&&e>0?e:1/0,s=0,c=new Set;for(let l=0;ls.lastModified)&&r.set(o.sessionId,o)}let n=[...r.values()];return n.sort((o,s)=>s.lastModified!==o.lastModified?s.lastModified-o.lastModified:s.sessionIdo.sessionId?1:0),n}async function XFc(t,e,r){let n=await W3e(t),o;if(e)try{o=await $3e(n)}catch{o=[]}else o=[];if(o.length<=1){let h=[];for(let m of await iN(n))h.push(...await i3e(m,r,n));return h}let s=_V(),c=process.platform==="win32",l=o.map(h=>{let m=V3e(h);return{path:h,prefix:c?m.toLowerCase():m}});l.sort((h,m)=>m.prefix.length-h.prefix.length);let u;try{u=await(0,a_e.readdir)(s,{withFileTypes:!0})}catch{let h=[];for(let m of await iN(n))h.push(...await i3e(m,r,n));return h}let d=[],f=new Set;for(let h of await iN(n)){let m=(0,c_e.basename)(h);f.add(c?m.toLowerCase():m),d.push(...await i3e(h,r,n))}for(let h of u){if(!h.isDirectory())continue;let m=c?h.name.toLowerCase():h.name;if(!f.has(m)){for(let{path:g,prefix:A}of l)if(m===A||A.length>=E3e&&m.startsWith(A+"-")){f.add(m),d.push(...await i3e((0,c_e.join)(s,h.name),r,g));break}}}return d}async function e8c(t){let e=_V(),r;try{r=await(0,a_e.readdir)(e,{withFileTypes:!0})}catch{return[]}return(await Promise.all(r.filter(n=>n.isDirectory()).map(n=>i3e((0,c_e.join)(e,n.name),t)))).flat()}async function t8c(t){let{dir:e,limit:r,offset:n,includeWorktrees:o}=t??{},s=n??0,c=r!==void 0&&r>0||s>0,l=e?await XFc(e,o??!0,c):await e8c(c);return c?JFc(l,r,s):ZFc(l)}async function r8c(t,e={}){let r=ph(t);if(!r)return;let n=await jTt(r,e.dir);if(!n)return;let o=await QWi(n.filePath);if(o)return HTt(r,o,n.projectPath)??void 0}async function n8c(t,e,r={}){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);if(!e.trim())throw Error("title must be non-empty");let n=x0({type:"custom-title",customTitle:e.trim(),sessionId:t})+` +`;await VWi(t,n,r)}async function i8c(t,e,r={}){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);if(e!==null){let o=u3e(e).trim();if(!o)throw Error("tag must be non-empty (use null to clear)");e=o}let n=x0({type:"tag",tag:e??"",sessionId:t})+` +`;await VWi(t,n,r)}async function o8c(t,e={}){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);for(let r of await s8c(e)){let n=(0,Lne.join)(r,`${t}.jsonl`),o;try{({size:o}=await(0,nB.stat)(n))}catch(s){let c=lI(s);if(c==="ENOENT"||c==="ENOTDIR")continue;throw s}if(o!==0){await(0,nB.rm)(n,{force:!0}),await(0,nB.rm)((0,Lne.join)(r,t),{recursive:!0,force:!0});return}}throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found in any project directory`)}async function s8c(t){if(t.dir){let r=await W3e(t.dir),n=await iN(r),o;try{o=await $3e(r)}catch{o=[]}for(let s of o)s!==r&&n.push(...await iN(s));return n}let e=_V();try{return(await(0,nB.readdir)(e,{withFileTypes:!0})).filter(r=>r.isDirectory()||r.isSymbolicLink()).map(r=>(0,Lne.join)(e,r.name))}catch{return[]}}async function VWi(t,e,r){let n=`${t}.jsonl`;if(r.dir){let c=await W3e(r.dir);for(let u of await iN(c))if(await lBr((0,Lne.join)(u,n),e))return;let l;try{l=await $3e(c)}catch{l=[]}for(let u of l)if(u!==c){for(let d of await iN(u))if(await lBr((0,Lne.join)(d,n),e))return}throw Error(`Session ${t} not found in project directory for ${r.dir}`)}let o=_V(),s;try{s=await(0,nB.readdir)(o)}catch{throw Error(`Session ${t} not found (no projects directory)`)}for(let c of s)if(await lBr((0,Lne.join)(o,c,n),e))return;throw Error(`Session ${t} not found in any project directory`)}async function lBr(t,e){let r;try{r=await(0,nB.open)(t,eLr.constants.O_WRONLY|eLr.constants.O_APPEND)}catch(n){let o=lI(n);if(o==="ENOENT"||o==="ENOTDIR")return!1;throw n}try{let{size:n}=await r.stat();if(n===0)return!1;let o=process.platform==="win32"?n:void 0;return await r.write(e,o,"utf8"),!0}finally{await r.close()}}async function a8c(t,e){let r=`${t}.jsonl`;async function n(c){try{let l=await USt().readBytes((0,WSt.join)(c,r));return l.length===0?null:{buf:l,projectDir:c}}catch{return null}}if(a(n,"Y"),e){let c=await W3e(e);for(let u of await iN(c)){let d=await n(u);if(d)return d}let l;try{l=await $3e(c)}catch{l=[]}for(let u of l)if(u!==c)for(let d of await iN(u)){let f=await n(d);if(f)return f}return null}let o=_V(),s;try{s=await USt().list(o)}catch{return null}for(let c of s){let l=await n((0,WSt.join)(o,c));if(l)return l}return null}function l8c(t,e){let r=[],n=[],o=10,s=t.length,c=0;for(;c=l)continue;let d=t.toString("utf-8",u,l);try{WWi(dN(d),e,r,n)}catch{}}return{transcript:r,contentReplacements:n}}function u8c(t,e){let r=[],n=[];for(let o of t)typeof o!="object"||o===null||WWi(o,e,r,n);return{transcript:r,contentReplacements:n}}function WWi(t,e,r,n){c8c.has(t.type)&&typeof t.uuid=="string"?r.push(t):t.type==="content-replacement"&&t.sessionId===e&&Array.isArray(t.replacements)&&n.push(...t.replacements)}async function d8c(t,e={}){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);if(e.upToMessageId&&!ph(e.upToMessageId))throw Error(`Invalid upToMessageId: ${e.upToMessageId}`);let r=await a8c(t,e.dir);if(!r)throw Error(e.dir?`Session ${t} not found in project directory for ${e.dir}`:`Session ${t} not found`);let{entries:n,forkedSessionId:o}=f8c(r.buf,t,e);return await XBr((0,WSt.join)(r.projectDir,`${o}.jsonl`),n),{sessionId:o}}function f8c(t,e,r){let n=l8c(t,e);return zWi(n,e,r,()=>{let o=t.length,s=t.toString("utf-8",0,Math.min(o,r9)),c=t.toString("utf-8",Math.max(0,o-r9));return QR(c,"customTitle")||QR(s,"customTitle")||QR(c,"aiTitle")||QR(s,"aiTitle")||UWi(s)})}function p8c(t,e,r){let n=u8c(t,e);return zWi(n,e,r,()=>h8c(t))}function h8c(t){let e,r;for(let n of t){if(typeof n!="object"||n===null)continue;let o=n;typeof o.customTitle=="string"&&o.customTitle&&(e=o.customTitle),typeof o.aiTitle=="string"&&o.aiTitle&&(r=o.aiTitle)}return e||r||TFc(t)||void 0}function zWi(t,e,r,n){let o=t.transcript.filter(m=>!m.isSidechain);if(o.length===0)throw Error(`Session ${e} has no messages to fork`);if(r.upToMessageId){let m=o.findIndex(g=>g.uuid===r.upToMessageId);if(m===-1)throw Error(`Message ${r.upToMessageId} not found in session ${e}`);o=o.slice(0,m+1)}let s=new Map;for(let m of o)s.set(m.uuid,(0,o3e.randomUUID)());let c=o.filter(m=>m.type!=="progress");if(c.length===0)throw Error(`Session ${e} has no messages to fork`);let l=new Map;for(let m of o)l.set(m.uuid,m);let u=(0,o3e.randomUUID)(),d=new Date().toISOString(),f=[];for(let m=0;m0&&f.push({type:"content-replacement",sessionId:u,replacements:t.contentReplacements,uuid:(0,o3e.randomUUID)(),timestamp:d});let h=r.title?.trim();return h||(h=`${n()||"Forked session"} (fork)`),f.push({type:"custom-title",sessionId:u,customTitle:h,uuid:(0,o3e.randomUUID)(),timestamp:d}),{entries:f,forkedSessionId:u}}async function YWi(t,e){let r=await jTt(t,e);if(!r)return null;let n=r.filePath.replace(/\.jsonl$/,"");return(0,zSt.join)(n,"subagents")}async function KWi(t){let e=[];async function r(n){let o;try{o=await(0,v3e.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o)if(s.isFile()&&s.name.startsWith("agent-")&&s.name.endsWith(".jsonl")){let c=s.name.slice(6,-6);e.push({agentId:c,filePath:(0,zSt.join)(n,s.name)})}else s.isDirectory()&&await r((0,zSt.join)(n,s.name))}return a(r,"J"),await r(t),e}function m8c(t){let e=[],r=10,n=t.length,o=0;for(;o=s)continue;let l=t.toString("utf-8",c,s);try{let u=dN(l),d=u.type;(d==="user"||d==="assistant")&&typeof u.uuid=="string"&&e.push(u)}catch{}}return e}function g8c(t){if(t.length===0)return[];let e=new Map;for(let c of t)e.set(c.uuid,c);let r=t.findLast(c=>c.type==="user"||c.type==="assistant");if(!r)return[];let n=[],o=new Set,s=r;for(;s&&!o.has(s.uuid);)o.add(s.uuid),n.push(s),s=s.parentUuid?e.get(s.parentUuid):void 0;return n.reverse(),n}async function A8c(t,e){if(!ph(t))return[];let r=await YWi(t,e?.dir);return r?(await KWi(r)).map(n=>n.agentId):[]}async function y8c(t,e,r){if(!ph(t))return[];if(!e)return[];let n=await YWi(t,r?.dir);if(!n)return[];let o=(await KWi(n)).find(l=>l.agentId===e);if(!o)return[];let s;try{s=await(0,v3e.readFile)(o.filePath)}catch{return[]}let c;try{let l=o.filePath.replace(/\.jsonl$/,".meta.json");c=dN(await(0,v3e.readFile)(l,"utf-8")).toolUseId}catch{}return JWi(s,r,c)}function JWi(t,e,r){if(t.length===0)return[];let n=m8c(t),o=g8c(n).filter(s=>s.type==="user"||s.type==="assistant").map(s=>jWi(s,r));return HWi(o,e)}function ezi(t,e){let r=0;for(let n of t)r+=+!!e(n);return r}function tzi(t){return[...new Set(t)]}function E8c(){return"prod"}function T8c(){let t=process.env.CLAUDE_LOCAL_OAUTH_API_BASE?.replace(/\/$/,"")??"http://localhost:8000",e=process.env.CLAUDE_LOCAL_OAUTH_APPS_BASE?.replace(/\/$/,"")??"http://localhost:4000",r=process.env.CLAUDE_LOCAL_OAUTH_CONSOLE_BASE?.replace(/\/$/,"")??"http://localhost:3000";return{BASE_API_URL:t,CONSOLE_AUTHORIZE_URL:`${r}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${e}/oauth/authorize`,CLAUDE_AI_ORIGIN:e,TOKEN_URL:`${t}/v1/oauth/token`,API_KEY_URL:`${t}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${t}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${r}/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code`,CLAUDEAI_SUCCESS_URL:`${r}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${r}/oauth/code/callback`,CLIENT_ID:"22422756-60c9-4084-8eb7-27705fd5cf9a",OAUTH_FILE_SUFFIX:"-local-oauth",MCP_PROXY_URL:"http://localhost:8205",MCP_PROXY_PATH:"/v1/toolbox/shttp/mcp/{server_id}"}}function x8c(){let t=(()=>{switch(E8c()){case"local":return T8c();case"staging":return S8c??BGi;case"prod":return BGi}})(),e=process.env.CLAUDE_CODE_CUSTOM_OAUTH_URL;if(e){let n=e.replace(/\/$/,"");if(!I8c.includes(n))throw Error("CLAUDE_CODE_CUSTOM_OAUTH_URL is not an approved endpoint.");t={...t,BASE_API_URL:n,CONSOLE_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_AUTHORIZE_URL:`${n}/oauth/authorize`,CLAUDE_AI_ORIGIN:n,TOKEN_URL:`${n}/v1/oauth/token`,API_KEY_URL:`${n}/api/oauth/claude_cli/create_api_key`,ROLES_URL:`${n}/api/oauth/claude_cli/roles`,CONSOLE_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,CLAUDEAI_SUCCESS_URL:`${n}/oauth/code/success?app=claude-code`,MANUAL_REDIRECT_URL:`${n}/oauth/code/callback`,OAUTH_FILE_SUFFIX:"-custom-oauth"}}let r=process.env.CLAUDE_CODE_OAUTH_CLIENT_ID;return r&&(t={...t,CLIENT_ID:r}),t}function R8c(t=""){let e=process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR,r=e!==void 0?!e:!process.env.CLAUDE_CONFIG_DIR,n=e!==void 0?e.normalize("NFC"):i_e(),o=r?"":`-${(0,ZWi.createHash)("sha256").update(n).digest("hex").substring(0,8)}`;return`Claude Code${x8c().OAUTH_FILE_SUFFIX}${t}${o}`}function k8c(){if(process.platform==="win32")return"claude-code-user";let t;try{t=process.env.USER||(0,XWi.userInfo)().username}catch{t="claude-code-user"}return P8c.test(t)?t:"claude-code-user"}function tLr(){return N8c}function cn(t,e){let r=tLr(),n=rLr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===C3e?void 0:C3e].filter(o=>!!o)});t.common.issues.push(n)}function Vo(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:a((s,c)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??c.defaultError}:typeof c.data>"u"?{message:l??n??c.defaultError}:s.code!=="invalid_type"?{message:c.defaultError}:{message:l??r??c.defaultError}},"errorMap"),description:o}}function izi(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function K8c(t){return new RegExp(`^${izi(t)}$`)}function J8c(t){let e=`${nzi}T${izi(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Z8c(t,e){return!!((e==="v4"||!e)&&H8c.test(t)||(e==="v6"||!e)&&$8c.test(t))}function X8c(t,e){if(!U8c.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function e6c(t,e){return!!((e==="v4"||!e)&&G8c.test(t)||(e==="v6"||!e)&&V8c.test(t))}function t6c(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function vEe(t){if(t instanceof dI){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=$R.create(vEe(n))}return new dI({...t._def,shape:a(()=>e,"shape")})}else return t instanceof AV?new AV({...t._def,type:vEe(t.element)}):t instanceof $R?$R.create(vEe(t.unwrap())):t instanceof a9?a9.create(vEe(t.unwrap())):t instanceof s9?s9.create(t.items.map(e=>vEe(e))):t}function iLr(t,e){let r=aV(t),n=aV(e);if(t===e)return{valid:!0,data:t};if(r===wn.object&&n===wn.object){let o=lc.objectKeys(e),s=lc.objectKeys(t).filter(l=>o.indexOf(l)!==-1),c={...t,...e};for(let l of s){let u=iLr(t[l],e[l]);if(!u.valid)return{valid:!1};c[l]=u.data}return{valid:!0,data:c}}else if(r===wn.array&&n===wn.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;sr?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}function Lv(t){return t&&Object.assign(ZSt,t),ZSt}function n6c(t){return t}function i6c(t){return t}function o6c(t){}function s6c(t){throw Error()}function a6c(t){}function E3r(t){let e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function $r(t,e="|"){return t.map(r=>is(r)).join(e)}function lzi(t,e){return typeof e=="bigint"?e.toString():e}function GTt(t){return{get value(){{let e=t();return Object.defineProperty(this,"value",{value:e}),e}throw Error("cached value already set")}}}function zne(t){return t==null}function $Tt(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function uzi(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}function Hc(t,e,r){Object.defineProperty(t,e,{get(){{let n=r();return t[e]=n,n}throw Error("cached value already set")},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function _3r(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function c6c(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function l6c(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;se,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}function p6c(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function is(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function pzi(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function h6c(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return fN(t,{...t._zod.def,shape:r,checks:[]})}function m6c(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return fN(t,{...t._zod.def,shape:r,checks:[]})}function g6c(t,e){if(!M3e(e))throw Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return _3r(this,"shape",n),n},checks:[]};return fN(t,r)}function A6c(t,e){return fN(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return _3r(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function y6c(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return fN(e,{...e._zod.def,shape:o,checks:[]})}function E6c(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return fN(e,{...e._zod.def,shape:o,checks:[]})}function xEe(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function a3e(t){return typeof t=="string"?t:t?.message}function cN(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=a3e(t.inst?._zod.def?.error?.(t))??a3e(e?.error?.(t))??a3e(r.customError?.(t))??a3e(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,!e?.reportInput&&delete n.input,n}function VTt(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function WTt(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function gzi(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function _6c(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function b3r(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function S3r(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Ezi(n.path)}`);return e.join(` +`)}function Pzi(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}function Qzi(t){return typeof t.precision=="number"?t.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":t.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${t.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function qzi(t){return new RegExp(`^${Qzi(t)}$`)}function jzi(t){let e=Qzi({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Fzi}T(?:${n})$`)}function qGi(t,e,r){t.issues.length&&e.issues.push(...HR(r,t.issues))}function N3r(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function FYi(t){if(!P3r.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return N3r(r)}function qYi(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function jGi(t,e,r){t.issues.length&&e.issues.push(...HR(r,t.issues)),e.value[r]=t.value}function Z1t(t,e,r){t.issues.length&&e.issues.push(...HR(r,t.issues)),e.value[r]=t.value}function HGi(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...HR(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function GGi(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>cN(s,n,Lv())))}),e}function cLr(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(M3e(t)&&M3e(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=cLr(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;ncN(l,c,Lv()))})),e.issues.length&&(XSt.has(typeof n)?r.issues.push(...HR(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>cN(l,c,Lv()))})),r.value.set(t.value,e.value)}function WGi(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function zGi(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function YGi(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function KGi(t,e,r){return xEe(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function JGi(t){return t.value=Object.freeze(t.value),t}function ZGi(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(gzi(o))}}function D6c(){return{localeError:k6c()}}function M6c(){return{localeError:N6c()}}function XGi(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function B6c(){return{localeError:O6c()}}function F6c(){return{localeError:L6c()}}function Q6c(){return{localeError:U6c()}}function j6c(){return{localeError:q6c()}}function _Ki(){return{localeError:G6c()}}function W6c(){return{localeError:V6c()}}function Y6c(){return{localeError:z6c()}}function J6c(){return{localeError:K6c()}}function X6c(){return{localeError:Z6c()}}function t9c(){return{localeError:e9c()}}function n9c(){return{localeError:r9c()}}function o9c(){return{localeError:i9c()}}function a9c(){return{localeError:s9c()}}function l9c(){return{localeError:c9c()}}function d9c(){return{localeError:u9c()}}function p9c(){return{localeError:f9c()}}function m9c(){return{localeError:h9c()}}function A9c(){return{localeError:g9c()}}function E9c(){return{localeError:y9c()}}function v9c(){return{localeError:_9c()}}function b9c(){return{localeError:C9c()}}function T9c(){return{localeError:S9c()}}function x9c(){return{localeError:I9c()}}function R9c(){return{localeError:w9c()}}function k9c(){return{localeError:P9c()}}function N9c(){return{localeError:D9c()}}function e$i(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}function O9c(){return{localeError:M9c()}}function L9c(){return{localeError:B9c()}}function U9c(){return{localeError:F9c()}}function q9c(){return{localeError:Q9c()}}function H9c(){return{localeError:j9c()}}function V9c(){return{localeError:$9c()}}function z9c(){return{localeError:W9c()}}function K9c(){return{localeError:Y9c()}}function Z9c(){return{localeError:J9c()}}function eUc(){return{localeError:X9c()}}function rUc(){return{localeError:tUc()}}function H3r(){return new O3e}function bKi(t,e){return new t({type:"string",...Ir(e)})}function SKi(t,e){return new t({type:"string",coerce:!0,...Ir(e)})}function G3r(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ir(e)})}function iTt(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ir(e)})}function $3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ir(e)})}function V3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ir(e)})}function W3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ir(e)})}function z3r(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ir(e)})}function Y3r(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ir(e)})}function K3r(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ir(e)})}function J3r(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ir(e)})}function Z3r(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ir(e)})}function X3r(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ir(e)})}function eFr(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ir(e)})}function tFr(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ir(e)})}function rFr(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ir(e)})}function nFr(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ir(e)})}function iFr(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ir(e)})}function oFr(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ir(e)})}function sFr(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ir(e)})}function aFr(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ir(e)})}function cFr(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ir(e)})}function lFr(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ir(e)})}function uFr(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ir(e)})}function IKi(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ir(e)})}function xKi(t,e){return new t({type:"string",format:"date",check:"string_format",...Ir(e)})}function wKi(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ir(e)})}function RKi(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ir(e)})}function PKi(t,e){return new t({type:"number",checks:[],...Ir(e)})}function kKi(t,e){return new t({type:"number",coerce:!0,checks:[],...Ir(e)})}function DKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ir(e)})}function NKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Ir(e)})}function MKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Ir(e)})}function OKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Ir(e)})}function BKi(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Ir(e)})}function LKi(t,e){return new t({type:"boolean",...Ir(e)})}function FKi(t,e){return new t({type:"boolean",coerce:!0,...Ir(e)})}function UKi(t,e){return new t({type:"bigint",...Ir(e)})}function QKi(t,e){return new t({type:"bigint",coerce:!0,...Ir(e)})}function qKi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ir(e)})}function jKi(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ir(e)})}function HKi(t,e){return new t({type:"symbol",...Ir(e)})}function GKi(t,e){return new t({type:"undefined",...Ir(e)})}function $Ki(t,e){return new t({type:"null",...Ir(e)})}function VKi(t){return new t({type:"any"})}function oTt(t){return new t({type:"unknown"})}function WKi(t,e){return new t({type:"never",...Ir(e)})}function zKi(t,e){return new t({type:"void",...Ir(e)})}function YKi(t,e){return new t({type:"date",...Ir(e)})}function KKi(t,e){return new t({type:"date",coerce:!0,...Ir(e)})}function JKi(t,e){return new t({type:"nan",...Ir(e)})}function Gne(t,e){return new k3r({check:"less_than",...Ir(e),value:t,inclusive:!1})}function oN(t,e){return new k3r({check:"less_than",...Ir(e),value:t,inclusive:!0})}function $ne(t,e){return new D3r({check:"greater_than",...Ir(e),value:t,inclusive:!1})}function aI(t,e){return new D3r({check:"greater_than",...Ir(e),value:t,inclusive:!0})}function ZKi(t){return $ne(0,t)}function XKi(t){return Gne(0,t)}function eJi(t){return oN(0,t)}function tJi(t){return aI(0,t)}function B3e(t,e){return new Xzi({check:"multiple_of",...Ir(e),value:t})}function JTt(t,e){return new rYi({check:"max_size",...Ir(e),maximum:t})}function L3e(t,e){return new nYi({check:"min_size",...Ir(e),minimum:t})}function dFr(t,e){return new iYi({check:"size_equals",...Ir(e),size:t})}function ZTt(t,e){return new oYi({check:"max_length",...Ir(e),maximum:t})}function KEe(t,e){return new sYi({check:"min_length",...Ir(e),minimum:t})}function XTt(t,e){return new aYi({check:"length_equals",...Ir(e),length:t})}function fFr(t,e){return new cYi({check:"string_format",format:"regex",...Ir(e),pattern:t})}function pFr(t){return new lYi({check:"string_format",format:"lowercase",...Ir(t)})}function hFr(t){return new uYi({check:"string_format",format:"uppercase",...Ir(t)})}function mFr(t,e){return new dYi({check:"string_format",format:"includes",...Ir(e),includes:t})}function gFr(t,e){return new fYi({check:"string_format",format:"starts_with",...Ir(e),prefix:t})}function AFr(t,e){return new pYi({check:"string_format",format:"ends_with",...Ir(e),suffix:t})}function rJi(t,e,r){return new hYi({check:"property",property:t,schema:e,...Ir(r)})}function yFr(t,e){return new mYi({check:"mime_type",mime:t,...Ir(e)})}function Kne(t){return new gYi({check:"overwrite",tx:t})}function EFr(t){return Kne(e=>e.normalize(t))}function _Fr(){return Kne(t=>t.trim())}function vFr(){return Kne(t=>t.toLowerCase())}function CFr(){return Kne(t=>t.toUpperCase())}function bFr(t,e,r){return new t({type:"array",element:e,...Ir(r)})}function nUc(t,e,r){return new t({type:"union",options:e,...Ir(r)})}function iUc(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Ir(n)})}function oUc(t,e,r){return new t({type:"intersection",left:e,right:r})}function nJi(t,e,r,n){let o=r instanceof Co;return new t({type:"tuple",items:e,rest:o?r:null,...Ir(o?n:r)})}function sUc(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Ir(n)})}function aUc(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Ir(n)})}function cUc(t,e,r){return new t({type:"set",valueType:e,...Ir(r)})}function lUc(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Ir(r)})}function uUc(t,e,r){return new t({type:"enum",entries:e,...Ir(r)})}function dUc(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Ir(r)})}function iJi(t,e){return new t({type:"file",...Ir(e)})}function fUc(t,e){return new t({type:"transform",transform:e})}function pUc(t,e){return new t({type:"optional",innerType:e})}function hUc(t,e){return new t({type:"nullable",innerType:e})}function mUc(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function gUc(t,e,r){return new t({type:"nonoptional",innerType:e,...Ir(r)})}function AUc(t,e){return new t({type:"success",innerType:e})}function yUc(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function EUc(t,e,r){return new t({type:"pipe",in:e,out:r})}function _Uc(t,e){return new t({type:"readonly",innerType:e})}function vUc(t,e,r){return new t({type:"template_literal",parts:e,...Ir(r)})}function CUc(t,e){return new t({type:"lazy",getter:e})}function bUc(t,e){return new t({type:"promise",innerType:e})}function oJi(t,e,r){let n=Ir(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function sJi(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Ir(r)})}function aJi(t,e){let r=Ir(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let s=new Set(n),c=new Set(o),l=t.Pipe??q3r,u=t.Boolean??O3r,d=t.String??K3e,f=new(t.Transform??Q3r)({type:"transform",transform:a((m,g)=>{let A=m;return r.case!=="sensitive"&&(A=A.toLowerCase()),s.has(A)?!0:c.has(A)?!1:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:g.value,inst:f}),{})},"transform"),error:r.error}),h=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:f,error:r.error});return new l({type:"pipe",in:h,out:new u({type:"boolean",error:r.error}),error:r.error})}function cJi(t,e,r,n={}){let o=Ir(n),s={...Ir(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}function lJi(t){return new sTt({type:"function",input:Array.isArray(t?.input)?nJi(KTt,t?.input):t?.input??bFr(L3r,oTt(nTt)),output:t?.output??oTt(nTt)})}function SFr(t,e){if(t instanceof O3e){let n=new F3e(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri||(l=>l),defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new F3e(e);return r.process(t),r.emit(t,e)}function Im(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Im(n.element,r);case"object":{for(let o in n.shape)if(Im(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Im(o,r))return!0;return!1}case"intersection":return Im(n.left,r)||Im(n.right,r);case"tuple":{for(let o of n.items)if(Im(o,r))return!0;return!!(n.rest&&Im(n.rest,r))}case"record":return Im(n.keyType,r)||Im(n.valueType,r);case"map":return Im(n.keyType,r)||Im(n.valueType,r);case"set":return Im(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Im(n.innerType,r);case"lazy":return Im(n.getter(),r);case"default":return Im(n.innerType,r);case"prefault":return Im(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Im(n.in,r)||Im(n.out,r);case"success":return!1;case"catch":return!1;default:}throw Error(`Unknown schema type: ${n.type}`)}function t$i(t,e){let r={type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},...Qs.normalizeParams(e)};return new IUc(r)}function oB(t){return!!t._zod}function bEe(t){let e=Object.values(t);if(e.length===0)return t$i({});let r=e.every(oB),n=e.every(o=>!oB(o));if(r)return t$i(t);if(n)return r6c(t);throw Error("Mixed Zod versions detected in object shape.")}function d3e(t,e){return oB(t)?zTt(t,e):t.safeParse(e)}async function dBr(t,e){return oB(t)?await YTt(t,e):await t.safeParseAsync(e)}function J3e(t){if(!t)return;let e;if(oB(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function YLe(t){if(t){if(typeof t=="object"){let e=t,r=t;if(!e._def&&!r._zod){let n=Object.values(t);if(n.length>0&&n.every(o=>typeof o=="object"&&o!==null&&(o._def!==void 0||o._zod!==void 0||typeof o.parse=="function")))return bEe(t)}}if(oB(t)){let e=t._zod?.def;if(e&&(e.type==="object"||e.shape!==void 0))return t}else if(t.shape!==void 0)return t}}function fBr(t){if(t&&typeof t=="object"){if("message"in t&&typeof t.message=="string")return t.message;if("issues"in t&&Array.isArray(t.issues)&&t.issues.length>0){let e=t.issues[0];if(e&&typeof e=="object"&&"message"in e)return String(e.message)}try{return JSON.stringify(t)}catch{return String(t)}}return String(t)}function xUc(t){return t.description}function wUc(t){if(oB(t))return t._zod?.def?.type==="optional";let e=t;return typeof t.isOptional=="function"?t.isOptional():e._def?.typeName==="ZodOptional"}function uJi(t){if(oB(t)){let n=t._zod?.def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}}let e=t._def;if(e){if(e.value!==void 0)return e.value;if(Array.isArray(e.values)&&e.values.length>0)return e.values[0]}let r=t.value;if(r!==void 0)return r}function dJi(t){return IKi(IFr,t)}function fJi(t){return xKi(xFr,t)}function pJi(t){return wKi(wFr,t)}function hJi(t){return RKi(RFr,t)}function It(t){return bKi(eIt,t)}function PUc(t){return G3r(kFr,t)}function kUc(t){return iTt(aTt,t)}function DUc(t){return $3r(i9,t)}function NUc(t){return V3r(i9,t)}function MUc(t){return W3r(i9,t)}function OUc(t){return z3r(i9,t)}function BUc(t){return Y3r(DFr,t)}function LUc(t){return K3r(NFr,t)}function FUc(t){return J3r(MFr,t)}function UUc(t){return Z3r(OFr,t)}function QUc(t){return X3r(BFr,t)}function qUc(t){return eFr(LFr,t)}function jUc(t){return tFr(FFr,t)}function HUc(t){return rFr(UFr,t)}function GUc(t){return nFr(QFr,t)}function $Uc(t){return iFr(qFr,t)}function VUc(t){return oFr(jFr,t)}function WUc(t){return sFr(HFr,t)}function zUc(t){return aFr(GFr,t)}function YUc(t){return cFr($Fr,t)}function KUc(t){return lFr(VFr,t)}function JUc(t){return uFr(WFr,t)}function ZUc(t,e,r={}){return cJi(_Ji,t,e,r)}function Pc(t){return PKi(tIt,t)}function lLr(t){return DKi(l_e,t)}function XUc(t){return NKi(l_e,t)}function e7c(t){return MKi(l_e,t)}function t7c(t){return OKi(l_e,t)}function r7c(t){return BKi(l_e,t)}function xm(t){return LKi(rIt,t)}function n7c(t){return UKi(nIt,t)}function i7c(t){return qKi(zFr,t)}function o7c(t){return jKi(zFr,t)}function s7c(t){return HKi(vJi,t)}function a7c(t){return GKi(CJi,t)}function YFr(t){return $Ki(bJi,t)}function c7c(){return VKi(SJi)}function zd(){return oTt(TJi)}function iIt(t){return WKi(IJi,t)}function l7c(t){return zKi(xJi,t)}function u7c(t){return YKi(KFr,t)}function Aa(t,e){return bFr(wJi,t,e)}function d7c(t){let e=t._zod.def.shape;return Xn(Object.keys(e))}function vn(t,e){let r={type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},...Qs.normalizeParams(e)};return new oIt(r)}function f7c(t,e){return new oIt({type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},catchall:iIt(),...Qs.normalizeParams(e)})}function Mv(t,e){return new oIt({type:"object",get shape(){return Qs.assignProp(this,"shape",{...t}),this.shape},catchall:zd(),...Qs.normalizeParams(e)})}function Kl(t,e){return new JFr({type:"union",options:t,...Qs.normalizeParams(e)})}function ZFr(t,e,r){return new RJi({type:"union",options:e,discriminator:t,...Qs.normalizeParams(r)})}function sIt(t,e){return new PJi({type:"intersection",left:t,right:e})}function p7c(t,e,r){let n=e instanceof Co,o=n?r:e;return new kJi({type:"tuple",items:t,rest:n?e:null,...Qs.normalizeParams(o)})}function Yl(t,e,r){return new XFr({type:"record",keyType:t,valueType:e,...Qs.normalizeParams(r)})}function h7c(t,e,r){return new XFr({type:"record",keyType:Kl([t,iIt()]),valueType:e,...Qs.normalizeParams(r)})}function m7c(t,e,r){return new DJi({type:"map",keyType:t,valueType:e,...Qs.normalizeParams(r)})}function g7c(t,e){return new NJi({type:"set",valueType:t,...Qs.normalizeParams(e)})}function p1(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new U3e({type:"enum",entries:r,...Qs.normalizeParams(e)})}function A7c(t,e){return new U3e({type:"enum",entries:t,...Qs.normalizeParams(e)})}function Xn(t,e){return new MJi({type:"literal",values:Array.isArray(t)?t:[t],...Qs.normalizeParams(e)})}function y7c(t){return iJi(OJi,t)}function t8r(t){return new e8r({type:"transform",transform:t})}function gd(t){return new r8r({type:"optional",innerType:t})}function cTt(t){return new BJi({type:"nullable",innerType:t})}function E7c(t){return gd(cTt(t))}function FJi(t,e){return new LJi({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function QJi(t,e){return new UJi({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function qJi(t,e){return new n8r({type:"nonoptional",innerType:t,...Qs.normalizeParams(e)})}function _7c(t){return new jJi({type:"success",innerType:t})}function GJi(t,e){return new HJi({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function v7c(t){return JKi($Ji,t)}function lTt(t,e){return new i8r({type:"pipe",in:t,out:e})}function WJi(t){return new VJi({type:"readonly",innerType:t})}function C7c(t,e){return new zJi({type:"template_literal",parts:t,...Qs.normalizeParams(e)})}function KJi(t){return new YJi({type:"lazy",getter:t})}function b7c(t){return new JJi({type:"promise",innerType:t})}function ZJi(t,e){let r=new hh({check:"custom",...Qs.normalizeParams(e)});return r._zod.check=t,r}function XJi(t,e){return oJi(aIt,t??(()=>!0),e)}function eZi(t,e={}){return sJi(aIt,t,e)}function tZi(t,e){let r=ZJi(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Qs.issue(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Qs.issue(s))}},t(n.value,n)),e);return r}function S7c(t,e={error:`Input not instance of ${t.name}`}){let r=new aIt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...Qs.normalizeParams(e)});return r._zod.bag.Class=t,r}function I7c(t){let e=KJi(()=>Kl([It(t),Pc(),xm(),YFr(),Aa(e),Yl(It(),e)]));return e}function o8r(t,e){return lTt(t8r(t),e)}function w7c(t){Lv({customError:t})}function R7c(){return Lv().customError}function P7c(t){return SKi(eIt,t)}function k7c(t){return kKi(tIt,t)}function D7c(t){return FKi(rIt,t)}function N7c(t){return QKi(nIt,t)}function M7c(t){return KKi(KFr,t)}function lqc(t){if(t.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function uqc(t){if(t.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}function Pne(t){return t==="completed"||t==="failed"||t==="cancelled"}function _Zi(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function ul(t,e,r,n,o){t[e]=r,_Zi(t,e,n,o)}function f1(t){if(t.target!=="openAi")return{};let e=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy==="relative"?vZi(e,t.currentPath):e.join("/")}}function yqc(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Cr.ZodAny&&(r.items=Rc(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&ul(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&ul(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(ul(r,"minItems",t.exactLength.value,t.exactLength.message,e),ul(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Eqc(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?ul(r,"minimum",n.value,n.message,e):ul(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),ul(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?ul(r,"maximum",n.value,n.message,e):ul(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),ul(r,"maximum",n.value,n.message,e));break;case"multipleOf":ul(r,"multipleOf",n.value,n.message,e);break}return r}function _qc(){return{type:"boolean"}}function CZi(t,e){return Rc(t.type._def,e)}function bZi(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>bZi(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Cqc(t,e)}}function bqc(t,e){return{...Rc(t.innerType._def,e),default:t.defaultValue()}}function Sqc(t,e){return e.effectStrategy==="input"?Rc(t.schema._def,e):f1(e)}function Tqc(t){return{type:"string",enum:Array.from(t.values)}}function xqc(t,e){let r=[Rc(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Rc(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(s=>{if(Iqc(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let c=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;c=u}else n=void 0;o.push(c)}}),o.length?{allOf:o,...n}:void 0}function wqc(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}function SZi(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":ul(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":ul(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":nN(r,"email",n.message,e);break;case"format:idn-email":nN(r,"idn-email",n.message,e);break;case"pattern:zod":Nv(r,rN.email,n.message,e);break}break;case"url":nN(r,"uri",n.message,e);break;case"uuid":nN(r,"uuid",n.message,e);break;case"regex":Nv(r,n.regex,n.message,e);break;case"cuid":Nv(r,rN.cuid,n.message,e);break;case"cuid2":Nv(r,rN.cuid2,n.message,e);break;case"startsWith":Nv(r,RegExp(`^${hBr(n.value,e)}`),n.message,e);break;case"endsWith":Nv(r,RegExp(`${hBr(n.value,e)}$`),n.message,e);break;case"datetime":nN(r,"date-time",n.message,e);break;case"date":nN(r,"date",n.message,e);break;case"time":nN(r,"time",n.message,e);break;case"duration":nN(r,"duration",n.message,e);break;case"length":ul(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),ul(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":{Nv(r,RegExp(hBr(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&nN(r,"ipv4",n.message,e),n.version!=="v4"&&nN(r,"ipv6",n.message,e);break}case"base64url":Nv(r,rN.base64url,n.message,e);break;case"jwt":Nv(r,rN.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&Nv(r,rN.ipv4Cidr,n.message,e),n.version!=="v4"&&Nv(r,rN.ipv6Cidr,n.message,e);break}case"emoji":Nv(r,rN.emoji(),n.message,e);break;case"ulid":{Nv(r,rN.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{nN(r,"binary",n.message,e);break}case"contentEncoding:base64":{ul(r,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{Nv(r,rN.base64,n.message,e);break}}break}case"nanoid":Nv(r,rN.nanoid,n.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function hBr(t,e){return e.patternStrategy==="escape"?Pqc(t):t}function Pqc(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):ul(t,"format",e,r,n)}function Nv(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:i$i(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ul(t,"pattern",i$i(e,n),r,n)}function i$i(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",s=!1,c=!1,l=!1;for(let u=0;u({...n,[o]:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??E1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===vr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=LZi(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===vr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===vr.ZodBranded&&t.keyType._def.type._def.typeName===vr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=OZi(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function BHc(t,e){if(e.mapStrategy==="record")return FZi(t,e);let r=Pc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||E1(e),n=Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||E1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function LHc(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function FHc(t){return t.target==="openAi"?void 0:{not:E1({...t,currentPath:[...t.currentPath,"not"]})}}function UHc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function QHc(t,e){if(e.target==="openApi3")return y$i(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in RTt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=RTt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return y$i(t,e)}function qHc(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:RTt[t.innerType._def.typeName],nullable:!0}:{type:[RTt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function jHc(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",NZi(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?fl(r,"minimum",n.value,n.message,e):fl(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),fl(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?fl(r,"maximum",n.value,n.message,e):fl(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),fl(r,"maximum",n.value,n.message,e));break;case"multipleOf":fl(r,"multipleOf",n.value,n.message,e);break}return r}function HHc(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=$Hc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Pc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=GHc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function GHc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Pc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function $Hc(t){try{return t.isOptional()}catch{return!0}}function zHc(t,e){return Pc(t.type._def,e)}function YHc(t,e){let r={type:"array",uniqueItems:!0,items:Pc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&fl(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&fl(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function KHc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Pc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Pc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function JHc(t){return{not:E1(t)}}function ZHc(t){return E1(t)}function Pc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==_Hc)return l}if(n&&!r){let l=tGc(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=eGc(t,t.typeName,e),c=typeof s=="function"?Pc(s(),e):s;if(c&&rGc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function iGc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function E$i(t,e){return fB(t)?VFr(t,{target:iGc(e?.target),io:e?.pipeStrategy??"input"}):nGc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function _$i(t){let e=dFe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=bJi(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function C$i(t,e){let r=T3e(t,e);if(!r.success)throw r.error;return r.data}function v$i(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function sGc(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];v$i(c)&&v$i(s)?r[o]={...c,...s}:r[o]=s}return r}function lGc(){let t=new aGc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return cGc.default(t),t}function uGc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function dGc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function b$i(t){return!!t&&typeof t=="object"&&UZi in t}function fGc(t){return t[UZi]?.complete}function hGc(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!pGc.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function mGc(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function T$i(t){let e=hGc(t);return mGc(t,e.warnings),e.isValid}function QZi(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function qZi(t){return"_def"in t||"_zod"in t||QZi(t)}function VLr(t){return typeof t!="object"||t===null||qZi(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(QZi)}function I$i(t){if(t){if(VLr(t))return OEe(t);if(!qZi(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function AGc(t){let e=dFe(t);return e?Object.entries(e).map(([r,n])=>{let o=DQc(n),s=NQc(n);return{name:r,description:o,required:!s}}):[]}function gV(t){let e=dFe(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=bJi(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function x$i(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function yGc(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function EGc(t){let e=new $Lr({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!_Gc(n))continue;let o=n.description;o&&!d9.has(n)&&d9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function _Gc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function xr(t){let e;return()=>e??=t()}function vGc(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new GR("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function bGc(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:I0(r)})}catch(s){throw new GR(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new GR(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=CGc().safeParse(await n.json());if(!o.success)throw new GR(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function R$i(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function zLr(t,e,r){let n=SGc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=hI(),c=I0(o)+` -`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,HZi.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function SGc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function TGc(t){let{buffer:e,bytesRead:r}=hI().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function IGc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function xGc(t){let e=hI(),{resolvedPath:r,isSymlink:n}=OWi(e,t);n&&Kl(`Reading through symlink: ${t} -> ${r}`);let o=TGc(r),s=e.readFileSync(r,{encoding:o}),c=IGc(s.slice(0,4096));return{content:s.replaceAll(`\r +]`;continue}o+=n[u],n[u]==="\\"?s=!0:c&&n[u]==="]"?c=!1:!c&&n[u]==="["&&(c=!0)}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return o}function TZi(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===Cr.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??f1(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Cr.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=SZi(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Cr.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Cr.ZodBranded&&t.keyType._def.type._def.typeName===Cr.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=CZi(t.keyType._def,e);return{...r,propertyNames:o}}}return r}function kqc(t,e){if(e.mapStrategy==="record")return TZi(t,e);let r=Rc(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||f1(e),n=Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||f1(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Dqc(t){let e=t.values,r=Object.keys(t.values).filter(o=>typeof e[e[o]]!="number").map(o=>e[o]),n=Array.from(new Set(r.map(o=>typeof o)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:r}}function Nqc(t){return t.target==="openAi"?void 0:{not:f1({...t,currentPath:[...t.currentPath,"not"]})}}function Mqc(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}function Oqc(t,e){if(e.target==="openApi3")return o$i(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in mTt&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,s)=>{let c=mTt[s._def.typeName];return c&&!o.includes(c)?[...o,c]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,s)=>{let c=typeof s._def.value;switch(c){case"string":case"number":case"boolean":return[...o,c];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];default:return o}},[]);if(n.length===r.length){let o=n.filter((s,c,l)=>l.indexOf(s)===c);return{type:o.length>1?o:o[0],enum:r.reduce((s,c)=>s.includes(c._def.value)?s:[...s,c._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return o$i(t,e)}function Bqc(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:mTt[t.innerType._def.typeName],nullable:!0}:{type:[mTt[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Lqc(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",_Zi(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?ul(r,"minimum",n.value,n.message,e):ul(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),ul(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?ul(r,"maximum",n.value,n.message,e):ul(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),ul(r,"maximum",n.value,n.message,e));break;case"multipleOf":ul(r,"multipleOf",n.value,n.message,e);break}return r}function Fqc(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],s=t.shape();for(let l in s){let u=s[l];if(u===void 0||u._def===void 0)continue;let d=Qqc(u);d&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),d=!1);let f=Rc(u._def,{...e,currentPath:[...e.currentPath,"properties",l],propertyPath:[...e.currentPath,"properties",l]});f!==void 0&&(n.properties[l]=f,!d&&o.push(l))}o.length&&(n.required=o);let c=Uqc(t,e);return c!==void 0&&(n.additionalProperties=c),n}function Uqc(t,e){if(t.catchall._def.typeName!=="ZodNever")return Rc(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Qqc(t){try{return t.isOptional()}catch{return!0}}function Hqc(t,e){return Rc(t.type._def,e)}function Gqc(t,e){let r={type:"array",uniqueItems:!0,items:Rc(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&ul(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&ul(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}function $qc(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Rc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Rc(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Rc(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Vqc(t){return{not:f1(t)}}function Wqc(t){return f1(t)}function Rc(t,e,r=!1){let n=e.seen.get(t);if(e.override){let l=e.override?.(t,e,n,r);if(l!==mqc)return l}if(n&&!r){let l=Kqc(n,e);if(l!==void 0)return l}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=Yqc(t,t.typeName,e),c=typeof s=="function"?Rc(s(),e):s;if(c&&Jqc(t,e,c),e.postProcess){let l=e.postProcess(c,t,e);return o.jsonSchema=c,l}return o.jsonSchema=c,c}function Xqc(t){return!t||t==="jsonSchema7"||t==="draft-7"?"draft-7":t==="jsonSchema2019-09"||t==="draft-2020-12"?"draft-2020-12":"draft-7"}function s$i(t,e){return oB(t)?SFr(t,{target:Xqc(e?.target),io:e?.pipeStrategy??"input"}):Zqc(t,{strictUnions:e?.strictUnions??!0,pipeStrategy:e?.pipeStrategy??"input"})}function a$i(t){let e=J3e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=uJi(e);if(typeof r!="string")throw Error("Schema method literal must be a string");return r}function c$i(t,e){let r=d3e(t,e);if(!r.success)throw r.error;return r.data}function l$i(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function tjc(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];l$i(c)&&l$i(s)?r[o]={...c,...s}:r[o]=s}return r}function ijc(){let t=new rjc.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return njc.default(t),t}function ojc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function sjc(t,e,r){if(!t)throw Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}function u$i(t){return!!t&&typeof t=="object"&&IZi in t}function ajc(t){return t[IZi]?.complete}function ljc(t){let e=[];if(t.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(t.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!cjc.test(t)){let r=t.split("").filter(n=>!/[A-Za-z0-9._-]/.test(n)).filter((n,o,s)=>s.indexOf(n)===o);return e.push(`Tool name contains invalid characters: ${r.map(n=>`"${n}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:e}}return{isValid:!0,warnings:e}}function ujc(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function f$i(t){let e=ljc(t);return ujc(t,e.warnings),e.isValid}function xZi(t){return t!==null&&typeof t=="object"&&"parse"in t&&typeof t.parse=="function"&&"safeParse"in t&&typeof t.safeParse=="function"}function wZi(t){return"_def"in t||"_zod"in t||xZi(t)}function SLr(t){return typeof t!="object"||t===null||wZi(t)?!1:Object.keys(t).length===0?!0:Object.values(t).some(xZi)}function p$i(t){if(t){if(SLr(t))return bEe(t);if(!wZi(t))throw Error("inputSchema must be a Zod schema or raw shape, received an unrecognized object");return t}}function fjc(t){let e=J3e(t);return e?Object.entries(e).map(([r,n])=>{let o=xUc(n),s=wUc(n);return{name:r,description:o,required:!s}}):[]}function oV(t){let e=J3e(t)?.method;if(!e)throw Error("Schema is missing a method literal");let r=uJi(e);if(typeof r=="string")return r;throw Error("Schema method literal must be a string")}function h$i(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}function pjc(t,e,r,n,o){let s={};return o?.searchHint&&(s["anthropic/searchHint"]=o.searchHint),o?.alwaysLoad&&(s["anthropic/alwaysLoad"]=!0),{name:t,description:e,inputSchema:r,handler:n,annotations:o?.annotations,_meta:Object.keys(s).length>0?s:void 0}}function hjc(t){let e=new bLr({name:t.name,version:t.version??"1.0.0"},{capabilities:{tools:t.tools?{}:void 0},instructions:t.instructions});return t.tools&&t.tools.forEach(r=>{for(let n of Object.values(r.inputSchema)){if(!mjc(n))continue;let o=n.description;o&&!n9.has(n)&&n9.add(n,{description:o})}e.registerTool(r.name,{description:r.description,inputSchema:r.inputSchema,annotations:r.annotations,_meta:t.alwaysLoad?{"anthropic/alwaysLoad":!0,...r._meta}:r._meta},r.handler)}),{type:"sdk",name:t.name,instance:e}}function mjc(t){return typeof t=="object"&&t!==null&&"_zod"in t}function xr(t){let e;return()=>e??=t()}function Ajc(t){if(t.startsWith("cc://")){let n=t.slice(5),o=new URL(`http://${n}`),s=o.pathname.slice(1)||void 0;return{serverUrl:`http://${o.host}`,authToken:s}}if(t.startsWith("cc+unix://"))throw new qR("Unix socket connect (cc+unix://) is not supported by the SDK transport");let e=/^https?:\/\//i.test(t)?t:`http://${t}`,r=new URL(e);return{serverUrl:`${r.protocol}//${r.host}`,authToken:void 0}}async function yjc(t){let e={"content-type":"application/json"};t.authToken&&(e.authorization=`Bearer ${t.authToken}`);let r={};t.cwd&&(r.cwd=t.cwd),t.sessionKey&&(r.session_key=t.sessionKey),t.permissionMode&&(r.permission_mode=t.permissionMode);let n;try{n=await fetch(`${t.serverUrl}/sessions`,{method:"POST",headers:e,body:x0(r)})}catch(s){throw new qR(`Failed to connect to server at ${t.serverUrl}: ${s instanceof Error?s.message:String(s)}`,"session_create_failed")}if(!n.ok){let s=await n.text().catch(()=>"");throw new qR(`Failed to create session: ${n.status} ${n.statusText}${s?` \u2014 ${s}`:""}`,"session_create_failed")}let o=gjc().safeParse(await n.json());if(!o.success)throw new qR(`Invalid session response: ${o.error.message}`,"session_create_invalid_response");return{sessionId:o.data.session_id,wsUrl:o.data.ws_url,workDir:o.data.work_dir}}async function g$i(t,e,r){let n={};r&&(n.authorization=`Bearer ${r}`);try{await fetch(`${t}/sessions/${e}`,{method:"DELETE",headers:n})}catch{}}function ILr(t,e,r){let n=Ejc();if(!n)return;let o={timestamp:new Date().toISOString(),level:t,event:e,data:r??{}},s=uI(),c=x0(o)+` +`;try{s.appendFileSync(n,c)}catch{try{s.mkdirSync((0,PZi.dirname)(n)),s.appendFileSync(n,c)}catch{}}}function Ejc(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}function _jc(t){let{buffer:e,bytesRead:r}=uI().readSync(t,{length:4096});return r===0?"utf8":r>=2&&e[0]===255&&e[1]===254?"utf16le":(r>=3&&e[0]===239&&e[1]===187&&e[2]===191,"utf8")}function vjc(t){let e=0,r=0;for(let n=0;n0&&t[n-1]==="\r"?e++:r++);return e>r?"CRLF":"LF"}function Cjc(t){let e=uI(),{resolvedPath:r,isSymlink:n}=CWi(e,t);n&&Wl(`Reading through symlink: ${t} -> ${r}`);let o=_jc(r),s=e.readFileSync(r,{encoding:o}),c=vjc(s.slice(0,4096));return{content:s.replaceAll(`\r `,` -`),encoding:o,lineEndings:c}}function TIt(t){return xGc(t).content}function GZi(t){return t.startsWith("\uFEFF")?t.slice(1):t}function PGc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),kTt.default.platform==="darwin"?wGc(t):kTt.default.platform==="win32"?RGc(t):kGc(t)}function DGc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||HE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function NGc(){return DGc()==="essential-traffic"}function OGc(t){LBr.length>=MGc&&LBr.shift(),LBr.push(t)}function $Zi(t){let e=nFe(t);try{if(HE(process.env.CLAUDE_CODE_USE_BEDROCK)||HE(process.env.CLAUDE_CODE_USE_VERTEX)||HE(process.env.CLAUDE_CODE_USE_FOUNDRY)||HE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||HE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||NGc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(OGc(r),O$i===null){BGc.push({type:"error",error:e});return}O$i.logError(e)}catch{}}function FGc(t,e,r=100){let n=new JLr({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function YZi(t,e){try{return{ok:!0,value:JSON.parse(GZi(t))}}catch(r){return e&&$Zi(r),{ok:!1}}}function JGc(){let t=H.object({type:H.literal("command").describe("Shell command hook type"),command:H.string().describe("Shell command to execute"),args:H.array(H.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:d3e(),shell:H.enum(KGc).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:H.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:H.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:H.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:H.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=H.object({type:H.literal("prompt").describe("LLM prompt hook type"),prompt:H.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:H.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:H.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=H.object({type:H.literal("mcp_tool").describe("MCP tool hook type"),server:H.string().describe("Name of an already-configured MCP server to invoke"),tool:H.string().describe("Name of the tool on that server to call"),input:H.record(H.string(),H.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=H.object({type:H.literal("http").describe("HTTP hook type"),url:H.string().url().describe("URL to POST the hook input JSON to"),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:H.record(H.string(),H.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:H.array(H.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=H.object({type:H.literal("agent").describe("Agentic verifier hook type"),prompt:H.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:d3e(),timeout:H.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:H.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:H.string().optional().describe("Custom status message to display in spinner while hook runs"),once:H.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function f$c(t){return XZi.has(t.toLowerCase())?!1:d$c.test(t)?!0:u$c.test(t)}function O$c(t){let e=N$c();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=M$c().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(Kl(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(Kl(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function cXi(){return V$c.filter(t=>wIt[t].buildGate())}function W$c(t){let e={};for(let r of t)e={...e,...wIt[r].shape()};return e}function z$c(t){let e={};for(let r of t)e={...e,...wIt[r].permissionsShape?.()};return e}function Y$c(t){let e=[];for(let r of t)e.push(...wIt[r].permissionModes?.()??[]);return e}function K$c(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function PEe(t){return Object.hasOwn(q$i,t)?q$i[t]:t}function J$c(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function Z$c(t){let e=X$c(t,"(");if(e===-1)return{toolName:PEe(t)};let r=eVc(t,")");if(r===-1||r<=e)return{toolName:PEe(t)};if(r!==t.length-1)return{toolName:PEe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:PEe(t)};if(o===""||o==="*")return{toolName:PEe(n)};let s=J$c(o);return{toolName:PEe(n),ruleContent:s}}function X$c(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function eVc(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function tVc(t){return MTt.filePatternTools.includes(t)}function rVc(t){return MTt.bashPrefixTools.includes(t)}function nVc(t){return Object.hasOwn(MTt.customValidation,t)?MTt.customValidation[t]:void 0}function uXi(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function UBr(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${H8c(String(n.toolName))}"`};let s=nVc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(rVc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(tVc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function fXi(t){return H.object({allow:H.array(QBr()).optional().describe("List of permission rules for allowed operations"),deny:H.array(QBr()).optional().describe("List of permission rules for denied operations"),ask:H.array(QBr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:H.enum([...Z8r,...Y$c(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:H.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...z$c(t),additionalDirectories:H.array(H.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function cVc(t){return H.object({$schema:H.literal($$c).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:H.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:H.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:H.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:H.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:H.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:aVc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...HE(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:H.object({issuer:H.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:H.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:H.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:H.object({type:H.literal("command"),command:H.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:H.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:H.object({enabled:H.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:H.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:H.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:H.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:H.object({enabled:H.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:H.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:H.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:H.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:H.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:H.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:H.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:oVc().optional().describe("Environment variables to set for Claude Code sessions"),attribution:H.object({commit:H.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:H.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:H.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:H.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:fXi(t).optional().describe("Tool usage permissions configuration"),model:H.string().optional().describe("Override the default model used by Claude Code"),availableModels:H.array(H.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:H.record(H.string(),H.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:H.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:H.array(H.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:H.array(H.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:H.record(H.string(),H.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:H.array(pXi()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:H.array(hXi()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:DTt().optional().describe("Custom commands to run before/after tool executions"),worktree:H.object({symlinkDirectories:H.array(H.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:H.array(H.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:H.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:H.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:H.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:H.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:H.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:H.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:H.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:H.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:H.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:H.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:H.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:H.array(H.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:H.array(H.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:H.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:H.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:H.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:H.preprocess(e=>Array.isArray(e)?e.filter(r=>j$i.includes(r)):e,H.union([H.boolean(),H.array(H.enum(j$i))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:H.object({type:H.literal("command"),command:H.string(),padding:H.number().optional(),refreshInterval:H.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:H.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:H.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:H.object({type:H.literal("command"),command:H.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:H.record(H.string(),H.union([H.array(H.string()),H.boolean(),H.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:H.record(H.string(),sVc()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:H.array(NTt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:H.array(NTt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:H.array(H.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:H.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:H.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:H.union([H.string(),H.array(H.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:H.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:H.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:H.string().optional().describe("Controls the output style for assistant responses"),viewMode:H.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:H.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:H.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:jGc().optional(),feedbackSurveyRate:H.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:H.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:H.object({mode:H.enum(["append","replace"]),verbs:H.array(H.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:H.object({excludeDefault:H.boolean().optional(),tips:H.array(H.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:H.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:H.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:H.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:H.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:H.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:H.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:H.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:H.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:H.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:H.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:H.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:H.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:H.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:H.array(H.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:H.record(H.string(),H.object({mcpServers:H.record(H.string(),H.record(H.string(),H.union([H.string(),H.number(),H.boolean(),H.array(H.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:H.record(H.string(),H.union([H.string(),H.number(),H.boolean(),H.array(H.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:H.object({defaultEnvironmentId:H.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:H.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:H.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:H.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:H.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:H.object({enabled:H.boolean().optional(),mode:H.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:H.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:H.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:H.array(H.object({marketplace:H.string(),plugin:H.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:H.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:H.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:H.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:H.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:H.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:H.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:H.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:H.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:H.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:H.array(H.object({id:H.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:H.string().describe("Display name for the SSH connection"),sshHost:H.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:H.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:H.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:H.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:H.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:H.array(H.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:H.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:H.union([H.enum(WGc),H.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:H.enum(GGc).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:H.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:H.enum(HGc).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:H.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:H.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:H.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:H.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:H.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:H.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:H.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:H.enum($Gc).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:H.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:H.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:H.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:H.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:H.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:H.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...W$c(t)}).passthrough()}function dVc(t){let e=lVc.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=uVc[$8c(t.path,".")]),r}function H$i(t){return t.code==="invalid_type"}function G$i(t){return t.code==="invalid_value"}function fVc(t){return t.code==="unrecognized_keys"}function $$i(t){return t.code==="too_small"}function qEe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function V$i(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function EFe(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(G$i(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(H$i(r)){l=r.expected;let h=V$i(r.message);u=h??qEe(r.input),d=h??qEe(r.input)}else $$i(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=dVc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(G$i(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(H$i(r)){let h=V$i(r.message)??qEe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(fVc(r)){let h=r.keys.join(", ");o=`Unrecognized ${G8c(r.keys.length,"field")}: ${h}`}else $$i(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function pVc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=dXi(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function mVc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=qEe(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!hVc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${zTt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=qEe(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function AVc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of gVc){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${qEe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,AXi.execFile)(t,e,{encoding:"utf-8",timeout:_Vc},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function bVc(){return(async()=>{if(process.platform==="darwin"){let t=CVc(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,yXi.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await f3e(yVc,[...EVc,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([f3e(t,["query",r3r,"/v",LEe]),f3e(t,["query",n3r,"/v",LEe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(gXi()){let[t,e]=await Promise.all([f3e(z$i,["query",r3r,"/v",LEe]),f3e(z$i,["query",n3r,"/v",LEe])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function SVc(){return vVc}function TVc(){BTt||(BTt=(async()=>{let t=Date.now(),e=SVc()??bVc(),{mdm:r,hkcu:n,wslInherits:o}=kVc(await e);EXi=r,_Xi=n,CXi=o;let s=Date.now()-t;if(Kl(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){Kl(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{zLr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function IVc(){BTt||TVc(),await BTt}function xVc(){return EXi??EV}function wVc(){return _Xi??EV}function RVc(){return CXi}function qBr(t,e){let r=xV(IIt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=T_e(r,e),o=S_e().safeParse(r);if(!o.success){let s=EFe(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function Y$i(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function kVc(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=qBr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:EV,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=Y$i(t.hklmStdout);c&&(r=qBr(c,`Registry: ${r3r}\\${LEe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:EV,o=gXi(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||DVc(),!s))return{mdm:n,hkcu:EV,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:EV,wslInherits:s}}if(PVc(s))return{mdm:n,hkcu:EV,wslInherits:s};if(t.hkcuStdout){let c=Y$i(t.hkcuStdout);if(c){let l=qBr(c,`Registry: ${n3r}\\${LEe}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:EV,wslInherits:s}}function PVc(t){return t&&J$i(OTt)?!0:J$i(eFe())}function K$i(t){let e=xV(IIt(TIt(t),!1));if(!e||typeof e!="object")return!1;T_e(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function DVc(){function t(e){try{let r=IIt(TIt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,$ne.join)(OTt,"managed-settings.json")))return!0;try{let e=(0,$ne.join)(OTt,"managed-settings.d");for(let r of hI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,$ne.join)(e,r.name)))return!0}catch{}return!1}function J$i(t){try{if(K$i((0,$ne.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,$ne.join)(t,"managed-settings.d"),r=hI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(K$i((0,$ne.join)(e,n.name)))return!0}catch{}}catch{}return!1}function NVc(t,e,r){(r!==void 0&&!YTt(t[e],r)||r===void 0&&!(e in t))&&R3r(t,e,r)}function MVc(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function FVc(t){return y_e(t)&&D3r(t)}function $Vc(t){if(!y_e(t)||rFe(t)!=QVc)return!1;var e=RWi(t);if(e===null)return!0;var r=HVc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&vXi.call(r)==GVc}function WVc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function zVc(t){return n3c(t,IWi(t))}function KVc(t,e,r,n,o,s,c){var l=o3r(t,r),u=o3r(e,r),d=c.get(u);if(d){i3r(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=IV(u),g=!m&&k3r(u),A=!m&&!g&&SWi(u);f=u,m||g||A?IV(l)?f=l:UVc(l)?f=EFc(l):g?(h=!1,f=wWi(u,!0)):A?(h=!1,f=xFc(u,!0)):f=[]:VVc(u)||D3e(u)?(f=l,D3e(l)?f=YVc(l):(!p9(l)||y3r(l))&&(f=PFc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),i3r(t,r,f)}function bXi(t,e,r,n,o){t!==e&&LVc(e,function(s,c){if(o||(o=new KLc),p9(s))JVc(t,e,c,r,bXi,n,o);else{var l=n?n(o3r(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),i3r(t,c,l)}},IWi)}function XVc(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function tWc(t,e,r){return e=Z$i(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=Z$i(n.length-e,0),c=Array(s);++o0){if(++e>=sWc)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function fWc(t,e){return TXi(SXi(t,e,PWi),t+"")}function hWc(t,e,r){if(!p9(r))return!1;var n=typeof e;return(n=="number"?D3r(r)&&XTt(e,r.length):n=="string"&&e in r)?YTt(r[e],t):!1}function gWc(t){return pWc(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&mWc(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?IXi(l,e-1,r,n,o):CFc(o,l):n||(o[o.length]=l)}return o}function wWc(t){var e=t==null?0:t.length;return e?xWc(t,1):[]}function kWc(t){return TXi(SXi(t,void 0,RWc),t+"")}function OWc(){return void 0??(0,xXi.join)(g_e(),NWc)}function BWc(){try{let t=TIt(OWc()),e=hN(GZi(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function LWc(){if(!void 0&&MWc!==!0)return null;if(HBr)return HBr;let t=BWc();return t?(HBr=t,L3r(),t):null}function e6r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),G$c.filter(r=>e.has(r))}function FWc(){return(0,ly.join)(eFe(),"managed-settings.json")}function wXi(t){if(xIt()==="wsl"&&t.wslInherits?.()){let e=GBr(OTt);if(e.settings)return e;let r=GBr(eFe());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return GBr(eFe())}function GBr(t){let e=[],r={},n=!1,{settings:o,errors:s}=LTt((0,ly.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=vV(r,o,bV),n=!0);let c=(0,ly.join)(t,"managed-settings.d");try{let d=hI().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=LTt((0,ly.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=vV(r,h,bV),n=!0)}}catch(d){let f=pI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&Kl(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function UWc(t,e){iFe(t)?Kl(`Broken symlink or missing file encountered for settings.json at path: ${e}`):Kl(`settings file read failed at ${e}: ${t}`,{level:"error"})}function LTt(t,e){let r=h8c(t);if(r)return{settings:r.settings?xV(r.settings):null,errors:r.errors};let n=QWc(t,e);return m8c(t,n),{settings:n.settings?xV(n.settings):null,errors:n.errors}}function RXi(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function kXi(t){let e=t?.remote?t.remote():LWc();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"remote managed settings"),o=S_e().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"remote managed settings")]}}function PXi(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"parent managed settings"),o=S_e().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"parent managed settings")]}}function DXi(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=xV(e),n=T_e(r,"SDK inline settings"),o=S_e().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...EFe(o.error,"SDK inline settings")]}}function QWc(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=OWi(hI(),t);r=TIt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=xV(IIt(r,!1)),o=T_e(n,t),s=S_e().safeParse(n);if(!s.success){let c=EFe(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return UWc(r,t),{settings:null,errors:[]}}}function eVi(t,e){switch(t){case"userSettings":return(0,ly.resolve)(g_e());case"policySettings":case"projectSettings":case"localSettings":return(0,ly.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,ly.dirname)((0,ly.resolve)(e.flagPath)):(0,ly.resolve)(e.cwd)}}function qWc(t){return t.coworkPlugins||HE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function FTt(t,e){switch(t){case"userSettings":return(0,ly.join)(eVi(t,e),qWc(e));case"projectSettings":case"localSettings":return(0,ly.join)(eVi(t,e),jWc(t));case"policySettings":return FWc();case"flagSettings":return e.flagPath}}function jWc(t){switch(t){case"projectSettings":return(0,ly.join)(".claude","settings.json");case"localSettings":return(0,ly.join)(".claude","settings.local.json")}}function NXi(t,e){let r=d8c(t);if(r!==void 0)return r;let n=WWc(t,e);return f8c(t,n),n}function HWc(t){return!t||t.parentSettingsBehavior==="merge"}function GWc(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=jBr(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=jBr(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=jBr(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function $Wc(t){if(t.helper?.())return"helper";if(kXi(t).settings)return"remote";if(RXi(t).settings)return xIt()==="macos"?"plist":"hklm";if((t.file?.()??wXi(t)).settings)return"file";if(PXi(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function VWc(t){let e=[],{settings:r,errors:n}=kXi(t);e.push(...n);let{settings:o,errors:s}=RXi(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??wXi(t);e.push(...l);let{settings:u,errors:d}=PXi(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&HWc(h)?GWc(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function MXi(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=VWc(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:vV({},n??{},r??{},bV),errors:o}}function WWc(t,e){if(t==="policySettings")return MXi(e).settings;let r=FTt(t,e),{settings:n}=r?LTt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=DXi(e);if(o)return vV(n||{},o,bV)}return n}function zWc(t,e){return hzi([...t,...e])}function bV(t,e){if(Array.isArray(t)&&Array.isArray(e))return zWc(t,e)}function YWc(t){if($Br)return{settings:{},errors:[]};let e=Date.now();zLr("info","settings_load_started"),$Br=!0;try{let r=A8c(),n={};r&&(n=vV(n,r,bV));let o=[],s=new Set,c=new Set;for(let l of e6r(t)){if(l==="policySettings"){let{settings:d,errors:f}=MXi(t);d&&(n=vV(n,d,bV));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=FTt(l,t);if(u){let d=(0,ly.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=LTt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=vV(n,f,bV))}}if(l==="flagSettings"){let{settings:d,errors:f}=DXi(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=vV(n,d,bV))}}return zLr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{$Br=!1}}function KWc(t){let e=l8c();if(e!==null)return e;let r=YWc(t);return u8c(r),r}function JWc(t){let{settings:e}=KWc(t);return e||{}}function ZWc(t){L3r();let e=[];for(let r of e6r(t)){let n=NXi(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:JWc(t),sources:e}}function XWc(t,e){let r=e6r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(NXi(o,e)?.[t]!==void 0)return o}return null}function izc(t){let e=t.effective.permissions?.defaultMode;if(!e||!rzc.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(nzc.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function ozc(t={}){await IVc();let e={cwd:(0,jZi.resolve)(t.cwd??hI().cwd()),allowedSources:(t.settingSources??tzc).map(r=>ezc[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:xVc,hkcu:wVc,wslInherits:RVc,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=ZWc(e),o=$Wc(e)??void 0,s=n.map(({source:l,settings:u})=>({source:tVi[l],settings:u,path:l==="policySettings"?void 0:FTt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=XWc(l,e);u&&(c[l]={source:tVi[u],path:u==="policySettings"?void 0:FTt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{L3r()}}async function szc(t){return ozc(t)}async function azc(t,e){try{await(0,GE.copyFile)(t,e)}catch(r){if(!iFe(r))throw r}}async function czc(t,e){if(!t)return;let r=t;try{let n=hN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=I0(n))}catch{}await(0,GE.writeFile)(e,r,{mode:384})}function lzc(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=M9c(N9c);return new Promise(e=>{(0,SVi.execFile)("security",["find-generic-password","-a",B9c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function OXi(t,e,r,n,o=6e4){if(!uh(e))return;let s=ZR(r),c=await Qne(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,cc.join)((0,jEe.tmpdir)(),`claude-resume-${(0,VTt.randomUUID)()}`);try{let u=(0,cc.join)(l,"projects",s);await(0,GE.mkdir)(u,{recursive:!0});let d=(0,cc.join)(u,`${e}.jsonl`);await CLr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,cc.join)((0,jEe.homedir)(),".claude"),m;try{m=await(0,GE.readFile)((0,cc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!iFe(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await lzc()??m),await czc(m,(0,cc.join)(l,".credentials.json")),await azc((0,cc.join)(f??(0,jEe.homedir)(),".claude.json"),(0,cc.join)(l,".claude.json")),t.listSubkeys){let g=(0,cc.join)(u,e),A=await Qne(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,cc.resolve)(g,y+".jsonl");if(!y||(0,cc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+cc.sep)){Kl(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Qne(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)c3r(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,GE.mkdir)((0,cc.dirname)(E),{recursive:!0}),await CLr(E,b)),v.length>0){let T=v.at(-1),w=(0,cc.resolve)(g,y+".meta.json");await(0,GE.mkdir)((0,cc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,GE.writeFile)(w,I0(x),{mode:384})}}}return l}catch(u){throw await UTt(l),u}}function s3r(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=WBr(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:k=[],tools:D,env:N,executable:L=MVi()?"bun":"node",executableArgs:B=[],extraArgs:Q={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:q,forkSession:F,hooks:U,includeHookEvents:W,includePartialMessages:V,forwardSubagentText:G,onElicitation:Y,persistSession:re,sessionStore:j,sessionStoreFlush:X,thinking:ie,effort:we,maxThinkingTokens:Ae,maxTurns:De,maxBudgetUsd:Te,taskBudget:Z,mcpServers:J,model:z,outputFormat:le,permissionMode:K="default",allowDangerouslySkipPermissions:ae=!1,permissionPromptToolName:Me,plugins:ne,getOAuthToken:se,getHostAuthToken:Ie,workload:_e,resume:Re,resumeSessionAt:Je,sessionId:Xe,skills:Ct,stderr:Ot,strictMcpConfig:$t}=d;if(j&&re===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(j&&T&&!Re&&!j.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(j&&O)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");j&&d.spawnClaudeCodeProcess&&Kl("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let Gt=d.pathToClaudeCodeExecutable;if(!Gt){let ut=(0,xVi.fileURLToPath)(importMetaUrlShim),ee=(0,TVi.createRequire)(ut),pe=g6c(ke=>ee.resolve(ke));if(!pe)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);Gt=pe}let Ee=le?.type==="json_schema"?le.schema:void 0,Qe=N?{...N}:{...process.env};Qe.CLAUDE_CODE_ENTRYPOINT||(Qe.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),Qe.CLAUDE_AGENT_SDK_VERSION||(Qe.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(Qe.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),se&&(Qe.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ie&&(Qe.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),q?.askUserQuestion?.previewFormat&&(Qe.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=q.askUserQuestion.previewFormat);let nt={};if(zGi.propagation.inject(zGi.context.active(),nt),"traceparent"in nt)for(let ut of["TRACEPARENT","TRACESTATE"])ut in(N??{})||delete Qe[ut];for(let[ut,ee]of Object.entries(nt)){let pe=ut.toUpperCase();pe in(N??{})||(Qe[pe]=ee)}let mt={},xe=new Map;if(J)for(let[ut,ee]of Object.entries(J))ee.type==="sdk"&&ee.instance?xe.set(ut,ee.instance):mt[ut]=ee;let He;if(ie)switch(ie.type){case"adaptive":He={type:"adaptive",display:ie.display};break;case"enabled":He={type:"enabled",budgetTokens:ie.budgetTokens,display:ie.display};break;case"disabled":He={type:"disabled"};break}else Ae!==void 0&&(He=Ae===0?{type:"disabled"}:{type:"enabled",budgetTokens:Ae});r&&(Qe.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(Qe.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let Ze=new gLr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:L,executableArgs:B,extraArgs:_e?{...Q,workload:_e}:Q,pathToClaudeCodeExecutable:Gt,env:Qe,forkSession:F,stderr:Ot,thinkingConfig:He,effort:we,maxTurns:De,maxBudgetUsd:Te,taskBudget:Z,model:z,fallbackModel:M,jsonSchema:Ee,permissionMode:K,allowDangerouslySkipPermissions:ae,permissionPromptToolName:Me,continueConversation:j?void 0:T,resume:Re,resumeSessionAt:Je,sessionId:Xe,settings:typeof s=="object"?I0(s):s,managedSettings:c?I0(c):void 0,settingSources:l,skills:Ct,allowedTools:_,disallowedTools:k,tools:D,mcpServers:mt,strictMcpConfig:$t,canUseTool:!!b,hooks:!!U,includeHookEvents:W,includePartialMessages:V,persistSession:re,sessionMirror:!!j,plugins:ne,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),at={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:Ct,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:G},ct=new yLr(Ze,e,b,U,g,xe,Ee,at,Y,se,Ie);if(j){let ut=a(()=>(0,cc.join)(Qe.CLAUDE_CONFIG_DIR??(0,cc.join)((0,jEe.homedir)(),".claude"),"projects"),"S6"),ee=X==="eager",pe=new ELr(async(ke,Le)=>{let Ve=oVi(ke,ut());Ve?await j.append(Ve,Le):Kl(`[SessionStore] dropping mirror frame: filePath ${ke} is not under ${ut()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(ke,Le)=>{let Ve=oVi(ke,ut());Ve&&ct.reportMirrorError(Ve,Le.message)},ee?0:U3r,ee?0:Q3r);ct.setTranscriptMirrorBatcher(pe)}return{queryInstance:ct,transport:Ze,abortController:g,processEnv:Qe}}function a3r(t,e,r,n){typeof r=="string"?e.write(I0({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` -`):t.streamInput(r).catch(o=>n.abort(o))}async function UTt(t){for(let e=0;;e++)try{return await(0,GE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!uzc.has(pI(r)??""))return;await RVi((e+1)*100)}}function dzc(t,e){t.waitForExit().catch(()=>{}).finally(()=>UTt(e))}function fzc({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=s3r({...e},typeof t=="string",void 0,!0),d=(0,cc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Qne(f.listSessions(ZR(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return OXi(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>dzc(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=nFe(g);c.spawnAbort(A),s.setError(A)}),a3r(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=s3r(e,typeof t=="string");return a3r(r,n,t,o),r}async function pzc({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,cc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await Qne(t.sessionStore.listSessions(ZR(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await OXi(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=s3r(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>UTt(g))})}await Qne(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{a3r(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>UTt(r))}throw await c,l}}async function hzc(t,e){return e?.sessionStore?xzc(e.sessionStore,t,e):X6c(t,e)}async function mzc(t){return t?.sessionStore?Tzc(t.sessionStore,t):s9c(t)}async function gzc(t,e){return e?.sessionStore?wzc(e.sessionStore,t,e):a9c(t,e)}async function Azc(t,e,r){return r?.sessionStore?Rzc(r.sessionStore,t,e,r.dir):c9c(t,e,r)}async function yzc(t,e,r){return r?.sessionStore?kzc(r.sessionStore,t,e,r.dir):l9c(t,e,r)}async function Ezc(t,e){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=ZR(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return u9c(t,e)}async function _zc(t,e){return e?.sessionStore?Pzc(e.sessionStore,t,e):g9c(t,e)}async function Czc(t,e,r){if(!uh(t))throw Error(`Invalid sessionId: ${t}`);let n=await rIt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=ZR(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:U3r;if(await rVi(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,cc.join)(c,"subagents");for(let u of await vzc(l)){let d=(0,cc.relative)(c,u).split(cc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await rVi(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=hN(await(0,GE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!iFe(m))throw m}}}async function rVi(t,e,r,n){let o=(0,IVi.createInterface)({input:(0,WTt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(hN(l)),c+=l.length,(s.length>=n||c>=Q3r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function vzc(t){let e=[];async function r(n){let o;try{o=await(0,GE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,cc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function bzc(t,e){return e?.sessionStore?Dzc(e.sessionStore,t,e.dir):v9c(t,e)}async function Szc(t,e,r){return r?.sessionStore?Nzc(r.sessionStore,t,e,r):b9c(t,e,r)}function BXi(t){let e=(0,cc.resolve)(t??"."),r;try{r=(0,WTt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function ZR(t){return sFe(BXi(t))}function LXi(t){return t.map(e=>I0(e)).join(` +`),encoding:o,lineEndings:c}}function dIt(t){return Cjc(t).content}function kZi(t){return t.startsWith("\uFEFF")?t.slice(1):t}function Ijc(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),gTt.default.platform==="darwin"?bjc(t):gTt.default.platform==="win32"?Sjc(t):Tjc(t)}function xjc(){return process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC?"essential-traffic":process.env.DISABLE_TELEMETRY||QE(process.env.DO_NOT_TRACK)?"no-telemetry":"default"}function wjc(){return xjc()==="essential-traffic"}function Pjc(t){mBr.length>=Rjc&&mBr.shift(),mBr.push(t)}function DZi(t){let e=H3e(t);try{if(QE(process.env.CLAUDE_CODE_USE_BEDROCK)||QE(process.env.CLAUDE_CODE_USE_VERTEX)||QE(process.env.CLAUDE_CODE_USE_FOUNDRY)||QE(process.env.CLAUDE_CODE_USE_ANTHROPIC_AWS)||QE(process.env.CLAUDE_CODE_USE_MANTLE)||process.env.DISABLE_ERROR_REPORTING||wjc())return;let r={error:e.stack||e.message,timestamp:new Date().toISOString()};if(Pjc(r),C$i===null){kjc.push({type:"error",error:e});return}C$i.logError(e)}catch{}}function Njc(t,e,r=100){let n=new RLr({max:r}),o=a((...s)=>{let c=e(...s),l=n.get(c);if(l!==void 0)return l;let u=t(...s);return n.set(c,u),u},"X");return o.cache={clear:a(()=>n.clear(),"clear"),size:a(()=>n.size,"size"),delete:a(s=>n.delete(s),"delete"),get:a(s=>n.peek(s),"get"),has:a(s=>n.has(s),"has")},o}function BZi(t,e){try{return{ok:!0,value:JSON.parse(kZi(t))}}catch(r){return e&&DZi(r),{ok:!1}}}function Vjc(){let t=G.object({type:G.literal("command").describe("Shell command hook type"),command:G.string().describe("Shell command to execute"),args:G.array(G.string()).optional().describe("Argument list for exec form. When present, `command` is resolved as an executable and spawned directly with these arguments \u2014 no shell. Path placeholders like ${CLAUDE_PLUGIN_ROOT} are substituted per-element as plain strings, so paths with quotes, $, or backticks never reach a shell parser. When absent, `command` runs through a shell (bash on POSIX, PowerShell on Windows without Git Bash)."),if:JLe(),shell:G.enum($jc).optional().describe("Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash (powershell on Windows without Git Bash)."),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific command"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution"),async:G.boolean().optional().describe("If true, hook runs in background without blocking"),asyncRewake:G.boolean().optional().describe("If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async."),rewakeMessage:G.string().min(1).optional().describe("@internal Custom prefix for the system-reminder shown to the model when an asyncRewake hook exits with code 2. The hook output is appended after this prefix."),rewakeSummary:G.string().min(1).optional().describe('@internal One-line summary shown to the user in the terminal when an asyncRewake hook exits with code 2. Defaults to "Stop hook feedback".')}),e=G.object({type:G.literal("prompt").describe("LLM prompt hook type"),prompt:G.string().describe("Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON."),if:JLe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific prompt evaluation"),model:G.string().optional().describe('Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.'),continueOnBlock:G.boolean().optional().describe(`Sets the continue value for the decision:"block" produced when ok is false. Default false (turn ends). Whether continue:true lets the turn proceed depends on the event's decision:"block" semantics. On PostToolUse, the reason is fed back to Claude and the turn continues.`),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),r=G.object({type:G.literal("mcp_tool").describe("MCP tool hook type"),server:G.string().describe("Name of an already-configured MCP server to invoke"),tool:G.string().describe("Name of the tool on that server to call"),input:G.record(G.string(),G.unknown()).optional().describe('Arguments passed to the MCP tool. String values support ${path} interpolation from the hook input JSON (e.g. "${tool_input.file_path}").'),if:JLe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific tool call"),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),n=G.object({type:G.literal("http").describe("HTTP hook type"),url:G.string().url().describe("URL to POST the hook input JSON to"),if:JLe(),timeout:G.number().positive().optional().describe("Timeout in seconds for this specific request"),headers:G.record(G.string(),G.string()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:G.array(G.string()).optional().describe("Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work."),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")}),o=G.object({type:G.literal("agent").describe("Agentic verifier hook type"),prompt:G.string().describe('Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.'),if:JLe(),timeout:G.number().positive().optional().describe("Timeout in seconds for agent execution (default 60)"),model:G.string().optional().describe('Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.'),statusMessage:G.string().optional().describe("Custom status message to display in spinner while hook runs"),once:G.boolean().optional().describe("If true, hook runs once and is removed after execution")});return{BashCommandHookSchema:t,PromptHookSchema:e,HttpHookSchema:n,AgentHookSchema:o,McpToolHookSchema:r}}function aHc(t){return QZi.has(t.toLowerCase())?!1:sHc.test(t)?!0:oHc.test(t)}function PHc(t){let e=wHc();return t.flatMap((r,n)=>{let o=e.safeParse(r);if(o.success)return[o.data];let s=RHc().safeParse(r).data?.name,c=o.error.issues.map(l=>`${l.path.join(".")}: ${l.message}`).join(", ");return s?(Wl(`Stubbing unparseable marketplace plugin entry (${s}): ${c}`,{level:"warn"}),[{name:s,source:{source:"unsupported"},strict:!0}]):(Wl(`Dropping unparseable marketplace plugin entry (index ${n}): ${c}`,{level:"warn"}),[])})}function YZi(){return qHc.filter(t=>hIt[t].buildGate())}function jHc(t){let e={};for(let r of t)e={...e,...hIt[r].shape()};return e}function HHc(t){let e={};for(let r of t)e={...e,...hIt[r].permissionsShape?.()};return e}function GHc(t){let e=[];for(let r of t)e.push(...hIt[r].permissionModes?.()??[]);return e}function $Hc(t){let e=t.split("__"),[r,n,...o]=e;if(r!=="mcp"||!n)return null;let s=o.length>0?o.join("__"):void 0;return{serverName:n,toolName:s}}function EEe(t){return Object.hasOwn(w$i,t)?w$i[t]:t}function VHc(t){return t.replaceAll("\\(","(").replaceAll("\\)",")").replaceAll("\\\\","\\")}function WHc(t){let e=zHc(t,"(");if(e===-1)return{toolName:EEe(t)};let r=YHc(t,")");if(r===-1||r<=e)return{toolName:EEe(t)};if(r!==t.length-1)return{toolName:EEe(t)};let n=t.substring(0,e),o=t.substring(e+1,r);if(!n)return{toolName:EEe(t)};if(o===""||o==="*")return{toolName:EEe(n)};let s=VHc(o);return{toolName:EEe(n),ruleContent:s}}function zHc(t,e){for(let r=0;r=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function YHc(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]===e){let n=0,o=r-1;for(;o>=0&&t[o]==="\\";)n++,o--;if(n%2===0)return r}return-1}function KHc(t){return _Tt.filePatternTools.includes(t)}function JHc(t){return _Tt.bashPrefixTools.includes(t)}function ZHc(t){return Object.hasOwn(_Tt.customValidation,t)?_Tt.customValidation[t]:void 0}function JZi(t,e){let r=0,n=e-1;for(;n>=0&&t[n]==="\\";)r++,n--;return r%2!==0}function ABr(t,e){let r=0;for(let n=0;n0?{valid:!1,error:"MCP rules do not support patterns in parentheses",suggestion:`Use "${n.toolName}" without parentheses, or use "mcp__${o.serverName}__*" for all tools`,examples:[`mcp__${o.serverName}`,`mcp__${o.serverName}__*`,o.toolName&&o.toolName!=="*"?`mcp__${o.serverName}__${o.toolName}`:void 0].filter(Boolean)}:{valid:!0};if(!n.toolName||n.toolName.length===0)return{valid:!1,error:"Tool name cannot be empty"};if(!n.toolName.includes("_")&&n.toolName[0]!==n.toolName[0]?.toUpperCase())return{valid:!1,error:"Tool names must start with uppercase",suggestion:`Use "${F3c(String(n.toolName))}"`};let s=ZHc(n.toolName);if(s&&n.ruleContent!==void 0){let c=s(n.ruleContent);if(!c.valid)return c}if(JHc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*")&&!c.endsWith(":*"))return{valid:!1,error:"The :* pattern must be at the end",suggestion:"Move :* to the end for prefix matching, or use * for wildcard matching",examples:["Bash(npm run:*) - prefix matching (legacy)","Bash(npm run *) - wildcard matching"]};if(c===":*")return{valid:!1,error:"Prefix cannot be empty before :*",suggestion:"Specify a command prefix before :*",examples:["Bash(npm *)","Bash(git *)"]}}if(KHc(n.toolName)&&n.ruleContent!==void 0){let c=n.ruleContent;if(c.includes(":*"))return{valid:!1,error:'The ":*" syntax is only for Bash prefix rules',suggestion:'Use glob patterns like "*" or "**" for file matching',examples:[`${n.toolName}(*.ts) - matches .ts files`,`${n.toolName}(src/**) - matches all files in src`,`${n.toolName}(**/*.test.ts) - matches test files`]};if(c.includes("*")&&!c.match(/^\*|\*$|\*\*|\/\*|\*\.|\*\)/)&&!c.includes("**"))return{valid:!1,error:"Wildcard placement might be incorrect",suggestion:"Wildcards are typically used at path boundaries",examples:[`${n.toolName}(*.js) - all .js files`,`${n.toolName}(src/*) - all files directly in src`,`${n.toolName}(src/**) - all files recursively in src`]}}return{valid:!0}}function XZi(t){return G.object({allow:G.array(yBr()).optional().describe("List of permission rules for allowed operations"),deny:G.array(yBr()).optional().describe("List of permission rules for denied operations"),ask:G.array(yBr()).optional().describe("List of permission rules that should always prompt for confirmation"),defaultMode:G.enum([...P8r,...GHc(t)]).optional().describe("Default permission mode when Claude Code needs access"),disableBypassPermissionsMode:G.enum(["disable"]).optional().describe("Disable the ability to bypass permission prompts"),...HHc(t),additionalDirectories:G.array(G.string()).optional().describe("Additional directories to include in the permission scope")}).passthrough()}function nGc(t){return G.object({$schema:G.literal(QHc).optional().describe("JSON Schema reference for Claude Code settings"),apiKeyHelper:G.string().optional().describe("Path to a script that outputs authentication values"),proxyAuthHelper:G.string().optional().describe("Shell command that outputs a Proxy-Authorization header value (EAP)"),awsCredentialExport:G.string().optional().describe("Path to a script that exports AWS credentials"),awsAuthRefresh:G.string().optional().describe("Path to a script that refreshes AWS authentication"),gcpAuthRefresh:G.string().optional().describe("Command to refresh GCP authentication (e.g., gcloud auth application-default login)"),policyHelper:rGc().optional().describe("Executable that computes managed settings at startup. Honored only from admin-controlled policy sources."),...QE(process.env.CLAUDE_CODE_ENABLE_XAA)&&{xaaIdp:G.object({issuer:G.string().url().describe("IdP issuer URL for OIDC discovery"),clientId:G.string().describe("Claude Code's client_id registered at the IdP"),callbackPort:G.number().int().positive().optional().describe("Fixed loopback callback port for the IdP OIDC login. Only needed if the IdP does not honor RFC 8252 port-any matching.")}).optional().describe("XAA (SEP-990) IdP connection. Configure once; all XAA-enabled MCP servers reuse this.")},fileSuggestion:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom file suggestion configuration for @ mentions"),respectGitignore:G.boolean().optional().describe("Whether file picker should respect .gitignore files (default: true). Note: .ignore files are always respected."),breakReminder:G.object({enabled:G.boolean().optional().describe("Show a friendly nudge after sustained continuous use (default false). Must be true for the reminder to fire."),intervalMinutes:G.number().int().positive().optional().describe("Minutes of continuous use before the reminder fires (default 120). Re-fires every interval until you take a break."),breakThresholdMinutes:G.number().int().positive().optional().describe("Minutes of inactivity that count as a break and reset the timer (default 15)"),message:G.string().optional().describe("Custom reminder text. Leave unset for a rotating set of friendly nudges.")}).optional().describe("@internal Opt-in break reminder. When enabled, shows a dismissible nudge after sustained continuous use. Never blocks \u2014 just a friendly heads-up."),quietHours:G.object({enabled:G.boolean().optional().describe("Show a one-time nudge when you start or keep using the CLI inside your quiet-hours window (default false)."),start:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "22:00")').optional().describe('Start of the quiet-hours window, 24-hour local time "HH:MM".'),end:G.string().regex(/^([01]?\d|2[0-3]):[0-5]\d$/,'Expected 24-hour local time "HH:MM" (e.g. "07:00")').optional().describe('End of the quiet-hours window, 24-hour local time "HH:MM". May be earlier than start for an overnight range.')}).optional().describe("@internal Opt-in quiet hours. When enabled, shows a single soft nudge per session while inside the configured local-time window. Never blocks."),cleanupPeriodDays:G.number().int().positive().optional().describe("Number of days to retain chat transcripts before automatic cleanup (default: 30). Minimum 1. Use a large value for long retention; use --no-session-persistence to disable transcript writes entirely."),skillListingMaxDescChars:G.number().int().positive().optional().describe("Per-skill description character cap in the skill listing sent to Claude (default: 1536). Descriptions longer than this are truncated. Raise to opt in to higher per-turn context cost."),skillListingBudgetFraction:G.number().gt(0).lte(1).optional().describe("Fraction of the context window (in characters) reserved for the skill listing sent to Claude (default: 0.01 = 1%). When the listing exceeds this, descriptions are shortened to fit. Raise to opt in to higher per-turn context cost."),wslInheritsWindowsSettings:G.boolean().optional().describe("When set to true in either admin-only Windows source \u2014 the HKLM SOFTWARE/Policies/ClaudeCode registry key or C:/Program Files/ClaudeCode/managed-settings.json \u2014 WSL reads managed settings from the full Windows policy chain (HKLM, C:/Program Files/ClaudeCode via DrvFs, HKCU) in addition to /etc/claude-code. Windows sources take priority. The flag is also required in HKCU itself for HKCU policy to apply on WSL (double opt-in: admin enables the chain, user confirms HKCU). On native Windows the flag has no effect."),env:eGc().optional().describe("Environment variables to set for Claude Code sessions"),attribution:G.object({commit:G.string().optional().describe("Attribution text for git commits, including any trailers. Empty string hides attribution."),pr:G.string().optional().describe("Attribution text for pull request descriptions. Empty string hides attribution.")}).optional().describe("Customize attribution text for commits and PRs. Each field defaults to the standard Claude Code attribution if not set."),includeCoAuthoredBy:G.boolean().optional().describe("Deprecated: Use attribution instead. Whether to include Claude's co-authored by attribution in commits and PRs (defaults to true)"),includeGitInstructions:G.boolean().optional().describe("Include built-in commit and PR workflow instructions in Claude's system prompt (default: true)"),permissions:XZi(t).optional().describe("Tool usage permissions configuration"),model:G.string().optional().describe("Override the default model used by Claude Code"),availableModels:G.array(G.string()).optional().describe('Allowlist of models that users can select. Accepts family aliases ("opus" allows any opus version), version prefixes ("opus-4-5" allows only that version), and full model IDs. If undefined, all models are available. If empty array, only the default model is available. Typically set in managed settings by enterprise administrators.'),modelOverrides:G.record(G.string(),G.string()).optional().describe('Override mapping from Anthropic model ID (e.g. "claude-opus-4-6") to provider-specific model ID (e.g. a Bedrock inference profile ARN). Typically set in managed settings by enterprise administrators.'),enableAllProjectMcpServers:G.boolean().optional().describe("Whether to automatically approve all MCP servers in the project"),enabledMcpjsonServers:G.array(G.string()).optional().describe("List of approved MCP servers from .mcp.json"),disabledMcpjsonServers:G.array(G.string()).optional().describe("List of rejected MCP servers from .mcp.json"),skillOverrides:G.record(G.string(),G.enum(["on","name-only","user-invocable-only","off"])).optional().describe('Per-skill listing overrides keyed by skill name. "name-only" lists the skill without its description; "user-invocable-only" hides it from the model but keeps /name; "off" hides it from both. Absent = on.'),allowedMcpServers:G.array(eXi()).optional().describe("Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied."),deniedMcpServers:G.array(tXi()).optional().describe("Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied."),hooks:yTt().optional().describe("Custom commands to run before/after tool executions"),worktree:G.object({symlinkDirectories:G.array(G.string()).optional().describe('Directories to symlink from main repository to worktrees to avoid disk bloat. Must be explicitly configured - no directories are symlinked by default. Common examples: "node_modules", ".cache", ".bin"'),sparsePaths:G.array(G.string()).optional().describe("Directories to include when creating worktrees, via git sparse-checkout (cone mode). Dramatically faster in large monorepos \u2014 only the listed paths are written to disk."),baseRef:G.enum(["fresh","head"]).optional().describe("Which ref new worktrees branch from. 'fresh' (default) branches from origin/ for a clean tree. 'head' branches from your current local HEAD so unpushed commits and feature-branch state are present. Applies to --worktree, EnterWorktree, and agent isolation."),bgIsolation:G.enum(["worktree","none"]).optional().catch(void 0).describe("Isolation mode for background sessions in this repo. 'worktree' (default) blocks Edit/Write in the main checkout until EnterWorktree is called. 'none' lets background jobs edit the working copy directly.")}).optional().describe("Git worktree configuration for --worktree flag."),disableAllHooks:G.boolean().optional().describe("Disable all hooks and statusLine execution"),disableAgentView:G.boolean().optional().describe("Disable agent view (`claude agents`, `--bg`, /background, the on-demand daemon). Typically set in managed settings. Equivalent to CLAUDE_CODE_DISABLE_AGENT_VIEW=1."),disableRemoteControl:G.boolean().optional().describe("Disable Remote Control (claude.ai/code, `claude remote-control`, `--remote-control`/`--rc`, auto-start, and the in-session toggle). Typically set in managed settings."),disableWorkflows:G.boolean().optional().describe("Disable the Workflows feature (also via CLAUDE_CODE_DISABLE_WORKFLOWS)."),enableWorkflows:G.boolean().optional().describe("Enable or disable the Workflows feature for this user. Unset = default by plan once the feature is available."),workflowKeywordTriggerEnabled:G.boolean().optional().describe('Enable the "workflow"/"workflows" keyword trigger that opts a prompt into the Workflow tool. Set to false to type the word without triggering a workflow. Default: true.'),disableSkillShellExecution:G.boolean().optional().describe("Disable inline shell execution in skills and custom slash commands from user, project, or plugin sources. Commands are replaced with a placeholder instead of being run."),defaultShell:G.enum(["bash","powershell"]).optional().describe("Default shell for input-box ! commands. Defaults to 'bash' on all platforms (no Windows auto-flip)."),allowManagedHooksOnly:G.boolean().optional().describe("When true (and set in managed settings), only hooks from managed settings run. User, project, and local hooks are ignored."),allowedHttpHookUrls:G.array(G.string()).optional().describe('Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard (e.g. "https://hooks.example.com/*"). When set, HTTP hooks with non-matching URLs are blocked. If undefined, all URLs are allowed. If empty array, no HTTP hooks are allowed. Arrays merge across settings sources (same semantics as allowedMcpServers).'),httpHookAllowedEnvVars:G.array(G.string()).optional().describe("Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. If undefined, no restriction is applied. Arrays merge across settings sources (same semantics as allowedMcpServers)."),allowManagedPermissionRulesOnly:G.boolean().optional().describe("When true (and set in managed settings), only permission rules (allow/deny/ask) from managed settings are respected. User, project, local, and CLI argument permission rules are ignored."),allowManagedMcpServersOnly:G.boolean().optional().describe("When true (and set in managed settings), allowedMcpServers is only read from managed settings. deniedMcpServers still merges from all sources, so users can deny servers for themselves. Users can still add their own MCP servers, but only the admin-defined allowlist applies."),allowAllClaudeAiMcps:G.boolean().optional().describe("When true (and set in managed settings), claude.ai cloud MCP connectors load alongside managed-mcp.json instead of being suppressed by its exclusive-control lockdown. Default off preserves the lockdown. Read from managed settings only."),strictPluginOnlyCustomization:G.preprocess(e=>Array.isArray(e)?e.filter(r=>R$i.includes(r)):e,G.union([G.boolean(),G.array(G.enum(R$i))])).optional().catch(void 0).describe('When set in managed settings, blocks non-plugin customization sources for the listed surfaces. Array form locks specific surfaces (e.g. ["skills", "hooks"]); `true` locks all four; `false` is an explicit no-op. Blocked: ~/.claude/{surface}/, .claude/{surface}/ (project), settings.json hooks, .mcp.json. NOT blocked: managed (policySettings) sources, plugin-provided customizations. Composes with strictKnownMarketplaces for end-to-end admin control \u2014 plugins gated by marketplace allowlist, everything else blocked here.'),statusLine:G.object({type:G.literal("command"),command:G.string(),padding:G.number().optional(),refreshInterval:G.number().min(1).optional().catch(void 0).describe("Re-run the status line command every N seconds in addition to event-driven updates"),hideVimModeIndicator:G.boolean().optional().describe("Hide the built-in `-- INSERT --` / `-- VISUAL --` indicator below the prompt. Use this when your status line script renders `vim.mode` itself.")}).optional().describe("Custom status line display configuration"),prUrlTemplate:G.string().optional().describe('URL template for PR links in the footer badge and inline messages. Placeholders: {host} {owner} {repo} {number} {url}. Example: "https://reviews.example.com/{owner}/{repo}/pull/{number}"'),subagentStatusLine:G.object({type:G.literal("command"),command:G.string()}).optional().describe("Custom per-subagent status line shown in the agent panel; receives row context as JSON on stdin"),enabledPlugins:G.record(G.string(),G.union([G.array(G.string()),G.boolean(),G.undefined()])).optional().describe('Enabled plugins using plugin-id@marketplace-id format. Example: { "formatter@anthropic-tools": true }. Also supports extended format with version constraints. Settings precedence is user < project < local < flag < policy, so to disable a plugin that project settings enable, set it to false in .claude/settings.local.json \u2014 setting false in ~/.claude/settings.json is overridden by the project.'),extraKnownMarketplaces:G.record(G.string(),tGc()).check(e=>{for(let[r,n]of Object.entries(e.value))n.source.source==="settings"&&n.source.name!==r&&e.issues.push({code:"custom",input:n.source.name,path:[r,"source","name"],message:`Settings-sourced marketplace name must match its extraKnownMarketplaces key (got key "${r}" but source.name "${n.source.name}")`})}).optional().describe("Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources."),strictKnownMarketplaces:G.array(ETt()).optional().describe("Enterprise strict list of allowed marketplace sources. When set in managed settings, ONLY these exact sources can be added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem. Note: this is a policy gate only \u2014 it does NOT register marketplaces. To pre-register allowed marketplaces for users, also set extraKnownMarketplaces."),blockedMarketplaces:G.array(ETt()).optional().describe("Enterprise blocklist of marketplace sources. When set in managed settings, these exact sources are blocked from being added as marketplaces. The check happens BEFORE downloading, so blocked sources never touch the filesystem."),pluginSuggestionMarketplaces:G.array(G.string()).optional().describe("Marketplace names whose plugins may surface as contextual install suggestions (relevance-based tips), in addition to the official marketplace. Only honored when set in managed settings (policy scope); the key is ignored in user, project, and local settings. A name only takes effect when the marketplace is registered on the machine AND its registered source is also declared in managed settings, either as the extraKnownMarketplaces entry for that name or as an entry of strictKnownMarketplaces. A marketplace registered from a different source under an allowlisted name is ignored."),forceLoginMethod:G.enum(["claudeai","console"]).optional().describe('Force a specific login method: "claudeai" for Claude Pro/Max, "console" for Console billing'),parentSettingsBehavior:G.enum(["first-wins","merge"]).optional().describe(`Controls whether the SDK parent tier (Options.managedSettings / --managed-settings) layers under this admin tier. "first-wins" (default): parent is dropped \u2014 admin tiers are the only policy source. "merge": parent's restrictive-only-filtered settings union under the admin winner. Has no effect when no admin tier exists (parent applies as the sole policy tier, still filtered restrictive-only).`),forceLoginOrgUUID:G.union([G.string(),G.array(G.string())]).optional().describe("Organization UUID to require for OAuth login. Accepts a single UUID string or an array of UUIDs (any one is permitted). When set in managed settings, login fails if the authenticated account does not belong to a listed organization."),forceRemoteSettingsRefresh:G.boolean().optional().describe("When set in managed settings, the CLI blocks startup until remote managed settings are freshly fetched, and exits if the fetch fails"),otelHeadersHelper:G.string().optional().describe("Path to a script that outputs OpenTelemetry headers"),outputStyle:G.string().optional().describe("Controls the output style for assistant responses"),viewMode:G.enum(["default","verbose","focus"]).optional().catch(void 0).describe("Default transcript view mode on startup"),language:G.string().optional().describe('Preferred language for Claude responses and voice dictation (e.g., "japanese", "spanish")'),skipWebFetchPreflight:G.boolean().optional().describe("Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"),sandbox:Ljc().optional(),feedbackSurveyRate:G.number().min(0).max(1).optional().describe("Probability (0\u20131) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),spinnerTipsEnabled:G.boolean().optional().describe("Whether to show tips in the spinner"),spinnerVerbs:G.object({mode:G.enum(["append","replace"]),verbs:G.array(G.string())}).optional().describe('Customize spinner verbs. mode: "append" adds verbs to defaults, "replace" uses only your verbs.'),spinnerTipsOverride:G.object({excludeDefault:G.boolean().optional(),tips:G.array(G.string())}).optional().describe("Override spinner tips. tips: array of tip strings. excludeDefault: if true, only show custom tips (default: false)."),syntaxHighlightingDisabled:G.boolean().optional().describe("Whether to disable syntax highlighting in diffs"),terminalTitleFromRename:G.boolean().optional().describe("Whether /rename updates the terminal tab title (defaults to true). Set to false to keep auto-generated topic titles."),alwaysThinkingEnabled:G.boolean().optional().describe("When false, thinking is disabled. When absent or true, thinking is enabled automatically for supported models."),effortLevel:G.enum(["low","medium","high","xhigh"]).optional().catch(void 0).describe("Persisted effort level for supported models."),ultracode:G.boolean().optional().catch(void 0).describe("Enable ultracode for the session: xhigh effort plus standing dynamic-workflow orchestration. Session-scoped \u2014 typically provided via --settings or the apply_flag_settings control request; interactive toggles never persist it. Requires workflows to be enabled and an xhigh-capable model."),autoCompactWindow:G.number().int().min(1e5).max(1e6).optional().catch(void 0).describe("Auto-compact window size"),advisorModel:G.string().optional().describe("Advisor model for the server-side advisor tool."),fastMode:G.boolean().optional().describe("When true, fast mode is enabled. When absent or false, fast mode is off."),fastModePerSessionOptIn:G.boolean().optional().describe("When true, fast mode does not persist across sessions. Each session starts with fast mode off."),promptSuggestionEnabled:G.boolean().optional().describe("When false, prompt suggestions are disabled. When absent or true, prompt suggestions are enabled."),awaySummaryEnabled:G.boolean().optional().describe("@internal When false, the session recap (shown when you return after being away for 5+ minutes) is disabled. When absent or true, recap is enabled. Hidden from public SDK types until external launch."),showClearContextOnPlanAccept:G.boolean().optional().describe('When true, the plan-approval dialog offers a "clear context" option. Defaults to false.'),agent:G.string().optional().describe("Name of an agent (built-in or custom) to use for the main thread. Applies the agent's system prompt, tool restrictions, and model."),companyAnnouncements:G.array(G.string()).optional().describe("Company announcements to display at startup (one will be randomly selected if multiple are provided)"),pluginConfigs:G.record(G.string(),G.object({mcpServers:G.record(G.string(),G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]))).optional().describe("User configuration values for MCP servers keyed by server name"),options:G.record(G.string(),G.union([G.string(),G.number(),G.boolean(),G.array(G.string())])).optional().describe("Non-sensitive option values from plugin manifest userConfig, keyed by option name. Sensitive values go to secure storage instead.")})).optional().describe("Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format)"),remote:G.object({defaultEnvironmentId:G.string().optional().describe("Default environment ID to use for remote sessions")}).optional().describe("Remote session configuration"),autoUpdatesChannel:G.enum(["latest","stable","rc"]).optional().describe("Release channel for auto-updates (latest or stable)"),minimumVersion:G.string().optional().describe("Minimum version to stay on - prevents downgrades when switching to stable channel"),plansDirectory:G.string().optional().describe("Custom directory for plan files, relative to project root. If not set, defaults to ~/.claude/plans/"),tui:G.enum(["default","fullscreen"]).optional().describe('Terminal UI renderer. "fullscreen" uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1). "default" uses the classic main-screen renderer.'),voice:G.object({enabled:G.boolean().optional(),mode:G.enum(["hold","tap"]).optional().describe("'hold' (default): hold to talk. 'tap': tap to start, tap to stop+submit."),autoSubmit:G.boolean().optional().describe("Submit the prompt when hold-to-talk is released (hold mode only)")}).optional().describe("Voice mode settings (hold-to-talk / tap-to-toggle dictation)"),channelsEnabled:G.boolean().optional().describe("Managed-org opt-in for channel notifications (MCP servers with the claude/channel capability pushing inbound messages). claude.ai Teams/Enterprise: default off. Console: default on unless managed settings exist. Set true to allow; users then select servers via --channels."),allowedChannelPlugins:G.array(G.object({marketplace:G.string(),plugin:G.string()})).optional().describe("Managed-org allowlist of channel plugins. When set, replaces the default Anthropic allowlist \u2014 admins decide which plugins may push inbound messages. Undefined falls back to the default. Requires channelsEnabled: true."),prefersReducedMotion:G.boolean().optional().describe("Reduce or disable animations for accessibility (spinner shimmer, flash effects, etc.)"),doneMeansMerged:G.boolean().optional().describe("@internal When true, Claude keeps working until the PR is ready for you to merge, a cron/Monitor is armed to resume later, or it hands you a self-contained next step."),autoMemoryEnabled:G.boolean().optional().describe("Enable auto-memory for this project. When false, Claude will not read from or write to the auto-memory directory."),autoMemoryDirectory:G.string().optional().describe("Custom directory path for auto-memory storage. Supports ~/ prefix for home directory expansion. Ignored if set in projectSettings (checked-in .claude/settings.json) for security. When unset, defaults to ~/.claude/projects//memory/."),autoDreamEnabled:G.boolean().optional().describe("Enable background memory consolidation (auto-dream). When set, overrides the server-side default."),showThinkingSummaries:G.boolean().optional().describe("Request API-side thinking summaries and show them in the conversation and in the transcript view (ctrl+o). Set explicitly to override the default for your install."),skipDangerousModePermissionPrompt:G.boolean().optional().describe("Whether the user has accepted the bypass permissions mode dialog"),skipWorkflowUsageWarning:G.boolean().optional().describe("@internal Whether the user has accepted the multi-agent workflow usage warning. Until set, auto permission mode prompts before running a workflow."),disableAutoMode:G.enum(["disable"]).optional().describe("Disable auto mode"),sshConfigs:G.array(G.object({id:G.string().describe("Unique identifier for this SSH config. Used to match configs across settings sources."),name:G.string().describe("Display name for the SSH connection"),sshHost:G.string().describe('SSH host in format "user@hostname" or "hostname", or a host alias from ~/.ssh/config'),sshPort:G.number().int().optional().describe("SSH port (default: 22)"),sshIdentityFile:G.string().optional().describe("Path to SSH identity file (private key)"),startDirectory:G.string().optional().describe("Default working directory on the remote host. Supports tilde expansion (e.g. ~/projects). If not specified, defaults to the remote user home directory. Can be overridden by the [dir] positional argument in `claude ssh [dir]`.")})).optional().describe("SSH connection configurations for remote environments. Typically set in managed settings by enterprise administrators to pre-configure SSH connections for team members."),claudeMd:G.string().optional().describe("CLAUDE.md-style instructions injected as organization-managed memory. Only honored from managed/policy settings."),claudeMdExcludes:G.array(G.string()).optional().describe('Glob patterns or absolute paths of CLAUDE.md files to exclude from loading. Patterns are matched against absolute file paths using picomatch. Only applies to User, Project, and Local memory types (Managed/policy files cannot be excluded). Examples: "/home/user/monorepo/CLAUDE.md", "**/code/CLAUDE.md", "**/some-dir/.claude/rules/**"'),pluginTrustMessage:G.string().optional().describe('Custom message to append to the plugin trust warning shown before installation. Only read from policy settings (managed-settings.json / MDM). Useful for enterprise administrators to add organization-specific context (e.g., "All plugins from our internal marketplace are vetted and approved.").'),theme:G.union([G.enum(jjc),G.string().startsWith("custom:").transform(e=>e)]).optional().catch(void 0).describe("Color theme for the UI"),editorMode:G.enum(Ujc).optional().catch(void 0).describe("Key binding mode for the prompt input"),verbose:G.boolean().optional().describe("Show full tool output instead of truncated summaries"),preferredNotifChannel:G.enum(Fjc).optional().catch(void 0).describe("Preferred OS notification channel"),autoCompactEnabled:G.boolean().optional().describe("Automatically compact conversation when context fills"),autoScrollEnabled:G.boolean().optional().describe("Auto-scroll the conversation view to bottom (fullscreen mode only)"),fileCheckpointingEnabled:G.boolean().optional().describe("Snapshot files before edits so /rewind can restore them"),showTurnDuration:G.boolean().optional().describe('Show "Cooked for Nm Ns" after each assistant turn'),showMessageTimestamps:G.boolean().optional().describe("Stamp each assistant message with its arrival time"),terminalProgressBarEnabled:G.boolean().optional().describe("Emit OSC 9;4 progress sequences during long operations"),todoFeatureEnabled:G.boolean().optional().describe("Enable the todo / task tracking panel"),teammateMode:G.enum(Qjc).optional().catch(void 0).describe("How spawned teammates execute (tmux, in-process, auto)"),remoteControlAtStartup:G.boolean().optional().describe("Start Remote Control bridge automatically each session"),isolatePeerMachines:G.boolean().optional().describe("Require explicit approval before SendMessage can reach a peer session on another machine via Remote Control"),daemonColdStart:G.enum(["transient","ask"]).optional().describe("When no background service is running: 'transient' spawns one for this login session; 'ask' offers to install it persistently"),autoUploadSessions:G.boolean().optional().describe("Mirror local sessions to claude.ai as view-only (no remote control)"),inputNeededNotifEnabled:G.boolean().optional().describe("Push to mobile when a permission prompt or question is waiting"),agentPushNotifEnabled:G.boolean().optional().describe("Allow Claude to push proactive mobile notifications"),...jHc(t)}).passthrough()}function sGc(t){let e=iGc.find(n=>n.matches(t));if(!e)return null;let r={...e.tip};return t.code==="invalid_value"&&t.enumValues&&!r.suggestion&&(r.suggestion=`Valid values: ${t.enumValues.map(n=>`"${n}"`).join(", ")}`),!r.docLink&&t.path&&(r.docLink=oGc[Q3c(t.path,".")]),r}function P$i(t){return t.code==="invalid_type"}function k$i(t){return t.code==="invalid_value"}function aGc(t){return t.code==="unrecognized_keys"}function D$i(t){return t.code==="too_small"}function REe(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function N$i(t){let e=t.match(/received (\w+)/);return e?e[1]:void 0}function oFe(t,e){return t.issues.map(r=>{let n=r.path.map(String).join("."),o=r.message,s,c,l,u,d;if(k$i(r))c=r.values.map(h=>String(h)),l=c.join(" | "),u=void 0,d=void 0;else if(P$i(r)){l=r.expected;let h=N$i(r.message);u=h??REe(r.input),d=h??REe(r.input)}else D$i(r)?l=String(r.minimum):r.code==="custom"&&"params"in r&&(u=r.params.received,d=u);let f=sGc({path:n,code:r.code,expected:l,received:u,enumValues:c,message:r.message,value:u});if(k$i(r))s=c?.map(h=>`"${h}"`).join(", "),o=`Invalid value. Expected one of: ${s}`;else if(P$i(r)){let h=N$i(r.message)??REe(r.input);r.expected==="object"&&h==="null"&&n===""?o="Invalid or malformed JSON":o=`Expected ${r.expected}, but received ${h}`}else if(aGc(r)){let h=r.keys.join(", ");o=`Unrecognized ${U3c(r.keys.length,"field")}: ${h}`}else D$i(r)&&(o=`Number must be greater than or equal to ${r.minimum}`,s=String(r.minimum));return{file:e,path:n,message:o,expected:s,invalidValue:d,suggestion:f?.suggestion,docLink:f?.docLink}})}function cGc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!r.permissions||typeof r.permissions!="object")return[];let n=r.permissions,o=[];for(let s of["allow","deny","ask"]){let c=n[s];Array.isArray(c)&&(n[s]=c.filter(l=>{if(typeof l!="string")return o.push({file:e,path:`permissions.${s}`,message:`Non-string value in ${s} array was removed`,severity:"warning",invalidValue:l}),!1;let u=ZZi(l);if(!u.valid){let d=`Invalid permission rule "${l}" was skipped: ${u.error}`;return u.suggestion&&(d+=`. ${u.suggestion}`),o.push({file:e,path:`permissions.${s}`,message:d,severity:"warning",invalidValue:l}),!1}return!0}))}return o}function uGc(t,e){if(!t||typeof t!="object")return[];let r=t;if(!("hooks"in r))return[];if(r.hooks===null||typeof r.hooks!="object"||Array.isArray(r.hooks)){let s=REe(r.hooks);return delete r.hooks,[{file:e,path:"hooks",message:`"hooks" must be an object mapping event names to matcher arrays; received ${s}. This field was ignored.`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"}]}let n=r.hooks,o=[];for(let s of Object.keys(n)){if(!lGc.has(s)){delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Unknown hook event "${s}" was ignored. Valid events: ${MTt.join(", ")}`,severity:"warning",invalidValue:s,docLink:"https://code.claude.com/docs/en/hooks"});continue}if(!Array.isArray(n[s])){let c=REe(n[s]);delete n[s],o.push({file:e,path:`hooks.${s}`,message:`Hook event "${s}" must be an array of matchers; received ${c}. This entry was ignored.`,severity:"warning",invalidValue:c,docLink:"https://code.claude.com/docs/en/hooks"})}}return o.length>0&&Object.keys(n).length===0&&delete r.hooks,o}function fGc(t,e){if(!t||typeof t!="object")return[];let r=t,n=[];for(let{key:o,schema:s}of dGc){if(!(o in r))continue;if(!Array.isArray(r[o])){let u=r[o];delete r[o],n.push({file:e,path:o,message:`"${o}" must be an array; received ${REe(u)}. This field was ignored.`,severity:"warning",invalidValue:u});continue}let c=r[o],l=[];for(let u=0;u{try{(0,iXi.execFile)(t,e,{encoding:"utf-8",timeout:mGc},(n,o)=>{r({stdout:o??"",code:n?1:0})})}catch{r({stdout:"",code:1})}})}function yGc(){return(async()=>{if(process.platform==="darwin"){let t=gGc(),e=(await Promise.all(t.map(async({path:r,label:n})=>{if(!(0,oXi.existsSync)(r))return{stdout:"",label:n,ok:!1};let{stdout:o,code:s}=await ZLe(pGc,[...hGc,r]);return{stdout:o,label:n,ok:s===0&&!!o}}))).find(r=>r.ok);return{plistStdouts:e?[{stdout:e.stdout,label:e.label}]:[],hklmStdout:null,hkcuStdout:null}}if(process.platform==="win32"){let t=`${process.env.SYSTEMROOT||"C:\\Windows"}\\System32\\reg.exe`,[e,r]=await Promise.all([ZLe(t,["query",MLr,"/v",TEe]),ZLe(t,["query",OLr,"/v",TEe])]);return{plistStdouts:null,hklmStdout:e.code===0?e.stdout:null,hkcuStdout:r.code===0?r.stdout:null}}if(nXi()){let[t,e]=await Promise.all([ZLe(O$i,["query",MLr,"/v",TEe]),ZLe(O$i,["query",OLr,"/v",TEe])]);return{plistStdouts:null,hklmStdout:t.code===0?t.stdout:null,hkcuStdout:e.code===0?e.stdout:null}}return{plistStdouts:null,hklmStdout:null,hkcuStdout:null}})()}function EGc(){return AGc}function _Gc(){CTt||(CTt=(async()=>{let t=Date.now(),e=EGc()??yGc(),{mdm:r,hkcu:n,wslInherits:o}=TGc(await e);sXi=r,aXi=n,cXi=o;let s=Date.now()-t;if(Wl(`MDM settings load completed in ${s}ms`),Object.keys(r.settings).length>0){Wl(`MDM settings found: ${Object.keys(r.settings).join(", ")}`);try{ILr("info","mdm_settings_loaded",{duration_ms:s,key_count:Object.keys(r.settings).length,error_count:r.errors.length})}catch{}}})())}async function vGc(){CTt||_Gc(),await CTt}function CGc(){return sXi??cV}function bGc(){return aXi??cV}function SGc(){return cXi}function EBr(t,e){let r=gV(fIt(t,!1));if(!r||typeof r!="object")return{settings:{},errors:[]};let n=p_e(r,e),o=f_e().safeParse(r);if(!o.success){let s=oFe(o.error,e);return{settings:{},errors:[...n,...s]}}return{settings:o.data,errors:n}}function B$i(t,e="Settings"){let r=t.split(/\r?\n/),n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`^\\s+${n}\\s+REG_(?:EXPAND_)?SZ\\s+(.*)$`,"i");for(let s of r){let c=s.match(o);if(c&&c[1])return c[1].trimEnd()}return null}function TGc(t){let e=[];if(t.plistStdouts&&t.plistStdouts.length>0){let{stdout:c,label:l}=t.plistStdouts[0],u=EBr(c,l),{wslInheritsWindowsSettings:d,...f}=u.settings;if(Object.keys(f).length>0)return{mdm:u,hkcu:cV,wslInherits:!1};e.push(...u.errors)}let r=null;if(t.hklmStdout){let c=B$i(t.hklmStdout);c&&(r=EBr(c,`Registry: ${MLr}\\${TEe}`))}r&&e.push(...r.errors);let n=e.length>0?{settings:{},errors:e}:cV,o=nXi(),s=!1;if(o&&(s=r?.settings.wslInheritsWindowsSettings===!0||xGc(),!s))return{mdm:n,hkcu:cV,wslInherits:!1};if(r){let{wslInheritsWindowsSettings:c,...l}=r.settings;if(Object.keys(l).length>0)return{mdm:r,hkcu:cV,wslInherits:s}}if(IGc(s))return{mdm:n,hkcu:cV,wslInherits:s};if(t.hkcuStdout){let c=B$i(t.hkcuStdout);if(c){let l=EBr(c,`Registry: ${OLr}\\${TEe}`);if(!o||l.settings.wslInheritsWindowsSettings===!0){let{wslInheritsWindowsSettings:u,...d}=l.settings;return{mdm:n,hkcu:{settings:d,errors:l.errors},wslInherits:s}}if(l.errors.length>0)return{mdm:n,hkcu:{settings:{},errors:l.errors},wslInherits:s}}}return{mdm:n,hkcu:cV,wslInherits:s}}function IGc(t){return t&&F$i(vTt)?!0:F$i(Q3e())}function L$i(t){let e=gV(fIt(dIt(t),!1));if(!e||typeof e!="object")return!1;p_e(e,t);let{wslInheritsWindowsSettings:r,...n}=e;return Object.keys(n).length>0}function xGc(){function t(e){try{let r=fIt(dIt(e),!1);return!!r&&typeof r=="object"&&"wslInheritsWindowsSettings"in r&&r.wslInheritsWindowsSettings===!0}catch{return!1}}if(a(t,"$"),t((0,Fne.join)(vTt,"managed-settings.json")))return!0;try{let e=(0,Fne.join)(vTt,"managed-settings.d");for(let r of uI().readdirSync(e))if((r.isFile()||r.isSymbolicLink())&&r.name.endsWith(".json")&&!r.name.startsWith(".")&&t((0,Fne.join)(e,r.name)))return!0}catch{}return!1}function F$i(t){try{if(L$i((0,Fne.join)(t,"managed-settings.json")))return!0}catch{}try{let e=(0,Fne.join)(t,"managed-settings.d"),r=uI().readdirSync(e);for(let n of r)if(!(!(n.isFile()||n.isSymbolicLink())||!n.name.endsWith(".json")||n.name.startsWith(".")))try{if(L$i((0,Fne.join)(e,n.name)))return!0}catch{}}catch{}return!1}function wGc(t,e,r){(r!==void 0&&!OTt(t[e],r)||r===void 0&&!(e in t))&&a3r(t,e,r)}function RGc(t){return function(e,r,n){for(var o=-1,s=Object(e),c=n(e),l=c.length;l--;){var u=c[t?l:++o];if(r(s[u],u,s)===!1)break}return e}}function NGc(t){return s_e(t)&&u3r(t)}function QGc(t){if(!s_e(t)||j3e(t)!=OGc)return!1;var e=gWi(t);if(e===null)return!0;var r=FGc.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&lXi.call(r)==UGc}function jGc(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function HGc(t){return Z4c(t,pWi(t))}function $Gc(t,e,r,n,o,s,c){var l=LLr(t,r),u=LLr(e,r),d=c.get(u);if(d){BLr(t,r,d);return}var f=s?s(l,u,r+"",t,e,c):void 0,h=f===void 0;if(h){var m=mV(u),g=!m&&c3r(u),A=!m&&!g&&dWi(u);f=u,m||g||A?mV(l)?f=l:MGc(l)?f=hLc(l):g?(h=!1,f=mWi(u,!0)):A?(h=!1,f=CLc(u,!0)):f=[]:qGc(u)||y3e(u)?(f=l,y3e(l)?f=GGc(l):(!o9(l)||KLr(l))&&(f=ILc(u))):h=!1}h&&(c.set(u,f),o(f,u,n,s,c),c.delete(u)),BLr(t,r,f)}function uXi(t,e,r,n,o){t!==e&&DGc(e,function(s,c){if(o||(o=new $4c),o9(s))VGc(t,e,c,r,uXi,n,o);else{var l=n?n(LLr(t,c),s,c+"",t,e,o):void 0;l===void 0&&(l=s),BLr(t,c,l)}},pWi)}function zGc(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function KGc(t,e,r){return e=U$i(e===void 0?t.length-1:e,0),function(){for(var n=arguments,o=-1,s=U$i(n.length-e,0),c=Array(s);++o0){if(++e>=t$c)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function a$c(t,e){return fXi(dXi(t,e,yWi),t+"")}function l$c(t,e,r){if(!o9(r))return!1;var n=typeof e;return(n=="number"?u3r(r)&&UTt(e,r.length):n=="string"&&e in r)?OTt(r[e],t):!1}function d$c(t){return c$c(function(e,r){var n=-1,o=r.length,s=o>1?r[o-1]:void 0,c=o>2?r[2]:void 0;for(s=t.length>3&&typeof s=="function"?(o--,s):void 0,c&&u$c(r[0],r[1],c)&&(s=o<3?void 0:s,o=1),e=Object(e);++n0&&r(l)?e>1?pXi(l,e-1,r,n,o):gLc(o,l):n||(o[o.length]=l)}return o}function b$c(t){var e=t==null?0:t.length;return e?C$c(t,1):[]}function T$c(t){return fXi(dXi(t,void 0,S$c),t+"")}function P$c(){return void 0??(0,hXi.join)(i_e(),w$c)}function k$c(){try{let t=dIt(P$c()),e=dN(kZi(t));return!e||typeof e!="object"||Array.isArray(e)?null:e}catch{return null}}function D$c(){if(!void 0&&R$c!==!0)return null;if(vBr)return vBr;let t=k$c();return t?(vBr=t,m3r(),t):null}function D8r(t){let e=new Set(t.allowedSources);return e.add("flagSettings"),e.add("policySettings"),UHc.filter(r=>e.has(r))}function N$c(){return(0,py.join)(Q3e(),"managed-settings.json")}function mXi(t){if(pIt()==="wsl"&&t.wslInherits?.()){let e=CBr(vTt);if(e.settings)return e;let r=CBr(Q3e());return{settings:r.settings,errors:[...e.errors,...r.errors]}}return CBr(Q3e())}function CBr(t){let e=[],r={},n=!1,{settings:o,errors:s}=bTt((0,py.join)(t,"managed-settings.json"));e.push(...s),o&&Object.keys(o).length>0&&(r=dV(r,o,fV),n=!0);let c=(0,py.join)(t,"managed-settings.d");try{let d=uI().readdirSync(c).filter(f=>(f.isFile()||f.isSymbolicLink())&&f.name.endsWith(".json")&&!f.name.startsWith(".")).map(f=>f.name).sort();for(let f of d){let{settings:h,errors:m}=bTt((0,py.join)(c,f));e.push(...m),h&&Object.keys(h).length>0&&(r=dV(r,h,fV),n=!0)}}catch(d){let f=lI(d);f!=="ENOENT"&&f!=="ENOTDIR"&&Wl(`managed-settings.d read failed: ${d}`,{level:"error"})}let{wslInheritsWindowsSettings:l,...u}=r;return{settings:n&&Object.keys(u).length>0?r:null,errors:e}}function M$c(t,e){G3e(t)?Wl(`Broken symlink or missing file encountered for settings.json at path: ${e}`):Wl(`settings file read failed at ${e}: ${t}`,{level:"error"})}function bTt(t,e){let r=l3c(t);if(r)return{settings:r.settings?gV(r.settings):null,errors:r.errors};let n=O$c(t,e);return u3c(t,n),{settings:n.settings?gV(n.settings):null,errors:n.errors}}function gXi(t){if(!t.mdm)return{settings:null,errors:[]};let e=t.mdm();return{settings:Object.keys(e.settings).length>0?e.settings:null,errors:e.errors}}function AXi(t){let e=t?.remote?t.remote():D$c();if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=gV(e),n=p_e(r,"remote managed settings"),o=f_e().safeParse(r);return o.success?{settings:Object.keys(o.data).length>0?o.data:null,errors:n}:{settings:null,errors:[...n,...oFe(o.error,"remote managed settings")]}}function yXi(t){let e=t.parentManaged;if(!e||Object.keys(e).length===0)return{settings:null,errors:[]};let r=gV(e),n=p_e(r,"parent managed settings"),o=f_e().safeParse(r);return o.success?Object.keys(o.data).length>0?{settings:o.data,errors:n}:{settings:null,errors:n}:{settings:null,errors:[...n,...oFe(o.error,"parent managed settings")]}}function EXi(t){let e=t.flagInline;if(!e)return{settings:null,errors:[]};let r=gV(e),n=p_e(r,"SDK inline settings"),o=f_e().safeParse(r);return o.success?{settings:o.data,errors:n}:{settings:null,errors:[...n,...oFe(o.error,"SDK inline settings")]}}function O$c(t,e){try{let r;if(e!==void 0)r=e;else{let{resolvedPath:c}=CWi(uI(),t);r=dIt(c)}if(r.trim()==="")return{settings:{},errors:[]};let n=gV(fIt(r,!1)),o=p_e(n,t),s=f_e().safeParse(n);if(!s.success){let c=oFe(s.error,t);return{settings:null,errors:[...o,...c]}}return{settings:s.data,errors:o}}catch(r){return M$c(r,t),{settings:null,errors:[]}}}function q$i(t,e){switch(t){case"userSettings":return(0,py.resolve)(i_e());case"policySettings":case"projectSettings":case"localSettings":return(0,py.resolve)(e.cwd);case"flagSettings":return e.flagPath?(0,py.dirname)((0,py.resolve)(e.flagPath)):(0,py.resolve)(e.cwd)}}function B$c(t){return t.coworkPlugins||QE(process.env.CLAUDE_CODE_USE_COWORK_PLUGINS)?"cowork_settings.json":"settings.json"}function STt(t,e){switch(t){case"userSettings":return(0,py.join)(q$i(t,e),B$c(e));case"projectSettings":case"localSettings":return(0,py.join)(q$i(t,e),L$c(t));case"policySettings":return N$c();case"flagSettings":return e.flagPath}}function L$c(t){switch(t){case"projectSettings":return(0,py.join)(".claude","settings.json");case"localSettings":return(0,py.join)(".claude","settings.local.json")}}function _Xi(t,e){let r=s3c(t);if(r!==void 0)return r;let n=j$c(t,e);return a3c(t,n),n}function F$c(t){return!t||t.parentSettingsBehavior==="merge"}function U$c(t,e){let r={};t.allowManagedHooksOnly===!0&&(r.allowManagedHooksOnly=!0),t.allowManagedMcpServersOnly===!0&&(r.allowManagedMcpServersOnly=!0),t.allowManagedPermissionRulesOnly===!0&&(r.allowManagedPermissionRulesOnly=!0);let n=t.strictPluginOnlyCustomization;if((n===!0||Array.isArray(n)&&n.length>0)&&(r.strictPluginOnlyCustomization=n),t.deniedMcpServers&&(r.deniedMcpServers=t.deniedMcpServers),e.forceLoginOrgUUID===void 0&&t.forceLoginOrgUUID&&(r.forceLoginOrgUUID=t.forceLoginOrgUUID),e.allowedMcpServers===void 0&&t.allowedMcpServers&&(r.allowedMcpServers=t.allowedMcpServers),t.permissions){let o=_Br(t.permissions,["deny","ask"]);if(t.permissions.disableBypassPermissionsMode==="disable"&&(o.disableBypassPermissionsMode="disable"),e.allowManagedPermissionRulesOnly!==!0){let{allow:s,additionalDirectories:c}=t.permissions;s&&e.sandbox?.network?.allowManagedDomainsOnly!==!0&&(o.allow=s),c&&(o.additionalDirectories=c)}Object.keys(o).length>0&&(r.permissions=o)}if(t.sandbox){let{network:o,filesystem:s}=t.sandbox,c={};if(t.sandbox.enabled===!0&&(c.enabled=!0),t.sandbox.failIfUnavailable===!0&&(c.failIfUnavailable=!0),t.sandbox.allowUnsandboxedCommands===!1&&(c.allowUnsandboxedCommands=!1),t.sandbox.autoAllowBashIfSandboxed===!1&&(c.autoAllowBashIfSandboxed=!1),o){let l=_Br(o,["deniedDomains"]);o.allowManagedDomainsOnly===!0&&(l.allowManagedDomainsOnly=!0),e.sandbox?.network?.allowManagedDomainsOnly!==!0&&o.allowedDomains&&(l.allowedDomains=o.allowedDomains),Object.keys(l).length>0&&(c.network=l)}if(s){let l=_Br(s,["denyRead","denyWrite"]);s.allowManagedReadPathsOnly===!0&&(l.allowManagedReadPathsOnly=!0),e.sandbox?.filesystem?.allowManagedReadPathsOnly!==!0&&s.allowRead&&(l.allowRead=s.allowRead),Object.keys(l).length>0&&(c.filesystem=l)}Object.keys(c).length>0&&(r.sandbox=c)}return r}function Q$c(t){if(t.helper?.())return"helper";if(AXi(t).settings)return"remote";if(gXi(t).settings)return pIt()==="macos"?"plist":"hklm";if((t.file?.()??mXi(t)).settings)return"file";if(yXi(t).settings)return"parent";let e=t.hkcu?.();return e&&Object.keys(e.settings).length>0?"hkcu":null}function q$c(t){let e=[],{settings:r,errors:n}=AXi(t);e.push(...n);let{settings:o,errors:s}=gXi(t);e.push(...s);let{settings:c,errors:l}=t.file?.()??mXi(t);e.push(...l);let{settings:u,errors:d}=yXi(t);e.push(...d);let f=[r,o,c].filter(A=>A!==null),h=f[0]??null,m={allowManagedPermissionRulesOnly:f.some(A=>A.allowManagedPermissionRulesOnly===!0)||void 0,forceLoginOrgUUID:f.find(A=>A.forceLoginOrgUUID!==void 0)?.forceLoginOrgUUID,allowedMcpServers:f.find(A=>A.allowedMcpServers!==void 0)?.allowedMcpServers,sandbox:{network:{allowManagedDomainsOnly:f.some(A=>A.sandbox?.network?.allowManagedDomainsOnly===!0)||void 0},filesystem:{allowManagedReadPathsOnly:f.some(A=>A.sandbox?.filesystem?.allowManagedReadPathsOnly===!0)||void 0}}},g=u&&F$c(h)?U$c(u,m):null;return{tiers:f,admin:h,parentSlice:g,errors:e}}function vXi(t){let e=t.helper?.();if(e)return{settings:e,errors:t.helperWarnings?.()??[]};let{admin:r,parentSlice:n,errors:o}=q$c(t);if(!r&&!n){let s=t.hkcu?.();return s&&Object.keys(s.settings).length>0?{settings:s.settings,errors:[...o,...s.errors]}:{settings:null,errors:[...o,...s?.errors??[]]}}return{settings:dV({},n??{},r??{},fV),errors:o}}function j$c(t,e){if(t==="policySettings")return vXi(e).settings;let r=STt(t,e),{settings:n}=r?bTt(r,t==="flagSettings"?e.flagExpectedContent:void 0):{settings:null};if(t==="flagSettings"){let{settings:o}=EXi(e);if(o)return dV(n||{},o,fV)}return n}function H$c(t,e){return tzi([...t,...e])}function fV(t,e){if(Array.isArray(t)&&Array.isArray(e))return H$c(t,e)}function G$c(t){if(bBr)return{settings:{},errors:[]};let e=Date.now();ILr("info","settings_load_started"),bBr=!0;try{let r=f3c(),n={};r&&(n=dV(n,r,fV));let o=[],s=new Set,c=new Set;for(let l of D8r(t)){if(l==="policySettings"){let{settings:d,errors:f}=vXi(t);d&&(n=dV(n,d,fV));for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}continue}let u=STt(l,t);if(u){let d=(0,py.resolve)(u);if(!c.has(d)){c.add(d);let{settings:f,errors:h}=bTt(u,l==="flagSettings"?t.flagExpectedContent:void 0);for(let m of h){let g=`${m.file}:${m.path}:${m.message}`;s.has(g)||(s.add(g),o.push(m))}f&&(n=dV(n,f,fV))}}if(l==="flagSettings"){let{settings:d,errors:f}=EXi(t);for(let h of f){let m=`${h.file}:${h.path}:${h.message}`;s.has(m)||(s.add(m),o.push(h))}d&&(n=dV(n,d,fV))}}return ILr("info","settings_load_completed",{duration_ms:Date.now()-e,source_count:c.size,error_count:o.length}),{settings:n,errors:o}}finally{bBr=!1}}function $$c(t){let e=i3c();if(e!==null)return e;let r=G$c(t);return o3c(r),r}function V$c(t){let{settings:e}=$$c(t);return e||{}}function W$c(t){m3r();let e=[];for(let r of D8r(t)){let n=_Xi(r,t);n&&Object.keys(n).length>0&&e.push({source:r,settings:n})}return{effective:V$c(t),sources:e}}function z$c(t,e){let r=D8r(e);for(let n=r.length-1;n>=0;n--){let o=r[n];if(_Xi(o,e)?.[t]!==void 0)return o}return null}function X$c(t){let e=t.effective.permissions?.defaultMode;if(!e||!J$c.has(e))return t.effective;for(let r=t.sources.length-1;r>=0;r--){let n=t.sources[r];if(n.settings.permissions?.defaultMode!==void 0){if(Z$c.has(n.source)){let{defaultMode:o,...s}=t.effective.permissions??{};return{...t.effective,permissions:s}}return t.effective}}return t.effective}async function eVc(t={}){await vGc();let e={cwd:(0,RZi.resolve)(t.cwd??uI().cwd()),allowedSources:(t.settingSources??K$c).map(r=>Y$c[r]),parentManaged:t.managedSettings??null,flagInline:null,flagPath:void 0,mdm:CGc,hkcu:bGc,wslInherits:SGc,...t.serverManagedSettings!==void 0&&{remote:a(()=>t.serverManagedSettings,"remote")}};try{let{effective:r,sources:n}=W$c(e),o=Q$c(e)??void 0,s=n.map(({source:l,settings:u})=>({source:j$i[l],settings:u,path:l==="policySettings"?void 0:STt(l,e),...l==="policySettings"&&{policyOrigin:o}})),c={};for(let l of Object.keys(r)){let u=z$c(l,e);u&&(c[l]={source:j$i[u],path:u==="policySettings"?void 0:STt(u,e),...u==="policySettings"&&{policyOrigin:o}})}return{effective:r,provenance:c,sources:s}}finally{m3r()}}async function tVc(t){return eVc(t)}async function rVc(t,e){try{await(0,qE.copyFile)(t,e)}catch(r){if(!G3e(r))throw r}}async function nVc(t,e){if(!t)return;let r=t;try{let n=dN(t);n?.claudeAiOauth?.refreshToken&&(delete n.claudeAiOauth.refreshToken,r=x0(n))}catch{}await(0,qE.writeFile)(e,r,{mode:384})}function iVc(){if(process.platform!=="darwin")return Promise.resolve(void 0);let t=R8c(w8c);return new Promise(e=>{(0,dVi.execFile)("security",["find-generic-password","-a",k8c(),"-w","-s",t],{encoding:"utf-8",timeout:5e3},(r,n)=>e(r?void 0:n.trim()||void 0))})}async function CXi(t,e,r,n,o=6e4){if(!ph(e))return;let s=YR(r),c=await Nne(t.load({projectKey:s,sessionId:e}),o,`SessionStore.load() timed out after ${o}ms for session ${e}`);if(!c||c.length===0)return;let l=(0,cc.join)((0,PEe.tmpdir)(),`claude-resume-${(0,DTt.randomUUID)()}`);try{let u=(0,cc.join)(l,"projects",s);await(0,qE.mkdir)(u,{recursive:!0});let d=(0,cc.join)(u,`${e}.jsonl`);await XBr(d,c);let f=n?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR,h=f??(0,cc.join)((0,PEe.homedir)(),".claude"),m;try{m=await(0,qE.readFile)((0,cc.join)(h,".credentials.json"),"utf-8")}catch(g){if(!G3e(g))throw g}if(!f&&!(n??process.env).ANTHROPIC_API_KEY&&!(n??process.env).CLAUDE_CODE_OAUTH_TOKEN&&(m=await iVc()??m),await nVc(m,(0,cc.join)(l,".credentials.json")),await rVc((0,cc.join)(f??(0,PEe.homedir)(),".claude.json"),(0,cc.join)(l,".claude.json")),t.listSubkeys){let g=(0,cc.join)(u,e),A=await Nne(t.listSubkeys({projectKey:s,sessionId:e}),o,`SessionStore.listSubkeys() timed out after ${o}ms for session ${e}`);for(let y of A){let E=(0,cc.resolve)(g,y+".jsonl");if(!y||(0,cc.isAbsolute)(y)||y.split(/[\\/]/).includes("..")||!E.startsWith(g+cc.sep)){Wl(`[SessionStore] skipping unsafe subpath from listSubkeys: ${y}`,{level:"warn"});continue}let _=await Nne(t.load({projectKey:s,sessionId:e,subpath:y}),o,`SessionStore.load() timed out after ${o}ms for session ${e} subpath ${y}`);if(!_||_.length===0)continue;let v=[],b=[];for(let T of _)QLr(T)?v.push(T):b.push(T);if(b.length>0&&(await(0,qE.mkdir)((0,cc.dirname)(E),{recursive:!0}),await XBr(E,b)),v.length>0){let T=v.at(-1),w=(0,cc.resolve)(g,y+".meta.json");await(0,qE.mkdir)((0,cc.dirname)(w),{recursive:!0});let{type:R,...x}=T;await(0,qE.writeFile)(w,x0(x),{mode:384})}}}return l}catch(u){throw await TTt(l),u}}function FLr(t,e,r,n){let{systemPrompt:o,settings:s,managedSettings:c,settingSources:l,sandbox:u,...d}=t??{},f,h,m;o===void 0?f="":typeof o=="string"||Array.isArray(o)?f=o:o.type==="preset"&&(h=o.append,m=o.excludeDynamicSections),process.env.CLAUDE_AGENT_SDK_VERSION="0.3.159";let{abortController:g=TBr(),additionalDirectories:A=[],agent:y,agents:E,allowedTools:_=[],betas:v,canUseTool:b,continue:T,cwd:w,debug:R,debugFile:x,disallowedTools:P=[],tools:D,env:N,executable:B=vVi()?"bun":"node",executableArgs:L=[],extraArgs:j={},fallbackModel:M,enableFileCheckpointing:O,toolConfig:q,forkSession:Q,hooks:U,includeHookEvents:z,includePartialMessages:W,forwardSubagentText:$,onElicitation:J,persistSession:ne,sessionStore:H,sessionStoreFlush:re,thinking:ae,effort:Oe,maxThinkingTokens:ve,maxTurns:Fe,maxBudgetUsd:Pe,taskBudget:Z,mcpServers:ee,model:K,outputFormat:pe,permissionMode:X="default",allowDangerouslySkipPermissions:ue=!1,permissionPromptToolName:qe,plugins:ie,getOAuthToken:le,getHostAuthToken:Ne,workload:we,resume:Be,resumeSessionAt:tt,sessionId:st,skills:Et,stderr:kt,strictMcpConfig:Gt}=d;if(H&&ne===!1)throw Error("sessionStore cannot be used with persistSession: false -- the storage adapter requires local writes to mirror from. Use CLAUDE_CONFIG_DIR=/tmp for ephemeral local writes with external mirroring.");if(H&&T&&!Be&&!H.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");if(H&&O)throw Error("enableFileCheckpointing is not yet supported with sessionStore (backup blobs are not mirrored, so rewindFiles() fails after a store-backed resume).");H&&d.spawnClaudeCodeProcess&&Wl("sessionStore with custom spawnClaudeCodeProcess: ensure the subprocess CLAUDE_CONFIG_DIR matches the parent (same path, same separators) or transcript_mirror frames will be dropped.",{level:"warn"});let jt=d.pathToClaudeCodeExecutable;if(!jt){let Ge=(0,hVi.fileURLToPath)(importMetaUrlShim),Y=(0,fVi.createRequire)(Ge),se=dFc(he=>Y.resolve(he));if(!se)throw Error(`Native CLI binary for ${process.platform}-${process.arch} not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable.`);jt=se}let Ie=pe?.type==="json_schema"?pe.schema:void 0,F=N?{...N}:{...process.env};F.CLAUDE_CODE_ENTRYPOINT||(F.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),F.CLAUDE_AGENT_SDK_VERSION||(F.CLAUDE_AGENT_SDK_VERSION="0.3.159"),O&&(F.CLAUDE_CODE_ENABLE_SDK_FILE_CHECKPOINTING="true"),le&&(F.CLAUDE_CODE_SDK_HAS_OAUTH_REFRESH="1"),Ne&&(F.CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH="1"),q?.askUserQuestion?.previewFormat&&(F.CLAUDE_CODE_QUESTION_PREVIEW_FORMAT=q.askUserQuestion.previewFormat);let be={};if(OGi.propagation.inject(OGi.context.active(),be),"traceparent"in be)for(let Ge of["TRACEPARENT","TRACESTATE"])Ge in(N??{})||delete F[Ge];for(let[Ge,Y]of Object.entries(be)){let se=Ge.toUpperCase();se in(N??{})||(F[se]=Y)}let Ue={},de=new Map;if(ee)for(let[Ge,Y]of Object.entries(ee))Y.type==="sdk"&&Y.instance?de.set(Ge,Y.instance):Ue[Ge]=Y;let Se;if(ae)switch(ae.type){case"adaptive":Se={type:"adaptive",display:ae.display};break;case"enabled":Se={type:"enabled",budgetTokens:ae.budgetTokens,display:ae.display};break;case"disabled":Se={type:"disabled"};break}else ve!==void 0&&(Se=ve===0?{type:"disabled"}:{type:"enabled",budgetTokens:ve});r&&(F.CLAUDE_CONFIG_DIR=r,process.platform==="win32"&&(F.CLAUDE_SECURESTORAGE_CONFIG_DIR=N?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??N?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??""));let Le=new zBr({abortController:g,additionalDirectories:A,agent:y,betas:v,cwd:w,debug:R,debugFile:x,executable:B,executableArgs:L,extraArgs:we?{...j,workload:we}:j,pathToClaudeCodeExecutable:jt,env:F,forkSession:Q,stderr:kt,thinkingConfig:Se,effort:Oe,maxTurns:Fe,maxBudgetUsd:Pe,taskBudget:Z,model:K,fallbackModel:M,jsonSchema:Ie,permissionMode:X,allowDangerouslySkipPermissions:ue,permissionPromptToolName:qe,continueConversation:H?void 0:T,resume:Be,resumeSessionAt:tt,sessionId:st,settings:typeof s=="object"?x0(s):s,managedSettings:c?x0(c):void 0,settingSources:l,skills:Et,allowedTools:_,disallowedTools:P,tools:D,mcpServers:Ue,strictMcpConfig:Gt,canUseTool:!!b,hooks:!!U,includeHookEvents:z,includePartialMessages:W,persistSession:ne,sessionMirror:!!H,plugins:ie,sandbox:u,spawnClaudeCodeProcess:d.spawnClaudeCodeProcess,deferSpawn:n}),te={systemPrompt:f,appendSystemPrompt:h,planModeInstructions:d.planModeInstructions,appendSubagentSystemPrompt:d.appendSubagentSystemPrompt,toolAliases:d.toolAliases,excludeDynamicSections:m,agents:E,title:d.title,skills:Et,webSearchIsolationExemptMcpServers:d.webSearchIsolationExemptMcpServers,promptSuggestions:d.promptSuggestions,agentProgressSummaries:d.agentProgressSummaries,forwardSubagentText:$},Te=new KBr(Le,e,b,U,g,de,Ie,te,J,le,Ne);if(H){let Ge=a(()=>(0,cc.join)(F.CLAUDE_CONFIG_DIR??(0,cc.join)((0,PEe.homedir)(),".claude"),"projects"),"S6"),Y=re==="eager",se=new JBr(async(he,Ce)=>{let He=V$i(he,Ge());He?await H.append(He,Ce):Wl(`[SessionStore] dropping mirror frame: filePath ${he} is not under ${Ge()} -- subprocess CLAUDE_CONFIG_DIR likely differs from parent (custom spawnClaudeCodeProcess / container?)`,{level:"warn"})},void 0,(he,Ce)=>{let He=V$i(he,Ge());He&&Te.reportMirrorError(He,Ce.message)},Y?0:A3r,Y?0:y3r);Te.setTranscriptMirrorBatcher(se)}return{queryInstance:Te,transport:Le,abortController:g,processEnv:F}}function ULr(t,e,r,n){typeof r=="string"?e.write(x0({type:"user",session_id:"",message:{role:"user",content:[{type:"text",text:r}]},parent_tool_use_id:null})+` +`):t.streamInput(r).catch(o=>n.abort(o))}async function TTt(t){for(let e=0;;e++)try{return await(0,qE.rm)(t,{recursive:!0,force:!0})}catch(r){if(e>=4||!oVc.has(lI(r)??""))return;await gVi((e+1)*100)}}function sVc(t,e){t.waitForExit().catch(()=>{}).finally(()=>TTt(e))}function aVc({prompt:t,options:e}){if((e?.resume||e?.continue)&&e?.sessionStore){let{queryInstance:s,transport:c,abortController:l,processEnv:u}=FLr({...e},typeof t=="string",void 0,!0),d=(0,cc.resolve)(e.cwd??"."),f=e.sessionStore,h=e.loadTimeoutMs??6e4,m=e.resume;return(async()=>{if(m||(m=(await Nne(f.listSessions(YR(d)),h,`SessionStore.listSessions() timed out after ${h}ms`)).slice().sort((g,A)=>A.mtime-g.mtime)[0]?.sessionId),!!m)return CXi(f,m,d,e.env,e.loadTimeoutMs)})().then(g=>{if(g){c.updateResume(m);let A={CLAUDE_CONFIG_DIR:g};if(process.platform==="win32"){let y=e.env?.CLAUDE_SECURESTORAGE_CONFIG_DIR??process.env.CLAUDE_SECURESTORAGE_CONFIG_DIR??e.env?.CLAUDE_CONFIG_DIR??process.env.CLAUDE_CONFIG_DIR??"";A.CLAUDE_SECURESTORAGE_CONFIG_DIR=y,u.CLAUDE_SECURESTORAGE_CONFIG_DIR=y}c.updateEnv(A),u.CLAUDE_CONFIG_DIR=g,s.addCleanupCallback(()=>sVc(c,g))}s.isClosed()||c.spawn()}).catch(g=>{let A=H3e(g);c.spawnAbort(A),s.setError(A)}),ULr(s,c,t,l),s}let{queryInstance:r,transport:n,abortController:o}=FLr(e,typeof t=="string");return ULr(r,n,t,o),r}async function cVc({options:t,initializeTimeoutMs:e=6e4}={}){let r,n=t?.resume;if((n||t?.continue)&&t?.sessionStore){let l=(0,cc.resolve)(t.cwd??".");if(!n){if(!t.sessionStore.listSessions)throw Error("Options.continue with sessionStore requires store.listSessions to be implemented");let u=t.loadTimeoutMs??6e4;n=(await Nne(t.sessionStore.listSessions(YR(l)),u,`SessionStore.listSessions() timed out after ${u}ms`)).slice().sort((d,f)=>f.mtime-d.mtime)[0]?.sessionId}n&&(r=await CXi(t.sessionStore,n,l,t.env,t.loadTimeoutMs))}let o,s,c;try{let l=a(function(){m||(m=!0,h.close())},"z"),u=FLr(r&&n&&n!==t?.resume?{...t,resume:n}:t,!1,r);o=u.queryInstance;let{transport:d,abortController:f}=u;s=d;let h=u.queryInstance;if(r){let g=r;h.addCleanupCallback(()=>{c=d.waitForExit().catch(()=>{}).then(()=>TTt(g))})}await Nne(h.initializationResult(),e,`Subprocess initialization did not complete within ${e}ms \u2014 check authentication and network connectivity`);let m=!1;return{query(g){if(m)throw Error("WarmQuery.query() can only be called once");m=!0;try{ULr(h,d,g,f)}catch(A){throw h.close(),A}return typeof g=="string"&&h.setIsSingleUserTurn(!0),h},close:l,async[Symbol.asyncDispose](){m=!0,h.close(),await c}}}catch(l){if(o?.close(),r&&!c){let u=s;c=(u?u.waitForExit().catch(()=>{}):Promise.resolve()).then(()=>TTt(r))}throw await c,l}}async function lVc(t,e){return e?.sessionStore?CVc(e.sessionStore,t,e):zFc(t,e)}async function uVc(t){return t?.sessionStore?_Vc(t.sessionStore,t):t8c(t)}async function dVc(t,e){return e?.sessionStore?bVc(e.sessionStore,t,e):r8c(t,e)}async function fVc(t,e,r){return r?.sessionStore?SVc(r.sessionStore,t,e,r.dir):n8c(t,e,r)}async function pVc(t,e,r){return r?.sessionStore?TVc(r.sessionStore,t,e,r.dir):i8c(t,e,r)}async function hVc(t,e){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);if(e?.sessionStore){if(!e.sessionStore.delete)return;let r=YR(e.dir);await e.sessionStore.delete({projectKey:r,sessionId:t});return}return o8c(t,e)}async function mVc(t,e){return e?.sessionStore?IVc(e.sessionStore,t,e):d8c(t,e)}async function gVc(t,e,r){if(!ph(t))throw Error(`Invalid sessionId: ${t}`);let n=await jTt(t,r?.dir);if(!n)throw Error(`Session ${t} not found`);let o=YR(r?.dir),s=r?.batchSize&&r.batchSize>0?r.batchSize:A3r;if(await H$i(n.filePath,{projectKey:o,sessionId:t},e,s),r?.includeSubagents===!1)return;let c=n.filePath.replace(/\.jsonl$/,""),l=(0,cc.join)(c,"subagents");for(let u of await AVc(l)){let d=(0,cc.relative)(c,u).split(cc.sep);d[d.length-1]=d.at(-1).replace(/\.jsonl$/,"");let f={projectKey:o,sessionId:t,subpath:d.join("/")};await H$i(u,f,e,s);let h=u.replace(/\.jsonl$/,".meta.json");try{let m=dN(await(0,qE.readFile)(h,"utf8"));await e.append(f,[{type:"agent_metadata",...m}])}catch(m){if(!G3e(m))throw m}}}async function H$i(t,e,r,n){let o=(0,pVi.createInterface)({input:(0,NTt.createReadStream)(t,{encoding:"utf8"}),crlfDelay:1/0}),s=[],c=0;for await(let l of o)l&&(s.push(dN(l)),c+=l.length,(s.length>=n||c>=y3r)&&(await r.append(e,s),s=[],c=0));s.length>0&&await r.append(e,s)}async function AVc(t){let e=[];async function r(n){let o;try{o=await(0,qE.readdir)(n,{withFileTypes:!0})}catch{return}for(let s of o){let c=(0,cc.join)(n,s.name);s.isDirectory()?await r(c):s.isFile()&&s.name.endsWith(".jsonl")&&e.push(c)}}return a(r,"J"),await r(t),e}async function yVc(t,e){return e?.sessionStore?xVc(e.sessionStore,t,e.dir):A8c(t,e)}async function EVc(t,e,r){return r?.sessionStore?wVc(r.sessionStore,t,e,r):y8c(t,e,r)}function bXi(t){let e=(0,cc.resolve)(t??"."),r;try{r=(0,NTt.realpathSync)(e)}catch{r=e}return r.normalize("NFC")}function YR(t){return V3e(bXi(t))}function SXi(t){return t.map(e=>x0(e)).join(` `)+` -`}function nVi(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function c3r(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function Tzc(t,e){let r=BXi(e.dir),n=sFe(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else Kl("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=nVi(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await iVi(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=nVi(c,s,o);return iVi(t,l,e.dir,r)}async function iVi(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await UXi(t,o.sessionId,r);if(!s)return null;let c=nIt(o.sessionId,FXi(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function FXi(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,u9).toString("utf-8"),s=n>u9?r.subarray(n-u9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function Izc(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` -`)+1);try{let n=hN(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function UXi(t,e,r){let n=ZR(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:LXi(o)}async function xzc(t,e,r){if(!uh(e))return[];let n=ZR(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:Z6c(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function wzc(t,e,r){if(!uh(e))return;let n=await UXi(t,e,r.dir);if(!n)return;let o=FXi(n,Izc(n));return nIt(e,o)??void 0}async function Rzc(t,e,r,n){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=ZR(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,VTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function kzc(t,e,r,n){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=S3e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=ZR(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,VTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function Pzc(t,e,r){if(!uh(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!uh(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=ZR(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=y9c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function Dzc(t,e,r){if(!uh(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=ZR(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function Nzc(t,e,r,n){if(!uh(e))return[];if(!r)return[];let o=ZR(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(c3r),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!c3r(f));return d.length===0?[]:uzi(Buffer.from(LXi(d)),{limit:n.limit,offset:n.offset},u)}function oVi(t,e){let r=(0,cc.relative)(e,t),n=r.split(cc.sep);if(n[0]===".."||(0,cc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var sVi,SVi,VTt,WTt,GE,TVi,jEe,cc,IVi,xVi,wVi,kVi,PVi,DVi,FVi,UVi,gWi,aLr,AWi,Qg,yWi,cB,uLr,DWi,tTt,VE,eie,vo,xm,MWi,lB,jWi,$Wi,_Lr,VWi,lN,WEe,WWi,zWi,YWi,KWi,E_e,__e,vLr,uB,Gne,E3e,aTt,O3e,cTt,dzi,fzi,jZi,$ne,HZi,Yd,Y8r,kTt,KZi,JZi,J8r,ZLr,mXi,AXi,yXi,ly,xXi,tOc,rOc,VBr,nOc,iOc,sOc,aOc,l3r,Ut,cOc,pB,uOc,dOc,fOc,Vd,Wd,pOc,hOc,mOc,aVi,gOc,u_e,AOc,u3r,yOc,d_e,EOc,_Oc,cVi,QTt,COc,lVi,vOc,uVi,bOc,qTt,dVi,d3r,f3r,fVi,p3r,pVi,hVi,SOc,mVi,TOc,IOc,xOc,wOc,ROc,kOc,POc,DOc,NOc,MOc,OOc,BOc,LOc,FOc,UOc,QOc,qOc,jOc,_St,XHi,Rs,uc,kV,jTt,HOc,gVi,AVi,CSt,GOc,pN,$Oc,VOc,yVi,WOc,HTt,GTt,h3r,$Tt,m3r,zOc,EVi,YOc,KOc,JOc,ZOc,XOc,e5c,t5c,r5c,n5c,i5c,o5c,s5c,a5c,c5c,l5c,g3r,u5c,d5c,f5c,p5c,_Vi,CVi,h5c,m5c,g5c,A5c,y5c,vVi,E5c,_5c,C5c,v5c,b5c,S5c,T5c,I5c,x5c,w5c,R5c,k5c,P5c,D5c,N5c,M5c,bVi,O5c,B5c,L5c,F5c,zTt,Q5c,q5c,j5c,H5c,G5c,zBr,g1,Y5c,OVi,K5c,J5c,f_e,Z5c,TV,BVi,X5c,e4c,VLe,r4c,n4c,i4c,s4c,a4c,c4c,eGi,rFe,p9,d4c,f4c,p4c,h4c,y3r,g4c,hBr,tGi,y4c,E4c,_4c,v4c,b4c,S4c,T4c,I4c,x4c,w4c,R4c,P4c,N4c,E3r,O4c,I3e,L4c,U4c,Q4c,q4c,j4c,G4c,$4c,V4c,z4c,Y4c,J4c,rGi,X4c,YTt,KTt,rBc,nBc,oBc,aBc,lBc,dBc,JTt,fBc,LVi,hBc,gBc,ZTt,EBc,CBc,bBc,TBc,_3r,IBc,uy,g_e,G4h,QVi,YBr,xi,FC,fI,HEe,vSt,bSt,SSt,TSt,ISt,xSt,wSt,RSt,kSt,xBc,wBc,KBr,nGi,kBc,qVi,PBc,_V,DBc,MBc,oGi,sGi,aGi,v3r,FBc,QBc,qBc,GVi,PSt,jBc,HBc,S3r,GBc,cGi,mBr,$Bc,Jl,ZBr,Yl,lGi,uGi,DSt,fGi,zBc,pGi,Fne,YVi,YBc,KBc,JBc,I3r,ZBc,JVi,lI,uI,Vne,WLe,Wne,XBr,h3e,NSt,J1t,MSt,eLr,zne,$E,tWi,rWi,x3r,mGi,fLc,pLc,tLr,nWi,hLc,mLc,Ad,iWi,hr,gGi,ELc,Gn,OSt,v3e,BSt,LSt,FSt,USt,w3e,QSt,qSt,GEe,jSt,HSt,cWi,vLc,DEe,bLc,SLc,dWi,QR,pV,TEe,zLe,Z1t,YLe,KLe,X1t,JLe,i9,ZLe,eSt,tSt,Mne,rSt,nSt,XLe,gBr,yGi,iSt,ABr,yBr,EBr,EGi,_Gi,nLr,GSt,TLc,ILc,e3e,IEe,One,bm,m1,cI,l9,hV,t3e,vGi,iLr,$St,SGi,wLc,Yne,VSt,WSt,$Ee,zSt,R3e,YSt,k3e,A1,KSt,qR,mV,xEe,r3e,oSt,n3e,i3e,sSt,o3e,o9,s3e,aSt,cSt,Bne,lSt,uSt,a3e,_Br,xGi,CBr,vBr,bBr,SBr,wGi,RGi,oLr,JSt,P3e,PGi,kLc,ZSt,sLr,w3r,ySt,hWi,PLc,DLc,bp,VEe,MLc,OLc,cLr,LLc,jne,wEe,QLc,jLc,GLc,VLc,WLc,YLc,KLc,JLc,eTt,R3r,XLc,e3c,_Wi,n3c,o3c,y_e,a3c,DGi,CWi,l3c,u3c,d3c,D3e,f3c,IV,m3e,h3c,vWi,NGi,m3c,MGi,g3c,A3c,k3r,y3c,E3c,XTt,C3c,P3r,b3c,S3c,T3c,I3c,x3c,w3c,R3c,k3c,P3c,D3c,N3c,M3c,O3c,B3c,L3c,F3c,U3c,Q3c,q3c,j3c,H3c,G3c,$3c,V3c,md,z3c,K3c,g3e,bWi,b3e,J3c,TBr,Z3c,lLr,OGi,X3c,SWi,eFc,tFc,nFc,iFc,TWi,aFc,D3r,uFc,dFc,fFc,hFc,IWi,A3e,xWi,BGi,gFc,LGi,FGi,wWi,EFc,CFc,vFc,RWi,bFc,UGi,TFc,xFc,QGi,wFc,RFc,PFc,DFc,N3r,MFc,OFc,LFc,FFc,QFc,qFc,jFc,HFc,GFc,VFc,WFc,qGi,jGi,zFc,KFc,eIt,ZFc,M3r,t8c,n8c,o8c,a8c,PWi,O3r,rTt,p8c,B3r,g8c,E8c,C8c,v8c,b8c,$4h,S8c,V4h,T8c,W4h,I8c,z4h,x8c,Y4h,dLr,k8c,D8c,U8c,Q8c,K4h,J4h,V8c,GGi,$Gi,W8c,z8c,VGi,fLr,J8c,Z8c,pLr,X8c,BWi,LWi,t6c,r6c,dSt,IBr,c3e,xBr,hLr,qWi,Z4h,o6c,zd,hN,u6c,nTt,WGi,gLr,REe,iTt,y6c,ALr,yLr,U3r,Q3r,_6c,ELr,zGi,wBr,b6c,x6c,u9,R6c,N3e,N6c,M6c,O6c,sTt,L6c,M3e,F6c,U6c,e9c,p9c,T9c,mzi,I9c,x9c,w9c,eBh,YGi,R9c,P9c,N9c,O9c,lc,KGi,Rn,yV,pr,WR,L9c,B3e,F9c,SLr,UC,to,_3e,y1,JGi,ZGi,zEe,lTt,Kn,YR,XGi,ks,U9c,Q9c,q9c,j9c,H9c,G9c,$9c,V9c,W9c,DBr,z9c,Y9c,K9c,J9c,Z9c,X9c,gzi,eUc,YEe,L3e,F3e,U3e,Q3e,q3e,KEe,JEe,j3e,SV,dB,H3e,wV,mI,ZEe,a9,TLr,XEe,h9,xLr,G3e,$3e,wLr,e_e,t_e,r_e,n_e,Kne,uN,zR,m9,i_e,o_e,V3e,uTt,dTt,s_e,tBh,vr,rBh,nBh,iBh,oBh,sBh,aBh,cBh,lBh,uBh,dBh,fBh,pBh,hBh,mBh,aUc,gBh,ABh,yBh,EBh,_Bh,CBh,vBh,bBh,SBh,TBh,IBh,xBh,wBh,RBh,kBh,PBh,DBh,NBh,MBh,Ezi,_zi,Czi,RV,fTt,Hs,H3r,Szi,AUc,pTt,Tzi,xzi,wzi,RLr,kzi,G3r,cFe,W3r,hTt,z3r,mTt,Y3r,cIt,K3r,lIt,J3r,Mzi,Ozi,Bzi,Lzi,Fzi,Uzi,Qzi,IUc,qzi,a_e,xUc,wUc,RUc,jzi,kUc,PUc,DUc,NUc,MUc,Gzi,$zi,Vzi,Wzi,zzi,Z3r,Yzi,OUc,Kzi,Jzi,Zzi,rYi,nYi,iYi,oYi,sYi,aYi,cYi,lYi,uYi,dh,dYi,X3r,eFr,fYi,pYi,hYi,mYi,gYi,AYi,yYi,EYi,_Yi,lFe,CYi,vYi,bYi,SYi,TYi,IYi,xYi,wYi,RYi,gTt,kYi,bo,uFe,ku,PYi,DYi,NYi,MYi,OYi,BYi,LYi,FYi,UYi,QYi,qYi,jYi,HYi,GYi,$Yi,VYi,WYi,zYi,YYi,KYi,ZYi,XYi,tKi,rKi,rFr,nKi,nFr,iFr,iKi,oKi,sKi,aKi,cKi,ATt,lKi,uKi,dKi,oFr,sFr,aFr,fKi,pKi,uIt,hKi,mKi,gKi,AKi,yKi,EKi,cFr,_Ki,CKi,vKi,bKi,SKi,TKi,IKi,xKi,lFr,wKi,RKi,kKi,PKi,DKi,uFr,BUc,FUc,QUc,jUc,GUc,VUc,zUc,YUc,KUc,JUc,XUc,t7c,n7c,o7c,a7c,l7c,d7c,p7c,m7c,A7c,E7c,C7c,b7c,T7c,x7c,R7c,P7c,N7c,O7c,L7c,U7c,q7c,H7c,$7c,W7c,Y7c,K7c,Z7c,eQc,rQc,iQc,sQc,MKi,OKi,Y3e,d9,FKi,_Tt,Z3e,RQc,kQc,PQc,H,WFr,zFr,YFr,KFr,JFr,wJi,MQc,fFe,RJi,kJi,PJi,DJi,Ps,ZFr,hIt,yd,XFr,CTt,f9,e8r,t8r,r8r,n8r,i8r,o8r,s8r,a8r,c8r,l8r,u8r,d8r,f8r,p8r,h8r,m8r,NJi,mIt,C_e,gIt,AIt,g8r,MJi,OJi,BJi,LJi,FJi,UJi,QJi,y8r,qJi,EIt,E8r,jJi,HJi,GJi,C8r,$Ji,VJi,X3e,WJi,zJi,v8r,S8r,YJi,KJi,ZJi,T8r,tZi,rZi,iZi,I8r,oZi,aZi,cZi,uZi,CIt,kqc,Dqc,mZi,Qqc,gZi,AZi,qqc,Une,vIt,Im,yZi,EZi,OBh,jqc,Hqc,w8r,gI,pFe,Gqc,dy,KR,JR,fy,bIt,_Zi,m$i,CZi,$qc,R8r,hSt,Bi,k8r,Vqc,BBh,LBh,P8r,Wqc,D8r,zqc,hFe,l_e,vZi,Yqc,Kqc,Jqc,Zqc,Xqc,ejc,bZi,tjc,rjc,SZi,N8r,njc,ijc,M8r,ojc,mFe,gFe,sjc,AFe,SIt,ajc,STt,O8r,B8r,L8r,FBh,F8r,U8r,Q8r,cjc,TZi,IZi,q8r,xZi,yFe,v_e,wZi,ljc,DLr,ujc,NLr,djc,j8r,fjc,MLr,pjc,hjc,mjc,gjc,Ajc,yjc,Ejc,_jc,Cjc,vjc,OLr,bjc,Sjc,BLr,H8r,G8r,$8r,Tjc,Ijc,xjc,V8r,wjc,Rjc,kjc,Pjc,Djc,RZi,LLr,Njc,W8r,UBh,Mjc,TTt,Ojc,QBh,ITt,Bjc,kZi,Ljc,Fjc,Ujc,Qjc,qjc,jjc,Hjc,xTt,Gjc,$jc,Vjc,z8r,PZi,Wjc,zjc,Yjc,Kjc,Jjc,Zjc,Xjc,eHc,tHc,rHc,nHc,iHc,oHc,sHc,aHc,cHc,lHc,uHc,wTt,dHc,fHc,pHc,FLr,gHc,AHc,yHc,DZi,EHc,qBh,jBh,HBh,GBh,$Bh,VBh,li,ULr,_Hc,g$i,CHc,vHc,MZi,IHc,xHc,PHc,OBr,oN,MHc,RTt,y$i,VHc,WHc,XHc,eGc,tGc,rGc,nGc,oGc,QLr,aGc,cGc,qLr,jLr,HLr,UZi,S$i,pGc,GLr,$Lr,gGc,u3e,w$i,CGc,GR,WLr,k$i,WBh,zBh,P$i,D$i,N$i,M$i,CV,K8r,BEe,wGc,RGc,kGc,YBh,MGc,LBr,BGc,O$i,KBh,kEe,VZi,YLr,WZi,PTt,B$i,LGc,AV,zZi,QEe,KLr,JLr,UGc,L$i,IIt,xIt,ZBh,XBh,eLh,eFe,tLh,QGc,qGc,jGc,HGc,GGc,$Gc,VGc,WGc,rLh,Z8r,zGc,YGc,nLh,iLh,KGc,d3e,ZGc,XGc,DTt,oLh,sLh,b_e,DV,e$c,t$c,ZZi,r$c,n$c,i$c,o$c,s$c,a$c,c$c,l$c,XLr,aLh,XZi,u$c,d$c,fN,Xne,F$i,e3r,t3r,eXi,X8r,p$c,cLh,h$c,m$c,g$c,A$c,y$c,tXi,rXi,E$c,U$i,_$c,C$c,nXi,v$c,b$c,Q$i,S$c,T$c,iXi,I$c,oXi,x$c,w$c,R$c,NTt,FBr,sXi,k$c,P$c,D$c,N$c,M$c,lLh,aXi,B$c,L$c,F$c,U$c,Q$c,q$c,j$c,uLh,H$c,dLh,G$c,$$c,V$c,mSt,wIt,q$i,lXi,fLh,pLh,MTt,QBr,oVc,hLh,sVc,pXi,hXi,aVc,j$i,S_e,c9,lVc,uVc,mLh,hVc,gVc,W$i,r3r,n3r,LEe,yVc,EVc,_Vc,z$i,OTt,vVc,EV,EXi,_Xi,CXi,BTt,i3r,OVc,BVc,LVc,UVc,QVc,qVc,jVc,vXi,HVc,GVc,VVc,o3r,YVc,JVc,ZVc,eWc,Z$i,SXi,nWc,iWc,oWc,sWc,aWc,cWc,uWc,dWc,TXi,pWc,mWc,AWc,yWc,vV,_Wc,vWc,SWc,X$i,IWc,xWc,RWc,PWc,DWc,jBr,NWc,HBr,MWc,$Br,ezc,tVi,tzc,rzc,nzc,uzc,qXi=me(()=>{p();sVi=require("node:module"),SVi=require("child_process"),VTt=require("crypto"),WTt=require("fs"),GE=require("fs/promises"),TVi=require("module"),jEe=require("os"),cc=require("path"),IVi=require("readline"),xVi=require("url"),wVi=require("events"),kVi=require("child_process"),PVi=require("fs"),DVi=require("readline"),FVi=require("os"),UVi=require("path"),gWi=require("crypto"),aLr=require("path"),AWi=require("async_hooks"),Qg=require("fs/promises"),yWi=require("crypto"),cB=require("fs/promises"),uLr=require("fs"),DWi=require("process"),tTt=require("crypto"),VE=require("fs/promises"),eie=require("path"),vo=ce(require("fs"),1),xm=require("fs/promises"),MWi=require("fs"),lB=require("path"),jWi=require("fs"),$Wi=require("fs/promises"),_Lr=require("events"),VWi=require("fs"),lN=require("fs/promises"),WEe=require("path"),WWi=require("child_process"),zWi=require("util"),YWi=require("child_process"),KWi=require("path"),E_e=require("fs/promises"),__e=require("path"),vLr=require("fs"),uB=require("fs/promises"),Gne=require("path"),E3e=require("crypto"),aTt=require("path"),O3e=require("fs/promises"),cTt=require("path"),dzi=require("crypto"),fzi=require("os"),jZi=require("path"),$ne=require("path"),HZi=require("path"),Yd=ce(require("node:path"),1),Y8r=ce(require("node:os"),1),kTt=ce(require("node:process"),1),KZi=require("path"),JZi=require("fs/promises"),J8r=require("os"),ZLr=require("path"),mXi=require("os"),AXi=require("child_process"),yXi=require("fs"),ly=require("path"),xXi=require("path"),tOc=Object.create,{getPrototypeOf:rOc,defineProperty:VBr,getOwnPropertyNames:nOc}=Object,iOc=Object.prototype.hasOwnProperty;a(oOc,"a_");l3r=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?sOc??=new WeakMap:aOc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?tOc(rOc(t)):{};let c=e||!t||!t.__esModule?VBr(r,"default",{value:t,enumerable:!0}):r;for(let l of nOc(t))iOc.call(c,l)||VBr(c,l,{get:oOc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),Ut=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),cOc=a(t=>t,"$k");a(lOc,"Qk");pB=a((t,e)=>{for(var r in e)VBr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:lOc.bind(e,r)})},"M4"),uOc=(0,sVi.createRequire)(importMetaUrlShim),dOc=Symbol.dispose||Symbol.for("Symbol.dispose"),fOc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Vd=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[fOc]),n===void 0&&(n=e[dOc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),Wd=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),pOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),hOc=Ut(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(pOc(),t)}),mOc=Ut(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(hOc(),t)}),aVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),gOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=aVi(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),u_e=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=mOc(),r=aVi(),n=gOc(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),AOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=u_e();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),u3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),yOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=u3r();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),d_e=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=AOc(),r=yOc(),n=u3r(),o=u_e(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),EOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),_Oc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),cVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=d_e(),r=EOc(),n=_Oc(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),QTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),COc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),vOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),uVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),bOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=QTt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),qTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=bOc(),r=u_e(),n=d_e(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),dVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),d3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=dVi();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),f3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=d3r();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),fVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=QTt(),r=f3r(),n=qTt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),p3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=d3r(),r=f3r(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),pVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=qTt(),r=fVi(),n=f3r(),o=p3r(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),hVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=pVi(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),SOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=pVi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),mVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=hVi(),r=SOc(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),TOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),IOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),xOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),wOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),ROc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=wOc(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),kOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=ROc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),POc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=qTt();t.context=e.ContextAPI.getInstance()}),DOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=d_e();t.diag=e.DiagAPI.instance()}),NOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=lVi();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),MOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=NOc(),r=u_e(),n=d_e(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),OOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=MOc();t.metrics=e.MetricsAPI.getInstance()}),BOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),LOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=qTt(),r=QTt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),FOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=u_e(),r=BOc(),n=uVi(),o=LOc(),s=cVi(),c=d_e(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),UOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=FOc();t.propagation=e.PropagationAPI.getInstance()}),QOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=u_e(),r=mVi(),n=p3r(),o=fVi(),s=d_e(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),qOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=QOc();t.trace=e.TraceAPI.getInstance()}),jOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=cVi();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=QTt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=COc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=u3r();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=lVi();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=vOc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=uVi();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=hVi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=mVi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=TOc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=IOc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=xOc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=dVi();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=kOc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=p3r();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var E=d3r();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=POc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=DOc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=OOc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=UOc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=qOc();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),_St=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=_St();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),Rs=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=_St(),r=XHi(),n=_St();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=XHi();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(j,X){return this}}class c extends s{static{a(this,"Lj")}constructor(j,X,ie){super(),this.varKind=j,this.name=X,this.rhs=ie}render({es5:j,_n:X}){let ie=j?r.varKinds.var:this.varKind,we=this.rhs===void 0?"":` = ${this.rhs}`;return`${ie} ${this.name}${we};`+X}optimizeNames(j,X){if(j[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,j,X)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(j,X,ie){super(),this.lhs=j,this.rhs=X,this.sideEffects=ie}render({_n:j}){return`${this.lhs} = ${this.rhs};`+j}optimizeNames(j,X){if(!(this.lhs instanceof e.Name&&!j[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,j,X),this}get names(){let j=this.lhs instanceof e.Name?{}:{...this.lhs.names};return Q(j,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(j,X,ie,we){super(j,ie,we),this.op=X}render({_n:j}){return`${this.lhs} ${this.op}= ${this.rhs};`+j}}class d extends s{static{a(this,"Aj")}constructor(j){super(),this.label=j,this.names={}}render({_n:j}){return`${this.label}:`+j}}class f extends s{static{a(this,"Ij")}constructor(j){super(),this.label=j,this.names={}}render({_n:j}){return`break${this.label?` ${this.label}`:""};`+j}}class h extends s{static{a(this,"Rj")}constructor(j){super(),this.error=j}render({_n:j}){return`throw ${this.error};`+j}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(j){super(),this.code=j}render({_n:j}){return`${this.code};`+j}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(j,X){return this.code=M(this.code,j,X),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(j=[]){super(),this.nodes=j}render(j){return this.nodes.reduce((X,ie)=>X+ie.render(j),"")}optimizeNodes(){let{nodes:j}=this,X=j.length;for(;X--;){let ie=j[X].optimizeNodes();Array.isArray(ie)?j.splice(X,1,...ie):ie?j[X]=ie:j.splice(X,1)}return j.length>0?this:void 0}optimizeNames(j,X){let{nodes:ie}=this,we=ie.length;for(;we--;){let Ae=ie[we];Ae.optimizeNames(j,X)||(O(j,Ae.names),ie.splice(we,1))}return ie.length>0?this:void 0}get names(){return this.nodes.reduce((j,X)=>B(j,X.names),{})}}class A extends g{static{a(this,"f1")}render(j){return"{"+j._n+super.render(j)+"}"+j._n}}class y extends g{static{a(this,"Ej")}}class E extends A{static{a(this,"RJ")}}E.kind="else";class _ extends A{static{a(this,"e4")}constructor(j,X){super(X),this.condition=j}render(j){let X=`if(${this.condition})`+super.render(j);return this.else&&(X+="else "+this.else.render(j)),X}optimizeNodes(){super.optimizeNodes();let j=this.condition;if(j===!0)return this.nodes;let X=this.else;if(X){let ie=X.optimizeNodes();X=this.else=Array.isArray(ie)?new E(ie):ie}if(X)return j===!1?X instanceof _?X:X.nodes:this.nodes.length?this:new _(q(j),X instanceof _?[X]:X.nodes);if(!(j===!1||!this.nodes.length))return this}optimizeNames(j,X){var ie;if(this.else=(ie=this.else)===null||ie===void 0?void 0:ie.optimizeNames(j,X),!!(super.optimizeNames(j,X)||this.else))return this.condition=M(this.condition,j,X),this}get names(){let j=super.names;return Q(j,this.condition),this.else&&B(j,this.else.names),j}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(j){super(),this.iteration=j}render(j){return`for(${this.iteration})`+super.render(j)}optimizeNames(j,X){if(super.optimizeNames(j,X))return this.iteration=M(this.iteration,j,X),this}get names(){return B(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(j,X,ie,we){super(),this.varKind=j,this.name=X,this.from=ie,this.to=we}render(j){let X=j.es5?r.varKinds.var:this.varKind,{name:ie,from:we,to:Ae}=this;return`for(${X} ${ie}=${we}; ${ie}<${Ae}; ${ie}++)`+super.render(j)}get names(){let j=Q(super.names,this.from);return Q(j,this.to)}}class w extends v{static{a(this,"BB")}constructor(j,X,ie,we){super(),this.loop=j,this.varKind=X,this.name=ie,this.iterable=we}render(j){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(j)}optimizeNames(j,X){if(super.optimizeNames(j,X))return this.iterable=M(this.iterable,j,X),this}get names(){return B(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(j,X,ie){super(),this.name=j,this.args=X,this.async=ie}render(j){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(j)}}R.kind="func";class x extends g{static{a(this,"OW")}render(j){return"return "+super.render(j)}}x.kind="return";class k extends A{static{a(this,"kj")}render(j){let X="try"+super.render(j);return this.catch&&(X+=this.catch.render(j)),this.finally&&(X+=this.finally.render(j)),X}optimizeNodes(){var j,X;return super.optimizeNodes(),(j=this.catch)===null||j===void 0||j.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames(j,X){var ie,we;return super.optimizeNames(j,X),(ie=this.catch)===null||ie===void 0||ie.optimizeNames(j,X),(we=this.finally)===null||we===void 0||we.optimizeNames(j,X),this}get names(){let j=super.names;return this.catch&&B(j,this.catch.names),this.finally&&B(j,this.finally.names),j}}class D extends A{static{a(this,"DW")}constructor(j){super(),this.error=j}render(j){return`catch(${this.error})`+super.render(j)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(j){return"finally"+super.render(j)}}N.kind="finally";class L{static{a(this,"Sj")}constructor(j,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?` -`:""},this._extScope=j,this._scope=new r.Scope({parent:j}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(j){return this._scope.name(j)}scopeName(j){return this._extScope.name(j)}scopeValue(j,X){let ie=this._extScope.value(j,X);return(this._values[ie.prefix]||(this._values[ie.prefix]=new Set)).add(ie),ie}getScopeValue(j,X){return this._extScope.getValue(j,X)}scopeRefs(j){return this._extScope.scopeRefs(j,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(j,X,ie,we){let Ae=this._scope.toName(X);return ie!==void 0&&we&&(this._constants[Ae.str]=ie),this._leafNode(new c(j,Ae,ie)),Ae}const(j,X,ie){return this._def(r.varKinds.const,j,X,ie)}let(j,X,ie){return this._def(r.varKinds.let,j,X,ie)}var(j,X,ie){return this._def(r.varKinds.var,j,X,ie)}assign(j,X,ie){return this._leafNode(new l(j,X,ie))}add(j,X){return this._leafNode(new u(j,t.operators.ADD,X))}code(j){return typeof j=="function"?j():j!==e.nil&&this._leafNode(new m(j)),this}object(...j){let X=["{"];for(let[ie,we]of j)X.length>1&&X.push(","),X.push(ie),(ie!==we||this.opts.es5)&&(X.push(":"),(0,e.addCodeArg)(X,we));return X.push("}"),new e._Code(X)}if(j,X,ie){if(this._blockNode(new _(j)),X&&ie)this.code(X).else().code(ie).endIf();else if(X)this.code(X).endIf();else if(ie)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(j){return this._elseNode(new _(j))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(j,X){return this._blockNode(j),X&&this.code(X).endFor(),this}for(j,X){return this._for(new b(j),X)}forRange(j,X,ie,we,Ae=this.opts.es5?r.varKinds.var:r.varKinds.let){let De=this._scope.toName(j);return this._for(new T(Ae,De,X,ie),()=>we(De))}forOf(j,X,ie,we=r.varKinds.const){let Ae=this._scope.toName(j);if(this.opts.es5){let De=X instanceof e.Name?X:this.var("_arr",X);return this.forRange("_i",0,e._`${De}.length`,Te=>{this.var(Ae,e._`${De}[${Te}]`),ie(Ae)})}return this._for(new w("of",we,Ae,X),()=>ie(Ae))}forIn(j,X,ie,we=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(j,e._`Object.keys(${X})`,ie);let Ae=this._scope.toName(j);return this._for(new w("in",we,Ae,X),()=>ie(Ae))}endFor(){return this._endBlockNode(v)}label(j){return this._leafNode(new d(j))}break(j){return this._leafNode(new f(j))}return(j){let X=new x;if(this._blockNode(X),this.code(j),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(j,X,ie){if(!X&&!ie)throw Error('CodeGen: "try" without "catch" and "finally"');let we=new k;if(this._blockNode(we),this.code(j),X){let Ae=this.name("e");this._currNode=we.catch=new D(Ae),X(Ae)}return ie&&(this._currNode=we.finally=new N,this.code(ie)),this._endBlockNode(D,N)}throw(j){return this._leafNode(new h(j))}block(j,X){return this._blockStarts.push(this._nodes.length),j&&this.code(j).endBlock(X),this}endBlock(j){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let ie=this._nodes.length-X;if(ie<0||j!==void 0&&ie!==j)throw Error(`CodeGen: wrong number of nodes: ${ie} vs ${j} expected`);return this._nodes.length=X,this}func(j,X=e.nil,ie,we){return this._blockNode(new R(j,X,ie)),we&&this.code(we).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(j=1){for(;j-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(j){return this._currNode.nodes.push(j),this}_blockNode(j){this._currNode.nodes.push(j),this._nodes.push(j)}_endBlockNode(j,X){let ie=this._currNode;if(ie instanceof j||X&&ie instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${j.kind}/${X.kind}`:j.kind}"`)}_elseNode(j){let X=this._currNode;if(!(X instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=j,this}get _root(){return this._nodes[0]}get _currNode(){let j=this._nodes;return j[j.length-1]}set _currNode(j){let X=this._nodes;X[X.length-1]=j}}t.CodeGen=L;function B(re,j){for(let X in j)re[X]=(re[X]||0)+(j[X]||0);return re}a(B,"v0");function Q(re,j){return j instanceof e._CodeOrName?B(re,j.names):re}a(Q,"ZW");function M(re,j,X){if(re instanceof e.Name)return ie(re);if(!we(re))return re;return new e._Code(re._items.reduce((Ae,De)=>(De instanceof e.Name&&(De=ie(De)),De instanceof e._Code?Ae.push(...De._items):Ae.push(De),Ae),[]));function ie(Ae){let De=X[Ae.str];return De===void 0||j[Ae.str]!==1?Ae:(delete j[Ae.str],De)}function we(Ae){return Ae instanceof e._Code&&Ae._items.some(De=>De instanceof e.Name&&j[De.str]===1&&X[De.str]!==void 0)}}a(M,"V9");function O(re,j){for(let X in j)re[X]=(re[X]||0)-(j[X]||0)}a(O,"dp");function q(re){return typeof re=="boolean"||typeof re=="number"||re===null?!re:e._`!${Y(re)}`}a(q,"vj"),t.not=q;var F=G(t.operators.AND);function U(...re){return re.reduce(F)}a(U,"np"),t.and=U;var W=G(t.operators.OR);function V(...re){return re.reduce(W)}a(V,"op"),t.or=V;function G(re){return(j,X)=>j===e.nil?X:X===e.nil?j:e._`${Y(j)} ${re} ${Y(X)}`}a(G,"Cj");function Y(re){return re instanceof e.Name?re:e._`(${re})`}a(Y,"zB")}),uc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=Rs(),r=_St();function n(R){let x={};for(let k of R)x[k]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:k,self:D}=R;if(!k.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let L in x)N[L]||w(R,`unknown keyword: "${L}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(x[k])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let k in R)if(k!=="$ref"&&x.all[k])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},k,D,N){if(!N){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return e._`${k}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let k of R)x(k);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:k,resultToName:D}){return(N,L,B,Q)=>{let M=B===void 0?L:B instanceof e.Name?(L instanceof e.Name?R(N,L,B):x(N,L,B),B):L instanceof e.Name?(x(N,B,L),L):k(L,B);return Q===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(k,!0),()=>R.assign(k,e._`${k} || {}`).code(e._`Object.assign(${k}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>{x===!0?R.assign(k,!0):(R.assign(k,e._`${k} || {}`),E(R,k,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,k)=>R.if(e._`${k} !== true && ${x} !== undefined`,()=>R.assign(k,e._`${x} === true ? true : ${k} > ${x} ? ${k} : ${x}`)),"mergeNames"),mergeToName:a((R,x,k)=>R.if(e._`${k} !== true`,()=>R.assign(k,x===!0?!0:e._`${k} > ${x} ? ${k} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let k=R.var("props",e._`{}`);return x!==void 0&&E(R,k,x),k}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,k){Object.keys(k).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,k){if(R instanceof e.Name){let D=x===b.Num;return k?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,k=R.opts.strictSchema){if(k){if(x=`strict mode: ${x}`,k===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),kV=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),jTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=Rs(),r=uc(),n=kV();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,k=h(E,_,v);b??(R||x)?u(w,k):d(T,e._`[${k}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(E,_,v){let{createErrors:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:k,propertyName:D,topSchemaRef:N,schemaPath:L}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),k.messages&&b.push([f.message,typeof v=="function"?v(E):v]),k.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${L}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),HOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=jTt(),r=Rs(),n=kV(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),gVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),AVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),CSt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=gVi(),r=AVi(),n=jTt(),o=Rs(),s=uc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(b,T){let{gen:w,data:R,opts:x}=b,k=h(T,x.coerceTypes),D=T.length>0&&!(k.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{k.length?m(b,T,k):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:k}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);k.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,k.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let B of w)(f.has(B)||B==="array"&&k.coerceTypes==="array")&&L(B);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function L(B){switch(B){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null +`}function G$i(t,e,r){return e!==void 0&&e>0?t.slice(r,r+e):r>0?t.slice(r):t}function QLr(t){return typeof t=="object"&&t!==null&&"type"in t&&t.type==="agent_metadata"}async function _Vc(t,e){let r=bXi(e.dir),n=V3e(r),o=e.offset??0,s=e.limit;if(t.listSessionSummaries){let u=await t.listSessionSummaries(n),d=t.listSessions?new Map((await t.listSessions(n)).map(g=>[g.sessionId,g])):void 0,f=[];for(let g of u){let A=d?.get(g.sessionId);if(d&&!A)continue;let y=A!==void 0&&g.mtimeA.sessionId));for(let[A,y]of d)g.has(A)||f.push({sessionId:A,mtime:y.mtime})}else Wl("listSessionSummaries without listSessions: gap-fill skipped; sessions lacking a sidecar will be omitted");f.sort((g,A)=>A.mtime-g.mtime);let h=G$i(f,s,o),m=h.filter(g=>g.info===void 0);if(m.length>0){let g=await $$i(t,m,e.dir,r),A=new Map(g.map(y=>[y.sessionId,y]));for(let y of h)y.info===void 0&&(y.info=A.get(y.sessionId)??null)}return h.flatMap(g=>g.info?[g.info]:[])}if(!t.listSessions)throw Error("sessionStore.listSessions is not implemented -- cannot list sessions. Provide a store with a listSessions() method.");let c=(await t.listSessions(n)).slice().sort((u,d)=>d.mtime-u.mtime),l=G$i(c,s,o);return $$i(t,l,e.dir,r)}async function $$i(t,e,r,n){return(await Promise.allSettled(e.map(async o=>{let s=await IXi(t,o.sessionId,r);if(!s)return null;let c=HTt(o.sessionId,TXi(s,o.mtime),n);return c?{...c,lastModified:o.mtime}:null}))).flatMap((o,s)=>{let c=e[s];return o.status==="fulfilled"?o.value?[o.value]:[]:[{sessionId:c.sessionId,summary:"",lastModified:c.mtime}]})}function TXi(t,e){let r=Buffer.from(t,"utf-8"),n=r.length,o=r.subarray(0,r9).toString("utf-8"),s=n>r9?r.subarray(n-r9).toString("utf-8"):o;return{mtime:e,size:n,head:o,tail:s}}function vVc(t){let e=t.trimEnd(),r=e.slice(e.lastIndexOf(` +`)+1);try{let n=dN(r);if(typeof n=="object"&&n!==null&&"timestamp"in n&&typeof n.timestamp=="string"){let o=Date.parse(n.timestamp);if(!Number.isNaN(o))return o}}catch{}return Date.now()}async function IXi(t,e,r){let n=YR(r),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?null:SXi(o)}async function CVc(t,e,r){if(!ph(e))return[];let n=YR(r.dir),o=await t.load({projectKey:n,sessionId:e});return!o||o.length===0?[]:WFc(o,{limit:r.limit,offset:r.offset,includeSystemMessages:r.includeSystemMessages})}async function bVc(t,e,r){if(!ph(e))return;let n=await IXi(t,e,r.dir);if(!n)return;let o=TXi(n,vVc(n));return HTt(e,o)??void 0}async function SVc(t,e,r,n){if(!ph(e))throw Error(`Invalid sessionId: ${e}`);if(!r.trim())throw Error("title must be non-empty");let o=YR(n);await t.append({projectKey:o,sessionId:e},[{type:"custom-title",customTitle:r.trim(),sessionId:e,uuid:(0,DTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function TVc(t,e,r,n){if(!ph(e))throw Error(`Invalid sessionId: ${e}`);if(r!==null){let s=u3e(r).trim();if(!s)throw Error("tag must be non-empty (use null to clear)");r=s}let o=YR(n);await t.append({projectKey:o,sessionId:e},[{type:"tag",tag:r??"",sessionId:e,uuid:(0,DTt.randomUUID)(),timestamp:new Date().toISOString()}])}async function IVc(t,e,r){if(!ph(e))throw Error(`Invalid sessionId: ${e}`);if(r.upToMessageId&&!ph(r.upToMessageId))throw Error(`Invalid upToMessageId: ${r.upToMessageId}`);let n=YR(r.dir),o=await t.load({projectKey:n,sessionId:e});if(!o||o.length===0)throw Error(`Session ${e} not found`);let{entries:s,forkedSessionId:c}=p8c(o,e,r);return await t.append({projectKey:n,sessionId:c},s),{sessionId:c}}async function xVc(t,e,r){if(!ph(e))return[];if(!t.listSubkeys)throw Error("sessionStore.listSubkeys is not implemented -- cannot list subagents. Provide a store with a listSubkeys() method.");let n=YR(r),o=await t.listSubkeys({projectKey:n,sessionId:e}),s=new Set;for(let c of o){if(!c.startsWith("subagents/"))continue;let l=c.split("/").at(-1);l.startsWith("agent-")&&s.add(l.slice(6))}return[...s]}async function wVc(t,e,r,n){if(!ph(e))return[];if(!r)return[];let o=YR(n.dir),s=`subagents/agent-${r}`;if(t.listSubkeys){let f=await t.listSubkeys({projectKey:o,sessionId:e}),h=`agent-${r}`,m=f.find(g=>g.startsWith("subagents/")&&g.split("/").at(-1)===h);if(!m)return[];s=m}let c=await t.load({projectKey:o,sessionId:e,subpath:s});if(!c||c.length===0)return[];let l=c.findLast(QLr),u=typeof l?.toolUseId=="string"?l.toolUseId:void 0,d=c.filter(f=>!QLr(f));return d.length===0?[]:JWi(Buffer.from(SXi(d)),{limit:n.limit,offset:n.offset},u)}function V$i(t,e){let r=(0,cc.relative)(e,t),n=r.split(cc.sep);if(n[0]===".."||(0,cc.isAbsolute)(r)||n.length<2)return null;let o=n[0],s=n[1];if(n.length===2&&s.endsWith(".jsonl"))return{projectKey:o,sessionId:s.replace(/\.jsonl$/,"")};if(n.length>=4){let c=n.slice(2),l=c.length-1;return c[l]=c.at(-1).replace(/\.jsonl$/,""),{projectKey:o,sessionId:s,subpath:c.join("/")}}return null}var W$i,dVi,DTt,NTt,qE,fVi,PEe,cc,pVi,hVi,mVi,AVi,yVi,EVi,TVi,IVi,nWi,UBr,iWi,qg,oWi,tB,jBr,EWi,qSt,HE,Wne,vo,Rm,vWi,rB,RWi,DWi,ZBr,NWi,sN,OEe,MWi,OWi,BWi,LWi,a_e,c_e,eLr,nB,Lne,o3e,WSt,v3e,zSt,ZWi,XWi,RZi,Fne,PZi,Wd,x8r,gTt,LZi,FZi,R8r,PLr,rXi,iXi,oXi,py,hXi,KDc,JDc,SBr,ZDc,XDc,tNc,rNc,qLr,qt,nNc,sB,oNc,sNc,aNc,Gd,$d,cNc,lNc,uNc,z$i,dNc,ZEe,fNc,jLr,pNc,XEe,hNc,mNc,Y$i,ITt,gNc,K$i,ANc,J$i,yNc,xTt,Z$i,HLr,GLr,X$i,$Lr,eVi,tVi,ENc,rVi,_Nc,vNc,CNc,bNc,SNc,TNc,INc,xNc,wNc,RNc,PNc,kNc,DNc,NNc,MNc,ONc,BNc,LNc,sSt,QHi,xs,uc,EV,wTt,FNc,nVi,iVi,aSt,UNc,uN,QNc,qNc,oVi,jNc,RTt,PTt,VLr,kTt,WLr,HNc,sVi,GNc,$Nc,VNc,WNc,zNc,YNc,KNc,JNc,ZNc,XNc,eMc,tMc,rMc,nMc,iMc,zLr,oMc,sMc,aMc,cMc,aVi,cVi,lMc,uMc,dMc,fMc,pMc,lVi,hMc,mMc,gMc,AMc,yMc,EMc,_Mc,vMc,CMc,bMc,SMc,TMc,IMc,xMc,wMc,RMc,uVi,PMc,kMc,DMc,NMc,MTt,OMc,BMc,LMc,FMc,UMc,IBr,l1,GMc,CVi,$Mc,VMc,e_e,WMc,hV,bVi,zMc,YMc,DLe,JMc,ZMc,XMc,tOc,rOc,nOc,qHi,j3e,o9,sOc,aOc,cOc,lOc,KLr,dOc,V4r,jHi,pOc,hOc,mOc,AOc,yOc,EOc,_Oc,vOc,COc,bOc,SOc,IOc,wOc,JLr,POc,f3e,DOc,MOc,OOc,BOc,LOc,UOc,QOc,qOc,HOc,GOc,VOc,HHi,zOc,OTt,BTt,JOc,ZOc,e5c,r5c,i5c,s5c,LTt,a5c,SVi,l5c,d5c,FTt,h5c,g5c,y5c,_5c,ZLr,v5c,hy,i_e,R5h,xVi,xBr,Ii,Ov,cI,kEe,cSt,lSt,uSt,dSt,fSt,pSt,hSt,mSt,gSt,C5c,b5c,wBr,GHi,T5c,wVi,I5c,lV,x5c,R5c,VHi,WHi,zHi,e3r,N5c,O5c,B5c,kVi,ASt,L5c,F5c,r3r,U5c,YHi,W4r,Q5c,zl,PBr,Vl,KHi,JHi,ySt,XHi,H5c,eGi,kne,BVi,G5c,$5c,V5c,i3r,W5c,FVi,oI,sI,Une,NLe,Qne,kBr,e3e,ESt,L1t,_St,DBr,qne,jE,jVi,HVi,o3r,rGi,a4c,c4c,NBr,GVi,l4c,u4c,Ad,$Vi,mr,nGi,h4c,$n,vSt,c3e,CSt,bSt,SSt,TSt,h3e,ISt,xSt,DEe,wSt,RSt,YVi,A4c,_Ee,y4c,E4c,ZVi,LR,rV,pEe,MLe,F1t,OLe,BLe,U1t,LLe,K6,FLe,Q1t,q1t,xne,j1t,H1t,ULe,z4r,oGi,G1t,Y4r,K4r,J4r,sGi,aGi,OBr,PSt,_4c,v4c,QLe,hEe,wne,Tm,c1,iI,t9,nV,qLe,lGi,BBr,kSt,dGi,b4c,jne,DSt,NSt,NEe,MSt,m3e,OSt,g3e,u1,BSt,FR,iV,mEe,jLe,$1t,HLe,GLe,V1t,$Le,J6,VLe,W1t,z1t,Rne,Y1t,K1t,WLe,Z4r,hGi,X4r,eBr,tBr,rBr,mGi,gGi,LBr,LSt,A3e,yGi,T4c,FSt,FBr,s3r,iSt,tWi,I4c,x4c,Ip,MEe,R4c,P4c,QBr,D4c,One,gEe,O4c,L4c,U4c,q4c,j4c,G4c,$4c,V4c,QSt,a3r,z4c,Y4c,aWi,Z4c,eBc,s_e,rBc,EGi,cWi,iBc,oBc,sBc,y3e,aBc,mV,t3e,lBc,lWi,_Gi,uBc,vGi,dBc,fBc,c3r,pBc,hBc,UTt,gBc,l3r,yBc,EBc,_Bc,vBc,CBc,bBc,SBc,TBc,IBc,xBc,wBc,RBc,PBc,kBc,DBc,NBc,MBc,OBc,BBc,LBc,FBc,UBc,QBc,qBc,md,HBc,$Bc,r3e,uWi,l3e,VBc,nBr,WBc,qBr,CGi,zBc,dWi,YBc,KBc,ZBc,XBc,fWi,rLc,u3r,oLc,sLc,aLc,lLc,pWi,n3e,hWi,bGi,dLc,SGi,TGi,mWi,hLc,gLc,ALc,gWi,yLc,IGi,_Lc,CLc,xGi,bLc,SLc,ILc,xLc,d3r,RLc,PLc,DLc,NLc,OLc,BLc,LLc,FLc,ULc,qLc,jLc,wGi,RGi,HLc,$Lc,QTt,WLc,f3r,KLc,ZLc,e3c,r3c,yWi,p3r,jSt,c3c,h3r,d3c,h3c,g3c,A3c,y3c,P5h,E3c,k5h,_3c,D5h,v3c,N5h,C3c,M5h,HBr,T3c,x3c,M3c,O3c,O5h,B5h,q3c,kGi,DGi,j3c,H3c,NGi,GBr,V3c,W3c,$Br,z3c,bWi,SWi,K3c,J3c,J1t,iBr,zLe,oBr,VBr,wWi,L5h,eFc,Vd,dN,oFc,HSt,MGi,zBr,AEe,GSt,pFc,YBr,KBr,A3r,y3r,mFc,JBr,OGi,sBr,yFc,CFc,r9,SFc,E3e,wFc,RFc,PFc,VSt,DFc,_3e,NFc,MFc,YFc,c8c,_8c,rzi,v8c,C8c,b8c,U5h,BGi,S8c,I8c,w8c,P8c,lc,LGi,wn,aV,hr,GR,D8c,C3e,N8c,rLr,Bv,eo,s3e,d1,FGi,UGi,BEe,YSt,Kn,VR,QGi,ws,M8c,O8c,B8c,L8c,F8c,U8c,Q8c,q8c,j8c,uBr,H8c,G8c,$8c,V8c,W8c,z8c,nzi,Y8c,LEe,b3e,S3e,T3e,I3e,x3e,FEe,UEe,w3e,pV,iB,R3e,AV,dI,QEe,X6,nLr,qEe,s9,oLr,P3e,k3e,sLr,jEe,HEe,GEe,$Ee,Hne,aN,$R,a9,VEe,WEe,D3e,KSt,JSt,zEe,Q5h,Cr,q5h,j5h,H5h,G5h,$5h,V5h,W5h,z5h,Y5h,K5h,J5h,Z5h,X5h,e4h,r6c,t4h,r4h,n4h,i4h,o4h,s4h,a4h,c4h,l4h,u4h,d4h,f4h,p4h,h4h,m4h,g4h,A4h,y4h,E4h,szi,azi,czi,yV,ZSt,Qs,v3r,dzi,f6c,XSt,fzi,hzi,mzi,aLr,Azi,C3r,z3e,T3r,eTt,I3r,tTt,x3r,zTt,w3r,YTt,R3r,vzi,Czi,bzi,Szi,Tzi,Izi,xzi,v6c,wzi,YEe,C6c,b6c,S6c,Rzi,T6c,I6c,x6c,w6c,R6c,kzi,Dzi,Nzi,Mzi,Ozi,P3r,Bzi,P6c,Lzi,Fzi,Uzi,Hzi,Gzi,$zi,Vzi,Wzi,zzi,Yzi,Kzi,Jzi,hh,Zzi,k3r,D3r,Xzi,eYi,tYi,rYi,nYi,iYi,oYi,sYi,aYi,Y3e,cYi,lYi,uYi,dYi,fYi,pYi,hYi,mYi,gYi,rTt,AYi,Co,K3e,Ru,yYi,EYi,_Yi,vYi,CYi,bYi,SYi,TYi,IYi,xYi,wYi,RYi,PYi,kYi,DYi,NYi,MYi,OYi,BYi,LYi,UYi,QYi,jYi,HYi,M3r,GYi,O3r,B3r,$Yi,VYi,WYi,zYi,YYi,nTt,KYi,JYi,ZYi,L3r,F3r,U3r,XYi,eKi,KTt,tKi,rKi,nKi,iKi,oKi,sKi,Q3r,aKi,cKi,lKi,uKi,dKi,fKi,pKi,hKi,q3r,mKi,gKi,AKi,yKi,EKi,j3r,k6c,N6c,O6c,L6c,U6c,q6c,H6c,G6c,$6c,V6c,z6c,K6c,Z6c,e9c,r9c,i9c,s9c,c9c,u9c,f9c,h9c,g9c,y9c,_9c,C9c,S9c,I9c,w9c,P9c,D9c,M9c,B9c,F9c,Q9c,j9c,G9c,$9c,W9c,Y9c,J9c,X9c,tUc,vKi,CKi,O3e,n9,TKi,sTt,F3e,SUc,TUc,IUc,G,TFr,IFr,xFr,wFr,RFr,mJi,RUc,Z3e,gJi,AJi,yJi,EJi,Rs,PFr,eIt,yd,kFr,aTt,i9,DFr,NFr,MFr,OFr,BFr,LFr,FFr,UFr,QFr,qFr,jFr,HFr,GFr,$Fr,VFr,WFr,_Ji,tIt,l_e,rIt,nIt,zFr,vJi,CJi,bJi,SJi,TJi,IJi,xJi,KFr,wJi,oIt,JFr,RJi,PJi,kJi,XFr,DJi,NJi,U3e,MJi,OJi,e8r,r8r,BJi,LJi,UJi,n8r,jJi,HJi,$Ji,i8r,VJi,zJi,YJi,JJi,aIt,T7c,x7c,rZi,O7c,nZi,iZi,B7c,Dne,cIt,wm,oZi,sZi,_4h,L7c,F7c,s8r,fI,X3e,U7c,my,WR,zR,gy,lIt,aZi,r$i,cZi,Q7c,a8r,eSt,Oi,c8r,q7c,v4h,C4h,l8r,j7c,u8r,H7c,eFe,JEe,lZi,G7c,$7c,V7c,W7c,z7c,Y7c,uZi,K7c,J7c,dZi,d8r,Z7c,X7c,f8r,eQc,tFe,rFe,tQc,nFe,uIt,rQc,uTt,p8r,h8r,m8r,b4h,g8r,A8r,y8r,nQc,fZi,pZi,E8r,hZi,iFe,u_e,mZi,iQc,uLr,oQc,dLr,sQc,_8r,aQc,fLr,cQc,lQc,uQc,dQc,fQc,pQc,hQc,mQc,gQc,AQc,pLr,yQc,EQc,hLr,v8r,C8r,b8r,_Qc,vQc,CQc,S8r,bQc,SQc,TQc,IQc,xQc,gZi,mLr,wQc,T8r,S4h,RQc,dTt,PQc,T4h,fTt,kQc,AZi,DQc,NQc,MQc,OQc,BQc,LQc,FQc,pTt,UQc,QQc,qQc,I8r,yZi,jQc,HQc,GQc,$Qc,VQc,WQc,zQc,YQc,KQc,JQc,ZQc,XQc,eqc,tqc,rqc,nqc,iqc,oqc,hTt,sqc,aqc,cqc,gLr,dqc,fqc,pqc,EZi,hqc,I4h,x4h,w4h,R4h,P4h,k4h,ui,ALr,mqc,n$i,gqc,Aqc,vZi,vqc,Cqc,Iqc,pBr,rN,Rqc,mTt,o$i,qqc,jqc,zqc,Yqc,Kqc,Jqc,Zqc,ejc,yLr,rjc,njc,ELr,_Lr,vLr,IZi,d$i,cjc,CLr,bLr,djc,KLe,m$i,gjc,qR,TLr,A$i,D4h,N4h,y$i,E$i,_$i,v$i,uV,w8r,SEe,bjc,Sjc,Tjc,M4h,Rjc,mBr,kjc,C$i,O4h,yEe,NZi,xLr,MZi,ATt,b$i,Djc,sV,OZi,wEe,wLr,RLr,Mjc,S$i,fIt,pIt,L4h,F4h,U4h,Q3e,Q4h,Ojc,Bjc,Ljc,Fjc,Ujc,Qjc,qjc,jjc,q4h,P8r,Hjc,Gjc,j4h,H4h,$jc,JLe,Wjc,zjc,yTt,G4h,$4h,d_e,vV,Yjc,Kjc,UZi,Jjc,Zjc,Xjc,eHc,tHc,rHc,nHc,iHc,kLr,V4h,QZi,oHc,sHc,lN,Vne,T$i,DLr,NLr,qZi,k8r,cHc,W4h,lHc,uHc,dHc,fHc,pHc,jZi,HZi,hHc,I$i,mHc,gHc,GZi,AHc,yHc,x$i,EHc,_Hc,$Zi,vHc,VZi,CHc,bHc,SHc,ETt,gBr,WZi,THc,IHc,xHc,wHc,RHc,z4h,zZi,kHc,DHc,NHc,MHc,OHc,BHc,LHc,Y4h,FHc,K4h,UHc,QHc,qHc,tSt,hIt,w$i,KZi,J4h,Z4h,_Tt,yBr,eGc,X4h,tGc,eXi,tXi,rGc,R$i,f_e,e9,iGc,oGc,eBh,lGc,dGc,M$i,MLr,OLr,TEe,pGc,hGc,mGc,O$i,vTt,AGc,cV,sXi,aXi,cXi,CTt,BLr,PGc,kGc,DGc,MGc,OGc,BGc,LGc,lXi,FGc,UGc,qGc,LLr,GGc,VGc,WGc,YGc,U$i,dXi,ZGc,XGc,e$c,t$c,r$c,n$c,o$c,s$c,fXi,c$c,u$c,f$c,p$c,dV,m$c,A$c,E$c,Q$i,v$c,C$c,S$c,I$c,x$c,_Br,w$c,vBr,R$c,bBr,Y$c,j$i,K$c,J$c,Z$c,oVc,wXi=_e(()=>{p();W$i=require("node:module"),dVi=require("child_process"),DTt=require("crypto"),NTt=require("fs"),qE=require("fs/promises"),fVi=require("module"),PEe=require("os"),cc=require("path"),pVi=require("readline"),hVi=require("url"),mVi=require("events"),AVi=require("child_process"),yVi=require("fs"),EVi=require("readline"),TVi=require("os"),IVi=require("path"),nWi=require("crypto"),UBr=require("path"),iWi=require("async_hooks"),qg=require("fs/promises"),oWi=require("crypto"),tB=require("fs/promises"),jBr=require("fs"),EWi=require("process"),qSt=require("crypto"),HE=require("fs/promises"),Wne=require("path"),vo=fe(require("fs"),1),Rm=require("fs/promises"),vWi=require("fs"),rB=require("path"),RWi=require("fs"),DWi=require("fs/promises"),ZBr=require("events"),NWi=require("fs"),sN=require("fs/promises"),OEe=require("path"),MWi=require("child_process"),OWi=require("util"),BWi=require("child_process"),LWi=require("path"),a_e=require("fs/promises"),c_e=require("path"),eLr=require("fs"),nB=require("fs/promises"),Lne=require("path"),o3e=require("crypto"),WSt=require("path"),v3e=require("fs/promises"),zSt=require("path"),ZWi=require("crypto"),XWi=require("os"),RZi=require("path"),Fne=require("path"),PZi=require("path"),Wd=fe(require("node:path"),1),x8r=fe(require("node:os"),1),gTt=fe(require("node:process"),1),LZi=require("path"),FZi=require("fs/promises"),R8r=require("os"),PLr=require("path"),rXi=require("os"),iXi=require("child_process"),oXi=require("fs"),py=require("path"),hXi=require("path"),KDc=Object.create,{getPrototypeOf:JDc,defineProperty:SBr,getOwnPropertyNames:ZDc}=Object,XDc=Object.prototype.hasOwnProperty;a(eNc,"a_");qLr=a((t,e,r)=>{var n=t!=null&&typeof t=="object";if(n){var o=e?tNc??=new WeakMap:rNc??=new WeakMap,s=o.get(t);if(s)return s}r=t!=null?KDc(JDc(t)):{};let c=e||!t||!t.__esModule?SBr(r,"default",{value:t,enumerable:!0}):r;for(let l of ZDc(t))XDc.call(c,l)||SBr(c,l,{get:eNc.bind(t,l),enumerable:!0});return n&&o.set(t,c),c},"DG"),qt=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"I"),nNc=a(t=>t,"$k");a(iNc,"Qk");sB=a((t,e)=>{for(var r in e)SBr(t,r,{get:e[r],enumerable:!0,configurable:!0,set:iNc.bind(e,r)})},"M4"),oNc=(0,W$i.createRequire)(importMetaUrlShim),sNc=Symbol.dispose||Symbol.for("Symbol.dispose"),aNc=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),Gd=a((t,e,r)=>{if(e!=null){if(typeof e!="object"&&typeof e!="function")throw TypeError('Object expected to be assigned to "using" declaration');var n;if(r&&(n=e[aNc]),n===void 0&&(n=e[sNc]),typeof n!="function")throw TypeError("Object not disposable");t.push([r,n,e])}else r&&t.push([r]);return e},"Z$"),$d=a((t,e,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(c,l,u,d){return d=Error(u),d.name="SuppressedError",d.error=c,d.suppressed=l,d},o=a(c=>e=r?new n(c,e,"An error was suppressed during disposal"):(r=!0,c),"X"),s=a(c=>{for(;c=t.pop();)try{var l=c[1]&&c[1].call(c[2]);if(c[0])return Promise.resolve(l).then(s,u=>(o(u),s()))}catch(u){o(u)}if(r)throw e},"W");return s()},"M$"),cNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._globalThis=void 0,t._globalThis=typeof globalThis=="object"?globalThis:global}),lNc=qt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(cNc(),t)}),uNc=qt(t=>{var e=t&&t.__createBinding||(Object.create?function(n,o,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:a(function(){return o[s]},"get")})}:function(n,o,s,c){c===void 0&&(c=s),n[c]=o[s]}),r=t&&t.__exportStar||function(n,o){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&e(o,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(lNc(),t)}),z$i=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.9.0"}),dNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;var e=z$i(),r=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function n(o){let s=new Set([o]),c=new Set,l=o.match(r);if(!l)return()=>!1;let u={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};if(u.prerelease!=null)return function(h){return h===o};function d(h){return c.add(h),!1}a(d,"W");function f(h){return s.add(h),!0}return a(f,"G"),function(h){if(s.has(h))return!0;if(c.has(h))return!1;let m=h.match(r);if(!m)return d(h);let g={major:+m[1],minor:+m[2],patch:+m[3],prerelease:m[4]};return g.prerelease!=null||u.major!==g.major?d(h):u.major===0?u.minor===g.minor&&u.patch<=g.patch?f(h):d(h):u.minor<=g.minor?f(h):d(h)}}a(n,"b2"),t._makeCompatibilityCheck=n,t.isCompatible=n(e.VERSION)}),ZEe=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;var e=uNc(),r=z$i(),n=dNc(),o=r.VERSION.split(".")[0],s=Symbol.for(`opentelemetry.js.api.${o}`),c=e._globalThis;function l(f,h,m,g=!1){var A;let y=c[s]=(A=c[s])!==null&&A!==void 0?A:{version:r.VERSION};if(!g&&y[f]){let E=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${f}`);return m.error(E.stack||E.message),!1}if(y.version!==r.VERSION){let E=Error(`@opentelemetry/api: Registration of version v${y.version} for ${f} does not match previously registered API v${r.VERSION}`);return m.error(E.stack||E.message),!1}return y[f]=h,m.debug(`@opentelemetry/api: Registered a global for ${f} v${r.VERSION}.`),!0}a(l,"ex"),t.registerGlobal=l;function u(f){var h,m;let g=(h=c[s])===null||h===void 0?void 0:h.version;if(!(!g||!(0,n.isCompatible)(g)))return(m=c[s])===null||m===void 0?void 0:m[f]}a(u,"$y"),t.getGlobal=u;function d(f,h){h.debug(`@opentelemetry/api: Unregistering a global for ${f} v${r.VERSION}.`);let m=c[s];m&&delete m[f]}a(d,"Qy"),t.unregisterGlobal=d}),fNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;var e=ZEe();class r{static{a(this,"T2")}constructor(s){this._namespace=s.namespace||"DiagComponentLogger"}debug(...s){return n("debug",this._namespace,s)}error(...s){return n("error",this._namespace,s)}info(...s){return n("info",this._namespace,s)}warn(...s){return n("warn",this._namespace,s)}verbose(...s){return n("verbose",this._namespace,s)}}t.DiagComponentLogger=r;function n(o,s,c){let l=(0,e.getGlobal)("diag");if(l)return c.unshift(s),l[o](...c)}a(n,"lQ")}),jLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.ERROR=30]="ERROR",r[r.WARN=50]="WARN",r[r.INFO=60]="INFO",r[r.DEBUG=70]="DEBUG",r[r.VERBOSE=80]="VERBOSE",r[r.ALL=9999]="ALL"})(e=t.DiagLogLevel||(t.DiagLogLevel={}))}),pNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;var e=jLr();function r(n,o){ne.DiagLogLevel.ALL&&(n=e.DiagLogLevel.ALL),o=o||{};function s(c,l){let u=o[c];return typeof u=="function"&&n>=l?u.bind(o):function(){}}return a(s,"J"),{error:s("error",e.DiagLogLevel.ERROR),warn:s("warn",e.DiagLogLevel.WARN),info:s("info",e.DiagLogLevel.INFO),debug:s("debug",e.DiagLogLevel.DEBUG),verbose:s("verbose",e.DiagLogLevel.VERBOSE)}}a(r,"Gy"),t.createLogLevelDiagLogger=r}),XEe=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;var e=fNc(),r=pNc(),n=jLr(),o=ZEe(),s="diag";class c{static{a(this,"kU")}constructor(){function u(h){return function(...m){let g=(0,o.getGlobal)("diag");if(g)return g[h](...m)}}a(u,"$");let d=this,f=a((h,m={logLevel:n.DiagLogLevel.INFO})=>{var g,A,y;if(h===d){let v=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return d.error((g=v.stack)!==null&&g!==void 0?g:v.message),!1}typeof m=="number"&&(m={logLevel:m});let E=(0,o.getGlobal)("diag"),_=(0,r.createLogLevelDiagLogger)((A=m.logLevel)!==null&&A!==void 0?A:n.DiagLogLevel.INFO,h);if(E&&!m.suppressOverrideMessage){let v=(y=Error().stack)!==null&&y!==void 0?y:"";E.warn(`Current logger will be overwritten from ${v}`),_.warn(`Current logger will overwrite one already registered from ${v}`)}return(0,o.registerGlobal)("diag",_,d,!0)},"J");d.setLogger=f,d.disable=()=>{(0,o.unregisterGlobal)(s,d)},d.createComponentLogger=h=>new e.DiagComponentLogger(h),d.verbose=u("verbose"),d.debug=u("debug"),d.info=u("info"),d.warn=u("warn"),d.error=u("error")}static instance(){return this._instance||(this._instance=new c),this._instance}}t.DiagAPI=c}),hNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class e{static{a(this,"P8")}constructor(n){this._entries=n?new Map(n):new Map}getEntry(n){let o=this._entries.get(n);if(o)return Object.assign({},o)}getAllEntries(){return Array.from(this._entries.entries()).map(([n,o])=>[n,o])}setEntry(n,o){let s=new e(this._entries);return s._entries.set(n,o),s}removeEntry(n){let o=new e(this._entries);return o._entries.delete(n),o}removeEntries(...n){let o=new e(this._entries);for(let s of n)o._entries.delete(s);return o}clear(){return new e}}t.BaggageImpl=e}),mNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")}),Y$i=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;var e=XEe(),r=hNc(),n=mNc(),o=e.DiagAPI.instance();function s(l={}){return new r.BaggageImpl(new Map(Object.entries(l)))}a(s,"Ny"),t.createBaggage=s;function c(l){return typeof l!="string"&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof l}`),l=""),{__TYPE__:n.baggageEntryMetadataSymbol,toString(){return l}}}a(c,"wy"),t.baggageEntryMetadataFromString=c}),ITt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0;function e(n){return Symbol.for(n)}a(e,"Dy"),t.createContextKey=e;class r{static{a(this,"DX")}constructor(o){let s=this;s._currentContext=o?new Map(o):new Map,s.getValue=c=>s._currentContext.get(c),s.setValue=(c,l)=>{let u=new r(s._currentContext);return u._currentContext.set(c,l),u},s.deleteValue=c=>{let l=new r(s._currentContext);return l._currentContext.delete(c),l}}}t.ROOT_CONTEXT=new r}),gNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;var e=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];class r{static{a(this,"QD")}constructor(){function o(s){return function(...c){if(console){let l=console[s];if(typeof l!="function"&&(l=console.log),typeof l=="function")return l.apply(console,c)}}}a(o,"$");for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_GAUGE_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopGaugeMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class e{static{a(this,"CU")}constructor(){}createGauge(g,A){return t.NOOP_GAUGE_METRIC}createHistogram(g,A){return t.NOOP_HISTOGRAM_METRIC}createCounter(g,A){return t.NOOP_COUNTER_METRIC}createUpDownCounter(g,A){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(g,A){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(g,A){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(g,A){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(g,A){}removeBatchObservableCallback(g){}}t.NoopMeter=e;class r{static{a(this,"E8")}}t.NoopMetric=r;class n extends r{static{a(this,"TU")}add(g,A){}}t.NoopCounterMetric=n;class o extends r{static{a(this,"xU")}add(g,A){}}t.NoopUpDownCounterMetric=o;class s extends r{static{a(this,"yU")}record(g,A){}}t.NoopGaugeMetric=s;class c extends r{static{a(this,"fU")}record(g,A){}}t.NoopHistogramMetric=c;class l{static{a(this,"pQ")}addCallback(g){}removeCallback(g){}}t.NoopObservableMetric=l;class u extends l{static{a(this,"gU")}}t.NoopObservableCounterMetric=u;class d extends l{static{a(this,"hU")}}t.NoopObservableGaugeMetric=d;class f extends l{static{a(this,"uU")}}t.NoopObservableUpDownCounterMetric=f,t.NOOP_METER=new e,t.NOOP_COUNTER_METRIC=new n,t.NOOP_GAUGE_METRIC=new s,t.NOOP_HISTOGRAM_METRIC=new c,t.NOOP_UP_DOWN_COUNTER_METRIC=new o,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new d,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new f;function h(){return t.NOOP_METER}a(h,"Zy"),t.createNoopMeter=h}),ANc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0;var e;(function(r){r[r.INT=0]="INT",r[r.DOUBLE=1]="DOUBLE"})(e=t.ValueType||(t.ValueType={}))}),J$i=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,r){if(e!=null)return e[r]},keys(e){return e==null?[]:Object.keys(e)}},t.defaultTextMapSetter={set(e,r,n){e!=null&&(e[r]=n)}}}),yNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;var e=ITt();class r{static{a(this,"ZD")}active(){return e.ROOT_CONTEXT}with(o,s,c,...l){return s.call(c,...l)}bind(o,s){return s}enable(){return this}disable(){return this}}t.NoopContextManager=r}),xTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;var e=yNc(),r=ZEe(),n=XEe(),o="context",s=new e.NoopContextManager;class c{static{a(this,"iU")}constructor(){}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalContextManager(u){return(0,r.registerGlobal)(o,u,n.DiagAPI.instance())}active(){return this._getContextManager().active()}with(u,d,f,...h){return this._getContextManager().with(u,d,f,...h)}bind(u,d){return this._getContextManager().bind(u,d)}_getContextManager(){return(0,r.getGlobal)(o)||s}disable(){this._getContextManager().disable(),(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.ContextAPI=c}),Z$i=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0;var e;(function(r){r[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED"})(e=t.TraceFlags||(t.TraceFlags={}))}),HLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;var e=Z$i();t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:e.TraceFlags.NONE}}),GLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;var e=HLr();class r{static{a(this,"SD")}constructor(o=e.INVALID_SPAN_CONTEXT){this._spanContext=o}spanContext(){return this._spanContext}setAttribute(o,s){return this}setAttributes(o){return this}addEvent(o,s){return this}addLink(o){return this}addLinks(o){return this}setStatus(o){return this}updateName(o){return this}end(o){}isRecording(){return!1}recordException(o,s){}}t.NonRecordingSpan=r}),X$i=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;var e=ITt(),r=GLr(),n=xTt(),o=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function s(h){return h.getValue(o)||void 0}a(s,"tU"),t.getSpan=s;function c(){return s(n.ContextAPI.getInstance().active())}a(c,"my"),t.getActiveSpan=c;function l(h,m){return h.setValue(o,m)}a(l,"TD"),t.setSpan=l;function u(h){return h.deleteValue(o)}a(u,"ly"),t.deleteSpan=u;function d(h,m){return l(h,new r.NonRecordingSpan(m))}a(d,"cy"),t.setSpanContext=d;function f(h){var m;return(m=s(h))===null||m===void 0?void 0:m.spanContext()}a(f,"py"),t.getSpanContext=f}),$Lr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;var e=HLr(),r=GLr(),n=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function s(d){return n.test(d)&&d!==e.INVALID_TRACEID}a(s,"gD"),t.isValidTraceId=s;function c(d){return o.test(d)&&d!==e.INVALID_SPANID}a(c,"hD"),t.isValidSpanId=c;function l(d){return s(d.traceId)&&c(d.spanId)}a(l,"ey"),t.isSpanContextValid=l;function u(d){return new r.NonRecordingSpan(d)}a(u,"$f"),t.wrapSpanContext=u}),eVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;var e=xTt(),r=X$i(),n=GLr(),o=$Lr(),s=e.ContextAPI.getInstance();class c{static{a(this,"cD")}startSpan(d,f,h=s.active()){if(f?.root)return new n.NonRecordingSpan;let m=h&&(0,r.getSpanContext)(h);return l(m)&&(0,o.isSpanContextValid)(m)?new n.NonRecordingSpan(m):new n.NonRecordingSpan}startActiveSpan(d,f,h,m){let g,A,y;if(arguments.length<2)return;arguments.length===2?y=f:arguments.length===3?(g=f,y=h):(g=f,A=h,y=m);let E=A??s.active(),_=this.startSpan(d,g,E),v=(0,r.setSpan)(E,_);return s.with(v,y,void 0,_)}}t.NoopTracer=c;function l(u){return typeof u=="object"&&typeof u.spanId=="string"&&typeof u.traceId=="string"&&typeof u.traceFlags=="number"}a(l,"Gf")}),tVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;var e=eVi(),r=new e.NoopTracer;class n{static{a(this,"iD")}constructor(s,c,l,u){this._provider=s,this.name=c,this.version=l,this.options=u}startSpan(s,c,l){return this._getTracer().startSpan(s,c,l)}startActiveSpan(s,c,l,u){let d=this._getTracer();return Reflect.apply(d.startActiveSpan,d,arguments)}_getTracer(){if(this._delegate)return this._delegate;let s=this._provider.getDelegateTracer(this.name,this.version,this.options);return s?(this._delegate=s,this._delegate):r}}t.ProxyTracer=n}),ENc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;var e=eVi();class r{static{a(this,"oD")}getTracer(o,s,c){return new e.NoopTracer}}t.NoopTracerProvider=r}),rVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;var e=tVi(),r=ENc(),n=new r.NoopTracerProvider;class o{static{a(this,"eD")}getTracer(c,l,u){var d;return(d=this.getDelegateTracer(c,l,u))!==null&&d!==void 0?d:new e.ProxyTracer(this,c,l,u)}getDelegate(){var c;return(c=this._delegate)!==null&&c!==void 0?c:n}setDelegate(c){this._delegate=c}getDelegateTracer(c,l,u){var d;return(d=this._delegate)===null||d===void 0?void 0:d.getTracer(c,l,u)}}t.ProxyTracerProvider=o}),_Nc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0;var e;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e=t.SamplingDecision||(t.SamplingDecision={}))}),vNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0;var e;(function(r){r[r.INTERNAL=0]="INTERNAL",r[r.SERVER=1]="SERVER",r[r.CLIENT=2]="CLIENT",r[r.PRODUCER=3]="PRODUCER",r[r.CONSUMER=4]="CONSUMER"})(e=t.SpanKind||(t.SpanKind={}))}),CNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0;var e;(function(r){r[r.UNSET=0]="UNSET",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR"})(e=t.SpanStatusCode||(t.SpanStatusCode={}))}),bNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;var e="[_0-9a-z-*/]",r=`[a-z]${e}{0,255}`,n=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,o=new RegExp(`^(?:${r}|${n})$`),s=/^[ -~]{0,255}[!-~]$/,c=/,|=/;function l(d){return o.test(d)}a(l,"Lf"),t.validateKey=l;function u(d){return s.test(d)&&!c.test(d)}a(u,"jf"),t.validateValue=u}),SNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;var e=bNc(),r=32,n=512,o=",",s="=";class c{static{a(this,"UH")}constructor(u){this._internalState=new Map,u&&this._parse(u)}set(u,d){let f=this._clone();return f._internalState.has(u)&&f._internalState.delete(u),f._internalState.set(u,d),f}unset(u){let d=this._clone();return d._internalState.delete(u),d}get(u){return this._internalState.get(u)}serialize(){return this._keys().reduce((u,d)=>(u.push(d+s+this.get(d)),u),[]).join(o)}_parse(u){u.length>n||(this._internalState=u.split(o).reverse().reduce((d,f)=>{let h=f.trim(),m=h.indexOf(s);if(m!==-1){let g=h.slice(0,m),A=h.slice(m+1,f.length);(0,e.validateKey)(g)&&(0,e.validateValue)(A)&&d.set(g,A)}return d},new Map),this._internalState.size>r&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,r))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let u=new c;return u._internalState=new Map(this._internalState),u}}t.TraceStateImpl=c}),TNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;var e=SNc();function r(n){return new e.TraceStateImpl(n)}a(r,"Pf"),t.createTraceState=r}),INc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0;var e=xTt();t.context=e.ContextAPI.getInstance()}),xNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0;var e=XEe();t.diag=e.DiagAPI.instance()}),wNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;var e=K$i();class r{static{a(this,"HH")}getMeter(o,s,c){return e.NOOP_METER}}t.NoopMeterProvider=r,t.NOOP_METER_PROVIDER=new r}),RNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;var e=wNc(),r=ZEe(),n=XEe(),o="metrics";class s{static{a(this,"VH")}constructor(){}static getInstance(){return this._instance||(this._instance=new s),this._instance}setGlobalMeterProvider(l){return(0,r.registerGlobal)(o,l,n.DiagAPI.instance())}getMeterProvider(){return(0,r.getGlobal)(o)||e.NOOP_METER_PROVIDER}getMeter(l,u,d){return this.getMeterProvider().getMeter(l,u,d)}disable(){(0,r.unregisterGlobal)(o,n.DiagAPI.instance())}}t.MetricsAPI=s}),PNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0;var e=RNc();t.metrics=e.MetricsAPI.getInstance()}),kNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0;class e{static{a(this,"fF")}inject(n,o){}extract(n,o){return n}fields(){return[]}}t.NoopTextMapPropagator=e}),DNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;var e=xTt(),r=ITt(),n=(0,r.createContextKey)("OpenTelemetry Baggage Key");function o(u){return u.getValue(n)||void 0}a(o,"mF"),t.getBaggage=o;function s(){return o(e.ContextAPI.getInstance().active())}a(s,"xf"),t.getActiveBaggage=s;function c(u,d){return u.setValue(n,d)}a(c,"yf"),t.setBaggage=c;function l(u){return u.deleteValue(n)}a(l,"ff"),t.deleteBaggage=l}),NNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;var e=ZEe(),r=kNc(),n=J$i(),o=DNc(),s=Y$i(),c=XEe(),l="propagation",u=new r.NoopTextMapPropagator;class d{static{a(this,"wH")}constructor(){this.createBaggage=s.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new d),this._instance}setGlobalPropagator(h){return(0,e.registerGlobal)(l,h,c.DiagAPI.instance())}inject(h,m,g=n.defaultTextMapSetter){return this._getGlobalPropagator().inject(h,m,g)}extract(h,m,g=n.defaultTextMapGetter){return this._getGlobalPropagator().extract(h,m,g)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(l,c.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(l)||u}}t.PropagationAPI=d}),MNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0;var e=NNc();t.propagation=e.PropagationAPI.getInstance()}),ONc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;var e=ZEe(),r=rVi(),n=$Lr(),o=X$i(),s=XEe(),c="trace";class l{static{a(this,"FH")}constructor(){this._proxyTracerProvider=new r.ProxyTracerProvider,this.wrapSpanContext=n.wrapSpanContext,this.isSpanContextValid=n.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new l),this._instance}setGlobalTracerProvider(d){let f=(0,e.registerGlobal)(c,this._proxyTracerProvider,s.DiagAPI.instance());return f&&this._proxyTracerProvider.setDelegate(d),f}getTracerProvider(){return(0,e.getGlobal)(c)||this._proxyTracerProvider}getTracer(d,f){return this.getTracerProvider().getTracer(d,f)}disable(){(0,e.unregisterGlobal)(c,s.DiagAPI.instance()),this._proxyTracerProvider=new r.ProxyTracerProvider}}t.TraceAPI=l}),BNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0;var e=ONc();t.trace=e.TraceAPI.getInstance()}),LNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=t.propagation=t.metrics=t.diag=t.context=t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=t.isValidSpanId=t.isValidTraceId=t.isSpanContextValid=t.createTraceState=t.TraceFlags=t.SpanStatusCode=t.SpanKind=t.SamplingDecision=t.ProxyTracerProvider=t.ProxyTracer=t.defaultTextMapSetter=t.defaultTextMapGetter=t.ValueType=t.createNoopMeter=t.DiagLogLevel=t.DiagConsoleLogger=t.ROOT_CONTEXT=t.createContextKey=t.baggageEntryMetadataFromString=void 0;var e=Y$i();Object.defineProperty(t,"baggageEntryMetadataFromString",{enumerable:!0,get:a(function(){return e.baggageEntryMetadataFromString},"get")});var r=ITt();Object.defineProperty(t,"createContextKey",{enumerable:!0,get:a(function(){return r.createContextKey},"get")}),Object.defineProperty(t,"ROOT_CONTEXT",{enumerable:!0,get:a(function(){return r.ROOT_CONTEXT},"get")});var n=gNc();Object.defineProperty(t,"DiagConsoleLogger",{enumerable:!0,get:a(function(){return n.DiagConsoleLogger},"get")});var o=jLr();Object.defineProperty(t,"DiagLogLevel",{enumerable:!0,get:a(function(){return o.DiagLogLevel},"get")});var s=K$i();Object.defineProperty(t,"createNoopMeter",{enumerable:!0,get:a(function(){return s.createNoopMeter},"get")});var c=ANc();Object.defineProperty(t,"ValueType",{enumerable:!0,get:a(function(){return c.ValueType},"get")});var l=J$i();Object.defineProperty(t,"defaultTextMapGetter",{enumerable:!0,get:a(function(){return l.defaultTextMapGetter},"get")}),Object.defineProperty(t,"defaultTextMapSetter",{enumerable:!0,get:a(function(){return l.defaultTextMapSetter},"get")});var u=tVi();Object.defineProperty(t,"ProxyTracer",{enumerable:!0,get:a(function(){return u.ProxyTracer},"get")});var d=rVi();Object.defineProperty(t,"ProxyTracerProvider",{enumerable:!0,get:a(function(){return d.ProxyTracerProvider},"get")});var f=_Nc();Object.defineProperty(t,"SamplingDecision",{enumerable:!0,get:a(function(){return f.SamplingDecision},"get")});var h=vNc();Object.defineProperty(t,"SpanKind",{enumerable:!0,get:a(function(){return h.SpanKind},"get")});var m=CNc();Object.defineProperty(t,"SpanStatusCode",{enumerable:!0,get:a(function(){return m.SpanStatusCode},"get")});var g=Z$i();Object.defineProperty(t,"TraceFlags",{enumerable:!0,get:a(function(){return g.TraceFlags},"get")});var A=TNc();Object.defineProperty(t,"createTraceState",{enumerable:!0,get:a(function(){return A.createTraceState},"get")});var y=$Lr();Object.defineProperty(t,"isSpanContextValid",{enumerable:!0,get:a(function(){return y.isSpanContextValid},"get")}),Object.defineProperty(t,"isValidTraceId",{enumerable:!0,get:a(function(){return y.isValidTraceId},"get")}),Object.defineProperty(t,"isValidSpanId",{enumerable:!0,get:a(function(){return y.isValidSpanId},"get")});var E=HLr();Object.defineProperty(t,"INVALID_SPANID",{enumerable:!0,get:a(function(){return E.INVALID_SPANID},"get")}),Object.defineProperty(t,"INVALID_TRACEID",{enumerable:!0,get:a(function(){return E.INVALID_TRACEID},"get")}),Object.defineProperty(t,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:a(function(){return E.INVALID_SPAN_CONTEXT},"get")});var _=INc();Object.defineProperty(t,"context",{enumerable:!0,get:a(function(){return _.context},"get")});var v=xNc();Object.defineProperty(t,"diag",{enumerable:!0,get:a(function(){return v.diag},"get")});var b=PNc();Object.defineProperty(t,"metrics",{enumerable:!0,get:a(function(){return b.metrics},"get")});var T=MNc();Object.defineProperty(t,"propagation",{enumerable:!0,get:a(function(){return T.propagation},"get")});var w=BNc();Object.defineProperty(t,"trace",{enumerable:!0,get:a(function(){return w.trace},"get")}),t.default={context:_.context,diag:v.diag,metrics:b.metrics,propagation:T.propagation,trace:w.trace}}),sSt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{static{a(this,"BW")}}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{static{a(this,"K9")}constructor(v){if(super(),!t.IDENTIFIER.test(v))throw Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{static{a(this,"B4")}constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((b,T)=>`${b}${T}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,T)=>(T instanceof r&&(b[T.str]=(b[T.str]||0)+1),b),{})}}t._Code=n,t.nil=new n("");function o(_,...v){let b=[_[0]],T=0;for(;T{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;var e=sSt();class r extends Error{static{a(this,"Dj")}constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class o{static{a(this,"KB")}constructor({prefixes:d,parent:f}={}){this._names={},this._prefixes=d,this._parent=f}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){let f=this._names[d]||this._nameGroup(d);return`${d}${f.index++}`}_nameGroup(d){var f,h;if(!((h=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||h===void 0)&&h.has(d)||this._prefixes&&!this._prefixes.has(d))throw Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=o;class s extends e.Name{static{a(this,"qB")}constructor(d,f){super(f),this.prefix=d}setValue(d,{property:f,itemIndex:h}){this.value=d,this.scopePath=e._`.${new e.Name(f)}[${h}]`}}t.ValueScopeName=s;var c=e._`\n`;class l extends o{static{a(this,"Fj")}constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?c:e.nil}}get(){return this._scope}name(d){return new s(d,this._newName(d))}value(d,f){var h;if(f.ref===void 0)throw Error("CodeGen: ref must be passed in value");let m=this.toName(d),{prefix:g}=m,A=(h=f.key)!==null&&h!==void 0?h:f.ref,y=this._values[g];if(y){let v=y.get(A);if(v)return v}else y=this._values[g]=new Map;y.set(A,m);let E=this._scope[g]||(this._scope[g]=[]),_=E.length;return E[_]=f.ref,m.setValue(f,{property:g,itemIndex:_}),m}getValue(d,f){let h=this._values[d];if(h)return h.get(f)}scopeRefs(d,f=this._values){return this._reduceValues(f,h=>{if(h.scopePath===void 0)throw Error(`CodeGen: name "${h}" has no value`);return e._`${d}${h.scopePath}`})}scopeCode(d=this._values,f,h){return this._reduceValues(d,m=>{if(m.value===void 0)throw Error(`CodeGen: name "${m}" has no value`);return m.value.code},f,h)}_reduceValues(d,f,h={},m){let g=e.nil;for(let A in d){let y=d[A];if(!y)continue;let E=h[A]=h[A]||new Map;y.forEach(_=>{if(E.has(_))return;E.set(_,n.Started);let v=f(_);if(v){let b=this.opts.es5?t.varKinds.var:t.varKinds.const;g=e._`${g}${b} ${_} = ${v};${this.opts._n}`}else if(v=m?.(_))g=e._`${g}${v}${this.opts._n}`;else throw new r(_);E.set(_,n.Completed)})}return g}}t.ValueScope=l}),xs=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;var e=sSt(),r=QHi(),n=sSt();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return n._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return n.str},"get")}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:a(function(){return n.strConcat},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return n.nil},"get")}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:a(function(){return n.getProperty},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return n.stringify},"get")}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:a(function(){return n.regexpCode},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return n.Name},"get")});var o=QHi();Object.defineProperty(t,"Scope",{enumerable:!0,get:a(function(){return o.Scope},"get")}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:a(function(){return o.ValueScope},"get")}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:a(function(){return o.ValueScopeName},"get")}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:a(function(){return o.varKinds},"get")}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{static{a(this,"y1")}optimizeNodes(){return this}optimizeNames(H,re){return this}}class c extends s{static{a(this,"Lj")}constructor(H,re,ae){super(),this.varKind=H,this.name=re,this.rhs=ae}render({es5:H,_n:re}){let ae=H?r.varKinds.var:this.varKind,Oe=this.rhs===void 0?"":` = ${this.rhs}`;return`${ae} ${this.name}${Oe};`+re}optimizeNames(H,re){if(H[this.name.str])return this.rhs&&(this.rhs=M(this.rhs,H,re)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends s{static{a(this,"NB")}constructor(H,re,ae){super(),this.lhs=H,this.rhs=re,this.sideEffects=ae}render({_n:H}){return`${this.lhs} = ${this.rhs};`+H}optimizeNames(H,re){if(!(this.lhs instanceof e.Name&&!H[this.lhs.str]&&!this.sideEffects))return this.rhs=M(this.rhs,H,re),this}get names(){let H=this.lhs instanceof e.Name?{}:{...this.lhs.names};return j(H,this.rhs)}}class u extends l{static{a(this,"jj")}constructor(H,re,ae,Oe){super(H,ae,Oe),this.op=re}render({_n:H}){return`${this.lhs} ${this.op}= ${this.rhs};`+H}}class d extends s{static{a(this,"Aj")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`${this.label}:`+H}}class f extends s{static{a(this,"Ij")}constructor(H){super(),this.label=H,this.names={}}render({_n:H}){return`break${this.label?` ${this.label}`:""};`+H}}class h extends s{static{a(this,"Rj")}constructor(H){super(),this.error=H}render({_n:H}){return`throw ${this.error};`+H}get names(){return this.error.names}}class m extends s{static{a(this,"Pj")}constructor(H){super(),this.code=H}render({_n:H}){return`${this.code};`+H}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(H,re){return this.code=M(this.code,H,re),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class g extends s{static{a(this,"LW")}constructor(H=[]){super(),this.nodes=H}render(H){return this.nodes.reduce((re,ae)=>re+ae.render(H),"")}optimizeNodes(){let{nodes:H}=this,re=H.length;for(;re--;){let ae=H[re].optimizeNodes();Array.isArray(ae)?H.splice(re,1,...ae):ae?H[re]=ae:H.splice(re,1)}return H.length>0?this:void 0}optimizeNames(H,re){let{nodes:ae}=this,Oe=ae.length;for(;Oe--;){let ve=ae[Oe];ve.optimizeNames(H,re)||(O(H,ve.names),ae.splice(Oe,1))}return ae.length>0?this:void 0}get names(){return this.nodes.reduce((H,re)=>L(H,re.names),{})}}class A extends g{static{a(this,"f1")}render(H){return"{"+H._n+super.render(H)+"}"+H._n}}class y extends g{static{a(this,"Ej")}}class E extends A{static{a(this,"RJ")}}E.kind="else";class _ extends A{static{a(this,"e4")}constructor(H,re){super(re),this.condition=H}render(H){let re=`if(${this.condition})`+super.render(H);return this.else&&(re+="else "+this.else.render(H)),re}optimizeNodes(){super.optimizeNodes();let H=this.condition;if(H===!0)return this.nodes;let re=this.else;if(re){let ae=re.optimizeNodes();re=this.else=Array.isArray(ae)?new E(ae):ae}if(re)return H===!1?re instanceof _?re:re.nodes:this.nodes.length?this:new _(q(H),re instanceof _?[re]:re.nodes);if(!(H===!1||!this.nodes.length))return this}optimizeNames(H,re){var ae;if(this.else=(ae=this.else)===null||ae===void 0?void 0:ae.optimizeNames(H,re),!!(super.optimizeNames(H,re)||this.else))return this.condition=M(this.condition,H,re),this}get names(){let H=super.names;return j(H,this.condition),this.else&&L(H,this.else.names),H}}_.kind="if";class v extends A{static{a(this,"q9")}}v.kind="for";class b extends v{static{a(this,"bj")}constructor(H){super(),this.iteration=H}render(H){return`for(${this.iteration})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iteration=M(this.iteration,H,re),this}get names(){return L(super.names,this.iteration.names)}}class T extends v{static{a(this,"_j")}constructor(H,re,ae,Oe){super(),this.varKind=H,this.name=re,this.from=ae,this.to=Oe}render(H){let re=H.es5?r.varKinds.var:this.varKind,{name:ae,from:Oe,to:ve}=this;return`for(${re} ${ae}=${Oe}; ${ae}<${ve}; ${ae}++)`+super.render(H)}get names(){let H=j(super.names,this.from);return j(H,this.to)}}class w extends v{static{a(this,"BB")}constructor(H,re,ae,Oe){super(),this.loop=H,this.varKind=re,this.name=ae,this.iterable=Oe}render(H){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(H)}optimizeNames(H,re){if(super.optimizeNames(H,re))return this.iterable=M(this.iterable,H,re),this}get names(){return L(super.names,this.iterable.names)}}class R extends A{static{a(this,"wW")}constructor(H,re,ae){super(),this.name=H,this.args=re,this.async=ae}render(H){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(H)}}R.kind="func";class x extends g{static{a(this,"OW")}render(H){return"return "+super.render(H)}}x.kind="return";class P extends A{static{a(this,"kj")}render(H){let re="try"+super.render(H);return this.catch&&(re+=this.catch.render(H)),this.finally&&(re+=this.finally.render(H)),re}optimizeNodes(){var H,re;return super.optimizeNodes(),(H=this.catch)===null||H===void 0||H.optimizeNodes(),(re=this.finally)===null||re===void 0||re.optimizeNodes(),this}optimizeNames(H,re){var ae,Oe;return super.optimizeNames(H,re),(ae=this.catch)===null||ae===void 0||ae.optimizeNames(H,re),(Oe=this.finally)===null||Oe===void 0||Oe.optimizeNames(H,re),this}get names(){let H=super.names;return this.catch&&L(H,this.catch.names),this.finally&&L(H,this.finally.names),H}}class D extends A{static{a(this,"DW")}constructor(H){super(),this.error=H}render(H){return`catch(${this.error})`+super.render(H)}}D.kind="catch";class N extends A{static{a(this,"FW")}render(H){return"finally"+super.render(H)}}N.kind="finally";class B{static{a(this,"Sj")}constructor(H,re={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...re,_n:re.lines?` +`:""},this._extScope=H,this._scope=new r.Scope({parent:H}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(H){return this._scope.name(H)}scopeName(H){return this._extScope.name(H)}scopeValue(H,re){let ae=this._extScope.value(H,re);return(this._values[ae.prefix]||(this._values[ae.prefix]=new Set)).add(ae),ae}getScopeValue(H,re){return this._extScope.getValue(H,re)}scopeRefs(H){return this._extScope.scopeRefs(H,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(H,re,ae,Oe){let ve=this._scope.toName(re);return ae!==void 0&&Oe&&(this._constants[ve.str]=ae),this._leafNode(new c(H,ve,ae)),ve}const(H,re,ae){return this._def(r.varKinds.const,H,re,ae)}let(H,re,ae){return this._def(r.varKinds.let,H,re,ae)}var(H,re,ae){return this._def(r.varKinds.var,H,re,ae)}assign(H,re,ae){return this._leafNode(new l(H,re,ae))}add(H,re){return this._leafNode(new u(H,t.operators.ADD,re))}code(H){return typeof H=="function"?H():H!==e.nil&&this._leafNode(new m(H)),this}object(...H){let re=["{"];for(let[ae,Oe]of H)re.length>1&&re.push(","),re.push(ae),(ae!==Oe||this.opts.es5)&&(re.push(":"),(0,e.addCodeArg)(re,Oe));return re.push("}"),new e._Code(re)}if(H,re,ae){if(this._blockNode(new _(H)),re&&ae)this.code(re).else().code(ae).endIf();else if(re)this.code(re).endIf();else if(ae)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(H){return this._elseNode(new _(H))}else(){return this._elseNode(new E)}endIf(){return this._endBlockNode(_,E)}_for(H,re){return this._blockNode(H),re&&this.code(re).endFor(),this}for(H,re){return this._for(new b(H),re)}forRange(H,re,ae,Oe,ve=this.opts.es5?r.varKinds.var:r.varKinds.let){let Fe=this._scope.toName(H);return this._for(new T(ve,Fe,re,ae),()=>Oe(Fe))}forOf(H,re,ae,Oe=r.varKinds.const){let ve=this._scope.toName(H);if(this.opts.es5){let Fe=re instanceof e.Name?re:this.var("_arr",re);return this.forRange("_i",0,e._`${Fe}.length`,Pe=>{this.var(ve,e._`${Fe}[${Pe}]`),ae(ve)})}return this._for(new w("of",Oe,ve,re),()=>ae(ve))}forIn(H,re,ae,Oe=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(H,e._`Object.keys(${re})`,ae);let ve=this._scope.toName(H);return this._for(new w("in",Oe,ve,re),()=>ae(ve))}endFor(){return this._endBlockNode(v)}label(H){return this._leafNode(new d(H))}break(H){return this._leafNode(new f(H))}return(H){let re=new x;if(this._blockNode(re),this.code(H),re.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(H,re,ae){if(!re&&!ae)throw Error('CodeGen: "try" without "catch" and "finally"');let Oe=new P;if(this._blockNode(Oe),this.code(H),re){let ve=this.name("e");this._currNode=Oe.catch=new D(ve),re(ve)}return ae&&(this._currNode=Oe.finally=new N,this.code(ae)),this._endBlockNode(D,N)}throw(H){return this._leafNode(new h(H))}block(H,re){return this._blockStarts.push(this._nodes.length),H&&this.code(H).endBlock(re),this}endBlock(H){let re=this._blockStarts.pop();if(re===void 0)throw Error("CodeGen: not in self-balancing block");let ae=this._nodes.length-re;if(ae<0||H!==void 0&&ae!==H)throw Error(`CodeGen: wrong number of nodes: ${ae} vs ${H} expected`);return this._nodes.length=re,this}func(H,re=e.nil,ae,Oe){return this._blockNode(new R(H,re,ae)),Oe&&this.code(Oe).endFunc(),this}endFunc(){return this._endBlockNode(R)}optimize(H=1){for(;H-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(H){return this._currNode.nodes.push(H),this}_blockNode(H){this._currNode.nodes.push(H),this._nodes.push(H)}_endBlockNode(H,re){let ae=this._currNode;if(ae instanceof H||re&&ae instanceof re)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${re?`${H.kind}/${re.kind}`:H.kind}"`)}_elseNode(H){let re=this._currNode;if(!(re instanceof _))throw Error('CodeGen: "else" without "if"');return this._currNode=re.else=H,this}get _root(){return this._nodes[0]}get _currNode(){let H=this._nodes;return H[H.length-1]}set _currNode(H){let re=this._nodes;re[re.length-1]=H}}t.CodeGen=B;function L(ne,H){for(let re in H)ne[re]=(ne[re]||0)+(H[re]||0);return ne}a(L,"v0");function j(ne,H){return H instanceof e._CodeOrName?L(ne,H.names):ne}a(j,"ZW");function M(ne,H,re){if(ne instanceof e.Name)return ae(ne);if(!Oe(ne))return ne;return new e._Code(ne._items.reduce((ve,Fe)=>(Fe instanceof e.Name&&(Fe=ae(Fe)),Fe instanceof e._Code?ve.push(...Fe._items):ve.push(Fe),ve),[]));function ae(ve){let Fe=re[ve.str];return Fe===void 0||H[ve.str]!==1?ve:(delete H[ve.str],Fe)}function Oe(ve){return ve instanceof e._Code&&ve._items.some(Fe=>Fe instanceof e.Name&&H[Fe.str]===1&&re[Fe.str]!==void 0)}}a(M,"V9");function O(ne,H){for(let re in H)ne[re]=(ne[re]||0)-(H[re]||0)}a(O,"dp");function q(ne){return typeof ne=="boolean"||typeof ne=="number"||ne===null?!ne:e._`!${J(ne)}`}a(q,"vj"),t.not=q;var Q=$(t.operators.AND);function U(...ne){return ne.reduce(Q)}a(U,"np"),t.and=U;var z=$(t.operators.OR);function W(...ne){return ne.reduce(z)}a(W,"op"),t.or=W;function $(ne){return(H,re)=>H===e.nil?re:re===e.nil?H:e._`${J(H)} ${ne} ${J(re)}`}a($,"Cj");function J(ne){return ne instanceof e.Name?ne:e._`(${ne})`}a(J,"zB")}),uc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;var e=xs(),r=sSt();function n(R){let x={};for(let P of R)x[P]=!0;return x}a(n,"$d"),t.toHash=n;function o(R,x){return typeof x=="boolean"?x:Object.keys(x).length===0?!0:(s(R,x),!c(x,R.self.RULES.all))}a(o,"Qd"),t.alwaysValidSchema=o;function s(R,x=R.schema){let{opts:P,self:D}=R;if(!P.strictSchema||typeof x=="boolean")return;let N=D.RULES.keywords;for(let B in x)N[B]||w(R,`unknown keyword: "${B}"`)}a(s,"fj"),t.checkUnknownRules=s;function c(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(x[P])return!0;return!1}a(c,"gj"),t.schemaHasRules=c;function l(R,x){if(typeof R=="boolean")return!R;for(let P in R)if(P!=="$ref"&&x.all[P])return!0;return!1}a(l,"Jd"),t.schemaHasRulesButRef=l;function u({topSchemaRef:R,schemaPath:x},P,D,N){if(!N){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return e._`${P}`}return e._`${R}${x}${(0,e.getProperty)(D)}`}a(u,"Xd"),t.schemaRefOrVal=u;function d(R){return m(decodeURIComponent(R))}a(d,"Yd"),t.unescapeFragment=d;function f(R){return encodeURIComponent(h(R))}a(f,"Wd"),t.escapeFragment=f;function h(R){return typeof R=="number"?`${R}`:R.replace(/~/g,"~0").replace(/\//g,"~1")}a(h,"OB"),t.escapeJsonPointer=h;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}a(m,"hj"),t.unescapeJsonPointer=m;function g(R,x){if(Array.isArray(R))for(let P of R)x(P);else x(R)}a(g,"Gd"),t.eachItem=g;function A({mergeNames:R,mergeToName:x,mergeValues:P,resultToName:D}){return(N,B,L,j)=>{let M=L===void 0?B:L instanceof e.Name?(B instanceof e.Name?R(N,B,L):x(N,B,L),L):B instanceof e.Name?(x(N,L,B),B):P(B,L);return j===e.Name&&!(M instanceof e.Name)?D(N,M):M}}a(A,"xj"),t.mergeEvaluated={props:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>{R.if(e._`${x} === true`,()=>R.assign(P,!0),()=>R.assign(P,e._`${P} || {}`).code(e._`Object.assign(${P}, ${x})`))}),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>{x===!0?R.assign(P,!0):(R.assign(P,e._`${P} || {}`),E(R,P,x))}),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:{...R,...x},"mergeValues"),resultToName:y}),items:A({mergeNames:a((R,x,P)=>R.if(e._`${P} !== true && ${x} !== undefined`,()=>R.assign(P,e._`${x} === true ? true : ${P} > ${x} ? ${P} : ${x}`)),"mergeNames"),mergeToName:a((R,x,P)=>R.if(e._`${P} !== true`,()=>R.assign(P,x===!0?!0:e._`${P} > ${x} ? ${P} : ${x}`)),"mergeToName"),mergeValues:a((R,x)=>R===!0?!0:Math.max(R,x),"mergeValues"),resultToName:a((R,x)=>R.var("items",x),"resultToName")})};function y(R,x){if(x===!0)return R.var("props",!0);let P=R.var("props",e._`{}`);return x!==void 0&&E(R,P,x),P}a(y,"uj"),t.evaluatedPropsToName=y;function E(R,x,P){Object.keys(P).forEach(D=>R.assign(e._`${x}${(0,e.getProperty)(D)}`,!0))}a(E,"DB"),t.setEvaluated=E;var _={};function v(R,x){return R.scopeValue("func",{ref:x,code:_[x.code]||(_[x.code]=new r._Code(x.code))})}a(v,"Ud"),t.useFunc=v;var b;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(b||(t.Type=b={}));function T(R,x,P){if(R instanceof e.Name){let D=x===b.Num;return P?D?e._`"[" + ${R} + "]"`:e._`"['" + ${R} + "']"`:D?e._`"/" + ${R}`:e._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(R).toString():"/"+h(R)}a(T,"Hd"),t.getErrorPath=T;function w(R,x,P=R.opts.strictSchema){if(P){if(x=`strict mode: ${x}`,P===!0)throw Error(x);R.self.logger.warn(x)}}a(w,"mj"),t.checkStrictMode=w}),EV=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r}),wTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;var e=xs(),r=uc(),n=EV();t.keywordError={message:a(({keyword:E})=>e.str`must pass "${E}" keyword validation`,"message")},t.keyword$DataError={message:a(({keyword:E,schemaType:_})=>_?e.str`"${E}" keyword must be ${_} ($data)`:e.str`"${E}" keyword is invalid ($data)`,"message")};function o(E,_=t.keywordError,v,b){let{it:T}=E,{gen:w,compositeRule:R,allErrors:x}=T,P=h(E,_,v);b??(R||x)?u(w,P):d(T,e._`[${P}]`)}a(o,"bd"),t.reportError=o;function s(E,_=t.keywordError,v){let{it:b}=E,{gen:T,compositeRule:w,allErrors:R}=b,x=h(E,_,v);u(T,x),!(w||R)&&d(b,n.default.vErrors)}a(s,"_d"),t.reportExtraError=s;function c(E,_){E.assign(n.default.errors,_),E.if(e._`${n.default.vErrors} !== null`,()=>E.if(_,()=>E.assign(e._`${n.default.vErrors}.length`,_),()=>E.assign(n.default.vErrors,null)))}a(c,"kd"),t.resetErrorsCount=c;function l({gen:E,keyword:_,schemaValue:v,data:b,errsCount:T,it:w}){if(T===void 0)throw Error("ajv implementation error");let R=E.name("err");E.forRange("i",T,n.default.errors,x=>{E.const(R,e._`${n.default.vErrors}[${x}]`),E.if(e._`${R}.instancePath === undefined`,()=>E.assign(e._`${R}.instancePath`,(0,e.strConcat)(n.default.instancePath,w.errorPath))),E.assign(e._`${R}.schemaPath`,e.str`${w.errSchemaPath}/${_}`),w.opts.verbose&&(E.assign(e._`${R}.schema`,v),E.assign(e._`${R}.data`,b))})}a(l,"Sd"),t.extendErrors=l;function u(E,_){let v=E.const("err",_);E.if(e._`${n.default.vErrors} === null`,()=>E.assign(n.default.vErrors,e._`[${v}]`),e._`${n.default.vErrors}.push(${v})`),E.code(e._`${n.default.errors}++`)}a(u,"dj");function d(E,_){let{gen:v,validateName:b,schemaEnv:T}=E;T.$async?v.throw(e._`new ${E.ValidationError}(${_})`):(v.assign(e._`${b}.errors`,_),v.return(!1))}a(d,"ij");var f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function h(E,_,v){let{createErrors:b}=E.it;return b===!1?e._`{}`:m(E,_,v)}a(h,"nj");function m(E,_,v={}){let{gen:b,it:T}=E,w=[g(T,v),A(E,v)];return y(E,_,w),b.object(...w)}a(m,"vd");function g({errorPath:E},{instancePath:_}){let v=_?e.str`${E}${(0,r.getErrorPath)(_,r.Type.Str)}`:E;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,v)]}a(g,"Cd");function A({keyword:E,it:{errSchemaPath:_}},{schemaPath:v,parentSchema:b}){let T=b?_:e.str`${_}/${E}`;return v&&(T=e.str`${T}${(0,r.getErrorPath)(v,r.Type.Str)}`),[f.schemaPath,T]}a(A,"Td");function y(E,{params:_,message:v},b){let{keyword:T,data:w,schemaValue:R,it:x}=E,{opts:P,propertyName:D,topSchemaRef:N,schemaPath:B}=x;b.push([f.keyword,T],[f.params,typeof _=="function"?_(E):_||e._`{}`]),P.messages&&b.push([f.message,typeof v=="function"?v(E):v]),P.verbose&&b.push([f.schema,R],[f.parentSchema,e._`${N}${B}`],[n.default.data,w]),D&&b.push([f.propertyName,D])}a(y,"xd")}),FNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;var e=wTt(),r=xs(),n=EV(),o={message:"boolean schema is false"};function s(u){let{gen:d,schema:f,validateName:h}=u;f===!1?l(u,!1):typeof f=="object"&&f.$async===!0?d.return(n.default.data):(d.assign(r._`${h}.errors`,null),d.return(!0))}a(s,"pd"),t.topBoolOrEmptySchema=s;function c(u,d){let{gen:f,schema:h}=u;h===!1?(f.var(d,!1),l(u)):f.var(d,!0)}a(c,"dd"),t.boolOrEmptySchema=c;function l(u,d){let{gen:f,data:h}=u,m={gen:f,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(m,o,void 0,d)}a(l,"tj")}),nVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;var e=["string","number","integer","boolean","null","object","array"],r=new Set(e);function n(s){return typeof s=="string"&&r.has(s)}a(n,"od"),t.isJSONType=n;function o(){let s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}a(o,"td"),t.getRules=o}),iVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:o,self:s},c){let l=s.RULES.types[c];return l&&l!==!0&&r(o,l)}a(e,"sd"),t.schemaHasRulesForType=e;function r(o,s){return s.rules.some(c=>n(o,c))}a(r,"JA"),t.shouldUseGroup=r;function n(o,s){var c;return o[s.keyword]!==void 0||((c=s.definition.implements)===null||c===void 0?void 0:c.some(l=>o[l]!==void 0))}a(n,"XA"),t.shouldUseRule=n}),aSt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;var e=nVi(),r=iVi(),n=wTt(),o=xs(),s=uc(),c;(function(b){b[b.Correct=0]="Correct",b[b.Wrong=1]="Wrong"})(c||(t.DataType=c={}));function l(b){let T=u(b.type);if(T.includes("null")){if(b.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!T.length&&b.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');b.nullable===!0&&T.push("null")}return T}a(l,"Yi"),t.getSchemaTypes=l;function u(b){let T=Array.isArray(b)?b:b?[b]:[];if(T.every(e.isJSONType))return T;throw Error("type must be JSONType or JSONType[]: "+T.join(","))}a(u,"UA"),t.getJSONTypes=u;function d(b,T){let{gen:w,data:R,opts:x}=b,P=h(T,x.coerceTypes),D=T.length>0&&!(P.length===0&&T.length===1&&(0,r.schemaHasRulesForType)(b,T[0]));if(D){let N=y(T,R,x.strictNumbers,c.Wrong);w.if(N,()=>{P.length?m(b,T,P):_(b)})}return D}a(d,"Wi"),t.coerceAndCheckDataType=d;var f=new Set(["string","number","integer","boolean","null"]);function h(b,T){return T?b.filter(w=>f.has(w)||T==="array"&&w==="array"):[]}a(h,"Gi");function m(b,T,w){let{gen:R,data:x,opts:P}=b,D=R.let("dataType",o._`typeof ${x}`),N=R.let("coerced",o._`undefined`);P.coerceTypes==="array"&&R.if(o._`${D} == 'object' && Array.isArray(${x}) && ${x}.length == 1`,()=>R.assign(x,o._`${x}[0]`).assign(D,o._`typeof ${x}`).if(y(T,x,P.strictNumbers),()=>R.assign(N,x))),R.if(o._`${N} !== undefined`);for(let L of w)(f.has(L)||L==="array"&&P.coerceTypes==="array")&&B(L);R.else(),_(b),R.endIf(),R.if(o._`${N} !== undefined`,()=>{R.assign(x,N),g(b,N)});function B(L){switch(L){case"string":R.elseIf(o._`${D} == "number" || ${D} == "boolean"`).assign(N,o._`"" + ${x}`).elseIf(o._`${x} === null`).assign(N,o._`""`);return;case"number":R.elseIf(o._`${D} == "boolean" || ${x} === null || (${D} == "string" && ${x} && ${x} == +${x})`).assign(N,o._`+${x}`);return;case"integer":R.elseIf(o._`${D} === "boolean" || ${x} === null || (${D} === "string" && ${x} && ${x} == +${x} && !(${x} % 1))`).assign(N,o._`+${x}`);return;case"boolean":R.elseIf(o._`${x} === "false" || ${x} === 0 || ${x} === null`).assign(N,!1).elseIf(o._`${x} === "true" || ${x} === 1`).assign(N,!0);return;case"null":R.elseIf(o._`${x} === "" || ${x} === 0 || ${x} === false`),R.assign(N,null);return;case"array":R.elseIf(o._`${D} === "string" || ${D} === "number" - || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(L,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,k;switch(b){case"null":return o._`${T} ${x} null`;case"array":k=o._`Array.isArray(${T})`;break;case"object":k=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":k=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":k=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?k:(0,o.not)(k);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,k=(0,s.toHash)(b);if(k.array&&k.object){let D=o._`typeof ${T} != "object"`;x=k.null?D:o._`!${T} || ${D}`,delete k.null,delete k.array,delete k.object}else x=o.nil;k.number&&delete k.integer;for(let D in k)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),GOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=Rs(),r=uc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),pN=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=Rs(),r=uc(),n=kV(),o=uc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(k=>(0,e.and)(h(b,T,k,w.ownProperties),e._`${x} = ${k}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:k},it:D},N,L,B){let Q=B?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,k)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let O=e._`${Q}, ${w.object(...M)}`;return L!==e.nil?e._`${N}.call(${L}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,k=x(w,R);return b.scopeValue("pattern",{key:k.toString(),ref:k,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,k=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(k,!0),D(()=>T.break()),k;function D(N){let L=T.const("len",e._`${w}.length`);T.forRange("i",0,L,B=>{b.subschema({keyword:R,dataProp:B,dataPropType:r.Type.Num},k),T.if((0,e.not)(k),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let k=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,L)=>{let B=b.subschema({keyword:R,schemaProp:L,compositeRule:!0},D);T.assign(k,e._`${k} || ${D}`),!b.mergeValidEvaluated(B,D)&&T.if((0,e.not)(k))})),b.result(k,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),$Oc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=Rs(),r=kV(),n=pN(),o=jTt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),k=E.let("valid");g.block$data(k,D),g.ok((y=A.valid)!==null&&y!==void 0?y:k);function D(){if(A.errors===!1)B(),A.modifying&&l(g),Q(()=>g.error());else{let M=A.async?N():L();A.modifying&&l(g),Q(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>B(e._`await `),O=>E.assign(k,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function L(){let M=e._`${x}.errors`;return E.assign(M,null),B(e.nil),M}a(L,"w");function B(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,q=!("compile"in A&&!T||A.schema===!1);E.assign(k,e._`${M}${(0,n.callValidateCode)(g,x,O,q)}`,A.modifying)}a(B,"O");function Q(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:k),M)}a(Q,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),VOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=Rs(),r=uc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:E,opts:_}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),yVi=Ut((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),WOc=Ut((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=uc(),r=yVi(),n=WOc(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,_=!0){return typeof E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))return!0;let v=E[_];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},k=new Set;return n(E,{allKeys:!0},(L,B,Q,M)=>{if(M===void 0)return;let O=R+B,q=w[M];typeof L[v]=="string"&&(q=F.call(this,L[v])),U.call(this,L.$anchor),U.call(this,L.$dynamicAnchor),w[B]=q;function F(W){let V=this.opts.uriResolver.resolve;if(W=m(q?V(q,W):W),k.has(W))throw N(W);k.add(W);let G=this.refs[W];return typeof G=="string"&&(G=this.refs[G]),typeof G=="object"?D(L,G.schema,W):W!==m(O)&&(W[0]==="#"?(D(L,x[W],W),x[W]=L):this.refs[W]=O),W}a(F,"M");function U(W){if(typeof W=="string"){if(!A.test(W))throw Error(`invalid anchor "${W}"`);F.call(this,`#${W}`)}}a(U,"j")}),x;function D(L,B,Q){if(B!==void 0&&!r(L,B))throw N(Q)}function N(L){return Error(`reference "${L}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),GTt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=HOc(),r=CSt(),n=AVi(),o=CSt(),s=GOc(),c=$Oc(),l=VOc(),u=Rs(),d=kV(),f=HTt(),h=uc(),m=jTt();function g(J){if(R(J)&&(k(J),w(J))){_(J);return}A(J,()=>(0,e.topBoolOrEmptySchema)(J))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:J,validateName:z,schema:le,schemaEnv:K,opts:ae},Me){ae.code.es5?J.func(z,u._`${d.default.data}, ${d.default.valCxt}`,K.$async,()=>{J.code(u._`"use strict"; ${b(le,ae)}`),E(J,ae),J.code(Me)}):J.func(z,u._`${d.default.data}, ${y(ae)}`,K.$async,()=>J.code(b(le,ae)).code(Me))}a(A,"mA");function y(J){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${J.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function E(J,z){J.if(d.default.valCxt,()=>{J.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),J.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),J.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),J.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),z.dynamicRef&&J.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{J.var(d.default.instancePath,u._`""`),J.var(d.default.parentData,u._`undefined`),J.var(d.default.parentDataProperty,u._`undefined`),J.var(d.default.rootData,d.default.data),z.dynamicRef&&J.var(d.default.dynamicAnchors,u._`{}`)})}a(E,"In");function _(J){let{schema:z,opts:le,gen:K}=J;A(J,()=>{le.$comment&&z.$comment&&M(J),L(J),K.let(d.default.vErrors,null),K.let(d.default.errors,0),le.unevaluated&&v(J),D(J),O(J)})}a(_,"Rn");function v(J){let{gen:z,validateName:le}=J;J.evaluated=z.const("evaluated",u._`${le}.evaluated`),z.if(u._`${J.evaluated}.dynamicProps`,()=>z.assign(u._`${J.evaluated}.props`,u._`undefined`)),z.if(u._`${J.evaluated}.dynamicItems`,()=>z.assign(u._`${J.evaluated}.items`,u._`undefined`))}a(v,"Pn");function b(J,z){let le=typeof J=="object"&&J[z.schemaId];return le&&(z.code.source||z.code.process)?u._`/*# sourceURL=${le} */`:u.nil}a(b,"fA");function T(J,z){if(R(J)&&(k(J),w(J))){x(J,z);return}(0,e.boolOrEmptySchema)(J,z)}a(T,"En");function w({schema:J,self:z}){if(typeof J=="boolean")return!J;for(let le in J)if(z.RULES.all[le])return!0;return!1}a(w,"lA");function R(J){return typeof J.schema!="boolean"}a(R,"cA");function x(J,z){let{schema:le,gen:K,opts:ae}=J;ae.$comment&&le.$comment&&M(J),B(J),Q(J);let Me=K.const("_errs",d.default.errors);D(J,Me),K.var(z,u._`${Me} === ${d.default.errors}`)}a(x,"bn");function k(J){(0,h.checkUnknownRules)(J),N(J)}a(k,"pA");function D(J,z){if(J.opts.jtd)return F(J,[],!1,z);let le=(0,r.getSchemaTypes)(J.schema),K=(0,r.coerceAndCheckDataType)(J,le);F(J,le,!K,z)}a(D,"dA");function N(J){let{schema:z,errSchemaPath:le,opts:K,self:ae}=J;z.$ref&&K.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(z,ae.RULES)&&ae.logger.warn(`$ref: keywords ignored in schema at path "${le}"`)}a(N,"_n");function L(J){let{schema:z,opts:le}=J;z.default!==void 0&&le.useDefaults&&le.strictSchema&&(0,h.checkStrictMode)(J,"default is ignored in the schema root")}a(L,"kn");function B(J){let z=J.schema[J.opts.schemaId];z&&(J.baseId=(0,f.resolveUrl)(J.opts.uriResolver,J.baseId,z))}a(B,"Sn");function Q(J){if(J.schema.$async&&!J.schemaEnv.$async)throw Error("async schema in sync schema")}a(Q,"vn");function M({gen:J,schemaEnv:z,schema:le,errSchemaPath:K,opts:ae}){let Me=le.$comment;if(ae.$comment===!0)J.code(u._`${d.default.self}.logger.log(${Me})`);else if(typeof ae.$comment=="function"){let ne=u.str`${K}/$comment`,se=J.scopeValue("root",{ref:z.root});J.code(u._`${d.default.self}.opts.$comment(${Me}, ${ne}, ${se}.schema)`)}}a(M,"iA");function O(J){let{gen:z,schemaEnv:le,validateName:K,ValidationError:ae,opts:Me}=J;le.$async?z.if(u._`${d.default.errors} === 0`,()=>z.return(d.default.data),()=>z.throw(u._`new ${ae}(${d.default.vErrors})`)):(z.assign(u._`${K}.errors`,d.default.vErrors),Me.unevaluated&&q(J),z.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function q({gen:J,evaluated:z,props:le,items:K}){le instanceof u.Name&&J.assign(u._`${z}.props`,le),K instanceof u.Name&&J.assign(u._`${z}.items`,K)}a(q,"Tn");function F(J,z,le,K){let{gen:ae,schema:Me,data:ne,allErrors:se,opts:Ie,self:_e}=J,{RULES:Re}=_e;if(Me.$ref&&(Ie.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(Me,Re))){ae.block(()=>Ae(J,"$ref",Re.all.$ref.definition));return}Ie.jtd||W(J,z),ae.block(()=>{for(let Xe of Re.rules)Je(Xe);Je(Re.post)});function Je(Xe){(0,n.shouldUseGroup)(Me,Xe)&&(Xe.type?(ae.if((0,o.checkDataType)(Xe.type,ne,Ie.strictNumbers)),U(J,Xe),z.length===1&&z[0]===Xe.type&&le&&(ae.else(),(0,o.reportTypeError)(J)),ae.endIf()):U(J,Xe),se||ae.if(u._`${d.default.errors} === ${K||0}`))}a(Je,"B")}a(F,"gA");function U(J,z){let{gen:le,schema:K,opts:{useDefaults:ae}}=J;ae&&(0,s.assignDefaults)(J,z.type),le.block(()=>{for(let Me of z.rules)(0,n.shouldUseRule)(K,Me)&&Ae(J,Me.keyword,Me.definition,z.type)})}a(U,"hA");function W(J,z){J.schemaEnv.meta||!J.opts.strictTypes||(V(J,z),!J.opts.allowUnionTypes&&G(J,z),Y(J,J.dataTypes))}a(W,"xn");function V(J,z){if(z.length){if(!J.dataTypes.length){J.dataTypes=z;return}z.forEach(le=>{j(J.dataTypes,le)||ie(J,`type "${le}" not allowed by context "${J.dataTypes.join(",")}"`)}),X(J,z)}}a(V,"yn");function G(J,z){z.length>1&&!(z.length===2&&z.includes("null"))&&ie(J,"use allowUnionTypes to allow union type keyword")}a(G,"fn");function Y(J,z){let le=J.self.RULES.all;for(let K in le){let ae=le[K];if(typeof ae=="object"&&(0,n.shouldUseRule)(J.schema,ae)){let{type:Me}=ae.definition;Me.length&&!Me.some(ne=>re(z,ne))&&ie(J,`missing type "${Me.join(",")}" for keyword "${K}"`)}}}a(Y,"gn");function re(J,z){return J.includes(z)||z==="number"&&J.includes("integer")}a(re,"hn");function j(J,z){return J.includes(z)||z==="integer"&&J.includes("number")}a(j,"nA");function X(J,z){let le=[];for(let K of J.dataTypes)j(z,K)?le.push(K):z.includes("integer")&&K==="number"&&le.push("integer");J.dataTypes=le}a(X,"un");function ie(J,z){let le=J.schemaEnv.baseId+J.errSchemaPath;z+=` at "${le}" (strictTypes)`,(0,h.checkStrictMode)(J,z,J.opts.strictTypes)}a(ie,"SB");class we{static{a(this,"vB")}constructor(z,le,K){if((0,c.validateKeywordUsage)(z,le,K),this.gen=z.gen,this.allErrors=z.allErrors,this.keyword=K,this.data=z.data,this.schema=z.schema[K],this.$data=le.$data&&z.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(z,this.schema,K,this.$data),this.schemaType=le.schemaType,this.parentSchema=z.schema,this.params={},this.it=z,this.def=le,this.$data)this.schemaCode=z.gen.const("vSchema",Z(this.$data,z));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,le.schemaType,le.allowUndefined))throw Error(`${K} value must be ${JSON.stringify(le.schemaType)}`);("code"in le?le.trackErrors:le.errors!==!1)&&(this.errsCount=z.gen.const("_errs",d.default.errors))}result(z,le,K){this.failResult((0,u.not)(z),le,K)}failResult(z,le,K){this.gen.if(z),K?K():this.error(),le?(this.gen.else(),le(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(z,le){this.failResult((0,u.not)(z),void 0,le)}fail(z){if(z===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(z),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(z){if(!this.$data)return this.fail(z);let{schemaCode:le}=this;this.fail(u._`${le} !== undefined && (${(0,u.or)(this.invalid$data(),z)})`)}error(z,le,K){if(le){this.setParams(le),this._error(z,K),this.setParams({});return}this._error(z,K)}_error(z,le){(z?m.reportExtraError:m.reportError)(this,this.def.error,le)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(z){this.allErrors||this.gen.if(z)}setParams(z,le){le?Object.assign(this.params,z):this.params=z}block$data(z,le,K=u.nil){this.gen.block(()=>{this.check$data(z,K),le()})}check$data(z=u.nil,le=u.nil){if(!this.$data)return;let{gen:K,schemaCode:ae,schemaType:Me,def:ne}=this;K.if((0,u.or)(u._`${ae} === undefined`,le)),z!==u.nil&&K.assign(z,!0),(Me.length||ne.validateSchema)&&(K.elseIf(this.invalid$data()),this.$dataError(),z!==u.nil&&K.assign(z,!1)),K.else()}invalid$data(){let{gen:z,schemaCode:le,schemaType:K,def:ae,it:Me}=this;return(0,u.or)(ne(),se());function ne(){if(K.length){if(!(le instanceof u.Name))throw Error("ajv implementation error");let Ie=Array.isArray(K)?K:[K];return u._`${(0,o.checkDataTypes)(Ie,le,Me.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function se(){if(ae.validateSchema){let Ie=z.scopeValue("validate$data",{ref:ae.validateSchema});return u._`!${Ie}(${le})`}return u.nil}}subschema(z,le){let K=(0,l.getSubschema)(this.it,z);(0,l.extendSubschemaData)(K,this.it,z),(0,l.extendSubschemaMode)(K,z);let ae={...this.it,...K,items:void 0,props:void 0};return T(ae,le),ae}mergeEvaluated(z,le){let{it:K,gen:ae}=this;K.opts.unevaluated&&(K.props!==!0&&z.props!==void 0&&(K.props=h.mergeEvaluated.props(ae,z.props,K.props,le)),K.items!==!0&&z.items!==void 0&&(K.items=h.mergeEvaluated.items(ae,z.items,K.items,le)))}mergeValidEvaluated(z,le){let{it:K,gen:ae}=this;if(K.opts.unevaluated&&(K.props!==!0||K.items!==!0))return ae.if(le,()=>this.mergeEvaluated(z,u.Name)),!0}}t.KeywordCxt=we;function Ae(J,z,le,K){let ae=new we(J,le,z);"code"in le?le.code(ae,K):ae.$data&&le.validate?(0,c.funcKeywordCode)(ae,le):"macro"in le?(0,c.macroKeywordCode)(ae,le):(le.compile||le.validate)&&(0,c.funcKeywordCode)(ae,le)}a(Ae,"rA");var De=/^\/(?:[^~]|~0|~1)*$/,Te=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Z(J,{dataLevel:z,dataNames:le,dataPathArr:K}){let ae,Me;if(J==="")return d.default.rootData;if(J[0]==="/"){if(!De.test(J))throw Error(`Invalid JSON-pointer: ${J}`);ae=J,Me=d.default.rootData}else{let _e=Te.exec(J);if(!_e)throw Error(`Invalid JSON-pointer: ${J}`);let Re=+_e[1];if(ae=_e[2],ae==="#"){if(Re>=z)throw Error(Ie("property/index",Re));return K[z-Re]}if(Re>z)throw Error(Ie("data",Re));if(Me=le[z-Re],!ae)return Me}let ne=Me,se=ae.split("/");for(let _e of se)_e&&(Me=u._`${Me}${(0,u.getProperty)((0,h.unescapeJsonPointer)(_e))}`,ne=u._`${ne} && ${Me}`);return ne;function Ie(_e,Re){return`Cannot access ${_e} ${Re} levels up, current level is ${z}`}}a(Z,"oA"),t.getData=Z}),h3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),$Tt=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=HTt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),m3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=Rs(),r=h3r(),n=kV(),o=HTt(),s=uc(),c=GTt();class l{static{a(this,"CJ")}constructor(v){var b;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(b=v.baseId)!==null&&b!==void 0?b:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),k;_.$async&&(k=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:k,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},L;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let B=x.toString();L=`${x.scopeRefs(n.default.scope)}return ${B}`,this.opts.code.process&&(L=this.opts.code.process(L,_));let Q=Function(`${n.default.self}`,`${n.default.scope}`,L)(this,this.scope.get());if(this.scope.value(D,{ref:Q}),Q.errors=null,Q.schema=_.schema,Q.schemaEnv=_,_.$async&&(Q.$async=!0),this.opts.code.source===!0&&(Q.source={validateName:D,validateCode:B,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:O}=N;Q.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},Q.source&&(Q.source.evaluated=(0,e.stringify)(Q.evaluated))}return _.validate=Q,_}catch(B){throw delete _.validate,delete _.validateName,L&&this.logger.error("Error compiling schema, function code:",L),B}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:k}=this.opts;x&&(R=new l({schema:x,schemaId:k,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let k=A.call(this,_,x);return typeof k?.schema!="object"?void 0:E.call(this,b,k)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:k}=x,{schemaId:D}=this.opts,N=k[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:k,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let k of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(k)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(k)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let k=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,k)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),zOc=Ut((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),EVi=Ut((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let k="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";k+=x[N]}return k}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,k,D){if(x.length){let N=l(x);if(N!=="")k.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let k=0,D={error:!1,address:"",zone:""},N=[],L=[],B=!1,Q=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(B=!0),N.push(":");continue}else if(q==="%"){if(!M(L,N,D))break;M=d}else{L.push(q);continue}}return L.length&&(M===d?D.zone=L.join(""):Q?N.push(L.join("")):N.push(l(L))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let k=h(x);if(k.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=k;return k.zone&&(D+="%"+k.zone,N+="%25"+k.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,k){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,k=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=EVi(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let k=String(x.scheme).toLowerCase()==="https";return(x.port===(k?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[k,D]=x.resourceName.split("?");x.path=k&&k!=="/"?k:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,k){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=k.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let L=`${N}:${k.nid||x.nid}`,B=R(L);x.path=void 0,B&&(x=B.parse(x,k))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,k){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=k.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),L=`${D}:${k.nid||N}`,B=R(L);B&&(x=B.serialize(x,k));let Q=x,M=x.nss;return Q.path=`${N||k.nid}:${M}`,k.skipEscape=!0,Q}a(m,"Er");function g(x,k){let D=x;return D.uuid=D.nss,D.nss=void 0,!k.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let k=x;return k.nss=(x.uuid||"").toLowerCase(),k}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),KOc=Ut((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=EVi(),{SCHEMES:h,getSchemeHandler:m}=YOc();function g(N,L){return typeof N=="string"?N=R(N,L):typeof N=="object"&&(N=w(_(N,L),L)),N}a(g,"cr");function A(N,L,B){let Q=B?Object.assign({scheme:"null"},B):{scheme:"null"},M=y(w(N,Q),w(L,Q),Q,!0);return Q.skipEscape=!0,_(M,Q)}a(A,"pr");function y(N,L,B,Q){let M={};return Q||(N=w(_(N,B),B),L=w(_(L,B),B)),B=B||{},!B.tolerant&&L.scheme?(M.scheme=L.scheme,M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.userinfo!==void 0||L.host!==void 0||L.port!==void 0?(M.userinfo=L.userinfo,M.host=L.host,M.port=L.port,M.path=n(L.path||""),M.query=L.query):(L.path?(L.path[0]==="/"?M.path=n(L.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+L.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+L.path:M.path=L.path,M.path=n(M.path)),M.query=L.query):(M.path=N.path,L.query!==void 0?M.query=L.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=L.fragment,M}a(y,"MI");function E(N,L,B){let Q=k(N,B),M=k(L,B);return Q!==void 0&&M!==void 0&&Q.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,L){let B={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},Q=Object.assign({},L),M=[],O=m(Q.scheme||B.scheme);O&&O.serialize&&O.serialize(B,Q),B.path!==void 0&&(Q.skipEscape?B.path=s(B.path):(B.path=l(B.path),B.scheme!==void 0&&(B.path=B.path.split("%3A").join(":")))),Q.reference!=="suffix"&&B.scheme&&M.push(B.scheme,":");let q=o(B);if(q!==void 0&&(Q.reference!=="suffix"&&M.push("//"),M.push(q),B.path&&B.path[0]!=="/"&&M.push("/")),B.path!==void 0){let F=B.path;!Q.absolutePath&&(!O||!O.absolutePath)&&(F=n(F)),q===void 0&&F[0]==="/"&&F[1]==="/"&&(F="/%2F"+F.slice(2)),M.push(F)}return B.query!==void 0&&M.push("?",B.query),B.fragment!==void 0&&M.push("#",B.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,L){if(L[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(b,"nr");function T(N,L){let B=Object.assign({},L),Q={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;B.reference==="suffix"&&(B.scheme?N=B.scheme+":"+N:N="//"+N);let q=N.match(v);if(q){Q.scheme=q[1],Q.userinfo=q[3],Q.host=q[4],Q.port=parseInt(q[5],10),Q.path=q[6]||"",Q.query=q[7],Q.fragment=q[8],isNaN(Q.port)&&(Q.port=q[5]);let F=b(Q,q);if(F!==void 0&&(Q.error=Q.error||F,M=!0),Q.host)if(d(Q.host)===!1){let W=r(Q.host);Q.host=W.host.toLowerCase(),O=W.isIPV6}else O=!0;Q.scheme===void 0&&Q.userinfo===void 0&&Q.host===void 0&&Q.port===void 0&&Q.query===void 0&&!Q.path?Q.reference="same-document":Q.scheme===void 0?Q.reference="relative":Q.fragment===void 0?Q.reference="absolute":Q.reference="uri",B.reference&&B.reference!=="suffix"&&B.reference!==Q.reference&&(Q.error=Q.error||"URI is not a "+B.reference+" reference.");let U=m(B.scheme||Q.scheme);if(!B.unicodeSupport&&(!U||!U.unicodeSupport)&&Q.host&&(B.domainHost||U&&U.domainHost)&&O===!1&&f(Q.host))try{Q.host=URL.domainToASCII(Q.host.toLowerCase())}catch(W){Q.error=Q.error||"Host's domain name can not be converted to ASCII: "+W}if((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(Q.scheme!==void 0&&(Q.scheme=unescape(Q.scheme)),Q.host!==void 0&&(Q.host=u(unescape(Q.host),O))),Q.path&&(Q.path=c(Q.path)),Q.fragment))try{Q.fragment=encodeURI(decodeURIComponent(Q.fragment))}catch{Q.error=Q.error||"URI malformed"}U&&U.parse&&U.parse(Q,B)}else Q.error=Q.error||"URI can not be parsed.";return{parsed:Q,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,L){return T(N,L).parsed}a(w,"w9");function R(N,L){return x(N,L).normalized}a(R,"rr");function x(N,L){let{parsed:B,malformedAuthorityOrPort:Q}=T(N,L);return{normalized:Q?N:_(B,L),malformedAuthorityOrPort:Q}}a(x,"jI");function k(N,L){if(typeof N=="string"){let{normalized:B,malformedAuthorityOrPort:Q}=x(N,L);return Q?void 0:B}if(typeof N=="object")return _(N,L)}a(k,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),JOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=KOc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),ZOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=GTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=Rs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=h3r(),o=$Tt(),s=gVi(),c=m3r(),l=Rs(),u=HTt(),d=CSt(),f=uc(),h=zOc(),m=JOc(),g=a((V,G)=>new RegExp(V,G),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(V){var G,Y,re,j,X,ie,we,Ae,De,Te,Z,J,z,le,K,ae,Me,ne,se,Ie,_e,Re,Je,Xe,Ct;let Ot=V.strict,$t=(G=V.code)===null||G===void 0?void 0:G.optimize,Gt=$t===!0||$t===void 0?1:$t||0,Ee=(re=(Y=V.code)===null||Y===void 0?void 0:Y.regExp)!==null&&re!==void 0?re:g,Qe=(j=V.uriResolver)!==null&&j!==void 0?j:m.default;return{strictSchema:(ie=(X=V.strictSchema)!==null&&X!==void 0?X:Ot)!==null&&ie!==void 0?ie:!0,strictNumbers:(Ae=(we=V.strictNumbers)!==null&&we!==void 0?we:Ot)!==null&&Ae!==void 0?Ae:!0,strictTypes:(Te=(De=V.strictTypes)!==null&&De!==void 0?De:Ot)!==null&&Te!==void 0?Te:"log",strictTuples:(J=(Z=V.strictTuples)!==null&&Z!==void 0?Z:Ot)!==null&&J!==void 0?J:"log",strictRequired:(le=(z=V.strictRequired)!==null&&z!==void 0?z:Ot)!==null&&le!==void 0?le:!1,code:V.code?{...V.code,optimize:Gt,regExp:Ee}:{optimize:Gt,regExp:Ee},loopRequired:(K=V.loopRequired)!==null&&K!==void 0?K:v,loopEnum:(ae=V.loopEnum)!==null&&ae!==void 0?ae:v,meta:(Me=V.meta)!==null&&Me!==void 0?Me:!0,messages:(ne=V.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(se=V.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(Ie=V.schemaId)!==null&&Ie!==void 0?Ie:"$id",addUsedSchema:(_e=V.addUsedSchema)!==null&&_e!==void 0?_e:!0,validateSchema:(Re=V.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(Je=V.validateFormats)!==null&&Je!==void 0?Je:!0,unicodeRegExp:(Xe=V.unicodeRegExp)!==null&&Xe!==void 0?Xe:!0,int32range:(Ct=V.int32range)!==null&&Ct!==void 0?Ct:!0,uriResolver:Qe}}a(b,"Wo");class T{static{a(this,"CW")}constructor(G={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,G=this.opts={...G,...b(G)};let{es5:Y,lines:re}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:Y,lines:re}),this.logger=B(G.logger);let j=G.validateFormats;G.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,G,"NOT SUPPORTED"),w.call(this,_,G,"DEPRECATED","warn"),this._metaOpts=N.call(this),G.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),G.keywords&&D.call(this,G.keywords),typeof G.meta=="object"&&this.addMetaSchema(G.meta),x.call(this),G.validateFormats=j}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:G,meta:Y,schemaId:re}=this.opts,j=h;re==="id"&&(j={...h},j.id=j.$id,delete j.$id),Y&&G&&this.addMetaSchema(j,j[re],!1)}defaultMeta(){let{meta:G,schemaId:Y}=this.opts;return this.opts.defaultMeta=typeof G=="object"?G[Y]||G:void 0}validate(G,Y){let re;if(typeof G=="string"){if(re=this.getSchema(G),!re)throw Error(`no schema with key or ref "${G}"`)}else re=this.compile(G);let j=re(Y);return"$async"in re||(this.errors=re.errors),j}compile(G,Y){let re=this._addSchema(G,Y);return re.validate||this._compileSchemaEnv(re)}compileAsync(G,Y){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:re}=this.opts;return j.call(this,G,Y);async function j(Te,Z){await X.call(this,Te.$schema);let J=this._addSchema(Te,Z);return J.validate||ie.call(this,J)}async function X(Te){Te&&!this.getSchema(Te)&&await j.call(this,{$ref:Te},!0)}async function ie(Te){try{return this._compileSchemaEnv(Te)}catch(Z){if(!(Z instanceof o.default))throw Z;return we.call(this,Z),await Ae.call(this,Z.missingSchema),ie.call(this,Te)}}function we({missingSchema:Te,missingRef:Z}){if(this.refs[Te])throw Error(`AnySchema ${Te} is loaded but ${Z} cannot be resolved`)}async function Ae(Te){let Z=await De.call(this,Te);this.refs[Te]||await X.call(this,Z.$schema),this.refs[Te]||this.addSchema(Z,Te,Y)}async function De(Te){let Z=this._loading[Te];if(Z)return Z;try{return await(this._loading[Te]=re(Te))}finally{delete this._loading[Te]}}}addSchema(G,Y,re,j=this.opts.validateSchema){if(Array.isArray(G)){for(let ie of G)this.addSchema(ie,void 0,re,j);return this}let X;if(typeof G=="object"){let{schemaId:ie}=this.opts;if(X=G[ie],X!==void 0&&typeof X!="string")throw Error(`schema ${ie} must be string`)}return Y=(0,u.normalizeId)(Y||X),this._checkUnique(Y),this.schemas[Y]=this._addSchema(G,re,Y,j,!0),this}addMetaSchema(G,Y,re=this.opts.validateSchema){return this.addSchema(G,Y,!0,re),this}validateSchema(G,Y){if(typeof G=="boolean")return!0;let re;if(re=G.$schema,re!==void 0&&typeof re!="string")throw Error("$schema must be a string");if(re=re||this.opts.defaultMeta||this.defaultMeta(),!re)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let j=this.validate(re,G);if(!j&&Y){let X="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(X);else throw Error(X)}return j}getSchema(G){let Y;for(;typeof(Y=R.call(this,G))=="string";)G=Y;if(Y===void 0){let{schemaId:re}=this.opts,j=new c.SchemaEnv({schema:{},schemaId:re});if(Y=c.resolveSchema.call(this,j,G),!Y)return;this.refs[G]=Y}return Y.validate||this._compileSchemaEnv(Y)}removeSchema(G){if(G instanceof RegExp)return this._removeAllSchemas(this.schemas,G),this._removeAllSchemas(this.refs,G),this;switch(typeof G){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let Y=R.call(this,G);return typeof Y=="object"&&this._cache.delete(Y.schema),delete this.schemas[G],delete this.refs[G],this}case"object":{let Y=G;this._cache.delete(Y);let re=G[this.opts.schemaId];return re&&(re=(0,u.normalizeId)(re),delete this.schemas[re],delete this.refs[re]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(G){for(let Y of G)this.addKeyword(Y);return this}addKeyword(G,Y){let re;if(typeof G=="string")re=G,typeof Y=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),Y.keyword=re);else if(typeof G=="object"&&Y===void 0){if(Y=G,re=Y.keyword,Array.isArray(re)&&!re.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,re,Y),!Y)return(0,f.eachItem)(re,X=>O.call(this,X)),this;F.call(this,Y);let j={...Y,type:(0,d.getJSONTypes)(Y.type),schemaType:(0,d.getJSONTypes)(Y.schemaType)};return(0,f.eachItem)(re,j.type.length===0?X=>O.call(this,X,j):X=>j.type.forEach(ie=>O.call(this,X,j,ie))),this}getKeyword(G){let Y=this.RULES.all[G];return typeof Y=="object"?Y.definition:!!Y}removeKeyword(G){let{RULES:Y}=this;delete Y.keywords[G],delete Y.all[G];for(let re of Y.rules){let j=re.rules.findIndex(X=>X.keyword===G);j>=0&&re.rules.splice(j,1)}return this}addFormat(G,Y){return typeof Y=="string"&&(Y=new RegExp(Y)),this.formats[G]=Y,this}errorsText(G=this.errors,{separator:Y=", ",dataVar:re="data"}={}){return!G||G.length===0?"No errors":G.map(j=>`${re}${j.instancePath} ${j.message}`).reduce((j,X)=>j+Y+X)}$dataMetaSchema(G,Y){let re=this.RULES.all;G=JSON.parse(JSON.stringify(G));for(let j of Y){let X=j.split("/").slice(1),ie=G;for(let we of X)ie=ie[we];for(let we in re){let Ae=re[we];if(typeof Ae!="object")continue;let{$data:De}=Ae.definition,Te=ie[we];De&&Te&&(ie[we]=W(Te))}}return G}_removeAllSchemas(G,Y){for(let re in G){let j=G[re];(!Y||Y.test(re))&&(typeof j=="string"?delete G[re]:j&&!j.meta&&(this._cache.delete(j.schema),delete G[re]))}}_addSchema(G,Y,re,j=this.opts.validateSchema,X=this.opts.addUsedSchema){let ie,{schemaId:we}=this.opts;if(typeof G=="object")ie=G[we];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof G!="boolean")throw Error("schema must be object or boolean")}let Ae=this._cache.get(G);if(Ae!==void 0)return Ae;re=(0,u.normalizeId)(ie||re);let De=u.getSchemaRefs.call(this,G,re);return Ae=new c.SchemaEnv({schema:G,schemaId:we,meta:Y,baseId:re,localRefs:De}),this._cache.set(Ae.schema,Ae),X&&!re.startsWith("#")&&(re&&this._checkUnique(re),this.refs[re]=Ae),j&&this.validateSchema(G,!0),Ae}_checkUnique(G){if(this.schemas[G]||this.refs[G])throw Error(`schema with key or id "${G}" already exists`)}_compileSchemaEnv(G){if(G.meta?this._compileMetaSchema(G):c.compileSchema.call(this,G),!G.validate)throw Error("ajv implementation error");return G.validate}_compileMetaSchema(G){let Y=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,G)}finally{this.opts=Y}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(V,G,Y,re="error"){for(let j in V){let X=j;X in G&&this.logger[re](`${Y}: option ${j}. ${V[X]}`)}}a(w,"_I");function R(V){return V=(0,u.normalizeId)(V),this.schemas[V]||this.refs[V]}a(R,"kI");function x(){let V=this.opts.schemas;if(V)if(Array.isArray(V))this.addSchema(V);else for(let G in V)this.addSchema(V[G],G)}a(x,"Go");function k(){for(let V in this.opts.formats){let G=this.opts.formats[V];G&&this.addFormat(V,G)}}a(k,"Uo");function D(V){if(Array.isArray(V)){this.addVocabulary(V);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let G in V){let Y=V[G];Y.keyword||(Y.keyword=G),this.addKeyword(Y)}}a(D,"Ho");function N(){let V={...this.opts};for(let G of A)delete V[G];return V}a(N,"Ko");var L={log(){},warn(){},error(){}};function B(V){if(V===!1)return L;if(V===void 0)return console;if(V.log&&V.warn&&V.error)return V;throw Error("logger must implement log, warn and error methods")}a(B,"Vo");var Q=/^[a-z_$][a-z0-9_$:-]*$/i;function M(V,G){let{RULES:Y}=this;if((0,f.eachItem)(V,re=>{if(Y.keywords[re])throw Error(`Keyword ${re} is already defined`);if(!Q.test(re))throw Error(`Keyword ${re} has invalid name`)}),!!G&&G.$data&&!("code"in G||"validate"in G))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(V,G,Y){var re;let j=G?.post;if(Y&&j)throw Error('keyword with "post" flag cannot have "type"');let{RULES:X}=this,ie=j?X.post:X.rules.find(({type:Ae})=>Ae===Y);if(ie||(ie={type:Y,rules:[]},X.rules.push(ie)),X.keywords[V]=!0,!G)return;let we={keyword:V,definition:{...G,type:(0,d.getJSONTypes)(G.type),schemaType:(0,d.getJSONTypes)(G.schemaType)}};G.before?q.call(this,ie,we,G.before):ie.rules.push(we),X.all[V]=we,(re=G.implements)===null||re===void 0||re.forEach(Ae=>this.addKeyword(Ae))}a(O,"lB");function q(V,G,Y){let re=V.rules.findIndex(j=>j.keyword===Y);re>=0?V.rules.splice(re,0,G):(V.rules.push(G),this.logger.warn(`rule ${Y} is not defined`))}a(q,"No");function F(V){let{metaSchema:G}=V;G!==void 0&&(V.$data&&this.opts.$data&&(G=W(G)),V.validateSchema=this.compile(G,!0))}a(F,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function W(V){return{anyOf:[V,U]}}a(W,"CI")}),XOc=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),e5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=$Tt(),r=pN(),n=Rs(),o=kV(),s=m3r(),c=uc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===b)return d(f,E,y,y.$async);let k=h.scopeValue("root",{ref:b});return d(f,n._`${k}.validate`,b,b.$async)}function R(k){let D=u(f,k);d(f,D,k,k.$async)}function x(k){let D=h.scopeValue("schema",_.code.source===!0?{ref:k,code:(0,n.stringify)(k)}:{ref:k}),N=h.name("valid"),L=f.subschema({schema:k,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(L),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let k=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(k,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(k,!1)}),f.ok(k)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(k){let D=n._`${k}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(k){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let L=A.var("props",n._`${k}.evaluated.props`);y.props=c.mergeEvaluated.props(A,L,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let L=A.var("items",n._`${k}.evaluated.items`);y.items=c.mergeEvaluated.items(A,L,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),t5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=XOc(),r=e5c(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),r5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),n5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),i5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=i5c(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),s5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=uc(),n=Rs(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),a5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),c5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=uc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),l5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),g3r=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=yVi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),u5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=CSt(),r=Rs(),n=uc(),o=g3r(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),k=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(k,r._`continue`),E.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),k=u.name("outer");u.label(k).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(k)})))}a(T,"N")}};t.default=c}),d5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=g3r(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),f5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=g3r(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),p5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=r5c(),r=n5c(),n=o5c(),o=s5c(),s=a5c(),c=c5c(),l=l5c(),u=u5c(),d=d5c(),f=f5c(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),_Vi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=Rs(),r=uc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,E=>{c.subschema({keyword:h,dataProp:E,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),CVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=Rs(),r=uc(),n=pN(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;E(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),h5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=CVi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),m5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n=pN(),o=_Vi(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),g5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),A5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=Rs(),r=uc(),n=pN();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, + || ${D} === "boolean" || ${x} === null`).assign(N,o._`[${x}]`)}}a(B,"H")}a(m,"Ui");function g({gen:b,parentData:T,parentDataProperty:w},R){b.if(o._`${T} !== undefined`,()=>b.assign(o._`${T}[${w}]`,R))}a(g,"Hi");function A(b,T,w,R=c.Correct){let x=R===c.Correct?o.operators.EQ:o.operators.NEQ,P;switch(b){case"null":return o._`${T} ${x} null`;case"array":P=o._`Array.isArray(${T})`;break;case"object":P=o._`${T} && typeof ${T} == "object" && !Array.isArray(${T})`;break;case"integer":P=D(o._`!(${T} % 1) && !isNaN(${T})`);break;case"number":P=D();break;default:return o._`typeof ${T} ${x} ${b}`}return R===c.Correct?P:(0,o.not)(P);function D(N=o.nil){return(0,o.and)(o._`typeof ${T} == "number"`,N,w?o._`isFinite(${T})`:o.nil)}}a(A,"LB"),t.checkDataType=A;function y(b,T,w,R){if(b.length===1)return A(b[0],T,w,R);let x,P=(0,s.toHash)(b);if(P.array&&P.object){let D=o._`typeof ${T} != "object"`;x=P.null?D:o._`!${T} || ${D}`,delete P.null,delete P.array,delete P.object}else x=o.nil;P.number&&delete P.integer;for(let D in P)x=(0,o.and)(x,A(D,T,w,R));return x}a(y,"jB"),t.checkDataTypes=y;var E={message:a(({schema:b})=>`must be ${b}`,"message"),params:a(({schema:b,schemaValue:T})=>typeof b=="string"?o._`{type: ${b}}`:o._`{type: ${T}}`,"params")};function _(b){let T=v(b);(0,n.reportError)(T,E)}a(_,"AB"),t.reportTypeError=_;function v(b){let{gen:T,data:w,schema:R}=b,x=(0,s.schemaRefOrVal)(b,R,"type");return{gen:T,keyword:"type",data:w,schema:R.type,schemaCode:x,schemaValue:x,parentSchema:R,params:{},it:b}}a(v,"qi")}),UNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;var e=xs(),r=uc();function n(s,c){let{properties:l,items:u}=s.schema;if(c==="object"&&l)for(let d in l)o(s,d,l[d].default);else c==="array"&&Array.isArray(u)&&u.forEach((d,f)=>o(s,f,d.default))}a(n,"Fi"),t.assignDefaults=n;function o(s,c,l){let{gen:u,compositeRule:d,data:f,opts:h}=s;if(l===void 0)return;let m=e._`${f}${(0,e.getProperty)(c)}`;if(d){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let g=e._`${m} === undefined`;h.useDefaults==="empty"&&(g=e._`${g} || ${m} === null || ${m} === ""`),u.if(g,e._`${m} = ${(0,e.stringify)(l)}`)}a(o,"VA")}),uN=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;var e=xs(),r=uc(),n=EV(),o=uc();function s(b,T){let{gen:w,data:R,it:x}=b;w.if(h(w,R,T,x.opts.ownProperties),()=>{b.setParams({missingProperty:e._`${T}`},!0),b.error()})}a(s,"Mi"),t.checkReportMissingProp=s;function c({gen:b,data:T,it:{opts:w}},R,x){return(0,e.or)(...R.map(P=>(0,e.and)(h(b,T,P,w.ownProperties),e._`${x} = ${P}`)))}a(c,"Li"),t.checkMissingProp=c;function l(b,T){b.setParams({missingProperty:T},!0),b.error()}a(l,"ji"),t.reportMissingProp=l;function u(b){return b.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}a(u,"wA"),t.hasPropFunc=u;function d(b,T,w){return e._`${u(b)}.call(${T}, ${w})`}a(d,"RB"),t.isOwnProperty=d;function f(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} !== undefined`;return R?e._`${x} && ${d(b,T,w)}`:x}a(f,"Ai"),t.propertyInData=f;function h(b,T,w,R){let x=e._`${T}${(0,e.getProperty)(w)} === undefined`;return R?(0,e.or)(x,(0,e.not)(d(b,T,w))):x}a(h,"PB"),t.noPropertyInData=h;function m(b){return b?Object.keys(b).filter(T=>T!=="__proto__"):[]}a(m,"OA"),t.allSchemaProperties=m;function g(b,T){return m(T).filter(w=>!(0,r.alwaysValidSchema)(b,T[w]))}a(g,"Ii"),t.schemaProperties=g;function A({schemaCode:b,data:T,it:{gen:w,topSchemaRef:R,schemaPath:x,errorPath:P},it:D},N,B,L){let j=L?e._`${b}, ${T}, ${R}${x}`:T,M=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,D.parentData],[n.default.parentDataProperty,D.parentDataProperty],[n.default.rootData,n.default.rootData]];D.opts.dynamicRef&&M.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);let O=e._`${j}, ${w.object(...M)}`;return B!==e.nil?e._`${N}.call(${B}, ${O})`:e._`${N}(${O})`}a(A,"Ri"),t.callValidateCode=A;var y=e._`new RegExp`;function E({gen:b,it:{opts:T}},w){let R=T.unicodeRegExp?"u":"",{regExp:x}=T.code,P=x(w,R);return b.scopeValue("pattern",{key:P.toString(),ref:P,code:e._`${x.code==="new RegExp"?y:(0,o.useFunc)(b,x)}(${w}, ${R})`})}a(E,"Ei"),t.usePattern=E;function _(b){let{gen:T,data:w,keyword:R,it:x}=b,P=T.name("valid");if(x.allErrors){let N=T.let("valid",!0);return D(()=>T.assign(N,!1)),N}return T.var(P,!0),D(()=>T.break()),P;function D(N){let B=T.const("len",e._`${w}.length`);T.forRange("i",0,B,L=>{b.subschema({keyword:R,dataProp:L,dataPropType:r.Type.Num},P),T.if((0,e.not)(P),N)})}}a(_,"bi"),t.validateArray=_;function v(b){let{gen:T,schema:w,keyword:R,it:x}=b;if(!Array.isArray(w))throw Error("ajv implementation error");if(w.some(N=>(0,r.alwaysValidSchema)(x,N))&&!x.opts.unevaluated)return;let P=T.let("valid",!1),D=T.name("_valid");T.block(()=>w.forEach((N,B)=>{let L=b.subschema({keyword:R,schemaProp:B,compositeRule:!0},D);T.assign(P,e._`${P} || ${D}`),!b.mergeValidEvaluated(L,D)&&T.if((0,e.not)(P))})),b.result(P,()=>b.reset(),()=>b.error(!0))}a(v,"_i"),t.validateUnion=v}),QNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;var e=xs(),r=EV(),n=uN(),o=wTt();function s(g,A){let{gen:y,keyword:E,schema:_,parentSchema:v,it:b}=g,T=A.macro.call(b.self,_,v,b),w=f(y,E,T);b.opts.validateSchema!==!1&&b.self.validateSchema(T,!0);let R=y.name("valid");g.subschema({schema:T,schemaPath:e.nil,errSchemaPath:`${b.errSchemaPath}/${E}`,topSchemaRef:w,compositeRule:!0},R),g.pass(R,()=>g.error(!0))}a(s,"pi"),t.macroKeywordCode=s;function c(g,A){var y;let{gen:E,keyword:_,schema:v,parentSchema:b,$data:T,it:w}=g;d(w,A);let R=!T&&A.compile?A.compile.call(w.self,v,b,w):A.validate,x=f(E,_,R),P=E.let("valid");g.block$data(P,D),g.ok((y=A.valid)!==null&&y!==void 0?y:P);function D(){if(A.errors===!1)L(),A.modifying&&l(g),j(()=>g.error());else{let M=A.async?N():B();A.modifying&&l(g),j(()=>u(g,M))}}a(D,"z");function N(){let M=E.let("ruleErrs",null);return E.try(()=>L(e._`await `),O=>E.assign(P,!1).if(e._`${O} instanceof ${w.ValidationError}`,()=>E.assign(M,e._`${O}.errors`),()=>E.throw(O))),M}a(N,"N");function B(){let M=e._`${x}.errors`;return E.assign(M,null),L(e.nil),M}a(B,"w");function L(M=A.async?e._`await `:e.nil){let O=w.opts.passContext?r.default.this:r.default.self,q=!("compile"in A&&!T||A.schema===!1);E.assign(P,e._`${M}${(0,n.callValidateCode)(g,x,O,q)}`,A.modifying)}a(L,"O");function j(M){var O;E.if((0,e.not)((O=A.valid)!==null&&O!==void 0?O:P),M)}a(j,"D")}a(c,"di"),t.funcKeywordCode=c;function l(g){let{gen:A,data:y,it:E}=g;A.if(E.parentData,()=>A.assign(y,e._`${E.parentData}[${E.parentDataProperty}]`))}a(l,"ZA");function u(g,A){let{gen:y}=g;y.if(e._`Array.isArray(${A})`,()=>{y.assign(r.default.vErrors,e._`${r.default.vErrors} === null ? ${A} : ${r.default.vErrors}.concat(${A})`).assign(r.default.errors,e._`${r.default.vErrors}.length`),(0,o.extendErrors)(g)},()=>g.error())}a(u,"ii");function d({schemaEnv:g},A){if(A.async&&!g.$async)throw Error("async keyword in sync schema")}a(d,"ni");function f(g,A,y){if(y===void 0)throw Error(`keyword "${A}" failed to compile`);return g.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}a(f,"MA");function h(g,A,y=!1){return!A.length||A.some(E=>E==="array"?Array.isArray(g):E==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==E||y&&typeof g>"u")}a(h,"ri"),t.validSchemaType=h;function m({schema:g,opts:A,self:y,errSchemaPath:E},_,v){if(Array.isArray(_.keyword)?!_.keyword.includes(v):_.keyword!==v)throw Error("ajv implementation error");let b=_.dependencies;if(b?.some(T=>!Object.prototype.hasOwnProperty.call(g,T)))throw Error(`parent schema must have dependencies of ${v}: ${b.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[v])){let T=`keyword "${v}" value is invalid at path "${E}": `+y.errorsText(_.validateSchema.errors);if(A.validateSchema==="log")y.logger.error(T);else throw Error(T)}}a(m,"oi"),t.validateKeywordUsage=m}),qNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;var e=xs(),r=uc();function n(c,{keyword:l,schemaProp:u,schema:d,schemaPath:f,errSchemaPath:h,topSchemaRef:m}){if(l!==void 0&&d!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){let g=c.schema[l];return u===void 0?{schema:g,schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${c.errSchemaPath}/${l}`}:{schema:g[u],schemaPath:e._`${c.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${c.errSchemaPath}/${l}/${(0,r.escapeFragment)(u)}`}}if(d!==void 0){if(f===void 0||h===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:f,topSchemaRef:m,errSchemaPath:h}}throw Error('either "keyword" or "schema" must be passed')}a(n,"ei"),t.getSubschema=n;function o(c,l,{dataProp:u,dataPropType:d,data:f,dataTypes:h,propertyName:m}){if(f!==void 0&&u!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:g}=l;if(u!==void 0){let{errorPath:y,dataPathArr:E,opts:_}=l,v=g.let("data",e._`${l.data}${(0,e.getProperty)(u)}`,!0);A(v),c.errorPath=e.str`${y}${(0,r.getErrorPath)(u,d,_.jsPropertySyntax)}`,c.parentDataProperty=e._`${u}`,c.dataPathArr=[...E,c.parentDataProperty]}if(f!==void 0){let y=f instanceof e.Name?f:g.let("data",f,!0);A(y),m!==void 0&&(c.propertyName=m)}h&&(c.dataTypes=h);function A(y){c.data=y,c.dataLevel=l.dataLevel+1,c.dataTypes=[],l.definedProperties=new Set,c.parentData=l.data,c.dataNames=[...l.dataNames,y]}a(A,"H")}a(o,"$n"),t.extendSubschemaData=o;function s(c,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:d,createErrors:f,allErrors:h}){d!==void 0&&(c.compositeRule=d),f!==void 0&&(c.createErrors=f),h!==void 0&&(c.allErrors=h),c.jtdDiscriminator=l,c.jtdMetadata=u}a(s,"Qn"),t.extendSubschemaMode=s}),oVi=qt((t,e)=>{e.exports=a(function r(n,o){if(n===o)return!0;if(n&&o&&typeof n=="object"&&typeof o=="object"){if(n.constructor!==o.constructor)return!1;var s,c,l;if(Array.isArray(n)){if(s=n.length,s!=o.length)return!1;for(c=s;c--!==0;)if(!r(n[c],o[c]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if(l=Object.keys(n),s=l.length,s!==Object.keys(o).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[c]))return!1;for(c=s;c--!==0;){var u=l[c];if(!r(n[u],o[u]))return!1}return!0}return n!==n&&o!==o},"$")}),jNc=qt((t,e)=>{var r=e.exports=function(s,c,l){typeof c=="function"&&(l=c,c={}),l=c.cb||l;var u=typeof l=="function"?l:l.pre||function(){},d=l.post||function(){};n(c,u,d,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(s,c,l,u,d,f,h,m,g,A){if(u&&typeof u=="object"&&!Array.isArray(u)){c(u,d,f,h,m,g,A);for(var y in u){var E=u[y];if(Array.isArray(E)){if(y in r.arrayKeywords)for(var _=0;_{Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;var e=uc(),r=oVi(),n=jNc(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,_=!0){return typeof E=="boolean"?!0:_===!0?!l(E):_?u(E)<=_:!1}a(s,"Kn"),t.inlineRef=s;var c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(E){for(let _ in E){if(c.has(_))return!0;let v=E[_];if(Array.isArray(v)&&v.some(l)||typeof v=="object"&&l(v))return!0}return!1}a(l,"bB");function u(E){let _=0;for(let v in E){if(v==="$ref")return 1/0;if(_++,!o.has(v)&&(typeof E[v]=="object"&&(0,e.eachItem)(E[v],b=>_+=u(b)),_===1/0))return 1/0}return _}a(u,"SA");function d(E,_="",v){v!==!1&&(_=m(_));let b=E.parse(_);return f(E,b)}a(d,"vA"),t.getFullPath=d;function f(E,_){return E.serialize(_).split("#")[0]+"#"}a(f,"CA"),t._getFullPath=f;var h=/#\/?$/;function m(E){return E?E.replace(h,""):""}a(m,"N9"),t.normalizeId=m;function g(E,_,v){return v=m(v),E.resolve(_,v)}a(g,"Bn"),t.resolveUrl=g;var A=/^[a-z_][-a-z0-9._]*$/i;function y(E,_){if(typeof E=="boolean")return{};let{schemaId:v,uriResolver:b}=this.opts,T=m(E[v]||_),w={"":T},R=d(b,T,!1),x={},P=new Set;return n(E,{allKeys:!0},(B,L,j,M)=>{if(M===void 0)return;let O=R+L,q=w[M];typeof B[v]=="string"&&(q=Q.call(this,B[v])),U.call(this,B.$anchor),U.call(this,B.$dynamicAnchor),w[L]=q;function Q(z){let W=this.opts.uriResolver.resolve;if(z=m(q?W(q,z):z),P.has(z))throw N(z);P.add(z);let $=this.refs[z];return typeof $=="string"&&($=this.refs[$]),typeof $=="object"?D(B,$.schema,z):z!==m(O)&&(z[0]==="#"?(D(B,x[z],z),x[z]=B):this.refs[z]=O),z}a(Q,"M");function U(z){if(typeof z=="string"){if(!A.test(z))throw Error(`invalid anchor "${z}"`);Q.call(this,`#${z}`)}}a(U,"j")}),x;function D(B,L,j){if(L!==void 0&&!r(B,L))throw N(j)}function N(B){return Error(`reference "${B}" resolves to more than one schema`)}}a(y,"Nn"),t.getSchemaRefs=y}),PTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;var e=FNc(),r=aSt(),n=iVi(),o=aSt(),s=UNc(),c=QNc(),l=qNc(),u=xs(),d=EV(),f=RTt(),h=uc(),m=wTt();function g(ee){if(R(ee)&&(P(ee),w(ee))){_(ee);return}A(ee,()=>(0,e.topBoolOrEmptySchema)(ee))}a(g,"jn"),t.validateFunctionCode=g;function A({gen:ee,validateName:K,schema:pe,schemaEnv:X,opts:ue},qe){ue.code.es5?ee.func(K,u._`${d.default.data}, ${d.default.valCxt}`,X.$async,()=>{ee.code(u._`"use strict"; ${b(pe,ue)}`),E(ee,ue),ee.code(qe)}):ee.func(K,u._`${d.default.data}, ${y(ue)}`,X.$async,()=>ee.code(b(pe,ue)).code(qe))}a(A,"mA");function y(ee){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${ee.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}a(y,"An");function E(ee,K){ee.if(d.default.valCxt,()=>{ee.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),ee.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),ee.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),ee.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{ee.var(d.default.instancePath,u._`""`),ee.var(d.default.parentData,u._`undefined`),ee.var(d.default.parentDataProperty,u._`undefined`),ee.var(d.default.rootData,d.default.data),K.dynamicRef&&ee.var(d.default.dynamicAnchors,u._`{}`)})}a(E,"In");function _(ee){let{schema:K,opts:pe,gen:X}=ee;A(ee,()=>{pe.$comment&&K.$comment&&M(ee),B(ee),X.let(d.default.vErrors,null),X.let(d.default.errors,0),pe.unevaluated&&v(ee),D(ee),O(ee)})}a(_,"Rn");function v(ee){let{gen:K,validateName:pe}=ee;ee.evaluated=K.const("evaluated",u._`${pe}.evaluated`),K.if(u._`${ee.evaluated}.dynamicProps`,()=>K.assign(u._`${ee.evaluated}.props`,u._`undefined`)),K.if(u._`${ee.evaluated}.dynamicItems`,()=>K.assign(u._`${ee.evaluated}.items`,u._`undefined`))}a(v,"Pn");function b(ee,K){let pe=typeof ee=="object"&&ee[K.schemaId];return pe&&(K.code.source||K.code.process)?u._`/*# sourceURL=${pe} */`:u.nil}a(b,"fA");function T(ee,K){if(R(ee)&&(P(ee),w(ee))){x(ee,K);return}(0,e.boolOrEmptySchema)(ee,K)}a(T,"En");function w({schema:ee,self:K}){if(typeof ee=="boolean")return!ee;for(let pe in ee)if(K.RULES.all[pe])return!0;return!1}a(w,"lA");function R(ee){return typeof ee.schema!="boolean"}a(R,"cA");function x(ee,K){let{schema:pe,gen:X,opts:ue}=ee;ue.$comment&&pe.$comment&&M(ee),L(ee),j(ee);let qe=X.const("_errs",d.default.errors);D(ee,qe),X.var(K,u._`${qe} === ${d.default.errors}`)}a(x,"bn");function P(ee){(0,h.checkUnknownRules)(ee),N(ee)}a(P,"pA");function D(ee,K){if(ee.opts.jtd)return Q(ee,[],!1,K);let pe=(0,r.getSchemaTypes)(ee.schema),X=(0,r.coerceAndCheckDataType)(ee,pe);Q(ee,pe,!X,K)}a(D,"dA");function N(ee){let{schema:K,errSchemaPath:pe,opts:X,self:ue}=ee;K.$ref&&X.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(K,ue.RULES)&&ue.logger.warn(`$ref: keywords ignored in schema at path "${pe}"`)}a(N,"_n");function B(ee){let{schema:K,opts:pe}=ee;K.default!==void 0&&pe.useDefaults&&pe.strictSchema&&(0,h.checkStrictMode)(ee,"default is ignored in the schema root")}a(B,"kn");function L(ee){let K=ee.schema[ee.opts.schemaId];K&&(ee.baseId=(0,f.resolveUrl)(ee.opts.uriResolver,ee.baseId,K))}a(L,"Sn");function j(ee){if(ee.schema.$async&&!ee.schemaEnv.$async)throw Error("async schema in sync schema")}a(j,"vn");function M({gen:ee,schemaEnv:K,schema:pe,errSchemaPath:X,opts:ue}){let qe=pe.$comment;if(ue.$comment===!0)ee.code(u._`${d.default.self}.logger.log(${qe})`);else if(typeof ue.$comment=="function"){let ie=u.str`${X}/$comment`,le=ee.scopeValue("root",{ref:K.root});ee.code(u._`${d.default.self}.opts.$comment(${qe}, ${ie}, ${le}.schema)`)}}a(M,"iA");function O(ee){let{gen:K,schemaEnv:pe,validateName:X,ValidationError:ue,opts:qe}=ee;pe.$async?K.if(u._`${d.default.errors} === 0`,()=>K.return(d.default.data),()=>K.throw(u._`new ${ue}(${d.default.vErrors})`)):(K.assign(u._`${X}.errors`,d.default.vErrors),qe.unevaluated&&q(ee),K.return(u._`${d.default.errors} === 0`))}a(O,"Cn");function q({gen:ee,evaluated:K,props:pe,items:X}){pe instanceof u.Name&&ee.assign(u._`${K}.props`,pe),X instanceof u.Name&&ee.assign(u._`${K}.items`,X)}a(q,"Tn");function Q(ee,K,pe,X){let{gen:ue,schema:qe,data:ie,allErrors:le,opts:Ne,self:we}=ee,{RULES:Be}=we;if(qe.$ref&&(Ne.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(qe,Be))){ue.block(()=>ve(ee,"$ref",Be.all.$ref.definition));return}Ne.jtd||z(ee,K),ue.block(()=>{for(let st of Be.rules)tt(st);tt(Be.post)});function tt(st){(0,n.shouldUseGroup)(qe,st)&&(st.type?(ue.if((0,o.checkDataType)(st.type,ie,Ne.strictNumbers)),U(ee,st),K.length===1&&K[0]===st.type&&pe&&(ue.else(),(0,o.reportTypeError)(ee)),ue.endIf()):U(ee,st),le||ue.if(u._`${d.default.errors} === ${X||0}`))}a(tt,"B")}a(Q,"gA");function U(ee,K){let{gen:pe,schema:X,opts:{useDefaults:ue}}=ee;ue&&(0,s.assignDefaults)(ee,K.type),pe.block(()=>{for(let qe of K.rules)(0,n.shouldUseRule)(X,qe)&&ve(ee,qe.keyword,qe.definition,K.type)})}a(U,"hA");function z(ee,K){ee.schemaEnv.meta||!ee.opts.strictTypes||(W(ee,K),!ee.opts.allowUnionTypes&&$(ee,K),J(ee,ee.dataTypes))}a(z,"xn");function W(ee,K){if(K.length){if(!ee.dataTypes.length){ee.dataTypes=K;return}K.forEach(pe=>{H(ee.dataTypes,pe)||ae(ee,`type "${pe}" not allowed by context "${ee.dataTypes.join(",")}"`)}),re(ee,K)}}a(W,"yn");function $(ee,K){K.length>1&&!(K.length===2&&K.includes("null"))&&ae(ee,"use allowUnionTypes to allow union type keyword")}a($,"fn");function J(ee,K){let pe=ee.self.RULES.all;for(let X in pe){let ue=pe[X];if(typeof ue=="object"&&(0,n.shouldUseRule)(ee.schema,ue)){let{type:qe}=ue.definition;qe.length&&!qe.some(ie=>ne(K,ie))&&ae(ee,`missing type "${qe.join(",")}" for keyword "${X}"`)}}}a(J,"gn");function ne(ee,K){return ee.includes(K)||K==="number"&&ee.includes("integer")}a(ne,"hn");function H(ee,K){return ee.includes(K)||K==="integer"&&ee.includes("number")}a(H,"nA");function re(ee,K){let pe=[];for(let X of ee.dataTypes)H(K,X)?pe.push(X):K.includes("integer")&&X==="number"&&pe.push("integer");ee.dataTypes=pe}a(re,"un");function ae(ee,K){let pe=ee.schemaEnv.baseId+ee.errSchemaPath;K+=` at "${pe}" (strictTypes)`,(0,h.checkStrictMode)(ee,K,ee.opts.strictTypes)}a(ae,"SB");class Oe{static{a(this,"vB")}constructor(K,pe,X){if((0,c.validateKeywordUsage)(K,pe,X),this.gen=K.gen,this.allErrors=K.allErrors,this.keyword=X,this.data=K.data,this.schema=K.schema[X],this.$data=pe.$data&&K.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(K,this.schema,X,this.$data),this.schemaType=pe.schemaType,this.parentSchema=K.schema,this.params={},this.it=K,this.def=pe,this.$data)this.schemaCode=K.gen.const("vSchema",Z(this.$data,K));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,pe.schemaType,pe.allowUndefined))throw Error(`${X} value must be ${JSON.stringify(pe.schemaType)}`);("code"in pe?pe.trackErrors:pe.errors!==!1)&&(this.errsCount=K.gen.const("_errs",d.default.errors))}result(K,pe,X){this.failResult((0,u.not)(K),pe,X)}failResult(K,pe,X){this.gen.if(K),X?X():this.error(),pe?(this.gen.else(),pe(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(K,pe){this.failResult((0,u.not)(K),void 0,pe)}fail(K){if(K===void 0){this.error(),!this.allErrors&&this.gen.if(!1);return}this.gen.if(K),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(K){if(!this.$data)return this.fail(K);let{schemaCode:pe}=this;this.fail(u._`${pe} !== undefined && (${(0,u.or)(this.invalid$data(),K)})`)}error(K,pe,X){if(pe){this.setParams(pe),this._error(K,X),this.setParams({});return}this._error(K,X)}_error(K,pe){(K?m.reportExtraError:m.reportError)(this,this.def.error,pe)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(K){this.allErrors||this.gen.if(K)}setParams(K,pe){pe?Object.assign(this.params,K):this.params=K}block$data(K,pe,X=u.nil){this.gen.block(()=>{this.check$data(K,X),pe()})}check$data(K=u.nil,pe=u.nil){if(!this.$data)return;let{gen:X,schemaCode:ue,schemaType:qe,def:ie}=this;X.if((0,u.or)(u._`${ue} === undefined`,pe)),K!==u.nil&&X.assign(K,!0),(qe.length||ie.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),K!==u.nil&&X.assign(K,!1)),X.else()}invalid$data(){let{gen:K,schemaCode:pe,schemaType:X,def:ue,it:qe}=this;return(0,u.or)(ie(),le());function ie(){if(X.length){if(!(pe instanceof u.Name))throw Error("ajv implementation error");let Ne=Array.isArray(X)?X:[X];return u._`${(0,o.checkDataTypes)(Ne,pe,qe.opts.strictNumbers,o.DataType.Wrong)}`}return u.nil}function le(){if(ue.validateSchema){let Ne=K.scopeValue("validate$data",{ref:ue.validateSchema});return u._`!${Ne}(${pe})`}return u.nil}}subschema(K,pe){let X=(0,l.getSubschema)(this.it,K);(0,l.extendSubschemaData)(X,this.it,K),(0,l.extendSubschemaMode)(X,K);let ue={...this.it,...X,items:void 0,props:void 0};return T(ue,pe),ue}mergeEvaluated(K,pe){let{it:X,gen:ue}=this;X.opts.unevaluated&&(X.props!==!0&&K.props!==void 0&&(X.props=h.mergeEvaluated.props(ue,K.props,X.props,pe)),X.items!==!0&&K.items!==void 0&&(X.items=h.mergeEvaluated.items(ue,K.items,X.items,pe)))}mergeValidEvaluated(K,pe){let{it:X,gen:ue}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return ue.if(pe,()=>this.mergeEvaluated(K,u.Name)),!0}}t.KeywordCxt=Oe;function ve(ee,K,pe,X){let ue=new Oe(ee,pe,K);"code"in pe?pe.code(ue,X):ue.$data&&pe.validate?(0,c.funcKeywordCode)(ue,pe):"macro"in pe?(0,c.macroKeywordCode)(ue,pe):(pe.compile||pe.validate)&&(0,c.funcKeywordCode)(ue,pe)}a(ve,"rA");var Fe=/^\/(?:[^~]|~0|~1)*$/,Pe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Z(ee,{dataLevel:K,dataNames:pe,dataPathArr:X}){let ue,qe;if(ee==="")return d.default.rootData;if(ee[0]==="/"){if(!Fe.test(ee))throw Error(`Invalid JSON-pointer: ${ee}`);ue=ee,qe=d.default.rootData}else{let we=Pe.exec(ee);if(!we)throw Error(`Invalid JSON-pointer: ${ee}`);let Be=+we[1];if(ue=we[2],ue==="#"){if(Be>=K)throw Error(Ne("property/index",Be));return X[K-Be]}if(Be>K)throw Error(Ne("data",Be));if(qe=pe[K-Be],!ue)return qe}let ie=qe,le=ue.split("/");for(let we of le)we&&(qe=u._`${qe}${(0,u.getProperty)((0,h.unescapeJsonPointer)(we))}`,ie=u._`${ie} && ${qe}`);return ie;function Ne(we,Be){return`Cannot access ${we} ${Be} levels up, current level is ${K}`}}a(Z,"oA"),t.getData=Z}),VLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});class e extends Error{static{a(this,"sA")}constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}t.default=e}),kTt=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=RTt();class r extends Error{static{a(this,"$I")}constructor(o,s,c,l){super(l||`can't resolve reference ${c} from id ${s}`),this.missingRef=(0,e.resolveUrl)(o,s,c),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}t.default=r}),WLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;var e=xs(),r=VLr(),n=EV(),o=RTt(),s=uc(),c=PTt();class l{static{a(this,"CJ")}constructor(v){var b;this.refs={},this.dynamicAnchors={};let T;typeof v.schema=="object"&&(T=v.schema),this.schema=v.schema,this.schemaId=v.schemaId,this.root=v.root||this,this.baseId=(b=v.baseId)!==null&&b!==void 0?b:(0,o.normalizeId)(T?.[v.schemaId||"$id"]),this.schemaPath=v.schemaPath,this.localRefs=v.localRefs,this.meta=v.meta,this.$async=T?.$async,this.refs={}}}t.SchemaEnv=l;function u(_){let v=h.call(this,_);if(v)return v;let b=(0,o.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:T,lines:w}=this.opts.code,{ownProperties:R}=this.opts,x=new e.CodeGen(this.scope,{es5:T,lines:w,ownProperties:R}),P;_.$async&&(P=x.scopeValue("Error",{ref:r.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));let D=x.scopeName("validate");_.validateName=D;let N={gen:x,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:x.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,e.stringify)(_.schema)}:{ref:_.schema}),validateName:D,ValidationError:P,schema:_.schema,schemaEnv:_,rootId:b,baseId:_.baseId||b,schemaPath:e.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this},B;try{this._compilations.add(_),(0,c.validateFunctionCode)(N),x.optimize(this.opts.code.optimize);let L=x.toString();B=`${x.scopeRefs(n.default.scope)}return ${L}`,this.opts.code.process&&(B=this.opts.code.process(B,_));let j=Function(`${n.default.self}`,`${n.default.scope}`,B)(this,this.scope.get());if(this.scope.value(D,{ref:j}),j.errors=null,j.schema=_.schema,j.schemaEnv=_,_.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:D,validateCode:L,scopeValues:x._values}),this.opts.unevaluated){let{props:M,items:O}=N;j.evaluated={props:M instanceof e.Name?void 0:M,items:O instanceof e.Name?void 0:O,dynamicProps:M instanceof e.Name,dynamicItems:O instanceof e.Name},j.source&&(j.source.evaluated=(0,e.stringify)(j.evaluated))}return _.validate=j,_}catch(L){throw delete _.validate,delete _.validateName,B&&this.logger.error("Error compiling schema, function code:",B),L}finally{this._compilations.delete(_)}}a(u,"xB"),t.compileSchema=u;function d(_,v,b){var T;b=(0,o.resolveUrl)(this.opts.uriResolver,v,b);let w=_.refs[b];if(w)return w;let R=g.call(this,_,b);if(R===void 0){let x=(T=_.localRefs)===null||T===void 0?void 0:T[b],{schemaId:P}=this.opts;x&&(R=new l({schema:x,schemaId:P,root:_,baseId:v}))}if(R!==void 0)return _.refs[b]=f.call(this,R)}a(d,"tn"),t.resolveRef=d;function f(_){return(0,o.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:u.call(this,_)}a(f,"an");function h(_){for(let v of this._compilations)if(m(v,_))return v}a(h,"XI"),t.getCompilingSchema=h;function m(_,v){return _.schema===v.schema&&_.root===v.root&&_.baseId===v.baseId}a(m,"sn");function g(_,v){let b;for(;typeof(b=this.refs[v])=="string";)v=b;return b||this.schemas[v]||A.call(this,_,v)}a(g,"en");function A(_,v){let b=this.opts.uriResolver.parse(v),T=(0,o._getFullPath)(this.opts.uriResolver,b),w=(0,o.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&T===w)return E.call(this,b,_);let R=(0,o.normalizeId)(T),x=this.refs[R]||this.schemas[R];if(typeof x=="string"){let P=A.call(this,_,x);return typeof P?.schema!="object"?void 0:E.call(this,b,P)}if(typeof x?.schema=="object"){if(x.validate||u.call(this,x),R===(0,o.normalizeId)(v)){let{schema:P}=x,{schemaId:D}=this.opts,N=P[D];return N&&(w=(0,o.resolveUrl)(this.opts.uriResolver,w,N)),new l({schema:P,schemaId:D,root:_,baseId:w})}return E.call(this,b,x)}}a(A,"EW"),t.resolveSchema=A;var y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(_,{baseId:v,schema:b,root:T}){var w;if(((w=_.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(let P of _.fragment.slice(1).split("/")){if(typeof b=="boolean")return;let D=b[(0,s.unescapeFragment)(P)];if(D===void 0)return;b=D;let N=typeof b=="object"&&b[this.opts.schemaId];!y.has(P)&&N&&(v=(0,o.resolveUrl)(this.opts.uriResolver,v,N))}let R;if(typeof b!="boolean"&&b.$ref&&!(0,s.schemaHasRulesButRef)(b,this.RULES)){let P=(0,o.resolveUrl)(this.opts.uriResolver,v,b.$ref);R=A.call(this,T,P)}let{schemaId:x}=this.opts;if(R=R||new l({schema:b,schemaId:x,root:T,baseId:v}),R.schema!==R.root.schema)return R}a(E,"TB")}),HNc=qt((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),sVi=qt((t,e)=>{var r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),o=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),c=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function l(x){let P="",D=0,N=0;for(N=0;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N];break}for(N+=1;N=48&&D<=57||D>=65&&D<=70||D>=97&&D<=102))return"";P+=x[N]}return P}a(l,"fB");var u=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(x){return x.length=0,!0}a(d,"UI");function f(x,P,D){if(x.length){let N=l(x);if(N!=="")P.push(N);else return D.error=!0,!1;x.length=0}return!0}a(f,"Kr");function h(x){let P=0,D={error:!1,address:"",zone:""},N=[],B=[],L=!1,j=!1,M=f;for(let O=0;O7){D.error=!0;break}O>0&&x[O-1]===":"&&(L=!0),N.push(":");continue}else if(q==="%"){if(!M(B,N,D))break;M=d}else{B.push(q);continue}}return B.length&&(M===d?D.zone=B.join(""):j?N.push(B.join("")):N.push(l(B))),D.address=N.join(""),D}a(h,"qr");function m(x){if(g(x,":")<2)return{host:x,isIPV6:!1};let P=h(x);if(P.error)return{host:x,isIPV6:!1};{let{address:D,address:N}=P;return P.zone&&(D+="%"+P.zone,N+="%25"+P.zone),{host:D,isIPV6:!0,escapedHost:N}}}a(m,"qI");function g(x,P){let D=0;for(let N=0;Ny[N])}a(v,"VI");function b(x,P=!1){if(x.indexOf("%")===-1)return x;let D="";for(let N=0;N{var{isUUID:r}=sVi(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(x){return o.indexOf(x)!==-1}a(s,"Ar");function c(x){return x.secure===!0?!0:x.secure===!1?!1:x.scheme?x.scheme.length===3&&(x.scheme[0]==="w"||x.scheme[0]==="W")&&(x.scheme[1]==="s"||x.scheme[1]==="S")&&(x.scheme[2]==="s"||x.scheme[2]==="S"):!1}a(c,"hB");function l(x){return x.host||(x.error=x.error||"HTTP URIs must have a host."),x}a(l,"zI");function u(x){let P=String(x.scheme).toLowerCase()==="https";return(x.port===(P?443:80)||x.port==="")&&(x.port=void 0),x.path||(x.path="/"),x}a(u,"NI");function d(x){return x.secure=c(x),x.resourceName=(x.path||"/")+(x.query?"?"+x.query:""),x.path=void 0,x.query=void 0,x}a(d,"Ir");function f(x){if((x.port===(c(x)?443:80)||x.port==="")&&(x.port=void 0),typeof x.secure=="boolean"&&(x.scheme=x.secure?"wss":"ws",x.secure=void 0),x.resourceName){let[P,D]=x.resourceName.split("?");x.path=P&&P!=="/"?P:void 0,x.query=D,x.resourceName=void 0}return x.fragment=void 0,x}a(f,"Rr");function h(x,P){if(!x.path)return x.error="URN can not be parsed",x;let D=x.path.match(n);if(D){let N=P.scheme||x.scheme||"urn";x.nid=D[1].toLowerCase(),x.nss=D[2];let B=`${N}:${P.nid||x.nid}`,L=R(B);x.path=void 0,L&&(x=L.parse(x,P))}else x.error=x.error||"URN can not be parsed.";return x}a(h,"Pr");function m(x,P){if(x.nid===void 0)throw Error("URN without nid cannot be serialized");let D=P.scheme||x.scheme||"urn",N=x.nid.toLowerCase(),B=`${D}:${P.nid||N}`,L=R(B);L&&(x=L.serialize(x,P));let j=x,M=x.nss;return j.path=`${N||P.nid}:${M}`,P.skipEscape=!0,j}a(m,"Er");function g(x,P){let D=x;return D.uuid=D.nss,D.nss=void 0,!P.tolerant&&(!D.uuid||!r(D.uuid))&&(D.error=D.error||"UUID is not valid."),D}a(g,"br");function A(x){let P=x;return P.nss=(x.uuid||"").toLowerCase(),P}a(A,"_r");var y={scheme:"http",domainHost:!0,parse:l,serialize:u},E={scheme:"https",domainHost:y.domainHost,parse:l,serialize:u},_={scheme:"ws",domainHost:!0,parse:d,serialize:f},v={scheme:"wss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},b={scheme:"urn",parse:h,serialize:m,skipNormalize:!0},T={scheme:"urn:uuid",parse:g,serialize:A,skipNormalize:!0},w={http:y,https:E,ws:_,wss:v,urn:b,"urn:uuid":T};Object.setPrototypeOf(w,null);function R(x){return x&&(w[x]||w[x.toLowerCase()])||void 0}a(R,"uB"),e.exports={wsIsSecure:c,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:R}}),$Nc=qt((t,e)=>{var{normalizeIPv6:r,removeDotSegments:n,recomposeAuthority:o,normalizePercentEncoding:s,normalizePathEncoding:c,escapePreservingEscapes:l,reescapeHostDelimiters:u,isIPv4:d,nonSimpleDomain:f}=sVi(),{SCHEMES:h,getSchemeHandler:m}=GNc();function g(N,B){return typeof N=="string"?N=R(N,B):typeof N=="object"&&(N=w(_(N,B),B)),N}a(g,"cr");function A(N,B,L){let j=L?Object.assign({scheme:"null"},L):{scheme:"null"},M=y(w(N,j),w(B,j),j,!0);return j.skipEscape=!0,_(M,j)}a(A,"pr");function y(N,B,L,j){let M={};return j||(N=w(_(N,L),L),B=w(_(B,L),L)),L=L||{},!L.tolerant&&B.scheme?(M.scheme=B.scheme,M.userinfo=B.userinfo,M.host=B.host,M.port=B.port,M.path=n(B.path||""),M.query=B.query):(B.userinfo!==void 0||B.host!==void 0||B.port!==void 0?(M.userinfo=B.userinfo,M.host=B.host,M.port=B.port,M.path=n(B.path||""),M.query=B.query):(B.path?(B.path[0]==="/"?M.path=n(B.path):((N.userinfo!==void 0||N.host!==void 0||N.port!==void 0)&&!N.path?M.path="/"+B.path:N.path?M.path=N.path.slice(0,N.path.lastIndexOf("/")+1)+B.path:M.path=B.path,M.path=n(M.path)),M.query=B.query):(M.path=N.path,B.query!==void 0?M.query=B.query:M.query=N.query),M.userinfo=N.userinfo,M.host=N.host,M.port=N.port),M.scheme=N.scheme),M.fragment=B.fragment,M}a(y,"MI");function E(N,B,L){let j=P(N,L),M=P(B,L);return j!==void 0&&M!==void 0&&j.toLowerCase()===M.toLowerCase()}a(E,"dr");function _(N,B){let L={host:N.host,scheme:N.scheme,userinfo:N.userinfo,port:N.port,path:N.path,query:N.query,nid:N.nid,nss:N.nss,uuid:N.uuid,fragment:N.fragment,reference:N.reference,resourceName:N.resourceName,secure:N.secure,error:""},j=Object.assign({},B),M=[],O=m(j.scheme||L.scheme);O&&O.serialize&&O.serialize(L,j),L.path!==void 0&&(j.skipEscape?L.path=s(L.path):(L.path=l(L.path),L.scheme!==void 0&&(L.path=L.path.split("%3A").join(":")))),j.reference!=="suffix"&&L.scheme&&M.push(L.scheme,":");let q=o(L);if(q!==void 0&&(j.reference!=="suffix"&&M.push("//"),M.push(q),L.path&&L.path[0]!=="/"&&M.push("/")),L.path!==void 0){let Q=L.path;!j.absolutePath&&(!O||!O.absolutePath)&&(Q=n(Q)),q===void 0&&Q[0]==="/"&&Q[1]==="/"&&(Q="/%2F"+Q.slice(2)),M.push(Q)}return L.query!==void 0&&M.push("?",L.query),L.fragment!==void 0&&M.push("#",L.fragment),M.join("")}a(_,"y0");var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(N,B){if(B[2]!==void 0&&N.path&&N.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof N.port=="number"&&(N.port<0||N.port>65535))return"URI port is malformed."}a(b,"nr");function T(N,B){let L=Object.assign({},B),j={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},M=!1,O=!1;L.reference==="suffix"&&(L.scheme?N=L.scheme+":"+N:N="//"+N);let q=N.match(v);if(q){j.scheme=q[1],j.userinfo=q[3],j.host=q[4],j.port=parseInt(q[5],10),j.path=q[6]||"",j.query=q[7],j.fragment=q[8],isNaN(j.port)&&(j.port=q[5]);let Q=b(j,q);if(Q!==void 0&&(j.error=j.error||Q,M=!0),j.host)if(d(j.host)===!1){let z=r(j.host);j.host=z.host.toLowerCase(),O=z.isIPV6}else O=!0;j.scheme===void 0&&j.userinfo===void 0&&j.host===void 0&&j.port===void 0&&j.query===void 0&&!j.path?j.reference="same-document":j.scheme===void 0?j.reference="relative":j.fragment===void 0?j.reference="absolute":j.reference="uri",L.reference&&L.reference!=="suffix"&&L.reference!==j.reference&&(j.error=j.error||"URI is not a "+L.reference+" reference.");let U=m(L.scheme||j.scheme);if(!L.unicodeSupport&&(!U||!U.unicodeSupport)&&j.host&&(L.domainHost||U&&U.domainHost)&&O===!1&&f(j.host))try{j.host=URL.domainToASCII(j.host.toLowerCase())}catch(z){j.error=j.error||"Host's domain name can not be converted to ASCII: "+z}if((!U||U&&!U.skipNormalize)&&(N.indexOf("%")!==-1&&(j.scheme!==void 0&&(j.scheme=unescape(j.scheme)),j.host!==void 0&&(j.host=u(unescape(j.host),O))),j.path&&(j.path=c(j.path)),j.fragment))try{j.fragment=encodeURI(decodeURIComponent(j.fragment))}catch{j.error=j.error||"URI malformed"}U&&U.parse&&U.parse(j,L)}else j.error=j.error||"URI can not be parsed.";return{parsed:j,malformedAuthorityOrPort:M}}a(T,"LI");function w(N,B){return T(N,B).parsed}a(w,"w9");function R(N,B){return x(N,B).normalized}a(R,"rr");function x(N,B){let{parsed:L,malformedAuthorityOrPort:j}=T(N,B);return{normalized:j?N:_(L,B),malformedAuthorityOrPort:j}}a(x,"jI");function P(N,B){if(typeof N=="string"){let{normalized:L,malformedAuthorityOrPort:j}=x(N,B);return j?void 0:L}if(typeof N=="object")return _(N,B)}a(P,"FI");var D={SCHEMES:h,normalize:g,resolve:A,resolveComponent:y,equal:E,serialize:_,parse:w};e.exports=D,e.exports.default=D,e.exports.fastUri=D}),VNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=$Nc();e.code='require("ajv/dist/runtime/uri").default',t.default=e}),WNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=PTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return e.KeywordCxt},"get")});var r=xs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return r._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return r.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return r.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return r.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return r.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return r.CodeGen},"get")});var n=VLr(),o=kTt(),s=nVi(),c=WLr(),l=xs(),u=RTt(),d=aSt(),f=uc(),h=HNc(),m=VNc(),g=a((W,$)=>new RegExp(W,$),"vI");g.code="new RegExp";var A=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),E={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(W){var $,J,ne,H,re,ae,Oe,ve,Fe,Pe,Z,ee,K,pe,X,ue,qe,ie,le,Ne,we,Be,tt,st,Et;let kt=W.strict,Gt=($=W.code)===null||$===void 0?void 0:$.optimize,jt=Gt===!0||Gt===void 0?1:Gt||0,Ie=(ne=(J=W.code)===null||J===void 0?void 0:J.regExp)!==null&&ne!==void 0?ne:g,F=(H=W.uriResolver)!==null&&H!==void 0?H:m.default;return{strictSchema:(ae=(re=W.strictSchema)!==null&&re!==void 0?re:kt)!==null&&ae!==void 0?ae:!0,strictNumbers:(ve=(Oe=W.strictNumbers)!==null&&Oe!==void 0?Oe:kt)!==null&&ve!==void 0?ve:!0,strictTypes:(Pe=(Fe=W.strictTypes)!==null&&Fe!==void 0?Fe:kt)!==null&&Pe!==void 0?Pe:"log",strictTuples:(ee=(Z=W.strictTuples)!==null&&Z!==void 0?Z:kt)!==null&&ee!==void 0?ee:"log",strictRequired:(pe=(K=W.strictRequired)!==null&&K!==void 0?K:kt)!==null&&pe!==void 0?pe:!1,code:W.code?{...W.code,optimize:jt,regExp:Ie}:{optimize:jt,regExp:Ie},loopRequired:(X=W.loopRequired)!==null&&X!==void 0?X:v,loopEnum:(ue=W.loopEnum)!==null&&ue!==void 0?ue:v,meta:(qe=W.meta)!==null&&qe!==void 0?qe:!0,messages:(ie=W.messages)!==null&&ie!==void 0?ie:!0,inlineRefs:(le=W.inlineRefs)!==null&&le!==void 0?le:!0,schemaId:(Ne=W.schemaId)!==null&&Ne!==void 0?Ne:"$id",addUsedSchema:(we=W.addUsedSchema)!==null&&we!==void 0?we:!0,validateSchema:(Be=W.validateSchema)!==null&&Be!==void 0?Be:!0,validateFormats:(tt=W.validateFormats)!==null&&tt!==void 0?tt:!0,unicodeRegExp:(st=W.unicodeRegExp)!==null&&st!==void 0?st:!0,int32range:(Et=W.int32range)!==null&&Et!==void 0?Et:!0,uriResolver:F}}a(b,"Wo");class T{static{a(this,"CW")}constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...b($)};let{es5:J,lines:ne}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:J,lines:ne}),this.logger=L($.logger);let H=$.validateFormats;$.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,E,$,"NOT SUPPORTED"),w.call(this,_,$,"DEPRECATED","warn"),this._metaOpts=N.call(this),$.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&D.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),x.call(this),$.validateFormats=H}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:J,schemaId:ne}=this.opts,H=h;ne==="id"&&(H={...h},H.id=H.$id,delete H.$id),J&&$&&this.addMetaSchema(H,H[ne],!1)}defaultMeta(){let{meta:$,schemaId:J}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[J]||$:void 0}validate($,J){let ne;if(typeof $=="string"){if(ne=this.getSchema($),!ne)throw Error(`no schema with key or ref "${$}"`)}else ne=this.compile($);let H=ne(J);return"$async"in ne||(this.errors=ne.errors),H}compile($,J){let ne=this._addSchema($,J);return ne.validate||this._compileSchemaEnv(ne)}compileAsync($,J){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:ne}=this.opts;return H.call(this,$,J);async function H(Pe,Z){await re.call(this,Pe.$schema);let ee=this._addSchema(Pe,Z);return ee.validate||ae.call(this,ee)}async function re(Pe){Pe&&!this.getSchema(Pe)&&await H.call(this,{$ref:Pe},!0)}async function ae(Pe){try{return this._compileSchemaEnv(Pe)}catch(Z){if(!(Z instanceof o.default))throw Z;return Oe.call(this,Z),await ve.call(this,Z.missingSchema),ae.call(this,Pe)}}function Oe({missingSchema:Pe,missingRef:Z}){if(this.refs[Pe])throw Error(`AnySchema ${Pe} is loaded but ${Z} cannot be resolved`)}async function ve(Pe){let Z=await Fe.call(this,Pe);this.refs[Pe]||await re.call(this,Z.$schema),this.refs[Pe]||this.addSchema(Z,Pe,J)}async function Fe(Pe){let Z=this._loading[Pe];if(Z)return Z;try{return await(this._loading[Pe]=ne(Pe))}finally{delete this._loading[Pe]}}}addSchema($,J,ne,H=this.opts.validateSchema){if(Array.isArray($)){for(let ae of $)this.addSchema(ae,void 0,ne,H);return this}let re;if(typeof $=="object"){let{schemaId:ae}=this.opts;if(re=$[ae],re!==void 0&&typeof re!="string")throw Error(`schema ${ae} must be string`)}return J=(0,u.normalizeId)(J||re),this._checkUnique(J),this.schemas[J]=this._addSchema($,ne,J,H,!0),this}addMetaSchema($,J,ne=this.opts.validateSchema){return this.addSchema($,J,!0,ne),this}validateSchema($,J){if(typeof $=="boolean")return!0;let ne;if(ne=$.$schema,ne!==void 0&&typeof ne!="string")throw Error("$schema must be a string");if(ne=ne||this.opts.defaultMeta||this.defaultMeta(),!ne)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let H=this.validate(ne,$);if(!H&&J){let re="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(re);else throw Error(re)}return H}getSchema($){let J;for(;typeof(J=R.call(this,$))=="string";)$=J;if(J===void 0){let{schemaId:ne}=this.opts,H=new c.SchemaEnv({schema:{},schemaId:ne});if(J=c.resolveSchema.call(this,H,$),!J)return;this.refs[$]=J}return J.validate||this._compileSchemaEnv(J)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let J=R.call(this,$);return typeof J=="object"&&this._cache.delete(J.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{let J=$;this._cache.delete(J);let ne=$[this.opts.schemaId];return ne&&(ne=(0,u.normalizeId)(ne),delete this.schemas[ne],delete this.refs[ne]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let J of $)this.addKeyword(J);return this}addKeyword($,J){let ne;if(typeof $=="string")ne=$,typeof J=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),J.keyword=ne);else if(typeof $=="object"&&J===void 0){if(J=$,ne=J.keyword,Array.isArray(ne)&&!ne.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(M.call(this,ne,J),!J)return(0,f.eachItem)(ne,re=>O.call(this,re)),this;Q.call(this,J);let H={...J,type:(0,d.getJSONTypes)(J.type),schemaType:(0,d.getJSONTypes)(J.schemaType)};return(0,f.eachItem)(ne,H.type.length===0?re=>O.call(this,re,H):re=>H.type.forEach(ae=>O.call(this,re,H,ae))),this}getKeyword($){let J=this.RULES.all[$];return typeof J=="object"?J.definition:!!J}removeKeyword($){let{RULES:J}=this;delete J.keywords[$],delete J.all[$];for(let ne of J.rules){let H=ne.rules.findIndex(re=>re.keyword===$);H>=0&&ne.rules.splice(H,1)}return this}addFormat($,J){return typeof J=="string"&&(J=new RegExp(J)),this.formats[$]=J,this}errorsText($=this.errors,{separator:J=", ",dataVar:ne="data"}={}){return!$||$.length===0?"No errors":$.map(H=>`${ne}${H.instancePath} ${H.message}`).reduce((H,re)=>H+J+re)}$dataMetaSchema($,J){let ne=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let H of J){let re=H.split("/").slice(1),ae=$;for(let Oe of re)ae=ae[Oe];for(let Oe in ne){let ve=ne[Oe];if(typeof ve!="object")continue;let{$data:Fe}=ve.definition,Pe=ae[Oe];Fe&&Pe&&(ae[Oe]=z(Pe))}}return $}_removeAllSchemas($,J){for(let ne in $){let H=$[ne];(!J||J.test(ne))&&(typeof H=="string"?delete $[ne]:H&&!H.meta&&(this._cache.delete(H.schema),delete $[ne]))}}_addSchema($,J,ne,H=this.opts.validateSchema,re=this.opts.addUsedSchema){let ae,{schemaId:Oe}=this.opts;if(typeof $=="object")ae=$[Oe];else{if(this.opts.jtd)throw Error("schema must be object");if(typeof $!="boolean")throw Error("schema must be object or boolean")}let ve=this._cache.get($);if(ve!==void 0)return ve;ne=(0,u.normalizeId)(ae||ne);let Fe=u.getSchemaRefs.call(this,$,ne);return ve=new c.SchemaEnv({schema:$,schemaId:Oe,meta:J,baseId:ne,localRefs:Fe}),this._cache.set(ve.schema,ve),re&&!ne.startsWith("#")&&(ne&&this._checkUnique(ne),this.refs[ne]=ve),H&&this.validateSchema($,!0),ve}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):c.compileSchema.call(this,$),!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let J=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,$)}finally{this.opts=J}}}T.ValidationError=n.default,T.MissingRefError=o.default,t.default=T;function w(W,$,J,ne="error"){for(let H in W){let re=H;re in $&&this.logger[ne](`${J}: option ${H}. ${W[re]}`)}}a(w,"_I");function R(W){return W=(0,u.normalizeId)(W),this.schemas[W]||this.refs[W]}a(R,"kI");function x(){let W=this.opts.schemas;if(W)if(Array.isArray(W))this.addSchema(W);else for(let $ in W)this.addSchema(W[$],$)}a(x,"Go");function P(){for(let W in this.opts.formats){let $=this.opts.formats[W];$&&this.addFormat(W,$)}}a(P,"Uo");function D(W){if(Array.isArray(W)){this.addVocabulary(W);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let $ in W){let J=W[$];J.keyword||(J.keyword=$),this.addKeyword(J)}}a(D,"Ho");function N(){let W={...this.opts};for(let $ of A)delete W[$];return W}a(N,"Ko");var B={log(){},warn(){},error(){}};function L(W){if(W===!1)return B;if(W===void 0)return console;if(W.log&&W.warn&&W.error)return W;throw Error("logger must implement log, warn and error methods")}a(L,"Vo");var j=/^[a-z_$][a-z0-9_$:-]*$/i;function M(W,$){let{RULES:J}=this;if((0,f.eachItem)(W,ne=>{if(J.keywords[ne])throw Error(`Keyword ${ne} is already defined`);if(!j.test(ne))throw Error(`Keyword ${ne} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw Error('$data keyword must have "code" or "validate" function')}a(M,"zo");function O(W,$,J){var ne;let H=$?.post;if(J&&H)throw Error('keyword with "post" flag cannot have "type"');let{RULES:re}=this,ae=H?re.post:re.rules.find(({type:ve})=>ve===J);if(ae||(ae={type:J,rules:[]},re.rules.push(ae)),re.keywords[W]=!0,!$)return;let Oe={keyword:W,definition:{...$,type:(0,d.getJSONTypes)($.type),schemaType:(0,d.getJSONTypes)($.schemaType)}};$.before?q.call(this,ae,Oe,$.before):ae.rules.push(Oe),re.all[W]=Oe,(ne=$.implements)===null||ne===void 0||ne.forEach(ve=>this.addKeyword(ve))}a(O,"lB");function q(W,$,J){let ne=W.rules.findIndex(H=>H.keyword===J);ne>=0?W.rules.splice(ne,0,$):(W.rules.push($),this.logger.warn(`rule ${J} is not defined`))}a(q,"No");function Q(W){let{metaSchema:$}=W;$!==void 0&&(W.$data&&this.opts.$data&&($=z($)),W.validateSchema=this.compile($,!0))}a(Q,"wo");var U={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function z(W){return{anyOf:[W,U]}}a(z,"CI")}),zNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e}),YNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;var e=kTt(),r=uN(),n=xs(),o=EV(),s=WLr(),c=uc(),l={keyword:"$ref",schemaType:"string",code(f){let{gen:h,schema:m,it:g}=f,{baseId:A,schemaEnv:y,validateName:E,opts:_,self:v}=g,{root:b}=y;if((m==="#"||m==="#/")&&A===b.baseId)return w();let T=s.resolveRef.call(v,b,A,m);if(T===void 0)throw new e.default(g.opts.uriResolver,A,m);if(T instanceof s.SchemaEnv)return R(T);return x(T);function w(){if(y===b)return d(f,E,y,y.$async);let P=h.scopeValue("root",{ref:b});return d(f,n._`${P}.validate`,b,b.$async)}function R(P){let D=u(f,P);d(f,D,P,P.$async)}function x(P){let D=h.scopeValue("schema",_.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),N=h.name("valid"),B=f.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:D,errSchemaPath:m},N);f.mergeEvaluated(B),f.ok(N)}}};function u(f,h){let{gen:m}=f;return h.validate?m.scopeValue("validate",{ref:h.validate}):n._`${m.scopeValue("wrapper",{ref:h})}.validate`}a(u,"hI"),t.getValidate=u;function d(f,h,m,g){let{gen:A,it:y}=f,{allErrors:E,schemaEnv:_,opts:v}=y,b=v.passContext?o.default.this:n.nil;g?T():w();function T(){if(!_.$async)throw Error("async schema referenced by sync schema");let P=A.let("valid");A.try(()=>{A.code(n._`await ${(0,r.callValidateCode)(f,h,b)}`),x(h),!E&&A.assign(P,!0)},D=>{A.if(n._`!(${D} instanceof ${y.ValidationError})`,()=>A.throw(D)),R(D),!E&&A.assign(P,!1)}),f.ok(P)}a(T,"V");function w(){f.result((0,r.callValidateCode)(f,h,b),()=>x(h),()=>R(h))}a(w,"B");function R(P){let D=n._`${P}.errors`;A.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${D} : ${o.default.vErrors}.concat(${D})`),A.assign(o.default.errors,n._`${o.default.vErrors}.length`)}a(R,"z");function x(P){var D;if(!y.opts.unevaluated)return;let N=(D=m?.validate)===null||D===void 0?void 0:D.evaluated;if(y.props!==!0)if(N&&!N.dynamicProps)N.props!==void 0&&(y.props=c.mergeEvaluated.props(A,N.props,y.props));else{let B=A.var("props",n._`${P}.evaluated.props`);y.props=c.mergeEvaluated.props(A,B,y.props,n.Name)}if(y.items!==!0)if(N&&!N.dynamicItems)N.items!==void 0&&(y.items=c.mergeEvaluated.items(A,N.items,y.items));else{let B=A.var("items",n._`${P}.evaluated.items`);y.items=c.mergeEvaluated.items(A,B,y.items,n.Name)}}a(x,"N")}a(d,"xW"),t.callRef=d,t.default=l}),KNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=zNc(),r=YNc(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=n}),JNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=e.operators,n={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},o={message:a(({keyword:c,schemaCode:l})=>e.str`must be ${n[c].okStr} ${l}`,"message"),params:a(({keyword:c,schemaCode:l})=>e._`{comparison: ${n[c].okStr}, limit: ${l}}`,"params")},s={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d}=c;c.fail$data(e._`${u} ${n[l].fail} ${d} || isNaN(${u})`)}};t.default=s}),ZNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r={message:a(({schemaCode:o})=>e.str`must be multiple of ${o}`,"message"),params:a(({schemaCode:o})=>e._`{multipleOf: ${o}}`,"params")},n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:r,code(o){let{gen:s,data:c,schemaCode:l,it:u}=o,d=u.opts.multipleOfPrecision,f=s.let("res"),h=d?e._`Math.abs(Math.round(${f}) - ${f}) > 1e-${d}`:e._`${f} !== parseInt(${f})`;o.fail$data(e._`(${l} === 0 || (${f} = ${c}/${l}, ${h}))`)}};t.default=n}),XNc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});function e(r){let n=r.length,o=0,s=0,c;for(;s=55296&&c<=56319&&s{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n=XNc(),o={message({keyword:c,schemaCode:l}){let u=c==="maxLength"?"more":"fewer";return e.str`must NOT have ${u} than ${l} characters`},params:a(({schemaCode:c})=>e._`{limit: ${c}}`,"params")},s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(c){let{keyword:l,data:u,schemaCode:d,it:f}=c,h=l==="maxLength"?e.operators.GT:e.operators.LT,m=f.opts.unicode===!1?e._`${u}.length`:e._`${(0,r.useFunc)(c.gen,n.default)}(${u})`;c.fail$data(e._`${m} ${h} ${d}`)}};t.default=s}),tMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uN(),r=uc(),n=xs(),o={message:a(({schemaCode:c})=>n.str`must match pattern "${c}"`,"message"),params:a(({schemaCode:c})=>n._`{pattern: ${c}}`,"params")},s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c,g=m.opts.unicodeRegExp?"u":"";if(d){let{regExp:A}=m.opts.code,y=A.code==="new RegExp"?n._`new RegExp`:(0,r.useFunc)(l,A),E=l.let("valid");l.try(()=>l.assign(E,n._`${y}(${h}, ${g}).test(${u})`),()=>l.assign(E,!1)),c.fail$data(n._`!${E}`)}else{let A=(0,e.usePattern)(c,f);c.fail$data(n._`!${A}.test(${u})`)}}};t.default=s}),rMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxProperties"?"more":"fewer";return e.str`must NOT have ${c} than ${s} properties`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data(e._`Object.keys(${c}).length ${u} ${l}`)}};t.default=n}),nMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uN(),r=xs(),n=uc(),o={message:a(({params:{missingProperty:c}})=>r.str`must have required property '${c}'`,"message"),params:a(({params:{missingProperty:c}})=>r._`{missingProperty: ${c}}`,"params")},s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,schema:u,schemaCode:d,data:f,$data:h,it:m}=c,{opts:g}=m;if(!h&&u.length===0)return;let A=u.length>=g.loopRequired;if(m.allErrors?y():E(),g.strictRequired){let b=c.parentSchema.properties,{definedProperties:T}=c.it;for(let w of u)if(b?.[w]===void 0&&!T.has(w)){let R=m.schemaEnv.baseId+m.errSchemaPath,x=`required property "${w}" is not defined at "${R}" (strictRequired)`;(0,n.checkStrictMode)(m,x,m.opts.strictRequired)}}function y(){if(A||h)c.block$data(r.nil,_);else for(let b of u)(0,e.checkReportMissingProp)(c,b)}a(y,"q");function E(){let b=l.let("missing");if(A||h){let T=l.let("valid",!0);c.block$data(T,()=>v(b,T)),c.ok(T)}else l.if((0,e.checkMissingProp)(c,u,b)),(0,e.reportMissingProp)(c,b),l.else()}a(E,"V");function _(){l.forOf("prop",d,b=>{c.setParams({missingProperty:b}),l.if((0,e.noPropertyInData)(l,f,b,g.ownProperties),()=>c.error())})}a(_,"B");function v(b,T){c.setParams({missingProperty:b}),l.forOf(b,d,()=>{l.assign(T,(0,e.propertyInData)(l,f,b,g.ownProperties)),l.if((0,r.not)(T),()=>{c.error(),l.break()})},r.nil)}a(v,"z")}};t.default=s}),iMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r={message({keyword:o,schemaCode:s}){let c=o==="maxItems"?"more":"fewer";return e.str`must NOT have ${c} than ${s} items`},params:a(({schemaCode:o})=>e._`{limit: ${o}}`,"params")},n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:r,code(o){let{keyword:s,data:c,schemaCode:l}=o,u=s==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data(e._`${c}.length ${u} ${l}`)}};t.default=n}),zLr=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=oVi();e.code='require("ajv/dist/runtime/equal").default',t.default=e}),oMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=aSt(),r=xs(),n=uc(),o=zLr(),s={message:a(({params:{i:l,j:u}})=>r.str`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,"message"),params:a(({params:{i:l,j:u}})=>r._`{i: ${l}, j: ${u}}`,"params")},c={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:s,code(l){let{gen:u,data:d,$data:f,schema:h,parentSchema:m,schemaCode:g,it:A}=l;if(!f&&!h)return;let y=u.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(y,_,r._`${g} === false`),l.ok(y);function _(){let w=u.let("i",r._`${d}.length`),R=u.let("j");l.setParams({i:w,j:R}),u.assign(y,!0),u.if(r._`${w} > 1`,()=>(v()?b:T)(w,R))}a(_,"V");function v(){return E.length>0&&!E.some(w=>w==="object"||w==="array")}a(v,"B");function b(w,R){let x=u.name("item"),P=(0,e.checkDataTypes)(E,x,A.opts.strictNumbers,e.DataType.Wrong),D=u.const("indices",r._`{}`);u.for(r._`;${w}--;`,()=>{u.let(x,r._`${d}[${w}]`),u.if(P,r._`continue`),E.length>1&&u.if(r._`typeof ${x} == "string"`,r._`${x} += "_"`),u.if(r._`typeof ${D}[${x}] == "number"`,()=>{u.assign(R,r._`${D}[${x}]`),l.error(),u.assign(y,!1).break()}).code(r._`${D}[${x}] = ${w}`)})}a(b,"z");function T(w,R){let x=(0,n.useFunc)(u,o.default),P=u.name("outer");u.label(P).for(r._`;${w}--;`,()=>u.for(r._`${R} = ${w}; ${R}--;`,()=>u.if(r._`${x}(${d}[${w}], ${d}[${R}])`,()=>{l.error(),u.assign(y,!1).break(P)})))}a(T,"N")}};t.default=c}),sMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n=zLr(),o={message:"must be equal to constant",params:a(({schemaCode:c})=>e._`{allowedValue: ${c}}`,"params")},s={keyword:"const",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schemaCode:f,schema:h}=c;d||h&&typeof h=="object"?c.fail$data(e._`!${(0,r.useFunc)(l,n.default)}(${u}, ${f})`):c.fail(e._`${h} !== ${u}`)}};t.default=s}),aMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n=zLr(),o={message:"must be equal to one of the allowed values",params:a(({schemaCode:c})=>e._`{allowedValues: ${c}}`,"params")},s={keyword:"enum",schemaType:"array",$data:!0,error:o,code(c){let{gen:l,data:u,$data:d,schema:f,schemaCode:h,it:m}=c;if(!d&&f.length===0)throw Error("enum must have non-empty array");let g=f.length>=m.opts.loopEnum,A,y=a(()=>A??(A=(0,r.useFunc)(l,n.default)),"q"),E;if(g||d)E=l.let("valid"),c.block$data(E,_);else{if(!Array.isArray(f))throw Error("ajv implementation error");let b=l.const("vSchema",h);E=(0,e.or)(...f.map((T,w)=>v(b,w)))}c.pass(E);function _(){l.assign(E,!1),l.forOf("v",h,b=>l.if(e._`${y()}(${u}, ${b})`,()=>l.assign(E,!0).break()))}a(_,"B");function v(b,T){let w=f[T];return typeof w=="object"&&w!==null?e._`${y()}(${u}, ${b}[${T}])`:e._`${u} === ${w}`}a(v,"z")}};t.default=s}),cMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=JNc(),r=ZNc(),n=eMc(),o=tMc(),s=rMc(),c=nMc(),l=iMc(),u=oMc(),d=sMc(),f=aMc(),h=[e.default,r.default,n.default,o.default,s.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h}),aVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;var e=xs(),r=uc(),n={message:a(({params:{len:c}})=>e.str`must NOT have more than ${c} items`,"message"),params:a(({params:{len:c}})=>e._`{limit: ${c}}`,"params")},o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n,code(c){let{parentSchema:l,it:u}=c,{items:d}=l;if(!Array.isArray(d)){(0,r.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(c,d)}};function s(c,l){let{gen:u,schema:d,data:f,keyword:h,it:m}=c;m.items=!0;let g=u.const("len",e._`${f}.length`);if(d===!1)c.setParams({len:l.length}),c.pass(e._`${g} <= ${l.length}`);else if(typeof d=="object"&&!(0,r.alwaysValidSchema)(m,d)){let y=u.var("valid",e._`${g} <= ${l.length}`);u.if((0,e.not)(y),()=>A(y)),c.ok(y)}function A(y){u.forRange("i",l.length,g,E=>{c.subschema({keyword:h,dataProp:E,dataPropType:r.Type.Num},y),!m.allErrors&&u.if((0,e.not)(y),()=>u.break())})}a(A,"H")}a(s,"FR"),t.validateAdditionalItems=s,t.default=o}),cVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;var e=xs(),r=uc(),n=uN(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(c){let{schema:l,it:u}=c;if(Array.isArray(l))return s(c,"additionalItems",l);u.items=!0,!(0,r.alwaysValidSchema)(u,l)&&c.ok((0,n.validateArray)(c))}};function s(c,l,u=c.schema){let{gen:d,parentSchema:f,data:h,keyword:m,it:g}=c;E(f),g.opts.unevaluated&&u.length&&g.items!==!0&&(g.items=r.mergeEvaluated.items(d,u.length,g.items));let A=d.name("valid"),y=d.const("len",e._`${h}.length`);u.forEach((_,v)=>{(0,r.alwaysValidSchema)(g,_)||(d.if(e._`${y} > ${v}`,()=>c.subschema({keyword:m,schemaProp:v,dataProp:v},A)),c.ok(A))});function E(_){let{opts:v,errSchemaPath:b}=g,T=u.length,w=T===_.minItems&&(T===_.maxItems||_[l]===!1);if(v.strictTuples&&!w){let R=`"${m}" is ${T}-tuple, but minItems or maxItems/${l} are not specified or different at path "${b}"`;(0,r.checkStrictMode)(g,R,v.strictTuples)}}a(E,"V")}a(s,"jR"),t.validateTuple=s,t.default=o}),lMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=cVi(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a(n=>(0,e.validateTuple)(n,"items"),"code")};t.default=r}),uMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n=uN(),o=aVi(),s={message:a(({params:{len:l}})=>e.str`must NOT have more than ${l} items`,"message"),params:a(({params:{len:l}})=>e._`{limit: ${l}}`,"params")},c={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:s,code(l){let{schema:u,parentSchema:d,it:f}=l,{prefixItems:h}=d;f.items=!0,!(0,r.alwaysValidSchema)(f,u)&&(h?(0,o.validateAdditionalItems)(l,h):l.ok((0,n.validateArray)(l)))}};t.default=c}),dMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n={message:a(({params:{min:s,max:c}})=>c===void 0?e.str`must contain at least ${s} valid item(s)`:e.str`must contain at least ${s} and no more than ${c} valid item(s)`,"message"),params:a(({params:{min:s,max:c}})=>c===void 0?e._`{minContains: ${s}}`:e._`{minContains: ${s}, maxContains: ${c}}`,"params")},o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,data:d,it:f}=s,h,m,{minContains:g,maxContains:A}=u;f.opts.next?(h=g===void 0?1:g,m=A):h=1;let y=c.const("len",e._`${d}.length`);if(s.setParams({min:h,max:m}),m===void 0&&h===0){(0,r.checkStrictMode)(f,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&h>m){(0,r.checkStrictMode)(f,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,r.alwaysValidSchema)(f,l)){let T=e._`${y} >= ${h}`;m!==void 0&&(T=e._`${T} && ${y} <= ${m}`),s.pass(T);return}f.items=!0;let E=c.name("valid");m===void 0&&h===1?v(E,()=>c.if(E,()=>c.break())):h===0?(c.let(E,!0),m!==void 0&&c.if(e._`${d}.length > 0`,_)):(c.let(E,!1),_()),s.result(E,()=>s.reset());function _(){let T=c.name("_valid"),w=c.let("count",0);v(T,()=>c.if(T,()=>b(w)))}a(_,"z");function v(T,w){c.forRange("i",0,y,R=>{s.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:!0},T),w()})}a(v,"N");function b(T){c.code(e._`${T}++`),m===void 0?c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0).break()):(c.if(e._`${T} > ${m}`,()=>c.assign(E,!1).break()),h===1?c.assign(E,!0):c.if(e._`${T} >= ${h}`,()=>c.assign(E,!0)))}a(b,"w")}};t.default=o}),fMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;var e=xs(),r=uc(),n=uN();t.error={message:a(({params:{property:u,depsCount:d,deps:f}})=>{let h=d===1?"property":"properties";return e.str`must have ${h} ${f} when property ${u} is present`},"message"),params:a(({params:{property:u,depsCount:d,deps:f,missingProperty:h}})=>e._`{property: ${u}, missingProperty: ${h}, depsCount: ${d}, - deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${E} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),y5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),vVi=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=kV(),o=uc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let k;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");k=(0,e.isOwnProperty)(u,D,x)}else E.length?k=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):k=r.nil;return _.length&&(k=(0,r.or)(k,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(k)}a(b,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let k=u.name("valid");y.removeAdditional==="failing"?(R(x,k,!1),u.if((0,r.not)(k),()=>{l.reset(),T(x)})):(R(x,k),!A&&u.if((0,r.not)(k),()=>u.break()))}}a(w,"w");function R(x,k,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,k)}a(R,"O")}};t.default=c}),E5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=GTt(),r=pN(),n=uc(),o=vVi(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),_5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r=Rs(),n=uc(),o=uc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),C5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),v5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=pN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),b5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),S5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),T5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=uc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),I5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),x5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=_Vi(),r=h5c(),n=CVi(),o=m5c(),s=g5c(),c=A5c(),l=y5c(),u=vVi(),d=E5c(),f=_5c(),h=C5c(),m=v5c(),g=b5c(),A=S5c(),y=T5c(),E=I5c();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),w5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?E():_();function E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let k=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${k} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(k());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,L=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${L}.validate`]:["string",D,L]}a(x,"A");function k(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(k,"S")}a(_,"N")}};t.default=n}),R5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=w5c(),r=[e.default];t.default=r}),k5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),P5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=t5c(),r=p5c(),n=x5c(),o=R5c(),s=k5c(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),D5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),N5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=Rs(),r=D5c(),n=m3r(),o=$Tt(),s=uc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),k=!0;for(let B=0;B{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),bVi=Ut((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=ZOc(),n=P5c(),o=N5c(),s=M5c(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=GTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=Rs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=h3r();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=$Tt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),O5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(L,B){return{validate:L,compare:B}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:k},double:{type:"number",validate:k},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(L){let B=n.exec(L);if(!B)return!1;let Q=+B[1],M=+B[2],O=+B[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(Q)?29:o[M])}a(s,"xP");function c(L,B){if(L&&B)return L>B?1:L23||V>59||L&&!F)return!1;if(M<=23&&O<=59&&q<60)return!0;let G=O-V*U,Y=M-W*U-(G<0?1:0);return(Y===23||Y===-1)&&(G===59||G===-1)&&q<61}}a(u,"Jz");function d(L,B){if(!(L&&B))return;let Q=new Date("2020-01-01T"+L).valueOf(),M=new Date("2020-01-01T"+B).valueOf();if(Q&&M)return Q-M}a(d,"Wz");function f(L,B){if(!(L&&B))return;let Q=l.exec(L),M=l.exec(B);if(Q&&M)return L=Q[1]+Q[2]+Q[3],B=M[1]+M[2]+M[3],L>B?1:L=T}a(R,"Cs");function x(L){return Number.isInteger(L)}a(x,"Ts");function k(){return!0}a(k,"TP");var D=/[^\\]\\Z/;function N(L){if(D.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}a(N,"ys")}),B5c=Ut(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=bVi(),r=Rs(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?E():_();function E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),L5c=Ut((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=O5c(),n=B5c(),o=Rs(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),F5c=50;a(WBr,"g9");a(RVi,"K5");a(U5c,"Uk");a(Qne,"v4");zTt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],Q5c=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],q5c="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",j5c=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H5c=/(.*?)<\/command-name>/;a(A3r,"h9");G5c={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(NVi,"q5");a($5c,"JN");a(fV,"G1");a(V5c,"zk");a(W5c,"Nk");a(z5c,"wk");zBr=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=NVi(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},g1=class extends Error{static{a(this,"W6")}};a(MVi,"V5");a(HE,"R$");a(tFe,"U1");Y5c=typeof global=="object"&&global&&global.Object===Object&&global,OVi=Y5c,K5c=typeof self=="object"&&self&&self.Object===Object&&self,J5c=OVi||K5c||Function("return this")(),f_e=J5c,Z5c=f_e.Symbol,TV=Z5c,BVi=Object.prototype,X5c=BVi.hasOwnProperty,e4c=BVi.toString,VLe=TV?TV.toStringTag:void 0;a(t4c,"Ak");r4c=t4c,n4c=Object.prototype,i4c=n4c.toString;a(o4c,"Pk");s4c=o4c,a4c="[object Null]",c4c="[object Undefined]",eGi=TV?TV.toStringTag:void 0;a(l4c,"_k");rFe=l4c;a(u4c,"kk");p9=u4c,d4c="[object AsyncFunction]",f4c="[object Function]",p4c="[object GeneratorFunction]",h4c="[object Proxy]";a(m4c,"xk");y3r=m4c,g4c=f_e["__core-js_shared__"],hBr=g4c,tGi=(function(){var t=/[^.]+$/.exec(hBr&&hBr.keys&&hBr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(A4c,"fk");y4c=A4c,E4c=Function.prototype,_4c=E4c.toString;a(C4c,"uk");v4c=C4c,b4c=/[\\^$.*+?()[\]{}|]/g,S4c=/^\[object .+?Constructor\]$/,T4c=Function.prototype,I4c=Object.prototype,x4c=T4c.toString,w4c=I4c.hasOwnProperty,R4c=RegExp("^"+x4c.call(w4c).replace(b4c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(k4c,"rk");P4c=k4c;a(D4c,"ok");N4c=D4c;a(M4c,"tk");E3r=M4c,O4c=E3r(Object,"create"),I3e=O4c;a(B4c,"sk");L4c=B4c;a(F4c,"ek");U4c=F4c,Q4c="__lodash_hash_undefined__",q4c=Object.prototype,j4c=q4c.hasOwnProperty;a(H4c,"XS");G4c=H4c,$4c=Object.prototype,V4c=$4c.hasOwnProperty;a(W4c,"GS");z4c=W4c,Y4c="__lodash_hash_undefined__";a(K4c,"HS");J4c=K4c;a(p_e,"a0");p_e.prototype.clear=L4c;p_e.prototype.delete=U4c;p_e.prototype.get=G4c;p_e.prototype.has=z4c;p_e.prototype.set=J4c;rGi=p_e;a(Z4c,"KS");X4c=Z4c;a(eBc,"qS");YTt=eBc;a(tBc,"VS");KTt=tBc,rBc=Array.prototype,nBc=rBc.splice;a(iBc,"NS");oBc=iBc;a(sBc,"wS");aBc=sBc;a(cBc,"OS");lBc=cBc;a(uBc,"DS");dBc=uBc;a(h_e,"s0");h_e.prototype.clear=X4c;h_e.prototype.delete=oBc;h_e.prototype.get=aBc;h_e.prototype.has=lBc;h_e.prototype.set=dBc;JTt=h_e,fBc=E3r(f_e,"Map"),LVi=fBc;a(pBc,"ZS");hBc=pBc;a(mBc,"MS");gBc=mBc;a(ABc,"LS");ZTt=ABc;a(yBc,"jS");EBc=yBc;a(_Bc,"AS");CBc=_Bc;a(vBc,"IS");bBc=vBc;a(SBc,"RS");TBc=SBc;a(m_e,"e0");m_e.prototype.clear=hBc;m_e.prototype.delete=EBc;m_e.prototype.get=CBc;m_e.prototype.has=bBc;m_e.prototype.set=TBc;_3r=m_e,IBc="Expected a function";a(C3r,"MG");C3r.Cache=_3r;uy=C3r,g_e=uy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,UVi.join)((0,FVi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),G4h=uy(()=>HE(process.env.CLAUDE_CODE_SUPERVISED));a(gn,"y");a(ft,"Z");QVi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return QVi=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(x3e,"T4");YBr=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),xi=class extends Error{static{a(this,"g")}},FC=class t extends xi{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new HEe({message:n,cause:YBr(r)});let s=r,c=s?.error?.type;return e===400?new bSt(e,s,n,o,c):e===401?new SSt(e,s,n,o,c):e===403?new TSt(e,s,n,o,c):e===404?new ISt(e,s,n,o,c):e===409?new xSt(e,s,n,o,c):e===422?new wSt(e,s,n,o,c):e===429?new RSt(e,s,n,o,c):e>=500?new kSt(e,s,n,o,c):new t(e,s,n,o,c)}},fI=class extends FC{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},HEe=class extends FC{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},vSt=class extends HEe{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},bSt=class extends FC{static{a(this,"p9")}},SSt=class extends FC{static{a(this,"d9")}},TSt=class extends FC{static{a(this,"i9")}},ISt=class extends FC{static{a(this,"n9")}},xSt=class extends FC{static{a(this,"r9")}},wSt=class extends FC{static{a(this,"o9")}},RSt=class extends FC{static{a(this,"t9")}},kSt=class extends FC{static{a(this,"a9")}},xBc=/^[a-z][a-z0-9+.-]*:/i,wBc=a(t=>xBc.test(t),"bN"),KBr=a(t=>(KBr=Array.isArray,KBr(t)),"jG"),nGi=KBr;a(JBr,"w5");a(iGi,"IG");a(RBc,"_N");kBc=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new xi(`${t} must be an integer`);if(e<0)throw new xi(`${t} must be a positive integer`);return e},"kN"),qVi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),PBc=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),_V="0.94.0",DBc=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(NBc,"SS");MBc=a(()=>{let t=NBc();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":sGi(Deno.build.os),"X-Stainless-Arch":oGi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":sGi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":oGi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=OBc();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":_V,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(OBc,"CS");oGi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),sGi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),v3r=a(()=>aGi??(aGi=MBc()),"s9");a(BBc,"yN");a(jVi,"RG");a(HVi,"D5");a(b3r,"e9");a(LBc,"fN");FBc=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(UBc,"hN");QBc="urn:ietf:params:oauth:grant-type:jwt-bearer",qBc="refresh_token",GVi="/v1/oauth/token",PSt="oauth-2025-04-20",jBc="oidc-federation-2026-04-01",HBc=120,S3r=30,GBc=5,cGi=1048576;a($Vi,"Z5");a(VVi,"M5");mBr=2e3,$Bc=new Set(["error","error_description","error_uri"]);a($R,"Z6");a(WVi,"L5");a(zVi,"j5");a(VBc,"fS");Jl=class extends xi{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(qne,"Y4");ZBr=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-qne();return n>HBc?r.token:n>S3r?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||qne()-this.lastAdvisoryError{this.lastAdvisoryError=qne(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},Yl=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(WBc,"rN");a(T3r,"Q8");a(dGi,"bG");DSt={off:0,error:200,warn:300,info:400,debug:500},fGi=a((t,e,r)=>{if(t){if(RBc(DSt,t))return t;Ug(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(DSt))}`)}},"_G");a(p3e,"$Q");a(K1t,"A5");zBc={error:p3e,warn:p3e,info:p3e,debug:p3e},pGi=new WeakMap;a(Ug,"m$");Fne=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),YVi="1.0",YBc=/^[A-Za-z0-9_.-]+$/;a(KVi,"tN");KBc=a(async t=>{var e,r;let n=await I3r();if(n===null)return null;let o=t??await JVi();if(o===null)return null;KVi(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=Yl("ANTHROPIC_ORGANIZATION_ID"),h=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Yl("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:Yl("ANTHROPIC_WORKSPACE_ID"),base_url:Yl("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Yl("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Yl("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=Yl("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Yl("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Yl("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Yl("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=Yl("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Yl("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=Yl("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),JBc=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await I3r();if(!r)return null;let n=e??await JVi();return n?(KVi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),I3r=a(async()=>{if(!ZBc())return null;let t=await import("node:path"),e=Yl("ANTHROPIC_CONFIG_DIR");if(e)return e;if(v3r()["X-Stainless-OS"]==="Windows"){let o=Yl("APPDATA");if(o)return t.join(o,"Anthropic");let s=Yl("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=Yl("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=Yl("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),ZBc=a(()=>{let t=v3r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),JVi=a(async()=>{let t=await I3r();if(!t)return null;let e=Yl("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(hGi,"SG");a(XBc,"$w");a(eLc,"Qw");a(tLc,"Jw");a(ZVi,"vG");a(rLc,"Xw");a(nLc,"mS");a(iLc,"lS");a(oLc,"cS");Vne=class{static{a(this,"B1")}constructor(){lI.set(this,void 0),uI.set(this,void 0),gn(this,lI,new Uint8Array,"f"),gn(this,uI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?T3r(e):e;gn(this,lI,WBc([ft(this,lI,"f"),r]),"f");let n=[],o;for(;(o=sLc(ft(this,lI,"f"),ft(this,uI,"f")))!=null;){if(o.carriage&&ft(this,uI,"f")==null){gn(this,uI,o.index,"f");continue}if(ft(this,uI,"f")!=null&&(o.index!==ft(this,uI,"f")+1||o.carriage)){n.push(dGi(ft(this,lI,"f").subarray(0,ft(this,uI,"f")-1))),gn(this,lI,ft(this,lI,"f").subarray(ft(this,uI,"f")),"f"),gn(this,uI,null,"f");continue}let s=ft(this,uI,"f")!==null?o.preceding-1:o.preceding,c=dGi(ft(this,lI,"f").subarray(0,s));n.push(c),gn(this,lI,ft(this,lI,"f").subarray(o.index),"f"),gn(this,uI,null,"f")}return n}flush(){return ft(this,lI,"f").length?this.decode(` -`):[]}};lI=new WeakMap,uI=new WeakMap;Vne.NEWLINE_CHARS=new Set([` -`,"\r"]);Vne.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(sLc,"pS");a(aLc,"Yw");Wne=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,WLe.set(this,void 0),this.controller=r,gn(this,WLe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Ug(n):console;async function*c(){if(o)throw new xi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of cLc(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=qVi(u.data)??u.data,f=d?.error?.type;throw new FC(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(x3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new Vne,u=b3r(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new xi("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(x3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(WLe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,ft(this,WLe,"f")),new t(()=>o(r),this.controller,ft(this,WLe,"f"))]}toReadableStream(){let e=this,r;return jVi({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=T3r(JSON.stringify(o)+` -`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(cLc,"dS");a(lLc,"iS");XBr=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` -`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=uLc(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(uLc,"nS");a(XVi,"P5");a(eWi,"CG");NSt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=XVi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,h3e.set(this,void 0),gn(this,h3e,e,"f")}_thenUnwrap(e){return new t(ft(this,h3e,"f"),this.responsePromise,async(r,n)=>eWi(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(ft(this,h3e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};h3e=new WeakMap;MSt=class{static{a(this,"TG")}constructor(e,r,n,o){J1t.set(this,void 0),gn(this,J1t,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new xi("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await ft(this,J1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(J1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},eLr=class extends NSt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await XVi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},zne=class extends MSt{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...JBr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...JBr(this.options.query),after_id:e}}:null}},$E=class extends MSt{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...JBr(this.options.query),page:e}}:null}},tWi=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(FEe,"J0");a(gSt,"XQ");rWi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),x3r=a(async(t,e,r=!0)=>({...t,body:await fLc(t.body,e,r)}),"J8"),mGi=new WeakMap;a(dLc,"oS");fLc=a(async(t,e,r=!0)=>{if(!await dLc(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>tLr(n,o,s,r))),n},"tS"),pLc=a(t=>t instanceof Blob&&"name"in t,"aS"),tLr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,FEe([await r.blob()],gSt(r,n),o))}else if(rWi(r))t.append(e,FEe([await new Response(HVi(r)).blob()],gSt(r,n)));else if(pLc(r))t.append(e,FEe([r],gSt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>tLr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>tLr(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),nWi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),hLc=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&nWi(t),"sS"),mLc=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(gLc,"_5");a(rLr,"gG");a(ALc,"$v");Ad=class{static{a(this,"t")}constructor(e){this._client=e}},iWi=Symbol.for("brand.privateNullableHeaders");a(yLc,"Jv");hr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of yLc(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[iWi]:!0,values:e,nulls:r}},"R");a(oWi,"qw");gGi=Object.freeze(Object.create(null)),ELc=a((t=oWi)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??gGi)??gGi)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new xi(`Path parameters result in path with invalid segments: + deps: ${f}}`,"params")};var o={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){let[d,f]=s(u);c(u,d),l(u,f)}};function s({schema:u}){let d={},f={};for(let h in u){if(h==="__proto__")continue;let m=Array.isArray(u[h])?d:f;m[h]=u[h]}return[d,f]}a(s,"at");function c(u,d=u.schema){let{gen:f,data:h,it:m}=u;if(Object.keys(d).length===0)return;let g=f.let("missing");for(let A in d){let y=d[A];if(y.length===0)continue;let E=(0,n.propertyInData)(f,h,A,m.opts.ownProperties);u.setParams({property:A,depsCount:y.length,deps:y.join(", ")}),m.allErrors?f.if(E,()=>{for(let _ of y)(0,n.checkReportMissingProp)(u,_)}):(f.if(e._`${E} && (${(0,n.checkMissingProp)(u,y,g)})`),(0,n.reportMissingProp)(u,g),f.else())}}a(c,"vR"),t.validatePropertyDeps=c;function l(u,d=u.schema){let{gen:f,data:h,keyword:m,it:g}=u,A=f.name("valid");for(let y in d)(0,r.alwaysValidSchema)(g,d[y])||(f.if((0,n.propertyInData)(f,h,y,g.opts.ownProperties),()=>{let E=u.subschema({keyword:m,schemaProp:y},A);u.mergeValidEvaluated(E,A)},()=>f.var(A,!0)),u.ok(A))}a(l,"CR"),t.validateSchemaDeps=l,t.default=o}),pMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n={message:"property name must be valid",params:a(({params:s})=>e._`{propertyName: ${s.propertyName}}`,"params")},o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:n,code(s){let{gen:c,schema:l,data:u,it:d}=s;if((0,r.alwaysValidSchema)(d,l))return;let f=c.name("valid");c.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},f),c.if((0,e.not)(f),()=>{s.error(!0),!d.allErrors&&c.break()})}),s.ok(f)}};t.default=o}),lVi=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uN(),r=xs(),n=EV(),o=uc(),s={message:"must NOT have additional properties",params:a(({params:l})=>r._`{additionalProperty: ${l.additionalProperty}}`,"params")},c={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:s,code(l){let{gen:u,schema:d,parentSchema:f,data:h,errsCount:m,it:g}=l;if(!m)throw Error("ajv implementation error");let{allErrors:A,opts:y}=g;if(g.props=!0,y.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(g,d))return;let E=(0,e.allSchemaProperties)(f.properties),_=(0,e.allSchemaProperties)(f.patternProperties);v(),l.ok(r._`${m} === ${n.default.errors}`);function v(){u.forIn("key",h,x=>{!E.length&&!_.length?w(x):u.if(b(x),()=>w(x))})}a(v,"B");function b(x){let P;if(E.length>8){let D=(0,o.schemaRefOrVal)(g,f.properties,"properties");P=(0,e.isOwnProperty)(u,D,x)}else E.length?P=(0,r.or)(...E.map(D=>r._`${x} === ${D}`)):P=r.nil;return _.length&&(P=(0,r.or)(P,..._.map(D=>r._`${(0,e.usePattern)(l,D)}.test(${x})`))),(0,r.not)(P)}a(b,"z");function T(x){u.code(r._`delete ${h}[${x}]`)}a(T,"N");function w(x){if(y.removeAdditional==="all"||y.removeAdditional&&d===!1){T(x);return}if(d===!1){l.setParams({additionalProperty:x}),l.error(),!A&&u.break();return}if(typeof d=="object"&&!(0,o.alwaysValidSchema)(g,d)){let P=u.name("valid");y.removeAdditional==="failing"?(R(x,P,!1),u.if((0,r.not)(P),()=>{l.reset(),T(x)})):(R(x,P),!A&&u.if((0,r.not)(P),()=>u.break()))}}a(w,"w");function R(x,P,D){let N={keyword:"additionalProperties",dataProp:x,dataPropType:o.Type.Str};D===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(N,P)}a(R,"O")}};t.default=c}),hMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=PTt(),r=uN(),n=uc(),o=lVi(),s={keyword:"properties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,parentSchema:d,data:f,it:h}=c;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(h,o.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(u);for(let _ of m)h.definedProperties.add(_);h.opts.unevaluated&&m.length&&h.props!==!0&&(h.props=n.mergeEvaluated.props(l,(0,n.toHash)(m),h.props));let g=m.filter(_=>!(0,n.alwaysValidSchema)(h,u[_]));if(g.length===0)return;let A=l.name("valid");for(let _ of g)y(_)?E(_):(l.if((0,r.propertyInData)(l,f,_,h.opts.ownProperties)),E(_),!h.allErrors&&l.else().var(A,!0),l.endIf()),c.it.definedProperties.add(_),c.ok(A);function y(_){return h.opts.useDefaults&&!h.compositeRule&&u[_].default!==void 0}a(y,"q");function E(_){c.subschema({keyword:"properties",schemaProp:_,dataProp:_},A)}a(E,"V")}};t.default=s}),mMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uN(),r=xs(),n=uc(),o=uc(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(c){let{gen:l,schema:u,data:d,parentSchema:f,it:h}=c,{opts:m}=h,g=(0,e.allSchemaProperties)(u),A=g.filter(w=>(0,n.alwaysValidSchema)(h,u[w]));if(g.length===0||A.length===g.length&&(!h.opts.unevaluated||h.props===!0))return;let y=m.strictSchema&&!m.allowMatchingProperties&&f.properties,E=l.name("valid");h.props!==!0&&!(h.props instanceof r.Name)&&(h.props=(0,o.evaluatedPropsToName)(l,h.props));let{props:_}=h;v();function v(){for(let w of g)y&&b(w),h.allErrors?T(w):(l.var(E,!0),T(w),l.if(E))}a(v,"z");function b(w){for(let R in y)new RegExp(w).test(R)&&(0,n.checkStrictMode)(h,`property ${R} matches pattern ${w} (use allowMatchingProperties)`)}a(b,"N");function T(w){l.forIn("key",d,R=>{l.if(r._`${(0,e.usePattern)(c,w)}.test(${R})`,()=>{let x=A.includes(w);x||c.subschema({keyword:"patternProperties",schemaProp:w,dataProp:R,dataPropType:o.Type.Str},E),h.opts.unevaluated&&_!==!0?l.assign(r._`${_}[${R}]`,!0):!x&&!h.allErrors&&l.if((0,r.not)(E),()=>l.break())})})}a(T,"w")}};t.default=s}),gMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){let{gen:o,schema:s,it:c}=n;if((0,e.alwaysValidSchema)(c,s)){n.fail();return}let l=o.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),n.failResult(l,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};t.default=r}),AMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uN(),r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r}),yMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n={message:"must match exactly one schema in oneOf",params:a(({params:s})=>e._`{passingSchemas: ${s.passing}}`,"params")},o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:n,code(s){let{gen:c,schema:l,parentSchema:u,it:d}=s;if(!Array.isArray(l))throw Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;let f=l,h=c.let("valid",!1),m=c.let("passing",null),g=c.name("_valid");s.setParams({passing:m}),c.block(A),s.result(h,()=>s.reset(),()=>s.error(!0));function A(){f.forEach((y,E)=>{let _;(0,r.alwaysValidSchema)(d,y)?c.var(g,!0):_=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},g),E>0&&c.if(e._`${g} && ${h}`).assign(h,!1).assign(m,e._`[${m}, ${E}]`).else(),c.if(g,()=>{c.assign(h,!0),c.assign(m,E),_&&s.mergeEvaluated(_,e.Name)})})}a(A,"q")}};t.default=o}),EMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:"allOf",schemaType:"array",code(n){let{gen:o,schema:s,it:c}=n;if(!Array.isArray(s))throw Error("ajv implementation error");let l=o.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(c,u))return;let f=n.subschema({keyword:"allOf",schemaProp:d},l);n.ok(l),n.mergeEvaluated(f)})}};t.default=r}),_Mc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=uc(),n={message:a(({params:c})=>e.str`must match "${c.ifClause}" schema`,"message"),params:a(({params:c})=>e._`{failingKeyword: ${c.ifClause}}`,"params")},o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:n,code(c){let{gen:l,parentSchema:u,it:d}=c;u.then===void 0&&u.else===void 0&&(0,r.checkStrictMode)(d,'"if" without "then" and "else" is ignored');let f=s(d,"then"),h=s(d,"else");if(!f&&!h)return;let m=l.let("valid",!0),g=l.name("_valid");if(A(),c.reset(),f&&h){let E=l.let("ifClause");c.setParams({ifClause:E}),l.if(g,y("then",E),y("else",E))}else f?l.if(g,y("then")):l.if((0,e.not)(g),y("else"));c.pass(m,()=>c.error(!0));function A(){let E=c.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);c.mergeEvaluated(E)}a(A,"H");function y(E,_){return()=>{let v=c.subschema({keyword:E},g);l.assign(m,g),c.mergeValidEvaluated(v,m),_?l.assign(_,e._`${E}`):c.setParams({ifClause:E})}}a(y,"q")}};function s(c,l){let u=c.schema[l];return u!==void 0&&!(0,r.alwaysValidSchema)(c,u)}a(s,"WP"),t.default=o}),vMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=uc(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:o,it:s}){o.if===void 0&&(0,e.checkStrictMode)(s,`"${n}" without "if" is ignored`)}};t.default=r}),CMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=aVi(),r=lMc(),n=cVi(),o=uMc(),s=dMc(),c=fMc(),l=pMc(),u=lVi(),d=hMc(),f=mMc(),h=gMc(),m=AMc(),g=yMc(),A=EMc(),y=_Mc(),E=vMc();function _(v=!1){let b=[h.default,m.default,g.default,A.default,y.default,E.default,l.default,u.default,c.default,d.default,f.default];return v?b.push(r.default,o.default):b.push(e.default,n.default),b.push(s.default),b}a(_,"ra"),t.default=_}),bMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r={message:a(({schemaCode:o})=>e.str`must match format "${o}"`,"message"),params:a(({schemaCode:o})=>e._`{format: ${o}}`,"params")},n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r,code(o,s){let{gen:c,data:l,$data:u,schema:d,schemaCode:f,it:h}=o,{opts:m,errSchemaPath:g,schemaEnv:A,self:y}=h;if(!m.validateFormats)return;u?E():_();function E(){let v=c.scopeValue("formats",{ref:y.formats,code:m.code.formats}),b=c.const("fDef",e._`${v}[${f}]`),T=c.let("fType"),w=c.let("format");c.if(e._`typeof ${b} == "object" && !(${b} instanceof RegExp)`,()=>c.assign(T,e._`${b}.type || "string"`).assign(w,e._`${b}.validate`),()=>c.assign(T,e._`"string"`).assign(w,b)),o.fail$data((0,e.or)(R(),x()));function R(){return m.strictSchema===!1?e.nil:e._`${f} && !${w}`}a(R,"j");function x(){let P=A.$async?e._`(${b}.async ? await ${w}(${l}) : ${w}(${l}))`:e._`${w}(${l})`,D=e._`(typeof ${w} == "function" ? ${P} : ${w}.test(${l}))`;return e._`${w} && ${w} !== true && ${T} === ${s} && !${D}`}a(x,"A")}a(E,"z");function _(){let v=y.formats[d];if(!v){R();return}if(v===!0)return;let[b,T,w]=x(v);b===s&&o.pass(P());function R(){if(m.strictSchema===!1){y.logger.warn(D());return}throw Error(D());function D(){return`unknown format "${d}" ignored in schema at path "${g}"`}}a(R,"j");function x(D){let N=D instanceof RegExp?(0,e.regexpCode)(D):m.code.formats?e._`${m.code.formats}${(0,e.getProperty)(d)}`:void 0,B=c.scopeValue("formats",{key:d,ref:D,code:N});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,e._`${B}.validate`]:["string",D,B]}a(x,"A");function P(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!A.$async)throw Error("async format in sync schema");return e._`await ${w}(${l})`}return typeof T=="function"?e._`${w}(${l})`:e._`${w}.test(${l})`}a(P,"S")}a(_,"N")}};t.default=n}),SMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=bMc(),r=[e.default];t.default=r}),TMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),IMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=KNc(),r=cMc(),n=CMc(),o=SMc(),s=TMc(),c=[e.default,r.default,(0,n.default)(),o.default,s.metadataVocabulary,s.contentVocabulary];t.default=c}),xMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping"})(e||(t.DiscrError=e={}))}),wMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xs(),r=xMc(),n=WLr(),o=kTt(),s=uc(),c={message:a(({params:{discrError:u,tagName:d}})=>u===r.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,"message"),params:a(({params:{discrError:u,tag:d,tagName:f}})=>e._`{error: ${u}, tag: ${f}, tagValue: ${d}}`,"params")},l={keyword:"discriminator",type:"object",schemaType:"object",error:c,code(u){let{gen:d,data:f,schema:h,parentSchema:m,it:g}=u,{oneOf:A}=m;if(!g.opts.discriminator)throw Error("discriminator: requires discriminator option");let y=h.propertyName;if(typeof y!="string")throw Error("discriminator: requires propertyName");if(h.mapping)throw Error("discriminator: mapping is not supported");if(!A)throw Error("discriminator: requires oneOf keyword");let E=d.let("valid",!1),_=d.const("tag",e._`${f}${(0,e.getProperty)(y)}`);d.if(e._`typeof ${_} == "string"`,()=>v(),()=>u.error(!1,{discrError:r.DiscrError.Tag,tag:_,tagName:y})),u.ok(E);function v(){let w=T();d.if(!1);for(let R in w)d.elseIf(e._`${_} === ${R}`),d.assign(E,b(w[R]));d.else(),u.error(!1,{discrError:r.DiscrError.Mapping,tag:_,tagName:y}),d.endIf()}a(v,"V");function b(w){let R=d.name("valid"),x=u.subschema({keyword:"oneOf",schemaProp:w},R);return u.mergeEvaluated(x,e.Name),R}a(b,"B");function T(){var w;let R={},x=D(m),P=!0;for(let L=0;L{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),uVi=qt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;var r=WNc(),n=IMc(),o=wMc(),s=RMc(),c=["/properties"],l="http://json-schema.org/draft-07/schema";class u extends r.default{static{a(this,"pJ")}_addVocabularies(){super._addVocabularies(),n.default.forEach(A=>this.addVocabulary(A)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let A=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(A,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=PTt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:a(function(){return d.KeywordCxt},"get")});var f=xs();Object.defineProperty(t,"_",{enumerable:!0,get:a(function(){return f._},"get")}),Object.defineProperty(t,"str",{enumerable:!0,get:a(function(){return f.str},"get")}),Object.defineProperty(t,"stringify",{enumerable:!0,get:a(function(){return f.stringify},"get")}),Object.defineProperty(t,"nil",{enumerable:!0,get:a(function(){return f.nil},"get")}),Object.defineProperty(t,"Name",{enumerable:!0,get:a(function(){return f.Name},"get")}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:a(function(){return f.CodeGen},"get")});var h=VLr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:a(function(){return h.default},"get")});var m=kTt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:a(function(){return m.default},"get")})}),PMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(B,L){return{validate:B,compare:L}}a(e,"b4"),t.fullFormats={date:e(s,c),time:e(u(!0),d),"date-time":e(m(!0),g),"iso-time":e(u(),f),"iso-date-time":e(m(),A),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:R},int64:{type:"number",validate:x},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,c),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,A),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(B){return B%4===0&&(B%100!==0||B%400===0)}a(r,"Is");var n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(B){let L=n.exec(B);if(!L)return!1;let j=+L[1],M=+L[2],O=+L[3];return M>=1&&M<=12&&O>=1&&O<=(M===2&&r(j)?29:o[M])}a(s,"xP");function c(B,L){if(B&&L)return B>L?1:B23||W>59||B&&!Q)return!1;if(M<=23&&O<=59&&q<60)return!0;let $=O-W*U,J=M-z*U-($<0?1:0);return(J===23||J===-1)&&($===59||$===-1)&&q<61}}a(u,"Jz");function d(B,L){if(!(B&&L))return;let j=new Date("2020-01-01T"+B).valueOf(),M=new Date("2020-01-01T"+L).valueOf();if(j&&M)return j-M}a(d,"Wz");function f(B,L){if(!(B&&L))return;let j=l.exec(B),M=l.exec(L);if(j&&M)return B=j[1]+j[2]+j[3],L=M[1]+M[2]+M[3],B>L?1:B=T}a(R,"Cs");function x(B){return Number.isInteger(B)}a(x,"Ts");function P(){return!0}a(P,"TP");var D=/[^\\]\\Z/;function N(B){if(D.test(B))return!1;try{return new RegExp(B),!0}catch{return!1}}a(N,"ys")}),kMc=qt(t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=uVi(),r=xs(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:a(({keyword:l,schemaCode:u})=>r.str`should be ${o[l].okStr} ${u}`,"message"),params:a(({keyword:l,schemaCode:u})=>r._`{comparison: ${o[l].okStr}, limit: ${u}}`,"params")};t.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(l){let{gen:u,data:d,schemaCode:f,keyword:h,it:m}=l,{opts:g,self:A}=m;if(!g.validateFormats)return;let y=new e.KeywordCxt(m,A.RULES.all.format.definition,"format");y.$data?E():_();function E(){let b=u.scopeValue("formats",{ref:A.formats,code:g.code.formats}),T=u.const("fmt",r._`${b}[${y.schemaCode}]`);l.fail$data((0,r.or)(r._`typeof ${T} != "object"`,r._`${T} instanceof RegExp`,r._`typeof ${T}.compare != "function"`,v(T)))}a(E,"q");function _(){let b=y.schema,T=A.formats[b];if(!T||T===!0)return;if(typeof T!="object"||T instanceof RegExp||typeof T.compare!="function")throw Error(`"${h}": format "${b}" does not define "compare" function`);let w=u.scopeValue("formats",{key:b,ref:T,code:g.code.formats?r._`${g.code.formats}${(0,r.getProperty)(b)}`:void 0});l.fail$data(v(w))}a(_,"V");function v(b){return r._`${b}.compare(${d}, ${f}) ${o[h].fail} 0`}a(v,"B")},dependencies:["format"]};var c=a(l=>(l.addKeyword(t.formatLimitDefinition),l),"us");t.default=c}),DMc=qt((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=PMc(),n=kMc(),o=xs(),s=new o.Name("fullFormats"),c=new o.Name("fastFormats"),l=a((d,f={keywords:!0})=>{if(Array.isArray(f))return u(d,f,r.fullFormats,s),d;let[h,m]=f.mode==="fast"?[r.fastFormats,c]:[r.fullFormats,s],g=f.formats||r.formatNames;return u(d,g,h,m),f.keywords&&(0,n.default)(d),d},"Kz");l.get=(d,f="full")=>{let h=(f==="fast"?r.fastFormats:r.fullFormats)[d];if(!h)throw Error(`Unknown format "${d}"`);return h};function u(d,f,h,m){var g,A;(g=(A=d.opts.code).formats)!==null&&g!==void 0||(A.formats=o._`require("ajv-formats/dist/formats").${m}`);for(let y of f)d.addFormat(y,h[y])}a(u,"dP"),e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l}),NMc=50;a(TBr,"g9");a(gVi,"K5");a(MMc,"Uk");a(Nne,"v4");MTt=["PreToolUse","PostToolUse","PostToolUseFailure","PostToolBatch","Notification","UserPromptSubmit","UserPromptExpansion","SessionStart","SessionEnd","Stop","StopFailure","SubagentStart","SubagentStop","PreCompact","PostCompact","PermissionRequest","PermissionDenied","Setup","TeammateIdle","TaskCreated","TaskCompleted","Elicitation","ElicitationResult","ConfigChange","WorktreeCreate","WorktreeRemove","InstructionsLoaded","CwdChanged","FileChanged","MessageDisplay"],OMc=["clear","resume","logout","prompt_input_exit","other","bypass_permissions_disabled"],BMc="__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__",LMc=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,FMc=/(.*?)<\/command-name>/;a(YLr,"h9");UMc={customTitle:"customTitle",aiTitle:"aiTitle",lastPrompt:"lastPrompt",summary:"summaryHint",gitBranch:"gitBranch"};a(_Vi,"q5");a(QMc,"JN");a(tV,"G1");a(qMc,"zk");a(jMc,"Nk");a(HMc,"wk");IBr=class{static{a(this,"FG")}store=new Map;mtimes=new Map;summaries=new Map;lastMtime=0;keyToString(e){let r=[e.projectKey,e.sessionId];return e.subpath&&r.push(e.subpath),r.join("/")}async append(e,r){let n=this.keyToString(e),o=this.store.get(n)??[];o.push(...r),this.store.set(n,o);let s=Math.max(Date.now(),this.lastMtime+1);if(this.lastMtime=s,this.mtimes.set(n,s),e.subpath===void 0){let c=`${e.projectKey}/${e.sessionId}`,l=_Vi(this.summaries.get(c),e,r,{mtime:s});this.summaries.set(c,l)}}async load(e){let r=this.keyToString(e);return this.store.get(r)??null}async listSessions(e){let r=[],n=e+"/";for(let[o]of this.store)if(o.startsWith(n)){let s=o.slice(n.length);s.includes("/")||r.push({sessionId:s,mtime:this.mtimes.get(o)??0})}return r}async listSessionSummaries(e){let r=[],n=e+"/";for(let[o,s]of this.summaries)o.startsWith(n)&&r.push(s);return r}async delete(e){let r=this.keyToString(e);if(this.store.delete(r),this.mtimes.delete(r),e.subpath===void 0){this.summaries.delete(`${e.projectKey}/${e.sessionId}`);let n=`${e.projectKey}/${e.sessionId}/`;for(let o of this.store.keys())o.startsWith(n)&&(this.store.delete(o),this.mtimes.delete(o))}}async listSubkeys(e){let r=`${e.projectKey}/${e.sessionId}/`,n=[];for(let o of this.store.keys())o.startsWith(r)&&n.push(o.slice(r.length));return n}getEntries(e){return this.store.get(this.keyToString(e))??[]}get size(){let e=0;for(let r of this.store.keys()){let n=r.indexOf("/");n!==-1&&!r.slice(n+1).includes("/")&&e++}return e}clear(){this.store.clear(),this.mtimes.clear(),this.summaries.clear()}},l1=class extends Error{static{a(this,"W6")}};a(vVi,"V5");a(QE,"R$");a(q3e,"U1");GMc=typeof global=="object"&&global&&global.Object===Object&&global,CVi=GMc,$Mc=typeof self=="object"&&self&&self.Object===Object&&self,VMc=CVi||$Mc||Function("return this")(),e_e=VMc,WMc=e_e.Symbol,hV=WMc,bVi=Object.prototype,zMc=bVi.hasOwnProperty,YMc=bVi.toString,DLe=hV?hV.toStringTag:void 0;a(KMc,"Ak");JMc=KMc,ZMc=Object.prototype,XMc=ZMc.toString;a(eOc,"Pk");tOc=eOc,rOc="[object Null]",nOc="[object Undefined]",qHi=hV?hV.toStringTag:void 0;a(iOc,"_k");j3e=iOc;a(oOc,"kk");o9=oOc,sOc="[object AsyncFunction]",aOc="[object Function]",cOc="[object GeneratorFunction]",lOc="[object Proxy]";a(uOc,"xk");KLr=uOc,dOc=e_e["__core-js_shared__"],V4r=dOc,jHi=(function(){var t=/[^.]+$/.exec(V4r&&V4r.keys&&V4r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();a(fOc,"fk");pOc=fOc,hOc=Function.prototype,mOc=hOc.toString;a(gOc,"uk");AOc=gOc,yOc=/[\\^$.*+?()[\]{}|]/g,EOc=/^\[object .+?Constructor\]$/,_Oc=Function.prototype,vOc=Object.prototype,COc=_Oc.toString,bOc=vOc.hasOwnProperty,SOc=RegExp("^"+COc.call(bOc).replace(yOc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");a(TOc,"rk");IOc=TOc;a(xOc,"ok");wOc=xOc;a(ROc,"tk");JLr=ROc,POc=JLr(Object,"create"),f3e=POc;a(kOc,"sk");DOc=kOc;a(NOc,"ek");MOc=NOc,OOc="__lodash_hash_undefined__",BOc=Object.prototype,LOc=BOc.hasOwnProperty;a(FOc,"XS");UOc=FOc,QOc=Object.prototype,qOc=QOc.hasOwnProperty;a(jOc,"GS");HOc=jOc,GOc="__lodash_hash_undefined__";a($Oc,"HS");VOc=$Oc;a(t_e,"a0");t_e.prototype.clear=DOc;t_e.prototype.delete=MOc;t_e.prototype.get=UOc;t_e.prototype.has=HOc;t_e.prototype.set=VOc;HHi=t_e;a(WOc,"KS");zOc=WOc;a(YOc,"qS");OTt=YOc;a(KOc,"VS");BTt=KOc,JOc=Array.prototype,ZOc=JOc.splice;a(XOc,"NS");e5c=XOc;a(t5c,"wS");r5c=t5c;a(n5c,"OS");i5c=n5c;a(o5c,"DS");s5c=o5c;a(r_e,"s0");r_e.prototype.clear=zOc;r_e.prototype.delete=e5c;r_e.prototype.get=r5c;r_e.prototype.has=i5c;r_e.prototype.set=s5c;LTt=r_e,a5c=JLr(e_e,"Map"),SVi=a5c;a(c5c,"ZS");l5c=c5c;a(u5c,"MS");d5c=u5c;a(f5c,"LS");FTt=f5c;a(p5c,"jS");h5c=p5c;a(m5c,"AS");g5c=m5c;a(A5c,"IS");y5c=A5c;a(E5c,"RS");_5c=E5c;a(n_e,"e0");n_e.prototype.clear=l5c;n_e.prototype.delete=h5c;n_e.prototype.get=g5c;n_e.prototype.has=y5c;n_e.prototype.set=_5c;ZLr=n_e,v5c="Expected a function";a(XLr,"MG");XLr.Cache=ZLr;hy=XLr,i_e=hy(()=>(process.env.CLAUDE_CONFIG_DIR??(0,IVi.join)((0,TVi.homedir)(),".claude")).normalize("NFC"),()=>process.env.CLAUDE_CONFIG_DIR),R5h=hy(()=>QE(process.env.CLAUDE_CODE_SUPERVISED));a(mn,"y");a(gt,"Z");xVi=a(function(){let{crypto:t}=globalThis;if(t?.randomUUID)return xVi=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))},"LG");a(p3e,"T4");xBr=a(t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return Error(JSON.stringify(t))}catch{}}return Error(t)},"l9"),Ii=class extends Error{static{a(this,"g")}},Ov=class t extends Ii{static{a(this,"n$")}constructor(e,r,n,o,s){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("request-id"),this.error=r,this.type=s??null}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new kEe({message:n,cause:xBr(r)});let s=r,c=s?.error?.type;return e===400?new lSt(e,s,n,o,c):e===401?new uSt(e,s,n,o,c):e===403?new dSt(e,s,n,o,c):e===404?new fSt(e,s,n,o,c):e===409?new pSt(e,s,n,o,c):e===422?new hSt(e,s,n,o,c):e===429?new mSt(e,s,n,o,c):e>=500?new gSt(e,s,n,o,c):new t(e,s,n,o,c)}},cI=class extends Ov{static{a(this,"Q6")}constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},kEe=class extends Ov{static{a(this,"e1")}constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},cSt=class extends kEe{static{a(this,"c9")}constructor({message:e}={}){super({message:e??"Request timed out."})}},lSt=class extends Ov{static{a(this,"p9")}},uSt=class extends Ov{static{a(this,"d9")}},dSt=class extends Ov{static{a(this,"i9")}},fSt=class extends Ov{static{a(this,"n9")}},pSt=class extends Ov{static{a(this,"r9")}},hSt=class extends Ov{static{a(this,"o9")}},mSt=class extends Ov{static{a(this,"t9")}},gSt=class extends Ov{static{a(this,"a9")}},C5c=/^[a-z][a-z0-9+.-]*:/i,b5c=a(t=>C5c.test(t),"bN"),wBr=a(t=>(wBr=Array.isArray,wBr(t)),"jG"),GHi=wBr;a(RBr,"w5");a($Hi,"IG");a(S5c,"_N");T5c=a((t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ii(`${t} must be an integer`);if(e<0)throw new Ii(`${t} must be a positive integer`);return e},"kN"),wVi=a(t=>{try{return JSON.parse(t)}catch{return}},"O5"),I5c=a(t=>new Promise(e=>setTimeout(e,t)),"SN"),lV="0.94.0",x5c=a(()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u","xN");a(w5c,"SS");R5c=a(()=>{let t=w5c();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":lV,"X-Stainless-OS":WHi(Deno.build.os),"X-Stainless-Arch":VHi(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":lV,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":lV,"X-Stainless-OS":WHi(globalThis.process.platform??"unknown"),"X-Stainless-Arch":VHi(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=P5c();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":lV,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":lV,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},"vS");a(P5c,"CS");VHi=a(t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown","vN"),WHi=a(t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),"CN"),e3r=a(()=>zHi??(zHi=R5c()),"s9");a(k5c,"yN");a(RVi,"RG");a(PVi,"D5");a(t3r,"e9");a(D5c,"fN");N5c=a(({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)}),"gN");a(M5c,"hN");O5c="urn:ietf:params:oauth:grant-type:jwt-bearer",B5c="refresh_token",kVi="/v1/oauth/token",ASt="oauth-2025-04-20",L5c="oidc-federation-2026-04-01",F5c=120,r3r=30,U5c=5,YHi=1048576;a(DVi,"Z5");a(NVi,"M5");W4r=2e3,Q5c=new Set(["error","error_description","error_uri"]);a(jR,"Z6");a(MVi,"L5");a(OVi,"j5");a(q5c,"fS");zl=class extends Ii{static{a(this,"O$")}constructor(e,r=null,n=null,o=null){super(e),this.statusCode=r,this.body=n,this.requestId=o}};a(Mne,"Y4");PBr=class{static{a(this,"EG")}constructor(e,r){this.cached=null,this.pendingRefresh=null,this.nextForce=!1,this.lastAdvisoryError=0,this.provider=e,this.onAdvisoryRefreshError=r}async getToken(){let e=this.nextForce;this.nextForce=!1;let r=this.cached;if(e||r==null)return(await this.refresh(e)).token;if(r.expiresAt==null)return r.token;let n=r.expiresAt-Mne();return n>F5c?r.token:n>r3r?(this.backgroundRefresh(),r.token):(await this.refresh()).token}invalidate(){this.cached=null,this.nextForce=!0}refresh(e=!1){return this.pendingRefresh&&!e?this.pendingRefresh:this.doRefresh(e)}backgroundRefresh(){this.pendingRefresh||Mne()-this.lastAdvisoryError{this.lastAdvisoryError=Mne(),this.onAdvisoryRefreshError?.(e)})}doRefresh(e=!1){return this.pendingRefresh=this.provider(e?{forceRefresh:!0}:void 0).then(r=>(this.cached=r,this.pendingRefresh=null,r),r=>{throw this.pendingRefresh=null,r}),this.pendingRefresh}},Vl=a(t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()||void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()||void 0},"w$");a(j5c,"rN");a(n3r,"Q8");a(ZHi,"bG");ySt={off:0,error:200,warn:300,info:400,debug:500},XHi=a((t,e,r)=>{if(t){if(S5c(ySt,t))return t;Qg(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(ySt))}`)}},"_G");a(XLe,"$Q");a(B1t,"A5");H5c={error:XLe,warn:XLe,info:XLe,debug:XLe},eGi=new WeakMap;a(Qg,"m$");kne=a(t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="x-api-key"||e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t),"x4"),BVi="1.0",G5c=/^[A-Za-z0-9_.-]+$/;a(LVi,"tN");$5c=a(async t=>{var e,r;let n=await i3r();if(n===null)return null;let o=t??await FVi();if(o===null)return null;LVi(o);let s=await import("node:fs"),c=(await import("node:path")).join(n,"configs",`${o}.json`),l;try{l=await s.promises.readFile(c,"utf-8")}catch(f){if(f?.code!=="ENOENT")throw Error(`failed to read config file ${c}: ${f}`);l=null}if(l===null){let f=Vl("ANTHROPIC_ORGANIZATION_ID"),h=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE"),m=Vl("ANTHROPIC_FEDERATION_RULE_ID");return m&&f?{fromFile:!1,config:{organization_id:f,workspace_id:Vl("ANTHROPIC_WORKSPACE_ID"),base_url:Vl("ANTHROPIC_BASE_URL"),authentication:{type:"oidc_federation",federation_rule_id:m,service_account_id:Vl("ANTHROPIC_SERVICE_ACCOUNT_ID"),identity_token:h?{source:"file",path:h}:void 0,scope:Vl("ANTHROPIC_SCOPE")}}}:null}let u;try{u=JSON.parse(l)}catch(f){throw Error(`failed to parse config file ${c}: ${f}`)}if(!u.authentication)throw Error(`config file ${c} is missing "authentication"`);let d=u.authentication.type;if(d!=="oidc_federation"&&d!=="user_oauth")throw Error(`authentication.type "${d}" is not a known authentication type`);if(u.organization_id??(u.organization_id=Vl("ANTHROPIC_ORGANIZATION_ID")),u.workspace_id??(u.workspace_id=Vl("ANTHROPIC_WORKSPACE_ID")),u.base_url??(u.base_url=Vl("ANTHROPIC_BASE_URL")),(e=u.authentication).scope??(e.scope=Vl("ANTHROPIC_SCOPE")),u.authentication.type==="oidc_federation"){if(!u.authentication.identity_token){let f=Vl("ANTHROPIC_IDENTITY_TOKEN_FILE");f&&(u.authentication.identity_token={source:"file",path:f})}u.authentication.federation_rule_id||(u.authentication.federation_rule_id=Vl("ANTHROPIC_FEDERATION_RULE_ID")??""),(r=u.authentication).service_account_id??(r.service_account_id=Vl("ANTHROPIC_SERVICE_ACCOUNT_ID"))}return{config:u,fromFile:!0}},"aN"),V5c=a(async(t,e)=>{if(t?.authentication.credentials_path)return t.authentication.credentials_path;let r=await i3r();if(!r)return null;let n=e??await FVi();return n?(LVi(n),(await import("node:path")).join(r,"credentials",`${n}.json`)):null},"sN"),i3r=a(async()=>{if(!W5c())return null;let t=await import("node:path"),e=Vl("ANTHROPIC_CONFIG_DIR");if(e)return e;if(e3r()["X-Stainless-OS"]==="Windows"){let o=Vl("APPDATA");if(o)return t.join(o,"Anthropic");let s=Vl("USERPROFILE");return s?t.join(s,"AppData","Roaming","Anthropic"):null}let r=Vl("XDG_CONFIG_HOME");if(r)return t.join(r,"anthropic");let n=Vl("HOME");return n?t.join(n,".config","anthropic"):null},"kG"),W5c=a(()=>{let t=e3r()["X-Stainless-Runtime"];return t==="node"||t==="deno"},"uS"),FVi=a(async()=>{let t=await i3r();if(!t)return null;let e=Vl("ANTHROPIC_PROFILE");if(e)return e;let r=await import("node:fs"),n=(await import("node:path")).join(t,"active_config");try{return(await r.promises.readFile(n,"utf-8")).trim()||"default"}catch(o){if(o?.code!=="ENOENT")throw Error(`failed to read ${n}: ${o}`);return"default"}},"eN");a(tGi,"SG");a(z5c,"$w");a(Y5c,"Qw");a(K5c,"Jw");a(UVi,"vG");a(J5c,"Xw");a(Z5c,"mS");a(X5c,"lS");a(e4c,"cS");Une=class{static{a(this,"B1")}constructor(){oI.set(this,void 0),sI.set(this,void 0),mn(this,oI,new Uint8Array,"f"),mn(this,sI,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?n3r(e):e;mn(this,oI,j5c([gt(this,oI,"f"),r]),"f");let n=[],o;for(;(o=t4c(gt(this,oI,"f"),gt(this,sI,"f")))!=null;){if(o.carriage&>(this,sI,"f")==null){mn(this,sI,o.index,"f");continue}if(gt(this,sI,"f")!=null&&(o.index!==gt(this,sI,"f")+1||o.carriage)){n.push(ZHi(gt(this,oI,"f").subarray(0,gt(this,sI,"f")-1))),mn(this,oI,gt(this,oI,"f").subarray(gt(this,sI,"f")),"f"),mn(this,sI,null,"f");continue}let s=gt(this,sI,"f")!==null?o.preceding-1:o.preceding,c=ZHi(gt(this,oI,"f").subarray(0,s));n.push(c),mn(this,oI,gt(this,oI,"f").subarray(o.index),"f"),mn(this,sI,null,"f")}return n}flush(){return gt(this,oI,"f").length?this.decode(` +`):[]}};oI=new WeakMap,sI=new WeakMap;Une.NEWLINE_CHARS=new Set([` +`,"\r"]);Une.NEWLINE_REGEXP=/\r\n|[\n\r]/g;a(t4c,"pS");a(r4c,"Yw");Qne=class t{static{a(this,"x6")}constructor(e,r,n){this.iterator=e,NLe.set(this,void 0),this.controller=r,mn(this,NLe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,s=n?Qg(n):console;async function*c(){if(o)throw new Ii("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of n4c(e,r)){if(u.event==="completion")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event==="message_start"||u.event==="message_delta"||u.event==="message_stop"||u.event==="content_block_start"||u.event==="content_block_delta"||u.event==="content_block_stop"||u.event==="message"||u.event==="user.message"||u.event==="user.interrupt"||u.event==="user.tool_confirmation"||u.event==="user.custom_tool_result"||u.event==="agent.message"||u.event==="agent.thinking"||u.event==="agent.tool_use"||u.event==="agent.tool_result"||u.event==="agent.mcp_tool_use"||u.event==="agent.mcp_tool_result"||u.event==="agent.custom_tool_use"||u.event==="agent.thread_context_compacted"||u.event==="session.status_running"||u.event==="session.status_idle"||u.event==="session.status_rescheduled"||u.event==="session.status_terminated"||u.event==="session.error"||u.event==="session.deleted"||u.event==="span.model_request_start"||u.event==="span.model_request_end")try{yield JSON.parse(u.data)}catch(d){throw s.error("Could not parse message into JSON:",u.data),s.error("From chunk:",u.raw),d}if(u.event!=="ping"&&u.event==="error"){let d=wVi(u.data)??u.data,f=d?.error?.type;throw new Ov(void 0,d,void 0,e.headers,f)}}l=!0}catch(u){if(p3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*s(){let l=new Une,u=t3r(e);for await(let d of u)for(let f of l.decode(d))yield f;for(let d of l.flush())yield d}a(s,"X");async function*c(){if(o)throw new Ii("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let l=!1;try{for await(let u of s())l||u&&(yield JSON.parse(u));l=!0}catch(u){if(p3e(u))return;throw u}finally{l||r.abort()}}return a(c,"W"),new t(c,r,n)}[(NLe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=a(s=>({next:a(()=>{if(s.length===0){let c=n.next();e.push(c),r.push(c)}return s.shift()},"next")}),"Y");return[new t(()=>o(e),this.controller,gt(this,NLe,"f")),new t(()=>o(r),this.controller,gt(this,NLe,"f"))]}toReadableStream(){let e=this,r;return RVi({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:s}=await r.next();if(s)return n.close();let c=n3r(JSON.stringify(o)+` +`);n.enqueue(c)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};a(n4c,"dS");a(i4c,"iS");kBr=class{static{a(this,"Ww")}constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let s={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],s}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=o4c(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}};a(o4c,"nS");a(QVi,"P5");a(qVi,"CG");ESt=class t extends Promise{static{a(this,"Q0")}constructor(e,r,n=QVi){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,e3e.set(this,void 0),mn(this,e3e,e,"f")}_thenUnwrap(e){return new t(gt(this,e3e,"f"),this.responsePromise,async(r,n)=>qVi(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(gt(this,e3e,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};e3e=new WeakMap;_St=class{static{a(this,"TG")}constructor(e,r,n,o){L1t.set(this,void 0),mn(this,L1t,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Ii("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await gt(this,L1t,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(L1t=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},DBr=class extends ESt{static{a(this,"b5")}constructor(e,r,n){super(e,r,async(o,s)=>new n(o,s.response,await QVi(o,s),s.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},qne=class extends _St{static{a(this,"W4")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.first_id=n.first_id||null,this.last_id=n.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let r=this.first_id;return r?{...this.options,query:{...RBr(this.options.query),before_id:r}}:null}let e=this.last_id;return e?{...this.options,query:{...RBr(this.options.query),after_id:e}}:null}},jE=class extends _St{static{a(this,"D$")}constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.next_page=n.next_page||null}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){let e=this.next_page;return e?{...this.options,query:{...RBr(this.options.query),page:e}}:null}},jVi=a(()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},"yG");a(IEe,"J0");a(rSt,"XQ");HVi=a(t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function","fG"),o3r=a(async(t,e,r=!0)=>({...t,body:await a4c(t.body,e,r)}),"J8"),rGi=new WeakMap;a(s4c,"oS");a4c=a(async(t,e,r=!0)=>{if(!await s4c(e))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let n=new FormData;return await Promise.all(Object.entries(t||{}).map(([o,s])=>NBr(n,o,s,r))),n},"tS"),c4c=a(t=>t instanceof Blob&&"name"in t,"aS"),NBr=a(async(t,e,r,n)=>{if(r!==void 0){if(r==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response){let o={},s=r.headers.get("Content-Type");s&&(o={type:s}),t.append(e,IEe([await r.blob()],rSt(r,n),o))}else if(HVi(r))t.append(e,IEe([await new Response(PVi(r)).blob()],rSt(r,n)));else if(c4c(r))t.append(e,IEe([r],rSt(r,n),{type:r.type}));else if(Array.isArray(r))await Promise.all(r.map(o=>NBr(t,e+"[]",o,n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([o,s])=>NBr(t,`${e}[${o}]`,s,n)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}},"xG"),GVi=a(t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function","Uw"),l4c=a(t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&GVi(t),"sS"),u4c=a(t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function","eS");a(d4c,"_5");a(MBr,"gG");a(f4c,"$v");Ad=class{static{a(this,"t")}constructor(e){this._client=e}},$Vi=Symbol.for("brand.privateNullableHeaders");a(p4c,"Jv");mr=a(t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[s,c]of p4c(n)){let l=s.toLowerCase();o.has(l)||(e.delete(s),o.add(l)),c===null?(e.delete(s),r.add(l)):(e.append(s,c),r.delete(l))}}return{[$Vi]:!0,values:e,nulls:r}},"R");a(VVi,"qw");nGi=Object.freeze(Object.create(null)),h4c=a((t=VVi)=>function(e,...r){if(e.length===1)return e[0];let n=!1,o=[],s=e.reduce((d,f,h)=>{/[?#]/.test(f)&&(n=!0);let m=r[h],g=(n?encodeURIComponent:t)(""+m);return h!==r.length&&(m==null||typeof m=="object"&&m.toString===Object.getPrototypeOf(Object.getPrototypeOf(m.hasOwnProperty??nGi)??nGi)?.toString)&&(g=m+"",o.push({start:d.length+f.length,length:g.length,error:`Value of type ${Object.prototype.toString.call(m).slice(8,-1)} is not a valid path parameter`})),d+f+(h===r.length?"":g)},""),c=s.split(/[?#]/,1)[0],l=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,u;for(;(u=l.exec(c))!==null;)o.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(o.sort((d,f)=>d.start-f.start),o.length>0){let d=0,f=o.reduce((h,m)=>{let g=" ".repeat(m.start-d),A="^".repeat(m.length);return d=m.start+m.length,h+g+A},"");throw new Ii(`Path parameters result in path with invalid segments: ${o.map(h=>h.error).join(` `)} ${s} -${f}`)}return s},"Xv"),Gn=ELc(oWi),OSt=class extends Ad{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/environments/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/environments/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/environments/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/environments/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},v3e=Symbol("anthropic.sdk.stainlessHelper");a(ASt,"k5");a(sWi,"hG");a(aWi,"S5");a(_Lc,"Vw");BSt=class extends Ad{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",zne,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/files/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/files/${e}/content?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/files/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",x3r({body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},_Lc(o.file),r?.headers])},this._client))}},LSt=class extends Ad{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/models/${e}?beta=true`,{...n,headers:hr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",zne,{query:o,...r,headers:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},FSt=class extends Ad{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/user_profiles/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},USt=class extends Ad{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/agents/${e}/versions?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},w3e=class extends Ad{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new USt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get(Gn`/v1/agents/${e}?beta=true`,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/agents/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/agents/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};w3e.Versions=USt;QSt=class extends Ad{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post(Gn`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:hr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/memory_stores/${e}/memories?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete(Gn`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:hr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},qSt=class extends Ad{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get(Gn`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/memory_stores/${e}/memory_versions?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post(Gn`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},GEe=class extends Ad{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new QSt(this._client),this.memoryVersions=new qSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/memory_stores/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/memory_stores/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};GEe.Memories=QSt;GEe.MemoryVersions=qSt;jSt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Vne;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new xi("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new xi("Attempted to iterate over a response with no body");return new t(b3r(e.body),r)}},HSt=class extends Ad{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/messages/batches/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",zne,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/messages/batches/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new xi(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:hr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>jSt.fromResponse(l.response,l.controller))}},cWi={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(lWi,"Bw");a(AGi,"uG");a(uWi,"mG");a(CLc,"Nv");vLc=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),DEe(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),DEe(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),DEe(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),DEe(t);break;case"delimiter":return t=t.slice(0,t.length-1),DEe(t)}return t},"W8"),bLc=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),SLc=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),dWi=a(t=>JSON.parse(SLc(bLc(DEe(vLc(t))))),"C5"),_Gi="__json_buf";a(CGi,"Ow");nLr=class t{static{a(this,"ZQ")}constructor(e,r){QR.add(this),this.messages=[],this.receivedMessages=[],pV.set(this,void 0),TEe.set(this,null),this.controller=new AbortController,zLe.set(this,void 0),Z1t.set(this,()=>{}),YLe.set(this,()=>{}),KLe.set(this,void 0),X1t.set(this,()=>{}),JLe.set(this,()=>{}),i9.set(this,{}),ZLe.set(this,!1),eSt.set(this,!1),tSt.set(this,!1),Mne.set(this,!1),rSt.set(this,void 0),nSt.set(this,void 0),XLe.set(this,void 0),iSt.set(this,n=>{if(gn(this,eSt,!0,"f"),x3e(n)&&(n=new fI),n instanceof fI)return gn(this,tSt,!0,"f"),this._emit("abort",n);if(n instanceof xi)return this._emit("error",n);if(n instanceof Error){let o=new xi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new xi(String(n)))}),gn(this,zLe,new Promise((n,o)=>{gn(this,Z1t,n,"f"),gn(this,YLe,o,"f")}),"f"),gn(this,KLe,new Promise((n,o)=>{gn(this,X1t,n,"f"),gn(this,JLe,o,"f")}),"f"),ft(this,zLe,"f").catch(()=>{}),ft(this,KLe,"f").catch(()=>{}),gn(this,TEe,e,"f"),gn(this,XLe,r?.logger??console,"f")}get response(){return ft(this,rSt,"f")}get request_id(){return ft(this,nSt,"f")}async withResponse(){gn(this,Mne,!0,"f");let e=await ft(this,zLe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return gn(s,TEe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},ft(this,iSt,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ft(this,QR,"m",ABr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)ft(this,QR,"m",yBr).call(this,u);if(l.controller.signal?.aborted)throw new fI;ft(this,QR,"m",EBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(gn(this,rSt,e,"f"),gn(this,nSt,e?.headers.get("request-id"),"f"),ft(this,Z1t,"f").call(this,e),this._emit("connect"))}get ended(){return ft(this,ZLe,"f")}get errored(){return ft(this,eSt,"f")}get aborted(){return ft(this,tSt,"f")}abort(){this.controller.abort()}on(e,r){return(ft(this,i9,"f")[e]||(ft(this,i9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ft(this,i9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(ft(this,i9,"f")[e]||(ft(this,i9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{gn(this,Mne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){gn(this,Mne,!0,"f"),await ft(this,KLe,"f")}get currentMessage(){return ft(this,pV,"f")}async finalMessage(){return await this.done(),ft(this,QR,"m",gBr).call(this)}async finalText(){return await this.done(),ft(this,QR,"m",yGi).call(this)}_emit(e,...r){if(ft(this,ZLe,"f"))return;e==="end"&&(gn(this,ZLe,!0,"f"),ft(this,X1t,"f").call(this));let n=ft(this,i9,"f")[e];if(n&&(ft(this,i9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ft(this,Mne,"f")&&!n?.length&&Promise.reject(o),ft(this,YLe,"f").call(this,o),ft(this,JLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ft(this,Mne,"f")&&!n?.length&&Promise.reject(o),ft(this,YLe,"f").call(this,o),ft(this,JLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ft(this,QR,"m",gBr).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{ft(this,QR,"m",ABr).call(this),this._connected(null);let s=Wne.fromReadableStream(e,this.controller);for await(let c of s)ft(this,QR,"m",yBr).call(this,c);if(s.controller.signal?.aborted)throw new fI;ft(this,QR,"m",EBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(pV=new WeakMap,TEe=new WeakMap,zLe=new WeakMap,Z1t=new WeakMap,YLe=new WeakMap,KLe=new WeakMap,X1t=new WeakMap,JLe=new WeakMap,i9=new WeakMap,ZLe=new WeakMap,eSt=new WeakMap,tSt=new WeakMap,Mne=new WeakMap,rSt=new WeakMap,nSt=new WeakMap,XLe=new WeakMap,iSt=new WeakMap,QR=new WeakSet,gBr=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),yGi=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new xi("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),ABr=a(function(){this.ended||gn(this,pV,void 0,"f")},"cG"),yBr=a(function(e){if(this.ended)return;let r=ft(this,QR,"m",EGi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{CGi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(AGi(r,ft(this,TEe,"f"),{logger:ft(this,XLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{gn(this,pV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),EBr=a(function(){if(this.ended)throw new xi("stream has ended, this shouldn't happen");let e=ft(this,pV,"f");if(!e)throw new xi("request ended without sending any chunks");return gn(this,pV,void 0,"f"),AGi(e,ft(this,TEe,"f"),{logger:ft(this,XLe,"f")})},"dG"),EGi=a(function(e){let r=ft(this,pV,"f");if(e.type==="message_start"){if(r)throw new xi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new xi(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&CGi(n)){let o=n[_Gi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,_Gi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=dWi(o)}catch(c){let l=new xi(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);ft(this,iSt,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Wne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},GSt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},TLc=1e5,ILc=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: +${f}`)}return s},"Xv"),$n=h4c(VVi),vSt=class extends Ad{static{a(this,"YQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/environments?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/environments/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/environments?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/environments/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/environments/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},c3e=Symbol("anthropic.sdk.stainlessHelper");a(nSt,"k5");a(WVi,"hG");a(zVi,"S5");a(m4c,"Vw");CSt=class extends Ad{static{a(this,"GQ")}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/files?beta=true",qne,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}download(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}/content?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}retrieveMetadata(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/files/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"files-api-2025-04-14"].toString()},n?.headers])})}upload(e,r){let{betas:n,...o}=e;return this._client.post("/v1/files?beta=true",o3r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"files-api-2025-04-14"].toString()},m4c(o.file),r?.headers])},this._client))}},bSt=class extends Ad{static{a(this,"UQ")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}?beta=true`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models?beta=true",qne,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},SSt=class extends Ad{static{a(this,"HQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/user_profiles?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/user_profiles/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/user_profiles/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/user_profiles?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"user-profiles-2026-03-24"].toString()},r?.headers])})}createEnrollmentURL(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/user_profiles/${e}/enrollment_url?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"user-profiles-2026-03-24"].toString()},n?.headers])})}},TSt=class extends Ad{static{a(this,"KQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/agents/${e}/versions?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},h3e=class extends Ad{static{a(this,"X8")}constructor(){super(...arguments),this.versions=new TSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/agents?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o,...s}=r??{};return this._client.get($n`/v1/agents/${e}?beta=true`,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/agents/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/agents?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/agents/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};h3e.Versions=TSt;ISt=class extends Ad{static{a(this,"qQ")}create(e,r,n){let{view:o,betas:s,...c}=r;return this._client.post($n`/v1/memory_stores/${e}/memories?beta=true`,{query:{view:o},body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{memory_store_id:o,view:s,betas:c,...l}=r;return this._client.post($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{view:s},body:l,...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memories?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{memory_store_id:o,expected_content_sha256:s,betas:c}=r;return this._client.delete($n`/v1/memory_stores/${o}/memories/${e}?beta=true`,{query:{expected_content_sha256:s},...n,headers:mr([{"anthropic-beta":[...c??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},xSt=class extends Ad{static{a(this,"VQ")}retrieve(e,r,n){let{memory_store_id:o,betas:s,...c}=r;return this._client.get($n`/v1/memory_stores/${o}/memory_versions/${e}?beta=true`,{query:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/memory_stores/${e}/memory_versions?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}redact(e,r,n){let{memory_store_id:o,betas:s}=r;return this._client.post($n`/v1/memory_stores/${o}/memory_versions/${e}/redact?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},DEe=class extends Ad{static{a(this,"X0")}constructor(){super(...arguments),this.memories=new ISt(this._client),this.memoryVersions=new xSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/memory_stores?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/memory_stores/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/memory_stores?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/memory_stores/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/memory_stores/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};DEe.Memories=ISt;DEe.MemoryVersions=xSt;wSt=class t{static{a(this,"Y8")}constructor(e,r){this.iterator=e,this.controller=r}async*decoder(){let e=new Une;for await(let r of this.iterator)for(let n of e.decode(r))yield JSON.parse(n);for(let r of e.flush())yield JSON.parse(r)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse(e,r){if(!e.body)throw r.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ii("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ii("Attempted to iterate over a response with no body");return new t(t3r(e.body),r)}},RSt=class extends Ad{static{a(this,"BQ")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/messages/batches?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/messages/batches?beta=true",qne,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"message-batches-2024-09-24"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/messages/batches/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}cancel(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/messages/batches/${e}/cancel?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"message-batches-2024-09-24"].toString()},n?.headers])})}async results(e,r={},n){let o=await this.retrieve(e);if(!o.results_url)throw new Ii(`No batch \`results_url\`; Has it finished processing? ${o.processing_status} - ${o.id}`);let{betas:s}=r??{};return this._client.get(o.results_url,{...n,headers:mr([{"anthropic-beta":[...s??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},n?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((c,l)=>wSt.fromResponse(l.response,l.controller))}},YVi={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192};a(KVi,"Bw");a(iGi,"uG");a(JVi,"mG");a(g4c,"Nv");A4c=a(t=>{let e=0,r=[];for(;e{if(t.length===0)return t;let e=t[t.length-1];switch(e.type){case"separator":return t=t.slice(0,t.length-1),_Ee(t);case"number":let r=e.value[e.value.length-1];if(r==="."||r==="-")return t=t.slice(0,t.length-1),_Ee(t);case"string":let n=t[t.length-2];if(n?.type==="delimiter")return t=t.slice(0,t.length-1),_Ee(t);if(n?.type==="brace"&&n.value==="{")return t=t.slice(0,t.length-1),_Ee(t);break;case"delimiter":return t=t.slice(0,t.length-1),_Ee(t)}return t},"W8"),y4c=a(t=>{let e=[];return t.map(r=>{r.type==="brace"&&(r.value==="{"?e.push("}"):e.splice(e.lastIndexOf("}"),1)),r.type==="paren"&&(r.value==="["?e.push("]"):e.splice(e.lastIndexOf("]"),1))}),e.length>0&&e.reverse().map(r=>{r==="}"?t.push({type:"brace",value:"}"}):r==="]"&&t.push({type:"paren",value:"]"})}),t},"Ov"),E4c=a(t=>{let e="";return t.map(r=>{r.type==="string"?e+='"'+r.value+'"':e+=r.value}),e},"Dv"),ZVi=a(t=>JSON.parse(E4c(y4c(_Ee(A4c(t))))),"C5"),aGi="__json_buf";a(cGi,"Ow");OBr=class t{static{a(this,"ZQ")}constructor(e,r){LR.add(this),this.messages=[],this.receivedMessages=[],rV.set(this,void 0),pEe.set(this,null),this.controller=new AbortController,MLe.set(this,void 0),F1t.set(this,()=>{}),OLe.set(this,()=>{}),BLe.set(this,void 0),U1t.set(this,()=>{}),LLe.set(this,()=>{}),K6.set(this,{}),FLe.set(this,!1),Q1t.set(this,!1),q1t.set(this,!1),xne.set(this,!1),j1t.set(this,void 0),H1t.set(this,void 0),ULe.set(this,void 0),G1t.set(this,n=>{if(mn(this,Q1t,!0,"f"),p3e(n)&&(n=new cI),n instanceof cI)return mn(this,q1t,!0,"f"),this._emit("abort",n);if(n instanceof Ii)return this._emit("error",n);if(n instanceof Error){let o=new Ii(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ii(String(n)))}),mn(this,MLe,new Promise((n,o)=>{mn(this,F1t,n,"f"),mn(this,OLe,o,"f")}),"f"),mn(this,BLe,new Promise((n,o)=>{mn(this,U1t,n,"f"),mn(this,LLe,o,"f")}),"f"),gt(this,MLe,"f").catch(()=>{}),gt(this,BLe,"f").catch(()=>{}),mn(this,pEe,e,"f"),mn(this,ULe,r?.logger??console,"f")}get response(){return gt(this,j1t,"f")}get request_id(){return gt(this,H1t,"f")}async withResponse(){mn(this,xne,!0,"f");let e=await gt(this,MLe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return mn(s,pEe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,G1t,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,LR,"m",Y4r).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,LR,"m",K4r).call(this,u);if(l.controller.signal?.aborted)throw new cI;gt(this,LR,"m",J4r).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,j1t,e,"f"),mn(this,H1t,e?.headers.get("request-id"),"f"),gt(this,F1t,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,FLe,"f")}get errored(){return gt(this,Q1t,"f")}get aborted(){return gt(this,q1t,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,K6,"f")[e]||(gt(this,K6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,K6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,K6,"f")[e]||(gt(this,K6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,xne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,xne,!0,"f"),await gt(this,BLe,"f")}get currentMessage(){return gt(this,rV,"f")}async finalMessage(){return await this.done(),gt(this,LR,"m",z4r).call(this)}async finalText(){return await this.done(),gt(this,LR,"m",oGi).call(this)}_emit(e,...r){if(gt(this,FLe,"f"))return;e==="end"&&(mn(this,FLe,!0,"f"),gt(this,U1t,"f").call(this));let n=gt(this,K6,"f")[e];if(n&&(gt(this,K6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,xne,"f")&&!n?.length&&Promise.reject(o),gt(this,OLe,"f").call(this,o),gt(this,LLe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,xne,"f")&&!n?.length&&Promise.reject(o),gt(this,OLe,"f").call(this,o),gt(this,LLe,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,LR,"m",z4r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,LR,"m",Y4r).call(this),this._connected(null);let s=Qne.fromReadableStream(e,this.controller);for await(let c of s)gt(this,LR,"m",K4r).call(this,c);if(s.controller.signal?.aborted)throw new cI;gt(this,LR,"m",J4r).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(rV=new WeakMap,pEe=new WeakMap,MLe=new WeakMap,F1t=new WeakMap,OLe=new WeakMap,BLe=new WeakMap,U1t=new WeakMap,LLe=new WeakMap,K6=new WeakMap,FLe=new WeakMap,Q1t=new WeakMap,q1t=new WeakMap,xne=new WeakMap,j1t=new WeakMap,H1t=new WeakMap,ULe=new WeakMap,G1t=new WeakMap,LR=new WeakSet,z4r=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"lG"),oGi=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ii("stream ended without producing a content block with type=text");return e.join(" ")},"zw"),Y4r=a(function(){this.ended||mn(this,rV,void 0,"f")},"cG"),K4r=a(function(e){if(this.ended)return;let r=gt(this,LR,"m",sGi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{cGi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}case"compaction_delta":{n.type==="compaction"&&n.content&&this._emit("compaction",n.content);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(iGi(r,gt(this,pEe,"f"),{logger:gt(this,ULe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,rV,r,"f");break}case"content_block_start":case"message_delta":break}},"pG"),J4r=a(function(){if(this.ended)throw new Ii("stream has ended, this shouldn't happen");let e=gt(this,rV,"f");if(!e)throw new Ii("request ended without sending any chunks");return mn(this,rV,void 0,"f"),iGi(e,gt(this,pEe,"f"),{logger:gt(this,ULe,"f")})},"dG"),sGi=a(function(e){let r=gt(this,rV,"f");if(e.type==="message_start"){if(r)throw new Ii(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ii(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.container=e.delta.container,r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,r.context_management=e.context_management,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),e.usage.iterations!=null&&(r.usage.iterations=e.usage.iterations),r;case"content_block_start":return r.content.push(e.content_block),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&cGi(n)){let o=n[aGi]||"";o+=e.delta.partial_json;let s={...n};if(Object.defineProperty(s,aGi,{value:o,enumerable:!1,writable:!0}),o)try{s.input=ZVi(o)}catch(c){let l=new Ii(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${c}. JSON: ${o}`);gt(this,G1t,"f").call(this,l)}r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}case"compaction_delta":{n?.type==="compaction"&&(r.content[e.index]={...n,content:(n.content||"")+e.delta.content});break}default:e.delta}return r}case"content_block_stop":return r}},"Nw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Qne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},PSt=class extends Error{static{a(this,"U8")}constructor(e){let r=typeof e=="string"?e:e.map(n=>n.type==="text"?n.text:`[${n.type}]`).join(" ");super(r),this.name="ToolError",this.content=e}},_4c=1e5,v4c=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include: 1. Task Overview The user's core request and success criteria Any clarifications or constraints they specified @@ -1612,24 +1566,24 @@ User preferences or style requirements Domain-specific details that aren't obvious Any promises made to the user Be concise but complete\u2014err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task. -Wrap your summary in tags.`;a(bGi,"Lw");$St=class{static{a(this,"jQ")}constructor(e,r,n){e3e.add(this),this.client=e,IEe.set(this,!1),One.set(this,!1),bm.set(this,void 0),m1.set(this,void 0),cI.set(this,void 0),l9.set(this,void 0),hV.set(this,void 0),t3e.set(this,0),gn(this,bm,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...sWi(r.tools,r.messages)].join(", ");gn(this,m1,{...n,headers:hr([{"x-stainless-helper":o},n?.headers])},"f"),gn(this,hV,bGi(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(IEe=new WeakMap,One=new WeakMap,bm=new WeakMap,m1=new WeakMap,cI=new WeakMap,l9=new WeakMap,hV=new WeakMap,t3e=new WeakMap,e3e=new WeakSet,vGi=a(async function(){let e=ft(this,bm,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(ft(this,cI,"f")!==void 0)try{let u=await ft(this,cI,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??TLc;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:ft(this,bm,"f").params.max_tokens},{signal:ft(this,m1,"f").signal,headers:hr([ft(this,m1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new xi("Expected text response for compaction");return ft(this,bm,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(ft(this,IEe,"f"))throw new xi("Cannot iterate over a consumed stream");gn(this,IEe,!0,"f"),gn(this,One,!0,"f"),gn(this,l9,void 0,"f");try{for(;;){let r;try{if(ft(this,bm,"f").params.max_iterations&&ft(this,t3e,"f")>=ft(this,bm,"f").params.max_iterations)break;gn(this,One,!1,"f"),gn(this,l9,void 0,"f"),gn(this,t3e,(e=ft(this,t3e,"f"),e++,e),"f"),gn(this,cI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=ft(this,bm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},ft(this,m1,"f")),gn(this,cI,r.finalMessage(),"f"),ft(this,cI,"f").catch(()=>{}),yield r):(gn(this,cI,this.client.beta.messages.create({...s,stream:!1},ft(this,m1,"f")),"f"),yield ft(this,cI,"f")),!await ft(this,e3e,"m",vGi).call(this)){if(!ft(this,One,"f")){let{role:l,content:u}=await ft(this,cI,"f");ft(this,bm,"f").params.messages.push({role:l,content:u})}let c=await ft(this,e3e,"m",iLr).call(this,ft(this,bm,"f").params.messages.at(-1));if(c)ft(this,bm,"f").params.messages.push(c);else if(!ft(this,One,"f"))break}}finally{r&&r.abort()}}if(!ft(this,cI,"f"))throw new xi("ToolRunner concluded without a message from the server");ft(this,hV,"f").resolve(await ft(this,cI,"f"))}catch(r){throw gn(this,IEe,!1,"f"),ft(this,hV,"f").promise.catch(()=>{}),ft(this,hV,"f").reject(r),gn(this,hV,bGi(),"f"),r}}setMessagesParams(e){typeof e=="function"?ft(this,bm,"f").params=e(ft(this,bm,"f").params):ft(this,bm,"f").params=e,gn(this,One,!0,"f"),gn(this,l9,void 0,"f")}setRequestOptions(e){typeof e=="function"?gn(this,m1,e(ft(this,m1,"f")),"f"):gn(this,m1,{...ft(this,m1,"f"),...e},"f")}async generateToolResponse(e=ft(this,m1,"f").signal){let r=await ft(this,cI,"f")??this.params.messages.at(-1);return r?ft(this,e3e,"m",iLr).call(this,r,e):null}done(){return ft(this,hV,"f").promise}async runUntilDone(){if(!ft(this,IEe,"f"))for await(let e of this);return this.done()}get params(){return ft(this,bm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};iLr=a(async function(t,e=ft(this,m1,"f").signal){return ft(this,l9,"f")!==void 0?ft(this,l9,"f"):(gn(this,l9,xLc(ft(this,bm,"f").params,t,{...ft(this,m1,"f"),signal:e}),"f"),ft(this,l9,"f"))},"iG");a(xLc,"Fv");SGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},wLc=["claude-mythos-preview","claude-opus-4-6"],Yne=class extends Ad{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new HSt(this._client)}create(e,r){let n=TGi(e),{betas:o,...s}=n;s.model in SGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${SGi[s.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),wLc.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=cWi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=aWi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:hr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:hr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>uWi(n,e,{logger:this._client.logger??console}))}stream(e,r){return nLr.createMessage(this,e,r)}countTokens(e,r){let n=TGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:hr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new $St(this._client,e,r)}};a(TGi,"Aw");Yne.Batches=HSt;Yne.BetaToolRunner=$St;Yne.ToolError=GSt;VSt=class extends Ad{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/sessions/${e}/events?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},WSt=class extends Ad{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/sessions/${e}/resources?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete(Gn`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},$Ee=class extends Ad{static{a(this,"G0")}constructor(){super(...arguments),this.events=new VSt(this._client),this.resources=new WSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/sessions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/sessions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/sessions/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};$Ee.Events=VSt;$Ee.Resources=WSt;zSt=class extends Ad{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post(Gn`/v1/skills/${e}/versions?beta=true`,x3r({body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get(Gn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/skills/${e}/versions?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete(Gn`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},R3e=class extends Ad{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new zSt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",x3r({body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/skills/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/skills/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};R3e.Versions=zSt;YSt=class extends Ad{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList(Gn`/v1/vaults/${e}/credentials?beta=true`,$E,{query:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete(Gn`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post(Gn`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},k3e=class extends Ad{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new YSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/vaults/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post(Gn`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",$E,{query:o,...r,headers:hr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete(Gn`/v1/vaults/${e}?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post(Gn`/v1/vaults/${e}/archive?beta=true`,{...n,headers:hr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};k3e.Credentials=YSt;A1=class extends Ad{static{a(this,"G6")}constructor(){super(...arguments),this.models=new LSt(this._client),this.messages=new Yne(this._client),this.agents=new w3e(this._client),this.environments=new OSt(this._client),this.sessions=new $Ee(this._client),this.vaults=new k3e(this._client),this.memoryStores=new GEe(this._client),this.files=new BSt(this._client),this.skills=new R3e(this._client),this.userProfiles=new FSt(this._client)}};A1.Models=LSt;A1.Messages=Yne;A1.Agents=w3e;A1.Environments=OSt;A1.Sessions=$Ee;A1.Vaults=k3e;A1.MemoryStores=GEe;A1.Files=BSt;A1.Skills=R3e;A1.UserProfiles=FSt;KSt=class extends Ad{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(fWi,"Iw");a(IGi,"nG");a(pWi,"rG");a(RLc,"bv");RGi="__json_buf";a(kGi,"bw");oLr=class t{static{a(this,"CQ")}constructor(e,r){qR.add(this),this.messages=[],this.receivedMessages=[],mV.set(this,void 0),xEe.set(this,null),this.controller=new AbortController,r3e.set(this,void 0),oSt.set(this,()=>{}),n3e.set(this,()=>{}),i3e.set(this,void 0),sSt.set(this,()=>{}),o3e.set(this,()=>{}),o9.set(this,{}),s3e.set(this,!1),aSt.set(this,!1),cSt.set(this,!1),Bne.set(this,!1),lSt.set(this,void 0),uSt.set(this,void 0),a3e.set(this,void 0),CBr.set(this,n=>{if(gn(this,aSt,!0,"f"),x3e(n)&&(n=new fI),n instanceof fI)return gn(this,cSt,!0,"f"),this._emit("abort",n);if(n instanceof xi)return this._emit("error",n);if(n instanceof Error){let o=new xi(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new xi(String(n)))}),gn(this,r3e,new Promise((n,o)=>{gn(this,oSt,n,"f"),gn(this,n3e,o,"f")}),"f"),gn(this,i3e,new Promise((n,o)=>{gn(this,sSt,n,"f"),gn(this,o3e,o,"f")}),"f"),ft(this,r3e,"f").catch(()=>{}),ft(this,i3e,"f").catch(()=>{}),gn(this,xEe,e,"f"),gn(this,a3e,r?.logger??console,"f")}get response(){return ft(this,lSt,"f")}get request_id(){return ft(this,uSt,"f")}async withResponse(){gn(this,Bne,!0,"f");let e=await ft(this,r3e,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return gn(s,xEe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},ft(this,CBr,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{ft(this,qR,"m",vBr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)ft(this,qR,"m",bBr).call(this,u);if(l.controller.signal?.aborted)throw new fI;ft(this,qR,"m",SBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(gn(this,lSt,e,"f"),gn(this,uSt,e?.headers.get("request-id"),"f"),ft(this,oSt,"f").call(this,e),this._emit("connect"))}get ended(){return ft(this,s3e,"f")}get errored(){return ft(this,aSt,"f")}get aborted(){return ft(this,cSt,"f")}abort(){this.controller.abort()}on(e,r){return(ft(this,o9,"f")[e]||(ft(this,o9,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=ft(this,o9,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(ft(this,o9,"f")[e]||(ft(this,o9,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{gn(this,Bne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){gn(this,Bne,!0,"f"),await ft(this,i3e,"f")}get currentMessage(){return ft(this,mV,"f")}async finalMessage(){return await this.done(),ft(this,qR,"m",_Br).call(this)}async finalText(){return await this.done(),ft(this,qR,"m",xGi).call(this)}_emit(e,...r){if(ft(this,s3e,"f"))return;e==="end"&&(gn(this,s3e,!0,"f"),ft(this,sSt,"f").call(this));let n=ft(this,o9,"f")[e];if(n&&(ft(this,o9,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!ft(this,Bne,"f")&&!n?.length&&Promise.reject(o),ft(this,n3e,"f").call(this,o),ft(this,o3e,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!ft(this,Bne,"f")&&!n?.length&&Promise.reject(o),ft(this,n3e,"f").call(this,o),ft(this,o3e,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",ft(this,qR,"m",_Br).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{ft(this,qR,"m",vBr).call(this),this._connected(null);let s=Wne.fromReadableStream(e,this.controller);for await(let c of s)ft(this,qR,"m",bBr).call(this,c);if(s.controller.signal?.aborted)throw new fI;ft(this,qR,"m",SBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(mV=new WeakMap,xEe=new WeakMap,r3e=new WeakMap,oSt=new WeakMap,n3e=new WeakMap,i3e=new WeakMap,sSt=new WeakMap,o3e=new WeakMap,o9=new WeakMap,s3e=new WeakMap,aSt=new WeakMap,cSt=new WeakMap,Bne=new WeakMap,lSt=new WeakMap,uSt=new WeakMap,a3e=new WeakMap,CBr=new WeakMap,qR=new WeakSet,_Br=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),xGi=a(function(){if(this.receivedMessages.length===0)throw new xi("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new xi("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),vBr=a(function(){this.ended||gn(this,mV,void 0,"f")},"aG"),bBr=a(function(e){if(this.ended)return;let r=ft(this,qR,"m",wGi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{kGi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(IGi(r,ft(this,xEe,"f"),{logger:ft(this,a3e,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{gn(this,mV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),SBr=a(function(){if(this.ended)throw new xi("stream has ended, this shouldn't happen");let e=ft(this,mV,"f");if(!e)throw new xi("request ended without sending any chunks");return gn(this,mV,void 0,"f"),IGi(e,ft(this,xEe,"f"),{logger:ft(this,a3e,"f")})},"eG"),wGi=a(function(e){let r=ft(this,mV,"f");if(e.type==="message_start"){if(r)throw new xi(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new xi(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&kGi(n)){let o=n[RGi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,RGi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=dWi(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Wne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},JSt=class extends Ad{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Gn`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",zne,{query:e,...r})}delete(e,r){return this._client.delete(Gn`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post(Gn`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new xi(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:hr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>jSt.fromResponse(s.response,s.controller))}},P3e=class extends Ad{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new JSt(this._client)}create(e,r){e.model in PGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${PGi[e.model]} -Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),kLc.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=cWi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=aWi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:hr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>pWi(n,e,{logger:this._client.logger??console}))}stream(e,r){return oLr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},PGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},kLc=["claude-mythos-preview","claude-opus-4-6"];P3e.Batches=JSt;ZSt=class extends Ad{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get(Gn`/v1/models/${e}`,{...n,headers:hr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",zne,{query:o,...r,headers:hr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},PLc="\\n\\nHuman:",DLc="\\n\\nAssistant:",bp=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=Yl("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(sLr.add(this),this._requestAuthFlags=new WeakMap,ySt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:Yl("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:Yl("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&DBc())throw new xi(`It looks like you're running in a browser-like environment. +Wrap your summary in tags.`;a(uGi,"Lw");kSt=class{static{a(this,"jQ")}constructor(e,r,n){QLe.add(this),this.client=e,hEe.set(this,!1),wne.set(this,!1),Tm.set(this,void 0),c1.set(this,void 0),iI.set(this,void 0),t9.set(this,void 0),nV.set(this,void 0),qLe.set(this,0),mn(this,Tm,{params:{...r,messages:structuredClone(r.messages)}},"f");let o=["BetaToolRunner",...WVi(r.tools,r.messages)].join(", ");mn(this,c1,{...n,headers:mr([{"x-stainless-helper":o},n?.headers])},"f"),mn(this,nV,uGi(),"f"),r.compactionControl?.enabled&&console.warn('Anthropic: The `compactionControl` parameter is deprecated and will be removed in a future version. Use server-side compaction instead by passing `edits: [{ type: "compact_20260112" }]` in the params passed to `toolRunner()`. See https://platform.claude.com/docs/en/build-with-claude/compaction')}async*[(hEe=new WeakMap,wne=new WeakMap,Tm=new WeakMap,c1=new WeakMap,iI=new WeakMap,t9=new WeakMap,nV=new WeakMap,qLe=new WeakMap,QLe=new WeakSet,lGi=a(async function(){let e=gt(this,Tm,"f").params.compactionControl;if(!e||!e.enabled)return!1;let r=0;if(gt(this,iI,"f")!==void 0)try{let u=await gt(this,iI,"f");r=u.usage.input_tokens+(u.usage.cache_creation_input_tokens??0)+(u.usage.cache_read_input_tokens??0)+u.usage.output_tokens}catch{return!1}let n=e.contextTokenThreshold??_4c;if(rf.type!=="tool_use");d.length===0?c.pop():u.content=d}}let l=await this.client.beta.messages.create({model:o,messages:[...c,{role:"user",content:[{type:"text",text:s}]}],max_tokens:gt(this,Tm,"f").params.max_tokens},{signal:gt(this,c1,"f").signal,headers:mr([gt(this,c1,"f").headers,{"x-stainless-helper":"compaction"}])});if(l.content[0]?.type!=="text")throw new Ii("Expected text response for compaction");return gt(this,Tm,"f").params.messages=[{role:"user",content:l.content}],!0},"Mw"),Symbol.asyncIterator)](){var e;if(gt(this,hEe,"f"))throw new Ii("Cannot iterate over a consumed stream");mn(this,hEe,!0,"f"),mn(this,wne,!0,"f"),mn(this,t9,void 0,"f");try{for(;;){let r;try{if(gt(this,Tm,"f").params.max_iterations&>(this,qLe,"f")>=gt(this,Tm,"f").params.max_iterations)break;mn(this,wne,!1,"f"),mn(this,t9,void 0,"f"),mn(this,qLe,(e=gt(this,qLe,"f"),e++,e),"f"),mn(this,iI,void 0,"f");let{max_iterations:n,compactionControl:o,...s}=gt(this,Tm,"f").params;if(s.stream?(r=this.client.beta.messages.stream({...s},gt(this,c1,"f")),mn(this,iI,r.finalMessage(),"f"),gt(this,iI,"f").catch(()=>{}),yield r):(mn(this,iI,this.client.beta.messages.create({...s,stream:!1},gt(this,c1,"f")),"f"),yield gt(this,iI,"f")),!await gt(this,QLe,"m",lGi).call(this)){if(!gt(this,wne,"f")){let{role:l,content:u}=await gt(this,iI,"f");gt(this,Tm,"f").params.messages.push({role:l,content:u})}let c=await gt(this,QLe,"m",BBr).call(this,gt(this,Tm,"f").params.messages.at(-1));if(c)gt(this,Tm,"f").params.messages.push(c);else if(!gt(this,wne,"f"))break}}finally{r&&r.abort()}}if(!gt(this,iI,"f"))throw new Ii("ToolRunner concluded without a message from the server");gt(this,nV,"f").resolve(await gt(this,iI,"f"))}catch(r){throw mn(this,hEe,!1,"f"),gt(this,nV,"f").promise.catch(()=>{}),gt(this,nV,"f").reject(r),mn(this,nV,uGi(),"f"),r}}setMessagesParams(e){typeof e=="function"?gt(this,Tm,"f").params=e(gt(this,Tm,"f").params):gt(this,Tm,"f").params=e,mn(this,wne,!0,"f"),mn(this,t9,void 0,"f")}setRequestOptions(e){typeof e=="function"?mn(this,c1,e(gt(this,c1,"f")),"f"):mn(this,c1,{...gt(this,c1,"f"),...e},"f")}async generateToolResponse(e=gt(this,c1,"f").signal){let r=await gt(this,iI,"f")??this.params.messages.at(-1);return r?gt(this,QLe,"m",BBr).call(this,r,e):null}done(){return gt(this,nV,"f").promise}async runUntilDone(){if(!gt(this,hEe,"f"))for await(let e of this);return this.done()}get params(){return gt(this,Tm,"f").params}pushMessages(...e){this.setMessagesParams(r=>({...r,messages:[...r.messages,...e]}))}then(e,r){return this.runUntilDone().then(e,r)}};BBr=a(async function(t,e=gt(this,c1,"f").signal){return gt(this,t9,"f")!==void 0?gt(this,t9,"f"):(mn(this,t9,C4c(gt(this,Tm,"f").params,t,{...gt(this,c1,"f"),signal:e}),"f"),gt(this,t9,"f"))},"iG");a(C4c,"Fv");dGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},b4c=["claude-mythos-preview","claude-opus-4-6"],jne=class extends Ad{static{a(this,"w1")}constructor(){super(...arguments),this.batches=new RSt(this._client)}create(e,r){let n=fGi(e),{betas:o,...s}=n;s.model in dGi&&console.warn(`The model '${s.model}' is deprecated and will reach end-of-life on ${dGi[s.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),b4c.includes(s.model)&&s.thinking&&s.thinking.type==="enabled"&&console.warn(`Using Claude with ${s.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let c=this._client._options.timeout;if(!s.stream&&c==null){let u=YVi[s.model]??void 0;c=this._client.calculateNonstreamingTimeout(s.max_tokens,u)}let l=zVi(s.tools,s.messages);return this._client.post("/v1/messages?beta=true",{body:s,timeout:c??6e5,...r,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},l,r?.headers]),stream:n.stream??!1})}parse(e,r){return r={...r,headers:mr([{"anthropic-beta":[...e.betas??[],"structured-outputs-2025-12-15"].toString()},r?.headers])},this.create(e,r).then(n=>JVi(n,e,{logger:this._client.logger??console}))}stream(e,r){return OBr.createMessage(this,e,r)}countTokens(e,r){let n=fGi(e),{betas:o,...s}=n;return this._client.post("/v1/messages/count_tokens?beta=true",{body:s,...r,headers:mr([{"anthropic-beta":[...o??[],"token-counting-2024-11-01"].toString()},r?.headers])})}toolRunner(e,r){return new kSt(this._client,e,r)}};a(fGi,"Aw");jne.Batches=RSt;jne.BetaToolRunner=kSt;jne.ToolError=PSt;DSt=class extends Ad{static{a(this,"AQ")}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/events?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}send(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/events?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}stream(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}/events/stream?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers]),stream:!0})}},NSt=class extends Ad{static{a(this,"IQ")}retrieve(e,r,n){let{session_id:o,betas:s}=r;return this._client.get($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{session_id:o,betas:s,...c}=r;return this._client.post($n`/v1/sessions/${o}/resources/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/sessions/${e}/resources?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{session_id:o,betas:s}=r;return this._client.delete($n`/v1/sessions/${o}/resources/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}add(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}/resources?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},NEe=class extends Ad{static{a(this,"G0")}constructor(){super(...arguments),this.events=new DSt(this._client),this.resources=new NSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/sessions?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/sessions/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/sessions?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/sessions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/sessions/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};NEe.Events=DSt;NEe.Resources=NSt;MSt=class extends Ad{static{a(this,"RQ")}create(e,r={},n){let{betas:o,...s}=r??{};return this._client.post($n`/v1/skills/${e}/versions?beta=true`,o3r({body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])},this._client))}retrieve(e,r,n){let{skill_id:o,betas:s}=r;return this._client.get($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/skills/${e}/versions?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}delete(e,r,n){let{skill_id:o,betas:s}=r;return this._client.delete($n`/v1/skills/${o}/versions/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"skills-2025-10-02"].toString()},n?.headers])})}},m3e=class extends Ad{static{a(this,"K8")}constructor(){super(...arguments),this.versions=new MSt(this._client)}create(e={},r){let{betas:n,...o}=e??{};return this._client.post("/v1/skills?beta=true",o3r({body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])},this._client,!1))}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/skills?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"skills-2025-10-02"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/skills/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"skills-2025-10-02"].toString()},n?.headers])})}};m3e.Versions=MSt;OSt=class extends Ad{static{a(this,"PQ")}create(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}/credentials?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}retrieve(e,r,n){let{vault_id:o,betas:s}=r;return this._client.get($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{vault_id:o,betas:s,...c}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{body:c,...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e,r={},n){let{betas:o,...s}=r??{};return this._client.getAPIList($n`/v1/vaults/${e}/credentials?beta=true`,jE,{query:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}delete(e,r,n){let{vault_id:o,betas:s}=r;return this._client.delete($n`/v1/vaults/${o}/credentials/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r,n){let{vault_id:o,betas:s}=r;return this._client.post($n`/v1/vaults/${o}/credentials/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...s??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}},g3e=class extends Ad{static{a(this,"q8")}constructor(){super(...arguments),this.credentials=new OSt(this._client)}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/vaults?beta=true",{body:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}update(e,r,n){let{betas:o,...s}=r;return this._client.post($n`/v1/vaults/${e}?beta=true`,{body:s,...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/vaults?beta=true",jE,{query:o,...r,headers:mr([{"anthropic-beta":[...n??[],"managed-agents-2026-04-01"].toString()},r?.headers])})}delete(e,r={},n){let{betas:o}=r??{};return this._client.delete($n`/v1/vaults/${e}?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}archive(e,r={},n){let{betas:o}=r??{};return this._client.post($n`/v1/vaults/${e}/archive?beta=true`,{...n,headers:mr([{"anthropic-beta":[...o??[],"managed-agents-2026-04-01"].toString()},n?.headers])})}};g3e.Credentials=OSt;u1=class extends Ad{static{a(this,"G6")}constructor(){super(...arguments),this.models=new bSt(this._client),this.messages=new jne(this._client),this.agents=new h3e(this._client),this.environments=new vSt(this._client),this.sessions=new NEe(this._client),this.vaults=new g3e(this._client),this.memoryStores=new DEe(this._client),this.files=new CSt(this._client),this.skills=new m3e(this._client),this.userProfiles=new SSt(this._client)}};u1.Models=bSt;u1.Messages=jne;u1.Agents=h3e;u1.Environments=vSt;u1.Sessions=NEe;u1.Vaults=g3e;u1.MemoryStores=DEe;u1.Files=CSt;u1.Skills=m3e;u1.UserProfiles=SSt;BSt=class extends Ad{static{a(this,"V8")}create(e,r){let{betas:n,...o}=e;return this._client.post("/v1/complete",{body:o,timeout:this._client._options.timeout??6e5,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers]),stream:e.stream??!1})}};a(XVi,"Iw");a(pGi,"nG");a(eWi,"rG");a(S4c,"bv");gGi="__json_buf";a(AGi,"bw");LBr=class t{static{a(this,"CQ")}constructor(e,r){FR.add(this),this.messages=[],this.receivedMessages=[],iV.set(this,void 0),mEe.set(this,null),this.controller=new AbortController,jLe.set(this,void 0),$1t.set(this,()=>{}),HLe.set(this,()=>{}),GLe.set(this,void 0),V1t.set(this,()=>{}),$Le.set(this,()=>{}),J6.set(this,{}),VLe.set(this,!1),W1t.set(this,!1),z1t.set(this,!1),Rne.set(this,!1),Y1t.set(this,void 0),K1t.set(this,void 0),WLe.set(this,void 0),X4r.set(this,n=>{if(mn(this,W1t,!0,"f"),p3e(n)&&(n=new cI),n instanceof cI)return mn(this,z1t,!0,"f"),this._emit("abort",n);if(n instanceof Ii)return this._emit("error",n);if(n instanceof Error){let o=new Ii(n.message);return o.cause=n,this._emit("error",o)}return this._emit("error",new Ii(String(n)))}),mn(this,jLe,new Promise((n,o)=>{mn(this,$1t,n,"f"),mn(this,HLe,o,"f")}),"f"),mn(this,GLe,new Promise((n,o)=>{mn(this,V1t,n,"f"),mn(this,$Le,o,"f")}),"f"),gt(this,jLe,"f").catch(()=>{}),gt(this,GLe,"f").catch(()=>{}),mn(this,mEe,e,"f"),mn(this,WLe,r?.logger??console,"f")}get response(){return gt(this,Y1t,"f")}get request_id(){return gt(this,K1t,"f")}async withResponse(){mn(this,Rne,!0,"f");let e=await gt(this,jLe,"f");if(!e)throw Error("Could not resolve a `Response` object");return{data:this,response:e,request_id:e.headers.get("request-id")}}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createMessage(e,r,n,{logger:o}={}){let s=new t(r,{logger:o});for(let c of r.messages)s._addMessageParam(c);return mn(s,mEe,{...r,stream:!0},"f"),s._run(()=>s._createMessage(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),s}_run(e){e().then(()=>{this._emitFinal(),this._emit("end")},gt(this,X4r,"f"))}_addMessageParam(e){this.messages.push(e)}_addMessage(e,r=!0){this.receivedMessages.push(e),r&&this._emit("message",e)}async _createMessage(e,r,n){let o=n?.signal,s;o&&(o.aborted&&this.controller.abort(),s=this.controller.abort.bind(this.controller),o.addEventListener("abort",s));try{gt(this,FR,"m",eBr).call(this);let{response:c,data:l}=await e.create({...r,stream:!0},{...n,signal:this.controller.signal}).withResponse();this._connected(c);for await(let u of l)gt(this,FR,"m",tBr).call(this,u);if(l.controller.signal?.aborted)throw new cI;gt(this,FR,"m",rBr).call(this)}finally{o&&s&&o.removeEventListener("abort",s)}}_connected(e){this.ended||(mn(this,Y1t,e,"f"),mn(this,K1t,e?.headers.get("request-id"),"f"),gt(this,$1t,"f").call(this,e),this._emit("connect"))}get ended(){return gt(this,VLe,"f")}get errored(){return gt(this,W1t,"f")}get aborted(){return gt(this,z1t,"f")}abort(){this.controller.abort()}on(e,r){return(gt(this,J6,"f")[e]||(gt(this,J6,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=gt(this,J6,"f")[e];if(!n)return this;let o=n.findIndex(s=>s.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(gt(this,J6,"f")[e]||(gt(this,J6,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{mn(this,Rne,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){mn(this,Rne,!0,"f"),await gt(this,GLe,"f")}get currentMessage(){return gt(this,iV,"f")}async finalMessage(){return await this.done(),gt(this,FR,"m",Z4r).call(this)}async finalText(){return await this.done(),gt(this,FR,"m",hGi).call(this)}_emit(e,...r){if(gt(this,VLe,"f"))return;e==="end"&&(mn(this,VLe,!0,"f"),gt(this,V1t,"f").call(this));let n=gt(this,J6,"f")[e];if(n&&(gt(this,J6,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!gt(this,Rne,"f")&&!n?.length&&Promise.reject(o),gt(this,HLe,"f").call(this,o),gt(this,$Le,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!gt(this,Rne,"f")&&!n?.length&&Promise.reject(o),gt(this,HLe,"f").call(this,o),gt(this,$Le,"f").call(this,o),this._emit("end")}}_emitFinal(){this.receivedMessages.at(-1)&&this._emit("finalMessage",gt(this,FR,"m",Z4r).call(this))}async _fromReadableStream(e,r){let n=r?.signal,o;n&&(n.aborted&&this.controller.abort(),o=this.controller.abort.bind(this.controller),n.addEventListener("abort",o));try{gt(this,FR,"m",eBr).call(this),this._connected(null);let s=Qne.fromReadableStream(e,this.controller);for await(let c of s)gt(this,FR,"m",tBr).call(this,c);if(s.controller.signal?.aborted)throw new cI;gt(this,FR,"m",rBr).call(this)}finally{n&&o&&n.removeEventListener("abort",o)}}[(iV=new WeakMap,mEe=new WeakMap,jLe=new WeakMap,$1t=new WeakMap,HLe=new WeakMap,GLe=new WeakMap,V1t=new WeakMap,$Le=new WeakMap,J6=new WeakMap,VLe=new WeakMap,W1t=new WeakMap,z1t=new WeakMap,Rne=new WeakMap,Y1t=new WeakMap,K1t=new WeakMap,WLe=new WeakMap,X4r=new WeakMap,FR=new WeakSet,Z4r=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},"oG"),hGi=a(function(){if(this.receivedMessages.length===0)throw new Ii("stream ended without producing a Message with role=assistant");let e=this.receivedMessages.at(-1).content.filter(r=>r.type==="text").map(r=>r.text);if(e.length===0)throw new Ii("stream ended without producing a content block with type=text");return e.join(" ")},"Rw"),eBr=a(function(){this.ended||mn(this,iV,void 0,"f")},"aG"),tBr=a(function(e){if(this.ended)return;let r=gt(this,FR,"m",mGi).call(this,e);switch(this._emit("streamEvent",e,r),e.type){case"content_block_delta":{let n=r.content.at(-1);switch(e.delta.type){case"text_delta":{n.type==="text"&&this._emit("text",e.delta.text,n.text||"");break}case"citations_delta":{n.type==="text"&&this._emit("citation",e.delta.citation,n.citations??[]);break}case"input_json_delta":{AGi(n)&&n.input&&this._emit("inputJson",e.delta.partial_json,n.input);break}case"thinking_delta":{n.type==="thinking"&&this._emit("thinking",e.delta.thinking,n.thinking);break}case"signature_delta":{n.type==="thinking"&&this._emit("signature",n.signature);break}default:e.delta}break}case"message_stop":{this._addMessageParam(r),this._addMessage(pGi(r,gt(this,mEe,"f"),{logger:gt(this,WLe,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",r.content.at(-1));break}case"message_start":{mn(this,iV,r,"f");break}case"content_block_start":case"message_delta":break}},"sG"),rBr=a(function(){if(this.ended)throw new Ii("stream has ended, this shouldn't happen");let e=gt(this,iV,"f");if(!e)throw new Ii("request ended without sending any chunks");return mn(this,iV,void 0,"f"),pGi(e,gt(this,mEe,"f"),{logger:gt(this,WLe,"f")})},"eG"),mGi=a(function(e){let r=gt(this,iV,"f");if(e.type==="message_start"){if(r)throw new Ii(`Unexpected event order, got ${e.type} before receiving "message_stop"`);return e.message}if(!r)throw new Ii(`Unexpected event order, got ${e.type} before "message_start"`);switch(e.type){case"message_stop":return r;case"message_delta":return r.stop_reason=e.delta.stop_reason,r.stop_sequence=e.delta.stop_sequence,r.usage.output_tokens=e.usage.output_tokens,e.usage.input_tokens!=null&&(r.usage.input_tokens=e.usage.input_tokens),e.usage.cache_creation_input_tokens!=null&&(r.usage.cache_creation_input_tokens=e.usage.cache_creation_input_tokens),e.usage.cache_read_input_tokens!=null&&(r.usage.cache_read_input_tokens=e.usage.cache_read_input_tokens),e.usage.server_tool_use!=null&&(r.usage.server_tool_use=e.usage.server_tool_use),r;case"content_block_start":return r.content.push({...e.content_block}),r;case"content_block_delta":{let n=r.content.at(e.index);switch(e.delta.type){case"text_delta":{n?.type==="text"&&(r.content[e.index]={...n,text:(n.text||"")+e.delta.text});break}case"citations_delta":{n?.type==="text"&&(r.content[e.index]={...n,citations:[...n.citations??[],e.delta.citation]});break}case"input_json_delta":{if(n&&AGi(n)){let o=n[gGi]||"";o+=e.delta.partial_json;let s={...n};Object.defineProperty(s,gGi,{value:o,enumerable:!1,writable:!0}),o&&(s.input=ZVi(o)),r.content[e.index]=s}break}case"thinking_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,thinking:n.thinking+e.delta.thinking});break}case"signature_delta":{n?.type==="thinking"&&(r.content[e.index]={...n,signature:e.delta.signature});break}default:e.delta}return r}case"content_block_stop":return r}},"Pw"),Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("streamEvent",o=>{let s=r.shift();s?s.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let s of r)s.reject(o);r.length=0}),{next:a(async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((o,s)=>r.push({resolve:o,reject:s})).then(o=>o?{value:o,done:!1}:{value:void 0,done:!0}),"next"),return:a(async()=>(this.abort(),{value:void 0,done:!0}),"return")}}toReadableStream(){return new Qne(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}},LSt=class extends Ad{static{a(this,"TQ")}create(e,r){return this._client.post("/v1/messages/batches",{body:e,...r})}retrieve(e,r){return this._client.get($n`/v1/messages/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/v1/messages/batches",qne,{query:e,...r})}delete(e,r){return this._client.delete($n`/v1/messages/batches/${e}`,r)}cancel(e,r){return this._client.post($n`/v1/messages/batches/${e}/cancel`,r)}async results(e,r){let n=await this.retrieve(e);if(!n.results_url)throw new Ii(`No batch \`results_url\`; Has it finished processing? ${n.processing_status} - ${n.id}`);return this._client.get(n.results_url,{...r,headers:mr([{Accept:"application/binary"},r?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((o,s)=>wSt.fromResponse(s.response,s.controller))}},A3e=class extends Ad{static{a(this,"H0")}constructor(){super(...arguments),this.batches=new LSt(this._client)}create(e,r){e.model in yGi&&console.warn(`The model '${e.model}' is deprecated and will reach end-of-life on ${yGi[e.model]} +Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`),T4c.includes(e.model)&&e.thinking&&e.thinking.type==="enabled"&&console.warn(`Using Claude with ${e.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let n=this._client._options.timeout;if(!e.stream&&n==null){let s=YVi[e.model]??void 0;n=this._client.calculateNonstreamingTimeout(e.max_tokens,s)}let o=zVi(e.tools,e.messages);return this._client.post("/v1/messages",{body:e,timeout:n??6e5,...r,headers:mr([o,r?.headers]),stream:e.stream??!1})}parse(e,r){return this.create(e,r).then(n=>eWi(n,e,{logger:this._client.logger??console}))}stream(e,r){return LBr.createMessage(this,e,r,{logger:this._client.logger??console})}countTokens(e,r){return this._client.post("/v1/messages/count_tokens",{body:e,...r})}},yGi={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026","claude-opus-4-0":"June 15th, 2026","claude-opus-4-20250514":"June 15th, 2026","claude-sonnet-4-0":"June 15th, 2026","claude-sonnet-4-20250514":"June 15th, 2026"},T4c=["claude-mythos-preview","claude-opus-4-6"];A3e.Batches=LSt;FSt=class extends Ad{static{a(this,"z8")}retrieve(e,r={},n){let{betas:o}=r??{};return this._client.get($n`/v1/models/${e}`,{...n,headers:mr([{...o?.toString()!=null?{"anthropic-beta":o?.toString()}:void 0},n?.headers])})}list(e={},r){let{betas:n,...o}=e??{};return this._client.getAPIList("/v1/models",qne,{query:o,...r,headers:mr([{...n?.toString()!=null?{"anthropic-beta":n?.toString()}:void 0},r?.headers])})}},I4c="\\n\\nHuman:",x4c="\\n\\nAssistant:",Ip=class{static{a(this,"f$")}get credentials(){return this._authState.provider}constructor({baseURL:e=Vl("ANTHROPIC_BASE_URL"),apiKey:r,authToken:n,...o}={}){if(FBr.add(this),this._requestAuthFlags=new WeakMap,iSt.set(this,void 0),r===void 0&&(r=o.profile!=null?null:Vl("ANTHROPIC_API_KEY")??null),n===void 0&&(n=o.profile!=null?null:Vl("ANTHROPIC_AUTH_TOKEN")??null),o.profile!=null&&(o.credentials!=null||o.config!=null))throw TypeError("Pass at most one of `profile`, `credentials`, or `config`.");let s={apiKey:r,authToken:n,...o,baseURL:e||"https://api.anthropic.com"};if(!s.dangerouslyAllowBrowser&&x5c())throw new Ii(`It looks like you're running in a browser-like environment. This is disabled by default, as it risks exposing your secret API credentials to attackers. If you understand the risks and have appropriate mitigations in place, you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); -`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??w3r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=fGi(s.logLevel,"ClientOptions.logLevel",this)??fGi(Yl("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??BBc(),gn(this,ySt,FBc,"f");let l=Yl("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` -`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=ZVi(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{Ug(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Ug(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new ZBr(e,r=>{Ug(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await rLc(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new xi(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,hr([{Authorization:`Bearer ${r}`}])}return hr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return hr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return hr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return UBc(e)}getUserAgent(){return`${this.constructor.name}/JS ${_V}`}defaultIdempotencyKey(){return`stainless-node-retry-${QVi()}`}makeStatusError(e,r,n,o){return FC.generate(e,r,n,o)}buildURL(e,r,n){let o=!ft(this,sLr,"m",hWi).call(this)&&n||this.baseURL,s=wBc(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!iGi(c)||!iGi(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new xi("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(PSt)||o.append("anthropic-beta",PSt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new NSt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(Ug(this).debug(`[${d}] sending request`,Fne({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new fI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(YBr),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new fI;let v=x3e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Ug(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Ug(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,Fne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Ug(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Ug(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,Fne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new vSt:new HEe({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await LBc(g.body),Ug(this).info(`${E} - ${R}`),Ug(this).debug(`[${d}] response error (${R})`,Fne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";Ug(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>YBr(R).message),T=qVi(b),w=T?void 0:b;throw Ug(this).debug(`[${d}] response error (${v})`,Fne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return Ug(this).info(E),Ug(this).debug(`[${d}] response start`,Fne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new eLr(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await PBc(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new xi("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&kBc("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=hr([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...v3r(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=hr([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:HVi(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:ft(this,ySt,"f").call(this,{body:e,headers:n})}};w3r=bp,ySt=new WeakMap,sLr=new WeakSet,hWi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");bp.Anthropic=w3r;bp.HUMAN_PROMPT=PLc;bp.AI_PROMPT=DLc;bp.DEFAULT_TIMEOUT=6e5;bp.AnthropicError=xi;bp.APIError=FC;bp.APIConnectionError=HEe;bp.APIConnectionTimeoutError=vSt;bp.APIUserAbortError=fI;bp.NotFoundError=ISt;bp.ConflictError=xSt;bp.RateLimitError=RSt;bp.BadRequestError=bSt;bp.AuthenticationError=SSt;bp.InternalServerError=kSt;bp.PermissionDeniedError=TSt;bp.UnprocessableEntityError=wSt;bp.toFile=gLc;VEe=class extends bp{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new KSt(this),this.messages=new P3e(this),this.models=new ZSt(this),this.beta=new A1(this)}};VEe.Completions=KSt;VEe.Messages=P3e;VEe.Models=ZSt;VEe.Beta=A1;a(nFe,"j4");a(ESt,"N8");a(pI,"o$");a(iFe,"D1");a(mWi,"JU");a(NLc,"Tw");MLc=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),OLc=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(BLc,"xw");cLr=class{static{a(this,"gw")}read(e){return(0,Qg.readFile)(e,"utf8")}readBytes(e){return(0,Qg.readFile)(e)}write(e,r,n){return(0,Qg.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,Qg.mkdir)(e,{recursive:!0})}catch(r){if(pI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return BLc(e,r,n)}delete(e){return(0,Qg.unlink)(e)}list(e){return(0,Qg.readdir)(e)}append(e,r,n){return(0,Qg.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,Qg.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,Qg.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,Qg.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,Qg.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},LLc=new AWi.AsyncLocalStorage;a(XSt,"w8");wEe=null;a(EWi,"uw");a(FLc,"mw");a(jR,"L6");a(ULc,"dv");QLc=ULc;a(qLc,"iv");jLc=qLc;a(HLc,"nv");GLc=HLc;a($Lc,"rv");VLc=$Lc,WLc=200;a(zLc,"tv");YLc=zLc;a(A_e,"D8");A_e.prototype.clear=QLc;A_e.prototype.delete=jLc;A_e.prototype.get=GLc;A_e.prototype.has=VLc;A_e.prototype.set=YLc;KLc=A_e,JLc=(function(){try{var t=E3r(Object,"defineProperty");return t({},"",{}),t}catch{}})(),eTt=JLc;a(ZLc,"sv");R3r=ZLc,XLc=Object.prototype,e3c=XLc.hasOwnProperty;a(t3c,"QC");_Wi=t3c;a(r3c,"JC");n3c=r3c;a(i3c,"XC");o3c=i3c;a(s3c,"YC");y_e=s3c,a3c="[object Arguments]";a(c3c,"GC");DGi=c3c,CWi=Object.prototype,l3c=CWi.hasOwnProperty,u3c=CWi.propertyIsEnumerable,d3c=DGi((function(){return arguments})())?DGi:function(t){return y_e(t)&&l3c.call(t,"callee")&&!u3c.call(t,"callee")},D3e=d3c,f3c=Array.isArray,IV=f3c,m3e={};pB(m3e,{default:a(()=>k3r,"default")});a(p3c,"VC");h3c=p3c,vWi=typeof m3e=="object"&&m3e&&!m3e.nodeType&&m3e,NGi=vWi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,m3c=NGi&&NGi.exports===vWi,MGi=m3c?f_e.Buffer:void 0,g3c=MGi?MGi.isBuffer:void 0,A3c=g3c||h3c,k3r=A3c,y3c=9007199254740991,E3c=/^(?:0|[1-9]\d*)$/;a(_3c,"DC");XTt=_3c,C3c=9007199254740991;a(v3c,"ZC");P3r=v3c,b3c="[object Arguments]",S3c="[object Array]",T3c="[object Boolean]",I3c="[object Date]",x3c="[object Error]",w3c="[object Function]",R3c="[object Map]",k3c="[object Number]",P3c="[object Object]",D3c="[object RegExp]",N3c="[object Set]",M3c="[object String]",O3c="[object WeakMap]",B3c="[object ArrayBuffer]",L3c="[object DataView]",F3c="[object Float32Array]",U3c="[object Float64Array]",Q3c="[object Int8Array]",q3c="[object Int16Array]",j3c="[object Int32Array]",H3c="[object Uint8Array]",G3c="[object Uint8ClampedArray]",$3c="[object Uint16Array]",V3c="[object Uint32Array]",md={};md[F3c]=md[U3c]=md[Q3c]=md[q3c]=md[j3c]=md[H3c]=md[G3c]=md[$3c]=md[V3c]=!0;md[b3c]=md[S3c]=md[B3c]=md[T3c]=md[L3c]=md[I3c]=md[x3c]=md[w3c]=md[R3c]=md[k3c]=md[P3c]=md[D3c]=md[N3c]=md[M3c]=md[O3c]=!1;a(W3c,"pC");z3c=W3c;a(Y3c,"dC");K3c=Y3c,g3e={};pB(g3e,{default:a(()=>lLr,"default")});bWi=typeof g3e=="object"&&g3e&&!g3e.nodeType&&g3e,b3e=bWi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,J3c=b3e&&b3e.exports===bWi,TBr=J3c&&OVi.process,Z3c=(function(){try{var t=b3e&&b3e.require&&b3e.require("util").types;return t||TBr&&TBr.binding&&TBr.binding("util")}catch{}})(),lLr=Z3c,OGi=lLr&&lLr.isTypedArray,X3c=OGi?K3c(OGi):z3c,SWi=X3c,eFc=Object.prototype,tFc=eFc.hasOwnProperty;a(rFc,"aC");nFc=rFc,iFc=Object.prototype;a(oFc,"eC");TWi=oFc;a(sFc,"$T");aFc=sFc;a(cFc,"QT");D3r=cFc;a(lFc,"JT");uFc=lFc,dFc=Object.prototype,fFc=dFc.hasOwnProperty;a(pFc,"WT");hFc=pFc;a(mFc,"GT");IWi=mFc,A3e={};pB(A3e,{default:a(()=>wWi,"default")});xWi=typeof A3e=="object"&&A3e&&!A3e.nodeType&&A3e,BGi=xWi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,gFc=BGi&&BGi.exports===xWi,LGi=gFc?f_e.Buffer:void 0,FGi=LGi?LGi.allocUnsafe:void 0;a(AFc,"HT");wWi=AFc;a(yFc,"KT");EFc=yFc;a(_Fc,"qT");CFc=_Fc,vFc=aFc(Object.getPrototypeOf,Object),RWi=vFc,bFc=f_e.Uint8Array,UGi=bFc;a(SFc,"zT");TFc=SFc;a(IFc,"NT");xFc=IFc,QGi=Object.create,wFc=(function(){function t(){}return a(t,"$"),function(e){if(!p9(e))return{};if(QGi)return QGi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),RFc=wFc;a(kFc,"OT");PFc=kFc,DFc="[object Symbol]";a(NFc,"FT");N3r=NFc,MFc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OFc=/^\w*$/;a(BFc,"LT");LFc=BFc,FFc=500;a(UFc,"AT");QFc=UFc,qFc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jFc=/\\(\\)?/g,HFc=QFc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(qFc,function(r,n,o,s){e.push(o?s.replace(jFc,"$1"):n||r)}),e}),GFc=HFc;a($Fc,"ET");VFc=$Fc,WFc=1/0,qGi=TV?TV.prototype:void 0,jGi=qGi?qGi.toString:void 0;a(kWi,"PO");zFc=kWi;a(YFc,"_T");KFc=YFc;a(JFc,"kT");eIt=JFc,ZFc=1/0;a(XFc,"vT");M3r=XFc;a(e8c,"CT");t8c=e8c;a(r8c,"TT");n8c=r8c;a(i8c,"xT");o8c=i8c;a(s8c,"yT");a8c=s8c;a(c8c,"fT");PWi=c8c,O3r=null;a(l8c,"CO");a(u8c,"TO");rTt=new Map;a(d8c,"xO");a(f8c,"yO");B3r=new Map;a(h8c,"fO");a(m8c,"gO");a(L3r,"V0");a(A8c,"hO");a(y8c,"uO");E8c={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(_8c,"lT");C8c=_8c(),v8c=a(()=>{},"pT");a(NWi,"VU");b8c=tFe(),$4h=b8c.subscribe,S8c=tFe(),V4h=S8c.subscribe,T8c=tFe(),W4h=T8c.subscribe,I8c=tFe(),z4h=I8c.subscribe,x8c=tFe(),Y4h=x8c.subscribe;a(w8c,"lO");a(R8c,"tT");dLr=class{static{a(this,"cO")}#e=new Set;register(e){let r=R8c(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},k8c=new dLr;a(P8c,"pO");D8c=uy(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(N8c,"sT");a(M8c,"eT");a(O8c,"iO");a(B8c,"tO");a(L8c,"Qx");a(HGi,"oO");a(F8c,"aO");a(OWi,"HX");U8c={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=Vd(e,zd`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},async stat(t){return(0,xm.stat)(t)},async readdir(t){return(0,xm.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,xm.unlink)(t)},async rmdir(t){return(0,xm.rmdir)(t)},async rm(t,e){return(0,xm.rm)(t,e)},async mkdir(t,e){try{await(0,xm.mkdir)(t,{recursive:!0,...e})}catch(r){if(pI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,xm.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,xm.rename)(t,e)},statSync(t){let e=[];try{let o=Vd(e,zd`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},lstatSync(t){let e=[];try{let o=Vd(e,zd`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readFileSync(t,e){let r=[];try{let s=Vd(r,zd`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=Vd(e,zd`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readSync(t,e){let r=[];try{let s=Vd(r,zd`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=Vd(n,zd`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(pI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{Wd(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=Vd(r,zd`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},unlinkSync(t){let e=[];try{let o=Vd(e,zd`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},renameSync(t,e){let r=[];try{let s=Vd(r,zd`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},linkSync(t,e){let r=[];try{let s=Vd(r,zd`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=Vd(n,zd`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{Wd(n,o,s)}},readlinkSync(t){let e=[];try{let o=Vd(e,zd`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},realpathSync(t){let e=[];try{let o=Vd(e,zd`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=Vd(r,zd`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(pI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},readdirSync(t){let e=[];try{let o=Vd(e,zd`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},readdirStringSync(t){let e=[];try{let o=Vd(e,zd`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=Vd(e,zd`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},rmdirSync(t){let e=[];try{let o=Vd(e,zd`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{Wd(e,r,n)}},rmSync(t,e){let r=[];try{let s=Vd(r,zd`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,xm.readFile)(t);let r=await(0,xm.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${W8c}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],VGi=null;a(Y8c,"Ox");a(K8c,"W2");fLr={verbose:0,debug:1,info:2,warn:3,error:4},J8c=uy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(fLr,t)?t:"debug"}),Z8c=!1;a(tIt,"qX");pLr=uy(()=>{let t=tIt();return Z8c||HE(process.env.DEBUG)||HE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||BWi()||t.some(e=>e.startsWith("--debug="))||LWi()!==null}),X8c=uy(()=>{let t=tIt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return D8c(e)}),BWi=uy(()=>{let t=tIt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),LWi=uy(()=>{let t=tIt();for(let e=0;e{try{let t=QWi(),e=(0,eie.dirname)(t),r=(0,eie.join)(e,"latest");await(0,VE.unlink)(r).catch(()=>{}),await(0,VE.symlink)(t,r)}catch{}}),Z4h=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),o6c={[Symbol.dispose](){}};a(s6c,"_x");zd=s6c;a(I0,"B$");hN=a((t,e)=>{let r=[];try{let s=Vd(r,zd`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{Wd(r,n,o)}},"d$");a(a6c,"w2");a(xV,"A4");a(c6c,"kx");a(l6c,"O2");u6c=2e3,nTt=new Set,WGi=!1;a(d6c,"xx");a(f6c,"yx");gLr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=WBr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||WBr(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(nFe(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return MVi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=HE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,kVi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(HE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();jR(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:k=[],tools:D,mcpServers:N,strictMcpConfig:L,canUseTool:B,includePartialMessages:Q,plugins:M,sandbox:O}=this.options,{allowedTools:q=[]}=this.options;if(x!==void 0){let j=x==="all"?["Skill"]:x.map(ie=>`Skill(${ie})`),X=new Set(q);q=[...q,...j.filter(ie=>!X.has(ie))]}let F=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?F.push("--thinking","adaptive"):F.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":F.push("--thinking","disabled");break;case"adaptive":F.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&F.push("--thinking-display",f.display)}if(this.options.effort&&F.push("--effort",this.options.effort),h&&F.push("--max-turns",h.toString()),m!==void 0&&F.push("--max-budget-usd",m.toString()),g&&F.push("--task-budget",g.total.toString()),A&&F.push("--model",A),r&&F.push("--agent",r),n&&n.length>0&&F.push("--betas",n.join(",")),E&&F.push("--json-schema",I0(E)),this.options.debugFile?F.push("--debug-file",this.options.debugFile):this.options.debug&&F.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let j=FLc();j&&F.push("--debug-file",j)}if(B){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");F.push("--permission-prompt-tool","stdio")}else b&&F.push("--permission-prompt-tool",b);if(T&&F.push("--continue"),w&&F.push("--resume",w),this.options.assistant&&F.push("--assistant"),this.options.channels&&this.options.channels.length>0&&F.push("--channels",...this.options.channels),q.length>0&&F.push("--allowedTools",q.join(",")),k.length>0&&F.push("--disallowedTools",k.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?F.push("--tools",""):F.push("--tools",D.join(",")):F.push("--tools","default")),N&&Object.keys(N).length>0&&F.push("--mcp-config",I0({mcpServers:N})),R!==void 0&&F.push(`--setting-sources=${R.join(",")}`),L&&F.push("--strict-mcp-config"),_&&F.push("--permission-mode",_),v&&F.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");F.push("--fallback-model",y)}this.options.includeHookEvents&&F.push("--include-hook-events"),Q&&F.push("--include-partial-messages"),this.options.sessionMirror&&F.push("--session-mirror");for(let j of e)F.push("--add-dir",j);if(M&&M.length>0)for(let j of M)if(j.type==="local")F.push("--plugin-dir",j.path);else throw Error(`Unsupported plugin type: ${j.type}`);this.options.forkSession&&F.push("--fork-session"),this.options.resumeSessionAt&&F.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&F.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&F.push("--no-session-persistence"),this.options.managedSettings&&F.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let W=l6c(U,O);for(let[j,X]of Object.entries(W))X===null?F.push(`--${j}`):F.push(`--${j}`,X);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,HE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let V=p6c(u),G=V?u:s,Y=V?[...c,...F]:[...c,u,...F],re={command:G,args:Y,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(jR(`Spawning Claude Code (custom): ${G} ${Y.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(re)):(jR(`Spawning Claude Code: ${G} ${Y.join(" ")}`),this.process=this.spawnLocalProcess(re)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,f6c(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",j=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new g1("Claude Code process aborted by user");else if(NLc(j)){let X=h6c(u,V);this.exitError=ReferenceError(X),jR(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${j.message}`),jR(this.exitError.message)}),this.process.on("exit",(j,X)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new g1("Claude Code process aborted by user");else{let ie=this.getProcessExitError(j,X);ie&&(this.exitError=ie,jR(ie.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new g1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){jR("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);jR(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||jR("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${ESt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new g1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},u6c,r,e).unref(),r.once("exit",()=>nTt.delete(r))):r&&(nTt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,DVi.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=hN(n)}catch{jR(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new g1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(p6c,"fx");a(h6c,"gx");REe="@anthropic-ai/claude-agent-sdk";a(m6c,"ux");a(g6c,"F2");iTt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(A6c,"mx");y6c=A6c();a(F3r,"BX");a(HWi,"AU");a(GWi,"IU");a(E6c,"Z2");a(s9,"I4");ALr=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},yLr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new iTt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,tTt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(Kl("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof g1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Kl(`[Query.readMessages] Replacing exit error with result text. Original: ${ESt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(I0(o)+` -`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:ESt(n)}};try{await Promise.resolve(this.transport.write(I0(o)+` -`))}catch(s){Kl(`[Query.handleControlRequest] Error-response write failed: ${ESt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return s9("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return s9("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return s9("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return s9("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return s9("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write(I0(n)+` -`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return s9("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return s9("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return s9("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return s9("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){Kl("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,Kl(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(I0(n)+` -`))}Kl(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Kl("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Kl("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof g1))throw r}}waitForFirstResult(){return this.firstResultReceived?(Kl("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new ALr(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),Kl(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,tTt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(I0(n)+` -`)).catch(o=>{Kl(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},U3r=500,Q3r=1048576,_6c=[200,800],ELr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=U3r,s=Q3r,c=_6c){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=I0(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await Qne(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=nFe(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await RVi(f)}if(l){Kl(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){Kl(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},zGi=l3r(jOc(),1);a(C6c,"Ug");a(S3e,"O0");a(v6c,"qg");wBr=new Map,b6c=5e3;a(S6c,"Bg");a(T6c,"zg");a(I6c,"OZ");x6c=(0,zWi.promisify)(WWi.execFile);a(oFe,"m4");a(w6c,"jH");u9=65536,R6c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(uh,"L$");a(JWi,"ZZ");a(RBr,"IX");a(HR,"A6");a(CLr,"rQ");a(ZWi,"RX");a(k6c,"MZ");a(XWi,"PX");N3e=200;a(P6c,"Lg");a(sFe,"F0");a(PV,"U4");a(D6c,"jg");a(aFe,"M1");a(aN,"j6");a(rIt,"L1");N6c=1048576,M6c=5242880;a(B6c,"Rg");a(ezi,"jZ");a(Hne,"D0");a(oTt,"jX");sTt=Buffer.from('{"type":"attribution-snapshot"'),L6c=Buffer.from('{"type":"system"'),M3e=10,F6c=Buffer.from([M3e]),U6c=256;a(Q6c,"_g");a(q6c,"kg");a(j6c,"Sg");a(H6c,"vg");a(G6c,"Cg");a($6c,"AZ");a(V6c,"xg");a(W6c,"yg");a(z6c,"fg");a(kBr,"IH");a(Y6c,"gg");a(K6c,"hg");a(J6c,"ug");a(tzi,"RH");a(rzi,"PH");a(Z6c,"IZ");a(nzi,"RZ");a(X6c,"PZ");a(nIt,"k8");a(y3e,"oQ");a(izi,"EZ");e9c=32;a(t9c,"pg");a(r9c,"dg");a(n9c,"ig");a(i9c,"ng");a(o9c,"rg");a(s9c,"bZ");a(a9c,"_Z");a(c9c,"CZ");a(l9c,"TZ");a(u9c,"xZ");a(d9c,"ag");a(ozi,"yZ");a(PBr,"_H");a(f9c,"sg");p9c=new Set(["user","assistant","attachment","system","progress"]);a(h9c,"$h");a(m9c,"Qh");a(szi,"fZ");a(g9c,"gZ");a(A9c,"Jh");a(y9c,"hZ");a(E9c,"Xh");a(azi,"uZ");a(czi,"lZ");a(lzi,"cZ");a(_9c,"Wh");a(C9c,"Gh");a(v9c,"pZ");a(b9c,"dZ");a(uzi,"vH");a(pzi,"CH");a(hzi,"bX");a(S9c,"Uh");T9c="user:inference",mzi="user:profile",I9c="org:create_api_key",x9c=[I9c,mzi],w9c=[mzi,T9c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],eBh=hzi([...x9c,...w9c]),YGi={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},R9c=void 0;a(k9c,"zh");P9c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(D9c,"rZ");N9c="-credentials";a(M9c,"tZ");O9c=/^[a-zA-Z0-9._-]+$/;a(B9c,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(lc||(lc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(KGi||(KGi={}));Rn=lc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),yV=a(t=>{switch(typeof t){case"undefined":return Rn.undefined;case"string":return Rn.string;case"number":return Number.isNaN(t)?Rn.nan:Rn.number;case"boolean":return Rn.boolean;case"function":return Rn.function;case"bigint":return Rn.bigint;case"symbol":return Rn.symbol;case"object":return Array.isArray(t)?Rn.array:t===null?Rn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Rn.promise:typeof Map<"u"&&t instanceof Map?Rn.map:typeof Set<"u"&&t instanceof Set?Rn.set:typeof Date<"u"&&t instanceof Date?Rn.date:Rn.object;default:return Rn.unknown}},"l4"),pr=lc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),WR=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};WR.create=t=>new WR(t);L9c=a((t,e)=>{let r;switch(t.code){case pr.invalid_type:t.received===Rn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case pr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,lc.jsonStringifyReplacer)}`;break;case pr.unrecognized_keys:r=`Unrecognized key(s) in object: ${lc.joinValues(t.keys,", ")}`;break;case pr.invalid_union:r="Invalid input";break;case pr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${lc.joinValues(t.options)}`;break;case pr.invalid_enum_value:r=`Invalid enum value. Expected ${lc.joinValues(t.options)}, received '${t.received}'`;break;case pr.invalid_arguments:r="Invalid function arguments";break;case pr.invalid_return_type:r="Invalid function return type";break;case pr.invalid_date:r="Invalid date";break;case pr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:lc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case pr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case pr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case pr.custom:r="Invalid input";break;case pr.invalid_intersection_types:r="Intersection results could not be merged";break;case pr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case pr.not_finite:r="Number must be finite";break;default:r=e.defaultError,lc.assertNever(t)}return{message:r}},"Fh"),B3e=L9c,F9c=B3e;a(bLr,"tQ");SLr=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(ln,"f");UC=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return to;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return to;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},to=Object.freeze({status:"aborted"}),_3e=a(t=>({status:"dirty",value:t}),"v8"),y1=a(t=>({status:"valid",value:t}),"z6"),JGi=a(t=>t.status==="aborted","TH"),ZGi=a(t=>t.status==="dirty","xH"),zEe=a(t=>t.status==="valid","Z0"),lTt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Kn||(Kn={}));YR=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},XGi=a((t,e)=>{if(zEe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new WR(t.common.issues);return this._error=r,this._error}}},"eZ");a(Yo,"e");ks=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return yV(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:yV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new UC,ctx:{common:e.parent.common,data:e.data,parsedType:yV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(lTt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yV(e)},o=this._parseSync({data:e,path:n.path,parent:n});return XGi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yV(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return zEe(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>zEe(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yV(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(lTt(o)?o:Promise.resolve(o));return XGi(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:pr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new uN({schema:this,typeName:vr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return zR.create(this,this._def)}nullable(){return m9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wV.create(this)}promise(){return Kne.create(this,this._def)}or(e){return ZEe.create([this,e],this._def)}and(e){return XEe.create(this,e,this._def)}transform(e){return new uN({...Yo(this._def),schema:this,typeName:vr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new i_e({...Yo(this._def),innerType:this,defaultValue:r,typeName:vr.ZodDefault})}brand(){return new uTt({typeName:vr.ZodBranded,type:this,...Yo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new o_e({...Yo(this._def),innerType:this,catchValue:r,typeName:vr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return dTt.create(this,e)}readonly(){return s_e.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},U9c=/^c[^\s-]{8,}$/i,Q9c=/^[0-9a-z]+$/,q9c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,j9c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,H9c=/^[a-z0-9_-]{21}$/i,G9c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$9c=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,V9c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W9c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",z9c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Y9c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,K9c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,J9c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z9c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,X9c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gzi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",eUc=new RegExp(`^${gzi}$`);a(Azi,"QM");a(tUc,"yh");a(rUc,"fh");a(nUc,"gh");a(iUc,"hh");a(oUc,"uh");YEe=class t extends ks{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Rn.string){let o=this._getOrReturnCtx(e);return ln(o,{code:pr.invalid_type,expected:Rn.string,received:o.parsedType}),to}let r=new UC,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:pr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:pr.invalid_string,...Kn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Kn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Kn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Kn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Kn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Kn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Kn.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Kn.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Kn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Kn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Kn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Kn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Kn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Kn.errToObj(r)})}nonempty(e){return this.min(1,Kn.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew YEe({checks:[],typeName:vr.ZodString,coerce:t?.coerce??!1,...Yo(t)});a(sUc,"mh");L3e=class t extends ks{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Rn.number){let o=this._getOrReturnCtx(e);return ln(o,{code:pr.invalid_type,expected:Rn.number,received:o.parsedType}),to}let r,n=new UC;for(let o of this._def.checks)o.kind==="int"?lc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?sUc(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.not_finite,message:o.message}),n.dirty()):lc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Kn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kn.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&lc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew L3e({checks:[],typeName:vr.ZodNumber,coerce:t?.coerce||!1,...Yo(t)});F3e=class t extends ks{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Rn.bigint)return this._getInvalidInput(e);let r,n=new UC;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ln(r,{code:pr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):lc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.bigint,received:r.parsedType}),to}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew F3e({checks:[],typeName:vr.ZodBigInt,coerce:t?.coerce??!1,...Yo(t)});U3e=class extends ks{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Rn.boolean){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.boolean,received:r.parsedType}),to}return y1(e.data)}};U3e.create=t=>new U3e({typeName:vr.ZodBoolean,coerce:t?.coerce||!1,...Yo(t)});Q3e=class t extends ks{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Rn.date){let o=this._getOrReturnCtx(e);return ln(o,{code:pr.invalid_type,expected:Rn.date,received:o.parsedType}),to}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ln(o,{code:pr.invalid_date}),to}let r=new UC,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:pr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):lc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew Q3e({checks:[],coerce:t?.coerce||!1,typeName:vr.ZodDate,...Yo(t)});q3e=class extends ks{static{a(this,"SX")}_parse(e){if(this._getType(e)!==Rn.symbol){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.symbol,received:r.parsedType}),to}return y1(e.data)}};q3e.create=t=>new q3e({typeName:vr.ZodSymbol,...Yo(t)});KEe=class extends ks{static{a(this,"$7")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.undefined,received:r.parsedType}),to}return y1(e.data)}};KEe.create=t=>new KEe({typeName:vr.ZodUndefined,...Yo(t)});JEe=class extends ks{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==Rn.null){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.null,received:r.parsedType}),to}return y1(e.data)}};JEe.create=t=>new JEe({typeName:vr.ZodNull,...Yo(t)});j3e=class extends ks{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return y1(e.data)}};j3e.create=t=>new j3e({typeName:vr.ZodAny,...Yo(t)});SV=class extends ks{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return y1(e.data)}};SV.create=t=>new SV({typeName:vr.ZodUnknown,...Yo(t)});dB=class extends ks{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.never,received:r.parsedType}),to}};dB.create=t=>new dB({typeName:vr.ZodNever,...Yo(t)});H3e=class extends ks{static{a(this,"CX")}_parse(e){if(this._getType(e)!==Rn.undefined){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.void,received:r.parsedType}),to}return y1(e.data)}};H3e.create=t=>new H3e({typeName:vr.ZodVoid,...Yo(t)});wV=class t extends ks{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==Rn.array)return ln(r,{code:pr.invalid_type,expected:Rn.array,received:r.parsedType}),to;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(ln(r,{code:pr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new YR(r,c,r.path,l)))).then(c=>UC.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new YR(r,c,r.path,l)));return UC.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Kn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Kn.toString(r)}})}nonempty(e){return this.min(1,e)}};wV.create=(t,e)=>new wV({type:t,minLength:null,maxLength:null,exactLength:null,typeName:vr.ZodArray,...Yo(e)});a(NEe,"C8");mI=class t extends ks{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=lc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==Rn.object){let u=this._getOrReturnCtx(e);return ln(u,{code:pr.invalid_type,expected:Rn.object,received:u.parsedType}),to}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof dB&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new YR(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof dB){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(ln(n,{code:pr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new YR(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>UC.mergeObjectSync(r,u)):UC.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Kn.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:vr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of lc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of lc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return NEe(this)}partial(e){let r={};for(let n of lc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of lc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof zR;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return yzi(lc.objectKeys(this.shape))}};mI.create=(t,e)=>new mI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});mI.strictCreate=(t,e)=>new mI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});mI.lazycreate=(t,e)=>new mI({shape:t,unknownKeys:"strip",catchall:dB.create(),typeName:vr.ZodObject,...Yo(e)});ZEe=class extends ks{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new WR(l.ctx.common.issues));return ln(r,{code:pr.invalid_union,unionErrors:c}),to}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new WR(u));return ln(r,{code:pr.invalid_union,unionErrors:l}),to}}get options(){return this._def.options}};ZEe.create=(t,e)=>new ZEe({options:t,typeName:vr.ZodUnion,...Yo(e)});a9=a(t=>t instanceof e_e?a9(t.schema):t instanceof uN?a9(t.innerType()):t instanceof t_e?[t.value]:t instanceof r_e?t.options:t instanceof n_e?lc.objectValues(t.enum):t instanceof i_e?a9(t._def.innerType):t instanceof KEe?[void 0]:t instanceof JEe?[null]:t instanceof zR?[void 0,...a9(t.unwrap())]:t instanceof m9?[null,...a9(t.unwrap())]:t instanceof uTt||t instanceof s_e?a9(t.unwrap()):t instanceof o_e?a9(t._def.innerType):[],"c4"),TLr=class t extends ks{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.object)return ln(r,{code:pr.invalid_type,expected:Rn.object,received:r.parsedType}),to;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ln(r,{code:pr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),to)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=a9(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:vr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Yo(n)})}};a(ILr,"fH");XEe=class extends ks{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(JGi(s)||JGi(c))return to;let l=ILr(s.value,c.value);return l.valid?((ZGi(s)||ZGi(c))&&r.dirty(),{status:r.value,value:l.data}):(ln(n,{code:pr.invalid_intersection_types}),to)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};XEe.create=(t,e,r)=>new XEe({left:t,right:e,typeName:vr.ZodIntersection,...Yo(r)});h9=class t extends ks{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.array)return ln(n,{code:pr.invalid_type,expected:Rn.array,received:n.parsedType}),to;if(n.data.lengththis._def.items.length&&(ln(n,{code:pr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new YR(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>UC.mergeArray(r,s)):UC.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};h9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new h9({items:t,typeName:vr.ZodTuple,rest:null,...Yo(e)})};xLr=class t extends ks{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.object)return ln(n,{code:pr.invalid_type,expected:Rn.object,received:n.parsedType}),to;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new YR(n,l,n.path,l)),value:c._parse(new YR(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?UC.mergeObjectAsync(r,o):UC.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ks?new t({keyType:e,valueType:r,typeName:vr.ZodRecord,...Yo(n)}):new t({keyType:YEe.create(),valueType:e,typeName:vr.ZodRecord,...Yo(r)})}},G3e=class extends ks{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.map)return ln(n,{code:pr.invalid_type,expected:Rn.map,received:n.parsedType}),to;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new YR(n,l,n.path,[d,"key"])),value:s._parse(new YR(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return to;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return to;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};G3e.create=(t,e,r)=>new G3e({valueType:e,keyType:t,typeName:vr.ZodMap,...Yo(r)});$3e=class t extends ks{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==Rn.set)return ln(n,{code:pr.invalid_type,expected:Rn.set,received:n.parsedType}),to;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ln(n,{code:pr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return to;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new YR(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Kn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};$3e.create=(t,e)=>new $3e({valueType:t,minSize:null,maxSize:null,typeName:vr.ZodSet,...Yo(e)});wLr=class t extends ks{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.function)return ln(r,{code:pr.invalid_type,expected:Rn.function,received:r.parsedType}),to;function n(l,u){return SLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bLr(),B3e].filter(d=>!!d),issueData:{code:pr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return SLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,bLr(),B3e].filter(d=>!!d),issueData:{code:pr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Kne){let l=this;return y1(async function(...u){let d=new WR([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return y1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new WR([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new WR([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:h9.create(e).rest(SV.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||h9.create([]).rest(SV.create()),returns:r||SV.create(),typeName:vr.ZodFunction,...Yo(n)})}},e_e=class extends ks{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};e_e.create=(t,e)=>new e_e({getter:t,typeName:vr.ZodLazy,...Yo(e)});t_e=class extends ks{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ln(r,{received:r.data,code:pr.invalid_literal,expected:this._def.value}),to}return{status:"valid",value:e.data}}get value(){return this._def.value}};t_e.create=(t,e)=>new t_e({value:t,typeName:vr.ZodLiteral,...Yo(e)});a(yzi,"JM");r_e=class t extends ks{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{expected:lc.joinValues(n),received:r.parsedType,code:pr.invalid_type}),to}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return ln(r,{received:r.data,code:pr.invalid_enum_value,options:n}),to}return y1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};r_e.create=yzi;n_e=class extends ks{static{a(this,"G7")}_parse(e){let r=lc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Rn.string&&n.parsedType!==Rn.number){let o=lc.objectValues(r);return ln(n,{expected:lc.joinValues(o),received:n.parsedType,code:pr.invalid_type}),to}if(this._cache||(this._cache=new Set(lc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=lc.objectValues(r);return ln(n,{received:n.data,code:pr.invalid_enum_value,options:o}),to}return y1(e.data)}get enum(){return this._def.values}};n_e.create=(t,e)=>new n_e({values:t,typeName:vr.ZodNativeEnum,...Yo(e)});Kne=class extends ks{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Rn.promise&&r.common.async===!1)return ln(r,{code:pr.invalid_type,expected:Rn.promise,received:r.parsedType}),to;let n=r.parsedType===Rn.promise?r.data:Promise.resolve(r.data);return y1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Kne.create=(t,e)=>new Kne({type:t,typeName:vr.ZodPromise,...Yo(e)});uN=class extends ks{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{ln(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return to;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?to:u.status==="dirty"||r.value==="dirty"?_3e(u.value):u});{if(r.value==="aborted")return to;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?to:l.status==="dirty"||r.value==="dirty"?_3e(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?to:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?to:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!zEe(c))return to;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>zEe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):to);lc.assertNever(o)}};uN.create=(t,e,r)=>new uN({schema:t,typeName:vr.ZodEffects,effect:e,...Yo(r)});uN.createWithPreprocess=(t,e,r)=>new uN({schema:e,effect:{type:"preprocess",transform:t},typeName:vr.ZodEffects,...Yo(r)});zR=class extends ks{static{a(this,"o6")}_parse(e){return this._getType(e)===Rn.undefined?y1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zR.create=(t,e)=>new zR({innerType:t,typeName:vr.ZodOptional,...Yo(e)});m9=class extends ks{static{a(this,"A1")}_parse(e){return this._getType(e)===Rn.null?y1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};m9.create=(t,e)=>new m9({innerType:t,typeName:vr.ZodNullable,...Yo(e)});i_e=class extends ks{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===Rn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i_e.create=(t,e)=>new i_e({innerType:t,typeName:vr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Yo(e)});o_e=class extends ks{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return lTt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new WR(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};o_e.create=(t,e)=>new o_e({innerType:t,typeName:vr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Yo(e)});V3e=class extends ks{static{a(this,"yX")}_parse(e){if(this._getType(e)!==Rn.nan){let r=this._getOrReturnCtx(e);return ln(r,{code:pr.invalid_type,expected:Rn.nan,received:r.parsedType}),to}return{status:"valid",value:e.data}}};V3e.create=t=>new V3e({typeName:vr.ZodNaN,...Yo(t)});uTt=class extends ks{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},dTt=class t extends ks{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?to:o.status==="dirty"?(r.dirty(),_3e(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?to:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:vr.ZodPipeline})}},s_e=class extends ks{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(zEe(o)&&(o.value=Object.freeze(o.value)),o),"J");return lTt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};s_e.create=(t,e)=>new s_e({innerType:t,typeName:vr.ZodReadonly,...Yo(e)});tBh={object:mI.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(vr||(vr={}));rBh=YEe.create,nBh=L3e.create,iBh=V3e.create,oBh=F3e.create,sBh=U3e.create,aBh=Q3e.create,cBh=q3e.create,lBh=KEe.create,uBh=JEe.create,dBh=j3e.create,fBh=SV.create,pBh=dB.create,hBh=H3e.create,mBh=wV.create,aUc=mI.create,gBh=mI.strictCreate,ABh=ZEe.create,yBh=TLr.create,EBh=XEe.create,_Bh=h9.create,CBh=xLr.create,vBh=G3e.create,bBh=$3e.create,SBh=wLr.create,TBh=e_e.create,IBh=t_e.create,xBh=r_e.create,wBh=n_e.create,RBh=Kne.create,kBh=uN.create,PBh=zR.create,DBh=m9.create,NBh=uN.createWithPreprocess,MBh=dTt.create,Ezi={};pB(Ezi,{version:a(()=>kYi,"version"),util:a(()=>Hs,"util"),treeifyError:a(()=>Pzi,"treeifyError"),toJSONSchema:a(()=>VFr,"toJSONSchema"),toDotPath:a(()=>Dzi,"toDotPath"),safeParseAsync:a(()=>lIt,"safeParseAsync"),safeParse:a(()=>cIt,"safeParse"),registry:a(()=>dFr,"registry"),regexes:a(()=>J3r,"regexes"),prettifyError:a(()=>Nzi,"prettifyError"),parseAsync:a(()=>mTt,"parseAsync"),parse:a(()=>hTt,"parse"),locales:a(()=>uFr,"locales"),isValidJWT:a(()=>eKi,"isValidJWT"),isValidBase64URL:a(()=>JYi,"isValidBase64URL"),isValidBase64:a(()=>tFr,"isValidBase64"),globalRegistry:a(()=>d9,"globalRegistry"),globalConfig:a(()=>fTt,"globalConfig"),function:a(()=>vJi,"function"),formatError:a(()=>V3r,"formatError"),flattenError:a(()=>$3r,"flattenError"),config:a(()=>QC,"config"),clone:a(()=>mN,"clone"),_xid:a(()=>bFr,"_xid"),_void:a(()=>aJi,"_void"),_uuidv7:a(()=>gFr,"_uuidv7"),_uuidv6:a(()=>mFr,"_uuidv6"),_uuidv4:a(()=>hFr,"_uuidv4"),_uuid:a(()=>pFr,"_uuid"),_url:a(()=>AFr,"_url"),_uppercase:a(()=>BFr,"_uppercase"),_unknown:a(()=>ETt,"_unknown"),_union:a(()=>cQc,"_union"),_undefined:a(()=>nJi,"_undefined"),_ulid:a(()=>vFr,"_ulid"),_uint64:a(()=>tJi,"_uint64"),_uint32:a(()=>YKi,"_uint32"),_tuple:a(()=>gJi,"_tuple"),_trim:a(()=>jFr,"_trim"),_transform:a(()=>AQc,"_transform"),_toUpperCase:a(()=>GFr,"_toUpperCase"),_toLowerCase:a(()=>HFr,"_toLowerCase"),_templateLiteral:a(()=>IQc,"_templateLiteral"),_symbol:a(()=>rJi,"_symbol"),_success:a(()=>vQc,"_success"),_stringbool:a(()=>_Ji,"_stringbool"),_stringFormat:a(()=>CJi,"_stringFormat"),_string:a(()=>BKi,"_string"),_startsWith:a(()=>FFr,"_startsWith"),_size:a(()=>NFr,"_size"),_set:a(()=>pQc,"_set"),_safeParseAsync:a(()=>K3r,"_safeParseAsync"),_safeParse:a(()=>Y3r,"_safeParse"),_regex:a(()=>MFr,"_regex"),_refine:a(()=>EJi,"_refine"),_record:a(()=>dQc,"_record"),_readonly:a(()=>TQc,"_readonly"),_property:a(()=>mJi,"_property"),_promise:a(()=>wQc,"_promise"),_positive:a(()=>dJi,"_positive"),_pipe:a(()=>SQc,"_pipe"),_parseAsync:a(()=>z3r,"_parseAsync"),_parse:a(()=>W3r,"_parse"),_overwrite:a(()=>nie,"_overwrite"),_optional:a(()=>yQc,"_optional"),_number:a(()=>HKi,"_number"),_nullable:a(()=>EQc,"_nullable"),_null:a(()=>iJi,"_null"),_normalize:a(()=>qFr,"_normalize"),_nonpositive:a(()=>pJi,"_nonpositive"),_nonoptional:a(()=>CQc,"_nonoptional"),_nonnegative:a(()=>hJi,"_nonnegative"),_never:a(()=>sJi,"_never"),_negative:a(()=>fJi,"_negative"),_nativeEnum:a(()=>mQc,"_nativeEnum"),_nanoid:a(()=>EFr,"_nanoid"),_nan:a(()=>uJi,"_nan"),_multipleOf:a(()=>K3e,"_multipleOf"),_minSize:a(()=>J3e,"_minSize"),_minLength:a(()=>c_e,"_minLength"),_min:a(()=>dI,"_min"),_mime:a(()=>QFr,"_mime"),_maxSize:a(()=>dIt,"_maxSize"),_maxLength:a(()=>fIt,"_maxLength"),_max:a(()=>cN,"_max"),_map:a(()=>fQc,"_map"),_lte:a(()=>cN,"_lte"),_lt:a(()=>Jne,"_lt"),_lowercase:a(()=>OFr,"_lowercase"),_literal:a(()=>gQc,"_literal"),_length:a(()=>pIt,"_length"),_lazy:a(()=>xQc,"_lazy"),_ksuid:a(()=>SFr,"_ksuid"),_jwt:a(()=>DFr,"_jwt"),_isoTime:a(()=>qKi,"_isoTime"),_isoDuration:a(()=>jKi,"_isoDuration"),_isoDateTime:a(()=>UKi,"_isoDateTime"),_isoDate:a(()=>QKi,"_isoDate"),_ipv6:a(()=>IFr,"_ipv6"),_ipv4:a(()=>TFr,"_ipv4"),_intersection:a(()=>uQc,"_intersection"),_int64:a(()=>eJi,"_int64"),_int32:a(()=>zKi,"_int32"),_int:a(()=>$Ki,"_int"),_includes:a(()=>LFr,"_includes"),_guid:a(()=>yTt,"_guid"),_gte:a(()=>dI,"_gte"),_gt:a(()=>Zne,"_gt"),_float64:a(()=>WKi,"_float64"),_float32:a(()=>VKi,"_float32"),_file:a(()=>AJi,"_file"),_enum:a(()=>hQc,"_enum"),_endsWith:a(()=>UFr,"_endsWith"),_emoji:a(()=>yFr,"_emoji"),_email:a(()=>fFr,"_email"),_e164:a(()=>PFr,"_e164"),_discriminatedUnion:a(()=>lQc,"_discriminatedUnion"),_default:a(()=>_Qc,"_default"),_date:a(()=>cJi,"_date"),_custom:a(()=>yJi,"_custom"),_cuid2:a(()=>CFr,"_cuid2"),_cuid:a(()=>_Fr,"_cuid"),_coercedString:a(()=>LKi,"_coercedString"),_coercedNumber:a(()=>GKi,"_coercedNumber"),_coercedDate:a(()=>lJi,"_coercedDate"),_coercedBoolean:a(()=>JKi,"_coercedBoolean"),_coercedBigint:a(()=>XKi,"_coercedBigint"),_cidrv6:a(()=>wFr,"_cidrv6"),_cidrv4:a(()=>xFr,"_cidrv4"),_catch:a(()=>bQc,"_catch"),_boolean:a(()=>KKi,"_boolean"),_bigint:a(()=>ZKi,"_bigint"),_base64url:a(()=>kFr,"_base64url"),_base64:a(()=>RFr,"_base64"),_array:a(()=>$Fr,"_array"),_any:a(()=>oJi,"_any"),TimePrecision:a(()=>FKi,"TimePrecision"),NEVER:a(()=>_zi,"NEVER"),JSONSchemaGenerator:a(()=>Z3e,"JSONSchemaGenerator"),JSONSchema:a(()=>RQc,"JSONSchema"),Doc:a(()=>gTt,"Doc"),$output:a(()=>MKi,"$output"),$input:a(()=>OKi,"$input"),$constructor:a(()=>st,"$constructor"),$brand:a(()=>Czi,"$brand"),$ZodXID:a(()=>QYi,"$ZodXID"),$ZodVoid:a(()=>uKi,"$ZodVoid"),$ZodUnknown:a(()=>ATt,"$ZodUnknown"),$ZodUnion:a(()=>aFr,"$ZodUnion"),$ZodUndefined:a(()=>sKi,"$ZodUndefined"),$ZodUUID:a(()=>DYi,"$ZodUUID"),$ZodURL:a(()=>MYi,"$ZodURL"),$ZodULID:a(()=>UYi,"$ZodULID"),$ZodType:a(()=>bo,"$ZodType"),$ZodTuple:a(()=>uIt,"$ZodTuple"),$ZodTransform:a(()=>cFr,"$ZodTransform"),$ZodTemplateLiteral:a(()=>RKi,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>oKi,"$ZodSymbol"),$ZodSuccess:a(()=>TKi,"$ZodSuccess"),$ZodStringFormat:a(()=>ku,"$ZodStringFormat"),$ZodString:a(()=>uFe,"$ZodString"),$ZodSet:a(()=>gKi,"$ZodSet"),$ZodRegistry:a(()=>Y3e,"$ZodRegistry"),$ZodRecord:a(()=>hKi,"$ZodRecord"),$ZodRealError:a(()=>cFe,"$ZodRealError"),$ZodReadonly:a(()=>wKi,"$ZodReadonly"),$ZodPromise:a(()=>kKi,"$ZodPromise"),$ZodPrefault:a(()=>bKi,"$ZodPrefault"),$ZodPipe:a(()=>lFr,"$ZodPipe"),$ZodOptional:a(()=>_Ki,"$ZodOptional"),$ZodObject:a(()=>sFr,"$ZodObject"),$ZodNumberFormat:a(()=>nKi,"$ZodNumberFormat"),$ZodNumber:a(()=>rFr,"$ZodNumber"),$ZodNullable:a(()=>CKi,"$ZodNullable"),$ZodNull:a(()=>aKi,"$ZodNull"),$ZodNonOptional:a(()=>SKi,"$ZodNonOptional"),$ZodNever:a(()=>lKi,"$ZodNever"),$ZodNanoID:a(()=>BYi,"$ZodNanoID"),$ZodNaN:a(()=>xKi,"$ZodNaN"),$ZodMap:a(()=>mKi,"$ZodMap"),$ZodLiteral:a(()=>yKi,"$ZodLiteral"),$ZodLazy:a(()=>PKi,"$ZodLazy"),$ZodKSUID:a(()=>qYi,"$ZodKSUID"),$ZodJWT:a(()=>tKi,"$ZodJWT"),$ZodIntersection:a(()=>pKi,"$ZodIntersection"),$ZodISOTime:a(()=>GYi,"$ZodISOTime"),$ZodISODuration:a(()=>$Yi,"$ZodISODuration"),$ZodISODateTime:a(()=>jYi,"$ZodISODateTime"),$ZodISODate:a(()=>HYi,"$ZodISODate"),$ZodIPv6:a(()=>WYi,"$ZodIPv6"),$ZodIPv4:a(()=>VYi,"$ZodIPv4"),$ZodGUID:a(()=>PYi,"$ZodGUID"),$ZodFunction:a(()=>_Tt,"$ZodFunction"),$ZodFile:a(()=>EKi,"$ZodFile"),$ZodError:a(()=>G3r,"$ZodError"),$ZodEnum:a(()=>AKi,"$ZodEnum"),$ZodEmoji:a(()=>OYi,"$ZodEmoji"),$ZodEmail:a(()=>NYi,"$ZodEmail"),$ZodE164:a(()=>XYi,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>fKi,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>vKi,"$ZodDefault"),$ZodDate:a(()=>dKi,"$ZodDate"),$ZodCustomStringFormat:a(()=>rKi,"$ZodCustomStringFormat"),$ZodCustom:a(()=>DKi,"$ZodCustom"),$ZodCheckUpperCase:a(()=>bYi,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>lFe,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>TYi,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>AYi,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>CYi,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>xYi,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>RYi,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>pYi,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>fYi,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>gYi,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>EYi,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>wYi,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>mYi,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>yYi,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>vYi,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>X3r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>_Yi,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>SYi,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>eFr,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>IYi,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>hYi,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>dh,"$ZodCheck"),$ZodCatch:a(()=>IKi,"$ZodCatch"),$ZodCUID2:a(()=>FYi,"$ZodCUID2"),$ZodCUID:a(()=>LYi,"$ZodCUID"),$ZodCIDRv6:a(()=>YYi,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>zYi,"$ZodCIDRv4"),$ZodBoolean:a(()=>nFr,"$ZodBoolean"),$ZodBigIntFormat:a(()=>iKi,"$ZodBigIntFormat"),$ZodBigInt:a(()=>iFr,"$ZodBigInt"),$ZodBase64URL:a(()=>ZYi,"$ZodBase64URL"),$ZodBase64:a(()=>KYi,"$ZodBase64"),$ZodAsyncError:a(()=>RV,"$ZodAsyncError"),$ZodArray:a(()=>oFr,"$ZodArray"),$ZodAny:a(()=>cKi,"$ZodAny")});_zi=Object.freeze({status:"aborted"});a(st,"F");Czi=Symbol("zod_brand"),RV=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fTt={};a(QC,"c$");Hs={};pB(Hs,{unwrapMessage:a(()=>C3e,"unwrapMessage"),stringifyPrimitive:a(()=>os,"stringifyPrimitive"),required:a(()=>SUc,"required"),randomString:a(()=>mUc,"randomString"),propertyKeyTypes:a(()=>pTt,"propertyKeyTypes"),promiseAllObject:a(()=>hUc,"promiseAllObject"),primitiveTypes:a(()=>Tzi,"primitiveTypes"),prefixIssues:a(()=>VR,"prefixIssues"),pick:a(()=>EUc,"pick"),partial:a(()=>bUc,"partial"),optionalKeys:a(()=>Izi,"optionalKeys"),omit:a(()=>_Uc,"omit"),numKeys:a(()=>gUc,"numKeys"),nullish:a(()=>tie,"nullish"),normalizeParams:a(()=>Ir,"normalizeParams"),merge:a(()=>vUc,"merge"),jsonStringifyReplacer:a(()=>vzi,"jsonStringifyReplacer"),joinValues:a(()=>$r,"joinValues"),issue:a(()=>Rzi,"issue"),isPlainObject:a(()=>z3e,"isPlainObject"),isObject:a(()=>W3e,"isObject"),getSizableOrigin:a(()=>sIt,"getSizableOrigin"),getParsedType:a(()=>AUc,"getParsedType"),getLengthableOrigin:a(()=>aIt,"getLengthableOrigin"),getEnumValues:a(()=>q3r,"getEnumValues"),getElementAtPath:a(()=>pUc,"getElementAtPath"),floatSafeRemainder:a(()=>bzi,"floatSafeRemainder"),finalizeIssue:a(()=>dN,"finalizeIssue"),extend:a(()=>CUc,"extend"),escapeRegex:a(()=>rie,"escapeRegex"),esc:a(()=>MEe,"esc"),defineLazy:a(()=>Vc,"defineLazy"),createTransparentProxy:a(()=>yUc,"createTransparentProxy"),clone:a(()=>mN,"clone"),cleanRegex:a(()=>oIt,"cleanRegex"),cleanEnum:a(()=>TUc,"cleanEnum"),captureStackTrace:a(()=>H3r,"captureStackTrace"),cached:a(()=>iIt,"cached"),assignProp:a(()=>j3r,"assignProp"),assertNotEqual:a(()=>lUc,"assertNotEqual"),assertNever:a(()=>dUc,"assertNever"),assertIs:a(()=>uUc,"assertIs"),assertEqual:a(()=>cUc,"assertEqual"),assert:a(()=>fUc,"assert"),allowsEval:a(()=>Szi,"allowsEval"),aborted:a(()=>UEe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>xzi,"NUMBER_FORMAT_RANGES"),Class:a(()=>RLr,"Class"),BIGINT_FORMAT_RANGES:a(()=>wzi,"BIGINT_FORMAT_RANGES")});a(cUc,"lh");a(lUc,"ch");a(uUc,"ph");a(dUc,"dh");a(fUc,"ih");a(q3r,"B7");a($r,"P");a(vzi,"mH");a(iIt,"z7");a(tie,"I1");a(oIt,"N7");a(bzi,"lH");a(Vc,"N$");a(j3r,"cH");a(pUc,"nh");a(hUc,"rh");a(mUc,"oh");a(MEe,"j0");H3r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(W3e,"g8");Szi=iIt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(z3e,"h8");a(gUc,"th");AUc=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),pTt=new Set(["string","number","symbol"]),Tzi=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(rie,"r4");a(mN,"H6");a(Ir,"k");a(yUc,"sh");a(os,"x");a(Izi,"iH");xzi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wzi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(EUc,"eh");a(_Uc,"$u");a(CUc,"Qu");a(vUc,"Ju");a(bUc,"Xu");a(SUc,"Yu");a(UEe,"A0");a(VR,"I6");a(C3e,"V7");a(dN,"g6");a(sIt,"O7");a(aIt,"D7");a(Rzi,"oH");a(TUc,"Wu");RLr=class{static{a(this,"YM")}constructor(...e){}},kzi=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,vzi,2)},enumerable:!0})},"WM"),G3r=st("$ZodError",kzi),cFe=st("$ZodError",kzi,{Parent:Error});a($3r,"m8");a(V3r,"l8");a(Pzi,"mX");a(Dzi,"GM");a(Nzi,"lX");W3r=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new RV;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>dN(u,s,QC())));throw H3r(l,o?.callee),l}return c.value},"cX"),hTt=W3r(cFe),z3r=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>dN(u,s,QC())));throw H3r(l,o?.callee),l}return c.value},"pX"),mTt=z3r(cFe),Y3r=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new RV;return s.issues.length?{success:!1,error:new(t??G3r)(s.issues.map(c=>dN(c,o,QC())))}:{success:!0,data:s.value}},"dX"),cIt=Y3r(cFe),K3r=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>dN(c,o,QC())))}:{success:!0,data:s.value}},"iX"),lIt=K3r(cFe),J3r={};pB(J3r,{xid:a(()=>Lzi,"xid"),uuid7:a(()=>RUc,"uuid7"),uuid6:a(()=>wUc,"uuid6"),uuid4:a(()=>xUc,"uuid4"),uuid:a(()=>a_e,"uuid"),uppercase:a(()=>uYi,"uppercase"),unicodeEmail:a(()=>DUc,"unicodeEmail"),undefined:a(()=>cYi,"undefined"),ulid:a(()=>Bzi,"ulid"),time:a(()=>eYi,"time"),string:a(()=>rYi,"string"),rfc5322Email:a(()=>PUc,"rfc5322Email"),number:a(()=>oYi,"number"),null:a(()=>aYi,"null"),nanoid:a(()=>Uzi,"nanoid"),lowercase:a(()=>lYi,"lowercase"),ksuid:a(()=>Fzi,"ksuid"),ipv6:a(()=>$zi,"ipv6"),ipv4:a(()=>Gzi,"ipv4"),integer:a(()=>iYi,"integer"),html5Email:a(()=>kUc,"html5Email"),hostname:a(()=>Yzi,"hostname"),guid:a(()=>qzi,"guid"),extendedDuration:a(()=>IUc,"extendedDuration"),emoji:a(()=>Hzi,"emoji"),email:a(()=>jzi,"email"),e164:a(()=>Kzi,"e164"),duration:a(()=>Qzi,"duration"),domain:a(()=>OUc,"domain"),datetime:a(()=>tYi,"datetime"),date:a(()=>Zzi,"date"),cuid2:a(()=>Ozi,"cuid2"),cuid:a(()=>Mzi,"cuid"),cidrv6:a(()=>Wzi,"cidrv6"),cidrv4:a(()=>Vzi,"cidrv4"),browserEmail:a(()=>NUc,"browserEmail"),boolean:a(()=>sYi,"boolean"),bigint:a(()=>nYi,"bigint"),base64url:a(()=>Z3r,"base64url"),base64:a(()=>zzi,"base64"),_emoji:a(()=>MUc,"_emoji")});Mzi=/^[cC][^\s-]{8,}$/,Ozi=/^[0-9a-z]+$/,Bzi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lzi=/^[0-9a-vA-V]{20}$/,Fzi=/^[A-Za-z0-9]{27}$/,Uzi=/^[a-zA-Z0-9_-]{21}$/,Qzi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,IUc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qzi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,a_e=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),xUc=a_e(4),wUc=a_e(6),RUc=a_e(7),jzi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kUc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,PUc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,DUc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,NUc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,MUc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(Hzi,"WK");Gzi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$zi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Vzi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wzi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zzi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Z3r=/^[A-Za-z0-9_-]*$/,Yzi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,OUc=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Kzi=/^\+(?:[0-9]){6,14}[0-9]$/,Jzi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Zzi=new RegExp(`^${Jzi}$`);a(Xzi,"HM");a(eYi,"NK");a(tYi,"wK");rYi=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),nYi=/^\d+n?$/,iYi=/^\d+$/,oYi=/^-?\d+(?:\.\d+)?/i,sYi=/true|false/i,aYi=/null/i,cYi=/undefined/i,lYi=/^[^A-Z]*$/,uYi=/^[^a-z]*$/,dh=st("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),dYi={number:"number",bigint:"bigint",object:"date"},X3r=st("$ZodCheckLessThan",(t,e)=>{dh.init(t,e);let r=dYi[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{dh.init(t,e);let r=dYi[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),fYi=st("$ZodCheckMultipleOf",(t,e)=>{dh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):bzi(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),pYi=st("$ZodCheckNumberFormat",(t,e)=>{dh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=xzi[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=iYi)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),hYi=st("$ZodCheckBigIntFormat",(t,e)=>{dh.init(t,e);let[r,n]=wzi[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),mYi=st("$ZodCheckMaxSize",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:sIt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),gYi=st("$ZodCheckMinSize",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:sIt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),AYi=st("$ZodCheckSizeEquals",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:sIt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),yYi=st("$ZodCheckMaxLength",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=aIt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),EYi=st("$ZodCheckMinLength",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=aIt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),_Yi=st("$ZodCheckLengthEquals",(t,e)=>{dh.init(t,e),t._zod.when=r=>{let n=r.value;return!tie(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=aIt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),lFe=st("$ZodCheckStringFormat",(t,e)=>{var r,n;dh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),CYi=st("$ZodCheckRegex",(t,e)=>{lFe.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),vYi=st("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=lYi),lFe.init(t,e)}),bYi=st("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=uYi),lFe.init(t,e)}),SYi=st("$ZodCheckIncludes",(t,e)=>{dh.init(t,e);let r=rie(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),TYi=st("$ZodCheckStartsWith",(t,e)=>{dh.init(t,e);let r=new RegExp(`^${rie(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),IYi=st("$ZodCheckEndsWith",(t,e)=>{dh.init(t,e);let r=new RegExp(`.*${rie(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(e$i,"KM");xYi=st("$ZodCheckProperty",(t,e)=>{dh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>e$i(o,r,e.property));e$i(n,r,e.property)}}),wYi=st("$ZodCheckMimeType",(t,e)=>{dh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),RYi=st("$ZodCheckOverwrite",(t,e)=>{dh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),gTt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` +`);this.baseURL=s.baseURL,this._baseURLIsExplicit=o.__baseURLIsExplicit??!!e,this.timeout=s.timeout??s3r.DEFAULT_TIMEOUT,this.logger=s.logger??console;let c="warn";this.logLevel=c,this.logLevel=XHi(s.logLevel,"ClientOptions.logLevel",this)??XHi(Vl("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??c,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??k5c(),mn(this,iSt,N5c,"f");let l=Vl("ANTHROPIC_CUSTOM_HEADERS");if(l){let d={};for(let f of l.split(` +`)){let h=f.indexOf(":");h>=0&&(d[f.substring(0,h).trim()]=f.substring(h+1).trim())}s.defaultHeaders={...d,...s.defaultHeaders}}let u=o.__auth;if(delete s.__auth,delete s.__baseURLIsExplicit,this._options=s,this.apiKey=typeof r=="string"?r:null,this.authToken=n,u)this._authState=u,!this._baseURLIsExplicit&&u.baseURL&&(this.baseURL=u.baseURL);else if(this._authState={provider:null,tokenCache:null,resolution:null,error:null,extraHeaders:{}},this.apiKey==null&&this.authToken==null){let d=s.credentials??null;if(d)this._authState.provider=d,this._authState.tokenCache=this._makeTokenCache(d);else if(s.config!=null){let f=UVi(s.config,this._credentialResolverOptions());this._authState.provider=f.provider,this._authState.tokenCache=this._makeTokenCache(f.provider),this._authState.extraHeaders=f.extraHeaders,this._applyCredentialBaseURL(f.baseURL)}else s.profile!=null?this._authState.resolution=this._resolveDefaultCredentials(s.profile):this._authState.resolution=this._resolveDefaultCredentials()}}_applyCredentialBaseURL(e){if(!e)return;let r=e.replace(/\/+$/,"");this._authState.baseURL=r,!this._baseURLIsExplicit&&(this.baseURL=r)}_credentialResolverOptions(){return{baseURL:this.baseURL,fetch:this.fetch,userAgent:this.getUserAgent(),onCacheWriteError:a(e=>{Qg(this).debug("credential cache write failed (best-effort)",e)},"onCacheWriteError"),onSafetyWarning:a(e=>{Qg(this).warn(e)},"onSafetyWarning")}}_makeTokenCache(e){return new PBr(e,r=>{Qg(this).debug("advisory token refresh failed; serving cached token",r)})}withOptions(e){let r="credentials"in e||"config"in e||"profile"in e,n="apiKey"in e||"authToken"in e||r,o={...this._options,...this._baseURLIsExplicit?{baseURL:this.baseURL}:{},maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,credentials:this.credentials,...r?{credentials:void 0,config:void 0,profile:void 0}:{},...e,__auth:n?void 0:this._authState,__baseURLIsExplicit:"baseURL"in e?!0:this._baseURLIsExplicit};return new this.constructor(o)}async _resolveDefaultCredentials(e){try{let r=await J5c(this._credentialResolverOptions(),e);if(r)this._authState.provider=r.provider,this._authState.tokenCache=this._makeTokenCache(r.provider),this._authState.extraHeaders=r.extraHeaders,this._applyCredentialBaseURL(r.baseURL);else if(e!=null)throw new Ii(`Profile "${e}" could not be resolved (no /configs/${e}.json found).`)}catch(r){this._authState.error=r}finally{this._authState.resolution=null}}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){if(!(e.get("x-api-key")||e.get("authorization"))){if(this._authState.error)throw this._authState.error;if(!(this._authState.tokenCache||this._authState.resolution)&&!(this.apiKey&&e.get("x-api-key"))&&!r.has("x-api-key")&&!(this.authToken&&e.get("authorization"))&&!r.has("authorization"))throw Error('Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}}_authFlags(e){let r=this._requestAuthFlags.get(e);return r||(r={usedTokenCache:!1,didRefreshFor401:!1},this._requestAuthFlags.set(e,r)),r}async authHeaders(e){if(this._authState.resolution&&await this._authState.resolution,!this._authState.error){if(this._authState.tokenCache&&this.apiKey==null){let r=await this._authState.tokenCache.getToken();return this._authFlags(e).usedTokenCache=!0,mr([{Authorization:`Bearer ${r}`}])}return mr([await this.apiKeyAuth(e),await this.bearerAuth(e)])}}async apiKeyAuth(e){if(this.apiKey!=null)return mr([{"X-Api-Key":this.apiKey}])}async bearerAuth(e){if(this.authToken!=null)return mr([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(e){return M5c(e)}getUserAgent(){return`${this.constructor.name}/JS ${lV}`}defaultIdempotencyKey(){return`stainless-node-retry-${xVi()}`}makeStatusError(e,r,n,o){return Ov.generate(e,r,n,o)}buildURL(e,r,n){let o=!gt(this,FBr,"m",tWi).call(this)&&n||this.baseURL,s=b5c(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),c=this.defaultQuery(),l=Object.fromEntries(s.searchParams);return(!$Hi(c)||!$Hi(l))&&(r={...l,...c,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(s.search=this.stringifyQuery(r)),s.toString()}_calculateNonstreamingTimeout(e){if(3600*e/128e3>600)throw new Ii("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 6e5}async prepareOptions(e){}async prepareRequest(e,{url:r,options:n}){if(this._authState.tokenCache&&this.apiKey==null){let o=e.headers instanceof Headers?e.headers:new Headers(e.headers);for(let[s,c]of Object.entries(this._authState.extraHeaders))o.has(s)||o.set(s,c);o.get("anthropic-beta")?.split(",").map(s=>s.trim())?.includes(ASt)||o.append("anthropic-beta",ASt),e.headers=o}}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new ESt(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,s=o.maxRetries??this.maxRetries;r==null&&(r=s,this._requestAuthFlags.delete(o)),await this.prepareOptions(o);let{req:c,url:l,timeout:u}=await this.buildRequest(o,{retryCount:s-r});await this.prepareRequest(c,{url:l,options:o});let d="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),f=n===void 0?"":`, retryOf: ${n}`,h=Date.now();if(Qg(this).debug(`[${d}] sending request`,kne({retryOfRequestLogID:n,method:o.method,url:l,options:o,headers:c.headers})),o.signal?.aborted)throw new cI;let m=new AbortController,g=await this.fetchWithTimeout(l,c,u,m).catch(xBr),A=Date.now();if(g instanceof globalThis.Error){let _=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new cI;let v=p3e(g)||/timed? ?out/i.test(String(g)+("cause"in g?String(g.cause):""));if(r)return Qg(this).info(`[${d}] connection ${v?"timed out":"failed"} - ${_}`),Qg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (${_})`,kne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),this.retryRequest(o,r,n??d);throw Qg(this).info(`[${d}] connection ${v?"timed out":"failed"} - error; no more retries left`),Qg(this).debug(`[${d}] connection ${v?"timed out":"failed"} (error; no more retries left)`,kne({retryOfRequestLogID:n,url:l,durationMs:A-h,message:g.message})),v?new cSt:new kEe({cause:g})}let y=[...g.headers.entries()].filter(([_])=>_==="request-id").map(([_,v])=>", "+_+": "+JSON.stringify(v)).join(""),E=`[${d}${f}${y}] ${c.method} ${l} ${g.ok?"succeeded":"failed"} with status ${g.status} in ${A-h}ms`;if(!g.ok){let _=await this.shouldRetry(g,o);if(r&&_){let R=`retrying, ${r} attempts remaining`;return await D5c(g.body),Qg(this).info(`${E} - ${R}`),Qg(this).debug(`[${d}] response error (${R})`,kne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),this.retryRequest(o,r,n??d,g.headers)}let v=_?"error; no more retries left":"error; not retryable";Qg(this).info(`${E} - ${v}`);let b=await g.text().catch(R=>xBr(R).message),T=wVi(b),w=T?void 0:b;throw Qg(this).debug(`[${d}] response error (${v})`,kne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,message:w,durationMs:Date.now()-h})),this.makeStatusError(g.status,T,w,g.headers)}return Qg(this).info(E),Qg(this).debug(`[${d}] response start`,kne({retryOfRequestLogID:n,url:g.url,status:g.status,headers:g.headers,durationMs:A-h})),{response:g,options:o,controller:m,requestLogID:d,retryOfRequestLogID:n,startTime:h}}getAPIList(e,r,n){return this.requestAPIList(r,n&&"then"in n?n.then(o=>({method:"get",path:e,...o})):{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new DBr(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:s,method:c,...l}=r||{},u=this._makeAbort(o);s&&s.addEventListener("abort",u,{once:!0});let d=setTimeout(u,n),f=globalThis.ReadableStream&&l.body instanceof globalThis.ReadableStream||typeof l.body=="object"&&l.body!==null&&Symbol.asyncIterator in l.body,h={signal:o.signal,...f?{duplex:"half"}:{},method:"GET",...l};c&&(h.method=c.toUpperCase());try{return await this.fetch.call(void 0,e,h)}finally{clearTimeout(d)}}async shouldRetry(e,r){let n=this._authFlags(r);if(e.status===401&&this._authState.tokenCache&&n.usedTokenCache&&!n.didRefreshFor401)return n.didRefreshFor401=!0,this._authState.tokenCache.invalidate(),!0;let o=e.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let s,c=o?.get("retry-after-ms");if(c){let u=parseFloat(c);Number.isNaN(u)||(s=u)}let l=o?.get("retry-after");if(l&&!s){let u=parseFloat(l);Number.isNaN(u)?s=Date.parse(l)-Date.now():s=u*1e3}if(s===void 0){let u=e.maxRetries??this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(r,u)}return await I5c(s),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let n=r-e,o=Math.min(.5*Math.pow(2,n),8),s=1-Math.random()*.25;return o*s*1e3}calculateNonstreamingTimeout(e,r){if(36e5*e/128e3>6e5||r!=null&&e>r)throw new Ii("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 6e5}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:s,query:c,defaultBaseURL:l}=n;this._authState.resolution&&await this._authState.resolution,!this._baseURLIsExplicit&&this._authState.baseURL&&this.baseURL!==this._authState.baseURL&&(this.baseURL=this._authState.baseURL);let u=this.buildURL(s,c,l);"timeout"in n&&T5c("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:d,body:f}=this.buildBody({options:n}),h=await this.buildHeaders({options:e,method:o,bodyHeaders:d,retryCount:r});return{req:{method:o,headers:h,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&f instanceof globalThis.ReadableStream&&{duplex:"half"},...f&&{body:f},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let s={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);let c=mr([s,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...e3r(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(c),c.values}_makeAbort(e){return()=>e.abort()}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=mr([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:PVi(e)}:typeof e=="object"&&n.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(e)}:gt(this,iSt,"f").call(this,{body:e,headers:n})}};s3r=Ip,iSt=new WeakMap,FBr=new WeakSet,tWi=a(function(){return this.baseURL!=="https://api.anthropic.com"},"Sw");Ip.Anthropic=s3r;Ip.HUMAN_PROMPT=I4c;Ip.AI_PROMPT=x4c;Ip.DEFAULT_TIMEOUT=6e5;Ip.AnthropicError=Ii;Ip.APIError=Ov;Ip.APIConnectionError=kEe;Ip.APIConnectionTimeoutError=cSt;Ip.APIUserAbortError=cI;Ip.NotFoundError=fSt;Ip.ConflictError=pSt;Ip.RateLimitError=mSt;Ip.BadRequestError=lSt;Ip.AuthenticationError=uSt;Ip.InternalServerError=gSt;Ip.PermissionDeniedError=dSt;Ip.UnprocessableEntityError=hSt;Ip.toFile=d4c;MEe=class extends Ip{static{a(this,"K0")}constructor(){super(...arguments),this.completions=new BSt(this),this.messages=new A3e(this),this.models=new FSt(this),this.beta=new u1(this)}};MEe.Completions=BSt;MEe.Messages=A3e;MEe.Models=FSt;MEe.Beta=u1;a(H3e,"j4");a(oSt,"N8");a(lI,"o$");a(G3e,"D1");a(rWi,"JU");a(w4c,"Tw");R4c=new Set(["EXDEV","EPERM","EEXIST","EBUSY"]),P4c=new Set(["ENOSPC","EIO","EDQUOT","EFBIG"]);a(k4c,"xw");QBr=class{static{a(this,"gw")}read(e){return(0,qg.readFile)(e,"utf8")}readBytes(e){return(0,qg.readFile)(e)}write(e,r,n){return(0,qg.writeFile)(e,r,{encoding:"utf8",mode:n})}async mkdir(e){try{await(0,qg.mkdir)(e,{recursive:!0})}catch(r){if(lI(r)!=="EEXIST")throw r}}atomicWrite(e,r,n){return k4c(e,r,n)}delete(e){return(0,qg.unlink)(e)}list(e){return(0,qg.readdir)(e)}append(e,r,n){return(0,qg.appendFile)(e,r,{encoding:"utf8",mode:n})}writeExclusive(e,r){return(0,qg.writeFile)(e,r,{encoding:"utf8",flag:"wx"})}writeBytes(e,r){return(0,qg.writeFile)(e,r)}async stat(e){return{mtimeMs:(await(0,qg.stat)(e)).mtimeMs}}async listEntries(e){return(await(0,qg.readdir)(e,{withFileTypes:!0})).map(r=>({name:r.name,isDirectory:r.isDirectory(),isFile:r.isFile()}))}},D4c=new iWi.AsyncLocalStorage;a(USt,"w8");gEe=null;a(sWi,"uw");a(N4c,"mw");a(UR,"L6");a(M4c,"dv");O4c=M4c;a(B4c,"iv");L4c=B4c;a(F4c,"nv");U4c=F4c;a(Q4c,"rv");q4c=Q4c,j4c=200;a(H4c,"tv");G4c=H4c;a(o_e,"D8");o_e.prototype.clear=O4c;o_e.prototype.delete=L4c;o_e.prototype.get=U4c;o_e.prototype.has=q4c;o_e.prototype.set=G4c;$4c=o_e,V4c=(function(){try{var t=JLr(Object,"defineProperty");return t({},"",{}),t}catch{}})(),QSt=V4c;a(W4c,"sv");a3r=W4c,z4c=Object.prototype,Y4c=z4c.hasOwnProperty;a(K4c,"QC");aWi=K4c;a(J4c,"JC");Z4c=J4c;a(X4c,"XC");eBc=X4c;a(tBc,"YC");s_e=tBc,rBc="[object Arguments]";a(nBc,"GC");EGi=nBc,cWi=Object.prototype,iBc=cWi.hasOwnProperty,oBc=cWi.propertyIsEnumerable,sBc=EGi((function(){return arguments})())?EGi:function(t){return s_e(t)&&iBc.call(t,"callee")&&!oBc.call(t,"callee")},y3e=sBc,aBc=Array.isArray,mV=aBc,t3e={};sB(t3e,{default:a(()=>c3r,"default")});a(cBc,"VC");lBc=cBc,lWi=typeof t3e=="object"&&t3e&&!t3e.nodeType&&t3e,_Gi=lWi&&typeof o5=="object"&&o5&&!o5.nodeType&&o5,uBc=_Gi&&_Gi.exports===lWi,vGi=uBc?e_e.Buffer:void 0,dBc=vGi?vGi.isBuffer:void 0,fBc=dBc||lBc,c3r=fBc,pBc=9007199254740991,hBc=/^(?:0|[1-9]\d*)$/;a(mBc,"DC");UTt=mBc,gBc=9007199254740991;a(ABc,"ZC");l3r=ABc,yBc="[object Arguments]",EBc="[object Array]",_Bc="[object Boolean]",vBc="[object Date]",CBc="[object Error]",bBc="[object Function]",SBc="[object Map]",TBc="[object Number]",IBc="[object Object]",xBc="[object RegExp]",wBc="[object Set]",RBc="[object String]",PBc="[object WeakMap]",kBc="[object ArrayBuffer]",DBc="[object DataView]",NBc="[object Float32Array]",MBc="[object Float64Array]",OBc="[object Int8Array]",BBc="[object Int16Array]",LBc="[object Int32Array]",FBc="[object Uint8Array]",UBc="[object Uint8ClampedArray]",QBc="[object Uint16Array]",qBc="[object Uint32Array]",md={};md[NBc]=md[MBc]=md[OBc]=md[BBc]=md[LBc]=md[FBc]=md[UBc]=md[QBc]=md[qBc]=!0;md[yBc]=md[EBc]=md[kBc]=md[_Bc]=md[DBc]=md[vBc]=md[CBc]=md[bBc]=md[SBc]=md[TBc]=md[IBc]=md[xBc]=md[wBc]=md[RBc]=md[PBc]=!1;a(jBc,"pC");HBc=jBc;a(GBc,"dC");$Bc=GBc,r3e={};sB(r3e,{default:a(()=>qBr,"default")});uWi=typeof r3e=="object"&&r3e&&!r3e.nodeType&&r3e,l3e=uWi&&typeof a5=="object"&&a5&&!a5.nodeType&&a5,VBc=l3e&&l3e.exports===uWi,nBr=VBc&&CVi.process,WBc=(function(){try{var t=l3e&&l3e.require&&l3e.require("util").types;return t||nBr&&nBr.binding&&nBr.binding("util")}catch{}})(),qBr=WBc,CGi=qBr&&qBr.isTypedArray,zBc=CGi?$Bc(CGi):HBc,dWi=zBc,YBc=Object.prototype,KBc=YBc.hasOwnProperty;a(JBc,"aC");ZBc=JBc,XBc=Object.prototype;a(eLc,"eC");fWi=eLc;a(tLc,"$T");rLc=tLc;a(nLc,"QT");u3r=nLc;a(iLc,"JT");oLc=iLc,sLc=Object.prototype,aLc=sLc.hasOwnProperty;a(cLc,"WT");lLc=cLc;a(uLc,"GT");pWi=uLc,n3e={};sB(n3e,{default:a(()=>mWi,"default")});hWi=typeof n3e=="object"&&n3e&&!n3e.nodeType&&n3e,bGi=hWi&&typeof XX=="object"&&XX&&!XX.nodeType&&XX,dLc=bGi&&bGi.exports===hWi,SGi=dLc?e_e.Buffer:void 0,TGi=SGi?SGi.allocUnsafe:void 0;a(fLc,"HT");mWi=fLc;a(pLc,"KT");hLc=pLc;a(mLc,"qT");gLc=mLc,ALc=rLc(Object.getPrototypeOf,Object),gWi=ALc,yLc=e_e.Uint8Array,IGi=yLc;a(ELc,"zT");_Lc=ELc;a(vLc,"NT");CLc=vLc,xGi=Object.create,bLc=(function(){function t(){}return a(t,"$"),function(e){if(!o9(e))return{};if(xGi)return xGi(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),SLc=bLc;a(TLc,"OT");ILc=TLc,xLc="[object Symbol]";a(wLc,"FT");d3r=wLc,RLc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,PLc=/^\w*$/;a(kLc,"LT");DLc=kLc,NLc=500;a(MLc,"AT");OLc=MLc,BLc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LLc=/\\(\\)?/g,FLc=OLc(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(BLc,function(r,n,o,s){e.push(o?s.replace(LLc,"$1"):n||r)}),e}),ULc=FLc;a(QLc,"ET");qLc=QLc,jLc=1/0,wGi=hV?hV.prototype:void 0,RGi=wGi?wGi.toString:void 0;a(AWi,"PO");HLc=AWi;a(GLc,"_T");$Lc=GLc;a(VLc,"kT");QTt=VLc,WLc=1/0;a(zLc,"vT");f3r=zLc;a(YLc,"CT");KLc=YLc;a(JLc,"TT");ZLc=JLc;a(XLc,"xT");e3c=XLc;a(t3c,"yT");r3c=t3c;a(n3c,"fT");yWi=n3c,p3r=null;a(i3c,"CO");a(o3c,"TO");jSt=new Map;a(s3c,"xO");a(a3c,"yO");h3r=new Map;a(l3c,"fO");a(u3c,"gO");a(m3r,"V0");a(f3c,"hO");a(p3c,"uO");h3c={renderTarget:"ink",workspace:"local",canDrive:!0,transcriptSource:"local-jsonl",remote:null};a(m3c,"lT");g3c=m3c(),A3c=a(()=>{},"pT");a(_Wi,"VU");y3c=q3e(),P5h=y3c.subscribe,E3c=q3e(),k5h=E3c.subscribe,_3c=q3e(),D5h=_3c.subscribe,v3c=q3e(),N5h=v3c.subscribe,C3c=q3e(),M5h=C3c.subscribe;a(b3c,"lO");a(S3c,"tT");HBr=class{static{a(this,"cO")}#e=new Set;register(e){let r=S3c(e);this.#e.add(r);let n=a(()=>{this.#e.delete(r)},"J");return Object.assign(n,{[Symbol.dispose]:n})}async drain(){let e=Array.from(this.#e);this.#e.clear(),await Promise.all(e.map(async r=>r()))}async[Symbol.asyncDispose](){await this.drain()}get sizeForTesting(){return this.#e.size}},T3c=new HBr;a(I3c,"pO");x3c=hy(t=>{if(!t||t.trim()==="")return null;let e=t.split(",").map(s=>s.trim()).filter(Boolean);if(e.length===0)return null;let r=e.some(s=>s.startsWith("!")),n=e.some(s=>!s.startsWith("!"));if(r&&n)return null;let o=e.map(s=>s.replace(/^!/,"").toLowerCase());return{include:r?[]:o,exclude:r?o:[],isExclusive:r}});a(w3c,"sT");a(R3c,"eT");a(P3c,"iO");a(k3c,"tO");a(D3c,"Qx");a(PGi,"oO");a(N3c,"aO");a(CWi,"HX");M3c={cwd(){return process.cwd()},existsSync(t){let e=[];try{let o=Gd(e,Vd`fs.existsSync(${t})`,0);return vo.existsSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},async stat(t){return(0,Rm.stat)(t)},async readdir(t){return(0,Rm.readdir)(t,{withFileTypes:!0})},async unlink(t){return(0,Rm.unlink)(t)},async rmdir(t){return(0,Rm.rmdir)(t)},async rm(t,e){return(0,Rm.rm)(t,e)},async mkdir(t,e){try{await(0,Rm.mkdir)(t,{recursive:!0,...e})}catch(r){if(lI(r)!=="EEXIST")throw r}},async readFile(t,e){return(0,Rm.readFile)(t,{encoding:e.encoding})},async rename(t,e){return(0,Rm.rename)(t,e)},statSync(t){let e=[];try{let o=Gd(e,Vd`fs.statSync(${t})`,0);return vo.statSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},lstatSync(t){let e=[];try{let o=Gd(e,Vd`fs.lstatSync(${t})`,0);return vo.lstatSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readFileSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.readFileSync(${t})`,0);return vo.readFileSync(t,{encoding:e.encoding})}catch(s){var n=s,o=1}finally{$d(r,n,o)}},readFileBytesSync(t){let e=[];try{let o=Gd(e,Vd`fs.readFileBytesSync(${t})`,0);return vo.readFileSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.readSync(${t}, ${e.length} bytes)`,0),c;try{c=vo.openSync(t,"r");let l=Buffer.alloc(e.length),u=vo.readSync(c,l,0,e.length,0);return{buffer:l,bytesRead:u}}finally{c&&vo.closeSync(c)}}catch(s){var n=s,o=1}finally{$d(r,n,o)}},appendFileSync(t,e,r){let n=[];try{let c=Gd(n,Vd`fs.appendFileSync(${t}, ${e.length} chars)`,0);if(r?.mode!==void 0)try{let l=vo.openSync(t,"ax",r.mode);try{vo.appendFileSync(l,e)}finally{vo.closeSync(l)}return}catch(l){if(lI(l)!=="EEXIST")throw l}vo.appendFileSync(t,e)}catch(c){var o=c,s=1}finally{$d(n,o,s)}},copyFileSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.copyFileSync(${t} → ${e})`,0);vo.copyFileSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},unlinkSync(t){let e=[];try{let o=Gd(e,Vd`fs.unlinkSync(${t})`,0);vo.unlinkSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},renameSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.renameSync(${t} → ${e})`,0);vo.renameSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},linkSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.linkSync(${t} → ${e})`,0);vo.linkSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},symlinkSync(t,e,r){let n=[];try{let c=Gd(n,Vd`fs.symlinkSync(${t} → ${e})`,0);vo.symlinkSync(t,e,r)}catch(c){var o=c,s=1}finally{$d(n,o,s)}},readlinkSync(t){let e=[];try{let o=Gd(e,Vd`fs.readlinkSync(${t})`,0);return vo.readlinkSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},realpathSync(t){let e=[];try{let o=Gd(e,Vd`fs.realpathSync(${t})`,0);return vo.realpathSync(t).normalize("NFC")}catch(o){var r=o,n=1}finally{$d(e,r,n)}},mkdirSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.mkdirSync(${t})`,0),c={recursive:!0};e?.mode!==void 0&&(c.mode=e.mode);try{vo.mkdirSync(t,c)}catch(l){if(lI(l)!=="EEXIST")throw l}}catch(s){var n=s,o=1}finally{$d(r,n,o)}},readdirSync(t){let e=[];try{let o=Gd(e,Vd`fs.readdirSync(${t})`,0);return vo.readdirSync(t,{withFileTypes:!0})}catch(o){var r=o,n=1}finally{$d(e,r,n)}},readdirStringSync(t){let e=[];try{let o=Gd(e,Vd`fs.readdirStringSync(${t})`,0);return vo.readdirSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},isDirEmptySync(t){let e=[];try{let o=Gd(e,Vd`fs.isDirEmptySync(${t})`,0);return this.readdirSync(t).length===0}catch(o){var r=o,n=1}finally{$d(e,r,n)}},rmdirSync(t){let e=[];try{let o=Gd(e,Vd`fs.rmdirSync(${t})`,0);vo.rmdirSync(t)}catch(o){var r=o,n=1}finally{$d(e,r,n)}},rmSync(t,e){let r=[];try{let s=Gd(r,Vd`fs.rmSync(${t})`,0);vo.rmSync(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},createWriteStream(t){return vo.createWriteStream(t)},async readFileBytes(t,e){if(e===void 0)return(0,Rm.readFile)(t);let r=await(0,Rm.open)(t,"r");try{let{size:n}=await r.stat(),o=Math.min(n,e),s=Buffer.allocUnsafe(o),c=0;for(;c=:(,)])([a-zA-Z0-9_~.]{3}\\dQ~[a-zA-Z0-9_~.-]{31,34})(?:$|[\\\\'"\\x60\\s<),])`,confidence:"high"},{id:"digitalocean-pat",source:`\\b(dop_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"digitalocean-access-token",source:`\\b(doo_v1_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-api-key",source:`\\b(${j3c}03-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"anthropic-admin-api-key",source:`\\b(sk-ant-admin01-[a-zA-Z0-9_\\-]{93}AA)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"openai-api-key",source:`\\b(sk-(?:proj|svcacct|admin)-(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})T3BlbkFJ(?:[A-Za-z0-9_-]{74}|[A-Za-z0-9_-]{58})\\b|sk-[a-zA-Z0-9]{20}T3BlbkFJ[a-zA-Z0-9]{20})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"huggingface-access-token",source:`\\b(hf_[a-zA-Z]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"github-pat",source:"ghp_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-fine-grained-pat",source:"github_pat_\\w{82}",confidence:"high"},{id:"github-app-token",source:"(?:ghu|ghs)_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-oauth",source:"gho_[0-9a-zA-Z]{36}",confidence:"high"},{id:"github-refresh-token",source:"ghr_[0-9a-zA-Z]{36}",confidence:"high"},{id:"gitlab-pat",source:"glpat-[\\w-]{20}",confidence:"high"},{id:"gitlab-deploy-token",source:"gldt-[0-9a-zA-Z_\\-]{20}",confidence:"high"},{id:"slack-bot-token",source:"xoxb-[0-9]{10,13}-[0-9]{10,13}[a-zA-Z0-9-]*",confidence:"high"},{id:"slack-user-token",source:"xox[pe](?:-[0-9]{10,13}){3}-[a-zA-Z0-9-]{28,34}",confidence:"high"},{id:"slack-app-token",source:"xapp-\\d-[A-Z0-9]+-\\d+-[a-z0-9]+",flags:"i",confidence:"high"},{id:"twilio-api-key",source:"SK[0-9a-fA-F]{32}",confidence:"high"},{id:"sendgrid-api-token",source:`\\b(SG\\.[a-zA-Z0-9=_\\-.]{66})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"npm-access-token",source:`\\b(npm_[a-zA-Z0-9]{36})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"pypi-upload-token",source:"pypi-AgEIcHlwaS5vcmc[\\w-]{50,1000}",confidence:"high"},{id:"databricks-api-token",source:`\\b(dapi[a-f0-9]{32}(?:-\\d)?)(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"hashicorp-tf-api-token",source:"[a-zA-Z0-9]{14}\\.atlasv1\\.[a-zA-Z0-9\\-_=]{60,70}",confidence:"high"},{id:"pulumi-api-token",source:`\\b(pul-[a-f0-9]{40})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"postman-api-token",source:`\\b(PMAK-[a-fA-F0-9]{24}-[a-fA-F0-9]{34})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-api-key",source:`\\b(eyJrIjoi[A-Za-z0-9+/]{70,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-cloud-api-token",source:`\\b(glc_[A-Za-z0-9+/]{32,400}={0,3})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"grafana-service-account-token",source:`\\b(glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-user-token",source:`\\b(sntryu_[a-f0-9]{64})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"sentry-org-token",source:"\\bsntrys_eyJpYXQiO[a-zA-Z0-9+/]{10,200}(?:LCJyZWdpb25fdXJs|InJlZ2lvbl91cmwi|cmVnaW9uX3VybCI6)[a-zA-Z0-9+/]{10,200}={0,2}_[a-zA-Z0-9+/]{43}",confidence:"high"},{id:"stripe-access-token",source:`\\b((?:sk|rk)_(?:test|live|prod)_[a-zA-Z0-9]{10,99})(?:[\\x60'"\\s;]|\\\\[nr]|$)`,confidence:"high"},{id:"shopify-access-token",source:"shpat_[a-fA-F0-9]{32}",confidence:"high"},{id:"shopify-shared-secret",source:"shpss_[a-fA-F0-9]{32}",confidence:"high"},{id:"private-key",source:"-----BEGIN[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----[\\s\\S-]{64,}?-----END[ A-Z0-9_-]{0,100}PRIVATE KEY(?: BLOCK)?-----",flags:"i",confidence:"high"}],NGi=null;a(G3c,"Ox");a($3c,"W2");GBr={verbose:0,debug:1,info:2,warn:3,error:4},V3c=hy(()=>{let t=process.env.CLAUDE_CODE_DEBUG_LOG_LEVEL?.toLowerCase().trim();return t&&Object.hasOwn(GBr,t)?t:"debug"}),W3c=!1;a(qTt,"qX");$Br=hy(()=>{let t=qTt();return W3c||QE(process.env.DEBUG)||QE(process.env.DEBUG_SDK)||t.includes("--debug")||t.includes("-d")||bWi()||t.some(e=>e.startsWith("--debug="))||SWi()!==null}),z3c=hy(()=>{let t=qTt().find(r=>r.startsWith("--debug="));if(!t)return null;let e=t.substring(8);return x3c(e)}),bWi=hy(()=>{let t=qTt();return t.includes("--debug-to-stderr")||t.includes("-d2e")}),SWi=hy(()=>{let t=qTt();for(let e=0;e{try{let t=xWi(),e=(0,Wne.dirname)(t),r=(0,Wne.join)(e,"latest");await(0,HE.unlink)(r).catch(()=>{}),await(0,HE.symlink)(t,r)}catch{}}),L5h=(()=>{let t=process.env.CLAUDE_CODE_SLOW_OPERATION_THRESHOLD_MS;if(t!==void 0){let e=Number(t);if(!Number.isNaN(e)&&e>=0)return e}return 1/0})(),eFc={[Symbol.dispose](){}};a(tFc,"_x");Vd=tFc;a(x0,"B$");dN=a((t,e)=>{let r=[];try{let s=Gd(r,Vd`JSON.parse(${t})`,0);return typeof e>"u"?JSON.parse(t):JSON.parse(t,e)}catch(s){var n=s,o=1}finally{$d(r,n,o)}},"d$");a(rFc,"w2");a(gV,"A4");a(nFc,"kx");a(iFc,"O2");oFc=2e3,HSt=new Set,MGi=!1;a(sFc,"xx");a(aFc,"yx");zBr=class{static{a(this,"jU")}options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];abortHandler;forwardedAbort=TBr();pendingWrites=[];pendingEndInput=!1;spawnResolve;spawnReject;spawnPromise;constructor(e){this.options=e,this.abortController=e.abortController||TBr(),e.deferSpawn?(this.spawnPromise=new Promise((r,n)=>{this.spawnResolve=r,this.spawnReject=n}),this.spawnPromise.catch(()=>{})):this.initialize()}spawn(){try{this.initialize()}catch(r){throw this.spawnAbort(H3e(r)),r}let e=this.pendingWrites;this.pendingWrites=[],this.spawnResolve&&(this.spawnResolve(),this.spawnResolve=void 0,this.spawnReject=void 0);for(let r of e)this.write(r);this.pendingEndInput&&(this.pendingEndInput=!1,this.processStdin?.end())}spawnAbort(e){this.spawnReject&&(this.spawnReject(e),this.spawnReject=void 0,this.spawnResolve=void 0,this.pendingWrites=[])}updateEnv(e){this.options.env?Object.assign(this.options.env,e):this.options.env={...e}}updateResume(e){this.options.resume=e}getDefaultExecutable(){return vVi()?"bun":"node"}spawnLocalProcess(e){let{command:r,args:n,cwd:o,env:s,signal:c}=e,l=QE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr?"pipe":"ignore",u=(0,AVi.spawn)(r,n,{cwd:o,stdio:["pipe","pipe",l],signal:c,env:s,windowsHide:!0});return(QE(s.DEBUG_CLAUDE_AGENT_SDK)||this.options.stderr)&&u.stderr.on("data",d=>{let f=d.toString();UR(f),this.options.stderr&&this.options.stderr(f)}),{stdin:u.stdin,stdout:u.stdout,get killed(){return u.killed},get exitCode(){return u.exitCode},kill:u.kill.bind(u),on:u.on.bind(u),once:u.once.bind(u),off:u.off.bind(u)}}initialize(){try{let{additionalDirectories:e=[],agent:r,betas:n,cwd:o,executable:s=this.getDefaultExecutable(),executableArgs:c=[],extraArgs:l={},pathToClaudeCodeExecutable:u,env:d={...process.env},thinkingConfig:f,maxTurns:h,maxBudgetUsd:m,taskBudget:g,model:A,fallbackModel:y,jsonSchema:E,permissionMode:_,allowDangerouslySkipPermissions:v,permissionPromptToolName:b,continueConversation:T,resume:w,settingSources:R,skills:x,disallowedTools:P=[],tools:D,mcpServers:N,strictMcpConfig:B,canUseTool:L,includePartialMessages:j,plugins:M,sandbox:O}=this.options,{allowedTools:q=[]}=this.options;if(x!==void 0){let H=x==="all"?["Skill"]:x.map(ae=>`Skill(${ae})`),re=new Set(q);q=[...q,...H.filter(ae=>!re.has(ae))]}let Q=["--output-format","stream-json","--verbose","--input-format","stream-json"];if(f){switch(f.type){case"enabled":f.budgetTokens===void 0?Q.push("--thinking","adaptive"):Q.push("--max-thinking-tokens",f.budgetTokens.toString());break;case"disabled":Q.push("--thinking","disabled");break;case"adaptive":Q.push("--thinking","adaptive");break}f.type!=="disabled"&&f.display&&Q.push("--thinking-display",f.display)}if(this.options.effort&&Q.push("--effort",this.options.effort),h&&Q.push("--max-turns",h.toString()),m!==void 0&&Q.push("--max-budget-usd",m.toString()),g&&Q.push("--task-budget",g.total.toString()),A&&Q.push("--model",A),r&&Q.push("--agent",r),n&&n.length>0&&Q.push("--betas",n.join(",")),E&&Q.push("--json-schema",x0(E)),this.options.debugFile?Q.push("--debug-file",this.options.debugFile):this.options.debug&&Q.push("--debug"),!this.options.debugFile&&!this.options.spawnClaudeCodeProcess){let H=N4c();H&&Q.push("--debug-file",H)}if(L){if(b)throw Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");Q.push("--permission-prompt-tool","stdio")}else b&&Q.push("--permission-prompt-tool",b);if(T&&Q.push("--continue"),w&&Q.push("--resume",w),this.options.assistant&&Q.push("--assistant"),this.options.channels&&this.options.channels.length>0&&Q.push("--channels",...this.options.channels),q.length>0&&Q.push("--allowedTools",q.join(",")),P.length>0&&Q.push("--disallowedTools",P.join(",")),D!==void 0&&(Array.isArray(D)?D.length===0?Q.push("--tools",""):Q.push("--tools",D.join(",")):Q.push("--tools","default")),N&&Object.keys(N).length>0&&Q.push("--mcp-config",x0({mcpServers:N})),R!==void 0&&Q.push(`--setting-sources=${R.join(",")}`),B&&Q.push("--strict-mcp-config"),_&&Q.push("--permission-mode",_),v&&Q.push("--allow-dangerously-skip-permissions"),y){if(A&&y===A)throw Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");Q.push("--fallback-model",y)}this.options.includeHookEvents&&Q.push("--include-hook-events"),j&&Q.push("--include-partial-messages"),this.options.sessionMirror&&Q.push("--session-mirror");for(let H of e)Q.push("--add-dir",H);if(M&&M.length>0)for(let H of M)if(H.type==="local")Q.push("--plugin-dir",H.path);else throw Error(`Unsupported plugin type: ${H.type}`);this.options.forkSession&&Q.push("--fork-session"),this.options.resumeSessionAt&&Q.push("--resume-session-at",this.options.resumeSessionAt),this.options.sessionId&&Q.push("--session-id",this.options.sessionId),this.options.persistSession===!1&&Q.push("--no-session-persistence"),this.options.managedSettings&&Q.push("--managed-settings",this.options.managedSettings);let U={...l??{}};this.options.settings&&(U.settings=this.options.settings);let z=iFc(U,O);for(let[H,re]of Object.entries(z))re===null?Q.push(`--${H}`):Q.push(`--${H}`,re);d.CLAUDE_CODE_ENTRYPOINT||(d.CLAUDE_CODE_ENTRYPOINT="sdk-ts"),delete d.NODE_OPTIONS,QE(d.DEBUG_CLAUDE_AGENT_SDK)?d.DEBUG="1":delete d.DEBUG;let W=cFc(u),$=W?u:s,J=W?[...c,...Q]:[...c,u,...Q],ne={command:$,args:J,cwd:o,env:d,signal:this.forwardedAbort.signal};this.options.spawnClaudeCodeProcess?(UR(`Spawning Claude Code (custom): ${$} ${J.join(" ")}`),this.process=this.options.spawnClaudeCodeProcess(ne)):(UR(`Spawning Claude Code: ${$} ${J.join(" ")}`),this.process=this.spawnLocalProcess(ne)),this.processStdin=this.process.stdin,this.processStdout=this.process.stdout,aFc(this.process),this.abortHandler=()=>this.close(),this.abortController.signal.addEventListener("abort",this.abortHandler),this.abortController.signal.aborted&&this.close(),this.process.on("error",H=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new l1("Claude Code process aborted by user");else if(w4c(H)){let re=lFc(u,W);this.exitError=ReferenceError(re),UR(this.exitError.message)}else this.exitError=Error(`Failed to spawn Claude Code process: ${H.message}`),UR(this.exitError.message)}),this.process.on("exit",(H,re)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new l1("Claude Code process aborted by user");else{let ae=this.getProcessExitError(H,re);ae&&(this.exitError=ae,UR(ae.message))}}),this.ready=!this.abortController.signal.aborted}catch(e){throw this.ready=!1,e}}getProcessExitError(e,r){if(e!==0&&e!==null)return Error(`Claude Code process exited with code ${e}`);if(r)return Error(`Claude Code process terminated by signal ${r}`)}write(e){if(this.abortController.signal.aborted)throw new l1("Operation aborted");if(this.spawnResolve){this.pendingWrites.push(e);return}if(!this.ready||!this.processStdin)throw Error("ProcessTransport is not ready for writing");if(this.processStdin.writableEnded){UR("[ProcessTransport] Dropping write to ended stdin stream");return}if(this.process?.killed||this.process?.exitCode!==null)throw Error("Cannot write to terminated process");if(this.exitError)throw Error(`Cannot write to process that exited with error: ${this.exitError.message}`);UR(`[ProcessTransport] Writing to stdin: ${e.substring(0,100)}`);try{this.processStdin.write(e)||UR("[ProcessTransport] Write buffer full, data queued")}catch(r){throw this.ready=!1,Error(`Failed to write to process stdin: ${oSt(r)}`)}}[Symbol.dispose](){this.close()}close(){this.spawnAbort(this.abortController.signal.aborted?new l1("Claude Code process aborted by user"):Error("Query closed before spawn")),this.processStdin&&(this.processStdin.end(),this.processStdin=void 0),this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0);for(let{handler:n}of this.exitListeners)this.process?.off("exit",n);this.exitListeners=[];let e=a(()=>{this.abortController.signal.aborted&&this.forwardedAbort.abort(this.abortController.signal.reason)},"$"),r=this.process;r&&!r.killed&&r.exitCode===null?(setTimeout((n,o)=>{if(n.exitCode!==null){o();return}if(process.platform==="win32"){setTimeout((s,c)=>{s.exitCode===null&&s.kill("SIGKILL"),c()},5e3,n,o).unref();return}n.kill("SIGTERM"),setTimeout(s=>{s.exitCode===null&&s.kill("SIGKILL")},5e3,n).unref(),o()},oFc,r,e).unref(),r.once("exit",()=>HSt.delete(r))):r&&(HSt.delete(r),e()),this.ready=!1}isReady(){return this.ready}async*readMessages(){if(this.spawnPromise&&(await this.spawnPromise,this.spawnPromise=void 0),!this.processStdout)throw Error("ProcessTransport output stream not available");if(this.exitError)throw this.exitError;let e=(0,EVi.createInterface)({input:this.processStdout}),r=this.process?(()=>{let n=this.process,o=a(()=>e.close(),"Y");return n.on("error",o),()=>n.off("error",o)})():void 0;this.exitError&&e.close();try{for await(let n of e)if(n.trim()){let o;try{o=dN(n)}catch{UR(`Non-JSON stdout: ${n}`);continue}yield o}if(this.exitError)throw this.exitError;await this.waitForExit()}catch(n){throw n}finally{r?.(),e.close()}}endInput(){if(this.spawnResolve){this.pendingEndInput=!0;return}this.processStdin&&this.processStdin.end()}getInputStream(){return this.processStdin}onExit(e){if(!this.process)return()=>{};let r=a((n,o)=>{let s=this.getProcessExitError(n,o);e(s)},"Q");return this.process.on("exit",r),this.exitListeners.push({callback:e,handler:r}),()=>{this.process&&this.process.off("exit",r);let n=this.exitListeners.findIndex(o=>o.handler===r);n!==-1&&this.exitListeners.splice(n,1)}}async waitForExit(){if(!this.process){if(this.exitError)throw this.exitError;return}if(this.process.exitCode!==null||this.process.killed||this.exitError){if(this.exitError)throw this.exitError;return}return new Promise((e,r)=>{let n=a((s,c)=>{if(this.abortController.signal.aborted){r(new l1("Operation aborted"));return}let l=this.getProcessExitError(s,c);l?r(l):e()},"J");this.process.once("exit",n);let o=a(s=>{this.process.off("exit",n),r(s)},"Y");this.process.once("error",o),this.process.once("exit",()=>{this.process.off("error",o)})})}};a(cFc,"fx");a(lFc,"gx");AEe="@anthropic-ai/claude-agent-sdk";a(uFc,"ux");a(dFc,"F2");GSt=class{static{a(this,"hQ")}returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,r)=>{this.readResolve=e,this.readReject=r})}enqueue(e){if(this.readResolve){let r=this.readResolve;this.readResolve=void 0,this.readReject=void 0,r({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let r=this.readReject;this.readResolve=void 0,this.readReject=void 0,r(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}};a(fFc,"mx");pFc=fFc();a(g3r,"BX");a(PWi,"AU");a(kWi,"IU");a(hFc,"Z2");a(Z6,"I4");YBr=class{static{a(this,"RU")}sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}},KBr=class{static{a(this,"PU")}transport;isSingleUserTurn;canUseTool;hooks;abortController;jsonSchema;initConfig;onElicitation;getOAuthToken;getHostAuthToken;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new GSt;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;sdkMcpServerInstances=new Map;pendingMcpResponses=new Map;firstResultReceivedResolve;firstResultReceived=!1;lastErrorResultText;transcriptMirrorBatcher;cleanupCallbacks=[];cleanupPromise;setIsSingleUserTurn(e){this.isSingleUserTurn=e}setTranscriptMirrorBatcher(e){this.transcriptMirrorBatcher=e}reportMirrorError(e,r){let n={type:"system",subtype:"mirror_error",error:r,key:e,uuid:(0,qSt.randomUUID)(),session_id:e.sessionId};this.inputStream.enqueue(n)}addCleanupCallback(e){this.cleanupPerformed?e():this.cleanupCallbacks.push(e)}isClosed(){return this.cleanupPerformed}hasBidirectionalNeeds(){return this.sdkMcpTransports.size>0||this.hooks!==void 0&&Object.keys(this.hooks).length>0||this.canUseTool!==void 0||this.onElicitation!==void 0||this.getOAuthToken!==void 0||this.getHostAuthToken!==void 0}constructor(e,r,n,o,s,c=new Map,l,u,d,f,h){this.transport=e,this.isSingleUserTurn=r,this.canUseTool=n,this.hooks=o,this.abortController=s,this.jsonSchema=l,this.initConfig=u,this.onElicitation=d,this.getOAuthToken=f,this.getHostAuthToken=h;for(let[m,g]of c)this.connectSdkMcpServer(m,g);this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}async stopTask(e){await this.request({subtype:"stop_task",task_id:e})}async backgroundTasks(e){return(await this.request({subtype:"background_tasks",tool_use_id:e})).response.backgrounded??!0}close(){this.cleanup()}cleanup(e){return this.cleanupPromise?this.cleanupPromise:(this.cleanupPerformed=!0,this.cleanupPromise=this.performCleanup(e),this.cleanupPromise)}async performCleanup(e){for(let r of this.cleanupCallbacks)try{r()}catch{}if(this.cleanupCallbacks=[],this.transcriptMirrorBatcher)try{await this.transcriptMirrorBatcher.flush()}catch{}try{for(let n of this.cancelControllers.values())n.abort();this.cancelControllers.clear(),this.transport.close();let r=e??Error("Query closed before response received");for(let{reject:n}of this.pendingControlResponses.values())n(r);this.pendingControlResponses.clear();for(let{reject:n}of this.pendingMcpResponses.values())n(r);this.pendingMcpResponses.clear(),this.hookCallbacks.clear();for(let n of this.sdkMcpTransports.values())n.close().catch(()=>{});this.sdkMcpTransports.clear(),e?this.inputStream.error(e):this.inputStream.done()}catch{}}next(...[e]){return this.sdkMessages.next(e)}async return(e){return await this.cleanup(),this.sdkMessages.return(e)}async throw(e){return await this.cleanup(),this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}async[Symbol.asyncDispose](){await this.cleanup()}async readMessages(){try{for await(let e of this.transport.readMessages()){if(e.type==="control_response"){let r=this.pendingControlResponses.get(e.response.request_id);r&&r.handler(e.response);continue}else if(e.type==="control_request"){this.handleControlRequest(e);continue}else if(e.type==="control_cancel_request"){this.handleControlCancelRequest(e);continue}else{if(e.type==="keep_alive")continue;if(e.type==="transcript_mirror"){this.transcriptMirrorBatcher?.enqueue(e.filePath,e.entries);continue}}if(e.type==="system"&&(e.subtype==="post_turn_summary"||e.subtype==="task_summary")){this.inputStream.enqueue(e);continue}e.type==="result"?(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.lastErrorResultText=e.is_error?e.subtype==="success"?e.result:e.errors.join("; "):void 0,this.firstResultReceived=!0,this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&(Wl("[Query.readMessages] First result received for single-turn query, closing stdin"),this.transport.endInput())):e.type==="system"&&e.subtype==="session_state_changed"||(this.lastErrorResultText=void 0),this.inputStream.enqueue(e)}this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.inputStream.done(),this.cleanup()}catch(e){if(this.transcriptMirrorBatcher&&await this.transcriptMirrorBatcher.flush(),this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.lastErrorResultText!==void 0&&!(e instanceof l1)){let r=Error(`Claude Code returned an error result: ${this.lastErrorResultText}`);Wl(`[Query.readMessages] Replacing exit error with result text. Original: ${oSt(e)}`),this.inputStream.error(r),this.cleanup(r);return}this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let r=new AbortController;this.cancelControllers.set(e.request_id,r);try{let n=await this.processControlRequest(e,r.signal);if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:n}};await Promise.resolve(this.transport.write(x0(o)+` +`))}catch(n){if(this.cleanupPerformed)return;let o={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:oSt(n)}};try{await Promise.resolve(this.transport.write(x0(o)+` +`))}catch(s){Wl(`[Query.handleControlRequest] Error-response write failed: ${oSt(s)}`,{level:"error"})}}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let r=this.cancelControllers.get(e.request_id);r&&(r.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,r){if(e.request.subtype==="can_use_tool"){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return{...await this.canUseTool(e.request.tool_name,e.request.input,{signal:r,suggestions:e.request.permission_suggestions,blockedPath:e.request.blocked_path,decisionReason:e.request.decision_reason,title:e.request.title,displayName:e.request.display_name,description:e.request.description,toolUseID:e.request.tool_use_id,agentID:e.request.agent_id}),toolUseID:e.request.tool_use_id}}else{if(e.request.subtype==="hook_callback")return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,r);if(e.request.subtype==="mcp_message"){let n=e.request,o=this.sdkMcpTransports.get(n.server_name);if(!o)throw Error(`SDK MCP server not found: ${n.server_name}`);return"method"in n.message&&"id"in n.message&&n.message.id!==null?{mcp_response:await this.handleMcpControlRequest(n.server_name,n,o)}:(o.onmessage&&o.onmessage(n.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}else if(e.request.subtype==="elicitation"){let n=e.request;return this.onElicitation?await this.onElicitation({serverName:n.mcp_server_name,message:n.message,mode:n.mode,url:n.url,elicitationId:n.elicitation_id,requestedSchema:n.requested_schema,title:n.title,displayName:n.display_name,description:n.description},{signal:r}):{action:"decline"}}else if(e.request.subtype==="oauth_token_refresh"){if(!this.getOAuthToken)throw Error("getOAuthToken callback is not provided.");return{accessToken:await this.getOAuthToken({signal:r})??null}}else if(e.request.subtype==="host_auth_token_refresh"){if(!this.getHostAuthToken)throw Error("getHostAuthToken callback is not provided.");return{authToken:await this.getHostAuthToken({signal:r})??null}}}throw Error("Unsupported control request subtype: "+e.request.subtype)}async*readSdkMessages(){try{for await(let e of this.inputStream)yield e}finally{await this.cleanup()}}async initialize(){let e;if(this.hooks){e={};for(let[o,s]of Object.entries(this.hooks))s.length>0&&(e[o]=s.map(c=>{let l=[];for(let u of c.hooks){let d=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(d,u),l.push(d)}return{matcher:c.matcher,hookCallbackIds:l,timeout:c.timeout}}))}let r=this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0,n={subtype:"initialize",hooks:e,sdkMcpServers:r,jsonSchema:this.jsonSchema,systemPrompt:typeof this.initConfig?.systemPrompt=="string"?[this.initConfig.systemPrompt]:this.initConfig?.systemPrompt,appendSystemPrompt:this.initConfig?.appendSystemPrompt,planModeInstructions:this.initConfig?.planModeInstructions,appendSubagentSystemPrompt:this.initConfig?.appendSubagentSystemPrompt,toolAliases:this.initConfig?.toolAliases,excludeDynamicSections:this.initConfig?.excludeDynamicSections,agents:this.initConfig?.agents,title:this.initConfig?.title,skills:Array.isArray(this.initConfig?.skills)?this.initConfig.skills:void 0,webSearchIsolationExemptMcpServers:this.initConfig?.webSearchIsolationExemptMcpServers,promptSuggestions:this.initConfig?.promptSuggestions,agentProgressSummaries:this.initConfig?.agentProgressSummaries,forwardSubagentText:this.initConfig?.forwardSubagentText};return(await this.request(n)).response}async interrupt(){return Z6("sdk_interrupt",async()=>{await this.request({subtype:"interrupt"})})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async applyFlagSettings(e){return Z6("sdk_apply_flag_settings",async()=>{await this.request({subtype:"apply_flag_settings",settings:e})})}async getSettings(){return(await this.request({subtype:"get_settings"})).response}async rewindFiles(e,r){return Z6("sdk_rewind_files",async()=>(await this.request({subtype:"rewind_files",user_message_id:e,dry_run:r?.dryRun})).response)}async cancelAsyncMessage(e){return(await this.request({subtype:"cancel_async_message",message_uuid:e})).response.cancelled}async seedReadState(e,r){await this.request({subtype:"seed_read_state",path:e,mtime:r})}async enableRemoteControl(e,r){return(await this.request({subtype:"remote_control",enabled:e,...r!==void 0&&{name:r}})).response}async submitFeedback(e,r){return(await this.request({subtype:"submit_feedback",description:e,surface:r?.surface})).response}async generateSessionTitle(e,r){return Z6("sdk_session_title_generate",async()=>(await this.request({subtype:"generate_session_title",description:e,persist:r?.persist})).response.title)}async askSideQuestion(e){return Z6("sdk_side_question",async()=>{let r=(await this.request({subtype:"side_question",question:e})).response;return r.response===null?null:{response:r.response,synthetic:r.synthetic??!1}})}async launchUltrareview(e,r){return(await this.request({subtype:"ultrareview_launch",args:e,confirm:r?.confirm??!1})).response}async messageRated(e){await this.request({subtype:"message_rated",messageUuid:e.messageUuid,sentiment:e.sentiment,surface:e.surface,cleared:e.cleared??!1})}processPendingPermissionRequests(e){for(let r of e)r.request.subtype==="can_use_tool"&&this.handleControlRequest(r).catch(()=>{})}request(e){let r=Math.random().toString(36).substring(2,15),n={request_id:r,type:"control_request",request:e};return new Promise((o,s)=>{this.pendingControlResponses.set(r,{handler:a(c=>{this.pendingControlResponses.delete(r),c.subtype==="success"?o(c):(s(Error(c.error)),c.pending_permission_requests&&this.processPendingPermissionRequests(c.pending_permission_requests))},"handler"),reject:s}),Promise.resolve(this.transport.write(x0(n)+` +`)).catch(c=>{this.pendingControlResponses.delete(r),s(c)})})}initializationResult(){return this.initialization}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async supportedAgents(){return(await this.initialization).agents}async reconnectMcpServer(e){await this.request({subtype:"mcp_reconnect",serverName:e})}async toggleMcpServer(e,r){return Z6("sdk_mcp_toggle_server",async()=>{await this.request({subtype:"mcp_toggle",serverName:e,enabled:r})})}async enableChannel(e){return Z6("sdk_mcp_enable_channel",async()=>{await this.request({subtype:"channel_enable",serverName:e})})}async mcpAuthenticate(e,r){return(await this.request({subtype:"mcp_authenticate",serverName:e,redirectUri:r})).response}async mcpClearAuth(e){return(await this.request({subtype:"mcp_clear_auth",serverName:e})).response}async mcpSubmitOAuthCallbackUrl(e,r){return(await this.request({subtype:"mcp_oauth_callback_url",serverName:e,callbackUrl:r})).response}async claudeAuthenticate(e){return(await this.request({subtype:"claude_authenticate",loginWithClaudeAi:e})).response}async claudeOAuthCallback(e,r){return(await this.request({subtype:"claude_oauth_callback",authorizationCode:e,state:r})).response}async claudeOAuthWaitForCompletion(){return(await this.request({subtype:"claude_oauth_wait_for_completion"})).response}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async getContextUsage(){return(await this.request({subtype:"get_context_usage"})).response}async readFile(e,r){try{return(await this.request({subtype:"read_file",path:e,max_bytes:r?.maxBytes,encoding:r?.encoding})).response}catch{return null}}async reloadPlugins(){return Z6("sdk_reload_plugins",async()=>(await this.request({subtype:"reload_plugins"})).response)}async setMcpServers(e){return Z6("sdk_mcp_set_servers",async()=>{let r={},n={};for(let[l,u]of Object.entries(e))u.type==="sdk"&&"instance"in u?r[l]=u.instance:n[l]=u;let o=new Set(this.sdkMcpServerInstances.keys()),s=new Set(Object.keys(r));for(let l of o)s.has(l)||await this.disconnectSdkMcpServer(l);for(let[l,u]of Object.entries(r))o.has(l)||this.connectSdkMcpServer(l,u);let c={};for(let l of Object.keys(r))c[l]={type:"sdk",name:l};return(await this.request({subtype:"mcp_set_servers",servers:{...n,...c}})).response})}async accountInfo(){return(await this.initialization).account}async streamInput(e){Wl("[Query.streamInput] Starting to process input stream");try{let r=0;for await(let n of e){if(r++,Wl(`[Query.streamInput] Processing message ${r}: ${n.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(x0(n)+` +`))}Wl(`[Query.streamInput] Finished processing ${r} messages from input stream`),r>0&&this.hasBidirectionalNeeds()&&(Wl("[Query.streamInput] Has bidirectional needs, waiting for first result"),await this.waitForFirstResult()),Wl("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(r){if(!(r instanceof l1))throw r}}waitForFirstResult(){return this.firstResultReceived?(Wl("[Query.waitForFirstResult] Result already received, returning immediately"),Promise.resolve()):new Promise(e=>{if(this.abortController?.signal.aborted){e();return}this.abortController?.signal.addEventListener("abort",()=>e(),{once:!0}),this.firstResultReceivedResolve=e})}handleHookCallbacks(e,r,n,o){let s=this.hookCallbacks.get(e);if(!s)throw Error(`No hook callback found for ID: ${e}`);return s(r,n,{signal:o})}connectSdkMcpServer(e,r){let n=new YBr(o=>this.sendMcpServerMessageToCli(e,o));this.sdkMcpTransports.set(e,n),this.sdkMcpServerInstances.set(e,r),r.connect(n).catch(o=>{this.sdkMcpTransports.get(e)===n&&this.sdkMcpTransports.delete(e),this.sdkMcpServerInstances.get(e)===r&&this.sdkMcpServerInstances.delete(e),Wl(`[Query.connectSdkMcpServer] Failed to connect MCP server '${e}': ${o}`,{level:"error"})})}async disconnectSdkMcpServer(e){let r=this.sdkMcpTransports.get(e);r&&(await r.close(),this.sdkMcpTransports.delete(e)),this.sdkMcpServerInstances.delete(e)}sendMcpServerMessageToCli(e,r){if("id"in r&&r.id!==null&&r.id!==void 0){let o=`${e}:${r.id}`,s=this.pendingMcpResponses.get(o);if(s){s.resolve(r),this.pendingMcpResponses.delete(o);return}}let n={type:"control_request",request_id:(0,qSt.randomUUID)(),request:{subtype:"mcp_message",server_name:e,message:r}};Promise.resolve(this.transport.write(x0(n)+` +`)).catch(o=>{Wl(`[Query.sendMcpServerMessageToCli] Transport write failed: ${o}`,{level:"error"})})}handleMcpControlRequest(e,r,n){let o="id"in r.message?r.message.id:null,s=`${e}:${o}`;return new Promise((c,l)=>{let u=a(()=>{this.pendingMcpResponses.delete(s)},"U"),d=a(h=>{u(),c(h)},"H"),f=a(h=>{u(),l(h)},"q");if(this.pendingMcpResponses.set(s,{resolve:d,reject:f}),n.onmessage)n.onmessage(r.message);else{u(),l(Error("No message handler registered"));return}})}},A3r=500,y3r=1048576,mFc=[200,800],JBr=class{static{a(this,"EU")}send;sendTimeoutMs;onError;maxPendingEntries;maxPendingBytes;backoffMs;pending=[];pendingEntries=0;pendingBytes=0;flushPromise=null;constructor(e,r=6e4,n,o=A3r,s=y3r,c=mFc){this.send=e,this.sendTimeoutMs=r,this.onError=n,this.maxPendingEntries=o,this.maxPendingBytes=s,this.backoffMs=c}enqueue(e,r){let n=x0(r).length;this.pending.push({filePath:e,entries:r,bytes:n}),this.pendingEntries+=r.length,this.pendingBytes+=n,(this.pendingEntries>this.maxPendingEntries||this.pendingBytes>this.maxPendingBytes)&&(this.flushPromise=this.drain(),this.flushPromise.catch(()=>{}))}async flush(){let e=this.drain();this.flushPromise=e,await e,this.flushPromise===e&&(this.flushPromise=null)}async drain(){let e=this.flushPromise,r=this.pending.splice(0);this.pendingEntries=0,this.pendingBytes=0,e&&await e,r.length!==0&&await this.doFlush(r)}async doFlush(e){let r=new Map;for(let o of e){let s=r.get(o.filePath);s?s.push(...o.entries):r.set(o.filePath,o.entries.slice())}let n=this.backoffMs.length+1;for(let[o,s]of r){let c=`SessionStore.append() timed out after ${this.sendTimeoutMs}ms for ${o}`,l,u=1;for(;u<=n;u++)try{await Nne(this.send(o,s),this.sendTimeoutMs,c),l=void 0;break}catch(d){if(l=H3e(d),l.message===c)break;let f=this.backoffMs[u-1];if(f===void 0)break;await gVi(f)}if(l){Wl(`[TranscriptMirrorBatcher] flush failed for ${o} after ${u} attempt(s): ${l}`,{level:"error"});try{this.onError?.(o,l)}catch(d){Wl(`[TranscriptMirrorBatcher] onError callback threw: ${d}`,{level:"error"})}}}}},OGi=qLr(LNc(),1);a(gFc,"Ug");a(u3e,"O0");a(AFc,"qg");sBr=new Map,yFc=5e3;a(EFc,"Bg");a(_Fc,"zg");a(vFc,"OZ");CFc=(0,OWi.promisify)(MWi.execFile);a($3e,"m4");a(bFc,"jH");r9=65536,SFc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;a(ph,"L$");a(FWi,"ZZ");a(aBr,"IX");a(QR,"A6");a(XBr,"rQ");a(UWi,"RX");a(TFc,"MZ");a(QWi,"PX");E3e=200;a(IFc,"Lg");a(V3e,"F0");a(_V,"U4");a(xFc,"jg");a(W3e,"M1");a(iN,"j6");a(jTt,"L1");wFc=1048576,RFc=5242880;a(kFc,"Rg");a(qWi,"jZ");a(Bne,"D0");a($St,"jX");VSt=Buffer.from('{"type":"attribution-snapshot"'),DFc=Buffer.from('{"type":"system"'),_3e=10,NFc=Buffer.from([_3e]),MFc=256;a(OFc,"_g");a(BFc,"kg");a(LFc,"Sg");a(FFc,"vg");a(UFc,"Cg");a(QFc,"AZ");a(qFc,"xg");a(jFc,"yg");a(HFc,"fg");a(cBr,"IH");a(GFc,"gg");a($Fc,"hg");a(VFc,"ug");a(jWi,"RH");a(HWi,"PH");a(WFc,"IZ");a(GWi,"RZ");a(zFc,"PZ");a(HTt,"k8");a(i3e,"oQ");a($Wi,"EZ");YFc=32;a(KFc,"pg");a(JFc,"dg");a(ZFc,"ig");a(XFc,"ng");a(e8c,"rg");a(t8c,"bZ");a(r8c,"_Z");a(n8c,"CZ");a(i8c,"TZ");a(o8c,"xZ");a(s8c,"ag");a(VWi,"yZ");a(lBr,"_H");a(a8c,"sg");c8c=new Set(["user","assistant","attachment","system","progress"]);a(l8c,"$h");a(u8c,"Qh");a(WWi,"fZ");a(d8c,"gZ");a(f8c,"Jh");a(p8c,"hZ");a(h8c,"Xh");a(zWi,"uZ");a(YWi,"lZ");a(KWi,"cZ");a(m8c,"Wh");a(g8c,"Gh");a(A8c,"pZ");a(y8c,"dZ");a(JWi,"vH");a(ezi,"CH");a(tzi,"bX");a(E8c,"Uh");_8c="user:inference",rzi="user:profile",v8c="org:create_api_key",C8c=[v8c,rzi],b8c=[rzi,_8c,"user:sessions:claude_code","user:mcp_servers","user:file_upload"],U5h=tzi([...C8c,...b8c]),BGi={BASE_API_URL:"https://api.anthropic.com",CONSOLE_AUTHORIZE_URL:"https://platform.claude.com/oauth/authorize",CLAUDE_AI_AUTHORIZE_URL:"https://claude.com/cai/oauth/authorize",CLAUDE_AI_ORIGIN:"https://claude.ai",TOKEN_URL:"https://platform.claude.com/v1/oauth/token",API_KEY_URL:"https://api.anthropic.com/api/oauth/claude_cli/create_api_key",ROLES_URL:"https://api.anthropic.com/api/oauth/claude_cli/roles",CONSOLE_SUCCESS_URL:"https://platform.claude.com/buy_credits?returnUrl=/oauth/code/success%3Fapp%3Dclaude-code",CLAUDEAI_SUCCESS_URL:"https://platform.claude.com/oauth/code/success?app=claude-code",MANUAL_REDIRECT_URL:"https://platform.claude.com/oauth/code/callback",CLIENT_ID:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",OAUTH_FILE_SUFFIX:"",MCP_PROXY_URL:"https://mcp-proxy.anthropic.com",MCP_PROXY_PATH:"/v1/mcp/{server_id}"},S8c=void 0;a(T8c,"zh");I8c=["https://beacon.claude-ai.staging.ant.dev","https://claude.fedstart.com","https://claude-staging.fedstart.com"];a(x8c,"rZ");w8c="-credentials";a(R8c,"tZ");P8c=/^[a-zA-Z0-9._-]+$/;a(k8c,"aZ");(function(t){t.assertEqual=o=>{};function e(o){}a(e,"Q"),t.assertIs=e;function r(o){throw Error()}a(r,"J"),t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let c of o)s[c]=c;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),c={};for(let l of s)c[l]=o[l];return t.objectValues(c)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let c in o)Object.prototype.hasOwnProperty.call(o,c)&&s.push(c);return s},t.find=(o,s)=>{for(let c of o)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}a(n,"Y"),t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(lc||(lc={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(LGi||(LGi={}));wn=lc.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),aV=a(t=>{switch(typeof t){case"undefined":return wn.undefined;case"string":return wn.string;case"number":return Number.isNaN(t)?wn.nan:wn.number;case"boolean":return wn.boolean;case"function":return wn.function;case"bigint":return wn.bigint;case"symbol":return wn.symbol;case"object":return Array.isArray(t)?wn.array:t===null?wn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?wn.promise:typeof Map<"u"&&t instanceof Map?wn.map:typeof Set<"u"&&t instanceof Set?wn.set:typeof Date<"u"&&t instanceof Date?wn.date:wn.object;default:return wn.unknown}},"l4"),hr=lc.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),GR=class t extends Error{static{a(this,"f6")}get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};GR.create=t=>new GR(t);D8c=a((t,e)=>{let r;switch(t.code){case hr.invalid_type:t.received===wn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case hr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,lc.jsonStringifyReplacer)}`;break;case hr.unrecognized_keys:r=`Unrecognized key(s) in object: ${lc.joinValues(t.keys,", ")}`;break;case hr.invalid_union:r="Invalid input";break;case hr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${lc.joinValues(t.options)}`;break;case hr.invalid_enum_value:r=`Invalid enum value. Expected ${lc.joinValues(t.options)}, received '${t.received}'`;break;case hr.invalid_arguments:r="Invalid function arguments";break;case hr.invalid_return_type:r="Invalid function return type";break;case hr.invalid_date:r="Invalid date";break;case hr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:lc.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case hr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case hr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case hr.custom:r="Invalid input";break;case hr.invalid_intersection_types:r="Intersection results could not be merged";break;case hr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case hr.not_finite:r="Number must be finite";break;default:r=e.defaultError,lc.assertNever(t)}return{message:r}},"Fh"),C3e=D8c,N8c=C3e;a(tLr,"tQ");rLr=a(t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],c={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="",u=n.filter(d=>!!d).slice().reverse();for(let d of u)l=d(c,{data:e,defaultError:l}).message;return{...o,path:s,message:l}},"_X");a(cn,"f");Bv=class t{static{a(this,"U6")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return eo;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let s=await o.key,c=await o.value;n.push({key:s,value:c})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:c}=o;if(s.status==="aborted"||c.status==="aborted")return eo;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}},eo=Object.freeze({status:"aborted"}),s3e=a(t=>({status:"dirty",value:t}),"v8"),d1=a(t=>({status:"valid",value:t}),"z6"),FGi=a(t=>t.status==="aborted","TH"),UGi=a(t=>t.status==="dirty","xH"),BEe=a(t=>t.status==="valid","Z0"),YSt=a(t=>typeof Promise<"u"&&t instanceof Promise,"aQ");(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Kn||(Kn={}));VR=class{static{a(this,"H4")}constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},QGi=a((t,e)=>{if(BEe(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new GR(t.common.issues);return this._error=r,this._error}}},"eZ");a(Vo,"e");ws=class{static{a(this,"Y$")}get description(){return this._def.description}_getType(e){return aV(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:aV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bv,ctx:{common:e.parent.common,data:e.data,parsedType:aV(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(YSt(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aV(e)},o=this._parseSync({data:e,path:n.path,parent:n});return QGi(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aV(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return BEe(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>BEe(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aV(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(YSt(o)?o:Promise.resolve(o));return QGi(n,s)}refine(e,r){let n=a(o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r,"J");return this._refinement((o,s)=>{let c=e(o),l=a(()=>s.addIssue({code:hr.custom,...n(o)}),"G");return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new aN({schema:this,typeName:Cr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return $R.create(this,this._def)}nullable(){return a9.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return AV.create(this)}promise(){return Hne.create(this,this._def)}or(e){return QEe.create([this,e],this._def)}and(e){return qEe.create(this,e,this._def)}transform(e){return new aN({...Vo(this._def),schema:this,typeName:Cr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new VEe({...Vo(this._def),innerType:this,defaultValue:r,typeName:Cr.ZodDefault})}brand(){return new KSt({typeName:Cr.ZodBranded,type:this,...Vo(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new WEe({...Vo(this._def),innerType:this,catchValue:r,typeName:Cr.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return JSt.create(this,e)}readonly(){return zEe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},M8c=/^c[^\s-]{8,}$/i,O8c=/^[0-9a-z]+$/,B8c=/^[0-9A-HJKMNP-TV-Z]{26}$/i,L8c=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,F8c=/^[a-z0-9_-]{21}$/i,U8c=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Q8c=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,q8c=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,j8c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",H8c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,G8c=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,$8c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,V8c=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W8c=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z8c=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nzi="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Y8c=new RegExp(`^${nzi}$`);a(izi,"QM");a(K8c,"yh");a(J8c,"fh");a(Z8c,"gh");a(X8c,"hh");a(e6c,"uh");LEe=class t extends ws{static{a(this,"p4")}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==wn.string){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.string,received:o.parsedType}),eo}let r=new Bv,n;for(let o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(n=this._getOrReturnCtx(e,n),cn(n,{code:hr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,c=e.data.lengthe.test(o),{validation:r,code:hr.invalid_string,...Kn.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Kn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Kn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Kn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Kn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Kn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Kn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Kn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Kn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Kn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Kn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Kn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Kn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Kn.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Kn.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Kn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Kn.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Kn.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Kn.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Kn.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Kn.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Kn.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Kn.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Kn.errToObj(r)})}nonempty(e){return this.min(1,Kn.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew LEe({checks:[],typeName:Cr.ZodString,coerce:t?.coerce??!1,...Vo(t)});a(t6c,"mh");b3e=class t extends ws{static{a(this,"T8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==wn.number){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.number,received:o.parsedType}),eo}let r,n=new Bv;for(let o of this._def.checks)o.kind==="int"?lc.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.invalid_type,expected:"integer",received:"float",message:o.message}),n.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),n.dirty()):o.kind==="multipleOf"?t6c(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_finite,message:o.message}),n.dirty()):lc.assertNever(o);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Kn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Kn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kn.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuee.kind==="int"||e.kind==="multipleOf"&&lc.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.valuenew b3e({checks:[],typeName:Cr.ZodNumber,coerce:t?.coerce||!1,...Vo(t)});S3e=class t extends ws{static{a(this,"x8")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==wn.bigint)return this._getInvalidInput(e);let r,n=new Bv;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),n.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),cn(r,{code:hr.not_multiple_of,multipleOf:o.value,message:o.message}),n.dirty()):lc.assertNever(o);return{status:n.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.bigint,received:r.parsedType}),eo}gte(e,r){return this.setLimit("min",e,!0,Kn.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Kn.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Kn.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Kn.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Kn.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kn.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Kn.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew S3e({checks:[],typeName:Cr.ZodBigInt,coerce:t?.coerce??!1,...Vo(t)});T3e=class extends ws{static{a(this,"kX")}_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==wn.boolean){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.boolean,received:r.parsedType}),eo}return d1(e.data)}};T3e.create=t=>new T3e({typeName:Cr.ZodBoolean,coerce:t?.coerce||!1,...Vo(t)});I3e=class t extends ws{static{a(this,"eQ")}_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==wn.date){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_type,expected:wn.date,received:o.parsedType}),eo}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return cn(o,{code:hr.invalid_date}),eo}let r=new Bv,n;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(n=this._getOrReturnCtx(e,n),cn(n,{code:hr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):lc.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Kn.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Kn.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.valuenew I3e({checks:[],coerce:t?.coerce||!1,typeName:Cr.ZodDate,...Vo(t)});x3e=class extends ws{static{a(this,"SX")}_parse(e){if(this._getType(e)!==wn.symbol){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.symbol,received:r.parsedType}),eo}return d1(e.data)}};x3e.create=t=>new x3e({typeName:Cr.ZodSymbol,...Vo(t)});FEe=class extends ws{static{a(this,"$7")}_parse(e){if(this._getType(e)!==wn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.undefined,received:r.parsedType}),eo}return d1(e.data)}};FEe.create=t=>new FEe({typeName:Cr.ZodUndefined,...Vo(t)});UEe=class extends ws{static{a(this,"Q7")}_parse(e){if(this._getType(e)!==wn.null){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.null,received:r.parsedType}),eo}return d1(e.data)}};UEe.create=t=>new UEe({typeName:Cr.ZodNull,...Vo(t)});w3e=class extends ws{static{a(this,"vX")}constructor(){super(...arguments),this._any=!0}_parse(e){return d1(e.data)}};w3e.create=t=>new w3e({typeName:Cr.ZodAny,...Vo(t)});pV=class extends ws{static{a(this,"M0")}constructor(){super(...arguments),this._unknown=!0}_parse(e){return d1(e.data)}};pV.create=t=>new pV({typeName:Cr.ZodUnknown,...Vo(t)});iB=class extends ws{static{a(this,"d4")}_parse(e){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.never,received:r.parsedType}),eo}};iB.create=t=>new iB({typeName:Cr.ZodNever,...Vo(t)});R3e=class extends ws{static{a(this,"CX")}_parse(e){if(this._getType(e)!==wn.undefined){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.void,received:r.parsedType}),eo}return d1(e.data)}};R3e.create=t=>new R3e({typeName:Cr.ZodVoid,...Vo(t)});AV=class t extends ws{static{a(this,"R4")}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==wn.array)return cn(r,{code:hr.invalid_type,expected:wn.array,received:r.parsedType}),eo;if(o.exactLength!==null){let c=r.data.length>o.exactLength.value,l=r.data.lengtho.maxLength.value&&(cn(r,{code:hr.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>o.type._parseAsync(new VR(r,c,r.path,l)))).then(c=>Bv.mergeArray(n,c));let s=[...r.data].map((c,l)=>o.type._parseSync(new VR(r,c,r.path,l)));return Bv.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Kn.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Kn.toString(r)}})}nonempty(e){return this.min(1,e)}};AV.create=(t,e)=>new AV({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Cr.ZodArray,...Vo(e)});a(vEe,"C8");dI=class t extends ws{static{a(this,"g$")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=lc.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==wn.object){let u=this._getOrReturnCtx(e);return cn(u,{code:hr.invalid_type,expected:wn.object,received:u.parsedType}),eo}let{status:r,ctx:n}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof iB&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||c.push(u);let l=[];for(let u of s){let d=o[u],f=n.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new VR(n,f,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof iB){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of c)l.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")c.length>0&&(cn(n,{code:hr.unrecognized_keys,keys:c}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of c){let f=n.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new VR(n,f,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of l){let f=await d.key,h=await d.value;u.push({key:f,value:h,alwaysSet:d.alwaysSet})}return u}).then(u=>Bv.mergeObjectSync(r,u)):Bv.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Kn.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:a((r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Kn.errToObj(e).message??o}:{message:o}},"errorMap")}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:a(()=>({...this._def.shape(),...e}),"shape")})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:a(()=>({...this._def.shape(),...e._def.shape()}),"shape"),typeName:Cr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of lc.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}omit(e){let r={};for(let n of lc.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return vEe(this)}partial(e){let r={};for(let n of lc.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:a(()=>r,"shape")})}required(e){let r={};for(let n of lc.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof $R;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:a(()=>r,"shape")})}keyof(){return ozi(lc.objectKeys(this.shape))}};dI.create=(t,e)=>new dI({shape:a(()=>t,"shape"),unknownKeys:"strip",catchall:iB.create(),typeName:Cr.ZodObject,...Vo(e)});dI.strictCreate=(t,e)=>new dI({shape:a(()=>t,"shape"),unknownKeys:"strict",catchall:iB.create(),typeName:Cr.ZodObject,...Vo(e)});dI.lazycreate=(t,e)=>new dI({shape:t,unknownKeys:"strip",catchall:iB.create(),typeName:Cr.ZodObject,...Vo(e)});QEe=class extends ws{static{a(this,"J7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new GR(l.ctx.common.issues));return cn(r,{code:hr.invalid_union,unionErrors:c}),eo}if(a(o,"Y"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(o);{let s,c=[];for(let u of n){let d={...r,common:{...r.common,issues:[]},parent:null},f=u._parseSync({data:r.data,path:r.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(u=>new GR(u));return cn(r,{code:hr.invalid_union,unionErrors:l}),eo}}get options(){return this._def.options}};QEe.create=(t,e)=>new QEe({options:t,typeName:Cr.ZodUnion,...Vo(e)});X6=a(t=>t instanceof jEe?X6(t.schema):t instanceof aN?X6(t.innerType()):t instanceof HEe?[t.value]:t instanceof GEe?t.options:t instanceof $Ee?lc.objectValues(t.enum):t instanceof VEe?X6(t._def.innerType):t instanceof FEe?[void 0]:t instanceof UEe?[null]:t instanceof $R?[void 0,...X6(t.unwrap())]:t instanceof a9?[null,...X6(t.unwrap())]:t instanceof KSt||t instanceof zEe?X6(t.unwrap()):t instanceof WEe?X6(t._def.innerType):[],"c4"),nLr=class t extends ws{static{a(this,"gH")}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.object)return cn(r,{code:hr.invalid_type,expected:wn.object,received:r.parsedType}),eo;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(cn(r,{code:hr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),eo)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let c=X6(s.shape[e]);if(!c.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let l of c){if(o.has(l))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);o.set(l,s)}}return new t({typeName:Cr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...Vo(n)})}};a(iLr,"fH");qEe=class extends ws{static{a(this,"X7")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=a((s,c)=>{if(FGi(s)||FGi(c))return eo;let l=iLr(s.value,c.value);return l.valid?((UGi(s)||UGi(c))&&r.dirty(),{status:r.value,value:l.data}):(cn(n,{code:hr.invalid_intersection_types}),eo)},"Y");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>o(s,c)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};qEe.create=(t,e,r)=>new qEe({left:t,right:e,typeName:Cr.ZodIntersection,...Vo(r)});s9=class t extends ws{static{a(this,"i4")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.array)return cn(n,{code:hr.invalid_type,expected:wn.array,received:n.parsedType}),eo;if(n.data.lengththis._def.items.length&&(cn(n,{code:hr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new VR(n,s,n.path,c)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Bv.mergeArray(r,s)):Bv.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};s9.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new s9({items:t,typeName:Cr.ZodTuple,rest:null,...Vo(e)})};oLr=class t extends ws{static{a(this,"TX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.object)return cn(n,{code:hr.invalid_type,expected:wn.object,received:n.parsedType}),eo;let o=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)o.push({key:s._parse(new VR(n,l,n.path,l)),value:c._parse(new VR(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?Bv.mergeObjectAsync(r,o):Bv.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ws?new t({keyType:e,valueType:r,typeName:Cr.ZodRecord,...Vo(n)}):new t({keyType:LEe.create(),valueType:e,typeName:Cr.ZodRecord,...Vo(r)})}},P3e=class extends ws{static{a(this,"xX")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.map)return cn(n,{code:hr.invalid_type,expected:wn.map,received:n.parsedType}),eo;let o=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,u],d)=>({key:o._parse(new VR(n,l,n.path,[d,"key"])),value:s._parse(new VR(n,u,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of c){let d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of c){let{key:d,value:f}=u;if(d.status==="aborted"||f.status==="aborted")return eo;(d.status==="dirty"||f.status==="dirty")&&r.dirty(),l.set(d.value,f.value)}return{status:r.value,value:l}}}};P3e.create=(t,e,r)=>new P3e({valueType:e,keyType:t,typeName:Cr.ZodMap,...Vo(r)});k3e=class t extends ws{static{a(this,"y8")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==wn.set)return cn(n,{code:hr.invalid_type,expected:wn.set,received:n.parsedType}),eo;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(cn(n,{code:hr.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function c(u){let d=new Set;for(let f of u){if(f.status==="aborted")return eo;f.status==="dirty"&&r.dirty(),d.add(f.value)}return{status:r.value,value:d}}a(c,"W");let l=[...n.data.values()].map((u,d)=>s._parse(new VR(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(e,r){return new t({...this._def,minSize:{value:e,message:Kn.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Kn.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};k3e.create=(t,e)=>new k3e({valueType:t,minSize:null,maxSize:null,typeName:Cr.ZodSet,...Vo(e)});sLr=class t extends ws{static{a(this,"sQ")}constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.function)return cn(r,{code:hr.invalid_type,expected:wn.function,received:r.parsedType}),eo;function n(l,u){return rLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,tLr(),C3e].filter(d=>!!d),issueData:{code:hr.invalid_arguments,argumentsError:u}})}a(n,"J");function o(l,u){return rLr({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,tLr(),C3e].filter(d=>!!d),issueData:{code:hr.invalid_return_type,returnTypeError:u}})}a(o,"Y");let s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof Hne){let l=this;return d1(async function(...u){let d=new GR([]),f=await l._def.args.parseAsync(u,s).catch(m=>{throw d.addIssue(n(u,m)),d}),h=await Reflect.apply(c,this,f);return await l._def.returns._def.type.parseAsync(h,s).catch(m=>{throw d.addIssue(o(h,m)),d})})}else{let l=this;return d1(function(...u){let d=l._def.args.safeParse(u,s);if(!d.success)throw new GR([n(u,d.error)]);let f=Reflect.apply(c,this,d.data),h=l._def.returns.safeParse(f,s);if(!h.success)throw new GR([o(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:s9.create(e).rest(pV.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||s9.create([]).rest(pV.create()),returns:r||pV.create(),typeName:Cr.ZodFunction,...Vo(n)})}},jEe=class extends ws{static{a(this,"Y7")}get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};jEe.create=(t,e)=>new jEe({getter:t,typeName:Cr.ZodLazy,...Vo(e)});HEe=class extends ws{static{a(this,"W7")}_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return cn(r,{received:r.data,code:hr.invalid_literal,expected:this._def.value}),eo}return{status:"valid",value:e.data}}get value(){return this._def.value}};HEe.create=(t,e)=>new HEe({value:t,typeName:Cr.ZodLiteral,...Vo(e)});a(ozi,"JM");GEe=class t extends ws{static{a(this,"L0")}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return cn(r,{expected:lc.joinValues(n),received:r.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return cn(r,{received:r.data,code:hr.invalid_enum_value,options:n}),eo}return d1(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};GEe.create=ozi;$Ee=class extends ws{static{a(this,"G7")}_parse(e){let r=lc.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==wn.string&&n.parsedType!==wn.number){let o=lc.objectValues(r);return cn(n,{expected:lc.joinValues(o),received:n.parsedType,code:hr.invalid_type}),eo}if(this._cache||(this._cache=new Set(lc.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=lc.objectValues(r);return cn(n,{received:n.data,code:hr.invalid_enum_value,options:o}),eo}return d1(e.data)}get enum(){return this._def.values}};$Ee.create=(t,e)=>new $Ee({values:t,typeName:Cr.ZodNativeEnum,...Vo(e)});Hne=class extends ws{static{a(this,"f8")}unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==wn.promise&&r.common.async===!1)return cn(r,{code:hr.invalid_type,expected:wn.promise,received:r.parsedType}),eo;let n=r.parsedType===wn.promise?r.data:Promise.resolve(r.data);return d1(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Hne.create=(t,e)=>new Hne({type:t,typeName:Cr.ZodPromise,...Vo(e)});aN=class extends ws{static{a(this,"P4")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Cr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:a(c=>{cn(n,c),c.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let c=o.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async l=>{if(r.value==="aborted")return eo;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?eo:u.status==="dirty"||r.value==="dirty"?s3e(u.value):u});{if(r.value==="aborted")return eo;let l=this._def.schema._parseSync({data:c,path:n.path,parent:n});return l.status==="aborted"?eo:l.status==="dirty"||r.value==="dirty"?s3e(l.value):l}}if(o.type==="refinement"){let c=a(l=>{let u=o.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"W");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?eo:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?eo:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(o.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!BEe(c))return eo;let l=o.transform(c.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>BEe(c)?Promise.resolve(o.transform(c.value,s)).then(l=>({status:r.value,value:l})):eo);lc.assertNever(o)}};aN.create=(t,e,r)=>new aN({schema:t,typeName:Cr.ZodEffects,effect:e,...Vo(r)});aN.createWithPreprocess=(t,e,r)=>new aN({schema:e,effect:{type:"preprocess",transform:t},typeName:Cr.ZodEffects,...Vo(r)});$R=class extends ws{static{a(this,"o6")}_parse(e){return this._getType(e)===wn.undefined?d1(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$R.create=(t,e)=>new $R({innerType:t,typeName:Cr.ZodOptional,...Vo(e)});a9=class extends ws{static{a(this,"A1")}_parse(e){return this._getType(e)===wn.null?d1(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a9.create=(t,e)=>new a9({innerType:t,typeName:Cr.ZodNullable,...Vo(e)});VEe=class extends ws{static{a(this,"U7")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===wn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};VEe.create=(t,e)=>new VEe({innerType:t,typeName:Cr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Vo(e)});WEe=class extends ws{static{a(this,"H7")}_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return YSt(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new GR(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new GR(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};WEe.create=(t,e)=>new WEe({innerType:t,typeName:Cr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Vo(e)});D3e=class extends ws{static{a(this,"yX")}_parse(e){if(this._getType(e)!==wn.nan){let r=this._getOrReturnCtx(e);return cn(r,{code:hr.invalid_type,expected:wn.nan,received:r.parsedType}),eo}return{status:"valid",value:e.data}}};D3e.create=t=>new D3e({typeName:Cr.ZodNaN,...Vo(t)});KSt=class extends ws{static{a(this,"hH")}_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},JSt=class t extends ws{static{a(this,"fX")}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?eo:o.status==="dirty"?(r.dirty(),s3e(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?eo:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Cr.ZodPipeline})}},zEe=class extends ws{static{a(this,"K7")}_parse(e){let r=this._def.innerType._parse(e),n=a(o=>(BEe(o)&&(o.value=Object.freeze(o.value)),o),"J");return YSt(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};zEe.create=(t,e)=>new zEe({innerType:t,typeName:Cr.ZodReadonly,...Vo(e)});Q5h={object:dI.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Cr||(Cr={}));q5h=LEe.create,j5h=b3e.create,H5h=D3e.create,G5h=S3e.create,$5h=T3e.create,V5h=I3e.create,W5h=x3e.create,z5h=FEe.create,Y5h=UEe.create,K5h=w3e.create,J5h=pV.create,Z5h=iB.create,X5h=R3e.create,e4h=AV.create,r6c=dI.create,t4h=dI.strictCreate,r4h=QEe.create,n4h=nLr.create,i4h=qEe.create,o4h=s9.create,s4h=oLr.create,a4h=P3e.create,c4h=k3e.create,l4h=sLr.create,u4h=jEe.create,d4h=HEe.create,f4h=GEe.create,p4h=$Ee.create,h4h=Hne.create,m4h=aN.create,g4h=$R.create,A4h=a9.create,y4h=aN.createWithPreprocess,E4h=JSt.create,szi={};sB(szi,{version:a(()=>AYi,"version"),util:a(()=>Qs,"util"),treeifyError:a(()=>yzi,"treeifyError"),toJSONSchema:a(()=>SFr,"toJSONSchema"),toDotPath:a(()=>Ezi,"toDotPath"),safeParseAsync:a(()=>YTt,"safeParseAsync"),safeParse:a(()=>zTt,"safeParse"),registry:a(()=>H3r,"registry"),regexes:a(()=>R3r,"regexes"),prettifyError:a(()=>_zi,"prettifyError"),parseAsync:a(()=>tTt,"parseAsync"),parse:a(()=>eTt,"parse"),locales:a(()=>j3r,"locales"),isValidJWT:a(()=>qYi,"isValidJWT"),isValidBase64URL:a(()=>FYi,"isValidBase64URL"),isValidBase64:a(()=>N3r,"isValidBase64"),globalRegistry:a(()=>n9,"globalRegistry"),globalConfig:a(()=>ZSt,"globalConfig"),function:a(()=>lJi,"function"),formatError:a(()=>S3r,"formatError"),flattenError:a(()=>b3r,"flattenError"),config:a(()=>Lv,"config"),clone:a(()=>fN,"clone"),_xid:a(()=>tFr,"_xid"),_void:a(()=>zKi,"_void"),_uuidv7:a(()=>z3r,"_uuidv7"),_uuidv6:a(()=>W3r,"_uuidv6"),_uuidv4:a(()=>V3r,"_uuidv4"),_uuid:a(()=>$3r,"_uuid"),_url:a(()=>Y3r,"_url"),_uppercase:a(()=>hFr,"_uppercase"),_unknown:a(()=>oTt,"_unknown"),_union:a(()=>nUc,"_union"),_undefined:a(()=>GKi,"_undefined"),_ulid:a(()=>eFr,"_ulid"),_uint64:a(()=>jKi,"_uint64"),_uint32:a(()=>BKi,"_uint32"),_tuple:a(()=>nJi,"_tuple"),_trim:a(()=>_Fr,"_trim"),_transform:a(()=>fUc,"_transform"),_toUpperCase:a(()=>CFr,"_toUpperCase"),_toLowerCase:a(()=>vFr,"_toLowerCase"),_templateLiteral:a(()=>vUc,"_templateLiteral"),_symbol:a(()=>HKi,"_symbol"),_success:a(()=>AUc,"_success"),_stringbool:a(()=>aJi,"_stringbool"),_stringFormat:a(()=>cJi,"_stringFormat"),_string:a(()=>bKi,"_string"),_startsWith:a(()=>gFr,"_startsWith"),_size:a(()=>dFr,"_size"),_set:a(()=>cUc,"_set"),_safeParseAsync:a(()=>w3r,"_safeParseAsync"),_safeParse:a(()=>x3r,"_safeParse"),_regex:a(()=>fFr,"_regex"),_refine:a(()=>sJi,"_refine"),_record:a(()=>sUc,"_record"),_readonly:a(()=>_Uc,"_readonly"),_property:a(()=>rJi,"_property"),_promise:a(()=>bUc,"_promise"),_positive:a(()=>ZKi,"_positive"),_pipe:a(()=>EUc,"_pipe"),_parseAsync:a(()=>I3r,"_parseAsync"),_parse:a(()=>T3r,"_parse"),_overwrite:a(()=>Kne,"_overwrite"),_optional:a(()=>pUc,"_optional"),_number:a(()=>PKi,"_number"),_nullable:a(()=>hUc,"_nullable"),_null:a(()=>$Ki,"_null"),_normalize:a(()=>EFr,"_normalize"),_nonpositive:a(()=>eJi,"_nonpositive"),_nonoptional:a(()=>gUc,"_nonoptional"),_nonnegative:a(()=>tJi,"_nonnegative"),_never:a(()=>WKi,"_never"),_negative:a(()=>XKi,"_negative"),_nativeEnum:a(()=>uUc,"_nativeEnum"),_nanoid:a(()=>J3r,"_nanoid"),_nan:a(()=>JKi,"_nan"),_multipleOf:a(()=>B3e,"_multipleOf"),_minSize:a(()=>L3e,"_minSize"),_minLength:a(()=>KEe,"_minLength"),_min:a(()=>aI,"_min"),_mime:a(()=>yFr,"_mime"),_maxSize:a(()=>JTt,"_maxSize"),_maxLength:a(()=>ZTt,"_maxLength"),_max:a(()=>oN,"_max"),_map:a(()=>aUc,"_map"),_lte:a(()=>oN,"_lte"),_lt:a(()=>Gne,"_lt"),_lowercase:a(()=>pFr,"_lowercase"),_literal:a(()=>dUc,"_literal"),_length:a(()=>XTt,"_length"),_lazy:a(()=>CUc,"_lazy"),_ksuid:a(()=>rFr,"_ksuid"),_jwt:a(()=>uFr,"_jwt"),_isoTime:a(()=>wKi,"_isoTime"),_isoDuration:a(()=>RKi,"_isoDuration"),_isoDateTime:a(()=>IKi,"_isoDateTime"),_isoDate:a(()=>xKi,"_isoDate"),_ipv6:a(()=>iFr,"_ipv6"),_ipv4:a(()=>nFr,"_ipv4"),_intersection:a(()=>oUc,"_intersection"),_int64:a(()=>qKi,"_int64"),_int32:a(()=>OKi,"_int32"),_int:a(()=>DKi,"_int"),_includes:a(()=>mFr,"_includes"),_guid:a(()=>iTt,"_guid"),_gte:a(()=>aI,"_gte"),_gt:a(()=>$ne,"_gt"),_float64:a(()=>MKi,"_float64"),_float32:a(()=>NKi,"_float32"),_file:a(()=>iJi,"_file"),_enum:a(()=>lUc,"_enum"),_endsWith:a(()=>AFr,"_endsWith"),_emoji:a(()=>K3r,"_emoji"),_email:a(()=>G3r,"_email"),_e164:a(()=>lFr,"_e164"),_discriminatedUnion:a(()=>iUc,"_discriminatedUnion"),_default:a(()=>mUc,"_default"),_date:a(()=>YKi,"_date"),_custom:a(()=>oJi,"_custom"),_cuid2:a(()=>X3r,"_cuid2"),_cuid:a(()=>Z3r,"_cuid"),_coercedString:a(()=>SKi,"_coercedString"),_coercedNumber:a(()=>kKi,"_coercedNumber"),_coercedDate:a(()=>KKi,"_coercedDate"),_coercedBoolean:a(()=>FKi,"_coercedBoolean"),_coercedBigint:a(()=>QKi,"_coercedBigint"),_cidrv6:a(()=>sFr,"_cidrv6"),_cidrv4:a(()=>oFr,"_cidrv4"),_catch:a(()=>yUc,"_catch"),_boolean:a(()=>LKi,"_boolean"),_bigint:a(()=>UKi,"_bigint"),_base64url:a(()=>cFr,"_base64url"),_base64:a(()=>aFr,"_base64"),_array:a(()=>bFr,"_array"),_any:a(()=>VKi,"_any"),TimePrecision:a(()=>TKi,"TimePrecision"),NEVER:a(()=>azi,"NEVER"),JSONSchemaGenerator:a(()=>F3e,"JSONSchemaGenerator"),JSONSchema:a(()=>SUc,"JSONSchema"),Doc:a(()=>rTt,"Doc"),$output:a(()=>vKi,"$output"),$input:a(()=>CKi,"$input"),$constructor:a(()=>ft,"$constructor"),$brand:a(()=>czi,"$brand"),$ZodXID:a(()=>xYi,"$ZodXID"),$ZodVoid:a(()=>JYi,"$ZodVoid"),$ZodUnknown:a(()=>nTt,"$ZodUnknown"),$ZodUnion:a(()=>U3r,"$ZodUnion"),$ZodUndefined:a(()=>WYi,"$ZodUndefined"),$ZodUUID:a(()=>EYi,"$ZodUUID"),$ZodURL:a(()=>vYi,"$ZodURL"),$ZodULID:a(()=>IYi,"$ZodULID"),$ZodType:a(()=>Co,"$ZodType"),$ZodTuple:a(()=>KTt,"$ZodTuple"),$ZodTransform:a(()=>Q3r,"$ZodTransform"),$ZodTemplateLiteral:a(()=>gKi,"$ZodTemplateLiteral"),$ZodSymbol:a(()=>VYi,"$ZodSymbol"),$ZodSuccess:a(()=>fKi,"$ZodSuccess"),$ZodStringFormat:a(()=>Ru,"$ZodStringFormat"),$ZodString:a(()=>K3e,"$ZodString"),$ZodSet:a(()=>nKi,"$ZodSet"),$ZodRegistry:a(()=>O3e,"$ZodRegistry"),$ZodRecord:a(()=>tKi,"$ZodRecord"),$ZodRealError:a(()=>z3e,"$ZodRealError"),$ZodReadonly:a(()=>mKi,"$ZodReadonly"),$ZodPromise:a(()=>AKi,"$ZodPromise"),$ZodPrefault:a(()=>uKi,"$ZodPrefault"),$ZodPipe:a(()=>q3r,"$ZodPipe"),$ZodOptional:a(()=>aKi,"$ZodOptional"),$ZodObject:a(()=>F3r,"$ZodObject"),$ZodNumberFormat:a(()=>GYi,"$ZodNumberFormat"),$ZodNumber:a(()=>M3r,"$ZodNumber"),$ZodNullable:a(()=>cKi,"$ZodNullable"),$ZodNull:a(()=>zYi,"$ZodNull"),$ZodNonOptional:a(()=>dKi,"$ZodNonOptional"),$ZodNever:a(()=>KYi,"$ZodNever"),$ZodNanoID:a(()=>bYi,"$ZodNanoID"),$ZodNaN:a(()=>hKi,"$ZodNaN"),$ZodMap:a(()=>rKi,"$ZodMap"),$ZodLiteral:a(()=>oKi,"$ZodLiteral"),$ZodLazy:a(()=>yKi,"$ZodLazy"),$ZodKSUID:a(()=>wYi,"$ZodKSUID"),$ZodJWT:a(()=>jYi,"$ZodJWT"),$ZodIntersection:a(()=>eKi,"$ZodIntersection"),$ZodISOTime:a(()=>kYi,"$ZodISOTime"),$ZodISODuration:a(()=>DYi,"$ZodISODuration"),$ZodISODateTime:a(()=>RYi,"$ZodISODateTime"),$ZodISODate:a(()=>PYi,"$ZodISODate"),$ZodIPv6:a(()=>MYi,"$ZodIPv6"),$ZodIPv4:a(()=>NYi,"$ZodIPv4"),$ZodGUID:a(()=>yYi,"$ZodGUID"),$ZodFunction:a(()=>sTt,"$ZodFunction"),$ZodFile:a(()=>sKi,"$ZodFile"),$ZodError:a(()=>C3r,"$ZodError"),$ZodEnum:a(()=>iKi,"$ZodEnum"),$ZodEmoji:a(()=>CYi,"$ZodEmoji"),$ZodEmail:a(()=>_Yi,"$ZodEmail"),$ZodE164:a(()=>QYi,"$ZodE164"),$ZodDiscriminatedUnion:a(()=>XYi,"$ZodDiscriminatedUnion"),$ZodDefault:a(()=>lKi,"$ZodDefault"),$ZodDate:a(()=>ZYi,"$ZodDate"),$ZodCustomStringFormat:a(()=>HYi,"$ZodCustomStringFormat"),$ZodCustom:a(()=>EKi,"$ZodCustom"),$ZodCheckUpperCase:a(()=>uYi,"$ZodCheckUpperCase"),$ZodCheckStringFormat:a(()=>Y3e,"$ZodCheckStringFormat"),$ZodCheckStartsWith:a(()=>fYi,"$ZodCheckStartsWith"),$ZodCheckSizeEquals:a(()=>iYi,"$ZodCheckSizeEquals"),$ZodCheckRegex:a(()=>cYi,"$ZodCheckRegex"),$ZodCheckProperty:a(()=>hYi,"$ZodCheckProperty"),$ZodCheckOverwrite:a(()=>gYi,"$ZodCheckOverwrite"),$ZodCheckNumberFormat:a(()=>eYi,"$ZodCheckNumberFormat"),$ZodCheckMultipleOf:a(()=>Xzi,"$ZodCheckMultipleOf"),$ZodCheckMinSize:a(()=>nYi,"$ZodCheckMinSize"),$ZodCheckMinLength:a(()=>sYi,"$ZodCheckMinLength"),$ZodCheckMimeType:a(()=>mYi,"$ZodCheckMimeType"),$ZodCheckMaxSize:a(()=>rYi,"$ZodCheckMaxSize"),$ZodCheckMaxLength:a(()=>oYi,"$ZodCheckMaxLength"),$ZodCheckLowerCase:a(()=>lYi,"$ZodCheckLowerCase"),$ZodCheckLessThan:a(()=>k3r,"$ZodCheckLessThan"),$ZodCheckLengthEquals:a(()=>aYi,"$ZodCheckLengthEquals"),$ZodCheckIncludes:a(()=>dYi,"$ZodCheckIncludes"),$ZodCheckGreaterThan:a(()=>D3r,"$ZodCheckGreaterThan"),$ZodCheckEndsWith:a(()=>pYi,"$ZodCheckEndsWith"),$ZodCheckBigIntFormat:a(()=>tYi,"$ZodCheckBigIntFormat"),$ZodCheck:a(()=>hh,"$ZodCheck"),$ZodCatch:a(()=>pKi,"$ZodCatch"),$ZodCUID2:a(()=>TYi,"$ZodCUID2"),$ZodCUID:a(()=>SYi,"$ZodCUID"),$ZodCIDRv6:a(()=>BYi,"$ZodCIDRv6"),$ZodCIDRv4:a(()=>OYi,"$ZodCIDRv4"),$ZodBoolean:a(()=>O3r,"$ZodBoolean"),$ZodBigIntFormat:a(()=>$Yi,"$ZodBigIntFormat"),$ZodBigInt:a(()=>B3r,"$ZodBigInt"),$ZodBase64URL:a(()=>UYi,"$ZodBase64URL"),$ZodBase64:a(()=>LYi,"$ZodBase64"),$ZodAsyncError:a(()=>yV,"$ZodAsyncError"),$ZodArray:a(()=>L3r,"$ZodArray"),$ZodAny:a(()=>YYi,"$ZodAny")});azi=Object.freeze({status:"aborted"});a(ft,"F");czi=Symbol("zod_brand"),yV=class extends Error{static{a(this,"n4")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ZSt={};a(Lv,"c$");Qs={};sB(Qs,{unwrapMessage:a(()=>a3e,"unwrapMessage"),stringifyPrimitive:a(()=>is,"stringifyPrimitive"),required:a(()=>E6c,"required"),randomString:a(()=>u6c,"randomString"),propertyKeyTypes:a(()=>XSt,"propertyKeyTypes"),promiseAllObject:a(()=>l6c,"promiseAllObject"),primitiveTypes:a(()=>fzi,"primitiveTypes"),prefixIssues:a(()=>HR,"prefixIssues"),pick:a(()=>h6c,"pick"),partial:a(()=>y6c,"partial"),optionalKeys:a(()=>pzi,"optionalKeys"),omit:a(()=>m6c,"omit"),numKeys:a(()=>d6c,"numKeys"),nullish:a(()=>zne,"nullish"),normalizeParams:a(()=>Ir,"normalizeParams"),merge:a(()=>A6c,"merge"),jsonStringifyReplacer:a(()=>lzi,"jsonStringifyReplacer"),joinValues:a(()=>$r,"joinValues"),issue:a(()=>gzi,"issue"),isPlainObject:a(()=>M3e,"isPlainObject"),isObject:a(()=>N3e,"isObject"),getSizableOrigin:a(()=>VTt,"getSizableOrigin"),getParsedType:a(()=>f6c,"getParsedType"),getLengthableOrigin:a(()=>WTt,"getLengthableOrigin"),getEnumValues:a(()=>E3r,"getEnumValues"),getElementAtPath:a(()=>c6c,"getElementAtPath"),floatSafeRemainder:a(()=>uzi,"floatSafeRemainder"),finalizeIssue:a(()=>cN,"finalizeIssue"),extend:a(()=>g6c,"extend"),escapeRegex:a(()=>Yne,"escapeRegex"),esc:a(()=>CEe,"esc"),defineLazy:a(()=>Hc,"defineLazy"),createTransparentProxy:a(()=>p6c,"createTransparentProxy"),clone:a(()=>fN,"clone"),cleanRegex:a(()=>$Tt,"cleanRegex"),cleanEnum:a(()=>_6c,"cleanEnum"),captureStackTrace:a(()=>v3r,"captureStackTrace"),cached:a(()=>GTt,"cached"),assignProp:a(()=>_3r,"assignProp"),assertNotEqual:a(()=>i6c,"assertNotEqual"),assertNever:a(()=>s6c,"assertNever"),assertIs:a(()=>o6c,"assertIs"),assertEqual:a(()=>n6c,"assertEqual"),assert:a(()=>a6c,"assert"),allowsEval:a(()=>dzi,"allowsEval"),aborted:a(()=>xEe,"aborted"),NUMBER_FORMAT_RANGES:a(()=>hzi,"NUMBER_FORMAT_RANGES"),Class:a(()=>aLr,"Class"),BIGINT_FORMAT_RANGES:a(()=>mzi,"BIGINT_FORMAT_RANGES")});a(n6c,"lh");a(i6c,"ch");a(o6c,"ph");a(s6c,"dh");a(a6c,"ih");a(E3r,"B7");a($r,"P");a(lzi,"mH");a(GTt,"z7");a(zne,"I1");a($Tt,"N7");a(uzi,"lH");a(Hc,"N$");a(_3r,"cH");a(c6c,"nh");a(l6c,"rh");a(u6c,"oh");a(CEe,"j0");v3r=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};a(N3e,"g8");dzi=GTt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch{return!1}});a(M3e,"h8");a(d6c,"th");f6c=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw Error(`Unknown data type: ${e}`)}},"ah"),XSt=new Set(["string","number","symbol"]),fzi=new Set(["string","number","bigint","boolean","symbol","undefined"]);a(Yne,"r4");a(fN,"H6");a(Ir,"k");a(p6c,"sh");a(is,"x");a(pzi,"iH");hzi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},mzi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};a(h6c,"eh");a(m6c,"$u");a(g6c,"Qu");a(A6c,"Ju");a(y6c,"Xu");a(E6c,"Yu");a(xEe,"A0");a(HR,"I6");a(a3e,"V7");a(cN,"g6");a(VTt,"O7");a(WTt,"D7");a(gzi,"oH");a(_6c,"Wu");aLr=class{static{a(this,"YM")}constructor(...e){}},Azi=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,lzi,2)},enumerable:!0})},"WM"),C3r=ft("$ZodError",Azi),z3e=ft("$ZodError",Azi,{Parent:Error});a(b3r,"m8");a(S3r,"l8");a(yzi,"mX");a(Ezi,"GM");a(_zi,"lX");T3r=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new yV;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>cN(u,s,Lv())));throw v3r(l,o?.callee),l}return c.value},"cX"),eTt=T3r(z3e),I3r=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>cN(u,s,Lv())));throw v3r(l,o?.callee),l}return c.value},"pX"),tTt=I3r(z3e),x3r=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new yV;return s.issues.length?{success:!1,error:new(t??C3r)(s.issues.map(c=>cN(c,o,Lv())))}:{success:!0,data:s.value}},"dX"),zTt=x3r(z3e),w3r=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>cN(c,o,Lv())))}:{success:!0,data:s.value}},"iX"),YTt=w3r(z3e),R3r={};sB(R3r,{xid:a(()=>Szi,"xid"),uuid7:a(()=>S6c,"uuid7"),uuid6:a(()=>b6c,"uuid6"),uuid4:a(()=>C6c,"uuid4"),uuid:a(()=>YEe,"uuid"),uppercase:a(()=>Jzi,"uppercase"),unicodeEmail:a(()=>x6c,"unicodeEmail"),undefined:a(()=>Yzi,"undefined"),ulid:a(()=>bzi,"ulid"),time:a(()=>qzi,"time"),string:a(()=>Hzi,"string"),rfc5322Email:a(()=>I6c,"rfc5322Email"),number:a(()=>Vzi,"number"),null:a(()=>zzi,"null"),nanoid:a(()=>Izi,"nanoid"),lowercase:a(()=>Kzi,"lowercase"),ksuid:a(()=>Tzi,"ksuid"),ipv6:a(()=>Dzi,"ipv6"),ipv4:a(()=>kzi,"ipv4"),integer:a(()=>$zi,"integer"),html5Email:a(()=>T6c,"html5Email"),hostname:a(()=>Bzi,"hostname"),guid:a(()=>wzi,"guid"),extendedDuration:a(()=>v6c,"extendedDuration"),emoji:a(()=>Pzi,"emoji"),email:a(()=>Rzi,"email"),e164:a(()=>Lzi,"e164"),duration:a(()=>xzi,"duration"),domain:a(()=>P6c,"domain"),datetime:a(()=>jzi,"datetime"),date:a(()=>Uzi,"date"),cuid2:a(()=>Czi,"cuid2"),cuid:a(()=>vzi,"cuid"),cidrv6:a(()=>Mzi,"cidrv6"),cidrv4:a(()=>Nzi,"cidrv4"),browserEmail:a(()=>w6c,"browserEmail"),boolean:a(()=>Wzi,"boolean"),bigint:a(()=>Gzi,"bigint"),base64url:a(()=>P3r,"base64url"),base64:a(()=>Ozi,"base64"),_emoji:a(()=>R6c,"_emoji")});vzi=/^[cC][^\s-]{8,}$/,Czi=/^[0-9a-z]+$/,bzi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Szi=/^[0-9a-vA-V]{20}$/,Tzi=/^[A-Za-z0-9]{27}$/,Izi=/^[a-zA-Z0-9_-]{21}$/,xzi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,v6c=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wzi=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,YEe=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"P0"),C6c=YEe(4),b6c=YEe(6),S6c=YEe(7),Rzi=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,T6c=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,I6c=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,x6c=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,w6c=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,R6c="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";a(Pzi,"WK");kzi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Dzi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Nzi=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Mzi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ozi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,P3r=/^[A-Za-z0-9_-]*$/,Bzi=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,P6c=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Lzi=/^\+(?:[0-9]){6,14}[0-9]$/,Fzi="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Uzi=new RegExp(`^${Fzi}$`);a(Qzi,"HM");a(qzi,"NK");a(jzi,"wK");Hzi=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"OK"),Gzi=/^\d+n?$/,$zi=/^\d+$/,Vzi=/^-?\d+(?:\.\d+)?/i,Wzi=/true|false/i,zzi=/null/i,Yzi=/undefined/i,Kzi=/^[^A-Z]*$/,Jzi=/^[^a-z]*$/,hh=ft("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Zzi={number:"number",bigint:"bigint",object:"date"},k3r=ft("$ZodCheckLessThan",(t,e)=>{hh.init(t,e);let r=Zzi[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{hh.init(t,e);let r=Zzi[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Xzi=ft("$ZodCheckMultipleOf",(t,e)=>{hh.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):uzi(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),eYi=ft("$ZodCheckNumberFormat",(t,e)=>{hh.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=hzi[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=$zi)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),tYi=ft("$ZodCheckBigIntFormat",(t,e)=>{hh.init(t,e);let[r,n]=mzi[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),rYi=ft("$ZodCheckMaxSize",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;n.size<=e.maximum||r.issues.push({origin:VTt(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),nYi=ft("$ZodCheckMinSize",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;n.size>=e.minimum||r.issues.push({origin:VTt(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),iYi=ft("$ZodCheckSizeEquals",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.size!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{let n=r.value,o=n.size;if(o===e.size)return;let s=o>e.size;r.issues.push({origin:VTt(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),oYi=ft("$ZodCheckMaxLength",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let n=r.value;if(n.length<=e.maximum)return;let o=WTt(n);r.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),sYi=ft("$ZodCheckMinLength",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{let n=r.value;if(n.length>=e.minimum)return;let o=WTt(n);r.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),aYi=ft("$ZodCheckLengthEquals",(t,e)=>{hh.init(t,e),t._zod.when=r=>{let n=r.value;return!zne(n)&&n.length!==void 0},t._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{let n=r.value,o=n.length;if(o===e.length)return;let s=WTt(n),c=o>e.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Y3e=ft("$ZodCheckStringFormat",(t,e)=>{var r,n;hh.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),cYi=ft("$ZodCheckRegex",(t,e)=>{Y3e.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),lYi=ft("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Kzi),Y3e.init(t,e)}),uYi=ft("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Jzi),Y3e.init(t,e)}),dYi=ft("$ZodCheckIncludes",(t,e)=>{hh.init(t,e);let r=Yne(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),fYi=ft("$ZodCheckStartsWith",(t,e)=>{hh.init(t,e);let r=new RegExp(`^${Yne(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),pYi=ft("$ZodCheckEndsWith",(t,e)=>{hh.init(t,e);let r=new RegExp(`.*${Yne(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});a(qGi,"KM");hYi=ft("$ZodCheckProperty",(t,e)=>{hh.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>qGi(o,r,e.property));qGi(n,r,e.property)}}),mYi=ft("$ZodCheckMimeType",(t,e)=>{hh.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),gYi=ft("$ZodCheckOverwrite",(t,e)=>{hh.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}}),rTt=class{static{a(this,"tX")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(` `).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(` -`))}},kYi={major:4,minor:0,patch:0},bo=st("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kYi;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=UEe(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new RV;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=UEe(s,h)))});else{if(s.issues.length===h)continue;u||(u=UEe(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new RV;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=cIt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return lIt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),uFe=st("$ZodString",(t,e)=>{bo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??rYi(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ku=st("$ZodStringFormat",(t,e)=>{lFe.init(t,e),uFe.init(t,e)}),PYi=st("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=qzi),ku.init(t,e)}),DYi=st("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=a_e(r))}else e.pattern??(e.pattern=a_e());ku.init(t,e)}),NYi=st("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=jzi),ku.init(t,e)}),MYi=st("$ZodURL",(t,e)=>{ku.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Yzi.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),OYi=st("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Hzi()),ku.init(t,e)}),BYi=st("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Uzi),ku.init(t,e)}),LYi=st("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Mzi),ku.init(t,e)}),FYi=st("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ozi),ku.init(t,e)}),UYi=st("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Bzi),ku.init(t,e)}),QYi=st("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Lzi),ku.init(t,e)}),qYi=st("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Fzi),ku.init(t,e)}),jYi=st("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=tYi(e)),ku.init(t,e)}),HYi=st("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Zzi),ku.init(t,e)}),GYi=st("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=eYi(e)),ku.init(t,e)}),$Yi=st("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Qzi),ku.init(t,e)}),VYi=st("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Gzi),ku.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),WYi=st("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=$zi),ku.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),zYi=st("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Vzi),ku.init(t,e)}),YYi=st("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Wzi),ku.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(tFr,"oK");KYi=st("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=zzi),ku.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{tFr(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(JYi,"AM");ZYi=st("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Z3r),ku.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{JYi(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),XYi=st("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Kzi),ku.init(t,e)});a(eKi,"IM");tKi=st("$ZodJWT",(t,e)=>{ku.init(t,e),t._zod.check=r=>{eKi(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),rKi=st("$ZodCustomStringFormat",(t,e)=>{ku.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),rFr=st("$ZodNumber",(t,e)=>{bo.init(t,e),t._zod.pattern=t._zod.bag.pattern??oYi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),nKi=st("$ZodNumber",(t,e)=>{pYi.init(t,e),rFr.init(t,e)}),nFr=st("$ZodBoolean",(t,e)=>{bo.init(t,e),t._zod.pattern=sYi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),iFr=st("$ZodBigInt",(t,e)=>{bo.init(t,e),t._zod.pattern=nYi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),iKi=st("$ZodBigInt",(t,e)=>{hYi.init(t,e),iFr.init(t,e)}),oKi=st("$ZodSymbol",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),sKi=st("$ZodUndefined",(t,e)=>{bo.init(t,e),t._zod.pattern=cYi,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),aKi=st("$ZodNull",(t,e)=>{bo.init(t,e),t._zod.pattern=aYi,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),cKi=st("$ZodAny",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),ATt=st("$ZodUnknown",(t,e)=>{bo.init(t,e),t._zod.parse=r=>r}),lKi=st("$ZodNever",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),uKi=st("$ZodVoid",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),dKi=st("$ZodDate",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(t$i,"BM");oFr=st("$ZodArray",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;ct$i(d,r,c))):t$i(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(fSt,"aX");a(r$i,"zM");sFr=st("$ZodObject",(t,e)=>{bo.init(t,e);let r=iIt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof bo))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=Izi(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Vc(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new gTt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=MEe(_);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=MEe(_);h.write(` +`))}},AYi={major:4,minor:0,patch:0},Co=ft("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=AYi;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=xEe(s),d;for(let f of c){if(f._zod.when){if(!f._zod.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new yV;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=xEe(s,h)))});else{if(s.issues.length===h)continue;u||(u=xEe(s,h))}}return d?d.then(()=>s):s},"X");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new yV;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=zTt(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return YTt(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),K3e=ft("$ZodString",(t,e)=>{Co.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Hzi(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Ru=ft("$ZodStringFormat",(t,e)=>{Y3e.init(t,e),K3e.init(t,e)}),yYi=ft("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=wzi),Ru.init(t,e)}),EYi=ft("$ZodUUID",(t,e)=>{if(e.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=YEe(r))}else e.pattern??(e.pattern=YEe());Ru.init(t,e)}),_Yi=ft("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Rzi),Ru.init(t,e)}),vYi=ft("$ZodURL",(t,e)=>{Ru.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,!e.hostname.test(o.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Bzi.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,!e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),CYi=ft("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Pzi()),Ru.init(t,e)}),bYi=ft("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Izi),Ru.init(t,e)}),SYi=ft("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=vzi),Ru.init(t,e)}),TYi=ft("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Czi),Ru.init(t,e)}),IYi=ft("$ZodULID",(t,e)=>{e.pattern??(e.pattern=bzi),Ru.init(t,e)}),xYi=ft("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Szi),Ru.init(t,e)}),wYi=ft("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Tzi),Ru.init(t,e)}),RYi=ft("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=jzi(e)),Ru.init(t,e)}),PYi=ft("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Uzi),Ru.init(t,e)}),kYi=ft("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=qzi(e)),Ru.init(t,e)}),DYi=ft("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=xzi),Ru.init(t,e)}),NYi=ft("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=kzi),Ru.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),MYi=ft("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Dzi),Ru.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),OYi=ft("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Nzi),Ru.init(t,e)}),BYi=ft("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Mzi),Ru.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});a(N3r,"oK");LYi=ft("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ozi),Ru.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{N3r(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});a(FYi,"AM");UYi=ft("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=P3r),Ru.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{FYi(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),QYi=ft("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Lzi),Ru.init(t,e)});a(qYi,"IM");jYi=ft("$ZodJWT",(t,e)=>{Ru.init(t,e),t._zod.check=r=>{qYi(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),HYi=ft("$ZodCustomStringFormat",(t,e)=>{Ru.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),M3r=ft("$ZodNumber",(t,e)=>{Co.init(t,e),t._zod.pattern=t._zod.bag.pattern??Vzi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),GYi=ft("$ZodNumber",(t,e)=>{eYi.init(t,e),M3r.init(t,e)}),O3r=ft("$ZodBoolean",(t,e)=>{Co.init(t,e),t._zod.pattern=Wzi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),B3r=ft("$ZodBigInt",(t,e)=>{Co.init(t,e),t._zod.pattern=Gzi,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),$Yi=ft("$ZodBigInt",(t,e)=>{tYi.init(t,e),B3r.init(t,e)}),VYi=ft("$ZodSymbol",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),WYi=ft("$ZodUndefined",(t,e)=>{Co.init(t,e),t._zod.pattern=Yzi,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),zYi=ft("$ZodNull",(t,e)=>{Co.init(t,e),t._zod.pattern=zzi,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),YYi=ft("$ZodAny",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),nTt=ft("$ZodUnknown",(t,e)=>{Co.init(t,e),t._zod.parse=r=>r}),KYi=ft("$ZodNever",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),JYi=ft("$ZodVoid",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),ZYi=ft("$ZodDate",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});a(jGi,"BM");L3r=ft("$ZodArray",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cjGi(d,r,c))):jGi(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});a(Z1t,"aX");a(HGi,"zM");F3r=ft("$ZodObject",(t,e)=>{Co.init(t,e);let r=GTt(()=>{let f=Object.keys(e.shape);for(let m of f)if(!(e.shape[m]instanceof Co))throw Error(`Invalid element at key "${m}": expected a Zod schema`);let h=pzi(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(h)}});Hc(t._zod,"propValues",()=>{let f=e.shape,h={};for(let m in f){let g=f[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(let A of g.values)h[m].add(A)}}return h});let n=a(f=>{let h=new rTt(["shape","payload","ctx"]),m=r.value,g=a(_=>{let v=CEe(_);return`shape[${v}]._zod.run({ value: input[${v}], issues: [] }, ctx)`},"w");h.write("const input = payload.value;");let A=Object.create(null),y=0;for(let _ of m.keys)A[_]=`key_${y++}`;h.write("const newResult = {}");for(let _ of m.keys)if(m.optionalKeys.has(_)){let v=A[_];h.write(`const ${v} = ${g(_)};`);let b=CEe(_);h.write(` if (${v}.issues.length) { if (input[${b}] === undefined) { if (${b} in input) { @@ -1651,80 +1605,111 @@ new Anthropic({ apiKey, dangerouslyAllowBrowser: true }); `)}else{let v=A[_];h.write(`const ${v} = ${g(_)};`),h.write(` if (${v}.issues.length) payload.issues = payload.issues.concat(${v}.issues.map(iss => ({ ...iss, - path: iss.path ? [${MEe(_)}, ...iss.path] : [${MEe(_)}] - })));`),h.write(`newResult[${MEe(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=W3e,c=!fTt.jitless,l=c&&Szi.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?r$i(x,f,b,m):fSt(x,f,b))):R?r$i(w,f,b,m):fSt(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>fSt(T,f,v))):fSt(b,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(n$i,"NM");aFr=st("$ZodUnion",(t,e)=>{bo.init(t,e),Vc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Vc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Vc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Vc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>oIt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>n$i(c,r,t,n)):n$i(s,r,t,n)}}),fKi=st("$ZodDiscriminatedUnion",(t,e)=>{aFr.init(t,e);let r=t._zod.parse;Vc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=iIt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!W3e(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),pKi=st("$ZodIntersection",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>i$i(r,l,u)):i$i(r,s,c)}});a(kLr,"pK");a(i$i,"wM");uIt=st("$ZodTuple",(t,e)=>{bo.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>pSt(h,o,u))):pSt(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>pSt(m,o,u))):pSt(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(pSt,"sX");hKi=st("$ZodRecord",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!z3e(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...VR(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...VR(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>dN(d,n,QC())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...VR(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...VR(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),mKi=st("$ZodMap",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{o$i(f,h,r,c,o,t,n)})):o$i(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(o$i,"OM");gKi=st("$ZodSet",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>s$i(u,r))):s$i(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(s$i,"DM");AKi=st("$ZodEnum",(t,e)=>{bo.init(t,e);let r=q3r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>pTt.has(typeof n)).map(n=>typeof n=="string"?rie(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),yKi=st("$ZodLiteral",(t,e)=>{bo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?rie(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),EKi=st("$ZodFile",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),cFr=st("$ZodTransform",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new RV;return r.value=o,r}}),_Ki=st("$ZodOptional",(t,e)=>{bo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Vc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Vc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${oIt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),CKi=st("$ZodNullable",(t,e)=>{bo.init(t,e),Vc(t._zod,"optin",()=>e.innerType._zod.optin),Vc(t._zod,"optout",()=>e.innerType._zod.optout),Vc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${oIt(r.source)}|null)$`):void 0}),Vc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),vKi=st("$ZodDefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>a$i(s,e)):a$i(o,e)}});a(a$i,"FM");bKi=st("$ZodPrefault",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),SKi=st("$ZodNonOptional",(t,e)=>{bo.init(t,e),Vc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>c$i(s,t)):c$i(o,t)}});a(c$i,"ZM");TKi=st("$ZodSuccess",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),IKi=st("$ZodCatch",(t,e)=>{bo.init(t,e),t._zod.optin="optional",Vc(t._zod,"optout",()=>e.innerType._zod.optout),Vc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>dN(c,n,QC()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>dN(s,n,QC()))},input:r.value}),r.issues=[]),r)}}),xKi=st("$ZodNaN",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),lFr=st("$ZodPipe",(t,e)=>{bo.init(t,e),Vc(t._zod,"values",()=>e.in._zod.values),Vc(t._zod,"optin",()=>e.in._zod.optin),Vc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>l$i(s,e,n)):l$i(o,e,n)}});a(l$i,"MM");wKi=st("$ZodReadonly",(t,e)=>{bo.init(t,e),Vc(t._zod,"propValues",()=>e.innerType._zod.propValues),Vc(t._zod,"values",()=>e.innerType._zod.values),Vc(t._zod,"optin",()=>e.innerType._zod.optin),Vc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(u$i):u$i(o)}});a(u$i,"LM");RKi=st("$ZodTemplateLiteral",(t,e)=>{bo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof bo){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||Tzi.has(typeof n))r.push(rie(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),kKi=st("$ZodPromise",(t,e)=>{bo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),PKi=st("$ZodLazy",(t,e)=>{bo.init(t,e),Vc(t._zod,"innerType",()=>e.getter()),Vc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Vc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Vc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Vc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),DKi=st("$ZodCustom",(t,e)=>{dh.init(t,e),bo.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>d$i(s,r,n,t));d$i(o,r,n,t)}});a(d$i,"jM");uFr={};pB(uFr,{zhTW:a(()=>aQc,"zhTW"),zhCN:a(()=>oQc,"zhCN"),vi:a(()=>nQc,"vi"),ur:a(()=>tQc,"ur"),ua:a(()=>X7c,"ua"),tr:a(()=>J7c,"tr"),th:a(()=>z7c,"th"),ta:a(()=>V7c,"ta"),sv:a(()=>G7c,"sv"),sl:a(()=>j7c,"sl"),ru:a(()=>Q7c,"ru"),pt:a(()=>F7c,"pt"),ps:a(()=>M7c,"ps"),pl:a(()=>B7c,"pl"),ota:a(()=>D7c,"ota"),no:a(()=>k7c,"no"),nl:a(()=>w7c,"nl"),ms:a(()=>I7c,"ms"),mk:a(()=>S7c,"mk"),ko:a(()=>v7c,"ko"),kh:a(()=>_7c,"kh"),ja:a(()=>y7c,"ja"),it:a(()=>g7c,"it"),id:a(()=>h7c,"id"),hu:a(()=>f7c,"hu"),he:a(()=>u7c,"he"),frCA:a(()=>c7c,"frCA"),fr:a(()=>s7c,"fr"),fi:a(()=>i7c,"fi"),fa:a(()=>r7c,"fa"),es:a(()=>e7c,"es"),eo:a(()=>ZUc,"eo"),en:a(()=>NKi,"en"),de:a(()=>WUc,"de"),cs:a(()=>$Uc,"cs"),ca:a(()=>HUc,"ca"),be:a(()=>qUc,"be"),az:a(()=>UUc,"az"),ar:a(()=>LUc,"ar")});BUc=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${os(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${$r(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(LUc,"tK");FUc=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${os(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(UUc,"aK");a(f$i,"PM");QUc=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${os(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=f$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=f$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(qUc,"sK");jUc=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${os(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$r(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(HUc,"eK");GUc=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${os(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${$r(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a($Uc,"$q");VUc=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${os(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(WUc,"Qq");zUc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),YUc=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${zUc(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${os(n.values[0])}`:`Invalid option: expected one of ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(NKi,"A7");KUc=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),JUc=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${KUc(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${os(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(ZUc,"Jq");XUc=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${os(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(e7c,"Xq");t7c=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${os(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${$r(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${$r(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(r7c,"Yq");n7c=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${os(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${$r(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(i7c,"Wq");o7c=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${os(o.values[0])} attendu`:`Option invalide : une valeur parmi ${$r(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${$r(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(s7c,"Gq");a7c=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${os(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${$r(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(c7c,"Uq");l7c=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${os(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(u7c,"Hq");d7c=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${os(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(f7c,"Kq");p7c=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${os(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(h7c,"qq");m7c=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${os(o.values[0])}`:`Opzione non valida: atteso uno tra ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(g7c,"Vq");A7c=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${os(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$r(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${$r(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a(y7c,"Bq");E7c=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${os(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${$r(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(_7c,"zq");C7c=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${os(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$r(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${$r(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(v7c,"Nq");b7c=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${os(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(S7c,"wq");T7c=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${os(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${$r(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(I7c,"Oq");x7c=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${os(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(w7c,"Dq");R7c=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${os(o.values[0])}`:`Ugyldig valg: forventet en av ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(k7c,"Fq");P7c=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${os(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(D7c,"Zq");N7c=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${os(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$r(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a(M7c,"Mq");O7c=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${os(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a(B7c,"Lq");L7c=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${os(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(F7c,"jq");a(p$i,"EM");U7c=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${os(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=p$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=p$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(Q7c,"Aq");q7c=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${os(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(j7c,"Iq");H7c=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${os(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(G7c,"Rq");$7c=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${os(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$r(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(V7c,"Pq");W7c=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${os(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(z7c,"Eq");Y7c=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),K7c=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Y7c(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${os(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(J7c,"bq");Z7c=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${os(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(X7c,"_q");eQc=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${os(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$r(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${$r(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(tQc,"kq");rQc=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${os(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${$r(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(nQc,"Sq");iQc=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${os(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(oQc,"vq");sQc=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${os(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${$r(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(aQc,"Cq");MKi=Symbol("ZodOutput"),OKi=Symbol("ZodInput"),Y3e=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(dFr,"R7");d9=dFr();a(BKi,"aY");a(LKi,"Tq");a(fFr,"P7");a(yTt,"o8");a(pFr,"E7");a(hFr,"b7");a(mFr,"_7");a(gFr,"k7");a(AFr,"S7");a(yFr,"v7");a(EFr,"C7");a(_Fr,"T7");a(CFr,"x7");a(vFr,"y7");a(bFr,"f7");a(SFr,"g7");a(TFr,"h7");a(IFr,"u7");a(xFr,"m7");a(wFr,"l7");a(RFr,"c7");a(kFr,"p7");a(PFr,"d7");a(DFr,"i7");FKi={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(UKi,"xq");a(QKi,"yq");a(qKi,"fq");a(jKi,"gq");a(HKi,"eY");a(GKi,"hq");a($Ki,"$3");a(VKi,"Q3");a(WKi,"J3");a(zKi,"X3");a(YKi,"Y3");a(KKi,"W3");a(JKi,"uq");a(ZKi,"G3");a(XKi,"mq");a(eJi,"U3");a(tJi,"H3");a(rJi,"K3");a(nJi,"q3");a(iJi,"V3");a(oJi,"B3");a(ETt,"b0");a(sJi,"z3");a(aJi,"N3");a(cJi,"w3");a(lJi,"lq");a(uJi,"O3");a(Jne,"o4");a(cN,"t6");a(Zne,"t4");a(dI,"P6");a(dJi,"cq");a(fJi,"pq");a(pJi,"dq");a(hJi,"iq");a(K3e,"_0");a(dIt,"t8");a(J3e,"k0");a(NFr,"n7");a(fIt,"a8");a(c_e,"k1");a(pIt,"s8");a(MFr,"r7");a(OFr,"o7");a(BFr,"t7");a(LFr,"a7");a(FFr,"s7");a(UFr,"e7");a(mJi,"nq");a(QFr,"$J");a(nie,"a4");a(qFr,"QJ");a(jFr,"JJ");a(HFr,"XJ");a(GFr,"YJ");a($Fr,"WJ");a(cQc,"Wm");a(lQc,"Gm");a(uQc,"Um");a(gJi,"rq");a(dQc,"Hm");a(fQc,"Km");a(pQc,"qm");a(hQc,"Vm");a(mQc,"Bm");a(gQc,"zm");a(AJi,"D3");a(AQc,"Nm");a(yQc,"wm");a(EQc,"Om");a(_Qc,"Dm");a(CQc,"Fm");a(vQc,"Zm");a(bQc,"Mm");a(SQc,"Lm");a(TQc,"jm");a(IQc,"Am");a(xQc,"Im");a(wQc,"Rm");a(yJi,"F3");a(EJi,"Z3");a(_Ji,"M3");a(CJi,"L3");_Tt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?hTt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?hTt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await mTt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?mTt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new uIt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a(vJi,"j3");Z3e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??d9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=q3r(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&Sm(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ + path: iss.path ? [${CEe(_)}, ...iss.path] : [${CEe(_)}] + })));`),h.write(`newResult[${CEe(_)}] = ${v}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let E=h.compile();return(_,v)=>E(f,_,v)},"Y"),o,s=N3e,c=!ZSt.jitless,l=c&&dzi.value,u=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=r.value);let m=f.value;if(!s(m))return f.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),f;let g=[];if(c&&l&&h?.async===!1&&h.jitless!==!0)o||(o=n(e.shape)),f=o(f,h);else{f.value={};let v=d.shape;for(let b of d.keys){let T=v[b],w=T._zod.run({value:m[b],issues:[]},h),R=T._zod.optin==="optional"&&T._zod.optout==="optional";w instanceof Promise?g.push(w.then(x=>R?HGi(x,f,b,m):Z1t(x,f,b))):R?HGi(w,f,b,m):Z1t(w,f,b)}}if(!u)return g.length?Promise.all(g).then(()=>f):f;let A=[],y=d.keySet,E=u._zod,_=E.def.type;for(let v of Object.keys(m)){if(y.has(v))continue;if(_==="never"){A.push(v);continue}let b=E.run({value:m[v],issues:[]},h);b instanceof Promise?g.push(b.then(T=>Z1t(T,f,v))):Z1t(b,f,v)}return A.length&&f.issues.push({code:"unrecognized_keys",keys:A,input:m,inst:t}),g.length?Promise.all(g).then(()=>f):f}});a(GGi,"NM");U3r=ft("$ZodUnion",(t,e)=>{Co.init(t,e),Hc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Hc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Hc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Hc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>$Tt(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>GGi(c,r,t,n)):GGi(s,r,t,n)}}),XYi=ft("$ZodDiscriminatedUnion",(t,e)=>{U3r.init(t,e);let r=t._zod.parse;Hc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=GTt(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!N3e(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),eKi=ft("$ZodIntersection",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([l,u])=>$Gi(r,l,u)):$Gi(r,s,c)}});a(cLr,"pK");a($Gi,"wM");KTt=ft("$ZodTuple",(t,e)=>{Co.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>X1t(h,o,u))):X1t(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>X1t(m,o,u))):X1t(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});a(X1t,"sX");tKi=ft("$ZodRecord",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!M3e(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...HR(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...HR(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>cN(d,n,Lv())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...HR(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...HR(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),rKi=ft("$ZodMap",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{VGi(f,h,r,c,o,t,n)})):VGi(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});a(VGi,"OM");nKi=ft("$ZodSet",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>WGi(u,r))):WGi(l,r)}return s.length?Promise.all(s).then(()=>r):r}});a(WGi,"DM");iKi=ft("$ZodEnum",(t,e)=>{Co.init(t,e);let r=E3r(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>XSt.has(typeof n)).map(n=>typeof n=="string"?Yne(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),oKi=ft("$ZodLiteral",(t,e)=>{Co.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?Yne(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),sKi=ft("$ZodFile",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),Q3r=ft("$ZodTransform",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new yV;return r.value=o,r}}),aKi=ft("$ZodOptional",(t,e)=>{Co.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Hc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Hc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${$Tt(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),cKi=ft("$ZodNullable",(t,e)=>{Co.init(t,e),Hc(t._zod,"optin",()=>e.innerType._zod.optin),Hc(t._zod,"optout",()=>e.innerType._zod.optout),Hc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${$Tt(r.source)}|null)$`):void 0}),Hc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),lKi=ft("$ZodDefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>zGi(s,e)):zGi(o,e)}});a(zGi,"FM");uKi=ft("$ZodPrefault",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),dKi=ft("$ZodNonOptional",(t,e)=>{Co.init(t,e),Hc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>YGi(s,t)):YGi(o,t)}});a(YGi,"ZM");fKi=ft("$ZodSuccess",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),pKi=ft("$ZodCatch",(t,e)=>{Co.init(t,e),t._zod.optin="optional",Hc(t._zod,"optout",()=>e.innerType._zod.optout),Hc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>cN(c,n,Lv()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>cN(s,n,Lv()))},input:r.value}),r.issues=[]),r)}}),hKi=ft("$ZodNaN",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),q3r=ft("$ZodPipe",(t,e)=>{Co.init(t,e),Hc(t._zod,"values",()=>e.in._zod.values),Hc(t._zod,"optin",()=>e.in._zod.optin),Hc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>KGi(s,e,n)):KGi(o,e,n)}});a(KGi,"MM");mKi=ft("$ZodReadonly",(t,e)=>{Co.init(t,e),Hc(t._zod,"propValues",()=>e.innerType._zod.propValues),Hc(t._zod,"values",()=>e.innerType._zod.values),Hc(t._zod,"optin",()=>e.innerType._zod.optin),Hc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(JGi):JGi(o)}});a(JGi,"LM");gKi=ft("$ZodTemplateLiteral",(t,e)=>{Co.init(t,e);let r=[];for(let n of e.parts)if(n instanceof Co){if(!n._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||fzi.has(typeof n))r.push(Yne(`${n}`));else throw Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),AKi=ft("$ZodPromise",(t,e)=>{Co.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),yKi=ft("$ZodLazy",(t,e)=>{Co.init(t,e),Hc(t._zod,"innerType",()=>e.getter()),Hc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Hc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Hc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Hc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),EKi=ft("$ZodCustom",(t,e)=>{hh.init(t,e),Co.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>ZGi(s,r,n,t));ZGi(o,r,n,t)}});a(ZGi,"jM");j3r={};sB(j3r,{zhTW:a(()=>rUc,"zhTW"),zhCN:a(()=>eUc,"zhCN"),vi:a(()=>Z9c,"vi"),ur:a(()=>K9c,"ur"),ua:a(()=>z9c,"ua"),tr:a(()=>V9c,"tr"),th:a(()=>H9c,"th"),ta:a(()=>q9c,"ta"),sv:a(()=>U9c,"sv"),sl:a(()=>L9c,"sl"),ru:a(()=>O9c,"ru"),pt:a(()=>N9c,"pt"),ps:a(()=>R9c,"ps"),pl:a(()=>k9c,"pl"),ota:a(()=>x9c,"ota"),no:a(()=>T9c,"no"),nl:a(()=>b9c,"nl"),ms:a(()=>v9c,"ms"),mk:a(()=>E9c,"mk"),ko:a(()=>A9c,"ko"),kh:a(()=>m9c,"kh"),ja:a(()=>p9c,"ja"),it:a(()=>d9c,"it"),id:a(()=>l9c,"id"),hu:a(()=>a9c,"hu"),he:a(()=>o9c,"he"),frCA:a(()=>n9c,"frCA"),fr:a(()=>t9c,"fr"),fi:a(()=>X6c,"fi"),fa:a(()=>J6c,"fa"),es:a(()=>Y6c,"es"),eo:a(()=>W6c,"eo"),en:a(()=>_Ki,"en"),de:a(()=>j6c,"de"),cs:a(()=>Q6c,"cs"),ca:a(()=>F6c,"ca"),be:a(()=>B6c,"be"),az:a(()=>M6c,"az"),ar:a(()=>D6c,"ar")});k6c=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${is(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${$r(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"Du");a(D6c,"tK");N6c=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${is(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"Fu");a(M6c,"aK");a(XGi,"PM");O6c=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${is(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=XGi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=XGi(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"Zu");a(B6c,"sK");L6c=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${is(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$r(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"Mu");a(F6c,"eK");U6c=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${is(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${$r(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"Lu");a(Q6c,"$q");q6c=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${is(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"ju");a(j6c,"Qq");H6c=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Au"),G6c=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${H6c(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${is(n.values[0])}`:`Invalid option: expected one of ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"Iu");a(_Ki,"A7");$6c=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"Ru"),V6c=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${$6c(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${is(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"Pu");a(W6c,"Jq");z6c=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"J"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${is(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"Eu");a(Y6c,"Xq");K6c=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${is(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${$r(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${$r(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"bu");a(J6c,"Yq");Z6c=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${is(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${$r(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"_u");a(X6c,"Wq");e9c=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${is(o.values[0])} attendu`:`Option invalide : une valeur parmi ${$r(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${$r(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"ku");a(t9c,"Gq");r9c=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${is(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${$r(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"Su");a(n9c,"Uq");i9c=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${is(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"vu");a(o9c,"Hq");s9c=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${is(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"Cu");a(a9c,"Kq");c9c=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${is(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"Tu");a(l9c,"qq");u9c=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${is(o.values[0])}`:`Opzione non valida: atteso uno tra ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"xu");a(d9c,"Vq");f9c=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${is(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$r(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${$r(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"yu");a(p9c,"Bq");h9c=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${is(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${$r(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"fu");a(m9c,"zq");g9c=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${is(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$r(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${$r(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"gu");a(A9c,"Nq");y9c=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${is(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"hu");a(E9c,"wq");_9c=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${is(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${$r(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"uu");a(v9c,"Oq");C9c=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${is(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"mu");a(b9c,"Dq");S9c=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${is(o.values[0])}`:`Ugyldig valg: forventet en av ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"lu");a(T9c,"Fq");I9c=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${is(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"cu");a(x9c,"Zq");w9c=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${is(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$r(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"pu");a(R9c,"Mq");P9c=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${is(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"du");a(k9c,"Lq");D9c=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${is(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"iu");a(N9c,"jq");a(e$i,"EM");M9c=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${is(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=e$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=e$i(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"nu");a(O9c,"Aq");B9c=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${is(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"ru");a(L9c,"Iq");F9c=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${is(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${$r(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"ou");a(U9c,"Rq");Q9c=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${is(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$r(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"tu");a(q9c,"Pq");j9c=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${is(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${$r(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"au");a(H9c,"Eq");G9c=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"su"),$9c=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"Q");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${G9c(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${is(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$r(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${$r(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"eu");a(V9c,"bq");W9c=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${is(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${$r(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"$m");a(z9c,"_q");Y9c=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${is(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$r(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${$r(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"Qm");a(K9c,"kq");J9c=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${is(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${$r(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"Jm");a(Z9c,"Sq");X9c=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${is(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${$r(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"Xm");a(eUc,"vq");tUc=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"Q");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"J"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${is(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$r(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${$r(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"Ym");a(rUc,"Cq");vKi=Symbol("ZodOutput"),CKi=Symbol("ZodInput"),O3e=class{static{a(this,"I7")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};a(H3r,"R7");n9=H3r();a(bKi,"aY");a(SKi,"Tq");a(G3r,"P7");a(iTt,"o8");a($3r,"E7");a(V3r,"b7");a(W3r,"_7");a(z3r,"k7");a(Y3r,"S7");a(K3r,"v7");a(J3r,"C7");a(Z3r,"T7");a(X3r,"x7");a(eFr,"y7");a(tFr,"f7");a(rFr,"g7");a(nFr,"h7");a(iFr,"u7");a(oFr,"m7");a(sFr,"l7");a(aFr,"c7");a(cFr,"p7");a(lFr,"d7");a(uFr,"i7");TKi={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};a(IKi,"xq");a(xKi,"yq");a(wKi,"fq");a(RKi,"gq");a(PKi,"eY");a(kKi,"hq");a(DKi,"$3");a(NKi,"Q3");a(MKi,"J3");a(OKi,"X3");a(BKi,"Y3");a(LKi,"W3");a(FKi,"uq");a(UKi,"G3");a(QKi,"mq");a(qKi,"U3");a(jKi,"H3");a(HKi,"K3");a(GKi,"q3");a($Ki,"V3");a(VKi,"B3");a(oTt,"b0");a(WKi,"z3");a(zKi,"N3");a(YKi,"w3");a(KKi,"lq");a(JKi,"O3");a(Gne,"o4");a(oN,"t6");a($ne,"t4");a(aI,"P6");a(ZKi,"cq");a(XKi,"pq");a(eJi,"dq");a(tJi,"iq");a(B3e,"_0");a(JTt,"t8");a(L3e,"k0");a(dFr,"n7");a(ZTt,"a8");a(KEe,"k1");a(XTt,"s8");a(fFr,"r7");a(pFr,"o7");a(hFr,"t7");a(mFr,"a7");a(gFr,"s7");a(AFr,"e7");a(rJi,"nq");a(yFr,"$J");a(Kne,"a4");a(EFr,"QJ");a(_Fr,"JJ");a(vFr,"XJ");a(CFr,"YJ");a(bFr,"WJ");a(nUc,"Wm");a(iUc,"Gm");a(oUc,"Um");a(nJi,"rq");a(sUc,"Hm");a(aUc,"Km");a(cUc,"qm");a(lUc,"Vm");a(uUc,"Bm");a(dUc,"zm");a(iJi,"D3");a(fUc,"Nm");a(pUc,"wm");a(hUc,"Om");a(mUc,"Dm");a(gUc,"Fm");a(AUc,"Zm");a(yUc,"Mm");a(EUc,"Lm");a(_Uc,"jm");a(vUc,"Am");a(CUc,"Im");a(bUc,"Rm");a(oJi,"F3");a(sJi,"Z3");a(aJi,"M3");a(cJi,"L3");sTt=class{static{a(this,"oq")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a((...n)=>{let o=this._def.input?eTt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?eTt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}implementAsync(e){if(typeof e!="function")throw Error("implement() must be called with a function");let r=a(async(...n)=>{let o=this._def.input?await tTt(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?tTt(this._def.output,s,void 0,{callee:r}):s},"Q");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new KTt({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}};a(lJi,"j3");F3e=class{static{a(this,"A3")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??n9,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},h=e._zod.parent;if(h)l.ref=h,this.process(h,f),this.seen.get(h).isParent=!0;else{let m=l.schema;switch(o.type){case"string":{let g=m;g.type="string";let{minimum:A,maximum:y,format:E,patterns:_,contentEncoding:v}=e._zod.bag;if(typeof A=="number"&&(g.minLength=A),typeof y=="number"&&(g.maxLength=y),E&&(g.format=s[E]??E,g.format===""&&delete g.format),v&&(g.contentEncoding=v),_&&_.size>0){let b=[..._];b.length===1?g.pattern=b[0].source:b.length>1&&(l.schema.allOf=[...b.map(T=>({...this.target==="draft-7"?{type:"string"}:{},pattern:T.source}))])}break}case"number":{let g=m,{minimum:A,maximum:y,format:E,multipleOf:_,exclusiveMaximum:v,exclusiveMinimum:b}=e._zod.bag;typeof E=="string"&&E.includes("int")?g.type="integer":g.type="number",typeof b=="number"&&(g.exclusiveMinimum=b),typeof A=="number"&&(g.minimum=A,typeof b=="number"&&(b>=A?delete g.minimum:delete g.exclusiveMinimum)),typeof v=="number"&&(g.exclusiveMaximum=v),typeof y=="number"&&(g.maximum=y,typeof v=="number"&&(v<=y?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{let g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":case"never":{m.not={};break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let g=m,{minimum:A,maximum:y}=e._zod.bag;typeof A=="number"&&(g.minItems=A),typeof y=="number"&&(g.maxItems=y),g.type="array",g.items=this.process(o.element,{...f,path:[...f.path,"items"]});break}case"object":{let g=m;g.type="object",g.properties={};let A=o.shape;for(let _ in A)g.properties[_]=this.process(A[_],{...f,path:[...f.path,"properties",_]});let y=new Set(Object.keys(A)),E=new Set([...y].filter(_=>{let v=o.shape[_]._zod;return this.io==="input"?v.optin===void 0:v.optout===void 0}));E.size>0&&(g.required=Array.from(E)),o.catchall?._zod.def.type==="never"?g.additionalProperties=!1:o.catchall?o.catchall&&(g.additionalProperties=this.process(o.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=m;g.anyOf=o.options.map((A,y)=>this.process(A,{...f,path:[...f.path,"anyOf",y]}));break}case"intersection":{let g=m,A=this.process(o.left,{...f,path:[...f.path,"allOf",0]}),y=this.process(o.right,{...f,path:[...f.path,"allOf",1]}),E=a(v=>"allOf"in v&&Object.keys(v).length===1,"D"),_=[...E(A)?A.allOf:[A],...E(y)?y.allOf:[y]];g.allOf=_;break}case"tuple":{let g=m;g.type="array";let A=o.items.map((_,v)=>this.process(_,{...f,path:[...f.path,"prefixItems",v]}));if(this.target==="draft-2020-12"?g.prefixItems=A:g.items=A,o.rest){let _=this.process(o.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}o.rest&&(g.items=this.process(o.rest,{...f,path:[...f.path,"items"]}));let{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(g.minItems=y),typeof E=="number"&&(g.maxItems=E);break}case"record":{let g=m;g.type="object",g.propertyNames=this.process(o.keyType,{...f,path:[...f.path,"propertyNames"]}),g.additionalProperties=this.process(o.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=m,A=E3r(o.entries);A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),g.enum=A;break}case"literal":{let g=m,A=[];for(let y of o.values)if(y===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof y=="bigint"){if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");A.push(Number(y))}else A.push(y);if(A.length!==0)if(A.length===1){let y=A[0];g.type=y===null?"null":typeof y,g.const=y}else A.every(y=>typeof y=="number")&&(g.type="number"),A.every(y=>typeof y=="string")&&(g.type="string"),A.every(y=>typeof y=="boolean")&&(g.type="string"),A.every(y=>y===null)&&(g.type="null"),g.enum=A;break}case"file":{let g=m,A={type:"string",format:"binary",contentEncoding:"binary"},{minimum:y,maximum:E,mime:_}=e._zod.bag;y!==void 0&&(A.minLength=y),E!==void 0&&(A.maxLength=E),_?_.length===1?(A.contentMediaType=_[0],Object.assign(g,A)):g.anyOf=_.map(v=>({...A,contentMediaType:v})):Object.assign(g,A);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(o.innerType,f);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"success":{let g=m;g.type="boolean";break}case"default":{this.process(o.innerType,f),l.ref=o.innerType,m.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,f),l.ref=o.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,f),l.ref=o.innerType;let g;try{g=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=m,A=e._zod.pattern;if(!A)throw Error("Pattern not found in template literal");g.type="string",g.pattern=A.source;break}case"pipe":{let g=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(g,f),l.ref=g;break}case"readonly":{this.process(o.innerType,f),l.ref=o.innerType,m.readOnly=!0;break}case"promise":{this.process(o.innerType,f),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,f),l.ref=o.innerType;break}case"lazy":{let g=e._zod.innerType;this.process(g,f),l.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&Im(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let A=n.external.registry.get(f[0])?.id;if(A)return{ref:n.external.uri(A)};let y=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=y,{defId:y,ref:`${n.external.uri("__shared")}#/${h}/${y}`}}if(f[1]===o)return{ref:"#"};let m=`#/${h}/`,g=f[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},"X"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"W");for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let m=n.external.registry.get(f[0])?.id;if(e!==f[0]&&m){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){if(n.cycles==="throw")throw Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(VFr,"e8");a(Sm,"t$");RQc={},kQc=st("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");bo.init(t,e),t.def=e,t.parse=(r,n)=>hTt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>cIt(t,r,n),t.parseAsync=async(r,n)=>mTt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>lIt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>mN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),PQc=st("ZodMiniObject",(t,e)=>{sFr.init(t,e),kQc.init(t,e),Hs.defineLazy(t,"shape",()=>e.shape)});a(h$i,"tq");a(fB,"a6");a(OEe,"S0");a(T3e,"S1");a(NBr,"I3");a(dFe,"v1");a(l3e,"$9");a(MBr,"R3");a(DQc,"_M");a(NQc,"kM");a(bJi,"P3");H={};pB(H,{xid:a(()=>WQc,"xid"),void:a(()=>hqc,"void"),uuidv7:a(()=>QQc,"uuidv7"),uuidv6:a(()=>UQc,"uuidv6"),uuidv4:a(()=>FQc,"uuidv4"),uuid:a(()=>LQc,"uuid"),url:a(()=>qQc,"url"),uppercase:a(()=>BFr,"uppercase"),unknown:a(()=>Kd,"unknown"),union:a(()=>Xl,"union"),undefined:a(()=>fqc,"undefined"),ulid:a(()=>VQc,"ulid"),uint64:a(()=>uqc,"uint64"),uint32:a(()=>aqc,"uint32"),tuple:a(()=>yqc,"tuple"),trim:a(()=>jFr,"trim"),treeifyError:a(()=>Pzi,"treeifyError"),transform:a(()=>b8r,"transform"),toUpperCase:a(()=>GFr,"toUpperCase"),toLowerCase:a(()=>HFr,"toLowerCase"),toJSONSchema:a(()=>VFr,"toJSONSchema"),templateLiteral:a(()=>xqc,"templateLiteral"),symbol:a(()=>dqc,"symbol"),superRefine:a(()=>hZi,"superRefine"),success:a(()=>Tqc,"success"),stringbool:a(()=>kqc,"stringbool"),stringFormat:a(()=>nqc,"stringFormat"),string:a(()=>bt,"string"),strictObject:a(()=>Aqc,"strictObject"),startsWith:a(()=>FFr,"startsWith"),size:a(()=>NFr,"size"),setErrorMap:a(()=>Nqc,"setErrorMap"),set:a(()=>Cqc,"set"),safeParseAsync:a(()=>DJi,"safeParseAsync"),safeParse:a(()=>PJi,"safeParse"),registry:a(()=>dFr,"registry"),regexes:a(()=>J3r,"regexes"),regex:a(()=>MFr,"regex"),refine:a(()=>pZi,"refine"),record:a(()=>Zl,"record"),readonly:a(()=>sZi,"readonly"),property:a(()=>mJi,"property"),promise:a(()=>wqc,"promise"),prettifyError:a(()=>Nzi,"prettifyError"),preprocess:a(()=>x8r,"preprocess"),prefault:a(()=>XJi,"prefault"),positive:a(()=>dJi,"positive"),pipe:a(()=>bTt,"pipe"),partialRecord:a(()=>Eqc,"partialRecord"),parseAsync:a(()=>kJi,"parseAsync"),parse:a(()=>RJi,"parse"),overwrite:a(()=>nie,"overwrite"),optional:a(()=>gd,"optional"),object:a(()=>Cn,"object"),number:a(()=>Dc,"number"),nullish:a(()=>Sqc,"nullish"),nullable:a(()=>vTt,"nullable"),null:a(()=>A8r,"null"),normalize:a(()=>qFr,"normalize"),nonpositive:a(()=>pJi,"nonpositive"),nonoptional:a(()=>eZi,"nonoptional"),nonnegative:a(()=>hJi,"nonnegative"),never:a(()=>yIt,"never"),negative:a(()=>fJi,"negative"),nativeEnum:a(()=>vqc,"nativeEnum"),nanoid:a(()=>HQc,"nanoid"),nan:a(()=>Iqc,"nan"),multipleOf:a(()=>K3e,"multipleOf"),minSize:a(()=>J3e,"minSize"),minLength:a(()=>c_e,"minLength"),mime:a(()=>QFr,"mime"),maxSize:a(()=>dIt,"maxSize"),maxLength:a(()=>fIt,"maxLength"),map:a(()=>_qc,"map"),lte:a(()=>cN,"lte"),lt:a(()=>Jne,"lt"),lowercase:a(()=>OFr,"lowercase"),looseObject:a(()=>LC,"looseObject"),locales:a(()=>uFr,"locales"),literal:a(()=>ei,"literal"),length:a(()=>pIt,"length"),lazy:a(()=>lZi,"lazy"),ksuid:a(()=>zQc,"ksuid"),keyof:a(()=>gqc,"keyof"),jwt:a(()=>rqc,"jwt"),json:a(()=>Pqc,"json"),iso:a(()=>WFr,"iso"),ipv6:a(()=>KQc,"ipv6"),ipv4:a(()=>YQc,"ipv4"),intersection:a(()=>_It,"intersection"),int64:a(()=>lqc,"int64"),int32:a(()=>sqc,"int32"),int:a(()=>PLr,"int"),instanceof:a(()=>Rqc,"instanceof"),includes:a(()=>LFr,"includes"),guid:a(()=>BQc,"guid"),gte:a(()=>dI,"gte"),gt:a(()=>Zne,"gt"),globalRegistry:a(()=>d9,"globalRegistry"),getErrorMap:a(()=>Mqc,"getErrorMap"),function:a(()=>vJi,"function"),formatError:a(()=>V3r,"formatError"),float64:a(()=>oqc,"float64"),float32:a(()=>iqc,"float32"),flattenError:a(()=>$3r,"flattenError"),file:a(()=>bqc,"file"),enum:a(()=>_1,"enum"),endsWith:a(()=>UFr,"endsWith"),emoji:a(()=>jQc,"emoji"),email:a(()=>OQc,"email"),e164:a(()=>tqc,"e164"),discriminatedUnion:a(()=>_8r,"discriminatedUnion"),date:a(()=>mqc,"date"),custom:a(()=>fZi,"custom"),cuid2:a(()=>$Qc,"cuid2"),cuid:a(()=>GQc,"cuid"),core:a(()=>Ezi,"core"),config:a(()=>QC,"config"),coerce:a(()=>mZi,"coerce"),clone:a(()=>mN,"clone"),cidrv6:a(()=>ZQc,"cidrv6"),cidrv4:a(()=>JQc,"cidrv4"),check:a(()=>dZi,"check"),catch:a(()=>nZi,"catch"),boolean:a(()=>Tm,"boolean"),bigint:a(()=>cqc,"bigint"),base64url:a(()=>eqc,"base64url"),base64:a(()=>XQc,"base64"),array:a(()=>_a,"array"),any:a(()=>pqc,"any"),_default:a(()=>JJi,"_default"),_ZodString:a(()=>ZFr,"_ZodString"),ZodXID:a(()=>s8r,"ZodXID"),ZodVoid:a(()=>QJi,"ZodVoid"),ZodUnknown:a(()=>FJi,"ZodUnknown"),ZodUnion:a(()=>E8r,"ZodUnion"),ZodUndefined:a(()=>OJi,"ZodUndefined"),ZodUUID:a(()=>f9,"ZodUUID"),ZodURL:a(()=>e8r,"ZodURL"),ZodULID:a(()=>o8r,"ZodULID"),ZodType:a(()=>Ps,"ZodType"),ZodTuple:a(()=>GJi,"ZodTuple"),ZodTransform:a(()=>v8r,"ZodTransform"),ZodTemplateLiteral:a(()=>aZi,"ZodTemplateLiteral"),ZodSymbol:a(()=>MJi,"ZodSymbol"),ZodSuccess:a(()=>tZi,"ZodSuccess"),ZodStringFormat:a(()=>yd,"ZodStringFormat"),ZodString:a(()=>hIt,"ZodString"),ZodSet:a(()=>VJi,"ZodSet"),ZodRecord:a(()=>C8r,"ZodRecord"),ZodRealError:a(()=>fFe,"ZodRealError"),ZodReadonly:a(()=>oZi,"ZodReadonly"),ZodPromise:a(()=>uZi,"ZodPromise"),ZodPrefault:a(()=>ZJi,"ZodPrefault"),ZodPipe:a(()=>I8r,"ZodPipe"),ZodOptional:a(()=>S8r,"ZodOptional"),ZodObject:a(()=>EIt,"ZodObject"),ZodNumberFormat:a(()=>C_e,"ZodNumberFormat"),ZodNumber:a(()=>mIt,"ZodNumber"),ZodNullable:a(()=>YJi,"ZodNullable"),ZodNull:a(()=>BJi,"ZodNull"),ZodNonOptional:a(()=>T8r,"ZodNonOptional"),ZodNever:a(()=>UJi,"ZodNever"),ZodNanoID:a(()=>r8r,"ZodNanoID"),ZodNaN:a(()=>iZi,"ZodNaN"),ZodMap:a(()=>$Ji,"ZodMap"),ZodLiteral:a(()=>WJi,"ZodLiteral"),ZodLazy:a(()=>cZi,"ZodLazy"),ZodKSUID:a(()=>a8r,"ZodKSUID"),ZodJWT:a(()=>m8r,"ZodJWT"),ZodIssueCode:a(()=>Dqc,"ZodIssueCode"),ZodIntersection:a(()=>HJi,"ZodIntersection"),ZodISOTime:a(()=>KFr,"ZodISOTime"),ZodISODuration:a(()=>JFr,"ZodISODuration"),ZodISODateTime:a(()=>zFr,"ZodISODateTime"),ZodISODate:a(()=>YFr,"ZodISODate"),ZodIPv6:a(()=>l8r,"ZodIPv6"),ZodIPv4:a(()=>c8r,"ZodIPv4"),ZodGUID:a(()=>CTt,"ZodGUID"),ZodFile:a(()=>zJi,"ZodFile"),ZodError:a(()=>MQc,"ZodError"),ZodEnum:a(()=>X3e,"ZodEnum"),ZodEmoji:a(()=>t8r,"ZodEmoji"),ZodEmail:a(()=>XFr,"ZodEmail"),ZodE164:a(()=>h8r,"ZodE164"),ZodDiscriminatedUnion:a(()=>jJi,"ZodDiscriminatedUnion"),ZodDefault:a(()=>KJi,"ZodDefault"),ZodDate:a(()=>y8r,"ZodDate"),ZodCustomStringFormat:a(()=>NJi,"ZodCustomStringFormat"),ZodCustom:a(()=>CIt,"ZodCustom"),ZodCatch:a(()=>rZi,"ZodCatch"),ZodCUID2:a(()=>i8r,"ZodCUID2"),ZodCUID:a(()=>n8r,"ZodCUID"),ZodCIDRv6:a(()=>d8r,"ZodCIDRv6"),ZodCIDRv4:a(()=>u8r,"ZodCIDRv4"),ZodBoolean:a(()=>gIt,"ZodBoolean"),ZodBigIntFormat:a(()=>g8r,"ZodBigIntFormat"),ZodBigInt:a(()=>AIt,"ZodBigInt"),ZodBase64URL:a(()=>p8r,"ZodBase64URL"),ZodBase64:a(()=>f8r,"ZodBase64"),ZodArray:a(()=>qJi,"ZodArray"),ZodAny:a(()=>LJi,"ZodAny"),TimePrecision:a(()=>FKi,"TimePrecision"),NEVER:a(()=>_zi,"NEVER"),$output:a(()=>MKi,"$output"),$input:a(()=>OKi,"$input"),$brand:a(()=>Czi,"$brand")});WFr={};pB(WFr,{time:a(()=>IJi,"time"),duration:a(()=>xJi,"duration"),datetime:a(()=>SJi,"datetime"),date:a(()=>TJi,"date"),ZodISOTime:a(()=>KFr,"ZodISOTime"),ZodISODuration:a(()=>JFr,"ZodISODuration"),ZodISODateTime:a(()=>zFr,"ZodISODateTime"),ZodISODate:a(()=>YFr,"ZodISODate")});zFr=st("ZodISODateTime",(t,e)=>{jYi.init(t,e),yd.init(t,e)});a(SJi,"aq");YFr=st("ZodISODate",(t,e)=>{HYi.init(t,e),yd.init(t,e)});a(TJi,"sq");KFr=st("ZodISOTime",(t,e)=>{GYi.init(t,e),yd.init(t,e)});a(IJi,"eq");JFr=st("ZodISODuration",(t,e)=>{$Yi.init(t,e),yd.init(t,e)});a(xJi,"$V");wJi=a((t,e)=>{G3r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>V3r(t,r),"value")},flatten:{value:a(r=>$3r(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),MQc=st("ZodError",wJi),fFe=st("ZodError",wJi,{Parent:Error}),RJi=W3r(fFe),kJi=z3r(fFe),PJi=Y3r(fFe),DJi=K3r(fFe),Ps=st("ZodType",(t,e)=>(bo.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>mN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>RJi(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>PJi(t,r,n),t.parseAsync=async(r,n)=>kJi(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>DJi(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(pZi(r,n)),t.superRefine=r=>t.check(hZi(r)),t.overwrite=r=>t.check(nie(r)),t.optional=()=>gd(t),t.nullable=()=>vTt(t),t.nullish=()=>gd(vTt(t)),t.nonoptional=r=>eZi(t,r),t.array=()=>_a(t),t.or=r=>Xl([t,r]),t.and=r=>_It(t,r),t.transform=r=>bTt(t,b8r(r)),t.default=r=>JJi(t,r),t.prefault=r=>XJi(t,r),t.catch=r=>nZi(t,r),t.pipe=r=>bTt(t,r),t.readonly=()=>sZi(t),t.describe=r=>{let n=t.clone();return d9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return d9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return d9.get(t);let n=t.clone();return d9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),ZFr=st("_ZodString",(t,e)=>{uFe.init(t,e),Ps.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(MFr(...n)),t.includes=(...n)=>t.check(LFr(...n)),t.startsWith=(...n)=>t.check(FFr(...n)),t.endsWith=(...n)=>t.check(UFr(...n)),t.min=(...n)=>t.check(c_e(...n)),t.max=(...n)=>t.check(fIt(...n)),t.length=(...n)=>t.check(pIt(...n)),t.nonempty=(...n)=>t.check(c_e(1,...n)),t.lowercase=n=>t.check(OFr(n)),t.uppercase=n=>t.check(BFr(n)),t.trim=()=>t.check(jFr()),t.normalize=(...n)=>t.check(qFr(...n)),t.toLowerCase=()=>t.check(HFr()),t.toUpperCase=()=>t.check(GFr())}),hIt=st("ZodString",(t,e)=>{uFe.init(t,e),ZFr.init(t,e),t.email=r=>t.check(fFr(XFr,r)),t.url=r=>t.check(AFr(e8r,r)),t.jwt=r=>t.check(DFr(m8r,r)),t.emoji=r=>t.check(yFr(t8r,r)),t.guid=r=>t.check(yTt(CTt,r)),t.uuid=r=>t.check(pFr(f9,r)),t.uuidv4=r=>t.check(hFr(f9,r)),t.uuidv6=r=>t.check(mFr(f9,r)),t.uuidv7=r=>t.check(gFr(f9,r)),t.nanoid=r=>t.check(EFr(r8r,r)),t.guid=r=>t.check(yTt(CTt,r)),t.cuid=r=>t.check(_Fr(n8r,r)),t.cuid2=r=>t.check(CFr(i8r,r)),t.ulid=r=>t.check(vFr(o8r,r)),t.base64=r=>t.check(RFr(f8r,r)),t.base64url=r=>t.check(kFr(p8r,r)),t.xid=r=>t.check(bFr(s8r,r)),t.ksuid=r=>t.check(SFr(a8r,r)),t.ipv4=r=>t.check(TFr(c8r,r)),t.ipv6=r=>t.check(IFr(l8r,r)),t.cidrv4=r=>t.check(xFr(u8r,r)),t.cidrv6=r=>t.check(wFr(d8r,r)),t.e164=r=>t.check(PFr(h8r,r)),t.datetime=r=>t.check(SJi(r)),t.date=r=>t.check(TJi(r)),t.time=r=>t.check(IJi(r)),t.duration=r=>t.check(xJi(r))});a(bt,"L");yd=st("ZodStringFormat",(t,e)=>{ku.init(t,e),ZFr.init(t,e)}),XFr=st("ZodEmail",(t,e)=>{NYi.init(t,e),yd.init(t,e)});a(OQc,"Cm");CTt=st("ZodGUID",(t,e)=>{PYi.init(t,e),yd.init(t,e)});a(BQc,"Tm");f9=st("ZodUUID",(t,e)=>{DYi.init(t,e),yd.init(t,e)});a(LQc,"xm");a(FQc,"ym");a(UQc,"fm");a(QQc,"gm");e8r=st("ZodURL",(t,e)=>{MYi.init(t,e),yd.init(t,e)});a(qQc,"hm");t8r=st("ZodEmoji",(t,e)=>{OYi.init(t,e),yd.init(t,e)});a(jQc,"um");r8r=st("ZodNanoID",(t,e)=>{BYi.init(t,e),yd.init(t,e)});a(HQc,"mm");n8r=st("ZodCUID",(t,e)=>{LYi.init(t,e),yd.init(t,e)});a(GQc,"lm");i8r=st("ZodCUID2",(t,e)=>{FYi.init(t,e),yd.init(t,e)});a($Qc,"cm");o8r=st("ZodULID",(t,e)=>{UYi.init(t,e),yd.init(t,e)});a(VQc,"pm");s8r=st("ZodXID",(t,e)=>{QYi.init(t,e),yd.init(t,e)});a(WQc,"dm");a8r=st("ZodKSUID",(t,e)=>{qYi.init(t,e),yd.init(t,e)});a(zQc,"im");c8r=st("ZodIPv4",(t,e)=>{VYi.init(t,e),yd.init(t,e)});a(YQc,"nm");l8r=st("ZodIPv6",(t,e)=>{WYi.init(t,e),yd.init(t,e)});a(KQc,"rm");u8r=st("ZodCIDRv4",(t,e)=>{zYi.init(t,e),yd.init(t,e)});a(JQc,"om");d8r=st("ZodCIDRv6",(t,e)=>{YYi.init(t,e),yd.init(t,e)});a(ZQc,"tm");f8r=st("ZodBase64",(t,e)=>{KYi.init(t,e),yd.init(t,e)});a(XQc,"am");p8r=st("ZodBase64URL",(t,e)=>{ZYi.init(t,e),yd.init(t,e)});a(eqc,"sm");h8r=st("ZodE164",(t,e)=>{XYi.init(t,e),yd.init(t,e)});a(tqc,"em");m8r=st("ZodJWT",(t,e)=>{tKi.init(t,e),yd.init(t,e)});a(rqc,"$l");NJi=st("ZodCustomStringFormat",(t,e)=>{rKi.init(t,e),yd.init(t,e)});a(nqc,"Ql");mIt=st("ZodNumber",(t,e)=>{rFr.init(t,e),Ps.init(t,e),t.gt=(n,o)=>t.check(Zne(n,o)),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.lt=(n,o)=>t.check(Jne(n,o)),t.lte=(n,o)=>t.check(cN(n,o)),t.max=(n,o)=>t.check(cN(n,o)),t.int=n=>t.check(PLr(n)),t.safe=n=>t.check(PLr(n)),t.positive=n=>t.check(Zne(0,n)),t.nonnegative=n=>t.check(dI(0,n)),t.negative=n=>t.check(Jne(0,n)),t.nonpositive=n=>t.check(cN(0,n)),t.multipleOf=(n,o)=>t.check(K3e(n,o)),t.step=(n,o)=>t.check(K3e(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Dc,"z$");C_e=st("ZodNumberFormat",(t,e)=>{nKi.init(t,e),mIt.init(t,e)});a(PLr,"WV");a(iqc,"Jl");a(oqc,"Xl");a(sqc,"Yl");a(aqc,"Wl");gIt=st("ZodBoolean",(t,e)=>{nFr.init(t,e),Ps.init(t,e)});a(Tm,"i$");AIt=st("ZodBigInt",(t,e)=>{iFr.init(t,e),Ps.init(t,e),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.gt=(n,o)=>t.check(Zne(n,o)),t.gte=(n,o)=>t.check(dI(n,o)),t.min=(n,o)=>t.check(dI(n,o)),t.lt=(n,o)=>t.check(Jne(n,o)),t.lte=(n,o)=>t.check(cN(n,o)),t.max=(n,o)=>t.check(cN(n,o)),t.positive=n=>t.check(Zne(BigInt(0),n)),t.negative=n=>t.check(Jne(BigInt(0),n)),t.nonpositive=n=>t.check(cN(BigInt(0),n)),t.nonnegative=n=>t.check(dI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(K3e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(cqc,"Gl");g8r=st("ZodBigIntFormat",(t,e)=>{iKi.init(t,e),AIt.init(t,e)});a(lqc,"Ul");a(uqc,"Hl");MJi=st("ZodSymbol",(t,e)=>{oKi.init(t,e),Ps.init(t,e)});a(dqc,"Kl");OJi=st("ZodUndefined",(t,e)=>{sKi.init(t,e),Ps.init(t,e)});a(fqc,"ql");BJi=st("ZodNull",(t,e)=>{aKi.init(t,e),Ps.init(t,e)});a(A8r,"T3");LJi=st("ZodAny",(t,e)=>{cKi.init(t,e),Ps.init(t,e)});a(pqc,"Vl");FJi=st("ZodUnknown",(t,e)=>{ATt.init(t,e),Ps.init(t,e)});a(Kd,"S$");UJi=st("ZodNever",(t,e)=>{lKi.init(t,e),Ps.init(t,e)});a(yIt,"x3");QJi=st("ZodVoid",(t,e)=>{uKi.init(t,e),Ps.init(t,e)});a(hqc,"Bl");y8r=st("ZodDate",(t,e)=>{dKi.init(t,e),Ps.init(t,e),t.min=(n,o)=>t.check(dI(n,o)),t.max=(n,o)=>t.check(cN(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(mqc,"zl");qJi=st("ZodArray",(t,e)=>{oFr.init(t,e),Ps.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(c_e(r,n)),t.nonempty=r=>t.check(c_e(1,r)),t.max=(r,n)=>t.check(fIt(r,n)),t.length=(r,n)=>t.check(pIt(r,n)),t.unwrap=()=>t.element});a(_a,"W$");a(gqc,"Nl");EIt=st("ZodObject",(t,e)=>{sFr.init(t,e),Ps.init(t,e),Hs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>_1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Kd()}),t.loose=()=>t.clone({...t._zod.def,catchall:Kd()}),t.strict=()=>t.clone({...t._zod.def,catchall:yIt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Hs.extend(t,r),t.merge=r=>Hs.merge(t,r),t.pick=r=>Hs.pick(t,r),t.omit=r=>Hs.omit(t,r),t.partial=(...r)=>Hs.partial(S8r,t,r[0]),t.required=(...r)=>Hs.required(T8r,t,r[0])});a(Cn,"h");a(Aqc,"wl");a(LC,"K6");E8r=st("ZodUnion",(t,e)=>{aFr.init(t,e),Ps.init(t,e),t.options=e.options});a(Xl,"A$");jJi=st("ZodDiscriminatedUnion",(t,e)=>{E8r.init(t,e),fKi.init(t,e)});a(_8r,"g3");HJi=st("ZodIntersection",(t,e)=>{pKi.init(t,e),Ps.init(t,e)});a(_It,"VJ");GJi=st("ZodTuple",(t,e)=>{uIt.init(t,e),Ps.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(yqc,"Ol");C8r=st("ZodRecord",(t,e)=>{hKi.init(t,e),Ps.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Zl,"I$");a(Eqc,"Dl");$Ji=st("ZodMap",(t,e)=>{mKi.init(t,e),Ps.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(_qc,"Fl");VJi=st("ZodSet",(t,e)=>{gKi.init(t,e),Ps.init(t,e),t.min=(...r)=>t.check(J3e(...r)),t.nonempty=r=>t.check(J3e(1,r)),t.max=(...r)=>t.check(dIt(...r)),t.size=(...r)=>t.check(NFr(...r))});a(Cqc,"Zl");X3e=st("ZodEnum",(t,e)=>{AKi.init(t,e),Ps.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new X3e({...e,checks:[],...Hs.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new X3e({...e,checks:[],...Hs.normalizeParams(o),entries:s})}});a(_1,"N6");a(vqc,"Ml");WJi=st("ZodLiteral",(t,e)=>{yKi.init(t,e),Ps.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(ei,"l");zJi=st("ZodFile",(t,e)=>{EKi.init(t,e),Ps.init(t,e),t.min=(r,n)=>t.check(J3e(r,n)),t.max=(r,n)=>t.check(dIt(r,n)),t.mime=(r,n)=>t.check(QFr(Array.isArray(r)?r:[r],n))});a(bqc,"Ll");v8r=st("ZodTransform",(t,e)=>{cFr.init(t,e),Ps.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Hs.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(Hs.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(b8r,"bV");S8r=st("ZodOptional",(t,e)=>{_Ki.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gd,"_$");YJi=st("ZodNullable",(t,e)=>{CKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(vTt,"v3");a(Sqc,"jl");KJi=st("ZodDefault",(t,e)=>{vKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(JJi,"aM");ZJi=st("ZodPrefault",(t,e)=>{bKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(XJi,"eM");T8r=st("ZodNonOptional",(t,e)=>{SKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(eZi,"$L");tZi=st("ZodSuccess",(t,e)=>{TKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(Tqc,"Al");rZi=st("ZodCatch",(t,e)=>{IKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(nZi,"XL");iZi=st("ZodNaN",(t,e)=>{xKi.init(t,e),Ps.init(t,e)});a(Iqc,"Il");I8r=st("ZodPipe",(t,e)=>{lFr.init(t,e),Ps.init(t,e),t.in=e.in,t.out=e.out});a(bTt,"C3");oZi=st("ZodReadonly",(t,e)=>{wKi.init(t,e),Ps.init(t,e)});a(sZi,"GL");aZi=st("ZodTemplateLiteral",(t,e)=>{RKi.init(t,e),Ps.init(t,e)});a(xqc,"Rl");cZi=st("ZodLazy",(t,e)=>{PKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(lZi,"KL");uZi=st("ZodPromise",(t,e)=>{kKi.init(t,e),Ps.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(wqc,"Pl");CIt=st("ZodCustom",(t,e)=>{DKi.init(t,e),Ps.init(t,e)});a(dZi,"VL");a(fZi,"vV");a(pZi,"BL");a(hZi,"zL");a(Rqc,"El");kqc=a((...t)=>_Ji({Pipe:I8r,Boolean:gIt,String:hIt,Transform:v8r},...t),"bl");a(Pqc,"_l");a(x8r,"u3");Dqc={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(Nqc,"Sl");a(Mqc,"vl");mZi={};pB(mZi,{string:a(()=>Oqc,"string"),number:a(()=>Bqc,"number"),date:a(()=>Uqc,"date"),boolean:a(()=>Lqc,"boolean"),bigint:a(()=>Fqc,"bigint")});a(Oqc,"Cl");a(Bqc,"Tl");a(Lqc,"xl");a(Fqc,"yl");a(Uqc,"fl");QC(NKi());Qqc=H,gZi=Qqc,AZi="2025-11-25",qqc=[AZi,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Une="io.modelcontextprotocol/related-task",vIt="2.0",Im=fZi(t=>t!==null&&(typeof t=="object"||typeof t=="function")),yZi=Xl([bt(),Dc().int()]),EZi=bt(),OBh=LC({ttl:Dc().optional(),pollInterval:Dc().optional()}),jqc=Cn({ttl:Dc().optional()}),Hqc=Cn({taskId:bt()}),w8r=LC({progressToken:yZi.optional(),[Une]:Hqc.optional()}),gI=Cn({_meta:w8r.optional()}),pFe=gI.extend({task:jqc.optional()}),Gqc=a(t=>pFe.safeParse(t).success,"FL"),dy=Cn({method:bt(),params:gI.loose().optional()}),KR=Cn({_meta:w8r.optional()}),JR=Cn({method:bt(),params:KR.loose().optional()}),fy=LC({_meta:w8r.optional()}),bIt=Xl([bt(),Dc().int()]),_Zi=Cn({jsonrpc:ei(vIt),id:bIt,...dy.shape}).strict(),m$i=a(t=>_Zi.safeParse(t).success,"fV"),CZi=Cn({jsonrpc:ei(vIt),...JR.shape}).strict(),$qc=a(t=>CZi.safeParse(t).success,"LL"),R8r=Cn({jsonrpc:ei(vIt),id:bIt,result:fy}).strict(),hSt=a(t=>R8r.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Bi||(Bi={}));k8r=Cn({jsonrpc:ei(vIt),id:bIt.optional(),error:Cn({code:Dc().int(),message:bt(),data:Kd().optional()})}).strict(),Vqc=a(t=>k8r.safeParse(t).success,"jL"),BBh=Xl([_Zi,CZi,R8r,k8r]),LBh=Xl([R8r,k8r]),P8r=fy.strict(),Wqc=KR.extend({requestId:bIt.optional(),reason:bt().optional()}),D8r=JR.extend({method:ei("notifications/cancelled"),params:Wqc}),zqc=Cn({src:bt(),mimeType:bt().optional(),sizes:_a(bt()).optional(),theme:_1(["light","dark"]).optional()}),hFe=Cn({icons:_a(zqc).optional()}),l_e=Cn({name:bt(),title:bt().optional()}),vZi=l_e.extend({...l_e.shape,...hFe.shape,version:bt(),websiteUrl:bt().optional(),description:bt().optional()}),Yqc=_It(Cn({applyDefaults:Tm().optional()}),Zl(bt(),Kd())),Kqc=x8r(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,_It(Cn({form:Yqc.optional(),url:Im.optional()}),Zl(bt(),Kd()).optional())),Jqc=LC({list:Im.optional(),cancel:Im.optional(),requests:LC({sampling:LC({createMessage:Im.optional()}).optional(),elicitation:LC({create:Im.optional()}).optional()}).optional()}),Zqc=LC({list:Im.optional(),cancel:Im.optional(),requests:LC({tools:LC({call:Im.optional()}).optional()}).optional()}),Xqc=Cn({experimental:Zl(bt(),Im).optional(),sampling:Cn({context:Im.optional(),tools:Im.optional()}).optional(),elicitation:Kqc.optional(),roots:Cn({listChanged:Tm().optional()}).optional(),tasks:Jqc.optional(),extensions:Zl(bt(),Im).optional()}),ejc=gI.extend({protocolVersion:bt(),capabilities:Xqc,clientInfo:vZi}),bZi=dy.extend({method:ei("initialize"),params:ejc}),tjc=Cn({experimental:Zl(bt(),Im).optional(),logging:Im.optional(),completions:Im.optional(),prompts:Cn({listChanged:Tm().optional()}).optional(),resources:Cn({subscribe:Tm().optional(),listChanged:Tm().optional()}).optional(),tools:Cn({listChanged:Tm().optional()}).optional(),tasks:Zqc.optional(),extensions:Zl(bt(),Im).optional()}),rjc=fy.extend({protocolVersion:bt(),capabilities:tjc,serverInfo:vZi,instructions:bt().optional()}),SZi=JR.extend({method:ei("notifications/initialized"),params:KR.optional()}),N8r=dy.extend({method:ei("ping"),params:gI.optional()}),njc=Cn({progress:Dc(),total:gd(Dc()),message:gd(bt())}),ijc=Cn({...KR.shape,...njc.shape,progressToken:yZi}),M8r=JR.extend({method:ei("notifications/progress"),params:ijc}),ojc=gI.extend({cursor:EZi.optional()}),mFe=dy.extend({params:ojc.optional()}),gFe=fy.extend({nextCursor:EZi.optional()}),sjc=_1(["working","input_required","completed","failed","cancelled"]),AFe=Cn({taskId:bt(),status:sjc,ttl:Xl([Dc(),A8r()]),createdAt:bt(),lastUpdatedAt:bt(),pollInterval:gd(Dc()),statusMessage:gd(bt())}),SIt=fy.extend({task:AFe}),ajc=KR.merge(AFe),STt=JR.extend({method:ei("notifications/tasks/status"),params:ajc}),O8r=dy.extend({method:ei("tasks/get"),params:gI.extend({taskId:bt()})}),B8r=fy.merge(AFe),L8r=dy.extend({method:ei("tasks/result"),params:gI.extend({taskId:bt()})}),FBh=fy.loose(),F8r=mFe.extend({method:ei("tasks/list")}),U8r=gFe.extend({tasks:_a(AFe)}),Q8r=dy.extend({method:ei("tasks/cancel"),params:gI.extend({taskId:bt()})}),cjc=fy.merge(AFe),TZi=Cn({uri:bt(),mimeType:gd(bt()),_meta:Zl(bt(),Kd()).optional()}),IZi=TZi.extend({text:bt()}),q8r=bt().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),xZi=TZi.extend({blob:q8r}),yFe=_1(["user","assistant"]),v_e=Cn({audience:_a(yFe).optional(),priority:Dc().min(0).max(1).optional(),lastModified:WFr.datetime({offset:!0}).optional()}),wZi=Cn({...l_e.shape,...hFe.shape,uri:bt(),description:gd(bt()),mimeType:gd(bt()),size:gd(Dc()),annotations:v_e.optional(),_meta:gd(LC({}))}),ljc=Cn({...l_e.shape,...hFe.shape,uriTemplate:bt(),description:gd(bt()),mimeType:gd(bt()),annotations:v_e.optional(),_meta:gd(LC({}))}),DLr=mFe.extend({method:ei("resources/list")}),ujc=gFe.extend({resources:_a(wZi)}),NLr=mFe.extend({method:ei("resources/templates/list")}),djc=gFe.extend({resourceTemplates:_a(ljc)}),j8r=gI.extend({uri:bt()}),fjc=j8r,MLr=dy.extend({method:ei("resources/read"),params:fjc}),pjc=fy.extend({contents:_a(Xl([IZi,xZi]))}),hjc=JR.extend({method:ei("notifications/resources/list_changed"),params:KR.optional()}),mjc=j8r,gjc=dy.extend({method:ei("resources/subscribe"),params:mjc}),Ajc=j8r,yjc=dy.extend({method:ei("resources/unsubscribe"),params:Ajc}),Ejc=KR.extend({uri:bt()}),_jc=JR.extend({method:ei("notifications/resources/updated"),params:Ejc}),Cjc=Cn({name:bt(),description:gd(bt()),required:gd(Tm())}),vjc=Cn({...l_e.shape,...hFe.shape,description:gd(bt()),arguments:gd(_a(Cjc)),_meta:gd(LC({}))}),OLr=mFe.extend({method:ei("prompts/list")}),bjc=gFe.extend({prompts:_a(vjc)}),Sjc=gI.extend({name:bt(),arguments:Zl(bt(),bt()).optional()}),BLr=dy.extend({method:ei("prompts/get"),params:Sjc}),H8r=Cn({type:ei("text"),text:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),G8r=Cn({type:ei("image"),data:q8r,mimeType:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),$8r=Cn({type:ei("audio"),data:q8r,mimeType:bt(),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),Tjc=Cn({type:ei("tool_use"),name:bt(),id:bt(),input:Zl(bt(),Kd()),_meta:Zl(bt(),Kd()).optional()}),Ijc=Cn({type:ei("resource"),resource:Xl([IZi,xZi]),annotations:v_e.optional(),_meta:Zl(bt(),Kd()).optional()}),xjc=wZi.extend({type:ei("resource_link")}),V8r=Xl([H8r,G8r,$8r,xjc,Ijc]),wjc=Cn({role:yFe,content:V8r}),Rjc=fy.extend({description:bt().optional(),messages:_a(wjc)}),kjc=JR.extend({method:ei("notifications/prompts/list_changed"),params:KR.optional()}),Pjc=Cn({title:bt().optional(),readOnlyHint:Tm().optional(),destructiveHint:Tm().optional(),idempotentHint:Tm().optional(),openWorldHint:Tm().optional()}),Djc=Cn({taskSupport:_1(["required","optional","forbidden"]).optional()}),RZi=Cn({...l_e.shape,...hFe.shape,description:bt().optional(),inputSchema:Cn({type:ei("object"),properties:Zl(bt(),Im).optional(),required:_a(bt()).optional()}).catchall(Kd()),outputSchema:Cn({type:ei("object"),properties:Zl(bt(),Im).optional(),required:_a(bt()).optional()}).catchall(Kd()).optional(),annotations:Pjc.optional(),execution:Djc.optional(),_meta:Zl(bt(),Kd()).optional()}),LLr=mFe.extend({method:ei("tools/list")}),Njc=gFe.extend({tools:_a(RZi)}),W8r=fy.extend({content:_a(V8r).default([]),structuredContent:Zl(bt(),Kd()).optional(),isError:Tm().optional()}),UBh=W8r.or(fy.extend({toolResult:Kd()})),Mjc=pFe.extend({name:bt(),arguments:Zl(bt(),Kd()).optional()}),TTt=dy.extend({method:ei("tools/call"),params:Mjc}),Ojc=JR.extend({method:ei("notifications/tools/list_changed"),params:KR.optional()}),QBh=Cn({autoRefresh:Tm().default(!0),debounceMs:Dc().int().nonnegative().default(300)}),ITt=_1(["debug","info","notice","warning","error","critical","alert","emergency"]),Bjc=gI.extend({level:ITt}),kZi=dy.extend({method:ei("logging/setLevel"),params:Bjc}),Ljc=KR.extend({level:ITt,logger:bt().optional(),data:Kd()}),Fjc=JR.extend({method:ei("notifications/message"),params:Ljc}),Ujc=Cn({name:bt().optional()}),Qjc=Cn({hints:_a(Ujc).optional(),costPriority:Dc().min(0).max(1).optional(),speedPriority:Dc().min(0).max(1).optional(),intelligencePriority:Dc().min(0).max(1).optional()}),qjc=Cn({mode:_1(["auto","required","none"]).optional()}),jjc=Cn({type:ei("tool_result"),toolUseId:bt().describe("The unique identifier for the corresponding tool call."),content:_a(V8r).default([]),structuredContent:Cn({}).loose().optional(),isError:Tm().optional(),_meta:Zl(bt(),Kd()).optional()}),Hjc=_8r("type",[H8r,G8r,$8r]),xTt=_8r("type",[H8r,G8r,$8r,Tjc,jjc]),Gjc=Cn({role:yFe,content:Xl([xTt,_a(xTt)]),_meta:Zl(bt(),Kd()).optional()}),$jc=pFe.extend({messages:_a(Gjc),modelPreferences:Qjc.optional(),systemPrompt:bt().optional(),includeContext:_1(["none","thisServer","allServers"]).optional(),temperature:Dc().optional(),maxTokens:Dc().int(),stopSequences:_a(bt()).optional(),metadata:Im.optional(),tools:_a(RZi).optional(),toolChoice:qjc.optional()}),Vjc=dy.extend({method:ei("sampling/createMessage"),params:$jc}),z8r=fy.extend({model:bt(),stopReason:gd(_1(["endTurn","stopSequence","maxTokens"]).or(bt())),role:yFe,content:Hjc}),PZi=fy.extend({model:bt(),stopReason:gd(_1(["endTurn","stopSequence","maxTokens","toolUse"]).or(bt())),role:yFe,content:Xl([xTt,_a(xTt)])}),Wjc=Cn({type:ei("boolean"),title:bt().optional(),description:bt().optional(),default:Tm().optional()}),zjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),minLength:Dc().optional(),maxLength:Dc().optional(),format:_1(["email","uri","date","date-time"]).optional(),default:bt().optional()}),Yjc=Cn({type:_1(["number","integer"]),title:bt().optional(),description:bt().optional(),minimum:Dc().optional(),maximum:Dc().optional(),default:Dc().optional()}),Kjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),enum:_a(bt()),default:bt().optional()}),Jjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),oneOf:_a(Cn({const:bt(),title:bt()})),default:bt().optional()}),Zjc=Cn({type:ei("string"),title:bt().optional(),description:bt().optional(),enum:_a(bt()),enumNames:_a(bt()).optional(),default:bt().optional()}),Xjc=Xl([Kjc,Jjc]),eHc=Cn({type:ei("array"),title:bt().optional(),description:bt().optional(),minItems:Dc().optional(),maxItems:Dc().optional(),items:Cn({type:ei("string"),enum:_a(bt())}),default:_a(bt()).optional()}),tHc=Cn({type:ei("array"),title:bt().optional(),description:bt().optional(),minItems:Dc().optional(),maxItems:Dc().optional(),items:Cn({anyOf:_a(Cn({const:bt(),title:bt()}))}),default:_a(bt()).optional()}),rHc=Xl([eHc,tHc]),nHc=Xl([Zjc,Xjc,rHc]),iHc=Xl([nHc,Wjc,zjc,Yjc]),oHc=pFe.extend({mode:ei("form").optional(),message:bt(),requestedSchema:Cn({type:ei("object"),properties:Zl(bt(),iHc),required:_a(bt()).optional()})}),sHc=pFe.extend({mode:ei("url"),message:bt(),elicitationId:bt(),url:bt().url()}),aHc=Xl([oHc,sHc]),cHc=dy.extend({method:ei("elicitation/create"),params:aHc}),lHc=KR.extend({elicitationId:bt()}),uHc=JR.extend({method:ei("notifications/elicitation/complete"),params:lHc}),wTt=fy.extend({action:_1(["accept","decline","cancel"]),content:x8r(t=>t===null?void 0:t,Zl(bt(),Xl([bt(),Dc(),Tm(),_a(bt())])).optional())}),dHc=Cn({type:ei("ref/resource"),uri:bt()}),fHc=Cn({type:ei("ref/prompt"),name:bt()}),pHc=gI.extend({ref:Xl([fHc,dHc]),argument:Cn({name:bt(),value:bt()}),context:Cn({arguments:Zl(bt(),bt()).optional()}).optional()}),FLr=dy.extend({method:ei("completion/complete"),params:pHc});a(hHc,"kL");a(mHc,"SL");gHc=fy.extend({completion:LC({values:_a(bt()).max(100),total:gd(Dc().int()),hasMore:gd(Tm())})}),AHc=Cn({uri:bt().startsWith("file://"),name:bt().optional(),_meta:Zl(bt(),Kd()).optional()}),yHc=dy.extend({method:ei("roots/list"),params:gI.optional()}),DZi=fy.extend({roots:_a(AHc)}),EHc=JR.extend({method:ei("notifications/roots/list_changed"),params:KR.optional()}),qBh=Xl([N8r,bZi,FLr,kZi,BLr,OLr,DLr,NLr,MLr,gjc,yjc,TTt,LLr,O8r,L8r,F8r,Q8r]),jBh=Xl([D8r,M8r,SZi,EHc,STt]),HBh=Xl([P8r,z8r,PZi,wTt,DZi,B8r,U8r,SIt]),GBh=Xl([N8r,Vjc,cHc,yHc,O8r,L8r,F8r,Q8r]),$Bh=Xl([D8r,M8r,Fjc,_jc,hjc,Ojc,kjc,STt,uHc]),VBh=Xl([P8r,rjc,gHc,Rjc,bjc,ujc,djc,pjc,W8r,Njc,B8r,U8r,SIt]),li=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Bi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new ULr(o.elicitations,r)}return new t(e,r,n)}},ULr=class extends li{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Bi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Lne,"T1");_Hc=Symbol("Let zodToJsonSchema decide on which parser to use"),g$i={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},CHc=a(t=>typeof t=="string"?{...g$i,name:t}:{...g$i,...t},"xL"),vHc=a(t=>{let e=CHc(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(NZi,"aV");a(fl,"H$");MZi=a((t,e)=>{let r=0;for(;rPc(t.innerType._def,e),"uL");a(BZi,"sV");xHc=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":fl(r,"minimum",n.value,n.message,e);break;case"max":fl(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(wHc,"mL");a(RHc,"lL");a(kHc,"cL");PHc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(DHc,"pL");a(NHc,"dL");OBr=void 0,oN={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(OBr===void 0&&(OBr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),OBr),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(LZi,"qW");a(BBr,"$B");MHc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(OHc,"Np");a(sN,"V4");a(BC,"w6");a(A$i,"iL");a(FZi,"VW");a(BHc,"nL");a(LHc,"rL");a(FHc,"oL");a(UHc,"tL");RTt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(QHc,"sL");y$i=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Pc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(qHc,"eL");a(jHc,"$j");a(HHc,"Qj");a(GHc,"wp");a($Hc,"Op");VHc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Pc(t.innerType._def,e);let r=Pc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:E1(e)},r]}:E1(e)},"Jj"),WHc=a((t,e)=>{if(e.pipeStrategy==="input")return Pc(t.in._def,e);if(e.pipeStrategy==="output")return Pc(t.out._def,e);let r=Pc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Pc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(zHc,"Yj");a(YHc,"Wj");a(KHc,"Gj");a(JHc,"Uj");a(ZHc,"Hj");XHc=a((t,e)=>Pc(t.innerType._def,e),"Kj"),eGc=a((t,e,r)=>{switch(e){case vr.ZodString:return LZi(t,r);case vr.ZodNumber:return jHc(t,r);case vr.ZodObject:return HHc(t,r);case vr.ZodBigInt:return SHc(t,r);case vr.ZodBoolean:return THc();case vr.ZodDate:return BZi(t,r);case vr.ZodUndefined:return JHc(r);case vr.ZodNull:return UHc(r);case vr.ZodArray:return bHc(t,r);case vr.ZodUnion:case vr.ZodDiscriminatedUnion:return QHc(t,r);case vr.ZodIntersection:return DHc(t,r);case vr.ZodTuple:return KHc(t,r);case vr.ZodRecord:return FZi(t,r);case vr.ZodLiteral:return NHc(t,r);case vr.ZodEnum:return kHc(t);case vr.ZodNativeEnum:return LHc(t);case vr.ZodNullable:return qHc(t,r);case vr.ZodOptional:return VHc(t,r);case vr.ZodMap:return BHc(t,r);case vr.ZodSet:return YHc(t,r);case vr.ZodLazy:return()=>t.getter()._def;case vr.ZodPromise:return zHc(t,r);case vr.ZodNaN:case vr.ZodNever:return FHc(r);case vr.ZodEffects:return RHc(t,r);case vr.ZodAny:return E1(r);case vr.ZodUnknown:return ZHc(r);case vr.ZodDefault:return wHc(t,r);case vr.ZodBranded:return OZi(t,r);case vr.ZodReadonly:return XHc(t,r);case vr.ZodCatch:return IHc(t,r);case vr.ZodPipeline:return WHc(t,r);case vr.ZodFunction:case vr.ZodVoid:case vr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Pc,"r");tGc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:MZi(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),E1(e)):e.$refStrategy==="seen"?E1(e):void 0}},"Dp"),rGc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),nGc=a((t,e)=>{let r=vHc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Pc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??E1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Pc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??E1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(iGc,"Zp");a(E$i,"JB");a(_$i,"XB");a(C$i,"YB");oGc=6e4,QLr=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(D8r,r=>{this._oncancel(r)}),this.setNotificationHandler(M8r,r=>{this._onprogress(r)}),this.setRequestHandler(N8r,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(O8r,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new li(Bi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(L8r,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new li(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new li(Bi.InvalidParams,`Task not found: ${s}`);if(!Lne(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Lne(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Une]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(F8r,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new li(Bi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Q8r,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new li(Bi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Lne(o.status))throw new li(Bi.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new li(Bi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof li?o:new li(Bi.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),li.fromError(Bi.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),hSt(s)||Vqc(s)?this._onresponse(s):m$i(s)?this._onrequest(s,c):$qc(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=li.fromError(Bi.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[Une]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Bi.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=Gqc(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new li(Bi.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Bi.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),hSt(e))n(e);else{let c=new li(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(hSt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),hSt(e))o(e);else{let c=li.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof li?c:new li(Bi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,SIt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new li(Bi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Lne(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new li(Bi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new li(Bi.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof li?c:new li(Bi.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Une]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let b=v instanceof li?v:new li(Bi.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=T3e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??oGc,E=a(()=>A(li.fromError(Bi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},B8r,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},U8r,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},cjc,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Une]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Une]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Une]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=_$i(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=C$i(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=_$i(e);this._notificationHandlers.set(n,o=>{let s=C$i(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&m$i(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new li(Bi.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new li(Bi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new li(Bi.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new li(Bi.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=STt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Lne(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new li(Bi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Lne(l.status))throw new li(Bi.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=STt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Lne(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(v$i,"Vj");a(sGc,"Bj");aGc=l3r(bVi(),1),cGc=l3r(L5c(),1);a(lGc,"ps");qLr=class{static{a(this,"qz")}constructor(e){this._ajv=e??lGc()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},jLr=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},z8r,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},wTt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(uGc,"tP");a(dGc,"aP");HLr=class extends QLr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(ITt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(SZi,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(kZi,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=ITt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new jLr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=sGc(this._capabilities,e)}setRequestHandler(e,r){let n=dFe(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(fB(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=T3e(TTt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new li(Bi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=T3e(SIt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new li(Bi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=T3e(W8r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new li(Bi.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){dGc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&uGc(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:qqc.includes(r)?r:AZi,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},P8r)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},PZi,r):this.request({method:"sampling/createMessage",params:e},z8r,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},wTt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},wTt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new li(Bi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof li?s:new li(Bi.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},DZi,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},UZi=Symbol.for("mcp.completable");a(b$i,"zz");a(fGc,"$E");(function(t){t.Completable="McpCompletable"})(S$i||(S$i={}));pGc=/^[A-Za-z0-9._-]{1,128}$/;a(hGc,"is");a(mGc,"ns");a(T$i,"Nz");GLr=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},$Lr=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new HLr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new GLr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(LLr)),this.server.assertCanSetRequestHandler(gV(TTt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(LLr,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=l3e(r.inputSchema);return o?E$i(o,{strictUnions:!0,pipeStrategy:"input"}):gGc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=l3e(r.outputSchema);o&&(n.outputSchema=E$i(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(TTt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new li(Bi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new li(Bi.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new li(Bi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new li(Bi.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof li&&n.code===Bi.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=l3e(e.inputSchema)??e.inputSchema,s=await NBr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=MBr(c);throw new li(Bi.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new li(Bi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=l3e(e.outputSchema),s=await NBr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=MBr(c);throw new li(Bi.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new li(Bi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(gV(FLr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(FLr,async e=>{switch(e.params.ref.type){case"ref/prompt":return hHc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return mHc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new li(Bi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new li(Bi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new li(Bi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return u3e;let o=dFe(n.argsSchema)?.[e.params.argument.name];if(!b$i(o))return u3e;let s=fGc(o);if(!s)return u3e;let c=await s(e.params.argument.value,e.params.context);return x$i(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return u3e;throw new li(Bi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return u3e;let s=await o(e.params.argument.value,e.params.context);return x$i(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(DLr)),this.server.assertCanSetRequestHandler(gV(NLr)),this.server.assertCanSetRequestHandler(gV(MLr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(DLr,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(NLr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(MLr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new li(Bi.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new li(Bi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(gV(OLr)),this.server.assertCanSetRequestHandler(gV(BLr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(OLr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?AGc(r.argsSchema):void 0}))})),this.server.setRequestHandler(BLr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new li(Bi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new li(Bi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=l3e(n.argsSchema),s=await NBr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=MBr(u);throw new li(Bi.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:OEe(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=OEe(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof zR?l._def?.innerType:l;return b$i(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){T$i(e);let f={title:r,description:n,inputSchema:I$i(o),outputSchema:I$i(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&T$i(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=OEe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=OEe(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(VLr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!VLr(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},gGc={type:"object",properties:{}};a(QZi,"XE");a(qZi,"YE");a(VLr,"Oz");a(I$i,"QE");a(AGc,"os");a(gV,"l1");a(x$i,"JE");u3e={completion:{values:[],hasMore:!1}};a(yGc,"ts");a(EGc,"as");a(_Gc,"ss");a(xr,"b");w$i=15e3,CGc=xr(()=>H.object({session_id:H.string(),ws_url:H.string(),work_dir:H.string().optional(),session_key:H.string().optional()})),GR=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},WLr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new iTt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new g1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new g1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await bGc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=nFe(s);if(!(c instanceof g1)){let l=c instanceof GR&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&R$i(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new GR(`WebSocket connection timeout after ${w$i}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},w$i,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,jR(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles==="ref"&&c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"G");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}!n.external&&Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw Error("Error converting schema to JSON.")}}};a(SFr,"e8");a(Im,"t$");SUc={},TUc=ft("ZodMiniType",(t,e)=>{if(!t._zod)throw Error("Uninitialized schema in ZodMiniType.");Co.init(t,e),t.def=e,t.parse=(r,n)=>eTt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>zTt(t,r,n),t.parseAsync=async(r,n)=>tTt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>YTt(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>fN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t)}),IUc=ft("ZodMiniObject",(t,e)=>{F3r.init(t,e),TUc.init(t,e),Qs.defineLazy(t,"shape",()=>e.shape)});a(t$i,"tq");a(oB,"a6");a(bEe,"S0");a(d3e,"S1");a(dBr,"I3");a(J3e,"v1");a(YLe,"$9");a(fBr,"R3");a(xUc,"_M");a(wUc,"kM");a(uJi,"P3");G={};sB(G,{xid:a(()=>jUc,"xid"),void:a(()=>l7c,"void"),uuidv7:a(()=>OUc,"uuidv7"),uuidv6:a(()=>MUc,"uuidv6"),uuidv4:a(()=>NUc,"uuidv4"),uuid:a(()=>DUc,"uuid"),url:a(()=>BUc,"url"),uppercase:a(()=>hFr,"uppercase"),unknown:a(()=>zd,"unknown"),union:a(()=>Kl,"union"),undefined:a(()=>a7c,"undefined"),ulid:a(()=>qUc,"ulid"),uint64:a(()=>o7c,"uint64"),uint32:a(()=>r7c,"uint32"),tuple:a(()=>p7c,"tuple"),trim:a(()=>_Fr,"trim"),treeifyError:a(()=>yzi,"treeifyError"),transform:a(()=>t8r,"transform"),toUpperCase:a(()=>CFr,"toUpperCase"),toLowerCase:a(()=>vFr,"toLowerCase"),toJSONSchema:a(()=>SFr,"toJSONSchema"),templateLiteral:a(()=>C7c,"templateLiteral"),symbol:a(()=>s7c,"symbol"),superRefine:a(()=>tZi,"superRefine"),success:a(()=>_7c,"success"),stringbool:a(()=>T7c,"stringbool"),stringFormat:a(()=>ZUc,"stringFormat"),string:a(()=>It,"string"),strictObject:a(()=>f7c,"strictObject"),startsWith:a(()=>gFr,"startsWith"),size:a(()=>dFr,"size"),setErrorMap:a(()=>w7c,"setErrorMap"),set:a(()=>g7c,"set"),safeParseAsync:a(()=>EJi,"safeParseAsync"),safeParse:a(()=>yJi,"safeParse"),registry:a(()=>H3r,"registry"),regexes:a(()=>R3r,"regexes"),regex:a(()=>fFr,"regex"),refine:a(()=>eZi,"refine"),record:a(()=>Yl,"record"),readonly:a(()=>WJi,"readonly"),property:a(()=>rJi,"property"),promise:a(()=>b7c,"promise"),prettifyError:a(()=>_zi,"prettifyError"),preprocess:a(()=>o8r,"preprocess"),prefault:a(()=>QJi,"prefault"),positive:a(()=>ZKi,"positive"),pipe:a(()=>lTt,"pipe"),partialRecord:a(()=>h7c,"partialRecord"),parseAsync:a(()=>AJi,"parseAsync"),parse:a(()=>gJi,"parse"),overwrite:a(()=>Kne,"overwrite"),optional:a(()=>gd,"optional"),object:a(()=>vn,"object"),number:a(()=>Pc,"number"),nullish:a(()=>E7c,"nullish"),nullable:a(()=>cTt,"nullable"),null:a(()=>YFr,"null"),normalize:a(()=>EFr,"normalize"),nonpositive:a(()=>eJi,"nonpositive"),nonoptional:a(()=>qJi,"nonoptional"),nonnegative:a(()=>tJi,"nonnegative"),never:a(()=>iIt,"never"),negative:a(()=>XKi,"negative"),nativeEnum:a(()=>A7c,"nativeEnum"),nanoid:a(()=>FUc,"nanoid"),nan:a(()=>v7c,"nan"),multipleOf:a(()=>B3e,"multipleOf"),minSize:a(()=>L3e,"minSize"),minLength:a(()=>KEe,"minLength"),mime:a(()=>yFr,"mime"),maxSize:a(()=>JTt,"maxSize"),maxLength:a(()=>ZTt,"maxLength"),map:a(()=>m7c,"map"),lte:a(()=>oN,"lte"),lt:a(()=>Gne,"lt"),lowercase:a(()=>pFr,"lowercase"),looseObject:a(()=>Mv,"looseObject"),locales:a(()=>j3r,"locales"),literal:a(()=>Xn,"literal"),length:a(()=>XTt,"length"),lazy:a(()=>KJi,"lazy"),ksuid:a(()=>HUc,"ksuid"),keyof:a(()=>d7c,"keyof"),jwt:a(()=>JUc,"jwt"),json:a(()=>I7c,"json"),iso:a(()=>TFr,"iso"),ipv6:a(()=>$Uc,"ipv6"),ipv4:a(()=>GUc,"ipv4"),intersection:a(()=>sIt,"intersection"),int64:a(()=>i7c,"int64"),int32:a(()=>t7c,"int32"),int:a(()=>lLr,"int"),instanceof:a(()=>S7c,"instanceof"),includes:a(()=>mFr,"includes"),guid:a(()=>kUc,"guid"),gte:a(()=>aI,"gte"),gt:a(()=>$ne,"gt"),globalRegistry:a(()=>n9,"globalRegistry"),getErrorMap:a(()=>R7c,"getErrorMap"),function:a(()=>lJi,"function"),formatError:a(()=>S3r,"formatError"),float64:a(()=>e7c,"float64"),float32:a(()=>XUc,"float32"),flattenError:a(()=>b3r,"flattenError"),file:a(()=>y7c,"file"),enum:a(()=>p1,"enum"),endsWith:a(()=>AFr,"endsWith"),emoji:a(()=>LUc,"emoji"),email:a(()=>PUc,"email"),e164:a(()=>KUc,"e164"),discriminatedUnion:a(()=>ZFr,"discriminatedUnion"),date:a(()=>u7c,"date"),custom:a(()=>XJi,"custom"),cuid2:a(()=>QUc,"cuid2"),cuid:a(()=>UUc,"cuid"),core:a(()=>szi,"core"),config:a(()=>Lv,"config"),coerce:a(()=>rZi,"coerce"),clone:a(()=>fN,"clone"),cidrv6:a(()=>WUc,"cidrv6"),cidrv4:a(()=>VUc,"cidrv4"),check:a(()=>ZJi,"check"),catch:a(()=>GJi,"catch"),boolean:a(()=>xm,"boolean"),bigint:a(()=>n7c,"bigint"),base64url:a(()=>YUc,"base64url"),base64:a(()=>zUc,"base64"),array:a(()=>Aa,"array"),any:a(()=>c7c,"any"),_default:a(()=>FJi,"_default"),_ZodString:a(()=>PFr,"_ZodString"),ZodXID:a(()=>FFr,"ZodXID"),ZodVoid:a(()=>xJi,"ZodVoid"),ZodUnknown:a(()=>TJi,"ZodUnknown"),ZodUnion:a(()=>JFr,"ZodUnion"),ZodUndefined:a(()=>CJi,"ZodUndefined"),ZodUUID:a(()=>i9,"ZodUUID"),ZodURL:a(()=>DFr,"ZodURL"),ZodULID:a(()=>LFr,"ZodULID"),ZodType:a(()=>Rs,"ZodType"),ZodTuple:a(()=>kJi,"ZodTuple"),ZodTransform:a(()=>e8r,"ZodTransform"),ZodTemplateLiteral:a(()=>zJi,"ZodTemplateLiteral"),ZodSymbol:a(()=>vJi,"ZodSymbol"),ZodSuccess:a(()=>jJi,"ZodSuccess"),ZodStringFormat:a(()=>yd,"ZodStringFormat"),ZodString:a(()=>eIt,"ZodString"),ZodSet:a(()=>NJi,"ZodSet"),ZodRecord:a(()=>XFr,"ZodRecord"),ZodRealError:a(()=>Z3e,"ZodRealError"),ZodReadonly:a(()=>VJi,"ZodReadonly"),ZodPromise:a(()=>JJi,"ZodPromise"),ZodPrefault:a(()=>UJi,"ZodPrefault"),ZodPipe:a(()=>i8r,"ZodPipe"),ZodOptional:a(()=>r8r,"ZodOptional"),ZodObject:a(()=>oIt,"ZodObject"),ZodNumberFormat:a(()=>l_e,"ZodNumberFormat"),ZodNumber:a(()=>tIt,"ZodNumber"),ZodNullable:a(()=>BJi,"ZodNullable"),ZodNull:a(()=>bJi,"ZodNull"),ZodNonOptional:a(()=>n8r,"ZodNonOptional"),ZodNever:a(()=>IJi,"ZodNever"),ZodNanoID:a(()=>MFr,"ZodNanoID"),ZodNaN:a(()=>$Ji,"ZodNaN"),ZodMap:a(()=>DJi,"ZodMap"),ZodLiteral:a(()=>MJi,"ZodLiteral"),ZodLazy:a(()=>YJi,"ZodLazy"),ZodKSUID:a(()=>UFr,"ZodKSUID"),ZodJWT:a(()=>WFr,"ZodJWT"),ZodIssueCode:a(()=>x7c,"ZodIssueCode"),ZodIntersection:a(()=>PJi,"ZodIntersection"),ZodISOTime:a(()=>wFr,"ZodISOTime"),ZodISODuration:a(()=>RFr,"ZodISODuration"),ZodISODateTime:a(()=>IFr,"ZodISODateTime"),ZodISODate:a(()=>xFr,"ZodISODate"),ZodIPv6:a(()=>qFr,"ZodIPv6"),ZodIPv4:a(()=>QFr,"ZodIPv4"),ZodGUID:a(()=>aTt,"ZodGUID"),ZodFile:a(()=>OJi,"ZodFile"),ZodError:a(()=>RUc,"ZodError"),ZodEnum:a(()=>U3e,"ZodEnum"),ZodEmoji:a(()=>NFr,"ZodEmoji"),ZodEmail:a(()=>kFr,"ZodEmail"),ZodE164:a(()=>VFr,"ZodE164"),ZodDiscriminatedUnion:a(()=>RJi,"ZodDiscriminatedUnion"),ZodDefault:a(()=>LJi,"ZodDefault"),ZodDate:a(()=>KFr,"ZodDate"),ZodCustomStringFormat:a(()=>_Ji,"ZodCustomStringFormat"),ZodCustom:a(()=>aIt,"ZodCustom"),ZodCatch:a(()=>HJi,"ZodCatch"),ZodCUID2:a(()=>BFr,"ZodCUID2"),ZodCUID:a(()=>OFr,"ZodCUID"),ZodCIDRv6:a(()=>HFr,"ZodCIDRv6"),ZodCIDRv4:a(()=>jFr,"ZodCIDRv4"),ZodBoolean:a(()=>rIt,"ZodBoolean"),ZodBigIntFormat:a(()=>zFr,"ZodBigIntFormat"),ZodBigInt:a(()=>nIt,"ZodBigInt"),ZodBase64URL:a(()=>$Fr,"ZodBase64URL"),ZodBase64:a(()=>GFr,"ZodBase64"),ZodArray:a(()=>wJi,"ZodArray"),ZodAny:a(()=>SJi,"ZodAny"),TimePrecision:a(()=>TKi,"TimePrecision"),NEVER:a(()=>azi,"NEVER"),$output:a(()=>vKi,"$output"),$input:a(()=>CKi,"$input"),$brand:a(()=>czi,"$brand")});TFr={};sB(TFr,{time:a(()=>pJi,"time"),duration:a(()=>hJi,"duration"),datetime:a(()=>dJi,"datetime"),date:a(()=>fJi,"date"),ZodISOTime:a(()=>wFr,"ZodISOTime"),ZodISODuration:a(()=>RFr,"ZodISODuration"),ZodISODateTime:a(()=>IFr,"ZodISODateTime"),ZodISODate:a(()=>xFr,"ZodISODate")});IFr=ft("ZodISODateTime",(t,e)=>{RYi.init(t,e),yd.init(t,e)});a(dJi,"aq");xFr=ft("ZodISODate",(t,e)=>{PYi.init(t,e),yd.init(t,e)});a(fJi,"sq");wFr=ft("ZodISOTime",(t,e)=>{kYi.init(t,e),yd.init(t,e)});a(pJi,"eq");RFr=ft("ZodISODuration",(t,e)=>{DYi.init(t,e),yd.init(t,e)});a(hJi,"$V");mJi=a((t,e)=>{C3r.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>S3r(t,r),"value")},flatten:{value:a(r=>b3r(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"vM"),RUc=ft("ZodError",mJi),Z3e=ft("ZodError",mJi,{Parent:Error}),gJi=T3r(Z3e),AJi=I3r(Z3e),yJi=x3r(Z3e),EJi=w3r(Z3e),Rs=ft("ZodType",(t,e)=>(Co.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>fN(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>gJi(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>yJi(t,r,n),t.parseAsync=async(r,n)=>AJi(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>EJi(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(eZi(r,n)),t.superRefine=r=>t.check(tZi(r)),t.overwrite=r=>t.check(Kne(r)),t.optional=()=>gd(t),t.nullable=()=>cTt(t),t.nullish=()=>gd(cTt(t)),t.nonoptional=r=>qJi(t,r),t.array=()=>Aa(t),t.or=r=>Kl([t,r]),t.and=r=>sIt(t,r),t.transform=r=>lTt(t,t8r(r)),t.default=r=>FJi(t,r),t.prefault=r=>QJi(t,r),t.catch=r=>GJi(t,r),t.pipe=r=>lTt(t,r),t.readonly=()=>WJi(t),t.describe=r=>{let n=t.clone();return n9.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return n9.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return n9.get(t);let n=t.clone();return n9.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),PFr=ft("_ZodString",(t,e)=>{K3e.init(t,e),Rs.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(fFr(...n)),t.includes=(...n)=>t.check(mFr(...n)),t.startsWith=(...n)=>t.check(gFr(...n)),t.endsWith=(...n)=>t.check(AFr(...n)),t.min=(...n)=>t.check(KEe(...n)),t.max=(...n)=>t.check(ZTt(...n)),t.length=(...n)=>t.check(XTt(...n)),t.nonempty=(...n)=>t.check(KEe(1,...n)),t.lowercase=n=>t.check(pFr(n)),t.uppercase=n=>t.check(hFr(n)),t.trim=()=>t.check(_Fr()),t.normalize=(...n)=>t.check(EFr(...n)),t.toLowerCase=()=>t.check(vFr()),t.toUpperCase=()=>t.check(CFr())}),eIt=ft("ZodString",(t,e)=>{K3e.init(t,e),PFr.init(t,e),t.email=r=>t.check(G3r(kFr,r)),t.url=r=>t.check(Y3r(DFr,r)),t.jwt=r=>t.check(uFr(WFr,r)),t.emoji=r=>t.check(K3r(NFr,r)),t.guid=r=>t.check(iTt(aTt,r)),t.uuid=r=>t.check($3r(i9,r)),t.uuidv4=r=>t.check(V3r(i9,r)),t.uuidv6=r=>t.check(W3r(i9,r)),t.uuidv7=r=>t.check(z3r(i9,r)),t.nanoid=r=>t.check(J3r(MFr,r)),t.guid=r=>t.check(iTt(aTt,r)),t.cuid=r=>t.check(Z3r(OFr,r)),t.cuid2=r=>t.check(X3r(BFr,r)),t.ulid=r=>t.check(eFr(LFr,r)),t.base64=r=>t.check(aFr(GFr,r)),t.base64url=r=>t.check(cFr($Fr,r)),t.xid=r=>t.check(tFr(FFr,r)),t.ksuid=r=>t.check(rFr(UFr,r)),t.ipv4=r=>t.check(nFr(QFr,r)),t.ipv6=r=>t.check(iFr(qFr,r)),t.cidrv4=r=>t.check(oFr(jFr,r)),t.cidrv6=r=>t.check(sFr(HFr,r)),t.e164=r=>t.check(lFr(VFr,r)),t.datetime=r=>t.check(dJi(r)),t.date=r=>t.check(fJi(r)),t.time=r=>t.check(pJi(r)),t.duration=r=>t.check(hJi(r))});a(It,"L");yd=ft("ZodStringFormat",(t,e)=>{Ru.init(t,e),PFr.init(t,e)}),kFr=ft("ZodEmail",(t,e)=>{_Yi.init(t,e),yd.init(t,e)});a(PUc,"Cm");aTt=ft("ZodGUID",(t,e)=>{yYi.init(t,e),yd.init(t,e)});a(kUc,"Tm");i9=ft("ZodUUID",(t,e)=>{EYi.init(t,e),yd.init(t,e)});a(DUc,"xm");a(NUc,"ym");a(MUc,"fm");a(OUc,"gm");DFr=ft("ZodURL",(t,e)=>{vYi.init(t,e),yd.init(t,e)});a(BUc,"hm");NFr=ft("ZodEmoji",(t,e)=>{CYi.init(t,e),yd.init(t,e)});a(LUc,"um");MFr=ft("ZodNanoID",(t,e)=>{bYi.init(t,e),yd.init(t,e)});a(FUc,"mm");OFr=ft("ZodCUID",(t,e)=>{SYi.init(t,e),yd.init(t,e)});a(UUc,"lm");BFr=ft("ZodCUID2",(t,e)=>{TYi.init(t,e),yd.init(t,e)});a(QUc,"cm");LFr=ft("ZodULID",(t,e)=>{IYi.init(t,e),yd.init(t,e)});a(qUc,"pm");FFr=ft("ZodXID",(t,e)=>{xYi.init(t,e),yd.init(t,e)});a(jUc,"dm");UFr=ft("ZodKSUID",(t,e)=>{wYi.init(t,e),yd.init(t,e)});a(HUc,"im");QFr=ft("ZodIPv4",(t,e)=>{NYi.init(t,e),yd.init(t,e)});a(GUc,"nm");qFr=ft("ZodIPv6",(t,e)=>{MYi.init(t,e),yd.init(t,e)});a($Uc,"rm");jFr=ft("ZodCIDRv4",(t,e)=>{OYi.init(t,e),yd.init(t,e)});a(VUc,"om");HFr=ft("ZodCIDRv6",(t,e)=>{BYi.init(t,e),yd.init(t,e)});a(WUc,"tm");GFr=ft("ZodBase64",(t,e)=>{LYi.init(t,e),yd.init(t,e)});a(zUc,"am");$Fr=ft("ZodBase64URL",(t,e)=>{UYi.init(t,e),yd.init(t,e)});a(YUc,"sm");VFr=ft("ZodE164",(t,e)=>{QYi.init(t,e),yd.init(t,e)});a(KUc,"em");WFr=ft("ZodJWT",(t,e)=>{jYi.init(t,e),yd.init(t,e)});a(JUc,"$l");_Ji=ft("ZodCustomStringFormat",(t,e)=>{HYi.init(t,e),yd.init(t,e)});a(ZUc,"Ql");tIt=ft("ZodNumber",(t,e)=>{M3r.init(t,e),Rs.init(t,e),t.gt=(n,o)=>t.check($ne(n,o)),t.gte=(n,o)=>t.check(aI(n,o)),t.min=(n,o)=>t.check(aI(n,o)),t.lt=(n,o)=>t.check(Gne(n,o)),t.lte=(n,o)=>t.check(oN(n,o)),t.max=(n,o)=>t.check(oN(n,o)),t.int=n=>t.check(lLr(n)),t.safe=n=>t.check(lLr(n)),t.positive=n=>t.check($ne(0,n)),t.nonnegative=n=>t.check(aI(0,n)),t.negative=n=>t.check(Gne(0,n)),t.nonpositive=n=>t.check(oN(0,n)),t.multipleOf=(n,o)=>t.check(B3e(n,o)),t.step=(n,o)=>t.check(B3e(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});a(Pc,"z$");l_e=ft("ZodNumberFormat",(t,e)=>{GYi.init(t,e),tIt.init(t,e)});a(lLr,"WV");a(XUc,"Jl");a(e7c,"Xl");a(t7c,"Yl");a(r7c,"Wl");rIt=ft("ZodBoolean",(t,e)=>{O3r.init(t,e),Rs.init(t,e)});a(xm,"i$");nIt=ft("ZodBigInt",(t,e)=>{B3r.init(t,e),Rs.init(t,e),t.gte=(n,o)=>t.check(aI(n,o)),t.min=(n,o)=>t.check(aI(n,o)),t.gt=(n,o)=>t.check($ne(n,o)),t.gte=(n,o)=>t.check(aI(n,o)),t.min=(n,o)=>t.check(aI(n,o)),t.lt=(n,o)=>t.check(Gne(n,o)),t.lte=(n,o)=>t.check(oN(n,o)),t.max=(n,o)=>t.check(oN(n,o)),t.positive=n=>t.check($ne(BigInt(0),n)),t.negative=n=>t.check(Gne(BigInt(0),n)),t.nonpositive=n=>t.check(oN(BigInt(0),n)),t.nonnegative=n=>t.check(aI(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(B3e(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});a(n7c,"Gl");zFr=ft("ZodBigIntFormat",(t,e)=>{$Yi.init(t,e),nIt.init(t,e)});a(i7c,"Ul");a(o7c,"Hl");vJi=ft("ZodSymbol",(t,e)=>{VYi.init(t,e),Rs.init(t,e)});a(s7c,"Kl");CJi=ft("ZodUndefined",(t,e)=>{WYi.init(t,e),Rs.init(t,e)});a(a7c,"ql");bJi=ft("ZodNull",(t,e)=>{zYi.init(t,e),Rs.init(t,e)});a(YFr,"T3");SJi=ft("ZodAny",(t,e)=>{YYi.init(t,e),Rs.init(t,e)});a(c7c,"Vl");TJi=ft("ZodUnknown",(t,e)=>{nTt.init(t,e),Rs.init(t,e)});a(zd,"S$");IJi=ft("ZodNever",(t,e)=>{KYi.init(t,e),Rs.init(t,e)});a(iIt,"x3");xJi=ft("ZodVoid",(t,e)=>{JYi.init(t,e),Rs.init(t,e)});a(l7c,"Bl");KFr=ft("ZodDate",(t,e)=>{ZYi.init(t,e),Rs.init(t,e),t.min=(n,o)=>t.check(aI(n,o)),t.max=(n,o)=>t.check(oN(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});a(u7c,"zl");wJi=ft("ZodArray",(t,e)=>{L3r.init(t,e),Rs.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(KEe(r,n)),t.nonempty=r=>t.check(KEe(1,r)),t.max=(r,n)=>t.check(ZTt(r,n)),t.length=(r,n)=>t.check(XTt(r,n)),t.unwrap=()=>t.element});a(Aa,"W$");a(d7c,"Nl");oIt=ft("ZodObject",(t,e)=>{F3r.init(t,e),Rs.init(t,e),Qs.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>p1(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:zd()}),t.loose=()=>t.clone({...t._zod.def,catchall:zd()}),t.strict=()=>t.clone({...t._zod.def,catchall:iIt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Qs.extend(t,r),t.merge=r=>Qs.merge(t,r),t.pick=r=>Qs.pick(t,r),t.omit=r=>Qs.omit(t,r),t.partial=(...r)=>Qs.partial(r8r,t,r[0]),t.required=(...r)=>Qs.required(n8r,t,r[0])});a(vn,"h");a(f7c,"wl");a(Mv,"K6");JFr=ft("ZodUnion",(t,e)=>{U3r.init(t,e),Rs.init(t,e),t.options=e.options});a(Kl,"A$");RJi=ft("ZodDiscriminatedUnion",(t,e)=>{JFr.init(t,e),XYi.init(t,e)});a(ZFr,"g3");PJi=ft("ZodIntersection",(t,e)=>{eKi.init(t,e),Rs.init(t,e)});a(sIt,"VJ");kJi=ft("ZodTuple",(t,e)=>{KTt.init(t,e),Rs.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});a(p7c,"Ol");XFr=ft("ZodRecord",(t,e)=>{tKi.init(t,e),Rs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(Yl,"I$");a(h7c,"Dl");DJi=ft("ZodMap",(t,e)=>{rKi.init(t,e),Rs.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});a(m7c,"Fl");NJi=ft("ZodSet",(t,e)=>{nKi.init(t,e),Rs.init(t,e),t.min=(...r)=>t.check(L3e(...r)),t.nonempty=r=>t.check(L3e(1,r)),t.max=(...r)=>t.check(JTt(...r)),t.size=(...r)=>t.check(dFr(...r))});a(g7c,"Zl");U3e=ft("ZodEnum",(t,e)=>{iKi.init(t,e),Rs.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw Error(`Key ${c} not found in enum`);return new U3e({...e,checks:[],...Qs.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw Error(`Key ${c} not found in enum`);return new U3e({...e,checks:[],...Qs.normalizeParams(o),entries:s})}});a(p1,"N6");a(A7c,"Ml");MJi=ft("ZodLiteral",(t,e)=>{oKi.init(t,e),Rs.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});a(Xn,"l");OJi=ft("ZodFile",(t,e)=>{sKi.init(t,e),Rs.init(t,e),t.min=(r,n)=>t.check(L3e(r,n)),t.max=(r,n)=>t.check(JTt(r,n)),t.mime=(r,n)=>t.check(yFr(Array.isArray(r)?r:[r],n))});a(y7c,"Ll");e8r=ft("ZodTransform",(t,e)=>{Q3r.init(t,e),Rs.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(Qs.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(Qs.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});a(t8r,"bV");r8r=ft("ZodOptional",(t,e)=>{aKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(gd,"_$");BJi=ft("ZodNullable",(t,e)=>{cKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(cTt,"v3");a(E7c,"jl");LJi=ft("ZodDefault",(t,e)=>{lKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});a(FJi,"aM");UJi=ft("ZodPrefault",(t,e)=>{uKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(QJi,"eM");n8r=ft("ZodNonOptional",(t,e)=>{dKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(qJi,"$L");jJi=ft("ZodSuccess",(t,e)=>{fKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(_7c,"Al");HJi=ft("ZodCatch",(t,e)=>{pKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});a(GJi,"XL");$Ji=ft("ZodNaN",(t,e)=>{hKi.init(t,e),Rs.init(t,e)});a(v7c,"Il");i8r=ft("ZodPipe",(t,e)=>{q3r.init(t,e),Rs.init(t,e),t.in=e.in,t.out=e.out});a(lTt,"C3");VJi=ft("ZodReadonly",(t,e)=>{mKi.init(t,e),Rs.init(t,e)});a(WJi,"GL");zJi=ft("ZodTemplateLiteral",(t,e)=>{gKi.init(t,e),Rs.init(t,e)});a(C7c,"Rl");YJi=ft("ZodLazy",(t,e)=>{yKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.getter()});a(KJi,"KL");JJi=ft("ZodPromise",(t,e)=>{AKi.init(t,e),Rs.init(t,e),t.unwrap=()=>t._zod.def.innerType});a(b7c,"Pl");aIt=ft("ZodCustom",(t,e)=>{EKi.init(t,e),Rs.init(t,e)});a(ZJi,"VL");a(XJi,"vV");a(eZi,"BL");a(tZi,"zL");a(S7c,"El");T7c=a((...t)=>aJi({Pipe:i8r,Boolean:rIt,String:eIt,Transform:e8r},...t),"bl");a(I7c,"_l");a(o8r,"u3");x7c={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};a(w7c,"Sl");a(R7c,"vl");rZi={};sB(rZi,{string:a(()=>P7c,"string"),number:a(()=>k7c,"number"),date:a(()=>M7c,"date"),boolean:a(()=>D7c,"boolean"),bigint:a(()=>N7c,"bigint")});a(P7c,"Cl");a(k7c,"Tl");a(D7c,"xl");a(N7c,"yl");a(M7c,"fl");Lv(_Ki());O7c=G,nZi=O7c,iZi="2025-11-25",B7c=[iZi,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Dne="io.modelcontextprotocol/related-task",cIt="2.0",wm=XJi(t=>t!==null&&(typeof t=="object"||typeof t=="function")),oZi=Kl([It(),Pc().int()]),sZi=It(),_4h=Mv({ttl:Pc().optional(),pollInterval:Pc().optional()}),L7c=vn({ttl:Pc().optional()}),F7c=vn({taskId:It()}),s8r=Mv({progressToken:oZi.optional(),[Dne]:F7c.optional()}),fI=vn({_meta:s8r.optional()}),X3e=fI.extend({task:L7c.optional()}),U7c=a(t=>X3e.safeParse(t).success,"FL"),my=vn({method:It(),params:fI.loose().optional()}),WR=vn({_meta:s8r.optional()}),zR=vn({method:It(),params:WR.loose().optional()}),gy=Mv({_meta:s8r.optional()}),lIt=Kl([It(),Pc().int()]),aZi=vn({jsonrpc:Xn(cIt),id:lIt,...my.shape}).strict(),r$i=a(t=>aZi.safeParse(t).success,"fV"),cZi=vn({jsonrpc:Xn(cIt),...zR.shape}).strict(),Q7c=a(t=>cZi.safeParse(t).success,"LL"),a8r=vn({jsonrpc:Xn(cIt),id:lIt,result:gy}).strict(),eSt=a(t=>a8r.safeParse(t).success,"zJ");(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Oi||(Oi={}));c8r=vn({jsonrpc:Xn(cIt),id:lIt.optional(),error:vn({code:Pc().int(),message:It(),data:zd().optional()})}).strict(),q7c=a(t=>c8r.safeParse(t).success,"jL"),v4h=Kl([aZi,cZi,a8r,c8r]),C4h=Kl([a8r,c8r]),l8r=gy.strict(),j7c=WR.extend({requestId:lIt.optional(),reason:It().optional()}),u8r=zR.extend({method:Xn("notifications/cancelled"),params:j7c}),H7c=vn({src:It(),mimeType:It().optional(),sizes:Aa(It()).optional(),theme:p1(["light","dark"]).optional()}),eFe=vn({icons:Aa(H7c).optional()}),JEe=vn({name:It(),title:It().optional()}),lZi=JEe.extend({...JEe.shape,...eFe.shape,version:It(),websiteUrl:It().optional(),description:It().optional()}),G7c=sIt(vn({applyDefaults:xm().optional()}),Yl(It(),zd())),$7c=o8r(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,sIt(vn({form:G7c.optional(),url:wm.optional()}),Yl(It(),zd()).optional())),V7c=Mv({list:wm.optional(),cancel:wm.optional(),requests:Mv({sampling:Mv({createMessage:wm.optional()}).optional(),elicitation:Mv({create:wm.optional()}).optional()}).optional()}),W7c=Mv({list:wm.optional(),cancel:wm.optional(),requests:Mv({tools:Mv({call:wm.optional()}).optional()}).optional()}),z7c=vn({experimental:Yl(It(),wm).optional(),sampling:vn({context:wm.optional(),tools:wm.optional()}).optional(),elicitation:$7c.optional(),roots:vn({listChanged:xm().optional()}).optional(),tasks:V7c.optional(),extensions:Yl(It(),wm).optional()}),Y7c=fI.extend({protocolVersion:It(),capabilities:z7c,clientInfo:lZi}),uZi=my.extend({method:Xn("initialize"),params:Y7c}),K7c=vn({experimental:Yl(It(),wm).optional(),logging:wm.optional(),completions:wm.optional(),prompts:vn({listChanged:xm().optional()}).optional(),resources:vn({subscribe:xm().optional(),listChanged:xm().optional()}).optional(),tools:vn({listChanged:xm().optional()}).optional(),tasks:W7c.optional(),extensions:Yl(It(),wm).optional()}),J7c=gy.extend({protocolVersion:It(),capabilities:K7c,serverInfo:lZi,instructions:It().optional()}),dZi=zR.extend({method:Xn("notifications/initialized"),params:WR.optional()}),d8r=my.extend({method:Xn("ping"),params:fI.optional()}),Z7c=vn({progress:Pc(),total:gd(Pc()),message:gd(It())}),X7c=vn({...WR.shape,...Z7c.shape,progressToken:oZi}),f8r=zR.extend({method:Xn("notifications/progress"),params:X7c}),eQc=fI.extend({cursor:sZi.optional()}),tFe=my.extend({params:eQc.optional()}),rFe=gy.extend({nextCursor:sZi.optional()}),tQc=p1(["working","input_required","completed","failed","cancelled"]),nFe=vn({taskId:It(),status:tQc,ttl:Kl([Pc(),YFr()]),createdAt:It(),lastUpdatedAt:It(),pollInterval:gd(Pc()),statusMessage:gd(It())}),uIt=gy.extend({task:nFe}),rQc=WR.merge(nFe),uTt=zR.extend({method:Xn("notifications/tasks/status"),params:rQc}),p8r=my.extend({method:Xn("tasks/get"),params:fI.extend({taskId:It()})}),h8r=gy.merge(nFe),m8r=my.extend({method:Xn("tasks/result"),params:fI.extend({taskId:It()})}),b4h=gy.loose(),g8r=tFe.extend({method:Xn("tasks/list")}),A8r=rFe.extend({tasks:Aa(nFe)}),y8r=my.extend({method:Xn("tasks/cancel"),params:fI.extend({taskId:It()})}),nQc=gy.merge(nFe),fZi=vn({uri:It(),mimeType:gd(It()),_meta:Yl(It(),zd()).optional()}),pZi=fZi.extend({text:It()}),E8r=It().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),hZi=fZi.extend({blob:E8r}),iFe=p1(["user","assistant"]),u_e=vn({audience:Aa(iFe).optional(),priority:Pc().min(0).max(1).optional(),lastModified:TFr.datetime({offset:!0}).optional()}),mZi=vn({...JEe.shape,...eFe.shape,uri:It(),description:gd(It()),mimeType:gd(It()),size:gd(Pc()),annotations:u_e.optional(),_meta:gd(Mv({}))}),iQc=vn({...JEe.shape,...eFe.shape,uriTemplate:It(),description:gd(It()),mimeType:gd(It()),annotations:u_e.optional(),_meta:gd(Mv({}))}),uLr=tFe.extend({method:Xn("resources/list")}),oQc=rFe.extend({resources:Aa(mZi)}),dLr=tFe.extend({method:Xn("resources/templates/list")}),sQc=rFe.extend({resourceTemplates:Aa(iQc)}),_8r=fI.extend({uri:It()}),aQc=_8r,fLr=my.extend({method:Xn("resources/read"),params:aQc}),cQc=gy.extend({contents:Aa(Kl([pZi,hZi]))}),lQc=zR.extend({method:Xn("notifications/resources/list_changed"),params:WR.optional()}),uQc=_8r,dQc=my.extend({method:Xn("resources/subscribe"),params:uQc}),fQc=_8r,pQc=my.extend({method:Xn("resources/unsubscribe"),params:fQc}),hQc=WR.extend({uri:It()}),mQc=zR.extend({method:Xn("notifications/resources/updated"),params:hQc}),gQc=vn({name:It(),description:gd(It()),required:gd(xm())}),AQc=vn({...JEe.shape,...eFe.shape,description:gd(It()),arguments:gd(Aa(gQc)),_meta:gd(Mv({}))}),pLr=tFe.extend({method:Xn("prompts/list")}),yQc=rFe.extend({prompts:Aa(AQc)}),EQc=fI.extend({name:It(),arguments:Yl(It(),It()).optional()}),hLr=my.extend({method:Xn("prompts/get"),params:EQc}),v8r=vn({type:Xn("text"),text:It(),annotations:u_e.optional(),_meta:Yl(It(),zd()).optional()}),C8r=vn({type:Xn("image"),data:E8r,mimeType:It(),annotations:u_e.optional(),_meta:Yl(It(),zd()).optional()}),b8r=vn({type:Xn("audio"),data:E8r,mimeType:It(),annotations:u_e.optional(),_meta:Yl(It(),zd()).optional()}),_Qc=vn({type:Xn("tool_use"),name:It(),id:It(),input:Yl(It(),zd()),_meta:Yl(It(),zd()).optional()}),vQc=vn({type:Xn("resource"),resource:Kl([pZi,hZi]),annotations:u_e.optional(),_meta:Yl(It(),zd()).optional()}),CQc=mZi.extend({type:Xn("resource_link")}),S8r=Kl([v8r,C8r,b8r,CQc,vQc]),bQc=vn({role:iFe,content:S8r}),SQc=gy.extend({description:It().optional(),messages:Aa(bQc)}),TQc=zR.extend({method:Xn("notifications/prompts/list_changed"),params:WR.optional()}),IQc=vn({title:It().optional(),readOnlyHint:xm().optional(),destructiveHint:xm().optional(),idempotentHint:xm().optional(),openWorldHint:xm().optional()}),xQc=vn({taskSupport:p1(["required","optional","forbidden"]).optional()}),gZi=vn({...JEe.shape,...eFe.shape,description:It().optional(),inputSchema:vn({type:Xn("object"),properties:Yl(It(),wm).optional(),required:Aa(It()).optional()}).catchall(zd()),outputSchema:vn({type:Xn("object"),properties:Yl(It(),wm).optional(),required:Aa(It()).optional()}).catchall(zd()).optional(),annotations:IQc.optional(),execution:xQc.optional(),_meta:Yl(It(),zd()).optional()}),mLr=tFe.extend({method:Xn("tools/list")}),wQc=rFe.extend({tools:Aa(gZi)}),T8r=gy.extend({content:Aa(S8r).default([]),structuredContent:Yl(It(),zd()).optional(),isError:xm().optional()}),S4h=T8r.or(gy.extend({toolResult:zd()})),RQc=X3e.extend({name:It(),arguments:Yl(It(),zd()).optional()}),dTt=my.extend({method:Xn("tools/call"),params:RQc}),PQc=zR.extend({method:Xn("notifications/tools/list_changed"),params:WR.optional()}),T4h=vn({autoRefresh:xm().default(!0),debounceMs:Pc().int().nonnegative().default(300)}),fTt=p1(["debug","info","notice","warning","error","critical","alert","emergency"]),kQc=fI.extend({level:fTt}),AZi=my.extend({method:Xn("logging/setLevel"),params:kQc}),DQc=WR.extend({level:fTt,logger:It().optional(),data:zd()}),NQc=zR.extend({method:Xn("notifications/message"),params:DQc}),MQc=vn({name:It().optional()}),OQc=vn({hints:Aa(MQc).optional(),costPriority:Pc().min(0).max(1).optional(),speedPriority:Pc().min(0).max(1).optional(),intelligencePriority:Pc().min(0).max(1).optional()}),BQc=vn({mode:p1(["auto","required","none"]).optional()}),LQc=vn({type:Xn("tool_result"),toolUseId:It().describe("The unique identifier for the corresponding tool call."),content:Aa(S8r).default([]),structuredContent:vn({}).loose().optional(),isError:xm().optional(),_meta:Yl(It(),zd()).optional()}),FQc=ZFr("type",[v8r,C8r,b8r]),pTt=ZFr("type",[v8r,C8r,b8r,_Qc,LQc]),UQc=vn({role:iFe,content:Kl([pTt,Aa(pTt)]),_meta:Yl(It(),zd()).optional()}),QQc=X3e.extend({messages:Aa(UQc),modelPreferences:OQc.optional(),systemPrompt:It().optional(),includeContext:p1(["none","thisServer","allServers"]).optional(),temperature:Pc().optional(),maxTokens:Pc().int(),stopSequences:Aa(It()).optional(),metadata:wm.optional(),tools:Aa(gZi).optional(),toolChoice:BQc.optional()}),qQc=my.extend({method:Xn("sampling/createMessage"),params:QQc}),I8r=gy.extend({model:It(),stopReason:gd(p1(["endTurn","stopSequence","maxTokens"]).or(It())),role:iFe,content:FQc}),yZi=gy.extend({model:It(),stopReason:gd(p1(["endTurn","stopSequence","maxTokens","toolUse"]).or(It())),role:iFe,content:Kl([pTt,Aa(pTt)])}),jQc=vn({type:Xn("boolean"),title:It().optional(),description:It().optional(),default:xm().optional()}),HQc=vn({type:Xn("string"),title:It().optional(),description:It().optional(),minLength:Pc().optional(),maxLength:Pc().optional(),format:p1(["email","uri","date","date-time"]).optional(),default:It().optional()}),GQc=vn({type:p1(["number","integer"]),title:It().optional(),description:It().optional(),minimum:Pc().optional(),maximum:Pc().optional(),default:Pc().optional()}),$Qc=vn({type:Xn("string"),title:It().optional(),description:It().optional(),enum:Aa(It()),default:It().optional()}),VQc=vn({type:Xn("string"),title:It().optional(),description:It().optional(),oneOf:Aa(vn({const:It(),title:It()})),default:It().optional()}),WQc=vn({type:Xn("string"),title:It().optional(),description:It().optional(),enum:Aa(It()),enumNames:Aa(It()).optional(),default:It().optional()}),zQc=Kl([$Qc,VQc]),YQc=vn({type:Xn("array"),title:It().optional(),description:It().optional(),minItems:Pc().optional(),maxItems:Pc().optional(),items:vn({type:Xn("string"),enum:Aa(It())}),default:Aa(It()).optional()}),KQc=vn({type:Xn("array"),title:It().optional(),description:It().optional(),minItems:Pc().optional(),maxItems:Pc().optional(),items:vn({anyOf:Aa(vn({const:It(),title:It()}))}),default:Aa(It()).optional()}),JQc=Kl([YQc,KQc]),ZQc=Kl([WQc,zQc,JQc]),XQc=Kl([ZQc,jQc,HQc,GQc]),eqc=X3e.extend({mode:Xn("form").optional(),message:It(),requestedSchema:vn({type:Xn("object"),properties:Yl(It(),XQc),required:Aa(It()).optional()})}),tqc=X3e.extend({mode:Xn("url"),message:It(),elicitationId:It(),url:It().url()}),rqc=Kl([eqc,tqc]),nqc=my.extend({method:Xn("elicitation/create"),params:rqc}),iqc=WR.extend({elicitationId:It()}),oqc=zR.extend({method:Xn("notifications/elicitation/complete"),params:iqc}),hTt=gy.extend({action:p1(["accept","decline","cancel"]),content:o8r(t=>t===null?void 0:t,Yl(It(),Kl([It(),Pc(),xm(),Aa(It())])).optional())}),sqc=vn({type:Xn("ref/resource"),uri:It()}),aqc=vn({type:Xn("ref/prompt"),name:It()}),cqc=fI.extend({ref:Kl([aqc,sqc]),argument:vn({name:It(),value:It()}),context:vn({arguments:Yl(It(),It()).optional()}).optional()}),gLr=my.extend({method:Xn("completion/complete"),params:cqc});a(lqc,"kL");a(uqc,"SL");dqc=gy.extend({completion:Mv({values:Aa(It()).max(100),total:gd(Pc().int()),hasMore:gd(xm())})}),fqc=vn({uri:It().startsWith("file://"),name:It().optional(),_meta:Yl(It(),zd()).optional()}),pqc=my.extend({method:Xn("roots/list"),params:fI.optional()}),EZi=gy.extend({roots:Aa(fqc)}),hqc=zR.extend({method:Xn("notifications/roots/list_changed"),params:WR.optional()}),I4h=Kl([d8r,uZi,gLr,AZi,hLr,pLr,uLr,dLr,fLr,dQc,pQc,dTt,mLr,p8r,m8r,g8r,y8r]),x4h=Kl([u8r,f8r,dZi,hqc,uTt]),w4h=Kl([l8r,I8r,yZi,hTt,EZi,h8r,A8r,uIt]),R4h=Kl([d8r,qQc,nqc,pqc,p8r,m8r,g8r,y8r]),P4h=Kl([u8r,f8r,NQc,mQc,lQc,PQc,TQc,uTt,oqc]),k4h=Kl([l8r,J7c,dqc,SQc,yQc,oQc,sQc,cQc,T8r,wQc,h8r,A8r,uIt]),ui=class t extends Error{static{a(this,"c")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Oi.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new ALr(o.elicitations,r)}return new t(e,r,n)}},ALr=class extends ui{static{a(this,"vL")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Oi.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};a(Pne,"T1");mqc=Symbol("Let zodToJsonSchema decide on which parser to use"),n$i={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},gqc=a(t=>typeof t=="string"?{...n$i,name:t}:{...n$i,...t},"xL"),Aqc=a(t=>{let e=gqc(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}},"yL");a(_Zi,"aV");a(ul,"H$");vZi=a((t,e)=>{let r=0;for(;rRc(t.innerType._def,e),"uL");a(bZi,"sV");Cqc=a((t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":ul(r,"minimum",n.value,n.message,e);break;case"max":ul(r,"maximum",n.value,n.message,e);break}return r},"Vp");a(bqc,"mL");a(Sqc,"lL");a(Tqc,"cL");Iqc=a(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"Bp");a(xqc,"pL");a(wqc,"dL");pBr=void 0,rN={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(pBr===void 0&&(pBr=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),pBr),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};a(SZi,"qW");a(hBr,"$B");Rqc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");a(Pqc,"Np");a(nN,"V4");a(Nv,"w6");a(i$i,"iL");a(TZi,"VW");a(kqc,"nL");a(Dqc,"rL");a(Nqc,"oL");a(Mqc,"tL");mTt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};a(Oqc,"sL");o$i=a((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Rc(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0},"aL");a(Bqc,"eL");a(Lqc,"$j");a(Fqc,"Qj");a(Uqc,"wp");a(Qqc,"Op");qqc=a((t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Rc(t.innerType._def,e);let r=Rc(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:f1(e)},r]}:f1(e)},"Jj"),jqc=a((t,e)=>{if(e.pipeStrategy==="input")return Rc(t.in._def,e);if(e.pipeStrategy==="output")return Rc(t.out._def,e);let r=Rc(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Rc(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}},"Xj");a(Hqc,"Yj");a(Gqc,"Wj");a($qc,"Gj");a(Vqc,"Uj");a(Wqc,"Hj");zqc=a((t,e)=>Rc(t.innerType._def,e),"Kj"),Yqc=a((t,e,r)=>{switch(e){case Cr.ZodString:return SZi(t,r);case Cr.ZodNumber:return Lqc(t,r);case Cr.ZodObject:return Fqc(t,r);case Cr.ZodBigInt:return Eqc(t,r);case Cr.ZodBoolean:return _qc();case Cr.ZodDate:return bZi(t,r);case Cr.ZodUndefined:return Vqc(r);case Cr.ZodNull:return Mqc(r);case Cr.ZodArray:return yqc(t,r);case Cr.ZodUnion:case Cr.ZodDiscriminatedUnion:return Oqc(t,r);case Cr.ZodIntersection:return xqc(t,r);case Cr.ZodTuple:return $qc(t,r);case Cr.ZodRecord:return TZi(t,r);case Cr.ZodLiteral:return wqc(t,r);case Cr.ZodEnum:return Tqc(t);case Cr.ZodNativeEnum:return Dqc(t);case Cr.ZodNullable:return Bqc(t,r);case Cr.ZodOptional:return qqc(t,r);case Cr.ZodMap:return kqc(t,r);case Cr.ZodSet:return Gqc(t,r);case Cr.ZodLazy:return()=>t.getter()._def;case Cr.ZodPromise:return Hqc(t,r);case Cr.ZodNaN:case Cr.ZodNever:return Nqc(r);case Cr.ZodEffects:return Sqc(t,r);case Cr.ZodAny:return f1(r);case Cr.ZodUnknown:return Wqc(r);case Cr.ZodDefault:return bqc(t,r);case Cr.ZodBranded:return CZi(t,r);case Cr.ZodReadonly:return zqc(t,r);case Cr.ZodCatch:return vqc(t,r);case Cr.ZodPipeline:return jqc(t,r);case Cr.ZodFunction:case Cr.ZodVoid:case Cr.ZodSymbol:return;default:return(n=>{})(e)}},"qj");a(Rc,"r");Kqc=a((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:vZi(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),f1(e)):e.$refStrategy==="seen"?f1(e):void 0}},"Dp"),Jqc=a((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r),"Fp"),Zqc=a((t,e)=>{let r=Aqc(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[d,f])=>({...u,[d]:Rc(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0)??f1(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=Rc(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??f1(r),c=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;c!==void 0&&(s.title=c),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let l=o===void 0?n?{...s,[r.definitionPath]:n}:s:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:s}};return r.target==="jsonSchema7"?l.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(l.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in l||"oneOf"in l||"allOf"in l||"type"in l&&Array.isArray(l.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),l},"QB");a(Xqc,"Zp");a(s$i,"JB");a(a$i,"XB");a(c$i,"YB");ejc=6e4,yLr=class{static{a(this,"WB")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(u8r,r=>{this._oncancel(r)}),this.setNotificationHandler(f8r,r=>{this._onprogress(r)}),this.setRequestHandler(d8r,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(p8r,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ui(Oi.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(m8r,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new ui(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new ui(Oi.InvalidParams,`Task not found: ${s}`);if(!Pne(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Pne(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Dne]:{taskId:s}}}}return await o()},"Y");return await o()}),this.setRequestHandler(g8r,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new ui(Oi.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(y8r,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new ui(Oi.InvalidParams,`Task not found: ${r.params.taskId}`);if(Pne(o.status))throw new ui(Oi.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new ui(Oi.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof ui?o:new ui(Oi.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ui.fromError(Oi.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),eSt(s)||q7c(s)?this._onresponse(s):r$i(s)?this._onrequest(s,c):Q7c(s)?this._onnotification(s):this._onerror(Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=ui.fromError(Oi.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[Dne]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Oi.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=U7c(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new ui(Oi.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Oi.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),eSt(e))n(e);else{let c=new ui(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(eSt(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),eSt(e))o(e);else{let c=ui.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof ui?c:new ui(Oi.InternalError,String(c))}}return}let s;try{let c=await this.request(e,uIt,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new ui(Oi.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Pne(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new ui(Oi.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new ui(Oi.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof ui?c:new ui(Oi.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"V");if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Dne]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(Error(`Failed to send cancellation: ${T}`)));let b=v instanceof ui?v:new ui(Oi.RequestTimeout,String(v));f(b)},"N");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=d3e(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??ejc,E=a(()=>A(ui.fromError(Oi.RequestTimeout,"Request timed out",{timeout:y})),"O");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(Error(`Response handler missing for side-channeled request ${m}`))},"M");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},h8r,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},A8r,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},nQc,r)}async notification(e,r){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Dne]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Dne]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Dne]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=a$i(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=c$i(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=a$i(e);this._notificationHandlers.set(n,o=>{let s=c$i(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&r$i(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new ui(Oi.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new ui(Oi.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new ui(Oi.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw Error("No task store configured");return{createTask:a(async o=>{if(!e)throw Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new ui(Oi.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=uTt.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Pne(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new ui(Oi.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Pne(l.status))throw new ui(Oi.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=uTt.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Pne(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};a(l$i,"Vj");a(tjc,"Bj");rjc=qLr(uVi(),1),njc=qLr(DMc(),1);a(ijc,"ps");ELr=class{static{a(this,"qz")}constructor(e){this._ajv=e??ijc()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}},_Lr=class{static{a(this,"Vz")}constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],c=s.some(f=>f.type==="tool_result"),l=e.messages.length>1?e.messages[e.messages.length-2]:void 0,u=l?Array.isArray(l.content)?l.content:[l.content]:[],d=u.some(f=>f.type==="tool_use");if(c){if(s.some(f=>f.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!d)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(d){let f=new Set(u.filter(m=>m.type==="tool_use").map(m=>m.id)),h=new Set(s.filter(m=>m.type==="tool_result").map(m=>m.toolUseId));if(f.size!==h.size||![...f].every(m=>h.has(m)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},I8r,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},hTt,r)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};a(ojc,"tP");a(sjc,"aP");vLr=class extends yLr{static{a(this,"Bz")}constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(fTt.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)this._oninitialize(n)),this.setNotificationHandler(dZi,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(AZi,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:c}=n.params,l=fTt.safeParse(c);return l.success&&this._loggingLevels.set(s,l.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new _Lr(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=tjc(this._capabilities,e)}setRequestHandler(e,r){let n=J3e(e)?.method;if(!n)throw Error("Schema is missing a method literal");let o;if(oB(n)){let s=n;o=s._zod?.def?.value??s.value}else{let s=n;o=s._def?.value??s.value}if(typeof o!="string")throw Error("Schema method literal must be a string");if(o==="tools/call"){let s=a(async(c,l)=>{let u=d3e(dTt,c);if(!u.success){let m=u.error instanceof Error?u.error.message:String(u.error);throw new ui(Oi.InvalidParams,`Invalid tools/call request: ${m}`)}let{params:d}=u.data,f=await Promise.resolve(r(c,l));if(d.task){let m=d3e(uIt,f);if(!m.success){let g=m.error instanceof Error?m.error.message:String(m.error);throw new ui(Oi.InvalidParams,`Invalid task creation result: ${g}`)}return m.data}let h=d3e(T8r,f);if(!h.success){let m=h.error instanceof Error?h.error.message:String(h.error);throw new ui(Oi.InvalidParams,`Invalid tools/call result: ${m}`)}return h.data},"G");return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){sjc(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&ojc(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:B7c.includes(r)?r:iZi,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},l8r)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(d=>d.type==="tool_result"),c=e.messages.length>1?e.messages[e.messages.length-2]:void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(s){if(o.some(d=>d.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!u)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(h=>h.type==="tool_use").map(h=>h.id)),f=new Set(o.filter(h=>h.type==="tool_result").map(h=>h.toolUseId));if(d.size!==f.size||![...d].every(h=>f.has(h)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},yZi,r):this.request({method:"sampling/createMessage",params:e},I8r,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support url elicitation.");let n=e;return this.request({method:"elicitation/create",params:n},hTt,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw Error("Client does not support form elicitation.");let n=e.mode==="form"?e:{...e,mode:"form"},o=await this.request({method:"elicitation/create",params:n},hTt,r);if(o.action==="accept"&&o.content&&n.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(n.requestedSchema)(o.content);if(!s.valid)throw new ui(Oi.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(s){throw s instanceof ui?s:new ui(Oi.InternalError,`Error validating elicitation response: ${s instanceof Error?s.message:String(s)}`)}return o}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},EZi,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}},IZi=Symbol.for("mcp.completable");a(u$i,"zz");a(ajc,"$E");(function(t){t.Completable="McpCompletable"})(d$i||(d$i={}));cjc=/^[A-Za-z0-9._-]{1,128}$/;a(ljc,"is");a(ujc,"ns");a(f$i,"Nz");CLr=class{static{a(this,"wz")}constructor(e){this._mcpServer=e}registerToolTask(e,r,n){let o={taskSupport:"required",...r.execution};if(o.taskSupport==="forbidden")throw Error(`Cannot register task-based tool '${e}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(e,r.title,r.description,r.inputSchema,r.outputSchema,r.annotations,o,r._meta,n)}},bLr=class{static{a(this,"Dz")}constructor(e,r){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new vLr(e,r)}get experimental(){return this._experimental||(this._experimental={tasks:new CLr(this)}),this._experimental}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(oV(mLr)),this.server.assertCanSetRequestHandler(oV(dTt)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(mLr,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,r])=>{let n={name:e,title:r.title,description:r.description,inputSchema:(()=>{let o=YLe(r.inputSchema);return o?s$i(o,{strictUnions:!0,pipeStrategy:"input"}):djc})(),annotations:r.annotations,execution:r.execution,_meta:r._meta};if(r.outputSchema){let o=YLe(r.outputSchema);o&&(n.outputSchema=s$i(o,{strictUnions:!0,pipeStrategy:"output"}))}return n})})),this.server.setRequestHandler(dTt,async(e,r)=>{try{let n=this._registeredTools[e.params.name];if(!n)throw new ui(Oi.InvalidParams,`Tool ${e.params.name} not found`);if(!n.enabled)throw new ui(Oi.InvalidParams,`Tool ${e.params.name} disabled`);let o=!!e.params.task,s=n.execution?.taskSupport,c="createTask"in n.handler;if((s==="required"||s==="optional")&&!c)throw new ui(Oi.InternalError,`Tool ${e.params.name} has taskSupport '${s}' but was not registered with registerToolTask`);if(s==="required"&&!o)throw new ui(Oi.MethodNotFound,`Tool ${e.params.name} requires task augmentation (taskSupport: 'required')`);if(s==="optional"&&!o&&c)return await this.handleAutomaticTaskPolling(n,e,r);let l=await this.validateToolInput(n,e.params.arguments,e.params.name),u=await this.executeToolHandler(n,l,r);return o||await this.validateToolOutput(n,u,e.params.name),u}catch(n){if(n instanceof ui&&n.code===Oi.UrlElicitationRequired)throw n;return this.createToolError(n instanceof Error?n.message:String(n))}}),this._toolHandlersInitialized=!0)}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,r,n){if(!e.inputSchema)return;let o=YLe(e.inputSchema)??e.inputSchema,s=await dBr(o,r);if(!s.success){let c="error"in s?s.error:"Unknown error",l=fBr(c);throw new ui(Oi.InvalidParams,`Input validation error: Invalid arguments for tool ${n}: ${l}`)}return s.data}async validateToolOutput(e,r,n){if(!e.outputSchema||!("content"in r)||r.isError)return;if(!r.structuredContent)throw new ui(Oi.InvalidParams,`Output validation error: Tool ${n} has an output schema but no structured content was provided`);let o=YLe(e.outputSchema),s=await dBr(o,r.structuredContent);if(!s.success){let c="error"in s?s.error:"Unknown error",l=fBr(c);throw new ui(Oi.InvalidParams,`Output validation error: Invalid structured content for tool ${n}: ${l}`)}}async executeToolHandler(e,r,n){let o=e.handler;if("createTask"in o){if(!n.taskStore)throw Error("No task store provided.");let s={...n,taskStore:n.taskStore};return e.inputSchema?await Promise.resolve(o.createTask(r,s)):await Promise.resolve(o.createTask(s))}return e.inputSchema?await Promise.resolve(o(r,n)):await Promise.resolve(o(n))}async handleAutomaticTaskPolling(e,r,n){if(!n.taskStore)throw Error("No task store provided for task-capable tool.");let o=await this.validateToolInput(e,r.params.arguments,r.params.name),s=e.handler,c={...n,taskStore:n.taskStore},l=o?await Promise.resolve(s.createTask(o,c)):await Promise.resolve(s.createTask(c)),u=l.task.taskId,d=l.task,f=d.pollInterval??5e3;for(;d.status!=="completed"&&d.status!=="failed"&&d.status!=="cancelled";){await new Promise(m=>setTimeout(m,f));let h=await n.taskStore.getTask(u);if(!h)throw new ui(Oi.InternalError,`Task ${u} not found during polling`);d=h}return await n.taskStore.getTaskResult(u)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(oV(gLr)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(gLr,async e=>{switch(e.params.ref.type){case"ref/prompt":return lqc(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return uqc(e),this.handleResourceCompletion(e,e.params.ref);default:throw new ui(Oi.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,r){let n=this._registeredPrompts[r.name];if(!n)throw new ui(Oi.InvalidParams,`Prompt ${r.name} not found`);if(!n.enabled)throw new ui(Oi.InvalidParams,`Prompt ${r.name} disabled`);if(!n.argsSchema)return KLe;let o=J3e(n.argsSchema)?.[e.params.argument.name];if(!u$i(o))return KLe;let s=ajc(o);if(!s)return KLe;let c=await s(e.params.argument.value,e.params.context);return h$i(c)}async handleResourceCompletion(e,r){let n=Object.values(this._registeredResourceTemplates).find(c=>c.resourceTemplate.uriTemplate.toString()===r.uri);if(!n){if(this._registeredResources[r.uri])return KLe;throw new ui(Oi.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=n.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return KLe;let s=await o(e.params.argument.value,e.params.context);return h$i(s)}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(oV(uLr)),this.server.assertCanSetRequestHandler(oV(dLr)),this.server.assertCanSetRequestHandler(oV(fLr)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(uLr,async(e,r)=>{let n=Object.entries(this._registeredResources).filter(([s,c])=>c.enabled).map(([s,c])=>({uri:s,name:c.name,...c.metadata})),o=[];for(let s of Object.values(this._registeredResourceTemplates)){if(!s.resourceTemplate.listCallback)continue;let c=await s.resourceTemplate.listCallback(r);for(let l of c.resources)o.push({...s.metadata,...l})}return{resources:[...n,...o]}}),this.server.setRequestHandler(dLr,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,r])=>({name:e,uriTemplate:r.resourceTemplate.uriTemplate.toString(),...r.metadata}))})),this.server.setRequestHandler(fLr,async(e,r)=>{let n=new URL(e.params.uri),o=this._registeredResources[n.toString()];if(o){if(!o.enabled)throw new ui(Oi.InvalidParams,`Resource ${n} disabled`);return o.readCallback(n,r)}for(let s of Object.values(this._registeredResourceTemplates)){let c=s.resourceTemplate.uriTemplate.match(n.toString());if(c)return s.readCallback(n,c,r)}throw new ui(Oi.InvalidParams,`Resource ${n} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(oV(pLr)),this.server.assertCanSetRequestHandler(oV(hLr)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(pLr,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,r])=>({name:e,title:r.title,description:r.description,arguments:r.argsSchema?fjc(r.argsSchema):void 0}))})),this.server.setRequestHandler(hLr,async(e,r)=>{let n=this._registeredPrompts[e.params.name];if(!n)throw new ui(Oi.InvalidParams,`Prompt ${e.params.name} not found`);if(!n.enabled)throw new ui(Oi.InvalidParams,`Prompt ${e.params.name} disabled`);if(n.argsSchema){let o=YLe(n.argsSchema),s=await dBr(o,e.params.arguments);if(!s.success){let u="error"in s?s.error:"Unknown error",d=fBr(u);throw new ui(Oi.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${d}`)}let c=s.data,l=n.callback;return await Promise.resolve(l(c,r))}else{let o=n.callback;return await Promise.resolve(o(r))}}),this._promptHandlersInitialized=!0)}resource(e,r,...n){let o;typeof n[0]=="object"&&(o=n.shift());let s=n[0];if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let c=this._createRegisteredResource(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,void 0,r,o,s);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}registerResource(e,r,n,o){if(typeof r=="string"){if(this._registeredResources[r])throw Error(`Resource ${r} is already registered`);let s=this._createRegisteredResource(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let s=this._createRegisteredResourceTemplate(e,n.title,r,n,o);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),s}}_createRegisteredResource(e,r,n,o,s){let c={name:e,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({uri:null}),"remove"),update:a(l=>{typeof l.uri<"u"&&l.uri!==n&&(delete this._registeredResources[n],l.uri&&(this._registeredResources[l.uri]=c)),typeof l.name<"u"&&(c.name=l.name),typeof l.title<"u"&&(c.title=l.title),typeof l.metadata<"u"&&(c.metadata=l.metadata),typeof l.callback<"u"&&(c.readCallback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendResourceListChanged()},"update")};return this._registeredResources[n]=c,c}_createRegisteredResourceTemplate(e,r,n,o,s){let c={resourceTemplate:n,title:r,metadata:o,readCallback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(u=>{typeof u.name<"u"&&u.name!==e&&(delete this._registeredResourceTemplates[e],u.name&&(this._registeredResourceTemplates[u.name]=c)),typeof u.title<"u"&&(c.title=u.title),typeof u.template<"u"&&(c.resourceTemplate=u.template),typeof u.metadata<"u"&&(c.metadata=u.metadata),typeof u.callback<"u"&&(c.readCallback=u.callback),typeof u.enabled<"u"&&(c.enabled=u.enabled),this.sendResourceListChanged()},"update")};this._registeredResourceTemplates[e]=c;let l=n.uriTemplate.variableNames;return Array.isArray(l)&&l.some(u=>!!n.completeCallback(u))&&this.setCompletionRequestHandler(),c}_createRegisteredPrompt(e,r,n,o,s){let c={title:r,description:n,argsSchema:o===void 0?void 0:bEe(o),callback:s,enabled:!0,disable:a(()=>c.update({enabled:!1}),"disable"),enable:a(()=>c.update({enabled:!0}),"enable"),remove:a(()=>c.update({name:null}),"remove"),update:a(l=>{typeof l.name<"u"&&l.name!==e&&(delete this._registeredPrompts[e],l.name&&(this._registeredPrompts[l.name]=c)),typeof l.title<"u"&&(c.title=l.title),typeof l.description<"u"&&(c.description=l.description),typeof l.argsSchema<"u"&&(c.argsSchema=bEe(l.argsSchema)),typeof l.callback<"u"&&(c.callback=l.callback),typeof l.enabled<"u"&&(c.enabled=l.enabled),this.sendPromptListChanged()},"update")};return this._registeredPrompts[e]=c,o&&Object.values(o).some(l=>{let u=l instanceof $R?l._def?.innerType:l;return u$i(u)})&&this.setCompletionRequestHandler(),c}_createRegisteredTool(e,r,n,o,s,c,l,u,d){f$i(e);let f={title:r,description:n,inputSchema:p$i(o),outputSchema:p$i(s),annotations:c,execution:l,_meta:u,handler:d,enabled:!0,disable:a(()=>f.update({enabled:!1}),"disable"),enable:a(()=>f.update({enabled:!0}),"enable"),remove:a(()=>f.update({name:null}),"remove"),update:a(h=>{typeof h.name<"u"&&h.name!==e&&(typeof h.name=="string"&&f$i(h.name),delete this._registeredTools[e],h.name&&(this._registeredTools[h.name]=f)),typeof h.title<"u"&&(f.title=h.title),typeof h.description<"u"&&(f.description=h.description),typeof h.paramsSchema<"u"&&(f.inputSchema=bEe(h.paramsSchema)),typeof h.outputSchema<"u"&&(f.outputSchema=bEe(h.outputSchema)),typeof h.callback<"u"&&(f.handler=h.callback),typeof h.annotations<"u"&&(f.annotations=h.annotations),typeof h._meta<"u"&&(f._meta=h._meta),typeof h.enabled<"u"&&(f.enabled=h.enabled),this.sendToolListChanged()},"update")};return this._registeredTools[e]=f,this.setToolRequestHandlers(),this.sendToolListChanged(),f}tool(e,...r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let n,o,s,c;if(typeof r[0]=="string"&&(n=r.shift()),r.length>1){let u=r[0];if(SLr(u))o=r.shift(),r.length>1&&typeof r[0]=="object"&&r[0]!==null&&!SLr(r[0])&&(c=r.shift());else if(typeof u=="object"&&u!==null){if(Object.values(u).some(d=>typeof d=="object"&&d!==null))throw Error(`Tool ${e} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);c=r.shift()}}let l=r[0];return this._createRegisteredTool(e,void 0,n,o,s,c,{taskSupport:"forbidden"},void 0,l)}registerTool(e,r,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:s,inputSchema:c,outputSchema:l,annotations:u,_meta:d}=r;return this._createRegisteredTool(e,o,s,c,l,u,{taskSupport:"forbidden"},d,n)}prompt(e,...r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let n;typeof r[0]=="string"&&(n=r.shift());let o;r.length>1&&(o=r.shift());let s=r[0],c=this._createRegisteredPrompt(e,void 0,n,o,s);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}registerPrompt(e,r,n){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:s,argsSchema:c}=r,l=this._createRegisteredPrompt(e,o,s,c,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),l}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,r){return this.server.sendLoggingMessage(e,r)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}},djc={type:"object",properties:{}};a(xZi,"XE");a(wZi,"YE");a(SLr,"Oz");a(p$i,"QE");a(fjc,"os");a(oV,"l1");a(h$i,"JE");KLe={completion:{values:[],hasMore:!1}};a(pjc,"ts");a(hjc,"as");a(mjc,"ss");a(xr,"b");m$i=15e3,gjc=xr(()=>G.object({session_id:G.string(),ws_url:G.string(),work_dir:G.string().optional(),session_key:G.string().optional()})),qR=class extends Error{static{a(this,"F4")}code;constructor(e,r){super(e),this.name="DirectConnectError",this.code=r}},TLr=class{static{a(this,"UE")}options;ws;sessionId;workDir;abortController;readyState=!1;closed=!1;exitError;messages=new GSt;readyPromise;readyResolve;readyReject;abortHandler;partialChunks=[];telemetryEmitted=!1;constructor(e){this.options=e,this.abortController=e.abortController??new AbortController,this.readyPromise=new Promise((r,n)=>{this.readyResolve=r,this.readyReject=n}),this.readyPromise.catch(()=>{}),this.initialize()}get ready(){return this.readyPromise}getSessionId(){return this.sessionId}getWorkDir(){return this.workDir}async initialize(){if(this.abortController.signal.aborted){this.failInit(new l1("Connection aborted"));return}this.abortHandler=()=>{this.close(),this.exitError=new l1("Connection aborted by user")},this.abortController.signal.addEventListener("abort",this.abortHandler);let e;try{let s=await yjc(this.options);this.sessionId=s.sessionId,this.workDir=s.workDir,e=s.wsUrl}catch(s){let c=H3e(s);if(!(c instanceof l1)){let l=c instanceof qR&&c.code?c.code:"session_create_failed";this.emitTelemetry("bad",l)}this.failInit(c);return}if(this.closed){this.options.deleteSessionOnClose&&this.sessionId&&g$i(this.options.serverUrl,this.sessionId,this.options.authToken);return}let r={};this.options.authToken&&(r.authorization=`Bearer ${this.options.authToken}`);let n=new WebSocket(e,{headers:r});this.ws=n;let o=setTimeout((s,c)=>{if(!s.readyState){c.close();let l=new qR(`WebSocket connection timeout after ${m$i}ms`);s.exitError=l,s.readyReject?.(l),s.emitTelemetry("bad","connect_timeout")}},m$i,this,n);n.addEventListener("open",()=>{clearTimeout(o),this.readyState=!0,UR(`[DirectConnectTransport] Connected to ${this.options.serverUrl}, session=${this.sessionId}`),this.readyResolve?.(),this.emitTelemetry("ok")}),n.addEventListener("message",s=>{let c=typeof s.data=="string"?s.data:"";if(c.indexOf(` `)===-1){c&&this.partialChunks.push(c);return}let l=this.partialChunks.join("")+c;this.partialChunks.length=0;let u=l.split(` -`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=hN(f)}catch(m){jR(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new GR("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new GR(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?HWi("transport_direct_connect"):e==="bad"?GWi("transport_direct_connect",r??"unknown"):E6c("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new g1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new GR("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&R$i(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(vGc,"$e");a(bGc,"Qe");a(R$i,"GE");a(zLr,"nJ");a(SGc,"Xe");a(TGc,"Ye");a(IGc,"We");a(xGc,"Ge");a(TIt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(k$i||(k$i={}));WBh=Array(20).fill(0).map((t,e)=>" ".repeat(e)),zBh={" ":{"\n":Array(200).fill(0).map((t,e)=>` +`),d=u.pop()??"";d&&this.partialChunks.push(d);for(let f of u){if(!f)continue;let h;try{h=dN(f)}catch(m){UR(`DirectConnect: dropped malformed JSON line (${f.length} bytes): ${m}`);continue}this.messages.enqueue(h)}}),n.addEventListener("error",()=>{clearTimeout(o);let s=new qR("WebSocket connection error");this.exitError=s,this.readyReject?.(s),this.messages.done(),!this.readyState&&this.emitTelemetry("bad","ws_error")}),n.addEventListener("close",s=>{let c=this.readyState;this.readyState=!1,this.closed=!0;let l=s.code!==1e3&&s.code!==1001;l&&!this.exitError&&(this.exitError=new qR(`WebSocket closed abnormally: ${s.code} ${s.reason}`)),this.messages.done(),c&&l&&!this.abortController.signal.aborted&&this.emitTelemetry("sad","ws_closed_abnormally")})}emitTelemetry(e,r){this.telemetryEmitted||(this.telemetryEmitted=!0,e==="ok"?PWi("transport_direct_connect"):e==="bad"?kWi("transport_direct_connect",r??"unknown"):hFc("transport_direct_connect",r??"unknown"))}failInit(e){this.exitError=e,this.closed=!0,this.readyReject?.(e),this.messages.done()}async write(e){if(this.abortController.signal.aborted)throw new l1("Operation aborted");if(this.readyState||await this.readyPromise,!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new qR("Transport is not ready for writing");this.ws.send(e)}isReady(){return this.readyState&&this.ws?.readyState===WebSocket.OPEN}endInput(){}[Symbol.dispose](){this.close()}close(){this.closed||(this.closed=!0,this.readyState=!1,this.abortHandler&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.abortController.signal.aborted||this.abortController.abort(),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.messages.done(),this.options.deleteSessionOnClose&&this.sessionId&&g$i(this.options.serverUrl,this.sessionId,this.options.authToken))}async*readMessages(){if(yield*this.messages,this.exitError)throw this.exitError}};a(Ajc,"$e");a(yjc,"Qe");a(g$i,"GE");a(ILr,"nJ");a(Ejc,"Xe");a(_jc,"Ye");a(vjc,"We");a(Cjc,"Ge");a(dIt,"h0");(function(t){t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.space=32]="space",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.asterisk=42]="asterisk",t[t.backslash=92]="backslash",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.plus=43]="plus",t[t.slash=47]="slash",t[t.formFeed=12]="formFeed",t[t.tab=9]="tab"})(A$i||(A$i={}));D4h=Array(20).fill(0).map((t,e)=>" ".repeat(e)),N4h={" ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r `+" ".repeat(e))}," ":{"\n":Array(200).fill(0).map((t,e)=>` `+" ".repeat(e)),"\r":Array(200).fill(0).map((t,e)=>"\r"+" ".repeat(e)),"\r\n":Array(200).fill(0).map((t,e)=>`\r -`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(P$i||(P$i={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(D$i||(D$i={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(N$i||(N$i={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(M$i||(M$i={}));a(GZi,"rW");CV=Y8r.default.homedir(),K8r=Y8r.default.tmpdir(),{env:BEe}=kTt.default,wGc=a(t=>{let e=Yd.default.join(CV,"Library");return{data:Yd.default.join(e,"Application Support",t),config:Yd.default.join(e,"Preferences",t),cache:Yd.default.join(e,"Caches",t),log:Yd.default.join(e,"Logs",t),temp:Yd.default.join(K8r,t)}},"Oe"),RGc=a(t=>{let e=BEe.APPDATA||Yd.default.join(CV,"AppData","Roaming"),r=BEe.LOCALAPPDATA||Yd.default.join(CV,"AppData","Local");return{data:Yd.default.join(r,t,"Data"),config:Yd.default.join(e,t,"Config"),cache:Yd.default.join(r,t,"Cache"),log:Yd.default.join(r,t,"Log"),temp:Yd.default.join(K8r,t)}},"De"),kGc=a(t=>{let e=Yd.default.basename(CV);return{data:Yd.default.join(BEe.XDG_DATA_HOME||Yd.default.join(CV,".local","share"),t),config:Yd.default.join(BEe.XDG_CONFIG_HOME||Yd.default.join(CV,".config"),t),cache:Yd.default.join(BEe.XDG_CACHE_HOME||Yd.default.join(CV,".cache"),t),log:Yd.default.join(BEe.XDG_STATE_HOME||Yd.default.join(CV,".local","state"),t),temp:Yd.default.join(K8r,e,t)}},"Fe");a(PGc,"Mz");YBh=PGc("claude-cli");a(DGc,"Ze");a(NGc,"wE");MGc=100,LBr=[];a(OGc,"Le");BGc=[],O$i=null,KBh=uy(()=>process.argv.includes("--hard-fail"));a($Zi,"oW");kEe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,VZi=new Set,YLr=typeof process=="object"&&process?process:{},WZi=a((t,e,r,n)=>{typeof YLr.emitWarning=="function"?YLr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),PTt=globalThis.AbortController,B$i=globalThis.AbortSignal;if(typeof PTt>"u"){B$i=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},PTt=class{static{a(this,"tW")}constructor(){e()}signal=new B$i;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=YLr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,WZi("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}LGc=a(t=>!VZi.has(t),"Ae"),AV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),zZi=a(t=>AV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?QEe:null:null,"ME"),QEe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},KLr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=zZi(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},JLr=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#C;#m;#b;#T;#E;#v;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#C,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!AV(r))throw TypeError("max option must be a nonnegative integer");let x=r?zZi(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#C=KLr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#v=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!AV(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!AV(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=AV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!AV(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&LGc("LRU_CACHE_UNBOUNDED")&&(VZi.add("LRU_CACHE_UNBOUNDED"),WZi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new QEe(this.#e),r=new QEe(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=kEe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?kEe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=kEe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#B=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new QEe(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!AV(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!AV(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#L=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(kEe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=kEe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=kEe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#C.length!==0?this.#C.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#v&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#v&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#v||this.#y)&&(this.#v&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#C.push(r)),this.#s===1?(this.#A=this.#h=0,this.#C.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new PTt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof PTt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),k=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",k&&R&&(_.returnedStale=!0)),k?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#v||this.#y)&&(this.#v&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#C.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#v&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#C.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(FGc,"LE");UGc=8192;a(YZi,"AE");L$i=FGc(YZi,t=>t,50),IIt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>UGc?YZi(t,e):L$i(t,e);return r.ok?r.value:null},{cache:L$i.cache}),xIt=uy(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=hI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){Kl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return $Zi(t),"unknown"}}),ZBh=uy(()=>{if(process.platform==="linux")try{let t=hI().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){Kl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),XBh=uy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,J8r.release)()};try{let e=await(0,JZi.readFile)("/etc/os-release","utf8");for(let r of e.split(` -`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),eLh=uy(()=>{if(process.platform!=="darwin")return;let t=(0,J8r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),eFe=uy(function(){switch(xIt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),tLh=uy(function(){return(0,KZi.join)(eFe(),"managed-settings.d")}),QGc=xr(()=>H.object({allowedDomains:H.array(H.string()).optional(),deniedDomains:H.array(H.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:H.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:H.array(H.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:H.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:H.boolean().optional(),allowMachLookup:H.array(H.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:H.number().optional(),socksProxyPort:H.number().optional(),tlsTerminate:H.object({caCertPath:H.string().min(1).optional(),caKeyPath:H.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),qGc=xr(()=>H.object({allowWrite:H.array(H.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:H.array(H.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:H.array(H.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:H.array(H.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:H.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),jGc=xr(()=>H.object({enabled:H.boolean().optional(),failIfUnavailable:H.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:H.boolean().optional(),allowUnsandboxedCommands:H.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:QGc(),filesystem:qGc(),ignoreViolations:H.record(H.string(),H.array(H.string())).optional(),enableWeakerNestedSandbox:H.boolean().optional(),enableWeakerNetworkIsolation:H.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:H.array(H.string()).optional(),ripgrep:H.object({command:H.string(),args:H.array(H.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:H.preprocess(t=>typeof t=="string"&&(0,ZLr.isAbsolute)(t)?t:void 0,H.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:H.preprocess(t=>typeof t=="string"&&(0,ZLr.isAbsolute)(t)?t:void 0,H.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),HGc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],GGc=["normal","vim"],$Gc=["auto","tmux","in-process"],VGc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],WGc=["auto",...VGc],rLh=xIt()==="macos"?"\u23FA":"\u25CF",Z8r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],zGc=[...Z8r,"bubble"],YGc=zGc,nLh=xr(()=>gZi.enum(YGc)),iLh=xr(()=>gZi.enum(Z8r)),KGc=["bash","powershell"],d3e=xr(()=>H.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(JGc,"Se");ZGc=xr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=JGc();return H.discriminatedUnion("type",[t,e,r,n,o])}),XGc=xr(()=>H.object({matcher:H.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:H.array(ZGc()).describe("List of hooks to execute when the matcher matches")})),DTt=xr(()=>H.partialRecord(H.enum(zTt),H.array(XGc()))),oLh=xr(()=>H.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),sLh=xr(()=>H.enum(["stdio","sse","sse-ide","http","ws","sdk"])),b_e=xr(()=>H.literal("comms").optional().catch(void 0)),DV=xr(()=>H.number().int().positive()),e$c=xr(()=>H.object({type:H.literal("stdio").optional(),command:H.string().min(1,"Command cannot be empty"),args:H.array(H.string()).default([]),env:H.record(H.string(),H.string()).optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),t$c=xr(()=>H.boolean()),ZZi=xr(()=>H.object({clientId:H.string().optional(),callbackPort:H.number().int().positive().optional(),authServerMetadataUrl:H.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:H.string().min(1).optional(),xaa:t$c().optional()})),r$c=xr(()=>H.object({type:H.literal("sse"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),oauth:ZZi().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),n$c=xr(()=>H.object({type:H.literal("sse-ide"),url:H.string(),ideName:H.string(),ideRunningInWindows:H.boolean().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),i$c=xr(()=>H.object({type:H.literal("ws-ide"),url:H.string(),ideName:H.string(),authToken:H.string().optional(),ideRunningInWindows:H.boolean().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),o$c=xr(()=>H.object({type:H.enum(["http","streamable-http"]).transform(()=>"http"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),oauth:ZZi().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),s$c=xr(()=>H.object({type:H.literal("ws"),url:H.string(),headers:H.record(H.string(),H.string()).optional(),headersHelper:H.string().optional(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),role:b_e()})),a$c=xr(()=>H.object({type:H.literal("sdk"),name:H.string(),timeout:DV().optional(),alwaysLoad:H.boolean().optional()})),c$c=xr(()=>H.enum(["allow","ask","blocked"])),l$c=xr(()=>H.object({type:H.literal("claudeai-proxy"),url:H.string(),id:H.string(),timeout:DV().optional(),alwaysLoad:H.boolean().optional(),toolPermissions:H.record(H.string(),c$c()).optional()})),XLr=xr(()=>H.union([e$c(),r$c(),n$c(),i$c(),o$c(),s$c(),a$c(),l$c()])),aLh=xr(()=>H.object({mcpServers:H.record(H.string(),XLr())})),XZi=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),u$c=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,d$c=/[^\u0020-\u007E]/;a(f$c,"pe");fN=xr(()=>H.string().startsWith("./")),Xne=xr(()=>fN().endsWith(".json")),F$i=xr(()=>H.union([fN().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),H.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),e3r=xr(()=>fN().endsWith(".md")),t3r=xr(()=>H.union([e3r(),fN()])),eXi=xr(()=>H.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!f$c(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),X8r=xr(()=>H.object({name:H.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:H.string().optional().describe("Contact email for support or feedback"),url:H.string().optional().describe("Website, GitHub profile, or organization URL")})),p$c=xr(()=>H.object({$schema:H.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:H.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:H.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:H.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:H.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:X8r().optional().describe("Information about the plugin creator or maintainer"),homepage:H.string().url().optional().describe("Plugin homepage or documentation URL"),repository:H.string().optional().describe("Source code repository URL"),license:H.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:H.array(H.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:H.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:H.array(L$c()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),cLh=xr(()=>H.object({description:H.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:H.lazy(()=>DTt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),h$c=xr(()=>H.object({hooks:H.union([Xne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),H.lazy(()=>DTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),H.array(H.union([Xne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),H.lazy(()=>DTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),m$c=xr(()=>H.object({source:t3r().optional().describe("Path to command markdown file, relative to plugin root"),content:H.string().optional().describe("Inline markdown content for the command"),description:H.string().optional().describe("Command description override"),argumentHint:H.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:H.string().optional().describe("Default model for this command"),allowedTools:H.array(H.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),g$c=xr(()=>H.object({commands:H.union([t3r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),H.array(t3r().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),H.record(H.string(),m$c()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),A$c=xr(()=>H.object({agents:H.union([e3r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),H.array(e3r().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),y$c=xr(()=>H.object({skills:H.union([fN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),H.array(fN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),tXi=xr(()=>H.object({outputStyles:H.union([fN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),H.array(fN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),rXi=xr(()=>H.object({themes:H.union([fN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),H.array(fN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),E$c=xr(()=>H.object({})),U$i=xr(()=>H.string().min(1)),_$c=xr(()=>H.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),C$c=xr(()=>H.object({mcpServers:H.union([Xne().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),F$i().describe("Path or URL to MCPB file containing MCP server configuration"),H.record(H.string(),XLr()).describe("MCP server configurations keyed by server name"),H.array(H.union([Xne().describe("Path to MCP servers configuration file"),F$i().describe("Path or URL to MCPB file"),H.record(H.string(),XLr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),nXi=xr(()=>H.object({type:H.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:H.string().describe("Human-readable label shown in the config dialog"),description:H.string().describe("Help text shown beneath the field in the config dialog"),required:H.boolean().optional().describe("If true, validation fails when this field is empty"),default:H.union([H.string(),H.number(),H.boolean(),H.array(H.string())]).optional().describe("Default value used when the user provides nothing"),multiple:H.boolean().optional().describe("For string type: allow an array of strings"),sensitive:H.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:H.number().optional().describe("Minimum value (number type only)"),max:H.number().optional().describe("Maximum value (number type only)")}).strict()),v$c=xr(()=>H.object({userConfig:H.record(H.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),nXi()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),b$c=xr(()=>H.object({channels:H.array(H.object({server:H.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:H.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:H.record(H.string(),nXi()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),Q$i=xr(()=>H.strictObject({command:H.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:H.array(U$i()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:H.record(_$c(),U$i()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:H.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:H.record(H.string(),H.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:H.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:H.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:H.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:H.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:H.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:H.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:H.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),S$c=xr(()=>H.strictObject({name:H.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:H.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:H.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:H.union([H.literal("always"),H.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),T$c=xr(()=>H.array(S$c()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),iXi=xr(()=>H.object({monitors:H.union([Xne().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),T$c()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),I$c=xr(()=>H.object({lspServers:H.union([Xne().describe("Path to .lsp.json configuration file relative to plugin root"),H.record(H.string(),Q$i()).describe("LSP server configurations keyed by server name"),H.array(H.union([Xne().describe("Path to LSP configuration file"),H.record(H.string(),Q$i()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),oXi=xr(()=>H.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),x$c=xr(()=>H.object({settings:H.record(H.string(),H.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),w$c=xr(()=>H.object({experimental:H.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,H.object({...rXi().partial().shape,...iXi().partial().shape,...tXi().partial().shape,evals:H.union([H.string(),H.array(H.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),R$c=xr(()=>H.object({...p$c().shape,...h$c().partial().shape,...g$c().partial().shape,...A$c().partial().shape,...y$c().partial().shape,...tXi().partial().shape,...rXi().partial().shape,...E$c().shape,...b$c().partial().shape,...C$c().partial().shape,...I$c().partial().shape,...iXi().partial().shape,...x$c().partial().shape,...v$c().partial().shape,...w$c().partial().shape})),NTt=xr(()=>H.discriminatedUnion("source",[H.object({source:H.literal("url"),url:H.string().url().describe("Direct URL to marketplace.json file"),headers:H.record(H.string(),H.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),H.object({source:H.literal("github"),repo:H.string().describe("GitHub repository in owner/repo format"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:H.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:H.array(H.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:H.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),H.object({source:H.literal("git"),url:H.string().describe("Full git repository URL"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:H.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:H.array(H.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:H.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),H.object({source:H.literal("npm"),package:oXi().describe("NPM package containing marketplace.json")}),H.object({source:H.literal("file"),path:H.string().describe("Local file path to marketplace.json")}),H.object({source:H.literal("directory"),path:H.string().describe("Local directory containing .claude-plugin/marketplace.json")}),H.object({source:H.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),H.object({source:H.literal("hostPattern"),hostPattern:H.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),H.object({source:H.literal("pathPattern"),pathPattern:H.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),H.object({source:H.literal("settings"),name:eXi().refine(t=>!XZi.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:H.array(k$c()).describe("Plugin entries declared inline in settings.json"),owner:X8r().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),FBr=xr(()=>H.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),sXi=xr(()=>H.union([fN().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),H.object({source:H.literal("npm"),package:oXi().or(H.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:H.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:H.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),H.object({source:H.literal("url"),url:H.string().describe("Full git repository URL (https:// or git@)"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().optional().describe("Specific commit SHA to use")}),H.object({source:H.literal("github"),repo:H.string().describe("GitHub repository in owner/repo format"),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().optional().describe("Specific commit SHA to use")}),H.object({source:H.literal("git-subdir"),url:H.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:H.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:H.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:FBr().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),H.object({source:H.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),k$c=xr(()=>H.object({name:H.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:sXi().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:H.string().optional(),version:H.string().optional(),strict:H.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),P$c=xr(()=>H.object({cli:H.array(H.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:H.array(H.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:H.array(H.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:H.array(H.object({file:H.string().max(256),pattern:H.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:H.array(H.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),D$c=xr(()=>H.object({topic:H.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:P$c().optional().describe("Matchers that determine when the plugin is relevant.")})),N$c=xr(()=>R$c().partial().extend({name:H.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:sXi().describe("Where to fetch the plugin from"),category:H.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:H.array(H.string()).optional().describe("Tags for searchability and discovery"),strict:H.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:H.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,D$c().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),M$c=xr(()=>H.object({name:H.string().min(1).refine(t=>!t.includes(" "))}));a(O$c,"z$$");lLh=xr(()=>H.object({$schema:H.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:eXi(),version:H.string().optional().describe("Marketplace manifest version"),description:H.string().optional().describe("Human-readable description of this marketplace"),owner:X8r().describe("Marketplace maintainer or curator information"),plugins:H.array(H.unknown()).transform(O$c).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:H.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:H.object({pluginRoot:H.string().optional().describe("Base path for relative plugin sources"),version:H.string().optional().describe("Marketplace version"),description:H.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:H.array(H.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),aXi=xr(()=>H.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),B$c=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,L$c=xr(()=>H.union([H.string().regex(B$c,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),H.object({name:H.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:H.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),F$c=xr(()=>H.object({version:H.string().describe("Currently installed version"),installedAt:H.string().describe("ISO 8601 timestamp of installation"),lastUpdated:H.string().optional().describe("ISO 8601 timestamp of last update"),installPath:H.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:H.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:H.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:H.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),U$c=xr(()=>H.object({version:H.literal(1).describe("Schema version 1"),plugins:H.record(aXi(),F$c()).describe("Map of plugin IDs to their installation metadata")})),Q$c=xr(()=>H.enum(["managed","user","project","local"])),q$c=xr(()=>H.object({scope:Q$c().describe("Installation scope"),projectPath:H.string().optional().describe("Project path (required for project/local scopes)"),installPath:H.string().describe("Absolute path to the versioned plugin directory"),version:H.string().optional().describe("Currently installed version"),installedAt:H.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:H.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:H.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:H.string().optional().describe("Tag-derived semver this install resolved to"),auto:H.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),j$c=xr(()=>H.object({version:H.literal(2).describe("Schema version 2"),plugins:H.record(aXi(),H.array(q$c())).describe("Map of plugin IDs to arrays of installation entries")})),uLh=xr(()=>H.union([U$c(),j$c()])),H$c=xr(()=>H.object({source:NTt().describe("Where to fetch the marketplace from"),installLocation:H.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:H.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:H.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),dLh=xr(()=>H.record(H.string(),H$c())),G$c=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],$$c="https://json.schemastore.org/claude-code-settings.json",V$c=["autoMode","deepLink","voice","assistant","briefView"],mSt={},wIt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape"),permissionsShape:a(()=>mSt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:H.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>mSt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:H.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(cXi,"Ez");a(W$c,"tE");a(z$c,"aE");a(Y$c,"sE");a(K$c,"eE");q$i={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(PEe,"E9");lXi="workspace",fLh=`mcp__${lXi}__bash`,pLh=`mcp__${lXi}__web_fetch`;a(J$c,"A$$");a(Z$c,"Jb");a(X$c,"I$$");a(eVc,"R$$");MTt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(tVc,"Xb");a(rVc,"Yb");a(nVc,"Wb");a(uXi,"Gb");a(UBr,"bz");a(iVc,"P$$");a(dXi,"_z");QBr=xr(()=>H.string().superRefine((t,e)=>{let r=dXi(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:H.ZodIssueCode.custom,message:n,params:{received:t}})}})),oVc=xr(()=>H.record(H.string(),H.coerce.string()));a(fXi,"Hb");hLh=xr(()=>fXi(cXi())),sVc=xr(()=>H.object({source:NTt().describe("Where to fetch the marketplace from"),installLocation:H.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:H.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),pXi=xr(()=>H.object({serverName:H.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:H.array(H.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:H.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>pzi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),hXi=xr(()=>H.object({serverName:H.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:H.array(H.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:H.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>pzi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),aVc=xr(()=>H.object({path:H.string().describe("Absolute path to the helper executable"),timeoutMs:H.number().int().min(1e3).optional(),refreshIntervalMs:H.union([H.literal(0),H.number().int().min(6e4)]).optional()})),j$i=["skills","agents","hooks","mcp"];a(cVc,"Kb");S_e=xr(()=>cVc(cXi())),c9="https://code.claude.com/docs/en",lVc=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${c9}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${c9}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${c9}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${c9}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${c9}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${c9}/iam#working-directories`}}],uVc={permissions:`${c9}/iam#configuring-permissions`,env:`${c9}/settings#environment-variables`,hooks:`${c9}/hooks`};a(dVc,"qb");mLh=xr(()=>S_e().strict());a(H$i,"Vb");a(G$i,"Bb");a(fVc,"v$$");a($$i,"zb");a(qEe,"b9");a(V$i,"Nb");a(EFe,"d0");a(pVc,"C$$");hVc=new Set(zTt);a(mVc,"x$$");gVc=[{key:"allowedMcpServers",schema:pXi},{key:"deniedMcpServers",schema:hXi}];a(AVc,"f$$");a(T_e,"i1");W$i="com.anthropic.claudecode",r3r="HKLM\\SOFTWARE\\Policies\\ClaudeCode",n3r="HKCU\\SOFTWARE\\Policies\\ClaudeCode",LEe="Settings",yVc="/usr/bin/plutil",EVc=["-convert","json","-o","-","--"],_Vc=5e3,z$i="/mnt/c/Windows/System32/reg.exe",OTt="/mnt/c/Program Files/ClaudeCode";a(gXi,"XG");a(CVc,"Zb");vVc=null;a(f3e,"$5");a(bVc,"Mb");a(SVc,"Lb");EV=Object.freeze({settings:{},errors:[]}),EXi=null,_Xi=null,CXi=!1,BTt=null;a(TVc,"l$$");a(IVc,"bb");a(xVc,"_b");a(wVc,"kb");a(RVc,"Sb");a(qBr,"Cz");a(Y$i,"jb");a(kVc,"c$$");a(PVc,"p$$");a(K$i,"Ab");a(DVc,"d$$");a(J$i,"Ib");a(NVc,"i$$");i3r=NVc;a(MVc,"n$$");OVc=MVc,BVc=OVc(),LVc=BVc;a(FVc,"o$$");UVc=FVc,QVc="[object Object]",qVc=Function.prototype,jVc=Object.prototype,vXi=qVc.toString,HVc=jVc.hasOwnProperty,GVc=vXi.call(Object);a($Vc,"Q6$");VVc=$Vc;a(WVc,"J6$");o3r=WVc;a(zVc,"X6$");YVc=zVc;a(KVc,"Y6$");JVc=KVc;a(bXi,"hb");ZVc=bXi;a(XVc,"W6$");eWc=XVc,Z$i=Math.max;a(tWc,"G6$");SXi=tWc;a(rWc,"U6$");nWc=rWc,iWc=eTt?function(t,e){return eTt(t,"toString",{configurable:!0,enumerable:!1,value:nWc(e),writable:!0})}:PWi,oWc=iWc,sWc=800,aWc=16,cWc=Date.now;a(lWc,"B6$");uWc=lWc,dWc=uWc(oWc),TXi=dWc;a(fWc,"N6$");pWc=fWc;a(hWc,"w6$");mWc=hWc;a(gWc,"O6$");AWc=gWc,yWc=AWc(function(t,e,r,n){ZVc(t,e,r,n)}),vV=yWc;a(EWc,"F6$");_Wc=EWc;a(CWc,"Z6$");vWc=CWc;a(bWc,"M6$");SWc=bWc,X$i=TV?TV.isConcatSpreadable:void 0;a(TWc,"L6$");IWc=TWc;a(IXi,"$_");xWc=IXi;a(wWc,"j6$");RWc=wWc;a(kWc,"A6$");PWc=kWc,DWc=PWc(function(t,e){return t==null?{}:SWc(t,e)}),jBr=DWc,NWc="remote-settings.json",HBr=null;a(OWc,"b6$");a(BWc,"_6$");a(LWc,"W_");a(e6r,"fz");a(FWc,"S6$");a(wXi,"U_");a(GBr,"xz");a(UWc,"v6$");a(LTt,"HG");a(RXi,"H_");a(kXi,"K_");a(PXi,"q_");a(DXi,"V_");a(QWc,"C6$");a(eVi,"G_");a(qWc,"T6$");a(FTt,"Y5");a(jWc,"x6$");a(NXi,"B_");a(HWc,"y6$");a(GWc,"f6$");a($Wc,"z_");a(VWc,"g6$");a(MXi,"N_");a(WWc,"h6$");a(zWc,"u6$");a(bV,"o1");$Br=!1;a(YWc,"m6$");a(KWc,"l6$");a(JWc,"c6$");a(ZWc,"w_");a(XWc,"O_");ezc={user:"userSettings",project:"projectSettings",local:"localSettings"},tVi={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},tzc=["user","project","local"],rzc=new Set(["bypassPermissions","auto","acceptEdits"]),nzc=new Set(["project"]);a(izc,"o6$");a(ozc,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(szc,"LA$");a(azc,"G4$");a(czc,"U4$");a(lzc,"H4$");a(OXi,"b_");a(s3r,"uz");a(a3r,"mz");uzc=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(UTt,"KG");a(dzc,"q4$");a(fzc,"jA$");a(pzc,"AA$");a(hzc,"IA$");a(mzc,"RA$");a(gzc,"PA$");a(Azc,"EA$");a(yzc,"bA$");a(Ezc,"_A$");a(_zc,"kA$");a(Czc,"SA$");a(rVi,"M_");a(vzc,"V4$");a(bzc,"vA$");a(Szc,"CA$");a(BXi,"__");a(ZR,"J4");a(LXi,"k_");a(nVi,"L_");a(c3r,"lz");a(Tzc,"B4$");a(iVi,"j_");a(FXi,"S_");a(Izc,"z4$");a(UXi,"v_");a(xzc,"N4$");a(wzc,"w4$");a(Rzc,"O4$");a(kzc,"D4$");a(Pzc,"F4$");a(Dzc,"Z4$");a(Nzc,"M4$");a(oVi,"A_")});var rto=I((x6r,tto)=>{p();x6r.createWatcher=g8e()("vscode-policy-watcher");if(require.main===tto){let t=process.platform;x6r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Fto=I(O6r=>{p();var Lto="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");O6r.encode=function(t){if(0<=t&&t{p();var Uto=Fto(),B6r=5,Qto=1<>1;return e?-r:r}a(SKc,"fromVLQSigned");L6r.encode=a(function(e){var r="",n,o=bKc(e);do n=o&qto,o>>>=B6r,o>0&&(n|=jto),r+=Uto.encode(n);while(o>0);return r},"base64VLQ_encode");L6r.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Uto.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&jto),u&=qto,s=s+(u<{p();function TKc(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(TKc,"getArg");KE.getArg=TKc;var Hto=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,IKc=/^data:.+\,.+$/;function KFe(t){var e=t.match(Hto);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(KFe,"urlParse");KE.urlParse=KFe;function j_e(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(j_e,"urlGenerate");KE.urlGenerate=j_e;function U6r(t){var e=t,r=KFe(t);if(r){if(!r.path)return t;e=r.path}for(var n=KE.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,j_e(r)):e}a(U6r,"normalize");KE.normalize=U6r;function Gto(t,e){t===""&&(t="."),e===""&&(e=".");var r=KFe(e),n=KFe(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),j_e(r);if(r||e.match(IKc))return e;if(n&&!n.host&&!n.path)return n.host=e,j_e(n);var o=e.charAt(0)==="/"?e:U6r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,j_e(n)):o}a(Gto,"join");KE.join=Gto;KE.isAbsolute=function(t){return t.charAt(0)==="/"||Hto.test(t)};function xKc(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(xKc,"relative");KE.relative=xKc;var $to=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Vto(t){return t}a(Vto,"identity");function wKc(t){return Wto(t)?"$"+t:t}a(wKc,"toSetString");KE.toSetString=$to?Vto:wKc;function RKc(t){return Wto(t)?t.slice(1):t}a(RKc,"fromSetString");KE.fromSetString=$to?Vto:RKc;function Wto(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(Wto,"isProtoString");function kKc(t,e,r){var n=H_e(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:H_e(t.name,e.name)}a(kKc,"compareByOriginalPositions");KE.compareByOriginalPositions=kKc;function PKc(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=H_e(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:H_e(t.name,e.name)}a(PKc,"compareByGeneratedPositionsDeflated");KE.compareByGeneratedPositionsDeflated=PKc;function H_e(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(H_e,"strcmp");function DKc(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=H_e(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:H_e(t.name,e.name)}a(DKc,"compareByGeneratedPositionsInflated");KE.compareByGeneratedPositionsInflated=DKc;function NKc(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(NKc,"parseSourceMapInput");KE.parseSourceMapInput=NKc;function MKc(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=KFe(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=Gto(j_e(n),e)}return U6r(e)}a(MKc,"computeSourceURL");KE.computeSourceURL=MKc});var j6r=I(zto=>{p();var Q6r=G_e(),q6r=Object.prototype.hasOwnProperty,cie=typeof Map<"u";function E9(){this._array=[],this._set=cie?new Map:Object.create(null)}a(E9,"ArraySet");E9.fromArray=a(function(e,r){for(var n=new E9,o=0,s=e.length;o=0)return r}else{var n=Q6r.toSetString(e);if(q6r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");E9.prototype.at=a(function(e){if(e>=0&&e{p();var Yto=G_e();function OKc(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Yto.compareByGeneratedPositionsInflated(t,e)<=0}a(OKc,"generatedPositionAfter");function ewt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(ewt,"MappingList");ewt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");ewt.prototype.add=a(function(e){OKc(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");ewt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Yto.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Kto.MappingList=ewt});var H6r=I(Zto=>{p();var JFe=F6r(),x0=G_e(),twt=j6r().ArraySet,BKc=Jto().MappingList;function rk(t){t||(t={}),this._file=x0.getArg(t,"file",null),this._sourceRoot=x0.getArg(t,"sourceRoot",null),this._skipValidation=x0.getArg(t,"skipValidation",!1),this._sources=new twt,this._names=new twt,this._mappings=new BKc,this._sourcesContents=null}a(rk,"SourceMapGenerator");rk.prototype._version=3;rk.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new rk({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=x0.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=x0.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");rk.prototype.addMapping=a(function(e){var r=x0.getArg(e,"generated"),n=x0.getArg(e,"original",null),o=x0.getArg(e,"source",null),s=x0.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");rk.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=x0.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[x0.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[x0.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");rk.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=x0.relative(s,o));var c=new twt,l=new twt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=x0.join(n,u.source)),s!=null&&(u.source=x0.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=x0.join(n,u)),s!=null&&(u=x0.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");rk.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");rk.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!x0.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=JFe.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=JFe.encode(h-c),c=h,u+=JFe.encode(d.originalLine-1-o),o=d.originalLine-1,u+=JFe.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=JFe.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");rk.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=x0.relative(r,n));var o=x0.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");rk.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");rk.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Zto.SourceMapGenerator=rk});var Xto=I(lie=>{p();lie.GREATEST_LOWER_BOUND=1;lie.LEAST_UPPER_BOUND=2;function G6r(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?G6r(c,e,r,n,o,s):s==lie.LEAST_UPPER_BOUND?e1?G6r(t,c,r,n,o,s):s==lie.LEAST_UPPER_BOUND?c:t<0?-1:t}a(G6r,"recursiveSearch");lie.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=G6r(-1,r.length,e,r,n,o||lie.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var tro=I(ero=>{p();function $6r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a($6r,"swap");function LKc(t,e){return Math.round(t+Math.random()*(e-t))}a(LKc,"randomIntInRange");function V6r(t,e,r,n){if(r{p();var Qn=G_e(),W6r=Xto(),$_e=j6r().ArraySet,FKc=F6r(),ZFe=tro().quickSort;function Ed(t,e){var r=t;return typeof t=="string"&&(r=Qn.parseSourceMapInput(t)),r.sections!=null?new CN(r,e):new py(r,e)}a(Ed,"SourceMapConsumer");Ed.fromSourceMap=function(t,e){return py.fromSourceMap(t,e)};Ed.prototype._version=3;Ed.prototype.__generatedMappings=null;Object.defineProperty(Ed.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Ed.prototype.__originalMappings=null;Object.defineProperty(Ed.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Ed.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Ed.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Ed.GENERATED_ORDER=1;Ed.ORIGINAL_ORDER=2;Ed.GREATEST_LOWER_BOUND=1;Ed.LEAST_UPPER_BOUND=2;Ed.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Ed.GENERATED_ORDER,c;switch(s){case Ed.GENERATED_ORDER:c=this._generatedMappings;break;case Ed.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=Qn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Ed.prototype.allGeneratedPositionsFor=a(function(e){var r=Qn.getArg(e,"line"),n={source:Qn.getArg(e,"source"),originalLine:r,originalColumn:Qn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Qn.compareByOriginalPositions,W6r.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:Qn.getArg(c,"generatedLine",null),column:Qn.getArg(c,"generatedColumn",null),lastColumn:Qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");rwt.SourceMapConsumer=Ed;function py(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sources"),s=Qn.getArg(r,"names",[]),c=Qn.getArg(r,"sourceRoot",null),l=Qn.getArg(r,"sourcesContent",null),u=Qn.getArg(r,"mappings"),d=Qn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=Qn.normalize(c)),o=o.map(String).map(Qn.normalize).map(function(f){return c&&Qn.isAbsolute(c)&&Qn.isAbsolute(f)?Qn.relative(c,f):f}),this._names=$_e.fromArray(s.map(String),!0),this._sources=$_e.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return Qn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(py,"BasicSourceMapConsumer");py.prototype=Object.create(Ed.prototype);py.prototype.consumer=Ed;py.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=Qn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}ZFe(A,Qn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,ZFe(g,Qn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");py.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return W6r.search(e,r,s,c)},"SourceMapConsumer_findMapping");py.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=Qn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=Qn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=Qn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:Qn.getArg(o,"originalLine",null),column:Qn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");py.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");py.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=Qn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=Qn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");py.prototype.generatedPositionFor=a(function(e){var r=Qn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:Qn.getArg(e,"line"),originalColumn:Qn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",Qn.compareByOriginalPositions,Qn.getArg(e,"bias",Ed.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:Qn.getArg(s,"generatedLine",null),column:Qn.getArg(s,"generatedColumn",null),lastColumn:Qn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");rwt.BasicSourceMapConsumer=py;function CN(t,e){var r=t;typeof t=="string"&&(r=Qn.parseSourceMapInput(t));var n=Qn.getArg(r,"version"),o=Qn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new $_e,this._names=new $_e;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=Qn.getArg(c,"offset"),u=Qn.getArg(l,"line"),d=Qn.getArg(l,"column");if(u{p();var UKc=H6r().SourceMapGenerator,nwt=G_e(),QKc=/(\r?\n)/,qKc=10,V_e="$$$isSourceNode$$$";function EI(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[V_e]=!0,n!=null&&this.add(n)}a(EI,"SourceNode");EI.fromStringWithSourceMap=a(function(e,r,n){var o=new EI,s=e.split(QKc),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[V_e]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");EI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();iwt.SourceMapGenerator=H6r().SourceMapGenerator;iwt.SourceMapConsumer=nro().SourceMapConsumer;iwt.SourceNode=oro().SourceNode});var cro=I((BKh,aro)=>{p();var jKc=Object.prototype.toString,z6r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function HKc(t){return jKc.call(t).slice(8,-1)==="ArrayBuffer"}a(HKc,"isArrayBuffer");function GKc(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return z6r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(GKc,"fromArrayBuffer");function $Kc(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return z6r?Buffer.from(t,e):new Buffer(t,e)}a($Kc,"fromString");function VKc(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return HKc(t)?GKc(t,e,r):typeof t=="string"?$Kc(t,e):z6r?Buffer.from(t):new Buffer(t)}a(VKc,"bufferFrom");aro.exports=VKc});var gro=I((die,Z6r)=>{p();var WKc=sro().SourceMapConsumer,Y6r=require("path"),AB;try{AB=require("fs"),(!AB.existsSync||!AB.readFileSync)&&(AB=null)}catch{}var zKc=cro();function lro(t,e){return t.require(e)}a(lro,"dynamicRequire");var uro=!1,dro=!1,K6r=!1,XFe="auto",uie={},e8e={},YKc=/^data:application\/json[^,]+base64,/,UV=[],QV=[];function X6r(){return XFe==="browser"?!0:XFe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(X6r,"isInBrowser");function KKc(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a(KKc,"hasGlobalProcessEventEmitter");function JKc(){return typeof process=="object"&&process!==null?process.version:""}a(JKc,"globalProcessVersion");function ZKc(){if(typeof process=="object"&&process!==null)return process.stderr}a(ZKc,"globalProcessStderr");function XKc(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(XKc,"globalProcessExit");function owt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(tJc,"CallSiteToString");function fro(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=tJc,e}a(fro,"cloneCallSite");function hro(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(JKc())?0:62;n===1&&o>c&&!X6r()&&!t.isEval()&&(o-=c);var l=r9r({source:r,line:n,column:o});e.curPosition=l,t=fro(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=pro(d),t=fro(t),t.getEvalOrigin=function(){return d}),t}a(hro,"wrapCallSite");function rJc(t,e){K6r&&(uie={},e8e={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` - at `+hro(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(rJc,"prepareStackTrace");function mro(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=uie[r];if(!s&&AB&&AB.existsSync(r))try{s=AB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` +`+" ".repeat(e))}};(function(t){t.DEFAULT={allowTrailingComma:!1}})(y$i||(y$i={}));(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(E$i||(E$i={}));(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(_$i||(_$i={}));(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(v$i||(v$i={}));a(kZi,"rW");uV=x8r.default.homedir(),w8r=x8r.default.tmpdir(),{env:SEe}=gTt.default,bjc=a(t=>{let e=Wd.default.join(uV,"Library");return{data:Wd.default.join(e,"Application Support",t),config:Wd.default.join(e,"Preferences",t),cache:Wd.default.join(e,"Caches",t),log:Wd.default.join(e,"Logs",t),temp:Wd.default.join(w8r,t)}},"Oe"),Sjc=a(t=>{let e=SEe.APPDATA||Wd.default.join(uV,"AppData","Roaming"),r=SEe.LOCALAPPDATA||Wd.default.join(uV,"AppData","Local");return{data:Wd.default.join(r,t,"Data"),config:Wd.default.join(e,t,"Config"),cache:Wd.default.join(r,t,"Cache"),log:Wd.default.join(r,t,"Log"),temp:Wd.default.join(w8r,t)}},"De"),Tjc=a(t=>{let e=Wd.default.basename(uV);return{data:Wd.default.join(SEe.XDG_DATA_HOME||Wd.default.join(uV,".local","share"),t),config:Wd.default.join(SEe.XDG_CONFIG_HOME||Wd.default.join(uV,".config"),t),cache:Wd.default.join(SEe.XDG_CACHE_HOME||Wd.default.join(uV,".cache"),t),log:Wd.default.join(SEe.XDG_STATE_HOME||Wd.default.join(uV,".local","state"),t),temp:Wd.default.join(w8r,e,t)}},"Fe");a(Ijc,"Mz");M4h=Ijc("claude-cli");a(xjc,"Ze");a(wjc,"wE");Rjc=100,mBr=[];a(Pjc,"Le");kjc=[],C$i=null,O4h=hy(()=>process.argv.includes("--hard-fail"));a(DZi,"oW");yEe=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,NZi=new Set,xLr=typeof process=="object"&&process?process:{},MZi=a((t,e,r,n)=>{typeof xLr.emitWarning=="function"?xLr.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"ZE"),ATt=globalThis.AbortController,b$i=globalThis.AbortSignal;if(typeof ATt>"u"){b$i=class{static{a(this,"DE")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,n){this._onabort.push(n)}},ATt=class{static{a(this,"tW")}constructor(){e()}signal=new b$i;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let n of this.signal._onabort)n(r);this.signal.onabort?.(r)}}};let t=xLr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,MZi("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"Q")}Djc=a(t=>!NZi.has(t),"Ae"),sV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"p1"),OZi=a(t=>sV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wEe:null:null,"ME"),wEe=class extends Array{static{a(this,"rJ")}constructor(e){super(e),this.fill(0)}},wLr=class t{static{a(this,"I9")}heap;length;static#e=!1;static create(e){let r=OZi(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},RLr=class t{static{a(this,"aW")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!sV(r))throw TypeError("max option must be a nonnegative integer");let x=r?OZi(r):Array;if(!x)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=Array(r).fill(void 0),this.#l=Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=wLr.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!sV(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!sV(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=sV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!sV(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError("At least one of max, maxSize, or ttl is required");!this.ttlAutopurge&&!this.#e&&!this.#t&&Djc("LRU_CACHE_UNBOUNDED")&&(NZi.add("LRU_CACHE_UNBOUNDED"),MZi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",t))}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){let e=new wEe(this.#e),r=new wEe(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=yEe.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?yEe.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=yEe.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"Y");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#E");#d=a(()=>{},"#R");#B=a(()=>{},"#y");#_=a(()=>!1,"#N");#D(){let e=new wEe(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!sV(o))if(s){if(typeof s!="function")throw TypeError("sizeCalculation must be a function");if(o=s(n,r),!sV(o))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#k=a(e=>{},"#b");#N=a((e,r,n)=>{},"#v");#L=a((e,r,n,o)=>{if(n||o)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#f");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(yEe.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=yEe.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=yEe.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#k(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#P(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#k(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new ATt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"H"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"q"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"V"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"w")))})},"B");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof ATt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let D=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",D&&(_.returnedStale=!0)),D?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#k(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};a(Njc,"LE");Mjc=8192;a(BZi,"AE");S$i=Njc(BZi,t=>t,50),fIt=Object.assign(function(t,e=!0){if(!t)return null;let r=t.length>Mjc?BZi(t,e):S$i(t,e);return r.ok?r.value:null},{cache:S$i.cache}),pIt=hy(()=>{try{if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";if(process.platform==="linux"){if(process.env.WSL_DISTRO_NAME||process.env.WSL_INTEROP)return"wsl";try{let t=uI().readFileSync("/proc/version",{encoding:"utf8"});if(t.toLowerCase().includes("microsoft")||t.toLowerCase().includes("wsl"))return"wsl"}catch(t){Wl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"})}return"linux"}return"unknown"}catch(t){return DZi(t),"unknown"}}),L4h=hy(()=>{if(process.platform==="linux")try{let t=uI().readFileSync("/proc/version",{encoding:"utf8"}),e=t.match(/WSL(\d+)/i);return e&&e[1]?e[1]:t.toLowerCase().includes("microsoft")?"1":void 0}catch(t){Wl(`Failed to read /proc/version for WSL detection: ${t}`,{level:"error"});return}}),F4h=hy(async()=>{if(process.platform!=="linux")return;let t={linuxKernel:(0,R8r.release)()};try{let e=await(0,FZi.readFile)("/etc/os-release","utf8");for(let r of e.split(` +`)){let n=r.match(/^(ID|VERSION_ID)=(.*)$/);if(n&&n[1]&&n[2]){let o=n[2].replace(/^"|"$/g,"");n[1]==="ID"?t.linuxDistroId=o:t.linuxDistroVersion=o}}}catch{}return t}),U4h=hy(()=>{if(process.platform!=="darwin")return;let t=(0,R8r.release)().match(/^(\d+)\./);if(!(!t||!t[1]))return parseInt(t[1],10)-9}),Q3e=hy(function(){switch(pIt()){case"macos":return"/Library/Application Support/ClaudeCode";case"windows":return"C:\\Program Files\\ClaudeCode";default:return"/etc/claude-code"}}),Q4h=hy(function(){return(0,LZi.join)(Q3e(),"managed-settings.d")}),Ojc=xr(()=>G.object({allowedDomains:G.array(G.string()).optional(),deniedDomains:G.array(G.string()).optional().describe("Domains that are always blocked, even if matched by allowedDomains. Supports the same wildcard syntax as allowedDomains. Merged from all settings sources regardless of allowManagedDomainsOnly."),allowManagedDomainsOnly:G.boolean().optional().describe("When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources."),allowUnixSockets:G.array(G.string()).optional().describe("macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path)."),allowAllUnixSockets:G.boolean().optional().describe("If true, allow all Unix sockets (disables blocking on both platforms)."),allowLocalBinding:G.boolean().optional(),allowMachLookup:G.array(G.string().refine(t=>!(t.endsWith("*")?t.slice(0,-1):t).includes("*"),{message:'Wildcards are only allowed as a single trailing "*" (e.g., "com.example.*" or "*" for all services).'})).optional().describe('macOS only: Additional XPC/Mach service names to allow looking up. Supports trailing-wildcard prefix matching (e.g., "com.apple.coresimulator.*"). Needed for tools that communicate via XPC such as the iOS Simulator or Playwright.'),httpProxyPort:G.number().optional(),socksProxyPort:G.number().optional(),tlsTerminate:G.object({caCertPath:G.string().min(1).optional(),caKeyPath:G.string().min(1).optional()}).optional().describe("[EXPERIMENTAL] Enable in-process TLS termination so the per-request filter can see HTTPS request bodies. Provide a CA cert+key, or omit both to have sandbox-runtime generate an ephemeral one for the session.")}).optional()),Bjc=xr(()=>G.object({allowWrite:G.array(G.string()).optional().describe("Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules."),denyWrite:G.array(G.string()).optional().describe("Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules."),denyRead:G.array(G.string()).optional().describe("Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules."),allowRead:G.array(G.string()).optional().describe("Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths."),allowManagedReadPathsOnly:G.boolean().optional().describe("When true (set in managed settings), only allowRead paths from policySettings are used.")}).optional()),Ljc=xr(()=>G.object({enabled:G.boolean().optional(),failIfUnavailable:G.boolean().optional().describe("Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies or unsupported platform). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate."),autoAllowBashIfSandboxed:G.boolean().optional(),allowUnsandboxedCommands:G.boolean().optional().describe("Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."),network:Ojc(),filesystem:Bjc(),ignoreViolations:G.record(G.string(),G.array(G.string())).optional(),enableWeakerNestedSandbox:G.boolean().optional(),enableWeakerNetworkIsolation:G.boolean().optional().describe("macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** \u2014 opens a potential data exfiltration vector through the trustd service. Default: false"),excludedCommands:G.array(G.string()).optional(),ripgrep:G.object({command:G.string(),args:G.array(G.string()).optional()}).optional().describe("Custom ripgrep configuration for bundled ripgrep support"),bwrapPath:G.preprocess(t=>typeof t=="string"&&(0,PLr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the bwrap (bubblewrap) binary. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings."),socatPath:G.preprocess(t=>typeof t=="string"&&(0,PLr.isAbsolute)(t)?t:void 0,G.string()).optional().catch(void 0).describe("Linux/WSL only: Absolute path to the socat binary used for the sandbox network proxy. Overrides auto-detection via PATH. Only honored from admin-controlled managed settings.")}).passthrough()),Fjc=["auto","iterm2","iterm2_with_bell","terminal_bell","kitty","ghostty","notifications_disabled"],Ujc=["normal","vim"],Qjc=["auto","tmux","in-process"],qjc=["dark","light","light-daltonized","dark-daltonized","light-ansi","dark-ansi"],jjc=["auto",...qjc],q4h=pIt()==="macos"?"\u23FA":"\u25CF",P8r=["acceptEdits","auto","bypassPermissions","default","dontAsk","plan"],Hjc=[...P8r,"bubble"],Gjc=Hjc,j4h=xr(()=>nZi.enum(Gjc)),H4h=xr(()=>nZi.enum(P8r)),$jc=["bash","powershell"],JLe=xr(()=>G.string().optional().describe('Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.'));a(Vjc,"Se");Wjc=xr(()=>{let{BashCommandHookSchema:t,PromptHookSchema:e,AgentHookSchema:r,HttpHookSchema:n,McpToolHookSchema:o}=Vjc();return G.discriminatedUnion("type",[t,e,r,n,o])}),zjc=xr(()=>G.object({matcher:G.string().optional().describe('String pattern to match (e.g. tool names like "Write")'),hooks:G.array(Wjc()).describe("List of hooks to execute when the matcher matches")})),yTt=xr(()=>G.partialRecord(G.enum(MTt),G.array(zjc()))),G4h=xr(()=>G.enum(["local","user","project","dynamic","enterprise","claudeai","managed","agent"])),$4h=xr(()=>G.enum(["stdio","sse","sse-ide","http","ws","sdk"])),d_e=xr(()=>G.literal("comms").optional().catch(void 0)),vV=xr(()=>G.number().int().positive()),Yjc=xr(()=>G.object({type:G.literal("stdio").optional(),command:G.string().min(1,"Command cannot be empty"),args:G.array(G.string()).default([]),env:G.record(G.string(),G.string()).optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),Kjc=xr(()=>G.boolean()),UZi=xr(()=>G.object({clientId:G.string().optional(),callbackPort:G.number().int().positive().optional(),authServerMetadataUrl:G.string().url().startsWith("https://",{message:"authServerMetadataUrl must use https://"}).optional(),scopes:G.string().min(1).optional(),xaa:Kjc().optional()})),Jjc=xr(()=>G.object({type:G.literal("sse"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:UZi().optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),Zjc=xr(()=>G.object({type:G.literal("sse-ide"),url:G.string(),ideName:G.string(),ideRunningInWindows:G.boolean().optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),Xjc=xr(()=>G.object({type:G.literal("ws-ide"),url:G.string(),ideName:G.string(),authToken:G.string().optional(),ideRunningInWindows:G.boolean().optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),eHc=xr(()=>G.object({type:G.enum(["http","streamable-http"]).transform(()=>"http"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),oauth:UZi().optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),tHc=xr(()=>G.object({type:G.literal("ws"),url:G.string(),headers:G.record(G.string(),G.string()).optional(),headersHelper:G.string().optional(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),role:d_e()})),rHc=xr(()=>G.object({type:G.literal("sdk"),name:G.string(),timeout:vV().optional(),alwaysLoad:G.boolean().optional()})),nHc=xr(()=>G.enum(["allow","ask","blocked"])),iHc=xr(()=>G.object({type:G.literal("claudeai-proxy"),url:G.string(),id:G.string(),timeout:vV().optional(),alwaysLoad:G.boolean().optional(),toolPermissions:G.record(G.string(),nHc()).optional()})),kLr=xr(()=>G.union([Yjc(),Jjc(),Zjc(),Xjc(),eHc(),tHc(),rHc(),iHc()])),V4h=xr(()=>G.object({mcpServers:G.record(G.string(),kLr())})),QZi=new Set(["claude-code-marketplace","claude-code-plugins","claude-plugins-official","anthropic-marketplace","anthropic-plugins","agent-skills","anthropic-agent-skills","life-sciences","knowledge-work-plugins","claude-for-legal","claude-for-financial-services","financial-services-plugins"]),oHc=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,sHc=/[^\u0020-\u007E]/;a(aHc,"pe");lN=xr(()=>G.string().startsWith("./")),Vne=xr(()=>lN().endsWith(".json")),T$i=xr(()=>G.union([lN().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB file path must end with .mcpb or .dxt"}).describe("Path to MCPB file relative to plugin root"),G.string().url().refine(t=>t.endsWith(".mcpb")||t.endsWith(".dxt"),{message:"MCPB URL must end with .mcpb or .dxt"}).describe("URL to MCPB file")])),DLr=xr(()=>lN().endsWith(".md")),NLr=xr(()=>G.union([DLr(),lN()])),qZi=xr(()=>G.string().min(1,"Marketplace must have a name").refine(t=>!t.includes(" "),{message:'Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")'}).refine(t=>!t.includes("/")&&!t.includes("\\")&&!t.includes("..")&&t!==".",{message:'Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."'}).refine(t=>!aHc(t),{message:"Marketplace name impersonates an official Anthropic/Claude marketplace"}).refine(t=>t.toLowerCase()!=="inline",{message:'Marketplace name "inline" is reserved for --plugin-dir session plugins'}).refine(t=>t.toLowerCase()!=="builtin",{message:'Marketplace name "builtin" is reserved for built-in plugins'}).refine(t=>t.toLowerCase()!=="skills-dir",{message:'Marketplace name "skills-dir" is reserved for plugins auto-loaded from .claude/skills/'})),k8r=xr(()=>G.object({name:G.string().min(1,"Author name cannot be empty").describe("Display name of the plugin author or organization"),email:G.string().optional().describe("Contact email for support or feedback"),url:G.string().optional().describe("Website, GitHub profile, or organization URL")})),cHc=xr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier for the plugin, used for namespacing (prefer kebab-case)"),displayName:G.string().optional().describe('Human-readable name shown in UI (e.g., "GitHub Utils"). Falls back to `name` when omitted. Unlike `name`, may contain spaces and any casing; not used for namespacing or lookup.'),version:G.string().optional().describe("Semantic version (e.g., 1.2.3) following semver.org specification"),description:G.string().optional().describe("Brief, user-facing explanation of what the plugin provides"),author:k8r().optional().describe("Information about the plugin creator or maintainer"),homepage:G.string().url().optional().describe("Plugin homepage or documentation URL"),repository:G.string().optional().describe("Source code repository URL"),license:G.string().optional().describe("SPDX license identifier (e.g., MIT, Apache-2.0)"),keywords:G.array(G.string()).optional().describe("Tags for plugin discovery and categorization"),defaultEnabled:G.boolean().optional().describe("Whether the plugin starts enabled when the user has no explicit enabled/disabled setting for it (default: true). Explicit enabledPlugins values always win, and a plugin required by an enabled dependent is enabled regardless of this value."),dependencies:G.array(DHc()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),W4h=xr(()=>G.object({description:G.string().optional().describe("Brief, user-facing explanation of what these hooks provide"),hooks:G.lazy(()=>yTt()).describe("The hooks provided by the plugin, in the same format as the one used for settings")})),lHc=xr(()=>G.object({hooks:G.union([Vne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>yTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)"),G.array(G.union([Vne().describe("Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root"),G.lazy(()=>yTt()).describe("Additional hooks (in addition to those in hooks/hooks.json, if it exists)")]))])})),uHc=xr(()=>G.object({source:NLr().optional().describe("Path to command markdown file, relative to plugin root"),content:G.string().optional().describe("Inline markdown content for the command"),description:G.string().optional().describe("Command description override"),argumentHint:G.string().optional().describe('Hint for command arguments (e.g., "[file]")'),model:G.string().optional().describe("Default model for this command"),allowedTools:G.array(G.string()).optional().describe("Tools allowed when command runs")}).refine(t=>t.source&&!t.content||!t.source&&t.content,{message:'Command must have either "source" (file path) or "content" (inline markdown), but not both'})),dHc=xr(()=>G.object({commands:G.union([NLr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(NLr().describe("Path to a command file or skill directory, relative to the plugin root. When set, the commands/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of command file or skill directory paths. When set, the commands/ directory is not auto-loaded."),G.record(G.string(),uHc()).describe('Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" \u2192 "/plugin:about")')])})),fHc=xr(()=>G.object({agents:G.union([DLr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(DLr().describe("Path to an agent file, relative to the plugin root. When set, the agents/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of agent file paths. When set, the agents/ directory is not auto-loaded.")])})),pHc=xr(()=>G.object({skills:G.union([lN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory."),G.array(lN().describe("Path to a skill directory, relative to the plugin root. Loaded in addition to the skills/ directory.")).describe("List of skill directory paths, loaded in addition to the skills/ directory.")])})),jZi=xr(()=>G.object({outputStyles:G.union([lN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(lN().describe("Path to an output-styles directory or file, relative to the plugin root. When set, the output-styles/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of output-style directory or file paths. When set, the output-styles/ directory is not auto-loaded.")])})),HZi=xr(()=>G.object({themes:G.union([lN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both."),G.array(lN().describe("Path to a themes directory or file, relative to the plugin root. When set, the themes/ directory is not auto-loaded \u2014 list its files here if you want both.")).describe("List of theme directory or file paths. When set, the themes/ directory is not auto-loaded.")])})),hHc=xr(()=>G.object({})),I$i=xr(()=>G.string().min(1)),mHc=xr(()=>G.string().min(2).refine(t=>t.startsWith("."),{message:'File extensions must start with dot (e.g., ".ts", not "ts")'})),gHc=xr(()=>G.object({mcpServers:G.union([Vne().describe("MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)"),T$i().describe("Path or URL to MCPB file containing MCP server configuration"),G.record(G.string(),kLr()).describe("MCP server configurations keyed by server name"),G.array(G.union([Vne().describe("Path to MCP servers configuration file"),T$i().describe("Path or URL to MCPB file"),G.record(G.string(),kLr()).describe("Inline MCP server configurations")])).describe("Array of MCP server configurations (paths, MCPB files, or inline definitions)")])})),GZi=xr(()=>G.object({type:G.enum(["string","number","boolean","directory","file"]).describe("Type of the configuration value"),title:G.string().describe("Human-readable label shown in the config dialog"),description:G.string().describe("Help text shown beneath the field in the config dialog"),required:G.boolean().optional().describe("If true, validation fails when this field is empty"),default:G.union([G.string(),G.number(),G.boolean(),G.array(G.string())]).optional().describe("Default value used when the user provides nothing"),multiple:G.boolean().optional().describe("For string type: allow an array of strings"),sensitive:G.boolean().optional().describe("If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json"),min:G.number().optional().describe("Minimum value (number type only)"),max:G.number().optional().describe("Maximum value (number type only)")}).strict()),AHc=xr(()=>G.object({userConfig:G.record(G.string().regex(/^[A-Za-z_]\w*$/,"Option keys must be valid identifiers (letters, digits, underscore; no leading digit) \u2014 they become CLAUDE_PLUGIN_OPTION_ env vars in hooks"),GZi()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage. Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Keep sensitive value counts small.")})),yHc=xr(()=>G.object({channels:G.array(G.object({server:G.string().min(1).describe("Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers."),displayName:G.string().optional().describe('Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.'),userConfig:G.record(G.string(),GZi()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe("Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.")})),x$i=xr(()=>G.strictObject({command:G.string().min(1).refine(t=>!(t.includes(" ")&&!t.startsWith("/")),{message:"Command should not contain spaces. Use args array for arguments."}).describe('Command to execute the LSP server (e.g., "typescript-language-server")'),args:G.array(I$i()).optional().describe("Command-line arguments to pass to the server"),extensionToLanguage:G.record(mHc(),I$i()).refine(t=>Object.keys(t).length>0,{message:"extensionToLanguage must have at least one mapping"}).describe("Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping."),transport:G.enum(["stdio","socket"]).default("stdio").describe("Communication transport mechanism"),env:G.record(G.string(),G.string()).optional().describe("Environment variables to set when starting the server"),initializationOptions:G.unknown().optional().describe("Initialization options passed to the server during initialization"),settings:G.unknown().optional().describe("Settings passed to the server via workspace/didChangeConfiguration"),workspaceFolder:G.string().optional().describe("Workspace folder path to use for the server"),startupTimeout:G.number().int().positive().optional().describe("Maximum time to wait for server startup (milliseconds)"),shutdownTimeout:G.number().int().positive().optional().describe("Maximum time to wait for graceful shutdown (milliseconds)"),restartOnCrash:G.boolean().optional().describe("Whether to restart the server if it crashes"),maxRestarts:G.number().int().nonnegative().optional().describe("Maximum number of restart attempts before giving up")})),EHc=xr(()=>G.strictObject({name:G.string().min(1).describe("Identifier for this monitor, unique within the plugin. Used to dedupe so re-arming (plugin reload, repeat skill invoke) does not spawn duplicates."),command:G.string().min(1).describe('Shell command to run as a persistent background monitor. Each stdout line is delivered to the model as a event; the process runs for the session lifetime. ${CLAUDE_PLUGIN_ROOT}, ${CLAUDE_PLUGIN_DATA}, ${CLAUDE_PROJECT_DIR}, ${user_config.*}, and ${ENV_VAR} are substituted. Runs in the session cwd \u2014 prefix with `cd "${CLAUDE_PLUGIN_ROOT}" && ` if the script needs its own directory.'),description:G.string().min(1).describe("Short human-readable description of what is being monitored (shown in task panel and notification summary)."),when:G.union([G.literal("always"),G.string().startsWith("on-skill-invoke:").refine(t=>t.length>16,{message:"on-skill-invoke: must specify a skill name"})]).default("always").describe('Arm trigger. "always" arms at session start and on plugin reload. "on-skill-invoke:" arms the first time that skill is dispatched (via Skill tool or slash command).')})),_Hc=xr(()=>G.array(EHc()).refine(t=>new Set(t.map(e=>e.name)).size===t.length,{message:"Monitor names must be unique within a plugin"})),$Zi=xr(()=>G.object({monitors:G.union([Vne().describe("Path to a JSON file containing the monitors array, relative to the plugin root"),_Hc()]).describe("Background watch scripts the host arms as persistent Monitor tasks (unsandboxed, same trust tier as hooks) so plugins need not instruct the model to arm them. When omitted, monitors/monitors.json at the plugin root is loaded if present.")})),vHc=xr(()=>G.object({lspServers:G.union([Vne().describe("Path to .lsp.json configuration file relative to plugin root"),G.record(G.string(),x$i()).describe("LSP server configurations keyed by server name"),G.array(G.union([Vne().describe("Path to LSP configuration file"),G.record(G.string(),x$i()).describe("Inline LSP server configurations")])).describe("Array of LSP server configurations (paths or inline definitions)")])})),VZi=xr(()=>G.string().refine(t=>!t.includes("..")&&!t.includes("//"),"Package name cannot contain path traversal patterns").refine(t=>{let e=/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/,r=/^[a-z0-9][a-z0-9-._]*$/;return e.test(t)||r.test(t)},"Invalid npm package name format")),CHc=xr(()=>G.object({settings:G.record(G.string(),G.unknown()).optional().describe("Settings to merge into the user settings while this plugin is enabled. Only the documented allowlisted keys are applied.")})),bHc=xr(()=>G.object({experimental:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,G.object({...HZi().partial().shape,...$Zi().partial().shape,...jZi().partial().shape,evals:G.union([G.string(),G.array(G.string())]).optional().describe("Path(s) to evaluation query files for `claude plugin eval`. Defaults to `evals/`.")}).optional().describe("Components whose manifest shape may change without a deprecation cycle. Move a key out of here once it is promoted to stable."))})),SHc=xr(()=>G.object({...cHc().shape,...lHc().partial().shape,...dHc().partial().shape,...fHc().partial().shape,...pHc().partial().shape,...jZi().partial().shape,...HZi().partial().shape,...hHc().shape,...yHc().partial().shape,...gHc().partial().shape,...vHc().partial().shape,...$Zi().partial().shape,...CHc().partial().shape,...AHc().partial().shape,...bHc().partial().shape})),ETt=xr(()=>G.discriminatedUnion("source",[G.object({source:G.literal("url"),url:G.string().url().describe("Direct URL to marketplace.json file"),headers:G.record(G.string(),G.string()).optional().describe("Custom HTTP headers (e.g., for authentication)")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("git"),url:G.string().describe("Full git repository URL"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),path:G.string().optional().describe("Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"),sparsePaths:G.array(G.string()).optional().describe('Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.'),skipLfs:G.boolean().optional().describe("Skip Git LFS smudge during clone and update (sets GIT_LFS_SKIP_SMUDGE=1) so LFS pointer files stay as pointers instead of downloading their content. Use for marketplaces hosted in repos with large LFS objects.")}),G.object({source:G.literal("npm"),package:VZi().describe("NPM package containing marketplace.json")}),G.object({source:G.literal("file"),path:G.string().describe("Local file path to marketplace.json")}),G.object({source:G.literal("directory"),path:G.string().describe("Local directory containing .claude-plugin/marketplace.json")}),G.object({source:G.literal("skills-dir")}).describe("Policy-list sentinel for the ~/.claude/skills/ auto-load (@skills-dir plugins). In strictKnownMarketplaces: opt the scan back IN (by default any allowlist blocks it). In blockedMarketplaces: turn the scan OFF without otherwise restricting marketplaces. Only meaningful in those two managed-settings lists (areLocalPluginDirsAllowedByPolicy); known_marketplaces.json / marketplace add etc. ignore it."),G.object({source:G.literal("hostPattern"),hostPattern:G.string().describe('Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").')}),G.object({source:G.literal("pathPattern"),pathPattern:G.string().describe('Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.')}),G.object({source:G.literal("settings"),name:qZi().refine(t=>!QZi.has(t.toLowerCase()),{message:"Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false."}).describe("Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection \u2014 validateOfficialNameSource runs after the disk write, too late to clean up."),plugins:G.array(THc()).describe("Plugin entries declared inline in settings.json"),owner:k8r().optional()}).describe("Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).")])),gBr=xr(()=>G.string().length(40).regex(/^[a-f0-9]{40}$/,"Must be a full 40-character lowercase git commit SHA")),WZi=xr(()=>G.union([lN().describe("Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)"),G.object({source:G.literal("npm"),package:VZi().or(G.string().refine(t=>/^(?:file|https?|git(?:\+https?|\+ssh)?|ssh|github|gitlab|bitbucket):/i.test(t)||!t.includes(".."),'Package reference cannot contain ".." path segments')).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:G.string().optional().describe("Specific version or version range (e.g., ^1.0.0, ~2.1.0)"),registry:G.string().url().optional().describe("Custom NPM registry URL (defaults to using system default, likely npmjs.org)")}).describe("NPM package as plugin source"),G.object({source:G.literal("url"),url:G.string().describe("Full git repository URL (https:// or git@)"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gBr().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("github"),repo:G.string().describe("GitHub repository in owner/repo format"),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gBr().optional().describe("Specific commit SHA to use")}),G.object({source:G.literal("git-subdir"),url:G.string().describe("Git repository: GitHub owner/repo shorthand, https://, or git@ URL"),path:G.string().min(1).describe('Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.'),ref:G.string().optional().describe('Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.'),sha:gBr().optional().describe("Specific commit SHA to use")}).describe("Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded."),G.object({source:G.literal("unsupported")}).describe('Placeholder for source types this Claude Code version does not recognize. Never authored by hand \u2014 PluginMarketplaceSchema rewrites unparseable sources to this so the entry remains in marketplace.plugins (detectDelistedPlugins must not see it as removed). Install attempts fail at cachePlugin with a clear "update Claude Code" message.')])),THc=xr(()=>G.object({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Plugin name as it appears in the target repository"),source:WZi().describe("Where to fetch the plugin from. Must be a remote source \u2014 relative paths have no marketplace repository to resolve against."),description:G.string().optional(),version:G.string().optional(),strict:G.boolean().optional()}).refine(t=>typeof t.source!="string",{message:'Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url). Relative-path sources like "./foo" have no marketplace repository to resolve against.'}).refine(t=>typeof t.source=="string"||t.source.source!=="unsupported",{message:"source.source: 'unsupported' is a parse-time placeholder and cannot be authored. Use a remote source (github, git-subdir, npm, url)."})),IHc=xr(()=>G.object({cli:G.array(G.string().max(64)).max(10).optional().describe('First command tokens (e.g. ["stripe"]) \u2014 exact match against commands run this session.'),hosts:G.array(G.string().max(128)).max(20).optional().describe('Hostnames (e.g. ["api.stripe.com"]) \u2014 exact, case-insensitive match against hostnames seen in https?:// URLs in bash commands run this session. Bare hostname only: lowercase, no scheme, no port, no path.'),filesRead:G.array(G.string().max(256)).max(10).optional().describe('Glob patterns (e.g. ["**/*.tf"]) \u2014 the plugin is relevant when a file Claude has read this session matches any pattern. Matched against read-file paths, forward-slash normalized, case-insensitive.'),manifestDeps:G.array(G.object({file:G.string().max(256),pattern:G.string().max(256)})).max(10).optional().describe("Dependency declared in a package manifest. Each {file, pattern} is a pair of RegExp sources: `file` matches the manifest filename (package.json, go.mod, requirements.txt, \u2026); `pattern` matches the dependency declaration inside that file. Evaluated against files read this session."),cwd:G.array(G.string().max(256)).max(10).optional().describe(`Glob patterns (e.g. ["Engine/Source/Runtime/Renderer/**"]) \u2014 the plugin is relevant when the session's working directory is at or under a directory matching the pattern. Matched against the cwd both relative to the enclosing git repo root and as an absolute path, forward-slash normalized, case-insensitive. A bare directory (no glob characters) means "cwd is at or under this directory". Known at session start, so this signal can surface a suggestion before the first turn.`)})),xHc=xr(()=>G.object({topic:G.string().max(64).optional().describe('What the user is working with when this plugin is relevant \u2014 fills "Working with {topic}?". Often the product name (e.g. "Stripe"); use a domain (e.g. "design") when the plugin name does not read naturally as a topic. Defaults to the plugin name with each hyphen-segment capitalized.'),signals:IHc().optional().describe("Matchers that determine when the plugin is relevant.")})),wHc=xr(()=>SHc().partial().extend({name:G.string().min(1,"Plugin name cannot be empty").refine(t=>!t.includes(" "),{message:'Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")'}).describe("Unique identifier matching the plugin name"),source:WZi().describe("Where to fetch the plugin from"),category:G.string().optional().describe('Category for organizing plugins (e.g., "productivity", "development")'),tags:G.array(G.string()).optional().describe("Tags for searchability and discovery"),strict:G.boolean().optional().default(!0).describe("Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest."),relevance:G.preprocess(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0,xHc().optional()).describe(`Declares when this plugin is relevant to the user's work. Consumed by the spinner tip ("Working with {topic}?"), session-start auto-suggest, and marketplace browse ranking.`)})),RHc=xr(()=>G.object({name:G.string().min(1).refine(t=>!t.includes(" "))}));a(PHc,"z$$");z4h=xr(()=>G.object({$schema:G.string().optional().describe("JSON Schema reference for editor autocomplete/validation; ignored at load time"),name:qZi(),version:G.string().optional().describe("Marketplace manifest version"),description:G.string().optional().describe("Human-readable description of this marketplace"),owner:k8r().describe("Marketplace maintainer or curator information"),plugins:G.array(G.unknown()).transform(PHc).describe("Collection of available plugins in this marketplace"),forceRemoveDeletedPlugins:G.boolean().optional().describe("When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users"),metadata:G.object({pluginRoot:G.string().optional().describe("Base path for relative plugin sources"),version:G.string().optional().describe("Marketplace version"),description:G.string().optional().describe("Marketplace description")}).optional().describe("Optional marketplace metadata"),allowCrossMarketplaceDependenciesOn:G.array(G.string()).optional().describe("Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies \u2014 no transitive trust.")})),zZi=xr(()=>G.string().regex(/^[A-Za-z0-9][-A-Za-z0-9._]*@[A-Za-z0-9][-A-Za-z0-9._]*$/,"Plugin ID must be in format: plugin@marketplace")),kHc=/^[A-Za-z0-9][-A-Za-z0-9._]*(@[A-Za-z0-9][-A-Za-z0-9._]*)?(@\^[^@]*)?$/,DHc=xr(()=>G.union([G.string().regex(kHc,"Dependency must be a plugin name, optionally qualified with @marketplace").transform(t=>t.replace(/@\^[^@]*$/,"")),G.object({name:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/),marketplace:G.string().min(1).regex(/^[A-Za-z0-9][-A-Za-z0-9._]*$/).optional()}).loose().transform(t=>t.marketplace?`${t.name}@${t.marketplace}`:t.name)])),NHc=xr(()=>G.object({version:G.string().describe("Currently installed version"),installedAt:G.string().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),installPath:G.string().describe("Absolute path to the installed plugin directory"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins (for version tracking)"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to (when fetched via a version constraint). Used by verifyAndDemote in preference to manifest.version, since the upstream may have forgotten to bump plugin.json."),auto:G.boolean().optional().describe("True when this plugin was pulled in as a dependency rather than installed explicitly. Auto-installed plugins are eligible for removal by the orphan sweep when nothing depends on them. Absent = manual (preserves pre-flag installs).")})),MHc=xr(()=>G.object({version:G.literal(1).describe("Schema version 1"),plugins:G.record(zZi(),NHc()).describe("Map of plugin IDs to their installation metadata")})),OHc=xr(()=>G.enum(["managed","user","project","local"])),BHc=xr(()=>G.object({scope:OHc().describe("Installation scope"),projectPath:G.string().optional().describe("Project path (required for project/local scopes)"),installPath:G.string().describe("Absolute path to the versioned plugin directory"),version:G.string().optional().describe("Currently installed version"),installedAt:G.string().optional().describe("ISO 8601 timestamp of installation"),lastUpdated:G.string().optional().describe("ISO 8601 timestamp of last update"),gitCommitSha:G.string().optional().describe("Git commit SHA for git-based plugins"),resolvedVersion:G.string().optional().describe("Tag-derived semver this install resolved to"),auto:G.boolean().optional().describe("True when pulled in as a dependency. Eligible for orphan sweep.")})),LHc=xr(()=>G.object({version:G.literal(2).describe("Schema version 2"),plugins:G.record(zZi(),G.array(BHc())).describe("Map of plugin IDs to arrays of installation entries")})),Y4h=xr(()=>G.union([MHc(),LHc()])),FHc=xr(()=>G.object({source:ETt().describe("Where to fetch the marketplace from"),installLocation:G.string().describe("Local cache path where marketplace manifest is stored"),lastUpdated:G.string().describe("ISO 8601 timestamp of last marketplace refresh"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),K4h=xr(()=>G.record(G.string(),FHc())),UHc=["userSettings","projectSettings","localSettings","flagSettings","policySettings"],QHc="https://json.schemastore.org/claude-code-settings.json",qHc=["autoMode","deepLink","voice","assistant","briefView"],tSt={},hIt={autoMode:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>tSt,"shape"),permissionsShape:a(()=>tSt,"permissionsShape"),permissionModes:a(()=>[],"permissionModes")},deepLink:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({disableDeepLinkRegistration:G.enum(["disable"]).optional().describe("Prevent claude-cli:// protocol handler registration with the OS")}),"shape")},voice:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>tSt,"shape")},assistant:{buildGate:a(()=>!1,"buildGate"),shape:a(()=>tSt,"shape")},briefView:{buildGate:a(()=>!0,"buildGate"),shape:a(()=>({defaultView:G.enum(["chat","transcript"]).optional().describe("Default transcript view: chat (SendUserMessage checkpoints only) or transcript (full)")}),"shape")}};a(YZi,"Ez");a(jHc,"tE");a(HHc,"aE");a(GHc,"sE");a($Hc,"eE");w$i={Task:"Agent",KillShell:"TaskStop",AgentOutputTool:"TaskOutput",BashOutputTool:"TaskOutput",ListPeers:"ListAgents",Brief:"SendUserMessage"};a(EEe,"E9");KZi="workspace",J4h=`mcp__${KZi}__bash`,Z4h=`mcp__${KZi}__web_fetch`;a(VHc,"A$$");a(WHc,"Jb");a(zHc,"I$$");a(YHc,"R$$");_Tt={filePatternTools:["Read","Write","Edit","Glob","NotebookRead","NotebookEdit"],bashPrefixTools:["Bash"],customValidation:{WebSearch:a(t=>t.includes("*")||t.includes("?")?{valid:!1,error:"WebSearch does not support wildcards",suggestion:"Use exact search terms without * or ?",examples:["WebSearch(claude ai)","WebSearch(typescript tutorial)"]}:{valid:!0},"WebSearch"),WebFetch:a(t=>t.includes("://")||t.startsWith("http")?{valid:!1,error:"WebFetch permissions use domain format, not URLs",suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:github.com)"]}:t.startsWith("domain:")?{valid:!0}:{valid:!1,error:'WebFetch permissions must use "domain:" prefix',suggestion:'Use "domain:hostname" format',examples:["WebFetch(domain:example.com)","WebFetch(domain:*.google.com)"]},"WebFetch")}};a(KHc,"Xb");a(JHc,"Yb");a(ZHc,"Wb");a(JZi,"Gb");a(ABr,"bz");a(XHc,"P$$");a(ZZi,"_z");yBr=xr(()=>G.string().superRefine((t,e)=>{let r=ZZi(t);if(!r.valid){let n=r.error;r.suggestion&&(n+=`. ${r.suggestion}`),r.examples&&r.examples.length>0&&(n+=`. Examples: ${r.examples.join(", ")}`),e.addIssue({code:G.ZodIssueCode.custom,message:n,params:{received:t}})}})),eGc=xr(()=>G.record(G.string(),G.coerce.string()));a(XZi,"Hb");X4h=xr(()=>XZi(YZi())),tGc=xr(()=>G.object({source:ETt().describe("Where to fetch the marketplace from"),installLocation:G.string().optional().describe("Local cache path where marketplace manifest is stored (auto-generated if not provided)"),autoUpdate:G.boolean().optional().describe("Whether to automatically update this marketplace and its installed plugins on startup")})),eXi=xr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that users are allowed to configure"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for allowed stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for allowed remote MCP servers')}).refine(t=>ezi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),tXi=xr(()=>G.object({serverName:G.string().regex(/^[a-zA-Z0-9_-]+$/,"Server name can only contain letters, numbers, hyphens, and underscores").optional().describe("Name of the MCP server that is explicitly blocked"),serverCommand:G.array(G.string()).min(1,"Server command must have at least one element (the command)").optional().describe("Command array [command, ...args] to match exactly for blocked stdio servers"),serverUrl:G.string().optional().describe('URL pattern with wildcard support (e.g., "https://*.example.com/*") for blocked remote MCP servers')}).refine(t=>ezi([t.serverName!==void 0,t.serverCommand!==void 0,t.serverUrl!==void 0],Boolean)===1,{message:'Entry must have exactly one of "serverName", "serverCommand", or "serverUrl"'})),rGc=xr(()=>G.object({path:G.string().describe("Absolute path to the helper executable"),timeoutMs:G.number().int().min(1e3).optional(),refreshIntervalMs:G.union([G.literal(0),G.number().int().min(6e4)]).optional()})),R$i=["skills","agents","hooks","mcp"];a(nGc,"Kb");f_e=xr(()=>nGc(YZi())),e9="https://code.claude.com/docs/en",iGc=[{matches:a(t=>t.path==="permissions.defaultMode"&&t.code==="invalid_value","matches"),tip:{suggestion:'Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)',docLink:`${e9}/iam#permission-modes`}},{matches:a(t=>t.path==="apiKeyHelper"&&t.code==="invalid_type","matches"),tip:{suggestion:'Provide a shell command that outputs your API key to stdout. The script should output only the API key. Example: "/bin/generate_temp_api_key.sh"'}},{matches:a(t=>t.path==="cleanupPeriodDays"&&t.code==="too_small","matches"),tip:{suggestion:'cleanupPeriodDays must be at least 1. To keep transcripts for a long time, set a large number (e.g. 3650 for ~10 years). To disable transcript writes entirely, remove this setting and use the --no-session-persistence CLI flag or the SDK persistSession:false option instead. (0 is rejected because it previously silently disabled all transcript writes, which users setting it to mean "never clean up" did not expect.)'}},{matches:a(t=>t.path.startsWith("env.")&&t.code==="invalid_type","matches"),tip:{suggestion:'Environment variables must be strings. Wrap numbers and booleans in quotes. Example: "DEBUG": "true", "PORT": "3000"',docLink:`${e9}/settings#environment-variables`}},{matches:a(t=>(t.path==="permissions.allow"||t.path==="permissions.deny")&&t.code==="invalid_type"&&t.expected==="array","matches"),tip:{suggestion:'Permission rules must be in an array. Format: ["Tool(specifier)"]. Examples: ["Bash(npm run build)", "Edit(docs/**)", "Read(~/.zshrc)"]. Use * for wildcards.'}},{matches:a(t=>t.path.startsWith("hooks.")&&t.code==="invalid_key","matches"),tip:{suggestion:"Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",docLink:`${e9}/hooks`}},{matches:a(t=>/\.hooks\.\d+\.command$/.test(t.path)&&t.code==="invalid_type"&&t.received==="undefined","matches"),tip:{suggestion:'Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {"type": "command", "command": "echo", "args": ["hi"]}. For shell form, set `command` to the full shell string: {"type": "command", "command": "echo hi"}.',docLink:`${e9}/hooks#exec-form-and-shell-form`}},{matches:a(t=>t.path.includes("hooks")&&t.code==="invalid_type","matches"),tip:{suggestion:'Hooks use a matcher + hooks array. The matcher is a string: a tool name ("Bash"), pipe-separated list ("Edit|Write"), or empty to match all. Example: {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "echo Done"}]}]}'}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="boolean","matches"),tip:{suggestion:'Use true or false without quotes. Example: "includeCoAuthoredBy": true'}},{matches:a(t=>t.code==="unrecognized_keys","matches"),tip:{suggestion:"Check for typos or refer to the documentation for valid fields",docLink:`${e9}/settings`}},{matches:a(t=>t.code==="invalid_value"&&t.enumValues!==void 0,"matches"),tip:{suggestion:void 0}},{matches:a(t=>t.code==="invalid_type"&&t.expected==="object"&&t.received===null&&t.path==="","matches"),tip:{suggestion:"Check for missing commas, unmatched brackets, or trailing commas. Use a JSON validator to identify the exact syntax error."}},{matches:a(t=>t.path==="permissions.additionalDirectories"&&t.code==="invalid_type","matches"),tip:{suggestion:'Must be an array of directory paths. Example: ["~/projects", "/tmp/workspace"]. You can also use --add-dir flag or /add-dir command',docLink:`${e9}/iam#working-directories`}}],oGc={permissions:`${e9}/iam#configuring-permissions`,env:`${e9}/settings#environment-variables`,hooks:`${e9}/hooks`};a(sGc,"qb");eBh=xr(()=>f_e().strict());a(P$i,"Vb");a(k$i,"Bb");a(aGc,"v$$");a(D$i,"zb");a(REe,"b9");a(N$i,"Nb");a(oFe,"d0");a(cGc,"C$$");lGc=new Set(MTt);a(uGc,"x$$");dGc=[{key:"allowedMcpServers",schema:eXi},{key:"deniedMcpServers",schema:tXi}];a(fGc,"f$$");a(p_e,"i1");M$i="com.anthropic.claudecode",MLr="HKLM\\SOFTWARE\\Policies\\ClaudeCode",OLr="HKCU\\SOFTWARE\\Policies\\ClaudeCode",TEe="Settings",pGc="/usr/bin/plutil",hGc=["-convert","json","-o","-","--"],mGc=5e3,O$i="/mnt/c/Windows/System32/reg.exe",vTt="/mnt/c/Program Files/ClaudeCode";a(nXi,"XG");a(gGc,"Zb");AGc=null;a(ZLe,"$5");a(yGc,"Mb");a(EGc,"Lb");cV=Object.freeze({settings:{},errors:[]}),sXi=null,aXi=null,cXi=!1,CTt=null;a(_Gc,"l$$");a(vGc,"bb");a(CGc,"_b");a(bGc,"kb");a(SGc,"Sb");a(EBr,"Cz");a(B$i,"jb");a(TGc,"c$$");a(IGc,"p$$");a(L$i,"Ab");a(xGc,"d$$");a(F$i,"Ib");a(wGc,"i$$");BLr=wGc;a(RGc,"n$$");PGc=RGc,kGc=PGc(),DGc=kGc;a(NGc,"o$$");MGc=NGc,OGc="[object Object]",BGc=Function.prototype,LGc=Object.prototype,lXi=BGc.toString,FGc=LGc.hasOwnProperty,UGc=lXi.call(Object);a(QGc,"Q6$");qGc=QGc;a(jGc,"J6$");LLr=jGc;a(HGc,"X6$");GGc=HGc;a($Gc,"Y6$");VGc=$Gc;a(uXi,"hb");WGc=uXi;a(zGc,"W6$");YGc=zGc,U$i=Math.max;a(KGc,"G6$");dXi=KGc;a(JGc,"U6$");ZGc=JGc,XGc=QSt?function(t,e){return QSt(t,"toString",{configurable:!0,enumerable:!1,value:ZGc(e),writable:!0})}:yWi,e$c=XGc,t$c=800,r$c=16,n$c=Date.now;a(i$c,"B6$");o$c=i$c,s$c=o$c(e$c),fXi=s$c;a(a$c,"N6$");c$c=a$c;a(l$c,"w6$");u$c=l$c;a(d$c,"O6$");f$c=d$c,p$c=f$c(function(t,e,r,n){WGc(t,e,r,n)}),dV=p$c;a(h$c,"F6$");m$c=h$c;a(g$c,"Z6$");A$c=g$c;a(y$c,"M6$");E$c=y$c,Q$i=hV?hV.isConcatSpreadable:void 0;a(_$c,"L6$");v$c=_$c;a(pXi,"$_");C$c=pXi;a(b$c,"j6$");S$c=b$c;a(T$c,"A6$");I$c=T$c,x$c=I$c(function(t,e){return t==null?{}:E$c(t,e)}),_Br=x$c,w$c="remote-settings.json",vBr=null;a(P$c,"b6$");a(k$c,"_6$");a(D$c,"W_");a(D8r,"fz");a(N$c,"S6$");a(mXi,"U_");a(CBr,"xz");a(M$c,"v6$");a(bTt,"HG");a(gXi,"H_");a(AXi,"K_");a(yXi,"q_");a(EXi,"V_");a(O$c,"C6$");a(q$i,"G_");a(B$c,"T6$");a(STt,"Y5");a(L$c,"x6$");a(_Xi,"B_");a(F$c,"y6$");a(U$c,"f6$");a(Q$c,"z_");a(q$c,"g6$");a(vXi,"N_");a(j$c,"h6$");a(H$c,"u6$");a(fV,"o1");bBr=!1;a(G$c,"m6$");a($$c,"l6$");a(V$c,"c6$");a(W$c,"w_");a(z$c,"O_");Y$c={user:"userSettings",project:"projectSettings",local:"localSettings"},j$i={userSettings:"user",projectSettings:"project",localSettings:"local",flagSettings:"flag",policySettings:"managed"},K$c=["user","project","local"],J$c=new Set(["bypassPermissions","auto","acceptEdits"]),Z$c=new Set(["project"]);a(X$c,"o6$");a(eVc,"F_");process.env.NoDefaultCurrentDirectoryInExePath="1";a(tVc,"LA$");a(rVc,"G4$");a(nVc,"U4$");a(iVc,"H4$");a(CXi,"b_");a(FLr,"uz");a(ULr,"mz");oVc=new Set(["EBUSY","EMFILE","ENFILE","ENOTEMPTY","EPERM"]);a(TTt,"KG");a(sVc,"q4$");a(aVc,"jA$");a(cVc,"AA$");a(lVc,"IA$");a(uVc,"RA$");a(dVc,"PA$");a(fVc,"EA$");a(pVc,"bA$");a(hVc,"_A$");a(mVc,"kA$");a(gVc,"SA$");a(H$i,"M_");a(AVc,"V4$");a(yVc,"vA$");a(EVc,"CA$");a(bXi,"__");a(YR,"J4");a(SXi,"k_");a(G$i,"L_");a(QLr,"lz");a(_Vc,"B4$");a($$i,"j_");a(TXi,"S_");a(vVc,"z4$");a(IXi,"v_");a(CVc,"N4$");a(bVc,"w4$");a(SVc,"O4$");a(TVc,"D4$");a(IVc,"F4$");a(xVc,"Z4$");a(wVc,"M4$");a(V$i,"A_")});var Heo=I((o6r,jeo)=>{p();o6r.createWatcher=r8e()("vscode-policy-watcher");if(require.main===jeo){let t=process.platform;o6r.createWatcher(t==="darwin"?"com.visualstudio.code.oss":"CodeOSS",{UpdateMode:{type:"string"},SCMInputFontSize:{type:"number"},DisableFeedback:{type:"boolean"}},e=>console.log(e))}});var Tto=I(p6r=>{p();var Sto="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");p6r.encode=function(t){if(0<=t&&t{p();var Ito=Tto(),h6r=5,xto=1<>1;return e?-r:r}a(Ezc,"fromVLQSigned");m6r.encode=a(function(e){var r="",n,o=yzc(e);do n=o&wto,o>>>=h6r,o>0&&(n|=Rto),r+=Ito.encode(n);while(o>0);return r},"base64VLQ_encode");m6r.decode=a(function(e,r,n){var o=e.length,s=0,c=0,l,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Ito.decode(e.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));l=!!(u&Rto),u&=wto,s=s+(u<{p();function _zc(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}a(_zc,"getArg");WE.getArg=_zc;var Pto=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,vzc=/^data:.+\,.+$/;function OFe(t){var e=t.match(Pto);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}a(OFe,"urlParse");WE.urlParse=OFe;function P_e(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}a(P_e,"urlGenerate");WE.urlGenerate=P_e;function A6r(t){var e=t,r=OFe(t);if(r){if(!r.path)return t;e=r.path}for(var n=WE.isAbsolute(e),o=e.split(/\/+/),s,c=0,l=o.length-1;l>=0;l--)s=o[l],s==="."?o.splice(l,1):s===".."?c++:c>0&&(s===""?(o.splice(l+1,c),c=0):(o.splice(l,2),c--));return e=o.join("/"),e===""&&(e=n?"/":"."),r?(r.path=e,P_e(r)):e}a(A6r,"normalize");WE.normalize=A6r;function kto(t,e){t===""&&(t="."),e===""&&(e=".");var r=OFe(e),n=OFe(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),P_e(r);if(r||e.match(vzc))return e;if(n&&!n.host&&!n.path)return n.host=e,P_e(n);var o=e.charAt(0)==="/"?e:A6r(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=o,P_e(n)):o}a(kto,"join");WE.join=kto;WE.isAbsolute=function(t){return t.charAt(0)==="/"||Pto.test(t)};function Czc(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}a(Czc,"relative");WE.relative=Czc;var Dto=(function(){var t=Object.create(null);return!("__proto__"in t)})();function Nto(t){return t}a(Nto,"identity");function bzc(t){return Mto(t)?"$"+t:t}a(bzc,"toSetString");WE.toSetString=Dto?Nto:bzc;function Szc(t){return Mto(t)?t.slice(1):t}a(Szc,"fromSetString");WE.fromSetString=Dto?Nto:Szc;function Mto(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}a(Mto,"isProtoString");function Tzc(t,e,r){var n=k_e(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:k_e(t.name,e.name)}a(Tzc,"compareByOriginalPositions");WE.compareByOriginalPositions=Tzc;function Izc(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=k_e(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:k_e(t.name,e.name)}a(Izc,"compareByGeneratedPositionsDeflated");WE.compareByGeneratedPositionsDeflated=Izc;function k_e(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}a(k_e,"strcmp");function xzc(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=k_e(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:k_e(t.name,e.name)}a(xzc,"compareByGeneratedPositionsInflated");WE.compareByGeneratedPositionsInflated=xzc;function wzc(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}a(wzc,"parseSourceMapInput");WE.parseSourceMapInput=wzc;function Rzc(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=OFe(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}e=kto(P_e(n),e)}return A6r(e)}a(Rzc,"computeSourceURL");WE.computeSourceURL=Rzc});var _6r=I(Oto=>{p();var y6r=D_e(),E6r=Object.prototype.hasOwnProperty,tie=typeof Map<"u";function d9(){this._array=[],this._set=tie?new Map:Object.create(null)}a(d9,"ArraySet");d9.fromArray=a(function(e,r){for(var n=new d9,o=0,s=e.length;o=0)return r}else{var n=y6r.toSetString(e);if(E6r.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},"ArraySet_indexOf");d9.prototype.at=a(function(e){if(e>=0&&e{p();var Bto=D_e();function Pzc(t,e){var r=t.generatedLine,n=e.generatedLine,o=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=o||Bto.compareByGeneratedPositionsInflated(t,e)<=0}a(Pzc,"generatedPositionAfter");function Qxt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a(Qxt,"MappingList");Qxt.prototype.unsortedForEach=a(function(e,r){this._array.forEach(e,r)},"MappingList_forEach");Qxt.prototype.add=a(function(e){Pzc(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},"MappingList_add");Qxt.prototype.toArray=a(function(){return this._sorted||(this._array.sort(Bto.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},"MappingList_toArray");Lto.MappingList=Qxt});var v6r=I(Uto=>{p();var BFe=g6r(),w0=D_e(),qxt=_6r().ArraySet,kzc=Fto().MappingList;function XR(t){t||(t={}),this._file=w0.getArg(t,"file",null),this._sourceRoot=w0.getArg(t,"sourceRoot",null),this._skipValidation=w0.getArg(t,"skipValidation",!1),this._sources=new qxt,this._names=new qxt,this._mappings=new kzc,this._sourcesContents=null}a(XR,"SourceMapGenerator");XR.prototype._version=3;XR.fromSourceMap=a(function(e){var r=e.sourceRoot,n=new XR({file:e.file,sourceRoot:r});return e.eachMapping(function(o){var s={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(s.source=o.source,r!=null&&(s.source=w0.relative(r,s.source)),s.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(s.name=o.name)),n.addMapping(s)}),e.sources.forEach(function(o){var s=o;r!==null&&(s=w0.relative(r,o)),n._sources.has(s)||n._sources.add(s);var c=e.sourceContentFor(o);c!=null&&n.setSourceContent(o,c)}),n},"SourceMapGenerator_fromSourceMap");XR.prototype.addMapping=a(function(e){var r=w0.getArg(e,"generated"),n=w0.getArg(e,"original",null),o=w0.getArg(e,"source",null),s=w0.getArg(e,"name",null);this._skipValidation||this._validateMapping(r,n,o,s),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:s})},"SourceMapGenerator_addMapping");XR.prototype.setSourceContent=a(function(e,r){var n=e;this._sourceRoot!=null&&(n=w0.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[w0.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[w0.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},"SourceMapGenerator_setSourceContent");XR.prototype.applySourceMap=a(function(e,r,n){var o=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=e.file}var s=this._sourceRoot;s!=null&&(o=w0.relative(s,o));var c=new qxt,l=new qxt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var d=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=w0.join(n,u.source)),s!=null&&(u.source=w0.relative(s,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var f=u.source;f!=null&&!c.has(f)&&c.add(f);var h=u.name;h!=null&&!l.has(h)&&l.add(h)},this),this._sources=c,this._names=l,e.sources.forEach(function(u){var d=e.sourceContentFor(u);d!=null&&(n!=null&&(u=w0.join(n,u)),s!=null&&(u=w0.relative(s,u)),this.setSourceContent(u,d))},this)},"SourceMapGenerator_applySourceMap");XR.prototype._validateMapping=a(function(e,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!o)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:o}))}},"SourceMapGenerator_validateMapping");XR.prototype._serializeMappings=a(function(){for(var e=0,r=1,n=0,o=0,s=0,c=0,l="",u,d,f,h,m=this._mappings.toArray(),g=0,A=m.length;g0){if(!w0.compareByGeneratedPositionsInflated(d,m[g-1]))continue;u+=","}u+=BFe.encode(d.generatedColumn-e),e=d.generatedColumn,d.source!=null&&(h=this._sources.indexOf(d.source),u+=BFe.encode(h-c),c=h,u+=BFe.encode(d.originalLine-1-o),o=d.originalLine-1,u+=BFe.encode(d.originalColumn-n),n=d.originalColumn,d.name!=null&&(f=this._names.indexOf(d.name),u+=BFe.encode(f-s),s=f)),l+=u}return l},"SourceMapGenerator_serializeMappings");XR.prototype._generateSourcesContent=a(function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=w0.relative(r,n));var o=w0.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)},"SourceMapGenerator_generateSourcesContent");XR.prototype.toJSON=a(function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},"SourceMapGenerator_toJSON");XR.prototype.toString=a(function(){return JSON.stringify(this.toJSON())},"SourceMapGenerator_toString");Uto.SourceMapGenerator=XR});var Qto=I(rie=>{p();rie.GREATEST_LOWER_BOUND=1;rie.LEAST_UPPER_BOUND=2;function C6r(t,e,r,n,o,s){var c=Math.floor((e-t)/2)+t,l=o(r,n[c],!0);return l===0?c:l>0?e-c>1?C6r(c,e,r,n,o,s):s==rie.LEAST_UPPER_BOUND?e1?C6r(t,c,r,n,o,s):s==rie.LEAST_UPPER_BOUND?c:t<0?-1:t}a(C6r,"recursiveSearch");rie.search=a(function(e,r,n,o){if(r.length===0)return-1;var s=C6r(-1,r.length,e,r,n,o||rie.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s},"search")});var jto=I(qto=>{p();function b6r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a(b6r,"swap");function Dzc(t,e){return Math.round(t+Math.random()*(e-t))}a(Dzc,"randomIntInRange");function S6r(t,e,r,n){if(r{p();var qn=D_e(),T6r=Qto(),N_e=_6r().ArraySet,Nzc=g6r(),LFe=jto().quickSort;function Ed(t,e){var r=t;return typeof t=="string"&&(r=qn.parseSourceMapInput(t)),r.sections!=null?new yN(r,e):new Ay(r,e)}a(Ed,"SourceMapConsumer");Ed.fromSourceMap=function(t,e){return Ay.fromSourceMap(t,e)};Ed.prototype._version=3;Ed.prototype.__generatedMappings=null;Object.defineProperty(Ed.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings},"get")});Ed.prototype.__originalMappings=null;Object.defineProperty(Ed.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:a(function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings},"get")});Ed.prototype._charIsMappingSeparator=a(function(e,r){var n=e.charAt(r);return n===";"||n===","},"SourceMapConsumer_charIsMappingSeparator");Ed.prototype._parseMappings=a(function(e,r){throw new Error("Subclasses must implement _parseMappings")},"SourceMapConsumer_parseMappings");Ed.GENERATED_ORDER=1;Ed.ORIGINAL_ORDER=2;Ed.GREATEST_LOWER_BOUND=1;Ed.LEAST_UPPER_BOUND=2;Ed.prototype.eachMapping=a(function(e,r,n){var o=r||null,s=n||Ed.GENERATED_ORDER,c;switch(s){case Ed.GENERATED_ORDER:c=this._generatedMappings;break;case Ed.ORIGINAL_ORDER:c=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;c.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=qn.computeSourceURL(l,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(e,o)},"SourceMapConsumer_eachMapping");Ed.prototype.allGeneratedPositionsFor=a(function(e){var r=qn.getArg(e,"line"),n={source:qn.getArg(e,"source"),originalLine:r,originalColumn:qn.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var o=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",qn.compareByOriginalPositions,T6r.LEAST_UPPER_BOUND);if(s>=0){var c=this._originalMappings[s];if(e.column===void 0)for(var l=c.originalLine;c&&c.originalLine===l;)o.push({line:qn.getArg(c,"generatedLine",null),column:qn.getArg(c,"generatedColumn",null),lastColumn:qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s];else for(var u=c.originalColumn;c&&c.originalLine===r&&c.originalColumn==u;)o.push({line:qn.getArg(c,"generatedLine",null),column:qn.getArg(c,"generatedColumn",null),lastColumn:qn.getArg(c,"lastGeneratedColumn",null)}),c=this._originalMappings[++s]}return o},"SourceMapConsumer_allGeneratedPositionsFor");jxt.SourceMapConsumer=Ed;function Ay(t,e){var r=t;typeof t=="string"&&(r=qn.parseSourceMapInput(t));var n=qn.getArg(r,"version"),o=qn.getArg(r,"sources"),s=qn.getArg(r,"names",[]),c=qn.getArg(r,"sourceRoot",null),l=qn.getArg(r,"sourcesContent",null),u=qn.getArg(r,"mappings"),d=qn.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=qn.normalize(c)),o=o.map(String).map(qn.normalize).map(function(f){return c&&qn.isAbsolute(c)&&qn.isAbsolute(f)?qn.relative(c,f):f}),this._names=N_e.fromArray(s.map(String),!0),this._sources=N_e.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(f){return qn.computeSourceURL(c,f,e)}),this.sourceRoot=c,this.sourcesContent=l,this._mappings=u,this._sourceMapURL=e,this.file=d}a(Ay,"BasicSourceMapConsumer");Ay.prototype=Object.create(Ed.prototype);Ay.prototype.consumer=Ed;Ay.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=qn.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r1&&(y.source=l+_[1],l+=_[1],y.originalLine=s+_[2],s=y.originalLine,y.originalLine+=1,y.originalColumn=c+_[3],c=y.originalColumn,_.length>4&&(y.name=u+_[4],u+=_[4])),A.push(y),typeof y.originalLine=="number"&&g.push(y)}LFe(A,qn.compareByGeneratedPositionsDeflated),this.__generatedMappings=A,LFe(g,qn.compareByOriginalPositions),this.__originalMappings=g},"SourceMapConsumer_parseMappings");Ay.prototype._findMapping=a(function(e,r,n,o,s,c){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[o]);return T6r.search(e,r,s,c)},"SourceMapConsumer_findMapping");Ay.prototype.computeColumnSpans=a(function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===r.generatedLine){var s=qn.getArg(o,"source",null);s!==null&&(s=this._sources.at(s),s=qn.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var c=qn.getArg(o,"name",null);return c!==null&&(c=this._names.at(c)),{source:s,line:qn.getArg(o,"originalLine",null),column:qn.getArg(o,"originalColumn",null),name:c}}}return{source:null,line:null,column:null,name:null}},"SourceMapConsumer_originalPositionFor");Ay.prototype.hasContentsOfAllSources=a(function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1},"BasicSourceMapConsumer_hasContentsOfAllSources");Ay.prototype.sourceContentFor=a(function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var o=e;this.sourceRoot!=null&&(o=qn.relative(this.sourceRoot,o));var s;if(this.sourceRoot!=null&&(s=qn.urlParse(this.sourceRoot))){var c=o.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(c))return this.sourcesContent[this._sources.indexOf(c)];if((!s.path||s.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(r)return null;throw new Error('"'+o+'" is not in the SourceMap.')},"SourceMapConsumer_sourceContentFor");Ay.prototype.generatedPositionFor=a(function(e){var r=qn.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:qn.getArg(e,"line"),originalColumn:qn.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",qn.compareByOriginalPositions,qn.getArg(e,"bias",Ed.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===n.source)return{line:qn.getArg(s,"generatedLine",null),column:qn.getArg(s,"generatedColumn",null),lastColumn:qn.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},"SourceMapConsumer_generatedPositionFor");jxt.BasicSourceMapConsumer=Ay;function yN(t,e){var r=t;typeof t=="string"&&(r=qn.parseSourceMapInput(t));var n=qn.getArg(r,"version"),o=qn.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new N_e,this._names=new N_e;var s={line:-1,column:0};this._sections=o.map(function(c){if(c.url)throw new Error("Support for url field in sections not implemented.");var l=qn.getArg(c,"offset"),u=qn.getArg(l,"line"),d=qn.getArg(l,"column");if(u{p();var Mzc=v6r().SourceMapGenerator,Hxt=D_e(),Ozc=/(\r?\n)/,Bzc=10,M_e="$$$isSourceNode$$$";function mI(t,e,r,n,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=o??null,this[M_e]=!0,n!=null&&this.add(n)}a(mI,"SourceNode");mI.fromStringWithSourceMap=a(function(e,r,n){var o=new mI,s=e.split(Ozc),c=0,l=a(function(){var m=A(),g=A()||"";return m+g;function A(){return c=0;r--)this.prepend(e[r]);else if(e[M_e]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this},"SourceNode_prepend");mI.prototype.walk=a(function(e){for(var r,n=0,o=this.children.length;n0){for(r=[],n=0;n{p();Gxt.SourceMapGenerator=v6r().SourceMapGenerator;Gxt.SourceMapConsumer=Gto().SourceMapConsumer;Gxt.SourceNode=Vto().SourceNode});var Yto=I((sYh,zto)=>{p();var Lzc=Object.prototype.toString,I6r=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function Fzc(t){return Lzc.call(t).slice(8,-1)==="ArrayBuffer"}a(Fzc,"isArrayBuffer");function Uzc(t,e,r){e>>>=0;var n=t.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(r===void 0)r=n;else if(r>>>=0,r>n)throw new RangeError("'length' is out of bounds");return I6r?Buffer.from(t.slice(e,e+r)):new Buffer(new Uint8Array(t.slice(e,e+r)))}a(Uzc,"fromArrayBuffer");function Qzc(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return I6r?Buffer.from(t,e):new Buffer(t,e)}a(Qzc,"fromString");function qzc(t,e,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return Fzc(t)?Uzc(t,e,r):typeof t=="string"?Qzc(t,e):I6r?Buffer.from(t):new Buffer(t)}a(qzc,"bufferFrom");zto.exports=qzc});var nro=I((iie,P6r)=>{p();var jzc=Wto().SourceMapConsumer,x6r=require("path"),uB;try{uB=require("fs"),(!uB.existsSync||!uB.readFileSync)&&(uB=null)}catch{}var Hzc=Yto();function Kto(t,e){return t.require(e)}a(Kto,"dynamicRequire");var Jto=!1,Zto=!1,w6r=!1,FFe="auto",nie={},UFe={},Gzc=/^data:application\/json[^,]+base64,/,wV=[],RV=[];function k6r(){return FFe==="browser"?!0:FFe==="node"?!1:typeof window<"u"&&typeof XMLHttpRequest=="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}a(k6r,"isInBrowser");function $zc(){return typeof process=="object"&&process!==null&&typeof process.on=="function"}a($zc,"hasGlobalProcessEventEmitter");function Vzc(){return typeof process=="object"&&process!==null?process.version:""}a(Vzc,"globalProcessVersion");function Wzc(){if(typeof process=="object"&&process!==null)return process.stderr}a(Wzc,"globalProcessStderr");function zzc(t){if(typeof process=="object"&&process!==null&&typeof process.exit=="function")return process.exit(t)}a(zzc,"globalProcessExit");function $xt(t){return function(e){for(var r=0;r";var r=this.getLineNumber();if(r!=null){e+=":"+r;var n=this.getColumnNumber();n&&(e+=":"+n)}}var o="",s=this.getFunctionName(),c=!0,l=this.isConstructor(),u=!(this.isToplevel()||l);if(u){var d=this.getTypeName();d==="[object Object]"&&(d="null");var f=this.getMethodName();s?(d&&s.indexOf(d)!=0&&(o+=d+"."),o+=s,f&&s.indexOf("."+f)!=s.length-f.length-1&&(o+=" [as "+f+"]")):o+=d+"."+(f||"")}else l?o+="new "+(s||""):s?o+=s:(o+=e,c=!1);return c&&(o+=" ("+e+")"),o}a(Kzc,"CallSiteToString");function Xto(t){var e={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(r){e[r]=/^(?:is|get)/.test(r)?function(){return t[r].call(t)}:t[r]}),e.toString=Kzc,e}a(Xto,"cloneCallSite");function tro(t,e){if(e===void 0&&(e={nextPosition:null,curPosition:null}),t.isNative())return e.curPosition=null,t;var r=t.getFileName()||t.getScriptNameOrSourceURL();if(r){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/,c=s.test(Vzc())?0:62;n===1&&o>c&&!k6r()&&!t.isEval()&&(o-=c);var l=M6r({source:r,line:n,column:o});e.curPosition=l,t=Xto(t);var u=t.getFunctionName;return t.getFunctionName=function(){return e.nextPosition==null?u():e.nextPosition.name||u()},t.getFileName=function(){return l.source},t.getLineNumber=function(){return l.line},t.getColumnNumber=function(){return l.column+1},t.getScriptNameOrSourceURL=function(){return l.source},t}var d=t.isEval()&&t.getEvalOrigin();return d&&(d=ero(d),t=Xto(t),t.getEvalOrigin=function(){return d}),t}a(tro,"wrapCallSite");function Jzc(t,e){w6r&&(nie={},UFe={});for(var r=t.name||"Error",n=t.message||"",o=r+": "+n,s={nextPosition:null,curPosition:null},c=[],l=e.length-1;l>=0;l--)c.push(` + at `+tro(e[l],s)),s.nextPosition=s.curPosition;return s.curPosition=s.nextPosition=null,o+c.reverse().join("")}a(Jzc,"prepareStackTrace");function rro(t){var e=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(e){var r=e[1],n=+e[2],o=+e[3],s=nie[r];if(!s&&uB&&uB.existsSync(r))try{s=uB.readFileSync(r,"utf8")}catch{s=""}if(s){var c=s.split(/(?:\r\n|\r|\n)/)[n-1];if(c)return r+":"+n+` `+c+` -`+new Array(o).join(" ")+"^"}}return null}a(mro,"getErrorSource");function nJc(t){var e=mro(t),r=ZKc();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),XKc(1)}a(nJc,"printErrorAndExit");function iJc(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return nJc(arguments[1])}return t.apply(this,arguments)}}a(iJc,"shimEmitUncaughtException");var oJc=UV.slice(0),sJc=QV.slice(0);die.wrapCallSite=hro;die.getErrorSource=mro;die.mapSourcePosition=r9r;die.retrieveSourceMap=t9r;die.install=function(t){if(t=t||{},t.environment&&(XFe=t.environment,["node","browser","auto"].indexOf(XFe)===-1))throw new Error("environment "+XFe+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(UV.length=0),UV.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(QV.length=0),QV.unshift(t.retrieveSourceMap)),t.hookRequire&&!X6r()){var e=lro(Z6r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return uie[c]=s,e8e[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(K6r||(K6r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),uro||(uro=!0,Error.prepareStackTrace=rJc),!dro){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=lro(Z6r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&KKc()&&(dro=!0,iJc())}};die.resetRetrieveHandlers=function(){UV.length=0,QV.length=0,UV=oJc.slice(0),QV=sJc.slice(0),t9r=owt(QV),e9r=owt(UV)}});var Aro=I(()=>{p();gro().install()});var lJc={};wi(lJc,{getTokenizer:()=>Ss,getTokenizerAsync:()=>aGe,main:()=>Ero});module.exports=Ca(lJc);p();p();p();p();var Df=class{static{a(this,"LogTarget")}},yB=class{static{a(this,"TelemetryLogSender")}},ge=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Df).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(yB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Dr=new ge("default");p();p();p();var cwt="github.copilot",a9r="github-enterprise";p();var Ds=a((t,e)=>({editorId:t,displayName:e}),"id"),Tro=Ds("unknown","Unknown"),c9r=Ds("eclipse","Eclipse"),l9r=Ds("xcode","Xcode"),_9=Ds("vim","Vim/Neovim"),u9r=Ds("helix","Helix"),Iro={"copilot-eclipse":c9r,Copilot4Eclipse:c9r,"copilot-xcode":l9r,"Copilot for Xcode":l9r,"copilot-vs":Ds("visual-studio","Visual Studio"),"copilot.vim":_9,"copilot.lua":_9,"Github Copilot LSP for Neovim":_9,"coc-github-copilot":_9,"nvim-lspconfig":_9,"copilot-lsp-client-neovim":_9,"neovim-copilot-lsp":_9,"sidekick.nvim":_9,"helix-copilot":u9r,"copilot-helix":u9r,"copilot-sublime":Ds("sublime-text","Sublime Text"),"zed-copilot":Ds("zed","Zed"),RStudio:Ds("rstudio","RStudio"),"obsidian-copilot":Ds("obsidian","Obsidian"),marimo:Ds("marimo","marimo"),"Qt Creator Copilot plugin":Ds("qt-creator","Qt Creator"),"godot-copilot":Ds("godot","Godot"),"kakoune-lsp":Ds("kakoune","Kakoune"),"typora-copilot":Ds("typora","Typora"),"Copilot for Nova":Ds("nova","Nova")},xro={IU:Ds("intellij","IntelliJ IDEA"),IC:Ds("intellij","IntelliJ IDEA"),IE:Ds("intellij","IntelliJ IDEA"),PY:Ds("pycharm","PyCharm"),PC:Ds("pycharm","PyCharm"),PE:Ds("pycharm","PyCharm"),WS:Ds("webstorm","WebStorm"),PS:Ds("phpstorm","PhpStorm"),RD:Ds("rider","Rider"),RM:Ds("rubymine","RubyMine"),CL:Ds("clion","CLion"),GO:Ds("goland","GoLand"),RR:Ds("rustrover","RustRover"),DB:Ds("datagrip","DataGrip"),DS:Ds("dataspell","DataSpell"),AI:Ds("android-studio","Android Studio"),QA:Ds("aqua","Aqua"),MPS:Ds("mps","MPS"),JBC:Ds("jetbrains-client","JetBrains Client"),GW:Ds("jetbrains-gateway","JetBrains Gateway")},d9r="JetBrains-",wro=Ds("jetbrains","JetBrains IDE");function f9r(t){let e=t.plugin.name?.trim();if(!e)return Tro;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(d9r)){let n=xro[r.slice(d9r.length)];if(n)return n}return wro}return Iro[e]??Ds(e,e)}a(f9r,"resolveEditorIdentity");p();p();p();p();p();p();var ik=class{static{a(this,"InlineCompletionsUnification")}},Rro={codeUnification:!1,modelUnification:!1,expAssignments:[]},fie=class extends ik{constructor(){super(...arguments);this.inlineCompletionsUnificationState=Rro;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};p();p();async function doo(){let{getDeviceId:t}=await Promise.resolve().then(()=>ce(G7r()));return t()}a(doo,"loadDeviceId");var CI=class{constructor(e=doo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();var r_="X-Copilot-RelatedPluginVersion-",yie=(G=>(G.Market="X-MSEdge-Market",G.CorpNet="X-FD-Corpnet",G.Build="X-VSCode-Build",G.ApplicationVersion="X-VSCode-AppVersion",G.TargetPopulation="X-VSCode-TargetPopulation",G.ClientId="X-MSEdge-ClientId",G.DevDeviceId="X-VSCode-DevDeviceId",G.ExtensionName="X-VSCode-ExtensionName",G.ExtensionVersion="X-VSCode-ExtensionVersion",G.ExtensionRelease="X-VSCode-ExtensionRelease",G.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",G.Language="X-VSCode-Language",G.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",G.CopilotEngine="X-Copilot-Engine",G.CopilotOverrideEngine="X-Copilot-OverrideEngine",G.CopilotRepository="X-Copilot-Repository",G.CopilotFileType="X-Copilot-FileType",G.CopilotUserKind="X-Copilot-UserKind",G.CopilotDogfood="X-Copilot-Dogfood",G.CopilotCustomModel="X-Copilot-CustomModel",G.CopilotOrgs="X-Copilot-Orgs",G.CopilotTrackingId="X-Copilot-CopilotTrackingId",G.CopilotClientVersion="X-Copilot-ClientVersion",G.CopilotSku="X-GitHub-Copilot-SKU",G.CopilotRelatedPluginVersionCppTools=r_+"msvscodecpptools",G.CopilotRelatedPluginVersionCMakeTools=r_+"msvscodecmaketools",G.CopilotRelatedPluginVersionMakefileTools=r_+"msvscodemakefiletools",G.CopilotRelatedPluginVersionCSharpDevKit=r_+"msdotnettoolscsdevkit",G.CopilotRelatedPluginVersionPython=r_+"mspythonpython",G.CopilotRelatedPluginVersionPylance=r_+"mspythonvscodepylance",G.CopilotRelatedPluginVersionJavaPack=r_+"vscjavavscodejavapack",G.CopilotRelatedPluginVersionJavaManager=r_+"vscjavavscodejavadependency",G.CopilotRelatedPluginVersionTypescript=r_+"vscodetypescriptlanguagefeatures",G.CopilotRelatedPluginVersionTypescriptNext=r_+"msvscodevscodetypescriptnext",G.CopilotRelatedPluginVersionCSharp=r_+"msdotnettoolscsharp",G.CopilotRelatedPluginVersionGithubCopilotChat=r_+"githubcopilotchat",G.CopilotRelatedPluginVersionGithubCopilot=r_+"githubcopilot",G))(yie||{});var foo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},SB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=foo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function Es(t,e){let r=Pm(t,e,"event.CopilotToken");return t.get(Qt).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(Es,"onCopilotToken");function Dwt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(Dwt,"propertiesFromCopilotToken");var Nf=class{constructor(e){this.#e={};this.optedIn=!1;this.ftFlag="";Es(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=Dwt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};var n6e=ce(IB()),i6e=ce(require("os"));var poo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function hoo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` -`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(poo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(hoo,"buildExceptionDetail");function Owt(t,e){let r=t.get(Lr),n=r.getEditorInfo(),o=t.get(Nf),s={"#editor":n.devName??n.name,"#editor_version":C1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":C1(r.getEditorPluginInfo()),"#session_id":t.get(Fa).sessionId,"#machine_id":t.get(Fa).machineId,"#architecture":i6e.arch(),"#os_platform":i6e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(Owt,"buildContext");function ZQr(t,e,r){let n=t.get(ss),o=t.get(Lr).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:Owt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=hoo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,n6e.SHA256)(n6e.enc.Utf16.parse(f.join(` -`))).toString()),c}a(ZQr,"buildPayload");p();var cCe=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var eqr=ce(IB());var nn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},sk=class extends nn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},o6e=class extends nn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var tqr=7*86400*1e3,bN=class{constructor(e=5){this.perWeek=e;this.cache=new nn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-tqr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(rqr(t.replace(/\\/g,"/")),"gi"):new RegExp(rqr(t),"gi"));function goo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(Aoo,"removePropertiesWithPossibleUserInfo");function yoo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(yoo,"redactPaths");function iqr(t,e=moo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=Aoo(s);if(c!==s){r[n]=c;continue}s=goo(s,e);for(let l of e)s=s.replace(l,"");s=yoo(s),r[n]=s}return r}a(iqr,"sanitizeTelemetryProperties");function R9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(R9,"filterTelemetryProperties");p();var vI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:sqr(r,n),verboseLogging:_oo(r,n),testMode:e,simulation:Eoo(n)})}};function v1(t){return t.get(vI).flags.testMode}a(v1,"isRunningInTest");function Eie(t){return v1(t)}a(Eie,"shouldFailForDebugPurposes");function lCe(t){return t.get(vI).flags.debug}a(lCe,"isDebugEnabled");function oqr(t){return t.get(vI).flags.verboseLogging}a(oqr,"isVerboseLoggingEnabled");function sqr(t,e){return t.includes("--debug")||Lwt(e,"DEBUG")}a(sqr,"determineDebugFlag");function Eoo(t){return Lwt(t,"SIMULATION")}a(Eoo,"determineSimulationFlag");function a6e(t){return t.get(vI).flags.simulation}a(a6e,"isRunningInSimulation");function _oo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||Lwt(e,"VERBOSE")||sqr(t,e)}a(_oo,"determineVerboseLoggingEnabled");function Lwt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(Lwt,"determineEnvFlagEnabled");p();var _d=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var lqr=require("os"),uqr=ce(require("path"));function uCe(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(uCe,"redactPaths");var Coo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),voo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function Uwt(t){if(Coo.has(t))return t;for(let e of voo)if(e.test(t))return t;return uCe(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(Uwt,"redactMessage");function c6e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(c6e,"escapeForRegExp");var boo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+c6e((0,lqr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function Fwt(t){return t.replace(boo,"~")}a(Fwt,"redactHomeDir");var dqr="[\\\\/]?([^:)]*)(?=:\\d)",aqr=new RegExp(c6e(uqr.sep),"g"),cqr=new RegExp(c6e(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+dqr,"gi");function Qwt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` -`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(cqr.test(l))o.stack+=` -${uCe(l.replace(cqr,(u,d)=>"./"+d.replace(aqr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` -${uCe(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(c6e(f.replace(/[\\/]$/,""))+dqr,"gi");if(h.test(l)){o.stack+=` -${uCe(l.replace(h,(m,g)=>d+g.replace(aqr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` -${Fwt(l)}`:o.stack+=` - at [redacted]:0:0`}}else r&&s&&(o.stack=Fwt(s));return t.cause instanceof Error&&(o.cause=Qwt(t.cause,e,r,n)),o}a(Qwt,"cloneError");function fqr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(fqr,"errorMessageWithoutPath");function pqr(t,e){return Qwt(t,a(function(n){return Fwt(fqr(n))},"prepareMessage"),!0,e)}a(pqr,"prepareErrorForRestrictedTelemetry");function hqr(t,e,r=!1){return Qwt(t,a(function(o){if(r)return Uwt(fqr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=uCe(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(hqr,"redactError");p();p();var my={};wi(my,{HasPropertyKey:()=>l6e,IsArray:()=>Sp,IsAsyncIterator:()=>qwt,IsBigInt:()=>dCe,IsBoolean:()=>xB,IsDate:()=>GV,IsFunction:()=>jwt,IsIterator:()=>Hwt,IsNull:()=>Gwt,IsNumber:()=>b1,IsObject:()=>Wc,IsRegExp:()=>fCe,IsString:()=>Ol,IsSymbol:()=>$wt,IsUint8Array:()=>wB,IsUndefined:()=>Tp});p();function l6e(t,e){return e in t}a(l6e,"HasPropertyKey");function qwt(t){return Wc(t)&&!Sp(t)&&!wB(t)&&Symbol.asyncIterator in t}a(qwt,"IsAsyncIterator");function Sp(t){return Array.isArray(t)}a(Sp,"IsArray");function dCe(t){return typeof t=="bigint"}a(dCe,"IsBigInt");function xB(t){return typeof t=="boolean"}a(xB,"IsBoolean");function GV(t){return t instanceof globalThis.Date}a(GV,"IsDate");function jwt(t){return typeof t=="function"}a(jwt,"IsFunction");function Hwt(t){return Wc(t)&&!Sp(t)&&!wB(t)&&Symbol.iterator in t}a(Hwt,"IsIterator");function Gwt(t){return t===null}a(Gwt,"IsNull");function b1(t){return typeof t=="number"}a(b1,"IsNumber");function Wc(t){return typeof t=="object"&&t!==null}a(Wc,"IsObject");function fCe(t){return t instanceof globalThis.RegExp}a(fCe,"IsRegExp");function Ol(t){return typeof t=="string"}a(Ol,"IsString");function $wt(t){return typeof t=="symbol"}a($wt,"IsSymbol");function wB(t){return t instanceof globalThis.Uint8Array}a(wB,"IsUint8Array");function Tp(t){return t===void 0}a(Tp,"IsUndefined");function Soo(t){return t.map(e=>u6e(e))}a(Soo,"ArrayType");function Too(t){return new Date(t.getTime())}a(Too,"DateType");function Ioo(t){return new Uint8Array(t)}a(Ioo,"Uint8ArrayType");function xoo(t){return new RegExp(t.source,t.flags)}a(xoo,"RegExpType");function woo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=u6e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=u6e(t[r]);return e}a(woo,"ObjectType");function u6e(t){return Sp(t)?Soo(t):GV(t)?Too(t):wB(t)?Ioo(t):fCe(t)?xoo(t):Wc(t)?woo(t):t}a(u6e,"Visit");function Pu(t){return u6e(t)}a(Pu,"Clone");function _ie(t,e){return e===void 0?Pu(t):Pu({...e,...t})}a(_ie,"CloneType");p();p();p();function d6e(t){return So(t)&&globalThis.Symbol.asyncIterator in t}a(d6e,"IsAsyncIterator");function f6e(t){return So(t)&&globalThis.Symbol.iterator in t}a(f6e,"IsIterator");function Vwt(t){return So(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(Vwt,"IsStandardObject");function p6e(t){return t instanceof globalThis.Promise}a(p6e,"IsPromise");function n_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(n_,"IsDate");function mqr(t){return t instanceof globalThis.Map}a(mqr,"IsMap");function gqr(t){return t instanceof globalThis.Set}a(gqr,"IsSet");function bI(t){return globalThis.ArrayBuffer.isView(t)}a(bI,"IsTypedArray");function Cie(t){return t instanceof globalThis.Uint8Array}a(Cie,"IsUint8Array");function Qi(t,e){return e in t}a(Qi,"HasPropertyKey");function So(t){return t!==null&&typeof t=="object"}a(So,"IsObject");function Ri(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(Ri,"IsArray");function Du(t){return t===void 0}a(Du,"IsUndefined");function RB(t){return t===null}a(RB,"IsNull");function SN(t){return typeof t=="boolean"}a(SN,"IsBoolean");function oi(t){return typeof t=="number"}a(oi,"IsNumber");function h6e(t){return globalThis.Number.isInteger(t)}a(h6e,"IsInteger");function Wg(t){return typeof t=="bigint"}a(Wg,"IsBigInt");function va(t){return typeof t=="string"}a(va,"IsString");function k9(t){return typeof t=="function"}a(k9,"IsFunction");function kB(t){return typeof t=="symbol"}a(kB,"IsSymbol");function S1(t){return Wg(t)||SN(t)||RB(t)||oi(t)||va(t)||kB(t)||Du(t)}a(S1,"IsValueType");var eu;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=So(c);return t.AllowArrayObject?l:l&&!Ri(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?oi(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=Du(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(eu||(eu={}));p();function Roo(t){return globalThis.Object.freeze(t).map(e=>pCe(e))}a(Roo,"ImmutableArray");function koo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=pCe(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=pCe(t[r]);return globalThis.Object.freeze(e)}a(koo,"ImmutableObject");function pCe(t){return Sp(t)?Roo(t):GV(t)?t:wB(t)?t:fCe(t)?t:Wc(t)?koo(t):t}a(pCe,"Immutable");function Tt(t,e){let r=e!==void 0?{...e,...t}:t;switch(eu.InstanceMode){case"freeze":return pCe(r);case"clone":return Pu(r);default:return r}}a(Tt,"CreateType");p();var qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var Cd=Symbol.for("TypeBox.Transform"),ak=Symbol.for("TypeBox.Readonly"),zg=Symbol.for("TypeBox.Optional"),SI=Symbol.for("TypeBox.Hint"),_t=Symbol.for("TypeBox.Kind");function vie(t){return Wc(t)&&t[ak]==="Readonly"}a(vie,"IsReadonly");function GC(t){return Wc(t)&&t[zg]==="Optional"}a(GC,"IsOptional");function Wwt(t){return ia(t,"Any")}a(Wwt,"IsAny");function zwt(t){return ia(t,"Argument")}a(zwt,"IsArgument");function ck(t){return ia(t,"Array")}a(ck,"IsArray");function $V(t){return ia(t,"AsyncIterator")}a($V,"IsAsyncIterator");function VV(t){return ia(t,"BigInt")}a(VV,"IsBigInt");function PB(t){return ia(t,"Boolean")}a(PB,"IsBoolean");function lk(t){return ia(t,"Computed")}a(lk,"IsComputed");function uk(t){return ia(t,"Constructor")}a(uk,"IsConstructor");function Poo(t){return ia(t,"Date")}a(Poo,"IsDate");function dk(t){return ia(t,"Function")}a(dk,"IsFunction");function fk(t){return ia(t,"Integer")}a(fk,"IsInteger");function Zd(t){return ia(t,"Intersect")}a(Zd,"IsIntersect");function WV(t){return ia(t,"Iterator")}a(WV,"IsIterator");function ia(t,e){return Wc(t)&&_t in t&&t[_t]===e}a(ia,"IsKindOf");function m6e(t){return xB(t)||b1(t)||Ol(t)}a(m6e,"IsLiteralValue");function T1(t){return ia(t,"Literal")}a(T1,"IsLiteral");function I1(t){return ia(t,"MappedKey")}a(I1,"IsMappedKey");function Nu(t){return ia(t,"MappedResult")}a(Nu,"IsMappedResult");function P9(t){return ia(t,"Never")}a(P9,"IsNever");function Doo(t){return ia(t,"Not")}a(Doo,"IsNot");function hCe(t){return ia(t,"Null")}a(hCe,"IsNull");function pk(t){return ia(t,"Number")}a(pk,"IsNumber");function Ip(t){return ia(t,"Object")}a(Ip,"IsObject");function zV(t){return ia(t,"Promise")}a(zV,"IsPromise");function YV(t){return ia(t,"Record")}a(YV,"IsRecord");function Mf(t){return ia(t,"Ref")}a(Mf,"IsRef");function Ywt(t){return ia(t,"RegExp")}a(Ywt,"IsRegExp");function DB(t){return ia(t,"String")}a(DB,"IsString");function mCe(t){return ia(t,"Symbol")}a(mCe,"IsSymbol");function x1(t){return ia(t,"TemplateLiteral")}a(x1,"IsTemplateLiteral");function Noo(t){return ia(t,"This")}a(Noo,"IsThis");function Za(t){return Wc(t)&&Cd in t}a(Za,"IsTransform");function w1(t){return ia(t,"Tuple")}a(w1,"IsTuple");function NB(t){return ia(t,"Undefined")}a(NB,"IsUndefined");function ba(t){return ia(t,"Union")}a(ba,"IsUnion");function Moo(t){return ia(t,"Uint8Array")}a(Moo,"IsUint8Array");function Ooo(t){return ia(t,"Unknown")}a(Ooo,"IsUnknown");function Boo(t){return ia(t,"Unsafe")}a(Boo,"IsUnsafe");function Loo(t){return ia(t,"Void")}a(Loo,"IsVoid");function D9(t){return Wc(t)&&_t in t&&Ol(t[_t])}a(D9,"IsKind");function vd(t){return Wwt(t)||zwt(t)||ck(t)||PB(t)||VV(t)||$V(t)||lk(t)||uk(t)||Poo(t)||dk(t)||fk(t)||Zd(t)||WV(t)||T1(t)||I1(t)||Nu(t)||P9(t)||Doo(t)||hCe(t)||pk(t)||Ip(t)||zV(t)||YV(t)||Mf(t)||Ywt(t)||DB(t)||mCe(t)||x1(t)||Noo(t)||w1(t)||NB(t)||ba(t)||Moo(t)||Ooo(t)||Boo(t)||Loo(t)||D9(t)}a(vd,"IsSchema");var ze={};wi(ze,{IsAny:()=>_qr,IsArgument:()=>Cqr,IsArray:()=>vqr,IsAsyncIterator:()=>bqr,IsBigInt:()=>Sqr,IsBoolean:()=>Tqr,IsComputed:()=>Iqr,IsConstructor:()=>xqr,IsDate:()=>wqr,IsFunction:()=>Rqr,IsImport:()=>Hoo,IsInteger:()=>kqr,IsIntersect:()=>Pqr,IsIterator:()=>Dqr,IsKind:()=>ijr,IsKindOf:()=>Ms,IsLiteral:()=>ACe,IsLiteralBoolean:()=>Goo,IsLiteralNumber:()=>Mqr,IsLiteralString:()=>Nqr,IsLiteralValue:()=>Oqr,IsMappedKey:()=>Bqr,IsMappedResult:()=>Lqr,IsNever:()=>Fqr,IsNot:()=>Uqr,IsNull:()=>Qqr,IsNumber:()=>qqr,IsObject:()=>jqr,IsOptional:()=>joo,IsPromise:()=>Hqr,IsProperties:()=>g6e,IsReadonly:()=>qoo,IsRecord:()=>Gqr,IsRecursive:()=>$oo,IsRef:()=>$qr,IsRegExp:()=>Vqr,IsSchema:()=>Mu,IsString:()=>Wqr,IsSymbol:()=>zqr,IsTemplateLiteral:()=>Yqr,IsThis:()=>Kqr,IsTransform:()=>Jqr,IsTuple:()=>Zqr,IsUint8Array:()=>ejr,IsUndefined:()=>Xqr,IsUnion:()=>Xwt,IsUnionLiteral:()=>Voo,IsUnknown:()=>tjr,IsUnsafe:()=>rjr,IsVoid:()=>njr,TypeGuardUnknownTypeError:()=>Kwt});p();var Kwt=class extends qi{static{a(this,"TypeGuardUnknownTypeError")}},Foo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Aqr(t){try{return new RegExp(t),!0}catch{return!1}}a(Aqr,"IsPattern");function Jwt(t){if(!Ol(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(Jwt,"IsControlCharacterFree");function yqr(t){return Zwt(t)||Mu(t)}a(yqr,"IsAdditionalProperties");function gCe(t){return Tp(t)||dCe(t)}a(gCe,"IsOptionalBigInt");function Bl(t){return Tp(t)||b1(t)}a(Bl,"IsOptionalNumber");function Zwt(t){return Tp(t)||xB(t)}a(Zwt,"IsOptionalBoolean");function zc(t){return Tp(t)||Ol(t)}a(zc,"IsOptionalString");function Uoo(t){return Tp(t)||Ol(t)&&Jwt(t)&&Aqr(t)}a(Uoo,"IsOptionalPattern");function Qoo(t){return Tp(t)||Ol(t)&&Jwt(t)}a(Qoo,"IsOptionalFormat");function Eqr(t){return Tp(t)||Mu(t)}a(Eqr,"IsOptionalSchema");function qoo(t){return Wc(t)&&t[ak]==="Readonly"}a(qoo,"IsReadonly");function joo(t){return Wc(t)&&t[zg]==="Optional"}a(joo,"IsOptional");function _qr(t){return Ms(t,"Any")&&zc(t.$id)}a(_qr,"IsAny");function Cqr(t){return Ms(t,"Argument")&&b1(t.index)}a(Cqr,"IsArgument");function vqr(t){return Ms(t,"Array")&&t.type==="array"&&zc(t.$id)&&Mu(t.items)&&Bl(t.minItems)&&Bl(t.maxItems)&&Zwt(t.uniqueItems)&&Eqr(t.contains)&&Bl(t.minContains)&&Bl(t.maxContains)}a(vqr,"IsArray");function bqr(t){return Ms(t,"AsyncIterator")&&t.type==="AsyncIterator"&&zc(t.$id)&&Mu(t.items)}a(bqr,"IsAsyncIterator");function Sqr(t){return Ms(t,"BigInt")&&t.type==="bigint"&&zc(t.$id)&&gCe(t.exclusiveMaximum)&&gCe(t.exclusiveMinimum)&&gCe(t.maximum)&&gCe(t.minimum)&&gCe(t.multipleOf)}a(Sqr,"IsBigInt");function Tqr(t){return Ms(t,"Boolean")&&t.type==="boolean"&&zc(t.$id)}a(Tqr,"IsBoolean");function Iqr(t){return Ms(t,"Computed")&&Ol(t.target)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))}a(Iqr,"IsComputed");function xqr(t){return Ms(t,"Constructor")&&t.type==="Constructor"&&zc(t.$id)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))&&Mu(t.returns)}a(xqr,"IsConstructor");function wqr(t){return Ms(t,"Date")&&t.type==="Date"&&zc(t.$id)&&Bl(t.exclusiveMaximumTimestamp)&&Bl(t.exclusiveMinimumTimestamp)&&Bl(t.maximumTimestamp)&&Bl(t.minimumTimestamp)&&Bl(t.multipleOfTimestamp)}a(wqr,"IsDate");function Rqr(t){return Ms(t,"Function")&&t.type==="Function"&&zc(t.$id)&&Sp(t.parameters)&&t.parameters.every(e=>Mu(e))&&Mu(t.returns)}a(Rqr,"IsFunction");function Hoo(t){return Ms(t,"Import")&&l6e(t,"$defs")&&Wc(t.$defs)&&g6e(t.$defs)&&l6e(t,"$ref")&&Ol(t.$ref)&&t.$ref in t.$defs}a(Hoo,"IsImport");function kqr(t){return Ms(t,"Integer")&&t.type==="integer"&&zc(t.$id)&&Bl(t.exclusiveMaximum)&&Bl(t.exclusiveMinimum)&&Bl(t.maximum)&&Bl(t.minimum)&&Bl(t.multipleOf)}a(kqr,"IsInteger");function g6e(t){return Wc(t)&&Object.entries(t).every(([e,r])=>Jwt(e)&&Mu(r))}a(g6e,"IsProperties");function Pqr(t){return Ms(t,"Intersect")&&!(Ol(t.type)&&t.type!=="object")&&Sp(t.allOf)&&t.allOf.every(e=>Mu(e)&&!Jqr(e))&&zc(t.type)&&(Zwt(t.unevaluatedProperties)||Eqr(t.unevaluatedProperties))&&zc(t.$id)}a(Pqr,"IsIntersect");function Dqr(t){return Ms(t,"Iterator")&&t.type==="Iterator"&&zc(t.$id)&&Mu(t.items)}a(Dqr,"IsIterator");function Ms(t,e){return Wc(t)&&_t in t&&t[_t]===e}a(Ms,"IsKindOf");function Nqr(t){return ACe(t)&&Ol(t.const)}a(Nqr,"IsLiteralString");function Mqr(t){return ACe(t)&&b1(t.const)}a(Mqr,"IsLiteralNumber");function Goo(t){return ACe(t)&&xB(t.const)}a(Goo,"IsLiteralBoolean");function ACe(t){return Ms(t,"Literal")&&zc(t.$id)&&Oqr(t.const)}a(ACe,"IsLiteral");function Oqr(t){return xB(t)||b1(t)||Ol(t)}a(Oqr,"IsLiteralValue");function Bqr(t){return Ms(t,"MappedKey")&&Sp(t.keys)&&t.keys.every(e=>b1(e)||Ol(e))}a(Bqr,"IsMappedKey");function Lqr(t){return Ms(t,"MappedResult")&&g6e(t.properties)}a(Lqr,"IsMappedResult");function Fqr(t){return Ms(t,"Never")&&Wc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(Fqr,"IsNever");function Uqr(t){return Ms(t,"Not")&&Mu(t.not)}a(Uqr,"IsNot");function Qqr(t){return Ms(t,"Null")&&t.type==="null"&&zc(t.$id)}a(Qqr,"IsNull");function qqr(t){return Ms(t,"Number")&&t.type==="number"&&zc(t.$id)&&Bl(t.exclusiveMaximum)&&Bl(t.exclusiveMinimum)&&Bl(t.maximum)&&Bl(t.minimum)&&Bl(t.multipleOf)}a(qqr,"IsNumber");function jqr(t){return Ms(t,"Object")&&t.type==="object"&&zc(t.$id)&&g6e(t.properties)&&yqr(t.additionalProperties)&&Bl(t.minProperties)&&Bl(t.maxProperties)}a(jqr,"IsObject");function Hqr(t){return Ms(t,"Promise")&&t.type==="Promise"&&zc(t.$id)&&Mu(t.item)}a(Hqr,"IsPromise");function Gqr(t){return Ms(t,"Record")&&t.type==="object"&&zc(t.$id)&&yqr(t.additionalProperties)&&Wc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&Aqr(r[0])&&Wc(e.patternProperties)&&Mu(e.patternProperties[r[0]])})(t)}a(Gqr,"IsRecord");function $oo(t){return Wc(t)&&SI in t&&t[SI]==="Recursive"}a($oo,"IsRecursive");function $qr(t){return Ms(t,"Ref")&&zc(t.$id)&&Ol(t.$ref)}a($qr,"IsRef");function Vqr(t){return Ms(t,"RegExp")&&zc(t.$id)&&Ol(t.source)&&Ol(t.flags)&&Bl(t.maxLength)&&Bl(t.minLength)}a(Vqr,"IsRegExp");function Wqr(t){return Ms(t,"String")&&t.type==="string"&&zc(t.$id)&&Bl(t.minLength)&&Bl(t.maxLength)&&Uoo(t.pattern)&&Qoo(t.format)}a(Wqr,"IsString");function zqr(t){return Ms(t,"Symbol")&&t.type==="symbol"&&zc(t.$id)}a(zqr,"IsSymbol");function Yqr(t){return Ms(t,"TemplateLiteral")&&t.type==="string"&&Ol(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Yqr,"IsTemplateLiteral");function Kqr(t){return Ms(t,"This")&&zc(t.$id)&&Ol(t.$ref)}a(Kqr,"IsThis");function Jqr(t){return Wc(t)&&Cd in t}a(Jqr,"IsTransform");function Zqr(t){return Ms(t,"Tuple")&&t.type==="array"&&zc(t.$id)&&b1(t.minItems)&&b1(t.maxItems)&&t.minItems===t.maxItems&&(Tp(t.items)&&Tp(t.additionalItems)&&t.minItems===0||Sp(t.items)&&t.items.every(e=>Mu(e)))}a(Zqr,"IsTuple");function Xqr(t){return Ms(t,"Undefined")&&t.type==="undefined"&&zc(t.$id)}a(Xqr,"IsUndefined");function Voo(t){return Xwt(t)&&t.anyOf.every(e=>Nqr(e)||Mqr(e))}a(Voo,"IsUnionLiteral");function Xwt(t){return Ms(t,"Union")&&zc(t.$id)&&Wc(t)&&Sp(t.anyOf)&&t.anyOf.every(e=>Mu(e))}a(Xwt,"IsUnion");function ejr(t){return Ms(t,"Uint8Array")&&t.type==="Uint8Array"&&zc(t.$id)&&Bl(t.minByteLength)&&Bl(t.maxByteLength)}a(ejr,"IsUint8Array");function tjr(t){return Ms(t,"Unknown")&&zc(t.$id)}a(tjr,"IsUnknown");function rjr(t){return Ms(t,"Unsafe")}a(rjr,"IsUnsafe");function njr(t){return Ms(t,"Void")&&t.type==="void"&&zc(t.$id)}a(njr,"IsVoid");function ijr(t){return Wc(t)&&_t in t&&Ol(t[_t])&&!Foo.includes(t[_t])}a(ijr,"IsKind");function Mu(t){return Wc(t)&&(_qr(t)||Cqr(t)||vqr(t)||Tqr(t)||Sqr(t)||bqr(t)||Iqr(t)||xqr(t)||wqr(t)||Rqr(t)||kqr(t)||Pqr(t)||Dqr(t)||ACe(t)||Bqr(t)||Lqr(t)||Fqr(t)||Uqr(t)||Qqr(t)||qqr(t)||jqr(t)||Hqr(t)||Gqr(t)||$qr(t)||Vqr(t)||Wqr(t)||zqr(t)||Yqr(t)||Kqr(t)||Zqr(t)||Xqr(t)||Xwt(t)||ejr(t)||tjr(t)||rjr(t)||njr(t)||ijr(t))}a(Mu,"IsSchema");p();var eRt="(true|false)",yCe="(0|[1-9][0-9]*)",tRt="(.*)",Woo="(?!.*)",Jnl=`^${eRt}$`,N9=`^${yCe}$`,M9=`^${tRt}$`,ojr=`^${Woo}$`;p();var hk={};wi(hk,{Clear:()=>Yoo,Delete:()=>Koo,Entries:()=>zoo,Get:()=>Xoo,Has:()=>Joo,Set:()=>Zoo});p();var bie=new Map;function zoo(){return new Map(bie)}a(zoo,"Entries");function Yoo(){return bie.clear()}a(Yoo,"Clear");function Koo(t){return bie.delete(t)}a(Koo,"Delete");function Joo(t){return bie.has(t)}a(Joo,"Has");function Zoo(t,e){bie.set(t,e)}a(Zoo,"Set");function Xoo(t){return bie.get(t)}a(Xoo,"Get");var i_={};wi(i_,{Clear:()=>tso,Delete:()=>rso,Entries:()=>eso,Get:()=>oso,Has:()=>nso,Set:()=>iso});p();var Sie=new Map;function eso(){return new Map(Sie)}a(eso,"Entries");function tso(){return Sie.clear()}a(tso,"Clear");function rso(t){return Sie.delete(t)}a(rso,"Delete");function nso(t){return Sie.has(t)}a(nso,"Has");function iso(t,e){Sie.set(t,e)}a(iso,"Set");function oso(t){return Sie.get(t)}a(oso,"Get");p();function sjr(t,e){return t.includes(e)}a(sjr,"SetIncludes");function ajr(t){return[...new Set(t)]}a(ajr,"SetDistinct");function sso(t,e){return t.filter(r=>e.includes(r))}a(sso,"SetIntersect");function aso(t,e){return t.reduce((r,n)=>sso(r,n),e)}a(aso,"SetIntersectManyResolve");function cjr(t){return t.length===1?t[0]:t.length>1?aso(t.slice(1),t[0]):[]}a(cjr,"SetIntersectMany");function ljr(t){let e=[];for(let r of t)e.push(...r);return e}a(ljr,"SetUnionMany");p();function O9(t){return Tt({[_t]:"Any"},t)}a(O9,"Any");p();function Tie(t,e){return Tt({[_t]:"Array",type:"array",items:t},e)}a(Tie,"Array");p();function ujr(t){return Tt({[_t]:"Argument",index:t})}a(ujr,"Argument");p();function Iie(t,e){return Tt({[_t]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Iie,"AsyncIterator");p();p();function tu(t,e,r){return Tt({[_t]:"Computed",target:t,parameters:e},r)}a(tu,"Computed");p();p();function cso(t,e){let{[e]:r,...n}=t;return n}a(cso,"DiscardKey");function Xd(t,e){return e.reduce((r,n)=>cso(r,n),t)}a(Xd,"Discard");p();function Ko(t){return Tt({[_t]:"Never",not:{}},t)}a(Ko,"Never");p();p();function Ua(t){return Tt({[_t]:"MappedResult",properties:t})}a(Ua,"MappedResult");p();p();function xie(t,e,r){return Tt({[_t]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(xie,"Constructor");p();function TN(t,e,r){return Tt({[_t]:"Function",type:"Function",parameters:t,returns:e},r)}a(TN,"Function");p();p();p();p();function ECe(t,e){return Tt({[_t]:"Union",anyOf:t},e)}a(ECe,"UnionCreate");function lso(t){return t.some(e=>GC(e))}a(lso,"IsUnionOptional");function djr(t){return t.map(e=>GC(e)?uso(e):e)}a(djr,"RemoveOptionalFromRest");function uso(t){return Xd(t,[zg])}a(uso,"RemoveOptionalFromType");function dso(t,e){return lso(t)?gy(ECe(djr(t),e)):ECe(djr(t),e)}a(dso,"ResolveUnion");function IN(t,e){return t.length===1?Tt(t[0],e):t.length===0?Ko(e):dso(t,e)}a(IN,"UnionEvaluated");p();function Xa(t,e){return t.length===0?Ko(e):t.length===1?Tt(t[0],e):ECe(t,e)}a(Xa,"Union");p();p();p();var A6e=class extends qi{static{a(this,"TemplateLiteralParserError")}};function fso(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(fso,"Unescape");function rRt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(rRt,"IsNonEscaped");function OB(t,e){return rRt(t,e,"(")}a(OB,"IsOpenParen");function _Ce(t,e){return rRt(t,e,")")}a(_Ce,"IsCloseParen");function fjr(t,e){return rRt(t,e,"|")}a(fjr,"IsSeparator");function pso(t){if(!(OB(t,0)&&_Ce(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(wie(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(wie(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(Aso,"Or");function yso(t){function e(o,s){if(!OB(o,s))throw new A6e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(wie(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(yso,"And");function wie(t){return pso(t)?wie(hso(t)):mso(t)?Aso(t):gso(t)?yso(t):{type:"const",const:fso(t)}}a(wie,"TemplateLiteralParse");function Rie(t){return wie(t.slice(1,t.length-1))}a(Rie,"TemplateLiteralParseExact");var nRt=class extends qi{static{a(this,"TemplateLiteralFiniteError")}};function Eso(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(Eso,"IsNumberExpression");function _so(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(_so,"IsBooleanExpression");function Cso(t){return t.type==="const"&&t.const===".*"}a(Cso,"IsStringExpression");function KV(t){return Eso(t)||Cso(t)?!1:_so(t)?!0:t.type==="and"?t.expr.every(e=>KV(e)):t.type==="or"?t.expr.every(e=>KV(e)):t.type==="const"?!0:(()=>{throw new nRt("Unknown expression type")})()}a(KV,"IsTemplateLiteralExpressionFinite");function y6e(t){let e=Rie(t.pattern);return KV(e)}a(y6e,"IsTemplateLiteralFinite");p();var iRt=class extends qi{static{a(this,"TemplateLiteralGenerateError")}};function*pjr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of pjr(t.slice(1)))yield`${e}${r}`}a(pjr,"GenerateReduce");function*vso(t){return yield*pjr(t.expr.map(e=>[...CCe(e)]))}a(vso,"GenerateAnd");function*bso(t){for(let e of t.expr)yield*CCe(e)}a(bso,"GenerateOr");function*Sso(t){return yield t.const}a(Sso,"GenerateConst");function*CCe(t){return t.type==="and"?yield*vso(t):t.type==="or"?yield*bso(t):t.type==="const"?yield*Sso(t):(()=>{throw new iRt("Unknown expression")})()}a(CCe,"TemplateLiteralExpressionGenerate");function kie(t){let e=Rie(t.pattern);return KV(e)?[...CCe(e)]:[]}a(kie,"TemplateLiteralGenerate");p();p();function oa(t,e){return Tt({[_t]:"Literal",const:t,type:typeof t},e)}a(oa,"Literal");p();function E6e(t){return Tt({[_t]:"Boolean",type:"boolean"},t)}a(E6e,"Boolean");p();function Pie(t){return Tt({[_t]:"BigInt",type:"bigint"},t)}a(Pie,"BigInt");p();function TI(t){return Tt({[_t]:"Number",type:"number"},t)}a(TI,"Number");p();function o_(t){return Tt({[_t]:"String",type:"string"},t)}a(o_,"String");function*Tso(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield E6e():e==="number"?yield TI():e==="bigint"?yield Pie():e==="string"?yield o_():yield(()=>{let r=e.split("|").map(n=>oa(n.trim()));return r.length===0?Ko():r.length===1?r[0]:IN(r)})()}a(Tso,"FromUnion");function*Iso(t){if(t[1]!=="{"){let e=oa("$"),r=oRt(t.slice(1));return yield*[e,...r]}for(let e=2;emjr(r,e)).join("|")})`:pk(t)?`${e}${yCe}`:fk(t)?`${e}${yCe}`:VV(t)?`${e}${yCe}`:DB(t)?`${e}${tRt}`:T1(t)?`${e}${xso(t.const.toString())}`:PB(t)?`${e}${eRt}`:(()=>{throw new sRt(`Unexpected Kind '${t[_t]}'`)})()}a(mjr,"Visit");function aRt(t){return`^${t.map(e=>mjr(e,"")).join("")}$`}a(aRt,"TemplateLiteralPattern");p();function JV(t){let r=kie(t).map(n=>oa(n));return IN(r)}a(JV,"TemplateLiteralToUnion");p();function _6e(t,e){let r=Ol(t)?aRt(hjr(t)):aRt(t);return Tt({[_t]:"TemplateLiteral",type:"string",pattern:r},e)}a(_6e,"TemplateLiteral");function wso(t){return kie(t).map(r=>r.toString())}a(wso,"FromTemplateLiteral");function Rso(t){let e=[];for(let r of t)e.push(...$C(r));return e}a(Rso,"FromUnion");function kso(t){return[t.toString()]}a(kso,"FromLiteral");function $C(t){return[...new Set(x1(t)?wso(t):ba(t)?Rso(t.anyOf):T1(t)?kso(t.const):pk(t)?["[number]"]:fk(t)?["[number]"]:[])]}a($C,"IndexPropertyKeys");p();function Pso(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=B9(t,$C(e[o]),r);return n}a(Pso,"FromProperties");function Dso(t,e,r){return Pso(t,e.properties,r)}a(Dso,"FromMappedResult");function gjr(t,e,r){let n=Dso(t,e,r);return Ua(n)}a(gjr,"IndexFromMappedResult");function yjr(t,e){return t.map(r=>Ejr(r,e))}a(yjr,"FromRest");function Nso(t){return t.filter(e=>!P9(e))}a(Nso,"FromIntersectRest");function Mso(t,e){return C6e(Nso(yjr(t,e)))}a(Mso,"FromIntersect");function Oso(t){return t.some(e=>P9(e))?[]:t}a(Oso,"FromUnionRest");function Bso(t,e){return IN(Oso(yjr(t,e)))}a(Bso,"FromUnion");function Lso(t,e){return e in t?t[e]:e==="[number]"?IN(t):Ko()}a(Lso,"FromTuple");function Fso(t,e){return e==="[number]"?t:Ko()}a(Fso,"FromArray");function Uso(t,e){return e in t?t[e]:Ko()}a(Uso,"FromProperty");function Ejr(t,e){return Zd(t)?Mso(t.allOf,e):ba(t)?Bso(t.anyOf,e):w1(t)?Lso(t.items??[],e):ck(t)?Fso(t.items,e):Ip(t)?Uso(t.properties,e):Ko()}a(Ejr,"IndexFromPropertyKey");function vCe(t,e){return e.map(r=>Ejr(t,r))}a(vCe,"IndexFromPropertyKeys");function Ajr(t,e){return IN(vCe(t,e))}a(Ajr,"FromSchema");function B9(t,e,r){if(Mf(t)||Mf(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!vd(t)||!vd(e))throw new qi(n);return tu("Index",[t,e])}return Nu(e)?gjr(t,e,r):I1(e)?_jr(t,e,r):Tt(vd(e)?Ajr(t,$C(e)):Ajr(t,e),r)}a(B9,"Index");function Qso(t,e,r){return{[e]:B9(t,[e],Pu(r))}}a(Qso,"MappedIndexPropertyKey");function qso(t,e,r){return e.reduce((n,o)=>({...n,...Qso(t,o,r)}),{})}a(qso,"MappedIndexPropertyKeys");function jso(t,e,r){return qso(t,e.keys,r)}a(jso,"MappedIndexProperties");function _jr(t,e,r){let n=jso(t,e,r);return Ua(n)}a(_jr,"IndexFromMappedKey");p();function Die(t,e){return Tt({[_t]:"Iterator",type:"Iterator",items:t},e)}a(Die,"Iterator");p();function Hso(t){return globalThis.Object.keys(t).filter(e=>!GC(t[e]))}a(Hso,"RequiredArray");function Gso(t,e){let r=Hso(t),n=r.length>0?{[_t]:"Object",type:"object",required:r,properties:t}:{[_t]:"Object",type:"object",properties:t};return Tt(n,e)}a(Gso,"_Object");var ec=Gso;p();function v6e(t,e){return Tt({[_t]:"Promise",type:"Promise",item:t},e)}a(v6e,"Promise");p();p();function $so(t){return Tt(Xd(t,[ak]))}a($so,"RemoveReadonly");function Vso(t){return Tt({...t,[ak]:"Readonly"})}a(Vso,"AddReadonly");function Wso(t,e){return e===!1?$so(t):Vso(t)}a(Wso,"ReadonlyWithFlag");function VC(t,e){let r=e??!0;return Nu(t)?Cjr(t,r):Wso(t,r)}a(VC,"Readonly");function zso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=VC(t[n],e);return r}a(zso,"FromProperties");function Yso(t,e){return zso(t.properties,e)}a(Yso,"FromMappedResult");function Cjr(t,e){let r=Yso(t,e);return Ua(r)}a(Cjr,"ReadonlyFromMappedResult");p();function II(t,e){return Tt(t.length>0?{[_t]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[_t]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(II,"Tuple");function vjr(t,e){return t in e?xI(t,e[t]):Ua(e)}a(vjr,"FromMappedResult");function Kso(t){return{[t]:oa(t)}}a(Kso,"MappedKeyToKnownMappedResultProperties");function Jso(t){let e={};for(let r of t)e[r]=oa(r);return e}a(Jso,"MappedKeyToUnknownMappedResultProperties");function Zso(t,e){return sjr(e,t)?Kso(t):Jso(e)}a(Zso,"MappedKeyToMappedResultProperties");function Xso(t,e){let r=Zso(t,e);return vjr(t,r)}a(Xso,"FromMappedKey");function bCe(t,e){return e.map(r=>xI(t,r))}a(bCe,"FromRest");function eao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=xI(t,e[n]);return r}a(eao,"FromProperties");function xI(t,e){let r={...e};return GC(e)?gy(xI(t,Xd(e,[zg]))):vie(e)?VC(xI(t,Xd(e,[ak]))):Nu(e)?vjr(t,e.properties):I1(e)?Xso(t,e.keys):uk(e)?xie(bCe(t,e.parameters),xI(t,e.returns),r):dk(e)?TN(bCe(t,e.parameters),xI(t,e.returns),r):$V(e)?Iie(xI(t,e.items),r):WV(e)?Die(xI(t,e.items),r):Zd(e)?Ay(bCe(t,e.allOf),r):ba(e)?Xa(bCe(t,e.anyOf),r):w1(e)?II(bCe(t,e.items??[]),r):Ip(e)?ec(eao(t,e.properties),r):ck(e)?Tie(xI(t,e.items),r):zV(e)?v6e(xI(t,e.item),r):e}a(xI,"FromSchemaType");function tao(t,e){let r={};for(let n of t)r[n]=xI(n,e);return r}a(tao,"MappedFunctionReturnType");function bjr(t,e,r){let n=vd(t)?$C(t):t,o=e({[_t]:"MappedKey",keys:n}),s=tao(n,o);return ec(s,r)}a(bjr,"Mapped");p();function rao(t){return Tt(Xd(t,[zg]))}a(rao,"RemoveOptional");function nao(t){return Tt({...t,[zg]:"Optional"})}a(nao,"AddOptional");function iao(t,e){return e===!1?rao(t):nao(t)}a(iao,"OptionalWithFlag");function gy(t,e){let r=e??!0;return Nu(t)?Sjr(t,r):iao(t,r)}a(gy,"Optional");function oao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=gy(t[n],e);return r}a(oao,"FromProperties");function sao(t,e){return oao(t.properties,e)}a(sao,"FromMappedResult");function Sjr(t,e){let r=sao(t,e);return Ua(r)}a(Sjr,"OptionalFromMappedResult");p();function SCe(t,e={}){let r=t.every(o=>Ip(o)),n=vd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return Tt(e.unevaluatedProperties===!1||vd(e.unevaluatedProperties)||r?{...n,[_t]:"Intersect",type:"object",allOf:t}:{...n,[_t]:"Intersect",allOf:t},e)}a(SCe,"IntersectCreate");function aao(t){return t.every(e=>GC(e))}a(aao,"IsIntersectOptional");function cao(t){return Xd(t,[zg])}a(cao,"RemoveOptionalFromType");function Tjr(t){return t.map(e=>GC(e)?cao(e):e)}a(Tjr,"RemoveOptionalFromRest");function lao(t,e){return aao(t)?gy(SCe(Tjr(t),e)):SCe(Tjr(t),e)}a(lao,"ResolveIntersect");function C6e(t,e={}){if(t.length===1)return Tt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return lao(t,e)}a(C6e,"IntersectEvaluated");p();function Ay(t,e){if(t.length===1)return Tt(t[0],e);if(t.length===0)return Ko(e);if(t.some(r=>Za(r)))throw new Error("Cannot intersect transform types");return SCe(t,e)}a(Ay,"Intersect");p();function wI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new qi("Ref: $ref must be a string");return Tt({[_t]:"Ref",$ref:e},r)}a(wI,"Ref");function uao(t,e){return tu("Awaited",[tu(t,e)])}a(uao,"FromComputed");function dao(t){return tu("Awaited",[wI(t)])}a(dao,"FromRef");function fao(t){return Ay(Ijr(t))}a(fao,"FromIntersect");function pao(t){return Xa(Ijr(t))}a(pao,"FromUnion");function hao(t){return Nie(t)}a(hao,"FromPromise");function Ijr(t){return t.map(e=>Nie(e))}a(Ijr,"FromRest");function Nie(t,e){return Tt(lk(t)?uao(t.target,t.parameters):Zd(t)?fao(t.allOf):ba(t)?pao(t.anyOf):zV(t)?hao(t.item):Mf(t)?dao(t.$ref):t,e)}a(Nie,"Awaited");p();p();p();p();function xjr(t){let e=[];for(let r of t)e.push(WC(r));return e}a(xjr,"FromRest");function mao(t){let e=xjr(t);return ljr(e)}a(mao,"FromIntersect");function gao(t){let e=xjr(t);return cjr(e)}a(gao,"FromUnion");function Aao(t){return t.map((e,r)=>r.toString())}a(Aao,"FromTuple");function yao(t){return["[number]"]}a(yao,"FromArray");function Eao(t){return globalThis.Object.getOwnPropertyNames(t)}a(Eao,"FromProperties");function _ao(t){return cRt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(_ao,"FromPatternProperties");function WC(t){return Zd(t)?mao(t.allOf):ba(t)?gao(t.anyOf):w1(t)?Aao(t.items??[]):ck(t)?yao(t.items):Ip(t)?Eao(t.properties):YV(t)?_ao(t.patternProperties):[]}a(WC,"KeyOfPropertyKeys");var cRt=!1;function BB(t){cRt=!0;let e=WC(t);return cRt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(BB,"KeyOfPattern");function Cao(t,e){return tu("KeyOf",[tu(t,e)])}a(Cao,"FromComputed");function vao(t){return tu("KeyOf",[wI(t)])}a(vao,"FromRef");function bao(t,e){let r=WC(t),n=Sao(r),o=IN(n);return Tt(o,e)}a(bao,"KeyOfFromType");function Sao(t){return t.map(e=>e==="[number]"?TI():oa(e))}a(Sao,"KeyOfPropertyKeysToRest");function Mie(t,e){return lk(t)?Cao(t.target,t.parameters):Mf(t)?vao(t.$ref):Nu(t)?wjr(t,e):bao(t,e)}a(Mie,"KeyOf");function Tao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Mie(t[n],Pu(e));return r}a(Tao,"FromProperties");function Iao(t,e){return Tao(t.properties,e)}a(Iao,"FromMappedResult");function wjr(t,e){let r=Iao(t,e);return Ua(r)}a(wjr,"KeyOfFromMappedResult");p();function b6e(t){let e=WC(t),r=vCe(t,e);return e.map((n,o)=>[e[o],r[o]])}a(b6e,"KeyOfPropertyEntries");function xao(t){let e=[];for(let r of t)e.push(...WC(r));return ajr(e)}a(xao,"CompositeKeys");function wao(t){return t.filter(e=>!P9(e))}a(wao,"FilterNever");function Rao(t,e){let r=[];for(let n of t)r.push(...vCe(n,[e]));return wao(r)}a(Rao,"CompositeProperty");function kao(t,e){let r={};for(let n of e)r[n]=C6e(Rao(t,n));return r}a(kao,"CompositeProperties");function Rjr(t,e){let r=xao(t),n=kao(t,r);return ec(n,e)}a(Rjr,"Composite");p();p();function S6e(t){return Tt({[_t]:"Date",type:"Date"},t)}a(S6e,"Date");p();function T6e(t){return Tt({[_t]:"Null",type:"null"},t)}a(T6e,"Null");p();function I6e(t){return Tt({[_t]:"Symbol",type:"symbol"},t)}a(I6e,"Symbol");p();function x6e(t){return Tt({[_t]:"Undefined",type:"undefined"},t)}a(x6e,"Undefined");p();function w6e(t){return Tt({[_t]:"Uint8Array",type:"Uint8Array"},t)}a(w6e,"Uint8Array");p();function mk(t){return Tt({[_t]:"Unknown"},t)}a(mk,"Unknown");function Pao(t){return t.map(e=>lRt(e,!1))}a(Pao,"FromArray");function Dao(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=VC(lRt(t[r],!1));return e}a(Dao,"FromProperties");function R6e(t,e){return e===!0?t:VC(t)}a(R6e,"ConditionalReadonly");function lRt(t,e){return qwt(t)?R6e(O9(),e):Hwt(t)?R6e(O9(),e):Sp(t)?VC(II(Pao(t))):wB(t)?w6e():GV(t)?S6e():Wc(t)?R6e(ec(Dao(t)),e):jwt(t)?R6e(TN([],mk()),e):Tp(t)?x6e():Gwt(t)?T6e():$wt(t)?I6e():dCe(t)?Pie():b1(t)?oa(t):xB(t)?oa(t):Ol(t)?oa(t):ec({})}a(lRt,"FromValue");function kjr(t,e){return Tt(lRt(t,!0),e)}a(kjr,"Const");p();function Pjr(t,e){return uk(t)?II(t.parameters,e):Ko(e)}a(Pjr,"ConstructorParameters");p();function Djr(t,e){if(Tp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>oa(s));return Xa(o,{...e,[SI]:"Enum"})}a(Djr,"Enum");p();p();p();var dRt=class extends qi{static{a(this,"ExtendsResolverError")}},xt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(xt||(xt={}));function RI(t){return t===xt.False?t:xt.True}a(RI,"IntoBooleanResult");function Oie(t){throw new dRt(t)}a(Oie,"Throw");function ph(t){return ze.IsNever(t)||ze.IsIntersect(t)||ze.IsUnion(t)||ze.IsUnknown(t)||ze.IsAny(t)}a(ph,"IsStructuralRight");function hh(t,e){return ze.IsNever(e)?Ujr(t,e):ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsUnknown(e)?Hjr(t,e):ze.IsAny(e)?hRt(t,e):Oie("StructuralRight")}a(hh,"StructuralRight");function hRt(t,e){return xt.True}a(hRt,"FromAnyRight");function Nao(t,e){return ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)&&e.anyOf.some(r=>ze.IsAny(r)||ze.IsUnknown(r))?xt.True:ze.IsUnion(e)?xt.Union:ze.IsUnknown(e)||ze.IsAny(e)?xt.True:xt.Union}a(Nao,"FromAny");function Mao(t,e){return ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:ze.IsNever(t)?xt.True:xt.False}a(Mao,"FromArrayRight");function Oao(t,e){return ze.IsObject(e)&&P6e(e)?xt.True:ph(e)?hh(t,e):ze.IsArray(e)?RI(Yc(t.items,e.items)):xt.False}a(Oao,"FromArray");function Bao(t,e){return ph(e)?hh(t,e):ze.IsAsyncIterator(e)?RI(Yc(t.items,e.items)):xt.False}a(Bao,"FromAsyncIterator");function Lao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsBigInt(e)?xt.True:xt.False}a(Lao,"FromBigInt");function Ljr(t,e){return ze.IsLiteralBoolean(t)||ze.IsBoolean(t)?xt.True:xt.False}a(Ljr,"FromBooleanRight");function Fao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsBoolean(e)?xt.True:xt.False}a(Fao,"FromBoolean");function Uao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsConstructor(e)?t.parameters.length>e.parameters.length?xt.False:t.parameters.every((r,n)=>RI(Yc(e.parameters[n],r))===xt.True)?RI(Yc(t.returns,e.returns)):xt.False:xt.False}a(Uao,"FromConstructor");function Qao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsDate(e)?xt.True:xt.False}a(Qao,"FromDate");function qao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsFunction(e)?t.parameters.length>e.parameters.length?xt.False:t.parameters.every((r,n)=>RI(Yc(e.parameters[n],r))===xt.True)?RI(Yc(t.returns,e.returns)):xt.False:xt.False}a(qao,"FromFunction");function Fjr(t,e){return ze.IsLiteral(t)&&my.IsNumber(t.const)||ze.IsNumber(t)||ze.IsInteger(t)?xt.True:xt.False}a(Fjr,"FromIntegerRight");function jao(t,e){return ze.IsInteger(e)||ze.IsNumber(e)?xt.True:ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):xt.False}a(jao,"FromInteger");function k6e(t,e){return e.allOf.every(r=>Yc(t,r)===xt.True)?xt.True:xt.False}a(k6e,"FromIntersectRight");function Hao(t,e){return t.allOf.some(r=>Yc(r,e)===xt.True)?xt.True:xt.False}a(Hao,"FromIntersect");function Gao(t,e){return ph(e)?hh(t,e):ze.IsIterator(e)?RI(Yc(t.items,e.items)):xt.False}a(Gao,"FromIterator");function $ao(t,e){return ze.IsLiteral(e)&&e.const===t.const?xt.True:ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsString(e)?jjr(t,e):ze.IsNumber(e)?Qjr(t,e):ze.IsInteger(e)?Fjr(t,e):ze.IsBoolean(e)?Ljr(t,e):xt.False}a($ao,"FromLiteral");function Ujr(t,e){return xt.False}a(Ujr,"FromNeverRight");function Vao(t,e){return xt.True}a(Vao,"FromNever");function Njr(t){let[e,r]=[t,0];for(;ze.IsNot(e);)e=e.not,r+=1;return r%2===0?e:mk()}a(Njr,"UnwrapTNot");function Wao(t,e){return ze.IsNot(t)?Yc(Njr(t),e):ze.IsNot(e)?Yc(t,Njr(e)):Oie("Invalid fallthrough for Not")}a(Wao,"FromNot");function zao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsNull(e)?xt.True:xt.False}a(zao,"FromNull");function Qjr(t,e){return ze.IsLiteralNumber(t)||ze.IsNumber(t)||ze.IsInteger(t)?xt.True:xt.False}a(Qjr,"FromNumberRight");function Yao(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsInteger(e)||ze.IsNumber(e)?xt.True:xt.False}a(Yao,"FromNumber");function zC(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(zC,"IsObjectPropertyCount");function Mjr(t){return P6e(t)}a(Mjr,"IsObjectStringLike");function Ojr(t){return zC(t,0)||zC(t,1)&&"description"in t.properties&&ze.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(ze.IsString(t.properties.description.anyOf[0])&&ze.IsUndefined(t.properties.description.anyOf[1])||ze.IsString(t.properties.description.anyOf[1])&&ze.IsUndefined(t.properties.description.anyOf[0]))}a(Ojr,"IsObjectSymbolLike");function uRt(t){return zC(t,0)}a(uRt,"IsObjectNumberLike");function Bjr(t){return zC(t,0)}a(Bjr,"IsObjectBooleanLike");function Kao(t){return zC(t,0)}a(Kao,"IsObjectBigIntLike");function Jao(t){return zC(t,0)}a(Jao,"IsObjectDateLike");function Zao(t){return P6e(t)}a(Zao,"IsObjectUint8ArrayLike");function Xao(t){let e=TI();return zC(t,0)||zC(t,1)&&"length"in t.properties&&RI(Yc(t.properties.length,e))===xt.True}a(Xao,"IsObjectFunctionLike");function eco(t){return zC(t,0)}a(eco,"IsObjectConstructorLike");function P6e(t){let e=TI();return zC(t,0)||zC(t,1)&&"length"in t.properties&&RI(Yc(t.properties.length,e))===xt.True}a(P6e,"IsObjectArrayLike");function tco(t){let e=TN([O9()],O9());return zC(t,0)||zC(t,1)&&"then"in t.properties&&RI(Yc(t.properties.then,e))===xt.True}a(tco,"IsObjectPromiseLike");function qjr(t,e){return Yc(t,e)===xt.False||ze.IsOptional(t)&&!ze.IsOptional(e)?xt.False:xt.True}a(qjr,"Property");function yy(t,e){return ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:ze.IsNever(t)||ze.IsLiteralString(t)&&Mjr(e)||ze.IsLiteralNumber(t)&&uRt(e)||ze.IsLiteralBoolean(t)&&Bjr(e)||ze.IsSymbol(t)&&Ojr(e)||ze.IsBigInt(t)&&Kao(e)||ze.IsString(t)&&Mjr(e)||ze.IsSymbol(t)&&Ojr(e)||ze.IsNumber(t)&&uRt(e)||ze.IsInteger(t)&&uRt(e)||ze.IsBoolean(t)&&Bjr(e)||ze.IsUint8Array(t)&&Zao(e)||ze.IsDate(t)&&Jao(e)||ze.IsConstructor(t)&&eco(e)||ze.IsFunction(t)&&Xao(e)?xt.True:ze.IsRecord(t)&&ze.IsString(fRt(t))?e[SI]==="Record"?xt.True:xt.False:ze.IsRecord(t)&&ze.IsNumber(fRt(t))&&zC(e,0)?xt.True:xt.False}a(yy,"FromObjectRight");function rco(t,e){return ph(e)?hh(t,e):ze.IsRecord(e)?kI(t,e):ze.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!ze.IsOptional(e.properties[r]))return xt.False;if(ze.IsOptional(e.properties[r]))return xt.True;if(qjr(t.properties[r],e.properties[r])===xt.False)return xt.False}return xt.True})():xt.False}a(rco,"FromObject");function nco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)&&tco(e)?xt.True:ze.IsPromise(e)?RI(Yc(t.item,e.item)):xt.False}a(nco,"FromPromise");function fRt(t){return N9 in t.patternProperties?TI():M9 in t.patternProperties?o_():Oie("Unknown record key pattern")}a(fRt,"RecordKey");function pRt(t){return N9 in t.patternProperties?t.patternProperties[N9]:M9 in t.patternProperties?t.patternProperties[M9]:Oie("Unable to get record value schema")}a(pRt,"RecordValue");function kI(t,e){let[r,n]=[fRt(e),pRt(e)];return ze.IsLiteralString(t)&&ze.IsNumber(r)&&RI(Yc(t,n))===xt.True?xt.True:ze.IsUint8Array(t)&&ze.IsNumber(r)||ze.IsString(t)&&ze.IsNumber(r)||ze.IsArray(t)&&ze.IsNumber(r)?Yc(t,n):ze.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(qjr(n,t.properties[o])===xt.False)return xt.False;return xt.True})():xt.False}a(kI,"FromRecordRight");function ico(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?Yc(pRt(t),pRt(e)):xt.False}a(ico,"FromRecord");function oco(t,e){let r=ze.IsRegExp(t)?o_():t,n=ze.IsRegExp(e)?o_():e;return Yc(r,n)}a(oco,"FromRegExp");function jjr(t,e){return ze.IsLiteral(t)&&my.IsString(t.const)||ze.IsString(t)?xt.True:xt.False}a(jjr,"FromStringRight");function sco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsString(e)?xt.True:xt.False}a(sco,"FromString");function aco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsSymbol(e)?xt.True:xt.False}a(aco,"FromSymbol");function cco(t,e){return ze.IsTemplateLiteral(t)?Yc(JV(t),e):ze.IsTemplateLiteral(e)?Yc(t,JV(e)):Oie("Invalid fallthrough for TemplateLiteral")}a(cco,"FromTemplateLiteral");function lco(t,e){return ze.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Yc(r,e.items)===xt.True)}a(lco,"IsArrayOfTuple");function uco(t,e){return ze.IsNever(t)?xt.True:ze.IsUnknown(t)?xt.False:ze.IsAny(t)?xt.Union:xt.False}a(uco,"FromTupleRight");function dco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)&&P6e(e)||ze.IsArray(e)&&lco(t,e)?xt.True:ze.IsTuple(e)?my.IsUndefined(t.items)&&!my.IsUndefined(e.items)||!my.IsUndefined(t.items)&&my.IsUndefined(e.items)?xt.False:my.IsUndefined(t.items)&&!my.IsUndefined(e.items)||t.items.every((r,n)=>Yc(r,e.items[n])===xt.True)?xt.True:xt.False:xt.False}a(dco,"FromTuple");function fco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsUint8Array(e)?xt.True:xt.False}a(fco,"FromUint8Array");function pco(t,e){return ph(e)?hh(t,e):ze.IsObject(e)?yy(t,e):ze.IsRecord(e)?kI(t,e):ze.IsVoid(e)?gco(t,e):ze.IsUndefined(e)?xt.True:xt.False}a(pco,"FromUndefined");function mRt(t,e){return e.anyOf.some(r=>Yc(t,r)===xt.True)?xt.True:xt.False}a(mRt,"FromUnionRight");function hco(t,e){return t.anyOf.every(r=>Yc(r,e)===xt.True)?xt.True:xt.False}a(hco,"FromUnion");function Hjr(t,e){return xt.True}a(Hjr,"FromUnknownRight");function mco(t,e){return ze.IsNever(e)?Ujr(t,e):ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsAny(e)?hRt(t,e):ze.IsString(e)?jjr(t,e):ze.IsNumber(e)?Qjr(t,e):ze.IsInteger(e)?Fjr(t,e):ze.IsBoolean(e)?Ljr(t,e):ze.IsArray(e)?Mao(t,e):ze.IsTuple(e)?uco(t,e):ze.IsObject(e)?yy(t,e):ze.IsUnknown(e)?xt.True:xt.False}a(mco,"FromUnknown");function gco(t,e){return ze.IsUndefined(t)||ze.IsUndefined(t)?xt.True:xt.False}a(gco,"FromVoidRight");function Aco(t,e){return ze.IsIntersect(e)?k6e(t,e):ze.IsUnion(e)?mRt(t,e):ze.IsUnknown(e)?Hjr(t,e):ze.IsAny(e)?hRt(t,e):ze.IsObject(e)?yy(t,e):ze.IsVoid(e)?xt.True:xt.False}a(Aco,"FromVoid");function Yc(t,e){return ze.IsTemplateLiteral(t)||ze.IsTemplateLiteral(e)?cco(t,e):ze.IsRegExp(t)||ze.IsRegExp(e)?oco(t,e):ze.IsNot(t)||ze.IsNot(e)?Wao(t,e):ze.IsAny(t)?Nao(t,e):ze.IsArray(t)?Oao(t,e):ze.IsBigInt(t)?Lao(t,e):ze.IsBoolean(t)?Fao(t,e):ze.IsAsyncIterator(t)?Bao(t,e):ze.IsConstructor(t)?Uao(t,e):ze.IsDate(t)?Qao(t,e):ze.IsFunction(t)?qao(t,e):ze.IsInteger(t)?jao(t,e):ze.IsIntersect(t)?Hao(t,e):ze.IsIterator(t)?Gao(t,e):ze.IsLiteral(t)?$ao(t,e):ze.IsNever(t)?Vao(t,e):ze.IsNull(t)?zao(t,e):ze.IsNumber(t)?Yao(t,e):ze.IsObject(t)?rco(t,e):ze.IsRecord(t)?ico(t,e):ze.IsString(t)?sco(t,e):ze.IsSymbol(t)?aco(t,e):ze.IsTuple(t)?dco(t,e):ze.IsPromise(t)?nco(t,e):ze.IsUint8Array(t)?fco(t,e):ze.IsUndefined(t)?pco(t,e):ze.IsUnion(t)?hco(t,e):ze.IsUnknown(t)?mco(t,e):ze.IsVoid(t)?Aco(t,e):Oie(`Unknown left type operand '${t[_t]}'`)}a(Yc,"Visit");function L9(t,e){return Yc(t,e)}a(L9,"ExtendsCheck");p();p();p();function yco(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Bie(t[c],e,r,n,Pu(o));return s}a(yco,"FromProperties");function Eco(t,e,r,n,o){return yco(t.properties,e,r,n,o)}a(Eco,"FromMappedResult");function Gjr(t,e,r,n,o){let s=Eco(t,e,r,n,o);return Ua(s)}a(Gjr,"ExtendsFromMappedResult");function _co(t,e,r,n){let o=L9(t,e);return o===xt.Union?Xa([r,n]):o===xt.True?r:n}a(_co,"ExtendsResolve");function Bie(t,e,r,n,o){return Nu(t)?Gjr(t,e,r,n,o):I1(t)?Tt($jr(t,e,r,n,o)):Tt(_co(t,e,r,n),o)}a(Bie,"Extends");function Cco(t,e,r,n,o){return{[t]:Bie(oa(t),e,r,n,Pu(o))}}a(Cco,"FromPropertyKey");function vco(t,e,r,n,o){return t.reduce((s,c)=>({...s,...Cco(c,e,r,n,o)}),{})}a(vco,"FromPropertyKeys");function bco(t,e,r,n,o){return vco(t.keys,e,r,n,o)}a(bco,"FromMappedKey");function $jr(t,e,r,n,o){let s=bco(t,e,r,n,o);return Ua(s)}a($jr,"ExtendsFromMappedKey");p();function Sco(t){return t.allOf.every(e=>LB(e))}a(Sco,"Intersect");function Tco(t){return t.anyOf.some(e=>LB(e))}a(Tco,"Union");function Ico(t){return!LB(t.not)}a(Ico,"Not");function LB(t){return t[_t]==="Intersect"?Sco(t):t[_t]==="Union"?Tco(t):t[_t]==="Not"?Ico(t):t[_t]==="Undefined"}a(LB,"ExtendsUndefinedCheck");p();function Vjr(t,e){return Lie(JV(t),e)}a(Vjr,"ExcludeFromTemplateLiteral");function xco(t,e){let r=t.filter(n=>L9(n,e)===xt.False);return r.length===1?r[0]:Xa(r)}a(xco,"ExcludeRest");function Lie(t,e,r={}){return x1(t)?Tt(Vjr(t,e),r):Nu(t)?Tt(Wjr(t,e),r):Tt(ba(t)?xco(t.anyOf,e):L9(t,e)!==xt.False?Ko():t,r)}a(Lie,"Exclude");function wco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Lie(t[n],e);return r}a(wco,"FromProperties");function Rco(t,e){return wco(t.properties,e)}a(Rco,"FromMappedResult");function Wjr(t,e){let r=Rco(t,e);return Ua(r)}a(Wjr,"ExcludeFromMappedResult");p();p();p();function zjr(t,e){return Fie(JV(t),e)}a(zjr,"ExtractFromTemplateLiteral");function kco(t,e){let r=t.filter(n=>L9(n,e)!==xt.False);return r.length===1?r[0]:Xa(r)}a(kco,"ExtractRest");function Fie(t,e,r){return x1(t)?Tt(zjr(t,e),r):Nu(t)?Tt(Yjr(t,e),r):Tt(ba(t)?kco(t.anyOf,e):L9(t,e)!==xt.False?t:Ko(),r)}a(Fie,"Extract");function Pco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Fie(t[n],e);return r}a(Pco,"FromProperties");function Dco(t,e){return Pco(t.properties,e)}a(Dco,"FromMappedResult");function Yjr(t,e){let r=Dco(t,e);return Ua(r)}a(Yjr,"ExtractFromMappedResult");p();function Kjr(t,e){return uk(t)?Tt(t.returns,e):Ko(e)}a(Kjr,"InstanceType");p();p();function D6e(t){return VC(gy(t))}a(D6e,"ReadonlyOptional");p();function ZV(t,e,r){return Tt({[_t]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(ZV,"RecordCreateFromPattern");function gRt(t,e,r){let n={};for(let o of t)n[o]=e;return ec(n,{...r,[SI]:"Record"})}a(gRt,"RecordCreateFromKeys");function Nco(t,e,r){return y6e(t)?gRt($C(t),e,r):ZV(t.pattern,e,r)}a(Nco,"FromTemplateLiteralKey");function Mco(t,e,r){return gRt($C(Xa(t)),e,r)}a(Mco,"FromUnionKey");function Oco(t,e,r){return gRt([t.toString()],e,r)}a(Oco,"FromLiteralKey");function Bco(t,e,r){return ZV(t.source,e,r)}a(Bco,"FromRegExpKey");function Lco(t,e,r){let n=Tp(t.pattern)?M9:t.pattern;return ZV(n,e,r)}a(Lco,"FromStringKey");function Fco(t,e,r){return ZV(M9,e,r)}a(Fco,"FromAnyKey");function Uco(t,e,r){return ZV(ojr,e,r)}a(Uco,"FromNeverKey");function Qco(t,e,r){return ec({true:e,false:e},r)}a(Qco,"FromBooleanKey");function qco(t,e,r){return ZV(N9,e,r)}a(qco,"FromIntegerKey");function jco(t,e,r){return ZV(N9,e,r)}a(jco,"FromNumberKey");function N6e(t,e,r={}){return ba(t)?Mco(t.anyOf,e,r):x1(t)?Nco(t,e,r):T1(t)?Oco(t.const,e,r):PB(t)?Qco(t,e,r):fk(t)?qco(t,e,r):pk(t)?jco(t,e,r):Ywt(t)?Bco(t,e,r):DB(t)?Lco(t,e,r):Wwt(t)?Fco(t,e,r):P9(t)?Uco(t,e,r):Ko(r)}a(N6e,"Record");function M6e(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(M6e,"RecordPattern");function Jjr(t){let e=M6e(t);return e===M9?o_():e===N9?TI():o_({pattern:e})}a(Jjr,"RecordKey");function O6e(t){return t.patternProperties[M6e(t)]}a(O6e,"RecordValue");function Hco(t,e){return e.parameters=TCe(t,e.parameters),e.returns=gk(t,e.returns),e}a(Hco,"FromConstructor");function Gco(t,e){return e.parameters=TCe(t,e.parameters),e.returns=gk(t,e.returns),e}a(Gco,"FromFunction");function $co(t,e){return e.allOf=TCe(t,e.allOf),e}a($co,"FromIntersect");function Vco(t,e){return e.anyOf=TCe(t,e.anyOf),e}a(Vco,"FromUnion");function Wco(t,e){return Tp(e.items)||(e.items=TCe(t,e.items)),e}a(Wco,"FromTuple");function zco(t,e){return e.items=gk(t,e.items),e}a(zco,"FromArray");function Yco(t,e){return e.items=gk(t,e.items),e}a(Yco,"FromAsyncIterator");function Kco(t,e){return e.items=gk(t,e.items),e}a(Kco,"FromIterator");function Jco(t,e){return e.item=gk(t,e.item),e}a(Jco,"FromPromise");function Zco(t,e){let r=rlo(t,e.properties);return{...e,...ec(r)}}a(Zco,"FromObject");function Xco(t,e){let r=gk(t,Jjr(e)),n=gk(t,O6e(e)),o=N6e(r,n);return{...e,...o}}a(Xco,"FromRecord");function elo(t,e){return e.index in t?t[e.index]:mk()}a(elo,"FromArgument");function tlo(t,e){let r=vie(e),n=GC(e),o=gk(t,e);return r&&n?D6e(o):r&&!n?VC(o):!r&&n?gy(o):o}a(tlo,"FromProperty");function rlo(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:tlo(t,e[n])}),{})}a(rlo,"FromProperties");function TCe(t,e){return e.map(r=>gk(t,r))}a(TCe,"FromTypes");function gk(t,e){return uk(e)?Hco(t,e):dk(e)?Gco(t,e):Zd(e)?$co(t,e):ba(e)?Vco(t,e):w1(e)?Wco(t,e):ck(e)?zco(t,e):$V(e)?Yco(t,e):WV(e)?Kco(t,e):zV(e)?Jco(t,e):Ip(e)?Zco(t,e):YV(e)?Xco(t,e):zwt(e)?elo(t,e):e}a(gk,"FromType");function Zjr(t,e){return gk(e,_ie(t))}a(Zjr,"Instantiate");p();function Xjr(t){return Tt({[_t]:"Integer",type:"integer"},t)}a(Xjr,"Integer");p();p();p();function nlo(t,e,r){return{[t]:Ak(oa(t),e,Pu(r))}}a(nlo,"MappedIntrinsicPropertyKey");function ilo(t,e,r){return t.reduce((o,s)=>({...o,...nlo(s,e,r)}),{})}a(ilo,"MappedIntrinsicPropertyKeys");function olo(t,e,r){return ilo(t.keys,e,r)}a(olo,"MappedIntrinsicProperties");function eHr(t,e,r){let n=olo(t,e,r);return Ua(n)}a(eHr,"IntrinsicFromMappedKey");function slo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(slo,"ApplyUncapitalize");function alo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(alo,"ApplyCapitalize");function clo(t){return t.toUpperCase()}a(clo,"ApplyUppercase");function llo(t){return t.toLowerCase()}a(llo,"ApplyLowercase");function ulo(t,e,r){let n=Rie(t.pattern);if(!KV(n))return{...t,pattern:tHr(t.pattern,e)};let c=[...CCe(n)].map(d=>oa(d)),l=rHr(c,e),u=Xa(l);return _6e([u],r)}a(ulo,"FromTemplateLiteral");function tHr(t,e){return typeof t=="string"?e==="Uncapitalize"?slo(t):e==="Capitalize"?alo(t):e==="Uppercase"?clo(t):e==="Lowercase"?llo(t):t:t.toString()}a(tHr,"FromLiteralValue");function rHr(t,e){return t.map(r=>Ak(r,e))}a(rHr,"FromRest");function Ak(t,e,r={}){return I1(t)?eHr(t,e,r):x1(t)?ulo(t,e,r):ba(t)?Xa(rHr(t.anyOf,e),r):T1(t)?oa(tHr(t.const,e),r):Tt(t,r)}a(Ak,"Intrinsic");function nHr(t,e={}){return Ak(t,"Capitalize",e)}a(nHr,"Capitalize");p();function iHr(t,e={}){return Ak(t,"Lowercase",e)}a(iHr,"Lowercase");p();function oHr(t,e={}){return Ak(t,"Uncapitalize",e)}a(oHr,"Uncapitalize");p();function sHr(t,e={}){return Ak(t,"Uppercase",e)}a(sHr,"Uppercase");p();p();p();p();p();function dlo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=F9(t[o],e,Pu(r));return n}a(dlo,"FromProperties");function flo(t,e,r){return dlo(t.properties,e,r)}a(flo,"FromMappedResult");function aHr(t,e,r){let n=flo(t,e,r);return Ua(n)}a(aHr,"OmitFromMappedResult");function plo(t,e){return t.map(r=>ARt(r,e))}a(plo,"FromIntersect");function hlo(t,e){return t.map(r=>ARt(r,e))}a(hlo,"FromUnion");function mlo(t,e){let{[e]:r,...n}=t;return n}a(mlo,"FromProperty");function glo(t,e){return e.reduce((r,n)=>mlo(r,n),t)}a(glo,"FromProperties");function Alo(t,e,r){let n=Xd(t,[Cd,"$id","required","properties"]),o=glo(r,e);return ec(o,n)}a(Alo,"FromObject");function ylo(t){let e=t.reduce((r,n)=>m6e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(ylo,"UnionFromPropertyKeys");function ARt(t,e){return Zd(t)?Ay(plo(t.allOf,e)):ba(t)?Xa(hlo(t.anyOf,e)):Ip(t)?Alo(t,e,t.properties):ec({})}a(ARt,"OmitResolve");function F9(t,e,r){let n=Sp(e)?ylo(e):e,o=vd(e)?$C(e):e,s=Mf(t),c=Mf(e);return Nu(t)?aHr(t,o,r):I1(e)?cHr(t,e,r):s&&c?tu("Omit",[t,n],r):!s&&c?tu("Omit",[t,n],r):s&&!c?tu("Omit",[t,n],r):Tt({...ARt(t,o),...r})}a(F9,"Omit");function Elo(t,e,r){return{[e]:F9(t,[e],Pu(r))}}a(Elo,"FromPropertyKey");function _lo(t,e,r){return e.reduce((n,o)=>({...n,...Elo(t,o,r)}),{})}a(_lo,"FromPropertyKeys");function Clo(t,e,r){return _lo(t,e.keys,r)}a(Clo,"FromMappedKey");function cHr(t,e,r){let n=Clo(t,e,r);return Ua(n)}a(cHr,"OmitFromMappedKey");p();p();p();function vlo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=U9(t[o],e,Pu(r));return n}a(vlo,"FromProperties");function blo(t,e,r){return vlo(t.properties,e,r)}a(blo,"FromMappedResult");function lHr(t,e,r){let n=blo(t,e,r);return Ua(n)}a(lHr,"PickFromMappedResult");function Slo(t,e){return t.map(r=>yRt(r,e))}a(Slo,"FromIntersect");function Tlo(t,e){return t.map(r=>yRt(r,e))}a(Tlo,"FromUnion");function Ilo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(Ilo,"FromProperties");function xlo(t,e,r){let n=Xd(t,[Cd,"$id","required","properties"]),o=Ilo(r,e);return ec(o,n)}a(xlo,"FromObject");function wlo(t){let e=t.reduce((r,n)=>m6e(n)?[...r,oa(n)]:r,[]);return Xa(e)}a(wlo,"UnionFromPropertyKeys");function yRt(t,e){return Zd(t)?Ay(Slo(t.allOf,e)):ba(t)?Xa(Tlo(t.anyOf,e)):Ip(t)?xlo(t,e,t.properties):ec({})}a(yRt,"PickResolve");function U9(t,e,r){let n=Sp(e)?wlo(e):e,o=vd(e)?$C(e):e,s=Mf(t),c=Mf(e);return Nu(t)?lHr(t,o,r):I1(e)?uHr(t,e,r):s&&c?tu("Pick",[t,n],r):!s&&c?tu("Pick",[t,n],r):s&&!c?tu("Pick",[t,n],r):Tt({...yRt(t,o),...r})}a(U9,"Pick");function Rlo(t,e,r){return{[e]:U9(t,[e],Pu(r))}}a(Rlo,"FromPropertyKey");function klo(t,e,r){return e.reduce((n,o)=>({...n,...Rlo(t,o,r)}),{})}a(klo,"FromPropertyKeys");function Plo(t,e,r){return klo(t,e.keys,r)}a(Plo,"FromMappedKey");function uHr(t,e,r){let n=Plo(t,e,r);return Ua(n)}a(uHr,"PickFromMappedKey");p();p();function Dlo(t,e){return tu("Partial",[tu(t,e)])}a(Dlo,"FromComputed");function Nlo(t){return tu("Partial",[wI(t)])}a(Nlo,"FromRef");function Mlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=gy(t[r]);return e}a(Mlo,"FromProperties");function Olo(t,e){let r=Xd(t,[Cd,"$id","required","properties"]),n=Mlo(e);return ec(n,r)}a(Olo,"FromObject");function dHr(t){return t.map(e=>fHr(e))}a(dHr,"FromRest");function fHr(t){return lk(t)?Dlo(t.target,t.parameters):Mf(t)?Nlo(t.$ref):Zd(t)?Ay(dHr(t.allOf)):ba(t)?Xa(dHr(t.anyOf)):Ip(t)?Olo(t,t.properties):VV(t)||PB(t)||fk(t)||T1(t)||hCe(t)||pk(t)||DB(t)||mCe(t)||NB(t)?t:ec({})}a(fHr,"PartialResolve");function Uie(t,e){return Nu(t)?pHr(t,e):Tt({...fHr(t),...e})}a(Uie,"Partial");function Blo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Uie(t[n],Pu(e));return r}a(Blo,"FromProperties");function Llo(t,e){return Blo(t.properties,e)}a(Llo,"FromMappedResult");function pHr(t,e){let r=Llo(t,e);return Ua(r)}a(pHr,"PartialFromMappedResult");p();p();function Flo(t,e){return tu("Required",[tu(t,e)])}a(Flo,"FromComputed");function Ulo(t){return tu("Required",[wI(t)])}a(Ulo,"FromRef");function Qlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Xd(t[r],[zg]);return e}a(Qlo,"FromProperties");function qlo(t,e){let r=Xd(t,[Cd,"$id","required","properties"]),n=Qlo(e);return ec(n,r)}a(qlo,"FromObject");function hHr(t){return t.map(e=>mHr(e))}a(hHr,"FromRest");function mHr(t){return lk(t)?Flo(t.target,t.parameters):Mf(t)?Ulo(t.$ref):Zd(t)?Ay(hHr(t.allOf)):ba(t)?Xa(hHr(t.anyOf)):Ip(t)?qlo(t,t.properties):VV(t)||PB(t)||fk(t)||T1(t)||hCe(t)||pk(t)||DB(t)||mCe(t)||NB(t)?t:ec({})}a(mHr,"RequiredResolve");function Qie(t,e){return Nu(t)?gHr(t,e):Tt({...mHr(t),...e})}a(Qie,"Required");function jlo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Qie(t[n],e);return r}a(jlo,"FromProperties");function Hlo(t,e){return jlo(t.properties,e)}a(Hlo,"FromMappedResult");function gHr(t,e){let r=Hlo(t,e);return Ua(r)}a(gHr,"RequiredFromMappedResult");function Glo(t,e){return e.map(r=>Mf(r)?ERt(t,r.$ref):R1(t,r))}a(Glo,"DereferenceParameters");function ERt(t,e){return e in t?Mf(t[e])?ERt(t,t[e].$ref):R1(t,t[e]):Ko()}a(ERt,"Dereference");function $lo(t){return Nie(t[0])}a($lo,"FromAwaited");function Vlo(t){return B9(t[0],t[1])}a(Vlo,"FromIndex");function Wlo(t){return Mie(t[0])}a(Wlo,"FromKeyOf");function zlo(t){return Uie(t[0])}a(zlo,"FromPartial");function Ylo(t){return F9(t[0],t[1])}a(Ylo,"FromOmit");function Klo(t){return U9(t[0],t[1])}a(Klo,"FromPick");function Jlo(t){return Qie(t[0])}a(Jlo,"FromRequired");function Zlo(t,e,r){let n=Glo(t,r);return e==="Awaited"?$lo(n):e==="Index"?Vlo(n):e==="KeyOf"?Wlo(n):e==="Partial"?zlo(n):e==="Omit"?Ylo(n):e==="Pick"?Klo(n):e==="Required"?Jlo(n):Ko()}a(Zlo,"FromComputed");function Xlo(t,e){return Tie(R1(t,e))}a(Xlo,"FromArray");function euo(t,e){return Iie(R1(t,e))}a(euo,"FromAsyncIterator");function tuo(t,e,r){return xie(ICe(t,e),R1(t,r))}a(tuo,"FromConstructor");function ruo(t,e,r){return TN(ICe(t,e),R1(t,r))}a(ruo,"FromFunction");function nuo(t,e){return Ay(ICe(t,e))}a(nuo,"FromIntersect");function iuo(t,e){return Die(R1(t,e))}a(iuo,"FromIterator");function ouo(t,e){return ec(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:R1(t,e[n])}),{}))}a(ouo,"FromObject");function suo(t,e){let[r,n]=[R1(t,O6e(e)),M6e(e)],o=_ie(e);return o.patternProperties[n]=r,o}a(suo,"FromRecord");function auo(t,e){return Mf(e)?{...ERt(t,e.$ref),[Cd]:e[Cd]}:e}a(auo,"FromTransform");function cuo(t,e){return II(ICe(t,e))}a(cuo,"FromTuple");function luo(t,e){return Xa(ICe(t,e))}a(luo,"FromUnion");function ICe(t,e){return e.map(r=>R1(t,r))}a(ICe,"FromTypes");function R1(t,e){return GC(e)?Tt(R1(t,Xd(e,[zg])),e):vie(e)?Tt(R1(t,Xd(e,[ak])),e):Za(e)?Tt(auo(t,e),e):ck(e)?Tt(Xlo(t,e.items),e):$V(e)?Tt(euo(t,e.items),e):lk(e)?Tt(Zlo(t,e.target,e.parameters)):uk(e)?Tt(tuo(t,e.parameters,e.returns),e):dk(e)?Tt(ruo(t,e.parameters,e.returns),e):Zd(e)?Tt(nuo(t,e.allOf),e):WV(e)?Tt(iuo(t,e.items),e):Ip(e)?Tt(ouo(t,e.properties),e):YV(e)?Tt(suo(t,e)):w1(e)?Tt(cuo(t,e.items||[]),e):ba(e)?Tt(luo(t,e.anyOf),e):e}a(R1,"FromType");function uuo(t,e){return e in t?R1(t,t[e]):Ko()}a(uuo,"ComputeType");function AHr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:uuo(t,r)}),{})}a(AHr,"ComputeModuleProperties");var _Rt=class{static{a(this,"TModule")}constructor(e){let r=AHr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:Tt(this.$defs[e],r)};return Tt({[_t]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function yHr(t){return new _Rt(t)}a(yHr,"Module");p();function EHr(t,e){return Tt({[_t]:"Not",not:t},e)}a(EHr,"Not");p();function _Hr(t,e){return dk(t)?II(t.parameters,e):Ko()}a(_Hr,"Parameters");p();var duo=0;function CHr(t,e={}){Tp(e.$id)&&(e.$id=`T${duo++}`);let r=_ie(t({[_t]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,Tt({[SI]:"Recursive",...r},e)}a(CHr,"Recursive");p();function vHr(t,e){let r=Ol(t)?new globalThis.RegExp(t):t;return Tt({[_t]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(vHr,"RegExp");p();function fuo(t){return Zd(t)?t.allOf:ba(t)?t.anyOf:w1(t)?t.items??[]:[]}a(fuo,"RestResolve");function bHr(t){return fuo(t)}a(bHr,"Rest");p();function SHr(t,e){return dk(t)?Tt(t.returns,e):Ko(e)}a(SHr,"ReturnType");p();var CRt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new vRt(this.schema,e)}},vRt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[Cd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[Cd].Decode(c)),"Decode")};return{...r,[Cd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[Cd]:n}}Encode(e){return Za(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function THr(t){return new CRt(t)}a(THr,"Transform");p();function IHr(t={}){return Tt({[_t]:t[_t]??"Unsafe"},t)}a(IHr,"Unsafe");p();function xHr(t){return Tt({[_t]:"Void",type:"void"},t)}a(xHr,"Void");p();var bRt={};wi(bRt,{Any:()=>O9,Argument:()=>ujr,Array:()=>Tie,AsyncIterator:()=>Iie,Awaited:()=>Nie,BigInt:()=>Pie,Boolean:()=>E6e,Capitalize:()=>nHr,Composite:()=>Rjr,Const:()=>kjr,Constructor:()=>xie,ConstructorParameters:()=>Pjr,Date:()=>S6e,Enum:()=>Djr,Exclude:()=>Lie,Extends:()=>Bie,Extract:()=>Fie,Function:()=>TN,Index:()=>B9,InstanceType:()=>Kjr,Instantiate:()=>Zjr,Integer:()=>Xjr,Intersect:()=>Ay,Iterator:()=>Die,KeyOf:()=>Mie,Literal:()=>oa,Lowercase:()=>iHr,Mapped:()=>bjr,Module:()=>yHr,Never:()=>Ko,Not:()=>EHr,Null:()=>T6e,Number:()=>TI,Object:()=>ec,Omit:()=>F9,Optional:()=>gy,Parameters:()=>_Hr,Partial:()=>Uie,Pick:()=>U9,Promise:()=>v6e,Readonly:()=>VC,ReadonlyOptional:()=>D6e,Record:()=>N6e,Recursive:()=>CHr,Ref:()=>wI,RegExp:()=>vHr,Required:()=>Qie,Rest:()=>bHr,ReturnType:()=>SHr,String:()=>o_,Symbol:()=>I6e,TemplateLiteral:()=>_6e,Transform:()=>THr,Tuple:()=>II,Uint8Array:()=>w6e,Uncapitalize:()=>oHr,Undefined:()=>x6e,Union:()=>Xa,Unknown:()=>mk,Unsafe:()=>IHr,Uppercase:()=>sHr,Void:()=>xHr});p();var S=bRt;p();p();function puo(t){switch(t.errorType){case Et.ArrayContains:return"Expected array to contain at least one matching value";case Et.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case Et.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case Et.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case Et.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case Et.ArrayUniqueItems:return"Expected array elements to be unique";case Et.Array:return"Expected array";case Et.AsyncIterator:return"Expected AsyncIterator";case Et.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case Et.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case Et.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case Et.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case Et.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case Et.BigInt:return"Expected bigint";case Et.Boolean:return"Expected boolean";case Et.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case Et.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case Et.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case Et.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case Et.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case Et.Date:return"Expected Date";case Et.Function:return"Expected function";case Et.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case Et.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case Et.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case Et.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case Et.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case Et.Integer:return"Expected integer";case Et.IntersectUnevaluatedProperties:return"Unexpected property";case Et.Intersect:return"Expected all values to match";case Et.Iterator:return"Expected Iterator";case Et.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case Et.Never:return"Never";case Et.Not:return"Value should not match";case Et.Null:return"Expected null";case Et.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case Et.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case Et.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case Et.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case Et.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case Et.Number:return"Expected number";case Et.Object:return"Expected object";case Et.ObjectAdditionalProperties:return"Unexpected property";case Et.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case Et.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case Et.ObjectRequiredProperty:return"Expected required property";case Et.Promise:return"Expected Promise";case Et.RegExp:return"Expected string to match regular expression";case Et.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case Et.StringFormat:return`Expected string to match '${t.schema.format}' format`;case Et.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case Et.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case Et.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case Et.String:return"Expected string";case Et.Symbol:return"Expected symbol";case Et.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case Et.Tuple:return"Expected tuple";case Et.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case Et.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case Et.Uint8Array:return"Expected Uint8Array";case Et.Undefined:return"Expected undefined";case Et.Union:return"Expected union value";case Et.Void:return"Expected void";case Et.Kind:return`Expected kind '${t.schema[_t]}'`;default:return"Unknown error type"}}a(puo,"DefaultErrorFunction");var huo=puo;function wHr(){return huo}a(wHr,"GetErrorFunction");p();var SRt=class extends qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function muo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new SRt(t);return Sa(r,e)}a(muo,"Resolve");function Dm(t,e){return!va(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Dm,"Pushref");function Sa(t,e){return t[_t]==="This"||t[_t]==="Ref"?muo(t,e):t}a(Sa,"Deref");p();var TRt=class extends qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},k1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(k1||(k1={}));var qie=BigInt("14695981039346656037"),[guo,Auo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],yuo=Array.from({length:256}).map((t,e)=>BigInt(e)),RHr=new Float64Array(1),kHr=new DataView(RHr.buffer),PHr=new Uint8Array(RHr.buffer);function*Euo(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(Euo,"NumberToBytes");function _uo(t){Ey(k1.Array);for(let e of t)jie(e)}a(_uo,"ArrayType");function Cuo(t){Ey(k1.Boolean),Ey(t?1:0)}a(Cuo,"BooleanType");function vuo(t){Ey(k1.BigInt),kHr.setBigInt64(0,t);for(let e of PHr)Ey(e)}a(vuo,"BigIntType");function buo(t){Ey(k1.Date),jie(t.getTime())}a(buo,"DateType");function Suo(t){Ey(k1.Null)}a(Suo,"NullType");function Tuo(t){Ey(k1.Number),kHr.setFloat64(0,t);for(let e of PHr)Ey(e)}a(Tuo,"NumberType");function Iuo(t){Ey(k1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())jie(e),jie(t[e])}a(Iuo,"ObjectType");function xuo(t){Ey(k1.String);for(let e=0;e=t.minItems)||Gs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Nm(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=Q9(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(Gs(t.contains)||oi(t.minContains)||oi(t.maxContains)))return!0;let n=Gs(t.contains)?t.contains:Ko(),o=r.reduce((s,c)=>Nm(n,e,c)?s+1:s,0);return!(o===0||oi(t.minContains)&&ot.maxContains)}a(Muo,"FromArray");function Ouo(t,e,r){return d6e(r)}a(Ouo,"FromAsyncIterator");function Buo(t,e,r){return!(!Wg(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Buo,"FromBigInt");function Luo(t,e,r){return SN(r)}a(Luo,"FromBoolean");function Fuo(t,e,r){return Nm(t.returns,e,r.prototype)}a(Fuo,"FromConstructor");function Uuo(t,e,r){return!(!n_(r)||Gs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||Gs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||Gs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||Gs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Uuo,"FromDate");function Quo(t,e,r){return k9(r)}a(Quo,"FromFunction");function quo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Nm(o,[...e,...n],r)}a(quo,"FromImport");function juo(t,e,r){return!(!h6e(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.multipleOf)&&r%t.multipleOf!==0)}a(juo,"FromInteger");function Huo(t,e,r){let n=t.allOf.every(o=>Nm(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(BB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(vd(t.unevaluatedProperties)){let o=new RegExp(BB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Nm(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Huo,"FromIntersect");function Guo(t,e,r){return f6e(r)}a(Guo,"FromIterator");function $uo(t,e,r){return r===t.const}a($uo,"FromLiteral");function Vuo(t,e,r){return!1}a(Vuo,"FromNever");function Wuo(t,e,r){return!Nm(t.not,e,r)}a(Wuo,"FromNot");function zuo(t,e,r){return RB(r)}a(zuo,"FromNull");function Yuo(t,e,r){return!(!eu.IsNumberLike(r)||Gs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||Gs(t.minimum)&&!(r>=t.minimum)||Gs(t.maximum)&&!(r<=t.maximum)||Gs(t.multipleOf)&&r%t.multipleOf!==0)}a(Yuo,"FromNumber");function Kuo(t,e,r){if(!eu.IsObjectLike(r)||Gs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Gs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Nm(s,e,r[o])||(LB(s)||Puo(s))&&!(o in r))return!1}else if(eu.IsExactOptionalProperty(r,o)&&!Nm(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Nm(t.additionalProperties,e,r[s])):!0}a(Kuo,"FromObject");function Juo(t,e,r){return p6e(r)}a(Juo,"FromPromise");function Zuo(t,e,r){if(!eu.IsRecordLike(r)||Gs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||Gs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Nm(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Nm(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Zuo,"FromRecord");function Xuo(t,e,r){return Nm(Sa(t,e),e,r)}a(Xuo,"FromRef");function edo(t,e,r){let n=new RegExp(t.source,t.flags);return Gs(t.minLength)&&!(r.length>=t.minLength)||Gs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(edo,"FromRegExp");function tdo(t,e,r){return!va(r)||Gs(t.minLength)&&!(r.length>=t.minLength)||Gs(t.maxLength)&&!(r.length<=t.maxLength)||Gs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:Gs(t.format)?hk.Has(t.format)?hk.Get(t.format)(r):!1:!0}a(tdo,"FromString");function rdo(t,e,r){return kB(r)}a(rdo,"FromSymbol");function ndo(t,e,r){return va(r)&&new RegExp(t.pattern).test(r)}a(ndo,"FromTemplateLiteral");function ido(t,e,r){return Nm(Sa(t,e),e,r)}a(ido,"FromThis");function odo(t,e,r){if(!Ri(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nNm(n,e,r))}a(ado,"FromUnion");function cdo(t,e,r){return!(!Cie(r)||Gs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||Gs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(cdo,"FromUint8Array");function ldo(t,e,r){return!0}a(ldo,"FromUnknown");function udo(t,e,r){return eu.IsVoidLike(r)}a(udo,"FromVoid");function ddo(t,e,r){return i_.Has(t[_t])?i_.Get(t[_t])(t,r):!1}a(ddo,"FromKind");function Nm(t,e,r){let n=Gs(t.$id)?Dm(t,e):e,o=t;switch(o[_t]){case"Any":return Duo(o,n,r);case"Argument":return Nuo(o,n,r);case"Array":return Muo(o,n,r);case"AsyncIterator":return Ouo(o,n,r);case"BigInt":return Buo(o,n,r);case"Boolean":return Luo(o,n,r);case"Constructor":return Fuo(o,n,r);case"Date":return Uuo(o,n,r);case"Function":return Quo(o,n,r);case"Import":return quo(o,n,r);case"Integer":return juo(o,n,r);case"Intersect":return Huo(o,n,r);case"Iterator":return Guo(o,n,r);case"Literal":return $uo(o,n,r);case"Never":return Vuo(o,n,r);case"Not":return Wuo(o,n,r);case"Null":return zuo(o,n,r);case"Number":return Yuo(o,n,r);case"Object":return Kuo(o,n,r);case"Promise":return Juo(o,n,r);case"Record":return Zuo(o,n,r);case"Ref":return Xuo(o,n,r);case"RegExp":return edo(o,n,r);case"String":return tdo(o,n,r);case"Symbol":return rdo(o,n,r);case"TemplateLiteral":return ndo(o,n,r);case"This":return ido(o,n,r);case"Tuple":return odo(o,n,r);case"Undefined":return sdo(o,n,r);case"Union":return ado(o,n,r);case"Uint8Array":return cdo(o,n,r);case"Unknown":return ldo(o,n,r);case"Void":return udo(o,n,r);default:if(!i_.Has(o[_t]))throw new IRt(o);return ddo(o,n,r)}}a(Nm,"Visit");function Jo(...t){return t.length===3?Nm(t[0],t[1],t[2]):Nm(t[0],[],t[1])}a(Jo,"Check");var Et;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(Et||(Et={}));var xRt=class extends qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function FB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(FB,"EscapeKey");function $s(t){return t!==void 0}a($s,"IsDefined");var q9=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function on(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:wHr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(on,"Create");function*fdo(t,e,r,n){}a(fdo,"FromAny");function*pdo(t,e,r,n){}a(pdo,"FromArgument");function*hdo(t,e,r,n){if(!Ri(n))return yield on(Et.Array,t,r,n);$s(t.minItems)&&!(n.length>=t.minItems)&&(yield on(Et.ArrayMinItems,t,r,n)),$s(t.maxItems)&&!(n.length<=t.maxItems)&&(yield on(Et.ArrayMaxItems,t,r,n));for(let c=0;cMm(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield on(Et.ArrayContains,t,r,n)),oi(t.minContains)&&st.maxContains&&(yield on(Et.ArrayMaxContains,t,r,n))}a(hdo,"FromArray");function*mdo(t,e,r,n){d6e(n)||(yield on(Et.AsyncIterator,t,r,n))}a(mdo,"FromAsyncIterator");function*gdo(t,e,r,n){if(!Wg(n))return yield on(Et.BigInt,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.BigIntExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.BigIntMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.BigIntMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield on(Et.BigIntMultipleOf,t,r,n))}a(gdo,"FromBigInt");function*Ado(t,e,r,n){SN(n)||(yield on(Et.Boolean,t,r,n))}a(Ado,"FromBoolean");function*ydo(t,e,r,n){yield*Mm(t.returns,e,r,n.prototype)}a(ydo,"FromConstructor");function*Edo(t,e,r,n){if(!n_(n))return yield on(Et.Date,t,r,n);$s(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield on(Et.DateExclusiveMinimumTimestamp,t,r,n)),$s(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield on(Et.DateMaximumTimestamp,t,r,n)),$s(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield on(Et.DateMinimumTimestamp,t,r,n)),$s(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield on(Et.DateMultipleOfTimestamp,t,r,n))}a(Edo,"FromDate");function*_do(t,e,r,n){k9(n)||(yield on(Et.Function,t,r,n))}a(_do,"FromFunction");function*Cdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Mm(s,[...e,...o],r,n)}a(Cdo,"FromImport");function*vdo(t,e,r,n){if(!h6e(n))return yield on(Et.Integer,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.IntegerExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.IntegerMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.IntegerMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(Et.IntegerMultipleOf,t,r,n))}a(vdo,"FromInteger");function*bdo(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Mm(s,e,r,n))o=!0,yield c;if(o)return yield on(Et.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(BB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield on(Et.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(BB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Mm(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(bdo,"FromIntersect");function*Sdo(t,e,r,n){f6e(n)||(yield on(Et.Iterator,t,r,n))}a(Sdo,"FromIterator");function*Tdo(t,e,r,n){n!==t.const&&(yield on(Et.Literal,t,r,n))}a(Tdo,"FromLiteral");function*Ido(t,e,r,n){yield on(Et.Never,t,r,n)}a(Ido,"FromNever");function*xdo(t,e,r,n){Mm(t.not,e,r,n).next().done===!0&&(yield on(Et.Not,t,r,n))}a(xdo,"FromNot");function*wdo(t,e,r,n){RB(n)||(yield on(Et.Null,t,r,n))}a(wdo,"FromNull");function*Rdo(t,e,r,n){if(!eu.IsNumberLike(n))return yield on(Et.Number,t,r,n);$s(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield on(Et.NumberExclusiveMinimum,t,r,n)),$s(t.maximum)&&!(n<=t.maximum)&&(yield on(Et.NumberMaximum,t,r,n)),$s(t.minimum)&&!(n>=t.minimum)&&(yield on(Et.NumberMinimum,t,r,n)),$s(t.multipleOf)&&n%t.multipleOf!==0&&(yield on(Et.NumberMultipleOf,t,r,n))}a(Rdo,"FromNumber");function*kdo(t,e,r,n){if(!eu.IsObjectLike(n))return yield on(Et.Object,t,r,n);$s(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(Et.ObjectMinProperties,t,r,n)),$s(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(Et.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield on(Et.ObjectRequiredProperty,t.properties[l],`${r}/${FB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield on(Et.ObjectAdditionalProperties,t,`${r}/${FB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Mm(t.additionalProperties,e,`${r}/${FB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Mm(u,e,`${r}/${FB(l)}`,n[l]),LB(t)&&!(l in n)&&(yield on(Et.ObjectRequiredProperty,u,`${r}/${FB(l)}`,void 0))):eu.IsExactOptionalProperty(n,l)&&(yield*Mm(u,e,`${r}/${FB(l)}`,n[l]))}}a(kdo,"FromObject");function*Pdo(t,e,r,n){p6e(n)||(yield on(Et.Promise,t,r,n))}a(Pdo,"FromPromise");function*Ddo(t,e,r,n){if(!eu.IsRecordLike(n))return yield on(Et.Object,t,r,n);$s(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield on(Et.ObjectMinProperties,t,r,n)),$s(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield on(Et.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*Mm(s,e,`${r}/${FB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Mm(t.additionalProperties,e,`${r}/${FB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield on(Et.ObjectAdditionalProperties,t,`${r}/${FB(l)}`,u)}}a(Ddo,"FromRecord");function*Ndo(t,e,r,n){yield*Mm(Sa(t,e),e,r,n)}a(Ndo,"FromRef");function*Mdo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);if($s(t.minLength)&&!(n.length>=t.minLength)&&(yield on(Et.StringMinLength,t,r,n)),$s(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(Et.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield on(Et.RegExp,t,r,n)}a(Mdo,"FromRegExp");function*Odo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);$s(t.minLength)&&!(n.length>=t.minLength)&&(yield on(Et.StringMinLength,t,r,n)),$s(t.maxLength)&&!(n.length<=t.maxLength)&&(yield on(Et.StringMaxLength,t,r,n)),va(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield on(Et.StringPattern,t,r,n))),va(t.format)&&(hk.Has(t.format)?hk.Get(t.format)(n)||(yield on(Et.StringFormat,t,r,n)):yield on(Et.StringFormatUnknown,t,r,n))}a(Odo,"FromString");function*Bdo(t,e,r,n){kB(n)||(yield on(Et.Symbol,t,r,n))}a(Bdo,"FromSymbol");function*Ldo(t,e,r,n){if(!va(n))return yield on(Et.String,t,r,n);new RegExp(t.pattern).test(n)||(yield on(Et.StringPattern,t,r,n))}a(Ldo,"FromTemplateLiteral");function*Fdo(t,e,r,n){yield*Mm(Sa(t,e),e,r,n)}a(Fdo,"FromThis");function*Udo(t,e,r,n){if(!Ri(n))return yield on(Et.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield on(Et.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield on(Et.TupleLength,t,r,n);if(t.items)for(let o=0;onew q9(Mm(s,e,r,n)));yield on(Et.Union,t,r,n,o)}a(qdo,"FromUnion");function*jdo(t,e,r,n){if(!Cie(n))return yield on(Et.Uint8Array,t,r,n);$s(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield on(Et.Uint8ArrayMaxByteLength,t,r,n)),$s(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield on(Et.Uint8ArrayMinByteLength,t,r,n))}a(jdo,"FromUint8Array");function*Hdo(t,e,r,n){}a(Hdo,"FromUnknown");function*Gdo(t,e,r,n){eu.IsVoidLike(n)||(yield on(Et.Void,t,r,n))}a(Gdo,"FromVoid");function*$do(t,e,r,n){i_.Get(t[_t])(t,n)||(yield on(Et.Kind,t,r,n))}a($do,"FromKind");function*Mm(t,e,r,n){let o=$s(t.$id)?[...e,t]:e,s=t;switch(s[_t]){case"Any":return yield*fdo(s,o,r,n);case"Argument":return yield*pdo(s,o,r,n);case"Array":return yield*hdo(s,o,r,n);case"AsyncIterator":return yield*mdo(s,o,r,n);case"BigInt":return yield*gdo(s,o,r,n);case"Boolean":return yield*Ado(s,o,r,n);case"Constructor":return yield*ydo(s,o,r,n);case"Date":return yield*Edo(s,o,r,n);case"Function":return yield*_do(s,o,r,n);case"Import":return yield*Cdo(s,o,r,n);case"Integer":return yield*vdo(s,o,r,n);case"Intersect":return yield*bdo(s,o,r,n);case"Iterator":return yield*Sdo(s,o,r,n);case"Literal":return yield*Tdo(s,o,r,n);case"Never":return yield*Ido(s,o,r,n);case"Not":return yield*xdo(s,o,r,n);case"Null":return yield*wdo(s,o,r,n);case"Number":return yield*Rdo(s,o,r,n);case"Object":return yield*kdo(s,o,r,n);case"Promise":return yield*Pdo(s,o,r,n);case"Record":return yield*Ddo(s,o,r,n);case"Ref":return yield*Ndo(s,o,r,n);case"RegExp":return yield*Mdo(s,o,r,n);case"String":return yield*Odo(s,o,r,n);case"Symbol":return yield*Bdo(s,o,r,n);case"TemplateLiteral":return yield*Ldo(s,o,r,n);case"This":return yield*Fdo(s,o,r,n);case"Tuple":return yield*Udo(s,o,r,n);case"Undefined":return yield*Qdo(s,o,r,n);case"Union":return yield*qdo(s,o,r,n);case"Uint8Array":return yield*jdo(s,o,r,n);case"Unknown":return yield*Hdo(s,o,r,n);case"Void":return yield*Gdo(s,o,r,n);default:if(!i_.Has(s[_t]))throw new xRt(t);return yield*$do(s,o,r,n)}}a(Mm,"Visit");function xN(...t){let e=t.length===3?Mm(t[0],t[1],"",t[2]):Mm(t[0],[],"",t[1]);return new q9(e)}a(xN,"Errors");p();p();var Hie=class extends qi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},wRt=class extends qi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function bd(t,e,r){try{return Za(t)?t[Cd].Decode(r):r}catch(n){throw new wRt(t,e,r,n)}}a(bd,"Default");function Vdo(t,e,r,n){return Ri(n)?bd(t,r,n.map((o,s)=>yk(t.items,e,`${r}/${s}`,o))):bd(t,r,n)}a(Vdo,"FromArray");function Wdo(t,e,r,n){if(!So(n)||S1(n))return bd(t,r,n);let o=b6e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=yk(h,e,`${r}/${f}`,c[f]));if(!Za(t.unevaluatedProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(Wdo,"FromIntersect");function zdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=yk(s,[...e,...o],r,n);return bd(t,r,c)}a(zdo,"FromImport");function Ydo(t,e,r,n){return bd(t,r,yk(t.not,e,r,n))}a(Ydo,"FromNot");function Kdo(t,e,r,n){if(!So(n))return bd(t,r,n);let o=WC(t),s={...n};for(let d of o)Qi(s,d)&&(Du(s[d])&&(!NB(t.properties[d])||eu.IsExactOptionalProperty(s,d))||(s[d]=yk(t.properties[d],e,`${r}/${d}`,s[d])));if(!vd(t.additionalProperties))return bd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=bd(l,`${r}/${d}`,u[d]));return bd(t,r,u)}a(Kdo,"FromObject");function Jdo(t,e,r,n){if(!So(n))return bd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=yk(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!vd(t.additionalProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(Jdo,"FromRecord");function Zdo(t,e,r,n){let o=Sa(t,e);return bd(t,r,yk(o,e,r,n))}a(Zdo,"FromRef");function Xdo(t,e,r,n){let o=Sa(t,e);return bd(t,r,yk(o,e,r,n))}a(Xdo,"FromThis");function efo(t,e,r,n){return Ri(n)&&Ri(t.items)?bd(t,r,t.items.map((o,s)=>yk(o,e,`${r}/${s}`,n[s]))):bd(t,r,n)}a(efo,"FromTuple");function tfo(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=yk(o,e,r,n);return bd(t,r,s)}return bd(t,r,n)}a(tfo,"FromUnion");function yk(t,e,r,n){let o=Dm(t,e),s=t;switch(t[_t]){case"Array":return Vdo(s,o,r,n);case"Import":return zdo(s,o,r,n);case"Intersect":return Wdo(s,o,r,n);case"Not":return Ydo(s,o,r,n);case"Object":return Kdo(s,o,r,n);case"Record":return Jdo(s,o,r,n);case"Ref":return Zdo(s,o,r,n);case"Symbol":return bd(s,r,n);case"This":return Xdo(s,o,r,n);case"Tuple":return efo(s,o,r,n);case"Union":return tfo(s,o,r,n);default:return bd(s,r,n)}}a(yk,"Visit");function Gie(t,e,r){return yk(t,e,"",r)}a(Gie,"TransformDecode");p();var $ie=class extends qi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},RRt=class extends qi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function Yg(t,e,r){try{return Za(t)?t[Cd].Encode(r):r}catch(n){throw new RRt(t,e,r,n)}}a(Yg,"Default");function rfo(t,e,r,n){let o=Yg(t,r,n);return Ri(o)?o.map((s,c)=>Ek(t.items,e,`${r}/${c}`,s)):o}a(rfo,"FromArray");function nfo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Yg(t,r,n);return Ek(s,[...e,...o],r,c)}a(nfo,"FromImport");function ifo(t,e,r,n){let o=Yg(t,r,n);if(!So(n)||S1(n))return o;let s=b6e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=Ek(m,e,`${r}/${h}`,l[h]));if(!Za(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Yg(d,`${r}/${h}`,f[h]));return f}a(ifo,"FromIntersect");function ofo(t,e,r,n){return Yg(t.not,r,Yg(t,r,n))}a(ofo,"FromNot");function sfo(t,e,r,n){let o=Yg(t,r,n);if(!So(o))return o;let s=WC(t),c={...o};for(let f of s)Qi(c,f)&&(Du(c[f])&&(!NB(t.properties[f])||eu.IsExactOptionalProperty(c,f))||(c[f]=Ek(t.properties[f],e,`${r}/${f}`,c[f])));if(!vd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Yg(u,`${r}/${f}`,d[f]));return d}a(sfo,"FromObject");function afo(t,e,r,n){let o=Yg(t,r,n);if(!So(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=Ek(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!vd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Yg(d,`${r}/${h}`,f[h]));return f}a(afo,"FromRecord");function cfo(t,e,r,n){let o=Sa(t,e),s=Ek(o,e,r,n);return Yg(t,r,s)}a(cfo,"FromRef");function lfo(t,e,r,n){let o=Sa(t,e),s=Ek(o,e,r,n);return Yg(t,r,s)}a(lfo,"FromThis");function ufo(t,e,r,n){let o=Yg(t,r,n);return Ri(t.items)?t.items.map((s,c)=>Ek(s,e,`${r}/${c}`,o[c])):[]}a(ufo,"FromTuple");function dfo(t,e,r,n){for(let o of t.anyOf){if(!Jo(o,e,n))continue;let s=Ek(o,e,r,n);return Yg(t,r,s)}for(let o of t.anyOf){let s=Ek(o,e,r,n);if(Jo(t,e,s))return Yg(t,r,s)}return Yg(t,r,n)}a(dfo,"FromUnion");function Ek(t,e,r,n){let o=Dm(t,e),s=t;switch(t[_t]){case"Array":return rfo(s,o,r,n);case"Import":return nfo(s,o,r,n);case"Intersect":return ifo(s,o,r,n);case"Not":return ofo(s,o,r,n);case"Object":return sfo(s,o,r,n);case"Record":return afo(s,o,r,n);case"Ref":return cfo(s,o,r,n);case"This":return lfo(s,o,r,n);case"Tuple":return ufo(s,o,r,n);case"Union":return dfo(s,o,r,n);default:return Yg(s,r,n)}}a(Ek,"Visit");function Vie(t,e,r){return Ek(t,e,"",r)}a(Vie,"TransformEncode");p();function ffo(t,e){return Za(t)||R0(t.items,e)}a(ffo,"FromArray");function pfo(t,e){return Za(t)||R0(t.items,e)}a(pfo,"FromAsyncIterator");function hfo(t,e){return Za(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a(hfo,"FromConstructor");function mfo(t,e){return Za(t)||R0(t.returns,e)||t.parameters.some(r=>R0(r,e))}a(mfo,"FromFunction");function gfo(t,e){return Za(t)||Za(t.unevaluatedProperties)||t.allOf.some(r=>R0(r,e))}a(gfo,"FromIntersect");function Afo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return Za(t)||R0(n,[...r,...e])}a(Afo,"FromImport");function yfo(t,e){return Za(t)||R0(t.items,e)}a(yfo,"FromIterator");function Efo(t,e){return Za(t)||R0(t.not,e)}a(Efo,"FromNot");function _fo(t,e){return Za(t)||Object.values(t.properties).some(r=>R0(r,e))||vd(t.additionalProperties)&&R0(t.additionalProperties,e)}a(_fo,"FromObject");function Cfo(t,e){return Za(t)||R0(t.item,e)}a(Cfo,"FromPromise");function vfo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return Za(t)||R0(n,e)||vd(t.additionalProperties)&&Za(t.additionalProperties)}a(vfo,"FromRecord");function bfo(t,e){return Za(t)?!0:R0(Sa(t,e),e)}a(bfo,"FromRef");function Sfo(t,e){return Za(t)?!0:R0(Sa(t,e),e)}a(Sfo,"FromThis");function Tfo(t,e){return Za(t)||!Du(t.items)&&t.items.some(r=>R0(r,e))}a(Tfo,"FromTuple");function Ifo(t,e){return Za(t)||t.anyOf.some(r=>R0(r,e))}a(Ifo,"FromUnion");function R0(t,e){let r=Dm(t,e),n=t;if(t.$id&&kRt.has(t.$id))return!1;switch(t.$id&&kRt.add(t.$id),t[_t]){case"Array":return ffo(n,r);case"AsyncIterator":return pfo(n,r);case"Constructor":return hfo(n,r);case"Function":return mfo(n,r);case"Import":return Afo(n,r);case"Intersect":return gfo(n,r);case"Iterator":return yfo(n,r);case"Not":return Efo(n,r);case"Object":return _fo(n,r);case"Promise":return Cfo(n,r);case"Record":return vfo(n,r);case"Ref":return bfo(n,r);case"This":return Sfo(n,r);case"Tuple":return Tfo(n,r);case"Union":return Ifo(n,r);default:return Za(t)}}a(R0,"Visit");var kRt=new Set;function UB(t,e){return kRt.clear(),R0(t,e)}a(UB,"HasTransform");var PRt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=UB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return xN(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Hie(this.schema,e,this.Errors(e).First());return this.hasTransform?Gie(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Vie(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new $ie(this.schema,e,this.Errors(e).First());return r}},QB;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(QB||(QB={}));var B6e;(function(t){function e(s){return s.length===0?!1:QB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${Z.minItems}`);let ae=Y(Z.items,J,"value");if(yield`((array) => { for(const ${le} of array) if(!(${ae})) { return false }; return true; })(${z})`,Mu(Z.contains)||oi(Z.minContains)||oi(Z.maxContains)){let Me=Mu(Z.contains)?Z.contains:Ko(),ne=Y(Me,J,"value"),se=oi(Z.minContains)?[`(count >= ${Z.minContains})`]:[],Ie=oi(Z.maxContains)?[`(count <= ${Z.maxContains})`]:[],_e=`const count = value.reduce((${K}, ${le}) => ${ne} ? acc + 1 : acc, 0)`,Re=["(count > 0)",...se,...Ie].join(" && ");yield`((${le}) => { ${_e}; return ${Re}})(${z})`}Z.uniqueItems===!0&&(yield`((${le}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${z})`)}a(o,"FromArray");function*s(Z,J,z){yield`(typeof value === 'object' && Symbol.asyncIterator in ${z})`}a(s,"FromAsyncIterator");function*c(Z,J,z){yield`(typeof ${z} === 'bigint')`,Wg(Z.exclusiveMaximum)&&(yield`${z} < BigInt(${Z.exclusiveMaximum})`),Wg(Z.exclusiveMinimum)&&(yield`${z} > BigInt(${Z.exclusiveMinimum})`),Wg(Z.maximum)&&(yield`${z} <= BigInt(${Z.maximum})`),Wg(Z.minimum)&&(yield`${z} >= BigInt(${Z.minimum})`),Wg(Z.multipleOf)&&(yield`(${z} % BigInt(${Z.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(Z,J,z){yield`(typeof ${z} === 'boolean')`}a(l,"FromBoolean");function*u(Z,J,z){yield*V(Z.returns,J,`${z}.prototype`)}a(u,"FromConstructor");function*d(Z,J,z){yield`(${z} instanceof Date) && Number.isFinite(${z}.getTime())`,oi(Z.exclusiveMaximumTimestamp)&&(yield`${z}.getTime() < ${Z.exclusiveMaximumTimestamp}`),oi(Z.exclusiveMinimumTimestamp)&&(yield`${z}.getTime() > ${Z.exclusiveMinimumTimestamp}`),oi(Z.maximumTimestamp)&&(yield`${z}.getTime() <= ${Z.maximumTimestamp}`),oi(Z.minimumTimestamp)&&(yield`${z}.getTime() >= ${Z.minimumTimestamp}`),oi(Z.multipleOfTimestamp)&&(yield`(${z}.getTime() % ${Z.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(Z,J,z){yield`(typeof ${z} === 'function')`}a(f,"FromFunction");function*h(Z,J,z){let le=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((K,ae)=>[...K,Z.$defs[ae]],[]);yield*V(wI(Z.$ref),[...J,...le],z)}a(h,"FromImport");function*m(Z,J,z){yield`Number.isInteger(${z})`,oi(Z.exclusiveMaximum)&&(yield`${z} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${z} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${z} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${z} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${z} % ${Z.multipleOf}) === 0`)}a(m,"FromInteger");function*g(Z,J,z){let le=Z.allOf.map(K=>Y(K,J,z)).join(" && ");if(Z.unevaluatedProperties===!1){let K=j(`${new RegExp(BB(Z))};`),ae=`Object.getOwnPropertyNames(${z}).every(key => ${K}.test(key))`;yield`(${le} && ${ae})`}else if(Mu(Z.unevaluatedProperties)){let K=j(`${new RegExp(BB(Z))};`),ae=`Object.getOwnPropertyNames(${z}).every(key => ${K}.test(key) || ${Y(Z.unevaluatedProperties,J,`${z}[key]`)})`;yield`(${le} && ${ae})`}else yield`(${le})`}a(g,"FromIntersect");function*A(Z,J,z){yield`(typeof value === 'object' && Symbol.iterator in ${z})`}a(A,"FromIterator");function*y(Z,J,z){typeof Z.const=="number"||typeof Z.const=="boolean"?yield`(${z} === ${Z.const})`:yield`(${z} === '${NRt.Escape(Z.const)}')`}a(y,"FromLiteral");function*E(Z,J,z){yield"false"}a(E,"FromNever");function*_(Z,J,z){yield`(!${Y(Z.not,J,z)})`}a(_,"FromNot");function*v(Z,J,z){yield`(${z} === null)`}a(v,"FromNull");function*b(Z,J,z){yield XV.IsNumberLike(z),oi(Z.exclusiveMaximum)&&(yield`${z} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${z} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${z} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${z} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${z} % ${Z.multipleOf}) === 0`)}a(b,"FromNumber");function*T(Z,J,z){yield XV.IsObjectLike(z),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${z}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${z}).length <= ${Z.maxProperties}`);let le=Object.getOwnPropertyNames(Z.properties);for(let K of le){let ae=B6e.Encode(z,K),Me=Z.properties[K];if(Z.required&&Z.required.includes(K))yield*V(Me,J,ae),(LB(Me)||e(Me))&&(yield`('${K}' in ${z})`);else{let ne=Y(Me,J,ae);yield XV.IsExactOptionalProperty(z,K,ne)}}if(Z.additionalProperties===!1)if(Z.required&&Z.required.length===le.length)yield`Object.getOwnPropertyNames(${z}).length === ${le.length}`;else{let K=`[${le.map(ae=>`'${ae}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${z}).every(key => ${K}.includes(key))`}if(typeof Z.additionalProperties=="object"){let K=Y(Z.additionalProperties,J,`${z}[key]`),ae=`[${le.map(Me=>`'${Me}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${z}).every(key => ${ae}.includes(key) || ${K}))`}}a(T,"FromObject");function*w(Z,J,z){yield`${z} instanceof Promise`}a(w,"FromPromise");function*R(Z,J,z){yield XV.IsRecordLike(z),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${z}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${z}).length <= ${Z.maxProperties}`);let[le,K]=Object.entries(Z.patternProperties)[0],ae=j(`${new RegExp(le)}`),Me=Y(K,J,"value"),ne=Mu(Z.additionalProperties)?Y(Z.additionalProperties,J,z):Z.additionalProperties===!1?"false":"true",se=`(${ae}.test(key) ? ${Me} : ${ne})`;yield`(Object.entries(${z}).every(([key, value]) => ${se}))`}a(R,"FromRecord");function*x(Z,J,z){let le=Sa(Z,J);if(G.functions.has(Z.$ref))return yield`${re(Z.$ref)}(${z})`;yield*V(le,J,z)}a(x,"FromRef");function*k(Z,J,z){let le=j(`${new RegExp(Z.source,Z.flags)};`);yield`(typeof ${z} === 'string')`,oi(Z.maxLength)&&(yield`${z}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${z}.length >= ${Z.minLength}`),yield`${le}.test(${z})`}a(k,"FromRegExp");function*D(Z,J,z){yield`(typeof ${z} === 'string')`,oi(Z.maxLength)&&(yield`${z}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${z}.length >= ${Z.minLength}`),Z.pattern!==void 0&&(yield`${j(`${new RegExp(Z.pattern)};`)}.test(${z})`),Z.format!==void 0&&(yield`format('${Z.format}', ${z})`)}a(D,"FromString");function*N(Z,J,z){yield`(typeof ${z} === 'symbol')`}a(N,"FromSymbol");function*L(Z,J,z){yield`(typeof ${z} === 'string')`,yield`${j(`${new RegExp(Z.pattern)};`)}.test(${z})`}a(L,"FromTemplateLiteral");function*B(Z,J,z){yield`${re(Z.$ref)}(${z})`}a(B,"FromThis");function*Q(Z,J,z){if(yield`Array.isArray(${z})`,Z.items===void 0)return yield`${z}.length === 0`;yield`(${z}.length === ${Z.maxItems})`;for(let le=0;leY(K,J,z)).join(" || ")})`}a(O,"FromUnion");function*q(Z,J,z){yield`${z} instanceof Uint8Array`,oi(Z.maxByteLength)&&(yield`(${z}.length <= ${Z.maxByteLength})`),oi(Z.minByteLength)&&(yield`(${z}.length >= ${Z.minByteLength})`)}a(q,"FromUint8Array");function*F(Z,J,z){yield"true"}a(F,"FromUnknown");function*U(Z,J,z){yield XV.IsVoidLike(z)}a(U,"FromVoid");function*W(Z,J,z){let le=G.instances.size;G.instances.set(le,Z),yield`kind('${Z[_t]}', ${le}, ${z})`}a(W,"FromKind");function*V(Z,J,z,le=!0){let K=va(Z.$id)?[...J,Z]:J,ae=Z;if(le&&va(Z.$id)){let Me=re(Z.$id);if(G.functions.has(Me))return yield`${Me}(${z})`;{G.functions.set(Me,"");let ne=X(Me,Z,J,"value",!1);return G.functions.set(Me,ne),yield`${Me}(${z})`}}switch(ae[_t]){case"Any":return yield*r(ae,K,z);case"Argument":return yield*n(ae,K,z);case"Array":return yield*o(ae,K,z);case"AsyncIterator":return yield*s(ae,K,z);case"BigInt":return yield*c(ae,K,z);case"Boolean":return yield*l(ae,K,z);case"Constructor":return yield*u(ae,K,z);case"Date":return yield*d(ae,K,z);case"Function":return yield*f(ae,K,z);case"Import":return yield*h(ae,K,z);case"Integer":return yield*m(ae,K,z);case"Intersect":return yield*g(ae,K,z);case"Iterator":return yield*A(ae,K,z);case"Literal":return yield*y(ae,K,z);case"Never":return yield*E(ae,K,z);case"Not":return yield*_(ae,K,z);case"Null":return yield*v(ae,K,z);case"Number":return yield*b(ae,K,z);case"Object":return yield*T(ae,K,z);case"Promise":return yield*w(ae,K,z);case"Record":return yield*R(ae,K,z);case"Ref":return yield*x(ae,K,z);case"RegExp":return yield*k(ae,K,z);case"String":return yield*D(ae,K,z);case"Symbol":return yield*N(ae,K,z);case"TemplateLiteral":return yield*L(ae,K,z);case"This":return yield*B(ae,K,z);case"Tuple":return yield*Q(ae,K,z);case"Undefined":return yield*M(ae,K,z);case"Union":return yield*O(ae,K,z);case"Uint8Array":return yield*q(ae,K,z);case"Unknown":return yield*F(ae,K,z);case"Void":return yield*U(ae,K,z);default:if(!i_.Has(ae[_t]))throw new MRt(Z);return yield*W(ae,K,z)}}a(V,"Visit");let G={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function Y(Z,J,z,le=!0){return`(${[...V(Z,J,z,le)].join(" && ")})`}a(Y,"CreateExpression");function re(Z){return`check_${DRt.Encode(Z)}`}a(re,"CreateFunctionName");function j(Z){let J=`local_${G.variables.size}`;return G.variables.set(J,`const ${J} = ${Z}`),J}a(j,"CreateVariable");function X(Z,J,z,le,K=!0){let[ae,Me]=[` -`,_e=>"".padStart(_e," ")],ne=ie("value","any"),se=we("boolean"),Ie=[...V(J,z,le,K)].map(_e=>`${Me(4)}${_e}`).join(` &&${ae}`);return`function ${Z}(${ne})${se} {${ae}${Me(2)}return (${ae}${Ie}${ae}${Me(2)}) -}`}a(X,"CreateFunction");function ie(Z,J){let z=G.language==="typescript"?`: ${J}`:"";return`${Z}${z}`}a(ie,"CreateParameter");function we(Z){return G.language==="typescript"?`: ${Z}`:""}a(we,"CreateReturns");function Ae(Z,J,z){let le=X("check",Z,J,"value"),K=ie("value","any"),ae=we("boolean"),Me=[...G.functions.values()],ne=[...G.variables.values()],se=va(Z.$id)?`return function check(${K})${ae} { - return ${re(Z.$id)}(value) -}`:`return ${le}`;return[...ne,...Me,se].join(` -`)}a(Ae,"Build");function De(...Z){let J={language:"javascript"},[z,le,K]=Z.length===2&&Ri(Z[1])?[Z[0],Z[1],J]:Z.length===2&&!Ri(Z[1])?[Z[0],[],Z[1]]:Z.length===3?[Z[0],Z[1],Z[2]]:Z.length===1?[Z[0],[],J]:[null,[],J];if(G.language=K.language,G.variables.clear(),G.functions.clear(),G.instances.clear(),!Mu(z))throw new L6e(z);for(let ae of le)if(!Mu(ae))throw new L6e(ae);return Ae(z,le,K)}a(De,"Code"),t.Code=De;function Te(Z,J=[]){let z=De(Z,J,{language:"javascript"}),le=globalThis.Function("kind","format","hash",z),K=new Map(G.instances);function ae(Ie,_e,Re){if(!i_.Has(Ie)||!K.has(_e))return!1;let Je=i_.Get(Ie),Xe=K.get(_e);return Je(Xe,Re)}a(ae,"typeRegistryFunction");function Me(Ie,_e){return hk.Has(Ie)?hk.Get(Ie)(_e):!1}a(Me,"formatRegistryFunction");function ne(Ie){return Q9(Ie)}a(ne,"hashFunction");let se=le(ae,Me,ne);return new PRt(Z,J,se,z)}a(Te,"Compile"),t.Compile=Te})(Ou||(Ou={}));var b9e=ce(IB()),poe=ce(require("os"));Ns();var S9e=ce(ti());function foe(t){return t===1}a(foe,"isRestricted");var kpo=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],LCe=8192,Ppo=21;var k0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return foe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(moe(e))return this.reporterRestricted;if(Eie(e))return new cCe}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}getFTReporter(e){if(aWr(e))return this.reporterFT;if(Eie(e))return new cCe}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterFT,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterFT=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},Dpo=S.Object({},{additionalProperties:S.String()}),Npo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),Mpo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function Opo(t){return Mpo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(Opo,"isOomError");function Bpo(t){return OI(t)?"network":Opo(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(Bpo,"getErrorType");var jt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Ou.Compile(Dpo)}static{this.validateTelemetryMeasurements=Ou.Compile(Npo)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},pl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=pl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Jt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=C1(e.get(Lr).getEditorInfo()),this.properties.editor_plugin_version=C1(e.get(Lr).getEditorPluginInfo());let r=e.get(Fa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${N1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Lr);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=C1(r.getEditorInfo());let n=e.get(ar);this.properties.fetcher=n.name;let o=e.get(Zo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=pWr(e);r["copilot.build"]=hWr(e),r["copilot.buildType"]=J9(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(foe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>LCe){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+LCe;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(hoe,"telemetrizePromptLength");function pl(){return performance.now()}a(pl,"now");function qpo(t){return Math.floor(t/1e3)}a(qpo,"nowSeconds");function moe(t){return t.get(Nf).optedIn}a(moe,"shouldSendRestricted");function aWr(t){return t.get(Nf).ftFlag!==""}a(aWr,"shouldSendFinetuningTelemetry");function ht(t,e,r,n){return t.get(_d).register(jpo(t,e,pl(),r?.extendedBy(),n))}a(ht,"telemetry");function MI(t,e,r){return t.get(_d).register(I9e(t,e,r?.extendedBy()))}a(MI,"telemetryMsft");function gt(t,e,r,n){let o=jt.createAndMarkAsIssued(r,n);return t.get(_d).register(I9e(t,e,o))}a(gt,"telemetryMs");function T9e(t,e,r,n){let o=(n||jt.createAndMarkAsIssued()).extendedBy(cWr(r));return t.get(_d).register(I9e(t,e,o))}a(T9e,"telemetryMsftWithError");function gi(t,e,r,n,o){let s=jt.createAndMarkAsIssued({...n,...cWr(r)},o);return t.get(_d).register(I9e(t,e,s))}a(gi,"telemetryMsWithError");function cWr(t){let e={};if(t){let r=$po(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(cWr,"buildErrorProperties");async function jpo(t,e,r,n,o=0){let s=n||jt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!foe(o)||moe(t))&&FCe(t,o,e,s),foe(o)&&kpo.includes(e)&&aWr(t)&&Qpo(t,o,e,s),Lpo(t,e,s)}a(jpo,"_telemetry");async function I9e(t,e,r){let n=r||jt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Upo(t,e,n)}a(I9e,"_telemetryMsft");function x9e(t,e){return t.get(_d).register(Hpo(t,e,pl()))}a(x9e,"telemetryExpProblem");async function Hpo(t,e,r){let n="expProblem",o=jt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),FCe(t,0,n,o)}a(Hpo,"_telemetryExpProblem");function goe(t,e,r,n,o=0){let s={...r,...lWr(t)};FCe(t,o,e,{properties:s,measurements:n})}a(goe,"telemetryRaw");function lWr(t){let e=t.get(Lr),r={unique_id:gr(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:C1(e.getEditorInfo())};return{...t.get(Nf).getProperties(),...r}}a(lWr,"createRequiredProperties");var cPt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,b9e.SHA256)(b9e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function _s(t,e,r,n,o){return t.get(_d).register(uWr(t,e,pl(),r,{...n},o))}a(_s,"telemetryException");async function uWr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||P0(c)||c instanceof S9e.ConnectionError||c instanceof S9e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new cPt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} +`+new Array(o).join(" ")+"^"}}return null}a(rro,"getErrorSource");function Zzc(t){var e=rro(t),r=Wzc();r&&r._handle&&r._handle.setBlocking&&r._handle.setBlocking(!0),e&&(console.error(),console.error(e)),console.error(t.stack),zzc(1)}a(Zzc,"printErrorAndExit");function Xzc(){var t=process.emit;process.emit=function(e){if(e==="uncaughtException"){var r=arguments[1]&&arguments[1].stack,n=this.listeners(e).length>0;if(r&&!n)return Zzc(arguments[1])}return t.apply(this,arguments)}}a(Xzc,"shimEmitUncaughtException");var eYc=wV.slice(0),tYc=RV.slice(0);iie.wrapCallSite=tro;iie.getErrorSource=rro;iie.mapSourcePosition=M6r;iie.retrieveSourceMap=N6r;iie.install=function(t){if(t=t||{},t.environment&&(FFe=t.environment,["node","browser","auto"].indexOf(FFe)===-1))throw new Error("environment "+FFe+" was unknown. Available options are {auto, browser, node}");if(t.retrieveFile&&(t.overrideRetrieveFile&&(wV.length=0),wV.unshift(t.retrieveFile)),t.retrieveSourceMap&&(t.overrideRetrieveSourceMap&&(RV.length=0),RV.unshift(t.retrieveSourceMap)),t.hookRequire&&!k6r()){var e=Kto(P6r,"module"),r=e.prototype._compile;r.__sourceMapSupport||(e.prototype._compile=function(s,c){return nie[c]=s,UFe[c]=void 0,r.call(this,s,c)},e.prototype._compile.__sourceMapSupport=!0)}if(w6r||(w6r="emptyCacheBetweenOperations"in t?t.emptyCacheBetweenOperations:!1),Jto||(Jto=!0,Error.prepareStackTrace=Jzc),!Zto){var n="handleUncaughtExceptions"in t?t.handleUncaughtExceptions:!0;try{var o=Kto(P6r,"worker_threads");o.isMainThread===!1&&(n=!1)}catch{}n&&$zc()&&(Zto=!0,Xzc())}};iie.resetRetrieveHandlers=function(){wV.length=0,RV.length=0,wV=eYc.slice(0),RV=tYc.slice(0),N6r=$xt(RV),D6r=$xt(wV)}});var iro=I(()=>{p();nro().install()});var iYc={};xi(iYc,{getTokenizer:()=>Cs,getTokenizerAsync:()=>b7,main:()=>sro});module.exports=ya(iYc);p();p();p();var U6r="auth.db",fro=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],pro=` + CREATE TABLE IF NOT EXISTS oauth_tokens ( + token_id INTEGER PRIMARY KEY AUTOINCREMENT, + auth_authority TEXT NOT NULL, + oauth_client_id TEXT NOT NULL, + user_login TEXT NOT NULL, + scopes TEXT NOT NULL, + token_ciphertext BLOB NOT NULL, + token_schema_version INTEGER NOT NULL, + source_editor_id TEXT NOT NULL, + created_at INTEGER NOT NULL, + updated_at INTEGER NOT NULL, + last_used_at INTEGER NOT NULL, + UNIQUE(auth_authority, oauth_client_id, user_login) + ) +`,hro=` + CREATE TABLE IF NOT EXISTS active_sessions ( + editor_id TEXT PRIMARY KEY, + token_id INTEGER NOT NULL REFERENCES oauth_tokens(token_id) ON DELETE CASCADE, + activated_at INTEGER NOT NULL + ) +`,mro=` + CREATE TABLE IF NOT EXISTS editor_signout ( + editor_id TEXT PRIMARY KEY, + signed_out_at INTEGER NOT NULL + ) +`,gro=` + CREATE TABLE IF NOT EXISTS metadata ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL + ) +`,Aro=[pro,hro,mro,gro];function zxt(t){for(let e of fro)t.exec(e);return yro(t),t}a(zxt,"applyPragmas");function yro(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(yro,"ensureWalMode");function Yxt(t){for(let e of Aro)t.exec(e);return t}a(Yxt,"applySchema");function PV(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(PV,"runInWriteTx");p();p();p();var Kxt="github.copilot",Q6r="github-enterprise";p();var Ps=a((t,e)=>({editorId:t,displayName:e}),"id"),Ero=Ps("unknown","Unknown"),q6r=Ps("eclipse","Eclipse"),j6r=Ps("xcode","Xcode"),f9=Ps("vim","Vim/Neovim"),H6r=Ps("helix","Helix"),_ro={"copilot-eclipse":q6r,Copilot4Eclipse:q6r,"copilot-xcode":j6r,"Copilot for Xcode":j6r,"copilot-vs":Ps("visual-studio","Visual Studio"),"copilot.vim":f9,"copilot.lua":f9,"Github Copilot LSP for Neovim":f9,"coc-github-copilot":f9,"nvim-lspconfig":f9,"copilot-lsp-client-neovim":f9,"neovim-copilot-lsp":f9,"sidekick.nvim":f9,"helix-copilot":H6r,"copilot-helix":H6r,"copilot-sublime":Ps("sublime-text","Sublime Text"),"zed-copilot":Ps("zed","Zed"),RStudio:Ps("rstudio","RStudio"),"obsidian-copilot":Ps("obsidian","Obsidian"),marimo:Ps("marimo","marimo"),"Qt Creator Copilot plugin":Ps("qt-creator","Qt Creator"),"godot-copilot":Ps("godot","Godot"),"kakoune-lsp":Ps("kakoune","Kakoune"),"typora-copilot":Ps("typora","Typora"),"Copilot for Nova":Ps("nova","Nova")},vro={IU:Ps("intellij","IntelliJ IDEA"),IC:Ps("intellij","IntelliJ IDEA"),IE:Ps("intellij","IntelliJ IDEA"),PY:Ps("pycharm","PyCharm"),PC:Ps("pycharm","PyCharm"),PE:Ps("pycharm","PyCharm"),WS:Ps("webstorm","WebStorm"),PS:Ps("phpstorm","PhpStorm"),RD:Ps("rider","Rider"),RM:Ps("rubymine","RubyMine"),CL:Ps("clion","CLion"),GO:Ps("goland","GoLand"),RR:Ps("rustrover","RustRover"),DB:Ps("datagrip","DataGrip"),DS:Ps("dataspell","DataSpell"),AI:Ps("android-studio","Android Studio"),QA:Ps("aqua","Aqua"),MPS:Ps("mps","MPS"),JBC:Ps("jetbrains-client","JetBrains Client"),GW:Ps("jetbrains-gateway","JetBrains Gateway")},G6r="JetBrains-",Cro=Ps("jetbrains","JetBrains IDE");function $6r(t){let e=t.plugin.name?.trim();if(!e)return Ero;if(e==="copilot-intellij"){let r=t.editor.name??"";if(r.startsWith(G6r)){let n=vro[r.slice(G6r.length)];if(n)return n}return Cro}return _ro[e]??Ps(e,e)}a($6r,"resolveEditorIdentity");p();p();p();p();var QFe=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get raw(){return this.userInfo}};p();function Jxt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(Jxt,"findKnownOrg");function V6r(t){let e=t.organization_list??[];return Jxt(e)??""}a(V6r,"getUserKind");p();var Nf=class{static{a(this,"LogTarget")}},dB=class{static{a(this,"TelemetryLogSender")}},Ae=class{constructor(e){this.category=e}static{a(this,"Logger")}log(e,r,...n){e.get(Nf).logIt(e,r,this.category,...n)}debug(e,...r){this.log(e,4,...r)}info(e,...r){this.log(e,3,...r)}warn(e,...r){this.log(e,2,...r)}error(e,...r){this.log(e,1,...r)}exception(e,r,n){if(r instanceof Error&&r.name==="Canceled"&&r.message==="Canceled")return;let o=n;n.startsWith(".")&&(o=n.substring(1),n=`${this.category}${n}`),e.get(dB).sendException(e,r,n);let s=r instanceof Error?r:new Error(`Non-error thrown: ${String(r)}`);this.log(e,1,`${o}:`,s)}},Dr=new Ae("default");p();p();p();p();async function ioo(){let{getDeviceId:t}=await Promise.resolve().then(()=>fe(S7r()));return t()}a(ioo,"loadDeviceId");var AI=class{constructor(e=ioo){this.resolvedId="";this.deviceIdPromise=(async()=>e())().catch(()=>"").then(r=>this.resolvedId=r)}static{a(this,"DevDeviceIdManager")}async getId(){return this.deviceIdPromise}getIdSync(){return this.resolvedId}};p();p();p();var rP=class{static{a(this,"InlineCompletionsUnification")}},ooo={codeUnification:!1,modelUnification:!1,expAssignments:[]},uie=class extends rP{constructor(){super(...arguments);this.inlineCompletionsUnificationState=ooo;this.onDidChangeState=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeState")}static{a(this,"NullInlineCompletionsUnification")}};var qv=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return o8e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(rP).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var XE="X-Copilot-RelatedPluginVersion-",die=($=>($.Market="X-MSEdge-Market",$.CorpNet="X-FD-Corpnet",$.Build="X-VSCode-Build",$.ApplicationVersion="X-VSCode-AppVersion",$.TargetPopulation="X-VSCode-TargetPopulation",$.ClientId="X-MSEdge-ClientId",$.DevDeviceId="X-VSCode-DevDeviceId",$.ExtensionName="X-VSCode-ExtensionName",$.ExtensionVersion="X-VSCode-ExtensionVersion",$.ExtensionRelease="X-VSCode-ExtensionRelease",$.CompletionsInChatExtensionVersion="X-VSCode-CompletionsInChatExtensionVersion",$.Language="X-VSCode-Language",$.CopilotClientTimeBucket="X-Copilot-ClientTimeBucket",$.CopilotEngine="X-Copilot-Engine",$.CopilotOverrideEngine="X-Copilot-OverrideEngine",$.CopilotRepository="X-Copilot-Repository",$.CopilotFileType="X-Copilot-FileType",$.CopilotUserKind="X-Copilot-UserKind",$.CopilotDogfood="X-Copilot-Dogfood",$.CopilotCustomModel="X-Copilot-CustomModel",$.CopilotOrgs="X-Copilot-Orgs",$.CopilotTrackingId="X-Copilot-CopilotTrackingId",$.CopilotClientVersion="X-Copilot-ClientVersion",$.CopilotSku="X-GitHub-Copilot-SKU",$.CopilotRelatedPluginVersionCppTools=XE+"msvscodecpptools",$.CopilotRelatedPluginVersionCMakeTools=XE+"msvscodecmaketools",$.CopilotRelatedPluginVersionMakefileTools=XE+"msvscodemakefiletools",$.CopilotRelatedPluginVersionCSharpDevKit=XE+"msdotnettoolscsdevkit",$.CopilotRelatedPluginVersionPython=XE+"mspythonpython",$.CopilotRelatedPluginVersionPylance=XE+"mspythonvscodepylance",$.CopilotRelatedPluginVersionJavaPack=XE+"vscjavavscodejavapack",$.CopilotRelatedPluginVersionJavaManager=XE+"vscjavavscodejavadependency",$.CopilotRelatedPluginVersionTypescript=XE+"vscodetypescriptlanguagefeatures",$.CopilotRelatedPluginVersionTypescriptNext=XE+"msvscodevscodetypescriptnext",$.CopilotRelatedPluginVersionCSharp=XE+"msdotnettoolscsharp",$.CopilotRelatedPluginVersionGithubCopilotChat=XE+"githubcopilotchat",$.CopilotRelatedPluginVersionGithubCopilot=XE+"githubcopilot",$))(die||{});var soo={"X-Copilot-ClientTimeBucket":"timeBucket","X-Copilot-OverrideEngine":"engine","X-Copilot-Repository":"repo","X-Copilot-FileType":"fileType","X-Copilot-UserKind":"userKind"},AB=class t{constructor(e){this.filters=e;for(let[r,n]of Object.entries(this.filters))n===""&&delete this.filters[r]}static{a(this,"FilterSettings")}extends(e){for(let[r,n]of Object.entries(e.filters))if(this.filters[r]!==n)return!1;return!0}addToTelemetry(e){for(let[r,n]of Object.entries(this.filters)){let o=soo[r];o!==void 0&&(e.properties[o]=n)}}stringify(){let e=Object.keys(this.filters);return e.sort(),e.map(r=>`${r}:${this.filters[r]}`).join(";")}toHeaders(){return{...this.filters}}withChange(e,r){return new t({...this.filters,[e]:r})}};p();p();p();function ys(t,e){let r=Nm(t,e,"event.CopilotToken");return t.get(Ut).onDidChangeTokenResult(n=>{n.copilotToken&&r(n.copilotToken)})}a(ys,"onCopilotToken");function Cwt(t){let e=t.getTokenValue("tid"),r=t.organization_list,n=t.enterprise_list,o=t.getTokenValue("sku");if(!e)return;let s={copilot_trackingId:e};return r&&(s.organizations_list=r.toString()),n&&(s.enterprise_list=n.toString()),o&&(s.sku=o),s}a(Cwt,"propertiesFromCopilotToken");var Mf=class{constructor(e){this.#e={};this.optedIn=!1;this.ftFlag="";ys(e,r=>this.updateFromToken(r))}static{a(this,"TelemetryUserConfig")}#e;getProperties(){return this.#e}get trackingId(){return this.#e.copilot_trackingId}updateFromToken(e){let r=Cwt(e);r&&(this.#e=r,this.optedIn=e.getTokenValue("rt")==="1",this.ftFlag=e.getTokenValue("ft")??"")}};var G8e=fe(v9()),$8e=fe(require("os"));var aoo=/^(\s+at)?(.*?)(@|\s\(|\s)([^(\n]+?)(:\d+)?(:\d+)?(\)?)$/;function coo(t){let e={type:t.name,value:t.message},r=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,"");if(r?.startsWith(t.toString()+` +`)){e.stacktrace=[];for(let n of r.slice(t.toString().length+1).split(/\n/).reverse()){let o=n.match(aoo),s={filename:"",function:""};o&&(s.function=o[2]?.trim()?.replace(/^[^.]{1,2}(\.|$)/,"_$1")??s.function,s.filename=(o[4]?.trim()??s.filename).replace(/^\.\/dist\//,"/github-copilot/dist/"),o[5]&&o[5]!==":0"&&(s.lineno=o[5].slice(1)),o[6]&&o[5]!==":0"&&(s.colno=o[6].slice(1)),s.in_app=!/[[<:]|(?:^|\/)node_modules\//.test(s.filename)),e.stacktrace.push(s)}}return e}a(coo,"buildExceptionDetail");function Twt(t,e){let r=t.get(Nr),n=r.getEditorInfo(),o=t.get(Mf),s={"#editor":n.devName??n.name,"#editor_version":h1({name:n.devName??n.name,version:n.version}),"#plugin":r.getEditorPluginInfo().name,"#plugin_version":h1(r.getEditorPluginInfo()),"#session_id":t.get(Oa).sessionId,"#machine_id":t.get(Oa).machineId,"#architecture":$8e.arch(),"#os_platform":$8e.platform(),...e};return o.trackingId&&(s.user=o.trackingId,s["#tracking_id"]=o.trackingId),s}a(Twt,"buildContext");function DQr(t,e,r){let n=t.get(os),o=t.get(Nr).getEditorInfo(),s=typeof process<"u"?process.versions.node:"web",c={app:"copilot-client",rollup_id:"auto",platform:"node",release:n.getBuildType()!=="dev"?`copilot-client@${n.getVersion()}`:void 0,deployed_to:n.getBuildType(),catalog_service:o.name==="vscode"?"CopilotCompletionsVSCode":"CopilotLanguageServer",transaction:r,context:Twt(t,{"#node_version":s}),sensitive_context:{}},l=[];c.exception_detail=[];let u=0,d=e;for(;d instanceof Error&&u<10;){let h=coo(d);c.exception_detail.unshift(h),l.unshift([d,h]),u+=1,d=d.cause}let f=[];for(let[h,m]of l)if(m.stacktrace&&m.stacktrace.length>0){f.push(`${m.type}: ${h.code??""}`);let g=[...m.stacktrace].reverse();for(let y of g)if(y.filename?.startsWith("/github-copilot/"))return c;let A=!1;for(let y of g)if(y.in_app){A=!0,f.push(`${y.filename?.replace(/^\.\//,"")}:${y.lineno}:${y.colno}`);break}A||f.push(r),f.push(`${g[0].filename?.replace(/^\.\//,"")}`)}else return c;return c.exception_detail.length>0&&(c.rollup_id=(0,G8e.SHA256)(G8e.enc.Utf16.parse(f.join(` +`))).toString()),c}a(DQr,"buildPayload");p();var K_e=class{static{a(this,"FailingTelemetryReporter")}sendTelemetryEvent(e,r,n){throw new Error("Telemetry disabled")}sendTelemetryErrorEvent(e,r,n,o){throw new Error("Telemetry disabled")}dispose(){return Promise.resolve()}hackOptOutListener(){}};p();p();var MQr=fe(v9());var yn=class{constructor(e=10){this.valueMap=new Map;if(e<1)throw new Error("Size limit must be at least 1");this.sizeLimit=e}static{a(this,"LRUCacheMap")}set(e,r){if(this.has(e))this.valueMap.delete(e);else if(this.valueMap.size>=this.sizeLimit){let n=this.valueMap.keys().next().value;this.delete(n)}return this.valueMap.set(e,r),this}get(e){if(this.valueMap.has(e)){let r=this.valueMap.get(e);return this.valueMap.delete(e),this.valueMap.set(e,r),r}}delete(e){return this.valueMap.delete(e)}clear(){this.valueMap.clear()}get size(){return this.valueMap.size}keys(){return new Map(this.valueMap).keys()}values(){return new Map(this.valueMap).values()}entries(){return new Map(this.valueMap).entries()}[Symbol.iterator](){return this.entries()}has(e){return this.valueMap.has(e)}forEach(e,r){new Map(this.valueMap).forEach(e,r)}get[Symbol.toStringTag](){return"LRUCacheMap"}peek(e){return this.valueMap.get(e)}},nP=class extends yn{constructor(r,n=120*1e3){super(r);this.defaultTtl=n;this.expiration=new Map}static{a(this,"LRUExpirationCacheMap")}has(r){let n=!1,o=this.expiration.get(r);return o!==void 0&&(o>performance.now()&&(n=super.has(r)),n||this.delete(r)),n}get(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.get(r);this.delete(r)}}peek(r){let n=this.expiration.get(r);if(n!==void 0){if(n>performance.now())return super.peek(r);this.delete(r)}}set(r,n,o=this.defaultTtl){if(o<=0)throw new Error("TTL must be greater than 0");let s=super.set(r,n);return this.expiration.set(r,performance.now()+o),s}clear(){super.clear(),this.expiration.clear()}delete(r){return this.expiration.delete(r),super.delete(r)}get[Symbol.toStringTag](){return"LRUExpirationCacheMap"}},V8e=class extends yn{static{a(this,"LRUDisposableCacheMap")}delete(e){let r=this.peek(e);return r&&r.dispose(),super.delete(e)}clear(){for(let e of this.values())e.dispose();super.clear()}uncache(e){let r=this.peek(e);return super.delete(e),r}dispose(){this.clear()}};var OQr=7*86400*1e3,_N=class{constructor(e=5){this.perWeek=e;this.cache=new yn(1e3)}static{a(this,"ExceptionRateLimiter")}isThrottled(e){let r=Date.now(),n=this.cache.get(e)||new Array(this.perWeek).fill(-OQr);return r-n[0]t?.length>0&&t!==".").map(t=>t.includes("\\")?new RegExp(BQr(t.replace(/\\/g,"/")),"gi"):new RegExp(BQr(t),"gi"));function uoo(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let r=t,n=[];for(let l of e)for(;;){let u=l.exec(t);if(!u)break;n.push([u.index,l.lastIndex])}let o=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,s=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g,c=0;for(r="";;){let l=s.exec(t);if(!l)break;let u=n.some(([d,f])=>l.index",c=s.lastIndex)}return c`;return t}a(doo,"removePropertiesWithPossibleUserInfo");function foo(t){return t.replace(/([\s|(]|file:\/\/)(\/[^\s]+)/g,"$1[redacted]").replace(/([\s|(]|file:\/\/)([a-zA-Z]:[(\\|/){1,2}][^\s]+)/gi,"$1[redacted]").replace(/([\s|(]|file:\/\/)(\\[^\s]+)/gi,"$1[redacted]")}a(foo,"redactPaths");function FQr(t,e=loo){let r={};for(let[n,o]of Object.entries(t))if(typeof o=="string"){let s=o.replaceAll("%20"," "),c=doo(s);if(c!==s){r[n]=c;continue}s=uoo(s,e);for(let l of e)s=s.replace(l,"");s=foo(s),r[n]=s}return r}a(FQr,"sanitizeTelemetryProperties");function C9(t,e=Object.keys(t)){let r={};for(let n of e)t[n]!==void 0&&(r[n]=t[n]);return r}a(C9,"filterTelemetryProperties");p();var yI=class t{constructor(e){this.flags=e}static{a(this,"RuntimeMode")}static fromEnvironment(e,r=process.argv,n=process.env){return new t({debug:QQr(r,n),verboseLogging:hoo(r,n),testMode:e,simulation:poo(n)})}};function m1(t){return t.get(yI).flags.testMode}a(m1,"isRunningInTest");function fie(t){return m1(t)}a(fie,"shouldFailForDebugPurposes");function J_e(t){return t.get(yI).flags.debug}a(J_e,"isDebugEnabled");function UQr(t){return t.get(yI).flags.verboseLogging}a(UQr,"isVerboseLoggingEnabled");function QQr(t,e){return t.includes("--debug")||xwt(e,"DEBUG")}a(QQr,"determineDebugFlag");function poo(t){return xwt(t,"SIMULATION")}a(poo,"determineSimulationFlag");function z8e(t){return t.get(yI).flags.simulation}a(z8e,"isRunningInSimulation");function hoo(t,e){return e.COPILOT_AGENT_VERBOSE==="1"||e.COPILOT_AGENT_VERBOSE?.toLowerCase()==="true"||xwt(e,"VERBOSE")||QQr(t,e)}a(hoo,"determineVerboseLoggingEnabled");function xwt(t,e){for(let r of["GH_COPILOT_","GITHUB_COPILOT_"]){let n=t[`${r}${e}`];if(n)return n==="1"||n?.toLowerCase()==="true"}return!1}a(xwt,"determineEnvFlagEnabled");p();var _d=class{constructor(){this.promises=new Set}static{a(this,"PromiseQueue")}register(e){this.promises.add(e),e.finally(()=>this.promises.delete(e))}async flush(){await Promise.allSettled(this.promises)}};p();var HQr=require("os"),GQr=fe(require("path"));function Z_e(t){return t.replace(/(file:\/\/)([^\s<>]+)/gi,"$1[redacted]").replace(/(^|[\s|:=(<'"`])((?:\/(?=[^/])|\\|[a-zA-Z]:[\\/])[^\s:)>'"`]+)/g,"$1[redacted]")}a(Z_e,"redactPaths");var moo=new Set(["Maximum call stack size exceeded","Set maximum size exceeded","Invalid arguments"]),goo=[/^[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}.]+ is not a function[ \w]*$/u,/^Cannot read properties of undefined \(reading '[\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]+'\)$/u];function Rwt(t){if(moo.has(t))return t;for(let e of goo)if(e.test(t))return t;return Z_e(t).replace(/\bDNS:(?:\*\.)?[\w.-]+/gi,"DNS:[redacted]")}a(Rwt,"redactMessage");function Y8e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Y8e,"escapeForRegExp");var Aoo=new RegExp("(?<=^|[\\s|(\"'`]|file://)"+Y8e((0,HQr.homedir)())+"(?=$|[\\\\/:\"'`])","gi");function wwt(t){return t.replace(Aoo,"~")}a(wwt,"redactHomeDir");var $Qr="[\\\\/]?([^:)]*)(?=:\\d)",qQr=new RegExp(Y8e(GQr.sep),"g"),jQr=new RegExp(Y8e(__dirname.replace(/[\\/]lib[\\/]src[\\/]util$|[\\/]dist$/,""))+$Qr,"gi");function Pwt(t,e,r=!1,n=[]){let o=new Error(e(t));o.name=t.name,typeof t.syscall=="string"&&(o.syscall=t.syscall),typeof t.code=="string"&&(o.code=t.code),typeof t.errno=="number"&&(o.errno=t.errno),o.stack=void 0;let s=t.stack?.replace(/^.*?:\d+\n.*\n *\^?\n\n/,""),c;for(let l of[t.toString(),`${t.name}: ${t.message}`])if(s?.startsWith(l+` +`)){c=s.slice(l.length+1).split(/\n/);break}if(c){o.stack=o.toString();for(let l of c)if(jQr.test(l))o.stack+=` +${Z_e(l.replace(jQr,(u,d)=>"./"+d.replace(qQr,"/")))}`;else if(/[ (]node:|[ (]wasm:\/\/wasm\/| \(\)$/.test(l))o.stack+=` +${Z_e(l)}`;else{let u=!1;for(let{prefix:d,path:f}of n){let h=new RegExp(Y8e(f.replace(/[\\/]$/,""))+$Qr,"gi");if(h.test(l)){o.stack+=` +${Z_e(l.replace(h,(m,g)=>d+g.replace(qQr,"/")))}`,u=!0;break}}if(u)continue;r?o.stack+=` +${wwt(l)}`:o.stack+=` + at [redacted]:0:0`}}else r&&s&&(o.stack=wwt(s));return t.cause instanceof Error&&(o.cause=Pwt(t.cause,e,r,n)),o}a(Pwt,"cloneError");function VQr(t){let e=t.message;return typeof t.path=="string"&&t.path.length>0&&(e=e.replaceAll(t.path,"")),e}a(VQr,"errorMessageWithoutPath");function WQr(t,e){return Pwt(t,a(function(n){return wwt(VQr(n))},"prepareMessage"),!0,e)}a(WQr,"prepareErrorForRestrictedTelemetry");function zQr(t,e,r=!1){return Pwt(t,a(function(o){if(r)return Rwt(VQr(o));let s="[redacted]";return typeof o.code=="string"&&(s=o.code+" "+s),typeof o.syscall=="string"?s=Z_e(o.syscall)+" "+s:"erroredSysCall"in o&&typeof o.erroredSysCall=="string"&&(s=o.erroredSysCall+" "+s),s},"prepareMessage"),!1,e)}a(zQr,"redactError");p();p();var Ey={};xi(Ey,{HasPropertyKey:()=>K8e,IsArray:()=>xp,IsAsyncIterator:()=>kwt,IsBigInt:()=>X_e,IsBoolean:()=>EB,IsDate:()=>MV,IsFunction:()=>Dwt,IsIterator:()=>Nwt,IsNull:()=>Mwt,IsNumber:()=>g1,IsObject:()=>Gc,IsRegExp:()=>eve,IsString:()=>Nl,IsSymbol:()=>Owt,IsUint8Array:()=>_B,IsUndefined:()=>wp});p();function K8e(t,e){return e in t}a(K8e,"HasPropertyKey");function kwt(t){return Gc(t)&&!xp(t)&&!_B(t)&&Symbol.asyncIterator in t}a(kwt,"IsAsyncIterator");function xp(t){return Array.isArray(t)}a(xp,"IsArray");function X_e(t){return typeof t=="bigint"}a(X_e,"IsBigInt");function EB(t){return typeof t=="boolean"}a(EB,"IsBoolean");function MV(t){return t instanceof globalThis.Date}a(MV,"IsDate");function Dwt(t){return typeof t=="function"}a(Dwt,"IsFunction");function Nwt(t){return Gc(t)&&!xp(t)&&!_B(t)&&Symbol.iterator in t}a(Nwt,"IsIterator");function Mwt(t){return t===null}a(Mwt,"IsNull");function g1(t){return typeof t=="number"}a(g1,"IsNumber");function Gc(t){return typeof t=="object"&&t!==null}a(Gc,"IsObject");function eve(t){return t instanceof globalThis.RegExp}a(eve,"IsRegExp");function Nl(t){return typeof t=="string"}a(Nl,"IsString");function Owt(t){return typeof t=="symbol"}a(Owt,"IsSymbol");function _B(t){return t instanceof globalThis.Uint8Array}a(_B,"IsUint8Array");function wp(t){return t===void 0}a(wp,"IsUndefined");function yoo(t){return t.map(e=>J8e(e))}a(yoo,"ArrayType");function Eoo(t){return new Date(t.getTime())}a(Eoo,"DateType");function _oo(t){return new Uint8Array(t)}a(_oo,"Uint8ArrayType");function voo(t){return new RegExp(t.source,t.flags)}a(voo,"RegExpType");function Coo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=J8e(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=J8e(t[r]);return e}a(Coo,"ObjectType");function J8e(t){return xp(t)?yoo(t):MV(t)?Eoo(t):_B(t)?_oo(t):eve(t)?voo(t):Gc(t)?Coo(t):t}a(J8e,"Visit");function Pu(t){return J8e(t)}a(Pu,"Clone");function pie(t,e){return e===void 0?Pu(t):Pu({...e,...t})}a(pie,"CloneType");p();p();p();function Z8e(t){return bo(t)&&globalThis.Symbol.asyncIterator in t}a(Z8e,"IsAsyncIterator");function X8e(t){return bo(t)&&globalThis.Symbol.iterator in t}a(X8e,"IsIterator");function Bwt(t){return bo(t)&&(globalThis.Object.getPrototypeOf(t)===Object.prototype||globalThis.Object.getPrototypeOf(t)===null)}a(Bwt,"IsStandardObject");function e6e(t){return t instanceof globalThis.Promise}a(e6e,"IsPromise");function e_(t){return t instanceof Date&&globalThis.Number.isFinite(t.getTime())}a(e_,"IsDate");function YQr(t){return t instanceof globalThis.Map}a(YQr,"IsMap");function KQr(t){return t instanceof globalThis.Set}a(KQr,"IsSet");function EI(t){return globalThis.ArrayBuffer.isView(t)}a(EI,"IsTypedArray");function hie(t){return t instanceof globalThis.Uint8Array}a(hie,"IsUint8Array");function Ui(t,e){return e in t}a(Ui,"HasPropertyKey");function bo(t){return t!==null&&typeof t=="object"}a(bo,"IsObject");function wi(t){return globalThis.Array.isArray(t)&&!globalThis.ArrayBuffer.isView(t)}a(wi,"IsArray");function ku(t){return t===void 0}a(ku,"IsUndefined");function vB(t){return t===null}a(vB,"IsNull");function vN(t){return typeof t=="boolean"}a(vN,"IsBoolean");function oi(t){return typeof t=="number"}a(oi,"IsNumber");function t6e(t){return globalThis.Number.isInteger(t)}a(t6e,"IsInteger");function zg(t){return typeof t=="bigint"}a(zg,"IsBigInt");function Ea(t){return typeof t=="string"}a(Ea,"IsString");function b9(t){return typeof t=="function"}a(b9,"IsFunction");function CB(t){return typeof t=="symbol"}a(CB,"IsSymbol");function A1(t){return zg(t)||vN(t)||vB(t)||oi(t)||Ea(t)||CB(t)||ku(t)}a(A1,"IsValueType");var Jl;(function(t){t.InstanceMode="default",t.ExactOptionalPropertyTypes=!1,t.AllowArrayObject=!1,t.AllowNaN=!1,t.AllowNullVoid=!1;function e(c,l){return t.ExactOptionalPropertyTypes?l in c:c[l]!==void 0}a(e,"IsExactOptionalProperty"),t.IsExactOptionalProperty=e;function r(c){let l=bo(c);return t.AllowArrayObject?l:l&&!wi(c)}a(r,"IsObjectLike"),t.IsObjectLike=r;function n(c){return r(c)&&!(c instanceof Date)&&!(c instanceof Uint8Array)}a(n,"IsRecordLike"),t.IsRecordLike=n;function o(c){return t.AllowNaN?oi(c):Number.isFinite(c)}a(o,"IsNumberLike"),t.IsNumberLike=o;function s(c){let l=ku(c);return t.AllowNullVoid?l||c===null:l}a(s,"IsVoidLike"),t.IsVoidLike=s})(Jl||(Jl={}));p();function boo(t){return globalThis.Object.freeze(t).map(e=>tve(e))}a(boo,"ImmutableArray");function Soo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=tve(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=tve(t[r]);return globalThis.Object.freeze(e)}a(Soo,"ImmutableObject");function tve(t){return xp(t)?boo(t):MV(t)?t:_B(t)?t:eve(t)?t:Gc(t)?Soo(t):t}a(tve,"Immutable");function wt(t,e){let r=e!==void 0?{...e,...t}:t;switch(Jl.InstanceMode){case"freeze":return tve(r);case"clone":return Pu(r);default:return r}}a(wt,"CreateType");p();var Qi=class extends Error{static{a(this,"TypeBoxError")}constructor(e){super(e)}};p();p();p();var vd=Symbol.for("TypeBox.Transform"),iP=Symbol.for("TypeBox.Readonly"),Yg=Symbol.for("TypeBox.Optional"),_I=Symbol.for("TypeBox.Hint"),Tt=Symbol.for("TypeBox.Kind");function mie(t){return Gc(t)&&t[iP]==="Readonly"}a(mie,"IsReadonly");function jv(t){return Gc(t)&&t[Yg]==="Optional"}a(jv,"IsOptional");function Lwt(t){return ta(t,"Any")}a(Lwt,"IsAny");function Fwt(t){return ta(t,"Argument")}a(Fwt,"IsArgument");function oP(t){return ta(t,"Array")}a(oP,"IsArray");function OV(t){return ta(t,"AsyncIterator")}a(OV,"IsAsyncIterator");function BV(t){return ta(t,"BigInt")}a(BV,"IsBigInt");function bB(t){return ta(t,"Boolean")}a(bB,"IsBoolean");function sP(t){return ta(t,"Computed")}a(sP,"IsComputed");function aP(t){return ta(t,"Constructor")}a(aP,"IsConstructor");function Too(t){return ta(t,"Date")}a(Too,"IsDate");function cP(t){return ta(t,"Function")}a(cP,"IsFunction");function lP(t){return ta(t,"Integer")}a(lP,"IsInteger");function Kd(t){return ta(t,"Intersect")}a(Kd,"IsIntersect");function LV(t){return ta(t,"Iterator")}a(LV,"IsIterator");function ta(t,e){return Gc(t)&&Tt in t&&t[Tt]===e}a(ta,"IsKindOf");function r6e(t){return EB(t)||g1(t)||Nl(t)}a(r6e,"IsLiteralValue");function y1(t){return ta(t,"Literal")}a(y1,"IsLiteral");function E1(t){return ta(t,"MappedKey")}a(E1,"IsMappedKey");function Du(t){return ta(t,"MappedResult")}a(Du,"IsMappedResult");function S9(t){return ta(t,"Never")}a(S9,"IsNever");function Ioo(t){return ta(t,"Not")}a(Ioo,"IsNot");function rve(t){return ta(t,"Null")}a(rve,"IsNull");function uP(t){return ta(t,"Number")}a(uP,"IsNumber");function Rp(t){return ta(t,"Object")}a(Rp,"IsObject");function FV(t){return ta(t,"Promise")}a(FV,"IsPromise");function UV(t){return ta(t,"Record")}a(UV,"IsRecord");function Of(t){return ta(t,"Ref")}a(Of,"IsRef");function Uwt(t){return ta(t,"RegExp")}a(Uwt,"IsRegExp");function SB(t){return ta(t,"String")}a(SB,"IsString");function nve(t){return ta(t,"Symbol")}a(nve,"IsSymbol");function _1(t){return ta(t,"TemplateLiteral")}a(_1,"IsTemplateLiteral");function xoo(t){return ta(t,"This")}a(xoo,"IsThis");function Ja(t){return Gc(t)&&vd in t}a(Ja,"IsTransform");function v1(t){return ta(t,"Tuple")}a(v1,"IsTuple");function TB(t){return ta(t,"Undefined")}a(TB,"IsUndefined");function _a(t){return ta(t,"Union")}a(_a,"IsUnion");function woo(t){return ta(t,"Uint8Array")}a(woo,"IsUint8Array");function Roo(t){return ta(t,"Unknown")}a(Roo,"IsUnknown");function Poo(t){return ta(t,"Unsafe")}a(Poo,"IsUnsafe");function koo(t){return ta(t,"Void")}a(koo,"IsVoid");function T9(t){return Gc(t)&&Tt in t&&Nl(t[Tt])}a(T9,"IsKind");function Cd(t){return Lwt(t)||Fwt(t)||oP(t)||bB(t)||BV(t)||OV(t)||sP(t)||aP(t)||Too(t)||cP(t)||lP(t)||Kd(t)||LV(t)||y1(t)||E1(t)||Du(t)||S9(t)||Ioo(t)||rve(t)||uP(t)||Rp(t)||FV(t)||UV(t)||Of(t)||Uwt(t)||SB(t)||nve(t)||_1(t)||xoo(t)||v1(t)||TB(t)||_a(t)||woo(t)||Roo(t)||Poo(t)||koo(t)||T9(t)}a(Cd,"IsSchema");var nt={};xi(nt,{IsAny:()=>eqr,IsArgument:()=>tqr,IsArray:()=>rqr,IsAsyncIterator:()=>nqr,IsBigInt:()=>iqr,IsBoolean:()=>oqr,IsComputed:()=>sqr,IsConstructor:()=>aqr,IsDate:()=>cqr,IsFunction:()=>lqr,IsImport:()=>Loo,IsInteger:()=>uqr,IsIntersect:()=>dqr,IsIterator:()=>fqr,IsKind:()=>Fqr,IsKindOf:()=>ks,IsLiteral:()=>ove,IsLiteralBoolean:()=>Foo,IsLiteralNumber:()=>hqr,IsLiteralString:()=>pqr,IsLiteralValue:()=>mqr,IsMappedKey:()=>gqr,IsMappedResult:()=>Aqr,IsNever:()=>yqr,IsNot:()=>Eqr,IsNull:()=>_qr,IsNumber:()=>vqr,IsObject:()=>Cqr,IsOptional:()=>Boo,IsPromise:()=>bqr,IsProperties:()=>n6e,IsReadonly:()=>Ooo,IsRecord:()=>Sqr,IsRecursive:()=>Uoo,IsRef:()=>Tqr,IsRegExp:()=>Iqr,IsSchema:()=>Nu,IsString:()=>xqr,IsSymbol:()=>wqr,IsTemplateLiteral:()=>Rqr,IsThis:()=>Pqr,IsTransform:()=>kqr,IsTuple:()=>Dqr,IsUint8Array:()=>Mqr,IsUndefined:()=>Nqr,IsUnion:()=>Hwt,IsUnionLiteral:()=>Qoo,IsUnknown:()=>Oqr,IsUnsafe:()=>Bqr,IsVoid:()=>Lqr,TypeGuardUnknownTypeError:()=>Qwt});p();var Qwt=class extends Qi{static{a(this,"TypeGuardUnknownTypeError")}},Doo=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function JQr(t){try{return new RegExp(t),!0}catch{return!1}}a(JQr,"IsPattern");function qwt(t){if(!Nl(t))return!1;for(let e=0;e=7&&r<=13||r===27||r===127)return!1}return!0}a(qwt,"IsControlCharacterFree");function ZQr(t){return jwt(t)||Nu(t)}a(ZQr,"IsAdditionalProperties");function ive(t){return wp(t)||X_e(t)}a(ive,"IsOptionalBigInt");function Ml(t){return wp(t)||g1(t)}a(Ml,"IsOptionalNumber");function jwt(t){return wp(t)||EB(t)}a(jwt,"IsOptionalBoolean");function $c(t){return wp(t)||Nl(t)}a($c,"IsOptionalString");function Noo(t){return wp(t)||Nl(t)&&qwt(t)&&JQr(t)}a(Noo,"IsOptionalPattern");function Moo(t){return wp(t)||Nl(t)&&qwt(t)}a(Moo,"IsOptionalFormat");function XQr(t){return wp(t)||Nu(t)}a(XQr,"IsOptionalSchema");function Ooo(t){return Gc(t)&&t[iP]==="Readonly"}a(Ooo,"IsReadonly");function Boo(t){return Gc(t)&&t[Yg]==="Optional"}a(Boo,"IsOptional");function eqr(t){return ks(t,"Any")&&$c(t.$id)}a(eqr,"IsAny");function tqr(t){return ks(t,"Argument")&&g1(t.index)}a(tqr,"IsArgument");function rqr(t){return ks(t,"Array")&&t.type==="array"&&$c(t.$id)&&Nu(t.items)&&Ml(t.minItems)&&Ml(t.maxItems)&&jwt(t.uniqueItems)&&XQr(t.contains)&&Ml(t.minContains)&&Ml(t.maxContains)}a(rqr,"IsArray");function nqr(t){return ks(t,"AsyncIterator")&&t.type==="AsyncIterator"&&$c(t.$id)&&Nu(t.items)}a(nqr,"IsAsyncIterator");function iqr(t){return ks(t,"BigInt")&&t.type==="bigint"&&$c(t.$id)&&ive(t.exclusiveMaximum)&&ive(t.exclusiveMinimum)&&ive(t.maximum)&&ive(t.minimum)&&ive(t.multipleOf)}a(iqr,"IsBigInt");function oqr(t){return ks(t,"Boolean")&&t.type==="boolean"&&$c(t.$id)}a(oqr,"IsBoolean");function sqr(t){return ks(t,"Computed")&&Nl(t.target)&&xp(t.parameters)&&t.parameters.every(e=>Nu(e))}a(sqr,"IsComputed");function aqr(t){return ks(t,"Constructor")&&t.type==="Constructor"&&$c(t.$id)&&xp(t.parameters)&&t.parameters.every(e=>Nu(e))&&Nu(t.returns)}a(aqr,"IsConstructor");function cqr(t){return ks(t,"Date")&&t.type==="Date"&&$c(t.$id)&&Ml(t.exclusiveMaximumTimestamp)&&Ml(t.exclusiveMinimumTimestamp)&&Ml(t.maximumTimestamp)&&Ml(t.minimumTimestamp)&&Ml(t.multipleOfTimestamp)}a(cqr,"IsDate");function lqr(t){return ks(t,"Function")&&t.type==="Function"&&$c(t.$id)&&xp(t.parameters)&&t.parameters.every(e=>Nu(e))&&Nu(t.returns)}a(lqr,"IsFunction");function Loo(t){return ks(t,"Import")&&K8e(t,"$defs")&&Gc(t.$defs)&&n6e(t.$defs)&&K8e(t,"$ref")&&Nl(t.$ref)&&t.$ref in t.$defs}a(Loo,"IsImport");function uqr(t){return ks(t,"Integer")&&t.type==="integer"&&$c(t.$id)&&Ml(t.exclusiveMaximum)&&Ml(t.exclusiveMinimum)&&Ml(t.maximum)&&Ml(t.minimum)&&Ml(t.multipleOf)}a(uqr,"IsInteger");function n6e(t){return Gc(t)&&Object.entries(t).every(([e,r])=>qwt(e)&&Nu(r))}a(n6e,"IsProperties");function dqr(t){return ks(t,"Intersect")&&!(Nl(t.type)&&t.type!=="object")&&xp(t.allOf)&&t.allOf.every(e=>Nu(e)&&!kqr(e))&&$c(t.type)&&(jwt(t.unevaluatedProperties)||XQr(t.unevaluatedProperties))&&$c(t.$id)}a(dqr,"IsIntersect");function fqr(t){return ks(t,"Iterator")&&t.type==="Iterator"&&$c(t.$id)&&Nu(t.items)}a(fqr,"IsIterator");function ks(t,e){return Gc(t)&&Tt in t&&t[Tt]===e}a(ks,"IsKindOf");function pqr(t){return ove(t)&&Nl(t.const)}a(pqr,"IsLiteralString");function hqr(t){return ove(t)&&g1(t.const)}a(hqr,"IsLiteralNumber");function Foo(t){return ove(t)&&EB(t.const)}a(Foo,"IsLiteralBoolean");function ove(t){return ks(t,"Literal")&&$c(t.$id)&&mqr(t.const)}a(ove,"IsLiteral");function mqr(t){return EB(t)||g1(t)||Nl(t)}a(mqr,"IsLiteralValue");function gqr(t){return ks(t,"MappedKey")&&xp(t.keys)&&t.keys.every(e=>g1(e)||Nl(e))}a(gqr,"IsMappedKey");function Aqr(t){return ks(t,"MappedResult")&&n6e(t.properties)}a(Aqr,"IsMappedResult");function yqr(t){return ks(t,"Never")&&Gc(t.not)&&Object.getOwnPropertyNames(t.not).length===0}a(yqr,"IsNever");function Eqr(t){return ks(t,"Not")&&Nu(t.not)}a(Eqr,"IsNot");function _qr(t){return ks(t,"Null")&&t.type==="null"&&$c(t.$id)}a(_qr,"IsNull");function vqr(t){return ks(t,"Number")&&t.type==="number"&&$c(t.$id)&&Ml(t.exclusiveMaximum)&&Ml(t.exclusiveMinimum)&&Ml(t.maximum)&&Ml(t.minimum)&&Ml(t.multipleOf)}a(vqr,"IsNumber");function Cqr(t){return ks(t,"Object")&&t.type==="object"&&$c(t.$id)&&n6e(t.properties)&&ZQr(t.additionalProperties)&&Ml(t.minProperties)&&Ml(t.maxProperties)}a(Cqr,"IsObject");function bqr(t){return ks(t,"Promise")&&t.type==="Promise"&&$c(t.$id)&&Nu(t.item)}a(bqr,"IsPromise");function Sqr(t){return ks(t,"Record")&&t.type==="object"&&$c(t.$id)&&ZQr(t.additionalProperties)&&Gc(t.patternProperties)&&(e=>{let r=Object.getOwnPropertyNames(e.patternProperties);return r.length===1&&JQr(r[0])&&Gc(e.patternProperties)&&Nu(e.patternProperties[r[0]])})(t)}a(Sqr,"IsRecord");function Uoo(t){return Gc(t)&&_I in t&&t[_I]==="Recursive"}a(Uoo,"IsRecursive");function Tqr(t){return ks(t,"Ref")&&$c(t.$id)&&Nl(t.$ref)}a(Tqr,"IsRef");function Iqr(t){return ks(t,"RegExp")&&$c(t.$id)&&Nl(t.source)&&Nl(t.flags)&&Ml(t.maxLength)&&Ml(t.minLength)}a(Iqr,"IsRegExp");function xqr(t){return ks(t,"String")&&t.type==="string"&&$c(t.$id)&&Ml(t.minLength)&&Ml(t.maxLength)&&Noo(t.pattern)&&Moo(t.format)}a(xqr,"IsString");function wqr(t){return ks(t,"Symbol")&&t.type==="symbol"&&$c(t.$id)}a(wqr,"IsSymbol");function Rqr(t){return ks(t,"TemplateLiteral")&&t.type==="string"&&Nl(t.pattern)&&t.pattern[0]==="^"&&t.pattern[t.pattern.length-1]==="$"}a(Rqr,"IsTemplateLiteral");function Pqr(t){return ks(t,"This")&&$c(t.$id)&&Nl(t.$ref)}a(Pqr,"IsThis");function kqr(t){return Gc(t)&&vd in t}a(kqr,"IsTransform");function Dqr(t){return ks(t,"Tuple")&&t.type==="array"&&$c(t.$id)&&g1(t.minItems)&&g1(t.maxItems)&&t.minItems===t.maxItems&&(wp(t.items)&&wp(t.additionalItems)&&t.minItems===0||xp(t.items)&&t.items.every(e=>Nu(e)))}a(Dqr,"IsTuple");function Nqr(t){return ks(t,"Undefined")&&t.type==="undefined"&&$c(t.$id)}a(Nqr,"IsUndefined");function Qoo(t){return Hwt(t)&&t.anyOf.every(e=>pqr(e)||hqr(e))}a(Qoo,"IsUnionLiteral");function Hwt(t){return ks(t,"Union")&&$c(t.$id)&&Gc(t)&&xp(t.anyOf)&&t.anyOf.every(e=>Nu(e))}a(Hwt,"IsUnion");function Mqr(t){return ks(t,"Uint8Array")&&t.type==="Uint8Array"&&$c(t.$id)&&Ml(t.minByteLength)&&Ml(t.maxByteLength)}a(Mqr,"IsUint8Array");function Oqr(t){return ks(t,"Unknown")&&$c(t.$id)}a(Oqr,"IsUnknown");function Bqr(t){return ks(t,"Unsafe")}a(Bqr,"IsUnsafe");function Lqr(t){return ks(t,"Void")&&t.type==="void"&&$c(t.$id)}a(Lqr,"IsVoid");function Fqr(t){return Gc(t)&&Tt in t&&Nl(t[Tt])&&!Doo.includes(t[Tt])}a(Fqr,"IsKind");function Nu(t){return Gc(t)&&(eqr(t)||tqr(t)||rqr(t)||oqr(t)||iqr(t)||nqr(t)||sqr(t)||aqr(t)||cqr(t)||lqr(t)||uqr(t)||dqr(t)||fqr(t)||ove(t)||gqr(t)||Aqr(t)||yqr(t)||Eqr(t)||_qr(t)||vqr(t)||Cqr(t)||bqr(t)||Sqr(t)||Tqr(t)||Iqr(t)||xqr(t)||wqr(t)||Rqr(t)||Pqr(t)||Dqr(t)||Nqr(t)||Hwt(t)||Mqr(t)||Oqr(t)||Bqr(t)||Lqr(t)||Fqr(t))}a(Nu,"IsSchema");p();var Gwt="(true|false)",sve="(0|[1-9][0-9]*)",$wt="(.*)",qoo="(?!.*)",crl=`^${Gwt}$`,I9=`^${sve}$`,x9=`^${$wt}$`,Uqr=`^${qoo}$`;p();var dP={};xi(dP,{Clear:()=>Hoo,Delete:()=>Goo,Entries:()=>joo,Get:()=>Woo,Has:()=>$oo,Set:()=>Voo});p();var gie=new Map;function joo(){return new Map(gie)}a(joo,"Entries");function Hoo(){return gie.clear()}a(Hoo,"Clear");function Goo(t){return gie.delete(t)}a(Goo,"Delete");function $oo(t){return gie.has(t)}a($oo,"Has");function Voo(t,e){gie.set(t,e)}a(Voo,"Set");function Woo(t){return gie.get(t)}a(Woo,"Get");var t_={};xi(t_,{Clear:()=>Yoo,Delete:()=>Koo,Entries:()=>zoo,Get:()=>Xoo,Has:()=>Joo,Set:()=>Zoo});p();var Aie=new Map;function zoo(){return new Map(Aie)}a(zoo,"Entries");function Yoo(){return Aie.clear()}a(Yoo,"Clear");function Koo(t){return Aie.delete(t)}a(Koo,"Delete");function Joo(t){return Aie.has(t)}a(Joo,"Has");function Zoo(t,e){Aie.set(t,e)}a(Zoo,"Set");function Xoo(t){return Aie.get(t)}a(Xoo,"Get");p();function Qqr(t,e){return t.includes(e)}a(Qqr,"SetIncludes");function qqr(t){return[...new Set(t)]}a(qqr,"SetDistinct");function eso(t,e){return t.filter(r=>e.includes(r))}a(eso,"SetIntersect");function tso(t,e){return t.reduce((r,n)=>eso(r,n),e)}a(tso,"SetIntersectManyResolve");function jqr(t){return t.length===1?t[0]:t.length>1?tso(t.slice(1),t[0]):[]}a(jqr,"SetIntersectMany");function Hqr(t){let e=[];for(let r of t)e.push(...r);return e}a(Hqr,"SetUnionMany");p();function w9(t){return wt({[Tt]:"Any"},t)}a(w9,"Any");p();function yie(t,e){return wt({[Tt]:"Array",type:"array",items:t},e)}a(yie,"Array");p();function Gqr(t){return wt({[Tt]:"Argument",index:t})}a(Gqr,"Argument");p();function Eie(t,e){return wt({[Tt]:"AsyncIterator",type:"AsyncIterator",items:t},e)}a(Eie,"AsyncIterator");p();p();function Zl(t,e,r){return wt({[Tt]:"Computed",target:t,parameters:e},r)}a(Zl,"Computed");p();p();function rso(t,e){let{[e]:r,...n}=t;return n}a(rso,"DiscardKey");function Jd(t,e){return e.reduce((r,n)=>rso(r,n),t)}a(Jd,"Discard");p();function Wo(t){return wt({[Tt]:"Never",not:{}},t)}a(Wo,"Never");p();p();function Ba(t){return wt({[Tt]:"MappedResult",properties:t})}a(Ba,"MappedResult");p();p();function _ie(t,e,r){return wt({[Tt]:"Constructor",type:"Constructor",parameters:t,returns:e},r)}a(_ie,"Constructor");p();function CN(t,e,r){return wt({[Tt]:"Function",type:"Function",parameters:t,returns:e},r)}a(CN,"Function");p();p();p();p();function ave(t,e){return wt({[Tt]:"Union",anyOf:t},e)}a(ave,"UnionCreate");function nso(t){return t.some(e=>jv(e))}a(nso,"IsUnionOptional");function $qr(t){return t.map(e=>jv(e)?iso(e):e)}a($qr,"RemoveOptionalFromRest");function iso(t){return Jd(t,[Yg])}a(iso,"RemoveOptionalFromType");function oso(t,e){return nso(t)?_y(ave($qr(t),e)):ave($qr(t),e)}a(oso,"ResolveUnion");function bN(t,e){return t.length===1?wt(t[0],e):t.length===0?Wo(e):oso(t,e)}a(bN,"UnionEvaluated");p();function Za(t,e){return t.length===0?Wo(e):t.length===1?wt(t[0],e):ave(t,e)}a(Za,"Union");p();p();p();var i6e=class extends Qi{static{a(this,"TemplateLiteralParserError")}};function sso(t){return t.replace(/\\\$/g,"$").replace(/\\\*/g,"*").replace(/\\\^/g,"^").replace(/\\\|/g,"|").replace(/\\\(/g,"(").replace(/\\\)/g,")")}a(sso,"Unescape");function Vwt(t,e,r){return t[e]===r&&t.charCodeAt(e-1)!==92}a(Vwt,"IsNonEscaped");function xB(t,e){return Vwt(t,e,"(")}a(xB,"IsOpenParen");function cve(t,e){return Vwt(t,e,")")}a(cve,"IsCloseParen");function Vqr(t,e){return Vwt(t,e,"|")}a(Vqr,"IsSeparator");function aso(t){if(!(xB(t,0)&&cve(t,t.length-1)))return!1;let e=0;for(let r=0;r0&&n.push(vie(c)),r=s+1}let o=t.slice(r);return o.length>0&&n.push(vie(o)),n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"or",expr:n}}a(dso,"Or");function fso(t){function e(o,s){if(!xB(o,s))throw new i6e("TemplateLiteralParser: Index must point to open parens");let c=0;for(let l=s;l0&&n.push(vie(l)),o=c-1}return n.length===0?{type:"const",const:""}:n.length===1?n[0]:{type:"and",expr:n}}a(fso,"And");function vie(t){return aso(t)?vie(cso(t)):lso(t)?dso(t):uso(t)?fso(t):{type:"const",const:sso(t)}}a(vie,"TemplateLiteralParse");function Cie(t){return vie(t.slice(1,t.length-1))}a(Cie,"TemplateLiteralParseExact");var Wwt=class extends Qi{static{a(this,"TemplateLiteralFiniteError")}};function pso(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="0"&&t.expr[1].type==="const"&&t.expr[1].const==="[1-9][0-9]*"}a(pso,"IsNumberExpression");function hso(t){return t.type==="or"&&t.expr.length===2&&t.expr[0].type==="const"&&t.expr[0].const==="true"&&t.expr[1].type==="const"&&t.expr[1].const==="false"}a(hso,"IsBooleanExpression");function mso(t){return t.type==="const"&&t.const===".*"}a(mso,"IsStringExpression");function QV(t){return pso(t)||mso(t)?!1:hso(t)?!0:t.type==="and"?t.expr.every(e=>QV(e)):t.type==="or"?t.expr.every(e=>QV(e)):t.type==="const"?!0:(()=>{throw new Wwt("Unknown expression type")})()}a(QV,"IsTemplateLiteralExpressionFinite");function o6e(t){let e=Cie(t.pattern);return QV(e)}a(o6e,"IsTemplateLiteralFinite");p();var zwt=class extends Qi{static{a(this,"TemplateLiteralGenerateError")}};function*Wqr(t){if(t.length===1)return yield*t[0];for(let e of t[0])for(let r of Wqr(t.slice(1)))yield`${e}${r}`}a(Wqr,"GenerateReduce");function*gso(t){return yield*Wqr(t.expr.map(e=>[...lve(e)]))}a(gso,"GenerateAnd");function*Aso(t){for(let e of t.expr)yield*lve(e)}a(Aso,"GenerateOr");function*yso(t){return yield t.const}a(yso,"GenerateConst");function*lve(t){return t.type==="and"?yield*gso(t):t.type==="or"?yield*Aso(t):t.type==="const"?yield*yso(t):(()=>{throw new zwt("Unknown expression")})()}a(lve,"TemplateLiteralExpressionGenerate");function bie(t){let e=Cie(t.pattern);return QV(e)?[...lve(e)]:[]}a(bie,"TemplateLiteralGenerate");p();p();function ra(t,e){return wt({[Tt]:"Literal",const:t,type:typeof t},e)}a(ra,"Literal");p();function s6e(t){return wt({[Tt]:"Boolean",type:"boolean"},t)}a(s6e,"Boolean");p();function Sie(t){return wt({[Tt]:"BigInt",type:"bigint"},t)}a(Sie,"BigInt");p();function vI(t){return wt({[Tt]:"Number",type:"number"},t)}a(vI,"Number");p();function r_(t){return wt({[Tt]:"String",type:"string"},t)}a(r_,"String");function*Eso(t){let e=t.trim().replace(/"|'/g,"");return e==="boolean"?yield s6e():e==="number"?yield vI():e==="bigint"?yield Sie():e==="string"?yield r_():yield(()=>{let r=e.split("|").map(n=>ra(n.trim()));return r.length===0?Wo():r.length===1?r[0]:bN(r)})()}a(Eso,"FromUnion");function*_so(t){if(t[1]!=="{"){let e=ra("$"),r=Ywt(t.slice(1));return yield*[e,...r]}for(let e=2;eYqr(r,e)).join("|")})`:uP(t)?`${e}${sve}`:lP(t)?`${e}${sve}`:BV(t)?`${e}${sve}`:SB(t)?`${e}${$wt}`:y1(t)?`${e}${vso(t.const.toString())}`:bB(t)?`${e}${Gwt}`:(()=>{throw new Kwt(`Unexpected Kind '${t[Tt]}'`)})()}a(Yqr,"Visit");function Jwt(t){return`^${t.map(e=>Yqr(e,"")).join("")}$`}a(Jwt,"TemplateLiteralPattern");p();function qV(t){let r=bie(t).map(n=>ra(n));return bN(r)}a(qV,"TemplateLiteralToUnion");p();function a6e(t,e){let r=Nl(t)?Jwt(zqr(t)):Jwt(t);return wt({[Tt]:"TemplateLiteral",type:"string",pattern:r},e)}a(a6e,"TemplateLiteral");function Cso(t){return bie(t).map(r=>r.toString())}a(Cso,"FromTemplateLiteral");function bso(t){let e=[];for(let r of t)e.push(...Hv(r));return e}a(bso,"FromUnion");function Sso(t){return[t.toString()]}a(Sso,"FromLiteral");function Hv(t){return[...new Set(_1(t)?Cso(t):_a(t)?bso(t.anyOf):y1(t)?Sso(t.const):uP(t)?["[number]"]:lP(t)?["[number]"]:[])]}a(Hv,"IndexPropertyKeys");p();function Tso(t,e,r){let n={};for(let o of Object.getOwnPropertyNames(e))n[o]=R9(t,Hv(e[o]),r);return n}a(Tso,"FromProperties");function Iso(t,e,r){return Tso(t,e.properties,r)}a(Iso,"FromMappedResult");function Kqr(t,e,r){let n=Iso(t,e,r);return Ba(n)}a(Kqr,"IndexFromMappedResult");function Zqr(t,e){return t.map(r=>Xqr(r,e))}a(Zqr,"FromRest");function xso(t){return t.filter(e=>!S9(e))}a(xso,"FromIntersectRest");function wso(t,e){return c6e(xso(Zqr(t,e)))}a(wso,"FromIntersect");function Rso(t){return t.some(e=>S9(e))?[]:t}a(Rso,"FromUnionRest");function Pso(t,e){return bN(Rso(Zqr(t,e)))}a(Pso,"FromUnion");function kso(t,e){return e in t?t[e]:e==="[number]"?bN(t):Wo()}a(kso,"FromTuple");function Dso(t,e){return e==="[number]"?t:Wo()}a(Dso,"FromArray");function Nso(t,e){return e in t?t[e]:Wo()}a(Nso,"FromProperty");function Xqr(t,e){return Kd(t)?wso(t.allOf,e):_a(t)?Pso(t.anyOf,e):v1(t)?kso(t.items??[],e):oP(t)?Dso(t.items,e):Rp(t)?Nso(t.properties,e):Wo()}a(Xqr,"IndexFromPropertyKey");function uve(t,e){return e.map(r=>Xqr(t,r))}a(uve,"IndexFromPropertyKeys");function Jqr(t,e){return bN(uve(t,e))}a(Jqr,"FromSchema");function R9(t,e,r){if(Of(t)||Of(e)){let n="Index types using Ref parameters require both Type and Key to be of TSchema";if(!Cd(t)||!Cd(e))throw new Qi(n);return Zl("Index",[t,e])}return Du(e)?Kqr(t,e,r):E1(e)?ejr(t,e,r):wt(Cd(e)?Jqr(t,Hv(e)):Jqr(t,e),r)}a(R9,"Index");function Mso(t,e,r){return{[e]:R9(t,[e],Pu(r))}}a(Mso,"MappedIndexPropertyKey");function Oso(t,e,r){return e.reduce((n,o)=>({...n,...Mso(t,o,r)}),{})}a(Oso,"MappedIndexPropertyKeys");function Bso(t,e,r){return Oso(t,e.keys,r)}a(Bso,"MappedIndexProperties");function ejr(t,e,r){let n=Bso(t,e,r);return Ba(n)}a(ejr,"IndexFromMappedKey");p();function Tie(t,e){return wt({[Tt]:"Iterator",type:"Iterator",items:t},e)}a(Tie,"Iterator");p();function Lso(t){return globalThis.Object.keys(t).filter(e=>!jv(t[e]))}a(Lso,"RequiredArray");function Fso(t,e){let r=Lso(t),n=r.length>0?{[Tt]:"Object",type:"object",required:r,properties:t}:{[Tt]:"Object",type:"object",properties:t};return wt(n,e)}a(Fso,"_Object");var Xa=Fso;p();function l6e(t,e){return wt({[Tt]:"Promise",type:"Promise",item:t},e)}a(l6e,"Promise");p();p();function Uso(t){return wt(Jd(t,[iP]))}a(Uso,"RemoveReadonly");function Qso(t){return wt({...t,[iP]:"Readonly"})}a(Qso,"AddReadonly");function qso(t,e){return e===!1?Uso(t):Qso(t)}a(qso,"ReadonlyWithFlag");function Gv(t,e){let r=e??!0;return Du(t)?tjr(t,r):qso(t,r)}a(Gv,"Readonly");function jso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Gv(t[n],e);return r}a(jso,"FromProperties");function Hso(t,e){return jso(t.properties,e)}a(Hso,"FromMappedResult");function tjr(t,e){let r=Hso(t,e);return Ba(r)}a(tjr,"ReadonlyFromMappedResult");p();function CI(t,e){return wt(t.length>0?{[Tt]:"Tuple",type:"array",items:t,additionalItems:!1,minItems:t.length,maxItems:t.length}:{[Tt]:"Tuple",type:"array",minItems:t.length,maxItems:t.length},e)}a(CI,"Tuple");function rjr(t,e){return t in e?bI(t,e[t]):Ba(e)}a(rjr,"FromMappedResult");function Gso(t){return{[t]:ra(t)}}a(Gso,"MappedKeyToKnownMappedResultProperties");function $so(t){let e={};for(let r of t)e[r]=ra(r);return e}a($so,"MappedKeyToUnknownMappedResultProperties");function Vso(t,e){return Qqr(e,t)?Gso(t):$so(e)}a(Vso,"MappedKeyToMappedResultProperties");function Wso(t,e){let r=Vso(t,e);return rjr(t,r)}a(Wso,"FromMappedKey");function dve(t,e){return e.map(r=>bI(t,r))}a(dve,"FromRest");function zso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(e))r[n]=bI(t,e[n]);return r}a(zso,"FromProperties");function bI(t,e){let r={...e};return jv(e)?_y(bI(t,Jd(e,[Yg]))):mie(e)?Gv(bI(t,Jd(e,[iP]))):Du(e)?rjr(t,e.properties):E1(e)?Wso(t,e.keys):aP(e)?_ie(dve(t,e.parameters),bI(t,e.returns),r):cP(e)?CN(dve(t,e.parameters),bI(t,e.returns),r):OV(e)?Eie(bI(t,e.items),r):LV(e)?Tie(bI(t,e.items),r):Kd(e)?vy(dve(t,e.allOf),r):_a(e)?Za(dve(t,e.anyOf),r):v1(e)?CI(dve(t,e.items??[]),r):Rp(e)?Xa(zso(t,e.properties),r):oP(e)?yie(bI(t,e.items),r):FV(e)?l6e(bI(t,e.item),r):e}a(bI,"FromSchemaType");function Yso(t,e){let r={};for(let n of t)r[n]=bI(n,e);return r}a(Yso,"MappedFunctionReturnType");function njr(t,e,r){let n=Cd(t)?Hv(t):t,o=e({[Tt]:"MappedKey",keys:n}),s=Yso(n,o);return Xa(s,r)}a(njr,"Mapped");p();function Kso(t){return wt(Jd(t,[Yg]))}a(Kso,"RemoveOptional");function Jso(t){return wt({...t,[Yg]:"Optional"})}a(Jso,"AddOptional");function Zso(t,e){return e===!1?Kso(t):Jso(t)}a(Zso,"OptionalWithFlag");function _y(t,e){let r=e??!0;return Du(t)?ijr(t,r):Zso(t,r)}a(_y,"Optional");function Xso(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=_y(t[n],e);return r}a(Xso,"FromProperties");function eao(t,e){return Xso(t.properties,e)}a(eao,"FromMappedResult");function ijr(t,e){let r=eao(t,e);return Ba(r)}a(ijr,"OptionalFromMappedResult");p();function fve(t,e={}){let r=t.every(o=>Rp(o)),n=Cd(e.unevaluatedProperties)?{unevaluatedProperties:e.unevaluatedProperties}:{};return wt(e.unevaluatedProperties===!1||Cd(e.unevaluatedProperties)||r?{...n,[Tt]:"Intersect",type:"object",allOf:t}:{...n,[Tt]:"Intersect",allOf:t},e)}a(fve,"IntersectCreate");function tao(t){return t.every(e=>jv(e))}a(tao,"IsIntersectOptional");function rao(t){return Jd(t,[Yg])}a(rao,"RemoveOptionalFromType");function ojr(t){return t.map(e=>jv(e)?rao(e):e)}a(ojr,"RemoveOptionalFromRest");function nao(t,e){return tao(t)?_y(fve(ojr(t),e)):fve(ojr(t),e)}a(nao,"ResolveIntersect");function c6e(t,e={}){if(t.length===1)return wt(t[0],e);if(t.length===0)return Wo(e);if(t.some(r=>Ja(r)))throw new Error("Cannot intersect transform types");return nao(t,e)}a(c6e,"IntersectEvaluated");p();function vy(t,e){if(t.length===1)return wt(t[0],e);if(t.length===0)return Wo(e);if(t.some(r=>Ja(r)))throw new Error("Cannot intersect transform types");return fve(t,e)}a(vy,"Intersect");p();function SI(...t){let[e,r]=typeof t[0]=="string"?[t[0],t[1]]:[t[0].$id,t[1]];if(typeof e!="string")throw new Qi("Ref: $ref must be a string");return wt({[Tt]:"Ref",$ref:e},r)}a(SI,"Ref");function iao(t,e){return Zl("Awaited",[Zl(t,e)])}a(iao,"FromComputed");function oao(t){return Zl("Awaited",[SI(t)])}a(oao,"FromRef");function sao(t){return vy(sjr(t))}a(sao,"FromIntersect");function aao(t){return Za(sjr(t))}a(aao,"FromUnion");function cao(t){return Iie(t)}a(cao,"FromPromise");function sjr(t){return t.map(e=>Iie(e))}a(sjr,"FromRest");function Iie(t,e){return wt(sP(t)?iao(t.target,t.parameters):Kd(t)?sao(t.allOf):_a(t)?aao(t.anyOf):FV(t)?cao(t.item):Of(t)?oao(t.$ref):t,e)}a(Iie,"Awaited");p();p();p();p();function ajr(t){let e=[];for(let r of t)e.push($v(r));return e}a(ajr,"FromRest");function lao(t){let e=ajr(t);return Hqr(e)}a(lao,"FromIntersect");function uao(t){let e=ajr(t);return jqr(e)}a(uao,"FromUnion");function dao(t){return t.map((e,r)=>r.toString())}a(dao,"FromTuple");function fao(t){return["[number]"]}a(fao,"FromArray");function pao(t){return globalThis.Object.getOwnPropertyNames(t)}a(pao,"FromProperties");function hao(t){return Zwt?globalThis.Object.getOwnPropertyNames(t).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}a(hao,"FromPatternProperties");function $v(t){return Kd(t)?lao(t.allOf):_a(t)?uao(t.anyOf):v1(t)?dao(t.items??[]):oP(t)?fao(t.items):Rp(t)?pao(t.properties):UV(t)?hao(t.patternProperties):[]}a($v,"KeyOfPropertyKeys");var Zwt=!1;function wB(t){Zwt=!0;let e=$v(t);return Zwt=!1,`^(${e.map(n=>`(${n})`).join("|")})$`}a(wB,"KeyOfPattern");function mao(t,e){return Zl("KeyOf",[Zl(t,e)])}a(mao,"FromComputed");function gao(t){return Zl("KeyOf",[SI(t)])}a(gao,"FromRef");function Aao(t,e){let r=$v(t),n=yao(r),o=bN(n);return wt(o,e)}a(Aao,"KeyOfFromType");function yao(t){return t.map(e=>e==="[number]"?vI():ra(e))}a(yao,"KeyOfPropertyKeysToRest");function xie(t,e){return sP(t)?mao(t.target,t.parameters):Of(t)?gao(t.$ref):Du(t)?cjr(t,e):Aao(t,e)}a(xie,"KeyOf");function Eao(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=xie(t[n],Pu(e));return r}a(Eao,"FromProperties");function _ao(t,e){return Eao(t.properties,e)}a(_ao,"FromMappedResult");function cjr(t,e){let r=_ao(t,e);return Ba(r)}a(cjr,"KeyOfFromMappedResult");p();function u6e(t){let e=$v(t),r=uve(t,e);return e.map((n,o)=>[e[o],r[o]])}a(u6e,"KeyOfPropertyEntries");function vao(t){let e=[];for(let r of t)e.push(...$v(r));return qqr(e)}a(vao,"CompositeKeys");function Cao(t){return t.filter(e=>!S9(e))}a(Cao,"FilterNever");function bao(t,e){let r=[];for(let n of t)r.push(...uve(n,[e]));return Cao(r)}a(bao,"CompositeProperty");function Sao(t,e){let r={};for(let n of e)r[n]=c6e(bao(t,n));return r}a(Sao,"CompositeProperties");function ljr(t,e){let r=vao(t),n=Sao(t,r);return Xa(n,e)}a(ljr,"Composite");p();p();function d6e(t){return wt({[Tt]:"Date",type:"Date"},t)}a(d6e,"Date");p();function f6e(t){return wt({[Tt]:"Null",type:"null"},t)}a(f6e,"Null");p();function p6e(t){return wt({[Tt]:"Symbol",type:"symbol"},t)}a(p6e,"Symbol");p();function h6e(t){return wt({[Tt]:"Undefined",type:"undefined"},t)}a(h6e,"Undefined");p();function m6e(t){return wt({[Tt]:"Uint8Array",type:"Uint8Array"},t)}a(m6e,"Uint8Array");p();function fP(t){return wt({[Tt]:"Unknown"},t)}a(fP,"Unknown");function Tao(t){return t.map(e=>Xwt(e,!1))}a(Tao,"FromArray");function Iao(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Gv(Xwt(t[r],!1));return e}a(Iao,"FromProperties");function g6e(t,e){return e===!0?t:Gv(t)}a(g6e,"ConditionalReadonly");function Xwt(t,e){return kwt(t)?g6e(w9(),e):Nwt(t)?g6e(w9(),e):xp(t)?Gv(CI(Tao(t))):_B(t)?m6e():MV(t)?d6e():Gc(t)?g6e(Xa(Iao(t)),e):Dwt(t)?g6e(CN([],fP()),e):wp(t)?h6e():Mwt(t)?f6e():Owt(t)?p6e():X_e(t)?Sie():g1(t)?ra(t):EB(t)?ra(t):Nl(t)?ra(t):Xa({})}a(Xwt,"FromValue");function ujr(t,e){return wt(Xwt(t,!0),e)}a(ujr,"Const");p();function djr(t,e){return aP(t)?CI(t.parameters,e):Wo(e)}a(djr,"ConstructorParameters");p();function fjr(t,e){if(wp(t))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(t).filter(s=>isNaN(s)).map(s=>t[s]),o=[...new Set(r)].map(s=>ra(s));return Za(o,{...e,[_I]:"Enum"})}a(fjr,"Enum");p();p();p();var tRt=class extends Qi{static{a(this,"ExtendsResolverError")}},Rt;(function(t){t[t.Union=0]="Union",t[t.True=1]="True",t[t.False=2]="False"})(Rt||(Rt={}));function TI(t){return t===Rt.False?t:Rt.True}a(TI,"IntoBooleanResult");function wie(t){throw new tRt(t)}a(wie,"Throw");function gh(t){return nt.IsNever(t)||nt.IsIntersect(t)||nt.IsUnion(t)||nt.IsUnknown(t)||nt.IsAny(t)}a(gh,"IsStructuralRight");function Ah(t,e){return nt.IsNever(e)?Ejr(t,e):nt.IsIntersect(e)?A6e(t,e):nt.IsUnion(e)?oRt(t,e):nt.IsUnknown(e)?bjr(t,e):nt.IsAny(e)?iRt(t,e):wie("StructuralRight")}a(Ah,"StructuralRight");function iRt(t,e){return Rt.True}a(iRt,"FromAnyRight");function xao(t,e){return nt.IsIntersect(e)?A6e(t,e):nt.IsUnion(e)&&e.anyOf.some(r=>nt.IsAny(r)||nt.IsUnknown(r))?Rt.True:nt.IsUnion(e)?Rt.Union:nt.IsUnknown(e)||nt.IsAny(e)?Rt.True:Rt.Union}a(xao,"FromAny");function wao(t,e){return nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:nt.IsNever(t)?Rt.True:Rt.False}a(wao,"FromArrayRight");function Rao(t,e){return nt.IsObject(e)&&y6e(e)?Rt.True:gh(e)?Ah(t,e):nt.IsArray(e)?TI(Vc(t.items,e.items)):Rt.False}a(Rao,"FromArray");function Pao(t,e){return gh(e)?Ah(t,e):nt.IsAsyncIterator(e)?TI(Vc(t.items,e.items)):Rt.False}a(Pao,"FromAsyncIterator");function kao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsBigInt(e)?Rt.True:Rt.False}a(kao,"FromBigInt");function Ajr(t,e){return nt.IsLiteralBoolean(t)||nt.IsBoolean(t)?Rt.True:Rt.False}a(Ajr,"FromBooleanRight");function Dao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsBoolean(e)?Rt.True:Rt.False}a(Dao,"FromBoolean");function Nao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsConstructor(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>TI(Vc(e.parameters[n],r))===Rt.True)?TI(Vc(t.returns,e.returns)):Rt.False:Rt.False}a(Nao,"FromConstructor");function Mao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsDate(e)?Rt.True:Rt.False}a(Mao,"FromDate");function Oao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsFunction(e)?t.parameters.length>e.parameters.length?Rt.False:t.parameters.every((r,n)=>TI(Vc(e.parameters[n],r))===Rt.True)?TI(Vc(t.returns,e.returns)):Rt.False:Rt.False}a(Oao,"FromFunction");function yjr(t,e){return nt.IsLiteral(t)&&Ey.IsNumber(t.const)||nt.IsNumber(t)||nt.IsInteger(t)?Rt.True:Rt.False}a(yjr,"FromIntegerRight");function Bao(t,e){return nt.IsInteger(e)||nt.IsNumber(e)?Rt.True:gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):Rt.False}a(Bao,"FromInteger");function A6e(t,e){return e.allOf.every(r=>Vc(t,r)===Rt.True)?Rt.True:Rt.False}a(A6e,"FromIntersectRight");function Lao(t,e){return t.allOf.some(r=>Vc(r,e)===Rt.True)?Rt.True:Rt.False}a(Lao,"FromIntersect");function Fao(t,e){return gh(e)?Ah(t,e):nt.IsIterator(e)?TI(Vc(t.items,e.items)):Rt.False}a(Fao,"FromIterator");function Uao(t,e){return nt.IsLiteral(e)&&e.const===t.const?Rt.True:gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsString(e)?Cjr(t,e):nt.IsNumber(e)?_jr(t,e):nt.IsInteger(e)?yjr(t,e):nt.IsBoolean(e)?Ajr(t,e):Rt.False}a(Uao,"FromLiteral");function Ejr(t,e){return Rt.False}a(Ejr,"FromNeverRight");function Qao(t,e){return Rt.True}a(Qao,"FromNever");function pjr(t){let[e,r]=[t,0];for(;nt.IsNot(e);)e=e.not,r+=1;return r%2===0?e:fP()}a(pjr,"UnwrapTNot");function qao(t,e){return nt.IsNot(t)?Vc(pjr(t),e):nt.IsNot(e)?Vc(t,pjr(e)):wie("Invalid fallthrough for Not")}a(qao,"FromNot");function jao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsNull(e)?Rt.True:Rt.False}a(jao,"FromNull");function _jr(t,e){return nt.IsLiteralNumber(t)||nt.IsNumber(t)||nt.IsInteger(t)?Rt.True:Rt.False}a(_jr,"FromNumberRight");function Hao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsInteger(e)||nt.IsNumber(e)?Rt.True:Rt.False}a(Hao,"FromNumber");function Vv(t,e){return Object.getOwnPropertyNames(t.properties).length===e}a(Vv,"IsObjectPropertyCount");function hjr(t){return y6e(t)}a(hjr,"IsObjectStringLike");function mjr(t){return Vv(t,0)||Vv(t,1)&&"description"in t.properties&&nt.IsUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(nt.IsString(t.properties.description.anyOf[0])&&nt.IsUndefined(t.properties.description.anyOf[1])||nt.IsString(t.properties.description.anyOf[1])&&nt.IsUndefined(t.properties.description.anyOf[0]))}a(mjr,"IsObjectSymbolLike");function eRt(t){return Vv(t,0)}a(eRt,"IsObjectNumberLike");function gjr(t){return Vv(t,0)}a(gjr,"IsObjectBooleanLike");function Gao(t){return Vv(t,0)}a(Gao,"IsObjectBigIntLike");function $ao(t){return Vv(t,0)}a($ao,"IsObjectDateLike");function Vao(t){return y6e(t)}a(Vao,"IsObjectUint8ArrayLike");function Wao(t){let e=vI();return Vv(t,0)||Vv(t,1)&&"length"in t.properties&&TI(Vc(t.properties.length,e))===Rt.True}a(Wao,"IsObjectFunctionLike");function zao(t){return Vv(t,0)}a(zao,"IsObjectConstructorLike");function y6e(t){let e=vI();return Vv(t,0)||Vv(t,1)&&"length"in t.properties&&TI(Vc(t.properties.length,e))===Rt.True}a(y6e,"IsObjectArrayLike");function Yao(t){let e=CN([w9()],w9());return Vv(t,0)||Vv(t,1)&&"then"in t.properties&&TI(Vc(t.properties.then,e))===Rt.True}a(Yao,"IsObjectPromiseLike");function vjr(t,e){return Vc(t,e)===Rt.False||nt.IsOptional(t)&&!nt.IsOptional(e)?Rt.False:Rt.True}a(vjr,"Property");function Cy(t,e){return nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:nt.IsNever(t)||nt.IsLiteralString(t)&&hjr(e)||nt.IsLiteralNumber(t)&&eRt(e)||nt.IsLiteralBoolean(t)&&gjr(e)||nt.IsSymbol(t)&&mjr(e)||nt.IsBigInt(t)&&Gao(e)||nt.IsString(t)&&hjr(e)||nt.IsSymbol(t)&&mjr(e)||nt.IsNumber(t)&&eRt(e)||nt.IsInteger(t)&&eRt(e)||nt.IsBoolean(t)&&gjr(e)||nt.IsUint8Array(t)&&Vao(e)||nt.IsDate(t)&&$ao(e)||nt.IsConstructor(t)&&zao(e)||nt.IsFunction(t)&&Wao(e)?Rt.True:nt.IsRecord(t)&&nt.IsString(rRt(t))?e[_I]==="Record"?Rt.True:Rt.False:nt.IsRecord(t)&&nt.IsNumber(rRt(t))&&Vv(e,0)?Rt.True:Rt.False}a(Cy,"FromObjectRight");function Kao(t,e){return gh(e)?Ah(t,e):nt.IsRecord(e)?II(t,e):nt.IsObject(e)?(()=>{for(let r of Object.getOwnPropertyNames(e.properties)){if(!(r in t.properties)&&!nt.IsOptional(e.properties[r]))return Rt.False;if(nt.IsOptional(e.properties[r]))return Rt.True;if(vjr(t.properties[r],e.properties[r])===Rt.False)return Rt.False}return Rt.True})():Rt.False}a(Kao,"FromObject");function Jao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)&&Yao(e)?Rt.True:nt.IsPromise(e)?TI(Vc(t.item,e.item)):Rt.False}a(Jao,"FromPromise");function rRt(t){return I9 in t.patternProperties?vI():x9 in t.patternProperties?r_():wie("Unknown record key pattern")}a(rRt,"RecordKey");function nRt(t){return I9 in t.patternProperties?t.patternProperties[I9]:x9 in t.patternProperties?t.patternProperties[x9]:wie("Unable to get record value schema")}a(nRt,"RecordValue");function II(t,e){let[r,n]=[rRt(e),nRt(e)];return nt.IsLiteralString(t)&&nt.IsNumber(r)&&TI(Vc(t,n))===Rt.True?Rt.True:nt.IsUint8Array(t)&&nt.IsNumber(r)||nt.IsString(t)&&nt.IsNumber(r)||nt.IsArray(t)&&nt.IsNumber(r)?Vc(t,n):nt.IsObject(t)?(()=>{for(let o of Object.getOwnPropertyNames(t.properties))if(vjr(n,t.properties[o])===Rt.False)return Rt.False;return Rt.True})():Rt.False}a(II,"FromRecordRight");function Zao(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?Vc(nRt(t),nRt(e)):Rt.False}a(Zao,"FromRecord");function Xao(t,e){let r=nt.IsRegExp(t)?r_():t,n=nt.IsRegExp(e)?r_():e;return Vc(r,n)}a(Xao,"FromRegExp");function Cjr(t,e){return nt.IsLiteral(t)&&Ey.IsString(t.const)||nt.IsString(t)?Rt.True:Rt.False}a(Cjr,"FromStringRight");function eco(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsString(e)?Rt.True:Rt.False}a(eco,"FromString");function tco(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsSymbol(e)?Rt.True:Rt.False}a(tco,"FromSymbol");function rco(t,e){return nt.IsTemplateLiteral(t)?Vc(qV(t),e):nt.IsTemplateLiteral(e)?Vc(t,qV(e)):wie("Invalid fallthrough for TemplateLiteral")}a(rco,"FromTemplateLiteral");function nco(t,e){return nt.IsArray(e)&&t.items!==void 0&&t.items.every(r=>Vc(r,e.items)===Rt.True)}a(nco,"IsArrayOfTuple");function ico(t,e){return nt.IsNever(t)?Rt.True:nt.IsUnknown(t)?Rt.False:nt.IsAny(t)?Rt.Union:Rt.False}a(ico,"FromTupleRight");function oco(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)&&y6e(e)||nt.IsArray(e)&&nco(t,e)?Rt.True:nt.IsTuple(e)?Ey.IsUndefined(t.items)&&!Ey.IsUndefined(e.items)||!Ey.IsUndefined(t.items)&&Ey.IsUndefined(e.items)?Rt.False:Ey.IsUndefined(t.items)&&!Ey.IsUndefined(e.items)||t.items.every((r,n)=>Vc(r,e.items[n])===Rt.True)?Rt.True:Rt.False:Rt.False}a(oco,"FromTuple");function sco(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsUint8Array(e)?Rt.True:Rt.False}a(sco,"FromUint8Array");function aco(t,e){return gh(e)?Ah(t,e):nt.IsObject(e)?Cy(t,e):nt.IsRecord(e)?II(t,e):nt.IsVoid(e)?uco(t,e):nt.IsUndefined(e)?Rt.True:Rt.False}a(aco,"FromUndefined");function oRt(t,e){return e.anyOf.some(r=>Vc(t,r)===Rt.True)?Rt.True:Rt.False}a(oRt,"FromUnionRight");function cco(t,e){return t.anyOf.every(r=>Vc(r,e)===Rt.True)?Rt.True:Rt.False}a(cco,"FromUnion");function bjr(t,e){return Rt.True}a(bjr,"FromUnknownRight");function lco(t,e){return nt.IsNever(e)?Ejr(t,e):nt.IsIntersect(e)?A6e(t,e):nt.IsUnion(e)?oRt(t,e):nt.IsAny(e)?iRt(t,e):nt.IsString(e)?Cjr(t,e):nt.IsNumber(e)?_jr(t,e):nt.IsInteger(e)?yjr(t,e):nt.IsBoolean(e)?Ajr(t,e):nt.IsArray(e)?wao(t,e):nt.IsTuple(e)?ico(t,e):nt.IsObject(e)?Cy(t,e):nt.IsUnknown(e)?Rt.True:Rt.False}a(lco,"FromUnknown");function uco(t,e){return nt.IsUndefined(t)||nt.IsUndefined(t)?Rt.True:Rt.False}a(uco,"FromVoidRight");function dco(t,e){return nt.IsIntersect(e)?A6e(t,e):nt.IsUnion(e)?oRt(t,e):nt.IsUnknown(e)?bjr(t,e):nt.IsAny(e)?iRt(t,e):nt.IsObject(e)?Cy(t,e):nt.IsVoid(e)?Rt.True:Rt.False}a(dco,"FromVoid");function Vc(t,e){return nt.IsTemplateLiteral(t)||nt.IsTemplateLiteral(e)?rco(t,e):nt.IsRegExp(t)||nt.IsRegExp(e)?Xao(t,e):nt.IsNot(t)||nt.IsNot(e)?qao(t,e):nt.IsAny(t)?xao(t,e):nt.IsArray(t)?Rao(t,e):nt.IsBigInt(t)?kao(t,e):nt.IsBoolean(t)?Dao(t,e):nt.IsAsyncIterator(t)?Pao(t,e):nt.IsConstructor(t)?Nao(t,e):nt.IsDate(t)?Mao(t,e):nt.IsFunction(t)?Oao(t,e):nt.IsInteger(t)?Bao(t,e):nt.IsIntersect(t)?Lao(t,e):nt.IsIterator(t)?Fao(t,e):nt.IsLiteral(t)?Uao(t,e):nt.IsNever(t)?Qao(t,e):nt.IsNull(t)?jao(t,e):nt.IsNumber(t)?Hao(t,e):nt.IsObject(t)?Kao(t,e):nt.IsRecord(t)?Zao(t,e):nt.IsString(t)?eco(t,e):nt.IsSymbol(t)?tco(t,e):nt.IsTuple(t)?oco(t,e):nt.IsPromise(t)?Jao(t,e):nt.IsUint8Array(t)?sco(t,e):nt.IsUndefined(t)?aco(t,e):nt.IsUnion(t)?cco(t,e):nt.IsUnknown(t)?lco(t,e):nt.IsVoid(t)?dco(t,e):wie(`Unknown left type operand '${t[Tt]}'`)}a(Vc,"Visit");function P9(t,e){return Vc(t,e)}a(P9,"ExtendsCheck");p();p();p();function fco(t,e,r,n,o){let s={};for(let c of globalThis.Object.getOwnPropertyNames(t))s[c]=Rie(t[c],e,r,n,Pu(o));return s}a(fco,"FromProperties");function pco(t,e,r,n,o){return fco(t.properties,e,r,n,o)}a(pco,"FromMappedResult");function Sjr(t,e,r,n,o){let s=pco(t,e,r,n,o);return Ba(s)}a(Sjr,"ExtendsFromMappedResult");function hco(t,e,r,n){let o=P9(t,e);return o===Rt.Union?Za([r,n]):o===Rt.True?r:n}a(hco,"ExtendsResolve");function Rie(t,e,r,n,o){return Du(t)?Sjr(t,e,r,n,o):E1(t)?wt(Tjr(t,e,r,n,o)):wt(hco(t,e,r,n),o)}a(Rie,"Extends");function mco(t,e,r,n,o){return{[t]:Rie(ra(t),e,r,n,Pu(o))}}a(mco,"FromPropertyKey");function gco(t,e,r,n,o){return t.reduce((s,c)=>({...s,...mco(c,e,r,n,o)}),{})}a(gco,"FromPropertyKeys");function Aco(t,e,r,n,o){return gco(t.keys,e,r,n,o)}a(Aco,"FromMappedKey");function Tjr(t,e,r,n,o){let s=Aco(t,e,r,n,o);return Ba(s)}a(Tjr,"ExtendsFromMappedKey");p();function yco(t){return t.allOf.every(e=>RB(e))}a(yco,"Intersect");function Eco(t){return t.anyOf.some(e=>RB(e))}a(Eco,"Union");function _co(t){return!RB(t.not)}a(_co,"Not");function RB(t){return t[Tt]==="Intersect"?yco(t):t[Tt]==="Union"?Eco(t):t[Tt]==="Not"?_co(t):t[Tt]==="Undefined"}a(RB,"ExtendsUndefinedCheck");p();function Ijr(t,e){return Pie(qV(t),e)}a(Ijr,"ExcludeFromTemplateLiteral");function vco(t,e){let r=t.filter(n=>P9(n,e)===Rt.False);return r.length===1?r[0]:Za(r)}a(vco,"ExcludeRest");function Pie(t,e,r={}){return _1(t)?wt(Ijr(t,e),r):Du(t)?wt(xjr(t,e),r):wt(_a(t)?vco(t.anyOf,e):P9(t,e)!==Rt.False?Wo():t,r)}a(Pie,"Exclude");function Cco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Pie(t[n],e);return r}a(Cco,"FromProperties");function bco(t,e){return Cco(t.properties,e)}a(bco,"FromMappedResult");function xjr(t,e){let r=bco(t,e);return Ba(r)}a(xjr,"ExcludeFromMappedResult");p();p();p();function wjr(t,e){return kie(qV(t),e)}a(wjr,"ExtractFromTemplateLiteral");function Sco(t,e){let r=t.filter(n=>P9(n,e)!==Rt.False);return r.length===1?r[0]:Za(r)}a(Sco,"ExtractRest");function kie(t,e,r){return _1(t)?wt(wjr(t,e),r):Du(t)?wt(Rjr(t,e),r):wt(_a(t)?Sco(t.anyOf,e):P9(t,e)!==Rt.False?t:Wo(),r)}a(kie,"Extract");function Tco(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=kie(t[n],e);return r}a(Tco,"FromProperties");function Ico(t,e){return Tco(t.properties,e)}a(Ico,"FromMappedResult");function Rjr(t,e){let r=Ico(t,e);return Ba(r)}a(Rjr,"ExtractFromMappedResult");p();function Pjr(t,e){return aP(t)?wt(t.returns,e):Wo(e)}a(Pjr,"InstanceType");p();p();function E6e(t){return Gv(_y(t))}a(E6e,"ReadonlyOptional");p();function jV(t,e,r){return wt({[Tt]:"Record",type:"object",patternProperties:{[t]:e}},r)}a(jV,"RecordCreateFromPattern");function sRt(t,e,r){let n={};for(let o of t)n[o]=e;return Xa(n,{...r,[_I]:"Record"})}a(sRt,"RecordCreateFromKeys");function xco(t,e,r){return o6e(t)?sRt(Hv(t),e,r):jV(t.pattern,e,r)}a(xco,"FromTemplateLiteralKey");function wco(t,e,r){return sRt(Hv(Za(t)),e,r)}a(wco,"FromUnionKey");function Rco(t,e,r){return sRt([t.toString()],e,r)}a(Rco,"FromLiteralKey");function Pco(t,e,r){return jV(t.source,e,r)}a(Pco,"FromRegExpKey");function kco(t,e,r){let n=wp(t.pattern)?x9:t.pattern;return jV(n,e,r)}a(kco,"FromStringKey");function Dco(t,e,r){return jV(x9,e,r)}a(Dco,"FromAnyKey");function Nco(t,e,r){return jV(Uqr,e,r)}a(Nco,"FromNeverKey");function Mco(t,e,r){return Xa({true:e,false:e},r)}a(Mco,"FromBooleanKey");function Oco(t,e,r){return jV(I9,e,r)}a(Oco,"FromIntegerKey");function Bco(t,e,r){return jV(I9,e,r)}a(Bco,"FromNumberKey");function _6e(t,e,r={}){return _a(t)?wco(t.anyOf,e,r):_1(t)?xco(t,e,r):y1(t)?Rco(t.const,e,r):bB(t)?Mco(t,e,r):lP(t)?Oco(t,e,r):uP(t)?Bco(t,e,r):Uwt(t)?Pco(t,e,r):SB(t)?kco(t,e,r):Lwt(t)?Dco(t,e,r):S9(t)?Nco(t,e,r):Wo(r)}a(_6e,"Record");function v6e(t){return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]}a(v6e,"RecordPattern");function kjr(t){let e=v6e(t);return e===x9?r_():e===I9?vI():r_({pattern:e})}a(kjr,"RecordKey");function C6e(t){return t.patternProperties[v6e(t)]}a(C6e,"RecordValue");function Lco(t,e){return e.parameters=pve(t,e.parameters),e.returns=pP(t,e.returns),e}a(Lco,"FromConstructor");function Fco(t,e){return e.parameters=pve(t,e.parameters),e.returns=pP(t,e.returns),e}a(Fco,"FromFunction");function Uco(t,e){return e.allOf=pve(t,e.allOf),e}a(Uco,"FromIntersect");function Qco(t,e){return e.anyOf=pve(t,e.anyOf),e}a(Qco,"FromUnion");function qco(t,e){return wp(e.items)||(e.items=pve(t,e.items)),e}a(qco,"FromTuple");function jco(t,e){return e.items=pP(t,e.items),e}a(jco,"FromArray");function Hco(t,e){return e.items=pP(t,e.items),e}a(Hco,"FromAsyncIterator");function Gco(t,e){return e.items=pP(t,e.items),e}a(Gco,"FromIterator");function $co(t,e){return e.item=pP(t,e.item),e}a($co,"FromPromise");function Vco(t,e){let r=Kco(t,e.properties);return{...e,...Xa(r)}}a(Vco,"FromObject");function Wco(t,e){let r=pP(t,kjr(e)),n=pP(t,C6e(e)),o=_6e(r,n);return{...e,...o}}a(Wco,"FromRecord");function zco(t,e){return e.index in t?t[e.index]:fP()}a(zco,"FromArgument");function Yco(t,e){let r=mie(e),n=jv(e),o=pP(t,e);return r&&n?E6e(o):r&&!n?Gv(o):!r&&n?_y(o):o}a(Yco,"FromProperty");function Kco(t,e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:Yco(t,e[n])}),{})}a(Kco,"FromProperties");function pve(t,e){return e.map(r=>pP(t,r))}a(pve,"FromTypes");function pP(t,e){return aP(e)?Lco(t,e):cP(e)?Fco(t,e):Kd(e)?Uco(t,e):_a(e)?Qco(t,e):v1(e)?qco(t,e):oP(e)?jco(t,e):OV(e)?Hco(t,e):LV(e)?Gco(t,e):FV(e)?$co(t,e):Rp(e)?Vco(t,e):UV(e)?Wco(t,e):Fwt(e)?zco(t,e):e}a(pP,"FromType");function Djr(t,e){return pP(e,pie(t))}a(Djr,"Instantiate");p();function Njr(t){return wt({[Tt]:"Integer",type:"integer"},t)}a(Njr,"Integer");p();p();p();function Jco(t,e,r){return{[t]:hP(ra(t),e,Pu(r))}}a(Jco,"MappedIntrinsicPropertyKey");function Zco(t,e,r){return t.reduce((o,s)=>({...o,...Jco(s,e,r)}),{})}a(Zco,"MappedIntrinsicPropertyKeys");function Xco(t,e,r){return Zco(t.keys,e,r)}a(Xco,"MappedIntrinsicProperties");function Mjr(t,e,r){let n=Xco(t,e,r);return Ba(n)}a(Mjr,"IntrinsicFromMappedKey");function elo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toLowerCase(),r].join("")}a(elo,"ApplyUncapitalize");function tlo(t){let[e,r]=[t.slice(0,1),t.slice(1)];return[e.toUpperCase(),r].join("")}a(tlo,"ApplyCapitalize");function rlo(t){return t.toUpperCase()}a(rlo,"ApplyUppercase");function nlo(t){return t.toLowerCase()}a(nlo,"ApplyLowercase");function ilo(t,e,r){let n=Cie(t.pattern);if(!QV(n))return{...t,pattern:Ojr(t.pattern,e)};let c=[...lve(n)].map(d=>ra(d)),l=Bjr(c,e),u=Za(l);return a6e([u],r)}a(ilo,"FromTemplateLiteral");function Ojr(t,e){return typeof t=="string"?e==="Uncapitalize"?elo(t):e==="Capitalize"?tlo(t):e==="Uppercase"?rlo(t):e==="Lowercase"?nlo(t):t:t.toString()}a(Ojr,"FromLiteralValue");function Bjr(t,e){return t.map(r=>hP(r,e))}a(Bjr,"FromRest");function hP(t,e,r={}){return E1(t)?Mjr(t,e,r):_1(t)?ilo(t,e,r):_a(t)?Za(Bjr(t.anyOf,e),r):y1(t)?ra(Ojr(t.const,e),r):wt(t,r)}a(hP,"Intrinsic");function Ljr(t,e={}){return hP(t,"Capitalize",e)}a(Ljr,"Capitalize");p();function Fjr(t,e={}){return hP(t,"Lowercase",e)}a(Fjr,"Lowercase");p();function Ujr(t,e={}){return hP(t,"Uncapitalize",e)}a(Ujr,"Uncapitalize");p();function Qjr(t,e={}){return hP(t,"Uppercase",e)}a(Qjr,"Uppercase");p();p();p();p();p();function olo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=k9(t[o],e,Pu(r));return n}a(olo,"FromProperties");function slo(t,e,r){return olo(t.properties,e,r)}a(slo,"FromMappedResult");function qjr(t,e,r){let n=slo(t,e,r);return Ba(n)}a(qjr,"OmitFromMappedResult");function alo(t,e){return t.map(r=>aRt(r,e))}a(alo,"FromIntersect");function clo(t,e){return t.map(r=>aRt(r,e))}a(clo,"FromUnion");function llo(t,e){let{[e]:r,...n}=t;return n}a(llo,"FromProperty");function ulo(t,e){return e.reduce((r,n)=>llo(r,n),t)}a(ulo,"FromProperties");function dlo(t,e,r){let n=Jd(t,[vd,"$id","required","properties"]),o=ulo(r,e);return Xa(o,n)}a(dlo,"FromObject");function flo(t){let e=t.reduce((r,n)=>r6e(n)?[...r,ra(n)]:r,[]);return Za(e)}a(flo,"UnionFromPropertyKeys");function aRt(t,e){return Kd(t)?vy(alo(t.allOf,e)):_a(t)?Za(clo(t.anyOf,e)):Rp(t)?dlo(t,e,t.properties):Xa({})}a(aRt,"OmitResolve");function k9(t,e,r){let n=xp(e)?flo(e):e,o=Cd(e)?Hv(e):e,s=Of(t),c=Of(e);return Du(t)?qjr(t,o,r):E1(e)?jjr(t,e,r):s&&c?Zl("Omit",[t,n],r):!s&&c?Zl("Omit",[t,n],r):s&&!c?Zl("Omit",[t,n],r):wt({...aRt(t,o),...r})}a(k9,"Omit");function plo(t,e,r){return{[e]:k9(t,[e],Pu(r))}}a(plo,"FromPropertyKey");function hlo(t,e,r){return e.reduce((n,o)=>({...n,...plo(t,o,r)}),{})}a(hlo,"FromPropertyKeys");function mlo(t,e,r){return hlo(t,e.keys,r)}a(mlo,"FromMappedKey");function jjr(t,e,r){let n=mlo(t,e,r);return Ba(n)}a(jjr,"OmitFromMappedKey");p();p();p();function glo(t,e,r){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=D9(t[o],e,Pu(r));return n}a(glo,"FromProperties");function Alo(t,e,r){return glo(t.properties,e,r)}a(Alo,"FromMappedResult");function Hjr(t,e,r){let n=Alo(t,e,r);return Ba(n)}a(Hjr,"PickFromMappedResult");function ylo(t,e){return t.map(r=>cRt(r,e))}a(ylo,"FromIntersect");function Elo(t,e){return t.map(r=>cRt(r,e))}a(Elo,"FromUnion");function _lo(t,e){let r={};for(let n of e)n in t&&(r[n]=t[n]);return r}a(_lo,"FromProperties");function vlo(t,e,r){let n=Jd(t,[vd,"$id","required","properties"]),o=_lo(r,e);return Xa(o,n)}a(vlo,"FromObject");function Clo(t){let e=t.reduce((r,n)=>r6e(n)?[...r,ra(n)]:r,[]);return Za(e)}a(Clo,"UnionFromPropertyKeys");function cRt(t,e){return Kd(t)?vy(ylo(t.allOf,e)):_a(t)?Za(Elo(t.anyOf,e)):Rp(t)?vlo(t,e,t.properties):Xa({})}a(cRt,"PickResolve");function D9(t,e,r){let n=xp(e)?Clo(e):e,o=Cd(e)?Hv(e):e,s=Of(t),c=Of(e);return Du(t)?Hjr(t,o,r):E1(e)?Gjr(t,e,r):s&&c?Zl("Pick",[t,n],r):!s&&c?Zl("Pick",[t,n],r):s&&!c?Zl("Pick",[t,n],r):wt({...cRt(t,o),...r})}a(D9,"Pick");function blo(t,e,r){return{[e]:D9(t,[e],Pu(r))}}a(blo,"FromPropertyKey");function Slo(t,e,r){return e.reduce((n,o)=>({...n,...blo(t,o,r)}),{})}a(Slo,"FromPropertyKeys");function Tlo(t,e,r){return Slo(t,e.keys,r)}a(Tlo,"FromMappedKey");function Gjr(t,e,r){let n=Tlo(t,e,r);return Ba(n)}a(Gjr,"PickFromMappedKey");p();p();function Ilo(t,e){return Zl("Partial",[Zl(t,e)])}a(Ilo,"FromComputed");function xlo(t){return Zl("Partial",[SI(t)])}a(xlo,"FromRef");function wlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=_y(t[r]);return e}a(wlo,"FromProperties");function Rlo(t,e){let r=Jd(t,[vd,"$id","required","properties"]),n=wlo(e);return Xa(n,r)}a(Rlo,"FromObject");function $jr(t){return t.map(e=>Vjr(e))}a($jr,"FromRest");function Vjr(t){return sP(t)?Ilo(t.target,t.parameters):Of(t)?xlo(t.$ref):Kd(t)?vy($jr(t.allOf)):_a(t)?Za($jr(t.anyOf)):Rp(t)?Rlo(t,t.properties):BV(t)||bB(t)||lP(t)||y1(t)||rve(t)||uP(t)||SB(t)||nve(t)||TB(t)?t:Xa({})}a(Vjr,"PartialResolve");function Die(t,e){return Du(t)?Wjr(t,e):wt({...Vjr(t),...e})}a(Die,"Partial");function Plo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Die(t[n],Pu(e));return r}a(Plo,"FromProperties");function klo(t,e){return Plo(t.properties,e)}a(klo,"FromMappedResult");function Wjr(t,e){let r=klo(t,e);return Ba(r)}a(Wjr,"PartialFromMappedResult");p();p();function Dlo(t,e){return Zl("Required",[Zl(t,e)])}a(Dlo,"FromComputed");function Nlo(t){return Zl("Required",[SI(t)])}a(Nlo,"FromRef");function Mlo(t){let e={};for(let r of globalThis.Object.getOwnPropertyNames(t))e[r]=Jd(t[r],[Yg]);return e}a(Mlo,"FromProperties");function Olo(t,e){let r=Jd(t,[vd,"$id","required","properties"]),n=Mlo(e);return Xa(n,r)}a(Olo,"FromObject");function zjr(t){return t.map(e=>Yjr(e))}a(zjr,"FromRest");function Yjr(t){return sP(t)?Dlo(t.target,t.parameters):Of(t)?Nlo(t.$ref):Kd(t)?vy(zjr(t.allOf)):_a(t)?Za(zjr(t.anyOf)):Rp(t)?Olo(t,t.properties):BV(t)||bB(t)||lP(t)||y1(t)||rve(t)||uP(t)||SB(t)||nve(t)||TB(t)?t:Xa({})}a(Yjr,"RequiredResolve");function Nie(t,e){return Du(t)?Kjr(t,e):wt({...Yjr(t),...e})}a(Nie,"Required");function Blo(t,e){let r={};for(let n of globalThis.Object.getOwnPropertyNames(t))r[n]=Nie(t[n],e);return r}a(Blo,"FromProperties");function Llo(t,e){return Blo(t.properties,e)}a(Llo,"FromMappedResult");function Kjr(t,e){let r=Llo(t,e);return Ba(r)}a(Kjr,"RequiredFromMappedResult");function Flo(t,e){return e.map(r=>Of(r)?lRt(t,r.$ref):C1(t,r))}a(Flo,"DereferenceParameters");function lRt(t,e){return e in t?Of(t[e])?lRt(t,t[e].$ref):C1(t,t[e]):Wo()}a(lRt,"Dereference");function Ulo(t){return Iie(t[0])}a(Ulo,"FromAwaited");function Qlo(t){return R9(t[0],t[1])}a(Qlo,"FromIndex");function qlo(t){return xie(t[0])}a(qlo,"FromKeyOf");function jlo(t){return Die(t[0])}a(jlo,"FromPartial");function Hlo(t){return k9(t[0],t[1])}a(Hlo,"FromOmit");function Glo(t){return D9(t[0],t[1])}a(Glo,"FromPick");function $lo(t){return Nie(t[0])}a($lo,"FromRequired");function Vlo(t,e,r){let n=Flo(t,r);return e==="Awaited"?Ulo(n):e==="Index"?Qlo(n):e==="KeyOf"?qlo(n):e==="Partial"?jlo(n):e==="Omit"?Hlo(n):e==="Pick"?Glo(n):e==="Required"?$lo(n):Wo()}a(Vlo,"FromComputed");function Wlo(t,e){return yie(C1(t,e))}a(Wlo,"FromArray");function zlo(t,e){return Eie(C1(t,e))}a(zlo,"FromAsyncIterator");function Ylo(t,e,r){return _ie(hve(t,e),C1(t,r))}a(Ylo,"FromConstructor");function Klo(t,e,r){return CN(hve(t,e),C1(t,r))}a(Klo,"FromFunction");function Jlo(t,e){return vy(hve(t,e))}a(Jlo,"FromIntersect");function Zlo(t,e){return Tie(C1(t,e))}a(Zlo,"FromIterator");function Xlo(t,e){return Xa(globalThis.Object.keys(e).reduce((r,n)=>({...r,[n]:C1(t,e[n])}),{}))}a(Xlo,"FromObject");function euo(t,e){let[r,n]=[C1(t,C6e(e)),v6e(e)],o=pie(e);return o.patternProperties[n]=r,o}a(euo,"FromRecord");function tuo(t,e){return Of(e)?{...lRt(t,e.$ref),[vd]:e[vd]}:e}a(tuo,"FromTransform");function ruo(t,e){return CI(hve(t,e))}a(ruo,"FromTuple");function nuo(t,e){return Za(hve(t,e))}a(nuo,"FromUnion");function hve(t,e){return e.map(r=>C1(t,r))}a(hve,"FromTypes");function C1(t,e){return jv(e)?wt(C1(t,Jd(e,[Yg])),e):mie(e)?wt(C1(t,Jd(e,[iP])),e):Ja(e)?wt(tuo(t,e),e):oP(e)?wt(Wlo(t,e.items),e):OV(e)?wt(zlo(t,e.items),e):sP(e)?wt(Vlo(t,e.target,e.parameters)):aP(e)?wt(Ylo(t,e.parameters,e.returns),e):cP(e)?wt(Klo(t,e.parameters,e.returns),e):Kd(e)?wt(Jlo(t,e.allOf),e):LV(e)?wt(Zlo(t,e.items),e):Rp(e)?wt(Xlo(t,e.properties),e):UV(e)?wt(euo(t,e)):v1(e)?wt(ruo(t,e.items||[]),e):_a(e)?wt(nuo(t,e.anyOf),e):e}a(C1,"FromType");function iuo(t,e){return e in t?C1(t,t[e]):Wo()}a(iuo,"ComputeType");function Jjr(t){return globalThis.Object.getOwnPropertyNames(t).reduce((e,r)=>({...e,[r]:iuo(t,r)}),{})}a(Jjr,"ComputeModuleProperties");var uRt=class{static{a(this,"TModule")}constructor(e){let r=Jjr(e),n=this.WithIdentifiers(r);this.$defs=n}Import(e,r){let n={...this.$defs,[e]:wt(this.$defs[e],r)};return wt({[Tt]:"Import",$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((r,n)=>({...r,[n]:{...e[n],$id:n}}),{})}};function Zjr(t){return new uRt(t)}a(Zjr,"Module");p();function Xjr(t,e){return wt({[Tt]:"Not",not:t},e)}a(Xjr,"Not");p();function eHr(t,e){return cP(t)?CI(t.parameters,e):Wo()}a(eHr,"Parameters");p();var ouo=0;function tHr(t,e={}){wp(e.$id)&&(e.$id=`T${ouo++}`);let r=pie(t({[Tt]:"This",$ref:`${e.$id}`}));return r.$id=e.$id,wt({[_I]:"Recursive",...r},e)}a(tHr,"Recursive");p();function rHr(t,e){let r=Nl(t)?new globalThis.RegExp(t):t;return wt({[Tt]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},e)}a(rHr,"RegExp");p();function suo(t){return Kd(t)?t.allOf:_a(t)?t.anyOf:v1(t)?t.items??[]:[]}a(suo,"RestResolve");function nHr(t){return suo(t)}a(nHr,"Rest");p();function iHr(t,e){return cP(t)?wt(t.returns,e):Wo(e)}a(iHr,"ReturnType");p();var dRt=class{static{a(this,"TransformDecodeBuilder")}constructor(e){this.schema=e}Decode(e){return new fRt(this.schema,e)}},fRt=class{static{a(this,"TransformEncodeBuilder")}constructor(e,r){this.schema=e,this.decode=r}EncodeTransform(e,r){let s={Encode:a(c=>r[vd].Encode(e(c)),"Encode"),Decode:a(c=>this.decode(r[vd].Decode(c)),"Decode")};return{...r,[vd]:s}}EncodeSchema(e,r){let n={Decode:this.decode,Encode:e};return{...r,[vd]:n}}Encode(e){return Ja(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function oHr(t){return new dRt(t)}a(oHr,"Transform");p();function sHr(t={}){return wt({[Tt]:t[Tt]??"Unsafe"},t)}a(sHr,"Unsafe");p();function aHr(t){return wt({[Tt]:"Void",type:"void"},t)}a(aHr,"Void");p();var pRt={};xi(pRt,{Any:()=>w9,Argument:()=>Gqr,Array:()=>yie,AsyncIterator:()=>Eie,Awaited:()=>Iie,BigInt:()=>Sie,Boolean:()=>s6e,Capitalize:()=>Ljr,Composite:()=>ljr,Const:()=>ujr,Constructor:()=>_ie,ConstructorParameters:()=>djr,Date:()=>d6e,Enum:()=>fjr,Exclude:()=>Pie,Extends:()=>Rie,Extract:()=>kie,Function:()=>CN,Index:()=>R9,InstanceType:()=>Pjr,Instantiate:()=>Djr,Integer:()=>Njr,Intersect:()=>vy,Iterator:()=>Tie,KeyOf:()=>xie,Literal:()=>ra,Lowercase:()=>Fjr,Mapped:()=>njr,Module:()=>Zjr,Never:()=>Wo,Not:()=>Xjr,Null:()=>f6e,Number:()=>vI,Object:()=>Xa,Omit:()=>k9,Optional:()=>_y,Parameters:()=>eHr,Partial:()=>Die,Pick:()=>D9,Promise:()=>l6e,Readonly:()=>Gv,ReadonlyOptional:()=>E6e,Record:()=>_6e,Recursive:()=>tHr,Ref:()=>SI,RegExp:()=>rHr,Required:()=>Nie,Rest:()=>nHr,ReturnType:()=>iHr,String:()=>r_,Symbol:()=>p6e,TemplateLiteral:()=>a6e,Transform:()=>oHr,Tuple:()=>CI,Uint8Array:()=>m6e,Uncapitalize:()=>Ujr,Undefined:()=>h6e,Union:()=>Za,Unknown:()=>fP,Unsafe:()=>sHr,Uppercase:()=>Qjr,Void:()=>aHr});p();var S=pRt;p();p();function auo(t){switch(t.errorType){case St.ArrayContains:return"Expected array to contain at least one matching value";case St.ArrayMaxContains:return`Expected array to contain no more than ${t.schema.maxContains} matching values`;case St.ArrayMinContains:return`Expected array to contain at least ${t.schema.minContains} matching values`;case St.ArrayMaxItems:return`Expected array length to be less or equal to ${t.schema.maxItems}`;case St.ArrayMinItems:return`Expected array length to be greater or equal to ${t.schema.minItems}`;case St.ArrayUniqueItems:return"Expected array elements to be unique";case St.Array:return"Expected array";case St.AsyncIterator:return"Expected AsyncIterator";case St.BigIntExclusiveMaximum:return`Expected bigint to be less than ${t.schema.exclusiveMaximum}`;case St.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${t.schema.exclusiveMinimum}`;case St.BigIntMaximum:return`Expected bigint to be less or equal to ${t.schema.maximum}`;case St.BigIntMinimum:return`Expected bigint to be greater or equal to ${t.schema.minimum}`;case St.BigIntMultipleOf:return`Expected bigint to be a multiple of ${t.schema.multipleOf}`;case St.BigInt:return"Expected bigint";case St.Boolean:return"Expected boolean";case St.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`;case St.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`;case St.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`;case St.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`;case St.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`;case St.Date:return"Expected Date";case St.Function:return"Expected function";case St.IntegerExclusiveMaximum:return`Expected integer to be less than ${t.schema.exclusiveMaximum}`;case St.IntegerExclusiveMinimum:return`Expected integer to be greater than ${t.schema.exclusiveMinimum}`;case St.IntegerMaximum:return`Expected integer to be less or equal to ${t.schema.maximum}`;case St.IntegerMinimum:return`Expected integer to be greater or equal to ${t.schema.minimum}`;case St.IntegerMultipleOf:return`Expected integer to be a multiple of ${t.schema.multipleOf}`;case St.Integer:return"Expected integer";case St.IntersectUnevaluatedProperties:return"Unexpected property";case St.Intersect:return"Expected all values to match";case St.Iterator:return"Expected Iterator";case St.Literal:return`Expected ${typeof t.schema.const=="string"?`'${t.schema.const}'`:t.schema.const}`;case St.Never:return"Never";case St.Not:return"Value should not match";case St.Null:return"Expected null";case St.NumberExclusiveMaximum:return`Expected number to be less than ${t.schema.exclusiveMaximum}`;case St.NumberExclusiveMinimum:return`Expected number to be greater than ${t.schema.exclusiveMinimum}`;case St.NumberMaximum:return`Expected number to be less or equal to ${t.schema.maximum}`;case St.NumberMinimum:return`Expected number to be greater or equal to ${t.schema.minimum}`;case St.NumberMultipleOf:return`Expected number to be a multiple of ${t.schema.multipleOf}`;case St.Number:return"Expected number";case St.Object:return"Expected object";case St.ObjectAdditionalProperties:return"Unexpected property";case St.ObjectMaxProperties:return`Expected object to have no more than ${t.schema.maxProperties} properties`;case St.ObjectMinProperties:return`Expected object to have at least ${t.schema.minProperties} properties`;case St.ObjectRequiredProperty:return"Expected required property";case St.Promise:return"Expected Promise";case St.RegExp:return"Expected string to match regular expression";case St.StringFormatUnknown:return`Unknown format '${t.schema.format}'`;case St.StringFormat:return`Expected string to match '${t.schema.format}' format`;case St.StringMaxLength:return`Expected string length less or equal to ${t.schema.maxLength}`;case St.StringMinLength:return`Expected string length greater or equal to ${t.schema.minLength}`;case St.StringPattern:return`Expected string to match '${t.schema.pattern}'`;case St.String:return"Expected string";case St.Symbol:return"Expected symbol";case St.TupleLength:return`Expected tuple to have ${t.schema.maxItems||0} elements`;case St.Tuple:return"Expected tuple";case St.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${t.schema.maxByteLength}`;case St.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${t.schema.minByteLength}`;case St.Uint8Array:return"Expected Uint8Array";case St.Undefined:return"Expected undefined";case St.Union:return"Expected union value";case St.Void:return"Expected void";case St.Kind:return`Expected kind '${t.schema[Tt]}'`;default:return"Unknown error type"}}a(auo,"DefaultErrorFunction");var cuo=auo;function cHr(){return cuo}a(cHr,"GetErrorFunction");p();var hRt=class extends Qi{static{a(this,"TypeDereferenceError")}constructor(e){super(`Unable to dereference schema with $id '${e.$ref}'`),this.schema=e}};function luo(t,e){let r=e.find(n=>n.$id===t.$ref);if(r===void 0)throw new hRt(t);return va(r,e)}a(luo,"Resolve");function Mm(t,e){return!Ea(t.$id)||e.some(r=>r.$id===t.$id)||e.push(t),e}a(Mm,"Pushref");function va(t,e){return t[Tt]==="This"||t[Tt]==="Ref"?luo(t,e):t}a(va,"Deref");p();var mRt=class extends Qi{static{a(this,"ValueHashError")}constructor(e){super("Unable to hash value"),this.value=e}},b1;(function(t){t[t.Undefined=0]="Undefined",t[t.Null=1]="Null",t[t.Boolean=2]="Boolean",t[t.Number=3]="Number",t[t.String=4]="String",t[t.Object=5]="Object",t[t.Array=6]="Array",t[t.Date=7]="Date",t[t.Uint8Array=8]="Uint8Array",t[t.Symbol=9]="Symbol",t[t.BigInt=10]="BigInt"})(b1||(b1={}));var Mie=BigInt("14695981039346656037"),[uuo,duo]=[BigInt("1099511628211"),BigInt("18446744073709551616")],fuo=Array.from({length:256}).map((t,e)=>BigInt(e)),lHr=new Float64Array(1),uHr=new DataView(lHr.buffer),dHr=new Uint8Array(lHr.buffer);function*puo(t){let e=t===0?1:Math.ceil(Math.floor(Math.log2(t)+1)/8);for(let r=0;r>8*(e-1-r)&255}a(puo,"NumberToBytes");function huo(t){by(b1.Array);for(let e of t)Oie(e)}a(huo,"ArrayType");function muo(t){by(b1.Boolean),by(t?1:0)}a(muo,"BooleanType");function guo(t){by(b1.BigInt),uHr.setBigInt64(0,t);for(let e of dHr)by(e)}a(guo,"BigIntType");function Auo(t){by(b1.Date),Oie(t.getTime())}a(Auo,"DateType");function yuo(t){by(b1.Null)}a(yuo,"NullType");function Euo(t){by(b1.Number),uHr.setFloat64(0,t);for(let e of dHr)by(e)}a(Euo,"NumberType");function _uo(t){by(b1.Object);for(let e of globalThis.Object.getOwnPropertyNames(t).sort())Oie(e),Oie(t[e])}a(_uo,"ObjectType");function vuo(t){by(b1.String);for(let e=0;e=t.minItems)||qs(t.maxItems)&&!(r.length<=t.maxItems))return!1;for(let s of r)if(!Om(t.items,e,s))return!1;if(t.uniqueItems===!0&&!(function(){let s=new Set;for(let c of r){let l=N9(c);if(s.has(l))return!1;s.add(l)}return!0})())return!1;if(!(qs(t.contains)||oi(t.minContains)||oi(t.maxContains)))return!0;let n=qs(t.contains)?t.contains:Wo(),o=r.reduce((s,c)=>Om(n,e,c)?s+1:s,0);return!(o===0||oi(t.minContains)&&ot.maxContains)}a(wuo,"FromArray");function Ruo(t,e,r){return Z8e(r)}a(Ruo,"FromAsyncIterator");function Puo(t,e,r){return!(!zg(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.multipleOf)&&r%t.multipleOf!==BigInt(0))}a(Puo,"FromBigInt");function kuo(t,e,r){return vN(r)}a(kuo,"FromBoolean");function Duo(t,e,r){return Om(t.returns,e,r.prototype)}a(Duo,"FromConstructor");function Nuo(t,e,r){return!(!e_(r)||qs(t.exclusiveMaximumTimestamp)&&!(r.getTime()t.exclusiveMinimumTimestamp)||qs(t.maximumTimestamp)&&!(r.getTime()<=t.maximumTimestamp)||qs(t.minimumTimestamp)&&!(r.getTime()>=t.minimumTimestamp)||qs(t.multipleOfTimestamp)&&r.getTime()%t.multipleOfTimestamp!==0)}a(Nuo,"FromDate");function Muo(t,e,r){return b9(r)}a(Muo,"FromFunction");function Ouo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Om(o,[...e,...n],r)}a(Ouo,"FromImport");function Buo(t,e,r){return!(!t6e(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.multipleOf)&&r%t.multipleOf!==0)}a(Buo,"FromInteger");function Luo(t,e,r){let n=t.allOf.every(o=>Om(o,e,r));if(t.unevaluatedProperties===!1){let o=new RegExp(wB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c));return n&&s}else if(Cd(t.unevaluatedProperties)){let o=new RegExp(wB(t)),s=Object.getOwnPropertyNames(r).every(c=>o.test(c)||Om(t.unevaluatedProperties,e,r[c]));return n&&s}else return n}a(Luo,"FromIntersect");function Fuo(t,e,r){return X8e(r)}a(Fuo,"FromIterator");function Uuo(t,e,r){return r===t.const}a(Uuo,"FromLiteral");function Quo(t,e,r){return!1}a(Quo,"FromNever");function quo(t,e,r){return!Om(t.not,e,r)}a(quo,"FromNot");function juo(t,e,r){return vB(r)}a(juo,"FromNull");function Huo(t,e,r){return!(!Jl.IsNumberLike(r)||qs(t.exclusiveMaximum)&&!(rt.exclusiveMinimum)||qs(t.minimum)&&!(r>=t.minimum)||qs(t.maximum)&&!(r<=t.maximum)||qs(t.multipleOf)&&r%t.multipleOf!==0)}a(Huo,"FromNumber");function Guo(t,e,r){if(!Jl.IsObjectLike(r)||qs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||qs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let n=Object.getOwnPropertyNames(t.properties);for(let o of n){let s=t.properties[o];if(t.required&&t.required.includes(o)){if(!Om(s,e,r[o])||(RB(s)||Tuo(s))&&!(o in r))return!1}else if(Jl.IsExactOptionalProperty(r,o)&&!Om(s,e,r[o]))return!1}if(t.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return t.required&&t.required.length===n.length&&o.length===n.length?!0:o.every(s=>n.includes(s))}else return typeof t.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(s=>n.includes(s)||Om(t.additionalProperties,e,r[s])):!0}a(Guo,"FromObject");function $uo(t,e,r){return e6e(r)}a($uo,"FromPromise");function Vuo(t,e,r){if(!Jl.IsRecordLike(r)||qs(t.minProperties)&&!(Object.getOwnPropertyNames(r).length>=t.minProperties)||qs(t.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=t.maxProperties))return!1;let[n,o]=Object.entries(t.patternProperties)[0],s=new RegExp(n),c=Object.entries(r).every(([d,f])=>s.test(d)?Om(o,e,f):!0),l=typeof t.additionalProperties=="object"?Object.entries(r).every(([d,f])=>s.test(d)?!0:Om(t.additionalProperties,e,f)):!0,u=t.additionalProperties===!1?Object.getOwnPropertyNames(r).every(d=>s.test(d)):!0;return c&&l&&u}a(Vuo,"FromRecord");function Wuo(t,e,r){return Om(va(t,e),e,r)}a(Wuo,"FromRef");function zuo(t,e,r){let n=new RegExp(t.source,t.flags);return qs(t.minLength)&&!(r.length>=t.minLength)||qs(t.maxLength)&&!(r.length<=t.maxLength)?!1:n.test(r)}a(zuo,"FromRegExp");function Yuo(t,e,r){return!Ea(r)||qs(t.minLength)&&!(r.length>=t.minLength)||qs(t.maxLength)&&!(r.length<=t.maxLength)||qs(t.pattern)&&!new RegExp(t.pattern).test(r)?!1:qs(t.format)?dP.Has(t.format)?dP.Get(t.format)(r):!1:!0}a(Yuo,"FromString");function Kuo(t,e,r){return CB(r)}a(Kuo,"FromSymbol");function Juo(t,e,r){return Ea(r)&&new RegExp(t.pattern).test(r)}a(Juo,"FromTemplateLiteral");function Zuo(t,e,r){return Om(va(t,e),e,r)}a(Zuo,"FromThis");function Xuo(t,e,r){if(!wi(r)||t.items===void 0&&r.length!==0||r.length!==t.maxItems)return!1;if(!t.items)return!0;for(let n=0;nOm(n,e,r))}a(tdo,"FromUnion");function rdo(t,e,r){return!(!hie(r)||qs(t.maxByteLength)&&!(r.length<=t.maxByteLength)||qs(t.minByteLength)&&!(r.length>=t.minByteLength))}a(rdo,"FromUint8Array");function ndo(t,e,r){return!0}a(ndo,"FromUnknown");function ido(t,e,r){return Jl.IsVoidLike(r)}a(ido,"FromVoid");function odo(t,e,r){return t_.Has(t[Tt])?t_.Get(t[Tt])(t,r):!1}a(odo,"FromKind");function Om(t,e,r){let n=qs(t.$id)?Mm(t,e):e,o=t;switch(o[Tt]){case"Any":return Iuo(o,n,r);case"Argument":return xuo(o,n,r);case"Array":return wuo(o,n,r);case"AsyncIterator":return Ruo(o,n,r);case"BigInt":return Puo(o,n,r);case"Boolean":return kuo(o,n,r);case"Constructor":return Duo(o,n,r);case"Date":return Nuo(o,n,r);case"Function":return Muo(o,n,r);case"Import":return Ouo(o,n,r);case"Integer":return Buo(o,n,r);case"Intersect":return Luo(o,n,r);case"Iterator":return Fuo(o,n,r);case"Literal":return Uuo(o,n,r);case"Never":return Quo(o,n,r);case"Not":return quo(o,n,r);case"Null":return juo(o,n,r);case"Number":return Huo(o,n,r);case"Object":return Guo(o,n,r);case"Promise":return $uo(o,n,r);case"Record":return Vuo(o,n,r);case"Ref":return Wuo(o,n,r);case"RegExp":return zuo(o,n,r);case"String":return Yuo(o,n,r);case"Symbol":return Kuo(o,n,r);case"TemplateLiteral":return Juo(o,n,r);case"This":return Zuo(o,n,r);case"Tuple":return Xuo(o,n,r);case"Undefined":return edo(o,n,r);case"Union":return tdo(o,n,r);case"Uint8Array":return rdo(o,n,r);case"Unknown":return ndo(o,n,r);case"Void":return ido(o,n,r);default:if(!t_.Has(o[Tt]))throw new gRt(o);return odo(o,n,r)}}a(Om,"Visit");function zo(...t){return t.length===3?Om(t[0],t[1],t[2]):Om(t[0],[],t[1])}a(zo,"Check");var St;(function(t){t[t.ArrayContains=0]="ArrayContains",t[t.ArrayMaxContains=1]="ArrayMaxContains",t[t.ArrayMaxItems=2]="ArrayMaxItems",t[t.ArrayMinContains=3]="ArrayMinContains",t[t.ArrayMinItems=4]="ArrayMinItems",t[t.ArrayUniqueItems=5]="ArrayUniqueItems",t[t.Array=6]="Array",t[t.AsyncIterator=7]="AsyncIterator",t[t.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",t[t.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",t[t.BigIntMaximum=10]="BigIntMaximum",t[t.BigIntMinimum=11]="BigIntMinimum",t[t.BigIntMultipleOf=12]="BigIntMultipleOf",t[t.BigInt=13]="BigInt",t[t.Boolean=14]="Boolean",t[t.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",t[t.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",t[t.DateMaximumTimestamp=17]="DateMaximumTimestamp",t[t.DateMinimumTimestamp=18]="DateMinimumTimestamp",t[t.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",t[t.Date=20]="Date",t[t.Function=21]="Function",t[t.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",t[t.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",t[t.IntegerMaximum=24]="IntegerMaximum",t[t.IntegerMinimum=25]="IntegerMinimum",t[t.IntegerMultipleOf=26]="IntegerMultipleOf",t[t.Integer=27]="Integer",t[t.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",t[t.Intersect=29]="Intersect",t[t.Iterator=30]="Iterator",t[t.Kind=31]="Kind",t[t.Literal=32]="Literal",t[t.Never=33]="Never",t[t.Not=34]="Not",t[t.Null=35]="Null",t[t.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",t[t.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",t[t.NumberMaximum=38]="NumberMaximum",t[t.NumberMinimum=39]="NumberMinimum",t[t.NumberMultipleOf=40]="NumberMultipleOf",t[t.Number=41]="Number",t[t.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",t[t.ObjectMaxProperties=43]="ObjectMaxProperties",t[t.ObjectMinProperties=44]="ObjectMinProperties",t[t.ObjectRequiredProperty=45]="ObjectRequiredProperty",t[t.Object=46]="Object",t[t.Promise=47]="Promise",t[t.RegExp=48]="RegExp",t[t.StringFormatUnknown=49]="StringFormatUnknown",t[t.StringFormat=50]="StringFormat",t[t.StringMaxLength=51]="StringMaxLength",t[t.StringMinLength=52]="StringMinLength",t[t.StringPattern=53]="StringPattern",t[t.String=54]="String",t[t.Symbol=55]="Symbol",t[t.TupleLength=56]="TupleLength",t[t.Tuple=57]="Tuple",t[t.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",t[t.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",t[t.Uint8Array=60]="Uint8Array",t[t.Undefined=61]="Undefined",t[t.Union=62]="Union",t[t.Void=63]="Void"})(St||(St={}));var ARt=class extends Qi{static{a(this,"ValueErrorsUnknownTypeError")}constructor(e){super("Unknown type"),this.schema=e}};function PB(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}a(PB,"EscapeKey");function js(t){return t!==void 0}a(js,"IsDefined");var M9=class{static{a(this,"ValueErrorIterator")}constructor(e){this.iterator=e}[Symbol.iterator](){return this.iterator}First(){let e=this.iterator.next();return e.done?void 0:e.value}};function nn(t,e,r,n,o=[]){return{type:t,schema:e,path:r,value:n,message:cHr()({errorType:t,path:r,schema:e,value:n,errors:o}),errors:o}}a(nn,"Create");function*sdo(t,e,r,n){}a(sdo,"FromAny");function*ado(t,e,r,n){}a(ado,"FromArgument");function*cdo(t,e,r,n){if(!wi(n))return yield nn(St.Array,t,r,n);js(t.minItems)&&!(n.length>=t.minItems)&&(yield nn(St.ArrayMinItems,t,r,n)),js(t.maxItems)&&!(n.length<=t.maxItems)&&(yield nn(St.ArrayMaxItems,t,r,n));for(let c=0;cBm(o,e,`${r}${u}`,l).next().done===!0?c+1:c,0);s===0&&(yield nn(St.ArrayContains,t,r,n)),oi(t.minContains)&&st.maxContains&&(yield nn(St.ArrayMaxContains,t,r,n))}a(cdo,"FromArray");function*ldo(t,e,r,n){Z8e(n)||(yield nn(St.AsyncIterator,t,r,n))}a(ldo,"FromAsyncIterator");function*udo(t,e,r,n){if(!zg(n))return yield nn(St.BigInt,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.BigIntExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.BigIntMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.BigIntMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==BigInt(0)&&(yield nn(St.BigIntMultipleOf,t,r,n))}a(udo,"FromBigInt");function*ddo(t,e,r,n){vN(n)||(yield nn(St.Boolean,t,r,n))}a(ddo,"FromBoolean");function*fdo(t,e,r,n){yield*Bm(t.returns,e,r,n.prototype)}a(fdo,"FromConstructor");function*pdo(t,e,r,n){if(!e_(n))return yield nn(St.Date,t,r,n);js(t.exclusiveMaximumTimestamp)&&!(n.getTime()t.exclusiveMinimumTimestamp)&&(yield nn(St.DateExclusiveMinimumTimestamp,t,r,n)),js(t.maximumTimestamp)&&!(n.getTime()<=t.maximumTimestamp)&&(yield nn(St.DateMaximumTimestamp,t,r,n)),js(t.minimumTimestamp)&&!(n.getTime()>=t.minimumTimestamp)&&(yield nn(St.DateMinimumTimestamp,t,r,n)),js(t.multipleOfTimestamp)&&n.getTime()%t.multipleOfTimestamp!==0&&(yield nn(St.DateMultipleOfTimestamp,t,r,n))}a(pdo,"FromDate");function*hdo(t,e,r,n){b9(n)||(yield nn(St.Function,t,r,n))}a(hdo,"FromFunction");function*mdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref];yield*Bm(s,[...e,...o],r,n)}a(mdo,"FromImport");function*gdo(t,e,r,n){if(!t6e(n))return yield nn(St.Integer,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.IntegerExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.IntegerMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.IntegerMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==0&&(yield nn(St.IntegerMultipleOf,t,r,n))}a(gdo,"FromInteger");function*Ado(t,e,r,n){let o=!1;for(let s of t.allOf)for(let c of Bm(s,e,r,n))o=!0,yield c;if(o)return yield nn(St.Intersect,t,r,n);if(t.unevaluatedProperties===!1){let s=new RegExp(wB(t));for(let c of Object.getOwnPropertyNames(n))s.test(c)||(yield nn(St.IntersectUnevaluatedProperties,t,`${r}/${c}`,n))}if(typeof t.unevaluatedProperties=="object"){let s=new RegExp(wB(t));for(let c of Object.getOwnPropertyNames(n))if(!s.test(c)){let l=Bm(t.unevaluatedProperties,e,`${r}/${c}`,n[c]).next();l.done||(yield l.value)}}}a(Ado,"FromIntersect");function*ydo(t,e,r,n){X8e(n)||(yield nn(St.Iterator,t,r,n))}a(ydo,"FromIterator");function*Edo(t,e,r,n){n!==t.const&&(yield nn(St.Literal,t,r,n))}a(Edo,"FromLiteral");function*_do(t,e,r,n){yield nn(St.Never,t,r,n)}a(_do,"FromNever");function*vdo(t,e,r,n){Bm(t.not,e,r,n).next().done===!0&&(yield nn(St.Not,t,r,n))}a(vdo,"FromNot");function*Cdo(t,e,r,n){vB(n)||(yield nn(St.Null,t,r,n))}a(Cdo,"FromNull");function*bdo(t,e,r,n){if(!Jl.IsNumberLike(n))return yield nn(St.Number,t,r,n);js(t.exclusiveMaximum)&&!(nt.exclusiveMinimum)&&(yield nn(St.NumberExclusiveMinimum,t,r,n)),js(t.maximum)&&!(n<=t.maximum)&&(yield nn(St.NumberMaximum,t,r,n)),js(t.minimum)&&!(n>=t.minimum)&&(yield nn(St.NumberMinimum,t,r,n)),js(t.multipleOf)&&n%t.multipleOf!==0&&(yield nn(St.NumberMultipleOf,t,r,n))}a(bdo,"FromNumber");function*Sdo(t,e,r,n){if(!Jl.IsObjectLike(n))return yield nn(St.Object,t,r,n);js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield nn(St.ObjectMinProperties,t,r,n)),js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield nn(St.ObjectMaxProperties,t,r,n));let o=Array.isArray(t.required)?t.required:[],s=Object.getOwnPropertyNames(t.properties),c=Object.getOwnPropertyNames(n);for(let l of o)c.includes(l)||(yield nn(St.ObjectRequiredProperty,t.properties[l],`${r}/${PB(l)}`,void 0));if(t.additionalProperties===!1)for(let l of c)s.includes(l)||(yield nn(St.ObjectAdditionalProperties,t,`${r}/${PB(l)}`,n[l]));if(typeof t.additionalProperties=="object")for(let l of c)s.includes(l)||(yield*Bm(t.additionalProperties,e,`${r}/${PB(l)}`,n[l]));for(let l of s){let u=t.properties[l];t.required&&t.required.includes(l)?(yield*Bm(u,e,`${r}/${PB(l)}`,n[l]),RB(t)&&!(l in n)&&(yield nn(St.ObjectRequiredProperty,u,`${r}/${PB(l)}`,void 0))):Jl.IsExactOptionalProperty(n,l)&&(yield*Bm(u,e,`${r}/${PB(l)}`,n[l]))}}a(Sdo,"FromObject");function*Tdo(t,e,r,n){e6e(n)||(yield nn(St.Promise,t,r,n))}a(Tdo,"FromPromise");function*Ido(t,e,r,n){if(!Jl.IsRecordLike(n))return yield nn(St.Object,t,r,n);js(t.minProperties)&&!(Object.getOwnPropertyNames(n).length>=t.minProperties)&&(yield nn(St.ObjectMinProperties,t,r,n)),js(t.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=t.maxProperties)&&(yield nn(St.ObjectMaxProperties,t,r,n));let[o,s]=Object.entries(t.patternProperties)[0],c=new RegExp(o);for(let[l,u]of Object.entries(n))c.test(l)&&(yield*Bm(s,e,`${r}/${PB(l)}`,u));if(typeof t.additionalProperties=="object")for(let[l,u]of Object.entries(n))c.test(l)||(yield*Bm(t.additionalProperties,e,`${r}/${PB(l)}`,u));if(t.additionalProperties===!1){for(let[l,u]of Object.entries(n))if(!c.test(l))return yield nn(St.ObjectAdditionalProperties,t,`${r}/${PB(l)}`,u)}}a(Ido,"FromRecord");function*xdo(t,e,r,n){yield*Bm(va(t,e),e,r,n)}a(xdo,"FromRef");function*wdo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);if(js(t.minLength)&&!(n.length>=t.minLength)&&(yield nn(St.StringMinLength,t,r,n)),js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield nn(St.StringMaxLength,t,r,n)),!new RegExp(t.source,t.flags).test(n))return yield nn(St.RegExp,t,r,n)}a(wdo,"FromRegExp");function*Rdo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);js(t.minLength)&&!(n.length>=t.minLength)&&(yield nn(St.StringMinLength,t,r,n)),js(t.maxLength)&&!(n.length<=t.maxLength)&&(yield nn(St.StringMaxLength,t,r,n)),Ea(t.pattern)&&(new RegExp(t.pattern).test(n)||(yield nn(St.StringPattern,t,r,n))),Ea(t.format)&&(dP.Has(t.format)?dP.Get(t.format)(n)||(yield nn(St.StringFormat,t,r,n)):yield nn(St.StringFormatUnknown,t,r,n))}a(Rdo,"FromString");function*Pdo(t,e,r,n){CB(n)||(yield nn(St.Symbol,t,r,n))}a(Pdo,"FromSymbol");function*kdo(t,e,r,n){if(!Ea(n))return yield nn(St.String,t,r,n);new RegExp(t.pattern).test(n)||(yield nn(St.StringPattern,t,r,n))}a(kdo,"FromTemplateLiteral");function*Ddo(t,e,r,n){yield*Bm(va(t,e),e,r,n)}a(Ddo,"FromThis");function*Ndo(t,e,r,n){if(!wi(n))return yield nn(St.Tuple,t,r,n);if(t.items===void 0&&n.length!==0)return yield nn(St.TupleLength,t,r,n);if(n.length!==t.maxItems)return yield nn(St.TupleLength,t,r,n);if(t.items)for(let o=0;onew M9(Bm(s,e,r,n)));yield nn(St.Union,t,r,n,o)}a(Odo,"FromUnion");function*Bdo(t,e,r,n){if(!hie(n))return yield nn(St.Uint8Array,t,r,n);js(t.maxByteLength)&&!(n.length<=t.maxByteLength)&&(yield nn(St.Uint8ArrayMaxByteLength,t,r,n)),js(t.minByteLength)&&!(n.length>=t.minByteLength)&&(yield nn(St.Uint8ArrayMinByteLength,t,r,n))}a(Bdo,"FromUint8Array");function*Ldo(t,e,r,n){}a(Ldo,"FromUnknown");function*Fdo(t,e,r,n){Jl.IsVoidLike(n)||(yield nn(St.Void,t,r,n))}a(Fdo,"FromVoid");function*Udo(t,e,r,n){t_.Get(t[Tt])(t,n)||(yield nn(St.Kind,t,r,n))}a(Udo,"FromKind");function*Bm(t,e,r,n){let o=js(t.$id)?[...e,t]:e,s=t;switch(s[Tt]){case"Any":return yield*sdo(s,o,r,n);case"Argument":return yield*ado(s,o,r,n);case"Array":return yield*cdo(s,o,r,n);case"AsyncIterator":return yield*ldo(s,o,r,n);case"BigInt":return yield*udo(s,o,r,n);case"Boolean":return yield*ddo(s,o,r,n);case"Constructor":return yield*fdo(s,o,r,n);case"Date":return yield*pdo(s,o,r,n);case"Function":return yield*hdo(s,o,r,n);case"Import":return yield*mdo(s,o,r,n);case"Integer":return yield*gdo(s,o,r,n);case"Intersect":return yield*Ado(s,o,r,n);case"Iterator":return yield*ydo(s,o,r,n);case"Literal":return yield*Edo(s,o,r,n);case"Never":return yield*_do(s,o,r,n);case"Not":return yield*vdo(s,o,r,n);case"Null":return yield*Cdo(s,o,r,n);case"Number":return yield*bdo(s,o,r,n);case"Object":return yield*Sdo(s,o,r,n);case"Promise":return yield*Tdo(s,o,r,n);case"Record":return yield*Ido(s,o,r,n);case"Ref":return yield*xdo(s,o,r,n);case"RegExp":return yield*wdo(s,o,r,n);case"String":return yield*Rdo(s,o,r,n);case"Symbol":return yield*Pdo(s,o,r,n);case"TemplateLiteral":return yield*kdo(s,o,r,n);case"This":return yield*Ddo(s,o,r,n);case"Tuple":return yield*Ndo(s,o,r,n);case"Undefined":return yield*Mdo(s,o,r,n);case"Union":return yield*Odo(s,o,r,n);case"Uint8Array":return yield*Bdo(s,o,r,n);case"Unknown":return yield*Ldo(s,o,r,n);case"Void":return yield*Fdo(s,o,r,n);default:if(!t_.Has(s[Tt]))throw new ARt(t);return yield*Udo(s,o,r,n)}}a(Bm,"Visit");function SN(...t){let e=t.length===3?Bm(t[0],t[1],"",t[2]):Bm(t[0],[],"",t[1]);return new M9(e)}a(SN,"Errors");p();p();var Bie=class extends Qi{static{a(this,"TransformDecodeCheckError")}constructor(e,r,n){super("Unable to decode value as it does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},yRt=class extends Qi{static{a(this,"TransformDecodeError")}constructor(e,r,n,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=e,this.path=r,this.value=n,this.error=o}};function bd(t,e,r){try{return Ja(t)?t[vd].Decode(r):r}catch(n){throw new yRt(t,e,r,n)}}a(bd,"Default");function Qdo(t,e,r,n){return wi(n)?bd(t,r,n.map((o,s)=>mP(t.items,e,`${r}/${s}`,o))):bd(t,r,n)}a(Qdo,"FromArray");function qdo(t,e,r,n){if(!bo(n)||A1(n))return bd(t,r,n);let o=u6e(t),s=o.map(f=>f[0]),c={...n};for(let[f,h]of o)f in c&&(c[f]=mP(h,e,`${r}/${f}`,c[f]));if(!Ja(t.unevaluatedProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.unevaluatedProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a(qdo,"FromIntersect");function jdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=mP(s,[...e,...o],r,n);return bd(t,r,c)}a(jdo,"FromImport");function Hdo(t,e,r,n){return bd(t,r,mP(t.not,e,r,n))}a(Hdo,"FromNot");function Gdo(t,e,r,n){if(!bo(n))return bd(t,r,n);let o=$v(t),s={...n};for(let d of o)Ui(s,d)&&(ku(s[d])&&(!TB(t.properties[d])||Jl.IsExactOptionalProperty(s,d))||(s[d]=mP(t.properties[d],e,`${r}/${d}`,s[d])));if(!Cd(t.additionalProperties))return bd(t,r,s);let c=Object.getOwnPropertyNames(s),l=t.additionalProperties,u={...s};for(let d of c)o.includes(d)||(u[d]=bd(l,`${r}/${d}`,u[d]));return bd(t,r,u)}a(Gdo,"FromObject");function $do(t,e,r,n){if(!bo(n))return bd(t,r,n);let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=new RegExp(o),c={...n};for(let f of Object.getOwnPropertyNames(n))s.test(f)&&(c[f]=mP(t.patternProperties[o],e,`${r}/${f}`,c[f]));if(!Cd(t.additionalProperties))return bd(t,r,c);let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.test(f)||(d[f]=bd(u,`${r}/${f}`,d[f]));return bd(t,r,d)}a($do,"FromRecord");function Vdo(t,e,r,n){let o=va(t,e);return bd(t,r,mP(o,e,r,n))}a(Vdo,"FromRef");function Wdo(t,e,r,n){let o=va(t,e);return bd(t,r,mP(o,e,r,n))}a(Wdo,"FromThis");function zdo(t,e,r,n){return wi(n)&&wi(t.items)?bd(t,r,t.items.map((o,s)=>mP(o,e,`${r}/${s}`,n[s]))):bd(t,r,n)}a(zdo,"FromTuple");function Ydo(t,e,r,n){for(let o of t.anyOf){if(!zo(o,e,n))continue;let s=mP(o,e,r,n);return bd(t,r,s)}return bd(t,r,n)}a(Ydo,"FromUnion");function mP(t,e,r,n){let o=Mm(t,e),s=t;switch(t[Tt]){case"Array":return Qdo(s,o,r,n);case"Import":return jdo(s,o,r,n);case"Intersect":return qdo(s,o,r,n);case"Not":return Hdo(s,o,r,n);case"Object":return Gdo(s,o,r,n);case"Record":return $do(s,o,r,n);case"Ref":return Vdo(s,o,r,n);case"Symbol":return bd(s,r,n);case"This":return Wdo(s,o,r,n);case"Tuple":return zdo(s,o,r,n);case"Union":return Ydo(s,o,r,n);default:return bd(s,r,n)}}a(mP,"Visit");function Lie(t,e,r){return mP(t,e,"",r)}a(Lie,"TransformDecode");p();var Fie=class extends Qi{static{a(this,"TransformEncodeCheckError")}constructor(e,r,n){super("The encoded value does not match the expected schema"),this.schema=e,this.value=r,this.error=n}},ERt=class extends Qi{static{a(this,"TransformEncodeError")}constructor(e,r,n,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=e,this.path=r,this.value=n,this.error=o}};function Kg(t,e,r){try{return Ja(t)?t[vd].Encode(r):r}catch(n){throw new ERt(t,e,r,n)}}a(Kg,"Default");function Kdo(t,e,r,n){let o=Kg(t,r,n);return wi(o)?o.map((s,c)=>gP(t.items,e,`${r}/${c}`,s)):o}a(Kdo,"FromArray");function Jdo(t,e,r,n){let o=globalThis.Object.values(t.$defs),s=t.$defs[t.$ref],c=Kg(t,r,n);return gP(s,[...e,...o],r,c)}a(Jdo,"FromImport");function Zdo(t,e,r,n){let o=Kg(t,r,n);if(!bo(n)||A1(n))return o;let s=u6e(t),c=s.map(h=>h[0]),l={...o};for(let[h,m]of s)h in l&&(l[h]=gP(m,e,`${r}/${h}`,l[h]));if(!Ja(t.unevaluatedProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.unevaluatedProperties,f={...l};for(let h of u)c.includes(h)||(f[h]=Kg(d,`${r}/${h}`,f[h]));return f}a(Zdo,"FromIntersect");function Xdo(t,e,r,n){return Kg(t.not,r,Kg(t,r,n))}a(Xdo,"FromNot");function efo(t,e,r,n){let o=Kg(t,r,n);if(!bo(o))return o;let s=$v(t),c={...o};for(let f of s)Ui(c,f)&&(ku(c[f])&&(!TB(t.properties[f])||Jl.IsExactOptionalProperty(c,f))||(c[f]=gP(t.properties[f],e,`${r}/${f}`,c[f])));if(!Cd(t.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),u=t.additionalProperties,d={...c};for(let f of l)s.includes(f)||(d[f]=Kg(u,`${r}/${f}`,d[f]));return d}a(efo,"FromObject");function tfo(t,e,r,n){let o=Kg(t,r,n);if(!bo(n))return o;let s=Object.getOwnPropertyNames(t.patternProperties)[0],c=new RegExp(s),l={...o};for(let h of Object.getOwnPropertyNames(n))c.test(h)&&(l[h]=gP(t.patternProperties[s],e,`${r}/${h}`,l[h]));if(!Cd(t.additionalProperties))return l;let u=Object.getOwnPropertyNames(l),d=t.additionalProperties,f={...l};for(let h of u)c.test(h)||(f[h]=Kg(d,`${r}/${h}`,f[h]));return f}a(tfo,"FromRecord");function rfo(t,e,r,n){let o=va(t,e),s=gP(o,e,r,n);return Kg(t,r,s)}a(rfo,"FromRef");function nfo(t,e,r,n){let o=va(t,e),s=gP(o,e,r,n);return Kg(t,r,s)}a(nfo,"FromThis");function ifo(t,e,r,n){let o=Kg(t,r,n);return wi(t.items)?t.items.map((s,c)=>gP(s,e,`${r}/${c}`,o[c])):[]}a(ifo,"FromTuple");function ofo(t,e,r,n){for(let o of t.anyOf){if(!zo(o,e,n))continue;let s=gP(o,e,r,n);return Kg(t,r,s)}for(let o of t.anyOf){let s=gP(o,e,r,n);if(zo(t,e,s))return Kg(t,r,s)}return Kg(t,r,n)}a(ofo,"FromUnion");function gP(t,e,r,n){let o=Mm(t,e),s=t;switch(t[Tt]){case"Array":return Kdo(s,o,r,n);case"Import":return Jdo(s,o,r,n);case"Intersect":return Zdo(s,o,r,n);case"Not":return Xdo(s,o,r,n);case"Object":return efo(s,o,r,n);case"Record":return tfo(s,o,r,n);case"Ref":return rfo(s,o,r,n);case"This":return nfo(s,o,r,n);case"Tuple":return ifo(s,o,r,n);case"Union":return ofo(s,o,r,n);default:return Kg(s,r,n)}}a(gP,"Visit");function Uie(t,e,r){return gP(t,e,"",r)}a(Uie,"TransformEncode");p();function sfo(t,e){return Ja(t)||P0(t.items,e)}a(sfo,"FromArray");function afo(t,e){return Ja(t)||P0(t.items,e)}a(afo,"FromAsyncIterator");function cfo(t,e){return Ja(t)||P0(t.returns,e)||t.parameters.some(r=>P0(r,e))}a(cfo,"FromConstructor");function lfo(t,e){return Ja(t)||P0(t.returns,e)||t.parameters.some(r=>P0(r,e))}a(lfo,"FromFunction");function ufo(t,e){return Ja(t)||Ja(t.unevaluatedProperties)||t.allOf.some(r=>P0(r,e))}a(ufo,"FromIntersect");function dfo(t,e){let r=globalThis.Object.getOwnPropertyNames(t.$defs).reduce((o,s)=>[...o,t.$defs[s]],[]),n=t.$defs[t.$ref];return Ja(t)||P0(n,[...r,...e])}a(dfo,"FromImport");function ffo(t,e){return Ja(t)||P0(t.items,e)}a(ffo,"FromIterator");function pfo(t,e){return Ja(t)||P0(t.not,e)}a(pfo,"FromNot");function hfo(t,e){return Ja(t)||Object.values(t.properties).some(r=>P0(r,e))||Cd(t.additionalProperties)&&P0(t.additionalProperties,e)}a(hfo,"FromObject");function mfo(t,e){return Ja(t)||P0(t.item,e)}a(mfo,"FromPromise");function gfo(t,e){let r=Object.getOwnPropertyNames(t.patternProperties)[0],n=t.patternProperties[r];return Ja(t)||P0(n,e)||Cd(t.additionalProperties)&&Ja(t.additionalProperties)}a(gfo,"FromRecord");function Afo(t,e){return Ja(t)?!0:P0(va(t,e),e)}a(Afo,"FromRef");function yfo(t,e){return Ja(t)?!0:P0(va(t,e),e)}a(yfo,"FromThis");function Efo(t,e){return Ja(t)||!ku(t.items)&&t.items.some(r=>P0(r,e))}a(Efo,"FromTuple");function _fo(t,e){return Ja(t)||t.anyOf.some(r=>P0(r,e))}a(_fo,"FromUnion");function P0(t,e){let r=Mm(t,e),n=t;if(t.$id&&_Rt.has(t.$id))return!1;switch(t.$id&&_Rt.add(t.$id),t[Tt]){case"Array":return sfo(n,r);case"AsyncIterator":return afo(n,r);case"Constructor":return cfo(n,r);case"Function":return lfo(n,r);case"Import":return dfo(n,r);case"Intersect":return ufo(n,r);case"Iterator":return ffo(n,r);case"Not":return pfo(n,r);case"Object":return hfo(n,r);case"Promise":return mfo(n,r);case"Record":return gfo(n,r);case"Ref":return Afo(n,r);case"This":return yfo(n,r);case"Tuple":return Efo(n,r);case"Union":return _fo(n,r);default:return Ja(t)}}a(P0,"Visit");var _Rt=new Set;function kB(t,e){return _Rt.clear(),P0(t,e)}a(kB,"HasTransform");var vRt=class{static{a(this,"TypeCheck")}constructor(e,r,n,o){this.schema=e,this.references=r,this.checkFunc=n,this.code=o,this.hasTransform=kB(e,r)}Code(){return this.code}Schema(){return this.schema}References(){return this.references}Errors(e){return SN(this.schema,this.references,e)}Check(e){return this.checkFunc(e)}Decode(e){if(!this.checkFunc(e))throw new Bie(this.schema,e,this.Errors(e).First());return this.hasTransform?Lie(this.schema,this.references,e):e}Encode(e){let r=this.hasTransform?Uie(this.schema,this.references,e):e;if(!this.checkFunc(r))throw new Fie(this.schema,e,this.Errors(e).First());return r}},DB;(function(t){function e(s){return s===36}a(e,"DollarSign"),t.DollarSign=e;function r(s){return s===95}a(r,"IsUnderscore"),t.IsUnderscore=r;function n(s){return s>=65&&s<=90||s>=97&&s<=122}a(n,"IsAlpha"),t.IsAlpha=n;function o(s){return s>=48&&s<=57}a(o,"IsNumeric"),t.IsNumeric=o})(DB||(DB={}));var b6e;(function(t){function e(s){return s.length===0?!1:DB.IsNumeric(s.charCodeAt(0))}a(e,"IsFirstCharacterNumeric");function r(s){if(e(s))return!1;for(let c=0;c= ${Z.minItems}`);let ue=J(Z.items,ee,"value");if(yield`((array) => { for(const ${pe} of array) if(!(${ue})) { return false }; return true; })(${K})`,Nu(Z.contains)||oi(Z.minContains)||oi(Z.maxContains)){let qe=Nu(Z.contains)?Z.contains:Wo(),ie=J(qe,ee,"value"),le=oi(Z.minContains)?[`(count >= ${Z.minContains})`]:[],Ne=oi(Z.maxContains)?[`(count <= ${Z.maxContains})`]:[],we=`const count = value.reduce((${X}, ${pe}) => ${ie} ? acc + 1 : acc, 0)`,Be=["(count > 0)",...le,...Ne].join(" && ");yield`((${pe}) => { ${we}; return ${Be}})(${K})`}Z.uniqueItems===!0&&(yield`((${pe}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${K})`)}a(o,"FromArray");function*s(Z,ee,K){yield`(typeof value === 'object' && Symbol.asyncIterator in ${K})`}a(s,"FromAsyncIterator");function*c(Z,ee,K){yield`(typeof ${K} === 'bigint')`,zg(Z.exclusiveMaximum)&&(yield`${K} < BigInt(${Z.exclusiveMaximum})`),zg(Z.exclusiveMinimum)&&(yield`${K} > BigInt(${Z.exclusiveMinimum})`),zg(Z.maximum)&&(yield`${K} <= BigInt(${Z.maximum})`),zg(Z.minimum)&&(yield`${K} >= BigInt(${Z.minimum})`),zg(Z.multipleOf)&&(yield`(${K} % BigInt(${Z.multipleOf})) === 0`)}a(c,"FromBigInt");function*l(Z,ee,K){yield`(typeof ${K} === 'boolean')`}a(l,"FromBoolean");function*u(Z,ee,K){yield*W(Z.returns,ee,`${K}.prototype`)}a(u,"FromConstructor");function*d(Z,ee,K){yield`(${K} instanceof Date) && Number.isFinite(${K}.getTime())`,oi(Z.exclusiveMaximumTimestamp)&&(yield`${K}.getTime() < ${Z.exclusiveMaximumTimestamp}`),oi(Z.exclusiveMinimumTimestamp)&&(yield`${K}.getTime() > ${Z.exclusiveMinimumTimestamp}`),oi(Z.maximumTimestamp)&&(yield`${K}.getTime() <= ${Z.maximumTimestamp}`),oi(Z.minimumTimestamp)&&(yield`${K}.getTime() >= ${Z.minimumTimestamp}`),oi(Z.multipleOfTimestamp)&&(yield`(${K}.getTime() % ${Z.multipleOfTimestamp}) === 0`)}a(d,"FromDate");function*f(Z,ee,K){yield`(typeof ${K} === 'function')`}a(f,"FromFunction");function*h(Z,ee,K){let pe=globalThis.Object.getOwnPropertyNames(Z.$defs).reduce((X,ue)=>[...X,Z.$defs[ue]],[]);yield*W(SI(Z.$ref),[...ee,...pe],K)}a(h,"FromImport");function*m(Z,ee,K){yield`Number.isInteger(${K})`,oi(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(m,"FromInteger");function*g(Z,ee,K){let pe=Z.allOf.map(X=>J(X,ee,K)).join(" && ");if(Z.unevaluatedProperties===!1){let X=H(`${new RegExp(wB(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key))`;yield`(${pe} && ${ue})`}else if(Nu(Z.unevaluatedProperties)){let X=H(`${new RegExp(wB(Z))};`),ue=`Object.getOwnPropertyNames(${K}).every(key => ${X}.test(key) || ${J(Z.unevaluatedProperties,ee,`${K}[key]`)})`;yield`(${pe} && ${ue})`}else yield`(${pe})`}a(g,"FromIntersect");function*A(Z,ee,K){yield`(typeof value === 'object' && Symbol.iterator in ${K})`}a(A,"FromIterator");function*y(Z,ee,K){typeof Z.const=="number"||typeof Z.const=="boolean"?yield`(${K} === ${Z.const})`:yield`(${K} === '${bRt.Escape(Z.const)}')`}a(y,"FromLiteral");function*E(Z,ee,K){yield"false"}a(E,"FromNever");function*_(Z,ee,K){yield`(!${J(Z.not,ee,K)})`}a(_,"FromNot");function*v(Z,ee,K){yield`(${K} === null)`}a(v,"FromNull");function*b(Z,ee,K){yield HV.IsNumberLike(K),oi(Z.exclusiveMaximum)&&(yield`${K} < ${Z.exclusiveMaximum}`),oi(Z.exclusiveMinimum)&&(yield`${K} > ${Z.exclusiveMinimum}`),oi(Z.maximum)&&(yield`${K} <= ${Z.maximum}`),oi(Z.minimum)&&(yield`${K} >= ${Z.minimum}`),oi(Z.multipleOf)&&(yield`(${K} % ${Z.multipleOf}) === 0`)}a(b,"FromNumber");function*T(Z,ee,K){yield HV.IsObjectLike(K),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let pe=Object.getOwnPropertyNames(Z.properties);for(let X of pe){let ue=b6e.Encode(K,X),qe=Z.properties[X];if(Z.required&&Z.required.includes(X))yield*W(qe,ee,ue),(RB(qe)||e(qe))&&(yield`('${X}' in ${K})`);else{let ie=J(qe,ee,ue);yield HV.IsExactOptionalProperty(K,X,ie)}}if(Z.additionalProperties===!1)if(Z.required&&Z.required.length===pe.length)yield`Object.getOwnPropertyNames(${K}).length === ${pe.length}`;else{let X=`[${pe.map(ue=>`'${ue}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${K}).every(key => ${X}.includes(key))`}if(typeof Z.additionalProperties=="object"){let X=J(Z.additionalProperties,ee,`${K}[key]`),ue=`[${pe.map(qe=>`'${qe}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${K}).every(key => ${ue}.includes(key) || ${X}))`}}a(T,"FromObject");function*w(Z,ee,K){yield`${K} instanceof Promise`}a(w,"FromPromise");function*R(Z,ee,K){yield HV.IsRecordLike(K),oi(Z.minProperties)&&(yield`Object.getOwnPropertyNames(${K}).length >= ${Z.minProperties}`),oi(Z.maxProperties)&&(yield`Object.getOwnPropertyNames(${K}).length <= ${Z.maxProperties}`);let[pe,X]=Object.entries(Z.patternProperties)[0],ue=H(`${new RegExp(pe)}`),qe=J(X,ee,"value"),ie=Nu(Z.additionalProperties)?J(Z.additionalProperties,ee,K):Z.additionalProperties===!1?"false":"true",le=`(${ue}.test(key) ? ${qe} : ${ie})`;yield`(Object.entries(${K}).every(([key, value]) => ${le}))`}a(R,"FromRecord");function*x(Z,ee,K){let pe=va(Z,ee);if($.functions.has(Z.$ref))return yield`${ne(Z.$ref)}(${K})`;yield*W(pe,ee,K)}a(x,"FromRef");function*P(Z,ee,K){let pe=H(`${new RegExp(Z.source,Z.flags)};`);yield`(typeof ${K} === 'string')`,oi(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),yield`${pe}.test(${K})`}a(P,"FromRegExp");function*D(Z,ee,K){yield`(typeof ${K} === 'string')`,oi(Z.maxLength)&&(yield`${K}.length <= ${Z.maxLength}`),oi(Z.minLength)&&(yield`${K}.length >= ${Z.minLength}`),Z.pattern!==void 0&&(yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`),Z.format!==void 0&&(yield`format('${Z.format}', ${K})`)}a(D,"FromString");function*N(Z,ee,K){yield`(typeof ${K} === 'symbol')`}a(N,"FromSymbol");function*B(Z,ee,K){yield`(typeof ${K} === 'string')`,yield`${H(`${new RegExp(Z.pattern)};`)}.test(${K})`}a(B,"FromTemplateLiteral");function*L(Z,ee,K){yield`${ne(Z.$ref)}(${K})`}a(L,"FromThis");function*j(Z,ee,K){if(yield`Array.isArray(${K})`,Z.items===void 0)return yield`${K}.length === 0`;yield`(${K}.length === ${Z.maxItems})`;for(let pe=0;peJ(X,ee,K)).join(" || ")})`}a(O,"FromUnion");function*q(Z,ee,K){yield`${K} instanceof Uint8Array`,oi(Z.maxByteLength)&&(yield`(${K}.length <= ${Z.maxByteLength})`),oi(Z.minByteLength)&&(yield`(${K}.length >= ${Z.minByteLength})`)}a(q,"FromUint8Array");function*Q(Z,ee,K){yield"true"}a(Q,"FromUnknown");function*U(Z,ee,K){yield HV.IsVoidLike(K)}a(U,"FromVoid");function*z(Z,ee,K){let pe=$.instances.size;$.instances.set(pe,Z),yield`kind('${Z[Tt]}', ${pe}, ${K})`}a(z,"FromKind");function*W(Z,ee,K,pe=!0){let X=Ea(Z.$id)?[...ee,Z]:ee,ue=Z;if(pe&&Ea(Z.$id)){let qe=ne(Z.$id);if($.functions.has(qe))return yield`${qe}(${K})`;{$.functions.set(qe,"");let ie=re(qe,Z,ee,"value",!1);return $.functions.set(qe,ie),yield`${qe}(${K})`}}switch(ue[Tt]){case"Any":return yield*r(ue,X,K);case"Argument":return yield*n(ue,X,K);case"Array":return yield*o(ue,X,K);case"AsyncIterator":return yield*s(ue,X,K);case"BigInt":return yield*c(ue,X,K);case"Boolean":return yield*l(ue,X,K);case"Constructor":return yield*u(ue,X,K);case"Date":return yield*d(ue,X,K);case"Function":return yield*f(ue,X,K);case"Import":return yield*h(ue,X,K);case"Integer":return yield*m(ue,X,K);case"Intersect":return yield*g(ue,X,K);case"Iterator":return yield*A(ue,X,K);case"Literal":return yield*y(ue,X,K);case"Never":return yield*E(ue,X,K);case"Not":return yield*_(ue,X,K);case"Null":return yield*v(ue,X,K);case"Number":return yield*b(ue,X,K);case"Object":return yield*T(ue,X,K);case"Promise":return yield*w(ue,X,K);case"Record":return yield*R(ue,X,K);case"Ref":return yield*x(ue,X,K);case"RegExp":return yield*P(ue,X,K);case"String":return yield*D(ue,X,K);case"Symbol":return yield*N(ue,X,K);case"TemplateLiteral":return yield*B(ue,X,K);case"This":return yield*L(ue,X,K);case"Tuple":return yield*j(ue,X,K);case"Undefined":return yield*M(ue,X,K);case"Union":return yield*O(ue,X,K);case"Uint8Array":return yield*q(ue,X,K);case"Unknown":return yield*Q(ue,X,K);case"Void":return yield*U(ue,X,K);default:if(!t_.Has(ue[Tt]))throw new SRt(Z);return yield*z(ue,X,K)}}a(W,"Visit");let $={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function J(Z,ee,K,pe=!0){return`(${[...W(Z,ee,K,pe)].join(" && ")})`}a(J,"CreateExpression");function ne(Z){return`check_${CRt.Encode(Z)}`}a(ne,"CreateFunctionName");function H(Z){let ee=`local_${$.variables.size}`;return $.variables.set(ee,`const ${ee} = ${Z}`),ee}a(H,"CreateVariable");function re(Z,ee,K,pe,X=!0){let[ue,qe]=[` +`,we=>"".padStart(we," ")],ie=ae("value","any"),le=Oe("boolean"),Ne=[...W(ee,K,pe,X)].map(we=>`${qe(4)}${we}`).join(` &&${ue}`);return`function ${Z}(${ie})${le} {${ue}${qe(2)}return (${ue}${Ne}${ue}${qe(2)}) +}`}a(re,"CreateFunction");function ae(Z,ee){let K=$.language==="typescript"?`: ${ee}`:"";return`${Z}${K}`}a(ae,"CreateParameter");function Oe(Z){return $.language==="typescript"?`: ${Z}`:""}a(Oe,"CreateReturns");function ve(Z,ee,K){let pe=re("check",Z,ee,"value"),X=ae("value","any"),ue=Oe("boolean"),qe=[...$.functions.values()],ie=[...$.variables.values()],le=Ea(Z.$id)?`return function check(${X})${ue} { + return ${ne(Z.$id)}(value) +}`:`return ${pe}`;return[...ie,...qe,le].join(` +`)}a(ve,"Build");function Fe(...Z){let ee={language:"javascript"},[K,pe,X]=Z.length===2&&wi(Z[1])?[Z[0],Z[1],ee]:Z.length===2&&!wi(Z[1])?[Z[0],[],Z[1]]:Z.length===3?[Z[0],Z[1],Z[2]]:Z.length===1?[Z[0],[],ee]:[null,[],ee];if($.language=X.language,$.variables.clear(),$.functions.clear(),$.instances.clear(),!Nu(K))throw new S6e(K);for(let ue of pe)if(!Nu(ue))throw new S6e(ue);return ve(K,pe,X)}a(Fe,"Code"),t.Code=Fe;function Pe(Z,ee=[]){let K=Fe(Z,ee,{language:"javascript"}),pe=globalThis.Function("kind","format","hash",K),X=new Map($.instances);function ue(Ne,we,Be){if(!t_.Has(Ne)||!X.has(we))return!1;let tt=t_.Get(Ne),st=X.get(we);return tt(st,Be)}a(ue,"typeRegistryFunction");function qe(Ne,we){return dP.Has(Ne)?dP.Get(Ne)(we):!1}a(qe,"formatRegistryFunction");function ie(Ne){return N9(Ne)}a(ie,"hashFunction");let le=pe(ue,qe,ie);return new vRt(Z,ee,le,K)}a(Pe,"Compile"),t.Compile=Pe})(Mu||(Mu={}));var u9e=fe(v9()),soe=fe(require("os"));As();var d9e=fe(ei());function ooe(t){return t===1}a(ooe,"isRestricted");var Spo=["engine.prompt","engine.completion","ghostText.capturedAfterAccepted","ghostText.capturedAfterRejected"],Tve=8192,Tpo=21;var k0=class{static{a(this,"TelemetryReporters")}getReporter(e,r=0){return ooe(r)?this.getRestrictedReporter(e):this.reporter}getRestrictedReporter(e){if(coe(e))return this.reporterRestricted;if(fie(e))return new K_e}getMsft1pReporter(){return this.reporterMsft1p}getMsftReporter(){return this.reporterMsft}getFTReporter(e){if(qVr(e))return this.reporterFT;if(fie(e))return new K_e}setReporter(e){this.reporter=e}setRestrictedReporter(e){this.reporterRestricted=e}setMsft1pReporter(e){this.reporterMsft1p=e}setMsftReporter(e){this.reporterMsft=e}setFTReporter(e){this.reporterFT=e}async deactivate(){let e=[this.reporter,this.reporterRestricted,this.reporterFT,this.reporterMsft1p,this.reporterMsft];this.reporter=this.reporterRestricted=this.reporterFT=this.reporterMsft1p=this.reporterMsft=void 0,await Promise.all(e.map(r=>r?.dispose()))}},Ipo=S.Object({},{additionalProperties:S.String()}),xpo=S.Object({meanLogProb:S.Optional(S.Number()),meanAlternativeLogProb:S.Optional(S.Number())},{additionalProperties:S.Number()}),wpo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function Rpo(t){return wpo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(Rpo,"isOomError");function Ppo(t){return kI(t)?"network":Rpo(t)||t.code==="EMFILE"||t.code==="ENFILE"||t.syscall==="uv_cwd"&&(t.code==="ENOENT"||t.code=="EIO")||t.code==="CopilotPromptLoadFailure"||`${t.code}`.startsWith("CopilotPromptWorkerExit")?"local":"exception"}a(Ppo,"getErrorType");var Vt=class t{static{a(this,"TelemetryData")}static{this.validateTelemetryProperties=Mu.Compile(Ipo)}static{this.validateTelemetryMeasurements=Mu.Compile(xpo)}static{this.keysExemptedFromSanitization=["abexp.assignmentcontext","VSCode.ABExp.Features"]}constructor(e,r,n){this.properties=e,this.measurements=r,this.issuedTime=n}static createAndMarkAsIssued(e,r){return new t(e||{},r||{},dl())}extendedBy(e,r){let n={...this.properties,...e},o={...this.measurements,...r},s=new t(n,o,this.issuedTime);return s.displayedTime=this.displayedTime,s}markAsDisplayed(){this.displayedTime===void 0&&(this.displayedTime=dl())}async extendWithExpTelemetry(e){let{filters:r,exp:n}=await e.get(Jt).getFallbackExpAndFilters();n.addToTelemetry(e,this),r.addToTelemetry(this)}extendWithCoreEditorAgnosticFields(e){this.properties.editor_version=h1(e.get(Nr).getEditorInfo()),this.properties.editor_plugin_version=h1(e.get(Nr).getEditorPluginInfo());let r=e.get(Oa);this.properties.client_machineid=r.machineId,this.properties.client_sessionid=r.sessionId,this.properties.copilot_version=`copilot/${I1(e)}`,typeof process<"u"&&(this.properties.runtime_version=`node/${process.versions.node}`)}extendWithEditorAgnosticFields(e){this.extendWithCoreEditorAgnosticFields(e);let r=e.get(Nr);this.properties.common_extname=r.getEditorPluginInfo().name,this.properties.common_extversion=r.getEditorPluginInfo().version,this.properties.common_vscodeversion=h1(r.getEditorInfo());let n=e.get(cr);this.properties.fetcher=n.name;let o=e.get(Yo).getHttpSettings();this.properties.proxy_enabled=o.proxy?"true":"false",this.properties.proxy_auth=o.proxyAuthorization?"true":"false",this.properties.proxy_kerberos_spn=o.proxyKerberosServicePrincipal?"true":"false",this.properties.reject_unauthorized=o.proxyStrictSSL!==!1?"true":"false"}extendWithConfigProperties(e){let r=WVr(e);r["copilot.build"]=zVr(e),r["copilot.buildType"]=G9(e),this.properties={...this.properties,...r}}extendWithRequestId(e){let r={headerRequestId:e.headerRequestId,serverExperiments:e.serverExperiments,deploymentId:e.deploymentId};this.properties={...this.properties,...r}}static{this.keysToRemoveFromStandardTelemetryHack=["gitRepoHost","gitRepoName","gitRepoOwner","gitRepoUrl","gitRepoPath","repo","request_option_nwo","userKind"]}static maybeRemoveRepoInfoFromPropertiesHack(e,r){if(ooe(e))return r;let n={};for(let o in r)t.keysToRemoveFromStandardTelemetryHack.includes(o)||(n[o]=r[o]);return n}sanitizeKeys(){this.properties=t.sanitizeKeys(this.properties),this.measurements=t.sanitizeKeys(this.measurements);for(let e in this.measurements)isNaN(this.measurements[e])&&delete this.measurements[e]}multiplexProperties(){this.properties=t.multiplexProperties(this.properties)}static sanitizeKeys(e){e=e||{};let r={};for(let n in e){let o=t.keysExemptedFromSanitization.includes(n)?n:n.replace(/\./g,"_");r[o]=e[n]}return r}static multiplexProperties(e){let r={...e};for(let n in e){let o=e[n],s=o?.length??0;if(s>Tve){let c=0,l=0;for(;s>0&&l1&&(u=n+"_"+(l<10?"0":"")+l);let d=c+Tve;se+r.length,0)??0),promptSuffixCharLen:t.suffix.length}}a(aoe,"telemetrizePromptLength");function dl(){return performance.now()}a(dl,"now");function Opo(t){return Math.floor(t/1e3)}a(Opo,"nowSeconds");function coe(t){return t.get(Mf).optedIn}a(coe,"shouldSendRestricted");function qVr(t){return t.get(Mf).ftFlag!==""}a(qVr,"shouldSendFinetuningTelemetry");function yt(t,e,r,n){return t.get(_d).register(Bpo(t,e,dl(),r?.extendedBy(),n))}a(yt,"telemetry");function PI(t,e,r){return t.get(_d).register(p9e(t,e,r?.extendedBy()))}a(PI,"telemetryMsft");function _t(t,e,r,n){let o=Vt.createAndMarkAsIssued(r,n);return t.get(_d).register(p9e(t,e,o))}a(_t,"telemetryMs");function f9e(t,e,r,n){let o=(n||Vt.createAndMarkAsIssued()).extendedBy(jVr(r));return t.get(_d).register(p9e(t,e,o))}a(f9e,"telemetryMsftWithError");function si(t,e,r,n,o){let s=Vt.createAndMarkAsIssued({...n,...jVr(r)},o);return t.get(_d).register(p9e(t,e,s))}a(si,"telemetryMsWithError");function jVr(t){let e={};if(t){let r=Upo(t);e.errorName=r.name,e.errorMessage=r.message,e.errorStack=r.stack??""}return e}a(jVr,"buildErrorProperties");async function Bpo(t,e,r,n,o=0){let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o??!1,"IncludeExp",r),(!ooe(o)||coe(t))&&Ive(t,o,e,s),ooe(o)&&Spo.includes(e)&&qVr(t)&&Mpo(t,o,e,s),kpo(t,e,s)}a(Bpo,"_telemetry");async function p9e(t,e,r){let n=r||Vt.createAndMarkAsIssued({},{});await n.prepareForSendingToMsft(t),Npo(t,e,n)}a(p9e,"_telemetryMsft");function o8e(t,e){return t.get(_d).register(Lpo(t,e,dl()))}a(o8e,"telemetryExpProblem");async function Lpo(t,e,r){let n="expProblem",o=Vt.createAndMarkAsIssued(e,{});await o.makeReadyForSending(t,0,"SkipExp",r),Ive(t,0,n,o)}a(Lpo,"_telemetryExpProblem");function loe(t,e,r,n,o=0){let s={...r,...HVr(t)};Ive(t,o,e,{properties:s,measurements:n})}a(loe,"telemetryRaw");function HVr(t){let e=t.get(Nr),r={unique_id:ir(),common_extname:e.getEditorPluginInfo().name,common_extversion:e.getEditorPluginInfo().version,common_vscodeversion:h1(e.getEditorInfo())};return{...t.get(Mf).getProperties(),...r}}a(HVr,"createRequiredProperties");var ZPt=class extends Error{static{a(this,"CopilotNonError")}constructor(e){let r;try{r=JSON.stringify(e)}catch{r=String(e)}super(r),this.name="CopilotNonError",this.code=(0,u9e.SHA256)(u9e.enc.Utf16.parse(this.message)).toString().slice(0,16)}};function La(t,e,r,n,o){return t.get(_d).register(GVr(t,e,dl(),r,{...n},o))}a(La,"telemetryException");async function GVr(t,e,r,n,o,s){let c;if(e instanceof Error){if(c=e,c.name==="Canceled"&&c.message==="Canceled"||c.name==="CodeExpectedError"||D0(c)||c instanceof d9e.ConnectionError||c instanceof d9e.ResponseError||c.name==="CopilotAuthError"||c.name==="DeviceFlowError")return}else{if(c=new ZPt(e),e&&typeof e=="object"&&e.name==="ExitStatus")return;if(c.stack?.startsWith(`${c} `)){let y=c.stack.slice(`${c} `.length).split(` `);/^\s*(?:at )?(?:\w+\.)*_telemetryException\b/.test(y[0]??"")&&y.shift(),/^\s*(?:at )?(?:\w+\.)*telemetryException\b/.test(y[0]??"")&&y.shift(),c.stack=`${c} ${y.join(` -`)}`}}let l=t.get(Lr).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=moe(t),f=hqr(c,u,d),h=Bpo(c),m=h==="exception",g=jt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=Uwt(y.value):y.value="[redacted]");s??=ZQr(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(bN).isThrottled(A)){if(d){let y=pqr(c,u),E=jt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,FCe(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),FCe(t,0,`error.${h}`,g)}}a(uWr,"_telemetryException");function Pm(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await uWr(t,c,pl(),r,n)}},"wrapped");return(...s)=>t.get(_d).register(o(...s))}a(Pm,"telemetryCatch");function Bm(t,e,r,n){return t.get(_d).register(Gpo(t,e,pl(),r?.extendedBy(),n))}a(Bm,"telemetryError");async function Gpo(t,e,r,n,o=0){if(foe(o)&&!moe(t))return;let s=n||jt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Fpo(t,o,e,s)}a(Gpo,"_telemetryError");function dWr(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=jt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),ht(t,"engine.completion",u,1)}a(dWr,"logEngineCompletion");function fWr(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return ht(t,"engine.prompt",o,1)}a(fWr,"logEnginePrompt");function $po(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a($po,"buildErrorFromUnknown");var XC=class t{static{a(this,"ExpConfig")}constructor(e,r,n){this.variables=e,this.assignmentContext=r,this.features=n}static createFallbackConfig(e,r){return x9e(e,{reason:r}),this.createEmptyConfig()}static createEmptyConfig(){return new t({},"","")}addToTelemetry(e,r){let o=e.get(ik).inlineCompletionsUnificationState.expAssignments.filter(c=>!this.assignmentContext.includes(c)),s=[this.assignmentContext,...o].filter(Boolean).join(";");r.properties["VSCode.ABExp.Features"]=this.features,r.properties["abexp.assignmentcontext"]=s}};p();var Vpo=new ge("expConfigManager"),Wpo=3600*1e3,PN=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt{try{let{exp:r}=await this.ctx.get(Jt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){Vpo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function gWr(t){let e=qt(t,je.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(PN).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(gWr,"resolveTransparentTokenRefresh");p();p();var w9e=class{constructor(e){this.userInfo=e}static{a(this,"CopilotUserInfoWrapper")}get sku(){return this.userInfo?.access_type_sku}get isFreeUser(){return this.sku==="free_limited_copilot"}get isIndividualUser(){return this.copilotPlan==="free"||this.copilotPlan==="individual"||this.copilotPlan==="individual_pro"||this.copilotPlan==="individual_max"}get isTBBEnabled(){return this.userInfo?.token_based_billing===!0}get copilotPlan(){if(this.isFreeUser)return"free";let e=this.userInfo?.copilot_plan;switch(e){case"individual":case"individual_pro":case"individual_max":case"business":case"enterprise":return e;default:return"individual"}}get canUpgradePlan(){return this.userInfo?.can_upgrade_plan===!0}get quotaInfo(){return{quota_snapshots:this.userInfo?.quota_snapshots,quota_reset_date:this.userInfo?.quota_reset_date}}get raw(){return this.userInfo}};p();function uPt(t){return["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","faef89d9169d5eacf1d8c8dde3412e37","4535c7beffc844b46bb1ed4aa04d759a"].find(r=>t.includes(r))}a(uPt,"findKnownOrg");function AWr(t){let e=t.organization_list??[];return uPt(e)??""}a(AWr,"getUserKind");p();p();var oW=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function P0(t){return!t||typeof t!="object"?!1:t instanceof oW||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(P0,"isAbortError");var Aoe=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},DN=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},zpo=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function OI(t,e=!0){return t instanceof Error?e&&"cause"in t&&OI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof Aoe||t instanceof DN||t?.message?.startsWith("net::")||zpo.has(t.code??""):!1}a(OI,"isNetworkError");var BI=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new Aoe(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new Aoe(`Response body truncated: actualLength=${s}`,"Truncated"):new Aoe(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function yoe(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a(yoe,"parseRetryAfterSeconds");p();function R9e(){return typeof process>"u"}a(R9e,"isWeb");function NN(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(NN,"isMsBenchModeEnabled");var dPt=class extends DN{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function Td(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...R9e()?{}:by(t),...n.headers}};let o=await t.get(ar).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new DN(o);if(!o.headers.get("x-github-request-id"))throw new dPt(o);return o}a(Td,"apiFetch");p();p();var sa=class{constructor(){this.recentNotifications=new nn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var aa=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var _Wr=require("os"),k9e=require("path");p();var yWr;(()=>{"use strict";var t={975:L=>{function B(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(B,"e");function Q(O,q){for(var F,U="",W=0,V=-1,G=0,Y=0;Y<=O.length;++Y){if(Y2){var re=U.lastIndexOf("/");if(re!==U.length-1){re===-1?(U="",W=0):W=(U=U.slice(0,re)).length-1-U.lastIndexOf("/"),V=Y,G=0;continue}}else if(U.length===2||U.length===1){U="",W=0,V=Y,G=0;continue}}q&&(U.length>0?U+="/..":U="..",W=2)}else U.length>0?U+="/"+O.slice(V+1,Y):U=O.slice(V+1,Y),W=Y-V-1;V=Y,G=0}else F===46&&G!==-1?++G:G=-1}return U}a(Q,"r");var M={resolve:a(function(){for(var O,q="",F=!1,U=arguments.length-1;U>=-1&&!F;U--){var W;U>=0?W=arguments[U]:(O===void 0&&(O=process.cwd()),W=O),B(W),W.length!==0&&(q=W+"/"+q,F=W.charCodeAt(0)===47)}return q=Q(q,!F),F?q.length>0?"/"+q:"/":q.length>0?q:"."},"resolve"),normalize:a(function(O){if(B(O),O.length===0)return".";var q=O.charCodeAt(0)===47,F=O.charCodeAt(O.length-1)===47;return(O=Q(O,!q)).length!==0||q||(O="."),O.length>0&&F&&(O+="/"),q?"/"+O:O},"normalize"),isAbsolute:a(function(O){return B(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,q=0;q0&&(O===void 0?O=F:O+="/"+F)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,q){if(B(O),B(q),O===q||(O=M.resolve(O))===(q=M.resolve(q)))return"";for(var F=1;FY){if(q.charCodeAt(V+j)===47)return q.slice(V+j+1);if(j===0)return q.slice(V+j)}else W>Y&&(O.charCodeAt(F+j)===47?re=j:j===0&&(re=0));break}var X=O.charCodeAt(F+j);if(X!==q.charCodeAt(V+j))break;X===47&&(re=j)}var ie="";for(j=F+re+1;j<=U;++j)j!==U&&O.charCodeAt(j)!==47||(ie.length===0?ie+="..":ie+="/..");return ie.length>0?ie+q.slice(V+re):(V+=re,q.charCodeAt(V)===47&&++V,q.slice(V))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(B(O),O.length===0)return".";for(var q=O.charCodeAt(0),F=q===47,U=-1,W=!0,V=O.length-1;V>=1;--V)if((q=O.charCodeAt(V))===47){if(!W){U=V;break}}else W=!1;return U===-1?F?"/":".":F&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,q){if(q!==void 0&&typeof q!="string")throw new TypeError('"ext" argument must be a string');B(O);var F,U=0,W=-1,V=!0;if(q!==void 0&&q.length>0&&q.length<=O.length){if(q.length===O.length&&q===O)return"";var G=q.length-1,Y=-1;for(F=O.length-1;F>=0;--F){var re=O.charCodeAt(F);if(re===47){if(!V){U=F+1;break}}else Y===-1&&(V=!1,Y=F+1),G>=0&&(re===q.charCodeAt(G)?--G==-1&&(W=F):(G=-1,W=Y))}return U===W?W=Y:W===-1&&(W=O.length),O.slice(U,W)}for(F=O.length-1;F>=0;--F)if(O.charCodeAt(F)===47){if(!V){U=F+1;break}}else W===-1&&(V=!1,W=F+1);return W===-1?"":O.slice(U,W)},"basename"),extname:a(function(O){B(O);for(var q=-1,F=0,U=-1,W=!0,V=0,G=O.length-1;G>=0;--G){var Y=O.charCodeAt(G);if(Y!==47)U===-1&&(W=!1,U=G+1),Y===46?q===-1?q=G:V!==1&&(V=1):q!==-1&&(V=-1);else if(!W){F=G+1;break}}return q===-1||U===-1||V===0||V===1&&q===U-1&&q===F+1?"":O.slice(q,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(q,F){var U=F.dir||F.root,W=F.base||(F.name||"")+(F.ext||"");return U?U===F.root?U+W:U+"/"+W:W})(0,O)},"format"),parse:a(function(O){B(O);var q={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return q;var F,U=O.charCodeAt(0),W=U===47;W?(q.root="/",F=1):F=0;for(var V=-1,G=0,Y=-1,re=!0,j=O.length-1,X=0;j>=F;--j)if((U=O.charCodeAt(j))!==47)Y===-1&&(re=!1,Y=j+1),U===46?V===-1?V=j:X!==1&&(X=1):V!==-1&&(X=-1);else if(!re){G=j+1;break}return V===-1||Y===-1||X===0||X===1&&V===Y-1&&V===G+1?Y!==-1&&(q.base=q.name=G===0&&W?O.slice(1,Y):O.slice(G,Y)):(G===0&&W?(q.name=O.slice(1,V),q.base=O.slice(1,Y)):(q.name=O.slice(G,V),q.base=O.slice(G,Y)),q.ext=O.slice(V,Y)),G>0?q.dir=O.slice(0,G-1):W&&(q.dir="/"),q},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,L.exports=M}},e={};function r(L){var B=e[L];if(B!==void 0)return B.exports;var Q=e[L]={exports:{}};return t[L](Q,Q.exports,r),Q.exports}a(r,"r"),r.d=(L,B)=>{for(var Q in B)r.o(B,Q)&&!r.o(L,Q)&&Object.defineProperty(L,Q,{enumerable:!0,get:B[Q]})},r.o=(L,B)=>Object.prototype.hasOwnProperty.call(L,B),r.r=L=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(L,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(L,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(L,B){if(!L.scheme&&B)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${L.authority}", path: "${L.path}", query: "${L.query}", fragment: "${L.fragment}"}`);if(L.scheme&&!s.test(L.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(L.path){if(L.authority){if(!c.test(L.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(L.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(B){return B instanceof m||!!B&&typeof B.authority=="string"&&typeof B.fragment=="string"&&typeof B.path=="string"&&typeof B.query=="string"&&typeof B.scheme=="string"&&typeof B.fsPath=="string"&&typeof B.with=="function"&&typeof B.toString=="function"}scheme;authority;path;query;fragment;constructor(B,Q,M,O,q,F=!1){typeof B=="object"?(this.scheme=B.scheme||d,this.authority=B.authority||d,this.path=B.path||d,this.query=B.query||d,this.fragment=B.fragment||d):(this.scheme=(function(U,W){return U||W?U:"file"})(B,F),this.authority=Q||d,this.path=(function(U,W){switch(U){case"https":case"http":case"file":W?W[0]!==f&&(W=f+W):W=f}return W})(this.scheme,M||d),this.query=O||d,this.fragment=q||d,u(this,F))}get fsPath(){return v(this,!1)}with(B){if(!B)return this;let{scheme:Q,authority:M,path:O,query:q,fragment:F}=B;return Q===void 0?Q=this.scheme:Q===null&&(Q=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),q===void 0?q=this.query:q===null&&(q=d),F===void 0?F=this.fragment:F===null&&(F=d),Q===this.scheme&&M===this.authority&&O===this.path&&q===this.query&&F===this.fragment?this:new A(Q,M,O,q,F)}static parse(B,Q=!1){let M=h.exec(B);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),Q):new A(d,d,d,d,d)}static file(B){let Q=d;if(o&&(B=B.replace(/\\/g,f)),B[0]===f&&B[1]===f){let M=B.indexOf(f,2);M===-1?(Q=B.substring(2),B=f):(Q=B.substring(2,M),B=B.substring(M)||f)}return new A("file",Q,B,d,d)}static from(B){let Q=new A(B.scheme,B.authority,B.path,B.query,B.fragment);return u(Q,!0),Q}toString(B=!1){return b(this,B)}toJSON(){return this}static revive(B){if(B){if(B instanceof m)return B;{let Q=new A(B);return Q._formatted=B.external,Q._fsPath=B._sep===g?B.fsPath:null,Q}}return B}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(B=!1){return B?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let B={$mid:1};return this._fsPath&&(B.fsPath=this._fsPath,B._sep=g),this._formatted&&(B.external=this._formatted),this.path&&(B.path=this.path),this.scheme&&(B.scheme=this.scheme),this.authority&&(B.authority=this.authority),this.query&&(B.query=this.query),this.fragment&&(B.fragment=this.fragment),B}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(L,B,Q){let M,O=-1;for(let q=0;q=97&&F<=122||F>=65&&F<=90||F>=48&&F<=57||F===45||F===46||F===95||F===126||B&&F===47||Q&&F===91||Q&&F===93||Q&&F===58)O!==-1&&(M+=encodeURIComponent(L.substring(O,q)),O=-1),M!==void 0&&(M+=L.charAt(q));else{M===void 0&&(M=L.substr(0,q));let U=y[F];U!==void 0?(O!==-1&&(M+=encodeURIComponent(L.substring(O,q)),O=-1),M+=U):O===-1&&(O=q)}}return O!==-1&&(M+=encodeURIComponent(L.substring(O))),M!==void 0?M:L}a(E,"m");function _(L){let B;for(let Q=0;Q1&&L.scheme==="file"?`//${L.authority}${L.path}`:L.path.charCodeAt(0)===47&&(L.path.charCodeAt(1)>=65&&L.path.charCodeAt(1)<=90||L.path.charCodeAt(1)>=97&&L.path.charCodeAt(1)<=122)&&L.path.charCodeAt(2)===58?B?L.path.substr(1):L.path[1].toLowerCase()+L.path.substr(2):L.path,o&&(Q=Q.replace(/\//g,"\\")),Q}a(v,"v");function b(L,B){let Q=B?_:E,M="",{scheme:O,authority:q,path:F,query:U,fragment:W}=L;if(O&&(M+=O,M+=":"),(q||O==="file")&&(M+=f,M+=f),q){let V=q.indexOf("@");if(V!==-1){let G=q.substr(0,V);q=q.substr(V+1),V=G.lastIndexOf(":"),V===-1?M+=Q(G,!1,!1):(M+=Q(G.substr(0,V),!1,!1),M+=":",M+=Q(G.substr(V+1),!1,!0)),M+="@"}q=q.toLowerCase(),V=q.lastIndexOf(":"),V===-1?M+=Q(q,!1,!0):(M+=Q(q.substr(0,V),!1,!0),M+=q.substr(V))}if(F){if(F.length>=3&&F.charCodeAt(0)===47&&F.charCodeAt(2)===58){let V=F.charCodeAt(1);V>=65&&V<=90&&(F=`/${String.fromCharCode(V+32)}:${F.substr(3)}`)}else if(F.length>=2&&F.charCodeAt(1)===58){let V=F.charCodeAt(0);V>=65&&V<=90&&(F=`${String.fromCharCode(V+32)}:${F.substr(2)}`)}M+=Q(F,!0,!1)}return U&&(M+="?",M+=Q(U,!1,!1)),W&&(M+="#",M+=B?W:E(W,!1,!1)),M}a(b,"b");function T(L){try{return decodeURIComponent(L)}catch{return L.length>3?L.substr(0,3)+T(L.substr(3)):L}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(L){return L.match(w)?L.replace(w,(B=>T(B))):L}a(R,"w");var x=r(975);let k=x.posix||x,D="/";var N;(function(L){L.joinPath=function(B,...Q){return B.with({path:k.join(B.path,...Q)})},L.resolvePath=function(B,...Q){let M=B.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let q=k.resolve(M,...Q);return O&&q[0]===D&&!B.authority&&(q=q.substring(1)),B.with({path:q})},L.dirname=function(B){if(B.path.length===0||B.path===D)return B;let Q=k.dirname(B.path);return Q.length===1&&Q.charCodeAt(0)===46&&(Q=""),B.with({path:Q})},L.basename=function(B){return k.basename(B.path)},L.extname=function(B){return k.extname(B.path)}})(N||(N={})),yWr=n})();var{URI:Z9,Utils:UCe}=yWr;function CWr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+CWr(t.substring(3)):t}}a(CWr,"decodeURIComponentGraceful");var EWr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function fPt(t){return t.match(EWr)?t.replace(EWr,e=>CWr(e)):t}a(fPt,"percentDecode");function Ia(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return Z9.file(t).toString()}a(Ia,"makeFsUri");function To(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?Z9.parse(e[1]+e[2],!0):Z9.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(To,"parseUri");function P9e(t){return To(t),t}a(P9e,"validateUri");function ca(t){try{return To(t).toString()}catch{return t}}a(ca,"normalizeUri");var sW=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function Wn(t){let e=To(t);if(!sW.has(e.scheme)&&!aa.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,_Wr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,k9e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(Wn,"fsPath");function ho(t){try{return Wn(t)}catch{return}}a(ho,"getFsPath");function vWr(t){let e=ho(t);if(e)return Z9.file(e).toString()}a(vWr,"getFsUri");function aW(t,...e){let r,n=ho(t);return n?r=Ia((0,k9e.resolve)(n,...e)):r=UCe.resolvePath(To(t),...e.map(o=>bWr(o))).toString(),typeof t=="string"?r:{uri:r}}a(aW,"resolveFilePath");function xa(t,...e){let r=UCe.joinPath(To(t),...e.map(bWr)).toString();return typeof t=="string"?r:{uri:r}}a(xa,"joinPath");function bWr(t){return Ypo(t)?t.replaceAll("\\","/"):t}a(bWr,"pathToURIPath");function Ypo(t){return/^[^/\\]*\\/.test(t)}a(Ypo,"isWinPath");function ji(t){return fPt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(ji,"basename");function tf(t){let e=UCe.dirname(To(t)),r;return sW.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(tf,"dirname");function SWr(t){return UCe.extname(To(t))}a(SWr,"extname");var D0=class{static{a(this,"NetworkConfiguration")}};function D9e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!hPt(t)&&r.protocol==="http:")return r.href}catch{}}a(D9e,"ensurePermittedUrl");var cW={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function pPt(t,e,r){if(r&&v1(t)){for(let n of r){let o=qt(t,n);if(o)return o}return}for(let n of e){let o=qt(t,n);if(o)return o}}a(pPt,"urlConfigOverride");function Kpo(t,e){switch(e){case"api":return pPt(t,[je.DebugOverrideCapiUrl,je.DebugOverrideCapiUrlLegacy],[je.DebugTestOverrideCapiUrl,je.DebugTestOverrideCapiUrlLegacy]);case"proxy":return pPt(t,[je.DebugOverrideProxyUrl,je.DebugOverrideProxyUrlLegacy],[je.DebugTestOverrideProxyUrl,je.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!hPt(t))return pPt(t,[je.DebugSnippyOverrideUrl])}}a(Kpo,"getEndpointOverrideUrl");function LI(t,e,r,...n){let o=Kpo(t,r)??e.endpoints[r];return xa(o,...n)}a(LI,"getEndpointUrl");function HB(t){return FI(t)?.endpoints??cW}a(HB,"getLastKnownEndpoints");function N9e(t,e){if(e&&!D9e(t,e)){t.get(sa).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(D0).setConfiguredUrls(t,{serverUrl:e})}a(N9e,"updateServerUrl");p();var N0=class{static{a(this,"UrlOpener")}};var Jg=new ge("auth"),mPt=60,Jpo=300;var Zpo=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Xpo="4535c7beffc844b46bb1ed4aa04d759a";function Sy(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a(Sy,"fillGitHubUrls");function X9(){return Math.floor(Date.now()/1e3)}a(X9,"nowSeconds");async function gPt(t,e,r){let n=jt.createAndMarkAsIssued({},{});ht(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Td(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json(),l=c.user_notification;if(TWr(t,l,e),s.status===401){let m="Failed to get copilot token due to 401 status. Please sign out and try again.",g=s.headers.get("x-github-request-id")??"",A=c.error_details,y=[];g&&y.push(`request_id=${g}`),A?.url&&y.push(`url=${A.url}`),A?.notification_id&&y.push(`notification_id=${A.notification_id}`),A?.message&&y.push(`error=${A.message}`);let E=y.length>0?` (${y.join(", ")})`:"";return Jg.info(t,`${m}${E}`),Bm(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:m}}if(!s.ok||!c.token){Jg.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),Bm(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let m=c.error_details;return m?.notification_id!=="not_signed_up"&&TWr(t,m,e),{failureKind:"NotAuthorized",message:m?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let u=X9()+c.refresh_in+mPt,d=await QCe(t,e),f;d.ok&&(f=await d.json());let h=new lW(c,f,u);return ht(t,"auth.new_token",n.extendedBy({...Dwt(h)},{adjusted_expires_at:h.expiresAt,expires_at:c.expires_at,current_time:X9()})),{copilotToken:h}}a(gPt,"authFromGitHubSession");var gh=class{static{a(this,"CopilotTokenFetcher")}},M9e=class extends gh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await gPt(e,r,n)}};async function QCe(t,e){return await Td(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(QCe,"fetchCopilotUserInfo");function TWr(t,e,r){e&&t.get(sa).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Lr).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(N0).open(l)}e.notification_id&&s&&await eho(t,e.notification_id,r)}).catch(n=>{Jg.exception(t,n,"copilotToken.notification")})}a(TWr,"notifyUser");async function eho(t,e,r){let n=await Td(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&Jg.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(eho,"sendNotificationResultToGitHub");var lW=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new w9e(r)}static{a(this,"CopilotToken")}get endpoints(){return{...cW,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Jpo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Xpo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var Ai=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function O9e(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(O9e,"authEnvVarConflictMessage");var eU=class extends Ai{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function IWr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new Ai("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new Ai("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new Ai("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(IWr,"validateGitHubServerUrl");p();p();var MN=class{static{a(this,"AuthRepository")}};p();function xWr(t){let e=t.trim();if(!e)throw new Ai("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=IWr(r),{apiUrl:o}=Sy({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(xWr,"buildAuthServerEndpoint");function tU(t,e){if(e!==void 0)return xWr(e);{let r=t.get(D0),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(tU,"resolveAuthServerEndpoint");function APt(t){if(!t)return!1;try{return xWr(t),!0}catch{return!1}}a(APt,"isValidAuthServer");p();p();p();p();p();p();p();p();function VB(t,e){return t||e}a(VB,"_pureAssign");function M0(t,e){return t[e]}a(M0,"_pureRef");var ev=void 0,Ah=null,DPt="",H9e="function",jCe="object",GB="prototype",kPt="__proto__",uW="undefined",U9e="constructor",NPt="Symbol",tho="_polyfill",dW="length",Q9e="name",Zg="call",G9e="toString",UI=VB(Object),MPt=M0(UI,GB),NWr=VB(String),fW=M0(NWr,GB),HCe=VB(Math),MWr=VB(Array),$9e=M0(MWr,GB),$B=M0($9e,"slice");function Bf(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Bf,"safe");function rho(t,e){var r=Bf(t);return r.e?e:r.v}a(rho,"safeGet");var yPt;function V9e(t){return function(e){return typeof e===t}}a(V9e,"_createIs");function OWr(t){var e="[object "+t+"]";return function(r){return!!(r&&GCe(r)===e)}}a(OWr,"_createObjIs");function GCe(t){return MPt[G9e].call(t)}a(GCe,"objToString");function Pn(t){return typeof t===uW||t===uW}a(Pn,"isUndefined");function nho(t){return!Coe(t)}a(nho,"isStrictUndefined");function Zt(t){return t===Ah||Pn(t)}a(Zt,"isNullOrUndefined");function iho(t){return t===Ah||!Coe(t)}a(iho,"isStrictNullOrUndefined");function Coe(t){return!!t||t!==ev}a(Coe,"isDefined");function oho(t){return!yPt&&(yPt=["string","number","boolean",uW,"symbol","bigint"]),t!==jCe&&yPt.indexOf(t)!==-1}a(oho,"isPrimitiveType");var yi=V9e("string"),Mr=V9e(H9e);function Fu(t){return!t&&Zt(t)?!1:!!t&&typeof t===jCe}a(Fu,"isObject");var cr=M0(MWr,"isArray"),W9e=OWr("Date"),Eh=V9e("number"),vk=V9e("boolean");var WB=OWr("Error");function Lm(t){return!!(t&&t.then&&Mr(t.then))}a(Lm,"isPromiseLike");function M1(t){return!(!t||rho(function(){return!(t&&0+t)},!t))}a(M1,"isTruthy");var voe=M0(UI,"getOwnPropertyDescriptor");function Fm(t,e){return!!t&&MPt.hasOwnProperty[Zg](t,e)}a(Fm,"objHasOwnProperty");var Xg=VB(M0(UI,"hasOwn"),sho);function sho(t,e){return Fm(t,e)||!!voe(t,e)}a(sho,"polyObjHasOwn");function zr(t,e,r){if(t&&Fu(t)){for(var n in t)if(Xg(t,n)&&e[Zg](r||t,n,t[n])===-1)break}}a(zr,"objForEachKey");var B9e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function aho(t){var e={};if(e[B9e.c]=!0,e[B9e.e]=!0,t.l){e.get=function(){return t.l.v};var r=voe(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return zr(t,function(n,o){e[B9e[n]]=nho(o)?e[B9e[n]]:o}),e}a(aho,"_createProp");var s_=M0(UI,"defineProperty"),BWr=M0(UI,"defineProperties");function Hi(t,e,r){return s_(t,e,aho(r))}a(Hi,"objDefine");function LWr(t,e,r,n,o){var s={};return zr(t,function(c,l){q9e(s,c,e?l:c),q9e(s,l,r?l:c)}),n?n(s):s}a(LWr,"_createKeyValueMap");function q9e(t,e,r,n){s_(t,e,{value:r,enumerable:!0,writable:!1})}a(q9e,"_assignMapValue");var Lu=VB(NWr),cho="[object Error]";function lr(t,e){var r=DPt,n=MPt[G9e][Zg](t);n===cho&&(t={stack:Lu(t.stack),message:Lu(t.message),name:Lu(t.name)});try{r=JSON.stringify(t,Ah,e?typeof e=="number"?e:4:ev),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):Ah)||Lu(t)}catch(o){r=" - "+lr(o,e)}return n+": "+r}a(lr,"dumpObj");function Kc(t){throw new Error(t)}a(Kc,"throwError");function O0(t){throw new TypeError(t)}a(O0,"throwTypeError");var FWr=M0(UI,"freeze");function lho(t){return t}a(lho,"_doNothing");function uho(t){return t[kPt]||Ah}a(uho,"_getProto");var zB=M0(UI,"assign"),Uu=M0(UI,"keys");function a_(t){return FWr&&zr(t,function(e,r){(cr(r)||Fu(r))&&a_(r)}),_h(t)}a(a_,"objDeepFreeze");var _h=VB(FWr,lho);var PPt=VB(M0(UI,"getPrototypeOf"),uho);function z9e(t){return LWr(t,1,0,_h)}a(z9e,"createEnum");function dho(t){return LWr(t,0,0,_h)}a(dho,"createEnumKeyMap");function fho(t){var e={};return zr(t,function(r,n){q9e(e,r,n[1]),q9e(e,n[0],n[1])}),_h(e)}a(fho,"createSimpleMap");function OPt(t){return fho(t)}a(OPt,"createTypeMap");var UWr=dho({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),wWr="__tsUtils$gblCfg",EPt;function QWr(){var t;return typeof globalThis!==uW&&(t=globalThis),!t&&typeof self!==uW&&(t=self),!t&&typeof window!==uW&&(t=window),!t&&typeof global!==uW&&(t=global),t}a(QWr,"_getGlobalValue");function qWr(){if(!EPt){var t=Bf(QWr).v||{};EPt=t[wWr]=t[wWr]||{}}return EPt}a(qWr,"_getGlobalConfig");var boe=$Ce;function $Ce(t,e,r){var n=e?e[t]:Ah;return function(o){var s=(o?o[t]:Ah)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?$B[Zg](c,1):c)}O0('"'+Lu(t)+'" not defined for '+lr(o))}}a($Ce,"_unwrapFunctionWithPoly");function pho(t){return function(e){return e[t]}}a(pho,"_unwrapProp");var rU=M0(HCe,"min"),bk=M0(HCe,"max"),RWr=boe("slice",fW),Lf=boe("substring",fW),Y9e=$Ce("substr",fW,hho);function hho(t,e,r){return Zt(t)&&O0("Invalid "+lr(t)),r<0?DPt:(e=e||0,e<0&&(e=bk(e+t[dW],0)),Pn(r)?RWr(t,e):RWr(t,e,e+r))}a(hho,"polyStrSubstr");function ON(t,e){return Lf(t,0,e)}a(ON,"strLeft");var kWr="_urid",_Pt;function mho(){if(!_Pt){var t=qWr();_Pt=t.gblSym=t.gblSym||{k:{},s:{}}}return _Pt}a(mho,"_globalSymbolRegistry");var L9e;function BPt(t){var e={description:Lu(t),toString:a(function(){return NPt+"("+t+")"},"toString")};return e[tho]=!0,e}a(BPt,"polyNewSymbol");function gho(t){var e=mho();if(!Xg(e.k,t)){var r=BPt(t),n=Uu(e.s).length;r[kWr]=function(){return n+"_"+r[G9e]()},e.k[t]=r,e.s[r[kWr]()]=Lu(t)}return e.k[t]}a(gho,"polySymbolFor");function Aho(t){!L9e&&(L9e={});var e,r=UWr[t];return r&&(e=L9e[r]=L9e[r]||BPt(NPt+"."+r)),e}a(Aho,"polyGetKnownSymbol");var yh;function nU(){yh=qWr()}a(nU,"_initTestHooks");function K9e(t){var e={};return!yh&&nU(),e.b=yh.lzy,s_(e,"v",{configurable:!0,get:a(function(){var r=t();return yh.lzy||s_(e,"v",{value:r}),e.b=yh.lzy,r},"get")}),e}a(K9e,"getLazy");function O1(t){return s_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(O1,"createCachedValue");var jWr="window",qCe;function J9e(t,e){var r;return function(){return!yh&&nU(),(!r||yh.lzy)&&(r=O1(Bf(t,e).v)),r.v}}a(J9e,"_getGlobalInstFn");function Ty(t){return!yh&&nU(),(!qCe||t===!1||yh.lzy)&&(qCe=O1(Bf(QWr).v||Ah)),qCe.v}a(Ty,"getGlobal");function ki(t,e){var r;if(!qCe||e===!1?r=Ty(e):r=qCe.v,r&&r[t])return r[t];if(t===jWr)try{return window}catch{}return Ah}a(ki,"getInst");function YB(){return!!rf()}a(YB,"hasDocument");var rf=J9e(ki,["document"]);function Soe(){return!!nf()}a(Soe,"hasWindow");var nf=J9e(ki,[jWr]);function pW(){return!!Qu()}a(pW,"hasNavigator");var Qu=J9e(ki,["navigator"]);var HWr=J9e(function(){return!!Bf(function(){return process&&(process.versions||{}).node}).v});var _oe,CPt;function Z9e(){return _oe=O1(Bf(ki,[NPt]).v),_oe}a(Z9e,"_initSymbol");function yho(t){var e=(yh.lzy?0:_oe)||Z9e();return e.v?e.v[t]:ev}a(yho,"_getSymbolKey");function GWr(){return!!Eho()}a(GWr,"hasSymbol");function Eho(){return!yh&&nU(),((yh.lzy?0:_oe)||Z9e()).v}a(Eho,"getSymbol");function VCe(t,e){var r=UWr[t];!yh&&nU();var n=(yh.lzy?0:_oe)||Z9e();return n.v?n.v[r||t]:e?ev:Aho(t)}a(VCe,"getKnownSymbol");function QI(t,e){!yh&&nU();var r=(yh.lzy?0:_oe)||Z9e();return r.v?r.v(t):e?Ah:BPt(t)}a(QI,"newSymbol");function iU(t){return!yh&&nU(),CPt=(yh.lzy?0:CPt)||O1(Bf(yho,["for"]).v),(CPt.v||gho)(t)}a(iU,"symbolFor");function j9e(t){return!!t&&Mr(t.next)}a(j9e,"isIterator");function LPt(t){return!iho(t)&&Mr(t[VCe(3)])}a(LPt,"isIterable");var F9e;function X9e(t,e,r){if(t&&(j9e(t)||(!F9e&&(F9e=O1(VCe(3))),t=t[F9e.v]?t[F9e.v]():Ah),j9e(t))){var n=ev,o=ev;try{for(var s=0;!(o=t.next()).done&&e[Zg](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=Ah,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(X9e,"iterForOf");function Eoe(t,e,r){return t.apply(e,r)}a(Eoe,"fnApply");function Ch(t,e){return!Pn(e)&&t&&(cr(e)?Eoe(t.push,t,e):j9e(e)||LPt(e)?X9e(e,function(r){t.push(r)}):t.push(e)),t}a(Ch,"arrAppend");function yt(t,e,r){if(t)for(var n=t[dW]>>>0,o=0;o0?r:0;return Lf(t,o,o+n[dW])===n}a(Mho,"polyStrStartsWith");var xPt="ref",wPt="unref",RPt="hasRef",Oho="enabled";function Bho(t,e,r){var n=!0,o=t?e(Ah):Ah,s;function c(){return n=!1,o&&o[wPt]&&o[wPt](),s}a(c,"_unref");function l(){o&&r(o),o=Ah}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[RPt]=function(){return o&&o[RPt]?o[RPt]():n},s[xPt]=function(){return n=!0,o&&o[xPt]&&o[xPt](),s},s[wPt]=c,s=s_(s,Oho,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=Ah},"dn")}}a(Bho,"_createTimerHandler");function UPt(t,e,r){var n=cr(e),o=n?e.length:0,s=(o>0?e[0]:n?ev:e)||setTimeout,c=(o>1?e[1]:ev)||clearTimeout,l=r[0];r[0]=function(){u.dn(),Eoe(l,ev,$B[Zg](arguments))};var u=Bho(t,function(d){if(d){if(d.refresh)return d.refresh(),d;Eoe(c,ev,[d])}return Eoe(s,ev,r)},function(d){Eoe(c,ev,[d])});return u.h}a(UPt,"_createTimeoutWith");function xp(t,e){return UPt(!0,ev,$B[Zg](arguments))}a(xp,"scheduleTimeout");function KWr(t,e,r){return UPt(!0,t,$B[Zg](arguments,1))}a(KWr,"scheduleTimeoutWith");function eUe(t,e){return UPt(!1,ev,$B[Zg](arguments))}a(eUe,"createTimeout");var JCe=z9e,QPt=OPt;p();var Sk=JCe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var Tk="toLowerCase",un="length",xoe="warnToConsole",ZB="throwInternal",LN="watch",sU="apply",Li="push",qI="splice",qu="logger",FN="cancel",XB="initialize",UN="identifier",woe="removeNotificationListener",Roe="addNotificationListener",tv="isInitialized",ZCe="getNotifyMgr",aU="getPlugin",L1="name",B0="processNext",tUe="getProcessTelContext",eL="value",cU="enabled",qPt="stopPollingInternalLogs",jI="unload",XCe="onComplete",rUe="version",nUe="loggingLevelConsole",QN="createNew",F1="teardown",koe="messageId",qN="message",rv="diagLog",lU="_doTeardown",mW="update",U1="getNext",uU="setNextPlugin",eve="userAgent",HI="split",Ik="replace",tve="substring",rve="indexOf",tL="type",jPt="evtName",xk="status",HPt="getAllResponseHeaders",nve="isChildEvt",Q1="data",gW="getCtx",wk="setCtx",GPt="itemsReceived",ive="headers",Poe="urlString",AW="timeout";var iUe="traceFlags";var $Pt;function JWr(t,e){$Pt||($Pt=zCe("AggregationError",function(n,o){o[un]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw yt(e,function(n,o){r+=` -`.concat(o," > ").concat(lr(n))}),new $Pt(r,e||[])}a(JWr,"throwAggregationError");p();p();p();var Doe="function",GI="object",q1="undefined",j1="prototype";var dU=Object,ove=dU[j1];p();var Tbl=(Ty()||{}).Symbol,Ibl=(Ty()||{}).Reflect;var ZWr="hasOwnProperty",Fho=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a(n2t,"_hasVisited");function qho(t,e,r,n){function o(u,d,f){var h=d[f];if(h[YPt]&&n){var m=u[dUe]||{};m[sve]!==!1&&(h=(m[d[Noe]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=BN(null);fUe(r,function(u){s[u]=o(e,r,u)});for(var c=EW(t),l=[];c&&!t2t(c)&&!n2t(l,c);)fUe(c,function(u){!s[u]&&r2t(c,u,!ave)&&(s[u]=o(e,c,u))}),l.push(c),c=EW(c);return s}a(qho,"_getBaseFuncs");function jho(t,e,r,n){var o=null;if(t&&Fm(r,Noe)){var s=t[dUe]||BN(null);if(o=(s[r[Noe]]||BN(null))[e],o||pUe("Missing ["+e+"] "+uUe),!o[KPt]&&s[sve]!==!1){for(var c=!Fm(t,e),l=EW(t),u=[];c&&l&&!t2t(l)&&!n2t(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=EW(l)}try{c&&(t[e]=o),o[KPt]=1}catch{s[sve]=!1}}}return o}a(jho,"_getInstFunc");function Hho(t,e,r){var n=e[t];return n===r&&(n=EW(e)[t]),typeof n!==uUe&&pUe("["+t+"] is not a "+uUe),n}a(Hho,"_getProtoFunc");function Gho(t,e,r,n,o){function s(u,d){var f=a(function(){var h=jho(this,d,u,f)||Hho(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[YPt]=1,f}if(a(s,"_createDynamicPrototype"),!cUe(t)){var c=r[dUe]=r[dUe]||BN(null);if(!cUe(c)){var l=c[e]=c[e]||BN(null);c[sve]!==!1&&(c[sve]=!!o),cUe(l)||fUe(r,function(u){r2t(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!Fm(t,u)||t[u]&&!t[u][YPt])&&(t[u]=s(t,u)))})}}}a(Gho,"_populatePrototype");function $ho(t,e){if(ave){for(var r=[],n=EW(e);n&&!t2t(n)&&!n2t(r,n);){if(n===t)return!0;r.push(n),n=EW(n)}return!1}return!0}a($ho,"_checkPrototype");function zPt(t,e){return Fm(t,rL)?t.name||e||XWr:((t||{})[lUe]||{}).name||e||XWr}a(zPt,"_getObjName");function bi(t,e,r,n){Fm(t,rL)||pUe("theClass is an invalid class definition.");var o=t[rL];$ho(o,e)||pUe("["+zPt(t)+"] not in hierarchy of ["+zPt(e)+"]");var s=null;Fm(o,Noe)?s=o[Noe]:(s=Uho+zPt(t,"_")+"$"+ZPt.n,ZPt.n++,o[Noe]=s);var c=bi[nzr],l=!!c[aUe];l&&n&&n[aUe]!==void 0&&(l=!!n[aUe]);var u=Qho(e),d=qho(o,e,u,l);r(e,d);var f=!!ave&&!!c[JPt];f&&n&&(f=!!n[JPt]),Gho(o,s,e,u,f!==!1)}a(bi,"dynamicProto");bi[nzr]=ZPt.o;p();var mUe="Promise";var d2t="rejected";function ml(t,e){return gUe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:d2t,rejected:!0,reason:r}):r})}a(ml,"doAwaitResponse");function gUe(t,e,r,n){var o=t;try{if(Lm(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&Vho(o,n)}return o}a(gUe,"doAwait");function Vho(t,e){var r=t;return e&&(Lm(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(Vho,"doFinally");var i2t,o2t,s2t,izr=!1;function Who(t,e,r,n){i2t=i2t||{toString:a(function(){return"[[PromiseState]]"},"toString")},o2t=o2t||{toString:a(function(){return"[[PromiseResult]]"},"toString")},s2t=s2t||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[i2t]={get:e},o[o2t]={get:r},o[s2t]={get:n},BWr(t,o)}a(Who,"_addDebugState$1");var azr=["pending","resolving","resolved",d2t],ozr="dispatchEvent",hUe;function zho(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(zho,"_hasInitEventFn");function Yho(t,e,r,n){var o=rf();!hUe&&(hUe=O1(!!Bf(zho,[o]).v));var s=hUe.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),hUe.v&&s.initEvent(e,!1,!0),s&&t[ozr])t[ozr](s);else{var c=t["on"+e];if(c)c(s);else{var l=ki("console");l&&(l.error||l.log)(e,lr(s))}}}a(Yho,"emitEvent");var czr="unhandledRejection",Kho=czr.toLowerCase(),cve=[],Jho=0,Zho=10;var a2t;function szr(t){return Mr(t)?t.toString():lr(t)}a(szr,"dumpFnObj");function lzr(t,e,r){var n=oU(arguments,3),o=0,s=!1,c,l=[],u=Jho++,d=cve.length>0?cve[cve.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{cve.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(k,D){l.push(function(){try{var N=o===2?w:R,L=Pn(N)?c:Mr(N)?N(c):N;Lm(L)?L.then(k,D):N?k(L):o===3?D(L):k(L)}catch(B){D(B)}}),s&&_()},n);return x}finally{cve.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Mr(w)&&(R=a(function(k){return w&&w(),k},"thenFinally"),x=a(function(k){throw w&&w(),k},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return azr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&Lm(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=xp(b,Zho))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,HWr())process.emit(czr,c,m);else{var w=nf()||Ty();!a2t&&(a2t=O1(Bf(ki,[mUe+"RejectionEvent"]).v)),Yho(w,Kho,function(R){return Hi(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!a2t.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},s_(m,"state",{get:E}),izr&&Who(m,E,function(){return GCe(c)},function(){return f}),GWr()&&(m[VCe(11)]="IPromise");function T(){return"IPromise"+(izr?"["+u+(Pn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+szr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Mr(r)||O0(mUe+": executor is not a function - "+szr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(lzr,"_createPromise");function Xho(t){return function(e){var r=oU(arguments,1);return t(function(n,o){try{var s=[],c=1;X9e(e,function(l,u){l&&(c++,gUe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(Xho,"_createAllPromise");function e0o(t){return O1(function(e){var r=oU(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,ml(u,function(f){f.rejected?s[d]={status:d2t,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{cr(e)?yt(e,l):LPt(e)?X9e(e,l):O0("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(e0o,"_createAllSettledPromise");function uzr(t){yt(t,function(e){try{e()}catch{}})}a(uzr,"syncItemProcessor");function t0o(t){var e=Eh(t)?t:0;return function(r){xp(function(){uzr(r)},e)}}a(t0o,"timeoutItemProcessor");function dzr(t,e){return lzr(dzr,t0o(e),t,e)}a(dzr,"createAsyncPromise");var c2t;function r0o(t,e){!c2t&&(c2t=O1(Bf(ki,[mUe]).v||null));var r=c2t.v;if(!r)return dzr(t);Mr(t)||O0(mUe+": executor is not a function - "+lr(t));var n=0;function o(){return azr[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return s_(s,"state",{get:o}),s}a(r0o,"createNativePromise");var l2t;function lve(t){return lzr(lve,uzr,t)}a(lve,"createSyncPromise");function AUe(t,e){return!l2t&&(l2t=e0o(lve)),l2t.v(t,e)}a(AUe,"createSyncAllSettledPromise");var u2t;function Id(t,e){return!u2t&&(u2t=O1(r0o)),u2t.v.call(this,t,e)}a(Id,"createPromise");var yUe=Xho(Id);var o1l=VCe(11);p();p();p();p();var H1=void 0,Io="",_W="channels",Ff="core",EUe="createPerfMgr",uve="disabled",nL="extensionConfig",CW="extensions",nv="processTelemetry",vW="priority",Moe="eventsSent",fU="eventsDiscarded",Ooe="eventsSendRequest",jN="perfEvent",_Ue="offlineEventsStored",CUe="offlineBatchSent",vUe="offlineBatchDrop",Boe="getPerfMgr",bUe="domain",SUe="path",fzr="Not dynamic - ",pzr="REDACTED",f2t=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var n0o="getPrototypeOf",i0o=/-([a-z])/g,o0o=/([^\w\d_$])/g,s0o=/^(\d+[\w\d_$])/,m1l=Object[n0o];function pU(t){return!Zt(t)}a(pU,"isNotNullOrUndefined");function dve(t){var e=t;return e&&yi(e)&&(e=e[Ik](i0o,function(r,n){return n.toUpperCase()}),e=e[Ik](o0o,"_"),e=e[Ik](s0o,function(r,n){return"_"+n})),e}a(dve,"normalizeJsName");function L0(t,e){return t&&e?nu(t,e)!==-1:!1}a(L0,"strContains");function hU(t){return t&&t.toISOString()||""}a(hU,"toISOString");function wp(t){return WB(t)?t[L1]:Io}a(wp,"getExceptionName");function HN(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(HN,"setValue");function p2t(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Pn(r)?{}:r,t[e]=n)):n=Pn(r)?{}:r,n}a(p2t,"getSetValue");function a0o(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][sU](n,o)}}a(a0o,"_createProxyFunction");function bW(t,e,r,n,o){t&&e&&r&&(o!==!1||Pn(t[e]))&&(t[e]=a0o(r,n))}a(bW,"proxyFunctionAs");function SW(t,e,r,n){return t&&e&&Fu(t)&&cr(r)&&yt(r,function(o){yi(o)&&bW(t,o,e,o,n)}),t}a(SW,"proxyFunctions");function h2t(t){return(function(){function e(){var r=this;t&&zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(h2t,"createClassFromInterface");function IUe(t){return t&&zB&&(t=dU(zB({},t))),t}a(IUe,"optimizeObject");function xUe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[un],d=!1,f=1;for(u>0&&vk(l)&&(d=l,l=c[f]||{},f++),Fu(l)||(l={});f>>=0),gve=Czr+t&IW,Ave=vzr-t&IW,bzr=!0}a(C0o,"_mwcSeed");function v0o(){try{var t=hl()&2147483647;C0o((Math.random()*_zr^t)+t)}catch{}}a(v0o,"_autoSeedMwc");function Ezr(t){var e=0,r=b2t()||S2t();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&IW),e===0&&Uoe()&&(bzr||v0o(),e=b0o()&IW),e===0&&(e=B1(_zr*Math.random()|0)),t||(e>>>=0),e}a(Ezr,"random32");function b0o(t){Ave=36969*(Ave&65535)+(Ave>>16)&IW,gve=18e3*(gve&65535)+(gve>>16)&IW;var e=(Ave<<16)+(gve&65535)>>>0&IW|0;return t||(e>>>=0),e}a(b0o,"mwcRandom32");function Szr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=Ezr()>>>0,n=0,o=Io;o[un]>>=6,n===5&&(r=(Ezr()<<2&4294967295|r&3)>>>0,n=0);return o}a(Szr,"newId");var Tzr="3.3.11",S0o="."+Szr(6),T0o=0;function Izr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(Izr,"_canAcceptData");function I0o(t,e){var r=e[t.id];if(!r){r={};try{Izr(e)&&Hi(e,t.id,{e:!1,v:r})}catch{}}return r}a(I0o,"_getCache");function G1(t,e){return e===void 0&&(e=!1),dve(t+T0o+++(e?"."+Tzr:Io)+S0o)}a(G1,"createUniqueNamespace");function kUe(t){var e={id:G1("_aiData-"+(t||Io)+"."+Tzr),accept:a(function(r){return Izr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[dve(n)]:(s&&(c=I0o(e,r),c[dve(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(kUe,"createElmNodeData");p();function PUe(t){return t&&Fu(t)&&!cr(t)&&(t.isVal||t.fb||Xg(t,"v")||Xg(t,"mrg")||Xg(t,"ref")||t.set)}a(PUe,"_isConfigDefaults");function xzr(t,e,r){var n,o=r.dfVal||Coe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&JWr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[un]>0){c||(c=[]),l||(l=xp(function(){l=null,f()},0));for(var A=0;A0?ml(iL(t[0],e),function(){BUe(oU(t,1),e,r)}):r(),n}a(BUe,"doUnloadAll");p();var Dzr=500,k2t="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function M0o(t,e,r){return!t&&Zt(t)?e:vk(t)?t:Lu(t)[Tk]()==="true"}a(M0o,"_stringToBoolOrDefault");function P2t(t){return{mrg:!0,v:t}}a(P2t,"cfgDfMerge");function qoe(t,e,r){return{fb:r,isVal:t,v:e}}a(qoe,"cfgDfValidate");function WI(t,e){return{fb:e,set:M0o,v:!!t}}a(WI,"cfgDfBoolean");p();p();var D2t=[Moe,fU,Ooe,jN],FUe=null,LUe;function O0o(t,e){return function(){var r=arguments,n=N2t(e);if(n){var o=n.listener;o&&o[t]&&o[t][sU](o,r)}}}a(O0o,"_listenerProxyFunc");function B0o(){var t=ki("Microsoft");return t&&(FUe=t.ApplicationInsights),FUe}a(B0o,"_getExtensionNamespace");function N2t(t){var e=FUe;return!e&&t.disableDbgExt!==!0&&(e=FUe||B0o()),e?e.ChromeDbgExt:null}a(N2t,"getDebugExt");function Nzr(t){if(!LUe){LUe={};for(var e=0;e=A&&(d[T](b[qN]),n[w]=!0)}else o>=A&&d[T](b[qN]);f(A,b)}},d.debugToConsole=function(A){M2t("debug",A),g("warning",A)},d[xoe]=function(A){M2t("warn",A),g("warning",A)},d.errorToConsole=function(A){M2t("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[jI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=U0o+y[koe];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Li](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new bve(23,v,!1);d.queue[Li](b),A===1?d.errorToConsole(v):d[xoe](v)}}}a(f,"_logInternalMessage");function h(A){return VI(vh(A,Q0o,d).cfg,function(y){var E=y.cfg;o=E[nUe],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=N2t(e||{});E&&E[rv]&&E[rv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function Bzr(t){return t||new Hoe}a(Bzr,"_getLogger");function Vr(t,e,r,n,o,s){s===void 0&&(s=!1),Bzr(t)[ZB](e,r,n,o,s)}a(Vr,"_throwInternal");function oL(t,e){Bzr(t)[xoe](e)}a(oL,"_warnToConsole");var O2t,AU,Lzr="toGMTString",Fzr="toUTCString",U2t="cookie",B2t="expires",Uzr="isCookieUseDisabled",Sve="disableCookiesUsage",Qzr="_ckMgr",UUe=null,L2t=null,qzr=null,$N,jzr={},Hzr={},j0o=(O2t={cookieCfg:P2t((AU={},AU[bUe]={fb:"cookieDomain",dfVal:pU},AU.path={fb:"cookiePath",dfVal:pU},AU.enabled=H1,AU.ignoreCookies=H1,AU.blockedCookies=H1,AU.disableCookieDefer=!1,AU)),cookieDomain:H1,cookiePath:H1},O2t[Sve]=H1,O2t);function Q2t(){!$N&&($N=K9e(function(){return rf()}))}a(Q2t,"_getDoc");function QUe(t){return t?t.isEnabled():!0}a(QUe,"_isMgrEnabled");function Yzr(t,e){return e&&t&&cr(t.ignoreCookies)?Go(t.ignoreCookies,e)!==-1:!1}a(Yzr,"_isIgnoredCookie");function Gzr(t,e){return e&&t&&cr(t.blockedCookies)&&Go(t.blockedCookies,e)!==-1?!0:Yzr(t,e)}a(Gzr,"_isBlockedCookie");function $zr(t,e){var r=e[cU];if(Zt(r)){var n=void 0;Pn(t[Uzr])||(n=!t[Uzr]),Pn(t[Sve])||(n=!t[Sve]),r=n}return r}a($zr,"_isCfgEnabled");function Kzr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[SUe]=E||"/",_[B2t]="Thu, 01 Jan 1970 00:00:01 GMT",_);return Uoe()||(v["max-age"]="0"),Wzr(Io,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Io),R=nu(w,";");if(R!==-1&&(w=Pi(ON(E,R)),T=Jzr(Lf(E,R+1))),HN(T,bUe,v||o,M1,Pn),!Zt(_)){var x=Uoe();if(Pn(T[B2t])){var k=hl(),D=k+_*1e3;if(D>0){var N=new Date;N.setTime(D),HN(T,B2t,Vzr(N,x?Lzr:Fzr)||Vzr(N,x?Lzr:Fzr)||Io,M1)}}x||HN(T,"max-age",Io+_,null,Pn)}var L=hve();return L&&L.protocol==="https:"&&(HN(T,"secure",null,null,Pn),L2t===null&&(L2t=!G0o((Qu()||{})[eve])),L2t&&HN(T,"SameSite","None",null,Pn)),HN(T,SUe,b||n,null,Pn),Wzr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[un]-1;_>=0;_--)f[_].n===E&&f[qI](_,1)}a(g,"_removePendingCookie");function A(){F2t(e)&&f&&(yt(f,function(E){Gzr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=vh(t||Hzr,null,e).cfg,s=VI(t,function(E){E.setDf(E.cfg,j0o),r=E.ref(E.cfg,"cookieCfg"),n=r[SUe]||"/",o=r[bUe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=$zr(t,r)!==!1,l=r.getCookie||H0o,u=r.setCookie||zzr,d=r.delCookie||zzr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=$zr(t,r)!==!1&&c&&F2t(e),_=Hzr[Qzr];return E&&_&&y!==_&&(E=QUe(_)),E},"isEnabled"),setEnabled:a(function(E){r[cU]=E,Pn(t[Sve])||(t[Sve]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=Gzr(r,E);if(!R){var x=m(_,v,b,T);QUe(y)?(u(E,x),w=!0):f&&(g(E),f[Li]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Io,v=Yzr(r,E);if(!v){if(QUe(y))_=l(E);else if(f)for(var b=f[un]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=nu(w,";");_=R!==-1?Pi(ON(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return QUe(y)?v=y.purge(E,_):f&&(g(E),f[Li]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return F2t(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[Qzr]=y,y}a(Kzr,"createCookieMgr");function F2t(t){if(UUe===null){UUe=!1,!$N&&Q2t();try{var e=$N.v||{};UUe=e[U2t]!==void 0}catch(r){Vr(t,2,68,"Cannot access document.cookie - "+wp(r),{exception:lr(r)})}}return UUe}a(F2t,"areCookiesSupported");function Jzr(t){var e={};if(t&&t[un]){var r=Pi(t)[HI](";");yt(r,function(n){if(n=Pi(n||Io),n){var o=nu(n,"=");o===-1?e[n]=null:e[Pi(ON(n,o))]=Pi(Lf(n,o+1))}})}return e}a(Jzr,"_extractParts");function Vzr(t,e){return Mr(t[e])?t[e]():null}a(Vzr,"_formatDate");function Wzr(t,e){var r=t||Io;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Io:"="+o)}),r}a(Wzr,"_formatCookieValue");function H0o(t){var e=Io;if(!$N&&Q2t(),$N.v){var r=$N.v[U2t]||Io;qzr!==r&&(jzr=Jzr(r),qzr=r),e=Pi(jzr[t]||Io)}return e}a(H0o,"_getCookieValue");function zzr(t,e){!$N&&Q2t(),$N.v&&($N.v[U2t]=t+"="+e)}a(zzr,"_setCookieValue");function G0o(t){return yi(t)?!!(L0(t,"CPU iPhone OS 12")||L0(t,"iPad; CPU OS 12")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&L0(t,"Version/")&&L0(t,"Safari")||L0(t,"Macintosh; Intel Mac OS X 10_14")&&JB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||L0(t,"Chrome/5")||L0(t,"Chrome/6")||L0(t,"UnrealEngine")&&!L0(t,"Chrome")||L0(t,"UCBrowser/12")||L0(t,"UCBrowser/11")):!1}a(G0o,"uaDisallowsSameSiteNone");p();var $0o={perfEvtsSendAll:!1};function V0o(t){t.h=null;var e=t.cb;t.cb=[],yt(e,function(r){Bf(r.fn,[r.arg])})}a(V0o,"_runScheduledListeners");function yU(t,e,r,n){yt(t,function(o){o&&o[e]&&(r?(r.cb[Li]({fn:n,arg:o}),r.h=r.h||xp(V0o,0,r)):Bf(n,[o]))})}a(yU,"_runListeners");var Zzr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=vh(e,$0o);n=c[LN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){Hi(l,"listeners",{g:a(function(){return o},"g")}),l[Roe]=function(u){o[Li](u)},l[woe]=function(u){for(var d=Go(o,u);d>-1;)o[qI](d,1),d=Go(o,u)},l[Moe]=function(u){yU(o,Moe,s,function(d){d[Moe](u)})},l[fU]=function(u,d,f){yU(o,fU,s,function(h){h[fU](u,d,f)})},l[Ooe]=function(u,d){yU(o,Ooe,d?s:null,function(f){f[Ooe](u,d)})},l[jN]=function(u){u&&(r||!u[nve]())&&yU(o,jN,null,function(d){u.isAsync?xp(function(){return d[jN](u)},0):d[jN](u)})},l[_Ue]=function(u){u&&u[un]&&yU(o,_Ue,s,function(d){d[_Ue](u)})},l[CUe]=function(u){u&&u[Q1]&&yU(o,CUe,s,function(d){d[CUe](u)})},l[vUe]=function(u,d){if(u>0){var f=d||0;yU(o,vUe,s,function(h){h[vUe](u,f)})}},l[jI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[FN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(yU(o,"unload",null,function(h){var m=h[jI](u);m&&(f||(f=[]),f[Li](m))}),f)return Id(function(h){return ml(yUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Goe="ctx",j2t="ParentContextKey",Tve="ChildrenContextKey",W0o=null,qUe=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[L1]=e,o.isAsync=n,o[nve]=function(){return!1},Mr(r)){var s;Hi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[gW]=function(c){return c?c===t[j2t]||c===t[Tve]?o[c]:(o[Goe]||{})[c]:null},o[wk]=function(c,l){if(c)if(c===t[j2t])o[c]||(o[nve]=function(){return!0}),o[c]=l;else if(c===t[Tve])o[c]=l;else{var u=o[Goe]=o[Goe]||{};u[c]=l}},o.complete=function(){var c=0,l=o[gW](t[Tve]);if(cr(l))for(var u=0;u0&&(yt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Vr(r[qu],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[nL];!_&&A&&(_={}),E[nL]=_,_=e.ref(E,nL),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}yve(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[aU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(V2t,"_createInternalContext");function Rk(t,e,r,n){var o=vh(e),s=V2t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[nv](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=EU(d,o.cfg,r,f)),Rk(d||c[U1](),o.cfg,r,f)}return a(u,"_createNew"),c[B0]=l,c[QN]=u,c}a(Rk,"createProcessTelemetryContext");function $oe(t,e,r){var n=vh(e.config),o=V2t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[jI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=EU(u,n.cfg,e,d)),$oe(u||s[U1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[QN]=l,s}a($oe,"createProcessTelemetryUnloadContext");function Ive(t,e,r){var n=vh(e.config),o=V2t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[mW])&&d[mW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=EU(u,n.cfg,e,d)),Ive(u||s[U1](),e,d)}return a(l,"_createNew"),s[B0]=c,s[QN]=l,s}a(Ive,"createProcessTelemetryUpdateContext");function EU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[un]>0){var c=null;yt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[nv])){var u=X0o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?EU([n],e,r):o}a(EU,"createTelemetryProxyChain");function X0o(t,e,r){var n=null,o=Mr(t[nv]),s=Mr(t[uU]),c;t?c=t[UN]+"-"+t[vW]+"-"+oYr++:c="Unknown-0-"+oYr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Mr(t[iYr])&&(g=t[iYr]()),g||(g=Rk(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[UN]:J0o,T=g[nYr];return T||(T=g[nYr]={}),g.setNext(n),t&&jUe(g[Ff](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Io;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Vr(g[rv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=sL(t);return _[F1]||_[uve]?!1:(s&&t[uU](n),t[nv](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[B0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=sL(t),v=t[Ff]||_[Ff];t&&(!v||v===g.core())&&!_[F1]&&(_[Ff]=null,_[F1]=!0,_[tv]=!1,t[F1]&&t[F1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[B0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=sL(t),v=t[Ff]||_[Ff];t&&(!v||v===g.core())&&!_[F1]&&t[mW]&&t[mW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[B0](A)}return a(m,"_updatePlugin"),_h(l)}a(X0o,"createTelemetryPluginProxy");var emo=(function(){function t(e,r,n,o){var s=this,c=Rk(e,r,n,o);SW(s,c,Uu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function GUe(){var t=[];function e(n){n&&t[Li](n)}a(e,"_addHandler");function r(n,o){yt(t,function(s){try{s(n,o)}catch(c){Vr(n[rv](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(GUe,"createUnloadHandlerContainer");p();var $Ue,VUe;function WUe(){var t=[];function e(n){var o=t;t=[],yt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Vr(n,2,73,"Unloading:"+lr(c))}}),$Ue&&o[un]>$Ue&&(VUe?VUe("doUnload",o):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),$Ue&&t[un]>$Ue&&(VUe?VUe("Add",t):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(WUe,"createUnloadHookContainer");var W2t,_U="getPlugin",tmo=(W2t={},W2t[nL]={isVal:pU,v:{}},W2t),xve=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[XB]=function(h,m,g,A){u(h,m,A),r=!0},f[F1]=function(h,m){var g=f[Ff];if(!g||h&&g!==h[Ff]())return;var A,y=!1,E=h||$oe(null,g,o&&o[_U]?o[_U]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[rv]()),A===!0&&E[B0](_),d())}return a(v,"_unloadCallback"),!f[lU]||f[lU](E,_,v)!==!0?v():A=!0,A},f[mW]=function(h,m){var g=f[Ff];if(!g||h&&g!==h[Ff]())return;var A,y=!1,E=h||Ive(null,g,o&&o[_U]?o[_U]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[U1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},bW(f,"_addUnloadCb",function(){return s},"add"),bW(f,"_addHook",function(){return c},"add"),Hi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[rv]=function(f){return l(f)[rv]()},e[tv]=function(){return r},e.setInitialized=function(f){r=f},e[uU]=function(f){o=f},e[B0]=function(f,h){h?h[B0](f):o&&Mr(o[nv])&&o[nv](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||Rk(null,{},e[Ff]);o&&o[_U]?h=m[QN](null,o[_U]):h=m[QN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){vh(f,tmo,xW(h)),!m&&h&&(m=h[tUe]()[U1]());var g=o;o&&o[_U]&&(g=o[_U]()),e[Ff]=h,n=Rk(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Ff]=null,n=null,o=null,c=WUe(),s=GUe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function rmo(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){yt(t,function(s,c){if(s.id===n.id)return t[qI](c,1),-1})},"remove")};return o}a(rmo,"_addInitializer");function nmo(t,e,r){for(var n=!1,o=t[un],s=0;s"},"v")})}a(pmo,"_createUnloadHook");var K2t=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F;bi(t,this,function(U){X(),U._getDbgPlgTargets=function(){return[x,o]},U[tv]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[XB]=function(ne,se,Ie,_e){g&&Kc(aYr),U[tv]()&&Kc("Core cannot be initialized more than once"),e=vh(ne,z2t,Ie||U[qu],!1),ne=e.cfg,Me(e[LN](function(Xe){var Ct=Xe.cfg;B=Ct.initInMemoMaxSize||smo,W(Ct);var Ot=Xe.ref(Xe.cfg,nL);zr(Ot,function($t){Xe.ref(Ot,$t)})})),s=_e,b=fmo(e,v,s&&U[ZCe](),b),z(),U[qu]=Ie;var Re=ne[CW];if(f=[],f[Li].apply(f,yW(yW([],se,!1),Re,!1)),h=ne[_W],we(null),(!m||m[un]===0)&&Kc("No "+_W+" available"),h&&h[un]>1){var Je=U[aU]("TeeChannelController");(!Je||!Je.plugin)&&Vr(n,1,28,"TeeChannel required")}dmo(ne,R,n),R=null,r=!0,N===Sk.ACTIVE&&Y()},U.getChannels=function(){var ne=[];return m&&yt(m,function(se){ne[Li](se)}),_h(ne)},U.track=function(ne){jUe(U[Boe](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ae(ne),Kc("Invalid telemetry item")),!ne[L1]&&Zt(ne[L1])&&(ae(ne),Kc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||hU(new Date),ne.ver=ne.ver||"4.0",!g&&U[tv]()&&N===Sk.ACTIVE?ie()[B0](ne):N!==Sk.INACTIVE&&o[un]<=B&&o[Li](ne)},function(){return{item:ne}},!ne.sync)},U[tUe]=ie,U[ZCe]=function(){return s||(s=new Zzr(e.cfg),U[imo]=s),s},U[Roe]=function(ne){U.getNotifyMgr()[Roe](ne)},U[woe]=function(ne){s&&s[woe](ne)},U.getCookieMgr=function(){return u||(u=Kzr(e.cfg,U[qu])),u},U.setCookieMgr=function(ne){u!==ne&&(iL(u,!1),u=ne)},U[Boe]=function(){return c||l||eYr()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[un]},U.releaseQueue=function(){if(r&&o[un]>0){var ne=o;o=[],N===2?yt(ne,function(se){se.iKey=se.iKey||w,ie()[B0](se)}):Vr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,F=!1,O&&O[FN](),re(!0)};function W(ne){var se=ne.instrumentationKey,Ie=ne.endpointUrl;if(N!==3){if(Zt(se)){w=null,N=Sk.INACTIVE;var _e="Please provide instrumentation key";r?(Vr(n,1,100,_e),Y()):Kc(_e);return}var Re=[];Lm(se)?(Re[Li](se),w=null):w=se,Lm(Ie)?(Re[Li](Ie),L=null):L=Ie,Re[un]?V(ne,Re):G()}}a(W,"_handleIKeyEndpointPromises");function V(ne,se){Q=!1,N=3;var Ie=pU(ne.initTimeOut)?ne.initTimeOut:amo,_e=AUe(se);M&&M[FN](),M=xp(function(){M=null,Q||G()},Ie),ml(_e,function(Re){try{if(Q)return;if(!Re.rejected){var Je=Re[eL];if(Je&&Je[un]){var Xe=Je[0];if(w=Xe&&Xe[eL],Je[un]>1){var Ct=Je[1];L=Ct&&Ct[eL]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}G()}catch{Q||G()}})}a(V,"_waitForInitPromises");function G(){Q=!0,Zt(w)?(N=Sk.INACTIVE,Vr(n,1,112,"ikey can't be resolved from promises")):N=Sk.ACTIVE,Y()}a(G,"_setStatus");function Y(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(Y,"_releaseQueues");function re(ne){if((!O||!O[cU])&&!F){var se=ne||n&&n.queue[un]>0;se&&(q||(q=!0,Me(e[LN](function(Ie){var _e=Ie.cfg.diagnosticLogInterval;(!_e||!(_e>0))&&(_e=1e4);var Re=!1;O&&(Re=O[cU],O[FN]()),O=eUe(Z,_e),O.unref(),O[cU]=Re}))),O[cU]=!0)}return O}a(re,"_startLogPoller"),U[qPt]=function(){F=!0,O&&O[FN](),Z()},SW(U,function(){return A},["addTelemetryInitializer"]),U[jI]=function(ne,se,Ie){ne===void 0&&(ne=!0),r||Kc(omo),g&&Kc(aYr);var _e={reason:50,isAsync:ne,flushComplete:!1},Re;ne&&!se&&(Re=Id(function(Ct){se=Ct}));var Je=$oe(De(),U);Je[XCe](function(){v.run(U[qu]),BUe([u,s,n],ne,function(){X(),se&&se(_e)})},U);function Xe(Ct){_e.flushComplete=Ct,g=!0,_.run(Je,_e),U[qPt](),Je[B0](_e)}return a(Xe,"_doUnload"),Z(),J(ne,Xe,6,Ie)||Xe(!1),Re},U[aU]=Ae,U.addPlugin=function(ne,se,Ie,_e){if(!ne){_e&&_e(!1),K(uYr);return}var Re=Ae(ne[UN]);if(Re&&!se){_e&&_e(!1),K("Plugin ["+ne[UN]+"] is already loaded!");return}var Je={reason:16};function Xe($t){f[Li](ne),Je.added=[ne],we(Je),_e&&_e(!0)}if(a(Xe,"_addPlugin"),Re){var Ct=[Re.plugin],Ot={reason:2,isAsync:!!Ie};Te(Ct,Ot,function($t){$t?(Je.removed=Ct,Je.reason|=32,Xe(!0)):_e&&_e(!1)})}else Xe(!1)},U.updateCfg=function(ne,se){se===void 0&&(se=!0);var Ie;if(U[tv]()){Ie={reason:1,cfg:e.cfg,oldCfg:Toe({},e.cfg),newConfig:Toe({},ne),merge:se},ne=Ie.newConfig;var _e=e.cfg;ne[CW]=_e[CW],ne[_W]=_e[_W]}e._block(function(Re){var Je=Re.cfg;Y2t(Re,Je,ne,se),se||zr(Je,function(Xe){Xg(ne,Xe)||Re.set(Je,Xe,H1)}),Re.setDf(Je,z2t)},!0),e.notify(),Ie&&le(Ie)},U.evtNamespace=function(){return E},U.flush=J,U.getTraceCtx=function(ne){return T||(T=rYr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=Me,bW(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var se;return r?se=VI(e.cfg,ne,U[qu]):se=umo(R,ne),pmo(se)},U.getWParam=function(){return YB()||e.cfg.enableWParam?0:-1};function j(){var ne={};k=[];var se=a(function(Ie){Ie&&yt(Ie,function(_e){if(_e[UN]&&_e[rUe]&&!ne[_e.identifier]){var Re=_e[UN]+"="+_e[rUe];k[Li](Re),ne[_e.identifier]=_e}})},"_addPluginVersions");se(m),h&&yt(h,function(Ie){se(Ie)}),se(f)}a(j,"_setPluginVersions");function X(){r=!1,e=vh({},z2t,U[qu]),e.cfg[nUe]=1,Hi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(se){U.updateCfg(se,!1)},"s")}),Hi(U,"pluginVersionStringArr",{g:a(function(){return k||j(),k},"g")}),Hi(U,"pluginVersionString",{g:a(function(){return D||(k||j(),D=k.join(";")),D||Io},"g")}),Hi(U,"logger",{g:a(function(){return n||(n=new Hoe(e.cfg),e[qu]=n),n},"g"),s:a(function(se){e[qu]=se,n!==se&&(iL(n,!1),n=se)},"s")}),U[qu]=new Hoe(e.cfg),x=[];var ne=U.config[CW]||[];ne.splice(0,ne[un]),Ch(ne,x),A=new sYr,o=[],iL(s,!1),s=null,c=null,l=null,iL(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=G1("AIBaseCore",!0),_=GUe(),T=null,w=null,v=WUe(),R=[],D=null,k=null,F=!1,O=null,q=!1,N=0,L=null,B=null,Q=!1,M=null}a(X,"_initDefaults");function ie(){var ne=Rk(De(),e.cfg,U);return ne[XCe](re),ne}a(ie,"_createTelCtx");function we(ne){var se=lmo(U[qu],Dzr,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=HUe(Ch(m,se[_W]));var Ie=Ch(HUe(se[Ff]),m);x=_h(Ie);var _e=U.config[CW]||[];_e.splice(0,_e[un]),Ch(_e,x);var Re=ie();m&&m[un]>0&&$2t(Re[QN](m),Ie),$2t(Re,Ie),ne&&le(ne)}a(we,"_initPluginChain");function Ae(ne){var se=null,Ie=null,_e=[];return yt(x,function(Re){if(Re[UN]===ne&&Re!==A)return Ie=Re,-1;Re.getChannel&&_e[Li](Re)}),!Ie&&_e[un]>0&&yt(_e,function(Re){if(Ie=Re.getChannel(ne),!Ie)return-1}),Ie&&(se={plugin:Ie,setEnabled:a(function(Re){sL(Ie)[uve]=!Re},"setEnabled"),isEnabled:a(function(){var Re=sL(Ie);return!Re[F1]&&!Re[uve]},"isEnabled"),remove:a(function(Re,Je){Re===void 0&&(Re=!0);var Xe=[Ie],Ct={reason:1,isAsync:Re};Te(Xe,Ct,function(Ot){Ot&&we({reason:32,removed:Xe}),Je&&Je(Ot)})},"remove")}),se}a(Ae,"_getPlugin");function De(){if(!d){var ne=(x||[]).slice();Go(ne,A)===-1&&ne[Li](A),d=EU(HUe(ne),e.cfg,U)}return d}a(De,"_getPluginChain");function Te(ne,se,Ie){if(ne&&ne[un]>0){var _e=EU(ne,e.cfg,U),Re=$oe(_e,U);Re[XCe](function(){var Je=!1,Xe=[];yt(f,function(Ot,$t){cYr(Ot,ne)?Je=!0:Xe[Li](Ot)}),f=Xe,D=null,k=null;var Ct=[];h&&(yt(h,function(Ot,$t){var Gt=[];yt(Ot,function(Ee){cYr(Ee,ne)?Je=!0:Gt[Li](Ee)}),Ct[Li](Gt)}),h=Ct),Ie&&Ie(Je),re()}),Re[B0](se)}else Ie(!1)}a(Te,"_removePlugins");function Z(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[un]=0,yt(ne,function(se){var Ie={name:y||"InternalMessageId: "+se[koe],iKey:w,time:hU(new Date),baseType:bve.dataType,baseData:{message:se[qN]}};U.track(Ie)})}}a(Z,"_flushInternalLogs");function J(ne,se,Ie,_e){var Re=1,Je=!1,Xe=null;_e=_e||5e3;function Ct(){Re--,Je&&Re===0&&(Xe&&Xe[FN](),Xe=null,se&&se(Je),se=null)}if(a(Ct,"doCallback"),m&&m[un]>0){var Ot=ie()[QN](m);Ot.iterate(function($t){if($t.flush){Re++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Ct()},Ie)||Gt||(ne&&Xe==null?Xe=xp(function(){Xe=null,Ct()},_e):Ct())}})}return Je=!0,Ct(),!0}a(J,"_flushChannels");function z(){var ne;Me(e[LN](function(se){var Ie=se.cfg.enablePerfMgr;if(Ie){var _e=se.cfg[EUe];(ne!==_e||!ne)&&(_e||(_e=cmo),p2t(se.cfg,EUe,_e),ne=_e,l=null),!c&&!l&&Mr(_e)&&(l=_e(U,U[ZCe]()))}else l=null,ne=null}))}a(z,"_initPerfManager");function le(ne){var se=Ive(De(),U);se[XCe](re),(!U._updateHook||U._updateHook(se,ne)!==!0)&&se[B0](ne)}a(le,"_doUpdate");function K(ne){var se=U[qu];se?(Vr(se,2,73,ne),re()):Kc(ne)}a(K,"_logOrThrowError");function ae(ne){var se=U[ZCe]();se&&se[fU]([ne],2)}a(ae,"_notifyInvalidEvent");function Me(ne){v.add(ne)}a(Me,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function wve(t,e){try{if(t&&t!==""){var r=c_().parse(t);if(r&&r[GPt]&&r[GPt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[un])return r}}catch(n){Vr(e,1,43,"Cannot parse the response. "+(n[L1]||lr(n)),{response:t})}return null}a(wve,"parseResponse");p();var kk="",hmo="NoResponseBody",dYr="&"+hmo+"=true",J2t="POST",Z2t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;Q(),E[XB]=function(M,O){o=O,n&&Vr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=hve();O&&O.protocol&&O.protocol[Tk]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[un]?R(M,O):null},E.getFallbackInst=function(){return d},E[lU]=function(M,O){Q()},E.preparePayload=function(M,O,q,F){if(!O||F||!q[Q1]){M(q);return}try{var U=ki("CompressionStream");if(!Mr(U)){M(q);return}var W=new ReadableStream({start:a(function(X){X.enqueue(yi(q[Q1])?new TextEncoder().encode(q[Q1]):q[Q1]),X.close()},"start")}),V=W.pipeThrough(new U("gzip")),G=V.getReader(),Y=[],re=0,j=!1;return ml(G.read(),a(function X(ie){if(!j&&!ie.rejected){var we=ie[eL];if(!we.done)return Y[Li](we[eL]),re+=we.value[un],ml(G.read(),X);for(var Ae=new Uint8Array(re),De=0,Te=0,Z=Y;Te0&&(yt(Uu(Ae),function(z){j.append(z,Ae[z])}),De[ive]=j),u?De.credentials=u:v&&s&&(De.credentials="include"),q&&(De.keepalive=!0,e+=X,s?M._sendReason===2&&(ie=!0,A&&(U+=dYr)):ie=!0);var Te=new Request(U,De);try{Te[k2t]=!0}catch{}if(!q&&r&&(G=Id(function(z,le){Y=z,re=le})),!U){w(O),Y&&Y(!1);return}function Z(z,le){le?x(O,s?0:le,{},s?kk:z):x(O,s?0:400,{},s?kk:z)}a(Z,"_handleError");function J(z,le,K){var ae=z[xk],Me=c.fetchOnComplete;Me&&Mr(Me)?Me(z,O,K||kk,le):x(O,ae,{},K||kk)}a(J,"_onFetchComplete");try{ml(fetch(s?U:Te,s?De:null),function(z){if(q&&(e-=X,X=0),!we)if(we=!0,z.rejected)Z(z.reason&&z.reason[qN],499),re&&re(z.reason);else{var le=z[eL];try{!s&&!le.ok?(le[xk]?Z(le.statusText,le[xk]):Z(le.statusText,499),Y&&Y(!1)):s&&!le.body?(J(le,null,kk),Y&&Y(!0)):ml(le.text(),function(K){J(le,M,K[eL]),Y&&Y(!0)})}catch(K){le&&le[xk]?Z(lr(K),le[xk]):Z(lr(K),499),re&&re(K)}}})}catch(z){we||(Z(lr(z),499),re&&re(z))}return ie&&!we&&(we=!0,x(O,200,{}),Y&&Y(!0)),s&&!we&&M[AW]>0&&y&&y.set(function(){we||(we=!0,x(O,500,{}),Y&&Y(!0))},M[AW]),G}a(L,"_doFetchSender");function B(M,O,q){var F=nf(),U=new XDomainRequest,W=M[Q1];U.onload=function(){var j=Loe(U),X=c&&c.xdrOnComplete;X&&Mr(X)?X(U,O,M):x(O,200,{},j)},U.onerror=function(){x(O,400,{},s?kk:fve(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var V=F&&F.location&&F.location.protocol||"",G=M[Poe];if(!G){w(O);return}if(!s&&G.lastIndexOf(V,0)!==0){var Y="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Vr(o,2,40,". "+Y),T(Y,O);return}var re=s?G:G[Ik](/^(https?:)/,"");U.open(J2t,re),M[AW]&&(U[AW]=M[AW]),U.send(W),s&&q?y&&y.set(function(){U.send(W)},0):U.send(W)}a(B,"_xdrSender");function Q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(Q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var yYr="on",fYr="attachEvent",pYr="addEventListener",hYr="detachEvent",mYr="removeEventListener",X2t="events";var bxl=G1("aiEvtPageHide"),Sxl=G1("aiEvtPageShow"),mmo=/\.[\.]+/g,gmo=/[\.]+$/,Amo=1,zUe=kUe("events"),ymo=/^([^.]*)(?:\.(.+)|)/;function gYr(t){return t&&t[Ik]?t[Ik](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Io):t}a(gYr,"_normalizeNamespace");function eDt(t,e){if(e){var r=Io;cr(e)?(r=Io,yt(e,function(o){o=gYr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=gYr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Io)+r)}var n=ymo.exec(t||Io)||[];return{type:n[1],ns:(n[2]||Io).replace(mmo,".").replace(gmo,Io)[HI](".").sort().join(".")}}a(eDt,"_getEvtNamespace");function EYr(t,e,r){r===void 0&&(r=!0);var n=zUe.get(t,X2t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(EYr,"_getRegisteredEvents");function _Yr(t,e,r,n){t&&e&&e[tL]&&(t[mYr]?t[mYr](e[tL],r,n):t[hYr]&&t[hYr](yYr+e[tL],r))}a(_Yr,"_doDetach");function Emo(t,e,r,n){var o=!1;return t&&e&&e[tL]&&r&&(t[pYr]?(t[pYr](e[tL],r,n),o=!0):t[fYr]&&(t[fYr](yYr+e[tL],r),o=!0)),o}a(Emo,"_doAttach");function AYr(t,e,r,n){for(var o=e[un];o--;){var s=e[o];s&&(!r.ns||r.ns===s[jPt].ns)&&(!n||n(s))&&(_Yr(t,s[jPt],s.handler,s.capture),e[qI](o,1))}}a(AYr,"_doUnregister");function _mo(t,e,r){if(e[tL])AYr(t,EYr(t,e[tL]),e,r);else{var n=zUe.get(t,X2t,{});zr(n,function(o,s){AYr(t,s,e,r)}),Uu(n)[un]===0&&zUe.kill(t,X2t)}}a(_mo,"_unregisterEvents");function Rve(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=eDt("xx",r).ns[HI](".")):r=t,r}a(Rve,"mergeEvtNamespace");function YUe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=eDt(e,n);if(s=Emo(t,c,r,o),s&&zUe.accept(t)){var l={guid:Amo++,evtName:c,handler:r,capture:o};EYr(t,c.type)[Li](l)}}catch{}return s}a(YUe,"eventOn");function tDt(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=eDt(e,n),c=!1;_mo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||_Yr(t,s,r,o)}catch{}}a(tDt,"eventOff");p();var kve="sampleRate",Pve="ProcessLegacy",KUe="http.method",wW="https://dc.services.visualstudio.com",VN="/v2/track",xy="not_specified";p();var JUe=QPt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var RW="split",mo="length",kW="toLowerCase",vU="ingestionendpoint",bU="toString",rDt="removeItem",Voe="message",xYr="count";var Dve="stringify",Nve="pathname",PW="match";var wy="name";var eA="properties",Ry="measurements",Mve="sizeInBytes",Ove="typeName",Woe="exceptions",DW="severityLevel",ZUe="problemGroup",NW="parsedStack",Bve="hasFullStack",Lve="assembly",WN="fileName",MW="line",zoe="aiDataContract",OW="duration";function nDt(t,e,r){var n=e[mo],o=wYr(t,e);if(o[mo]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Lf(o,0,147)+RYr(s);o=c}return o}a(nDt,"dataSanitizeKeyAndAddUniqueness");function wYr(t,e){var r;return e&&(e=Pi(Lu(e)),e[mo]>150&&(r=Lf(e,0,150),Vr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(wYr,"dataSanitizeKey");function iu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Pi(Lu(e)),e[mo]>r&&(n=Lf(e,0,r),Vr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(iu,"dataSanitizeString");function BW(t,e,r){return yi(e)&&(e=x2t(e,r)),sDt(t,e,2048,66)}a(BW,"dataSanitizeUrl");function Fve(t,e){var r;return e&&e[mo]>32768&&(r=Lf(e,0,32768),Vr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(Fve,"dataSanitizeMessage");function iDt(t,e){var r;if(e){var n=""+e;n[mo]>32768&&(r=Lf(n,0,32768),Vr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(iDt,"dataSanitizeException");function l_(t,e){if(e){var r={};zr(e,function(n,o){if(Fu(o)&&mU())try{o=c_()[Dve](o)}catch(s){Vr(t,2,49,"custom property is not valid",{exception:s},!0)}o=iu(t,o,8192),n=nDt(t,n,r),r[n]=o}),e=r}return e}a(l_,"dataSanitizeProperties");function u_(t,e){if(e){var r={};zr(e,function(n,o){n=nDt(t,n,r),r[n]=o}),e=r}return e}a(u_,"dataSanitizeMeasurements");function oDt(t,e){return e&&sDt(t,e,128,69)[bU]()}a(oDt,"dataSanitizeId");function sDt(t,e,r,n){var o;return e&&(e=Pi(Lu(e)),e[mo]>r&&(o=Lf(e,0,r),Vr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(sDt,"dataSanitizeInput");function RYr(t){var e="00"+t;return Y9e(e,e[mo]-3)}a(RYr,"dsPadNumber");p();var kYr=rf()||{},PYr=0,vmo=[null,null,null,null,null];function DYr(t){var e=PYr,r=vmo,n=r[e];return kYr.createElement?r[e]||(n=r[e]=kYr.createElement("a")):n={host:bmo(t,!0)},n.href=t,e++,e>=r[mo]&&(e=0),PYr=e,n}a(DYr,"urlParseUrl");function bmo(t,e){var r=NYr(t,e)||"";if(r){var n=r[PW](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>3&&yi(n[2])&&n[2][mo]>0)return n[2]+(n[3]||"")}return r}a(bmo,"urlParseHost");function NYr(t,e){var r=null;if(t){var n=t[PW](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[mo]>2&&yi(n[2])&&n[2][mo]>0&&(r=n[2]||"",e&&n[mo]>2)){var o=(n[1]||"")[kW](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(NYr,"urlParseFullHost");var Smo=[wW+VN,"https://breeze.aimon.applicationinsights.io"+VN,"https://dc-int.services.visualstudio.com"+VN];function XUe(t){return Go(Smo,t[kW]())!==-1}a(XUe,"isInternalApplicationInsightsEndpoint");function MYr(t,e,r,n){var o,s=n,c=n;if(e&&e[mo]>0){var l=DYr(e);if(o=l.host,!s)if(l[Nve]!=null){var u=l.pathname[mo]===0?"/":l[Nve];u.charAt(0)!=="/"&&(u="/"+u),c=l[Nve],s=iu(t,r?r+" "+u:u)}else s=iu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(MYr,"AjaxHelperParseDependencyPath");p();p();var e7e=JCe({LocalStorage:0,SessionStorage:1});var Yoe=void 0,OYr="";function BYr(t){try{if(Zt(Ty()))return null;var e=new Date()[bU](),r=ki(t===e7e.LocalStorage?"localStorage":"sessionStorage"),n=OYr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[rDt](n),!o)return r}catch{}return null}a(BYr,"_getVerifiedStorageObject");function aDt(){return t7e()?BYr(e7e.SessionStorage):null}a(aDt,"_getSessionStorageObject");function cDt(t){OYr=t||""}a(cDt,"utlSetStoragePrefix");function t7e(t){return(t||Yoe===void 0)&&(Yoe=!!BYr(e7e.SessionStorage)),Yoe}a(t7e,"utlCanUseSessionStorage");function lDt(t,e){var r=aDt();if(r!==null)try{return r.getItem(e)}catch(n){Yoe=!1,Vr(t,2,2,"Browser failed read of session storage. "+wp(n),{exception:lr(n)})}return null}a(lDt,"utlGetSessionStorage");function uDt(t,e,r){var n=aDt();if(n!==null)try{return n.setItem(e,r),!0}catch(o){Yoe=!1,Vr(t,2,4,"Browser failed write to session storage. "+wp(o),{exception:lr(o)})}return!1}a(uDt,"utlSetSessionStorage");function dDt(t,e){var r=aDt();if(r!==null)try{return r[rDt](e),!0}catch(n){Yoe=!1,Vr(t,2,6,"Browser failed removal of session storage item. "+wp(n),{exception:lr(n)})}return!1}a(dDt,"utlRemoveSessionStorage");p();var Tmo=";",Imo="=";function Uve(t){if(!t)return{};var e=t[RW](Tmo),r=WCe(e,function(o,s){var c=s[RW](Imo);if(c[mo]===2){var l=c[0][kW](),u=c[1];o[l]=u}return o},{});if(Uu(r)[mo]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[vU]=r[vU]||"https://"+n+"dc."+r.endpointsuffix}r[vU]=r[vU]||wW,JB(r[vU],"/")&&(r[vU]=r[vU].slice(0,-1))}return r}a(Uve,"parseConnectionString");p();var fDt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[wy]=iu(e,n)||xy,s.data=r,s.time=hU(new Date),s[zoe]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var aL=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[wy]=iu(e,r)||xy,s[eA]=l_(e,n),s[Ry]=u_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var xmo=58,wmo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,Rmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,kmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,Pmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Dmo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Nmo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,Mmo=/([^\(\s\n]+):([0-9]+)$/,LYr="",Koe="error",zI="stack",hDt="stackDetails",FYr="errorSrc",mDt="message",jYr="description",UYr=[{re:Rmo,len:5,m:1,fn:2,ln:3,col:4},{chk:Bmo,pre:Omo,re:kmo,len:4,m:1,fn:2,ln:3},{re:Pmo,len:3,m:1,fn:2,hdl:qYr},{re:Dmo,len:2,fn:1,hdl:qYr}];function Omo(t){return t.replace(/(\(anonymous\))/,"")}a(Omo,"_scrubAnonymous");function Bmo(t){return nu(t,"[native")<0}a(Bmo,"_ignoreNative");function gDt(t,e){var r=t;return r&&!yi(r)&&(JSON&&JSON[Dve]?(r=JSON[Dve](t),e&&(!r||r==="{}")&&(Mr(t[bU])?r=t[bU]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(gDt,"_stringify");function HYr(t,e){var r=t;return t&&(r&&!yi(r)&&(r=t[mDt]||t[jYr]||r),r&&!yi(r)&&(r=gDt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&nu(r||"",e)===-1&&(r=e+": "+r),r||""}a(HYr,"_formatMessage");function Lmo(t){try{if(Fu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Lmo,"_isExceptionDetailsInternal");function Fmo(t){try{if(Fu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(Fmo,"_isExceptionInternal");function QYr(t){return t&&t.src&&yi(t.src)&&t.obj&&cr(t.obj)}a(QYr,"_isStackDetails");function LW(t){var e=t||"";yi(e)||(yi(e[zI])?e=e[zI]:e=""+e);var r=e[RW](` -`);return{src:e,obj:r}}a(LW,"_convertStackObj");function Umo(t){for(var e=[],r=t[RW](` -`),n=0;n0){e=[];var n=0,o=!1,s=0;yt(r,function(y){if(o||$mo(y)){var E=Lu(y);o=!0;var _=Vmo(E,n);_&&(s+=_[Mve],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[mo]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(qmo,"_parseStack");function r7e(t){var e="";if(t&&(e=t.typeName||t[wy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[bU]());e=n&&n[mo]>1?n[1]:""}catch{}return e}a(r7e,"_getErrorType");function pDt(t){if(t)try{if(!yi(t)){var e=r7e(t),r=gDt(t,!1);return(!r||r==="{}")&&(t[Koe]&&(t=t[Koe],e=r7e(t)),r=gDt(t,!0)),nu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(pDt,"_formatErrorCode");var FW=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,Fmo(r)?(l[Woe]=r[Woe]||[],l[eA]=r[eA],l[Ry]=r[Ry],r[DW]&&(l[DW]=r[DW]),r.id&&(l.id=r.id,r[eA].id=r.id),r[ZUe]&&(l[ZUe]=r[ZUe]),Zt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Woe]=[$Yr(e,r,n)],l[eA]=l_(e,n),l[Ry]=u_(e,o),s&&(l[DW]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=r7e(s||c||e);return{message:HYr(e,d),url:r,lineNumber:n,columnNumber:o,error:pDt(s||c||e),evt:pDt(c||e),typeName:d,stackDetails:GYr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Woe]&&KB(r[Woe],function(l){return Gmo(e,l)}),c=new t(e,$I($I({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&KB(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[Bve]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=pDt,t})();var jmo=_h({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Hmo(){var t=this,e=cr(t[NW])&&KB(t[NW],function(n){return zmo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[Ove],message:t[Voe],hasFullStack:t[Bve],stack:t[zI],parsedStack:e||void 0};return r}a(Hmo,"_toInterface");function $Yr(t,e,r){var n,o,s,c,l,u,d,f;if(Lmo(e))c=e[Ove],l=e[Voe],d=e[zI],f=e[NW]||[],u=e[Bve];else{var h=e,m=h&&h.evt;WB(h)||(h=h[Koe]||m||h),c=iu(t,r7e(h))||xy,l=Fve(t,HYr(e||h,c))||xy;var g=e[hDt]||GYr(e);f=qmo(g),cr(f)&&KB(f,function(A){A[Lve]=iu(t,A[Lve]),A[WN]=iu(t,A[WN])}),d=iDt(t,Qmo(g)),u=cr(f)&&f[mo]>0,r&&(r[Ove]=r[Ove]||c)}return n={},n[zoe]=jmo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[Bve]=u,n.stack=d,n.parsedStack=f,n.toInterface=Hmo,n}a($Yr,"_createExceptionDetails");function Gmo(t,e){var r=cr(e[NW])&&KB(e[NW],function(o){return Wmo(o)})||e[NW],n=$Yr(t,$I($I({},e),{parsedStack:r}));return n}a(Gmo,"_createExDetailsFromInterface");function VYr(t,e){var r=e[PW](Nmo);if(r&&r[mo]>=4)t[WN]=r[1],t[MW]=parseInt(r[2]);else{var n=e[PW](Mmo);n&&n[mo]>=3?(t[WN]=n[1],t[MW]=parseInt(n[2])):t[WN]=e}}a(VYr,"_parseFilename");function qYr(t,e,r){var n=t[WN];e.fn&&r&&r[mo]>e.fn&&(e.ln&&r[mo]>e.ln?(n=Pi(r[e.fn]||""),t[MW]=parseInt(Pi(r[e.ln]||""))||0):n=Pi(r[e.fn]||"")),n&&VYr(t,n)}a(qYr,"_handleFilename");function $mo(t){var e=!1;if(t&&yi(t)){var r=Pi(t);r&&(e=wmo.test(r))}return e}a($mo,"_isStackFrame");var WYr=_h({level:1,method:1,assembly:0,fileName:0,line:0});function Vmo(t,e){var r,n;if(t&&yi(t)&&Pi(t)){n=(r={},r[zoe]=WYr,r.level=e,r.assembly=Pi(t),r.method=LYr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Pi(c[s.m]||LYr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[WN]=Pi(c[s.fn]||""),n[MW]=parseInt(Pi(c[s.ln]||""))||0):VYr(n,c[s.fn]||""));break}o++}}return zYr(n)}a(Vmo,"_extractStackFrame");function Wmo(t){var e,r=(e={},e[zoe]=WYr,e.level=t.level,e.method=t.method,e.assembly=t[Lve],e.fileName=t[WN],e.line=t[MW],e.sizeInBytes=0,e);return zYr(r)}a(Wmo,"_stackFrameFromInterface");function zYr(t){var e=xmo;return t&&(e+=t.method[mo],e+=t.assembly[mo],e+=t.fileName[mo],e+=t.level.toString()[mo],e+=t.line.toString()[mo],t[Mve]=e),t}a(zYr,"_populateFrameSizeInBytes");function zmo(t){return{level:t.level,method:t.method,assembly:t[Lve],fileName:t[WN],line:t[MW]}}a(zmo,"_parsedFrameToInterface");p();p();var YYr=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var cL=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new YYr;h[xYr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[wy]=iu(e,r)||xy,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[eA]=l_(e,u),f[Ry]=u_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var Qve="";function n7e(t){(isNaN(t)||t<0)&&(t=0),t=YWr(t);var e=Qve+t%1e3,r=Qve+B1(t/1e3)%60,n=Qve+B1(t/(1e3*60))%60,o=Qve+B1(t/(1e3*60*60))%24,s=B1(t/(1e3*60*60*24));return e=e[mo]===1?"00"+e:e[mo]===2?"0"+e:e,r=r[mo]<2?"0"+r:r,n=n[mo]<2?"0"+n:n,o=o[mo]<2?"0"+o:o,(s>0?s+".":Qve)+o+":"+n+":"+r+"."+e}a(n7e,"msToTimeSpan");var UW=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=oDt(e,l),u.url=BW(e,n),u[wy]=iu(e,r)||xy,isNaN(o)||(u[OW]=n7e(o)),u[eA]=l_(e,s),u[Ry]=u_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var QW=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[OW]=n7e(s),g.success=c,g.resultCode=l+"",g.type=iu(e,d);var A=MYr(e,n,u,o);g.data=BW(e,o)||A.data,g.target=iu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[wy]=iu(e,A[wy]),g[eA]=l_(e,h),g[Ry]=u_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var qW=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||xy,c[Voe]=Fve(e,r),c[eA]=l_(e,o),c[Ry]=u_(e,s),n&&(c[DW]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var jW=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=BW(e,n),u[wy]=iu(e,r)||xy,u[eA]=l_(e,s),u[Ry]=u_(e,c),l&&(u.domProcessing=l.domProcessing,u[OW]=l[OW],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var lL=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function TU(t){var e="ai."+t+".";return function(r){return e+r}}a(TU,"_aiNameFunc");var qve=TU("application"),F0=TU("device"),i7e=TU("location"),Joe=TU("operation"),ADt=TU("session"),SU=TU("user"),HW=TU("cloud"),jve=TU("internal"),Hve=(function(t){Iy(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(h2t({applicationVersion:qve("ver"),applicationBuild:qve("build"),applicationTypeId:qve("typeId"),applicationId:qve("applicationId"),applicationLayer:qve("layer"),deviceId:F0("id"),deviceIp:F0("ip"),deviceLanguage:F0("language"),deviceLocale:F0("locale"),deviceModel:F0("model"),deviceFriendlyName:F0("friendlyName"),deviceNetwork:F0("network"),deviceNetworkName:F0("networkName"),deviceOEMName:F0("oemName"),deviceOS:F0("os"),deviceOSVersion:F0("osVersion"),deviceRoleInstance:F0("roleInstance"),deviceRoleName:F0("roleName"),deviceScreenResolution:F0("screenResolution"),deviceType:F0("type"),deviceMachineName:F0("machineName"),deviceVMName:F0("vmName"),deviceBrowser:F0("browser"),deviceBrowserVersion:F0("browserVersion"),locationIp:i7e("ip"),locationCountry:i7e("country"),locationProvince:i7e("province"),locationCity:i7e("city"),operationId:Joe("id"),operationName:Joe("name"),operationParentId:Joe("parentId"),operationRootId:Joe("rootId"),operationSyntheticSource:Joe("syntheticSource"),operationCorrelationVector:Joe("correlationVector"),sessionId:ADt("id"),sessionIsFirst:ADt("isFirst"),sessionIsNew:ADt("isNew"),userAccountAcquisitionDate:SU("accountAcquisitionDate"),userAccountId:SU("accountId"),userAgent:SU("userAgent"),userId:SU("id"),userStoreRegion:SU("storeRegion"),userAuthUserId:SU("authUserId"),userAnonymousUserAcquisitionDate:SU("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:SU("authUserAcquisitionDate"),cloudName:HW("name"),cloudRole:HW("role"),cloudRoleVer:HW("roleVer"),cloudRoleInstance:HW("roleInstance"),cloudEnvironment:HW("environment"),cloudLocation:HW("location"),cloudDeploymentUnit:HW("deploymentUnit"),internalNodeName:jve("nodeName"),internalSdkVersion:jve("sdkVersion"),internalAgentVersion:jve("agentVersion"),internalSnippet:jve("snippet"),internalSdkSrc:jve("sdkSrc")}));p();var bh=new Hve;p();function KYr(t,e){tDt(t,null,null,e)}a(KYr,"_disableEvents");function yDt(t){var e=rf(),r=Qu(),n=!1,o=[],s=1;r&&!Zt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=Rve(G1("OfflineListener"),t);try{if(f(nf())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=YUe(b,"online",y,u),T&&YUe(b,"offline",E,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var b=m();l!==b&&(l=b,yt(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=nf();if(b&&n){if(KYr(b,u),e){var T=e.body||e;Pn(T.ononline)||KYr(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(yDt,"createOfflineListener");var o7e="AppInsightsChannelPlugin";p();p();p();p();p();var IU="duration";p();var Sh="tags",s7e="deviceType",iv="data",zN="name",GW="traceID",Oo="length",xU="stringify",wU="measurements",YI="dataType",RU="envelopeType",uL="toString",dL="enqueue",fL="count",KI="push",Gve="emitLineDelimitedJson",kU="clear",Zoe="markAsSent",$W="clearSent",$ve="bufferOverride",Xoe="BUFFER_KEY",pL="SENT_BUFFER_KEY",PU="concat",ese="MAX_BUFFER_SIZE",tse="triggerSend",tA="diagLog",a7e="initialize",rse="_sender",nse="endpointUrl",ise="instrumentationKey",c7e="customHeaders",EDt="maxBatchSizeInBytes",l7e="onunloadDisableBeacon",u7e="isBeaconApiDisabled",_Dt="alwaysUseXhrOverride",CDt="enableSessionStorageBuffer",Pk="_buffer",vDt="onunloadDisableFetch",bDt="disableSendBeaconSplit",Vve="getSenderInst",DU="_onError",d7e="_onPartialSuccess",Wve="_onSuccess",f7e="itemsReceived",p7e="itemsAccepted",h7e="baseType",ose="sampleRate",JYr="getHashCodeScore";var SDt="baseType",xd="baseData",Um="properties",ZYr="true";function Rp(t,e,r){return HN(t,e,r,M1)}a(Rp,"_setValueIf");function Ymo(t,e,r){var n=r[Sh]=r[Sh]||{},o=e.ext=e.ext||{},s=e[Sh]=e[Sh]||[],c=o.user;c&&(Rp(n,bh.userAuthUserId,c.authId),Rp(n,bh.userId,c.id||c.localId));var l=o.app;l&&Rp(n,bh.sessionId,l.sesId);var u=o.device;u&&(Rp(n,bh.deviceId,u.id||u.localId),Rp(n,bh[s7e],u.deviceClass),Rp(n,bh.deviceIp,u.ip),Rp(n,bh.deviceModel,u.model),Rp(n,bh[s7e],u[s7e]));var d=e.ext.web;if(d){Rp(n,bh.deviceLanguage,d.browserLang),Rp(n,bh.deviceBrowserVersion,d.browserVer),Rp(n,bh.deviceBrowser,d.browser);var f=r[iv]=r[iv]||{},h=f[xd]=f[xd]||{},m=h[Um]=h[Um]||{};Rp(m,"domain",d.domain),Rp(m,"isManual",d.isManual?ZYr:null),Rp(m,"screenRes",d.screenRes),Rp(m,"userConsent",d.userConsent?ZYr:null)}var g=o.os;g&&(Rp(n,bh.deviceOS,g[zN]),Rp(n,bh.deviceOSVersion,g.osVer));var A=o.trace;A&&(Rp(n,bh.operationParentId,A.parentID),Rp(n,bh.operationName,iu(t,A[zN])),Rp(n,bh.operationId,A[GW]));for(var y={},E=s[Oo]-1;E>=0;E--){var _=s[E];zr(_,function(b,T){y[b]=T}),s.splice(E,1)}zr(s,function(b,T){y[b]=T});var v=$I($I({},n),y);v[bh.internalSdkVersion]||(v[bh.internalSdkVersion]=iu(t,"javascript:".concat(Kmo.Version),64)),r[Sh]=IUe(v)}a(Ymo,"_extractPartAExtensions");function NU(t,e,r){Zt(t)||zr(t,function(n,o){Eh(o)?r[n]=o:yi(o)?e[n]=o:mU()&&(e[n]=c_()[xU](o))})}a(NU,"_extractPropsAndMeasurements");function VW(t,e){Zt(t)||zr(t,function(r,n){t[r]=n||e})}a(VW,"_convertPropsUndefinedToCustomDefinedValue");function WW(t,e,r,n){var o=new fDt(t,n,e);Rp(o,"sampleRate",r[kve]),(r[xd]||{}).startTime&&(o.time=hU(r[xd].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[zN]=o[zN].replace("{0}",s),Ymo(t,r,o),r[Sh]=r[Sh]||[],IUe(o)}a(WW,"_createEnvelope");function zW(t,e){Zt(e[xd])&&Vr(t,1,46,"telemetryItem.baseData cannot be null.")}a(zW,"EnvelopeCreatorInit");var Kmo={Version:"3.3.11"};function XYr(t,e,r){zW(t,e);var n=e[xd][wU]||{},o=e[xd][Um]||{};NU(e[iv],o,n),Zt(r)||VW(o,r);var s=e[xd];if(Zt(s))return oL(t,"Invalid input for dependency data"),null;var c=s[Um]&&s[Um][KUe]?s[Um][KUe]:"GET",l=new QW(t,s.id,s.target,s[zN],s[IU],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new lL(QW[YI],l);return WW(t,QW[RU],e,u)}a(XYr,"DependencyEnvelopeCreator");function TDt(t,e,r){zW(t,e);var n={},o={};e[SDt]!==aL[YI]&&(n.baseTypeSource=e[SDt]),e[SDt]===aL[YI]?(n=e[xd][Um]||{},o=e[xd][wU]||{}):e[xd]&&NU(e[xd],n,o),NU(e[iv],n,o),Zt(r)||VW(n,r);var s=e[xd][zN],c=new aL(t,s,n,o),l=new lL(aL[YI],c);return WW(t,aL[RU],e,l)}a(TDt,"EventEnvelopeCreator");function eKr(t,e,r){zW(t,e);var n=e[xd][wU]||{},o=e[xd][Um]||{};NU(e[iv],o,n),Zt(r)||VW(o,r);var s=e[xd],c=FW.CreateFromInterface(t,s,o,n),l=new lL(FW[YI],c);return WW(t,FW[RU],e,l)}a(eKr,"ExceptionEnvelopeCreator");function tKr(t,e,r){zW(t,e);var n=e[xd],o=n[Um]||{},s=n[wU]||{};NU(e[iv],o,s),Zt(r)||VW(o,r);var c=new cL(t,n[zN],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new lL(cL[YI],c);return WW(t,cL[RU],e,l)}a(tKr,"MetricEnvelopeCreator");function rKr(t,e,r){zW(t,e);var n,o=e[xd];!Zt(o)&&!Zt(o[Um])&&!Zt(o[Um][IU])?(n=o[Um][IU],delete o[Um][IU]):!Zt(e[iv])&&!Zt(e[iv][IU])&&(n=e[iv][IU],delete e[iv][IU]);var s=e[xd],c;((e.ext||{}).trace||{})[GW]&&(c=e.ext.trace[GW]);var l=s.id||c,u=s[zN],d=s.uri,f=s[Um]||{},h=s[wU]||{};if(Zt(s.refUri)||(f.refUri=s.refUri),Zt(s.pageType)||(f.pageType=s.pageType),Zt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[uL]()),!Zt(s[Um])){var m=s[Um];zr(m,function(y,E){f[y]=E})}NU(e[iv],f,h),Zt(r)||VW(f,r);var g=new UW(t,u,d,n,f,h,l),A=new lL(UW[YI],g);return WW(t,UW[RU],e,A)}a(rKr,"PageViewEnvelopeCreator");function nKr(t,e,r){zW(t,e);var n=e[xd],o=n[zN],s=n.uri||n.url,c=n[Um]||{},l=n[wU]||{};NU(e[iv],c,l),Zt(r)||VW(c,r);var u=new jW(t,o,s,void 0,c,l,n),d=new lL(jW[YI],u);return WW(t,jW[RU],e,d)}a(nKr,"PageViewPerformanceEnvelopeCreator");function iKr(t,e,r){zW(t,e);var n=e[xd].message,o=e[xd].severityLevel,s=e[xd][Um]||{},c=e[xd][wU]||{};NU(e[iv],s,c),Zt(r)||VW(s,r);var l=new qW(t,n,o,s,c),u=new lL(qW[YI],l);return WW(t,qW[RU],e,u)}a(iKr,"TraceEnvelopeCreator");p();var oKr=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},bi(t,this,function(c){c[dL]=function(l){if(c[fL]()>=r.eventsLimitInMem){o||(Vr(e,2,105,"Maximum in-memory buffer size reached: "+c[fL](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Zt(s)&&l.cnt>s)&&n[KI](l)},c[fL]=function(){return n[Oo]},c.size=function(){for(var l=n[Oo],u=0;u0){var u=[];yt(l,function(f){u[KI](f.item)});var d=r[Gve]?u.join(` -`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new IDt(l,u):new m7e(l,u);return yt(f,function(m){h[dL](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),m7e=(function(t){Iy(e,t);function e(r,n){var o=t.call(this,r,n)||this;return bi(e,o,function(s,c){s[Zoe]=function(l){c[kU]()},s[$W]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(oKr);var Jmo=["AI_buffer","AI_sentBuffer"],IDt=(function(t){Iy(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[$ve]||{getItem:lDt,setItem:uDt},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return bi(e,s,function(m,g){var A=T(e[Xoe]),y=T(e[pL]),E=x(),_=y[PU](E),v=m._set(A[PU](_));v[Oo]>e[ese]&&(v[Oo]=e[ese]),R(e[pL],[]),R(e[Xoe],v),m[dL]=function(D){if(m[fL]()>=e[ese]){c||(Vr(n,2,67,"Maximum buffer size reached: "+m[fL](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Zt(h)&&D.cnt>h)&&(g[dL](D),R(e[Xoe],m._get()))},m[kU]=function(){g[kU](),R(e[Xoe],m._get()),R(e[pL],[]),c=!1},m[Zoe]=function(D){R(e[Xoe],m._set(b(D,m._get())));var N=T(e[pL]);N instanceof Array&&D instanceof Array&&(N=N[PU](D),N[Oo]>e[ese]&&(Vr(n,1,67,"Sent buffer reached its maximum size: "+N[Oo],!0),N[Oo]=e[ese]),R(e[pL],N))},m[$W]=function(D){var N=T(e[pL]);N=b(D,N),R(e[pL],N)},m.createNew=function(D,N,L){L=!!L;var B=m._get().slice(0),Q=T(e[pL]).slice(0);D=D||n,N=N||{},m[kU]();var M=L?new e(D,N):new m7e(D,N);return yt(B,function(O){M[dL](O)}),L&&M[Zoe](Q),M};function b(D,N){var L=[],B=[];return yt(D,function(Q){B[KI](Q.item)}),yt(N,function(Q){!Mr(Q)&&Go(B,Q.item)===-1&&L[KI](Q)}),L}a(b,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var L=c_().parse(N);if(yi(L)&&(L=c_().parse(L)),L&&cr(L))return L}}catch(B){Vr(n,1,42," storage key: "+D+", "+wp(B),{exception:lr(B)})}return[]}a(w,"_getBufferBase");function R(D,N){var L=D;try{L=l?l+"_"+L:L;var B=JSON[xU](N);f(n,L,B)}catch(Q){f(n,L,JSON[xU]([])),Vr(n,2,41," storage key: "+L+", "+wp(Q)+". Buffer cleared",{exception:lr(Q)})}}a(R,"_setBuffer");function x(){var D=[];try{return yt(Jmo,function(N){var L=k(N);if(D=D[PU](L),l){var B=l+"_"+N,Q=k(B);D=D[PU](Q)}}),D}catch(N){Vr(n,2,41,"Transfer events from previous buffers: "+wp(N)+". previous Buffer items can not be removed",{exception:lr(N)})}return[]}a(x,"_getPreviousEvents");function k(D){try{var N=w(D),L=[];return yt(N,function(B){var Q={item:B,cnt:0};L[KI](Q)}),dDt(n,D),L}catch{}return[]}a(k,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(oKr);p();var sKr=(function(){function t(e){bi(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return c_()[xU](l)}catch(u){Vr(e,1,48,u&&Mr(u[uL])?u[uL]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Vr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Vr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(cr(c))d=o(c,l);else{Vr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{c_()[xU](c),d=c}catch(f){Vr(e,1,48,f&&Mr(f[uL])?f[uL]():"Error serializing object",null,!0)}}return d}return c[u]=!0,zr(c.aiDataContract,function(f,h){var m=Mr(h)?h()&1:h&1,g=Mr(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Fu(c[f])&&c[f]!==null;if(m&&!y&&!A)Vr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!cr(c))Vr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r -`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[ose]=e,this.samplingScoreGenerator=new cKr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[ose],n=!1;return r==null||r>=100||e.baseType===cL[YI]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(tgo,"_chkSampling");var rgo=(hL={},hL[aL.dataType]=TDt,hL[qW.dataType]=iKr,hL[UW.dataType]=rKr,hL[jW.dataType]=nKr,hL[FW.dataType]=eKr,hL[cL.dataType]=tKr,hL[QW.dataType]=XYr,hL),xDt=(function(t){Iy(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=o7e;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F,U,W,V,G,Y,re;return bi(e,r,function(j,X){ut(),j.pause=function(){xe(),c=!0},j.resume=function(){c&&(c=!1,o=null,Je(),mt())},j.flush=function(ee,pe,ke){if(ee===void 0&&(ee=!0),!c){xe();try{var Le=j[tse](ee,null,ke||1);return ml(Le,function(Ve){return pe?(pe(!Ve.rejected),!0):ee?Id(function(tt){tt(!Ve.rejected)}):Le})}catch(Ve){Vr(j[tA](),1,22,"flush failed, telemetry will not be collected: "+wp(Ve),{exception:lr(Ve)})}}},j.onunloadFlush=function(){if(!c)if(v||O)try{return j[tse](!0,Ot,2)}catch(ee){Vr(j[tA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+wp(ee),{exception:lr(ee)})}else j.flush(!1)},j.addHeader=function(ee,pe){f[ee]=pe},j[a7e]=function(ee,pe,ke,Le){j.isInitialized()&&Vr(j[tA](),1,28,"Sender is already initialized"),X[a7e](ee,pe,ke,Le);var Ve=j.identifier;u=new sKr(pe.logger),n=0,o=null,s=0,j[rse]=null,d=0;var tt=j[tA]();A=Rve(G1("Sender"),pe.evtNamespace&&pe.evtNamespace()),g=yDt(A),j._addHook(VI(ee,function(vt){var Nt=vt.cfg;Nt.storagePrefix&&cDt(Nt.storagePrefix);var Vt=Rk(null,Nt,pe),It=Vt.getExtCfg(Ve,fKr),Be=It[nse];if(y&&Be===y){var oe=Nt[nse];oe&&oe!==Be&&(It[nse]=oe)}var ve=ki("CompressionStream");re=m2t("zipPayload",Nt,!1),Mr(ve)||(re=!1);var Se=It.corsPolicy;Se?(Se==="same-origin"||Se==="same-site"||Se==="cross-origin")&&r.addHeader(pKr,Se):delete f[pKr],Lm(It[ise])&&(It[ise]=Nt[ise]),Hi(j,"_senderConfig",{g:a(function(){return It},"g")}),E!==It[nse]&&(y=E=It[nse]),pe.activeStatus()===Sk.PENDING?j.pause():pe.activeStatus()===Sk.ACTIVE&&j.resume(),w&&w!==It[c7e]&&yt(w,function(_r){delete f[_r.header]}),_=It[EDt],v=(It[l7e]===!1||It[u7e]===!1)&&gU(),b=It[l7e]===!1&&gU(),T=It[u7e]===!1&&gU(),O=It[_Dt],q=!!It.disableXhr,Y=It.retryCodes;var de=It[$ve],te=!!It[CDt]&&(!!de||t7e()),Fe=It.namePrefix,et=te!==L||te&&Q!==Fe||te&&B!==de;if(j[Pk]){if(et)try{j[Pk]=j[Pk].createNew(tt,It,te)}catch(_r){Vr(j[tA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+wp(_r),{exception:lr(_r)})}Je()}else j[Pk]=te?new IDt(tt,It):new m7e(tt,It);Q=Fe,L=te,B=de,F=!It[vDt]&&mve(!0),V=!!It[bDt],j._sample=new lKr(It.samplingPercentage,tt),x=It[ise],!Lm(x)&&!ct(x,Nt)&&Vr(tt,1,100,"Invalid Instrumentation key "+x),w=It[c7e],yi(y)&&!XUe(y)&&w&&w[Oo]>0?yt(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=It.enableSendPromise;var Ht=we();G?G.SetConfig(Ht):(G=new Z2t,G[a7e](Ht,tt));var mr=It.httpXHROverride,or=null,Nr=null,Hr=wUe([3,1,2],It.transports);or=G&&G[Vve](Hr,!1);var Gr=G&&G.getFallbackInst();U=a(function(_r,wm){return Ie(Gr,_r,wm)},"_xhrSend"),W=a(function(_r,wm){return Ie(Gr,_r,wm,!1)},"_fallbackSend"),or=O?mr:or||mr||Gr,j[rse]=function(_r,wm){return Ie(or,_r,wm)},F&&(m=Ee);var zt=wUe([3,1],It.unloadTransports);F||(zt=zt.filter(function(_r){return _r!==2})),Nr=G&&G[Vve](zt,!0),Nr=O?mr:Nr||mr,(O||It.unloadTransports||!m)&&Nr&&(m=a(function(_r,wm){return Ie(Nr,_r,wm)},"_syncUnloadSender")),m||(m=U),R=It.disableTelemetry,k=It.convertUndefined||Dk,D=It.isRetryDisabled,N=It.maxBatchInterval}))},j.processTelemetry=function(ee,pe){pe=j._getTelCtx(pe);var ke=pe[tA]();try{var Le=z(ee,ke);if(!Le)return;var Ve=le(ee,ke);if(!Ve)return;var tt=u.serialize(Ve),vt=j[Pk];Je(tt);var Nt={item:tt,cnt:0};vt[dL](Nt),mt()}catch(Vt){Vr(ke,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+wp(Vt),{exception:lr(Vt)})}j.processNext(ee,pe)},j.isCompletelyIdle=function(){return!c&&h===0&&j._buffer[fL]()===0},j.getOfflineListener=function(){return g},j._xhrReadyStateChange=function(ee,pe,ke){if(!Gt(pe))return Ae(ee,pe,ke)},j[tse]=function(ee,pe,ke){ee===void 0&&(ee=!0);var Le;if(!c)try{var Ve=j[Pk];if(R)Ve[kU]();else{if(Ve[fL]()>0){var tt=Ve.getItems();at(ke||0,ee),pe?Le=pe.call(j,tt,ee):Le=j[rse](tt,ee)}s=+new Date}xe()}catch(Nt){var vt=T2t();(!vt||vt>9)&&Vr(j[tA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+wp(Nt),{exception:lr(Nt)})}return Le},j.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:Me,serialize:K,batch:ae,shouldProcess:a(function(ee){return!!z(ee)},"shouldProcess")}},j._doTeardown=function(ee,pe){j.onunloadFlush(),iL(g,!1),ut()},j[DU]=function(ee,pe,ke){if(!Gt(ee))return De(ee,pe,ke)},j[d7e]=function(ee,pe){if(!Gt(ee))return Te(ee,pe)},j[Wve]=function(ee,pe){if(!Gt(ee))return Z(ee,pe)},j._xdrOnLoad=function(ee,pe){if(!Gt(pe))return ie(ee,pe)};function ie(ee,pe){var ke=dKr(ee);if(ee&&(ke+""=="200"||ke===""))n=0,j[Wve](pe,0);else{var Le=wve(ke);Le&&Le[f7e]&&Le[f7e]>Le[p7e]&&!D?j[d7e](pe,Le):j[DU](pe,fve(ee))}}a(ie,"_xdrOnLoad");function we(){try{var ee={xdrOnComplete:a(function(ke,Le,Ve){var tt=J(Ve);if(tt)return ie(ke,tt)},"xdrOnComplete"),fetchOnComplete:a(function(ke,Le,Ve,tt){var vt=J(tt);if(vt)return Xe(ke.status,vt,ke.url,vt[Oo],ke.statusText,Ve||"")},"fetchOnComplete"),xhrOnComplete:a(function(ke,Le,Ve){var tt=J(Ve);if(tt)return Ae(ke,tt,tt[Oo])},"xhrOnComplete"),beaconOnRetry:a(function(ke,Le,Ve){return $t(ke,Le,Ve)},"beaconOnRetry")},pe={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:q,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:ee};return pe}catch{}return null}a(we,"_getSendPostMgrConfig");function Ae(ee,pe,ke){ee.readyState===4&&Xe(ee.status,pe,ee.responseURL,ke,TW(ee),dKr(ee)||ee.response)}a(Ae,"_xhrReadyStateChange");function De(ee,pe,ke){Vr(j[tA](),2,26,"Failed to send telemetry.",{message:pe}),j._buffer&&j._buffer[$W](ee)}a(De,"_onError");function Te(ee,pe){for(var ke=[],Le=[],Ve=pe.errors.reverse(),tt=0,vt=Ve;tt0&&j[Wve](ee,pe[p7e]),ke[Oo]>0&&j[DU](ke,TW(null,["partial success",pe[p7e],"of",pe.itemsReceived].join(" "))),Le[Oo]>0&&(Qe(Le),Vr(j[tA](),2,40,"Partial success. Delivered: "+ee[Oo]+", Failed: "+ke[Oo]+". Will retry to send "+Le[Oo]+" our of "+pe[f7e]+" items"))}a(Te,"_onPartialSuccess");function Z(ee,pe){j._buffer&&j._buffer[$W](ee)}a(Z,"_onSuccess");function J(ee){try{if(ee){var pe=ee,ke=pe.oriPayload;return ke&&ke[Oo]?ke:null}}catch{}return null}a(J,"_getPayloadArr");function z(ee,pe){if(R)return!1;if(!ee)return pe&&Vr(pe,1,7,"Cannot send empty telemetry"),!1;if(ee.baseData&&!ee[h7e])return pe&&Vr(pe,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(ee[h7e]||(ee[h7e]="EventData"),!j[rse])return pe&&Vr(pe,1,28,"Sender was not initialized"),!1;if(ne(ee))ee[kve]=j._sample[ose];else return pe&&Vr(pe,2,33,"Telemetry item was sampled out and not sent",{SampleRate:j._sample[ose]}),!1;return!0}a(z,"_validate");function le(ee,pe){var ke=ee.iKey||x,Le=e.constructEnvelope(ee,ke,pe,k);if(!Le){Vr(pe,1,47,"Unable to create an AppInsights envelope");return}var Ve=!1;if(ee[Sh]&&ee[Sh][Pve]&&(yt(ee[Sh][Pve],function(tt){try{tt&&tt(Le)===!1&&(Ve=!0,oL(pe,"Telemetry processor check returns false"))}catch(vt){Vr(pe,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+wp(vt),{exception:lr(vt)},!0)}}),delete ee[Sh][Pve]),!Ve)return Le}a(le,"_getEnvelope");function K(ee){var pe=uKr,ke=j[tA]();try{var Le=z(ee,ke),Ve=null;Le&&(Ve=le(ee,ke)),Ve&&(pe=u.serialize(Ve))}catch{}return pe}a(K,"_serialize");function ae(ee){var pe=uKr;return ee&&ee[Oo]&&(pe="["+ee.join(",")+"]"),pe}a(ae,"_batch");function Me(ee){var pe=Re();return{urlString:y,data:ee,headers:pe}}a(Me,"_createPayload");function ne(ee){return j._sample.isSampledIn(ee)}a(ne,"_isSampledIn");function se(ee,pe,ke,Le){pe===200&&ee?j._onSuccess(ee,ee[Oo]):Le&&j[DU](ee,Le)}a(se,"_getOnComplete");function Ie(ee,pe,ke,Le){Le===void 0&&(Le=!0);var Ve=a(function(oe,ve,Se){return se(pe,oe,ve,Se)},"onComplete"),tt=_e(pe),vt=ee&&ee.sendPOST;if(vt&&tt){Le&&j._buffer[Zoe](pe);var Nt,Vt=!1,It,Be;return G.preparePayload(function(oe){Nt=vt(oe,Ve,!ke),Vt=!0,It&&gUe(Nt,It,Be)},re,tt,!ke),Vt?Nt:Id(function(oe,ve){It=oe,Be=ve})}return null}a(Ie,"_doSend");function _e(ee){if(cr(ee)&&ee[Oo]>0){var pe=j[Pk].batchPayloads(ee),ke=Re(),Le={data:pe,urlString:y,headers:ke,disableXhrSync:q,disableFetchKeepAlive:!F,oriPayload:ee};return Le}return null}a(_e,"_getPayload");function Re(){try{var ee=f||{};return XUe(y)&&(ee[JUe[6]]=JUe[7]),ee}catch{}return null}a(Re,"_getHeaders");function Je(ee){var pe=ee?ee[Oo]:0;return j[Pk].size()+pe>_?((!g||g.isOnline())&&j[tse](!0,null,10),!0):!1}a(Je,"_checkMaxSize");function Xe(ee,pe,ke,Le,Ve,tt){var vt=null;if(j._appId||(vt=wve(tt),vt&&vt.appId&&(j._appId=vt.appId)),(ee<200||ee>=300)&&ee!==0){if((ee===301||ee===307||ee===308)&&!Ct(ke)){j[DU](pe,Ve);return}if(g&&!g.isOnline()){if(!D){var Nt=10;Qe(pe,Nt),Vr(j[tA](),2,40,". Offline - Response Code: ".concat(ee,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(pe.length," items."))}return}!D&&He(ee)?(Qe(pe),Vr(j[tA](),2,40,". Response code "+ee+". Will retry to send "+pe[Oo]+" items.")):j[DU](pe,Ve)}else Ct(ke),ee===206?(vt||(vt=wve(tt)),vt&&!D?j[d7e](pe,vt):j[DU](pe,Ve)):(n=0,j[Wve](pe,Le))}a(Xe,"_checkResponsStatus");function Ct(ee){return d>=10?!1:!Zt(ee)&&ee!==""&&ee!==y?(y=ee,++d,!0):!1}a(Ct,"_checkAndUpdateEndPointUrl");function Ot(ee,pe){if(m)m(ee,!1);else{var ke=G&&G[Vve]([3],!0);return Ie(ke,ee,pe)}}a(Ot,"_doUnloadSend");function $t(ee,pe,ke){var Le=ee,Ve=Le&&Le.oriPayload;if(V)W&&W(Ve,!0),Vr(j[tA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var tt=[],vt=0;vt0&&(W&&W(tt,!0),Vr(j[tA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a($t,"_onBeaconRetry");function Gt(ee){try{if(ee&&ee[Oo])return yi(ee[0])}catch{}return null}a(Gt,"_isStringArr");function Ee(ee,pe){var ke=null;if(cr(ee)){for(var Le=ee[Oo],Ve=0;Ve-1}a(He,"_isRetriable");function Ze(){var ee="getNotifyMgr",pe,ke=j.core;return ke&&(ke[ee]?pe=ke[ee]():pe=ke._notificationManager),pe}a(Ze,"_getNotifyMgr");function at(ee,pe){var ke=Ze();if(ke&&ke.eventsSendRequest)try{ke.eventsSendRequest(ee,pe)}catch(Le){Vr(j[tA](),1,74,"send request notification failed: "+wp(Le),{exception:lr(Le)})}}a(at,"_notifySendRequest");function ct(ee,pe){var ke=pe.disableInstrumentationKeyValidation,Le=Zt(ke)?!1:ke;if(Le)return!0;var Ve="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",tt=new RegExp(Ve);return tt.test(ee)}a(ct,"_validateInstrumentationKey");function ut(){j[rse]=null,j[Pk]=null,j._appId=null,j._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,E=null,_=0,v=!1,w=null,R=!1,x=null,k=Dk,D=!1,L=null,Q=Dk,q=!1,F=!1,V=!1,U=null,W=null,G=null,Hi(j,"_senderConfig",{g:a(function(){return xUe({},fKr)},"g")})}a(ut,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Zt(n)?c=$I($I({},r),{iKey:n}):c=r;var l=rgo[c.baseType]||TDt;return l(o,c,s)},e})(xve);p();var YW="instrumentationKey",zve="connectionString",sse="endpointUrl",ase="userOverrideEndpointUrl";var KW,wDt,RDt=void 0,ngo=(KW={diagnosticLogInterval:qoe(igo,1e4)},KW[zve]=RDt,KW.endpointUrl=RDt,KW[YW]=RDt,KW.featureOptIn=(wDt={},wDt.zipPayload={mode:1},wDt),KW.extensionConfig={},KW);function igo(t){return t&&t>0}a(igo,"_chkDiagLevel");var hKr=(function(){function t(e){var r=new K2t,n;(Zt(e)||Zt(e[YW])&&Zt(e[zve]))&&Kc("Invalid input configuration"),bi(t,this,function(s){Hi(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,SW(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=vh(e||{},ngo);n=l.cfg,r.addUnloadHook(VI(l,function(){var u=n[zve];if(Lm(u)){var d=lve(function(g,A){ml(u,function(y){var E=y.value,_=n[YW];if(!y.rejected&&E){n[zve]=E;var v=Uve(E);_=v.instrumentationkey||_}g(_)})}),f=lve(function(g,A){ml(u,function(y){var E=y.value,_=n[sse];if(!y.rejected&&E){var v=Uve(E),b=v.ingestionendpoint;_=b?b+VN:_}g(_)})});n[YW]=d,n[sse]=n[ase]||f}if(yi(u)){var h=Uve(u),m=h.ingestionendpoint;n[sse]=n[ase]?n[ase]:m+VN,n[YW]=h.instrumentationkey||n[YW]}n[sse]=n[ase]?n[ase]:n[sse]})),r.initialize(n,[new xDt])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var $1=ce(require("os"));var JW=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.options=n;this.onCopilotToken=a(e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json",this.options?.includeAuthorizationHeader&&this.token&&(n.Authorization=`Bearer ${this.token.token}`);let o={method:"POST",headers:n,body:e.data};this.ctx.get(ar).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new hKr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[o7e]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:ogo(e),this.commonProperties=n?.excludeCommonProperties?{}:sgo(e),this.#e=Es(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function ogo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${$1.type()} ${$1.release()}`,e["ai.device.osArchitecture"]=$1.arch(),e["ai.device.osPlatform"]=$1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ss).getVersion(),e}a(ogo,"getTags");function sgo(t){let e={};e.common_os=$1.platform(),e.common_platformversion=$1.release(),e.common_arch=$1.arch(),e.common_cpu=Array.from(new Set($1.cpus().map(n=>n.model))).join();let r=t.get(Fa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(sgo,"getCommonProperties");p();p();p();p();p();p();var Yve=z9e;var YN=Yve({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var MU=Yve({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var ZW="toLowerCase",vn="length",cse="warnToConsole",mL="throwInternal",KN="watch",OU="apply",ro="push",JI="splice",ju="logger",JN="cancel",gL="initialize",ZN="identifier",lse="removeNotificationListener",use="addNotificationListener",ov="isInitialized",Kve="getNotifyMgr",BU="getPlugin",Nk="name",U0="processNext",g7e="getProcessTelContext",AL="value",LU="enabled",kDt="stopPollingInternalLogs",ZI="unload",Jve="onComplete",A7e="version",y7e="loggingLevelConsole",XN="createNew",V1="teardown",dse="messageId",eM="message",sv="diagLog",FU="_doTeardown",XW="update",W1="getNext",UU="setNextPlugin",Zve="userAgent",yL="split",Mk="replace",PDt="substring",E7e="indexOf",EL="type",DDt="evtName",Ok="status",NDt="getAllResponseHeaders",Xve="isChildEvt",z1="data",ez="getCtx",Bk="setCtx";var ebe="headers",fse="urlString",tz="timeout";var _7e="traceFlags";var MDt;function mKr(t,e){MDt||(MDt=zCe("AggregationError",function(n,o){o[vn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw yt(e,function(n,o){r+=` -`.concat(o," > ").concat(lr(n))}),new MDt(r,e||[])}a(mKr,"throwAggregationError");p();p();p();p();p();var Y1=void 0,Cs="",rz="channels",Uf="core",C7e="createPerfMgr",tbe="disabled",_L="extensionConfig",nz="extensions",av="processTelemetry",iz="priority",pse="eventsSent",QU="eventsDiscarded",hse="eventsSendRequest",tM="perfEvent",v7e="offlineEventsStored",b7e="offlineBatchSent",S7e="offlineBatchDrop",mse="getPerfMgr",T7e="domain",I7e="path",gKr="Not dynamic - ";var ago="getPrototypeOf",cgo=/-([a-z])/g,lgo=/([^\w\d_$])/g,ugo=/^(\d+[\w\d_$])/,gDl=Object[ago];function qU(t){return!Zt(t)}a(qU,"isNotNullOrUndefined");function gse(t){var e=t;return e&&yi(e)&&(e=e[Mk](cgo,function(r,n){return n.toUpperCase()}),e=e[Mk](lgo,"_"),e=e[Mk](ugo,function(r,n){return"_"+n})),e}a(gse,"normalizeJsName");function Qm(t,e){return t&&e?nu(t,e)!==-1:!1}a(Qm,"strContains");function Ase(t){return t&&t.toISOString()||""}a(Ase,"toISOString");function yse(t){return WB(t)?t[Nk]:Cs}a(yse,"getExceptionName");function CL(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(CL,"setValue");function x7e(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Pn(r)?{}:r,t[e]=n)):n=Pn(r)?{}:r,n}a(x7e,"getSetValue");function dgo(t,e){var r=null,n=null;return Mr(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][OU](n,o)}}a(dgo,"_createProxyFunction");function jU(t,e,r,n,o){t&&e&&r&&(o!==!1||Pn(t[e]))&&(t[e]=dgo(r,n))}a(jU,"proxyFunctionAs");function HU(t,e,r,n){return t&&e&&Fu(t)&&cr(r)&&yt(r,function(o){yi(o)&&jU(t,o,e,o,n)}),t}a(HU,"proxyFunctions");function rM(t){return t&&zB&&(t=dU(zB({},t))),t}a(rM,"optimizeObject");function w7e(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(w7e,"isFeatureEnabled");function nM(t){try{return t.responseText}catch{}return null}a(nM,"getResponseText");function R7e(t,e){return t?"XDomainRequest,Response:"+nM(t)||"":e}a(R7e,"formatErrorMessageXdr");function nbe(t,e){return t?"XMLHttpRequest,Status:"+t[Ok]+",Response:"+nM(t)||t.response||"":e}a(nbe,"formatErrorMessageXhr");function ibe(t,e){return e&&(Eh(e)?t=[e].concat(t):cr(e)&&(t=e.concat(t))),t}a(ibe,"prependTransports");var fgo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",AKr="withCredentials",pgo="timeout";function ODt(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,fgo,n),r&&c(l,AKr,r),l.open(t,e,!o),r&&c(l,AKr,r),!o&&s&&c(l,pgo,s),l}a(ODt,"openXhr");function BDt(t){var e={};if(yi(t)){var r=Pi(t)[yL](/[\r\n]+/);yt(r,function(n){if(n){var o=n[E7e](": ");if(o!==-1){var s=Pi(n.substring(0,o))[ZW](),c=Pi(n[PDt](o+1));e[s]=c}else e[Pi(n)]=1}})}return e}a(BDt,"convertAllHeadersToMap");function rbe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Pi(n))}return t}a(rbe,"_appendHeader");var hgo="kill-duration",mgo="kill-duration-seconds",ggo="time-delta-millis";function GU(t,e){var r={};return t[NDt]?r=BDt(t[NDt]()):e&&(r=rbe(r,t,ggo),r=rbe(r,t,hgo),r=rbe(r,t,mgo)),r}a(GU,"_getAllResponseHeaders");p();p();var Ago="location",ygo="console",yKr="JSON",Ego="crypto",_go="msCrypto",Cgo="ReactNative",vgo="msie",bgo="trident/",EKr="XMLHttpRequest",LDt=null,FDt=null,Sgo=!1,Ese=null,UDt=null;function _Kr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[j1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Pn(o[e])}catch{}}return r}a(_Kr,"_hasProperty");function _se(t){if(t&&Sgo){var e=ki("__mockLocation");if(e)return e}return typeof location===GI&&location?location:ki(Ago)}a(_se,"getLocation");function k7e(){return typeof console!==q1?console:ki(ygo)}a(k7e,"getConsole");function obe(){return!!(typeof JSON===GI&&JSON||ki(yKr)!==null)}a(obe,"hasJSON");function P7e(){return obe()?JSON||ki(yKr):null}a(P7e,"getJSON");function D7e(){return ki(Ego)}a(D7e,"getCrypto");function N7e(){return ki(_go)}a(N7e,"getMsCrypto");function Cse(){var t=Qu();return t&&t.product?t.product===Cgo:!1}a(Cse,"isReactNative");function oz(){var t=Qu();if(t&&(t[Zve]!==FDt||LDt===null)){FDt=t[Zve];var e=(FDt||Cs)[ZW]();LDt=Qm(e,vgo)||Qm(e,bgo)}return LDt}a(oz,"isIE");function vse(t){return(UDt===null||t===!1)&&(UDt=pW()&&!!Qu().sendBeacon),UDt}a(vse,"isBeaconsSupported");function bse(t){var e=!1;try{e=!!ki("fetch");var r=ki("Request");e&&t&&r&&(e=_Kr(r,"keepalive"))}catch{}return e}a(bse,"isFetchSupported");function M7e(){return Ese===null&&(Ese=typeof XDomainRequest!==q1,Ese&&sbe()&&(Ese=Ese&&!_Kr(ki(EKr),"withCredentials"))),Ese}a(M7e,"useXDomainRequest");function sbe(){var t=!1;try{var e=ki(EKr);t=!!e}catch{}return t}a(sbe,"isXhrSupported");var CKr=4294967296,sz=4294967295,vKr=123456789,bKr=987654321,SKr=!1,abe=vKr,cbe=bKr;function Tgo(t){t<0&&(t>>>=0),abe=vKr+t&sz,cbe=bKr-t&sz,SKr=!0}a(Tgo,"_mwcSeed");function Igo(){try{var t=hl()&2147483647;Tgo((Math.random()*CKr^t)+t)}catch{}}a(Igo,"_autoSeedMwc");function QDt(t){var e=0,r=D7e()||N7e();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&sz),e===0&&oz()&&(SKr||Igo(),e=xgo()&sz),e===0&&(e=B1(CKr*Math.random()|0)),t||(e>>>=0),e}a(QDt,"random32");function xgo(t){cbe=36969*(cbe&65535)+(cbe>>16)&sz,abe=18e3*(abe&65535)+(abe>>16)&sz;var e=(cbe<<16)+(abe&65535)>>>0&sz|0;return t||(e>>>=0),e}a(xgo,"mwcRandom32");function qDt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=QDt()>>>0,n=0,o=Cs;o[vn]>>=6,n===5&&(r=(QDt()<<2&4294967295|r&3)>>>0,n=0);return o}a(qDt,"newId");var TKr="3.3.10",wgo="."+qDt(6),Rgo=0;function IKr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(IKr,"_canAcceptData");function kgo(t,e){var r=e[t.id];if(!r){r={};try{IKr(e)&&Hi(e,t.id,{e:!1,v:r})}catch{}}return r}a(kgo,"_getCache");function XI(t,e){return e===void 0&&(e=!1),gse(t+Rgo+++(e?"."+TKr:Cs)+wgo)}a(XI,"createUniqueNamespace");function O7e(t){var e={id:XI("_aiData-"+(t||Cs)+"."+TKr),accept:a(function(r){return IKr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[gse(n)]:(s&&(c=kgo(e,r),c[gse(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(O7e,"createElmNodeData");p();function B7e(t){return t&&Fu(t)&&!cr(t)&&(t.isVal||t.fb||Xg(t,"v")||Xg(t,"mrg")||Xg(t,"ref")||t.set)}a(B7e,"_isConfigDefaults");function xKr(t,e,r){var n,o=r.dfVal||Coe;if(e&&r.fb){var s=r.fb;cr(s)||(s=[s]);for(var c=0;c0&&mKr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[vn]>0){c||(c=[]),l||(l=xp(function(){l=null,f()},0));for(var A=0;A0?ml(Tse(t[0],e),function(){VDt(oU(t,1),e,r)}):r(),n}a(VDt,"doUnloadAll");p();var kKr=500,WDt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function PKr(t){return{mrg:!0,v:t}}a(PKr,"cfgDfMerge");p();p();var zDt=[pse,QU,hse,tM],j7e=null,q7e;function Fgo(t,e){return function(){var r=arguments,n=YDt(e);if(n){var o=n.listener;o&&o[t]&&o[t][OU](o,r)}}}a(Fgo,"_listenerProxyFunc");function Ugo(){var t=ki("Microsoft");return t&&(j7e=t.ApplicationInsights),j7e}a(Ugo,"_getExtensionNamespace");function YDt(t){var e=j7e;return!e&&t.disableDbgExt!==!0&&(e=j7e||Ugo()),e?e.ChromeDbgExt:null}a(YDt,"getDebugExt");function DKr(t){if(!q7e){q7e={};for(var e=0;e=A&&(d[T](b[eM]),n[w]=!0)}else o>=A&&d[T](b[eM]);f(A,b)}},d.debugToConsole=function(A){KDt("debug",A),g("warning",A)},d[cse]=function(A){KDt("warn",A),g("warning",A)},d.errorToConsole=function(A){KDt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[ZI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=jgo+y[dse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[ro](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new xse(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[cse](v)}}}a(f,"_logInternalMessage");function h(A){return K1(kp(A,Hgo,d).cfg,function(y){var E=y.cfg;o=E[y7e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=YDt(e||{});E&&E[sv]&&E[sv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function OKr(t){return t||new az}a(OKr,"_getLogger");function wa(t,e,r,n,o,s){s===void 0&&(s=!1),OKr(t)[mL](e,r,n,o,s)}a(wa,"_throwInternal");function oM(t,e){OKr(t)[cse](e)}a(oM,"_warnToConsole");var JDt,$U,BKr="toGMTString",LKr="toUTCString",eNt="cookie",ZDt="expires",FKr="isCookieUseDisabled",mbe="disableCookiesUsage",UKr="_ckMgr",H7e=null,XDt=null,QKr=null,sM,qKr={},jKr={},$go=(JDt={cookieCfg:PKr(($U={},$U[T7e]={fb:"cookieDomain",dfVal:qU},$U.path={fb:"cookiePath",dfVal:qU},$U.enabled=Y1,$U.ignoreCookies=Y1,$U.blockedCookies=Y1,$U.disableCookieDefer=!1,$U)),cookieDomain:Y1,cookiePath:Y1},JDt[mbe]=Y1,JDt);function tNt(){!sM&&(sM=K9e(function(){return rf()}))}a(tNt,"_getDoc");function G7e(t){return t?t.isEnabled():!0}a(G7e,"_isMgrEnabled");function zKr(t,e){return e&&t&&cr(t.ignoreCookies)?Go(t.ignoreCookies,e)!==-1:!1}a(zKr,"_isIgnoredCookie");function HKr(t,e){return e&&t&&cr(t.blockedCookies)&&Go(t.blockedCookies,e)!==-1?!0:zKr(t,e)}a(HKr,"_isBlockedCookie");function GKr(t,e){var r=e[LU];if(Zt(r)){var n=void 0;Pn(t[FKr])||(n=!t[FKr]),Pn(t[mbe])||(n=!t[mbe]),r=n}return r}a(GKr,"_isCfgEnabled");function rNt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[I7e]=E||"/",_[ZDt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return oz()||(v["max-age"]="0"),VKr(Cs,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Cs),R=nu(w,";");if(R!==-1&&(w=Pi(ON(E,R)),T=YKr(Lf(E,R+1))),CL(T,T7e,v||o,M1,Pn),!Zt(_)){var x=oz();if(Pn(T[ZDt])){var k=hl(),D=k+_*1e3;if(D>0){var N=new Date;N.setTime(D),CL(T,ZDt,$Kr(N,x?BKr:LKr)||$Kr(N,x?BKr:LKr)||Cs,M1)}}x||CL(T,"max-age",Cs+_,null,Pn)}var L=_se();return L&&L.protocol==="https:"&&(CL(T,"secure",null,null,Pn),XDt===null&&(XDt=!KKr((Qu()||{})[Zve])),XDt&&CL(T,"SameSite","None",null,Pn)),CL(T,I7e,b||n,null,Pn),VKr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[vn]-1;_>=0;_--)f[_].n===E&&f[JI](_,1)}a(g,"_removePendingCookie");function A(){hbe(e)&&f&&(yt(f,function(E){HKr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=kp(t||jKr,null,e).cfg,s=K1(t,function(E){E.setDf(E.cfg,$go),r=E.ref(E.cfg,"cookieCfg"),n=r[I7e]||"/",o=r[T7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=GKr(t,r)!==!1,l=r.getCookie||Vgo,u=r.setCookie||WKr,d=r.delCookie||WKr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=GKr(t,r)!==!1&&c&&hbe(e),_=jKr[UKr];return E&&_&&y!==_&&(E=G7e(_)),E},"isEnabled"),setEnabled:a(function(E){r[LU]=E,Pn(t[mbe])||(t[mbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=HKr(r,E);if(!R){var x=m(_,v,b,T);G7e(y)?(u(E,x),w=!0):f&&(g(E),f[ro]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Cs,v=zKr(r,E);if(!v){if(G7e(y))_=l(E);else if(f)for(var b=f[vn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=nu(w,";");_=R!==-1?Pi(ON(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return G7e(y)?v=y.purge(E,_):f&&(g(E),f[ro]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return hbe(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[UKr]=y,y}a(rNt,"createCookieMgr");function hbe(t){if(H7e===null){H7e=!1,!sM&&tNt();try{var e=sM.v||{};H7e=e[eNt]!==void 0}catch(r){wa(t,2,68,"Cannot access document.cookie - "+yse(r),{exception:lr(r)})}}return H7e}a(hbe,"areCookiesSupported");function YKr(t){var e={};if(t&&t[vn]){var r=Pi(t)[yL](";");yt(r,function(n){if(n=Pi(n||Cs),n){var o=nu(n,"=");o===-1?e[n]=null:e[Pi(ON(n,o))]=Pi(Lf(n,o+1))}})}return e}a(YKr,"_extractParts");function $Kr(t,e){return Mr(t[e])?t[e]():null}a($Kr,"_formatDate");function VKr(t,e){var r=t||Cs;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Cs:"="+o)}),r}a(VKr,"_formatCookieValue");function Vgo(t){var e=Cs;if(!sM&&tNt(),sM.v){var r=sM.v[eNt]||Cs;QKr!==r&&(qKr=YKr(r),QKr=r),e=Pi(qKr[t]||Cs)}return e}a(Vgo,"_getCookieValue");function WKr(t,e){!sM&&tNt(),sM.v&&(sM.v[eNt]=t+"="+e)}a(WKr,"_setCookieValue");function KKr(t){return yi(t)?!!(Qm(t,"CPU iPhone OS 12")||Qm(t,"iPad; CPU OS 12")||Qm(t,"Macintosh; Intel Mac OS X 10_14")&&Qm(t,"Version/")&&Qm(t,"Safari")||Qm(t,"Macintosh; Intel Mac OS X 10_14")&&JB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||Qm(t,"Chrome/5")||Qm(t,"Chrome/6")||Qm(t,"UnrealEngine")&&!Qm(t,"Chrome")||Qm(t,"UCBrowser/12")||Qm(t,"UCBrowser/11")):!1}a(KKr,"uaDisallowsSameSiteNone");p();var Wgo={perfEvtsSendAll:!1};function zgo(t){t.h=null;var e=t.cb;t.cb=[],yt(e,function(r){Bf(r.fn,[r.arg])})}a(zgo,"_runScheduledListeners");function VU(t,e,r,n){yt(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||xp(zgo,0,r)):Bf(n,[o]))})}a(VU,"_runListeners");var nNt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=kp(e,Wgo);n=c[KN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){Hi(l,"listeners",{g:a(function(){return o},"g")}),l[use]=function(u){o[ro](u)},l[lse]=function(u){for(var d=Go(o,u);d>-1;)o[JI](d,1),d=Go(o,u)},l[pse]=function(u){VU(o,pse,s,function(d){d[pse](u)})},l[QU]=function(u,d){VU(o,QU,s,function(f){f[QU](u,d)})},l[hse]=function(u,d){VU(o,hse,d?s:null,function(f){f[hse](u,d)})},l[tM]=function(u){u&&(r||!u[Xve]())&&VU(o,tM,null,function(d){u.isAsync?xp(function(){return d[tM](u)},0):d[tM](u)})},l[v7e]=function(u){u&&u[vn]&&VU(o,v7e,s,function(d){d[v7e](u)})},l[b7e]=function(u){u&&u[z1]&&VU(o,b7e,s,function(d){d[b7e](u)})},l[S7e]=function(u,d){if(u>0){var f=d||0;VU(o,S7e,s,function(h){h[S7e](u,f)})}},l[ZI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[JN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(VU(o,"unload",null,function(h){var m=h[ZI](u);m&&(f||(f=[]),f[ro](m))}),f)return Id(function(h){return ml(yUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Rse="ctx",oNt="ParentContextKey",gbe="ChildrenContextKey",Ygo=null,kse=(function(){function t(e,r,n){var o=this;if(o.start=hl(),o[Nk]=e,o.isAsync=n,o[Xve]=function(){return!1},Mr(r)){var s;Hi(o,"payload",{g:a(function(){return!s&&Mr(r)&&(s=r(),r=null),s},"g")})}o[ez]=function(c){return c?c===t[oNt]||c===t[gbe]?o[c]:(o[Rse]||{})[c]:null},o[Bk]=function(c,l){if(c)if(c===t[oNt])o[c]||(o[Xve]=function(){return!0}),o[c]=l;else if(c===t[gbe])o[c]=l;else{var u=o[Rse]=o[Rse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[ez](t[gbe]);if(cr(l))for(var u=0;u0&&(yt(A,function(y){try{y.func.call(y.self,y.args)}catch(E){wa(r[ju],2,73,"Unexpected Exception during onComplete - "+lr(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[_L];!_&&A&&(_={}),E[_L]=_,_=e.ref(E,_L),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}lbe(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[BU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(uNt,"_createInternalContext");function ex(t,e,r,n){var o=kp(e),s=uNt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[av](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),cr(d)&&(d=WU(d,o.cfg,r,f)),ex(d||c[W1](),o.cfg,r,f)}return a(u,"_createNew"),c[U0]=l,c[XN]=u,c}a(ex,"createProcessTelemetryContext");function Pse(t,e,r){var n=kp(e.config),o=uNt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[ZI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=WU(u,n.cfg,e,d)),Pse(u||s[W1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[XN]=l,s}a(Pse,"createProcessTelemetryUnloadContext");function Abe(t,e,r){var n=kp(e.config),o=uNt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Mr(d[XW])&&d[XW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),cr(u)&&(u=WU(u,n.cfg,e,d)),Abe(u||s[W1](),e,d)}return a(l,"_createNew"),s[U0]=c,s[XN]=l,s}a(Abe,"createProcessTelemetryUpdateContext");function WU(t,e,r,n){var o=null,s=!n;if(cr(t)&&t[vn]>0){var c=null;yt(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Mr(l[av])){var u=tAo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?WU([n],e,r):o}a(WU,"createTelemetryProxyChain");function tAo(t,e,r){var n=null,o=Mr(t[av]),s=Mr(t[UU]),c;t?c=t[ZN]+"-"+t[iz]+"-"+tJr++:c="Unknown-0-"+tJr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Mr(t[eJr])&&(g=t[eJr]()),g||(g=ex(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[ZN]:Xgo,T=g[XKr];return T||(T=g[XKr]={}),g.setNext(n),t&&Pp(g[Uf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Cs;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&wa(g[sv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+lr(x)+", run flags: "+lr(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=vL(t);return _[V1]||_[tbe]?!1:(s&&t[UU](n),t[av](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[U0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=vL(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[V1]&&(_[Uf]=null,_[V1]=!0,_[ov]=!1,t[V1]&&t[V1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[U0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=vL(t),v=t[Uf]||_[Uf];t&&(!v||v===g.core())&&!_[V1]&&t[XW]&&t[XW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[U0](A)}return a(m,"_updatePlugin"),_h(l)}a(tAo,"createTelemetryPluginProxy");var rJr=(function(){function t(e,r,n,o){var s=this,c=ex(e,r,n,o);HU(s,c,Uu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function ybe(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){yt(t,function(s){try{s(n,o)}catch(c){wa(n[sv](),2,73,"Unexpected error calling unload handler - "+lr(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(ybe,"createUnloadHandlerContainer");p();var W7e,z7e;function Y7e(){var t=[];function e(n){var o=t;t=[],yt(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){wa(n,2,73,"Unloading:"+lr(c))}}),W7e&&o[vn]>W7e&&(z7e?z7e("doUnload",o):wa(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Ch(t,n),W7e&&t[vn]>W7e&&(z7e?z7e("Add",t):wa(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(Y7e,"createUnloadHookContainer");var dNt,zU="getPlugin",rAo=(dNt={},dNt[_L]={isVal:qU,v:{}},dNt),Dse=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[gL]=function(h,m,g,A){u(h,m,A),r=!0},f[V1]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||Pse(null,g,o&&o[zU]?o[zU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[sv]()),A===!0&&E[U0](_),d())}return a(v,"_unloadCallback"),!f[FU]||f[FU](E,_,v)!==!0?v():A=!0,A},f[XW]=function(h,m){var g=f[Uf];if(!g||h&&g!==h[Uf]())return;var A,y=!1,E=h||Abe(null,g,o&&o[zU]?o[zU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[W1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},jU(f,"_addUnloadCb",function(){return s},"add"),jU(f,"_addHook",function(){return c},"add"),Hi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[sv]=function(f){return l(f)[sv]()},e[ov]=function(){return r},e.setInitialized=function(f){r=f},e[UU]=function(f){o=f},e[U0]=function(f,h){h?h[U0](f):o&&Mr(o[av])&&o[av](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||ex(null,{},e[Uf]);o&&o[zU]?h=m[XN](null,o[zU]):h=m[XN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){kp(f,rAo,wse(h)),!m&&h&&(m=h[g7e]()[W1]());var g=o;o&&o[zU]&&(g=o[zU]()),e[Uf]=h,n=ex(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Uf]=null,n=null,o=null,c=Y7e(),s=ybe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function nAo(t,e,r){var n={id:e,fn:r};Ch(t,n);var o={remove:a(function(){yt(t,function(s,c){if(s.id===n.id)return t[JI](c,1),-1})},"remove")};return o}a(nAo,"_addInitializer");function iAo(t,e,r){for(var n=!1,o=t[vn],s=0;s"},"v")})}a(hAo,"_createUnloadHook");var K7e=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F;bi(t,this,function(U){X(),U._getDbgPlgTargets=function(){return[x,o]},U[ov]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[gL]=function(ne,se,Ie,_e){g&&Kc(iJr),U[ov]()&&Kc("Core cannot be initialized more than once"),e=kp(ne,fNt,Ie||U[ju],!1),ne=e.cfg,Me(e[KN](function(Xe){var Ct=Xe.cfg;B=Ct.initInMemoMaxSize||aAo,W(Ct);var Ot=Xe.ref(Xe.cfg,_L);zr(Ot,function($t){Xe.ref(Ot,$t)})})),s=_e,b=pAo(e,v,s&&U[Kve](),b),z(),U[ju]=Ie;var Re=ne[nz];if(f=[],f[ro].apply(f,yW(yW([],se,!1),Re,!1)),h=ne[rz],we(null),(!m||m[vn]===0)&&Kc("No "+rz+" available"),h&&h[vn]>1){var Je=U[BU]("TeeChannelController");(!Je||!Je.plugin)&&wa(n,1,28,"TeeChannel required")}fAo(ne,R,n),R=null,r=!0,N===MU.ACTIVE&&Y()},U.getChannels=function(){var ne=[];return m&&yt(m,function(se){ne[ro](se)}),_h(ne)},U.track=function(ne){Pp(U[mse](),function(){return"AppInsightsCore:track"},function(){ne===null&&(ae(ne),Kc("Invalid telemetry item")),!ne[Nk]&&Zt(ne[Nk])&&(ae(ne),Kc("telemetry name required")),ne.iKey=ne.iKey||w,ne.time=ne.time||Ase(new Date),ne.ver=ne.ver||"4.0",!g&&U[ov]()&&N===MU.ACTIVE?ie()[U0](ne):N!==MU.INACTIVE&&o[vn]<=B&&o[ro](ne)},function(){return{item:ne}},!ne.sync)},U[g7e]=ie,U[Kve]=function(){return s||(s=new nNt(e.cfg),U[oAo]=s),s},U[use]=function(ne){U.getNotifyMgr()[use](ne)},U[lse]=function(ne){s&&s[lse](ne)},U.getCookieMgr=function(){return u||(u=rNt(e.cfg,U[ju])),u},U.setCookieMgr=function(ne){u!==ne&&(Tse(u,!1),u=ne)},U[mse]=function(){return c||l||sNt()},U.setPerfMgr=function(ne){c=ne},U.eventCnt=function(){return o[vn]},U.releaseQueue=function(){if(r&&o[vn]>0){var ne=o;o=[],N===2?yt(ne,function(se){se.iKey=se.iKey||w,ie()[U0](se)}):wa(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ne){return y=ne||null,F=!1,O&&O[JN](),re(!0)};function W(ne){var se=ne.instrumentationKey,Ie=ne.endpointUrl;if(N!==3){if(Zt(se)){w=null,N=MU.INACTIVE;var _e="Please provide instrumentation key";r?(wa(n,1,100,_e),Y()):Kc(_e);return}var Re=[];Lm(se)?(Re[ro](se),w=null):w=se,Lm(Ie)?(Re[ro](Ie),L=null):L=Ie,Re[vn]?V(ne,Re):G()}}a(W,"_handleIKeyEndpointPromises");function V(ne,se){Q=!1,N=3;var Ie=qU(ne.initTimeOut)?ne.initTimeOut:cAo,_e=AUe(se);M&&M[JN](),M=xp(function(){M=null,Q||G()},Ie),ml(_e,function(Re){try{if(Q)return;if(!Re.rejected){var Je=Re[AL];if(Je&&Je[vn]){var Xe=Je[0];if(w=Xe&&Xe[AL],Je[vn]>1){var Ct=Je[1];L=Ct&&Ct[AL]}}w&&(ne.instrumentationKey=w,ne.endpointUrl=L)}G()}catch{Q||G()}})}a(V,"_waitForInitPromises");function G(){Q=!0,Zt(w)?(N=MU.INACTIVE,wa(n,1,112,"ikey can't be resolved from promises")):N=MU.ACTIVE,Y()}a(G,"_setStatus");function Y(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(Y,"_releaseQueues");function re(ne){if((!O||!O[LU])&&!F){var se=ne||n&&n.queue[vn]>0;se&&(q||(q=!0,Me(e[KN](function(Ie){var _e=Ie.cfg.diagnosticLogInterval;(!_e||!(_e>0))&&(_e=1e4);var Re=!1;O&&(Re=O[LU],O[JN]()),O=eUe(Z,_e),O.unref(),O[LU]=Re}))),O[LU]=!0)}return O}a(re,"_startLogPoller"),U[kDt]=function(){F=!0,O&&O[JN](),Z()},HU(U,function(){return A},["addTelemetryInitializer"]),U[ZI]=function(ne,se,Ie){ne===void 0&&(ne=!0),r||Kc(sAo),g&&Kc(iJr);var _e={reason:50,isAsync:ne,flushComplete:!1},Re;ne&&!se&&(Re=Id(function(Ct){se=Ct}));var Je=Pse(De(),U);Je[Jve](function(){v.run(U[ju]),VDt([u,s,n],ne,function(){X(),se&&se(_e)})},U);function Xe(Ct){_e.flushComplete=Ct,g=!0,_.run(Je,_e),U[kDt](),Je[U0](_e)}return a(Xe,"_doUnload"),Z(),J(ne,Xe,6,Ie)||Xe(!1),Re},U[BU]=Ae,U.addPlugin=function(ne,se,Ie,_e){if(!ne){_e&&_e(!1),K(aJr);return}var Re=Ae(ne[ZN]);if(Re&&!se){_e&&_e(!1),K("Plugin ["+ne[ZN]+"] is already loaded!");return}var Je={reason:16};function Xe($t){f[ro](ne),Je.added=[ne],we(Je),_e&&_e(!0)}if(a(Xe,"_addPlugin"),Re){var Ct=[Re.plugin],Ot={reason:2,isAsync:!!Ie};Te(Ct,Ot,function($t){$t?(Je.removed=Ct,Je.reason|=32,Xe(!0)):_e&&_e(!1)})}else Xe(!1)},U.updateCfg=function(ne,se){se===void 0&&(se=!0);var Ie;if(U[ov]()){Ie={reason:1,cfg:e.cfg,oldCfg:Toe({},e.cfg),newConfig:Toe({},ne),merge:se},ne=Ie.newConfig;var _e=e.cfg;ne[nz]=_e[nz],ne[rz]=_e[rz]}e._block(function(Re){var Je=Re.cfg;pNt(Re,Je,ne,se),se||zr(Je,function(Xe){Xg(ne,Xe)||Re.set(Je,Xe,Y1)}),Re.setDf(Je,fNt)},!0),e.notify(),Ie&&le(Ie)},U.evtNamespace=function(){return E},U.flush=J,U.getTraceCtx=function(ne){return T||(T=ZKr()),T},U.setTraceCtx=function(ne){T=ne||null},U.addUnloadHook=Me,jU(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ne){var se;return r?se=K1(e.cfg,ne,U[ju]):se=dAo(R,ne),hAo(se)},U.getWParam=function(){return YB()||e.cfg.enableWParam?0:-1};function j(){var ne={};k=[];var se=a(function(Ie){Ie&&yt(Ie,function(_e){if(_e[ZN]&&_e[A7e]&&!ne[_e.identifier]){var Re=_e[ZN]+"="+_e[A7e];k[ro](Re),ne[_e.identifier]=_e}})},"_addPluginVersions");se(m),h&&yt(h,function(Ie){se(Ie)}),se(f)}a(j,"_setPluginVersions");function X(){r=!1,e=kp({},fNt,U[ju]),e.cfg[y7e]=1,Hi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(se){U.updateCfg(se,!1)},"s")}),Hi(U,"pluginVersionStringArr",{g:a(function(){return k||j(),k},"g")}),Hi(U,"pluginVersionString",{g:a(function(){return D||(k||j(),D=k.join(";")),D||Cs},"g")}),Hi(U,"logger",{g:a(function(){return n||(n=new az(e.cfg),e[ju]=n),n},"g"),s:a(function(se){e[ju]=se,n!==se&&(Tse(n,!1),n=se)},"s")}),U[ju]=new az(e.cfg),x=[];var ne=U.config[nz]||[];ne.splice(0,ne[vn]),Ch(ne,x),A=new nJr,o=[],Tse(s,!1),s=null,c=null,l=null,Tse(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=XI("AIBaseCore",!0),_=ybe(),T=null,w=null,v=Y7e(),R=[],D=null,k=null,F=!1,O=null,q=!1,N=0,L=null,B=null,Q=!1,M=null}a(X,"_initDefaults");function ie(){var ne=ex(De(),e.cfg,U);return ne[Jve](re),ne}a(ie,"_createTelCtx");function we(ne){var se=uAo(U[ju],kKr,f);d=null,D=null,k=null,m=(h||[])[0]||[],m=V7e(Ch(m,se[rz]));var Ie=Ch(V7e(se[Uf]),m);x=_h(Ie);var _e=U.config[nz]||[];_e.splice(0,_e[vn]),Ch(_e,x);var Re=ie();m&&m[vn]>0&&lNt(Re[XN](m),Ie),lNt(Re,Ie),ne&&le(ne)}a(we,"_initPluginChain");function Ae(ne){var se=null,Ie=null,_e=[];return yt(x,function(Re){if(Re[ZN]===ne&&Re!==A)return Ie=Re,-1;Re.getChannel&&_e[ro](Re)}),!Ie&&_e[vn]>0&&yt(_e,function(Re){if(Ie=Re.getChannel(ne),!Ie)return-1}),Ie&&(se={plugin:Ie,setEnabled:a(function(Re){vL(Ie)[tbe]=!Re},"setEnabled"),isEnabled:a(function(){var Re=vL(Ie);return!Re[V1]&&!Re[tbe]},"isEnabled"),remove:a(function(Re,Je){Re===void 0&&(Re=!0);var Xe=[Ie],Ct={reason:1,isAsync:Re};Te(Xe,Ct,function(Ot){Ot&&we({reason:32,removed:Xe}),Je&&Je(Ot)})},"remove")}),se}a(Ae,"_getPlugin");function De(){if(!d){var ne=(x||[]).slice();Go(ne,A)===-1&&ne[ro](A),d=WU(V7e(ne),e.cfg,U)}return d}a(De,"_getPluginChain");function Te(ne,se,Ie){if(ne&&ne[vn]>0){var _e=WU(ne,e.cfg,U),Re=Pse(_e,U);Re[Jve](function(){var Je=!1,Xe=[];yt(f,function(Ot,$t){oJr(Ot,ne)?Je=!0:Xe[ro](Ot)}),f=Xe,D=null,k=null;var Ct=[];h&&(yt(h,function(Ot,$t){var Gt=[];yt(Ot,function(Ee){oJr(Ee,ne)?Je=!0:Gt[ro](Ee)}),Ct[ro](Gt)}),h=Ct),Ie&&Ie(Je),re()}),Re[U0](se)}else Ie(!1)}a(Te,"_removePlugins");function Z(){if(n&&n.queue){var ne=n.queue.slice(0);n.queue[vn]=0,yt(ne,function(se){var Ie={name:y||"InternalMessageId: "+se[dse],iKey:w,time:Ase(new Date),baseType:xse.dataType,baseData:{message:se[eM]}};U.track(Ie)})}}a(Z,"_flushInternalLogs");function J(ne,se,Ie,_e){var Re=1,Je=!1,Xe=null;_e=_e||5e3;function Ct(){Re--,Je&&Re===0&&(Xe&&Xe[JN](),Xe=null,se&&se(Je),se=null)}if(a(Ct,"doCallback"),m&&m[vn]>0){var Ot=ie()[XN](m);Ot.iterate(function($t){if($t.flush){Re++;var Gt=!1;$t.flush(ne,function(){Gt=!0,Ct()},Ie)||Gt||(ne&&Xe==null?Xe=xp(function(){Xe=null,Ct()},_e):Ct())}})}return Je=!0,Ct(),!0}a(J,"_flushChannels");function z(){var ne;Me(e[KN](function(se){var Ie=se.cfg.enablePerfMgr;if(Ie){var _e=se.cfg[C7e];(ne!==_e||!ne)&&(_e||(_e=lAo),x7e(se.cfg,C7e,_e),ne=_e,l=null),!c&&!l&&Mr(_e)&&(l=_e(U,U[Kve]()))}else l=null,ne=null}))}a(z,"_initPerfManager");function le(ne){var se=Abe(De(),U);se[Jve](re),(!U._updateHook||U._updateHook(se,ne)!==!0)&&se[U0](ne)}a(le,"_doUpdate");function K(ne){var se=U[ju];se?(wa(se,2,73,ne),re()):Kc(ne)}a(K,"_logOrThrowError");function ae(ne){var se=U[Kve]();se&&se[QU]([ne],2)}a(ae,"_notifyInvalidEvent");function Me(ne){v.add(ne)}a(Me,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var Lk="",mAo="NoResponseBody",cJr="&"+mAo+"=true",hNt="POST",J7e=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;Q(),E[gL]=function(M,O){o=O,n&&wa(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=_se();O&&O.protocol&&O.protocol[ZW]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[vn]?R(M,O):null},E.getFallbackInst=function(){return d},E[FU]=function(M,O){Q()},E.preparePayload=function(M,O,q,F){if(!O||F||!q[z1]){M(q);return}try{var U=ki("CompressionStream");if(!Mr(U)){M(q);return}var W=new ReadableStream({start:a(function(X){X.enqueue(yi(q[z1])?new TextEncoder().encode(q[z1]):q[z1]),X.close()},"start")}),V=W.pipeThrough(new U("gzip")),G=V.getReader(),Y=[],re=0,j=!1;return ml(G.read(),a(function X(ie){if(!j&&!ie.rejected){var we=ie[AL];if(!we.done)return Y[ro](we[AL]),re+=we.value[vn],ml(G.read(),X);for(var Ae=new Uint8Array(re),De=0,Te=0,Z=Y;Te0&&(yt(Uu(Ae),function(z){j.append(z,Ae[z])}),De[ebe]=j),u?De.credentials=u:v&&s&&(De.credentials="include"),q&&(De.keepalive=!0,e+=X,s?M._sendReason===2&&(ie=!0,A&&(U+=cJr)):ie=!0);var Te=new Request(U,De);try{Te[WDt]=!0}catch{}if(!q&&r&&(G=Id(function(z,le){Y=z,re=le})),!U){w(O),Y&&Y(!1);return}function Z(z,le){le?x(O,s?0:le,{},s?Lk:z):x(O,s?0:400,{},s?Lk:z)}a(Z,"_handleError");function J(z,le,K){var ae=z[Ok],Me=c.fetchOnComplete;Me&&Mr(Me)?Me(z,O,K||Lk,le):x(O,ae,{},K||Lk)}a(J,"_onFetchComplete");try{ml(fetch(s?U:Te,s?De:null),function(z){if(q&&(e-=X,X=0),!we)if(we=!0,z.rejected)Z(z.reason&&z.reason[eM],499),re&&re(z.reason);else{var le=z[AL];try{!s&&!le.ok?(le[Ok]?Z(le.statusText,le[Ok]):Z(le.statusText,499),Y&&Y(!1)):s&&!le.body?(J(le,null,Lk),Y&&Y(!0)):ml(le.text(),function(K){J(le,M,K[AL]),Y&&Y(!0)})}catch(K){le&&le[Ok]?Z(lr(K),le[Ok]):Z(lr(K),499),re&&re(K)}}})}catch(z){we||(Z(lr(z),499),re&&re(z))}return ie&&!we&&(we=!0,x(O,200,{}),Y&&Y(!0)),s&&!we&&M[tz]>0&&y&&y.set(function(){we||(we=!0,x(O,500,{}),Y&&Y(!0))},M[tz]),G}a(L,"_doFetchSender");function B(M,O,q){var F=nf(),U=new XDomainRequest,W=M[z1];U.onload=function(){var j=nM(U),X=c&&c.xdrOnComplete;X&&Mr(X)?X(U,O,M):x(O,200,{},j)},U.onerror=function(){x(O,400,{},s?Lk:R7e(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var V=F&&F.location&&F.location.protocol||"",G=M[fse];if(!G){w(O);return}if(!s&&G.lastIndexOf(V,0)!==0){var Y="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";wa(o,2,40,". "+Y),T(Y,O);return}var re=s?G:G[Mk](/^(https?:)/,"");U.open(hNt,re),M[tz]&&(U[tz]=M[tz]),U.send(W),s&&q?y&&y.set(function(){U.send(W)},0):U.send(W)}a(B,"_xdrSender");function Q(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(Q,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var mJr="on",lJr="attachEvent",uJr="addEventListener",dJr="detachEvent",fJr="removeEventListener",mNt="events",Cbe="visibilitychange",X7e="pagehide",gJr="pageshow",AJr="unload",yJr="beforeunload",EJr=XI("aiEvtPageHide"),_Jr=XI("aiEvtPageShow"),gAo=/\.[\.]+/g,AAo=/[\.]+$/,yAo=1,Z7e=O7e("events"),EAo=/^([^.]*)(?:\.(.+)|)/;function pJr(t){return t&&t[Mk]?t[Mk](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Cs):t}a(pJr,"_normalizeNamespace");function gNt(t,e){if(e){var r=Cs;cr(e)?(r=Cs,yt(e,function(o){o=pJr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=pJr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Cs)+r)}var n=EAo.exec(t||Cs)||[];return{type:n[1],ns:(n[2]||Cs).replace(gAo,".").replace(AAo,Cs)[yL](".").sort().join(".")}}a(gNt,"_getEvtNamespace");function CJr(t,e,r){r===void 0&&(r=!0);var n=Z7e.get(t,mNt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(CJr,"_getRegisteredEvents");function vJr(t,e,r,n){t&&e&&e[EL]&&(t[fJr]?t[fJr](e[EL],r,n):t[dJr]&&t[dJr](mJr+e[EL],r))}a(vJr,"_doDetach");function _Ao(t,e,r,n){var o=!1;return t&&e&&e[EL]&&r&&(t[uJr]?(t[uJr](e[EL],r,n),o=!0):t[lJr]&&(t[lJr](mJr+e[EL],r),o=!0)),o}a(_Ao,"_doAttach");function hJr(t,e,r,n){for(var o=e[vn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[DDt].ns)&&(!n||n(s))&&(vJr(t,s[DDt],s.handler,s.capture),e[JI](o,1))}}a(hJr,"_doUnregister");function CAo(t,e,r){if(e[EL])hJr(t,CJr(t,e[EL]),e,r);else{var n=Z7e.get(t,mNt,{});zr(n,function(o,s){hJr(t,s,e,r)}),Uu(n)[vn]===0&&Z7e.kill(t,mNt)}}a(CAo,"_unregisterEvents");function KU(t,e){var r;return e?(cr(e)?r=[t].concat(e):r=[t,e],r=gNt("xx",r).ns[yL](".")):r=t,r}a(KU,"mergeEvtNamespace");function Ebe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=gNt(e,n);if(s=_Ao(t,c,r,o),s&&Z7e.accept(t)){var l={guid:yAo++,evtName:c,handler:r,capture:o};CJr(t,c.type)[ro](l)}}catch{}return s}a(Ebe,"eventOn");function _be(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=gNt(e,n),c=!1;CAo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||vJr(t,s,r,o)}catch{}}a(_be,"eventOff");function ANt(t,e,r){var n=!1,o=nf();o&&(n=Ebe(o,t,e,r),n=Ebe(o.body,t,e,r)||n);var s=rf();return s&&(n=Ebe(s,t,e,r)||n),n}a(ANt,"addEventHandler");function yNt(t,e,r){var n=nf();n&&(_be(n,t,e,r),_be(n.body,t,e,r));var o=rf();o&&_be(o,t,e,r)}a(yNt,"removeEventHandler");function Nse(t,e,r,n){var o=!1;return e&&t&&t[vn]>0&&yt(t,function(s){s&&(!r||Go(r,s)===-1)&&(o=ANt(s,e,n)||o)}),o}a(Nse,"_addEventListeners");function ENt(t,e,r,n){var o=!1;return e&&t&&cr(t)&&(o=Nse(t,e,r,n),!o&&r&&r[vn]>0&&(o=Nse(t,e,null,n))),o}a(ENt,"addEventListeners");function cz(t,e,r){t&&cr(t)&&yt(t,function(n){n&&yNt(n,e,r)})}a(cz,"removeEventListeners");function eQe(t,e,r){return ENt([yJr,AJr,X7e],t,e,r)}a(eQe,"addPageUnloadEventListener");function tQe(t,e){cz([yJr,AJr,X7e],t,e)}a(tQe,"removePageUnloadEventListener");function vbe(t,e,r){function n(c){var l=rf();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=KU(EJr,r),s=Nse([X7e],t,e,o);return(!e||Go(e,Cbe)===-1)&&(s=Nse([Cbe],n,e,o)||s),!s&&e&&(s=vbe(t,null,r)),s}a(vbe,"addPageHideEventListener");function rQe(t,e){var r=KU(EJr,e);cz([X7e],t,r),cz([Cbe],null,r)}a(rQe,"removePageHideEventListener");function bbe(t,e,r){function n(c){var l=rf();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=KU(_Jr,r),s=Nse([gJr],t,e,o);return s=Nse([Cbe],n,e,o)||s,!s&&e&&(s=bbe(t,null,r)),s}a(bbe,"addPageShowEventListener");function nQe(t,e){var r=KU(_Jr,e);cz([gJr],t,r),cz([Cbe],null,r)}a(nQe,"removePageShowEventListener");p();var Mse="",bJr="https://browser.events.data.microsoft.com/OneCollector/1.0/",_Nt="version",iQe="properties";p();p();var CNt="initialize",vNt="indexOf",aM="timings",bNt="pollInternalLogs",J1="value",oQe="length",sQe="processTelemetryStart";var bL,SJr="4.3.10",Sbe="1DS-Web-JS-"+SJr,TJr=ove.hasOwnProperty;var PAo=(bL={},bL[0]=0,bL[2]=6,bL[1]=1,bL[3]=7,bL[4098]=6,bL[4097]=1,bL[4099]=7,bL);var DAo=YB(),NAo=Soe();function tx(t){return!(t===Mse||Zt(t))}a(tx,"isValueAssigned");function SNt(t){if(t){var e=nu(t,"-");if(e>-1)return ON(t,e)}return Mse}a(SNt,"getTenantId");function TNt(t){return!!(t&&Eh(t)&&t>=1&&t<=4)}a(TNt,"isLatency");function INt(t,e,r){if(!e&&!tx(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||cr(e))e={value:e};else if(n==="object"&&!TJr.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Zt(e[J1])||e[J1]===Mse||!yi(e[J1])&&!Eh(e[J1])&&!vk(e[J1])&&!cr(e[J1]))return null;if(cr(e[J1])&&!xJr(e[J1]))return null;if(!Zt(e.kind)){if(cr(e[J1])||!IJr(e.kind))return null;e[J1]=e[J1].toString()}return e}a(INt,"sanitizeProperty");function Tbe(t,e,r){var n=-1;if(!Pn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),MAo(r))n===-1&&(n=0),n|=r;else{var o=PAo[aQe(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(Tbe,"getCommonSchemaMetaData");function Ose(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[oQe],d=arguments;for(vk(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(IJr,"isValueKind");function MAo(t){return t>=0&&t<=9}a(MAo,"isDataType");function xJr(t){return t[oQe]>0}a(xJr,"isArrayValid");function cQe(t,e){var r=t;r[aM]=r[aM]||{},r[aM][sQe]=r[aM][sQe]||{},r[aM][sQe][e]=Z1()}a(cQe,"setProcessTelemetryTimings");function aQe(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===GI&&(e=4,cr(t)?(e=4096,t[oQe]>0&&(e|=aQe(t[0]))):TJr.call(t,"value")&&(e=8192|aQe(t[J1])))}return e}a(aQe,"getFieldValueType");function xNt(){return!!ki("chrome")}a(xNt,"isChromium");function lz(t){return t>0}a(lz,"isGreaterThanZero");var OAo=a_({endpointUrl:bJr,propertyStorageOverride:{isVal:BAo}});function BAo(t){return t&&(!t.getProperty||!t.setProperty)&&Kc("Invalid property storage override passed."),!0}a(BAo,"_chkPropOverride");var wNt=(function(t){Iy(e,t);function e(){var r=t.call(this)||this;return bi(e,r,function(n,o){n[CNt]=function(s,c,l,u){Pp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[CNt](kp(s,OAo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=lr(h);f[vNt]("channels")!==-1&&(f+=` - - Channels must be provided through config.channels only!`),wa(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Pp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[aM]=c[aM]||{},c[aM].trackStart=Z1(),TNt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=Sbe;var u=c.baseData=c.baseData||{};u[iQe]=u[iQe]||{};var d=u[iQe];d[_Nt]=d[_Nt]||n.pluginVersionString||Mse}o.track(c)},function(){return{item:s}},!s.sync)},n[bNt]=function(s){return o[bNt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(K7e);p();p();var Ibe="REAL_TIME",wJr="NEAR_REAL_TIME",RJr="BEST_EFFORT";p();p();p();var Fk="";var lQe="drop",kJr="send",RNt="requeue",PJr="rspFail",DJr="oth",kNt="no-cache, no-store",uQe="application/x-json-stream",xbe="cache-control",Bse="content-type",NJr="kill-tokens",MJr="kill-duration";var OJr="time-delta-millis",dQe="client-version",PNt="client-id",fQe="time-delta-to-apply-millis",pQe="upload-time",hQe="apikey",wbe="AuthMsaDeviceTicket",DNt="WebAuthToken",NNt="AuthXToken";var BJr="NoResponseBody",Lse="msfpc",MNt="trace",mQe="user";p();var Rbe="allowRequestSending",gQe="shouldAddClockSkewHeaders",AQe="getClockSkewHeaderValue",kbe="setClockSkew",$o="length",cM="concat",X1="iKey",Qf="count",lM="events",Q0="push",uM="split",yQe="toLowerCase",uz="hdrs",EQe="useHdrs",dz="initialize",_Qe="setTimeoutOverride",CQe="clearTimeoutOverride",LJr="payloadPreprocessor",ONt="overrideEndpointUrl",BNt="avoidOptions",FJr="disableEventTimings",vQe="enableCompoundKey",LNt="disableXhrSync",FNt="disableFetchKeepAlive",UJr="addNoResponse",UNt="useSendBeacon",QNt="fetchCredentials",qNt="alwaysUseXhrOverride",bQe="serializeOfflineEvt",SQe="getOfflineRequestDetails",TQe="createPayload",Pbe="createOneDSPayload",jNt="payloadBlob",Uk="headers",Fse="_thePayload",ky="batches",cv="sendType",Dbe="canSendRequest",Use="sendQueuedRequests",Nbe="setUnloading",QJr="isTenantKilled",IQe="sendSynchronousBatch",xQe="_transport",Qse="getWParam",HNt="isBeacon",Mbe="timings",wQe="isTeardown",RQe="_sendReason",kQe="setKillSwitchTenants",PQe="_backOffTransmission",Obe="identifier",qJr="ignoreMc1Ms0CookieProcessing",GNt="autoFlushEventsLimit",jJr="disableAutoBatchFlushLimit",HJr="overrideInstrumentationKey",Bbe="sendAttempt",JU="latency",fz="sync";function $Jr(t){var e=(t.ext||{}).intweb;return e&&tx(e[Lse])?e[Lse]:null}a($Jr,"_getEventMsfpc");function GJr(t){for(var e=null,r=0;e===null&&rhl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var FAo=.8,UAo=1.2,zJr=3e3,QAo=6e5;function YJr(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(YJr,"retryPolicyShouldRetryForStatus");function DQe(t){var e=0,r=zJr*FAo,n=zJr*UAo,o=B1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,rU(e,QAo)}a(DQe,"retryPolicyGetMillisToBackoffForRetry");p();var qAo=20,jAo=3145728,JJr=65e3,ZJr=2e6,HAo=rU(ZJr,JJr),KJr="metadata",NQe="f",GAo=/\./,XJr=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,E=s||Tbe,_=$Ao(l),v=MQe(_.requestLimit,jAo,0),b=MQe(_.requestLimit,JJr,1),T=MQe(_.recordLimit,ZJr,0),w=Math.min(MQe(_.recordLimit,HAo,1),b);bi(t,this,function(R){R.createPayload=function(D,N,L,B,Q,M){return{apiKeys:[],payloadBlob:Fk,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:L,isBeacon:B,sendType:M,sendReason:Q}},R.appendPayload=function(D,N,L){var B=D&&N&&!D.overflow;return B&&Pp(e,function(){return"Serializer:appendPayload"},function(){for(var Q=N.events(),M=D.payloadBlob,O=D.numEvents,q=!1,F=[],U=[],W=D.isBeacon,V=W?b:v,G=W?w:T,Y=0,re=0;Y=L){D.overflow=N.split(Y);break}var X=R.getEventBlob(j);if(X&&X.length<=G){var ie=X.length,we=M.length;if(we+ie>V){D.overflow=N.split(Y);break}M&&(M+=` -`),M+=X,re++,re>qAo&&(Y9e(M,0,1),re=0),q=!0,O++}else X?F.push(j):U.push(j),Q.splice(Y,1),Y--}Y++}if(F.length>0&&D.sizeExceed.push(ZU.create(N.iKey(),F)),U.length>0&&D.failedEvts.push(ZU.create(N.iKey(),U)),q){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var Ae=N.iKey();Go(D.apiKeys,Ae)===-1&&D.apiKeys.push(Ae)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:L}}),B},R.getEventBlob=function(D){try{return Pp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+SNt(D.iKey);var L={},B;y||(B=a(function(q,F,U){VAo(E,L,q,F,U)},"_addMetadataCallback"));var Q=D[f];Q&&(N[f]=L,zr(Q,function(q,F){var U=L[q]={};k(F,U,"ext."+q,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return k(D.baseData,O,d,!1,[d],B,m),k(D.data,M,u,!1,[],B,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var L=A[D];return L===void 0&&(D.length>=7&&(L=Ioe(D,"ext.metadata")||Ioe(D,"ext.web")),A[D]=L),L}a(x,"_isReservedField");function k(D,N,L,B,Q,M,O){zr(D,function(q,F){var U=null;if(F||tx(F)){var W=L,V=q,G=Q,Y=N;if(h&&!B&&GAo.test(q)){var re=q.split("."),j=re.length;if(j>1){G&&(G=G.slice());for(var X=0;X0&&n<=e)return n}return e}a(MQe,"_validateSizeLimit");function $Ao(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a($Ao,"_getSizeLimtCfg");function VAo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[KJr];c||(c=e[KJr]={f:{}});var l=c[NQe];if(l||(l=c[NQe]={}),r)for(var u=0;u0)for(var o=e[yQe](),s=0;s0&&(n&&VNt[e]?(t[uz][VNt[e]]=r,t[EQe]=!0):t.url+="&"+e+"="+r)}a(jse,"_addRequestDetails");function KAo(t,e,r){for(var n=0;n=0&&F.splice(He,1)},"rm")}},j[bQe]=function(xe){try{if(b)return b.getEventBlob(xe)}catch{}return Fk},j[SQe]=function(){try{var xe=b&&b[TQe](0,!1,!1,!1,1,0);return _e(xe,x)}catch{}return null},j[Pbe]=function(xe,He){try{var Ze=[];yt(xe,function(pe){He&&(pe=rM(pe));var ke=ZU.create(pe[X1],[pe]);Ze[Q0](ke)});for(var at=null;Ze[$o]>0&&b;){var ct=Ze.shift();ct&&ct[Qf]()>0&&(at=at||b[TQe](0,!1,!1,!1,1,0),b.appendPayload(at,ct,re))}var ut=_e(at,x),ee={data:at[jNt],urlString:ut.url,headers:ut[uz],timeout:k,disableXhrSync:N,disableFetchKeepAlive:L};return x&&(OQe(ee[Uk],xbe)||(ee[Uk][xbe]=kNt),OQe(ee[Uk],Bse)||(ee[Uk][Bse]=uQe)),ee}catch{}return null};function ie(xe,He){try{return G&&G.getSenderInst(xe,He)}catch{}return null}a(ie,"_getSenderInterface"),j._getDbgPlgTargets=function(){return[g[0],c,b,g,we(),s,re]};function we(){try{var xe={xdrOnComplete:Ae,fetchOnComplete:Te,xhrOnComplete:Z,beaconOnRetry:z},He={enableSendPromise:!1,isOneDs:!0,disableCredentials:!X,fetchCredentials:Y,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:L,timeWrapper:W,addNoResponse:Q,senderOnCompleteCallBack:xe};return He}catch{}return null}a(we,"_getSendPostMgrConfig");function Ae(xe,He,Ze){var at=nM(xe);J(He,200,{},at),Qe(at)}a(Ae,"_xdrOncomplete");function De(){var xe;s=null,c=new WJr,l=!1,u=new VJr,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,k=xe,N=xe,L=xe,B=xe,Q=xe,M=[],O=xe,q=xe,F=[],U=!1,W=qse(),V=!1,G=null,re=null}a(De,"_initDefaults");function Te(xe,He,Ze,at){var ct=a(function(pe,ke,Le){J(He,pe,ke,Le),Qe(Le)},"handleResponse"),ut={},ee=xe[Uk];ee&&ee.forEach(function(pe,ke){ut[ke]=pe}),ct(xe.status,ut,Ze||Fk)}a(Te,"_fetchOnComplete");function Z(xe,He,Ze){var at=nM(xe);J(He,xe.status,GU(xe,!0),at),Qe(at)}a(Z,"_xhrOnComplete");function J(xe,He,Ze,at){try{xe(He,Ze,at)}catch(ct){wa(m,2,518,lr(ct))}}a(J,"_doOnComplete");function z(xe,He,Ze){var at=xe,ct=200,ut=at[Fse],ee=xe.urlString+(Q?WAo:Fk);try{var pe=Qu();if(ut){var ke=!!A.getPlugin("LocalStorage"),Le=[],Ve=[];yt(ut[ky],function(tt){if(Le&&tt&&tt[Qf]()>0)for(var vt=tt[lM](),Nt=0;Nt0&&(ut.sentEvts=Ve),ke||nt(Le,8003,ut[cv],!0)}else ct=0}catch(tt){oM(m,"Failed to send telemetry using sendBeacon API. Ex:"+lr(tt)),ct=0}finally{J(He,ct,{},Fk)}}a(z,"_onBeaconRetry");function le(xe){return xe===2||xe===3}a(le,"_isBeaconPayload");function K(xe){return R&&le(xe)&&(xe=2),xe}a(K,"_adjustSendType"),j.addHeader=function(xe,He){_[xe]=He},j.removeHeader=function(xe){delete _[xe]},j[Dbe]=function(){return ae()&&u[Rbe]()},j[Use]=function(xe,He){Pn(xe)&&(xe=0),R&&(xe=K(xe),He=2),ne(v,xe,0)&&Ie(Me(),0,!1,xe,He||0)},j.isCompletelyIdle=function(){return!l&&f===0&&v[$o]===0},j[Nbe]=function(xe){R=xe},j.addBatch=function(xe){if(xe&&xe[Qf]()>0){if(c.isTenantKilled(xe[X1]()))return!1;v[Q0](xe)}return!0},j.teardown=function(){v[$o]>0&&Ie(Me(),0,!0,2,2),yt(M,function(xe){xe&&xe.rm&&xe.rm()}),M=[]},j.pause=function(){l=!0},j.resume=function(){l=!1,j[Use](0,4)},j[IQe]=function(xe,He,Ze){xe&&xe[Qf]()>0&&(Zt(He)&&(He=1),R&&(He=K(He),Ze=2),Ie([xe],0,!1,He,Ze||0))};function ae(){return!l&&f0&&!l&&g[He]&&b&&(at=He!==0||ae()&&(Ze>0||u[Rbe]())),at}a(ne,"_canSendPayload");function se(xe){var He={};return xe&&yt(xe,function(Ze,at){He[at]={iKey:Ze[X1](),evts:Ze[lM]()}}),He}a(se,"_createDebugBatches");function Ie(xe,He,Ze,at,ct){if(!(!xe||xe[$o]===0)){if(l){nt(xe,1,at);return}at=K(at);try{var ut=xe,ee=at!==0;Pp(A,function(){return"HttpManager:_sendBatches"},function(pe){pe&&(xe=xe.slice(0));for(var ke=[],Le=null,Ve=Z1(),tt=g[at]||(ee?g[1]:g[0]),vt=tt&&tt[xQe],Nt=B&&(R||le(at)||vt===3||tt._isSync&&vt===2);ne(xe,at,He);){var Vt=xe.shift();Vt&&Vt[Qf]()>0&&(c.isTenantKilled(Vt[X1]())?ke[Q0](Vt):(Le=Le||b[TQe](He,Ze,ee,Nt,ct,at),b.appendPayload(Le,Vt,re)?Le.overflow!==null&&(xe=[Le.overflow][cM](xe),Le.overflow=null,Je(Le,Ve,Z1(),ct),Ve=Z1(),Le=null):(Je(Le,Ve,Z1(),ct),Ve=Z1(),xe=[Vt][cM](xe),Le=null)))}Le&&Je(Le,Ve,Z1(),ct),xe[$o]>0&&(v=xe[cM](v)),nt(ke,8004,at)},function(){return{batches:se(ut),retryCount:He,isTeardown:Ze,isSynchronous:ee,sendReason:ct,useSendBeacon:le(at),sendType:at}},!ee)}catch(pe){wa(m,2,48,"Unexpected Exception sending batch: "+lr(pe))}}}a(Ie,"_sendBatches");function _e(xe,He){var Ze={url:s,hdrs:{},useHdrs:!1};He?(Ze[uz]=Ose(Ze[uz],_),Ze.useHdrs=Uu(Ze.hdrs)[$o]>0):zr(_,function(pe,ke){WNt[pe]?jse(Ze,WNt[pe],ke,!1):(Ze[uz][pe]=ke,Ze[EQe]=!0)}),jse(Ze,PNt,"NO_AUTH",He),jse(Ze,dQe,Sbe,He);var at=Fk;yt(xe.apiKeys,function(pe){at[$o]>0&&(at+=","),at+=pe}),jse(Ze,hQe,at,He),jse(Ze,pQe,hl().toString(),He);var ct=Ee(xe);if(tx(ct)&&(Ze.url+="&ext.intweb.msfpc="+ct),u[gQe]()&&jse(Ze,fQe,u[AQe](),He),A[Qse]){var ut=A[Qse]();ut>=0&&(Ze.url+="&w="+ut)}for(var ee=0;ee0){var ct=!!O,ut=g[xe.sendType];!le(xe[cv])&&xe[HNt]&&xe.sendReason===2&&(ut=g[2]||g[3]||ut);var ee=x;(xe.isBeacon||ut[xQe]===3)&&(ee=!1);var pe=_e(xe,ee);ee=ee||pe[EQe];var ke=Z1();Pp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Le=0;Le0?Nt[$Nt]++:Nt[$Nt]=1}nt(xe[ky],1e3+(at||0),xe[cv],!0);var It={data:xe[jNt],urlString:pe.url,headers:pe[uz],_thePayload:xe,_sendReason:at,timeout:k,disableXhrSync:N,disableFetchKeepAlive:L};ee&&(OQe(It[Uk],xbe)||(It[Uk][xbe]=kNt),OQe(It[Uk],Bse)||(It[Uk][Bse]=uQe));var Be=null;ut&&(Be=a(function(oe){u.firstRequestSent();var ve=a(function(de,te){Ct(de,te,xe,at)},"onComplete"),Se=xe[wQe]||xe.isSync;G.preparePayload(function(de){try{ut.sendPOST(de,ve,Se),q&&q(It,de,Se,xe[HNt])}catch(te){J(ve,0,{}),oM(m,"Unexpected exception sending payload. Ex:"+lr(te))}},D,oe,Se)},"sender")),Pp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(Be)if(xe[cv]===0&&f++,ct&&!xe.isBeacon&&ut[xQe]!==3){var oe={data:It.data,urlString:It.urlString,headers:Ose({},It[Uk]),timeout:It.timeout,disableXhrSync:It[LNt],disableFetchKeepAlive:It[FNt]},ve=!1;Pp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(oe,function(Se){ve=!0,!y&&!Se[Fse]&&(Se[Fse]=Se[Fse]||It[Fse],Se[RQe]=Se[RQe]||It[RQe]),Be(Se)},xe.isSync||xe[wQe])}catch{ve||Be(It)}})}else Be(It)})},function(){return{thePayload:xe,serializationStart:He,serializationCompleted:Ze,sendReason:at}},xe.isSync)}xe.sizeExceed&&xe.sizeExceed[$o]>0&&nt(xe.sizeExceed,8003,xe[cv]),xe.failedEvts&&xe.failedEvts[$o]>0&&nt(xe.failedEvts,8002,xe[cv])}a(Je,"_doPayloadSend");function Xe(xe,He){T&&yt(xe,function(Ze){var at=Ze[Mbe]=Ze[Mbe]||{};Re(at,"sendEventCompleted",He)})}a(Xe,"_addEventCompletedTimings");function Ct(xe,He,Ze,at){var ct=9e3,ut=null,ee=!1,pe=!1;try{var ke=!0;if(typeof xe!==q1){if(He){u[kbe](He[OJr]);var Le=He[MJr]||He["kill-duration-seconds"];yt(c[kQe](He[NJr],Le),function(tt){yt(Ze[ky],function(vt){if(vt[X1]()===tt){ut=ut||[];var Nt=vt[uM](0);Ze.numEvents-=Nt[Qf](),ut[Q0](Nt)}})})}if(xe==200||xe==204){ct=200;return}(!YJr(xe)||Ze.numEvents<=0)&&(ke=!1),ct=9e3+xe%1e3}if(ke){ct=100;var Ve=Ze.retryCnt;Ze[cv]===0&&(Ve0&&Xe(Ze[lM](),He)})}}a($t,"_addCompleteTimings");function Gt(xe,He,Ze){He?xe():W.set(xe,Ze)}a(Gt,"_doAction");function Ee(xe){for(var He=0;He0&&o){var ct=o[mt(He)];if(ct){var ut=Ze!==0;Pp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){Gt(function(){try{ct.call(o,xe,He,ut,Ze)}catch(ee){wa(m,1,74,"send request notification failed: "+ee)}},at||ut,0)},function(){return{batches:se(xe),reason:He,isSync:ut,sendSync:at,sendType:Ze}},!ut)}}}a(nt,"_sendBatchesNotification");function mt(xe){var He=YAo[xe];return tx(He)||(He=DJr,xe>=9e3&&xe<=9999?He=PJr:xe>=8e3&&xe<=8999?He=lQe:xe>=1e3&&xe<=1999&&(He=kJr)),He}a(mt,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var ZAo=.25,nZr=500,XAo=20,iZr=6,oZr=2,eyo=4,tZr=2,tyo=1,zNt=1e4,mz="eventsDiscarded",rZr="",Th=void 0,ryo=a_({eventsLimitInMem:{isVal:lz,v:zNt},immediateEventLimit:{isVal:lz,v:500},autoFlushEventsLimit:{isVal:lz,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:nyo,v:Th},overrideInstrumentationKey:Th,overrideEndpointUrl:Th,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:Th,clearTimeoutOverride:Th,payloadPreprocessor:Th,payloadListener:Th,disableEventTimings:Th,valueSanitizer:Th,stringifyObjects:Th,enableCompoundKey:Th,disableOptimizeObj:!1,fetchCredentials:Th,transports:Th,unloadTransports:Th,useSendBeacon:Th,disableFetchKeepAlive:Th,avoidOptions:!1,xhrTimeout:Th,disableXhrSync:Th,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Eh,v:iZr},maxUnloadEventRetryAttempts:{isVal:Eh,v:oZr},addNoResponse:Th,maxEvtPerBatch:{isVal:Eh,v:nZr},excludeCsMetaData:Th,requestLimit:{}});function nyo(t){return t&&t.sendPOST}a(nyo,"isOverrideFn");var YNt=(function(t){Iy(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=Ibe,A,y,E,_,v,b,T,w,R,x,k,D,N,L,B,Q,M,O,q,F,U,W,V;return bi(e,r,function(G,Y){le(),G._getDbgPlgTargets=function(){return[v,n]},G[dz]=function(ee,pe,ke){Pp(pe,function(){return"PostChannel:initialize"},function(){Y[dz](ee,pe,ke),q=pe.getNotifyMgr();try{B=KU(XI(G[Obe]),pe.evtNamespace&&pe.evtNamespace()),G._addHook(K1(ee,function(Le){var Ve=Le.cfg,tt=ex(null,Ve,pe);n=tt.getExtCfg(G[Obe],ryo),Q=qse(n[_Qe],n[CQe]),k=!n.disableOptimizeObj&&xNt(),M=n[qJr],j(pe),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[GNt],N=n.maxEventRetryAttempts,L=n.maxUnloadEventRetryAttempts,O=n[jJr],V=n.maxEvtPerBatch,Lm(Ve.endpointUrl)?G.pause():l&&G.resume(),ut(),U=n[HJr],W=!!n.disableTelemetry,F&&re();var vt=Ve.disablePageUnloadEvents||[];F=eQe(we,vt,B),F=vbe(we,vt,B)||F,F=bbe(Ae,Ve.disablePageShowEvents,B)||F})),v[dz](ee,G.core,G)}catch(Le){throw G.setInitialized(!1),Le}},function(){return{theConfig:ee,core:pe,extensions:ke}})},G.processTelemetry=function(ee,pe){cQe(ee,G[Obe]),pe=pe||G._getTelCtx(pe);var ke=ee;!W&&!o&&(U&&(ke[X1]=U),Te(ke,!0),D?Me(2,2):z()),G.processNext(ke,pe)},G.getOfflineSupport=function(){try{var ee=v&&v[SQe]();if(v)return{getUrl:a(function(){return ee?ee.url:null},"getUrl"),serialize:ie,batch:X,shouldProcess:a(function(pe){return!W},"shouldProcess"),createPayload:a(function(pe){return null},"createPayload"),createOneDSPayload:a(function(pe){if(v[Pbe])return v[Pbe](pe,k)},"createOneDSPayload")}}catch{}return null},G._doTeardown=function(ee,pe){Me(2,2),o=!0,v.teardown(),re(),le()};function re(){tQe(null,B),rQe(null,B),nQe(null,B)}a(re,"_removeUnloadHandlers");function j(ee){var pe=ee[Qse];ee[Qse]=function(){var ke=0;return M&&(ke=ke|2),ke|pe.call(ee)}}a(j,"_hookWParam");function X(ee){var pe=rZr;return ee&&ee[$o]&&yt(ee,function(ke){pe&&(pe+=` -`),pe+=ke}),pe}a(X,"_batch");function ie(ee){var pe=rZr;try{De(ee),pe=v[bQe](ee)}catch{}return pe}a(ie,"_serialize");function we(ee){var pe=ee||nf().event;pe.type!=="beforeunload"&&(D=!0,v[Nbe](D)),Me(2,2)}a(we,"_handleUnloadEvents");function Ae(ee){D=!1,v[Nbe](D)}a(Ae,"_handleShowEvents");function De(ee){ee.ext&&ee.ext[MNt]&&delete ee.ext[MNt],ee.ext&&ee.ext[mQe]&&ee.ext[mQe].id&&delete ee.ext[mQe].id,k&&(ee.ext=rM(ee.ext),ee.baseData&&(ee.baseData=rM(ee.baseData)),ee.data&&(ee.data=rM(ee.data)))}a(De,"_cleanEvent");function Te(ee,pe){if(ee[Bbe]||(ee[Bbe]=0),ee[JU]||(ee[JU]=1),De(ee),ee[fz]){if(E||l)ee[JU]=3,ee[fz]=!1;else if(v){k&&(ee=rM(ee)),v[IQe](ZU.create(ee[X1],[ee]),ee[fz]===!0?1:ee[fz],3);return}}var ke=ee[JU],Le=f,Ve=h;ke===4&&(Le=u,Ve=d);var tt=!1;if(Leee;if(!ke&&w>0)for(var Le=1;!ke&&Le<=3;Le++){var Ve=b[Le];Ve&&Ve[ky]&&yt(Ve[ky],function(tt){tt&&tt[Qf]()>=w&&(ke=!0)})}Ie(!0,ke)},G.pause=function(){ae(),l=!0,v&&v.pause()},G.resume=function(){l=!1,v&&v.resume(),z()},G._loadTransmitProfiles=function(ee){$t(),zr(ee,function(pe,ke){var Le=ke[$o];if(Le>=2){var Ve=Le>2?ke[2]:0;if(ke.splice(0,Le-2),ke[1]<0&&(ke[0]=-1),ke[1]>0&&ke[0]>0){var tt=ke[0]/ke[1];ke[0]=VWr(tt)*ke[1]}Ve>=0&&ke[1]>=0&&Ve>ke[1]&&(Ve=ke[1]),ke[Q0](Ve),m[pe]=ke}})},G.flush=function(ee,pe,ke){ee===void 0&&(ee=!0);var Le;if(!l)if(ke=ke||1,ee)pe||(Le=Id(function(tt){pe=tt})),c==null?(ae(),Xe(1,0,ke),c=K(function(){c=null,Ct(pe,ke)},0)):s[Q0](pe);else{var Ve=ae();Z(1,1,ke),pe&&pe(),Ve&&z()}return Le},G.setMsaAuthTicket=function(ee){v.addHeader(wbe,ee)},G.setAuthPluginHeader=function(ee){v.addHeader(DNt,ee)},G.removeAuthPluginHeader=function(){v.removeHeader(DNt)},G.hasEvents=J,G._setTransmitProfile=function(ee){g!==ee&&m[ee]!==void 0&&(ae(),g=ee,z())},HU(G,function(){return v},["addResponseHandler"]);function Z(ee,pe,ke){var Le=Xe(ee,pe,ke);return v[Use](pe,ke),Le}a(Z,"_sendEventsForLatencyAndAbove");function J(){return f>0}a(J,"_hasEvents");function z(){if(R>=0&&Xe(R,0,x)&&v[Use](0,x),u>0&&!y&&!l){var ee=m[g][2];ee>=0&&(y=K(function(){y=null,Z(4,0,1),z()},ee))}var pe=m[g][1];!A&&!c&&pe>=0&&!l&&(J()?A=K(function(){A=null,Z(_===0?3:1,0,1),_++,_%=2,z()},pe):_=0)}a(z,"_scheduleTimer"),G[PQe]=function(){E0&&f>T&&(pe=!0),pe&&c==null&&G.flush(ee,function(){},20))}a(Ie,"_performAutoFlush");function _e(ee,pe){k&&(ee=rM(ee));var ke=ee[JU],Le=se(ee[X1],ke,!0);return Le.addEvent(ee)?(ke!==4?(f++,pe&&ee[Bbe]===0&&Ie(!ee.sync,w>0&&Le[Qf]()>=w)):u++,!0):!1}a(_e,"_addEventToProperQueue");function Re(ee,pe,ke,Le){for(;ke<=pe;){var Ve=se(ee,pe,!0);if(Ve&&Ve[Qf]()>0){var tt=Ve[uM](0,Le),vt=tt[Qf]();if(vt>0)return ke===4?u-=vt:f-=vt,mt(mz,[tt],YN.QueueFull),!0}ke++}return Je(),!1}a(Re,"_dropEventWithLatencyOrLess");function Je(){for(var ee=0,pe=0,ke=a(function(Ve){var tt=b[Ve];tt&&tt[ky]&&yt(tt[ky],function(vt){Ve===4?ee+=vt[Qf]():pe+=vt[Qf]()})},"_loop_1"),Le=1;Le<=4;Le++)ke(Le);f=pe,u=ee}a(Je,"_resetQueueCounts");function Xe(ee,pe,ke){var Le=!1,Ve=pe===0;return!Ve||v[Dbe]()?Pp(G.core,function(){return"PostChannel._queueBatches"},function(){for(var tt=[],vt=4;vt>=ee;){var Nt=b[vt];Nt&&Nt.batches&&Nt.batches[$o]>0&&(yt(Nt[ky],function(Vt){v.addBatch(Vt)?Le=Le||Vt&&Vt[Qf]()>0:tt=tt[cM](Vt[lM]()),vt===4?u-=Vt[Qf]():f-=Vt[Qf]()}),Nt[ky]=[],Nt.iKeyMap={}),vt--}tt[$o]>0&&nt(mz,tt,YN.KillSwitch),Le&&R>=ee&&(R=-1,x=0)},function(){return{latency:ee,sendType:pe,sendReason:ke}},!Ve):(R=R>=0?rU(R,ee):ee,x=bk(x,ke)),Le}a(Xe,"_queueBatches");function Ct(ee,pe){Z(1,0,pe),Je(),Ot(function(){ee&&ee(),s[$o]>0?c=K(function(){c=null,Ct(s.shift(),pe)},0):(c=null,z())})}a(Ct,"_flushImpl");function Ot(ee){v.isCompletelyIdle()?ee():c=K(function(){c=null,Ot(ee)},ZAo)}a(Ot,"_waitForIdleManager");function $t(){ae(),Gt(),g=Ibe,z()}a($t,"_resetTransmitProfiles");function Gt(){m={},m[Ibe]=[2,1,0],m[wJr]=[6,3,0],m[RJr]=[18,9,0]}a(Gt,"_initializeProfiles");function Ee(ee,pe){var ke=[],Le=N;D&&(Le=L),yt(ee,function(Ve){Ve&&Ve[Qf]()>0&&yt(Ve[lM](),function(tt){tt&&(tt[fz]&&(tt[JU]=4,tt[fz]=!1),tt[Bbe]0&&nt(mz,ke,YN.NonRetryableStatus),D&&Me(2,2)}a(Ee,"_requeueEvents");function Qe(ee,pe){var ke=q||{},Le=ke[ee];if(Le)try{Le.apply(ke,pe)}catch(Ve){wa(G.diagLog(),1,74,ee+" notification failed: "+Ve)}}a(Qe,"_callNotification");function nt(ee,pe){for(var ke=[],Le=2;Le0&&Qe(ee,[pe][cM](ke))}a(nt,"_notifyEvents");function mt(ee,pe){for(var ke=[],Le=2;Le0&&yt(pe,function(Ve){Ve&&Ve[Qf]()>0&&Qe(ee,[Ve.events()][cM](ke))})}a(mt,"_notifyBatchEvents");function xe(ee,pe,ke){ee&&ee[$o]>0&&Qe("eventsSendRequest",[pe>=1e3&&pe<=1999?pe-1e3:0,ke!==!0])}a(xe,"_sendingEvent");function He(ee,pe){mt("eventsSent",ee,pe),z()}a(He,"_eventsSentEvent");function Ze(ee,pe){mt(mz,ee,pe>=8e3&&pe<=8999?pe-8e3:YN.Unknown)}a(Ze,"_eventsDropped");function at(ee){mt(mz,ee,YN.NonRetryableStatus),z()}a(at,"_eventsResponseFail");function ct(ee,pe){mt(mz,ee,YN.Unknown),z()}a(ct,"_otherEvent");function ut(){O?w=0:w=bk(V*(tZr+1),h/6)}a(ut,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Dse);var eS=ce(require("os"));var BQe=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=iyo(e),this.commonProperties=oyo(e),this.#e=Es(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new wNt,n=new YNt,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Dr.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Dr.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Ur).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Dr.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(ar).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function iyo(t){let e={},r=t.get(Fa);e["ai.session.id"]=r.sessionId;let n=t.get(Nf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${eS.type()} ${eS.release()}`,e["ai.device.osArchitecture"]=eS.arch(),e["ai.device.osPlatform"]=eS.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(ss).getVersion(),e}a(iyo,"getTags");function oyo(t){let e={};e.common_os=eS.platform(),e.common_platformversion=eS.release(),e.common_arch=eS.arch(),e.common_cpu=Array.from(new Set(eS.cpus().map(n=>n.model))).join();let r=t.get(Fa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(oyo,"getCommonProperties");var syo="7d7048df-6dd0-4048-bb23-b716c1461f8f",ayo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",cyo="f0000000-0000-0000-0000-000000000000",lyo="b73649cf-ca8f-4768-9e0e-b789d8529db5",uyo="5fb6107a-6a29-423f-a824-22e3724fa2a6",dyo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function fyo(t){return J9(t)==="prod"?lyo:uyo}a(fyo,"getMsftInstrumentationKey");function sZr(t){return new URL(t).hostname==="github.com"?cW.telemetry:t.replace("://","://copilot-telemetry-service.")}a(sZr,"getEndpointForServerUrl");var Ih=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=sZr(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];Es(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(k0);if(o.setReporter(new JW(r,this.namespace,{instrumentationKey:syo,endpointUrl:n})),o.setRestrictedReporter(new JW(r,this.namespace,{instrumentationKey:ayo,endpointUrl:n})),o.setFTReporter(new JW(r,this.namespace,{instrumentationKey:cyo,endpointUrl:n,includeAuthorizationHeader:!0})),o.setMsftReporter(new JW(r,`copilot/${this.namespace}`,{instrumentationKey:fyo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new BQe(r,"ThirdParty.copilot-chat",dyo,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(k0);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(k0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=sZr(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function pyo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Td(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(Ih).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return Jg.exception(t,n,"signUpLimited failed"),!1}}a(pyo,"apiFetchSignUpLimited");async function JNt(t,e,r){let n=await t.get(Qt).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await pyo(t,e)?JNt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(JNt,"getTokenWithSignUpLimited");p();p();var aZr=ce(ti());var no=class extends aZr.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var hyo={didChangeFeatureFlags:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},Mn=class{constructor(){this.capabilities={...hyo};this.emitter=new no;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var SL=require("fs"),Hse=require("os"),Gse=ce(require("path")),XU=require("process");var Si=class{static{a(this,"PersistenceManager")}},ZNt=class extends Si{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await SL.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Gse.dirname(s);c!==this.directory&&await SL.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await Lbe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await SL.promises.writeFile(s,JSON.stringify(u)+` -`,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await Lbe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` +`)}`}}let l=t.get(Nr).getEditorInfo(),u;l.root&&(u=[{prefix:`${l.name}:`,path:l.root}]);let d=coe(t),f=zQr(c,u,d),h=Ppo(c),m=h==="exception",g=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:f.stack||f.toString(),message:f.message,...o});if(await g.makeReadyForSending(t,0,"IncludeExp",r),s?.exception_detail)for(let y of s.exception_detail)y.value&&(d?y.value=Rwt(y.value):y.value="[redacted]");s??=DQr(t,f,n),s.context={...s.context,"copilot_event.unique_id":g.properties.unique_id,"#restricted_telemetry":d?"true":"false"},s.rollup_id!=="auto"&&(g.properties.errno=s.rollup_id),s.created_at=new Date(g.issuedTime).toISOString();let A=s.rollup_id==="auto"?c.stack??"":s.rollup_id;if(!t.get(_N).isThrottled(A)){if(d){let y=WQr(c,u),E=Vt.createAndMarkAsIssued({origin:n??"",type:c.name,code:`${c.code??""}`,reason:y.stack||y.toString(),message:y.message,...o});s.rollup_id!=="auto"&&(E.properties.errno=s.rollup_id),await E.makeReadyForSending(t,1,"IncludeExp",r),E.properties.unique_id=g.properties.unique_id,g.properties.restricted_unique_id=E.properties.unique_id,Ive(t,1,`error.${h}`,E)}m&&(g.properties.failbot_payload=JSON.stringify(s)),Ive(t,0,`error.${h}`,g)}}a(GVr,"_telemetryException");function Nm(t,e,r,n){let o=a(async(...s)=>{try{await e(...s)}catch(c){await GVr(t,c,dl(),r,n)}},"wrapped");return(...s)=>t.get(_d).register(o(...s))}a(Nm,"telemetryCatch");function Fm(t,e,r,n){return t.get(_d).register(Fpo(t,e,dl(),r?.extendedBy(),n))}a(Fm,"telemetryError");async function Fpo(t,e,r,n,o=0){if(ooe(o)&&!coe(t))return;let s=n||Vt.createAndMarkAsIssued({},{});await s.makeReadyForSending(t,o,"IncludeExp",r),Dpo(t,o,e,s)}a(Fpo,"_telemetryError");function $Vr(t,e,r,n,o,s){let c={completionTextJson:JSON.stringify(e),choiceIndex:o.toString()},l=s?.properties?.engineName;l&&(c.engineName=l,c.modelId=l);let u=Vt.createAndMarkAsIssued(c);if(r.logprobs)for(let[d,f]of Object.entries(r.logprobs))u.properties["logprobs_"+d]=JSON.stringify(f)??"unset";return u.extendWithRequestId(n),yt(t,"engine.completion",u,1)}a($Vr,"logEngineCompletion");function VVr(t,e,r){let n={promptJson:JSON.stringify({prefix:e.prefix,context:e.context}),promptSuffixJson:JSON.stringify(e.suffix)};if(e.context){let s=r.properties["request.option.extra"]?JSON.parse(r.properties["request.option.extra"]):{};s.context=e.context,n["request.option.extra"]=JSON.stringify(s)}let o=r.extendedBy(n);return yt(t,"engine.prompt",o,1)}a(VVr,"logEnginePrompt");function Upo(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){let e=t,r;if(typeof e.message=="string")r=e.message;else try{r=JSON.stringify(e)}catch{r="Unknown error"}let n=new Error(r);return n.name=typeof e.name=="string"?e.name:typeof t,typeof e.stack=="string"&&(n.stack=e.stack),n}return new Error("Unknown error")}a(Upo,"buildErrorFromUnknown");p();var YV=class extends Error{static{a(this,"HttpTimeoutError")}constructor(e,r){super(e,{cause:r}),this.name="HttpTimeoutError"}};function D0(t){return!t||typeof t!="object"?!1:t instanceof YV||"name"in t&&t.name==="AbortError"||"code"in t&&t.code==="ABORT_ERR"}a(D0,"isAbortError");var uoe=class extends SyntaxError{constructor(r,n){super(r);this.code=n;this.name="JsonParseError"}static{a(this,"JsonParseError")}},wN=class extends Error{static{a(this,"FetchResponseError")}constructor(e,r=`HTTP ${e.status} ${e.statusText}`){super(r),this.name="FetchResponseError",this.code=`HTTP${e.status}`}},Qpo=new Set(["ECONNABORTED","ECONNRESET","EHOSTUNREACH","ENETUNREACH","ENOTCONN","ENOTFOUND","ETIMEDOUT","ERR_HTTP2_STREAM_ERROR","ERR_SSL_BAD_DECRYPT","ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC","ERR_SSL_INVALID_LIBRARY_(0)","ERR_SSL_SSLV3_ALERT_BAD_RECORD_MAC","ERR_SSL_WRONG_VERSION_NUMBER","ERR_STREAM_PREMATURE_CLOSE","ERR_TLS_CERT_ALTNAME_INVALID"]);function kI(t,e=!0){return t instanceof Error?e&&"cause"in t&&kI(t.cause,!1)?!0:t.name==="EditorFetcherError"||t.name==="FetchError"||t instanceof uoe||t instanceof wN||t?.message?.startsWith("net::")||Qpo.has(t.code??""):!1}a(kI,"isNetworkError");var DI=class{constructor(e,r,n,o,s){this.status=e;this.statusText=r;this.headers=n;this.getText=o;this.getBody=s;this.ok=this.status>=200&&this.status<300;this.clientError=this.status>=400&&this.status<500}static{a(this,"Response")}async text(){return this.getText()}async json(){let e=await this.text(),r=this.headers.get("content-type");if(!r||!r.includes("json"))throw new uoe(`Response content-type is ${r??"missing"} (status=${this.status})`,`ContentType=${r}`);try{return JSON.parse(e)}catch(n){if(n instanceof SyntaxError){let o=n.message.match(/^(.*?) in JSON at position (\d+)(?: \(line \d+ column \d+\))?$/);if(o&&parseInt(o[2],10)==e.length||n.message==="Unexpected end of JSON input"){let s=new TextEncoder().encode(e).length,c=this.headers.get("content-length");throw c===null?new uoe(`Response body truncated: actualLength=${s}`,"Truncated"):new uoe(`Response body truncated: actualLength=${s}, headerLength=${c}`,"Truncated")}}throw n}}body(){return this.getBody()}};function $9(t){let e=t.headers.get("retry-after");if(!e)return;let r=Number.parseFloat(e);if(Number.isFinite(r)&&r>=0)return r;let n=Date.parse(e);if(Number.isNaN(n))return;let o=n-Date.now();return o<=0?0:o/1e3}a($9,"parseRetryAfterSeconds");var cr=class{static{a(this,"Fetcher")}getImplementation(){return this}};function KV(t,e,r,n,o,s,c,l,u,d,f,h){let m={...l,Authorization:`Bearer ${r}`,...xy(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Oa).sessionId,m["VScode-MachineId"]=t.get(Oa).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(cr);if(c){let E=new AbortController;c.onCancellationRequested(()=>{yt(t,"networking.cancelRequest",Vt.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(qpo(E))return yt(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(KV,"postRequest");function qpo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(qpo,"isInterruptedNetworkError");p();function h9e(){return typeof process>"u"}a(h9e,"isWeb");function OB(){return typeof process<"u"&&process.env.MSBENCH_MODE==="true"}a(OB,"isMsBenchModeEnabled");var XPt=class extends wN{static{a(this,"ProxiedResponseError")}constructor(e){super(e,`HTTP ${e.status} response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`)}};async function Lf(t,e,r,n={}){n={...n,headers:{Authorization:`Bearer ${e.accessToken}`,...h9e()?{}:xy(t),...n.headers}};let o=await t.get(cr).fetch(new URL(r,e.apiUrl).href,n);if(o.status>=500)throw new wN(o);if(!o.headers.get("x-github-request-id"))throw new XPt(o);return o}a(Lf,"apiFetch");p();p();var Hs=class{constructor(){this.recentNotifications=new yn(100)}static{a(this,"NotificationSender")}async showWarningMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showWarningMessage(r,...n)}async showInformationMessageOnlyOnce(e,r,...n){if(!this.recentNotifications.has(e??r))return this.recentNotifications.set(e??r,!0),this.showInformationMessage(r,...n)}};p();p();var na=class t{static{a(this,"ContentProvider")}static{this.registeredSchemes=new Set}static registerSchemes(e){for(let r of e)t.registeredSchemes.add(r)}static isRegisteredScheme(e){return t.registeredSchemes.has(e)}};var JVr=require("os"),m9e=require("path");p();var YVr;(()=>{"use strict";var t={975:B=>{function L(O){if(typeof O!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(O))}a(L,"e");function j(O,q){for(var Q,U="",z=0,W=-1,$=0,J=0;J<=O.length;++J){if(J2){var ne=U.lastIndexOf("/");if(ne!==U.length-1){ne===-1?(U="",z=0):z=(U=U.slice(0,ne)).length-1-U.lastIndexOf("/"),W=J,$=0;continue}}else if(U.length===2||U.length===1){U="",z=0,W=J,$=0;continue}}q&&(U.length>0?U+="/..":U="..",z=2)}else U.length>0?U+="/"+O.slice(W+1,J):U=O.slice(W+1,J),z=J-W-1;W=J,$=0}else Q===46&&$!==-1?++$:$=-1}return U}a(j,"r");var M={resolve:a(function(){for(var O,q="",Q=!1,U=arguments.length-1;U>=-1&&!Q;U--){var z;U>=0?z=arguments[U]:(O===void 0&&(O=process.cwd()),z=O),L(z),z.length!==0&&(q=z+"/"+q,Q=z.charCodeAt(0)===47)}return q=j(q,!Q),Q?q.length>0?"/"+q:"/":q.length>0?q:"."},"resolve"),normalize:a(function(O){if(L(O),O.length===0)return".";var q=O.charCodeAt(0)===47,Q=O.charCodeAt(O.length-1)===47;return(O=j(O,!q)).length!==0||q||(O="."),O.length>0&&Q&&(O+="/"),q?"/"+O:O},"normalize"),isAbsolute:a(function(O){return L(O),O.length>0&&O.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var O,q=0;q0&&(O===void 0?O=Q:O+="/"+Q)}return O===void 0?".":M.normalize(O)},"join"),relative:a(function(O,q){if(L(O),L(q),O===q||(O=M.resolve(O))===(q=M.resolve(q)))return"";for(var Q=1;QJ){if(q.charCodeAt(W+H)===47)return q.slice(W+H+1);if(H===0)return q.slice(W+H)}else z>J&&(O.charCodeAt(Q+H)===47?ne=H:H===0&&(ne=0));break}var re=O.charCodeAt(Q+H);if(re!==q.charCodeAt(W+H))break;re===47&&(ne=H)}var ae="";for(H=Q+ne+1;H<=U;++H)H!==U&&O.charCodeAt(H)!==47||(ae.length===0?ae+="..":ae+="/..");return ae.length>0?ae+q.slice(W+ne):(W+=ne,q.charCodeAt(W)===47&&++W,q.slice(W))},"relative"),_makeLong:a(function(O){return O},"_makeLong"),dirname:a(function(O){if(L(O),O.length===0)return".";for(var q=O.charCodeAt(0),Q=q===47,U=-1,z=!0,W=O.length-1;W>=1;--W)if((q=O.charCodeAt(W))===47){if(!z){U=W;break}}else z=!1;return U===-1?Q?"/":".":Q&&U===1?"//":O.slice(0,U)},"dirname"),basename:a(function(O,q){if(q!==void 0&&typeof q!="string")throw new TypeError('"ext" argument must be a string');L(O);var Q,U=0,z=-1,W=!0;if(q!==void 0&&q.length>0&&q.length<=O.length){if(q.length===O.length&&q===O)return"";var $=q.length-1,J=-1;for(Q=O.length-1;Q>=0;--Q){var ne=O.charCodeAt(Q);if(ne===47){if(!W){U=Q+1;break}}else J===-1&&(W=!1,J=Q+1),$>=0&&(ne===q.charCodeAt($)?--$==-1&&(z=Q):($=-1,z=J))}return U===z?z=J:z===-1&&(z=O.length),O.slice(U,z)}for(Q=O.length-1;Q>=0;--Q)if(O.charCodeAt(Q)===47){if(!W){U=Q+1;break}}else z===-1&&(W=!1,z=Q+1);return z===-1?"":O.slice(U,z)},"basename"),extname:a(function(O){L(O);for(var q=-1,Q=0,U=-1,z=!0,W=0,$=O.length-1;$>=0;--$){var J=O.charCodeAt($);if(J!==47)U===-1&&(z=!1,U=$+1),J===46?q===-1?q=$:W!==1&&(W=1):q!==-1&&(W=-1);else if(!z){Q=$+1;break}}return q===-1||U===-1||W===0||W===1&&q===U-1&&q===Q+1?"":O.slice(q,U)},"extname"),format:a(function(O){if(O===null||typeof O!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof O);return(function(q,Q){var U=Q.dir||Q.root,z=Q.base||(Q.name||"")+(Q.ext||"");return U?U===Q.root?U+z:U+"/"+z:z})(0,O)},"format"),parse:a(function(O){L(O);var q={root:"",dir:"",base:"",ext:"",name:""};if(O.length===0)return q;var Q,U=O.charCodeAt(0),z=U===47;z?(q.root="/",Q=1):Q=0;for(var W=-1,$=0,J=-1,ne=!0,H=O.length-1,re=0;H>=Q;--H)if((U=O.charCodeAt(H))!==47)J===-1&&(ne=!1,J=H+1),U===46?W===-1?W=H:re!==1&&(re=1):W!==-1&&(re=-1);else if(!ne){$=H+1;break}return W===-1||J===-1||re===0||re===1&&W===J-1&&W===$+1?J!==-1&&(q.base=q.name=$===0&&z?O.slice(1,J):O.slice($,J)):($===0&&z?(q.name=O.slice(1,W),q.base=O.slice(1,J)):(q.name=O.slice($,W),q.base=O.slice($,J)),q.ext=O.slice(W,J)),$>0?q.dir=O.slice(0,$-1):z&&(q.dir="/"),q},"parse"),sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,B.exports=M}},e={};function r(B){var L=e[B];if(L!==void 0)return L.exports;var j=e[B]={exports:{}};return t[B](j,j.exports,r),j.exports}a(r,"r"),r.d=(B,L)=>{for(var j in L)r.o(L,j)&&!r.o(B,j)&&Object.defineProperty(B,j,{enumerable:!0,get:L[j]})},r.o=(B,L)=>Object.prototype.hasOwnProperty.call(B,L),r.r=B=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})};var n={};let o;r.r(n),r.d(n,{URI:a(()=>m,"URI"),Utils:a(()=>N,"Utils")}),typeof process=="object"?o=process.platform==="win32":typeof navigator=="object"&&(o=navigator.userAgent.indexOf("Windows")>=0);let s=/^\w[\w\d+.-]*$/,c=/^\//,l=/^\/\//;function u(B,L){if(!B.scheme&&L)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${B.authority}", path: "${B.path}", query: "${B.query}", fragment: "${B.fragment}"}`);if(B.scheme&&!s.test(B.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(B.path){if(B.authority){if(!c.test(B.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(l.test(B.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}a(u,"a");let d="",f="/",h=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class m{static{a(this,"l")}static isUri(L){return L instanceof m||!!L&&typeof L.authority=="string"&&typeof L.fragment=="string"&&typeof L.path=="string"&&typeof L.query=="string"&&typeof L.scheme=="string"&&typeof L.fsPath=="string"&&typeof L.with=="function"&&typeof L.toString=="function"}scheme;authority;path;query;fragment;constructor(L,j,M,O,q,Q=!1){typeof L=="object"?(this.scheme=L.scheme||d,this.authority=L.authority||d,this.path=L.path||d,this.query=L.query||d,this.fragment=L.fragment||d):(this.scheme=(function(U,z){return U||z?U:"file"})(L,Q),this.authority=j||d,this.path=(function(U,z){switch(U){case"https":case"http":case"file":z?z[0]!==f&&(z=f+z):z=f}return z})(this.scheme,M||d),this.query=O||d,this.fragment=q||d,u(this,Q))}get fsPath(){return v(this,!1)}with(L){if(!L)return this;let{scheme:j,authority:M,path:O,query:q,fragment:Q}=L;return j===void 0?j=this.scheme:j===null&&(j=d),M===void 0?M=this.authority:M===null&&(M=d),O===void 0?O=this.path:O===null&&(O=d),q===void 0?q=this.query:q===null&&(q=d),Q===void 0?Q=this.fragment:Q===null&&(Q=d),j===this.scheme&&M===this.authority&&O===this.path&&q===this.query&&Q===this.fragment?this:new A(j,M,O,q,Q)}static parse(L,j=!1){let M=h.exec(L);return M?new A(M[2]||d,R(M[4]||d),R(M[5]||d),R(M[7]||d),R(M[9]||d),j):new A(d,d,d,d,d)}static file(L){let j=d;if(o&&(L=L.replace(/\\/g,f)),L[0]===f&&L[1]===f){let M=L.indexOf(f,2);M===-1?(j=L.substring(2),L=f):(j=L.substring(2,M),L=L.substring(M)||f)}return new A("file",j,L,d,d)}static from(L){let j=new A(L.scheme,L.authority,L.path,L.query,L.fragment);return u(j,!0),j}toString(L=!1){return b(this,L)}toJSON(){return this}static revive(L){if(L){if(L instanceof m)return L;{let j=new A(L);return j._formatted=L.external,j._fsPath=L._sep===g?L.fsPath:null,j}}return L}}let g=o?1:void 0;class A extends m{static{a(this,"d")}_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=v(this,!1)),this._fsPath}toString(L=!1){return L?b(this,!0):(this._formatted||(this._formatted=b(this,!1)),this._formatted)}toJSON(){let L={$mid:1};return this._fsPath&&(L.fsPath=this._fsPath,L._sep=g),this._formatted&&(L.external=this._formatted),this.path&&(L.path=this.path),this.scheme&&(L.scheme=this.scheme),this.authority&&(L.authority=this.authority),this.query&&(L.query=this.query),this.fragment&&(L.fragment=this.fragment),L}}let y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(B,L,j){let M,O=-1;for(let q=0;q=97&&Q<=122||Q>=65&&Q<=90||Q>=48&&Q<=57||Q===45||Q===46||Q===95||Q===126||L&&Q===47||j&&Q===91||j&&Q===93||j&&Q===58)O!==-1&&(M+=encodeURIComponent(B.substring(O,q)),O=-1),M!==void 0&&(M+=B.charAt(q));else{M===void 0&&(M=B.substr(0,q));let U=y[Q];U!==void 0?(O!==-1&&(M+=encodeURIComponent(B.substring(O,q)),O=-1),M+=U):O===-1&&(O=q)}}return O!==-1&&(M+=encodeURIComponent(B.substring(O))),M!==void 0?M:B}a(E,"m");function _(B){let L;for(let j=0;j1&&B.scheme==="file"?`//${B.authority}${B.path}`:B.path.charCodeAt(0)===47&&(B.path.charCodeAt(1)>=65&&B.path.charCodeAt(1)<=90||B.path.charCodeAt(1)>=97&&B.path.charCodeAt(1)<=122)&&B.path.charCodeAt(2)===58?L?B.path.substr(1):B.path[1].toLowerCase()+B.path.substr(2):B.path,o&&(j=j.replace(/\//g,"\\")),j}a(v,"v");function b(B,L){let j=L?_:E,M="",{scheme:O,authority:q,path:Q,query:U,fragment:z}=B;if(O&&(M+=O,M+=":"),(q||O==="file")&&(M+=f,M+=f),q){let W=q.indexOf("@");if(W!==-1){let $=q.substr(0,W);q=q.substr(W+1),W=$.lastIndexOf(":"),W===-1?M+=j($,!1,!1):(M+=j($.substr(0,W),!1,!1),M+=":",M+=j($.substr(W+1),!1,!0)),M+="@"}q=q.toLowerCase(),W=q.lastIndexOf(":"),W===-1?M+=j(q,!1,!0):(M+=j(q.substr(0,W),!1,!0),M+=q.substr(W))}if(Q){if(Q.length>=3&&Q.charCodeAt(0)===47&&Q.charCodeAt(2)===58){let W=Q.charCodeAt(1);W>=65&&W<=90&&(Q=`/${String.fromCharCode(W+32)}:${Q.substr(3)}`)}else if(Q.length>=2&&Q.charCodeAt(1)===58){let W=Q.charCodeAt(0);W>=65&&W<=90&&(Q=`${String.fromCharCode(W+32)}:${Q.substr(2)}`)}M+=j(Q,!0,!1)}return U&&(M+="?",M+=j(U,!1,!1)),z&&(M+="#",M+=L?z:E(z,!1,!1)),M}a(b,"b");function T(B){try{return decodeURIComponent(B)}catch{return B.length>3?B.substr(0,3)+T(B.substr(3)):B}}a(T,"C");let w=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(B){return B.match(w)?B.replace(w,(L=>T(L))):B}a(R,"w");var x=r(975);let P=x.posix||x,D="/";var N;(function(B){B.joinPath=function(L,...j){return L.with({path:P.join(L.path,...j)})},B.resolvePath=function(L,...j){let M=L.path,O=!1;M[0]!==D&&(M=D+M,O=!0);let q=P.resolve(M,...j);return O&&q[0]===D&&!L.authority&&(q=q.substring(1)),L.with({path:q})},B.dirname=function(L){if(L.path.length===0||L.path===D)return L;let j=P.dirname(L.path);return j.length===1&&j.charCodeAt(0)===46&&(j=""),L.with({path:j})},B.basename=function(L){return P.basename(L.path)},B.extname=function(L){return P.extname(L.path)}})(N||(N={})),YVr=n})();var{URI:V9,Utils:xve}=YVr;function ZVr(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substring(0,3)+ZVr(t.substring(3)):t}}a(ZVr,"decodeURIComponentGraceful");var KVr=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ekt(t){return t.match(KVr)?t.replace(KVr,e=>ZVr(e)):t}a(ekt,"percentDecode");function ba(t){if(/^[A-Za-z][A-Za-z0-9+.-]+:/.test(t))throw new Error("Path must not contain a scheme");if(!t)throw new Error("Path must not be empty");return V9.file(t).toString()}a(ba,"makeFsUri");function to(t){if(typeof t!="string"&&(t=t.uri),/^[A-Za-z]:\\/.test(t))throw new Error(`Could not parse <${t}>: Windows-style path`);try{let e=t.match(/^(?:([^:/?#]+?:)?\/\/)(\/\/.*)$/);return e?V9.parse(e[1]+e[2],!0):V9.parse(t,!0)}catch(e){throw new Error(`Could not parse <${t}>`,{cause:e})}}a(to,"parseUri");function g9e(t){return to(t),t}a(g9e,"validateUri");function ia(t){try{return to(t).toString()}catch{return t}}a(ia,"normalizeUri");var JV=new Set(["file","notebook","vscode-notebook","vscode-notebook-cell"]);function kn(t){let e=to(t);if(!JV.has(e.scheme)&&!na.isRegisteredScheme(e.scheme))throw new Error(`Copilot currently does not support URI with scheme: ${e.scheme}`);if((0,JVr.platform)()==="win32"){let r=e.path;return e.authority?r=`//${e.authority}${e.path}`:/^\/[A-Za-z]:/.test(r)&&(r=r.substring(1)),(0,m9e.normalize)(r)}else{if(e.authority)throw new Error("Unsupported remote file path");return e.path}}a(kn,"fsPath");function Ko(t){try{return kn(t)}catch{return}}a(Ko,"getFsPath");function XVr(t){let e=Ko(t);if(e)return V9.file(e).toString()}a(XVr,"getFsUri");function ZV(t,...e){let r,n=Ko(t);return n?r=ba((0,m9e.resolve)(n,...e)):r=xve.resolvePath(to(t),...e.map(o=>eWr(o))).toString(),typeof t=="string"?r:{uri:r}}a(ZV,"resolveFilePath");function Sa(t,...e){let r=xve.joinPath(to(t),...e.map(eWr)).toString();return typeof t=="string"?r:{uri:r}}a(Sa,"joinPath");function eWr(t){return jpo(t)?t.replaceAll("\\","/"):t}a(eWr,"pathToURIPath");function jpo(t){return/^[^/\\]*\\/.test(t)}a(jpo,"isWinPath");function Ki(t){return ekt((typeof t=="string"?t:t.uri).replace(/[#?].*$/,"").replace(/\/$/,"").replace(/^.*[/:]/,""))}a(Ki,"basename");function Xd(t){let e=xve.dirname(to(t)),r;return JV.has(e.scheme)&&e.scheme!=="file"?r=e.with({scheme:"file",fragment:""}).toString():r=e.toString(),typeof t=="string"?r:{uri:r}}a(Xd,"dirname");function tWr(t){return xve.extname(to(t))}a(tWr,"extname");var N0=class{static{a(this,"NetworkConfiguration")}};function A9e(t,e){try{let r=new URL(e??"");if(r.protocol==="https:"||!rkt(t)&&r.protocol==="http:")return r.href}catch{}}a(A9e,"ensurePermittedUrl");var XV={api:"https://api.githubcopilot.com",proxy:"https://copilot-proxy.githubusercontent.com",telemetry:"https://copilot-telemetry.githubusercontent.com","origin-tracker":"https://origin-tracker.githubusercontent.com"};function tkt(t,e,r){if(r&&m1(t)){for(let n of r){let o=Ht(t,n);if(o)return o}return}for(let n of e){let o=Ht(t,n);if(o)return o}}a(tkt,"urlConfigOverride");function Hpo(t,e){switch(e){case"api":return tkt(t,[Je.DebugOverrideCapiUrl,Je.DebugOverrideCapiUrlLegacy],[Je.DebugTestOverrideCapiUrl,Je.DebugTestOverrideCapiUrlLegacy]);case"proxy":return tkt(t,[Je.DebugOverrideProxyUrl,Je.DebugOverrideProxyUrlLegacy],[Je.DebugTestOverrideProxyUrl,Je.DebugTestOverrideProxyUrlLegacy]);case"origin-tracker":if(!rkt(t))return tkt(t,[Je.DebugSnippyOverrideUrl])}}a(Hpo,"getEndpointOverrideUrl");function NI(t,e,r,...n){let o=Hpo(t,r)??e.endpoints[r];return Sa(o,...n)}a(NI,"getEndpointUrl");function BB(t){return MI(t)?.endpoints??XV}a(BB,"getLastKnownEndpoints");function y9e(t,e){if(e&&!A9e(t,e)){t.get(Hs).showWarningMessage(`Ignoring invalid or unsupported authentication URL "${e}".`);return}t.get(N0).setConfiguredUrls(t,{serverUrl:e})}a(y9e,"updateServerUrl");p();var M0=class{static{a(this,"UrlOpener")}};var Zg=new Ae("auth"),nkt=60,Gpo=300;var $po=["a5db0bcaae94032fe715fb34a5e4bce2","7184f66dfcee98cb5f08a1cb936d5225","1cb18ac6eedd49b43d74a1c5beb0b955","ea9395b9a9248c05ee6847cbd24355ed"],Vpo="4535c7beffc844b46bb1ed4aa04d759a";function wy(t){let e=t.serverUrl?.match(/^https?:\/\//)?t.serverUrl:"",r=t.apiUrl?.match(/^https?:\/\//)?t.apiUrl:"";return e?r||=e.replace("://","://api."):r?.includes("://api.")&&(e||=r.replace("://api.","://")),(!e||!r)&&(e="https://github.com/",r="https://api.github.com/"),{apiUrl:r,serverUrl:e}}a(wy,"fillGitHubUrls");function W9(){return Math.floor(Date.now()/1e3)}a(W9,"nowSeconds");async function ikt(t,e,r){let n=Vt.createAndMarkAsIssued({},{});yt(t,"auth.new_login");let o={"X-GitHub-Api-Version":"2024-12-15"};r?.hasKnownOrg&&(o["X-GitHub-Staff-Request"]="1");let s=await Lf(t,e,"copilot_internal/v2/token",{timeout:12e4,headers:o}),c=await s.json(),l=c.user_notification;if(rWr(t,l,e),s.status===401){let m="Failed to get copilot token due to 401 status. Please sign out and try again.",g=s.headers.get("x-github-request-id")??"",A=c.error_details,y=[];g&&y.push(`request_id=${g}`),A?.url&&y.push(`url=${A.url}`),A?.notification_id&&y.push(`notification_id=${A.notification_id}`),A?.message&&y.push(`error=${A.message}`);let E=y.length>0?` (${y.join(", ")})`:"";return Zg.info(t,`${m}${E}`),Fm(t,"auth.unknown_401",n),{failureKind:"HTTP401",message:m}}if(!s.ok||!c.token){Zg.info(t,`Invalid copilot token: missing token: ${s.status} ${s.statusText}`),Fm(t,"auth.invalid_token",n.extendedBy({status:s.status.toString(),status_text:s.statusText}));let m=c.error_details;return m?.notification_id!=="not_signed_up"&&rWr(t,m,e),{failureKind:"NotAuthorized",message:m?.message??"Could not retrieve token",canSignUpForLimited:c.can_signup_for_limited??!1}}let u=W9()+c.refresh_in+nkt,d=await wve(t,e),f;d.ok&&(f=await d.json());let h=new eW(c,f,u);return yt(t,"auth.new_token",n.extendedBy({...Cwt(h)},{adjusted_expires_at:h.expiresAt,expires_at:c.expires_at,current_time:W9()})),{copilotToken:h}}a(ikt,"authFromGitHubSession");var Eh=class{static{a(this,"CopilotTokenFetcher")}},E9e=class extends Eh{static{a(this,"NetworkCopilotTokenFetcher")}async fetchTokenResult(e,r,n){return await ikt(e,r,n)}};async function wve(t,e){return await Lf(t,e,"copilot_internal/user",{timeout:12e4,headers:{"X-GitHub-Api-Version":"2025-05-01"}})}a(wve,"fetchCopilotUserInfo");function rWr(t,e,r){e&&t.get(Hs).showWarningMessageOnlyOnce(e.notification_id,e.message,{title:e.title},{title:"Dismiss"}).then(async n=>{let o=n?.title===e.title,s=o||n?.title==="Dismiss";if(o){let c=t.get(Nr).getEditorPluginInfo(),l=e.url.replace("{EDITOR}",encodeURIComponent(c.name+"_"+c.version));await t.get(M0).open(l)}e.notification_id&&s&&await Wpo(t,e.notification_id,r)}).catch(n=>{Zg.exception(t,n,"copilotToken.notification")})}a(rWr,"notifyUser");async function Wpo(t,e,r){let n=await Lf(t,r,"copilot_internal/notification",{method:"POST",body:JSON.stringify({notification_id:e})});(!n||!n.ok)&&Zg.error(t,`Failed to send notification result to GitHub: ${n?.status} ${n?.statusText}`)}a(Wpo,"sendNotificationResultToGitHub");var eW=class{constructor(e,r,n){this.envelope=e;this.expiresAt=n;this.token=e.token,this.organization_list=e.organization_list,this.enterprise_list=e.enterprise_list,this.tokenMap=this.parseToken(this.token),this.userInfo=new QFe(r)}static{a(this,"CopilotToken")}get endpoints(){return{...XV,...this.envelope.endpoints??{}}}needsRefresh(){return this.expiresAt-Gpo(this.organization_list??[]).includes(e))}isGitHubUser(){return(this.organization_list??[]).includes(Vpo)}isInternalUser(){return this.isMicrosoftUser()||this.isGitHubUser()}};p();var gi=class extends Error{static{a(this,"CopilotAuthError")}constructor(e,r){super(e,{cause:r}),this.name="CopilotAuthError"}};function _9e(t){return`Environment variable ${t} provides a token that is not valid for GitHub Copilot. Please unset it (or replace with a working token) and retry.`}a(_9e,"authEnvVarConflictMessage");var z9=class extends gi{static{a(this,"NoBrowserAvailableError")}constructor(e="Browser not available for OAuth code flow"){super(e),this.name="NoBrowserAvailableError"}};function nWr(t){let e=t.trim();if(!e)throw new gi("Invalid GitHub server URL: value is empty or whitespace.");let r;try{r=new URL(e)}catch{throw new gi("Invalid GitHub server URL: value is not a valid absolute URL.")}if(r.protocol!=="https:")throw new gi("Invalid GitHub server URL: only HTTPS URLs are supported.");if(r.port!=="")throw new gi("Invalid GitHub server URL: port numbers are not supported.");return r.toString()}a(nWr,"validateGitHubServerUrl");p();p();var OI=class{static{a(this,"AuthRepository")}};p();function iWr(t){let e=t.trim();if(!e)throw new gi("Invalid GitHub server URL: value is empty or whitespace.");let r=/^https?:\/\//i.test(e)?e:`https://${e}`,n=nWr(r),{apiUrl:o}=wy({serverUrl:n}),s=new URL(n).hostname;return{serverUrl:n,apiUrl:o,authAuthority:s}}a(iWr,"buildAuthServerEndpoint");function Y9(t,e){if(e!==void 0)return iWr(e);{let r=t.get(N0),{serverUrl:n,apiUrl:o}=r.getConfiguredUrls(),s=r.getAuthAuthority();return{serverUrl:n,apiUrl:o,authAuthority:s}}}a(Y9,"resolveAuthServerEndpoint");function okt(t){if(!t)return!1;try{return iWr(t),!0}catch{return!1}}a(okt,"isValidAuthServer");p();p();p();p();p();p();p();p();function UB(t,e){return t||e}a(UB,"_pureAssign");function O0(t,e){return t[e]}a(O0,"_pureRef");var Jv=void 0,_h=null,_kt="",w9e="function",Pve="object",LB="prototype",ykt="__proto__",tW="undefined",S9e="constructor",vkt="Symbol",zpo="_polyfill",rW="length",T9e="name",Xg="call",R9e="toString",BI=UB(Object),Ckt=O0(BI,LB),uWr=UB(String),nW=O0(uWr,LB),kve=UB(Math),dWr=UB(Array),P9e=O0(dWr,LB),FB=O0(P9e,"slice");function Ff(t,e){try{return{v:t.apply(this,e)}}catch(r){return{e:r}}}a(Ff,"safe");function Ypo(t,e){var r=Ff(t);return r.e?e:r.v}a(Ypo,"safeGet");var skt;function k9e(t){return function(e){return typeof e===t}}a(k9e,"_createIs");function fWr(t){var e="[object "+t+"]";return function(r){return!!(r&&Dve(r)===e)}}a(fWr,"_createObjIs");function Dve(t){return Ckt[R9e].call(t)}a(Dve,"objToString");function Dn(t){return typeof t===tW||t===tW}a(Dn,"isUndefined");function Kpo(t){return!poe(t)}a(Kpo,"isStrictUndefined");function Zt(t){return t===_h||Dn(t)}a(Zt,"isNullOrUndefined");function Jpo(t){return t===_h||!poe(t)}a(Jpo,"isStrictNullOrUndefined");function poe(t){return!!t||t!==Jv}a(poe,"isDefined");function Zpo(t){return!skt&&(skt=["string","number","boolean",tW,"symbol","bigint"]),t!==Pve&&skt.indexOf(t)!==-1}a(Zpo,"isPrimitiveType");var Ai=k9e("string"),Or=k9e(w9e);function Lu(t){return!t&&Zt(t)?!1:!!t&&typeof t===Pve}a(Lu,"isObject");var lr=O0(dWr,"isArray"),D9e=fWr("Date"),Ch=k9e("number"),EP=k9e("boolean");var QB=fWr("Error");function Um(t){return!!(t&&t.then&&Or(t.then))}a(Um,"isPromiseLike");function x1(t){return!(!t||Ypo(function(){return!(t&&0+t)},!t))}a(x1,"isTruthy");var hoe=O0(BI,"getOwnPropertyDescriptor");function Qm(t,e){return!!t&&Ckt.hasOwnProperty[Xg](t,e)}a(Qm,"objHasOwnProperty");var eA=UB(O0(BI,"hasOwn"),Xpo);function Xpo(t,e){return Qm(t,e)||!!hoe(t,e)}a(Xpo,"polyObjHasOwn");function zr(t,e,r){if(t&&Lu(t)){for(var n in t)if(eA(t,n)&&e[Xg](r||t,n,t[n])===-1)break}}a(zr,"objForEachKey");var v9e={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function eho(t){var e={};if(e[v9e.c]=!0,e[v9e.e]=!0,t.l){e.get=function(){return t.l.v};var r=hoe(t.l,"v");r&&r.set&&(e.set=function(n){t.l.v=n})}return zr(t,function(n,o){e[v9e[n]]=Kpo(o)?e[v9e[n]]:o}),e}a(eho,"_createProp");var n_=O0(BI,"defineProperty"),pWr=O0(BI,"defineProperties");function qi(t,e,r){return n_(t,e,eho(r))}a(qi,"objDefine");function hWr(t,e,r,n,o){var s={};return zr(t,function(c,l){I9e(s,c,e?l:c),I9e(s,l,r?l:c)}),n?n(s):s}a(hWr,"_createKeyValueMap");function I9e(t,e,r,n){n_(t,e,{value:r,enumerable:!0,writable:!1})}a(I9e,"_assignMapValue");var Bu=UB(uWr),tho="[object Error]";function ur(t,e){var r=_kt,n=Ckt[R9e][Xg](t);n===tho&&(t={stack:Bu(t.stack),message:Bu(t.message),name:Bu(t.name)});try{r=JSON.stringify(t,_h,e?typeof e=="number"?e:4:Jv),r=(r?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):_h)||Bu(t)}catch(o){r=" - "+ur(o,e)}return n+": "+r}a(ur,"dumpObj");function Wc(t){throw new Error(t)}a(Wc,"throwError");function B0(t){throw new TypeError(t)}a(B0,"throwTypeError");var mWr=O0(BI,"freeze");function rho(t){return t}a(rho,"_doNothing");function nho(t){return t[ykt]||_h}a(nho,"_getProto");var qB=O0(BI,"assign"),Fu=O0(BI,"keys");function i_(t){return mWr&&zr(t,function(e,r){(lr(r)||Lu(r))&&i_(r)}),bh(t)}a(i_,"objDeepFreeze");var bh=UB(mWr,rho);var Ekt=UB(O0(BI,"getPrototypeOf"),nho);function N9e(t){return hWr(t,1,0,bh)}a(N9e,"createEnum");function iho(t){return hWr(t,0,0,bh)}a(iho,"createEnumKeyMap");function oho(t){var e={};return zr(t,function(r,n){I9e(e,r,n[1]),I9e(e,n[0],n[1])}),bh(e)}a(oho,"createSimpleMap");function bkt(t){return oho(t)}a(bkt,"createTypeMap");var gWr=iho({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),oWr="__tsUtils$gblCfg",akt;function AWr(){var t;return typeof globalThis!==tW&&(t=globalThis),!t&&typeof self!==tW&&(t=self),!t&&typeof window!==tW&&(t=window),!t&&typeof global!==tW&&(t=global),t}a(AWr,"_getGlobalValue");function yWr(){if(!akt){var t=Ff(AWr).v||{};akt=t[oWr]=t[oWr]||{}}return akt}a(yWr,"_getGlobalConfig");var moe=Nve;function Nve(t,e,r){var n=e?e[t]:_h;return function(o){var s=(o?o[t]:_h)||n;if(s||r){var c=arguments;return(s||r).apply(o,s?FB[Xg](c,1):c)}B0('"'+Bu(t)+'" not defined for '+ur(o))}}a(Nve,"_unwrapFunctionWithPoly");function sho(t){return function(e){return e[t]}}a(sho,"_unwrapProp");var K9=O0(kve,"min"),_P=O0(kve,"max"),sWr=moe("slice",nW),Uf=moe("substring",nW),M9e=Nve("substr",nW,aho);function aho(t,e,r){return Zt(t)&&B0("Invalid "+ur(t)),r<0?_kt:(e=e||0,e<0&&(e=_P(e+t[rW],0)),Dn(r)?sWr(t,e):sWr(t,e,e+r))}a(aho,"polyStrSubstr");function RN(t,e){return Uf(t,0,e)}a(RN,"strLeft");var aWr="_urid",ckt;function cho(){if(!ckt){var t=yWr();ckt=t.gblSym=t.gblSym||{k:{},s:{}}}return ckt}a(cho,"_globalSymbolRegistry");var C9e;function Skt(t){var e={description:Bu(t),toString:a(function(){return vkt+"("+t+")"},"toString")};return e[zpo]=!0,e}a(Skt,"polyNewSymbol");function lho(t){var e=cho();if(!eA(e.k,t)){var r=Skt(t),n=Fu(e.s).length;r[aWr]=function(){return n+"_"+r[R9e]()},e.k[t]=r,e.s[r[aWr]()]=Bu(t)}return e.k[t]}a(lho,"polySymbolFor");function uho(t){!C9e&&(C9e={});var e,r=gWr[t];return r&&(e=C9e[r]=C9e[r]||Skt(vkt+"."+r)),e}a(uho,"polyGetKnownSymbol");var vh;function J9(){vh=yWr()}a(J9,"_initTestHooks");function O9e(t){var e={};return!vh&&J9(),e.b=vh.lzy,n_(e,"v",{configurable:!0,get:a(function(){var r=t();return vh.lzy||n_(e,"v",{value:r}),e.b=vh.lzy,r},"get")}),e}a(O9e,"getLazy");function w1(t){return n_({toJSON:a(function(){return t},"toJSON")},"v",{value:t})}a(w1,"createCachedValue");var EWr="window",Rve;function B9e(t,e){var r;return function(){return!vh&&J9(),(!r||vh.lzy)&&(r=w1(Ff(t,e).v)),r.v}}a(B9e,"_getGlobalInstFn");function Ry(t){return!vh&&J9(),(!Rve||t===!1||vh.lzy)&&(Rve=w1(Ff(AWr).v||_h)),Rve.v}a(Ry,"getGlobal");function Ri(t,e){var r;if(!Rve||e===!1?r=Ry(e):r=Rve.v,r&&r[t])return r[t];if(t===EWr)try{return window}catch{}return _h}a(Ri,"getInst");function jB(){return!!ef()}a(jB,"hasDocument");var ef=B9e(Ri,["document"]);function goe(){return!!tf()}a(goe,"hasWindow");var tf=B9e(Ri,[EWr]);function iW(){return!!Uu()}a(iW,"hasNavigator");var Uu=B9e(Ri,["navigator"]);var _Wr=B9e(function(){return!!Ff(function(){return process&&(process.versions||{}).node}).v});var foe,lkt;function L9e(){return foe=w1(Ff(Ri,[vkt]).v),foe}a(L9e,"_initSymbol");function dho(t){var e=(vh.lzy?0:foe)||L9e();return e.v?e.v[t]:Jv}a(dho,"_getSymbolKey");function vWr(){return!!fho()}a(vWr,"hasSymbol");function fho(){return!vh&&J9(),((vh.lzy?0:foe)||L9e()).v}a(fho,"getSymbol");function Mve(t,e){var r=gWr[t];!vh&&J9();var n=(vh.lzy?0:foe)||L9e();return n.v?n.v[r||t]:e?Jv:uho(t)}a(Mve,"getKnownSymbol");function LI(t,e){!vh&&J9();var r=(vh.lzy?0:foe)||L9e();return r.v?r.v(t):e?_h:Skt(t)}a(LI,"newSymbol");function Z9(t){return!vh&&J9(),lkt=(vh.lzy?0:lkt)||w1(Ff(dho,["for"]).v),(lkt.v||lho)(t)}a(Z9,"symbolFor");function x9e(t){return!!t&&Or(t.next)}a(x9e,"isIterator");function Tkt(t){return!Jpo(t)&&Or(t[Mve(3)])}a(Tkt,"isIterable");var b9e;function F9e(t,e,r){if(t&&(x9e(t)||(!b9e&&(b9e=w1(Mve(3))),t=t[b9e.v]?t[b9e.v]():_h),x9e(t))){var n=Jv,o=Jv;try{for(var s=0;!(o=t.next()).done&&e[Xg](r||t,o.value,s,t)!==-1;)s++}catch(c){n={e:c},t.throw&&(o=_h,t.throw(n))}finally{try{o&&!o.done&&t.return&&t.return(o)}finally{if(n)throw n.e}}}}a(F9e,"iterForOf");function doe(t,e,r){return t.apply(e,r)}a(doe,"fnApply");function Sh(t,e){return!Dn(e)&&t&&(lr(e)?doe(t.push,t,e):x9e(e)||Tkt(e)?F9e(e,function(r){t.push(r)}):t.push(e)),t}a(Sh,"arrAppend");function Ct(t,e,r){if(t)for(var n=t[rW]>>>0,o=0;o0?r:0;return Uf(t,o,o+n[rW])===n}a(xho,"polyStrStartsWith");var mkt="ref",gkt="unref",Akt="hasRef",who="enabled";function Rho(t,e,r){var n=!0,o=t?e(_h):_h,s;function c(){return n=!1,o&&o[gkt]&&o[gkt](),s}a(c,"_unref");function l(){o&&r(o),o=_h}a(l,"_cancel");function u(){return o=e(o),n||c(),s}a(u,"_refresh");function d(f){!f&&o&&l(),f&&!o&&u()}return a(d,"_setEnabled"),s={cancel:l,refresh:u},s[Akt]=function(){return o&&o[Akt]?o[Akt]():n},s[mkt]=function(){return n=!0,o&&o[mkt]&&o[mkt](),s},s[gkt]=c,s=n_(s,who,{get:a(function(){return!!o},"get"),set:d}),{h:s,dn:a(function(){o=_h},"dn")}}a(Rho,"_createTimerHandler");function xkt(t,e,r){var n=lr(e),o=n?e.length:0,s=(o>0?e[0]:n?Jv:e)||setTimeout,c=(o>1?e[1]:Jv)||clearTimeout,l=r[0];r[0]=function(){u.dn(),doe(l,Jv,FB[Xg](arguments))};var u=Rho(t,function(d){if(d){if(d.refresh)return d.refresh(),d;doe(c,Jv,[d])}return doe(s,Jv,r)},function(d){doe(c,Jv,[d])});return u.h}a(xkt,"_createTimeoutWith");function Pp(t,e){return xkt(!0,Jv,FB[Xg](arguments))}a(Pp,"scheduleTimeout");function xWr(t,e,r){return xkt(!0,t,FB[Xg](arguments,1))}a(xWr,"scheduleTimeoutWith");function U9e(t,e){return xkt(!1,Jv,FB[Xg](arguments))}a(U9e,"createTimeout");var Uve=N9e,wkt=bkt;p();var vP=Uve({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var CP="toLowerCase",ln="length",Eoe="warnToConsole",$B="throwInternal",kN="watch",eU="apply",Bi="push",FI="splice",Qu="logger",DN="cancel",VB="initialize",NN="identifier",_oe="removeNotificationListener",voe="addNotificationListener",Zv="isInitialized",Qve="getNotifyMgr",tU="getPlugin",P1="name",L0="processNext",Q9e="getProcessTelContext",WB="value",rU="enabled",Rkt="stopPollingInternalLogs",UI="unload",qve="onComplete",q9e="version",j9e="loggingLevelConsole",MN="createNew",k1="teardown",Coe="messageId",ON="message",Xv="diagLog",nU="_doTeardown",sW="update",D1="getNext",iU="setNextPlugin",jve="userAgent",QI="split",bP="replace",Hve="substring",Gve="indexOf",zB="type",Pkt="evtName",SP="status",kkt="getAllResponseHeaders",$ve="isChildEvt",N1="data",aW="getCtx",TP="setCtx",Dkt="itemsReceived",Vve="headers",boe="urlString",cW="timeout";var H9e="traceFlags";var Nkt;function wWr(t,e){Nkt||(Nkt=Bve("AggregationError",function(n,o){o[ln]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(ur(n))}),new Nkt(r,e||[])}a(wWr,"throwAggregationError");p();p();p();var Soe="function",qI="object",M1="undefined",O1="prototype";var oU=Object,Wve=oU[O1];p();var yvl=(Ry()||{}).Symbol,Evl=(Ry()||{}).Reflect;var RWr="hasOwnProperty",kho=a(function(t){for(var e,r=1,n=arguments.length;r0)for(var o=0;o=0;r--)if(t[r]===e)return!0;return!1}a($kt,"_hasVisited");function Mho(t,e,r,n){function o(u,d,f){var h=d[f];if(h[Lkt]&&n){var m=u[K9e]||{};m[zve]!==!1&&(h=(m[d[Toe]]||{})[f]||h)}return function(){return h.apply(u,arguments)}}a(o,"_instFuncProxy");var s=PN(null);J9e(r,function(u){s[u]=o(e,r,u)});for(var c=uW(t),l=[];c&&!Hkt(c)&&!$kt(l,c);)J9e(c,function(u){!s[u]&&Gkt(c,u,!Yve)&&(s[u]=o(e,c,u))}),l.push(c),c=uW(c);return s}a(Mho,"_getBaseFuncs");function Oho(t,e,r,n){var o=null;if(t&&Qm(r,Toe)){var s=t[K9e]||PN(null);if(o=(s[r[Toe]]||PN(null))[e],o||Z9e("Missing ["+e+"] "+Y9e),!o[Fkt]&&s[zve]!==!1){for(var c=!Qm(t,e),l=uW(t),u=[];c&&l&&!Hkt(l)&&!$kt(u,l);){var d=l[e];if(d){c=d===n;break}u.push(l),l=uW(l)}try{c&&(t[e]=o),o[Fkt]=1}catch{s[zve]=!1}}}return o}a(Oho,"_getInstFunc");function Bho(t,e,r){var n=e[t];return n===r&&(n=uW(e)[t]),typeof n!==Y9e&&Z9e("["+t+"] is not a "+Y9e),n}a(Bho,"_getProtoFunc");function Lho(t,e,r,n,o){function s(u,d){var f=a(function(){var h=Oho(this,d,u,f)||Bho(d,u,f);return h.apply(this,arguments)},"dynProtoProxy");return f[Lkt]=1,f}if(a(s,"_createDynamicPrototype"),!W9e(t)){var c=r[K9e]=r[K9e]||PN(null);if(!W9e(c)){var l=c[e]=c[e]||PN(null);c[zve]!==!1&&(c[zve]=!!o),W9e(l)||J9e(r,function(u){Gkt(r,u,!1)&&r[u]!==n[u]&&(l[u]=r[u],delete r[u],(!Qm(t,u)||t[u]&&!t[u][Lkt])&&(t[u]=s(t,u)))})}}}a(Lho,"_populatePrototype");function Fho(t,e){if(Yve){for(var r=[],n=uW(e);n&&!Hkt(n)&&!$kt(r,n);){if(n===t)return!0;r.push(n),n=uW(n)}return!1}return!0}a(Fho,"_checkPrototype");function Bkt(t,e){return Qm(t,YB)?t.name||e||PWr:((t||{})[z9e]||{}).name||e||PWr}a(Bkt,"_getObjName");function bi(t,e,r,n){Qm(t,YB)||Z9e("theClass is an invalid class definition.");var o=t[YB];Fho(o,e)||Z9e("["+Bkt(t)+"] not in hierarchy of ["+Bkt(e)+"]");var s=null;Qm(o,Toe)?s=o[Toe]:(s=Dho+Bkt(t,"_")+"$"+Qkt.n,Qkt.n++,o[Toe]=s);var c=bi[MWr],l=!!c[V9e];l&&n&&n[V9e]!==void 0&&(l=!!n[V9e]);var u=Nho(e),d=Mho(o,e,u,l);r(e,d);var f=!!Yve&&!!c[Ukt];f&&n&&(f=!!n[Ukt]),Lho(o,s,e,u,f!==!1)}a(bi,"dynamicProto");bi[MWr]=Qkt.o;p();var eUe="Promise";var Xkt="rejected";function pl(t,e){return tUe(t,function(r){return e?e({status:"fulfilled",rejected:!1,value:r}):r},function(r){return e?e({status:Xkt,rejected:!0,reason:r}):r})}a(pl,"doAwaitResponse");function tUe(t,e,r,n){var o=t;try{if(Um(t))(e||r)&&(o=t.then(e,r));else try{e&&(o=e(t))}catch(s){if(r)o=r(s);else throw s}}finally{n&&Uho(o,n)}return o}a(tUe,"doAwait");function Uho(t,e){var r=t;return e&&(Um(t)?t.finally?r=t.finally(e):r=t.then(function(n){return e(),n},function(n){throw e(),n}):e()),r}a(Uho,"doFinally");var Vkt,Wkt,zkt,OWr=!1;function Qho(t,e,r,n){Vkt=Vkt||{toString:a(function(){return"[[PromiseState]]"},"toString")},Wkt=Wkt||{toString:a(function(){return"[[PromiseResult]]"},"toString")},zkt=zkt||{toString:a(function(){return"[[PromiseIsHandled]]"},"toString")};var o={};o[Vkt]={get:e},o[Wkt]={get:r},o[zkt]={get:n},pWr(t,o)}a(Qho,"_addDebugState$1");var FWr=["pending","resolving","resolved",Xkt],BWr="dispatchEvent",X9e;function qho(t){var e;return t&&t.createEvent&&(e=t.createEvent("Event")),!!e&&e.initEvent}a(qho,"_hasInitEventFn");function jho(t,e,r,n){var o=ef();!X9e&&(X9e=w1(!!Ff(qho,[o]).v));var s=X9e.v?o.createEvent("Event"):n?new Event(e):{};if(r&&r(s),X9e.v&&s.initEvent(e,!1,!0),s&&t[BWr])t[BWr](s);else{var c=t["on"+e];if(c)c(s);else{var l=Ri("console");l&&(l.error||l.log)(e,ur(s))}}}a(jho,"emitEvent");var UWr="unhandledRejection",Hho=UWr.toLowerCase(),Kve=[],Gho=0,$ho=10;var Ykt;function LWr(t){return Or(t)?t.toString():ur(t)}a(LWr,"dumpFnObj");function QWr(t,e,r){var n=X9(arguments,3),o=0,s=!1,c,l=[],u=Gho++,d=Kve.length>0?Kve[Kve.length-1]:void 0,f=!1,h=null,m;function g(w,R){try{Kve.push(u),f=!0,h&&h.cancel(),h=null;var x=t(function(P,D){l.push(function(){try{var N=o===2?w:R,B=Dn(N)?c:Or(N)?N(c):N;Um(B)?B.then(P,D):N?P(B):o===3?D(B):P(B)}catch(L){D(L)}}),s&&_()},n);return x}finally{Kve.pop()}}a(g,"_then");function A(w){return g(void 0,w)}a(A,"_catch");function y(w){var R=w,x=w;return Or(w)&&(R=a(function(P){return w&&w(),P},"thenFinally"),x=a(function(P){throw w&&w(),P},"catchFinally")),g(R,x)}a(y,"_finally");function E(){return FWr[o]}a(E,"_strState");function _(){if(l.length>0){var w=l.slice();l=[],f=!0,h&&h.cancel(),h=null,e(w)}}a(_,"_processQueue");function v(w,R){return function(x){if(o===R){if(w===2&&Um(x)){o=1,x.then(v(2,1),v(3,1));return}o=w,s=!0,c=x,_(),!f&&w===3&&!h&&(h=Pp(b,$ho))}}}a(v,"_createSettleIfFn");function b(){if(!f)if(f=!0,_Wr())process.emit(UWr,c,m);else{var w=tf()||Ry();!Ykt&&(Ykt=w1(Ff(Ri,[eUe+"RejectionEvent"]).v)),jho(w,Hho,function(R){return qi(R,"promise",{g:a(function(){return m},"g")}),R.reason=c,R},!!Ykt.v)}}a(b,"_notifyUnhandledRejection"),m={then:g,catch:A,finally:y},n_(m,"state",{get:E}),OWr&&Qho(m,E,function(){return Dve(c)},function(){return f}),vWr()&&(m[Mve(11)]="IPromise");function T(){return"IPromise"+(OWr?"["+u+(Dn(d)?"":":"+d)+"]":"")+" "+E()+(s?" - "+LWr(c):"")}return a(T,"_toString"),m.toString=T,a((function(){Or(r)||B0(eUe+": executor is not a function - "+LWr(r));var R=v(3,0);try{r.call(m,v(2,0),R)}catch(x){R(x)}}),"_initialize")(),m}a(QWr,"_createPromise");function Vho(t){return function(e){var r=X9(arguments,1);return t(function(n,o){try{var s=[],c=1;F9e(e,function(l,u){l&&(c++,tUe(l,function(d){s[u]=d,--c===0&&n(s)},o))}),c--,c===0&&n(s)}catch(l){o(l)}},r)}}a(Vho,"_createAllPromise");function Who(t){return w1(function(e){var r=X9(arguments,1);return t(function(n,o){var s=[],c=1;function l(u,d){c++,pl(u,function(f){f.rejected?s[d]={status:Xkt,reason:f.reason}:s[d]={status:"fulfilled",value:f.value},--c===0&&n(s)})}a(l,"processItem");try{lr(e)?Ct(e,l):Tkt(e)?F9e(e,l):B0("Input is not an iterable"),c--,c===0&&n(s)}catch(u){o(u)}},r)})}a(Who,"_createAllSettledPromise");function qWr(t){Ct(t,function(e){try{e()}catch{}})}a(qWr,"syncItemProcessor");function zho(t){var e=Ch(t)?t:0;return function(r){Pp(function(){qWr(r)},e)}}a(zho,"timeoutItemProcessor");function jWr(t,e){return QWr(jWr,zho(e),t,e)}a(jWr,"createAsyncPromise");var Kkt;function Yho(t,e){!Kkt&&(Kkt=w1(Ff(Ri,[eUe]).v||null));var r=Kkt.v;if(!r)return jWr(t);Or(t)||B0(eUe+": executor is not a function - "+ur(t));var n=0;function o(){return FWr[n]}a(o,"_strState");var s=new r(function(c,l){function u(f){n=2,c(f)}a(u,"_resolve");function d(f){n=3,l(f)}a(d,"_reject"),t(u,d)});return n_(s,"state",{get:o}),s}a(Yho,"createNativePromise");var Jkt;function Jve(t){return QWr(Jve,qWr,t)}a(Jve,"createSyncPromise");function rUe(t,e){return!Jkt&&(Jkt=Who(Jve)),Jkt.v(t,e)}a(rUe,"createSyncAllSettledPromise");var Zkt;function Td(t,e){return!Zkt&&(Zkt=w1(Yho)),Zkt.v.call(this,t,e)}a(Td,"createPromise");var nUe=Vho(Td);var Zvl=Mve(11);p();p();p();p();var B1=void 0,So="",dW="channels",Qf="core",iUe="createPerfMgr",Zve="disabled",KB="extensionConfig",fW="extensions",eC="processTelemetry",pW="priority",Ioe="eventsSent",sU="eventsDiscarded",xoe="eventsSendRequest",BN="perfEvent",oUe="offlineEventsStored",sUe="offlineBatchSent",aUe="offlineBatchDrop",woe="getPerfMgr",cUe="domain",lUe="path",HWr="Not dynamic - ",GWr="REDACTED",e2t=["sig","Signature","AWSAccessKeyId","X-Goog-Signature"];var Kho="getPrototypeOf",Jho=/-([a-z])/g,Zho=/([^\w\d_$])/g,Xho=/^(\d+[\w\d_$])/,cCl=Object[Kho];function aU(t){return!Zt(t)}a(aU,"isNotNullOrUndefined");function Xve(t){var e=t;return e&&Ai(e)&&(e=e[bP](Jho,function(r,n){return n.toUpperCase()}),e=e[bP](Zho,"_"),e=e[bP](Xho,function(r,n){return"_"+n})),e}a(Xve,"normalizeJsName");function F0(t,e){return t&&e?eu(t,e)!==-1:!1}a(F0,"strContains");function cU(t){return t&&t.toISOString()||""}a(cU,"toISOString");function kp(t){return QB(t)?t[P1]:So}a(kp,"getExceptionName");function LN(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(LN,"setValue");function t2t(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Dn(r)?{}:r,t[e]=n)):n=Dn(r)?{}:r,n}a(t2t,"getSetValue");function e0o(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][eU](n,o)}}a(e0o,"_createProxyFunction");function hW(t,e,r,n,o){t&&e&&r&&(o!==!1||Dn(t[e]))&&(t[e]=e0o(r,n))}a(hW,"proxyFunctionAs");function mW(t,e,r,n){return t&&e&&Lu(t)&&lr(r)&&Ct(r,function(o){Ai(o)&&hW(t,o,e,o,n)}),t}a(mW,"proxyFunctions");function r2t(t){return(function(){function e(){var r=this;t&&zr(t,function(n,o){r[n]=o})}return a(e,"class_1"),e})()}a(r2t,"createClassFromInterface");function dUe(t){return t&&qB&&(t=oU(qB({},t))),t}a(dUe,"optimizeObject");function fUe(t,e,r,n,o,s){var c=arguments,l=c[0]||{},u=c[ln],d=!1,f=1;for(u>0&&EP(l)&&(d=l,l=c[f]||{},f++),Lu(l)||(l={});f>>=0),iCe=ZWr+t&AW,oCe=XWr-t&AW,ezr=!0}a(h0o,"_mwcSeed");function m0o(){try{var t=fl()&2147483647;h0o((Math.random()*JWr^t)+t)}catch{}}a(m0o,"_autoSeedMwc");function KWr(t){var e=0,r=d2t()||f2t();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&AW),e===0&&koe()&&(ezr||m0o(),e=g0o()&AW),e===0&&(e=R1(JWr*Math.random()|0)),t||(e>>>=0),e}a(KWr,"random32");function g0o(t){oCe=36969*(oCe&65535)+(oCe>>16)&AW,iCe=18e3*(iCe&65535)+(iCe>>16)&AW;var e=(oCe<<16)+(iCe&65535)>>>0&AW|0;return t||(e>>>=0),e}a(g0o,"mwcRandom32");function tzr(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=KWr()>>>0,n=0,o=So;o[ln]>>=6,n===5&&(r=(KWr()<<2&4294967295|r&3)>>>0,n=0);return o}a(tzr,"newId");var rzr="3.3.11",A0o="."+tzr(6),y0o=0;function nzr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(nzr,"_canAcceptData");function E0o(t,e){var r=e[t.id];if(!r){r={};try{nzr(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(E0o,"_getCache");function L1(t,e){return e===void 0&&(e=!1),Xve(t+y0o+++(e?"."+rzr:So)+A0o)}a(L1,"createUniqueNamespace");function mUe(t){var e={id:L1("_aiData-"+(t||So)+"."+rzr),accept:a(function(r){return nzr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[Xve(n)]:(s&&(c=E0o(e,r),c[Xve(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(mUe,"createElmNodeData");p();function gUe(t){return t&&Lu(t)&&!lr(t)&&(t.isVal||t.fb||eA(t,"v")||eA(t,"mrg")||eA(t,"ref")||t.set)}a(gUe,"_isConfigDefaults");function izr(t,e,r){var n,o=r.dfVal||poe;if(e&&r.fb){var s=r.fb;lr(s)||(s=[s]);for(var c=0;c0&&wWr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[ln]>0){c||(c=[]),l||(l=Pp(function(){l=null,f()},0));for(var A=0;A0?pl(JB(t[0],e),function(){vUe(X9(t,1),e,r)}):r(),n}a(vUe,"doUnloadAll");p();var lzr=500,y2t="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function x0o(t,e,r){return!t&&Zt(t)?e:EP(t)?t:Bu(t)[CP]()==="true"}a(x0o,"_stringToBoolOrDefault");function E2t(t){return{mrg:!0,v:t}}a(E2t,"cfgDfMerge");function Noe(t,e,r){return{fb:r,isVal:t,v:e}}a(Noe,"cfgDfValidate");function GI(t,e){return{fb:e,set:x0o,v:!!t}}a(GI,"cfgDfBoolean");p();p();var _2t=[Ioe,sU,xoe,BN],bUe=null,CUe;function w0o(t,e){return function(){var r=arguments,n=v2t(e);if(n){var o=n.listener;o&&o[t]&&o[t][eU](o,r)}}}a(w0o,"_listenerProxyFunc");function R0o(){var t=Ri("Microsoft");return t&&(bUe=t.ApplicationInsights),bUe}a(R0o,"_getExtensionNamespace");function v2t(t){var e=bUe;return!e&&t.disableDbgExt!==!0&&(e=bUe||R0o()),e?e.ChromeDbgExt:null}a(v2t,"getDebugExt");function uzr(t){if(!CUe){CUe={};for(var e=0;e<_2t[ln];e++)CUe[_2t[e]]=w0o(_2t[e],t)}return CUe}a(uzr,"getDebugListener");var Moe,fzr="warnToConsole",P0o="AI (Internal): ",k0o="AI: ",D0o="AITR_",N0o={loggingLevelConsole:0,loggingLevelTelemetry:1,maxMessageLimit:25,enableDebug:!1},M0o=(Moe={},Moe[0]=null,Moe[1]="errorToConsole",Moe[2]=fzr,Moe[3]="debugToConsole",Moe);function dzr(t){return t?'"'+t[bP](/\"/g,So)+'"':So}a(dzr,"_sanitizeDiagnosticText");function C2t(t,e){var r=u2t();if(r){var n="log";r[t]&&(n=t),Or(r[n])&&r[n](e)}}a(C2t,"_logToConsole");var dCe=(function(){function t(e,r,n,o){n===void 0&&(n=!1);var s=this;s[Coe]=e,s[ON]=(n?k0o:P0o)+e;var c=So;lU()&&(c=o_().stringify(o));var l=(r?" message:"+dzr(r):So)+(o?" props:"+dzr(c):So);s[ON]+=l}return a(t,"_InternalLogMessage"),t.dataType="MessageData",t})();function yW(t,e){return(t||{})[Qu]||new Ooe(e)}a(yW,"safeGetLogger");var Ooe=(function(){function t(e){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={},o,s,c,l,u;bi(t,this,function(d){u=h(e||{}),d.consoleLoggingLevel=function(){return o},d[$B]=function(A,y,E,_,v){v===void 0&&(v=!1);var b=new dCe(y,E,v,_);if(l)throw ur(b);var T=M0o[A]||fzr;if(Dn(b[ON]))g("throw"+(A===1?"Critical":"Warning"),b);else{if(v){var w=+b[Coe];!n[w]&&o>=A&&(d[T](b[ON]),n[w]=!0)}else o>=A&&d[T](b[ON]);f(A,b)}},d.debugToConsole=function(A){C2t("debug",A),g("warning",A)},d[Eoe]=function(A){C2t("warn",A),g("warning",A)},d.errorToConsole=function(A){C2t("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[UI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=D0o+y[Coe];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[Bi](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new dCe(23,v,!1);d.queue[Bi](b),A===1?d.errorToConsole(v):d[Eoe](v)}}}a(f,"_logInternalMessage");function h(A){return HI(Th(A,N0o,d).cfg,function(y){var E=y.cfg;o=E[j9e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=v2t(e||{});E&&E[Xv]&&E[Xv](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function pzr(t){return t||new Ooe}a(pzr,"_getLogger");function Vr(t,e,r,n,o,s){s===void 0&&(s=!1),pzr(t)[$B](e,r,n,o,s)}a(Vr,"_throwInternal");function ZB(t,e){pzr(t)[Eoe](e)}a(ZB,"_warnToConsole");var b2t,dU,hzr="toGMTString",mzr="toUTCString",x2t="cookie",S2t="expires",gzr="isCookieUseDisabled",fCe="disableCookiesUsage",Azr="_ckMgr",SUe=null,T2t=null,yzr=null,UN,Ezr={},_zr={},O0o=(b2t={cookieCfg:E2t((dU={},dU[cUe]={fb:"cookieDomain",dfVal:aU},dU.path={fb:"cookiePath",dfVal:aU},dU.enabled=B1,dU.ignoreCookies=B1,dU.blockedCookies=B1,dU.disableCookieDefer=!1,dU)),cookieDomain:B1,cookiePath:B1},b2t[fCe]=B1,b2t);function w2t(){!UN&&(UN=O9e(function(){return ef()}))}a(w2t,"_getDoc");function TUe(t){return t?t.isEnabled():!0}a(TUe,"_isMgrEnabled");function Izr(t,e){return e&&t&&lr(t.ignoreCookies)?Qo(t.ignoreCookies,e)!==-1:!1}a(Izr,"_isIgnoredCookie");function vzr(t,e){return e&&t&&lr(t.blockedCookies)&&Qo(t.blockedCookies,e)!==-1?!0:Izr(t,e)}a(vzr,"_isBlockedCookie");function Czr(t,e){var r=e[rU];if(Zt(r)){var n=void 0;Dn(t[gzr])||(n=!t[gzr]),Dn(t[fCe])||(n=!t[fCe]),r=n}return r}a(Czr,"_isCfgEnabled");function xzr(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[lUe]=E||"/",_[S2t]="Thu, 01 Jan 1970 00:00:01 GMT",_);return koe()||(v["max-age"]="0"),Szr(So,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||So),R=eu(w,";");if(R!==-1&&(w=Pi(RN(E,R)),T=wzr(Uf(E,R+1))),LN(T,cUe,v||o,x1,Dn),!Zt(_)){var x=koe();if(Dn(T[S2t])){var P=fl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),LN(T,S2t,bzr(N,x?hzr:mzr)||bzr(N,x?hzr:mzr)||So,x1)}}x||LN(T,"max-age",So+_,null,Dn)}var B=rCe();return B&&B.protocol==="https:"&&(LN(T,"secure",null,null,Dn),T2t===null&&(T2t=!L0o((Uu()||{})[jve])),T2t&&LN(T,"SameSite","None",null,Dn)),LN(T,lUe,b||n,null,Dn),Szr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[ln]-1;_>=0;_--)f[_].n===E&&f[FI](_,1)}a(g,"_removePendingCookie");function A(){I2t(e)&&f&&(Ct(f,function(E){vzr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Th(t||_zr,null,e).cfg,s=HI(t,function(E){E.setDf(E.cfg,O0o),r=E.ref(E.cfg,"cookieCfg"),n=r[lUe]||"/",o=r[cUe],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=Czr(t,r)!==!1,l=r.getCookie||B0o,u=r.setCookie||Tzr,d=r.delCookie||Tzr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=Czr(t,r)!==!1&&c&&I2t(e),_=_zr[Azr];return E&&_&&y!==_&&(E=TUe(_)),E},"isEnabled"),setEnabled:a(function(E){r[rU]=E,Dn(t[fCe])||(t[fCe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=vzr(r,E);if(!R){var x=m(_,v,b,T);TUe(y)?(u(E,x),w=!0):f&&(g(E),f[Bi]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=So,v=Izr(r,E);if(!v){if(TUe(y))_=l(E);else if(f)for(var b=f[ln]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=eu(w,";");_=R!==-1?Pi(RN(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return TUe(y)?v=y.purge(E,_):f&&(g(E),f[Bi]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return I2t(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[Azr]=y,y}a(xzr,"createCookieMgr");function I2t(t){if(SUe===null){SUe=!1,!UN&&w2t();try{var e=UN.v||{};SUe=e[x2t]!==void 0}catch(r){Vr(t,2,68,"Cannot access document.cookie - "+kp(r),{exception:ur(r)})}}return SUe}a(I2t,"areCookiesSupported");function wzr(t){var e={};if(t&&t[ln]){var r=Pi(t)[QI](";");Ct(r,function(n){if(n=Pi(n||So),n){var o=eu(n,"=");o===-1?e[n]=null:e[Pi(RN(n,o))]=Pi(Uf(n,o+1))}})}return e}a(wzr,"_extractParts");function bzr(t,e){return Or(t[e])?t[e]():null}a(bzr,"_formatDate");function Szr(t,e){var r=t||So;return zr(e,function(n,o){r+="; "+n+(Zt(o)?So:"="+o)}),r}a(Szr,"_formatCookieValue");function B0o(t){var e=So;if(!UN&&w2t(),UN.v){var r=UN.v[x2t]||So;yzr!==r&&(Ezr=wzr(r),yzr=r),e=Pi(Ezr[t]||So)}return e}a(B0o,"_getCookieValue");function Tzr(t,e){!UN&&w2t(),UN.v&&(UN.v[x2t]=t+"="+e)}a(Tzr,"_setCookieValue");function L0o(t){return Ai(t)?!!(F0(t,"CPU iPhone OS 12")||F0(t,"iPad; CPU OS 12")||F0(t,"Macintosh; Intel Mac OS X 10_14")&&F0(t,"Version/")&&F0(t,"Safari")||F0(t,"Macintosh; Intel Mac OS X 10_14")&&GB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||F0(t,"Chrome/5")||F0(t,"Chrome/6")||F0(t,"UnrealEngine")&&!F0(t,"Chrome")||F0(t,"UCBrowser/12")||F0(t,"UCBrowser/11")):!1}a(L0o,"uaDisallowsSameSiteNone");p();var F0o={perfEvtsSendAll:!1};function U0o(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){Ff(r.fn,[r.arg])})}a(U0o,"_runScheduledListeners");function fU(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[Bi]({fn:n,arg:o}),r.h=r.h||Pp(U0o,0,r)):Ff(n,[o]))})}a(fU,"_runListeners");var Rzr=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Th(e,F0o);n=c[kN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[voe]=function(u){o[Bi](u)},l[_oe]=function(u){for(var d=Qo(o,u);d>-1;)o[FI](d,1),d=Qo(o,u)},l[Ioe]=function(u){fU(o,Ioe,s,function(d){d[Ioe](u)})},l[sU]=function(u,d,f){fU(o,sU,s,function(h){h[sU](u,d,f)})},l[xoe]=function(u,d){fU(o,xoe,d?s:null,function(f){f[xoe](u,d)})},l[BN]=function(u){u&&(r||!u[$ve]())&&fU(o,BN,null,function(d){u.isAsync?Pp(function(){return d[BN](u)},0):d[BN](u)})},l[oUe]=function(u){u&&u[ln]&&fU(o,oUe,s,function(d){d[oUe](u)})},l[sUe]=function(u){u&&u[N1]&&fU(o,sUe,s,function(d){d[sUe](u)})},l[aUe]=function(u,d){if(u>0){var f=d||0;fU(o,aUe,s,function(h){h[aUe](u,f)})}},l[UI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[DN](),s.h=null,s.cb=[]},"_finishUnload"),f;if(fU(o,"unload",null,function(h){var m=h[UI](u);m&&(f||(f=[]),f[Bi](m))}),f)return Td(function(h){return pl(nUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var Boe="ctx",P2t="ParentContextKey",pCe="ChildrenContextKey",Q0o=null,IUe=(function(){function t(e,r,n){var o=this;if(o.start=fl(),o[P1]=e,o.isAsync=n,o[$ve]=function(){return!1},Or(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[aW]=function(c){return c?c===t[P2t]||c===t[pCe]?o[c]:(o[Boe]||{})[c]:null},o[TP]=function(c,l){if(c)if(c===t[P2t])o[c]||(o[$ve]=function(){return!0}),o[c]=l;else if(c===t[pCe])o[c]=l;else{var u=o[Boe]=o[Boe]||{};u[c]=l}},o.complete=function(){var c=0,l=o[aW](t[pCe]);if(lr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Vr(r[Qu],2,73,"Unexpected Exception during onComplete - "+ur(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[KB];!_&&A&&(_={}),E[KB]=_,_=e.ref(E,KB),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}sCe(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[tU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(M2t,"_createInternalContext");function IP(t,e,r,n){var o=Th(e),s=M2t(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[eC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),lr(d)&&(d=pU(d,o.cfg,r,f)),IP(d||c[D1](),o.cfg,r,f)}return a(u,"_createNew"),c[L0]=l,c[MN]=u,c}a(IP,"createProcessTelemetryContext");function Loe(t,e,r){var n=Th(e.config),o=M2t(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[UI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),lr(u)&&(u=pU(u,n.cfg,e,d)),Loe(u||s[D1](),e,d)}return a(l,"_createNew"),s[L0]=c,s[MN]=l,s}a(Loe,"createProcessTelemetryUnloadContext");function hCe(t,e,r){var n=Th(e.config),o=M2t(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[sW])&&d[sW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),lr(u)&&(u=pU(u,n.cfg,e,d)),hCe(u||s[D1](),e,d)}return a(l,"_createNew"),s[L0]=c,s[MN]=l,s}a(hCe,"createProcessTelemetryUpdateContext");function pU(t,e,r,n){var o=null,s=!n;if(lr(t)&&t[ln]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[eC])){var u=V0o(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?pU([n],e,r):o}a(pU,"createTelemetryProxyChain");function V0o(t,e,r){var n=null,o=Or(t[eC]),s=Or(t[iU]),c;t?c=t[NN]+"-"+t[pW]+"-"+Bzr++:c="Unknown-0-"+Bzr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Or(t[Ozr])&&(g=t[Ozr]()),g||(g=IP(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[NN]:G0o,T=g[Mzr];return T||(T=g[Mzr]={}),g.setNext(n),t&&xUe(g[Qf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:So;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Vr(g[Xv](),1,73,"Plugin ["+b+"] failed during "+y+" - "+ur(x)+", run flags: "+ur(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=XB(t);return _[k1]||_[Zve]?!1:(s&&t[iU](n),t[eC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[L0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=XB(t),v=t[Qf]||_[Qf];t&&(!v||v===g.core())&&!_[k1]&&(_[Qf]=null,_[k1]=!0,_[Zv]=!1,t[k1]&&t[k1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[L0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=XB(t),v=t[Qf]||_[Qf];t&&(!v||v===g.core())&&!_[k1]&&t[sW]&&t[sW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[L0](A)}return a(m,"_updatePlugin"),bh(l)}a(V0o,"createTelemetryPluginProxy");var W0o=(function(){function t(e,r,n,o){var s=this,c=IP(e,r,n,o);mW(s,c,Fu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function RUe(){var t=[];function e(n){n&&t[Bi](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Vr(n[Xv](),2,73,"Unexpected error calling unload handler - "+ur(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(RUe,"createUnloadHandlerContainer");p();var PUe,kUe;function DUe(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Vr(n,2,73,"Unloading:"+ur(c))}}),PUe&&o[ln]>PUe&&(kUe?kUe("doUnload",o):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Sh(t,n),PUe&&t[ln]>PUe&&(kUe?kUe("Add",t):Vr(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(DUe,"createUnloadHookContainer");var O2t,hU="getPlugin",z0o=(O2t={},O2t[KB]={isVal:aU,v:{}},O2t),mCe=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[VB]=function(h,m,g,A){u(h,m,A),r=!0},f[k1]=function(h,m){var g=f[Qf];if(!g||h&&g!==h[Qf]())return;var A,y=!1,E=h||Loe(null,g,o&&o[hU]?o[hU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[Xv]()),A===!0&&E[L0](_),d())}return a(v,"_unloadCallback"),!f[nU]||f[nU](E,_,v)!==!0?v():A=!0,A},f[sW]=function(h,m){var g=f[Qf];if(!g||h&&g!==h[Qf]())return;var A,y=!1,E=h||hCe(null,g,o&&o[hU]?o[hU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[D1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},hW(f,"_addUnloadCb",function(){return s},"add"),hW(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[Xv]=function(f){return l(f)[Xv]()},e[Zv]=function(){return r},e.setInitialized=function(f){r=f},e[iU]=function(f){o=f},e[L0]=function(f,h){h?h[L0](f):o&&Or(o[eC])&&o[eC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||IP(null,{},e[Qf]);o&&o[hU]?h=m[MN](null,o[hU]):h=m[MN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Th(f,z0o,yW(h)),!m&&h&&(m=h[Q9e]()[D1]());var g=o;o&&o[hU]&&(g=o[hU]()),e[Qf]=h,n=IP(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[Qf]=null,n=null,o=null,c=DUe(),s=RUe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Y0o(t,e,r){var n={id:e,fn:r};Sh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[FI](c,1),-1})},"remove")};return o}a(Y0o,"_addInitializer");function K0o(t,e,r){for(var n=!1,o=t[ln],s=0;s"},"v")})}a(smo,"_createUnloadHook");var F2t=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q;bi(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[Zv]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[VB]=function(ie,le,Ne,we){g&&Wc(Fzr),U[Zv]()&&Wc("Core cannot be initialized more than once"),e=Th(ie,B2t,Ne||U[Qu],!1),ie=e.cfg,qe(e[kN](function(st){var Et=st.cfg;L=Et.initInMemoMaxSize||X0o,z(Et);var kt=st.ref(st.cfg,KB);zr(kt,function(Gt){st.ref(kt,Gt)})})),s=we,b=omo(e,v,s&&U[Qve](),b),K(),U[Qu]=Ne;var Be=ie[fW];if(f=[],f[Bi].apply(f,lW(lW([],le,!1),Be,!1)),h=ie[dW],Oe(null),(!m||m[ln]===0)&&Wc("No "+dW+" available"),h&&h[ln]>1){var tt=U[tU]("TeeChannelController");(!tt||!tt.plugin)&&Vr(n,1,28,"TeeChannel required")}imo(ie,R,n),R=null,r=!0,N===vP.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[Bi](le)}),bh(ie)},U.track=function(ie){xUe(U[woe](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),Wc("Invalid telemetry item")),!ie[P1]&&Zt(ie[P1])&&(ue(ie),Wc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||cU(new Date),ie.ver=ie.ver||"4.0",!g&&U[Zv]()&&N===vP.ACTIVE?ae()[L0](ie):N!==vP.INACTIVE&&o[ln]<=L&&o[Bi](ie)},function(){return{item:ie}},!ie.sync)},U[Q9e]=ae,U[Qve]=function(){return s||(s=new Rzr(e.cfg),U[J0o]=s),s},U[voe]=function(ie){U.getNotifyMgr()[voe](ie)},U[_oe]=function(ie){s&&s[_oe](ie)},U.getCookieMgr=function(){return u||(u=xzr(e.cfg,U[Qu])),u},U.setCookieMgr=function(ie){u!==ie&&(JB(u,!1),u=ie)},U[woe]=function(){return c||l||kzr()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[ln]},U.releaseQueue=function(){if(r&&o[ln]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[L0](le)}):Vr(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[DN](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Zt(le)){w=null,N=vP.INACTIVE;var we="Please provide instrumentation key";r?(Vr(n,1,100,we),J()):Wc(we);return}var Be=[];Um(le)?(Be[Bi](le),w=null):w=le,Um(Ne)?(Be[Bi](Ne),B=null):B=Ne,Be[ln]?W(ie,Be):$()}}a(z,"_handleIKeyEndpointPromises");function W(ie,le){j=!1,N=3;var Ne=aU(ie.initTimeOut)?ie.initTimeOut:emo,we=rUe(le);M&&M[DN](),M=Pp(function(){M=null,j||$()},Ne),pl(we,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[WB];if(tt&&tt[ln]){var st=tt[0];if(w=st&&st[WB],tt[ln]>1){var Et=tt[1];B=Et&&Et[WB]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=B)}$()}catch{j||$()}})}a(W,"_waitForInitPromises");function $(){j=!0,Zt(w)?(N=vP.INACTIVE,Vr(n,1,112,"ikey can't be resolved from promises")):N=vP.ACTIVE,J()}a($,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[rU])&&!Q){var le=ie||n&&n.queue[ln]>0;le&&(q||(q=!0,qe(e[kN](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[rU],O[DN]()),O=U9e(Z,we),O.unref(),O[rU]=Be}))),O[rU]=!0)}return O}a(ne,"_startLogPoller"),U[Rkt]=function(){Q=!0,O&&O[DN](),Z()},mW(U,function(){return A},["addTelemetryInitializer"]),U[UI]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||Wc(Z0o),g&&Wc(Fzr);var we={reason:50,isAsync:ie,flushComplete:!1},Be;ie&&!le&&(Be=Td(function(Et){le=Et}));var tt=Loe(Fe(),U);tt[qve](function(){v.run(U[Qu]),vUe([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(tt,we),U[Rkt](),tt[L0](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Be},U[tU]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(qzr);return}var Be=ve(ie[NN]);if(Be&&!le){we&&we(!1),X("Plugin ["+ie[NN]+"] is already loaded!");return}var tt={reason:16};function st(Gt){f[Bi](ie),tt.added=[ie],Oe(tt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],kt={reason:2,isAsync:!!Ne};Pe(Et,kt,function(Gt){Gt?(tt.removed=Et,tt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[Zv]()){Ne={reason:1,cfg:e.cfg,oldCfg:Aoe({},e.cfg),newConfig:Aoe({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[fW]=we[fW],ie[dW]=we[dW]}e._block(function(Be){var tt=Be.cfg;L2t(Be,tt,ie,le),le||zr(tt,function(st){eA(ie,st)||Be.set(tt,st,B1)}),Be.setDf(tt,B2t)},!0),e.notify(),Ne&&pe(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=Nzr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=qe,hW(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=HI(e.cfg,ie,U[Qu]):le=nmo(R,ie),smo(le)},U.getWParam=function(){return jB()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[NN]&&we[q9e]&&!ie[we.identifier]){var Be=we[NN]+"="+we[q9e];P[Bi](Be),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Th({},B2t,U[Qu]),e.cfg[j9e]=1,qi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!1)},"s")}),qi(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||So},"g")}),qi(U,"logger",{g:a(function(){return n||(n=new Ooe(e.cfg),e[Qu]=n),n},"g"),s:a(function(le){e[Qu]=le,n!==le&&(JB(n,!1),n=le)},"s")}),U[Qu]=new Ooe(e.cfg),x=[];var ie=U.config[fW]||[];ie.splice(0,ie[ln]),Sh(ie,x),A=new Lzr,o=[],JB(s,!1),s=null,c=null,l=null,JB(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=L1("AIBaseCore",!0),_=RUe(),T=null,w=null,v=DUe(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,B=null,L=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=IP(Fe(),e.cfg,U);return ie[qve](ne),ie}a(ae,"_createTelCtx");function Oe(ie){var le=rmo(U[Qu],lzr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=wUe(Sh(m,le[dW]));var Ne=Sh(wUe(le[Qf]),m);x=bh(Ne);var we=U.config[fW]||[];we.splice(0,we[ln]),Sh(we,x);var Be=ae();m&&m[ln]>0&&N2t(Be[MN](m),Ne),N2t(Be,Ne),ie&&pe(ie)}a(Oe,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[NN]===ie&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[Bi](Be)}),!Ne&&we[ln]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Be){XB(Ne)[Zve]=!Be},"setEnabled"),isEnabled:a(function(){var Be=XB(Ne);return!Be[k1]&&!Be[Zve]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],Et={reason:1,isAsync:Be};Pe(st,Et,function(kt){kt&&Oe({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Fe(){if(!d){var ie=(x||[]).slice();Qo(ie,A)===-1&&ie[Bi](A),d=pU(wUe(ie),e.cfg,U)}return d}a(Fe,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[ln]>0){var we=pU(ie,e.cfg,U),Be=Loe(we,U);Be[qve](function(){var tt=!1,st=[];Ct(f,function(kt,Gt){Uzr(kt,ie)?tt=!0:st[Bi](kt)}),f=st,D=null,P=null;var Et=[];h&&(Ct(h,function(kt,Gt){var jt=[];Ct(kt,function(Ie){Uzr(Ie,ie)?tt=!0:jt[Bi](Ie)}),Et[Bi](jt)}),h=Et),Ne&&Ne(tt),ne()}),Be[L0](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[ln]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[Coe],iKey:w,time:cU(new Date),baseType:dCe.dataType,baseData:{message:le[ON]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Be=1,tt=!1,st=null;we=we||5e3;function Et(){Be--,tt&&Be===0&&(st&&st[DN](),st=null,le&&le(tt),le=null)}if(a(Et,"doCallback"),m&&m[ln]>0){var kt=ae()[MN](m);kt.iterate(function(Gt){if(Gt.flush){Be++;var jt=!1;Gt.flush(ie,function(){jt=!0,Et()},Ne)||jt||(ie&&st==null?st=Pp(function(){st=null,Et()},we):Et())}})}return tt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ie;qe(e[kN](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[iUe];(ie!==we||!ie)&&(we||(we=tmo),t2t(le.cfg,iUe,we),ie=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[Qve]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function pe(ie){var le=hCe(Fe(),U);le[qve](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[L0](ie)}a(pe,"_doUpdate");function X(ie){var le=U[Qu];le?(Vr(le,2,73,ie),ne()):Wc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[Qve]();le&&le[sU]([ie],2)}a(ue,"_notifyInvalidEvent");function qe(ie){v.add(ie)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();function gCe(t,e){try{if(t&&t!==""){var r=o_().parse(t);if(r&&r[Dkt]&&r[Dkt]>=r.itemsAccepted&&r.itemsReceived-r.itemsAccepted===r.errors[ln])return r}}catch(n){Vr(e,1,43,"Cannot parse the response. "+(n[P1]||ur(n)),{response:t})}return null}a(gCe,"parseResponse");p();var xP="",amo="NoResponseBody",jzr="&"+amo+"=true",U2t="POST",Q2t=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;j(),E[VB]=function(M,O){o=O,n&&Vr(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=rCe();O&&O.protocol&&O.protocol[CP]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[ln]?R(M,O):null},E.getFallbackInst=function(){return d},E[nU]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[N1]){M(q);return}try{var U=Ri("CompressionStream");if(!Or(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(Ai(q[N1])?new TextEncoder().encode(q[N1]):q[N1]),re.close()},"start")}),W=z.pipeThrough(new U("gzip")),$=W.getReader(),J=[],ne=0,H=!1;return pl($.read(),a(function re(ae){if(!H&&!ae.rejected){var Oe=ae[WB];if(!Oe.done)return J[Bi](Oe[WB]),ne+=Oe.value[ln],pl($.read(),re);for(var ve=new Uint8Array(ne),Fe=0,Pe=0,Z=J;Pe0&&(Ct(Fu(ve),function(K){H.append(K,ve[K])}),Fe[Vve]=H),u?Fe.credentials=u:v&&s&&(Fe.credentials="include"),q&&(Fe.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=jzr)):ae=!0);var Pe=new Request(U,Fe);try{Pe[y2t]=!0}catch{}if(!q&&r&&($=Td(function(K,pe){J=K,ne=pe})),!U){w(O),J&&J(!1);return}function Z(K,pe){pe?x(O,s?0:pe,{},s?xP:K):x(O,s?0:400,{},s?xP:K)}a(Z,"_handleError");function ee(K,pe,X){var ue=K[SP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,X||xP,pe):x(O,ue,{},X||xP)}a(ee,"_onFetchComplete");try{pl(fetch(s?U:Pe,s?Fe:null),function(K){if(q&&(e-=re,re=0),!Oe)if(Oe=!0,K.rejected)Z(K.reason&&K.reason[ON],499),ne&&ne(K.reason);else{var pe=K[WB];try{!s&&!pe.ok?(pe[SP]?Z(pe.statusText,pe[SP]):Z(pe.statusText,499),J&&J(!1)):s&&!pe.body?(ee(pe,null,xP),J&&J(!0)):pl(pe.text(),function(X){ee(pe,M,X[WB]),J&&J(!0)})}catch(X){pe&&pe[SP]?Z(ur(X),pe[SP]):Z(ur(X),499),ne&&ne(X)}}})}catch(K){Oe||(Z(ur(K),499),ne&&ne(K))}return ae&&!Oe&&(Oe=!0,x(O,200,{}),J&&J(!0)),s&&!Oe&&M[cW]>0&&y&&y.set(function(){Oe||(Oe=!0,x(O,500,{}),J&&J(!0))},M[cW]),$}a(B,"_doFetchSender");function L(M,O,q){var Q=tf(),U=new XDomainRequest,z=M[N1];U.onload=function(){var H=Roe(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?xP:eCe(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",$=M[boe];if(!$){w(O);return}if(!s&&$.lastIndexOf(W,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Vr(o,2,40,". "+J),T(J,O);return}var ne=s?$:$[bP](/^(https?:)/,"");U.open(U2t,ne),M[cW]&&(U[cW]=M[cW]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}a(L,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var Yzr="on",Hzr="attachEvent",Gzr="addEventListener",$zr="detachEvent",Vzr="removeEventListener",q2t="events";var gTl=L1("aiEvtPageHide"),ATl=L1("aiEvtPageShow"),cmo=/\.[\.]+/g,lmo=/[\.]+$/,umo=1,NUe=mUe("events"),dmo=/^([^.]*)(?:\.(.+)|)/;function Wzr(t){return t&&t[bP]?t[bP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,So):t}a(Wzr,"_normalizeNamespace");function j2t(t,e){if(e){var r=So;lr(e)?(r=So,Ct(e,function(o){o=Wzr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=Wzr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||So)+r)}var n=dmo.exec(t||So)||[];return{type:n[1],ns:(n[2]||So).replace(cmo,".").replace(lmo,So)[QI](".").sort().join(".")}}a(j2t,"_getEvtNamespace");function Kzr(t,e,r){r===void 0&&(r=!0);var n=NUe.get(t,q2t,{},r),o=n[e];return o||(o=n[e]=[]),o}a(Kzr,"_getRegisteredEvents");function Jzr(t,e,r,n){t&&e&&e[zB]&&(t[Vzr]?t[Vzr](e[zB],r,n):t[$zr]&&t[$zr](Yzr+e[zB],r))}a(Jzr,"_doDetach");function fmo(t,e,r,n){var o=!1;return t&&e&&e[zB]&&r&&(t[Gzr]?(t[Gzr](e[zB],r,n),o=!0):t[Hzr]&&(t[Hzr](Yzr+e[zB],r),o=!0)),o}a(fmo,"_doAttach");function zzr(t,e,r,n){for(var o=e[ln];o--;){var s=e[o];s&&(!r.ns||r.ns===s[Pkt].ns)&&(!n||n(s))&&(Jzr(t,s[Pkt],s.handler,s.capture),e[FI](o,1))}}a(zzr,"_doUnregister");function pmo(t,e,r){if(e[zB])zzr(t,Kzr(t,e[zB]),e,r);else{var n=NUe.get(t,q2t,{});zr(n,function(o,s){zzr(t,s,e,r)}),Fu(n)[ln]===0&&NUe.kill(t,q2t)}}a(pmo,"_unregisterEvents");function ACe(t,e){var r;return e?(lr(e)?r=[t].concat(e):r=[t,e],r=j2t("xx",r).ns[QI](".")):r=t,r}a(ACe,"mergeEvtNamespace");function MUe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=j2t(e,n);if(s=fmo(t,c,r,o),s&&NUe.accept(t)){var l={guid:umo++,evtName:c,handler:r,capture:o};Kzr(t,c.type)[Bi](l)}}catch{}return s}a(MUe,"eventOn");function H2t(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=j2t(e,n),c=!1;pmo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||Jzr(t,s,r,o)}catch{}}a(H2t,"eventOff");p();var yCe="sampleRate",ECe="ProcessLegacy",OUe="http.method",EW="https://dc.services.visualstudio.com",QN="/v2/track",ky="not_specified";p();var BUe=wkt({requestContextHeader:[0,"Request-Context"],requestContextTargetKey:[1,"appId"],requestContextAppIdFormat:[2,"appId=cid-v1:"],requestIdHeader:[3,"Request-Id"],traceParentHeader:[4,"traceparent"],traceStateHeader:[5,"tracestate"],sdkContextHeader:[6,"Sdk-Context"],sdkContextHeaderAppIdRequest:[7,"appId"],requestContextHeaderLowerCase:[8,"request-context"]});p();p();var _W="split",ho="length",vW="toLowerCase",gU="ingestionendpoint",AU="toString",G2t="removeItem",Foe="message",iYr="count";var _Ce="stringify",vCe="pathname",CW="match";var Dy="name";var tA="properties",Ny="measurements",CCe="sizeInBytes",bCe="typeName",Uoe="exceptions",bW="severityLevel",LUe="problemGroup",SW="parsedStack",SCe="hasFullStack",TCe="assembly",qN="fileName",TW="line",Qoe="aiDataContract",IW="duration";function $2t(t,e,r){var n=e[ho],o=oYr(t,e);if(o[ho]!==n){for(var s=0,c=o;r[c]!==void 0;)s++,c=Uf(o,0,147)+sYr(s);o=c}return o}a($2t,"dataSanitizeKeyAndAddUniqueness");function oYr(t,e){var r;return e&&(e=Pi(Bu(e)),e[ho]>150&&(r=Uf(e,0,150),Vr(t,2,57,"name is too long. It has been truncated to 150 characters.",{name:e},!0))),r||e}a(oYr,"dataSanitizeKey");function tu(t,e,r){r===void 0&&(r=1024);var n;return e&&(r=r||1024,e=Pi(Bu(e)),e[ho]>r&&(n=Uf(e,0,r),Vr(t,2,61,"string value is too long. It has been truncated to "+r+" characters.",{value:e},!0))),n||e}a(tu,"dataSanitizeString");function xW(t,e,r){return Ai(e)&&(e=m2t(e,r)),z2t(t,e,2048,66)}a(xW,"dataSanitizeUrl");function ICe(t,e){var r;return e&&e[ho]>32768&&(r=Uf(e,0,32768),Vr(t,2,56,"message is too long, it has been truncated to 32768 characters.",{message:e},!0)),r||e}a(ICe,"dataSanitizeMessage");function V2t(t,e){var r;if(e){var n=""+e;n[ho]>32768&&(r=Uf(n,0,32768),Vr(t,2,52,"exception is too long, it has been truncated to 32768 characters.",{exception:e},!0))}return r||e}a(V2t,"dataSanitizeException");function s_(t,e){if(e){var r={};zr(e,function(n,o){if(Lu(o)&&lU())try{o=o_()[_Ce](o)}catch(s){Vr(t,2,49,"custom property is not valid",{exception:s},!0)}o=tu(t,o,8192),n=$2t(t,n,r),r[n]=o}),e=r}return e}a(s_,"dataSanitizeProperties");function a_(t,e){if(e){var r={};zr(e,function(n,o){n=$2t(t,n,r),r[n]=o}),e=r}return e}a(a_,"dataSanitizeMeasurements");function W2t(t,e){return e&&z2t(t,e,128,69)[AU]()}a(W2t,"dataSanitizeId");function z2t(t,e,r,n){var o;return e&&(e=Pi(Bu(e)),e[ho]>r&&(o=Uf(e,0,r),Vr(t,2,n,"input is too long, it has been truncated to "+r+" characters.",{data:e},!0))),o||e}a(z2t,"dataSanitizeInput");function sYr(t){var e="00"+t;return M9e(e,e[ho]-3)}a(sYr,"dsPadNumber");p();var aYr=ef()||{},cYr=0,mmo=[null,null,null,null,null];function lYr(t){var e=cYr,r=mmo,n=r[e];return aYr.createElement?r[e]||(n=r[e]=aYr.createElement("a")):n={host:gmo(t,!0)},n.href=t,e++,e>=r[ho]&&(e=0),cYr=e,n}a(lYr,"urlParseUrl");function gmo(t,e){var r=uYr(t,e)||"";if(r){var n=r[CW](/(www\d{0,5}\.)?([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[ho]>3&&Ai(n[2])&&n[2][ho]>0)return n[2]+(n[3]||"")}return r}a(gmo,"urlParseHost");function uYr(t,e){var r=null;if(t){var n=t[CW](/(\w{1,150}):\/\/([^\/:]{1,256})(:\d{1,20})?/i);if(n!=null&&n[ho]>2&&Ai(n[2])&&n[2][ho]>0&&(r=n[2]||"",e&&n[ho]>2)){var o=(n[1]||"")[vW](),s=n[3]||"";(o==="http"&&s===":80"||o==="https"&&s===":443")&&(s=""),r+=s}}return r}a(uYr,"urlParseFullHost");var Amo=[EW+QN,"https://breeze.aimon.applicationinsights.io"+QN,"https://dc-int.services.visualstudio.com"+QN];function FUe(t){return Qo(Amo,t[vW]())!==-1}a(FUe,"isInternalApplicationInsightsEndpoint");function dYr(t,e,r,n){var o,s=n,c=n;if(e&&e[ho]>0){var l=lYr(e);if(o=l.host,!s)if(l[vCe]!=null){var u=l.pathname[ho]===0?"/":l[vCe];u.charAt(0)!=="/"&&(u="/"+u),c=l[vCe],s=tu(t,r?r+" "+u:u)}else s=tu(t,e)}else o=n,s=n;return{target:o,name:s,data:c}}a(dYr,"AjaxHelperParseDependencyPath");p();p();var UUe=Uve({LocalStorage:0,SessionStorage:1});var qoe=void 0,fYr="";function pYr(t){try{if(Zt(Ry()))return null;var e=new Date()[AU](),r=Ri(t===UUe.LocalStorage?"localStorage":"sessionStorage"),n=fYr+e;r.setItem(n,e);var o=r.getItem(n)!==e;if(r[G2t](n),!o)return r}catch{}return null}a(pYr,"_getVerifiedStorageObject");function Y2t(){return QUe()?pYr(UUe.SessionStorage):null}a(Y2t,"_getSessionStorageObject");function K2t(t){fYr=t||""}a(K2t,"utlSetStoragePrefix");function QUe(t){return(t||qoe===void 0)&&(qoe=!!pYr(UUe.SessionStorage)),qoe}a(QUe,"utlCanUseSessionStorage");function J2t(t,e){var r=Y2t();if(r!==null)try{return r.getItem(e)}catch(n){qoe=!1,Vr(t,2,2,"Browser failed read of session storage. "+kp(n),{exception:ur(n)})}return null}a(J2t,"utlGetSessionStorage");function Z2t(t,e,r){var n=Y2t();if(n!==null)try{return n.setItem(e,r),!0}catch(o){qoe=!1,Vr(t,2,4,"Browser failed write to session storage. "+kp(o),{exception:ur(o)})}return!1}a(Z2t,"utlSetSessionStorage");function X2t(t,e){var r=Y2t();if(r!==null)try{return r[G2t](e),!0}catch(n){qoe=!1,Vr(t,2,6,"Browser failed removal of session storage item. "+kp(n),{exception:ur(n)})}return!1}a(X2t,"utlRemoveSessionStorage");p();var ymo=";",Emo="=";function xCe(t){if(!t)return{};var e=t[_W](ymo),r=Ove(e,function(o,s){var c=s[_W](Emo);if(c[ho]===2){var l=c[0][vW](),u=c[1];o[l]=u}return o},{});if(Fu(r)[ho]>0){if(r.endpointsuffix){var n=r.location?r.location+".":"";r[gU]=r[gU]||"https://"+n+"dc."+r.endpointsuffix}r[gU]=r[gU]||EW,GB(r[gU],"/")&&(r[gU]=r[gU].slice(0,-1))}return r}a(xCe,"parseConnectionString");p();var eDt=(function(){function t(e,r,n){var o=this,s=this;s.ver=1,s.sampleRate=100,s.tags={},s[Dy]=tu(e,n)||ky,s.data=r,s.time=cU(new Date),s[Qoe]={time:1,iKey:1,name:1,sampleRate:a(function(){return o.sampleRate===100?4:1},"sampleRate"),tags:1,data:1}}return a(t,"Envelope"),t})();p();var eL=(function(){function t(e,r,n,o){this.aiDataContract={ver:1,name:1,properties:0,measurements:0};var s=this;s.ver=2,s[Dy]=tu(e,r)||ky,s[tA]=s_(e,n),s[Ny]=a_(e,o)}return a(t,"Event"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Event",t.dataType="EventData",t})();p();var _mo=58,vmo=/^\s{0,50}(from\s|at\s|Line\s{1,5}\d{1,10}\s{1,5}of|\w{1,50}@\w{1,80}|[^\(\s\n]+:[0-9\?]+(?::[0-9\?]+)?)/,Cmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+):([0-9\?]+)\)?$/,bmo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\]]+):([0-9\?]+)\)?$/,Smo=/^(?:\s{0,50}at)?\s{0,50}([^\@\()\s]+)?\s{0,50}(?:\s|\@|\()\s{0,5}([^\(\s\n\)\]]+)\)?$/,Tmo=/(?:^|\(|\s{0,10}[\w\)]+\@)?([^\(\n\s\]\)]+)(?:\:([0-9]+)(?:\:([0-9]+))?)?\)?(?:,|$)/,Imo=/([^\(\s\n]+):([0-9]+):([0-9]+)$/,xmo=/([^\(\s\n]+):([0-9]+)$/,hYr="",joe="error",$I="stack",rDt="stackDetails",mYr="errorSrc",nDt="message",EYr="description",gYr=[{re:Cmo,len:5,m:1,fn:2,ln:3,col:4},{chk:Rmo,pre:wmo,re:bmo,len:4,m:1,fn:2,ln:3},{re:Smo,len:3,m:1,fn:2,hdl:yYr},{re:Tmo,len:2,fn:1,hdl:yYr}];function wmo(t){return t.replace(/(\(anonymous\))/,"")}a(wmo,"_scrubAnonymous");function Rmo(t){return eu(t,"[native")<0}a(Rmo,"_ignoreNative");function iDt(t,e){var r=t;return r&&!Ai(r)&&(JSON&&JSON[_Ce]?(r=JSON[_Ce](t),e&&(!r||r==="{}")&&(Or(t[AU])?r=t[AU]():r=""+t)):r=""+t+" - (Missing JSON.stringify)"),r||""}a(iDt,"_stringify");function _Yr(t,e){var r=t;return t&&(r&&!Ai(r)&&(r=t[nDt]||t[EYr]||r),r&&!Ai(r)&&(r=iDt(r,!0)),t.filename&&(r=r+" @"+(t.filename||"")+":"+(t.lineno||"?")+":"+(t.colno||"?"))),e&&e!=="String"&&e!=="Object"&&e!=="Error"&&eu(r||"",e)===-1&&(r=e+": "+r),r||""}a(_Yr,"_formatMessage");function Pmo(t){try{if(Lu(t))return"hasFullStack"in t&&"typeName"in t}catch{}return!1}a(Pmo,"_isExceptionDetailsInternal");function kmo(t){try{if(Lu(t))return"ver"in t&&"exceptions"in t&&"properties"in t}catch{}return!1}a(kmo,"_isExceptionInternal");function AYr(t){return t&&t.src&&Ai(t.src)&&t.obj&&lr(t.obj)}a(AYr,"_isStackDetails");function wW(t){var e=t||"";Ai(e)||(Ai(e[$I])?e=e[$I]:e=""+e);var r=e[_W](` +`);return{src:e,obj:r}}a(wW,"_convertStackObj");function Dmo(t){for(var e=[],r=t[_W](` +`),n=0;n0){e=[];var n=0,o=!1,s=0;Ct(r,function(y){if(o||Fmo(y)){var E=Bu(y);o=!0;var _=Umo(E,n);_&&(s+=_[CCe],e.push(_),n++)}});var c=32*1024;if(s>c)for(var l=0,u=e[ho]-1,d=0,f=l,h=u;lc){var A=h-f+1;e.splice(f,A);break}f=l,h=u,l++,u--}}return e}a(Mmo,"_parseStack");function qUe(t){var e="";if(t&&(e=t.typeName||t[Dy]||"",!e))try{var r=/function (.{1,200})\(/,n=r.exec(t.constructor[AU]());e=n&&n[ho]>1?n[1]:""}catch{}return e}a(qUe,"_getErrorType");function tDt(t){if(t)try{if(!Ai(t)){var e=qUe(t),r=iDt(t,!1);return(!r||r==="{}")&&(t[joe]&&(t=t[joe],e=qUe(t)),r=iDt(t,!0)),eu(r,e)!==0&&e!=="String"?e+":"+r:r}}catch{}return""+(t||"")}a(tDt,"_formatErrorCode");var RW=(function(){function t(e,r,n,o,s,c){this.aiDataContract={ver:1,exceptions:1,severityLevel:0,properties:0,measurements:0};var l=this;l.ver=2,kmo(r)?(l[Uoe]=r[Uoe]||[],l[tA]=r[tA],l[Ny]=r[Ny],r[bW]&&(l[bW]=r[bW]),r.id&&(l.id=r.id,r[tA].id=r.id),r[LUe]&&(l[LUe]=r[LUe]),Zt(r.isManual)||(l.isManual=r.isManual)):(n||(n={}),c&&(n.id=c),l[Uoe]=[CYr(e,r,n)],l[tA]=s_(e,n),l[Ny]=a_(e,o),s&&(l[bW]=s),c&&(l.id=c))}return a(t,"Exception"),t.CreateAutoException=function(e,r,n,o,s,c,l,u){var d=qUe(s||c||e);return{message:_Yr(e,d),url:r,lineNumber:n,columnNumber:o,error:tDt(s||c||e),evt:tDt(c||e),typeName:d,stackDetails:vYr(l||s||c),errorSrc:u}},t.CreateFromInterface=function(e,r,n,o){var s=r[Uoe]&&HB(r[Uoe],function(l){return Lmo(e,l)}),c=new t(e,jI(jI({},r),{exceptions:s}),n,o);return c},t.prototype.toInterface=function(){var e=this,r=e.exceptions,n=e.properties,o=e.measurements,s=e.severityLevel,c=e.problemGroup,l=e.id,u=e.isManual,d=r instanceof Array&&HB(r,function(f){return f.toInterface()})||void 0;return{ver:"4.0",exceptions:d,severityLevel:s,properties:n,measurements:o,problemGroup:c,id:l,isManual:u}},t.CreateSimpleException=function(e,r,n,o,s,c){var l;return{exceptions:[(l={},l[SCe]=!0,l.message=e,l.stack=s,l.typeName=r,l)]}},t.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",t.dataType="ExceptionData",t.formatError=tDt,t})();var Omo=bh({id:0,outerId:0,typeName:1,message:1,hasFullStack:0,stack:0,parsedStack:2});function Bmo(){var t=this,e=lr(t[SW])&&HB(t[SW],function(n){return qmo(n)}),r={id:t.id,outerId:t.outerId,typeName:t[bCe],message:t[Foe],hasFullStack:t[SCe],stack:t[$I],parsedStack:e||void 0};return r}a(Bmo,"_toInterface");function CYr(t,e,r){var n,o,s,c,l,u,d,f;if(Pmo(e))c=e[bCe],l=e[Foe],d=e[$I],f=e[SW]||[],u=e[SCe];else{var h=e,m=h&&h.evt;QB(h)||(h=h[joe]||m||h),c=tu(t,qUe(h))||ky,l=ICe(t,_Yr(e||h,c))||ky;var g=e[rDt]||vYr(e);f=Mmo(g),lr(f)&&HB(f,function(A){A[TCe]=tu(t,A[TCe]),A[qN]=tu(t,A[qN])}),d=V2t(t,Nmo(g)),u=lr(f)&&f[ho]>0,r&&(r[bCe]=r[bCe]||c)}return n={},n[Qoe]=Omo,n.id=o,n.outerId=s,n.typeName=c,n.message=l,n[SCe]=u,n.stack=d,n.parsedStack=f,n.toInterface=Bmo,n}a(CYr,"_createExceptionDetails");function Lmo(t,e){var r=lr(e[SW])&&HB(e[SW],function(o){return Qmo(o)})||e[SW],n=CYr(t,jI(jI({},e),{parsedStack:r}));return n}a(Lmo,"_createExDetailsFromInterface");function bYr(t,e){var r=e[CW](Imo);if(r&&r[ho]>=4)t[qN]=r[1],t[TW]=parseInt(r[2]);else{var n=e[CW](xmo);n&&n[ho]>=3?(t[qN]=n[1],t[TW]=parseInt(n[2])):t[qN]=e}}a(bYr,"_parseFilename");function yYr(t,e,r){var n=t[qN];e.fn&&r&&r[ho]>e.fn&&(e.ln&&r[ho]>e.ln?(n=Pi(r[e.fn]||""),t[TW]=parseInt(Pi(r[e.ln]||""))||0):n=Pi(r[e.fn]||"")),n&&bYr(t,n)}a(yYr,"_handleFilename");function Fmo(t){var e=!1;if(t&&Ai(t)){var r=Pi(t);r&&(e=vmo.test(r))}return e}a(Fmo,"_isStackFrame");var SYr=bh({level:1,method:1,assembly:0,fileName:0,line:0});function Umo(t,e){var r,n;if(t&&Ai(t)&&Pi(t)){n=(r={},r[Qoe]=SYr,r.level=e,r.assembly=Pi(t),r.method=hYr,r.fileName="",r.line=0,r.sizeInBytes=0,r);for(var o=0;o=s.len){s.m&&(n.method=Pi(c[s.m]||hYr)),s.hdl?s.hdl(n,s,c):s.fn&&(s.ln?(n[qN]=Pi(c[s.fn]||""),n[TW]=parseInt(Pi(c[s.ln]||""))||0):bYr(n,c[s.fn]||""));break}o++}}return TYr(n)}a(Umo,"_extractStackFrame");function Qmo(t){var e,r=(e={},e[Qoe]=SYr,e.level=t.level,e.method=t.method,e.assembly=t[TCe],e.fileName=t[qN],e.line=t[TW],e.sizeInBytes=0,e);return TYr(r)}a(Qmo,"_stackFrameFromInterface");function TYr(t){var e=_mo;return t&&(e+=t.method[ho],e+=t.assembly[ho],e+=t.fileName[ho],e+=t.level.toString()[ho],e+=t.line.toString()[ho],t[CCe]=e),t}a(TYr,"_populateFrameSizeInBytes");function qmo(t){return{level:t.level,method:t.method,assembly:t[TCe],fileName:t[qN],line:t[TW]}}a(qmo,"_parsedFrameToInterface");p();p();var IYr=(function(){function t(){this.aiDataContract={name:1,kind:0,value:1,count:0,min:0,max:0,stdDev:0},this.kind=0}return a(t,"DataPoint"),t})();var tL=(function(){function t(e,r,n,o,s,c,l,u,d){this.aiDataContract={ver:1,metrics:1,properties:0};var f=this;f.ver=2;var h=new IYr;h[iYr]=o>0?o:void 0,h.max=isNaN(c)||c===null?void 0:c,h.min=isNaN(s)||s===null?void 0:s,h[Dy]=tu(e,r)||ky,h.value=n,h.stdDev=isNaN(l)||l===null?void 0:l,f.metrics=[h],f[tA]=s_(e,u),f[Ny]=a_(e,d)}return a(t,"Metric"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",t.dataType="MetricData",t})();p();p();var wCe="";function jUe(t){(isNaN(t)||t<0)&&(t=0),t=IWr(t);var e=wCe+t%1e3,r=wCe+R1(t/1e3)%60,n=wCe+R1(t/(1e3*60))%60,o=wCe+R1(t/(1e3*60*60))%24,s=R1(t/(1e3*60*60*24));return e=e[ho]===1?"00"+e:e[ho]===2?"0"+e:e,r=r[ho]<2?"0"+r:r,n=n[ho]<2?"0"+n:n,o=o[ho]<2?"0"+o:o,(s>0?s+".":wCe)+o+":"+n+":"+r+"."+e}a(jUe,"msToTimeSpan");var PW=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,properties:0,measurements:0,id:0};var u=this;u.ver=2,u.id=W2t(e,l),u.url=xW(e,n),u[Dy]=tu(e,r)||ky,isNaN(o)||(u[IW]=jUe(o)),u[tA]=s_(e,s),u[Ny]=a_(e,c)}return a(t,"PageView"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",t.dataType="PageviewData",t})();p();var kW=(function(){function t(e,r,n,o,s,c,l,u,d,f,h,m){d===void 0&&(d="Ajax"),this.aiDataContract={id:1,ver:1,name:0,resultCode:0,duration:0,success:0,data:0,target:0,type:0,properties:0,measurements:0,kind:0,value:0,count:0,min:0,max:0,stdDev:0,dependencyKind:0,dependencySource:0,commandName:0,dependencyTypeName:0};var g=this;g.ver=2,g.id=r,g[IW]=jUe(s),g.success=c,g.resultCode=l+"",g.type=tu(e,d);var A=dYr(e,n,u,o);g.data=xW(e,o)||A.data,g.target=tu(e,A.target),f&&(g.target="".concat(g.target," | ").concat(f)),g[Dy]=tu(e,A[Dy]),g[tA]=s_(e,h),g[Ny]=a_(e,m)}return a(t,"RemoteDependencyData"),t.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",t.dataType="RemoteDependencyData",t})();p();var DW=(function(){function t(e,r,n,o,s){this.aiDataContract={ver:1,message:1,severityLevel:0,properties:0};var c=this;c.ver=2,r=r||ky,c[Foe]=ICe(e,r),c[tA]=s_(e,o),c[Ny]=a_(e,s),n&&(c[bW]=n)}return a(t,"Trace"),t.envelopeType="Microsoft.ApplicationInsights.{0}.Message",t.dataType="MessageData",t})();p();var NW=(function(){function t(e,r,n,o,s,c,l){this.aiDataContract={ver:1,name:0,url:0,duration:0,perfTotal:0,networkConnect:0,sentRequest:0,receivedResponse:0,domProcessing:0,properties:0,measurements:0};var u=this;u.ver=2,u.url=xW(e,n),u[Dy]=tu(e,r)||ky,u[tA]=s_(e,s),u[Ny]=a_(e,c),l&&(u.domProcessing=l.domProcessing,u[IW]=l[IW],u.networkConnect=l.networkConnect,u.perfTotal=l.perfTotal,u.receivedResponse=l.receivedResponse,u.sentRequest=l.sentRequest)}return a(t,"PageViewPerformance"),t.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",t.dataType="PageviewPerformanceData",t})();p();var rL=(function(){function t(e,r){this.aiDataContract={baseType:1,baseData:1},this.baseType=e,this.baseData=r}return a(t,"Data"),t})();p();function EU(t){var e="ai."+t+".";return function(r){return e+r}}a(EU,"_aiNameFunc");var RCe=EU("application"),U0=EU("device"),HUe=EU("location"),Hoe=EU("operation"),oDt=EU("session"),yU=EU("user"),MW=EU("cloud"),PCe=EU("internal"),kCe=(function(t){Py(e,t);function e(){return t.call(this)||this}return a(e,"ContextTagKeys"),e})(r2t({applicationVersion:RCe("ver"),applicationBuild:RCe("build"),applicationTypeId:RCe("typeId"),applicationId:RCe("applicationId"),applicationLayer:RCe("layer"),deviceId:U0("id"),deviceIp:U0("ip"),deviceLanguage:U0("language"),deviceLocale:U0("locale"),deviceModel:U0("model"),deviceFriendlyName:U0("friendlyName"),deviceNetwork:U0("network"),deviceNetworkName:U0("networkName"),deviceOEMName:U0("oemName"),deviceOS:U0("os"),deviceOSVersion:U0("osVersion"),deviceRoleInstance:U0("roleInstance"),deviceRoleName:U0("roleName"),deviceScreenResolution:U0("screenResolution"),deviceType:U0("type"),deviceMachineName:U0("machineName"),deviceVMName:U0("vmName"),deviceBrowser:U0("browser"),deviceBrowserVersion:U0("browserVersion"),locationIp:HUe("ip"),locationCountry:HUe("country"),locationProvince:HUe("province"),locationCity:HUe("city"),operationId:Hoe("id"),operationName:Hoe("name"),operationParentId:Hoe("parentId"),operationRootId:Hoe("rootId"),operationSyntheticSource:Hoe("syntheticSource"),operationCorrelationVector:Hoe("correlationVector"),sessionId:oDt("id"),sessionIsFirst:oDt("isFirst"),sessionIsNew:oDt("isNew"),userAccountAcquisitionDate:yU("accountAcquisitionDate"),userAccountId:yU("accountId"),userAgent:yU("userAgent"),userId:yU("id"),userStoreRegion:yU("storeRegion"),userAuthUserId:yU("authUserId"),userAnonymousUserAcquisitionDate:yU("anonUserAcquisitionDate"),userAuthenticatedUserAcquisitionDate:yU("authUserAcquisitionDate"),cloudName:MW("name"),cloudRole:MW("role"),cloudRoleVer:MW("roleVer"),cloudRoleInstance:MW("roleInstance"),cloudEnvironment:MW("environment"),cloudLocation:MW("location"),cloudDeploymentUnit:MW("deploymentUnit"),internalNodeName:PCe("nodeName"),internalSdkVersion:PCe("sdkVersion"),internalAgentVersion:PCe("agentVersion"),internalSnippet:PCe("snippet"),internalSdkSrc:PCe("sdkSrc")}));p();var Ih=new kCe;p();function xYr(t,e){H2t(t,null,null,e)}a(xYr,"_disableEvents");function sDt(t){var e=ef(),r=Uu(),n=!1,o=[],s=1;r&&!Zt(r.onLine)&&!r.onLine&&(s=2);var c=0,l=m(),u=ACe(L1("OfflineListener"),t);try{if(f(tf())&&(n=!0),e){var d=e.body||e;d.ononline&&f(d)&&(n=!0)}}catch{n=!1}function f(b){var T=!1;return b&&(T=MUe(b,"online",y,u),T&&MUe(b,"offline",E,u)),T}a(f,"_enableEvents");function h(){return l}a(h,"_isOnline");function m(){return!(c===2||s===2)}a(m,"calCurrentState");function g(){var b=m();l!==b&&(l=b,Ct(o,function(T){var w={isOnline:l,rState:s,uState:c};try{T(w)}catch{}}))}a(g,"listnerNoticeCheck");function A(b){c=b,g()}a(A,"setOnlineState");function y(){s=1,g()}a(y,"_setOnline");function E(){s=2,g()}a(E,"_setOffline");function _(){var b=tf();if(b&&n){if(xYr(b,u),e){var T=e.body||e;Dn(T.ononline)||xYr(T,u)}n=!1}}a(_,"_unload");function v(b){return o.push(b),{rm:a(function(){var T=o.indexOf(b);if(T>-1)return o.splice(T,1)},"rm")}}return a(v,"addListener"),{isOnline:h,isListening:a(function(){return n},"isListening"),unload:_,addListener:v,setOnlineState:A}}a(sDt,"createOfflineListener");var GUe="AppInsightsChannelPlugin";p();p();p();p();p();var _U="duration";p();var xh="tags",$Ue="deviceType",tC="data",jN="name",OW="traceID",Mo="length",vU="stringify",CU="measurements",VI="dataType",bU="envelopeType",nL="toString",iL="enqueue",oL="count",WI="push",DCe="emitLineDelimitedJson",SU="clear",Goe="markAsSent",BW="clearSent",NCe="bufferOverride",$oe="BUFFER_KEY",sL="SENT_BUFFER_KEY",TU="concat",Voe="MAX_BUFFER_SIZE",Woe="triggerSend",rA="diagLog",VUe="initialize",zoe="_sender",Yoe="endpointUrl",Koe="instrumentationKey",WUe="customHeaders",aDt="maxBatchSizeInBytes",zUe="onunloadDisableBeacon",YUe="isBeaconApiDisabled",cDt="alwaysUseXhrOverride",lDt="enableSessionStorageBuffer",wP="_buffer",uDt="onunloadDisableFetch",dDt="disableSendBeaconSplit",MCe="getSenderInst",IU="_onError",KUe="_onPartialSuccess",OCe="_onSuccess",JUe="itemsReceived",ZUe="itemsAccepted",XUe="baseType",Joe="sampleRate",wYr="getHashCodeScore";var fDt="baseType",Id="baseData",qm="properties",RYr="true";function Dp(t,e,r){return LN(t,e,r,x1)}a(Dp,"_setValueIf");function jmo(t,e,r){var n=r[xh]=r[xh]||{},o=e.ext=e.ext||{},s=e[xh]=e[xh]||[],c=o.user;c&&(Dp(n,Ih.userAuthUserId,c.authId),Dp(n,Ih.userId,c.id||c.localId));var l=o.app;l&&Dp(n,Ih.sessionId,l.sesId);var u=o.device;u&&(Dp(n,Ih.deviceId,u.id||u.localId),Dp(n,Ih[$Ue],u.deviceClass),Dp(n,Ih.deviceIp,u.ip),Dp(n,Ih.deviceModel,u.model),Dp(n,Ih[$Ue],u[$Ue]));var d=e.ext.web;if(d){Dp(n,Ih.deviceLanguage,d.browserLang),Dp(n,Ih.deviceBrowserVersion,d.browserVer),Dp(n,Ih.deviceBrowser,d.browser);var f=r[tC]=r[tC]||{},h=f[Id]=f[Id]||{},m=h[qm]=h[qm]||{};Dp(m,"domain",d.domain),Dp(m,"isManual",d.isManual?RYr:null),Dp(m,"screenRes",d.screenRes),Dp(m,"userConsent",d.userConsent?RYr:null)}var g=o.os;g&&(Dp(n,Ih.deviceOS,g[jN]),Dp(n,Ih.deviceOSVersion,g.osVer));var A=o.trace;A&&(Dp(n,Ih.operationParentId,A.parentID),Dp(n,Ih.operationName,tu(t,A[jN])),Dp(n,Ih.operationId,A[OW]));for(var y={},E=s[Mo]-1;E>=0;E--){var _=s[E];zr(_,function(b,T){y[b]=T}),s.splice(E,1)}zr(s,function(b,T){y[b]=T});var v=jI(jI({},n),y);v[Ih.internalSdkVersion]||(v[Ih.internalSdkVersion]=tu(t,"javascript:".concat(Hmo.Version),64)),r[xh]=dUe(v)}a(jmo,"_extractPartAExtensions");function xU(t,e,r){Zt(t)||zr(t,function(n,o){Ch(o)?r[n]=o:Ai(o)?e[n]=o:lU()&&(e[n]=o_()[vU](o))})}a(xU,"_extractPropsAndMeasurements");function LW(t,e){Zt(t)||zr(t,function(r,n){t[r]=n||e})}a(LW,"_convertPropsUndefinedToCustomDefinedValue");function FW(t,e,r,n){var o=new eDt(t,n,e);Dp(o,"sampleRate",r[yCe]),(r[Id]||{}).startTime&&(o.time=cU(r[Id].startTime)),o.iKey=r.iKey;var s=r.iKey.replace(/-/g,"");return o[jN]=o[jN].replace("{0}",s),jmo(t,r,o),r[xh]=r[xh]||[],dUe(o)}a(FW,"_createEnvelope");function UW(t,e){Zt(e[Id])&&Vr(t,1,46,"telemetryItem.baseData cannot be null.")}a(UW,"EnvelopeCreatorInit");var Hmo={Version:"3.3.11"};function PYr(t,e,r){UW(t,e);var n=e[Id][CU]||{},o=e[Id][qm]||{};xU(e[tC],o,n),Zt(r)||LW(o,r);var s=e[Id];if(Zt(s))return ZB(t,"Invalid input for dependency data"),null;var c=s[qm]&&s[qm][OUe]?s[qm][OUe]:"GET",l=new kW(t,s.id,s.target,s[jN],s[_U],s.success,s.responseCode,c,s.type,s.correlationContext,o,n),u=new rL(kW[VI],l);return FW(t,kW[bU],e,u)}a(PYr,"DependencyEnvelopeCreator");function pDt(t,e,r){UW(t,e);var n={},o={};e[fDt]!==eL[VI]&&(n.baseTypeSource=e[fDt]),e[fDt]===eL[VI]?(n=e[Id][qm]||{},o=e[Id][CU]||{}):e[Id]&&xU(e[Id],n,o),xU(e[tC],n,o),Zt(r)||LW(n,r);var s=e[Id][jN],c=new eL(t,s,n,o),l=new rL(eL[VI],c);return FW(t,eL[bU],e,l)}a(pDt,"EventEnvelopeCreator");function kYr(t,e,r){UW(t,e);var n=e[Id][CU]||{},o=e[Id][qm]||{};xU(e[tC],o,n),Zt(r)||LW(o,r);var s=e[Id],c=RW.CreateFromInterface(t,s,o,n),l=new rL(RW[VI],c);return FW(t,RW[bU],e,l)}a(kYr,"ExceptionEnvelopeCreator");function DYr(t,e,r){UW(t,e);var n=e[Id],o=n[qm]||{},s=n[CU]||{};xU(e[tC],o,s),Zt(r)||LW(o,r);var c=new tL(t,n[jN],n.average,n.sampleCount,n.min,n.max,n.stdDev,o,s),l=new rL(tL[VI],c);return FW(t,tL[bU],e,l)}a(DYr,"MetricEnvelopeCreator");function NYr(t,e,r){UW(t,e);var n,o=e[Id];!Zt(o)&&!Zt(o[qm])&&!Zt(o[qm][_U])?(n=o[qm][_U],delete o[qm][_U]):!Zt(e[tC])&&!Zt(e[tC][_U])&&(n=e[tC][_U],delete e[tC][_U]);var s=e[Id],c;((e.ext||{}).trace||{})[OW]&&(c=e.ext.trace[OW]);var l=s.id||c,u=s[jN],d=s.uri,f=s[qm]||{},h=s[CU]||{};if(Zt(s.refUri)||(f.refUri=s.refUri),Zt(s.pageType)||(f.pageType=s.pageType),Zt(s.isLoggedIn)||(f.isLoggedIn=s.isLoggedIn[nL]()),!Zt(s[qm])){var m=s[qm];zr(m,function(y,E){f[y]=E})}xU(e[tC],f,h),Zt(r)||LW(f,r);var g=new PW(t,u,d,n,f,h,l),A=new rL(PW[VI],g);return FW(t,PW[bU],e,A)}a(NYr,"PageViewEnvelopeCreator");function MYr(t,e,r){UW(t,e);var n=e[Id],o=n[jN],s=n.uri||n.url,c=n[qm]||{},l=n[CU]||{};xU(e[tC],c,l),Zt(r)||LW(c,r);var u=new NW(t,o,s,void 0,c,l,n),d=new rL(NW[VI],u);return FW(t,NW[bU],e,d)}a(MYr,"PageViewPerformanceEnvelopeCreator");function OYr(t,e,r){UW(t,e);var n=e[Id].message,o=e[Id].severityLevel,s=e[Id][qm]||{},c=e[Id][CU]||{};xU(e[tC],s,c),Zt(r)||LW(s,r);var l=new DW(t,n,o,s,c),u=new rL(DW[VI],l);return FW(t,DW[bU],e,u)}a(OYr,"TraceEnvelopeCreator");p();var BYr=(function(){function t(e,r){var n=[],o=!1,s=r.maxRetryCnt;this._get=function(){return n},this._set=function(c){return n=c,n},bi(t,this,function(c){c[iL]=function(l){if(c[oL]()>=r.eventsLimitInMem){o||(Vr(e,2,105,"Maximum in-memory buffer size reached: "+c[oL](),!0),o=!0);return}l.cnt=l.cnt||0,!(!Zt(s)&&l.cnt>s)&&n[WI](l)},c[oL]=function(){return n[Mo]},c.size=function(){for(var l=n[Mo],u=0;u0){var u=[];Ct(l,function(f){u[WI](f.item)});var d=r[DCe]?u.join(` +`):"["+u.join(",")+"]";return d}return null},c.createNew=function(l,u,d){var f=n.slice(0);l=l||e,u=u||{};var h=d?new hDt(l,u):new e7e(l,u);return Ct(f,function(m){h[iL](m)}),h}})}return a(t,"BaseSendBuffer"),t.__ieDyn=1,t})(),e7e=(function(t){Py(e,t);function e(r,n){var o=t.call(this,r,n)||this;return bi(e,o,function(s,c){s[Goe]=function(l){c[SU]()},s[BW]=function(l){}}),o}return a(e,"ArraySendBuffer"),e.__ieDyn=1,e})(BYr);var Gmo=["AI_buffer","AI_sentBuffer"],hDt=(function(t){Py(e,t);function e(n,o){var s=t.call(this,n,o)||this,c=!1,l=o?.namePrefix,u=o[NCe]||{getItem:J2t,setItem:Z2t},d=u.getItem,f=u.setItem,h=o.maxRetryCnt;return bi(e,s,function(m,g){var A=T(e[$oe]),y=T(e[sL]),E=x(),_=y[TU](E),v=m._set(A[TU](_));v[Mo]>e[Voe]&&(v[Mo]=e[Voe]),R(e[sL],[]),R(e[$oe],v),m[iL]=function(D){if(m[oL]()>=e[Voe]){c||(Vr(n,2,67,"Maximum buffer size reached: "+m[oL](),!0),c=!0);return}D.cnt=D.cnt||0,!(!Zt(h)&&D.cnt>h)&&(g[iL](D),R(e[$oe],m._get()))},m[SU]=function(){g[SU](),R(e[$oe],m._get()),R(e[sL],[]),c=!1},m[Goe]=function(D){R(e[$oe],m._set(b(D,m._get())));var N=T(e[sL]);N instanceof Array&&D instanceof Array&&(N=N[TU](D),N[Mo]>e[Voe]&&(Vr(n,1,67,"Sent buffer reached its maximum size: "+N[Mo],!0),N[Mo]=e[Voe]),R(e[sL],N))},m[BW]=function(D){var N=T(e[sL]);N=b(D,N),R(e[sL],N)},m.createNew=function(D,N,B){B=!!B;var L=m._get().slice(0),j=T(e[sL]).slice(0);D=D||n,N=N||{},m[SU]();var M=B?new e(D,N):new e7e(D,N);return Ct(L,function(O){M[iL](O)}),B&&M[Goe](j),M};function b(D,N){var B=[],L=[];return Ct(D,function(j){L[WI](j.item)}),Ct(N,function(j){!Or(j)&&Qo(L,j.item)===-1&&B[WI](j)}),B}a(b,"_removePayloadsFromBuffer");function T(D){var N=D;return N=l?l+"_"+N:N,w(N)}a(T,"_getBuffer");function w(D){try{var N=d(n,D);if(N){var B=o_().parse(N);if(Ai(B)&&(B=o_().parse(B)),B&&lr(B))return B}}catch(L){Vr(n,1,42," storage key: "+D+", "+kp(L),{exception:ur(L)})}return[]}a(w,"_getBufferBase");function R(D,N){var B=D;try{B=l?l+"_"+B:B;var L=JSON[vU](N);f(n,B,L)}catch(j){f(n,B,JSON[vU]([])),Vr(n,2,41," storage key: "+B+", "+kp(j)+". Buffer cleared",{exception:ur(j)})}}a(R,"_setBuffer");function x(){var D=[];try{return Ct(Gmo,function(N){var B=P(N);if(D=D[TU](B),l){var L=l+"_"+N,j=P(L);D=D[TU](j)}}),D}catch(N){Vr(n,2,41,"Transfer events from previous buffers: "+kp(N)+". previous Buffer items can not be removed",{exception:ur(N)})}return[]}a(x,"_getPreviousEvents");function P(D){try{var N=w(D),B=[];return Ct(N,function(L){var j={item:L,cnt:0};B[WI](j)}),X2t(n,D),B}catch{}return[]}a(P,"_getItemsFromPreviousKey")}),s}a(e,"SessionStorageSendBuffer");var r;return r=e,e.VERSION="_1",e.BUFFER_KEY="AI_buffer"+r.VERSION,e.SENT_BUFFER_KEY="AI_sentBuffer"+r.VERSION,e.MAX_BUFFER_SIZE=2e3,e})(BYr);p();var LYr=(function(){function t(e){bi(t,this,function(r){r.serialize=function(c){var l=n(c,"root");try{return o_()[vU](l)}catch(u){Vr(e,1,48,u&&Or(u[nL])?u[nL]():"Error serializing object",null,!0)}};function n(c,l){var u="__aiCircularRefCheck",d={};if(!c)return Vr(e,1,48,"cannot serialize object because it is null or undefined",{name:l},!0),d;if(c[u])return Vr(e,2,50,"Circular reference detected while serializing object",{name:l},!0),d;if(!c.aiDataContract){if(l==="measurements")d=s(c,"number",l);else if(l==="properties")d=s(c,"string",l);else if(l==="tags")d=s(c,"string",l);else if(lr(c))d=o(c,l);else{Vr(e,2,49,"Attempting to serialize an object which does not implement ISerializable",{name:l},!0);try{o_()[vU](c),d=c}catch(f){Vr(e,1,48,f&&Or(f[nL])?f[nL]():"Error serializing object",null,!0)}}return d}return c[u]=!0,zr(c.aiDataContract,function(f,h){var m=Or(h)?h()&1:h&1,g=Or(h)?h()&4:h&4,A=h&2,y=c[f]!==void 0,E=Lu(c[f])&&c[f]!==null;if(m&&!y&&!A)Vr(e,1,24,"Missing required field specification. The field is required but not present on source",{field:f,name:l});else if(!g){var _=void 0;E?A?_=o(c[f],f):_=n(c[f],f):_=c[f],_!==void 0&&(d[f]=_)}}),delete c[u],d}a(n,"_serializeObject");function o(c,l){var u;if(c)if(!lr(c))Vr(e,1,54,`This field was specified as an array in the contract but the item is not an array.\r +`,{name:l},!0);else{u=[];for(var d=0;d100||e<0)&&(n.throwInternal(2,58,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),e=100),this[Joe]=e,this.samplingScoreGenerator=new UYr}return a(t,"Sample"),t.prototype.isSampledIn=function(e){var r=this[Joe],n=!1;return r==null||r>=100||e.baseType===tL[VI]?!0:(n=this.samplingScoreGenerator.getSamplingScore(e)0&&t<=100}a(zmo,"_chkSampling");var Ymo=(aL={},aL[eL.dataType]=pDt,aL[DW.dataType]=OYr,aL[PW.dataType]=NYr,aL[NW.dataType]=MYr,aL[RW.dataType]=kYr,aL[tL.dataType]=DYr,aL[kW.dataType]=PYr,aL),mDt=(function(t){Py(e,t);function e(){var r=t.call(this)||this;r.priority=1001,r.identifier=GUe;var n,o,s,c,l,u,d,f,h=0,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q,U,z,W,$,J,ne;return bi(e,r,function(H,re){Ge(),H.pause=function(){de(),c=!0},H.resume=function(){c&&(c=!1,o=null,tt(),Ue())},H.flush=function(Y,se,he){if(Y===void 0&&(Y=!0),!c){de();try{var Ce=H[Woe](Y,null,he||1);return pl(Ce,function(He){return se?(se(!He.rejected),!0):Y?Td(function($e){$e(!He.rejected)}):Ce})}catch(He){Vr(H[rA](),1,22,"flush failed, telemetry will not be collected: "+kp(He),{exception:ur(He)})}}},H.onunloadFlush=function(){if(!c)if(v||O)try{return H[Woe](!0,kt,2)}catch(Y){Vr(H[rA](),1,20,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+kp(Y),{exception:ur(Y)})}else H.flush(!1)},H.addHeader=function(Y,se){f[Y]=se},H[VUe]=function(Y,se,he,Ce){H.isInitialized()&&Vr(H[rA](),1,28,"Sender is already initialized"),re[VUe](Y,se,he,Ce);var He=H.identifier;u=new LYr(se.logger),n=0,o=null,s=0,H[zoe]=null,d=0;var $e=H[rA]();A=ACe(L1("Sender"),se.evtNamespace&&se.evtNamespace()),g=sDt(A),H._addHook(HI(Y,function(Xe){var ct=Xe.cfg;ct.storagePrefix&&K2t(ct.storagePrefix);var bt=IP(null,ct,se),ht=bt.getExtCfg(He,HYr),We=ht[Yoe];if(y&&We===y){var ce=ct[Yoe];ce&&ce!==We&&(ht[Yoe]=ce)}var Re=Ri("CompressionStream");ne=n2t("zipPayload",ct,!1),Or(Re)||(ne=!1);var Me=ht.corsPolicy;Me?(Me==="same-origin"||Me==="same-site"||Me==="cross-origin")&&r.addHeader(GYr,Me):delete f[GYr],Um(ht[Koe])&&(ht[Koe]=ct[Koe]),qi(H,"_senderConfig",{g:a(function(){return ht},"g")}),E!==ht[Yoe]&&(y=E=ht[Yoe]),se.activeStatus()===vP.PENDING?H.pause():se.activeStatus()===vP.ACTIVE&&H.resume(),w&&w!==ht[WUe]&&Ct(w,function(_r){delete f[_r.header]}),_=ht[aDt],v=(ht[zUe]===!1||ht[YUe]===!1)&&uU(),b=ht[zUe]===!1&&uU(),T=ht[YUe]===!1&&uU(),O=ht[cDt],q=!!ht.disableXhr,J=ht.retryCodes;var ge=ht[NCe],oe=!!ht[lDt]&&(!!ge||QUe()),ze=ht.namePrefix,at=oe!==B||oe&&j!==ze||oe&&L!==ge;if(H[wP]){if(at)try{H[wP]=H[wP].createNew($e,ht,oe)}catch(_r){Vr(H[rA](),1,12,"failed to transfer telemetry to different buffer storage, telemetry will be lost: "+kp(_r),{exception:ur(_r)})}tt()}else H[wP]=oe?new hDt($e,ht):new e7e($e,ht);j=ze,B=oe,L=ge,Q=!ht[uDt]&&nCe(!0),W=!!ht[dDt],H._sample=new QYr(ht.samplingPercentage,$e),x=ht[Koe],!Um(x)&&!Te(x,ct)&&Vr($e,1,100,"Invalid Instrumentation key "+x),w=ht[WUe],Ai(y)&&!FUe(y)&&w&&w[Mo]>0?Ct(w,function(_r){r.addHeader(_r.header,_r.value)}):w=null,M=ht.enableSendPromise;var $t=Oe();$?$.SetConfig($t):($=new Q2t,$[VUe]($t,$e));var gr=ht.httpXHROverride,sr=null,Mr=null,Hr=pUe([3,1,2],ht.transports);sr=$&&$[MCe](Hr,!1);var Gr=$&&$.getFallbackInst();U=a(function(_r,Pm){return Ne(Gr,_r,Pm)},"_xhrSend"),z=a(function(_r,Pm){return Ne(Gr,_r,Pm,!1)},"_fallbackSend"),sr=O?gr:sr||gr||Gr,H[zoe]=function(_r,Pm){return Ne(sr,_r,Pm)},Q&&(m=Ie);var zt=pUe([3,1],ht.unloadTransports);Q||(zt=zt.filter(function(_r){return _r!==2})),Mr=$&&$[MCe](zt,!0),Mr=O?gr:Mr||gr,(O||ht.unloadTransports||!m)&&Mr&&(m=a(function(_r,Pm){return Ne(Mr,_r,Pm)},"_syncUnloadSender")),m||(m=U),R=ht.disableTelemetry,P=ht.convertUndefined||RP,D=ht.isRetryDisabled,N=ht.maxBatchInterval}))},H.processTelemetry=function(Y,se){se=H._getTelCtx(se);var he=se[rA]();try{var Ce=K(Y,he);if(!Ce)return;var He=pe(Y,he);if(!He)return;var $e=u.serialize(He),Xe=H[wP];tt($e);var ct={item:$e,cnt:0};Xe[iL](ct),Ue()}catch(bt){Vr(he,2,12,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+kp(bt),{exception:ur(bt)})}H.processNext(Y,se)},H.isCompletelyIdle=function(){return!c&&h===0&&H._buffer[oL]()===0},H.getOfflineListener=function(){return g},H._xhrReadyStateChange=function(Y,se,he){if(!jt(se))return ve(Y,se,he)},H[Woe]=function(Y,se,he){Y===void 0&&(Y=!0);var Ce;if(!c)try{var He=H[wP];if(R)He[SU]();else{if(He[oL]()>0){var $e=He.getItems();te(he||0,Y),se?Ce=se.call(H,$e,Y):Ce=H[zoe]($e,Y)}s=+new Date}de()}catch(ct){var Xe=p2t();(!Xe||Xe>9)&&Vr(H[rA](),1,40,"Telemetry transmission failed, some telemetry will be lost: "+kp(ct),{exception:ur(ct)})}return Ce},H.getOfflineSupport=function(){return{getUrl:a(function(){return y},"getUrl"),createPayload:qe,serialize:X,batch:ue,shouldProcess:a(function(Y){return!!K(Y)},"shouldProcess")}},H._doTeardown=function(Y,se){H.onunloadFlush(),JB(g,!1),Ge()},H[IU]=function(Y,se,he){if(!jt(Y))return Fe(Y,se,he)},H[KUe]=function(Y,se){if(!jt(Y))return Pe(Y,se)},H[OCe]=function(Y,se){if(!jt(Y))return Z(Y,se)},H._xdrOnLoad=function(Y,se){if(!jt(se))return ae(Y,se)};function ae(Y,se){var he=jYr(Y);if(Y&&(he+""=="200"||he===""))n=0,H[OCe](se,0);else{var Ce=gCe(he);Ce&&Ce[JUe]&&Ce[JUe]>Ce[ZUe]&&!D?H[KUe](se,Ce):H[IU](se,eCe(Y))}}a(ae,"_xdrOnLoad");function Oe(){try{var Y={xdrOnComplete:a(function(he,Ce,He){var $e=ee(He);if($e)return ae(he,$e)},"xdrOnComplete"),fetchOnComplete:a(function(he,Ce,He,$e){var Xe=ee($e);if(Xe)return st(he.status,Xe,he.url,Xe[Mo],he.statusText,He||"")},"fetchOnComplete"),xhrOnComplete:a(function(he,Ce,He){var $e=ee(He);if($e)return ve(he,$e,$e[Mo])},"xhrOnComplete"),beaconOnRetry:a(function(he,Ce,He){return Gt(he,Ce,He)},"beaconOnRetry")},se={enableSendPromise:M,isOneDs:!1,disableCredentials:!1,disableXhr:q,disableBeacon:!T,disableBeaconSync:!b,senderOnCompleteCallBack:Y};return se}catch{}return null}a(Oe,"_getSendPostMgrConfig");function ve(Y,se,he){Y.readyState===4&&st(Y.status,se,Y.responseURL,he,gW(Y),jYr(Y)||Y.response)}a(ve,"_xhrReadyStateChange");function Fe(Y,se,he){Vr(H[rA](),2,26,"Failed to send telemetry.",{message:se}),H._buffer&&H._buffer[BW](Y)}a(Fe,"_onError");function Pe(Y,se){for(var he=[],Ce=[],He=se.errors.reverse(),$e=0,Xe=He;$e0&&H[OCe](Y,se[ZUe]),he[Mo]>0&&H[IU](he,gW(null,["partial success",se[ZUe],"of",se.itemsReceived].join(" "))),Ce[Mo]>0&&(F(Ce),Vr(H[rA](),2,40,"Partial success. Delivered: "+Y[Mo]+", Failed: "+he[Mo]+". Will retry to send "+Ce[Mo]+" our of "+se[JUe]+" items"))}a(Pe,"_onPartialSuccess");function Z(Y,se){H._buffer&&H._buffer[BW](Y)}a(Z,"_onSuccess");function ee(Y){try{if(Y){var se=Y,he=se.oriPayload;return he&&he[Mo]?he:null}}catch{}return null}a(ee,"_getPayloadArr");function K(Y,se){if(R)return!1;if(!Y)return se&&Vr(se,1,7,"Cannot send empty telemetry"),!1;if(Y.baseData&&!Y[XUe])return se&&Vr(se,1,70,"Cannot send telemetry without baseData and baseType"),!1;if(Y[XUe]||(Y[XUe]="EventData"),!H[zoe])return se&&Vr(se,1,28,"Sender was not initialized"),!1;if(ie(Y))Y[yCe]=H._sample[Joe];else return se&&Vr(se,2,33,"Telemetry item was sampled out and not sent",{SampleRate:H._sample[Joe]}),!1;return!0}a(K,"_validate");function pe(Y,se){var he=Y.iKey||x,Ce=e.constructEnvelope(Y,he,se,P);if(!Ce){Vr(se,1,47,"Unable to create an AppInsights envelope");return}var He=!1;if(Y[xh]&&Y[xh][ECe]&&(Ct(Y[xh][ECe],function($e){try{$e&&$e(Ce)===!1&&(He=!0,ZB(se,"Telemetry processor check returns false"))}catch(Xe){Vr(se,1,64,"One of telemetry initializers failed, telemetry item will not be sent: "+kp(Xe),{exception:ur(Xe)},!0)}}),delete Y[xh][ECe]),!He)return Ce}a(pe,"_getEnvelope");function X(Y){var se=qYr,he=H[rA]();try{var Ce=K(Y,he),He=null;Ce&&(He=pe(Y,he)),He&&(se=u.serialize(He))}catch{}return se}a(X,"_serialize");function ue(Y){var se=qYr;return Y&&Y[Mo]&&(se="["+Y.join(",")+"]"),se}a(ue,"_batch");function qe(Y){var se=Be();return{urlString:y,data:Y,headers:se}}a(qe,"_createPayload");function ie(Y){return H._sample.isSampledIn(Y)}a(ie,"_isSampledIn");function le(Y,se,he,Ce){se===200&&Y?H._onSuccess(Y,Y[Mo]):Ce&&H[IU](Y,Ce)}a(le,"_getOnComplete");function Ne(Y,se,he,Ce){Ce===void 0&&(Ce=!0);var He=a(function(ce,Re,Me){return le(se,ce,Re,Me)},"onComplete"),$e=we(se),Xe=Y&&Y.sendPOST;if(Xe&&$e){Ce&&H._buffer[Goe](se);var ct,bt=!1,ht,We;return $.preparePayload(function(ce){ct=Xe(ce,He,!he),bt=!0,ht&&tUe(ct,ht,We)},ne,$e,!he),bt?ct:Td(function(ce,Re){ht=ce,We=Re})}return null}a(Ne,"_doSend");function we(Y){if(lr(Y)&&Y[Mo]>0){var se=H[wP].batchPayloads(Y),he=Be(),Ce={data:se,urlString:y,headers:he,disableXhrSync:q,disableFetchKeepAlive:!Q,oriPayload:Y};return Ce}return null}a(we,"_getPayload");function Be(){try{var Y=f||{};return FUe(y)&&(Y[BUe[6]]=BUe[7]),Y}catch{}return null}a(Be,"_getHeaders");function tt(Y){var se=Y?Y[Mo]:0;return H[wP].size()+se>_?((!g||g.isOnline())&&H[Woe](!0,null,10),!0):!1}a(tt,"_checkMaxSize");function st(Y,se,he,Ce,He,$e){var Xe=null;if(H._appId||(Xe=gCe($e),Xe&&Xe.appId&&(H._appId=Xe.appId)),(Y<200||Y>=300)&&Y!==0){if((Y===301||Y===307||Y===308)&&!Et(he)){H[IU](se,He);return}if(g&&!g.isOnline()){if(!D){var ct=10;F(se,ct),Vr(H[rA](),2,40,". Offline - Response Code: ".concat(Y,". Offline status: ").concat(!g.isOnline(),". Will retry to send ").concat(se.length," items."))}return}!D&&Se(Y)?(F(se),Vr(H[rA](),2,40,". Response code "+Y+". Will retry to send "+se[Mo]+" items.")):H[IU](se,He)}else Et(he),Y===206?(Xe||(Xe=gCe($e)),Xe&&!D?H[KUe](se,Xe):H[IU](se,He)):(n=0,H[OCe](se,Ce))}a(st,"_checkResponsStatus");function Et(Y){return d>=10?!1:!Zt(Y)&&Y!==""&&Y!==y?(y=Y,++d,!0):!1}a(Et,"_checkAndUpdateEndPointUrl");function kt(Y,se){if(m)m(Y,!1);else{var he=$&&$[MCe]([3],!0);return Ne(he,Y,se)}}a(kt,"_doUnloadSend");function Gt(Y,se,he){var Ce=Y,He=Ce&&Ce.oriPayload;if(W)z&&z(He,!0),Vr(H[rA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender.");else{for(var $e=[],Xe=0;Xe0&&(z&&z($e,!0),Vr(H[rA](),2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}a(Gt,"_onBeaconRetry");function jt(Y){try{if(Y&&Y[Mo])return Ai(Y[0])}catch{}return null}a(jt,"_isStringArr");function Ie(Y,se){var he=null;if(lr(Y)){for(var Ce=Y[Mo],He=0;He-1}a(Se,"_isRetriable");function Le(){var Y="getNotifyMgr",se,he=H.core;return he&&(he[Y]?se=he[Y]():se=he._notificationManager),se}a(Le,"_getNotifyMgr");function te(Y,se){var he=Le();if(he&&he.eventsSendRequest)try{he.eventsSendRequest(Y,se)}catch(Ce){Vr(H[rA](),1,74,"send request notification failed: "+kp(Ce),{exception:ur(Ce)})}}a(te,"_notifySendRequest");function Te(Y,se){var he=se.disableInstrumentationKeyValidation,Ce=Zt(he)?!1:he;if(Ce)return!0;var He="^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",$e=new RegExp(He);return $e.test(Y)}a(Te,"_validateInstrumentationKey");function Ge(){H[zoe]=null,H[wP]=null,H._appId=null,H._sample=null,f={},g=null,n=0,o=null,s=null,c=!1,l=null,u=null,d=0,h=0,m=null,A=null,y=null,E=null,_=0,v=!1,w=null,R=!1,x=null,P=RP,D=!1,B=null,j=RP,q=!1,Q=!1,W=!1,U=null,z=null,$=null,qi(H,"_senderConfig",{g:a(function(){return fUe({},HYr)},"g")})}a(Ge,"_initDefaults")}),r}return a(e,"Sender"),e.constructEnvelope=function(r,n,o,s){var c;n!==r.iKey&&!Zt(n)?c=jI(jI({},r),{iKey:n}):c=r;var l=Ymo[c.baseType]||pDt;return l(o,c,s)},e})(mCe);p();var QW="instrumentationKey",BCe="connectionString",Zoe="endpointUrl",Xoe="userOverrideEndpointUrl";var qW,gDt,ADt=void 0,Kmo=(qW={diagnosticLogInterval:Noe(Jmo,1e4)},qW[BCe]=ADt,qW.endpointUrl=ADt,qW[QW]=ADt,qW.featureOptIn=(gDt={},gDt.zipPayload={mode:1},gDt),qW.extensionConfig={},qW);function Jmo(t){return t&&t>0}a(Jmo,"_chkDiagLevel");var $Yr=(function(){function t(e){var r=new F2t,n;(Zt(e)||Zt(e[QW])&&Zt(e[BCe]))&&Wc("Invalid input configuration"),bi(t,this,function(s){qi(s,"config",{g:a(function(){return n},"g")}),c(),s.initialize=c,s.track=o,mW(s,r,["flush","pollInternalLogs","stopPollingInternalLogs","unload","getPlugin","addPlugin","evtNamespace","addUnloadCb","onCfgChange","getTraceCtx","updateCfg","addTelemetryInitializer"]);function c(){var l=Th(e||{},Kmo);n=l.cfg,r.addUnloadHook(HI(l,function(){var u=n[BCe];if(Um(u)){var d=Jve(function(g,A){pl(u,function(y){var E=y.value,_=n[QW];if(!y.rejected&&E){n[BCe]=E;var v=xCe(E);_=v.instrumentationkey||_}g(_)})}),f=Jve(function(g,A){pl(u,function(y){var E=y.value,_=n[Zoe];if(!y.rejected&&E){var v=xCe(E),b=v.ingestionendpoint;_=b?b+QN:_}g(_)})});n[QW]=d,n[Zoe]=n[Xoe]||f}if(Ai(u)){var h=xCe(u),m=h.ingestionendpoint;n[Zoe]=n[Xoe]?n[Xoe]:m+QN,n[QW]=h.instrumentationkey||n[QW]}n[Zoe]=n[Xoe]?n[Xoe]:n[Zoe]})),r.initialize(n,[new mDt])}a(c,"_initialize")});function o(s){s&&(s.baseData=s.baseData||{},s.baseType=s.baseType||"EventData"),r.track(s)}a(o,"_track")}return a(t,"ApplicationInsights"),t.__ieDyn=1,t})();var F1=fe(require("os"));var jW=class{constructor(e,r,n,o){this.ctx=e;this.namespace=r;this.options=n;this.onCopilotToken=a(e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false";let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.xhrOverride={sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`AppInsightsReporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json",this.options?.includeAuthorizationHeader&&this.token&&(n.Authorization=`Bearer ${this.token.token}`);let o={method:"POST",headers:n,body:e.data};this.ctx.get(cr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")};this.client=new $Yr({instrumentationKey:n.instrumentationKey,disableAjaxTracking:!0,disableExceptionTracking:!0,disableFetchTracking:!0,disableCorrelationHeaders:!0,disableCookiesUsage:!0,autoTrackPageVisitTime:!1,emitLineDelimitedJson:!1,disableInstrumentationKeyValidation:!0,endpointUrl:n.endpointUrl,extensionConfig:{[GUe]:{alwaysUseXhrOverride:!0,httpXHROverride:this.xhrOverride}}}),this.tags=n?.excludeCommonTags?{}:Zmo(e),this.commonProperties=n?.excludeCommonProperties?{}:Xmo(e),this.#e=ys(e,this.onCopilotToken),o&&this.onCopilotToken(o)}static{a(this,"AppInsightsReporter")}#e;sendTelemetryEvent(e,r,n){r={...r,...this.commonProperties};let o=this.qualifyEventName(e);this.client.track({name:o,tags:this.tags,data:{...r,...n},baseType:"EventData",baseData:{name:o,properties:r,measurements:n}})}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}};function Zmo(t){let e={},r=t.get(Oa);e["ai.session.id"]=r.sessionId;let n=t.get(Mf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${F1.type()} ${F1.release()}`,e["ai.device.osArchitecture"]=F1.arch(),e["ai.device.osPlatform"]=F1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(os).getVersion(),e}a(Zmo,"getTags");function Xmo(t){let e={};e.common_os=F1.platform(),e.common_platformversion=F1.release(),e.common_arch=F1.arch(),e.common_cpu=Array.from(new Set(F1.cpus().map(n=>n.model))).join();let r=t.get(Oa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(Xmo,"getCommonProperties");p();p();p();p();p();p();var LCe=N9e;var HN=LCe({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5});p();var wU=LCe({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2});p();p();var HW="toLowerCase",Cn="length",ese="warnToConsole",cL="throwInternal",GN="watch",RU="apply",ro="push",zI="splice",qu="logger",$N="cancel",lL="initialize",VN="identifier",tse="removeNotificationListener",rse="addNotificationListener",rC="isInitialized",FCe="getNotifyMgr",PU="getPlugin",PP="name",Q0="processNext",t7e="getProcessTelContext",uL="value",kU="enabled",yDt="stopPollingInternalLogs",YI="unload",UCe="onComplete",r7e="version",n7e="loggingLevelConsole",WN="createNew",U1="teardown",nse="messageId",zN="message",nC="diagLog",DU="_doTeardown",GW="update",Q1="getNext",NU="setNextPlugin",QCe="userAgent",dL="split",kP="replace",EDt="substring",i7e="indexOf",fL="type",_Dt="evtName",DP="status",vDt="getAllResponseHeaders",qCe="isChildEvt",q1="data",$W="getCtx",NP="setCtx";var jCe="headers",ise="urlString",VW="timeout";var o7e="traceFlags";var CDt;function VYr(t,e){CDt||(CDt=Bve("AggregationError",function(n,o){o[Cn]>1&&(n.errors=o[1])}));var r=t||"One or more errors occurred.";throw Ct(e,function(n,o){r+=` +`.concat(o," > ").concat(ur(n))}),new CDt(r,e||[])}a(VYr,"throwAggregationError");p();p();p();p();p();var j1=void 0,Es="",WW="channels",qf="core",s7e="createPerfMgr",HCe="disabled",pL="extensionConfig",zW="extensions",iC="processTelemetry",YW="priority",ose="eventsSent",MU="eventsDiscarded",sse="eventsSendRequest",YN="perfEvent",a7e="offlineEventsStored",c7e="offlineBatchSent",l7e="offlineBatchDrop",ase="getPerfMgr",u7e="domain",d7e="path",WYr="Not dynamic - ";var ego="getPrototypeOf",tgo=/-([a-z])/g,rgo=/([^\w\d_$])/g,ngo=/^(\d+[\w\d_$])/,lkl=Object[ego];function OU(t){return!Zt(t)}a(OU,"isNotNullOrUndefined");function cse(t){var e=t;return e&&Ai(e)&&(e=e[kP](tgo,function(r,n){return n.toUpperCase()}),e=e[kP](rgo,"_"),e=e[kP](ngo,function(r,n){return"_"+n})),e}a(cse,"normalizeJsName");function jm(t,e){return t&&e?eu(t,e)!==-1:!1}a(jm,"strContains");function lse(t){return t&&t.toISOString()||""}a(lse,"toISOString");function use(t){return QB(t)?t[PP]:Es}a(use,"getExceptionName");function hL(t,e,r,n,o){var s=r;return t&&(s=t[e],s!==r&&(!o||o(s))&&(!n||n(r))&&(s=r,t[e]=s)),s}a(hL,"setValue");function f7e(t,e,r){var n;return t?(n=t[e],!n&&Zt(n)&&(n=Dn(r)?{}:r,t[e]=n)):n=Dn(r)?{}:r,n}a(f7e,"getSetValue");function igo(t,e){var r=null,n=null;return Or(t)?r=t:n=t,function(){var o=arguments;if(r&&(n=r()),n)return n[e][RU](n,o)}}a(igo,"_createProxyFunction");function BU(t,e,r,n,o){t&&e&&r&&(o!==!1||Dn(t[e]))&&(t[e]=igo(r,n))}a(BU,"proxyFunctionAs");function LU(t,e,r,n){return t&&e&&Lu(t)&&lr(r)&&Ct(r,function(o){Ai(o)&&BU(t,o,e,o,n)}),t}a(LU,"proxyFunctions");function KN(t){return t&&qB&&(t=oU(qB({},t))),t}a(KN,"optimizeObject");function p7e(t,e,r){var n=e&&e.featureOptIn&&e.featureOptIn[t];if(t&&n){var o=n.mode;if(o===3)return!0;if(o===2)return!1}return r}a(p7e,"isFeatureEnabled");function JN(t){try{return t.responseText}catch{}return null}a(JN,"getResponseText");function h7e(t,e){return t?"XDomainRequest,Response:"+JN(t)||"":e}a(h7e,"formatErrorMessageXdr");function $Ce(t,e){return t?"XMLHttpRequest,Status:"+t[DP]+",Response:"+JN(t)||t.response||"":e}a($Ce,"formatErrorMessageXhr");function VCe(t,e){return e&&(Ch(e)?t=[e].concat(t):lr(e)&&(t=e.concat(t))),t}a(VCe,"prependTransports");var ogo="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",zYr="withCredentials",sgo="timeout";function bDt(t,e,r,n,o,s){n===void 0&&(n=!1),o===void 0&&(o=!1);function c(u,d,f){try{u[d]=f}catch{}}a(c,"_wrapSetXhrProp");var l=new XMLHttpRequest;return n&&c(l,ogo,n),r&&c(l,zYr,r),l.open(t,e,!o),r&&c(l,zYr,r),!o&&s&&c(l,sgo,s),l}a(bDt,"openXhr");function SDt(t){var e={};if(Ai(t)){var r=Pi(t)[dL](/[\r\n]+/);Ct(r,function(n){if(n){var o=n[i7e](": ");if(o!==-1){var s=Pi(n.substring(0,o))[HW](),c=Pi(n[EDt](o+1));e[s]=c}else e[Pi(n)]=1}})}return e}a(SDt,"convertAllHeadersToMap");function GCe(t,e,r){if(!t[r]&&e&&e.getResponseHeader){var n=e.getResponseHeader(r);n&&(t[r]=Pi(n))}return t}a(GCe,"_appendHeader");var ago="kill-duration",cgo="kill-duration-seconds",lgo="time-delta-millis";function FU(t,e){var r={};return t[vDt]?r=SDt(t[vDt]()):e&&(r=GCe(r,t,lgo),r=GCe(r,t,ago),r=GCe(r,t,cgo)),r}a(FU,"_getAllResponseHeaders");p();p();var ugo="location",dgo="console",YYr="JSON",fgo="crypto",pgo="msCrypto",hgo="ReactNative",mgo="msie",ggo="trident/",KYr="XMLHttpRequest",TDt=null,IDt=null,Ago=!1,dse=null,xDt=null;function JYr(t,e){var r=!1;if(t){try{if(r=e in t,!r){var n=t[O1];n&&(r=e in n)}}catch{}if(!r)try{var o=new t;r=!Dn(o[e])}catch{}}return r}a(JYr,"_hasProperty");function fse(t){if(t&&Ago){var e=Ri("__mockLocation");if(e)return e}return typeof location===qI&&location?location:Ri(ugo)}a(fse,"getLocation");function m7e(){return typeof console!==M1?console:Ri(dgo)}a(m7e,"getConsole");function WCe(){return!!(typeof JSON===qI&&JSON||Ri(YYr)!==null)}a(WCe,"hasJSON");function g7e(){return WCe()?JSON||Ri(YYr):null}a(g7e,"getJSON");function A7e(){return Ri(fgo)}a(A7e,"getCrypto");function y7e(){return Ri(pgo)}a(y7e,"getMsCrypto");function pse(){var t=Uu();return t&&t.product?t.product===hgo:!1}a(pse,"isReactNative");function KW(){var t=Uu();if(t&&(t[QCe]!==IDt||TDt===null)){IDt=t[QCe];var e=(IDt||Es)[HW]();TDt=jm(e,mgo)||jm(e,ggo)}return TDt}a(KW,"isIE");function hse(t){return(xDt===null||t===!1)&&(xDt=iW()&&!!Uu().sendBeacon),xDt}a(hse,"isBeaconsSupported");function mse(t){var e=!1;try{e=!!Ri("fetch");var r=Ri("Request");e&&t&&r&&(e=JYr(r,"keepalive"))}catch{}return e}a(mse,"isFetchSupported");function E7e(){return dse===null&&(dse=typeof XDomainRequest!==M1,dse&&zCe()&&(dse=dse&&!JYr(Ri(KYr),"withCredentials"))),dse}a(E7e,"useXDomainRequest");function zCe(){var t=!1;try{var e=Ri(KYr);t=!!e}catch{}return t}a(zCe,"isXhrSupported");var ZYr=4294967296,JW=4294967295,XYr=123456789,eKr=987654321,tKr=!1,YCe=XYr,KCe=eKr;function ygo(t){t<0&&(t>>>=0),YCe=XYr+t&JW,KCe=eKr-t&JW,tKr=!0}a(ygo,"_mwcSeed");function Ego(){try{var t=fl()&2147483647;ygo((Math.random()*ZYr^t)+t)}catch{}}a(Ego,"_autoSeedMwc");function wDt(t){var e=0,r=A7e()||y7e();return r&&r.getRandomValues&&(e=r.getRandomValues(new Uint32Array(1))[0]&JW),e===0&&KW()&&(tKr||Ego(),e=_go()&JW),e===0&&(e=R1(ZYr*Math.random()|0)),t||(e>>>=0),e}a(wDt,"random32");function _go(t){KCe=36969*(KCe&65535)+(KCe>>16)&JW,YCe=18e3*(YCe&65535)+(YCe>>16)&JW;var e=(KCe<<16)+(YCe&65535)>>>0&JW|0;return t||(e>>>=0),e}a(_go,"mwcRandom32");function RDt(t){t===void 0&&(t=22);for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=wDt()>>>0,n=0,o=Es;o[Cn]>>=6,n===5&&(r=(wDt()<<2&4294967295|r&3)>>>0,n=0);return o}a(RDt,"newId");var rKr="3.3.10",vgo="."+RDt(6),Cgo=0;function nKr(t){return t.nodeType===1||t.nodeType===9||!+t.nodeType}a(nKr,"_canAcceptData");function bgo(t,e){var r=e[t.id];if(!r){r={};try{nKr(e)&&qi(e,t.id,{e:!1,v:r})}catch{}}return r}a(bgo,"_getCache");function KI(t,e){return e===void 0&&(e=!1),cse(t+Cgo+++(e?"."+rKr:Es)+vgo)}a(KI,"createUniqueNamespace");function _7e(t){var e={id:KI("_aiData-"+(t||Es)+"."+rKr),accept:a(function(r){return nKr(r)},"accept"),get:a(function(r,n,o,s){var c=r[e.id];return c?c[cse(n)]:(s&&(c=bgo(e,r),c[cse(n)]=o),o)},"get"),kill:a(function(r,n){if(r&&r[n])try{delete r[n]}catch{}},"kill")};return e}a(_7e,"createElmNodeData");p();function v7e(t){return t&&Lu(t)&&!lr(t)&&(t.isVal||t.fb||eA(t,"v")||eA(t,"mrg")||eA(t,"ref")||t.set)}a(v7e,"_isConfigDefaults");function iKr(t,e,r){var n,o=r.dfVal||poe;if(e&&r.fb){var s=r.fb;lr(s)||(s=[s]);for(var c=0;c0&&VYr("Watcher error(s): ",A)}}a(f,"_notifyWatchers");function h(g){if(g&&g.h[Cn]>0){c||(c=[]),l||(l=Pp(function(){l=null,f()},0));for(var A=0;A0?pl(Ase(t[0],e),function(){MDt(X9(t,1),e,r)}):r(),n}a(MDt,"doUnloadAll");p();var aKr=500,ODt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";p();p();function cKr(t){return{mrg:!0,v:t}}a(cKr,"cfgDfMerge");p();p();var BDt=[ose,MU,sse,YN],x7e=null,I7e;function kgo(t,e){return function(){var r=arguments,n=LDt(e);if(n){var o=n.listener;o&&o[t]&&o[t][RU](o,r)}}}a(kgo,"_listenerProxyFunc");function Dgo(){var t=Ri("Microsoft");return t&&(x7e=t.ApplicationInsights),x7e}a(Dgo,"_getExtensionNamespace");function LDt(t){var e=x7e;return!e&&t.disableDbgExt!==!0&&(e=x7e||Dgo()),e?e.ChromeDbgExt:null}a(LDt,"getDebugExt");function lKr(t){if(!I7e){I7e={};for(var e=0;e=A&&(d[T](b[zN]),n[w]=!0)}else o>=A&&d[T](b[zN]);f(A,b)}},d.debugToConsole=function(A){FDt("debug",A),g("warning",A)},d[ese]=function(A){FDt("warn",A),g("warning",A)},d.errorToConsole=function(A){FDt("error",A),g("error",A)},d.resetInternalMessageCount=function(){r=0,n={}},d.logInternalMessage=f,d[YI]=function(A){u&&u.rm(),u=null};function f(A,y){if(!m()){var E=!0,_=Ogo+y[nse];if(n[_]?E=!1:n[_]=!0,E&&(A<=s&&(d.queue[ro](y),r++,g(A===1?"error":"warn",y)),r===c)){var v="Internal events throttle limit per PageView reached for this app.",b=new Ese(23,v,!1);d.queue[ro](b),A===1?d.errorToConsole(v):d[ese](v)}}}a(f,"_logInternalMessage");function h(A){return H1(Np(A,Bgo,d).cfg,function(y){var E=y.cfg;o=E[n7e],s=E.loggingLevelTelemetry,c=E.maxMessageLimit,l=E.enableDebug})}a(h,"_setDefaultsFromConfig");function m(){return r>=c}a(m,"_areInternalMessagesThrottled");function g(A,y){var E=LDt(e||{});E&&E[nC]&&E[nC](A,y)}a(g,"_debugExtMsg")})}return a(t,"DiagnosticLogger"),t.__ieDyn=1,t})();function fKr(t){return t||new ZW}a(fKr,"_getLogger");function Ta(t,e,r,n,o,s){s===void 0&&(s=!1),fKr(t)[cL](e,r,n,o,s)}a(Ta,"_throwInternal");function XN(t,e){fKr(t)[ese](e)}a(XN,"_warnToConsole");var UDt,UU,pKr="toGMTString",hKr="toUTCString",jDt="cookie",QDt="expires",mKr="isCookieUseDisabled",nbe="disableCookiesUsage",gKr="_ckMgr",w7e=null,qDt=null,AKr=null,eM,yKr={},EKr={},Fgo=(UDt={cookieCfg:cKr((UU={},UU[u7e]={fb:"cookieDomain",dfVal:OU},UU.path={fb:"cookiePath",dfVal:OU},UU.enabled=j1,UU.ignoreCookies=j1,UU.blockedCookies=j1,UU.disableCookieDefer=!1,UU)),cookieDomain:j1,cookiePath:j1},UDt[nbe]=j1,UDt);function HDt(){!eM&&(eM=O9e(function(){return ef()}))}a(HDt,"_getDoc");function R7e(t){return t?t.isEnabled():!0}a(R7e,"_isMgrEnabled");function TKr(t,e){return e&&t&&lr(t.ignoreCookies)?Qo(t.ignoreCookies,e)!==-1:!1}a(TKr,"_isIgnoredCookie");function _Kr(t,e){return e&&t&&lr(t.blockedCookies)&&Qo(t.blockedCookies,e)!==-1?!0:TKr(t,e)}a(_Kr,"_isBlockedCookie");function vKr(t,e){var r=e[kU];if(Zt(r)){var n=void 0;Dn(t[mKr])||(n=!t[mKr]),Dn(t[nbe])||(n=!t[nbe]),r=n}return r}a(vKr,"_isCfgEnabled");function GDt(t,e){var r,n,o,s,c,l,u,d,f=[];function h(E){var _,v=(_={},_[d7e]=E||"/",_[QDt]="Thu, 01 Jan 1970 00:00:01 GMT",_);return KW()||(v["max-age"]="0"),bKr(Es,v)}a(h,"_formatDeletionValue");function m(E,_,v,b){var T={},w=Pi(E||Es),R=eu(w,";");if(R!==-1&&(w=Pi(RN(E,R)),T=IKr(Uf(E,R+1))),hL(T,u7e,v||o,x1,Dn),!Zt(_)){var x=KW();if(Dn(T[QDt])){var P=fl(),D=P+_*1e3;if(D>0){var N=new Date;N.setTime(D),hL(T,QDt,CKr(N,x?pKr:hKr)||CKr(N,x?pKr:hKr)||Es,x1)}}x||hL(T,"max-age",Es+_,null,Dn)}var B=fse();return B&&B.protocol==="https:"&&(hL(T,"secure",null,null,Dn),qDt===null&&(qDt=!xKr((Uu()||{})[QCe])),qDt&&hL(T,"SameSite","None",null,Dn)),hL(T,d7e,b||n,null,Dn),bKr(w,T)}a(m,"_formatSetCookieValue");function g(E){if(f)for(var _=f[Cn]-1;_>=0;_--)f[_].n===E&&f[zI](_,1)}a(g,"_removePendingCookie");function A(){rbe(e)&&f&&(Ct(f,function(E){_Kr(r,E.n)||(E.o===0?u(E.n,E.v):E.o===1&&d(E.n,E.v))}),f=[])}a(A,"_flushPendingCookies"),t=Np(t||EKr,null,e).cfg,s=H1(t,function(E){E.setDf(E.cfg,Fgo),r=E.ref(E.cfg,"cookieCfg"),n=r[d7e]||"/",o=r[u7e],r.disableCookieDefer?f=null:f===null&&(f=[]);var _=c;c=vKr(t,r)!==!1,l=r.getCookie||Ugo,u=r.setCookie||SKr,d=r.delCookie||SKr,!_&&c&&f&&A()},e);var y={isEnabled:a(function(){var E=vKr(t,r)!==!1&&c&&rbe(e),_=EKr[gKr];return E&&_&&y!==_&&(E=R7e(_)),E},"isEnabled"),setEnabled:a(function(E){r[kU]=E,Dn(t[nbe])||(t[nbe]=!E)},"setEnabled"),set:a(function(E,_,v,b,T){var w=!1,R=_Kr(r,E);if(!R){var x=m(_,v,b,T);R7e(y)?(u(E,x),w=!0):f&&(g(E),f[ro]({n:E,o:0,v:x}),w=!0)}return w},"set"),get:a(function(E){var _=Es,v=TKr(r,E);if(!v){if(R7e(y))_=l(E);else if(f)for(var b=f[Cn]-1;b>=0;b--){var T=f[b];if(T.n===E){if(T.o===0){var w=T.v,R=eu(w,";");_=R!==-1?Pi(RN(w,R)):Pi(w)}break}}}return _},"get"),del:a(function(E,_){var v=!1;return R7e(y)?v=y.purge(E,_):f&&(g(E),f[ro]({n:E,o:1,v:h(_)}),v=!0),v},"del"),purge:a(function(E,_){var v=!1;return rbe(e)&&(d(E,h(_)),v=!0),v},"purge"),unload:a(function(E){s&&s.rm(),s=null,f=null},"unload")};return y[gKr]=y,y}a(GDt,"createCookieMgr");function rbe(t){if(w7e===null){w7e=!1,!eM&&HDt();try{var e=eM.v||{};w7e=e[jDt]!==void 0}catch(r){Ta(t,2,68,"Cannot access document.cookie - "+use(r),{exception:ur(r)})}}return w7e}a(rbe,"areCookiesSupported");function IKr(t){var e={};if(t&&t[Cn]){var r=Pi(t)[dL](";");Ct(r,function(n){if(n=Pi(n||Es),n){var o=eu(n,"=");o===-1?e[n]=null:e[Pi(RN(n,o))]=Pi(Uf(n,o+1))}})}return e}a(IKr,"_extractParts");function CKr(t,e){return Or(t[e])?t[e]():null}a(CKr,"_formatDate");function bKr(t,e){var r=t||Es;return zr(e,function(n,o){r+="; "+n+(Zt(o)?Es:"="+o)}),r}a(bKr,"_formatCookieValue");function Ugo(t){var e=Es;if(!eM&&HDt(),eM.v){var r=eM.v[jDt]||Es;AKr!==r&&(yKr=IKr(r),AKr=r),e=Pi(yKr[t]||Es)}return e}a(Ugo,"_getCookieValue");function SKr(t,e){!eM&&HDt(),eM.v&&(eM.v[jDt]=t+"="+e)}a(SKr,"_setCookieValue");function xKr(t){return Ai(t)?!!(jm(t,"CPU iPhone OS 12")||jm(t,"iPad; CPU OS 12")||jm(t,"Macintosh; Intel Mac OS X 10_14")&&jm(t,"Version/")&&jm(t,"Safari")||jm(t,"Macintosh; Intel Mac OS X 10_14")&&GB(t,"AppleWebKit/605.1.15 (KHTML, like Gecko)")||jm(t,"Chrome/5")||jm(t,"Chrome/6")||jm(t,"UnrealEngine")&&!jm(t,"Chrome")||jm(t,"UCBrowser/12")||jm(t,"UCBrowser/11")):!1}a(xKr,"uaDisallowsSameSiteNone");p();var Qgo={perfEvtsSendAll:!1};function qgo(t){t.h=null;var e=t.cb;t.cb=[],Ct(e,function(r){Ff(r.fn,[r.arg])})}a(qgo,"_runScheduledListeners");function QU(t,e,r,n){Ct(t,function(o){o&&o[e]&&(r?(r.cb[ro]({fn:n,arg:o}),r.h=r.h||Pp(qgo,0,r)):Ff(n,[o]))})}a(QU,"_runListeners");var $Dt=(function(){function t(e){this.listeners=[];var r,n,o=[],s={h:null,cb:[]},c=Np(e,Qgo);n=c[GN](function(l){r=!!l.cfg.perfEvtsSendAll}),bi(t,this,function(l){qi(l,"listeners",{g:a(function(){return o},"g")}),l[rse]=function(u){o[ro](u)},l[tse]=function(u){for(var d=Qo(o,u);d>-1;)o[zI](d,1),d=Qo(o,u)},l[ose]=function(u){QU(o,ose,s,function(d){d[ose](u)})},l[MU]=function(u,d){QU(o,MU,s,function(f){f[MU](u,d)})},l[sse]=function(u,d){QU(o,sse,d?s:null,function(f){f[sse](u,d)})},l[YN]=function(u){u&&(r||!u[qCe]())&&QU(o,YN,null,function(d){u.isAsync?Pp(function(){return d[YN](u)},0):d[YN](u)})},l[a7e]=function(u){u&&u[Cn]&&QU(o,a7e,s,function(d){d[a7e](u)})},l[c7e]=function(u){u&&u[q1]&&QU(o,c7e,s,function(d){d[c7e](u)})},l[l7e]=function(u,d){if(u>0){var f=d||0;QU(o,l7e,s,function(h){h[l7e](u,f)})}},l[YI]=function(u){var d=a(function(){n&&n.rm(),n=null,o=[],s.h&&s.h[$N](),s.h=null,s.cb=[]},"_finishUnload"),f;if(QU(o,"unload",null,function(h){var m=h[YI](u);m&&(f||(f=[]),f[ro](m))}),f)return Td(function(h){return pl(nUe(f),function(){d(),h()})});d()}})}return a(t,"NotificationManager"),t.__ieDyn=1,t})();p();var vse="ctx",WDt="ParentContextKey",ibe="ChildrenContextKey",jgo=null,Cse=(function(){function t(e,r,n){var o=this;if(o.start=fl(),o[PP]=e,o.isAsync=n,o[qCe]=function(){return!1},Or(r)){var s;qi(o,"payload",{g:a(function(){return!s&&Or(r)&&(s=r(),r=null),s},"g")})}o[$W]=function(c){return c?c===t[WDt]||c===t[ibe]?o[c]:(o[vse]||{})[c]:null},o[NP]=function(c,l){if(c)if(c===t[WDt])o[c]||(o[qCe]=function(){return!0}),o[c]=l;else if(c===t[ibe])o[c]=l;else{var u=o[vse]=o[vse]||{};u[c]=l}},o.complete=function(){var c=0,l=o[$W](t[ibe]);if(lr(l))for(var u=0;u0&&(Ct(A,function(y){try{y.func.call(y.self,y.args)}catch(E){Ta(r[qu],2,73,"Unexpected Exception during onComplete - "+ur(E))}}),s=[])}return g}a(u,"_moveNext");function d(g,A){var y=null,E=e.cfg;if(E&&g){var _=E[pL];!_&&A&&(_={}),E[pL]=_,_=e.ref(E,pL),_&&(y=_[g],!y&&A&&(y={}),_[g]=y,y=e.ref(_,g))}return y}a(d,"_getExtCfg");function f(g,A){var y=d(g,!0);return A&&zr(A,function(E,_){if(Zt(y[E])){var v=e.cfg[E];(v||!Zt(v))&&(y[E]=v)}JCe(e,y,E,_)}),e.setDf(y,A)}a(f,"_resolveExtCfg");function h(g,A,y){y===void 0&&(y=!1);var E,_=d(g,!1),v=e.cfg;return _&&(_[A]||!Zt(_[A]))?E=_[A]:(v[A]||!Zt(v[A]))&&(E=v[A]),E||!Zt(E)?E:y}a(h,"_getConfig");function m(g){for(var A;A=c._next();){var y=A[PU]();y&&g(y)}}return a(m,"_iterateChain"),c}a(ZDt,"_createInternalContext");function JI(t,e,r,n){var o=Np(e),s=ZDt(t,o,r,n),c=s.ctx;function l(d){var f=s._next();return f&&f[iC](d,c),!f}a(l,"_processNext");function u(d,f){return d===void 0&&(d=null),lr(d)&&(d=qU(d,o.cfg,r,f)),JI(d||c[Q1](),o.cfg,r,f)}return a(u,"_createNew"),c[Q0]=l,c[WN]=u,c}a(JI,"createProcessTelemetryContext");function bse(t,e,r){var n=Np(e.config),o=ZDt(t,n,e,r),s=o.ctx;function c(u){var d=o._next();return d&&d[YI](s,u),!d}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),lr(u)&&(u=qU(u,n.cfg,e,d)),bse(u||s[Q1](),e,d)}return a(l,"_createNew"),s[Q0]=c,s[WN]=l,s}a(bse,"createProcessTelemetryUnloadContext");function obe(t,e,r){var n=Np(e.config),o=ZDt(t,n,e,r),s=o.ctx;function c(u){return s.iterate(function(d){Or(d[GW])&&d[GW](s,u)})}a(c,"_processNext");function l(u,d){return u===void 0&&(u=null),lr(u)&&(u=qU(u,n.cfg,e,d)),obe(u||s[Q1](),e,d)}return a(l,"_createNew"),s[Q0]=c,s[WN]=l,s}a(obe,"createProcessTelemetryUpdateContext");function qU(t,e,r,n){var o=null,s=!n;if(lr(t)&&t[Cn]>0){var c=null;Ct(t,function(l){if(!s&&n===l&&(s=!0),s&&l&&Or(l[iC])){var u=zgo(l,e,r);o||(o=u),c&&c._setNext(u),c=u}})}return n&&!o?qU([n],e,r):o}a(qU,"createTelemetryProxyChain");function zgo(t,e,r){var n=null,o=Or(t[iC]),s=Or(t[NU]),c;t?c=t[VN]+"-"+t[YW]+"-"+DKr++:c="Unknown-0-"+DKr++;var l={getPlugin:a(function(){return t},"getPlugin"),getNext:a(function(){return n},"getNext"),processTelemetry:f,unload:h,update:m,_id:c,_setNext:a(function(g){n=g},"_setNext")};function u(){var g;return t&&Or(t[kKr])&&(g=t[kKr]()),g||(g=JI(l,e,r)),g}a(u,"_getTelCtx");function d(g,A,y,E,_){var v=!1,b=t?t[VN]:Vgo,T=g[PKr];return T||(T=g[PKr]={}),g.setNext(n),t&&Mp(g[qf](),function(){return b+":"+y},function(){T[c]=!0;try{var w=n?n._id:Es;w&&(T[w]=!1),v=A(g)}catch(x){var R=n?T[n._id]:!0;R&&(v=!0),(!n||!R)&&Ta(g[nC](),1,73,"Plugin ["+b+"] failed during "+y+" - "+ur(x)+", run flags: "+ur(T))}},E,_),v}a(d,"_processChain");function f(g,A){A=A||u();function y(E){if(!t||!o)return!1;var _=mL(t);return _[U1]||_[HCe]?!1:(s&&t[NU](n),t[iC](g,E),!0)}a(y,"_callProcessTelemetry"),d(A,y,"processTelemetry",function(){return{item:g}},!g.sync)||A[Q0](g)}a(f,"_processTelemetry");function h(g,A){function y(){var E=!1;if(t){var _=mL(t),v=t[qf]||_[qf];t&&(!v||v===g.core())&&!_[U1]&&(_[qf]=null,_[U1]=!0,_[rC]=!1,t[U1]&&t[U1](g,A)===!0&&(E=!0))}return E}a(y,"_callTeardown"),d(g,y,"unload",function(){},A.isAsync)||g[Q0](A)}a(h,"_unloadPlugin");function m(g,A){function y(){var E=!1;if(t){var _=mL(t),v=t[qf]||_[qf];t&&(!v||v===g.core())&&!_[U1]&&t[GW]&&t[GW](g,A)===!0&&(E=!0)}return E}a(y,"_callUpdate"),d(g,y,"update",function(){},!1)||g[Q0](A)}return a(m,"_updatePlugin"),bh(l)}a(zgo,"createTelemetryPluginProxy");var NKr=(function(){function t(e,r,n,o){var s=this,c=JI(e,r,n,o);LU(s,c,Fu(c))}return a(t,"ProcessTelemetryContext"),t})();p();p();p();function sbe(){var t=[];function e(n){n&&t[ro](n)}a(e,"_addHandler");function r(n,o){Ct(t,function(s){try{s(n,o)}catch(c){Ta(n[nC](),2,73,"Unexpected error calling unload handler - "+ur(c))}}),t=[]}return a(r,"_runHandlers"),{add:e,run:r}}a(sbe,"createUnloadHandlerContainer");p();var D7e,N7e;function M7e(){var t=[];function e(n){var o=t;t=[],Ct(o,function(s){try{(s.rm||s.remove).call(s)}catch(c){Ta(n,2,73,"Unloading:"+ur(c))}}),D7e&&o[Cn]>D7e&&(N7e?N7e("doUnload",o):Ta(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected."))}a(e,"_doUnload");function r(n){n&&(Sh(t,n),D7e&&t[Cn]>D7e&&(N7e?N7e("Add",t):Ta(null,1,48,"Max unload hooks exceeded. An excessive number of unload hooks has been detected.")))}return a(r,"_addHook"),{run:e,add:r}}a(M7e,"createUnloadHookContainer");var XDt,jU="getPlugin",Ygo=(XDt={},XDt[pL]={isVal:OU,v:{}},XDt),Sse=(function(){function t(){var e=this,r,n,o,s,c;d(),bi(t,e,function(f){f[lL]=function(h,m,g,A){u(h,m,A),r=!0},f[U1]=function(h,m){var g=f[qf];if(!g||h&&g!==h[qf]())return;var A,y=!1,E=h||bse(null,g,o&&o[jU]?o[jU]():o),_=m||{reason:0,isAsync:!1};function v(){y||(y=!0,s.run(E,m),c.run(E[nC]()),A===!0&&E[Q0](_),d())}return a(v,"_unloadCallback"),!f[DU]||f[DU](E,_,v)!==!0?v():A=!0,A},f[GW]=function(h,m){var g=f[qf];if(!g||h&&g!==h[qf]())return;var A,y=!1,E=h||obe(null,g,o&&o[jU]?o[jU]():o),_=m||{reason:0};function v(){y||(y=!0,u(E.getCfg(),E.core(),E[Q1]()))}return a(v,"_updateCallback"),!f._doUpdate||f._doUpdate(E,_,v)!==!0?v():A=!0,A},BU(f,"_addUnloadCb",function(){return s},"add"),BU(f,"_addHook",function(){return c},"add"),qi(f,"_unloadHooks",{g:a(function(){return c},"g")})}),e[nC]=function(f){return l(f)[nC]()},e[rC]=function(){return r},e.setInitialized=function(f){r=f},e[NU]=function(f){o=f},e[Q0]=function(f,h){h?h[Q0](f):o&&Or(o[iC])&&o[iC](f,null)},e._getTelCtx=l;function l(f){f===void 0&&(f=null);var h=f;if(!h){var m=n||JI(null,{},e[qf]);o&&o[jU]?h=m[WN](null,o[jU]):h=m[WN](null,o)}return h}a(l,"_getTelCtx");function u(f,h,m){Np(f,Ygo,_se(h)),!m&&h&&(m=h[t7e]()[Q1]());var g=o;o&&o[jU]&&(g=o[jU]()),e[qf]=h,n=JI(m,f,h,g)}a(u,"_setDefaults");function d(){r=!1,e[qf]=null,n=null,o=null,c=M7e(),s=sbe()}a(d,"_initDefaults")}return a(t,"BaseTelemetryPlugin"),t.__ieDyn=1,t})();function Kgo(t,e,r){var n={id:e,fn:r};Sh(t,n);var o={remove:a(function(){Ct(t,function(s,c){if(s.id===n.id)return t[zI](c,1),-1})},"remove")};return o}a(Kgo,"_addInitializer");function Jgo(t,e,r){for(var n=!1,o=t[Cn],s=0;s"},"v")})}a(aAo,"_createUnloadHook");var O7e=(function(){function t(){var e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q;bi(t,this,function(U){re(),U._getDbgPlgTargets=function(){return[x,o]},U[rC]=function(){return r},U.activeStatus=function(){return N},U._setPendingStatus=function(){N=3},U[lL]=function(ie,le,Ne,we){g&&Wc(OKr),U[rC]()&&Wc("Core cannot be initialized more than once"),e=Np(ie,eNt,Ne||U[qu],!1),ie=e.cfg,qe(e[GN](function(st){var Et=st.cfg;L=Et.initInMemoMaxSize||eAo,z(Et);var kt=st.ref(st.cfg,pL);zr(kt,function(Gt){st.ref(kt,Gt)})})),s=we,b=sAo(e,v,s&&U[FCe](),b),K(),U[qu]=Ne;var Be=ie[zW];if(f=[],f[ro].apply(f,lW(lW([],le,!1),Be,!1)),h=ie[WW],Oe(null),(!m||m[Cn]===0)&&Wc("No "+WW+" available"),h&&h[Cn]>1){var tt=U[PU]("TeeChannelController");(!tt||!tt.plugin)&&Ta(n,1,28,"TeeChannel required")}oAo(ie,R,n),R=null,r=!0,N===wU.ACTIVE&&J()},U.getChannels=function(){var ie=[];return m&&Ct(m,function(le){ie[ro](le)}),bh(ie)},U.track=function(ie){Mp(U[ase](),function(){return"AppInsightsCore:track"},function(){ie===null&&(ue(ie),Wc("Invalid telemetry item")),!ie[PP]&&Zt(ie[PP])&&(ue(ie),Wc("telemetry name required")),ie.iKey=ie.iKey||w,ie.time=ie.time||lse(new Date),ie.ver=ie.ver||"4.0",!g&&U[rC]()&&N===wU.ACTIVE?ae()[Q0](ie):N!==wU.INACTIVE&&o[Cn]<=L&&o[ro](ie)},function(){return{item:ie}},!ie.sync)},U[t7e]=ae,U[FCe]=function(){return s||(s=new $Dt(e.cfg),U[Zgo]=s),s},U[rse]=function(ie){U.getNotifyMgr()[rse](ie)},U[tse]=function(ie){s&&s[tse](ie)},U.getCookieMgr=function(){return u||(u=GDt(e.cfg,U[qu])),u},U.setCookieMgr=function(ie){u!==ie&&(Ase(u,!1),u=ie)},U[ase]=function(){return c||l||zDt()},U.setPerfMgr=function(ie){c=ie},U.eventCnt=function(){return o[Cn]},U.releaseQueue=function(){if(r&&o[Cn]>0){var ie=o;o=[],N===2?Ct(ie,function(le){le.iKey=le.iKey||w,ae()[Q0](le)}):Ta(n,2,20,"core init status is not active")}},U.pollInternalLogs=function(ie){return y=ie||null,Q=!1,O&&O[$N](),ne(!0)};function z(ie){var le=ie.instrumentationKey,Ne=ie.endpointUrl;if(N!==3){if(Zt(le)){w=null,N=wU.INACTIVE;var we="Please provide instrumentation key";r?(Ta(n,1,100,we),J()):Wc(we);return}var Be=[];Um(le)?(Be[ro](le),w=null):w=le,Um(Ne)?(Be[ro](Ne),B=null):B=Ne,Be[Cn]?W(ie,Be):$()}}a(z,"_handleIKeyEndpointPromises");function W(ie,le){j=!1,N=3;var Ne=OU(ie.initTimeOut)?ie.initTimeOut:tAo,we=rUe(le);M&&M[$N](),M=Pp(function(){M=null,j||$()},Ne),pl(we,function(Be){try{if(j)return;if(!Be.rejected){var tt=Be[uL];if(tt&&tt[Cn]){var st=tt[0];if(w=st&&st[uL],tt[Cn]>1){var Et=tt[1];B=Et&&Et[uL]}}w&&(ie.instrumentationKey=w,ie.endpointUrl=B)}$()}catch{j||$()}})}a(W,"_waitForInitPromises");function $(){j=!0,Zt(w)?(N=wU.INACTIVE,Ta(n,1,112,"ikey can't be resolved from promises")):N=wU.ACTIVE,J()}a($,"_setStatus");function J(){r&&(U.releaseQueue(),U.pollInternalLogs())}a(J,"_releaseQueues");function ne(ie){if((!O||!O[kU])&&!Q){var le=ie||n&&n.queue[Cn]>0;le&&(q||(q=!0,qe(e[GN](function(Ne){var we=Ne.cfg.diagnosticLogInterval;(!we||!(we>0))&&(we=1e4);var Be=!1;O&&(Be=O[kU],O[$N]()),O=U9e(Z,we),O.unref(),O[kU]=Be}))),O[kU]=!0)}return O}a(ne,"_startLogPoller"),U[yDt]=function(){Q=!0,O&&O[$N](),Z()},LU(U,function(){return A},["addTelemetryInitializer"]),U[YI]=function(ie,le,Ne){ie===void 0&&(ie=!0),r||Wc(Xgo),g&&Wc(OKr);var we={reason:50,isAsync:ie,flushComplete:!1},Be;ie&&!le&&(Be=Td(function(Et){le=Et}));var tt=bse(Fe(),U);tt[UCe](function(){v.run(U[qu]),MDt([u,s,n],ie,function(){re(),le&&le(we)})},U);function st(Et){we.flushComplete=Et,g=!0,_.run(tt,we),U[yDt](),tt[Q0](we)}return a(st,"_doUnload"),Z(),ee(ie,st,6,Ne)||st(!1),Be},U[PU]=ve,U.addPlugin=function(ie,le,Ne,we){if(!ie){we&&we(!1),X(FKr);return}var Be=ve(ie[VN]);if(Be&&!le){we&&we(!1),X("Plugin ["+ie[VN]+"] is already loaded!");return}var tt={reason:16};function st(Gt){f[ro](ie),tt.added=[ie],Oe(tt),we&&we(!0)}if(a(st,"_addPlugin"),Be){var Et=[Be.plugin],kt={reason:2,isAsync:!!Ne};Pe(Et,kt,function(Gt){Gt?(tt.removed=Et,tt.reason|=32,st(!0)):we&&we(!1)})}else st(!1)},U.updateCfg=function(ie,le){le===void 0&&(le=!0);var Ne;if(U[rC]()){Ne={reason:1,cfg:e.cfg,oldCfg:Aoe({},e.cfg),newConfig:Aoe({},ie),merge:le},ie=Ne.newConfig;var we=e.cfg;ie[zW]=we[zW],ie[WW]=we[WW]}e._block(function(Be){var tt=Be.cfg;tNt(Be,tt,ie,le),le||zr(tt,function(st){eA(ie,st)||Be.set(tt,st,j1)}),Be.setDf(tt,eNt)},!0),e.notify(),Ne&&pe(Ne)},U.evtNamespace=function(){return E},U.flush=ee,U.getTraceCtx=function(ie){return T||(T=RKr()),T},U.setTraceCtx=function(ie){T=ie||null},U.addUnloadHook=qe,BU(U,"addUnloadCb",function(){return _},"add"),U.onCfgChange=function(ie){var le;return r?le=H1(e.cfg,ie,U[qu]):le=iAo(R,ie),aAo(le)},U.getWParam=function(){return jB()||e.cfg.enableWParam?0:-1};function H(){var ie={};P=[];var le=a(function(Ne){Ne&&Ct(Ne,function(we){if(we[VN]&&we[r7e]&&!ie[we.identifier]){var Be=we[VN]+"="+we[r7e];P[ro](Be),ie[we.identifier]=we}})},"_addPluginVersions");le(m),h&&Ct(h,function(Ne){le(Ne)}),le(f)}a(H,"_setPluginVersions");function re(){r=!1,e=Np({},eNt,U[qu]),e.cfg[n7e]=1,qi(U,"config",{g:a(function(){return e.cfg},"g"),s:a(function(le){U.updateCfg(le,!1)},"s")}),qi(U,"pluginVersionStringArr",{g:a(function(){return P||H(),P},"g")}),qi(U,"pluginVersionString",{g:a(function(){return D||(P||H(),D=P.join(";")),D||Es},"g")}),qi(U,"logger",{g:a(function(){return n||(n=new ZW(e.cfg),e[qu]=n),n},"g"),s:a(function(le){e[qu]=le,n!==le&&(Ase(n,!1),n=le)},"s")}),U[qu]=new ZW(e.cfg),x=[];var ie=U.config[zW]||[];ie.splice(0,ie[Cn]),Sh(ie,x),A=new MKr,o=[],Ase(s,!1),s=null,c=null,l=null,Ase(u,!1),u=null,d=null,f=[],h=null,m=null,g=!1,y=null,E=KI("AIBaseCore",!0),_=sbe(),T=null,w=null,v=M7e(),R=[],D=null,P=null,Q=!1,O=null,q=!1,N=0,B=null,L=null,j=!1,M=null}a(re,"_initDefaults");function ae(){var ie=JI(Fe(),e.cfg,U);return ie[UCe](ne),ie}a(ae,"_createTelCtx");function Oe(ie){var le=nAo(U[qu],aKr,f);d=null,D=null,P=null,m=(h||[])[0]||[],m=k7e(Sh(m,le[WW]));var Ne=Sh(k7e(le[qf]),m);x=bh(Ne);var we=U.config[zW]||[];we.splice(0,we[Cn]),Sh(we,x);var Be=ae();m&&m[Cn]>0&&JDt(Be[WN](m),Ne),JDt(Be,Ne),ie&&pe(ie)}a(Oe,"_initPluginChain");function ve(ie){var le=null,Ne=null,we=[];return Ct(x,function(Be){if(Be[VN]===ie&&Be!==A)return Ne=Be,-1;Be.getChannel&&we[ro](Be)}),!Ne&&we[Cn]>0&&Ct(we,function(Be){if(Ne=Be.getChannel(ie),!Ne)return-1}),Ne&&(le={plugin:Ne,setEnabled:a(function(Be){mL(Ne)[HCe]=!Be},"setEnabled"),isEnabled:a(function(){var Be=mL(Ne);return!Be[U1]&&!Be[HCe]},"isEnabled"),remove:a(function(Be,tt){Be===void 0&&(Be=!0);var st=[Ne],Et={reason:1,isAsync:Be};Pe(st,Et,function(kt){kt&&Oe({reason:32,removed:st}),tt&&tt(kt)})},"remove")}),le}a(ve,"_getPlugin");function Fe(){if(!d){var ie=(x||[]).slice();Qo(ie,A)===-1&&ie[ro](A),d=qU(k7e(ie),e.cfg,U)}return d}a(Fe,"_getPluginChain");function Pe(ie,le,Ne){if(ie&&ie[Cn]>0){var we=qU(ie,e.cfg,U),Be=bse(we,U);Be[UCe](function(){var tt=!1,st=[];Ct(f,function(kt,Gt){BKr(kt,ie)?tt=!0:st[ro](kt)}),f=st,D=null,P=null;var Et=[];h&&(Ct(h,function(kt,Gt){var jt=[];Ct(kt,function(Ie){BKr(Ie,ie)?tt=!0:jt[ro](Ie)}),Et[ro](jt)}),h=Et),Ne&&Ne(tt),ne()}),Be[Q0](le)}else Ne(!1)}a(Pe,"_removePlugins");function Z(){if(n&&n.queue){var ie=n.queue.slice(0);n.queue[Cn]=0,Ct(ie,function(le){var Ne={name:y||"InternalMessageId: "+le[nse],iKey:w,time:lse(new Date),baseType:Ese.dataType,baseData:{message:le[zN]}};U.track(Ne)})}}a(Z,"_flushInternalLogs");function ee(ie,le,Ne,we){var Be=1,tt=!1,st=null;we=we||5e3;function Et(){Be--,tt&&Be===0&&(st&&st[$N](),st=null,le&&le(tt),le=null)}if(a(Et,"doCallback"),m&&m[Cn]>0){var kt=ae()[WN](m);kt.iterate(function(Gt){if(Gt.flush){Be++;var jt=!1;Gt.flush(ie,function(){jt=!0,Et()},Ne)||jt||(ie&&st==null?st=Pp(function(){st=null,Et()},we):Et())}})}return tt=!0,Et(),!0}a(ee,"_flushChannels");function K(){var ie;qe(e[GN](function(le){var Ne=le.cfg.enablePerfMgr;if(Ne){var we=le.cfg[s7e];(ie!==we||!ie)&&(we||(we=rAo),f7e(le.cfg,s7e,we),ie=we,l=null),!c&&!l&&Or(we)&&(l=we(U,U[FCe]()))}else l=null,ie=null}))}a(K,"_initPerfManager");function pe(ie){var le=obe(Fe(),U);le[UCe](ne),(!U._updateHook||U._updateHook(le,ie)!==!0)&&le[Q0](ie)}a(pe,"_doUpdate");function X(ie){var le=U[qu];le?(Ta(le,2,73,ie),ne()):Wc(ie)}a(X,"_logOrThrowError");function ue(ie){var le=U[FCe]();le&&le[MU]([ie],2)}a(ue,"_notifyInvalidEvent");function qe(ie){v.add(ie)}a(qe,"_addUnloadHook")})}return a(t,"AppInsightsCore"),t.__ieDyn=1,t})();p();var MP="",cAo="NoResponseBody",UKr="&"+cAo+"=true",rNt="POST",B7e=(function(){function t(){var e=0,r,n,o,s,c,l,u,d,f,h,m,g,A,y;bi(t,this,function(E,_){var v=!0;j(),E[lL]=function(M,O){o=O,n&&Ta(o,1,28,"Sender is already initialized"),E.SetConfig(M),n=!0},E._getDbgPlgTargets=function(){return[n,s,l,r]},E.SetConfig=function(M){try{if(c=M.senderOnCompleteCallBack||{},l=!!M.disableCredentials,u=M.fetchCredentials,s=!!M.isOneDs,r=!!M.enableSendPromise,f=!!M.disableXhr,h=!!M.disableBeacon,m=!!M.disableBeaconSync,y=M.timeWrapper,A=!!M.addNoResponse,g=!!M.disableFetchKeepAlive,d={sendPOST:N},s||(v=!1),l){var O=fse();O&&O.protocol&&O.protocol[HW]()==="file:"&&(v=!1)}return!0}catch{}return!1},E.getSyncFetchPayload=function(){return e},E.getSenderInst=function(M,O){return M&&M[Cn]?R(M,O):null},E.getFallbackInst=function(){return d},E[DU]=function(M,O){j()},E.preparePayload=function(M,O,q,Q){if(!O||Q||!q[q1]){M(q);return}try{var U=Ri("CompressionStream");if(!Or(U)){M(q);return}var z=new ReadableStream({start:a(function(re){re.enqueue(Ai(q[q1])?new TextEncoder().encode(q[q1]):q[q1]),re.close()},"start")}),W=z.pipeThrough(new U("gzip")),$=W.getReader(),J=[],ne=0,H=!1;return pl($.read(),a(function re(ae){if(!H&&!ae.rejected){var Oe=ae[uL];if(!Oe.done)return J[ro](Oe[uL]),ne+=Oe.value[Cn],pl($.read(),re);for(var ve=new Uint8Array(ne),Fe=0,Pe=0,Z=J;Pe0&&(Ct(Fu(ve),function(K){H.append(K,ve[K])}),Fe[jCe]=H),u?Fe.credentials=u:v&&s&&(Fe.credentials="include"),q&&(Fe.keepalive=!0,e+=re,s?M._sendReason===2&&(ae=!0,A&&(U+=UKr)):ae=!0);var Pe=new Request(U,Fe);try{Pe[ODt]=!0}catch{}if(!q&&r&&($=Td(function(K,pe){J=K,ne=pe})),!U){w(O),J&&J(!1);return}function Z(K,pe){pe?x(O,s?0:pe,{},s?MP:K):x(O,s?0:400,{},s?MP:K)}a(Z,"_handleError");function ee(K,pe,X){var ue=K[DP],qe=c.fetchOnComplete;qe&&Or(qe)?qe(K,O,X||MP,pe):x(O,ue,{},X||MP)}a(ee,"_onFetchComplete");try{pl(fetch(s?U:Pe,s?Fe:null),function(K){if(q&&(e-=re,re=0),!Oe)if(Oe=!0,K.rejected)Z(K.reason&&K.reason[zN],499),ne&&ne(K.reason);else{var pe=K[uL];try{!s&&!pe.ok?(pe[DP]?Z(pe.statusText,pe[DP]):Z(pe.statusText,499),J&&J(!1)):s&&!pe.body?(ee(pe,null,MP),J&&J(!0)):pl(pe.text(),function(X){ee(pe,M,X[uL]),J&&J(!0)})}catch(X){pe&&pe[DP]?Z(ur(X),pe[DP]):Z(ur(X),499),ne&&ne(X)}}})}catch(K){Oe||(Z(ur(K),499),ne&&ne(K))}return ae&&!Oe&&(Oe=!0,x(O,200,{}),J&&J(!0)),s&&!Oe&&M[VW]>0&&y&&y.set(function(){Oe||(Oe=!0,x(O,500,{}),J&&J(!0))},M[VW]),$}a(B,"_doFetchSender");function L(M,O,q){var Q=tf(),U=new XDomainRequest,z=M[q1];U.onload=function(){var H=JN(U),re=c&&c.xdrOnComplete;re&&Or(re)?re(U,O,M):x(O,200,{},H)},U.onerror=function(){x(O,400,{},s?MP:h7e(U))},U.ontimeout=function(){x(O,500,{})},U.onprogress=function(){};var W=Q&&Q.location&&Q.location.protocol||"",$=M[ise];if(!$){w(O);return}if(!s&&$.lastIndexOf(W,0)!==0){var J="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";Ta(o,2,40,". "+J),T(J,O);return}var ne=s?$:$[kP](/^(https?:)/,"");U.open(rNt,ne),M[VW]&&(U[VW]=M[VW]),U.send(z),s&&q?y&&y.set(function(){U.send(z)},0):U.send(z)}a(L,"_xdrSender");function j(){e=0,n=!1,r=!1,o=null,s=null,c=null,l=null,u=null,d=null,f=!1,h=!1,m=!1,g=!1,A=!1,y=null}a(j,"_initDefaults")})}return a(t,"SenderPostManager"),t.__ieDyn=1,t})();p();var VKr="on",QKr="attachEvent",qKr="addEventListener",jKr="detachEvent",HKr="removeEventListener",nNt="events",lbe="visibilitychange",F7e="pagehide",WKr="pageshow",zKr="unload",YKr="beforeunload",KKr=KI("aiEvtPageHide"),JKr=KI("aiEvtPageShow"),lAo=/\.[\.]+/g,uAo=/[\.]+$/,dAo=1,L7e=_7e("events"),fAo=/^([^.]*)(?:\.(.+)|)/;function GKr(t){return t&&t[kP]?t[kP](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Es):t}a(GKr,"_normalizeNamespace");function iNt(t,e){if(e){var r=Es;lr(e)?(r=Es,Ct(e,function(o){o=GKr(o),o&&(o[0]!=="."&&(o="."+o),r+=o)})):r=GKr(e),r&&(r[0]!=="."&&(r="."+r),t=(t||Es)+r)}var n=fAo.exec(t||Es)||[];return{type:n[1],ns:(n[2]||Es).replace(lAo,".").replace(uAo,Es)[dL](".").sort().join(".")}}a(iNt,"_getEvtNamespace");function ZKr(t,e,r){r===void 0&&(r=!0);var n=L7e.get(t,nNt,{},r),o=n[e];return o||(o=n[e]=[]),o}a(ZKr,"_getRegisteredEvents");function XKr(t,e,r,n){t&&e&&e[fL]&&(t[HKr]?t[HKr](e[fL],r,n):t[jKr]&&t[jKr](VKr+e[fL],r))}a(XKr,"_doDetach");function pAo(t,e,r,n){var o=!1;return t&&e&&e[fL]&&r&&(t[qKr]?(t[qKr](e[fL],r,n),o=!0):t[QKr]&&(t[QKr](VKr+e[fL],r),o=!0)),o}a(pAo,"_doAttach");function $Kr(t,e,r,n){for(var o=e[Cn];o--;){var s=e[o];s&&(!r.ns||r.ns===s[_Dt].ns)&&(!n||n(s))&&(XKr(t,s[_Dt],s.handler,s.capture),e[zI](o,1))}}a($Kr,"_doUnregister");function hAo(t,e,r){if(e[fL])$Kr(t,ZKr(t,e[fL]),e,r);else{var n=L7e.get(t,nNt,{});zr(n,function(o,s){$Kr(t,s,e,r)}),Fu(n)[Cn]===0&&L7e.kill(t,nNt)}}a(hAo,"_unregisterEvents");function GU(t,e){var r;return e?(lr(e)?r=[t].concat(e):r=[t,e],r=iNt("xx",r).ns[dL](".")):r=t,r}a(GU,"mergeEvtNamespace");function abe(t,e,r,n,o){o===void 0&&(o=!1);var s=!1;if(t)try{var c=iNt(e,n);if(s=pAo(t,c,r,o),s&&L7e.accept(t)){var l={guid:dAo++,evtName:c,handler:r,capture:o};ZKr(t,c.type)[ro](l)}}catch{}return s}a(abe,"eventOn");function cbe(t,e,r,n,o){if(o===void 0&&(o=!1),t)try{var s=iNt(e,n),c=!1;hAo(t,s,function(l){return s.ns&&!r||l.handler===r?(c=!0,!0):!1}),c||XKr(t,s,r,o)}catch{}}a(cbe,"eventOff");function oNt(t,e,r){var n=!1,o=tf();o&&(n=abe(o,t,e,r),n=abe(o.body,t,e,r)||n);var s=ef();return s&&(n=abe(s,t,e,r)||n),n}a(oNt,"addEventHandler");function sNt(t,e,r){var n=tf();n&&(cbe(n,t,e,r),cbe(n.body,t,e,r));var o=ef();o&&cbe(o,t,e,r)}a(sNt,"removeEventHandler");function Tse(t,e,r,n){var o=!1;return e&&t&&t[Cn]>0&&Ct(t,function(s){s&&(!r||Qo(r,s)===-1)&&(o=oNt(s,e,n)||o)}),o}a(Tse,"_addEventListeners");function aNt(t,e,r,n){var o=!1;return e&&t&&lr(t)&&(o=Tse(t,e,r,n),!o&&r&&r[Cn]>0&&(o=Tse(t,e,null,n))),o}a(aNt,"addEventListeners");function XW(t,e,r){t&&lr(t)&&Ct(t,function(n){n&&sNt(n,e,r)})}a(XW,"removeEventListeners");function U7e(t,e,r){return aNt([YKr,zKr,F7e],t,e,r)}a(U7e,"addPageUnloadEventListener");function Q7e(t,e){XW([YKr,zKr,F7e],t,e)}a(Q7e,"removePageUnloadEventListener");function ube(t,e,r){function n(c){var l=ef();t&&l&&l.visibilityState==="hidden"&&t(c)}a(n,"_handlePageVisibility");var o=GU(KKr,r),s=Tse([F7e],t,e,o);return(!e||Qo(e,lbe)===-1)&&(s=Tse([lbe],n,e,o)||s),!s&&e&&(s=ube(t,null,r)),s}a(ube,"addPageHideEventListener");function q7e(t,e){var r=GU(KKr,e);XW([F7e],t,r),XW([lbe],null,r)}a(q7e,"removePageHideEventListener");function dbe(t,e,r){function n(c){var l=ef();t&&l&&l.visibilityState==="visible"&&t(c)}a(n,"_handlePageVisibility");var o=GU(JKr,r),s=Tse([WKr],t,e,o);return s=Tse([lbe],n,e,o)||s,!s&&e&&(s=dbe(t,null,r)),s}a(dbe,"addPageShowEventListener");function j7e(t,e){var r=GU(JKr,e);XW([WKr],t,r),XW([lbe],null,r)}a(j7e,"removePageShowEventListener");p();var Ise="",eJr="https://browser.events.data.microsoft.com/OneCollector/1.0/",cNt="version",H7e="properties";p();p();var lNt="initialize",uNt="indexOf",tM="timings",dNt="pollInternalLogs",G1="value",G7e="length",$7e="processTelemetryStart";var gL,tJr="4.3.10",fbe="1DS-Web-JS-"+tJr,rJr=Wve.hasOwnProperty;var SAo=(gL={},gL[0]=0,gL[2]=6,gL[1]=1,gL[3]=7,gL[4098]=6,gL[4097]=1,gL[4099]=7,gL);var TAo=jB(),IAo=goe();function ZI(t){return!(t===Ise||Zt(t))}a(ZI,"isValueAssigned");function fNt(t){if(t){var e=eu(t,"-");if(e>-1)return RN(t,e)}return Ise}a(fNt,"getTenantId");function pNt(t){return!!(t&&Ch(t)&&t>=1&&t<=4)}a(pNt,"isLatency");function hNt(t,e,r){if(!e&&!ZI(e)||typeof t!="string")return null;var n=typeof e;if(n==="string"||n==="number"||n==="boolean"||lr(e))e={value:e};else if(n==="object"&&!rJr.call(e,"value"))e={value:r?JSON.stringify(e):e};else if(Zt(e[G1])||e[G1]===Ise||!Ai(e[G1])&&!Ch(e[G1])&&!EP(e[G1])&&!lr(e[G1]))return null;if(lr(e[G1])&&!iJr(e[G1]))return null;if(!Zt(e.kind)){if(lr(e[G1])||!nJr(e.kind))return null;e[G1]=e[G1].toString()}return e}a(hNt,"sanitizeProperty");function pbe(t,e,r){var n=-1;if(!Dn(t))if(e>0&&(e===32?n=8192:e<=13&&(n=e<<5)),xAo(r))n===-1&&(n=0),n|=r;else{var o=SAo[V7e(t)]||-1;n!==-1&&o!==-1?n|=o:o===6&&(n=o)}return n}a(pbe,"getCommonSchemaMetaData");function xse(t,e,r,n,o){var s={},c=!1,l=0,u=arguments[G7e],d=arguments;for(EP(d[0])&&(c=d[0],l++);l0&&t<=13||t===32}a(nJr,"isValueKind");function xAo(t){return t>=0&&t<=9}a(xAo,"isDataType");function iJr(t){return t[G7e]>0}a(iJr,"isArrayValid");function W7e(t,e){var r=t;r[tM]=r[tM]||{},r[tM][$7e]=r[tM][$7e]||{},r[tM][$7e][e]=$1()}a(W7e,"setProcessTelemetryTimings");function V7e(t){var e=0;if(t!=null){var r=typeof t;r==="string"?e=1:r==="number"?e=2:r==="boolean"?e=3:r===qI&&(e=4,lr(t)?(e=4096,t[G7e]>0&&(e|=V7e(t[0]))):rJr.call(t,"value")&&(e=8192|V7e(t[G1])))}return e}a(V7e,"getFieldValueType");function mNt(){return!!Ri("chrome")}a(mNt,"isChromium");function ez(t){return t>0}a(ez,"isGreaterThanZero");var wAo=i_({endpointUrl:eJr,propertyStorageOverride:{isVal:RAo}});function RAo(t){return t&&(!t.getProperty||!t.setProperty)&&Wc("Invalid property storage override passed."),!0}a(RAo,"_chkPropOverride");var gNt=(function(t){Py(e,t);function e(){var r=t.call(this)||this;return bi(e,r,function(n,o){n[lNt]=function(s,c,l,u){Mp(n,function(){return"AppInsightsCore.initialize"},function(){try{o[lNt](Np(s,wAo,l||n.logger,!1).cfg,c,l,u)}catch(h){var d=n.logger,f=ur(h);f[uNt]("channels")!==-1&&(f+=` + - Channels must be provided through config.channels only!`),Ta(d,1,514,"SDK Initialization Failed - no telemetry will be sent: "+f)}},function(){return{config:s,extensions:c,logger:l,notificationManager:u}})},n.track=function(s){Mp(n,function(){return"AppInsightsCore.track"},function(){var c=s;if(c){c[tM]=c[tM]||{},c[tM].trackStart=$1(),pNt(c.latency)||(c.latency=1);var l=c.ext=c.ext||{};l.sdk=l.sdk||{},l.sdk.ver=fbe;var u=c.baseData=c.baseData||{};u[H7e]=u[H7e]||{};var d=u[H7e];d[cNt]=d[cNt]||n.pluginVersionString||Ise}o.track(c)},function(){return{item:s}},!s.sync)},n[dNt]=function(s){return o[dNt](s||"InternalLog")}}),r}return a(e,"AppInsightsCore"),e.__ieDyn=1,e})(O7e);p();p();var hbe="REAL_TIME",oJr="NEAR_REAL_TIME",sJr="BEST_EFFORT";p();p();p();var OP="";var z7e="drop",aJr="send",ANt="requeue",cJr="rspFail",lJr="oth",yNt="no-cache, no-store",Y7e="application/x-json-stream",mbe="cache-control",wse="content-type",uJr="kill-tokens",dJr="kill-duration";var fJr="time-delta-millis",K7e="client-version",ENt="client-id",J7e="time-delta-to-apply-millis",Z7e="upload-time",X7e="apikey",gbe="AuthMsaDeviceTicket",_Nt="WebAuthToken",vNt="AuthXToken";var pJr="NoResponseBody",Rse="msfpc",CNt="trace",eQe="user";p();var Abe="allowRequestSending",tQe="shouldAddClockSkewHeaders",rQe="getClockSkewHeaderValue",ybe="setClockSkew",qo="length",rM="concat",V1="iKey",jf="count",nM="events",q0="push",iM="split",nQe="toLowerCase",tz="hdrs",iQe="useHdrs",rz="initialize",oQe="setTimeoutOverride",sQe="clearTimeoutOverride",hJr="payloadPreprocessor",bNt="overrideEndpointUrl",SNt="avoidOptions",mJr="disableEventTimings",aQe="enableCompoundKey",TNt="disableXhrSync",INt="disableFetchKeepAlive",gJr="addNoResponse",xNt="useSendBeacon",wNt="fetchCredentials",RNt="alwaysUseXhrOverride",cQe="serializeOfflineEvt",lQe="getOfflineRequestDetails",uQe="createPayload",Ebe="createOneDSPayload",PNt="payloadBlob",BP="headers",Pse="_thePayload",My="batches",oC="sendType",_be="canSendRequest",kse="sendQueuedRequests",vbe="setUnloading",AJr="isTenantKilled",dQe="sendSynchronousBatch",fQe="_transport",Dse="getWParam",kNt="isBeacon",Cbe="timings",pQe="isTeardown",hQe="_sendReason",mQe="setKillSwitchTenants",gQe="_backOffTransmission",bbe="identifier",yJr="ignoreMc1Ms0CookieProcessing",DNt="autoFlushEventsLimit",EJr="disableAutoBatchFlushLimit",_Jr="overrideInstrumentationKey",Sbe="sendAttempt",$U="latency",nz="sync";function CJr(t){var e=(t.ext||{}).intweb;return e&&ZI(e[Rse])?e[Rse]:null}a(CJr,"_getEventMsfpc");function vJr(t){for(var e=null,r=0;e===null&&rfl()?!0:(delete s[c],!1)}})}return a(t,"KillSwitch"),t.__ieDyn=1,t})();p();var kAo=.8,DAo=1.2,TJr=3e3,NAo=6e5;function IJr(t){return!(t>=300&&t<500&&t!=429||t==501||t==505)}a(IJr,"retryPolicyShouldRetryForStatus");function AQe(t){var e=0,r=TJr*kAo,n=TJr*DAo,o=R1(Math.random()*(n-r))+r;return e=Math.pow(2,t)*o,K9(e,NAo)}a(AQe,"retryPolicyGetMillisToBackoffForRetry");p();var MAo=20,OAo=3145728,wJr=65e3,RJr=2e6,BAo=K9(RJr,wJr),xJr="metadata",yQe="f",LAo=/\./,PJr=(function(){function t(e,r,n,o,s,c,l){var u="data",d="baseData",f="ext",h=!!o,m=!0,g=r,A={},y=!!c,E=s||pbe,_=FAo(l),v=EQe(_.requestLimit,OAo,0),b=EQe(_.requestLimit,wJr,1),T=EQe(_.recordLimit,RJr,0),w=Math.min(EQe(_.recordLimit,BAo,1),b);bi(t,this,function(R){R.createPayload=function(D,N,B,L,j,M){return{apiKeys:[],payloadBlob:OP,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:D,isTeardown:N,isSync:B,isBeacon:L,sendType:M,sendReason:j}},R.appendPayload=function(D,N,B){var L=D&&N&&!D.overflow;return L&&Mp(e,function(){return"Serializer:appendPayload"},function(){for(var j=N.events(),M=D.payloadBlob,O=D.numEvents,q=!1,Q=[],U=[],z=D.isBeacon,W=z?b:v,$=z?w:T,J=0,ne=0;J=B){D.overflow=N.split(J);break}var re=R.getEventBlob(H);if(re&&re.length<=$){var ae=re.length,Oe=M.length;if(Oe+ae>W){D.overflow=N.split(J);break}M&&(M+=` +`),M+=re,ne++,ne>MAo&&(M9e(M,0,1),ne=0),q=!0,O++}else re?Q.push(H):U.push(H),j.splice(J,1),J--}J++}if(Q.length>0&&D.sizeExceed.push(VU.create(N.iKey(),Q)),U.length>0&&D.failedEvts.push(VU.create(N.iKey(),U)),q){D.batches.push(N),D.payloadBlob=M,D.numEvents=O;var ve=N.iKey();Qo(D.apiKeys,ve)===-1&&D.apiKeys.push(ve)}},function(){return{payload:D,theBatch:{iKey:N.iKey(),evts:N.events()},max:B}}),L},R.getEventBlob=function(D){try{return Mp(e,function(){return"Serializer.getEventBlob"},function(){var N={};N.name=D.name,N.time=D.time,N.ver=D.ver,N.iKey="o:"+fNt(D.iKey);var B={},L;y||(L=a(function(q,Q,U){UAo(E,B,q,Q,U)},"_addMetadataCallback"));var j=D[f];j&&(N[f]=B,zr(j,function(q,Q){var U=B[q]={};P(Q,U,"ext."+q,!0,null,null,!0)}));var M=N[u]={};M.baseType=D.baseType;var O=M[d]={};return P(D.baseData,O,d,!1,[d],L,m),P(D.data,M,u,!1,[],L,m),JSON.stringify(N)},function(){return{item:D}})}catch{return null}};function x(D,N){var B=A[D];return B===void 0&&(D.length>=7&&(B=yoe(D,"ext.metadata")||yoe(D,"ext.web")),A[D]=B),B}a(x,"_isReservedField");function P(D,N,B,L,j,M,O){zr(D,function(q,Q){var U=null;if(Q||ZI(Q)){var z=B,W=q,$=j,J=N;if(h&&!L&&LAo.test(q)){var ne=q.split("."),H=ne.length;if(H>1){$&&($=$.slice());for(var re=0;re0&&n<=e)return n}return e}a(EQe,"_validateSizeLimit");function FAo(t){var e={};return t&&t.requestLimit?t.requestLimit:e}a(FAo,"_getSizeLimtCfg");function UAo(t,e,r,n,o){if(o&&e){var s=t(o.value,o.kind,o.propertyType);if(s>-1){var c=e[xJr];c||(c=e[xJr]={f:{}});var l=c[yQe];if(l||(l=c[yQe]={}),r)for(var u=0;u0)for(var o=e[nQe](),s=0;s0&&(n&&MNt[e]?(t[tz][MNt[e]]=r,t[iQe]=!0):t.url+="&"+e+"="+r)}a(Mse,"_addRequestDetails");function HAo(t,e,r){for(var n=0;n=0&&Q.splice(Se,1)},"rm")}},H[cQe]=function(de){try{if(b)return b.getEventBlob(de)}catch{}return OP},H[lQe]=function(){try{var de=b&&b[uQe](0,!1,!1,!1,1,0);return we(de,x)}catch{}return null},H[Ebe]=function(de,Se){try{var Le=[];Ct(de,function(se){Se&&(se=KN(se));var he=VU.create(se[V1],[se]);Le[q0](he)});for(var te=null;Le[qo]>0&&b;){var Te=Le.shift();Te&&Te[jf]()>0&&(te=te||b[uQe](0,!1,!1,!1,1,0),b.appendPayload(te,Te,ne))}var Ge=we(te,x),Y={data:te[PNt],urlString:Ge.url,headers:Ge[tz],timeout:P,disableXhrSync:N,disableFetchKeepAlive:B};return x&&(_Qe(Y[BP],mbe)||(Y[BP][mbe]=yNt),_Qe(Y[BP],wse)||(Y[BP][wse]=Y7e)),Y}catch{}return null};function ae(de,Se){try{return $&&$.getSenderInst(de,Se)}catch{}return null}a(ae,"_getSenderInterface"),H._getDbgPlgTargets=function(){return[g[0],c,b,g,Oe(),s,ne]};function Oe(){try{var de={xdrOnComplete:ve,fetchOnComplete:Pe,xhrOnComplete:Z,beaconOnRetry:K},Se={enableSendPromise:!1,isOneDs:!0,disableCredentials:!re,fetchCredentials:J,disableXhr:!1,disableBeacon:!d,disableBeaconSync:!d,disableFetchKeepAlive:B,timeWrapper:z,addNoResponse:j,senderOnCompleteCallBack:de};return Se}catch{}return null}a(Oe,"_getSendPostMgrConfig");function ve(de,Se,Le){var te=JN(de);ee(Se,200,{},te),F(te)}a(ve,"_xdrOncomplete");function Fe(){var de;s=null,c=new SJr,l=!1,u=new bJr,d=!1,f=0,h=null,m=null,g=null,A=null,y=!0,E=[],_={},v=[],b=null,T=!1,w=null,R=!1,x=!1,P=de,N=de,B=de,L=de,j=de,M=[],O=de,q=de,Q=[],U=!1,z=Nse(),W=!1,$=null,ne=null}a(Fe,"_initDefaults");function Pe(de,Se,Le,te){var Te=a(function(se,he,Ce){ee(Se,se,he,Ce),F(Ce)},"handleResponse"),Ge={},Y=de[BP];Y&&Y.forEach(function(se,he){Ge[he]=se}),Te(de.status,Ge,Le||OP)}a(Pe,"_fetchOnComplete");function Z(de,Se,Le){var te=JN(de);ee(Se,de.status,FU(de,!0),te),F(te)}a(Z,"_xhrOnComplete");function ee(de,Se,Le,te){try{de(Se,Le,te)}catch(Te){Ta(m,2,518,ur(Te))}}a(ee,"_doOnComplete");function K(de,Se,Le){var te=de,Te=200,Ge=te[Pse],Y=de.urlString+(j?QAo:OP);try{var se=Uu();if(Ge){var he=!!A.getPlugin("LocalStorage"),Ce=[],He=[];Ct(Ge[My],function($e){if(Ce&&$e&&$e[jf]()>0)for(var Xe=$e[nM](),ct=0;ct0&&(Ge.sentEvts=He),he||be(Ce,8003,Ge[oC],!0)}else Te=0}catch($e){XN(m,"Failed to send telemetry using sendBeacon API. Ex:"+ur($e)),Te=0}finally{ee(Se,Te,{},OP)}}a(K,"_onBeaconRetry");function pe(de){return de===2||de===3}a(pe,"_isBeaconPayload");function X(de){return R&&pe(de)&&(de=2),de}a(X,"_adjustSendType"),H.addHeader=function(de,Se){_[de]=Se},H.removeHeader=function(de){delete _[de]},H[_be]=function(){return ue()&&u[Abe]()},H[kse]=function(de,Se){Dn(de)&&(de=0),R&&(de=X(de),Se=2),ie(v,de,0)&&Ne(qe(),0,!1,de,Se||0)},H.isCompletelyIdle=function(){return!l&&f===0&&v[qo]===0},H[vbe]=function(de){R=de},H.addBatch=function(de){if(de&&de[jf]()>0){if(c.isTenantKilled(de[V1]()))return!1;v[q0](de)}return!0},H.teardown=function(){v[qo]>0&&Ne(qe(),0,!0,2,2),Ct(M,function(de){de&&de.rm&&de.rm()}),M=[]},H.pause=function(){l=!0},H.resume=function(){l=!1,H[kse](0,4)},H[dQe]=function(de,Se,Le){de&&de[jf]()>0&&(Zt(Se)&&(Se=1),R&&(Se=X(Se),Le=2),Ne([de],0,!1,Se,Le||0))};function ue(){return!l&&f0&&!l&&g[Se]&&b&&(te=Se!==0||ue()&&(Le>0||u[Abe]())),te}a(ie,"_canSendPayload");function le(de){var Se={};return de&&Ct(de,function(Le,te){Se[te]={iKey:Le[V1](),evts:Le[nM]()}}),Se}a(le,"_createDebugBatches");function Ne(de,Se,Le,te,Te){if(!(!de||de[qo]===0)){if(l){be(de,1,te);return}te=X(te);try{var Ge=de,Y=te!==0;Mp(A,function(){return"HttpManager:_sendBatches"},function(se){se&&(de=de.slice(0));for(var he=[],Ce=null,He=$1(),$e=g[te]||(Y?g[1]:g[0]),Xe=$e&&$e[fQe],ct=L&&(R||pe(te)||Xe===3||$e._isSync&&Xe===2);ie(de,te,Se);){var bt=de.shift();bt&&bt[jf]()>0&&(c.isTenantKilled(bt[V1]())?he[q0](bt):(Ce=Ce||b[uQe](Se,Le,Y,ct,Te,te),b.appendPayload(Ce,bt,ne)?Ce.overflow!==null&&(de=[Ce.overflow][rM](de),Ce.overflow=null,tt(Ce,He,$1(),Te),He=$1(),Ce=null):(tt(Ce,He,$1(),Te),He=$1(),de=[bt][rM](de),Ce=null)))}Ce&&tt(Ce,He,$1(),Te),de[qo]>0&&(v=de[rM](v)),be(he,8004,te)},function(){return{batches:le(Ge),retryCount:Se,isTeardown:Le,isSynchronous:Y,sendReason:Te,useSendBeacon:pe(te),sendType:te}},!Y)}catch(se){Ta(m,2,48,"Unexpected Exception sending batch: "+ur(se))}}}a(Ne,"_sendBatches");function we(de,Se){var Le={url:s,hdrs:{},useHdrs:!1};Se?(Le[tz]=xse(Le[tz],_),Le.useHdrs=Fu(Le.hdrs)[qo]>0):zr(_,function(se,he){ONt[se]?Mse(Le,ONt[se],he,!1):(Le[tz][se]=he,Le[iQe]=!0)}),Mse(Le,ENt,"NO_AUTH",Se),Mse(Le,K7e,fbe,Se);var te=OP;Ct(de.apiKeys,function(se){te[qo]>0&&(te+=","),te+=se}),Mse(Le,X7e,te,Se),Mse(Le,Z7e,fl().toString(),Se);var Te=Ie(de);if(ZI(Te)&&(Le.url+="&ext.intweb.msfpc="+Te),u[tQe]()&&Mse(Le,J7e,u[rQe](),Se),A[Dse]){var Ge=A[Dse]();Ge>=0&&(Le.url+="&w="+Ge)}for(var Y=0;Y0){var Te=!!O,Ge=g[de.sendType];!pe(de[oC])&&de[kNt]&&de.sendReason===2&&(Ge=g[2]||g[3]||Ge);var Y=x;(de.isBeacon||Ge[fQe]===3)&&(Y=!1);var se=we(de,Y);Y=Y||se[iQe];var he=$1();Mp(A,function(){return"HttpManager:_doPayloadSend"},function(){for(var Ce=0;Ce0?ct[NNt]++:ct[NNt]=1}be(de[My],1e3+(te||0),de[oC],!0);var ht={data:de[PNt],urlString:se.url,headers:se[tz],_thePayload:de,_sendReason:te,timeout:P,disableXhrSync:N,disableFetchKeepAlive:B};Y&&(_Qe(ht[BP],mbe)||(ht[BP][mbe]=yNt),_Qe(ht[BP],wse)||(ht[BP][wse]=Y7e));var We=null;Ge&&(We=a(function(ce){u.firstRequestSent();var Re=a(function(ge,oe){Et(ge,oe,de,te)},"onComplete"),Me=de[pQe]||de.isSync;$.preparePayload(function(ge){try{Ge.sendPOST(ge,Re,Me),q&&q(ht,ge,Me,de[kNt])}catch(oe){ee(Re,0,{}),XN(m,"Unexpected exception sending payload. Ex:"+ur(oe))}},D,ce,Me)},"sender")),Mp(A,function(){return"HttpManager:_doPayloadSend.sender"},function(){if(We)if(de[oC]===0&&f++,Te&&!de.isBeacon&&Ge[fQe]!==3){var ce={data:ht.data,urlString:ht.urlString,headers:xse({},ht[BP]),timeout:ht.timeout,disableXhrSync:ht[TNt],disableFetchKeepAlive:ht[INt]},Re=!1;Mp(A,function(){return"HttpManager:_doPayloadSend.sendHook"},function(){try{O(ce,function(Me){Re=!0,!y&&!Me[Pse]&&(Me[Pse]=Me[Pse]||ht[Pse],Me[hQe]=Me[hQe]||ht[hQe]),We(Me)},de.isSync||de[pQe])}catch{Re||We(ht)}})}else We(ht)})},function(){return{thePayload:de,serializationStart:Se,serializationCompleted:Le,sendReason:te}},de.isSync)}de.sizeExceed&&de.sizeExceed[qo]>0&&be(de.sizeExceed,8003,de[oC]),de.failedEvts&&de.failedEvts[qo]>0&&be(de.failedEvts,8002,de[oC])}a(tt,"_doPayloadSend");function st(de,Se){T&&Ct(de,function(Le){var te=Le[Cbe]=Le[Cbe]||{};Be(te,"sendEventCompleted",Se)})}a(st,"_addEventCompletedTimings");function Et(de,Se,Le,te){var Te=9e3,Ge=null,Y=!1,se=!1;try{var he=!0;if(typeof de!==M1){if(Se){u[ybe](Se[fJr]);var Ce=Se[dJr]||Se["kill-duration-seconds"];Ct(c[mQe](Se[uJr],Ce),function($e){Ct(Le[My],function(Xe){if(Xe[V1]()===$e){Ge=Ge||[];var ct=Xe[iM](0);Le.numEvents-=ct[jf](),Ge[q0](ct)}})})}if(de==200||de==204){Te=200;return}(!IJr(de)||Le.numEvents<=0)&&(he=!1),Te=9e3+de%1e3}if(he){Te=100;var He=Le.retryCnt;Le[oC]===0&&(He0&&st(Le[nM](),Se)})}}a(Gt,"_addCompleteTimings");function jt(de,Se,Le){Se?de():z.set(de,Le)}a(jt,"_doAction");function Ie(de){for(var Se=0;Se0&&o){var Te=o[Ue(Se)];if(Te){var Ge=Le!==0;Mp(A,function(){return"HttpManager:_sendBatchesNotification"},function(){jt(function(){try{Te.call(o,de,Se,Ge,Le)}catch(Y){Ta(m,1,74,"send request notification failed: "+Y)}},te||Ge,0)},function(){return{batches:le(de),reason:Se,isSync:Ge,sendSync:te,sendType:Le}},!Ge)}}}a(be,"_sendBatchesNotification");function Ue(de){var Se=jAo[de];return ZI(Se)||(Se=lJr,de>=9e3&&de<=9999?Se=cJr:de>=8e3&&de<=8999?Se=z7e:de>=1e3&&de<=1999&&(Se=aJr)),Se}a(Ue,"_getNotificationAction")})}return a(t,"HttpManager"),t.__ieDyn=1,t})();var $Ao=.25,MJr=500,VAo=20,OJr=6,BJr=2,WAo=4,DJr=2,zAo=1,BNt=1e4,sz="eventsDiscarded",NJr="",wh=void 0,YAo=i_({eventsLimitInMem:{isVal:ez,v:BNt},immediateEventLimit:{isVal:ez,v:500},autoFlushEventsLimit:{isVal:ez,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:KAo,v:wh},overrideInstrumentationKey:wh,overrideEndpointUrl:wh,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:wh,clearTimeoutOverride:wh,payloadPreprocessor:wh,payloadListener:wh,disableEventTimings:wh,valueSanitizer:wh,stringifyObjects:wh,enableCompoundKey:wh,disableOptimizeObj:!1,fetchCredentials:wh,transports:wh,unloadTransports:wh,useSendBeacon:wh,disableFetchKeepAlive:wh,avoidOptions:!1,xhrTimeout:wh,disableXhrSync:wh,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:Ch,v:OJr},maxUnloadEventRetryAttempts:{isVal:Ch,v:BJr},addNoResponse:wh,maxEvtPerBatch:{isVal:Ch,v:MJr},excludeCsMetaData:wh,requestLimit:{}});function KAo(t){return t&&t.sendPOST}a(KAo,"isOverrideFn");var LNt=(function(t){Py(e,t);function e(){var r=t.call(this)||this;r.identifier="PostChannel",r.priority=1011,r.version="4.3.10";var n,o=!1,s=[],c,l=!1,u=0,d,f=0,h,m={},g=hbe,A,y,E,_,v,b,T,w,R,x,P,D,N,B,L,j,M,O,q,Q,U,z,W;return bi(e,r,function($,J){pe(),$._getDbgPlgTargets=function(){return[v,n]},$[rz]=function(Y,se,he){Mp(se,function(){return"PostChannel:initialize"},function(){J[rz](Y,se,he),q=se.getNotifyMgr();try{L=GU(KI($[bbe]),se.evtNamespace&&se.evtNamespace()),$._addHook(H1(Y,function(Ce){var He=Ce.cfg,$e=JI(null,He,se);n=$e.getExtCfg($[bbe],YAo),j=Nse(n[oQe],n[sQe]),P=!n.disableOptimizeObj&&mNt(),M=n[yJr],H(se),h=n.eventsLimitInMem,d=n.immediateEventLimit,T=n[DNt],N=n.maxEventRetryAttempts,B=n.maxUnloadEventRetryAttempts,O=n[EJr],W=n.maxEvtPerBatch,Um(He.endpointUrl)?$.pause():l&&$.resume(),Ge(),U=n[_Jr],z=!!n.disableTelemetry,Q&&ne();var Xe=He.disablePageUnloadEvents||[];Q=U7e(Oe,Xe,L),Q=ube(Oe,Xe,L)||Q,Q=dbe(ve,He.disablePageShowEvents,L)||Q})),v[rz](Y,$.core,$)}catch(Ce){throw $.setInitialized(!1),Ce}},function(){return{theConfig:Y,core:se,extensions:he}})},$.processTelemetry=function(Y,se){W7e(Y,$[bbe]),se=se||$._getTelCtx(se);var he=Y;!z&&!o&&(U&&(he[V1]=U),Pe(he,!0),D?qe(2,2):K()),$.processNext(he,se)},$.getOfflineSupport=function(){try{var Y=v&&v[lQe]();if(v)return{getUrl:a(function(){return Y?Y.url:null},"getUrl"),serialize:ae,batch:re,shouldProcess:a(function(se){return!z},"shouldProcess"),createPayload:a(function(se){return null},"createPayload"),createOneDSPayload:a(function(se){if(v[Ebe])return v[Ebe](se,P)},"createOneDSPayload")}}catch{}return null},$._doTeardown=function(Y,se){qe(2,2),o=!0,v.teardown(),ne(),pe()};function ne(){Q7e(null,L),q7e(null,L),j7e(null,L)}a(ne,"_removeUnloadHandlers");function H(Y){var se=Y[Dse];Y[Dse]=function(){var he=0;return M&&(he=he|2),he|se.call(Y)}}a(H,"_hookWParam");function re(Y){var se=NJr;return Y&&Y[qo]&&Ct(Y,function(he){se&&(se+=` +`),se+=he}),se}a(re,"_batch");function ae(Y){var se=NJr;try{Fe(Y),se=v[cQe](Y)}catch{}return se}a(ae,"_serialize");function Oe(Y){var se=Y||tf().event;se.type!=="beforeunload"&&(D=!0,v[vbe](D)),qe(2,2)}a(Oe,"_handleUnloadEvents");function ve(Y){D=!1,v[vbe](D)}a(ve,"_handleShowEvents");function Fe(Y){Y.ext&&Y.ext[CNt]&&delete Y.ext[CNt],Y.ext&&Y.ext[eQe]&&Y.ext[eQe].id&&delete Y.ext[eQe].id,P&&(Y.ext=KN(Y.ext),Y.baseData&&(Y.baseData=KN(Y.baseData)),Y.data&&(Y.data=KN(Y.data)))}a(Fe,"_cleanEvent");function Pe(Y,se){if(Y[Sbe]||(Y[Sbe]=0),Y[$U]||(Y[$U]=1),Fe(Y),Y[nz]){if(E||l)Y[$U]=3,Y[nz]=!1;else if(v){P&&(Y=KN(Y)),v[dQe](VU.create(Y[V1],[Y]),Y[nz]===!0?1:Y[nz],3);return}}var he=Y[$U],Ce=f,He=h;he===4&&(Ce=u,He=d);var $e=!1;if(CeY;if(!he&&w>0)for(var Ce=1;!he&&Ce<=3;Ce++){var He=b[Ce];He&&He[My]&&Ct(He[My],function($e){$e&&$e[jf]()>=w&&(he=!0)})}Ne(!0,he)},$.pause=function(){ue(),l=!0,v&&v.pause()},$.resume=function(){l=!1,v&&v.resume(),K()},$._loadTransmitProfiles=function(Y){Gt(),zr(Y,function(se,he){var Ce=he[qo];if(Ce>=2){var He=Ce>2?he[2]:0;if(he.splice(0,Ce-2),he[1]<0&&(he[0]=-1),he[1]>0&&he[0]>0){var $e=he[0]/he[1];he[0]=bWr($e)*he[1]}He>=0&&he[1]>=0&&He>he[1]&&(He=he[1]),he[q0](He),m[se]=he}})},$.flush=function(Y,se,he){Y===void 0&&(Y=!0);var Ce;if(!l)if(he=he||1,Y)se||(Ce=Td(function($e){se=$e})),c==null?(ue(),st(1,0,he),c=X(function(){c=null,Et(se,he)},0)):s[q0](se);else{var He=ue();Z(1,1,he),se&&se(),He&&K()}return Ce},$.setMsaAuthTicket=function(Y){v.addHeader(gbe,Y)},$.setAuthPluginHeader=function(Y){v.addHeader(_Nt,Y)},$.removeAuthPluginHeader=function(){v.removeHeader(_Nt)},$.hasEvents=ee,$._setTransmitProfile=function(Y){g!==Y&&m[Y]!==void 0&&(ue(),g=Y,K())},LU($,function(){return v},["addResponseHandler"]);function Z(Y,se,he){var Ce=st(Y,se,he);return v[kse](se,he),Ce}a(Z,"_sendEventsForLatencyAndAbove");function ee(){return f>0}a(ee,"_hasEvents");function K(){if(R>=0&&st(R,0,x)&&v[kse](0,x),u>0&&!y&&!l){var Y=m[g][2];Y>=0&&(y=X(function(){y=null,Z(4,0,1),K()},Y))}var se=m[g][1];!A&&!c&&se>=0&&!l&&(ee()?A=X(function(){A=null,Z(_===0?3:1,0,1),_++,_%=2,K()},se):_=0)}a(K,"_scheduleTimer"),$[gQe]=function(){E0&&f>T&&(se=!0),se&&c==null&&$.flush(Y,function(){},20))}a(Ne,"_performAutoFlush");function we(Y,se){P&&(Y=KN(Y));var he=Y[$U],Ce=le(Y[V1],he,!0);return Ce.addEvent(Y)?(he!==4?(f++,se&&Y[Sbe]===0&&Ne(!Y.sync,w>0&&Ce[jf]()>=w)):u++,!0):!1}a(we,"_addEventToProperQueue");function Be(Y,se,he,Ce){for(;he<=se;){var He=le(Y,se,!0);if(He&&He[jf]()>0){var $e=He[iM](0,Ce),Xe=$e[jf]();if(Xe>0)return he===4?u-=Xe:f-=Xe,Ue(sz,[$e],HN.QueueFull),!0}he++}return tt(),!1}a(Be,"_dropEventWithLatencyOrLess");function tt(){for(var Y=0,se=0,he=a(function(He){var $e=b[He];$e&&$e[My]&&Ct($e[My],function(Xe){He===4?Y+=Xe[jf]():se+=Xe[jf]()})},"_loop_1"),Ce=1;Ce<=4;Ce++)he(Ce);f=se,u=Y}a(tt,"_resetQueueCounts");function st(Y,se,he){var Ce=!1,He=se===0;return!He||v[_be]()?Mp($.core,function(){return"PostChannel._queueBatches"},function(){for(var $e=[],Xe=4;Xe>=Y;){var ct=b[Xe];ct&&ct.batches&&ct.batches[qo]>0&&(Ct(ct[My],function(bt){v.addBatch(bt)?Ce=Ce||bt&&bt[jf]()>0:$e=$e[rM](bt[nM]()),Xe===4?u-=bt[jf]():f-=bt[jf]()}),ct[My]=[],ct.iKeyMap={}),Xe--}$e[qo]>0&&be(sz,$e,HN.KillSwitch),Ce&&R>=Y&&(R=-1,x=0)},function(){return{latency:Y,sendType:se,sendReason:he}},!He):(R=R>=0?K9(R,Y):Y,x=_P(x,he)),Ce}a(st,"_queueBatches");function Et(Y,se){Z(1,0,se),tt(),kt(function(){Y&&Y(),s[qo]>0?c=X(function(){c=null,Et(s.shift(),se)},0):(c=null,K())})}a(Et,"_flushImpl");function kt(Y){v.isCompletelyIdle()?Y():c=X(function(){c=null,kt(Y)},$Ao)}a(kt,"_waitForIdleManager");function Gt(){ue(),jt(),g=hbe,K()}a(Gt,"_resetTransmitProfiles");function jt(){m={},m[hbe]=[2,1,0],m[oJr]=[6,3,0],m[sJr]=[18,9,0]}a(jt,"_initializeProfiles");function Ie(Y,se){var he=[],Ce=N;D&&(Ce=B),Ct(Y,function(He){He&&He[jf]()>0&&Ct(He[nM](),function($e){$e&&($e[nz]&&($e[$U]=4,$e[nz]=!1),$e[Sbe]0&&be(sz,he,HN.NonRetryableStatus),D&&qe(2,2)}a(Ie,"_requeueEvents");function F(Y,se){var he=q||{},Ce=he[Y];if(Ce)try{Ce.apply(he,se)}catch(He){Ta($.diagLog(),1,74,Y+" notification failed: "+He)}}a(F,"_callNotification");function be(Y,se){for(var he=[],Ce=2;Ce0&&F(Y,[se][rM](he))}a(be,"_notifyEvents");function Ue(Y,se){for(var he=[],Ce=2;Ce0&&Ct(se,function(He){He&&He[jf]()>0&&F(Y,[He.events()][rM](he))})}a(Ue,"_notifyBatchEvents");function de(Y,se,he){Y&&Y[qo]>0&&F("eventsSendRequest",[se>=1e3&&se<=1999?se-1e3:0,he!==!0])}a(de,"_sendingEvent");function Se(Y,se){Ue("eventsSent",Y,se),K()}a(Se,"_eventsSentEvent");function Le(Y,se){Ue(sz,Y,se>=8e3&&se<=8999?se-8e3:HN.Unknown)}a(Le,"_eventsDropped");function te(Y){Ue(sz,Y,HN.NonRetryableStatus),K()}a(te,"_eventsResponseFail");function Te(Y,se){Ue(sz,Y,HN.Unknown),K()}a(Te,"_otherEvent");function Ge(){O?w=0:w=_P(W*(DJr+1),h/6)}a(Ge,"_setAutoLimits")}),r}return a(e,"PostChannel"),e.__ieDyn=1,e})(Sse);var W1=fe(require("os"));var vQe=class{constructor(e,r,n,o=!0,s){this.ctx=e;this.namespace=r;this.internalOnly=o;this.onCopilotToken=a(async e=>{this.token=e,this.commonProperties["common.isinternal"]=e?.isInternalUser()?"true":"false",await this.refreshGitHubHandleInCommonProperties();let r=e.getTokenValue("tid");r!==void 0&&(this.tags["ai.user.id"]=r)},"onCopilotToken");this.client=this.initializeClient(n),this.tags=JAo(e),this.commonProperties=ZAo(e),this.#e=ys(e,this.onCopilotToken),s&&this.onCopilotToken(s)}static{a(this,"Msft1dsReporter")}#e;initializeClient(e){try{let r=new gNt,n=new LNt,o={instrumentationKey:e,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[n]]},s={alwaysUseXhrOverride:!0,httpXHROverride:this.createXhrOverride()};return o.extensionConfig={},o.extensionConfig[n.identifier]=s,r.initialize(o,[]),r.addTelemetryInitializer(c=>{let l=c.ext??{},u=l.web??{};u.consentDetails='{"GPC_DataSharingOptIn":false}',l.web=u,c.ext=l,c.tags={...c.tags??{},...this.tags}}),r}catch(r){Dr.error(this.ctx,"Failed to initialize MSFT 1DS reporter",r)}}sendTelemetryEvent(e,r,n){if(!this.client||this.internalOnly&&!this.token?.isInternalUser())return;r={...r,...this.commonProperties};let o=this.qualifyEventName(e);try{this.client.track({name:o,baseData:{name:o,properties:r,measurements:n}})}catch(s){Dr.debug(this.ctx,"Error tracking telemetry event",s)}}sendTelemetryErrorEvent(e,r,n){this.sendTelemetryEvent(this.qualifyEventName(e),r,n)}async dispose(){this.#e.dispose(),await this.client?.unload(!0,void 0,200)}qualifyEventName(e){return e.startsWith(this.namespace)?e:`${this.namespace}/${e}`}async refreshGitHubHandleInCommonProperties(){try{let e=await this.ctx.get(Fr).resolveSession();e?.login?this.commonProperties["common.github_handle"]=e.login:delete this.commonProperties["common.github_handle"]}catch(e){Dr.debug(this.ctx,"Error resolving GitHub handle for telemetry",e)}}createXhrOverride(){return{sendPOST:a((e,r)=>{if(typeof e.data!="string")throw new Error(`Telemetry reporter only supports string payloads, received ${typeof e.data}`);let n=e.headers??{};n["Content-Type"]="application/json";let o={method:"POST",headers:n,body:e.data};this.ctx.get(cr).fetch(e.urlString,o).then(s=>s.text().then(c=>{r(s.status,Object.fromEntries(s.headers),c)})).catch(s=>{Dr.debug(this.ctx,"Error sending telemetry",s),r(0,{})})},"sendPOST")}}};function JAo(t){let e={},r=t.get(Oa);e["ai.session.id"]=r.sessionId;let n=t.get(Mf);return n.trackingId&&(e["ai.user.id"]=n.trackingId),e["ai.cloud.roleInstance"]="REDACTED",e["ai.device.osVersion"]=`${W1.type()} ${W1.release()}`,e["ai.device.osArchitecture"]=W1.arch(),e["ai.device.osPlatform"]=W1.platform(),e["ai.cloud.role"]="Web",e["ai.application.ver"]=t.get(os).getVersion(),e}a(JAo,"getTags");function ZAo(t){let e={};e.common_os=W1.platform(),e.common_platformversion=W1.release(),e.common_arch=W1.arch(),e.common_cpu=Array.from(new Set(W1.cpus().map(n=>n.model))).join();let r=t.get(Oa);return e.common_vscodemachineid=r.machineId,e.common_vscodesessionid=r.sessionId,e.client_deviceid=r.devDeviceId,e.common_uikind=r.uiKind,e.common_remotename=r.remoteName,e.common_isnewappinstall="",e}a(ZAo,"getCommonProperties");var XAo="7d7048df-6dd0-4048-bb23-b716c1461f8f",eyo="3fdd7f28-937a-48c8-9a21-ba337db23bd1",tyo="f0000000-0000-0000-0000-000000000000",ryo="b73649cf-ca8f-4768-9e0e-b789d8529db5",nyo="5fb6107a-6a29-423f-a824-22e3724fa2a6",iyo="ec712b3202c5462fb6877acae7f1f9d7-c19ad55e-3e3c-4f99-984b-827f6d95bd9e-6917";function oyo(t){return G9(t)==="prod"?ryo:nyo}a(oyo,"getMsftInstrumentationKey");function LJr(t){return new URL(t).hostname==="github.com"?XV.telemetry:t.replace("://","://copilot-telemetry-service.")}a(LJr,"getEndpointForServerUrl");var Hf=class{constructor(e,r){this.ctx=e;this.namespace=r;this.serverUrl="https://github.com/";this.rootUrl=LJr(this.serverUrl);this.shuttingDown=new Set;this.initListeners=[];ys(e,n=>{this.cachedToken=n,this.updateServiceEndpoints(n.endpoints)})}static{a(this,"TelemetryInitialization")}get endpointUrl(){return this.overrideEndpointUrlForTesting||new URL("telemetry",this.rootUrl).href}get isInitialized(){return this.initializedWith!==void 0}get isEnabled(){return this._enabled??!1}initialize(e){let r=this.ctx;this._enabled=e;let n=this.endpointUrl;if(!(this.initializedWith?.enabled===this._enabled&&this.initializedWith?.endpointUrl===this.endpointUrl)&&(this.shutdownWithoutWaiting(),this.initializedWith={endpointUrl:n,enabled:this._enabled},e)){let o=r.get(k0);if(o.setReporter(new jW(r,this.namespace,{instrumentationKey:XAo,endpointUrl:n})),o.setRestrictedReporter(new jW(r,this.namespace,{instrumentationKey:eyo,endpointUrl:n})),o.setFTReporter(new jW(r,this.namespace,{instrumentationKey:tyo,endpointUrl:n,includeAuthorizationHeader:!0})),o.setMsftReporter(new jW(r,`copilot/${this.namespace}`,{instrumentationKey:oyo(r),excludeCommonTags:!0,excludeCommonProperties:!0})),o.setMsft1pReporter(new vQe(r,"ThirdParty.copilot-chat",iyo,!0,this.cachedToken)),this.initListeners){let s=this.initListeners;this.initListeners=void 0;for(let c of s)try{c()}catch{}}}}onInitialized(e){if(this.initListeners)this.initListeners.push(e);else try{e()}catch{}}setCustomReporters(e,r){this.shutdownWithoutWaiting();let n=this.ctx.get(k0);n.setReporter(e),n.setRestrictedReporter(r)}async shutdown(){this.shutdownWithoutWaiting(),await Promise.all(this.shuttingDown)}shutdownWithoutWaiting(){this.initializedWith=void 0;let e=this.ctx.get(k0).deactivate().finally(()=>{this.shuttingDown.delete(e)});this.shuttingDown.add(e)}updateSessionConfig(e){e?.serverUrl&&e.serverUrl!==this.serverUrl&&(this.serverUrl=e.serverUrl,this.rootUrl=LJr(e.serverUrl)),this.isInitialized&&this.initialize(this._enabled)}updateServiceEndpoints(e){this.rootUrl=e.telemetry,this.isInitialized&&this.initialize(this._enabled)}};async function syo(t,e){let r="copilot_internal/subscribe_limited_user";try{return(await(await Lf(t,e,r,{method:"POST",headers:{"X-GitHub-Api-Version":"2025-05-01"},body:JSON.stringify({restricted_telemetry:t.get(Hf).isEnabled?"enabled":"disabled",public_code_suggestions:"enabled"})})).json()).subscribed}catch(n){return Zg.exception(t,n,"signUpLimited failed"),!1}}a(syo,"apiFetchSignUpLimited");async function UNt(t,e,r){let n=await t.get(Ut).getTokenResult();switch(n.failureKind){case void 0:return"OK";case"HTTP401":case"NotSignedIn":return"NotSignedIn";case"NotAuthorized":return r&&n.canSignUpForLimited&&await syo(t,e)?UNt(t,e,!1):"NotAuthorized";case"Exception":throw n.exception}}a(UNt,"getTokenWithSignUpLimited");p();p();var FJr=fe(ei());var no=class extends FJr.Emitter{static{a(this,"Emitter")}get event(){return super.event}};var ayo={didChangeFeatureFlags:!1,fetch:!1,ipCodeCitation:!1,redirectedTelemetry:!1,related:!1,token:!1,watchedFiles:!1,showPanelMessage:!1,mcpElicitation:!1,mcpSampling:!1,mcpAllowlist:!1,stateDatabase:!1,subAgent:!1,mcpServerManagement:!1,cveRemediatorAgent:!1,debuggerAgent:!1,contentProvider:[],manageTodoListTool:!1,agentDebugLog:!1,accountPickerEnabled:!1},On=class{constructor(){this.capabilities={...ayo};this.emitter=new no;this.onDidSetCapabilities=this.emitter.event}static{a(this,"CopilotCapabilitiesProvider")}setCapabilities(e){let r;for(r in e){let n=e[r];n!==void 0&&(this.capabilities[r]=n)}this.emitter.fire(this.capabilities)}getCapabilities(){return this.capabilities}};p();var AL=require("fs"),Ose=require("os"),Bse=fe(require("path")),WU=require("process");var yi=class{static{a(this,"PersistenceManager")}},QNt=class extends yi{constructor(r){super();this.directory=r}static{a(this,"FilePersistenceManager")}async read(r,n){try{return(await this.readJsonObject(r))[n]}catch{return}}async update(r,n,o){await AL.promises.mkdir(this.directory,{recursive:!0,mode:448});let s=`${this.directory}/${r}.json`,c=Bse.dirname(s);c!==this.directory&&await AL.promises.mkdir(c,{recursive:!0,mode:448});let l;try{l=await Tbe.acquire(s);let u=await this.readJsonObject(r);u[n]=o,await AL.promises.writeFile(s,JSON.stringify(u)+` +`,{encoding:"utf8",mode:384})}finally{l&&await l()}}async delete(r,n){let o=`${this.directory}/${r}.json`,s;try{s=await Tbe.acquire(o);let c=await this.readJsonObject(r);delete c[n];let l=JSON.stringify(c)+` `;l===`{} -`?await SL.promises.rm(o):await SL.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await Lbe.acquire(n),await SL.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await SL.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await SL.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},Lbe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function myo(){if(XU.env.XDG_CONFIG_HOME&&Gse.isAbsolute(XU.env.XDG_CONFIG_HOME))return XU.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Hse.platform)()==="win32"){let e=XU.env.USERPROFILE||XNt.homedir();return e?e+"\\AppData\\Local\\github-copilot":cZr()}let t=XU.env.HOME&&XU.env.HOME.length>0?XU.env.HOME:XNt.homedir();return t?t+"/.config/github-copilot":cZr()}a(myo,"getXdgConfigPath");var XNt={homedir:Hse.homedir,tmpdir:Hse.tmpdir};function cZr(){return Gse.join(XNt.tmpdir(),"github-copilot")}a(cZr,"tmpdirConfigPath");function lZr(){return new ZNt(myo())}a(lZr,"makeXdgPersistenceManager");p();var as=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},LQe=class extends as{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var uZr={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function dZr(t,e){gt(t,uZr.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(dZr,"telemetryAuthPickerListed");function eMt(t,e){gt(t,uZr.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(eMt,"telemetryAuthPickerUsed");p();var $se={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked"};function fZr(t,e){gi(t,$se.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(fZr,"telemetryAuthStoreInitialize");function pZr(t,e){gi(t,$se.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(pZr,"telemetryAuthStoreError");function hZr(t,e){gi(t,$se.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a(hZr,"telemetryAuthStoreMigration");function tMt(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),gt(t,$se.SessionActivated,r,{durationMs:e.durationMs})}a(tMt,"telemetryAuthSessionActivated");function mZr(t,e){gt(t,$se.SessionDeactivated,{editorId:e.editorId})}a(mZr,"telemetryAuthSessionDeactivated");function rMt(t,e){gt(t,$se.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(rMt,"telemetryAuthTokenRevoked");var gyo="apps",gZr="hosts",qm=new ge("AuthManager"),AZr="legacy_files_migration_done",Ayo=5,yyo=6e4,Ur=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Qt)}getConfiguredUrls(){return this.ctx.get(D0).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),qm.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(as).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await JNt(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Zo).requireReady();let{session:r,sourceEnvVar:n}=iMt(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),{session:{...r,...Sy(r)},sourceEnvVar:n};let o=await this.transientSession;return o?o.accessToken===void 0?{session:void 0}:{session:{...o,...Sy(o)}}:{session:await this.resolvePersistedSession({authAuthority:e})}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},FQe=class extends Ur{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(MN)}async tracked(r,n){try{return await n()}catch(o){throw qm.exception(this.ctx,o,`authStore.${r}`),pZr(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Lr).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=tU(this.ctx,r.authAuthority)}catch(o){qm.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:_yo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(AZr))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(Si),h=this.editorId(),[m,g]=await Promise.all([f.readAll(gyo).catch(()=>({})),f.readAll(gZr).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=yZr(y);if(!E){c++;continue}let[_,v]=Eyo(A)??["github.com",Vse],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!APt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:nMt(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=yZr(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!APt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Vse,scopes:nMt(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(AZr,String(Date.now())))}catch{}this.ctx.get(Si).deleteSetting(gZr).catch(()=>{}),hZr(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),qm.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(),c=s.slice(0,Ayo);if(qm.debug(this.ctx,`tryAutoAdopt: editorId=${n} totalTokens=${s.length} candidates=${c.length}`),c.length===0)return;let l=this.ctx.get(gh);for(let u of c){let d=this.tokenRecordToSession(u.record);if(!d){qm.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${u.tokenId}; continuing walk`),await this.revokeTokenById(u.tokenId,"corrupt_authority");continue}let f;try{f=await l.fetchTokenResult(this.ctx,d)}catch{qm.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${u.tokenId}; aborting walk`);return}if(f.copilotToken||f.failureKind==="NotAuthorized"){qm.info(this.ctx,`tryAutoAdopt: adopting tokenId=${u.tokenId} crossEditor=${u.sourceEditorId!==n} noCopilotAccess=${f.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,u.tokenId))}catch(h){qm.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${u.tokenId} (${h?.message??h}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(u.tokenId),tMt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:u.sourceEditorId!==n,durationMs:Date.now()-o}),d}if(f.failureKind==="HTTP401"){qm.info(this.ctx,`tryAutoAdopt: revoking invalid tokenId=${u.tokenId}; continuing walk`);let h=await this.tracked("revoke",()=>r.deleteTokenCascade(u.tokenId));rMt(this.ctx,{editorId:n,trigger:"bad_credentials",affectedEditors:h.affectedEditors});continue}qm.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${u.tokenId} kind=${f.failureKind}; aborting walk`);return}qm.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new Ai("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new Ai("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();qm.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:nMt(r.scopes)}));qm.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),tMt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=tU(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return qm.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),mZr(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){qm.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return qm.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),rMt(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&this._copilotTokenManager.setActiveTokenId(void 0),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return eMt(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{d="NotSignedIn"}let f;switch(d){case"OK":f="ok";break;case"NotAuthorized":f="not_entitled";break;default:this._copilotTokenManager.getActiveTokenId()===void 0?(await this._copilotTokenManager.awaitPendingCascadeRevoke(),f="revoked"):f="transient";break}return eMt(this.ctx,{editorId:o,status:f,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:f}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return dZr(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(Mn).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o);if(!l&&!s&&!c&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){qm.debug(this.ctx,`resolvePersistedSession: no active session editorId=${o}`);return}let u=tU(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==u.authAuthority||r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId)return;let d=this.tokenRecordToSession(l.record);if(!d){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let f=Date.now();return f-this.lastTouchAt>=yyo&&(this.lastTouchAt=f,n.touchActiveSession(o).catch(()=>{})),d}};function Eyo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(Eyo,"splitAppsKey");function _yo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(_yo,"normalizeScopes");function nMt(t){return t?typeof t=="string"?t:t.join(" "):""}a(nMt,"scopesToString");function yZr(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(yZr,"asLegacyAuthRecord");function iMt(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...Sy({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...Sy({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...Sy({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(iMt,"getSessionFromEnv");p();var Cyo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],EZr="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",_Zr="https://gh.io/copilot-network-errors",lv=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&Cyo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new ge("certificates").error(e,`${EZr} Please visit ${_Zr} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(sa).showWarningMessage(EZr,n).then(o=>{if(o?.title===n.title)return e.get(N0).open(_Zr)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var rA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function rx(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(rx,"delay");function Wse(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Wse,"fireAndForget");function zse(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(zse,"safeInit");var oMt=class extends Ai{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Qt=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.refreshTimer=void 0;this.didChangeTokenResult=new no;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new no;this.onDidResetToken=this.didResetToken.event;this.pendingCascadeRevoke=Promise.resolve()}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Ur).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get(gh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),gWr(this.ctx).value){UQe(this.ctx,"skipped",-1);return}let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(UQe(this.ctx,"scheduled",r),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(UQe(this.ctx,"started",r),this.startTokenRefresh(n=>{UQe(this.ctx,n.copilotToken?"success":"failure",r,n.failureKind??"","exception"in n?n.exception:void 0)}))},r),typeof this.refreshTimer=="object"&&"unref"in this.refreshTimer&&this.refreshTimer.unref())}clearRefreshTimer(){this.refreshTimer!==void 0&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}startTokenRefresh(e){let r,n=this.getGitHubSession().then(async o=>o?(r=o.login,await this.fetchTokenResult(o)):{failureKind:"NotSignedIn"}).catch(o=>{let s=o instanceof Error?o:new Error(String(o));return Jg.exception(this.ctx,s,"tokenRefresh"),{failureKind:"Exception",message:String(o),exception:s}}).then(o=>(this.tokenPromise!==n||(this.tokenPromise=void 0,o.copilotToken&&(this.ctx.get(as).forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(o.copilotToken),this.didChangeTokenResult.fire(o)),e?.(o)),o));this.tokenPromise=n}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(CZr(this.ctx))throw this.tokenPrimingError=r,r;Jg.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(as);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"}),this.cascadeRevokeActiveToken();break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1,result:{status:"NotSignedIn",user:r}}),this.ctx.get(lv).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=X9(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?gi(this.ctx,"auth.token_reset_complete",e.exception,s,l):gt(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=X9(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new oMt(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}cascadeRevokeActiveToken(){let e=this.activeTokenId;e!==void 0&&(this.activeTokenId=void 0,this.pendingCascadeRevoke=this.ctx.get(Ur).revokeTokenById(e,"bad_credentials").then(r=>{Jg.debug(this.ctx,`cascadeRevoke: revoked tokenId ${e}, affectedEditors=${r.affectedEditors}`)}).catch(r=>{Jg.exception(this.ctx,r,"cascadeRevoke")}))}async awaitPendingCascadeRevoke(){await this.pendingCascadeRevoke}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){Jg.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}r!==void 0?(ht(this.ctx,"auth.reset_token_"+r),Jg.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):Jg.debug(this.ctx,`Resetting copilot token (caller: ${e})`);let o=X9(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;gt(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),!(!this.activeToken&&!this.tokenPromise)&&(this.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire())}getLastToken(){return this.lastToken}};function FI(t){return t.get(Qt).getLastToken()}a(FI,"getLastCopilotToken");function UQe(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?gi(t,"auth.proactive_copilot_token_refresh",o,s,c):gt(t,"auth.proactive_copilot_token_refresh",s,c)}a(UQe,"telemetryProactiveCopilotTokenRefresh");p();var dM=class{static{a(this,"Clock")}now(){return new Date}};p();var Qk=class{static{a(this,"ExpConfigMaker")}},Fbe=class extends Qk{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(ar),c=Object.keys(o).length===0?this.defaultFilters:o,l=new URL("telemetry",n.telemetry).href,u;try{u=await s.fetch(l,{method:"GET",headers:c,timeout:5e3})}catch(m){return XC.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return XC.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return _s(r,m,"fetchExperiments"),XC.createFallbackConfig(r,"ExP responded with invalid JSON");throw m}let f=d.Configs.find(m=>m.Id==="vscode")??{Id:"vscode",Parameters:{}},h=Object.entries(f.Parameters).map(([m,g])=>m+(g?"":"cf"));return new XC(f.Parameters,d.AssignmentContext,h.join(";"))}},QQe=class extends Qk{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(XC.createEmptyConfig())}};p();p();var qQe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},sMt=class extends qQe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},vZr=a(t=>new sMt(t),"DEFAULT_GRANULARITY"),jQe=class extends qQe{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var bZr="X-Copilot-ClientTimeBucket",HQe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=vZr(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new jQe(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(bZr,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(bZr,s))}}};p();p();p();p();var aMt=new Map;async function byo(t){if(aMt.has(t))return aMt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return aMt.set(t,e),e}a(byo,"getCachedHmacKey");async function Syo(t){if(t)try{let e=await byo(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(Syo,"createRequestHMAC");async function SZr(t,e){let r=await Syo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(SZr,"createMsBenchHmacHeaders");p();p();p();p();var $Qe="4.13.1",gz="04b07795-8ddb-461a-bbee-02f9e1bf7b46",TZr="common",GQe;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(GQe||(GQe={}));var Ube=GQe.AzurePublicCloud,IZr="login.microsoftonline.com",xZr=["*"],wZr="cae",RZr="nocae",kZr="msal.cache";var cMt;var Tyo,VQe,DZr;function NZr(){return VQe!==void 0&&DZr!==void 0}a(NZr,"hasVSCodePlugin");function Iyo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(cMt===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||kZr;e.cache.cachePlugin=cMt({name:`${r}.${RZr}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=cMt({name:`${r}.${wZr}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=wyo(t.isVSCodeCredential||!1)),e}a(Iyo,"generatePluginConfiguration");var PZr={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},xyo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return DZr}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return Tyo}}};function wyo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=xyo[t?"vsCode":"native"];if(o===void 0)throw new Error(PZr.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(PZr.unavailable(e,r));return o.broker}a(wyo,"getBrokerPlugin");var MZr={generatePluginConfiguration:Iyo};p();p();p();function Ryo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(Ryo,"isErrorResponse");var BZr="CredentialUnavailableError",Dn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=BZr}},WQe="AuthenticationError",e7=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(Ryo(r))o=OZr(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=OZr(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. +`?await AL.promises.rm(o):await AL.promises.writeFile(o,l,{encoding:"utf8",mode:384})}catch{}finally{s&&await s()}}async deleteSetting(r){let n=`${this.directory}/${r}.json`,o;try{o=await Tbe.acquire(n),await AL.promises.rm(n)}catch{}finally{o&&await o()}}async listSettings(){try{return(await AL.promises.readdir(this.directory)).filter(n=>n.endsWith(".json")).map(n=>n.slice(0,-5))}catch{return[]}}async listKeys(r){return Object.keys(await this.readJsonObject(r))}async readAll(r){return await this.readJsonObject(r)}async readJsonObject(r){let n=`${this.directory}/${r}.json`;try{let o=await AL.promises.readFile(n,{encoding:"utf8"});return JSON.parse(o)}catch{return{}}}},Tbe=class{static{a(this,"LockManager")}static{this.locks=new Map}static{this.DEFAULT_TIMEOUT_MS=1e4}static async acquire(e){await this.getLock(e);let r,n=new Promise(o=>{r=o});return this.locks.set(e,n),()=>Promise.resolve().then(()=>{r&&(r(),r=void 0,this.locks.get(e)===n&&this.locks.delete(e))})}static async getLock(e){let r=Date.now();for(;Date.now()-r{setTimeout(()=>{l(new Error("timeout"))},o)});try{await Promise.race([n,s])}catch{return}}}};function cyo(){if(WU.env.XDG_CONFIG_HOME&&Bse.isAbsolute(WU.env.XDG_CONFIG_HOME))return WU.env.XDG_CONFIG_HOME+"/github-copilot";if((0,Ose.platform)()==="win32"){let e=WU.env.USERPROFILE||qNt.homedir();return e?e+"\\AppData\\Local\\github-copilot":UJr()}let t=WU.env.HOME&&WU.env.HOME.length>0?WU.env.HOME:qNt.homedir();return t?t+"/.config/github-copilot":UJr()}a(cyo,"getXdgConfigPath");var qNt={homedir:Ose.homedir,tmpdir:Ose.tmpdir};function UJr(){return Bse.join(qNt.tmpdir(),"github-copilot")}a(UJr,"tmpdirConfigPath");function QJr(){return new QNt(cyo())}a(QJr,"makeXdgPersistenceManager");p();var ss=class{static{a(this,"StatusReporter")}#e=0;#t="Normal";#r;#n;#i=!0;#o={category:"auth",kind:"Warning",message:"Not initialized",askToReSignin:!1,result:{status:"NotSignedIn"}};#s={category:"cls",kind:"Normal",inactive:!1};get busy(){return this.#e>0}trackCompletionJob(e){return this.#t==="Warning"&&this.forceNormalV1(),this.#s.kind==="Warning"&&this.forceNormalV2("cls",{inactive:!1}),this.#e++===0&&(this.#a(),this.#c("completion")),e().finally(()=>{--this.#e===0&&(this.#a(),this.#c("completion"))})}forceStatusV1(e,r,n){this.#t===e&&this.#r===r&&!n&&!this.#n&&!this.#i||(this.#t=e,this.#r=r,this.#n=n,this.#i=!1,this.#a())}forceStatusV2(e,r){e==="auth"?this.#o=r:this.#s=r,this.#c(e)}forceStatus(e,r,n){this.forceStatusV1(r.kind,r.message,n),this.forceStatusV2(e,r)}forceNormalV1(){this.#t!=="Inactive"&&this.forceStatusV1("Normal")}forceNormalV2(e,r){this.forceStatusV2(e,{...r,kind:"Normal",category:e})}forceNormal(e,r){this.forceNormalV1(),this.forceNormalV2(e,r)}setErrorV1(e,r){this.forceStatusV1("Error",e,r)}setErrorV2(e,r){let n=e==="auth"?this.#o:this.#s;this.forceStatusV2(e,{...n,...r,kind:"Error",category:e})}setError(e,r,n){this.setErrorV1(r.message,n),this.setErrorV2(e,r)}setWarningV1(e){this.#t!=="Error"&&this.forceStatusV1("Warning",e)}setWarningV2(e,r){let n=e==="auth"?this.#o:this.#s;n.kind!=="Error"&&this.forceStatusV2(e,{...n,...r,kind:"Warning",category:e})}setWarning(e,r){this.setWarningV1(r.message),this.setWarningV2(e,r)}setInactiveV1(e){this.#t==="Error"||this.#t==="Warning"||this.forceStatusV1("Inactive",e)}setClsInactiveV2(e){this.setInactiveV1(e),!(this.#s.kind==="Error"||this.#s.kind==="Warning")&&(this.#s.inactive&&this.#s.message===e||(this.#s={category:"cls",kind:"Normal",inactive:!0,message:e},this.#c("cls")))}setClsInactive(e){this.setInactiveV1(e),this.setClsInactiveV2(e)}clearInactiveV1(){this.#t==="Inactive"&&this.forceStatusV1("Normal")}clearClsInactiveV2(){this.#s.inactive&&(this.#s={category:"cls",kind:"Normal",inactive:!1},this.#c("cls"))}clearClsInactive(){this.clearInactiveV1(),this.clearClsInactiveV2()}sendInitNonAuthStatus(){this.didChangeV2({statuses:[this.#s,{category:"completion",busy:this.busy}]})}#a(){let e={kind:this.#t,message:this.#r,busy:this.busy,command:this.#n};this.didChangeV1(e)}#c(e){let r=this.#u(e);this.didChangeV2({statuses:[r]})}#u(e){switch(e){case"completion":return{category:"completion",busy:this.#e>0};case"auth":return this.#o;case"cls":return this.#s}}},CQe=class extends ss{static{a(this,"NoOpStatusReporter")}didChangeV1(){}didChangeV2(){}};p();var qJr={PickerListed:"auth.account_picker.listed",PickerUsed:"auth.account_picker.used"};function jJr(t,e){_t(t,qJr.PickerListed,{editorId:e.editorId,hasCurrentSession:String(e.hasCurrentSession),hasOptOutTombstone:String(e.hasOptOutTombstone)},{candidateCount:e.candidateCount})}a(jJr,"telemetryAuthPickerListed");function jNt(t,e){_t(t,qJr.PickerUsed,{editorId:e.editorId,status:e.status,clearedTombstone:String(e.clearedTombstone),crossEditorReuse:String(e.crossEditorReuse)},{validationMs:e.validationMs})}a(jNt,"telemetryAuthPickerUsed");p();var zU={StoreInitialize:"auth.store.initialize",StoreError:"auth.store.error",StoreMigration:"auth.store.migration",SessionActivated:"auth.session.activated",SessionDeactivated:"auth.session.deactivated",TokenRevoked:"auth.token.revoked",EncryptionInitialize:"auth.encryption.initialize",EncryptionUpgrade:"auth.encryption.upgrade"};function HJr(t,e){si(t,zU.StoreInitialize,e.error,{repoKind:e.repoKind,errorPhase:e.errorPhase||""},{durationMs:e.durationMs})}a(HJr,"telemetryAuthStoreInitialize");function GJr(t,e){si(t,zU.StoreError,e.error,{editorId:e.editorId,op:e.op})}a(GJr,"telemetryAuthStoreError");function $Jr(t,e){si(t,zU.StoreMigration,e.error,{editorId:e.editorId,outcome:e.outcome},{appsRecords:e.appsRecords,hostsRecords:e.hostsRecords,skippedRecords:e.skippedRecords,durationMs:e.durationMs})}a($Jr,"telemetryAuthStoreMigration");function HNt(t,e){let r={editorId:e.editorId,trigger:e.trigger};e.crossEditorReuse!==void 0&&(r.crossEditorReuse=String(e.crossEditorReuse)),e.tokenRewrite!==void 0&&(r.tokenRewrite=String(e.tokenRewrite)),_t(t,zU.SessionActivated,r,{durationMs:e.durationMs})}a(HNt,"telemetryAuthSessionActivated");function VJr(t,e){_t(t,zU.SessionDeactivated,{editorId:e.editorId})}a(VJr,"telemetryAuthSessionDeactivated");function Ibe(t,e){_t(t,zU.TokenRevoked,{editorId:e.editorId,trigger:e.trigger},{affectedEditors:e.affectedEditors})}a(Ibe,"telemetryAuthTokenRevoked");function bQe(t,e){si(t,zU.EncryptionInitialize,e.diagnostics.error,{writerKind:e.writerKind,available:String(e.diagnostics.available),errorPhase:e.diagnostics.errorPhase??"",masterKeySource:e.diagnostics.masterKeySource??""})}a(bQe,"telemetryAuthEncryptionInitialize");function GNt(t,e){si(t,zU.EncryptionUpgrade,e.error,{},e.result?{attempted:e.result.attempted,upgraded:e.result.upgraded,failed:e.result.failed,skipped:e.result.skipped}:void 0)}a(GNt,"telemetryAuthEncryptionUpgrade");var lyo="apps",WJr="hosts",Hm=new Ae("AuthManager"),zJr="legacy_files_migration_done",uyo=5,dyo=6e4,Fr=class{constructor(e,r){this.ctx=e;this.env=r}static{a(this,"AuthManager")}hasTransientSession(){return this.transientSession!==void 0}get _copilotTokenManager(){return this.ctx.get(Ut)}getConfiguredUrls(){return this.ctx.get(N0).getConfiguredUrls()}async checkAndUpdateStatus(e){let r=e?.localChecksOnly??!1,n,o;if(e?.githubAppId!==void 0)n=await this.resolvePersistedSession(e);else{let c=await this.resolveSessionWithSource(e?.authAuthority);n=c.session,o=c.sourceEnvVar}if(n===void 0)return this._copilotTokenManager.resetToken("session_not_found"),Hm.info(this.ctx,"checkAndUpdateStatus: no session found, priming token"),await this._copilotTokenManager.primeToken(),o?{status:"NotSignedIn",sourceEnvVar:o}:{status:"NotSignedIn"};if(r)return this.ctx.get(ss).forceNormalV2("auth",{result:{status:"MaybeOK",user:n.login}}),o?{status:"MaybeOK",user:n.login,sourceEnvVar:o}:{status:"MaybeOK",user:n.login};e?.forceRefresh&&this._copilotTokenManager.resetToken("force_refresh");let s=await UNt(this.ctx,n,e?.freshSignIn??!1);return o?{status:s,user:n.login,sourceEnvVar:o}:{status:s,user:n.login}}async resolveSession(e){return(await this.resolveSessionWithSource(e)).session}async resolveSessionWithSource(e){await this.ctx.get(Yo).requireReady();let{session:r,sourceEnvVar:n}=VNt(this.env);if(r)return this._copilotTokenManager.setActiveTokenId(void 0),{session:{...r,...wy(r)},sourceEnvVar:n};let o=await this.transientSession;return o?o.accessToken===void 0?{session:void 0}:{session:{...o,...wy(o)}}:{session:await this.resolvePersistedSession({authAuthority:e})}}setTransientSession(e){this.transientSession=e&&Promise.resolve(e),this._copilotTokenManager.setActiveTokenId(void 0),this._copilotTokenManager.resetToken("set_transient_session")}},SQe=class extends Fr{constructor(){super(...arguments);this.lastTouchAt=0}static{a(this,"PersistentAuthManager")}get authRepository(){return this.ctx.get(OI)}async tracked(r,n){try{return await n()}catch(o){throw Hm.exception(this.ctx,o,`authStore.${r}`),GJr(this.ctx,{editorId:this.editorId(),op:r,error:o}),o}}editorId(){return this.cachedEditorId===void 0&&(this.cachedEditorId=this.ctx.get(Nr).getEditorIdentity().editorId),this.cachedEditorId}tokenRecordToSession(r){let n;try{n=Y9(this.ctx,r.authAuthority)}catch(o){Hm.warn(this.ctx,"tokenRecordToSession: dropping record with unparseable authAuthority",o);return}return{serverUrl:n.serverUrl,apiUrl:n.apiUrl,accessToken:r.accessToken,login:r.user,githubAppId:r.oauthClientId||void 0,scopes:pyo(r.scopes)}}async ensureSqliteMigration(){return this.sqliteMigrationPromise||(this.sqliteMigrationPromise=this.runSqliteMigration()),this.sqliteMigrationPromise}async runSqliteMigration(){let r=this.authRepository;try{if(await r.getMetadata(zJr))return}catch{}let n=Date.now(),o=0,s=0,c=0,l="ok",u,d=!1;try{let f=this.ctx.get(yi),h=this.editorId(),[m,g]=await Promise.all([f.readAll(lyo).catch(()=>({})),f.readAll(WJr).catch(()=>({}))]);d=Object.keys(m).length>0||Object.keys(g).length>0;for(let[A,y]of Object.entries(m)){let E=YJr(y);if(!E){c++;continue}let[_,v]=fyo(A)??["github.com",Lse],b=E.oauth_token||E.access_token,T=E.user||E.login;if(!b||!T){c++;continue}let w=E.authAuthority||_;if(!okt(w)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:T,accessToken:b,authAuthority:w,oauthClientId:E.githubAppId??v,scopes:$Nt(E.scopes)}),o++}catch{c++}}for(let[A,y]of Object.entries(g)){let E=YJr(y);if(!E){c++;continue}let _=E.oauth_token||E.access_token,v=E.user||E.login;if(!_||!v){c++;continue}let b=E.authAuthority||A;if(!okt(b)){c++;continue}try{await r.upsertTokenAndAssign(h,{user:v,accessToken:_,authAuthority:b,oauthClientId:E.githubAppId??Lse,scopes:$Nt(E.scopes)}),s++}catch{c++}}}catch(f){l="failed",u=f}finally{l==="ok"&&!d&&(l="noop");try{await this.tracked("metadata",()=>r.setMetadata(zJr,String(Date.now())))}catch{}this.ctx.get(yi).deleteSetting(WJr).catch(()=>{}),$Jr(this.ctx,{editorId:this.editorId(),outcome:l,error:u,appsRecords:o,hostsRecords:s,skippedRecords:c,durationMs:Date.now()-n}),Hm.info(this.ctx,`runSqliteMigration: outcome=${l} apps=${o} hosts=${s} skipped=${c}`)}}tryAutoAdoptCoalesced(){return this.autoAdoptPromise||(this.autoAdoptPromise=this.tryAutoAdopt().finally(()=>{this.autoAdoptPromise=void 0})),this.autoAdoptPromise}async tryAutoAdopt(){let r=this.authRepository,n=this.editorId(),o=Date.now(),s=await r.listTokensByRecency(uyo);if(Hm.debug(this.ctx,`tryAutoAdopt: editorId=${n} candidates=${s.length}`),s.length===0)return;let c=this.ctx.get(Eh);for(let l of s){let u=this.tokenRecordToSession(l.record);if(!u){Hm.info(this.ctx,`tryAutoAdopt: dropping corrupt-authority tokenId=${l.tokenId}; continuing walk`),await this.revokeTokenById(l.tokenId,"corrupt_authority");continue}let d;try{d=await c.fetchTokenResult(this.ctx,u)}catch{Hm.debug(this.ctx,`tryAutoAdopt: transient fetch error tokenId=${l.tokenId}; aborting walk`);return}if(d.copilotToken||d.failureKind==="NotAuthorized"){Hm.info(this.ctx,`tryAutoAdopt: adopting tokenId=${l.tokenId} crossEditor=${l.sourceEditorId!==n} noCopilotAccess=${d.failureKind==="NotAuthorized"}`);try{await this.tracked("assign",()=>r.assignActiveSession(n,l.tokenId))}catch(f){Hm.info(this.ctx,`tryAutoAdopt: assign failed for tokenId=${l.tokenId} (${f?.message??f}); continuing walk`);continue}return this._copilotTokenManager.setActiveTokenId(l.tokenId),HNt(this.ctx,{editorId:n,trigger:"auto_adopt",crossEditorReuse:l.sourceEditorId!==n,durationMs:Date.now()-o}),u}if(d.failureKind==="HTTP401"){Hm.info(this.ctx,`tryAutoAdopt: revoking invalid tokenId=${l.tokenId}; continuing walk`);let f=await this.tracked("revoke",()=>r.deleteTokenCascade(l.tokenId));Ibe(this.ctx,{editorId:n,trigger:"bad_credentials",affectedEditors:f.affectedEditors});continue}Hm.debug(this.ctx,`tryAutoAdopt: transient failure tokenId=${l.tokenId} kind=${d.failureKind}; aborting walk`);return}Hm.debug(this.ctx,`tryAutoAdopt: exhausted candidates editorId=${n}`)}async signInEditor(r){if(!r.user)throw new gi("Cannot sign in: missing GitHub username.");if(!r.accessToken)throw new gi("Cannot sign in: missing GitHub access token.");await this.ensureSqliteMigration();let n=this.editorId(),o=Date.now();Hm.debug(this.ctx,`signInEditor: editorId=${n} authority=${r.authAuthority} appId=${r.githubAppId??""}`);let s=await this.tracked("upsert",()=>this.authRepository.upsertTokenAndAssign(n,{user:r.user,accessToken:r.accessToken,authAuthority:r.authAuthority,oauthClientId:r.githubAppId??"",scopes:$Nt(r.scopes)}));Hm.info(this.ctx,`signInEditor: persisted editorId=${n} tokenId=${s.tokenId} rewrite=${s.tokenRewrite}`),HNt(this.ctx,{editorId:n,trigger:"sign_in",tokenRewrite:s.tokenRewrite,durationMs:Date.now()-o});let c=Y9(this.ctx,r.authAuthority);return this.setTransientSession({login:r.user,accessToken:r.accessToken,githubAppId:r.githubAppId,serverUrl:c.serverUrl,apiUrl:c.apiUrl}),this._copilotTokenManager.setActiveTokenId(s.tokenId),await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:r.authAuthority})}async signOutEditor(){let r=this.editorId();return Hm.info(this.ctx,`signOutEditor: editorId=${r}`),await this.tracked("opt_out",()=>this.authRepository.markEditorOptedOut(r)),VJr(this.ctx,{editorId:r}),this._copilotTokenManager.setActiveTokenId(void 0),this.setTransientSession(void 0),await this.checkAndUpdateStatus({forceRefresh:!0})}async revokeTokenById(r,n){Hm.info(this.ctx,`revokeTokenById: tokenId=${r} trigger=${n??"unknown"}`);let o=await this.tracked("revoke",()=>this.authRepository.deleteTokenCascade(r));return Hm.info(this.ctx,`revokeTokenById: cascade complete tokenId=${r} affectedEditors=${o.affectedEditors}`),Ibe(this.ctx,{editorId:this.editorId(),trigger:n??"unknown",affectedEditors:o.affectedEditors}),this._copilotTokenManager.resetToken("token_revoked",void 0,r),this._copilotTokenManager.getActiveTokenId()===r&&this._copilotTokenManager.setActiveTokenId(void 0),o}async useExistingToken(r){let n=this.authRepository,o=this.editorId(),s=await n.getTokenById(r);if(!s)return jNt(this.ctx,{editorId:o,status:"revoked",clearedTombstone:!1,crossEditorReuse:!1,validationMs:0}),{status:"revoked"};let c=s.sourceEditorId!==o,l=await n.hasOptOutTombstone(o);this.setTransientSession(void 0),await n.assignActiveSession(o,r),this._copilotTokenManager.setActiveTokenId(r);let u=performance.now(),d;try{d=(await this.checkAndUpdateStatus({forceRefresh:!0,freshSignIn:!0,authAuthority:s.record.authAuthority})).status}catch{d="NotSignedIn"}let f;switch(d){case"OK":f="ok";break;case"NotAuthorized":f="not_entitled";break;default:this._copilotTokenManager.getActiveTokenId()===void 0?(await this._copilotTokenManager.awaitPendingCascadeRevoke(),f="revoked"):f="transient";break}return jNt(this.ctx,{editorId:o,status:f,clearedTombstone:l,crossEditorReuse:c,validationMs:performance.now()-u}),{status:f}}async listAvailableTokens(){await this.ensureSqliteMigration();let r=this.authRepository,n=this.editorId(),o=await r.listAvailableTokens(),s=await r.getActiveSession(n),c=o.map(d=>({tokenId:d.tokenId,authAuthority:d.authAuthority,userLogin:d.userLogin,isCurrent:s?.tokenId===d.tokenId,lastUsedAt:d.lastUsedAt})),l=c.some(d=>d.isCurrent),u=await r.hasOptOutTombstone(n);return jJr(this.ctx,{editorId:n,candidateCount:c.length,hasCurrentSession:l,hasOptOutTombstone:u}),c}async resolvePersistedSession(r){await this.ensureSqliteMigration();let n=this.authRepository,o=this.editorId(),s=this.ctx.get(On).getCapabilities().accountPickerEnabled,c=await n.hasOptOutTombstone(o),l=await n.getActiveSession(o);if(!l&&!s&&!c&&(await this.tryAutoAdoptCoalesced(),l=await n.getActiveSession(o)),!l){Hm.debug(this.ctx,`resolvePersistedSession: no active session editorId=${o}`);return}let u=Y9(this.ctx,r?.authAuthority);if(r?.authAuthority!==void 0&&l.record.authAuthority!==u.authAuthority||r?.githubAppId!==void 0&&l.record.oauthClientId!==r.githubAppId)return;let d=this.tokenRecordToSession(l.record);if(!d){await this.revokeTokenById(l.tokenId,"corrupt_authority");return}this._copilotTokenManager.setActiveTokenId(l.tokenId);let f=Date.now();return f-this.lastTouchAt>=dyo&&(this.lastTouchAt=f,n.touchActiveSession(o).catch(()=>{})),d}};function fyo(t){let e=t.lastIndexOf(":");if(e<0)return;let r=t.slice(e+1);if(r)return[t.slice(0,e),r]}a(fyo,"splitAppsKey");function pyo(t){if(t)return typeof t=="string"?t.split(" ").filter(e=>e.length>0):t}a(pyo,"normalizeScopes");function $Nt(t){return t?typeof t=="string"?t:t.join(" "):""}a($Nt,"scopesToString");function YJr(t){if(!(!t||typeof t!="object"||Array.isArray(t)))return t}a(YJr,"asLegacyAuthRecord");function VNt(t){return t.GH_COPILOT_TOKEN&&!/=/.test(t.GH_COPILOT_TOKEN)?{session:{...wy({apiUrl:t.GH_COPILOT_API_URL,serverUrl:t.GH_COPILOT_SERVER_URL}),login:t.GH_COPILOT_USER||"",accessToken:t.GH_COPILOT_TOKEN},sourceEnvVar:"GH_COPILOT_TOKEN"}:t.GITHUB_COPILOT_TOKEN?{session:{...wy({apiUrl:t.GITHUB_COPILOT_API_URL,serverUrl:t.GITHUB_COPILOT_SERVER_URL}),login:t.GITHUB_COPILOT_USER||"",accessToken:t.GITHUB_COPILOT_TOKEN},sourceEnvVar:"GITHUB_COPILOT_TOKEN"}:t.CODESPACES==="true"&&t.GITHUB_TOKEN?{session:{...wy({apiUrl:t.GITHUB_API_URL,serverUrl:t.GITHUB_SERVER_URL}),login:t.GITHUB_USER||"",accessToken:t.GITHUB_TOKEN},sourceEnvVar:"GITHUB_TOKEN"}:{}}a(VNt,"getSessionFromEnv");p();var hyo=["UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_SIGNATURE_FAILURE"],KJr="Your proxy connection requires a trusted certificate. Please make sure the proxy certificate and any issuers are configured correctly and trusted by your operating system.",JJr="https://gh.io/copilot-network-errors",sC=class{constructor(){this.notifiedErrorCodes=[]}static{a(this,"UserErrorNotifier")}notifyUser(e,r){if(!(r instanceof Error))return;let n=r;n.code&&hyo.includes(n.code)&&!this.didNotifyBefore(n.code)&&(this.notifiedErrorCodes.push(n.code),this.displayCertificateErrorNotification(e,n))}async displayCertificateErrorNotification(e,r){new Ae("certificates").error(e,`${KJr} Please visit ${JJr} to learn more. Original cause:`,r);let n={title:"Learn more"};return e.get(Hs).showWarningMessage(KJr,n).then(o=>{if(o?.title===n.title)return e.get(M0).open(JJr)})}didNotifyBefore(e){return this.notifiedErrorCodes.indexOf(e)!==-1}};p();var nA=class{constructor(){this.resolve=a(()=>{},"resolve");this.reject=a(()=>{},"reject");this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}static{a(this,"Deferred")}};function XI(t,e=void 0){return new Promise(r=>setTimeout(()=>r(e),t))}a(XI,"delay");function Fse(t,e){try{t()?.catch(r=>{try{e?.(r)}catch{}})}catch(r){try{e?.(r)}catch{}}}a(Fse,"fireAndForget");function Use(t,e,r){try{return t()}catch(n){try{r?.(n)}catch{}return e}}a(Use,"safeInit");var WNt=class extends gi{constructor(r){super("message"in r?r.message:`${r.failureKind}`);this.result=r}static{a(this,"TokenResultError")}},Ut=class{constructor(e,r=!1){this.ctx=e;this.primed=r;this.lastToken=void 0;this.activeToken=void 0;this.activeTokenId=void 0;this.tokenPromise=void 0;this.tokenPrimingError=void 0;this.refreshTimer=void 0;this.didChangeTokenResult=new no;this.onDidChangeTokenResult=this.didChangeTokenResult.event;this.didResetToken=new no;this.onDidResetToken=this.didResetToken.event;this.pendingCascadeRevoke=Promise.resolve()}static{a(this,"CopilotTokenManager")}async getGitHubSession(){return await this.ctx.get(Fr).resolveSession()}primeToken(){if(this.tokenPrimingError)return Promise.reject(this.tokenPrimingError);this.primed=!0;try{return this.getToken().then(()=>!0,()=>!1)}catch{return Promise.resolve(!1)}}async fetchTokenResult(e){return await this.ctx.get(Eh).fetchTokenResult(this.ctx,e,this.lastToken)}setToken(e){this.activeToken=this.lastToken=e,this.scheduleProactiveRefresh(e)}scheduleProactiveRefresh(e){if(this.clearRefreshTimer(),XJr(this.ctx).value){TQe(this.ctx,"skipped",-1);return}let r=e.envelope.refresh_in*1e3;r>0&&r<=2147483647&&(TQe(this.ctx,"scheduled",r),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,!this.tokenPromise&&(TQe(this.ctx,"started",r),this.startTokenRefresh(n=>{TQe(this.ctx,n.copilotToken?"success":"failure",r,n.failureKind??"","exception"in n?n.exception:void 0)}))},r),typeof this.refreshTimer=="object"&&"unref"in this.refreshTimer&&this.refreshTimer.unref())}clearRefreshTimer(){this.refreshTimer!==void 0&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}startTokenRefresh(e){let r,n=this.getGitHubSession().then(async o=>o?(r=o.login,await this.fetchTokenResult(o)):{failureKind:"NotSignedIn"}).catch(o=>{let s=o instanceof Error?o:new Error(String(o));return Zg.exception(this.ctx,s,"tokenRefresh"),{failureKind:"Exception",message:String(o),exception:s}}).then(o=>(this.tokenPromise!==n||(this.tokenPromise=void 0,o.copilotToken&&(this.ctx.get(ss).forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(o.copilotToken),this.didChangeTokenResult.fire(o)),e?.(o)),o));this.tokenPromise=n}async getTokenResult(){if(!this.primed){let r=new Error("Token requested before initialization");if(ZJr(this.ctx))throw this.tokenPrimingError=r,r;Zg.exception(this.ctx,r,".getToken")}if(this.activeToken!==void 0&&!this.activeToken.needsRefresh())return{copilotToken:this.activeToken};if(!this.tokenPromise){let r,n=this.captureFetchContext(),o=this.getGitHubSession().then(async s=>s?(r=s.login,await this.fetchTokenResult(s)):{failureKind:"NotSignedIn"}).catch(s=>{if(!(s instanceof Error))throw s;return{failureKind:"Exception",message:String(s),exception:s}}).then(s=>(this.tokenPromise!==o||(this.tokenPromise=void 0,this.handleTokenResult(s,r,n)),s));this.tokenPromise=o}return await this.tokenPromise}handleTokenResult(e,r,n){let o=this.ctx.get(ss);switch(e.failureKind){case"NotSignedIn":o.setError("auth",{message:"You are not signed into GitHub.",askToReSignin:!1,result:{status:"NotSignedIn",user:r}});break;case"HTTP401":o.setError("auth",{message:"Your GitHub Copilot session has expired. You have been signed out. Please sign in again to continue using GitHub Copilot.",askToReSignin:!0,result:{status:"NotSignedIn",user:r}},{command:"github.copilot.signIn",title:"Sign In"}),this.cascadeRevokeActiveToken();break;case"NotAuthorized":o.setError("auth",{message:e.message,askToReSignin:!1,result:{status:"NotAuthorized",user:r??""}});break;case"Exception":o.setWarning("auth",{message:e.message,askToReSignin:!1,result:{status:"NotSignedIn",user:r}}),this.ctx.get(sC).notifyUser(this.ctx,e.exception);break;case void 0:o.forceNormal("auth",{result:{status:"OK",user:r??""}}),this.setToken(e.copilotToken)}this.didChangeTokenResult.fire(e);let s={result:e.copilotToken?"success":"failure",errorCode:e.failureKind??"",trigger:n?.trigger??"unknown",editorPreviewEnabled:e.copilotToken?e.copilotToken.getTokenValue("editor_preview_features")==="0"?"false":"true":""},c=W9(),l={previousRemainingLifetime:n?.previousRemainingLifetime??-1,previousUnadjustedRemainingLifetime:n?.previousUnadjustedRemainingLifetime??-1,newRefreshIn:e.copilotToken?.envelope.refresh_in??-1,newRemainingLifetime:e.copilotToken?e.copilotToken.expiresAt-c:-1,newUnadjustedRemainingLifetime:e.copilotToken?e.copilotToken.envelope.expires_at-c:-1};"exception"in e&&e.exception?si(this.ctx,"auth.token_reset_complete",e.exception,s,l):_t(this.ctx,"auth.token_reset_complete",s,l)}captureFetchContext(){let e=this.activeToken??this.lastToken,r=this.lastToken===void 0?"initial":this.activeToken===void 0?"after_reset":"expiry",n=W9(),o=e?e.expiresAt-n:-1,s=e?e.envelope.expires_at-n:-1;return{trigger:r,previousRemainingLifetime:o,previousUnadjustedRemainingLifetime:s}}async getToken(){let e=await this.getTokenResult();if(e.copilotToken)return e.copilotToken;throw e.exception?e.exception:new WNt(e)}setActiveTokenId(e){if(this.activeTokenId===e)return;let r=this.activeTokenId;this.activeTokenId=e,r!==void 0&&this.activeToken&&this.resetToken("active_token_id_changed")}getActiveTokenId(){return this.activeTokenId}cascadeRevokeActiveToken(){let e=this.activeTokenId;e!==void 0&&(this.activeTokenId=void 0,this.pendingCascadeRevoke=this.ctx.get(Fr).revokeTokenById(e,"bad_credentials").then(r=>{Zg.debug(this.ctx,`cascadeRevoke: revoked tokenId ${e}, affectedEditors=${r.affectedEditors}`)}).catch(r=>{Zg.exception(this.ctx,r,"cascadeRevoke")}))}async awaitPendingCascadeRevoke(){await this.pendingCascadeRevoke}resetToken(e,r,n){if(n!==void 0&&this.activeTokenId!==void 0&&n!==this.activeTokenId){Zg.debug(this.ctx,`Skipping token reset from ${e} for tokenId ${n} because activeTokenId is ${this.activeTokenId}`);return}r!==void 0?(yt(this.ctx,"auth.reset_token_"+r),Zg.debug(this.ctx,`Resetting copilot token on HTTP error ${r} (caller: ${e})`)):Zg.debug(this.ctx,`Resetting copilot token (caller: ${e})`);let o=W9(),s=this.activeToken?this.activeToken.expiresAt-o:-1,c=this.activeToken?this.activeToken.envelope.expires_at-o:-1;_t(this.ctx,"auth.token_reset_trigger",{caller:e,httpStatus:r!==void 0?String(r):"",hadActiveToken:String(!!this.activeToken),hadPendingRefresh:String(!!this.tokenPromise)},{remainingLifetime:s,unadjustedRemainingLifetime:c}),!(!this.activeToken&&!this.tokenPromise)&&(this.clearRefreshTimer(),this.activeToken=void 0,this.tokenPromise=void 0,this.didResetToken.fire())}getLastToken(){return this.lastToken}};function MI(t){return t.get(Ut).getLastToken()}a(MI,"getLastCopilotToken");function TQe(t,e,r,n,o){let s={status:e,errorCode:n??""},c={delayMs:r};o?si(t,"auth.proactive_copilot_token_refresh",o,s,c):_t(t,"auth.proactive_copilot_token_refresh",s,c)}a(TQe,"telemetryProactiveCopilotTokenRefresh");p();var oM=class{static{a(this,"Clock")}now(){return new Date}};p();var LP=class{static{a(this,"ExpConfigMaker")}},xbe=class extends LP{constructor(r={}){super();this.defaultFilters=r}static{a(this,"ExpConfigFromTAS")}async fetchExperiments(r,n,o){let s=r.get(cr),c=Object.keys(o).length===0?this.defaultFilters:o,l=new URL("telemetry",n.telemetry).href,u;try{u=await s.fetch(l,{method:"GET",headers:c,timeout:5e3})}catch(m){return qv.createFallbackConfig(r,`Error fetching ExP config: ${String(m)}`)}if(!u.ok)return qv.createFallbackConfig(r,`ExP responded with ${u.status}`);let d;try{d=await u.json()}catch(m){if(m instanceof SyntaxError)return La(r,m,"fetchExperiments"),qv.createFallbackConfig(r,"ExP responded with invalid JSON");throw m}let f=d.Configs.find(m=>m.Id==="vscode")??{Id:"vscode",Parameters:{}},h=Object.entries(f.Parameters).map(([m,g])=>m+(g?"":"cf"));return new qv(f.Parameters,d.AssignmentContext,h.join(";"))}},IQe=class extends LP{static{a(this,"ExpConfigNone")}fetchExperiments(){return Promise.resolve(qv.createEmptyConfig())}};p();p();var xQe=class{constructor(e){this.prefix=e}static{a(this,"GranularityImplementation")}getCurrentAndUpComingValues(e){let r=this.getValue(e),n=this.getUpcomingValues(e);return[r,n]}},zNt=class extends xQe{static{a(this,"ConstantGranularity")}getValue(e){return this.prefix}getUpcomingValues(e){return[]}},eZr=a(t=>new zNt(t),"DEFAULT_GRANULARITY"),wQe=class extends xQe{constructor(r,n=.5,o=new Date().setUTCHours(0,0,0,0)){super(r);this.prefix=r;this.fetchBeforeFactor=n;this.anchor=o}static{a(this,"TimeBucketGranularity")}setTimePeriod(r){isNaN(r)?this.timePeriodLengthMs=void 0:this.timePeriodLengthMs=r}setByCallBuckets(r){isNaN(r)?this.numByCallBuckets=void 0:this.numByCallBuckets=r}getValue(r){return this.prefix+this.getTimePeriodBucketString(r)+(this.numByCallBuckets?this.timeHash(r):"")}getTimePeriodBucketString(r){return this.timePeriodLengthMs?this.dateToTimePartString(r):""}getUpcomingValues(r){let n=[],o=this.getUpcomingTimePeriodBucketStrings(r),s=this.getUpcomingByCallBucketStrings();for(let c of o)for(let l of s)n.push(this.prefix+c+l);return n}getUpcomingTimePeriodBucketStrings(r){if(this.timePeriodLengthMs===void 0)return[""];if((r.getTime()-this.anchor)%this.timePeriodLengthMsr.toString())}timeHash(r){return this.numByCallBuckets==null?0:7883*(r.getTime()%this.numByCallBuckets)%this.numByCallBuckets}dateToTimePartString(r){return this.timePeriodLengthMs==null?"":Math.floor((r.getTime()-this.anchor)/this.timePeriodLengthMs).toString()}};var tZr="X-Copilot-ClientTimeBucket",RQe=class{constructor(e,r){this.specs=new Map;this.prefix=e,this.clock=r,this.defaultGranularity=eZr(e)}static{a(this,"GranularityDirectory")}selectGranularity(e){for(let[r,n]of this.specs.entries())if(e.extends(r))return n;return this.defaultGranularity}update(e,r,n){if(r=r>1?r:NaN,n=n>0?n:NaN,isNaN(r)&&isNaN(n))this.specs.delete(e);else{let o=new wQe(this.prefix);isNaN(r)||o.setByCallBuckets(r),isNaN(n)||o.setTimePeriod(n*3600*1e3),this.specs.set(e,o)}}extendFilters(e){let r=this.selectGranularity(e),[n,o]=r.getCurrentAndUpComingValues(this.clock.now());return{newFilterSettings:e.withChange(tZr,n),otherFilterSettingsToPrefetch:o.map(s=>e.withChange(tZr,s))}}};p();p();p();p();var YNt=new Map;async function gyo(t){if(YNt.has(t))return YNt.get(t);let e=await crypto.subtle.importKey("raw",new TextEncoder().encode(t),{name:"HMAC",hash:"SHA-256"},!1,["sign"]);return YNt.set(t,e),e}a(gyo,"getCachedHmacKey");async function Ayo(t){if(t)try{let e=await gyo(t),r=Math.floor(Date.now()/1e3).toString(),n=new TextEncoder().encode(r),o=await crypto.subtle.sign("HMAC",e,n),c=Array.from(new Uint8Array(o)).map(l=>l.toString(16).padStart(2,"0")).join("");return`${r}.${c}`}catch{return}}a(Ayo,"createRequestHMAC");async function rZr(t,e){let r=await Ayo(t);return r?{"Request-Hmac":r,"Copilot-Integration-Id":e??"jetbrains-chat-dev"}:{}}a(rZr,"createMsBenchHmacHeaders");p();p();p();p();var kQe="4.13.1",az="04b07795-8ddb-461a-bbee-02f9e1bf7b46",nZr="common",PQe;(function(t){t.AzureChina="https://login.chinacloudapi.cn",t.AzureGermany="https://login.microsoftonline.de",t.AzureGovernment="https://login.microsoftonline.us",t.AzurePublicCloud="https://login.microsoftonline.com"})(PQe||(PQe={}));var wbe=PQe.AzurePublicCloud,iZr="login.microsoftonline.com",oZr=["*"],sZr="cae",aZr="nocae",cZr="msal.cache";var KNt;var yyo,DQe,uZr;function dZr(){return DQe!==void 0&&uZr!==void 0}a(dZr,"hasVSCodePlugin");function Eyo(t){let e={cache:{},broker:{...t.brokerOptions,isEnabled:t.brokerOptions?.enabled??!1,enableMsaPassthrough:t.brokerOptions?.legacyEnableMsaPassthrough??!1}};if(t.tokenCachePersistenceOptions?.enabled){if(KNt===void 0)throw new Error(["Persistent token caching was requested, but no persistence provider was configured.","You must install the identity-cache-persistence plugin package (`npm install --save @azure/identity-cache-persistence`)","and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling","`useIdentityPlugin(cachePersistencePlugin)` before using `tokenCachePersistenceOptions`."].join(" "));let r=t.tokenCachePersistenceOptions.name||cZr;e.cache.cachePlugin=KNt({name:`${r}.${aZr}`,...t.tokenCachePersistenceOptions}),e.cache.cachePluginCae=KNt({name:`${r}.${sZr}`,...t.tokenCachePersistenceOptions})}return t.brokerOptions?.enabled&&(e.broker.nativeBrokerPlugin=vyo(t.isVSCodeCredential||!1)),e}a(Eyo,"generatePluginConfiguration");var lZr={missing:a((t,e,r)=>[`${t} was requested, but no plugin was configured or no authentication record was found.`,`You must install the ${e} plugin package (npm install --save ${e})`,"and enable it by importing `useIdentityPlugin` from `@azure/identity` and calling",`useIdentityPlugin(${r}) before using enableBroker.`].join(" "),"missing"),unavailable:a((t,e)=>[`${t} was requested, and the plugin is configured, but the broker is unavailable.`,`Ensure the ${t} plugin is properly installed and configured.`,"Check for missing native dependencies and ensure the package is properly installed.",`See the README for prerequisites on installing and using ${e}.`].join(" "),"unavailable")},_yo={vsCode:{credentialName:"Visual Studio Code Credential",packageName:"@azure/identity-vscode",pluginVar:"vsCodePlugin",get brokerInfo(){return uZr}},native:{credentialName:"Broker for WAM",packageName:"@azure/identity-broker",pluginVar:"nativeBrokerPlugin",get brokerInfo(){return yyo}}};function vyo(t){let{credentialName:e,packageName:r,pluginVar:n,brokerInfo:o}=_yo[t?"vsCode":"native"];if(o===void 0)throw new Error(lZr.missing(e,r,n));if(o.broker.isBrokerAvailable===!1)throw new Error(lZr.unavailable(e,r));return o.broker}a(vyo,"getBrokerPlugin");var fZr={generatePluginConfiguration:Eyo};p();p();p();function Cyo(t){return t&&typeof t.error=="string"&&typeof t.error_description=="string"}a(Cyo,"isErrorResponse");var hZr="CredentialUnavailableError",Nn=class extends Error{static{a(this,"CredentialUnavailableError")}constructor(e,r){super(e,r),this.name=hZr}},NQe="AuthenticationError",YU=class extends Error{static{a(this,"AuthenticationError")}statusCode;errorResponse;constructor(e,r,n){let o={error:"unknown",errorDescription:"An unknown error occurred and no additional details are available."};if(Cyo(r))o=pZr(r);else if(typeof r=="string")try{let s=JSON.parse(r);o=pZr(s)}catch{e===400?o={error:"invalid_request",errorDescription:`The service indicated that the request was invalid. ${r}`}:o={error:"unknown_error",errorDescription:`An unknown error has occurred. Response body: ${r}`}}else o={error:"unknown_error",errorDescription:"An unknown error occurred and no additional details are available."};super(`${o.error} Status code: ${e} More details: -${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=WQe}},LZr="AggregateAuthenticationError",Qbe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` +${o.errorDescription},`,n),this.statusCode=e,this.errorResponse=o,this.name=NQe}},mZr="AggregateAuthenticationError",Rbe=class extends Error{static{a(this,"AggregateAuthenticationError")}errors;constructor(e,r){let n=e.join(` `);super(`${r} -${n}`),this.errors=e,this.name=LZr}};function OZr(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(OZr,"convertOAuthErrorResponseToErrorResponse");var nx=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var FZr=require("node:os"),UZr=ce(require("node:util"),1),QZr=ce(require("node:process"),1);function qZr(t,...e){QZr.stderr.write(`${UZr.default.format(t,...e)}${FZr.EOL}`)}a(qZr,"log");var jZr=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,HZr,lMt=[],uMt=[],zQe=[];jZr&&dMt(jZr);var GZr=Object.assign(t=>$Zr(t),{enable:dMt,enabled:fMt,disable:kyo,log:qZr});function dMt(t){HZr=t,lMt=[],uMt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?uMt.push(new RegExp(`^${n.substr(1)}$`)):lMt.push(new RegExp(`^${n}$`));for(let n of zQe)n.enabled=fMt(n.namespace)}a(dMt,"enable");function fMt(t){if(t.endsWith("*"))return!0;for(let e of uMt)if(e.test(t))return!1;for(let e of lMt)if(e.test(t))return!0;return!1}a(fMt,"enabled");function kyo(){let t=HZr||"";return dMt(""),t}a(kyo,"disable");function $Zr(t){let e=Object.assign(r,{enabled:fMt(t),destroy:Pyo,log:GZr.log,namespace:t,extend:Dyo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),zQe.push(e),e}a($Zr,"createDebugger");function Pyo(){let t=zQe.indexOf(this);return t>=0?(zQe.splice(t,1),!0):!1}a(Pyo,"destroy");function Dyo(t){let e=$Zr(`${this.namespace}:${t}`);return e.log=this.log,e}a(Dyo,"extend");var Yse=GZr;var WZr=new Set,YQe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,JQe,pMt=Yse("azure");pMt.log=(...t)=>{Yse.log(...t)};var hMt=["verbose","info","warning","error"];YQe&&(KZr(YQe)?Nyo(YQe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${YQe}'; logging is not enabled. Acceptable values: ${hMt.join(", ")}.`));function Nyo(t){if(t&&!KZr(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${hMt.join(",")}`);JQe=t;let e=[];for(let r of WZr)YZr(r)&&e.push(r.namespace);Yse.enable(e.join(","))}a(Nyo,"setLogLevel");function ZQe(){return JQe}a(ZQe,"getLogLevel");var VZr={verbose:400,info:300,warning:200,error:100};function t7(t){let e=pMt.extend(t);return zZr(pMt,e),{error:KQe(e,"error"),warning:KQe(e,"warning"),info:KQe(e,"info"),verbose:KQe(e,"verbose")}}a(t7,"createClientLogger");function zZr(t,e){e.log=(...r)=>{t.log(...r)}}a(zZr,"patchLogMethod");function KQe(t,e){let r=Object.assign(t.extend(e),{level:e});if(zZr(t,r),YZr(r)){let n=Yse.disable();Yse.enable(n+","+r.namespace)}return WZr.add(r),r}a(KQe,"createLogger");function YZr(t){return!!(JQe&&VZr[t.level]<=VZr[JQe])}a(YZr,"shouldEnable");function KZr(t){return hMt.includes(t)}a(KZr,"isAzureLogLevel");var tS=t7("identity");function XQe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(XQe,"processEnvVars");function q0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(q0,"formatSuccess");function Os(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a(Os,"formatError");function JZr(t,e,r=tS){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(JZr,"credentialLoggerInstance");function lo(t,e=tS){let r=JZr(t,void 0,e);return{...r,parent:e,getToken:JZr("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var Kse={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function ZZr(t={}){let e=new mMt(t.parentContext);return t.span&&(e=e.setValue(Kse.span,t.span)),t.namespace&&(e=e.setValue(Kse.namespace,t.namespace)),e}a(ZZr,"createTracingContext");var mMt=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var XZr=ce(gMt(),1),tqe=XZr.state;function Myo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(Myo,"createDefaultTracingSpan");function Oyo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:Myo(),tracingContext:ZZr({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(Oyo,"createDefaultInstrumenter");function qbe(){return tqe.instrumenterImplementation||(tqe.instrumenterImplementation=Oyo()),tqe.instrumenterImplementation}a(qbe,"getInstrumenter");p();function jbe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=qbe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(Kse.namespace)||(A=A.setValue(Kse.namespace,e)),y.setAttribute("az.namespace",A.getValue(Kse.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return qbe().withContext(d,f,...h)}a(c,"withContext");function l(d){return qbe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return qbe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(jbe,"createTracingClient");var Nc=jbe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:$Qe});var AMt=lo("ChainedTokenCredential"),Hbe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return Nc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new Qbe(s,"ChainedTokenCredential authentication failed.");throw AMt.getToken.info(Os(e,l)),l}if(AMt.getToken.info(`Result for ${o.constructor.name}: ${q0(e)}`),n===null)throw new Dn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var aS={};wi(aS,{AuthError:()=>Bo,AuthErrorCodes:()=>Aae,AzureCloudInstance:()=>wL,ClientAssertion:()=>NL,ClientAuthError:()=>o7,ClientAuthErrorCodes:()=>Np,ClientConfigurationError:()=>iae,ClientConfigurationErrorCodes:()=>sae,ConfidentialClientApplication:()=>Mae,CryptoProvider:()=>gM,DistributedCachePlugin:()=>Uje,InteractionRequiredAuthError:()=>iS,InteractionRequiredAuthErrorCodes:()=>Bqe,LogLevel:()=>sf,Logger:()=>H0,ManagedIdentityApplication:()=>Oae,ManagedIdentitySourceNames:()=>io,PromptValue:()=>IIo,ProtocolMode:()=>Dy,PublicClientApplication:()=>Dae,ResponseMode:()=>xIo,ServerError:()=>f_,TokenCache:()=>_ae,TokenCacheContext:()=>rS,internals:()=>G5t,version:()=>sS});p();var G5t={};wi(G5t,{Deserializer:()=>PL,Serializer:()=>r7});p();p();var r7=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var sn={};wi(sn,{addApplicationTelemetry:()=>n1e,addAuthorizationCode:()=>y5t,addBrokerParameters:()=>xL,addCcsOid:()=>TL,addCcsUpn:()=>s7,addClaims:()=>xz,addCliData:()=>C5t,addClientAssertion:()=>s1e,addClientAssertionType:()=>a1e,addClientCapabilitiesToClaims:()=>iXr,addClientId:()=>Tz,addClientInfo:()=>Rz,addClientSecret:()=>o1e,addCodeChallengeParams:()=>qEo,addCodeVerifier:()=>_5t,addCorrelationId:()=>wz,addDeviceCode:()=>jEo,addDomainHint:()=>m5t,addEARParameters:()=>WEo,addExtraParameters:()=>IL,addGrantType:()=>c1e,addIdTokenHint:()=>h5t,addInstanceAware:()=>l1e,addLibraryInfo:()=>r1e,addLoginHint:()=>cae,addLogoutHint:()=>v5t,addNativeBroker:()=>QEo,addNonce:()=>A5t,addOboAssertion:()=>HEo,addPassword:()=>VEo,addPopToken:()=>u1e,addPostLogoutRedirectUri:()=>p5t,addPrompt:()=>g5t,addRedirectUri:()=>Iz,addRefreshToken:()=>E5t,addRequestTokenUse:()=>GEo,addResource:()=>h1e,addResponseMode:()=>f5t,addResponseType:()=>UEo,addScopes:()=>Sz,addServerTelemetry:()=>f1e,addSid:()=>Tqe,addSshJwk:()=>d1e,addState:()=>i1e,addThrottling:()=>p1e,addUsername:()=>$Eo,instrumentBrokerParams:()=>bz});p();var Xt={};wi(Xt,{AADAuthority:()=>qk,AAD_INSTANCE_DISCOVERY_ENDPT:()=>vMt,AAD_TENANT_DOMAIN_SUFFIX:()=>bMt,ADFS:()=>_Mt,APP_METADATA:()=>tae,AUTHORITY_METADATA_CACHE_KEY:()=>rae,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>UMt,AUTHORIZATION_PENDING:()=>Uyo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>xMt,AuthenticationScheme:()=>of,AuthorityMetadataSource:()=>Py,CACHE_ACCOUNT_TYPE_ADFS:()=>LMt,CACHE_ACCOUNT_TYPE_GENERIC:()=>lqe,CACHE_ACCOUNT_TYPE_MSAV1:()=>iEo,CACHE_ACCOUNT_TYPE_MSSTS:()=>BMt,CACHE_KEY_SEPARATOR:()=>yz,CIAM_AUTH_URL:()=>rqe,CLIENT_INFO:()=>FMt,CLIENT_INFO_SEPARATOR:()=>eae,CLIENT_MISMATCH_ERROR:()=>YMt,CODE_GRANT_TYPE:()=>Lyo,CONSUMER_UTID:()=>Byo,CacheOutcome:()=>jk,CacheType:()=>oEo,ClaimsRequestKeys:()=>Xse,CodeChallengeMethodValues:()=>rEo,CredentialType:()=>j0,DEFAULT_AUTHORITY:()=>eXr,DEFAULT_AUTHORITY_HOST:()=>EMt,DEFAULT_COMMON_TENANT:()=>Gbe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>VMt,DEFAULT_THROTTLE_TIME_SECONDS:()=>$Mt,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>KMt,DSTS:()=>CMt,EMAIL_SCOPE:()=>nXr,EncodingTypes:()=>lEo,FORWARD_SLASH:()=>Jse,GrantType:()=>Wbe,HTTP_BAD_REQUEST:()=>aqe,HTTP_CLIENT_ERROR:()=>Gyo,HTTP_CLIENT_ERROR_RANGE_END:()=>DMt,HTTP_CLIENT_ERROR_RANGE_START:()=>PMt,HTTP_GATEWAY_TIMEOUT:()=>Zyo,HTTP_GONE:()=>zyo,HTTP_MULTI_SIDED_ERROR:()=>Xyo,HTTP_NOT_FOUND:()=>Vyo,HTTP_REDIRECT:()=>Hyo,HTTP_REQUEST_TIMEOUT:()=>Wyo,HTTP_SERVER_ERROR:()=>Kyo,HTTP_SERVER_ERROR_RANGE_END:()=>MMt,HTTP_SERVER_ERROR_RANGE_START:()=>NMt,HTTP_SERVICE_UNAVAILABLE:()=>Jyo,HTTP_SUCCESS:()=>sqe,HTTP_SUCCESS_RANGE_END:()=>jyo,HTTP_SUCCESS_RANGE_START:()=>qyo,HTTP_TOO_MANY_REQUESTS:()=>Yyo,HTTP_UNAUTHORIZED:()=>$yo,HeaderNames:()=>Dp,HttpMethod:()=>eEo,IMDS_ENDPOINT:()=>oqe,IMDS_TIMEOUT:()=>IMt,IMDS_VERSION:()=>TMt,INVALID_GRANT_ERROR:()=>zMt,INVALID_INSTANCE:()=>kMt,JsonWebTokenTypes:()=>aEo,KNOWN_PUBLIC_CLOUDS:()=>RMt,NOT_APPLICABLE:()=>$be,NOT_AVAILABLE:()=>Az,OAuthResponseType:()=>nEo,OFFLINE_ACCESS_SCOPE:()=>iqe,OIDC_DEFAULT_SCOPES:()=>Zse,OIDC_SCOPES:()=>cqe,ONE_DAY_IN_MS:()=>cEo,OPENID_SCOPE:()=>tXr,PROFILE_SCOPE:()=>rXr,PasswordGrantConstants:()=>fqe,PersistentCacheKeys:()=>tEo,PromptValue:()=>Vbe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>wMt,RESOURCE_DELIM:()=>nqe,RegionDiscoveryOutcomes:()=>Kbe,RegionDiscoverySources:()=>i7,ResponseMode:()=>OMt,S256_CODE_CHALLENGE_METHOD:()=>Fyo,SERVER_TELEM_CACHE_KEY:()=>zbe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>dqe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>qMt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>sEo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>QMt,SERVER_TELEM_OVERFLOW_FALSE:()=>HMt,SERVER_TELEM_OVERFLOW_TRUE:()=>jMt,SERVER_TELEM_SCHEMA_VERSION:()=>uqe,SERVER_TELEM_UNKNOWN_ERROR:()=>GMt,SERVER_TELEM_VALUE_SEPARATOR:()=>n7,SHR_NONCE_VALIDITY:()=>Qyo,SKU:()=>yMt,THE_FAMILY_ID:()=>Ez,THROTTLING_PREFIX:()=>Ybe,URL_FORM_CONTENT_TYPE:()=>SMt,X_MS_LIB_CAPABILITY_VALUE:()=>WMt});p();var yMt="msal.js.common",eXr="https://login.microsoftonline.com/common/",EMt="login.microsoftonline.com",Gbe="common",_Mt="adfs",CMt="dstsv2",vMt=`${eXr}discovery/instance?api-version=1.1&authorization_endpoint=`,rqe=".ciamlogin.com",bMt=".onmicrosoft.com",nqe="|",Byo="9188040d-6c67-4c5b-b112-36a304b66dad",tXr="openid",rXr="profile",iqe="offline_access",nXr="email",Lyo="authorization_code",Fyo="S256",SMt="application/x-www-form-urlencoded;charset=utf-8",Uyo="authorization_pending",$be="N/A",Az="Not Available",Jse="/",oqe="http://169.254.169.254/metadata/instance/compute/location",TMt="2020-06-01",IMt=2e3,xMt="TryAutoDetect",wMt="login.microsoft.com",RMt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],Qyo=240,kMt="invalid_instance",sqe=200,qyo=200,jyo=299,Hyo=302,Gyo=400,PMt=400,aqe=400,$yo=401,Vyo=404,Wyo=408,zyo=410,Yyo=429,DMt=499,Kyo=500,NMt=500,Jyo=503,Zyo=504,MMt=599,Xyo=600,eEo={GET:"GET",POST:"POST"},Zse=[tXr,rXr,iqe],cqe=[...Zse,nXr],Dp={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},tEo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},qk={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Xse={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Vbe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},rEo={PLAIN:"plain",S256:"S256"},nEo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},OMt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Wbe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},BMt="MSSTS",LMt="ADFS",iEo="MSA",lqe="Generic",yz="-",eae=".",j0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},oEo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},tae="appmetadata",FMt="client_info",Ez="1",rae="authority-metadata",UMt=3600*24,Py={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},uqe=5,sEo=80,QMt=330,qMt=50,zbe="server-telemetry",dqe="|",n7=",",jMt="1",HMt="0",GMt="unknown_error",of={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},$Mt=60,VMt=3600,Ybe="throttling",WMt="retry-after, h429",zMt="invalid_grant",YMt="client_mismatch",fqe={username:"username",password:"password"},i7={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Kbe={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},jk={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},aEo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},cEo=864e5,KMt=300,lEo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var _z={};wi(_z,{ACCESS_TOKEN:()=>fEo,BROKER_CLIENT_ID:()=>Jbe,BROKER_REDIRECT_URI:()=>Aqe,CCS_HEADER:()=>_Eo,CLAIMS:()=>eOt,CLIENT_ASSERTION:()=>SOt,CLIENT_ASSERTION_TYPE:()=>TOt,CLIENT_ID:()=>fM,CLIENT_INFO:()=>AEo,CLIENT_REQUEST_ID:()=>uOt,CLIENT_SECRET:()=>bOt,CLI_DATA:()=>BOt,CODE:()=>sOt,CODE_CHALLENGE:()=>aOt,CODE_CHALLENGE_METHOD:()=>cOt,CODE_VERIFIER:()=>lOt,DEVICE_CODE:()=>vOt,DOMAIN_HINT:()=>DOt,EAR_JWE_CRYPTO:()=>MOt,EAR_JWK:()=>NOt,ERROR:()=>uEo,ERROR_DESCRIPTION:()=>dEo,EXPIRES_IN:()=>hEo,FOCI:()=>EEo,GRANT_TYPE:()=>XMt,ID_TOKEN:()=>pEo,ID_TOKEN_HINT:()=>COt,INSTANCE_AWARE:()=>nae,LOGIN_HINT:()=>POt,LOGOUT_HINT:()=>ROt,NATIVE_BROKER:()=>wOt,NONCE:()=>iOt,OBO_ASSERTION:()=>IOt,ON_BEHALF_OF:()=>yEo,POST_LOGOUT_URI:()=>_Ot,PROMPT:()=>oOt,REDIRECT_URI:()=>pqe,REFRESH_TOKEN:()=>rOt,REFRESH_TOKEN_EXPIRES_IN:()=>mEo,REQUESTED_TOKEN_USE:()=>xOt,REQ_CNF:()=>mqe,RESOURCE:()=>OOt,RESPONSE_MODE:()=>ZMt,RESPONSE_TYPE:()=>JMt,RETURN_SPA_CODE:()=>gqe,SCOPE:()=>tOt,SESSION_STATE:()=>gEo,SID:()=>kOt,STATE:()=>nOt,TOKEN_TYPE:()=>hqe,X_APP_NAME:()=>yOt,X_APP_VER:()=>EOt,X_CLIENT_CPU:()=>hOt,X_CLIENT_CURR_TELEM:()=>mOt,X_CLIENT_EXTRA_SKU:()=>CEo,X_CLIENT_LAST_TELEM:()=>gOt,X_CLIENT_OS:()=>pOt,X_CLIENT_SKU:()=>dOt,X_CLIENT_VER:()=>fOt,X_MS_LIB_CAPABILITY:()=>AOt});p();var fM="client_id",pqe="redirect_uri",JMt="response_type",ZMt="response_mode",XMt="grant_type",eOt="claims",tOt="scope",uEo="error",dEo="error_description",fEo="access_token",pEo="id_token",rOt="refresh_token",hEo="expires_in",mEo="refresh_token_expires_in",nOt="state",iOt="nonce",oOt="prompt",gEo="session_state",AEo="client_info",sOt="code",aOt="code_challenge",cOt="code_challenge_method",lOt="code_verifier",uOt="client-request-id",dOt="x-client-SKU",fOt="x-client-VER",pOt="x-client-OS",hOt="x-client-CPU",mOt="x-client-current-telemetry",gOt="x-client-last-telemetry",AOt="x-ms-lib-capability",yOt="x-app-name",EOt="x-app-ver",_Ot="post_logout_redirect_uri",COt="id_token_hint",vOt="device_code",bOt="client_secret",SOt="client_assertion",TOt="client_assertion_type",hqe="token_type",mqe="req_cnf",IOt="assertion",xOt="requested_token_use",yEo="on_behalf_of",EEo="foci",_Eo="X-AnchorMailbox",gqe="return_spa_code",wOt="nativebroker",ROt="logout_hint",kOt="sid",POt="login_hint",DOt="domain_hint",CEo="x-client-xtra-sku",Jbe="brk_client_id",Aqe="brk_redirect_uri",nae="instance_aware",NOt="ear_jwk",MOt="ear_jwe_crypto",OOt="resource",BOt="clidata";p();p();p();function yqe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(yqe,"getDefaultErrorMessage");var Bo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?yqe(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function Cz(t,e){return new Bo(t,e||yqe(t))}a(Cz,"createAuthError");var iae=class t extends Bo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function gl(t){return new iae(t)}a(gl,"createClientConfigurationError");p();var su=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var o7=class t extends Bo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function wt(t,e){return new o7(t,e)}a(wt,"createClientAuthError");var sae={};wi(sae,{authorityMismatch:()=>REo,authorityUriInsecure:()=>FOt,cannotAllowPlatformBroker:()=>wEo,cannotSetOIDCOptions:()=>xEo,claimsRequestParsingError:()=>vEo,emptyInputScopesError:()=>QOt,invalidAuthenticationHeader:()=>IEo,invalidAuthorityMetadata:()=>GOt,invalidClaims:()=>Eqe,invalidCloudDiscoveryMetadata:()=>_qe,invalidCodeChallengeMethod:()=>bEo,invalidRequestMethodForEAR:()=>kEo,logoutRequestEmpty:()=>jOt,missingNonceAuthenticationHeader:()=>TEo,missingSshJwk:()=>Zbe,missingSshKid:()=>SEo,pkceParamsMissing:()=>HOt,redirectUriEmpty:()=>LOt,tokenRequestEmpty:()=>qOt,untrustedAuthority:()=>$Ot,urlEmptyError:()=>UOt,urlParseError:()=>oae});p();var LOt="redirect_uri_empty",vEo="claims_request_parsing_error",FOt="authority_uri_insecure",oae="url_parse_error",UOt="empty_url_error",QOt="empty_input_scopes_error",Eqe="invalid_claims",qOt="token_request_empty",jOt="logout_request_empty",bEo="invalid_code_challenge_method",HOt="pkce_params_missing",_qe="invalid_cloud_discovery_metadata",GOt="invalid_authority_metadata",$Ot="untrusted_authority",Zbe="missing_ssh_jwk",SEo="missing_ssh_kid",TEo="missing_nonce_authentication_header",IEo="invalid_authentication_header",xEo="cannot_set_OIDCOptions",wEo="cannot_allow_platform_broker",REo="authority_mismatch",kEo="invalid_request_method_for_EAR";var Np={};wi(Np,{authTimeNotFound:()=>Xbe,authorizationCodeMissingFromServerResponse:()=>a5t,bindingKeyNotRemoved:()=>MEo,cannotAppendScopeSet:()=>n5t,cannotRemoveEmptyScope:()=>r5t,clientInfoDecodingError:()=>Cqe,clientInfoEmptyError:()=>VOt,emptyInputScopeSet:()=>Sqe,endSessionEndpointNotSupported:()=>c5t,endpointResolutionError:()=>Hk,hashNotDeserialized:()=>KOt,invalidCacheEnvironment:()=>t1e,invalidCacheRecord:()=>i5t,invalidState:()=>vz,keyIdMissing:()=>l5t,maxAgeTranspired:()=>XOt,methodNotImplemented:()=>vs,misplacedResourceParam:()=>d5t,multipleMatchingAppMetadata:()=>e5t,multipleMatchingTokens:()=>PEo,nestedAppAuthBridgeDisabled:()=>LEo,networkError:()=>zOt,noAccountFound:()=>DEo,noAccountInSilentRequest:()=>e1e,noCryptoObject:()=>o5t,noNetworkConnectivity:()=>OEo,nonceMismatch:()=>ZOt,nullOrEmptyToken:()=>WOt,openIdConfigError:()=>YOt,platformBrokerError:()=>FEo,requestCannotBeMade:()=>t5t,resourceParameterRequired:()=>u5t,stateMismatch:()=>JOt,stateNotFound:()=>bqe,tokenClaimsCnfRequiredForSignedJwt:()=>s5t,tokenParsingError:()=>vqe,tokenRefreshRequired:()=>aae,unexpectedCredentialType:()=>NEo,userCanceled:()=>BEo});p();var Cqe="client_info_decoding_error",VOt="client_info_empty_error",vqe="token_parsing_error",WOt="null_or_empty_token",Hk="endpoints_resolution_error",zOt="network_error",YOt="openid_config_error",KOt="hash_not_deserialized",vz="invalid_state",JOt="state_mismatch",bqe="state_not_found",ZOt="nonce_mismatch",Xbe="auth_time_not_found",XOt="max_age_transpired",PEo="multiple_matching_tokens",e5t="multiple_matching_appMetadata",t5t="request_cannot_be_made",r5t="cannot_remove_empty_scope",n5t="cannot_append_scopeset",Sqe="empty_input_scopeset",e1e="no_account_in_silent_request",i5t="invalid_cache_record",t1e="invalid_cache_environment",DEo="no_account_found",o5t="no_crypto_object",NEo="unexpected_credential_type",aae="token_refresh_required",s5t="token_claims_cnf_required_for_signedjwt",a5t="authorization_code_missing_from_server_response",MEo="binding_key_not_removed",c5t="end_session_endpoint_not_supported",l5t="key_id_missing",OEo="no_network_connectivity",BEo="user_canceled",vs="method_not_implemented",LEo="nested_app_auth_bridge_disabled",FEo="platform_broker_error",u5t="resource_parameter_required",d5t="misplaced_resource_parameter";var xh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?su.trimArrayEntries([...e]):[],n=r?su.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw gl(QOt);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...Zse],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(iqe):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return cqe.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw wt(n5t)}}removeScope(e){if(!e)throw wt(r5t);this.scopes.delete(e.trim())}removeOIDCScopes(){cqe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw wt(Sqe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw wt(Sqe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function bz(t,e,r){if(!e)return;let n=t.get(fM);n&&t.has(Jbe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(pqe)},e)}a(bz,"instrumentBrokerParams");function UEo(t,e){t.set(JMt,e)}a(UEo,"addResponseType");function f5t(t,e){t.set(ZMt,e||OMt.QUERY)}a(f5t,"addResponseMode");function QEo(t){t.set(wOt,"1")}a(QEo,"addNativeBroker");function Sz(t,e,r=!0,n=Zse){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new xh(o);t.set(tOt,s.printScopes())}a(Sz,"addScopes");function Tz(t,e){t.set(fM,e)}a(Tz,"addClientId");function Iz(t,e){t.set(pqe,e)}a(Iz,"addRedirectUri");function p5t(t,e){t.set(_Ot,e)}a(p5t,"addPostLogoutRedirectUri");function h5t(t,e){t.set(COt,e)}a(h5t,"addIdTokenHint");function m5t(t,e){t.set(DOt,e)}a(m5t,"addDomainHint");function cae(t,e){t.set(POt,e)}a(cae,"addLoginHint");function s7(t,e){t.set(Dp.CCS_HEADER,`UPN:${e}`)}a(s7,"addCcsUpn");function TL(t,e){t.set(Dp.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(TL,"addCcsOid");function Tqe(t,e){t.set("sid",e)}a(Tqe,"addSid");function xz(t,e,r){let n=iXr(e,r);try{JSON.parse(n)}catch{throw gl(Eqe)}t.set(eOt,n)}a(xz,"addClaims");function wz(t,e){t.set(uOt,e)}a(wz,"addCorrelationId");function r1e(t,e){t.set(dOt,e.sku),t.set(fOt,e.version),e.os&&t.set(pOt,e.os),e.cpu&&t.set(hOt,e.cpu)}a(r1e,"addLibraryInfo");function n1e(t,e){e?.appName&&t.set(yOt,e.appName),e?.appVersion&&t.set(EOt,e.appVersion)}a(n1e,"addApplicationTelemetry");function g5t(t,e){t.set(oOt,e)}a(g5t,"addPrompt");function i1e(t,e){e&&t.set(nOt,e)}a(i1e,"addState");function A5t(t,e){t.set(iOt,e)}a(A5t,"addNonce");function qEo(t,e,r){if(e&&r)t.set(aOt,e),t.set(cOt,r);else throw gl(HOt)}a(qEo,"addCodeChallengeParams");function y5t(t,e){t.set(sOt,e)}a(y5t,"addAuthorizationCode");function jEo(t,e){t.set(vOt,e)}a(jEo,"addDeviceCode");function E5t(t,e){t.set(rOt,e)}a(E5t,"addRefreshToken");function _5t(t,e){t.set(lOt,e)}a(_5t,"addCodeVerifier");function o1e(t,e){t.set(bOt,e)}a(o1e,"addClientSecret");function s1e(t,e){e&&t.set(SOt,e)}a(s1e,"addClientAssertion");function a1e(t,e){e&&t.set(TOt,e)}a(a1e,"addClientAssertionType");function HEo(t,e){t.set(IOt,e)}a(HEo,"addOboAssertion");function GEo(t,e){t.set(xOt,e)}a(GEo,"addRequestTokenUse");function c1e(t,e){t.set(XMt,e)}a(c1e,"addGrantType");function Rz(t){t.set(FMt,"1")}a(Rz,"addClientInfo");function C5t(t){t.set(BOt,"1")}a(C5t,"addCliData");function l1e(t){t.has(nae)||t.set(nae,"true")}a(l1e,"addInstanceAware");function IL(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(IL,"addExtraParameters");function iXr(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw gl(Eqe)}return e&&e.length>0&&(r.hasOwnProperty(Xse.ACCESS_TOKEN)||(r[Xse.ACCESS_TOKEN]={}),r[Xse.ACCESS_TOKEN][Xse.XMS_CC]={values:e}),JSON.stringify(r)}a(iXr,"addClientCapabilitiesToClaims");function $Eo(t,e){t.set(fqe.username,e)}a($Eo,"addUsername");function VEo(t,e){t.set(fqe.password,e)}a(VEo,"addPassword");function u1e(t,e){e&&(t.set(hqe,of.POP),t.set(mqe,e))}a(u1e,"addPopToken");function d1e(t,e){e&&(t.set(hqe,of.SSH),t.set(mqe,e))}a(d1e,"addSshJwk");function f1e(t,e){t.set(mOt,e.generateCurrentRequestHeaderValue()),t.set(gOt,e.generateLastRequestHeaderValue())}a(f1e,"addServerTelemetry");function p1e(t){t.set(AOt,WMt)}a(p1e,"addThrottling");function v5t(t,e){t.set(ROt,e)}a(v5t,"addLogoutHint");function xL(t,e,r){t.has(Jbe)||t.set(Jbe,e),t.has(Aqe)||t.set(Aqe,r)}a(xL,"addBrokerParameters");function WEo(t,e){t.set(NOt,encodeURIComponent(e)),t.set(MOt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(WEo,"addEARParameters");function h1e(t,e){e&&t.set(OOt,e)}a(h1e,"addResource");var nA={};wi(nA,{getDeserializedResponse:()=>zEo,mapToQueryString:()=>pM,normalizeUrlForComparison:()=>YEo,stripLeadingHashOrQuery:()=>sXr});p();function oXr(t){if(!t)return t;let e=t.toLowerCase();return su.endsWith(e,"?")?e=e.slice(0,-1):su.endsWith(e,"?/")&&(e=e.slice(0,-2)),su.endsWith(e,"/")||(e+="/"),e}a(oXr,"canonicalizeUrl");function sXr(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(sXr,"stripLeadingHashOrQuery");function zEo(t){if(!t||t.indexOf("=")<0)return null;try{let e=sXr(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw wt(KOt)}return null}a(zEo,"getDeserializedResponse");function pM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(pM,"mapToQueryString");function YEo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return oXr(n)}catch{return oXr(e)}}a(YEo,"normalizeUrlForComparison");p();p();var lae={createNewGuid:a(()=>{throw wt(vs)},"createNewGuid"),base64Decode:a(()=>{throw wt(vs)},"base64Decode"),base64Encode:a(()=>{throw wt(vs)},"base64Encode"),base64UrlEncode:a(()=>{throw wt(vs)},"base64UrlEncode"),encodeKid:a(()=>{throw wt(vs)},"encodeKid"),async getPublicKeyThumbprint(){throw wt(vs)},async removeTokenBindingKey(){throw wt(vs)},async clearKeystore(){throw wt(vs)},async signJwt(){throw wt(vs)},async hashString(){throw wt(vs)}};p();var sf;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(sf||(sf={}));var KEo=50,JEo=500,kz=new Map;function ZEo(t,e){kz.delete(t),kz.set(t,e)}a(ZEo,"markAsRecentlyUsed");function XEo(t,e){let r=Date.now(),n=kz.get(t);if(n)ZEo(t,n);else if(n={logs:[],firstEventTime:r},kz.set(t,n),kz.size>KEo){let o=kz.keys().next().value;o&&kz.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>JEo&&n.logs.shift()}a(XEo,"addLogToCache");function e_o(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(e_o,"isHashedString");var H0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=sf.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:sf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(e_o(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};XEo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${sf[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:sf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:sf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:sf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:sf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:sf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:sf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:sf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:sf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:sf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:sf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var a7="@azure/msal-common",hM="16.4.1";p();var wL={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function aXr(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(aXr,"tenantIdMatchesHomeTenant");function Pz(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:aXr(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:aXr(r,t)}}a(Pz,"buildTenantProfile");function Iqe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=Pz(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(Iqe,"updateAccountTenantProfileData");var xqe={};wi(xqe,{checkMaxAge:()=>m1e,extractTokenClaims:()=>RL,getJWSPayload:()=>cXr,isKmsi:()=>b5t});p();function RL(t,e){let r=cXr(t);try{let n=e(r);return JSON.parse(n)}catch{throw wt(vqe)}}a(RL,"extractTokenClaims");function b5t(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(b5t,"isKmsi");function cXr(t){if(!t)throw wt(WOt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw wt(vqe);return r[2]}a(cXr,"getJWSPayload");function m1e(t,e){if(e===0||Date.now()-3e5>t+e)throw wt(XOt)}a(m1e,"checkMaxAge");p();p();var bs=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw gl(UOt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return su.endsWith(r,"?")?r=r.slice(0,-1):su.endsWith(r,"?/")&&(r=r.slice(0,-2)),su.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw gl(oae)}if(!e.HostNameAndPort||!e.PathSegments)throw gl(oae);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw gl(FOt)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===qk.COMMON||n[0]===qk.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw gl(oae);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw gl(oae);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===Jse){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var t_o=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function r_o(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(r_o,"buildOpenIdConfig");var n_o=t_o.reduce((t,{host:e,issuerHost:r})=>(t[e]=r_o(e,r||e),t),{}),uXr={endpointMetadata:n_o,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},S5t=uXr.endpointMetadata,T5t=uXr.instanceDiscoveryMetadata,I5t=new Set;T5t.metadata.forEach(t=>{t.aliases.forEach(e=>{I5t.add(e)})});function dXr(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new bs(o).getUrlComponents().HostNameAndPort;n=lXr(e,r,s,t.cloudDiscoveryMetadata?.metadata,Py.CONFIG)||lXr(e,r,s,T5t.metadata,Py.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(dXr,"getAliasesFromStaticSources");function lXr(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=g1e(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(lXr,"getAliasesFromMetadata");function fXr(t){return g1e(T5t.metadata,t)}a(fXr,"getCloudDiscoveryMetadataFromHardcodedValues");function g1e(t,e){for(let r=0;rx5t,createAccountEntityFromAccountInfo:()=>s_o,generateAccountId:()=>i_o,generateHomeAccountId:()=>w5t,getAccountInfo:()=>dae,isAccountEntity:()=>a_o,isSingleTenant:()=>o_o});p();p();function uae(t,e){if(!t)throw wt(VOt);try{let r=e(t);return JSON.parse(r)}catch{throw wt(Cqe)}}a(uae,"buildClientInfo");function mM(t){if(!t)throw wt(Cqe);let e=t.split(eae,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(mM,"buildClientInfoFromHomeAccountId");p();var ix={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function wqe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(wqe,"getTenantIdFromIdTokenClaims");p();var Dy={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function i_o(t){return[t.homeAccountId,t.environment].join(yz).toLowerCase()}a(i_o,"generateAccountId");function dae(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(Pz(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(dae,"getAccountInfo");function o_o(t){return!t.tenantProfiles}a(o_o,"isSingleTenant");function x5t(t,e,r){let n;e.authorityType===ix.Adfs?n=LMt:e.protocolMode===Dy.OIDC?n=lqe:n=BMt;let o,s;t.clientInfo&&r&&(o=uae(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw wt(t1e);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||wqe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[Pz(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(x5t,"createAccountEntity");function s_o(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(Pz(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||lqe,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a(s_o,"createAccountEntityFromAccountInfo");function w5t(t,e,r,n,o,s){if(!(e===ix.Adfs||e===ix.Dsts)){if(t)try{let c=uae(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(w5t,"generateHomeAccountId");function a_o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(a_o,"isAccountEntity");var c7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(a7,hM),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?dae(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=RL(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=Iqe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=dae(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw wt(i5t);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof Bo?c:mXr(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=xh.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&xh.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===of.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===of.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:j0.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=xh.createSearchScopes(r.scopes),l=r.authenticationScheme||of.BEARER,u=l&&l.toLowerCase()!==of.BEARER.toLowerCase()?j0.ACCESS_TOKEN_WITH_AUTH_SCHEME:j0.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?Ez:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:j0.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw wt(e5t);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===Ez)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=dXr(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==j0.ACCESS_TOKEN&&e.credentialType!==j0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:xh.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(tae)!==-1}isAuthorityMetadata(e){return e.indexOf(rae)!==-1}generateAuthorityMetadataCacheKey(e){return`${rae}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},y1e=class extends c7{static{a(this,"DefaultStorageClass")}async setAccount(){throw wt(vs)}getAccount(){throw wt(vs)}async setIdTokenCredential(){throw wt(vs)}getIdTokenCredential(){throw wt(vs)}async setAccessTokenCredential(){throw wt(vs)}getAccessTokenCredential(){throw wt(vs)}async setRefreshTokenCredential(){throw wt(vs)}getRefreshTokenCredential(){throw wt(vs)}setAppMetadata(){throw wt(vs)}getAppMetadata(){throw wt(vs)}setServerTelemetry(){throw wt(vs)}getServerTelemetry(){throw wt(vs)}setAuthorityMetadata(){throw wt(vs)}getAuthorityMetadata(){throw wt(vs)}getAuthorityMetadataKeys(){throw wt(vs)}setThrottlingCache(){throw wt(vs)}getThrottlingCache(){throw wt(vs)}removeItem(){throw wt(vs)}getKeys(){throw wt(vs)}getAccountKeys(){throw wt(vs)}getTokenKeys(){throw wt(vs)}generateCredentialKey(){throw wt(vs)}generateAccountKey(){throw wt(vs)}};p();p();var gXr={NotStarted:0,InProgress:1,Completed:2};var wh=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:gXr.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var AXr={tokenRenewalOffsetSeconds:KMt,preventCorsPreflight:!1},c_o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.Info,correlationId:""},l_o={async sendGetRequestAsync(){throw wt(vs)},async sendPostRequestAsync(){throw wt(vs)}},u_o={sku:yMt,version:hM,cpu:"",os:""},d_o={clientSecret:"",clientAssertion:void 0},f_o={azureCloudInstance:wL.None,tenant:`${Gbe}`},p_o={application:{appName:"",appVersion:""}};function kL({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...c_o,...r};return{authOptions:h_o(t),systemOptions:{...AXr,...e},loggerOptions:m,storageInterface:n||new y1e(t.clientId,lae,new H0(m),new wh),networkInterface:o||l_o,cryptoInterface:s||lae,clientCredentials:c||d_o,libraryInfo:{...u_o,...l},telemetry:{...p_o,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(kL,"buildClientConfiguration");function h_o(t){return{clientCapabilities:[],azureCloudOptions:f_o,instanceAware:!1,isMcp:!1,...t}}a(h_o,"buildAuthOptions");function Rqe(t){return t.authOptions.authority.options.protocolMode===Dy.OIDC}a(Rqe,"isOidcProtocolMode");p();p();var rS=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var d_={};wi(d_,{createAccessTokenEntity:()=>P5t,createIdTokenEntity:()=>k5t,createRefreshTokenEntity:()=>D5t,generateAppMetadataKey:()=>b_o,generateAuthorityMetadataExpiresAt:()=>Pqe,isAccessTokenEntity:()=>y_o,isAppMetadataEntity:()=>S_o,isAuthorityMetadataEntity:()=>T_o,isAuthorityMetadataExpired:()=>Dqe,isCredentialEntity:()=>kqe,isIdTokenEntity:()=>E_o,isRefreshTokenEntity:()=>__o,isServerTelemetryEntity:()=>C_o,isThrottlingEntity:()=>v_o,updateAuthorityEndpointMetadata:()=>pae,updateCloudDiscoveryMetadata:()=>_1e});p();var Hu={};wi(Hu,{delay:()=>A_o,isCacheExpired:()=>g_o,isTokenExpired:()=>fae,nowSeconds:()=>nS,toDateFromSeconds:()=>E1e,toSecondsFromDate:()=>m_o,wasClockTurnedBack:()=>R5t});p();function nS(){return Math.round(new Date().getTime()/1e3)}a(nS,"nowSeconds");function m_o(t){return t.getTime()/1e3}a(m_o,"toSecondsFromDate");function E1e(t){return t?new Date(Number(t)*1e3):new Date}a(E1e,"toDateFromSeconds");function fae(t,e){let r=Number(t)||0;return nS()+e>r}a(fae,"isTokenExpired");function g_o(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(g_o,"isCacheExpired");function R5t(t){return Number(t)>nS()}a(R5t,"wasClockTurnedBack");function A_o(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(A_o,"delay");function k5t(t,e,r,n,o){return{credentialType:j0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(k5t,"createIdTokenEntity");function P5t(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:j0.ACCESS_TOKEN,secret:r,cachedAt:nS().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||of.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==of.BEARER.toLowerCase())switch(g.credentialType=j0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case of.POP:let A=RL(r,u);if(!A?.cnf?.kid)throw wt(s5t);g.keyId=A.cnf.kid;break;case of.SSH:g.keyId=m}return g}a(P5t,"createAccessTokenEntity");function D5t(t,e,r,n,o,s,c){let l={credentialType:j0.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(D5t,"createRefreshTokenEntity");function kqe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(kqe,"isCredentialEntity");function y_o(t){return t?kqe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===j0.ACCESS_TOKEN||t.credentialType===j0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(y_o,"isAccessTokenEntity");function E_o(t){return t?kqe(t)&&t.hasOwnProperty("realm")&&t.credentialType===j0.ID_TOKEN:!1}a(E_o,"isIdTokenEntity");function __o(t){return t?kqe(t)&&t.credentialType===j0.REFRESH_TOKEN:!1}a(__o,"isRefreshTokenEntity");function C_o(t,e){let r=t.indexOf(zbe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(C_o,"isServerTelemetryEntity");function v_o(t,e){let r=!1;t&&(r=t.indexOf(Ybe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(v_o,"isThrottlingEntity");function b_o({environment:t,clientId:e}){return[tae,t,e].join(yz).toLowerCase()}a(b_o,"generateAppMetadataKey");function S_o(t,e){return e?t.indexOf(tae)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(S_o,"isAppMetadataEntity");function T_o(t,e){return e?t.indexOf(rae)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(T_o,"isAuthorityMetadataEntity");function Pqe(){return nS()+UMt}a(Pqe,"generateAuthorityMetadataExpiresAt");function pae(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(pae,"updateAuthorityEndpointMetadata");function _1e(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(_1e,"updateCloudDiscoveryMetadata");function Dqe(t){return t.expiresAt<=nS()}a(Dqe,"isAuthorityMetadataExpired");p();p();var yXr="networkClientSendPostRequestAsync",EXr="refreshTokenClientExecutePostToTokenEndpoint",_Xr="authorizationCodeClientExecutePostToTokenEndpoint",CXr="refreshTokenClientExecuteTokenRequest",vXr="refreshTokenClientAcquireToken",Nqe="refreshTokenClientAcquireTokenWithCachedRefreshToken",bXr="refreshTokenClientCreateTokenRequestBody",SXr="silentFlowClientGenerateResultFromCacheRecord";var TXr="authClientExecuteTokenRequest",IXr="authClientCreateTokenRequestBody",xXr="updateTokenEndpointAuthority",hae="popTokenGenerateCnf",Mqe="handleServerTokenResponse",wXr="authorityResolveEndpointsAsync",RXr="authorityGetCloudDiscoveryMetadataFromNetwork",kXr="authorityUpdateCloudDiscoveryMetadata",PXr="authorityGetEndpointMetadataFromNetwork",DXr="authorityUpdateEndpointMetadata",N5t="authorityUpdateMetadataWithRegionalInformation",NXr="regionDiscoveryDetectRegion",M5t="regionDiscoveryGetRegionFromIMDS",MXr="regionDiscoveryGetCurrentVersion",OXr="cacheManagerGetRefreshToken";p();var BXr=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),Vs=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var I_o={SW:"sw"},l7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Vs(this.generateKid.bind(this),hae,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:I_o.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new bs(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:nS(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var Bqe={};wi(Bqe,{badToken:()=>C1e,consentRequired:()=>F5t,interactionRequired:()=>L5t,interruptedUser:()=>Q5t,loginRequired:()=>U5t,nativeAccountUnavailable:()=>x_o,noTokensFound:()=>Oqe,refreshTokenExpired:()=>O5t,uxNotAllowed:()=>B5t});p();var Oqe="no_tokens_found",x_o="native_account_unavailable",O5t="refresh_token_expired",B5t="ux_not_allowed",L5t="interaction_required",F5t="consent_required",U5t="login_required",C1e="bad_token",Q5t="interrupted_user";var LXr=[L5t,F5t,U5t,C1e,B5t,Q5t],w_o=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],iS=class t extends Bo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function Lqe(t,e,r){let n=!!t&&LXr.indexOf(t)>-1,o=!!r&&w_o.indexOf(r)>-1,s=!!e&&LXr.some(c=>e.indexOf(c)>-1);return n||s||o}a(Lqe,"isInteractionRequiredError");function Fqe(t,e){return new iS(t,e)}a(Fqe,"createInteractionRequiredAuthError");p();var f_=class t extends Bo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function FXr(t,e){if(!t)throw wt(o5t);if(!e)throw wt(vz);try{let r=e.split(nqe),n=r[0],o=r.length>1?r.slice(1).join(nqe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw wt(vz)}}a(FXr,"parseRequestState");var Mp=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||Az} - Timestamp: ${e.timestamp||Az} - Description: ${e.error_description||Az} - Correlation ID: ${e.correlation_id||Az} - Trace ID: ${e.trace_id||Az}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new f_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=NMt&&e.status<=MMt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. -${c}`,r);return}else if(n&&e.status&&e.status>=PMt&&e.status<=DMt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. -${c}`,r);return}throw Lqe(e.error,e.error_description,e.suberror)?new iS(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=RL(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw wt(ZOt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw wt(Xbe);m1e(y,o.maxAge)}}this.homeAccountIdentifier=w5t(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=FXr(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new rS(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,b5t(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw wt(t1e);let d=wqe(s),f,h;e.id_token&&s&&(f=k5t(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=UXr(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?xh.fromString(e.scope):new xh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=P5t(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=D5t(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,E="";if(n.accessToken){if(n.accessToken.tokenType===of.POP&&!s.popKid){let T=new l7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw wt(l5t);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=xh.fromString(n.accessToken.target).asArray(),g=E1e(n.accessToken.expiresOn),A=E1e(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=E1e(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===Ez?Ez:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?Iqe(dae(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function UXr(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let E=(A.length===1?A[0]:null)||x5t({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),_=E.tenantProfiles||[],v=u||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=Pz(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(UXr,"buildAccountToCache");p();var p_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function h_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(h_,"getClientAssertion");p();function mae(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(mae,"getRequestThumbprint");var Nz={};wi(Nz,{createTokenQueryParameters:()=>S1e,createTokenRequestHeaders:()=>b1e,executePostToTokenEndpoint:()=>T1e,sendPostRequest:()=>QXr});p();p();var v1e=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${Ybe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Dp.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||$Mt),n+VMt)*1e3)}static removeThrottle(e,r,n,o){let s=mae(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var gae=class t extends Bo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function q5t(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new gae(t,e,r)}a(q5t,"createNetworkError");function b1e(t,e,r){let n={};if(n[Dp.CONTENT_TYPE]=SMt,!e&&r)switch(r.type){case p_.HOME_ACCOUNT_ID:try{let o=mM(r.credential);n[Dp.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case p_.UPN:n[Dp.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(b1e,"createTokenRequestHeaders");function S1e(t,e,r,n){let o=new Map;return t.embeddedClientId&&xL(o,e,r),t.extraQueryParameters&&IL(o,t.extraQueryParameters),wz(o,t.correlationId),bz(o,t.correlationId,n),pM(o)}a(S1e,"createTokenQueryParameters");async function T1e(t,e,r,n,o,s,c,l,u,d){let f=await QXr(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(T1e,"executePostToTokenEndpoint");async function QXr(t,e,r,n,o,s,c,l){v1e.preProcess(o,t,n);let u;try{u=await Vs(s.sendPostRequestAsync.bind(s),yXr,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Dp.X_MS_HTTP_VERSION]||"",requestId:d[Dp.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof gae){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Dp.X_MS_HTTP_VERSION]||"",requestId:f[Dp.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Dp.CONTENT_TYPE]||void 0,contentLengthHeader:f[Dp.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Bo?d:wt(zOt)}return v1e.postProcess(o,t,u,n),u}a(QXr,"sendPostRequest");var Qqe={};wi(Qqe,{createDiscoveredInstance:()=>H5t});p();p();p();function qXr(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(qXr,"isOpenIdConfigResponse");p();function jXr(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(jXr,"isCloudInstanceDiscoveryResponse");p();function HXr(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(HXr,"isCloudInstanceDiscoveryErrorResponse");p();var I1e=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=i7.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Vs(this.getRegionFromIMDS.bind(this),M5t,this.logger,this.performanceClient,this.correlationId)(TMt,o);if(s.status===sqe&&(n=s.body,r.region_source=i7.IMDS),s.status===aqe){let c=await Vs(this.getCurrentVersion.bind(this),MXr,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=i7.FAILED_AUTO_DETECTION,null;let l=await Vs(this.getRegionFromIMDS.bind(this),M5t,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===sqe&&(n=l.body,r.region_source=i7.IMDS)}}catch{return r.region_source=i7.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=i7.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${oqe}?api-version=${e}&format=text`,r,IMt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${oqe}?format=json`,e);return r.status===aqe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};I1e.IMDS_OPTIONS={headers:{Metadata:"true"}};var Gk=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new I1e(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(rqe))return ix.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case _Mt:return ix.Adfs;case CMt:return ix.Dsts}return ix.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new bs(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw wt(Hk)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw wt(Hk)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw wt(Hk)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw wt(c5t);return this.replacePath(this.metadata.end_session_endpoint)}else throw wt(Hk)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw wt(Hk)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw wt(Hk)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===ix.Default&&this.protocolMode!==Dy.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new bs(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new bs(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===ix.Adfs||this.protocolMode===Dy.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await Vs(this.updateCloudDiscoveryMetadata.bind(this),kXr,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Vs(this.updateEndpointMetadata.bind(this),DXr,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Pqe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Py.CACHE&&n?.source!==Py.CACHE&&(e.expiresAt=Pqe(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===Py.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Vs(this.updateMetadataWithRegionalInformation.bind(this),N5t,this.logger,this.performanceClient,this.correlationId)(r.metadata);pae(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Vs(this.getEndpointMetadataFromNetwork.bind(this),PXr,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Vs(this.updateMetadataWithRegionalInformation.bind(this),N5t,this.logger,this.performanceClient,this.correlationId)(n)),pae(e,n,!0),Py.NETWORK;throw wt(YOt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),pae(e,r,!1),{source:Py.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return pae(e,n,!1),{source:Py.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=Dqe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Py.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new bs(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw gl(GOt)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return qXr(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in S5t?S5t[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==xMt)return this.regionDiscoveryMetadata.region_outcome=Kbe.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Vs(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),NXr,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=Kbe.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=Kbe.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Vs(this.getCloudDiscoveryMetadataFromNetwork.bind(this),RXr,this.logger,this.performanceClient,this.correlationId)();if(n)return _1e(e,n,!0),Py.NETWORK;throw gl($Ot)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||$be}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||$be}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||$be}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),_1e(e,r,!1),Py.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=fXr(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),_1e(e,n,!1),Py.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=Dqe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Py.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===ix.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=g1e(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),gl(_qe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${vMt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(jXr(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(HXr(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===kMt)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=g1e(c,this.hostnameAndPort)}catch(o){if(o instanceof Bo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. +${n}`),this.errors=e,this.name=mZr}};function pZr(t){return{error:t.error,errorDescription:t.error_description,correlationId:t.correlation_id,errorCodes:t.error_codes,timestamp:t.timestamp,traceId:t.trace_id}}a(pZr,"convertOAuthErrorResponseToErrorResponse");var ex=class extends Error{static{a(this,"AuthenticationRequiredError")}scopes;getTokenOptions;constructor(e){super(e.message,e.cause?{cause:e.cause}:void 0),this.scopes=e.scopes,this.getTokenOptions=e.getTokenOptions,this.name="AuthenticationRequiredError"}};p();p();p();p();var gZr=require("node:os"),AZr=fe(require("node:util"),1),yZr=fe(require("node:process"),1);function EZr(t,...e){yZr.stderr.write(`${AZr.default.format(t,...e)}${gZr.EOL}`)}a(EZr,"log");var _Zr=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,vZr,JNt=[],ZNt=[],MQe=[];_Zr&&XNt(_Zr);var CZr=Object.assign(t=>bZr(t),{enable:XNt,enabled:eMt,disable:byo,log:EZr});function XNt(t){vZr=t,JNt=[],ZNt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?ZNt.push(new RegExp(`^${n.substr(1)}$`)):JNt.push(new RegExp(`^${n}$`));for(let n of MQe)n.enabled=eMt(n.namespace)}a(XNt,"enable");function eMt(t){if(t.endsWith("*"))return!0;for(let e of ZNt)if(e.test(t))return!1;for(let e of JNt)if(e.test(t))return!0;return!1}a(eMt,"enabled");function byo(){let t=vZr||"";return XNt(""),t}a(byo,"disable");function bZr(t){let e=Object.assign(r,{enabled:eMt(t),destroy:Syo,log:CZr.log,namespace:t,extend:Tyo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),MQe.push(e),e}a(bZr,"createDebugger");function Syo(){let t=MQe.indexOf(this);return t>=0?(MQe.splice(t,1),!0):!1}a(Syo,"destroy");function Tyo(t){let e=bZr(`${this.namespace}:${t}`);return e.log=this.log,e}a(Tyo,"extend");var Qse=CZr;var TZr=new Set,OQe=typeof process<"u"&&process.env&&process.env.AZURE_LOG_LEVEL||void 0,LQe,tMt=Qse("azure");tMt.log=(...t)=>{Qse.log(...t)};var rMt=["verbose","info","warning","error"];OQe&&(wZr(OQe)?Iyo(OQe):console.error(`AZURE_LOG_LEVEL set to unknown log level '${OQe}'; logging is not enabled. Acceptable values: ${rMt.join(", ")}.`));function Iyo(t){if(t&&!wZr(t))throw new Error(`Unknown log level '${t}'. Acceptable values: ${rMt.join(",")}`);LQe=t;let e=[];for(let r of TZr)xZr(r)&&e.push(r.namespace);Qse.enable(e.join(","))}a(Iyo,"setLogLevel");function FQe(){return LQe}a(FQe,"getLogLevel");var SZr={verbose:400,info:300,warning:200,error:100};function KU(t){let e=tMt.extend(t);return IZr(tMt,e),{error:BQe(e,"error"),warning:BQe(e,"warning"),info:BQe(e,"info"),verbose:BQe(e,"verbose")}}a(KU,"createClientLogger");function IZr(t,e){e.log=(...r)=>{t.log(...r)}}a(IZr,"patchLogMethod");function BQe(t,e){let r=Object.assign(t.extend(e),{level:e});if(IZr(t,r),xZr(r)){let n=Qse.disable();Qse.enable(n+","+r.namespace)}return TZr.add(r),r}a(BQe,"createLogger");function xZr(t){return!!(LQe&&SZr[t.level]<=SZr[LQe])}a(xZr,"shouldEnable");function wZr(t){return rMt.includes(t)}a(wZr,"isAzureLogLevel");var z1=KU("identity");function UQe(t){return t.reduce((e,r)=>(process.env[r]?e.assigned.push(r):e.missing.push(r),e),{missing:[],assigned:[]})}a(UQe,"processEnvVars");function j0(t){return`SUCCESS. Scopes: ${Array.isArray(t)?t.join(", "):t}.`}a(j0,"formatSuccess");function Ds(t,e){let r="ERROR.";return t?.length&&(r+=` Scopes: ${Array.isArray(t)?t.join(", "):t}.`),`${r} Error message: ${typeof e=="string"?e:e.message}.`}a(Ds,"formatError");function RZr(t,e,r=z1){let n=e?`${e.fullTitle} ${t}`:t;function o(u){r.info(`${n} =>`,u)}a(o,"info");function s(u){r.warning(`${n} =>`,u)}a(s,"warning");function c(u){r.verbose(`${n} =>`,u)}a(c,"verbose");function l(u){r.error(`${n} =>`,u)}return a(l,"error"),{title:t,fullTitle:n,info:o,warning:s,verbose:c,error:l}}a(RZr,"credentialLoggerInstance");function lo(t,e=z1){let r=RZr(t,void 0,e);return{...r,parent:e,getToken:RZr("=> getToken()",r,e)}}a(lo,"credentialLogger");p();p();p();p();var qse={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function PZr(t={}){let e=new nMt(t.parentContext);return t.span&&(e=e.setValue(qse.span,t.span)),t.namespace&&(e=e.setValue(qse.namespace,t.namespace)),e}a(PZr,"createTracingContext");var nMt=class t{static{a(this,"TracingContextImpl")}constructor(e){this._contextMap=e instanceof t?new Map(e._contextMap):new Map}setValue(e,r){let n=new t(this);return n._contextMap.set(e,r),n}getValue(e){return this._contextMap.get(e)}deleteValue(e){let r=new t(this);return r._contextMap.delete(e),r}};p();var kZr=fe(iMt(),1),qQe=kZr.state;function xyo(){return{end:a(()=>{},"end"),isRecording:a(()=>!1,"isRecording"),recordException:a(()=>{},"recordException"),setAttribute:a(()=>{},"setAttribute"),setStatus:a(()=>{},"setStatus"),addEvent:a(()=>{},"addEvent")}}a(xyo,"createDefaultTracingSpan");function wyo(){return{createRequestHeaders:a(()=>({}),"createRequestHeaders"),parseTraceparentHeader:a(()=>{},"parseTraceparentHeader"),startSpan:a((t,e)=>({span:xyo(),tracingContext:PZr({parentContext:e.tracingContext})}),"startSpan"),withContext(t,e,...r){return e(...r)}}}a(wyo,"createDefaultInstrumenter");function Pbe(){return qQe.instrumenterImplementation||(qQe.instrumenterImplementation=wyo()),qQe.instrumenterImplementation}a(Pbe,"getInstrumenter");p();function kbe(t){let{namespace:e,packageName:r,packageVersion:n}=t;function o(d,f,h){var m;let g=Pbe().startSpan(d,Object.assign(Object.assign({},h),{packageName:r,packageVersion:n,tracingContext:(m=f?.tracingOptions)===null||m===void 0?void 0:m.tracingContext})),A=g.tracingContext,y=g.span;A.getValue(qse.namespace)||(A=A.setValue(qse.namespace,e)),y.setAttribute("az.namespace",A.getValue(qse.namespace));let E=Object.assign({},f,{tracingOptions:Object.assign(Object.assign({},f?.tracingOptions),{tracingContext:A})});return{span:y,updatedOptions:E}}a(o,"startSpan");async function s(d,f,h,m){let{span:g,updatedOptions:A}=o(d,f,m);try{let y=await c(A.tracingOptions.tracingContext,()=>Promise.resolve(h(A,g)));return g.setStatus({status:"success"}),y}catch(y){throw g.setStatus({status:"error",error:y}),y}finally{g.end()}}a(s,"withSpan");function c(d,f,...h){return Pbe().withContext(d,f,...h)}a(c,"withContext");function l(d){return Pbe().parseTraceparentHeader(d)}a(l,"parseTraceparentHeader");function u(d){return Pbe().createRequestHeaders(d)}return a(u,"createRequestHeaders"),{startSpan:o,withSpan:s,withContext:c,parseTraceparentHeader:l,createRequestHeaders:u}}a(kbe,"createTracingClient");var kc=kbe({namespace:"Microsoft.AAD",packageName:"@azure/identity",packageVersion:kQe});var oMt=lo("ChainedTokenCredential"),Dbe=class{static{a(this,"ChainedTokenCredential")}_sources=[];constructor(...e){this._sources=e}async getToken(e,r={}){let{token:n}=await this.getTokenInternal(e,r);return n}async getTokenInternal(e,r={}){let n=null,o,s=[];return kc.withSpan("ChainedTokenCredential.getToken",r,async c=>{for(let l=0;l0){let l=new Rbe(s,"ChainedTokenCredential authentication failed.");throw oMt.getToken.info(Ds(e,l)),l}if(oMt.getToken.info(`Result for ${o.constructor.name}: ${j0(e)}`),n===null)throw new Nn("Failed to retrieve a valid token");return{token:n,successfulCredential:o}})}};p();p();p();p();var eS={};xi(eS,{AuthError:()=>Oo,AuthErrorCodes:()=>cae,AzureCloudInstance:()=>vL,ClientAssertion:()=>IL,ClientAuthError:()=>e7,ClientAuthErrorCodes:()=>Bp,ClientConfigurationError:()=>Yse,ClientConfigurationErrorCodes:()=>Jse,ConfidentialClientApplication:()=>Tae,CryptoProvider:()=>uM,DistributedCachePlugin:()=>Tje,InteractionRequiredAuthError:()=>J1,InteractionRequiredAuthErrorCodes:()=>Cqe,LogLevel:()=>nf,Logger:()=>G0,ManagedIdentityApplication:()=>Iae,ManagedIdentitySourceNames:()=>io,PromptValue:()=>EIo,ProtocolMode:()=>By,PublicClientApplication:()=>bae,ResponseMode:()=>_Io,ServerError:()=>l_,TokenCache:()=>dae,TokenCacheContext:()=>Y1,internals:()=>D5t,version:()=>X1});p();var D5t={};xi(D5t,{Deserializer:()=>SL,Serializer:()=>JU});p();p();var JU=class{static{a(this,"Serializer")}static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,realm:o.realm,local_account_id:o.localAccountId,username:o.username,authority_type:o.authorityType,name:o.name,client_info:o.clientInfo,last_modification_time:o.lastModificationTime,last_modification_app:o.lastModificationApp,tenantProfiles:o.tenantProfiles?.map(s=>JSON.stringify(s))}}),r}static serializeIdTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm}}),r}static serializeAccessTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,realm:o.realm,target:o.target,cached_at:o.cachedAt,expires_on:o.expiresOn,extended_expires_on:o.extendedExpiresOn,refresh_on:o.refreshOn,key_id:o.keyId,token_type:o.tokenType,userAssertionHash:o.userAssertionHash,resource:o.resource}}),r}static serializeRefreshTokens(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={home_account_id:o.homeAccountId,environment:o.environment,credential_type:o.credentialType,client_id:o.clientId,secret:o.secret,family_id:o.familyId,target:o.target,realm:o.realm}}),r}static serializeAppMetadata(e){let r={};return Object.keys(e).map(function(n){let o=e[n];r[n]={client_id:o.clientId,environment:o.environment,family_id:o.familyId}}),r}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}};p();p();p();var on={};xi(on,{addApplicationTelemetry:()=>Vbe,addAuthorizationCode:()=>s5t,addBrokerParameters:()=>_L,addCcsOid:()=>yL,addCcsUpn:()=>t7,addClaims:()=>yz,addCliData:()=>l5t,addClientAssertion:()=>Ybe,addClientAssertionType:()=>Kbe,addClientCapabilitiesToClaims:()=>BZr,addClientId:()=>gz,addClientInfo:()=>_z,addClientSecret:()=>zbe,addCodeChallengeParams:()=>MEo,addCodeVerifier:()=>c5t,addCorrelationId:()=>Ez,addDeviceCode:()=>OEo,addDomainHint:()=>n5t,addEARParameters:()=>QEo,addExtraParameters:()=>EL,addGrantType:()=>Jbe,addIdTokenHint:()=>r5t,addInstanceAware:()=>Zbe,addLibraryInfo:()=>$be,addLoginHint:()=>Xse,addLogoutHint:()=>u5t,addNativeBroker:()=>NEo,addNonce:()=>o5t,addOboAssertion:()=>BEo,addPassword:()=>UEo,addPopToken:()=>Xbe,addPostLogoutRedirectUri:()=>t5t,addPrompt:()=>i5t,addRedirectUri:()=>Az,addRefreshToken:()=>a5t,addRequestTokenUse:()=>LEo,addResource:()=>n1e,addResponseMode:()=>e5t,addResponseType:()=>DEo,addScopes:()=>mz,addServerTelemetry:()=>t1e,addSid:()=>dqe,addSshJwk:()=>e1e,addState:()=>Wbe,addThrottling:()=>r1e,addUsername:()=>FEo,instrumentBrokerParams:()=>hz});p();var Xt={};xi(Xt,{AADAuthority:()=>FP,AAD_INSTANCE_DISCOVERY_ENDPT:()=>uMt,AAD_TENANT_DOMAIN_SUFFIX:()=>dMt,ADFS:()=>cMt,APP_METADATA:()=>Vse,AUTHORITY_METADATA_CACHE_KEY:()=>Wse,AUTHORITY_METADATA_REFRESH_TIME_SECONDS:()=>xMt,AUTHORIZATION_PENDING:()=>Dyo,AZURE_REGION_AUTO_DISCOVER_FLAG:()=>mMt,AuthenticationScheme:()=>rf,AuthorityMetadataSource:()=>Oy,CACHE_ACCOUNT_TYPE_ADFS:()=>TMt,CACHE_ACCOUNT_TYPE_GENERIC:()=>YQe,CACHE_ACCOUNT_TYPE_MSAV1:()=>Jyo,CACHE_ACCOUNT_TYPE_MSSTS:()=>SMt,CACHE_KEY_SEPARATOR:()=>lz,CIAM_AUTH_URL:()=>jQe,CLIENT_INFO:()=>IMt,CLIENT_INFO_SEPARATOR:()=>$se,CLIENT_MISMATCH_ERROR:()=>LMt,CODE_GRANT_TYPE:()=>Pyo,CONSUMER_UTID:()=>Ryo,CacheOutcome:()=>UP,CacheType:()=>Zyo,ClaimsRequestKeys:()=>Gse,CodeChallengeMethodValues:()=>Yyo,CredentialType:()=>H0,DEFAULT_AUTHORITY:()=>DZr,DEFAULT_AUTHORITY_HOST:()=>aMt,DEFAULT_COMMON_TENANT:()=>Nbe,DEFAULT_MAX_THROTTLE_TIME_SECONDS:()=>MMt,DEFAULT_THROTTLE_TIME_SECONDS:()=>NMt,DEFAULT_TOKEN_RENEWAL_OFFSET_SEC:()=>FMt,DSTS:()=>lMt,EMAIL_SCOPE:()=>OZr,EncodingTypes:()=>rEo,FORWARD_SLASH:()=>jse,GrantType:()=>Bbe,HTTP_BAD_REQUEST:()=>WQe,HTTP_CLIENT_ERROR:()=>Lyo,HTTP_CLIENT_ERROR_RANGE_END:()=>_Mt,HTTP_CLIENT_ERROR_RANGE_START:()=>EMt,HTTP_GATEWAY_TIMEOUT:()=>$yo,HTTP_GONE:()=>qyo,HTTP_MULTI_SIDED_ERROR:()=>Vyo,HTTP_NOT_FOUND:()=>Uyo,HTTP_REDIRECT:()=>Byo,HTTP_REQUEST_TIMEOUT:()=>Qyo,HTTP_SERVER_ERROR:()=>Hyo,HTTP_SERVER_ERROR_RANGE_END:()=>CMt,HTTP_SERVER_ERROR_RANGE_START:()=>vMt,HTTP_SERVICE_UNAVAILABLE:()=>Gyo,HTTP_SUCCESS:()=>VQe,HTTP_SUCCESS_RANGE_END:()=>Oyo,HTTP_SUCCESS_RANGE_START:()=>Myo,HTTP_TOO_MANY_REQUESTS:()=>jyo,HTTP_UNAUTHORIZED:()=>Fyo,HeaderNames:()=>Op,HttpMethod:()=>Wyo,IMDS_ENDPOINT:()=>$Qe,IMDS_TIMEOUT:()=>hMt,IMDS_VERSION:()=>pMt,INVALID_GRANT_ERROR:()=>BMt,INVALID_INSTANCE:()=>yMt,JsonWebTokenTypes:()=>eEo,KNOWN_PUBLIC_CLOUDS:()=>AMt,NOT_APPLICABLE:()=>Mbe,NOT_AVAILABLE:()=>cz,OAuthResponseType:()=>Kyo,OFFLINE_ACCESS_SCOPE:()=>GQe,OIDC_DEFAULT_SCOPES:()=>Hse,OIDC_SCOPES:()=>zQe,ONE_DAY_IN_MS:()=>tEo,OPENID_SCOPE:()=>NZr,PROFILE_SCOPE:()=>MZr,PasswordGrantConstants:()=>ZQe,PersistentCacheKeys:()=>zyo,PromptValue:()=>Obe,REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:()=>gMt,RESOURCE_DELIM:()=>HQe,RegionDiscoveryOutcomes:()=>Ube,RegionDiscoverySources:()=>XU,ResponseMode:()=>bMt,S256_CODE_CHALLENGE_METHOD:()=>kyo,SERVER_TELEM_CACHE_KEY:()=>Lbe,SERVER_TELEM_CATEGORY_SEPARATOR:()=>JQe,SERVER_TELEM_MAX_CACHED_ERRORS:()=>RMt,SERVER_TELEM_MAX_CUR_HEADER_BYTES:()=>Xyo,SERVER_TELEM_MAX_LAST_HEADER_BYTES:()=>wMt,SERVER_TELEM_OVERFLOW_FALSE:()=>kMt,SERVER_TELEM_OVERFLOW_TRUE:()=>PMt,SERVER_TELEM_SCHEMA_VERSION:()=>KQe,SERVER_TELEM_UNKNOWN_ERROR:()=>DMt,SERVER_TELEM_VALUE_SEPARATOR:()=>ZU,SHR_NONCE_VALIDITY:()=>Nyo,SKU:()=>sMt,THE_FAMILY_ID:()=>uz,THROTTLING_PREFIX:()=>Fbe,URL_FORM_CONTENT_TYPE:()=>fMt,X_MS_LIB_CAPABILITY_VALUE:()=>OMt});p();var sMt="msal.js.common",DZr="https://login.microsoftonline.com/common/",aMt="login.microsoftonline.com",Nbe="common",cMt="adfs",lMt="dstsv2",uMt=`${DZr}discovery/instance?api-version=1.1&authorization_endpoint=`,jQe=".ciamlogin.com",dMt=".onmicrosoft.com",HQe="|",Ryo="9188040d-6c67-4c5b-b112-36a304b66dad",NZr="openid",MZr="profile",GQe="offline_access",OZr="email",Pyo="authorization_code",kyo="S256",fMt="application/x-www-form-urlencoded;charset=utf-8",Dyo="authorization_pending",Mbe="N/A",cz="Not Available",jse="/",$Qe="http://169.254.169.254/metadata/instance/compute/location",pMt="2020-06-01",hMt=2e3,mMt="TryAutoDetect",gMt="login.microsoft.com",AMt=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],Nyo=240,yMt="invalid_instance",VQe=200,Myo=200,Oyo=299,Byo=302,Lyo=400,EMt=400,WQe=400,Fyo=401,Uyo=404,Qyo=408,qyo=410,jyo=429,_Mt=499,Hyo=500,vMt=500,Gyo=503,$yo=504,CMt=599,Vyo=600,Wyo={GET:"GET",POST:"POST"},Hse=[NZr,MZr,GQe],zQe=[...Hse,OZr],Op={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},zyo={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},FP={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},Gse={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Obe={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},Yyo={PLAIN:"plain",S256:"S256"},Kyo={CODE:"code",IDTOKEN_TOKEN:"id_token token",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},bMt={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},Bbe={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},SMt="MSSTS",TMt="ADFS",Jyo="MSA",YQe="Generic",lz="-",$se=".",H0={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Zyo={ADFS:1001,MSA:1002,MSSTS:1003,GENERIC:1004,ACCESS_TOKEN:2001,REFRESH_TOKEN:2002,ID_TOKEN:2003,APP_METADATA:3001,UNDEFINED:9999},Vse="appmetadata",IMt="client_info",uz="1",Wse="authority-metadata",xMt=3600*24,Oy={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},KQe=5,Xyo=80,wMt=330,RMt=50,Lbe="server-telemetry",JQe="|",ZU=",",PMt="1",kMt="0",DMt="unknown_error",rf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},NMt=60,MMt=3600,Fbe="throttling",OMt="retry-after, h429",BMt="invalid_grant",LMt="client_mismatch",ZQe={username:"username",password:"password"},XU={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Ube={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},UP={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},eEo={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},tEo=864e5,FMt=300,rEo={BASE64:"base64",HEX:"hex",UTF8:"utf-8"};var dz={};xi(dz,{ACCESS_TOKEN:()=>oEo,BROKER_CLIENT_ID:()=>Qbe,BROKER_REDIRECT_URI:()=>nqe,CCS_HEADER:()=>pEo,CLAIMS:()=>jMt,CLIENT_ASSERTION:()=>fOt,CLIENT_ASSERTION_TYPE:()=>pOt,CLIENT_ID:()=>sM,CLIENT_INFO:()=>uEo,CLIENT_REQUEST_ID:()=>ZMt,CLIENT_SECRET:()=>dOt,CLI_DATA:()=>SOt,CODE:()=>zMt,CODE_CHALLENGE:()=>YMt,CODE_CHALLENGE_METHOD:()=>KMt,CODE_VERIFIER:()=>JMt,DEVICE_CODE:()=>uOt,DOMAIN_HINT:()=>_Ot,EAR_JWE_CRYPTO:()=>COt,EAR_JWK:()=>vOt,ERROR:()=>nEo,ERROR_DESCRIPTION:()=>iEo,EXPIRES_IN:()=>aEo,FOCI:()=>fEo,GRANT_TYPE:()=>qMt,ID_TOKEN:()=>sEo,ID_TOKEN_HINT:()=>lOt,INSTANCE_AWARE:()=>zse,LOGIN_HINT:()=>EOt,LOGOUT_HINT:()=>AOt,NATIVE_BROKER:()=>gOt,NONCE:()=>VMt,OBO_ASSERTION:()=>hOt,ON_BEHALF_OF:()=>dEo,POST_LOGOUT_URI:()=>cOt,PROMPT:()=>WMt,REDIRECT_URI:()=>XQe,REFRESH_TOKEN:()=>GMt,REFRESH_TOKEN_EXPIRES_IN:()=>cEo,REQUESTED_TOKEN_USE:()=>mOt,REQ_CNF:()=>tqe,RESOURCE:()=>bOt,RESPONSE_MODE:()=>QMt,RESPONSE_TYPE:()=>UMt,RETURN_SPA_CODE:()=>rqe,SCOPE:()=>HMt,SESSION_STATE:()=>lEo,SID:()=>yOt,STATE:()=>$Mt,TOKEN_TYPE:()=>eqe,X_APP_NAME:()=>sOt,X_APP_VER:()=>aOt,X_CLIENT_CPU:()=>rOt,X_CLIENT_CURR_TELEM:()=>nOt,X_CLIENT_EXTRA_SKU:()=>hEo,X_CLIENT_LAST_TELEM:()=>iOt,X_CLIENT_OS:()=>tOt,X_CLIENT_SKU:()=>XMt,X_CLIENT_VER:()=>eOt,X_MS_LIB_CAPABILITY:()=>oOt});p();var sM="client_id",XQe="redirect_uri",UMt="response_type",QMt="response_mode",qMt="grant_type",jMt="claims",HMt="scope",nEo="error",iEo="error_description",oEo="access_token",sEo="id_token",GMt="refresh_token",aEo="expires_in",cEo="refresh_token_expires_in",$Mt="state",VMt="nonce",WMt="prompt",lEo="session_state",uEo="client_info",zMt="code",YMt="code_challenge",KMt="code_challenge_method",JMt="code_verifier",ZMt="client-request-id",XMt="x-client-SKU",eOt="x-client-VER",tOt="x-client-OS",rOt="x-client-CPU",nOt="x-client-current-telemetry",iOt="x-client-last-telemetry",oOt="x-ms-lib-capability",sOt="x-app-name",aOt="x-app-ver",cOt="post_logout_redirect_uri",lOt="id_token_hint",uOt="device_code",dOt="client_secret",fOt="client_assertion",pOt="client_assertion_type",eqe="token_type",tqe="req_cnf",hOt="assertion",mOt="requested_token_use",dEo="on_behalf_of",fEo="foci",pEo="X-AnchorMailbox",rqe="return_spa_code",gOt="nativebroker",AOt="logout_hint",yOt="sid",EOt="login_hint",_Ot="domain_hint",hEo="x-client-xtra-sku",Qbe="brk_client_id",nqe="brk_redirect_uri",zse="instance_aware",vOt="ear_jwk",COt="ear_jwe_crypto",bOt="resource",SOt="clidata";p();p();p();function iqe(t){return`See https://aka.ms/msal.js.errors#${t} for details`}a(iqe,"getDefaultErrorMessage");var Oo=class t extends Error{static{a(this,"AuthError")}constructor(e,r,n){let o=r||(e?iqe(e):""),s=o?`${e}: ${o}`:e;super(s),Object.setPrototypeOf(this,t.prototype),this.errorCode=e||"",this.errorMessage=o||"",this.subError=n||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}};function fz(t,e){return new Oo(t,e||iqe(t))}a(fz,"createAuthError");var Yse=class t extends Oo{static{a(this,"ClientConfigurationError")}constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,t.prototype)}};function hl(t){return new Yse(t)}a(hl,"createClientConfigurationError");p();var nu=class{static{a(this,"StringUtils")}static isEmptyObj(e){if(e)try{let r=JSON.parse(e);return Object.keys(r).length===0}catch{}return!0}static startsWith(e,r){return e.indexOf(r)===0}static endsWith(e,r){return e.length>=r.length&&e.lastIndexOf(r)===e.length-r.length}static queryStringToObject(e){let r={},n=e.split("&"),o=a(s=>decodeURIComponent(s.replace(/\+/g," ")),"decode");return n.forEach(s=>{if(s.trim()){let[c,l]=s.split(/=(.+)/g,2);c&&l&&(r[o(c)]=o(l))}}),r}static trimArrayEntries(e){return e.map(r=>r.trim())}static removeEmptyStringsFromArray(e){return e.filter(r=>!!r)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}};p();var e7=class t extends Oo{static{a(this,"ClientAuthError")}constructor(e,r){super(e,r),this.name="ClientAuthError",Object.setPrototypeOf(this,t.prototype)}};function Pt(t,e){return new e7(t,e)}a(Pt,"createClientAuthError");var Jse={};xi(Jse,{authorityMismatch:()=>CEo,authorityUriInsecure:()=>IOt,cannotAllowPlatformBroker:()=>vEo,cannotSetOIDCOptions:()=>_Eo,claimsRequestParsingError:()=>mEo,emptyInputScopesError:()=>wOt,invalidAuthenticationHeader:()=>EEo,invalidAuthorityMetadata:()=>DOt,invalidClaims:()=>oqe,invalidCloudDiscoveryMetadata:()=>sqe,invalidCodeChallengeMethod:()=>gEo,invalidRequestMethodForEAR:()=>bEo,logoutRequestEmpty:()=>POt,missingNonceAuthenticationHeader:()=>yEo,missingSshJwk:()=>qbe,missingSshKid:()=>AEo,pkceParamsMissing:()=>kOt,redirectUriEmpty:()=>TOt,tokenRequestEmpty:()=>ROt,untrustedAuthority:()=>NOt,urlEmptyError:()=>xOt,urlParseError:()=>Kse});p();var TOt="redirect_uri_empty",mEo="claims_request_parsing_error",IOt="authority_uri_insecure",Kse="url_parse_error",xOt="empty_url_error",wOt="empty_input_scopes_error",oqe="invalid_claims",ROt="token_request_empty",POt="logout_request_empty",gEo="invalid_code_challenge_method",kOt="pkce_params_missing",sqe="invalid_cloud_discovery_metadata",DOt="invalid_authority_metadata",NOt="untrusted_authority",qbe="missing_ssh_jwk",AEo="missing_ssh_kid",yEo="missing_nonce_authentication_header",EEo="invalid_authentication_header",_Eo="cannot_set_OIDCOptions",vEo="cannot_allow_platform_broker",CEo="authority_mismatch",bEo="invalid_request_method_for_EAR";var Bp={};xi(Bp,{authTimeNotFound:()=>jbe,authorizationCodeMissingFromServerResponse:()=>YOt,bindingKeyNotRemoved:()=>xEo,cannotAppendScopeSet:()=>$Ot,cannotRemoveEmptyScope:()=>GOt,clientInfoDecodingError:()=>aqe,clientInfoEmptyError:()=>MOt,emptyInputScopeSet:()=>uqe,endSessionEndpointNotSupported:()=>KOt,endpointResolutionError:()=>QP,hashNotDeserialized:()=>FOt,invalidCacheEnvironment:()=>Gbe,invalidCacheRecord:()=>VOt,invalidState:()=>pz,keyIdMissing:()=>JOt,maxAgeTranspired:()=>qOt,methodNotImplemented:()=>_s,misplacedResourceParam:()=>XOt,multipleMatchingAppMetadata:()=>jOt,multipleMatchingTokens:()=>SEo,nestedAppAuthBridgeDisabled:()=>PEo,networkError:()=>BOt,noAccountFound:()=>TEo,noAccountInSilentRequest:()=>Hbe,noCryptoObject:()=>WOt,noNetworkConnectivity:()=>wEo,nonceMismatch:()=>QOt,nullOrEmptyToken:()=>OOt,openIdConfigError:()=>LOt,platformBrokerError:()=>kEo,requestCannotBeMade:()=>HOt,resourceParameterRequired:()=>ZOt,stateMismatch:()=>UOt,stateNotFound:()=>lqe,tokenClaimsCnfRequiredForSignedJwt:()=>zOt,tokenParsingError:()=>cqe,tokenRefreshRequired:()=>Zse,unexpectedCredentialType:()=>IEo,userCanceled:()=>REo});p();var aqe="client_info_decoding_error",MOt="client_info_empty_error",cqe="token_parsing_error",OOt="null_or_empty_token",QP="endpoints_resolution_error",BOt="network_error",LOt="openid_config_error",FOt="hash_not_deserialized",pz="invalid_state",UOt="state_mismatch",lqe="state_not_found",QOt="nonce_mismatch",jbe="auth_time_not_found",qOt="max_age_transpired",SEo="multiple_matching_tokens",jOt="multiple_matching_appMetadata",HOt="request_cannot_be_made",GOt="cannot_remove_empty_scope",$Ot="cannot_append_scopeset",uqe="empty_input_scopeset",Hbe="no_account_in_silent_request",VOt="invalid_cache_record",Gbe="invalid_cache_environment",TEo="no_account_found",WOt="no_crypto_object",IEo="unexpected_credential_type",Zse="token_refresh_required",zOt="token_claims_cnf_required_for_signedjwt",YOt="authorization_code_missing_from_server_response",xEo="binding_key_not_removed",KOt="end_session_endpoint_not_supported",JOt="key_id_missing",wEo="no_network_connectivity",REo="user_canceled",_s="method_not_implemented",PEo="nested_app_auth_bridge_disabled",kEo="platform_broker_error",ZOt="resource_parameter_required",XOt="misplaced_resource_parameter";var Rh=class t{static{a(this,"ScopeSet")}constructor(e){let r=e?nu.trimArrayEntries([...e]):[],n=r?nu.removeEmptyStringsFromArray(r):[];if(!n||!n.length)throw hl(wOt);this.scopes=new Set,n.forEach(o=>this.scopes.add(o))}static fromString(e){let n=(e||"").split(" ");return new t(n)}static createSearchScopes(e){let r=e&&e.length>0?e:[...Hse],n=new t(r);return n.containsOnlyOIDCScopes()?n.removeScope(GQe):n.removeOIDCScopes(),n}containsScope(e){let r=this.printScopesLowerCase().split(" "),n=new t(r);return e?n.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(r=>this.containsScope(r))}containsOnlyOIDCScopes(){let e=0;return zQe.forEach(r=>{this.containsScope(r)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(r=>this.appendScope(r))}catch{throw Pt($Ot)}}removeScope(e){if(!e)throw Pt(GOt);this.scopes.delete(e.trim())}removeOIDCScopes(){zQe.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw Pt(uqe);let r=new Set;return e.scopes.forEach(n=>r.add(n.toLowerCase())),this.scopes.forEach(n=>r.add(n.toLowerCase())),r}intersectingScopeSets(e){if(!e)throw Pt(uqe);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();let r=this.unionScopeSets(e),n=e.getScopeCount(),o=this.getScopeCount();return r.sizee.push(r)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}};function hz(t,e,r){if(!e)return;let n=t.get(sM);n&&t.has(Qbe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:t.get(XQe)},e)}a(hz,"instrumentBrokerParams");function DEo(t,e){t.set(UMt,e)}a(DEo,"addResponseType");function e5t(t,e){t.set(QMt,e||bMt.QUERY)}a(e5t,"addResponseMode");function NEo(t){t.set(gOt,"1")}a(NEo,"addNativeBroker");function mz(t,e,r=!0,n=Hse){r&&!n.includes("openid")&&!e.includes("openid")&&n.push("openid");let o=r?[...e||[],...n]:e||[],s=new Rh(o);t.set(HMt,s.printScopes())}a(mz,"addScopes");function gz(t,e){t.set(sM,e)}a(gz,"addClientId");function Az(t,e){t.set(XQe,e)}a(Az,"addRedirectUri");function t5t(t,e){t.set(cOt,e)}a(t5t,"addPostLogoutRedirectUri");function r5t(t,e){t.set(lOt,e)}a(r5t,"addIdTokenHint");function n5t(t,e){t.set(_Ot,e)}a(n5t,"addDomainHint");function Xse(t,e){t.set(EOt,e)}a(Xse,"addLoginHint");function t7(t,e){t.set(Op.CCS_HEADER,`UPN:${e}`)}a(t7,"addCcsUpn");function yL(t,e){t.set(Op.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}a(yL,"addCcsOid");function dqe(t,e){t.set("sid",e)}a(dqe,"addSid");function yz(t,e,r){let n=BZr(e,r);try{JSON.parse(n)}catch{throw hl(oqe)}t.set(jMt,n)}a(yz,"addClaims");function Ez(t,e){t.set(ZMt,e)}a(Ez,"addCorrelationId");function $be(t,e){t.set(XMt,e.sku),t.set(eOt,e.version),e.os&&t.set(tOt,e.os),e.cpu&&t.set(rOt,e.cpu)}a($be,"addLibraryInfo");function Vbe(t,e){e?.appName&&t.set(sOt,e.appName),e?.appVersion&&t.set(aOt,e.appVersion)}a(Vbe,"addApplicationTelemetry");function i5t(t,e){t.set(WMt,e)}a(i5t,"addPrompt");function Wbe(t,e){e&&t.set($Mt,e)}a(Wbe,"addState");function o5t(t,e){t.set(VMt,e)}a(o5t,"addNonce");function MEo(t,e,r){if(e&&r)t.set(YMt,e),t.set(KMt,r);else throw hl(kOt)}a(MEo,"addCodeChallengeParams");function s5t(t,e){t.set(zMt,e)}a(s5t,"addAuthorizationCode");function OEo(t,e){t.set(uOt,e)}a(OEo,"addDeviceCode");function a5t(t,e){t.set(GMt,e)}a(a5t,"addRefreshToken");function c5t(t,e){t.set(JMt,e)}a(c5t,"addCodeVerifier");function zbe(t,e){t.set(dOt,e)}a(zbe,"addClientSecret");function Ybe(t,e){e&&t.set(fOt,e)}a(Ybe,"addClientAssertion");function Kbe(t,e){e&&t.set(pOt,e)}a(Kbe,"addClientAssertionType");function BEo(t,e){t.set(hOt,e)}a(BEo,"addOboAssertion");function LEo(t,e){t.set(mOt,e)}a(LEo,"addRequestTokenUse");function Jbe(t,e){t.set(qMt,e)}a(Jbe,"addGrantType");function _z(t){t.set(IMt,"1")}a(_z,"addClientInfo");function l5t(t){t.set(SOt,"1")}a(l5t,"addCliData");function Zbe(t){t.has(zse)||t.set(zse,"true")}a(Zbe,"addInstanceAware");function EL(t,e){Object.entries(e).forEach(([r,n])=>{!t.has(r)&&n&&t.set(r,n)})}a(EL,"addExtraParameters");function BZr(t,e){let r;if(!t)r={};else try{r=JSON.parse(t)}catch{throw hl(oqe)}return e&&e.length>0&&(r.hasOwnProperty(Gse.ACCESS_TOKEN)||(r[Gse.ACCESS_TOKEN]={}),r[Gse.ACCESS_TOKEN][Gse.XMS_CC]={values:e}),JSON.stringify(r)}a(BZr,"addClientCapabilitiesToClaims");function FEo(t,e){t.set(ZQe.username,e)}a(FEo,"addUsername");function UEo(t,e){t.set(ZQe.password,e)}a(UEo,"addPassword");function Xbe(t,e){e&&(t.set(eqe,rf.POP),t.set(tqe,e))}a(Xbe,"addPopToken");function e1e(t,e){e&&(t.set(eqe,rf.SSH),t.set(tqe,e))}a(e1e,"addSshJwk");function t1e(t,e){t.set(nOt,e.generateCurrentRequestHeaderValue()),t.set(iOt,e.generateLastRequestHeaderValue())}a(t1e,"addServerTelemetry");function r1e(t){t.set(oOt,OMt)}a(r1e,"addThrottling");function u5t(t,e){t.set(AOt,e)}a(u5t,"addLogoutHint");function _L(t,e,r){t.has(Qbe)||t.set(Qbe,e),t.has(nqe)||t.set(nqe,r)}a(_L,"addBrokerParameters");function QEo(t,e){t.set(vOt,encodeURIComponent(e)),t.set(COt,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}a(QEo,"addEARParameters");function n1e(t,e){e&&t.set(bOt,e)}a(n1e,"addResource");var iA={};xi(iA,{getDeserializedResponse:()=>qEo,mapToQueryString:()=>aM,normalizeUrlForComparison:()=>jEo,stripLeadingHashOrQuery:()=>FZr});p();function LZr(t){if(!t)return t;let e=t.toLowerCase();return nu.endsWith(e,"?")?e=e.slice(0,-1):nu.endsWith(e,"?/")&&(e=e.slice(0,-2)),nu.endsWith(e,"/")||(e+="/"),e}a(LZr,"canonicalizeUrl");function FZr(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}a(FZr,"stripLeadingHashOrQuery");function qEo(t){if(!t||t.indexOf("=")<0)return null;try{let e=FZr(t),r=Object.fromEntries(new URLSearchParams(e));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch{throw Pt(FOt)}return null}a(qEo,"getDeserializedResponse");function aM(t){let e=new Array;return t.forEach((r,n)=>{e.push(`${n}=${encodeURIComponent(r)}`)}),e.join("&")}a(aM,"mapToQueryString");function jEo(t){if(!t)return t;let e=t.split("#")[0];try{let r=new URL(e),n=r.origin+r.pathname+r.search;return LZr(n)}catch{return LZr(e)}}a(jEo,"normalizeUrlForComparison");p();p();var eae={createNewGuid:a(()=>{throw Pt(_s)},"createNewGuid"),base64Decode:a(()=>{throw Pt(_s)},"base64Decode"),base64Encode:a(()=>{throw Pt(_s)},"base64Encode"),base64UrlEncode:a(()=>{throw Pt(_s)},"base64UrlEncode"),encodeKid:a(()=>{throw Pt(_s)},"encodeKid"),async getPublicKeyThumbprint(){throw Pt(_s)},async removeTokenBindingKey(){throw Pt(_s)},async clearKeystore(){throw Pt(_s)},async signJwt(){throw Pt(_s)},async hashString(){throw Pt(_s)}};p();var nf;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(nf||(nf={}));var HEo=50,GEo=500,vz=new Map;function $Eo(t,e){vz.delete(t),vz.set(t,e)}a($Eo,"markAsRecentlyUsed");function VEo(t,e){let r=Date.now(),n=vz.get(t);if(n)$Eo(t,n);else if(n={logs:[],firstEventTime:r},vz.set(t,n),vz.size>HEo){let o=vz.keys().next().value;o&&vz.delete(o)}n.logs.push({...e,milliseconds:r-n.firstEventTime}),n.logs.length>GEo&&n.logs.shift()}a(VEo,"addLogToCache");function WEo(t){if(t.length!==6)return!1;for(let e=0;e="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}a(WEo,"isHashedString");var G0=class t{static{a(this,"Logger")}constructor(e,r,n){this.level=nf.Info;let o=a(()=>{},"defaultLoggerCallback"),s=e||t.createDefaultLoggerOptions();this.localCallback=s.loggerCallback||o,this.piiLoggingEnabled=s.piiLoggingEnabled||!1,this.level=typeof s.logLevel=="number"?s.logLevel:nf.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.Info}}clone(e,r){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,r)}logMessage(e,r){let n=r.correlationId;if(WEo(e)){let u={hash:e,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0};VEo(n,u)}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;let l=`${`[${new Date().toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${nf[r.logLevel]} - ${e}`;this.executeCallback(r.logLevel,l,r.containsPii||!1)}executeCallback(e,r,n){this.localCallback&&this.localCallback(e,r,n)}error(e,r){this.logMessage(e,{logLevel:nf.Error,containsPii:!1,correlationId:r})}errorPii(e,r){this.logMessage(e,{logLevel:nf.Error,containsPii:!0,correlationId:r})}warning(e,r){this.logMessage(e,{logLevel:nf.Warning,containsPii:!1,correlationId:r})}warningPii(e,r){this.logMessage(e,{logLevel:nf.Warning,containsPii:!0,correlationId:r})}info(e,r){this.logMessage(e,{logLevel:nf.Info,containsPii:!1,correlationId:r})}infoPii(e,r){this.logMessage(e,{logLevel:nf.Info,containsPii:!0,correlationId:r})}verbose(e,r){this.logMessage(e,{logLevel:nf.Verbose,containsPii:!1,correlationId:r})}verbosePii(e,r){this.logMessage(e,{logLevel:nf.Verbose,containsPii:!0,correlationId:r})}trace(e,r){this.logMessage(e,{logLevel:nf.Trace,containsPii:!1,correlationId:r})}tracePii(e,r){this.logMessage(e,{logLevel:nf.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}};p();var r7="@azure/msal-common",cM="16.4.1";p();var vL={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};p();p();function UZr(t,e){return!!t&&!!e&&t===e.split(".")[1]}a(UZr,"tenantIdMatchesHomeTenant");function Cz(t,e,r,n){if(n){let{oid:o,sub:s,tid:c,name:l,tfp:u,acr:d,preferred_username:f,upn:h,login_hint:m}=n,g=c||u||d||"";return{tenantId:g,localAccountId:o||s||"",name:l,username:f||h||"",loginHint:m,isHomeTenant:UZr(g,t)}}else return{tenantId:r,localAccountId:e,username:"",isHomeTenant:UZr(r,t)}}a(Cz,"buildTenantProfile");function fqe(t,e,r,n){let o=t;if(e){let{isHomeTenant:s,...c}=e;o={...t,...c}}if(r){let{isHomeTenant:s,...c}=Cz(t.homeAccountId,t.localAccountId,t.tenantId,r);return o={...o,...c,idTokenClaims:r,idToken:n},o}return o}a(fqe,"updateAccountTenantProfileData");var pqe={};xi(pqe,{checkMaxAge:()=>i1e,extractTokenClaims:()=>CL,getJWSPayload:()=>QZr,isKmsi:()=>d5t});p();function CL(t,e){let r=QZr(t);try{let n=e(r);return JSON.parse(n)}catch{throw Pt(cqe)}}a(CL,"extractTokenClaims");function d5t(t){if(!t.signin_state)return!1;let e=["kmsi","dvc_dmjd"];return t.signin_state.some(r=>e.includes(r.trim().toLowerCase()))}a(d5t,"isKmsi");function QZr(t){if(!t)throw Pt(OOt);let r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw Pt(cqe);return r[2]}a(QZr,"getJWSPayload");function i1e(t,e){if(e===0||Date.now()-3e5>t+e)throw Pt(qOt)}a(i1e,"checkMaxAge");p();p();var vs=class t{static{a(this,"UrlString")}get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw hl(xOt);e.includes("#")||(this._urlString=t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let r=e.toLowerCase();return nu.endsWith(r,"?")?r=r.slice(0,-1):nu.endsWith(r,"?/")&&(r=r.slice(0,-2)),nu.endsWith(r,"/")||(r+="/"),r}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw hl(Kse)}if(!e.HostNameAndPort||!e.PathSegments)throw hl(Kse);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw hl(IOt)}static appendQueryString(e,r){return r?e.indexOf("?")<0?`${e}?${r}`:`${e}&${r}`:e}static removeHashFromUrl(e){return t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){let r=this.getUrlComponents(),n=r.PathSegments;return e&&n.length!==0&&(n[0]===FP.COMMON||n[0]===FP.ORGANIZATIONS)&&(n[0]=e),t.constructAuthorityUriFromObject(r)}getUrlComponents(){let e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=this.urlString.match(e);if(!r)throw hl(Kse);let n={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5],QueryString:r[7]},o=n.AbsolutePath.split("/");return o=o.filter(s=>s&&s.length>0),n.PathSegments=o,n.QueryString&&n.QueryString.endsWith("/")&&(n.QueryString=n.QueryString.substring(0,n.QueryString.length-1)),n}static getDomainFromUrl(e){let r=RegExp("^([^:/?#]+://)?([^/?#]*)"),n=e.match(r);if(!n)throw hl(Kse);return n[2]}static getAbsoluteUrl(e,r){if(e[0]===jse){let o=new t(r).getUrlComponents();return o.Protocol+"//"+o.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}};var zEo=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function YEo(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}a(YEo,"buildOpenIdConfig");var KEo=zEo.reduce((t,{host:e,issuerHost:r})=>(t[e]=YEo(e,r||e),t),{}),jZr={endpointMetadata:KEo,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},f5t=jZr.endpointMetadata,p5t=jZr.instanceDiscoveryMetadata,h5t=new Set;p5t.metadata.forEach(t=>{t.aliases.forEach(e=>{h5t.add(e)})});function HZr(t,e,r){let n,o=t.canonicalAuthority;if(o){let s=new vs(o).getUrlComponents().HostNameAndPort;n=qZr(e,r,s,t.cloudDiscoveryMetadata?.metadata,Oy.CONFIG)||qZr(e,r,s,p5t.metadata,Oy.HARDCODED_VALUES)||t.knownAuthorities}return n||[]}a(HZr,"getAliasesFromStaticSources");function qZr(t,e,r,n,o){if(t.trace(`getAliasesFromMetadata called with source: '${o}'`,e),r&&n){let s=o1e(n,r);if(s)return t.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,e),s.aliases;t.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,e)}return null}a(qZr,"getAliasesFromMetadata");function GZr(t){return o1e(p5t.metadata,t)}a(GZr,"getCloudDiscoveryMetadataFromHardcodedValues");function o1e(t,e){for(let r=0;rm5t,createAccountEntityFromAccountInfo:()=>XEo,generateAccountId:()=>JEo,generateHomeAccountId:()=>g5t,getAccountInfo:()=>rae,isAccountEntity:()=>e_o,isSingleTenant:()=>ZEo});p();p();function tae(t,e){if(!t)throw Pt(MOt);try{let r=e(t);return JSON.parse(r)}catch{throw Pt(aqe)}}a(tae,"buildClientInfo");function lM(t){if(!t)throw Pt(aqe);let e=t.split($se,2);return{uid:e[0],utid:e.length<2?"":e[1]}}a(lM,"buildClientInfoFromHomeAccountId");p();var tx={Default:0,Adfs:1,Dsts:2,Ciam:3};p();function hqe(t){return t&&(t.tid||t.tfp||t.acr)||null}a(hqe,"getTenantIdFromIdTokenClaims");p();var By={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function JEo(t){return[t.homeAccountId,t.environment].join(lz).toLowerCase()}a(JEo,"generateAccountId");function rae(t){let e=t.tenantProfiles||[];return e.length===0&&t.realm&&t.localAccountId&&e.push(Cz(t.homeAccountId,t.localAccountId,t.realm)),{homeAccountId:t.homeAccountId,environment:t.environment,tenantId:t.realm,username:t.username,localAccountId:t.localAccountId,loginHint:t.loginHint,name:t.name,nativeAccountId:t.nativeAccountId,authorityType:t.authorityType,tenantProfiles:new Map(e.map(r=>[r.tenantId,r])),dataBoundary:t.dataBoundary}}a(rae,"getAccountInfo");function ZEo(t){return!t.tenantProfiles}a(ZEo,"isSingleTenant");function m5t(t,e,r){let n;e.authorityType===tx.Adfs?n=TMt:e.protocolMode===By.OIDC?n=YQe:n=SMt;let o,s;t.clientInfo&&r&&(o=tae(t.clientInfo,r),o.xms_tdbr&&(s=o.xms_tdbr==="EU"?"EU":"None"));let c=t.environment||e&&e.getPreferredCache();if(!c)throw Pt(Gbe);let l=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,u=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,d=l||u||"",f=t.idTokenClaims?.login_hint,h=o?.utid||hqe(t.idTokenClaims)||"",m=o?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"",g;return t.tenantProfiles?g=t.tenantProfiles:g=[Cz(t.homeAccountId,m,h,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:h,localAccountId:m,username:d,authorityType:n,loginHint:f,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:g,dataBoundary:s}}a(m5t,"createAccountEntity");function XEo(t,e,r){let n=Array.from(t.tenantProfiles?.values()||[]);return n.length===0&&t.tenantId&&t.localAccountId&&n.push(Cz(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||YQe,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:r,tenantProfiles:n,dataBoundary:t.dataBoundary}}a(XEo,"createAccountEntityFromAccountInfo");function g5t(t,e,r,n,o,s){if(!(e===tx.Adfs||e===tx.Dsts)){if(t)try{let c=tae(t,n.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}r.warning("No client info in response",o)}return s?.sub||""}a(g5t,"generateHomeAccountId");function e_o(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}a(e_o,"isAccountEntity");var n7=class{static{a(this,"CacheManager")}constructor(e,r,n,o,s){this.clientId=e,this.cryptoImpl=r,this.commonLogger=n.clone(r7,cM),this.staticAuthorityOptions=s,this.performanceClient=o}getAllAccounts(e={},r){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,r),r,e)}getAccountInfoFilteredBy(e,r){if(Object.keys(e).length===0||Object.values(e).every(o=>o==null||o===""))return this.commonLogger.warning("getAccountInfoFilteredBy: Account filter is empty or invalid, returning null",r),null;let n=this.getAllAccounts(e,r);return n.length>1?n.sort(s=>s.idTokenClaims?-1:1)[0]:n.length===1?n[0]:null}getBaseAccountInfo(e,r){let n=this.getAccountsFilteredBy(e,r);return n.length>0?rae(n[0]):null}buildTenantProfiles(e,r,n){return e.flatMap(o=>this.getTenantProfilesFromAccountEntity(o,r,n?.tenantId,n))}getTenantedAccountInfoByFilter(e,r,n,o,s){let c=null,l;if(s&&!this.tenantProfileMatchesFilter(n,s))return null;let u=this.getIdToken(e,o,r,n.tenantId);return u&&(l=CL(u.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(l,s))?null:(c=fqe(e,n,l,u?.secret),c)}getTenantProfilesFromAccountEntity(e,r,n,o){let s=rae(e),c=s.tenantProfiles||new Map,l=this.getTokenKeys();if(n){let d=c.get(n);if(d)c=new Map([[n,d]]);else return[]}let u=[];return c.forEach(d=>{let f=this.getTenantedAccountInfoByFilter(s,l,d,r,o);f&&u.push(f)}),u}tenantProfileMatchesFilter(e,r){return!(r.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,r.localAccountId)||r.name&&e.name!==r.name||r.isHomeTenant!==void 0&&e.isHomeTenant!==r.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,r){return!(r&&(r.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,r.localAccountId)||r.loginHint&&!this.matchLoginHintFromTokenClaims(e,r.loginHint)||r.username&&!this.matchUsername(e.preferred_username,r.username)||r.name&&!this.matchName(e,r.name)||r.sid&&!this.matchSid(e,r.sid)))}async saveCacheRecord(e,r,n,o,s){if(!e)throw Pt(VOt);try{e.account&&await this.setAccount(e.account,r,n,o),e.idToken&&s?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,r,n),e.accessToken&&s?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,r,n),e.refreshToken&&s?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,r,n),e.appMetadata&&this.setAppMetadata(e.appMetadata,r)}catch(c){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",r),c instanceof Oo?c:WZr(c)}}async saveAccessToken(e,r,n){let o={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},s=this.getTokenKeys(),c=Rh.fromString(e.target);s.accessToken.forEach(l=>{if(!this.accessTokenKeyMatchesFilter(l,o,!1))return;let u=this.getAccessTokenCredential(l,r);u&&this.credentialMatchesFilter(u,o,r)&&Rh.fromString(u.target).intersectingScopeSets(c)&&this.removeAccessToken(l,r)}),await this.setAccessTokenCredential(e,r,n)}getAccountsFilteredBy(e,r){let n=this.getAccountKeys(),o=[];return n.forEach(s=>{let c=this.getAccount(s,r);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,r)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;let l={localAccountId:e?.localAccountId,name:e?.name},u=c.tenantProfiles?.filter(d=>this.tenantProfileMatchesFilter(d,l));u&&u.length===0||o.push(c)}),o}credentialMatchesFilter(e,r,n){return!(r.clientId&&!this.matchClientId(e,r.clientId)||r.userAssertionHash&&!this.matchUserAssertionHash(e,r.userAssertionHash)||typeof r.homeAccountId=="string"&&!this.matchHomeAccountId(e,r.homeAccountId)||r.environment&&!this.matchEnvironment(e,r.environment,n)||r.realm&&!this.matchRealm(e,r.realm)||r.credentialType&&!this.matchCredentialType(e,r.credentialType)||r.familyId&&!this.matchFamilyId(e,r.familyId)||r.target&&!this.matchTarget(e,r.target)||e.credentialType===H0.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(r.tokenType&&!this.matchTokenType(e,r.tokenType)||r.tokenType===rf.SSH&&r.keyId&&!this.matchKeyId(e,r.keyId)))}getAppMetadataFilteredBy(e,r){let n=this.getKeys(),o={};return n.forEach(s=>{if(!this.isAppMetadata(s))return;let c=this.getAppMetadata(s,r);c&&(e.environment&&!this.matchEnvironment(c,e.environment,r)||e.clientId&&!this.matchClientId(c,e.clientId)||(o[s]=c))}),o}getAuthorityMetadataByAlias(e,r){let n=this.getAuthorityMetadataKeys(),o=null;return n.forEach(s=>{if(!this.isAuthorityMetadata(s)||s.indexOf(this.clientId)===-1)return;let c=this.getAuthorityMetadata(s,r);c&&c.aliases.indexOf(e)!==-1&&(o=c)}),o}removeAllAccounts(e){this.getAllAccounts({},e).forEach(n=>{this.removeAccount(n,e)})}removeAccount(e,r){this.removeAccountContext(e,r);let n=this.getAccountKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.filter(o).forEach(s=>{this.removeItem(s,r),this.performanceClient.incrementFields({accountsRemoved:1},r)})}removeAccountContext(e,r){let n=this.getTokenKeys(),o=a(s=>s.includes(e.homeAccountId)&&s.includes(e.environment),"keyFilter");n.idToken.filter(o).forEach(s=>{this.removeIdToken(s,r)}),n.accessToken.filter(o).forEach(s=>{this.removeAccessToken(s,r)}),n.refreshToken.filter(o).forEach(s=>{this.removeRefreshToken(s,r)})}removeAccessToken(e,r){let n=this.getAccessTokenCredential(e,r);if(n&&(this.removeItem(e,r),this.performanceClient.incrementFields({accessTokensRemoved:1},r),n.credentialType.toLowerCase()===H0.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&n.tokenType===rf.POP)){let s=n.keyId;s&&this.cryptoImpl.removeTokenBindingKey(s,r).catch(()=>{this.commonLogger.error(`Failed to remove token binding key '${s}'`,r),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},r)})}}removeAppMetadata(e){return this.getKeys().forEach(n=>{this.isAppMetadata(n)&&this.removeItem(n,e)}),!0}getIdToken(e,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called",r);let s={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:H0.ID_TOKEN,clientId:this.clientId,realm:o},c=this.getIdTokensByFilter(s,r,n),l=c.size;if(l<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",r),null;if(l>1){let u=c;if(!o){let d=new Map;c.forEach((h,m)=>{h.realm===e.tenantId&&d.set(m,h)});let f=d.size;if(f<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",r),c.values().next().value;if(f===1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",r),d.values().next().value;u=d}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",r),u.forEach((d,f)=>{this.removeIdToken(f,r)}),this.performanceClient.addFields({multiMatchedID:c.size},r),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",r),c.values().next().value}getIdTokensByFilter(e,r,n){let o=n&&n.idToken||this.getTokenKeys().idToken,s=new Map;return o.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;let l=this.getIdTokenCredential(c,r);l&&this.credentialMatchesFilter(l,e,r)&&s.set(c,l)}),s}idTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}removeIdToken(e,r){this.removeItem(e,r)}removeRefreshToken(e,r){this.removeItem(e,r)}getAccessToken(e,r,n,o){let s=r.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",s);let c=Rh.createSearchScopes(r.scopes),l=r.authenticationScheme||rf.BEARER,u=l&&l.toLowerCase()!==rf.BEARER.toLowerCase()?H0.ACCESS_TOKEN_WITH_AUTH_SCHEME:H0.ACCESS_TOKEN,d={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:u,clientId:this.clientId,realm:o||e.tenantId,target:c,tokenType:l,keyId:r.sshKid},f=n&&n.accessToken||this.getTokenKeys().accessToken,h=[];f.forEach(g=>{if(this.accessTokenKeyMatchesFilter(g,d,!0)){let A=this.getAccessTokenCredential(g,s);A&&this.credentialMatchesFilter(A,d,s)&&h.push(A)}});let m=h.length;return m<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",s),null):m>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",s),h.forEach(g=>{this.removeAccessToken(this.generateCredentialKey(g),s)}),this.performanceClient.addFields({multiMatchedAT:h.length},s),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",s),h[0])}accessTokenKeyMatchesFilter(e,r,n){let o=e.toLowerCase();if(r.clientId&&o.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&o.indexOf(r.homeAccountId.toLowerCase())===-1||r.realm&&o.indexOf(r.realm.toLowerCase())===-1)return!1;if(r.target){let s=r.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(s,e,!0))return;let c=this.getAccessTokenCredential(s,r);c&&this.credentialMatchesFilter(c,e,r)&&o.push(c)}),o}getRefreshToken(e,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called",n);let s=r?uz:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:H0.REFRESH_TOKEN,clientId:this.clientId,familyId:s},l=o&&o.refreshToken||this.getTokenKeys().refreshToken,u=[];l.forEach(f=>{if(this.refreshTokenKeyMatchesFilter(f,c)){let h=this.getRefreshTokenCredential(f,n);h&&this.credentialMatchesFilter(h,c,n)&&u.push(h)}});let d=u.length;return d<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",n),null):(d>1&&this.performanceClient.addFields({multiMatchedRT:d},n),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",n),u[0])}refreshTokenKeyMatchesFilter(e,r){let n=e.toLowerCase();return!(r.familyId&&n.indexOf(r.familyId.toLowerCase())===-1||!r.familyId&&r.clientId&&n.indexOf(r.clientId.toLowerCase())===-1||r.homeAccountId&&n.indexOf(r.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,r){let n={environment:e,clientId:this.clientId},o=this.getAppMetadataFilteredBy(n,r),s=Object.keys(o).map(l=>o[l]),c=s.length;if(c<1)return null;if(c>1)throw Pt(jOt);return s[0]}isAppMetadataFOCI(e,r){let n=this.readAppMetadataFromCache(e,r);return!!(n&&n.familyId===uz)}matchHomeAccountId(e,r){return typeof e.homeAccountId=="string"&&r===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,r){let n=e.oid||e.sub;return r===n}matchLocalAccountIdFromTenantProfile(e,r){return e.localAccountId===r}matchName(e,r){return r.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,r){return!!(e&&typeof e=="string"&&r?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,r){return!!(e.userAssertionHash&&r===e.userAssertionHash)}matchEnvironment(e,r,n){if(this.staticAuthorityOptions){let s=HZr(this.staticAuthorityOptions,this.commonLogger,n);if(s.includes(r)&&s.includes(e.environment))return!0}let o=this.getAuthorityMetadataByAlias(r,n);return!!(o&&o.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,r){return e.credentialType&&r.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,r){return!!(e.clientId&&r===e.clientId)}matchFamilyId(e,r){return!!(e.familyId&&r===e.familyId)}matchRealm(e,r){return e.realm?.toLowerCase()===r.toLowerCase()}matchNativeAccountId(e,r){return!!(e.nativeAccountId&&r===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,r){return e.login_hint===r||e.preferred_username===r||e.upn===r}matchSid(e,r){return e.sid===r}matchAuthorityType(e,r){return!!(e.authorityType&&r.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,r){return e.credentialType!==H0.ACCESS_TOKEN&&e.credentialType!==H0.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:Rh.fromString(e.target).containsScopeSet(r)}matchTokenType(e,r){return!!(e.tokenType&&e.tokenType===r)}matchKeyId(e,r){return!!(e.keyId&&e.keyId===r)}isAppMetadata(e){return e.indexOf(Vse)!==-1}isAuthorityMetadata(e){return e.indexOf(Wse)!==-1}generateAuthorityMetadataCacheKey(e){return`${Wse}-${this.clientId}-${e}`}static toObject(e,r){for(let n in r)e[n]=r[n];return e}},a1e=class extends n7{static{a(this,"DefaultStorageClass")}async setAccount(){throw Pt(_s)}getAccount(){throw Pt(_s)}async setIdTokenCredential(){throw Pt(_s)}getIdTokenCredential(){throw Pt(_s)}async setAccessTokenCredential(){throw Pt(_s)}getAccessTokenCredential(){throw Pt(_s)}async setRefreshTokenCredential(){throw Pt(_s)}getRefreshTokenCredential(){throw Pt(_s)}setAppMetadata(){throw Pt(_s)}getAppMetadata(){throw Pt(_s)}setServerTelemetry(){throw Pt(_s)}getServerTelemetry(){throw Pt(_s)}setAuthorityMetadata(){throw Pt(_s)}getAuthorityMetadata(){throw Pt(_s)}getAuthorityMetadataKeys(){throw Pt(_s)}setThrottlingCache(){throw Pt(_s)}getThrottlingCache(){throw Pt(_s)}removeItem(){throw Pt(_s)}getKeys(){throw Pt(_s)}getAccountKeys(){throw Pt(_s)}getTokenKeys(){throw Pt(_s)}generateCredentialKey(){throw Pt(_s)}generateAccountKey(){throw Pt(_s)}};p();p();var zZr={NotStarted:0,InProgress:1,Completed:2};var Ph=class{static{a(this,"StubPerformanceClient")}generateId(){return"callback-id"}startMeasurement(e,r){return{end:a(()=>null,"end"),discard:a(()=>{},"discard"),add:a(()=>{},"add"),increment:a(()=>{},"increment"),event:{eventId:this.generateId(),status:zZr.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:r||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}};var YZr={tokenRenewalOffsetSeconds:FMt,preventCorsPreflight:!1},t_o={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.Info,correlationId:""},r_o={async sendGetRequestAsync(){throw Pt(_s)},async sendPostRequestAsync(){throw Pt(_s)}},n_o={sku:sMt,version:cM,cpu:"",os:""},i_o={clientSecret:"",clientAssertion:void 0},o_o={azureCloudInstance:vL.None,tenant:`${Nbe}`},s_o={application:{appName:"",appVersion:""}};function bL({authOptions:t,systemOptions:e,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:c,libraryInfo:l,telemetry:u,serverTelemetryManager:d,persistencePlugin:f,serializableCache:h}){let m={...t_o,...r};return{authOptions:a_o(t),systemOptions:{...YZr,...e},loggerOptions:m,storageInterface:n||new a1e(t.clientId,eae,new G0(m),new Ph),networkInterface:o||r_o,cryptoInterface:s||eae,clientCredentials:c||i_o,libraryInfo:{...n_o,...l},telemetry:{...s_o,...u},serverTelemetryManager:d||null,persistencePlugin:f||null,serializableCache:h||null}}a(bL,"buildClientConfiguration");function a_o(t){return{clientCapabilities:[],azureCloudOptions:o_o,instanceAware:!1,isMcp:!1,...t}}a(a_o,"buildAuthOptions");function mqe(t){return t.authOptions.authority.options.protocolMode===By.OIDC}a(mqe,"isOidcProtocolMode");p();p();var Y1=class{static{a(this,"TokenCacheContext")}constructor(e,r){this.cache=e,this.hasChanged=r}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}};var c_={};xi(c_,{createAccessTokenEntity:()=>E5t,createIdTokenEntity:()=>y5t,createRefreshTokenEntity:()=>_5t,generateAppMetadataKey:()=>g_o,generateAuthorityMetadataExpiresAt:()=>Aqe,isAccessTokenEntity:()=>d_o,isAppMetadataEntity:()=>A_o,isAuthorityMetadataEntity:()=>y_o,isAuthorityMetadataExpired:()=>yqe,isCredentialEntity:()=>gqe,isIdTokenEntity:()=>f_o,isRefreshTokenEntity:()=>p_o,isServerTelemetryEntity:()=>h_o,isThrottlingEntity:()=>m_o,updateAuthorityEndpointMetadata:()=>iae,updateCloudDiscoveryMetadata:()=>l1e});p();var ju={};xi(ju,{delay:()=>u_o,isCacheExpired:()=>l_o,isTokenExpired:()=>nae,nowSeconds:()=>K1,toDateFromSeconds:()=>c1e,toSecondsFromDate:()=>c_o,wasClockTurnedBack:()=>A5t});p();function K1(){return Math.round(new Date().getTime()/1e3)}a(K1,"nowSeconds");function c_o(t){return t.getTime()/1e3}a(c_o,"toSecondsFromDate");function c1e(t){return t?new Date(Number(t)*1e3):new Date}a(c1e,"toDateFromSeconds");function nae(t,e){let r=Number(t)||0;return K1()+e>r}a(nae,"isTokenExpired");function l_o(t,e){let r=Number(t)+e*24*60*60*1e3;return Date.now()>r}a(l_o,"isCacheExpired");function A5t(t){return Number(t)>K1()}a(A5t,"wasClockTurnedBack");function u_o(t,e){return new Promise(r=>setTimeout(()=>r(e),t))}a(u_o,"delay");function y5t(t,e,r,n,o){return{credentialType:H0.ID_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}a(y5t,"createIdTokenEntity");function E5t(t,e,r,n,o,s,c,l,u,d,f,h,m){let g={homeAccountId:t,credentialType:H0.ACCESS_TOKEN,secret:r,cachedAt:K1().toString(),expiresOn:c.toString(),extendedExpiresOn:l.toString(),environment:e,clientId:n,realm:o,target:s,tokenType:f||rf.BEARER,lastUpdatedAt:Date.now().toString()};if(h&&(g.userAssertionHash=h),d&&(g.refreshOn=d.toString()),g.tokenType?.toLowerCase()!==rf.BEARER.toLowerCase())switch(g.credentialType=H0.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case rf.POP:let A=CL(r,u);if(!A?.cnf?.kid)throw Pt(zOt);g.keyId=A.cnf.kid;break;case rf.SSH:g.keyId=m}return g}a(E5t,"createAccessTokenEntity");function _5t(t,e,r,n,o,s,c){let l={credentialType:H0.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return s&&(l.userAssertionHash=s),o&&(l.familyId=o),c&&(l.expiresOn=c.toString()),l}a(_5t,"createRefreshTokenEntity");function gqe(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}a(gqe,"isCredentialEntity");function d_o(t){return t?gqe(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===H0.ACCESS_TOKEN||t.credentialType===H0.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}a(d_o,"isAccessTokenEntity");function f_o(t){return t?gqe(t)&&t.hasOwnProperty("realm")&&t.credentialType===H0.ID_TOKEN:!1}a(f_o,"isIdTokenEntity");function p_o(t){return t?gqe(t)&&t.credentialType===H0.REFRESH_TOKEN:!1}a(p_o,"isRefreshTokenEntity");function h_o(t,e){let r=t.indexOf(Lbe)===0,n=!0;return e&&(n=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),r&&n}a(h_o,"isServerTelemetryEntity");function m_o(t,e){let r=!1;t&&(r=t.indexOf(Fbe)===0);let n=!0;return e&&(n=e.hasOwnProperty("throttleTime")),r&&n}a(m_o,"isThrottlingEntity");function g_o({environment:t,clientId:e}){return[Vse,t,e].join(lz).toLowerCase()}a(g_o,"generateAppMetadataKey");function A_o(t,e){return e?t.indexOf(Vse)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}a(A_o,"isAppMetadataEntity");function y_o(t,e){return e?t.indexOf(Wse)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}a(y_o,"isAuthorityMetadataEntity");function Aqe(){return K1()+xMt}a(Aqe,"generateAuthorityMetadataExpiresAt");function iae(t,e,r){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=r,t.jwks_uri=e.jwks_uri}a(iae,"updateAuthorityEndpointMetadata");function l1e(t,e,r){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=r}a(l1e,"updateCloudDiscoveryMetadata");function yqe(t){return t.expiresAt<=K1()}a(yqe,"isAuthorityMetadataExpired");p();p();var KZr="networkClientSendPostRequestAsync",JZr="refreshTokenClientExecutePostToTokenEndpoint",ZZr="authorizationCodeClientExecutePostToTokenEndpoint",XZr="refreshTokenClientExecuteTokenRequest",eXr="refreshTokenClientAcquireToken",Eqe="refreshTokenClientAcquireTokenWithCachedRefreshToken",tXr="refreshTokenClientCreateTokenRequestBody",rXr="silentFlowClientGenerateResultFromCacheRecord";var nXr="authClientExecuteTokenRequest",iXr="authClientCreateTokenRequestBody",oXr="updateTokenEndpointAuthority",oae="popTokenGenerateCnf",_qe="handleServerTokenResponse",sXr="authorityResolveEndpointsAsync",aXr="authorityGetCloudDiscoveryMetadataFromNetwork",cXr="authorityUpdateCloudDiscoveryMetadata",lXr="authorityGetEndpointMetadataFromNetwork",uXr="authorityUpdateEndpointMetadata",v5t="authorityUpdateMetadataWithRegionalInformation",dXr="regionDiscoveryDetectRegion",C5t="regionDiscoveryGetRegionFromIMDS",fXr="regionDiscoveryGetCurrentVersion",pXr="cacheManagerGetRefreshToken";p();var hXr=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);o&&n.incrementFields({[`ext.${e}CallCount`]:1},o);try{let l=t(...s);return c.end({success:!0}),r.trace(`Returning result from '${e}'`,o),l}catch(l){r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l}},"invoke"),Gs=a((t,e,r,n,o)=>(...s)=>{r.trace(`Executing function '${e}'`,o);let c=n.startMeasurement(e,o);return o&&n.incrementFields({[`ext.${e}CallCount`]:1},o),t(...s).then(l=>(r.trace(`Returning result from '${e}'`,o),c.end({success:!0}),l)).catch(l=>{r.trace(`Error occurred in '${e}'`,o);try{r.trace(JSON.stringify(l),o)}catch{r.trace("Unable to print error message.",o)}throw c.end({success:!1},l),l})},"invokeAsync");var E_o={SW:"sw"},i7=class{static{a(this,"PopTokenGenerator")}constructor(e,r){this.cryptoUtils=e,this.performanceClient=r}async generateCnf(e,r){let n=await Gs(this.generateKid.bind(this),oae,r,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:o}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:E_o.SW}}async signPopToken(e,r,n){return this.signPayload(e,r,n)}async signPayload(e,r,n,o){let{resourceRequestMethod:s,resourceRequestUri:c,shrClaims:l,shrNonce:u,shrOptions:d}=n,h=(c?new vs(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:K1(),m:s?.toUpperCase(),u:h?.HostNameAndPort,nonce:u||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:l||void 0,...o},r,d,n.correlationId)}};p();var Cqe={};xi(Cqe,{badToken:()=>u1e,consentRequired:()=>I5t,interactionRequired:()=>T5t,interruptedUser:()=>w5t,loginRequired:()=>x5t,nativeAccountUnavailable:()=>__o,noTokensFound:()=>vqe,refreshTokenExpired:()=>b5t,uxNotAllowed:()=>S5t});p();var vqe="no_tokens_found",__o="native_account_unavailable",b5t="refresh_token_expired",S5t="ux_not_allowed",T5t="interaction_required",I5t="consent_required",x5t="login_required",u1e="bad_token",w5t="interrupted_user";var mXr=[T5t,I5t,x5t,u1e,S5t,w5t],v_o=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed","interrupted_user"],J1=class t extends Oo{static{a(this,"InteractionRequiredAuthError")}constructor(e,r,n,o,s,c,l,u){super(e,r,n),Object.setPrototypeOf(this,t.prototype),this.timestamp=o||"",this.traceId=s||"",this.correlationId=c||"",this.claims=l||"",this.name="InteractionRequiredAuthError",this.errorNo=u}};function bqe(t,e,r){let n=!!t&&mXr.indexOf(t)>-1,o=!!r&&v_o.indexOf(r)>-1,s=!!e&&mXr.some(c=>e.indexOf(c)>-1);return n||s||o}a(bqe,"isInteractionRequiredError");function Sqe(t,e){return new J1(t,e)}a(Sqe,"createInteractionRequiredAuthError");p();var l_=class t extends Oo{static{a(this,"ServerError")}constructor(e,r,n,o,s){super(e,r,n),this.name="ServerError",this.errorNo=o,this.status=s,Object.setPrototypeOf(this,t.prototype)}};p();function gXr(t,e){if(!t)throw Pt(WOt);if(!e)throw Pt(pz);try{let r=e.split(HQe),n=r[0],o=r.length>1?r.slice(1).join(HQe):"",s=t(n),c=JSON.parse(s);return{userRequestState:o||"",libraryState:c}}catch{throw Pt(pz)}}a(gXr,"parseRequestState");var Lp=class t{static{a(this,"ResponseHandler")}constructor(e,r,n,o,s,c,l){this.clientId=e,this.cacheStorage=r,this.cryptoObj=n,this.logger=o,this.performanceClient=s,this.serializableCache=c,this.persistencePlugin=l}validateTokenResponse(e,r,n){if(e.error||e.error_description||e.suberror){let o=`Error(s): ${e.error_codes||cz} - Timestamp: ${e.timestamp||cz} - Description: ${e.error_description||cz} - Correlation ID: ${e.correlation_id||cz} - Trace ID: ${e.trace_id||cz}`,s=e.error_codes?.length?e.error_codes[0]:void 0,c=new l_(e.error,o,e.suberror,s,e.status);if(n&&e.status&&e.status>=vMt&&e.status<=CMt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed. +${c}`,r);return}else if(n&&e.status&&e.status>=EMt&&e.status<=_Mt){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token. +${c}`,r);return}throw bqe(e.error,e.error_description,e.suberror)?new J1(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):c}}async handleServerTokenResponse(e,r,n,o,s,c,l,u,d,f){let h;if(e.id_token){if(h=CL(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&h.nonce!==c.nonce)throw Pt(QOt);if(o.maxAge||o.maxAge===0){let y=h.auth_time;if(!y)throw Pt(jbe);i1e(y,o.maxAge)}}this.homeAccountIdentifier=g5t(e.client_info||"",r.authorityType,this.logger,this.cryptoObj,o.correlationId,h);let m;c&&c.state&&(m=gXr(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||o.sshKid||void 0;let g=this.generateCacheRecord(e,r,n,o,h,l,c),A;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",o.correlationId),A=new Y1(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(A)),u&&!d&&g.account&&this.cacheStorage.getAllAccounts({homeAccountId:g.account.homeAccountId,environment:g.account.environment},o.correlationId).length<1)return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",o.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},o.correlationId),await t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,void 0,f);await this.cacheStorage.saveCacheRecord(g,o.correlationId,d5t(h||{}),s,o.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&A&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",o.correlationId),await this.persistencePlugin.afterCacheAccess(A))}return t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,this.performanceClient,h,m,e,f)}generateCacheRecord(e,r,n,o,s,c,l){let u=r.getPreferredCache();if(!u)throw Pt(Gbe);let d=hqe(s),f,h;e.id_token&&s&&(f=y5t(this.homeAccountIdentifier,u,e.id_token,this.clientId,d||""),h=AXr(this.cacheStorage,r,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o.correlationId,s,e.client_info,u,d,l,void 0,this.logger,this.performanceClient));let m=null;if(e.access_token){let y=e.scope?Rh.fromString(e.scope):new Rh(o.scopes||[]),E=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=n+E,T=b+_,w=v&&v>0?n+v:void 0;m=E5t(this.homeAccountIdentifier,u,e.access_token,this.clientId,d||r.tenant||"",y.printScopes(),b,T,this.cryptoObj.base64Decode,w,e.token_type,c,e.key_id);let R=o.resource||null;R&&(m.resource=R)}let g=null;if(e.refresh_token){let y;if(e.refresh_token_expires_in){let E=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;y=n+E,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:y},o.correlationId)}g=_5t(this.homeAccountIdentifier,u,e.refresh_token,this.clientId,e.foci,c,y)}let A=null;return e.foci&&(A={clientId:this.clientId,environment:u,familyId:e.foci}),{account:h,idToken:f,accessToken:m,refreshToken:g,appMetadata:A}}static async generateAuthenticationResult(e,r,n,o,s,c,l,u,d,f){let h="",m=[],g=null,A,y,E="";if(n.accessToken){if(n.accessToken.tokenType===rf.POP&&!s.popKid){let T=new i7(e,c),{secret:w,keyId:R}=n.accessToken;if(!R)throw Pt(JOt);h=await T.signPopToken(w,R,s)}else h=n.accessToken.secret;m=Rh.fromString(n.accessToken.target).asArray(),g=c1e(n.accessToken.expiresOn),A=c1e(n.accessToken.extendedExpiresOn),n.accessToken.refreshOn&&(y=c1e(n.accessToken.refreshOn))}n.appMetadata&&(E=n.appMetadata.familyId===uz?uz:"");let _=l?.oid||l?.sub||"",v=l?.tid||"";d?.spa_accountid&&n.account&&(n.account.nativeAccountId=d?.spa_accountid);let b=n.account?fqe(rae(n.account),void 0,l,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:_,tenantId:v,scopes:m,account:b,idToken:n?.idToken?.secret||"",idTokenClaims:l||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:A,refreshOn:y,correlationId:s.correlationId,requestId:f||"",familyId:E,tokenType:n.accessToken?.tokenType||"",state:u?u.userRequestState:"",cloudGraphHostName:n.account?.cloudGraphHostName||"",msGraphHost:n.account?.msGraphHost||"",code:d?.spa_code,fromPlatformBroker:!1}}};function AXr(t,e,r,n,o,s,c,l,u,d,f,h,m){h?.verbose("setCachedAccount called",o);let g=l||e.getPreferredCache(),A=t.getAccountsFilteredBy({homeAccountId:r,environment:g},o);m?.addFields({cacheMatchedAccounts:A.length},o),A.length>1&&h?.warning("Multiple base accounts matched homeAccountId. Ignoring cached account and creating a new base account.",o);let E=(A.length===1?A[0]:null)||m5t({homeAccountId:r,idTokenClaims:s,clientInfo:c,environment:l,cloudGraphHostName:d?.cloud_graph_host_name,msGraphHost:d?.msgraph_host,nativeAccountId:f},e,n),_=E.tenantProfiles||[],v=u||E.realm;if(v&&!_.find(b=>b.tenantId===v)){let b=Cz(r,E.localAccountId,v,s);_.push(b)}return E.tenantProfiles=_,E}a(AXr,"buildAccountToCache");p();var u_={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};p();async function d_(t,e,r){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:r})}a(d_,"getClientAssertion");p();function sae(t,e,r){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:r,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}a(sae,"getRequestThumbprint");var Sz={};xi(Sz,{createTokenQueryParameters:()=>p1e,createTokenRequestHeaders:()=>f1e,executePostToTokenEndpoint:()=>h1e,sendPostRequest:()=>yXr});p();p();var d1e=class t{static{a(this,"ThrottlingUtils")}static generateThrottlingStorageKey(e){return`${Fbe}.${JSON.stringify(e)}`}static preProcess(e,r,n){let o=t.generateThrottlingStorageKey(r),s=e.getThrottlingCache(o,n);if(s){if(s.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Op.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){let r=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(r||NMt),n+MMt)*1e3)}static removeThrottle(e,r,n,o){let s=sae(r,n,o),c=this.generateThrottlingStorageKey(s);e.removeItem(c,n.correlationId)}};p();var aae=class t extends Oo{static{a(this,"NetworkError")}constructor(e,r,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,t.prototype),this.name="NetworkError",this.error=e,this.httpStatus=r,this.responseHeaders=n}};function R5t(t,e,r,n){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new aae(t,e,r)}a(R5t,"createNetworkError");function f1e(t,e,r){let n={};if(n[Op.CONTENT_TYPE]=fMt,!e&&r)switch(r.type){case u_.HOME_ACCOUNT_ID:try{let o=lM(r.credential);n[Op.CCS_HEADER]=`Oid:${o.uid}@${o.utid}`}catch(o){t.verbose(`Could not parse home account ID for CCS Header: '${o}'`,"")}break;case u_.UPN:n[Op.CCS_HEADER]=`UPN: ${r.credential}`;break}return n}a(f1e,"createTokenRequestHeaders");function p1e(t,e,r,n){let o=new Map;return t.embeddedClientId&&_L(o,e,r),t.extraQueryParameters&&EL(o,t.extraQueryParameters),Ez(o,t.correlationId),hz(o,t.correlationId,n),aM(o)}a(p1e,"createTokenQueryParameters");async function h1e(t,e,r,n,o,s,c,l,u,d){let f=await yXr(n,t,{body:e,headers:r},o,s,c,l,u);return d&&f.status<500&&f.status!==429&&d.clearTelemetryCache(),f}a(h1e,"executePostToTokenEndpoint");async function yXr(t,e,r,n,o,s,c,l){d1e.preProcess(o,t,n);let u;try{u=await Gs(s.sendPostRequestAsync.bind(s),KZr,c,l,n)(e,r);let d=u.headers||{};l?.addFields({refreshTokenSize:u.body.refresh_token?.length||0,httpVerToken:d[Op.X_MS_HTTP_VERSION]||"",requestId:d[Op.X_MS_REQUEST_ID]||""},n)}catch(d){if(d instanceof aae){let f=d.responseHeaders;throw f&&l?.addFields({httpVerToken:f[Op.X_MS_HTTP_VERSION]||"",requestId:f[Op.X_MS_REQUEST_ID]||"",contentTypeHeader:f[Op.CONTENT_TYPE]||void 0,contentLengthHeader:f[Op.CONTENT_LENGTH]||void 0,httpStatus:d.httpStatus},n),d.error}throw d instanceof Oo?d:Pt(BOt)}return d1e.postProcess(o,t,u,n),u}a(yXr,"sendPostRequest");var Iqe={};xi(Iqe,{createDiscoveredInstance:()=>k5t});p();p();p();function EXr(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}a(EXr,"isOpenIdConfigResponse");p();function _Xr(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}a(_Xr,"isCloudInstanceDiscoveryResponse");p();function vXr(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}a(vXr,"isCloudInstanceDiscoveryErrorResponse");p();var m1e=class t{static{a(this,"RegionDiscovery")}constructor(e,r,n,o){this.networkInterface=e,this.logger=r,this.performanceClient=n,this.correlationId=o}async detectRegion(e,r){let n=e;if(n)r.region_source=XU.ENVIRONMENT_VARIABLE;else{let o=t.IMDS_OPTIONS;try{let s=await Gs(this.getRegionFromIMDS.bind(this),C5t,this.logger,this.performanceClient,this.correlationId)(pMt,o);if(s.status===VQe&&(n=s.body,r.region_source=XU.IMDS),s.status===WQe){let c=await Gs(this.getCurrentVersion.bind(this),fXr,this.logger,this.performanceClient,this.correlationId)(o);if(!c)return r.region_source=XU.FAILED_AUTO_DETECTION,null;let l=await Gs(this.getRegionFromIMDS.bind(this),C5t,this.logger,this.performanceClient,this.correlationId)(c,o);l.status===VQe&&(n=l.body,r.region_source=XU.IMDS)}}catch{return r.region_source=XU.FAILED_AUTO_DETECTION,null}}return n||(r.region_source=XU.FAILED_AUTO_DETECTION),n||null}async getRegionFromIMDS(e,r){return this.networkInterface.sendGetRequestAsync(`${$Qe}?api-version=${e}&format=text`,r,hMt)}async getCurrentVersion(e){try{let r=await this.networkInterface.sendGetRequestAsync(`${$Qe}?format=json`,e);return r.status===WQe&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch{return null}}};m1e.IMDS_OPTIONS={headers:{Metadata:"true"}};var qP=class t{static{a(this,"Authority")}constructor(e,r,n,o,s,c,l,u){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=r,this.cacheManager=n,this.authorityOptions=o,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=s,this.performanceClient=l,this.correlationId=c,this.managedIdentity=u||!1,this.regionDiscovery=new m1e(r,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(jQe))return tx.Ciam;let r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case cMt:return tx.Adfs;case lMt:return tx.Dsts}return tx.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new vs(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw Pt(QP)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw Pt(QP)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw Pt(QP)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw Pt(KOt);return this.replacePath(this.metadata.end_session_endpoint)}else throw Pt(QP)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw Pt(QP)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw Pt(QP)}canReplaceTenant(e){return e.PathSegments.length===1&&!t.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===tx.Default&&this.protocolMode!==By.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let r=e,o=new vs(this.metadata.canonical_authority).getUrlComponents(),s=o.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((l,u)=>{let d=s[u];if(u===0&&this.canReplaceTenant(o)){let f=new vs(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];d!==f&&(this.logger.verbose(`Replacing tenant domain name '${d}' with id '${f}'`,this.correlationId),d=f)}l!==d&&(r=r.replace(`/${d}/`,`/${l}/`))}),this.replaceTenant(r)}get defaultOpenIdConfigurationEndpoint(){let e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===tx.Adfs||this.protocolMode===By.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){let e=this.getCurrentMetadataEntity(),r=await Gs(this.updateCloudDiscoveryMetadata.bind(this),cXr,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);let n=await Gs(this.updateEndpointMetadata.bind(this),uXr,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,r,{source:n}),this.performanceClient?.addFields({cloudDiscoverySource:r,authorityEndpointSource:n},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Aqe(),jwks_uri:""}),e}updateCachedMetadata(e,r,n){r!==Oy.CACHE&&n?.source!==Oy.CACHE&&(e.expiresAt=Aqe(),e.canonical_authority=this.canonicalAuthority);let o=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(o,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){let r=this.updateEndpointMetadataFromLocalSources(e);if(r){if(r.source===Oy.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&r.metadata){let o=await Gs(this.updateMetadataWithRegionalInformation.bind(this),v5t,this.logger,this.performanceClient,this.correlationId)(r.metadata);iae(e,o,!1),e.canonical_authority=this.canonicalAuthority}return r.source}let n=await Gs(this.getEndpointMetadataFromNetwork.bind(this),lXr,this.logger,this.performanceClient,this.correlationId)();if(n)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(n=await Gs(this.updateMetadataWithRegionalInformation.bind(this),v5t,this.logger,this.performanceClient,this.correlationId)(n)),iae(e,n,!0),Oy.NETWORK;throw Pt(LOt,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);let r=this.getEndpointMetadataFromConfig();if(r)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),iae(e,r,!1),{source:Oy.CONFIG};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);let n=this.getEndpointMetadataFromHardcodedValues();if(n)return iae(e,n,!1),{source:Oy.HARDCODED_VALUES,metadata:n};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);let o=yqe(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!o?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Oy.CACHE}):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new vs(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw hl(DOt)}return null}async getEndpointMetadataFromNetwork(){let e={},r=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${r}'`,this.correlationId);try{let n=await this.networkInterface.sendGetRequestAsync(r,e);return EXr(n.body)?n.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(n){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${n}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in f5t?f5t[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){let r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==mMt)return this.regionDiscoveryMetadata.region_outcome=Ube.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=r,t.replaceWithRegionalInformation(e,r);let n=await Gs(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),dXr,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=Ube.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=n,t.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=Ube.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){let r=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(r)return r;let n=await Gs(this.getCloudDiscoveryMetadataFromNetwork.bind(this),aXr,this.logger,this.performanceClient,this.correlationId)();if(n)return l1e(e,n,!0),Oy.NETWORK;throw hl(NOt)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||Mbe}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||Mbe}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||Mbe}'`,this.correlationId);let r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),l1e(e,r,!1),Oy.CONFIG;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);let n=GZr(this.hostnameAndPort);if(n)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),l1e(e,n,!1),Oy.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);let o=yqe(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Oy.CACHE):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===tx.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);let e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=o1e(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),hl(sqe)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){let e=`${uMt}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={},n=null;try{let o=await this.networkInterface.sendGetRequestAsync(e,r),s,c;if(_Xr(o.body))s=o.body,c=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${s.tenant_discovery_endpoint}'`,this.correlationId);else if(vXr(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${o.status}'`,this.correlationId),s=o.body,s.error===yMt)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${s.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${s.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),c=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=o1e(c,this.hostnameAndPort)}catch(o){if(o instanceof Oo)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata. Error: '${o.errorCode}' Error Description: '${o.errorMessage}'`,this.correlationId);else{let s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata. Error: '${s.name}' -Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&bs.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==wL.None){let o=r.tenant?r.tenant:Gbe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return EMt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw wt(Hk)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return I5t.has(e)}static isPublicCloudAuthority(e){return RMt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new bs(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${wMt}`);let l=bs.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new bs(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(rqe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${bMt}`}return r}};Gk.reservedTenantDomains=new Set(["{tenant}","{tenantid}",qk.COMMON,qk.CONSUMERS,qk.ORGANIZATIONS]);function GXr(t){let n=new bs(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case qk.COMMON:case qk.ORGANIZATIONS:case qk.CONSUMERS:return;default:return n}}a(GXr,"getTenantFromAuthorityString");function Uqe(t){return t.endsWith(Jse)?t:`${t}${Jse}`}a(Uqe,"formatAuthorityUri");function j5t(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw gl(_qe)}return{canonicalAuthority:t.authority?Uqe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(j5t,"buildStaticAuthorityOptions");async function H5t(t,e,r,n,o,s,c){let l=Gk.transformCIAMAuthority(Uqe(t)),u=new Gk(l,e,r,n,o,s,c);try{return await Vs(u.resolveEndpointsAsync.bind(u),wXr,o,c,s)(),u}catch{throw wt(Hk)}}a(H5t,"createDiscoveredInstance");var x1e=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw wt(t5t);n&&n.cloud_instance_host_name&&await Vs(this.updateTokenEndpointAuthority.bind(this),xXr,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=nS(),s=await Vs(this.executeTokenRequest.bind(this),TXr,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Dp.X_MS_REQUEST_ID],l=new Mp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),Vs(l.handleServerTokenResponse.bind(l),Mqe,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw gl(jOt);let r=this.createLogoutUrlQueryString(e);return bs.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=S1e(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=bs.appendQueryString(e.tokenEndpoint,o),c=await Vs(this.createTokenRequestBody.bind(this),IXr,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=uae(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${eae}${f.utid}`,type:p_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=b1e(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=mae(this.config.authOptions.clientId,r);return Vs(T1e,_Xr,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(Tz(r,e.embeddedClientId||e.extraParameters?.[fM]||this.config.authOptions.clientId),this.includeRedirectUri)Iz(r,e.redirectUri);else if(!e.redirectUri)throw gl(LOt);if(Sz(r,e.scopes,!0,this.oidcDefaultScopes),h1e(r,e.resource),y5t(r,e.code),r1e(r,this.config.libraryInfo),n1e(r,this.config.telemetry.application),p1e(r),this.serverTelemetryManager&&!Rqe(this.config)&&f1e(r,this.serverTelemetryManager),e.codeVerifier&&_5t(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&o1e(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;s1e(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),a1e(r,o.assertionType)}if(c1e(r,Wbe.AUTHORIZATION_CODE_GRANT),Rz(r),e.authenticationScheme===of.POP){let o=new l7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Vs(o.generateCnf.bind(o),hae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,u1e(r,s)}else if(e.authenticationScheme===of.SSH)if(e.sshJwk)d1e(r,e.sshJwk);else throw gl(Zbe);(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&xz(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=uae(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${eae}${o.utid}`,type:p_.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case p_.HOME_ACCOUNT_ID:try{let o=mM(n.credential);TL(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case p_.UPN:s7(r,n.credential);break}return e.embeddedClientId&&xL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&IL(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[gqe])&&IL(r,{[gqe]:"1"}),bz(r,e.correlationId,this.performanceClient),pM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&p5t(r,e.postLogoutRedirectUri),e.correlationId&&wz(r,e.correlationId),e.idTokenHint&&h5t(r,e.idTokenHint),e.state&&i1e(r,e.state),e.logoutHint&&v5t(r,e.logoutHint),e.extraQueryParameters&&IL(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&l1e(r),pM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await H5t(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var R_o=300,Mz=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=nS(),o=await Vs(this.executeTokenRequest.bind(this),CXr,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Dp.X_MS_REQUEST_ID],c=new Mp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),Vs(c.handleServerTokenResponse.bind(c),Mqe,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw gl(qOt);if(!e.account)throw wt(e1e);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof iS&&o.errorCode===Oqe,c=o instanceof f_&&o.errorCode===zMt&&o.subError===YMt;if(s||c)return Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Vs(this.acquireTokenWithCachedRefreshToken.bind(this),Nqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=BXr(this.cacheManager.getRefreshToken.bind(this.cacheManager),OXr,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw Fqe(Oqe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||R_o;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),fae(o.expiresOn,c))throw Fqe(O5t)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||of.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:p_.HOME_ACCOUNT_ID}};try{return await Vs(this.acquireToken.bind(this),vXr,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof iS&&c.subError===C1e){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=S1e(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=bs.appendQueryString(r.tokenEndpoint,n),s=await Vs(this.createTokenRequestBody.bind(this),bXr,this.logger,this.performanceClient,e.correlationId)(e),c=b1e(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=mae(this.config.authOptions.clientId,e);return Vs(T1e,EXr,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(Tz(r,e.embeddedClientId||e.extraParameters?.[fM]||this.config.authOptions.clientId),e.redirectUri&&Iz(r,e.redirectUri),Sz(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),c1e(r,Wbe.REFRESH_TOKEN_GRANT),Rz(r),r1e(r,this.config.libraryInfo),n1e(r,this.config.telemetry.application),p1e(r),this.serverTelemetryManager&&!Rqe(this.config)&&f1e(r,this.serverTelemetryManager),E5t(r,e.refreshToken),this.config.clientCredentials.clientSecret&&o1e(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;s1e(r,await h_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),a1e(r,n.assertionType)}if(e.authenticationScheme===of.POP){let n=new l7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Vs(n.generateCnf.bind(n),hae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,u1e(r,o)}else if(e.authenticationScheme===of.SSH)if(e.sshJwk)d1e(r,e.sshJwk);else throw gl(Zbe);if((!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&xz(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case p_.HOME_ACCOUNT_ID:try{let n=mM(e.ccsCredential.credential);TL(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case p_.UPN:s7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&xL(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&IL(r,{...e.extraParameters}),bz(r,e.correlationId,this.performanceClient),pM(r)}};p();var w1e=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=kL(e),this.logger=new H0(this.config.loggerOptions,a7,hM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=jk.NOT_APPLICABLE;if(e.forceRefresh||!su.isEmptyObj(e.claims))throw this.setCacheOutcome(jk.FORCE_REFRESH_OR_CLAIMS,e.correlationId),wt(aae);if(!e.account)throw wt(e1e);let n=e.account.tenantId||GXr(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(R5t(s.cachedAt)||fae(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(jk.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),wt(aae);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(jk.NO_CACHED_ACCESS_TOKEN,e.correlationId),wt(aae)}else s.refreshOn&&fae(s.refreshOn,0)&&(r=jk.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(jk.NO_CACHED_ACCESS_TOKEN,e.correlationId),wt(aae);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Vs(this.generateResultFromCacheRecord.bind(this),SXr,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==jk.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=RL(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw wt(Xbe);m1e(o,r.maxAge)}return Mp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var R1e={};wi(R1e,{getAuthorizationCodePayload:()=>D_o,getAuthorizeUrl:()=>P_o,getStandardAuthorizeRequestParameters:()=>k_o,validateAuthorizationResponse:()=>$Xr});p();function k_o(t,e,r,n){let o=e.correlationId,s=new Map;Tz(s,e.embeddedClientId||e.extraQueryParameters?.[fM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Sz(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),h1e(s,e.resource),Iz(s,e.redirectUri),wz(s,o),f5t(s,e.responseMode),Rz(s),C5t(s),e.prompt&&(g5t(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(m5t(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==Vbe.SELECT_ACCOUNT)if(e.sid&&e.prompt===Vbe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),Tqe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=M_o(e.account),u=O_o(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),cae(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=mM(e.account.homeAccountId);TL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===Vbe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),Tqe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=mM(e.account.homeAccountId);TL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),cae(s,e.loginHint),s7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),cae(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=mM(e.account.homeAccountId);TL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),cae(s,e.loginHint),s7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&A5t(s,e.nonce),e.state&&i1e(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&xz(s,e.claims,t.clientCapabilities),e.embeddedClientId&&xL(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(nae))&&l1e(s),s}a(k_o,"getStandardAuthorizeRequestParameters");function P_o(t,e){let r=pM(e);return bs.appendQueryString(t.authorizationEndpoint,r)}a(P_o,"getAuthorizeUrl");function D_o(t,e){if($Xr(t,e),!t.code)throw wt(a5t);return t}a(D_o,"getAuthorizationCodePayload");function $Xr(t,e){if(!t.state||!e)throw t.state?wt(bqe,"Cached State"):wt(bqe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw wt(vz,t.state)}try{n=decodeURIComponent(e)}catch{throw wt(vz,t.state)}if(r!==n)throw wt(JOt);if(t.error||t.error_description||t.suberror){let o=N_o(t);throw Lqe(t.error,t.error_description,t.suberror)?new iS(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new f_(t.error||"",t.error_description,t.suberror,o)}}a($Xr,"validateAuthorizationResponse");function N_o(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(N_o,"parseServerErrorNo");function M_o(t){return t.idTokenClaims?.sid||null}a(M_o,"extractAccountSid");function O_o(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(O_o,"extractLoginHint");p();function Oz(t,e){if(t){if(e.resource&&(VXr(e.extraParameters)||VXr(e.extraQueryParameters)))throw wt(d5t);if(!e.resource)throw wt(u5t)}}a(Oz,"enforceResourceParameter");function VXr(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(VXr,"containsResourceParam");var Aae={};wi(Aae,{postRequestFailed:()=>L_o,unexpectedError:()=>B_o});p();var B_o="unexpected_error",L_o="post_request_failed";p();var WXr=",",zXr="|";function F_o(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(WXr),l.length<4)return e}else l=Array.from({length:4},()=>zXr);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&U_o({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(WXr)}a(F_o,"makeExtraSkuString");function U_o(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(zXr))}a(U_o,"setSku");var Bz=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=jk.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=zbe+yz+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${n7}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(n7),s=this.getRegionDiscoveryFields(),c=[e,s].join(n7);return[uqe,c,o].join(dqe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(n7),o=e.errors.slice(0,r).join(n7),s=e.errors.length,c=r=qMt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Bo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(GMt),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};c7.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var YXr="system_assigned_managed_identity",Q_o="managed_identity",$5t=`https://login.microsoftonline.com/${Q_o}/`,uv={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},Rh={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},zi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},io={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},af={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},qf={GET:"GET",POST:"POST"},KXr="REGION_NAME",JXr="MSAL_FORCE_REGION",ZXr=32,XXr={SHA256:"sha256"},qqe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},V5t={KEY_SEPARATOR:"-"},ox={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},cf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},sx={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},jqe={INTERVAL_MS:100,TIMEOUT_MS:5e3},een=4096;p();p();p();var yae=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,qf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,qf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:j_o(n),signal:s.signal};r===qf.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw Cz(Np.networkError,"Request timeout");let f=Cz(Np.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw q5t(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:q_o(u.headers),body:await u.json(),status:u.status}}catch(d){throw Cz(Np.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function q_o(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(q_o,"getHeaderDict");function j_o(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(j_o,"getFetchHeaders");p();p();p();var Hqe="invalid_file_extension",Gqe="invalid_file_path",u7="invalid_managed_identity_id_type",$qe="invalid_secret",ten="missing_client_id",ren="network_unavailable",Vqe="platform_not_supported",Wqe="unable_to_create_azure_arc",zqe="unable_to_create_cloud_shell",Yqe="unable_to_create_source",k1e="unable_to_read_secret_file",nen="user_assigned_not_available_at_runtime",Kqe="www_authenticate_header_missing",Jqe="www_authenticate_header_unsupported_format",Lz={[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[zi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[zi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[zi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var H_o={[Hqe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[Gqe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[u7]:"More than one ManagedIdentityIdType was provided.",[$qe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[Vqe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[ten]:"A ManagedIdentityId id was not provided.",[Lz.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[Lz.IDENTITY_ENDPOINT]:`The Managed Identity's '${zi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[Lz.IMDS_ENDPOINT]:`The Managed Identity's '${zi.IMDS_ENDPOINT}' environment variable is malformed.`,[Lz.MSI_ENDPOINT]:`The Managed Identity's '${zi.MSI_ENDPOINT}' environment variable is malformed.`,[ren]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[Wqe]:"Azure Arc Managed Identities can only be system assigned.",[zqe]:"Cloud Shell Managed Identities can only be system assigned.",[Yqe]:"Unable to create a Managed Identity source based on environment variables.",[k1e]:"Unable to read the secret file.",[nen]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[Kqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[Jqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},W5t=class t extends Bo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,H_o[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Op(t){return new W5t(t)}a(Op,"createManagedIdentityError");var Zqe=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw Op(u7);this.id=r,this.idType=af.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Op(u7);this.id=n,this.idType=af.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Op(u7);this.id=o,this.idType=af.USER_ASSIGNED_OBJECT_ID}else this.id=YXr,this.idType=af.SYSTEM_ASSIGNED}};p();var kh={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},Ny=class t extends Bo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(kh.invalidLoopbackAddressType.code,`${kh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(kh.unableToLoadRedirectUri.code,`${kh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(kh.noAuthCodeInResponse.code,`${kh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(kh.noLoopbackServerExists.code,`${kh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(kh.loopbackServerAlreadyExists.code,`${kh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(kh.loopbackServerTimeout.code,`${kh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(kh.stateNotFoundError.code,kh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(kh.thumbprintMissing.code,kh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(kh.redirectUriNotSupported.code,kh.redirectUriNotSupported.desc)}};var G_o={clientId:"",authority:Xt.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:wL.None,tenant:""},isMcp:!1},z5t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:sf.Info},$_o={loggerOptions:z5t,networkClient:new yae,disableInternalRetries:!1,protocolMode:Dy.AAD},V_o={application:{appName:"",appVersion:""}};function ien({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...$_o,networkClient:new yae,loggerOptions:n?.loggerOptions||z5t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw Ny.createStateNotFoundError();return{auth:{...G_o,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...V_o,...o}}}a(ien,"buildAppConfiguration");function oen({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new Zqe(e),o=r?.loggerOptions||z5t,s;return r?.networkClient?s=r.networkClient:s=new yae,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(oen,"buildManagedIdentityConfiguration");p();p();Ns();var Eae=class{static{a(this,"GuidGenerator")}generateGuid(){return gr()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var oS=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(Xt.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,Xt.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var sen=ce(require("crypto"),1);var d7=class{static{a(this,"HashUtils")}sha256(e){return sen.default.createHash(XXr.SHA256).update(e).digest()}};var aen=ce(require("crypto"),1);var Xqe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new d7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%qqe.CV_CHARSET.length;for(;e.length<=ZXr;){let o=aen.default.randomBytes(1)[0];if(o>=r)continue;let s=o%qqe.CV_CHARSET.length;e.push(qqe.CV_CHARSET[s])}let n=e.join("");return oS.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return oS.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};var gM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new Xqe,this.guidGenerator=new Eae,this.hashUtils=new d7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return oS.base64Encode(e)}base64Decode(e){return oS.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return oS.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};p();p();function cen(t){let e=t.credentialType===Xt.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(V5t.KEY_SEPARATOR).toLowerCase()}a(cen,"generateCredentialKey");function len(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(V5t.KEY_SEPARATOR).toLowerCase()}a(len,"generateAccountKey");var f7=class extends c7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new wh,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(Dz.isAccountEntity(o))r.accounts[n]=o;else if(d_.isIdTokenEntity(o))r.idTokens[n]=o;else if(d_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(d_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(d_.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return cen(e)}generateAccountKey(e){return len(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(Dz.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return d_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return d_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return d_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return d_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=d_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&d_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&d_.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&d_.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return PL.deserializeAllCache(PL.deserializeJSONBlob(e))}static generateJsonCache(e){return r7.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var P1e={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},_ae=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=r7.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=PL.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=f7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new gM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new rS(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new rS(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new Eae().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new rS(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{...P1e.Account,...e.Account},IdToken:{...P1e.IdToken,...e.IdToken},AccessToken:{...P1e.AccessToken,...e.AccessToken},RefreshToken:{...P1e.RefreshToken,...e.RefreshToken},AppMetadata:{...P1e.AppMetadata,...e.AppMetadata}}}};p();var Wnn=ce(Qnn(),1);p();var qnn="missing_tenant_id_error",jnn="user_timeout_reached",Hnn="invalid_assertion",U4t="invalid_client_credential",Gnn="device_code_polling_cancelled",$nn="device_code_expired",Vnn="device_code_unknown_error";var NL=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw wt(Hnn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=Hu.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?sx.PSS_256:sx.RSA_256},l=this.useSha256?sx.X5T_256:sx.X5T;Object.assign(c,{[l]:oS.base64EncodeUrl(this.thumbprint,Xt.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[sx.X5C]:this.publicCertificate});let u={[sx.AUDIENCE]:this.jwtAudience,[sx.EXPIRATION_TIME]:this.expirationTime,[sx.ISSUER]:this.issuer,[sx.SUBJECT]:this.issuer,[sx.NOT_BEFORE]:o,[sx.JWT_ID]:e.createNewGuid()};return this.jwt=Wnn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&sn.addCcsUpn(r,e.username),nA.mapToQueryString(r)}};p();function znn(t,e,r,n){let o=R1e.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return sn.addLibraryInfo(o,{sku:ox.MSAL_SKU,version:sS,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==Dy.OIDC&&sn.addApplicationTelemetry(o,t.telemetry.application),sn.addResponseType(o,Xt.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&sn.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),sn.addExtraParameters(o,r.extraQueryParameters||{}),R1e.getAuthorizeUrl(e,o)}a(znn,"getAuthCodeRequestUrl");var Pae=class{static{a(this,"ClientApplication")}constructor(e){this.config=ien(e),this.cryptoProvider=new gM,this.logger=new H0(this.config.system.loggerOptions,kae,sS),this.storage=new f7(this.logger,this.config.auth.clientId,this.cryptoProvider,j5t(this.config.auth)),this.tokenCache=new _ae(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||Xt.ResponseMode.QUERY,authenticationScheme:Xt.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return znn(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:Xt.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(cf.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new x1e(c,new wh);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,cf.acquireTokenByCode,r)}catch(s){throw s instanceof Bo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:Xt.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(cf.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new Mz(s,new wh);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,cf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(cf.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new w1e(s,new wh);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof o7&&l.errorCode===Np.tokenRefreshRequired)return new Mz(s,new wh).acquireTokenByRefreshToken(r,cf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...Xt.OIDC_DEFAULT_SCOPES]});if(s===Xt.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new Mz(n,new wh);try{await c.acquireTokenByRefreshToken(e,cf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(cf.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new Rje(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw Ny.createStateNotFoundError();if(e!==r)throw wt(Np.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:ox.MSAL_SKU,version:sS,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=NL.fromAssertion(await h_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:ox.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===Xt.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=Xt.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...Xt.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new Bz(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=Gk.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return Qqe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new wh)}clearCache(){this.storage.clear()}};p();var Ynn=ce(require("http"),1);var kje=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw Ny.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=Ynn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===Xt.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(Ny.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=nA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(Xt.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw Ny.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),Ny.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${ox.HTTP_PROTOCOL}${ox.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var Pje=class extends EM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=Hu.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Mp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,cf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=bs.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&sn.addExtraParameters(r,e.extraQueryParameters),nA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return sn.addScopes(r,e.scopes),sn.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&sn.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),wt(Gnn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),wt(jnn);if(Hu.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),wt($nn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=bs.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?Hu.nowSeconds()+e.timeout:void 0,u=Hu.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===Xt.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await Hu.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),Cz(Aae.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),wt(Vnn)}createTokenRequestBody(e,r){let n=new Map;sn.addScopes(n,e.scopes),sn.addClientId(n,this.config.authOptions.clientId),sn.addGrantType(n,Xt.GrantType.DEVICE_CODE_GRANT),sn.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return sn.addCorrelationId(n,o),sn.addClientInfo(n),sn.addLibraryInfo(n,this.config.libraryInfo),sn.addApplicationTelemetry(n,this.config.telemetry.application),sn.addThrottling(n),this.serverTelemetryManager&&sn.addServerTelemetry(n,this.serverTelemetryManager),(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(n)}};var Dae=class extends Pae{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=Bz.makeExtraSkuString({libraryName:ox.MSAL_SKU,libraryVersion:sS})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),Oz(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(cf.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new Pje(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Bo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),Oz(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[_z.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw Ny.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new kje,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:Xt.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:Xt.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new f_(m.error,m.error_description,m.suberror);if(!m.code)throw Ny.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),Oz(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[_z.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw Ny.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return Oz(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return Oz(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(jqe.TIMEOUT_MS/jqe.INTERVAL_MS1)throw wt(Np.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=Hu.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:Xt.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=bs.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=Hu.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Mp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,cf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes,!1),sn.addGrantType(r,Xt.GrantType.CLIENT_CREDENTIALS_GRANT),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(!su.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}};p();var Dje=class extends EM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new xh(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(Hu.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),wt(Np.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),wt(Np.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=xqe.extractTokenClaims(n.secret,oS.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),Mp.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:Xt.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||Xt.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?Xt.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:Xt.CredentialType.ACCESS_TOKEN,clientId:e,target:xh.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw wt(Np.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=bs.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=Hu.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Mp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,cf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;sn.addClientId(r,this.config.authOptions.clientId),sn.addScopes(r,e.scopes),sn.addGrantType(r,Xt.GrantType.JWT_BEARER),sn.addClientInfo(r),sn.addLibraryInfo(r,this.config.libraryInfo),sn.addApplicationTelemetry(r,this.config.telemetry.application),sn.addThrottling(r),this.serverTelemetryManager&&sn.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();sn.addCorrelationId(r,n),sn.addRequestTokenUse(r,_z.ON_BEHALF_OF),sn.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&sn.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(sn.addClientAssertion(r,await h_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),sn.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&sn.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),nA.mapToQueryString(r)}};var Mae=class extends Pae{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw wt(U4t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?NL.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):NL.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw wt(U4t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await h_(e.clientAssertion,this.config.auth.clientId),assertionType:ox.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!Xt.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new bs(s.authority).getUrlComponents().PathSegments[0];if(Object.values(Xt.AADAuthority).includes(l))throw wt(qnn);let u=process.env[JXr],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[KXr]},h=this.initializeServerTelemetryManager(cf.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new Nae(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Bo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new Dje(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Bo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function Knn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(Knn,"isIso8601");p();var Nje=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===qf.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[Xt.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(qf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(qf.POST,e,r)}};var Qz={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},A_=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(Knn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-Hu.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[Rh.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[Rh.XMS_CC]=g}let c=s.headers;c[Xt.HeaderNames.CONTENT_TYPE]=Xt.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new Nje(this.networkClient,s.retryPolicy,this.logger),d=Hu.nowSeconds(),f;try{s.httpMethod===qf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Bo?g:wt(Np.networkError)}let h=new Mp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new wh,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,cf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case af.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?Qz.MANAGED_IDENTITY_CLIENT_ID_2017:Qz.MANAGED_IDENTITY_CLIENT_ID;case af.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?Qz.MANAGED_IDENTITY_RESOURCE_ID_IMDS:Qz.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case af.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),Qz.MANAGED_IDENTITY_OBJECT_ID;default:throw Op(u7)}}};A_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new bs(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Op(Lz[t])}};p();p();p();var Mje=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var aIo=3,cIo=1e3,lIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_TOO_MANY_REQUESTS,Xt.HTTP_SERVER_ERROR,Xt.HTTP_SERVICE_UNAVAILABLE,Xt.HTTP_GATEWAY_TIMEOUT],Oje=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new Mje}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return cIo}async pauseForRetry(e,r,n,o){if(lIo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var dv=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new Oje}computeUri(){let e=new Map;this.queryParameters&&sn.addExtraParameters(e,this.queryParameters);let r=nA.mapToQueryString(e);return bs.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&sn.addExtraParameters(e,this.bodyParameters),nA.mapToQueryString(e)}};var uIo="2019-08-01",q1e=class t extends A_{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.APP_SERVICE} managed identity is unavailable because one or both of the '${zi.IDENTITY_HEADER}' and '${zi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,c,io.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${io.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new dv(qf.GET,this.identityEndpoint);return n.headers[uv.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Rh.API_VERSION]=uIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var ML=require("fs"),ein=ce(require("path"),1);var dIo="2019-11-01",Jnn="http://127.0.0.1:40342/metadata/identity/oauth2/token",Znn="N/A: himds executable exists",Xnn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},fIo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},j1e=class t extends A_{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IMDS_ENDPOINT];if(!e||!r){let n=fIo[process.platform];try{(0,ML.accessSync)(n,ML.constants.F_OK|ML.constants.R_OK),e=Jnn,r=Znn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${zi.IDENTITY_ENDPOINT}' and '${zi.IMDS_ENDPOINT}' are not defined. ${io.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===Znn)e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${io.AZURE_ARC} endpoint: ${Jnn}. Creating ${io.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,io.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(zi.IMDS_ENDPOINT,u,io.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${io.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${io.AZURE_ARC} managed identity.`,"")}if(c.idType!==af.SYSTEM_ASSIGNED)throw Op(Wqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new dv(qf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[uv.METADATA_HEADER_NAME]="true",r.queryParameters[Rh.API_VERSION]=dIo,r.queryParameters[Rh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===Xt.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Op(Kqe);if(!c.includes("Basic realm="))throw Op(Jqe);let l=c.split("Basic realm=")[1];if(!Xnn.hasOwnProperty(process.platform))throw Op(Vqe);let u=Xnn[process.platform],d=ein.default.basename(l);if(!d.endsWith(".key"))throw Op(Hqe);if(u+d!==l)throw Op(Gqe);let f;try{f=await(0,ML.statSync)(l).size}catch{throw Op(k1e)}if(f>een)throw Op($qe);let h;try{h=(0,ML.readFileSync)(l,Xt.EncodingTypes.UTF8)}catch{throw Op(k1e)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[uv.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Bo?g:wt(Np.networkError)}}return this.getServerTokenResponse(s||e)}};p();var H1e=class t extends A_{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[zi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${io.CLOUD_SHELL} managed identity is unavailable because the '${zi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,l,io.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${io.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${io.CLOUD_SHELL} managed identity.`,""),c.idType!==af.SYSTEM_ASSIGNED)throw Op(zqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new dv(qf.POST,this.msiEndpoint);return r.headers[uv.METADATA_HEADER_NAME]="true",r.bodyParameters[Rh.RESOURCE]=e,r}};p();p();p();var Bje=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var pIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_GONE,Xt.HTTP_TOO_MANY_REQUESTS],hIo=3,mIo=7,gIo=1e3,AIo=4e3,yIo=2e3,EIo=10*1e3,Lje=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new Bje(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return gIo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return AIo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return yIo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return EIo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===Xt.HTTP_GONE?mIo:hIo),(pIo.includes(e)||e>=Xt.HTTP_SERVER_ERROR_RANGE_START&&e<=Xt.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var tin="/metadata/identity/oauth2/token",_Io=`http://169.254.169.254${tin}`,CIo="2018-02-01",Fje=class t extends A_{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${io.IMDS} returned endpoint: ${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(zi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[zi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${tin}`,io.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${zi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${io.IMDS}, using the default endpoint.`,""),c=_Io),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new dv(qf.GET,this.identityEndpoint);return n.headers[uv.METADATA_HEADER_NAME]="true",n.queryParameters[Rh.API_VERSION]=CIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new Lje,n}};p();var vIo="2019-07-01-preview",G1e=class t extends A_{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[zi.IDENTITY_ENDPOINT],r=process.env[zi.IDENTITY_HEADER],n=process.env[zi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${io.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${zi.IDENTITY_HEADER}', '${zi.IDENTITY_ENDPOINT}' or '${zi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(zi.IDENTITY_ENDPOINT,l,io.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${io.SERVICE_FABRIC} managed identity.`,""),c.idType!==af.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${io.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new dv(qf.GET,this.identityEndpoint);return n.headers[uv.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[Rh.API_VERSION]=vIo,n.queryParameters[Rh.RESOURCE]=e,r.idType!==af.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var bIo="2017-09-01",SIo=`Only client id is supported for user-assigned managed identity in ${io.MACHINE_LEARNING}.`,$1e=class t extends A_{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[zi.MSI_ENDPOINT],r=process.env[zi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${zi.MSI_ENDPOINT}' and '${zi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(zi.MSI_ENDPOINT,c,io.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${io.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new dv(qf.GET,this.msiEndpoint);if(n.headers[uv.METADATA_HEADER_NAME]="true",n.headers[uv.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[Rh.API_VERSION]=bIo,n.queryParameters[Rh.RESOURCE]=e,r.idType===af.SYSTEM_ASSIGNED)n.queryParameters[Qz.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[zi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===af.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(SIo);return n}};var V1e=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(G1e.getEnvironmentVariables())?io.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(q1e.getEnvironmentVariables())?io.APP_SERVICE:this.allEnvironmentVariablesAreDefined($1e.getEnvironmentVariables())?io.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(H1e.getEnvironmentVariables())?io.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(j1e.getEnvironmentVariables())?io.AZURE_ARC:io.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=G1e.tryCreate(e,r,n,o,s,c)||q1e.tryCreate(e,r,n,o,s)||$1e.tryCreate(e,r,n,o,s)||H1e.tryCreate(e,r,n,o,s,c)||j1e.tryCreate(e,r,n,o,s,c)||Fje.tryCreate(e,r,n,o,s);if(!l)throw Op(Yqe);return l}};var TIo=[io.SERVICE_FABRIC],Oae=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=oen(e||{}),this.logger=new H0(this.config.system.loggerOptions,kae,sS);let r={canonicalAuthority:Xt.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new f7(this.logger,this.config.managedIdentityId.id,lae,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new gM;let n={protocolMode:Dy.AAD,knownAuthorities:[$5t],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new Gk($5t,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new wh,!0),this.fakeClientCredentialClient=new Nae({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new V1e(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new d7}async acquireToken(e){if(!e.resource)throw gl(sae.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&TIo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(Xt.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===Xt.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return V1e.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var Uje=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>Dz.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var IIo=Xt.PromptValue,xIo=Xt.ResponseMode;p();p();p();p();p();function W1e(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(W1e,"getRandomIntegerInclusive");function z1e(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+W1e(0,n/2)}}a(z1e,"calculateRetryDelay");p();function Bae(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(Bae,"isObject");p();function qz(t){if(Bae(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(qz,"isError");p();p();var rin=require("node:crypto");var Q4t,wIo=typeof((Q4t=globalThis?.crypto)===null||Q4t===void 0?void 0:Q4t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):rin.randomUUID;function Lae(){return wIo()}a(Lae,"randomUUID");p();var q4t,j4t,H4t,G4t,nin=typeof window<"u"&&typeof window.document<"u",iin=typeof self=="object"&&typeof self?.importScripts=="function"&&(((q4t=self.constructor)===null||q4t===void 0?void 0:q4t.name)==="DedicatedWorkerGlobalScope"||((j4t=self.constructor)===null||j4t===void 0?void 0:j4t.name)==="ServiceWorkerGlobalScope"||((H4t=self.constructor)===null||H4t===void 0?void 0:H4t.name)==="SharedWorkerGlobalScope"),oin=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",sin=typeof Bun<"u"&&typeof Bun.version<"u",g7=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((G4t=globalThis.process.versions)===null||G4t===void 0)&&G4t.node);var ain=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function fv(t,e){return Buffer.from(t,e)}a(fv,"stringToUint8Array");p();var $4t="REDACTED",RIo=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],kIo=["api-version"],Vk=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=RIo.concat(e),r=kIo.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||Bae(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,$4t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=$4t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=$4t;return r}};p();p();p();p();var jz=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function W4t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new jz(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(W4t,"createAbortablePromise");p();var OIo="The delay was aborted.";function z4t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return W4t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??OIo})}a(z4t,"delay");p();function Fae(t){if(qz(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(Fae,"getErrorMessage");p();function cin(t,e){return z1e(t,e)}a(cin,"calculateRetryDelay");function Qje(t){return qz(t)}a(Qje,"isError");var qje=g7,Uae=g7;p();var Y1e=lo("IdentityUtils"),lin="1.0";function Hz(t,e,r){let n=a(o=>(Y1e.getToken.info(o),new nx({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(Hz,"ensureValidMsalToken");function Y4t(t){let e=t?.authorityHost;return!e&&Uae&&(e=process.env.AZURE_AUTHORITY_HOST),e??Ube}a(Y4t,"getAuthorityHost");function K4t(t,e){return e||(e=Ube),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(K4t,"getAuthority");function uin(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(uin,"getKnownAuthorities");var jje=a((t,e=qje?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case aS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case aS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case aS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case aS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function Hje(t){switch(t){case"error":return aS.LogLevel.Error;case"info":return aS.LogLevel.Info;case"verbose":return aS.LogLevel.Verbose;case"warning":return aS.LogLevel.Warning;default:return aS.LogLevel.Info}}a(Hje,"getMSALLogLevel");function Gz(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return Y1e.info(Os(t,e.message)),new Dn(e.message);case"device_code_polling_cancelled":return new jz("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":Y1e.info(Os(t,`Authentication returned errorCode ${n.errorCode}`));break;default:Y1e.info(Os(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(Y1e.info(Os(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new nx({scopes:t,getTokenOptions:r,message:e.message})}a(Gz,"handleMsalError");function din(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(din,"publicToMsal");function fin(t,e){return{authority:e.environment??IZr,homeAccountId:e.homeAccountId,tenantId:e.tenantId||TZr,username:e.username,clientId:t,version:lin}}a(fin,"msalToPublic");function J4t(t){let e=JSON.parse(t);if(e.version&&e.version!==lin)throw Error("Unsupported AuthenticationRecord version");return e}a(J4t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function LIo(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(LIo,"isPrimitiveBody");function FIo(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(FIo,"handleNullableResponseAndWrappableBody");function Z4t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return FIo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:LIo(t.parsedBody,l)})}a(Z4t,"flattenResponse");var _M={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var CM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var pin=require("node:os"),hin=ce(require("node:util"),1),min=ce(require("node:process"),1);function gin(t,...e){min.stderr.write(`${hin.default.format(t,...e)}${pin.EOL}`)}a(gin,"log");var Ain=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,yin,X4t=[],eBt=[],$je=[];Ain&&tBt(Ain);var Ein=Object.assign(t=>_in(t),{enable:tBt,enabled:rBt,disable:UIo,log:gin});function tBt(t){yin=t,X4t=[],eBt=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?eBt.push(new RegExp(`^${n.substr(1)}$`)):X4t.push(new RegExp(`^${n}$`));for(let n of $je)n.enabled=rBt(n.namespace)}a(tBt,"enable");function rBt(t){if(t.endsWith("*"))return!0;for(let e of eBt)if(e.test(t))return!1;for(let e of X4t)if(e.test(t))return!0;return!1}a(rBt,"enabled");function UIo(){let t=yin||"";return tBt(""),t}a(UIo,"disable");function _in(t){let e=Object.assign(r,{enabled:rBt(t),destroy:QIo,log:Ein.log,namespace:t,extend:qIo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),$je.push(e),e}a(_in,"createDebugger");function QIo(){let t=$je.indexOf(this);return t>=0?($je.splice(t,1),!0):!1}a(QIo,"destroy");function qIo(t){let e=_in(`${this.namespace}:${t}`);return e.log=this.log,e}a(qIo,"extend");var Qae=Ein;var nBt=["verbose","info","warning","error"],Cin={verbose:400,info:300,warning:200,error:100};function vin(t,e){e.log=(...r)=>{t.log(...r)}}a(vin,"patchLogMethod");function bin(t){return nBt.includes(t)}a(bin,"isTypeSpecRuntimeLogLevel");function jIo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=Qae(t.namespace);o.log=(...f)=>{Qae.log(...f)};function s(f){if(f&&!bin(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${nBt.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);Qae.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(bin(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${nBt.join(", ")}.`));function c(f){return!!(n&&Cin[f.level]<=Cin[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(vin(f,m),c(m)){let g=Qae.disable();Qae.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return vin(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(jIo,"createLoggerContext");var Sin=jIo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),HIo=Sin.logger;function J1e(t){return Sin.createClientLogger(t)}a(J1e,"createClientLogger");p();function Vje(t){return t.toLowerCase()}a(Vje,"normalizeName");function*GIo(t){for(let e of t.values())yield[e.name,e.value]}a(GIo,"headerIterator");var iBt=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(Vje(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(Vje(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(Vje(e))}delete(e){this._headersMap.delete(Vje(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return GIo(this._headersMap)}};function cS(t){return new iBt(t)}a(cS,"createHttpHeaders");p();p();p();var oBt=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:cS(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||Lae(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function Wje(t){return new oBt(t)}a(Wje,"createPipelineRequest");p();var Tin=new Set(["Deserialize","Serialize","Retry","Sign"]),sBt=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!Tin.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!Tin.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function zje(){return sBt.create()}a(zje,"createEmptyPipeline");p();p();var Iin=require("node:util"),xin=Iin.inspect.custom;var $Io=new Vk,sA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,xin,{value:a(()=>`RestError: ${this.message} - ${$Io.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};sA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";sA.PARSE_ERROR="PARSE_ERROR";function Yje(t){return t instanceof sA?!0:qz(t)&&t.name==="RestError"}a(Yje,"isRestError");p();p();var qae=ce(require("node:http"),1),jae=ce(require("node:https"),1),Jje=ce(require("node:zlib"),1),Rin=require("node:stream");p();var ux=J1e("ts-http-runtime");var VIo={};function Z1e(t){return t&&typeof t.pipe=="function"}a(Z1e,"isReadableStream");function win(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(win,"isStreamComplete");function kin(t){return t&&typeof t.byteLength=="number"}a(kin,"isArrayBuffer");var Kje=class extends Rin.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},aBt=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new CM("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new Vk;ux.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=KIo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new Kje(_);v.on("error",b=>{ux.error("Error in upload progress",b)}),Z1e(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=WIo(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?zIo(m,g):m;let E=e.onDownloadProgress;if(E){let _=new Kje(E);_.on("error",v=>{ux.error("Error in download progress",v)}),h.pipe(_),h=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await YIo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();Z1e(f)&&(m=win(f));let g=Promise.resolve();Z1e(h)&&(g=win(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{ux.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?qae.request(u,d):jae.request(u,d);h.once("error",m=>{var g;f(new sA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:sA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new CM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&Z1e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):kin(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(ux.error("Unrecognized body type",n),f(new sA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?qae.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new qae.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return jae.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:VIo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(ux.info("No cached TLS Agent exist, creating a new Agent"),c=new jae.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function WIo(t){let e=cS();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(WIo,"getResponseHeaders");function zIo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Jje.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Jje.createInflate();return t.pipe(n),n}return t}a(zIo,"getDecodedResponseStream");function YIo(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new sA(`Error reading response as text: ${o.message}`,{code:sA.PARSE_ERROR}))})})}a(YIo,"streamToText");function KIo(t){return t?Buffer.isBuffer(t)?t.length:Z1e(t)?null:kin(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(KIo,"getBodyLength");function Pin(){return new aBt}a(Pin,"createNodeHttpClient");function Zje(){return Pin()}a(Zje,"createDefaultHttpClient");p();p();p();p();var cBt="logPolicy";function Xje(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:ux.info,n=new Vk({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:cBt,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(Xje,"logPolicy");p();var lBt="redirectPolicy",Din=["GET","HEAD"];function eHe(t={}){let{maxRetries:e=20}=t;return{name:lBt,async sendRequest(r,n){let o=await n(r);return Nin(n,o,e)}}}a(eHe,"redirectPolicy");async function Nin(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&Din.includes(o.method)||s===302&&Din.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new CM(r?.abortErrorMsg?r?.abortErrorMsg:JIo)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(Bin,"delay");function Lin(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(Lin,"parseHeaderValueAsNumber");var dBt="Retry-After",ZIo=["retry-after-ms","x-ms-retry-after-ms",dBt];function Fin(t){if(t&&[429,503].includes(t.status))try{for(let o of ZIo){let s=Lin(t,o);if(s===0||s)return s*(o===dBt?1e3:1)}let e=t.headers.get(dBt);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(Fin,"getRetryAfterInMs");function Uin(t){return Number.isFinite(Fin(t))}a(Uin,"isThrottlingRetryResponse");function fBt(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=Fin(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(fBt,"throttlingRetryStrategy");var XIo=1e3,exo=1e3*64;function rHe(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:XIo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:exo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=rxo(l),d=u&&t.ignoreSystemErrors,f=txo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Uin(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:z1e(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(rHe,"exponentialRetryStrategy");function txo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(txo,"isExponentialRetryResponse");function rxo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(rxo,"isSystemError");p();var nxo=J1e("ts-http-runtime retryPolicy"),ixo="retryPolicy";function A7(t,e={maxRetries:3}){let r=e.logger||nxo;return{name:ixo,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new CM;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await Bin(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(A7,"retryPolicy");var pBt="defaultRetryPolicy";function nHe(t={}){var e;return{name:pBt,sendRequest:A7([fBt(),rHe(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(nHe,"defaultRetryPolicy");p();var hBt="formDataPolicy";function oxo(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(oxo,"formDataToFormDataMap");function iHe(){return{name:hBt,async sendRequest(t,e){if(g7&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=oxo(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=sxo(t.formData):await axo(t.formData,t),t.formData=void 0}return e(t)}}}a(iHe,"formDataPolicy");function sxo(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(sxo,"wwwFormUrlEncode");async function axo(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:cS({"Content-Disposition":`form-data; name="${o}"`}),body:fv(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=cS();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(axo,"prepareFormData");p();var uon=ce(vBt(),1),don=ce(bBt(),1);var two="HTTPS_PROXY",rwo="HTTP_PROXY",nwo="ALL_PROXY",iwo="NO_PROXY",SBt="proxyPolicy",aon=[],fon=!1,owo=new Map;function fHe(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(fHe,"getEnvironmentValue");function swo(){if(!process)return;let t=fHe(two),e=fHe(nwo),r=fHe(rwo);return t||e||r}a(swo,"loadEnvironmentProxyValue");function awo(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(awo,"isBypassed");function cwo(){let t=fHe(iwo);return fon=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(cwo,"loadNoProxy");function lwo(){let t=swo();return t?new URL(t):void 0}a(lwo,"getDefaultProxySettingsInternal");function con(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(con,"getUrlFromProxySettings");function lon(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ux.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new don.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new uon.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(lon,"setProxyAgentOnRequest");function pHe(t,e){fon||aon.push(...cwo());let r=t?con(t):lwo(),n={};return{name:SBt,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!awo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:aon,e?.customNoProxyList?void 0:owo)?lon(o,n,r):o.proxySettings&&lon(o,n,con(o.proxySettings)),s(o)}}}a(pHe,"proxyPolicy");p();var TBt="agentPolicy";function hHe(t){return{name:TBt,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(hHe,"agentPolicy");p();var IBt="tlsPolicy";function mHe(t){return{name:IBt,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(mHe,"tlsPolicy");p();p();function gHe(t){return typeof t.stream=="function"}a(gHe,"isBlob");p();OL();var CHe=require("stream");function Fon(){return eSe(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield dS(e.read());if(r)return yield dS(void 0);yield yield dS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(Fon,"streamAsyncIterator");function pwo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=Fon.bind(t)),t.values||(t.values=Fon.bind(t))}a(pwo,"makeAsyncIterable");function Uon(t){return t instanceof ReadableStream?(pwo(t),CHe.Readable.fromWeb(t)):t}a(Uon,"ensureNodeStream");function hwo(t){return t instanceof Uint8Array?CHe.Readable.from(Buffer.from(t)):gHe(t)?Uon(t.stream()):Uon(t)}a(hwo,"toStream");async function Qon(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(hwo);return CHe.Readable.from((function(){return eSe(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,_He(d)),u;u=yield dS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield dS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield dS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(Qon,"concat");function mwo(){return`----AzSDKFormBoundary${Lae()}`}a(mwo,"generateBoundary");function gwo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r -`;return e}a(gwo,"encodeHeaders");function Awo(t){return t instanceof Uint8Array?t.byteLength:gHe(t)?t.size===-1?void 0:t.size:void 0}a(Awo,"getLength");function ywo(t){let e=0;for(let r of t){let n=Awo(r);if(n===void 0)return;e+=n}return e}a(ywo,"getTotalLength");async function Ewo(t,e,r){let n=[fv(`--${r}`,"utf-8"),...e.flatMap(s=>[fv(`\r -`,"utf-8"),fv(gwo(s.headers),"utf-8"),fv(`\r -`,"utf-8"),s.body,fv(`\r ---${r}`,"utf-8")]),fv(`--\r +Error Description: '${s.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(r=>r&&vs.getDomainFromUrl(r).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==vL.None){let o=r.tenant?r.tenant:Nbe;n=`${r.azureCloudInstance}/${o}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return aMt;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Pt(QP)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return h5t.has(e)}static isPublicCloudAuthority(e){return AMt.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){let o=new vs(e);o.validateAsUri();let s=o.getUrlComponents(),c=`${r}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(c=`${r}.${gMt}`);let l=vs.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return n?`${l}?${n}`:l}static replaceWithRegionalInformation(e,r){let n={...e};return n.authorization_endpoint=t.buildRegionalAuthorityString(n.authorization_endpoint,r),n.token_endpoint=t.buildRegionalAuthorityString(n.token_endpoint,r),n.end_session_endpoint&&(n.end_session_endpoint=t.buildRegionalAuthorityString(n.end_session_endpoint,r)),n}static transformCIAMAuthority(e){let r=e,o=new vs(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(jQe)){let s=o.HostNameAndPort.split(".")[0];r=`${r}${s}${dMt}`}return r}};qP.reservedTenantDomains=new Set(["{tenant}","{tenantid}",FP.COMMON,FP.CONSUMERS,FP.ORGANIZATIONS]);function CXr(t){let n=new vs(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(n){case FP.COMMON:case FP.ORGANIZATIONS:case FP.CONSUMERS:return;default:return n}}a(CXr,"getTenantFromAuthorityString");function Tqe(t){return t.endsWith(jse)?t:`${t}${jse}`}a(Tqe,"formatAuthorityUri");function P5t(t){let e=t.cloudDiscoveryMetadata,r;if(e)try{r=JSON.parse(e)}catch{throw hl(sqe)}return{canonicalAuthority:t.authority?Tqe(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:r}}a(P5t,"buildStaticAuthorityOptions");async function k5t(t,e,r,n,o,s,c){let l=qP.transformCIAMAuthority(Tqe(t)),u=new qP(l,e,r,n,o,s,c);try{return await Gs(u.resolveEndpointsAsync.bind(u),sXr,o,c,s)(),u}catch{throw Pt(QP)}}a(k5t,"createDiscoveredInstance");var g1e=class{static{a(this,"AuthorizationCodeClient")}constructor(e,r){this.includeRedirectUri=!0,this.config=bL(e),this.logger=new G0(this.config.loggerOptions,r7,cM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,r,n){if(!e.code)throw Pt(HOt);n&&n.cloud_instance_host_name&&await Gs(this.updateTokenEndpointAuthority.bind(this),oXr,this.logger,this.performanceClient,e.correlationId)(n.cloud_instance_host_name,e.correlationId);let o=K1(),s=await Gs(this.executeTokenRequest.bind(this),nXr,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=s.headers?.[Op.X_MS_REQUEST_ID],l=new Lp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return l.validateTokenResponse(s.body,e.correlationId),Gs(l.handleServerTokenResponse.bind(l),_qe,this.logger,this.performanceClient,e.correlationId)(s.body,this.authority,o,e,r,n,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw hl(POt);let r=this.createLogoutUrlQueryString(e);return vs.appendQueryString(this.authority.endSessionEndpoint,r)}async executeTokenRequest(e,r,n){let o=p1e(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),s=vs.appendQueryString(e.tokenEndpoint,o),c=await Gs(this.createTokenRequestBody.bind(this),iXr,this.logger,this.performanceClient,r.correlationId)(r),l;if(r.clientInfo)try{let f=tae(r.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${f.uid}${$se}${f.utid}`,type:u_.HOME_ACCOUNT_ID}}catch(f){this.logger.verbose(`Could not parse client info for CCS Header: '${f}'`,r.correlationId)}let u=f1e(this.logger,this.config.systemOptions.preventCorsPreflight,l||r.ccsCredential),d=sae(this.config.authOptions.clientId,r);return Gs(h1e,ZZr,this.logger,this.performanceClient,r.correlationId)(s,c,u,d,r.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,n)}async createTokenRequestBody(e){let r=new Map;if(gz(r,e.embeddedClientId||e.extraParameters?.[sM]||this.config.authOptions.clientId),this.includeRedirectUri)Az(r,e.redirectUri);else if(!e.redirectUri)throw hl(TOt);if(mz(r,e.scopes,!0,this.oidcDefaultScopes),n1e(r,e.resource),s5t(r,e.code),$be(r,this.config.libraryInfo),Vbe(r,this.config.telemetry.application),r1e(r),this.serverTelemetryManager&&!mqe(this.config)&&t1e(r,this.serverTelemetryManager),e.codeVerifier&&c5t(r,e.codeVerifier),this.config.clientCredentials.clientSecret&&zbe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let o=this.config.clientCredentials.clientAssertion;Ybe(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Kbe(r,o.assertionType)}if(Jbe(r,Bbe.AUTHORIZATION_CODE_GRANT),_z(r),e.authenticationScheme===rf.POP){let o=new i7(this.cryptoUtils,this.performanceClient),s;e.popKid?s=this.cryptoUtils.encodeKid(e.popKid):s=(await Gs(o.generateCnf.bind(o),oae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Xbe(r,s)}else if(e.authenticationScheme===rf.SSH)if(e.sshJwk)e1e(r,e.sshJwk);else throw hl(qbe);(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&yz(r,e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{let o=tae(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${o.uid}${$se}${o.utid}`,type:u_.HOME_ACCOUNT_ID}}catch(o){this.logger.verbose(`Could not parse client info for CCS Header: '${o}'`,e.correlationId)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case u_.HOME_ACCOUNT_ID:try{let o=lM(n.credential);yL(r,o)}catch(o){this.logger.verbose(`Could not parse home account ID for CCS Header: '${o}'`,e.correlationId)}break;case u_.UPN:t7(r,n.credential);break}return e.embeddedClientId&&_L(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&EL(r,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[rqe])&&EL(r,{[rqe]:"1"}),hz(r,e.correlationId,this.performanceClient),aM(r)}createLogoutUrlQueryString(e){let r=new Map;return e.postLogoutRedirectUri&&t5t(r,e.postLogoutRedirectUri),e.correlationId&&Ez(r,e.correlationId),e.idTokenHint&&r5t(r,e.idTokenHint),e.state&&Wbe(r,e.state),e.logoutHint&&u5t(r,e.logoutHint),e.extraQueryParameters&&EL(r,e.extraQueryParameters),this.config.authOptions.instanceAware&&Zbe(r),aM(r)}async updateTokenEndpointAuthority(e,r){let n=`https://${e}/${this.authority.tenant}/`,o=await k5t(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,r,this.performanceClient);this.authority=o}};p();var C_o=300,Tz=class{static{a(this,"RefreshTokenClient")}constructor(e,r){this.config=bL(e),this.logger=new G0(this.config.loggerOptions,r7,cM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireToken(e,r){let n=K1(),o=await Gs(this.executeTokenRequest.bind(this),XZr,this.logger,this.performanceClient,e.correlationId)(e,this.authority),s=o.headers?.[Op.X_MS_REQUEST_ID],c=new Lp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o.body,e.correlationId),Gs(c.handleServerTokenResponse.bind(c),_qe,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,n,e,r,void 0,void 0,!0,e.forceCache,s)}async acquireTokenByRefreshToken(e,r){if(!e)throw hl(ROt);if(!e.account)throw Pt(Hbe);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Gs(this.acquireTokenWithCachedRefreshToken.bind(this),Eqe,this.logger,this.performanceClient,e.correlationId)(e,!0,r)}catch(o){let s=o instanceof J1&&o.errorCode===vqe,c=o instanceof l_&&o.errorCode===BMt&&o.subError===LMt;if(s||c)return Gs(this.acquireTokenWithCachedRefreshToken.bind(this),Eqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r);throw o}return Gs(this.acquireTokenWithCachedRefreshToken.bind(this),Eqe,this.logger,this.performanceClient,e.correlationId)(e,!1,r)}async acquireTokenWithCachedRefreshToken(e,r,n){let o=hXr(this.cacheManager.getRefreshToken.bind(this.cacheManager),pXr,this.logger,this.performanceClient,e.correlationId)(e.account,r,e.correlationId,void 0);if(!o)throw Sqe(vqe);if(o.expiresOn){let c=e.refreshTokenExpirationOffsetSeconds||C_o;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(o.expiresOn),rtOffsetSeconds:c},e.correlationId),nae(o.expiresOn,c))throw Sqe(b5t)}let s={...e,refreshToken:o.secret,authenticationScheme:e.authenticationScheme||rf.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:u_.HOME_ACCOUNT_ID}};try{return await Gs(this.acquireToken.bind(this),eXr,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(c){if(c instanceof J1&&c.subError===u1e){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);let l=this.cacheManager.generateCredentialKey(o);this.cacheManager.removeRefreshToken(l,e.correlationId)}throw c}}async executeTokenRequest(e,r){let n=p1e(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=vs.appendQueryString(r.tokenEndpoint,n),s=await Gs(this.createTokenRequestBody.bind(this),tXr,this.logger,this.performanceClient,e.correlationId)(e),c=f1e(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),l=sae(this.config.authOptions.clientId,e);return Gs(h1e,JZr,this.logger,this.performanceClient,e.correlationId)(o,s,c,l,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){let r=new Map;if(gz(r,e.embeddedClientId||e.extraParameters?.[sM]||this.config.authOptions.clientId),e.redirectUri&&Az(r,e.redirectUri),mz(r,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),Jbe(r,Bbe.REFRESH_TOKEN_GRANT),_z(r),$be(r,this.config.libraryInfo),Vbe(r,this.config.telemetry.application),r1e(r),this.serverTelemetryManager&&!mqe(this.config)&&t1e(r,this.serverTelemetryManager),a5t(r,e.refreshToken),this.config.clientCredentials.clientSecret&&zbe(r,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){let n=this.config.clientCredentials.clientAssertion;Ybe(r,await d_(n.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Kbe(r,n.assertionType)}if(e.authenticationScheme===rf.POP){let n=new i7(this.cryptoUtils,this.performanceClient),o;e.popKid?o=this.cryptoUtils.encodeKid(e.popKid):o=(await Gs(n.generateCnf.bind(n),oae,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,Xbe(r,o)}else if(e.authenticationScheme===rf.SSH)if(e.sshJwk)e1e(r,e.sshJwk);else throw hl(qbe);if((!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&yz(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case u_.HOME_ACCOUNT_ID:try{let n=lM(e.ccsCredential.credential);yL(r,n)}catch(n){this.logger.verbose(`Could not parse home account ID for CCS Header: '${n}'`,e.correlationId)}break;case u_.UPN:t7(r,e.ccsCredential.credential);break}return e.embeddedClientId&&_L(r,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&EL(r,{...e.extraParameters}),hz(r,e.correlationId,this.performanceClient),aM(r)}};p();var A1e=class{static{a(this,"SilentFlowClient")}constructor(e,r){this.config=bL(e),this.logger=new G0(this.config.loggerOptions,r7,cM),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=r}async acquireCachedToken(e){let r=UP.NOT_APPLICABLE;if(e.forceRefresh||!nu.isEmptyObj(e.claims))throw this.setCacheOutcome(UP.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Pt(Zse);if(!e.account)throw Pt(Hbe);let n=e.account.tenantId||CXr(e.authority),o=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,o,n);if(s){if(A5t(s.cachedAt)||nae(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(UP.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Pt(Zse);if(e.resource){if(s.resource!==e.resource)throw this.setCacheOutcome(UP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Zse)}else s.refreshOn&&nae(s.refreshOn,0)&&(r=UP.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(UP.NO_CACHED_ACCESS_TOKEN,e.correlationId),Pt(Zse);let c=e.authority||this.authority.getPreferredCache(),l={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,o,n),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(r,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Gs(this.generateResultFromCacheRecord.bind(this),rXr,this.logger,this.performanceClient,e.correlationId)(l,e),r]}setCacheOutcome(e,r){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},r),e!==UP.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,r)}async generateResultFromCacheRecord(e,r){let n;if(e.idToken&&(n=CL(e.idToken.secret,this.config.cryptoInterface.base64Decode)),r.maxAge||r.maxAge===0){let o=n?.auth_time;if(!o)throw Pt(jbe);i1e(o,r.maxAge)}return Lp.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,r,this.performanceClient,n)}};var y1e={};xi(y1e,{getAuthorizationCodePayload:()=>T_o,getAuthorizeUrl:()=>S_o,getStandardAuthorizeRequestParameters:()=>b_o,validateAuthorizationResponse:()=>bXr});p();function b_o(t,e,r,n){let o=e.correlationId,s=new Map;gz(s,e.embeddedClientId||e.extraQueryParameters?.[sM]||t.clientId);let c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(mz(s,c,!0,t.authority.options.OIDCOptions?.defaultScopes),n1e(s,e.resource),Az(s,e.redirectUri),Ez(s,o),e5t(s,e.responseMode),_z(s),l5t(s),e.prompt&&(i5t(s,e.prompt),n?.addFields({prompt:e.prompt},o)),e.domainHint&&(n5t(s,e.domainHint),n?.addFields({domainHintFromRequest:!0},o)),e.prompt!==Obe.SELECT_ACCOUNT)if(e.sid&&e.prompt===Obe.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",e.correlationId),dqe(s,e.sid),n?.addFields({sidFromRequest:!0},o);else if(e.account){let l=x_o(e.account),u=w_o(e.account);if(u&&e.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',e.correlationId),u=null),u){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",e.correlationId),Xse(s,u),n?.addFields({loginHintFromClaim:!0},o);try{let d=lM(e.account.homeAccountId);yL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(l&&e.prompt===Obe.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",e.correlationId),dqe(s,l),n?.addFields({sidFromClaim:!0},o);try{let d=lM(e.account.homeAccountId);yL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}else if(e.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",e.correlationId),Xse(s,e.loginHint),t7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(e.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",e.correlationId),Xse(s,e.account.username),n?.addFields({loginHintFromUpn:!0},o);try{let d=lM(e.account.homeAccountId);yL(s,d)}catch{r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",e.correlationId)}}}else e.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",e.correlationId),Xse(s,e.loginHint),t7(s,e.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",e.correlationId);return e.nonce&&o5t(s,e.nonce),e.state&&Wbe(s,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&yz(s,e.claims,t.clientCapabilities),e.embeddedClientId&&_L(s,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(zse))&&Zbe(s),s}a(b_o,"getStandardAuthorizeRequestParameters");function S_o(t,e){let r=aM(e);return vs.appendQueryString(t.authorizationEndpoint,r)}a(S_o,"getAuthorizeUrl");function T_o(t,e){if(bXr(t,e),!t.code)throw Pt(YOt);return t}a(T_o,"getAuthorizationCodePayload");function bXr(t,e){if(!t.state||!e)throw t.state?Pt(lqe,"Cached State"):Pt(lqe,"Server State");let r,n;try{r=decodeURIComponent(t.state)}catch{throw Pt(pz,t.state)}try{n=decodeURIComponent(e)}catch{throw Pt(pz,t.state)}if(r!==n)throw Pt(UOt);if(t.error||t.error_description||t.suberror){let o=I_o(t);throw bqe(t.error,t.error_description,t.suberror)?new J1(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",o):new l_(t.error||"",t.error_description,t.suberror,o)}}a(bXr,"validateAuthorizationResponse");function I_o(t){let e="code=",r=t.error_uri?.lastIndexOf(e);return r&&r>=0?t.error_uri?.substring(r+e.length):void 0}a(I_o,"parseServerErrorNo");function x_o(t){return t.idTokenClaims?.sid||null}a(x_o,"extractAccountSid");function w_o(t){return t.loginHint||t.idTokenClaims?.login_hint||null}a(w_o,"extractLoginHint");p();function Iz(t,e){if(t){if(e.resource&&(SXr(e.extraParameters)||SXr(e.extraQueryParameters)))throw Pt(XOt);if(!e.resource)throw Pt(ZOt)}}a(Iz,"enforceResourceParameter");function SXr(t){return t?Object.prototype.hasOwnProperty.call(t,"resource"):!1}a(SXr,"containsResourceParam");var cae={};xi(cae,{postRequestFailed:()=>P_o,unexpectedError:()=>R_o});p();var R_o="unexpected_error",P_o="post_request_failed";p();var TXr=",",IXr="|";function k_o(t){let{skus:e,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:s}=t,c=new Map([[0,[r,n]],[2,[o,s]]]),l=[];if(e?.length){if(l=e.split(TXr),l.length<4)return e}else l=Array.from({length:4},()=>IXr);return c.forEach((u,d)=>{u.length===2&&u[0]?.length&&u[1]?.length&&D_o({skuArr:l,index:d,skuName:u[0],skuVersion:u[1]})}),l.join(TXr)}a(k_o,"makeExtraSkuString");function D_o(t){let{skuArr:e,index:r,skuName:n,skuVersion:o}=t;r>=e.length||(e[r]=[n,o].join(IXr))}a(D_o,"setSku");var xz=class t{static{a(this,"ServerTelemetryManager")}constructor(e,r){this.cacheOutcome=UP.NOT_APPLICABLE,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=Lbe+lz+e.clientId}generateCurrentRequestHeaderValue(){let e=`${this.apiId}${ZU}${this.cacheOutcome}`,r=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n?.length&&r.push(`broker_error=${n}`);let o=r.join(ZU),s=this.getRegionDiscoveryFields(),c=[e,s].join(ZU);return[KQe,c,o].join(JQe)}generateLastRequestHeaderValue(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*r).join(ZU),o=e.errors.slice(0,r).join(ZU),s=e.errors.length,c=r=RMt&&(r.failedRequests.shift(),r.failedRequests.shift(),r.errors.shift()),r.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Oo?e.subError?r.errors.push(e.subError):e.errorCode?r.errors.push(e.errorCode):r.errors.push(e.toString()):r.errors.push(e.toString()):r.errors.push(DMt),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}incrementCacheHits(){let e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){let e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){let e=this.getLastRequests(),r=t.maxErrorsToSend(e),n=e.errors.length;if(r===n)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{let o={failedRequests:e.failedRequests.slice(r*2),errors:e.errors.slice(r),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o,this.correlationId)}}static maxErrorsToSend(e){let r,n=0,o=0,s=e.errors.length;for(r=0;rJSON.parse(l)),lastUpdatedAt:Date.now().toString()},c={};n7.toObject(c,s),r[n]=c}),r}static deserializeIdTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAccessTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,realm:o.realm,target:o.target,cachedAt:o.cached_at,expiresOn:o.expires_on,extendedExpiresOn:o.extended_expires_on,refreshOn:o.refresh_on,keyId:o.key_id,tokenType:o.token_type,userAssertionHash:o.userAssertionHash,resource:o.resource,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeRefreshTokens(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n],s={homeAccountId:o.home_account_id,environment:o.environment,credentialType:o.credential_type,clientId:o.client_id,secret:o.secret,familyId:o.family_id,target:o.target,realm:o.realm,lastUpdatedAt:Date.now().toString()};r[n]=s}),r}static deserializeAppMetadata(e){let r={};return e&&Object.keys(e).map(function(n){let o=e[n];r[n]={clientId:o.client_id,environment:o.environment,familyId:o.family_id}}),r}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}};p();p();var xXr="system_assigned_managed_identity",N_o="managed_identity",N5t=`https://login.microsoftonline.com/${N_o}/`,aC={AUTHORIZATION_HEADER_NAME:"Authorization",METADATA_HEADER_NAME:"Metadata",APP_SERVICE_SECRET_HEADER_NAME:"X-IDENTITY-HEADER",ML_AND_SF_SECRET_HEADER_NAME:"secret"},kh={API_VERSION:"api-version",RESOURCE:"resource",SHA256_TOKEN_TO_REFRESH:"token_sha256_to_refresh",XMS_CC:"xms_cc"},Vi={AZURE_POD_IDENTITY_AUTHORITY_HOST:"AZURE_POD_IDENTITY_AUTHORITY_HOST",DEFAULT_IDENTITY_CLIENT_ID:"DEFAULT_IDENTITY_CLIENT_ID",IDENTITY_ENDPOINT:"IDENTITY_ENDPOINT",IDENTITY_HEADER:"IDENTITY_HEADER",IDENTITY_SERVER_THUMBPRINT:"IDENTITY_SERVER_THUMBPRINT",IMDS_ENDPOINT:"IMDS_ENDPOINT",MSI_ENDPOINT:"MSI_ENDPOINT",MSI_SECRET:"MSI_SECRET"},io={APP_SERVICE:"AppService",AZURE_ARC:"AzureArc",CLOUD_SHELL:"CloudShell",DEFAULT_TO_IMDS:"DefaultToImds",IMDS:"Imds",MACHINE_LEARNING:"MachineLearning",SERVICE_FABRIC:"ServiceFabric"},of={SYSTEM_ASSIGNED:"system-assigned",USER_ASSIGNED_CLIENT_ID:"user-assigned-client-id",USER_ASSIGNED_RESOURCE_ID:"user-assigned-resource-id",USER_ASSIGNED_OBJECT_ID:"user-assigned-object-id"},Gf={GET:"GET",POST:"POST"},wXr="REGION_NAME",RXr="MSAL_FORCE_REGION",PXr=32,kXr={SHA256:"sha256"},xqe={CV_CHARSET:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"},M5t={KEY_SEPARATOR:"-"},rx={MSAL_SKU:"msal.js.node",JWT_BEARER_ASSERTION_TYPE:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer",HTTP_PROTOCOL:"http://",LOCALHOST:"localhost"},sf={acquireTokenSilent:62,acquireTokenByUsernamePassword:371,acquireTokenByDeviceCode:671,acquireTokenByClientCredential:771,acquireTokenByOBO:772,acquireTokenWithManagedIdentity:773,acquireTokenByCode:871,acquireTokenByRefreshToken:872},nx={RSA_256:"RS256",PSS_256:"PS256",X5T_256:"x5t#S256",X5T:"x5t",X5C:"x5c",AUDIENCE:"aud",EXPIRATION_TIME:"exp",ISSUER:"iss",SUBJECT:"sub",NOT_BEFORE:"nbf",JWT_ID:"jti"},wqe={INTERVAL_MS:100,TIMEOUT_MS:5e3},DXr=4096;p();p();p();var lae=class{static{a(this,"HttpClient")}async sendGetRequestAsync(e,r,n){return this.sendRequest(e,Gf.GET,r,n)}async sendPostRequestAsync(e,r){return this.sendRequest(e,Gf.POST,r)}async sendRequest(e,r,n,o){let s=new AbortController,c;o&&(c=setTimeout(()=>{s.abort()},o));let l={method:r,headers:O_o(n),signal:s.signal};r===Gf.POST&&(l.body=n?.body||"");let u;try{u=await fetch(e,l)}catch(d){if(c&&clearTimeout(c),d instanceof Error&&d.name==="AbortError")throw fz(Bp.networkError,"Request timeout");let f=fz(Bp.networkError,`Network request failed: ${d instanceof Error?d.message:"unknown"}`);throw R5t(f,void 0,void 0,d instanceof Error?d:void 0)}c&&clearTimeout(c);try{return{headers:M_o(u.headers),body:await u.json(),status:u.status}}catch(d){throw fz(Bp.tokenParsingError,`Failed to parse response: ${d instanceof Error?d.message:"unknown"}`)}}};function M_o(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}a(M_o,"getHeaderDict");function O_o(t){let e=new Headers;return t&&t.headers&&Object.entries(t.headers).forEach(([r,n])=>{e.append(r,n)}),e}a(O_o,"getFetchHeaders");p();p();p();var Rqe="invalid_file_extension",Pqe="invalid_file_path",o7="invalid_managed_identity_id_type",kqe="invalid_secret",NXr="missing_client_id",MXr="network_unavailable",Dqe="platform_not_supported",Nqe="unable_to_create_azure_arc",Mqe="unable_to_create_cloud_shell",Oqe="unable_to_create_source",E1e="unable_to_read_secret_file",OXr="user_assigned_not_available_at_runtime",Bqe="www_authenticate_header_missing",Lqe="www_authenticate_header_unsupported_format",wz={[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]:"azure_pod_identity_authority_host_url_malformed",[Vi.IDENTITY_ENDPOINT]:"identity_endpoint_url_malformed",[Vi.IMDS_ENDPOINT]:"imds_endpoint_url_malformed",[Vi.MSI_ENDPOINT]:"msi_endpoint_url_malformed"};var B_o={[Rqe]:"The file path in the WWW-Authenticate header does not contain a .key file.",[Pqe]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[o7]:"More than one ManagedIdentityIdType was provided.",[kqe]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[Dqe]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[NXr]:"A ManagedIdentityId id was not provided.",[wz.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST}' environment variable is malformed.`,[wz.IDENTITY_ENDPOINT]:`The Managed Identity's '${Vi.IDENTITY_ENDPOINT}' environment variable is malformed.`,[wz.IMDS_ENDPOINT]:`The Managed Identity's '${Vi.IMDS_ENDPOINT}' environment variable is malformed.`,[wz.MSI_ENDPOINT]:`The Managed Identity's '${Vi.MSI_ENDPOINT}' environment variable is malformed.`,[MXr]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[Nqe]:"Azure Arc Managed Identities can only be system assigned.",[Mqe]:"Cloud Shell Managed Identities can only be system assigned.",[Oqe]:"Unable to create a Managed Identity source based on environment variables.",[E1e]:"Unable to read the secret file.",[OXr]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[Bqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[Lqe]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is in an unsupported format."},O5t=class t extends Oo{static{a(this,"ManagedIdentityError")}constructor(e){super(e,B_o[e]),this.name="ManagedIdentityError",Object.setPrototypeOf(this,t.prototype)}};function Fp(t){return new O5t(t)}a(Fp,"createManagedIdentityError");var Fqe=class{static{a(this,"ManagedIdentityId")}get id(){return this._id}set id(e){this._id=e}get idType(){return this._idType}set idType(e){this._idType=e}constructor(e){let r=e?.userAssignedClientId,n=e?.userAssignedResourceId,o=e?.userAssignedObjectId;if(r){if(n||o)throw Fp(o7);this.id=r,this.idType=of.USER_ASSIGNED_CLIENT_ID}else if(n){if(r||o)throw Fp(o7);this.id=n,this.idType=of.USER_ASSIGNED_RESOURCE_ID}else if(o){if(r||n)throw Fp(o7);this.id=o,this.idType=of.USER_ASSIGNED_OBJECT_ID}else this.id=xXr,this.idType=of.SYSTEM_ASSIGNED}};p();var Dh={invalidLoopbackAddressType:{code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},unableToLoadRedirectUri:{code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},noAuthCodeInResponse:{code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},noLoopbackServerExists:{code:"no_loopback_server_exists",desc:"No loopback server exists yet."},loopbackServerAlreadyExists:{code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},loopbackServerTimeout:{code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},stateNotFoundError:{code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},thumbprintMissing:{code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."},redirectUriNotSupported:{code:"redirect_uri_not_supported",desc:"RedirectUri is not supported in this scenario. Please remove redirectUri from the request."}},Ly=class t extends Oo{static{a(this,"NodeAuthError")}constructor(e,r){super(e,r),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new t(Dh.invalidLoopbackAddressType.code,`${Dh.invalidLoopbackAddressType.desc}`)}static createUnableToLoadRedirectUrlError(){return new t(Dh.unableToLoadRedirectUri.code,`${Dh.unableToLoadRedirectUri.desc}`)}static createNoAuthCodeInResponseError(){return new t(Dh.noAuthCodeInResponse.code,`${Dh.noAuthCodeInResponse.desc}`)}static createNoLoopbackServerExistsError(){return new t(Dh.noLoopbackServerExists.code,`${Dh.noLoopbackServerExists.desc}`)}static createLoopbackServerAlreadyExistsError(){return new t(Dh.loopbackServerAlreadyExists.code,`${Dh.loopbackServerAlreadyExists.desc}`)}static createLoopbackServerTimeoutError(){return new t(Dh.loopbackServerTimeout.code,`${Dh.loopbackServerTimeout.desc}`)}static createStateNotFoundError(){return new t(Dh.stateNotFoundError.code,Dh.stateNotFoundError.desc)}static createThumbprintMissingError(){return new t(Dh.thumbprintMissing.code,Dh.thumbprintMissing.desc)}static createRedirectUriNotSupportedError(){return new t(Dh.redirectUriNotSupported.code,Dh.redirectUriNotSupported.desc)}};var L_o={clientId:"",authority:Xt.DEFAULT_AUTHORITY,clientSecret:"",clientAssertion:"",clientCertificate:{thumbprint:"",thumbprintSha256:"",privateKey:"",x5c:""},knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",clientCapabilities:[],azureCloudOptions:{azureCloudInstance:vL.None,tenant:""},isMcp:!1},B5t={loggerCallback:a(()=>{},"loggerCallback"),piiLoggingEnabled:!1,logLevel:nf.Info},F_o={loggerOptions:B5t,networkClient:new lae,disableInternalRetries:!1,protocolMode:By.AAD},U_o={application:{appName:"",appVersion:""}};function BXr({auth:t,broker:e,cache:r,system:n,telemetry:o}){let s={...F_o,networkClient:new lae,loggerOptions:n?.loggerOptions||B5t,disableInternalRetries:n?.disableInternalRetries||!1};if(t.clientCertificate&&!t.clientCertificate.thumbprint&&!t.clientCertificate.thumbprintSha256)throw Ly.createStateNotFoundError();return{auth:{...L_o,...t},broker:{...e},cache:{...r},system:{...s,...n},telemetry:{...U_o,...o}}}a(BXr,"buildAppConfiguration");function LXr({clientCapabilities:t,managedIdentityIdParams:e,system:r}){let n=new Fqe(e),o=r?.loggerOptions||B5t,s;return r?.networkClient?s=r.networkClient:s=new lae,{clientCapabilities:t||[],managedIdentityId:n,system:{loggerOptions:o,networkClient:s},disableInternalRetries:r?.disableInternalRetries||!1}}a(LXr,"buildManagedIdentityConfiguration");p();p();As();var uae=class{static{a(this,"GuidGenerator")}generateGuid(){return ir()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}};p();var Z1=class t{static{a(this,"EncodingUtils")}static base64Encode(e,r){return Buffer.from(e,r).toString(Xt.EncodingTypes.BASE64)}static base64EncodeUrl(e,r){return t.base64Encode(e,r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Buffer.from(e,Xt.EncodingTypes.BASE64).toString("utf8")}static base64DecodeUrl(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";return t.base64Decode(r)}};p();p();var FXr=fe(require("crypto"),1);var s7=class{static{a(this,"HashUtils")}sha256(e){return FXr.default.createHash(kXr.SHA256).update(e).digest()}};var UXr=fe(require("crypto"),1);var Uqe=class{static{a(this,"PkceGenerator")}constructor(){this.hashUtils=new s7}async generatePkceCodes(){let e=this.generateCodeVerifier(),r=this.generateCodeChallengeFromVerifier(e);return{verifier:e,challenge:r}}generateCodeVerifier(){let e=[],r=256-256%xqe.CV_CHARSET.length;for(;e.length<=PXr;){let o=UXr.default.randomBytes(1)[0];if(o>=r)continue;let s=o%xqe.CV_CHARSET.length;e.push(xqe.CV_CHARSET[s])}let n=e.join("");return Z1.base64EncodeUrl(n)}generateCodeChallengeFromVerifier(e){return Z1.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};var uM=class{static{a(this,"CryptoProvider")}constructor(){this.pkceGenerator=new Uqe,this.guidGenerator=new uae,this.hashUtils=new s7}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return Z1.base64Encode(e)}base64Decode(e){return Z1.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return Z1.base64EncodeUrl(this.hashUtils.sha256(e).toString(Xt.EncodingTypes.BASE64),Xt.EncodingTypes.BASE64)}};p();p();function QXr(t){let e=t.credentialType===Xt.CredentialType.REFRESH_TOKEN&&t.familyId||t.clientId,r=t.tokenType&&t.tokenType.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?t.tokenType.toLowerCase():"";return[t.homeAccountId,t.environment,t.credentialType,e,t.realm||"",t.target||"",r].join(M5t.KEY_SEPARATOR).toLowerCase()}a(QXr,"generateCredentialKey");function qXr(t){let e=t.homeAccountId.split(".")[1];return[t.homeAccountId,t.environment,e||t.tenantId||""].join(M5t.KEY_SEPARATOR).toLowerCase()}a(qXr,"generateAccountKey");var a7=class extends n7{static{a(this,"NodeStorage")}constructor(e,r,n,o){super(r,n,e,new Ph,o),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach(e=>e.call(null))}cacheToInMemoryCache(e){let r={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(let n in e){let o=e[n];if(typeof o=="object")if(bz.isAccountEntity(o))r.accounts[n]=o;else if(c_.isIdTokenEntity(o))r.idTokens[n]=o;else if(c_.isAccessTokenEntity(o))r.accessTokens[n]=o;else if(c_.isRefreshTokenEntity(o))r.refreshTokens[n]=o;else if(c_.isAppMetadataEntity(n,o))r.appMetadata[n]=o;else continue}return r}inMemoryCacheToCache(e){let r=this.getCache();return r={...r,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},r}getInMemoryCache(){return this.logger.trace("Getting in-memory cache",""),this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache","");let r=this.inMemoryCacheToCache(e);this.setCache(r),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store",""),this.cache}setCache(e){this.logger.trace("Setting cache key value store",""),this.cache=e,this.emitChange()}getItem(e){return this.logger.tracePii(`Item key: ${e}`,""),this.getCache()[e]}setItem(e,r){this.logger.tracePii(`Item key: ${e}`,"");let n=this.getCache();n[e]=r,this.setCache(n)}generateCredentialKey(e){return QXr(e)}generateAccountKey(e){return qXr(e)}getAccountKeys(){let e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){let e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){let r=this.getItem(e);return r&&typeof r=="object"?{...r}:null}async setAccount(e){let r=this.generateAccountKey(bz.getAccountInfo(e));this.setItem(r,e)}getIdTokenCredential(e){let r=this.getItem(e);return c_.isIdTokenEntity(r)?r:null}async setIdTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAccessTokenCredential(e){let r=this.getItem(e);return c_.isAccessTokenEntity(r)?r:null}async setAccessTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getRefreshTokenCredential(e){let r=this.getItem(e);return c_.isRefreshTokenEntity(r)?r:null}async setRefreshTokenCredential(e){let r=this.generateCredentialKey(e);this.setItem(r,e)}getAppMetadata(e){let r=this.getItem(e);return c_.isAppMetadataEntity(e,r)?r:null}setAppMetadata(e){let r=c_.generateAppMetadataKey(e);this.setItem(r,e)}getServerTelemetry(e){let r=this.getItem(e);return r&&c_.isServerTelemetryEntity(e,r)?r:null}setServerTelemetry(e,r){this.setItem(e,r)}getAuthorityMetadata(e){let r=this.getItem(e);return r&&c_.isAuthorityMetadataEntity(e,r)?r:null}getAuthorityMetadataKeys(){return this.getKeys().filter(e=>this.isAuthorityMetadata(e))}setAuthorityMetadata(e,r){this.setItem(e,r)}getThrottlingCache(e){let r=this.getItem(e);return r&&c_.isThrottlingEntity(e,r)?r:null}setThrottlingCache(e,r){this.setItem(e,r)}removeItem(e){this.logger.tracePii(`Item key: ${e}`,"");let r=!1,n=this.getCache();return n[e]&&(delete n[e],r=!0),r&&(this.setCache(n),this.emitChange()),r}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys","");let e=this.getCache();return[...Object.keys(e)]}clear(){this.logger.trace("Clearing cache entries created by MSAL",""),this.getKeys().forEach(r=>{this.removeItem(r)}),this.emitChange()}static generateInMemoryCache(e){return SL.deserializeAllCache(SL.deserializeJSONBlob(e))}static generateJsonCache(e){return JU.serializeAllCache(e)}updateCredentialCacheKey(e,r){let n=this.generateCredentialKey(r);if(e!==n){let o=this.getItem(e);if(o)return this.removeItem(e),this.setItem(n,o),this.logger.verbose(`Updated an outdated ${r.credentialType} cache key`,""),n;this.logger.error(`Attempted to update an outdated ${r.credentialType} cache key but no item matching the outdated key was found in storage`,"")}return e}};p();var _1e={Account:{},IdToken:{},AccessToken:{},RefreshToken:{},AppMetadata:{}},dae=class{static{a(this,"TokenCache")}constructor(e,r,n){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),n&&(this.persistence=n),this.logger=r}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache","");let e=JU.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk",""),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge",""),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache",""),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk","");let r=SL.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(r)}else this.logger.trace("No cache snapshot to deserialize","")}getKVStore(){return this.storage.getCache()}getCacheSnapshot(){let e=a7.generateInMemoryCache(this.cacheSnapshot);return this.storage.inMemoryCacheToCache(e)}async getAllAccounts(e=new uM().createNewGuid()){this.logger.trace("getAllAccounts called",e);let r;try{return this.persistence&&(r=new Y1(this,!1),await this.persistence.beforeCacheAccess(r)),this.storage.getAllAccounts({},e)}finally{this.persistence&&r&&await this.persistence.afterCacheAccess(r)}}async getAccountByHomeId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.homeAccountId===e)[0]||null}async getAccountByLocalId(e){let r=await this.getAllAccounts();return e&&r&&r.length&&r.filter(n=>n.localAccountId===e)[0]||null}async removeAccount(e,r){this.logger.trace("removeAccount called",r||"");let n;try{this.persistence&&(n=new Y1(this,!0),await this.persistence.beforeCacheAccess(n)),this.storage.removeAccount(e,r||new uae().generateGuid())}finally{this.persistence&&n&&await this.persistence.afterCacheAccess(n)}}async overwriteCache(){if(!this.persistence){this.logger.info("No persistence layer specified, cache cannot be overwritten","");return}this.logger.info("Overwriting in-memory cache with persistent cache",""),this.storage.clear();let e=new Y1(this,!1);await this.persistence.beforeCacheAccess(e);let r=this.getCacheSnapshot();this.storage.setCache(r),await this.persistence.afterCacheAccess(e)}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,r){this.logger.trace("Merging in-memory cache with cache snapshot","");let n=this.mergeRemovals(e,r);return this.mergeUpdates(n,r)}mergeUpdates(e,r){return Object.keys(r).forEach(n=>{let o=r[n];if(!e.hasOwnProperty(n))o!==null&&(e[n]=o);else{let s=o!==null,c=typeof o=="object",l=!Array.isArray(o),u=typeof e[n]<"u"&&e[n]!==null;s&&c&&l&&u?this.mergeUpdates(e[n],o):e[n]=o}}),e}mergeRemovals(e,r){this.logger.trace("Remove updated entries in cache","");let n=e.Account?this.mergeRemovalsDict(e.Account,r.Account):e.Account,o=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,r.AccessToken):e.AccessToken,s=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,r.RefreshToken):e.RefreshToken,c=e.IdToken?this.mergeRemovalsDict(e.IdToken,r.IdToken):e.IdToken,l=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,r.AppMetadata):e.AppMetadata;return{...e,Account:n,AccessToken:o,RefreshToken:s,IdToken:c,AppMetadata:l}}mergeRemovalsDict(e,r){let n={...e};return Object.keys(e).forEach(o=>{(!r||!r.hasOwnProperty(o))&&delete n[o]}),n}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache",""),{Account:{..._1e.Account,...e.Account},IdToken:{..._1e.IdToken,...e.IdToken},AccessToken:{..._1e.AccessToken,...e.AccessToken},RefreshToken:{..._1e.RefreshToken,...e.RefreshToken},AppMetadata:{..._1e.AppMetadata,...e.AppMetadata}}}};p();var Tnn=fe(ynn(),1);p();var Enn="missing_tenant_id_error",_nn="user_timeout_reached",vnn="invalid_assertion",x4t="invalid_client_credential",Cnn="device_code_polling_cancelled",bnn="device_code_expired",Snn="device_code_unknown_error";var IL=class t{static{a(this,"ClientAssertion")}static fromAssertion(e){let r=new t;return r.jwt=e,r}static fromCertificate(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!1,n&&(o.publicCertificate=this.parseCertificate(n)),o}static fromCertificateWithSha256Thumbprint(e,r,n){let o=new t;return o.privateKey=r,o.thumbprint=e,o.useSha256=!0,n&&(o.publicCertificate=this.parseCertificate(n)),o}getJwt(e,r,n){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&r===this.issuer&&n===this.jwtAudience?this.jwt:this.createJwt(e,r,n);if(this.jwt)return this.jwt;throw Pt(vnn)}createJwt(e,r,n){this.issuer=r,this.jwtAudience=n;let o=ju.nowSeconds();this.expirationTime=o+600;let c={alg:this.useSha256?nx.PSS_256:nx.RSA_256},l=this.useSha256?nx.X5T_256:nx.X5T;Object.assign(c,{[l]:Z1.base64EncodeUrl(this.thumbprint,Xt.EncodingTypes.HEX)}),this.publicCertificate&&Object.assign(c,{[nx.X5C]:this.publicCertificate});let u={[nx.AUDIENCE]:this.jwtAudience,[nx.EXPIRATION_TIME]:this.expirationTime,[nx.ISSUER]:this.issuer,[nx.SUBJECT]:this.issuer,[nx.NOT_BEFORE]:o,[nx.JWT_ID]:e.createNewGuid()};return this.jwt=Tnn.default.sign(u,this.privateKey,{header:c}),this.jwt}isExpired(){return this.expirationTime0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&on.addCcsUpn(r,e.username),iA.mapToQueryString(r)}};p();function Inn(t,e,r,n){let o=y1e.getStandardAuthorizeRequestParameters({...t.auth,authority:e,redirectUri:r.redirectUri||""},r,n);return on.addLibraryInfo(o,{sku:rx.MSAL_SKU,version:X1,cpu:process.arch||"",os:process.platform||""}),t.system.protocolMode!==By.OIDC&&on.addApplicationTelemetry(o,t.telemetry.application),on.addResponseType(o,Xt.OAuthResponseType.CODE),r.codeChallenge&&r.codeChallengeMethod&&on.addCodeChallengeParams(o,r.codeChallenge,r.codeChallengeMethod),on.addExtraParameters(o,r.extraQueryParameters||{}),y1e.getAuthorizeUrl(e,o)}a(Inn,"getAuthCodeRequestUrl");var Cae=class{static{a(this,"ClientApplication")}constructor(e){this.config=BXr(e),this.cryptoProvider=new uM,this.logger=new G0(this.config.system.loggerOptions,vae,X1),this.storage=new a7(this.logger,this.config.auth.clientId,this.cryptoProvider,P5t(this.config.auth)),this.tokenCache=new dae(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||Xt.ResponseMode.QUERY,authenticationScheme:Xt.AuthenticationScheme.BEARER,state:e.state||"",nonce:e.nonce||""},n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions);return Inn(this.config,n,r,this.logger)}async acquireTokenByCode(e,r){this.logger.info("acquireTokenByCode called",e.correlationId||""),e.state&&r&&(this.logger.info("acquireTokenByCode - validating state",e.correlationId||""),this.validateState(e.state,r.state||""),r={...r,state:""});let n={...e,...await this.initializeBaseRequest(e),authenticationScheme:Xt.AuthenticationScheme.BEARER},o=this.initializeServerTelemetryManager(sf.acquireTokenByCode,n.correlationId);try{let s=await this.createAuthority(n.authority,n.correlationId,void 0,e.azureCloudOptions),c=await this.buildOauthClientConfiguration(s,n.correlationId,n.redirectUri,o),l=new g1e(c,new Ph);return this.logger.verbose("Auth code client created",n.correlationId),await l.acquireToken(n,sf.acquireTokenByCode,r)}catch(s){throw s instanceof Oo&&s.setCorrelationId(n.correlationId),o.cacheFailedRequest(s),s}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e),authenticationScheme:Xt.AuthenticationScheme.BEARER},n=this.initializeServerTelemetryManager(sf.acquireTokenByRefreshToken,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new Tz(s,new Ph);return this.logger.verbose("Refresh token client created",r.correlationId),await c.acquireToken(r,sf.acquireTokenByRefreshToken)}catch(o){throw o instanceof Oo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenSilent(e){let r={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},n=this.initializeServerTelemetryManager(sf.acquireTokenSilent,r.correlationId,r.forceRefresh);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,r.redirectUri||"",n),c=new A1e(s,new Ph);this.logger.verbose("Silent flow client created",r.correlationId);try{return await this.tokenCache.overwriteCache(),await this.acquireCachedTokenSilent(r,c,s)}catch(l){if(l instanceof e7&&l.errorCode===Bp.tokenRefreshRequired)return new Tz(s,new Ph).acquireTokenByRefreshToken(r,sf.acquireTokenSilent);throw l}}catch(o){throw o instanceof Oo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireCachedTokenSilent(e,r,n){let[o,s]=await r.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...Xt.OIDC_DEFAULT_SCOPES]});if(s===Xt.CacheOutcome.PROACTIVELY_REFRESHED){this.logger.info("ClientApplication:acquireCachedTokenSilent - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",e.correlationId);let c=new Tz(n,new Ph);try{await c.acquireTokenByRefreshToken(e,sf.acquireTokenSilent)}catch{}}return o}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)},n=this.initializeServerTelemetryManager(sf.acquireTokenByUsernamePassword,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new mje(s);return this.logger.verbose("Username password client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Oo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}getTokenCache(){return this.logger.info("getTokenCache called",""),this.tokenCache}validateState(e,r){if(!e)throw Ly.createStateNotFoundError();if(e!==r)throw Pt(Bp.stateMismatch)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,r,n,o){return this.logger.verbose("buildOauthClientConfiguration called",r),this.logger.info(`Building oauth client configuration with the following authority: ${e.tokenEndpoint}.`,r),o?.updateRegionDiscoveryMetadata(e.regionDiscoveryMetadata),{authOptions:{clientId:this.config.auth.clientId,authority:e,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:n,isMcp:this.config.auth.isMcp},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:r},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:o,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(e)},libraryInfo:{sku:rx.MSAL_SKU,version:X1,cpu:process.arch||"",os:process.platform||""},telemetry:this.config.telemetry,persistencePlugin:this.config.cache.cachePlugin,serializableCache:this.tokenCache}}async getClientAssertion(e){return this.developerProvidedClientAssertion&&(this.clientAssertion=IL.fromAssertion(await d_(this.developerProvidedClientAssertion,this.config.auth.clientId,e.tokenEndpoint))),this.clientAssertion&&{assertion:this.clientAssertion.getJwt(this.cryptoProvider,this.config.auth.clientId,e.tokenEndpoint),assertionType:rx.JWT_BEARER_ASSERTION_TYPE}}async initializeBaseRequest(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();return this.logger.verbose("initializeRequestScopes called",r),e.authenticationScheme&&e.authenticationScheme===Xt.AuthenticationScheme.POP&&this.logger.verbose("Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request",r),e.authenticationScheme=Xt.AuthenticationScheme.BEARER,{...e,scopes:[...e&&e.scopes||[],...Xt.OIDC_DEFAULT_SCOPES],correlationId:r,authority:e.authority||this.config.auth.authority}}initializeServerTelemetryManager(e,r,n){let o={clientId:this.config.auth.clientId,correlationId:r,apiId:e,forceRefresh:n||!1};return new xz(o,this.storage)}async createAuthority(e,r,n,o){this.logger.verbose("createAuthority called",r);let s=qP.generateAuthority(e,o||this.config.auth.azureCloudOptions),c={protocolMode:this.config.system.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,azureRegionConfiguration:n};return Iqe.createDiscoveredInstance(s,this.config.system.networkClient,this.storage,c,this.logger,r,new Ph)}clearCache(){this.storage.clear()}};p();var xnn=fe(require("http"),1);var gje=class{static{a(this,"LoopbackClient")}async listenForAuthCode(e,r){if(this.server)throw Ly.createLoopbackServerAlreadyExistsError();return new Promise((n,o)=>{this.server=xnn.default.createServer((s,c)=>{let l=s.url;if(l){if(l===Xt.FORWARD_SLASH){c.end(e||"Auth code was successfully acquired. You can close this window now.");return}}else{c.end(r||"Error occurred loading redirectUrl"),o(Ly.createUnableToLoadRedirectUrlError());return}let u=this.getRedirectUri(),d=new URL(l,u),f=iA.getDeserializedResponse(d.search)||{};f.code&&(c.writeHead(Xt.HTTP_REDIRECT,{location:u}),c.end()),f.error&&c.end(r||`Error occurred: ${f.error}`),n(f)}),this.server.listen(0,"127.0.0.1")})}getRedirectUri(){if(!this.server||!this.server.listening)throw Ly.createNoLoopbackServerExistsError();let e=this.server.address();if(!e||typeof e=="string"||!e.port)throw this.closeServer(),Ly.createInvalidLoopbackAddressTypeError();let r=e&&e.port;return`${rx.HTTP_PROTOCOL}${rx.LOCALHOST}:${r}`}closeServer(){this.server&&(this.server.close(),typeof this.server.closeAllConnections=="function"&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}};p();var Aje=class extends pM{static{a(this,"DeviceCodeClient")}constructor(e){super(e)}async acquireToken(e){let r=await this.getDeviceCode(e);e.deviceCodeCallback(r);let n=ju.nowSeconds(),o=await this.acquireTokenWithDeviceCode(e,r),s=new Lp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(o,e.correlationId),s.handleServerTokenResponse(o,this.authority,n,e,sf.acquireTokenByDeviceCode)}async getDeviceCode(e){let r=this.createExtraQueryParameters(e),n=vs.appendQueryString(this.authority.deviceCodeEndpoint,r),o=this.createQueryString(e),s=this.createTokenRequestHeaders(),c={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(n,o,s,c,e.correlationId)}createExtraQueryParameters(e){let r=new Map;return e.extraQueryParameters&&on.addExtraParameters(r,e.extraQueryParameters),iA.mapToQueryString(r)}async executePostRequestToDeviceCodeEndpoint(e,r,n,o,s){let{body:{user_code:c,device_code:l,verification_uri:u,expires_in:d,interval:f,message:h}}=await this.sendPostRequest(o,e,{body:r,headers:n},s);return{userCode:c,deviceCode:l,verificationUri:u,expiresIn:d,interval:f,message:h}}createQueryString(e){let r=new Map;return on.addScopes(r,e.scopes),on.addClientId(r,this.config.authOptions.clientId),e.extraQueryParameters&&on.addExtraParameters(r,e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),iA.mapToQueryString(r)}continuePolling(e,r,n){if(n)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true",""),Pt(Cnn);if(r&&rr)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${r}`,""),Pt(_nn);if(ju.nowSeconds()>e)throw r&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${r}`,""),this.logger.error(`Device code expired. Expiration time of device code was ${e}`,""),Pt(bnn);return!0}async acquireTokenWithDeviceCode(e,r){let n=this.createTokenQueryParameters(e),o=vs.appendQueryString(this.authority.tokenEndpoint,n),s=this.createTokenRequestBody(e,r),c=this.createTokenRequestHeaders(),l=e.timeout?ju.nowSeconds()+e.timeout:void 0,u=ju.nowSeconds()+r.expiresIn,d=r.interval*1e3;for(;this.continuePolling(u,l,e.cancel);){let f={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},h=await this.executePostToTokenEndpoint(o,s,c,f,e.correlationId);if(h.body&&h.body.error)if(h.body.error===Xt.AUTHORIZATION_PENDING)this.logger.info("Authorization pending. Continue polling.",e.correlationId),await ju.delay(d);else throw this.logger.info("Unexpected error in polling from the server",e.correlationId),fz(cae.postRequestFailed,h.body.error);else return this.logger.verbose("Authorization completed successfully. Polling stopped.",e.correlationId),h.body}throw this.logger.error("Polling stopped for unknown reasons.",e.correlationId),Pt(Snn)}createTokenRequestBody(e,r){let n=new Map;on.addScopes(n,e.scopes),on.addClientId(n,this.config.authOptions.clientId),on.addGrantType(n,Xt.GrantType.DEVICE_CODE_GRANT),on.addDeviceCode(n,r.deviceCode);let o=e.correlationId||this.config.cryptoInterface.createNewGuid();return on.addCorrelationId(n,o),on.addClientInfo(n),on.addLibraryInfo(n,this.config.libraryInfo),on.addApplicationTelemetry(n,this.config.telemetry.application),on.addThrottling(n),this.serverTelemetryManager&&on.addServerTelemetry(n,this.serverTelemetryManager),(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(n,e.claims,this.config.authOptions.clientCapabilities),iA.mapToQueryString(n)}};var bae=class extends Cae{static{a(this,"PublicClientApplication")}constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.","")),this.skus=xz.makeExtraSkuString({libraryName:rx.MSAL_SKU,libraryVersion:X1})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId||""),Iz(this.config.auth.isMcp,e);let r=Object.assign(e,await this.initializeBaseRequest(e)),n=this.initializeServerTelemetryManager(sf.acquireTokenByDeviceCode,r.correlationId);try{let o=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),s=await this.buildOauthClientConfiguration(o,r.correlationId,"",n),c=new Aje(s);return this.logger.verbose("Device code client created",r.correlationId),await c.acquireToken(r)}catch(o){throw o instanceof Oo&&o.setCorrelationId(r.correlationId),n.cacheFailedRequest(o),o}}async acquireTokenInteractive(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",r),Iz(this.config.auth.isMcp,e);let{openBrowser:n,successTemplate:o,errorTemplate:s,windowHandle:c,loopbackClient:l,...u}=e;if(this.nativeBrokerPlugin){let A={...u,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...u.extraQueryParameters,...u.extraParameters,[dz.X_CLIENT_EXTRA_SKU]:this.skus},accountId:u.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(A,c)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw Ly.createRedirectUriNotSupportedError();e.redirectUri=""}let{verifier:d,challenge:f}=await this.cryptoProvider.generatePkceCodes(),h=l||new gje,m={},g=null;try{let A=h.listenForAuthCode(o,s).then(T=>{m=T}).catch(T=>{g=T}),y=await this.waitForRedirectUri(h),E={...u,correlationId:r,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:y,responseMode:Xt.ResponseMode.QUERY,codeChallenge:f,codeChallengeMethod:Xt.CodeChallengeMethodValues.S256},_=await this.getAuthCodeUrl(E);if(await n(_),await A,g)throw g;if(m.error)throw new l_(m.error,m.error_description,m.suberror);if(!m.code)throw Ly.createNoAuthCodeInResponseError();let v=m.client_info,b={code:m.code,codeVerifier:d,clientInfo:v||"",...E};return await this.acquireTokenByCode(b)}finally{h.closeServer()}}async acquireTokenSilent(e){let r=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",r),Iz(this.config.auth.isMcp,e),this.nativeBrokerPlugin){let n={...e,clientId:this.config.auth.clientId,scopes:e.scopes||Xt.OIDC_DEFAULT_SCOPES,redirectUri:e.redirectUri||"",authority:e.authority||this.config.auth.authority,correlationId:r,extraParameters:{...e.extraQueryParameters,...e.extraParameters,[dz.X_CLIENT_EXTRA_SKU]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(n)}if(e.redirectUri){if(!this.config.broker.nativeBrokerPlugin)throw Ly.createRedirectUriNotSupportedError();e.redirectUri=""}return super.acquireTokenSilent(e)}async acquireTokenByCode(e,r){return Iz(this.config.auth.isMcp,e),super.acquireTokenByCode(e,r)}async acquireTokenByRefreshToken(e){return Iz(this.config.auth.isMcp,e),super.acquireTokenByRefreshToken(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){let r={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(r)}await this.getTokenCache().removeAccount(e.account,e.correlationId)}async getAllAccounts(){if(this.nativeBrokerPlugin){let e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise((r,n)=>{let o=0,s=setInterval(()=>{if(wqe.TIMEOUT_MS/wqe.INTERVAL_MS1)throw Pt(Bp.multipleMatchingTokens);return l[0]}async executeTokenRequest(e,r,n){let o,s;if(this.appTokenProvider){this.logger.info("Using appTokenProvider extensibility.",e.correlationId);let u={correlationId:e.correlationId,tenantId:this.config.authOptions.authority.tenant,scopes:e.scopes,claims:e.claims};s=ju.nowSeconds();let d=await this.appTokenProvider(u);o={access_token:d.accessToken,expires_in:d.expiresInSeconds,refresh_in:d.refreshInSeconds,token_type:Xt.AuthenticationScheme.BEARER}}else{let u=this.createTokenQueryParameters(e),d=vs.appendQueryString(r.tokenEndpoint,u),f=await this.createTokenRequestBody(e),h=this.createTokenRequestHeaders(),m={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};this.logger.info("Sending token request to endpoint: "+r.tokenEndpoint,e.correlationId),s=ju.nowSeconds();let g=await this.executePostToTokenEndpoint(d,f,h,m,e.correlationId);o=g.body,o.status=g.status}let c=new Lp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(o,e.correlationId,n),await c.handleServerTokenResponse(o,this.authority,s,e,sf.acquireTokenByClientCredential)}async createTokenRequestBody(e){let r=new Map;on.addClientId(r,this.config.authOptions.clientId),on.addScopes(r,e.scopes,!1),on.addGrantType(r,Xt.GrantType.CLIENT_CREDENTIALS_GRANT),on.addLibraryInfo(r,this.config.libraryInfo),on.addApplicationTelemetry(r,this.config.telemetry.application),on.addThrottling(r),this.serverTelemetryManager&&on.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();on.addCorrelationId(r,n),this.config.clientCredentials.clientSecret&&on.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=e.clientAssertion||this.config.clientCredentials.clientAssertion;return o&&(on.addClientAssertion(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),on.addClientAssertionType(r,o.assertionType)),(!nu.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),iA.mapToQueryString(r)}};p();var yje=class extends pM{static{a(this,"OnBehalfOfClient")}constructor(e){super(e)}async acquireToken(e){if(this.scopeSet=new Rh(e.scopes||[]),this.userAssertionHash=await this.cryptoUtils.hashString(e.oboAssertion),e.skipCache||e.claims)return this.executeTokenRequest(e,this.authority,this.userAssertionHash);try{return await this.getCachedAuthenticationResult(e)}catch{return await this.executeTokenRequest(e,this.authority,this.userAssertionHash)}}async getCachedAuthenticationResult(e){let r=this.readAccessTokenFromCacheForOBO(this.config.authOptions.clientId,e);if(r){if(ju.isTokenExpired(r.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info(`OnbehalfofFlow:getCachedAuthenticationResult - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`,e.correlationId),Pt(Bp.tokenRefreshRequired)}else throw this.serverTelemetryManager?.setCacheOutcome(Xt.CacheOutcome.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.",e.correlationId),Pt(Bp.tokenRefreshRequired);let n=this.readIdTokenFromCacheForOBO(r.homeAccountId,e.correlationId),o,s=null;if(n){o=pqe.extractTokenClaims(n.secret,Z1.base64Decode);let c=o.oid||o.sub,l={homeAccountId:n.homeAccountId,environment:n.environment,tenantId:n.realm,username:"",localAccountId:c||""};s=this.cacheManager.getAccount(this.cacheManager.generateAccountKey(l),e.correlationId)}return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),Lp.generateAuthenticationResult(this.cryptoUtils,this.authority,{account:s,accessToken:r,idToken:n,refreshToken:null,appMetadata:null},!0,e,this.performanceClient,o)}readIdTokenFromCacheForOBO(e,r){let n={homeAccountId:e,environment:this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,credentialType:Xt.CredentialType.ID_TOKEN,clientId:this.config.authOptions.clientId,realm:this.authority.tenant},o=this.cacheManager.getIdTokensByFilter(n,r);return Object.values(o).length<1?null:Object.values(o)[0]}readAccessTokenFromCacheForOBO(e,r){let n=r.authenticationScheme||Xt.AuthenticationScheme.BEARER,s={credentialType:n&&n.toLowerCase()!==Xt.AuthenticationScheme.BEARER.toLowerCase()?Xt.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:Xt.CredentialType.ACCESS_TOKEN,clientId:e,target:Rh.createSearchScopes(this.scopeSet.asArray()),tokenType:n,keyId:r.sshKid,userAssertionHash:this.userAssertionHash},c=this.cacheManager.getAccessTokensByFilter(s,r.correlationId),l=c.length;if(l<1)return null;if(l>1)throw Pt(Bp.multipleMatchingTokens);return c[0]}async executeTokenRequest(e,r,n){let o=this.createTokenQueryParameters(e),s=vs.appendQueryString(r.tokenEndpoint,o),c=await this.createTokenRequestBody(e),l=this.createTokenRequestHeaders(),u={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},d=ju.nowSeconds(),f=await this.executePostToTokenEndpoint(s,c,l,u,e.correlationId),h=new Lp(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return h.validateTokenResponse(f.body,e.correlationId),await h.handleServerTokenResponse(f.body,this.authority,d,e,sf.acquireTokenByOBO,void 0,n)}async createTokenRequestBody(e){let r=new Map;on.addClientId(r,this.config.authOptions.clientId),on.addScopes(r,e.scopes),on.addGrantType(r,Xt.GrantType.JWT_BEARER),on.addClientInfo(r),on.addLibraryInfo(r,this.config.libraryInfo),on.addApplicationTelemetry(r,this.config.telemetry.application),on.addThrottling(r),this.serverTelemetryManager&&on.addServerTelemetry(r,this.serverTelemetryManager);let n=e.correlationId||this.config.cryptoInterface.createNewGuid();on.addCorrelationId(r,n),on.addRequestTokenUse(r,dz.ON_BEHALF_OF),on.addOboAssertion(r,e.oboAssertion),this.config.clientCredentials.clientSecret&&on.addClientSecret(r,this.config.clientCredentials.clientSecret);let o=this.config.clientCredentials.clientAssertion;return o&&(on.addClientAssertion(r,await d_(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),on.addClientAssertionType(r,o.assertionType)),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&on.addClaims(r,e.claims,this.config.authOptions.clientCapabilities),iA.mapToQueryString(r)}};var Tae=class extends Cae{static{a(this,"ConfidentialClientApplication")}constructor(e){super(e);let r=!!this.config.auth.clientSecret,n=!!this.config.auth.clientAssertion,o=(!!this.config.auth.clientCertificate?.thumbprint||!!this.config.auth.clientCertificate?.thumbprintSha256)&&!!this.config.auth.clientCertificate?.privateKey;if(!this.appTokenProvider){if(r&&n||n&&o||r&&o)throw Pt(x4t);if(this.config.auth.clientSecret){this.clientSecret=this.config.auth.clientSecret;return}if(this.config.auth.clientAssertion){this.developerProvidedClientAssertion=this.config.auth.clientAssertion;return}if(o)this.clientAssertion=this.config.auth.clientCertificate.thumbprintSha256?IL.fromCertificateWithSha256Thumbprint(this.config.auth.clientCertificate.thumbprintSha256,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c):IL.fromCertificate(this.config.auth.clientCertificate.thumbprint,this.config.auth.clientCertificate.privateKey,this.config.auth.clientCertificate.x5c);else throw Pt(x4t);this.appTokenProvider=void 0}}SetAppTokenProvider(e){this.appTokenProvider=e}async acquireTokenByClientCredential(e){this.logger.info("acquireTokenByClientCredential called",e.correlationId||"");let r;e.clientAssertion&&(r={assertion:await d_(e.clientAssertion,this.config.auth.clientId),assertionType:rx.JWT_BEARER_ASSERTION_TYPE});let n=await this.initializeBaseRequest(e),o={...n,scopes:n.scopes.filter(m=>!Xt.OIDC_DEFAULT_SCOPES.includes(m))},s={...e,...o,clientAssertion:r},l=new vs(s.authority).getUrlComponents().PathSegments[0];if(Object.values(Xt.AADAuthority).includes(l))throw Pt(Enn);let u=process.env[RXr],d;s.azureRegion!=="DisableMsalForceRegion"&&(!s.azureRegion&&u?d=u:d=s.azureRegion);let f={azureRegion:d,environmentRegion:process.env[wXr]},h=this.initializeServerTelemetryManager(sf.acquireTokenByClientCredential,s.correlationId,s.skipCache);try{let m=await this.createAuthority(s.authority,s.correlationId,f,e.azureCloudOptions),g=await this.buildOauthClientConfiguration(m,s.correlationId,"",h),A=new Sae(g,this.appTokenProvider);return this.logger.verbose("Client credential client created",s.correlationId),await A.acquireToken(s)}catch(m){throw m instanceof Oo&&m.setCorrelationId(s.correlationId),h.cacheFailedRequest(m),m}}async acquireTokenOnBehalfOf(e){this.logger.info("acquireTokenOnBehalfOf called",e.correlationId||"");let r={...e,...await this.initializeBaseRequest(e)};try{let n=await this.createAuthority(r.authority,r.correlationId,void 0,e.azureCloudOptions),o=await this.buildOauthClientConfiguration(n,r.correlationId,"",void 0),s=new yje(o);return this.logger.verbose("On behalf of client created",r.correlationId),await s.acquireToken(r)}catch(n){throw n instanceof Oo&&n.setCorrelationId(r.correlationId),n}}};p();p();p();p();p();function wnn(t){if(typeof t!="string")return!1;let e=new Date(t);return!isNaN(e.getTime())&&e.toISOString()===t}a(wnn,"isIso8601");p();var Eje=class{static{a(this,"HttpClientWithRetries")}constructor(e,r,n){this.httpClientNoRetries=e,this.retryPolicy=r,this.logger=n}async sendNetworkRequestAsyncHelper(e,r,n){return e===Gf.GET?this.httpClientNoRetries.sendGetRequestAsync(r,n):this.httpClientNoRetries.sendPostRequestAsync(r,n)}async sendNetworkRequestAsync(e,r,n){let o=await this.sendNetworkRequestAsyncHelper(e,r,n);"isNewRequest"in this.retryPolicy&&(this.retryPolicy.isNewRequest=!0);let s=0;for(;await this.retryPolicy.pauseForRetry(o.status,s,this.logger,o.headers[Xt.HeaderNames.RETRY_AFTER]);)o=await this.sendNetworkRequestAsyncHelper(e,r,n),s++;return o}async sendGetRequestAsync(e,r){return this.sendNetworkRequestAsync(Gf.GET,e,r)}async sendPostRequestAsync(e,r){return this.sendNetworkRequestAsync(Gf.POST,e,r)}};var kz={MANAGED_IDENTITY_CLIENT_ID_2017:"clientid",MANAGED_IDENTITY_CLIENT_ID:"client_id",MANAGED_IDENTITY_OBJECT_ID:"object_id",MANAGED_IDENTITY_RESOURCE_ID_IMDS:"msi_res_id",MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS:"mi_res_id"},h_=class{static{a(this,"BaseManagedIdentitySource")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async getServerTokenResponseAsync(e,r,n,o){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let r,n;return e.body.expires_on&&(wnn(e.body.expires_on)&&(e.body.expires_on=new Date(e.body.expires_on).getTime()/1e3),n=e.body.expires_on-ju.nowSeconds(),n>2*3600&&(r=n/2)),{status:e.status,access_token:e.body.access_token,expires_in:n,scope:e.body.resource,token_type:e.body.token_type,refresh_in:r,correlation_id:e.body.correlation_id||e.body.correlationId,error:typeof e.body.error=="string"?e.body.error:e.body.error?.code,error_description:e.body.message||(typeof e.body.error=="string"?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,r,n,o){let s=this.createRequest(e.resource,r);if(e.revokedTokenSha256Hash&&(this.logger.info(`[Managed Identity] The following claims are present in the request: ${e.claims}`,""),s.queryParameters[kh.SHA256_TOKEN_TO_REFRESH]=e.revokedTokenSha256Hash),e.clientCapabilities?.length){let g=e.clientCapabilities.toString();this.logger.info(`[Managed Identity] The following client capabilities are present in the request: ${g}`,""),s.queryParameters[kh.XMS_CC]=g}let c=s.headers;c[Xt.HeaderNames.CONTENT_TYPE]=Xt.URL_FORM_CONTENT_TYPE;let l={headers:c};Object.keys(s.bodyParameters).length&&(l.body=s.computeParametersBodyString());let u=this.disableInternalRetries?this.networkClient:new Eje(this.networkClient,s.retryPolicy,this.logger),d=ju.nowSeconds(),f;try{s.httpMethod===Gf.POST?f=await u.sendPostRequestAsync(s.computeUri(),l):f=await u.sendGetRequestAsync(s.computeUri(),l)}catch(g){throw g instanceof Oo?g:Pt(Bp.networkError)}let h=new Lp(r.id,this.nodeStorage,this.cryptoProvider,this.logger,new Ph,null,null),m=await this.getServerTokenResponseAsync(f,u,s,l);return h.validateTokenResponse(m,m.correlation_id||"",o),h.handleServerTokenResponse(m,n,d,e,sf.acquireTokenWithManagedIdentity)}getManagedIdentityUserAssignedIdQueryParameterKey(e,r,n){switch(e){case of.USER_ASSIGNED_CLIENT_ID:return this.logger.info(`[Managed Identity] [API version ${n?"2017+":"2019+"}] Adding user assigned client id to the request.`,""),n?kz.MANAGED_IDENTITY_CLIENT_ID_2017:kz.MANAGED_IDENTITY_CLIENT_ID;case of.USER_ASSIGNED_RESOURCE_ID:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request.",""),r?kz.MANAGED_IDENTITY_RESOURCE_ID_IMDS:kz.MANAGED_IDENTITY_RESOURCE_ID_NON_IMDS;case of.USER_ASSIGNED_OBJECT_ID:return this.logger.info("[Managed Identity] Adding user assigned object id to the request.",""),kz.MANAGED_IDENTITY_OBJECT_ID;default:throw Fp(o7)}}};h_.getValidatedEnvVariableUrlString=(t,e,r,n)=>{try{return new vs(e).urlString}catch{throw n.info(`[Managed Identity] ${r} managed identity is unavailable because the '${t}' environment variable is malformed.`,""),Fp(wz[t])}};p();p();p();var _je=class{static{a(this,"LinearRetryStrategy")}calculateDelay(e,r){if(!e)return r;let n=Math.round(parseFloat(e)*1e3);return isNaN(n)&&(n=new Date(e).valueOf()-new Date().valueOf()),Math.max(r,n)}};var eIo=3,tIo=1e3,rIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_TOO_MANY_REQUESTS,Xt.HTTP_SERVER_ERROR,Xt.HTTP_SERVICE_UNAVAILABLE,Xt.HTTP_GATEWAY_TIMEOUT],vje=class t{static{a(this,"DefaultManagedIdentityRetryPolicy")}constructor(){this.linearRetryStrategy=new _je}static get DEFAULT_MANAGED_IDENTITY_RETRY_DELAY_MS(){return tIo}async pauseForRetry(e,r,n,o){if(rIo.includes(e)&&rsetTimeout(c,s)),!0}return!1}};var cC=class{static{a(this,"ManagedIdentityRequestParameters")}constructor(e,r,n){this.httpMethod=e,this._baseEndpoint=r,this.headers={},this.bodyParameters={},this.queryParameters={},this.retryPolicy=n||new vje}computeUri(){let e=new Map;this.queryParameters&&on.addExtraParameters(e,this.queryParameters);let r=iA.mapToQueryString(e);return vs.appendQueryString(this._baseEndpoint,r)}computeParametersBodyString(){let e=new Map;return this.bodyParameters&&on.addExtraParameters(e,this.bodyParameters),iA.mapToQueryString(e)}};var nIo="2019-08-01",P1e=class t extends h_{static{a(this,"AppService")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.IDENTITY_HEADER];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.APP_SERVICE} managed identity is unavailable because one or both of the '${Vi.IDENTITY_HEADER}' and '${Vi.IDENTITY_ENDPOINT}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.IDENTITY_ENDPOINT,c,io.APP_SERVICE,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.APP_SERVICE} managed identity. Endpoint URI: ${u}. Creating ${io.APP_SERVICE} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new cC(Gf.GET,this.identityEndpoint);return n.headers[aC.APP_SERVICE_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[kh.API_VERSION]=nIo,n.queryParameters[kh.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var xL=require("fs"),Dnn=fe(require("path"),1);var iIo="2019-11-01",Rnn="http://127.0.0.1:40342/metadata/identity/oauth2/token",Pnn="N/A: himds executable exists",knn={win32:`${process.env.ProgramData}\\AzureConnectedMachineAgent\\Tokens\\`,linux:"/var/opt/azcmagent/tokens/"},oIo={win32:`${process.env.ProgramFiles}\\AzureConnectedMachineAgent\\himds.exe`,linux:"/opt/azcmagent/bin/himds"},k1e=class t extends h_{static{a(this,"AzureArc")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static getEnvironmentVariables(){let e=process.env[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.IMDS_ENDPOINT];if(!e||!r){let n=oIo[process.platform];try{(0,xL.accessSync)(n,xL.constants.F_OK|xL.constants.R_OK),e=Rnn,r=Pnn}catch{}}return[e,r]}static tryCreate(e,r,n,o,s,c){let[l,u]=t.getEnvironmentVariables();if(!l||!u)return e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is unavailable through environment variables because one or both of '${Vi.IDENTITY_ENDPOINT}' and '${Vi.IMDS_ENDPOINT}' are not defined. ${io.AZURE_ARC} managed identity is also unavailable through file detection.`,""),null;if(u===Pnn)e.info(`[Managed Identity] ${io.AZURE_ARC} managed identity is available through file detection. Defaulting to known ${io.AZURE_ARC} endpoint: ${Rnn}. Creating ${io.AZURE_ARC} managed identity.`,"");else{let d=t.getValidatedEnvVariableUrlString(Vi.IDENTITY_ENDPOINT,l,io.AZURE_ARC,e);d.endsWith("/")&&d.slice(0,-1),t.getValidatedEnvVariableUrlString(Vi.IMDS_ENDPOINT,u,io.AZURE_ARC,e),e.info(`[Managed Identity] Environment variables validation passed for ${io.AZURE_ARC} managed identity. Endpoint URI: ${d}. Creating ${io.AZURE_ARC} managed identity.`,"")}if(c.idType!==of.SYSTEM_ASSIGNED)throw Fp(Nqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new cC(Gf.GET,this.identityEndpoint.replace("localhost","127.0.0.1"));return r.headers[aC.METADATA_HEADER_NAME]="true",r.queryParameters[kh.API_VERSION]=iIo,r.queryParameters[kh.RESOURCE]=e,r}async getServerTokenResponseAsync(e,r,n,o){let s;if(e.status===Xt.HTTP_UNAUTHORIZED){let c=e.headers["www-authenticate"];if(!c)throw Fp(Bqe);if(!c.includes("Basic realm="))throw Fp(Lqe);let l=c.split("Basic realm=")[1];if(!knn.hasOwnProperty(process.platform))throw Fp(Dqe);let u=knn[process.platform],d=Dnn.default.basename(l);if(!d.endsWith(".key"))throw Fp(Rqe);if(u+d!==l)throw Fp(Pqe);let f;try{f=await(0,xL.statSync)(l).size}catch{throw Fp(E1e)}if(f>DXr)throw Fp(kqe);let h;try{h=(0,xL.readFileSync)(l,Xt.EncodingTypes.UTF8)}catch{throw Fp(E1e)}let m=`Basic ${h}`;this.logger.info("[Managed Identity] Adding authorization header to the request.",""),n.headers[aC.AUTHORIZATION_HEADER_NAME]=m;try{s=await r.sendGetRequestAsync(n.computeUri(),o)}catch(g){throw g instanceof Oo?g:Pt(Bp.networkError)}}return this.getServerTokenResponse(s||e)}};p();var D1e=class t extends h_{static{a(this,"CloudShell")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.msiEndpoint=c}static getEnvironmentVariables(){return[process.env[Vi.MSI_ENDPOINT]]}static tryCreate(e,r,n,o,s,c){let[l]=t.getEnvironmentVariables();if(!l)return e.info(`[Managed Identity] ${io.CLOUD_SHELL} managed identity is unavailable because the '${Vi.MSI_ENDPOINT} environment variable is not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.MSI_ENDPOINT,l,io.CLOUD_SHELL,e);if(e.info(`[Managed Identity] Environment variable validation passed for ${io.CLOUD_SHELL} managed identity. Endpoint URI: ${u}. Creating ${io.CLOUD_SHELL} managed identity.`,""),c.idType!==of.SYSTEM_ASSIGNED)throw Fp(Mqe);return new t(e,r,n,o,s,l)}createRequest(e){let r=new cC(Gf.POST,this.msiEndpoint);return r.headers[aC.METADATA_HEADER_NAME]="true",r.bodyParameters[kh.RESOURCE]=e,r}};p();p();p();var Cje=class{static{a(this,"ExponentialRetryStrategy")}constructor(e,r,n){this.minExponentialBackoff=e,this.maxExponentialBackoff=r,this.exponentialDeltaBackoff=n}calculateDelay(e){return e===0?this.minExponentialBackoff:Math.min(Math.pow(2,e-1)*this.exponentialDeltaBackoff,this.maxExponentialBackoff)}};var sIo=[Xt.HTTP_NOT_FOUND,Xt.HTTP_REQUEST_TIMEOUT,Xt.HTTP_GONE,Xt.HTTP_TOO_MANY_REQUESTS],aIo=3,cIo=7,lIo=1e3,uIo=4e3,dIo=2e3,fIo=10*1e3,bje=class t{static{a(this,"ImdsRetryPolicy")}constructor(){this.exponentialRetryStrategy=new Cje(t.MIN_EXPONENTIAL_BACKOFF_MS,t.MAX_EXPONENTIAL_BACKOFF_MS,t.EXPONENTIAL_DELTA_BACKOFF_MS)}static get MIN_EXPONENTIAL_BACKOFF_MS(){return lIo}static get MAX_EXPONENTIAL_BACKOFF_MS(){return uIo}static get EXPONENTIAL_DELTA_BACKOFF_MS(){return dIo}static get HTTP_STATUS_GONE_RETRY_AFTER_MS(){return fIo}set isNewRequest(e){this._isNewRequest=e}async pauseForRetry(e,r,n){if(this._isNewRequest&&(this._isNewRequest=!1,this.maxRetries=e===Xt.HTTP_GONE?cIo:aIo),(sIo.includes(e)||e>=Xt.HTTP_SERVER_ERROR_RANGE_START&&e<=Xt.HTTP_SERVER_ERROR_RANGE_END&&rsetTimeout(s,o)),!0}return!1}};var Nnn="/metadata/identity/oauth2/token",pIo=`http://169.254.169.254${Nnn}`,hIo="2018-02-01",Sje=class t extends h_{static{a(this,"Imds")}constructor(e,r,n,o,s,c){super(e,r,n,o,s),this.identityEndpoint=c}static tryCreate(e,r,n,o,s){let c;return process.env[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]?(e.info(`[Managed Identity] Environment variable ${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST} for ${io.IMDS} returned endpoint: ${process.env[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}`,""),c=t.getValidatedEnvVariableUrlString(Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST,`${process.env[Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST]}${Nnn}`,io.IMDS,e)):(e.info(`[Managed Identity] Unable to find ${Vi.AZURE_POD_IDENTITY_AUTHORITY_HOST} environment variable for ${io.IMDS}, using the default endpoint.`,""),c=pIo),new t(e,r,n,o,s,c)}createRequest(e,r){let n=new cC(Gf.GET,this.identityEndpoint);return n.headers[aC.METADATA_HEADER_NAME]="true",n.queryParameters[kh.API_VERSION]=hIo,n.queryParameters[kh.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!0)]=r.id),n.retryPolicy=new bje,n}};p();var mIo="2019-07-01-preview",N1e=class t extends h_{static{a(this,"ServiceFabric")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.identityEndpoint=c,this.identityHeader=l}static getEnvironmentVariables(){let e=process.env[Vi.IDENTITY_ENDPOINT],r=process.env[Vi.IDENTITY_HEADER],n=process.env[Vi.IDENTITY_SERVER_THUMBPRINT];return[e,r,n]}static tryCreate(e,r,n,o,s,c){let[l,u,d]=t.getEnvironmentVariables();if(!l||!u||!d)return e.info(`[Managed Identity] ${io.SERVICE_FABRIC} managed identity is unavailable because one or all of the '${Vi.IDENTITY_HEADER}', '${Vi.IDENTITY_ENDPOINT}' or '${Vi.IDENTITY_SERVER_THUMBPRINT}' environment variables are not defined.`,""),null;let f=t.getValidatedEnvVariableUrlString(Vi.IDENTITY_ENDPOINT,l,io.SERVICE_FABRIC,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.SERVICE_FABRIC} managed identity. Endpoint URI: ${f}. Creating ${io.SERVICE_FABRIC} managed identity.`,""),c.idType!==of.SYSTEM_ASSIGNED&&e.warning(`[Managed Identity] ${io.SERVICE_FABRIC} user assigned managed identity is configured in the cluster, not during runtime. See also: https://learn.microsoft.com/en-us/azure/service-fabric/configure-existing-cluster-enable-managed-identity-token-service.`,""),new t(e,r,n,o,s,l,u)}createRequest(e,r){let n=new cC(Gf.GET,this.identityEndpoint);return n.headers[aC.ML_AND_SF_SECRET_HEADER_NAME]=this.identityHeader,n.queryParameters[kh.API_VERSION]=mIo,n.queryParameters[kh.RESOURCE]=e,r.idType!==of.SYSTEM_ASSIGNED&&(n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType)]=r.id),n}};p();var gIo="2017-09-01",AIo=`Only client id is supported for user-assigned managed identity in ${io.MACHINE_LEARNING}.`,M1e=class t extends h_{static{a(this,"MachineLearning")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s),this.msiEndpoint=c,this.secret=l}static getEnvironmentVariables(){let e=process.env[Vi.MSI_ENDPOINT],r=process.env[Vi.MSI_SECRET];return[e,r]}static tryCreate(e,r,n,o,s){let[c,l]=t.getEnvironmentVariables();if(!c||!l)return e.info(`[Managed Identity] ${io.MACHINE_LEARNING} managed identity is unavailable because one or both of the '${Vi.MSI_ENDPOINT}' and '${Vi.MSI_SECRET}' environment variables are not defined.`,""),null;let u=t.getValidatedEnvVariableUrlString(Vi.MSI_ENDPOINT,c,io.MACHINE_LEARNING,e);return e.info(`[Managed Identity] Environment variables validation passed for ${io.MACHINE_LEARNING} managed identity. Endpoint URI: ${u}. Creating ${io.MACHINE_LEARNING} managed identity.`,""),new t(e,r,n,o,s,c,l)}createRequest(e,r){let n=new cC(Gf.GET,this.msiEndpoint);if(n.headers[aC.METADATA_HEADER_NAME]="true",n.headers[aC.ML_AND_SF_SECRET_HEADER_NAME]=this.secret,n.queryParameters[kh.API_VERSION]=gIo,n.queryParameters[kh.RESOURCE]=e,r.idType===of.SYSTEM_ASSIGNED)n.queryParameters[kz.MANAGED_IDENTITY_CLIENT_ID_2017]=process.env[Vi.DEFAULT_IDENTITY_CLIENT_ID];else if(r.idType===of.USER_ASSIGNED_CLIENT_ID)n.queryParameters[this.getManagedIdentityUserAssignedIdQueryParameterKey(r.idType,!1,!0)]=r.id;else throw new Error(AIo);return n}};var O1e=class t{static{a(this,"ManagedIdentityClient")}constructor(e,r,n,o,s){this.logger=e,this.nodeStorage=r,this.networkClient=n,this.cryptoProvider=o,this.disableInternalRetries=s}async sendManagedIdentityTokenRequest(e,r,n,o){return t.identitySource||(t.identitySource=this.selectManagedIdentitySource(this.logger,this.nodeStorage,this.networkClient,this.cryptoProvider,this.disableInternalRetries,r)),t.identitySource.acquireTokenWithManagedIdentity(e,r,n,o)}allEnvironmentVariablesAreDefined(e){return Object.values(e).every(r=>r!==void 0)}getManagedIdentitySource(){return t.sourceName=this.allEnvironmentVariablesAreDefined(N1e.getEnvironmentVariables())?io.SERVICE_FABRIC:this.allEnvironmentVariablesAreDefined(P1e.getEnvironmentVariables())?io.APP_SERVICE:this.allEnvironmentVariablesAreDefined(M1e.getEnvironmentVariables())?io.MACHINE_LEARNING:this.allEnvironmentVariablesAreDefined(D1e.getEnvironmentVariables())?io.CLOUD_SHELL:this.allEnvironmentVariablesAreDefined(k1e.getEnvironmentVariables())?io.AZURE_ARC:io.DEFAULT_TO_IMDS,t.sourceName}selectManagedIdentitySource(e,r,n,o,s,c){let l=N1e.tryCreate(e,r,n,o,s,c)||P1e.tryCreate(e,r,n,o,s)||M1e.tryCreate(e,r,n,o,s)||D1e.tryCreate(e,r,n,o,s,c)||k1e.tryCreate(e,r,n,o,s,c)||Sje.tryCreate(e,r,n,o,s);if(!l)throw Fp(Oqe);return l}};var yIo=[io.SERVICE_FABRIC],Iae=class t{static{a(this,"ManagedIdentityApplication")}constructor(e){this.config=LXr(e||{}),this.logger=new G0(this.config.system.loggerOptions,vae,X1);let r={canonicalAuthority:Xt.DEFAULT_AUTHORITY};t.nodeStorage||(t.nodeStorage=new a7(this.logger,this.config.managedIdentityId.id,eae,r)),this.networkClient=this.config.system.networkClient,this.cryptoProvider=new uM;let n={protocolMode:By.AAD,knownAuthorities:[N5t],cloudDiscoveryMetadata:"",authorityMetadata:""};this.fakeAuthority=new qP(N5t,this.networkClient,t.nodeStorage,n,this.logger,this.cryptoProvider.createNewGuid(),new Ph,!0),this.fakeClientCredentialClient=new Sae({authOptions:{clientId:this.config.managedIdentityId.id,authority:this.fakeAuthority}}),this.managedIdentityClient=new O1e(this.logger,t.nodeStorage,this.networkClient,this.cryptoProvider,this.config.disableInternalRetries),this.hashUtils=new s7}async acquireToken(e){if(!e.resource)throw hl(Jse.urlEmptyError);let r={forceRefresh:e.forceRefresh,resource:e.resource.replace("/.default",""),scopes:[e.resource.replace("/.default","")],authority:this.fakeAuthority.canonicalAuthority,correlationId:this.cryptoProvider.createNewGuid(),claims:e.claims,clientCapabilities:this.config.clientCapabilities};if(r.forceRefresh)return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority);let[n,o]=await this.fakeClientCredentialClient.getCachedAuthenticationResult(r,this.config,this.cryptoProvider,this.fakeAuthority,t.nodeStorage);if(r.claims){let s=this.managedIdentityClient.getManagedIdentitySource();if(n&&yIo.includes(s)){let c=this.hashUtils.sha256(n.accessToken).toString(Xt.EncodingTypes.HEX);r.revokedTokenSha256Hash=c}return this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}return n?(o===Xt.CacheOutcome.PROACTIVELY_REFRESHED&&(this.logger.info("ClientCredentialClient:getCachedAuthenticationResult - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.",r.correlationId),await this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority,!0)),n):this.acquireTokenFromManagedIdentity(r,this.config.managedIdentityId,this.fakeAuthority)}async acquireTokenFromManagedIdentity(e,r,n,o){return this.managedIdentityClient.sendManagedIdentityTokenRequest(e,r,n,o)}getManagedIdentitySource(){return O1e.sourceName||this.managedIdentityClient.getManagedIdentitySource()}};p();var Tje=class{static{a(this,"DistributedCachePlugin")}constructor(e,r){this.client=e,this.partitionManager=r}async beforeCacheAccess(e){let r=await this.partitionManager.getKey(),n=await this.client.get(r);e.tokenCache.deserialize(n)}async afterCacheAccess(e){if(e.cacheHasChanged){let r=e.tokenCache.getKVStore(),n=Object.values(r).filter(s=>bz.isAccountEntity(s)),o;if(n.length>0){let s=n[0];o=await this.partitionManager.extractKey(s)}else o=await this.partitionManager.getKey();await this.client.set(o,e.tokenCache.serialize())}}};var EIo=Xt.PromptValue,_Io=Xt.ResponseMode;p();p();p();p();p();function B1e(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t}a(B1e,"getRandomIntegerInclusive");function L1e(t,e){let r=e.retryDelayInMs*Math.pow(2,t),n=Math.min(e.maxRetryDelayInMs,r);return{retryAfterInMs:n/2+B1e(0,n/2)}}a(L1e,"calculateRetryDelay");p();function xae(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(xae,"isObject");p();function Dz(t){if(xae(t)){let e=typeof t.name=="string",r=typeof t.message=="string";return e&&r}return!1}a(Dz,"isError");p();p();var Mnn=require("node:crypto");var w4t,vIo=typeof((w4t=globalThis?.crypto)===null||w4t===void 0?void 0:w4t.randomUUID)=="function"?globalThis.crypto.randomUUID.bind(globalThis.crypto):Mnn.randomUUID;function wae(){return vIo()}a(wae,"randomUUID");p();var R4t,P4t,k4t,D4t,Onn=typeof window<"u"&&typeof window.document<"u",Bnn=typeof self=="object"&&typeof self?.importScripts=="function"&&(((R4t=self.constructor)===null||R4t===void 0?void 0:R4t.name)==="DedicatedWorkerGlobalScope"||((P4t=self.constructor)===null||P4t===void 0?void 0:P4t.name)==="ServiceWorkerGlobalScope"||((k4t=self.constructor)===null||k4t===void 0?void 0:k4t.name)==="SharedWorkerGlobalScope"),Lnn=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Fnn=typeof Bun<"u"&&typeof Bun.version<"u",d7=typeof globalThis.process<"u"&&!!globalThis.process.version&&!!(!((D4t=globalThis.process.versions)===null||D4t===void 0)&&D4t.node);var Unn=typeof navigator<"u"&&navigator?.product==="ReactNative";p();function lC(t,e){return Buffer.from(t,e)}a(lC,"stringToUint8Array");p();var N4t="REDACTED",CIo=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],bIo=["api-version"],HP=class{static{a(this,"Sanitizer")}constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:r=[]}={}){e=CIo.concat(e),r=bIo.concat(r),this.allowedHeaderNames=new Set(e.map(n=>n.toLowerCase())),this.allowedQueryParameters=new Set(r.map(n=>n.toLowerCase()))}sanitize(e){let r=new Set;return JSON.stringify(e,(n,o)=>{if(o instanceof Error)return Object.assign(Object.assign({},o),{name:o.name,message:o.message});if(n==="headers")return this.sanitizeHeaders(o);if(n==="url")return this.sanitizeUrl(o);if(n==="query")return this.sanitizeQuery(o);if(n==="body")return;if(n==="response")return;if(n==="operationSpec")return;if(Array.isArray(o)||xae(o)){if(r.has(o))return"[Circular]";r.add(o)}return o},2)}sanitizeUrl(e){if(typeof e!="string"||e===null||e==="")return e;let r=new URL(e);if(!r.search)return e;for(let[n]of r.searchParams)this.allowedQueryParameters.has(n.toLowerCase())||r.searchParams.set(n,N4t);return r.toString()}sanitizeHeaders(e){let r={};for(let n of Object.keys(e))this.allowedHeaderNames.has(n.toLowerCase())?r[n]=e[n]:r[n]=N4t;return r}sanitizeQuery(e){if(typeof e!="object"||e===null)return e;let r={};for(let n of Object.keys(e))this.allowedQueryParameters.has(n.toLowerCase())?r[n]=e[n]:r[n]=N4t;return r}};p();p();p();p();var Nz=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};function O4t(t,e){let{cleanupBeforeAbort:r,abortSignal:n,abortErrorMsg:o}=e??{};return new Promise((s,c)=>{function l(){c(new Nz(o??"The operation was aborted."))}a(l,"rejectOnAbort");function u(){n?.removeEventListener("abort",d)}a(u,"removeListeners");function d(){r?.(),u(),l()}if(a(d,"onAbort"),n?.aborted)return l();try{t(f=>{u(),s(f)},f=>{u(),c(f)})}catch(f){c(f)}n?.addEventListener("abort",d)})}a(O4t,"createAbortablePromise");p();var wIo="The delay was aborted.";function B4t(t,e){let r,{abortSignal:n,abortErrorMsg:o}=e??{};return O4t(s=>{r=setTimeout(s,t)},{cleanupBeforeAbort:a(()=>clearTimeout(r),"cleanupBeforeAbort"),abortSignal:n,abortErrorMsg:o??wIo})}a(B4t,"delay");p();function Rae(t){if(Dz(t))return t.message;{let e;try{typeof t=="object"&&t?e=JSON.stringify(t):e=String(t)}catch{e="[unable to stringify input]"}return`Unknown error ${e}`}}a(Rae,"getErrorMessage");p();function Qnn(t,e){return L1e(t,e)}a(Qnn,"calculateRetryDelay");function Ije(t){return Dz(t)}a(Ije,"isError");var xje=d7,Pae=d7;p();var F1e=lo("IdentityUtils"),qnn="1.0";function Mz(t,e,r){let n=a(o=>(F1e.getToken.info(o),new ex({scopes:Array.isArray(t)?t:[t],getTokenOptions:r,message:o})),"error");if(!e)throw n("No response");if(!e.expiresOn)throw n('Response had no "expiresOn" property.');if(!e.accessToken)throw n('Response had no "accessToken" property.')}a(Mz,"ensureValidMsalToken");function L4t(t){let e=t?.authorityHost;return!e&&Pae&&(e=process.env.AZURE_AUTHORITY_HOST),e??wbe}a(L4t,"getAuthorityHost");function F4t(t,e){return e||(e=wbe),new RegExp(`${t}/?$`).test(e)?e:e.endsWith("/")?e+t:`${e}/${t}`}a(F4t,"getAuthority");function jnn(t,e,r){return t==="adfs"&&e||r?[e]:[]}a(jnn,"getKnownAuthorities");var wje=a((t,e=xje?"Node":"Browser")=>(r,n,o)=>{if(!o)switch(r){case eS.LogLevel.Error:t.info(`MSAL ${e} V2 error: ${n}`);return;case eS.LogLevel.Info:t.info(`MSAL ${e} V2 info message: ${n}`);return;case eS.LogLevel.Verbose:t.info(`MSAL ${e} V2 verbose message: ${n}`);return;case eS.LogLevel.Warning:t.info(`MSAL ${e} V2 warning: ${n}`);return}},"defaultLoggerCallback");function Rje(t){switch(t){case"error":return eS.LogLevel.Error;case"info":return eS.LogLevel.Info;case"verbose":return eS.LogLevel.Verbose;case"warning":return eS.LogLevel.Warning;default:return eS.LogLevel.Info}}a(Rje,"getMSALLogLevel");function Oz(t,e,r){if(e.name==="AuthError"||e.name==="ClientAuthError"||e.name==="BrowserAuthError"){let n=e;switch(n.errorCode){case"endpoints_resolution_error":return F1e.info(Ds(t,e.message)),new Nn(e.message);case"device_code_polling_cancelled":return new Nz("The authentication has been aborted by the caller.");case"consent_required":case"interaction_required":case"login_required":F1e.info(Ds(t,`Authentication returned errorCode ${n.errorCode}`));break;default:F1e.info(Ds(t,`Failed to acquire token: ${e.message}`));break}}return e.name==="ClientConfigurationError"||e.name==="BrowserConfigurationAuthError"||e.name==="AbortError"||e.name==="AuthenticationError"?e:e.name==="NativeAuthError"?(F1e.info(Ds(t,`Error from the native broker: ${e.message} with status code: ${e.statusCode}`)),e):new ex({scopes:t,getTokenOptions:r,message:e.message})}a(Oz,"handleMsalError");function Hnn(t){return{localAccountId:t.homeAccountId,environment:t.authority,username:t.username,homeAccountId:t.homeAccountId,tenantId:t.tenantId}}a(Hnn,"publicToMsal");function Gnn(t,e){return{authority:e.environment??iZr,homeAccountId:e.homeAccountId,tenantId:e.tenantId||nZr,username:e.username,clientId:t,version:qnn}}a(Gnn,"msalToPublic");function U4t(t){let e=JSON.parse(t);if(e.version&&e.version!==qnn)throw Error("Unsupported AuthenticationRecord version");return e}a(U4t,"deserializeAuthenticationRecord");p();p();p();p();p();p();function PIo(t,e){return e!=="Composite"&&e!=="Dictionary"&&(typeof t=="string"||typeof t=="number"||typeof t=="boolean"||e?.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)!==null||t===void 0||t===null)}a(PIo,"isPrimitiveBody");function kIo(t){let e=Object.assign(Object.assign({},t.headers),t.body);return t.hasNullableType&&Object.getOwnPropertyNames(e).length===0?t.shouldWrapBody?{body:null}:null:t.shouldWrapBody?Object.assign(Object.assign({},t.headers),{body:t.body}):e}a(kIo,"handleNullableResponseAndWrappableBody");function Q4t(t,e){var r,n;let o=t.parsedHeaders;if(t.request.method==="HEAD")return Object.assign(Object.assign({},o),{body:t.parsedBody});let s=e&&e.bodyMapper,c=!!s?.nullable,l=s?.type.name;if(l==="Stream")return Object.assign(Object.assign({},o),{blobBody:t.blobBody,readableStreamBody:t.readableStreamBody});let u=l==="Composite"&&s.type.modelProperties||{},d=Object.keys(u).some(f=>u[f].serializedName==="");if(l==="Sequence"||d){let f=(r=t.parsedBody)!==null&&r!==void 0?r:[];for(let h of Object.keys(u))u[h].serializedName&&(f[h]=(n=t.parsedBody)===null||n===void 0?void 0:n[h]);if(o)for(let h of Object.keys(o))f[h]=o[h];return c&&!t.parsedBody&&!o&&Object.getOwnPropertyNames(u).length===0?null:f}return kIo({body:t.parsedBody,headers:o,hasNullableType:c,shouldWrapBody:PIo(t.parsedBody,l)})}a(Q4t,"flattenResponse");var hM={Base64Url:"Base64Url",Boolean:"Boolean",ByteArray:"ByteArray",Composite:"Composite",Date:"Date",DateTime:"DateTime",DateTimeRfc1123:"DateTimeRfc1123",Dictionary:"Dictionary",Enum:"Enum",Number:"Number",Object:"Object",Sequence:"Sequence",String:"String",Stream:"Stream",TimeSpan:"TimeSpan",UnixTime:"UnixTime"};p();p();p();p();p();var mM=class extends Error{static{a(this,"AbortError")}constructor(e){super(e),this.name="AbortError"}};p();p();p();var $nn=require("node:os"),Vnn=fe(require("node:util"),1),Wnn=fe(require("node:process"),1);function znn(t,...e){Wnn.stderr.write(`${Vnn.default.format(t,...e)}${$nn.EOL}`)}a(znn,"log");var Ynn=typeof process<"u"&&process.env&&process.env.DEBUG||void 0,Knn,q4t=[],j4t=[],kje=[];Ynn&&H4t(Ynn);var Jnn=Object.assign(t=>Znn(t),{enable:H4t,enabled:G4t,disable:DIo,log:znn});function H4t(t){Knn=t,q4t=[],j4t=[];let e=/\*/g,r=t.split(",").map(n=>n.trim().replace(e,".*?"));for(let n of r)n.startsWith("-")?j4t.push(new RegExp(`^${n.substr(1)}$`)):q4t.push(new RegExp(`^${n}$`));for(let n of kje)n.enabled=G4t(n.namespace)}a(H4t,"enable");function G4t(t){if(t.endsWith("*"))return!0;for(let e of j4t)if(e.test(t))return!1;for(let e of q4t)if(e.test(t))return!0;return!1}a(G4t,"enabled");function DIo(){let t=Knn||"";return H4t(""),t}a(DIo,"disable");function Znn(t){let e=Object.assign(r,{enabled:G4t(t),destroy:NIo,log:Jnn.log,namespace:t,extend:MIo});function r(...n){e.enabled&&(n.length>0&&(n[0]=`${t} ${n[0]}`),e.log(...n))}return a(r,"debug"),kje.push(e),e}a(Znn,"createDebugger");function NIo(){let t=kje.indexOf(this);return t>=0?(kje.splice(t,1),!0):!1}a(NIo,"destroy");function MIo(t){let e=Znn(`${this.namespace}:${t}`);return e.log=this.log,e}a(MIo,"extend");var kae=Jnn;var $4t=["verbose","info","warning","error"],Xnn={verbose:400,info:300,warning:200,error:100};function ein(t,e){e.log=(...r)=>{t.log(...r)}}a(ein,"patchLogMethod");function tin(t){return $4t.includes(t)}a(tin,"isTypeSpecRuntimeLogLevel");function OIo(t){let e=new Set,r=typeof process<"u"&&process.env&&process.env[t.logLevelEnvVarName]||void 0,n,o=kae(t.namespace);o.log=(...f)=>{kae.log(...f)};function s(f){if(f&&!tin(f))throw new Error(`Unknown log level '${f}'. Acceptable values: ${$4t.join(",")}`);n=f;let h=[];for(let m of e)c(m)&&h.push(m.namespace);kae.enable(h.join(","))}a(s,"contextSetLogLevel"),r&&(tin(r)?s(r):console.error(`${t.logLevelEnvVarName} set to unknown log level '${r}'; logging is not enabled. Acceptable values: ${$4t.join(", ")}.`));function c(f){return!!(n&&Xnn[f.level]<=Xnn[n])}a(c,"shouldEnable");function l(f,h){let m=Object.assign(f.extend(h),{level:h});if(ein(f,m),c(m)){let g=kae.disable();kae.enable(g+","+m.namespace)}return e.add(m),m}a(l,"createLogger");function u(){return n}a(u,"contextGetLogLevel");function d(f){let h=o.extend(f);return ein(o,h),{error:l(h,"error"),warning:l(h,"warning"),info:l(h,"info"),verbose:l(h,"verbose")}}return a(d,"contextCreateClientLogger"),{setLogLevel:s,getLogLevel:u,createClientLogger:d,logger:o}}a(OIo,"createLoggerContext");var rin=OIo({logLevelEnvVarName:"TYPESPEC_RUNTIME_LOG_LEVEL",namespace:"typeSpecRuntime"}),BIo=rin.logger;function Q1e(t){return rin.createClientLogger(t)}a(Q1e,"createClientLogger");p();function Dje(t){return t.toLowerCase()}a(Dje,"normalizeName");function*LIo(t){for(let e of t.values())yield[e.name,e.value]}a(LIo,"headerIterator");var V4t=class{static{a(this,"HttpHeadersImpl")}constructor(e){if(this._headersMap=new Map,e)for(let r of Object.keys(e))this.set(r,e[r])}set(e,r){this._headersMap.set(Dje(e),{name:e,value:String(r).trim()})}get(e){var r;return(r=this._headersMap.get(Dje(e)))===null||r===void 0?void 0:r.value}has(e){return this._headersMap.has(Dje(e))}delete(e){this._headersMap.delete(Dje(e))}toJSON(e={}){let r={};if(e.preserveCase)for(let n of this._headersMap.values())r[n.name]=n.value;else for(let[n,o]of this._headersMap)r[n]=o.value;return r}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return LIo(this._headersMap)}};function tS(t){return new V4t(t)}a(tS,"createHttpHeaders");p();p();p();var W4t=class{static{a(this,"PipelineRequestImpl")}constructor(e){var r,n,o,s,c,l,u;this.url=e.url,this.body=e.body,this.headers=(r=e.headers)!==null&&r!==void 0?r:tS(),this.method=(n=e.method)!==null&&n!==void 0?n:"GET",this.timeout=(o=e.timeout)!==null&&o!==void 0?o:0,this.multipartBody=e.multipartBody,this.formData=e.formData,this.disableKeepAlive=(s=e.disableKeepAlive)!==null&&s!==void 0?s:!1,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=(c=e.withCredentials)!==null&&c!==void 0?c:!1,this.abortSignal=e.abortSignal,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||wae(),this.allowInsecureConnection=(l=e.allowInsecureConnection)!==null&&l!==void 0?l:!1,this.enableBrowserStreams=(u=e.enableBrowserStreams)!==null&&u!==void 0?u:!1,this.requestOverrides=e.requestOverrides,this.authSchemes=e.authSchemes}};function Nje(t){return new W4t(t)}a(Nje,"createPipelineRequest");p();var nin=new Set(["Deserialize","Serialize","Retry","Sign"]),z4t=class t{static{a(this,"HttpPipeline")}constructor(e){var r;this._policies=[],this._policies=(r=e?.slice(0))!==null&&r!==void 0?r:[],this._orderedPolicies=void 0}addPolicy(e,r={}){if(r.phase&&r.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(r.phase&&!nin.has(r.phase))throw new Error(`Invalid phase name: ${r.phase}`);if(r.afterPhase&&!nin.has(r.afterPhase))throw new Error(`Invalid afterPhase name: ${r.afterPhase}`);this._policies.push({policy:e,options:r}),this._orderedPolicies=void 0}removePolicy(e){let r=[];return this._policies=this._policies.filter(n=>e.name&&n.policy.name===e.name||e.phase&&n.options.phase===e.phase?(r.push(n.policy),!1):!0),this._orderedPolicies=void 0,r}sendRequest(e,r){return this.getOrderedPolicies().reduceRight((s,c)=>l=>c.sendRequest(l,s),s=>e.sendRequest(s))(r)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new t(this._policies)}static create(){return new t}orderPolicies(){let e=[],r=new Map;function n(A){return{name:A,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}a(n,"createPhase");let o=n("Serialize"),s=n("None"),c=n("Deserialize"),l=n("Retry"),u=n("Sign"),d=[o,s,c,l,u];function f(A){return A==="Retry"?l:A==="Serialize"?o:A==="Deserialize"?c:A==="Sign"?u:s}a(f,"getPhase");for(let A of this._policies){let y=A.policy,E=A.options,_=y.name;if(r.has(_))throw new Error("Duplicate policy names not allowed in pipeline");let v={policy:y,dependsOn:new Set,dependants:new Set};E.afterPhase&&(v.afterPhase=f(E.afterPhase),v.afterPhase.hasAfterPolicies=!0),r.set(_,v),f(E.phase).policies.add(v)}for(let A of this._policies){let{policy:y,options:E}=A,_=y.name,v=r.get(_);if(!v)throw new Error(`Missing node for policy ${_}`);if(E.afterPolicies)for(let b of E.afterPolicies){let T=r.get(b);T&&(v.dependsOn.add(T),T.dependants.add(v))}if(E.beforePolicies)for(let b of E.beforePolicies){let T=r.get(b);T&&(T.dependsOn.add(v),v.dependants.add(T))}}function h(A){A.hasRun=!0;for(let y of A.policies)if(!(y.afterPhase&&(!y.afterPhase.hasRun||y.afterPhase.policies.size))&&y.dependsOn.size===0){e.push(y.policy);for(let E of y.dependants)E.dependsOn.delete(y);r.delete(y.policy.name),A.policies.delete(y)}}a(h,"walkPhase");function m(){for(let A of d){if(h(A),A.policies.size>0&&A!==s){s.hasRun||h(s);return}A.hasAfterPolicies&&h(s)}}a(m,"walkPhases");let g=0;for(;r.size>0;){g++;let A=e.length;if(m(),e.length<=A&&g>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}};function Mje(){return z4t.create()}a(Mje,"createEmptyPipeline");p();p();var iin=require("node:util"),oin=iin.inspect.custom;var FIo=new HP,aA=class t extends Error{static{a(this,"RestError")}constructor(e,r={}){super(e),this.name="RestError",this.code=r.code,this.statusCode=r.statusCode,Object.defineProperty(this,"request",{value:r.request,enumerable:!1}),Object.defineProperty(this,"response",{value:r.response,enumerable:!1}),Object.defineProperty(this,oin,{value:a(()=>`RestError: ${this.message} + ${FIo.sanitize(Object.assign(Object.assign({},this),{request:this.request,response:this.response}))}`,"value"),enumerable:!1}),Object.setPrototypeOf(this,t.prototype)}};aA.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR";aA.PARSE_ERROR="PARSE_ERROR";function Oje(t){return t instanceof aA?!0:Dz(t)&&t.name==="RestError"}a(Oje,"isRestError");p();p();var Dae=fe(require("node:http"),1),Nae=fe(require("node:https"),1),Lje=fe(require("node:zlib"),1),ain=require("node:stream");p();var ax=Q1e("ts-http-runtime");var UIo={};function q1e(t){return t&&typeof t.pipe=="function"}a(q1e,"isReadableStream");function sin(t){return t.readable===!1?Promise.resolve():new Promise(e=>{let r=a(()=>{e(),t.removeListener("close",r),t.removeListener("end",r),t.removeListener("error",r)},"handler");t.on("close",r),t.on("end",r),t.on("error",r)})}a(sin,"isStreamComplete");function cin(t){return t&&typeof t.byteLength=="number"}a(cin,"isArrayBuffer");var Bje=class extends ain.Transform{static{a(this,"ReportTransform")}_transform(e,r,n){this.push(e),this.loadedBytes+=e.length;try{this.progressCallback({loadedBytes:this.loadedBytes}),n()}catch(o){n(o)}}constructor(e){super(),this.loadedBytes=0,this.progressCallback=e}},Y4t=class{static{a(this,"NodeHttpClient")}constructor(){this.cachedHttpsAgents=new WeakMap}async sendRequest(e){var r,n,o;let s=new AbortController,c;if(e.abortSignal){if(e.abortSignal.aborted)throw new mM("The operation was aborted. Request has already been canceled.");c=a(m=>{m.type==="abort"&&s.abort()},"abortListener"),e.abortSignal.addEventListener("abort",c)}let l;e.timeout>0&&(l=setTimeout(()=>{let m=new HP;ax.info(`request to '${m.sanitizeUrl(e.url)}' timed out. canceling...`),s.abort()},e.timeout));let u=e.headers.get("Accept-Encoding"),d=u?.includes("gzip")||u?.includes("deflate"),f=typeof e.body=="function"?e.body():e.body;if(f&&!e.headers.has("Content-Length")){let m=HIo(f);m!==null&&e.headers.set("Content-Length",m)}let h;try{if(f&&e.onUploadProgress){let _=e.onUploadProgress,v=new Bje(_);v.on("error",b=>{ax.error("Error in upload progress",b)}),q1e(f)?f.pipe(v):v.end(f),f=v}let m=await this.makeRequest(e,s,f);l!==void 0&&clearTimeout(l);let g=QIo(m),y={status:(r=m.statusCode)!==null&&r!==void 0?r:0,headers:g,request:e};if(e.method==="HEAD")return m.resume(),y;h=d?qIo(m,g):m;let E=e.onDownloadProgress;if(E){let _=new Bje(E);_.on("error",v=>{ax.error("Error in download progress",v)}),h.pipe(_),h=_}return!((n=e.streamResponseStatusCodes)===null||n===void 0)&&n.has(Number.POSITIVE_INFINITY)||!((o=e.streamResponseStatusCodes)===null||o===void 0)&&o.has(y.status)?y.readableStreamBody=h:y.bodyAsText=await jIo(h),y}finally{if(e.abortSignal&&c){let m=Promise.resolve();q1e(f)&&(m=sin(f));let g=Promise.resolve();q1e(h)&&(g=sin(h)),Promise.all([m,g]).then(()=>{var A;c&&((A=e.abortSignal)===null||A===void 0||A.removeEventListener("abort",c))}).catch(A=>{ax.warning("Error when cleaning up abortListener on httpRequest",A)})}}}makeRequest(e,r,n){var o;let s=new URL(e.url),c=s.protocol!=="https:";if(c&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);let l=(o=e.agent)!==null&&o!==void 0?o:this.getOrCreateAgent(e,c),u=Object.assign({agent:l,hostname:s.hostname,path:`${s.pathname}${s.search}`,port:s.port,method:e.method,headers:e.headers.toJSON({preserveCase:!0})},e.requestOverrides);return new Promise((d,f)=>{let h=c?Dae.request(u,d):Nae.request(u,d);h.once("error",m=>{var g;f(new aA(m.message,{code:(g=m.code)!==null&&g!==void 0?g:aA.REQUEST_SEND_ERROR,request:e}))}),r.signal.addEventListener("abort",()=>{let m=new mM("The operation was aborted. Rejecting from abort signal callback while making request.");h.destroy(m),f(m)}),n&&q1e(n)?n.pipe(h):n?typeof n=="string"||Buffer.isBuffer(n)?h.end(n):cin(n)?h.end(ArrayBuffer.isView(n)?Buffer.from(n.buffer):Buffer.from(n)):(ax.error("Unrecognized body type",n),f(new aA("Unrecognized body type"))):h.end()})}getOrCreateAgent(e,r){var n;let o=e.disableKeepAlive;if(r)return o?Dae.globalAgent:(this.cachedHttpAgent||(this.cachedHttpAgent=new Dae.Agent({keepAlive:!0})),this.cachedHttpAgent);{if(o&&!e.tlsSettings)return Nae.globalAgent;let s=(n=e.tlsSettings)!==null&&n!==void 0?n:UIo,c=this.cachedHttpsAgents.get(s);return c&&c.options.keepAlive===!o||(ax.info("No cached TLS Agent exist, creating a new Agent"),c=new Nae.Agent(Object.assign({keepAlive:!o},s)),this.cachedHttpsAgents.set(s,c)),c}}};function QIo(t){let e=tS();for(let r of Object.keys(t.headers)){let n=t.headers[r];Array.isArray(n)?n.length>0&&e.set(r,n[0]):n&&e.set(r,n)}return e}a(QIo,"getResponseHeaders");function qIo(t,e){let r=e.get("Content-Encoding");if(r==="gzip"){let n=Lje.createGunzip();return t.pipe(n),n}else if(r==="deflate"){let n=Lje.createInflate();return t.pipe(n),n}return t}a(qIo,"getDecodedResponseStream");function jIo(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{Buffer.isBuffer(o)?n.push(o):n.push(Buffer.from(o))}),t.on("end",()=>{e(Buffer.concat(n).toString("utf8"))}),t.on("error",o=>{o&&o?.name==="AbortError"?r(o):r(new aA(`Error reading response as text: ${o.message}`,{code:aA.PARSE_ERROR}))})})}a(jIo,"streamToText");function HIo(t){return t?Buffer.isBuffer(t)?t.length:q1e(t)?null:cin(t)?t.byteLength:typeof t=="string"?Buffer.from(t).length:null:0}a(HIo,"getBodyLength");function lin(){return new Y4t}a(lin,"createNodeHttpClient");function Fje(){return lin()}a(Fje,"createDefaultHttpClient");p();p();p();p();var K4t="logPolicy";function Uje(t={}){var e;let r=(e=t.logger)!==null&&e!==void 0?e:ax.info,n=new HP({additionalAllowedHeaderNames:t.additionalAllowedHeaderNames,additionalAllowedQueryParameters:t.additionalAllowedQueryParameters});return{name:K4t,async sendRequest(o,s){if(!r.enabled)return s(o);r(`Request: ${n.sanitize(o)}`);let c=await s(o);return r(`Response status code: ${c.status}`),r(`Headers: ${n.sanitize(c.headers)}`),c}}}a(Uje,"logPolicy");p();var J4t="redirectPolicy",uin=["GET","HEAD"];function Qje(t={}){let{maxRetries:e=20}=t;return{name:J4t,async sendRequest(r,n){let o=await n(r);return din(n,o,e)}}}a(Qje,"redirectPolicy");async function din(t,e,r,n=0){let{request:o,status:s,headers:c}=e,l=c.get("location");if(l&&(s===300||s===301&&uin.includes(o.method)||s===302&&uin.includes(o.method)||s===303&&o.method==="POST"||s===307)&&n{let s,c,l=a(()=>o(new mM(r?.abortErrorMsg?r?.abortErrorMsg:GIo)),"rejectOnAbort"),u=a(()=>{r?.abortSignal&&c&&r.abortSignal.removeEventListener("abort",c)},"removeListeners");if(c=a(()=>(s&&clearTimeout(s),u(),l()),"onAborted"),r?.abortSignal&&r.abortSignal.aborted)return l();s=setTimeout(()=>{u(),n(e)},t),r?.abortSignal&&r.abortSignal.addEventListener("abort",c)})}a(hin,"delay");function min(t,e){let r=t.headers.get(e);if(!r)return;let n=Number(r);if(!Number.isNaN(n))return n}a(min,"parseHeaderValueAsNumber");var X4t="Retry-After",$Io=["retry-after-ms","x-ms-retry-after-ms",X4t];function gin(t){if(t&&[429,503].includes(t.status))try{for(let o of $Io){let s=min(t,o);if(s===0||s)return s*(o===X4t?1e3:1)}let e=t.headers.get(X4t);if(!e)return;let n=Date.parse(e)-Date.now();return Number.isFinite(n)?Math.max(0,n):void 0}catch{return}}a(gin,"getRetryAfterInMs");function Ain(t){return Number.isFinite(gin(t))}a(Ain,"isThrottlingRetryResponse");function eBt(){return{name:"throttlingRetryStrategy",retry({response:t}){let e=gin(t);return Number.isFinite(e)?{retryAfterInMs:e}:{skipStrategy:!0}}}}a(eBt,"throttlingRetryStrategy");var VIo=1e3,WIo=1e3*64;function jje(t={}){var e,r;let n=(e=t.retryDelayInMs)!==null&&e!==void 0?e:VIo,o=(r=t.maxRetryDelayInMs)!==null&&r!==void 0?r:WIo;return{name:"exponentialRetryStrategy",retry({retryCount:s,response:c,responseError:l}){let u=YIo(l),d=u&&t.ignoreSystemErrors,f=zIo(c),h=f&&t.ignoreHttpStatusCodes;return c&&(Ain(c)||!f)||h||d?{skipStrategy:!0}:l&&!u&&!f?{errorToThrow:l}:L1e(s,{retryDelayInMs:n,maxRetryDelayInMs:o})}}}a(jje,"exponentialRetryStrategy");function zIo(t){return!!(t&&t.status!==void 0&&(t.status>=500||t.status===408)&&t.status!==501&&t.status!==505)}a(zIo,"isExponentialRetryResponse");function YIo(t){return t?t.code==="ETIMEDOUT"||t.code==="ESOCKETTIMEDOUT"||t.code==="ECONNREFUSED"||t.code==="ECONNRESET"||t.code==="ENOENT"||t.code==="ENOTFOUND":!1}a(YIo,"isSystemError");p();var KIo=Q1e("ts-http-runtime retryPolicy"),JIo="retryPolicy";function f7(t,e={maxRetries:3}){let r=e.logger||KIo;return{name:JIo,async sendRequest(n,o){var s,c;let l,u,d=-1;e:for(;;){d+=1,l=void 0,u=void 0;try{r.info(`Retry ${d}: Attempting to send request`,n.requestId),l=await o(n),r.info(`Retry ${d}: Received a response from request`,n.requestId)}catch(f){if(r.error(`Retry ${d}: Received an error from request`,n.requestId),u=f,!f||u.name!=="RestError")throw f;l=u.response}if(!((s=n.abortSignal)===null||s===void 0)&&s.aborted)throw r.error(`Retry ${d}: Request aborted.`),new mM;if(d>=((c=e.maxRetries)!==null&&c!==void 0?c:3)){if(r.info(`Retry ${d}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),u)throw u;if(l)return l;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${d}: Processing ${t.length} retry strategies.`);t:for(let f of t){let h=f.logger||r;h.info(`Retry ${d}: Processing retry strategy ${f.name}.`);let m=f.retry({retryCount:d,response:l,responseError:u});if(m.skipStrategy){h.info(`Retry ${d}: Skipped.`);continue t}let{errorToThrow:g,retryAfterInMs:A,redirectTo:y}=m;if(g)throw h.error(`Retry ${d}: Retry strategy ${f.name} throws error:`,g),g;if(A||A===0){h.info(`Retry ${d}: Retry strategy ${f.name} retries after ${A}`),await hin(A,void 0,{abortSignal:n.abortSignal});continue e}if(y){h.info(`Retry ${d}: Retry strategy ${f.name} redirects to ${y}`),n.url=y;continue e}}if(u)throw r.info("None of the retry strategies could work with the received error. Throwing it."),u;if(l)return r.info("None of the retry strategies could work with the received response. Returning it."),l}}}}a(f7,"retryPolicy");var tBt="defaultRetryPolicy";function Hje(t={}){var e;return{name:tBt,sendRequest:f7([eBt(),jje(t)],{maxRetries:(e=t.maxRetries)!==null&&e!==void 0?e:3}).sendRequest}}a(Hje,"defaultRetryPolicy");p();var rBt="formDataPolicy";function ZIo(t){var e;let r={};for(let[n,o]of t.entries())(e=r[n])!==null&&e!==void 0||(r[n]=[]),r[n].push(o);return r}a(ZIo,"formDataToFormDataMap");function Gje(){return{name:rBt,async sendRequest(t,e){if(d7&&typeof FormData<"u"&&t.body instanceof FormData&&(t.formData=ZIo(t.body),t.body=void 0),t.formData){let r=t.headers.get("Content-Type");r&&r.indexOf("application/x-www-form-urlencoded")!==-1?t.body=XIo(t.formData):await exo(t.formData,t),t.formData=void 0}return e(t)}}}a(Gje,"formDataPolicy");function XIo(t){let e=new URLSearchParams;for(let[r,n]of Object.entries(t))if(Array.isArray(n))for(let o of n)e.append(r,o.toString());else e.append(r,n.toString());return e.toString()}a(XIo,"wwwFormUrlEncode");async function exo(t,e){let r=e.headers.get("Content-Type");if(r&&!r.startsWith("multipart/form-data"))return;e.headers.set("Content-Type",r??"multipart/form-data");let n=[];for(let[o,s]of Object.entries(t))for(let c of Array.isArray(s)?s:[s])if(typeof c=="string")n.push({headers:tS({"Content-Disposition":`form-data; name="${o}"`}),body:lC(c,"utf-8")});else{if(c==null||typeof c!="object")throw new Error(`Unexpected value for key ${o}: ${c}. Value should be serialized to string first.`);{let l=c.name||"blob",u=tS();u.set("Content-Disposition",`form-data; name="${o}"; filename="${l}"`),u.set("Content-Type",c.type||"application/octet-stream"),n.push({headers:u,body:c})}}e.multipartBody={parts:n}}a(exo,"prepareFormData");p();var jin=fe(uBt(),1),Hin=fe(dBt(),1);var zxo="HTTPS_PROXY",Yxo="HTTP_PROXY",Kxo="ALL_PROXY",Jxo="NO_PROXY",fBt="proxyPolicy",Uin=[],Gin=!1,Zxo=new Map;function Zje(t){if(process.env[t])return process.env[t];if(process.env[t.toLowerCase()])return process.env[t.toLowerCase()]}a(Zje,"getEnvironmentValue");function Xxo(){if(!process)return;let t=Zje(zxo),e=Zje(Kxo),r=Zje(Yxo);return t||e||r}a(Xxo,"loadEnvironmentProxyValue");function ewo(t,e,r){if(e.length===0)return!1;let n=new URL(t).hostname;if(r?.has(n))return r.get(n);let o=!1;for(let s of e)s[0]==="."?(n.endsWith(s)||n.length===s.length-1&&n===s.slice(1))&&(o=!0):n===s&&(o=!0);return r?.set(n,o),o}a(ewo,"isBypassed");function two(){let t=Zje(Jxo);return Gin=!0,t?t.split(",").map(e=>e.trim()).filter(e=>e.length):[]}a(two,"loadNoProxy");function rwo(){let t=Xxo();return t?new URL(t):void 0}a(rwo,"getDefaultProxySettingsInternal");function Qin(t){let e;try{e=new URL(t.host)}catch{throw new Error(`Expecting a valid host string in proxy settings, but found "${t.host}".`)}return e.port=String(t.port),t.username&&(e.username=t.username),t.password&&(e.password=t.password),e}a(Qin,"getUrlFromProxySettings");function qin(t,e,r){if(t.agent)return;let o=new URL(t.url).protocol!=="https:";t.tlsSettings&&ax.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored.");let s=t.headers.toJSON();o?(e.httpProxyAgent||(e.httpProxyAgent=new Hin.HttpProxyAgent(r,{headers:s})),t.agent=e.httpProxyAgent):(e.httpsProxyAgent||(e.httpsProxyAgent=new jin.HttpsProxyAgent(r,{headers:s})),t.agent=e.httpsProxyAgent)}a(qin,"setProxyAgentOnRequest");function Xje(t,e){Gin||Uin.push(...two());let r=t?Qin(t):rwo(),n={};return{name:fBt,async sendRequest(o,s){var c;return!o.proxySettings&&r&&!ewo(o.url,(c=e?.customNoProxyList)!==null&&c!==void 0?c:Uin,e?.customNoProxyList?void 0:Zxo)?qin(o,n,r):o.proxySettings&&qin(o,n,Qin(o.proxySettings)),s(o)}}}a(Xje,"proxyPolicy");p();var pBt="agentPolicy";function eHe(t){return{name:pBt,sendRequest:a(async(e,r)=>(e.agent||(e.agent=t),r(e)),"sendRequest")}}a(eHe,"agentPolicy");p();var hBt="tlsPolicy";function tHe(t){return{name:hBt,sendRequest:a(async(e,r)=>(e.tlsSettings||(e.tlsSettings=t),r(e)),"sendRequest")}}a(tHe,"tlsPolicy");p();p();function rHe(t){return typeof t.stream=="function"}a(rHe,"isBlob");p();wL();var aHe=require("stream");function gon(){return H1e(this,arguments,a(function*(){let e=this.getReader();try{for(;;){let{done:r,value:n}=yield iS(e.read());if(r)return yield iS(void 0);yield yield iS(n)}}finally{e.releaseLock()}},"streamAsyncIterator_1"))}a(gon,"streamAsyncIterator");function swo(t){t[Symbol.asyncIterator]||(t[Symbol.asyncIterator]=gon.bind(t)),t.values||(t.values=gon.bind(t))}a(swo,"makeAsyncIterable");function Aon(t){return t instanceof ReadableStream?(swo(t),aHe.Readable.fromWeb(t)):t}a(Aon,"ensureNodeStream");function awo(t){return t instanceof Uint8Array?aHe.Readable.from(Buffer.from(t)):rHe(t)?Aon(t.stream()):Aon(t)}a(awo,"toStream");async function yon(t){return function(){let e=t.map(r=>typeof r=="function"?r():r).map(awo);return aHe.Readable.from((function(){return H1e(this,arguments,function*(){var r,n,o,s;for(let d of e)try{for(var c=!0,l=(n=void 0,sHe(d)),u;u=yield iS(l.next()),r=u.done,!r;c=!0)s=u.value,c=!1,yield yield iS(s)}catch(f){n={error:f}}finally{try{!c&&!r&&(o=l.return)&&(yield iS(o.call(l)))}finally{if(n)throw n.error}}})})())}}a(yon,"concat");function cwo(){return`----AzSDKFormBoundary${wae()}`}a(cwo,"generateBoundary");function lwo(t){let e="";for(let[r,n]of t)e+=`${r}: ${n}\r +`;return e}a(lwo,"encodeHeaders");function uwo(t){return t instanceof Uint8Array?t.byteLength:rHe(t)?t.size===-1?void 0:t.size:void 0}a(uwo,"getLength");function dwo(t){let e=0;for(let r of t){let n=uwo(r);if(n===void 0)return;e+=n}return e}a(dwo,"getTotalLength");async function fwo(t,e,r){let n=[lC(`--${r}`,"utf-8"),...e.flatMap(s=>[lC(`\r +`,"utf-8"),lC(lwo(s.headers),"utf-8"),lC(`\r +`,"utf-8"),s.body,lC(`\r +--${r}`,"utf-8")]),lC(`--\r \r -`,"utf-8")],o=ywo(n);o&&t.headers.set("Content-Length",o),t.body=await Qon(n)}a(Ewo,"buildRequestBody");var tSe="multipartPolicy",_wo=70,Cwo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function vwo(t){if(t.length>_wo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!Cwo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(vwo,"assertValidBoundary");function vHe(){return{name:tSe,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?vwo(n):n=mwo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await Ewo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(vHe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function bHe(){return zje()}a(bHe,"createEmptyPipeline");p();p();p();var bM=t7("core-rest-pipeline");p();p();p();p();function PBt(t={}){return Xje(Object.assign({logger:bM.info},t))}a(PBt,"logPolicy");p();function DBt(t={}){return eHe(t)}a(DBt,"redirectPolicy");p();p();p();var $ae=ce(require("node:os"),1),SHe=ce(require("node:process"),1);function qon(){return"User-Agent"}a(qon,"getHeaderName");async function jon(t){if(SHe&&SHe.versions){let e=SHe.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${$ae.arch()}-${$ae.type()}-${$ae.release()})`)}a(jon,"setPlatformSpecificData");p();var THe="1.22.0";function Pwo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(Pwo,"getUserAgentString");function Hon(){return qon()}a(Hon,"getUserAgentHeaderName");async function IHe(t){let e=new Map;e.set("core-rest-pipeline",THe),await jon(e);let r=Pwo(e);return t?`${t} ${r}`:r}a(IHe,"getUserAgentValue");var Gon=Hon(),$on="userAgentPolicy";function NBt(t={}){let e=IHe(t.userAgentPrefix);return{name:$on,async sendRequest(r,n){return r.headers.has(Gon)||r.headers.set(Gon,await e),n(r)}}}a(NBt,"userAgentPolicy");p();p();var Von=Symbol("rawContent");function MBt(t){return typeof t[Von]=="function"}a(MBt,"hasRawContent");function Won(t){return MBt(t)?t[Von]():t}a(Won,"getRawContent");var xHe=tSe;function OBt(){let t=vHe();return{name:xHe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)MBt(n.body)&&(n.body=Won(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(OBt,"multipartPolicy");p();function BBt(){return tHe()}a(BBt,"decompressResponsePolicy");p();function LBt(t={}){return nHe(t)}a(LBt,"defaultRetryPolicy");p();function FBt(){return iHe()}a(FBt,"formDataPolicy");p();function UBt(t,e){return pHe(t,e)}a(UBt,"proxyPolicy");p();var zon="setClientRequestIdPolicy";function QBt(t="x-ms-client-request-id"){return{name:zon,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(QBt,"setClientRequestIdPolicy");p();function qBt(t){return hHe(t)}a(qBt,"agentPolicy");p();function jBt(t){return mHe(t)}a(jBt,"tlsPolicy");p();p();var Vae=sA;function rSe(t){return Yje(t)}a(rSe,"isRestError");var Yon="tracingPolicy";function HBt(t={}){let e=IHe(t.userAgentPrefix),r=new Vk({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=Dwo();return{name:Yon,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=Nwo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return Owo(d,h),h}catch(h){throw Mwo(d,h),h}}}}a(HBt,"tracingPolicy");function Dwo(){try{return jbe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:THe})}catch(t){bM.warning(`Error when creating the TracingClient: ${Fae(t)}`);return}}a(Dwo,"tryCreateTracingClient");function Nwo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){bM.warning(`Skipping creating a tracing span due to an error: ${Fae(n)}`);return}}a(Nwo,"tryCreateSpan");function Mwo(t,e){try{t.setStatus({status:"error",error:Qje(e)?e:void 0}),rSe(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){bM.warning(`Skipping tracing span processing due to an error: ${Fae(r)}`)}}a(Mwo,"tryProcessError");function Owo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){bM.warning(`Skipping tracing span processing due to an error: ${Fae(r)}`)}}a(Owo,"tryProcessResponse");p();p();function wHe(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(wHe,"wrapAbortSignalLike");var Bwo="wrapAbortSignalLikePolicy";function Kon(){return{name:Bwo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=wHe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(Kon,"wrapAbortSignalLikePolicy");function GBt(t){var e;let r=bHe();return Uae&&(t.agent&&r.addPolicy(qBt(t.agent)),t.tlsOptions&&r.addPolicy(jBt(t.tlsOptions)),r.addPolicy(UBt(t.proxyOptions)),r.addPolicy(BBt())),r.addPolicy(Kon()),r.addPolicy(FBt(),{beforePolicies:[xHe]}),r.addPolicy(NBt(t.userAgentOptions)),r.addPolicy(QBt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(OBt(),{afterPhase:"Deserialize"}),r.addPolicy(LBt(t.retryOptions),{phase:"Retry"}),r.addPolicy(HBt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Uae&&r.addPolicy(DBt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(PBt(t.loggingOptions),{afterPhase:"Sign"}),r}a(GBt,"createPipelineFromOptions");p();function $Bt(){let t=Zje();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?wHe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a($Bt,"createDefaultHttpClient");p();function _7(t){return cS(t)}a(_7,"createHttpHeaders");p();function zk(t){return Wje(t)}a(zk,"createPipelineRequest");p();p();p();p();var Fwo=t7("core-rest-pipeline retryPolicy");function VBt(t,e={maxRetries:3}){return A7(t,Object.assign({logger:Fwo},e))}a(VBt,"retryPolicy");p();p();var Uwo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Qwo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(WBt,"createTokenCycler");var esn="bearerTokenAuthenticationPolicy";async function RHe(t,e){try{return[await e(t),void 0]}catch(r){if(rSe(r)&&r.response)return[r.response,r];throw r}}a(RHe,"trySendRequest");async function qwo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(qwo,"defaultAuthorizeRequest");function Jon(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(Jon,"isChallengeResponse");async function Zon(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(Zon,"authorizeRequestOnCaeChallenge");function kHe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||bM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:qwo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?WBt(o):()=>Promise.resolve(null);return{name:esn,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await RHe(f,h),Jon(m)){let y=Xon(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await Zon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await RHe(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await RHe(f,h)),Jon(m)&&(y=Xon(m.headers.get("WWW-Authenticate")),y))){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await Zon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await RHe(f,h))}}if(g)throw g;return m}}}a(kHe,"bearerTokenAuthenticationPolicy");function jwo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(jwo,"parseChallenges");function Xon(t){var e;return t?(e=jwo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(Xon,"getCaeChallengeClaims");p();p();p();p();p();p();var rsn=ce(tsn(),1),zBt=rsn.state;function C7(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=nsn(t,n);!c.propertyFound&&r&&(c=nsn(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=C7(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(C7,"getOperationArgumentValueFromParameter");function nsn(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(zwo,"deserializeResponseBody");function Ywo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(Ywo,"isOperationSpecEmpty");function Kwo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(Ywo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Vae(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===_M.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(Kwo,"handleErrorResponse");async function Jwo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||Vae.PARSE_ERROR;throw new Vae(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(Jwo,"parse");p();p();function ssn(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===_M.Stream&&e.add(Number(r))}return e}a(ssn,"getStreamingResponseStatusCodes");function SM(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(SM,"getPathStringFromParameter");var asn="serializationPolicy";function KBt(t={}){let e=t.stringifyXML;return{name:asn,async sendRequest(r,n){let o=BL(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&(Zwo(r,c,s),Xwo(r,c,s,e)),n(r)}}}a(KBt,"serializationPolicy");function Zwo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=C7(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,SM(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||SM(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a(Zwo,"serializeHeaders");function Xwo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=C7(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=SM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===_M.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",k=eRo(_,x,T,t.body,f);T===_M.Sequence?t.body=n(tRo(k,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(k,{rootName:y||A,xmlCharKey:h}))}else{if(T===_M.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=C7(e,m);if(g!=null){let A=m.mapper.serializedName||SM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,SM(m),f)}}}}a(Xwo,"serializeRequestBody");function eRo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(eRo,"getXmlValueWithNamespace");function tRo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(tRo,"prepareXMLRootList");function JBt(t={}){let e=GBt(t??{});return t.credentialOptions&&e.addPolicy(kHe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(KBt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(YBt(t.deserializationOptions),{phase:"Deserialize"}),e}a(JBt,"createClientPipeline");p();var ZBt;function csn(){return ZBt||(ZBt=$Bt()),ZBt}a(csn,"getCachedDefaultHttpClient");p();var rRo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function usn(t,e,r,n){let o=nRo(e,r,n),s=!1,c=lsn(t,o);if(e.path){let d=lsn(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),iRo(d)?(c=d,s=!0):c=oRo(c,d)}let{queryParams:l,sequenceParams:u}=sRo(e,r,n);return c=cRo(c,l,u,s),c}a(usn,"getRequestUrl");function lsn(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(lsn,"replaceAll");function nRo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=C7(e,s,r),l=SM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(nRo,"calculateUrlReplacements");function iRo(t){return t.includes("://")}a(iRo,"isAbsoluteUrl");function oRo(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a(oRo,"appendPath");function sRo(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=C7(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,SM(c));let u=c.collectionFormat?rRo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||SM(c),l)}}return{queryParams:o,sequenceParams:s}}a(sRo,"calculateQueryParameters");function aRo(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(aRo,"simpleParseQueryParams");function cRo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=aRo(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(cRo,"appendQueryParams");p();var XBt=t7("core-client");var nSe=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&XBt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||csn(),this.pipeline=e.pipeline||lRo(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=usn(n,r,e,this),s=zk({url:o});s.method=r.httpMethod;let c=BL(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=ssn(r));try{let d=await this.sendRequest(s),f=Z4t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=Z4t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function lRo(t){let e=uRo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return JBt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(lRo,"createDefaultPipeline");function uRo(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(uRo,"getCredentialScopes");p();p();p();function dsn(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(dsn,"getIdentityTokenEndpointSuffix");p();var fsn="/.default",psn="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function iSe(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(fsn)?e.substr(0,e.lastIndexOf(fsn)):e}a(iSe,"mapScopesToResource");function hsn(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(hsn,"parseExpirationTimestamp");function msn(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(msn,"parseRefreshTimestamp");var oSe="noCorrelationId";function dRo(t){let e=t?.authorityHost;return qje&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??Ube}a(dRo,"getIdentityClientAuthorityHost");var v7=class extends nSe{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${$Qe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=dRo(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){tS.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:hsn(n),refreshAfterTimestamp:msn(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return tS.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new e7(r.status,r.bodyAsText);throw tS.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;tS.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return Nc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=dsn(e),h=zk({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:_7({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return tS.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===WQe&&f.errorResponse.error==="interaction_required")return tS.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw tS.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||oSe,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(oSe)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||oSe}async sendGetRequestAsync(e,r){let n=zk({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:_7(r?.headers),abortSignal:this.generateAbortSignal(oSe)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=zk({url:e,method:"POST",body:r?.body,headers:_7(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));tS.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){tS.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var eLt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(eLt||(eLt={}));function DHe(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===eLt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(DHe,"calculateRegionalAuthority");p();p();function fRo(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(fRo,"createConfigurationErrorMessage");function lf(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=fRo(o);throw n?.info(s),new Dn(s)}return o}a(lf,"processMultiTenantRequest");function Hm(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info(Os("",r)),r}}a(Hm,"checkTenantId");function Wae(t,e,r){return e?(Hm(t,e),e):(r||(r=gz),r!==gz?"common":"organizations")}a(Wae,"resolveTenantId");function jf(t){return!t||t.length===0?[]:t.includes("*")?xZr:t}a(jf,"resolveAdditionallyAllowedTenantIds");var y_=lo("MsalClient");function wRo(t,e,r={}){let n=Wae(r.logger??y_,e,t),o=K4t(n,Y4t(r)),s=new v7({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:uin(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:jje(r.logger??y_),logLevel:Hje(ZQe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(wRo,"generateMsalConfiguration");function My(t,e,r={}){let n={msalConfig:wRo(t,e,r),cachedAccount:r.authenticationRecord?din(r.authenticationRecord):null,pluginConfiguration:MZr.generatePluginConfiguration(r),logger:r.logger??y_},o=new Map;async function s(x={}){let k=x.enableCae?"CAE":"default",D=o.get(k);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Dae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(k,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let k=x.enableCae?"CAE":"default",D=c.get(k);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Mae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(k,D),D}a(l,"getConfidentialApp");async function u(x,k,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new nx({scopes:k});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:k,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(L){throw Gz(k,L,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?K4t(x.tenantId,Y4t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,k,D,N){let L=null;try{L=await u(x,k,D)}catch(B){if(B.name!=="AuthenticationRequiredError")throw B;if(D.disableAutomaticAuthentication)throw new nx({scopes:k,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(L===null)try{L=await N()}catch(B){throw Gz(k,B,D)}return Hz(k,L,D),n.cachedAccount=L?.account??null,n.logger.getToken.info(q0(k)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}a(f,"withSilentAuthentication");async function h(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(h,"getTokenByClientSecret");async function m(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims,clientAssertion:k});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(m,"getTokenByClientAssertion");async function g(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=k;let N=await l(D);try{let L=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:DHe(),claims:D?.claims});return Hz(x,L,D),n.logger.getToken.info(q0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Gz(x,L,D)}}a(g,"getTokenByClientCertificate");async function A(x,k,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let L={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:k,authority:d(D),claims:D?.claims},B=N.acquireTokenByDeviceCode(L);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{L.cancel=!0}),B})}a(A,"getTokenByDeviceCode");async function y(x,k,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let L=await s(N);return f(L,x,N,()=>{let B={scopes:x,username:k,password:D,authority:d(N),claims:N?.claims};return L.acquireTokenByUsernamePassword(B)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return fin(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,k,D,N,L={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let B;return N?(n.msalConfig.auth.clientSecret=N,B=await l(L)):B=await s(L),f(B,x,L,()=>B.acquireTokenByCode({scopes:x,redirectUri:k,code:D,authority:d(L),claims:L?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,k,D,N={}){y_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(y_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(y_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(y_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let L=await l(N);try{let B=await L.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:k});return Hz(x,B,N),y_.getToken.info(q0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Gz(x,B,N)}}a(v,"getTokenOnBehalfOf");function b(x,k){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(LHe(),Gsn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(k),claims:k?.claims,loginHint:k?.loginHint,errorTemplate:k?.browserCustomizationOptions?.errorMessage,successTemplate:k?.browserCustomizationOptions?.successMessage,prompt:k?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,k,D={}){y_.verbose("Authentication will resume through the broker");let N=await s(D),L=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?L.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):y_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((L.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),k?(L.prompt="none",y_.verbose("Attempting broker authentication using the default broker account")):y_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(L.shrNonce=D.proofOfPossessionOptions.nonce,L.authenticationScheme="pop",L.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,L.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(L)}catch(B){if(y_.verbose(`Failed to authenticate through the broker: ${B.message}`),D.disableAutomaticAuthentication)throw new nx({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(k)return T(x,!1,D);throw B}}a(T,"getBrokeredTokenInternal");async function w(x,k,D={}){y_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${k}`);let N=await T(x,k,D);return Hz(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(q0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,k={}){y_.getToken.info("Attempting to acquire token interactively");let D=await s(k);return f(D,x,k,async()=>{let N=b(x,k);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,k):(k.proofOfPossessionOptions&&(N.shrNonce=k.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=k.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=k.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(My,"createMsalClient");var uSe=require("node:crypto");var Vsn=require("node:fs/promises");var lSe="ClientCertificateCredential",$sn=lo(lSe),dSe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${lSe}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=jf(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${lSe}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${lSe}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=My(r,e,{...o,logger:$sn,tokenCredentialOptions:o})}async getToken(e,r={}){return Nc.withSpan(`${lSe}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,$sn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await RRo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,uSe.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function RRo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,Vsn.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,uSe.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,uSe.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(RRo,"parseCertificate");p();p();function hx(t){return Array.isArray(t)?t:[t]}a(hx,"ensureScopes");function Kae(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info(Os(t,r)),r}}a(Kae,"ensureValidScopeForDevTimeCreds");function FHe(t){return t.replace(/\/.default$/,"")}a(FHe,"getScopeResource");var Wsn=lo("ClientSecretCredential"),fSe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Dn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Dn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=jf(o?.additionallyAllowedTenants),this.msalClient=My(r,e,{...o,logger:Wsn,tokenCredentialOptions:o})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,Wsn);let o=hx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var kRo=lo("UsernamePasswordCredential"),pSe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Dn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Dn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Dn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Dn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=jf(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=My(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,kRo);let o=hx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var PRo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function DRo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(DRo,"getAdditionallyAllowedTenants");var UHe="EnvironmentCredential",LL=lo(UHe);function NRo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return LL.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(NRo,"getSendCertificateChain");var hSe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=XQe(PRo).assigned.join(", ");LL.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=DRo(),l=NRo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&Hm(LL,n),n&&o&&s){LL.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new fSe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){LL.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new dSe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(LL.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),LL.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new pSe(n,o,h,m,u))}async getToken(e,r={}){return Nc.withSpan(`${UHe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return LL.getToken.info(q0(e)),o}catch(o){let s=new e7(400,{error:`${UHe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw LL.getToken.info(Os(e,s)),s}throw new Dn(`${UHe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var MRo=1e3*64,ORo=3e3;function zsn(t){return VBt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(ORo,t.startDelayInMs):t.startDelayInMs;return cin(e,{retryDelayInMs:n,maxRetryDelayInMs:MRo})},"retry")}],{maxRetries:t.maxRetries})}a(zsn,"imdsRetryPolicy");p();var FL="ManagedIdentityCredential - IMDS",Vz=lo(FL),BRo="http://169.254.169.254",LRo="/metadata/identity/oauth2/token";function FRo(t){if(!iSe(t))throw new Error(`${FL}: Multiple scopes are not supported.`);let r=new URL(LRo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??BRo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:_7(n)}}a(FRo,"prepareInvalidRequestOptions");var Ysn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=iSe(e);if(!o)return Vz.info(`${FL}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=FRo(o);return Nc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=zk(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{Vz.info(`${FL}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return Qje(d)&&Vz.verbose(`${FL}: Caught error ${d.name}: ${d.message}`),Vz.info(`${FL}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(Vz.info(`${FL}: The Azure IMDS endpoint is unavailable`),Vz.info(`${FL}: ${u.bodyAsText}`),!1):(Vz.info(`${FL}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var Ksn=lo("ClientAssertionCredential"),Jae=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Dn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Dn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Dn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=jf(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=My(r,e,{...o,logger:Ksn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.tenantId,n,this.additionallyAllowedTenantIds,Ksn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var Jsn=require("node:fs/promises");var Wz="WorkloadIdentityCredential",URo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],mSe=lo(Wz),UL=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=XQe(URo).assigned.join(", ");mSe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&Hm(mSe,o),!s)throw new Dn(`${Wz}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Dn(`${Wz}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Dn(`${Wz}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". - See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);mSe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new Jae(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${Wz}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. +`,"utf-8")],o=dwo(n);o&&t.headers.set("Content-Length",o),t.body=await yon(n)}a(fwo,"buildRequestBody");var G1e="multipartPolicy",pwo=70,hwo=new Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'()+,-./:=?");function mwo(t){if(t.length>pwo)throw new Error(`Multipart boundary "${t}" exceeds maximum length of 70 characters`);if(Array.from(t).some(e=>!hwo.has(e)))throw new Error(`Multipart boundary "${t}" contains invalid characters`)}a(mwo,"assertValidBoundary");function cHe(){return{name:G1e,async sendRequest(t,e){var r;if(!t.multipartBody)return e(t);if(t.body)throw new Error("multipartBody and regular body cannot be set at the same time");let n=t.multipartBody.boundary,o=(r=t.headers.get("Content-Type"))!==null&&r!==void 0?r:"multipart/mixed",s=o.match(/^(multipart\/[^ ;]+)(?:; *boundary=(.+))?$/);if(!s)throw new Error(`Got multipart request body, but content-type header was not multipart: ${o}`);let[,c,l]=s;if(l&&n&&l!==n)throw new Error(`Multipart boundary was specified as ${l} in the header, but got ${n} in the request body`);return n??(n=l),n?mwo(n):n=cwo(),t.headers.set("Content-Type",`${c}; boundary=${n}`),await fwo(t,t.multipartBody.parts,n),t.multipartBody=void 0,e(t)}}}a(cHe,"multipartPolicy");p();p();p();p();p();p();p();p();p();p();p();p();function lHe(){return Mje()}a(lHe,"createEmptyPipeline");p();p();p();var AM=KU("core-rest-pipeline");p();p();p();p();function EBt(t={}){return Uje(Object.assign({logger:AM.info},t))}a(EBt,"logPolicy");p();function _Bt(t={}){return Qje(t)}a(_Bt,"redirectPolicy");p();p();p();var Bae=fe(require("node:os"),1),uHe=fe(require("node:process"),1);function Eon(){return"User-Agent"}a(Eon,"getHeaderName");async function _on(t){if(uHe&&uHe.versions){let e=uHe.versions;e.bun?t.set("Bun",e.bun):e.deno?t.set("Deno",e.deno):e.node&&t.set("Node",e.node)}t.set("OS",`(${Bae.arch()}-${Bae.type()}-${Bae.release()})`)}a(_on,"setPlatformSpecificData");p();var dHe="1.22.0";function Swo(t){let e=[];for(let[r,n]of t){let o=n?`${r}/${n}`:r;e.push(o)}return e.join(" ")}a(Swo,"getUserAgentString");function von(){return Eon()}a(von,"getUserAgentHeaderName");async function fHe(t){let e=new Map;e.set("core-rest-pipeline",dHe),await _on(e);let r=Swo(e);return t?`${t} ${r}`:r}a(fHe,"getUserAgentValue");var Con=von(),bon="userAgentPolicy";function vBt(t={}){let e=fHe(t.userAgentPrefix);return{name:bon,async sendRequest(r,n){return r.headers.has(Con)||r.headers.set(Con,await e),n(r)}}}a(vBt,"userAgentPolicy");p();p();var Son=Symbol("rawContent");function CBt(t){return typeof t[Son]=="function"}a(CBt,"hasRawContent");function Ton(t){return CBt(t)?t[Son]():t}a(Ton,"getRawContent");var pHe=G1e;function bBt(){let t=cHe();return{name:pHe,sendRequest:a(async(e,r)=>{if(e.multipartBody)for(let n of e.multipartBody.parts)CBt(n.body)&&(n.body=Ton(n.body));return t.sendRequest(e,r)},"sendRequest")}}a(bBt,"multipartPolicy");p();function SBt(){return qje()}a(SBt,"decompressResponsePolicy");p();function TBt(t={}){return Hje(t)}a(TBt,"defaultRetryPolicy");p();function IBt(){return Gje()}a(IBt,"formDataPolicy");p();function xBt(t,e){return Xje(t,e)}a(xBt,"proxyPolicy");p();var Ion="setClientRequestIdPolicy";function wBt(t="x-ms-client-request-id"){return{name:Ion,async sendRequest(e,r){return e.headers.has(t)||e.headers.set(t,e.requestId),r(e)}}}a(wBt,"setClientRequestIdPolicy");p();function RBt(t){return eHe(t)}a(RBt,"agentPolicy");p();function PBt(t){return tHe(t)}a(PBt,"tlsPolicy");p();p();var Lae=aA;function $1e(t){return Oje(t)}a($1e,"isRestError");var xon="tracingPolicy";function kBt(t={}){let e=fHe(t.userAgentPrefix),r=new HP({additionalAllowedQueryParameters:t.additionalAllowedQueryParameters}),n=Two();return{name:xon,async sendRequest(o,s){var c;if(!n)return s(o);let l=await e,u={"http.url":r.sanitizeUrl(o.url),"http.method":o.method,"http.user_agent":l,requestId:o.requestId};l&&(u["http.user_agent"]=l);let{span:d,tracingContext:f}=(c=Iwo(n,o,u))!==null&&c!==void 0?c:{};if(!d||!f)return s(o);try{let h=await n.withContext(f,s,o);return wwo(d,h),h}catch(h){throw xwo(d,h),h}}}}a(kBt,"tracingPolicy");function Two(){try{return kbe({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:dHe})}catch(t){AM.warning(`Error when creating the TracingClient: ${Rae(t)}`);return}}a(Two,"tryCreateTracingClient");function Iwo(t,e,r){try{let{span:n,updatedOptions:o}=t.startSpan(`HTTP ${e.method}`,{tracingOptions:e.tracingOptions},{spanKind:"client",spanAttributes:r});if(!n.isRecording()){n.end();return}let s=t.createRequestHeaders(o.tracingOptions.tracingContext);for(let[c,l]of Object.entries(s))e.headers.set(c,l);return{span:n,tracingContext:o.tracingOptions.tracingContext}}catch(n){AM.warning(`Skipping creating a tracing span due to an error: ${Rae(n)}`);return}}a(Iwo,"tryCreateSpan");function xwo(t,e){try{t.setStatus({status:"error",error:Ije(e)?e:void 0}),$1e(e)&&e.statusCode&&t.setAttribute("http.status_code",e.statusCode),t.end()}catch(r){AM.warning(`Skipping tracing span processing due to an error: ${Rae(r)}`)}}a(xwo,"tryProcessError");function wwo(t,e){try{t.setAttribute("http.status_code",e.status);let r=e.headers.get("x-ms-request-id");r&&t.setAttribute("serviceRequestId",r),e.status>=400&&t.setStatus({status:"error"}),t.end()}catch(r){AM.warning(`Skipping tracing span processing due to an error: ${Rae(r)}`)}}a(wwo,"tryProcessResponse");p();p();function hHe(t){if(t instanceof AbortSignal)return{abortSignal:t};if(t.aborted)return{abortSignal:AbortSignal.abort(t.reason)};let e=new AbortController,r=!0;function n(){r&&(t.removeEventListener("abort",o),r=!1)}a(n,"cleanup");function o(){e.abort(t.reason),n()}return a(o,"listener"),t.addEventListener("abort",o),{abortSignal:e.signal,cleanup:n}}a(hHe,"wrapAbortSignalLike");var Rwo="wrapAbortSignalLikePolicy";function won(){return{name:Rwo,sendRequest:a(async(t,e)=>{if(!t.abortSignal)return e(t);let{abortSignal:r,cleanup:n}=hHe(t.abortSignal);t.abortSignal=r;try{return await e(t)}finally{n?.()}},"sendRequest")}}a(won,"wrapAbortSignalLikePolicy");function DBt(t){var e;let r=lHe();return Pae&&(t.agent&&r.addPolicy(RBt(t.agent)),t.tlsOptions&&r.addPolicy(PBt(t.tlsOptions)),r.addPolicy(xBt(t.proxyOptions)),r.addPolicy(SBt())),r.addPolicy(won()),r.addPolicy(IBt(),{beforePolicies:[pHe]}),r.addPolicy(vBt(t.userAgentOptions)),r.addPolicy(wBt((e=t.telemetryOptions)===null||e===void 0?void 0:e.clientRequestIdHeaderName)),r.addPolicy(bBt(),{afterPhase:"Deserialize"}),r.addPolicy(TBt(t.retryOptions),{phase:"Retry"}),r.addPolicy(kBt(Object.assign(Object.assign({},t.userAgentOptions),t.loggingOptions)),{afterPhase:"Retry"}),Pae&&r.addPolicy(_Bt(t.redirectOptions),{afterPhase:"Retry"}),r.addPolicy(EBt(t.loggingOptions),{afterPhase:"Sign"}),r}a(DBt,"createPipelineFromOptions");p();function NBt(){let t=Fje();return{async sendRequest(e){let{abortSignal:r,cleanup:n}=e.abortSignal?hHe(e.abortSignal):{};try{return e.abortSignal=r,await t.sendRequest(e)}finally{n?.()}}}}a(NBt,"createDefaultHttpClient");p();function m7(t){return tS(t)}a(m7,"createHttpHeaders");p();function $P(t){return Nje(t)}a($P,"createPipelineRequest");p();p();p();p();var kwo=KU("core-rest-pipeline retryPolicy");function MBt(t,e={maxRetries:3}){return f7(t,Object.assign({logger:kwo},e))}a(MBt,"retryPolicy");p();p();var Dwo={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:1e3*60*2};async function Nwo(t,e,r){async function n(){if(Date.now()t.getToken(u,d),"tryGetAccessToken"),s.retryIntervalInMs,(f=n?.expiresOnTimestamp)!==null&&f!==void 0?f:Date.now()).then(m=>(r=null,n=m,o=d.tenantId,n)).catch(m=>{throw r=null,n=null,o=void 0,m})),r}return a(l,"refresh"),async(u,d)=>{let f=!!d.claims,h=o!==d.tenantId;return f&&(n=null),h||f||c.mustRefresh?l(u,d):(c.shouldRefresh&&l(u,d),n)}}a(OBt,"createTokenCycler");var Don="bearerTokenAuthenticationPolicy";async function mHe(t,e){try{return[await e(t),void 0]}catch(r){if($1e(r)&&r.response)return[r.response,r];throw r}}a(mHe,"trySendRequest");async function Mwo(t){let{scopes:e,getAccessToken:r,request:n}=t,o={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions,enableCae:!0},s=await r(e,o);s&&t.request.headers.set("Authorization",`Bearer ${s.token}`)}a(Mwo,"defaultAuthorizeRequest");function Ron(t){return t.status===401&&t.headers.has("WWW-Authenticate")}a(Ron,"isChallengeResponse");async function Pon(t,e){var r;let{scopes:n}=t,o=await t.getAccessToken(n,{enableCae:!0,claims:e});return o?(t.request.headers.set("Authorization",`${(r=o.tokenType)!==null&&r!==void 0?r:"Bearer"} ${o.token}`),!0):!1}a(Pon,"authorizeRequestOnCaeChallenge");function gHe(t){var e,r,n;let{credential:o,scopes:s,challengeCallbacks:c}=t,l=t.logger||AM,u={authorizeRequest:(r=(e=c?.authorizeRequest)===null||e===void 0?void 0:e.bind(c))!==null&&r!==void 0?r:Mwo,authorizeRequestOnChallenge:(n=c?.authorizeRequestOnChallenge)===null||n===void 0?void 0:n.bind(c)},d=o?OBt(o):()=>Promise.resolve(null);return{name:Don,async sendRequest(f,h){if(!f.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");await u.authorizeRequest({scopes:Array.isArray(s)?s:[s],request:f,getAccessToken:d,logger:l});let m,g,A;if([m,g]=await mHe(f,h),Ron(m)){let y=kon(m.headers.get("WWW-Authenticate"));if(y){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await Pon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await mHe(f,h))}else if(u.authorizeRequestOnChallenge&&(A=await u.authorizeRequestOnChallenge({scopes:Array.isArray(s)?s:[s],request:f,response:m,getAccessToken:d,logger:l}),A&&([m,g]=await mHe(f,h)),Ron(m)&&(y=kon(m.headers.get("WWW-Authenticate")),y))){let E;try{E=atob(y)}catch{return l.warning(`The WWW-Authenticate header contains "claims" that cannot be parsed. Unable to perform the Continuous Access Evaluation authentication flow. Unparsable claims: ${y}`),m}A=await Pon({scopes:Array.isArray(s)?s:[s],response:m,request:f,getAccessToken:d,logger:l},E),A&&([m,g]=await mHe(f,h))}}if(g)throw g;return m}}}a(gHe,"bearerTokenAuthenticationPolicy");function Owo(t){let e=/(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g,r=/(\w+)="([^"]*)"/g,n=[],o;for(;(o=e.exec(t))!==null;){let s=o[1],c=o[2],l={},u;for(;(u=r.exec(c))!==null;)l[u[1]]=u[2];n.push({scheme:s,params:l})}return n}a(Owo,"parseChallenges");function kon(t){var e;return t?(e=Owo(t).find(n=>n.scheme==="Bearer"&&n.params.claims&&n.params.error==="insufficient_claims"))===null||e===void 0?void 0:e.params.claims:void 0}a(kon,"getCaeChallengeClaims");p();p();p();p();p();p();var Mon=fe(Non(),1),BBt=Mon.state;function g7(t,e,r){let n=e.parameterPath,o=e.mapper,s;if(typeof n=="string"&&(n=[n]),Array.isArray(n)){if(n.length>0)if(o.isConstant)s=o.defaultValue;else{let c=Oon(t,n);!c.propertyFound&&r&&(c=Oon(r,n));let l=!1;c.propertyFound||(l=o.required||n[0]==="options"&&n.length===2),s=l?o.defaultValue:c.propertyValue}}else{o.required&&(s={});for(let c in n){let l=o.type.modelProperties[c],u=n[c],d=g7(t,{parameterPath:u,mapper:l},r);d!==void 0&&(s||(s={}),s[c]=d)}}return s}a(g7,"getOperationArgumentValueFromParameter");function Oon(t,e){let r={propertyFound:!1},n=0;for(;n=200&&r.status<300);u.headersMapper&&(s.parsedHeaders=l.serializer.deserialize(u.headersMapper,s.headers.toJSON(),"operationRes.parsedHeaders",{xml:{},ignoreUnknownProperties:!0}))}return s}a(qwo,"deserializeResponseBody");function jwo(t){let e=Object.keys(t.responses);return e.length===0||e.length===1&&e[0]==="default"}a(jwo,"isOperationSpecEmpty");function Hwo(t,e,r,n){var o;let s=200<=t.status&&t.status<300;if(jwo(e)?s:!!r)if(r){if(!r.isError)return{error:null,shouldReturnResponse:!1}}else return{error:null,shouldReturnResponse:!1};let l=r??e.responses.default,u=!((o=t.request.streamResponseStatusCodes)===null||o===void 0)&&o.has(t.status)?`Unexpected status code: ${t.status}`:t.bodyAsText,d=new Lae(u,{statusCode:t.status,request:t.request,response:t});if(!l)throw d;let f=l.bodyMapper,h=l.headersMapper;try{if(t.parsedBody){let m=t.parsedBody,g;if(f){let y=m;if(e.isXML&&f.type.name===hM.Sequence){y=[];let E=f.xmlElementName;typeof m=="object"&&E&&(y=m[E])}g=e.serializer.deserialize(f,y,"error.response.parsedBody",n)}let A=m.error||g||m;d.code=A.code,A.message&&(d.message=A.message),f&&(d.response.parsedBody=g)}t.headers&&h&&(d.response.parsedHeaders=e.serializer.deserialize(h,t.headers.toJSON(),"operationRes.parsedHeaders"))}catch(m){d.message=`Error "${m.message}" occurred in deserializing the responseBody - "${t.bodyAsText}" for the default response.`}return{error:d,shouldReturnResponse:!1}}a(Hwo,"handleErrorResponse");async function Gwo(t,e,r,n,o){var s;if(!(!((s=r.request.streamResponseStatusCodes)===null||s===void 0)&&s.has(r.status))&&r.bodyAsText){let c=r.bodyAsText,l=r.headers.get("Content-Type")||"",u=l?l.split(";").map(d=>d.toLowerCase()):[];try{if(u.length===0||u.some(d=>t.indexOf(d)!==-1))return r.parsedBody=JSON.parse(c),r;if(u.some(d=>e.indexOf(d)!==-1)){if(!o)throw new Error("Parsing XML not supported.");let d=await o(c,n.xml);return r.parsedBody=d,r}}catch(d){let f=`Error "${d}" occurred while parsing the response body - ${r.bodyAsText}.`,h=d.code||Lae.PARSE_ERROR;throw new Lae(f,{code:h,statusCode:r.status,request:r.request,response:r})}}return r}a(Gwo,"parse");p();p();function Fon(t){let e=new Set;for(let r in t.responses){let n=t.responses[r];n.bodyMapper&&n.bodyMapper.type.name===hM.Stream&&e.add(Number(r))}return e}a(Fon,"getStreamingResponseStatusCodes");function yM(t){let{parameterPath:e,mapper:r}=t,n;return typeof e=="string"?n=e:Array.isArray(e)?n=e.join("."):n=r.serializedName,n}a(yM,"getPathStringFromParameter");var Uon="serializationPolicy";function FBt(t={}){let e=t.stringifyXML;return{name:Uon,async sendRequest(r,n){let o=RL(r),s=o?.operationSpec,c=o?.operationArguments;return s&&c&&($wo(r,c,s),Vwo(r,c,s,e)),n(r)}}}a(FBt,"serializationPolicy");function $wo(t,e,r){var n,o;if(r.headerParameters)for(let c of r.headerParameters){let l=g7(e,c);if(l!=null||c.mapper.required){l=r.serializer.serialize(c.mapper,l,yM(c));let u=c.mapper.headerCollectionPrefix;if(u)for(let d of Object.keys(l))t.headers.set(u+d,l[d]);else t.headers.set(c.mapper.serializedName||yM(c),l)}}let s=(o=(n=e.options)===null||n===void 0?void 0:n.requestOptions)===null||o===void 0?void 0:o.customHeaders;if(s)for(let c of Object.keys(s))t.headers.set(c,s[c])}a($wo,"serializeHeaders");function Vwo(t,e,r,n=function(){throw new Error("XML serialization unsupported!")}){var o,s,c,l,u;let d=(o=e.options)===null||o===void 0?void 0:o.serializerOptions,f={xml:{rootName:(s=d?.xml.rootName)!==null&&s!==void 0?s:"",includeRoot:(c=d?.xml.includeRoot)!==null&&c!==void 0?c:!1,xmlCharKey:(l=d?.xml.xmlCharKey)!==null&&l!==void 0?l:"_"}},h=f.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){t.body=g7(e,r.requestBody);let m=r.requestBody.mapper,{required:g,serializedName:A,xmlName:y,xmlElementName:E,xmlNamespace:_,xmlNamespacePrefix:v,nullable:b}=m,T=m.type.name;try{if(t.body!==void 0&&t.body!==null||b&&t.body===null||g){let w=yM(r.requestBody);t.body=r.serializer.serialize(m,t.body,w,f);let R=T===hM.Stream;if(r.isXML){let x=v?`xmlns:${v}`:"xmlns",P=Wwo(_,x,T,t.body,f);T===hM.Sequence?t.body=n(zwo(P,E||y||A,x,_),{rootName:y||A,xmlCharKey:h}):R||(t.body=n(P,{rootName:y||A,xmlCharKey:h}))}else{if(T===hM.String&&(!((u=r.contentType)===null||u===void 0)&&u.match("text/plain")||r.mediaType==="text"))return;R||(t.body=JSON.stringify(t.body))}}}catch(w){throw new Error(`Error "${w.message}" occurred in serializing the payload - ${JSON.stringify(A,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){t.formData={};for(let m of r.formDataParameters){let g=g7(e,m);if(g!=null){let A=m.mapper.serializedName||yM(m);t.formData[A]=r.serializer.serialize(m.mapper,g,yM(m),f)}}}}a(Vwo,"serializeRequestBody");function Wwo(t,e,r,n,o){if(t&&!["Composite","Sequence","Dictionary"].includes(r)){let s={};return s[o.xml.xmlCharKey]=n,s["$"]={[e]:t},s}return n}a(Wwo,"getXmlValueWithNamespace");function zwo(t,e,r,n){if(Array.isArray(t)||(t=[t]),!r||!n)return{[e]:t};let o={[e]:t};return o["$"]={[r]:n},o}a(zwo,"prepareXMLRootList");function UBt(t={}){let e=DBt(t??{});return t.credentialOptions&&e.addPolicy(gHe({credential:t.credentialOptions.credential,scopes:t.credentialOptions.credentialScopes})),e.addPolicy(FBt(t.serializationOptions),{phase:"Serialize"}),e.addPolicy(LBt(t.deserializationOptions),{phase:"Deserialize"}),e}a(UBt,"createClientPipeline");p();var QBt;function Qon(){return QBt||(QBt=NBt()),QBt}a(Qon,"getCachedDefaultHttpClient");p();var Ywo={CSV:",",SSV:" ",Multi:"Multi",TSV:" ",Pipes:"|"};function jon(t,e,r,n){let o=Kwo(e,r,n),s=!1,c=qon(t,o);if(e.path){let d=qon(e.path,o);e.path==="/{nextLink}"&&d.startsWith("/")&&(d=d.substring(1)),Jwo(d)?(c=d,s=!0):c=Zwo(c,d)}let{queryParams:l,sequenceParams:u}=Xwo(e,r,n);return c=tRo(c,l,u,s),c}a(jon,"getRequestUrl");function qon(t,e){let r=t;for(let[n,o]of e)r=r.split(n).join(o);return r}a(qon,"replaceAll");function Kwo(t,e,r){var n;let o=new Map;if(!((n=t.urlParameters)===null||n===void 0)&&n.length)for(let s of t.urlParameters){let c=g7(e,s,r),l=yM(s);c=t.serializer.serialize(s.mapper,c,l),s.skipEncoding||(c=encodeURIComponent(c)),o.set(`{${s.mapper.serializedName||l}}`,c)}return o}a(Kwo,"calculateUrlReplacements");function Jwo(t){return t.includes("://")}a(Jwo,"isAbsoluteUrl");function Zwo(t,e){if(!e)return t;let r=new URL(t),n=r.pathname;n.endsWith("/")||(n=`${n}/`),e.startsWith("/")&&(e=e.substring(1));let o=e.indexOf("?");if(o!==-1){let s=e.substring(0,o),c=e.substring(o+1);n=n+s,c&&(r.search=r.search?`${r.search}&${c}`:c)}else n=n+e;return r.pathname=n,r.toString()}a(Zwo,"appendPath");function Xwo(t,e,r){var n;let o=new Map,s=new Set;if(!((n=t.queryParameters)===null||n===void 0)&&n.length)for(let c of t.queryParameters){c.mapper.type.name==="Sequence"&&c.mapper.serializedName&&s.add(c.mapper.serializedName);let l=g7(e,c,r);if(l!=null||c.mapper.required){l=t.serializer.serialize(c.mapper,l,yM(c));let u=c.collectionFormat?Ywo[c.collectionFormat]:"";if(Array.isArray(l)&&(l=l.map(d=>d??"")),c.collectionFormat==="Multi"&&l.length===0)continue;Array.isArray(l)&&(c.collectionFormat==="SSV"||c.collectionFormat==="TSV")&&(l=l.join(u)),c.skipEncoding||(Array.isArray(l)?l=l.map(d=>encodeURIComponent(d)):l=encodeURIComponent(l)),Array.isArray(l)&&(c.collectionFormat==="CSV"||c.collectionFormat==="Pipes")&&(l=l.join(u)),o.set(c.mapper.serializedName||yM(c),l)}}return{queryParams:o,sequenceParams:s}}a(Xwo,"calculateQueryParameters");function eRo(t){let e=new Map;if(!t||t[0]!=="?")return e;t=t.slice(1);let r=t.split("&");for(let n of r){let[o,s]=n.split("=",2),c=e.get(o);c?Array.isArray(c)?c.push(s):e.set(o,[c,s]):e.set(o,s)}return e}a(eRo,"simpleParseQueryParams");function tRo(t,e,r,n=!1){if(e.size===0)return t;let o=new URL(t),s=eRo(o.search);for(let[l,u]of e){let d=s.get(l);if(Array.isArray(d))if(Array.isArray(u)){d.push(...u);let f=new Set(d);s.set(l,Array.from(f))}else d.push(u);else d?(Array.isArray(u)?u.unshift(d):r.has(l)&&s.set(l,[d,u]),n||s.set(l,u)):s.set(l,u)}let c=[];for(let[l,u]of s)if(typeof u=="string")c.push(`${l}=${u}`);else if(Array.isArray(u))for(let d of u)c.push(`${l}=${d}`);else c.push(`${l}=${u}`);return o.search=c.length?`?${c.join("&")}`:"",o.toString()}a(tRo,"appendQueryParams");p();var qBt=KU("core-client");var V1e=class{static{a(this,"ServiceClient")}constructor(e={}){var r,n;if(this._requestContentType=e.requestContentType,this._endpoint=(r=e.endpoint)!==null&&r!==void 0?r:e.baseUri,e.baseUri&&qBt.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||Qon(),this.pipeline=e.pipeline||rRo(e),!((n=e.additionalPolicies)===null||n===void 0)&&n.length)for(let{policy:o,position:s}of e.additionalPolicies){let c=s==="perRetry"?"Sign":void 0;this.pipeline.addPolicy(o,{afterPhase:c})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,r){let n=r.baseUrl||this._endpoint;if(!n)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");let o=jon(n,r,e,this),s=$P({url:o});s.method=r.httpMethod;let c=RL(s);c.operationSpec=r,c.operationArguments=e;let l=r.contentType||this._requestContentType;l&&r.requestBody&&s.headers.set("Content-Type",l);let u=e.options;if(u){let d=u.requestOptions;d&&(d.timeout&&(s.timeout=d.timeout),d.onUploadProgress&&(s.onUploadProgress=d.onUploadProgress),d.onDownloadProgress&&(s.onDownloadProgress=d.onDownloadProgress),d.shouldDeserialize!==void 0&&(c.shouldDeserialize=d.shouldDeserialize),d.allowInsecureConnection&&(s.allowInsecureConnection=!0)),u.abortSignal&&(s.abortSignal=u.abortSignal),u.tracingOptions&&(s.tracingOptions=u.tracingOptions)}this._allowInsecureConnection&&(s.allowInsecureConnection=!0),s.streamResponseStatusCodes===void 0&&(s.streamResponseStatusCodes=Fon(r));try{let d=await this.sendRequest(s),f=Q4t(d,r.responses[d.status]);return u?.onResponse&&u.onResponse(d,f),f}catch(d){if(typeof d=="object"&&d?.response){let f=d.response,h=Q4t(f,r.responses[d.statusCode]||r.responses.default);d.details=h,u?.onResponse&&u.onResponse(f,h,d)}throw d}}};function rRo(t){let e=nRo(t),r=t.credential&&e?{credentialScopes:e,credential:t.credential}:void 0;return UBt(Object.assign(Object.assign({},t),{credentialOptions:r}))}a(rRo,"createDefaultPipeline");function nRo(t){if(t.credentialScopes)return t.credentialScopes;if(t.endpoint)return`${t.endpoint}/.default`;if(t.baseUri)return`${t.baseUri}/.default`;if(t.credential&&!t.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}a(nRo,"getCredentialScopes");p();p();p();function Hon(t){return t==="adfs"?"oauth2/token":"oauth2/v2.0/token"}a(Hon,"getIdentityTokenEndpointSuffix");p();var Gon="/.default",$on="Specifying a `clientId` or `resourceId` is not supported by the Service Fabric managed identity environment. The managed identity configuration is determined by the Service Fabric cluster resource configuration. See https://aka.ms/servicefabricmi for more information";function W1e(t){let e="";if(Array.isArray(t)){if(t.length!==1)return;e=t[0]}else typeof t=="string"&&(e=t);return e.endsWith(Gon)?e.substr(0,e.lastIndexOf(Gon)):e}a(W1e,"mapScopesToResource");function Von(t){if(typeof t.expires_on=="number")return t.expires_on*1e3;if(typeof t.expires_on=="string"){let e=+t.expires_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.expires_on);if(!isNaN(r))return r}if(typeof t.expires_in=="number")return Date.now()+t.expires_in*1e3;throw new Error(`Failed to parse token expiration from body. expires_in="${t.expires_in}", expires_on="${t.expires_on}"`)}a(Von,"parseExpirationTimestamp");function Won(t){if(t.refresh_on){if(typeof t.refresh_on=="number")return t.refresh_on*1e3;if(typeof t.refresh_on=="string"){let e=+t.refresh_on;if(!isNaN(e))return e*1e3;let r=Date.parse(t.refresh_on);if(!isNaN(r))return r}throw new Error(`Failed to parse refresh_on from body. refresh_on="${t.refresh_on}"`)}else return}a(Won,"parseRefreshTimestamp");var z1e="noCorrelationId";function iRo(t){let e=t?.authorityHost;return xje&&(e=e??process.env.AZURE_AUTHORITY_HOST),e??wbe}a(iRo,"getIdentityClientAuthorityHost");var A7=class extends V1e{static{a(this,"IdentityClient")}authorityHost;allowLoggingAccountIdentifiers;abortControllers;allowInsecureConnection=!1;tokenCredentialOptions;constructor(e){let r=`azsdk-js-identity/${kQe}`,n=e?.userAgentOptions?.userAgentPrefix?`${e.userAgentOptions.userAgentPrefix} ${r}`:`${r}`,o=iRo(e);if(!o.startsWith("https:"))throw new Error("The authorityHost address must use the 'https' protocol.");super({requestContentType:"application/json; charset=utf-8",retryOptions:{maxRetries:3},...e,userAgentOptions:{userAgentPrefix:n},baseUri:o}),this.authorityHost=o,this.abortControllers=new Map,this.allowLoggingAccountIdentifiers=e?.loggingOptions?.allowLoggingAccountIdentifiers,this.tokenCredentialOptions={...e},e?.allowInsecureConnection&&(this.allowInsecureConnection=e.allowInsecureConnection)}async sendTokenRequest(e){z1.info(`IdentityClient: sending token request to [${e.url}]`);let r=await this.sendRequest(e);if(r.bodyAsText&&(r.status===200||r.status===201)){let n=JSON.parse(r.bodyAsText);if(!n.access_token)return null;this.logIdentifiers(r);let o={accessToken:{token:n.access_token,expiresOnTimestamp:Von(n),refreshAfterTimestamp:Won(n),tokenType:"Bearer"},refreshToken:n.refresh_token};return z1.info(`IdentityClient: [${e.url}] token acquired, expires on ${o.accessToken.expiresOnTimestamp}`),o}else{let n=new YU(r.status,r.bodyAsText);throw z1.warning(`IdentityClient: authentication error. HTTP status: ${r.status}, ${n.errorResponse.errorDescription}`),n}}async refreshAccessToken(e,r,n,o,s,c={}){if(o===void 0)return null;z1.info(`IdentityClient: refreshing access token with client ID: ${r}, scopes: ${n} started`);let l={grant_type:"refresh_token",client_id:r,refresh_token:o,scope:n};s!==void 0&&(l.client_secret=s);let u=new URLSearchParams(l);return kc.withSpan("IdentityClient.refreshAccessToken",c,async d=>{try{let f=Hon(e),h=$P({url:`${this.authorityHost}/${e}/${f}`,method:"POST",body:u.toString(),abortSignal:c.abortSignal,headers:m7({Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"}),tracingOptions:d.tracingOptions}),m=await this.sendTokenRequest(h);return z1.info(`IdentityClient: refreshed token for client ID: ${r}`),m}catch(f){if(f.name===NQe&&f.errorResponse.error==="interaction_required")return z1.info(`IdentityClient: interaction required for client ID: ${r}`),null;throw z1.warning(`IdentityClient: failed refreshing token for client ID: ${r}: ${f}`),f}})}generateAbortSignal(e){let r=new AbortController,n=this.abortControllers.get(e)||[];n.push(r),this.abortControllers.set(e,n);let o=r.signal.onabort;return r.signal.onabort=(...s)=>{this.abortControllers.set(e,void 0),o&&o.apply(r.signal,s)},r.signal}abortRequests(e){let r=e||z1e,n=[...this.abortControllers.get(r)||[],...this.abortControllers.get(z1e)||[]];if(n.length){for(let o of n)o.abort();this.abortControllers.set(r,void 0)}}getCorrelationId(e){let r=e?.body?.split("&").map(n=>n.split("=")).find(([n])=>n==="client-request-id");return r&&r.length&&r[1]||z1e}async sendGetRequestAsync(e,r){let n=$P({url:e,method:"GET",body:r?.body,allowInsecureConnection:this.allowInsecureConnection,headers:m7(r?.headers),abortSignal:this.generateAbortSignal(z1e)}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}async sendPostRequestAsync(e,r){let n=$P({url:e,method:"POST",body:r?.body,headers:m7(r?.headers),allowInsecureConnection:this.allowInsecureConnection,abortSignal:this.generateAbortSignal(this.getCorrelationId(r))}),o=await this.sendRequest(n);return this.logIdentifiers(o),{body:o.bodyAsText?JSON.parse(o.bodyAsText):void 0,headers:o.headers.toJSON(),status:o.status}}getTokenCredentialOptions(){return this.tokenCredentialOptions}logIdentifiers(e){if(!this.allowLoggingAccountIdentifiers||!e.bodyAsText)return;let r="No User Principal Name available";try{let o=(e.parsedBody||JSON.parse(e.bodyAsText)).access_token;if(!o)return;let s=o.split(".")[1],{appid:c,upn:l,tid:u,oid:d}=JSON.parse(Buffer.from(s,"base64").toString("utf8"));z1.info(`[Authenticated account] Client ID: ${c}. Tenant ID: ${u}. User Principal Name: ${l||r}. Object ID (user): ${d}`)}catch(n){z1.warning("allowLoggingAccountIdentifiers was set, but we couldn't log the account information. Error:",n.message)}}};p();var jBt;(function(t){t.AutoDiscoverRegion="AutoDiscoverRegion",t.USWest="westus",t.USWest2="westus2",t.USCentral="centralus",t.USEast="eastus",t.USEast2="eastus2",t.USNorthCentral="northcentralus",t.USSouthCentral="southcentralus",t.USWestCentral="westcentralus",t.CanadaCentral="canadacentral",t.CanadaEast="canadaeast",t.BrazilSouth="brazilsouth",t.EuropeNorth="northeurope",t.EuropeWest="westeurope",t.UKSouth="uksouth",t.UKWest="ukwest",t.FranceCentral="francecentral",t.FranceSouth="francesouth",t.SwitzerlandNorth="switzerlandnorth",t.SwitzerlandWest="switzerlandwest",t.GermanyNorth="germanynorth",t.GermanyWestCentral="germanywestcentral",t.NorwayWest="norwaywest",t.NorwayEast="norwayeast",t.AsiaEast="eastasia",t.AsiaSouthEast="southeastasia",t.JapanEast="japaneast",t.JapanWest="japanwest",t.AustraliaEast="australiaeast",t.AustraliaSouthEast="australiasoutheast",t.AustraliaCentral="australiacentral",t.AustraliaCentral2="australiacentral2",t.IndiaCentral="centralindia",t.IndiaSouth="southindia",t.IndiaWest="westindia",t.KoreaSouth="koreasouth",t.KoreaCentral="koreacentral",t.UAECentral="uaecentral",t.UAENorth="uaenorth",t.SouthAfricaNorth="southafricanorth",t.SouthAfricaWest="southafricawest",t.ChinaNorth="chinanorth",t.ChinaEast="chinaeast",t.ChinaNorth2="chinanorth2",t.ChinaEast2="chinaeast2",t.GermanyCentral="germanycentral",t.GermanyNorthEast="germanynortheast",t.GovernmentUSVirginia="usgovvirginia",t.GovernmentUSIowa="usgoviowa",t.GovernmentUSArizona="usgovarizona",t.GovernmentUSTexas="usgovtexas",t.GovernmentUSDodEast="usdodeast",t.GovernmentUSDodCentral="usdodcentral"})(jBt||(jBt={}));function yHe(t){let e=t;return e===void 0&&globalThis.process?.env?.AZURE_REGIONAL_AUTHORITY_NAME!==void 0&&(e=process.env.AZURE_REGIONAL_AUTHORITY_NAME),e===jBt.AutoDiscoverRegion?"AUTO_DISCOVER":e}a(yHe,"calculateRegionalAuthority");p();p();function oRo(t){return`The current credential is not configured to acquire tokens for tenant ${t}. To enable acquiring tokens for this tenant add it to the AdditionallyAllowedTenants on the credential options, or add "*" to AdditionallyAllowedTenants to allow acquiring tokens for any tenant.`}a(oRo,"createConfigurationErrorMessage");function af(t,e,r=[],n){let o;if(process.env.AZURE_IDENTITY_DISABLE_MULTITENANTAUTH||t==="adfs"?o=t:o=e?.tenantId??t,t&&o!==t&&!r.includes("*")&&!r.some(s=>s.localeCompare(o)===0)){let s=oRo(o);throw n?.info(s),new Nn(s)}return o}a(af,"processMultiTenantRequest");function $m(t,e){if(!e.match(/^[0-9a-zA-Z-.]+$/)){let r=new Error("Invalid tenant id provided. You can locate your tenant id by following the instructions listed here: https://learn.microsoft.com/partner-center/find-ids-and-domain-names.");throw t.info(Ds("",r)),r}}a($m,"checkTenantId");function Fae(t,e,r){return e?($m(t,e),e):(r||(r=az),r!==az?"common":"organizations")}a(Fae,"resolveTenantId");function $f(t){return!t||t.length===0?[]:t.includes("*")?oZr:t}a($f,"resolveAdditionallyAllowedTenantIds");var m_=lo("MsalClient");function vRo(t,e,r={}){let n=Fae(r.logger??m_,e,t),o=F4t(n,L4t(r)),s=new A7({...r.tokenCredentialOptions,authorityHost:o,loggingOptions:r.loggingOptions});return{auth:{clientId:t,authority:o,knownAuthorities:jnn(n,o,r.disableInstanceDiscovery)},system:{networkClient:s,loggerOptions:{loggerCallback:wje(r.logger??m_),logLevel:Rje(FQe()),piiLoggingEnabled:r.loggingOptions?.enableUnsafeSupportLogging}}}}a(vRo,"generateMsalConfiguration");function Fy(t,e,r={}){let n={msalConfig:vRo(t,e,r),cachedAccount:r.authenticationRecord?Hnn(r.authenticationRecord):null,pluginConfiguration:fZr.generatePluginConfiguration(r),logger:r.logger??m_},o=new Map;async function s(x={}){let P=x.enableCae?"CAE":"default",D=o.get(P);if(D)return n.logger.getToken.info("Existing PublicClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new PublicClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new bae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),o.set(P,D),D}a(s,"getPublicApp");let c=new Map;async function l(x={}){let P=x.enableCae?"CAE":"default",D=c.get(P);if(D)return n.logger.getToken.info("Existing ConfidentialClientApplication found in cache, returning it."),D;n.logger.getToken.info(`Creating new ConfidentialClientApplication with CAE ${x.enableCae?"enabled":"disabled"}.`);let N=x.enableCae?n.pluginConfiguration.cache.cachePluginCae:n.pluginConfiguration.cache.cachePlugin;return n.msalConfig.auth.clientCapabilities=x.enableCae?["cp1"]:void 0,D=new Tae({...n.msalConfig,broker:{nativeBrokerPlugin:n.pluginConfiguration.broker.nativeBrokerPlugin},cache:{cachePlugin:await N}}),c.set(P,D),D}a(l,"getConfidentialApp");async function u(x,P,D={}){if(n.cachedAccount===null)throw n.logger.getToken.info("No cached account found in local state."),new ex({scopes:P});D.claims&&(n.cachedClaims=D.claims);let N={account:n.cachedAccount,scopes:P,claims:n.cachedClaims};n.pluginConfiguration.broker.isEnabled&&(N.extraQueryParameters||={},n.pluginConfiguration.broker.enableMsaPassthrough&&(N.extraQueryParameters.msal_request_type="consumer_passthrough")),D.proofOfPossessionOptions&&(N.shrNonce=D.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl),n.logger.getToken.info("Attempting to acquire token silently");try{return await x.acquireTokenSilent(N)}catch(B){throw Oz(P,B,D)}}a(u,"getTokenSilent");function d(x){return x?.tenantId?F4t(x.tenantId,L4t(r)):n.msalConfig.auth.authority}a(d,"calculateRequestAuthority");async function f(x,P,D,N){let B=null;try{B=await u(x,P,D)}catch(L){if(L.name!=="AuthenticationRequiredError")throw L;if(D.disableAutomaticAuthentication)throw new ex({scopes:P,getTokenOptions:D,message:"Automatic authentication has been disabled. You may call the authentication() method."})}if(B===null)try{B=await N()}catch(L){throw Oz(P,L,D)}return Mz(P,B,D),n.cachedAccount=B?.account??null,n.logger.getToken.info(j0(P)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}a(f,"withSilentAuthentication");async function h(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client secret"),n.msalConfig.auth.clientSecret=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:yHe(),claims:D?.claims});return Mz(x,B,D),n.logger.getToken.info(j0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Oz(x,B,D)}}a(h,"getTokenByClientSecret");async function m(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client assertion"),n.msalConfig.auth.clientAssertion=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:yHe(),claims:D?.claims,clientAssertion:P});return Mz(x,B,D),n.logger.getToken.info(j0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Oz(x,B,D)}}a(m,"getTokenByClientAssertion");async function g(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using client certificate"),n.msalConfig.auth.clientCertificate=P;let N=await l(D);try{let B=await N.acquireTokenByClientCredential({scopes:x,authority:d(D),azureRegion:yHe(),claims:D?.claims});return Mz(x,B,D),n.logger.getToken.info(j0(x)),{token:B.accessToken,expiresOnTimestamp:B.expiresOn.getTime(),refreshAfterTimestamp:B.refreshOn?.getTime(),tokenType:B.tokenType}}catch(B){throw Oz(x,B,D)}}a(g,"getTokenByClientCertificate");async function A(x,P,D={}){n.logger.getToken.info("Attempting to acquire token using device code");let N=await s(D);return f(N,x,D,()=>{let B={scopes:x,cancel:D?.abortSignal?.aborted??!1,deviceCodeCallback:P,authority:d(D),claims:D?.claims},L=N.acquireTokenByDeviceCode(B);return D.abortSignal&&D.abortSignal.addEventListener("abort",()=>{B.cancel=!0}),L})}a(A,"getTokenByDeviceCode");async function y(x,P,D,N={}){n.logger.getToken.info("Attempting to acquire token using username and password");let B=await s(N);return f(B,x,N,()=>{let L={scopes:x,username:P,password:D,authority:d(N),claims:N?.claims};return B.acquireTokenByUsernamePassword(L)})}a(y,"getTokenByUsernamePassword");function E(){if(n.cachedAccount)return Gnn(t,n.cachedAccount)}a(E,"getActiveAccount");async function _(x,P,D,N,B={}){n.logger.getToken.info("Attempting to acquire token using authorization code");let L;return N?(n.msalConfig.auth.clientSecret=N,L=await l(B)):L=await s(B),f(L,x,B,()=>L.acquireTokenByCode({scopes:x,redirectUri:P,code:D,authority:d(B),claims:B?.claims}))}a(_,"getTokenByAuthorizationCode");async function v(x,P,D,N={}){m_.getToken.info("Attempting to acquire token on behalf of another user"),typeof D=="string"?(m_.getToken.info("Using client secret for on behalf of flow"),n.msalConfig.auth.clientSecret=D):typeof D=="function"?(m_.getToken.info("Using client assertion callback for on behalf of flow"),n.msalConfig.auth.clientAssertion=D):(m_.getToken.info("Using client certificate for on behalf of flow"),n.msalConfig.auth.clientCertificate=D);let B=await l(N);try{let L=await B.acquireTokenOnBehalfOf({scopes:x,authority:d(N),claims:N.claims,oboAssertion:P});return Mz(x,L,N),m_.getToken.info(j0(x)),{token:L.accessToken,expiresOnTimestamp:L.expiresOn.getTime(),refreshAfterTimestamp:L.refreshOn?.getTime(),tokenType:L.tokenType}}catch(L){throw Oz(x,L,N)}}a(v,"getTokenOnBehalfOf");function b(x,P){return{openBrowser:a(async D=>{await(await Promise.resolve().then(()=>(bHe(),Csn))).default(D,{newInstance:!0})},"openBrowser"),scopes:x,authority:d(P),claims:P?.claims,loginHint:P?.loginHint,errorTemplate:P?.browserCustomizationOptions?.errorMessage,successTemplate:P?.browserCustomizationOptions?.successMessage,prompt:P?.loginHint?"login":"select_account"}}a(b,"createBaseInteractiveRequest");async function T(x,P,D={}){m_.verbose("Authentication will resume through the broker");let N=await s(D),B=b(x,D);n.pluginConfiguration.broker.parentWindowHandle?B.windowHandle=Buffer.from(n.pluginConfiguration.broker.parentWindowHandle):m_.warning("Parent window handle is not specified for the broker. This may cause unexpected behavior. Please provide the parentWindowHandle."),n.pluginConfiguration.broker.enableMsaPassthrough&&((B.extraQueryParameters??={}).msal_request_type="consumer_passthrough"),P?(B.prompt="none",m_.verbose("Attempting broker authentication using the default broker account")):m_.verbose("Attempting broker authentication without the default broker account"),D.proofOfPossessionOptions&&(B.shrNonce=D.proofOfPossessionOptions.nonce,B.authenticationScheme="pop",B.resourceRequestMethod=D.proofOfPossessionOptions.resourceRequestMethod,B.resourceRequestUri=D.proofOfPossessionOptions.resourceRequestUrl);try{return await N.acquireTokenInteractive(B)}catch(L){if(m_.verbose(`Failed to authenticate through the broker: ${L.message}`),D.disableAutomaticAuthentication)throw new ex({scopes:x,getTokenOptions:D,message:"Cannot silently authenticate with default broker account."});if(P)return T(x,!1,D);throw L}}a(T,"getBrokeredTokenInternal");async function w(x,P,D={}){m_.getToken.info(`Attempting to acquire token using brokered authentication with useDefaultBrokerAccount: ${P}`);let N=await T(x,P,D);return Mz(x,N,D),n.cachedAccount=N?.account??null,n.logger.getToken.info(j0(x)),{token:N.accessToken,expiresOnTimestamp:N.expiresOn.getTime(),refreshAfterTimestamp:N.refreshOn?.getTime(),tokenType:N.tokenType}}a(w,"getBrokeredToken");async function R(x,P={}){m_.getToken.info("Attempting to acquire token interactively");let D=await s(P);return f(D,x,P,async()=>{let N=b(x,P);return n.pluginConfiguration.broker.isEnabled?T(x,n.pluginConfiguration.broker.useDefaultBrokerAccount??!1,P):(P.proofOfPossessionOptions&&(N.shrNonce=P.proofOfPossessionOptions.nonce,N.authenticationScheme="pop",N.resourceRequestMethod=P.proofOfPossessionOptions.resourceRequestMethod,N.resourceRequestUri=P.proofOfPossessionOptions.resourceRequestUrl),D.acquireTokenInteractive(N))})}return a(R,"getTokenByInteractiveRequest"),{getActiveAccount:E,getBrokeredToken:w,getTokenByClientSecret:h,getTokenByClientAssertion:m,getTokenByClientCertificate:g,getTokenByDeviceCode:A,getTokenByUsernamePassword:y,getTokenByAuthorizationCode:_,getTokenOnBehalfOf:v,getTokenByInteractiveRequest:R}}a(Fy,"createMsalClient");var X1e=require("node:crypto");var Ssn=require("node:fs/promises");var Z1e="ClientCertificateCredential",bsn=lo(Z1e),eSe=class{static{a(this,"ClientCertificateCredential")}tenantId;additionallyAllowedTenantIds;certificateConfiguration;sendCertificateChain;msalClient;constructor(e,r,n,o={}){if(!e||!r)throw new Error(`${Z1e}: tenantId and clientId are required parameters.`);this.tenantId=e,this.additionallyAllowedTenantIds=$f(o?.additionallyAllowedTenants),this.sendCertificateChain=o.sendCertificateChain,this.certificateConfiguration={...typeof n=="string"?{certificatePath:n}:n};let s=this.certificateConfiguration.certificate,c=this.certificateConfiguration.certificatePath;if(!this.certificateConfiguration||!(s||c))throw new Error(`${Z1e}: Provide either a PEM certificate in string form, or the path to that certificate in the filesystem. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);if(s&&c)throw new Error(`${Z1e}: To avoid unexpected behaviors, providing both the contents of a PEM certificate and the path to a PEM certificate is forbidden. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.`);this.msalClient=Fy(r,e,{...o,logger:bsn,tokenCredentialOptions:o})}async getToken(e,r={}){return kc.withSpan(`${Z1e}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,bsn);let o=Array.isArray(e)?e:[e],s=await this.buildClientCertificate();return this.msalClient.getTokenByClientCertificate(o,s,n)})}async buildClientCertificate(){let e=await CRo(this.certificateConfiguration,this.sendCertificateChain??!1),r;return this.certificateConfiguration.certificatePassword!==void 0?r=(0,X1e.createPrivateKey)({key:e.certificateContents,passphrase:this.certificateConfiguration.certificatePassword,format:"pem"}).export({format:"pem",type:"pkcs8"}).toString():r=e.certificateContents,{thumbprint:e.thumbprint,thumbprintSha256:e.thumbprintSha256,privateKey:r,x5c:e.x5c}}};async function CRo(t,e){let r=t.certificate,n=t.certificatePath,o=r||await(0,Ssn.readFile)(n,"utf8"),s=e?o:void 0,c=/(-+BEGIN CERTIFICATE-+)(\n\r?|\r\n?)([A-Za-z0-9+/\n\r]+=*)(\n\r?|\r\n?)(-+END CERTIFICATE-+)/g,l=[],u;do u=c.exec(o),u&&l.push(u[3]);while(u);if(l.length===0)throw new Error("The file at the specified path does not contain a PEM-encoded certificate.");let d=(0,X1e.createHash)("sha1").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase(),f=(0,X1e.createHash)("sha256").update(Buffer.from(l[0],"base64")).digest("hex").toUpperCase();return{certificateContents:o,thumbprintSha256:f,thumbprint:d,x5c:s}}a(CRo,"parseCertificate");p();p();function dx(t){return Array.isArray(t)?t:[t]}a(dx,"ensureScopes");function qae(t,e){if(!t.match(/^[0-9a-zA-Z-_.:/]+$/)){let r=new Error("Invalid scope was specified by the user or calling client");throw e.getToken.info(Ds(t,r)),r}}a(qae,"ensureValidScopeForDevTimeCreds");function SHe(t){return t.replace(/\/.default$/,"")}a(SHe,"getScopeResource");var Tsn=lo("ClientSecretCredential"),tSe=class{static{a(this,"ClientSecretCredential")}tenantId;additionallyAllowedTenantIds;msalClient;clientSecret;constructor(e,r,n,o={}){if(!e)throw new Nn("ClientSecretCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!r)throw new Nn("ClientSecretCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");if(!n)throw new Nn("ClientSecretCredential: clientSecret is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/serviceprincipalauthentication/troubleshoot.");this.clientSecret=n,this.tenantId=e,this.additionallyAllowedTenantIds=$f(o?.additionallyAllowedTenants),this.msalClient=Fy(r,e,{...o,logger:Tsn,tokenCredentialOptions:o})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,Tsn);let o=dx(e);return this.msalClient.getTokenByClientSecret(o,this.clientSecret,n)})}};p();var bRo=lo("UsernamePasswordCredential"),rSe=class{static{a(this,"UsernamePasswordCredential")}tenantId;additionallyAllowedTenantIds;msalClient;username;password;constructor(e,r,n,o,s={}){if(!e)throw new Nn("UsernamePasswordCredential: tenantId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!r)throw new Nn("UsernamePasswordCredential: clientId is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!n)throw new Nn("UsernamePasswordCredential: username is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");if(!o)throw new Nn("UsernamePasswordCredential: password is a required parameter. To troubleshoot, visit https://aka.ms/azsdk/js/identity/usernamepasswordcredential/troubleshoot.");this.tenantId=e,this.additionallyAllowedTenantIds=$f(s?.additionallyAllowedTenants),this.username=n,this.password=o,this.msalClient=Fy(r,this.tenantId,{...s,tokenCredentialOptions:s??{}})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,bRo);let o=dx(e);return this.msalClient.getTokenByUsernamePassword(o,this.username,this.password,n)})}};var SRo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_CLIENT_SECRET","AZURE_CLIENT_CERTIFICATE_PATH","AZURE_CLIENT_CERTIFICATE_PASSWORD","AZURE_USERNAME","AZURE_PASSWORD","AZURE_ADDITIONALLY_ALLOWED_TENANTS","AZURE_CLIENT_SEND_CERTIFICATE_CHAIN"];function TRo(){return(process.env.AZURE_ADDITIONALLY_ALLOWED_TENANTS??"").split(";")}a(TRo,"getAdditionallyAllowedTenants");var THe="EnvironmentCredential",PL=lo(THe);function IRo(){let t=(process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN??"").toLowerCase(),e=t==="true"||t==="1";return PL.verbose(`AZURE_CLIENT_SEND_CERTIFICATE_CHAIN: ${process.env.AZURE_CLIENT_SEND_CERTIFICATE_CHAIN}; sendCertificateChain: ${e}`),e}a(IRo,"getSendCertificateChain");var nSe=class{static{a(this,"EnvironmentCredential")}_credential=void 0;constructor(e){let r=UQe(SRo).assigned.join(", ");PL.info(`Found the following environment variables: ${r}`);let n=process.env.AZURE_TENANT_ID,o=process.env.AZURE_CLIENT_ID,s=process.env.AZURE_CLIENT_SECRET,c=TRo(),l=IRo(),u={...e,additionallyAllowedTenantIds:c,sendCertificateChain:l};if(n&&$m(PL,n),n&&o&&s){PL.info(`Invoking ClientSecretCredential with tenant ID: ${n}, clientId: ${o} and clientSecret: [REDACTED]`),this._credential=new tSe(n,o,s,u);return}let d=process.env.AZURE_CLIENT_CERTIFICATE_PATH,f=process.env.AZURE_CLIENT_CERTIFICATE_PASSWORD;if(n&&o&&d){PL.info(`Invoking ClientCertificateCredential with tenant ID: ${n}, clientId: ${o} and certificatePath: ${d}`),this._credential=new eSe(n,o,{certificatePath:d,certificatePassword:f},u);return}let h=process.env.AZURE_USERNAME,m=process.env.AZURE_PASSWORD;n&&o&&h&&m&&(PL.info(`Invoking UsernamePasswordCredential with tenant ID: ${n}, clientId: ${o} and username: ${h}`),PL.warning("Environment is configured to use username and password authentication. This authentication method is deprecated, as it doesn't support multifactor authentication (MFA). Use a more secure credential. For more details, see https://aka.ms/azsdk/identity/mfa."),this._credential=new rSe(n,o,h,m,u))}async getToken(e,r={}){return kc.withSpan(`${THe}.getToken`,r,async n=>{if(this._credential)try{let o=await this._credential.getToken(e,n);return PL.getToken.info(j0(e)),o}catch(o){let s=new YU(400,{error:`${THe} authentication failed. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`,error_description:o.message.toString().split("More details:").join("")});throw PL.getToken.info(Ds(e,s)),s}throw new Nn(`${THe} is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.`)})}};p();p();var xRo=1e3*64,wRo=3e3;function Isn(t){return MBt([{name:"imdsRetryPolicy",retry:a(({retryCount:e,response:r})=>{if(r?.status!==404&&r?.status!==410)return{skipStrategy:!0};let n=r?.status===410?Math.max(wRo,t.startDelayInMs):t.startDelayInMs;return Qnn(e,{retryDelayInMs:n,maxRetryDelayInMs:xRo})},"retry")}],{maxRetries:t.maxRetries})}a(Isn,"imdsRetryPolicy");p();var kL="ManagedIdentityCredential - IMDS",Lz=lo(kL),RRo="http://169.254.169.254",PRo="/metadata/identity/oauth2/token";function kRo(t){if(!W1e(t))throw new Error(`${kL}: Multiple scopes are not supported.`);let r=new URL(PRo,process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST??RRo),n={Accept:"application/json"};return{url:`${r}`,method:"GET",headers:m7(n)}}a(kRo,"prepareInvalidRequestOptions");var xsn={name:"imdsMsi",async isAvailable(t){let{scopes:e,identityClient:r,getTokenOptions:n}=t,o=W1e(e);if(!o)return Lz.info(`${kL}: Unavailable. Multiple scopes are not supported.`),!1;if(process.env.AZURE_POD_IDENTITY_AUTHORITY_HOST)return!0;if(!r)throw new Error("Missing IdentityClient");let s=kRo(o);return kc.withSpan("ManagedIdentityCredential-pingImdsEndpoint",n??{},async c=>{s.tracingOptions=c.tracingOptions;let l=$P(s);l.timeout=c.requestOptions?.timeout||1e3,l.allowInsecureConnection=!0;let u;try{Lz.info(`${kL}: Pinging the Azure IMDS endpoint`),u=await r.sendRequest(l)}catch(d){return Ije(d)&&Lz.verbose(`${kL}: Caught error ${d.name}: ${d.message}`),Lz.info(`${kL}: The Azure IMDS endpoint is unavailable`),!1}return u.status===403&&u.bodyAsText?.includes("unreachable")?(Lz.info(`${kL}: The Azure IMDS endpoint is unavailable`),Lz.info(`${kL}: ${u.bodyAsText}`),!1):(Lz.info(`${kL}: The Azure IMDS endpoint is available`),!0)})}};p();p();p();var wsn=lo("ClientAssertionCredential"),jae=class{static{a(this,"ClientAssertionCredential")}msalClient;tenantId;additionallyAllowedTenantIds;getAssertion;options;constructor(e,r,n,o={}){if(!e)throw new Nn("ClientAssertionCredential: tenantId is a required parameter.");if(!r)throw new Nn("ClientAssertionCredential: clientId is a required parameter.");if(!n)throw new Nn("ClientAssertionCredential: clientAssertion is a required parameter.");this.tenantId=e,this.additionallyAllowedTenantIds=$f(o?.additionallyAllowedTenants),this.options=o,this.getAssertion=n,this.msalClient=Fy(r,e,{...o,logger:wsn,tokenCredentialOptions:this.options})}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.tenantId,n,this.additionallyAllowedTenantIds,wsn);let o=Array.isArray(e)?e:[e];return this.msalClient.getTokenByClientAssertion(o,this.getAssertion,n)})}};var Rsn=require("node:fs/promises");var Fz="WorkloadIdentityCredential",DRo=["AZURE_TENANT_ID","AZURE_CLIENT_ID","AZURE_FEDERATED_TOKEN_FILE"],iSe=lo(Fz),DL=class{static{a(this,"WorkloadIdentityCredential")}client;azureFederatedTokenFileContent=void 0;cacheDate=void 0;federatedTokenFilePath;constructor(e){let r=UQe(DRo).assigned.join(", ");iSe.info(`Found the following environment variables: ${r}`);let n=e??{},o=n.tenantId||process.env.AZURE_TENANT_ID,s=n.clientId||process.env.AZURE_CLIENT_ID;if(this.federatedTokenFilePath=n.tokenFilePath||process.env.AZURE_FEDERATED_TOKEN_FILE,o&&$m(iSe,o),!s)throw new Nn(`${Fz}: is unavailable. clientId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_CLIENT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!o)throw new Nn(`${Fz}: is unavailable. tenantId is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_TENANT_ID". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);if(!this.federatedTokenFilePath)throw new Nn(`${Fz}: is unavailable. federatedTokenFilePath is a required parameter. In DefaultAzureCredential and ManagedIdentityCredential, this can be provided as an environment variable - "AZURE_FEDERATED_TOKEN_FILE". + See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`);iSe.info(`Invoking ClientAssertionCredential with tenant ID: ${o}, clientId: ${n.clientId} and federated token path: [REDACTED]`),this.client=new jae(o,s,this.readFileContents.bind(this),e)}async getToken(e,r){if(!this.client){let n=`${Fz}: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters. In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables - "AZURE_TENANT_ID", "AZURE_CLIENT_ID", - "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw mSe.info(n),new Dn(n)}return mSe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Dn(`${Wz}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,Jsn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Dn(`${Wz}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var Zsn="ManagedIdentityCredential - Token Exchange",QRo=lo(Zsn),_Lt={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||QRo.info(`${Zsn}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new UL({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var fS=lo("ManagedIdentityCredential"),I7=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new v7({...n,additionalPolicies:[{policy:zsn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Oae({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:Hje(ZQe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:jje(fS)}}}),this.isAvailableIdentityClient=new v7({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw fS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw fS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Dn(`ManagedIdentityCredential: ${psn}`);if(fS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];fS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){fS.getToken.info("Using the MSAL provider for Managed Identity.");let n=iSe(e);if(!n)throw new Dn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return Nc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await _Lt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(fS.getToken.info(`MSAL Identity source: ${s}`),o){fS.getToken.info("Using the token exchange managed identity.");let u=await _Lt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Dn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(fS.getToken.info("Using the IMDS endpoint to probe for availability."),!await Ysn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Dn("Attempted to use the IMDS endpoint, but it is not available.");fS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),fS.getToken.info(q0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw fS.getToken.error(Os(e,o)),o.name==="AuthenticationRequiredError"?o:qRo(o)?new Dn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Dn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(fS.getToken.info(s),new nx({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function qRo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(qRo,"isNetworkError");p();var Xsn=ce(require("child_process"),1);var TM=lo("AzureDeveloperCliCredential"),QHe={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},ean={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(TM.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");Xsn.default.exec(d,{cwd:ean.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},gSe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Hm(TM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=lf(this.tenantId,r,this.additionallyAllowedTenantIds);n&&Hm(TM,n);let o;return typeof e=="string"?o=[e]:o=e,TM.getToken.info(`Using the scopes ${e}`),Nc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{Kae(d,TM)});let s=await ean.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Dn(QHe.notInstalled);throw TM.getToken.info(Os(e,d)),d}if(l){let d=new Dn(QHe.login);throw TM.getToken.info(Os(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Dn(`${QHe.claim} ${f}`);throw TM.getToken.info(Os(e,h)),h}try{let d=JSON.parse(s.stdout);return TM.getToken.info(q0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Dn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Dn(s.message||QHe.unknown);throw TM.getToken.info(Os(e,c)),c}})}};p();var tan=ce(require("child_process"),1);p();function CLt(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info(Os("",r)),r}}a(CLt,"checkSubscription");var pS=lo("AzureCliCredential"),ASe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},ran={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(pS.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");tan.default.exec(d,{cwd:ran.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},ySe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&(Hm(pS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(CLt(pS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Dn(`${ASe.claim} ${l}`);throw pS.getToken.info(Os(n,d)),d}let s=lf(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&Hm(pS,s),this.subscription&&CLt(pS,this.subscription),pS.getToken.info(`Using the scope ${n}`),Nc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{Kae(n,pS);let c=FHe(n),l=await ran.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Dn(ASe.notInstalled);throw pS.getToken.info(Os(e,h)),h}if(d){let h=new Dn(ASe.login);throw pS.getToken.info(Os(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return pS.getToken.info(q0(e)),m}catch(h){throw l.stderr?new Dn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Dn(c.message||ASe.unknown);throw pS.getToken.info(Os(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return pS.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Dn(`${ASe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var nan=ce(require("node:child_process"),1),ian={execFile(t,e,r){return new Promise((n,o)=>{nan.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var IM=lo("AzurePowerShellCredential"),san=process.platform==="win32";function aan(t){return san?`${t}.exe`:t}a(aan,"formatCommand");async function oan(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await ian.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(oan,"runCommands");var can={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},qHe={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},jRo=a(t=>t.message.match(`(.*)${can.login}(.*)`),"isLoginError"),HRo=a(t=>t.message.match(can.installed),"isNotInstalledError"),vLt=[aan("pwsh")];san&&vLt.push(aan("powershell"));var ESe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&(Hm(IM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...vLt]){try{await oan([[o,"/?"]],n)}catch{vLt.shift();continue}let c=(await oan([[o,"-NoProfile","-NonInteractive","-Command",` + "AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot`;throw iSe.info(n),new Nn(n)}return iSe.info("Invoking getToken() of Client Assertion Credential"),this.client.getToken(e,r)}async readFileContents(){if(this.cacheDate!==void 0&&Date.now()-this.cacheDate>=1e3*60*5&&(this.azureFederatedTokenFileContent=void 0),!this.federatedTokenFilePath)throw new Nn(`${Fz}: is unavailable. Invalid file path provided ${this.federatedTokenFilePath}.`);if(!this.azureFederatedTokenFileContent){let r=(await(0,Rsn.readFile)(this.federatedTokenFilePath,"utf8")).trim();if(r)this.azureFederatedTokenFileContent=r,this.cacheDate=Date.now();else throw new Nn(`${Fz}: is unavailable. No content on the file ${this.federatedTokenFilePath}.`)}return this.azureFederatedTokenFileContent}};var Psn="ManagedIdentityCredential - Token Exchange",NRo=lo(Psn),cLt={name:"tokenExchangeMsi",async isAvailable(t){let e=process.env,r=!!((t||e.AZURE_CLIENT_ID)&&e.AZURE_TENANT_ID&&process.env.AZURE_FEDERATED_TOKEN_FILE);return r||NRo.info(`${Psn}: Unavailable. The environment variables needed are: AZURE_CLIENT_ID (or the client ID sent through the parameters), AZURE_TENANT_ID and AZURE_FEDERATED_TOKEN_FILE`),r},async getToken(t,e={}){let{scopes:r,clientId:n}=t,o={};return new DL({clientId:n,tenantId:process.env.AZURE_TENANT_ID,tokenFilePath:process.env.AZURE_FEDERATED_TOKEN_FILE,...o,disableInstanceDiscovery:!0}).getToken(r,e)}};var oS=lo("ManagedIdentityCredential"),v7=class{static{a(this,"ManagedIdentityCredential")}managedIdentityApp;identityClient;clientId;resourceId;objectId;msiRetryConfig={maxRetries:5,startDelayInMs:800,intervalIncrement:2};isAvailableIdentityClient;sendProbeRequest;constructor(e,r){let n;typeof e=="string"?(this.clientId=e,n=r??{}):(this.clientId=e?.clientId,n=e??{}),this.resourceId=n?.resourceId,this.objectId=n?.objectId,this.sendProbeRequest=n?.sendProbeRequest??!1;let o=[{key:"clientId",value:this.clientId},{key:"resourceId",value:this.resourceId},{key:"objectId",value:this.objectId}].filter(c=>c.value);if(o.length>1)throw new Error(`ManagedIdentityCredential: only one of 'clientId', 'resourceId', or 'objectId' can be provided. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}`);n.allowInsecureConnection=!0,n.retryOptions?.maxRetries!==void 0&&(this.msiRetryConfig.maxRetries=n.retryOptions.maxRetries),this.identityClient=new A7({...n,additionalPolicies:[{policy:Isn(this.msiRetryConfig),position:"perCall"}]}),this.managedIdentityApp=new Iae({managedIdentityIdParams:{userAssignedClientId:this.clientId,userAssignedResourceId:this.resourceId,userAssignedObjectId:this.objectId},system:{disableInternalRetries:!0,networkClient:this.identityClient,loggerOptions:{logLevel:Rje(FQe()),piiLoggingEnabled:n.loggingOptions?.enableUnsafeSupportLogging,loggerCallback:wje(oS)}}}),this.isAvailableIdentityClient=new A7({...n,retryOptions:{maxRetries:0}});let s=this.managedIdentityApp.getManagedIdentitySource();if(s==="CloudShell"&&(this.clientId||this.resourceId||this.objectId))throw oS.warning(`CloudShell MSI detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Nn("ManagedIdentityCredential: Specifying a user-assigned managed identity is not supported for CloudShell at runtime. When using Managed Identity in CloudShell, omit the clientId, resourceId, and objectId parameters.");if(s==="ServiceFabric"&&(this.clientId||this.resourceId||this.objectId))throw oS.warning(`Service Fabric detected with user-provided IDs - throwing. Received values: ${JSON.stringify({clientId:this.clientId,resourceId:this.resourceId,objectId:this.objectId})}.`),new Nn(`ManagedIdentityCredential: ${$on}`);if(oS.info(`Using ${s} managed identity.`),o.length===1){let{key:c,value:l}=o[0];oS.info(`${s} with ${c}: ${l}`)}}async getToken(e,r={}){oS.getToken.info("Using the MSAL provider for Managed Identity.");let n=W1e(e);if(!n)throw new Nn(`ManagedIdentityCredential: Multiple scopes are not supported. Scopes: ${JSON.stringify(e)}`);return kc.withSpan("ManagedIdentityCredential.getToken",r,async()=>{try{let o=await cLt.isAvailable(this.clientId),s=this.managedIdentityApp.getManagedIdentitySource(),c=s==="DefaultToImds"||s==="Imds";if(oS.getToken.info(`MSAL Identity source: ${s}`),o){oS.getToken.info("Using the token exchange managed identity.");let u=await cLt.getToken({scopes:e,clientId:this.clientId,identityClient:this.identityClient,retryConfig:this.msiRetryConfig,resourceId:this.resourceId});if(u===null)throw new Nn("Attempted to use the token exchange managed identity, but received a null response.");return u}else if(c&&this.sendProbeRequest&&(oS.getToken.info("Using the IMDS endpoint to probe for availability."),!await xsn.isAvailable({scopes:e,clientId:this.clientId,getTokenOptions:r,identityClient:this.isAvailableIdentityClient,resourceId:this.resourceId})))throw new Nn("Attempted to use the IMDS endpoint, but it is not available.");oS.getToken.info("Calling into MSAL for managed identity token.");let l=await this.managedIdentityApp.acquireToken({resource:n});return this.ensureValidMsalToken(e,l,r),oS.getToken.info(j0(e)),{expiresOnTimestamp:l.expiresOn.getTime(),token:l.accessToken,refreshAfterTimestamp:l.refreshOn?.getTime(),tokenType:"Bearer"}}catch(o){throw oS.getToken.error(Ds(e,o)),o.name==="AuthenticationRequiredError"?o:MRo(o)?new Nn(`ManagedIdentityCredential: Network unreachable. Message: ${o.message}`,{cause:o}):new Nn(`ManagedIdentityCredential: Authentication failed. Message ${o.message}`,{cause:o})}})}ensureValidMsalToken(e,r,n){let o=a(s=>(oS.getToken.info(s),new ex({scopes:Array.isArray(e)?e:[e],getTokenOptions:n,message:s})),"createError");if(!r)throw o("No response.");if(!r.expiresOn)throw o('Response had no "expiresOn" property.');if(!r.accessToken)throw o('Response had no "accessToken" property.')}};function MRo(t){return!!(t.errorCode==="network_error"||t.code==="ENETUNREACH"||t.code==="EHOSTUNREACH"||(t.statusCode===403||t.code===403)&&t.message.includes("unreachable"))}a(MRo,"isNetworkError");p();var ksn=fe(require("child_process"),1);var EM=lo("AzureDeveloperCliCredential"),IHe={notInstalled:"Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",login:"Please run 'azd auth login' from a command prompt to authenticate before using this credential. For more information, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.",unknown:"Unknown error while trying to retrieve the access token",claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:"},Dsn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(EM.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure Developer CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzdAccessToken(t,e,r,n){let o=[];e&&(o=["--tenant-id",e]);let s=[];return n&&(s=["--claims",btoa(n)]),new Promise((c,l)=>{try{let d=["azd",...["auth","token","--output","json","--no-prompt",...t.reduce((f,h)=>f.concat("--scope",h),[]),...o,...s]].join(" ");ksn.default.exec(d,{cwd:Dsn.getSafeWorkingDir(),timeout:r},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},oSe=class{static{a(this,"AzureDeveloperCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&($m(EM,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=$f(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=af(this.tenantId,r,this.additionallyAllowedTenantIds);n&&$m(EM,n);let o;return typeof e=="string"?o=[e]:o=e,EM.getToken.info(`Using the scopes ${e}`),kc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{o.forEach(d=>{qae(d,EM)});let s=await Dsn.getAzdAccessToken(o,n,this.timeout,r.claims),c=s.stderr?.match("must use multi-factor authentication")||s.stderr?.match("reauthentication required"),l=s.stderr?.match("not logged in, run `azd login` to login")||s.stderr?.match("not logged in, run `azd auth login` to login");if(s.stderr?.match("azd:(.*)not found")||s.stderr?.startsWith("'azd' is not recognized")||s.error&&s.error.code==="ENOENT"){let d=new Nn(IHe.notInstalled);throw EM.getToken.info(Ds(e,d)),d}if(l){let d=new Nn(IHe.login);throw EM.getToken.info(Ds(e,d)),d}if(c){let f=`azd auth login ${o.reduce((m,g)=>m.concat("--scope",g),[]).join(" ")}`,h=new Nn(`${IHe.claim} ${f}`);throw EM.getToken.info(Ds(e,h)),h}try{let d=JSON.parse(s.stdout);return EM.getToken.info(j0(e)),{token:d.token,expiresOnTimestamp:new Date(d.expiresOn).getTime(),tokenType:"Bearer"}}catch(d){throw s.stderr?new Nn(s.stderr):d}}catch(s){let c=s.name==="CredentialUnavailableError"?s:new Nn(s.message||IHe.unknown);throw EM.getToken.info(Ds(e,c)),c}})}};p();var Nsn=fe(require("child_process"),1);p();function lLt(t,e){if(!e.match(/^[0-9a-zA-Z-._ ]+$/)){let r=new Error(`Subscription '${e}' contains invalid characters. If this is the name of a subscription, use its ID instead. You can locate your subscription by following the instructions listed here: https://learn.microsoft.com/azure/azure-portal/get-subscription-tenant-id`);throw t.info(Ds("",r)),r}}a(lLt,"checkSubscription");var sS=lo("AzureCliCredential"),sSe={claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",notInstalled:"Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.",login:"Please run 'az login' from a command prompt to authenticate before using this credential.",unknown:"Unknown error while trying to retrieve the access token",unexpectedResponse:'Unexpected response from Azure CLI when getting token. Expected "expiresOn" to be a RFC3339 date string. Got:'},Msn={getSafeWorkingDir(){if(process.platform==="win32"){let t=process.env.SystemRoot||process.env.SYSTEMROOT;return t||(sS.getToken.warning("The SystemRoot environment variable is not set. This may cause issues when using the Azure CLI credential."),t="C:\\Windows"),t}else return"/bin"},async getAzureCliAccessToken(t,e,r,n){let o=[],s=[];return e&&(o=["--tenant",e]),r&&(s=["--subscription",`"${r}"`]),new Promise((c,l)=>{try{let d=["az",...["account","get-access-token","--output","json","--resource",t,...o,...s]].join(" ");Nsn.default.exec(d,{cwd:Msn.getSafeWorkingDir(),timeout:n},(f,h,m)=>{c({stdout:h,stderr:m,error:f})})}catch(u){l(u)}})}},aSe=class{static{a(this,"AzureCliCredential")}tenantId;additionallyAllowedTenantIds;timeout;subscription;constructor(e){e?.tenantId&&($m(sS,e?.tenantId),this.tenantId=e?.tenantId),e?.subscription&&(lLt(sS,e?.subscription),this.subscription=e?.subscription),this.additionallyAllowedTenantIds=$f(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getToken(e,r={}){let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`az login --claims-challenge ${btoa(o)} --scope ${n}`,u=r.tenantId;u&&(l+=` --tenant ${u}`);let d=new Nn(`${sSe.claim} ${l}`);throw sS.getToken.info(Ds(n,d)),d}let s=af(this.tenantId,r,this.additionallyAllowedTenantIds);return s&&$m(sS,s),this.subscription&&lLt(sS,this.subscription),sS.getToken.info(`Using the scope ${n}`),kc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{try{qae(n,sS);let c=SHe(n),l=await Msn.getAzureCliAccessToken(c,s,this.subscription,this.timeout),u=l.stderr?.match("(.*)az login --scope(.*)"),d=l.stderr?.match("(.*)az login(.*)")&&!u;if(l.stderr?.match("az:(.*)not found")||l.stderr?.startsWith("'az' is not recognized")){let h=new Nn(sSe.notInstalled);throw sS.getToken.info(Ds(e,h)),h}if(d){let h=new Nn(sSe.login);throw sS.getToken.info(Ds(e,h)),h}try{let h=l.stdout,m=this.parseRawResponse(h);return sS.getToken.info(j0(e)),m}catch(h){throw l.stderr?new Nn(l.stderr):h}}catch(c){let l=c.name==="CredentialUnavailableError"?c:new Nn(c.message||sSe.unknown);throw sS.getToken.info(Ds(e,l)),l}})}parseRawResponse(e){let r=JSON.parse(e),n=r.accessToken,o=Number.parseInt(r.expires_on,10)*1e3;if(!isNaN(o))return sS.getToken.info("expires_on is available and is valid, using it"),{token:n,expiresOnTimestamp:o,tokenType:"Bearer"};if(o=new Date(r.expiresOn).getTime(),isNaN(o))throw new Nn(`${sSe.unexpectedResponse} "${r.expiresOn}"`);return{token:n,expiresOnTimestamp:o,tokenType:"Bearer"}}};p();p();var Osn=fe(require("node:child_process"),1),Bsn={execFile(t,e,r){return new Promise((n,o)=>{Osn.default.execFile(t,e,r,(s,c,l)=>{Buffer.isBuffer(c)&&(c=c.toString("utf8")),Buffer.isBuffer(l)&&(l=l.toString("utf8")),l||s?o(l?new Error(l):s):n(c)})})}};var _M=lo("AzurePowerShellCredential"),Fsn=process.platform==="win32";function Usn(t){return Fsn?`${t}.exe`:t}a(Usn,"formatCommand");async function Lsn(t,e){let r=[];for(let n of t){let[o,...s]=n,c=await Bsn.execFile(o,s,{encoding:"utf8",timeout:e});r.push(c)}return r}a(Lsn,"runCommands");var Qsn={login:"Run Connect-AzAccount to login",installed:"The specified module 'Az.Accounts' with version '2.2.0' was not loaded because no valid module file was found in any module directory"},xHe={login:"Please run 'Connect-AzAccount' from PowerShell to authenticate before using this credential.",installed:`The 'Az.Account' module >= 2.2.0 is not installed. Install the Azure Az PowerShell module with: "Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force".`,claim:"This credential doesn't support claims challenges. To authenticate with the required claims, please run the following command:",troubleshoot:"To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot."},ORo=a(t=>t.message.match(`(.*)${Qsn.login}(.*)`),"isLoginError"),BRo=a(t=>t.message.match(Qsn.installed),"isNotInstalledError"),uLt=[Usn("pwsh")];Fsn&&uLt.push(Usn("powershell"));var cSe=class{static{a(this,"AzurePowerShellCredential")}tenantId;additionallyAllowedTenantIds;timeout;constructor(e){e?.tenantId&&($m(_M,e?.tenantId),this.tenantId=e?.tenantId),this.additionallyAllowedTenantIds=$f(e?.additionallyAllowedTenants),this.timeout=e?.processTimeoutInMs}async getAzurePowerShellAccessToken(e,r,n){for(let o of[...uLt]){try{await Lsn([[o,"/?"]],n)}catch{uLt.shift();continue}let c=(await Lsn([[o,"-NoProfile","-NonInteractive","-Command",` $tenantId = "${r??""}" $m = Import-Module Az.Accounts -MinimumVersion 2.2.0 -PassThru $useSecureString = $m.Version -ge [version]'2.17.0' -and $m.Version -lt [version]'5.0.0' @@ -1765,24 +1750,24 @@ Error Description: '${s.message}'`,this.correlationId)}return null}return n||(th } Write-Output (ConvertTo-Json $result) - `]]))[0];return GRo(c)}throw new Error("Unable to execute PowerShell. Ensure that it is installed in your system")}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async()=>{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Dn(`${qHe.claim} ${l}`);throw IM.getToken.info(Os(n,d)),d}let s=lf(this.tenantId,r,this.additionallyAllowedTenantIds);s&&Hm(IM,s);try{Kae(n,IM),IM.getToken.info(`Using the scope ${n}`);let c=FHe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return IM.getToken.info(q0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(HRo(c)){let u=new Dn(qHe.installed);throw IM.getToken.info(Os(n,u)),u}else if(jRo(c)){let u=new Dn(qHe.login);throw IM.getToken.info(Os(n,u)),u}let l=new Dn(`${c}. ${qHe.troubleshoot}`);throw IM.getToken.info(Os(n,l)),l}})}};async function GRo(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&IM.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(GRo,"parseJsonToken");p();var lan=require("node:fs/promises");var $Ro="common",VRo="aebc6443-996d-45c2-90f0-388ff96faa56",bLt=lo("VisualStudioCodeCredential"),WRo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function zRo(t){let e=WRo[t];if(e)throw new Dn(e)}a(zRo,"checkUnsupportedTenant");var _Se=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?(Hm(bLt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=$Ro,this.additionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants),zRo(this.tenantId)}async prepare(e){let r=lf(this.tenantId,this.options,this.additionallyAllowedTenantIds,bLt)||this.tenantId;if(!NZr()||!VQe)throw new Dn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(VQe,e);this.msalClient=My(VRo,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=hx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Dn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,lan.readFile)(e,{encoding:"utf8"});return J4t(n)}catch(n){throw bLt.getToken.info(Os(r,n)),new Dn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var jHe=lo("BrokerCredential"),HHe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Wae(jHe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=jf(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:jHe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=My(gz,this.brokerTenantId,r)}async getToken(e,r={}){return Nc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=lf(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,jHe);let o=hx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw jHe.getToken.info(Os(o,s)),new Dn("Failed to acquire token using broker authentication",{cause:s})}})}};function uan(t={}){return new HHe(t)}a(uan,"createDefaultBrokerCredential");function SLt(t={}){return new _Se(t)}a(SLt,"createDefaultVisualStudioCodeCredential");function TLt(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new I7(c)}if(o&&r){let c={...t,tenantId:s};return new I7(r,c)}if(e){let c={...t,clientId:e};return new I7(c)}return new I7(t)}a(TLt,"createDefaultManagedIdentityCredential");function ILt(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new UL(s)}if(o){let s={...t,tenantId:o};return new UL(s)}return new UL(t)}a(ILt,"createDefaultWorkloadIdentityCredential");function xLt(t={}){return new gSe(t)}a(xLt,"createDefaultAzureDeveloperCliCredential");function wLt(t={}){return new ySe(t)}a(wLt,"createDefaultAzureCliCredential");function RLt(t={}){return new ESe(t)}a(RLt,"createDefaultAzurePowershellCredential");function kLt(t={}){return new hSe(t)}a(kLt,"createDefaultEnvironmentCredential");var GHe=lo("DefaultAzureCredential"),PLt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return GHe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Zae=class extends Hbe{static{a(this,"DefaultAzureCredential")}constructor(e){YRo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[SLt,wLt,RLt,xLt,uan],o=[kLt,ILt,TLt],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[kLt];break;case"workloadidentitycredential":s=[ILt];break;case"managedidentitycredential":s=[()=>TLt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[SLt];break;case"azureclicredential":s=[wLt];break;case"azurepowershellcredential":s=[RLt];break;case"azuredeveloperclicredential":s=[xLt];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw GHe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return GHe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new PLt(u.name,d.message)}});super(...l)}};function YRo(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw GHe.warning(n),new Error(n)}}}a(YRo,"validateRequiredEnvVars");p();var Z0u=lo("InteractiveBrowserCredential");p();var cmu=lo("DeviceCodeCredential");p();var KRo="AzurePipelinesCredential",ymu=lo(KRo);p();var wmu=lo("AuthorizationCodeCredential");p();var JRo="OnBehalfOfCredential",Fmu=lo(JRo);p();var $He=new ge("capiFetchUtilities");function ZRo(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(ZRo,"getIntegrationId");function Gm(t){let e={...by(t),"X-GitHub-Api-Version":"2026-06-01"},r=ZRo(t.get(Lr));return r&&(e["Copilot-Integration-Id"]=r),e}a(Gm,"getCapiHeaders");function dan(t,e){return $He.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":cW.api,"Copilot-Integration-Id":"autodev-test"}}a(dan,"addMsBenchCesProxyHeaders");async function fan(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;$He.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await SZr(process.env.HMAC_SECRET,r);return{...e,...n}}a(fan,"addMsBenchHmacHeaders");function XRo(){return NN()&&!!process.env.HMAC_SECRET}a(XRo,"isMsBenchHmacModeEnabled");function DLt(){return NN()&&!process.env.HMAC_SECRET}a(DLt,"isMsBenchCesProxyModeEnabled");async function CSe(t,e){return process.env.HMAC_SECRET?await fan(t,e):dan(t,e)}a(CSe,"addMsBenchHeaders");async function VHe(t,e,r){let n=r;DLt()&&(n=await eko());let o={...e,Authorization:`Bearer ${n}`};return{headers:XRo()?await fan(t,o):DLt()?dan(t,o):o,token:n}}a(VHe,"applyMsBenchAuth");function vSe(t,e,...r){if(DLt()){$He.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return LI(t,e,"api",...r)}a(vSe,"getCapiUrl");function WHe(t,e,r){(e.status===401||e.status===403)&&($He.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Qt).resetToken("capi_fetch",e.status))}a(WHe,"handleCapiAuthError");async function zz(t,e,r){r??=await t.get(Qt).getToken();let n=vSe(t,r,e),{headers:o}=await VHe(t,Gm(t),r.token),s=await t.get(ar).fetch(new URL(n).href,{method:"GET",headers:o});return WHe(t,s,e),s}a(zz,"fetchCapiUrl");async function zHe(t,e,r){let n=await t.get(Qt).getToken(),o=vSe(t,n,e),{headers:s}=await VHe(t,Gm(t),n.token),c=await t.get(ar).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return WHe(t,c,e),c}a(zHe,"postCapiUrl");async function eko(){let e=await new Zae().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(eko,"getMsBenchToken");p();var han=600*1e3,Tn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},NLt={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Xae=new Set([Tn.O1Ga,Tn.O3Mini,Tn.O1Mini,Tn.Gemini20Pro,Tn.Gemini20Flash]);function JHe(t){return t.startsWith("claude")}a(JHe,"isClaudeFamily");function hS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Tn.Gpt4o]:r=[Tn.Gpt4o,Tn.Gpt4turbo,Tn.Gpt4,Tn.O1Mini,Tn.O1Ga,Tn.Claude35Sonnet,Tn.O3Mini,Tn.Gemini20Flash,Tn.Claude37Sonnet,Tn.Claude37SonnetThought,Tn.Gpt45,Tn.Gpt41,Tn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt35turbo,Tn.Gpt41,Tn.CopilotBase];break;case"gitCommit":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt4,Tn.Gpt41,Tn.CopilotBase];break;case"nesStubs":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt41,Tn.CopilotBase];break}return r}a(hS,"getSupportedModelFamiliesForPrompt");var ZHe={textEmbedding3Small:"text-embedding-3-small"},tko=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),pan=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),rko=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:tko,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional(pan),long_context:S.Optional(pan)}))})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),man=S.Object({data:S.Array(rko)});function gan(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(gan,"getDegradationReason");var dc=class{static{a(this,"ModelMetadataProvider")}},YHe=class extends dc{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Qt).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(){return this.shouldRefreshModels()&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await zz(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Dr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Dr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new DN(r)}await this.processModels(r)}async fetchModel(r){let n=await zz(this.ctx,`/models/${r}`);if(!n.ok){Dr.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await zHe(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Dr.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>han}},KHe=class extends dc{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(){let r=this.ctx.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatExpModelIds(n),s=[];if(o){let c=o?.split(",");for(let l of c){let u=await this.fetchModel(l.trim());u!==void 0&&(u.isExperimental=!0,s.push(u))}}return s.concat(await this.delegate.getMetadata())}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(Aan,"getUserSelectedModelConfiguration");p();p();p();var ece=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();var yan=ce(require("node:fs/promises")),XHe=ce(require("node:path"));async function tce(t){return await yan.readFile(MLt(t))}a(tce,"readFile");function MLt(t){return XHe.default.resolve(XHe.default.extname(__filename)!==".ts"?__dirname:XHe.default.resolve(__dirname,"../../dist"),t)}a(MLt,"locateFile");var nce=ce(oGe());var sGe=new Map;function Ss(t="o200k_base"){let e=sGe.get(t);return e!==void 0||(e=sGe.get("o200k_base"),e!==void 0)?e:new rce}a(Ss,"getTokenizer");async function aGe(t="o200k_base"){return await SSe,Ss(t)}a(aGe,"getTokenizerAsync");async function yko(t){if(!t.endsWith(".tiktoken.noindex"))throw new Error("File does not end with .tiktoken.noindex");let e=await tce(t),r=new Map,n=[];for(let o=0;othis.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let n=typeof e=="string"?e:e[0],o=r.claims;if(o&&o.trim()){let l=`Connect-AzAccount -ClaimsChallenge ${btoa(o)}`,u=r.tenantId;u&&(l+=` -Tenant ${u}`);let d=new Nn(`${xHe.claim} ${l}`);throw _M.getToken.info(Ds(n,d)),d}let s=af(this.tenantId,r,this.additionallyAllowedTenantIds);s&&$m(_M,s);try{qae(n,_M),_M.getToken.info(`Using the scope ${n}`);let c=SHe(n),l=await this.getAzurePowerShellAccessToken(c,s,this.timeout);return _M.getToken.info(j0(e)),{token:l.Token,expiresOnTimestamp:new Date(l.ExpiresOn).getTime(),tokenType:"Bearer"}}catch(c){if(BRo(c)){let u=new Nn(xHe.installed);throw _M.getToken.info(Ds(n,u)),u}else if(ORo(c)){let u=new Nn(xHe.login);throw _M.getToken.info(Ds(n,u)),u}let l=new Nn(`${c}. ${xHe.troubleshoot}`);throw _M.getToken.info(Ds(n,l)),l}})}};async function LRo(t){let e=/{[^{}]*}/g,r=t.match(e),n=t;if(r)try{for(let o of r)try{let s=JSON.parse(o);if(s?.Token)return n=n.replace(o,""),n&&_M.getToken.warning(n),s}catch{continue}}catch{throw new Error(`Unable to parse the output of PowerShell. Received output: ${t}`)}throw new Error(`No access token found in the output. Received output: ${t}`)}a(LRo,"parseJsonToken");p();var qsn=require("node:fs/promises");var FRo="common",URo="aebc6443-996d-45c2-90f0-388ff96faa56",dLt=lo("VisualStudioCodeCredential"),QRo={adfs:"The VisualStudioCodeCredential does not support authentication with ADFS tenants."};function qRo(t){let e=QRo[t];if(e)throw new Nn(e)}a(qRo,"checkUnsupportedTenant");var lSe=class{static{a(this,"VisualStudioCodeCredential")}tenantId;additionallyAllowedTenantIds;msalClient;options;constructor(e){this.options=e||{},e&&e.tenantId?($m(dLt,e.tenantId),this.tenantId=e.tenantId):this.tenantId=FRo,this.additionallyAllowedTenantIds=$f(e?.additionallyAllowedTenants),qRo(this.tenantId)}async prepare(e){let r=af(this.tenantId,this.options,this.additionallyAllowedTenantIds,dLt)||this.tenantId;if(!dZr()||!DQe)throw new Nn("Visual Studio Code Authentication is not available. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");let n=await this.loadAuthRecord(DQe,e);this.msalClient=Fy(URo,r,{...this.options,isVSCodeCredential:!0,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0},authenticationRecord:n})}preparePromise;prepareOnce(e){return this.preparePromise||(this.preparePromise=this.prepare(e)),this.preparePromise}async getToken(e,r){let n=dx(e);if(await this.prepareOnce(n),!this.msalClient)throw new Nn("Visual Studio Code Authentication failed to initialize. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.");return this.msalClient.getTokenByInteractiveRequest(n,{...r,disableAutomaticAuthentication:!0})}async loadAuthRecord(e,r){try{let n=await(0,qsn.readFile)(e,{encoding:"utf8"});return U4t(n)}catch(n){throw dLt.getToken.info(Ds(r,n)),new Nn("Cannot load authentication record in Visual Studio Code. Ensure you have have Azure Resources Extension installed in VS Code, signed into Azure via VS Code, installed the @azure/identity-vscode package, and properly configured the extension.")}}};p();var wHe=lo("BrokerCredential"),RHe=class{static{a(this,"BrokerCredential")}brokerMsalClient;brokerTenantId;brokerAdditionallyAllowedTenantIds;constructor(e){this.brokerTenantId=Fae(wHe,e.tenantId),this.brokerAdditionallyAllowedTenantIds=$f(e?.additionallyAllowedTenants);let r={...e,tokenCredentialOptions:e,logger:wHe,brokerOptions:{enabled:!0,parentWindowHandle:new Uint8Array(0),useDefaultBrokerAccount:!0}};this.brokerMsalClient=Fy(az,this.brokerTenantId,r)}async getToken(e,r={}){return kc.withSpan(`${this.constructor.name}.getToken`,r,async n=>{n.tenantId=af(this.brokerTenantId,n,this.brokerAdditionallyAllowedTenantIds,wHe);let o=dx(e);try{return this.brokerMsalClient.getBrokeredToken(o,!0,{...n,disableAutomaticAuthentication:!0})}catch(s){throw wHe.getToken.info(Ds(o,s)),new Nn("Failed to acquire token using broker authentication",{cause:s})}})}};function jsn(t={}){return new RHe(t)}a(jsn,"createDefaultBrokerCredential");function fLt(t={}){return new lSe(t)}a(fLt,"createDefaultVisualStudioCodeCredential");function pLt(t={}){t.retryOptions??={maxRetries:5,retryDelayInMs:800},t.sendProbeRequest??=!0;let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=t?.managedIdentityResourceId,o=process.env.AZURE_FEDERATED_TOKEN_FILE,s=t?.tenantId??process.env.AZURE_TENANT_ID;if(n){let c={...t,resourceId:n};return new v7(c)}if(o&&r){let c={...t,tenantId:s};return new v7(r,c)}if(e){let c={...t,clientId:e};return new v7(c)}return new v7(t)}a(pLt,"createDefaultManagedIdentityCredential");function hLt(t){let e=t?.managedIdentityClientId??process.env.AZURE_CLIENT_ID,r=t?.workloadIdentityClientId??e,n=process.env.AZURE_FEDERATED_TOKEN_FILE,o=t?.tenantId??process.env.AZURE_TENANT_ID;if(n&&r){let s={...t,tenantId:o,clientId:r,tokenFilePath:n};return new DL(s)}if(o){let s={...t,tenantId:o};return new DL(s)}return new DL(t)}a(hLt,"createDefaultWorkloadIdentityCredential");function mLt(t={}){return new oSe(t)}a(mLt,"createDefaultAzureDeveloperCliCredential");function gLt(t={}){return new aSe(t)}a(gLt,"createDefaultAzureCliCredential");function ALt(t={}){return new cSe(t)}a(ALt,"createDefaultAzurePowershellCredential");function yLt(t={}){return new nSe(t)}a(yLt,"createDefaultEnvironmentCredential");var PHe=lo("DefaultAzureCredential"),ELt=class{static{a(this,"UnavailableDefaultCredential")}credentialUnavailableErrorMessage;credentialName;constructor(e,r){this.credentialName=e,this.credentialUnavailableErrorMessage=r}getToken(){return PHe.getToken.info(`Skipping ${this.credentialName}, reason: ${this.credentialUnavailableErrorMessage}`),Promise.resolve(null)}},Hae=class extends Dbe{static{a(this,"DefaultAzureCredential")}constructor(e){jRo(e);let r=process.env.AZURE_TOKEN_CREDENTIALS?process.env.AZURE_TOKEN_CREDENTIALS.trim().toLowerCase():void 0,n=[fLt,gLt,ALt,mLt,jsn],o=[yLt,hLt,pLt],s=[],c="EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, AzureDeveloperCliCredential";if(r)switch(r){case"dev":s=n;break;case"prod":s=o;break;case"environmentcredential":s=[yLt];break;case"workloadidentitycredential":s=[hLt];break;case"managedidentitycredential":s=[()=>pLt({sendProbeRequest:!1})];break;case"visualstudiocodecredential":s=[fLt];break;case"azureclicredential":s=[gLt];break;case"azurepowershellcredential":s=[ALt];break;case"azuredeveloperclicredential":s=[mLt];break;default:{let u=`Invalid value for AZURE_TOKEN_CREDENTIALS = ${process.env.AZURE_TOKEN_CREDENTIALS}. Valid values are 'prod' or 'dev' or any of these credentials - ${c}.`;throw PHe.warning(u),new Error(u)}}else s=[...o,...n];let l=s.map(u=>{try{return u(e??{})}catch(d){return PHe.warning(`Skipped ${u.name} because of an error creating the credential: ${d}`),new ELt(u.name,d.message)}});super(...l)}};function jRo(t){if(t?.requiredEnvVars){let r=(Array.isArray(t.requiredEnvVars)?t.requiredEnvVars:[t.requiredEnvVars]).filter(n=>!process.env[n]);if(r.length>0){let n=`Required environment ${r.length===1?"variable":"variables"} '${r.join(", ")}' for DefaultAzureCredential ${r.length===1?"is":"are"} not set or empty.`;throw PHe.warning(n),new Error(n)}}}a(jRo,"validateRequiredEnvVars");p();var $pu=lo("InteractiveBrowserCredential");p();var thu=lo("DeviceCodeCredential");p();var HRo="AzurePipelinesCredential",dhu=lo(HRo);p();var vhu=lo("AuthorizationCodeCredential");p();var GRo="OnBehalfOfCredential",khu=lo(GRo);p();var kHe=new Ae("capiFetchUtilities");function $Ro(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a($Ro,"getIntegrationId");function lA(t){let e={...xy(t),"X-GitHub-Api-Version":"2026-06-01"},r=$Ro(t.get(Nr));return r&&(e["Copilot-Integration-Id"]=r),e}a(lA,"getCapiHeaders");function Hsn(t,e){return kHe.debug(t,"Using CES proxy mode for msbench"),{...e,"ces-proxy-target":XV.api,"Copilot-Integration-Id":"autodev-test"}}a(Hsn,"addMsBenchCesProxyHeaders");async function Gsn(t,e){let r=process.env.INTEGRATION_ID_FOR_HMAC_SECRET;kHe.info(t,"Using HMAC authentication mode for msbench with integration id",r);let n=await rZr(process.env.HMAC_SECRET,r);return{...e,...n}}a(Gsn,"addMsBenchHmacHeaders");function VRo(){return OB()&&!!process.env.HMAC_SECRET}a(VRo,"isMsBenchHmacModeEnabled");function _Lt(){return OB()&&!process.env.HMAC_SECRET}a(_Lt,"isMsBenchCesProxyModeEnabled");async function DHe(t,e){return process.env.HMAC_SECRET?await Gsn(t,e):Hsn(t,e)}a(DHe,"addMsBenchHeaders");async function NHe(t,e,r){let n=r;_Lt()&&(n=await WRo());let o={...e,Authorization:`Bearer ${n}`};return{headers:VRo()?await Gsn(t,o):_Lt()?Hsn(t,o):o,token:n}}a(NHe,"applyMsBenchAuth");function MHe(t,e,...r){if(_Lt()){kHe.debug(t,"Using CES proxy endpoint for URL generation");let n=r.join("/");return n.startsWith("/")&&(n=n.slice(1)),`https://ces-dev1.azurewebsites.net/api/proxy/${n}`}return NI(t,e,"api",...r)}a(MHe,"getCapiUrl");function OHe(t,e,r){(e.status===401||e.status===403)&&(kHe.debug(t,"CAPI auth error encountered",{status:e.status,path:r}),t.get(Ut).resetToken("capi_fetch",e.status))}a(OHe,"handleCapiAuthError");async function Uz(t,e,r){r??=await t.get(Ut).getToken();let n=MHe(t,r,e),{headers:o}=await NHe(t,lA(t),r.token),s=await t.get(cr).fetch(new URL(n).href,{method:"GET",headers:o});return OHe(t,s,e),s}a(Uz,"fetchCapiUrl");async function BHe(t,e,r){let n=await t.get(Ut).getToken(),o=MHe(t,n,e),{headers:s}=await NHe(t,lA(t),n.token),c=await t.get(cr).fetch(new URL(o).href,{method:"POST",headers:s,body:r});return OHe(t,c,e),c}a(BHe,"postCapiUrl");async function WRo(){let e=await new Hae().getToken("api://17b0ad65-ed36-4194-bb27-059c567bc41f/.default");if(!e)throw new Error("Failed to retrieve access token");return e.token}a(WRo,"getMsBenchToken");p();var Vsn=600*1e3,Tn={Gpt35turbo:"gpt-3.5-turbo",Gpt4:"gpt-4",Gpt4turbo:"gpt-4-turbo",Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",O1Mini:"o1-mini",O1Ga:"o1-ga",Claude35Sonnet:"claude-3.5-sonnet",O3Mini:"o3-mini",Gemini20Flash:"gemini-2.0-flash",Gemini20Pro:"gemini-2.0-pro",Claude37Sonnet:"claude-3.7-sonnet",Claude37SonnetThought:"claude-3.7-sonnet-thought",Gpt45:"gpt-4.5",Gpt41:"gpt-4.1",Gpt5:"gpt-5",Gpt5Mini:"gpt-5-mini",Gpt5CodeX:"gpt-5-codex",Gpt51:"gpt-5.1",Gpt51CodeX:"gpt-5.1-codex",Gpt51CodeXMini:"gpt-5.1-codex-mini",Gpt52:"gpt-5.2",Gpt54Mini:"gpt-5.4-mini",ClaudeHaiku45:"claude-haiku-4.5",Gemini3Flash:"gemini-3-flash",CopilotBase:"copilot-base",BYOK:"byok",Unknown:"unknown"},vLt={ChatCompletions:"/chat/completions",Responses:"/responses",Messages:"/v1/messages"},Gae=new Set([Tn.O1Ga,Tn.O3Mini,Tn.O1Mini,Tn.Gemini20Pro,Tn.Gemini20Flash]);function UHe(t){return t.startsWith("claude")}a(UHe,"isClaudeFamily");function aS(t,e=!1){let r;switch(t){case"user":case"inline":e?r=[Tn.Gpt4o]:r=[Tn.Gpt4o,Tn.Gpt4turbo,Tn.Gpt4,Tn.O1Mini,Tn.O1Ga,Tn.Claude35Sonnet,Tn.O3Mini,Tn.Gemini20Flash,Tn.Claude37Sonnet,Tn.Claude37SonnetThought,Tn.Gpt45,Tn.Gpt41,Tn.CopilotBase];break;case"meta":case"suggestions":case"synonyms":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt35turbo,Tn.Gpt41,Tn.CopilotBase];break;case"gitCommit":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt4,Tn.Gpt41,Tn.CopilotBase];break;case"nesStubs":e?r=[Tn.Gpt4oMini]:r=[Tn.Gpt4oMini,Tn.Gpt4o,Tn.Gpt41,Tn.CopilotBase];break;case"codeMapper":r=[Tn.Gpt41]}return r}a(aS,"getSupportedModelFamiliesForPrompt");var Wsn={textEmbedding3Small:"text-embedding-3-small"},zRo=S.Object({type:S.Union([S.Literal("chat"),S.Literal("embeddings"),S.Literal("completion")]),tokenizer:S.String(),family:S.String(),object:S.String(),supports:S.Optional(S.Object({tool_calls:S.Optional(S.Boolean()),parallel_tool_calls:S.Optional(S.Boolean()),streaming:S.Optional(S.Boolean()),vision:S.Optional(S.Boolean()),adaptive_thinking:S.Optional(S.Boolean()),reasoning_effort:S.Optional(S.Array(S.String()))})),limits:S.Optional(S.Object({max_inputs:S.Optional(S.Number()),max_prompt_tokens:S.Optional(S.Number()),max_output_tokens:S.Optional(S.Number()),max_non_streaming_output_tokens:S.Optional(S.Number()),max_context_window_tokens:S.Optional(S.Number())}))}),$sn=S.Object({cache_price:S.Optional(S.Number()),input_price:S.Optional(S.Number()),output_price:S.Optional(S.Number()),context_max:S.Optional(S.Number())}),YRo=S.Object({id:S.String(),vendor:S.Optional(S.String()),name:S.String(),version:S.String(),model_picker_enabled:S.Boolean(),model_picker_category:S.Optional(S.String()),model_picker_price_category:S.Optional(S.String()),is_chat_default:S.Optional(S.Boolean()),is_chat_fallback:S.Optional(S.Boolean()),capabilities:zRo,billing:S.Optional(S.Object({is_premium:S.Optional(S.Boolean()),multiplier:S.Optional(S.Number()),token_prices:S.Optional(S.Object({batch_size:S.Optional(S.Number()),default:S.Optional($sn),long_context:S.Optional($sn)}))})),object:S.String(),preview:S.Optional(S.Boolean()),isExperimental:S.Optional(S.Boolean()),policy:S.Optional(S.Object({state:S.String(),terms:S.String()})),supported_endpoints:S.Optional(S.Array(S.String())),warning_messages:S.Optional(S.Array(S.Object({message:S.String()}))),info_messages:S.Optional(S.Array(S.Object({message:S.String()})))}),zsn=S.Object({data:S.Array(YRo)});function Ysn(t){return t.warning_messages?.at(0)?.message??t.info_messages?.at(0)?.message}a(Ysn,"getDegradationReason");var Fa=class{static{a(this,"ModelMetadataProvider")}},LHe=class extends Fa{constructor(r){super();this.ctx=r;this._metadata=[];this._lastFetchTime=0;this._xGithubRequestId=void 0;this.allowTokenRefresh=a(()=>{this._lastFetchTime=0},"allowTokenRefresh");r.get(Ut).onDidResetToken(this.allowTokenRefresh)}static{a(this,"CapiModelMetadataProvider")}async getMetadata(){return this.shouldRefreshModels()&&await this.fetchMetadata(),this._metadata.slice()}async getModelMetadataList(){return this.shouldRefreshModels()&&await this.fetchMetadata(),{models:this._metadata.slice(),xGithubRequestId:this._xGithubRequestId}}async getFallbackModel(){return(await this.getMetadata()).find(n=>n.is_chat_fallback)}async fetchMetadata(){let r=await Uz(this.ctx,"/models");if(this._xGithubRequestId=r.headers.get("X-GitHub-Request-Id")??void 0,r.status<200||r.status>=300){if(r.status===429&&this._metadata.length>0){Dr.error(this.ctx,"Rate limited while fetching models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId});return}throw Dr.error(this.ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText,xGithubRequestId:this._xGithubRequestId}),new wN(r)}await this.processModels(r)}async fetchModel(r){let n=await Uz(this.ctx,`/models/${r}`);if(!n.ok){Dr.error(this.ctx,`Failed to fetch model ${r} from CAPI`,{status:n.status,statusText:n.statusText,xGithubRequestId:this._xGithubRequestId});return}return await n.json()}async acceptModelPolicy(r){return(await BHe(this.ctx,`/models/${r}/policy`,JSON.stringify({status:"enabled"}))).ok?(await this.fetchMetadata(),!0):!1}async processModels(r){try{let n=await r.json();this._metadata=n.data,this._lastFetchTime=Date.now()}catch(n){Dr.error(this.ctx,"Failed to parse models from CAPI",{error:n})}}shouldRefreshModels(){return this._metadata.length===0||!this._lastFetchTime?!0:this.isLastFetchOlderTenMinutes()}isLastFetchOlderTenMinutes(){return Date.now()-this._lastFetchTime>Vsn}},FHe=class extends Fa{constructor(r,n){super();this.ctx=r;this.delegate=n;this._exp_models_cache=new Map}static{a(this,"ExpModelMetadataProvider")}async getMetadata(){let r=this.ctx.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatExpModelIds(n),s=[];if(o){let c=o?.split(",");for(let l of c){let u=await this.fetchModel(l.trim());u!==void 0&&(u.isExperimental=!0,s.push(u))}}return s.concat(await this.delegate.getMetadata())}async getModelMetadataList(){return this.delegate.getModelMetadataList()}async fetchModel(r){let n=this._exp_models_cache.get(r);if(n){let[s,c]=n;if(Date.now()-c0?e:null}a(Ksn,"getUserSelectedModelConfiguration");p();p();p();var $ae=class extends Error{constructor(r,n){super(r,{cause:n});this.code="CopilotPromptLoadFailure"}static{a(this,"CopilotPromptLoadFailure")}};p();var Jsn=fe(require("node:fs/promises")),QHe=fe(require("node:path"));async function Vae(t){return await Jsn.readFile(CLt(t))}a(Vae,"readFile");function CLt(t){return QHe.default.resolve(QHe.default.extname(__filename)!==".ts"?__dirname:QHe.default.resolve(__dirname,"../../dist"),t)}a(CLt,"locateFile");var zae=fe(VHe());var dSe=new Map;function Cs(t="o200k_base"){MLt(t);let e=dSe.get(t);return e!==void 0?e:dPo(t)}a(Cs,"getTokenizer");var dan=new Map;function dPo(t){let e=dan.get(t);if(!e){let r=new Wae(t),n=a(()=>dSe.get(t)??r,"current");e={tokenLength:a(o=>n().tokenLength(o),"tokenLength"),tokenize:a(o=>n().tokenize(o),"tokenize"),detokenize:a(o=>n().detokenize(o),"detokenize"),tokenizeStrings:a(o=>n().tokenizeStrings(o),"tokenizeStrings"),takeLastTokens:a((o,s)=>n().takeLastTokens(o,s),"takeLastTokens"),takeFirstTokens:a((o,s)=>n().takeFirstTokens(o,s),"takeFirstTokens"),takeLastLinesTokens:a((o,s)=>n().takeLastLinesTokens(o,s),"takeLastLinesTokens")},dan.set(t,e)}return e}a(dPo,"getUpgradingTokenizer");async function b7(t="o200k_base"){return await MLt(t),Cs(t)}a(b7,"getTokenizerAsync");async function fPo(t){if(!t.endsWith(".tiktoken.noindex"))throw new Error("File does not end with .tiktoken.noindex");let e=await Vae(t),r=new Map,n=[];for(let o=0;othis.detokenize([n]))}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=4,o=1,s=Math.min(e.length,r*n),c=e.slice(-s),l=this.tokenize(c);for(;l.length{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},NLt=class{constructor(){this.hash=a(e=>{let r=0;for(let n=0;nr.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,r){let n=this.tokenizeStrings(e).slice(-r);return{text:n.join(""),tokens:n.map(this.hash)}}takeFirstTokens(e,r){let n=this.tokenizeStrings(e).slice(0,r);return{text:n.join(""),tokens:n.map(this.hash)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}},Eko={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},GLt=4,rce=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-GLt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-GLt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?Eko[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` +`);return n.substring(o+1)}},pPo={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},DLt=4,Wae=class{constructor(e="o200k_base",r){this.languageId=r;this.tokenizerName=e}static{a(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(r=>{let n=0;for(let o=0;o{let n=[],o=r.toString();for(;o.length>0;){let s=o.slice(-DLt),c=String.fromCharCode(parseInt(s));n.unshift(c),o=o.slice(0,-DLt)}return n.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?pPo[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(-Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeFirstTokens(e,r){if(r<=0)return{text:"",tokens:[]};let n=e.slice(0,Math.floor(r*this.getEffectiveTokenLength()));return{text:n,tokens:Array.from({length:this.tokenLength(n)},(o,s)=>s)}}takeLastLinesTokens(e,r){let{text:n}=this.takeLastTokens(e,r);if(n.length===e.length||e[e.length-n.length-1]===` `)return n;let o=n.indexOf(` -`);return n.substring(o+1)}};async function Dan(t){try{let e=await $Lt.create(t);sGe.set(t,e)}catch{}}a(Dan,"setTokenizer");var SSe=(async()=>{sGe.set("mock",new VLt),await Promise.all([Dan("cl100k_base"),Dan("o200k_base")])})();p();p();var _ko=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Man=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},WLt,cGe,Oan,zLt=class extends qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),WLt.add(this),cGe.set(this,void 0),_ko(this,cGe,e,"f"),this.error=r}Errors(){return new q9(Man(this,WLt,"m",Oan).call(this))}};cGe=new WeakMap,WLt=new WeakSet,Oan=a(function*(){this.error&&(yield this.error),yield*Man(this,cGe,"f")},"_AssertError_Iterator");function Nan(t,e,r){if(!Jo(t,e,r))throw new zLt(xN(t,e,r))}a(Nan,"AssertValue");function lGe(...t){return t.length===3?Nan(t[0],t[1],t[2]):Nan(t[0],[],t[1])}a(lGe,"Assert");p();p();p();function Cko(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Qa(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Qa(t[r]);return e}a(Cko,"FromObject");function vko(t){return t.map(e=>Qa(e))}a(vko,"FromArray");function bko(t){return t.slice()}a(bko,"FromTypedArray");function Sko(t){return new Map(Qa([...t.entries()]))}a(Sko,"FromMap");function Tko(t){return new Set(Qa([...t.entries()]))}a(Tko,"FromSet");function Iko(t){return new Date(t.toISOString())}a(Iko,"FromDate");function Qa(t){if(Ri(t))return vko(t);if(n_(t))return Iko(t);if(bI(t))return bko(t);if(mqr(t))return Sko(t);if(gqr(t))return Tko(t);if(So(t))return Cko(t);if(S1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Qa,"Clone");var mS=class extends qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function qa(t){return k9(t)?t():Qa(t)}a(qa,"FromDefault");function xko(t,e){return Qi(t,"default")?qa(t.default):{}}a(xko,"FromAny");function wko(t,e){return{}}a(wko,"FromArgument");function Rko(t,e){if(t.uniqueItems===!0&&!Qi(t,"default"))throw new mS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Qi(t,"default"))throw new mS(t,"Array with the contains constraint requires a default value");return"default"in t?qa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>gS(t.items,e)):[]}a(Rko,"FromArray");function kko(t,e){return Qi(t,"default")?qa(t.default):(async function*(){})()}a(kko,"FromAsyncIterator");function Pko(t,e){return Qi(t,"default")?qa(t.default):BigInt(0)}a(Pko,"FromBigInt");function Dko(t,e){return Qi(t,"default")?qa(t.default):!1}a(Dko,"FromBoolean");function Nko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=gS(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(Nko,"FromConstructor");function Mko(t,e){return Qi(t,"default")?qa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(Mko,"FromDate");function Oko(t,e){return Qi(t,"default")?qa(t.default):()=>gS(t.returns,e)}a(Oko,"FromFunction");function Bko(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return gS(n,[...e,...r])}a(Bko,"FromImport");function Lko(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(Lko,"FromInteger");function Fko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=gS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!Jo(t,e,r))throw new mS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(Fko,"FromIntersect");function Uko(t,e){return Qi(t,"default")?qa(t.default):(function*(){})()}a(Uko,"FromIterator");function Qko(t,e){return Qi(t,"default")?qa(t.default):t.const}a(Qko,"FromLiteral");function qko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"Never types cannot be created. Consider using a default value.")}a(qko,"FromNever");function jko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"Not types must have a default value")}a(jko,"FromNot");function Hko(t,e){return Qi(t,"default")?qa(t.default):null}a(Hko,"FromNull");function Gko(t,e){return Qi(t,"default")?qa(t.default):t.minimum!==void 0?t.minimum:0}a(Gko,"FromNumber");function $ko(t,e){if(Qi(t,"default"))return qa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=gS(s,e));return n}}a($ko,"FromObject");function Vko(t,e){return Qi(t,"default")?qa(t.default):Promise.resolve(gS(t.item,e))}a(Vko,"FromPromise");function Wko(t,e){return Qi(t,"default")?qa(t.default):{}}a(Wko,"FromRecord");function zko(t,e){return Qi(t,"default")?qa(t.default):gS(Sa(t,e),e)}a(zko,"FromRef");function Yko(t,e){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"RegExp types cannot be created. Consider using a default value.")}a(Yko,"FromRegExp");function Kko(t,e){if(t.pattern!==void 0){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Qi(t,"default"))return qa(t.default);throw new mS(t,"String types with formats must specify a default value")}else return Qi(t,"default")?qa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a(Kko,"FromString");function Jko(t,e){return Qi(t,"default")?qa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(Jko,"FromSymbol");function Zko(t,e){if(Qi(t,"default"))return qa(t.default);if(!y6e(t))throw new mS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return kie(t)[0]}a(Zko,"FromTemplateLiteral");function Xko(t,e){if(Ban++>aPo)throw new mS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Qi(t,"default")?qa(t.default):gS(Sa(t,e),e)}a(Xko,"FromThis");function ePo(t,e){return Qi(t,"default")?qa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>gS(t.items[n],e))}a(ePo,"FromTuple");function tPo(t,e){if(Qi(t,"default"))return qa(t.default)}a(tPo,"FromUndefined");function rPo(t,e){if(Qi(t,"default"))return qa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return gS(t.anyOf[0],e)}a(rPo,"FromUnion");function nPo(t,e){return Qi(t,"default")?qa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(nPo,"FromUint8Array");function iPo(t,e){return Qi(t,"default")?qa(t.default):{}}a(iPo,"FromUnknown");function oPo(t,e){if(Qi(t,"default"))return qa(t.default)}a(oPo,"FromVoid");function sPo(t,e){if(Qi(t,"default"))return qa(t.default);throw new Error("User defined types must specify a default value")}a(sPo,"FromKind");function gS(t,e){let r=Dm(t,e),n=t;switch(n[_t]){case"Any":return xko(n,r);case"Argument":return wko(n,r);case"Array":return Rko(n,r);case"AsyncIterator":return kko(n,r);case"BigInt":return Pko(n,r);case"Boolean":return Dko(n,r);case"Constructor":return Nko(n,r);case"Date":return Mko(n,r);case"Function":return Oko(n,r);case"Import":return Bko(n,r);case"Integer":return Lko(n,r);case"Intersect":return Fko(n,r);case"Iterator":return Uko(n,r);case"Literal":return Qko(n,r);case"Never":return qko(n,r);case"Not":return jko(n,r);case"Null":return Hko(n,r);case"Number":return Gko(n,r);case"Object":return $ko(n,r);case"Promise":return Vko(n,r);case"Record":return Wko(n,r);case"Ref":return zko(n,r);case"RegExp":return Yko(n,r);case"String":return Kko(n,r);case"Symbol":return Jko(n,r);case"TemplateLiteral":return Zko(n,r);case"This":return Xko(n,r);case"Tuple":return ePo(n,r);case"Undefined":return tPo(n,r);case"Union":return rPo(n,r);case"Uint8Array":return nPo(n,r);case"Unknown":return iPo(n,r);case"Void":return oPo(n,r);default:if(!i_.Has(n[_t]))throw new mS(n,"Unknown type");return sPo(n,r)}}a(gS,"Visit");var aPo=512,Ban=0;function Yk(...t){return Ban=0,t.length===2?gS(t[0],t[1]):gS(t[0],[])}a(Yk,"Create");var uGe=class extends qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Lan(t,e,r){if(t[_t]==="Object"&&typeof r=="object"&&!RB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[_t]==="Literal"&&u.const===r[l]?100:0,f=Jo(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[_t]==="Union"){let o=t.anyOf.map(s=>Sa(s,e)).map(s=>Lan(s,e,r));return Math.max(...o)}else return Jo(t,e,r)?1:0}a(Lan,"ScoreUnion");function cPo(t,e,r){let n=t.anyOf.map(c=>Sa(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Lan(c,e,r);l>s&&(o=c,s=l)}return o}a(cPo,"SelectUnion");function lPo(t,e,r){if("default"in t)return typeof r=="function"?t.default:Qa(t.default);{let n=cPo(t,e,r);return TSe(n,e,r)}}a(lPo,"CastUnion");function uPo(t,e,r){return Jo(t,e,r)?Qa(r):Yk(t,e)}a(uPo,"DefaultClone");function dPo(t,e,r){return Jo(t,e,r)?r:Yk(t,e)}a(dPo,"Default");function fPo(t,e,r){if(Jo(t,e,r))return Qa(r);let n=Ri(r)?Qa(r):Yk(t,e),o=oi(t.minItems)&&n.lengthnull)]:n,c=(oi(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>Kk(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!Jo(t,e,l))throw new uGe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(fPo,"FromArray");function pPo(t,e,r){if(Jo(t,e,r))return Yk(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=Kk(c,e,r.prototype[s]));return o}a(pPo,"FromConstructor");function hPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Kk(o,[...e,...n],r)}a(hPo,"FromImport");function Fan(t,e){return So(t)&&!So(e)||!So(t)&&So(e)?t:!So(t)||!So(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?Fan(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(Fan,"IntersectAssign");function mPo(t,e,r){if(Jo(t,e,r))return r;let n=Yk(t,e),o=Fan(n,r);return Jo(t,e,o)?o:n}a(mPo,"FromIntersect");function gPo(t,e,r){throw new uGe(t,"Never types cannot be cast")}a(gPo,"FromNever");function APo(t,e,r){if(Jo(t,e,r))return r;if(r===null||typeof r!="object")return Yk(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=Kk(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=Kk(t.additionalProperties,e,r[c]))}return o}a(APo,"FromObject");function yPo(t,e,r){if(Jo(t,e,r))return Qa(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Yk(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=Kk(o,e,l);return s}a(yPo,"FromRecord");function EPo(t,e,r){return Kk(Sa(t,e),e,r)}a(EPo,"FromRef");function _Po(t,e,r){return Kk(Sa(t,e),e,r)}a(_Po,"FromThis");function CPo(t,e,r){return Jo(t,e,r)?Qa(r):Ri(r)?t.items===void 0?[]:t.items.map((n,o)=>Kk(n,e,r[o])):Yk(t,e)}a(CPo,"FromTuple");function vPo(t,e,r){return Jo(t,e,r)?Qa(r):lPo(t,e,r)}a(vPo,"FromUnion");function Kk(t,e,r){let n=va(t.$id)?Dm(t,e):e,o=t;switch(t[_t]){case"Array":return fPo(o,n,r);case"Constructor":return pPo(o,n,r);case"Import":return hPo(o,n,r);case"Intersect":return mPo(o,n,r);case"Never":return gPo(o,n,r);case"Object":return APo(o,n,r);case"Record":return yPo(o,n,r);case"Ref":return EPo(o,n,r);case"This":return _Po(o,n,r);case"Tuple":return CPo(o,n,r);case"Union":return vPo(o,n,r);case"Date":case"Symbol":case"Uint8Array":return uPo(t,e,r);default:return dPo(o,n,r)}}a(Kk,"Visit");function TSe(...t){return t.length===3?Kk(t[0],t[1],t[2]):Kk(t[0],[],t[1])}a(TSe,"Cast");p();function bPo(t){return D9(t)&&t[_t]!=="Unsafe"}a(bPo,"IsCheckable");function SPo(t,e,r){return Ri(r)?r.map(n=>hv(t.items,e,n)):r}a(SPo,"FromArray");function TPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return hv(o,[...e,...n],r)}a(TPo,"FromImport");function IPo(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>hv(l,e,Qa(r))).reduce((l,u)=>So(u)?{...l,...u}:u,{});if(!So(r)||!So(s)||!D9(n))return s;let c=WC(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||Jo(n,e,r[l])&&(s[l]=hv(n,e,r[l]));return s}a(IPo,"FromIntersect");function xPo(t,e,r){if(!So(r)||Ri(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Qi(t.properties,o)){r[o]=hv(t.properties[o],e,r[o]);continue}if(D9(n)&&Jo(n,e,r[o])){r[o]=hv(n,e,r[o]);continue}delete r[o]}return r}a(xPo,"FromObject");function wPo(t,e,r){if(!So(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=hv(c,e,r[u]);continue}if(D9(n)&&Jo(n,e,r[u])){r[u]=hv(n,e,r[u]);continue}delete r[u]}return r}a(wPo,"FromRecord");function RPo(t,e,r){return hv(Sa(t,e),e,r)}a(RPo,"FromRef");function kPo(t,e,r){return hv(Sa(t,e),e,r)}a(kPo,"FromThis");function PPo(t,e,r){if(!Ri(r))return r;if(Du(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(PPo,"FromTuple");function DPo(t,e,r){for(let n of t.anyOf)if(bPo(n)&&Jo(n,e,r))return hv(n,e,r);return r}a(DPo,"FromUnion");function hv(t,e,r){let n=va(t.$id)?Dm(t,e):e,o=t;switch(o[_t]){case"Array":return SPo(o,n,r);case"Import":return TPo(o,n,r);case"Intersect":return IPo(o,n,r);case"Object":return xPo(o,n,r);case"Record":return wPo(o,n,r);case"Ref":return RPo(o,n,r);case"This":return kPo(o,n,r);case"Tuple":return PPo(o,n,r);case"Union":return DPo(o,n,r);default:return r}}a(hv,"Visit");function dGe(...t){return t.length===3?hv(t[0],t[1],t[2]):hv(t[0],[],t[1])}a(dGe,"Clean");p();function fGe(t){return va(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(fGe,"IsStringNumeric");function NPo(t){return Wg(t)||SN(t)||oi(t)}a(NPo,"IsValueToString");function ISe(t){return t===!0||oi(t)&&t===1||Wg(t)&&t===BigInt("1")||va(t)&&(t.toLowerCase()==="true"||t==="1")}a(ISe,"IsValueTrue");function xSe(t){return t===!1||oi(t)&&(t===0||Object.is(t,-0))||Wg(t)&&t===BigInt("0")||va(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(xSe,"IsValueFalse");function MPo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(MPo,"IsTimeStringWithTimeZone");function OPo(t){return va(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(OPo,"IsTimeStringWithoutTimeZone");function BPo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(BPo,"IsDateTimeStringWithTimeZone");function LPo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(LPo,"IsDateTimeStringWithoutTimeZone");function FPo(t){return va(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(FPo,"IsDateString");function UPo(t,e){let r=Qan(t);return r===e?r:t}a(UPo,"TryConvertLiteralString");function QPo(t,e){let r=qan(t);return r===e?r:t}a(QPo,"TryConvertLiteralNumber");function qPo(t,e){let r=Uan(t);return r===e?r:t}a(qPo,"TryConvertLiteralBoolean");function jPo(t,e){return va(t.const)?UPo(e,t.const):oi(t.const)?QPo(e,t.const):SN(t.const)?qPo(e,t.const):e}a(jPo,"TryConvertLiteral");function Uan(t){return ISe(t)?!0:xSe(t)?!1:t}a(Uan,"TryConvertBoolean");function HPo(t){let e=a(r=>r.split(".")[0],"truncateInteger");return fGe(t)?BigInt(e(t)):oi(t)?BigInt(Math.trunc(t)):xSe(t)?BigInt(0):ISe(t)?BigInt(1):t}a(HPo,"TryConvertBigInt");function Qan(t){return kB(t)&&t.description!==void 0?t.description.toString():NPo(t)?t.toString():t}a(Qan,"TryConvertString");function qan(t){return fGe(t)?parseFloat(t):ISe(t)?1:xSe(t)?0:t}a(qan,"TryConvertNumber");function GPo(t){return fGe(t)?parseInt(t):oi(t)?Math.trunc(t):ISe(t)?1:xSe(t)?0:t}a(GPo,"TryConvertInteger");function $Po(t){return va(t)&&t.toLowerCase()==="null"?null:t}a($Po,"TryConvertNull");function VPo(t){return va(t)&&t==="undefined"?void 0:t}a(VPo,"TryConvertUndefined");function WPo(t){return n_(t)?t:oi(t)?new Date(t):ISe(t)?new Date(1):xSe(t)?new Date(0):fGe(t)?new Date(parseInt(t)):OPo(t)?new Date(`1970-01-01T${t}.000Z`):MPo(t)?new Date(`1970-01-01T${t}`):LPo(t)?new Date(`${t}.000Z`):BPo(t)?new Date(t):FPo(t)?new Date(`${t}T00:00:00.000Z`):t}a(WPo,"TryConvertDate");function zPo(t,e,r){return(Ri(r)?r:[r]).map(o=>Jk(t.items,e,o))}a(zPo,"FromArray");function YPo(t,e,r){return HPo(r)}a(YPo,"FromBigInt");function KPo(t,e,r){return Uan(r)}a(KPo,"FromBoolean");function JPo(t,e,r){return WPo(r)}a(JPo,"FromDate");function ZPo(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return Jk(o,[...e,...n],r)}a(ZPo,"FromImport");function XPo(t,e,r){return GPo(r)}a(XPo,"FromInteger");function e2o(t,e,r){return t.allOf.reduce((n,o)=>Jk(o,e,n),r)}a(e2o,"FromIntersect");function t2o(t,e,r){return jPo(t,r)}a(t2o,"FromLiteral");function r2o(t,e,r){return $Po(r)}a(r2o,"FromNull");function n2o(t,e,r){return qan(r)}a(n2o,"FromNumber");function i2o(t,e,r){if(!So(r)||Ri(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Qi(r,n)&&(r[n]=Jk(t.properties[n],e,r[n]));return r}a(i2o,"FromObject");function o2o(t,e,r){if(!(So(r)&&!Ri(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=Jk(s,e,l);return r}a(o2o,"FromRecord");function s2o(t,e,r){return Jk(Sa(t,e),e,r)}a(s2o,"FromRef");function a2o(t,e,r){return Qan(r)}a(a2o,"FromString");function c2o(t,e,r){return va(r)||oi(r)?Symbol(r):r}a(c2o,"FromSymbol");function l2o(t,e,r){return Jk(Sa(t,e),e,r)}a(l2o,"FromThis");function u2o(t,e,r){return Ri(r)&&!Du(t.items)?r.map((o,s)=>s{let c=__(s,e,n);return So(c)?{...o,...c}:c},{})}a(g2o,"FromIntersect");function A2o(t,e,r){let n=QL(t,r);if(!So(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=__(t.properties[s],e,n[s]);Du(c)||(n[s]=__(t.properties[s],e,n[s]))}if(!YLt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=__(t.additionalProperties,e,n[s]));return n}a(A2o,"FromObject");function y2o(t,e,r){let n=QL(t,r);if(!So(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&YLt(c)&&(n[u]=__(c,e,n[u]));if(!YLt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=__(o,e,n[u]));return n}a(y2o,"FromRecord");function E2o(t,e,r){return __(Sa(t,e),e,QL(t,r))}a(E2o,"FromRef");function _2o(t,e,r){return __(Sa(t,e),e,r)}a(_2o,"FromThis");function C2o(t,e,r){let n=QL(t,r);if(!Ri(n)||Du(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cS2o,Format:()=>wSe,Get:()=>I2o,Has:()=>T2o,Set:()=>b2o,ValuePointerRootDeleteError:()=>gGe,ValuePointerRootSetError:()=>mGe});p();var mGe=class extends qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},gGe=class extends qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Han(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Han,"Escape");function*wSe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nYz(t[o],e[o]))}a(x2o,"ObjectType");function w2o(t,e){return n_(e)&&t.getTime()===e.getTime()}a(w2o,"DateType");function R2o(t,e){return!Ri(e)||t.length!==e.length?!1:t.every((r,n)=>Yz(r,e[n]))}a(R2o,"ArrayType");function k2o(t,e){return!bI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>Yz(r,e[n]))}a(k2o,"TypedArrayType");function P2o(t,e){return t===e}a(P2o,"ValueType");function Yz(t,e){if(n_(t))return w2o(t,e);if(bI(t))return k2o(t,e);if(Ri(t))return R2o(t,e);if(So(t))return x2o(t,e);if(S1(t))return P2o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(Yz,"Equal");var D2o=ec({type:oa("insert"),path:o_(),value:mk()}),N2o=ec({type:oa("update"),path:o_(),value:mk()}),M2o=ec({type:oa("delete"),path:o_()}),$an=Xa([D2o,N2o,M2o]),AGe=class extends qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function yGe(t,e){return{type:"update",path:t,value:e}}a(yGe,"CreateUpdate");function Van(t,e){return{type:"insert",path:t,value:e}}a(Van,"CreateInsert");function Wan(t){return{type:"delete",path:t}}a(Wan,"CreateDelete");function Gan(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new AGe(t,"Cannot diff objects with symbols")}a(Gan,"AssertDiffable");function*O2o(t,e,r){if(Gan(e),Gan(r),!Vwt(r))return yield yGe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Qi(e,s)||(yield Van(`${t}/${s}`,r[s]));for(let s of n)Qi(r,s)&&(Yz(e,r)||(yield*EGe(`${t}/${s}`,e[s],r[s])));for(let s of n)Qi(r,s)||(yield Wan(`${t}/${s}`))}a(O2o,"ObjectType");function*B2o(t,e,r){if(!Ri(r))return yield yGe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(U2o,"IsRootUpdate");function Q2o(t){return t.length===0}a(Q2o,"IsIdentity");function Yan(t,e){if(U2o(e))return Qa(e[0].value);if(Q2o(e))return Qa(t);let r=Qa(t);for(let n of e)switch(n.type){case"insert":{Zk.Set(r,n.path,n.value);break}case"update":{Zk.Set(r,n.path,n.value);break}case"delete":{Zk.Delete(r,n.path);break}}return r}a(Yan,"Patch");p();function Kan(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=UB(e,r)?Vie(e,r,n):n;if(!Jo(e,r,o))throw new $ie(e,o,xN(e,r,o).First());return o}a(Kan,"Encode");p();function _Ge(t){return So(t)&&!Ri(t)}a(_Ge,"IsStandardObject");var CGe=class extends qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function q2o(t,e,r,n){if(!_Ge(r))Zk.Set(t,e,Qa(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)KLt(t,`${e}/${c}`,r[c],n[c])}}a(q2o,"ObjectType");function j2o(t,e,r,n){if(!Ri(r))Zk.Set(t,e,Qa(n));else{for(let o=0;o(lGe(s,c,l),l)],["Cast",(s,c,l)=>TSe(s,c,l)],["Clean",(s,c,l)=>dGe(s,c,l)],["Clone",(s,c,l)=>Qa(l)],["Convert",(s,c,l)=>pGe(s,c,l)],["Decode",(s,c,l)=>UB(s,c)?Gie(s,c,l):l],["Default",(s,c,l)=>hGe(s,c,l)],["Encode",(s,c,l)=>UB(s,c)?Vie(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(JLt||(JLt={}));var Xan=["Clone","Clean","Default","Convert","Assert","Decode"];function V2o(t,e,r,n){return t.reduce((o,s)=>{let c=JLt.Get(s);if(Du(c))throw new vGe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(V2o,"ParseValue");function ecn(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?Ri(t[0])?[t[0],t[1],[],t[2]]:[Xan,t[0],t[1],t[2]]:t.length===2?[Xan,t[0],[],t[1]]:(()=>{throw new vGe("Invalid Arguments")})();return V2o(e,r,n,o)}a(ecn,"Parse");p();var RM={};wi(RM,{Assert:()=>lGe,Cast:()=>TSe,Check:()=>Jo,Clean:()=>dGe,Clone:()=>Qa,Convert:()=>pGe,Create:()=>Yk,Decode:()=>jan,Default:()=>hGe,Diff:()=>zan,Edit:()=>$an,Encode:()=>Kan,Equal:()=>Yz,Errors:()=>xN,Hash:()=>Q9,Mutate:()=>Zan,Parse:()=>ecn,Patch:()=>Yan,ValueErrorIterator:()=>q9});p();var W2o="gpt-41-copilot",mx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&Es(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return W2o}parseModelsResponse(e){try{return RM.Parse(man,e)}catch(r){Dr.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await zz(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Dr.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=Aan(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Dr.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=qt(this._ctx,je.DebugOverrideEngine)||qt(this._ctx,je.DebugOverrideEngineLegacy);if(o)return new Kz(o,"override");let s=e?this._ctx.get(Jt).customEngine(e):"",c=e?this._ctx.get(Jt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new Kz(s,"exp"):new Kz(n,"modelpicker"):s?new Kz(s,"exp"):new Kz(r,"default")}},Kz=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function w7(t,e=void 0){let r=t.get(mx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(w7,"getEngineRequestInfo");p();p();var Fo=class{static{a(this,"FileSystem")}};var ycn=ce(Acn());function Ecn(t){return t!==void 0&&t!==0}a(Ecn,"isRepoInfo");function _cn(t){if(t===void 0||t===0)return"";let e=qL(t);if(e==="github/github")return e;let r=EDo(t)?.toLowerCase();return r!==void 0?r:""}a(_cn,"getDogFood");function qL(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(qL,"tryGetGitHubNWO");function EDo(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(EDo,"tryGetADONWO");function R7(t,e){let r=tf(e);return _Do(t,r)}a(R7,"extractRepoInfoInBackground");var _Do=SDo(CDo,1e4);async function CDo(t,e){let r=vWr(e);if(!r)return;let n=await vDo(t,r);if(!n)return;let o=t.get(Fo),s=xa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=bDo(c)??"",u=t3t(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(CDo,"extractRepoInfo");function t3t(t){let e;try{if(e=(0,ycn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(t3t,"parseRepoUrl");async function vDo(t,e){let r=e+"_add_to_make_longer",n=t.get(Fo);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new e3t(d)),n.delete(c)}),0}}a(SDo,"computeInBackgroundAndMemoize");p();var RSe=500,Ccn=8192-RSe,vcn=4,bGe=10,bcn=1e3*5,SGe={prefix:35,suffix:15,stableContext:35,volatileContext:15},TDo={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function kSe(t){return t=t.toLowerCase(),TDo[t]??t}a(kSe,"normalizeLanguageId");var r3t=class{constructor(e){this.ctx=e;this.cache=new nn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` -`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new n3t(()=>this.ctx.get(Qk).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},n3t=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function IDo(t){return"uri"in t}a(IDo,"isCompletionsFiltersInfo");var Jt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new r3t(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=jt.createAndMarkAsIssued()){if(n instanceof NI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&IDo(r)?R7(this.ctx,r.uri):void 0,s=qL(o)??"",c=_cn(o)??"",l=r?.languageId??"",u=w7(this.ctx).modelId,d=AWr(e),f=e.getTokenValue("ft")??"",h=e.getTokenValue("ol")??"",m=e.getTokenValue("tid")??"",A=this.ctx.get(Nf).getProperties(),y=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-CustomModel":f,"X-Copilot-Orgs":h,"X-Copilot-CopilotTrackingId":m,"X-GitHub-Copilot-SKU":A.sku||""},_=this.getGranularityDirectory(),v=this.makeFilterSettings(E),b=_.extendFilters(v),T=await this.getExpConfig(b.newFilterSettings,y);_.update(v,+(T.variables.copilotbycallbuckets??NaN),+(T.variables.copilottimeperiodsizeinh??NaN));let w=_.extendFilters(v),R=w.newFilterSettings,x=await this.getExpConfig(R,y),k=new Promise(D=>setTimeout(D,t.upcomingDynamicFilterCheckDelayMs));for(let D of w.otherFilterSettingsToPrefetch)k=k.then(async()=>{await new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(D,y)});return this.prepareForUpcomingFilters(R,y),new NI(n.properties,n.measurements,n.issuedTime,{filters:R,exp:x})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Qt).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(Fa).machineId;this.granularityDirectory=new HQe(e,this.ctx.get(dM))}return this.granularityDirectory}makeFilterSettings(e){return new SB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return XC.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new SB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=HB(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??SGe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??bGe}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??Ccn+RSe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??bcn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??SGe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??SGe.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}ideEnableCopilotSemanticSearch(e){return e.filtersAndExp.exp.variables.ideenablecopilotsemanticsearch??!1}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function TGe(t){let e=qt(t,je.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(TGe,"isSearchAgentEnabled");function Scn(t,e){let r=qt(t,je.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Jt).ideEnableCopilotNesNonFreeEnabled(e)}a(Scn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var IGe=ce(ice());var o3t={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function AS(t){return t in o3t&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(AS,"isSupportedLanguageId");function xGe(t){if(!(t in o3t))throw new Error(`Unrecognized language: ${t}`);return o3t[t]}a(xGe,"languageIdToWasmLanguage");var i3t=new Map;async function xDo(t){let e;try{e=await tce(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new ece(`Could not load tree-sitter-${t}.wasm`,r):r}return IGe.default.Language.load(e)}a(xDo,"loadWasmLanguage");function a3t(t){let e=xGe(t);if(!i3t.has(e)){let r=xDo(e);i3t.set(e,r)}return i3t.get(e)}a(a3t,"getLanguage");var s3t=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function k7(t,e){return(await c3t(t,e))[0]}a(k7,"parseTreeSitter");async function c3t(t,e){await IGe.default.init({locateFile:a(s=>MLt(s),"locateFile")});let r;try{r=new IGe.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new s3t(`Could not init Parse for language <${t}>`,s):s}let n=await a3t(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(c3t,"parseTreeSitterIncludingVersion");function Tcn(t){switch(xGe(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(Tcn,"getBlockCloseToken");function wDo(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(wDo,"innerQuery");var RDo=[`[ +`);return n.substring(o+1)}};async function hPo(t){try{let e=await WHe.create(t);dSe.set(t,e)}catch{}}a(hPo,"setTokenizer");var fan=new Map,pan=!1;function MLt(t="o200k_base"){if(pan||(pan=!0,dSe.set("mock",new NLt)),t==="mock")return Promise.resolve();let e=fan.get(t);return e||(e=hPo(t).catch(()=>{}),fan.set(t,e)),e}a(MLt,"_ensureLoaded");async function OLt(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"||t===void 0?"o200k_base":void 0;e&&await MLt(e)}a(OLt,"ensureNativeTokenizersLoaded");function han(t){let e=t==="cl100k_base"?"cl100k_base":t==="o200k_base"?"o200k_base":void 0;if(!e)return;let r=dSe.get(e);if(r instanceof WHe)return{encode:a((n,o)=>r.encode(n,o),"encode")}}a(han,"getNativeEncoder");p();p();var mPo=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},gan=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},BLt,zHe,Aan,LLt=class extends Qi{static{a(this,"AssertError")}constructor(e){let r=e.First();super(r===void 0?"Invalid Value":r.message),BLt.add(this),zHe.set(this,void 0),mPo(this,zHe,e,"f"),this.error=r}Errors(){return new M9(gan(this,BLt,"m",Aan).call(this))}};zHe=new WeakMap,BLt=new WeakSet,Aan=a(function*(){this.error&&(yield this.error),yield*gan(this,zHe,"f")},"_AssertError_Iterator");function man(t,e,r){if(!zo(t,e,r))throw new LLt(SN(t,e,r))}a(man,"AssertValue");function YHe(...t){return t.length===3?man(t[0],t[1],t[2]):man(t[0],[],t[1])}a(YHe,"Assert");p();p();p();function gPo(t){let e={};for(let r of Object.getOwnPropertyNames(t))e[r]=Ua(t[r]);for(let r of Object.getOwnPropertySymbols(t))e[r]=Ua(t[r]);return e}a(gPo,"FromObject");function APo(t){return t.map(e=>Ua(e))}a(APo,"FromArray");function yPo(t){return t.slice()}a(yPo,"FromTypedArray");function EPo(t){return new Map(Ua([...t.entries()]))}a(EPo,"FromMap");function _Po(t){return new Set(Ua([...t.entries()]))}a(_Po,"FromSet");function vPo(t){return new Date(t.toISOString())}a(vPo,"FromDate");function Ua(t){if(wi(t))return APo(t);if(e_(t))return vPo(t);if(EI(t))return yPo(t);if(YQr(t))return EPo(t);if(KQr(t))return _Po(t);if(bo(t))return gPo(t);if(A1(t))return t;throw new Error("ValueClone: Unable to clone value")}a(Ua,"Clone");var cS=class extends Qi{static{a(this,"ValueCreateError")}constructor(e,r){super(r),this.schema=e}};function Qa(t){return b9(t)?t():Ua(t)}a(Qa,"FromDefault");function CPo(t,e){return Ui(t,"default")?Qa(t.default):{}}a(CPo,"FromAny");function bPo(t,e){return{}}a(bPo,"FromArgument");function SPo(t,e){if(t.uniqueItems===!0&&!Ui(t,"default"))throw new cS(t,"Array with the uniqueItems constraint requires a default value");if("contains"in t&&!Ui(t,"default"))throw new cS(t,"Array with the contains constraint requires a default value");return"default"in t?Qa(t.default):t.minItems!==void 0?Array.from({length:t.minItems}).map(r=>lS(t.items,e)):[]}a(SPo,"FromArray");function TPo(t,e){return Ui(t,"default")?Qa(t.default):(async function*(){})()}a(TPo,"FromAsyncIterator");function IPo(t,e){return Ui(t,"default")?Qa(t.default):BigInt(0)}a(IPo,"FromBigInt");function xPo(t,e){return Ui(t,"default")?Qa(t.default):!1}a(xPo,"FromBoolean");function wPo(t,e){if(Ui(t,"default"))return Qa(t.default);{let r=lS(t.returns,e);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[n,o]of Object.entries(r)){let s=this;s[n]=o}}}:class{}}}a(wPo,"FromConstructor");function RPo(t,e){return Ui(t,"default")?Qa(t.default):t.minimumTimestamp!==void 0?new Date(t.minimumTimestamp):new Date}a(RPo,"FromDate");function PPo(t,e){return Ui(t,"default")?Qa(t.default):()=>lS(t.returns,e)}a(PPo,"FromFunction");function kPo(t,e){let r=globalThis.Object.values(t.$defs),n=t.$defs[t.$ref];return lS(n,[...e,...r])}a(kPo,"FromImport");function DPo(t,e){return Ui(t,"default")?Qa(t.default):t.minimum!==void 0?t.minimum:0}a(DPo,"FromInteger");function NPo(t,e){if(Ui(t,"default"))return Qa(t.default);{let r=t.allOf.reduce((n,o)=>{let s=lS(o,e);return typeof s=="object"?{...n,...s}:s},{});if(!zo(t,e,r))throw new cS(t,"Intersect produced invalid value. Consider using a default value.");return r}}a(NPo,"FromIntersect");function MPo(t,e){return Ui(t,"default")?Qa(t.default):(function*(){})()}a(MPo,"FromIterator");function OPo(t,e){return Ui(t,"default")?Qa(t.default):t.const}a(OPo,"FromLiteral");function BPo(t,e){if(Ui(t,"default"))return Qa(t.default);throw new cS(t,"Never types cannot be created. Consider using a default value.")}a(BPo,"FromNever");function LPo(t,e){if(Ui(t,"default"))return Qa(t.default);throw new cS(t,"Not types must have a default value")}a(LPo,"FromNot");function FPo(t,e){return Ui(t,"default")?Qa(t.default):null}a(FPo,"FromNull");function UPo(t,e){return Ui(t,"default")?Qa(t.default):t.minimum!==void 0?t.minimum:0}a(UPo,"FromNumber");function QPo(t,e){if(Ui(t,"default"))return Qa(t.default);{let r=new Set(t.required),n={};for(let[o,s]of Object.entries(t.properties))r.has(o)&&(n[o]=lS(s,e));return n}}a(QPo,"FromObject");function qPo(t,e){return Ui(t,"default")?Qa(t.default):Promise.resolve(lS(t.item,e))}a(qPo,"FromPromise");function jPo(t,e){return Ui(t,"default")?Qa(t.default):{}}a(jPo,"FromRecord");function HPo(t,e){return Ui(t,"default")?Qa(t.default):lS(va(t,e),e)}a(HPo,"FromRef");function GPo(t,e){if(Ui(t,"default"))return Qa(t.default);throw new cS(t,"RegExp types cannot be created. Consider using a default value.")}a(GPo,"FromRegExp");function $Po(t,e){if(t.pattern!==void 0){if(Ui(t,"default"))return Qa(t.default);throw new cS(t,"String types with patterns must specify a default value")}else if(t.format!==void 0){if(Ui(t,"default"))return Qa(t.default);throw new cS(t,"String types with formats must specify a default value")}else return Ui(t,"default")?Qa(t.default):t.minLength!==void 0?Array.from({length:t.minLength}).map(()=>" ").join(""):""}a($Po,"FromString");function VPo(t,e){return Ui(t,"default")?Qa(t.default):"value"in t?Symbol.for(t.value):Symbol()}a(VPo,"FromSymbol");function WPo(t,e){if(Ui(t,"default"))return Qa(t.default);if(!o6e(t))throw new cS(t,"Can only create template literals that produce a finite variants. Consider using a default value.");return bie(t)[0]}a(WPo,"FromTemplateLiteral");function zPo(t,e){if(yan++>rko)throw new cS(t,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return Ui(t,"default")?Qa(t.default):lS(va(t,e),e)}a(zPo,"FromThis");function YPo(t,e){return Ui(t,"default")?Qa(t.default):t.items===void 0?[]:Array.from({length:t.minItems}).map((r,n)=>lS(t.items[n],e))}a(YPo,"FromTuple");function KPo(t,e){if(Ui(t,"default"))return Qa(t.default)}a(KPo,"FromUndefined");function JPo(t,e){if(Ui(t,"default"))return Qa(t.default);if(t.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return lS(t.anyOf[0],e)}a(JPo,"FromUnion");function ZPo(t,e){return Ui(t,"default")?Qa(t.default):t.minByteLength!==void 0?new Uint8Array(t.minByteLength):new Uint8Array(0)}a(ZPo,"FromUint8Array");function XPo(t,e){return Ui(t,"default")?Qa(t.default):{}}a(XPo,"FromUnknown");function eko(t,e){if(Ui(t,"default"))return Qa(t.default)}a(eko,"FromVoid");function tko(t,e){if(Ui(t,"default"))return Qa(t.default);throw new Error("User defined types must specify a default value")}a(tko,"FromKind");function lS(t,e){let r=Mm(t,e),n=t;switch(n[Tt]){case"Any":return CPo(n,r);case"Argument":return bPo(n,r);case"Array":return SPo(n,r);case"AsyncIterator":return TPo(n,r);case"BigInt":return IPo(n,r);case"Boolean":return xPo(n,r);case"Constructor":return wPo(n,r);case"Date":return RPo(n,r);case"Function":return PPo(n,r);case"Import":return kPo(n,r);case"Integer":return DPo(n,r);case"Intersect":return NPo(n,r);case"Iterator":return MPo(n,r);case"Literal":return OPo(n,r);case"Never":return BPo(n,r);case"Not":return LPo(n,r);case"Null":return FPo(n,r);case"Number":return UPo(n,r);case"Object":return QPo(n,r);case"Promise":return qPo(n,r);case"Record":return jPo(n,r);case"Ref":return HPo(n,r);case"RegExp":return GPo(n,r);case"String":return $Po(n,r);case"Symbol":return VPo(n,r);case"TemplateLiteral":return WPo(n,r);case"This":return zPo(n,r);case"Tuple":return YPo(n,r);case"Undefined":return KPo(n,r);case"Union":return JPo(n,r);case"Uint8Array":return ZPo(n,r);case"Unknown":return XPo(n,r);case"Void":return eko(n,r);default:if(!t_.Has(n[Tt]))throw new cS(n,"Unknown type");return tko(n,r)}}a(lS,"Visit");var rko=512,yan=0;function VP(...t){return yan=0,t.length===2?lS(t[0],t[1]):lS(t[0],[])}a(VP,"Create");var KHe=class extends Qi{static{a(this,"ValueCastError")}constructor(e,r){super(r),this.schema=e}};function Ean(t,e,r){if(t[Tt]==="Object"&&typeof r=="object"&&!vB(r)){let n=t,o=Object.getOwnPropertyNames(r);return Object.entries(n.properties).reduce((c,[l,u])=>{let d=u[Tt]==="Literal"&&u.const===r[l]?100:0,f=zo(u,e,r[l])?10:0,h=o.includes(l)?1:0;return c+(d+f+h)},0)}else if(t[Tt]==="Union"){let o=t.anyOf.map(s=>va(s,e)).map(s=>Ean(s,e,r));return Math.max(...o)}else return zo(t,e,r)?1:0}a(Ean,"ScoreUnion");function nko(t,e,r){let n=t.anyOf.map(c=>va(c,e)),[o,s]=[n[0],0];for(let c of n){let l=Ean(c,e,r);l>s&&(o=c,s=l)}return o}a(nko,"SelectUnion");function iko(t,e,r){if("default"in t)return typeof r=="function"?t.default:Ua(t.default);{let n=nko(t,e,r);return fSe(n,e,r)}}a(iko,"CastUnion");function oko(t,e,r){return zo(t,e,r)?Ua(r):VP(t,e)}a(oko,"DefaultClone");function sko(t,e,r){return zo(t,e,r)?r:VP(t,e)}a(sko,"Default");function ako(t,e,r){if(zo(t,e,r))return Ua(r);let n=wi(r)?Ua(r):VP(t,e),o=oi(t.minItems)&&n.lengthnull)]:n,c=(oi(t.maxItems)&&o.length>t.maxItems?o.slice(0,t.maxItems):o).map(u=>WP(t.items,e,u));if(t.uniqueItems!==!0)return c;let l=[...new Set(c)];if(!zo(t,e,l))throw new KHe(t,"Array cast produced invalid data due to uniqueItems constraint");return l}a(ako,"FromArray");function cko(t,e,r){if(zo(t,e,r))return VP(t,e);let n=new Set(t.returns.required||[]),o=a(function(){},"result");for(let[s,c]of Object.entries(t.returns.properties))!n.has(s)&&r.prototype[s]===void 0||(o.prototype[s]=WP(c,e,r.prototype[s]));return o}a(cko,"FromConstructor");function lko(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return WP(o,[...e,...n],r)}a(lko,"FromImport");function _an(t,e){return bo(t)&&!bo(e)||!bo(t)&&bo(e)?t:!bo(t)||!bo(e)?e:globalThis.Object.getOwnPropertyNames(t).reduce((r,n)=>{let o=n in e?_an(t[n],e[n]):t[n];return{...r,[n]:o}},{})}a(_an,"IntersectAssign");function uko(t,e,r){if(zo(t,e,r))return r;let n=VP(t,e),o=_an(n,r);return zo(t,e,o)?o:n}a(uko,"FromIntersect");function dko(t,e,r){throw new KHe(t,"Never types cannot be cast")}a(dko,"FromNever");function fko(t,e,r){if(zo(t,e,r))return r;if(r===null||typeof r!="object")return VP(t,e);let n=new Set(t.required||[]),o={};for(let[s,c]of Object.entries(t.properties))!n.has(s)&&r[s]===void 0||(o[s]=WP(c,e,r[s]));if(typeof t.additionalProperties=="object"){let s=Object.getOwnPropertyNames(t.properties);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||(o[c]=WP(t.additionalProperties,e,r[c]))}return o}a(fko,"FromObject");function pko(t,e,r){if(zo(t,e,r))return Ua(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return VP(t,e);let n=Object.getOwnPropertyNames(t.patternProperties)[0],o=t.patternProperties[n],s={};for(let[c,l]of Object.entries(r))s[c]=WP(o,e,l);return s}a(pko,"FromRecord");function hko(t,e,r){return WP(va(t,e),e,r)}a(hko,"FromRef");function mko(t,e,r){return WP(va(t,e),e,r)}a(mko,"FromThis");function gko(t,e,r){return zo(t,e,r)?Ua(r):wi(r)?t.items===void 0?[]:t.items.map((n,o)=>WP(n,e,r[o])):VP(t,e)}a(gko,"FromTuple");function Ako(t,e,r){return zo(t,e,r)?Ua(r):iko(t,e,r)}a(Ako,"FromUnion");function WP(t,e,r){let n=Ea(t.$id)?Mm(t,e):e,o=t;switch(t[Tt]){case"Array":return ako(o,n,r);case"Constructor":return cko(o,n,r);case"Import":return lko(o,n,r);case"Intersect":return uko(o,n,r);case"Never":return dko(o,n,r);case"Object":return fko(o,n,r);case"Record":return pko(o,n,r);case"Ref":return hko(o,n,r);case"This":return mko(o,n,r);case"Tuple":return gko(o,n,r);case"Union":return Ako(o,n,r);case"Date":case"Symbol":case"Uint8Array":return oko(t,e,r);default:return sko(o,n,r)}}a(WP,"Visit");function fSe(...t){return t.length===3?WP(t[0],t[1],t[2]):WP(t[0],[],t[1])}a(fSe,"Cast");p();function yko(t){return T9(t)&&t[Tt]!=="Unsafe"}a(yko,"IsCheckable");function Eko(t,e,r){return wi(r)?r.map(n=>dC(t.items,e,n)):r}a(Eko,"FromArray");function _ko(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return dC(o,[...e,...n],r)}a(_ko,"FromImport");function vko(t,e,r){let n=t.unevaluatedProperties,s=t.allOf.map(l=>dC(l,e,Ua(r))).reduce((l,u)=>bo(u)?{...l,...u}:u,{});if(!bo(r)||!bo(s)||!T9(n))return s;let c=$v(t);for(let l of Object.getOwnPropertyNames(r))c.includes(l)||zo(n,e,r[l])&&(s[l]=dC(n,e,r[l]));return s}a(vko,"FromIntersect");function Cko(t,e,r){if(!bo(r)||wi(r))return r;let n=t.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(Ui(t.properties,o)){r[o]=dC(t.properties[o],e,r[o]);continue}if(T9(n)&&zo(n,e,r[o])){r[o]=dC(n,e,r[o]);continue}delete r[o]}return r}a(Cko,"FromObject");function bko(t,e,r){if(!bo(r))return r;let n=t.additionalProperties,o=Object.getOwnPropertyNames(r),[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of o){if(l.test(u)){r[u]=dC(c,e,r[u]);continue}if(T9(n)&&zo(n,e,r[u])){r[u]=dC(n,e,r[u]);continue}delete r[u]}return r}a(bko,"FromRecord");function Sko(t,e,r){return dC(va(t,e),e,r)}a(Sko,"FromRef");function Tko(t,e,r){return dC(va(t,e),e,r)}a(Tko,"FromThis");function Iko(t,e,r){if(!wi(r))return r;if(ku(t.items))return[];let n=Math.min(r.length,t.items.length);for(let o=0;on?r.slice(0,n):r}a(Iko,"FromTuple");function xko(t,e,r){for(let n of t.anyOf)if(yko(n)&&zo(n,e,r))return dC(n,e,r);return r}a(xko,"FromUnion");function dC(t,e,r){let n=Ea(t.$id)?Mm(t,e):e,o=t;switch(o[Tt]){case"Array":return Eko(o,n,r);case"Import":return _ko(o,n,r);case"Intersect":return vko(o,n,r);case"Object":return Cko(o,n,r);case"Record":return bko(o,n,r);case"Ref":return Sko(o,n,r);case"This":return Tko(o,n,r);case"Tuple":return Iko(o,n,r);case"Union":return xko(o,n,r);default:return r}}a(dC,"Visit");function JHe(...t){return t.length===3?dC(t[0],t[1],t[2]):dC(t[0],[],t[1])}a(JHe,"Clean");p();function ZHe(t){return Ea(t)&&!isNaN(t)&&!isNaN(parseFloat(t))}a(ZHe,"IsStringNumeric");function wko(t){return zg(t)||vN(t)||oi(t)}a(wko,"IsValueToString");function pSe(t){return t===!0||oi(t)&&t===1||zg(t)&&t===BigInt("1")||Ea(t)&&(t.toLowerCase()==="true"||t==="1")}a(pSe,"IsValueTrue");function hSe(t){return t===!1||oi(t)&&(t===0||Object.is(t,-0))||zg(t)&&t===BigInt("0")||Ea(t)&&(t.toLowerCase()==="false"||t==="0"||t==="-0")}a(hSe,"IsValueFalse");function Rko(t){return Ea(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(Rko,"IsTimeStringWithTimeZone");function Pko(t){return Ea(t)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Pko,"IsTimeStringWithoutTimeZone");function kko(t){return Ea(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t)}a(kko,"IsDateTimeStringWithTimeZone");function Dko(t){return Ea(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t)}a(Dko,"IsDateTimeStringWithoutTimeZone");function Nko(t){return Ea(t)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t)}a(Nko,"IsDateString");function Mko(t,e){let r=Can(t);return r===e?r:t}a(Mko,"TryConvertLiteralString");function Oko(t,e){let r=ban(t);return r===e?r:t}a(Oko,"TryConvertLiteralNumber");function Bko(t,e){let r=van(t);return r===e?r:t}a(Bko,"TryConvertLiteralBoolean");function Lko(t,e){return Ea(t.const)?Mko(e,t.const):oi(t.const)?Oko(e,t.const):vN(t.const)?Bko(e,t.const):e}a(Lko,"TryConvertLiteral");function van(t){return pSe(t)?!0:hSe(t)?!1:t}a(van,"TryConvertBoolean");function Fko(t){let e=a(r=>r.split(".")[0],"truncateInteger");return ZHe(t)?BigInt(e(t)):oi(t)?BigInt(Math.trunc(t)):hSe(t)?BigInt(0):pSe(t)?BigInt(1):t}a(Fko,"TryConvertBigInt");function Can(t){return CB(t)&&t.description!==void 0?t.description.toString():wko(t)?t.toString():t}a(Can,"TryConvertString");function ban(t){return ZHe(t)?parseFloat(t):pSe(t)?1:hSe(t)?0:t}a(ban,"TryConvertNumber");function Uko(t){return ZHe(t)?parseInt(t):oi(t)?Math.trunc(t):pSe(t)?1:hSe(t)?0:t}a(Uko,"TryConvertInteger");function Qko(t){return Ea(t)&&t.toLowerCase()==="null"?null:t}a(Qko,"TryConvertNull");function qko(t){return Ea(t)&&t==="undefined"?void 0:t}a(qko,"TryConvertUndefined");function jko(t){return e_(t)?t:oi(t)?new Date(t):pSe(t)?new Date(1):hSe(t)?new Date(0):ZHe(t)?new Date(parseInt(t)):Pko(t)?new Date(`1970-01-01T${t}.000Z`):Rko(t)?new Date(`1970-01-01T${t}`):Dko(t)?new Date(`${t}.000Z`):kko(t)?new Date(t):Nko(t)?new Date(`${t}T00:00:00.000Z`):t}a(jko,"TryConvertDate");function Hko(t,e,r){return(wi(r)?r:[r]).map(o=>zP(t.items,e,o))}a(Hko,"FromArray");function Gko(t,e,r){return Fko(r)}a(Gko,"FromBigInt");function $ko(t,e,r){return van(r)}a($ko,"FromBoolean");function Vko(t,e,r){return jko(r)}a(Vko,"FromDate");function Wko(t,e,r){let n=globalThis.Object.values(t.$defs),o=t.$defs[t.$ref];return zP(o,[...e,...n],r)}a(Wko,"FromImport");function zko(t,e,r){return Uko(r)}a(zko,"FromInteger");function Yko(t,e,r){return t.allOf.reduce((n,o)=>zP(o,e,n),r)}a(Yko,"FromIntersect");function Kko(t,e,r){return Lko(t,r)}a(Kko,"FromLiteral");function Jko(t,e,r){return Qko(r)}a(Jko,"FromNull");function Zko(t,e,r){return ban(r)}a(Zko,"FromNumber");function Xko(t,e,r){if(!bo(r)||wi(r))return r;for(let n of Object.getOwnPropertyNames(t.properties))Ui(r,n)&&(r[n]=zP(t.properties[n],e,r[n]));return r}a(Xko,"FromObject");function e2o(t,e,r){if(!(bo(r)&&!wi(r)))return r;let o=Object.getOwnPropertyNames(t.patternProperties)[0],s=t.patternProperties[o];for(let[c,l]of Object.entries(r))r[c]=zP(s,e,l);return r}a(e2o,"FromRecord");function t2o(t,e,r){return zP(va(t,e),e,r)}a(t2o,"FromRef");function r2o(t,e,r){return Can(r)}a(r2o,"FromString");function n2o(t,e,r){return Ea(r)||oi(r)?Symbol(r):r}a(n2o,"FromSymbol");function i2o(t,e,r){return zP(va(t,e),e,r)}a(i2o,"FromThis");function o2o(t,e,r){return wi(r)&&!ku(t.items)?r.map((o,s)=>s{let c=A_(s,e,n);return bo(c)?{...o,...c}:c},{})}a(d2o,"FromIntersect");function f2o(t,e,r){let n=NL(t,r);if(!bo(n))return n;let o=Object.getOwnPropertyNames(t.properties);for(let s of o){let c=A_(t.properties[s],e,n[s]);ku(c)||(n[s]=A_(t.properties[s],e,n[s]))}if(!FLt(t.additionalProperties))return n;for(let s of Object.getOwnPropertyNames(n))o.includes(s)||(n[s]=A_(t.additionalProperties,e,n[s]));return n}a(f2o,"FromObject");function p2o(t,e,r){let n=NL(t,r);if(!bo(n))return n;let o=t.additionalProperties,[s,c]=Object.entries(t.patternProperties)[0],l=new RegExp(s);for(let u of Object.getOwnPropertyNames(n))l.test(u)&&FLt(c)&&(n[u]=A_(c,e,n[u]));if(!FLt(o))return n;for(let u of Object.getOwnPropertyNames(n))l.test(u)||(n[u]=A_(o,e,n[u]));return n}a(p2o,"FromRecord");function h2o(t,e,r){return A_(va(t,e),e,NL(t,r))}a(h2o,"FromRef");function m2o(t,e,r){return A_(va(t,e),e,r)}a(m2o,"FromThis");function g2o(t,e,r){let n=NL(t,r);if(!wi(n)||ku(t.items))return n;let[o,s]=[t.items,Math.max(t.items.length,n.length)];for(let c=0;cE2o,Format:()=>mSe,Get:()=>v2o,Has:()=>_2o,Set:()=>y2o,ValuePointerRootDeleteError:()=>rGe,ValuePointerRootSetError:()=>tGe});p();var tGe=class extends Qi{static{a(this,"ValuePointerRootSetError")}constructor(e,r,n){super("Cannot set root value"),this.value=e,this.path=r,this.update=n}},rGe=class extends Qi{static{a(this,"ValuePointerRootDeleteError")}constructor(e,r){super("Cannot delete root value"),this.value=e,this.path=r}};function Tan(t){return t.indexOf("~")===-1?t:t.replace(/~1/g,"/").replace(/~0/g,"~")}a(Tan,"Escape");function*mSe(t){if(t==="")return;let[e,r]=[0,0];for(let n=0;nQz(t[o],e[o]))}a(C2o,"ObjectType");function b2o(t,e){return e_(e)&&t.getTime()===e.getTime()}a(b2o,"DateType");function S2o(t,e){return!wi(e)||t.length!==e.length?!1:t.every((r,n)=>Qz(r,e[n]))}a(S2o,"ArrayType");function T2o(t,e){return!EI(e)||t.length!==e.length||Object.getPrototypeOf(t).constructor.name!==Object.getPrototypeOf(e).constructor.name?!1:t.every((r,n)=>Qz(r,e[n]))}a(T2o,"TypedArrayType");function I2o(t,e){return t===e}a(I2o,"ValueType");function Qz(t,e){if(e_(t))return b2o(t,e);if(EI(t))return T2o(t,e);if(wi(t))return S2o(t,e);if(bo(t))return C2o(t,e);if(A1(t))return I2o(t,e);throw new Error("ValueEquals: Unable to compare value")}a(Qz,"Equal");var x2o=Xa({type:ra("insert"),path:r_(),value:fP()}),w2o=Xa({type:ra("update"),path:r_(),value:fP()}),R2o=Xa({type:ra("delete"),path:r_()}),xan=Za([x2o,w2o,R2o]),nGe=class extends Qi{static{a(this,"ValueDiffError")}constructor(e,r){super(r),this.value=e}};function iGe(t,e){return{type:"update",path:t,value:e}}a(iGe,"CreateUpdate");function wan(t,e){return{type:"insert",path:t,value:e}}a(wan,"CreateInsert");function Ran(t){return{type:"delete",path:t}}a(Ran,"CreateDelete");function Ian(t){if(globalThis.Object.getOwnPropertySymbols(t).length>0)throw new nGe(t,"Cannot diff objects with symbols")}a(Ian,"AssertDiffable");function*P2o(t,e,r){if(Ian(e),Ian(r),!Bwt(r))return yield iGe(t,r);let n=globalThis.Object.getOwnPropertyNames(e),o=globalThis.Object.getOwnPropertyNames(r);for(let s of o)Ui(e,s)||(yield wan(`${t}/${s}`,r[s]));for(let s of n)Ui(r,s)&&(Qz(e,r)||(yield*oGe(`${t}/${s}`,e[s],r[s])));for(let s of n)Ui(r,s)||(yield Ran(`${t}/${s}`))}a(P2o,"ObjectType");function*k2o(t,e,r){if(!wi(r))return yield iGe(t,r);for(let n=0;n=0;n--)n0&&t[0].path===""&&t[0].type==="update"}a(M2o,"IsRootUpdate");function O2o(t){return t.length===0}a(O2o,"IsIdentity");function kan(t,e){if(M2o(e))return Ua(e[0].value);if(O2o(e))return Ua(t);let r=Ua(t);for(let n of e)switch(n.type){case"insert":{YP.Set(r,n.path,n.value);break}case"update":{YP.Set(r,n.path,n.value);break}case"delete":{YP.Delete(r,n.path);break}}return r}a(kan,"Patch");p();function Dan(...t){let[e,r,n]=t.length===3?[t[0],t[1],t[2]]:[t[0],[],t[1]],o=kB(e,r)?Uie(e,r,n):n;if(!zo(e,r,o))throw new Fie(e,o,SN(e,r,o).First());return o}a(Dan,"Encode");p();function sGe(t){return bo(t)&&!wi(t)}a(sGe,"IsStandardObject");var aGe=class extends Qi{static{a(this,"ValueMutateError")}constructor(e){super(e)}};function B2o(t,e,r,n){if(!sGe(r))YP.Set(t,e,Ua(n));else{let o=Object.getOwnPropertyNames(r),s=Object.getOwnPropertyNames(n);for(let c of o)s.includes(c)||delete r[c];for(let c of s)o.includes(c)||(r[c]=null);for(let c of s)ULt(t,`${e}/${c}`,r[c],n[c])}}a(B2o,"ObjectType");function L2o(t,e,r,n){if(!wi(r))YP.Set(t,e,Ua(n));else{for(let o=0;o(YHe(s,c,l),l)],["Cast",(s,c,l)=>fSe(s,c,l)],["Clean",(s,c,l)=>JHe(s,c,l)],["Clone",(s,c,l)=>Ua(l)],["Convert",(s,c,l)=>XHe(s,c,l)],["Decode",(s,c,l)=>kB(s,c)?Lie(s,c,l):l],["Default",(s,c,l)=>eGe(s,c,l)],["Encode",(s,c,l)=>kB(s,c)?Uie(s,c,l):l]]);function r(s){e.delete(s)}a(r,"Delete"),t.Delete=r;function n(s,c){e.set(s,c)}a(n,"Set"),t.Set=n;function o(s){return e.get(s)}a(o,"Get"),t.Get=o})(QLt||(QLt={}));var Oan=["Clone","Clean","Default","Convert","Assert","Decode"];function q2o(t,e,r,n){return t.reduce((o,s)=>{let c=QLt.Get(s);if(ku(c))throw new cGe(`Unable to find Parse operation '${s}'`);return c(e,r,o)},n)}a(q2o,"ParseValue");function Ban(...t){let[e,r,n,o]=t.length===4?[t[0],t[1],t[2],t[3]]:t.length===3?wi(t[0])?[t[0],t[1],[],t[2]]:[Oan,t[0],t[1],t[2]]:t.length===2?[Oan,t[0],[],t[1]]:(()=>{throw new cGe("Invalid Arguments")})();return q2o(e,r,n,o)}a(Ban,"Parse");p();var bM={};xi(bM,{Assert:()=>YHe,Cast:()=>fSe,Check:()=>zo,Clean:()=>JHe,Clone:()=>Ua,Convert:()=>XHe,Create:()=>VP,Decode:()=>San,Default:()=>eGe,Diff:()=>Pan,Edit:()=>xan,Encode:()=>Dan,Equal:()=>Qz,Errors:()=>SN,Hash:()=>N9,Mutate:()=>Man,Parse:()=>Ban,Patch:()=>kan,ValueErrorIterator:()=>M9});p();var j2o="gpt-41-copilot",fx=class t{constructor(e,r=!0){this._ctx=e;this.onModelsFetchedCallbacks=[];this.fetchedModelData=[];this.editorPreviewFeaturesDisabled=!1;r&&ys(this._ctx,n=>this.refreshAvailableModels(n))}static{a(this,"AvailableModelsManager")}async refreshAvailableModels(e){await this.refreshModels(e);for(let r of this.onModelsFetchedCallbacks)r()}addHandler(e){this.onModelsFetchedCallbacks.push(e)}getDefaultModelId(){if(this.fetchedModelData){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled)[0];if(e)return e.id}return j2o}parseModelsResponse(e){try{return bM.Parse(zsn,e)}catch(r){Dr.exception(this._ctx,r,"Failed to parse /models response from CAPI");return}}async refreshModels(e){let r=await this.fetchModels(e);r&&(this.fetchedModelData=r)}async fetchModels(e){return this.editorPreviewFeaturesDisabled=e.getTokenValue("editor_preview_features")=="0",await this.fetch(e)}fetch(e){return(!this.fetchInProgress||this.fetchInProgress.withToken.token!==e.token)&&(this.fetchInProgress={withToken:e,response:this.fetchImpl(e).finally(()=>{this.fetchInProgress=void 0})}),this.fetchInProgress.response}async fetchImpl(e){let r=await Uz(this._ctx,"/models",e);return r.ok?this.parseModelsResponse(await r.json())?.data??[]:(Dr.error(this._ctx,"Failed to fetch models from CAPI",{status:r.status,statusText:r.statusText}),null)}getGenericCompletionModels(){let e=t.filterCompletionModels(this.fetchedModelData,this.editorPreviewFeaturesDisabled);return t.mapCompletionModels(e)}getTokenizerForModel(e){let n=this.getGenericCompletionModels().find(o=>o.modelId===e);return n?n.tokenizer:"o200k_base"}static filterCompletionModels(e,r){return e.filter(n=>n.capabilities.type==="completion").filter(n=>!r||n.preview===!1||n.preview===void 0)}static filterModelsWithEditorPreviewFeatures(e,r){return e.filter(n=>!r||n.preview===!1||n.preview===void 0)}static mapCompletionModels(e){return e.map(r=>({modelId:r.id,label:r.name,preview:!!r.preview,tokenizer:r.capabilities.tokenizer}))}getCurrentModelRequestInfo(e=void 0){let r=this.getDefaultModelId(),n=Ksn(this._ctx);if(n){let l=this.getGenericCompletionModels().map(u=>u.modelId);l.includes(n)||(l.length>0&&Dr.error(this._ctx,`User selected model ${n} is not in the list of generic models: ${l.join(", ")}, falling back to default model.`),n=null),r===n&&(n=null)}let o=Ht(this._ctx,Je.DebugOverrideEngine)||Ht(this._ctx,Je.DebugOverrideEngineLegacy);if(o)return new qz(o,"override");let s=e?this._ctx.get(Jt).customEngine(e):"",c=e?this._ctx.get(Jt).customEngineTargetEngine(e):void 0;return n?s&&c&&n===c?new qz(s,"exp"):new qz(n,"modelpicker"):s?new qz(s,"exp"):new qz(r,"default")}},qz=class{constructor(e,r){this.modelId=e;this.modelChoiceSource=r}static{a(this,"ModelRequestInfo")}get headers(){return{}}};function S7(t,e=void 0){let r=t.get(fx),n=r.getCurrentModelRequestInfo(e),o=r.getTokenizerForModel(n.modelId);return{headers:n.headers,modelId:n.modelId,engineChoiceSource:n.modelChoiceSource,tokenizer:o}}a(S7,"getEngineRequestInfo");p();p();var jo=class{static{a(this,"FileSystem")}};var ecn=fe(Xan());function tcn(t){return t!==void 0&&t!==0}a(tcn,"isRepoInfo");function rcn(t){if(t===void 0||t===0)return"";let e=jz(t);if(e==="github/github")return e;let r=hDo(t)?.toLowerCase();return r!==void 0?r:""}a(rcn,"getDogFood");function jz(t){if(t!==void 0&&t!==0&&t.hostname==="github.com")return t.owner+"/"+t.repo}a(jz,"tryGetGitHubNWO");function hDo(t){if(t===void 0||t===0)return;let e=t.hostname.toLowerCase(),r=e==="azure.com"||e.endsWith(".azure.com"),n=e==="visualstudio.com"||e.endsWith(".visualstudio.com");if(r||n)return t.owner+"/"+t.repo}a(hDo,"tryGetADONWO");function T7(t,e){let r=Xd(e);return mDo(t,r)}a(T7,"extractRepoInfoInBackground");var mDo=EDo(gDo,1e4);async function gDo(t,e){let r=XVr(e);if(!r)return;let n=await ADo(t,r);if(!n)return;let o=t.get(jo),s=Sa(n,".git","config"),c;try{c=await o.readFileString(s)}catch{return}let l=yDo(c)??"",u=GLt(l),d={uri:n};return u===void 0?{baseFolder:d,url:l,hostname:"",owner:"",repo:"",pathname:""}:{baseFolder:d,url:l,...u}}a(gDo,"extractRepoInfo");function GLt(t){let e;try{if(e=(0,ecn.default)(t),e.resource==""||e.owner==""||e.name==""||e.pathname=="")return}catch{return}return{hostname:e.resource,owner:e.owner,repo:e.name,pathname:e.pathname}}a(GLt,"parseRepoUrl");async function ADo(t,e){let r=e+"_add_to_make_longer",n=t.get(jo);for(;e!=="file:///"&&e.length{let c=JSON.stringify(s),l=r.get(c);if(l)return l.result;if(n.has(c))return 0;let u=t(o,...s);return n.add(c),u.then(d=>{r.set(c,new HLt(d)),n.delete(c)}),0}}a(EDo,"computeInBackgroundAndMemoize");p();var gSe=500,ncn=8192-gSe,icn=4,lGe=10,ocn=1e3*5,uGe={prefix:35,suffix:15,stableContext:35,volatileContext:15},_Do={javascriptreact:"javascript",jsx:"javascript",typescriptreact:"typescript",jade:"pug",cshtml:"razor",c:"cpp"};function ASe(t){return t=t.toLowerCase(),_Do[t]??t}a(ASe,"normalizeLanguageId");var $Lt=class{constructor(e){this.ctx=e;this.cache=new yn(200)}static{a(this,"FilterSettingsToExpConfigs")}async fetchExpConfig(e,r){let n=e.stringify()+` +`+JSON.stringify(r),o=this.cache.get(n);return o||(o=new VLt(()=>this.ctx.get(LP).fetchExperiments(this.ctx,r,e.toHeaders()),1e3*60*60),this.cache.set(n,o)),o.run()}getCachedExpConfig(e){return this.cache.get(e.stringify())?.value()}},VLt=class{constructor(e,r=1/0){this.producer=e;this.expirationMs=r}static{a(this,"Task")}async run(){return this.promise===void 0&&(this.promise=this.producer(),this.storeResult(this.promise).then(()=>{this.expirationMs<1/0&&this.promise!==void 0&&setTimeout(()=>this.promise=void 0,this.expirationMs)})),this.promise}async storeResult(e){try{this.result=await e}finally{this.result===void 0&&(this.promise=void 0)}}value(){return this.result}};function vDo(t){return"uri"in t}a(vDo,"isCompletionsFiltersInfo");var Jt=class t{constructor(e){this.ctx=e;this.staticFilters={};this.dynamicFilters={};this.dynamicFilterGroups=[];this.upcomingDynamicFilters={};this.assignments=new $Lt(this.ctx)}static{a(this,"Features")}static{this.upcomingDynamicFilterCheckDelayMs=20}static{this.upcomingTimeBucketMinutes=5+Math.floor(Math.random()*11)}registerStaticFilters(e){Object.assign(this.staticFilters,e)}registerDynamicFilter(e,r){this.dynamicFilters[e]=r}registerDynamicFilterGroup(e){this.dynamicFilterGroups.push(e)}getDynamicFilterValues(){let e={};for(let r of this.dynamicFilterGroups)Object.assign(e,r());for(let[r,n]of Object.entries(this.dynamicFilters))e[r]=n();return e}registerUpcomingDynamicFilter(e,r){this.upcomingDynamicFilters[e]=r}async updateExPValuesAndAssignments(e,r,n=Vt.createAndMarkAsIssued()){if(n instanceof RI)throw new Error("updateExPValuesAndAssignments should not be called with TelemetryWithExp");let o=r&&vDo(r)?T7(this.ctx,r.uri):void 0,s=jz(o)??"",c=rcn(o)??"",l=r?.languageId??"",u=S7(this.ctx).modelId,d=V6r(e),f=e.getTokenValue("ft")??"",h=e.getTokenValue("ol")??"",m=e.getTokenValue("tid")??"",A=this.ctx.get(Mf).getProperties(),y=e.endpoints,E={"X-Copilot-Repository":s,"X-Copilot-FileType":l,"X-Copilot-UserKind":d,"X-Copilot-Dogfood":c,"X-Copilot-Engine":u,"X-Copilot-CustomModel":f,"X-Copilot-Orgs":h,"X-Copilot-CopilotTrackingId":m,"X-GitHub-Copilot-SKU":A.sku||""},_=this.getGranularityDirectory(),v=this.makeFilterSettings(E),b=_.extendFilters(v),T=await this.getExpConfig(b.newFilterSettings,y);_.update(v,+(T.variables.copilotbycallbuckets??NaN),+(T.variables.copilottimeperiodsizeinh??NaN));let w=_.extendFilters(v),R=w.newFilterSettings,x=await this.getExpConfig(R,y),P=new Promise(D=>setTimeout(D,t.upcomingDynamicFilterCheckDelayMs));for(let D of w.otherFilterSettingsToPrefetch)P=P.then(async()=>{await new Promise(N=>setTimeout(N,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(D,y)});return this.prepareForUpcomingFilters(R,y),new RI(n.properties,n.measurements,n.issuedTime,{filters:R,exp:x})}async fetchTokenAndUpdateExPValuesAndAssignments(e,r){let n=await this.ctx.get(Ut).getToken();return await this.updateExPValuesAndAssignments(n,e,r)}getGranularityDirectory(){if(!this.granularityDirectory){let e=this.ctx.get(Oa).machineId;this.granularityDirectory=new RQe(e,this.ctx.get(oM))}return this.granularityDirectory}makeFilterSettings(e){return new AB({...this.staticFilters,...this.getDynamicFilterValues(),...e})}async getExpConfig(e,r){try{return this.assignments.fetchExpConfig(e,r)}catch(n){return qv.createFallbackConfig(this.ctx,`Error fetching ExP config: ${String(n)}`)}}async prepareForUpcomingFilters(e,r){if(!(new Date().getMinutes()<60-t.upcomingTimeBucketMinutes))for(let[n,o]of Object.entries(this.upcomingDynamicFilters))await new Promise(s=>setTimeout(s,t.upcomingDynamicFilterCheckDelayMs)),this.getExpConfig(e.withChange(n,o()),r)}stringify(){let e=this.assignments.getCachedExpConfig(new AB({}));return JSON.stringify(e?.variables??{})}async getFallbackExpAndFilters(){let e=this.makeFilterSettings({}),r=BB(this.ctx),n=await this.getExpConfig(e,r);return{filters:e,exp:n}}disableLogProb(e){return e.filtersAndExp.exp.variables.copilotdisablelogprob??!0}overrideBlockMode(e){return e.filtersAndExp.exp.variables.copilotoverrideblockmode||void 0}customEngine(e){return e.filtersAndExp.exp.variables.copilotcustomengine??""}customEngineTargetEngine(e){return e.filtersAndExp.exp.variables.copilotcustomenginetargetengine}suffixPercent(e){return e.filtersAndExp.exp.variables.CopilotSuffixPercent??uGe.suffix}suffixMatchThreshold(e){return e.filtersAndExp.exp.variables.copilotsuffixmatchthreshold??lGe}cppHeadersEnableSwitch(e){return e.filtersAndExp.exp.variables.copilotcppheadersenableswitch??!1}relatedFilesVSCodeCSharp(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodecsharp??!1}relatedFilesVSCodeTypeScript(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscodetypescript??!1}relatedFilesVSCode(e){return e.filtersAndExp.exp.variables.copilotrelatedfilesvscode??!1}contextProviders(e){let r=e.filtersAndExp.exp.variables.copilotcontextproviders??"";return r?r.split(",").map(n=>n.trim()):[]}contextProviderTimeBudget(e){return e.filtersAndExp.exp.variables.copilotcontextprovidertimebudget??150}includeNeighboringFiles(e){return e.filtersAndExp.exp.variables.copilotincludeneighboringfiles??!1}excludeRelatedFiles(e){return e.filtersAndExp.exp.variables.copilotexcluderelatedfiles??!1}maxPromptCompletionTokens(e){return e.filtersAndExp.exp.variables.maxpromptcompletionTokens??ncn+gSe}ideChatMaxRequestTokens(e){return e.filtersAndExp.exp.variables.idechatmaxrequesttokens??-1}ideChatExpModelIds(e){return e.filtersAndExp.exp.variables.idechatexpmodelids??""}ideChatEnableProjectMetadata(e){return e.filtersAndExp.exp.variables.idechatenableprojectmetadata??!1}ideDataMigrationCompleted(e){return e.filtersAndExp.exp.variables.idedatamigrationcompleted??!1}workspaceContextCoordinator(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcoordinator??!1}workspaceContextCacheTime(e){return e.filtersAndExp.exp.variables.copilotworkspacecontextcachetime??ocn}stableContextPercent(e){return e.filtersAndExp.exp.variables.copilotstablecontextpercent??uGe.stableContext}volatileContextPercent(e){return e.filtersAndExp.exp.variables.copilotvolatilecontextpercent??uGe.volatileContext}cppContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcppContextProviderParams}csharpContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotcsharpcontextproviderparams}javaContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotjavacontextproviderparams}multiLanguageContextProviderParams(e){return e.filtersAndExp.exp.variables.copilotmultilanguagecontextproviderparams}tsContextProviderParams(e){return e.filtersAndExp.exp.variables.copilottscontextproviderparams}completionsDebounce(e){return e.filtersAndExp.exp.variables.copilotcompletionsdebounce}enableElectronFetcher(e){return e.filtersAndExp.exp.variables.copilotelectronfetcher??!1}enableFetchFetcher(e){return e.filtersAndExp.exp.variables.copilotfetchfetcher??!1}asyncCompletionsTimeout(e){return e.filtersAndExp.exp.variables.copilotasynccompletionstimeout??200}enablePromptContextProxyField(e){return e.filtersAndExp.exp.variables.copilotenablepromptcontextproxyfield??!1}enableProgressiveReveal(e){return e.filtersAndExp.exp.variables.copilotprogressivereveal??!1}modelAlwaysTerminatesSingleline(e){return e.filtersAndExp.exp.variables.copilotmodelterminatesingleline??!0}longLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressivereveallonglookaheadsize??9}shortLookaheadSize(e){return e.filtersAndExp.exp.variables.copilotprogressiverevealshortlookaheadsize??3}maxMultilineTokens(e){return e.filtersAndExp.exp.variables.copilotmaxmultilinetokens??200}multilineAfterAcceptLines(e){return e.filtersAndExp.exp.variables.copilotmultilineafteracceptlines??1}enableNESXTab(e){return e.filtersAndExp.exp.variables.copilotnesxtab??!1}getNESXTabModelID(e){return e.filtersAndExp.exp.variables.copilotnesxtabmodelid??"copilot-nes-xtab"}completionsDelay(e){return e.filtersAndExp.exp.variables.copilotcompletionsdelay??200}singleLineUnlessAccepted(e){return e.filtersAndExp.exp.variables.copilotsinglelineunlessaccepted??!1}useCompletionsComparisonPanel(e){return e.filtersAndExp.exp.variables.copilotusecompletionscomparisonpanel??!1}comparisonPanelModelIds(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelmodelids??""}comparisonPanelRandomizedMode(e){return e.filtersAndExp.exp.variables.copilotcomparisonpanelrandomizedmode??!0}useChatLibCompletions(e){return e.filtersAndExp.exp.variables.copilotusechatlibcompletions??!1}cveRemediatorAgentEnabled(e){return e.filtersAndExp.exp.variables.cveremediatoragentenabled??!1}instantApplyModelMigration(e){return e.filtersAndExp.exp.variables.copilotinstantapplymodelmigration??!1}appmodContextMenuEnabled(e){return e.filtersAndExp.exp.variables.copilotappmodcontextmenuenabled??!1}searchAgentEnabled(e){return e.filtersAndExp.exp.variables.copilotsearchagentenabled??!1}cliAsDefaultAgentProviderEnabled(e){return e.filtersAndExp.exp.variables.copilotcliasdefaultagentprovider??!1}inlineChatUseCliEnabled(e){return e.filtersAndExp.exp.variables.inlinechatusecli??!1}ideEnableCopilotNesNonFreeEnabled(e){return e.filtersAndExp.exp.variables.ideenablecopilotnes??!1}};async function dGe(t){let e=Ht(t,Je.SearchAgent);if(e==="true")return!0;if(e==="false")return!1;let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments();return r.searchAgentEnabled(n)}a(dGe,"isSearchAgentEnabled");function acn(t,e){let r=Ht(t,Je.EnableCopilotNesNonFree);return r==="true"?!0:r==="false"?!1:t.get(Jt).ideEnableCopilotNesNonFreeEnabled(e)}a(acn,"isIdeEnableCopilotNesNonFreeEnabled");p();p();p();var fGe=fe(Yae());var zLt={python:"python",javascript:"javascript",javascriptreact:"javascript",jsx:"javascript",typescript:"typescript",typescriptreact:"tsx",go:"go",ruby:"ruby",csharp:"c-sharp",java:"java",php:"php",c:"cpp",cpp:"cpp"};function uS(t){return t in zLt&&t!=="csharp"&&t!=="java"&&t!=="php"&&t!=="c"&&t!=="cpp"}a(uS,"isSupportedLanguageId");function pGe(t){if(!(t in zLt))throw new Error(`Unrecognized language: ${t}`);return zLt[t]}a(pGe,"languageIdToWasmLanguage");var WLt=new Map;async function CDo(t){let e;try{e=await Vae(`tree-sitter-${t}.wasm`)}catch(r){throw r instanceof Error&&"code"in r&&typeof r.code=="string"&&r.name==="Error"?new $ae(`Could not load tree-sitter-${t}.wasm`,r):r}return fGe.default.Language.load(e)}a(CDo,"loadWasmLanguage");function KLt(t){let e=pGe(t);if(!WLt.has(e)){let r=CDo(e);WLt.set(e,r)}return WLt.get(e)}a(KLt,"getLanguage");var YLt=class extends Error{static{a(this,"WrappedError")}constructor(e,r){super(e,{cause:r})}};async function I7(t,e){return(await JLt(t,e))[0]}a(I7,"parseTreeSitter");async function JLt(t,e){await fGe.default.init({locateFile:a(s=>CLt(s),"locateFile")});let r;try{r=new fGe.default}catch(s){throw s&&typeof s=="object"&&"message"in s&&typeof s.message=="string"&&s.message.includes("table index is out of bounds")?new YLt(`Could not init Parse for language <${t}>`,s):s}let n=await KLt(t);r.setLanguage(n);let o=r.parse(e);return r.delete(),[o,n.version]}a(JLt,"parseTreeSitterIncludingVersion");function ccn(t){switch(pGe(t)){case"python":return null;case"javascript":case"typescript":case"tsx":case"go":case"c-sharp":case"java":case"php":case"cpp":return"}";case"ruby":return"end"}}a(ccn,"getBlockCloseToken");function bDo(t,e){let r=[];for(let n of t){if(!n[1]){let o=e.tree.getLanguage();n[1]=o.query(n[0])}r.push(...n[1].matches(e))}return r}a(bDo,"innerQuery");var SDo=[`[ (class_definition (block (expression_statement (string)))) (function_definition (block (expression_statement (string)))) -]`];function Icn(t){return wDo([RDo],t).length==1}a(Icn,"queryPythonIsDocstring");var kM=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` +]`];function lcn(t){return bDo([SDo],t).length==1}a(lcn,"queryPythonIsDocstring");var SM=class{constructor(e){this.node=e;this.children=[];this.collapsed=!1}static{a(this,"StatementNode")}addChild(e){e.parent=this,e.nextSibling=void 0,this.children.length>0&&(this.children[this.children.length-1].nextSibling=e),this.children.push(e)}childrenFinished(){}containsStatement(e){return this.node.startIndex<=e.node.startIndex&&this.node.endIndex>=e.node.endIndex}statementAt(e){if(this.node.startIndex>e||this.node.endIndex(r=n.statementAt(e),r!==void 0)),r??this}collapse(){this.children.length=0,this.collapsed=!0}get description(){return`${this.node.type} ([${this.node.startPosition.row},${this.node.startPosition.column}]..[${this.node.endPosition.row},${this.node.endPosition.column}]): ${JSON.stringify(this.node.text.length>33?this.node.text.substring(0,15)+"..."+this.node.text.slice(-15):this.node.text)}`}dump(e="",r=""){let n=[`${e}${this.description}`];return this.children.forEach(o=>{n.push(o.dump(`${r}+- `,o.nextSibling===void 0?`${r} `:`${r}| `))}),n.join(` `)}dumpPath(e="",r="",n=!1){if(this.parent){let o=this.parent.dumpPath(e,r,!0),s=o.length-o.lastIndexOf(` `)-1-r.length,c=" ".repeat(s),l=n?` ${r}${c}+- `:"";return o+this.description+l}else{let o=n?` -${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return oce.languageIds.has(e)||sce.languageIds.has(e)||PSe.languageIds.has(e)||ace.languageIds.has(e)||DSe.languageIds.has(e)||NSe.languageIds.has(e)||MSe.languageIds.has(e)||OSe.languageIds.has(e)||BSe.languageIds.has(e)}static isTrimmedByDefault(e){return oce.languageIds.has(e)||sce.languageIds.has(e)||ace.languageIds.has(e)}static create(e,r,n,o){if(oce.languageIds.has(e))return new oce(e,r,n,o);if(sce.languageIds.has(e))return new sce(e,r,n,o);if(PSe.languageIds.has(e))return new PSe(e,r,n,o);if(ace.languageIds.has(e))return new ace(e,r,n,o);if(MSe.languageIds.has(e))return new MSe(e,r,n,o);if(DSe.languageIds.has(e))return new DSe(e,r,n,o);if(NSe.languageIds.has(e))return new NSe(e,r,n,o);if(OSe.languageIds.has(e))return new OSe(e,r,n,o);if(BSe.languageIds.has(e))return new BSe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await k7(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` +${r}+- `:"";return e+this.description+o}}},Vm=class{constructor(e,r,n,o){this.languageId=e;this.text=r;this.startOffset=n;this.endOffset=o;this.statements=[]}static{a(this,"StatementTree")}static isSupported(e){return Kae.languageIds.has(e)||Jae.languageIds.has(e)||ySe.languageIds.has(e)||Zae.languageIds.has(e)||ESe.languageIds.has(e)||_Se.languageIds.has(e)||vSe.languageIds.has(e)||CSe.languageIds.has(e)||bSe.languageIds.has(e)}static isTrimmedByDefault(e){return Kae.languageIds.has(e)||Jae.languageIds.has(e)||Zae.languageIds.has(e)}static create(e,r,n,o){if(Kae.languageIds.has(e))return new Kae(e,r,n,o);if(Jae.languageIds.has(e))return new Jae(e,r,n,o);if(ySe.languageIds.has(e))return new ySe(e,r,n,o);if(Zae.languageIds.has(e))return new Zae(e,r,n,o);if(vSe.languageIds.has(e))return new vSe(e,r,n,o);if(ESe.languageIds.has(e))return new ESe(e,r,n,o);if(_Se.languageIds.has(e))return new _Se(e,r,n,o);if(CSe.languageIds.has(e))return new CSe(e,r,n,o);if(bSe.languageIds.has(e))return new bSe(e,r,n,o);throw new Error(`Unsupported languageId: ${e}`)}[Symbol.dispose](){this.tree&&(this.tree.delete(),this.tree=void 0)}clear(){this.statements.length=0}statementAt(e){let r;return this.statements.find(n=>(r=n.statementAt(e),r!==void 0)),r}async build(){let e=[];this.clear();let r=await this.parse();this.getStatementQuery(r).captures(r.rootNode,{startPosition:this.offsetToPosition(this.startOffset),endPosition:this.offsetToPosition(this.endOffset)}).forEach(o=>{let s=this.createNode(o.node);for(;e.length>0&&!e[0].containsStatement(s);)e.shift()?.childrenFinished();e.length>0?e[0].addChild(s):this.addStatement(s),e.unshift(s)}),e.forEach(o=>o.childrenFinished())}addStatement(e){e.parent=void 0,e.nextSibling=void 0,this.statements.length>0&&(this.statements[this.statements.length-1].nextSibling=e),this.statements.push(e)}async parse(){return this.tree||(this.tree=await I7(this.languageId,this.text)),this.tree}getStatementQuery(e){return this.getQuery(e.getLanguage(),this.getStatementQueryText())}getQuery(e,r){return e.query(r)}offsetToPosition(e){let r=this.text.slice(0,e).split(` `),n=r.length-1,o=r[r.length-1].length;return{row:n,column:o}}dump(e=""){let r=[];return this.statements.forEach((n,o)=>{let s=`[${o}]`,c=" ".repeat(s.length);r.push(n.dump(`${e} ${s} `,`${e} ${c} `))}),r.join(` -`)}},wGe=class t extends kM{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},oce=class extends $m{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new wGe(e)}getStatementQueryText(){return`[ +`)}},hGe=class t extends SM{static{a(this,"JSStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","generator_function_declaration","class_declaration","statement_block","if_statement","switch_statement","for_statement","for_in_statement","while_statement","do_statement","try_statement","with_statement","labeled_statement","method_definition","interface_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="statement_block"||this.children.length===2&&this.node.childForFieldName("alternative")!==null&&this.children[0].node.type!=="statement_block"&&this.children[1].node.type!=="statement_block"}},Kae=class extends Vm{static{a(this,"JSStatementTree")}static{this.languageIds=new Set(["javascript","javascriptreact","jsx"])}createNode(e){return new hGe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1805,7 +1790,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (field_definition) - ] @statement`}},sce=class extends $m{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new wGe(e)}getStatementQueryText(){return`[ + ] @statement`}},Jae=class extends Vm{static{a(this,"TSStatementTree")}static{this.languageIds=new Set(["typescript","typescriptreact"])}createNode(e){return new hGe(e)}getStatementQueryText(){return`[ (export_statement) (import_statement) (debugger_statement) @@ -1828,7 +1813,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (labeled_statement) (method_definition) (public_field_definition) - ] @statement`}},l3t=class t extends kM{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},PSe=class extends $m{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new l3t(e)}getStatementQueryText(){return`[ + ] @statement`}},ZLt=class t extends SM{static{a(this,"PyStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","for_statement","while_statement","try_statement","with_statement","function_definition","class_definition","decorated_definition","match_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"?!1:this.node.startPosition.row===this.node.endPosition.row}},ySe=class extends Vm{static{a(this,"PyStatementTree")}static{this.languageIds=new Set(["python"])}createNode(e){return new ZLt(e)}getStatementQueryText(){return`[ (future_import_statement) (import_statement) (import_from_statement) @@ -1854,24 +1839,24 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (decorated_definition) (match_statement) (block) - ] @statement`}},u3t=class t extends kM{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},ace=class extends $m{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new u3t(e)}getStatementQueryText(){return`[ + ] @statement`}},XLt=class t extends SM{static{a(this,"GoStatementNode")}static{this.compoundTypeNames=new Set(["function_declaration","method_declaration","if_statement","for_statement","expression_switch_statement","type_switch_statement","select_statement","block"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},Zae=class extends Vm{static{a(this,"GoStatementTree")}static{this.languageIds=new Set(["go"])}createNode(e){return new XLt(e)}getStatementQueryText(){return`[ (package_clause) (function_declaration) (method_declaration) (import_declaration) (_statement) (block) - ] @statement`}},d3t=class t extends kM{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},DSe=class extends $m{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new d3t(e)}getStatementQueryText(){return`[ + ] @statement`}},e3t=class t extends SM{static{a(this,"PhpStatementNode")}static{this.compoundTypeNames=new Set(["if_statement","else_clause","else_if_clause","for_statement","foreach_statement","while_statement","do_statement","switch_statement","try_statement","catch_clause","finally_clause","anonymous_function","compound_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},ESe=class extends Vm{static{a(this,"PhpStatementTree")}static{this.languageIds=new Set(["php"])}createNode(e){return new e3t(e)}getStatementQueryText(){return`[ (statement) (compound_statement) (method_declaration) (property_declaration) (const_declaration) (use_declaration) - ] @statement`}},f3t=class t extends kM{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},NSe=class extends $m{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new f3t(e)}getStatementQueryText(){return`[ + ] @statement`}},t3t=class t extends SM{static{a(this,"RubyStatementNode")}static{this.compoundTypeNames=new Set(["if","case","while","until","for","begin","module","class","method"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}},_Se=class extends Vm{static{a(this,"RubyStatementTree")}static{this.languageIds=new Set(["ruby"])}createNode(e){return new t3t(e)}getStatementQueryText(){return`[ (_statement) (when) - ] @statement`}},p3t=class t extends kM{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},MSe=class extends $m{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new p3t(e)}getStatementQueryText(){return`[ + ] @statement`}},r3t=class t extends SM{static{a(this,"JavaStatementNode")}static{this.compoundTypeNames=new Set(["block","do_statement","enhanced_for_statement","for_statement","if_statement","labeled_statement","switch_expression","synchronized_statement","try_statement","try_with_resources_statement","while_statement","interface_declaration","method_declaration","constructor_declaration","compact_constructor_declaration","class_declaration","annotation_type_declaration","static_initializer"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},vSe=class extends Vm{static{a(this,"JavaStatementTree")}static{this.languageIds=new Set(["java"])}createNode(e){return new r3t(e)}getStatementQueryText(){return`[ (statement) (field_declaration) (record_declaration) @@ -1884,7 +1869,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (block) (static_initializer) (constructor_declaration) - ] @statement`}},h3t=class t extends kM{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},OSe=class extends $m{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new h3t(e)}getStatementQueryText(){return`[ + ] @statement`}},n3t=class t extends SM{static{a(this,"CSharpStatementNode")}static{this.compoundTypeNames=new Set(["block","checked_statement","class_declaration","constructor_declaration","destructor_declaration","do_statement","fixed_statement","for_statement","foreach_statement","if_statement","interface_declaration","lock_statement","method_declaration","struct_declaration","switch_statement","try_statement","unsafe_statement","while_statement"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){this.isSingleLineIfStatement()&&this.collapse()}isSingleLineIfStatement(){return this.node.type!=="if_statement"||this.node.startPosition.row!==this.node.endPosition.row?!1:this.children.length===1&&this.children[0].node.type!=="block"}},CSe=class extends Vm{static{a(this,"CSharpStatementTree")}static{this.languageIds=new Set(["csharp"])}createNode(e){return new n3t(e)}getStatementQueryText(){return`[ (extern_alias_directive) (using_directive) (global_attribute) @@ -1896,7 +1881,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (declaration) (accessor_declaration) (block) - ] @statement`}},m3t=class t extends kM{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},BSe=class extends $m{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new m3t(e)}getStatementQueryText(){return`[ + ] @statement`}},i3t=class t extends SM{static{a(this,"CStatementNode")}static{this.compoundTypeNames=new Set(["declaration","function_definition","enum_specifier","field_declaration_list","type_definition","compound_statement","if_statement","switch_statement","while_statement","for_statement","do_statement","preproc_if","preproc_ifdef","namespace_definition","class_specifier","field_declaration_list","concept_definition","template_declaration"])}get isCompoundStatementType(){return!this.collapsed&&t.compoundTypeNames.has(this.node.type)}childrenFinished(){(this.isSingleLineDeclarationStatement()||this.isSingleLineConceptDefinition())&&this.collapse()}isSingleLineDeclarationStatement(){return!(this.node.type!=="declaration"||this.node.startPosition.row!==this.node.endPosition.row)}isSingleLineConceptDefinition(){return!(this.node.type!=="concept_definition"||this.node.startPosition.row!==this.node.endPosition.row)}},bSe=class extends Vm{static{a(this,"CStatementTree")}static{this.languageIds=new Set(["c","cpp"])}createNode(e){return new i3t(e)}getStatementQueryText(){return`[ (declaration) (function_definition) (type_definition) @@ -1933,11 +1918,57 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (using_declaration) (alias_declaration) (static_assert_declaration) - ] @statement`}};var PM=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return $m.isSupported(e)}static isTrimmedByDefault(e){return $m.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=swt(n,$m.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{awt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var RGe=class extends PM{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexQDo,build:()=>LDo,buildType:()=>FDo,default:()=>VDo,dependencies:()=>HDo,description:()=>ODo,devDependencies:()=>jDo,displayName:()=>MDo,engines:()=>UDo,name:()=>NDo,overrides:()=>GDo,overridesComments:()=>$Do,scripts:()=>qDo,version:()=>BDo});var NDo="copilot",MDo="GitHub Copilot",ODo="Your AI pair programmer",BDo="1.503.0",LDo="28",FDo="prod",UDo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},QDo={cliPackageVersion:"2.1.159"},qDo={postinstall:"tsx script/copyCopilotSdkFiles.ts",build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},jDo={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^21.0.1","@types/vscode":"1.120.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.20.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.4.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.6.0","js-yaml":"^4.1.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.39.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.2.0",tsx:"^4.22.3",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},HDo={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.56","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.49","@vscode/chat-lib":"^0.51.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.7","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.2.0",microjob:"^0.7.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.26.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.0",yargs:"^18.0.0"},GDo={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.2",zod:"3.25.76"},$Do={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},VDo={name:NDo,displayName:MDo,description:ODo,version:BDo,build:LDo,buildType:FDo,engines:UDo,anthropicClaude:QDo,scripts:qDo,devDependencies:jDo,dependencies:HDo,overrides:GDo,overridesComments:$Do};var je={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",TransparentTokenRefresh:"internal.auth.transparentTokenRefresh",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function kcn(t){return["server","parsingandserver"].includes(t)}a(kcn,"shouldDoServerTrimming");var eP=class{static{a(this,"BlockModeConfig")}},cce=class extends eP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Jt).overrideBlockMode(n);if(o)return g3t(o,r);let s=e.get(Jt).enableProgressiveReveal(n);return(qt(e,je.AlwaysRequestMultiline)??s)||PM.isTrimmedByDefault(r)?g3t("moremultiline",r):r=="ruby"?"parsing":AS(r)?"parsingandserver":"server"}};function WDo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(WDo,"blockModeRequiresTreeSitter");function g3t(t,e){return t==="moremultiline"&&$m.isSupported(e)?t:WDo(t)&&!AS(e)?"server":t}a(g3t,"toApplicableBlockMode");var Zo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},lce=class extends Zo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return zDo(r)}getOptionalConfig(r){return YDo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Jz=class extends Zo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new no;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new no;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=LSe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[je.ShowEditorCompletions,je.EnableAutoCompletions,je.DelayCompletions,je.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Pcn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Pcn,"getConfigKeyRecursively");function zDo(t){if(kGe.has(t))return kGe.get(t);throw new Error(`Missing config default value: ${cwt}.${t}`)}a(zDo,"getConfigDefaultForKey");function YDo(t){return kGe.get(t)}a(YDo,"getOptionalConfigDefaultForKey");function uce(t){return t.get(Zo).getExplicitlySetConfigs()}a(uce,"getExplicitlySetConfigs");var KDo={[je.DebugOverrideCppHeadersEnableSwitch]:!1,[je.RelatedFilesVSCodeCSharp]:!1,[je.RelatedFilesVSCodeTypeScript]:!1,[je.RelatedFilesVSCode]:!1,[je.IncludeNeighboringFiles]:!1,[je.ExcludeRelatedFiles]:!1,[je.ContextProviders]:[],[je.DebugUseEditorFetcher]:null,[je.DebugUseElectronFetcher]:null,[je.DebugOverrideLogLevels]:{},[je.DebugSnippyOverrideUrl]:"",[je.AgentDebugLogsDirectory]:void 0,[je.ClaudeCliPath]:void 0,[je.FetchStrategy]:"auto",[je.ToolConfirmAutoApprove]:!1,[je.AutoApproveUnmatchedTerminal]:void 0,[je.AutoApproveUnmatchedFileOp]:void 0,[je.TrustToolAnnotations]:!1,[je.AutoApproveYoloMode]:!1,[je.EditorHandlesAllConfirmation]:!1,[je.MaxToolCallingLoop]:25,[je.AutoCompress]:!1,[je.AnthropicThinkingBudgetToken]:1024,[je.EnableSkills]:!1,[je.EnableHooks]:!1,[je.EnableCustomAgents]:!0,[je.EnableOrgCustomAgents]:!0,[je.UseAgentsMd]:!1,[je.UseNestedAgentsMd]:!1,[je.UseClaudeMd]:!1,[je.UseNestedClaudeMd]:!1,[je.UseSubsetMatching]:null,[je.ContextProviderTimeBudget]:void 0,[je.DebugOverrideCapiUrl]:"",[je.DebugTestOverrideCapiUrl]:"",[je.DebugOverrideProxyUrl]:"",[je.DebugTestOverrideProxyUrl]:"",[je.DebugOverrideEngine]:"",[je.AlwaysRequestMultiline]:void 0,[je.ModelAlwaysTerminatesSingleline]:void 0,[je.TrimCompletionsAggressively]:void 0,[je.CompletionsDebounce]:void 0,[je.NESXTab]:void 0,[je.UseWorkspaceContextCoordinator]:void 0,[je.ShowWorkspaceContextDebugger]:!1,[je.CompletionsDelay]:void 0,[je.UseSplitContextPrompt]:void 0,[je.UseCompletionsComparisonPanel]:void 0,[je.ComparisonPanelModelIds]:void 0,[je.ComparisonPanelRandomizedMode]:void 0,[je.UseFetchFetcher]:void 0,[je.UseChatLibCompletions]:void 0,[je.TranscriptDirectory]:void 0,[je.EnableThinking]:!0,[je.ShowEditorCompletions]:void 0,[je.EnableAutoCompletions]:void 0,[je.DelayCompletions]:void 0,[je.FilterCompletions]:void 0,[je.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[je.UserSelectedCompletionModel]:"",[je.DebugFilterLogCategories]:[],[je.DebugOverrideEngineLegacy]:"",[je.DebugTestOverrideProxyUrlLegacy]:"",[je.DebugOverrideProxyUrlLegacy]:"",[je.DebugTestOverrideCapiUrlLegacy]:"",[je.DebugOverrideCapiUrlLegacy]:"",[je.HookErrorOccurredStackTrace]:!1,[je.NESUseExplicitRejection]:!1,[je.AppendPromptTokenCache]:"",[je.PromptPersistBasePath]:void 0,[je.AnthropicMessagesEndpoint]:"",[je.EnableCopilotNesNonFree]:"",[je.UseHelixFetcher]:"",[je.EnableMapCodeFallback]:"enabled",[je.SearchAgent]:"",[je.PerfEnabled]:"",[je.NESExtendedRange]:!1,[je.TransparentTokenRefresh]:"",[je.DisableWorkspaceIndex]:""},kGe=new Map(Object.entries(KDo));for(let t of Object.values(je))if(!kGe.has(t))throw new Error(`Missing config default value ${cwt}.${t}`);function qt(t,e){return t.get(Zo).getConfig(e)}a(qt,"getConfig");function jL(t){return qt(t,je.DisableWorkspaceIndex)==="true"}a(jL,"isWorkspaceIndexDisabled");function pWr(t){return t.get(Zo).dumpForTelemetry()}a(pWr,"dumpForTelemetry");var ss=class{constructor(){this.packageJson=FSe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function hPt(t){return t.get(ss).isProduction()}a(hPt,"isProduction");function CZr(t){return t.get(ss).getBuildType()==="dev"}a(CZr,"isDevBuild");function J9(t){return t.get(ss).getBuildType()}a(J9,"getBuildType");function hWr(t){return t.get(ss).getBuild()}a(hWr,"getBuild");function N1(t){return t.get(ss).getVersion()}a(N1,"getVersion");var Fa=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function C1({name:t,version:e}){return`${t}/${e}`}a(C1,"formatNameAndVersion");var Lr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return f9r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}};function by(t){let e=t.get(Lr);return{"Editor-Version":C1(e.getEditorInfo()),"Editor-Plugin-Version":C1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":N1(t)}}a(by,"editorVersionHeaders");var Dcn="Iv1.b507a08c87ecfe98",JDo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Vse="Ov23liV9UpD7Rnfnskm3",ZDo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",XDo={[Dcn]:JDo,[Vse]:ZDo},Bp=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??Dcn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=XDo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};var ar=class{static{a(this,"Fetcher")}getImplementation(){return this}};function P7(t,e,r,n,o,s,c,l,u,d,f,h){let m={...l,Authorization:`Bearer ${r}`,...by(t)};d===void 0&&(m["Openai-Organization"]="github-copilot",m["X-Request-Id"]=o,m["VScode-SessionId"]=t.get(Fa).sessionId,m["VScode-MachineId"]=t.get(Fa).machineId,m["X-GitHub-Api-Version"]="2026-01-09"),n&&(m["OpenAI-Intent"]=n);let g={method:"POST",headers:m,json:s,timeout:u};f&&h&&f.logRequest({timestamp:new Date().toISOString(),requestId:o,method:"POST",url:e,headers:m,messages:h,body:s});let A=t.get(ar);if(c){let E=new AbortController;c.onCancellationRequested(()=>{ht(t,"networking.cancelRequest",jt.createAndMarkAsIssued({headerRequestId:o})),E.abort()}),g.signal=E.signal}return A.fetch(e,g).catch(E=>{if(eNo(E))return ht(t,"networking.disconnectAll"),A.disconnectAll().then(()=>A.fetch(e,g));throw E})}a(P7,"postRequest");function eNo(t){return t instanceof Error?t.message=="ERR_HTTP2_GOAWAY_SESSION"?!0:"code"in t?t.code=="ECONNRESET"||t.code=="ETIMEDOUT"||t.code=="ERR_HTTP2_INVALID_SESSION":!1:!1}a(eNo,"isInterruptedNetworkError");var tNo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function rNo(t){return tNo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(rNo,"isOomError");function D7(t,e,r,n=Dr){if(!P0(e)){if(e instanceof Error){let o=e;rNo(o)?t.get(as).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(as).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(as).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(as).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(as).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a(D7,"handleException");function Ncn(t){process.addListener("uncaughtException",r=>{D7(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,D7(t,r,"unhandledRejection")}finally{e=!1}})}a(Ncn,"registerDefaultHandlers");async function Mcn(t){try{await SSe}catch(e){D7(t,e,"initializeTokenizers")}}a(Mcn,"waitForTokenizers");p();p();p();var HL={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var Ocn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],Bcn={".php":[".blade"]},N7=Object.keys(HL).flatMap(t=>HL[t].extensions);var A3t=ce(require("node:path"));var fce=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},USe=class{static{a(this,"LanguageDetection")}},y3t=new Map,dce=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(HL)){for(let n of e)y3t.set(n,[...y3t.get(n)??[],t]);for(let n of r??[])dce.set(n,[...dce.get(n)??[],t])}var E3t=class extends USe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=ji(e.uri),n=A3t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new fce(s.languageId,s.isGuess,c):new fce(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(Ocn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=A3t.extname(n).toLowerCase();if(o.length>0&&N7.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=Bcn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(dce.has(e))return{languageId:dce.get(e)[0],isGuess:!1};let n=y3t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),dce.has(e))return{languageId:dce.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},_3t=class extends USe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new fce("cpp",n.isGuess,n.fileExtension):n}},C3t=class extends USe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new fce(r.languageId,!0,""):this.delegate.detectLanguage(r)}},nNo=new _3t(new C3t(new E3t));function DM({uri:t,languageId:e}){let r=nNo.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(DM,"detectLanguage");p();p();p();p();function Nh(t){if(t.isCancellationRequested)throw new PGe}a(Nh,"throwIfCancellationRequested");function tP(t){return t instanceof PGe?!0:t instanceof Error&&t.name===v3t&&t.message===v3t}a(tP,"isCancellationError");var PGe=class extends Error{static{a(this,"CancellationError")}constructor(){super(v3t),this.name=this.message}},v3t="Canceled",DGe=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function Zz(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(Zz,"isTypeDefinition");var cu=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=Fcn(e,e.length,o),Lcn(n,r);o0}};var mGe=class extends TM{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndexo&&c.node.endIndexODo,build:()=>DDo,buildType:()=>NDo,default:()=>qDo,dependencies:()=>FDo,description:()=>PDo,devDependencies:()=>LDo,displayName:()=>RDo,engines:()=>MDo,name:()=>wDo,overrides:()=>UDo,overridesComments:()=>QDo,scripts:()=>BDo,version:()=>kDo});var wDo="copilot",RDo="GitHub Copilot",PDo="Your AI pair programmer",kDo="1.506.0",DDo="35",NDo="prod",MDo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},ODo={cliPackageVersion:"2.1.159"},BDo={postinstall:"tsx script/copyCopilotSdkFiles.ts && tsx script/chatLibPatch/patchChatLib.ts",build:"tsx esbuild.ts && tsx script/chatLibPatch/verifyChatLibPatch.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},LDo={"@azure/identity":"^4.13.1","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.7.1","@types/sinon":"^21.0.1","@types/vscode":"1.120.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.20.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^17.4.2",esbuild:"^0.28.0","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.4","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.6.0","js-yaml":"^4.2.0",mocha:"^11.2.2","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^6.39.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.0.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.2.0",tsx:"^4.22.3",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},FDo={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.56","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/tiktokenizer":"^1.0.10","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.3","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.5.6","@sinclair/typebox":"^0.34.49","@vscode/chat-lib":"0.51.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.3.7","@vscode/prompt-tsx":"^0.4.0-alpha.8","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^14.2.0",minimatch:"^10.2.5",open:"^10.2.0",semver:"^7.8.1",shiki:"~1.15.0","source-map-support":"^0.5.21",undici:"^7.26.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.0",yargs:"^18.0.0"},UDo={fsevents:"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.11","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.2",zod:"3.25.76"},QDo={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath). Pulled in by node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.11. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133.",zod:"Type-resolution hack: pin to 3.25.76 so the v3 API at root 'zod' (used by @github/copilot/sdk's zod-3-authored .d.ts via `import * as z from 'zod'`) and the v4 API at the 'zod/v4' subpath (used by @anthropic-ai/claude-agent-sdk via `import { z } from 'zod/v4'`) resolve from a single zod install. Without this, @anthropic-ai/claude-agent-sdk's strict `\"zod\": \"^4.0.0\"` requirement makes npm install zod 4.x, which causes z.infer in @github/copilot/sdk types to collapse to 'unknown' (TS18046 in lib/src/backgroundAgent/*). zod 3.25+ ships both APIs (root = v3, /v4 subpath = v4) so both consumers work from one install. Mirrors the same workaround used by vscode-copilot-chat. Drop when @github/copilot publishes zod-4-compatible types OR @anthropic-ai/claude-agent-sdk relaxes its zod requirement to '^3.25.0 || ^4.0.0'."},qDo={name:wDo,displayName:RDo,description:PDo,version:kDo,build:DDo,buildType:NDo,engines:MDo,anthropicClaude:ODo,scripts:BDo,devDependencies:LDo,dependencies:FDo,overrides:UDo,overridesComments:QDo};var Je={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableHooks:"agent.enableHooks",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",NESExtendedRange:"nextEditSuggestions.extendedRange",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",EnableCopilotNesNonFree:"internal.enableCopilotNesNonFree",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",TransparentTokenRefresh:"internal.auth.transparentTokenRefresh",AuthTokenEncryption:"internal.auth.tokenEncryption",DisableWorkspaceIndex:"internal.disableWorkspaceIndex"};function pcn(t){return["server","parsingandserver"].includes(t)}a(pcn,"shouldDoServerTrimming");var JP=class{static{a(this,"BlockModeConfig")}},Xae=class extends JP{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(Jt).overrideBlockMode(n);if(o)return o3t(o,r);let s=e.get(Jt).enableProgressiveReveal(n);return(Ht(e,Je.AlwaysRequestMultiline)??s)||TM.isTrimmedByDefault(r)?o3t("moremultiline",r):r=="ruby"?"parsing":uS(r)?"parsingandserver":"server"}};function jDo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(jDo,"blockModeRequiresTreeSitter");function o3t(t,e){return t==="moremultiline"&&Vm.isSupported(e)?t:jDo(t)&&!uS(e)?"server":t}a(o3t,"toApplicableBlockMode");var Yo=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},ece=class extends Yo{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return HDo(r)}getOptionalConfig(r){return GDo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},Hz=class extends Yo{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new no;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new no;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=SSe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[Je.ShowEditorCompletions,Je.EnableAutoCompletions,Je.DelayCompletions,Je.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function hcn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(hcn,"getConfigKeyRecursively");function HDo(t){if(gGe.has(t))return gGe.get(t);throw new Error(`Missing config default value: ${Kxt}.${t}`)}a(HDo,"getConfigDefaultForKey");function GDo(t){return gGe.get(t)}a(GDo,"getOptionalConfigDefaultForKey");function tce(t){return t.get(Yo).getExplicitlySetConfigs()}a(tce,"getExplicitlySetConfigs");var $Do={[Je.DebugOverrideCppHeadersEnableSwitch]:!1,[Je.RelatedFilesVSCodeCSharp]:!1,[Je.RelatedFilesVSCodeTypeScript]:!1,[Je.RelatedFilesVSCode]:!1,[Je.IncludeNeighboringFiles]:!1,[Je.ExcludeRelatedFiles]:!1,[Je.ContextProviders]:[],[Je.DebugUseEditorFetcher]:null,[Je.DebugUseElectronFetcher]:null,[Je.DebugOverrideLogLevels]:{},[Je.DebugSnippyOverrideUrl]:"",[Je.AgentDebugLogsDirectory]:void 0,[Je.ClaudeCliPath]:void 0,[Je.FetchStrategy]:"auto",[Je.ToolConfirmAutoApprove]:!1,[Je.AutoApproveUnmatchedTerminal]:void 0,[Je.AutoApproveUnmatchedFileOp]:void 0,[Je.TrustToolAnnotations]:!1,[Je.AutoApproveYoloMode]:!1,[Je.EditorHandlesAllConfirmation]:!1,[Je.MaxToolCallingLoop]:25,[Je.AutoCompress]:!1,[Je.AnthropicThinkingBudgetToken]:1024,[Je.EnableSkills]:!1,[Je.EnableHooks]:!1,[Je.EnableCustomAgents]:!0,[Je.EnableOrgCustomAgents]:!0,[Je.UseAgentsMd]:!1,[Je.UseNestedAgentsMd]:!1,[Je.UseClaudeMd]:!1,[Je.UseNestedClaudeMd]:!1,[Je.UseSubsetMatching]:null,[Je.ContextProviderTimeBudget]:void 0,[Je.DebugOverrideCapiUrl]:"",[Je.DebugTestOverrideCapiUrl]:"",[Je.DebugOverrideProxyUrl]:"",[Je.DebugTestOverrideProxyUrl]:"",[Je.DebugOverrideEngine]:"",[Je.AlwaysRequestMultiline]:void 0,[Je.ModelAlwaysTerminatesSingleline]:void 0,[Je.TrimCompletionsAggressively]:void 0,[Je.CompletionsDebounce]:void 0,[Je.NESXTab]:void 0,[Je.UseWorkspaceContextCoordinator]:void 0,[Je.ShowWorkspaceContextDebugger]:!1,[Je.CompletionsDelay]:void 0,[Je.UseSplitContextPrompt]:void 0,[Je.UseCompletionsComparisonPanel]:void 0,[Je.ComparisonPanelModelIds]:void 0,[Je.ComparisonPanelRandomizedMode]:void 0,[Je.UseFetchFetcher]:void 0,[Je.UseChatLibCompletions]:void 0,[Je.TranscriptDirectory]:void 0,[Je.EnableThinking]:!0,[Je.ShowEditorCompletions]:void 0,[Je.EnableAutoCompletions]:void 0,[Je.DelayCompletions]:void 0,[Je.FilterCompletions]:void 0,[Je.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[Je.UserSelectedCompletionModel]:"",[Je.DebugFilterLogCategories]:[],[Je.DebugOverrideEngineLegacy]:"",[Je.DebugTestOverrideProxyUrlLegacy]:"",[Je.DebugOverrideProxyUrlLegacy]:"",[Je.DebugTestOverrideCapiUrlLegacy]:"",[Je.DebugOverrideCapiUrlLegacy]:"",[Je.HookErrorOccurredStackTrace]:!1,[Je.NESUseExplicitRejection]:!1,[Je.AppendPromptTokenCache]:"",[Je.PromptPersistBasePath]:void 0,[Je.AnthropicMessagesEndpoint]:"",[Je.EnableCopilotNesNonFree]:"",[Je.UseHelixFetcher]:"",[Je.EnableMapCodeFallback]:"enabled",[Je.SearchAgent]:"",[Je.PerfEnabled]:"",[Je.NESExtendedRange]:!1,[Je.TransparentTokenRefresh]:"",[Je.AuthTokenEncryption]:"",[Je.DisableWorkspaceIndex]:""},gGe=new Map(Object.entries($Do));for(let t of Object.values(Je))if(!gGe.has(t))throw new Error(`Missing config default value ${Kxt}.${t}`);function Ht(t,e){return t.get(Yo).getConfig(e)}a(Ht,"getConfig");function ZP(t){return Ht(t,Je.DisableWorkspaceIndex)==="true"}a(ZP,"isWorkspaceIndexDisabled");function WVr(t){return t.get(Yo).dumpForTelemetry()}a(WVr,"dumpForTelemetry");var os=class{constructor(){this.packageJson=TSe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function rkt(t){return t.get(os).isProduction()}a(rkt,"isProduction");function ZJr(t){return t.get(os).getBuildType()==="dev"}a(ZJr,"isDevBuild");function G9(t){return t.get(os).getBuildType()}a(G9,"getBuildType");function zVr(t){return t.get(os).getBuild()}a(zVr,"getBuild");function I1(t){return t.get(os).getVersion()}a(I1,"getVersion");var Oa=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function h1({name:t,version:e}){return`${t}/${e}`}a(h1,"formatNameAndVersion");var Nr=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return $6r({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function xy(t){let e=t.get(Nr);return{"Editor-Version":h1(e.getEditorInfo()),"Editor-Plugin-Version":h1(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":I1(t)}}a(xy,"editorVersionHeaders");var mcn="Iv1.b507a08c87ecfe98",VDo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Lse="Ov23liV9UpD7Rnfnskm3",WDo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",zDo={[mcn]:VDo,[Lse]:WDo},Up=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??mcn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=zDo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};p();var YDo=new Ae("expConfigManager"),KDo=3600*1e3,IM=class{constructor(e,r){this.ctx=e;this.fetchedAt=0;r.onDidChangeTokenResult(n=>{n.copilotToken&&this.refresh({force:!0})})}static{a(this,"ExpConfigManager")}getBoolean(e){let r=this.cached?.variables[e];return typeof r=="boolean"?r:void 0}getNumber(e){let r=this.cached?.variables[e];return typeof r=="number"?r:void 0}getString(e){let r=this.cached?.variables[e];return typeof r=="string"?r:void 0}getRaw(e){return this.cached?.variables[e]}refresh({force:e=!1}={}){return this.inflight?this.inflight:!e&&this.cached!==void 0&&Date.now()-this.fetchedAt{try{let{exp:r}=await this.ctx.get(Jt).getFallbackExpAndFilters();this.cached=r,this.fetchedAt=Date.now()}catch(r){YDo.exception(this.ctx,r,".refresh")}finally{this.inflight=void 0}})(),this.inflight)}};function XJr(t){let e=Ht(t,Je.TransparentTokenRefresh);if(e==="true")return{value:!0,source:"config"};if(e==="false")return{value:!1,source:"config"};let r=t.get(IM).getBoolean("copilottransparenttokenrefresh");return typeof r=="boolean"?{value:r,source:"exp"}:{value:!1,source:"default"}}a(XJr,"resolveTransparentTokenRefresh");function gcn(t){return Ht(t,Je.AuthTokenEncryption)==="false"}a(gcn,"isAuthTokenEncryptionDisabled");p();var bcn=fe(require("node:crypto"));var s3t=new Ae("KeytarMasterKey"),Ecn="copilot-language-server",_cn="oauth-token-key",vcn=5e3,Scn=32,a3t;function XDo(t){return a3t??=eNo(t).finally(()=>{a3t=void 0}),a3t}a(XDo,"resolveMasterKey");async function eNo(t){let e;try{e=await l3t.loadKeytar()}catch(n){return s3t.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:c3t("loadModule",n)}}let r;try{r=await rNo(e)}catch(n){return n instanceof AGe?(s3t.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:c3t("corruptExistingEntry",n)}):(s3t.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:c3t("getOrCreateMasterKey",n)})}return{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(eNo,"doResolveMasterKey");function tNo(){return Promise.resolve().then(()=>fe(ycn()))}a(tNo,"loadKeytar");var l3t={resolveMasterKey:XDo,loadKeytar:tNo};async function rNo(t){let e=await Ccn(t.getPassword(Ecn,_cn),vcn,"getMasterKey");if(e){let n=nNo(e);if(n)return{key:n,source:"useExisting"};throw new AGe}let r=bcn.randomBytes(Scn);return await Ccn(t.setPassword(Ecn,_cn,r.toString("base64")),vcn,"setMasterKey"),{key:r,source:"createNew"}}a(rNo,"getOrCreateMasterKey");function Ccn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(Ccn,"withTimeout");var AGe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function c3t(t,e){return{available:!1,errorPhase:t,error:e}}a(c3t,"unavailable");function nNo(t){let e=Buffer.from(t,"base64");return e.length===Scn?e:void 0}a(nNo,"decodeMasterKey");p();var rce=fe(require("node:crypto"));var f3t=0,iNo=1,Gz=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},EGe=class{static{a(this,"SecretCodec")}},d3t=class extends EGe{constructor(){super(...arguments);this.schemaVersion=f3t}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},yGe=12,u3t=16,Tcn=32,_Ge=class extends EGe{constructor(r){super();this.key=r;this.schemaVersion=iNo;if(r.length!==Tcn)throw new Error(`AesGcmCodec requires a ${Tcn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=rce.randomBytes(yGe),o=rce.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length{let c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s.ciphertext,s.schemaVersion,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();PV(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();PV(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(r=-1){let n=this.stmts.selectAllTokensByRecency.all(r),o=[];for(let s of n){let c=await this.toStoredTokenRecordOrPurge(s);c&&o.push(c)}return o}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?await this.toStoredTokenRecordOrPurge(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all(-1).map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return PV(this.db,()=>{let o=this.stmts.deleteActiveSessionsForTokenReturning.all(r),s=this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of o)this.stmts.insertSignoutTombstone.run(c,n);return{affectedEditors:o.length,tokenDeleted:Number(s.changes)===1}})}async touchActiveSession(r){let n=Date.now();PV(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}async upgradePlaintextRows(){let r=this.stmts.selectPlaintextTokenRows.all(),n=0,o=0,s=0;for(let c of r){let l;try{let d=this.secretStorage.unwrap({schemaVersion:f3t,ciphertext:c.token_ciphertext});l=this.secretStorage.wrap(d)}catch{o++;continue}let u=PV(this.db,()=>this.stmts.updateTokenCiphertext.run(l.ciphertext,l.schemaVersion,c.token_id));Number(u.changes)===1?n++:s++}return{attempted:r.length,upgraded:n,failed:o,skipped:s}}async toStoredTokenRecordOrPurge(r){try{let n=this.secretStorage.unwrap({schemaVersion:r.token_schema_version,ciphertext:r.token_ciphertext});return{tokenId:r.token_id,sourceEditorId:r.source_editor_id,record:{user:r.user_login,accessToken:n,authAuthority:r.auth_authority,oauthClientId:r.oauth_client_id,scopes:r.scopes}}}catch(n){n instanceof Gz&&n.kind==="tagMismatch"&&this.deleteTokenCascade(r.token_id).then(({affectedEditors:o,tokenDeleted:s})=>{s&&(xcn.warn(this.ctx,`purged token after AES unwrap failure (tagMismatch) tokenId=${r.token_id} affectedEditors=${o}`),Ibe(this.ctx,{editorId:r.source_editor_id,trigger:"unwrap_failure",affectedEditors:o}))}).catch(o=>xcn.error(this.ctx,`cleanup after AES unwrap failure failed tokenId=${r.token_id} (row may be preserved, will retry on next read)`,o));return}}};var Rcn=fe(require("fs")),p3t=fe(require("node:sqlite")),Pcn=fe(require("path"));var OL=new Ae("AuthRepoInit");function nce(){return typeof performance<"u"?performance.now():Date.now()}a(nce,"nowMs");function wcn(t){try{t.close()}catch{}}a(wcn,"safeClose");function oNo(t){let e=nce(),r={durationMs:0};try{Rcn.mkdirSync(Pcn.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=nce()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new p3t.default.DatabaseSync(t)}catch(o){return r.durationMs=nce()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{zxt(n)}catch(o){return r.durationMs=nce()-e,r.errorPhase="applyPragmas",r.error=o,wcn(n),{db:void 0,diagnostics:r}}try{Yxt(n)}catch(o){return r.durationMs=nce()-e,r.errorPhase="applySchema",r.error=o,wcn(n),{db:void 0,diagnostics:r}}return r.durationMs=nce()-e,{db:n,diagnostics:r}}a(oNo,"tryOpenAuthDb");function sNo(t,e){let r=new p3t.default.DatabaseSync(":memory:");return zxt(r),Yxt(r),new ISe(t,r,e)}a(sNo,"openInMemoryAuthRepo");function kcn(t,e,r){let{db:n,diagnostics:o}=oNo(e);return n?{repo:new ISe(t,n,r),diagnostics:{...o,repoKind:"sqlite"}}:{repo:sNo(t,r),diagnostics:{...o,repoKind:"memory"}}}a(kcn,"buildAuthRepository");function Dcn(t,e){if(e.repoKind==="memory"){OL.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(Hs).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{OL.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){OL.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(Dcn,"reportAuthRepoFallbackNotice");function Ncn(t,e){HJr(t,e)}a(Ncn,"reportAuthRepoTelemetry");async function h3t(t){let e=t.get(ML),r=t.get(Hf);if(gcn(t)){OL.info(t,"secret-store: encryption disabled by config; pinning writes to plaintext v0");let c={available:!1,errorPhase:"disabledByConfig"};return r.onInitialized(()=>bQe(t,{writerKind:"plaintext",diagnostics:c})),{diagnostics:c}}let{masterKey:n,diagnostics:o}=await l3t.resolveMasterKey(t);if(!n)return cNo(t,o),r.onInitialized(()=>bQe(t,{writerKind:"plaintext",diagnostics:o})),{diagnostics:o};let s=new _Ge(n);return e.addReader(s),e.setWriter(s),r.onInitialized(()=>bQe(t,{writerKind:"aes-gcm",diagnostics:o})),setImmediate(()=>{aNo(t,r)}),{diagnostics:o}}a(h3t,"initializeSecretStorage");async function aNo(t,e){try{let r=await t.get(OI).upgradePlaintextRows();OL.info(t,"secret-store v0->v1 upgrade pass completed",r),r.attempted>0&&e.onInitialized(()=>GNt(t,{result:r}))}catch(r){OL.error(t,"secret-store v0->v1 upgrade pass threw",r),e.onInitialized(()=>GNt(t,{error:r}))}}a(aNo,"runPlaintextUpgradePass");function cNo(t,e){OL.info(t,`secret-store fallback: tokens stored in plaintext on disk (no OS keychain available; phase=${e.errorPhase??"n/a"})`);try{t.get(Hs).showWarningMessageOnlyOnce("auth.secretStorage.plaintextFallback","GitHub Copilot could not access the OS keychain. OAuth tokens are stored in plaintext on disk.").catch(r=>{OL.info(t,"reportSecretStorageFallbackNotice: notification failed",r)})}catch(r){OL.info(t,"reportSecretStorageFallbackNotice: notification skipped",r)}}a(cNo,"reportSecretStorageFallbackNotice");p();p();var lNo=new Set(["ERR_WORKER_OUT_OF_MEMORY","ENOMEM"]);function uNo(t){return lNo.has(t.code??"")||t.name==="RangeError"&&t.message==="WebAssembly.Memory(): could not allocate memory"}a(uNo,"isOomError");function $z(t,e,r,n=Dr){if(!D0(e)){if(e instanceof Error){let o=e;uNo(o)?t.get(ss).setWarning("cls",{message:"Out of memory"}):o.code==="EMFILE"||o.code==="ENFILE"?t.get(ss).setWarning("cls",{message:"Too many open files"}):o.code==="CopilotPromptLoadFailure"?t.get(ss).setWarning("cls",{message:"Corrupted Copilot installation"}):`${o.code}`.startsWith("CopilotPromptWorkerExit")?t.get(ss).setWarning("cls",{message:"Worker unexpectedly exited"}):o.syscall==="uv_cwd"&&o.code==="ENOENT"&&t.get(ss).setWarning("cls",{message:"Current working directory does not exist"})}n.exception(t,e,r)}}a($z,"handleException");function Mcn(t){process.addListener("uncaughtException",r=>{$z(t,r,"uncaughtException")});let e=!1;process.addListener("unhandledRejection",r=>{if(!e)try{e=!0,$z(t,r,"unhandledRejection")}finally{e=!1}})}a(Mcn,"registerDefaultHandlers");var vfn=new Ae("chatLibTokenizers"),Cfn=!1;function bfn(t){if(Cfn)return;Cfn=!0;let e=a(n=>t?vfn.info(t,n):console.error(`[chat-lib-tokenizer] ${n}`),"logInfo"),r=a(n=>t?vfn.warn(t,n):console.error(`[chat-lib-tokenizer] ${n}`),"logWarn");try{let n=fFt();typeof n.setExternalTokenizerProvider=="function"?(n.setExternalTokenizerProvider({getTokenizer:Cs,ensureLoaded:OLt}),e("Successfully injected CLS getTokenizer into chat-lib (vendored)")):r("chat-lib vendored tokenizer loaded but setExternalTokenizerProvider missing")}catch(n){r(`Could not require chat-lib vendored tokenizer: ${String(n)}`)}try{let n=J7();typeof n.setExternalNativeTokenizerProvider=="function"?(n.setExternalNativeTokenizerProvider({ensureLoaded:OLt,getEncoder:han}),e("Successfully injected CLS native encoder provider into chat-lib (native)")):r("chat-lib native tokenizer loaded but setExternalNativeTokenizerProvider missing")}catch(n){r(`Could not require chat-lib native tokenizer: ${String(n)}`)}}a(bfn,"wireChatLibTokenizers");function Sfn(){b7("o200k_base").catch(()=>{})}a(Sfn,"prewarmTokenizers");p();p();p();var ZL={abap:{extensions:[".abap"]},aspdotnet:{extensions:[".asax",".ascx",".ashx",".asmx",".aspx",".axd"]},bat:{extensions:[".bat",".cmd"]},bibtex:{extensions:[".bib",".bibtex"]},blade:{extensions:[".blade",".blade.php"]},BluespecSystemVerilog:{extensions:[".bsv"]},c:{extensions:[".c",".cats",".h",".h.in",".idc"]},csharp:{extensions:[".cake",".cs",".cs.pp",".csx",".linq"]},cpp:{extensions:[".c++",".cc",".cp",".cpp",".cppm",".cxx",".h",".h++",".hh",".hpp",".hxx",".idl",".inc",".inl",".ino",".ipp",".ixx",".rc",".re",".tcc",".tpp",".txx",".i"]},cobol:{extensions:[".cbl",".ccp",".cob",".cobol",".cpy"]},css:{extensions:[".css",".wxss"]},clojure:{extensions:[".bb",".boot",".cl2",".clj",".cljc",".cljs",".cljs.hl",".cljscm",".cljx",".edn",".hic"],filenames:["riemann.config"]},ql:{extensions:[".ql",".qll"]},coffeescript:{extensions:["._coffee",".cake",".cjsx",".coffee",".iced"],filenames:["Cakefile"]},cuda:{extensions:[".cu",".cuh"]},dart:{extensions:[".dart"]},dockerfile:{extensions:[".containerfile",".dockerfile"],filenames:["Containerfile","Dockerfile"]},dotenv:{extensions:[".env"],filenames:[".env",".env.ci",".env.dev",".env.development",".env.development.local",".env.example",".env.local",".env.prod",".env.production",".env.sample",".env.staging",".env.test",".env.testing"]},html:{extensions:[".ect",".ejs",".ejs.t",".jst",".hta",".htm",".html",".html.hl",".html5",".inc",".jsp",".njk",".tpl",".twig",".wxml",".xht",".xhtml",".phtml",".liquid"]},elixir:{extensions:[".ex",".exs"],filenames:["mix.lock"]},erlang:{extensions:[".app",".app.src",".erl",".es",".escript",".hrl",".xrl",".yrl"],filenames:["Emakefile","rebar.config","rebar.config.lock","rebar.lock"]},fsharp:{extensions:[".fs",".fsi",".fsx"]},go:{extensions:[".go"]},groovy:{extensions:[".gradle",".groovy",".grt",".gtpl",".gvy",".jenkinsfile"],filenames:["Jenkinsfile","Jenkinsfile"]},graphql:{extensions:[".gql",".graphql",".graphqls"]},terraform:{extensions:[".hcl",".nomad",".tf",".tfvars",".workflow"]},hlsl:{extensions:[".cginc",".fx",".fxh",".hlsl",".hlsli"]},erb:{extensions:[".erb",".erb.deface",".rhtml"]},razor:{extensions:[".cshtml",".razor"]},haml:{extensions:[".haml",".haml.deface"]},handlebars:{extensions:[".handlebars",".hbs"]},haskell:{extensions:[".hs",".hs-boot",".hsc"]},ini:{extensions:[".cfg",".cnf",".dof",".ini",".lektorproject",".prefs",".pro",".properties",".url"],filenames:[".buckconfig",".coveragerc",".flake8",".pylintrc","HOSTS","buildozer.spec","hosts","pylintrc","vlcrc"]},json:{extensions:[".4DForm",".4DProject",".JSON-tmLanguage",".avsc",".geojson",".gltf",".har",".ice",".json",".json.example",".jsonl",".mcmeta",".sarif",".tact",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","MODULE.bazel.lock","Package.resolved","Pipfile.lock","bun.lock","composer.lock","deno.lock","flake.lock","mcmod.info"]},jsonc:{extensions:[".code-snippets",".code-workspace",".jsonc",".sublime-build",".sublime-color-scheme",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[".babelrc",".devcontainer.json",".eslintrc.json",".jscsrc",".jshintrc",".jslintrc",".swcrc","api-extractor.json","argv.json","devcontainer.json","extensions.json","jsconfig.json","keybindings.json","language-configuration.json","launch.json","profiles.json","settings.json","tasks.json","tsconfig.json","tslint.json"]},java:{extensions:[".jav",".java",".jsh"]},javascript:{extensions:["._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".js",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib"],filenames:["Jakefile"]},julia:{extensions:[".jl"]},kotlin:{extensions:[".kt",".ktm",".kts"]},less:{extensions:[".less"]},lua:{extensions:[".fcgi",".lua",".luau",".nse",".p8",".pd_lua",".rbxs",".rockspec",".wlua"],filenames:[".luacheckrc"]},makefile:{extensions:[".d",".mak",".make",".makefile",".mk",".mkfile"],filenames:["BSDmakefile","GNUmakefile","Kbuild","Makefile","Makefile.am","Makefile.boot","Makefile.frag","Makefile.in","Makefile.inc","Makefile.wat","makefile","makefile.sco","mkfile"]},markdown:{extensions:[".livemd",".markdown",".md",".mdown",".mdwn",".mdx",".mkd",".mkdn",".mkdown",".ronn",".scd",".workbook"],filenames:["contents.lr"]},"objective-c":{extensions:[".h",".m"]},"objective-cpp":{extensions:[".mm"]},php:{extensions:[".aw",".ctp",".fcgi",".inc",".install",".module",".php",".php3",".php4",".php5",".phps",".phpt",".theme"],filenames:[".php",".php_cs",".php_cs.dist","Phakefile"]},perl:{extensions:[".al",".cgi",".fcgi",".perl",".ph",".pl",".plx",".pm",".psgi",".t"],filenames:[".latexmkrc","Makefile.PL","Rexfile","ack","cpanfile","latexmkrc"]},powershell:{extensions:[".ps1",".psd1",".psm1"]},pug:{extensions:[".jade",".pug"]},python:{extensions:[".cgi",".codon",".fcgi",".gyp",".gypi",".lmi",".py",".py3",".pyde",".pyi",".pyp",".pyt",".pyw",".rpy",".sage",".spec",".tac",".wsgi",".xpy"],filenames:[".gclient","DEPS","SConscript","SConstruct","wscript"]},r:{extensions:[".r",".rd",".rsx"],filenames:[".Rprofile","expr-dist"]},ruby:{extensions:[".builder",".eye",".fcgi",".gemspec",".god",".jbuilder",".mspec",".pluginspec",".podspec",".prawn",".rabl",".rake",".rb",".rbi",".rbuild",".rbw",".rbx",".ru",".ruby",".spec",".thor",".watchr"],filenames:[".irbrc",".pryrc",".simplecov","Appraisals","Berksfile","Brewfile","Buildfile","Capfile","Dangerfile","Deliverfile","Fastfile","Gemfile","Guardfile","Jarfile","Mavenfile","Podfile","Puppetfile","Rakefile","Snapfile","Steepfile","Thorfile","Vagrantfile","buildfile"]},rust:{extensions:[".rs",".rs.in"]},scss:{extensions:[".scss"]},sql:{extensions:[".cql",".ddl",".inc",".mysql",".prc",".sql",".tab",".udf",".viw"]},sass:{extensions:[".sass"]},scala:{extensions:[".kojo",".sbt",".sc",".scala"]},shellscript:{extensions:[".bash",".bats",".cgi",".command",".fcgi",".fish",".ksh",".sh",".sh.in",".tmux",".tool",".trigger",".zsh",".zsh-theme"],filenames:[".bash_aliases",".bash_functions",".bash_history",".bash_logout",".bash_profile",".bashrc",".cshrc",".envrc",".flaskenv",".kshrc",".login",".profile",".tmux.conf",".zlogin",".zlogout",".zprofile",".zshenv",".zshrc","9fs","PKGBUILD","bash_aliases","bash_logout","bash_profile","bashrc","cshrc","gradlew","kshrc","login","man","profile","tmux.conf","zlogin","zlogout","zprofile","zshenv","zshrc"]},slang:{extensions:[".fxc",".hlsl",".s",".slang",".slangh",".usf",".ush",".vfx"]},slim:{extensions:[".slim"]},solidity:{extensions:[".sol"]},stylus:{extensions:[".styl"]},svelte:{extensions:[".svelte"]},swift:{extensions:[".swift"]},systemverilog:{extensions:[".sv",".svh",".vh"]},typescriptreact:{extensions:[".tsx"]},latex:{extensions:[".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]},typescript:{extensions:[".cts",".mts",".ts"]},verilog:{extensions:[".v",".veo"]},vim:{extensions:[".vba",".vim",".vimrc",".vmb"],filenames:[".exrc",".gvimrc",".nvimrc",".vimrc","_vimrc","gvimrc","nvimrc","vimrc"]},vb:{extensions:[".vb",".vbhtml",".Dsr",".bas",".cls",".ctl",".frm",".vbs"]},vue:{extensions:[".nvue",".vue"]},xml:{extensions:[".adml",".admx",".ant",".axaml",".axml",".builds",".ccproj",".ccxml",".clixml",".cproject",".cscfg",".csdef",".csl",".csproj",".ct",".depproj",".dita",".ditamap",".ditaval",".dll.config",".dotsettings",".filters",".fsproj",".fxml",".glade",".gml",".gmx",".gpx",".grxml",".gst",".hzp",".iml",".ivy",".jelly",".jsproj",".kml",".launch",".mdpolicy",".mjml",".mod",".mojo",".mxml",".natvis",".ncl",".ndproj",".nproj",".nuspec",".odd",".osm",".pkgproj",".plist",".pluginspec",".proj",".props",".ps1xml",".psc1",".pt",".pubxml",".qhelp",".rdf",".res",".resx",".rss",".sch",".scxml",".sfproj",".shproj",".srdf",".storyboard",".sublime-snippet",".svg",".sw",".targets",".tml",".typ",".ui",".urdf",".ux",".vbproj",".vcxproj",".vsixmanifest",".vssettings",".vstemplate",".vxml",".wixproj",".workflow",".wsdl",".wsf",".wxi",".wxl",".wxs",".x3d",".xacro",".xaml",".xib",".xlf",".xliff",".xmi",".xml",".xml.dist",".xmp",".xproj",".xsd",".xspec",".xul",".zcml"],filenames:[".classpath",".cproject",".project","App.config","NuGet.config","Settings.StyleCop","Web.Debug.config","Web.Release.config","Web.config","packages.config"]},xsl:{extensions:[".xsl",".xslt"]},yaml:{extensions:[".mir",".reek",".rviz",".sublime-syntax",".syntax",".yaml",".yaml-tmlanguage",".yaml.sed",".yml",".yml.mysql"],filenames:[".clang-format",".clang-tidy",".clangd",".gemrc","CITATION.cff","glide.lock","pixi.lock","yarn.lock"]},javascriptreact:{extensions:[".jsx"]},legend:{extensions:[".pure"]}};p();p();var Tfn=[".ejs",".erb",".haml",".hbs",".j2",".jinja",".jinja2",".liquid",".mustache",".njk",".php",".pug",".slim",".webc"],Ifn={".php":[".blade"]},Z7=Object.keys(ZL).flatMap(t=>ZL[t].extensions);var N6t=fe(require("node:path"));var Rce=class{constructor(e,r,n){this.languageId=e;this.isGuess=r;this.fileExtension=n}static{a(this,"Language")}},cTe=class{static{a(this,"LanguageDetection")}},M6t=new Map,wce=new Map;for(let[t,{extensions:e,filenames:r}]of Object.entries(ZL)){for(let n of e)M6t.set(n,[...M6t.get(n)??[],t]);for(let n of r??[])wce.set(n,[...wce.get(n)??[],t])}var O6t=class extends cTe{static{a(this,"FilenameAndExensionLanguageDetection")}detectLanguage(e){let r=Ki(e.uri),n=N6t.extname(r).toLowerCase(),o=this.extensionWithoutTemplateLanguage(r,n),s=this.detectLanguageId(r,o),c=this.computeFullyQualifiedExtension(n,o);return s?new Rce(s.languageId,s.isGuess,c):new Rce(e.languageId,!0,c)}extensionWithoutTemplateLanguage(e,r){if(Tfn.includes(r)){let n=e.substring(0,e.lastIndexOf(".")),o=N6t.extname(n).toLowerCase();if(o.length>0&&Z7.includes(o)&&this.isExtensionValidForTemplateLanguage(r,o))return o}return r}isExtensionValidForTemplateLanguage(e,r){let n=Ifn[e];return!n||n.includes(r)}detectLanguageId(e,r){if(wce.has(e))return{languageId:wce.get(e)[0],isGuess:!1};let n=M6t.get(r)??[];if(n.length>0)return{languageId:n[0],isGuess:n.length>1};for(;e.includes(".");)if(e=e.replace(/\.[^.]*$/,""),wce.has(e))return{languageId:wce.get(e)[0],isGuess:!1}}computeFullyQualifiedExtension(e,r){return e!==r?r+e:e}},B6t=class extends cTe{constructor(r){super();this.delegate=r}static{a(this,"GroupingLanguageDetection")}detectLanguage(r){let n=this.delegate.detectLanguage(r),o=n.languageId;return o==="c"||o==="cpp"?new Rce("cpp",n.isGuess,n.fileExtension):n}},L6t=class extends cTe{constructor(r){super();this.delegate=r}static{a(this,"ClientProvidedLanguageDetection")}detectLanguage(r){return r.uri.startsWith("untitled:")||r.uri.startsWith("vscode-notebook-cell:")?new Rce(r.languageId,!0,""):this.delegate.detectLanguage(r)}},W3o=new B6t(new L6t(new O6t));function BM({uri:t,languageId:e}){let r=W3o.detectLanguage({uri:t,languageId:"UNKNOWN"});return r.languageId==="UNKNOWN"?e:r.languageId}a(BM,"detectLanguage");p();p();p();p();function Lh(t){if(t.isCancellationRequested)throw new sVe}a(Lh,"throwIfCancellationRequested");function ck(t){return t instanceof sVe?!0:t instanceof Error&&t.name===F6t&&t.message===F6t}a(ck,"isCancellationError");var sVe=class extends Error{static{a(this,"CancellationError")}constructor(){super(F6t),this.name=this.message}},F6t="Canceled",aVe=class{constructor(){this.items=[]}static{a(this,"Stack")}push(e){this.items.push(e)}pop(){return this.items.pop()}peek(){return this.items[this.items.length-1]}tryPeek(){return this.items.length>0}toArray(){return this.items}};function fY(t){switch(t){case 0:case 2:case 7:case 8:case 11:case 12:case 13:case 14:return!0;default:return!1}}a(fY,"isTypeDefinition");var su=class t{static{a(this,"TextRange")}static{this.empty=new t(0,0)}constructor(e,r){this.start=e,this.length=r}static fromBounds(e,r){return new t(e,r-e)}get end(){return this.start+this.length}contains(e){return this.start<=e&&this.end>=e}containsRange(e){return this.start<=e.start&&this.end>=e.end}equals(e){return this.start===e.start&&this.length===e.length}getText(e){return e.slice(this.start,this.end)}getTextWithIndentation(e,r){let n=[],o=this.start;for(o=wfn(e,e.length,o),xfn(n,r);o0||u>0||d>0||f>0?new gx(r,"","",cu.fromBounds(s,c),cu.fromBounds(d,f),cu.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new gx(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var NGe=class extends Mh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,iNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},MGe=class extends Mh{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,sNo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,aNo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},OGe=class extends Mh{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,oNo),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new cu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new cu(f,h-f),g=new cu(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=cu.empty,y=cu.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new gx(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},iNo=` +`),o=wfn(e,e.length,++o),xfn(n,r)):o++;return n.join("")}};function xfn(t,e){for(let r=0;r0||u>0||d>0||f>0?new Ax(r,"","",su.fromBounds(s,c),su.fromBounds(d,f),su.fromBounds(h,m),y,t.kindFromString(g),0):null;if(E){t.updateScopesForSymbol(e,E);let _=E.nameRange.getText(n),v=this.createNameFromScopes(n,e.toArray());return v=A?`${A}.${v}`:v,new Ax(r,v,_.substring(_.lastIndexOf(".")+1),E.commentRange,E.nameRange,E.bodyRange,E.extentRange,E.kind,0)}return null}static updateScopesForSymbol(e,r){for(;e.tryPeek()&&!e.peek()?.extentRange.containsRange(r.extentRange);)e.pop();e.push(r)}static kindFromString(e){switch(e){case"definition.class":return 0;case"definition.constant":return 1;case"definition.enum_variant":return 3;case"definition.enum":return 2;case"definition.field":return 4;case"definition.function":return 5;case"definition.implementation":return 6;case"definition.interface":return 7;case"definition.macro":return 8;case"definition.method":return 9;case"import.module":case"definition.module":case"definition.module.filescoped":return 10;case"definition.struct":return 11;case"definition.trait":return 12;case"definition.type":return 13;case"definition.union":return 14;case"reference":return 16;case"wildcard":return 18;case"alias":return 19;case"import":return 17;default:throw new Error("NotSupportedException")}}cleanQuotedString(e){return e.replace(/^(['"])(.*)\1$/,"$2")}};var cVe=class extends Fh{static{a(this,"GoSymbolExtractor")}get languageId(){return"go"}extractSymbols(e,r){return this.executeQuery(e,r,z3o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},lVe=class extends Fh{static{a(this,"GoReferenceExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,K3o)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,J3o),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},uVe=class extends Fh{static{a(this,"GoImportExtractor")}get languageId(){return"go"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,Y3o),o=new Set;try{n.matches.forEach(s=>{let c,l,u;for(let d of s.captures)d.name==="import.name"?c=d:d.name==="alias"?l=d:d.name==="import"&&(u=d);if(c&&u){let d=this.cleanQuotedString(c.node.text),f=c.node.startIndex+1,h=c.node.endIndex-1,m=l?new su(l.node.startIndex,l.node.endIndex-l.node.startIndex):new su(f,h-f),g=new su(u.node.startIndex,u.node.endIndex-u.node.startIndex),A=su.empty,y=su.empty,E=d.substring(d.lastIndexOf("/")+1);o.add(new Ax(e,d,E,A,m,y,g,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},z3o=` ( ((comment)* @comment) . @@ -1973,7 +2004,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (field_declaration name: (_) @name) @definition.field ) -`,oNo=` +`,Y3o=` (import_declaration (import_spec name: (package_identifier)? @alias @@ -1984,15 +2015,15 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (import_spec name: (package_identifier)? @alias path: (interpreted_string_literal) @import.name))+) @import -`,sNo=` +`,K3o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`,aNo=` +`,J3o=` (call_expression function: (_) @name) @reference (type_identifier) @reference -`;p();var LGe=class extends Mh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,cNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},FGe=class extends Mh{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,uNo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,dNo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},UGe=class extends Mh{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,lNo)).filter(o=>o.kind===0)}},cNo=` +`;p();var fVe=class extends Fh{static{a(this,"JavaSymbolExtractor")}get languageId(){return"java"}extractSymbols(e,r){return this.executeQuery(e,r,Z3o)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},pVe=class extends Fh{static{a(this,"JavaReferenceExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}extractReferences(e,r){return this.executeQuery(e,r,eFo)}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,tFo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},hVe=class extends Fh{static{a(this,"JavaImportExtractor")}get languageId(){return"java"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){return(await this.executeQuery(e,r,X3o)).filter(o=>o.kind===0)}},Z3o=` ( [ (block_comment) @comment @@ -2055,7 +2086,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (enum_constant name: (identifier) @name) @definition.enum_variant ) -`,lNo=` +`,X3o=` ( [ ((line_comment)* @comment) @@ -2067,19 +2098,19 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (asterisk)? @wildcard ) @definition.class ) -`,uNo=` +`,eFo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`,dNo=` +`,tFo=` (method_invocation name: (identifier) @name ) @reference (type_identifier) @reference -`;p();var fNo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),QGe=class extends Mh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,pNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},qGe=class extends Mh{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,hNo)).filter(o=>!fNo.has(o.unqualifiedName))}};var pNo=` +`;p();var rFo=new Set(["null","undefined","void","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),mVe=class extends Fh{static{a(this,"JavaScriptSymbolExtractor")}get languageId(){return"javascript"}extractSymbols(e,r){return this.executeQuery(e,r,nFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},gVe=class extends Fh{static{a(this,"JavaScriptReferenceExtractor")}extractLocalReferences(e,r,n){throw new Error("Method not implemented.")}get languageId(){return"javascript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,iFo)).filter(o=>!rFo.has(o.unqualifiedName))}};var nFo=` ( ((comment)* @comment) . @@ -2089,9 +2120,9 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name value: (_) @body))) @definition.function ] ) -`,hNo=` +`,iFo=` (call_expression function: (_) @name) @reference -`;p();var mNo=new Set(["int","str","float","bool","list","dict","tuple","set"]),jGe=class extends Mh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,gNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},HGe=class extends Mh{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,ANo)).filter(o=>!mNo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,ENo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},GGe=class extends Mh{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,yNo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new cu(l.node.startIndex,l.node.endIndex-l.node.startIndex):new cu(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new cu(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=cu.empty,A=cu.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new gx(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},gNo=` +`;p();var oFo=new Set(["int","str","float","bool","list","dict","tuple","set"]),AVe=class extends Fh{static{a(this,"PythonSymbolExtractor")}get languageId(){return"python"}extractSymbols(e,r){return this.executeQuery(e,r,sFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},yVe=class extends Fh{static{a(this,"PythonReferenceExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,aFo)).filter(o=>!oFo.has(o.unqualifiedName))}async extractLocalReferences(e,r,n){let o=await this.executeQuery(e,r,lFo),s=o.filter(u=>u.kind!==9),c=o.filter(u=>u.kind===9&&u.extentRange.containsRange(n)),l=[];for(let u of c)l.push(...s.filter(d=>u.extentRange.containsRange(d.extentRange)));return l}},EVe=class extends Fh{static{a(this,"PythonImportExtractor")}get languageId(){return"python"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractSymbols(e,r){let n=await this.findMatches(r,cFo),o=new Set;try{n.matches.forEach(s=>{let c,l,u,d;for(let f of s.captures)f.name==="import.name"?c=f:f.name==="import.module"?u=f:f.name==="alias"?l=f:f.name==="import"&&(d=f);if(u&&d){let f=c||u,h=l?new su(l.node.startIndex,l.node.endIndex-l.node.startIndex):new su(f.node.startIndex,d.node.endIndex-f.node.endIndex),m=new su(d.node.startIndex,d.node.endIndex-d.node.startIndex),g=su.empty,A=su.empty,y=f.node.text,E=y.split(".").pop()||y,_;c?_=`${u.node.text}.${c.node.text}`:_=u.node.text,o.add(new Ax(e,_,E,g,h,A,m,17,0))}})}finally{n.tree.delete()}return o.size>0?[...o]:[]}},sFo=` ( ((comment)* @comment) . @@ -2103,7 +2134,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la . (function_definition name: (_) @name body: (_) @body) @definition.method ) -`,ANo=` +`,aFo=` (call function: (_) @name) @reference (type [ @@ -2112,7 +2143,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`,yNo=` +`,cFo=` (import_statement name: (dotted_name) @import.module) @import (import_from_statement @@ -2127,7 +2158,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (aliased_import name: ((dotted_name) @import.name) alias: (identifier) @alias)) @import -`,ENo=` +`,lFo=` (call function: (_) @name) @reference (type [ @@ -2136,7 +2167,7 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la ]) @reference (class_definition superclasses: (argument_list (identifier) @name)) @reference -`;p();var _No=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),pce=class extends Mh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,CNo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},hce=class extends Mh{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,vNo)).filter(o=>!_No.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var CNo=` +`;p();var uFo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),Pce=class extends Fh{static{a(this,"TypeScriptSymbolExtractor")}get languageId(){return"typescript"}extractSymbols(e,r){return this.executeQuery(e,r,dFo)}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},kce=class extends Fh{static{a(this,"TypeScriptReferenceExtractor")}get languageId(){return"typescript"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){return(await this.executeQuery(e,r,fFo)).filter(o=>!uFo.has(o.unqualifiedName))}extractLocalReferences(){return Promise.reject(new Error("Method not implemented."))}};var dFo=` ( ((comment)* @comment) . @@ -2161,13 +2192,13 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la (variable_declarator name: (identifier) @name type: (type_annotation (type_identifier))) ] ) -`,vNo=` +`,fFo=` (call_expression function: (_) @name) @reference (type_identifier) @name @reference (new_expression constructor: (identifier) @name) @reference -`;p();var bNo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),$Ge=class extends pce{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,SNo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},VGe=class extends hce{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,TNo),super.extractReferences(e,r)]);return[...n.filter(s=>!bNo.has(s.unqualifiedName)),...o]}},SNo=` +`;p();var pFo=new Set(["string","number","boolean","null","undefined","void","any","never","object","symbol","bigint","Array","Promise","Date","RegExp","Map","Set"]),_Ve=class extends Pce{static{a(this,"TypeScriptReactSymbolExtractor")}get languageId(){return"typescriptreact"}extractSymbols(e,r){return Promise.all([this.executeQuery(e,r,hFo),super.extractSymbols(e,r)]).then(([n,o])=>[...n,...o])}createNameFromScopes(e,r){return r.map(n=>n.nameRange.getText(e)).join(".")}},vVe=class extends kce{static{a(this,"TypeScriptReactReferenceExtractor")}get languageId(){return"typescriptreact"}createNameFromScopes(e,r){return r.length>0?r[r.length-1].nameRange.getText(e):""}async extractReferences(e,r){let[n,o]=await Promise.all([this.executeQuery(e,r,mFo),super.extractReferences(e,r)]);return[...n.filter(s=>!pFo.has(s.unqualifiedName)),...o]}},hFo=` ( ((comment)* @comment) . @@ -2180,58 +2211,58 @@ ${r}+- `:"";return e+this.description+o}}},$m=class{constructor(e,r,n,o){this.la body: (_) @body))) @definition.function ] ) -`,TNo=` +`,mFo=` (jsx_element open_tag: (jsx_opening_element name: (_) @name) close_tag: (jsx_closing_element) ) @reference (jsx_self_closing_element name: (_) @name) @reference (import_specifier name:(identifier) @name) @reference -`;var QSe=[{symbolExtractor:new LGe,referenceExtractor:new FGe,importExtractor:new UGe,languageId:"java"},{symbolExtractor:new NGe,referenceExtractor:new MGe,importExtractor:new OGe,languageId:"go"},{symbolExtractor:new jGe,referenceExtractor:new HGe,importExtractor:new GGe,languageId:"python"},{symbolExtractor:new pce,referenceExtractor:new hce,languageId:"typescript"},{symbolExtractor:new $Ge,referenceExtractor:new VGe,languageId:"typescriptreact"},{symbolExtractor:new QGe,referenceExtractor:new qGe,languageId:"javascript"}];function Ucn(t){let e=DM({uri:t});if(e&&QSe.some(r=>e===r.languageId))return e}a(Ucn,"getSupportedLanguageIdForMultiLanguageProvider");var Qcn=new Map(QSe.map(t=>[t.languageId,t.referenceExtractor])),qcn=new Map(QSe.map(t=>[t.languageId,t.symbolExtractor])),jcn=new Map(QSe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),b3t=QSe.map(t=>HL[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function S3t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(S3t,"virtualNode");function Hcn(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(Hcn,"lineNode");function T3t(t){return{type:"blank",lineNumber:t,subs:[]}}a(T3t,"blankNode");function WGe(t){return{type:"top",indentation:-1,subs:t??[]}}a(WGe,"topNode");function cA(t){return t.type==="blank"}a(cA,"isBlank");function Xz(t){return t.type==="line"}a(Xz,"isLine");function eY(t){return t.type==="virtual"}a(eY,"isVirtual");p();function Gcn(t,e){return Oy(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Gcn,"clearLabelsIf");function tY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>tY(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>tY(r,e)),label:t.label?e(t.label):void 0}}}a(tY,"mapLabels");function Oy(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(Oy,"visitTree");function I3t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),Oy(t,s,n),o}a(I3t,"foldTree");function zGe(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:WGe()}a(zGe,"rebuildTree");p();function xNo(t){let e=t.split(` -`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[Hcn(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),Oy(t,r,"bottomUp")}a(qSe,"labelLines");function YGe(t){function e(r){if(eY(r)&&r.label===void 0){let n=r.subs.filter(o=>!cA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),Oy(t,e,"bottomUp")}a(YGe,"labelVirtualInherited");function jSe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(jSe,"buildLabelRules");function x3t(t){let r=zGe(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(Xz(l)||eY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&cA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[S3t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),cA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return Gcn(t,n=>n==="newVirtual"),r}a(x3t,"combineClosersAndOpeners");function $cn(t,e=cA,r){return zGe(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=S3t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!cA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(Wcn,"processJava");p();var DNo={heading:/^# /,subheading:/^## /,subsubheading:/### /},NNo=jSe(DNo);function zcn(t){let e=t;if(qSe(e,NNo),cA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||cA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=$cn(e),e=rY(e),YGe(e),e}a(zcn,"processMarkdown");p();function Ycn(t){return" ".repeat(t.indentation)+t.sourceLine+` -`}a(Ycn,"deparseLine");w3t("markdown",zcn);w3t("java",Wcn);var MNo={worthUp:.9,worthSibling:.88,worthDown:.8};function R3t(t,e,r=Ss(),n=MNo){let o=tY(t,s=>s?1:void 0);return Oy(o,s=>{if(cA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),Oy(o,s=>{if(cA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),ONo(o,e,r)}a(R3t,"fromTreeWithFocussedLines");function ONo(t,e,r=Ss()){let n=I3t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Ycn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new Ar(n,e,r)}a(ONo,"fromTreeWithValuedLines");function yS(t,e=!0,r=!0,n,o=Ss()){let s=typeof t=="string"?nY(t):nY(t.source,t.languageId);rY(s);let c=tY(s,l=>e&&l!=="closer");return Oy(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&Oy(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&Oy(c,l=>{l.label||=(Xz(l)||cA(l))&&l.lineNumber==0},"topDown"),R3t(c,n,o)}a(yS,"elidableTextForSourceCode");p();var HSe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` -`)&&o!=="none")throw new Error("LineWithValueAndCost: text contains newline");if(r<0&&o!=="none")throw new Error("LineWithValueAndCost: value is negative");if(n<0&&o!=="none")throw new Error("LineWithValueAndCost: cost is negative");if(o=="strict"&&r>1)throw new Error("Value should normally be between 0 and 1 -- set validation to `loose` to ignore this error")}static{a(this,"LineWithValueAndCost")}get value(){return this._value}get cost(){return this._cost}adjustValue(e){return this._value*=e,this}setValue(e){return this._value=e,this}recost(e=r=>Ss().tokenLength(r+` -`)){return this._cost=e(this.text),this}copy(){let e=new t(this.text,this.value,this.cost,"none",this.metadata);return e.markedForRemoval=this.markedForRemoval,e}};var Ar=class t{constructor(e,r,n=Ss()){this.metadata=r;this.tokenizer=n;this.lines=[];let o=[];for(let s of e){let c=Array.isArray(s)?s[1]:1,l=Array.isArray(s)?s[0]:s;typeof l=="string"?l.split(` -`).forEach(u=>o.push(new HSe(u,c,n.tokenLength(u+` -`),"strict",this.metadata))):l instanceof t?l.lines.forEach(u=>o.push(u.copy().adjustValue(c))):"source"in l&&"languageId"in l&&yS(l).lines.forEach(u=>o.push(u.copy().adjustValue(c)))}this.lines=o}static{a(this,"ElidableText")}adjust(e){this.lines.forEach(r=>r.adjustValue(e))}recost(e=r=>Ss().tokenLength(r+` +`;var lTe=[{symbolExtractor:new fVe,referenceExtractor:new pVe,importExtractor:new hVe,languageId:"java"},{symbolExtractor:new cVe,referenceExtractor:new lVe,importExtractor:new uVe,languageId:"go"},{symbolExtractor:new AVe,referenceExtractor:new yVe,importExtractor:new EVe,languageId:"python"},{symbolExtractor:new Pce,referenceExtractor:new kce,languageId:"typescript"},{symbolExtractor:new _Ve,referenceExtractor:new vVe,languageId:"typescriptreact"},{symbolExtractor:new mVe,referenceExtractor:new gVe,languageId:"javascript"}];function Rfn(t){let e=BM({uri:t});if(e&&lTe.some(r=>e===r.languageId))return e}a(Rfn,"getSupportedLanguageIdForMultiLanguageProvider");var Pfn=new Map(lTe.map(t=>[t.languageId,t.referenceExtractor])),kfn=new Map(lTe.map(t=>[t.languageId,t.symbolExtractor])),Dfn=new Map(lTe.filter(t=>t.importExtractor!==void 0).map(t=>[t.languageId,t.importExtractor])),U6t=lTe.map(t=>ZL[t.languageId].extensions).flat();p();p();p();p();p();p();p();p();p();function Q6t(t,e,r){return{type:"virtual",indentation:t,subs:e,label:r}}a(Q6t,"virtualNode");function Nfn(t,e,r,n,o){if(r==="")throw new Error("Cannot create a line node with an empty source line");return{type:"line",indentation:t,lineNumber:e,sourceLine:r,subs:n,label:o}}a(Nfn,"lineNode");function q6t(t){return{type:"blank",lineNumber:t,subs:[]}}a(q6t,"blankNode");function CVe(t){return{type:"top",indentation:-1,subs:t??[]}}a(CVe,"topNode");function hA(t){return t.type==="blank"}a(hA,"isBlank");function pY(t){return t.type==="line"}a(pY,"isLine");function hY(t){return t.type==="virtual"}a(hY,"isVirtual");p();function Mfn(t,e){return qy(t,r=>{r.label=r.label?e(r.label)?void 0:r.label:void 0},"bottomUp"),t}a(Mfn,"clearLabelsIf");function mY(t,e){switch(t.type){case"line":case"virtual":{let r=t.subs.map(n=>mY(n,e));return{...t,subs:r,label:t.label?e(t.label):void 0}}case"blank":return{...t,label:t.label?e(t.label):void 0};case"top":return{...t,subs:t.subs.map(r=>mY(r,e)),label:t.label?e(t.label):void 0}}}a(mY,"mapLabels");function qy(t,e,r){function n(o){r==="topDown"&&e(o),o.subs.forEach(s=>{n(s)}),r==="bottomUp"&&e(o)}a(n,"_visit"),n(t)}a(qy,"visitTree");function j6t(t,e,r,n){let o=e;function s(c){o=r(c,o)}return a(s,"visitor"),qy(t,s,n),o}a(j6t,"foldTree");function bVe(t,e,r){let n=a(s=>{if(r!==void 0&&r(s))return s;{let c=s.subs.map(n).filter(l=>l!==void 0);return s.subs=c,e(s)}},"rebuild"),o=n(t);return o!==void 0?o:CVe()}a(bVe,"rebuildTree");p();function AFo(t){let e=t.split(` +`),r=e.map(d=>d.match(/^\s*/)[0].length),n=e.map(d=>d.trimLeft());function o(d){let[f,h]=s(d+1,r[d]);return[Nfn(r[d],d,n[d],f),h]}a(o,"parseNode");function s(d,f){let h,m=[],g=d,A;for(;gf);)if(n[g]==="")A===void 0&&(A=g),g+=1;else{if(A!==void 0){for(let y=A;ys.matches(n.sourceLine));o&&(n.label=o.label)}}a(r,"visitor"),qy(t,r,"bottomUp")}a(uTe,"labelLines");function SVe(t){function e(r){if(hY(r)&&r.label===void 0){let n=r.subs.filter(o=>!hA(o));n.length===1&&(r.label=n[0].label)}}a(e,"visitor"),qy(t,e,"bottomUp")}a(SVe,"labelVirtualInherited");function dTe(t){return Object.keys(t).map(e=>{let r;return t[e].test?r=a(n=>t[e].test(n),"matches"):r=t[e],{matches:r,label:e}})}a(dTe,"buildLabelRules");function H6t(t){let r=bVe(t,a(function(n){if(n.subs.length===0||n.subs.findIndex(c=>c.label==="closer"||c.label==="opener")===-1)return n;let o=[],s;for(let c=0;cu.subs.push(d)),l.subs=[];else if(l.label==="closer"&&s!==void 0&&(pY(l)||hY(l))&&l.indentation>=s.indentation){let d=o.length-1;for(;d>0&&hA(o[d]);)d-=1;if(s.subs.push(...o.splice(d+1)),l.subs.length>0){let f=s.subs.findIndex(A=>A.label!=="newVirtual"),h=s.subs.slice(0,f),m=s.subs.slice(f),g=m.length>0?[Q6t(l.indentation,m,"newVirtual")]:[];s.subs=[...h,...g,l]}else s.subs.push(l)}else o.push(l),hA(l)||(s=l)}return n.subs=o,n},"rebuilder"));return Mfn(t,n=>n==="newVirtual"),r}a(H6t,"combineClosersAndOpeners");function Ofn(t,e=hA,r){return bVe(t,a(function(o){if(o.subs.length<=1)return o;let s=[],c=[],l,u=!1;function d(f=!1){if(l!==void 0&&(s.length>0||!f)){let h=Q6t(l,c,r);s.push(h)}else c.forEach(h=>s.push(h))}a(d,"flushBlockIntoNewSubs");for(let f=0;f{if(r.label==="class"||r.label==="interface")for(let n of r.subs)!hA(n)&&(n.label===void 0||n.label==="annotation")&&(n.label="member")},"bottomUp"),e}a(Lfn,"processJava");p();var CFo={heading:/^# /,subheading:/^## /,subsubheading:/### /},bFo=dTe(CFo);function Ffn(t){let e=t;if(uTe(e,bFo),hA(e))return e;function r(s){if(s.label==="heading")return 1;if(s.label==="subheading")return 2;if(s.label==="subsubheading")return 3}a(r,"headingLevel");let n=[e],o=[...e.subs];e.subs=[];for(let s of o){let c=r(s);if(c===void 0||hA(s))n[n.length-1].subs.push(s);else{for(;n.lengthc+1;)n.pop()}}return e=Ofn(e),e=gY(e),SVe(e),e}a(Ffn,"processMarkdown");p();function Ufn(t){return" ".repeat(t.indentation)+t.sourceLine+` +`}a(Ufn,"deparseLine");G6t("markdown",Ffn);G6t("java",Lfn);var SFo={worthUp:.9,worthSibling:.88,worthDown:.8};function $6t(t,e,r=Cs(),n=SFo){let o=mY(t,s=>s?1:void 0);return qy(o,s=>{if(hA(s))return;let c=s.subs.reduce((l,u)=>Math.max(l,u.label??0),0);s.label=Math.max(s.label??0,c*n.worthUp)},"bottomUp"),qy(o,s=>{if(hA(s))return;let c=s.subs.map(d=>d.label??0),l=[...c];for(let d=0;dMath.max(f,Math.pow(n.worthSibling,Math.abs(d-h))*c[d])));let u=s.label;u!==void 0&&(l=l.map(d=>Math.max(d,n.worthDown*u))),s.subs.forEach((d,f)=>d.label=l[f])},"topDown"),TFo(o,e,r)}a($6t,"fromTreeWithFocussedLines");function TFo(t,e,r=Cs()){let n=j6t(t,[],(o,s)=>((o.type==="line"||o.type==="blank")&&s.push(o.type==="line"?[Ufn(o).trimEnd(),o.label??0]:["",o.label??0]),s),"topDown");return new yr(n,e,r)}a(TFo,"fromTreeWithValuedLines");function hS(t,e=!0,r=!0,n,o=Cs()){let s=typeof t=="string"?AY(t):AY(t.source,t.languageId);gY(s);let c=mY(s,l=>e&&l!=="closer");return qy(c,l=>{l.label===void 0&&(l.label=e&&l.label!==!1)},"topDown"),e&&qy(c,l=>{if(l.label){let u=!1;for(let d of[...l.subs].reverse())d.label&&!u?u=!0:d.label=!1}else for(let u of l.subs)u.label=!1;l.subs.length>0&&(l.label=!1)},"topDown"),r&&qy(c,l=>{l.label||=(pY(l)||hA(l))&&l.lineNumber==0},"topDown"),$6t(c,n,o)}a(hS,"elidableTextForSourceCode");p();var fTe=class t{constructor(e,r,n,o="strict",s){this.text=e;this._value=r;this._cost=n;this.metadata=s;this.markedForRemoval=!1;if(e.includes(` +`)&&o!=="none")throw new Error("LineWithValueAndCost: text contains newline");if(r<0&&o!=="none")throw new Error("LineWithValueAndCost: value is negative");if(n<0&&o!=="none")throw new Error("LineWithValueAndCost: cost is negative");if(o=="strict"&&r>1)throw new Error("Value should normally be between 0 and 1 -- set validation to `loose` to ignore this error")}static{a(this,"LineWithValueAndCost")}get value(){return this._value}get cost(){return this._cost}adjustValue(e){return this._value*=e,this}setValue(e){return this._value=e,this}recost(e=r=>Cs().tokenLength(r+` +`)){return this._cost=e(this.text),this}copy(){let e=new t(this.text,this.value,this.cost,"none",this.metadata);return e.markedForRemoval=this.markedForRemoval,e}};var yr=class t{constructor(e,r,n=Cs()){this.metadata=r;this.tokenizer=n;this.lines=[];let o=[];for(let s of e){let c=Array.isArray(s)?s[1]:1,l=Array.isArray(s)?s[0]:s;typeof l=="string"?l.split(` +`).forEach(u=>o.push(new fTe(u,c,n.tokenLength(u+` +`),"strict",this.metadata))):l instanceof t?l.lines.forEach(u=>o.push(u.copy().adjustValue(c))):"source"in l&&"languageId"in l&&hS(l).lines.forEach(u=>o.push(u.copy().adjustValue(c)))}this.lines=o}static{a(this,"ElidableText")}adjust(e){this.lines.forEach(r=>r.adjustValue(e))}recost(e=r=>Cs().tokenLength(r+` `)){this.lines.forEach(r=>r.recost(e))}elide(e,r="[...]",n=!0,o="removeLeastDesirable",s=this.tokenizer,c="topToBottom"){if(s.tokenLength(r+` -`)>e)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=LNo(this.lines,o);if(u<=e)return k3t(l);FNo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?UNo(l,m):"",y=Kcn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];KGe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return k3t([Kcn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)KGe(h[m],r)&&KGe(h[m-1],r)&&h.splice(m,1);return k3t(h)}};function BNo(t){return t?.text.match(/^\s*/)?.[0]??""}a(BNo,"getIndentation");function KGe(t,e){return t?.text.trim()===e.trim()}a(KGe,"isEllipsis");function k3t(t){return{getText:a(()=>t.map(e=>e.text).join(` -`),"getText"),getLines:a(()=>t,"getLines")}}a(k3t,"produceElidedText");function LNo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(LNo,"initializeElisionContext");function FNo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(FNo,"sortPriorityQueue");function UNo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=BNo(o);break}}return r}a(UNo,"getClosestIndentation");function Kcn(t,e,r,n){let o=t+e;return new HSe(o,1/0,r.tokenLength(o+` -`),"loose",n?.metadata)}a(Kcn,"getNewEllipsis");p();var Jcn=require("fs");async function Zcn(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Nh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await QNo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(Zcn,"symbolRangesToCodeSnippets");async function QNo(t){if(t.length===0)return new Ar([]);let e=t[0].node.fileName,r=[],n="";try{let o=ho(e);o&&(n=(await Jcn.promises.readFile(o)).toString())}catch{}for(let o of t)Xcn(o,n).forEach(s=>r.push(s));return new Ar(r)}a(QNo,"sameFileSymbolRangeToElidableText");function Xcn(t,e){let n=[],o=t.node,s=e.substring(P3t(e,o.commentRange.start),o.commentRange.end);n.push([D3t(s),1-3e-4]);let c=P3t(e,o.bodyRange.start),l=P3t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(Zz(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([D3t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Xcn(d,e));else{let d=1-(Zz(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([D3t(f),d])}return Zz(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Xcn,"prepareForElidableText");function P3t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(P3t,"shiftLeftToNearestLineEndingOrAlphanumeric");function D3t(t){let e=0;for(;ee)throw new Error("maxTokens must be larger than the ellipsis length");let{lines:l,totalCost:u,priorityQueue:d}=xFo(this.lines,o);if(u<=e)return V6t(l);wFo(d,c);let f=u;for(;f>e&&d.length>0;){let m=d.shift().originalIndex,g=l[m];if(g.markedForRemoval)continue;let A=n?RFo(l,m):"",y=Qfn(A,r,s,g);l[m]=y,f-=g.cost,f+=y.cost;let E=m+1;if(E=0){let v=l[_];TVe(v,r)&&(f-=v.cost,v.markedForRemoval=!0)}}if(f>e)return V6t([Qfn("",r,s)]);let h=l.filter(m=>!m.markedForRemoval);for(let m=h.length-1;m>0;m--)TVe(h[m],r)&&TVe(h[m-1],r)&&h.splice(m,1);return V6t(h)}};function IFo(t){return t?.text.match(/^\s*/)?.[0]??""}a(IFo,"getIndentation");function TVe(t,e){return t?.text.trim()===e.trim()}a(TVe,"isEllipsis");function V6t(t){return{getText:a(()=>t.map(e=>e.text).join(` +`),"getText"),getLines:a(()=>t,"getLines")}}a(V6t,"produceElidedText");function xFo(t,e){let r=0,n=[];return{lines:t.map((s,c)=>{let l=s.copy();return e==="removeLeastBangForBuck"&&l.adjustValue(1/l.cost),r+=l.cost,n.push({originalIndex:c,value:l.value}),l}),totalCost:r,priorityQueue:n}}a(xFo,"initializeElisionContext");function wFo(t,e){t.sort((r,n)=>r.value!==n.value?r.value-n.value:e==="bottomToTop"?n.originalIndex-r.originalIndex:r.originalIndex-n.originalIndex)}a(wFo,"sortPriorityQueue");function RFo(t,e){let r="";for(let n=e;n>=0;n--){let o=t[n];if(!o.markedForRemoval&&o.text.trim()!==""){r=IFo(o);break}}return r}a(RFo,"getClosestIndentation");function Qfn(t,e,r,n){let o=t+e;return new fTe(o,1/0,r.tokenLength(o+` +`),"loose",n?.metadata)}a(Qfn,"getNewEllipsis");p();var qfn=require("fs");async function jfn(t,e,r,n,o){let s=new Map,c=0;for(let h of t){let m=h.node.fileName.toLowerCase(),g=s.get(m);g?g.symbols.push(h):s.set(m,{symbols:[h],topRank:c}),c++}if(s.delete(r.toLowerCase()),s.size===0)return[];let l=e,u=e/Math.min(4,s.size),d=[],f=Array.from(s.keys());f.sort((h,m)=>{let g=s.get(h).topRank,A=s.get(m).topRank;return g-A});for(let h of f){let m=s.get(h).symbols;if(m.length===0)continue;let g=m[0].node.fileName,A=m.reduce((y,E)=>y+E.node.extentRange.length,0);for(let y of m){if(l<=5)return d;Lh(o);let E=y.node.extentRange.length/A,_=Math.min(l,E*u),v=(await PFo([y])).elide(_).getText();l-=n.tokenLength(v),d.push({uri:g,value:v})}}return d}a(jfn,"symbolRangesToCodeSnippets");async function PFo(t){if(t.length===0)return new yr([]);let e=t[0].node.fileName,r=[],n="";try{let o=Ko(e);o&&(n=(await qfn.promises.readFile(o)).toString())}catch{}for(let o of t)Hfn(o,n).forEach(s=>r.push(s));return new yr(r)}a(PFo,"sameFileSymbolRangeToElidableText");function Hfn(t,e){let n=[],o=t.node,s=e.substring(W6t(e,o.commentRange.start),o.commentRange.end);n.push([z6t(s),1-3e-4]);let c=W6t(e,o.bodyRange.start),l=W6t(e,o.extentRange.start),u=o.bodyRange.length===0?e.substring(l,o.extentRange.end):e.substring(o.commentRange.length===0?l:o.commentRange.end,c);if(fY(o.kind)&&(u="BEGIN "+u.trimStart()),n.push([z6t(u),1-1e-4]),t.children.length>0)for(let d of t.children)n.push(...Hfn(d,e));else{let d=1-(fY(t.node.kind)?3e-4:4e-4),f=e.substring(c,o.bodyRange.end);n.push([z6t(f),d])}return fY(o.kind)&&n.push(["END "+u.substring(6),1-1e-4]),n.filter(d=>d[0].length>0)}a(Hfn,"prepareForElidableText");function W6t(t,e){for(;e-1>=0&&(t[e-1]===" "||t[e-1]===" ");)e--;return e}a(W6t,"shiftLeftToNearestLineEndingOrAlphanumeric");function z6t(t){let e=0;for(;e=0&&(t[r]==="\r"||t[r]===` -`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(D3t,"trimLineEndingsAndTrailingWhitespace");var N3t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},M7=class extends N3t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];Nh(c);let u=await l.extractReferences(e,r);Nh(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>Zz(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(Nh(r),Zz(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},JGe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new M7(e,r,!0,!0)),this.strategies.set("java",new M7(e,r,!0,!0)),this.strategies.set("python",new M7(e,r,!0,!1)),this.strategies.set("typescript",new M7(e,r,!0,!0)),this.strategies.set("typescriptreact",new M7(e,r,!0,!0)),this.strategies.set("javascript",new M7(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);Nh(l);let d=Ss();return Zcn(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var iY={Id:"id"},ES={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},la={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var ZGe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new M3t(iY.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, +`||t[r]===" "||t[r]===" ");)r--;return t.substring(e,r+1)}a(z6t,"trimLineEndingsAndTrailingWhitespace");var Y6t=class{constructor(e,r){this.referenceExtractors=new Map;this.index=e,this.referenceExtractors=r}static{a(this,"ContextRetrievalStrategy")}},X7=class extends Y6t{static{a(this,"UnqualifiedNameRetrievalStrategy")}constructor(e,r,n,o){super(e,r),this.caseSensitive=n,this.typesOnly=o}async getContextAtPositionAsync(e,r,n,o,s,c){let l=this.referenceExtractors.get(o);if(!l)return[];Lh(c);let u=await l.extractReferences(e,r);Lh(c);let d=Array.from(u);d.sort((g,A)=>this.compareSymbolRangesByProximityToCaret(g,A,n));let f=[],h=new Set,m=await this.findDefinitionsViaUnqualifiedNames(d,s,c);this.typesOnly&&(m=m.filter(g=>fY(g.kind)));for(let g of m)h.has(JSON.stringify(g))||(h.add(JSON.stringify(g)),f.push(await this.makeSymbolRangeNodeFromDefinition(g,c)));return f}async findDefinitionsViaUnqualifiedNames(e,r,n){let o=Array.from(new Set(e.map(h=>h.unqualifiedName))),s=!this.caseSensitive,c=await this.index.findPotentialDefinitionsAsync(o,s,n),l=a(h=>s?h.toLowerCase():h,"lowercaseIfCaseInsensitive"),u=a(h=>l(h.unqualifiedName),"getSymbolKey"),d=new Map;for(let h of c){let m=u(h),g=d.get(m)??[];d.set(m,[...g,h])}let f=[];for(let h of o){let m=d.get(l(h));if(!(!m||m.length>r.mlcpMaxSymbolMatches)){if(f.length+m.length>r.mlcpMaxContextItems){f.push(...m.slice(0,r.mlcpMaxContextItems-f.length));break}f.push(...m)}}return f}async makeSymbolRangeNodeFromDefinition(e,r){if(Lh(r),fY(e.kind)){let n=await this.index.findSymbolsByFullyQualifiedNamePrefix(e.fileName,e.fullyQualifiedName+".",r),o=await Promise.all(n.map(s=>this.makeSymbolRangeNodeFromDefinition(s,r)));return{node:e,children:o}}else return{node:e,children:[]}}compareSymbolRangesByProximityToCaret(e,r,n){let o=e.extentRange.end<=n,s=r.extentRange.end<=n;if(o&&!s)return-1;if(!o&&s)return 1;let c=Math.abs(e.extentRange.start-n),l=Math.abs(r.extentRange.start-n);return c-l}},IVe=class{constructor(e,r){this.strategies=new Map;this.strategies.set("go",new X7(e,r,!0,!0)),this.strategies.set("java",new X7(e,r,!0,!0)),this.strategies.set("python",new X7(e,r,!0,!1)),this.strategies.set("typescript",new X7(e,r,!0,!0)),this.strategies.set("typescriptreact",new X7(e,r,!0,!0)),this.strategies.set("javascript",new X7(e,r,!0,!1))}static{a(this,"SyntaxAwareContextRetrieval")}async getStringifiedContextAtPositionAsync(e,r,n,o,s,c,l){let u=await this.getContextAtPositionAsync(e,r,n,o,s,l);Lh(l);let d=Cs();return jfn(u,c,e,d,l)}async getContextAtPositionAsync(e,r,n,o,s,c){return this.strategies.has(o)?this.strategies.get(o).getContextAtPositionAsync(e,r,n,o,s,c):[]}};p();p();p();p();var yY={Id:"id"},mS={FilePath:"filePath",LastWriteTimeUtc:"lastWriteTimeUtc"},oa={DocumentId:"documentId",FullyQualifiedName:"fullyQualifiedName",UnqualifiedName:"unqualifiedName",CommentStart:"commentStart",CommentLength:"commentLength",NameStart:"nameStart",NameLength:"nameLength",BodyStart:"bodyStart",BodyLength:"bodyLength",ExtentStart:"extentStart",ExtentLength:"extentLength",SymbolKind:"symbolKind",RefKind:"refKind"};p();p();var xVe=class{constructor(e,r,n){this.tableName=e;this.createOptimizations=r;this.extraCreateDeclarations=n;this.primaryKey=new K6t(yY.Id)}static{a(this,"SQLTableQueryGenerator")}createTableQueries(){return this.createTableString??=this.generateCreateTableString(),[this.createTableString,...this.createOptimizations]}generateCreateTableString(){let e=this.fields.map(r=>r.initColumnString());return this.extraCreateDeclarations&&e.push(this.extraCreateDeclarations),e.push(),[`CREATE TABLE IF NOT EXISTS ${this.tableName} (`,` ${this.primaryKey.initColumnString()},`,` ${e.join(`, `)}`,")"].join(` `)}insertQuery(e,r){this.cachedInsertQueryStrings??=this.generateInsertQueryStrings();let n=[this.cachedInsertQueryStrings.prefix,Array(r).fill(this.cachedInsertQueryStrings.valuesTemplate).join(`, `)];return e&&n.push("ON CONFLICT DO NOTHING"),n.join(` `)}generateInsertQueryStrings(){return{prefix:`INSERT INTO ${this.tableName} (${this.fields.map(e=>e.name).join(", ")}) -VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},GSe=class t extends ZGe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${ES.FilePath}');`]);this.fields=[new WSe(ES.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new gv(ES.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},$Se=class t extends ZGe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${la.DocumentId}', '${la.ExtentStart}', '${la.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${la.UnqualifiedName}');`],`FOREIGN KEY(${la.DocumentId}) REFERENCES Document(${iY.Id}) ON DELETE CASCADE`);this.fields=[new gv(la.DocumentId),new WSe(la.FullyQualifiedName,{notNull:!0}),new WSe(la.UnqualifiedName,{notNull:!0}),new gv(la.CommentStart,{notNull:!0}),new gv(la.CommentLength,{notNull:!0}),new gv(la.NameStart,{notNull:!0}),new gv(la.NameLength,{notNull:!0}),new gv(la.BodyStart,{notNull:!0}),new gv(la.BodyLength,{notNull:!0}),new gv(la.ExtentStart,{notNull:!0}),new gv(la.ExtentLength,{notNull:!0}),new gv(la.SymbolKind,{notNull:!0}),new gv(la.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},VSe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},WSe=class extends VSe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},gv=class extends VSe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},M3t=class extends VSe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var XGe=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?t$e(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${iY.Id} = ?`,[e])}},GL=class t extends XGe{static{a(this,"DocumentTable")}static{this.tableName=GSe.tableName}createQueryGenerator(){return new GSe}async updateTimestamp(e,r){let n=await this.init;n&&e$e(n,`UPDATE ${t.tableName} SET ${ES.LastWriteTimeUtc} = ? WHERE ${ES.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${t.tableName} WHERE ${ES.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?t$e(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${ES.FilePath} = ?`,[e]):[]}},Oh=class t extends XGe{static{a(this,"SymbolTable")}static{this.tableName=$Se.tableName}createQueryGenerator(){return new $Se}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&e$e(r,`DELETE FROM ${t.tableName} WHERE ${la.DocumentId} = ?`,[e])}};function t$e(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(t$e,"runDBQuery");function e$e(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(e$e,"runDBCommand");var eln=ce(require("node:sqlite"));var r$e=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${GL.tableName} ON ${Oh.tableName}.${la.DocumentId} = ${GL.tableName}.${iY.Id}`;this.db=this.initDb(e),this.documentTable=new GL(this.db),this.symbolTable=new Oh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new eln.default.DatabaseSync(e,{open:!0});return r.exec(` +VALUES`,valuesTemplate:`(${Array(this.fields.length).fill("?").join(", ")})`}}},pTe=class t extends xVe{constructor(){super(t.tableName,[`CREATE UNIQUE INDEX IF NOT EXISTS 'IX_Document_FilePath' ON '${t.tableName}' ('${mS.FilePath}');`]);this.fields=[new gTe(mS.FilePath,{notNull:!0,collate:!0,noCase:!0,unique:!0}),new _C(mS.LastWriteTimeUtc,{notNull:!0})]}static{a(this,"DocumentQueryGenerator")}static{this.tableName="Document"}},hTe=class t extends xVe{constructor(){super(t.tableName,[`CREATE INDEX IF NOT EXISTS 'IX_Symbol_DocumentId' ON '${t.tableName}' ('${oa.DocumentId}', '${oa.ExtentStart}', '${oa.ExtentLength}');`,`CREATE INDEX IF NOT EXISTS 'IX_Symbol_UnqualifiedName' ON '${t.tableName}' ('${oa.UnqualifiedName}');`],`FOREIGN KEY(${oa.DocumentId}) REFERENCES Document(${yY.Id}) ON DELETE CASCADE`);this.fields=[new _C(oa.DocumentId),new gTe(oa.FullyQualifiedName,{notNull:!0}),new gTe(oa.UnqualifiedName,{notNull:!0}),new _C(oa.CommentStart,{notNull:!0}),new _C(oa.CommentLength,{notNull:!0}),new _C(oa.NameStart,{notNull:!0}),new _C(oa.NameLength,{notNull:!0}),new _C(oa.BodyStart,{notNull:!0}),new _C(oa.BodyLength,{notNull:!0}),new _C(oa.ExtentStart,{notNull:!0}),new _C(oa.ExtentLength,{notNull:!0}),new _C(oa.SymbolKind,{notNull:!0}),new _C(oa.RefKind,{notNull:!0})]}static{a(this,"SymbolQueryGenerator")}static{this.tableName="Symbol"}},mTe=class{constructor(e,r){this.name=e;this.notNull=r?.notNull??!1}static{a(this,"SQLField")}},gTe=class extends mTe{static{a(this,"StringColumn")}constructor(e,r){super(e,{notNull:r?.notNull}),this.collate=r?.collate??!1,this.noCase=r?.noCase??!1,this.unique=r?.unique??!1}initColumnString(){let e=this.collate?"COLLATE":void 0,r=this.noCase?"NOCASE":void 0,n=this.notNull?"NOT NULL":void 0,o=this.unique?"UNIQUE":void 0,s=[e,r,n,o].filter(c=>c).join(" ");return`'${this.name}' VARCHAR(500) ${s}`}},_C=class extends mTe{static{a(this,"NumberColumn")}initColumnString(){return`'${this.name}' INTEGER${this.notNull?" NOT NULL":""}`}},K6t=class extends mTe{static{a(this,"NumberPrimaryKeyColumn")}initColumnString(){return`'${this.name}' INTEGER PRIMARY KEY AUTOINCREMENT${this.notNull?" NOT NULL":""}`}};var wVe=class{static{a(this,"SQLTable")}constructor(e){this.queryGenerator=this.createQueryGenerator(),this.init=this.doInit(e)}async doInit(e){let r=await e;if(r)return this.create(r),r}create(e){let r=this.queryGenerator.createTableQueries();for(let n of r)e.exec(n)}async insert(e,r){let n=await this.init;if(!n)return;let o=this.queryGenerator.insertQuery(r,e.length),c=e.map(l=>Object.values(l)).flat();n.prepare(o).run(...c)}async getAllRows(){let e=await this.init;return e?PVe(e,`SELECT * FROM ${this.queryGenerator.tableName}`,[]):[]}async deleteRow(e){let r=await this.init;r&&RVe(r,`DELETE FROM ${this.queryGenerator.tableName} WHERE ${yY.Id} = ?`,[e])}},XL=class t extends wVe{static{a(this,"DocumentTable")}static{this.tableName=pTe.tableName}createQueryGenerator(){return new pTe}async updateTimestamp(e,r){let n=await this.init;n&&RVe(n,`UPDATE ${t.tableName} SET ${mS.LastWriteTimeUtc} = ? WHERE ${mS.FilePath} = ?`,[r,e])}async deleteAllWithPath(e){let r=await this.init;r&&RVe(r,`DELETE FROM ${t.tableName} WHERE ${mS.FilePath} = ?`,[e])}async getDocumentByFilePath(e){let r=await this.init;return r?PVe(r,`SELECT * FROM ${this.queryGenerator.tableName} WHERE ${mS.FilePath} = ?`,[e]):[]}},Uh=class t extends wVe{static{a(this,"SymbolTable")}static{this.tableName=hTe.tableName}createQueryGenerator(){return new hTe}async clearAllSymbolsFromDocument(e){let r=await this.init;r&&RVe(r,`DELETE FROM ${t.tableName} WHERE ${oa.DocumentId} = ?`,[e])}};function PVe(t,e,r){let o=Array.isArray(r)?r:[r];return o.length>0?t.prepare(e).all(...o):t.prepare(e).all()}a(PVe,"runDBQuery");function RVe(t,e,r){let o=Array.isArray(r)?r:[r];o.length>0?t.prepare(e).run(...o):t.prepare(e).run()}a(RVe,"runDBCommand");var Gfn=fe(require("node:sqlite"));var kVe=class{constructor(e){this.databaseFileName=e;this.innerJoinStatement=`INNER JOIN ${XL.tableName} ON ${Uh.tableName}.${oa.DocumentId} = ${XL.tableName}.${yY.Id}`;this.db=this.initDb(e),this.documentTable=new XL(this.db),this.symbolTable=new Uh(this.db)}static{a(this,"DocumentSymbolDatabase")}initDb(e){try{let r=new Gfn.default.DatabaseSync(e,{open:!0});return r.exec(` PRAGMA journal_mode = wal; PRAGMA synchronous = normal; PRAGMA optimize = 0x10002; PRAGMA foreign_keys = ON; - `),Promise.resolve(r)}catch(r){return console.error("Error initializing database:",r),Promise.resolve(void 0)}}async close(){let e=await this.db;e&&(await this.documentTable.init,await this.symbolTable.init,e.close())}async querySymbolsFuzzilyUsingUnqualifiedName(e,r){return await this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.UnqualifiedName} BETWEEN ? AND (? || '~')`,`ORDER BY ${la.UnqualifiedName}`,"LIMIT ?"].join(` -`),[e,e,r])}async querySymbolsUsingUnqualifiedNames(e,r){let n=e.map(()=>"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.UnqualifiedName} ${o}IN (${n})`].join(` -`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${la.FullyQualifiedName} = ?`].join(` -`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.ExtentStart} <= ? AND (${Oh.tableName}.${la.ExtentStart} + ${Oh.tableName}.${la.ExtentLength}) >= ?`].join(` -`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.ExtentStart} >= ? AND (${Oh.tableName}.${la.ExtentStart} + ${Oh.tableName}.${la.ExtentLength}) <= ?`,`ORDER BY ${Oh.tableName}.${la.ExtentStart}`].join(` -`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Oh.tableName}`,this.innerJoinStatement,`WHERE ${GL.tableName}.${ES.FilePath} = ? AND ${Oh.tableName}.${la.FullyQualifiedName} LIKE ?`,`ORDER BY ${Oh.tableName}.${la.ExtentStart}`].join(` -`),[e,`${r}%`])}async insertSymbols(e){return await this.symbolTable.insert(e,!1)}async insertDocument(e,r,n=!1){return await this.documentTable.insert([{filePath:e,lastWriteTimeUtc:r}],n)}async clearAllSymbolsFromDocument(e){return this.symbolTable.clearAllSymbolsFromDocument(e)}async updateDocumentTimestamp(e,r){return this.documentTable.updateTimestamp(e,r)}async deleteAllDocumentsWithPath(e){return this.documentTable.deleteAllWithPath(e)}async getAllDocuments(){return this.documentTable.getAllRows()}getDocument(e){return this.documentTable.getDocumentByFilePath(e)}async query(e,r){let n=await this.db;return n?(await this.documentTable.init,await this.symbolTable.init,t$e(n,e,r)):[]}};var n$e=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new r$e(e)}async close(){await this.database.close()}async insertOrReplaceDocumentSymbolsAsync(e,r,n){let o=await this.getOrCreateDocumentAsync(e,r);await this.database.clearAllSymbolsFromDocument(o.id),n.length>0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return mce(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew gx(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new cu(e.commentStart,e.commentLength),new cu(e.nameStart,e.nameLength),new cu(e.bodyStart,e.bodyLength),new cu(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(mce,"symbolsToSymbolRanges");var o$e=ce(require("fs/promises"));var i$e=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new n$e(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=ho(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await o$e.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await o$e.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function O3t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>qNo(r))}a(O3t,"isIndexWorkerData");var zSe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},O7=class extends zSe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},s$e=class extends zSe{constructor(r){super(By.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},By={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},a$e=class extends O7{constructor(r,n,o){super(r,By.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},c$e=class extends O7{constructor(r,n){super(r,By.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},l$e=class extends O7{constructor(r,n,o){super(r,By.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},u$e=class extends O7{constructor(r,n){super(r,By.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},d$e=class extends O7{constructor(r,n,o,s,c,l){super(r,By.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},f$e=class extends O7{static{a(this,"ExitRequest")}constructor(e){super(e,By.Exit)}},rP=class extends zSe{constructor(r,n,o){super(By.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function qNo(t){return"databaseFilePath"in t&&"rootPath"in t}a(qNo,"isIndexableWorkspaceFolder");var tln=ce(ti()),B7=require("worker_threads");var p$e=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new i$e(e,qcn,jcn,r),this.contextRetreival=new JGe(this.index.reader,Qcn)}},B3t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=Wn(o.rootPath);this.indices.set(s,new p$e(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new tln.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case By.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case By.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case By.Cancel:n.get(e.id)?.cancel(),s=new rP(e.id,void 0,void 0);break;case By.Exit:s=await this.dispatchExit(e,r,o.token);break;case By.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case By.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case By.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new rP(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=Wn(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new rP(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=Wn(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new rP(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=Wn(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new rP(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new rP(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new p$e(e.databaseFilePath)),new rP(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=Wn(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new rP(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function rln(){return O3t(B7.workerData)}a(rln,"isIndexWorker");function nln(){let t=B7.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!O3t(B7.workerData))throw new Error("Worker data must provide a valid database path.");let e=B7.workerData.cwd;process.cwd=()=>e,new B3t(t,B7.workerData.indexWorkspaceRoots,B7.workerData.params)}a(nln,"runIndexWorker");p();p();var YSe=require("fs"),iln=require("path");var L7=class extends Fo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await YSe.promises.readFile(Wn(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(Wn(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=Wn(e),n=await YSe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,iln.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await YSe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await YSe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();async function jNo(t){if(t.isCancellationRequested)return;let e=new rA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(jNo,"cancellationTokenToPromise");async function oln(t,e){if(e){let r=jNo(e);await Promise.race([t,r])}else await t}a(oln,"raceCancellation");function L3t(t){return Array.isArray(t)}a(L3t,"isArrayOfT");async function sln(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await F3t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(sln,"resolveAll");async function F3t(t,e){let r;return t instanceof Promise?r=await HNo(t,e):r=await GNo(t,e),r}a(F3t,"resolve");async function HNo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:L3t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await oln(o,e),n.resolutionTime=performance.now()-r,n}a(HNo,"resolvePromise");async function GNo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await oln(o,e),n.resolutionTime=performance.now()-r,n}a(GNo,"resolveIterable");p();p();var h$e="[...]",$No=0,Av=-1;function uf(){return $No++}a(uf,"getAvailableNodeId");function VNo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(VNo,"elideChildren");function aln(t,e=h$e){return r=>t.tokenLength(VNo(r,e))}a(aln,"getTokenizerCostFunction");p();var U7=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function WNo(t){let e={id:t.id??uf(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??h$e,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(WNo,"createRenderNode");function zNo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(zNo,"isRenderedChildRequired");function cln(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(cln,"rectifiedValue");function KSe(t,e){let r=lln(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(KSe,"rectifyWeights");function lln(t,e){let r=t.children.map(s=>lln(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new U7([]);let n=new U7(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(lln,"recursivelyRectifyWeights");function uln(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(E.id),"elider"),m=[],g=new Map;if(Q3t(t,m,h,g),m.length===0)return U3t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((E,_)=>E+_.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new U7([{item:t,priority:cln(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,cln(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(Q3t(t,h,m,g),h.length===0)return U3t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return U3t(t,o)}a(uln,"render");function U3t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(U3t,"renderEmpty");function Q3t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=zNo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=Q3t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(Q3t,"recursivelyRender");function JSe(t,e,r=h$e){let n=t.children.map(c=>JSe(c,e,r));r=t.elisionMarker??r;let o=e(t);return WNo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(JSe,"snapshot");var Q7={id:uf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var nP=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var g$e={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function YNo(t,e,r=g$e,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=xa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(YNo,"getDirectoryChildren");function KNo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=tf(e);for(;o.startsWith(r);){n.push(o);let s=tf(o);if(s.length>=o.length)break;o=s}return n}a(KNo,"getAncestors");function JNo(t,e,r=g$e.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=KNo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(JNo,"getAncestorWeights");async function*q3t(t,e,r,n,o,s){let c={...g$e,...r},l=c.MaxResults,u=c.Decay,d=JNo(t,e,u),f=new U7([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await YNo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(q3t,"getNearbyDocuments");var m$e=class extends nP{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=g$e;this.cache=new sk(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of q3t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function G0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(G0,"setDefault");var ZNo={MaxActiveSymbols:500,SymbolCacheSize:1e6},A$e=class extends nP{constructor(){super(...arguments);this.config=ZNo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new nn(this.config.SymbolCacheSize);this.textSymbols=new nn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=G0(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of j3t(l)){let d=G0(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())G0(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&dln(o))}},XNo=/^[a-zA-Z_]{2,}\w+$/;function dln(t){return XNo.test(t)}a(dln,"isSymbol");function eMo(t){return t.toLowerCase()}a(eMo,"normalizeWord");function*j3t(t){for(let e of t.split(/\W/))dln(e)&&(yield eMo(e))}a(j3t,"getTextSymbols");var tMo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},y$e=class extends A$e{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=tMo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new sk(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of j3t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=G0(this.textSymbols,l,()=>this.createSymbol(!1));G0(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of q3t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function fln(t){return t.nodeId!==void 0}a(fln,"isNodeLocation");var pln={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},E$e=class extends nP{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=pln[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let E of g.locations)fln(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(fln(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:Av});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=pln[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};G0(this.eventsByType,r,()=>new nn(s.maxEventCount)).set(++this.nextId,c)}};p();var _$e=class extends nP{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??Av,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function rMo(t){return t.id!==void 0}a(rMo,"isNodeItem");function nMo(t){return!("uri"in t)&&!("id"in t)}a(nMo,"isNullItem");var hln={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function mln(t){return t in hln}a(mln,"isSourceId");var q7="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",gce=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==Av),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},C$e=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=hln;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new gce([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new gce(r.items):new gce([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(Av);if(l!==void 0&&l>0){s.delete(Av);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new gce(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(nMo(r))return{weight:r.weight,uri:q7,id:Av};let n=rMo(r)?r.id:Av,o=r.uri??this.activeContext.getUri(n)??q7;return o===q7&&(n=Av),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=G0(r,s,()=>new Map),d=Av;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==q7?this.activeContext.normalizeUri(u)??q7:q7;for(let[h,m]of d.entries())u===q7||h===Av?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(q7),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:Av,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var H3t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*gln(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=oMo(e,this.document),o=new H3t(uf(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;miMo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function oMo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(oMo,"buildText");function*gln(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*gln(r,e))}a(gln,"walk");p();p();p();var b$e=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function G3t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:G3t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=G3t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new b$e(uf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(G3t,"recursivelyBuildNode");function Aln(t){let e=nY(t.getText(),t.detectedLanguageId);return G3t(e,t.lineCount,t)??new b$e(uf(),e,[],0,t.lineCount-1,t)}a(Aln,"parse");var S$e={source:"indentation",parse:Aln,update(t,e){return{root:Aln(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var Eln=ce(ice());function yln(t){return{line:t.row,character:t.column}}a(yln,"asPosition");var NM=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},j7=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new Eln.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return S$e.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:yln(e.startPosition),end:yln(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var sMo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),aMo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),cMo=new Set(["identifier"]),lMo=new Set(["string","comment"]),_ln=new NM(sMo,aMo,cMo,lMo);p();var uMo=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),dMo=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),fMo=new Set(["identifier"]),pMo=new Set(["string_literal","line_comment","block_comment"]),Cln=new NM(uMo,dMo,fMo,pMo);p();var hMo=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),mMo=new Set(["module","block","parameters","dictionary","list"]),gMo=new Set(["identifier"]),AMo=new Set(["string","comment"]),vln=new NM(hMo,mMo,gMo,AMo);p();var yMo=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),EMo=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),_Mo=new Set(["identifier"]),CMo=new Set(["string","comment"]),bln=new NM(yMo,EMo,_Mo,CMo);var Sln=ce(ice());async function Tln(t){await Sln.default.init();try{let e=await a3t(t);switch(t){case"python":return new j7(e,"tree-sitter-python",vln);case"typescript":return new j7(e,"tree-sitter-typescript",bln);case"java":return new j7(e,"tree-sitter-java",Cln);case"cpp":return new j7(e,"tree-sitter-cpp",_ln);default:return new j7(e,"tree-sitter-generic")}}catch{return S$e}}a(Tln,"getParser");var $3t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},T$e=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},Iln=500,I$e=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new nn(Iln);this.allowedExtensions=new Set(N7);this.invalidDocumentCache=new sk(Iln,this.config.InvalidCacheTime),this.cachedDocuments=new o6e(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>HL[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(P9e(e),r=ca(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(SWr(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new $3t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new T$e(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new rA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new T$e(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new v$e(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=G0(this.createdNodes,e,()=>new Set),o=G0(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await Tln(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var vMo="WorkspaceContextWorker";function V3t(t){let e=t;return e?.workerId===vMo&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(V3t,"isContextWorkerData");var bMo=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function xln(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return bMo.includes(e)?e:void 0}a(xln,"getContextMessageType");var H7=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();z3t();p();var Dln;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Dln||(Dln={}));var Y3t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Y3t||(Y3t={}));var Nln;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(Nln||(Nln={}));var w$e;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(w$e||(w$e={}));var Ly;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=w$e.MAX_VALUE),o===Number.MAX_VALUE&&(o=w$e.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.uinteger(o.line)&&dt.uinteger(o.character)}a(r,"is"),t.is=r})(Ly||(Ly={}));var lu;(function(t){function e(n,o,s,c){if(dt.uinteger(n)&&dt.uinteger(o)&&dt.uinteger(s)&&dt.uinteger(c))return{start:Ly.create(n,o),end:Ly.create(s,c)};if(Ly.is(n)&&Ly.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&Ly.is(o.start)&&Ly.is(o.end)}a(r,"is"),t.is=r})(lu||(lu={}));var R$e;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&(dt.string(o.uri)||dt.undefined(o.uri))}a(r,"is"),t.is=r})(R$e||(R$e={}));var Mln;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.targetRange)&&dt.string(o.targetUri)&&lu.is(o.targetSelectionRange)&&(lu.is(o.originSelectionRange)||dt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(Mln||(Mln={}));var K3t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.numberRange(o.red,0,1)&&dt.numberRange(o.green,0,1)&&dt.numberRange(o.blue,0,1)&&dt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(K3t||(K3t={}));var Oln;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&K3t.is(o.color)}a(r,"is"),t.is=r})(Oln||(Oln={}));var Bln;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.string(o.label)&&(dt.undefined(o.textEdit)||yce.is(o))&&(dt.undefined(o.additionalTextEdits)||dt.typedArray(o.additionalTextEdits,yce.is))}a(r,"is"),t.is=r})(Bln||(Bln={}));var Lln;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Lln||(Lln={}));var Fln;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return dt.defined(s)&&(d.startCharacter=s),dt.defined(c)&&(d.endCharacter=c),dt.defined(l)&&(d.kind=l),dt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.uinteger(o.startLine)&&dt.uinteger(o.startLine)&&(dt.undefined(o.startCharacter)||dt.uinteger(o.startCharacter))&&(dt.undefined(o.endCharacter)||dt.uinteger(o.endCharacter))&&(dt.undefined(o.kind)||dt.string(o.kind))}a(r,"is"),t.is=r})(Fln||(Fln={}));var J3t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&R$e.is(o.location)&&dt.string(o.message)}a(r,"is"),t.is=r})(J3t||(J3t={}));var Uln;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Uln||(Uln={}));var Qln;(function(t){t.Unnecessary=1,t.Deprecated=2})(Qln||(Qln={}));var qln;(function(t){function e(r){let n=r;return dt.objectLiteral(n)&&dt.string(n.href)}a(e,"is"),t.is=e})(qln||(qln={}));var k$e;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return dt.defined(s)&&(d.severity=s),dt.defined(c)&&(d.code=c),dt.defined(l)&&(d.source=l),dt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return dt.defined(s)&&lu.is(s.range)&&dt.string(s.message)&&(dt.number(s.severity)||dt.undefined(s.severity))&&(dt.integer(s.code)||dt.string(s.code)||dt.undefined(s.code))&&(dt.undefined(s.codeDescription)||dt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(dt.string(s.source)||dt.undefined(s.source))&&(dt.undefined(s.relatedInformation)||dt.typedArray(s.relatedInformation,J3t.is))}a(r,"is"),t.is=r})(k$e||(k$e={}));var Ace;(function(t){function e(n,o,...s){let c={title:n,command:o};return dt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.title)&&dt.string(o.command)}a(r,"is"),t.is=r})(Ace||(Ace={}));var yce;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return dt.objectLiteral(c)&&dt.string(c.newText)&&lu.is(c.range)}a(o,"is"),t.is=o})(yce||(yce={}));var Z3t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&dt.string(o.label)&&(dt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(dt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(Z3t||(Z3t={}));var Ece;(function(t){function e(r){let n=r;return dt.string(n)}a(e,"is"),t.is=e})(Ece||(Ece={}));var jln;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return yce.is(c)&&(Z3t.is(c.annotationId)||Ece.is(c.annotationId))}a(o,"is"),t.is=o})(jln||(jln={}));var X3t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&iFt.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(X3t||(X3t={}));var eFt;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&dt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||dt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||dt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(eFt||(eFt={}));var tFt;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&dt.string(o.oldUri)&&dt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||dt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||dt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(tFt||(tFt={}));var rFt;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&dt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||dt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||dt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Ece.is(o.annotationId))}a(r,"is"),t.is=r})(rFt||(rFt={}));var nFt;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>dt.string(o.kind)?eFt.is(o)||tFt.is(o)||rFt.is(o):X3t.is(o)))}a(e,"is"),t.is=e})(nFt||(nFt={}));var Hln;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)}a(r,"is"),t.is=r})(Hln||(Hln={}));var Gln;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)&&dt.integer(o.version)}a(r,"is"),t.is=r})(Gln||(Gln={}));var iFt;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)&&(o.version===null||dt.integer(o.version))}a(r,"is"),t.is=r})(iFt||(iFt={}));var $ln;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.string(o.uri)&&dt.string(o.languageId)&&dt.integer(o.version)&&dt.string(o.text)}a(r,"is"),t.is=r})($ln||($ln={}));var oFt;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(oFt||(oFt={}));var ZSe;(function(t){function e(r){let n=r;return dt.objectLiteral(r)&&oFt.is(n.kind)&&dt.string(n.value)}a(e,"is"),t.is=e})(ZSe||(ZSe={}));var Vln;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Vln||(Vln={}));var Wln;(function(t){t.PlainText=1,t.Snippet=2})(Wln||(Wln={}));var zln;(function(t){t.Deprecated=1})(zln||(zln={}));var Yln;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&dt.string(o.newText)&&lu.is(o.insert)&&lu.is(o.replace)}a(r,"is"),t.is=r})(Yln||(Yln={}));var Kln;(function(t){t.asIs=1,t.adjustIndentation=2})(Kln||(Kln={}));var Jln;(function(t){function e(r){let n=r;return n&&(dt.string(n.detail)||n.detail===void 0)&&(dt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(Jln||(Jln={}));var Zln;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(Zln||(Zln={}));var Xln;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Xln||(Xln={}));var P$e;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return dt.string(o)||dt.objectLiteral(o)&&dt.string(o.language)&&dt.string(o.value)}a(r,"is"),t.is=r})(P$e||(P$e={}));var eun;(function(t){function e(r){let n=r;return!!n&&dt.objectLiteral(n)&&(ZSe.is(n.contents)||P$e.is(n.contents)||dt.typedArray(n.contents,P$e.is))&&(r.range===void 0||lu.is(r.range))}a(e,"is"),t.is=e})(eun||(eun={}));var tun;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})(tun||(tun={}));var nun;(function(t){function e(r,n,...o){let s={label:r};return dt.defined(n)&&(s.documentation=n),dt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(nun||(nun={}));var iun;(function(t){t.Text=1,t.Read=2,t.Write=3})(iun||(iun={}));var oun;(function(t){function e(r,n){let o={range:r};return dt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(oun||(oun={}));var sun;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(sun||(sun={}));var aun;(function(t){t.Deprecated=1})(aun||(aun={}));var cun;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(cun||(cun={}));var lun;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(lun||(lun={}));var uun;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&dt.string(o.name)&&dt.number(o.kind)&&lu.is(o.range)&&lu.is(o.selectionRange)&&(o.detail===void 0||dt.string(o.detail))&&(o.deprecated===void 0||dt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(uun||(uun={}));var dun;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(dun||(dun={}));var D$e;(function(t){t.Invoked=1,t.Automatic=2})(D$e||(D$e={}));var fun;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.typedArray(o.diagnostics,k$e.is)&&(o.only===void 0||dt.typedArray(o.only,dt.string))&&(o.triggerKind===void 0||o.triggerKind===D$e.Invoked||o.triggerKind===D$e.Automatic)}a(r,"is"),t.is=r})(fun||(fun={}));var pun;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Ace.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&dt.string(o.title)&&(o.diagnostics===void 0||dt.typedArray(o.diagnostics,k$e.is))&&(o.kind===void 0||dt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Ace.is(o.command))&&(o.isPreferred===void 0||dt.boolean(o.isPreferred))&&(o.edit===void 0||nFt.is(o.edit))}a(r,"is"),t.is=r})(pun||(pun={}));var hun;(function(t){function e(n,o){let s={range:n};return dt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&lu.is(o.range)&&(dt.undefined(o.command)||Ace.is(o.command))}a(r,"is"),t.is=r})(hun||(hun={}));var mun;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&dt.uinteger(o.tabSize)&&dt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(mun||(mun={}));var gun;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&lu.is(o.range)&&(dt.undefined(o.target)||dt.string(o.target))}a(r,"is"),t.is=r})(gun||(gun={}));var Aun;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&lu.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(Aun||(Aun={}));var yun;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(yun||(yun={}));var Eun;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Eun||(Eun={}));var _un;(function(t){function e(r){let n=r;return dt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})(_un||(_un={}));var Cun;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&lu.is(o.range)&&dt.string(o.text)}a(r,"is"),t.is=r})(Cun||(Cun={}));var vun;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&lu.is(o.range)&&dt.boolean(o.caseSensitiveLookup)&&(dt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(vun||(vun={}));var bun;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&lu.is(o.range)&&(dt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(bun||(bun={}));var Sun;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.defined(o)&&lu.is(n.stoppedLocation)}a(r,"is"),t.is=r})(Sun||(Sun={}));var sFt;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(sFt||(sFt={}));var aFt;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&(o.tooltip===void 0||dt.string(o.tooltip)||ZSe.is(o.tooltip))&&(o.location===void 0||R$e.is(o.location))&&(o.command===void 0||Ace.is(o.command))}a(r,"is"),t.is=r})(aFt||(aFt={}));var Tun;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return dt.objectLiteral(o)&&Ly.is(o.position)&&(dt.string(o.label)||dt.typedArray(o.label,aFt.is))&&(o.kind===void 0||sFt.is(o.kind))&&o.textEdits===void 0||dt.typedArray(o.textEdits,yce.is)&&(o.tooltip===void 0||dt.string(o.tooltip)||ZSe.is(o.tooltip))&&(o.paddingLeft===void 0||dt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||dt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(Tun||(Tun={}));var Iun;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(Iun||(Iun={}));var xun;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(xun||(xun={}));var wun;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(wun||(wun={}));var Run;(function(t){t.Invoked=0,t.Automatic=1})(Run||(Run={}));var kun;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(kun||(kun={}));var Pun;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(Pun||(Pun={}));var Dun;(function(t){function e(r){let n=r;return dt.objectLiteral(n)&&Y3t.is(n.uri)&&dt.string(n.name)}a(e,"is"),t.is=e})(Dun||(Dun={}));var Nun;(function(t){function e(s,c,l,u){return new cFt(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(dt.defined(c)&&dt.string(c.uri)&&(dt.undefined(c.languageId)||dt.string(c.languageId))&&dt.uinteger(c.lineCount)&&dt.func(c.getText)&&dt.func(c.positionAt)&&dt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f"?").join(", "),o=r?"COLLATE NOCASE ":"";return await this.query([`SELECT * FROM ${Uh.tableName}`,this.innerJoinStatement,`WHERE ${oa.UnqualifiedName} ${o}IN (${n})`].join(` +`),e)}async querySymbolsUsingFullyQualifiedName(e){return this.query([`SELECT * FROM ${Uh.tableName}`,this.innerJoinStatement,`WHERE ${oa.FullyQualifiedName} = ?`].join(` +`),[e])}async querySymbolsContainingPosition(e,r){return this.query([`SELECT * FROM ${Uh.tableName}`,this.innerJoinStatement,`WHERE ${XL.tableName}.${mS.FilePath} = ? AND ${Uh.tableName}.${oa.ExtentStart} <= ? AND (${Uh.tableName}.${oa.ExtentStart} + ${Uh.tableName}.${oa.ExtentLength}) >= ?`].join(` +`),[e,r,r])}async querySymbolsContainedByRange(e,r,n){return this.query([`SELECT * FROM ${Uh.tableName}`,this.innerJoinStatement,`WHERE ${XL.tableName}.${mS.FilePath} = ? AND ${Uh.tableName}.${oa.ExtentStart} >= ? AND (${Uh.tableName}.${oa.ExtentStart} + ${Uh.tableName}.${oa.ExtentLength}) <= ?`,`ORDER BY ${Uh.tableName}.${oa.ExtentStart}`].join(` +`),[e,r,n])}async querySymbolsByQualifiedNamePrefix(e,r){return this.query([`SELECT * FROM ${Uh.tableName}`,this.innerJoinStatement,`WHERE ${XL.tableName}.${mS.FilePath} = ? AND ${Uh.tableName}.${oa.FullyQualifiedName} LIKE ?`,`ORDER BY ${Uh.tableName}.${oa.ExtentStart}`].join(` +`),[e,`${r}%`])}async insertSymbols(e){return await this.symbolTable.insert(e,!1)}async insertDocument(e,r,n=!1){return await this.documentTable.insert([{filePath:e,lastWriteTimeUtc:r}],n)}async clearAllSymbolsFromDocument(e){return this.symbolTable.clearAllSymbolsFromDocument(e)}async updateDocumentTimestamp(e,r){return this.documentTable.updateTimestamp(e,r)}async deleteAllDocumentsWithPath(e){return this.documentTable.deleteAllWithPath(e)}async getAllDocuments(){return this.documentTable.getAllRows()}getDocument(e){return this.documentTable.getDocumentByFilePath(e)}async query(e,r){let n=await this.db;return n?(await this.documentTable.init,await this.symbolTable.init,PVe(n,e,r)):[]}};var DVe=class{static{a(this,"SQLStorageReaderWriter")}constructor(e){this.database=new kVe(e)}async close(){await this.database.close()}async insertOrReplaceDocumentSymbolsAsync(e,r,n){let o=await this.getOrCreateDocumentAsync(e,r);await this.database.clearAllSymbolsFromDocument(o.id),n.length>0&&await this.database.insertSymbols(n.map(s=>({documentId:o.id,fullyQualifiedName:s.fullyQualifiedName,unqualifiedName:s.unqualifiedName,commentStart:s.commentRange.start,commentLength:s.commentRange.length,nameStart:s.nameRange.start,nameLength:s.nameRange.length,bodyStart:s.bodyRange.start,bodyLength:s.bodyRange.length,extentStart:s.extentRange.start,extentLength:s.extentRange.length,symbolKind:s.kind,refKind:s.refKind}))),await this.database.updateDocumentTimestamp(e,r)}async addDocumentsAsync(e){for(let r of e)r=r.toLowerCase(),await this.database.insertDocument(r,Date.now(),!0)}async deleteDocumentAsync(e){return await this.database.deleteAllDocumentsWithPath(e.toLowerCase())}async updateDocumentTimestampAsync(e,r){return await this.database.updateDocumentTimestamp(e.toLowerCase(),r)}async fuzzyMatchSymbolsAsync(e,r){return Dce(await this.database.querySymbolsFuzzilyUsingUnqualifiedName(e,r))}async findPotentialDefinitionsAsync(e,r,n){let o=[],c=0;for(;cnew Ax(e.filePath,e.fullyQualifiedName,e.unqualifiedName,new su(e.commentStart,e.commentLength),new su(e.nameStart,e.nameLength),new su(e.bodyStart,e.bodyLength),new su(e.extentStart,e.extentLength),e.symbolKind,e.refKind))}a(Dce,"symbolsToSymbolRanges");var MVe=fe(require("fs/promises"));var NVe=class{static{a(this,"Index")}constructor(e,r,n,o){this.storage=new DVe(e),this.symbolExtractors=r,this.importExtractors=n,this.params=o}dispose(){return this.storage.close()}get reader(){return this.storage}async indexFile(e,r){let n=Ko(e);if(!n)throw Error(`Cannot resolve a readable file path from ${e}`);let o;try{o=await MVe.stat(n)}catch{await this.storage.deleteDocumentAsync(e);return}let s=o.mtimeMs,c=await this.storage.getDocumentAsync(e);if(c&&c.lastWriteTimeUtc>=s)return;let l=this.symbolExtractors.get(r);if(!l)return;let u=(await MVe.readFile(n)).toString(),d=await l.extractSymbols(e,u),f=d;if(this.params?.mlcpEnableImports){let h=this.importExtractors.get(r);if(h){let m=await h.extractSymbols(e,u);f=[...d,...m]}}await this.storage.insertOrReplaceDocumentSymbolsAsync(e,s,f)}async getDocumentFilePaths(){return(await this.storage.getDocumentsAsync()).map(r=>r.filePath)}};p();function J6t(t){let e=t;return typeof e?.cwd=="string"&&Array.isArray(e?.indexWorkspaceRoots)&&e.indexWorkspaceRoots.every(r=>kFo(r))}a(J6t,"isIndexWorkerData");var ATe=class{static{a(this,"IndexNotification")}constructor(e){this.operation=e}},eQ=class extends ATe{constructor(r,n){super(n);this.id=r;this.id=r}static{a(this,"IndexRequest")}},OVe=class extends ATe{constructor(r){super(jy.Cancel);this.messageIdToCancel=r}static{a(this,"CancellationNotification")}},jy={CreateIndex:"createIndex",AddOrInvalidated:"addOrInvalidated",GetContext:"getContext",Exit:"exit",Response:"response",RemoveIndex:"removeIndex",Cancel:"cancel",GetAllDocumentsInWorkspace:"getAllDocumentsInWorkspace"},BVe=class extends eQ{constructor(r,n,o){super(r,jy.CreateIndex);this.baseWorkspaceFolderUri=n;this.databaseFilePath=o}static{a(this,"CreateIndexRequest")}},LVe=class extends eQ{constructor(r,n){super(r,jy.RemoveIndex);this.baseWorkspaceFolderUri=n}static{a(this,"RemoveIndexRequest")}},FVe=class extends eQ{constructor(r,n,o){super(r,jy.AddOrInvalidated);this.fileUri=n;this.languageId=o}static{a(this,"AddOrInvalidatedRequest")}},UVe=class extends eQ{constructor(r,n){super(r,jy.GetAllDocumentsInWorkspace);this.baseWorkspaceFolderUri=n}static{a(this,"GetAllDocumentsRequest")}},QVe=class extends eQ{constructor(r,n,o,s,c,l){super(r,jy.GetContext);this.fileUri=n;this.code=o;this.offset=s;this.languageId=c;this.params=l}static{a(this,"GetContextRequest")}},qVe=class extends eQ{static{a(this,"ExitRequest")}constructor(e){super(e,jy.Exit)}},lk=class extends ATe{constructor(r,n,o){super(jy.Response);this.id=r;this.error=n;this.data=o;n&&"code"in n&&typeof n.code=="string"&&(this.code=n.code)}static{a(this,"ResponseMessage")}};function kFo(t){return"databaseFilePath"in t&&"rootPath"in t}a(kFo,"isIndexableWorkspaceFolder");var $fn=fe(ei()),tQ=require("worker_threads");var jVe=class{static{a(this,"IndexInfo")}constructor(e,r){this.index=new NVe(e,kfn,Dfn,r),this.contextRetreival=new IVe(this.index.reader,Pfn)}},Z6t=class t{constructor(e,r,n){this.indices=new Map;this.cancellationTokens=new Map;this.params=n;for(let o of r){let s=kn(o.rootPath);this.indices.set(s,new jVe(o.databaseFilePath,n))}this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port?.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.dispatchMessage(o,this.indices,this.cancellationTokens)})}static{a(this,"IndexWorker")}async dispatchMessage(e,r,n){if(!e.__perf__)try{let o=new $fn.CancellationTokenSource;n.set(e.id,o);let s;switch(e.operation){case jy.AddOrInvalidated:s=await t.dispatchAddOrInvalidate(e,r,o.token);break;case jy.GetContext:s=await t.dispatchGetContext(e,r,o.token);break;case jy.Cancel:n.get(e.id)?.cancel(),s=new lk(e.id,void 0,void 0);break;case jy.Exit:s=await this.dispatchExit(e,r,o.token);break;case jy.CreateIndex:s=t.dispatchCreateIndex(e,r,o.token);break;case jy.RemoveIndex:s=await t.dispatchRemoveIndex(e,r,o.token);break;case jy.GetAllDocumentsInWorkspace:s=await t.GetAllDocumentsInWorkspaceRequest(e,r,o.token);break;default:this.port?.postMessage(new Error(`Unknown operation: ${e.operation}`))}s&&this.port?.postMessage(s),n.get(e.id)?.dispose(),n.delete(e.id)}catch(o){if(!(o instanceof Error))throw o;this.port?.postMessage(new lk(e.id,o,void 0))}}static async GetAllDocumentsInWorkspaceRequest(e,r,n){let o=kn(e.baseWorkspaceFolderUri),s,c;return r.has(o)?c=await r.get(o).index.getDocumentFilePaths():s=new Error(`Index not found for ${e.baseWorkspaceFolderUri}`),new lk(e.id,s,c)}static async dispatchAddOrInvalidate(e,r,n){let o=kn(e.fileUri),s=t.getIndexInfo(o,r)?.index,c;return s?await s.indexFile(e.fileUri,e.languageId):c=new Error(`Index not found for ${e.fileUri}`),new lk(e.id,c,void 0)}static async dispatchGetContext(e,r,n){let o=kn(e.fileUri),s=t.getIndexInfo(o,r)?.contextRetreival,c,l;return s?l=await s.getStringifiedContextAtPositionAsync(e.fileUri,e.code,e.offset,e.languageId,e.params,8e3,n):c=new Error(`ContextRetrieval not found for ${e.fileUri}`),new lk(e.id,c,l)}async dispatchExit(e,r,n){for(let o of r.values())await o.index.dispose();r.clear(),this.port?.postMessage(new lk(e.id,void 0,void 0)),this.port?.close()}static dispatchCreateIndex(e,r,n){let o=kn(e.baseWorkspaceFolderUri);return r.has(o)||r.set(o,new jVe(e.databaseFilePath)),new lk(e.id,void 0,void 0)}static async dispatchRemoveIndex(e,r,n){let o=kn(e.baseWorkspaceFolderUri);if(r.has(o)){let s=r.get(o);s&&await s.index.dispose(),r.delete(o)}return new lk(e.id,void 0,void 0)}static getIndexInfo(e,r){for(let[n,o]of r)if(e.startsWith(n))return o}};function Vfn(){return J6t(tQ.workerData)}a(Vfn,"isIndexWorker");function Wfn(){let t=tQ.parentPort;if(!t)throw new Error("This must be run a worker thread.");if(!J6t(tQ.workerData))throw new Error("Worker data must provide a valid database path.");let e=tQ.workerData.cwd;process.cwd=()=>e,new Z6t(t,tQ.workerData.indexWorkspaceRoots,tQ.workerData.params)}a(Wfn,"runIndexWorker");p();p();var yTe=require("fs"),zfn=require("path");var rQ=class extends jo{static{a(this,"LocalFileSystem")}async readFileString(e,r="utf8"){return await yTe.promises.readFile(kn(e),r)}async stat(e){let{targetStat:r,lstat:n,stat:o}=await this.statWithLink(kn(e));return{ctime:r.ctimeMs,mtime:r.mtimeMs,size:r.size,type:this.getFileType(r,n,o)}}async readDirectory(e){let r=kn(e),n=await yTe.promises.readdir(r,{withFileTypes:!0}),o=[];for(let s of n){let{targetStat:c,lstat:l,stat:u}=await this.statWithLink((0,zfn.join)(r,s.name));o.push([s.name,this.getFileType(c,l,u)])}return o}async statWithLink(e){let r=await yTe.promises.lstat(e);if(r.isSymbolicLink())try{let n=await yTe.promises.stat(e);return{lstat:r,stat:n,targetStat:n}}catch{}return{lstat:r,targetStat:r}}getFileType(e,r,n){let o=0;return e.isFile()&&(o=1),e.isDirectory()&&(o=2),r.isSymbolicLink()&&n&&(o|=64),o}};p();async function DFo(t){if(t.isCancellationRequested)return;let e=new nA,r=t.onCancellationRequested(()=>{e.resolve(),r.dispose()});await e.promise}a(DFo,"cancellationTokenToPromise");async function Yfn(t,e){if(e){let r=DFo(e);await Promise.race([t,r])}else await t}a(Yfn,"raceCancellation");function X6t(t){return Array.isArray(t)}a(X6t,"isArrayOfT");async function Kfn(t,e){let r=new Map,n=[];for(let[o,s]of t.entries()){let c=(async()=>{let l=await e9t(s,e);r.set(o,l)})();n.push(c)}return await Promise.allSettled(n.values()),r}a(Kfn,"resolveAll");async function e9t(t,e){let r;return t instanceof Promise?r=await NFo(t,e):r=await MFo(t,e),r}a(e9t,"resolve");async function NFo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{let s=await t;if(e?.isCancellationRequested)return;n={status:"full",resolutionTime:0,value:X6t(s)?[...s]:[s]}}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Yfn(o,e),n.resolutionTime=performance.now()-r,n}a(NFo,"resolvePromise");async function MFo(t,e){let r=performance.now(),n={status:"none",resolutionTime:0,value:null},o=(async()=>{try{for await(let s of t){if(e?.isCancellationRequested)return;n.status!="partial"&&(n={status:"partial",resolutionTime:0,value:[]}),n.value.push(s)}e?.isCancellationRequested||(n.status!=="partial"?n={status:"full",resolutionTime:0,value:[]}:n.status="full")}catch(s){if(e?.isCancellationRequested)return;n={status:"error",resolutionTime:0,reason:s}}})();return await Yfn(o,e),n.resolutionTime=performance.now()-r,n}a(MFo,"resolveIterable");p();p();var HVe="[...]",OFo=0,vC=-1;function lf(){return OFo++}a(lf,"getAvailableNodeId");function BFo(t,e){let r=t.children.map(n=>n.elisionMarker??e);return[...t.text.entries()].map(([n,o])=>n===0?o:r[n-1]+o).join("")}a(BFo,"elideChildren");function Jfn(t,e=HVe){return r=>t.tokenLength(BFo(r,e))}a(Jfn,"getTokenizerCostFunction");p();var iQ=class{static{a(this,"PriorityQueue")}constructor(e){if(this.heap=e?[...e]:[],this.heap.length>0)for(let r=Math.floor(this.heap.length/2)-1;r>=0;r--)this.siftDown(r)}get size(){return this.heap.length}insert(e,r){let n={item:e,priority:r};this.heap.push(n);let o=this.heap.length-1;this.siftUp(o)}peek(){return this.heap.length===0?null:this.heap[0]}pop(){if(this.heap.length===0)return null;let e=this.heap[0],r=this.heap.pop();return this.heap.length>0&&(this.heap[0]=r,this.siftDown(0)),e}clear(){let e=this.heap;return this.heap=[],e}siftUp(e){let r=this.heap[e];for(;e>0;){let n=Math.floor((e-1)/2);if(this.heap[n].priority>=r.priority)break;this.heap[e]=this.heap[n],e=n}this.heap[e]=r}siftDown(e){for(;ethis.heap[r].priority&&(r=n),othis.heap[r].priority&&(r=o),r===e)break;let s=this.heap[e];this.heap[e]=this.heap[r],this.heap[r]=s,e=r}}};function LFo(t){let e={id:t.id??lf(),text:t.text??new Array((t.children?.length??0)+1).fill(""),children:t.children??[],cost:t.cost??1,weight:t.weight??0,rectifiedWeight:t.rectifiedWeight,canMerge:t.canMerge??!1,elisionMarker:t.elisionMarker??HVe,requireRenderedChild:t.requireRenderedChild??!1};if(e.text.length!==e.children.length+1)throw new Error(`RenderNode text length (${e.text.length}) must be children length + 1 (${e.children.length+1})`);return e}a(LFo,"createRenderNode");function FFo(t){return t.requireRenderedChild||(t.rectifiedWeight??t.weight)>t.weight}a(FFo,"isRenderedChildRequired");function Zfn(t){return(t.rectifiedWeight??t.weight)/Math.max(t.cost,1)}a(Zfn,"rectifiedValue");function ETe(t,e){let r=Xfn(t,e);for(let{item:n,priority:o}of r.clear())for(let s of n.nodes)s.rectifiedWeight=o*Math.max(s.cost,1)}a(ETe,"rectifyWeights");function Xfn(t,e){let r=t.children.map(s=>Xfn(s,e));if(t.weight=Math.max(0,e?e(t):t.weight),t.weight===0&&r.reduce((s,c)=>s+c.size,0)===0)return new iQ([]);let n=new iQ(r.flatMap(s=>s.clear())),o={nodes:[t],totalCost:t.cost,totalWeight:t.weight};for(;(n.peek()?.priority??0)>o.totalWeight/Math.max(o.totalCost,1);){let{item:s}=n.pop();o.nodes.push(...s.nodes),o.totalCost+=s.totalCost,o.totalWeight+=s.totalWeight}return n.insert(o,o.totalWeight/Math.max(o.totalCost,1)),n}a(Xfn,"recursivelyRectifyWeights");function epn(t,e={}){let{budget:r,mask:n,costFunction:o}=e,s=n??[],c=new Set(Array.isArray(s)?s:[s]);if((r??t.cost)c.has(E.id),"elider"),m=[],g=new Map;if(r9t(t,m,h,g),m.length===0)return t9t(t,o);let A=m.join(""),y=o?o(A):[...g.values()].reduce((E,_)=>E+_.cost,0);return{text:A,cost:y,renderedNodes:g}}let l=new Map,u=[],d=new iQ([{item:t,priority:Zfn(t)}]),f=r;for(;f>0&&d.size>0;){let{item:h}=d.pop();if(!c.has(h.id)&&h.cost<=f){f-=h.cost,l.set(h.id,h),u.push(h);for(let m of h.children)d.insert(m,Zfn(m))}}for(;l.size>0;){let h=[],m=a(E=>!l.has(E.id),"elider"),g=new Map;if(r9t(t,h,m,g),h.length===0)return t9t(t,o);let A=h.join("");if(o===void 0){let E=[...g.values()].reduce((_,v)=>_+v.cost,0);return{text:A,cost:E,renderedNodes:g}}let y=o(A);if(y<=r)return{text:A,cost:y,renderedNodes:g};for(l=g;u.length>0&&y>r;){let E=u.pop();l.has(E.id)&&(y-=E.cost,l.delete(E.id))}if(u.length===0)break}return t9t(t,o)}a(epn,"render");function t9t(t,e){return{text:t.elisionMarker,cost:e?e(t.elisionMarker):t.elisionMarker.length,renderedNodes:new Map}}a(t9t,"renderEmpty");function r9t(t,e,r,n,o=!1){let s=e.length;if(r(t))return s>=2&&(o||e[s-2]===t.elisionMarker&&e[s-1].trim().length===0)?(e.pop(),!1):(e.push(t.elisionMarker),!1);let c=FFo(t),l=!0;for(let[u,d]of t.children.entries())e.push(t.text[u]??""),l=r9t(d,e,r,n,d.canMerge&&!l),c&&=!l;if(c){for(;e.length>s;)e.pop();return!1}return e.push(t.text[t.text.length-1]??""),n.set(t.id,t),!0}a(r9t,"recursivelyRender");function _Te(t,e,r=HVe){let n=t.children.map(c=>_Te(c,e,r));r=t.elisionMarker??r;let o=e(t);return LFo({...t,children:n,cost:o,weight:0,elisionMarker:t.elisionMarker??r})}a(_Te,"snapshot");var oQ={id:lf(),text:[""],children:[],cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};p();p();var uk=class{constructor(){this.disposables=[]}static{a(this,"WorkspaceContextProvider")}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};var $Ve={MaxDirectorySize:200,MaxResults:100,Decay:.5,CacheSize:2e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:2*1024*1024};async function UFo(t,e,r=$Ve,n){let o=n?.get(e);if(o!==void 0)return o;let s;try{s=await t.readDirectory(e)}catch{}if(s===void 0||r.MaxDirectorySize!==void 0&&s.length>r.MaxDirectorySize)return n?.set(e,"Invalid",r.InvalidCacheTime),"Invalid";let c={documents:[],directories:[]};for(let[l,u]of s){let d=Sa(e,l);u&2?c.directories.push(d):c.documents.push(d)}return n?.set(e,c),c}a(UFo,"getDirectoryChildren");function QFo(t,e){let r=t.getWorkspaceFolder({uri:e});if(r===void 0)return[];let n=[],o=Xd(e);for(;o.startsWith(r);){n.push(o);let s=Xd(o);if(s.length>=o.length)break;o=s}return n}a(QFo,"getAncestors");function qFo(t,e,r=$Ve.Decay){let n=new Map,o=new Map,s=new Map,c=new Map;for(let l of e){let u=QFo(t,l.uri);if(u.length===0){n.set(l.uri,new Set);continue}let d;for(let f of u){if(d!==void 0){let h=o.get(f)??new Set;h.add(d),o.set(f,h)}d=f}s.set(l.uri,d),n.set(l.uri,new Set(u))}for(let l of e){let u=[],d=n.get(l.uri);if(!(!d||d.size===0))for(u.push({uri:s.get(l.uri),weight:l.weight*Math.pow(r,d.size)});u.length>0;){let f=u.pop();c.set(f.uri,(c.get(f.uri)??0)+f.weight);let h=o.get(f.uri)??new Set;for(let m of h){let g=f.weight;d.has(m)?g/=r:g*=r,u.push({uri:m,weight:g})}}}return c}a(qFo,"getAncestorWeights");async function*n9t(t,e,r,n,o,s){let c={...$Ve,...r},l=c.MaxResults,u=c.Decay,d=qFo(t,e,u),f=new iQ([...d.entries()].map(([m,g])=>({item:m,priority:g}))),h=0;for(;f.size>0;){let{item:m,priority:g}=f.pop(),A=await UFo(t,m,c,n);if(s?.isCancellationRequested)return;if(A!=="Invalid"){for(let y of A.documents)if(!o||o(y)){try{if((await t.stat(y)).size>c.MaxFileBytes)continue}catch{continue}if(yield{uri:y,weight:g},h++,h>=l)return}for(let y of A.directories)d.has(y)||(f.insert(y,g*u),d.set(y,g*u))}}}a(n9t,"getNearbyDocuments");var GVe=class extends uk{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=$Ve;this.cache=new nP(this.config.CacheSize,this.config.CacheTime)}static{a(this,"FileDirectoryDocumentProvider")}async*getContext(r,n,o,s){for await(let c of n9t(this.fileSystem,n.documents,this.config,this.cache,l=>this.documentManager.normalizeUri(l)!==void 0,s))yield{...c,source:"FileDirectoryDocumentProvider"}}};p();p();p();function V0(t,e,r){let n=t.get(e);return n===void 0&&(n=r(e),t.set(e,n)),n}a(V0,"setDefault");var jFo={MaxActiveSymbols:500,SymbolCacheSize:1e6},VVe=class extends uk{constructor(){super(...arguments);this.config=jFo;this.nodeToSymbol=new Map;this.nodeValency=new Map;this.symbolToNode=new Map;this.symbolValency=new Map;this.identifierSymbols=new Set;this.identifiers=new yn(this.config.SymbolCacheSize);this.textSymbols=new yn(this.config.SymbolCacheSize);this.nextSymbolId=0}static{a(this,"SymbolContextProvider")}getContext(r,n,o,s){this.updateSymbolIndex(r,o);let c=this.getWeightedSymbols(n);return Promise.resolve(this.getWeightedNodes(c))}updateSymbolIndex(r,n){for(let{id:o}of r.getInvalidatedNodes()){let s=this.nodeToSymbol.get(o);if(this.nodeToSymbol.delete(o),this.nodeValency.delete(o),s)for(let[c,l]of s.entries()){let u=this.symbolToNode.get(c);u?.delete(o),u?.size===0?(this.symbolToNode.delete(c),this.symbolValency.delete(c),this.identifierSymbols.delete(c)):this.symbolValency.has(c)&&this.symbolValency.set(c,Math.max(1,(this.symbolValency.get(c)??0)-l))}}for(let{id:o}of r.getCreatedNodes()){let s=n.getNode(o);s!==void 0&&this.extractSymbols(s.document,s.node)}}getWeightedSymbols(r){let n=new Map;for(let{id:s,weight:c}of r.nodes){let l=this.nodeValency.get(s)??0,u=[],d=0;for(let[f,h]of this.nodeToSymbol.get(s)??[]){let m=this.symbolValency.get(f);if((m??0)<1)continue;let g=h/(Math.max(l,1)*Math.max(1,m));u.push({symbolId:f,nodeSymbolWeight:g}),d+=g}d=Math.max(d,1);for(let{symbolId:f,nodeSymbolWeight:h}of u)n.set(f,(n.get(f)??0)+c*h/d)}return[...n.entries()].map(([s,c])=>({symbolId:s,symbolWeight:c,symbolValency:this.symbolValency.get(s)})).filter(({symbolValency:s})=>(s??0)>0).sort((s,c)=>c.symbolWeight/c.symbolValency-s.symbolWeight/s.symbolValency).slice(0,this.config.MaxActiveSymbols)}getWeightedNodes(r){let n=[];for(let{symbolId:o,symbolWeight:s,symbolValency:c}of r){let l=this.identifierSymbols.has(o)?"SymbolContextProvider.Identifiers":"SymbolContextProvider.Text";for(let[u,d]of this.symbolToNode.get(o)??[]){let f=s*d/Math.max(c,this.nodeValency.get(u)??d);n.push({id:u,weight:f,source:l})}}return n}extractSymbols(r,n){if(this.nodeToSymbol.has(n.id))return;let o=new Map;this.nodeToSymbol.set(n.id,o);let s=0;for(let c of n.syntaxNodes()){let l=r.document.getText(c.range);if(this.isIdentifier(r,c,l)){let u=V0(this.identifiers,l,()=>this.createSymbol(!0));o.set(u,(o.get(u)??0)+1),s+=1}if(this.isText(r,c,l)||this.isIdentifier(r,c,l))for(let u of i9t(l)){let d=V0(this.textSymbols,u,()=>this.createSymbol());o.set(d,(o.get(d)??0)+1),s+=1}}this.nodeValency.set(n.id,s);for(let[c,l]of o.entries())V0(this.symbolToNode,c,()=>new Map).set(n.id,l),this.symbolValency.set(c,(this.symbolValency.get(c)??0)+l)}createSymbol(r=!1){let n=this.nextSymbolId++;return r&&this.identifierSymbols.add(n),n}isText(r,n,o){return r.parser.labeler.isText?.(n)??(n.children.length===0&&o.search(/\s/)>=0)}isIdentifier(r,n,o){return r.parser.labeler.isIdentifier?.(n)??(n.children.length===0&&tpn(o))}},HFo=/^[a-zA-Z_]{2,}\w+$/;function tpn(t){return HFo.test(t)}a(tpn,"isSymbol");function GFo(t){return t.toLowerCase()}a(GFo,"normalizeWord");function*i9t(t){for(let e of t.split(/\W/))tpn(e)&&(yield GFo(e))}a(i9t,"getTextSymbols");var $Fo={MaxDirectorySize:50,MaxResults:50,Decay:.5,CacheSize:1e3,CacheTime:1e3*60,InvalidCacheTime:1e3*60*60*24,MaxFileBytes:1*1024*1024,MaxActiveSymbols:500,DebouncedRemovalThreshold:3,UpdateDebounceTimeout:500,SymbolCacheSize:1e5},WVe=class extends VVe{constructor(r,n){super();this.fileSystem=r;this.documentManager=n;this.config=$Fo;this.symbolToDocuments=new Map;this.documentToSymbols=new Map;this.documentValency=new Map;this.cache=new nP(this.config.CacheSize,this.config.CacheTime);this.debouncedExpirationCount=new Map;this.updateDebounce=new Map;this.currentlyUpdating=new Set;this.isUpdatingIndex=!1;this.fileSystem.onDidFileChange(o=>{let s=o.document.uri;this.documentToSymbols.has(s)&&this.debouncedReadOrUpdateDocument(s)})}static{a(this,"IndexingSymbolContextProvider")}async getContext(r,n,o,s){super.updateSymbolIndex(r,o),await this.updateDocumentIndex(n);let c=super.getWeightedSymbols(n),l=super.getWeightedNodes(c),u=this.getWeightedDocuments(c);return[...l,...u]}getWeightedDocuments(r){let n=[];for(let{symbolId:o,symbolWeight:s}of r)for(let[c,l]of this.symbolToDocuments.get(o)??[]){let u=l/Math.max(1,this.documentValency.get(c)??1),d=Math.log(Math.max(this.documentToSymbols.size,1)/Math.max(1,this.symbolToDocuments.get(o)?.size??1)),f=s*u*d;n.push({source:"IndexingSymbolContextProvider.Text",uri:c,weight:f})}return n}debouncedReadOrUpdateDocument(r){this.updateDebounce.has(r)&&clearTimeout(this.updateDebounce.get(r)),this.updateDebounce.set(r,setTimeout(()=>{this.updateDebounce.delete(r),this.readOrUpdateDocument(r)},this.config.UpdateDebounceTimeout))}async readOrUpdateDocument(r){try{if(this.currentlyUpdating.has(r))return;if(this.documentManager.normalizeUri(r)===void 0){this.removeFromIndex(r);return}this.currentlyUpdating.add(r);let n=await this.fileSystem.readFileString({uri:r}),o=new Map,s=0;for(let l of i9t(n))o.set(l,(o.get(l)??0)+1),s++;let c=[];for(let[l,u]of o.entries()){let d=V0(this.textSymbols,l,()=>this.createSymbol(!1));V0(this.symbolToDocuments,d,()=>new Map).set(r,u),c.push(d)}this.documentValency.set(r,s),this.documentToSymbols.set(r,c)}catch{this.removeFromIndex(r)}finally{this.currentlyUpdating.delete(r)}}async updateDocumentIndex(r){if(!this.isUpdatingIndex){this.isUpdatingIndex=!0;try{for(let s of this.documentToSymbols.keys())this.debouncedExpirationCount.set(s,(this.debouncedExpirationCount.get(s)??0)+1);let n=a(s=>this.documentManager.normalizeUri(s)!==void 0,"filter");for await(let{uri:s}of n9t(this.fileSystem,r.documents,this.config,this.cache,n))this.documentToSymbols.has(s)||await this.readOrUpdateDocument(s),this.debouncedExpirationCount.delete(s);let o=[...this.debouncedExpirationCount.entries()].filter(([s,c])=>c>=this.config.DebouncedRemovalThreshold&&!this.currentlyUpdating.has(s)&&!this.updateDebounce.has(s));for(let[s]of o)this.removeFromIndex(s),this.debouncedExpirationCount.delete(s)}finally{this.isUpdatingIndex=!1}}}removeFromIndex(r){this.documentValency.delete(r);for(let n of this.documentToSymbols.get(r)??[]){let o=this.symbolToDocuments.get(n);o?.delete(r),o?.size===0&&this.symbolToDocuments.delete(n)}this.documentToSymbols.delete(r)}};p();function rpn(t){return t.nodeId!==void 0}a(rpn,"isNodeLocation");var npn={"RecentDocumentProvider.RecentlyFocused":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},"RecentDocumentProvider.RecentlyEdited":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!0},"RecentDocumentProvider.RecentlyOpen":{maxEventCount:100,halflife:1e3*60*5,isImpulse:!1},RecentCompletionsRequestProvider:{maxEventCount:100,halflife:1e3*60*5,isImpulse:!0},"ExtensionActivityProvider.CurrentSelection":{maxEventCount:1,halflife:1e5,isImpulse:!0},"ExtensionActivityProvider.PrimarySelection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.Selection":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1},"ExtensionActivityProvider.VisibleRange":{maxEventCount:1e3,halflife:1e3*60*5,isImpulse:!1}},zVe=class extends uk{constructor(){super(...arguments);this.eventsByType=new Map;this.nextId=0}static{a(this,"RecentActivityProvider")}getContext(r,n,o,s){let c=performance.now(),l=[];for(let[u,d]of this.eventsByType.entries()){let f=npn[u],h=[...d.values()].sort((g,A)=>A.timestamp-g.timestamp),m=1;for(let g of h){this.resolveRanges(g,o);let A=.5**((c-g.timestamp)/f.halflife),y=f.isImpulse?A:m-A;m=A;for(let E of g.locations)rpn(E)?l.push({weight:y,uri:E.uri,id:E.nodeId,source:u}):l.push({weight:y,uri:E.uri,source:u})}}return Promise.resolve(l)}resolveRanges(r,n){if(r.isFullyResolved)return;let o=!0,s=[];for(let c of r.locations)if(rpn(c))s.push(c);else if(c.range&&c.range.start!==void 0&&c.range.end!==void 0){let l=n.getDocument(c.uri)?.document;if(l!==void 0){let u=l.findNode(l.document.offsetAt(c.range.start),l.document.offsetAt(c.range.end));s.push({uri:c.uri,nodeId:u.id})}else o=!1,s.push(c)}else s.push({uri:c.uri,nodeId:vC});r.locations=s,r.isFullyResolved=o}recordEvent(r,n,o){let s=npn[r];if(s===void 0)return;let c={timestamp:o,locations:n,isFullyResolved:!1};V0(this.eventsByType,r,()=>new yn(s.maxEventCount)).set(++this.nextId,c)}};p();var YVe=class extends uk{constructor(){super(...arguments);this.nodeParent=new Map;this.nodeChildren=new Map}static{a(this,"TreeProximityProvider")}getContext(r,n,o,s){this.updateIndex(r,o,s);let c=new Map,l=new Map,u=new Map;for(let{id:f,weight:h}of n.nodes){let m=this.nodeParent.get(f)??vC,g=this.nodeChildren.get(m)?.size??0;g>0&&c.set(m,(c.get(m)??0)+h/g);let A=this.nodeChildren.get(f);if(A&&A.size>0)for(let E of A)l.set(E,(l.get(E)??0)+h/A.size);let y=this.nodeChildren.get(m);if(y&&y.size>1)for(let E of y)E!==f&&u.set(E,(u.get(E)??0)+h/y.size)}let d=[...[...c.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Parent"})),...[...l.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Children"})),...[...u.entries()].map(([f,h])=>({id:f,weight:h,source:"TreeProximityProvider.Siblings"}))];return Promise.resolve(d)}updateIndex(r,n,o){for(let{id:s}of r.getInvalidatedNodes())this.nodeParent.delete(s),this.nodeChildren.delete(s);for(let{id:s}of r.getCreatedNodes()){let c=n.getNode(s),l=new Set;if(c!==void 0)for(let u of c.node.children)this.nodeParent.set(u.id,s),l.add(u.id);l.size>0&&this.nodeChildren.set(s,l)}}};p();function VFo(t){return t.id!==void 0}a(VFo,"isNodeItem");function WFo(t){return!("uri"in t)&&!("id"in t)}a(WFo,"isNullItem");var ipn={"RecentDocumentProvider.RecentlyOpen":.1,"RecentDocumentProvider.RecentlyFocused":.1,"RecentDocumentProvider.RecentlyEdited":.1,RecentCompletionsRequestProvider:1,"ExtensionActivityProvider.CurrentSelection":5,"ExtensionActivityProvider.PrimarySelection":2,"ExtensionActivityProvider.Selection":.2,"ExtensionActivityProvider.VisibleRange":1,FileDirectoryDocumentProvider:.05,"SymbolContextProvider.Identifiers":.2,"SymbolContextProvider.Text":.2,"IndexingSymbolContextProvider.Text":1,"TreeProximityProvider.Parent":.3,"TreeProximityProvider.Children":.3,"TreeProximityProvider.Siblings":.3,"ExtensionReferenceProvider.References":.2,"ExtensionReferenceProvider.Definitions":1};function opn(t){return t in ipn}a(opn,"isSourceId");var sQ="64f5ff7d-e507-4558-81cf-3bdacc3c5c00",Nce=class{static{a(this,"WorkspaceContextWeights")}constructor(e){let r=new Map;for(let{uri:n,weight:o}of e)r.set(n,(r.get(n)??0)+o);this.documents=[...r.entries()].map(([n,o])=>({uri:n,weight:o})).sort((n,o)=>o.weight-n.weight),this.docWeights=r,this.nodes=e.filter(({id:n})=>n!==vC),this.nodeWeights=new Map(e.map(({id:n,weight:o})=>[n,o]))}getNodeWeight(e){return this.nodeWeights.get(e)??0}getDocumentWeight(e){return this.docWeights.get(e)??0}},KVe=class{constructor(e,r){this.activeContext=e;this.config=r;this.sourceWeights=ipn;this.sourceContext=new Map;this.prevUpdateTime=void 0;this.prevItems=[];this.weights=new Nce([])}static{a(this,"WorkspaceContextCoordinator")}getWeights(e){if(e){let r=this.sourceContext.get(e);return r?new Nce(r.items):new Nce([])}return this.weights}updateWeights(){let e=new Map,r=0,n=this.config.StaleWeightHalflife;for(let[o,{items:s,updateTime:c}]of this.sourceContext.entries()){let l=this.sourceWeights[o]??0;if(l<=0||s.length===0)continue;let u=.5**(-Math.max(0,(this.prevUpdateTime??c)-c)/n);l*=u,r+=l,this.aggregateWeights(s,e,l,!0)}if(r>0){if(this.weights.nodes.length>0){let o=r*this.config.Laziness,s=this.prevItems;this.aggregateWeights(s,e,o,!0)}for(let[o,s]of e.entries()){let c=this.activeContext.getDocument(o)?.document;if(c===void 0)continue;let l=s.get(vC);if(l!==void 0&&l>0){s.delete(vC);let u=0;for(let d of s.values())u+=d;if(u<=0){let d=c.getAllIds(),f=l/Math.max(d.length,1);for(let h of d)s.set(h,f)}else for(let[d,f]of[...s.entries()])s.set(d,f+l*(f/u))}}this.prevItems=this.truncateAndNormalize(e),this.weights=new Nce(this.prevItems)}return this.prevUpdateTime=performance.now(),this.weights}pushWorkspaceContext(e,r){let n=performance.now(),o=this.addUriAndId(r),s=new Map;this.aggregateWeights(o,s);let c=this.truncateAndNormalize(s);this.sourceContext.set(e,{items:c,updateTime:n})}addUriAndId(e){return e.filter(r=>r.weight>0).map(r=>{if(WFo(r))return{weight:r.weight,uri:sQ,id:vC};let n=VFo(r)?r.id:vC,o=r.uri??this.activeContext.getUri(n)??sQ;return o===sQ&&(n=vC),{weight:r.weight,uri:o,id:n}})}aggregateWeights(e,r,n=1,o=!1){for(let{uri:s,id:c,weight:l}of e){if(l<=0||isNaN(l))continue;let u=V0(r,s,()=>new Map),d=vC;(!o||this.activeContext.getUri(c)!==void 0)&&(d=c),u.set(d,(u.get(d)??0)+l*n)}}truncateAndNormalize(e){let r=[],n=new Map,o=0;for(let[u,d]of e.entries()){let f=u!==sQ?this.activeContext.normalizeUri(u)??sQ:sQ;for(let[h,m]of d.entries())u===sQ||h===vC?n.set(f,(n.get(f)??0)+m):r.push({uri:f,id:h,weight:m}),o+=m}if(o<=0)return[];n.delete(sQ),r.sort((u,d)=>d.weight-u.weight);for(let{uri:u,weight:d}of r.slice(this.config.MaxActiveNodes,r.length))n.set(u,(n.get(u)??0)+d);let s=[...n.entries()].sort((u,d)=>d[1]-u[1]).slice(0,this.config.MaxActiveFiles).map(([u,d])=>({uri:u,id:vC,weight:d}));return r.slice(0,this.config.MaxActiveNodes).concat(s).sort((u,d)=>d.weight-u.weight).map(u=>({...u,weight:u.weight/o}))}};p();p();p();var o9t=class{constructor(e,r,n,o=!1){this.id=e;this.parts=r;this.text=n;this.canMerge=o}static{a(this,"ContextNode")}get startOffset(){return this.parts[0].root.startOffset}get endOffset(){return this.parts[this.parts.length-1].root.endOffset}get syntaxRoots(){return this.parts.map(e=>e.root)}get children(){return this.parts.flatMap(e=>e.children)}get syntaxLimits(){return this.children.flatMap(e=>e.syntaxRoots)}*syntaxNodes(){let e=new Set(this.syntaxLimits.map(r=>r.id));for(let r of this.syntaxRoots)yield*spn(r,e)}findChild(e,r){if(ethis.endOffset||r=r)break;s.root.endOffset=r)break;c.endOffsets.root.startOffset-c.root.startOffset);let n=YFo(e,this.document),o=new o9t(lf(),e,n,r);return this.nodeById.set(o.id,o),o}buildTree(){let e=this.buildRecursively(this._syntaxRoot);return this.createNode([{root:this._syntaxRoot,children:e}])}buildRecursively(e){if(e.endOffset-e.startOffset({root:o,children:this.buildRecursively(o)}));if(this.canMergeChildren(e))return this.mergeChildren(r);let n=[];for(let{root:o,children:s}of r){if(this.canBeNode(o)&&o.endOffset-o.startOffset-s.reduce((l,u)=>l+(u.endOffset-u.startOffset),0)>=this.minSize){n.push(this.createNode([{root:o,children:s}]));continue}n.push(...s)}return n}mergeChildren(e){if(e.length===0)return[];e.sort((m,g)=>m.root.startOffset-g.root.startOffset);let r=e[e.length-1].root.endOffset-e[0].root.startOffset,n=[];for(let m of e){let g=m.root.endOffset-m.root.startOffset;for(let A of m.children){let y=A.endOffset-A.startOffset;g-=y,r-=y}n.push(g)}if(rm.children);let o=[0],s=0,c=null,l={line:-1,size:-1},u=e[0].root.startOffset,d=e[0].root.range.start.line;for(let m=0;mthis.minSize&&sl.line||A.line==l.line&&A.size>l.size)&&(l=A,c=m)}u=g.root.endOffset,d=g.root.range.end.line,s>=this.maxSize&&(c=c??m,o.push(c+1),m=c,s=0,c=null,l={line:-1,size:-1},u=e[m+1]?.root.startOffset,d=e[m+1]?.root.range.start.line)}o.length==1?o.push(e.length):o[o.length-1]!==e.length&&(o[o.length-1]=e.length);let f=[],h=!1;for(let m=0;mzFo}canBeNode(e){return this.parser.labeler.canBeNode?.(e)??!0}};function YFo(t,e){if(t.length===0)return[""];let r=[],n=e.positionAt(t[0].root.startOffset);for(let s of t.flatMap(c=>c.children).sort((c,l)=>c.startOffset-l.startOffset)){let c=e.positionAt(s.startOffset);r.push(e.getText({start:n,end:c})),n=e.positionAt(s.endOffset)}let o=e.positionAt(t[t.length-1].root.endOffset);return r.push(e.getText({start:n,end:o})),r}a(YFo,"buildText");function*spn(t,e){yield t;for(let r of t.children)e.has(r.id)||(yield*spn(r,e))}a(spn,"walk");p();p();p();var ZVe=class{constructor(e,r,n,o,s,c){this.id=e;this.raw=r;this.children=n;this.source="indentation";this.parent=null;let l={start:{line:o,character:0},end:{line:s,character:c.lineAt(s).text.length}},u=c.getText(l),d=u.search(/\S/);if(d===-1){let m={line:s,character:0};this.startOffset=c.offsetAt(m),this.endOffset=this.startOffset,this.range={start:m,end:m};return}let f=u.search(/\S(?!.*\S)/s),h=c.offsetAt(l.start);this.startOffset=h+d,this.endOffset=h+f+1,this.range={start:c.positionAt(this.startOffset),end:c.positionAt(this.endOffset)}}static{a(this,"IndentationNode")}get type(){return this.raw.type}};function s9t(t,e,r){let n=t.subs.map(u=>({subtree:u,node:s9t(u,e,r)})).filter(u=>u.node!==null).sort((u,d)=>u.node.startOffset-d.node.startOffset),o=[],s=e;for(let u=n.length-1;u>=0;u--){let{subtree:d,node:f}=n[u];if(f.range.end.line>=s){let h=s9t(d,s,r);h!==null&&(o.push(h),s=Math.min(h.range.start.line,s))}else o.push(f),s=Math.min(f.range.start.line,s)}o.sort((u,d)=>u.startOffset-d.startOffset);let c=e,l=0;if(o.length>0&&(c=Math.min(c,o[0].range.start.line),l=Math.max(l,o[o.length-1].range.end.line)),(t.type==="blank"||t.type==="line")&&(c=Math.min(c,t.lineNumber),l=Math.max(l,t.lineNumber),t.type==="blank"&&c===l))return null;if(l=Math.min(l,e-1),c<=l){let u=new ZVe(lf(),t,o,c,l,r);for(let d of o)d.parent=u;return u}return null}a(s9t,"recursivelyBuildNode");function apn(t){let e=AY(t.getText(),t.detectedLanguageId);return s9t(e,t.lineCount,t)??new ZVe(lf(),e,[],0,t.lineCount-1,t)}a(apn,"parse");var XVe={source:"indentation",parse:apn,update(t,e){return{root:apn(e),remapper:a(()=>{},"remapper")}},dispose:a(()=>{},"dispose"),labeler:{isIdentifier:a(t=>!1,"isIdentifier"),isText:a(t=>!0,"isText")}};p();p();var lpn=fe(Yae());function cpn(t){return{line:t.row,character:t.column}}a(cpn,"asPosition");var LM=class{constructor(e,r,n,o){this.nodeList=e;this.mergeList=r;this.identifierList=n;this.textList=o}static{a(this,"BasicNodeLabeler")}canBeNode(e){return this.nodeList.has(e.type)}canMergeChildren(e){return this.mergeList.has(e.type)}isIdentifier(e){return this.identifierList.has(e.type)}isText(e){return this.textList.has(e.type)}},aQ=class{constructor(e,r,n={}){this.language=e;this.source=r;this.labeler=n}static{a(this,"TreeSitterParser")}dispose(){}parse(e){let r,n;try{return r=new lpn.default,r.setLanguage(this.language),n=r.parse(e.getText()),this.snapshot(n.rootNode,null)}catch{return XVe.parse(e)}finally{n?.delete(),r?.delete()}}update(e,r){return{root:this.parse(r),remapper:a(()=>{},"remapper")}}snapshot(e,r){let n={id:e.id,source:this.source,type:e.type,startOffset:e.startIndex,endOffset:e.endIndex,range:{start:cpn(e.startPosition),end:cpn(e.endPosition)},parent:r,children:[]};return n.children=e.namedChildren.map(o=>this.snapshot(o,n)),n}};var KFo=new Set(["class_specifier","function_definition","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement","compound_statement"]),JFo=new Set(["translation_unit","compound_statement","parameter_list","argument_list"]),ZFo=new Set(["identifier"]),XFo=new Set(["string","comment"]),upn=new LM(KFo,JFo,ZFo,XFo);p();var e8o=new Set(["class_declaration","method_declaration","expression_statement","if_statement","for_statement","while_statement","try_statement","switch_statement"]),t8o=new Set(["program","block","object_creation_expression","formal_parameters","argument_list","array_initializer"]),r8o=new Set(["identifier"]),n8o=new Set(["string_literal","line_comment","block_comment"]),dpn=new LM(e8o,t8o,r8o,n8o);p();var i8o=new Set(["class_definition","function_definition","expression_statement","if_statement","for_statement","while_statement","with_statement","try_statement"]),o8o=new Set(["module","block","parameters","dictionary","list"]),s8o=new Set(["identifier"]),a8o=new Set(["string","comment"]),fpn=new LM(i8o,o8o,s8o,a8o);p();var c8o=new Set(["class_declaration","function_declaration","arrow_function","method_definition","expression_statement","if_statement","while_statement","try_statement","for_statement","switch_statement"]),l8o=new Set(["program","statement_block","formal_parameters","arguments","object","array"]),u8o=new Set(["identifier"]),d8o=new Set(["string","comment"]),ppn=new LM(c8o,l8o,u8o,d8o);var hpn=fe(Yae());async function mpn(t){await hpn.default.init();try{let e=await KLt(t);switch(t){case"python":return new aQ(e,"tree-sitter-python",fpn);case"typescript":return new aQ(e,"tree-sitter-typescript",ppn);case"java":return new aQ(e,"tree-sitter-java",dpn);case"cpp":return new aQ(e,"tree-sitter-cpp",upn);default:return new aQ(e,"tree-sitter-generic")}}catch{return XVe}}a(mpn,"getParser");var a9t=class{constructor(e,r){this.created=e;this.invalidated=r;this.updatedDocuments=Array.from(new Set([...e.entries(),...r.entries()].filter(([n,o])=>o.size>0).map(([n,o])=>n)))}static{a(this,"WorkspaceContextChanges")}getInvalidatedNodes(e){return this.getNodes(this.invalidated,e)}getCreatedNodes(e){return this.getNodes(this.created,e)}getNodes(e,r){return r===void 0?Array.from(e.entries()).flatMap(([n,o])=>[...o].map(s=>({uri:n,id:s}))):Array.from(e.get(r)??[]).map(n=>({uri:r,id:n}))}},eWe=class{constructor(e,r){this.item=e;this.disposalCallback=r}static{a(this,"CachedItem")}dispose(){this.disposalCallback(this.item)}},gpn=500,tWe=class{constructor(e,r){this.fileSystem=e;this.config=r;this.targetSet=new Set;this.activeDocuments=new Map;this.nodeToDoc=new Map;this.createdNodes=new Map;this.invalidatedNodes=new Map;this.parsers=new Map;this.staleDocuments=new Set;this.pendingUpdates=new Map;this.uriCache=new yn(gpn);this.allowedExtensions=new Set(Z7);this.invalidDocumentCache=new nP(gpn,this.config.InvalidCacheTime),this.cachedDocuments=new V8e(this.config.MaxActiveFiles),this.fileSystem.onDidFileChange(n=>this.handleFileChange(n.document.uri))}static{a(this,"WorkspaceContextDocumentManager")}setAllowedLanguages(e){this.allowedExtensions=new Set(e.flatMap(r=>ZL[r]?.extensions??[]))}getActiveDocuments(){return Array.from(this.activeDocuments.values())}getNode(e){let r=this.nodeToDoc.get(e);if(r===void 0)return;let n=this.getDocument(r);if(n===void 0)return;let o=n.document.getNode(e);if(o!==void 0)return{...n,node:o}}getDocument(e){let r=this.activeDocuments.get(e);if(r!==void 0)return{document:r,isActive:!0};let n=this.cachedDocuments.get(e);if(n!==void 0)return{document:n.item,isActive:!1}}getUri(e){return this.nodeToDoc.get(e)}normalizeUri(e){let r,n=this.uriCache.get(e);if(n!==null){if(n!==void 0)r=n;else try{if(g9e(e),r=ia(e),!(this.fileSystem.getWorkspaceFolder({uri:r})!==void 0)){this.uriCache.set(e,null);return}this.uriCache.set(e,r)}catch{this.uriCache.set(e,null);return}if(!(!this.allowedExtensions.has(tWr(r))||this.invalidDocumentCache.has(r)))return r}}dispose(){this.parsers.clear(),this.activeDocuments.clear(),this.cachedDocuments.clear()}updateDocuments(e){this.targetSet.clear();let r=[],n=e.documents.map(({uri:o})=>this.normalizeUri(o)).filter(o=>o!==void 0).slice(0,this.config.MaxActiveFiles);for(let o of n)this.targetSet.add(o),r.push(this.updateDocument(o));for(let o of[...this.activeDocuments.keys()])this.targetSet.has(o)||this.deactivateDocument(o);return Promise.all(r)}popChanges(){let e=new a9t(this.createdNodes,this.invalidatedNodes);return this.createdNodes=new Map,this.invalidatedNodes=new Map,e}isKnownDocument(e){return this.activeDocuments.has(e)||this.cachedDocuments.has(e)||this.pendingUpdates.has(e)}deactivateDocument(e){let r=this.activeDocuments.get(e);r!==void 0&&(this.activeDocuments.delete(e),this.pendingUpdates.has(e)||this.cachedDocuments.set(e,new eWe(r,n=>this.disposeDocument(n))))}async updateDocument(e){if(this.pendingUpdates.has(e))return;let r=new nA;this.pendingUpdates.set(e,r.promise);let n;this.activeDocuments.has(e)?n=this.activeDocuments.get(e):this.cachedDocuments.has(e)&&(n=this.cachedDocuments.get(e).item,this.cachedDocuments.uncache(e)),(n===void 0||this.staleDocuments.has(e))&&(this.staleDocuments.delete(e),n=await this.createUpdatedDocument(e,n)),n!==void 0&&(this.targetSet.has(e)?this.activeDocuments.set(e,n):(this.activeDocuments.delete(e),this.cachedDocuments.set(e,new eWe(n,o=>this.disposeDocument(o))))),this.pendingUpdates.delete(e),r.resolve()}async createUpdatedDocument(e,r){let n=await this.readTextDocument(e);if(n===void 0){r!==void 0&&this.disposeDocument(r);return}let o;try{o=await this.getParser(n.detectedLanguageId)}catch{this.invalidDocumentCache.set(e,!0),r!==void 0&&this.disposeDocument(r);return}if(r!==void 0)if(n.detectedLanguageId!==r.document.detectedLanguageId)this.disposeDocument(r);else{let c=new Set(r.getAllIds());r.update(n);let l=new Set(r.getAllIds()),u=[...l].filter(f=>!c.has(f)),d=[...c].filter(f=>!l.has(f));return this.recordDocumentChanges(e,{created:u,invalidated:d}),r}let s=new JVe(n,o,this.config.MinNodeSize);return this.recordDocumentChanges(e,{created:s.getAllIds(),invalidated:[]}),s}disposeDocument(e){this.recordDocumentChanges(e.uri,{created:[],invalidated:e.getAllIds()})}recordDocumentChanges(e,r){let n=V0(this.createdNodes,e,()=>new Set),o=V0(this.invalidatedNodes,e,()=>new Set);for(let s of r.created)n.add(s),this.nodeToDoc.set(s,e);for(let s of r.invalidated)n.has(s)?n.delete(s):o.add(s),this.nodeToDoc.delete(s)}async getParser(e){let r=this.parsers.get(e);return r===void 0&&(r=await mpn(e),this.parsers.set(e,r)),r}async readTextDocument(e){if(this.invalidDocumentCache.has(e)||this.normalizeUri(e)===void 0)return;let r=await this.fileSystem.readValidFile({uri:e});if(r.status!=="valid"||r.document.uri!==e){this.invalidDocumentCache.set(e,!0);return}return r.document}handleFileChange(e){this.isKnownDocument(e)&&this.staleDocuments.add(e)}};p();var f8o="WorkspaceContextWorker";function c9t(t){let e=t;return e?.workerId===f8o&&typeof e?.cwd=="string"&&Array.isArray(e?.workspaceRoots)&&e.workspaceRoots.every(r=>typeof r=="string")}a(c9t,"isContextWorkerData");var p8o=["RequestUpdate","Exit","ReadAndValidateUri","Error","UpdateResponse","FlushUpdates","ReadAndValidateResponse"];function Apn(t){if(typeof t!="object"||t===null)return;let e=t.messageType;return p8o.includes(e)?e:void 0}a(Apn,"getContextMessageType");var cQ=class{constructor(e,r,n){this.id=e;this.messageType=r;this.data=n}static{a(this,"ContextMessage")}};p();u9t();p();var Cpn;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(Cpn||(Cpn={}));var d9t;(function(t){function e(r){return typeof r=="string"}a(e,"is"),t.is=e})(d9t||(d9t={}));var bpn;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(bpn||(bpn={}));var nWe;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}a(e,"is"),t.is=e})(nWe||(nWe={}));var Hy;(function(t){function e(n,o){return n===Number.MAX_VALUE&&(n=nWe.MAX_VALUE),o===Number.MAX_VALUE&&(o=nWe.MAX_VALUE),{line:n,character:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.line)&&mt.uinteger(o.character)}a(r,"is"),t.is=r})(Hy||(Hy={}));var au;(function(t){function e(n,o,s,c){if(mt.uinteger(n)&&mt.uinteger(o)&&mt.uinteger(s)&&mt.uinteger(c))return{start:Hy.create(n,o),end:Hy.create(s,c)};if(Hy.is(n)&&Hy.is(o))return{start:n,end:o};throw new Error(`Range#create called with invalid arguments[${n}, ${o}, ${s}, ${c}]`)}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&Hy.is(o.start)&&Hy.is(o.end)}a(r,"is"),t.is=r})(au||(au={}));var iWe;(function(t){function e(n,o){return{uri:n,range:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&au.is(o.range)&&(mt.string(o.uri)||mt.undefined(o.uri))}a(r,"is"),t.is=r})(iWe||(iWe={}));var Spn;(function(t){function e(n,o,s,c){return{targetUri:n,targetRange:o,targetSelectionRange:s,originSelectionRange:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&au.is(o.targetRange)&&mt.string(o.targetUri)&&au.is(o.targetSelectionRange)&&(au.is(o.originSelectionRange)||mt.undefined(o.originSelectionRange))}a(r,"is"),t.is=r})(Spn||(Spn={}));var f9t;(function(t){function e(n,o,s,c){return{red:n,green:o,blue:s,alpha:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.numberRange(o.red,0,1)&&mt.numberRange(o.green,0,1)&&mt.numberRange(o.blue,0,1)&&mt.numberRange(o.alpha,0,1)}a(r,"is"),t.is=r})(f9t||(f9t={}));var Tpn;(function(t){function e(n,o){return{range:n,color:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&au.is(o.range)&&f9t.is(o.color)}a(r,"is"),t.is=r})(Tpn||(Tpn={}));var Ipn;(function(t){function e(n,o,s){return{label:n,textEdit:o,additionalTextEdits:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.undefined(o.textEdit)||Oce.is(o))&&(mt.undefined(o.additionalTextEdits)||mt.typedArray(o.additionalTextEdits,Oce.is))}a(r,"is"),t.is=r})(Ipn||(Ipn={}));var xpn;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(xpn||(xpn={}));var wpn;(function(t){function e(n,o,s,c,l,u){let d={startLine:n,endLine:o};return mt.defined(s)&&(d.startCharacter=s),mt.defined(c)&&(d.endCharacter=c),mt.defined(l)&&(d.kind=l),mt.defined(u)&&(d.collapsedText=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.uinteger(o.startLine)&&mt.uinteger(o.startLine)&&(mt.undefined(o.startCharacter)||mt.uinteger(o.startCharacter))&&(mt.undefined(o.endCharacter)||mt.uinteger(o.endCharacter))&&(mt.undefined(o.kind)||mt.string(o.kind))}a(r,"is"),t.is=r})(wpn||(wpn={}));var p9t;(function(t){function e(n,o){return{location:n,message:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&iWe.is(o.location)&&mt.string(o.message)}a(r,"is"),t.is=r})(p9t||(p9t={}));var Rpn;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Rpn||(Rpn={}));var Ppn;(function(t){t.Unnecessary=1,t.Deprecated=2})(Ppn||(Ppn={}));var kpn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&mt.string(n.href)}a(e,"is"),t.is=e})(kpn||(kpn={}));var oWe;(function(t){function e(n,o,s,c,l,u){let d={range:n,message:o};return mt.defined(s)&&(d.severity=s),mt.defined(c)&&(d.code=c),mt.defined(l)&&(d.source=l),mt.defined(u)&&(d.relatedInformation=u),d}a(e,"create"),t.create=e;function r(n){var o;let s=n;return mt.defined(s)&&au.is(s.range)&&mt.string(s.message)&&(mt.number(s.severity)||mt.undefined(s.severity))&&(mt.integer(s.code)||mt.string(s.code)||mt.undefined(s.code))&&(mt.undefined(s.codeDescription)||mt.string((o=s.codeDescription)===null||o===void 0?void 0:o.href))&&(mt.string(s.source)||mt.undefined(s.source))&&(mt.undefined(s.relatedInformation)||mt.typedArray(s.relatedInformation,p9t.is))}a(r,"is"),t.is=r})(oWe||(oWe={}));var Mce;(function(t){function e(n,o,...s){let c={title:n,command:o};return mt.defined(s)&&s.length>0&&(c.arguments=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.title)&&mt.string(o.command)}a(r,"is"),t.is=r})(Mce||(Mce={}));var Oce;(function(t){function e(s,c){return{range:s,newText:c}}a(e,"replace"),t.replace=e;function r(s,c){return{range:{start:s,end:s},newText:c}}a(r,"insert"),t.insert=r;function n(s){return{range:s,newText:""}}a(n,"del"),t.del=n;function o(s){let c=s;return mt.objectLiteral(c)&&mt.string(c.newText)&&au.is(c.range)}a(o,"is"),t.is=o})(Oce||(Oce={}));var h9t;(function(t){function e(n,o,s){let c={label:n};return o!==void 0&&(c.needsConfirmation=o),s!==void 0&&(c.description=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&mt.string(o.label)&&(mt.boolean(o.needsConfirmation)||o.needsConfirmation===void 0)&&(mt.string(o.description)||o.description===void 0)}a(r,"is"),t.is=r})(h9t||(h9t={}));var Bce;(function(t){function e(r){let n=r;return mt.string(n)}a(e,"is"),t.is=e})(Bce||(Bce={}));var Dpn;(function(t){function e(s,c,l){return{range:s,newText:c,annotationId:l}}a(e,"replace"),t.replace=e;function r(s,c,l){return{range:{start:s,end:s},newText:c,annotationId:l}}a(r,"insert"),t.insert=r;function n(s,c){return{range:s,newText:"",annotationId:c}}a(n,"del"),t.del=n;function o(s){let c=s;return Oce.is(c)&&(h9t.is(c.annotationId)||Bce.is(c.annotationId))}a(o,"is"),t.is=o})(Dpn||(Dpn={}));var m9t;(function(t){function e(n,o){return{textDocument:n,edits:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&_9t.is(o.textDocument)&&Array.isArray(o.edits)}a(r,"is"),t.is=r})(m9t||(m9t={}));var g9t;(function(t){function e(n,o,s){let c={kind:"create",uri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="create"&&mt.string(o.uri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Bce.is(o.annotationId))}a(r,"is"),t.is=r})(g9t||(g9t={}));var A9t;(function(t){function e(n,o,s,c){let l={kind:"rename",oldUri:n,newUri:o};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),c!==void 0&&(l.annotationId=c),l}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="rename"&&mt.string(o.oldUri)&&mt.string(o.newUri)&&(o.options===void 0||(o.options.overwrite===void 0||mt.boolean(o.options.overwrite))&&(o.options.ignoreIfExists===void 0||mt.boolean(o.options.ignoreIfExists)))&&(o.annotationId===void 0||Bce.is(o.annotationId))}a(r,"is"),t.is=r})(A9t||(A9t={}));var y9t;(function(t){function e(n,o,s){let c={kind:"delete",uri:n};return o!==void 0&&(o.recursive!==void 0||o.ignoreIfNotExists!==void 0)&&(c.options=o),s!==void 0&&(c.annotationId=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&o.kind==="delete"&&mt.string(o.uri)&&(o.options===void 0||(o.options.recursive===void 0||mt.boolean(o.options.recursive))&&(o.options.ignoreIfNotExists===void 0||mt.boolean(o.options.ignoreIfNotExists)))&&(o.annotationId===void 0||Bce.is(o.annotationId))}a(r,"is"),t.is=r})(y9t||(y9t={}));var E9t;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(o=>mt.string(o.kind)?g9t.is(o)||A9t.is(o)||y9t.is(o):m9t.is(o)))}a(e,"is"),t.is=e})(E9t||(E9t={}));var Npn;(function(t){function e(n){return{uri:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)}a(r,"is"),t.is=r})(Npn||(Npn={}));var Mpn;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.integer(o.version)}a(r,"is"),t.is=r})(Mpn||(Mpn={}));var _9t;(function(t){function e(n,o){return{uri:n,version:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&(o.version===null||mt.integer(o.version))}a(r,"is"),t.is=r})(_9t||(_9t={}));var Opn;(function(t){function e(n,o,s,c){return{uri:n,languageId:o,version:s,text:c}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.string(o.uri)&&mt.string(o.languageId)&&mt.integer(o.version)&&mt.string(o.text)}a(r,"is"),t.is=r})(Opn||(Opn={}));var v9t;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){let n=r;return n===t.PlainText||n===t.Markdown}a(e,"is"),t.is=e})(v9t||(v9t={}));var vTe;(function(t){function e(r){let n=r;return mt.objectLiteral(r)&&v9t.is(n.kind)&&mt.string(n.value)}a(e,"is"),t.is=e})(vTe||(vTe={}));var Bpn;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Bpn||(Bpn={}));var Lpn;(function(t){t.PlainText=1,t.Snippet=2})(Lpn||(Lpn={}));var Fpn;(function(t){t.Deprecated=1})(Fpn||(Fpn={}));var Upn;(function(t){function e(n,o,s){return{newText:n,insert:o,replace:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.newText)&&au.is(o.insert)&&au.is(o.replace)}a(r,"is"),t.is=r})(Upn||(Upn={}));var Qpn;(function(t){t.asIs=1,t.adjustIndentation=2})(Qpn||(Qpn={}));var qpn;(function(t){function e(r){let n=r;return n&&(mt.string(n.detail)||n.detail===void 0)&&(mt.string(n.description)||n.description===void 0)}a(e,"is"),t.is=e})(qpn||(qpn={}));var jpn;(function(t){function e(r){return{label:r}}a(e,"create"),t.create=e})(jpn||(jpn={}));var Hpn;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}a(e,"create"),t.create=e})(Hpn||(Hpn={}));var sWe;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}a(e,"fromPlainText"),t.fromPlainText=e;function r(n){let o=n;return mt.string(o)||mt.objectLiteral(o)&&mt.string(o.language)&&mt.string(o.value)}a(r,"is"),t.is=r})(sWe||(sWe={}));var Gpn;(function(t){function e(r){let n=r;return!!n&&mt.objectLiteral(n)&&(vTe.is(n.contents)||sWe.is(n.contents)||mt.typedArray(n.contents,sWe.is))&&(r.range===void 0||au.is(r.range))}a(e,"is"),t.is=e})(Gpn||(Gpn={}));var $pn;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}a(e,"create"),t.create=e})($pn||($pn={}));var Vpn;(function(t){function e(r,n,...o){let s={label:r};return mt.defined(n)&&(s.documentation=n),mt.defined(o)?s.parameters=o:s.parameters=[],s}a(e,"create"),t.create=e})(Vpn||(Vpn={}));var Wpn;(function(t){t.Text=1,t.Read=2,t.Write=3})(Wpn||(Wpn={}));var zpn;(function(t){function e(r,n){let o={range:r};return mt.number(n)&&(o.kind=n),o}a(e,"create"),t.create=e})(zpn||(zpn={}));var Ypn;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Ypn||(Ypn={}));var Kpn;(function(t){t.Deprecated=1})(Kpn||(Kpn={}));var Jpn;(function(t){function e(r,n,o,s,c){let l={name:r,kind:n,location:{uri:s,range:o}};return c&&(l.containerName=c),l}a(e,"create"),t.create=e})(Jpn||(Jpn={}));var Zpn;(function(t){function e(r,n,o,s){return s!==void 0?{name:r,kind:n,location:{uri:o,range:s}}:{name:r,kind:n,location:{uri:o}}}a(e,"create"),t.create=e})(Zpn||(Zpn={}));var Xpn;(function(t){function e(n,o,s,c,l,u){let d={name:n,detail:o,kind:s,range:c,selectionRange:l};return u!==void 0&&(d.children=u),d}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.name)&&mt.number(o.kind)&&au.is(o.range)&&au.is(o.selectionRange)&&(o.detail===void 0||mt.string(o.detail))&&(o.deprecated===void 0||mt.boolean(o.deprecated))&&(o.children===void 0||Array.isArray(o.children))&&(o.tags===void 0||Array.isArray(o.tags))}a(r,"is"),t.is=r})(Xpn||(Xpn={}));var ehn;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(ehn||(ehn={}));var aWe;(function(t){t.Invoked=1,t.Automatic=2})(aWe||(aWe={}));var thn;(function(t){function e(n,o,s){let c={diagnostics:n};return o!=null&&(c.only=o),s!=null&&(c.triggerKind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.typedArray(o.diagnostics,oWe.is)&&(o.only===void 0||mt.typedArray(o.only,mt.string))&&(o.triggerKind===void 0||o.triggerKind===aWe.Invoked||o.triggerKind===aWe.Automatic)}a(r,"is"),t.is=r})(thn||(thn={}));var rhn;(function(t){function e(n,o,s){let c={title:n},l=!0;return typeof o=="string"?(l=!1,c.kind=o):Mce.is(o)?c.command=o:c.edit=o,l&&s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return o&&mt.string(o.title)&&(o.diagnostics===void 0||mt.typedArray(o.diagnostics,oWe.is))&&(o.kind===void 0||mt.string(o.kind))&&(o.edit!==void 0||o.command!==void 0)&&(o.command===void 0||Mce.is(o.command))&&(o.isPreferred===void 0||mt.boolean(o.isPreferred))&&(o.edit===void 0||E9t.is(o.edit))}a(r,"is"),t.is=r})(rhn||(rhn={}));var nhn;(function(t){function e(n,o){let s={range:n};return mt.defined(o)&&(s.data=o),s}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&au.is(o.range)&&(mt.undefined(o.command)||Mce.is(o.command))}a(r,"is"),t.is=r})(nhn||(nhn={}));var ihn;(function(t){function e(n,o){return{tabSize:n,insertSpaces:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&mt.uinteger(o.tabSize)&&mt.boolean(o.insertSpaces)}a(r,"is"),t.is=r})(ihn||(ihn={}));var ohn;(function(t){function e(n,o,s){return{range:n,target:o,data:s}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&au.is(o.range)&&(mt.undefined(o.target)||mt.string(o.target))}a(r,"is"),t.is=r})(ohn||(ohn={}));var shn;(function(t){function e(n,o){return{range:n,parent:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&au.is(o.range)&&(o.parent===void 0||t.is(o.parent))}a(r,"is"),t.is=r})(shn||(shn={}));var ahn;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(ahn||(ahn={}));var chn;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(chn||(chn={}));var lhn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}a(e,"is"),t.is=e})(lhn||(lhn={}));var uhn;(function(t){function e(n,o){return{range:n,text:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&au.is(o.range)&&mt.string(o.text)}a(r,"is"),t.is=r})(uhn||(uhn={}));var dhn;(function(t){function e(n,o,s){return{range:n,variableName:o,caseSensitiveLookup:s}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&au.is(o.range)&&mt.boolean(o.caseSensitiveLookup)&&(mt.string(o.variableName)||o.variableName===void 0)}a(r,"is"),t.is=r})(dhn||(dhn={}));var fhn;(function(t){function e(n,o){return{range:n,expression:o}}a(e,"create"),t.create=e;function r(n){let o=n;return o!=null&&au.is(o.range)&&(mt.string(o.expression)||o.expression===void 0)}a(r,"is"),t.is=r})(fhn||(fhn={}));var phn;(function(t){function e(n,o){return{frameId:n,stoppedLocation:o}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.defined(o)&&au.is(n.stoppedLocation)}a(r,"is"),t.is=r})(phn||(phn={}));var C9t;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}a(e,"is"),t.is=e})(C9t||(C9t={}));var b9t;(function(t){function e(n){return{value:n}}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&(o.tooltip===void 0||mt.string(o.tooltip)||vTe.is(o.tooltip))&&(o.location===void 0||iWe.is(o.location))&&(o.command===void 0||Mce.is(o.command))}a(r,"is"),t.is=r})(b9t||(b9t={}));var hhn;(function(t){function e(n,o,s){let c={position:n,label:o};return s!==void 0&&(c.kind=s),c}a(e,"create"),t.create=e;function r(n){let o=n;return mt.objectLiteral(o)&&Hy.is(o.position)&&(mt.string(o.label)||mt.typedArray(o.label,b9t.is))&&(o.kind===void 0||C9t.is(o.kind))&&o.textEdits===void 0||mt.typedArray(o.textEdits,Oce.is)&&(o.tooltip===void 0||mt.string(o.tooltip)||vTe.is(o.tooltip))&&(o.paddingLeft===void 0||mt.boolean(o.paddingLeft))&&(o.paddingRight===void 0||mt.boolean(o.paddingRight))}a(r,"is"),t.is=r})(hhn||(hhn={}));var mhn;(function(t){function e(r){return{kind:"snippet",value:r}}a(e,"createSnippet"),t.createSnippet=e})(mhn||(mhn={}));var ghn;(function(t){function e(r,n,o,s){return{insertText:r,filterText:n,range:o,command:s}}a(e,"create"),t.create=e})(ghn||(ghn={}));var Ahn;(function(t){function e(r){return{items:r}}a(e,"create"),t.create=e})(Ahn||(Ahn={}));var yhn;(function(t){t.Invoked=0,t.Automatic=1})(yhn||(yhn={}));var Ehn;(function(t){function e(r,n){return{range:r,text:n}}a(e,"create"),t.create=e})(Ehn||(Ehn={}));var _hn;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}a(e,"create"),t.create=e})(_hn||(_hn={}));var vhn;(function(t){function e(r){let n=r;return mt.objectLiteral(n)&&d9t.is(n.uri)&&mt.string(n.name)}a(e,"is"),t.is=e})(vhn||(vhn={}));var Chn;(function(t){function e(s,c,l,u){return new S9t(s,c,l,u)}a(e,"create"),t.create=e;function r(s){let c=s;return!!(mt.defined(c)&&mt.string(c.uri)&&(mt.undefined(c.languageId)||mt.string(c.languageId))&&mt.uinteger(c.lineCount)&&mt.func(c.getText)&&mt.func(c.positionAt)&&mt.func(c.offsetAt))}a(r,"is"),t.is=r;function n(s,c){let l=s.getText(),u=o(c,(f,h)=>{let m=f.range.start.line-h.range.start.line;return m===0?f.range.start.character-h.range.start.character:m}),d=l.length;for(let f=u.length-1;f>=0;f--){let h=u[f],m=s.offsetAt(h.range.start),g=s.offsetAt(h.range.end);if(g<=d)l=l.substring(0,m)+h.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");d=m}return l}a(n,"applyEdits"),t.applyEdits=n;function o(s,c){if(s.length<=1)return s;let l=s.length/2|0,u=s.slice(0,l),d=s.slice(l);o(u,c),o(d,c);let f=0,h=0,m=0;for(;f0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return Ly.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return Ly.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(dt||(dt={}));var Ll=class{static{a(this,"LocationFactory")}static{this.range=lu.create.bind(lu)}static{this.position=Ly.create.bind(Ly)}},iP=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=$L.create(e.clientUri,e.clientLanguageId,n,e.getText());return $L.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=$L.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return $L.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=DM({uri:e,languageId:r})){return new t(ca(e),$L.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=lu.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=lu.create(Ly.create(r,0),Ly.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var MM=require("worker_threads");var TMo=5,Mun=3e4,lFt=class extends L7{constructor(r){super();this.worker=r;this.didChangeEmitter=new no;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>ca(n))}getWorkspaceFolder(r){let n=ca(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:iP.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},uFt=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new lFt(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new I$e(this.fileSystem,n),this.coordinator=new C$e(this.documentManager,n),this.recentActivityProvider=new E$e,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!xln(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new H7(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new H7(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${Mun}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},Mun);r=new rA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new H7(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(F3t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new H7(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function dFt(){return MM.parentPort!==null&&V3t(MM.workerData)}a(dFt,"isContextWorker");function Oun(){if(!dFt())throw new Error("This must be run in a worker thread.");if(!V3t(MM.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(MM.workerData)}`);let t=MM.workerData.cwd;process.cwd=()=>t;let e=new uFt(MM.parentPort,MM.workerData.workspaceRoots,MM.workerData.config);e.addLocalProvider(new m$e(e.fileSystem,e.documentManager)),e.addLocalProvider(new y$e(e.fileSystem,e.documentManager)),e.addLocalProvider(new _$e)}a(Oun,"runContextWorker");p();var XSe=ce(require("util"));function Lun(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(J9(t)==="dev")return t.get(Df).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",XSe.format(...o)))},e.dir=(n,o)=>r(4,XSe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(XSe.format(...n));o.name="Trace",e.log(o)},e}a(Lun,"createConsole");p();p();var M$e=ce(require("path")),Fun=require("worker_threads");var O$e=new Map,IMo=0;function eTe(t,e){let r=IMo++;O$e.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,O$e.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(eTe,"registerWorker");function Uun(t,e){let r=new Fun.Worker(M$e.default.resolve(M$e.default.extname(__filename)!==".ts"?__dirname:M$e.default.resolve(__dirname,"../../dist"),t),{workerData:e});return eTe(r,t),r}a(Uun,"createWorker");function Qun(){return O$e.size}a(Qun,"getActiveWorkerCount");async function qun(){let t=[],e=[];for(let[r,{worker:n,name:o}]of O$e)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(qun,"collectWorkerPerfStats");var B$e=ce(require("os")),jun=ce(require("v8"));function xMo(t){let e=qt(t,je.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(xMo,"getPerfState");var oY=class t{constructor(e){this.ctx=e;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=xMo(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=jun.getHeapStatistics(),o=this.cpuDelta(),s=Qun(),c=0,l="";try{let u=await qun();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(gt(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:B$e.freemem(),systemTotalMemBytes:B$e.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:jL(this.ctx)?1:0}),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var nk=ce(sP()),yro=require("worker_threads");p();p();var bVe=require("assert");p();p();var QOo={right:$Oo,center:VOo},qOo=0,pVe=1,jOo=2,hVe=3,LFt=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` -`).map(o=>o.split(" ")),n=0;return r.forEach(o=>{o.length>1&&_S.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),_S.stringWidth(o[0])))}),r.forEach(o=>{this.div(...o.map((s,c)=>({text:s.trim(),padding:this.measurePadding(s),width:c===0&&o.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=_S.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(` -`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>_S.stringWidth(c)&&(f+=" ".repeat(d-_S.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=QOo[e[l].align];f=m(f,d),_S.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=_S.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=_S.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` +`&&o++}n&&r.length>0&&e.push(r.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,o=r.length;if(o===0)return Hy.create(0,e);for(;ne?o=c:n=c+1}let s=n-1;return Hy.create(s,e-r[s])}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],o=e.line+1"u"}a(n,"undefined"),t.undefined=n;function o(g){return g===!0||g===!1}a(o,"boolean"),t.boolean=o;function s(g){return e.call(g)==="[object String]"}a(s,"string"),t.string=s;function c(g){return e.call(g)==="[object Number]"}a(c,"number"),t.number=c;function l(g,A,y){return e.call(g)==="[object Number]"&&A<=g&&g<=y}a(l,"numberRange"),t.numberRange=l;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}a(u,"integer"),t.integer=u;function d(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}a(d,"uinteger"),t.uinteger=d;function f(g){return e.call(g)==="[object Function]"}a(f,"func"),t.func=f;function h(g){return g!==null&&typeof g=="object"}a(h,"objectLiteral"),t.objectLiteral=h;function m(g,A){return Array.isArray(g)&&g.every(A)}a(m,"typedArray"),t.typedArray=m})(mt||(mt={}));var cu=class{static{a(this,"LocationFactory")}static{this.range=au.create.bind(au)}static{this.position=Hy.create.bind(Hy)}},gS=class t{constructor(e,r,n){this.uri=e;this._textDocument=r;this.detectedLanguageId=n}static{a(this,"CopilotTextDocument")}static withChanges(e,r,n){let o=e3.create(e.clientUri,e.clientLanguageId,n,e.getText());return e3.update(o,r,n),new t(e.uri,o,e.detectedLanguageId)}applyEdits(e){let r=e3.create(this.clientUri,this.clientLanguageId,this.version,this.getText());return e3.update(r,e.map(n=>({text:n.newText,range:n.range})),this.version),new t(this.uri,r,this.detectedLanguageId)}static create(e,r,n,o,s=BM({uri:e,languageId:r})){return new t(ia(e),e3.create(e,r,n,o),s)}get clientUri(){return this._textDocument.uri}get clientLanguageId(){return this._textDocument.languageId}get languageId(){return this._textDocument.languageId}get version(){return this._textDocument.version}get lineCount(){return this._textDocument.lineCount}getText(e){return this._textDocument.getText(e)}positionAt(e){return this._textDocument.positionAt(e)}offsetAt(e){return this._textDocument.offsetAt(e)}lineAt(e){let r=typeof e=="number"?e:e.line;if(r<0||r>=this.lineCount)throw new RangeError("Illegal value for lineNumber");let n=au.create(r,0,r+1,0),o=this.getText(n).replace(/\r\n$|\r$|\n$/g,""),s=au.create(Hy.create(r,0),Hy.create(r,o.length)),c=o.trim().length===0;return{text:o,range:s,isEmptyOrWhitespace:c}}};var FM=require("worker_threads");var m8o=5,bhn=3e4,T9t=class extends rQ{constructor(r){super();this.worker=r;this.didChangeEmitter=new no;this.onDidFileChange=this.didChangeEmitter.event;this.workspaceFolders=[]}static{a(this,"ContextWorkerFileSystem")}setWorkspaceFolders(r){this.workspaceFolders=r.map(n=>ia(n))}getWorkspaceFolder(r){let n=ia(r.uri);for(let o of this.workspaceFolders)if(n.startsWith(o))return o}async readValidFile(r){try{let n=await this.worker.readAndValidateUri(r.uri);return n.valid?{status:"valid",document:gS.create(n.uri,"UNKNOWN",-1,n.text)}:{status:"invalid",reason:`Invalid file ${r.uri}`}}catch{return{status:"invalid",reason:`Invalid file ${r.uri}`}}}},I9t=class{constructor(e,r,n){this.nextId=-1;this.activeValidations=new Map;this.validationQueue=new Map;this.fileSystem=new T9t(this);this.providers=[];this.port=e,this.port.on("message",o=>{o&&typeof o=="object"&&o.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",o=>{this.handleMessage(o)}),this.fileSystem.setWorkspaceFolders(r),this.documentManager=new tWe(this.fileSystem,n),this.coordinator=new KVe(this.documentManager,n),this.recentActivityProvider=new zVe,this.providers.push(this.recentActivityProvider)}static{a(this,"ContextWorker")}addLocalProvider(e){this.providers.push(e)}async handleMessage(e){if(e&&typeof e=="object"&&e.__perf__)return;if(!Apn(e)||typeof e.id!="number"){this.port.postMessage({error:new Error(`Received unrecognized context worker message: ${JSON.stringify(e)}`)});return}let n=e;try{await this.handleMessageUnsafe(n)}catch(o){this.port.postMessage(new cQ(n.id,"Error",o))}}async handleMessageUnsafe(e){switch(e.messageType){case"Exit":this.exit(),this.port.postMessage(new cQ(e.id,"Exit",void 0)),this.port?.close();break;case"RequestUpdate":await this.updateContext(e);break;case"ReadAndValidateResponse":this.settleValidation(e);break;default:throw new Error(`Received inappropriate context client message: ${JSON.stringify(e)}`)}}readAndValidateUri(e){let r=this.validationQueue.get(e)?.deferred;if(!r){let n=this.nextId--,o=setTimeout(()=>{let s=this.activeValidations.get(n)??this.validationQueue.get(e);s&&s.id===n&&(s.deferred.reject(new Error(`Validation timed out after ${bhn}ms`)),this.activeValidations.delete(n)||this.validationQueue.delete(e),this.advanceValidationQueue())},bhn);r=new nA,this.validationQueue.set(e,{id:n,uri:e,deferred:r,timeout:o}),this.advanceValidationQueue()}return r.promise}advanceValidationQueue(){for(;this.validationQueue.size>0&&this.activeValidations.sizer.getNodeWeight(h.id)??0),c[d.uri]=f}this.port.postMessage(new cQ(e.id,"UpdateResponse",{documents:c}));let l=[];for(let d of this.providers)l.push(e9t(d.getContext(n,r,this.documentManager)));let u=await Promise.all(l);for(let d of u)if(d.status==="error"){let f=d.reason instanceof Error?d.reason:new Error(String(d.reason));this.port.postMessage(new cQ(e.id,"Error",f))}else for(let f of d.value??[])this.coordinator.pushWorkspaceContext(f.source,[f])}exit(){for(let e of this.providers)e.dispose();this.providers=[],this.documentManager.dispose()}};function x9t(){return FM.parentPort!==null&&c9t(FM.workerData)}a(x9t,"isContextWorker");function Shn(){if(!x9t())throw new Error("This must be run in a worker thread.");if(!c9t(FM.workerData))throw new Error(`Invalid worker data for context worker: ${JSON.stringify(FM.workerData)}`);let t=FM.workerData.cwd;process.cwd=()=>t;let e=new I9t(FM.parentPort,FM.workerData.workspaceRoots,FM.workerData.config);e.addLocalProvider(new GVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new WVe(e.fileSystem,e.documentManager)),e.addLocalProvider(new YVe)}a(Shn,"runContextWorker");p();var CTe=fe(require("util"));function Thn(t){let e=new console.Console(process.stderr,process.stderr);function r(n,...o){if(G9(t)==="dev")return t.get(Nf).logIt(t,n,"console",...o)}return a(r,"logIt"),e.debug=(...n)=>r(4,...n),e.info=(...n)=>r(3,...n),e.warn=(...n)=>r(2,...n),e.error=(...n)=>r(1,...n),e.assert=(n,...o)=>{n||(o.length===0?r(2,"Assertion failed"):r(2,"Assertion failed:",CTe.format(...o)))},e.dir=(n,o)=>r(4,CTe.inspect(n,o)),e.log=e.debug.bind(e),e.trace=(...n)=>{let o=new Error(CTe.format(...n));o.name="Trace",e.log(o)},e}a(Thn,"createConsole");p();p();var lWe=fe(require("path")),Ihn=require("worker_threads");var uWe=new Map,g8o=0;function bTe(t,e){let r=g8o++;uWe.set(r,{worker:t,name:e});let n=t.removeAllListeners.bind(t),o=!1,s=a(()=>{o||(o=!0,uWe.delete(r),t.removeListener("exit",s),t.removeAllListeners===c&&(t.removeAllListeners=n))},"unregisterWorker"),c=a((l=>((l===void 0||l==="exit")&&s(),n(l))),"patchedRemoveAllListeners");return t.removeAllListeners=c,t.once("exit",s),s}a(bTe,"registerWorker");function xhn(t,e){let r=new Ihn.Worker(lWe.default.resolve(lWe.default.extname(__filename)!==".ts"?__dirname:lWe.default.resolve(__dirname,"../../dist"),t),{workerData:e});return bTe(r,t),r}a(xhn,"createWorker");function whn(){return uWe.size}a(whn,"getActiveWorkerCount");async function Rhn(){let t=[],e=[];for(let[r,{worker:n,name:o}]of uWe)e.push(new Promise(s=>{let c=setTimeout(()=>{n.removeListener("message",l),s()},1e3);c.unref();let l=a(u=>{if(u&&typeof u=="object"&&u.__perf__){clearTimeout(c),n.removeListener("message",l);let f=u.memoryUsage;t.push({id:r,name:o,heapUsedBytes:f?.heapUsed??0,heapTotalBytes:f?.heapTotal??0,externalBytes:f?.external??0,arrayBufferBytes:f?.arrayBuffers??0}),s()}},"handler");n.on("message",l);try{n.postMessage({__perf__:!0})}catch{clearTimeout(c),n.removeListener("message",l),s()}}));return await Promise.allSettled(e),t}a(Rhn,"collectWorkerPerfStats");var dWe=fe(require("os")),Phn=fe(require("v8"));function A8o(t){let e=Ht(t,Je.PerfEnabled);return e==="false"||e===!1?{enabled:!1,shouldSample:!1}:e==="true"||e===!0?{enabled:!0,shouldSample:!0}:{enabled:!0,shouldSample:Math.random()<.01}}a(A8o,"getPerfState");var EY=class t{constructor(e){this.ctx=e;this.sampled=!1;this.pendingTimeouts=[];this.lastCpuUsage=process.cpuUsage();this.lastCpuTime=Date.now();this.lastHighRssTime=0}static{a(this,"PerfMonitor")}static{this.HIGH_RSS_BYTES=2*1024*1024*1024}start(){this.sampled=A8o(this.ctx).shouldSample,this.sampled&&(this.scheduleTimeout(()=>{this.emitSnapshot("startup_30s")},3e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_1min")},6e4),this.scheduleTimeout(()=>{this.emitSnapshot("startup_5min")},3e5),this.snapshotTimer=setInterval(()=>{this.emitSnapshot("periodic")},6e5),this.snapshotTimer.unref())}stop(){this.snapshotTimer&&(clearInterval(this.snapshotTimer),this.snapshotTimer=void 0);for(let e of this.pendingTimeouts)clearTimeout(e);this.pendingTimeouts.length=0}scheduleTimeout(e,r){let n=setTimeout(()=>{let o=this.pendingTimeouts.indexOf(n);o>=0&&this.pendingTimeouts.splice(o,1),e()},r);n.unref(),this.pendingTimeouts.push(n)}async emitSnapshot(e){try{let r=process.memoryUsage(),n=Phn.getHeapStatistics(),o=this.cpuDelta(),s=whn(),c=0,l="";try{let u=await Rhn();s=u.length;for(let d of u)c+=d.heapUsedBytes;u.length>0&&(l=JSON.stringify(u.map(d=>({id:d.id,n:d.name,heap:d.heapUsedBytes,heapTotal:d.heapTotalBytes,ext:d.externalBytes,arrBuf:d.arrayBufferBytes}))))}catch{}if(_t(this.ctx,"cls.perf.memory_snapshot",{platform:process.platform,trigger:e,workerDetails:l},{uptimeMs:Math.round(process.uptime()*1e3),rssBytes:r.rss,heapUsedBytes:r.heapUsed,heapTotalBytes:r.heapTotal,heapSizeLimitBytes:n.heap_size_limit,externalBytes:r.external,arrayBufferBytes:r.arrayBuffers,cpuPercent:o.total,cpuUserPercent:o.user,cpuSystemPercent:o.system,systemFreeMemBytes:dWe.freemem(),systemTotalMemBytes:dWe.totalmem(),workerCount:s,workerHeapUsedTotal:c,workspaceIndexDisabled:ZP(this.ctx)?1:0}),e!=="high_rss_followup_30s"&&r.rss>t.HIGH_RSS_BYTES){let u=Date.now();u-this.lastHighRssTime>=6e5&&(this.lastHighRssTime=u,this.scheduleTimeout(()=>{this.emitSnapshot("high_rss_followup_30s")},3e4))}}catch{}}cpuDelta(){let e=Date.now(),r=e-this.lastCpuTime;if(r<=0)return{total:0,user:0,system:0};let n=process.cpuUsage(),o=(n.user-this.lastCpuUsage.user)/1e3/r*100,s=(n.system-this.lastCpuUsage.system)/1e3/r*100;return this.lastCpuUsage=n,this.lastCpuTime=e,{total:Math.round((o+s)*100)/100,user:Math.round(o*100)/100,system:Math.round(s*100)/100}}};var eP=fe(fk()),oro=require("worker_threads");p();p();var ZWe=require("assert");p();p();var P6o={right:O6o,center:B6o},k6o=0,jWe=1,D6o=2,HWe=3,X9t=class{static{a(this,"UI")}constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(` +`).map(o=>o.split(" ")),n=0;return r.forEach(o=>{o.length>1&&AS.stringWidth(o[0])>n&&(n=Math.min(Math.floor(this.width*.5),AS.stringWidth(o[0])))}),r.forEach(o=>{this.div(...o.map((s,c)=>({text:s.trim(),padding:this.measurePadding(s),width:c===0&&o.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=AS.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(` +`)}rowToString(e,r){return this.rasterize(e).forEach((n,o)=>{let s="";n.forEach((c,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=c;if(d>AS.stringWidth(c)&&(f+=" ".repeat(d-AS.stringWidth(c))),e[l].align&&e[l].align!=="left"&&this.wrap){let m=P6o[e[l].align];f=m(f,d),AS.stringWidth(f)0&&(s=this.renderInline(s,r[r.length-1]))}),r.push({text:s.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),o=n?n[0].length:0,s=r.text,c=AS.stringWidth(s.trimRight());return r.span?this.wrap?o{s.width=n[c],this.wrap?o=AS.wrap(s.text,this.negatePadding(s),{hard:!0}).split(` `):o=s.text.split(` -`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[qOo]||0).fill("")),o.push(...new Array(s.padding[jOo]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||_S.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,HOo(e[l])):c)}};function Bdn(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(Bdn,"addBorder");function HOo(t){let e=t.padding||[],r=1+(e[hVe]||0)+(e[pVe]||0);return t.border?r+4:r}a(HOo,"_minWidth");function GOo(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(GOo,"getWindowWidth");function $Oo(t,e){t=t.trim();let r=_S.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(VOo,"alignCenter");var _S;function Ldn(t,e){return _S=e,new LFt({width:t?.width||GOo(),wrap:t?.wrap})}a(Ldn,"cliui");p();p();p();function FFt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(FFt,"ansiRegex");var WOo=FFt();function lY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(WOo,"")}a(lY,"stripAnsi");p();p();function Fdn(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(Fdn,"isAmbiguous");function Udn(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(Udn,"isFullWidth");function Qdn(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(Qdn,"isWide");function zOo(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(zOo,"validate");function mVe(t,{ambiguousAsWide:e=!1}={}){return zOo(t),Udn(t)||Qdn(t)||e&&Fdn(t)?2:1}a(mVe,"eastAsianWidth");p();var qdn=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var YOo=new Intl.Segmenter,KOo=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function VL(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=lY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of YOo.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!KOo.test(c)){if(qdn().test(c)){o+=2;continue}o+=mVe(l,s)}}return o}a(VL,"stringWidth");p();p();var jdn=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),Hdn=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),Gdn=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),wd={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},PPu=Object.keys(wd.modifier),JOo=Object.keys(wd.color),ZOo=Object.keys(wd.bgColor),DPu=[...JOo,...ZOo];function XOo(){let t=new Map;for(let[e,r]of Object.entries(wd)){for(let[n,o]of Object.entries(r))wd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=wd[n],t.set(o[0],o[1]);Object.defineProperty(wd,e,{value:r,enumerable:!1})}return Object.defineProperty(wd,"codes",{value:t,enumerable:!1}),wd.color.close="\x1B[39m",wd.bgColor.close="\x1B[49m",wd.color.ansi=jdn(),wd.color.ansi256=Hdn(),wd.color.ansi16m=Gdn(),wd.bgColor.ansi=jdn(10),wd.bgColor.ansi256=Hdn(10),wd.bgColor.ansi16m=Gdn(10),Object.defineProperties(wd,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>wd.rgbToAnsi256(...wd.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>wd.ansi256ToAnsi(wd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>wd.ansi256ToAnsi(wd.hexToAnsi256(e)),"value"),enumerable:!1}}),wd}a(XOo,"assembleStyles");var e5o=XOo(),$dn=e5o;var AVe=new Set(["\x1B","\x9B"]),t5o=39,QFt="\x07",zdn="[",r5o="]",Ydn="m",gVe=`${r5o}8;;`,Vdn=a(t=>`${AVe.values().next().value}${zdn}${t}${Ydn}`,"wrapAnsiCode"),Wdn=a(t=>`${AVe.values().next().value}${gVe}${t}${QFt}`,"wrapAnsiHyperlink"),n5o=a(t=>t.split(" ").map(e=>VL(e)),"wordLengths"),UFt=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=VL(lY(t.at(-1)));for(let[l,u]of n.entries()){let d=VL(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),AVe.has(u)&&(o=!0,s=n.slice(l+1,l+1+gVe.length).join("")===gVe),o){s?u===QFt&&(o=!1,s=!1):u===Ydn&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),i5o=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(VL(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),o5o=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=n5o(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=VL(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){UFt(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>i5o(h)));let u=l.join(` -`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,AVe.has(m)){let{groups:A}=new RegExp(`(?:\\${zdn}(?\\d+)m|\\${gVe}(?.*)${QFt})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===t5o?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=$dn.codes.get(Number(o));d[h+1]===` -`?(s&&(n+=Wdn("")),o&&g&&(n+=Vdn(g))):m===` -`&&(o&&g&&(n+=Vdn(o)),s&&(n+=Wdn(s))),f+=m.length}return n},"exec");function qFt(t,e,r){return String(t).normalize().replaceAll(`\r +`),s.border&&(o.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),o.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(o.unshift(...new Array(s.padding[k6o]||0).fill("")),o.push(...new Array(s.padding[D6o]||0).fill(""))),o.forEach((l,u)=>{r[u]||r.push([]);let d=r[u];for(let f=0;fc.width||AS.stringWidth(c.text));let r=e.length,n=this.width,o=e.map(c=>{if(c.width)return r--,n-=c.width,c.width}),s=r?Math.floor(n/r):0;return o.map((c,l)=>c===void 0?Math.max(s,N6o(e[l])):c)}};function S0n(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}a(S0n,"addBorder");function N6o(t){let e=t.padding||[],r=1+(e[HWe]||0)+(e[jWe]||0);return t.border?r+4:r}a(N6o,"_minWidth");function M6o(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}a(M6o,"getWindowWidth");function O6o(t,e){t=t.trim();let r=AS.stringWidth(t);return r=e?t:" ".repeat(e-r>>1)+t}a(B6o,"alignCenter");var AS;function T0n(t,e){return AS=e,new X9t({width:t?.width||M6o(),wrap:t?.wrap})}a(T0n,"cliui");p();p();p();function eUt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(eUt,"ansiRegex");var L6o=eUt();function bY(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(L6o,"")}a(bY,"stripAnsi");p();p();function I0n(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}a(I0n,"isAmbiguous");function x0n(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}a(x0n,"isFullWidth");function w0n(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9800&&t<=9811||t===9855||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=19968&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101632&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129672||t>=129680&&t<=129725||t>=129727&&t<=129733||t>=129742&&t<=129755||t>=129760&&t<=129768||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}a(w0n,"isWide");function F6o(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}a(F6o,"validate");function GWe(t,{ambiguousAsWide:e=!1}={}){return F6o(t),x0n(t)||w0n(t)||e&&I0n(t)?2:1}a(GWe,"eastAsianWidth");p();var R0n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var U6o=new Intl.Segmenter,Q6o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function t3(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=bY(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of U6o.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!Q6o.test(c)){if(R0n().test(c)){o+=2;continue}o+=GWe(l,s)}}return o}a(t3,"stringWidth");p();p();var P0n=a((t=0)=>e=>`\x1B[${e+t}m`,"wrapAnsi16"),k0n=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"wrapAnsi256"),D0n=a((t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,"wrapAnsi16m"),Rd={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},RNu=Object.keys(Rd.modifier),q6o=Object.keys(Rd.color),j6o=Object.keys(Rd.bgColor),PNu=[...q6o,...j6o];function H6o(){let t=new Map;for(let[e,r]of Object.entries(Rd)){for(let[n,o]of Object.entries(r))Rd[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Rd[n],t.set(o[0],o[1]);Object.defineProperty(Rd,e,{value:r,enumerable:!1})}return Object.defineProperty(Rd,"codes",{value:t,enumerable:!1}),Rd.color.close="\x1B[39m",Rd.bgColor.close="\x1B[49m",Rd.color.ansi=P0n(),Rd.color.ansi256=k0n(),Rd.color.ansi16m=D0n(),Rd.bgColor.ansi=P0n(10),Rd.bgColor.ansi256=k0n(10),Rd.bgColor.ansi16m=D0n(10),Object.defineProperties(Rd,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Rd.rgbToAnsi256(...Rd.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let l=e%36;r=Math.floor(e/36)/5,n=Math.floor(l/6)/5,o=l%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:a((e,r,n)=>Rd.ansi256ToAnsi(Rd.rgbToAnsi256(e,r,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Rd.ansi256ToAnsi(Rd.hexToAnsi256(e)),"value"),enumerable:!1}}),Rd}a(H6o,"assembleStyles");var G6o=H6o(),N0n=G6o;var VWe=new Set(["\x1B","\x9B"]),$6o=39,rUt="\x07",B0n="[",V6o="]",L0n="m",$We=`${V6o}8;;`,M0n=a(t=>`${VWe.values().next().value}${B0n}${t}${L0n}`,"wrapAnsiCode"),O0n=a(t=>`${VWe.values().next().value}${$We}${t}${rUt}`,"wrapAnsiHyperlink"),W6o=a(t=>t.split(" ").map(e=>t3(e)),"wordLengths"),tUt=a((t,e,r)=>{let n=[...e],o=!1,s=!1,c=t3(bY(t.at(-1)));for(let[l,u]of n.entries()){let d=t3(u);if(c+d<=r?t[t.length-1]+=u:(t.push(u),c=0),VWe.has(u)&&(o=!0,s=n.slice(l+1,l+1+$We.length).join("")===$We),o){s?u===rUt&&(o=!1,s=!1):u===L0n&&(o=!1);continue}c+=d,c===r&&l0&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),z6o=a(t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(t3(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},"stringVisibleTrimSpacesRight"),Y6o=a((t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,c=W6o(t),l=[""];for(let[h,m]of t.split(" ").entries()){r.trim!==!1&&(l[l.length-1]=l.at(-1).trimStart());let g=t3(l.at(-1));if(h!==0&&(g>=e&&(r.wordWrap===!1||r.trim===!1)&&(l.push(""),g=0),(g>0||r.trim===!1)&&(l[l.length-1]+=" ",g++)),r.hard&&c[h]>e){let A=e-g,y=1+Math.floor((c[h]-A-1)/e);Math.floor((c[h]-1)/e)e&&g>0&&c[h]>0){if(r.wordWrap===!1&&ge&&r.wordWrap===!1){tUt(l,m,e);continue}l[l.length-1]+=m}r.trim!==!1&&(l=l.map(h=>z6o(h)));let u=l.join(` +`),d=[...u],f=0;for(let[h,m]of d.entries()){if(n+=m,VWe.has(m)){let{groups:A}=new RegExp(`(?:\\${B0n}(?\\d+)m|\\${$We}(?.*)${rUt})`).exec(u.slice(f))||{groups:{}};if(A.code!==void 0){let y=Number.parseFloat(A.code);o=y===$6o?void 0:y}else A.uri!==void 0&&(s=A.uri.length===0?void 0:A.uri)}let g=N0n.codes.get(Number(o));d[h+1]===` +`?(s&&(n+=O0n("")),o&&g&&(n+=M0n(g))):m===` +`&&(o&&g&&(n+=M0n(o)),s&&(n+=O0n(s))),f+=m.length}return n},"exec");function nUt(t,e,r){return String(t).normalize().replaceAll(`\r `,` `).split(` -`).map(n=>o5o(n,e,r)).join(` -`)}a(qFt,"wrapAnsi");function jFt(t){return Ldn(t,{stringWidth:VL,stripAnsi:lY,wrap:qFt})}a(jFt,"ui");p();var bce=require("path"),yVe=require("fs");function HFt(t,e){let r=(0,bce.resolve)(".",t),n;for((0,yVe.statSync)(r).isDirectory()||(r=(0,bce.dirname)(r));;){if(n=e(r,(0,yVe.readdirSync)(r)),n)return(0,bce.resolve)(r,n);if(r=(0,bce.dirname)(n=r),n===r)break}}a(HFt,"default");var hfn=require("util"),e8t=require("url");p();var tfn=require("util"),vVe=require("path");p();function uY(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(EVe,"decamelize");function _Ve(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(_Ve,"looksLikeNumber");p();p();function Kdn(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof ae=="number"&&(E.nargs[K]=ae,E.keys.push(K))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([K,ae])=>{typeof ae=="function"&&(E.coercions[K]=ae,E.keys.push(K))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(K){E.configs[K]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([K,ae])=>{(typeof ae=="boolean"||typeof ae=="function")&&(E.configs[K]=ae)})),re(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(K){(E.aliases[K]||[]).forEach(function(ae){u[ae]=u[K]})});let b=null;le();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let K=0;K=3&&(j(_e[1],E.arrays)?K=D(K,_e[1],o,_e[2]):j(_e[1],E.nargs)!==!1?K=k(K,_e[1],o,_e[2]):N(_e[1],_e[2],!0));else if(ae.match(v)&&l["boolean-negation"])_e=ae.match(v),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],N(se,j(se,E.arrays)?[!1]:!1));else if(ae.match(/^--.+/)||!l["short-option-groups"]&&ae.match(/^-[^-]+/))_e=ae.match(/^--?(.+)/),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],j(se,E.arrays)?K=D(K,se,o):j(se,E.nargs)!==!1?K=k(K,se,o):(Re=o[K+1],Re!==void 0&&(!Re.match(/^-/)||Re.match(_))&&!j(se,E.bools)&&!j(se,E.counts)||/^(true|false)$/.test(Re)?(N(se,Re),K++):N(se,Te(se))));else if(ae.match(/^-.\..+=/))_e=ae.match(/^-([^=]+)=([\s\S]*)$/),_e!==null&&Array.isArray(_e)&&_e.length>=3&&N(_e[1],_e[2]);else if(ae.match(/^-.\..+/)&&!ae.match(_))Re=o[K+1],_e=ae.match(/^-(.\..+)/),_e!==null&&Array.isArray(_e)&&_e.length>=2&&(se=_e[1],Re!==void 0&&!Re.match(/^-/)&&!j(se,E.bools)&&!j(se,E.counts)?(N(se,Re),K++):N(se,Te(se)));else if(ae.match(/^-[^-]+/)&&!ae.match(_)){Ie=ae.slice(1,-1).split(""),ne=!1;for(let Xe=0;XeK!=="--"&&K.includes("-")).forEach(K=>{delete w[K]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(K=>c[K])).forEach(K=>{l["camel-case-expansion"]&&K.includes("-")&&delete w[K.split(".").map(ae=>uY(ae)).join(".")],delete w[K]});function x(K){let ae=Q("_",K);(typeof ae=="string"||typeof ae=="number")&&w._.push(ae)}a(x,"pushPositional");function k(K,ae,Me,ne){let se,Ie=j(ae,E.nargs);if(Ie=typeof Ie!="number"||isNaN(Ie)?1:Ie,Ie===0)return z(ne)||(b=Error(y("Argument unexpected for: %s",ae))),N(ae,Te(ae)),K;let _e=z(ne)?0:1;if(l["nargs-eats-options"])Me.length-(K+1)+_e0&&(N(ae,ne),Re--),se=K+1;se0||_e&&typeof _e=="number"&&se.length>=_e||(Ie=Me[Re],/^-/.test(Ie)&&!_.test(Ie)&&!Ae(Ie)));Re++)K=Re,se.push(B(ae,Ie,s))}return typeof _e=="number"&&(_e&&se.length<_e||isNaN(_e)&&se.length===0)&&(b=Error(y("Not enough arguments following: %s",ae))),N(ae,se),K}a(D,"eatArray");function N(K,ae,Me=s){if(/-/.test(K)&&l["camel-case-expansion"]){let Ie=K.split(".").map(function(_e){return uY(_e)}).join(".");L(K,Ie)}let ne=B(K,ae,Me),se=K.split(".");Y(w,se,ne),E.aliases[K]&&E.aliases[K].forEach(function(Ie){let _e=Ie.split(".");Y(w,_e,ne)}),se.length>1&&l["dot-notation"]&&(E.aliases[se[0]]||[]).forEach(function(Ie){let _e=Ie.split("."),Re=[].concat(se);Re.shift(),_e=_e.concat(Re),(E.aliases[K]||[]).includes(_e.join("."))||Y(w,_e,ne)}),j(K,E.normalize)&&!j(K,E.arrays)&&[K].concat(E.aliases[K]||[]).forEach(function(_e){Object.defineProperty(R,_e,{enumerable:!0,get(){return ae},set(Re){ae=typeof Re=="string"?WL.normalize(Re):Re}})})}a(N,"setArg");function L(K,ae){E.aliases[K]&&E.aliases[K].length||(E.aliases[K]=[ae],g[ae]=!0),E.aliases[ae]&&E.aliases[ae].length||L(ae,K)}a(L,"addNewAlias");function B(K,ae,Me){Me&&(ae=a5o(ae)),(j(K,E.bools)||j(K,E.counts))&&typeof ae=="string"&&(ae=ae==="true");let ne=Array.isArray(ae)?ae.map(function(se){return Q(K,se)}):Q(K,ae);return j(K,E.counts)&&(z(ne)||typeof ne=="boolean")&&(ne=GFt()),j(K,E.normalize)&&j(K,E.arrays)&&(Array.isArray(ae)?ne=ae.map(se=>WL.normalize(se)):ne=WL.normalize(ae)),ne}a(B,"processValue");function Q(K,ae){return!l["parse-positional-numbers"]&&K==="_"||!j(K,E.strings)&&!j(K,E.bools)&&!Array.isArray(ae)&&(_Ve(ae)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ae}`)))||!z(ae)&&j(K,E.numbers))&&(ae=Number(ae)),ae}a(Q,"maybeCoerceNumber");function M(K){let ae=Object.create(null);V(ae,E.aliases,u),Object.keys(E.configs).forEach(function(Me){let ne=K[Me]||ae[Me];if(ne)try{let se=null,Ie=WL.resolve(WL.cwd(),ne),_e=E.configs[Me];if(typeof _e=="function"){try{se=_e(Ie)}catch(Re){se=Re}if(se instanceof Error){b=se;return}}else se=WL.require(Ie);O(se)}catch(se){se.name==="PermissionDenied"?b=se:K[Me]&&(b=Error(y("Invalid JSON config file: %s",ne)))}})}a(M,"setConfig");function O(K,ae){Object.keys(K).forEach(function(Me){let ne=K[Me],se=ae?ae+"."+Me:Me;typeof ne=="object"&&ne!==null&&!Array.isArray(ne)&&l["dot-notation"]?O(ne,se):(!G(w,se.split("."))||j(se,E.arrays)&&l["combine-arrays"])&&N(se,ne)})}a(O,"setConfigObject");function q(){typeof d<"u"&&d.forEach(function(K){O(K)})}a(q,"setConfigObjects");function F(K,ae){if(typeof f>"u")return;let Me=typeof f=="string"?f:"",ne=WL.env();Object.keys(ne).forEach(function(se){if(Me===""||se.lastIndexOf(Me,0)===0){let Ie=se.split("__").map(function(_e,Re){return Re===0&&(_e=_e.substring(Me.length)),uY(_e)});(ae&&E.configs[Ie.join(".")]||!ae)&&!G(K,Ie)&&N(Ie.join("."),ne[se])}})}a(F,"applyEnvVars");function U(K){let ae,Me=new Set;Object.keys(K).forEach(function(ne){if(!Me.has(ne)&&(ae=j(ne,E.coercions),typeof ae=="function"))try{let se=Q(ne,ae(K[ne]));[].concat(E.aliases[ne]||[],ne).forEach(Ie=>{Me.add(Ie),K[Ie]=se})}catch(se){b=se}})}a(U,"applyCoercions");function W(K){return E.keys.forEach(ae=>{~ae.indexOf(".")||typeof K[ae]>"u"&&(K[ae]=void 0)}),K}a(W,"setPlaceholderKeys");function V(K,ae,Me,ne=!1){Object.keys(Me).forEach(function(se){G(K,se.split("."))||(Y(K,se.split("."),Me[se]),ne&&(A[se]=!0),(ae[se]||[]).forEach(function(Ie){G(K,Ie.split("."))||Y(K,Ie.split("."),Me[se])}))})}a(V,"applyDefaultsAndAliases");function G(K,ae){let Me=K;l["dot-notation"]||(ae=[ae.join(".")]),ae.slice(0,-1).forEach(function(se){Me=Me[se]||{}});let ne=ae[ae.length-1];return typeof Me!="object"?!1:ne in Me}a(G,"hasKey");function Y(K,ae,Me){let ne=K;l["dot-notation"]||(ae=[ae.join(".")]),ae.slice(0,-1).forEach(function(Je){Je=Jdn(Je),typeof ne=="object"&&ne[Je]===void 0&&(ne[Je]={}),typeof ne[Je]!="object"||Array.isArray(ne[Je])?(Array.isArray(ne[Je])?ne[Je].push({}):ne[Je]=[ne[Je],{}],ne=ne[Je][ne[Je].length-1]):ne=ne[Je]});let se=Jdn(ae[ae.length-1]),Ie=j(ae.join("."),E.arrays),_e=Array.isArray(Me),Re=l["duplicate-arguments-array"];!Re&&j(se,E.nargs)&&(Re=!0,(!z(ne[se])&&E.nargs[se]===1||Array.isArray(ne[se])&&ne[se].length===E.nargs[se])&&(ne[se]=void 0)),Me===GFt()?ne[se]=GFt(ne[se]):Array.isArray(ne[se])?Re&&Ie&&_e?ne[se]=l["flatten-duplicate-arrays"]?ne[se].concat(Me):(Array.isArray(ne[se][0])?ne[se]:[ne[se]]).concat([Me]):!Re&&!!Ie==!!_e?ne[se]=Me:ne[se]=ne[se].concat([Me]):ne[se]===void 0&&Ie?ne[se]=_e?Me:[Me]:Re&&!(ne[se]===void 0||j(se,E.counts)||j(se,E.bools))?ne[se]=[ne[se],Me]:ne[se]=Me}a(Y,"setKey");function re(...K){K.forEach(function(ae){Object.keys(ae||{}).forEach(function(Me){E.aliases[Me]||(E.aliases[Me]=[].concat(c[Me]||[]),E.aliases[Me].concat(Me).forEach(function(ne){if(/-/.test(ne)&&l["camel-case-expansion"]){let se=uY(ne);se!==Me&&E.aliases[Me].indexOf(se)===-1&&(E.aliases[Me].push(se),g[se]=!0)}}),E.aliases[Me].concat(Me).forEach(function(ne){if(ne.length>1&&/[A-Z]/.test(ne)&&l["camel-case-expansion"]){let se=EVe(ne,"-");se!==Me&&E.aliases[Me].indexOf(se)===-1&&(E.aliases[Me].push(se),g[se]=!0)}}),E.aliases[Me].forEach(function(ne){E.aliases[ne]=[Me].concat(E.aliases[Me].filter(function(se){return ne!==se}))}))})})}a(re,"extendAliases");function j(K,ae){let Me=[].concat(E.aliases[K]||[],K),ne=Object.keys(ae),se=Me.find(Ie=>ne.includes(Ie));return se?ae[se]:!1}a(j,"checkAllAliases");function X(K){let ae=Object.keys(E);return[].concat(ae.map(ne=>E[ne])).some(function(ne){return Array.isArray(ne)?ne.includes(K):ne[K]})}a(X,"hasAnyFlag");function ie(K,...ae){return[].concat(...ae).some(function(ne){let se=K.match(ne);return se&&X(se[1])})}a(ie,"hasFlagsMatching");function we(K){if(K.match(_)||!K.match(/^-[^-]+/))return!1;let ae=!0,Me,ne=K.slice(1).split("");for(let se=0;sej(K,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",K)),!0):j(K,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",K)),!0):!1)}return a(le,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function s5o(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;oc5o,"env"),format:tfn.format,normalize:vVe.normalize,resolve:vVe.resolve,require:a(t=>{if(typeof efn<"u")return efn(t);if(t.match(/\.json$/))return JSON.parse((0,rfn.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),aTe=a(function(e,r){return nfn.parse(e.slice(),r).argv},"Parser");aTe.detailed=function(t,e){return nfn.parse(t.slice(),e)};aTe.camelCase=uY;aTe.decamelize=EVe;aTe.looksLikeNumber=_Ve;var ifn=aTe;var CS=require("path");p();function l5o(){return u5o()?0:1}a(l5o,"getProcessArgvBinIndex");function u5o(){return d5o()&&!process.defaultApp}a(u5o,"isBundledElectronApp");function d5o(){return!!process.versions.electron}a(d5o,"isElectronApp");function ofn(){return process.argv[l5o()]}a(ofn,"getProcessArgvBin");p();p();p();function YFt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(YFt,"ansiRegex");var f5o=YFt();function KFt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(f5o,"")}a(KFt,"stripAnsi");p();var sfn=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var p5o=new Intl.Segmenter,h5o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function JFt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=KFt(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of p5o.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!h5o.test(c)){if(sfn().test(c)){o+=2;continue}o+=mVe(l,s)}}return o}a(JFt,"stringWidth");p();p();var Sce=require("fs"),afn=require("util"),cfn=require("path");var lfn={fs:{readFileSync:Sce.readFileSync,writeFile:Sce.writeFile},format:afn.format,resolve:cfn.resolve,exists:a(t=>{try{return(0,Sce.statSync)(t).isFile()}catch{return!1}},"exists")};p();var aP,ZFt=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),aP.format.apply(aP.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),aP.format.apply(aP.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);aP.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{aP.fs.readFileSync&&(e=JSON.parse(aP.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=aP.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=aP.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return aP.exists(e)}};function ufn(t,e){aP=e;let r=new ZFt(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a(ufn,"y18n");var m5o=a(t=>ufn(t,lfn),"y18n"),dfn=m5o;var mfn=require("node:module"),gfn=ce(pfn(),1),SVe=require("node:fs");var XFt=(0,e8t.fileURLToPath)(importMetaUrlShim),g5o=XFt.substring(0,XFt.lastIndexOf("node_modules")),A5o=(0,mfn.createRequire)(importMetaUrlShim),Afn={assert:{notStrictEqual:bVe.notStrictEqual,strictEqual:bVe.strictEqual},cliui:jFt,findUp:HFt,getEnv:a(t=>process.env[t],"getEnv"),inspect:hfn.inspect,getProcessArgvBin:ofn,mainFilename:g5o||process.cwd(),Parser:ifn,path:{basename:CS.basename,dirname:CS.dirname,extname:CS.extname,relative:CS.relative,resolve:CS.resolve,join:CS.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:SVe.readFileSync,readdirSync:SVe.readdirSync,require:A5o,getCallerFile:a(()=>{let t=(0,gfn.default)(3);return t.match(/^file:\/\//)?(0,e8t.fileURLToPath)(t):t},"getCallerFile"),stringWidth:JFt,y18n:dfn({directory:(0,CS.resolve)(XFt,"../../../locales"),updateFiles:!1})};p();p();p();function C_(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(C_,"assertNotStrictEqual");function t8t(t,e){e.assert.strictEqual(typeof t,"string")}a(t8t,"assertSingleKey");function Tce(t){return Object.keys(t)}a(Tce,"objectKeys");p();function $u(t){return!!t&&!!t.then&&typeof t.then=="function"}a($u,"isPromise");p();p();p();var Lp=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function W7(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a(W7,"parseCommand");var y5o=["first","second","third","fourth","fifth","sixth"];function On(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[W7(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new Lp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=yfn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Efn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=yfn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&Efn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(On,"argsert");function yfn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(yfn,"guessType");function Efn(t,e,r){throw new Lp(`Invalid ${y5o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(Efn,"argumentTypeError");var TVe=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(On(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function _fn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(_fn,"commandMiddlewareFactory");function dY(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if($u(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return $u(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(dY,"applyMiddleware");p();function fY(t,e,r=n=>{throw n}){try{let n=E5o(t)?t():t;return $u(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(fY,"maybeAsyncResult");function E5o(t){return typeof t=="function"}a(E5o,"isFunction");var Ice=/(^\*)|(^\$0)/,r8t=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=_fn(s);if(o=o||(()=>{}),Array.isArray(e))if(_5o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(v5o(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Cfn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=W7(e);l=l.map(m=>W7(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Ice.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(Ice,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return $u(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(IVe(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if($u(h))return h.then(m=>(f=bfn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else C5o(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return $u(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Ice.test(r.original)?r.original.replace(Ice,"").trim():r.original,o=e.filter(s=>!Ice.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=fY(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=dY(n,c,l,!1),n=fY(n,f=>{let h=r.handler(f);return $u(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),$u(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=dY(n,l,d,!0);return $u(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=W7(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Ice.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(IVe(r))return r(e,!0);Cfn(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;C_(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();C_(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function vfn(t,e,r,n){return new r8t(t,e,r,n)}a(vfn,"command");function Cfn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(Cfn,"isCommandBuilderDefinition");function _5o(t){return t.every(e=>typeof e=="string")}a(_5o,"isCommandAndAliases");function IVe(t){return typeof t=="function"}a(IVe,"isCommandBuilderCallback");function C5o(t){return typeof t=="object"}a(C5o,"isCommandBuilderOptionDefinitions");function v5o(t){return typeof t=="object"&&!Array.isArray(t)}a(v5o,"isCommandHandlerDefinition");p();p();function z7(t={},e=()=>!0){let r={};return Tce(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(z7,"objFilter");p();function Y7(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(Y7,"setBlocking");function b5o(t){return typeof t=="boolean"}a(b5o,"isBoolean");function Tfn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(B){o.push(B)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(B=!0,Q){let[M,O]=typeof B=="string"?[!0,B]:[B,Q];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(B,Q){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let q=o[O];if(b5o(q)){if(Q)throw Q;if(B)throw Error(B)}else q(B,Q,n)}else{if(t.getExitProcess()&&Y7(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(B||Q)&&M.error(B||Q);let O=s||c;O&&((B||Q)&&M.error(""),M.error(O))}if(Q=Q||new Lp(B),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,Q);throw Q}},"fail");let d=[],f=!1;n.usage=(L,B)=>L===null?(f=!0,d=[],n):(f=!1,d.push([L,B||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(L,B)=>{h.push([L,B||""])};let m=[];n.command=a(function(B,Q,M,O,q=!1){M&&(m=m.map(F=>(F[2]=!1,F))),m.push([B,Q||"",M,O,q])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(B,Q){Array.isArray(B)?B.forEach(M=>{n.describe(M,Q)}):typeof B=="object"?Object.keys(B).forEach(M=>{n.describe(M,B[M])}):g[B]=Q},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=L=>{A.push(L)};let y=!1,E;n.wrap=L=>{y=!0,E=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=k(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=L=>_+L,n.help=a(function(){if(T)return T;b();let B=t.customScriptName?t.$0:e.path.basename(t.$0),Q=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),q=t.getGroups(),F=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(Q)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(F.default)),U=U.filter(R),U=Object.keys(U.reduce((ie,we)=>(we!=="_"&&(ie[we]=!0),ie),{}));let W=n.getWrap(),V=e.cliui({width:W,wrap:!!W});if(!f){if(d.length)d.forEach(ie=>{V.div({text:`${ie[0].replace(/\$0/g,B)}`}),ie[1]&&V.div({text:`${ie[1]}`,padding:[1,0,0,0]})}),V.div();else if(m.length){let ie=null;M._?ie=`${B} <${r("command")}> -`:ie=`${B} [${r("command")}] -`,V.div(`${ie}`)}}if(m.length>1||m.length===1&&!m[0][2]){V.div(r("Commands:"));let ie=t.getInternalMethods().getContext(),we=ie.commands.length?`${ie.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((De,Te)=>De[0].localeCompare(Te[0])));let Ae=B?`${B} `:"";m.forEach(De=>{let Te=`${Ae}${we}${De[0].replace(/^\$0 ?/,"")}`;V.span({text:Te,padding:[0,2,0,2],width:v(m,W,`${B}${we}`)+4},{text:De[1]});let Z=[];De[2]&&Z.push(`[${r("default")}]`),De[3]&&De[3].length&&Z.push(`[${r("aliases:")} ${De[3].join(", ")}]`),De[4]&&(typeof De[4]=="string"?Z.push(`[${r("deprecated: %s",De[4])}]`):Z.push(`[${r("deprecated")}]`)),Z.length?V.div({text:Z.join(" "),padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}let G=(Object.keys(F.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(ie=>!t.parsed.newAliases[ie]&&G.every(we=>(F.alias[we]||[]).indexOf(ie)===-1));let Y=r("Options:");q[Y]||(q[Y]=[]),w(U,F.alias,q,Y);let re=a(ie=>/^--/.test(xVe(ie)),"isLongSwitch"),j=Object.keys(q).filter(ie=>q[ie].length>0).map(ie=>{let we=q[ie].filter(R).map(Ae=>{if(G.includes(Ae))return Ae;for(let De=0,Te;(Te=G[De])!==void 0;De++)if((F.alias[Te]||[]).includes(Ae))return Te;return Ae});return{groupName:ie,normalizedKeys:we}}).filter(({normalizedKeys:ie})=>ie.length>0).map(({groupName:ie,normalizedKeys:we})=>{let Ae=we.reduce((De,Te)=>(De[Te]=[Te].concat(F.alias[Te]||[]).map(Z=>ie===n.getPositionalGroupName()?Z:(/^[0-9]$/.test(Z)?F.boolean.includes(Te)?"-":"--":Z.length>1?"--":"-")+Z).sort((Z,J)=>re(Z)===re(J)?0:re(Z)?1:-1).join(", "),De),{});return{groupName:ie,normalizedKeys:we,switches:Ae}});if(j.filter(({groupName:ie})=>ie!==n.getPositionalGroupName()).some(({normalizedKeys:ie,switches:we})=>!ie.every(Ae=>re(we[Ae])))&&j.filter(({groupName:ie})=>ie!==n.getPositionalGroupName()).forEach(({normalizedKeys:ie,switches:we})=>{ie.forEach(Ae=>{re(we[Ae])&&(we[Ae]=S5o(we[Ae],4))})}),j.forEach(({groupName:ie,normalizedKeys:we,switches:Ae})=>{V.div(ie),we.forEach(De=>{let Te=Ae[De],Z=g[De]||"",J=null;Z.includes(_)&&(Z=r(Z.substring(_.length))),F.boolean.includes(De)&&(J=`[${r("boolean")}]`),F.count.includes(De)&&(J=`[${r("count")}]`),F.string.includes(De)&&(J=`[${r("string")}]`),F.normalize.includes(De)&&(J=`[${r("string")}]`),F.array.includes(De)&&(J=`[${r("array")}]`),F.number.includes(De)&&(J=`[${r("number")}]`);let z=a(ae=>typeof ae=="string"?`[${r("deprecated: %s",ae)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),le=[De in O?z(O[De]):null,J,De in Q?`[${r("required")}]`:null,F.choices&&F.choices[De]?`[${r("choices:")} ${n.stringifiedValues(F.choices[De])}]`:null,x(F.default[De],F.defaultDescription[De])].filter(Boolean).join(" ");V.span({text:xVe(Te),padding:[0,2,0,2+Sfn(Te)],width:v(Ae,W)+4},Z);let K=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;le&&!K?V.div({text:le,padding:[0,0,0,2],align:"right"}):V.div()}),V.div()}),h.length&&(V.div(r("Examples:")),h.forEach(ie=>{ie[0]=ie[0].replace(/\$0/g,B)}),h.forEach(ie=>{ie[1]===""?V.div({text:ie[0],padding:[0,2,0,2]}):V.div({text:ie[0],padding:[0,2,0,2],width:v(h,W)+4},{text:ie[1]})}),V.div()),A.length>0){let ie=A.map(we=>we.replace(/\$0/g,B)).join(` -`);V.div(`${ie} -`)}return V.toString().replace(/\s*$/,"")},"help");function v(L,B,Q){let M=0;return Array.isArray(L)||(L=Object.values(L).map(O=>[O])),L.forEach(O=>{M=Math.max(e.stringWidth(Q?`${Q} ${xVe(O[0])}`:xVe(O[0]))+Sfn(O[0]),M)}),B&&(M=Math.min(M,parseInt((B*.5).toString(),10))),M}a(v,"maxWidth");function b(){let L=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(Q=>{B.alias[Q].forEach(M=>{g[M]&&n.describe(Q,g[M]),M in L&&t.demandOption(Q,L[M]),B.boolean.includes(M)&&t.boolean(Q),B.count.includes(M)&&t.count(Q),B.string.includes(M)&&t.string(Q),B.normalize.includes(M)&&t.normalize(Q),B.array.includes(M)&&t.array(Q),B.number.includes(M)&&t.number(Q)})})}a(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(L,B,Q,M){let O=[],q=null;return Object.keys(Q).forEach(F=>{O=O.concat(Q[F])}),L.forEach(F=>{q=[F].concat(B[F]),q.some(U=>O.indexOf(U)!==-1)||Q[M].push(F)}),O}a(w,"addUngroupedKeys");function R(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(B,Q){let M="",O=Q||", ",q=[].concat(B);return!B||!q.length||q.forEach(F=>{M.length&&(M+=O),M+=JSON.stringify(F)}),M},"stringifiedValues");function x(L,B){let Q=`[${r("default:")} `;if(L===void 0&&!B)return null;if(B)Q+=B;else switch(typeof L){case"string":Q+=`"${L}"`;break;case"object":Q+=JSON.stringify(L);break;default:Q+=L}return`${Q}]`}a(x,"defaultString");function k(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(k,"windowWidth");let D=null;n.version=L=>{D=L},n.showVersion=L=>{let B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(D)},n.reset=a(function(B){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=z7(g,Q=>!B[Q]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(B=!1){let Q=N.pop();Q&&(B?(g={...Q.descriptions,...g},m=[...Q.commands,...m],d=[...Q.usages,...d],h=[...Q.examples,...h],A=[...Q.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=Q)},"unfreeze"),n}a(Tfn,"usage");function n8t(t){return typeof t=="object"}a(n8t,"isIndentedText");function S5o(t,e){return n8t(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(S5o,"addIndentation");function Sfn(t){return n8t(t)?t.indentation:0}a(Sfn,"getIndentation");function xVe(t){return n8t(t)?t.text:t}a(xVe,"getText");p();p();var Ifn=`###-begin-{{app_name}}-completions-### +`).map(n=>Y6o(n,e,r)).join(` +`)}a(nUt,"wrapAnsi");function iUt(t){return T0n(t,{stringWidth:t3,stripAnsi:bY,wrap:nUt})}a(iUt,"ui");p();var Qce=require("path"),WWe=require("fs");function oUt(t,e){let r=(0,Qce.resolve)(".",t),n;for((0,WWe.statSync)(r).isDirectory()||(r=(0,Qce.dirname)(r));;){if(n=e(r,(0,WWe.readdirSync)(r)),n)return(0,Qce.resolve)(r,n);if(r=(0,Qce.dirname)(n=r),n===r)break}}a(oUt,"default");var rmn=require("util"),gUt=require("url");p();var H0n=require("util"),JWe=require("path");p();function SY(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,o=t.match(/^-+/);for(let s=o?o[0].length:0;s0?n+=`${e}${r.charAt(o)}`:n+=c}return n}a(zWe,"decamelize");function YWe(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}a(YWe,"looksLikeNumber");p();p();function F0n(t){if(Array.isArray(t))return t.map(c=>typeof c!="string"?c+"":c);t=t.trim();let e=0,r=null,n=null,o=null,s=[];for(let c=0;c{typeof ue=="number"&&(E.nargs[X]=ue,E.keys.push(X))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([X,ue])=>{typeof ue=="function"&&(E.coercions[X]=ue,E.keys.push(X))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(X){E.configs[X]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([X,ue])=>{(typeof ue=="boolean"||typeof ue=="function")&&(E.configs[X]=ue)})),ne(n.key,c,n.default,E.arrays),Object.keys(u).forEach(function(X){(E.aliases[X]||[]).forEach(function(ue){u[ue]=u[X]})});let b=null;pe();let T=[],w=Object.assign(Object.create(null),{_:[]}),R={};for(let X=0;X=3&&(H(we[1],E.arrays)?X=D(X,we[1],o,we[2]):H(we[1],E.nargs)!==!1?X=P(X,we[1],o,we[2]):N(we[1],we[2],!0));else if(ue.match(v)&&l["boolean-negation"])we=ue.match(v),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],N(le,H(le,E.arrays)?[!1]:!1));else if(ue.match(/^--.+/)||!l["short-option-groups"]&&ue.match(/^-[^-]+/))we=ue.match(/^--?(.+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],H(le,E.arrays)?X=D(X,le,o):H(le,E.nargs)!==!1?X=P(X,le,o):(Be=o[X+1],Be!==void 0&&(!Be.match(/^-/)||Be.match(_))&&!H(le,E.bools)&&!H(le,E.counts)||/^(true|false)$/.test(Be)?(N(le,Be),X++):N(le,Pe(le))));else if(ue.match(/^-.\..+=/))we=ue.match(/^-([^=]+)=([\s\S]*)$/),we!==null&&Array.isArray(we)&&we.length>=3&&N(we[1],we[2]);else if(ue.match(/^-.\..+/)&&!ue.match(_))Be=o[X+1],we=ue.match(/^-(.\..+)/),we!==null&&Array.isArray(we)&&we.length>=2&&(le=we[1],Be!==void 0&&!Be.match(/^-/)&&!H(le,E.bools)&&!H(le,E.counts)?(N(le,Be),X++):N(le,Pe(le)));else if(ue.match(/^-[^-]+/)&&!ue.match(_)){Ne=ue.slice(1,-1).split(""),ie=!1;for(let st=0;stX!=="--"&&X.includes("-")).forEach(X=>{delete w[X]}),l["strip-aliased"]&&[].concat(...Object.keys(c).map(X=>c[X])).forEach(X=>{l["camel-case-expansion"]&&X.includes("-")&&delete w[X.split(".").map(ue=>SY(ue)).join(".")],delete w[X]});function x(X){let ue=j("_",X);(typeof ue=="string"||typeof ue=="number")&&w._.push(ue)}a(x,"pushPositional");function P(X,ue,qe,ie){let le,Ne=H(ue,E.nargs);if(Ne=typeof Ne!="number"||isNaN(Ne)?1:Ne,Ne===0)return K(ie)||(b=Error(y("Argument unexpected for: %s",ue))),N(ue,Pe(ue)),X;let we=K(ie)?0:1;if(l["nargs-eats-options"])qe.length-(X+1)+we0&&(N(ue,ie),Be--),le=X+1;le0||we&&typeof we=="number"&&le.length>=we||(Ne=qe[Be],/^-/.test(Ne)&&!_.test(Ne)&&!ve(Ne)));Be++)X=Be,le.push(L(ue,Ne,s))}return typeof we=="number"&&(we&&le.length1&&l["dot-notation"]&&(E.aliases[le[0]]||[]).forEach(function(Ne){let we=Ne.split("."),Be=[].concat(le);Be.shift(),we=we.concat(Be),(E.aliases[X]||[]).includes(we.join("."))||J(w,we,ie)}),H(X,E.normalize)&&!H(X,E.arrays)&&[X].concat(E.aliases[X]||[]).forEach(function(we){Object.defineProperty(R,we,{enumerable:!0,get(){return ue},set(Be){ue=typeof Be=="string"?r3.normalize(Be):Be}})})}a(N,"setArg");function B(X,ue){E.aliases[X]&&E.aliases[X].length||(E.aliases[X]=[ue],g[ue]=!0),E.aliases[ue]&&E.aliases[ue].length||B(ue,X)}a(B,"addNewAlias");function L(X,ue,qe){qe&&(ue=J6o(ue)),(H(X,E.bools)||H(X,E.counts))&&typeof ue=="string"&&(ue=ue==="true");let ie=Array.isArray(ue)?ue.map(function(le){return j(X,le)}):j(X,ue);return H(X,E.counts)&&(K(ie)||typeof ie=="boolean")&&(ie=sUt()),H(X,E.normalize)&&H(X,E.arrays)&&(Array.isArray(ue)?ie=ue.map(le=>r3.normalize(le)):ie=r3.normalize(ue)),ie}a(L,"processValue");function j(X,ue){return!l["parse-positional-numbers"]&&X==="_"||!H(X,E.strings)&&!H(X,E.bools)&&!Array.isArray(ue)&&(YWe(ue)&&l["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${ue}`)))||!K(ue)&&H(X,E.numbers))&&(ue=Number(ue)),ue}a(j,"maybeCoerceNumber");function M(X){let ue=Object.create(null);W(ue,E.aliases,u),Object.keys(E.configs).forEach(function(qe){let ie=X[qe]||ue[qe];if(ie)try{let le=null,Ne=r3.resolve(r3.cwd(),ie),we=E.configs[qe];if(typeof we=="function"){try{le=we(Ne)}catch(Be){le=Be}if(le instanceof Error){b=le;return}}else le=r3.require(Ne);O(le)}catch(le){le.name==="PermissionDenied"?b=le:X[qe]&&(b=Error(y("Invalid JSON config file: %s",ie)))}})}a(M,"setConfig");function O(X,ue){Object.keys(X).forEach(function(qe){let ie=X[qe],le=ue?ue+"."+qe:qe;typeof ie=="object"&&ie!==null&&!Array.isArray(ie)&&l["dot-notation"]?O(ie,le):(!$(w,le.split("."))||H(le,E.arrays)&&l["combine-arrays"])&&N(le,ie)})}a(O,"setConfigObject");function q(){typeof d<"u"&&d.forEach(function(X){O(X)})}a(q,"setConfigObjects");function Q(X,ue){if(typeof f>"u")return;let qe=typeof f=="string"?f:"",ie=r3.env();Object.keys(ie).forEach(function(le){if(qe===""||le.lastIndexOf(qe,0)===0){let Ne=le.split("__").map(function(we,Be){return Be===0&&(we=we.substring(qe.length)),SY(we)});(ue&&E.configs[Ne.join(".")]||!ue)&&!$(X,Ne)&&N(Ne.join("."),ie[le])}})}a(Q,"applyEnvVars");function U(X){let ue,qe=new Set;Object.keys(X).forEach(function(ie){if(!qe.has(ie)&&(ue=H(ie,E.coercions),typeof ue=="function"))try{let le=j(ie,ue(X[ie]));[].concat(E.aliases[ie]||[],ie).forEach(Ne=>{qe.add(Ne),X[Ne]=le})}catch(le){b=le}})}a(U,"applyCoercions");function z(X){return E.keys.forEach(ue=>{~ue.indexOf(".")||typeof X[ue]>"u"&&(X[ue]=void 0)}),X}a(z,"setPlaceholderKeys");function W(X,ue,qe,ie=!1){Object.keys(qe).forEach(function(le){$(X,le.split("."))||(J(X,le.split("."),qe[le]),ie&&(A[le]=!0),(ue[le]||[]).forEach(function(Ne){$(X,Ne.split("."))||J(X,Ne.split("."),qe[le])}))})}a(W,"applyDefaultsAndAliases");function $(X,ue){let qe=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(le){qe=qe[le]||{}});let ie=ue[ue.length-1];return typeof qe!="object"?!1:ie in qe}a($,"hasKey");function J(X,ue,qe){let ie=X;l["dot-notation"]||(ue=[ue.join(".")]),ue.slice(0,-1).forEach(function(tt){tt=U0n(tt),typeof ie=="object"&&ie[tt]===void 0&&(ie[tt]={}),typeof ie[tt]!="object"||Array.isArray(ie[tt])?(Array.isArray(ie[tt])?ie[tt].push({}):ie[tt]=[ie[tt],{}],ie=ie[tt][ie[tt].length-1]):ie=ie[tt]});let le=U0n(ue[ue.length-1]),Ne=H(ue.join("."),E.arrays),we=Array.isArray(qe),Be=l["duplicate-arguments-array"];!Be&&H(le,E.nargs)&&(Be=!0,(!K(ie[le])&&E.nargs[le]===1||Array.isArray(ie[le])&&ie[le].length===E.nargs[le])&&(ie[le]=void 0)),qe===sUt()?ie[le]=sUt(ie[le]):Array.isArray(ie[le])?Be&&Ne&&we?ie[le]=l["flatten-duplicate-arrays"]?ie[le].concat(qe):(Array.isArray(ie[le][0])?ie[le]:[ie[le]]).concat([qe]):!Be&&!!Ne==!!we?ie[le]=qe:ie[le]=ie[le].concat([qe]):ie[le]===void 0&&Ne?ie[le]=we?qe:[qe]:Be&&!(ie[le]===void 0||H(le,E.counts)||H(le,E.bools))?ie[le]=[ie[le],qe]:ie[le]=qe}a(J,"setKey");function ne(...X){X.forEach(function(ue){Object.keys(ue||{}).forEach(function(qe){E.aliases[qe]||(E.aliases[qe]=[].concat(c[qe]||[]),E.aliases[qe].concat(qe).forEach(function(ie){if(/-/.test(ie)&&l["camel-case-expansion"]){let le=SY(ie);le!==qe&&E.aliases[qe].indexOf(le)===-1&&(E.aliases[qe].push(le),g[le]=!0)}}),E.aliases[qe].concat(qe).forEach(function(ie){if(ie.length>1&&/[A-Z]/.test(ie)&&l["camel-case-expansion"]){let le=zWe(ie,"-");le!==qe&&E.aliases[qe].indexOf(le)===-1&&(E.aliases[qe].push(le),g[le]=!0)}}),E.aliases[qe].forEach(function(ie){E.aliases[ie]=[qe].concat(E.aliases[qe].filter(function(le){return ie!==le}))}))})})}a(ne,"extendAliases");function H(X,ue){let qe=[].concat(E.aliases[X]||[],X),ie=Object.keys(ue),le=qe.find(Ne=>ie.includes(Ne));return le?ue[le]:!1}a(H,"checkAllAliases");function re(X){let ue=Object.keys(E);return[].concat(ue.map(ie=>E[ie])).some(function(ie){return Array.isArray(ie)?ie.includes(X):ie[X]})}a(re,"hasAnyFlag");function ae(X,...ue){return[].concat(...ue).some(function(ie){let le=X.match(ie);return le&&re(le[1])})}a(ae,"hasFlagsMatching");function Oe(X){if(X.match(_)||!X.match(/^-[^-]+/))return!1;let ue=!0,qe,ie=X.slice(1).split("");for(let le=0;leH(X,E.arrays)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",X)),!0):H(X,E.nargs)?(b=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",X)),!0):!1)}return a(pe,"checkConfiguration"),{aliases:Object.assign({},E.aliases),argv:Object.assign(R,w),configuration:l,defaulted:Object.assign({},A),error:b,newAliases:Object.assign({},g)}}};function K6o(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(o){e.push([].concat(t[o],o))});n;){n=!1;for(let o=0;oZ6o,"env"),format:H0n.format,normalize:JWe.normalize,resolve:JWe.resolve,require:a(t=>{if(typeof j0n<"u")return j0n(t);if(t.match(/\.json$/))return JSON.parse((0,G0n.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")},"require")}),PTe=a(function(e,r){return $0n.parse(e.slice(),r).argv},"Parser");PTe.detailed=function(t,e){return $0n.parse(t.slice(),e)};PTe.camelCase=SY;PTe.decamelize=zWe;PTe.looksLikeNumber=YWe;var V0n=PTe;var yS=require("path");p();function X6o(){return e9o()?0:1}a(X6o,"getProcessArgvBinIndex");function e9o(){return t9o()&&!process.defaultApp}a(e9o,"isBundledElectronApp");function t9o(){return!!process.versions.electron}a(t9o,"isElectronApp");function W0n(){return process.argv[X6o()]}a(W0n,"getProcessArgvBin");p();p();p();function dUt({onlyFirst:t=!1}={}){let o="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(o,t?void 0:"g")}a(dUt,"ansiRegex");var r9o=dUt();function fUt(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(r9o,"")}a(fUt,"stripAnsi");p();var z0n=a(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"default");var n9o=new Intl.Segmenter,i9o=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function pUt(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=fUt(t)),t.length===0)return 0;let o=0,s={ambiguousAsWide:!r};for(let{segment:c}of n9o.segment(t)){let l=c.codePointAt(0);if(!(l<=31||l>=127&&l<=159)&&!(l>=8203&&l<=8207||l===65279)&&!(l>=768&&l<=879||l>=6832&&l<=6911||l>=7616&&l<=7679||l>=8400&&l<=8447||l>=65056&&l<=65071)&&!(l>=55296&&l<=57343)&&!(l>=65024&&l<=65039)&&!i9o.test(c)){if(z0n().test(c)){o+=2;continue}o+=GWe(l,s)}}return o}a(pUt,"stringWidth");p();p();var qce=require("fs"),Y0n=require("util"),K0n=require("path");var J0n={fs:{readFileSync:qce.readFileSync,writeFile:qce.writeFile},format:Y0n.format,resolve:K0n.resolve,exists:a(t=>{try{return(0,qce.statSync)(t).isFile()}catch{return!1}},"exists")};p();var pk,hUt=class{static{a(this,"Y18N")}constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=a(function(){},"cb");return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),pk.format.apply(pk.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),o=e.shift(),s=a(function(){},"cb");typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let c=o===1?r:n;this.cache[this.locale][r]&&(c=this.cache[this.locale][r][o===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let l=[c];return~c.indexOf("%d")&&l.push(o),pk.format.apply(pk.format,l.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(o,s){let c=r[s+1];n+=o,typeof c<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,o=r.locale,s=r.cb,c=this._resolveLocaleFile(n,o),l=JSON.stringify(this.cache[o],null,2);pk.fs.writeFile(c,l,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{pk.fs.readFileSync&&(e=JSON.parse(pk.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=pk.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let o=pk.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return pk.exists(e)}};function Z0n(t,e){pk=e;let r=new hUt(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}a(Z0n,"y18n");var o9o=a(t=>Z0n(t,J0n),"y18n"),X0n=o9o;var nmn=require("node:module"),imn=fe(tmn(),1),XWe=require("node:fs");var mUt=(0,gUt.fileURLToPath)(importMetaUrlShim),s9o=mUt.substring(0,mUt.lastIndexOf("node_modules")),a9o=(0,nmn.createRequire)(importMetaUrlShim),omn={assert:{notStrictEqual:ZWe.notStrictEqual,strictEqual:ZWe.strictEqual},cliui:iUt,findUp:oUt,getEnv:a(t=>process.env[t],"getEnv"),inspect:rmn.inspect,getProcessArgvBin:W0n,mainFilename:s9o||process.cwd(),Parser:V0n,path:{basename:yS.basename,dirname:yS.dirname,extname:yS.extname,relative:yS.relative,resolve:yS.resolve,join:yS.join},process:{argv:a(()=>process.argv,"argv"),cwd:process.cwd,emitWarning:a((t,e)=>process.emitWarning(t,e),"emitWarning"),execPath:a(()=>process.execPath,"execPath"),exit:a(t=>{process.exit(t)},"exit"),nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:XWe.readFileSync,readdirSync:XWe.readdirSync,require:a9o,getCallerFile:a(()=>{let t=(0,imn.default)(3);return t.match(/^file:\/\//)?(0,gUt.fileURLToPath)(t):t},"getCallerFile"),stringWidth:pUt,y18n:X0n({directory:(0,yS.resolve)(mUt,"../../../locales"),updateFiles:!1})};p();p();p();function __(t,e,r,n){r.assert.notStrictEqual(t,e,n)}a(__,"assertNotStrictEqual");function AUt(t,e){e.assert.strictEqual(typeof t,"string")}a(AUt,"assertSingleKey");function jce(t){return Object.keys(t)}a(jce,"objectKeys");p();function Wu(t){return!!t&&!!t.then&&typeof t.then=="function"}a(Wu,"isPromise");p();p();p();var Qp=class t extends Error{static{a(this,"YError")}constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};p();function fQ(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,o=r.shift();if(!o)throw new Error(`No command found in: ${t}`);let s={cmd:o.replace(n,""),demanded:[],optional:[]};return r.forEach((c,l)=>{let u=!1;c=c.replace(/\s/g,""),/\.+[\]>]/.test(c)&&l===r.length-1&&(u=!0),/^\[/.test(c)?s.optional.push({cmd:c.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:c.replace(n,"").split("|"),variadic:u})}),s}a(fQ,"parseCommand");var c9o=["first","second","third","fourth","fifth","sixth"];function Bn(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[fQ(`cmd ${t}`),e,r]}a(n,"parseArgs");try{let o=0,[s,c,l]=n(),u=[].slice.call(c);for(;u.length&&u[u.length-1]===void 0;)u.pop();let d=l||u.length;if(df)throw new Qp(`Too many arguments provided. Expected max ${f} but received ${d}.`);s.demanded.forEach(h=>{let m=u.shift(),g=smn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&amn(g,h.cmd,o),o+=1}),s.optional.forEach(h=>{if(u.length===0)return;let m=u.shift(),g=smn(m);h.cmd.filter(y=>y===g||y==="*").length===0&&amn(g,h.cmd,o),o+=1})}catch(o){console.warn(o.stack)}}a(Bn,"argsert");function smn(t){return Array.isArray(t)?"array":t===null?"null":typeof t}a(smn,"guessType");function amn(t,e,r){throw new Qp(`Invalid ${c9o[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}a(amn,"argumentTypeError");var eze=class{static{a(this,"GlobalMiddleware")}constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,o=!1){if(Bn(" [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let s=0;s{let s=[...n[r]||[],r];return o.option?!s.includes(o.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function cmn(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}a(cmn,"commandMiddlewareFactory");function TY(t,e,r,n){return r.reduce((o,s)=>{if(s.applyBeforeValidation!==n)return o;if(s.mutates){if(s.applied)return o;s.applied=!0}if(Wu(o))return o.then(c=>Promise.all([c,s(c,e)])).then(([c,l])=>Object.assign(c,l));{let c=s(o,e);return Wu(c)?c.then(l=>Object.assign(o,l)):Object.assign(o,c)}},t)}a(TY,"applyMiddleware");p();function IY(t,e,r=n=>{throw n}){try{let n=l9o(t)?t():t;return Wu(n)?n.then(o=>e(o)):e(n)}catch(n){return r(n)}}a(IY,"maybeAsyncResult");function l9o(t){return typeof t=="function"}a(l9o,"isFunction");var Hce=/(^\*)|(^\$0)/,yUt=class{static{a(this,"CommandInstance")}constructor(e,r,n,o){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=o,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,o){o=o||{},this.requireCache.add(n);let s=this.shim.path.resolve(this.shim.path.dirname(n),e),c=this.shim.readdirSync(s,{recursive:!!o.recurse});Array.isArray(o.extensions)||(o.extensions=["js"]);let l=typeof o.visit=="function"?o.visit:u=>u;for(let u of c){let d=u.toString();if(o.exclude){let h=!1;if(typeof o.exclude=="function"?h=o.exclude(d):h=o.exclude.test(d),h)continue}if(o.include){let h=!1;if(typeof o.include=="function"?h=o.include(d):h=o.include.test(d),!h)continue}let f=!1;for(let h of o.extensions)d.endsWith(h)&&(f=!0);if(f){let h=this.shim.path.join(s,d),m=r(h),g=Object.create(null,Object.getOwnPropertyDescriptors({...m}));if(l(g,h,d)){if(this.requireCache.has(h))continue;this.requireCache.add(h),g.command||(g.command=this.shim.path.basename(h,this.shim.path.extname(h))),this.addHandler(g)}}}}addHandler(e,r,n,o,s,c){let l=[],u=cmn(s);if(o=o||(()=>{}),Array.isArray(e))if(u9o(e))[e,...l]=e;else for(let d of e)this.addHandler(d);else if(f9o(e)){let d=Array.isArray(e.command)||typeof e.command=="string"?e.command:null;if(d===null)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);e.aliases&&(d=[].concat(d).concat(e.aliases)),this.addHandler(d,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(lmn(n)){this.addHandler([e].concat(l),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let d=fQ(e);l=l.map(m=>fQ(m).cmd);let f=!1,h=[d.cmd].concat(l).filter(m=>Hce.test(m)?(f=!0,!1):!0);h.length===0&&f&&h.push("$0"),f&&(d.cmd=h[0],l=h.slice(1),e=e.replace(Hce,d.cmd)),l.forEach(m=>{this.aliasMap[m]=d.cmd}),r!==!1&&this.usage.command(e,r,f,l,c),this.handlers[d.cmd]={original:e,description:r,handler:o,builder:n||{},middlewares:u,deprecated:c,demanded:d.demanded,optional:d.optional},f&&(this.defaultCommand=this.handlers[d.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,o,s,c){let l=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),d=u.commands.slice(),f=!e;e&&(u.commands.push(e),u.fullCommands.push(l.original));let h=this.applyBuilderUpdateUsageAndParse(f,l,r,n.aliases,d,o,s,c);return Wu(h)?h.then(m=>this.applyMiddlewareAndGetResult(f,l,m.innerArgv,u,s,m.aliases,r)):this.applyMiddlewareAndGetResult(f,l,h.innerArgv,u,s,h.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,o,s,c,l,u){let d=r.builder,f=n;if(tze(d)){n.getInternalMethods().getUsageInstance().freeze();let h=d(n.getInternalMethods().reset(o),u);if(Wu(h))return h.then(m=>(f=dmn(m)?m:n,this.parseAndUpdateUsage(e,r,f,s,c,l)))}else d9o(d)&&(n.getInternalMethods().getUsageInstance().freeze(),f=n.getInternalMethods().reset(o),Object.keys(r.builder).forEach(h=>{f.option(h,d[h])}));return this.parseAndUpdateUsage(e,r,f,s,c,l)}parseAndUpdateUsage(e,r,n,o,s,c){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(o,r),r.description);let l=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,c);return Wu(l)?l.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:l}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Hce.test(r.original)?r.original.replace(Hce,"").trim():r.original,o=e.filter(s=>!Hce.test(s));return o.push(n),`$0 ${o.join(" ")}`}handleValidationAndGetResult(e,r,n,o,s,c,l,u){if(!c.getInternalMethods().getHasOutput()){let d=c.getInternalMethods().runValidation(s,u,c.parsed.error,e);n=IY(n,f=>(d(f),f))}if(r.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let d=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,d,!1,!1),n=TY(n,c,l,!1),n=IY(n,f=>{let h=r.handler(f);return Wu(h)?h.then(()=>f):f}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),Wu(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(f=>{try{c.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(o.commands.pop(),o.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,o,s,c,l){let u={};if(s)return n;l.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,o,l));let d=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),f=TY(n,l,d,!0);return Wu(f)?f.then(h=>this.handleValidationAndGetResult(e,r,h,o,c,l,d,u)):this.handleValidationAndGetResult(e,r,f,o,c,l,d,u)}populatePositionals(e,r,n,o){r._=r._.slice(n.commands.length);let s=e.demanded.slice(0),c=e.optional.slice(0),l={};for(this.validation.positionalCount(s.length,r._.length);s.length;){let u=s.shift();this.populatePositional(u,r,l)}for(;c.length;){let u=c.shift();this.populatePositional(u,r,l)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,l,this.cmdToParseOptions(e.original),o),l}populatePositional(e,r,n){let o=e.cmd[0];e.variadic?n[o]=r._.splice(0).map(String):r._.length&&(n[o]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=fQ(e);return n.demanded.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c,r.demand[s]=!0}),n.optional.forEach(o=>{let[s,...c]=o.cmd;o.variadic&&(r.array.push(s),r.default[s]=[]),r.alias[s]=c}),r}postProcessPositionals(e,r,n,o){let s=Object.assign({},o.getOptions());s.default=Object.assign(n.default,s.default);for(let d of Object.keys(n.alias))s.alias[d]=(s.alias[d]||[]).concat(n.alias[d]);s.array=s.array.concat(n.array),s.config={};let c=[];if(Object.keys(r).forEach(d=>{r[d].map(f=>{s.configuration["unknown-options-as-args"]&&(s.key[d]=!0),c.push(`--${d}`),c.push(f)})}),!c.length)return;let l=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(c,Object.assign({},s,{configuration:l}));if(u.error)o.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let d=Object.keys(r);Object.keys(r).forEach(f=>{d.push(...u.aliases[f])}),Object.keys(u.argv).forEach(f=>{d.includes(f)&&(r[f]||(r[f]=u.argv[f]),!this.isInConfigs(o,f)&&!this.isDefaulted(o,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(u.argv,f)&&(Array.isArray(e[f])||Array.isArray(u.argv[f]))?e[f]=[].concat(e[f],u.argv[f]):e[f]=u.argv[f])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(o=>Object.prototype.hasOwnProperty.call(o,r))||n.some(o=>Object.prototype.hasOwnProperty.call(o,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Hce.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(tze(r))return r(e,!0);lmn(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}extractDesc({describe:e,description:r,desc:n}){for(let o of[e,r,n]){if(typeof o=="string"||o===!1)return o;__(o,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();__(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function umn(t,e,r,n){return new yUt(t,e,r,n)}a(umn,"command");function lmn(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}a(lmn,"isCommandBuilderDefinition");function u9o(t){return t.every(e=>typeof e=="string")}a(u9o,"isCommandAndAliases");function tze(t){return typeof t=="function"}a(tze,"isCommandBuilderCallback");function d9o(t){return typeof t=="object"}a(d9o,"isCommandBuilderOptionDefinitions");function f9o(t){return typeof t=="object"&&!Array.isArray(t)}a(f9o,"isCommandHandlerDefinition");p();p();function pQ(t={},e=()=>!0){let r={};return jce(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}a(pQ,"objFilter");p();function hQ(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}a(hQ,"setBlocking");function p9o(t){return typeof t=="boolean"}a(p9o,"isBoolean");function pmn(t,e){let r=e.y18n.__,n={},o=[];n.failFn=a(function(L){o.push(L)},"failFn");let s=null,c=null,l=!0;n.showHelpOnFail=a(function(L=!0,j){let[M,O]=typeof L=="string"?[!0,L]:[L,j];return t.getInternalMethods().isGlobalContext()&&(c=O),s=O,l=M,n},"showHelpOnFailFn");let u=!1;n.fail=a(function(L,j){let M=t.getInternalMethods().getLoggerInstance();if(o.length)for(let O=o.length-1;O>=0;--O){let q=o[O];if(p9o(q)){if(j)throw j;if(L)throw Error(L)}else q(L,j,n)}else{if(t.getExitProcess()&&hQ(!0),!u){u=!0,l&&(t.showHelp("error"),M.error()),(L||j)&&M.error(L||j);let O=s||c;O&&((L||j)&&M.error(""),M.error(O))}if(j=j||new Qp(L),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,j);throw j}},"fail");let d=[],f=!1;n.usage=(B,L)=>B===null?(f=!0,d=[],n):(f=!1,d.push([B,L||""]),n),n.getUsage=()=>d,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>r("Positionals:");let h=[];n.example=(B,L)=>{h.push([B,L||""])};let m=[];n.command=a(function(L,j,M,O,q=!1){M&&(m=m.map(Q=>(Q[2]=!1,Q))),m.push([L,j||"",M,O,q])},"command"),n.getCommands=()=>m;let g={};n.describe=a(function(L,j){Array.isArray(L)?L.forEach(M=>{n.describe(M,j)}):typeof L=="object"?Object.keys(L).forEach(M=>{n.describe(M,L[M])}):g[L]=j},"describe"),n.getDescriptions=()=>g;let A=[];n.epilog=B=>{A.push(B)};let y=!1,E;n.wrap=B=>{y=!0,E=B},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(E=P(),y=!0),E);let _="__yargsString__:";n.deferY18nLookup=B=>_+B,n.help=a(function(){if(T)return T;b();let L=t.customScriptName?t.$0:e.path.basename(t.$0),j=t.getDemandedOptions(),M=t.getDemandedCommands(),O=t.getDeprecatedOptions(),q=t.getGroups(),Q=t.getOptions(),U=[];U=U.concat(Object.keys(g)),U=U.concat(Object.keys(j)),U=U.concat(Object.keys(M)),U=U.concat(Object.keys(Q.default)),U=U.filter(R),U=Object.keys(U.reduce((ae,Oe)=>(Oe!=="_"&&(ae[Oe]=!0),ae),{}));let z=n.getWrap(),W=e.cliui({width:z,wrap:!!z});if(!f){if(d.length)d.forEach(ae=>{W.div({text:`${ae[0].replace(/\$0/g,L)}`}),ae[1]&&W.div({text:`${ae[1]}`,padding:[1,0,0,0]})}),W.div();else if(m.length){let ae=null;M._?ae=`${L} <${r("command")}> +`:ae=`${L} [${r("command")}] +`,W.div(`${ae}`)}}if(m.length>1||m.length===1&&!m[0][2]){W.div(r("Commands:"));let ae=t.getInternalMethods().getContext(),Oe=ae.commands.length?`${ae.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(m=m.sort((Fe,Pe)=>Fe[0].localeCompare(Pe[0])));let ve=L?`${L} `:"";m.forEach(Fe=>{let Pe=`${ve}${Oe}${Fe[0].replace(/^\$0 ?/,"")}`;W.span({text:Pe,padding:[0,2,0,2],width:v(m,z,`${L}${Oe}`)+4},{text:Fe[1]});let Z=[];Fe[2]&&Z.push(`[${r("default")}]`),Fe[3]&&Fe[3].length&&Z.push(`[${r("aliases:")} ${Fe[3].join(", ")}]`),Fe[4]&&(typeof Fe[4]=="string"?Z.push(`[${r("deprecated: %s",Fe[4])}]`):Z.push(`[${r("deprecated")}]`)),Z.length?W.div({text:Z.join(" "),padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}let $=(Object.keys(Q.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);U=U.filter(ae=>!t.parsed.newAliases[ae]&&$.every(Oe=>(Q.alias[Oe]||[]).indexOf(ae)===-1));let J=r("Options:");q[J]||(q[J]=[]),w(U,Q.alias,q,J);let ne=a(ae=>/^--/.test(rze(ae)),"isLongSwitch"),H=Object.keys(q).filter(ae=>q[ae].length>0).map(ae=>{let Oe=q[ae].filter(R).map(ve=>{if($.includes(ve))return ve;for(let Fe=0,Pe;(Pe=$[Fe])!==void 0;Fe++)if((Q.alias[Pe]||[]).includes(ve))return Pe;return ve});return{groupName:ae,normalizedKeys:Oe}}).filter(({normalizedKeys:ae})=>ae.length>0).map(({groupName:ae,normalizedKeys:Oe})=>{let ve=Oe.reduce((Fe,Pe)=>(Fe[Pe]=[Pe].concat(Q.alias[Pe]||[]).map(Z=>ae===n.getPositionalGroupName()?Z:(/^[0-9]$/.test(Z)?Q.boolean.includes(Pe)?"-":"--":Z.length>1?"--":"-")+Z).sort((Z,ee)=>ne(Z)===ne(ee)?0:ne(Z)?1:-1).join(", "),Fe),{});return{groupName:ae,normalizedKeys:Oe,switches:ve}});if(H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).some(({normalizedKeys:ae,switches:Oe})=>!ae.every(ve=>ne(Oe[ve])))&&H.filter(({groupName:ae})=>ae!==n.getPositionalGroupName()).forEach(({normalizedKeys:ae,switches:Oe})=>{ae.forEach(ve=>{ne(Oe[ve])&&(Oe[ve]=h9o(Oe[ve],4))})}),H.forEach(({groupName:ae,normalizedKeys:Oe,switches:ve})=>{W.div(ae),Oe.forEach(Fe=>{let Pe=ve[Fe],Z=g[Fe]||"",ee=null;Z.includes(_)&&(Z=r(Z.substring(_.length))),Q.boolean.includes(Fe)&&(ee=`[${r("boolean")}]`),Q.count.includes(Fe)&&(ee=`[${r("count")}]`),Q.string.includes(Fe)&&(ee=`[${r("string")}]`),Q.normalize.includes(Fe)&&(ee=`[${r("string")}]`),Q.array.includes(Fe)&&(ee=`[${r("array")}]`),Q.number.includes(Fe)&&(ee=`[${r("number")}]`);let K=a(ue=>typeof ue=="string"?`[${r("deprecated: %s",ue)}]`:`[${r("deprecated")}]`,"deprecatedExtra"),pe=[Fe in O?K(O[Fe]):null,ee,Fe in j?`[${r("required")}]`:null,Q.choices&&Q.choices[Fe]?`[${r("choices:")} ${n.stringifiedValues(Q.choices[Fe])}]`:null,x(Q.default[Fe],Q.defaultDescription[Fe])].filter(Boolean).join(" ");W.span({text:rze(Pe),padding:[0,2,0,2+fmn(Pe)],width:v(ve,z)+4},Z);let X=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;pe&&!X?W.div({text:pe,padding:[0,0,0,2],align:"right"}):W.div()}),W.div()}),h.length&&(W.div(r("Examples:")),h.forEach(ae=>{ae[0]=ae[0].replace(/\$0/g,L)}),h.forEach(ae=>{ae[1]===""?W.div({text:ae[0],padding:[0,2,0,2]}):W.div({text:ae[0],padding:[0,2,0,2],width:v(h,z)+4},{text:ae[1]})}),W.div()),A.length>0){let ae=A.map(Oe=>Oe.replace(/\$0/g,L)).join(` +`);W.div(`${ae} +`)}return W.toString().replace(/\s*$/,"")},"help");function v(B,L,j){let M=0;return Array.isArray(B)||(B=Object.values(B).map(O=>[O])),B.forEach(O=>{M=Math.max(e.stringWidth(j?`${j} ${rze(O[0])}`:rze(O[0]))+fmn(O[0]),M)}),L&&(M=Math.min(M,parseInt((L*.5).toString(),10))),M}a(v,"maxWidth");function b(){let B=t.getDemandedOptions(),L=t.getOptions();(Object.keys(L.alias)||[]).forEach(j=>{L.alias[j].forEach(M=>{g[M]&&n.describe(j,g[M]),M in B&&t.demandOption(j,B[M]),L.boolean.includes(M)&&t.boolean(j),L.count.includes(M)&&t.count(j),L.string.includes(M)&&t.string(j),L.normalize.includes(M)&&t.normalize(j),L.array.includes(M)&&t.array(j),L.number.includes(M)&&t.number(j)})})}a(b,"normalizeAliases");let T;n.cacheHelpMessage=function(){T=this.help()},n.clearCachedHelpMessage=function(){T=void 0},n.hasCachedHelpMessage=function(){return!!T};function w(B,L,j,M){let O=[],q=null;return Object.keys(j).forEach(Q=>{O=O.concat(j[Q])}),B.forEach(Q=>{q=[Q].concat(L[Q]),q.some(U=>O.indexOf(U)!==-1)||j[M].push(Q)}),O}a(w,"addUngroupedKeys");function R(B){return t.getOptions().hiddenOptions.indexOf(B)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}a(R,"filterHiddenOptions"),n.showHelp=B=>{let L=t.getInternalMethods().getLoggerInstance();B||(B="error"),(typeof B=="function"?B:L[B])(n.help())},n.functionDescription=B=>["(",B.name?e.Parser.decamelize(B.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=a(function(L,j){let M="",O=j||", ",q=[].concat(L);return!L||!q.length||q.forEach(Q=>{M.length&&(M+=O),M+=JSON.stringify(Q)}),M},"stringifiedValues");function x(B,L){let j=`[${r("default:")} `;if(B===void 0&&!L)return null;if(L)j+=L;else switch(typeof B){case"string":j+=`"${B}"`;break;case"object":j+=JSON.stringify(B);break;default:j+=B}return`${j}]`}a(x,"defaultString");function P(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}a(P,"windowWidth");let D=null;n.version=B=>{D=B},n.showVersion=B=>{let L=t.getInternalMethods().getLoggerInstance();B||(B="error"),(typeof B=="function"?B:L[B])(D)},n.reset=a(function(L){return s=null,u=!1,d=[],f=!1,A=[],h=[],m=[],g=pQ(g,j=>!L[j]),n},"reset");let N=[];return n.freeze=a(function(){N.push({failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g})},"freeze"),n.unfreeze=a(function(L=!1){let j=N.pop();j&&(L?(g={...j.descriptions,...g},m=[...j.commands,...m],d=[...j.usages,...d],h=[...j.examples,...h],A=[...j.epilogs,...A]):{failMessage:s,failureOutput:u,usages:d,usageDisabled:f,epilogs:A,examples:h,commands:m,descriptions:g}=j)},"unfreeze"),n}a(pmn,"usage");function EUt(t){return typeof t=="object"}a(EUt,"isIndentedText");function h9o(t,e){return EUt(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}a(h9o,"addIndentation");function fmn(t){return EUt(t)?t.indentation:0}a(fmn,"getIndentation");function rze(t){return EUt(t)?t.text:t}a(rze,"getText");p();p();var hmn=`###-begin-{{app_name}}-completions-### # # yargs command completion script # @@ -2260,7 +2291,7 @@ _{{app_name}}_yargs_completions() } complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} ###-end-{{app_name}}-completions-### -`,xfn=`#compdef {{app_name}} +`,mmn=`#compdef {{app_name}} ###-begin-{{app_name}}-completions-### # # yargs command completion script @@ -2287,64 +2318,64 @@ else compdef _{{app_name}}_yargs_completions {{app_name}} fi ###-end-{{app_name}}-completions-### -`;var i8t=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=W7(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(C_(this.customCompletionFunction,null,this.shim),I5o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return $u(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return x5o(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return $u(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?xfn:Ifn,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function wfn(t,e,r,n){return new i8t(t,e,r,n)}a(wfn,"completion");function I5o(t){return t.length<3}a(I5o,"isSyncCompletionFunction");function x5o(t){return t.length>3}a(x5o,"isFallbackCompletionFunction");p();p();function Rfn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(Rfn,"levenshtein");var kfn=["$0","--","_"];function Pfn(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}let y=A.length?` +`;var _Ut=class{static{a(this,"Completion")}constructor(e,r,n,o){var s,c,l;this.yargs=e,this.usage=r,this.command=n,this.shim=o,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(l=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((c=this.shim.getEnv("ZSH_NAME"))===null||c===void 0?void 0:c.includes("zsh")))!==null&&l!==void 0?l:!1}defaultCompletion(e,r,n,o){let s=this.command.getCommandHandlers();for(let l=0,u=e.length;l{let c=fQ(s[0]).cmd;if(r.indexOf(c)===-1)if(!this.zshShell)e.push(c);else{let l=s[1]||"";e.push(c.replace(/:/g,"\\:")+":"+l)}})}optionCompletions(e,r,n,o){if((o.match(/^-/)||o===""&&e.length===0)&&!this.previousArgHasChoices(r)){let s=this.yargs.getOptions(),c=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(l=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(l);!c.includes(l)&&!s.hiddenOptions.includes(l)&&!this.argsContainKey(r,l,u)&&this.completeOptionKey(l,e,o,u&&!!s.default[l])})}}choicesFromOptionsCompletions(e,r,n,o){if(this.previousArgHasChoices(r)){let s=this.getPreviousArgChoices(r);s&&s.length>0&&e.push(...s.map(c=>c.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,o){if(o===""&&e.length>0&&this.previousArgHasChoices(r))return;let s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],c=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),l=s[n._.length-c-1];if(!l)return;let u=this.yargs.getOptions().choices[l]||[];for(let d of u)d.startsWith(o)&&e.push(d.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let o=r.replace(/^-+/,""),s=this.yargs.getOptions(),c=[o,...this.yargs.getAliases()[o]||[]],l;for(let u of c)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.isArray(s.choices[u])){l=s.choices[u];break}if(l)return l.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let o=a(s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1,"argsContains");if(o(r)||n&&o(`no-${r}`))return!0;if(this.aliases){for(let s of this.aliases[r])if(o(s))return!0}return!1}completeOptionKey(e,r,n,o){var s,c,l,u;let d=e;if(this.zshShell){let g=this.usage.getDescriptions(),A=(c=(s=this===null||this===void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||c===void 0?void 0:c.find(_=>{let v=g[_];return typeof v=="string"&&v.length>0}),y=A?g[A]:void 0,E=(u=(l=g[e])!==null&&l!==void 0?l:y)!==null&&u!==void 0?u:"";d=`${e.replace(/:/g,"\\:")}:${E.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=a(g=>/^--/.test(g),"startsByTwoDashes"),h=a(g=>/^[^0-9]$/.test(g),"isShortOption"),m=!f(n)&&h(e)?"-":"--";r.push(m+d),o&&r.push(m+"no-"+d)}customCompletion(e,r,n,o){if(__(this.customCompletionFunction,null,this.shim),g9o(this.customCompletionFunction)){let s=this.customCompletionFunction(n,r);return Wu(s)?s.then(c=>{this.shim.process.nextTick(()=>{o(null,c)})}).catch(c=>{this.shim.process.nextTick(()=>{o(c,void 0)})}):o(null,s)}else return A9o(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=o)=>this.defaultCompletion(e,r,n,s),s=>{o(null,s)}):this.customCompletionFunction(n,r,s=>{o(null,s)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",o=this.yargs.parse(e,!0),s=this.customCompletionFunction?c=>this.customCompletion(e,c,n,r):c=>this.defaultCompletion(e,c,n,r);return Wu(o)?o.then(s):s(o)}generateCompletionScript(e,r){let n=this.zshShell?mmn:hmn,o=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,o),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function gmn(t,e,r,n){return new _Ut(t,e,r,n)}a(gmn,"completion");function g9o(t){return t.length<3}a(g9o,"isSyncCompletionFunction");function A9o(t){return t.length>3}a(A9o,"isFallbackCompletionFunction");p();p();function Amn(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let o;for(o=0;o<=t.length;o++)r[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)===t.charAt(o-1)?r[n][o]=r[n-1][o-1]:n>1&&o>1&&e.charAt(n-2)===t.charAt(o-1)&&e.charAt(n-1)===t.charAt(o-2)?r[n][o]=r[n-2][o-2]+1:r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1));return r[e.length][t.length]}a(Amn,"levenshtein");var ymn=["$0","--","_"];function Emn(t,e,r){let n=r.y18n.__,o=r.y18n.__n,s={};s.nonOptionCount=a(function(h){let m=t.getDemandedCommands(),A=h._.length+(h["--"]?h["--"].length:0)-t.getInternalMethods().getContext().commands.length;m._&&(Am._.max)&&(Am._.max&&(m._.maxMsg!==void 0?e.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,A.toString()).replace(/\$1/,m._.max.toString()):null):e.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",A,A.toString(),m._.max.toString()))))},"nonOptionCount"),s.positionalCount=a(function(h,m){m"u")&&(g=g||{},g[A]=m[A]);if(g){let A=[];for(let E of Object.keys(g)){let _=g[E];_&&A.indexOf(_)<0&&A.push(_)}let y=A.length?` ${A.join(` -`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!kfn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(E=>{kfn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` - ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){On(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(C_(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} -`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){On(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((E,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=Rfn(h,_);v<=3&&v!h[m]),u=z7(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();C_(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Pfn,"validation");p();var k5o={};var o8t=[],cTe;function wVe(t,e,r,n){cTe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=R5o(e,t.extends);else try{c=k5o.resolve(t.extends)}catch{return t}w5o(c),o8t.push(c),o=s?JSON.parse(cTe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=wVe(o,cTe.path.dirname(c),r,cTe)}return o8t=[],r?Dfn(o,t):Object.assign({},o,t)}a(wVe,"applyExtends");function w5o(t){if(o8t.indexOf(t)>-1)throw new Lp(`Circular extended configurations: '${t}'.`)}a(w5o,"checkForCircularExtends");function R5o(t,e){return cTe.path.resolve(t,e)}a(R5o,"getPathToDefaultConfig");function Dfn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))n(e[o])&&n(r[o])?r[o]=Dfn(t[o],e[o]):r[o]=e[o];return r}a(Dfn,"mergeDeep");var Bn=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},Ce=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fp,pY,lTe,Ev,vS,RVe,K7,hY,kVe,vx,PVe,bx,OM,bS,Sx,DVe,mY,Vm,ri,NVe,MVe,SS,gY,xce,AY,J7,OVe,Yi,yY,EY,_Y,go,BVe,BM,Hf;function Zfn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new g8t(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Zfn,"YargsFactory");var Nfn=Symbol("copyDoubleDash"),Mfn=Symbol("copyDoubleDash"),s8t=Symbol("deleteFromParserHintObject"),Ofn=Symbol("emitWarning"),Bfn=Symbol("freeze"),Lfn=Symbol("getDollarZero"),CY=Symbol("getParserConfiguration"),Ffn=Symbol("getUsageConfiguration"),a8t=Symbol("guessLocale"),Ufn=Symbol("guessVersion"),Qfn=Symbol("parsePositionalNumbers"),c8t=Symbol("pkgUp"),Z7=Symbol("populateParserHintArray"),wce=Symbol("populateParserHintSingleValueDictionary"),l8t=Symbol("populateParserHintArrayDictionary"),u8t=Symbol("populateParserHintDictionary"),d8t=Symbol("sanitizeKey"),f8t=Symbol("setKey"),p8t=Symbol("unfreeze"),qfn=Symbol("validateAsync"),jfn=Symbol("getCommandInstance"),Hfn=Symbol("getContext"),Gfn=Symbol("getHasOutput"),$fn=Symbol("getLoggerInstance"),Vfn=Symbol("getParseContext"),Wfn=Symbol("getUsageInstance"),zfn=Symbol("getValidationInstance"),LVe=Symbol("hasParseCallback"),Yfn=Symbol("isGlobalContext"),vY=Symbol("postProcess"),Kfn=Symbol("rebase"),h8t=Symbol("reset"),uTe=Symbol("runYargsParserAndExecuteCommands"),m8t=Symbol("runValidation"),Jfn=Symbol("setHasOutput"),bY=Symbol("kTrackManuallySetKeys"),P5o="en_US",g8t=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,Fp.set(this,void 0),pY.set(this,void 0),lTe.set(this,{commands:[],fullCommands:[]}),Ev.set(this,null),vS.set(this,null),RVe.set(this,"show-hidden"),K7.set(this,null),hY.set(this,!0),kVe.set(this,{}),vx.set(this,!0),PVe.set(this,[]),bx.set(this,void 0),OM.set(this,{}),bS.set(this,!1),Sx.set(this,null),DVe.set(this,!0),mY.set(this,void 0),Vm.set(this,""),ri.set(this,void 0),NVe.set(this,void 0),MVe.set(this,{}),SS.set(this,null),gY.set(this,null),xce.set(this,{}),AY.set(this,{}),J7.set(this,void 0),OVe.set(this,!1),Yi.set(this,void 0),yY.set(this,!1),EY.set(this,!1),_Y.set(this,!1),go.set(this,void 0),BVe.set(this,{}),BM.set(this,null),Hf.set(this,void 0),Bn(this,Yi,o,"f"),Bn(this,J7,e,"f"),Bn(this,pY,r,"f"),Bn(this,NVe,n,"f"),Bn(this,bx,new TVe(this),"f"),this.$0=this[Lfn](),this[h8t](),Bn(this,Fp,Ce(this,Fp,"f"),"f"),Bn(this,go,Ce(this,go,"f"),"f"),Bn(this,Hf,Ce(this,Hf,"f"),"f"),Bn(this,ri,Ce(this,ri,"f"),"f"),Ce(this,ri,"f").showHiddenOpt=Ce(this,RVe,"f"),Bn(this,mY,this[Mfn](),"f"),Ce(this,Yi,"f").y18n.setLocale(P5o)}addHelpOpt(e,r){let n="help";return On("[string|boolean] [string]",[e,r],arguments.length),Ce(this,Sx,"f")&&(this[s8t](Ce(this,Sx,"f")),Bn(this,Sx,null,"f")),e===!1&&r===void 0?this:(Bn(this,Sx,typeof e=="string"?e:n,"f"),this.boolean(Ce(this,Sx,"f")),this.describe(Ce(this,Sx,"f"),r||Ce(this,go,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(On("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:Ce(this,RVe,"f");return this.boolean(n),this.describe(n,r||Ce(this,go,"f").deferY18nLookup("Show hidden options")),Ce(this,ri,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return On(" [string|array]",[e,r],arguments.length),this[l8t](this.alias.bind(this),"alias",e,r),this}array(e){return On("",[e],arguments.length),this[Z7]("array",e),this[bY](e),this}boolean(e){return On("",[e],arguments.length),this[Z7]("boolean",e),this[bY](e),this}check(e,r){return On(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>fY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&Ce(this,go,"f").fail(s.toString(),s):Ce(this,go,"f").fail(Ce(this,Yi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(Ce(this,go,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return On(" [string|array]",[e,r],arguments.length),this[l8t](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(On(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Lp("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new Lp("coerce callback must be provided");let n=e;return Ce(this,ri,"f").key[n]=!0,Ce(this,bx,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:fY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Lp(d.message)})},n),this}conflicts(e,r){return On(" [string|array]",[e,r],arguments.length),Ce(this,Hf,"f").conflicts(e,r),this}config(e="config",r,n){return On("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=wVe(e,Ce(this,pY,"f"),this[CY]()["deep-merge-config"]||!1,Ce(this,Yi,"f")),Ce(this,ri,"f").configObjects=(Ce(this,ri,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||Ce(this,go,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{Ce(this,ri,"f").config[o]=n||!0}),this)}completion(e,r,n){return On("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Bn(this,vS,e||Ce(this,vS,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(Ce(this,vS,"f"),r),n&&Ce(this,Ev,"f").registerFunction(n),this}command(e,r,n,o,s,c){return On(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),Ce(this,Fp,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){On(" [object]",[e,r],arguments.length);let n=Ce(this,NVe,"f")||Ce(this,Yi,"f").require;return Ce(this,Fp,"f").addDirectory(e,n,Ce(this,Yi,"f").getCallerFile(),r),this}count(e){return On("",[e],arguments.length),this[Z7]("count",e),this[bY](e),this}default(e,r,n){return On(" [*] [string]",[e,r,n],arguments.length),n&&(t8t(e,Ce(this,Yi,"f")),Ce(this,ri,"f").defaultDescription[e]=n),typeof r=="function"&&(t8t(e,Ce(this,Yi,"f")),Ce(this,ri,"f").defaultDescription[e]||(Ce(this,ri,"f").defaultDescription[e]=Ce(this,go,"f").functionDescription(r)),r=r.call()),this[wce](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return On("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),Ce(this,ri,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{C_(n,!0,Ce(this,Yi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(C_(n,!0,Ce(this,Yi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{C_(n,!0,Ce(this,Yi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return On(" [string]",[e,r],arguments.length),this[wce](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return On(" [string|boolean]",[e,r],arguments.length),Ce(this,ri,"f").deprecatedOptions[e]=r,this}describe(e,r){return On(" [string]",[e,r],arguments.length),this[f8t](e,!0),Ce(this,go,"f").describe(e,r),this}detectLocale(e){return On("",[e],arguments.length),Bn(this,hY,e,"f"),this}env(e){return On("[string|boolean]",[e],arguments.length),e===!1?delete Ce(this,ri,"f").envPrefix:Ce(this,ri,"f").envPrefix=e||"",this}epilogue(e){return On("",[e],arguments.length),Ce(this,go,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return On(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):Ce(this,go,"f").example(e,r),this}exit(e,r){Bn(this,bS,!0,"f"),Bn(this,K7,r,"f"),Ce(this,vx,"f")&&Ce(this,Yi,"f").process.exit(e)}exitProcess(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,vx,e,"f"),this}fail(e){if(On("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Lp("Invalid first argument. Expected function or boolean 'false'");return Ce(this,go,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return On(" [function]",[e,r],arguments.length),r?Ce(this,Ev,"f").getCompletion(e,r):new Promise((n,o)=>{Ce(this,Ev,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return On([],0),Ce(this,ri,"f").demandedOptions}getDemandedCommands(){return On([],0),Ce(this,ri,"f").demandedCommands}getDeprecatedOptions(){return On([],0),Ce(this,ri,"f").deprecatedOptions}getDetectLocale(){return Ce(this,hY,"f")}getExitProcess(){return Ce(this,vx,"f")}getGroups(){return Object.assign({},Ce(this,OM,"f"),Ce(this,AY,"f"))}getHelp(){if(Bn(this,bS,!0,"f"),!Ce(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[uTe](Ce(this,J7,"f"),void 0,void 0,0,!0);if($u(r))return r.then(()=>Ce(this,go,"f").help())}let e=Ce(this,Fp,"f").runDefaultBuilderOn(this);if($u(e))return e.then(()=>Ce(this,go,"f").help())}return Promise.resolve(Ce(this,go,"f").help())}getOptions(){return Ce(this,ri,"f")}getStrict(){return Ce(this,yY,"f")}getStrictCommands(){return Ce(this,EY,"f")}getStrictOptions(){return Ce(this,_Y,"f")}global(e,r){return On(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?Ce(this,ri,"f").local=Ce(this,ri,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{Ce(this,ri,"f").local.includes(n)||Ce(this,ri,"f").local.push(n)}),this}group(e,r){On(" ",[e,r],arguments.length);let n=Ce(this,AY,"f")[r]||Ce(this,OM,"f")[r];Ce(this,AY,"f")[r]&&delete Ce(this,AY,"f")[r];let o={};return Ce(this,OM,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return On("",[e],arguments.length),Ce(this,ri,"f").hiddenOptions.push(e),this}implies(e,r){return On(" [number|string|array]",[e,r],arguments.length),Ce(this,Hf,"f").implies(e,r),this}locale(e){return On("[string]",[e],arguments.length),e===void 0?(this[a8t](),Ce(this,Yi,"f").y18n.getLocale()):(Bn(this,hY,!1,"f"),Ce(this,Yi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return Ce(this,bx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return On(" [number]",[e,r],arguments.length),this[wce](this.nargs.bind(this),"narg",e,r),this}normalize(e){return On("",[e],arguments.length),this[Z7]("normalize",e),this}number(e){return On("",[e],arguments.length),this[Z7]("number",e),this[bY](e),this}option(e,r){if(On(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[bY](e),Ce(this,BM,"f")&&(e==="version"||r?.alias==="version")&&this[Ofn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` -`),void 0,"versionWarning"),Ce(this,ri,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(Ce(this,ri,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=Ce(this,go,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){On("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Bfn](),typeof e>"u"&&(e=Ce(this,J7,"f")),typeof r=="object"&&(Bn(this,gY,r,"f"),r=n),typeof r=="function"&&(Bn(this,SS,r,"f"),r=!1),r||Bn(this,J7,e,"f"),Ce(this,SS,"f")&&Bn(this,vx,!1,"f");let o=this[uTe](e,!!r),s=this.parsed;return Ce(this,Ev,"f").setParsed(this.parsed),$u(o)?o.then(c=>(Ce(this,SS,"f")&&Ce(this,SS,"f").call(this,Ce(this,K7,"f"),c,Ce(this,Vm,"f")),c)).catch(c=>{throw Ce(this,SS,"f")&&Ce(this,SS,"f")(c,this.parsed.argv,Ce(this,Vm,"f")),c}).finally(()=>{this[p8t](),this.parsed=s}):(Ce(this,SS,"f")&&Ce(this,SS,"f").call(this,Ce(this,K7,"f"),o,Ce(this,Vm,"f")),this[p8t](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return $u(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if($u(o))throw new Lp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return On("",[e],arguments.length),Bn(this,MVe,e,"f"),this}pkgConf(e,r){On(" [string]",[e,r],arguments.length);let n=null,o=this[c8t](r||Ce(this,pY,"f"));return o[e]&&typeof o[e]=="object"&&(n=wVe(o[e],r||Ce(this,pY,"f"),this[CY]()["deep-merge-config"]||!1,Ce(this,Yi,"f")),Ce(this,ri,"f").configObjects=(Ce(this,ri,"f").configObjects||[]).concat(n)),this}positional(e,r){On(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=z7(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=Ce(this,lTe,"f").fullCommands[Ce(this,lTe,"f").fullCommands.length-1],s=o?Ce(this,Fp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return Tce(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,Ce(this,go,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return On("[boolean]",[e],arguments.length),Bn(this,OVe,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return On(" [number]",[e],arguments.length),typeof e=="string"&&Ce(this,ri,"f").narg[e]?this:(this[wce](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return On("[string] [string]",[e,r],arguments.length),e=e||this.$0,Ce(this,mY,"f").log(Ce(this,Ev,"f").generateCompletionScript(e,r||Ce(this,vS,"f")||"completion")),this}showHelp(e){if(On("[string|function]",[e],arguments.length),Bn(this,bS,!0,"f"),!Ce(this,go,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[uTe](Ce(this,J7,"f"),void 0,void 0,0,!0);if($u(n))return n.then(()=>{Ce(this,go,"f").showHelp(e)}),this}let r=Ce(this,Fp,"f").runDefaultBuilderOn(this);if($u(r))return r.then(()=>{Ce(this,go,"f").showHelp(e)}),this}return Ce(this,go,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return On("[boolean|string] [string]",[e,r],arguments.length),Ce(this,go,"f").showHelpOnFail(e,r),this}showVersion(e){return On("[string|function]",[e],arguments.length),Ce(this,go,"f").showVersion(e),this}skipValidation(e){return On("",[e],arguments.length),this[Z7]("skipValidation",e),this}strict(e){return On("[boolean]",[e],arguments.length),Bn(this,yY,e!==!1,"f"),this}strictCommands(e){return On("[boolean]",[e],arguments.length),Bn(this,EY,e!==!1,"f"),this}strictOptions(e){return On("[boolean]",[e],arguments.length),Bn(this,_Y,e!==!1,"f"),this}string(e){return On("",[e],arguments.length),this[Z7]("string",e),this[bY](e),this}terminalWidth(){return On([],0),Ce(this,Yi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return On("",[e],arguments.length),Bn(this,hY,!1,"f"),Ce(this,Yi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(On(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(C_(e,null,Ce(this,Yi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Lp(".usage() description must start with $0 if being used as alias for .command()")}else return Ce(this,go,"f").usage(e),this}usageConfiguration(e){return On("",[e],arguments.length),Bn(this,BVe,e,"f"),this}version(e,r,n){let o="version";if(On("[boolean|string] [string] [string]",[e,r,n],arguments.length),Ce(this,BM,"f")&&(this[s8t](Ce(this,BM,"f")),Ce(this,go,"f").version(void 0),Bn(this,BM,null,"f")),arguments.length===0)n=this[Ufn](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return Bn(this,BM,typeof e=="string"?e:o,"f"),r=r||Ce(this,go,"f").deferY18nLookup("Show version number"),Ce(this,go,"f").version(n||void 0),this.boolean(Ce(this,BM,"f")),this.describe(Ce(this,BM,"f"),r),this}wrap(e){return On("",[e],arguments.length),Ce(this,go,"f").wrap(e),this}[(Fp=new WeakMap,pY=new WeakMap,lTe=new WeakMap,Ev=new WeakMap,vS=new WeakMap,RVe=new WeakMap,K7=new WeakMap,hY=new WeakMap,kVe=new WeakMap,vx=new WeakMap,PVe=new WeakMap,bx=new WeakMap,OM=new WeakMap,bS=new WeakMap,Sx=new WeakMap,DVe=new WeakMap,mY=new WeakMap,Vm=new WeakMap,ri=new WeakMap,NVe=new WeakMap,MVe=new WeakMap,SS=new WeakMap,gY=new WeakMap,xce=new WeakMap,AY=new WeakMap,J7=new WeakMap,OVe=new WeakMap,Yi=new WeakMap,yY=new WeakMap,EY=new WeakMap,_Y=new WeakMap,go=new WeakMap,BVe=new WeakMap,BM=new WeakMap,Hf=new WeakMap,Nfn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Mfn](){return{log:a((...e)=>{this[LVe]()||console.log(...e),Bn(this,bS,!0,"f"),Ce(this,Vm,"f").length&&Bn(this,Vm,Ce(this,Vm,"f")+` -`,"f"),Bn(this,Vm,Ce(this,Vm,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[LVe]()||console.error(...e),Bn(this,bS,!0,"f"),Ce(this,Vm,"f").length&&Bn(this,Vm,Ce(this,Vm,"f")+` -`,"f"),Bn(this,Vm,Ce(this,Vm,"f")+e.join(" "),"f")},"error")}}[s8t](e){Tce(Ce(this,ri,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=Ce(this,ri,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete Ce(this,go,"f").getDescriptions()[e]}[Ofn](e,r,n){Ce(this,kVe,"f")[n]||(Ce(this,Yi,"f").process.emitWarning(e,r),Ce(this,kVe,"f")[n]=!0)}[Bfn](){Ce(this,PVe,"f").push({options:Ce(this,ri,"f"),configObjects:Ce(this,ri,"f").configObjects.slice(0),exitProcess:Ce(this,vx,"f"),groups:Ce(this,OM,"f"),strict:Ce(this,yY,"f"),strictCommands:Ce(this,EY,"f"),strictOptions:Ce(this,_Y,"f"),completionCommand:Ce(this,vS,"f"),output:Ce(this,Vm,"f"),exitError:Ce(this,K7,"f"),hasOutput:Ce(this,bS,"f"),parsed:this.parsed,parseFn:Ce(this,SS,"f"),parseContext:Ce(this,gY,"f")}),Ce(this,go,"f").freeze(),Ce(this,Hf,"f").freeze(),Ce(this,Fp,"f").freeze(),Ce(this,bx,"f").freeze()}[Lfn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(Ce(this,Yi,"f").process.argv()[0])?r=Ce(this,Yi,"f").process.argv().slice(1,2):r=Ce(this,Yi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[Kfn](Ce(this,pY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});C_(s,void 0,Ce(this,Yi,"f")),n=JSON.parse(Ce(this,Yi,"f").readFileSync(s,"utf8"))}catch{}return Ce(this,xce,"f")[r]=n||{},Ce(this,xce,"f")[r]}[Z7](e,r){r=[].concat(r),r.forEach(n=>{n=this[d8t](n),Ce(this,ri,"f")[e].push(n)})}[wce](e,r,n,o){this[u8t](e,r,n,o,(s,c,l)=>{Ce(this,ri,"f")[s][c]=l})}[l8t](e,r,n,o){this[u8t](e,r,n,o,(s,c,l)=>{Ce(this,ri,"f")[s][c]=(Ce(this,ri,"f")[s][c]||[]).concat(l)})}[u8t](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of Tce(n))e(c,n[c]);else s(r,this[d8t](n),o)}[d8t](e){return e==="__proto__"?"___proto___":e}[f8t](e,r){return this[wce](this[f8t].bind(this),"key",e,r),this}[p8t](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=Ce(this,PVe,"f").pop();C_(g,void 0,Ce(this,Yi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){Bn(e,ri,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Bn(r,vx,y,"f")}}.value,groups:{set value(y){Bn(n,OM,y,"f")}}.value,output:{set value(y){Bn(o,Vm,y,"f")}}.value,exitError:{set value(y){Bn(s,K7,y,"f")}}.value,hasOutput:{set value(y){Bn(c,bS,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Bn(l,yY,y,"f")}}.value,strictCommands:{set value(y){Bn(u,EY,y,"f")}}.value,strictOptions:{set value(y){Bn(d,_Y,y,"f")}}.value,completionCommand:{set value(y){Bn(f,vS,y,"f")}}.value,parseFn:{set value(y){Bn(h,SS,y,"f")}}.value,parseContext:{set value(y){Bn(m,gY,y,"f")}}.value}=g,Ce(this,ri,"f").configObjects=A,Ce(this,go,"f").unfreeze(),Ce(this,Hf,"f").unfreeze(),Ce(this,Fp,"f").unfreeze(),Ce(this,bx,"f").unfreeze()}[qfn](e,r){return fY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[jfn].bind(this),getContext:this[Hfn].bind(this),getHasOutput:this[Gfn].bind(this),getLoggerInstance:this[$fn].bind(this),getParseContext:this[Vfn].bind(this),getParserConfiguration:this[CY].bind(this),getUsageConfiguration:this[Ffn].bind(this),getUsageInstance:this[Wfn].bind(this),getValidationInstance:this[zfn].bind(this),hasParseCallback:this[LVe].bind(this),isGlobalContext:this[Yfn].bind(this),postProcess:this[vY].bind(this),reset:this[h8t].bind(this),runValidation:this[m8t].bind(this),runYargsParserAndExecuteCommands:this[uTe].bind(this),setHasOutput:this[Jfn].bind(this)}}[jfn](){return Ce(this,Fp,"f")}[Hfn](){return Ce(this,lTe,"f")}[Gfn](){return Ce(this,bS,"f")}[$fn](){return Ce(this,mY,"f")}[Vfn](){return Ce(this,gY,"f")||{}}[Wfn](){return Ce(this,go,"f")}[zfn](){return Ce(this,Hf,"f")}[LVe](){return!!Ce(this,SS,"f")}[Yfn](){return Ce(this,DVe,"f")}[vY](e,r,n,o){return n||$u(e)||(r||(e=this[Nfn](e)),(this[CY]()["parse-positional-numbers"]||this[CY]()["parse-positional-numbers"]===void 0)&&(e=this[Qfn](e)),o&&(e=dY(e,this,Ce(this,bx,"f").getMiddleware(),!1))),e}[h8t](e={}){Bn(this,ri,Ce(this,ri,"f")||{},"f");let r={};r.local=Ce(this,ri,"f").local||[],r.configObjects=Ce(this,ri,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(Ce(this,AY,"f"),Object.keys(Ce(this,OM,"f")).reduce((c,l)=>{let u=Ce(this,OM,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Bn(this,OM,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(Ce(this,ri,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=z7(Ce(this,ri,"f")[c],l=>!n[l])}),r.envPrefix=Ce(this,ri,"f").envPrefix,Bn(this,ri,r,"f"),Bn(this,go,Ce(this,go,"f")?Ce(this,go,"f").reset(n):Tfn(this,Ce(this,Yi,"f")),"f"),Bn(this,Hf,Ce(this,Hf,"f")?Ce(this,Hf,"f").reset(n):Pfn(this,Ce(this,go,"f"),Ce(this,Yi,"f")),"f"),Bn(this,Fp,Ce(this,Fp,"f")?Ce(this,Fp,"f").reset():vfn(Ce(this,go,"f"),Ce(this,Hf,"f"),Ce(this,bx,"f"),Ce(this,Yi,"f")),"f"),Ce(this,Ev,"f")||Bn(this,Ev,wfn(this,Ce(this,go,"f"),Ce(this,Fp,"f"),Ce(this,Yi,"f")),"f"),Ce(this,bx,"f").reset(),Bn(this,vS,null,"f"),Bn(this,Vm,"","f"),Bn(this,K7,null,"f"),Bn(this,bS,!1,"f"),this.parsed=!1,this}[Kfn](e,r){return Ce(this,Yi,"f").path.relative(e,r)}[uTe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||Ce(this,J7,"f"),Ce(this,ri,"f").__=Ce(this,Yi,"f").y18n.__,Ce(this,ri,"f").configuration=this[CY]();let h=!!Ce(this,ri,"f").configuration["populate--"],m=Object.assign({},Ce(this,ri,"f").configuration,{"populate--":!0}),g=Ce(this,Yi,"f").Parser.detailed(e,Object.assign({},Ce(this,ri,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,Ce(this,gY,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===Ce(this,Sx,"f")&&A[b]?_=!0:b===Ce(this,BM,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&Ce(this,go,"f").clearCachedHelpMessage();try{if(this[a8t](),r)return this[vY](A,h,!!n,!1);Ce(this,Sx,"f")&&[Ce(this,Sx,"f")].concat(E[Ce(this,Sx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Bn(this,DVe,!1,"f");let b=Ce(this,Fp,"f").getCommands(),T=!((c=Ce(this,Ev,"f"))===null||c===void 0)&&c.completionKey?[(l=Ce(this,Ev,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=Ce(this,Ev,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,k;A._[x]!==void 0;x++)if(k=String(A._[x]),b.includes(k)&&k!==Ce(this,vS,"f")){let D=Ce(this,Fp,"f").runCommand(k,this,g,x+1,s,_||v||s);return this[vY](D,h,!!n,!1)}else if(!R&&k!==Ce(this,vS,"f")){R=k;break}!Ce(this,Fp,"f").hasDefaultCommand()&&Ce(this,OVe,"f")&&R&&!w&&Ce(this,Hf,"f").recommendCommands(R,b)}Ce(this,vS,"f")&&A._.includes(Ce(this,vS,"f"))&&!T&&(Ce(this,vx,"f")&&Y7(!0),this.showCompletionScript(),this.exit(0))}if(Ce(this,Fp,"f").hasDefaultCommand()&&!w){let R=Ce(this,Fp,"f").runCommand(null,this,g,0,s,_||v||s);return this[vY](R,h,!!n,!1)}if(T){Ce(this,vx,"f")&&Y7(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${Ce(this,Ev,"f").completionKey}`)+1);return Ce(this,Ev,"f").getCompletion(R,(x,k)=>{if(x)throw new Lp(x.message);(k||[]).forEach(D=>{Ce(this,mY,"f").log(D)}),this.exit(0)}),this[vY](A,!h,!!n,!1)}if(Ce(this,bS,"f")||(_?(Ce(this,vx,"f")&&Y7(!0),f=!0,this.showHelp(R=>{Ce(this,mY,"f").log(R),this.exit(0)})):v&&(Ce(this,vx,"f")&&Y7(!0),f=!0,Ce(this,go,"f").showVersion("log"),this.exit(0))),!f&&Ce(this,ri,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>Ce(this,ri,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Lp(g.error.message);if(!T){let R=this[m8t](E,{},g.error);n||(y=dY(A,this,Ce(this,bx,"f").getMiddleware(),!0)),y=this[qfn](R,y??A),$u(y)&&!n&&(y=y.then(()=>dY(A,this,Ce(this,bx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Lp)Ce(this,go,"f").fail(b.message,b);else throw b}return this[vY](y??A,h,!!n,!0)}[m8t](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Lp(n.message);Ce(this,Hf,"f").nonOptionCount(c),Ce(this,Hf,"f").requiredArguments(c,s);let l=!1;Ce(this,EY,"f")&&(l=Ce(this,Hf,"f").unknownCommands(c)),Ce(this,yY,"f")&&!l?Ce(this,Hf,"f").unknownArguments(c,e,r,!!o):Ce(this,_Y,"f")&&Ce(this,Hf,"f").unknownArguments(c,e,{},!1,!1),Ce(this,Hf,"f").limitedChoices(c),Ce(this,Hf,"f").implications(c),Ce(this,Hf,"f").conflicting(c)}}[Jfn](){Bn(this,bS,!0,"f")}[bY](e){if(typeof e=="string")Ce(this,ri,"f").key[e]=!0;else for(let r of e)Ce(this,ri,"f").key[r]=!0}};function bfn(t){return!!t&&typeof t.getInternalMethods=="function"}a(bfn,"isYargsInstance");var D5o=Zfn(Afn),Xfn=D5o;p();p();var rpn=require("node:child_process"),npn=require("node:util");var N5o=(0,npn.promisify)(rpn.execFile),X7="1.0.49",epn="COPILOT_CLI_PATH",M5o="GITHUB_COPILOT_ACP_USE_CLI",Rce="@github/copilot",O5o=3e4,B5o=1e4,tpn=6e4,kce=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function ipn(){return process.env[M5o]!=="0"}a(ipn,"isCLIIntegrationEnabled");var A8t=process.platform==="win32";async function opn(){if(process.env[epn]){let l=process.env[epn],u=await dTe(l,["--version"]);if(u)return F5o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new kce("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await dTe("copilot",["--version"]);if(t&&fTe(t,X7))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await dTe(e,["--offline",Rce,"--version"],!1,B5o);if(r&&fTe(r,X7))return{path:e,args:[Rce],version:r,source:"npx"};let n=`${Rce}@${X7}`,o=await dTe(e,[n,"--version"],!1,tpn);if(o&&fTe(o,X7))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Rce}@latest`,c=await dTe(e,[s,"--version"],!0,tpn);if(c){if(fTe(c,X7))return{path:e,args:[s],version:c,source:"npx-latest"};throw new kce(`Latest published Copilot CLI version ${c} is below the minimum required ${X7}.`)}throw new kce(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. -Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${Rce}`)}a(opn,"discoverCLI");function L5o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(L5o,"parseVersion");async function dTe(t,e,r=!1,n=O5o){try{let{stdout:o}=await N5o(t,e,{timeout:n,shell:A8t});return L5o(o)}catch(o){if(r)throw o;return null}}a(dTe,"tryGetVersion");function F5o(t,e){if(!fTe(t,X7))throw new kce(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${X7}. Update with: npm install -g ${Rce}@latest`)}a(F5o,"validateVersion");function fTe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},SY=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=gr();this._timestamp=Date.now();this.uriSchemeCache=new FVe;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var tQ=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();p();p();var TY=ce(require("child_process")),E8t=ce(require("path")),vpn=ce(Cpn());function bpn(t){return t.replace(/^git version /,"")}a(bpn,"parseVersion");function _8t(t){return new Promise((e,r)=>{let n=[],o=TY.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:bpn(Buffer.concat(n).toString("utf8").trim())}))})}a(_8t,"findSpecificGit");function J5o(){return new Promise((t,e)=>{TY.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){TY.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:bpn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);TY.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a(J5o,"findGitDarwin");function UVe(t){return t?_8t(E8t.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(UVe,"findSystemGitWin32");async function Z5o(){let t=await(0,vpn.default)("git.exe");return _8t(t)}a(Z5o,"findGitWin32InPath");function X5o(){return UVe(process.env.ProgramW6432).then(void 0,()=>UVe(process.env["ProgramFiles(x86)"])).then(void 0,()=>UVe(process.env.ProgramFiles)).then(void 0,()=>UVe(E8t.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>Z5o())}a(X5o,"findGitWin32");async function rQ(){try{switch(process.platform){case"darwin":return await J5o();case"win32":return await X5o();default:return await _8t("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(rQ,"findGit");var Spn=require("node:child_process"),Tpn=require("node:util");var e4o=(0,Tpn.promisify)(Spn.execFile);async function Ipn(t){return C8t(t,["github.com"])}a(Ipn,"resolveGitHubNwo");async function C8t(t,e){let r;try{r=(await rQ()).path}catch{return}let n;try{n=(await e4o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return t4o(n,e)}a(C8t,"resolveGitHubNwoForHosts");function t4o(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a(t4o,"parseGitRemoteUrl");async function xpn(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(xpn,"resolveRepoIds");p();var r4o=3e4,QVe=class{constructor(e,r=r4o){this.ctx=e;this.timeoutMs=r;this.logger=new ge("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=HB(n).api,c=`${wpn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(ar).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...Gm(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=HB(s).api,u=new URL(`${wpn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(ar).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...Gm(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function wpn(t){return t.endsWith("/")?t.slice(0,-1):t}a(wpn,"trimTrailingSlash");p();p();function Gpn(t){return typeof t>"u"||t===null}a(Gpn,"isNothing");function n4o(t){return typeof t=="object"&&t!==null}a(n4o,"isObject");function i4o(t){return Array.isArray(t)?t:Gpn(t)?[]:[t]}a(i4o,"toArray");function o4o(t,e){var r,n,o,s;if(e)for(s=Object.keys(e),r=0,n=s.length;rl&&(s=" ... ",e=n-l+s.length),r-n>l&&(c=" ...",r=n+l-c.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+c,pos:n-e+s.length}}a(v8t,"getLine");function b8t(t,e){return V0.repeat(" ",e-t.length)+t}a(b8t,"padStart");function h4o(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],o=[],s,c=-1;s=r.exec(t.buffer);)o.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&c<0&&(c=n.length-2);c<0&&(c=n.length-1);var l="",u,d,f=Math.min(t.line+e.linesAfter,o.length).toString().length,h=e.maxLength-(e.indent+f+3);for(u=1;u<=e.linesBefore&&!(c-u<0);u++)d=v8t(t.buffer,n[c-u],o[c-u],t.position-(n[c]-n[c-u]),h),l=V0.repeat(" ",e.indent)+b8t((t.line-u+1).toString(),f)+" | "+d.str+` -`+l;for(d=v8t(t.buffer,n[c],o[c],t.position,h),l+=V0.repeat(" ",e.indent)+b8t((t.line+1).toString(),f)+" | "+d.str+` -`,l+=V0.repeat("-",e.indent+f+3+d.pos)+`^ -`,u=1;u<=e.linesAfter&&!(c+u>=o.length);u++)d=v8t(t.buffer,n[c+u],o[c+u],t.position-(n[c]-n[c+u]),h),l+=V0.repeat(" ",e.indent)+b8t((t.line+u+1).toString(),f)+" | "+d.str+` -`;return l.replace(/\n$/,"")}a(h4o,"makeSnippet");var m4o=h4o,g4o=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],A4o=["scalar","sequence","mapping"];function y4o(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}a(y4o,"compileStyleAliases");function E4o(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(g4o.indexOf(r)===-1)throw new _v('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=y4o(e.styleAliases||null),A4o.indexOf(this.kind)===-1)throw new _v('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}a(E4o,"Type$1");var Uy=E4o;function Rpn(t,e){var r=[];return t[e].forEach(function(n){var o=r.length;r.forEach(function(s,c){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(o=c)}),r[o]=n}),r}a(Rpn,"compileList");function _4o(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(o){o.multi?(t.multi[o.kind].push(o),t.multi.fallback.push(o)):t[o.kind][o.tag]=t.fallback[o.tag]=o}for(a(n,"collectType"),e=0,r=arguments.length;e=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},"binary"),octal:a(function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},"octal"),decimal:a(function(t){return t.toString(10)},"decimal"),hexadecimal:a(function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),q4o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function j4o(t){return!(t===null||!q4o.test(t)||t[t.length-1]==="_")}a(j4o,"resolveYamlFloat");function H4o(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}a(H4o,"constructYamlFloat");var G4o=/^[-+]?[0-9]+e/;function $4o(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(V0.isNegativeZero(t))return"-0.0";return r=t.toString(10),G4o.test(r)?r.replace("e",".e"):r}a($4o,"representYamlFloat");function V4o(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||V0.isNegativeZero(t))}a(V4o,"isFloat");var W4o=new Uy("tag:yaml.org,2002:float",{kind:"scalar",resolve:j4o,construct:H4o,predicate:V4o,represent:$4o,defaultStyle:"lowercase"}),z4o=T4o.extend({implicit:[R4o,N4o,Q4o,W4o]}),Y4o=z4o,Vpn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Wpn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function K4o(t){return t===null?!1:Vpn.exec(t)!==null||Wpn.exec(t)!==null}a(K4o,"resolveYamlTimestamp");function J4o(t){var e,r,n,o,s,c,l,u=0,d=null,f,h,m;if(e=Vpn.exec(t),e===null&&(e=Wpn.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,o=+e[3],!e[4])return new Date(Date.UTC(r,n,o));if(s=+e[4],c=+e[5],l=+e[6],e[7]){for(u=e[7].slice(0,3);u.length<3;)u+="0";u=+u}return e[9]&&(f=+e[10],h=+(e[11]||0),d=(f*60+h)*6e4,e[9]==="-"&&(d=-d)),m=new Date(Date.UTC(r,n,o,s,c,l,u)),d&&m.setTime(m.getTime()-d),m}a(J4o,"constructYamlTimestamp");function Z4o(t){return t.toISOString()}a(Z4o,"representYamlTimestamp");var X4o=new Uy("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:K4o,construct:J4o,instanceOf:Date,represent:Z4o});function eBo(t){return t==="<<"||t===null}a(eBo,"resolveYamlMerge");var tBo=new Uy("tag:yaml.org,2002:merge",{kind:"scalar",resolve:eBo}),k8t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`;function rBo(t){if(t===null)return!1;var e,r,n=0,o=t.length,s=k8t;for(r=0;r64)){if(e<0)return!1;n+=6}return n%8===0}a(rBo,"resolveYamlBinary");function nBo(t){var e,r,n=t.replace(/[\r\n=]/g,""),o=n.length,s=k8t,c=0,l=[];for(e=0;e>16&255),l.push(c>>8&255),l.push(c&255)),c=c<<6|s.indexOf(n.charAt(e));return r=o%4*6,r===0?(l.push(c>>16&255),l.push(c>>8&255),l.push(c&255)):r===18?(l.push(c>>10&255),l.push(c>>2&255)):r===12&&l.push(c>>4&255),new Uint8Array(l)}a(nBo,"constructYamlBinary");function iBo(t){var e="",r=0,n,o,s=t.length,c=k8t;for(n=0;n>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[n];return o=s%3,o===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):o===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):o===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}a(iBo,"representYamlBinary");function oBo(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}a(oBo,"isBinary");var sBo=new Uy("tag:yaml.org,2002:binary",{kind:"scalar",resolve:rBo,construct:nBo,predicate:oBo,represent:iBo}),aBo=Object.prototype.hasOwnProperty,cBo=Object.prototype.toString;function lBo(t){if(t===null)return!0;var e=[],r,n,o,s,c,l=t;for(r=0,n=l.length;r>10)+55296,(t-65536&1023)+56320)}a(xBo,"charFromCodepoint");function Xpn(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}a(Xpn,"setProperty");var ehn=new Array(256),thn=new Array(256);for(IY=0;IY<256;IY++)ehn[IY]=Dpn(IY)?1:0,thn[IY]=Dpn(IY);var IY;function wBo(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||zpn,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(wBo,"State$1");function rhn(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=m4o(r),new _v(e,r)}a(rhn,"generateError");function di(t,e){throw rhn(t,e)}a(di,"throwError");function HVe(t,e){t.onWarning&&t.onWarning.call(null,rhn(t,e))}a(HVe,"throwWarning");var Npn={YAML:a(function(e,r,n){var o,s,c;e.version!==null&&di(e,"duplication of %YAML directive"),n.length!==1&&di(e,"YAML directive accepts exactly one argument"),o=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),o===null&&di(e,"ill-formed argument of the YAML directive"),s=parseInt(o[1],10),c=parseInt(o[2],10),s!==1&&di(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&HVe(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,r,n){var o,s;n.length!==2&&di(e,"TAG directive accepts exactly two arguments"),o=n[0],s=n[1],Jpn.test(o)||di(e,"ill-formed tag handle (first argument) of the TAG directive"),iQ.call(e.tagMap,o)&&di(e,'there is a previously declared suffix for "'+o+'" tag handle'),Zpn.test(s)||di(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{di(e,"tag prefix is malformed: "+s)}e.tagMap[o]=s},"handleTagDirective")};function nQ(t,e,r,n){var o,s,c,l;if(e1&&(t.result+=V0.repeat(` -`,e-1))}a(D8t,"writeFoldedLines");function RBo(t,e,r){var n,o,s,c,l,u,d,f,h=t.kind,m=t.result,g;if(g=t.input.charCodeAt(t.position),Cv(g)||Dce(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96||(g===63||g===45)&&(o=t.input.charCodeAt(t.position+1),Cv(o)||r&&Dce(o)))return!1;for(t.kind="scalar",t.result="",s=c=t.position,l=!1;g!==0;){if(g===58){if(o=t.input.charCodeAt(t.position+1),Cv(o)||r&&Dce(o))break}else if(g===35){if(n=t.input.charCodeAt(t.position-1),Cv(n))break}else{if(t.position===t.lineStart&&VVe(t)||r&&Dce(g))break;if(LM(g))if(u=t.line,d=t.lineStart,f=t.lineIndent,Lh(t,!1,-1),t.lineIndent>=e){l=!0,g=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=u,t.lineStart=d,t.lineIndent=f;break}}l&&(nQ(t,s,c,!1),D8t(t,t.line-u),s=c=t.position,l=!1),xY(g)||(c=t.position+1),g=t.input.charCodeAt(++t.position)}return nQ(t,s,c,!1),t.result?!0:(t.kind=h,t.result=m,!1)}a(RBo,"readPlainScalar");function kBo(t,e){var r,n,o;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=o=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(nQ(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,o=t.position;else return!0;else LM(r)?(nQ(t,n,o,!0),D8t(t,Lh(t,!1,e)),n=o=t.position):t.position===t.lineStart&&VVe(t)?di(t,"unexpected end of the document within a single quoted scalar"):(t.position++,o=t.position);di(t,"unexpected end of the stream within a single quoted scalar")}a(kBo,"readSingleQuotedScalar");function PBo(t,e){var r,n,o,s,c,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return nQ(t,r,t.position,!0),t.position++,!0;if(l===92){if(nQ(t,r,t.position,!0),l=t.input.charCodeAt(++t.position),LM(l))Lh(t,!1,e);else if(l<256&&ehn[l])t.result+=thn[l],t.position++;else if((c=TBo(l))>0){for(o=c,s=0;o>0;o--)l=t.input.charCodeAt(++t.position),(c=SBo(l))>=0?s=(s<<4)+c:di(t,"expected hexadecimal character");t.result+=xBo(s),t.position++}else di(t,"unknown escape sequence");r=n=t.position}else LM(l)?(nQ(t,r,n,!0),D8t(t,Lh(t,!1,e)),r=n=t.position):t.position===t.lineStart&&VVe(t)?di(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}di(t,"unexpected end of the stream within a double quoted scalar")}a(PBo,"readDoubleQuotedScalar");function DBo(t,e){var r=!0,n,o,s,c=t.tag,l,u=t.anchor,d,f,h,m,g,A=Object.create(null),y,E,_,v;if(v=t.input.charCodeAt(t.position),v===91)f=93,g=!1,l=[];else if(v===123)f=125,g=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),v=t.input.charCodeAt(++t.position);v!==0;){if(Lh(t,!0,e),v=t.input.charCodeAt(t.position),v===f)return t.position++,t.tag=c,t.anchor=u,t.kind=g?"mapping":"sequence",t.result=l,!0;r?v===44&&di(t,"expected the node content, but found ','"):di(t,"missed comma between flow collection entries"),E=y=_=null,h=m=!1,v===63&&(d=t.input.charCodeAt(t.position+1),Cv(d)&&(h=m=!0,t.position++,Lh(t,!0,e))),n=t.line,o=t.lineStart,s=t.position,Mce(t,e,qVe,!1,!0),E=t.tag,y=t.result,Lh(t,!0,e),v=t.input.charCodeAt(t.position),(m||t.line===n)&&v===58&&(h=!0,v=t.input.charCodeAt(++t.position),Lh(t,!0,e),Mce(t,e,qVe,!1,!0),_=t.result),g?Nce(t,l,A,E,y,_,n,o,s):h?l.push(Nce(t,null,A,E,y,_,n,o,s)):l.push(y),Lh(t,!0,e),v=t.input.charCodeAt(t.position),v===44?(r=!0,v=t.input.charCodeAt(++t.position)):r=!1}di(t,"unexpected end of the stream within a flow collection")}a(DBo,"readFlowCollection");function NBo(t,e){var r,n,o=S8t,s=!1,c=!1,l=e,u=0,d=!1,f,h;if(h=t.input.charCodeAt(t.position),h===124)n=!1;else if(h===62)n=!0;else return!1;for(t.kind="scalar",t.result="";h!==0;)if(h=t.input.charCodeAt(++t.position),h===43||h===45)S8t===o?o=h===43?kpn:_Bo:di(t,"repeat of a chomping mode identifier");else if((f=IBo(h))>=0)f===0?di(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?di(t,"repeat of an indentation width identifier"):(l=e+f-1,c=!0);else break;if(xY(h)){do h=t.input.charCodeAt(++t.position);while(xY(h));if(h===35)do h=t.input.charCodeAt(++t.position);while(!LM(h)&&h!==0)}for(;h!==0;){for(P8t(t),t.lineIndent=0,h=t.input.charCodeAt(t.position);(!c||t.lineIndentl&&(l=t.lineIndent),LM(h)){u++;continue}if(t.lineIndente)&&u!==0)di(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(E&&(c=t.line,l=t.lineStart,u=t.position),Mce(t,e,jVe,!0,o)&&(E?A=t.result:y=t.result),E||(Nce(t,h,m,g,A,y,c,l,u),g=A=y=null),Lh(t,!0,-1),v=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&v!==0)di(t,"bad indentation of a mapping entry");else if(t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndente?u=1:t.lineIndent===e?u=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),h=0,m=t.implicitTypes.length;h"),t.result!==null&&A.kind!==t.kind&&di(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+A.kind+'", not "'+t.kind+'"'),A.resolve(t.result,t.tag)?(t.result=A.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):di(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||f}a(Mce,"composeNode");function FBo(t){var e=t.position,r,n,o,s=!1,c;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(c=t.input.charCodeAt(t.position))!==0&&(Lh(t,!0,-1),c=t.input.charCodeAt(t.position),!(t.lineIndent>0||c!==37));){for(s=!0,c=t.input.charCodeAt(++t.position),r=t.position;c!==0&&!Cv(c);)c=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),o=[],n.length<1&&di(t,"directive name must not be less than one character in length");c!==0;){for(;xY(c);)c=t.input.charCodeAt(++t.position);if(c===35){do c=t.input.charCodeAt(++t.position);while(c!==0&&!LM(c));break}if(LM(c))break;for(r=t.position;c!==0&&!Cv(c);)c=t.input.charCodeAt(++t.position);o.push(t.input.slice(r,t.position))}c!==0&&P8t(t),iQ.call(Npn,n)?Npn[n](t,n,o):HVe(t,'unknown document directive "'+n+'"')}if(Lh(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Lh(t,!0,-1)):s&&di(t,"directives end mark is expected"),Mce(t,t.lineIndent-1,jVe,!1,!0),Lh(t,!0,-1),t.checkLineBreaks&&vBo.test(t.input.slice(e,t.position))&&HVe(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&VVe(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Lh(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var n=nhn(t,r);if(typeof e!="function")return n;for(var o=0,s=n.length;o=55296&&r<=56319&&e+1=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}a(pTe,"codePointAt");function fhn(t){var e=/^\n* /;return e.test(t)}a(fhn,"needIndentIndicator");var phn=1,w8t=2,hhn=3,mhn=4,Pce=5;function hLo(t,e,r,n,o,s,c,l){var u,d=0,f=null,h=!1,m=!1,g=n!==-1,A=-1,y=fLo(pTe(t,0))&&pLo(pTe(t,t.length-1));if(e||c)for(u=0;u=65536?u+=2:u++){if(d=pTe(t,u),!ATe(d))return Pce;y=y&&Fpn(d,f,l),f=d}else{for(u=0;u=65536?u+=2:u++){if(d=pTe(t,u),d===mTe)h=!0,g&&(m=m||u-A-1>n&&t[A+1]!==" ",A=u);else if(!ATe(d))return Pce;y=y&&Fpn(d,f,l),f=d}m=m||g&&u-A-1>n&&t[A+1]!==" "}return!h&&!m?y&&!c&&!o(t)?phn:s===gTe?Pce:w8t:r>9&&fhn(t)?Pce:c?s===gTe?Pce:w8t:m?mhn:hhn}a(hLo,"chooseScalarStyle");function mLo(t,e,r,n,o){t.dump=(function(){if(e.length===0)return t.quotingType===gTe?'""':"''";if(!t.noCompatMode&&(oLo.indexOf(e)!==-1||sLo.test(e)))return t.quotingType===gTe?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),c=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function u(d){return dLo(t,d)}switch(a(u,"testAmbiguity"),hLo(e,l,t.indent,c,u,t.quotingType,t.forceQuotes&&!n,o)){case phn:return e;case w8t:return"'"+e.replace(/'/g,"''")+"'";case hhn:return"|"+Upn(e,t.indent)+Qpn(Bpn(e,s));case mhn:return">"+Upn(e,t.indent)+Qpn(Bpn(gLo(e,c),s));case Pce:return'"'+ALo(e)+'"';default:throw new _v("impossible error: invalid scalar style")}})()}a(mLo,"writeScalar");function Upn(t,e){var r=fhn(t)?String(e):"",n=t[t.length-1]===` -`,o=n&&(t[t.length-2]===` -`||t===` -`),s=o?"+":n?"":"-";return r+s+` -`}a(Upn,"blockHeader");function Qpn(t){return t[t.length-1]===` -`?t.slice(0,-1):t}a(Qpn,"dropEndingNewline");function gLo(t,e){for(var r=/(\n+)([^\n]*)/g,n=(function(){var d=t.indexOf(` -`);return d=d!==-1?d:t.length,r.lastIndex=d,qpn(t.slice(0,d),e)})(),o=t[0]===` -`||t[0]===" ",s,c;c=r.exec(t);){var l=c[1],u=c[2];s=u[0]===" ",n+=l+(!o&&!s&&u!==""?` -`:"")+qpn(u,e),o=s}return n}a(gLo,"foldString");function qpn(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,o=0,s,c=0,l=0,u="";n=r.exec(t);)l=n.index,l-o>e&&(s=c>o?c:l,u+=` -`+t.slice(o,s),o=s+1),c=l;return u+=` -`,t.length-o>e&&c>o?u+=t.slice(o,c)+` -`+t.slice(c+1):u+=t.slice(o),u.slice(1)}a(qpn,"foldLine");function ALo(t){for(var e="",r=0,n,o=0;o=65536?o+=2:o++)r=pTe(t,o),n=Qy[r],!n&&ATe(r)?(e+=t[o],r>=65536&&(e+=t[o+1])):e+=n||cLo(r);return e}a(ALo,"escapeString");function yLo(t,e,r){var n="",o=t.tag,s,c,l;for(s=0,c=r.length;s"u"&&zL(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=o,t.dump="["+n+"]"}a(yLo,"writeFlowSequence");function jpn(t,e,r,n){var o="",s=t.tag,c,l,u;for(c=0,l=r.length;c"u"&&zL(t,e+1,null,!0,!0,!1,!0))&&((!n||o!=="")&&(o+=x8t(t,e)),t.dump&&mTe===t.dump.charCodeAt(0)?o+="-":o+="- ",o+=t.dump);t.tag=s,t.dump=o||"[]"}a(jpn,"writeBlockSequence");function ELo(t,e,r){var n="",o=t.tag,s=Object.keys(r),c,l,u,d,f;for(c=0,l=s.length;c1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),zL(t,e,d,!1,!1)&&(f+=t.dump,n+=f));t.tag=o,t.dump="{"+n+"}"}a(ELo,"writeFlowMapping");function _Lo(t,e,r,n){var o="",s=t.tag,c=Object.keys(r),l,u,d,f,h,m;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys=="function")c.sort(t.sortKeys);else if(t.sortKeys)throw new _v("sortKeys must be a boolean or a function");for(l=0,u=c.length;l1024,h&&(t.dump&&mTe===t.dump.charCodeAt(0)?m+="?":m+="? "),m+=t.dump,h&&(m+=x8t(t,e)),zL(t,e+1,f,!0,h)&&(t.dump&&mTe===t.dump.charCodeAt(0)?m+=":":m+=": ",m+=t.dump,o+=m));t.tag=s,t.dump=o||"{}"}a(_Lo,"writeBlockMapping");function Hpn(t,e,r){var n,o,s,c,l,u;for(o=r?t.explicitTypes:t.implicitTypes,s=0,c=o.length;s tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}a(Hpn,"detectType");function zL(t,e,r,n,o,s,c){t.tag=null,t.dump=r,Hpn(t,r,!1)||Hpn(t,r,!0);var l=ohn.call(t.dump),u=n,d;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=l==="[object Object]"||l==="[object Array]",h,m;if(f&&(h=t.duplicates.indexOf(r),m=h!==-1),(t.tag!==null&&t.tag!=="?"||m||t.indent!==2&&e>0)&&(o=!1),m&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(f&&m&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(_Lo(t,e,t.dump,o),m&&(t.dump="&ref_"+h+t.dump)):(ELo(t,e,t.dump),m&&(t.dump="&ref_"+h+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!c&&e>0?jpn(t,e-1,t.dump,o):jpn(t,e,t.dump,o),m&&(t.dump="&ref_"+h+t.dump)):(yLo(t,e,t.dump),m&&(t.dump="&ref_"+h+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&mLo(t,t.dump,e,s,u);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new _v("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(d=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?d="!"+d:d.slice(0,18)==="tag:yaml.org,2002:"?d="!!"+d.slice(18):d="!<"+d+">",t.dump=d+" "+t.dump)}return!0}a(zL,"writeNode");function CLo(t,e){var r=[],n=[],o,s;for(R8t(t,r,n),o=0,s=n.length;o0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=wY(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- +`)}`:"";e.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+y))}},"requiredArguments"),s.unknownArguments=a(function(h,m,g,A,y=!0){var E;let _=t.getInternalMethods().getCommandInstance().getCommands(),v=[],b=t.getInternalMethods().getContext();if(Object.keys(h).forEach(T=>{!ymn.includes(T)&&!Object.prototype.hasOwnProperty.call(g,T)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),T)&&!s.isValidAndSomeAliasIsNotNew(T,m)&&v.push(T)}),y&&(b.commands.length>0||_.length>0||A)&&h._.slice(b.commands.length).forEach(T=>{_.includes(""+T)||v.push(""+T)}),y){let w=((E=t.getDemandedCommands()._)===null||E===void 0?void 0:E.max)||0,R=b.commands.length+w;R{x=String(x),!b.commands.includes(x)&&!v.includes(x)&&v.push(x)})}v.length&&e.fail(o("Unknown argument: %s","Unknown arguments: %s",v.length,v.map(T=>T.trim()?T:`"${T}"`).join(", ")))},"unknownArguments"),s.unknownCommands=a(function(h){let m=t.getInternalMethods().getCommandInstance().getCommands(),g=[],A=t.getInternalMethods().getContext();return(A.commands.length>0||m.length>0)&&h._.slice(A.commands.length).forEach(y=>{m.includes(""+y)||g.push(""+y)}),g.length>0?(e.fail(o("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},"unknownCommands"),s.isValidAndSomeAliasIsNotNew=a(function(h,m){if(!Object.prototype.hasOwnProperty.call(m,h))return!1;let g=t.parsed.newAliases;return[h,...m[h]].some(A=>!Object.prototype.hasOwnProperty.call(g,A)||!g[h])},"isValidAndSomeAliasIsNotNew"),s.limitedChoices=a(function(h){let m=t.getOptions(),g={};if(!Object.keys(m.choices).length)return;Object.keys(h).forEach(E=>{ymn.indexOf(E)===-1&&Object.prototype.hasOwnProperty.call(m.choices,E)&&[].concat(h[E]).forEach(_=>{m.choices[E].indexOf(_)===-1&&_!==void 0&&(g[E]=(g[E]||[]).concat(_))})});let A=Object.keys(g);if(!A.length)return;let y=n("Invalid values:");A.forEach(E=>{y+=` + ${n("Argument: %s, Given: %s, Choices: %s",E,e.stringifiedValues(g[E]),e.stringifiedValues(m.choices[E]))}`}),e.fail(y)},"limitedChoices");let c={};s.implies=a(function(h,m){Bn(" [array|number|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.implies(g,h[g])}):(t.global(h),c[h]||(c[h]=[]),Array.isArray(m)?m.forEach(g=>s.implies(h,g)):(__(m,void 0,r),c[h].push(m)))},"implies"),s.getImplied=a(function(){return c},"getImplied");function l(f,h){let m=Number(h);return h=isNaN(m)?h:m,typeof h=="number"?h=f._.length>=h:h.match(/^--no-.+/)?(h=h.match(/^--no-(.+)/)[1],h=!Object.prototype.hasOwnProperty.call(f,h)):h=Object.prototype.hasOwnProperty.call(f,h),h}a(l,"keyExists"),s.implications=a(function(h){let m=[];if(Object.keys(c).forEach(g=>{let A=g;(c[g]||[]).forEach(y=>{let E=A,_=y;E=l(h,E),y=l(h,y),E&&!y&&m.push(` ${A} -> ${_}`)})}),m.length){let g=`${n("Implications failed:")} +`;m.forEach(A=>{g+=A}),e.fail(g)}},"implications");let u={};s.conflicts=a(function(h,m){Bn(" [array|string]",[h,m],arguments.length),typeof h=="object"?Object.keys(h).forEach(g=>{s.conflicts(g,h[g])}):(t.global(h),u[h]||(u[h]=[]),Array.isArray(m)?m.forEach(g=>s.conflicts(h,g)):u[h].push(m))},"conflicts"),s.getConflicting=()=>u,s.conflicting=a(function(h){Object.keys(h).forEach(m=>{u[m]&&u[m].forEach(g=>{g&&h[m]!==void 0&&h[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(m=>{u[m].forEach(g=>{g&&h[r.Parser.camelCase(m)]!==void 0&&h[r.Parser.camelCase(g)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",m,g))})})},"conflictingFn"),s.recommendCommands=a(function(h,m){m=m.sort((E,_)=>_.length-E.length);let A=null,y=1/0;for(let E=0,_;(_=m[E])!==void 0;E++){let v=Amn(h,_);v<=3&&v!h[m]),u=pQ(u,m=>!h[m]),s},"reset");let d=[];return s.freeze=a(function(){d.push({implied:c,conflicting:u})},"freeze"),s.unfreeze=a(function(){let h=d.pop();__(h,void 0,r),{implied:c,conflicting:u}=h},"unfreeze"),s}a(Emn,"validation");p();var _9o={};var vUt=[],kTe;function nze(t,e,r,n){kTe=n;let o={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return o;let s=/\.json|\..*rc$/.test(t.extends),c=null;if(s)c=E9o(e,t.extends);else try{c=_9o.resolve(t.extends)}catch{return t}y9o(c),vUt.push(c),o=s?JSON.parse(kTe.readFileSync(c,"utf8")):n.require(t.extends),delete t.extends,o=nze(o,kTe.path.dirname(c),r,kTe)}return vUt=[],r?_mn(o,t):Object.assign({},o,t)}a(nze,"applyExtends");function y9o(t){if(vUt.indexOf(t)>-1)throw new Qp(`Circular extended configurations: '${t}'.`)}a(y9o,"checkForCircularExtends");function E9o(t,e){return kTe.path.resolve(t,e)}a(E9o,"getPathToDefaultConfig");function _mn(t,e){let r={};function n(o){return o&&typeof o=="object"&&!Array.isArray(o)}a(n,"isObject"),Object.assign(r,t);for(let o of Object.keys(e))n(e[o])&&n(r[o])?r[o]=_mn(t[o],e[o]):r[o]=e[o];return r}a(_mn,"mergeDeep");var Ln=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ke=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},qp,xY,DTe,bC,ES,ize,mQ,wY,oze,bx,sze,Sx,UM,_S,Tx,aze,RY,Jm,ti,cze,lze,vS,PY,Gce,kY,gQ,uze,Wi,DY,NY,MY,mo,dze,QM,zf;function Qmn(t){return(e=[],r=t.process.cwd(),n)=>{let o=new DUt(e,r,n,t);return Object.defineProperty(o,"argv",{get:a(()=>o.parse(),"get"),enumerable:!0}),o.help(),o.version(),o}}a(Qmn,"YargsFactory");var vmn=Symbol("copyDoubleDash"),Cmn=Symbol("copyDoubleDash"),CUt=Symbol("deleteFromParserHintObject"),bmn=Symbol("emitWarning"),Smn=Symbol("freeze"),Tmn=Symbol("getDollarZero"),OY=Symbol("getParserConfiguration"),Imn=Symbol("getUsageConfiguration"),bUt=Symbol("guessLocale"),xmn=Symbol("guessVersion"),wmn=Symbol("parsePositionalNumbers"),SUt=Symbol("pkgUp"),AQ=Symbol("populateParserHintArray"),$ce=Symbol("populateParserHintSingleValueDictionary"),TUt=Symbol("populateParserHintArrayDictionary"),IUt=Symbol("populateParserHintDictionary"),xUt=Symbol("sanitizeKey"),wUt=Symbol("setKey"),RUt=Symbol("unfreeze"),Rmn=Symbol("validateAsync"),Pmn=Symbol("getCommandInstance"),kmn=Symbol("getContext"),Dmn=Symbol("getHasOutput"),Nmn=Symbol("getLoggerInstance"),Mmn=Symbol("getParseContext"),Omn=Symbol("getUsageInstance"),Bmn=Symbol("getValidationInstance"),fze=Symbol("hasParseCallback"),Lmn=Symbol("isGlobalContext"),BY=Symbol("postProcess"),Fmn=Symbol("rebase"),PUt=Symbol("reset"),NTe=Symbol("runYargsParserAndExecuteCommands"),kUt=Symbol("runValidation"),Umn=Symbol("setHasOutput"),LY=Symbol("kTrackManuallySetKeys"),v9o="en_US",DUt=class{static{a(this,"YargsInstance")}constructor(e=[],r,n,o){this.customScriptName=!1,this.parsed=!1,qp.set(this,void 0),xY.set(this,void 0),DTe.set(this,{commands:[],fullCommands:[]}),bC.set(this,null),ES.set(this,null),ize.set(this,"show-hidden"),mQ.set(this,null),wY.set(this,!0),oze.set(this,{}),bx.set(this,!0),sze.set(this,[]),Sx.set(this,void 0),UM.set(this,{}),_S.set(this,!1),Tx.set(this,null),aze.set(this,!0),RY.set(this,void 0),Jm.set(this,""),ti.set(this,void 0),cze.set(this,void 0),lze.set(this,{}),vS.set(this,null),PY.set(this,null),Gce.set(this,{}),kY.set(this,{}),gQ.set(this,void 0),uze.set(this,!1),Wi.set(this,void 0),DY.set(this,!1),NY.set(this,!1),MY.set(this,!1),mo.set(this,void 0),dze.set(this,{}),QM.set(this,null),zf.set(this,void 0),Ln(this,Wi,o,"f"),Ln(this,gQ,e,"f"),Ln(this,xY,r,"f"),Ln(this,cze,n,"f"),Ln(this,Sx,new eze(this),"f"),this.$0=this[Tmn](),this[PUt](),Ln(this,qp,ke(this,qp,"f"),"f"),Ln(this,mo,ke(this,mo,"f"),"f"),Ln(this,zf,ke(this,zf,"f"),"f"),Ln(this,ti,ke(this,ti,"f"),"f"),ke(this,ti,"f").showHiddenOpt=ke(this,ize,"f"),Ln(this,RY,this[Cmn](),"f"),ke(this,Wi,"f").y18n.setLocale(v9o)}addHelpOpt(e,r){let n="help";return Bn("[string|boolean] [string]",[e,r],arguments.length),ke(this,Tx,"f")&&(this[CUt](ke(this,Tx,"f")),Ln(this,Tx,null,"f")),e===!1&&r===void 0?this:(Ln(this,Tx,typeof e=="string"?e:n,"f"),this.boolean(ke(this,Tx,"f")),this.describe(ke(this,Tx,"f"),r||ke(this,mo,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(Bn("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:ke(this,ize,"f");return this.boolean(n),this.describe(n,r||ke(this,mo,"f").deferY18nLookup("Show hidden options")),ke(this,ti,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return Bn(" [string|array]",[e,r],arguments.length),this[TUt](this.alias.bind(this),"alias",e,r),this}array(e){return Bn("",[e],arguments.length),this[AQ]("array",e),this[LY](e),this}boolean(e){return Bn("",[e],arguments.length),this[AQ]("boolean",e),this[LY](e),this}check(e,r){return Bn(" [boolean]",[e,r],arguments.length),this.middleware((n,o)=>IY(()=>e(n,o.getOptions()),s=>(s?(typeof s=="string"||s instanceof Error)&&ke(this,mo,"f").fail(s.toString(),s):ke(this,mo,"f").fail(ke(this,Wi,"f").y18n.__("Argument check failed: %s",e.toString())),n),s=>(ke(this,mo,"f").fail(s.message?s.message:s.toString(),s),n)),!1,r),this}choices(e,r){return Bn(" [string|array]",[e,r],arguments.length),this[TUt](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(Bn(" [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new Qp("coerce callback must be provided");for(let o of e)this.coerce(o,r);return this}else if(typeof e=="object"){for(let o of Object.keys(e))this.coerce(o,e[o]);return this}if(!r)throw new Qp("coerce callback must be provided");let n=e;return ke(this,ti,"f").key[n]=!0,ke(this,Sx,"f").addCoerceMiddleware((o,s)=>{var c;let l=(c=s.getAliases()[n])!==null&&c!==void 0?c:[],u=[n,...l].filter(d=>Object.prototype.hasOwnProperty.call(o,d));return u.length===0?o:IY(()=>r(o[u[0]]),d=>(u.forEach(f=>{o[f]=d}),o),d=>{throw new Qp(d.message)})},n),this}conflicts(e,r){return Bn(" [string|array]",[e,r],arguments.length),ke(this,zf,"f").conflicts(e,r),this}config(e="config",r,n){return Bn("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=nze(e,ke(this,xY,"f"),this[OY]()["deep-merge-config"]||!1,ke(this,Wi,"f")),ke(this,ti,"f").configObjects=(ke(this,ti,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||ke(this,mo,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(o=>{ke(this,ti,"f").config[o]=n||!0}),this)}completion(e,r,n){return Bn("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Ln(this,ES,e||ke(this,ES,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(ke(this,ES,"f"),r),n&&ke(this,bC,"f").registerFunction(n),this}command(e,r,n,o,s,c){return Bn(" [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,o,s,c],arguments.length),ke(this,qp,"f").addHandler(e,r,n,o,s,c),this}commands(e,r,n,o,s,c){return this.command(e,r,n,o,s,c)}commandDir(e,r){Bn(" [object]",[e,r],arguments.length);let n=ke(this,cze,"f")||ke(this,Wi,"f").require;return ke(this,qp,"f").addDirectory(e,n,ke(this,Wi,"f").getCallerFile(),r),this}count(e){return Bn("",[e],arguments.length),this[AQ]("count",e),this[LY](e),this}default(e,r,n){return Bn(" [*] [string]",[e,r,n],arguments.length),n&&(AUt(e,ke(this,Wi,"f")),ke(this,ti,"f").defaultDescription[e]=n),typeof r=="function"&&(AUt(e,ke(this,Wi,"f")),ke(this,ti,"f").defaultDescription[e]||(ke(this,ti,"f").defaultDescription[e]=ke(this,mo,"f").functionDescription(r)),r=r.call()),this[$ce](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,o){return Bn("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,o],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),ke(this,ti,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:o},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(o=>{__(n,!0,ke(this,Wi,"f")),this.demandOption(o,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(__(n,!0,ke(this,Wi,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(o=>{__(n,!0,ke(this,Wi,"f")),this.demandOption(o,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return Bn(" [string]",[e,r],arguments.length),this[$ce](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return Bn(" [string|boolean]",[e,r],arguments.length),ke(this,ti,"f").deprecatedOptions[e]=r,this}describe(e,r){return Bn(" [string]",[e,r],arguments.length),this[wUt](e,!0),ke(this,mo,"f").describe(e,r),this}detectLocale(e){return Bn("",[e],arguments.length),Ln(this,wY,e,"f"),this}env(e){return Bn("[string|boolean]",[e],arguments.length),e===!1?delete ke(this,ti,"f").envPrefix:ke(this,ti,"f").envPrefix=e||"",this}epilogue(e){return Bn("",[e],arguments.length),ke(this,mo,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return Bn(" [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):ke(this,mo,"f").example(e,r),this}exit(e,r){Ln(this,_S,!0,"f"),Ln(this,mQ,r,"f"),ke(this,bx,"f")&&ke(this,Wi,"f").process.exit(e)}exitProcess(e=!0){return Bn("[boolean]",[e],arguments.length),Ln(this,bx,e,"f"),this}fail(e){if(Bn("",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Qp("Invalid first argument. Expected function or boolean 'false'");return ke(this,mo,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return Bn(" [function]",[e,r],arguments.length),r?ke(this,bC,"f").getCompletion(e,r):new Promise((n,o)=>{ke(this,bC,"f").getCompletion(e,(s,c)=>{s?o(s):n(c)})})}getDemandedOptions(){return Bn([],0),ke(this,ti,"f").demandedOptions}getDemandedCommands(){return Bn([],0),ke(this,ti,"f").demandedCommands}getDeprecatedOptions(){return Bn([],0),ke(this,ti,"f").deprecatedOptions}getDetectLocale(){return ke(this,wY,"f")}getExitProcess(){return ke(this,bx,"f")}getGroups(){return Object.assign({},ke(this,UM,"f"),ke(this,kY,"f"))}getHelp(){if(Ln(this,_S,!0,"f"),!ke(this,mo,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[NTe](ke(this,gQ,"f"),void 0,void 0,0,!0);if(Wu(r))return r.then(()=>ke(this,mo,"f").help())}let e=ke(this,qp,"f").runDefaultBuilderOn(this);if(Wu(e))return e.then(()=>ke(this,mo,"f").help())}return Promise.resolve(ke(this,mo,"f").help())}getOptions(){return ke(this,ti,"f")}getStrict(){return ke(this,DY,"f")}getStrictCommands(){return ke(this,NY,"f")}getStrictOptions(){return ke(this,MY,"f")}global(e,r){return Bn(" [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?ke(this,ti,"f").local=ke(this,ti,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{ke(this,ti,"f").local.includes(n)||ke(this,ti,"f").local.push(n)}),this}group(e,r){Bn(" ",[e,r],arguments.length);let n=ke(this,kY,"f")[r]||ke(this,UM,"f")[r];ke(this,kY,"f")[r]&&delete ke(this,kY,"f")[r];let o={};return ke(this,UM,"f")[r]=(n||[]).concat(e).filter(s=>o[s]?!1:o[s]=!0),this}hide(e){return Bn("",[e],arguments.length),ke(this,ti,"f").hiddenOptions.push(e),this}implies(e,r){return Bn(" [number|string|array]",[e,r],arguments.length),ke(this,zf,"f").implies(e,r),this}locale(e){return Bn("[string]",[e],arguments.length),e===void 0?(this[bUt](),ke(this,Wi,"f").y18n.getLocale()):(Ln(this,wY,!1,"f"),ke(this,Wi,"f").y18n.setLocale(e),this)}middleware(e,r,n){return ke(this,Sx,"f").addMiddleware(e,!!r,n)}nargs(e,r){return Bn(" [number]",[e,r],arguments.length),this[$ce](this.nargs.bind(this),"narg",e,r),this}normalize(e){return Bn("",[e],arguments.length),this[AQ]("normalize",e),this}number(e){return Bn("",[e],arguments.length),this[AQ]("number",e),this[LY](e),this}option(e,r){if(Bn(" [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[LY](e),ke(this,QM,"f")&&(e==="version"||r?.alias==="version")&&this[bmn](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` +`),void 0,"versionWarning"),ke(this,ti,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let o=r.demand||r.required||r.require;o&&this.demand(e,o),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(ke(this,ti,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let s=r.describe||r.description||r.desc,c=ke(this,mo,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(c,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){Bn("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Smn](),typeof e>"u"&&(e=ke(this,gQ,"f")),typeof r=="object"&&(Ln(this,PY,r,"f"),r=n),typeof r=="function"&&(Ln(this,vS,r,"f"),r=!1),r||Ln(this,gQ,e,"f"),ke(this,vS,"f")&&Ln(this,bx,!1,"f");let o=this[NTe](e,!!r),s=this.parsed;return ke(this,bC,"f").setParsed(this.parsed),Wu(o)?o.then(c=>(ke(this,vS,"f")&&ke(this,vS,"f").call(this,ke(this,mQ,"f"),c,ke(this,Jm,"f")),c)).catch(c=>{throw ke(this,vS,"f")&&ke(this,vS,"f")(c,this.parsed.argv,ke(this,Jm,"f")),c}).finally(()=>{this[RUt](),this.parsed=s}):(ke(this,vS,"f")&&ke(this,vS,"f").call(this,ke(this,mQ,"f"),o,ke(this,Jm,"f")),this[RUt](),this.parsed=s,o)}parseAsync(e,r,n){let o=this.parse(e,r,n);return Wu(o)?o:Promise.resolve(o)}parseSync(e,r,n){let o=this.parse(e,r,n);if(Wu(o))throw new Qp(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return o}parserConfiguration(e){return Bn("",[e],arguments.length),Ln(this,lze,e,"f"),this}pkgConf(e,r){Bn(" [string]",[e,r],arguments.length);let n=null,o=this[SUt](r||ke(this,xY,"f"));return o[e]&&typeof o[e]=="object"&&(n=nze(o[e],r||ke(this,xY,"f"),this[OY]()["deep-merge-config"]||!1,ke(this,Wi,"f")),ke(this,ti,"f").configObjects=(ke(this,ti,"f").configObjects||[]).concat(n)),this}positional(e,r){Bn(" ",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=pQ(r,(c,l)=>c==="type"&&!["string","number","boolean"].includes(l)?!1:n.includes(c));let o=ke(this,DTe,"f").fullCommands[ke(this,DTe,"f").fullCommands.length-1],s=o?ke(this,qp,"f").cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return jce(s).forEach(c=>{let l=s[c];Array.isArray(l)?l.indexOf(e)!==-1&&(r[c]=!0):l[e]&&!(c in r)&&(r[c]=l[e])}),this.group(e,ke(this,mo,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return Bn("[boolean]",[e],arguments.length),Ln(this,uze,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return Bn(" [number]",[e],arguments.length),typeof e=="string"&&ke(this,ti,"f").narg[e]?this:(this[$ce](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return Bn("[string] [string]",[e,r],arguments.length),e=e||this.$0,ke(this,RY,"f").log(ke(this,bC,"f").generateCompletionScript(e,r||ke(this,ES,"f")||"completion")),this}showHelp(e){if(Bn("[string|function]",[e],arguments.length),Ln(this,_S,!0,"f"),!ke(this,mo,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[NTe](ke(this,gQ,"f"),void 0,void 0,0,!0);if(Wu(n))return n.then(()=>{ke(this,mo,"f").showHelp(e)}),this}let r=ke(this,qp,"f").runDefaultBuilderOn(this);if(Wu(r))return r.then(()=>{ke(this,mo,"f").showHelp(e)}),this}return ke(this,mo,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return Bn("[boolean|string] [string]",[e,r],arguments.length),ke(this,mo,"f").showHelpOnFail(e,r),this}showVersion(e){return Bn("[string|function]",[e],arguments.length),ke(this,mo,"f").showVersion(e),this}skipValidation(e){return Bn("",[e],arguments.length),this[AQ]("skipValidation",e),this}strict(e){return Bn("[boolean]",[e],arguments.length),Ln(this,DY,e!==!1,"f"),this}strictCommands(e){return Bn("[boolean]",[e],arguments.length),Ln(this,NY,e!==!1,"f"),this}strictOptions(e){return Bn("[boolean]",[e],arguments.length),Ln(this,MY,e!==!1,"f"),this}string(e){return Bn("",[e],arguments.length),this[AQ]("string",e),this[LY](e),this}terminalWidth(){return Bn([],0),ke(this,Wi,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return Bn("",[e],arguments.length),Ln(this,wY,!1,"f"),ke(this,Wi,"f").y18n.updateLocale(e),this}usage(e,r,n,o){if(Bn(" [string|boolean] [function|object] [function]",[e,r,n,o],arguments.length),r!==void 0){if(__(e,null,ke(this,Wi,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,o);throw new Qp(".usage() description must start with $0 if being used as alias for .command()")}else return ke(this,mo,"f").usage(e),this}usageConfiguration(e){return Bn("",[e],arguments.length),Ln(this,dze,e,"f"),this}version(e,r,n){let o="version";if(Bn("[boolean|string] [string] [string]",[e,r,n],arguments.length),ke(this,QM,"f")&&(this[CUt](ke(this,QM,"f")),ke(this,mo,"f").version(void 0),Ln(this,QM,null,"f")),arguments.length===0)n=this[xmn](),e=o;else if(arguments.length===1){if(e===!1)return this;n=e,e=o}else arguments.length===2&&(n=r,r=void 0);return Ln(this,QM,typeof e=="string"?e:o,"f"),r=r||ke(this,mo,"f").deferY18nLookup("Show version number"),ke(this,mo,"f").version(n||void 0),this.boolean(ke(this,QM,"f")),this.describe(ke(this,QM,"f"),r),this}wrap(e){return Bn("",[e],arguments.length),ke(this,mo,"f").wrap(e),this}[(qp=new WeakMap,xY=new WeakMap,DTe=new WeakMap,bC=new WeakMap,ES=new WeakMap,ize=new WeakMap,mQ=new WeakMap,wY=new WeakMap,oze=new WeakMap,bx=new WeakMap,sze=new WeakMap,Sx=new WeakMap,UM=new WeakMap,_S=new WeakMap,Tx=new WeakMap,aze=new WeakMap,RY=new WeakMap,Jm=new WeakMap,ti=new WeakMap,cze=new WeakMap,lze=new WeakMap,vS=new WeakMap,PY=new WeakMap,Gce=new WeakMap,kY=new WeakMap,gQ=new WeakMap,uze=new WeakMap,Wi=new WeakMap,DY=new WeakMap,NY=new WeakMap,MY=new WeakMap,mo=new WeakMap,dze=new WeakMap,QM=new WeakMap,zf=new WeakMap,vmn)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Cmn](){return{log:a((...e)=>{this[fze]()||console.log(...e),Ln(this,_S,!0,"f"),ke(this,Jm,"f").length&&Ln(this,Jm,ke(this,Jm,"f")+` +`,"f"),Ln(this,Jm,ke(this,Jm,"f")+e.join(" "),"f")},"log"),error:a((...e)=>{this[fze]()||console.error(...e),Ln(this,_S,!0,"f"),ke(this,Jm,"f").length&&Ln(this,Jm,ke(this,Jm,"f")+` +`,"f"),Ln(this,Jm,ke(this,Jm,"f")+e.join(" "),"f")},"error")}}[CUt](e){jce(ke(this,ti,"f")).forEach(r=>{if((o=>o==="configObjects")(r))return;let n=ke(this,ti,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete ke(this,mo,"f").getDescriptions()[e]}[bmn](e,r,n){ke(this,oze,"f")[n]||(ke(this,Wi,"f").process.emitWarning(e,r),ke(this,oze,"f")[n]=!0)}[Smn](){ke(this,sze,"f").push({options:ke(this,ti,"f"),configObjects:ke(this,ti,"f").configObjects.slice(0),exitProcess:ke(this,bx,"f"),groups:ke(this,UM,"f"),strict:ke(this,DY,"f"),strictCommands:ke(this,NY,"f"),strictOptions:ke(this,MY,"f"),completionCommand:ke(this,ES,"f"),output:ke(this,Jm,"f"),exitError:ke(this,mQ,"f"),hasOutput:ke(this,_S,"f"),parsed:this.parsed,parseFn:ke(this,vS,"f"),parseContext:ke(this,PY,"f")}),ke(this,mo,"f").freeze(),ke(this,zf,"f").freeze(),ke(this,qp,"f").freeze(),ke(this,Sx,"f").freeze()}[Tmn](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(ke(this,Wi,"f").process.argv()[0])?r=ke(this,Wi,"f").process.argv().slice(1,2):r=ke(this,Wi,"f").process.argv().slice(0,1),e=r.map(n=>{let o=this[Fmn](ke(this,xY,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&o.length{if(l.includes("package.json"))return"package.json"});__(s,void 0,ke(this,Wi,"f")),n=JSON.parse(ke(this,Wi,"f").readFileSync(s,"utf8"))}catch{}return ke(this,Gce,"f")[r]=n||{},ke(this,Gce,"f")[r]}[AQ](e,r){r=[].concat(r),r.forEach(n=>{n=this[xUt](n),ke(this,ti,"f")[e].push(n)})}[$ce](e,r,n,o){this[IUt](e,r,n,o,(s,c,l)=>{ke(this,ti,"f")[s][c]=l})}[TUt](e,r,n,o){this[IUt](e,r,n,o,(s,c,l)=>{ke(this,ti,"f")[s][c]=(ke(this,ti,"f")[s][c]||[]).concat(l)})}[IUt](e,r,n,o,s){if(Array.isArray(n))n.forEach(c=>{e(c,o)});else if((c=>typeof c=="object")(n))for(let c of jce(n))e(c,n[c]);else s(r,this[xUt](n),o)}[xUt](e){return e==="__proto__"?"___proto___":e}[wUt](e,r){return this[$ce](this[wUt].bind(this),"key",e,r),this}[RUt](){var e,r,n,o,s,c,l,u,d,f,h,m;let g=ke(this,sze,"f").pop();__(g,void 0,ke(this,Wi,"f"));let A;e=this,r=this,n=this,o=this,s=this,c=this,l=this,u=this,d=this,f=this,h=this,m=this,{options:{set value(y){Ln(e,ti,y,"f")}}.value,configObjects:A,exitProcess:{set value(y){Ln(r,bx,y,"f")}}.value,groups:{set value(y){Ln(n,UM,y,"f")}}.value,output:{set value(y){Ln(o,Jm,y,"f")}}.value,exitError:{set value(y){Ln(s,mQ,y,"f")}}.value,hasOutput:{set value(y){Ln(c,_S,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Ln(l,DY,y,"f")}}.value,strictCommands:{set value(y){Ln(u,NY,y,"f")}}.value,strictOptions:{set value(y){Ln(d,MY,y,"f")}}.value,completionCommand:{set value(y){Ln(f,ES,y,"f")}}.value,parseFn:{set value(y){Ln(h,vS,y,"f")}}.value,parseContext:{set value(y){Ln(m,PY,y,"f")}}.value}=g,ke(this,ti,"f").configObjects=A,ke(this,mo,"f").unfreeze(),ke(this,zf,"f").unfreeze(),ke(this,qp,"f").unfreeze(),ke(this,Sx,"f").unfreeze()}[Rmn](e,r){return IY(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Pmn].bind(this),getContext:this[kmn].bind(this),getHasOutput:this[Dmn].bind(this),getLoggerInstance:this[Nmn].bind(this),getParseContext:this[Mmn].bind(this),getParserConfiguration:this[OY].bind(this),getUsageConfiguration:this[Imn].bind(this),getUsageInstance:this[Omn].bind(this),getValidationInstance:this[Bmn].bind(this),hasParseCallback:this[fze].bind(this),isGlobalContext:this[Lmn].bind(this),postProcess:this[BY].bind(this),reset:this[PUt].bind(this),runValidation:this[kUt].bind(this),runYargsParserAndExecuteCommands:this[NTe].bind(this),setHasOutput:this[Umn].bind(this)}}[Pmn](){return ke(this,qp,"f")}[kmn](){return ke(this,DTe,"f")}[Dmn](){return ke(this,_S,"f")}[Nmn](){return ke(this,RY,"f")}[Mmn](){return ke(this,PY,"f")||{}}[Omn](){return ke(this,mo,"f")}[Bmn](){return ke(this,zf,"f")}[fze](){return!!ke(this,vS,"f")}[Lmn](){return ke(this,aze,"f")}[BY](e,r,n,o){return n||Wu(e)||(r||(e=this[vmn](e)),(this[OY]()["parse-positional-numbers"]||this[OY]()["parse-positional-numbers"]===void 0)&&(e=this[wmn](e)),o&&(e=TY(e,this,ke(this,Sx,"f").getMiddleware(),!1))),e}[PUt](e={}){Ln(this,ti,ke(this,ti,"f")||{},"f");let r={};r.local=ke(this,ti,"f").local||[],r.configObjects=ke(this,ti,"f").configObjects||[];let n={};r.local.forEach(c=>{n[c]=!0,(e[c]||[]).forEach(l=>{n[l]=!0})}),Object.assign(ke(this,kY,"f"),Object.keys(ke(this,UM,"f")).reduce((c,l)=>{let u=ke(this,UM,"f")[l].filter(d=>!(d in n));return u.length>0&&(c[l]=u),c},{})),Ln(this,UM,{},"f");let o=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return o.forEach(c=>{r[c]=(ke(this,ti,"f")[c]||[]).filter(l=>!n[l])}),s.forEach(c=>{r[c]=pQ(ke(this,ti,"f")[c],l=>!n[l])}),r.envPrefix=ke(this,ti,"f").envPrefix,Ln(this,ti,r,"f"),Ln(this,mo,ke(this,mo,"f")?ke(this,mo,"f").reset(n):pmn(this,ke(this,Wi,"f")),"f"),Ln(this,zf,ke(this,zf,"f")?ke(this,zf,"f").reset(n):Emn(this,ke(this,mo,"f"),ke(this,Wi,"f")),"f"),Ln(this,qp,ke(this,qp,"f")?ke(this,qp,"f").reset():umn(ke(this,mo,"f"),ke(this,zf,"f"),ke(this,Sx,"f"),ke(this,Wi,"f")),"f"),ke(this,bC,"f")||Ln(this,bC,gmn(this,ke(this,mo,"f"),ke(this,qp,"f"),ke(this,Wi,"f")),"f"),ke(this,Sx,"f").reset(),Ln(this,ES,null,"f"),Ln(this,Jm,"","f"),Ln(this,mQ,null,"f"),Ln(this,_S,!1,"f"),this.parsed=!1,this}[Fmn](e,r){return ke(this,Wi,"f").path.relative(e,r)}[NTe](e,r,n,o=0,s=!1){var c,l,u,d;let f=!!n||s;e=e||ke(this,gQ,"f"),ke(this,ti,"f").__=ke(this,Wi,"f").y18n.__,ke(this,ti,"f").configuration=this[OY]();let h=!!ke(this,ti,"f").configuration["populate--"],m=Object.assign({},ke(this,ti,"f").configuration,{"populate--":!0}),g=ke(this,Wi,"f").Parser.detailed(e,Object.assign({},ke(this,ti,"f"),{configuration:{"parse-positional-numbers":!1,...m}})),A=Object.assign(g.argv,ke(this,PY,"f")),y,E=g.aliases,_=!1,v=!1;Object.keys(A).forEach(b=>{b===ke(this,Tx,"f")&&A[b]?_=!0:b===ke(this,QM,"f")&&A[b]&&(v=!0)}),A.$0=this.$0,this.parsed=g,o===0&&ke(this,mo,"f").clearCachedHelpMessage();try{if(this[bUt](),r)return this[BY](A,h,!!n,!1);ke(this,Tx,"f")&&[ke(this,Tx,"f")].concat(E[ke(this,Tx,"f")]||[]).filter(x=>x.length>1).includes(""+A._[A._.length-1])&&(A._.pop(),_=!0),Ln(this,aze,!1,"f");let b=ke(this,qp,"f").getCommands(),T=!((c=ke(this,bC,"f"))===null||c===void 0)&&c.completionKey?[(l=ke(this,bC,"f"))===null||l===void 0?void 0:l.completionKey,...(d=this.getAliases()[(u=ke(this,bC,"f"))===null||u===void 0?void 0:u.completionKey])!==null&&d!==void 0?d:[]].some(R=>Object.prototype.hasOwnProperty.call(A,R)):!1,w=_||T||s;if(A._.length){if(b.length){let R;for(let x=o||0,P;A._[x]!==void 0;x++)if(P=String(A._[x]),b.includes(P)&&P!==ke(this,ES,"f")){let D=ke(this,qp,"f").runCommand(P,this,g,x+1,s,_||v||s);return this[BY](D,h,!!n,!1)}else if(!R&&P!==ke(this,ES,"f")){R=P;break}!ke(this,qp,"f").hasDefaultCommand()&&ke(this,uze,"f")&&R&&!w&&ke(this,zf,"f").recommendCommands(R,b)}ke(this,ES,"f")&&A._.includes(ke(this,ES,"f"))&&!T&&(ke(this,bx,"f")&&hQ(!0),this.showCompletionScript(),this.exit(0))}if(ke(this,qp,"f").hasDefaultCommand()&&!w){let R=ke(this,qp,"f").runCommand(null,this,g,0,s,_||v||s);return this[BY](R,h,!!n,!1)}if(T){ke(this,bx,"f")&&hQ(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${ke(this,bC,"f").completionKey}`)+1);return ke(this,bC,"f").getCompletion(R,(x,P)=>{if(x)throw new Qp(x.message);(P||[]).forEach(D=>{ke(this,RY,"f").log(D)}),this.exit(0)}),this[BY](A,!h,!!n,!1)}if(ke(this,_S,"f")||(_?(ke(this,bx,"f")&&hQ(!0),f=!0,this.showHelp(R=>{ke(this,RY,"f").log(R),this.exit(0)})):v&&(ke(this,bx,"f")&&hQ(!0),f=!0,ke(this,mo,"f").showVersion("log"),this.exit(0))),!f&&ke(this,ti,"f").skipValidation.length>0&&(f=Object.keys(A).some(R=>ke(this,ti,"f").skipValidation.indexOf(R)>=0&&A[R]===!0)),!f){if(g.error)throw new Qp(g.error.message);if(!T){let R=this[kUt](E,{},g.error);n||(y=TY(A,this,ke(this,Sx,"f").getMiddleware(),!0)),y=this[Rmn](R,y??A),Wu(y)&&!n&&(y=y.then(()=>TY(A,this,ke(this,Sx,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Qp)ke(this,mo,"f").fail(b.message,b);else throw b}return this[BY](y??A,h,!!n,!0)}[kUt](e,r,n,o){let s={...this.getDemandedOptions()};return c=>{if(n)throw new Qp(n.message);ke(this,zf,"f").nonOptionCount(c),ke(this,zf,"f").requiredArguments(c,s);let l=!1;ke(this,NY,"f")&&(l=ke(this,zf,"f").unknownCommands(c)),ke(this,DY,"f")&&!l?ke(this,zf,"f").unknownArguments(c,e,r,!!o):ke(this,MY,"f")&&ke(this,zf,"f").unknownArguments(c,e,{},!1,!1),ke(this,zf,"f").limitedChoices(c),ke(this,zf,"f").implications(c),ke(this,zf,"f").conflicting(c)}}[Umn](){Ln(this,_S,!0,"f")}[LY](e){if(typeof e=="string")ke(this,ti,"f").key[e]=!0;else for(let r of e)ke(this,ti,"f").key[r]=!0}};function dmn(t){return!!t&&typeof t.getInternalMethods=="function"}a(dmn,"isYargsInstance");var C9o=Qmn(omn),qmn=C9o;p();p();var Gmn=require("node:child_process"),$mn=require("node:util");var b9o=(0,$mn.promisify)(Gmn.execFile),yQ="1.0.60",jmn="COPILOT_CLI_PATH",S9o="GITHUB_COPILOT_ACP_USE_CLI",Vce="@github/copilot",T9o=3e4,I9o=1e4,Hmn=6e4,Wce=class extends Error{static{a(this,"CLIDiscoveryError")}constructor(e){super(e),this.name="CLIDiscoveryError"}};function Vmn(){return process.env[S9o]!=="0"}a(Vmn,"isCLIIntegrationEnabled");var NUt=process.platform==="win32";async function Wmn(){if(process.env[jmn]){let l=process.env[jmn],u=await MTe(l,["--version"]);if(u)return w9o(u,"COPILOT_CLI_PATH"),{path:l,args:[],version:u,source:"env"};throw new Wce("Copilot CLI not found at COPILOT_CLI_PATH. Ensure the path is correct and the binary is executable.")}let t=await MTe("copilot",["--version"]);if(t&&OTe(t,yQ))return{path:"copilot",args:[],version:t,source:"path"};let e=process.platform==="win32"?"npx.cmd":"npx",r=await MTe(e,["--offline",Vce,"--version"],!1,I9o);if(r&&OTe(r,yQ))return{path:e,args:[Vce],version:r,source:"npx"};let n=`${Vce}@${yQ}`,o=await MTe(e,[n,"--version"],!1,Hmn);if(o&&OTe(o,yQ))return{path:e,args:[n],version:o,source:"npx-pinned"};let s=`${Vce}@latest`,c=await MTe(e,[s,"--version"],!0,Hmn);if(c){if(OTe(c,yQ))return{path:e,args:[s],version:c,source:"npx-latest"};throw new Wce(`Latest published Copilot CLI version ${c} is below the minimum required ${yQ}.`)}throw new Wce(`Copilot CLI version could not be determined. 'npx ${s} --version' ran successfully but its output contained no recognisable version. +Try running 'npx ${s} --version' manually to inspect the output, or install/update globally with: npm install -g ${Vce}`)}a(Wmn,"discoverCLI");function x9o(t){let e=t.match(/(\d+\.\d+\.\d+)/);return e?e[1]:null}a(x9o,"parseVersion");async function MTe(t,e,r=!1,n=T9o){try{let{stdout:o}=await b9o(t,e,{timeout:n,shell:NUt});return x9o(o)}catch(o){if(r)throw o;return null}}a(MTe,"tryGetVersion");function w9o(t,e){if(!OTe(t,yQ))throw new Wce(`Copilot CLI version ${t} (from ${e}) is below the minimum required version ${yQ}. Update with: npm install -g ${Vce}@latest`)}a(w9o,"validateVersion");function OTe(t,e){let r=a(c=>c.replace(/^v/,"").split(".").map(l=>{let u=parseInt(l,10);return isNaN(u)?0:u}),"parse"),n=r(t),o=r(e),s=Math.max(n.length,o.length);for(let c=0;cu)return!0;if(lr.type==="file").map(r=>r.uri).filter(Boolean),...this.request.activeEditor?.uri?[this.request.activeEditor.uri]:[]];return Array.from(new Set(e))}getMetadata(e){return this._metadata.get(e)?.at(-1)}getAllMetadata(e){return this._metadata.get(e)}setMetadata(e){let r=e.constructor,n=this._metadata.get(r)??[];n.push(e),this._metadata.set(r,n)}hasMetadata(e){let r=this._metadata.get(e);return r!==void 0&&r.length>0}isSubagent(){return this.parentTurnId!==void 0&&this.parentTurnId!==""}},FY=class t{constructor(e=[],r="panel",n="en",o){this.turns=e;this.source=r;this.userLanguage=n;this._telemetryId=ir();this._timestamp=Date.now();this.uriSchemeCache=new pze;this.currentPartitionId=1;this.id=o??this.telemetryId}static{a(this,"Conversation")}copy(){let e=JSON.parse(JSON.stringify(this.turns)),r=new t(e,this.source,this.userLanguage,this.id);return r._telemetryId=this.telemetryId,r._timestamp=this.timestamp,r.currentPartitionId=this.currentPartitionId,r}get telemetryId(){return this._telemetryId}get timestamp(){return this._timestamp}addTurn(e){this.turns.push(e)}deleteTurn(e){this.turns=this.turns.filter(r=>r.id!==e)}getLastTurn(){return this.turns[this.turns.length-1]}findTurn(e){return this.turns.find(r=>r.id===e)}};p();p();var qM=class{constructor(){this.promiseMap=new Map}static{a(this,"SequencerByKey")}queue(e,r){let o=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(r).finally(()=>{this.promiseMap.get(e)===o&&this.promiseMap.delete(e)});return this.promiseMap.set(e,o),o}async drain(){let e=Array.from(this.promiseMap.values());await Promise.all(e.map(r=>r.catch(()=>{})))}};p();p();p();var UY=fe(require("child_process")),OUt=fe(require("path")),ugn=fe(lgn());function dgn(t){return t.replace(/^git version /,"")}a(dgn,"parseVersion");function BUt(t){return new Promise((e,r)=>{let n=[],o=UY.spawn(t,["--version"]);o.stdout.on("data",s=>n.push(s)),o.on("error",r),o.on("close",s=>s?r(new Error(`Not found. Code: ${s}`)):e({path:t,version:dgn(Buffer.concat(n).toString("utf8").trim())}))})}a(BUt,"findSpecificGit");function q9o(){return new Promise((t,e)=>{UY.exec("which git",(r,n)=>{if(r)return e(new Error(`Executing "which git" failed: ${r.message}`));let o=n.toString().trim();function s(c){UY.execFile(c,["--version"],(l,u)=>l?e(new Error(`Executing "${c} --version" failed: ${l.message}`)):t({path:c,version:dgn(u.toString().trim())}))}if(a(s,"getVersion"),o!=="/usr/bin/git")return s(o);UY.exec("xcode-select -p",c=>{if(c&&c.code===2)return e(new Error('Executing "xcode-select -p" failed with error code 2.'));s(o)})})})}a(q9o,"findGitDarwin");function hze(t){return t?BUt(OUt.join(t,"Git","cmd","git.exe")):Promise.reject(new Error("Not found"))}a(hze,"findSystemGitWin32");async function j9o(){let t=await(0,ugn.default)("git.exe");return BUt(t)}a(j9o,"findGitWin32InPath");function H9o(){return hze(process.env.ProgramW6432).then(void 0,()=>hze(process.env["ProgramFiles(x86)"])).then(void 0,()=>hze(process.env.ProgramFiles)).then(void 0,()=>hze(OUt.join(process.env.LocalAppData,"Programs"))).then(void 0,()=>j9o())}a(H9o,"findGitWin32");async function _Q(){try{switch(process.platform){case"darwin":return await q9o();case"win32":return await H9o();default:return await BUt("git")}}catch(t){throw new Error(`Git installation not found in trusted locations: ${t.message}`)}}a(_Q,"findGit");var fgn=require("node:child_process"),pgn=require("node:util");var G9o=(0,pgn.promisify)(fgn.execFile);async function hgn(t){return LUt(t,["github.com"])}a(hgn,"resolveGitHubNwo");async function LUt(t,e){let r;try{r=(await _Q()).path}catch{return}let n;try{n=(await G9o(r,["remote","get-url","origin"],{cwd:t,timeout:5e3,windowsHide:!0})).stdout}catch{return}return $9o(n,e)}a(LUt,"resolveGitHubNwoForHosts");function $9o(t,e){let r=new Set(["github.com",...e.map(h=>h.toLowerCase())]),n=t.trim().match(/^(?:(?:https?|ssh|git):\/\/(?:[^@]+@)?|git@)([^/:]+)(?::\d+)?[:/](.+?)(?:\.git)?$/);if(!n)return;let[,o,s]=n;if(!r.has(o.toLowerCase()))return;let c=s.indexOf("/");if(c<=0)return;let l=s.slice(0,c),u=s.slice(c+1),d=u.indexOf("/"),f=d>=0?u.slice(0,d):u;if(!(!l||!f))return{owner:l,repo:f}}a($9o,"parseGitRemoteUrl");async function mgn(t,e,r=fetch){let n=`https://api.github.com/repos/${encodeURIComponent(t.owner)}/${encodeURIComponent(t.repo)}`,o;try{o=await r(n,{headers:{Authorization:`token ${e}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}})}catch{return}if(!o.ok)return;let s=await o.json();if(!(typeof s.id!="number"||typeof s.owner?.id!="number"))return{ownerId:s.owner.id,repoId:s.id}}a(mgn,"resolveRepoIds");p();var V9o=3e4,mze=class{constructor(e,r=V9o){this.ctx=e;this.timeoutMs=r;this.logger=new Ae("OrgCustomAgentClient")}static{a(this,"OrgCustomAgentClient")}async listCustomAgents(e,r){let n=this.ctx,o=await this.tryGetAccessToken();if(!o)return;let s=BB(n).api,c=`${ggn(s)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}?include_sources=org,enterprise`;try{let l=await n.get(cr).fetch(c,{method:"GET",headers:{Authorization:`Bearer ${o}`,Accept:"application/json",...lA(n)},timeout:this.timeoutMs});if(!l.ok){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} -> ${l.status}`);return}let u=await l.json();return Array.isArray(u?.agents)?u.agents:[]}catch(l){this.logger.warn(n,`[OrgCustomAgentClient] list ${e}/${r} failed: ${String(l)}`);return}}async getCustomAgentDetails(e,r,n,o){let s=this.ctx,c=await this.tryGetAccessToken();if(!c)return;let l=BB(s).api,u=new URL(`${ggn(l)}/agents/swe/custom-agents/${encodeURIComponent(e)}/${encodeURIComponent(r)}/${encodeURIComponent(n)}`);u.searchParams.set("version",o);try{let d=await s.get(cr).fetch(u.toString(),{method:"GET",headers:{Authorization:`Bearer ${c}`,Accept:"application/json",...lA(s)},timeout:this.timeoutMs});if(!d.ok){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} -> ${d.status}`);return}return await d.json()}catch(d){this.logger.warn(s,`[OrgCustomAgentClient] detail ${e}/${r}/${n}?version=${o} failed: ${String(d)}`);return}}async tryGetAccessToken(){try{return(await this.ctx.get(Fr).resolveSession())?.accessToken}catch(e){this.logger.debug(this.ctx,`[OrgCustomAgentClient] no GitHub session: ${String(e)}`);return}}};function ggn(t){return t.endsWith("/")?t.slice(0,-1):t}a(ggn,"trimTrailingSlash");p();p();var W9o=Object.create,Agn=Object.defineProperty,z9o=Object.getOwnPropertyDescriptor,Y9o=Object.getOwnPropertyNames,K9o=Object.getPrototypeOf,J9o=Object.prototype.hasOwnProperty,zu=a((t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),"__commonJSMin"),Z9o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=Y9o(e),s=0,c=o.length,l;se[u]).bind(null,l),enumerable:!(n=z9o(e,l))||n.enumerable});return t},"__copyProps"),X9o=a((t,e,r)=>(r=t!=null?W9o(K9o(t)):{},Z9o(e||!t||!t.__esModule?Agn(r,"default",{value:t,enumerable:!0}):r,t)),"__toESM"),BTe=zu(((t,e)=>{function r(u){return typeof u>"u"||u===null}a(r,"isNothing");function n(u){return typeof u=="object"&&u!==null}a(n,"isObject");function o(u){return Array.isArray(u)?u:r(u)?[]:[u]}a(o,"toArray");function s(u,d){if(d){let f=Object.keys(d);for(let h=0,m=f.length;h{function r(o,s){let c="",l=o.reason||"(unknown reason)";return o.mark?(o.mark.name&&(c+='in "'+o.mark.name+'" '),c+="("+(o.mark.line+1)+":"+(o.mark.column+1)+")",!s&&o.mark.snippet&&(c+=` + +`+o.mark.snippet),l+" "+c):l}a(r,"formatError");function n(o,s){Error.call(this),this.name="YAMLException",this.reason=o,this.mark=s,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(n,"YAMLException"),n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=a(function(s){return this.name+": "+r(this,s)},"toString"),e.exports=n})),eUo=zu(((t,e)=>{var r=BTe();function n(c,l,u,d,f){let h="",m="",g=Math.floor(f/2)-1;return d-l>g&&(h=" ... ",l=d-g+h.length),u-d>g&&(m=" ...",u=d+g-m.length),{str:h+c.slice(l,u).replace(/\t/g,"\u2192")+m,pos:d-l+h.length}}a(n,"getLine");function o(c,l){return r.repeat(" ",l-c.length)+c}a(o,"padStart");function s(c,l){if(l=Object.create(l||null),!c.buffer)return null;l.maxLength||(l.maxLength=79),typeof l.indent!="number"&&(l.indent=1),typeof l.linesBefore!="number"&&(l.linesBefore=3),typeof l.linesAfter!="number"&&(l.linesAfter=2);let u=/\r?\n|\r|\0/g,d=[0],f=[],h,m=-1;for(;h=u.exec(c.buffer);)f.push(h.index),d.push(h.index+h[0].length),c.position<=h.index&&m<0&&(m=d.length-2);m<0&&(m=d.length-1);let g="",A=Math.min(c.line+l.linesAfter,f.length).toString().length,y=l.maxLength-(l.indent+A+3);for(let _=1;_<=l.linesBefore&&!(m-_<0);_++){let v=n(c.buffer,d[m-_],f[m-_],c.position-(d[m]-d[m-_]),y);g=r.repeat(" ",l.indent)+o((c.line-_+1).toString(),A)+" | "+v.str+` +`+g}let E=n(c.buffer,d[m],f[m],c.position,y);g+=r.repeat(" ",l.indent)+o((c.line+1).toString(),A)+" | "+E.str+` +`,g+=r.repeat("-",l.indent+A+3+E.pos)+`^ +`;for(let _=1;_<=l.linesAfter&&!(m+_>=f.length);_++){let v=n(c.buffer,d[m+_],f[m+_],c.position-(d[m]-d[m+_]),y);g+=r.repeat(" ",l.indent)+o((c.line+_+1).toString(),A)+" | "+v.str+` +`}return g.replace(/\n$/,"")}a(s,"makeSnippet"),e.exports=s})),C_=zu(((t,e)=>{var r=LTe(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];function s(l){let u={};return l!==null&&Object.keys(l).forEach(function(d){l[d].forEach(function(f){u[String(f)]=d})}),u}a(s,"compileStyleAliases");function c(l,u){if(u=u||{},Object.keys(u).forEach(function(d){if(n.indexOf(d)===-1)throw new r('Unknown option "'+d+'" is met in definition of "'+l+'" YAML type.')}),this.options=u,this.tag=l,this.kind=u.kind||null,this.resolve=u.resolve||function(){return!0},this.construct=u.construct||function(d){return d},this.instanceOf=u.instanceOf||null,this.predicate=u.predicate||null,this.represent=u.represent||null,this.representName=u.representName||null,this.defaultStyle=u.defaultStyle||null,this.multi=u.multi||!1,this.styleAliases=s(u.styleAliases||null),o.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+l+'" YAML type.')}a(c,"Type"),e.exports=c})),ygn=zu(((t,e)=>{var r=LTe(),n=C_();function o(l,u){let d=[];return l[u].forEach(function(f){let h=d.length;d.forEach(function(m,g){m.tag===f.tag&&m.kind===f.kind&&m.multi===f.multi&&(h=g)}),d[h]=f}),d}a(o,"compileList");function s(){let l={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function u(d){d.multi?(l.multi[d.kind].push(d),l.multi.fallback.push(d)):l[d.kind][d.tag]=l.fallback[d.tag]=d}a(u,"collectType");for(let d=0,f=arguments.length;d{e.exports=new(C_())("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})})),_gn=zu(((t,e)=>{e.exports=new(C_())("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})})),vgn=zu(((t,e)=>{e.exports=new(C_())("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})})),Cgn=zu(((t,e)=>{e.exports=new(ygn())({explicit:[Egn(),_gn(),vgn()]})})),bgn=zu(((t,e)=>{var r=C_();function n(c){if(c===null)return!0;let l=c.length;return l===1&&c==="~"||l===4&&(c==="null"||c==="Null"||c==="NULL")}a(n,"resolveYamlNull");function o(){return null}a(o,"constructYamlNull");function s(c){return c===null}a(s,"isNull"),e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"})})),Sgn=zu(((t,e)=>{var r=C_();function n(c){if(c===null)return!1;let l=c.length;return l===4&&(c==="true"||c==="True"||c==="TRUE")||l===5&&(c==="false"||c==="False"||c==="FALSE")}a(n,"resolveYamlBoolean");function o(c){return c==="true"||c==="True"||c==="TRUE"}a(o,"constructYamlBoolean");function s(c){return Object.prototype.toString.call(c)==="[object Boolean]"}a(s,"isBoolean"),e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:o,predicate:s,represent:{lowercase:a(function(c){return c?"true":"false"},"lowercase"),uppercase:a(function(c){return c?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(c){return c?"True":"False"},"camelcase")},defaultStyle:"lowercase"})})),Tgn=zu(((t,e)=>{var r=BTe(),n=C_();function o(h){return h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102}a(o,"isHexCode");function s(h){return h>=48&&h<=55}a(s,"isOctCode");function c(h){return h>=48&&h<=57}a(c,"isDecCode");function l(h){if(h===null)return!1;let m=h.length,g=0,A=!1;if(!m)return!1;let y=h[g];if((y==="-"||y==="+")&&(y=h[++g]),y==="0"){if(g+1===m)return!0;if(y=h[++g],y==="b"){for(g++;g=0?"0b"+h.toString(2):"-0b"+h.toString(2).slice(1)},"binary"),octal:a(function(h){return h>=0?"0o"+h.toString(8):"-0o"+h.toString(8).slice(1)},"octal"),decimal:a(function(h){return h.toString(10)},"decimal"),hexadecimal:a(function(h){return h>=0?"0x"+h.toString(16).toUpperCase():"-0x"+h.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),Ign=zu(((t,e)=>{var r=BTe(),n=C_(),o=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function c(h){return h===null||!o.test(h)?!1:Number.isFinite(parseFloat(h,10))?!0:s.test(h)}a(c,"resolveYamlFloat");function l(h){let m=h.toLowerCase(),g=m[0]==="-"?-1:1;return"+-".indexOf(m[0])>=0&&(m=m.slice(1)),m===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:m===".nan"?NaN:g*parseFloat(m,10)}a(l,"constructYamlFloat");var u=/^[-+]?[0-9]+e/;function d(h,m){if(isNaN(h))switch(m){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===h)switch(m){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===h)switch(m){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(h))return"-0.0";let g=h.toString(10);return u.test(g)?g.replace("e",".e"):g}a(d,"representYamlFloat");function f(h){return Object.prototype.toString.call(h)==="[object Number]"&&(h%1!==0||r.isNegativeZero(h))}a(f,"isFloat"),e.exports=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:c,construct:l,predicate:f,represent:d,defaultStyle:"lowercase"})})),xgn=zu(((t,e)=>{e.exports=Cgn().extend({implicit:[bgn(),Sgn(),Tgn(),Ign()]})})),wgn=zu(((t,e)=>{e.exports=xgn()})),Rgn=zu(((t,e)=>{var r=C_(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(u){return u===null?!1:n.exec(u)!==null||o.exec(u)!==null}a(s,"resolveYamlTimestamp");function c(u){let d=0,f=null,h=n.exec(u);if(h===null&&(h=o.exec(u)),h===null)throw new Error("Date resolve error");let m=+h[1],g=+h[2]-1,A=+h[3];if(!h[4])return new Date(Date.UTC(m,g,A));let y=+h[4],E=+h[5],_=+h[6];if(h[7]){for(d=h[7].slice(0,3);d.length<3;)d+="0";d=+d}if(h[9]){let b=+h[10],T=+(h[11]||0);f=(b*60+T)*6e4,h[9]==="-"&&(f=-f)}let v=new Date(Date.UTC(m,g,A,y,E,_,d));return f&&v.setTime(v.getTime()-f),v}a(c,"constructYamlTimestamp");function l(u){return u.toISOString()}a(l,"representYamlTimestamp"),e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:c,instanceOf:Date,represent:l})})),Pgn=zu(((t,e)=>{var r=C_();function n(o){return o==="<<"||o===null}a(n,"resolveYamlMerge"),e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),kgn=zu(((t,e)=>{var r=C_(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`;function o(u){if(u===null)return!1;let d=0,f=u.length,h=n;for(let m=0;m64)){if(g<0)return!1;d+=6}}return d%8===0}a(o,"resolveYamlBinary");function s(u){let d=u.replace(/[\r\n=]/g,""),f=d.length,h=n,m=0,g=[];for(let y=0;y>16&255),g.push(m>>8&255),g.push(m&255)),m=m<<6|h.indexOf(d.charAt(y));let A=f%4*6;return A===0?(g.push(m>>16&255),g.push(m>>8&255),g.push(m&255)):A===18?(g.push(m>>10&255),g.push(m>>2&255)):A===12&&g.push(m>>4&255),new Uint8Array(g)}a(s,"constructYamlBinary");function c(u){let d="",f=0,h=u.length,m=n;for(let A=0;A>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]),f=(f<<8)+u[A];let g=h%3;return g===0?(d+=m[f>>18&63],d+=m[f>>12&63],d+=m[f>>6&63],d+=m[f&63]):g===2?(d+=m[f>>10&63],d+=m[f>>4&63],d+=m[f<<2&63],d+=m[64]):g===1&&(d+=m[f>>2&63],d+=m[f<<4&63],d+=m[64],d+=m[64]),d}a(c,"representYamlBinary");function l(u){return Object.prototype.toString.call(u)==="[object Uint8Array]"}a(l,"isBinary"),e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:o,construct:s,predicate:l,represent:c})})),Dgn=zu(((t,e)=>{var r=C_(),n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;function s(l){if(l===null)return!0;let u=[],d=l;for(let f=0,h=d.length;f{var r=C_(),n=Object.prototype.toString;function o(c){if(c===null)return!0;let l=c,u=new Array(l.length);for(let d=0,f=l.length;d{var r=C_(),n=Object.prototype.hasOwnProperty;function o(c){if(c===null)return!0;let l=c;for(let u in l)if(n.call(l,u)&&l[u]!==null)return!1;return!0}a(o,"resolveYamlSet");function s(c){return c!==null?c:{}}a(s,"constructYamlSet"),e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:o,construct:s})})),FUt=zu(((t,e)=>{e.exports=wgn().extend({implicit:[Rgn(),Pgn()],explicit:[kgn(),Dgn(),Ngn(),Mgn()]})})),tUo=zu(((t,e)=>{var r=BTe(),n=LTe(),o=eUo(),s=FUt(),c=Object.prototype.hasOwnProperty,l=1,u=2,d=3,f=4,h=1,m=2,g=3,A=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,y=/[\x85\u2028\u2029]/,E=/[,\[\]{}]/,_=/^(?:!|!!|![0-9A-Za-z-]+!)$/,v=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function b(F){return Object.prototype.toString.call(F)}a(b,"_class");function T(F){return F===10||F===13}a(T,"isEol");function w(F){return F===9||F===32}a(w,"isWhiteSpace");function R(F){return F===9||F===32||F===10||F===13}a(R,"isWsOrEol");function x(F){return F===44||F===91||F===93||F===123||F===125}a(x,"isFlowIndicator");function P(F){if(F>=48&&F<=57)return F-48;let be=F|32;return be>=97&&be<=102?be-97+10:-1}a(P,"fromHexCode");function D(F){return F===120?2:F===117?4:F===85?8:0}a(D,"escapedHexLen");function N(F){return F>=48&&F<=57?F-48:-1}a(N,"fromDecimalCode");function B(F){switch(F){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return` +`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(B,"simpleEscapeSequence");function L(F){return F<=65535?String.fromCharCode(F):String.fromCharCode((F-65536>>10)+55296,(F-65536&1023)+56320)}a(L,"charFromCodepoint");function j(F,be,Ue){be==="__proto__"?Object.defineProperty(F,be,{configurable:!0,enumerable:!0,writable:!0,value:Ue}):F[be]=Ue}a(j,"setProperty");var M=new Array(256),O=new Array(256);for(let F=0;F<256;F++)M[F]=B(F)?1:0,O[F]=B(F);function q(F,be){this.input=F,this.filename=be.filename||null,this.schema=be.schema||s,this.onWarning=be.onWarning||null,this.legacy=be.legacy||!1,this.json=be.json||!1,this.listener=be.listener||null,this.maxDepth=typeof be.maxDepth=="number"?be.maxDepth:100,this.maxMergeSeqLength=typeof be.maxMergeSeqLength=="number"?be.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=F.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(q,"State");function Q(F,be){let Ue={name:F.filename,buffer:F.input.slice(0,-1),position:F.position,line:F.line,column:F.position-F.lineStart};return Ue.snippet=o(Ue),new n(be,Ue)}a(Q,"generateError");function U(F,be){throw Q(F,be)}a(U,"throwError");function z(F,be){F.onWarning&&F.onWarning.call(null,Q(F,be))}a(z,"throwWarning");function W(F,be,Ue){let de=F.anchorMapTransactions;if(de.length!==0){let Se=de[de.length-1];c.call(Se,be)||(Se[be]={existed:c.call(F.anchorMap,be),value:F.anchorMap[be]})}F.anchorMap[be]=Ue}a(W,"storeAnchor");function $(F){F.anchorMapTransactions.push(Object.create(null))}a($,"beginAnchorTransaction");function J(F){let be=F.anchorMapTransactions.pop(),Ue=F.anchorMapTransactions;if(Ue.length===0)return;let de=Ue[Ue.length-1],Se=Object.keys(be);for(let Le=0,te=Se.length;Le=0;de-=1){let Se=be[Ue[de]];Se.existed?F.anchorMap[Ue[de]]=Se.value:delete F.anchorMap[Ue[de]]}}a(ne,"rollbackAnchorTransaction");function H(F){return{position:F.position,line:F.line,lineStart:F.lineStart,lineIndent:F.lineIndent,firstTabInLine:F.firstTabInLine,tag:F.tag,anchor:F.anchor,kind:F.kind,result:F.result}}a(H,"snapshotState");function re(F,be){F.position=be.position,F.line=be.line,F.lineStart=be.lineStart,F.lineIndent=be.lineIndent,F.firstTabInLine=be.firstTabInLine,F.tag=be.tag,F.anchor=be.anchor,F.kind=be.kind,F.result=be.result}a(re,"restoreState");var ae={YAML:a(function(be,Ue,de){be.version!==null&&U(be,"duplication of %YAML directive"),de.length!==1&&U(be,"YAML directive accepts exactly one argument");let Se=/^([0-9]+)\.([0-9]+)$/.exec(de[0]);Se===null&&U(be,"ill-formed argument of the YAML directive");let Le=parseInt(Se[1],10),te=parseInt(Se[2],10);Le!==1&&U(be,"unacceptable YAML version of the document"),be.version=de[0],be.checkLineBreaks=te<2,te!==1&&te!==2&&z(be,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(be,Ue,de){let Se;de.length!==2&&U(be,"TAG directive accepts exactly two arguments");let Le=de[0];Se=de[1],_.test(Le)||U(be,"ill-formed tag handle (first argument) of the TAG directive"),c.call(be.tagMap,Le)&&U(be,'there is a previously declared suffix for "'+Le+'" tag handle'),v.test(Se)||U(be,"ill-formed tag prefix (second argument) of the TAG directive");try{Se=decodeURIComponent(Se)}catch{U(be,"tag prefix is malformed: "+Se)}be.tagMap[Le]=Se},"handleTagDirective")};function Oe(F,be,Ue,de){if(be=32&&Te<=1114111||U(F,"expected valid JSON character")}else A.test(Se)&&U(F,"the stream contains non-printable characters");F.result+=Se}}a(Oe,"captureSegment");function ve(F,be,Ue,de){r.isObject(Ue)||U(F,"cannot merge mappings; the provided source object is unacceptable");let Se=Object.keys(Ue);for(let Le=0,te=Se.length;LeF.maxMergeSeqLength&&U(F,"merge sequence length exceeded maxMergeSeqLength ("+F.maxMergeSeqLength+")");let Y=new Set;for(let se=0,he=Le.length;se1&&(F.result+=r.repeat(` +`,be-1))}a(K,"writeFoldedLines");function pe(F,be,Ue){let de,Se,Le,te,Te,Ge,Y=F.kind,se=F.result,he=F.input.charCodeAt(F.position);if(R(he)||x(he)||he===35||he===38||he===42||he===33||he===124||he===62||he===39||he===34||he===37||he===64||he===96)return!1;if(he===63||he===45){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Ue&&x(Ce))return!1}for(F.kind="scalar",F.result="",de=Se=F.position,Le=!1;he!==0;){if(he===58){let Ce=F.input.charCodeAt(F.position+1);if(R(Ce)||Ue&&x(Ce))break}else if(he===35){if(R(F.input.charCodeAt(F.position-1)))break}else{if(F.position===F.lineStart&&ee(F)||Ue&&x(he))break;if(T(he))if(te=F.line,Te=F.lineStart,Ge=F.lineIndent,Z(F,!1,-1),F.lineIndent>=be){Le=!0,he=F.input.charCodeAt(F.position);continue}else{F.position=Se,F.line=te,F.lineStart=Te,F.lineIndent=Ge;break}}Le&&(Oe(F,de,Se,!1),K(F,F.line-te),de=Se=F.position,Le=!1),w(he)||(Se=F.position+1),he=F.input.charCodeAt(++F.position)}return Oe(F,de,Se,!1),F.result?!0:(F.kind=Y,F.result=se,!1)}a(pe,"readPlainScalar");function X(F,be){let Ue,de,Se=F.input.charCodeAt(F.position);if(Se!==39)return!1;for(F.kind="scalar",F.result="",F.position++,Ue=de=F.position;(Se=F.input.charCodeAt(F.position))!==0;)if(Se===39)if(Oe(F,Ue,F.position,!0),Se=F.input.charCodeAt(++F.position),Se===39)Ue=F.position,F.position++,de=F.position;else return!0;else T(Se)?(Oe(F,Ue,de,!0),K(F,Z(F,!1,be)),Ue=de=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a single quoted scalar"):(F.position++,w(Se)||(de=F.position));U(F,"unexpected end of the stream within a single quoted scalar")}a(X,"readSingleQuotedScalar");function ue(F,be){let Ue,de,Se,Le=F.input.charCodeAt(F.position);if(Le!==34)return!1;for(F.kind="scalar",F.result="",F.position++,Ue=de=F.position;(Le=F.input.charCodeAt(F.position))!==0;){if(Le===34)return Oe(F,Ue,F.position,!0),F.position++,!0;if(Le===92){if(Oe(F,Ue,F.position,!0),Le=F.input.charCodeAt(++F.position),T(Le))Z(F,!1,be);else if(Le<256&&M[Le])F.result+=O[Le],F.position++;else if((Se=D(Le))>0){let te=Se,Te=0;for(;te>0;te--)Le=F.input.charCodeAt(++F.position),(Se=P(Le))>=0?Te=(Te<<4)+Se:U(F,"expected hexadecimal character");F.result+=L(Te),F.position++}else U(F,"unknown escape sequence");Ue=de=F.position}else T(Le)?(Oe(F,Ue,de,!0),K(F,Z(F,!1,be)),Ue=de=F.position):F.position===F.lineStart&&ee(F)?U(F,"unexpected end of the document within a double quoted scalar"):(F.position++,w(Le)||(de=F.position))}U(F,"unexpected end of the stream within a double quoted scalar")}a(ue,"readDoubleQuotedScalar");function qe(F,be){let Ue=!0,de,Se,Le,te=F.tag,Te,Ge=F.anchor,Y,se,he,Ce,He=Object.create(null),$e,Xe,ct,bt=F.input.charCodeAt(F.position);if(bt===91)Y=93,Ce=!1,Te=[];else if(bt===123)Y=125,Ce=!0,Te={};else return!1;for(F.anchor!==null&&W(F,F.anchor,Te),bt=F.input.charCodeAt(++F.position);bt!==0;){if(Z(F,!0,be),bt=F.input.charCodeAt(F.position),bt===Y)return F.position++,F.tag=te,F.anchor=Ge,F.kind=Ce?"mapping":"sequence",F.result=Te,!0;Ue?bt===44&&U(F,"expected the node content, but found ','"):U(F,"missed comma between flow collection entries"),Xe=$e=ct=null,se=he=!1,bt===63&&R(F.input.charCodeAt(F.position+1))&&(se=he=!0,F.position++,Z(F,!0,be)),de=F.line,Se=F.lineStart,Le=F.position,Et(F,be,l,!1,!0),Xe=F.tag,$e=F.result,Z(F,!0,be),bt=F.input.charCodeAt(F.position),(he||F.line===de)&&bt===58&&(se=!0,bt=F.input.charCodeAt(++F.position),Z(F,!0,be),Et(F,be,l,!1,!0),ct=F.result),Ce?Fe(F,Te,He,Xe,$e,ct,de,Se,Le):se?Te.push(Fe(F,null,He,Xe,$e,ct,de,Se,Le)):Te.push($e),Z(F,!0,be),bt=F.input.charCodeAt(F.position),bt===44?(Ue=!0,bt=F.input.charCodeAt(++F.position)):Ue=!1}U(F,"unexpected end of the stream within a flow collection")}a(qe,"readFlowCollection");function ie(F,be){let Ue,de=h,Se=!1,Le=!1,te=be,Te=0,Ge=!1,Y,se=F.input.charCodeAt(F.position);if(se===124)Ue=!1;else if(se===62)Ue=!0;else return!1;for(F.kind="scalar",F.result="";se!==0;)if(se=F.input.charCodeAt(++F.position),se===43||se===45)h===de?de=se===43?g:m:U(F,"repeat of a chomping mode identifier");else if((Y=N(se))>=0)Y===0?U(F,"bad explicit indentation width of a block scalar; it cannot be less than one"):Le?U(F,"repeat of an indentation width identifier"):(te=be+Y-1,Le=!0);else break;if(w(se)){do se=F.input.charCodeAt(++F.position);while(w(se));if(se===35)do se=F.input.charCodeAt(++F.position);while(!T(se)&&se!==0)}for(;se!==0;){for(Pe(F),F.lineIndent=0,se=F.input.charCodeAt(F.position);(!Le||F.lineIndentte&&(te=F.lineIndent),T(se)){Te++;continue}if(!Le&&te===0&&U(F,"missing indentation for block scalar"),F.lineIndentbe)&&te!==0)U(F,"bad indentation of a sequence entry");else if(F.lineIndentbe)&&($e&&(Se=F.line,Le=F.lineStart,te=F.position),Et(F,be,f,!0,de)&&($e?Ce=F.result:He=F.result),$e||(Fe(F,Y,se,he,Ce,He,Se,Le,te),he=Ce=He=null),Z(F,!0,-1),ct=F.input.charCodeAt(F.position)),(F.line===ht||F.lineIndent>be)&&ct!==0)U(F,"bad indentation of a mapping entry");else if(F.lineIndent=F.maxDepth&&U(F,"nesting exceeded maxDepth ("+F.maxDepth+")"),F.depth+=1,F.listener!==null&&F.listener("open",F),F.tag=null,F.anchor=null,F.kind=null,F.result=null;let $e=Le=te=f===Ue||d===Ue;if(de&&Z(F,!0,-1)&&(Ge=!0,F.lineIndent>be?Te=1:F.lineIndent===be?Te=0:F.lineIndentbe?Te=1:F.lineIndent===be?Te=0:F.lineIndent tag; it should be "scalar", not "'+F.kind+'"');for(let Xe=0,ct=F.implicitTypes.length;Xe"),F.result!==null&&he.kind!==F.kind&&U(F,"unacceptable node kind for !<"+F.tag+'> tag; it should be "'+he.kind+'", not "'+F.kind+'"'),he.resolve(F.result,F.tag)?(F.result=he.construct(F.result,F.tag),F.anchor!==null&&W(F,F.anchor,F.result)):U(F,"cannot resolve a node with !<"+F.tag+"> explicit tag")}return F.listener!==null&&F.listener("close",F),F.depth-=1,F.tag!==null||F.anchor!==null||Y}a(Et,"composeNode");function kt(F){let be=F.position,Ue=!1,de;for(F.version=null,F.checkLineBreaks=F.legacy,F.tagMap=Object.create(null),F.anchorMap=Object.create(null);(de=F.input.charCodeAt(F.position))!==0&&(Z(F,!0,-1),de=F.input.charCodeAt(F.position),!(F.lineIndent>0||de!==37));){Ue=!0,de=F.input.charCodeAt(++F.position);let Se=F.position;for(;de!==0&&!R(de);)de=F.input.charCodeAt(++F.position);let Le=F.input.slice(Se,F.position),te=[];for(Le.length<1&&U(F,"directive name must not be less than one character in length");de!==0;){for(;w(de);)de=F.input.charCodeAt(++F.position);if(de===35){do de=F.input.charCodeAt(++F.position);while(de!==0&&!T(de));break}if(T(de))break;for(Se=F.position;de!==0&&!R(de);)de=F.input.charCodeAt(++F.position);te.push(F.input.slice(Se,F.position))}de!==0&&Pe(F),c.call(ae,Le)?ae[Le](F,Le,te):z(F,'unknown document directive "'+Le+'"')}if(Z(F,!0,-1),F.lineIndent===0&&F.input.charCodeAt(F.position)===45&&F.input.charCodeAt(F.position+1)===45&&F.input.charCodeAt(F.position+2)===45?(F.position+=3,Z(F,!0,-1)):Ue&&U(F,"directives end mark is expected"),Et(F,F.lineIndent-1,f,!1,!0),Z(F,!0,-1),F.checkLineBreaks&&y.test(F.input.slice(be,F.position))&&z(F,"non-ASCII line breaks are interpreted as content"),F.documents.push(F.result),F.position===F.lineStart&&ee(F)){F.input.charCodeAt(F.position)===46&&(F.position+=3,Z(F,!0,-1));return}F.position"u"&&(Ue=be,be=null);let de=Gt(F,Ue);if(typeof be!="function")return de;for(let Se=0,Le=de.length;Se{var r=BTe(),n=LTe(),o=FUt(),s=Object.prototype.toString,c=Object.prototype.hasOwnProperty,l=65279,u=9,d=10,f=13,h=32,m=33,g=34,A=35,y=37,E=38,_=39,v=42,b=44,T=45,w=58,R=61,x=62,P=63,D=64,N=91,B=93,L=96,j=123,M=124,O=125,q={};q[0]="\\0",q[7]="\\a",q[8]="\\b",q[9]="\\t",q[10]="\\n",q[11]="\\v",q[12]="\\f",q[13]="\\r",q[27]="\\e",q[34]='\\"',q[92]="\\\\",q[133]="\\N",q[160]="\\_",q[8232]="\\L",q[8233]="\\P";var Q=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],U=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function z(te,Te){if(Te===null)return{};let Ge={},Y=Object.keys(Te);for(let se=0,he=Y.length;se=32&&te<=126||te>=161&&te<=55295&&te!==8232&&te!==8233||te>=57344&&te<=65533&&te!==l||te>=65536&&te<=1114111}a(ve,"isPrintable");function Fe(te){return ve(te)&&te!==l&&te!==f&&te!==d}a(Fe,"isNsCharOrWhitespace");function Pe(te,Te,Ge){let Y=Fe(te),se=Y&&!Oe(te);return(Ge?Y:Y&&te!==b&&te!==N&&te!==B&&te!==j&&te!==O)&&te!==A&&!(Te===w&&!se)||Fe(Te)&&!Oe(Te)&&te===A||Te===w&&se}a(Pe,"isPlainSafe");function Z(te){return ve(te)&&te!==l&&!Oe(te)&&te!==T&&te!==P&&te!==w&&te!==b&&te!==N&&te!==B&&te!==j&&te!==O&&te!==A&&te!==E&&te!==v&&te!==m&&te!==M&&te!==R&&te!==x&&te!==_&&te!==g&&te!==y&&te!==D&&te!==L}a(Z,"isPlainSafeFirst");function ee(te){return!Oe(te)&&te!==w}a(ee,"isPlainSafeLast");function K(te,Te){let Ge=te.charCodeAt(Te),Y;return Ge>=55296&&Ge<=56319&&Te+1=56320&&Y<=57343)?(Ge-55296)*1024+Y-56320+65536:Ge}a(K,"codePointAt");function pe(te){return/^\n* /.test(te)}a(pe,"needIndentIndicator");var X=1,ue=2,qe=3,ie=4,le=5;function Ne(te,Te,Ge,Y,se,he,Ce,He){let $e,Xe=0,ct=null,bt=!1,ht=!1,We=Y!==-1,ce=-1,Re=Z(K(te,0))&&ee(K(te,te.length-1));if(Te||Ce)for($e=0;$e=65536?$e+=2:$e++){if(Xe=K(te,$e),!ve(Xe))return le;Re=Re&&Pe(Xe,ct,He),ct=Xe}else{for($e=0;$e=65536?$e+=2:$e++){if(Xe=K(te,$e),Xe===d)bt=!0,We&&(ht=ht||$e-ce-1>Y&&te[ce+1]!==" ",ce=$e);else if(!ve(Xe))return le;Re=Re&&Pe(Xe,ct,He),ct=Xe}ht=ht||We&&$e-ce-1>Y&&te[ce+1]!==" "}return!bt&&!ht?Re&&!Ce&&!se(te)?X:he===J?le:ue:Ge>9&&pe(te)?le:Ce?he===J?le:ue:ht?ie:qe}a(Ne,"chooseScalarStyle");function we(te,Te,Ge,Y,se){te.dump=(function(){if(Te.length===0)return te.quotingType===J?'""':"''";if(!te.noCompatMode&&(Q.indexOf(Te)!==-1||U.test(Te)))return te.quotingType===J?'"'+Te+'"':"'"+Te+"'";let he=te.indent*Math.max(1,Ge),Ce=te.lineWidth===-1?-1:Math.max(Math.min(te.lineWidth,40),te.lineWidth-he),He=Y||te.flowLevel>-1&&Ge>=te.flowLevel;function $e(Xe){return ae(te,Xe)}switch(a($e,"testAmbiguity"),Ne(Te,He,te.indent,Ce,$e,te.quotingType,te.forceQuotes&&!Y,se)){case X:return Te;case ue:return"'"+Te.replace(/'/g,"''")+"'";case qe:return"|"+Be(Te,te.indent)+tt(H(Te,he));case ie:return">"+Be(Te,te.indent)+tt(H(st(Te,Ce),he));case le:return'"'+kt(Te,Ce)+'"';default:throw new n("impossible error: invalid scalar style")}})()}a(we,"writeScalar");function Be(te,Te){let Ge=pe(te)?String(Te):"",Y=te[te.length-1]===` +`;return Ge+(Y&&(te[te.length-2]===` +`||te===` +`)?"+":Y?"":"-")+` +`}a(Be,"blockHeader");function tt(te){return te[te.length-1]===` +`?te.slice(0,-1):te}a(tt,"dropEndingNewline");function st(te,Te){let Ge=/(\n+)([^\n]*)/g,Y=(function(){let He=te.indexOf(` +`);return He=He!==-1?He:te.length,Ge.lastIndex=He,Et(te.slice(0,He),Te)})(),se=te[0]===` +`||te[0]===" ",he,Ce;for(;Ce=Ge.exec(te);){let He=Ce[1],$e=Ce[2];he=$e[0]===" ",Y+=He+(!se&&!he&&$e!==""?` +`:"")+Et($e,Te),se=he}return Y}a(st,"foldString");function Et(te,Te){if(te===""||te[0]===" ")return te;let Ge=/ [^ ]/g,Y,se=0,he,Ce=0,He=0,$e="";for(;Y=Ge.exec(te);)He=Y.index,He-se>Te&&(he=Ce>se?Ce:He,$e+=` +`+te.slice(se,he),se=he+1),Ce=He;return $e+=` +`,te.length-se>Te&&Ce>se?$e+=te.slice(se,Ce)+` +`+te.slice(Ce+1):$e+=te.slice(se),$e.slice(1)}a(Et,"foldLine");function kt(te){let Te="",Ge=0;for(let Y=0;Y=65536?Y+=2:Y++){Ge=K(te,Y);let se=q[Ge];!se&&ve(Ge)?(Te+=te[Y],Ge>=65536&&(Te+=te[Y+1])):Te+=se||W(Ge)}return Te}a(kt,"escapeString");function Gt(te,Te,Ge){let Y="",se=te.tag;for(let he=0,Ce=Ge.length;he"u"&&Ue(te,Te,null,!1,!1))&&(Y!==""&&(Y+=","+(te.condenseFlow?"":" ")),Y+=te.dump)}te.tag=se,te.dump="["+Y+"]"}a(Gt,"writeFlowSequence");function jt(te,Te,Ge,Y){let se="",he=te.tag;for(let Ce=0,He=Ge.length;Ce"u"&&Ue(te,Te+1,null,!0,!0,!1,!0))&&((!Y||se!=="")&&(se+=re(te,Te)),te.dump&&d===te.dump.charCodeAt(0)?se+="-":se+="- ",se+=te.dump)}te.tag=he,te.dump=se||"[]"}a(jt,"writeBlockSequence");function Ie(te,Te,Ge){let Y="",se=te.tag,he=Object.keys(Ge);for(let Ce=0,He=he.length;Ce1024&&($e+="? "),$e+=te.dump+(te.condenseFlow?'"':"")+":"+(te.condenseFlow?"":" "),Ue(te,Te,ct,!1,!1)&&($e+=te.dump,Y+=$e))}te.tag=se,te.dump="{"+Y+"}"}a(Ie,"writeFlowMapping");function F(te,Te,Ge,Y){let se="",he=te.tag,Ce=Object.keys(Ge);if(te.sortKeys===!0)Ce.sort();else if(typeof te.sortKeys=="function")Ce.sort(te.sortKeys);else if(te.sortKeys)throw new n("sortKeys must be a boolean or a function");for(let He=0,$e=Ce.length;He<$e;He+=1){let Xe="";(!Y||se!=="")&&(Xe+=re(te,Te));let ct=Ce[He],bt=Ge[ct];if(te.replacer&&(bt=te.replacer.call(Ge,ct,bt)),!Ue(te,Te+1,ct,!0,!0,!0))continue;let ht=te.tag!==null&&te.tag!=="?"||te.dump&&te.dump.length>1024;ht&&(te.dump&&d===te.dump.charCodeAt(0)?Xe+="?":Xe+="? "),Xe+=te.dump,ht&&(Xe+=re(te,Te)),Ue(te,Te+1,bt,!0,ht)&&(te.dump&&d===te.dump.charCodeAt(0)?Xe+=":":Xe+=": ",Xe+=te.dump,se+=Xe)}te.tag=he,te.dump=se||"{}"}a(F,"writeBlockMapping");function be(te,Te,Ge){let Y=Ge?te.explicitTypes:te.implicitTypes;for(let se=0,he=Y.length;se tag resolver accepts not "'+He+'" style');te.dump=$e}return!0}}return!1}a(be,"detectType");function Ue(te,Te,Ge,Y,se,he,Ce){te.tag=null,te.dump=Ge,be(te,Ge,!1)||be(te,Ge,!0);let He=s.call(te.dump),$e=Y;Y&&(Y=te.flowLevel<0||te.flowLevel>Te);let Xe=He==="[object Object]"||He==="[object Array]",ct,bt;if(Xe&&(ct=te.duplicates.indexOf(Ge),bt=ct!==-1),(te.tag!==null&&te.tag!=="?"||bt||te.indent!==2&&Te>0)&&(se=!1),bt&&te.usedDuplicates[ct])te.dump="*ref_"+ct;else{if(Xe&&bt&&!te.usedDuplicates[ct]&&(te.usedDuplicates[ct]=!0),He==="[object Object]")Y&&Object.keys(te.dump).length!==0?(F(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Ie(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object Array]")Y&&te.dump.length!==0?(te.noArrayIndent&&!Ce&&Te>0?jt(te,Te-1,te.dump,se):jt(te,Te,te.dump,se),bt&&(te.dump="&ref_"+ct+te.dump)):(Gt(te,Te,te.dump),bt&&(te.dump="&ref_"+ct+" "+te.dump));else if(He==="[object String]")te.tag!=="?"&&we(te,te.dump,Te,he,$e);else{if(He==="[object Undefined]")return!1;if(te.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+He)}if(te.tag!==null&&te.tag!=="?"){let ht=encodeURI(te.tag[0]==="!"?te.tag.slice(1):te.tag).replace(/!/g,"%21");te.tag[0]==="!"?ht="!"+ht:ht.slice(0,18)==="tag:yaml.org,2002:"?ht="!!"+ht.slice(18):ht="!<"+ht+">",te.dump=ht+" "+te.dump}}return!0}a(Ue,"writeNode");function de(te,Te){let Ge=[],Y=[];Se(te,Ge,Y);let se=Y.length;for(let he=0;he{var r=tUo(),n=rUo();function o(s,c){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+c+" instead, which is now safe by default.")}}a(o,"renamed"),e.exports.Type=C_(),e.exports.Schema=ygn(),e.exports.FAILSAFE_SCHEMA=Cgn(),e.exports.JSON_SCHEMA=xgn(),e.exports.CORE_SCHEMA=wgn(),e.exports.DEFAULT_SCHEMA=FUt(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=LTe(),e.exports.types={binary:kgn(),float:Ign(),map:vgn(),null:bgn(),pairs:Ngn(),set:Mgn(),timestamp:Rgn(),bool:Sgn(),int:Tgn(),merge:Pgn(),omap:Dgn(),seq:_gn(),str:Egn()},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")}))(),1),{Type:S4u,Schema:T4u,FAILSAFE_SCHEMA:I4u,JSON_SCHEMA:x4u,CORE_SCHEMA:w4u,DEFAULT_SCHEMA:R4u,load:P4u,loadAll:k4u,dump:QY,YAMLException:D4u,types:N4u,safeLoad:M4u,safeLoadAll:O4u,safeDump:B4u}=Ogn.default,L4u=Ogn.default;function Lgn(t){let e={};t.display_name&&(e.name=t.display_name),t.description&&(e.description=t.description),t.tools&&t.tools.length>0&&!t.tools.includes("*")&&(e.tools=t.tools),t.argument_hint&&(e["argument-hint"]=t.argument_hint),t.target&&(e.target=t.target),t.model&&(e.model=t.model);let r=[];t.user_invocable!==!1&&r.push("user"),t.disable_model_invocation!==!0&&r.push("model"),r.length<2&&(e["x-github-copilot-invoke-policy"]=r);let n=QY(e,{sortKeys:!1,lineWidth:-1,noRefs:!0,noCompatMode:!0,quotingType:'"',forceQuotes:!1}).trim(),o=t.prompt??"";return`--- ${n} --- ${o} -`}a(Ahn,"generateAgentMarkdown");p();p();p();p();p();p();var yTe={isBlocked:!1,reason:"VALID_FILE"},WVe={isBlocked:!1,reason:"NO_MATCHING_POLICY"},yhn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},RY={all:"all",repo:"repo"},oQ=new ge("contentExclusion");p();p();var zVe=class{static{a(this,"PolicyEvaluator")}};p();p();p();var O8t=new ge("repository"),kY=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},cP=class{static{a(this,"GitConfigLoader")}},YVe=class extends cP{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var Ehn=require("os");var KVe=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return Z9.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=Z9.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,Ehn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var JVe=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(cP).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new KVe(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var TLo=100,B8t=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},W0=class t{constructor(e){this.ctx=e;this.remoteResolver=new JVe;this.cache=new nn(TLo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=tf(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new B8t(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(Fo),o=xa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=xa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=aW(r,s[1]),l=xa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=xa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=xa(c,"commondir");c=aW(c,(await e.readFileString(d)).trimEnd());let f=xa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var PY=a((t,e)=>{if(RM.Check(t,e))return e;let r=`Typebox schema validation failed: -${[...RM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` -`)}`;throw new Error(r)},"assertShape");p();p();p();var ZVe=new WeakMap;function XVe(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&ZVe.has(t))return ZVe.get(t);switch(ZVe.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(ILo,"n");function vhn(t,e){return function(r,n){return ILo(t,e,r,n)}}a(vhn,"o");p();p();p();var F8t=a((t,e,r)=>{let n=t instanceof RegExp?bhn(t,r):t,o=e instanceof RegExp?bhn(e,r):e,s=n!==null&&o!=null&&xLo(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),bhn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),xLo=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var Shn="\0SLASH"+Math.random()+"\0",Thn="\0OPEN"+Math.random()+"\0",Q8t="\0CLOSE"+Math.random()+"\0",Ihn="\0COMMA"+Math.random()+"\0",xhn="\0PERIOD"+Math.random()+"\0",wLo=new RegExp(Shn,"g"),RLo=new RegExp(Thn,"g"),kLo=new RegExp(Q8t,"g"),PLo=new RegExp(Ihn,"g"),DLo=new RegExp(xhn,"g"),NLo=/\\\\/g,MLo=/\\{/g,OLo=/\\}/g,BLo=/\\,/g,LLo=/\\\./g,FLo=1e5;function U8t(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(U8t,"numeric");function ULo(t){return t.replace(NLo,Shn).replace(MLo,Thn).replace(OLo,Q8t).replace(BLo,Ihn).replace(LLo,xhn)}a(ULo,"escapeBraces");function QLo(t){return t.replace(wLo,"\\").replace(RLo,"{").replace(kLo,"}").replace(PLo,",").replace(DLo,".")}a(QLo,"unescapeBraces");function whn(t){if(!t)return[""];let e=[],r=F8t("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=whn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(whn,"parseCommaParts");function Rhn(t,e={}){if(!t)return[];let{max:r=FLo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),ETe(ULo(t),r,!0).map(QLo)}a(Rhn,"expand");function qLo(t){return"{"+t+"}"}a(qLo,"embrace");function jLo(t){return/^-?0\d/.test(t)}a(jLo,"isPadded");function HLo(t,e){return t<=e}a(HLo,"lte");function GLo(t,e){return t>=e}a(GLo,"gte");function ETe(t,e,r){let n=[],o=F8t("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?ETe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+Q8t+o.post,ETe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=whn(o.body),h.length===1&&h[0]!==void 0&&(h=ETe(h[0],e,!1).map(qLo),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=U8t(h[0]),A=U8t(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(U8t(h[2])),1):1,_=HLo;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var $Lo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},CTe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VLo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),khn=a(t=>t.join(""),"rangesToString"),Phn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(CTe(h)+"-"+CTe(y)):y===h&&n.push(CTe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(CTe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(CTe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var vv,WLo=new Set(["!","?","+","*","@"]),q8t=a(t=>WLo.has(t),"isExtglobType"),Dhn=a(t=>q8t(t.type),"isExtglobAST"),zLo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),YLo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),KLo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Nhn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),JLo="(?!(?:^|/)\\.\\.?(?:$|/))",tWe="(?!\\.)",ZLo=new Set(["[","."]),XLo=new Set(["..","."]),e3o=new Set("().*{}+?[]^$\\!"),t3o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),j8t="[^/]",Mhn=j8t+"*?",Ohn=j8t+"+?",r3o=0,DY=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++r3o;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,E,_]=typeof g=="string"?vv.#k(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&XLo.has(this.#n[0]))){let A=ZLo,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?JLo:E?tWe:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,lP(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,lP(this.toString()),!1,!1]}let c=!n||e||r||!tWe?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?tWe:"")+Ohn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?tWe:"")+Mhn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,lP(s),this.#t=!!this.#t,this.#r]}#S(){if(Dhn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var df=a((t,e,r={})=>(_Te(e),!r.nocomment&&e.charAt(0)==="#"?!1:new b_(e,r).match(t)),"minimatch"),n3o=/^\*+([^+@!?*[(]*)$/,i3o=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),o3o=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),s3o=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),a3o=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),c3o=/^\*+\.\*+$/,l3o=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),u3o=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),d3o=/^\.\*+$/,f3o=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),p3o=/^\*+$/,h3o=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),m3o=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),g3o=/^\?+([^+@!?*[(]*)?$/,A3o=a(([t,e=""])=>{let r=Fhn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),y3o=a(([t,e=""])=>{let r=Uhn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),E3o=a(([t,e=""])=>{let r=Uhn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),_3o=a(([t,e=""])=>{let r=Fhn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),Fhn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),Uhn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),Qhn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Bhn={win32:{sep:"\\"},posix:{sep:"/"}},C3o=Qhn==="win32"?Bhn.win32.sep:Bhn.posix.sep;df.sep=C3o;var Up=Symbol("globstar **");df.GLOBSTAR=Up;var v3o="[^/]",b3o=v3o+"*?",S3o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",T3o="(?:(?!(?:\\/|^)\\.).)*?",I3o=a((t,e={})=>r=>df(r,t,e),"filter");df.filter=I3o;var Tx=a((t,e={})=>Object.assign({},t,e),"ext"),x3o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return df;let e=df;return Object.assign(a((n,o,s={})=>e(n,o,Tx(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Tx(t,s))}static defaults(o){return e.defaults(Tx(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Tx(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Tx(t,s))}},unescape:a((n,o={})=>e.unescape(n,Tx(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Tx(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Tx(t,o)),"filter"),defaults:a(n=>e.defaults(Tx(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Tx(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Tx(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Tx(t,s)),"match"),sep:e.sep,GLOBSTAR:Up})},"defaults");df.defaults=x3o;var qhn=a((t,e={})=>(_Te(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Rhn(t,{max:e.braceExpandMax})),"braceExpand");df.braceExpand=qhn;var w3o=a((t,e={})=>new b_(t,e).makeRe(),"makeRe");df.makeRe=w3o;var R3o=a((t,e,r={})=>{let n=new b_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");df.match=R3o;var Lhn=/[?*]|[+@!]\(.*?\)|\[|\]/,k3o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),b_=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){_Te(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||Qhn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!Lhn.test(s[2]))&&!Lhn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Up)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(Up,s),l=r.lastIndexOf(Up),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?k3o(h):h===Up?Up:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==Up||A===Up||(A===void 0?g!==void 0&&g!==Up?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==Up&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=Up))});let f=d.filter(h=>h!==Up);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return df.defaults(e).Minimatch}};df.AST=DY;df.Minimatch=b_;df.escape=Oce;df.unescape=lP;var H8t="contentExclusion",rWe=class extends zVe{static{a(this,"CopilotContentExclusion")}#e;#t=new nn(1e4);#r=new nn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=aW(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??RY.all);if(!o)return WVe;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return oQ.exception(this.#e,n,`${H8t}.evaluate`),yhn}return yTe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=yTe,c,l=fPt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(df(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=G8t(u,"FILE_BLOCKED_PATH"),c=d;break e}return oQ.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return yTe;let c=this.evaluateFileContent(o,s,n);return oQ.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>jhn(c)).some(c=>c.test(n)))return G8t(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>jhn(c)).some(c=>c.test(n)))return G8t(o,"FILE_BLOCKED_TEXT_BASED");return yTe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){_s(this.#e,e,`${H8t}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=vhn(async e=>{let r=await this.#e.get(Qt).getGitHubSession();if(!r)throw new Ai("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(RY.all);e.filter(u=>u!==RY.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==RY.all).join(",")),n.searchParams.set("scope",o?RY.all:RY.repo);let c=await Td(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new DN(c)}return this.#s("fetch.success"),PY(M3o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(W0).getRepo(tf(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){ht(this.#e,`${H8t}.${e}`,jt.createAndMarkAsIssued(r,n))}};function jhn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(jhn,"stringToRegex");function G8t(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(G8t,"fileBlockedEvaluationResult");var P3o=S.Object({name:S.String(),type:S.String()}),D3o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:P3o}),$8t=S.Array(D3o),N3o=S.Object({rules:$8t,last_updated_at:S.String(),scope:S.String()}),M3o=S.Array(N3o);var Cc=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new rWe(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get(cn).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=Pm(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get(cn).onDidFocusTextDocument(r),Es(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){oQ.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(as).setClsInactive(r??"Copilot is disabled"):this.ctx.get(as).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===WVe.reason)return oQ.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return ht(this.ctx,e,jt.createAndMarkAsIssued(l,u)),ht(this.ctx,e,jt.createAndMarkAsIssued({...l,path:r},u),1),oQ.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Bce(t,e,r){let n=await t.get(Cc).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Bce,"isDocumentValid");var cn=class{constructor(e,r=Bce){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=ca(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(Fo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(Fo).readFileString(e)}getWorkspaceFolder(e){let r=ca(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(ca(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=ca(e.uri);for(let n of this.getWorkspaceFolders()){let o=ca(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return ji(r)}};p();p();var Ye=new ge("chat");p();var nWe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new no;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var qy=class{constructor(e){this.ctx=e;this.watchers=new nn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(Ye.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(Pm(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var FM=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},O3o="workspaceLifecycleManager",jy=new ge(O3o),S_=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=Es(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?jy.debug(this.ctx,`listener ${e.constructor.name} is already started`):(jy.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):jy.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);jy.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get(cn).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get(cn).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){jy.debug(r,"No workspaces to add.");return}jy.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];jy.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));jy.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));jy.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));jy.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){jy.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(qy).terminateWatching(l);for(let d of this.activeListeners)jy.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;jy.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(qy);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){jy.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)jy.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)jy.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(qy).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function iWe(t){t.set(S_,new S_(t))}a(iWe,"setupWorkspaceLifecycleListener");var sQ=ce(require("fs")),Ix=ce(require("path"));var V8t=".agent.md",B3o=300*1e3,L3o="github",Ghn="agents";function vTe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(vTe,"sanitizeSegment");function F3o(t){return t.replace(/\\/g,"/")}a(F3o,"toPosix");var YL=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new ge("OrgCustomAgentService");this.fetchSequencer=new tQ;this.activated=!1;this.orgs=new Map;this.client=o.client??new QVe(e),this.resolveNwo=o.resolveNwo??(s=>C8t(s,[e.get(D0).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??B3o,this.cacheRoot=Ix.join(this.persistenceManager.directory,L3o),this.lifecycleListener=new W8t(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=F3o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${Ghn}/*${V8t}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:$hn.githubOrg}),this.tokenSubscription=Es(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>ca(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(vTe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=Ix.relative(this.cacheRoot,e);if(r.startsWith("..")||Ix.isAbsolute(r))return;let n=r.indexOf(Ix.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=Wn(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=ca(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=ca(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(qt(this.ctx,je.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await sQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${V8t}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(Ix.join(o,l),Ahn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return Ix.join(this.cacheRoot,vTe(e.owner),vTe(e.repo),Ghn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await sQ.promises.stat(e)).size===n.length&&(await sQ.promises.readFile(e)).equals(n))return}catch{}await sQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await sQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(V8t)&&!r.has(o.name))try{await sQ.promises.unlink(Ix.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=Ix.join(this.cacheRoot,vTe(e.owner),vTe(e.repo));try{await sQ.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},W8t=class extends FM{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var lA=class{static{a(this,"PromptChangeNotifier")}},oWe=class extends lA{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function Vhn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(Vhn,"createPromptFilesChangedEvent");function Whn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(Whn,"createBatchPromptFilesChangedEvent");p();var Wm=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function Lce(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(Lce,"anyEvent");var Jhn=require("os"),bTe=ce(require("path"));function Fce(t){return t.replace(/\\/g,"/")}a(Fce,"toForwardSlash");function zhn(...t){return bTe.default.posix.join(...t.map(Fce))}a(zhn,"globJoin");function Q3o(t){let e=Fce(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(Q3o,"containsTraversal");function Yhn(t,e){let r=Fce(bTe.default.posix.normalize(Fce(t))),n=Fce(bTe.default.posix.normalize(Fce(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(Yhn,"isContained");var Khn=["*","?","{","["],T_=class{constructor(e,r){this.ctx=e;this.logger=new ge("PromptFileLocationRegistry");this._onLocationsChanged=new Wm;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??Jhn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(Q3o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=Khn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=zhn(f,d.pattern.slice(2));if(!Yhn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=zhn(f,d.pattern);Yhn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of Khn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(Vhn(e,"ConfigChanged"))}};p();p();p();var z8t=ce(require("path"));function xx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=z8t.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!z8t.posix.isAbsolute(s)}a(xx,"isEqualOrParent");var bv=process.platform==="linux";function aQ(t){return t.replace(/\\/g,"/")}a(aQ,"normalizeSlashes");function cQ(t){let e=aQ(t);return bv?e:e.toLowerCase()}a(cQ,"canonicalKey");function Zhn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>bv?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&xx(h,d,bv))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(Zhn,"coalesceEvents");var aWe=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Lce(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Lce(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var KL=ce(require("fs"));var MY=new ge("NodeJSWatcherService"),q3o=1e3,cWe=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??KL.watch,this._fsWatchFile=o??{watchFile:KL.watchFile,unwatchFile:KL.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=aQ(e.path),n=cQ(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){MY.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){MY.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return KL.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?G3o(e,aQ(o)):e,c=j3o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),MY.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),MY.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){MY.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=H3o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:q3o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),MY.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){MY.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function j3o(t,e){if(t==="change")return"update";try{return KL.statSync(e),"create"}catch{return"delete"}}a(j3o,"classify");function H3o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(H3o,"classifyStat");function G3o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(G3o,"joinPosix");p();var D0n=ce(P0n()),N0n=require("os"),M0n=ce(require("path"));var fWe=new ge("ParcelWatcherService"),MFo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",OFo=process.platform==="darwin"?[M0n.join((0,N0n.homedir)(),"Library","Containers")]:[],pWe=class{constructor(e,r){this.ctx=e;this._onDidChange=new Wm;this.onDidChange=this._onDidChange.event;this._onDidError=new Wm;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??D0n.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=aQ(e.path),n=cQ(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=aQ(e),o=this._findCoveringRoot(n);if(!o)return;let s=cQ(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(xx(r.path,e,bv))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&xx(e.path,o.path,bv)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=cQ(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{fWe.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:MFo,ignore:OFo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=cQ(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=aQ(s.path);n.push({path:c,type:s.type})}let o=Zhn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=cQ(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){fWe.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(fWe.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(sa).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),fWe.warn(this.ctx,"Failed to watch for file changes at",r,e))}};var O0n=ce(require("fs"));var lQ=ce(require("path"));var BFo=100,hWe=/[*?{[]/,o6t=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!xx(e.path,this.request.path,bv)&&!xx(this.request.path,e.path,bv))return;this._tryActivate();return}e.type==="delete"&&xx(e.path,this.request.path,bv)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=lQ.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=LFo(this.request.path,this.statSync);if(n===void 0||FFo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function LFo(t,e){let r=lQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=lQ.dirname(r)}}a(LFo,"findExistingAncestor");function FFo(t,e){return lQ.dirname(e)===t?!1:t===lQ.parse(t).root}a(FFo,"isAncestorTooBroad");var mWe=class{constructor(e,r,n=O0n.statSync){this._onPromptFileChanged=new Wm;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;if(r===void 0){let o=new pWe(e),s=new cWe(e,o);this._watcher=new aWe(e,o,s),this._ownsWatcher=!0}else this._watcher=r,this._ownsWatcher=!1;this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=hWe.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new b_(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=Whn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new o6t(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!hWe.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return hWe.test(n)}_extractBaseDir(e){let r=hWe.exec(e);if(!r)return lQ.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=xx(r.path,l,bv),d=xx(l,r.path,bv);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},BFo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function U0n(t,e=[],r={}){let n=t.length===0?[]:t.split(/\r\n|\n/);return new a6t(n,e,r).parse()}a(U0n,"parse");function RTe(t,e){return{line:t,character:e}}a(RTe,"createPosition");function wx(t,e,r){return{type:"string",value:t,start:e,end:r}}a(wx,"createStringNode");function UFo(t,e,r){return{type:"number",value:t,start:e,end:r}}a(UFo,"createNumberNode");function B0n(t,e,r){return{type:"boolean",value:t,start:e,end:r}}a(B0n,"createBooleanNode");function QFo(t,e){return{type:"null",value:null,start:t,end:e}}a(QFo,"createNullNode");function L0n(t,e,r){return{type:"object",start:e,end:r,properties:t}}a(L0n,"createObjectNode");function F0n(t,e,r){return{type:"array",start:e,end:r,items:t}}a(F0n,"createArrayNode");function Q0n(t){return t===" "||t===" "}a(Q0n,"isWhitespace");function qFo(t){return/^-?\d*\.?\d+$/.test(t)}a(qFo,"isValidNumber");var s6t=class{constructor(e){this.currentLine=0;this.currentChar=0;this.lines=e}static{a(this,"YamlLexer")}getCurrentPosition(){return RTe(this.currentLine,this.currentChar)}getCurrentLineNumber(){return this.currentLine}getCurrentCharNumber(){return this.currentChar}getCurrentLineText(){return this.currentLine=this.lines.length}getCurrentChar(){return this.isAtEnd()||this.currentChar>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][this.currentChar]}peek(e=1){let r=this.currentChar+e;return this.currentLine>=this.lines.length||r>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][r]}advance(){let e=this.getCurrentChar();return this.currentChar>=this.lines[this.currentLine].length&&this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}if(this.currentLine++,this.currentChar=0,this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}}}},a6t=class{constructor(e,r,n){this.flowLevel=0;this.lexer=new s6t(e),this.errors=r,this.options=n}static{a(this,"YamlParser")}addError(e,r,n,o){this.errors.push({message:e,code:r,start:n,end:o})}parseValue(e){if(this.lexer.skipWhitespace(),this.lexer.isAtEnd()){let n=this.lexer.getCurrentPosition();return wx("",n,n)}let r=this.lexer.getCurrentChar();return r==='"'||r==="'"?this.parseQuotedString(r):r==="["?this.parseInlineArray():r==="{"?this.parseInlineObject():this.parseUnquotedValue()}parseQuotedString(e){let r=this.lexer.getCurrentPosition();this.lexer.advance();let n="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==e;)n+=this.lexer.advance();this.lexer.getCurrentChar()===e&&this.lexer.advance();let o=this.lexer.getCurrentPosition();return wx(n,r,o)}parseUnquotedValue(){let e=this.lexer.getCurrentPosition(),r="",n=e,o=a(d=>d==="#"||this.flowLevel>0&&(d===","||d==="]"||d==="}"),"isTerminator"),s=this.lexer.getCurrentChar();if(s==='"'||s==="'")for(r+=this.lexer.advance(),n=this.lexer.getCurrentPosition();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(d===s||o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}let c=r.trimEnd(),l=r.length-c.length;l&&(n=RTe(e.line,n.character-l));let u=s==='"'||s==="'"?c.substring(1):c;return this.createValueNode(u,e,n)}createValueNode(e,r,n){if(e==="")return wx("",r,r);if(e==="true")return B0n(!0,r,n);if(e==="false")return B0n(!1,r,n);if(e==="null"||e==="~")return QFo(r,n);let o=Number(e);return!isNaN(o)&&isFinite(o)&&qFo(e)?UFo(o,r,n):wx(e,r,n)}parseInlineArray(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="]"){this.lexer.advance();break}if(this.lexer.getCurrentChar()===""){this.lexer.advanceLine();continue}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.parseValue();s.type==="string"&&s.value===""&&s.start.line===s.end.line&&s.start.character===s.end.character||r.push(s);let c=this.lexer.savePosition();if(o.line===c.line&&o.char===c.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,F0n(r,e,n)}parseInlineObject(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="}"){this.lexer.advance();break}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.lexer.getCurrentPosition(),c="";if(this.lexer.getCurrentChar()==='"'||this.lexer.getCurrentChar()==="'"){let h=this.lexer.getCurrentChar();for(this.lexer.advance();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==h;)c+=this.lexer.advance();this.lexer.getCurrentChar()===h&&this.lexer.advance()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)c+=this.lexer.advance();c=c.trim();let l=this.lexer.getCurrentPosition(),u=wx(c,s,l);this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let d=this.parseValue();r.push({key:u,value:d});let f=this.lexer.savePosition();if(o.line===f.line&&o.char===f.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,L0n(r,e,n)}parseBlockArray(e){let r=this.lexer.getCurrentPosition(),n=[];for(;!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd());){let s=this.lexer.getIndentation();if(ss)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let u=this.parseBlockArray(l);n.push(u)}else{let u=this.lexer.getCurrentLineText(),d=this.lexer.getCurrentCharNumber(),f=u.substring(d);if(f.includes(":")&&!f.trim().startsWith("#")){let h=this.parseBlockObject(l,this.lexer.getCurrentCharNumber());n.push(h)}else n.push(wx("",c,c))}else n.push(wx("",c,c))}else{let l=this.lexer.getCurrentLineText(),u=this.lexer.getCurrentCharNumber();if(l.substring(u).includes(":")){let h=this.parseBlockObject(c.character,c.character);n.push(h)}else{let h=this.parseValue();for(n.push(h);!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#";)this.lexer.advance();this.lexer.advanceLine()}}}else break}let o=r;return n.length>0?o=n[n.length-1].end:o=RTe(r.line,r.character+1),F0n(n,r,o)}parseBlockObject(e,r){let n=this.lexer.getCurrentPosition(),o=[],s=new Set,c=r!==void 0,l=!0;for(;!this.lexer.isAtEnd()&&((!l||!c)&&this.lexer.moveToNextNonEmptyLine(),l=!1,!this.lexer.isAtEnd());){let d=this.lexer.getIndentation();if(c){if(this.lexer.skipWhitespace(),this.lexer.getCurrentCharNumber()e){let E=RTe(this.lexer.getCurrentLineNumber(),0),_=RTe(this.lexer.getCurrentLineNumber(),this.lexer.getCurrentLineText().length);this.addError("Unexpected indentation","indentation",E,_),this.lexer.skipWhitespace()}else this.lexer.skipWhitespace()}let f=this.lexer.getCurrentPosition(),h="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)h+=this.lexer.advance();h=h.trim();let m=this.lexer.getCurrentPosition(),g=wx(h,f,m);!this.options.allowDuplicateKeys&&s.has(h)&&this.addError(`Duplicate key '${h}'`,"duplicateKey",f,m),s.add(h),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let A,y=this.lexer.getCurrentPosition();if(this.lexer.getCurrentChar()===""||this.lexer.getCurrentChar()==="#")if(this.lexer.advanceLine(),this.lexer.isAtEnd())A=wx("",y,y);else{let E=this.lexer.getIndentation();if(E>d)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-")A=this.parseBlockArray(E);else{let _=this.lexer.getCurrentLineText(),v=this.lexer.getCurrentCharNumber(),b=_.substring(v);b.includes(":")&&!b.trim().startsWith("#")?A=this.parseBlockObject(E):A=this.parseValue()}else!c&&E===d?(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"?A=this.parseBlockArray(d):A=wx("",y,y)):A=wx("",y,y)}else{for(A=this.parseValue();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#"&&Q0n(this.lexer.getCurrentChar());)this.lexer.advance();this.lexer.getCurrentChar()==="#"&&this.lexer.skipToEndOfLine(),!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()===""&&this.lexer.advanceLine()}o.push({key:g,value:A})}let u=n;return o.length>0&&(u=o[o.length-1].value.end),L0n(o,n,u)}parse(){if(!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd()))if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let e=this.lexer.peek();return e===" "||e===" "||e===""||e==="#"?this.parseBlockArray(0):this.parseValue()}else{if(this.lexer.getCurrentChar()==="[")return this.parseInlineArray();if(this.lexer.getCurrentChar()==="{")return this.parseInlineObject();{let e=this.lexer.getCurrentLineText(),r=this.lexer.getCurrentCharNumber(),n=e.substring(r),o=!1,s=!1,c="";for(let l=0;lf>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new dP.Range(2,1,l+1,1);o=new u6t(u,n)}if(c({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new dP.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===HFo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},d6t=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;sdP.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,E=new dP.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new dP.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>dP.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();var GFo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),$Fo="agentHook.event.load",EWe=class{constructor(){this.logger=new ge("HookParser")}static{a(this,"HookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return gt(e,$Fo,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return GFo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}};var dQ="globalPromptFiles://";var j0n=["agent","skill","prompt","instructions","hook"];function H0n(t,e){return`${t}::${e}`}a(H0n,"entryKey");function VFo(t){return`${t}::`}a(VFo,"typePrefix");var zm=class{constructor(e,r,n){this.ctx=e;this.fileLocator=r;this.logger=new ge("PromptService");this.watchHandles=new Map;this.entryCache=new Map;this.parseInflight=new Map;this.parsers=new Map;this.disposed=!1;n===void 0?(this.watcher=new mWe(e),this.ownsWatcher=!0):(this.watcher=n,this.ownsWatcher=!1);let o=e.get(T_),s=new class{constructor(){this.inner=new uQ}parse(u,d,f){return this.inner.parse(d,f)}};this.parsers.set("prompt",s),this.parsers.set("instructions",s),this.parsers.set("skill",s),this.parsers.set("agent",s),this.parsers.set("hook",new EWe),this.onPromptFilesChanged=Lce(o.onLocationsChanged,this.watcher.onPromptFileChanged),this.mergedChangeSubscription=this.onPromptFilesChanged(u=>this.handleChange(u));for(let u of j0n)this.rewatch(u);this.registrySubscription=o.onLocationsChanged(u=>{for(let d of u.affectedTypes)this.rewatch(d)});let c=a(u=>{this.evictFolder(u),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends FM{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(u){c(u)}},e.get(S_).addListener(this.workspaceListener)}static{a(this,"PromptService")}async collect(e,r,n){let o=await this.fileLocator.listFiles(e,n,r);return(await Promise.all(o.map(c=>this.resolveEntry(e,r,c)))).filter(c=>c!==void 0)}async resolveEntry(e,r,n){let o=H0n(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(Fo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose();try{this.ctx.get(S_).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(Fo).readFileString(r.uri))}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(H0n(o,Ia(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(lA).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=VFo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(T_),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of j0n)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{e=this.ctx.get(cn).getWorkspaceFolders().map(o=>Wn(o.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>xx(s.normalized,o.normalized,bv))||n.push(o);return n.map(o=>o.raw)}};p();var uu=class{constructor(){this.policyChangeEmitter=new Wm;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},_We=class extends uu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var f6t=64;var JL=(r=>(r.enabled="enabled",r.disabled="disabled",r))(JL||{}),Ym={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},$f={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},BY=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,f6t),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},fQ=class extends BY{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},wr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},pQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},LY=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Or=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},hQ=class extends Or{static{a(this,"ExtendedLanguageModelToolResult")}},G0n=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),ZL=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(ZL||{}),$0n=S.Object({result:S.Enum(ZL)});var p6t=ce(require("fs"));var kTe=ce(require("path"));var WFo=["user","model"],m6t="source",g6t={githubOrg:"github-org"},$hn={githubOrg:{[m6t]:g6t.githubOrg}},h6t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri,this._name=r.name??ji(n.uri).replace(".agent.md","")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??WFo}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(g6t));for(let n of e){let o=n[m6t];if(typeof o=="string"&&r.has(o))return o}}},V0n="./assets/prompts.contributions.json",zFo="CVE Remediator",YFo="Debugger",W0n=new Map([[zFo,"cveRemediatorAgent"],[YFo,"debuggerAgent"]]),jp=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new ge("CustomAgentService");this.agentUpdateSequencer=new tQ;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}subscribeToGateChanges(){try{let e=this.ctx.get(Zo);this.lastEnableCustomAgents=qt(this.ctx,je.EnableCustomAgents),this.lastEnableOrgCustomAgents=qt(this.ctx,je.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=qt(this.ctx,je.EnableCustomAgents),n=qt(this.ctx,je.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(uu);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(Mn),r=Array.from(new Set(W0n.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(lA).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e))}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(kTe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e){if(this.ctx.get(uu).getPolicyValue("customAgent.enabled")===!1)return[];if(qt(this.ctx,je.EnableCustomAgents)===!1)return[];await this.ready;let o=(await this.ctx.get(zm).collect(this.ctx,"agent",e)).map(u=>new h6t(u)),s=this.ctx.get(YL),c=qt(this.ctx,je.EnableOrgCustomAgents)!==!1,l=this.ctx.get(Mn).getCapabilities();return o.filter(u=>{if(this.isOrgScopedAgent(u)){if(!c)return!1;let h=u.promptFileEntry?.parsedPromptFile.uri,m=h?ho(h):void 0;if(!m||!s.isCachedAgentVisibleFor(m,e))return!1}let d=W0n.get(u.name);if(d===void 0)return!0;let f=l[d]??!1;return f||this.logger.debug(this.ctx,`Filtering out agent '${u.name}' (capability '${d}' is disabled)`),f})}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[m6t]===g6t.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[Wn(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=kTe.default.extname(__filename)===".ts"?kTe.default.resolve(__dirname,"../../../..",e):kTe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(V0n),n=await p6t.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${V0n}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=wY({[A]:y}).trim();m.push(E)}}u=m.join(` +`}a(Lgn,"generateAgentMarkdown");p();p();p();p();p();p();var FTe={isBlocked:!1,reason:"VALID_FILE"},gze={isBlocked:!1,reason:"NO_MATCHING_POLICY"},Fgn={isBlocked:!0,reason:"POLICY_ERROR",message:"Copilot is disabled because we could not fetch the repository policy"},qY={all:"all",repo:"repo"},vQ=new Ae("contentExclusion");p();p();var Aze=class{static{a(this,"PolicyEvaluator")}};p();p();p();var UUt=new Ae("repository"),jY=class t{constructor(){this.data={}}static{a(this,"GitConfigData")}getKeys(){return Object.keys(this.data)}getEntries(){return Object.entries(this.data)}get(e){let r=this.getAll(e);return r?r[r.length-1]:void 0}getAll(e){return this.data[this.normalizeKey(e)]}add(e,r){e in this.data||(this.data[e]=[]),this.data[e].push(r)}getSectionValues(e,r){let n=`${e}.`.toLowerCase(),o=`.${r}`.toLowerCase();return Object.keys(this.data).filter(s=>s.startsWith(n)&&s.endsWith(o)).map(s=>s.slice(n.length,-o.length))}concat(e){return this.getEntries().concat(e.getEntries()).reduce((r,[n,o])=>(o.forEach(s=>r.add(n,s)),r),new t)}normalizeKey(e){let r=e.split(".");return r[0]=r[0].toLowerCase(),r[r.length-1]=r[r.length-1].toLowerCase(),r.join(".")}},hk=class{static{a(this,"GitConfigLoader")}},yze=class extends hk{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackConfigLoader")}async getConfig(r,n){for(let o of this.loaders){let s=await o.getConfig(r,n);if(s)return s}}};p();var Ugn=require("os");var Eze=class{constructor(e){this.url=e;this.isUrl()?this.parseUrl():this.tryParseSSHString()||(this._scheme="file")}static{a(this,"GitRemoteUrl")}get scheme(){return this._scheme}get authority(){return this._authority}get hostname(){return this._hostname}get path(){return this._path}isInvalid(){return this._error!==void 0}isRemote(){return this.scheme!=="file"&&this.hostname!==void 0}isGitHub(){return this.isRemote()&&/(?:^|\.)(?:github\.com|ghe\.com)$/i.test(this.hostname??"")}isADO(){return this.isRemote()&&/(?:^|\.)(?:visualstudio\.com|azure\.com)$/i.test(this.hostname??"")}getUrlForApi(){if(!this.isRemote())return null;if(this.isUrl()&&!this.isInvalid())return V9.from({scheme:this.scheme,authority:this.authority.replace(/^[^@]+@/,""),path:this.path}).toString();if(this.scheme=="ssh"&&this.isADO()){let e=this.url.indexOf(":");return this.url.substring(0,e+1)+this.path}return this.url}isUrl(){return/[A-Za-z0-9][A-Za-z0-9]+:\/\//.test(this.url)}parseUrl(){let e;try{e=V9.parse(this.url)}catch(r){this._error=r;return}this._scheme=e.scheme,this.setAuthority(e.authority),this.setPath(e.path)}setAuthority(e){this._authority=e;let r=e.replace(/^[^@]+@/,"").replace(/:\d*$/,"");r&&(this._hostname=r)}tryParseSSHString(){let e=/^(?[^:/\\[]*(?:\[[^/\\\]]*\])?):/.exec(this.url);if(e&&((0,Ugn.platform)()!=="win32"||(e.groups?.host?.length??0)>1)){let r=e.groups?.host??"";return this._scheme="ssh",this.setAuthority(r),this.setPath(this.url.substring(r.length+1)),!0}return!1}setPath(e){if(this.isADO())try{this._path=decodeURIComponent(e);return}catch{}this._path=e}};var _ze=class{static{a(this,"GitRemoteResolver")}async resolveRemote(e,r){let n=await e.get(hk).getConfig(e,r);if(!n)return;let o=this.getRemotes(n),s=o.filter(c=>c.url.isGitHub());if(s.length)return s.find(c=>c.name==="origin")?.url??s[0].url;if(o.length)return o.find(c=>c.name==="origin")?.url??o[0].url}getRemotes(e){let r=this.getInsteadOfRules(e);return e.getSectionValues("remote","url").map(n=>({name:n,url:new Eze(this.applyInsteadOfRules(r,e.get(`remote.${n}.url`)??""))})).filter(n=>n.url.isRemote())}applyInsteadOfRules(e,r){for(let n of e)if(r.startsWith(n.insteadOf))return n.base+r.slice(n.insteadOf.length);return r}getInsteadOfRules(e){return e.getSectionValues("url","insteadof").map(r=>({base:r,insteadOf:e.get(`url.${r}.insteadof`)})).sort((r,n)=>n.base.length-r.base.length)}};var nUo=100,QUt=class{constructor(e,r){this.baseFolder=e;this.remote=r;this.setNWO()}static{a(this,"GitRepository")}get tenant(){return this._tenant}get owner(){return this._owner}get name(){return this._name}get adoOrganization(){return this._adoOrganization}isGitHub(){return this.remote?.isGitHub()??!1}isADO(){return this.remote?.isADO()??!1}setNWO(){let e=this.remote?.path?.replace(/^\//,"").split("/");if(this.isGitHub()){this._owner=e?.[0],this._name=e?.[1]?.replace(/\.git$/,"");let r=/^(?[^.]+)\.ghe\.com$/.exec(this.remote?.hostname??"");r&&(this._tenant=r.groups?.tenant)}else if(this.isADO()&&e?.length===4){if(this.remote?.scheme==="ssh"){this._adoOrganization=e?.[1],this._owner=e?.[2],this._name=e?.[3];return}let r=/(?:(?[^.]+)\.)?visualstudio\.com$/.exec(this.remote?.hostname??"");r?(this._adoOrganization=r.groups?.org,this._owner=e?.[1],this._name=e?.[3]):(this._adoOrganization=e?.[0],this._owner=e?.[1],this._name=e?.[3])}}},z0=class t{constructor(e){this.ctx=e;this.remoteResolver=new _ze;this.cache=new yn(nUo)}static{a(this,"RepositoryManager")}async getRepo({uri:e}){let r,n=[];do{if(this.cache.has(e.toString())){let s=this.cache.get(e);return this.updateCache(n,s),s}n.push(e.toString());let o=await this.tryGetRepoForFolder(e);if(o)return this.updateCache(n,o),o;r=e,e=Xd(e)}while(e!==r);this.updateCache(n,void 0)}updateCache(e,r){e.forEach(n=>this.cache.set(n,r))}async tryGetRepoForFolder(e){return await this.isBaseRepoFolder(e)?new QUt(typeof e=="string"?{uri:e}:e,await this.repoUrl(e)):void 0}async isBaseRepoFolder(e){return await t.getRepoConfigLocation(this.ctx,e)!==void 0}async repoUrl(e){return await this.remoteResolver.resolveRemote(this.ctx,e)}static async getRepoConfigLocation(e,r){try{let n=e.get(jo),o=Sa(r,".git");if((await n.stat(o)).type&1)return await this.getConfigLocationForGitfile(n,r,o);let c=Sa(o,"config");return await n.stat(c),c}catch{return}}static async getConfigLocationForGitfile(e,r,n){let s=(await e.readFileString(n)).match(/^gitdir:\s+(.+)$/m);if(!s)return;let c=ZV(r,s[1]),l=Sa(c,"config");if(await this.tryStat(e,l)!==void 0)return l;let u=Sa(c,"config.worktree");if(await this.tryStat(e,u)!==void 0)return u;let d=Sa(c,"commondir");c=ZV(c,(await e.readFileString(d)).trimEnd());let f=Sa(c,"config");return await e.stat(f),f}static async tryStat(e,r){try{return await e.stat(r)}catch{return}}};p();var HY=a((t,e)=>{if(bM.Check(t,e))return e;let r=`Typebox schema validation failed: +${[...bM.Errors(t,e)].map(n=>`${n.path} ${n.message}`).join(` +`)}`;throw new Error(r)},"assertShape");p();p();p();var vze=new WeakMap;function Cze(t,e){if(t==null||typeof t!="object")return String(t);let r,n="",o=0,s=Object.prototype.toString.call(t);if(s!=="[object RegExp]"&&s!=="[object Date]"&&vze.has(t))return vze.get(t);switch(vze.set(t,"~"+ ++e),s){case"[object Set]":r=Array.from(t);case"[object Array]":for(r||(r=t),n+="a";oe.delete(n))),o}a(iUo,"n");function jgn(t,e){return function(r,n){return iUo(t,e,r,n)}}a(jgn,"o");p();p();p();var jUt=a((t,e,r)=>{let n=t instanceof RegExp?Hgn(t,r):t,o=e instanceof RegExp?Hgn(e,r):e,s=n!==null&&o!=null&&oUo(n,o,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+o.length)}},"balanced"),Hgn=a((t,e)=>{let r=e.match(t);return r?r[0]:null},"maybeMatch"),oUo=a((t,e,r)=>{let n,o,s,c,l,u=r.indexOf(t),d=r.indexOf(e,u+1),f=u;if(u>=0&&d>0){if(t===e)return[u,d];for(n=[],s=r.length;f>=0&&!l;){if(f===u)n.push(f),u=r.indexOf(t,f+1);else if(n.length===1){let h=n.pop();h!==void 0&&(l=[h,d])}else o=n.pop(),o!==void 0&&o=0?u:d}n.length&&c!==void 0&&(l=[s,c])}return l},"range");var Ggn="\0SLASH"+Math.random()+"\0",$gn="\0OPEN"+Math.random()+"\0",GUt="\0CLOSE"+Math.random()+"\0",Vgn="\0COMMA"+Math.random()+"\0",Wgn="\0PERIOD"+Math.random()+"\0",sUo=new RegExp(Ggn,"g"),aUo=new RegExp($gn,"g"),cUo=new RegExp(GUt,"g"),lUo=new RegExp(Vgn,"g"),uUo=new RegExp(Wgn,"g"),dUo=/\\\\/g,fUo=/\\{/g,pUo=/\\}/g,hUo=/\\,/g,mUo=/\\\./g,gUo=1e5;function HUt(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}a(HUt,"numeric");function AUo(t){return t.replace(dUo,Ggn).replace(fUo,$gn).replace(pUo,GUt).replace(hUo,Vgn).replace(mUo,Wgn)}a(AUo,"escapeBraces");function yUo(t){return t.replace(sUo,"\\").replace(aUo,"{").replace(cUo,"}").replace(lUo,",").replace(uUo,".")}a(yUo,"unescapeBraces");function zgn(t){if(!t)return[""];let e=[],r=jUt("{","}",t);if(!r)return t.split(",");let{pre:n,body:o,post:s}=r,c=n.split(",");c[c.length-1]+="{"+o+"}";let l=zgn(s);return s.length&&(c[c.length-1]+=l.shift(),c.push.apply(c,l)),e.push.apply(e,c),e}a(zgn,"parseCommaParts");function Ygn(t,e={}){if(!t)return[];let{max:r=gUo}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),UTe(AUo(t),r,!0).map(yUo)}a(Ygn,"expand");function EUo(t){return"{"+t+"}"}a(EUo,"embrace");function _Uo(t){return/^-?0\d/.test(t)}a(_Uo,"isPadded");function vUo(t,e){return t<=e}a(vUo,"lte");function CUo(t,e){return t>=e}a(CUo,"gte");function UTe(t,e,r){let n=[],o=jUt("{","}",t);if(!o)return[t];let s=o.pre,c=o.post.length?UTe(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(let l=0;l=0;if(!d&&!f)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+GUt+o.post,UTe(t,e,!0)):[t];let h;if(d)h=o.body.split(/\.\./);else if(h=zgn(o.body),h.length===1&&h[0]!==void 0&&(h=UTe(h[0],e,!1).map(EUo),h.length===1))return c.map(g=>o.pre+h[0]+g);let m;if(d&&h[0]!==void 0&&h[1]!==void 0){let g=HUt(h[0]),A=HUt(h[1]),y=Math.max(h[0].length,h[1].length),E=h.length===3&&h[2]!==void 0?Math.max(Math.abs(HUt(h[2])),1):1,_=vUo;A0){let x=new Array(R+1).join("0");T<0?w="-"+x+w.slice(1):w=x+w}}m.push(w)}}else{m=[];for(let g=0;g{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");p();p();var bUo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},qTe=a(t=>t.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),SUo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),Kgn=a(t=>t.join(""),"rangesToString"),Jgn=a((t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],o=[],s=r+1,c=!1,l=!1,u=!1,d=!1,f=r,h="";e:for(;sh?n.push(qTe(h)+"-"+qTe(y)):y===h&&n.push(qTe(y)),h="",s++;continue}if(t.startsWith("-]",s+1)){n.push(qTe(y+"-")),s+=2;continue}if(t.startsWith("-",s+1)){h=y,s+=2;continue}n.push(qTe(y)),s++}if(fr?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var SC,TUo=new Set(["!","?","+","*","@"]),$Ut=a(t=>TUo.has(t),"isExtglobType"),Zgn=a(t=>$Ut(t.type),"isExtglobAST"),IUo=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),xUo=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),wUo=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Xgn=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),RUo="(?!(?:^|/)\\.\\.?(?:$|/))",Sze="(?!\\.)",PUo=new Set(["[","."]),kUo=new Set(["..","."]),DUo=new Set("().*{}+?[]^$\\!"),NUo=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),VUt="[^/]",eAn=VUt+"*?",tAn=VUt+"+?",MUo=0,GY=class{static{a(this,"AST")}type;#e;#t;#r=!1;#n=[];#i;#o;#s;#a=!1;#c;#u;#l=!1;id=++MUo;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#n.length,parts:this.#n}}constructor(e,r,n={}){this.type=e,e&&(this.#t=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#s=this.#e===this?[]:this.#e.#s,e==="!"&&!this.#e.#a&&this.#s.push(this),this.#o=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#u!==void 0?this.#u:this.type?this.#u=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#u=this.#n.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#s.pop();){if(e.type!=="!")continue;let r=e,n=r.#i;for(;n;){for(let o=r.#o+1;!n.type&&otypeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let e=this.#i;for(let r=0;rtypeof g!="string"),d=this.#n.map(g=>{let[A,y,E,_]=typeof g=="string"?SC.#P(g,this.#t,u):g.toRegExpSource(e);return this.#t=this.#t||E,this.#r=this.#r||_,A}).join(""),f="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&kUo.has(this.#n[0]))){let A=PUo,y=r&&A.has(d.charAt(0))||d.startsWith("\\.")&&A.has(d.charAt(2))||d.startsWith("\\.\\.")&&A.has(d.charAt(4)),E=!r&&!e&&A.has(d.charAt(0));f=y?RUo:E?Sze:""}let h="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(h="(?:$|\\/)"),[f+d+h,mk(d),this.#t=!!this.#t,this.#r]}let n=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#y(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString(),d=this;return d.#n=[u],d.type=null,d.#t=void 0,[u,mk(this.toString()),!1,!1]}let c=!n||e||r||!Sze?"":this.#y(!0);c===s&&(c=""),c&&(s=`(?:${s})(?:${c})*?`);let l="";if(this.type==="!"&&this.#l)l=(this.isStart()&&!r?Sze:"")+tAn;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Sze:"")+eAn+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?")?":`)${this.type}`;l=o+s+u}return[l,mk(s),this.#t=!!this.#t,this.#r]}#S(){if(Zgn(this)){let e=0,r=!1;do{r=!0;for(let n=0;n{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,o,s,c]=r.toRegExpSource(e);return this.#r=this.#r||c,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#P(e,r,n=!1){let o=!1,s="",c=!1,l=!1;for(let u=0;ur?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var uf=a((t,e,r={})=>(QTe(e),!r.nocomment&&e.charAt(0)==="#"?!1:new b_(e,r).match(t)),"minimatch"),OUo=/^\*+([^+@!?*[(]*)$/,BUo=a(t=>e=>!e.startsWith(".")&&e.endsWith(t),"starDotExtTest"),LUo=a(t=>e=>e.endsWith(t),"starDotExtTestDot"),FUo=a(t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),"starDotExtTestNocase"),UUo=a(t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),"starDotExtTestNocaseDot"),QUo=/^\*+\.\*+$/,qUo=a(t=>!t.startsWith(".")&&t.includes("."),"starDotStarTest"),jUo=a(t=>t!=="."&&t!==".."&&t.includes("."),"starDotStarTestDot"),HUo=/^\.\*+$/,GUo=a(t=>t!=="."&&t!==".."&&t.startsWith("."),"dotStarTest"),$Uo=/^\*+$/,VUo=a(t=>t.length!==0&&!t.startsWith("."),"starTest"),WUo=a(t=>t.length!==0&&t!=="."&&t!=="..","starTestDot"),zUo=/^\?+([^+@!?*[(]*)?$/,YUo=a(([t,e=""])=>{let r=iAn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocase"),KUo=a(([t,e=""])=>{let r=oAn([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},"qmarksTestNocaseDot"),JUo=a(([t,e=""])=>{let r=oAn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTestDot"),ZUo=a(([t,e=""])=>{let r=iAn([t]);return e?n=>r(n)&&n.endsWith(e):r},"qmarksTest"),iAn=a(([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},"qmarksTestNoExt"),oAn=a(([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),sAn=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",rAn={win32:{sep:"\\"},posix:{sep:"/"}},XUo=sAn==="win32"?rAn.win32.sep:rAn.posix.sep;uf.sep=XUo;var jp=Symbol("globstar **");uf.GLOBSTAR=jp;var e7o="[^/]",t7o=e7o+"*?",r7o="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",n7o="(?:(?!(?:\\/|^)\\.).)*?",i7o=a((t,e={})=>r=>uf(r,t,e),"filter");uf.filter=i7o;var Ix=a((t,e={})=>Object.assign({},t,e),"ext"),o7o=a(t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return uf;let e=uf;return Object.assign(a((n,o,s={})=>e(n,o,Ix(t,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(o,s={}){super(o,Ix(t,s))}static defaults(o){return e.defaults(Ix(t,o)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(o,s,c={}){super(o,s,Ix(t,c))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Ix(t,s))}},unescape:a((n,o={})=>e.unescape(n,Ix(t,o)),"unescape"),escape:a((n,o={})=>e.escape(n,Ix(t,o)),"escape"),filter:a((n,o={})=>e.filter(n,Ix(t,o)),"filter"),defaults:a(n=>e.defaults(Ix(t,n)),"defaults"),makeRe:a((n,o={})=>e.makeRe(n,Ix(t,o)),"makeRe"),braceExpand:a((n,o={})=>e.braceExpand(n,Ix(t,o)),"braceExpand"),match:a((n,o,s={})=>e.match(n,o,Ix(t,s)),"match"),sep:e.sep,GLOBSTAR:jp})},"defaults");uf.defaults=o7o;var aAn=a((t,e={})=>(QTe(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Ygn(t,{max:e.braceExpandMax})),"braceExpand");uf.braceExpand=aAn;var s7o=a((t,e={})=>new b_(t,e).makeRe(),"makeRe");uf.makeRe=s7o;var a7o=a((t,e,r={})=>{let n=new b_(e,r);return t=t.filter(o=>n.match(o)),n.options.nonull&&!t.length&&t.push(e),t},"match");uf.match=a7o;var nAn=/[?*]|[+@!]\(.*?\)|\[|\]/,c7o=a(t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),b_=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){QTe(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||sAn,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,c,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!nAn.test(s[2]))&&!nAn.test(s[3]),d=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(d)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let o=n;for(;r[o+1]==="**";)o++;o!==n&&r.splice(n,o-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,o)=>{let s=n[n.length-1];return o==="**"&&s==="**"?n:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(o),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let o=1;oo&&n.splice(o+1,c-o);let l=n[o+1],u=n[o+2],d=n[o+3];if(l!==".."||!u||u==="."||u===".."||!d||d==="."||d==="..")continue;r=!0,n.splice(o,1);let f=n.slice(0);f[o]="**",e.push(f),o--}if(!this.preserveMultipleSlashes){for(let c=1;cr.length)}partsMatch(e,r,n=!1){let o=0,s=0,c=[],l="";for(;o=2&&(e=this.levelTwoFileOptimize(e)),r.includes(jp)?this.#e(e,r,n,o,s):this.#r(e,r,n,o,s)}#e(e,r,n,o,s){let c=r.indexOf(jp,s),l=r.lastIndexOf(jp),[u,d,f]=n?[r.slice(s,c),r.slice(c+1),[]]:[r.slice(s,c),r.slice(c+1,l),r.slice(l+1)];if(u.length){let v=e.slice(o,o+u.length);if(!this.#r(v,u,n,0,0))return!1;o+=u.length,s+=u.length}let h=0;if(f.length){if(f.length+o>e.length)return!1;let v=e.length-f.length;if(this.#r(e,f,n,v,0))h=f.length;else{if(e[e.length-1]!==""||o+f.length===e.length||(v--,!this.#r(e,f,n,v,0)))return!1;h=f.length+1}}if(!d.length){let v=!!h;for(let b=o;b{let d=u.map(h=>{if(h instanceof RegExp)for(let m of h.flags.split(""))o.add(m);return typeof h=="string"?c7o(h):h===jp?jp:h._src});d.forEach((h,m)=>{let g=d[m+1],A=d[m-1];h!==jp||A===jp||(A===void 0?g!==void 0&&g!==jp?d[m+1]="(?:\\/|"+n+"\\/)?"+g:d[m]=n:g===void 0?d[m-1]=A+"(?:\\/|\\/"+n+")?":g!==jp&&(d[m-1]=A+"(?:\\/|\\/"+n+"\\/)"+g,d[m+1]=jp))});let f=d.filter(h=>h!==jp);if(this.partial&&f.length>=1){let h=[];for(let m=1;m<=f.length;m++)h.push(f.slice(0,m).join("/"));return"(?:"+h.join("|")+")"}return f.join("/")}).join("|"),[c,l]=e.length>1?["(?:",")"]:["",""];s="^"+c+s+l+"$",this.partial&&(s="^(?:\\/|"+c+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let c=o[o.length-1];if(!c)for(let l=o.length-2;!c&&l>=0;l--)c=o[l];for(let l of s){let u=o;if(n.matchBase&&l.length===1&&(u=[c]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return uf.defaults(e).Minimatch}};uf.AST=GY;uf.Minimatch=b_;uf.escape=zce;uf.unescape=mk;var WUt="contentExclusion",Tze=class extends Aze{static{a(this,"CopilotContentExclusion")}#e;#t=new yn(1e4);#r=new yn(200);constructor(e){super(),this.#e=e}async evaluate(e,r){try{e=ZV(e).toString();let n=await this.getGitRepo({uri:e}),o=await this.#n(n?.url??qY.all);if(!o)return gze;let s=n?.baseFolder?.uri??"file://",c=this.evaluateFilePathRules(e,s,o);if(c.isBlocked)return c;let l=this.evaluateTextBasedRules(e,o,r);if(l.isBlocked)return l}catch(n){return vQ.exception(this.#e,n,`${WUt}.evaluate`),Fgn}return FTe}evaluateFilePathRules(e,r,n){let o=e;if(this.#t.has(o))return this.#t.get(o);let s=FTe,c,l=ekt(e.replace(r,""));e:for(let u of n)for(let d of u.paths)if(uf(l,d,{nocase:!0,matchBase:!0,nonegate:!0,dot:!0})){s=zUt(u,"FILE_BLOCKED_PATH"),c=d;break e}return vQ.debug(this.#e,`Evaluated path-based exclusion rules for <${e}>`,{result:s,baseUri:r,fileName:l,matchingPattern:c}),this.#t.set(o,s),s}evaluateTextBasedRules(e,r,n){let o=r.filter(l=>l.ifAnyMatch),s=r.filter(l=>l.ifNoneMatch);if(!n||o.length===0&&s.length===0)return FTe;let c=this.evaluateFileContent(o,s,n);return vQ.debug(this.#e,`Evaluated text-based exclusion rules for <${e}>`,{result:c}),c}evaluateFileContent(e,r,n){for(let o of e)if(o.ifAnyMatch&&o.ifAnyMatch.length>0&&o.ifAnyMatch.map(c=>cAn(c)).some(c=>c.test(n)))return zUt(o,"FILE_BLOCKED_TEXT_BASED");for(let o of r)if(o.ifNoneMatch&&o.ifNoneMatch.length>0&&!o.ifNoneMatch.map(c=>cAn(c)).some(c=>c.test(n)))return zUt(o,"FILE_BLOCKED_TEXT_BASED");return FTe}async refresh(){try{let e=[...this.#r.keys()];this.reset(),await Promise.all(e.map(r=>this.#o(r)))}catch(e){La(this.#e,e,`${WUt}.refresh`)}}reset(){this.#r.clear(),this.#t.clear()}async#n(e){if(this.#i?.length)return this.#i;let r=await this.#o(e.toLowerCase());if(r.length!==0)return r}#i;setTestingRules(e){this.#i=e}#o=jgn(async e=>{let r=await this.#e.get(Ut).getGitHubSession();if(!r)throw new gi("No token found");let n=new URL("copilot_internal/content_exclusion",r.apiUrl),o=e.includes(qY.all);e.filter(u=>u!==qY.all).length>0&&n.searchParams.set("repos",e.filter(u=>u!==qY.all).join(",")),n.searchParams.set("scope",o?qY.all:qY.repo);let c=await Lf(this.#e,r,n.href),l=await c.json();if(!c.ok){if(c.status===404)return Array.from(e,()=>[]);throw this.#s("fetch.error",{message:l.message}),new wN(c)}return this.#s("fetch.success"),HY(f7o,l).map(u=>u.rules)},this.#r);async getGitRepo(e){let n=await this.#e.get(z0).getRepo(Xd(e));if(!n||!n?.remote)return;let o=n.remote.getUrlForApi();if(o)return{baseFolder:n.baseFolder,url:o}}#s(e,r,n){yt(this.#e,`${WUt}.${e}`,Vt.createAndMarkAsIssued(r,n))}};function cAn(t){if(!t.startsWith("/")&&!t.endsWith("/"))return new RegExp(t);let e=t.slice(1,t.lastIndexOf("/")),r=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,r)}a(cAn,"stringToRegex");function zUt(t,e){return{isBlocked:!0,message:`Your ${t.source.type.toLowerCase()} '${t.source.name}' has disabled Copilot for this file`,reason:e}}a(zUt,"fileBlockedEvaluationResult");var l7o=S.Object({name:S.String(),type:S.String()}),u7o=S.Object({paths:S.Array(S.String()),ifNoneMatch:S.Optional(S.Array(S.String())),ifAnyMatch:S.Optional(S.Array(S.String())),source:l7o}),YUt=S.Array(u7o),d7o=S.Object({rules:YUt,last_updated_at:S.String(),scope:S.String()}),f7o=S.Array(d7o);var ec=class{constructor(e){this.ctx=e;this.#e=!1;this.#t=new Tze(this.ctx);this.evaluateResultCache=new Map;this.onDidChangeActiveTextEditor=a(async e=>{if(!this.#e)return;if(!e.document){this.updateStatusIcon(!1);return}let r=await this.ctx.get(an).getTextDocumentValidation(e.document),n=r.status==="invalid",o=r.status==="invalid"?r.reason:void 0;this.updateStatusIcon(n,o)},"onDidChangeActiveTextEditor");let r=Nm(this.ctx,this.onDidChangeActiveTextEditor,"Content exclusions focus change");this.ctx.get(an).onDidFocusTextDocument(r),ys(this.ctx,n=>{this.#e=n.envelope.copilotignore_enabled??!1,this.evaluateResultCache.clear(),this.#t.refresh()})}static{a(this,"CopilotContentExclusionManager")}#e;#t;get enabled(){return this.#e}async evaluate(e,r,n){if(!this.#e)return{isBlocked:!1};let o=[],s=a(async(u,d)=>{let f=performance.now(),h=await d.evaluate(e,r),m=performance.now();return o.push({key:u,result:h,elapsedMs:Math.round(m-f)}),h},"track"),l=(await Promise.all([s("contentExclusion.evaluate",this.#t)])).find(u=>u?.isBlocked)??{isBlocked:!1};try{for(let u of o)this.#r(u.key,e,u.result,u.elapsedMs)}catch(u){vQ.error(this.ctx,"Error tracking telemetry",u)}return n==="UPDATE"&&this.updateStatusIcon(l.isBlocked,l.message),l}updateStatusIcon(e,r){this.#e&&(e?this.ctx.get(ss).setClsInactive(r??"Copilot is disabled"):this.ctx.get(ss).clearClsInactive())}#r(e,r,n,o){let s=r+e;if(this.evaluateResultCache.get(s)===n.reason)return!1;if(this.evaluateResultCache.set(s,n.reason??"UNKNOWN"),n.reason===gze.reason)return vQ.debug(this.ctx,`[${e}] No matching policy for this repository. uri: ${r}`),!1;let l={isBlocked:n.isBlocked?"true":"false",reason:n.reason??"UNKNOWN"},u={contentExclusionEvalMs:o};return yt(this.ctx,e,Vt.createAndMarkAsIssued(l,u)),yt(this.ctx,e,Vt.createAndMarkAsIssued({...l,path:r},u),1),vQ.debug(this.ctx,`[${e}] ${r}`,n),!0}setTestingRules(e){this.#t.setTestingRules(e)}set __contentExclusions(e){this.#t=e}get __contentExclusions(){return this.#t}};async function Yce(t,e,r){let n=await t.get(ec).evaluate(e.uri,r);return n.isBlocked?{status:"invalid",reason:n.message??"Document is blocked by repository policy"}:{status:"valid"}}a(Yce,"isDocumentValid");var an=class{constructor(e,r=Yce){this.ctx=e;this.validateTextDocument=r}static{a(this,"TextDocumentManager")}async textDocuments(){let e=this.getTextDocumentsUnsafe(),r=[];for(let n of e)(await this.validateTextDocument(this.ctx,n,n.getText())).status==="valid"&&r.push(n);return r}getTextDocumentUnsafe(e){let r=ia(e.uri);return this.getTextDocumentsUnsafe().find(n=>n.uri===r)}async getTextDocument(e){return this.getTextDocumentWithValidation(e).then(r=>{if(r.status==="valid")return r.document})}async getTextDocumentValidation(e){try{let r=this.getTextDocumentUnsafe(e)?.getText()??await this.readTextDocumentFromDisk(e.uri);return r===void 0?this.notFoundResult(e):this.validateTextDocument(this.ctx,e,r)}catch{return this.notFoundResult(e)}}async getTextDocumentWithValidation(e){let r=this.getTextDocumentUnsafe(e);if(!r)return this.notFoundResult(e);let n=await this.validateTextDocument(this.ctx,e,r.getText());return n.status==="valid"?{status:"valid",document:r}:n}notFoundResult({uri:e}){return{status:"notfound",message:`Document for URI could not be found: ${e}`}}async readTextDocumentFromDisk(e){try{if((await this.ctx.get(jo).stat(e)).size>5*1024*1024)return}catch{return}return await this.ctx.get(jo).readFileString(e)}getWorkspaceFolder(e){let r=ia(e.uri);return this.getWorkspaceFolders().find(n=>r.startsWith(ia(n.uri)))}getRelativePath(e){if(e.uri.startsWith("untitled:"))return;let r=ia(e.uri);for(let n of this.getWorkspaceFolders()){let o=ia(n.uri).replace(/[#?].*/,"").replace(/\/?$/,"/");if(r.startsWith(o))return r.slice(o.length)}return Ki(r)}};p();p();var ot=new Ae("chat");p();var Ize=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.emitter=new no;this.onFileChange=this.emitter.event;this.status="created",this.startWatching()}static{a(this,"WorkspaceWatcher")}emitFilesCreated(e){this.emitter.fire({type:"create",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesUpdated(e){this.emitter.fire({type:"update",documents:e,workspaceFolder:this.workspaceFolder})}emitFilesDeleted(e){this.emitter.fire({type:"delete",documents:e,workspaceFolder:this.workspaceFolder})}};var xx=class{constructor(e){this.ctx=e;this.watchers=new yn(25)}static{a(this,"WorkspaceWatcherProvider")}getWatcher(e){let r=this.watchers.get(e.uri);if(r)return r;let n=this.getParentFolder(e.uri);return n?this.watchers.get(n):void 0}getParentFolder(e){return[...this.watchers.keys()].find(n=>{let o=n.replace(/[#?].*/,"").replace(/\/?$/,"/");return e!==n&&e.startsWith(o)})}hasWatcher(e){return this.getParentFolder(e.uri)||this.getWatcher(e)!==void 0}startWatching(e){if(ot.debug(this.ctx,`WorkspaceWatcherProvider - Start watching workspace ${e.uri}`),this.hasWatcher(e)){this.getWatcher(e)?.startWatching();return}let r=this.createWatcher(e);this.watchers.set(e.uri,r)}stopWatching(e){this.getWatcher(e)?.stopWatching()}terminateSubfolderWatchers(e){let r=[];for(let s of this.watchers.values())r.push(s.workspaceFolder);let n=e.uri.replace(/[#?].*/,"").replace(/\/?$/,"/"),o=r.filter(s=>s.uri!==e.uri&&s.uri.startsWith(n));for(let s of o)this.terminateWatching(s);return o}terminateWatching(e){if(this.getWatcher(e)?.status!=="stopped")return this.stopWatching(e),this.watchers.delete(e.uri);this.watchers.delete(e.uri)}onFileChange(e,r,n,o){return this.getWatcher(e)?.onFileChange(Nm(this.ctx,r,"WorkspaceWatcherProvider.onFileChange"),n,o)}async getWatchedFiles(e){return await this.getWatcher(e)?.getWatchedFiles()??[]}async getWatchedFileUris(e){return await this.getWatcher(e)?.getWatchedFileUris()??[]}getStatus(e){return this.getWatcher(e)?.status}};var CQ=class{static{a(this,"WorkspaceLifecycleListener")}start(){}didAddWorkspace(e){}didRemoveWorkspace(e){}didTerminateWorkspaceSubfolders(e,r){}didChangeFiles(e){}},p7o="workspaceLifecycleManager",$y=new Ae(p7o),CS=class t{constructor(e){this.ctx=e;this.activeListeners=[];this.watchedWorkspaces=[];this.ctx=e;let r=ys(e,async()=>{r.dispose(),await this.start()})}static{a(this,"WorkspaceLifecycleManager")}async start(){for(let e of this.activeListeners)await e.isEnabled()?e.isStarted()?$y.debug(this.ctx,`listener ${e.constructor.name} is already started`):($y.debug(this.ctx,`starting listener ${e.constructor.name}`),await e.start()):$y.debug(this.ctx,`listener ${e.constructor.name} is not enabled`);$y.debug(this.ctx,"WorkspaceLifecycleManager started"),this.ctx.get(an).onDidChangeWorkspaceFolders(e=>{this.onWorkspacesAdded(e.added,this.ctx),this.onWorkspacesRemoved(e.removed,this.ctx)}),await this.onWorkspacesAdded(this.ctx.get(an).getWorkspaceFolders(),this.ctx)}static isSubfolder(e,r){let n=e.uri,o=r.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return n!==o&&n.startsWith(o)}async onWorkspacesAdded(e,r){if(!e.length){$y.debug(r,"No workspaces to add.");return}$y.debug(r,`Adding workspaces: ${e.map(l=>l.uri).join(", ")}`);let n=[...this.watchedWorkspaces,...e];$y.debug(r,`Combined workspaces: ${n.map(l=>l.uri).join(", ")}`);let o=n.filter((l,u,d)=>d.findIndex(f=>f.uri===l.uri)===u&&!d.some(f=>t.isSubfolder(l,f)));$y.debug(r,`Filtered workspaces: ${o.map(l=>l.uri).join(", ")}`);let s=o.filter(l=>!this.watchedWorkspaces.some(u=>u.uri===l.uri));$y.debug(r,`New workspaces: ${s.map(l=>l.uri).join(", ")}`);let c=this.watchedWorkspaces.filter(l=>!o.some(u=>u.uri===l.uri));$y.debug(r,`Removed workspaces: ${c.map(l=>l.uri).join(", ")}`),this.watchedWorkspaces=o;for(let l of c){$y.debug(r,`Terminating watching for removed workspace: ${l.uri}`),r.get(xx).terminateWatching(l);for(let d of this.activeListeners)$y.debug(r,`Notifying listener of removed workspace: ${l.uri}`),await d.didRemoveWorkspace(l)}for(let l of s){if(!l.uri)continue;$y.debug(r,`Starting to watch new workspace: ${l.uri}`);let u=r.get(xx);if(u.shouldStartWatching(l)){u.startWatching(l);let d=u.terminateSubfolderWatchers(l);if(d.length){$y.debug(r,`Terminated subfolder watchers for workspace: ${l.uri}, Subfolders: ${d.map(f=>f.uri).join(", ")}`);for(let f of this.activeListeners)await f.didTerminateWorkspaceSubfolders(l,d)}for(let f of this.activeListeners)$y.debug(r,`Adding file change listener for workspace: ${l.uri}`),u.onFileChange(l,f.didChangeFiles.bind(f))}}for(let l of this.activeListeners)for(let u of s)$y.debug(r,`Notifying ${l.constructor.name} of added workspace: ${u.uri}`),await l.didAddWorkspace(u)}async onWorkspacesRemoved(e,r){if(e.length)for(let n of e){if(!n.uri)continue;r.get(xx).terminateWatching(n),this.watchedWorkspaces=this.watchedWorkspaces.filter(s=>s.uri!==n.uri);for(let s of this.activeListeners)await s.didRemoveWorkspace(n)}}addListener(e){this.activeListeners.push(e)}removeListener(e){this.activeListeners=this.activeListeners.filter(r=>r!==e)}removeAllListeners(){this.activeListeners=[]}};function xze(t){t.set(CS,new CS(t))}a(xze,"setupWorkspaceLifecycleListener");var bQ=fe(require("fs")),wx=fe(require("path"));var KUt=".agent.md",h7o=300*1e3,m7o="github",uAn="agents";function jTe(t){return t.replace(/[^a-z0-9_-]/gi,"_").toLowerCase()}a(jTe,"sanitizeSegment");function g7o(t){return t.replace(/\\/g,"/")}a(g7o,"toPosix");var n3=class{constructor(e,r,n,o={}){this.ctx=e;this.registry=r;this.persistenceManager=n;this.logger=new Ae("OrgCustomAgentService");this.fetchSequencer=new qM;this.activated=!1;this.orgs=new Map;this.client=o.client??new mze(e),this.resolveNwo=o.resolveNwo??(s=>LUt(s,[e.get(N0).getAuthAuthority()])),this.refreshIntervalMs=o.refreshIntervalMs??h7o,this.cacheRoot=wx.join(this.persistenceManager.directory,m7o),this.lifecycleListener=new JUt(this)}static{a(this,"OrgCustomAgentService")}activate(){if(this.activated)return;this.activated=!0;let e=g7o(this.cacheRoot),n=`${e.endsWith("/")?e.slice(0,-1):e}/*/*/${uAn}/*${KUt}`;this.registration=this.registry.register("agent",[n],{watchable:!0,cacheable:!0,metadata:dAn.githubOrg}),this.tokenSubscription=ys(this.ctx,()=>{this.refreshAll()}),this.refreshIntervalMs>0&&(this.refreshTimer=setInterval(()=>{this.refreshAll()},this.refreshIntervalMs),this.refreshTimer.unref?.())}async dispose(){this.refreshTimer&&(clearInterval(this.refreshTimer),this.refreshTimer=void 0),this.tokenSubscription?.dispose(),this.tokenSubscription=void 0,this.registration?.dispose(),this.registration=void 0,this.activated=!1,await this.fetchSequencer.drain()}async refreshAll(){let e=Array.from(this.orgs.entries()).map(([r,n])=>this.fetchSequencer.queue(r,()=>this.fetchAndCacheOrg(r,n.probeNwo)));await Promise.all(e)}visibleOwnersForWorkspaces(e){let r=new Set(e.map(o=>ia(o.uri))),n=new Set;for(let o of this.orgs.values())for(let s of r)if(o.workspaces.has(s)){n.add(jTe(o.probeNwo.owner));break}return n}isCachedAgentVisibleFor(e,r){let n=this.extractOwnerFromPath(e);return n===void 0?!0:this.visibleOwnersForWorkspaces(r).has(n)}extractOwnerFromPath(e){let r=wx.relative(this.cacheRoot,e);if(r.startsWith("..")||wx.isAbsolute(r))return;let n=r.indexOf(wx.sep);if(!(n<=0))return r.slice(0,n)}_isActivated(){return this.activated}async _handleWorkspaceAdded(e){await this.onWorkspaceAdded(e)}async _handleWorkspaceRemoved(e){await this.onWorkspaceRemoved(e)}async onWorkspaceAdded(e){if(!e?.uri)return;let r;try{r=kn(e.uri)}catch{return}let n=await this.resolveNwo(r);if(!n)return;let o=ia(e.uri),s=this.orgs.get(n.owner);if(s){s.workspaces.add(o);return}this.orgs.set(n.owner,{workspaces:new Set([o]),probeNwo:n}),await this.fetchSequencer.queue(n.owner,()=>this.fetchAndCacheOrg(n.owner,n))}async onWorkspaceRemoved(e){if(!e?.uri)return;let r=ia(e.uri),n=[];for(let[o,s]of this.orgs)s.workspaces.delete(r)&&s.workspaces.size===0&&n.push({org:o,probe:s.probeNwo});for(let{org:o,probe:s}of n)this.orgs.delete(o),await this.fetchSequencer.queue(o,()=>this.removeOrgCache(s))}async fetchAndCacheOrg(e,r){if(Ht(this.ctx,Je.EnableOrgCustomAgents)===!1)return;let n=await this.client.listCustomAgents(r.owner,r.repo);if(n===void 0)return;let o=this.agentsDirFor(r);await bQ.promises.mkdir(o,{recursive:!0});let s=new Set;for(let c of n){let l=`${c.name}${KUt}`;s.add(l);let u=await this.fetchDetails(c);u&&await this.writeIfChanged(wx.join(o,l),Lgn(u))}await this.clearOrphans(o,s)}agentsDirFor(e){return wx.join(this.cacheRoot,jTe(e.owner),jTe(e.repo),uAn)}async fetchDetails(e){return this.client.getCustomAgentDetails(e.repo_owner,e.repo_name,e.name,e.version)}async writeIfChanged(e,r){let n=Buffer.from(r,"utf8");try{if((await bQ.promises.stat(e)).size===n.length&&(await bQ.promises.readFile(e)).equals(n))return}catch{}await bQ.promises.writeFile(e,n),this.logger.debug(this.ctx,`[OrgCustomAgentService] wrote ${e}`)}async clearOrphans(e,r){let n;try{n=await bQ.promises.readdir(e,{withFileTypes:!0})}catch{return}for(let o of n)if(o.isFile()&&o.name.endsWith(KUt)&&!r.has(o.name))try{await bQ.promises.unlink(wx.join(e,o.name)),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed orphan ${o.name}`)}catch(s){this.logger.warn(this.ctx,`[OrgCustomAgentService] orphan unlink failed: ${String(s)}`)}}async removeOrgCache(e){let r=wx.join(this.cacheRoot,jTe(e.owner),jTe(e.repo));try{await bQ.promises.rm(r,{recursive:!0,force:!0}),this.logger.debug(this.ctx,`[OrgCustomAgentService] removed cache for ${e.owner}/${e.repo}`)}catch(n){this.logger.warn(this.ctx,`[OrgCustomAgentService] failed to remove cache for ${e.owner}/${e.repo}: ${String(n)}`)}}},JUt=class extends CQ{constructor(r){super();this.service=r}static{a(this,"OrgCustomAgentLifecycleListener")}isEnabled(){return Promise.resolve(!0)}isStarted(){return this.service._isActivated()}start(){this.service.activate()}async didAddWorkspace(r){await this.service._handleWorkspaceAdded(r)}async didRemoveWorkspace(r){await this.service._handleWorkspaceRemoved(r)}};p();var mA=class{static{a(this,"PromptChangeNotifier")}},wze=class extends mA{static{a(this,"NullPromptChangeNotifier")}async notify(e){}};p();p();p();function fAn(t,e,r,n){let o=Array.isArray(t)?t:[t];return{affectedTypes:new Set(o),changes:[{reason:e,path:r}],workspaceFolderUri:n}}a(fAn,"createPromptFilesChangedEvent");function pAn(t,e,r){return{affectedTypes:new Set(t),changes:e,workspaceFolderUri:r}}a(pAn,"createBatchPromptFilesChangedEvent");p();var Kf=class{constructor(){this._listeners=[];this._disposed=!1}static{a(this,"EventEmitter")}get event(){return(e,r,n)=>{if(this._disposed)throw new Error("EventEmitter is disposed");let o={listener:e,thisArgs:r};this._listeners.push(o);let s={dispose:a(()=>{let c=this._listeners.indexOf(o);c>=0&&this._listeners.splice(c,1)},"dispose")};return n&&n.push(s),s}}fire(e){if(this._disposed)return;let r=this._listeners.slice();for(let{listener:n,thisArgs:o}of r)try{n.call(o,e)}catch(s){console.error("Error in event listener:",s)}}dispose(){this._listeners.length=0,this._disposed=!0}};function Kce(...t){return(e,r,n)=>{let o=[];for(let c of t)o.push(c(e,r));let s={dispose:a(()=>{for(let c of o)c.dispose()},"dispose")};return n&&n.push(s),s}}a(Kce,"anyEvent");var AAn=require("os"),HTe=fe(require("path"));function Jce(t){return t.replace(/\\/g,"/")}a(Jce,"toForwardSlash");function hAn(...t){return HTe.default.posix.join(...t.map(Jce))}a(hAn,"globJoin");function y7o(t){let e=Jce(t);return(e.startsWith("~/")?e.slice(2):e).split("/").some(n=>n==="..")}a(y7o,"containsTraversal");function mAn(t,e){let r=Jce(HTe.default.posix.normalize(Jce(t))),n=Jce(HTe.default.posix.normalize(Jce(e)));if(n===r)return!0;let o=r.endsWith("/")?r:`${r}/`;return n.startsWith(o)}a(mAn,"isContained");var gAn=["*","?","{","["],S_=class{constructor(e,r){this.ctx=e;this.logger=new Ae("PromptFileLocationRegistry");this._onLocationsChanged=new Kf;this.onLocationsChanged=this._onLocationsChanged.event;this.patterns=new Map;this.suppressEvents=0;this.getHomedir=r?.homedir??AAn.homedir}static{a(this,"PromptFileLocationRegistry")}register(e,r,n={}){let o=n.watchable??!0,s=n.cacheable??!0,c=n.metadata,l=this.patterns.get(e);l||(l=[],this.patterns.set(e,l));let u=[];for(let d of r){if(y7o(d)){this.logger.warn(this.ctx,`Skipping pattern "${d}" because it contains a ".." segment; traversal is not allowed.`);continue}if(!l.some(f=>f.pattern===d)){let f=gAn.some(m=>d.includes(m)),h=n.classification??{storage:this.derivePatternStorage(d)};l.push({pattern:d,isGlob:f,watchable:o,cacheable:s,metadata:c,classification:h}),u.push(d)}}return u.length>0&&this.fireLocationsChanged(e),{dispose:a(()=>this.unregister(e,u),"dispose")}}replace(e,r,n,o={}){let s=this.patterns.get(r)?.length??0;this.suppressEvents++;try{e?.dispose()}finally{this.suppressEvents--}return n.length>0?this.register(r,n,o):((this.patterns.get(r)?.length??0){},"dispose")})}unregister(e,r){let n=this.patterns.get(e);if(!n)return;let o=new Set(r),s=n.length,c=n.filter(l=>!o.has(l.pattern));c.lengtho.watchable).map(o=>o.pattern):n.map(o=>o.pattern):[]}resolvePatterns(e,r,n){let o=this.patterns.get(e);if(!o)return[];let s=new Set,c=[],l=a((d,f,h)=>{s.has(d)||(s.add(d),c.push({pattern:d,isGlob:f,watchable:h.watchable,cacheable:h.cacheable,metadata:h.metadata,classification:h.classification}))},"addIfNew"),u=n?o.filter(d=>d.watchable):o;for(let d of u)if(d.pattern.startsWith("~/")){let f=this.getHomedir(),h=hAn(f,d.pattern.slice(2));if(!mAn(f,h))continue;l(h,d.isGlob,d)}else if(this.isAbsolutePattern(d.pattern))l(d.pattern,d.isGlob,d);else for(let f of r){let h=hAn(f,d.pattern);mAn(f,h)&&l(h,d.isGlob,d)}return c}clear(e){let r=this.patterns.get(e);r&&r.length>0&&(this.patterns.set(e,[]),this.fireLocationsChanged(e))}derivePatternStorage(e){return e.startsWith("~/")||this.isAbsolutePattern(e)?"user":"local"}isAbsolutePattern(e){let r=e.length;for(let o of gAn){let s=e.indexOf(o);s>=0&&s0||this._onLocationsChanged.fire(fAn(e,"ConfigChanged"))}};p();p();p();p();var ZUt=fe(require("path"));function Rx(t,e,r){let n=r?t:t.toLowerCase(),o=r?e:e.toLowerCase();if(n===o)return!0;let s=ZUt.posix.relative(n,o);return s!==""&&!s.startsWith("..")&&!ZUt.posix.isAbsolute(s)}a(Rx,"isEqualOrParent");var TC=process.platform==="linux";function SQ(t){return t.replace(/\\/g,"/")}a(SQ,"normalizeSlashes");function Ak(t){let e=SQ(t);return TC?e:e.toLowerCase()}a(Ak,"canonicalKey");function yAn(t){if(t.length<=1)return t.slice();let e=new Map,r=a(u=>TC?u:u.toLowerCase(),"toKey");for(let u of t){let d=r(u.path),f=e.get(d);if(!f){e.set(d,{path:u.path,type:u.type});continue}let h=f.type,m=u.type;h==="create"&&m==="delete"?e.delete(d):h==="delete"&&m==="create"?e.set(d,{path:u.path,type:"update"}):h==="create"&&m==="update"||e.set(d,{path:u.path,type:m})}let n=[...e.values()],o=n.filter(u=>u.type==="delete").sort((u,d)=>u.path.length-d.path.length),s=[],c=[];for(let u of o){let d=r(u.path);c.some(h=>d!==h&&Rx(h,d,TC))||(s.push(u),c.push(d))}let l=n.filter(u=>u.type!=="delete");return[...s,...l]}a(yAn,"coalesceEvents");var Pze=class{constructor(e,r,n){this._parcel=r;this._nodejs=n;this._disposed=!1;this.onDidChange=Kce(this._parcel.onDidChange,this._nodejs.onDidChange),this.onDidError=Kce(this._parcel.onDidError,this._nodejs.onDidError)}static{a(this,"UniversalWatcher")}watch(e){if(this._disposed)throw new Error("UniversalWatcher: cannot watch after dispose");return e.recursive?this._parcel.watch(e):this._nodejs.watch(e)}async dispose(){this._disposed||(this._disposed=!0,await Promise.all([this._parcel.dispose(),this._nodejs.dispose()]))}};var i3=fe(require("fs"));var VY=new Ae("NodeJSWatcherService"),E7o=1e3,kze=class{constructor(e,r,n,o){this.ctx=e;this.recursive=r;this._onDidChange=new Kf;this.onDidChange=this._onDidChange.event;this._onDidError=new Kf;this.onDidError=this._onDidError.event;this._entries=new Map;this._disposed=!1;this._fsWatch=n??i3.watch,this._fsWatchFile=o??{watchFile:i3.watchFile,unwatchFile:i3.unwatchFile}}static{a(this,"NodeJSWatcherService")}watch(e){if(this._disposed)throw new Error("NodeJSWatcherService: cannot watch after dispose");if(e.recursive)throw new Error("NodeJSWatcherService: only supports non-recursive watches");let r=SQ(e.path),n=Ak(r),o=this._entries.get(n);if(o)return o.refCount++,this._entryDisposable(n);let s=this.recursive?.subscribeToPath(r,u=>{this._onDidChange.fire([u])});if(s)return this._entries.set(n,{path:r,refCount:1,disposable:s}),this._entryDisposable(n);let l=this._isRegularFile(r)?this._startWatchFile(r):this._startFsWatch(r);return this._entries.set(n,{path:r,refCount:1,disposable:l}),this._entryDisposable(n)}dispose(){if(this._disposed)return Promise.resolve();this._disposed=!0;let e=[...this._entries.values()];this._entries.clear();for(let r of e)try{r.disposable.dispose()}catch(n){VY.debug(this.ctx,"fs watcher dispose threw",r.path,n)}return this._onDidChange.dispose(),this._onDidError.dispose(),Promise.resolve()}_entryDisposable(e){let r=!1;return{dispose:a(()=>{if(r)return;r=!0;let n=this._entries.get(e);if(n&&(n.refCount--,n.refCount<=0)){this._entries.delete(e);try{n.disposable.dispose()}catch(o){VY.debug(this.ctx,"fs watcher dispose threw",n.path,o)}}},"dispose")}}_isRegularFile(e){try{return i3.statSync(e).isFile()}catch{return!1}}_startFsWatch(e){let r;try{r=this._fsWatch(e,{recursive:!1},(n,o)=>{if(this._disposed)return;let s=o?C7o(e,SQ(o)):e,c=_7o(n,s);this._onDidChange.fire([{path:s,type:c}])}),r.on("error",n=>{this._disposed||(this._onDidError.fire({path:e,error:n}),VY.debug(this.ctx,"fs.watch error for",e,n))})}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),VY.debug(this.ctx,"fs.watch threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{r?.close()}catch(n){VY.debug(this.ctx,"fs.watch close threw for",e,n)}},"dispose")}}_startWatchFile(e){let r=a((n,o)=>{if(this._disposed)return;let s=v7o(n,o);s&&this._onDidChange.fire([{path:e,type:s}])},"listener");try{this._fsWatchFile.watchFile(e,{interval:E7o},r)}catch(n){let o=n instanceof Error?n:new Error(String(n));return this._onDidError.fire({path:e,error:o}),VY.debug(this.ctx,"fs.watchFile threw for",e,o),{dispose:a(()=>{},"dispose")}}return{dispose:a(()=>{try{this._fsWatchFile.unwatchFile(e,r)}catch(n){VY.debug(this.ctx,"fs.unwatchFile threw for",e,n)}},"dispose")}}};function _7o(t,e){if(t==="change")return"update";try{return i3.statSync(e),"create"}catch{return"delete"}}a(_7o,"classify");function v7o(t,e){if(t.mtimeMs===0&&e.mtimeMs!==0)return"delete";if(t.mtimeMs!==0&&e.mtimeMs===0)return"create";if(t.mtimeMs!==e.mtimeMs)return"update"}a(v7o,"classifyStat");function C7o(t,e){return t.endsWith("/")?t+e:`${t}/${e}`}a(C7o,"joinPosix");p();var ZAn=fe(JAn()),XAn=require("os"),eyn=fe(require("path"));var Oze=new Ae("ParcelWatcherService"),fQo=process.platform==="win32"?"windows":process.platform==="linux"?"inotify":"fs-events",pQo=process.platform==="darwin"?[eyn.join((0,XAn.homedir)(),"Library","Containers")]:[],Bze=class{constructor(e,r){this.ctx=e;this._onDidChange=new Kf;this.onDidChange=this._onDidChange.event;this._onDidError=new Kf;this.onDidError=this._onDidError.event;this._roots=new Map;this._pendingShutdowns=new Set;this._disposed=!1;this._enospcNotified=!1;this._warnedPaths=new Set;this._subscribe=r??ZAn.subscribe}static{a(this,"ParcelWatcherService")}watch(e){if(this._disposed)throw new Error("ParcelWatcherService: cannot watch after dispose");if(!e.recursive)throw new Error("ParcelWatcherService: only supports recursive watches");let r=SQ(e.path),n=Ak(r),o=this._findCoveringRoot(r);if(o){let l={root:o};return o.handles.add(l),{dispose:a(()=>this._releaseHandle(l),"dispose")}}let s={path:r,handles:new Set,pathSubscribers:new Map};this._roots.set(n,s),this._startSubscription(s),this._foldChildrenIntoAfterSubscribed(s);let c={root:s};return s.handles.add(c),{dispose:a(()=>this._releaseHandle(c),"dispose")}}subscribeToPath(e,r){if(this._disposed)return;let n=SQ(e),o=this._findCoveringRoot(n);if(!o)return;let s=Ak(n),c=o.pathSubscribers.get(s);return c||(c=new Set,o.pathSubscribers.set(s,c)),c.add(r),{dispose:a(()=>{let l=o.pathSubscribers.get(s);l&&(l.delete(r),l.size===0&&o.pathSubscribers.delete(s),this._maybeTearDown(o))},"dispose")}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._roots.values()];for(this._roots.clear(),await Promise.all(e.map(async r=>{r.handles.clear(),r.pathSubscribers.clear(),await this._shutdownEntry(r)}));this._pendingShutdowns.size>0;){let r=[...this._pendingShutdowns];await Promise.allSettled(r)}this._onDidChange.dispose(),this._onDidError.dispose()}_findCoveringRoot(e){for(let r of this._roots.values())if(Rx(r.path,e,TC))return r}async _foldChildrenIntoAfterSubscribed(e){let r=[];for(let[n,o]of[...this._roots])if(o!==e&&Rx(e.path,o.path,TC)){for(let s of o.handles)s.root=e,e.handles.add(s);o.handles.clear();for(let[s,c]of o.pathSubscribers){let l=e.pathSubscribers.get(s);l||(l=new Set,e.pathSubscribers.set(s,l));for(let u of c)l.add(u)}o.pathSubscribers.clear(),this._roots.delete(n),r.push(o)}if(r.length!==0){try{await e.subscribing}catch{}for(let n of r)this._trackShutdown(n,"Shutdown of folded child failed for")}}_releaseHandle(e){let r=e.root;r.handles.delete(e),this._maybeTearDown(r)}_maybeTearDown(e){if(e.handles.size>0||e.pathSubscribers.size>0)return;let r=Ak(e.path);this._roots.get(r)===e&&(this._roots.delete(r),this._trackShutdown(e,"Unsubscribe failed for"))}_trackShutdown(e,r){let n=this._shutdownEntry(e).catch(o=>{Oze.debug(this.ctx,r,e.path,o)});this._pendingShutdowns.add(n),n.finally(()=>this._pendingShutdowns.delete(n))}_startSubscription(e){let r=this._subscribe(e.path,(n,o)=>{if(!this._disposed){if(n){this._onWatchError(n,e.path);return}this._handleParcelEvents(e,o)}},{backend:fQo,ignore:pQo}).then(async n=>{if(e.subscribing=void 0,this._disposed||!this._rootStillActive(e)){await n.unsubscribe();return}return e.subscription=n,n}).catch(n=>{e.subscribing=void 0,this._onWatchError(n instanceof Error?n:new Error(String(n)),e.path)});e.subscribing=r}_rootStillActive(e){let r=Ak(e.path);return this._roots.get(r)===e}async _shutdownEntry(e){let r=e.subscription;e.subscription=void 0;let n=e.subscribing;if(e.subscribing=void 0,r)await r.unsubscribe();else if(n){let o=await n;o&&await o.unsubscribe()}}_handleParcelEvents(e,r){if(r.length===0)return;let n=[];for(let s of r){let c=SQ(s.path);n.push({path:c,type:s.type})}let o=yAn(n);if(o.length!==0&&(this._onDidChange.fire(o),e.pathSubscribers.size!==0))for(let s of o){let c=Ak(s.path),l=e.pathSubscribers.get(c);if(l)for(let u of l)try{u(s)}catch(d){Oze.debug(this.ctx,"Path subscriber threw",s.path,d)}}}_onWatchError(e,r){if(this._disposed)return;let n=e.toString();if(Oze.debug(this.ctx,"Watcher error for",r,e),this._onDidError.fire({path:r,error:e}),n.includes("ENOSPC")&&!this._enospcNotified){this._enospcNotified=!0,this.ctx.get(Hs).showWarningMessageOnlyOnce("parcelWatcher.enospc","Unable to watch for file changes in AI customization files. The inotify watch limit may have been reached. Please increase the limit by following the instructions at http://aka.ms/ghc-jetbrains-wiki/FAQ#resolving-the-enospc-file-watcher-error-on-linux");return}this._warnedPaths.has(r)||(this._warnedPaths.add(r),Oze.warn(this.ctx,"Failed to watch for file changes at",r,e))}};function Lze(t){let e=new Bze(t),r=new kze(t,e);return new Pze(t,e,r)}a(Lze,"createUniversalWatcher");var tyn=fe(require("fs"));var TQ=fe(require("path"));var hQo=100,Fze=/[*?{[]/,l7t=class{constructor(e,r,n,o,s){this.request=e;this.watcher=r;this.registerDeferred=n;this.unregisterDeferred=o;this.statSync=s;this._disposed=!1;this._innerSubs=[];this.registerDeferred(this),this._tryActivate()}static{a(this,"DeferredWatchSubscription")}isPending(){return!this._disposed&&this._ancestorPath!==void 0}targetPath(){return this.request.path}handleEvent(e){if(!this._disposed){if(this._ancestorPath!==void 0){if(e.type!=="create"||!Rx(e.path,this.request.path,TC)&&!Rx(this.request.path,e.path,TC))return;this._tryActivate();return}e.type==="delete"&&Rx(e.path,this.request.path,TC)&&this._tryActivate()}}dispose(){this._disposed||(this._disposed=!0,this.unregisterDeferred(this),this._ancestorPath=void 0,this._disposeInnerSubs())}_tryActivate(){if(this._disposed)return;let e=this._isDirectory(this.request.path);if(e||this._exists(this.request.path)){let c=[];if(c.push(this.watcher.watch(this.request)),e){let u=TQ.dirname(this.request.path);u!==this.request.path&&this._isDirectory(u)&&c.push(this.watcher.watch({path:u,recursive:!1}))}let l=this._innerSubs;this._innerSubs=c,this._ancestorPath=void 0;for(let u of l)u.dispose();return}let n=mQo(this.request.path,this.statSync);if(n===void 0||gQo(n,this.request.path)){this._ancestorPath="",this._disposeInnerSubs();return}if(this._ancestorPath===n&&this._innerSubs.length>0)return;let o=this.watcher.watch({path:n,recursive:!1}),s=this._innerSubs;this._innerSubs=[o],this._ancestorPath=n;for(let c of s)c.dispose()}_exists(e){try{return this.statSync(e),!0}catch{return!1}}_isDirectory(e){try{return this.statSync(e).isDirectory()}catch{return!1}}_disposeInnerSubs(){let e=this._innerSubs;this._innerSubs=[];for(let r of e)r.dispose()}};function mQo(t,e){let r=TQ.dirname(t),n;for(;r!==n;){try{if(e(r).isDirectory())return r}catch{}n=r,r=TQ.dirname(r)}}a(mQo,"findExistingAncestor");function gQo(t,e){return TQ.dirname(e)===t?!1:t===TQ.parse(t).root}a(gQo,"isAncestorTooBroad");var Uze=class{constructor(e,r,n=tyn.statSync){this._onPromptFileChanged=new Kf;this.onPromptFileChanged=this._onPromptFileChanged.event;this._patterns=new Map;this._pendingChanges=[];this._pendingTypes=new Set;this._pendingKeys=new Set;this._disposed=!1;this._deferredSubs=new Set;this._watcher=r??Lze(e),this._ownsWatcher=r===void 0,this._statSync=n,this._subscriptionDisposable=this._watcher.onDidChange(o=>this._handleEvents(o))}static{a(this,"PromptFileWatcher")}watch(e,r,n){if(this._disposed)throw new Error("PromptFileWatcher: cannot watch after dispose");let o=Array.isArray(r)?r:[r],s=[],c=new Map,l=new Map;for(let d of o){let f=d.replace(/\\/g,"/");s.push(f),c.set(f,(c.get(f)??0)+1),!this._patterns.has(f)&&!l.has(f)&&l.set(f,this._toWatchRequest(f))}for(let[d,f]of c){let h=this._patterns.get(d);if(!h){let m=l.get(d),g=this._createDeferredSubscription(m),A=Fze.test(d)?m.path:void 0;h={refCountByType:new Map,matcher:new b_(d,{dot:!0}),subscription:g,baseDir:A},this._patterns.set(d,h)}h.refCountByType.set(e,(h.refCountByType.get(e)??0)+f)}n&&n.dispose();let u=!1;return{dispose:a(()=>{if(!u){u=!0;for(let d of s)this._decrementRefCount(d,e)}},"dispose")}}flush(){if(this._disposed||(this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._pendingChanges.length===0))return;let e=pAn([...this._pendingTypes],this._pendingChanges);this._pendingChanges=[],this._pendingTypes=new Set,this._pendingKeys=new Set,this._onPromptFileChanged.fire(e)}async dispose(){if(!this._disposed){this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0);for(let e of this._patterns.values())e.subscription.dispose();this._patterns.clear(),this._subscriptionDisposable.dispose(),this._ownsWatcher&&await this._watcher.dispose(),this._onPromptFileChanged.dispose()}}_createDeferredSubscription(e){return new l7t(e,this._watcher,r=>this._deferredSubs.add(r),r=>this._deferredSubs.delete(r),this._statSync)}_toWatchRequest(e){if(!Fze.test(e))return{path:e,recursive:!1,includes:[e]};let r=this._extractBaseDir(e),n=e.includes("**")||this._globSpansMultipleSegments(e);return{path:r,recursive:n,includes:[e]}}_globSpansMultipleSegments(e){let r=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));if(r<0)return!1;let n=e.slice(0,r);return Fze.test(n)}_extractBaseDir(e){let r=Fze.exec(e);if(!r)return TQ.dirname(e);let n=e.slice(0,r.index),o=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));if(o<0)throw new Error(`PromptFileWatcher: pattern "${e}" has no base directory; expected an absolute path.`);let s=o>0?n.slice(0,o):n;if(/^[A-Za-z]:$/.test(s)&&n.length>s.length){let c=n[s.length];if(c==="/"||c==="\\")return`${s}${c}`}return s}_handleEvents(e){if(!this._disposed){if(this._deferredSubs.size>0)for(let r of e)for(let n of[...this._deferredSubs])n.handleEvent(r);for(let r of e){let n=this._mapEventType(r.type),o=!1;for(let c of this._patterns.values()){if(c.matcher.match(r.path)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0;continue}if(r.type!=="delete"||c.baseDir===void 0)continue;let l=c.baseDir,u=Rx(r.path,l,TC),d=Rx(l,r.path,TC);if(!(!u&&!d)){for(let f of c.refCountByType.keys())this._pendingTypes.add(f);o=!0}}if(!o)continue;let s=`${n}\0${r.path}`;this._pendingKeys.has(s)||(this._pendingKeys.add(s),this._pendingChanges.push({reason:n,path:r.path}))}this._pendingChanges.length>0&&this._scheduleFlush()}}_mapEventType(e){switch(e){case"create":return"FileCreated";case"update":return"FileChanged";case"delete":return"FileDeleted"}}_scheduleFlush(){this._debounceTimer!==void 0&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this.flush()},hQo)}_decrementRefCount(e,r){let n=this._patterns.get(e);if(!n)return;let o=n.refCountByType.get(r);o!==void 0&&(o<=1?n.refCountByType.delete(r):n.refCountByType.set(r,o-1),n.refCountByType.size===0&&(this._patterns.delete(e),n.subscription.dispose()))}};p();p();function oyn(t,e=[],r={}){let n=t.length===0?[]:t.split(/\r\n|\n/);return new d7t(n,e,r).parse()}a(oyn,"parse");function YTe(t,e){return{line:t,character:e}}a(YTe,"createPosition");function Px(t,e,r){return{type:"string",value:t,start:e,end:r}}a(Px,"createStringNode");function AQo(t,e,r){return{type:"number",value:t,start:e,end:r}}a(AQo,"createNumberNode");function ryn(t,e,r){return{type:"boolean",value:t,start:e,end:r}}a(ryn,"createBooleanNode");function yQo(t,e){return{type:"null",value:null,start:t,end:e}}a(yQo,"createNullNode");function nyn(t,e,r){return{type:"object",start:e,end:r,properties:t}}a(nyn,"createObjectNode");function iyn(t,e,r){return{type:"array",start:e,end:r,items:t}}a(iyn,"createArrayNode");function syn(t){return t===" "||t===" "}a(syn,"isWhitespace");function EQo(t){return/^-?\d*\.?\d+$/.test(t)}a(EQo,"isValidNumber");var u7t=class{constructor(e){this.currentLine=0;this.currentChar=0;this.lines=e}static{a(this,"YamlLexer")}getCurrentPosition(){return YTe(this.currentLine,this.currentChar)}getCurrentLineNumber(){return this.currentLine}getCurrentCharNumber(){return this.currentChar}getCurrentLineText(){return this.currentLine=this.lines.length}getCurrentChar(){return this.isAtEnd()||this.currentChar>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][this.currentChar]}peek(e=1){let r=this.currentChar+e;return this.currentLine>=this.lines.length||r>=this.lines[this.currentLine].length?"":this.lines[this.currentLine][r]}advance(){let e=this.getCurrentChar();return this.currentChar>=this.lines[this.currentLine].length&&this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}if(this.currentLine++,this.currentChar=0,this.currentLine0&&!e.startsWith("#")){this.skipWhitespace();return}}}}},d7t=class{constructor(e,r,n){this.flowLevel=0;this.lexer=new u7t(e),this.errors=r,this.options=n}static{a(this,"YamlParser")}addError(e,r,n,o){this.errors.push({message:e,code:r,start:n,end:o})}parseValue(e){if(this.lexer.skipWhitespace(),this.lexer.isAtEnd()){let n=this.lexer.getCurrentPosition();return Px("",n,n)}let r=this.lexer.getCurrentChar();return r==='"'||r==="'"?this.parseQuotedString(r):r==="["?this.parseInlineArray():r==="{"?this.parseInlineObject():this.parseUnquotedValue()}parseQuotedString(e){let r=this.lexer.getCurrentPosition();this.lexer.advance();let n="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==e;)n+=this.lexer.advance();this.lexer.getCurrentChar()===e&&this.lexer.advance();let o=this.lexer.getCurrentPosition();return Px(n,r,o)}parseUnquotedValue(){let e=this.lexer.getCurrentPosition(),r="",n=e,o=a(d=>d==="#"||this.flowLevel>0&&(d===","||d==="]"||d==="}"),"isTerminator"),s=this.lexer.getCurrentChar();if(s==='"'||s==="'")for(r+=this.lexer.advance(),n=this.lexer.getCurrentPosition();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(d===s||o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="";){let d=this.lexer.getCurrentChar();if(o(d))break;r+=this.lexer.advance(),n=this.lexer.getCurrentPosition()}let c=r.trimEnd(),l=r.length-c.length;l&&(n=YTe(e.line,n.character-l));let u=s==='"'||s==="'"?c.substring(1):c;return this.createValueNode(u,e,n)}createValueNode(e,r,n){if(e==="")return Px("",r,r);if(e==="true")return ryn(!0,r,n);if(e==="false")return ryn(!1,r,n);if(e==="null"||e==="~")return yQo(r,n);let o=Number(e);return!isNaN(o)&&isFinite(o)&&EQo(e)?AQo(o,r,n):Px(e,r,n)}parseInlineArray(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="]"){this.lexer.advance();break}if(this.lexer.getCurrentChar()===""){this.lexer.advanceLine();continue}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.parseValue();s.type==="string"&&s.value===""&&s.start.line===s.end.line&&s.start.character===s.end.character||r.push(s);let c=this.lexer.savePosition();if(o.line===c.line&&o.char===c.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,iyn(r,e,n)}parseInlineObject(){let e=this.lexer.getCurrentPosition();this.lexer.advance(),this.flowLevel++;let r=[];for(;!this.lexer.isAtEnd();){if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="}"){this.lexer.advance();break}if(this.lexer.getCurrentChar()==="#"){this.lexer.skipToEndOfLine(),this.lexer.advanceLine();continue}let o=this.lexer.savePosition(),s=this.lexer.getCurrentPosition(),c="";if(this.lexer.getCurrentChar()==='"'||this.lexer.getCurrentChar()==="'"){let h=this.lexer.getCurrentChar();for(this.lexer.advance();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==h;)c+=this.lexer.advance();this.lexer.getCurrentChar()===h&&this.lexer.advance()}else for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)c+=this.lexer.advance();c=c.trim();let l=this.lexer.getCurrentPosition(),u=Px(c,s,l);this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let d=this.parseValue();r.push({key:u,value:d});let f=this.lexer.savePosition();if(o.line===f.line&&o.char===f.char)if(!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!=="")this.lexer.advance();else break;this.lexer.skipWhitespace(),this.lexer.getCurrentChar()===","&&this.lexer.advance()}let n=this.lexer.getCurrentPosition();return this.flowLevel--,nyn(r,e,n)}parseBlockArray(e){let r=this.lexer.getCurrentPosition(),n=[];for(;!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd());){let s=this.lexer.getIndentation();if(ss)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let u=this.parseBlockArray(l);n.push(u)}else{let u=this.lexer.getCurrentLineText(),d=this.lexer.getCurrentCharNumber(),f=u.substring(d);if(f.includes(":")&&!f.trim().startsWith("#")){let h=this.parseBlockObject(l,this.lexer.getCurrentCharNumber());n.push(h)}else n.push(Px("",c,c))}else n.push(Px("",c,c))}else{let l=this.lexer.getCurrentLineText(),u=this.lexer.getCurrentCharNumber();if(l.substring(u).includes(":")){let h=this.parseBlockObject(c.character,c.character);n.push(h)}else{let h=this.parseValue();for(n.push(h);!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#";)this.lexer.advance();this.lexer.advanceLine()}}}else break}let o=r;return n.length>0?o=n[n.length-1].end:o=YTe(r.line,r.character+1),iyn(n,r,o)}parseBlockObject(e,r){let n=this.lexer.getCurrentPosition(),o=[],s=new Set,c=r!==void 0,l=!0;for(;!this.lexer.isAtEnd()&&((!l||!c)&&this.lexer.moveToNextNonEmptyLine(),l=!1,!this.lexer.isAtEnd());){let d=this.lexer.getIndentation();if(c){if(this.lexer.skipWhitespace(),this.lexer.getCurrentCharNumber()e){let E=YTe(this.lexer.getCurrentLineNumber(),0),_=YTe(this.lexer.getCurrentLineNumber(),this.lexer.getCurrentLineText().length);this.addError("Unexpected indentation","indentation",E,_),this.lexer.skipWhitespace()}else this.lexer.skipWhitespace()}let f=this.lexer.getCurrentPosition(),h="";for(;!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!==":";)h+=this.lexer.advance();h=h.trim();let m=this.lexer.getCurrentPosition(),g=Px(h,f,m);!this.options.allowDuplicateKeys&&s.has(h)&&this.addError(`Duplicate key '${h}'`,"duplicateKey",f,m),s.add(h),this.lexer.getCurrentChar()===":"&&this.lexer.advance(),this.lexer.skipWhitespace();let A,y=this.lexer.getCurrentPosition();if(this.lexer.getCurrentChar()===""||this.lexer.getCurrentChar()==="#")if(this.lexer.advanceLine(),this.lexer.isAtEnd())A=Px("",y,y);else{let E=this.lexer.getIndentation();if(E>d)if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-")A=this.parseBlockArray(E);else{let _=this.lexer.getCurrentLineText(),v=this.lexer.getCurrentCharNumber(),b=_.substring(v);b.includes(":")&&!b.trim().startsWith("#")?A=this.parseBlockObject(E):A=this.parseValue()}else!c&&E===d?(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"?A=this.parseBlockArray(d):A=Px("",y,y)):A=Px("",y,y)}else{for(A=this.parseValue();!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()!==""&&this.lexer.getCurrentChar()!=="#"&&syn(this.lexer.getCurrentChar());)this.lexer.advance();this.lexer.getCurrentChar()==="#"&&this.lexer.skipToEndOfLine(),!this.lexer.isAtEnd()&&this.lexer.getCurrentChar()===""&&this.lexer.advanceLine()}o.push({key:g,value:A})}let u=n;return o.length>0&&(u=o[o.length-1].value.end),nyn(o,n,u)}parse(){if(!this.lexer.isAtEnd()&&(this.lexer.moveToNextNonEmptyLine(),!this.lexer.isAtEnd()))if(this.lexer.skipWhitespace(),this.lexer.getCurrentChar()==="-"){let e=this.lexer.peek();return e===" "||e===" "||e===""||e==="#"?this.parseBlockArray(0):this.parseValue()}else{if(this.lexer.getCurrentChar()==="[")return this.parseInlineArray();if(this.lexer.getCurrentChar()==="{")return this.parseInlineObject();{let e=this.lexer.getCurrentLineText(),r=this.lexer.getCurrentCharNumber(),n=e.substring(r),o=!1,s=!1,c="";for(let l=0;lf>0&&d.match(/^---[\s\r\n]*$/));l===-1?(l=n.length,c=n.length):c=l+1;let u=new yk.Range(2,1,l+1,1);o=new h7t(u,n)}if(c({message:c.message,range:this.asRange(c),code:c.code}));if(n)if(n.type!=="object")s.push({message:"Invalid header, expecting pairs",range:this.range,code:"INVALID_YAML"});else for(let c of n.properties)o.push({key:c.key.value,range:this.asRange({start:c.key.start,end:c.value.end}),value:this.asValue(c.value)});this._parsed={node:n,attributes:o,errors:s}}return this._parsed}asRange({start:e,end:r}){return new yk.Range(this.range.startLineNumber+e.line,e.character+1,this.range.startLineNumber+r.line,r.character+1)}asValue(e){switch(e.type){case"string":return{type:"string",value:e.value,range:this.asRange(e)};case"number":return{type:"number",value:e.value,range:this.asRange(e)};case"boolean":return{type:"boolean",value:e.value,range:this.asRange(e)};case"null":return{type:"null",value:e.value,range:this.asRange(e)};case"array":return{type:"array",items:e.items.map(r=>this.asValue(r)),range:this.asRange(e)};case"object":return{type:"object",properties:e.properties.map(n=>({key:this.asValue(n.key),value:this.asValue(n.value)})),range:this.asRange(e)}}}get attributes(){return this._parsedHeader.attributes}getAttribute(e){return this._parsedHeader.attributes.find(r=>r.key===e)}get errors(){return this._parsedHeader.errors}getStringAttribute(e){let r=this._parsedHeader.attributes.find(n=>n.key===e);if(r?.value.type==="string")return r.value.value}get name(){return this.getStringAttribute("name")}get description(){return this.getStringAttribute("description")}get agent(){return this.getStringAttribute("agent")??this.getStringAttribute("mode")}get model(){return this.getStringAttribute("model")}get applyTo(){return this.getStringAttribute("applyTo")}get invokePolicy(){let e=this._parsedHeader.attributes.find(r=>r.key===vQo);if(e?.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}}get tools(){let e=this._parsedHeader.attributes.find(r=>r.key==="tools");if(e){if(e.value.type==="array"){let r=[];for(let n of e.value.items)n.type==="string"&&n.value&&r.push(n.value);return r}else if(e.value.type==="object"){let r=[],n=a(({key:o,value:s})=>{s.type==="boolean"?r.push(o.value):s.type==="object"&&s.properties.forEach(n)},"collectLeafs");return e.value.properties.forEach(n),r}}}get handOffs(){let e=this._parsedHeader.attributes.find(r=>r.key==="handoffs");if(e&&e.value.type==="array"){let r=[];for(let n of e.value.items)if(n.type==="object"){let o,s,c,l;for(let u of n.properties)u.key.value==="agent"&&u.value.type==="string"?o=u.value.value:u.key.value==="label"&&u.value.type==="string"?s=u.value.value:u.key.value==="prompt"&&u.value.type==="string"?c=u.value.value:u.key.value==="send"&&u.value.type==="boolean"&&(l=u.value.value);o&&s&&c!==void 0&&r.push({agent:o,label:s,prompt:c,send:l})}return r}}},m7t=class{constructor(e,r,n){this.range=e;this.linesWithEOL=r;this.uri=n}static{a(this,"PromptBody")}get fileReferences(){return this.getParsedBody().fileReferences}get variableReferences(){return this.getParsedBody().variableReferences}get offset(){return this.getParsedBody().bodyOffset}getParsedBody(){if(this._parsed===void 0){let e=[],r=[],n=[],o=this.linesWithEOL.slice(0,this.range.startLineNumber-1).reduce((s,c)=>c.length+s,0);for(let s=this.range.startLineNumber-1,c=o;syk.Range.areIntersectingOrTouching(A,m)))continue;let g=h[1];if(g){if(g==="file:"){let A=h.index+h[0].length-h[2].length,y=h.index+h[0].length,E=new yk.Range(s+1,A+1,s+1,y+1);r.push({content:h[2],range:E,isMarkdownLink:!1})}}else{let A=h.index+1,y=h.index+h[0].length,E=new yk.Range(s+1,A+1,s+1,y+1);n.push({name:h[2],range:E,offset:c+h.index})}}c+=l.length}this._parsed={fileReferences:r.sort((s,c)=>yk.Range.compareRangesUsingStarts(s.range,c.range)),variableReferences:n,bodyOffset:o}}return this._parsed}get content(){return this._content===void 0&&(this._content=this.linesWithEOL.slice(this.range.startLineNumber-1,this.range.endLineNumber-1).join("").trim()),this._content}};p();var CQo=new Set(["sessionStart","sessionEnd","userPromptSubmitted","preToolUse","postToolUse","errorOccurred"]),bQo="agentHook.event.load",Hze=class{constructor(){this.logger=new Ae("HookParser")}static{a(this,"HookParser")}parse(e,r,n){let o=JSON.parse(n);if(o.version!==1)throw new Error(`Unsupported hooks config version: ${String(o.version)}`);if(o.hooks===void 0||typeof o.hooks!="object"||o.hooks===null)throw new Error("Invalid or missing hooks section");let s=o,c={};for(let[l,u]of Object.entries(s.hooks)){if(!this.isValidEventType(l)){this.logger.warn(e,`Invalid event type: ${l} in ${r}`);continue}let d=Array.isArray(u)?u:[],f=[];for(let h of d)this.isValidHook(h)?f.push(h):this.logger.warn(e,`Invalid hook configuration in ${r}: ${JSON.stringify(h)}`);c[l]=f}return _t(e,bQo,this.buildHookCountsByEventType(c)),{uri:r,version:1,hooks:c}}buildHookCountsByEventType(e){let r={};for(let[n,o]of Object.entries(e))o!==void 0&&(r[`${n}.hookCount`]=String(o.length));return r}isValidEventType(e){return CQo.has(e)}isValidHook(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="command"&&("bash"in e&&typeof e.bash=="string"||"powershell"in e&&typeof e.powershell=="string")}};var xQ="globalPromptFiles://";var cyn=["agent","skill","prompt","instructions","hook"];function lyn(t,e){return`${t}::${e}`}a(lyn,"entryKey");function SQo(t){return`${t}::`}a(SQo,"typePrefix");var Zm=class{constructor(e,r,n){this.ctx=e;this.fileLocator=r;this.logger=new Ae("PromptService");this.watchHandles=new Map;this.entryCache=new Map;this.parseInflight=new Map;this.parsers=new Map;this.disposed=!1;n===void 0?(this.watcher=new Uze(e),this.ownsWatcher=!0):(this.watcher=n,this.ownsWatcher=!1);let o=e.get(S_),s=new class{constructor(){this.inner=new IQ}parse(u,d,f){return this.inner.parse(d,f)}};this.parsers.set("prompt",s),this.parsers.set("instructions",s),this.parsers.set("skill",s),this.parsers.set("agent",s),this.parsers.set("hook",new Hze),this.onPromptFilesChanged=Kce(o.onLocationsChanged,this.watcher.onPromptFileChanged),this.mergedChangeSubscription=this.onPromptFilesChanged(u=>this.handleChange(u));for(let u of cyn)this.rewatch(u);this.registrySubscription=o.onLocationsChanged(u=>{for(let d of u.affectedTypes)this.rewatch(d)});let c=a(u=>{this.evictFolder(u),this.rewatchAll()},"onWorkspaceRemoved"),l=a(()=>{this.rewatchAll()},"onWorkspaceAdded");this.workspaceListener=new class extends CQ{isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}didAddWorkspace(){l()}didRemoveWorkspace(u){c(u)}},e.get(CS).addListener(this.workspaceListener)}static{a(this,"PromptService")}async collect(e,r,n){let o=await this.fileLocator.listFiles(e,n,r);return(await Promise.all(o.map(c=>this.resolveEntry(e,r,c)))).filter(c=>c!==void 0)}async resolveEntry(e,r,n){let o=lyn(r,n.uri);if(n.cacheable){let l=this.entryCache.get(o);if(l){let d=await this.fsMtime(e,n.uri);if(d!==void 0&&d===l.timestamp)return l.entry;this.invalidateKey(o)}let u=this.parseInflight.get(o);if(u)return u}let s=this.buildPromptPath(r,n),c=this.parseOne(e,s).then(l=>{if(l===void 0)return;let u={promptPath:s,parsedPromptFile:l};return n.cacheable&&!this.disposed&&this.parseInflight.get(o)===c&&this.entryCache.set(o,{entry:u,timestamp:n.timestamp}),u});return n.cacheable&&(this.parseInflight.set(o,c),c.finally(()=>{this.parseInflight.get(o)===c&&this.parseInflight.delete(o)})),c}async fsMtime(e,r){try{return(await e.get(jo).stat(r)).mtime}catch{return}}buildPromptPath(e,r){let{classification:n}=r;return n.storage==="extension"||n.storage==="clsAssets"?{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata,name:n.extensionInfo.name,description:n.extensionInfo.description,extensionId:n.extensionInfo.extensionId}:{uri:r.uri,storage:n.storage,type:e,metadata:r.metadata}}async dispose(){if(!this.disposed){this.disposed=!0,this.registrySubscription.dispose(),this.mergedChangeSubscription.dispose();try{this.ctx.get(CS).removeListener(this.workspaceListener)}catch{}for(let e of this.watchHandles.values())e.dispose();this.watchHandles.clear(),this.entryCache.clear(),this.parseInflight.clear(),this.ownsWatcher&&await this.watcher.dispose()}}async parseOne(e,r){let n=this.parsers.get(r.type);if(!n){this.logger.warn(e,`No parser registered for type ${r.type} (uri: ${r.uri})`);return}try{return await n.parse(e,r.uri,await e.get(jo).readFileString(r.uri))}catch(o){this.logger.warn(e,`Failed to parse ${r.type} file ${r.uri}:`,o);return}}handleChange(e){let r=new Set,n=!1;for(let o of e.changes)o.path?r.add(o.path):n=!0;for(let o of e.affectedTypes){if(n)this.clearType(o);else for(let s of r)this.invalidateKey(lyn(o,ba(s)));this.notifyChange(o)}}notifyChange(e){try{this.ctx.get(mA).notify(e).catch(r=>{this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)})}catch(r){this.logger.warn(this.ctx,`PromptChangeNotifier.notify(${e}) failed:`,r)}}invalidateKey(e){this.entryCache.delete(e),this.parseInflight.delete(e)}clearType(e){let r=SQo(e),n=new Set;for(let o of this.entryCache.keys())o.startsWith(r)&&n.add(o);for(let o of this.parseInflight.keys())o.startsWith(r)&&n.add(o);for(let o of n)this.invalidateKey(o)}rewatch(e){if(this.disposed)return;let r=this.ctx.get(S_),n=this.currentWorkspacePaths(),o=r.resolvePatterns(e,n,!0).map(l=>l.pattern),s=this.watchHandles.get(e);if(o.length===0){s&&(s.dispose(),this.watchHandles.delete(e));return}let c=this.watcher.watch(e,o,s);this.watchHandles.set(e,c)}rewatchAll(){for(let e of cyn)this.rewatch(e)}evictFolder(e){let r=e.uri.endsWith("/")?e.uri:`${e.uri}/`;for(let[n,o]of this.entryCache){let s=o.entry.promptPath.uri;(s===e.uri||s.startsWith(r))&&this.invalidateKey(n)}}currentWorkspacePaths(){let e;try{e=this.ctx.get(an).getWorkspaceFolders().map(o=>kn(o.uri))}catch{return[]}let r=e.map(o=>({raw:o,normalized:o.replace(/\\/g,"/")})).sort((o,s)=>o.normalized.length-s.normalized.length),n=[];for(let o of r)n.some(s=>Rx(s.normalized,o.normalized,TC))||n.push(o);return n.map(o=>o.raw)}};p();var lu=class{constructor(){this.policyChangeEmitter=new Kf;this.onDidChangePolicy=this.policyChangeEmitter.event}static{a(this,"PolicyWatcher")}},Gze=class extends lu{static{a(this,"NoOpPolicyWatcher")}getPolicyValue(e){}};p();var g7t=64;var o3=(r=>(r.enabled="enabled",r.disabled="disabled",r))(o3||{}),Xm={id:"copilot",displayName:"Copilot Language Server",description:"Copilot Language Server tool provider",isFirstPartyTool:!0},Jf={id:"copilot-editor",displayName:"Editor",description:"Editor tool provider",isFirstPartyTool:!0},zY=class{static{a(this,"LanguageModelTool")}constructor(e){this.type=e.type,this.toolProvider=e.toolProvider,this.name=e.name,this.displayName=e.displayName??this.name,this.description=e.description,this.displayDescription=e.displayDescription??this.description,this.inputSchema=e.inputSchema,this.annotations=e.annotations,this.id=`${this.toolProvider.id}.${this.name}`,this.nameForModel=(this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.displayNamePrefix??this.toolProvider.id}_${this.name}`).replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,g7t),this.status=e.status??"enabled",this.configurationKey=this.toolProvider.isFirstPartyTool?this.name:`${this.toolProvider.id}/${this.name}`}isEnabled(e){return Promise.resolve(!0)}},wQ=class extends zY{static{a(this,"BaseLanguageModelTool")}constructor(e){super(e)}},Rr=class{static{a(this,"LanguageModelTextPart")}constructor(e){this.value=e}},RQ=class{static{a(this,"LanguageModelDataPart")}constructor(e){this.value=e}},YY=class{static{a(this,"LanguageModelPromptTsxPart")}constructor(e){this.value=e}};var Br=class{static{a(this,"LanguageModelToolResult")}constructor(e,r){this.status=r,this.content=e}},PQ=class extends Br{static{a(this,"ExtendedLanguageModelToolResult")}},uyn=S.Object({content:S.Array(S.Union([S.Object({value:S.String()}),S.Object({value:S.Unknown()})])),status:S.Optional(S.Union([S.Literal("success"),S.Literal("error"),S.Literal("cancelled")]))}),s3=(r=>(r.Accept="accept",r.Dismiss="dismiss",r))(s3||{}),dyn=S.Object({result:S.Enum(s3)});var A7t=fe(require("fs"));var KTe=fe(require("path"));var TQo=["user","model"],E7t="source",_7t={githubOrg:"github-org"},dAn={githubOrg:{[E7t]:_7t.githubOrg}},y7t=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._id=n.uri,this._name=r.name??Ki(n.uri).replace(".agent.md","")}static{a(this,"CustomAgent")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get id(){return this._id}get name(){return this._name}get description(){return this.parsedPromptFile.header?.description}get tools(){return this.parsedPromptFile.header?.tools}get model(){return this.parsedPromptFile.header?.model}get handOffs(){return this.parsedPromptFile.header?.handOffs}get instruction(){return this.parsedPromptFile.body?.content}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}get invokePolicy(){return this.parsedPromptFile.header?.invokePolicy??TQo}get extensionId(){let e=this.promptFileEntry.promptPath;if(e.storage==="extension"||e.storage==="clsAssets")return e.extensionId}get source(){let e=this.promptFileEntry.promptPath.metadata;if(!e)return;let r=new Set(Object.values(_7t));for(let n of e){let o=n[E7t];if(typeof o=="string"&&r.has(o))return o}}},fyn="./assets/prompts.contributions.json",IQo="CVE Remediator",xQo="Debugger",pyn=new Map([[IQo,"cveRemediatorAgent"],[xQo,"debuggerAgent"]]),$p=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.logger=new Ae("CustomAgentService");this.agentUpdateSequencer=new qM;this.extensionAgents=new Map;this.agentsByExtension=new Map;this.agentFileLocationsPatterns=[];this.gateSubscriptions=[];this.lastGatedCapabilities={};this.syncRegistry(),this.ready=this.loadAssetsContributions(e),this.subscribeToGateChanges()}static{a(this,"CustomAgentService")}static{this.DEFAULT_AGENT_REGISTRATIONS=[".github/agents/**/*.agent.md",".claude/agents/**/*.agent.md","~/.copilot/agents/**/*.agent.md"]}static{this.AGENT_GLOB_SUFFIX="**/*.agent.md"}subscribeToGateChanges(){try{let e=this.ctx.get(Yo);this.lastEnableCustomAgents=Ht(this.ctx,Je.EnableCustomAgents),this.lastEnableOrgCustomAgents=Ht(this.ctx,Je.EnableOrgCustomAgents),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ht(this.ctx,Je.EnableCustomAgents),n=Ht(this.ctx,Je.EnableOrgCustomAgents);r===this.lastEnableCustomAgents&&n===this.lastEnableOrgCustomAgents||(this.lastEnableCustomAgents=r,this.lastEnableOrgCustomAgents=n,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(lu);this.lastCustomAgentPolicyEnabled=e.getPolicyValue("customAgent.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customAgent.enabled");r!==this.lastCustomAgentPolicyEnabled&&(this.lastCustomAgentPolicyEnabled=r,this.notifyAgentListChanged())}))}catch{}try{let e=this.ctx.get(On),r=Array.from(new Set(pyn.values())),n=a(o=>{let s={};for(let c of r)s[c]=o[c];return s},"snapshotGated");this.lastGatedCapabilities=n(e.getCapabilities()),this.gateSubscriptions.push(e.onDidSetCapabilities(o=>{let s=n(o);r.every(c=>s[c]===this.lastGatedCapabilities[c])||(this.lastGatedCapabilities=s,this.notifyAgentListChanged())}))}catch{}}notifyAgentListChanged(){try{this.ctx.get(mA).notify("agent").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(agent) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}syncRegistry(){let e=new Set(t.DEFAULT_AGENT_REGISTRATIONS);for(let r of this.agentFileLocationsPatterns)e.add(r);this.registryAgentPatterns=this.promptFileLocationRegistry.replace(this.registryAgentPatterns,"agent",Array.from(e))}setAgentFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(kn(n.uri)):n.type==="location"&&r.add(KTe.default.posix.join(n.path,t.AGENT_GLOB_SUFFIX));this.agentFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listCustomAgents(e){if(this.ctx.get(lu).getPolicyValue("customAgent.enabled")===!1)return[];await this.ready;let o=(await this.ctx.get(Zm).collect(this.ctx,"agent",e)).map(u=>new y7t(u)),s=this.ctx.get(n3),c=Ht(this.ctx,Je.EnableOrgCustomAgents)!==!1,l=this.ctx.get(On).getCapabilities();return o.filter(u=>{if(this.isOrgScopedAgent(u)){if(!c)return!1;let h=u.promptFileEntry?.parsedPromptFile.uri,m=h?Ko(h):void 0;if(!m||!s.isCachedAgentVisibleFor(m,e))return!1}let d=pyn.get(u.name);if(d===void 0)return!0;let f=l[d]??!1;return f||this.logger.debug(this.ctx,`Filtering out agent '${u.name}' (capability '${d}' is disabled)`),f})}isOrgScopedAgent(e){let r=e.promptFileEntry?.promptPath.metadata;return r?r.some(n=>n[E7t]===_7t.githubOrg):!1}async getCustomAgentById(e,r){return(await this.listCustomAgents(e)).find(o=>o.id===r)}registerExtensionAgent(e,r){let n=[];for(let o of r){if(this.extensionAgents.has(o.uri))continue;let s=this.promptFileLocationRegistry.register("agent",[kn(o.uri)],{watchable:!1,classification:{storage:"extension",extensionInfo:{name:o.name,description:o.description,extensionId:e}}}),c=o.uri,l={dispose:a(()=>{s.dispose(),this.extensionAgents.delete(c),this.agentsByExtension.get(e)?.delete(c),this.agentsByExtension.get(e)?.size===0&&this.agentsByExtension.delete(e)},"dispose")};this.extensionAgents.set(c,l);let u=this.agentsByExtension.get(e);u||(u=new Set,this.agentsByExtension.set(e,u)),u.add(c),n.push(c)}return{dispose:a(()=>{for(let o of n)this.extensionAgents.get(o)?.dispose()},"dispose")}}unregisterExtensionAgents(e){let r=this.agentsByExtension.get(e);if(r)for(let n of[...r])this.extensionAgents.get(n)?.dispose()}resolveAssetsPath(e){let r=KTe.default.extname(__filename)===".ts"?KTe.default.resolve(__dirname,"../../../..",e):KTe.default.resolve(__dirname,e);return this.logger.debug(this.ctx,`Resolved assets path: ${r}`),r}async loadAssetsContributions(e){try{let r=this.resolveAssetsPath(fyn),n=await A7t.promises.readFile(r,"utf8"),s=JSON.parse(n).chatAgents||[];for(let c of s)if(c.name&&c.description&&c.path){let l=this.resolveAssetsPath(c.path);this.promptFileLocationRegistry.register("agent",[l],{watchable:!1,classification:{storage:"clsAssets",extensionInfo:{name:c.name,description:c.description}}})}}catch(r){this.logger.warn(e,`Failed to read assets contribution file ${fyn}:`,r)}}async updateCustomAgent(e,r){if(e.isReadonly)throw new Error(`Cannot update readonly agent: ${e.name}`);await this.agentUpdateSequencer.queue(e.id,async()=>{await this.performUpdateCustomAgent(e,r)})}async performUpdateCustomAgent(e,r){let n=[];a(l=>{l&&n.push(l)},"addIfNotUndefined")(this.updateCustomAgentTools(e,r.updateToolOptions));let s,c=e.promptFileEntry?.parsedPromptFile;if(!c)throw new Error("Cannot update agent: parsedPromptFile is undefined");if(n.forEach(l=>{let u=l(c);u!==void 0&&(s={...s||{},...u})}),s!==void 0){let l={...this.extractHeader(c.header),...s},u="";if(c.header){let m=[];for(let g of c.header.attributes){let A=g.key,y=l[A];if(y!==void 0)if(A==="tools"&&Array.isArray(y)){let E=y.map(_=>JSON.stringify(_).slice(1,-1)).map(_=>`'${_}'`).join(", ");m.push(`tools: [${E}]`)}else{let E=QY({[A]:y}).trim();m.push(E)}}u=m.join(` `)+` `}let d=c.body?.content,f=u?`--- ${u}--- -${d}`:d||"",h=ho(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await p6t.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var DTe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},PTe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},yl={Ask:new PTe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new PTe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new PTe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function Y0n(t){return t===yl.Agent||t.id===yl.Agent.id}a(Y0n,"isBuiltInAgentMode");function KFo(t){return t===yl.InlineAgent||t.id===yl.InlineAgent.id}a(KFo,"isBuiltInInlineAgentMode");function K0n(t){return t===yl.Ask||t.id===yl.Ask.id||Y0n(t)||KFo(t)}a(K0n,"isBuiltInChatMode");function NTe(t){return Y0n(t)||!t.isBuiltIn&&t.customTools===void 0}a(NTe,"shouldApplyGlobalToolsSetting");var x_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[yl.Ask,yl.Agent,yl.InlineAgent],o=await this.ctx.get(jp).listCustomAgents(e||[]);return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new DTe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return yl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??yl.Agent:yl.Agent;case"InlineAgent":return yl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Mc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var CWe=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var JFo=new ge("conversationProgress"),mQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var vc=class{constructor(e){this.ctx=e;this.progressEntries=new nn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);JFo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&Ye.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var Ao={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"};function gQ(t){return t===Ao.Azure?1:0}a(gQ,"getAuthTypeForProvider");function Qce(t){return t===Ao.OpenAI||t===Ao.Gemini||t===Ao.Groq||t===Ao.OpenRouter||t===Ao.Anthropic}a(Qce,"isOpenAICompatible");async function QM(t,e,r){let o=await new bc(t.get(Si)).getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=c?.maxInputTokens||1e5,d=c?.maxOutputTokens||8192;return{modelId:r,uiName:l,modelFamily:Tn.BYOK,providerName:e,deploymentUrl:s?.deploymentUrl,maxRequestTokens:u,maxResponseTokens:d,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(QM,"resolveModelConfiguration");async function vWe(t,e,r){return await new bc(t.get(Si)).getAPIKey(e,r)}a(vWe,"resolveModelKey");function J0n(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(J0n,"resolveAzureUrl");function AQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(AQ,"isBYOKEnabled");var qM="byok",bc=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(qM,`${e}-${r}-api-key`);if(o)return o}return await this.persistenceManager.read(qM,`${e}-api-key`)}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(qM,`${e}-api-key`,r):n===1&&o&&await this.persistenceManager.update(qM,`${e}-${o}-api-key`,r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(qM,`${e}-api-key`):r===1&&n&&await this.persistenceManager.delete(qM,`${e}-${n}-api-key`))}async getStoredModelConfigs(e){return await this.persistenceManager.read(qM,`${e}-models-config`)||{}}async getAllModels(e){let r=[];if(!AQ(await e.get(Qt).getToken()))return r;for(let n of Object.values(Ao)){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(qM,`${e}-models-config`,c),o&&s&&await this.storeAPIKey(e,o,s,r)}async removeModelConfig(e,r){let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(qM,`${e}-models-config`,n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(qM,`${e}-models-config`)}};p();p();p();p();function A6t(t,e){let r=FY(t,e);return r===-1?void 0:t[r]}a(A6t,"findLastMonotonous");function FY(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?TWe.isErrorNoTelemetry(e)?new TWe(e.message+` +${d}`:d||"",h=Ko(c.uri);if(!h)throw new Error(`Invalid file URI: ${c.uri}`);await A7t.promises.writeFile(h,f,{encoding:"utf8"})}}updateCustomAgentTools(e,r){if(r)return n=>{let o=n.header?.tools;if(o!==void 0)return r.forEach(s=>{let c=o.findIndex(l=>l===s.toolConfigurationKey);s.status==="enabled"?c===-1&&o.push(s.toolConfigurationKey):c!==-1&&o.splice(c,1)}),{tools:o}}}extractHeader(e){let r=a(o=>{if(o.type==="array")return[...o.items.map(s=>r(s))];if(o.type==="object"){let s={};return o.properties.forEach(c=>{s[c.key.value]=r(c.value)}),s}return o.value},"extractValue"),n={};return e?.attributes.forEach(o=>{let{key:s,value:c}=o;n[s]=r(c)}),n}};var ZTe=class{constructor(e){this.customAgent=e;this._isBuiltIn=!1;this.kind="Agent";e.promptFileEntry?.promptPath?.storage==="clsAssets"&&(this._isBuiltIn=!0)}static{a(this,"CustomChatMode")}get isBuiltIn(){return this._isBuiltIn}get id(){return this.customAgent.id}get name(){return this.customAgent.name}get uri(){return this.customAgent?.promptFileEntry?.parsedPromptFile?.uri}get description(){return this.customAgent.description}get customTools(){return this.customAgent.tools}get model(){return this.customAgent.model}get handOffs(){return this.customAgent.handOffs}get instruction(){return this.customAgent.instruction}get source(){return this.customAgent}},JTe=class{constructor(e,r,n,o){this.id=e;this.name=r;this.kind=n;this.description=o;this.isBuiltIn=!0}static{a(this,"BuiltInChatMode")}},yl={Ask:new JTe("Ask","Ask","Ask","General purpose chat mode for questions and assistance"),Agent:new JTe("Agent","Agent","Agent","Advanced agent mode with access to tools and capabilities"),InlineAgent:new JTe("InlineAgent","Agent","InlineAgent","Agent mode with a restricted tool set for inline editing")};function myn(t){return t===yl.Agent||t.id===yl.Agent.id}a(myn,"isBuiltInAgentMode");function wQo(t){return t===yl.InlineAgent||t.id===yl.InlineAgent.id}a(wQo,"isBuiltInInlineAgentMode");function gyn(t){return t===yl.Ask||t.id===yl.Ask.id||myn(t)||wQo(t)}a(gyn,"isBuiltInChatMode");function XTe(t){return myn(t)||!t.isBuiltIn&&t.customTools===void 0}a(XTe,"shouldApplyGlobalToolsSetting");var I_=class{constructor(e){this.ctx=e}static{a(this,"ChatModeService")}async listChatModes(e){let r=[yl.Ask,yl.Agent,yl.InlineAgent],o=await this.ctx.get($p).listCustomAgents(e||[]);return r.push(...o.filter(s=>s.invokePolicy.includes("user")).map(s=>new ZTe(s))),r}async getChatMode(e,r,n){switch(e){case"Ask":return yl.Ask;case"Agent":return r?await this.getCustomChatModeById(r,n)??yl.Agent:yl.Agent;case"InlineAgent":return yl.InlineAgent}}async getCustomChatModeById(e,r){return(await this.listChatModes(r)).find(o=>o.id===e)}};p();var Dc=class extends Error{static{a(this,"CanceledError")}constructor(){super("Canceled"),this.name="Canceled"}};p();var $ze=class{constructor(){this._tools=new Map}static{a(this,"ToolRegistry")}registerTool(e){this._tools.set(e.id,e)}unregisterTool(e){return this._tools.delete(e)}getTool(e){return this._tools.get(e)}listTools(){return Array.from(this._tools.values())}};p();p();p();var RQo=new Ae("conversationProgress"),kQ={Unknown:-1,Default:0,ToolRoundExceedError:1e4};var vc=class{constructor(e){this.ctx=e;this.progressEntries=new yn(250)}static{a(this,"ConversationProgress")}async begin(e,r,n){let o={status:"open",handler:n};this.progressEntries.set(e.id,o),await o.handler.begin(this.ctx,e,r)}async report(e,r,n){let o=this.getProgressEntry(e);if(o.status==="open")await o.handler.report(this.ctx,e,r,n);else{let s=Object.keys(n).filter(c=>n[c]!==void 0);RQo.debug(this.ctx,`conversationProgress.report(): dropped because status is '${o.status}' (not open) for conversation ${e.id}. Dropped payload fields: [${s.join(", ")}]. If tokenUsage is among dropped fields, this is a cause of token usage not reaching $progress.`)}}async end(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"done",updatedAt:Date.now()}),await o.handler.end(this.ctx,e,r,n))}async cancel(e,r,n){let o=this.getProgressEntry(e);o.status==="open"&&(this.progressEntries.set(e.id,{...o,status:"cancelled",updatedAt:Date.now()}),await o.handler.cancel(this.ctx,e,r,n))}getCurrentHandler(e){return this.progressEntries.get(e.id)?.handler}getProgressEntry(e){let r=this.progressEntries.get(e.id);if(r===void 0)throw new Error(`No work done token for conversation ${e.id}`);return r.status!=="open"&&ot.error(this.ctx,`Work done token for conversation ${e.id} is already ${r.status}, last updated at ${r.updatedAt}`),r}};p();p();p();var go={Azure:"Azure",OpenAI:"OpenAI",Gemini:"Gemini",Groq:"Groq",OpenRouter:"OpenRouter",Anthropic:"Anthropic"};function DQ(t){return t===go.Azure?1:0}a(DQ,"getAuthTypeForProvider");function Xce(t){return t===go.OpenAI||t===go.Gemini||t===go.Groq||t===go.OpenRouter||t===go.Anthropic}a(Xce,"isOpenAICompatible");async function HM(t,e,r){let o=await new Cc(t.get(yi)).getStoredModelConfigs(e),s=o&&o[r]&&o[r].isRegistered!==!1?o[r]:void 0,c=s?.modelCapabilities,l=c?.name||r,u=c?.maxInputTokens||1e5,d=c?.maxOutputTokens||8192;return{modelId:r,uiName:l,modelFamily:Tn.BYOK,providerName:e,deploymentUrl:s?.deploymentUrl,maxRequestTokens:u,maxResponseTokens:d,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!!c?.toolCalling,supportsThinking:!!c?.thinking,originalBillingMultiplier:0}}a(HM,"resolveModelConfiguration");async function Vze(t,e,r){return await new Cc(t.get(yi)).getAPIKey(e,r)}a(Vze,"resolveModelKey");function Ayn(t,e){let{protocol:r,hostname:n,pathname:o}=new URL(e);if(o.endsWith("/chat/completions"))return e;if(n.endsWith(".models.ai.azure.com")||n.endsWith(".inference.ml.azure.com"))return`${r}//${n}/v1/chat/completions`;if(n.endsWith(".openai.azure.com"))return`${r}//${n}/openai/deployments/${t}/chat/completions?api-version=2025-01-01-preview`;throw new Error(`Unrecognized Azure deployment URL: ${e}`)}a(Ayn,"resolveAzureUrl");function NQ(t){return t.userInfo.isIndividualUser||t.isClientBYOKEnabled}a(NQ,"isBYOKEnabled");var GM="byok",Cc=class{constructor(e){this.persistenceManager=e}static{a(this,"BYOKPersistence")}async getAPIKey(e,r){if(r){let o=await this.persistenceManager.read(GM,`${e}-${r}-api-key`);if(o)return o}return await this.persistenceManager.read(GM,`${e}-api-key`)}async storeAPIKey(e,r,n,o){n!==2&&(n===0?await this.persistenceManager.update(GM,`${e}-api-key`,r):n===1&&o&&await this.persistenceManager.update(GM,`${e}-${o}-api-key`,r))}async deleteAPIKey(e,r,n){r!==2&&(r===0?await this.persistenceManager.delete(GM,`${e}-api-key`):r===1&&n&&await this.persistenceManager.delete(GM,`${e}-${n}-api-key`))}async getStoredModelConfigs(e){return await this.persistenceManager.read(GM,`${e}-models-config`)||{}}async getAllModels(e){let r=[];if(!NQ(await e.get(Ut).getToken()))return r;for(let n of Object.values(go)){let o=await this.getStoredModelConfigs(n);r.push(...Object.keys(o).map(s=>({name:s,provider:n,capabilities:o[s].modelCapabilities})))}return r}async saveModelConfig(e,r,n,o,s){let c=await this.getStoredModelConfigs(e);c[r]=n,await this.persistenceManager.update(GM,`${e}-models-config`,c),o&&s&&await this.storeAPIKey(e,o,s,r)}async removeModelConfig(e,r){let n=await this.getStoredModelConfigs(e),o=n[r];o&&(delete n[r],await this.persistenceManager.update(GM,`${e}-models-config`,n),o.deploymentUrl&&await this.deleteAPIKey(e,1,r))}async removeAllModelConfigs(e){await this.persistenceManager.delete(GM,`${e}-models-config`)}};p();p();p();p();function v7t(t,e){let r=KY(t,e);return r===-1?void 0:t[r]}a(v7t,"findLastMonotonous");function KY(t,e,r=0,n=t.length){let o=r,s=n;for(;o{throw e.stack?Yze.isErrorNoTelemetry(e)?new Yze(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(r=>{r(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)}},ZFo=new y6t;function qce(t){_6t(t)||ZFo.onUnexpectedError(t)}a(qce,"onUnexpectedError");var E6t="Canceled";function _6t(t){return t instanceof w_?!0:t instanceof Error&&t.name===E6t&&t.message===E6t}a(_6t,"isCancellationError");var w_=class extends Error{static{a(this,"CancellationError")}constructor(){super(E6t),this.name=this.message}};var TWe=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Oc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function C6t(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(b6t,"shuffle");var emn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(emn||={});function jce(t,e){return(r,n)=>e(t(r),t(n))}a(jce,"compareBy");var Hce=a((t,e)=>t-e,"numberComparator");var X0n=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||emn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function MTe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(MTe,"sumBy");p();function imn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(imn,"groupBy");var rmn,nmn,tmn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[rmn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(nmn=Symbol.iterator,rmn=Symbol.toStringTag,nmn)](){return this.values()}};p();function S6t(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(S6t,"createSingleCallFunction");p();var T6t;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let k of T)x=w(x,k);return x}b.reduce=y,a(y,"reduce");function*E(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new I6t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(smn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},amn,omn=class{constructor(e,r){this[amn]="ResourceSet";!e||typeof e=="function"?this._map=new IWe(e):(this._map=new IWe(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(amn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var cmn,x6t=class{constructor(){this[cmn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(cmn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},w6t=class extends x6t{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},xWe=class extends w6t{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var wWe=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var e8o=!1,Gce=null;var lmn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` -`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new wWe;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` -`),u)}n.sort(jce(u=>u.idx,Hce));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;h{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(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)}},PQo=new C7t;function ele(t){S7t(t)||PQo.onUnexpectedError(t)}a(ele,"onUnexpectedError");var b7t="Canceled";function S7t(t){return t instanceof x_?!0:t instanceof Error&&t.name===b7t&&t.message===b7t}a(S7t,"isCancellationError");var x_=class extends Error{static{a(this,"CancellationError")}constructor(){super(b7t),this.name=this.message}};var Yze=class t extends Error{static{a(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let r=new t;return r.message=e.message,r.stack=e.stack,r}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Nc=class t extends Error{static{a(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};function T7t(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n{let o=Math.sin(n++)*179426549;return o-Math.floor(o)},"rand")}else r=Math.random;for(let n=t.length-1;n>0;n-=1){let o=Math.floor(r()*(n+1)),s=t[n];t[n]=t[o],t[o]=s}}a(x7t,"shuffle");var _yn;(l=>{function t(u){return u<0}l.isLessThan=t,a(t,"isLessThan");function e(u){return u<=0}l.isLessThanOrEqual=e,a(e,"isLessThanOrEqual");function r(u){return u>0}l.isGreaterThan=r,a(r,"isGreaterThan");function n(u){return u===0}l.isNeitherLessOrGreaterThan=n,a(n,"isNeitherLessOrGreaterThan"),l.greaterThan=1,l.lessThan=-1,l.neitherLessOrGreaterThan=0})(_yn||={});function tle(t,e){return(r,n)=>e(t(r),t(n))}a(tle,"compareBy");var rle=a((t,e)=>t-e,"numberComparator");var Eyn=class t{constructor(e){this.iterate=e}static{a(this,"CallbackIterable")}static{this.empty=new t(e=>{})}forEach(e){this.iterate(r=>(e(r),!0))}toArray(){let e=[];return this.iterate(r=>(e.push(r),!0)),e}filter(e){return new t(r=>this.iterate(n=>e(n)?r(n):!0))}map(e){return new t(r=>this.iterate(n=>r(e(n))))}some(e){let r=!1;return this.iterate(n=>(r=e(n),!r)),r}findFirst(e){let r;return this.iterate(n=>e(n)?(r=n,!1):!0),r}findLast(e){let r;return this.iterate(n=>(e(n)&&(r=n),!0)),r}findLastMaxBy(e){let r,n=!0;return this.iterate(o=>((n||_yn.isGreaterThan(e(o,r)))&&(n=!1,r=o),!0)),r}};function eIe(t,e){return t.reduce((r,n)=>r+e(n),0)}a(eIe,"sumBy");p();function Syn(t,e){let r=Object.create(null);for(let n of t){let o=e(n),s=r[o];s||(s=r[o]=[]),s.push(n)}return r}a(Syn,"groupBy");var Cyn,byn,vyn=class{constructor(e,r){this.toKey=r;this._map=new Map;this[Cyn]="SetWithKey";for(let n of e)this.add(n)}static{a(this,"SetWithKey")}get size(){return this._map.size}add(e){let r=this.toKey(e);return this._map.set(r,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,r){this._map.forEach(n=>e.call(r,n,n,this))}[(byn=Symbol.iterator,Cyn=Symbol.toStringTag,byn)](){return this.values()}};p();function w7t(t,e){let r=this,n=!1,o;return function(){if(n)return o;if(n=!0,e)try{o=t.apply(r,arguments)}finally{e()}else o=t.apply(r,arguments);return o}}a(w7t,"createSingleCallFunction");p();var R7t;(b=>{function t(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}b.is=t,a(t,"is");let e=Object.freeze([]);function r(){return e}b.empty=r,a(r,"empty");function*n(T){yield T}b.single=n,a(n,"single");function o(T){return t(T)?T:n(T)}b.wrap=o,a(o,"wrap");function s(T){return T||e}b.from=s,a(s,"from");function*c(T){for(let w=T.length-1;w>=0;w--)yield T[w]}b.reverse=c,a(c,"reverse");function l(T){return!T||T[Symbol.iterator]().next().done===!0}b.isEmpty=l,a(l,"isEmpty");function u(T){return T[Symbol.iterator]().next().value}b.first=u,a(u,"first");function d(T,w){let R=0;for(let x of T)if(w(x,R++))return!0;return!1}b.some=d,a(d,"some");function f(T,w){for(let R of T)if(w(R))return R}b.find=f,a(f,"find");function*h(T,w){for(let R of T)w(R)&&(yield R)}b.filter=h,a(h,"filter");function*m(T,w){let R=0;for(let x of T)yield w(x,R++)}b.map=m,a(m,"map");function*g(T,w){let R=0;for(let x of T)yield*w(x,R++)}b.flatMap=g,a(g,"flatMap");function*A(...T){for(let w of T)yield*w}b.concat=A,a(A,"concat");function y(T,w,R){let x=R;for(let P of T)x=w(x,P);return x}b.reduce=y,a(y,"reduce");function*E(T,w,R=T.length){for(w<-T.length&&(w=0),w<0&&(w+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);we.toString(),"defaultToKey")}set(e,r){return this.map.set(this.toKey(e),new P7t(e,r)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,r){typeof r<"u"&&(e=e.bind(r));for(let[n,o]of this.map)e(o.value,o.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Iyn=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},xyn,Tyn=class{constructor(e,r){this[xyn]="ResourceSet";!e||typeof e=="function"?this._map=new Kze(e):(this._map=new Kze(r),e.forEach(this.add,this))}static{a(this,"ResourceSet")}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,r){this._map.forEach((n,o)=>e.call(r,o,o,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(xyn=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var wyn,k7t=class{constructor(){this[wyn]="LinkedMap";this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}static{a(this,"LinkedMap")}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=0){let n=this._map.get(e);if(n)return r!==0&&this.touch(n,r),n.value}set(e,r,n=0){let o=this._map.get(e);if(o)o.value=r,n!==0&&this.touch(o,n);else{switch(o={key:e,value:r,next:void 0,previous:void 0},n){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(e,o),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,o=this._head;for(;o;){if(r?e.bind(r)(o.value,o.key,this):e(o.value,o.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.key,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}values(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:n.value,done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}entries(){let e=this,r=this._state,n=this._head,o={[Symbol.iterator](){return o},next(){if(e._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let s={value:[n.key,n.value],done:!1};return n=n.next,s}else return{value:void 0,done:!0}}};return o}[(wyn=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._tail,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.previous,n--;this._tail=r,this._size=n,r&&(r.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r}e.next=void 0,e.previous=void 0,this._state++}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==1&&r!==2)){if(r===1){if(e===this._head)return;let n=e.next,o=e.previous;e===this._tail?(o.next=void 0,this._tail=o):(n.previous=o,o.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(r===2){if(e===this._tail)return;let n=e.next,o=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=o,o.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r])}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n)}},D7t=class extends k7t{static{a(this,"Cache")}constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,r=2){return super.get(e,r)}peek(e){return super.get(e,0)}set(e,r){return super.set(e,r,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Jze=class extends D7t{static{a(this,"LRUCache")}constructor(e,r=1){super(e,r)}trim(e){this.trimOld(e)}set(e,r){return super.set(e,r),this.checkTrim(),this}};var Zze=class{constructor(){this.map=new Map}static{a(this,"SetMap")}add(e,r){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(r)}delete(e,r){let n=this.map.get(e);n&&(n.delete(r),n.size===0&&this.map.delete(e))}forEach(e,r){let n=this.map.get(e);n&&n.forEach(r)}get(e){let r=this.map.get(e);return r||new Set}};var DQo=!1,nle=null;var Ryn=class t{constructor(){this.livingDisposables=new Map}static{a(this,"DisposableTracker")}static{this.idx=0}getDisposableData(e){let r=this.livingDisposables.get(e);return r||(r={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,r)),r}trackDisposable(e){let r=this.getDisposableData(e);r.source||(r.source=new Error().stack)}setParent(e,r){let n=this.getDisposableData(e);n.parent=r}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,r){let n=r.get(e);if(n)return n;let o=e.parent?this.getRootParent(this.getDisposableData(e.parent),r):e;return r.set(e,o),o}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,n])=>n.source!==null&&!this.getRootParent(n,e).isSingleton).flatMap(([n])=>n)}computeLeakingDisposables(e=10,r){let n;if(r)n=r;else{let u=new Map,d=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,u).isSingleton);if(d.length===0)return;let f=new Set(d.map(h=>h.value));if(n=d.filter(h=>!(h.parent&&f.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function o(u){function d(h,m){for(;h.length>0&&m.some(g=>typeof g=="string"?g===h[0]:h[0].match(g));)h.shift()}a(d,"removePrefix");let f=u.source.split(` +`).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return d(f,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),f.reverse()}a(o,"getStackTracePath");let s=new Zze;for(let u of n){let d=o(u);for(let f=0;f<=d.length;f++)s.add(d.slice(0,f).join(` +`),u)}n.sort(tle(u=>u.idx,rle));let c="",l=0;for(let u of n.slice(0,e)){l++;let d=o(u),f=[];for(let h=0;ho(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` +`)),y=Syn([...A].map(E=>o(E)[h]),E=>E);delete y[d[h]];for(let[E,_]of Object.entries(y))f.unshift(` - stacktraces of ${_.length} other leaks continue with ${E}`);f.unshift(m)}c+=` ==================== Leaking disposable ${l}/${n.length}: ${u.value.constructor.name} ==================== @@ -2357,7 +2388,7 @@ ${f.join(` ... and ${n.length-e} more leaking disposables -`),{leaks:n,details:c}}};function t8o(t){Gce=t}a(t8o,"setDisposableTracker");if(e8o){let t="__is_disposable_tracked__";t8o(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==R_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==R_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function k6t(t){return Gce?.trackDisposable(t),t}a(k6t,"trackDisposable");function P6t(t){Gce?.markAsDisposed(t)}a(P6t,"markAsDisposed");function R6t(t,e){Gce?.setParent(t,e)}a(R6t,"setParentOfDisposable");function r8o(t,e){if(Gce)for(let r of t)Gce.setParent(r,e)}a(r8o,"setParentOfDisposables");function umn(t){if(T6t.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(umn,"dispose");function dmn(...t){let e=RWe(()=>umn(t));return r8o(t,e),e}a(dmn,"combinedDisposable");function RWe(t){let e=k6t({dispose:S6t(()=>{P6t(e),t()})});return e}a(RWe,"toDisposable");var yQ=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;k6t(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(P6t(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{umn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return R6t(e,this),this._isDisposed?t.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),R6t(e,null))}},R_=class{constructor(){this._store=new yQ;k6t(this),R6t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){P6t(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function $ce(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a($ce,"formatResetDate");var EQ=class{static{a(this,"QuotaWarningNotifier")}};var UY=class{static{a(this,"QuotaChangeNotifier")}};var D6t=[50,75,90,95],Rd=class extends R_{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(Es(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(UY).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=D6t[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(D6t[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(EQ).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(EQ).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${$ce(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function kWe(t){let e=await t.get(Ur).resolveSession();if(e){let r=await QCe(t,e);if(r.ok){let n=await r.json();t.get(Rd).processUserInfoQuotaSnapshot(n)}}}a(kWe,"refreshUserQuota");p();p();var OTe=new ge("openAICompatibleLMProvider"),Vce={[Ao.OpenAI]:"https://api.openai.com/v1",[Ao.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[Ao.Groq]:"https://api.groq.com/openai/v1",[Ao.OpenRouter]:"https://openrouter.ai/api/v1",[Ao.Anthropic]:"https://api.anthropic.com/v1"},Rx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new bc(this.ctx.get(Si)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id];u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=Vce[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();!this._knownModels&&(this._knownModels=await this.fetchKnownModelList(),this._lastFetchTime=e)}async fetchKnownModelList(){let e=await(await this.ctx.get(ar).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*_Q(t,e){for await(let r of t)yield e(r)}a(_Q,"asyncIterableMap");async function*fmn(t,e){for await(let r of t)await e(r)&&(yield r)}a(fmn,"asyncIterableFilter");async function*BTe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(BTe,"asyncIterableMapFilter");async function*pmn(...t){for(let e of t)yield*e}a(pmn,"asyncIterableConcat");p();var PWe="interleaved-thinking-2025-05-14";p();var fP=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var Bc=class{static{a(this,"ModelConfigurationProvider")}},DWe=class extends Bc{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw Ye.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(dc).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(dc).getMetadata(),o=s8o(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===Tn.Gpt35turbo||r===Tn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:M6t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Tn.Gpt4||r===Tn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:M6t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Tn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await n8o(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:N6t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:i8o(s),maxLongContextTokens:o8o(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===ZHe.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function n8o(t,e){let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),M6t(o,e)}a(n8o,"getExpRequestTokens");function M6t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(M6t,"getRequestTokens");function i8o(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(i8o,"getMaxRequestTokens");function o8o(t){return t.billing?.token_prices?.long_context?.context_max}a(o8o,"getMaxLongContextTokens");function N6t(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(N6t,"getResponseTokens");function s8o(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(s8o,"filterModelsByCapabilities");function CQ(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(CQ,"pickReasoningEffort");function a8o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(a8o,"shouldUseResponsesApi");function c8o(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(c8o,"shouldUseMessagesApi");var hmn=["completions","responses","v1/messages"];function NWe(t,e){return e?"v1/messages":t&&a8o(t)?"responses":"completions"}a(NWe,"resolveEndpointRoute");function MWe(t,e){if(!c8o(e))return!1;let r=qt(t,je.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(MWe,"willUseMessagesEndpoint");p();function OWe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(OWe,"isCodexStyleGptModel");function mmn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(mmn,"isGpt5PlusFamily");function gmn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(gmn,"isAnthropicModel");p();p();function Amn(t,e){!e||!e.providerName||(e.providerName===Ao.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&delete t.max_tokens)}a(Amn,"adaptRequestForBYOKProvider");p();p();var IS=class{static{a(this,"RateLimitNotifier")}},BWe=class extends IS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var O6t=[50,75,90,95],jM=class extends R_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(Es(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(IS).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=O6t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(O6t[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=$ce(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();p();p();var vQ="copilot-edits-session";p();p();p();p();Ns();function LWe(t,e,r,n,o,s,c){return dWr(t,e,r,o,n,c),{completionText:e,meanLogProb:l8o(t,r),meanAlternativeLogProb:u8o(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:gr(),finishReason:r.finish_reason}}a(LWe,"convertToAPIChoice");function l8o(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Dr.exception(t,r,"Error calculating mean prob")}}a(l8o,"calculateMeanLogProb");function u8o(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Dr.exception(t,r,"Error calculating mean prob")}}a(u8o,"calculateMeanAlternativeLogProb");function Wce(t,e){return v1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(Wce,"getTemperatureForSamples");var d8o={markdown:[` +`),{leaks:n,details:c}}};function NQo(t){nle=t}a(NQo,"setDisposableTracker");if(DQo){let t="__is_disposable_tracked__";NQo(new class{trackDisposable(e){let r=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(r)},3e3)}setParent(e,r){if(e&&e!==w_.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==w_.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function M7t(t){return nle?.trackDisposable(t),t}a(M7t,"trackDisposable");function O7t(t){nle?.markAsDisposed(t)}a(O7t,"markAsDisposed");function N7t(t,e){nle?.setParent(t,e)}a(N7t,"setParentOfDisposable");function MQo(t,e){if(nle)for(let r of t)nle.setParent(r,e)}a(MQo,"setParentOfDisposables");function Pyn(t){if(R7t.is(t)){let e=[];for(let r of t)if(r)try{r.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}a(Pyn,"dispose");function kyn(...t){let e=Xze(()=>Pyn(t));return MQo(t,e),e}a(kyn,"combinedDisposable");function Xze(t){let e=M7t({dispose:w7t(()=>{O7t(e),t()})});return e}a(Xze,"toDisposable");var MQ=class t{constructor(){this._toDispose=new Set;this._isDisposed=!1;M7t(this)}static{a(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(O7t(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Pyn(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return N7t(e,this),this._isDisposed?t.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),N7t(e,null))}},w_=class{constructor(){this._store=new MQ;M7t(this),N7t(this._store,this)}static{a(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}dispose(){O7t(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};p();function ile(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let r=new Date,n=e.getFullYear()!==r.getFullYear();return new Intl.DateTimeFormat("en-US",n?{month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}:{month:"long",day:"numeric",hour:"numeric",minute:"2-digit"}).format(e)}a(ile,"formatResetDate");var OQ=class{static{a(this,"QuotaWarningNotifier")}};var JY=class{static{a(this,"QuotaChangeNotifier")}};var B7t=[50,75,90,95],uu=class extends w_{constructor(r){super();this._shownThresholds={chat:new Set,completions:new Set,premium_interactions:new Set};this._hasNotifiedOverage={};this._isTBBEnabled=!1;this._canUpgradePlan=!1;this._turnCredits=new Map;this._ctx=r,this._register(ys(r,n=>{let o=n.userInfo?.raw?.analytics_tracking_id;if(o!==this._userId){for(let s of Object.values(this._shownThresholds))s.clear();this._hasNotifiedOverage={},this._turnCredits.clear(),this._userId=o}this._copilotPlan=n.userInfo.copilotPlan,this._isTBBEnabled=!!n.userInfo?.isTBBEnabled,this._canUpgradePlan=!!n.userInfo?.canUpgradePlan,this.processUserInfoQuotaSnapshot(n.userInfo?.raw)}))}static{a(this,"ChatQuotaService")}get overageEnabled(){return this._quotaInfo?.chat?.overageEnabled===!0||this._quotaInfo?.completions?.overageEnabled===!0||this._quotaInfo?.premium_interactions?.overageEnabled===!0}get quotaExhausted(){return this._quotaInfo?.premium_interactions?this._quotaInfo.premium_interactions.used>=this._quotaInfo.premium_interactions.quota&&!this._quotaInfo.premium_interactions.overageEnabled:!1}setLastCopilotUsage(r,n){let o=r/1e9;this.addAic(o,n)}addAic(r,n){r>0&&this._turnCredits.set(n,(this._turnCredits.get(n)??0)+r)}transferTurnCredits(r,n){if(r===n)return;let o=this._turnCredits.get(r);o!==void 0&&(this._turnCredits.delete(r),this.addAic(o,n))}resetTurnCredits(r){this._turnCredits.delete(r)}getCreditsForTurn(r){return this._turnCredits.get(r)}clearQuota(){this._quotaInfo=void 0}processQuotaHeaders(r){let n=r.get("x-quota-snapshot-premium_models")||r.get("x-quota-snapshot-premium_interactions"),o=r.get("x-quota-snapshot-chat"),s=r.get("x-quota-snapshot-completions");!n&&!o&&!s||(this._quotaInfo={chat:this._parseQuotaHeader(o),completions:this._parseQuotaHeader(s),premium_interactions:this._parseQuotaHeader(n)},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse()))}processUserInfoQuotaSnapshot(r){if(!r?.quota_snapshots)return;let{chat:n,completions:o,premium_interactions:s}=r.quota_snapshots;this._quotaInfo={chat:n?this._buildSnapshotFromRaw(n):void 0,completions:o?this._buildSnapshotFromRaw(o):void 0,premium_interactions:s?this._buildSnapshotFromRaw(s):void 0},this.sendQuotaChangeNotification(),this._isTBBEnabled&&(this.checkAndNotifyQuotaThreshold(),this.checkAndNotifyOverageInUse())}_parseQuotaHeader(r){if(r)try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("ov")||"0.0"),c=n.get("ovPerm")==="true",l=Number.parseFloat(n.get("rem")||"0.0"),u=n.get("rst")??"",d=Math.max(0,o*(1-l/100)),f=o<0;return{quota:o,used:d,percentRemaining:l,overageUsed:s,overageEnabled:c,resetDate:u,unlimited:f}}catch(n){console.error("Failed to parse quota header",n);return}}_buildSnapshotFromRaw(r){return{overageEnabled:r.overage_permitted,overageUsed:r.overage_count,quota:r.entitlement,percentRemaining:r.percent_remaining,resetDate:r.quota_reset_at!=null&&r.quota_reset_at!==0?new Date(r.quota_reset_at*1e3).toISOString():"",used:Math.max(0,r.entitlement*(1-r.percent_remaining/100)),unlimited:r.unlimited}}async sendQuotaChangeNotification(){if(!this._quotaInfo)return;let r={chat:this._quotaInfo.chat,completions:this._quotaInfo.completions,premium_interactions:this._quotaInfo.premium_interactions,copilotPlan:this._copilotPlan};if(this._hasQuotaChanged(r)){this._lastSentQuotaParams=r;try{await this._ctx.get(JY).notifyQuotaChange(r)}catch(n){console.warn("Failed to send quota change notification",n)}}}_hasQuotaChanged(r){let n=this._lastSentQuotaParams;return n?n.copilotPlan!==r.copilotPlan||this._hasSnapshotChanged(n.chat,r.chat)||this._hasSnapshotChanged(n.completions,r.completions)||this._hasSnapshotChanged(n.premium_interactions,r.premium_interactions):!0}_hasSnapshotChanged(r,n){return r===void 0&&n===void 0?!1:r===void 0||n===void 0?!0:r.overageUsed!==n.overageUsed||r.overageEnabled!==n.overageEnabled||r.percentRemaining!==n.percentRemaining||r.quota!==n.quota||r.used!==n.used||r.resetDate!==n.resetDate}_isSnapshotNotificationActive(r){return r?.notified?!r.resetDate||new Date=0;s--){let c=B7t[s];if(o>=c&&!n.has(c)){for(let l=0;l<=s;l++)n.add(B7t[l]);return c}}}async _checkAndNotifyOverageSnapshot(r,n,o){if(!(!r||r.quota<=0)&&r.percentRemaining===0&&r.overageEnabled&&!this._isSnapshotNotificationActive(this._hasNotifiedOverage[n])){this._hasNotifiedOverage={...this._hasNotifiedOverage,[n]:{notified:!0,resetDate:r.resetDate}};try{await this._ctx.get(OQ).notifyQuotaWarning(this._buildWarningParams(o,"info"))}catch{}}}async checkAndNotifyOverageInUse(){this._quotaInfo&&(this._copilotPlan==="free"?(await this._checkAndNotifyOverageSnapshot(this._quotaInfo.chat,"chat","You are currently on overage spend until your chat limit resets."),await this._checkAndNotifyOverageSnapshot(this._quotaInfo.completions,"completions","You are currently on overage spend until your completions limit resets.")):await this._checkAndNotifyOverageSnapshot(this._quotaInfo.premium_interactions,"premium_interactions","You are currently on overage spend until your monthly limit resets."))}async checkAndNotifyQuotaThreshold(){if(!this._quotaInfo)return;let r=a(async(n,o)=>{let s=this._shownThresholds[o];if(this.clearStaleThresholds(n,s),this.checkThreshold(n,s)===void 0||!n)return;let l=n&&100-n.percentRemaining>=90?"warning":"info",u=100-n.percentRemaining,d=this.getQuotaThresholdMessage(o,u,n.resetDate);try{await this._ctx.get(OQ).notifyQuotaWarning(this._buildWarningParams(d,l))}catch{}},"notifyForSnapshot");this._copilotPlan==="free"?(await r(this._quotaInfo.chat,"chat"),await r(this._quotaInfo.completions,"completions")):await r(this._quotaInfo.premium_interactions,"premium_interactions")}getQuotaThresholdMessage(r,n,o){return r==="chat"||r==="completions"?n>=95?`You're close to your ${r} limit. Upgrade your plan to continue uninterrupted.`:`You've used over ${n}% of your ${r} budget. Upgrade your plan to continue uninterrupted.`:o?`You've used over ${n}% of your included AI credits. Limits reset on ${ile(o)}.`:`You've used over ${n}% of your included AI credits.`}};async function eYe(t){let e=await t.get(Fr).resolveSession();if(e){let r=await wve(t,e);if(r.ok){let n=await r.json();t.get(uu).processUserInfoQuotaSnapshot(n)}}}a(eYe,"refreshUserQuota");p();p();var tIe=new Ae("openAICompatibleLMProvider"),ole={[go.OpenAI]:"https://api.openai.com/v1",[go.Gemini]:"https://generativelanguage.googleapis.com/v1beta/openai",[go.Groq]:"https://api.groq.com/openai/v1",[go.OpenRouter]:"https://openrouter.ai/api/v1",[go.Anthropic]:"https://api.anthropic.com/v1"},kx=class{constructor(e,r){this._lastFetchTime=0;this.providerName=e,this.ctx=r}static{a(this,"BaseOpenAICompatibleLMProvider")}async getAllModels(){await this.ensureKnownModelsCache();try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new Cc(this.ctx.get(yi)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data){let u=this._knownModels?.[l.id];u&&c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:u})}return c}catch(e){throw tIe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getBaseUrl(){let e=ole[this.providerName];if(!e)throw new Error(`Unsupported provider: ${this.providerName}`);return e}getFetchModelUrl(){return`${this.getBaseUrl()}/models`}async ensureKnownModelsCache(){let e=Date.now();!this._knownModels&&(this._knownModels=await this.fetchKnownModelList(),this._lastFetchTime=e)}async fetchKnownModelList(){let e=await(await this.ctx.get(cr).fetch("https://main.vscode-cdn.net/extensions/copilotChat.json",{method:"GET"})).json(),r;return e.version!==1?r={}:r=e.modelInfo[this.providerName]||{},r}};p();async function*rIe(t,e){for await(let r of t)yield e(r)}a(rIe,"asyncIterableMap");async function*Dyn(t,e){for await(let r of t)await e(r)&&(yield r)}a(Dyn,"asyncIterableFilter");async function*nIe(t,e){for await(let r of t){let n=await e(r);n!==void 0&&(yield n)}}a(nIe,"asyncIterableMapFilter");p();var tYe="interleaved-thinking-2025-05-14";p();var Ek=class{static{a(this,"EndpointStrategyFactory")}static{this.strategies=new Map}static register(e){this.strategies.set(e.name,e)}static getStrategy(e){let r=this.strategies.get(e);if(!r){let n=this.strategies.get("completions");if(!n)throw new Error(`No strategy registered for endpoint '${e}' and no fallback strategy available. Available: ${Array.from(this.strategies.keys()).join(", ")}`);return n}return r}static hasStrategy(e){return this.strategies.has(e)}};p();var Yc=class{static{a(this,"ModelConfigurationProvider")}},rYe=class extends Yc{constructor(r){super();this.ctx=r}static{a(this,"DefaultModelConfigurationProvider")}async getBestChatModelConfig(r,n,o=!1){let s=[];for(let c of r){let l=await this.getFirstMatchingChatModelConfiguration(c,n,o);l&&s.push(l)}if(s.length>0){let c=s.find(l=>l.isExperimental);return c||s[0]}throw ot.error(this.ctx,`No model configuration found for families: ${r.join(", ")}. Available models: ${JSON.stringify(await this.ctx.get(Fa).getMetadata())}`),new Error("No model configuration found")}async getFirstMatchingModelMetadata(r){let n=await this.ctx.get(Fa).getMetadata(),o=BQo(n,r);if(o.length>0)return o[0]}async getFirstMatchingChatModelConfiguration(r,n,o){let s=await this.getFirstMatchingModelMetadata({family:r,type:"chat",supports:n,modelPickerEnabled:o});if(s===void 0)return;let c=s.supported_endpoints&&s.supported_endpoints.length>0?s.supported_endpoints:["/chat/completions"],l=s.capabilities.supports?.adaptive_thinking??!1,u=s.capabilities.supports?.reasoning_effort;return r===Tn.Gpt35turbo||r===Tn.Gpt4oMini?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:F7t(6144,s),maxLongContextTokens:void 0,maxResponseTokens:L7t(2048,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Tn.Gpt4||r===Tn.Gpt4turbo?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:F7t(10240,s),maxLongContextTokens:void 0,maxResponseTokens:L7t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:r===Tn.Gpt4o?{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:await OQo(this.ctx,s),maxLongContextTokens:void 0,maxResponseTokens:L7t(4096,s),baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}:{modelId:s.id,uiName:s.name,modelFamily:r,maxRequestTokens:Nyn(s),maxLongContextTokens:Myn(s),maxResponseTokens:s.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:s.capabilities.tokenizer,isExperimental:s.isExperimental??!1,stream:s.capabilities.supports?.streaming??!1,toolCalls:s.capabilities.supports?.tool_calls??!1,supportedEndpoints:c,supportsAdaptiveThinking:l,reasoningEfforts:u,originalBillingMultiplier:s.billing?.multiplier??0}}async getModelConfigurationById(r){let o=(await this.ctx.get(Fa).getMetadata()).find(c=>c.id===r&&c.capabilities.type==="chat"&&c.model_picker_enabled===!0);if(!o)return;let s=o.supported_endpoints&&o.supported_endpoints.length>0?o.supported_endpoints:["/chat/completions"];return{modelId:o.id,uiName:o.name,modelFamily:o.capabilities.family,maxRequestTokens:Nyn(o),maxLongContextTokens:Myn(o),maxResponseTokens:o.capabilities.limits?.max_output_tokens??4096,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:o.capabilities.tokenizer,isExperimental:o.isExperimental??!1,stream:o.capabilities.supports?.streaming??!1,toolCalls:o.capabilities.supports?.tool_calls??!1,supportedEndpoints:s,supportsAdaptiveThinking:o.capabilities.supports?.adaptive_thinking??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,originalBillingMultiplier:o.billing?.multiplier??0}}async getFirstMatchingEmbeddingModelConfiguration(r){let n=await this.getFirstMatchingModelMetadata({family:r,type:"embeddings"});if(n!==void 0&&r===Wsn.textEmbedding3Small)return{modelId:n.id,modelFamily:r,maxBatchSize:n.capabilities.limits?.max_inputs??16,maxTokens:8191,tokenizer:"cl100k_base"}}};async function OQo(t,e){let r=t.get(Jt),n=await r.fetchTokenAndUpdateExPValuesAndAssignments(),o=r.ideChatMaxRequestTokens(n);return o===-1&&(o=16384),F7t(o,e)}a(OQo,"getExpRequestTokens");function F7t(t,e){return e.capabilities.limits?.max_prompt_tokens?Math.min(t,e.capabilities.limits.max_prompt_tokens):t}a(F7t,"getRequestTokens");function Nyn(t){return t.billing?.token_prices?.default?.context_max??t.capabilities.limits?.max_prompt_tokens??8192}a(Nyn,"getMaxRequestTokens");function Myn(t){return t.billing?.token_prices?.long_context?.context_max}a(Myn,"getMaxLongContextTokens");function L7t(t,e){return e.capabilities.limits?.max_output_tokens?Math.min(t,e.capabilities.limits.max_output_tokens):t}a(L7t,"getResponseTokens");function BQo(t,e){return t.filter(r=>r.capabilities.type!==e.type||r.capabilities.family!==e.family&&!(r.is_chat_fallback===!0&&r.id===e.family)||r.capabilities.family===e.family&&r.id!==e.family&&r.is_chat_fallback===!0||e.modelPickerEnabled===!0&&!r.model_picker_enabled?!1:r.capabilities.supports===void 0||e.supports===void 0?!0:Object.keys(e.supports).every(n=>e.supports?.[n]===r.capabilities.supports?.[n]))}a(BQo,"filterModelsByCapabilities");function BQ(t,e){if(e)return e;if(!(!t||t.length===0))return t.includes("medium")?"medium":t[0]}a(BQ,"pickReasoningEffort");function LQo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/responses")}a(LQo,"shouldUseResponsesApi");function FQo(t){let e=t.supportedEndpoints;return!e||e.length===0?!1:e.includes("/v1/messages")&&!e.includes("/responses")}a(FQo,"shouldUseMessagesApi");var Oyn=["completions","responses","v1/messages"];function nYe(t,e){return e?"v1/messages":t&&LQo(t)?"responses":"completions"}a(nYe,"resolveEndpointRoute");function iYe(t,e){if(!FQo(e))return!1;let r=Ht(t,Je.AnthropicMessagesEndpoint);return r==="true"?!0:r!=="false"}a(iYe,"willUseMessagesEndpoint");p();function oYe(t){let e=t.toLowerCase();return e.startsWith("gpt")&&e.includes("-codex")}a(oYe,"isCodexStyleGptModel");function Byn(t){return t?t.toLowerCase().startsWith("gpt-5"):!1}a(Byn,"isGpt5PlusFamily");function Lyn(t){return t?t.toLowerCase().startsWith("claude"):!1}a(Lyn,"isAnthropicModel");p();p();function Fyn(t,e){!e||!e.providerName||(e.providerName===go.Anthropic?(delete t.temperature,delete t.top_p):e.supportsThinking&&(delete t.temperature,"max_tokens"in t&&(t.max_completion_tokens=t.max_tokens,delete t.max_tokens)),e.providerName&&delete t.max_tokens)}a(Fyn,"adaptRequestForBYOKProvider");p();p();var SS=class{static{a(this,"RateLimitNotifier")}},sYe=class extends SS{static{a(this,"NullRateLimitNotifier")}async notifyRateLimitWarning(e){}};var U7t=[50,75,90,95],$M=class extends w_{constructor(r){super();this.ctx=r;this._shownSessionThresholds=new Set;this._shownWeeklyThresholds=new Set;this._register(ys(r,()=>{this._shownSessionThresholds.clear(),this._shownWeeklyThresholds.clear(),this.clearRateLimits()}))}static{a(this,"ChatUsageRateLimitService")}get weeklyRateLimit(){return this._weeklyRateLimit}get sessionRateLimit(){return this._sessionRateLimit}clearRateLimits(){this._weeklyRateLimit=void 0,this._sessionRateLimit=void 0}processRateLimitHeaders(r){let n=r.get("x-usage-ratelimit-weekly"),o=r.get("x-usage-ratelimit-session");if(!n&&!o)return;n&&(this._weeklyRateLimit=this.parseRateLimitHeader(n)),o&&(this._sessionRateLimit=this.parseRateLimitHeader(o)),this.clearStaleThresholds(this._sessionRateLimit,this._shownSessionThresholds),this.clearStaleThresholds(this._weeklyRateLimit,this._shownWeeklyThresholds);let s=this.checkThreshold(this._sessionRateLimit,this._shownSessionThresholds,"session")??this.checkThreshold(this._weeklyRateLimit,this._shownWeeklyThresholds,"weekly");s&&this.ctx.get(SS).notifyRateLimitWarning(s)}clearStaleThresholds(r,n){if(!r){n.clear();return}let o=100-r.percentRemaining;for(let s of n)o=0;c--){let l=U7t[c];if(s>=l&&!n.has(l)){for(let d=0;d<=c;d++)n.add(U7t[d]);let u=this.getRateLimitMessage(o,r);return{type:o,rateLimit:r,message:u}}}}getRateLimitMessage(r,n){let o=Math.round(100-n.percentRemaining),s=ile(n.resetDate);return r==="session"?`You've used ${o}% of your session rate limit. Your session rate limit will reset on ${s}.`:`You've used ${o}% of your weekly rate limit. Your weekly rate limit will reset on ${s}.`}parseRateLimitHeader(r){try{let n=new URLSearchParams(r),o=Number.parseInt(n.get("ent")||"0",10),s=Number.parseFloat(n.get("rem")||"0.0"),c=n.get("rst")||"";return{entitlement:o,percentRemaining:s,resetDate:c}}catch(n){console.error("Failed to parse rate limit header",n);return}}};p();var eg="https://aka.ms/github-copilot-rate-limit-error";function UQo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a(UQo,"secondsToHumanReadableTime");var R_=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":UQo(e),o=r?.capiErrorCode,s=r?.suggestSwitchToAuto??!r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${eg})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${eg})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${eg})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${eg})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${eg})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${eg})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${eg})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${eg})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${eg})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${eg})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${eg})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${eg})`:`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${eg})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${eg})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${eg})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${eg})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${eg})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${eg})`}static translate402Reason(e,r){let n=r.retryAfterHeader,o=r.retryAfterSeconds;if(e.includes("free_quota_exceeded"))return n?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(n).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.";if(e.includes("overage_limit_reached"))return r.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.";if(e.includes("quota_exceeded")){if(r.isTBBEnabled){let s="";o!==void 0&&(s=` Quota resets on ${new Date(Date.now()+o*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let c=r.overageEnabled?"increase budget":"enable additional overages",l=r.canUpgradePlan?", upgrade your plan":"";switch(r.copilotPlan){case"free":return`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${s}`;case"individual":case"individual_pro":return`You've used your monthly AI Credits. Please ${c}${l} or wait for your allowance to renew.${s}`;case"individual_max":return`You've used your monthly AI Credits. Please ${c} or wait for your allowance to renew.${s}`;case"business":case"enterprise":return`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${c} or wait for your allowance to renew.${s}`;default:return`You've used your monthly AI Credits.${s}`}}switch(r.copilotPlan){case"free":return"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.";case"individual":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.";case"individual_pro":return"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.";case"business":case"enterprise":return"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.";default:return"You've reached your monthly chat messages quota."}}return e.includes("session_quota_exceeded")?o!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+o*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.":e.includes("billing_not_configured")?"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.":"Quota Exceeded."}static translate400Reason(e,r){if(e.includes("off_topic"))return"filtered as off_topic by intent classifier: message was not programming related";if(e.includes("model_not_supported"))return r?`model is not supported: ${r}`:"model is not supported.";if(e.includes("model_max_prompt_tokens_exceeded"))return"model max prompt tokens exceeded."}};p();p();p();var LQ="copilot-edits-session";p();p();p();p();As();function aYe(t,e,r,n,o,s,c){return $Vr(t,e,r,o,n,c),{completionText:e,meanLogProb:QQo(t,r),meanAlternativeLogProb:qQo(t,r),choiceIndex:n,requestId:o,blockFinished:s,tokens:r.tokens,numTokens:r.tokens.length,telemetryData:c,copilotAnnotations:r.copilot_annotations,clientCompletionId:ir(),finishReason:r.finish_reason}}a(aYe,"convertToAPIChoice");function QQo(t,e){if(e?.logprobs?.token_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--)r+=e.logprobs.token_logprobs[s],n+=1;return n>0?r/n:void 0}catch(r){Dr.exception(t,r,"Error calculating mean prob")}}a(QQo,"calculateMeanLogProb");function qQo(t,e){if(e?.logprobs?.top_logprobs)try{let r=0,n=0,o=50;for(let s=0;s0;s++,o--){let c={...e.logprobs.top_logprobs[s]};delete c[e.logprobs.tokens[s]],r+=Math.max(...Object.values(c)),n+=1}return n>0?r/n:void 0}catch(r){Dr.exception(t,r,"Error calculating mean prob")}}a(qQo,"calculateMeanAlternativeLogProb");function sle(t,e){return m1(t)||e<=1?0:e<10?.2:e<20?.4:.8}a(sle,"getTemperatureForSamples");var jQo={markdown:[` `],python:[` @@ -2365,23 +2396,23 @@ def `,` class `,` if `,` -#`]};function ymn(t,e){return d8o[e??""]??[` +#`]};function Uyn(t,e){return jQo[e??""]??[` -`,"\n```"]}a(ymn,"getStops");function zce(t){return 1}a(zce,"getTopP");function FWe(t){return RSe}a(FWe,"getMaxSolutionTokens");p();p();var f8o=1.15,p8o=1.17,h8o=2;function m8o(t){if(!t)return!1;let e=t.toLowerCase();return e.includes("opus")||e.includes("sonnet-4.6")}a(m8o,"isHighMultiplierModel");function g8o(t){return t.text?Array.isArray(t.text)?t.text.join(""):t.text:""}a(g8o,"getThinkingText");function Yce(t,e){let r=g8o(t);if(r.length>0){let n=Ss(),o=m8o(e)?p8o:f8o;return Math.ceil(n.tokenLength(r)*h8o*o)}return 0}a(Yce,"estimateThinkingTokens");function B6t(t){let e=t.delta;if(!e)return;let r=y8o(e),n=A8o(e);if(r||n)return{id:r,text:n}}a(B6t,"extractThinkingDeltaFromChoice");function A8o(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(A8o,"getThinkingDeltaText");function y8o(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(y8o,"getThinkingDeltaId");p();function Vu(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(Vu,"toString");var xS=new ge("streamChoices"),L6t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new q6t;this.tool_calls=new U6t;this.function_call=new Q6t;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=B6t(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function E8o(t){let e=t.split(` -`),r=e.pop();return[e.filter(n=>n!=""),r]}a(E8o,"splitChunk");var F6t=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},U6t=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new F6t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},Q6t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},q6t=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},QY=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=XL(this.response);this.stats=new j6t;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),xS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),xS.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();xS.debug(this.ctx,"chunk",u);let[d,f]=E8o(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{xS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&_8o(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?xS.error(this.ctx,"Error in response:",g.error.message):xS.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A0){let n=Cs(),o=VQo(e)?GQo:HQo;return Math.ceil(n.tokenLength(r)*$Qo*o)}return 0}a(cle,"estimateThinkingTokens");function Q7t(t){let e=t.delta;if(!e)return;let r=YQo(e),n=zQo(e);if(r||n)return{id:r,text:n}}a(Q7t,"extractThinkingDeltaFromChoice");function zQo(t){if(t)return t.cot_summary??t.reasoning_text??t.thinking}a(zQo,"getThinkingDeltaText");function YQo(t){if(t)return t.cot_id??t.reasoning_opaque??t.signature}a(YQo,"getThinkingDeltaId");p();function Yu(t){if(t instanceof Error)return t.stack?t.stack:t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}a(Yu,"toString");var TS=new Ae("streamChoices"),q7t=class{constructor(e){this.enableThinking=e;this.logprobs=[];this.top_logprobs=[];this.text=[];this.tokens=[];this.text_offset=[];this.copilot_annotations=new $7t;this.tool_calls=new H7t;this.function_call=new G7t;this.copilot_references=[];this.yielded=!1}static{a(this,"APIJsonDataStreaming")}append(e){if(e.text&&this.text.push(e.text),e.delta?.content&&e.delta.role!=="function"&&this.text.push(e.delta.content),e.logprobs&&(this.tokens.push(e.logprobs.tokens??[]),this.text_offset.push(e.logprobs.text_offset??[]),this.logprobs.push(e.logprobs.token_logprobs??[]),this.top_logprobs.push(e.logprobs.top_logprobs??[])),e.copilot_annotations&&this.copilot_annotations.update(e.copilot_annotations),e.delta?.copilot_annotations&&this.copilot_annotations.update(e.delta.copilot_annotations),e.delta?.tool_calls&&e.delta.tool_calls.length>0&&this.tool_calls.update(e.delta.tool_calls),e.delta?.function_call&&this.function_call.update(e.delta.function_call),e?.finish_reason&&(this.finish_reason=e.finish_reason),this.enableThinking){let r=Q7t(e);if((r?.id||r?.text)&&(this.thinking??={id:"",text:[]},r.id&&(this.thinking.id=r.id),r.text&&Array.isArray(this.thinking.text))){let n=Array.isArray(r.text)?r.text:[r.text];this.thinking.text.push(...n)}}}};function KQo(t){let e=t.split(` +`),r=e.pop();return[e.filter(n=>n!=""),r]}a(KQo,"splitChunk");var j7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingToolCall")}update(e){e.id&&(this.id=e.id),e.function.name&&(this.name=e.function.name),this.arguments.push(e.function.arguments)}},H7t=class{constructor(){this.toolCalls=[]}static{a(this,"StreamingToolCalls")}update(e){e.forEach(r=>{let n;if(r.id&&(n=this.toolCalls.find(o=>o.id===r.id)),!n&&!r.id&&r.index!==void 0){for(let o=this.toolCalls.length-1;o>=0;o--)if(this.toolCalls[o].index===r.index){n=this.toolCalls[o];break}}n||(n=this.toolCalls.length>0?this.toolCalls[this.toolCalls.length-1]:void 0),(!n||r.id&&n.id!==r.id)&&(n=new j7t,this.toolCalls.push(n)),r.index!==void 0&&n.index===void 0&&(n.index=r.index),n.update(r)})}getToolCalls(){return this.toolCalls}},G7t=class{constructor(){this.arguments=[]}static{a(this,"StreamingFunctionCall")}update(e){e.name&&(this.name=e.name),this.arguments.push(e.arguments)}},$7t=class{constructor(){this.current={}}static{a(this,"StreamCopilotAnnotations")}update(e){Object.entries(e).forEach(([r,n])=>{n.forEach(o=>this.update_namespace(r,o))})}update_namespace(e,r){this.current[e]||(this.current[e]=[]);let n=this.current[e],o=n.findIndex(s=>s.id===r.id);o>=0?n[o]=r:n.push(r)}for(e){return this.current[e]??[]}},ZY=class t{constructor(e,r,n,o,s,c,l){this.ctx=e;this.expectedNumChoices=r;this.response=n;this.body=o;this.telemetryData=s;this.dropCompletionReasons=c;this.cancellationToken=l;this.requestId=c3(this.response);this.stats=new V7t;this.solutions={}}static{a(this,"SSEProcessor")}static create(e,r,n,o,s,c){let l=n.body();if(l===null)throw new Error("No response body available");return typeof l.setEncoding=="function"?l.setEncoding("utf8"):l=l.pipeThrough(new TextDecoderStream),new t(e,r,n,l,o,s??[],c)}async*processSSE(e=()=>{}){try{yield*this.processSSEInner(e)}finally{this.cancel(),TS.debug(this.ctx,`request done: headerRequestId: [${this.requestId.headerRequestId}] model deployment ID: [${this.requestId.deploymentId}]`),TS.debug(this.ctx,"request stats:",this.stats)}}async*processSSEInner(e){let r="",n=null,o,s,c;e:for await(let l of this.body){if(this.maybeCancel("after awaiting body chunk"))return;let u=l.toString();TS.debug(this.ctx,"chunk",u);let[d,f]=KQo(r+u);r=f;for(let h of d){if(h.startsWith(":"))continue;let m=h.slice(5).trim();if(m=="[DONE]"){yield*this.finishSolutions(n,o,s,c,e);return}n=null;let g;try{g=JSON.parse(m)}catch{TS.error(this.ctx,"Error parsing JSON stream data",h);continue}if(g.copilot_confirmation&&JQo(g.copilot_confirmation)&&await e("",{text:"",requestId:this.requestId,copilotConfirmation:g.copilot_confirmation}),g.copilot_references&&await e("",{text:"",requestId:this.requestId,copilotReferences:g.copilot_references}),g.choices===void 0){!g.copilot_references&&!g.copilot_confirmation&&(g.error!==void 0?TS.error(this.ctx,"Error in response:",g.error.message):TS.error(this.ctx,"Unexpected response with no choices or error: "+m)),g.copilot_errors&&await e("",{text:"",requestId:this.requestId,copilotErrors:g.copilot_errors});continue}if(o===void 0&&g.model&&(o=g.model),g.usage&&(s=g.usage),g.copilot_usage&&(c=g.copilot_usage),this.allSolutionsDone()){r="";break e}for(let A=0;A-1||y.delta?.content?.indexOf(` -`)>-1,T=E?B6t(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>FTe(_,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&_.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(ht(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:w7(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(ht(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&xS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{xS.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>FTe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),ht(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(xS.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function G6t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(xS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),xS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),xS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=FTe(e.solution,t);return LWe(t,n,s,e.index,e.requestId,o,r)}a(G6t,"prepareSolutionForReturn");function FTe(t,e){let r=t.text.join(""),n=C8o(t,e),o=v8o(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(FTe,"convertToAPIJsonData");function _8o(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(_8o,"isCopilotConfirmation");function Emn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${Vu(s)}. Input: '${t}'.${c}`);throw o&>(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Emn,"parseCallArguments");function C8o(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Emn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(C8o,"extractToolCalls");function v8o(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Emn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(v8o,"extractFunctionCall");var j6t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new H6t,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},H6t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function UWe(t,e){return t!==null&&typeof t=="object"&&e in t}a(UWe,"hasKey");function Fh(t,e){return UWe(t,e)?t[e]:void 0}a(Fh,"getKey");var Cmn=ce(ti());var Vf=new ge("fetchCompletions");function XL(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(XL,"getRequestId");function e3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(e3,"getProcessingTime");function vmn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(vmn,"uiKindToIntent");var HM=class{static{a(this,"OpenAIFetcher")}};function b8o(t,e,r,n){return LI(t,e,"proxy","v1/engines",r,n)}a(b8o,"getProxyEngineUrl");function QWe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(QWe,"sanitizeRequestOptionTelemetry");async function S8o(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(as),m=b8o(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},hoe(e));QWe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,ht(t,"request.sent",g);let A=pl(),y=vmn(l);return P7(t,m,c.token,y,o,s,d,f).then(E=>{let _=XL(E);g.extendWithRequestId(_);let v=pl()-A;return g.measurements.totalTimeMs=v,Vf.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),Vf.debug(t,"request.response properties",g.properties),Vf.debug(t,"request.response measurements",g.measurements),Vf.debug(t,"prompt:",e),ht(t,"request.response",g),E}).catch(E=>{if(P0(E))throw ht(t,"request.cancel",g),E;h.setWarning("cls",{message:Fh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",_),g.properties.message=String(Fh(E,"name")??""),g.properties.code=String(Fh(E,"code")??""),g.properties.errno=String(Fh(E,"errno")??""),g.properties.type=String(Fh(E,"type")??"");let v=pl()-A;throw g.measurements.totalTimeMs=v,Vf.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),Vf.debug(t,"request.error properties",g.properties),Vf.debug(t,"request.error measurements",g.measurements),ht(t,"request.error",g),E}).finally(()=>{fWr(t,e,g)})}a(S8o,"fetchWithInstrumentation");async function T8o(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});QWe(s,f,["messages"]),f.properties.headerRequestId=o,ht(t,"request.sent",f);let h=pl(),m=vmn(l),g=Gm(t);NN()&&(g=await CSe(t,g));try{let A=await P7(t,n,c.token,m,o,s,d,g),y=XL(A);f.extendWithRequestId(y);let E=pl()-h;return f.measurements.totalTimeMs=E,Vf.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),Vf.debug(t,"request.response properties",f.properties),Vf.debug(t,"request.response measurements",f.measurements),Vf.debug(t,"messages:",JSON.stringify(e)),ht(t,"request.response",f),A}catch(A){if(P0(A))throw ht(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",y),f.properties.message=String(Fh(A,"name")??""),f.properties.code=String(Fh(A,"code")??""),f.properties.errno=String(Fh(A,"errno")??""),f.properties.type=String(Fh(A,"type")??"");let E=pl()-h;throw f.measurements.totalTimeMs=E,Vf.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),Vf.debug(t,"request.error properties",f.properties),Vf.debug(t,"request.error measurements",f.measurements),ht(t,"request.error",f),A}finally{Kce(t,e,f)}}a(T8o,"fetchChatWithInstrumentation");function _mn(t){return fmn(t,e=>e.completionText.trim().length>0)}a(_mn,"postProcessChoices");var I8o="github.copilot.completions.quotaExceeded",LTe=class extends HM{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(as),l="completions",u=await e.get(Qt).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){Vf.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=QY.create(e,r.count,d,n,[],s).processSSE(o),m=_Q(h,g=>G6t(e,g,n));return{type:"success",choices:_mn(m),getProcessingTime:a(()=>e3(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(as),A=await e.get(Qt).getToken(),y=await T8o(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){Vf.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=jt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=QY.create(e,1,y,m,[],Cmn.CancellationToken.None).processSSE(),v=_Q(_,b=>G6t(e,b,n));return{type:"success",choices:_mn(v),getProcessingTime:a(()=>e3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return jt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Jt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:FWe(e),temperature:Wce(e,n.count),top_p:zce(e),n:n.count,stop:ymn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=qL(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await rx(0),c?.isCancellationRequested?"not-sent":await S8o(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:I8o,title:"Learn More"});let l=Es(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),Vf.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Vf.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(Vf.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),ht(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Qt).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=yoe(o);gt(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,Vf.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(Vf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Vf.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};Ns();async function UTe(t,e,r,n){let o=jt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(UTe,"createTelemetryWithExpWithId");function Jc(t,{turn:e,conversation:r}={},n){return UTe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(Jc,"createTelemetryWithExpWithTurn");function QTe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(x8o(l))),c=c.extendedBy(d,f),c}a(QTe,"extendUserMessageTelemetryData");function x8o(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(x8o,"mapSkillResolutionsForTelemetry");function bmn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),qWe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(bmn,"createUserMessageTelemetryData");function Smn(t,e,r,n,o,s,c){let l=R8o(r);return qWe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a(Smn,"createModelMessageTelemetryData");function Tmn(t,e,r,n,o,s,c){qWe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Tmn,"createOffTopicMessageTelemetryData");function Imn(t,e,r,n,o,s,c,l,u){let d=qWe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return w8o(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Imn,"createSuggestionMessageTelemetryData");async function xmn(t,e,r){let n=await Jc(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";wS(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(xmn,"telemetryIndexCodesearch");function qWe(t,e,r,n,o,s,c){let l=c??jt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=gr();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=Hy(r);return ht(t,`${h}.message`,d),ht(t,`${h}.messageText`,f,1),d}a(qWe,"telemetryMessage");function wmn(t,e,r,n){wS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(wmn,"createSuggestionShownTelemetryData");function w8o(t,e,r,n,o,s,c,l){wS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(w8o,"createSuggestionSelectedTelemetryData");function wS(t,e,r,n,o,s){let c=s??jt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return ht(t,o,l),l}a(wS,"telemetryUserAction");function Kce(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return ht(t,"engine.messages",n,1)}a(Kce,"logEngineMessages");function Hy(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(Hy,"telemetryPrefixForUiKind");function R8o(t){let e=t.split(` -`),r=[],n;for(let o=0;o-1,T=E?Q7t(y):void 0;if(y.finish_reason||b||T){let R=_.text.join("");if(v=this.asSolutionDecision(await e(R,{text:R,index:y.index,requestId:this.requestId,annotations:_.copilot_annotations,copilotReferences:_.copilot_references,getAPIJsonData:a(()=>oIe(_,this.ctx),"getAPIJsonData"),finished:!!y.finish_reason,telemetryData:this.telemetryData,thinking:T?{id:T.id??"",text:T.text}:void 0})),this.maybeCancel("after awaiting finishedCb"))return}if(y.finish_reason&&_.function_call.name!==void 0){n=y.finish_reason;continue}if(y.finish_reason&&(v.yieldSolution=!0,v.continueStreaming=!1),!v.yieldSolution)continue;let w=y.finish_reason??"client-trimmed";if(yt(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:w,engineName:o??"",engineChoiceSource:S7(this.ctx,this.telemetryData).engineChoiceSource})),this.dropCompletionReasons.includes(y.finish_reason)?this.solutions[y.index]=null:_.yielded||(this.stats.markYielded(y.index),yield{solution:_,finishOffset:v.finishOffset,reason:y.finish_reason,requestId:this.requestId,index:y.index,model:o,usage:s,copilot_usage:c},_.yielded=!0),this.maybeCancel("after yielding finished choice"))return;v.continueStreaming||(this.solutions[y.index]=null)}}}for(let[l,u]of Object.entries(this.solutions)){let d=Number(l);if(u!=null&&(yt(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:"Iteration Done",engineName:o??""})),this.stats.markYielded(d),yield{solution:u,finishOffset:void 0,reason:"Iteration Done",requestId:this.requestId,index:d,model:o,usage:s,copilot_usage:c},this.maybeCancel("after yielding after iteration done")))return}if(r.length>0)try{let l=JSON.parse(r);l.error!==void 0&&TS.error(this.ctx,`Error in response: ${l.error.message}`,l.error)}catch{TS.error(this.ctx,`Error parsing extraData: ${r}`)}}asSolutionDecision(e){return e===void 0?{yieldSolution:!1,continueStreaming:!0}:typeof e=="number"?{yieldSolution:!0,continueStreaming:!1,finishOffset:e}:e}async*finishSolutions(e,r,n,o,s){for(let[c,l]of Object.entries(this.solutions)){let u=Number(c);if(l==null)continue;let d=l.text.join("");if(await s(d,{text:d,index:u,requestId:this.requestId,annotations:l.copilot_annotations,copilotReferences:l.copilot_references,getAPIJsonData:a(()=>oIe(l,this.ctx),"getAPIJsonData"),finished:!0,telemetryData:this.telemetryData}),!l.yielded&&(this.stats.markYielded(u),yt(this.ctx,"completion.finishReason",this.telemetryData.extendedBy({completionChoiceFinishReason:e??"DONE",engineName:r??""})),yield{solution:l,finishOffset:void 0,reason:e??"DONE",requestId:this.requestId,index:u,model:r,usage:n,copilot_usage:o},this.maybeCancel("after yielding on DONE")))return}}maybeCancel(e){return this.cancellationToken?.isCancellationRequested?(TS.debug(this.ctx,"Cancelled: "+e),this.cancel(),!0):!1}cancel(){this.body&&"destroy"in this.body&&typeof this.body.destroy=="function"?this.body.destroy():this.body instanceof ReadableStream&&this.body.cancel()}allSolutionsDone(){let e=Object.values(this.solutions);return e.length==this.expectedNumChoices&&e.every(r=>r==null)}};function z7t(t,e,r){let n=e.solution.text.join(""),o=!1;e.finishOffset!==void 0&&(TS.debug(t,`solution ${e.index}: early finish at offset ${e.finishOffset}`),n=n.substring(0,e.finishOffset),o=!0),TS.info(t,`solution ${e.index} returned. finish reason: [${e.reason}]`),TS.debug(t,`solution ${e.index} details: finishOffset: [${e.finishOffset}]`);let s=oIe(e.solution,t);return aYe(t,n,s,e.index,e.requestId,o,r)}a(z7t,"prepareSolutionForReturn");function oIe(t,e){let r=t.text.join(""),n=ZQo(t,e),o=XQo(t,e),s=t.copilot_annotations.current,c=t.thinking?.id?t.thinking:void 0,l={text:r,tokens:t.text,tool_calls:n,function_call:o,copilot_annotations:s,finish_reason:t.finish_reason??"stop",thinking:c};if(t.logprobs.length===0)return l;let u=t.logprobs.reduce((m,g)=>m.concat(g),[]),d=t.top_logprobs.reduce((m,g)=>m.concat(g),[]),f=t.text_offset.reduce((m,g)=>m.concat(g),[]),h=t.tokens.reduce((m,g)=>m.concat(g),[]);return{...l,logprobs:{token_logprobs:u,top_logprobs:d,text_offset:f,tokens:h}}}a(oIe,"convertToAPIJsonData");function JQo(t){return typeof t.title=="string"&&typeof t.message=="string"&&!!t.confirmation}a(JQo,"isCopilotConfirmation");function Qyn(t,e,r,n,o){if(!t)return{};try{return JSON.parse(t)}catch(s){let c=n?` Chunks (${n.length}): ${JSON.stringify(n)}`:"",l=new Error(`Failed to parse JSON for ${e} '${r}': ${Yu(s)}. Input: '${t}'.${c}`);throw o&&_t(o,"toolCall.argumentParseError",{callType:e,callName:r,error:l.message}),l}}a(Qyn,"parseCallArguments");function ZQo(t,e){let r=[],n=t.tool_calls.getToolCalls();for(let o of n)if(o.name){let s=o.arguments.join("").trim(),c=Qyn(s,"tool call",o.name,o.arguments,e);r.push({type:"function",function:{name:o.name,arguments:c},approxNumTokens:o.arguments.length+1,id:o.id})}return r}a(ZQo,"extractToolCalls");function XQo(t,e){if(t.function_call.name){let r=t.function_call.arguments.join("").trim(),n=Qyn(r,"function call",t.function_call.name,t.function_call.arguments,e);return{name:t.function_call.name,arguments:n}}}a(XQo,"extractFunctionCall");var V7t=class{constructor(){this.choices=new Map}static{a(this,"ChunkStats")}getChoiceStats(e){let r=this.choices.get(e);return r||(r=new W7t,this.choices.set(e,r)),r}add(e){this.getChoiceStats(e).increment()}markYielded(e){this.getChoiceStats(e).markYielded()}toString(){return Array.from(this.choices.entries()).map(([e,r])=>`${e}: ${r.yieldedTokens} -> ${r.seenTokens}`).join(", ")}},W7t=class{constructor(){this.yieldedTokens=-1;this.seenTokens=0}static{a(this,"ChoiceStats")}increment(){this.seenTokens++}markYielded(){this.yieldedTokens=this.seenTokens}};p();function lYe(t,e){return t!==null&&typeof t=="object"&&e in t}a(lYe,"hasKey");function qh(t,e){return lYe(t,e)?t[e]:void 0}a(qh,"getKey");var jyn=fe(ei());var Zf=new Ae("fetchCompletions");function c3(t){return{headerRequestId:t.headers.get("x-request-id")||"",serverExperiments:t.headers.get("X-Copilot-Experiment")||"",deploymentId:t.headers.get("azureml-model-deployment")||""}}a(c3,"getRequestId");function l3(t){let e=t.headers.get("openai-processing-ms");return e?parseInt(e,10):0}a(l3,"getProcessingTime");function Hyn(t){switch(t){case"ghostText":return"copilot-ghost";case"synthesize":return"copilot-panel"}}a(Hyn,"uiKindToIntent");var VM=class{static{a(this,"OpenAIFetcher")}};function eqo(t,e,r,n){return NI(t,e,"proxy","v1/engines",r,n)}a(eqo,"getProxyEngineUrl");function uYe(t,e,r,n){for(let[o,s]of Object.entries(t)){if(r.includes(o))continue;let c=s;if(o==="extra"&&n){let l={...c};for(let u of n)delete l[u];c=l}e.properties[`request.option.${o}`]=JSON.stringify(c)??"undefined"}}a(uYe,"sanitizeRequestOptionTelemetry");async function tqo(t,e,r,n,o,s,c,l,u,d,f){let h=t.get(ss),m=eqo(t,c,r,n),g=u.extendedBy({endpoint:n,engineName:r,uiKind:l},aoe(e));uYe(s,g,["prompt","suffix"],["context"]),g.properties.headerRequestId=o,yt(t,"request.sent",g);let A=dl(),y=Hyn(l);return KV(t,m,c.token,y,o,s,d,f).then(E=>{let _=c3(E);g.extendWithRequestId(_);let v=dl()-A;return g.measurements.totalTimeMs=v,Zf.info(t,`Request ${o} at <${m}> finished with ${E.status} status after ${v}ms`),g.properties.status=String(E.status),Zf.debug(t,"request.response properties",g.properties),Zf.debug(t,"request.response measurements",g.measurements),Zf.debug(t,"prompt:",e),yt(t,"request.response",g),E}).catch(E=>{if(D0(E))throw yt(t,"request.cancel",g),E;h.setWarning("cls",{message:qh(E,"message")??""});let _=g.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",_),g.properties.message=String(qh(E,"name")??""),g.properties.code=String(qh(E,"code")??""),g.properties.errno=String(qh(E,"errno")??""),g.properties.type=String(qh(E,"type")??"");let v=dl()-A;throw g.measurements.totalTimeMs=v,Zf.info(t,`Request ${o} at <${m}> rejected with ${String(E)} after ${v}ms`),Zf.debug(t,"request.error properties",g.properties),Zf.debug(t,"request.error measurements",g.measurements),yt(t,"request.error",g),E}).finally(()=>{VVr(t,e,g)})}a(tqo,"fetchWithInstrumentation");async function rqo(t,e,r,n,o,s,c,l,u,d){let f=u.extendedBy({endpoint:"chat/completions",engineModelId:r,uiKind:l});uYe(s,f,["messages"]),f.properties.headerRequestId=o,yt(t,"request.sent",f);let h=dl(),m=Hyn(l),g=lA(t);OB()&&(g=await DHe(t,g));try{let A=await KV(t,n,c.token,m,o,s,d,g),y=c3(A);f.extendWithRequestId(y);let E=dl()-h;return f.measurements.totalTimeMs=E,Zf.info(t,`Request ${o} at <${n}> finished with ${A.status} status after ${E}ms`),Zf.debug(t,"request.response properties",f.properties),Zf.debug(t,"request.response measurements",f.measurements),Zf.debug(t,"messages:",JSON.stringify(e)),yt(t,"request.response",f),A}catch(A){if(D0(A))throw yt(t,"request.cancel",f),A;let y=f.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",y),f.properties.message=String(qh(A,"name")??""),f.properties.code=String(qh(A,"code")??""),f.properties.errno=String(qh(A,"errno")??""),f.properties.type=String(qh(A,"type")??"");let E=dl()-h;throw f.measurements.totalTimeMs=E,Zf.info(t,`Request ${o} at <${n}> rejected with ${String(A)} after ${E}ms`),Zf.debug(t,"request.error properties",f.properties),Zf.debug(t,"request.error measurements",f.measurements),yt(t,"request.error",f),A}finally{lle(t,e,f)}}a(rqo,"fetchChatWithInstrumentation");function qyn(t){return Dyn(t,e=>e.completionText.trim().length>0)}a(qyn,"postProcessChoices");var nqo="github.copilot.completions.quotaExceeded",iIe=class extends VM{static{a(this,"LiveOpenAIFetcher")}#e;async fetchAndStreamCompletions(e,r,n,o,s){if(this.#e)return{type:"canceled",reason:this.#e};let c=e.get(ss),l="completions",u=await e.get(Ut).getToken(),d=await this.fetchWithParameters(e,l,r,u,n,s);if(d==="not-sent")return{type:"canceled",reason:"before fetch request"};if(s?.isCancellationRequested){let g=d.body();try{g&&"destroy"in g&&typeof g.destroy=="function"?g.destroy():g instanceof ReadableStream&&g.cancel()}catch(A){Zf.exception(e,A,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(d.status!==200){let g=this.createTelemetryData(l,e,r);return this.handleError(e,c,g,d,r.uiKind)}let h=ZY.create(e,r.count,d,n,[],s).processSSE(o),m=rIe(h,g=>z7t(e,g,n));return{type:"success",choices:qyn(m),getProcessingTime:a(()=>l3(d),"getProcessingTime")}}async fetchAndStreamChat(e,r,n,o,s,c,l,u={},d){if(this.#e)return{type:"canceled",reason:this.#e};let f="https://copilot-proxy.githubusercontent.com/chat/completions",h={messages:r,model:l.id,stream:!0,...u},m=n.extendedBy({endpoint:f,model:l.name}),g=e.get(ss),A=await e.get(Ut).getToken(),y=await rqo(e,r,l.id,f,s,h,A,o,m,d);if(d?.isCancellationRequested){let b=y.body();try{b&&"destroy"in b&&typeof b.destroy=="function"?b.destroy():b instanceof ReadableStream&&b.cancel()}catch(T){Zf.exception(e,T,"Error destroying stream")}return{type:"canceled",reason:"after fetch request"}}if(y.status!==200){let b=Vt.createAndMarkAsIssued({endpoint:f,engineName:l.name,uiKind:o,headerRequestId:s});return this.handleError(e,g,b,y,o)}let _=ZY.create(e,1,y,m,[],jyn.CancellationToken.None).processSSE(),v=rIe(_,b=>z7t(e,b,n));return{type:"success",choices:qyn(v),getProcessingTime:a(()=>l3(y),"getProcessingTime")}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineModelId,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s,c){let l=e.get(Jt).disableLogProb(s),u={prompt:n.prompt.prefix,suffix:n.prompt.suffix,max_tokens:cYe(e),temperature:sle(e,n.count),top_p:ale(e),n:n.count,stop:Uyn(e,n.languageId),stream:!0,extra:n.extra};(n.requestLogProbs||!l)&&(u.logprobs=2);let d=jz(n.repoInfo);return d!==void 0&&(u.nwo=d),n.postOptions&&Object.assign(u,n.postOptions),n.prompt.context&&n.prompt.context.length>0&&(u.extra.context=n.prompt.context),await XI(0),c?.isCancellationRequested?"not-sent":await tqo(e,n.prompt,n.engineModelId,r,n.ourRequestId,u,o,n.uiKind,s,c,n.headers)}async handleError(e,r,n,o,s){let c=await o.text();if(o.status===402){this.#e="monthly free code completions exhausted",r.setError("cls",{message:"Completions limit reached"},{command:nqo,title:"Learn More"});let l=ys(e,u=>{this.#e=void 0,(u.envelope.limited_user_quotas?.completions??1)>0&&(r.forceNormal("cls",{inactive:!1}),l.dispose())});return{type:"failed",reason:this.#e}}if(o.status===466)return r.setError("cls",{message:c}),Zf.info(e,c),{type:"failed",reason:`client not supported: ${c}`};if(o.clientError&&!o.headers.get("x-github-request-id")){let l=`Last response was a ${o.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Zf.error(e,l),r.setWarning("cls",{message:l}),n.properties.error=`Response status was ${o.status} with no x-github-request-id header`}else o.clientError?(Zf.warn(e,`Response status was ${o.status}:`,c),r.setWarning("cls",{message:`Last response was a ${o.status} error: ${c}`}),n.properties.error=`Response status was ${o.status}: ${c}`):(r.setWarning("cls",{message:`Last response was a ${o.status} error`}),n.properties.error=`Response status was ${o.status}`);if(n.properties.status=String(o.status),yt(e,"request.shownWarning",n),o.status===401||o.status===403)return e.get(Ut).resetToken("code_completion",o.status),{type:"failed",reason:`token expired or invalid: ${o.status}`};if(o.status===429){let l=$9(o);_t(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:l??-1});let u=l??10,d=Math.max(u,0)*1e3;return setTimeout(()=>{this.#e=void 0},d),this.#e=`Rate limited by server. Retry in ${u}s.`,Zf.warn(e,this.#e),{type:"failed",reason:this.#e}}return o.status===499?(Zf.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server"}):(Zf.error(e,"Unhandled status from server:",o.status,c),{type:"failed",reason:`unhandled status from server: ${o.status} ${c}`})}};As();async function sIe(t,e,r,n){let o=Vt.createAndMarkAsIssued({messageId:e,conversationId:r});return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments(n,o)}a(sIe,"createTelemetryWithExpWithId");function Kc(t,{turn:e,conversation:r}={},n){return sIe(t,e?.telemetryId??"",r?.telemetryId??"",n)}a(Kc,"createTelemetryWithExpWithTurn");function aIe(t,e,r,n,o,s,c,l){let u=t.turns[t.turns.length-1].skills.map(h=>h.skillId).sort(),d={source:"user",turnIndex:(t.turns.length-1).toString(),uiKind:e,skillIds:u.join(",")},f={promptTokenLen:n,messageCharLen:r};return o&&(d.suggestion=o),s&&(d.suggestionId=s),l.length>0&&(d.skillResolutionsJson=JSON.stringify(iqo(l))),c=c.extendedBy(d,f),c}a(aIe,"extendUserMessageTelemetryData");function iqo(t){return t.map(e=>({skillId:e.skillId,resolution:e.resolution,fileStatus:e.files?.map(r=>r.status),tokensPreEliding:e.tokensPreEliding??0,resolutionTimeMs:e.resolutionTimeMs??0,processingTimeMs:e.processingTimeMs??0}))}a(iqo,"mapSkillResolutionsForTelemetry");function Gyn(t,e,r,n,o,s,c){return n!=null&&(c=c.extendedBy({offTopic:n.toString()})),dYe(t,s,e,r,{uiKind:e,headerRequestId:o},{},c).properties.messageId}a(Gyn,"createUserMessageTelemetryData");function $yn(t,e,r,n,o,s,c){let l=sqo(r);return dYe(t.ctx,s,e,r,{source:"model",turnIndex:(t.conversation.turns.length-1).toString(),headerRequestId:o,uiKind:e,codeBlockLanguages:JSON.stringify(l),mode:t.turn.getChatModeForTelemetry(),modelId:t.turn.getResolvedModelId()??"unknown"},{messageCharLen:r.length,numCodeBlocks:l.length,numTokens:n},c).properties.messageId}a($yn,"createModelMessageTelemetryData");function Vyn(t,e,r,n,o,s,c){dYe(t,s,r,n,{source:"offTopic",turnIndex:e.turns.length.toString(),userMessageId:o,uiKind:r},{messageCharLen:n.length},c)}a(Vyn,"createOffTopicMessageTelemetryData");function Wyn(t,e,r,n,o,s,c,l,u){let d=dYe(t,l,r,n,{source:"suggestion",suggestion:s,turnIndex:(e.turns.length-1).toString(),uiKind:r,suggestionId:c},{promptTokenLen:o,messageCharLen:n.length},u);return oqo(t,r,s,d.properties.messageId,d.properties.conversationId,c,u,l),d.properties.messageId}a(Wyn,"createSuggestionMessageTelemetryData");async function zyn(t,e,r){let n=await Kc(t.ctx,t),o=t.conversation.source==="inline"?"conversationInline":"conversationPanel";IS(t.ctx,void 0,{conversationId:t.conversation.telemetryId,turnIndex:(t.conversation.turns.length-1).toString(),userMessageId:t.turn.telemetryId,provider:e,uiKind:o},r,"index.codesearch",n)}a(zyn,"telemetryIndexCodesearch");function dYe(t,e,r,n,o,s,c){let l=c??Vt.createAndMarkAsIssued();if(!("messageId"in o)&&!("messageId"in l.properties)){let m=ir();o.messageId=m}e&&(o.languageId=e.detectedLanguageId,s.documentLength=e.getText().length,s.documentLineCount=e.lineCount);let u={messageText:n,...o},d=l.extendedBy(o,s),f=l.extendedBy(u),h=Vy(r);return yt(t,`${h}.message`,d),yt(t,`${h}.messageText`,f,1),d}a(dYe,"telemetryMessage");function Yyn(t,e,r,n){IS(t,n,{uiKind:e},{},"conversation.suggestionShown",r)}a(Yyn,"createSuggestionShownTelemetryData");function oqo(t,e,r,n,o,s,c,l){IS(t,l,{suggestion:r,messageId:n,conversationId:o,suggestionId:s,uiKind:e},{},"conversation.suggestionSelected",c)}a(oqo,"createSuggestionSelectedTelemetryData");function IS(t,e,r,n,o,s){let c=s??Vt.createAndMarkAsIssued();e&&(r.languageId=e.detectedLanguageId,n.documentLength=e.getText().length,n.documentLineCount=e.lineCount);let l=c.extendedBy(r,n);return yt(t,o,l),l}a(IS,"telemetryUserAction");function lle(t,e,r){let n=r.extendedBy({messagesJson:JSON.stringify(e)});return yt(t,"engine.messages",n,1)}a(lle,"logEngineMessages");function Vy(t){switch(t){case"conversationInline":return"inlineConversation";case"conversationPanel":case"agentPanel":default:return"conversation"}}a(Vy,"telemetryPrefixForUiKind");function sqo(t){let e=t.split(` +`),r=[],n;for(let o=0;o(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(tc||{});function In(t){return t?(t=RS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(In,"getTextPart");function Nmn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(Nmn,"hasImageContent");function SQ(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(Jce(n))return n.some(o=>o.type==="image_url");if(qY(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(SQ,"hasImageContentInTurns");var Mmn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),Omn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function r3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(r3,"parseToolCallArguments");function Bmn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(Bmn,"toOpenAIToolCall");function Lmn(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),Kce(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=Yce(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(Lmn,"convertToChatCompletion");function Jce(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(Jce,"isChatCompletionContentPartArray");function qY(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(qY,"isChatMessageArray");function RS(t){if(typeof t=="string")return t;if(Jce(t))return t;if(qY(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(RS,"resolveAsChatMessageContent");function TQ(t,e){return(typeof t=="string"||Jce(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(TQ,"appendChatMessageContent");function GM(t,e){if(t){if(typeof t=="string"||Jce(t))return[{role:"assistant",content:t}];if(qY(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(GM,"resolveResponseAsChatMessages");p();var V6t=new ge("streamMessages");function Fmn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(V6t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),V6t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),V6t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=FTe(e.solution,t),u={role:"assistant",content:s};return Lmn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(Fmn,"prepareChatCompletionForReturn");Ns();var jWe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:Wce(e,r.count),top_p:zce(e),n:r.count,stop:[` +`);return r+n}a(lqo,"truncateContentIfNeeded");var uqo=["requestSource","chatRequestModel","mapper","headerRequestId","mode","modelId","languageId","messageId","conversationId","uiKind"];function Xyn(t,e,r,n,o,s,c){let l=`${Vy(e)}.${c}`,u=s.extendedBy(r,n);yt(t,l,u);let d={...r,uiKind:e||""};_t(t,c,C9(d,uqo),n);let f={...r};o.currentFileContent!==void 0&&(f.completionTextJson=lqo(o.currentFileContent));let h=s.extendedBy(f,n);yt(t,`${l}.restricted`,h,1)}a(Xyn,"telemetryEditSurvivalTracking");var tc=(s=>(s.System="system",s.User="user",s.Assistant="assistant",s.Function="function",s.Tool="tool",s))(tc||{});function Rn(t){return t?(t=xS(t),typeof t=="string"?t:t.map(e=>"text"in e?e.text:"").join("")):""}a(Rn,"getTextPart");function eEn(t){return t.some(e=>Array.isArray(e.content)?e.content.some(r=>r.type==="image_url"):!1)}a(eEn,"hasImageContent");function UQ(t){return t.some(e=>{let r=a(n=>{if(Array.isArray(n)){if(ule(n))return n.some(o=>o.type==="image_url");if(XY(n))return n.some(o=>Array.isArray(o.content)?o.content.some(s=>s.type==="image_url"):!1)}return!1},"checkContent");return e.request?.message&&r(e.request.message)||e.response?.message&&r(e.response.message)})}a(UQ,"hasImageContentInTurns");var tEn=a((t,e)=>S.Unsafe({type:"string",enum:t,description:e?.description}),"StringEnum"),rEn=S.Optional(S.Object({agentSlug:S.String(),state:S.Union([S.Literal("accepted"),S.Literal("dismissed")]),confirmation:S.Any()}));function d3(t){if(typeof t.function.arguments=="string")try{return JSON.parse(t.function.arguments)}catch{return{}}return t.function.arguments}a(d3,"parseToolCallArguments");function nEn(t){return typeof t.function.arguments=="object"&&(t.function.arguments=JSON.stringify(t.function.arguments)),t}a(nEn,"toOpenAIToolCall");function iEn(t,e,r,n,o,s,c,l,u,d,f,h){let m=JSON.parse(JSON.stringify(e));r.tool_calls&&(m.tool_calls=r.tool_calls),lle(t,[m],l);let g=r.thinking;return g&&g.tokens===void 0&&(g.tokens=cle(g,h)),{message:e,choiceIndex:n,requestId:o,blockFinished:s,finishReason:c,tokens:r.tokens,numTokens:r.tokens.length,tool_calls:r.tool_calls,function_call:r.function_call,telemetryData:l,copilotEditsSessionHeader:u,thinking:g,usage:d,copilot_usage:f}}a(iEn,"convertToChatCompletion");function ule(t){return Array.isArray(t)&&t.every(e=>"type"in e&&!("role"in e))}a(ule,"isChatCompletionContentPartArray");function XY(t){return Array.isArray(t)&&t.every(e=>"role"in e)}a(XY,"isChatMessageArray");function xS(t){if(typeof t=="string")return t;if(ule(t))return t;if(XY(t)){let e=t.filter(n=>n.role==="assistant"),r=[];for(let n of e)Array.isArray(n.content)?r.push(...n.content):r.push({type:"text",text:n.content});return r}return""}a(xS,"resolveAsChatMessageContent");function QQ(t,e){return(typeof t=="string"||ule(t))&&(t=[{role:"assistant",content:t}]),t.push(e),t}a(QQ,"appendChatMessageContent");function WM(t,e){if(t){if(typeof t=="string"||ule(t))return[{role:"assistant",content:t}];if(XY(t))return e?t:t.filter(r=>r.role!=="tool").map(r=>r.tool_calls?{...r,tool_calls:void 0,tool_call_id:void 0}:r)}else return[];return[]}a(WM,"resolveResponseAsChatMessages");p();var K7t=new Ae("streamMessages");function oEn(t,e,r,n,o){let s=e.solution.text.join(""),c=!1;e.finishOffset!==void 0&&(K7t.debug(t,`message ${e.index}: early finish at offset ${e.finishOffset}`),s=s.substring(0,e.finishOffset),c=!0),K7t.info(t,`message ${e.index} returned. finish reason: [${e.reason}]`),K7t.debug(t,`message ${e.index} details: finishOffset: [${e.finishOffset}]`);let l=oIe(e.solution,t),u={role:"assistant",content:s};return iEn(t,u,l,e.index,e.requestId,c,e.reason??"",r,n,e.usage,e.copilot_usage,o)}a(oEn,"prepareChatCompletionForReturn");As();var fYe=class{constructor(){this.name="completions";this.engineName="chat"}static{a(this,"ChatCompletionsEndpointStrategy")}buildRequestBody(e,r){let o={messages:r.messages.map(c=>{let l={...c};if(delete l.thinking,c.thinking&&c.thinking.id){l.reasoning_opaque=c.thinking.id;let u=Array.isArray(c.thinking.text)?c.thinking.text.join(""):c.thinking.text;u&&(l.reasoning_text=u)}return l}),tools:r.tools,tool_choice:r.tool_choice,model:r.modelConfiguration?.modelId,temperature:sle(e,r.count),top_p:ale(e),n:r.count,stop:[` -`],copilot_thread_id:r.copilot_thread_id};r.modelConfiguration?.maxResponseTokens!==void 0&&(o.max_tokens=r.modelConfiguration.maxResponseTokens);let s=qL(r.repoInfo);return s!==void 0&&(o.nwo=s),r.postOptions&&Object.assign(o,r.postOptions),r.intentParams?.intent&&(o.intent=r.intentParams.intent,r.intentParams.intent_model&&(o.intent_model=r.intentParams.intent_model),r.intentParams.intent_tokenizer&&(o.intent_tokenizer=r.intentParams.intent_tokenizer),r.intentParams.intent_threshold&&(o.intent_threshold=r.intentParams.intent_threshold),r.intentParams.intent_content&&(o.intent_content=r.intentParams.intent_content)),o}processResponse(e,r,n,o,s){let c=r.headers.get(vQ)||void 0;return s.postOptions?.stream===!1?{type:"success",chatCompletions:this.processNonStreamingResponse(r,n,o,c),getProcessingTime:a(()=>e3(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??gr(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:In(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=In(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=QY.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:_Q(u,f=>Fmn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};p();p();p();var Gy=ce(wo());var tAn="ephemeral",F9t=4,O6o=2;function rAn(t){let e=F9t-O6o-B6o(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===Gy.Raw.ChatRole.Tool&&c?.role!==Gy.Raw.ChatRole.Tool,d=s.role===Gy.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===Gy.Raw.ChatRole.User)||d)&&(s.content.push({type:Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:tAn}),e--,e<=0))break;s.role===Gy.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===Gy.Raw.ChatRole.User||o.role===Gy.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:tAn})),o.role!==Gy.Raw.ChatRole.User&&o.role!==Gy.Raw.ChatRole.System)break}}a(rAn,"addCacheBreakpoints");function B6o(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(B6o,"countCacheBreakpoints");function nAn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==Gy.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(nAn,"removeCacheBreakpoints");var oAn=new ge("messagesApi"),L6o="Please continue.";function sAn(t){let e=Q6o(t.tools),r=F6o(t.messages,t.ctx);q6o(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:L6o}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(sAn,"buildMessagesApiRequest");function F6o(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=Eze(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=Eze(s.content);s.copilot_cache_control&&iAn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=Eze(s.content);if(s.thinking&&U6o(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{oAn.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&iAn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=Eze(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(F6o,"convertToAnthropicMessages");function Eze(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(Eze,"convertContentToAnthropicBlocks");function U6o(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&oAn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(U6o,"addThinkingBlocks");function iAn(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(iAn,"applyCacheControlToLastBlock");function Q6o(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(Q6o,"convertToAnthropicTools");function q6o(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=F9t-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(q6o,"addToolsAndSystemCacheControl");p();p();var rle=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;rl3(r),"getProcessingTime")}:this.processStreamingResponse(e,r,n,o,c,s)}processNonStreamingResponse(e,r,n,o){return(async function*(){let s=await e.text(),c=JSON.parse(s),l=c.choices!=null?c.choices[0].message:{role:"assistant",content:""},u=e.headers.get("X-Request-ID")??ir(),d={blockFinished:!1,choiceIndex:0,finishReason:"stop",message:l,tokens:Rn(l.content).split(" "),requestId:{headerRequestId:u,deploymentId:"",serverExperiments:""},telemetryData:n,numTokens:0,copilotEditsSessionHeader:o,usage:c.usage},f=Rn(l.content);await r(f,{text:f,copilotReferences:c.copilot_references}),yield Promise.resolve(d)})()}processStreamingResponse(e,r,n,o,s,c){let u=ZY.create(e,c.count,r,o,[],c.cancel).processSSE(n);return{type:"success",chatCompletions:rIe(u,f=>oEn(e,f,o,s,c.modelConfiguration?.modelId)),getProcessingTime:a(()=>l3(r),"getProcessingTime")}}};p();p();p();var Wy=fe(xo());var sEn="ephemeral",J7t=4,dqo=2;function aEn(t){let e=J7t-dqo-fqo(t);if(e<=0)return;let r=!0,n=[...t].reverse();for(let[o,s]of n.entries()){let c=o>0?n[o-1]:void 0;if(s.content.some(f=>f.type===Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint))continue;let u=s.role===Wy.Raw.ChatRole.Tool&&c?.role!==Wy.Raw.ChatRole.Tool,d=s.role===Wy.Raw.ChatRole.Assistant&&!s.toolCalls?.length;if((r&&(u||s.role===Wy.Raw.ChatRole.User)||d)&&(s.content.push({type:Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:sEn}),e--,e<=0))break;s.role===Wy.Raw.ChatRole.User&&(r=!1)}for(let o of t){if(e<=0)break;let s=o.content.some(c=>c.type===Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint);if((o.role===Wy.Raw.ChatRole.User||o.role===Wy.Raw.ChatRole.System)&&!s&&(e--,o.content.push({type:Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint,cacheType:sEn})),o.role!==Wy.Raw.ChatRole.User&&o.role!==Wy.Raw.ChatRole.System)break}}a(aEn,"addCacheBreakpoints");function fqo(t){let e=0;for(let r of t)e+=r.content.filter(n=>n.type===Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint).length;return e}a(fqo,"countCacheBreakpoints");function cEn(t){for(let e of t)e.content=e.content.filter(r=>r.type!==Wy.Raw.ChatCompletionContentPartKind.CacheBreakpoint)}a(cEn,"removeCacheBreakpoints");var uEn=new Ae("messagesApi"),pqo="Please continue.";function dEn(t){let e=gqo(t.tools),r=hqo(t.messages,t.ctx);Aqo(e,r);let n=r.messages.at(-1);n&&n.role==="assistant"&&r.messages.push({role:"user",content:[{type:"text",text:pqo}]});let o={model:t.model,...r,max_tokens:t.maxTokens??4096,stream:t.stream??!0,...e.length>0?{tools:e}:{}};return t.adaptiveThinking?(o.thinking={type:"adaptive"},t.thinkingEffort&&(o.output_config={effort:t.thinkingEffort})):t.thinkingBudget&&t.thinkingBudget>0&&(o.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),o}a(dEn,"buildMessagesApiRequest");function hqo(t,e){let r=[],n=[];for(let s of t)switch(s.role){case"system":{let c=pYe(s.content);for(let l of c)l.type==="text"&&n.push(l);break}case"user":{let c=pYe(s.content);s.copilot_cache_control&&lEn(c),c.length>0&&r.push({role:"user",content:c});break}case"assistant":{let c=pYe(s.content);if(s.thinking&&mqo(e,c,s.thinking),s.tool_calls)for(let l of s.tool_calls){if(!l.id)continue;let u={};try{u=typeof l.function.arguments=="string"?JSON.parse(l.function.arguments):l.function.arguments}catch{uEn.warn(e,`Failed to parse tool call arguments for ${l.function.name}, using empty object`)}c.push({type:"tool_use",id:l.id,name:l.function.name,input:u})}s.copilot_cache_control&&lEn(c),c.length>0&&r.push({role:"assistant",content:c});break}case"tool":{if(s.tool_call_id){let l=pYe(s.content).filter(d=>(d.type==="text"||d.type==="image")&&!(d.type==="text"&&d.text.trim()==="")),u={type:"tool_result",tool_use_id:s.tool_call_id,content:l.length>0?l:void 0};s.copilot_cache_control&&(u.cache_control={type:"ephemeral"}),r.push({role:"user",content:[u]})}break}}let o=[];for(let s of r){let c=o.at(-1);c&&c.role===s.role?c.content=[...c.content,...s.content]:o.push(s)}return{messages:o,...n.length>0?{system:n}:{}}}a(hqo,"convertToAnthropicMessages");function pYe(t){if(!t)return[];if(typeof t=="string")return t.trim()?[{type:"text",text:t}]:[];let e=[];for(let r of t)if(r.type==="text")r.text.trim()&&e.push({type:"text",text:r.text});else if(r.type==="image_url"){let n=r.image_url.url,o=n.match(/^data:(image\/(?:jpeg|png|gif|webp));base64,(.+)$/);o?e.push({type:"image",source:{type:"base64",media_type:o[1],data:o[2]}}):n.startsWith("https://")&&e.push({type:"image",source:{type:"url",url:n}})}return e}a(pYe,"convertContentToAnthropicBlocks");function mqo(t,e,r){let n=Array.isArray(r.text)?r.text.join(""):r.text;n&&r.encrypted?e.unshift({type:"thinking",thinking:n,signature:r.encrypted}):r.encrypted&&!n?e.unshift({type:"redacted_thinking",data:r.encrypted}):n&&!r.encrypted&&uEn.warn(t,"Dropping thinking block: has text but no signature (possible incomplete stream)")}a(mqo,"addThinkingBlocks");function lEn(t){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r.type!=="thinking"&&r.type!=="redacted_thinking"){r.cache_control={type:"ephemeral"};return}}}a(lEn,"applyCacheControlToLastBlock");function gqo(t){return!t||t.length===0?[]:t.filter(e=>e.function.name&&e.function.name.length>0).map(e=>({name:e.function.name,description:e.function.description||"",input_schema:{type:"object",properties:e.function.parameters?.properties??{},required:e.function.parameters?.required}}))}a(gqo,"convertToAnthropicTools");function Aqo(t,e){let r=0;if(e.system)for(let c of e.system)c.cache_control&&r++;for(let c of e.messages)for(let l of c.content)"cache_control"in l&&l.cache_control&&r++;let n=J7t-r;if(n<=0)return;let o=t.at(-1);o&&n>0&&(o.cache_control={type:"ephemeral"},n--);let s=e.system?.at(-1);s&&!s.cache_control&&n>0&&(s.cache_control={type:"ephemeral"})}a(Aqo,"addToolsAndSystemCacheControl");p();p();var dle=class{constructor(e,r){this.dataBuffer="";this.eventTypeBuffer="";this.buffer=[];this.endedOnCR=!1;this.onEventHandler=e,this.onUnrecognizedFieldHandler=r,this.decoder=new TextDecoder("utf-8")}static{a(this,"SSEParser")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let r=0;for(this.endedOnCR&&e[0]===10&&r++,this.endedOnCR=!1;r{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){eIe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){eIe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(aAn,"processMessagesApiStream");var U9t=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):eIe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return eIe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&eIe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=Yce(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var _ze=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return sAn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}processResponse(e,r,n,o,s){let c=r.headers.get(vQ)||void 0;return{type:"success",chatCompletions:aAn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};p();p();p();p();var uAn=ce(wo());var sr=class extends uAn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?cAn(r):void 0,s=n?lAn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?cAn(n):void 0,c=o?lAn(o):void 0;return this.renderCopilot(e,r,s,c)}};function cAn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(cAn,"adaptProgressCallbackFromVSCode");function lAn(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a(lAn,"adaptCancellationTokenFromVSCode");var dAn="phase_data",Cze=class extends sr{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:dAn,phase:e}})}};function vze(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===dAn&&typeof r.phase=="string")return r.phase}a(vze,"rawPartAsPhaseData");p();var fAn="thinking",nle=class extends sr{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:fAn,thinking:e},tokenUsage:e.tokens??0})}};function bze(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===fAn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(bze,"rawPartAsThinkingData");var DS=ce(wo());function j6o(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=pAn(r);e.push({role:"system",content:n});break}case"user":{let n=pAn(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=G6o(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(j6o,"convertToResponsesApiInput");function H6o(t){let e=[];for(let r of t)switch(r.role){case DS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=$6o(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===DS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=V6o(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case DS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===DS.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===DS.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case DS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===DS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===DS.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case DS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===DS.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(H6o,"convertRawMessagesToResponsesApiInput");function pAn(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(pAn,"convertMessageContentToInputParts");function G6o(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(G6o,"convertMessageContentToOutputParts");function $6o(t){let e=[];for(let r of t)if(r.type===DS.Raw.ChatCompletionContentPartKind.Opaque){let n=bze(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a($6o,"extractReasoningFromRawMessage");function V6o(t){for(let e of t)if(e.type===DS.Raw.ChatCompletionContentPartKind.Opaque){let r=vze(e);if(r)return r}}a(V6o,"extractPhaseFromRawMessage");function hAn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=H6o(r).input:u=j6o(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(hAn,"buildResponsesApiRequest");p();var Q9t=new ge("responsesApiStream"),W6o=10,Sze=500,JY=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function mAn(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Vu(n)}. Input: '${t}'`)}}a(mAn,"parseCallArguments");async function*gAn(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new q9t(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new rle(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=W6o)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>Sze?T.substring(0,Sze):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>Sze&&(_=_.substring(0,Sze)+"\u2026"),Q9t.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new JY(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new JY(`The server returned an error: ${_}`)}else if(E)throw Q9t.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new JY("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){Q9t.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(gAn,"processResponsesApiStream");var q9t=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` +`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}};var cIe=new Ae("messagesApiStream");async function*fEn(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new Z7t(t,n,u,d,o,c),h=[],m;try{let g=new dle(A=>{try{if(A.data==="[DONE]")return;let y;try{y={type:A.type,...JSON.parse(A.data)}}catch(_){cIe.warn(t,`Skipping malformed SSE event: ${String(_.message).substring(0,100)}`);return}let E=f.push(y,r);E&&h.push(E)}catch(y){m=y}});for await(let A of l){if(s?.isCancellationRequested)break;for(g.feed(new Uint8Array(A));h.length>0;)yield h.shift();if(m)throw m}for(;h.length>0;)yield h.shift()}finally{try{l.destroy()}catch(g){cIe.exception(t,g,`Error destroying stream for Messages API request ${u}`)}}}a(fEn,"processMessagesApiStream");var Z7t=class{constructor(e,r,n,o,s,c){this.ctx=e;this.telemetryData=r;this.requestId=n;this.ghRequestId=o;this.copilotEditsSessionHeader=s;this.modelId=c;this.textAccumulator="";this.toolCallAccumulator=new Map;this.thinkingAccumulator=new Map;this.completedToolCalls=[];this.completedThinking=[];this.inputTokens=0;this.outputTokens=0;this.cacheCreationTokens=0;this.cacheReadTokens=0;this.hasError=!1}static{a(this,"AnthropicMessagesProcessor")}push(e,r){if(this.hasError)return;let n=a((o,s)=>{this.textAccumulator+=o,r(this.textAccumulator,{text:this.textAccumulator,...s})},"onProgress");switch(e.type){case"message_start":e.message&&(this.inputTokens=e.message.usage.input_tokens??0,this.outputTokens=e.message.usage.output_tokens??0,this.cacheCreationTokens=e.message.usage.cache_creation_input_tokens??0,this.cacheReadTokens=e.message.usage.cache_read_input_tokens??0);return;case"content_block_start":e.content_block?.type==="tool_use"&&e.index!==void 0?this.toolCallAccumulator.set(e.index,{id:e.content_block.id||"",name:e.content_block.name||"",arguments:""}):e.content_block?.type==="thinking"&&e.index!==void 0?this.thinkingAccumulator.set(e.index,{thinking:"",signature:""}):e.content_block?.type==="redacted_thinking"&&e.index!==void 0&&e.content_block.data&&(n("",{thinking:{id:`redacted_thinking_${e.index}`,encrypted:e.content_block.data}}),this.completedThinking.push({index:e.index,thinking:"",signature:e.content_block.data}));return;case"content_block_delta":if(e.delta){if(e.delta.type==="text_delta"&&e.delta.text)n(e.delta.text,{});else if(e.delta.type==="thinking_delta"&&e.delta.thinking&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.thinking+=e.delta.thinking),n("",{thinking:{id:`thinking_${e.index}`,text:e.delta.thinking}})}else if(e.delta.type==="signature_delta"&&e.delta.signature&&e.index!==void 0){let o=this.thinkingAccumulator.get(e.index);o&&(o.signature+=e.delta.signature)}else if(e.delta.type==="input_json_delta"&&e.delta.partial_json&&e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(o.arguments+=e.delta.partial_json)}}return;case"content_block_stop":if(e.index!==void 0){let o=this.toolCallAccumulator.get(e.index);o&&(this.completedToolCalls.push(o),this.toolCallAccumulator.delete(e.index));let s=this.thinkingAccumulator.get(e.index);s&&(s.signature?n("",{thinking:{id:`thinking_${e.index}`,encrypted:s.signature}}):cIe.warn(this.ctx,`Thinking block ${e.index} finalized without signature (incomplete stream?)`),this.completedThinking.push({index:e.index,...s}),this.thinkingAccumulator.delete(e.index))}return;case"message_delta":e.usage&&(this.outputTokens=e.usage.output_tokens,this.inputTokens=e.usage.input_tokens??this.inputTokens,this.cacheCreationTokens=e.usage.cache_creation_input_tokens??this.cacheCreationTokens,this.cacheReadTokens=e.usage.cache_read_input_tokens??this.cacheReadTokens),e.delta?.stop_reason&&(this.stopReason=e.delta.stop_reason),e.copilot_usage&&(this.copilotUsage=e.copilot_usage);return;case"message_stop":return this.buildFinalCompletion();case"error":{let o=e.error,s=o?.message||"Unknown error",c=o?.type||"unknown";return cIe.warn(this.ctx,`Messages API error (${c}): ${s}`),n("",{copilotErrors:[{type:"error",code:c,message:s,identifier:""}]}),this.stopReason="error",this.hasError=!0,this.buildFinalCompletion()}}}buildFinalCompletion(){let e;switch(this.stopReason){case"max_tokens":case"model_context_window_exceeded":e="length";break;case"tool_use":e="tool_calls";break;case"refusal":e="content_filter";break;default:e="stop";break}let r=this.inputTokens+this.cacheCreationTokens+this.cacheReadTokens,n={prompt_tokens:r,completion_tokens:this.outputTokens,total_tokens:r+this.outputTokens,prompt_tokens_details:{cached_tokens:this.cacheReadTokens}},o=this.copilotUsage,s={role:"assistant",content:this.textAccumulator},c=[...this.completedThinking.map(d=>({index:d.index,thinking:d.thinking,signature:d.signature})),...[...this.thinkingAccumulator.entries()].map(([d,f])=>({index:d,...f}))],l;for(let d of c)if(d.thinking||d.signature)if(!l)l={id:`thinking_${d.index}`,text:d.thinking||void 0,encrypted:d.signature||void 0};else{if(d.thinking){let f=Array.isArray(l.text)?l.text.join(""):l.text??"";l.text=f+d.thinking}d.signature&&(l.encrypted&&cIe.warn(this.ctx,"Multiple thinking blocks with signatures; keeping last"),l.id=`thinking_${d.index}`,l.encrypted=d.signature)}l&&l.tokens===void 0&&(l.tokens=cle(l,this.modelId));let u={message:s,choiceIndex:0,requestId:{headerRequestId:this.requestId,deploymentId:"",serverExperiments:"",ghRequestId:this.ghRequestId},tokens:[],numTokens:0,blockFinished:!0,finishReason:e,telemetryData:this.telemetryData,usage:n,copilotEditsSessionHeader:this.copilotEditsSessionHeader,thinking:l,copilot_usage:o};return this.completedToolCalls.length>0&&(u.tool_calls=this.completedToolCalls.map(d=>({id:d.id,type:"function",function:{name:d.name,arguments:d.arguments},approxNumTokens:0}))),u}};var hYe=class{constructor(){this.name="v1/messages";this.engineName=""}static{a(this,"MessagesEndpointStrategy")}buildRequestBody(e,r){let n=r.postOptions,o=n?.thinking_budget,s=n?.adaptive_thinking,c=n?.thinking_effort;return dEn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,maxTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,thinkingBudget:o,adaptiveThinking:s,thinkingEffort:c,ctx:e})}processResponse(e,r,n,o,s){let c=r.headers.get(LQ)||void 0;return{type:"success",chatCompletions:fEn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>l3(r),"getProcessingTime")}}};p();p();p();p();var mEn=fe(xo());var ar=class extends mEn.PromptElement{static{a(this,"CopilotPromptElement")}constructor(e){super(e)}async prepare(e,r,n){if(!this.prepareCopilot)return;let o=r?pEn(r):void 0,s=n?hEn(n):void 0;return await this.prepareCopilot(e,o,s)}render(e,r,n,o){let s=n?pEn(n):void 0,c=o?hEn(o):void 0;return this.renderCopilot(e,r,s,c)}};function pEn(t){return e=>{let r=e.text||"";if(t?.report&&r){let n={value:r};t.report(n)}}}a(pEn,"adaptProgressCallbackFromVSCode");function hEn(t){return{get isCancellationRequested(){return t?.isCancellationRequested??!1},onCancellationRequested:a((e,r)=>{let n=t?.onCancellationRequested(e,r);return{dispose:a(()=>{n?.dispose()},"dispose")}},"onCancellationRequested")}}a(hEn,"adaptCancellationTokenFromVSCode");var gEn="phase_data",mYe=class extends ar{static{a(this,"PhaseDataContainer")}renderCopilot(){let{phase:e}=this.props;return vscpp("opaque",{value:{type:gEn,phase:e}})}};function gYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===gEn&&typeof r.phase=="string")return r.phase}a(gYe,"rawPartAsPhaseData");p();var AEn="thinking",fle=class extends ar{static{a(this,"ThinkingDataContainer")}renderCopilot(){let{thinking:e}=this.props;return vscpp("opaque",{value:{type:AEn,thinking:e},tokenUsage:e.tokens??0})}};function AYe(t){let e=t.value;if(!e||typeof e!="object")return;let r=e;if(r.type===AEn&&r.thinking&&typeof r.thinking=="object")return r.thinking}a(AYe,"rawPartAsThinkingData");var wS=fe(xo());function yqo(t){let e=[];for(let r of t)switch(r.role){case"system":{let n=yEn(r);e.push({role:"system",content:n});break}case"user":{let n=yEn(r);e.push({role:"user",content:n});break}case"assistant":{if(r.thinking&&r.thinking.id&&r.thinking.encrypted){let o={type:"reasoning",id:r.thinking.id,summary:[],encrypted_content:r.thinking.encrypted};e.push(o)}let n=_qo(r);if(n.length>0){let o={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...r.phase?{phase:r.phase}:{}};e.push(o)}if(r.tool_calls)for(let o of r.tool_calls)o.id&&e.push({type:"function_call",call_id:o.id,name:o.function.name,arguments:typeof o.function.arguments=="string"?o.function.arguments:JSON.stringify(o.function.arguments)});break}case"tool":{if(r.tool_call_id){let n=typeof r.content=="string"?r.content:Array.isArray(r.content)?r.content.map(o=>o.type==="text"?o.text:"").join(""):"";e.push({type:"function_call_output",call_id:r.tool_call_id,output:n})}break}}return e}a(yqo,"convertToResponsesApiInput");function Eqo(t){let e=[];for(let r of t)switch(r.role){case wS.Raw.ChatRole.Assistant:if(r.content&&r.content.length>0){let n=vqo(r.content);e.push(...n)}if(r.content&&r.content.length>0){let n=[];for(let o of r.content)o.type===wS.Raw.ChatCompletionContentPartKind.Text&&o.text.trim()&&n.push({type:"output_text",text:o.text,annotations:[]});if(n.length>0){let o=Cqo(r.content),s={type:"message",role:"assistant",id:"msg_123",status:"completed",content:n,...o?{phase:o}:{}};e.push(s)}}if(r.toolCalls)for(let n of r.toolCalls)e.push({type:"function_call",name:n.function.name,arguments:n.function.arguments,call_id:n.id});break;case wS.Raw.ChatRole.Tool:if(r.toolCallId&&r.content){let n=r.content.filter(s=>s.type===wS.Raw.ChatCompletionContentPartKind.Text).map(s=>s.text).join("");n&&e.push({type:"function_call_output",call_id:r.toolCallId,output:n});let o=r.content.filter(s=>s.type===wS.Raw.ChatCompletionContentPartKind.Image).map(s=>({type:"input_image",image_url:s.imageUrl.url,detail:s.imageUrl.detail||"auto"}));o.length&&e.push({role:"user",content:[{type:"input_text",text:"Image associated with the above tool call:"},...o]})}break;case wS.Raw.ChatRole.User:if(r.content){let n=[];for(let o of r.content)o.type===wS.Raw.ChatCompletionContentPartKind.Text?n.push({type:"input_text",text:o.text}):o.type===wS.Raw.ChatCompletionContentPartKind.Image&&n.push({type:"input_image",image_url:o.imageUrl.url,detail:o.imageUrl.detail||"auto"});n.length>0&&e.push({role:"user",content:n})}break;case wS.Raw.ChatRole.System:if(r.content){let n=[];for(let o of r.content)o.type===wS.Raw.ChatCompletionContentPartKind.Text&&n.push({type:"input_text",text:o.text});n.length>0&&e.push({role:"system",content:n})}break}return{input:e}}a(Eqo,"convertRawMessagesToResponsesApiInput");function yEn(t){return typeof t.content=="string"?[{type:"input_text",text:t.content.trim()}]:Array.isArray(t.content)?t.content.map(e=>e.type==="text"?{type:"input_text",text:e.text.trim()}:e.type==="image_url"?{type:"input_image",image_url:e.image_url.url,detail:e.image_url.detail||"auto"}:{type:"input_text",text:""}):[{type:"input_text",text:""}]}a(yEn,"convertMessageContentToInputParts");function _qo(t){if(typeof t.content=="string")return t.content.trim()?[{type:"output_text",text:t.content,annotations:[]}]:[];if(Array.isArray(t.content)){let e=[];for(let r of t.content)r.type==="text"&&r.text.trim()&&e.push({type:"output_text",text:r.text,annotations:[]});return e}return[]}a(_qo,"convertMessageContentToOutputParts");function vqo(t){let e=[];for(let r of t)if(r.type===wS.Raw.ChatCompletionContentPartKind.Opaque){let n=AYe(r);n&&n.id&&n.encrypted&&e.push({type:"reasoning",id:n.id,summary:[],encrypted_content:n.encrypted})}return e}a(vqo,"extractReasoningFromRawMessage");function Cqo(t){for(let e of t)if(e.type===wS.Raw.ChatCompletionContentPartKind.Opaque){let r=gYe(e);if(r)return r}}a(Cqo,"extractPhaseFromRawMessage");function EEn(t){let{messages:e,promptTsxRawMessages:r,model:n,tools:o,toolChoice:s,maxOutputTokens:c,enableThinking:l}=t,u;r&&r.length>0?u=Eqo(r).input:u=yqo(e);let d={model:n,input:u};return o&&o.length>0&&(d.tools=o.map(f=>({...f.function,type:"function",strict:!1,parameters:f.function.parameters||{}}))),s&&(typeof s=="object"&&"function"in s?d.tool_choice={type:"function",name:s.function.name}:d.tool_choice=s),c!==void 0&&(d.max_output_tokens=c),d.stream=!0,d.store=!1,d.truncation="disabled",l&&(d.reasoning={effort:t.reasoningEffort??"medium",summary:"detailed"},d.include=["reasoning.encrypted_content"]),d}a(EEn,"buildResponsesApiRequest");p();var X7t=new Ae("responsesApiStream"),bqo=10,yYe=500,eK=class extends Error{static{a(this,"MidStreamError")}constructor(e){super(e),this.name="MidStreamError"}};function _En(t,e,r){if(!t)return{};try{return JSON.parse(t)}catch(n){throw new Error(`Failed to parse JSON for ${e} '${r}': ${Yu(n)}. Input: '${t}'`)}}a(_En,"parseCallArguments");async function*vEn(t,e,r,n,o,s,c){let l=e.body(),u=e.headers.get("X-Request-ID")||e.headers.get("x-request-id")||"unknown",d=e.headers.get("x-github-request-id")||"",f=new eQt(n,u,o,d,c),h=[],m,g=!1,A=[];try{let y=new dle(E=>{try{let _={type:E.type,...JSON.parse(E.data)},v=f.push(_,r);v&&h.push(v)}catch(_){m=_}},(E,_)=>{if(A.length>=bqo)return;let v=E.trim(),b=_?.trim(),T=v&&b?`${v}: ${b}`:v||b||"";T.length>0&&A.push(T.length>yYe?T.substring(0,yYe):T)});for await(let E of l){if(s?.isCancellationRequested)break;for(y.feed(new Uint8Array(E));h.length>0;)g=!0,yield h.shift();if(m)throw m}for(;h.length>0;)g=!0,yield h.shift();if(!g&&!s?.isCancellationRequested){let E=f.hasReceivedContentEvents();if(A.length>0){let _=A.join("; ");throw _.length>yYe&&(_=_.substring(0,yYe)+"\u2026"),X7t.error(t,`Non-SSE text received in stream for request ${u}: ${_}`),E?new eK(`The server disconnected unexpectedly while generating a response (${_}). The partial response above may be incomplete.`):new eK(`The server returned an error: ${_}`)}else if(E)throw X7t.error(t,`Stream ended without response.completed for request ${u} after receiving partial content`),new eK("The server disconnected unexpectedly while generating a response. The partial response above may be incomplete.")}}finally{try{l.destroy()}catch(y){X7t.exception(t,y,`Error destroying stream for Responses API request ${u}`)}}}a(vEn,"processResponsesApiStream");var eQt=class{constructor(e,r,n,o,s){this.telemetryData=e;this.requestId=r;this.copilotEditsSessionHeader=n;this.modelId=s;this.textAccumulator="";this.hasReceivedReasoningSummary=!1;this.thinking={id:"",text:[]};this.eventCount=0}static{a(this,"OpenAIResponsesProcessor")}hasReceivedContentEvents(){return this.eventCount>0}push(e,r){let n=a(o=>{this.textAccumulator+=o.text,r(this.textAccumulator,o)},"onProgress");switch(e.type){case"error":n({text:"",copilotErrors:[{code:e.code||"unknown",message:e.message,type:"error",identifier:e.param||""}]});return;case"response.output_text.delta":this.eventCount++,n({text:e.delta});return;case"response.output_item.added":this.eventCount++,e.item.type==="function_call"&&n({text:"",beginToolCalls:[{name:e.item.name}]});return;case"response.output_item.done":return this.handleOutputItemDone(e.item,n);case"response.reasoning_summary_text.delta":this.eventCount++,this.hasReceivedReasoningSummary=!0,e.delta&&Array.isArray(this.thinking.text)&&this.thinking.text.push(e.delta),n({text:"",thinking:{id:e.item_id,text:e.delta}});return;case"response.reasoning_summary_part.done":this.hasReceivedReasoningSummary=!0,Array.isArray(this.thinking.text)&&this.thinking.text.push(` `),n({text:"",thinking:{id:e.item_id,text:` -`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=mAn(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=mAn(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=Yce(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var Tze=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return hAn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??zce(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:CQ(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(vQ)||void 0;return{type:"success",chatCompletions:gAn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>e3(r),"getProcessingTime")}}};fP.register(new Tze);fP.register(new jWe);fP.register(new _ze);p();var Ize=require("fs"),NS=ce(require("path"));function Rze(t){return zse(()=>!!qt(t,je.PromptPersistBasePath)?.trim(),!1)}a(Rze,"isPromptPersistEnabled");var z6o={mkdir:a((t,e)=>Ize.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>Ize.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>Ize.promises.appendFile(t,e,r),"appendFile")},AP,xze,G9t,j9t=new Map,AAn=0,H9t=new Map,$9t=new Map;function V9t(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(V9t,"formatHumanTimestamp");function W9t(t,e){return xze||(xze=Y6o(t,e)),xze}a(W9t,"getSharedProcessRoot");async function Y6o(t,e){let r=V9t(new Date);AP=NS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(AP,{recursive:!0});let n=new Date().toISOString();G9t=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:AP};return await e.writeFile(NS.join(AP,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await J6o(AP,e).catch(()=>{}),await Z6o(AP,e).catch(()=>{}),AP}a(Y6o,"initProcessRoot");async function K6o(t){if(AP)try{let e=NS.join(AP,"session.json"),r=new Date().toISOString(),n={createdAt:G9t??r,updatedAt:r,pid:process.pid,processRoot:AP};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(K6o,"touchProcessRootSessionJson");function z9t(t){return $9t.get(t)}a(z9t,"getTurnDir");function yAn(){AP=void 0,xze=void 0,G9t=void 0,j9t.clear(),AAn=0,H9t.clear(),$9t.clear()}a(yAn,"resetSharedProcessRoot");async function J6o(t,e){await e.writeFile(NS.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs +`}});return;case"response.completed":return this.handleCompletedResponse(e,n);default:return}}handleOutputItemDone(e,r){if(this.eventCount++,e.type==="function_call"){let n=_En(e.arguments,"tool call",e.name);r({text:"",toolCalls:[{id:e.call_id,type:"function",function:{name:e.name,arguments:n},approxNumTokens:0}],phase:e.phase})}else if(e.type==="reasoning")e.id&&(this.thinking.id=e.id),e.encrypted_content&&(this.thinking.encrypted=e.encrypted_content),r({text:"",thinking:e.encrypted_content?{id:e.id,text:this.hasReceivedReasoningSummary?void 0:e.summary.map(n=>n.text),encrypted:e.encrypted_content}:void 0});else if(e.type==="message"){let n=e.phase;n&&r({text:"",phase:n})}}handleCompletedResponse(e,r){r({text:"",statefulMarker:e.response.id});let n=[],o=[];for(let f of e.response.output)if(f.type==="message"){if(f.content)for(let h of f.content)h.type==="output_text"&&h.text?n.push(h.text):h.type==="refusal"&&h.refusal&&n.push(h.refusal)}else if(f.type==="function_call"){let h=_En(f.arguments,"tool call",f.name);o.push({id:f.call_id,type:"function",function:{name:f.name,arguments:h},approxNumTokens:0})}let s={role:"assistant",content:n.join("")},c={prompt_tokens:e.response.usage?.input_tokens??0,completion_tokens:e.response.usage?.output_tokens??0,total_tokens:e.response.usage?.total_tokens??0,prompt_tokens_details:{cached_tokens:e.response.usage?.input_tokens_details?.cached_tokens??0},completion_tokens_details:{reasoning_tokens:e.response.usage?.output_tokens_details?.reasoning_tokens??0,accepted_prediction_tokens:0,rejected_prediction_tokens:0}},l={headerRequestId:this.requestId,serverExperiments:"",deploymentId:""},u=this.thinking.id?this.thinking:void 0;u&&u.tokens===void 0&&(u.tokens=cle(u,this.modelId));let d=e.copilot_usage;return{message:s,choiceIndex:0,requestId:l,tokens:[],numTokens:c.completion_tokens,blockFinished:!0,finishReason:o.length>0?"tool_calls":"stop",telemetryData:this.telemetryData,tool_calls:o.length>0?o:void 0,thinking:u,copilotEditsSessionHeader:this.copilotEditsSessionHeader,usage:c,copilot_usage:d}}};var EYe=class{constructor(){this.name="responses";this.engineName=""}static{a(this,"ResponsesEndpointStrategy")}buildRequestBody(e,r){return EEn({messages:r.messages,model:r.modelConfiguration?.modelId||"unknown",tools:r.tools,toolChoice:r.tool_choice,topP:r.topP??ale(e),maxOutputTokens:r.modelConfiguration?.maxResponseTokens,stream:!0,store:!1,enableThinking:r.enableThinking,reasoningEffort:BQ(r.modelConfiguration?.reasoningEfforts,r.modelConfiguration?.userSelectedReasoningEffort)})}processResponse(e,r,n,o,s){let c=r.headers.get(LQ)||void 0;return{type:"success",chatCompletions:vEn(e,r,n,o,c,s.cancel,s.modelConfiguration?.modelId),getProcessingTime:a(()=>l3(r),"getProcessingTime")}}};Ek.register(new EYe);Ek.register(new fYe);Ek.register(new hYe);p();var _Ye=require("fs"),RS=fe(require("path"));function bYe(t){return Use(()=>!!Ht(t,Je.PromptPersistBasePath)?.trim(),!1)}a(bYe,"isPromptPersistEnabled");var Sqo={mkdir:a((t,e)=>_Ye.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>_Ye.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>_Ye.promises.appendFile(t,e,r),"appendFile")},_k,vYe,nQt,tQt=new Map,CEn=0,rQt=new Map,iQt=new Map;function oQt(t){return t.toISOString().slice(0,19).replace(/-/g,"").replace(/:/g,"")}a(oQt,"formatHumanTimestamp");function sQt(t,e){return vYe||(vYe=Tqo(t,e)),vYe}a(sQt,"getSharedProcessRoot");async function Tqo(t,e){let r=oQt(new Date);_k=RS.join(t,`pid-${process.pid}_${r}`),await e.mkdir(_k,{recursive:!0});let n=new Date().toISOString();nQt=n;let o={createdAt:n,updatedAt:n,pid:process.pid,processRoot:_k};return await e.writeFile(RS.join(_k,"session.json"),JSON.stringify(o,null,2),"utf8").catch(()=>{}),await xqo(_k,e).catch(()=>{}),await wqo(_k,e).catch(()=>{}),_k}a(Tqo,"initProcessRoot");async function Iqo(t){if(_k)try{let e=RS.join(_k,"session.json"),r=new Date().toISOString(),n={createdAt:nQt??r,updatedAt:r,pid:process.pid,processRoot:_k};await t.writeFile(e,JSON.stringify(n,null,2),"utf8")}catch{}}a(Iqo,"touchProcessRootSessionJson");function aQt(t){return iQt.get(t)}a(aQt,"getTurnDir");function bEn(){_k=void 0,vYe=void 0,nQt=void 0,tQt.clear(),CEn=0,rQt.clear(),iQt.clear()}a(bEn,"resetSharedProcessRoot");async function xqo(t,e){await e.writeFile(RS.join(t,"README.md"),`# Copilot Language Server \u2014 Request Logs This directory contains persisted HTTP requests, LLM call logs, and tool-call trajectory data captured during a single CLS process. @@ -2430,7 +2461,7 @@ node generateHar.js http-log my-session.har \`\`\` Run from this directory, or pass absolute paths. -`,"utf8")}a(J6o,"writeReadme");async function Z6o(t,e){await e.writeFile(NS.join(t,"generateHar.js"),`#!/usr/bin/env node +`,"utf8")}a(xqo,"writeReadme");async function wqo(t,e){await e.writeFile(RS.join(t,"generateHar.js"),`#!/usr/bin/env node "use strict"; /** * Converts per-request JSON files from an http-log directory into a single HAR @@ -2499,51 +2530,51 @@ async function main() { } main().catch(e => { console.error(e); process.exit(1); }); -`,"utf8")}a(Z6o,"writeGenerateHarScript");var wze=class{constructor(e,r,n,o,s,c,l,u){this.ctx=e;this.source=n;this.conversationId=o;this.turnId=s;this.parentConversationId=c;this.parentTurnId=l;this.subagentName=u;this.sequenceNumber=0;this.appendQueues=new Map;this.fileOps=r??z6o}static{a(this,"LLMRequestPersistence")}isEnabled(){return!!this.getBasePath()}async ensureInitialized(){if(this.isEnabled())try{await this.ensureSessionDir()}catch{}}getBasePath(){return qt(this.ctx,je.PromptPersistBasePath)?.trim()||void 0}ensureSessionDir(){return this.sessionDirPromise||(this.sessionDirPromise=this.initSessionDir()),this.sessionDirPromise}async initSessionDir(){let e=this.getBasePath(),r=await W9t(e,this.fileOps);if(this.conversationId&&this.turnId){let n=this.conversationId.slice(0,8),o=this.turnId.slice(0,8),s=this.subagentName?this.subagentName.replace(/[^a-zA-Z0-9_-]/g,"_").slice(0,50):void 0,c=s?`_subagent-${s}`:"",l=(j9t.get(this.conversationId)??0)+1;j9t.set(this.conversationId,l);let u=String(l).padStart(6,"0"),d=this.parentTurnId?z9t(this.parentTurnId):void 0;if(this.subagentName&&d)this.sessionDir=NS.join(d,"runSubAgent",n,`${u}_${o}${c}`);else{let f=H9t.get(this.conversationId);f||(f=String(++AAn).padStart(6,"0"),H9t.set(this.conversationId,f)),this.sessionDir=NS.join(r,"conversations",`${f}_${n}`,`${u}_${o}${c}`)}await this.fileOps.mkdir(this.sessionDir,{recursive:!0}),$9t.set(this.turnId,this.sessionDir),await this.writeTurnMetadata(),K6o(this.fileOps)}else this.sessionDir=r;return this.sessionDir}async writeTurnMetadata(){try{let e={createdAt:new Date().toISOString(),pid:process.pid,conversationId:this.conversationId,turnId:this.turnId,source:this.source,...this.parentConversationId?{parentConversationId:this.parentConversationId}:{},...this.parentTurnId?{parentTurnId:this.parentTurnId}:{},...this.subagentName?{subagentName:this.subagentName}:{}},r=NS.join(this.sessionDir,"turn.json");await this.fileOps.writeFile(r,JSON.stringify(e,null,2),"utf8")}catch{}}async persistLLMRequest(e){if(this.isEnabled())try{let r=await this.ensureSessionDir();this.sequenceNumber++;let n=e.conversationId??this.conversationId,o=e.turnId??this.turnId,s={requestId:e.requestId,sequenceNumber:this.sequenceNumber,timestamp:new Date().toISOString(),...n?{conversationId:n}:{},...o?{turnId:o}:{},messages:e.messages,tools:e.tools,model:e.model,response:e.response,durationMs:e.durationMs},c=NS.join(r,"fetchLog.jsonl"),l=JSON.stringify(s)+` -`;await this.serializedAppend(c,l)}catch(r){Ye.debug(this.ctx,"Failed to persist LLM request",r)}}async appendTrajectoryStep(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.debug(this.ctx,"Failed to append trajectory step",r)}}async appendSubagentLink(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"trajectory.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.debug(this.ctx,"Failed to append subagent link",r)}}async appendToolInOut(e){if(this.isEnabled())try{let r=await this.ensureSessionDir(),n=NS.join(r,"tool-in-out.jsonl"),o=JSON.stringify(e)+` -`;await this.serializedAppend(n,o)}catch(r){Ye.debug(this.ctx,"Failed to append tool-in-out entry",r)}}serializedAppend(e,r){let o=(this.appendQueues.get(e)??Promise.resolve()).then(()=>this.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var Pze=require("fs"),YM=ce(require("path"));var EAn=require("stream");var X6o={mkdir:a((t,e)=>Pze.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>Pze.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>Pze.promises.appendFile(t,e,r),"appendFile")},kze,Dze=class t{constructor(e,r){this.ctx=e;this.fileOps=r??X6o,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){kze=void 0,yAn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return qt(this.ctx,je.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return kze||(kze=this.initHttpLogDir()),kze}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await W9t(this.basePath,this.toPersistenceFileOps()),r=YM.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{Ye.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{Ye.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=z9t(e);if(!r)return;let n=YM.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(YM.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{Ye.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(YM.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(YM.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(YM.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(YM.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(YM.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(YM.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},Nze=class extends BI{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new EAn.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var ZY=class t extends R_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new ge("AutoModelService"),this._register(Es(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(dc).getMetadata(),c=await this._ctx.get(Bc).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await zHe(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var Mze="Auto",MS="auto",_An="custom",Uo=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new bc(e.get(Si)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(dc).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n,o,s,c){if(n===MS)return await e.get(ZY).resolveModelConfiguration(s??"unknown",c);if(n)return e.get(Bc).getBestChatModelConfig([n],void 0,!0);{let l=await e.get(Qt).getToken(),u=!!l.userInfo?.isTBBEnabled,d=!!l.userInfo?.isFreeUser,f=e.get(Rd);if(!u&&f.quotaExhausted&&!d){let h=await e.get(dc).getFallbackModel();if(h?.id)return e.get(Bc).getBestChatModelConfig([h.id])}if(r)return e.get(Bc).getBestChatModelConfig(hS(r,u),o);throw new Error("Model is not specified")}}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(Ye.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static transformMessages(e,r){return r===Tn.O1Ga||r===Tn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=Y9t(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var Hp=new ge("fetchChat"),e9o=new Set([500,502,504]),t9o=[1e3,1e4,1e4],Oze=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(P0(f)||!OI(f))throw f;Hp.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(i9o(l.status)){Hp.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await Uo.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(Rd).processQuotaHeaders(l.headers),e.get(jM).processRateLimitHeaders(l.headers);let u=fP.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){Hp.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await o9o(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){Hp.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}Hp.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return jt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=fP.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return Amn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await r9o(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Hp.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),ht(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Qt).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return Hp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=yoe(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return gt(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return Hp.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400&&c.includes("off_topic"))return{type:"failed",reason:"filtered as off_topic by intent classifier: message was not programming related",code:n.status};if(n.status===400&&c.includes("model_not_supported"))return{type:"failed",reason:o?`model is not supported: ${o}`:"model is not supported.",code:n.status};if(n.status==400&&c.includes("model_max_prompt_tokens_exceeded"))return{type:"failed",reason:"model max prompt tokens exceeded.",code:n.status};if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Qt).getToken();if(n.status===402){if(c.includes("free_quota_exceeded"))return{type:"failed",reason:u?`You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait until ${new Date(u).toLocaleString()} for your limit to reset.`:"You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",code:n.status};if(c.includes("overage_limit_reached"))return{type:"failed",reason:d.userInfo?.isTBBEnabled?"You've reached your additional usage limit for your plan. Go to [GitHub Settings](https://github.com/settings/copilot/features) for more details.":"You cannot accrue additional overages at this time. Please contact [GitHub Support](https://support.github.com/contact) to continue using Copilot.",code:n.status};if(c.includes("quota_exceeded"))if(d.userInfo?.isTBBEnabled){let h=yoe(n),m="";h!==void 0&&(m=` Quota resets on ${new Date(Date.now()+h*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}.`);let g=e.get(Rd).overageEnabled?"increase budget":"enable additional overages",A=d.userInfo?.canUpgradePlan?", upgrade your plan":"";switch(d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:`You've used your monthly chat messages limit. Please upgrade your plan or wait for your allowance to renew.${m}`,code:n.status};case"individual":case"individual_pro":return{type:"failed",reason:`You've used your monthly AI Credits. Please ${g}${A} or wait for your allowance to renew.${m}`,code:n.status};case"individual_max":return{type:"failed",reason:`You've used your monthly AI Credits. Please ${g} or wait for your allowance to renew.${m}`,code:n.status};case"business":case"enterprise":return{type:"failed",reason:`You've used your monthly AI Credits. Please reach out to your organization's Copilot admin to ${g} or wait for your allowance to renew.${m}`,code:n.status};default:return{type:"failed",reason:`You've used your monthly AI Credits.${m}`,code:n.status}}}else switch(d.userInfo?.copilotPlan){case"free":return{type:"failed",reason:"You've reached your monthly chat messages quota. Upgrade to Copilot Pro (30-day free trial) or wait for your allowance to renew.",code:n.status};case"individual":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please enable additional paid premium requests, upgrade to Copilot Pro+, or wait for your allowance to renew.",code:n.status};case"individual_pro":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please enable additional paid premium requests or wait for your allowance to renew.",code:n.status};case"business":case"enterprise":return{type:"failed",reason:"You've reached your monthly chat messages quota. Please reach out to your organization's Copilot admin to enable additional paid premium requests or wait for your allowance to renew.",code:n.status};default:return{type:"failed",reason:"You've reached your monthly chat messages quota.",code:n.status}}else if(c.includes("session_quota_exceeded")){let h=yoe(n);return{type:"failed",reason:h!==void 0?`You've used your session quota. Wait until ${new Date(Date.now()+h*1e3).toLocaleString()} for your limit to reset.`:"You've used your session quota.",code:n.status}}else if(c.includes("billing_not_configured"))return{type:"failed",reason:"You have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, you must select a billing entity via the GitHub site, under Settings > Copilot > Billing.",code:n.status};return{type:"failed",reason:"Quota Exceeded.",code:n.status}}return n.status===503?{type:"failed",reason:c,code:n.status}:(Hp.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function r9o(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=n===""&&o===""?r:xa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});QWe(c,v,["messages"]),v.properties.headerRequestId=s,ht(t,"request.sent",v);let b=pl(),T=Rmn(u),w={...Gm(t),...f.toCapiHeaders()};NN()&&(w=await CSe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(k=>"image_url"in k):!1)&&(w["Copilot-Vision-Request"]="true"),h&&(w["api-key"]=h),g&&(w[vQ]=g),A&&(w["copilot-session-token"]=A),o==="v1/messages"&&!E&&(w["anthropic-beta"]=PWe),c.messages&&c.messages.forEach(x=>{n9o(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(k=>Bmn(k)))});let R=zse(()=>Rze(t)?new Dze(t):void 0,void 0);return P7(t,_,l,T,s,c,y,w,void 0,m,R,e).then(x=>{let k=XL(x);v.extendWithRequestId(k);let D=pl()-b;return v.measurements.totalTimeMs=D,Hp.info(t,`Request ${s} at <${_}> finished with ${x.status} status after ${D}ms`),Hp.debug(t,"request.response properties",v.properties),Hp.debug(t,"request.response measurements",v.measurements),Hp.debug(t,"messages:",JSON.stringify(e)),ht(t,"request.response",v),R?new Nze(x,R,s,b):x}).catch(x=>{if(P0(x))throw x;let k=v.extendedBy({error:"Network exception"});ht(t,"request.shownWarning",k),v.properties.message=String(Fh(x,"name")??""),v.properties.code=String(Fh(x,"code")??""),v.properties.errno=String(Fh(x,"errno")??""),v.properties.type=String(Fh(x,"type")??"");let D=pl()-b;throw v.measurements.totalTimeMs=D,Hp.info(t,`Request ${s} at <${_}> rejected with ${String(x)} after ${D}ms`),Hp.debug(t,"request.error properties",v.properties),Hp.debug(t,"request.error measurements",v.measurements),ht(t,"request.error",v),x}).finally(()=>{Kce(t,e,v)})}a(r9o,"fetchWithInstrumentation");function n9o(t){return"tool_calls"in t}a(n9o,"isChatMessageWithToolCalls");function i9o(t){return e9o.has(t)}a(i9o,"shouldRetryStatusCode");async function o9o(t,e,r,n,o=t9o){let s=t.get(ar),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(Hp.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([rx(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await rx(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return Hp.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,Hp.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,Hp.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return Hp.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(o9o,"checkNetworkConnectivity");p();var s9o=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function Bze(t){let e=t.slice();return e.reverse(),CAn(e)||CAn(e.filter(r=>r.trim().length>0))}a(Bze,"isRepetitive");function CAn(t){let e=a9o(t);for(let r of s9o){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(a9o,"kmp_prefix_function");Ns();var rc=class{constructor(e){this.ctx=e;this.fetcher=new Oze}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=gr(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Qt).getToken(),g=!h&&qt(this.ctx,je.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&gmn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=CQ(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=qt(this.ctx,je.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!AQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await vWe(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===Ao.Azure)if(e.modelConfiguration.deploymentUrl)A=J0n(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(Qce(e.modelConfiguration?.providerName))A=Vce[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=LI(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?MWe(this.ctx,f):!1;y=NWe(f,D)}Ye.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=fP.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let L=x;if(await c.onRetry?.(L,N),L.type==="failed"&&L.retryAfter!==void 0&&L.retryAfter>0){let B=L.retryAfter;if(await new Promise(Q=>{let M=setTimeout(()=>{O.dispose(),Q()},B*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),Q()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),gt(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:L.type==="failed"?L.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let k=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,k,y),this.trackTurnCredits(e,x),Wse(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:k})},D=>Ye.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=BTe(r.chatCompletions,u=>this.postProcess(u,o));Ye.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)Ye.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:In(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:In(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>In(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return Bze(e.tokens)?(r.extendWithRequestId(e.requestId),ht(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return Ye.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(P0(e))return{type:"canceled",reason:"network request aborted",requestId:r};{Ye.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof JY?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(Rd).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),gt(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var Uh=class{static{a(this,"ConversationInspector")}};p();p();var Qh=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},K9t=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},J9t=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},Xm=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new K9t(this._resolver(e),this.id,this.stepTitle)}processor(e){return new J9t(this._processor(e),this.id)}};p();p();var $y=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},ile=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new $y(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var vAn=new ge("EncodingConfigurationService"),KM=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),vAn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),vAn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var bAn=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var c9o=globalThis.performance&&typeof globalThis.performance.now=="function",Lze=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=c9o&&e===!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}};var SAn=!1,l9o=!1,rIe;(M=>{M.None=a(()=>R_.None,"None");function e(O){if(l9o){let{onDidAddListener:q}=O,F=tIe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),F.print()),q?.()}}}a(e,"_addLeakageTraceLogic");function r(O,q){return g(O,()=>{},0,void 0,!0,void 0,q)}M.defer=r,a(r,"defer");function n(O){return(q,F=null,U)=>{let W=!1,V;return V=O(G=>{if(!W)return V?V.dispose():W=!0,q.call(F,G)},null,U),W&&V.dispose(),V}}M.once=n,a(n,"once");function o(O,q){return M.once(M.filter(O,q))}M.onceIf=o,a(o,"onceIf");function s(O,q,F){return h((U,W=null,V)=>O(G=>U.call(W,q(G)),null,V),F)}M.map=s,a(s,"map");function c(O,q,F){return h((U,W=null,V)=>O(G=>{q(G),U.call(W,G)},null,V),F)}M.forEach=c,a(c,"forEach");function l(O,q,F){return h((U,W=null,V)=>O(G=>q(G)&&U.call(W,G),null,V),F)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(q,F=null,U)=>{let W=dmn(...O.map(V=>V(G=>q.call(F,G))));return m(W,U)}}M.any=d,a(d,"any");function f(O,q,F,U){let W=F;return s(O,V=>(W=q(W,V),W),U)}M.reduce=f,a(f,"reduce");function h(O,q){let F,U={onWillAddFirstListener(){F=O(W.fire,W)},onDidRemoveLastListener(){F?.dispose()}};q||e(U);let W=new OS(U);return q?.add(W),W.event}a(h,"snapshot");function m(O,q){return q instanceof Array?q.push(O):q&&q.add(O),O}a(m,"addAndReturnDisposable");function g(O,q,F=100,U=!1,W=!1,V,G){let Y,re,j,X=0,ie,we={leakWarningThreshold:V,onWillAddFirstListener(){Y=O(De=>{X++,re=q(re,De),U&&!j&&(Ae.fire(re),re=void 0),ie=a(()=>{let Te=re;re=void 0,j=void 0,(!U||X>1)&&Ae.fire(Te),X=0},"doFire"),typeof F=="number"?(clearTimeout(j),j=setTimeout(ie,F)):j===void 0&&(j=0,queueMicrotask(ie))})},onWillRemoveListener(){W&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,Y.dispose()}};G||e(we);let Ae=new OS(we);return G?.add(Ae),Ae.event}M.debounce=g,a(g,"debounce");function A(O,q=0,F){return M.debounce(O,(U,W)=>U?(U.push(W),U):[W],q,void 0,!0,void 0,F)}M.accumulate=A,a(A,"accumulate");function y(O,q=(U,W)=>U===W,F){let U=!0,W;return l(O,V=>{let G=U||!q(V,W);return U=!1,W=V,G},F)}M.latch=y,a(y,"latch");function E(O,q,F){return[M.filter(O,q,F),M.filter(O,U=>!q(U),F)]}M.split=E,a(E,"split");function _(O,q=!1,F=[],U){let W=F.slice(),V=O(re=>{W?W.push(re):Y.fire(re)});U&&U.add(V);let G=a(()=>{W?.forEach(re=>Y.fire(re)),W=null},"flush"),Y=new OS({onWillAddFirstListener(){V||(V=O(re=>Y.fire(re)),U&&U.add(V))},onDidAddFirstListener(){W&&(q?setTimeout(G):G())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return U&&U.add(Y),Y.event}M.buffer=_,a(_,"buffer");function v(O,q){return a((U,W,V)=>{let G=q(new T);return O(function(Y){let re=G.evaluate(Y);re!==b&&U.call(W,re)},void 0,V)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(F=>(q(F),F)),this}filter(q){return this.steps.push(F=>q(F)?F:b),this}reduce(q,F){let U=F;return this.steps.push(W=>(U=q(U,W),U)),this}latch(q=(F,U)=>F===U){let F=!0,U;return this.steps.push(W=>{let V=F||!q(W,U);return F=!1,U=W,V?W:b}),this}evaluate(q){for(let F of this.steps)if(q=F(q),q===b)break;return q}}function w(O,q,F=U=>U){let U=a((...Y)=>G.fire(F(...Y)),"fn"),W=a(()=>O.on(q,U),"onFirstListenerAdd"),V=a(()=>O.removeListener(q,U),"onLastListenerRemove"),G=new OS({onWillAddFirstListener:W,onDidRemoveLastListener:V});return G.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,q,F=U=>U){let U=a((...Y)=>G.fire(F(...Y)),"fn"),W=a(()=>O.addEventListener(q,U),"onFirstListenerAdd"),V=a(()=>O.removeEventListener(q,U),"onLastListenerRemove"),G=new OS({onWillAddFirstListener:W,onDidRemoveLastListener:V});return G.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,q){return new Promise(F=>n(O)(F,null,q))}M.toPromise=x,a(x,"toPromise");function k(O){let q=new OS;return O.then(F=>{q.fire(F)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}M.fromPromise=k,a(k,"fromPromise");function D(O,q){return O(F=>q.fire(F))}M.forward=D,a(D,"forward");function N(O,q,F){return q(F),O(U=>q(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class L{constructor(q,F){this._observable=q;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{q.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{q.removeObserver(this)},"onDidRemoveLastListener")};F||e(U),this.emitter=new OS(U),F&&F.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,F){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function B(O,q){return new L(O,q).emitter.event}M.fromObservable=B,a(B,"fromObservable");function Q(O){return(q,F,U)=>{let W=0,V=!1,G={beginUpdate(){W++},endUpdate(){W--,W===0&&(O.reportChanges(),V&&(V=!1,q.call(F)))},handlePossibleChange(){},handleChange(){V=!0}};O.addObserver(G),O.reportChanges();let Y={dispose(){O.removeObserver(G)}};return U instanceof yQ?U.add(Y):Array.isArray(U)&&U.push(Y),Y}}M.fromObservableLight=Q,a(Q,"fromObservableLight")})(rIe||={});var Z9t=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new Lze,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},TAn=-1;var X9t=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||rthis.fileOps.appendFile(e,r,"utf8"));return this.appendQueues.set(e,o.catch(()=>{})),o}};p();var TYe=require("fs"),zM=fe(require("path"));var SEn=require("stream");var Rqo={mkdir:a((t,e)=>TYe.promises.mkdir(t,e),"mkdir"),writeFile:a((t,e,r)=>TYe.promises.writeFile(t,e,r),"writeFile"),appendFile:a((t,e,r)=>TYe.promises.appendFile(t,e,r),"appendFile")},SYe,IYe=class t{constructor(e,r){this.ctx=e;this.fileOps=r??Rqo,this.basePath=this.getBasePath(),this.isEnabled=!!this.basePath}static{a(this,"DebugRequestLogger")}static{this.sequence=0}static{this.requestSeqMap=new Map}static{this.requestInteractionMap=new Map}static{this.appendChainMap=new Map}static resetForTesting(){SYe=void 0,bEn(),t.sequence=0,t.requestSeqMap.clear(),t.requestInteractionMap.clear(),t.appendChainMap.clear()}getBasePath(){return Ht(this.ctx,Je.PromptPersistBasePath)?.trim()||void 0}ensureDir(){return SYe||(SYe=this.initHttpLogDir()),SYe}toPersistenceFileOps(){return{mkdir:a((e,r)=>this.fileOps.mkdir(e,r),"mkdir"),writeFile:a((e,r,n)=>this.fileOps.writeFile(e,r,n),"writeFile"),appendFile:a((e,r,n)=>this.fileOps.appendFile(e,r,n),"appendFile")}}async initHttpLogDir(){let e=await sQt(this.basePath,this.toPersistenceFileOps()),r=zM.join(e,"http-log");return await this.fileOps.mkdir(r,{recursive:!0}),r}seqForRequest(e){let r=t.requestSeqMap.get(e);if(r!==void 0)return r;let n=++t.sequence;return t.requestSeqMap.set(e,n),n}logRequest(e){this.isEnabled&&this.writeRequestFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced request log",r)})}logResponse(e){this.isEnabled&&this.writeResponseFile(e).catch(r=>{ot.debug(this.ctx,"Failed to persist enhanced response log",r)})}static{this.SENSITIVE_HEADERS=new Set(["authorization","cookie","set-cookie","request-hmac","proxy-authorization"].map(e=>e.toLowerCase()))}static redactHeaders(e){let r={};for(let[n,o]of Object.entries(e))r[n]=t.SENSITIVE_HEADERS.has(n.toLowerCase())?"[REDACTED]":o;return r}async resolveTurnHttpLogDir(e){if(!e)return;let r=aQt(e);if(!r)return;let n=zM.join(r,"http-log");return await this.fileOps.mkdir(n,{recursive:!0}),n}static extractInteractionId(e){return Object.entries(e).find(([r])=>r.toLowerCase()==="x-interaction-id")?.[1]}async writeMessagesDump(e,r,n,o){if(!o||o.length===0)return;let s=`${r}_request_messages_dump_${n}.json`;await this.fileOps.writeFile(zM.join(e,s),JSON.stringify(o,null,2),"utf8")}appendResponseChunk(e,r){if(!this.isEnabled)return;let o=(t.appendChainMap.get(e)??Promise.resolve()).then(()=>this.doAppendChunk(e,r)).catch(s=>{ot.debug(this.ctx,"Failed to append SSE chunk",s)});t.appendChainMap.set(e,o)}async doAppendChunk(e,r){let n=await this.ensureDir(),o=this.seqForRequest(e),s=String(o).padStart(6,"0"),c=e.replace(/[^a-zA-Z0-9_-]/g,"_"),l=`${s}_response_sse_chunks_${c}.txt`;await this.fileOps.appendFile(zM.join(n,l),r,"utf8");let u=t.requestInteractionMap.get(e),d=await this.resolveTurnHttpLogDir(u);d&&await this.fileOps.appendFile(zM.join(d,l),r,"utf8")}async writeRequestFile(e){let r=await this.ensureDir(),n=this.seqForRequest(e.requestId),o=String(n).padStart(6,"0"),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${o}_request_${s}.json`,{messages:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(zM.join(r,c),f,"utf8"),await this.writeMessagesDump(r,o,s,l);let h=t.extractInteractionId(e.headers);h&&t.requestInteractionMap.set(e.requestId,h);let m=await this.resolveTurnHttpLogDir(h);m&&(await this.fileOps.writeFile(zM.join(m,c),f,"utf8"),await this.writeMessagesDump(m,o,s,l))}async writeResponseFile(e){let r=t.appendChainMap.get(e.requestId);r&&(await r,t.appendChainMap.delete(e.requestId));let n=await this.ensureDir(),o=this.seqForRequest(e.requestId),s=e.requestId.replace(/[^a-zA-Z0-9_-]/g,"_"),c=`${String(o).padStart(6,"0")}_response_headers_${s}.json`,{body:l,...u}=e,d={...u,headers:t.redactHeaders(e.headers)},f=JSON.stringify(d,null,2);await this.fileOps.writeFile(zM.join(n,c),f,"utf8");let h=t.requestInteractionMap.get(e.requestId),m=await this.resolveTurnHttpLogDir(h);m&&await this.fileOps.writeFile(zM.join(m,c),f,"utf8"),t.requestSeqMap.delete(e.requestId),t.requestInteractionMap.delete(e.requestId)}},xYe=class extends DI{static{a(this,"DebugLoggingResponseWrapper")}constructor(e,r,n,o){super(e.status,e.statusText,e.headers,()=>e.text(),()=>e.body()),this.logger=r,this.requestId=n,this.startTime=o}async text(){let e=await super.text();return this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),e}body(){let e=super.body();return e?this.createLoggingStream(e):null}createLoggingStream(e){let r=new SEn.PassThrough;return e.on("data",n=>{this.logger.appendResponseChunk(this.requestId,n.toString()),r.write(n)}),e.on("end",()=>{this.logger.logResponse({timestamp:new Date().toISOString(),requestId:this.requestId,status:this.status,statusText:this.statusText,headers:this.headersToObject(),duration:Math.round(performance.now()-this.startTime)}),r.end()}),e.on("error",n=>{r.emit("error",n)}),r}headersToObject(){let e={};for(let[r,n]of this.headers)e[r]=n;return e}};p();p();var tK=class t extends w_{constructor(r){super();this._autoModelCache=new Map;this._ongoingFetches=new Map;this._ctx=r,this._logger=new Ae("AutoModelService"),this._register(ys(this._ctx,()=>{this._autoModelCache.clear(),this._reserveToken=void 0,this._ongoingFetches.clear(),this._logger.info(this._ctx,"Auto model cache cleared due to token update")}))}static{a(this,"AutoModelService")}static{this.EXPIRY_THRESHOLD_MS=300*1e3}async resolveModelConfiguration(r,n){let o=this._autoModelCache.get(r);o||(o={},this._autoModelCache.set(r,o)),this._pruneExpiredTokens(o),!o.active&&o.standby&&(o.active=o.standby,o.standby=void 0),o.active||(o.active=await this._acquireActiveToken(r)),(!o.standby||!this._isTokenValid(o.standby)||this._isExpiringSoon(o.standby)||this._isExpiringSoon(o.active))&&this._refreshStandbyInBackground(r),this._ensureReserveRefill();let s=await this._ctx.get(Fa).getMetadata(),c=await this._ctx.get(Yc).getBestChatModelConfig([o.active.model]);c.copilotSessionToken=o.active.sessionToken,c.autoModeDiscountedCost=o.active.discountedCost;let l=s.find(u=>u.capabilities.family===o.active.model);return c.originalBillingMultiplier=l?.billing?.multiplier??0,c}_ensureReserveRefill(){if(this._isTokenValid(this._reserveToken))return;let r="reserve";if(this._ongoingFetches.has(r))return;let n=this._fetchToken("reserve");this._ongoingFetches.set(r,n),n.then(o=>{this._reserveToken=o}).catch(o=>{this._logger.error(this._ctx,`Failed to refresh reserve auto mode token: ${o instanceof Error?o.message:String(o)}`)}).finally(()=>{this._ongoingFetches.delete(r)})}async _acquireActiveToken(r){if(this._isTokenValid(this._reserveToken)){let c=this._reserveToken;return this._reserveToken=void 0,c}let n=`active:${r}`,o=this._ongoingFetches.get(n);if(o)return o;let s=this._fetchToken("active").finally(()=>{this._ongoingFetches.delete(n)});return this._ongoingFetches.set(n,s),s}_refreshStandbyInBackground(r){let n=`standby:${r}`;if(this._ongoingFetches.has(n))return;let o=this._fetchToken("standby");this._ongoingFetches.set(n,o),o.then(s=>{let c=this._autoModelCache.get(r);c&&(c.active&&c.active.sessionToken===s.sessionToken||(c.standby=s,this._ongoingFetches.delete(n)))}).catch(s=>{this._logger.error(this._ctx,`Failed to refresh standby auto mode token for ${r}: ${s instanceof Error?s.message:String(s)}`),this._ongoingFetches.delete(n)})}async _fetchToken(r){let n=Date.now();try{let o=await BHe(this._ctx,"/models/session",JSON.stringify({auto_mode:{model_hints:["auto"]}}));if(!o.ok)throw new Error(`Auto mode API returned status ${o.status}`);let s=await o.json(),c=s.selected_model,l=s.session_token,u=s.expires_at*1e3,d=s.discounted_costs?.[c];return this._logger.info(this._ctx,`Fetched auto model for ${r} in ${Date.now()-n}ms: ${c}`),{model:c,sessionToken:l,expiration:u,discountedCost:d}}catch(o){throw this._logger.error(this._ctx,`Failed to fetch auto mode model for ${r}: ${o instanceof Error?o.message:String(o)}`),o}}_pruneExpiredTokens(r){r.active&&!this._isTokenValid(r.active)&&(r.active=void 0),r.standby&&!this._isTokenValid(r.standby)&&(r.standby=void 0)}_isTokenValid(r){return!!r&&r.expiration>Date.now()}_isExpiringSoon(r){return r?r.expiration-Date.now()<=t.EXPIRY_THRESHOLD_MS:!1}};var wYe="Auto",P_="auto",TEn="custom",Ro=class t{static{a(this,"ModelPickerUtils")}static async formatModelDisplayName(e,r,n){if(!r)return;let o=n?.trim();if(o){try{let u=(await new Cc(e.get(yi)).getStoredModelConfigs(o))?.[r]?.modelCapabilities?.name?.trim();if(u)return`${u} (${o})`}catch{}return`${r} (${o})`}try{let l=(await e.get(Fa).getMetadata()).find(u=>u.id===r);if(l)return`${l.name}`}catch{}return`${r}`}static async getModelConfiguration(e,r,n){let o=await e.get(Ut).getToken(),s=!!o.userInfo?.isTBBEnabled,c=!!o.userInfo?.isFreeUser,l=e.get(uu);if(!s&&l.quotaExhausted&&!c){let u=await e.get(Fa).getFallbackModel();if(u?.id)return e.get(Yc).getBestChatModelConfig([u.id])}if(r)return e.get(Yc).getBestChatModelConfig(aS(r,s),n);throw new Error("Model is not specified")}static async getModelConfigurationById(e,r,n,o){if(!r)throw new Error("Model is not specified");if(r===P_)return await e.get(tK).resolveModelConfiguration(n??"unknown",o);let s=await e.get(Yc).getModelConfigurationById(r);if(!s)throw new Error(`No model configuration found for id '${r}'`);return s}static setUserSelectedReasoningEffort(e,r,n){if(!n)return r;let o=r.reasoningEfforts;return o&&o.length>0&&!o.includes(n)?(ot.warn(e,`User-selected reasoning effort '${n}' for model '${r.modelId}' is not in supported list [${o.join(", ")}].`),r):(r.userSelectedReasoningEffort=n,r)}static overrideMaxRequestTokens(e,r){return typeof r!="number"||!Number.isFinite(r)||r<=0||(e.maxRequestTokens=e.maxLongContextTokens===void 0?Math.min(e.maxRequestTokens,r):Math.min(e.maxLongContextTokens,r)),e}static applyModelConfigurationOverrides(e,r,n){return t.setUserSelectedReasoningEffort(e,r,n?.reasoningEffort),t.overrideMaxRequestTokens(r,n?.contextSize),r}static async resolveModelIdFromFamily(e,r){return r===P_?P_:(await e.get(Fa).getMetadata()).find(o=>o.capabilities.family===r&&o.capabilities.type==="chat"&&o.model_picker_enabled===!0)?.id}static transformMessages(e,r){return r===Tn.O1Ga||r===Tn.O1Mini?e.map(n=>n.role!=="user"?{role:"user",content:n.content}:n):e}static parseModelNotSupportedReason(e){if(!e)return{};let r=e.indexOf(":");if(r===-1||r===e.length-1)return{};let n=e.slice(r+1).trim();if(!n)return{};let{modelName:o,provider:s}=cQt(n);return{modelName:o||void 0,modelProviderName:s!==void 0&&s!==""?s:void 0}}};var Vp=new Ae("fetchChat"),Pqo=new Set([500,502,504]),kqo=[1e3,1e4,1e4],RYe=class{static{a(this,"OpenAIChatMLFetcher")}async fetchAndStreamChat(e,r,n,o,s){let c=String(n.properties.headerRequestId??r.ourRequestId);if(s?.isCancellationRequested)return{type:"canceled",reason:"before fetch request"};let l;try{let f=await this.fetchWithParameters(e,r.endpoint,r,n,s);if(f==="not-sent")return{type:"canceled",reason:"before fetch request"};l=f}catch(f){if(D0(f)||!kI(f))throw f;Vp.info(e,`Network error during fetch, checking connectivity before retry [${c}]: ${String(f)}`);let h=await this.retryAfterError(e,r,n,s,c);if(h&&"canceled"in h)return h.canceled;if(h&&"response"in h)l=h.response;else throw f}if(s?.isCancellationRequested)return this.destroyResponseBody(e,l),{type:"canceled",reason:"after fetch request"};if(Mqo(l.status)){Vp.info(e,`Server returned ${l.status}, checking network connectivity before retry [${c}]`);let f=await this.retryAfterError(e,r,n,s,c);if(f&&"canceled"in f)return this.destroyResponseBody(e,l),f.canceled;f&&"response"in f&&(this.destroyResponseBody(e,l),l=f.response)}if(l.status!==200){let f=this.createTelemetryData(r.endpoint,e,r),h=await Ro.formatModelDisplayName(e,r.model,r.modelProviderName),m=await this.handleError(e,f,l,h,r.uiKind);return m.type==="failed"?{...m,ghRequestId:l.headers.get("x-github-request-id")||void 0}:m}e.get(uu).processQuotaHeaders(l.headers),e.get($M).processRateLimitHeaders(l.headers);let u=Ek.getStrategy(r.endpoint),d={messages:r.messages,tools:r.tools,tool_choice:r.tool_choice,temperature:r.postOptions?.temperature,topP:r.postOptions?.top_p,modelConfiguration:{modelId:r.model,maxResponseTokens:r.postOptions?.max_tokens,stream:!!r.postOptions?.stream},repoInfo:r.repoInfo,count:r.count,postOptions:r.postOptions,intentParams:{intent:r.intent,intent_threshold:r.intent_threshold,intent_model:r.intent_model,intent_tokenizer:r.intent_tokenizer,intent_content:r.intent_content},copilot_thread_id:r.copilot_thread_id,prediction:r.prediction,cancel:s,enableThinking:r.enableThinking};return u.processResponse(e,l,o,n,d)}destroyResponseBody(e,r){try{let n=r.body();n&&"destroy"in n&&typeof n.destroy=="function"?n.destroy():n instanceof ReadableStream&&n.cancel()}catch(n){Vp.exception(e,n,"Error destroying response stream")}}async retryAfterError(e,r,n,o,s){if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled before connectivity check"}};let c=await Oqo(e,r.copilotApiBaseUrl,r.authToken,o);if(o?.isCancellationRequested)return{canceled:{type:"canceled",reason:"canceled during connectivity check"}};if(!c.retryRequest){Vp.info(e,`Not retrying chat request as network connectivity could not be re-established [${s}]`);return}Vp.info(e,`Connectivity check passed, retrying request [${s}]`);let l=await this.fetchWithParameters(e,r.endpoint,r,n,o);return l==="not-sent"?{canceled:{type:"canceled",reason:"before retry fetch request"}}:o?.isCancellationRequested?(this.destroyResponseBody(e,l),{canceled:{type:"canceled",reason:"after retry fetch request"}}):{response:l}}createTelemetryData(e,r,n){return Vt.createAndMarkAsIssued({endpoint:e,engineName:n.engineName,uiKind:n.uiKind,headerRequestId:n.ourRequestId})}async fetchWithParameters(e,r,n,o,s){let c=Ek.getStrategy(r),l={messages:n.messages,tools:n.tools,tool_choice:n.tool_choice,temperature:n.postOptions?.temperature,topP:n.postOptions?.top_p,modelConfiguration:{modelId:n.model,providerName:n.modelProviderName,maxResponseTokens:n.postOptions?.max_tokens,stream:n.postOptions?.stream!==!1,supportsThinking:n.supportsThinking,reasoningEfforts:n.reasoningEfforts,userSelectedReasoningEffort:n.userSelectedReasoningEffort},repoInfo:n.repoInfo,count:n.count,postOptions:n.postOptions,intentParams:{intent:n.intent,intent_threshold:n.intent_threshold,intent_model:n.intent_model,intent_tokenizer:n.intent_tokenizer,intent_content:n.intent_content},copilot_thread_id:n.copilot_thread_id,prediction:n.prediction,cancel:s,enableThinking:n.enableThinking},u=c.buildRequestBody(e,l);return Fyn(u,l.modelConfiguration),s?.isCancellationRequested?"not-sent":await Dqo(e,n.messages,n.copilotApiBaseUrl,n.engineName,r,n.ourRequestId,u,n.authToken,n.uiKind,o,n.llmInteraction,n.apiKey,n.modelProviderName,n.copilotEditsSessionHeader,n.copilotSessionToken,s,n.supportsAdaptiveThinking)}async handleError(e,r,n,o,s){if(n.clientError&&!n.headers.get("x-github-request-id")){let f=`Last response was a ${n.status} error and does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall`;Vp.error(e,f),r.properties.error=`Response status was ${n.status} with no x-github-request-id header`}else r.properties.error=`Response status was ${n.status}`;if(r.properties.status=String(n.status),yt(e,"request.shownWarning",r),n.status===401)try{let f=await n.text(),h=JSON.parse(f);if(h.authorize_url)return{type:"authRequired",reason:"not authorized",authUrl:h.authorize_url}}catch{}if(n.status===401||n.status===403)return e.get(Ut).resetToken("chat_messages",n.status),{type:"failed",reason:`token expired or invalid: ${n.status}`,code:n.status};if(n.status===499)return Vp.info(e,"Cancelled by server"),{type:"failed",reason:"canceled by server",code:n.status};let c=await n.text();if(n.status===429){let f=$9(n),h;try{let m=JSON.parse(c);h=m?.error?.code??m?.code}catch{}return _t(e,"request.throttled",{requestSource:s??"unknown"},{retryAfter:f??-1}),{type:"failed",reason:"rate limit exceeded",code:n.status,retryAfter:f,capiErrorCode:h}}if(n.status===466)return Vp.info(e,c),{type:"failed",reason:`client not supported: ${c}`,code:n.status};if(n.status===400){let f=R_.translate400Reason(c,o);if(f!==void 0)return{type:"failed",reason:f,code:n.status}}if(n.status===424)return{type:"failedDependency",reason:c};let u=n.headers.get("retry-after"),d=await e.get(Ut).getToken();return n.status===402?{type:"failed",reason:R_.translate402Reason(c,{retryAfterHeader:u??void 0,retryAfterSeconds:$9(n),copilotPlan:d.userInfo?.copilotPlan,isTBBEnabled:d.userInfo?.isTBBEnabled,canUpgradePlan:d.userInfo?.canUpgradePlan,overageEnabled:e.get(uu).overageEnabled}),code:n.status}:n.status===503?{type:"failed",reason:c,code:n.status}:(Vp.error(e,"Unhandled status from server:",n.status,c),{type:"failed",reason:`unhandled status from server: ${n.status} ${c}`,code:n.status})}};async function Dqo(t,e,r,n,o,s,c,l,u,d,f,h,m,g,A,y,E){let _=n===""&&o===""?r:Sa(r,n,o),v=d.extendedBy({endpoint:o,engineName:n,uiKind:u});uYe(c,v,["messages"]),v.properties.headerRequestId=s,yt(t,"request.sent",v);let b=dl(),T=Kyn(u),w={...lA(t),...f.toCapiHeaders()};OB()&&(w=await DHe(t,w)),c.messages?.some(x=>Array.isArray(x.content)?x.content.some(P=>"image_url"in P):!1)&&(w["Copilot-Vision-Request"]="true"),h&&(w["api-key"]=h),g&&(w[LQ]=g),A&&(w["copilot-session-token"]=A),o==="v1/messages"&&!E&&(w["anthropic-beta"]=tYe),c.messages&&c.messages.forEach(x=>{Nqo(x)&&x.tool_calls&&(x.tool_calls=x.tool_calls.map(P=>nEn(P)))});let R=Use(()=>bYe(t)?new IYe(t):void 0,void 0);return KV(t,_,l,T,s,c,y,w,void 0,m,R,e).then(x=>{let P=c3(x);v.extendWithRequestId(P);let D=dl()-b;return v.measurements.totalTimeMs=D,Vp.info(t,`Request ${s} at <${_}> finished with ${x.status} status after ${D}ms`),Vp.debug(t,"request.response properties",v.properties),Vp.debug(t,"request.response measurements",v.measurements),Vp.debug(t,"messages:",JSON.stringify(e)),yt(t,"request.response",v),R?new xYe(x,R,s,b):x}).catch(x=>{if(D0(x))throw x;let P=v.extendedBy({error:"Network exception"});yt(t,"request.shownWarning",P),v.properties.message=String(qh(x,"name")??""),v.properties.code=String(qh(x,"code")??""),v.properties.errno=String(qh(x,"errno")??""),v.properties.type=String(qh(x,"type")??"");let D=dl()-b;throw v.measurements.totalTimeMs=D,Vp.info(t,`Request ${s} at <${_}> rejected with ${String(x)} after ${D}ms`),Vp.debug(t,"request.error properties",v.properties),Vp.debug(t,"request.error measurements",v.measurements),yt(t,"request.error",v),x}).finally(()=>{lle(t,e,v)})}a(Dqo,"fetchWithInstrumentation");function Nqo(t){return"tool_calls"in t}a(Nqo,"isChatMessageWithToolCalls");function Mqo(t){return Pqo.has(t)}a(Mqo,"shouldRetryStatusCode");async function Oqo(t,e,r,n,o=kqo){let s=t.get(cr),c=new URL("_ping",e).href,l,u;for(let d of o){if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};if(Vp.info(t,`Waiting ${d}ms before pinging CAPI to check network connectivity...`),n){let f;try{await Promise.race([XI(d),new Promise(h=>{if(n.isCancellationRequested){h();return}f=n.onCancellationRequested(()=>{h()})})])}finally{f?.dispose()}}else await XI(d);if(n?.isCancellationRequested)return{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};try{let f=await s.fetch(c,{method:"GET",headers:{Authorization:`Bearer ${r}`}});if(f.status>=200&&f.status<300)return Vp.info(t,"CAPI ping successful, proceeding with chat request retry..."),{retryRequest:!0,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u};l=`Status ${f.status}: ${f.statusText??""}`,u=f.headers.get("x-github-request-id")??void 0,Vp.info(t,`CAPI ping returned status ${f.status}, retrying ping...`)}catch(f){l=String(f),u=void 0,Vp.info(t,`CAPI ping failed with error, retrying ping: ${l}`)}}return Vp.info(t,`Network connectivity could not be re-established after ${o.length} attempts`),{retryRequest:!1,connectivityTestError:l,connectivityTestErrorGitHubRequestId:u}}a(Oqo,"checkNetworkConnectivity");p();var Bqo=[{max_token_sequence_length:1,last_tokens_to_consider:10},{max_token_sequence_length:10,last_tokens_to_consider:30},{max_token_sequence_length:20,last_tokens_to_consider:45},{max_token_sequence_length:30,last_tokens_to_consider:60}];function PYe(t){let e=t.slice();return e.reverse(),IEn(e)||IEn(e.filter(r=>r.trim().length>0))}a(PYe,"isRepetitive");function IEn(t){let e=Lqo(t);for(let r of Bqo){if(t.length=0&&t[r+1]!==t[n];)r=e[r];t[r+1]===t[n]&&r++,e[n]=r}return e}a(Lqo,"kmp_prefix_function");As();var rc=class{constructor(e){this.ctx=e;this.fetcher=new RYe}static{a(this,"ChatMLFetcher")}async fetchResponse(e,r,n,o,s,c){let l=performance.now(),u=ir(),d={n:e.num_suggestions??1,temperature:e.temperature??0,stop:e.stop,top_p:e.topP??1,copilot_thread_id:e.copilot_thread_id,prediction:e.prediction},f=e.modelConfiguration;f&&(e.prediction?.content||delete d.prediction,e.prediction||e.modelConfiguration?.providerName===void 0&&f.maxResponseTokens!==void 0&&(d.max_tokens=f.maxResponseTokens),d.stream=!!f.stream),e.logitBias&&(d.logit_bias=e.logitBias);let h=e.chatModeKind==="Ask",m=await this.ctx.get(Ut).getToken(),g=!h&&Ht(this.ctx,Je.EnableThinking);if(g&&e.modelConfiguration?.providerName===void 0&&Lyn(e.modelConfiguration?.modelId)&&e.uiKind==="agentPanel")if(e.endpoint==="v1/messages"&&e.modelConfiguration?.supportsAdaptiveThinking){d.adaptive_thinking=!0;let D=BQ(e.modelConfiguration?.reasoningEfforts,e.modelConfiguration?.userSelectedReasoningEffort)??"medium";D!=="none"&&(d.thinking_effort=D)}else{let D=Ht(this.ctx,Je.AnthropicThinkingBudgetToken);if(D&&D>0){let N=D<1024?1024:D;d.thinking_budget=Math.min(32e3,e.modelConfiguration.maxResponseTokens-1,N)}}let A,y,E,_;if(e.modelConfiguration?.providerName){if(!NQ(m))throw new Error("Bring Your Own Key (BYOK) is not available for your account.");if(E=await Vze(this.ctx,e.modelConfiguration?.providerName,e.modelConfiguration.modelId),_=e.modelConfiguration.providerName,e.intentParams=void 0,e.modelConfiguration?.providerName===go.Azure)if(e.modelConfiguration.deploymentUrl)A=Ayn(e.modelConfiguration.modelId,e.modelConfiguration.deploymentUrl),y="",e.engineName="";else throw new Error(`No deployment URL found for Azure model: ${e.modelConfiguration.modelId}`);else if(Xce(e.modelConfiguration?.providerName))A=ole[e.modelConfiguration?.providerName],y=e.endpoint??"completions",e.authToken=E;else throw new Error(`Unsupported BYOK provider: ${e.modelConfiguration?.providerName}`)}else{if(A=NI(this.ctx,m,e.copilotApiProvider??"api"),e.endpoint)y=e.endpoint;else{let D=f?iYe(this.ctx,f):!1;y=nYe(f,D)}ot.debug(this.ctx,`Endpoint routing: model=${f?.modelId}, supportedEndpoints=${JSON.stringify(f?.supportedEndpoints)}, selected=${y}`)}let v=f?.copilotSessionToken,b=e.authToken??m.token,T=Ek.getStrategy(y),w=e.engineName??T.engineName,R={messages:e.messages,repoInfo:void 0,ourRequestId:u,copilotApiBaseUrl:A,engineName:w,endpoint:y,count:e.num_suggestions??1,uiKind:e.uiKind,postOptions:d,authToken:b,apiKey:E,modelProviderName:_,...e.intentParams,llmInteraction:e.llmInteraction,prediction:e.prediction,copilotEditsSessionHeader:e.copilotEditsSessionHeader,copilotSessionToken:v,supportsThinking:f?.supportsThinking,supportsAdaptiveThinking:f?.supportsAdaptiveThinking,reasoningEfforts:f?.reasoningEfforts,userSelectedReasoningEffort:f?.userSelectedReasoningEffort,enableThinking:g};f&&(R.model=f.modelId),e.tools&&e.tools?.length>0&&(f===void 0||f.toolCalls)&&(R.tools=e.tools,R.tool_choice=e.tool_choice??"auto");let x=await this.fetch(R,o,r,n);if(c){let D=c.maxRetryAttempts??3;for(let N=1;N<=D&&!(!c.shouldRetry(x)||x.type==="failed"&&x.noRetry);N++){let B=x;if(await c.onRetry?.(B,N),B.type==="failed"&&B.retryAfter!==void 0&&B.retryAfter>0){let L=B.retryAfter;if(await new Promise(j=>{let M=setTimeout(()=>{O.dispose(),j()},L*1e3),O=r.onCancellationRequested(()=>{clearTimeout(M),O.dispose(),j()})}),r.isCancellationRequested)break}x=await this.fetch(R,o,r,n),_t(this.ctx,"request.throttled.retry",{requestSource:e.uiKind??"unknown",resultType:x.type,modelId:f?f.providerName?"custom-byok":f.modelId:"unknown"},{retryAfter:B.type==="failed"?B.retryAfter??-1:-1,resultCode:x.type==="failed"?x.code??-1:-1})}}let P=Math.round(performance.now()-l);return this.sendFetchResponseTelemetry(e,x,n,P,y),this.trackTurnCredits(e,x),Fse(()=>{if(s)return s.persistLLMRequest({requestId:R.ourRequestId,messages:R.messages,tools:R.tools,model:R.model,response:x,durationMs:P})},D=>ot.debug(this.ctx,"persistLLMRequest failed",D)),x}async fetch(e,r,n,o){try{let s=await this.fetcher.fetchAndStreamChat(this.ctx,e,o.extendedBy({uiKind:e.uiKind}),r||(()=>{}),n);switch(s.type){case"success":return await this.processSuccessfulResponse(e,s,e.ourRequestId,o);case"canceled":return this.processCanceledResponse(s,e.ourRequestId);case"failed":case"failedDependency":return this.processFailedResponse(s,e.ourRequestId);case"authRequired":return{type:"agentAuthRequired",reason:"Agent authentication required.",authUrl:s.authUrl,requestId:e.ourRequestId}}}catch(s){return this.processError(s,e.ourRequestId)}}async processSuccessfulResponse(e,r,n,o){let s=[],c=nIe(r.chatCompletions,u=>this.postProcess(u,o));ot.debug(this.ctx,`Process success response for request ${e.ourRequestId} with chatParams: ${JSON.stringify(e,null,2)}`);let l=0;for await(let u of c)ot.debug(this.ctx,`Received choice #${l} for request ${e.ourRequestId}: ${JSON.stringify(u,null,2)}`),s.push(u),l++;if(s.length==1){let u=s[0];switch(u.finishReason){case"stop":return{type:"success",value:Rn(u.message?.content)??"",toolCalls:u.tool_calls,requestId:n,numTokens:u.numTokens,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"tool_calls":return{type:"tool_calls",toolCalls:u.tool_calls,requestId:n,copilotEditsSessionHeader:u.copilotEditsSessionHeader,thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"content_filter":return{type:"filtered",reason:"Response got filtered.",requestId:n,usage:u.usage,copilot_usage:u.copilot_usage};case"length":return{type:"length",reason:"Response too long.",requestId:n,truncatedValue:Rn(u.message?.content)??"",thinking:u.thinking,usage:u.usage,copilot_usage:u.copilot_usage};case"DONE":return{type:"no_finish_reason",reason:"No finish reason received.",requestId:n};default:return{type:"unknown",reason:"Unknown finish reason received.",requestId:n}}}else if(s.length>1){let u=s.filter(d=>d.finishReason=="stop"||d.finishReason=="tool_calls");if(u.length>0)return{type:"successMultiple",value:u.map(d=>Rn(d.message.content)),toolCalls:u.map(d=>d.tool_calls).filter(d=>d),requestId:n,copilotEditsSessionHeader:u[0].copilotEditsSessionHeader,usage:u[0].usage,copilot_usage:u[0].copilot_usage}}return{type:"no_choices",reason:"Response contained no choices.",requestId:n}}postProcess(e,r){return PYe(e.tokens)?(r.extendWithRequestId(e.requestId),yt(this.ctx,"conversation.repetition.detected",r,0),e.finishReason!==""?e:void 0):e.message?e:void 0}processCanceledResponse(e,r){return ot.debug(this.ctx,"Cancelled after awaiting fetchConversation"),{type:"canceled",reason:e.reason,requestId:r}}processFailedResponse(e,r){return e?.reason.includes("filtered as off_topic by intent classifier")?{type:"offTopic",reason:e.reason,requestId:r}:e?.reason.includes("model is not supported")?{type:"model_not_supported",reason:e.reason,requestId:r}:e?.reason.includes("model max prompt tokens exceeded")?{type:"model_max_prompt_tokens_exceeded",reason:e.reason,requestId:r}:{type:"failed",reason:e.reason,requestId:r,code:e.type==="failed"?e.code:void 0,retryAfter:e.type==="failed"?e.retryAfter:void 0,ghRequestId:e.type==="failed"?e.ghRequestId:void 0,capiErrorCode:e.type==="failed"?e.capiErrorCode:void 0}}processError(e,r){if(D0(e))return{type:"canceled",reason:"network request aborted",requestId:r};{ot.exception(this.ctx,e,"Error on conversation request");let n="Error on conversation request. Read more from logs.";if(e instanceof Error){let o=e.message;if(o&&o.trim().length>0){let s=360;o.length<=s?n=`Error on conversation request: ${o}`:n=`Error on conversation request: ${o.substring(0,s)}... Read more from logs.`}}return{type:"failed",reason:n,requestId:r,noRetry:e instanceof eK?!0:void 0}}}trackTurnCredits(e,r){if(!e.turnId)return;let n="copilot_usage"in r?r.copilot_usage:void 0;!n||n.total_nano_aiu<=0||this.ctx.get(uu).setLastCopilotUsage(n.total_nano_aiu,e.turnId)}sendFetchResponseTelemetry(e,r,n,o,s){let c={responseType:r.type},l={duration:o};e.modelConfiguration&&!e.modelConfiguration?.providerName&&(c.modelId=e.modelConfiguration.modelId,c.modelFamily=e.modelConfiguration.modelFamily,c.maxRequestTokens=String(e.modelConfiguration.maxRequestTokens),c.userSelectedReasoningEffort=e.modelConfiguration.userSelectedReasoningEffort??""),"reason"in r&&r.reason&&(c.reason=r.reason.substring(0,360)),"code"in r&&r.code!==void 0&&(c.statusCode=String(r.code)),r.type==="failed"&&r.noRetry&&(c.isMidStreamError="true"),c.uiKind=e.uiKind,s&&(c.route=s),r.usage&&(l.completionTokens=r.usage.completion_tokens,l.promptTokens=r.usage.prompt_tokens,l.totalTokens=r.usage.total_tokens,r.usage.prompt_tokens_details?.cached_tokens!==void 0&&(l.cachedTokens=r.usage.prompt_tokens_details.cached_tokens)),r.copilot_usage&&(l.copilotUsageTotalNanoAiu=r.copilot_usage.total_nano_aiu,r.copilot_usage.token_details?.length&&(c.copilotUsageTokenDetails=JSON.stringify(r.copilot_usage.token_details))),n.properties.conversationId&&(c.conversationId=n.properties.conversationId),n.properties.messageId&&(c.messageId=n.properties.messageId),n.properties.messageSource&&(c.messageSource=n.properties.messageSource),_t(this.ctx,"chatfetcher.response",c,l)}};p();p();p();p();p();p();p();p();var jh=class{static{a(this,"ConversationInspector")}};p();p();var Hh=class{constructor(){this.skills=[]}static{a(this,"ConversationSkillRegistry")}registerSkill(e){if(this.getSkill(e.id))throw new Error(`Skill with id '${e.id}' already registered`);this.skills.push(e)}getSkill(e){return this.skills.find(r=>r.id===e)}getDescriptors(){return[...this.skills]}},lQt=class{constructor(e,r,n){this.delegate=e;this.stepId=r;this.stepTitle=n}static{a(this,"StepReportingSkillResolver")}async resolveSkill(e){await e.steps.start(this.stepId,this.stepTitle);try{let r=await this.delegate.resolveSkill(e);return r||await e.steps.finish(this.stepId),r}catch(r){throw await e.steps.error(this.stepId,r instanceof Error?r.message:`Error resolving ${this.stepTitle}`),r}}},uQt=class{constructor(e,r){this.delegate=e;this.stepId=r}static{a(this,"StepReportingSkillProcessor")}value(){return this.delegate.value()}async processSkill(e,r){try{let n=await this.delegate.processSkill(e,r);return await r.steps.finish(this.stepId),n}catch(n){throw await r.steps.error(this.stepId,n instanceof Error?n.message:`Error processing ${this.stepId}`),n}}},rg=class{constructor(e,r,n,o,s,c="explicit",l=[],u=()=>!0){this.id=e;this._description=r;this.stepTitle=n;this._resolver=o;this._processor=s;this.type=c;this._examples=l;this._isAvailable=u}static{a(this,"SingleStepReportingSkill")}description(){return this._description}examples(){return this._examples}isAvailable(e){return this._isAvailable(e)}resolver(e){return new lQt(this._resolver(e),this.id,this.stepTitle)}processor(e){return new uQt(this._processor(e),this.id)}};p();p();var Y0=class extends Error{constructor(r){super(`No instance of ${r.name} has been registered`);this.ctor=r;this.name=`UnregisteredContextErrorFor${r.name}`}static{a(this,"UnregisteredContextError")}},ple=class{constructor(){this.instances=new Map}static{a(this,"Context")}get(e){let r=this.tryGet(e);if(r)return r;throw new Y0(e)}tryGet(e){let r=this.instances.get(e);if(r)return r}set(e,r){if(this.tryGet(e))throw new Error(`An instance of ${e.name} has already been registered. Use forceSet() if you're sure it's a good idea.`);this.assertIsInstance(e,r),this.instances.set(e,r)}forceSet(e,r){this.assertIsInstance(e,r),this.instances.set(e,r)}assertIsInstance(e,r){if(!(r instanceof e)){let n=JSON.stringify(r);throw new Error(`The instance you're trying to register for ${e.name} is not an instance of it (${n}).`)}}};p();var xEn=new Ae("EncodingConfigurationService"),YM=class{constructor(e){this.ctx=e;this.fileEncodingCache=new Map}static{a(this,"EncodingConfigurationService")}async getEncodingForFile(e){if(this.fileEncodingCache.has(e))return this.fileEncodingCache.get(e);let r=await this.requestEncodingFromClient(e)??"utf8";return this.fileEncodingCache.set(e,r),r}handleConfigurationChange(e){if(e.copilot?.encodingChanges){if(e.copilot.encodingChanges.length>0)for(let r of e.copilot.encodingChanges)this.fileEncodingCache.delete(r),xEn.debug(this.ctx,`Cache invalidated for file: ${r}`)}else this.fileEncodingCache.clear(),xEn.debug(this.ctx,"All encoding cache cleared")}clearCache(){this.fileEncodingCache.clear()}};p();p();p();p();p();var wEn=class t{static{a(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}};p();var Fqo=globalThis.performance&&typeof globalThis.performance.now=="function",kYe=class t{static{a(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=Fqo&&e===!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}};var REn=!1,Uqo=!1,uIe;(M=>{M.None=a(()=>w_.None,"None");function e(O){if(Uqo){let{onDidAddListener:q}=O,Q=lIe.create(),U=0;O.onDidAddListener=()=>{++U===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Q.print()),q?.()}}}a(e,"_addLeakageTraceLogic");function r(O,q){return g(O,()=>{},0,void 0,!0,void 0,q)}M.defer=r,a(r,"defer");function n(O){return(q,Q=null,U)=>{let z=!1,W;return W=O($=>{if(!z)return W?W.dispose():z=!0,q.call(Q,$)},null,U),z&&W.dispose(),W}}M.once=n,a(n,"once");function o(O,q){return M.once(M.filter(O,q))}M.onceIf=o,a(o,"onceIf");function s(O,q,Q){return h((U,z=null,W)=>O($=>U.call(z,q($)),null,W),Q)}M.map=s,a(s,"map");function c(O,q,Q){return h((U,z=null,W)=>O($=>{q($),U.call(z,$)},null,W),Q)}M.forEach=c,a(c,"forEach");function l(O,q,Q){return h((U,z=null,W)=>O($=>q($)&&U.call(z,$),null,W),Q)}M.filter=l,a(l,"filter");function u(O){return O}M.signal=u,a(u,"signal");function d(...O){return(q,Q=null,U)=>{let z=kyn(...O.map(W=>W($=>q.call(Q,$))));return m(z,U)}}M.any=d,a(d,"any");function f(O,q,Q,U){let z=Q;return s(O,W=>(z=q(z,W),z),U)}M.reduce=f,a(f,"reduce");function h(O,q){let Q,U={onWillAddFirstListener(){Q=O(z.fire,z)},onDidRemoveLastListener(){Q?.dispose()}};q||e(U);let z=new PS(U);return q?.add(z),z.event}a(h,"snapshot");function m(O,q){return q instanceof Array?q.push(O):q&&q.add(O),O}a(m,"addAndReturnDisposable");function g(O,q,Q=100,U=!1,z=!1,W,$){let J,ne,H,re=0,ae,Oe={leakWarningThreshold:W,onWillAddFirstListener(){J=O(Fe=>{re++,ne=q(ne,Fe),U&&!H&&(ve.fire(ne),ne=void 0),ae=a(()=>{let Pe=ne;ne=void 0,H=void 0,(!U||re>1)&&ve.fire(Pe),re=0},"doFire"),typeof Q=="number"?(clearTimeout(H),H=setTimeout(ae,Q)):H===void 0&&(H=0,queueMicrotask(ae))})},onWillRemoveListener(){z&&re>0&&ae?.()},onDidRemoveLastListener(){ae=void 0,J.dispose()}};$||e(Oe);let ve=new PS(Oe);return $?.add(ve),ve.event}M.debounce=g,a(g,"debounce");function A(O,q=0,Q){return M.debounce(O,(U,z)=>U?(U.push(z),U):[z],q,void 0,!0,void 0,Q)}M.accumulate=A,a(A,"accumulate");function y(O,q=(U,z)=>U===z,Q){let U=!0,z;return l(O,W=>{let $=U||!q(W,z);return U=!1,z=W,$},Q)}M.latch=y,a(y,"latch");function E(O,q,Q){return[M.filter(O,q,Q),M.filter(O,U=>!q(U),Q)]}M.split=E,a(E,"split");function _(O,q=!1,Q=[],U){let z=Q.slice(),W=O(ne=>{z?z.push(ne):J.fire(ne)});U&&U.add(W);let $=a(()=>{z?.forEach(ne=>J.fire(ne)),z=null},"flush"),J=new PS({onWillAddFirstListener(){W||(W=O(ne=>J.fire(ne)),U&&U.add(W))},onDidAddFirstListener(){z&&(q?setTimeout($):$())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return U&&U.add(J),J.event}M.buffer=_,a(_,"buffer");function v(O,q){return a((U,z,W)=>{let $=q(new T);return O(function(J){let ne=$.evaluate(J);ne!==b&&U.call(z,ne)},void 0,W)},"fn")}M.chain=v,a(v,"chain");let b=Symbol("HaltChainable");class T{constructor(){this.steps=[]}static{a(this,"ChainableSynthesis")}map(q){return this.steps.push(q),this}forEach(q){return this.steps.push(Q=>(q(Q),Q)),this}filter(q){return this.steps.push(Q=>q(Q)?Q:b),this}reduce(q,Q){let U=Q;return this.steps.push(z=>(U=q(U,z),U)),this}latch(q=(Q,U)=>Q===U){let Q=!0,U;return this.steps.push(z=>{let W=Q||!q(z,U);return Q=!1,U=z,W?z:b}),this}evaluate(q){for(let Q of this.steps)if(q=Q(q),q===b)break;return q}}function w(O,q,Q=U=>U){let U=a((...J)=>$.fire(Q(...J)),"fn"),z=a(()=>O.on(q,U),"onFirstListenerAdd"),W=a(()=>O.removeListener(q,U),"onLastListenerRemove"),$=new PS({onWillAddFirstListener:z,onDidRemoveLastListener:W});return $.event}M.fromNodeEventEmitter=w,a(w,"fromNodeEventEmitter");function R(O,q,Q=U=>U){let U=a((...J)=>$.fire(Q(...J)),"fn"),z=a(()=>O.addEventListener(q,U),"onFirstListenerAdd"),W=a(()=>O.removeEventListener(q,U),"onLastListenerRemove"),$=new PS({onWillAddFirstListener:z,onDidRemoveLastListener:W});return $.event}M.fromDOMEventEmitter=R,a(R,"fromDOMEventEmitter");function x(O,q){return new Promise(Q=>n(O)(Q,null,q))}M.toPromise=x,a(x,"toPromise");function P(O){let q=new PS;return O.then(Q=>{q.fire(Q)},()=>{q.fire(void 0)}).finally(()=>{q.dispose()}),q.event}M.fromPromise=P,a(P,"fromPromise");function D(O,q){return O(Q=>q.fire(Q))}M.forward=D,a(D,"forward");function N(O,q,Q){return q(Q),O(U=>q(U))}M.runAndSubscribe=N,a(N,"runAndSubscribe");class B{constructor(q,Q){this._observable=q;this._counter=0;this._hasChanged=!1;let U={onWillAddFirstListener:a(()=>{q.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:a(()=>{q.removeObserver(this)},"onDidRemoveLastListener")};Q||e(U),this.emitter=new PS(U),Q&&Q.add(this.emitter)}static{a(this,"EmitterObserver")}beginUpdate(q){this._counter++}handlePossibleChange(q){}handleChange(q,Q){this._hasChanged=!0}endUpdate(q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function L(O,q){return new B(O,q).emitter.event}M.fromObservable=L,a(L,"fromObservable");function j(O){return(q,Q,U)=>{let z=0,W=!1,$={beginUpdate(){z++},endUpdate(){z--,z===0&&(O.reportChanges(),W&&(W=!1,q.call(Q)))},handlePossibleChange(){},handleChange(){W=!0}};O.addObserver($),O.reportChanges();let J={dispose(){O.removeObserver($)}};return U instanceof MQ?U.add(J):Array.isArray(U)&&U.push(J),J}}M.fromObservableLight=j,a(j,"fromObservableLight")})(uIe||={});var dQt=class t{constructor(e){this.listenerCount=0;this.invocationCount=0;this.elapsedOverall=0;this.durations=[];this.name=`${e}_${t._idPool++}`,t.all.add(this)}static{a(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}start(e){this._stopWatch=new kYe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},PEn=-1;var fQt=class t{constructor(e,r,n=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e;this.threshold=r;this.name=n;this._warnCountdown=0}static{a(this,"LeakageMonitor")}static{this._idPool=1}dispose(){this._stacks?.clear()}check(e,r){let n=this.threshold;if(n<=0||r{let s=this._stacks.get(e.value)||0;this._stacks.set(e.value,s-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,r=0;for(let[n,o]of this._stacks)(!e||r{if(t instanceof ole)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new X9t(e?.onListenerError??qce,this._options?.leakWarningThreshold??TAn):void 0,this._perfMon=this._options?._profName?new Z9t(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(SAn){let e=this._listeners;queueMicrotask(()=>{f9o(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new tUt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||qce)(f),R_.None}if(this._disposed)return R_.None;r&&(e=e.bind(r));let o=new ole(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=tIe.create(),s=this._leakageMon.check(o.stack,this._size+1)),SAn&&(o.stack=c??tIe.create()),this._listeners?this._listeners instanceof ole?(this._deliveryQueue??=new rUt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=RWe(()=>{s?.(),this._removeListener(o)});return n instanceof yQ?n.add(l):Array.isArray(n)&&n.push(l),l},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 r=this._listeners,n=r.indexOf(e);if(n===-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--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*d9o<=r.length){let s=0;for(let c=0;c0}};var rUt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var IAn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),p9o;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof nUt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:rIe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:IAn})})(p9o||={});var nUt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}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?IAn:(this._emitter||(this._emitter=new OS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function m9o(t){return t}a(m9o,"identity");var Fze=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=m9o):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var LQ=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function iUt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(iUt,"escapeRegExpCharacters");function PAn(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(PAn,"ltrim");function Uze(t){return t.split(/\r\n|\r|\n/)}a(Uze,"splitLines");function oUt(t,e){return te?1:0}a(oUt,"compare");function Qze(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(Qze,"compareSubstring");function sUt(t,e){return iIe(t,e,0,t.length,0,e.length)}a(sUt,"compareIgnoreCase");function iIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return Qze(t.toLowerCase(),e.toLowerCase(),r,n,o,s);xAn(u)&&(u-=32),xAn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(iIe,"compareSubstringIgnoreCase");function xAn(t){return t>=97&&t<=122}a(xAn,"isLowerAsciiLetter");function DAn(t,e){let r=e.length;return e.length>t.length?!1:iIe(t,e,0,r)===0}a(DAn,"startsWithIgnoreCase");function sle(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(g9o,"startsWithUTF8BOM");function NAn(t){return g9o(t)?t.substr(1):t}a(NAn,"stripUTF8BOM");var wAn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=A9o()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function A9o(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(A9o,"getGraphemeBreakRawData");var RAn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new LQ(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new Fze({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new LQ(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rMAn)return{status:"notfound",message:"File too large"};let c=await Bce(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:iP.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=To(e);if(aa.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(aa),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof $y))throw c}let o=(await this.ctx.get(Fo).stat(e)).size/1024/1024;return o>MAn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(KM).getEncodingForFile(e)}catch(o){if(!(o instanceof $y))throw o}let n=await this.ctx.get(Fo).readFileString(e,r);return NAn(n)}};p();function sIe(t){for(var e=[],r=1;r{if(t instanceof hle)e(t);else for(let r=0;r0||this._options?.leakWarningThreshold?new fQt(e?.onListenerError??ele,this._options?.leakWarningThreshold??PEn):void 0,this._perfMon=this._options?._profName?new dQt(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}static{a(this,"Emitter")}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(REn){let e=this._listeners;queueMicrotask(()=>{jqo(e,r=>r.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,r,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let d=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new hQt(`${u}. HINT: Stack shows most frequent listener (${d[1]}-times)`,d[0]);return(this._options?.onListenerError||ele)(f),w_.None}if(this._disposed)return w_.None;r&&(e=e.bind(r));let o=new hle(e),s,c;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=lIe.create(),s=this._leakageMon.check(o.stack,this._size+1)),REn&&(o.stack=c??lIe.create()),this._listeners?this._listeners instanceof hle?(this._deliveryQueue??=new mQt,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let l=Xze(()=>{s?.(),this._removeListener(o)});return n instanceof MQ?n.add(l):Array.isArray(n)&&n.push(l),l},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 r=this._listeners,n=r.indexOf(e);if(n===-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--,r[n]=void 0;let o=this._deliveryQueue.current===this;if(this._size*qqo<=r.length){let s=0;for(let c=0;c0}};var mQt=class{constructor(){this.i=-1;this.end=0}static{a(this,"EventDeliveryQueuePrivate")}enqueue(e,r,n){this.i=0,this.end=n,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}};var kEn=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),Hqo;(n=>{function t(o){return o===n.None||o===n.Cancelled||o instanceof gQt?!0:!o||typeof o!="object"?!1:typeof o.isCancellationRequested=="boolean"&&typeof o.onCancellationRequested=="function"}n.isCancellationToken=t,a(t,"isCancellationToken"),n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:uIe.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:kEn})})(Hqo||={});var gQt=class{constructor(){this._isCancelled=!1;this._emitter=null}static{a(this,"MutableToken")}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?kEn:(this._emitter||(this._emitter=new PS),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};function $qo(t){return t}a($qo,"identity");var DYe=class{constructor(e,r){this.lastCache=void 0;this.lastArgKey=void 0;typeof e=="function"?(this._fn=e,this._computeKey=$qo):(this._fn=r,this._computeKey=e.getCacheKey)}static{a(this,"LRUCachedFunction")}get(e){let r=this._computeKey(e);return this.lastArgKey!==r&&(this.lastArgKey=r,this.lastCache=this._fn(e)),this.lastCache}};p();p();var qQ=class{constructor(e){this.executor=e;this._didRun=!1}static{a(this,"Lazy")}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};p();function AQt(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}a(AQt,"escapeRegExpCharacters");function BEn(t,e){if(!t||!e)return t;let r=e.length;if(r===0||t.length===0)return t;let n=0;for(;t.indexOf(e,n)===n;)n=n+r;return t.substring(n)}a(BEn,"ltrim");function NYe(t){return t.split(/\r\n|\r|\n/)}a(NYe,"splitLines");function yQt(t,e){return te?1:0}a(yQt,"compare");function MYe(t,e,r=0,n=t.length,o=0,s=e.length){for(;rd)return 1}let c=n-r,l=s-o;return cl?1:0}a(MYe,"compareSubstring");function EQt(t,e){return fIe(t,e,0,t.length,0,e.length)}a(EQt,"compareIgnoreCase");function fIe(t,e,r=0,n=t.length,o=0,s=e.length){for(;r=128||d>=128)return MYe(t.toLowerCase(),e.toLowerCase(),r,n,o,s);DEn(u)&&(u-=32),DEn(d)&&(d-=32);let f=u-d;if(f!==0)return f}let c=n-r,l=s-o;return cl?1:0}a(fIe,"compareSubstringIgnoreCase");function DEn(t){return t>=97&&t<=122}a(DEn,"isLowerAsciiLetter");function LEn(t,e){let r=e.length;return e.length>t.length?!1:fIe(t,e,0,r)===0}a(LEn,"startsWithIgnoreCase");function mle(t,e){let r=Math.min(t.length,e.length),n;for(n=0;n0&&t.charCodeAt(0)===65279)}a(Vqo,"startsWithUTF8BOM");function FEn(t){return Vqo(t)?t.substr(1):t}a(FEn,"stripUTF8BOM");var NEn=class t{static{a(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=Wqo()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let r=this._data,n=r.length/3,o=1;for(;o<=n;)if(er[3*o+1])o=2*o+1;else return r[3*o+2];return 0}};function Wqo(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}a(Wqo,"getGraphemeBreakRawData");var MEn=class t{constructor(e){this.confusableDictionary=e}static{a(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new qQ(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new DYe({getCacheKey:JSON.stringify},e=>{function r(f){let h=new Map;for(let m=0;m!f.startsWith("_")&&f in s);c.length===0&&(c=["_default"]);let l;for(let f of c){let h=r(s[f]);l=o(l,h)}let u=r(s._common),d=n(u,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e))}static{this._locales=new qQ(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let r=0;rUEn)return{status:"notfound",message:"File too large"};let c=await Yce(this.ctx,{uri:e},o);return c.status==="valid"?{status:"valid",document:gS.create(e,"UNKNOWN",-1,o)}:c}catch{return{status:"notfound",message:"File not found"}}}async readFileWithSize(e){let r=to(e);if(na.isRegisteredScheme(r.scheme))try{let c=this.ctx.get(na),{text:l,stat:u}=await c.readFile(e);return{text:l,fileSizeMB:u.size/1024/1024}}catch(c){if(!(c instanceof Y0))throw c}let o=(await this.ctx.get(jo).stat(e)).size/1024/1024;return o>UEn?{text:"",fileSizeMB:o}:{text:await this.doReadFile(e),fileSizeMB:o}}async doReadFile(e){let r="utf8";try{r=await this.ctx.get(YM).getEncodingForFile(e)}catch(o){if(!(o instanceof Y0))throw o}let n=await this.ctx.get(jo).readFileString(e,r);return FEn(n)}};p();function hIe(t){for(var e=[],r=1;rr.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(OAn,"filterConversationTurns");function cUt(t){return OAn(t).getLastTurn()?.id}a(cUt,"getLastTurnId");async function BAn(t){let e=OAn(t.conversation),r=cUt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(eg).getDump(r),s=_9o(o,e.turns);Dr.debug(t.ctx,`conversation.dump +`)),c+=h+n[u+1]}),c}a(hIe,"dedent");var sa=hIe;var _Qt=class{constructor(){this.resolvedSkills={};this.resolutions=[]}static{a(this,"SkillDump")}},ng=class{constructor(){this.dump=new yn(25);this.promptsDump=new yn(1)}static{a(this,"ConversationDumper")}addResolvedSkill(e,r,n){let o=this.getDump(e);o.resolvedSkills[r]=n}getResolvedSkill(e,r){return this.getDump(e).resolvedSkills[r]}addResolution(e,r){this.getDump(e).resolutions.push(r)}getDump(e){let r=this.dump.get(e);return r||(r=new _Qt,this.dump.set(e,r)),r}addPrompt(e,r,n){let o=this.promptsDump.get(e);o===void 0&&(o=new Map,this.promptsDump.set(e,o)),o.set(n,r)}getLastTurnPrompts(){if(this.promptsDump===void 0)return;let e=this.promptsDump.values().next();if(!e.done)return e.value}};function QEn(t){let e=t.copy();return e.turns=e.turns.filter(r=>r.status!=="in-progress"&&(r.response===void 0||r.response?.type==="model")),e}a(QEn,"filterConversationTurns");function vQt(t){return QEn(t).getLastTurn()?.id}a(vQt,"getLastTurnId");async function qEn(t){let e=QEn(t.conversation),r=vQt(t.conversation);if(!r)return"Nothing to dump because no request has been sent to the model yet.";let o=t.ctx.get(ng).getDump(r),s=Kqo(o,e.turns);Dr.debug(t.ctx,`conversation.dump `,` -`+s);let c=await C9o(o,t.ctx);return Ws` - ${E9o(t.conversation,r)} - ${y9o(t.ctx)} +`+s);let c=await Jqo(o,t.ctx);return sa` + ${Yqo(t.conversation,r)} + ${zqo(t.ctx)} The following code can be copied into a chat simulation \`yml\` file. This response has not polluted the conversation history and did not cause any model roundtrip. \`\`\`yaml ${s} \`\`\`${c?` ${c}`:""} - `}a(BAn,"getConversationDump");function y9o(t){let e=t.get(Lr);return Ws` + `}a(qEn,"getConversationDump");function zqo(t){let e=t.get(Nr);return sa` - IDE: \`${e.getEditorInfo().name} (${e.getEditorInfo().version})\` - Plugin: \`${e.getEditorPluginInfo().version}\` - `}a(y9o,"getEditorInfoDumpMessage");function E9o(t,e){return Ws` + `}a(zqo,"getEditorInfoDumpMessage");function Yqo(t,e){return sa` Debug information for the last turn of the conversation. - ConversationId: \`${t.id}\` - MessageId: \`${e}\` - `}a(E9o,"getInfoDumpMessage");async function LAn(t,e,r){let n=t.ctx.get(Qh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Vo).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` -- ${c.id}`;t.turn.request.message&&In(t.turn.request.message).trim().length>0&&(o+=` + `}a(Yqo,"getInfoDumpMessage");async function jEn(t,e,r){let n=t.ctx.get(Hh),o="# Available skills",s=n.getDescriptors().filter(c=>t.ctx.get(Go).getSupportedSkills(t.conversation.id).includes(c.id));if(r&&(s=s.filter(c=>c.id===r)),s.length===0)return`No skill with id ${r} available`;for(let c of s)o+=` +- ${c.id}`;t.turn.request.message&&Rn(t.turn.request.message).trim().length>0&&(o+=` -**User message**: ${In(t.turn.request.message)}`);for(let c of s){o+=` -## ${c.id}`,o+=Ws` +**User message**: ${Rn(t.turn.request.message)}`);for(let c of s){o+=` +## ${c.id}`,o+=sa` \n\n **Description** - ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=Ws` + ${c.description()}`;let l=n.getSkill(c.id),u=await l?.resolver(t).resolveSkill(t);if(u){o+=sa` \n\n **Resolution** \`\`\`yaml - ${wY(u)} - \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=Ws` + ${QY(u)} + \`\`\``;let d=await l?.processor(t).processSkill(u,t);if(d){let f=typeof d=="string"?d:d.elide(1e3).getText();o+=sa` \n\n **Processed value** @@ -2551,17 +2582,17 @@ ${c}`:""} **Unprocessable**`}else o+=` -**Unresolvable**`}return o}a(LAn,"getSkillsDump");function _9o(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:In(n.request.message)};return n.response&&(s.response=In(n.response.message)),s})};return wY(r)}a(_9o,"toSimulationFormat");async function C9o(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: -`);let c=await e.get(Jn).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Dr.debug(e,`conversation.dump.file +**Unresolvable**`}return o}a(jEn,"getSkillsDump");function Kqo(t,e){let r={state:{skills:t.resolvedSkills},turns:e.map((n,o)=>{let s={request:Rn(n.request.message)};return n.response&&(s.response=Rn(n.response.message)),s})};return QY(r)}a(Kqo,"toSimulationFormat");async function Jqo(t,e){let r=t.resolutions.map(s=>s.files).flat(),n=r.filter((s,c)=>s&&r.indexOf(s)===c),o;for(let s of n)if(s&&s.status==="included"){o||(o=`The following files have been used: +`);let c=await e.get(ri).getOrReadTextDocument(s),l;c.status==="valid"&&(l=c.document);let u=l?.getText();Dr.debug(e,`conversation.dump.file `,u),o+=` **${s.uri}** \`\`\`${l?.detectedLanguageId} ${u} -\`\`\``}return o}a(C9o,"fileDump");p();function lUt(t,e){let r=Ss(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(In(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(lUt,"countMessagesTokens");p();function FAn(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` +\`\`\``}return o}a(Jqo,"fileDump");p();function CQt(t,e){let r=Cs(e.tokenizer),n=0;for(let o of t)n+=e.baseTokensPerMessage,o.role&&(n+=r.tokenize(o.role).length),o.name&&(n+=r.tokenize(o.name).length+e.baseTokensPerName),o.content&&(n+=r.tokenize(Rn(o.content)).length);return n+=e.baseTokensPerCompletion,n}a(CQt,"countMessagesTokens");p();function HEn(t,e,r,n,o){let s=["You are an AI programming assistant.",'When asked for your name, you must respond with "GitHub Copilot".',"Follow the user's requirements carefully & to the letter.","Follow Microsoft content policies.","Avoid content that violates copyrights.",`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,"Keep your answers short and impersonal.","You can answer general programming questions and perform the following tasks:","* Ask a question about the files in your current workspace","* Explain how the code in your active editor works","* Make changes to existing code","* Review the selected code in your active editor","* Generate unit tests for the selected code","* Propose a fix for the problems in the selected code","* Scaffold code for a new file or project in a workspace","* Create a new Jupyter Notebook","* Ask questions about VS Code","* Generate query parameters for workspace search","* Ask how to do something in the terminal","* Explain what just happened in the terminal"].join(` `),c=["The active document is the source code the user is looking at right now.","You have read access to the code in the active document, files the user has recently worked with and open tabs. You are able to retrieve, read and use this code to answer questions.","You cannot retrieve code that is outside of the current project.","You can only give one reply for each conversation turn."].join(` `),l=e?`The user works in an IDE called ${e} which can be used to edit code, run and debug the user's application as well as executing tests.`:"",u=n?`The user is using ${n} as their operating system.`:"",d=o?`You use the ${o} large language model.`:"",f=r?`The user is logged in as ${r} on GitHub.`:"";return[s,u,d,f,l,c].filter(h=>h&&h!="").join(` -`)}a(FAn,"chatBasePrompt");p();p();async function FQ(t){return!!(await t.get(Qt).getToken()).userInfo?.isTBBEnabled}a(FQ,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function jze(t){return!!t&&typeof t.then=="function"}a(jze,"isThenable");var qze=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Oc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Oc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var v9o;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(v9o||={});var UAn=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new OS,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var Hze=!1,Gze=!1,aIe=!1,b9o=!1,S9o=!1,QAn=!1,T9o=!1,I9o=!1,x9o=!1,w9o=!1;var c3,l3=globalThis,kx;typeof l3.vscode<"u"&&typeof l3.vscode.process<"u"?kx=l3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(kx=process);var qAn=typeof kx?.versions?.electron=="string",R9o=qAn&&kx?.type==="renderer";typeof kx=="object"?(Hze=kx.platform==="win32",Gze=kx.platform==="darwin",aIe=kx.platform==="linux",b9o=aIe&&!!kx.env.SNAP&&!!kx.env.SNAP_REVISION,T9o=qAn,x9o=!!kx.env.CI||!!kx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,S9o=!0):typeof navigator=="object"&&!R9o?(c3=navigator.userAgent,Hze=c3.indexOf("Windows")>=0,Gze=c3.indexOf("Macintosh")>=0,I9o=(c3.indexOf("Macintosh")>=0||c3.indexOf("iPad")>=0||c3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,aIe=c3.indexOf("Linux")>=0,w9o=c3?.indexOf("Mobi")>=0,QAn=!0):console.error("Unable to resolve platform.");var uUt=0;Gze?uUt=1:Hze?uUt=3:aIe&&(uUt=2);var dUt=Hze,jAn=Gze,HAn=aIe;var k9o=QAn&&typeof l3.importScripts=="function",a$u=k9o?l3.origin:void 0;var JM=c3;var P9o=typeof l3.postMessage=="function"&&!l3.importScripts,c$u=(()=>{if(P9o){let t=[];l3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),l3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var D9o=!!(JM&&JM.indexOf("Chrome")>=0),l$u=!!(JM&&JM.indexOf("Firefox")>=0),u$u=!!(!D9o&&JM&&JM.indexOf("Safari")>=0),d$u=!!(JM&&JM.indexOf("Edg/")>=0),f$u=!!(JM&&JM.indexOf("Android")>=0);var XY,fUt=globalThis.vscode;if(typeof fUt<"u"&&typeof fUt.process<"u"){let t=fUt.process;XY={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?XY={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:XY={get platform(){return dUt?"win32":jAn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var cIe=XY.cwd,GAn=XY.env,$An=XY.platform,y$u=XY.arch;var M9o=65,O9o=97,B9o=90,L9o=122,qQ=46,tg=47,xv=92,UQ=58,F9o=63,$ze=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function U9o(t,e){if(t===null||typeof t!="object")throw new $ze(e,"Object",t)}a(U9o,"validateObject");function zf(t,e){if(typeof t!="string")throw new $ze(e,"string",t)}a(zf,"validateString");var wv=$An==="win32";function es(t){return t===tg||t===xv}a(es,"isPathSeparator");function pUt(t){return t===tg}a(pUt,"isPosixPathSeparator");function QQ(t){return t>=M9o&&t<=B9o||t>=O9o&&t<=L9o}a(QQ,"isWindowsDeviceRoot");function Vze(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===qQ&&l!==-1?++l:l=-1}return o}a(Vze,"normalizeString");function Q9o(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(Q9o,"formatExt");function VAn(t,e){U9o(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${Q9o(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(VAn,"_format");var qh={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],zf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=cIe():(s=GAn[`=${e}`]||cIe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===xv)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)es(f)&&(l=1,d=!0);else if(es(f))if(d=!0,es(s.charCodeAt(1))){let h=2,m=h;for(;h2&&es(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=Vze(r,!n,"\\",es),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){zf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return pUt(s)?"\\":t;if(es(s))if(o=!0,es(t.charCodeAt(1))){let l=2,u=l;for(;l2&&es(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&es(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){zf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return es(r)||e>2&&QQ(r)&&t.charCodeAt(1)===UQ&&es(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&es(r.charCodeAt(0))){++o;let s=r.length;s>1&&es(r.charCodeAt(1))&&(++o,s>2&&(es(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return qh.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e)return"";let r=qh.resolve(t),n=qh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===xv;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===xv;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===xv)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===xv?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===xv)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===xv&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=qh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===xv){if(e.charCodeAt(1)===xv){let r=e.charCodeAt(2);if(r!==F9o&&r!==qQ)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(QQ(e.charCodeAt(0))&&e.charCodeAt(1)===UQ&&e.charCodeAt(2)===xv)return`\\\\?\\${e}`;return t},dirname(t){zf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return es(o)?t:".";if(es(o)){if(r=n=1,es(t.charCodeAt(1))){let l=2,u=l;for(;l2&&es(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(es(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&zf(e,"suffix"),zf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&QQ(t.charCodeAt(0))&&t.charCodeAt(1)===UQ&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(es(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(es(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){zf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===UQ&&QQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(es(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===qQ?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:VAn.bind(null,"\\"),parse(t){zf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return es(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(es(o)){if(n=1,es(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),es(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===qQ?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},q9o=(()=>{if(wv){let t=/\\/g;return()=>{let e=cIe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>cIe()})(),ff={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:q9o();zf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===tg)}return e=Vze(e,!r,"/",pUt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=t.charCodeAt(t.length-1)===tg;return t=Vze(t,!e,"/",pUt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return zf(t,"path"),t.length>0&&t.charCodeAt(0)===tg},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":ff.normalize(e)},relative(t,e){if(zf(t,"from"),zf(e,"to"),t===e||(t=ff.resolve(t),e=ff.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===tg)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===tg?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===tg)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(zf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===tg,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===tg){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&zf(e,"ext"),zf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===tg){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===tg){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){zf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===tg){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===qQ?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:VAn.bind(null,"/"),parse(t){zf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===tg,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===tg){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===qQ?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};ff.win32=qh.win32=qh;ff.posix=qh.posix=ff;var j9o=wv?qh.normalize:ff.normalize,H9o=wv?qh.isAbsolute:ff.isAbsolute,Wze=wv?qh.join:ff.join,_$u=wv?qh.resolve:ff.resolve,C$u=wv?qh.relative:ff.relative,v$u=wv?qh.dirname:ff.dirname,WAn=wv?qh.basename:ff.basename,zAn=wv?qh.extname:ff.extname,b$u=wv?qh.format:ff.format,S$u=wv?qh.parse:ff.parse,T$u=wv?qh.toNamespacedPath:ff.toNamespacedPath,eK=wv?qh.sep:ff.sep,I$u=wv?qh.delimiter:ff.delimiter;p();p();function tK(t,e="unexpected state"){if(!t)throw new Oc(`Assertion Failed: ${e}`)}a(tK,"assert");function hUt(t){if(!t()){debugger;t(),qce(new Oc("Assertion Failed"))}}a(hUt,"assertFn");function lIe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!DAn(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(YAn,"isEqualOrParent");var zze="**",KAn="/",Yze="[/\\\\]",Kze="[^/\\\\]",$9o=/\//g;function JAn(t,e){switch(t){case 0:return"";case 1:return`${Kze}*?`;default:return`(?:${Yze}|${Kze}+${Yze}${e?`|${Yze}${Kze}+`:""})*?`}}a(JAn,"starsToRegExp");function uIe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(uIe,"splitGlobAware");function tyn(t){if(!t)return"";let e="",r=uIe(t,KAn);if(r.every(n=>n===zze))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===zze){if(n)return;e+=JAn(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===KAn?h="":h=iUt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${uIe(l,",").map(g=>tyn(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=Kze;continue;case"*":e+=JAn(1);continue;default:e+=iUt(f)}}sAUt(l,e)).filter(l=>l!==yP),t),n=r.length;if(!n)return yP;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(eUo,"trivia3");function eyn(t,e,r){let n=eK===ff.sep,o=n?t:t.replace($9o,eK),s=eK+o,c=ff.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(eyn,"trivia4and5");function tUo(t){try{let e=new RegExp(`^${tyn(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return yP}}a(tUo,"toRegExp");function nyn(t,e,r){return!t||typeof e!="string"?!1:yUt(t)(e,void 0,r)}a(nyn,"match");function yUt(t,e={}){if(!t)return gUt;if(typeof t=="string"||rUo(t)){let r=AUt(t,e);if(r===yP)return gUt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return nUo(t,e)}a(yUt,"parse");function rUo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(rUo,"isRelativePattern");function nUo(t,e){let r=iyn(Object.getOwnPropertyNames(t).map(l=>iUo(l,t[l],e)).filter(l=>l!==yP)),n=r.length;if(!n)return yP;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(nUo,"parsedExpression");function iUo(t,e,r){if(e===!1)return yP;let n=AUt(t,r);if(n===yP)return yP;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return jze(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(iUo,"parseExpressionPattern");function iyn(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(iyn,"aggregateBasenameMatches");function oyn(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return oUo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(oyn,"validate");function syn(t,e){let r=uIe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(nyn(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(syn,"matches");function oUo(t){try{let e=uIe(t,",");if(e.length===0)return!1;for(let r of e){let n=yUt(r);if(ryn(n))return!1}return!0}catch{return!1}}a(oUo,"isValidGlob");var cyn=ce(require("path"));var jh={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var _Ut=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ji(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){return this.isBuiltIn||this.promptFileEntry.promptPath.storage==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},lyn={name:"copilot-instructions",source:jh.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},uyn={name:"git-commit-instructions",source:jh.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},dyn={name:"agents-md-instructions",source:jh.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},sUo={name:"nested-agents-md-instructions",source:jh.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},fyn={name:"claude-md-instructions",source:jh.claudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},aUo={name:"nested-claude-md-instructions",source:jh.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},cUo=[lyn,uyn,dyn,sUo,fyn,aUo],lUo={name:"instruction-file",source:jh.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},EUt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},uUo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function ayn(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(ayn,"optionKey");function CUt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=ayn(n);if(!(o in EUt)||(r=!0,!(e[o]??EUt[o])))continue;let c=uUo[n];if(c){let l=ayn(c);if(!(e[l]??EUt[l]))continue}return!0}return r?!1:void 0}a(CUt,"shouldIncludeSource");var vUt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)CUt([n],e)!==!1&&r.push(...o);return r}},dUo=new uQ;function fUo(t,e,r,n){if(!t)return;let o=`${dQ}${e}`,s=dUo.parse(o,t),c=s.body?.content??t;if(c.trim())return{matchKind:r,uri:o,name:s.header?.name??e,applyTo:s.header?.applyTo||void 0,description:s.header?.description,content:c,isReadonly:!0,isBuiltIn:!1,source:[n]}}a(fUo,"resolveContent");var rK=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let m of this.configsByKey.values())o.push(...m);let{name:s,matchKind:c,source:l}=this.descriptor,u=o.filter(m=>m.type==="content").map(m=>{let g=m.content?.trim();return g?fUo(g,`global-${s}`,c,l):void 0}).filter(m=>m!==void 0);this.manager.set(l,u);let d={source:l,matchKind:c},f=this.descriptor.globSuffix??"",h=new Set;for(let m of this.descriptor.defaultRegistration??[])h.add(m);for(let m of o)m.type==="location"?h.add(cyn.default.posix.join(m.path,f)):m.type==="file"&&h.add(Wn(m.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(h),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:d})}};function pUo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a(pUo,"stripSource");var hUo="workspace",pf=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new vUt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[jh.copilotInstructions,new rK(lyn,this.inMemoryManager,n)],[jh.gitCommitInstructions,new rK(uyn,this.inMemoryManager,n)],[jh.agentsMdInstructions,new rK(dyn,this.inMemoryManager,n)],[jh.claudeMdInstructions,new rK(fyn,this.inMemoryManager,n)],[jh.customInstructionFiles,new rK(lUo,this.inMemoryManager,n)]]);for(let o of cUo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind}});this.slotsBySource.get(jh.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e){return(await this.ctx.get(zm).collect(this.ctx,"instructions",e)).map(n=>new _Ut(n))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=hUo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=jh.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Dr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(pUo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:jh.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get(jh.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:jh.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:jh.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:jh.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:jh.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` +`)}a(HEn,"chatBasePrompt");p();p();async function jQ(t){return!!(await t.get(Ut).getToken()).userInfo?.isTBBEnabled}a(jQ,"isTokenBasedBillingEnabled");p();p();p();p();p();p();p();function BYe(t){return!!t&&typeof t.then=="function"}a(BYe,"isThenable");var OYe=class{constructor(e,r){this._isDisposed=!1;this._token=-1,typeof e=="function"&&typeof r=="number"&&this.setIfNotSet(e,r)}static{a(this,"TimeoutTimer")}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,r){if(this._isDisposed)throw new Nc("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},r)}setIfNotSet(e,r){if(this._isDisposed)throw new Nc("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},r))}};var Zqo;(r=>{async function t(n){let o,s=await Promise.all(n.map(c=>c.then(l=>l,l=>{o||(o=l)})));if(typeof o<"u")throw o;return s}r.settled=t,a(t,"settled");function e(n){return new Promise(async(o,s)=>{try{await n(o,s)}catch(c){s(c)}})}r.withAsyncBody=e,a(e,"withAsyncBody")})(Zqo||={});var GEn=class t{static{a(this,"AsyncIterableObject")}static fromArray(e){return new t(r=>{r.emitMany(e)})}static fromPromise(e){return new t(async r=>{r.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async r=>{await Promise.all(e.map(async n=>r.emitOne(await n)))})}static merge(e){return new t(async r=>{await Promise.all(e.map(async n=>{for await(let o of n)r.emitOne(o)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new PS,queueMicrotask(async()=>{let n={emitOne:a(o=>this.emitOne(o),"emitOne"),emitMany:a(o=>this.emitMany(o),"emitMany"),reject:a(o=>this.reject(o),"reject")};try{await Promise.resolve(e(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:a(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,r){return new t(async n=>{for await(let o of e)n.emitOne(r(o))})}map(e){return t.map(this,e)}static filter(e,r){return new t(async n=>{for await(let o of e)r(o)&&n.emitOne(o)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,r=>!!r)}coalesce(){return t.coalesce(this)}static async toPromise(e){let r=[];for await(let n of e)r.push(n);return r}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};p();p();p();p();var LYe=!1,FYe=!1,mIe=!1,Xqo=!1,ejo=!1,$En=!1,tjo=!1,rjo=!1,njo=!1,ijo=!1;var f3,p3=globalThis,Dx;typeof p3.vscode<"u"&&typeof p3.vscode.process<"u"?Dx=p3.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Dx=process);var VEn=typeof Dx?.versions?.electron=="string",ojo=VEn&&Dx?.type==="renderer";typeof Dx=="object"?(LYe=Dx.platform==="win32",FYe=Dx.platform==="darwin",mIe=Dx.platform==="linux",Xqo=mIe&&!!Dx.env.SNAP&&!!Dx.env.SNAP_REVISION,tjo=VEn,njo=!!Dx.env.CI||!!Dx.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ejo=!0):typeof navigator=="object"&&!ojo?(f3=navigator.userAgent,LYe=f3.indexOf("Windows")>=0,FYe=f3.indexOf("Macintosh")>=0,rjo=(f3.indexOf("Macintosh")>=0||f3.indexOf("iPad")>=0||f3.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mIe=f3.indexOf("Linux")>=0,ijo=f3?.indexOf("Mobi")>=0,$En=!0):console.error("Unable to resolve platform.");var bQt=0;FYe?bQt=1:LYe?bQt=3:mIe&&(bQt=2);var SQt=LYe,WEn=FYe,zEn=mIe;var sjo=$En&&typeof p3.importScripts=="function",iWu=sjo?p3.origin:void 0;var KM=f3;var ajo=typeof p3.postMessage=="function"&&!p3.importScripts,oWu=(()=>{if(ajo){let t=[];p3.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,o=t.length;n{let n=++e;t.push({id:n,callback:r}),p3.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var cjo=!!(KM&&KM.indexOf("Chrome")>=0),sWu=!!(KM&&KM.indexOf("Firefox")>=0),aWu=!!(!cjo&&KM&&KM.indexOf("Safari")>=0),cWu=!!(KM&&KM.indexOf("Edg/")>=0),lWu=!!(KM&&KM.indexOf("Android")>=0);var rK,TQt=globalThis.vscode;if(typeof TQt<"u"&&typeof TQt.process<"u"){let t=TQt.process;rK={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?rK={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:rK={get platform(){return SQt?"win32":WEn?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var gIe=rK.cwd,YEn=rK.env,KEn=rK.platform,mWu=rK.arch;var ujo=65,djo=97,fjo=90,pjo=122,$Q=46,ig=47,xC=92,HQ=58,hjo=63,UYe=class extends Error{static{a(this,"ErrorInvalidArgType")}constructor(e,r,n){let o;typeof r=="string"&&r.indexOf("not ")===0?(o="must not be",r=r.replace(/^not /,"")):o="must be";let s=e.indexOf(".")!==-1?"property":"argument",c=`The "${e}" ${s} ${o} of type ${r}`;c+=`. Received type ${typeof n}`,super(c),this.code="ERR_INVALID_ARG_TYPE"}};function mjo(t,e){if(t===null||typeof t!="object")throw new UYe(e,"Object",t)}a(mjo,"validateObject");function Xf(t,e){if(typeof t!="string")throw new UYe(e,"string",t)}a(Xf,"validateString");var wC=KEn==="win32";function Zo(t){return t===ig||t===xC}a(Zo,"isPathSeparator");function IQt(t){return t===ig}a(IQt,"isPosixPathSeparator");function GQ(t){return t>=ujo&&t<=fjo||t>=djo&&t<=pjo}a(GQ,"isWindowsDeviceRoot");function QYe(t,e,r,n){let o="",s=0,c=-1,l=0,u=0;for(let d=0;d<=t.length;++d){if(d2){let f=o.lastIndexOf(r);f===-1?(o="",s=0):(o=o.slice(0,f),s=o.length-1-o.lastIndexOf(r)),c=d,l=0;continue}else if(o.length!==0){o="",s=0,c=d,l=0;continue}}e&&(o+=o.length>0?`${r}..`:"..",s=2)}else o.length>0?o+=`${r}${t.slice(c+1,d)}`:o=t.slice(c+1,d),s=d-c-1;c=d,l=0}else u===$Q&&l!==-1?++l:l=-1}return o}a(QYe,"normalizeString");function gjo(t){return t?`${t[0]==="."?"":"."}${t}`:""}a(gjo,"formatExt");function JEn(t,e){mjo(e,"pathObject");let r=e.dir||e.root,n=e.base||`${e.name||""}${gjo(e.ext)}`;return r?r===e.root?`${r}${n}`:`${r}${t}${n}`:n}a(JEn,"_format");var Gh={resolve(...t){let e="",r="",n=!1;for(let o=t.length-1;o>=-1;o--){let s;if(o>=0){if(s=t[o],Xf(s,`paths[${o}]`),s.length===0)continue}else e.length===0?s=gIe():(s=YEn[`=${e}`]||gIe(),(s===void 0||s.slice(0,2).toLowerCase()!==e.toLowerCase()&&s.charCodeAt(2)===xC)&&(s=`${e}\\`));let c=s.length,l=0,u="",d=!1,f=s.charCodeAt(0);if(c===1)Zo(f)&&(l=1,d=!0);else if(Zo(f))if(d=!0,Zo(s.charCodeAt(1))){let h=2,m=h;for(;h2&&Zo(s.charCodeAt(2))&&(d=!0,l=3));if(u.length>0)if(e.length>0){if(u.toLowerCase()!==e.toLowerCase())continue}else e=u;if(n){if(e.length>0)break}else if(r=`${s.slice(l)}\\${r}`,n=d,d&&e.length>0)break}return r=QYe(r,!n,"\\",Zo),n?`${e}\\${r}`:`${e}${r}`||"."},normalize(t){Xf(t,"path");let e=t.length;if(e===0)return".";let r=0,n,o=!1,s=t.charCodeAt(0);if(e===1)return IQt(s)?"\\":t;if(Zo(s))if(o=!0,Zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Zo(t.charCodeAt(2))&&(o=!0,r=3));let c=r0&&Zo(t.charCodeAt(e-1))&&(c+="\\"),n===void 0?o?`\\${c}`:c:o?`${n}\\${c}`:`${n}${c}`},isAbsolute(t){Xf(t,"path");let e=t.length;if(e===0)return!1;let r=t.charCodeAt(0);return Zo(r)||e>2&&GQ(r)&&t.charCodeAt(1)===HQ&&Zo(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,r;for(let s=0;s0&&(e===void 0?e=r=c:e+=`\\${c}`)}if(e===void 0)return".";let n=!0,o=0;if(typeof r=="string"&&Zo(r.charCodeAt(0))){++o;let s=r.length;s>1&&Zo(r.charCodeAt(1))&&(++o,s>2&&(Zo(r.charCodeAt(2))?++o:n=!1))}if(n){for(;o=2&&(e=`\\${e.slice(o)}`)}return Gh.normalize(e)},relative(t,e){if(Xf(t,"from"),Xf(e,"to"),t===e)return"";let r=Gh.resolve(t),n=Gh.resolve(e);if(r===n||(t=r.toLowerCase(),e=n.toLowerCase(),t===e))return"";let o=0;for(;oo&&t.charCodeAt(s-1)===xC;)s--;let c=s-o,l=0;for(;ll&&e.charCodeAt(u-1)===xC;)u--;let d=u-l,f=cf){if(e.charCodeAt(l+m)===xC)return n.slice(l+m+1);if(m===2)return n.slice(l+m)}c>f&&(t.charCodeAt(o+m)===xC?h=m:m===2&&(h=3)),h===-1&&(h=0)}let g="";for(m=o+h+1;m<=s;++m)(m===s||t.charCodeAt(m)===xC)&&(g+=g.length===0?"..":"\\..");return l+=h,g.length>0?`${g}${n.slice(l,u)}`:(n.charCodeAt(l)===xC&&++l,n.slice(l,u))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=Gh.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===xC){if(e.charCodeAt(1)===xC){let r=e.charCodeAt(2);if(r!==hjo&&r!==$Q)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(GQ(e.charCodeAt(0))&&e.charCodeAt(1)===HQ&&e.charCodeAt(2)===xC)return`\\\\?\\${e}`;return t},dirname(t){Xf(t,"path");let e=t.length;if(e===0)return".";let r=-1,n=0,o=t.charCodeAt(0);if(e===1)return Zo(o)?t:".";if(Zo(o)){if(r=n=1,Zo(t.charCodeAt(1))){let l=2,u=l;for(;l2&&Zo(t.charCodeAt(2))?3:2,n=r);let s=-1,c=!0;for(let l=e-1;l>=n;--l)if(Zo(t.charCodeAt(l))){if(!c){s=l;break}}else c=!1;if(s===-1){if(r===-1)return".";s=r}return t.slice(0,s)},basename(t,e){e!==void 0&&Xf(e,"suffix"),Xf(t,"path");let r=0,n=-1,o=!0,s;if(t.length>=2&&GQ(t.charCodeAt(0))&&t.charCodeAt(1)===HQ&&(r=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=r;--s){let u=t.charCodeAt(s);if(Zo(u)){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=r;--s)if(Zo(t.charCodeAt(s))){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Xf(t,"path");let e=0,r=-1,n=0,o=-1,s=!0,c=0;t.length>=2&&t.charCodeAt(1)===HQ&&GQ(t.charCodeAt(0))&&(e=n=2);for(let l=t.length-1;l>=e;--l){let u=t.charCodeAt(l);if(Zo(u)){if(!s){n=l+1;break}continue}o===-1&&(s=!1,o=l+1),u===$Q?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||o===-1||c===0||c===1&&r===o-1&&r===n+1?"":t.slice(r,o)},format:JEn.bind(null,"\\"),parse(t){Xf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.length,n=0,o=t.charCodeAt(0);if(r===1)return Zo(o)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Zo(o)){if(n=1,Zo(t.charCodeAt(1))){let h=2,m=h;for(;h0&&(e.root=t.slice(0,n));let s=-1,c=n,l=-1,u=!0,d=t.length-1,f=0;for(;d>=n;--d){if(o=t.charCodeAt(d),Zo(o)){if(!u){c=d+1;break}continue}l===-1&&(u=!1,l=d+1),o===$Q?s===-1?s=d:f!==1&&(f=1):s!==-1&&(f=-1)}return l!==-1&&(s===-1||f===0||f===1&&s===l-1&&s===c+1?e.base=e.name=t.slice(c,l):(e.name=t.slice(c,s),e.base=t.slice(c,l),e.ext=t.slice(s,l))),c>0&&c!==n?e.dir=t.slice(0,c-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Ajo=(()=>{if(wC){let t=/\\/g;return()=>{let e=gIe().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>gIe()})(),df={resolve(...t){let e="",r=!1;for(let n=t.length-1;n>=-1&&!r;n--){let o=n>=0?t[n]:Ajo();Xf(o,`paths[${n}]`),o.length!==0&&(e=`${o}/${e}`,r=o.charCodeAt(0)===ig)}return e=QYe(e,!r,"/",IQt),r?`/${e}`:e.length>0?e:"."},normalize(t){if(Xf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===ig,r=t.charCodeAt(t.length-1)===ig;return t=QYe(t,!e,"/",IQt),t.length===0?e?"/":r?"./":".":(r&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return Xf(t,"path"),t.length>0&&t.charCodeAt(0)===ig},join(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":df.normalize(e)},relative(t,e){if(Xf(t,"from"),Xf(e,"to"),t===e||(t=df.resolve(t),e=df.resolve(e),t===e))return"";let r=1,n=t.length,o=n-r,s=1,c=e.length-s,l=ol){if(e.charCodeAt(s+d)===ig)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else o>l&&(t.charCodeAt(r+d)===ig?u=d:d===0&&(u=0));let f="";for(d=r+u+1;d<=n;++d)(d===n||t.charCodeAt(d)===ig)&&(f+=f.length===0?"..":"/..");return`${f}${e.slice(s+u)}`},toNamespacedPath(t){return t},dirname(t){if(Xf(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===ig,r=-1,n=!0;for(let o=t.length-1;o>=1;--o)if(t.charCodeAt(o)===ig){if(!n){r=o;break}}else n=!1;return r===-1?e?"/":".":e&&r===1?"//":t.slice(0,r)},basename(t,e){e!==void 0&&Xf(e,"ext"),Xf(t,"path");let r=0,n=-1,o=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let c=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){let u=t.charCodeAt(s);if(u===ig){if(!o){r=s+1;break}}else l===-1&&(o=!1,l=s+1),c>=0&&(u===e.charCodeAt(c)?--c===-1&&(n=s):(c=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===ig){if(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)},extname(t){Xf(t,"path");let e=-1,r=0,n=-1,o=!0,s=0;for(let c=t.length-1;c>=0;--c){let l=t.charCodeAt(c);if(l===ig){if(!o){r=c+1;break}continue}n===-1&&(o=!1,n=c+1),l===$Q?e===-1?e=c:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:JEn.bind(null,"/"),parse(t){Xf(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let r=t.charCodeAt(0)===ig,n;r?(e.root="/",n=1):n=0;let o=-1,s=0,c=-1,l=!0,u=t.length-1,d=0;for(;u>=n;--u){let f=t.charCodeAt(u);if(f===ig){if(!l){s=u+1;break}continue}c===-1&&(l=!1,c=u+1),f===$Q?o===-1?o=u:d!==1&&(d=1):o!==-1&&(d=-1)}if(c!==-1){let f=s===0&&r?1:s;o===-1||d===0||d===1&&o===c-1&&o===s+1?e.base=e.name=t.slice(f,c):(e.name=t.slice(f,o),e.base=t.slice(f,c),e.ext=t.slice(o,c))}return s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};df.win32=Gh.win32=Gh;df.posix=Gh.posix=df;var yjo=wC?Gh.normalize:df.normalize,Ejo=wC?Gh.isAbsolute:df.isAbsolute,qYe=wC?Gh.join:df.join,AWu=wC?Gh.resolve:df.resolve,yWu=wC?Gh.relative:df.relative,EWu=wC?Gh.dirname:df.dirname,ZEn=wC?Gh.basename:df.basename,XEn=wC?Gh.extname:df.extname,_Wu=wC?Gh.format:df.format,vWu=wC?Gh.parse:df.parse,CWu=wC?Gh.toNamespacedPath:df.toNamespacedPath,nK=wC?Gh.sep:df.sep,bWu=wC?Gh.delimiter:df.delimiter;p();p();function iK(t,e="unexpected state"){if(!t)throw new Nc(`Assertion Failed: ${e}`)}a(iK,"assert");function xQt(t){if(!t()){debugger;t(),ele(new Nc("Assertion Failed"))}}a(xQt,"assertFn");function AIe(t,e){let r=0;for(;rt.length)return!1;if(r){if(!LEn(t,e))return!1;if(e.length===t.length)return!0;let s=e.length;return e.charAt(e.length-1)===n&&s--,t.charAt(s)===n}return e.charAt(e.length-1)!==n&&(e+=n),t.indexOf(e)===0}a(e_n,"isEqualOrParent");var jYe="**",t_n="/",HYe="[/\\\\]",GYe="[^/\\\\]",vjo=/\//g;function r_n(t,e){switch(t){case 0:return"";case 1:return`${GYe}*?`;default:return`(?:${HYe}|${GYe}+${HYe}${e?`|${HYe}${GYe}+`:""})*?`}}a(r_n,"starsToRegExp");function yIe(t,e){if(!t)return[];let r=[],n=!1,o=!1,s="";for(let c of t){switch(c){case e:if(!n&&!o){r.push(s),s="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":o=!0;break;case"]":o=!1;break}s+=c}return s&&r.push(s),r}a(yIe,"splitGlobAware");function s_n(t){if(!t)return"";let e="",r=yIe(t,t_n);if(r.every(n=>n===jYe))e=".*";else{let n=!1;r.forEach((o,s)=>{if(o===jYe){if(n)return;e+=r_n(2,s===r.length-1)}else{let c=!1,l="",u=!1,d="";for(let f of o){if(f!=="}"&&c){l+=f;continue}if(u&&(f!=="]"||!d)){let h;f==="-"?h=f:(f==="^"||f==="!")&&!d?h="^":f===t_n?h="":h=AQt(f),d+=h;continue}switch(f){case"{":c=!0;continue;case"[":u=!0;continue;case"}":{let m=`(?:${yIe(l,",").map(g=>s_n(g)).join("|")})`;e+=m,c=!1,l="";break}case"]":{e+="["+d+"]",u=!1,d="";break}case"?":e+=GYe;continue;case"*":e+=r_n(1);continue;default:e+=AQt(f)}}sPQt(l,e)).filter(l=>l!==vk),t),n=r.length;if(!n)return vk;if(n===1)return r[0];let o=a(function(l,u){for(let d=0,f=r.length;d!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Pjo,"trivia3");function o_n(t,e,r){let n=nK===df.sep,o=n?t:t.replace(vjo,nK),s=nK+o,c=df.sep+t,l;return r?l=a(function(u,d){return typeof u=="string"&&(u===o||u.endsWith(s)||!n&&(u===t||u.endsWith(c)))?e:null},"parsedPattern"):l=a(function(u,d){return typeof u=="string"&&(u===o||!n&&u===t)?e:null},"parsedPattern"),l.allPaths=[(r?"*/":"./")+t],l}a(o_n,"trivia4and5");function kjo(t){try{let e=new RegExp(`^${s_n(t)}$`);return function(r){return e.lastIndex=0,typeof r=="string"&&e.test(r)?t:null}}catch{return vk}}a(kjo,"toRegExp");function c_n(t,e,r){return!t||typeof e!="string"?!1:kQt(t)(e,void 0,r)}a(c_n,"match");function kQt(t,e={}){if(!t)return RQt;if(typeof t=="string"||Djo(t)){let r=PQt(t,e);if(r===vk)return RQt;let n=a(function(o,s){return!!r(o,s)},"resultPattern");return r.allBasenames&&(n.allBasenames=r.allBasenames),r.allPaths&&(n.allPaths=r.allPaths),n}return Njo(t,e)}a(kQt,"parse");function Djo(t){let e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}a(Djo,"isRelativePattern");function Njo(t,e){let r=l_n(Object.getOwnPropertyNames(t).map(l=>Mjo(l,t[l],e)).filter(l=>l!==vk)),n=r.length;if(!n)return vk;if(!r.some(l=>!!l.requiresSiblings)){if(n===1)return r[0];let l=a(function(f,h){let m;for(let g=0,A=r.length;g{for(let g of m){let A=await g;if(typeof A=="string")return A}return null})():null},"resultExpression"),u=r.find(f=>!!f.allBasenames);u&&(l.allBasenames=u.allBasenames);let d=r.reduce((f,h)=>h.allPaths?f.concat(h.allPaths):f,[]);return d.length&&(l.allPaths=d),l}let o=a(function(l,u,d){let f,h;for(let m=0,g=r.length;m{for(let m of h){let g=await m;if(typeof g=="string")return g}return null})():null},"resultExpression"),s=r.find(l=>!!l.allBasenames);s&&(o.allBasenames=s.allBasenames);let c=r.reduce((l,u)=>u.allPaths?l.concat(u.allPaths):l,[]);return c.length&&(o.allPaths=c),o}a(Njo,"parsedExpression");function Mjo(t,e,r){if(e===!1)return vk;let n=PQt(t,r);if(n===vk)return vk;if(typeof e=="boolean")return n;if(e){let o=e.when;if(typeof o=="string"){let s=a((c,l,u,d)=>{if(!d||!n(c,l))return null;let f=o.replace("$(basename)",()=>u),h=d(f);return BYe(h)?h.then(m=>m?t:null):h?t:null},"result");return s.requiresSiblings=!0,s}}return n}a(Mjo,"parseExpressionPattern");function l_n(t,e){let r=t.filter(l=>!!l.basenames);if(r.length<2)return t;let n=r.reduce((l,u)=>{let d=u.basenames;return d?l.concat(d):l},[]),o;if(e){o=[];for(let l=0,u=n.length;l{let d=u.patterns;return d?l.concat(d):l},[]);let s=a(function(l,u){if(typeof l!="string")return null;if(!u){let f;for(f=l.length;f>0;f--){let h=l.charCodeAt(f-1);if(h===47||h===92)break}u=l.substr(f)}let d=n.indexOf(u);return d!==-1?o[d]:null},"aggregate");s.basenames=n,s.patterns=o,s.allBasenames=n;let c=t.filter(l=>!l.basenames);return c.push(s),c}a(l_n,"aggregateBasenameMatches");function u_n(t){if(!t||t.trim()==="")return{pattern:t,isValid:!1,error:"Pattern cannot be empty"};let e=t.trim();return Ojo(e)?{pattern:e,isValid:!0}:{pattern:e,isValid:!1,error:"Invalid glob pattern"}}a(u_n,"validate");function d_n(t,e){let r=yIe(e,","),n=a(o=>{if(o=o.trim(),o.length!==0){if(o==="**"||o==="**/*"||o==="*")return{pattern:o};!o.startsWith("/")&&!o.startsWith("**/")&&(o="**/"+o);for(let s of t)if(c_n(o,s))return{pattern:o,file:s}}},"patternMatches");for(let o of r){let s=n(o);if(s)return s}}a(d_n,"matches");function Ojo(t){try{let e=yIe(t,",");if(e.length===0)return!1;for(let r of e){let n=kQt(r);if(a_n(n))return!1}return!0}catch{return!1}}a(Ojo,"isValidGlob");var p_n=fe(require("path"));var $h={copilotInstructions:"copilotInstructions",gitCommitInstructions:"gitCommitInstructions",agentsMdInstructions:"agentsMdInstructions",nestedAgentsMdInstructions:"nestedAgentsMdInstructions",claudeMdInstructions:"claudeMdInstructions",nestedClaudeMdInstructions:"nestedClaudeMdInstructions",customInstructionFiles:"customInstructionFiles"};var NQt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ki(n.uri).replace(".instructions.md","")}static{a(this,"CustomInstruction")}get metadata(){return this.promptFileEntry.promptPath.metadata}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get matchKind(){return this.metadata?.length?this.metadata.some(e=>e.matchKind==="ApplyToPattern")?"ApplyToPattern":"AlwaysApplied":"ApplyToPattern"}get source(){if(this.metadata?.length)return this.metadata.map(e=>e.source)}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get applyTo(){return this.parsedPromptFile.header?.applyTo||void 0}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){return this.isBuiltIn||this.promptFileEntry.promptPath.storage==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},h_n={name:"copilot-instructions",source:$h.copilotInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/copilot-instructions.md"]},m_n={name:"git-commit-instructions",source:$h.gitCommitInstructions,matchKind:"AlwaysApplied",defaultRegistration:[".github/git-commit-instructions.md"]},g_n={name:"agents-md-instructions",source:$h.agentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["AGENTS.md"]},Bjo={name:"nested-agents-md-instructions",source:$h.nestedAgentsMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/AGENTS.md"],watchable:!1,cacheable:!1},A_n={name:"claude-md-instructions",source:$h.claudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["CLAUDE.md","CLAUDE.local.md"]},Ljo={name:"nested-claude-md-instructions",source:$h.nestedClaudeMdInstructions,matchKind:"AlwaysApplied",defaultRegistration:["**/CLAUDE.md","**/CLAUDE.local.md"],watchable:!1,cacheable:!1},Fjo=[h_n,m_n,g_n,Bjo,A_n,Ljo],Ujo={name:"instruction-file",source:$h.customInstructionFiles,matchKind:"ApplyToPattern",defaultRegistration:[".github/instructions/**/*.instructions.md"],globSuffix:"**/*.instructions.md"},DQt={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!0},Qjo={nestedAgentsMdInstructions:"agentsMdInstructions",nestedClaudeMdInstructions:"claudeMdInstructions"};function f_n(t){return`include${t.charAt(0).toUpperCase()}${t.slice(1)}`}a(f_n,"optionKey");function MQt(t,e){if(!t?.length)return;let r=!1;for(let n of t){let o=f_n(n);if(!(o in DQt)||(r=!0,!(e[o]??DQt[o])))continue;let c=Qjo[n];if(c){let l=f_n(c);if(!(e[l]??DQt[l]))continue}return!0}return r?!1:void 0}a(MQt,"shouldIncludeSource");var OQt=class{constructor(){this.store=new Map}static{a(this,"InMemoryInstructionManager")}set(e,r){r.length===0?this.store.delete(e):this.store.set(e,r)}get(e){return this.store.get(e)??[]}getAll(e){let r=[];for(let[n,o]of this.store)MQt([n],e)!==!1&&r.push(...o);return r}},qjo=new IQ;function jjo(t,e,r,n){if(!t)return;let o=`${xQ}${e}`,s=qjo.parse(o,t),c=s.body?.content??t;if(c.trim())return{matchKind:r,uri:o,name:s.header?.name??e,applyTo:s.header?.applyTo||void 0,description:s.header?.description,content:c,isReadonly:!0,isBuiltIn:!1,source:[n]}}a(jjo,"resolveContent");var oK=class{constructor(e,r,n){this.descriptor=e;this.manager=r;this.registry=n;this.configsByKey=new Map}static{a(this,"InstructionSlot")}set(e,r="default"){let n=Array.isArray(e)?e:e?[e]:[];this.configsByKey.set(r,n);let o=[];for(let m of this.configsByKey.values())o.push(...m);let{name:s,matchKind:c,source:l}=this.descriptor,u=o.filter(m=>m.type==="content").map(m=>{let g=m.content?.trim();return g?jjo(g,`global-${s}`,c,l):void 0}).filter(m=>m!==void 0);this.manager.set(l,u);let d={source:l,matchKind:c},f=this.descriptor.globSuffix??"",h=new Set;for(let m of this.descriptor.defaultRegistration??[])h.add(m);for(let m of o)m.type==="location"?h.add(p_n.default.posix.join(m.path,f)):m.type==="file"&&h.add(kn(m.uri));this._registryDisposable=this.registry.replace(this._registryDisposable,"instructions",Array.from(h),{watchable:this.descriptor.watchable??!0,cacheable:this.descriptor.cacheable??!0,metadata:d})}};function Hjo(t){switch(t.type){case"content":return{type:"content",content:t.content};case"file":return{type:"file",uri:t.uri};case"location":return{type:"location",path:t.path}}}a(Hjo,"stripSource");var Gjo="workspace",ff=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.inMemoryManager=new OQt;let n=this.promptFileLocationRegistry;this.slotsBySource=new Map([[$h.copilotInstructions,new oK(h_n,this.inMemoryManager,n)],[$h.gitCommitInstructions,new oK(m_n,this.inMemoryManager,n)],[$h.agentsMdInstructions,new oK(g_n,this.inMemoryManager,n)],[$h.claudeMdInstructions,new oK(A_n,this.inMemoryManager,n)],[$h.customInstructionFiles,new oK(Ujo,this.inMemoryManager,n)]]);for(let o of Fjo)o.defaultRegistration&&n.register("instructions",o.defaultRegistration,{watchable:o.watchable??!0,cacheable:o.cacheable??!0,metadata:{source:o.source,matchKind:o.matchKind}});this.slotsBySource.get($h.customInstructionFiles).set([])}static{a(this,"CustomInstructionService")}async listCustomInstructions(e){return(await this.ctx.get(Zm).collect(this.ctx,"instructions",e)).map(n=>new NQt(n))}async getCustomInstructionById(e,r){return(await this.listCustomInstructions(e)).find(o=>o.uri===r)}setInstructionFileLocations(e,r=Gjo){this.dispatchToSlots(e,r)}dispatchToSlots(e,r){let n=Array.isArray(e)?e:[],o=new Map;for(let s of n){let c;if(s.source===void 0)c=$h.customInstructionFiles;else if(this.slotsBySource.has(s.source))c=s.source;else{Dr.warn(this.ctx,`Ignoring instruction setting with unknown source "${String(s.source)}".`);continue}let l=o.get(c)??[];l.push(Hjo(s)),o.set(c,l)}for(let[s,c]of this.slotsBySource)c.set(o.get(s)??[],r)}setGlobalInstructionFiles(e){let r=(e??[]).map(n=>({...n,source:$h.customInstructionFiles}));this.dispatchToSlots(r,"global-instruction-files")}getGlobalInstructionFiles(){return this.inMemoryManager.get($h.customInstructionFiles)}setGlobalCopilotInstructions(e){let r=e?[{...e,source:$h.copilotInstructions}]:[];this.dispatchToSlots(r,"global-copilot-instructions")}setGlobalGitCommitInstructions(e){let r=e?[{...e,source:$h.gitCommitInstructions}]:[];this.dispatchToSlots(r,"global-git-commit-instructions")}setGlobalAgentsMdInstructions(e){let r=e?[{...e,source:$h.agentsMdInstructions}]:[];this.dispatchToSlots(r,"global-agents-md-instructions")}setGlobalClaudeMdInstructions(e){let r=e?[{...e,source:$h.claudeMdInstructions}]:[];this.dispatchToSlots(r,"global-claude-md-instructions")}async collectAllInstructions(e,r,n={},o){let s=[];for(let c of this.inMemoryManager.getAll(n))this.matchesApplyTo(c,o)&&s.push(c);for(let c of await this.listCustomInstructions(r))this.shouldIncludeRegisteredInstruction(c,n,o)&&s.push(c);return this.emitCollectedTelemetry(s,n),s}static formatInstructions(e,r={}){if(!e||e.length===0)return;let n=[];for(let s of e)s.content.trim()&&n.push(` ${s.content} `);return n.length===0?void 0:`${r.customIntroduction||"When generating code, please follow these user provided coding instructions. You can ignore an instruction if it contradicts a system message."} @@ -2569,21 +2600,21 @@ ${s.content} ${n.join(` `)} -`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=oyn(n);return o.isValid&&!!syn(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=CUt(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` -`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&CUt(o.source,r)!==void 0).length;gt(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function jQ(t,e){if(t.length==0)return new Ar([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new Ar(r)}a(jQ,"weighElidableList");p();function pyn(t){let e=t.split(` -`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([yS(o.join(` -`)),1]),o=[],r.push([new Ar([s]),1])):r.push([new Ar([s]),1]),n=!n):n?o.push(s):r.push([new Ar([s]),.8]);return n&&(r.push([yS(o.join(` -`)),1]),r.push([new Ar(["```"]),1])),new Ar(r)}a(pyn,"fromMessage");function ale(t){let e=SUt(t),r=[];for(let n=0;n`}async getInstructions(e,r,n={},o){try{let s=await this.collectAllInstructions(e,r,n,o);if(s.length===0)return;let c=n;if(!n.customIntroduction){let l=s.filter(u=>u.matchKind==="ApplyToPattern");l.length>0&&(c={...n,customIntroduction:this.buildInstructionTable(l)})}return t.formatInstructions(s,c)}catch{return}}matchesApplyTo(e,r){if(e.matchKind==="AlwaysApplied")return!0;let n=e.applyTo;if(!n)return!1;let o=u_n(n);return o.isValid&&!!d_n(r||[],o.pattern)}shouldIncludeRegisteredInstruction(e,r,n){let o=MQt(e.source,r);return o!==void 0?o:r.includeCustomInstructionFiles===!1?!1:this.matchesApplyTo(e,n)}buildInstructionTable(e){let n=["Here is a list of instruction files that contain rules for modifying or creating new code.","These files are important for ensuring that the code is modified or created correctly.","Please make sure to follow the rules specified in these files when working with the codebase.","If the file is not already available as attachment, use the `read_file` tool to acquire it.","Make sure to acquire the instructions before making any changes to the code.","| Pattern | File Path | Description |","| ------- | --------- | ----------- |"],o=e.map(s=>`| \`${s.applyTo||"*"}\` | \`${s.uri}\` | ${s.description||""} |`);return n.concat(o).join(` +`)}emitCollectedTelemetry(e,r){let n=e.filter(o=>o.source&&MQt(o.source,r)!==void 0).length;_t(this.ctx,"customization.instruction.collected",{},{workspaceInstructionCount:e.length-n,globalInstructionCount:n})}};p();p();function VQ(t,e){if(t.length==0)return new yr([]);let r=t.map((n,o)=>{let s;switch(e){case"linear":s=1-o/t.length;break;case"inverseLinear":s=(o+1)/t.length;break;case"positional":s=1/(o+1);break;case"inversePositional":s=1/(t.length-o);break}return Array.isArray(n)&&n.length==2&&(s*=n[1],n=n[0]),[n,s]});return new yr(r)}a(VQ,"weighElidableList");p();function y_n(t){let e=t.split(` +`),r=[],n=!1,o=[];for(let s of e)s.startsWith("```")?(n?(r.push([hS(o.join(` +`)),1]),o=[],r.push([new yr([s]),1])):r.push([new yr([s]),1]),n=!n):n?o.push(s):r.push([new yr([s]),.8]);return n&&(r.push([hS(o.join(` +`)),1]),r.push([new yr(["```"]),1])),new yr(r)}a(y_n,"fromMessage");function gle(t){let e=LQt(t),r=[];for(let n=0;n1&&n!==e.length-1?` -`:"")),r.push(pyn(l))}return r.length>0?new Ar([[new Ar(["Consider the following conversation history:"]),1],[jQ(r,"inverseLinear"),1]]):null}a(ale,"fromHistory");var mUo=5;function SUt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&In(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,mUo).reverse()}a(SUt,"filterTurns");function hyn(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=In(t.message).startsWith("```")?` -`:" ";return`${e>0?`${e}) `:""}${r}:${n}${In(t.message)}`}a(hyn,"formatTurnMessage");p();p();p();var gUo=4,TUt={skillIds:[]},Jze=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await Uo.getModelConfiguration(e.ctx,"meta",void 0,{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(dA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(Ye.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(Uh).inspectFetchResult(m),this.handleResult(m,f,In(c),s,d.toolConfig)}else return TUt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),TUt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,gUo);else return Ye.error(this.ctx,"Missing tool call in meta prompt response"),TUt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return ht(this.ctx,`${Hy(o)}.metaPrompt`,u,0),ht(this.ctx,`${Hy(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});ht(this.ctx,"conversation.promptContextError",n,1)}};p();p();var ZM=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new Ar([Ws(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!cle(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:yS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||cle(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new Ar([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` +`:"")),r.push(y_n(l))}return r.length>0?new yr([[new yr(["Consider the following conversation history:"]),1],[VQ(r,"inverseLinear"),1]]):null}a(gle,"fromHistory");var $jo=5;function LQt(t,e){return t.filter(n=>(n.status==="success"||n.status==="in-progress")&&Rn(n.request.message)!=""&&n.agent?.agentSlug===e).reverse().slice(0,$jo).reverse()}a(LQt,"filterTurns");function E_n(t,e=0){let r;switch(t.type){case"user":case"template":r="User";break;case"model":r="GitHub Copilot";break;default:r=t.type}let n=Rn(t.message).startsWith("```")?` +`:" ";return`${e>0?`${e}) `:""}${r}:${n}${Rn(t.message)}`}a(E_n,"formatTurnMessage");p();p();p();var Vjo=4,FQt={skillIds:[]},$Ye=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"MetaPromptFetcher")}async fetchPromptContext(e,r,n,o,s){let c=e.conversation.getLastTurn().request.message;if(r.length>0){let l=await Ro.getModelConfiguration(e.ctx,"meta",{tool_calls:!0}),u={promptType:"meta",supportedSkillDescriptors:r,modelConfiguration:l},d=await this.ctx.get(gA).toPrompt(e,u),f=o.extendedBy({messageSource:"chat.metaprompt"},{promptTokenLen:d.tokens}),h={modelConfiguration:l,messages:d.messages,uiKind:s,llmInteraction:e.toLlmInteraction()};if(d.toolConfig===void 0)throw new Error("No tool call configuration found in meta prompt.");h.tool_choice=d.toolConfig.tool_choice,h.tools=d.toolConfig.tools;let m=await this.chatFetcher.fetchResponse(h,n,f);return m.type!=="success"&&(ot.error(this.ctx,"Failed to fetch prompt context, trying again..."),m=await this.chatFetcher.fetchResponse(h,n,f)),await e.ctx.get(jh).inspectFetchResult(m),this.handleResult(m,f,Rn(c),s,d.toolConfig)}else return FQt}handleResult(e,r,n,o,s){if(e.type!=="success")return this.telemetryError(r,e),FQt;let l;if(e.toolCalls&&e.toolCalls.length>0)l=s.extractArguments(e.toolCalls[0]).skillIds?.slice(0,Vjo);else return ot.error(this.ctx,"Missing tool call in meta prompt response"),FQt;let u=r.extendedBy({uiKind:o,skillIds:l?.join(",")??""},{numTokens:e.numTokens+e.toolCalls[0].approxNumTokens}),d=u.extendedBy({messageText:n});return yt(this.ctx,`${Vy(o)}.metaPrompt`,u,0),yt(this.ctx,`${Vy(o)}.promptContext`,d,1),{skillIds:l??[]}}telemetryError(e,r){let n=e.extendedBy({resultType:r.type,reason:r.reason??""});yt(this.ctx,"conversation.promptContextError",n,1)}};p();p();var JM=class{constructor(e,r,n){this.doc=e;this.selection=r;this.visibleRange=n}static{a(this,"ElidableDocument")}fromSelectedCode(e){let r=this.getExpandedSelection(),n=r;if(e.trimNewLines){let s=this.doc.getText(r),c=s.match(/^\n*/)?.[0].length??0,l=s.match(/\n*$/)?.[0].length??0;n={start:this.getLineStart(r.start.line+c),end:this.expandLineToEnd(r.end.line-l)}}let o=new yr([sa(this.doc.getText(n)).trim()]);return[this.wrapInTicks(o),n]}fromAllCode(e){let r=this.getDocumentRange(),n=this.getExpandedSelection(),o;!this.visibleRange||!this.rangeContainedIn(this.visibleRange,n)?o=n:o={start:this.getLineStart(this.visibleRange.start.line),end:this.expandLineToEnd(this.visibleRange.end.line)};let s={start:r.start,end:o.start.line>0?this.expandLineToEnd(o.start.line-1):r.start},c={start:o.start,end:n.start.line>0&&n.start.line>o.start.line?this.expandLineToEnd(n.start.line-1):o.start},l={start:n.end.line!Ale(h)||m===1).map(([h,m])=>{let g;return e.addLineNumbers?g=this.addLineNumbers(h):g=this.doc.getText(h),[m==1?g:hS(g),m]}));return this.wrapInTicks(f)}selectionIsDocument(){return this.rangeEquals(this.getExpandedSelection(),this.getDocumentRange())}selectionIsEmpty(){return this.selection==null||Ale(this.selection)}getExpandedSelection(){return this.selection!==void 0?{start:this.getLineStart(this.selection.start.line),end:this.expandLineToEnd(this.selection.end.line)}:this.getDocumentRange()}getDocumentRange(){return{start:this.getLineStart(0),end:this.expandLineToEnd(this.doc.lineCount-1)}}getLineStart(e){return{line:e,character:0}}expandLineToEnd(e){return e>this.doc.lineCount-1&&(e=this.doc.lineCount-1),{line:e,character:this.doc.lineAt({line:e,character:0}).text.length}}rangeContainedIn(e,r){return e.start.line<=r.start.line&&e.end.line>=r.end.line}rangeEquals(e,r){return e.start.line==r.start.line&&e.end.line==r.end.line}wrapInTicks(e,r){return new yr([["```"+this.doc.detectedLanguageId,1],[e,r??1],["```",1]])}addLineNumbers(e){let r=this.doc.getText(e).split(` `),n=this.doc.lineCount.toString().length;return r.map((s,c)=>`${(e.start.line+c+1).toString().padEnd(n," ")}:${s}`).join(` -`)}};function cle(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(cle,"isEmptyRange");p();p();var myn=ce(ti()),gyn=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),IUt;(r=>(r.method="github/didChangeAuth",r.type=new myn.ProtocolNotificationType(r.method)))(IUt||={});p();var Ayn=ce(ti()),xUt;(r=>(r.method="copilot/ipCodeCitation",r.type=new Ayn.NotificationType(r.method)))(xUt||={});p();var yyn=ce(ti()),Zze;(r=>(r.method="context/update",r.type=new yyn.ProtocolRequestType(r.method)))(Zze||={});p();p();p();var qn=ce(ti()),dIe=S.String(),Rv=S.Object({uri:dIe}),nK=S.Intersect([Rv,S.Object({version:S.Optional(S.Integer())})]),gWu=S.Required(nK),rg=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),hf=S.Object({start:rg,end:rg}),wUt=S.Union([S.Integer(),S.String()]),AWu=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var Eyn=ce(ti()),RUt;(r=>(r.method="textDocument/didFocus",r.type=new Eyn.ProtocolNotificationType(r.method)))(RUt||={});p();var AUo=S.Object({didChangeFeatureFlags:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),yUo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),_yn=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),Cyn=S.Object({editorInfo:S.Optional(_yn),editorPluginInfo:S.Optional(_yn),relatedPluginInfo:S.Optional(S.Array(yUo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(AUo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var fIe=ce(ti());var kUt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(kUt||{}),EUo=S.Enum(kUt),_Uo=S.Object({triggerKind:EUo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:hf,tooltipSignature:S.Optional(S.String())}))}),vyn=S.Object({textDocument:nK,position:rg,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:_Uo,data:S.Optional(S.Unknown())}),PUt;(r=>(r.method="textDocument/inlineCompletion",r.type=new fIe.ProtocolRequestType(r.method)))(PUt||={});var byn=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Syn=S.Object({item:byn}),DUt;(r=>(r.method="textDocument/didShowCompletion",r.type=new fIe.ProtocolNotificationType(r.method)))(DUt||={});var Tyn=S.Object({item:byn,acceptedLength:S.Integer({minimum:1})}),NUt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new fIe.ProtocolNotificationType(r.method)))(NUt||={});p();var Iyn=ce(ti()),CUo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new Iyn.ProtocolRequestType(r.method)))(CUo||={});p();var xyn=ce(ti()),vUo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:hf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),wyn=S.Object({textDocument:nK,position:rg,diagnostics:S.Optional(S.Array(vUo))}),bUo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),Ryn=S.Object({item:bUo}),MUt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new xyn.ProtocolNotificationType(r.method)))(MUt||={});p();var Xze=ce(ti());var kyn=S.Object({textDocument:nK,position:rg,partialResultToken:S.Optional(wUt),workDoneToken:S.Optional(wUt)}),eYe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new Xze.ProtocolRequestType(n.method),n.partialResult=new Xze.ProgressType))(eYe||={});p();var Pyn=ce(ti()),OUt;(r=>(r.method="copilot/related",r.type=new Pyn.ProtocolRequestType(r.method)))(OUt||={});p();var BUt=ce(ti()),LUt;(r=>(r.method="statusNotification",r.type=new BUt.ProtocolNotificationType(r.method)))(LUt||={});var FUt;(r=>(r.method="didChangeStatus/v2",r.type=new BUt.ProtocolNotificationType(r.method)))(FUt||={});var Dyn=ce(require("path"));var Nyn=S.Object({uri:S.String(),visibleRange:S.Optional(hf),selection:S.Optional(hf)}),UUt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument(e),o=zu(n);if(await this.turnContext.collectFile(Vy,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new ZM(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new Ar([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(cle(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new Ar([...u,...d])}else if(n.status==="invalid")return new Ar([`The currently open file \`${Dyn.basename(e.uri)}\` is content excluded.`])}},Vy="current-editor",tYe=class{constructor(e){this._resolver=e;this.id=Vy;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new UUt(e)}};p();var Myn=S.Object({labels:S.Array(S.String())}),QUt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new Ar(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new Ar([`- ${n}`]),.9]),this.turnContext.collectLabel(EP,n)}),new Ar(r)}},EP="project-labels",rYe=class{constructor(e){this._resolver=e;this.id=EP;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new QUt(e)}};p();p();p();var nYe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return be(e,r,"org.springframework.boot","Spring Boot"),be(e,r,"jakarta.jakartaee-api","Jakarta EE"),be(e,r,"javax:javaee-api","Java EE"),be(e,r,"org.apache.struts:struts2-core","Apache Struts"),be(e,r,"org.hibernate:hibernate-core","Hibernate"),be(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),be(e,r,"javax.faces:jsf-api","JSF"),be(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return be(e,r,"com.google.guava","Google Guava"),be(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),be(e,r,"org.apache.commons:commons-io","Apache Commons IO"),be(e,r,"joda-time:joda-time","Joda-Time"),be(e,r,"com.google.code.gson:gson","Google Gson"),be(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),be(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),be(e,r,"org.apache.commons:commons-net","Apache Commons Net"),be(e,r,"org.apache.poi:poi","Apache POI"),be(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),be(e,r,"junit:junit","JUnit"),be(e,r,"org.testng:testng","TestNG"),be(e,r,"org.spockframework:spock-core","Spock"),be(e,r,"io.cucumber:cucumber-java","Cucumber"),be(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return be(e,r,"org.mockito","Mockito"),be(e,r,"org.assertj","AssertJ"),be(e,r,"org.hamcrest","Hamcrest"),be(e,r,"org.powermock","PowerMock"),be(e,r,"org.jmock","JMock"),be(e,r,"org.easymock","EasyMock"),be(e,r,"org.jmockit:jmockit","JMockit"),be(e,r,"com.github.tomakehurst:wiremock","WireMock"),be(e,r,"org.dbunit:dbunit","DBUnit"),be(e,r,"com.icegreen:greenmail","GreenMail"),be(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),be(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),be(e,r,"io.rest-assured:rest-assured","Rest-Assured"),be(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),be(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},iYe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"@types/node","Node.js"),be(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||be(e,r,"react","React"),be(e,r,"angular","Angular"),be(e,r,"vue","Vue.js"),be(e,r,"ember","Ember.js"),be(e,r,"backbone","Backbone.js"),be(e,r,"meteor","Meteor"),be(e,r,"polymer","Polymer"),be(e,r,"aurelia","Aurelia"),be(e,r,"knockout","Knockout.js"),be(e,r,"dojo","Dojo Toolkit"),be(e,r,"mithril","Mithril.js"),be(e,r,"marionette","Marionette.js"),be(e,r,"marko","Marko.js"),be(e,r,"svelte","Svelte"),be(e,r,"hyperapp","Hyperapp"),be(e,r,"inferno","Inferno.js"),be(e,r,"preact","Preact"),be(e,r,"riot","Riot.js"),be(e,r,"moon","Moon.js"),be(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return be(e,r,"lodash","Lodash"),be(e,r,"moment","Moment.js"),be(e,r,"axios","Axios"),be(e,r,"redux","Redux"),be(e,r,"recoil","Recoil"),be(e,r,"jquery","jQuery"),be(e,r,"d3","D3.js"),be(e,r,"underscore","Underscore.js"),be(e,r,"ramda","Ramda"),be(e,r,"immutable","Immutable.js"),be(e,r,"rxjs","RxJS"),be(e,r,"three","Three.js"),be(e,r,"socket.io","Socket.IO"),be(e,r,"express","Express.js"),be(e,r,"next","Next.js"),be(e,r,"puppeteer","Puppeteer"),be(e,r,"cheerio","Cheerio"),be(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"jest","Jest"),be(e,r,"mocha","Mocha"),be(e,r,"jasmine","Jasmine"),be(e,r,"ava","AVA"),be(e,r,"qunit","QUnit"),be(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return be(e,r,"chai","Chai"),be(e,r,"sinon","Sinon"),be(e,r,"enzyme","Enzyme"),be(e,r,"protractor","Protractor"),be(e,r,"supertest","Supertest"),be(e,r,"nock","Nock"),be(e,r,"cypress","Cypress"),be(e,r,"@testing-library/react","React Testing Library"),r}},oYe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"github.com/gorilla/mux","Gorilla Mux"),be(e,r,"github.com/go-chi/chi","Chi"),be(e,r,"github.com/gin-gonic/gin","Gin"),be(e,r,"github.com/labstack/echo","Echo"),be(e,r,"github.com/revel/revel","Revel"),be(e,r,"github.com/astaxie/beego","Beego"),be(e,r,"github.com/go-martini/martini","Martini"),be(e,r,"github.com/gobuffalo/buffalo","Buffalo"),be(e,r,"github.com/goji/goji","Goji"),be(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return be(e,r,"net/http","net/http"),be(e,r,"fmt","fmt"),be(e,r,"io","io"),be(e,r,"time","time"),be(e,r,"math","math"),be(e,r,"strconv","strconv"),be(e,r,"strings","strings"),be(e,r,"sort","sort"),be(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"github.com/onsi/ginkgo","ginkgo"),be(e,r,"github.com/onsi/gomega","gomega"),be(e,r,"github.com/stretchr/testify","testify"),be(e,r,"gopkg.in/check.v1","gocheck"),be(e,r,"github.com/franela/goblin","goblin"),be(e,r,"github.com/DATA-DOG/godog","godog"),be(e,r,"github.com/stesla/gospec","gospec"),be(e,r,"github.com/rjeczalik/gotest","gotest"),be(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return be(e,r,"github.com/stretchr/testify","Testify"),be(e,r,"github.com/smartystreets/goconvey","GoConvey"),be(e,r,"github.com/onsi/ginkgo","Ginkgo"),be(e,r,"github.com/golang/mock","GoMock"),be(e,r,"gopkg.in/check.v1","GoCheck"),be(e,r,"github.com/franela/goblin","Goblin"),be(e,r,"github.com/DATA-DOG/godog","GoDog"),be(e,r,"github.com/onsi/gomega","Gomega"),be(e,r,"github.com/stesla/gospec","GoSpec"),be(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},sYe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"flask","Flask"),be(e,r,"django","Django"),be(e,r,"pyramid","Pyramid"),be(e,r,"tornado","Tornado"),be(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return be(e,r,"requests","requests"),be(e,r,"numpy","numpy"),be(e,r,"pandas","pandas"),be(e,r,"scipy","scipy"),be(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"pytest","Pytest"),be(e,r,"unittest","Unittest"),be(e,r,"doctest","Doctest"),be(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mock","Mock"),be(e,r,"hypothesis","Hypothesis"),be(e,r,"behave","Behave"),be(e,r,"lettuce","Lettuce"),be(e,r,"testify","Testify"),be(e,r,"pyhamcrest","PyHamcrest"),r}},aYe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"laravel/framework","Laravel"),be(e,r,"symfony/symfony","Symfony"),be(e,r,"slim/slim","Slim"),be(e,r,"cakephp/cakephp","CakePHP"),be(e,r,"yiisoft/yii2","Yii"),be(e,r,"zendframework/zendframework","Zend Framework"),be(e,r,"phalcon/cphalcon","Phalcon"),be(e,r,"bcosca/fatfree","Fat-Free"),be(e,r,"fuel/fuel","FuelPHP"),be(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return be(e,r,"monolog/monolog","Monolog"),be(e,r,"vlucas/phpdotenv","PHP dotenv"),be(e,r,"symfony/console","Symfony Console"),be(e,r,"guzzlehttp/guzzle","GuzzleHttp"),be(e,r,"ramsey/uuid","Ramsey UUID"),be(e,r,"doctrine/orm","Doctrine ORM"),be(e,r,"php-di/php-di","PHP-DI"),be(e,r,"phpunit/php-timer","PHPUnit Timer"),be(e,r,"symfony/finder","Symfony Finder"),be(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"phpunit/phpunit","PHPUnit"),be(e,r,"behat/behat","Behat"),be(e,r,"phpspec/phpspec","PHPSpec"),be(e,r,"codeception/codeception","Codeception"),be(e,r,"atoum/atoum","Atoum"),be(e,r,"pestphp/pest","PestPHP"),be(e,r,"kahlan/kahlan","Kahlan"),be(e,r,"peridot-php/peridot","Peridot"),be(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockery/mockery","Mockery"),be(e,r,"php-mock/php-mock","PHP-Mock"),be(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),be(e,r,"padraic/mockery","Padraic Mockery"),be(e,r,"phpspec/prophecy","PHPSpec Prophecy"),be(e,r,"phpunit/php-invoker","PHPUnit Invoker"),be(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),be(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),be(e,r,"phpunit/php-timer","PHPUnit Timer"),be(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},cYe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"Microsoft.NETCore.App",".NET Core"),be(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return be(e,r,"EntityFramework","Entity Framework"),be(e,r,"Newtonsoft.Json","Newtonsoft.Json"),be(e,r,"AutoMapper","AutoMapper"),be(e,r,"Serilog","Serilog"),be(e,r,"Dapper","Dapper"),be(e,r,"Polly","Polly"),be(e,r,"FluentValidation","FluentValidation"),be(e,r,"MediatR","MediatR"),be(e,r,"Hangfire","Hangfire"),be(e,r,"RabbitMQ.Client","RabbitMQ.Client"),be(e,r,"MassTransit","MassTransit"),be(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),be(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),be(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),be(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"xunit","xUnit"),be(e,r,"NUnit","NUnit"),be(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return be(e,r,"Moq","Moq"),be(e,r,"FluentAssertions","FluentAssertions"),be(e,r,"Bogus","Bogus"),be(e,r,"RestSharp","RestSharp"),be(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},lYe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"flutter","Flutter"),be(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return be(e,r,"dartx","dartx"),be(e,r,"provider","Provider"),be(e,r,"rxdart","RxDart"),be(e,r,"dio","Dio"),be(e,r,"json_serializable","json_serializable"),be(e,r,"freezed","Freezed"),be(e,r,"moor","Moor"),be(e,r,"hive","Hive"),be(e,r,"http","http"),be(e,r,"path","path"),be(e,r,"intl","intl"),be(e,r,"equatable","equatable"),be(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"test","test"),be(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockito","mockito"),be(e,r,"bloc_test","bloc_test"),r}},uYe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"rails","Rails"),be(e,r,"sinatra","Sinatra"),be(e,r,"hanami","Hanami"),be(e,r,"grape","Grape"),be(e,r,"roda","Roda"),be(e,r,"padrino","Padrino"),be(e,r,"cuba","Cuba"),be(e,r,"ramaze","Ramaze"),be(e,r,"nyara","Nyara"),be(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return be(e,r,"active_record","ActiveRecord"),be(e,r,"sequel","Sequel"),be(e,r,"rom","ROM"),be(e,r,"datamapper","DataMapper"),be(e,r,"mongoid","Mongoid"),be(e,r,"neo4j","Neo4j"),be(e,r,"redis","Redis"),be(e,r,"cassandra","Cassandra"),be(e,r,"couchrest","CouchRest"),be(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"rspec","RSpec"),be(e,r,"minitest","Minitest"),be(e,r,"cucumber","Cucumber"),be(e,r,"spinach","Spinach"),be(e,r,"turnip","Turnip"),be(e,r,"bacon","Bacon"),be(e,r,"shoulda","Shoulda"),be(e,r,"test-unit","Test::Unit"),be(e,r,"wrong","Wrong"),be(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return be(e,r,"factory_bot","FactoryBot"),be(e,r,"faker","Faker"),be(e,r,"ffaker","FFaker"),be(e,r,"fabrication","Fabrication"),be(e,r,"machinist","Machinist"),be(e,r,"mocha","Mocha"),be(e,r,"flexmock","FlexMock"),be(e,r,"rr","RR"),be(e,r,"bourne","Bourne"),be(e,r,"not_a_mock","NotAMock"),r}},dYe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return be(e,r,"tokio","tokio"),be(e,r,"async-std","async-std"),be(e,r,"hyper","hyper"),be(e,r,"actix-web","actix-web"),be(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return be(e,r,"serde","serde"),be(e,r,"regex","regex"),be(e,r,"rand","rand"),be(e,r,"log","log"),be(e,r,"lazy_static","lazy_static"),be(e,r,"libc","libc"),be(e,r,"futures","futures"),be(e,r,"rayon","rayon"),be(e,r,"reqwest","reqwest"),be(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return be(e,r,"test-case","test-case"),be(e,r,"proptest","proptest"),be(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return be(e,r,"mockall","mockall"),be(e,r,"double","double"),be(e,r,"rstest","rstest"),be(e,r,"mockiato","mockiato"),be(e,r,"mock_derive","mock_derive"),be(e,r,"mocktopus","mocktopus"),be(e,r,"mockers","mockers"),be(e,r,"mock_it","mock_it"),r}},fYe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function be(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(be,"addFromLibraries");var pYe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function Byn(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(Byn,"determineProgrammingLanguage");var Oyn=[new nYe,new iYe,new oYe,new sYe,new aYe,new cYe,new lYe,new uYe,new dYe,new fYe];function Lyn(t){let e=Oyn.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new pYe(t,Oyn);return new qUt(e)}a(Lyn,"getMetadataLookup");var qUt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var Fyn=S.Object({name:S.String(),version:S.Optional(S.String())}),Uyn=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(Fyn),buildTools:S.Array(Fyn)}),jUt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new Ar([`The user is working on a project with the following characteristics: -`]),1]);let n=Lyn(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new Ar(r)}addProgrammingLanguage(e,r){let n=Byn(e);this.turnContext.collectLabel(XM,n),r.push([new Ar([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(XM,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` -`);e.push([new Ar([`${r} -${o}`]),1])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;this.id=XM;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new jUt(e)}};p();var Qyn=ce(require("path"));var HUt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new Ar(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new Ar(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=zu(n);if(await this.turnContext.collectFile(gYe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new ZM(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new Ar([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new Ar([`The referenced file \`${Qyn.basename(r.uri)}\` is content excluded.`]),1]]}},GUt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},gYe="references",mYe=class{constructor(){this.id=gYe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new GUt}processor(e){return new HUt(e)}};var iK=a(()=>[XM,EP,gYe,Vy],"mandatorySkills"),lle=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new Jze(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!iK().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!iK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!iK().includes(d)))}return l.push(...iK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Vo).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Vo).getSupportedSkills(r.id),c=e.get(Qh).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await Px(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...iK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function yYe(t,e){let[r,n,o]=await SUo(t,e);return o.push(...xUo(t)),r.length>0||n.length>0?[new Ar([[new Ar(["Consider the additional context:"]),1],[jQ(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(yYe,"fromSkills");async function SUo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await wUo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await TUo(t,c.skillId);l&&(iK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(SUo,"handleSkillsInReverse");async function TUo(t,e){let n=t.ctx.get(Qh).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await IUo(t,n,l,d,c,f):[void 0,await AYe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await AYe(t,n,"unresolvable",void 0,c)]}catch(o){if(Ye.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof pIe)throw o;return[void 0,await AYe(t,n,"failed")]}}a(TUo,"safelyProcessSkill");async function IUo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new Ar([[n,1]]):c=n,[[c,r?.value()||0],await AYe(t,e,"resolved",c,o,s)]}a(IUo,"handleProcessedSkill");async function AYe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await FQ(t.ctx),f=await t.ctx.get(Bc).getBestChatModelConfig(hS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Ss(f.tokenizer).tokenLength(h)}return t.ctx.get(eg).addResolution(t.turn.id,u),u}a(AYe,"determineResolution");function xUo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(xUo,"handleIgnoredSkills");async function wUo(t,e,r){if(e!==XM&&e!==EP)return!0;let n=t.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===XM:e===EP}a(wUo,"includeSkill");var oK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=ale(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new Ar(n),c]}async elidableSkills(e,r){return await yYe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:qt(e.ctx,je.UseAgentsMd),includeNestedAgentsMdInstructions:qt(e.ctx,je.UseNestedAgentsMd),includeClaudeMdInstructions:qt(e.ctx,je.UseClaudeMd),includeNestedClaudeMdInstructions:qt(e.ctx,je.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(pf).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(pf).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=RS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` +`)}};function Ale(t){return t.start.line==t.end.line&&t.start.character==t.end.character}a(Ale,"isEmptyRange");p();p();var __n=fe(ei()),v_n=S.Object({accessToken:S.Optional(S.String({minLength:1})),handle:S.Optional(S.String({minLength:1})),login:S.Optional(S.String({minLength:1})),githubAppId:S.Optional(S.String({minLength:1})),apiUrl:S.Optional(S.String({})),serverUrl:S.Optional(S.String({})),tokenEndpoint:S.Optional(S.String({}))}),UQt;(r=>(r.method="github/didChangeAuth",r.type=new __n.ProtocolNotificationType(r.method)))(UQt||={});p();var C_n=fe(ei()),QQt;(r=>(r.method="copilot/ipCodeCitation",r.type=new C_n.NotificationType(r.method)))(QQt||={});p();var b_n=fe(ei()),VYe;(r=>(r.method="context/update",r.type=new b_n.ProtocolRequestType(r.method)))(VYe||={});p();p();p();var jn=fe(ei()),EIe=S.String(),RC=S.Object({uri:EIe}),sK=S.Intersect([RC,S.Object({version:S.Optional(S.Integer())})]),pYu=S.Required(sK),K0=S.Object({line:S.Integer({minimum:0}),character:S.Integer({minimum:0})}),pf=S.Object({start:K0,end:K0}),qQt=S.Union([S.Integer(),S.String()]),hYu=S.Object({isCancellationRequested:S.Boolean(),onCancellationRequested:S.Any()});p();var S_n=fe(ei()),jQt;(r=>(r.method="textDocument/didFocus",r.type=new S_n.ProtocolNotificationType(r.method)))(jQt||={});p();var Wjo=S.Object({didChangeFeatureFlags:S.Boolean(),fetch:S.Boolean(),ipCodeCitation:S.Boolean(),redirectedTelemetry:S.Boolean(),related:S.Boolean(),token:S.Boolean(),watchedFiles:S.Boolean(),showPanelMessage:S.Boolean(),mcpElicitation:S.Boolean(),mcpSampling:S.Boolean(),mcpAllowlist:S.Boolean(),stateDatabase:S.Boolean(),subAgent:S.Boolean(),mcpServerManagement:S.Boolean(),cveRemediatorAgent:S.Boolean(),debuggerAgent:S.Boolean(),contentProvider:S.Array(S.String()),manageTodoListTool:S.Boolean(),agentDebugLog:S.Boolean(),accountPickerEnabled:S.Boolean()}),zjo=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),T_n=S.Object({name:S.String(),version:S.Optional(S.String()),readableName:S.Optional(S.String())}),I_n=S.Object({editorInfo:S.Optional(T_n),editorPluginInfo:S.Optional(T_n),relatedPluginInfo:S.Optional(S.Array(zjo)),copilotIntegrationId:S.Optional(S.String()),copilotCapabilities:S.Optional(S.Partial(Wjo)),githubAppId:S.Optional(S.String()),sessionId:S.Optional(S.String())});p();var _Ie=fe(ei());var HQt=(r=>(r[r.Invoked=1]="Invoked",r[r.Automatic=2]="Automatic",r))(HQt||{}),Yjo=S.Enum(HQt),Kjo=S.Object({triggerKind:Yjo,selectedCompletionInfo:S.Optional(S.Object({text:S.String(),range:pf,tooltipSignature:S.Optional(S.String())}))}),x_n=S.Object({textDocument:sK,position:K0,formattingOptions:S.Optional(S.Object({tabSize:S.Optional(S.Union([S.Integer({minimum:1}),S.String()])),insertSpaces:S.Optional(S.Union([S.Boolean(),S.String()]))})),context:Kjo,data:S.Optional(S.Unknown())}),GQt;(r=>(r.method="textDocument/inlineCompletion",r.type=new _Ie.ProtocolRequestType(r.method)))(GQt||={});var w_n=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),R_n=S.Object({item:w_n}),$Qt;(r=>(r.method="textDocument/didShowCompletion",r.type=new _Ie.ProtocolNotificationType(r.method)))($Qt||={});var P_n=S.Object({item:w_n,acceptedLength:S.Integer({minimum:1})}),VQt;(r=>(r.method="textDocument/didPartiallyAcceptCompletion",r.type=new _Ie.ProtocolNotificationType(r.method)))(VQt||={});p();var k_n=fe(ei()),Jjo;(r=>(r.method="textDocument/inlineCompletionPrompt",r.type=new k_n.ProtocolRequestType(r.method)))(Jjo||={});p();var D_n=fe(ei()),Zjo=S.Object({severity:S.Union([S.Literal("error"),S.Literal("warning")]),message:S.String(),range:pf,code:S.Optional(S.Union([S.String(),S.Number()])),source:S.Optional(S.String())}),N_n=S.Object({textDocument:sK,position:K0,diagnostics:S.Optional(S.Array(Zjo))}),Xjo=S.Object({command:S.Object({arguments:S.Tuple([S.String({minLength:1})])})}),M_n=S.Object({item:Xjo}),WQt;(r=>(r.method="textDocument/didShowInlineEdit",r.type=new D_n.ProtocolNotificationType(r.method)))(WQt||={});p();var WYe=fe(ei());var O_n=S.Object({textDocument:sK,position:K0,partialResultToken:S.Optional(qQt),workDoneToken:S.Optional(qQt)}),zYe;(n=>(n.method="textDocument/copilotPanelCompletion",n.type=new WYe.ProtocolRequestType(n.method),n.partialResult=new WYe.ProgressType))(zYe||={});p();var B_n=fe(ei()),zQt;(r=>(r.method="copilot/related",r.type=new B_n.ProtocolRequestType(r.method)))(zQt||={});p();var YQt=fe(ei()),KQt;(r=>(r.method="statusNotification",r.type=new YQt.ProtocolNotificationType(r.method)))(KQt||={});var JQt;(r=>(r.method="didChangeStatus/v2",r.type=new YQt.ProtocolNotificationType(r.method)))(JQt||={});var L_n=fe(require("path"));var F_n=S.Object({uri:S.String(),visibleRange:S.Optional(pf),selection:S.Optional(pf)}),ZQt=class{constructor(e){this.turnContext=e}static{a(this,"CurrentEditorSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ri),n=await r.getOrReadTextDocument(e),o=Ku(n);if(await this.turnContext.collectFile(zy,e.uri,o),n.status==="valid"){let s=this.turnContext.conversation.source==="inline",c=new JM(n.document,e.selection,e.visibleRange),l=r.getRelativePath(n.document);if(o==="empty")return new yr([`The currently open file \`${l}\` is empty.`]);let u=[[`Code excerpt from the currently open file \`${l}\`:`,1],[c.fromAllCode({addLineNumbers:s}),1]],d=[];if(c.selectionIsDocument())d=[["The user is selecting the entire file.",1]];else if(s){let[f,h]=c.fromSelectedCode({trimNewLines:!0}),m=h.start.line+1;if(Ale(h))d=[[`The user is selecting line ${m}, which is empty.`,1]];else{let g=h.end.line+1;d=[["The user is selecting"+(m==g?` line ${m}:`:` lines ${m} to ${g} (inclusive):`),1],[f,1]]}}else c.selectionIsEmpty()||(d=[["The user is selecting this code:",1],[c.fromSelectedCode({trimNewLines:!1})[0],1]]);return new yr([...u,...d])}else if(n.status==="invalid")return new yr([`The currently open file \`${L_n.basename(e.uri)}\` is content excluded.`])}},zy="current-editor",YYe=class{constructor(e){this._resolver=e;this.id=zy;this.type="explicit"}static{a(this,"CurrentEditorSkill")}description(){return"The code from the user's currently open file"}resolver(){return this._resolver}processor(e){return new ZQt(e)}};p();var U_n=S.Object({labels:S.Array(S.String())}),XQt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectLabelsSkillProcessor")}value(){return 1}processSkill(e){let r=[];return r.push([new yr(["The developer is working on a project with the following characteristics (languages, frameworks):"]),1]),e.labels.forEach(n=>{r.push([new yr([`- ${n}`]),.9]),this.turnContext.collectLabel(Ck,n)}),new yr(r)}},Ck="project-labels",KYe=class{constructor(e){this._resolver=e;this.id=Ck;this.type="explicit"}static{a(this,"ProjectLabelsSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new XQt(e)}};p();p();p();var JYe=class{constructor(){this.languageId=["java","kotlin","scala","groovy"]}static{a(this,"JavaProjectMetadataLookup")}determineBuildTools(e){return[...e.buildTools]}determineApplicationFrameworks(e){let r=[];return De(e,r,"org.springframework.boot","Spring Boot"),De(e,r,"jakarta.jakartaee-api","Jakarta EE"),De(e,r,"javax:javaee-api","Java EE"),De(e,r,"org.apache.struts:struts2-core","Apache Struts"),De(e,r,"org.hibernate:hibernate-core","Hibernate"),De(e,r,"org.apache.wicket:wicket-core","Apache Wicket"),De(e,r,"javax.faces:jsf-api","JSF"),De(e,r,"org.grails:grails-core","Grails"),r}determineCoreLibraries(e){let r=[];return De(e,r,"com.google.guava","Google Guava"),De(e,r,"org.apache.commons:commons-lang3","Apache Commons Lang"),De(e,r,"org.apache.commons:commons-io","Apache Commons IO"),De(e,r,"joda-time:joda-time","Joda-Time"),De(e,r,"com.google.code.gson:gson","Google Gson"),De(e,r,"org.apache.commons:commons-math3","Apache Commons Math"),De(e,r,"org.apache.commons:commons-collections4","Apache Commons Collections"),De(e,r,"org.apache.commons:commons-net","Apache Commons Net"),De(e,r,"org.apache.poi:poi","Apache POI"),De(e,r,"com.fasterxml.jackson.core:jackson-databind","Jackson"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"org.junit.jupiter:junit-jupiter","JUnit"),De(e,r,"junit:junit","JUnit"),De(e,r,"org.testng:testng","TestNG"),De(e,r,"org.spockframework:spock-core","Spock"),De(e,r,"io.cucumber:cucumber-java","Cucumber"),De(e,r,"org.jboss.arquillian.junit:arquillian-junit-container","Arquillian"),r}determineTestingLibraries(e){let r=[];return De(e,r,"org.mockito","Mockito"),De(e,r,"org.assertj","AssertJ"),De(e,r,"org.hamcrest","Hamcrest"),De(e,r,"org.powermock","PowerMock"),De(e,r,"org.jmock","JMock"),De(e,r,"org.easymock","EasyMock"),De(e,r,"org.jmockit:jmockit","JMockit"),De(e,r,"com.github.tomakehurst:wiremock","WireMock"),De(e,r,"org.dbunit:dbunit","DBUnit"),De(e,r,"com.icegreen:greenmail","GreenMail"),De(e,r,"net.sourceforge.htmlunit:htmlunit","HtmlUnit"),De(e,r,"org.seleniumhq.selenium:selenium-java","Selenium"),De(e,r,"io.rest-assured:rest-assured","Rest-Assured"),De(e,r,"io.gatling.highcharts:gatling-charts-highcharts","Gatling"),De(e,r,"org.apache.jmeter:ApacheJMeter","JMeter"),r}},ZYe=class{constructor(){this.languageId=["javascript","javascriptreact","typescript","typescriptreact","vue"]}static{a(this,"JavaScriptProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"@types/node","Node.js"),De(e,r,"react-native","React Native"),r.find(n=>n.name==="React Native")||De(e,r,"react","React"),De(e,r,"angular","Angular"),De(e,r,"vue","Vue.js"),De(e,r,"ember","Ember.js"),De(e,r,"backbone","Backbone.js"),De(e,r,"meteor","Meteor"),De(e,r,"polymer","Polymer"),De(e,r,"aurelia","Aurelia"),De(e,r,"knockout","Knockout.js"),De(e,r,"dojo","Dojo Toolkit"),De(e,r,"mithril","Mithril.js"),De(e,r,"marionette","Marionette.js"),De(e,r,"marko","Marko.js"),De(e,r,"svelte","Svelte"),De(e,r,"hyperapp","Hyperapp"),De(e,r,"inferno","Inferno.js"),De(e,r,"preact","Preact"),De(e,r,"riot","Riot.js"),De(e,r,"moon","Moon.js"),De(e,r,"stencil","Stencil.js"),r}determineCoreLibraries(e){let r=[];return De(e,r,"lodash","Lodash"),De(e,r,"moment","Moment.js"),De(e,r,"axios","Axios"),De(e,r,"redux","Redux"),De(e,r,"recoil","Recoil"),De(e,r,"jquery","jQuery"),De(e,r,"d3","D3.js"),De(e,r,"underscore","Underscore.js"),De(e,r,"ramda","Ramda"),De(e,r,"immutable","Immutable.js"),De(e,r,"rxjs","RxJS"),De(e,r,"three","Three.js"),De(e,r,"socket.io","Socket.IO"),De(e,r,"express","Express.js"),De(e,r,"next","Next.js"),De(e,r,"puppeteer","Puppeteer"),De(e,r,"cheerio","Cheerio"),De(e,r,"nodemailer","Nodemailer"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"jest","Jest"),De(e,r,"mocha","Mocha"),De(e,r,"jasmine","Jasmine"),De(e,r,"ava","AVA"),De(e,r,"qunit","QUnit"),De(e,r,"tape","Tape"),r}determineTestingLibraries(e){let r=[];return De(e,r,"chai","Chai"),De(e,r,"sinon","Sinon"),De(e,r,"enzyme","Enzyme"),De(e,r,"protractor","Protractor"),De(e,r,"supertest","Supertest"),De(e,r,"nock","Nock"),De(e,r,"cypress","Cypress"),De(e,r,"@testing-library/react","React Testing Library"),r}},XYe=class{constructor(){this.languageId="go"}static{a(this,"GoProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"github.com/gorilla/mux","Gorilla Mux"),De(e,r,"github.com/go-chi/chi","Chi"),De(e,r,"github.com/gin-gonic/gin","Gin"),De(e,r,"github.com/labstack/echo","Echo"),De(e,r,"github.com/revel/revel","Revel"),De(e,r,"github.com/astaxie/beego","Beego"),De(e,r,"github.com/go-martini/martini","Martini"),De(e,r,"github.com/gobuffalo/buffalo","Buffalo"),De(e,r,"github.com/goji/goji","Goji"),De(e,r,"github.com/hoisie/web","Web.go"),r}determineCoreLibraries(e){let r=[];return De(e,r,"net/http","net/http"),De(e,r,"fmt","fmt"),De(e,r,"io","io"),De(e,r,"time","time"),De(e,r,"math","math"),De(e,r,"strconv","strconv"),De(e,r,"strings","strings"),De(e,r,"sort","sort"),De(e,r,"encoding/json","encoding/json"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"github.com/onsi/ginkgo","ginkgo"),De(e,r,"github.com/onsi/gomega","gomega"),De(e,r,"github.com/stretchr/testify","testify"),De(e,r,"gopkg.in/check.v1","gocheck"),De(e,r,"github.com/franela/goblin","goblin"),De(e,r,"github.com/DATA-DOG/godog","godog"),De(e,r,"github.com/stesla/gospec","gospec"),De(e,r,"github.com/rjeczalik/gotest","gotest"),De(e,r,"github.com/smartystreets/goconvey","goconvey"),r}determineTestingLibraries(e){let r=[];return De(e,r,"github.com/stretchr/testify","Testify"),De(e,r,"github.com/smartystreets/goconvey","GoConvey"),De(e,r,"github.com/onsi/ginkgo","Ginkgo"),De(e,r,"github.com/golang/mock","GoMock"),De(e,r,"gopkg.in/check.v1","GoCheck"),De(e,r,"github.com/franela/goblin","Goblin"),De(e,r,"github.com/DATA-DOG/godog","GoDog"),De(e,r,"github.com/onsi/gomega","Gomega"),De(e,r,"github.com/stesla/gospec","GoSpec"),De(e,r,"github.com/rjeczalik/gotest","GoTest"),r}},eKe=class{constructor(){this.languageId=["python","jupyter"]}static{a(this,"PythonProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flask","Flask"),De(e,r,"django","Django"),De(e,r,"pyramid","Pyramid"),De(e,r,"tornado","Tornado"),De(e,r,"fastapi","FastAPI"),r}determineCoreLibraries(e){let r=[];return De(e,r,"requests","requests"),De(e,r,"numpy","numpy"),De(e,r,"pandas","pandas"),De(e,r,"scipy","scipy"),De(e,r,"matplotlib","matplotlib"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"pytest","Pytest"),De(e,r,"unittest","Unittest"),De(e,r,"doctest","Doctest"),De(e,r,"nose","Nose"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mock","Mock"),De(e,r,"hypothesis","Hypothesis"),De(e,r,"behave","Behave"),De(e,r,"lettuce","Lettuce"),De(e,r,"testify","Testify"),De(e,r,"pyhamcrest","PyHamcrest"),r}},tKe=class{constructor(){this.languageId=["php","blade"]}static{a(this,"PhpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"laravel/framework","Laravel"),De(e,r,"symfony/symfony","Symfony"),De(e,r,"slim/slim","Slim"),De(e,r,"cakephp/cakephp","CakePHP"),De(e,r,"yiisoft/yii2","Yii"),De(e,r,"zendframework/zendframework","Zend Framework"),De(e,r,"phalcon/cphalcon","Phalcon"),De(e,r,"bcosca/fatfree","Fat-Free"),De(e,r,"fuel/fuel","FuelPHP"),De(e,r,"phpixie/framework","PHPixie"),r}determineCoreLibraries(e){let r=[];return De(e,r,"monolog/monolog","Monolog"),De(e,r,"vlucas/phpdotenv","PHP dotenv"),De(e,r,"symfony/console","Symfony Console"),De(e,r,"guzzlehttp/guzzle","GuzzleHttp"),De(e,r,"ramsey/uuid","Ramsey UUID"),De(e,r,"doctrine/orm","Doctrine ORM"),De(e,r,"php-di/php-di","PHP-DI"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"symfony/finder","Symfony Finder"),De(e,r,"symfony/yaml","Symfony Yaml"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"phpunit/phpunit","PHPUnit"),De(e,r,"behat/behat","Behat"),De(e,r,"phpspec/phpspec","PHPSpec"),De(e,r,"codeception/codeception","Codeception"),De(e,r,"atoum/atoum","Atoum"),De(e,r,"pestphp/pest","PestPHP"),De(e,r,"kahlan/kahlan","Kahlan"),De(e,r,"peridot-php/peridot","Peridot"),De(e,r,"phake/phake","Phake"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockery/mockery","Mockery"),De(e,r,"php-mock/php-mock","PHP-Mock"),De(e,r,"php-mock/php-mock-phpunit","PHP-Mock PHPUnit"),De(e,r,"padraic/mockery","Padraic Mockery"),De(e,r,"phpspec/prophecy","PHPSpec Prophecy"),De(e,r,"phpunit/php-invoker","PHPUnit Invoker"),De(e,r,"phpunit/php-token-stream","PHPUnit Token Stream"),De(e,r,"phpunit/php-code-coverage","PHPUnit Code Coverage"),De(e,r,"phpunit/php-timer","PHPUnit Timer"),De(e,r,"phpunit/php-text-template","PHPUnit Text Template"),r}},rKe=class{constructor(){this.languageId="csharp"}static{a(this,"CSharpProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"Microsoft.NETCore.App",".NET Core"),De(e,r,"Microsoft.AspNetCore.App","ASP.NET Core"),r}determineCoreLibraries(e){let r=[];return De(e,r,"EntityFramework","Entity Framework"),De(e,r,"Newtonsoft.Json","Newtonsoft.Json"),De(e,r,"AutoMapper","AutoMapper"),De(e,r,"Serilog","Serilog"),De(e,r,"Dapper","Dapper"),De(e,r,"Polly","Polly"),De(e,r,"FluentValidation","FluentValidation"),De(e,r,"MediatR","MediatR"),De(e,r,"Hangfire","Hangfire"),De(e,r,"RabbitMQ.Client","RabbitMQ.Client"),De(e,r,"MassTransit","MassTransit"),De(e,r,"Microsoft.Extensions.Logging","Microsoft.Extensions.Logging"),De(e,r,"Microsoft.Extensions.DependencyInjection","Microsoft.Extensions.DependencyInjection"),De(e,r,"Microsoft.Extensions.Configuration","Microsoft.Extensions.Configuration"),De(e,r,"Microsoft.Extensions.Http","Microsoft.Extensions.Http"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"xunit","xUnit"),De(e,r,"NUnit","NUnit"),De(e,r,"SpecFlow","SpecFlow"),r}determineTestingLibraries(e){let r=[];return De(e,r,"Moq","Moq"),De(e,r,"FluentAssertions","FluentAssertions"),De(e,r,"Bogus","Bogus"),De(e,r,"RestSharp","RestSharp"),De(e,r,"Swashbuckle.AspNetCore","Swashbuckle.AspNetCore"),r}},nKe=class{constructor(){this.languageId="dart"}static{a(this,"DartProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"flutter","Flutter"),De(e,r,"angular","AngularDart"),r}determineCoreLibraries(e){let r=[];return De(e,r,"dartx","dartx"),De(e,r,"provider","Provider"),De(e,r,"rxdart","RxDart"),De(e,r,"dio","Dio"),De(e,r,"json_serializable","json_serializable"),De(e,r,"freezed","Freezed"),De(e,r,"moor","Moor"),De(e,r,"hive","Hive"),De(e,r,"http","http"),De(e,r,"path","path"),De(e,r,"intl","intl"),De(e,r,"equatable","equatable"),De(e,r,"get_it","get_it"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test","test"),De(e,r,"flutter_test","flutter_test"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockito","mockito"),De(e,r,"bloc_test","bloc_test"),r}},iKe=class{constructor(){this.languageId="ruby"}static{a(this,"RubyProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"rails","Rails"),De(e,r,"sinatra","Sinatra"),De(e,r,"hanami","Hanami"),De(e,r,"grape","Grape"),De(e,r,"roda","Roda"),De(e,r,"padrino","Padrino"),De(e,r,"cuba","Cuba"),De(e,r,"ramaze","Ramaze"),De(e,r,"nyara","Nyara"),De(e,r,"rack","Rack"),r}determineCoreLibraries(e){let r=[];return De(e,r,"active_record","ActiveRecord"),De(e,r,"sequel","Sequel"),De(e,r,"rom","ROM"),De(e,r,"datamapper","DataMapper"),De(e,r,"mongoid","Mongoid"),De(e,r,"neo4j","Neo4j"),De(e,r,"redis","Redis"),De(e,r,"cassandra","Cassandra"),De(e,r,"couchrest","CouchRest"),De(e,r,"riak","Riak"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"rspec","RSpec"),De(e,r,"minitest","Minitest"),De(e,r,"cucumber","Cucumber"),De(e,r,"spinach","Spinach"),De(e,r,"turnip","Turnip"),De(e,r,"bacon","Bacon"),De(e,r,"shoulda","Shoulda"),De(e,r,"test-unit","Test::Unit"),De(e,r,"wrong","Wrong"),De(e,r,"contest","Contest"),r}determineTestingLibraries(e){let r=[];return De(e,r,"factory_bot","FactoryBot"),De(e,r,"faker","Faker"),De(e,r,"ffaker","FFaker"),De(e,r,"fabrication","Fabrication"),De(e,r,"machinist","Machinist"),De(e,r,"mocha","Mocha"),De(e,r,"flexmock","FlexMock"),De(e,r,"rr","RR"),De(e,r,"bourne","Bourne"),De(e,r,"not_a_mock","NotAMock"),r}},oKe=class{constructor(){this.languageId="rust"}static{a(this,"RustProjectMetadataLookup")}determineBuildTools(e){return e.buildTools}determineApplicationFrameworks(e){let r=[];return De(e,r,"tokio","tokio"),De(e,r,"async-std","async-std"),De(e,r,"hyper","hyper"),De(e,r,"actix-web","actix-web"),De(e,r,"rocket","rocket"),r}determineCoreLibraries(e){let r=[];return De(e,r,"serde","serde"),De(e,r,"regex","regex"),De(e,r,"rand","rand"),De(e,r,"log","log"),De(e,r,"lazy_static","lazy_static"),De(e,r,"libc","libc"),De(e,r,"futures","futures"),De(e,r,"rayon","rayon"),De(e,r,"reqwest","reqwest"),De(e,r,"warp","warp"),r}determineTestingFrameworks(e){let r=[];return De(e,r,"test-case","test-case"),De(e,r,"proptest","proptest"),De(e,r,"quickcheck","quickcheck"),r}determineTestingLibraries(e){let r=[];return De(e,r,"mockall","mockall"),De(e,r,"double","double"),De(e,r,"rstest","rstest"),De(e,r,"mockiato","mockiato"),De(e,r,"mock_derive","mock_derive"),De(e,r,"mocktopus","mocktopus"),De(e,r,"mockers","mockers"),De(e,r,"mock_it","mock_it"),r}},sKe=class{constructor(){this.languageId=["c","cpp"]}static{a(this,"CProjectMetadataLookup")}determineBuildTools(e){return e.buildTools.filter(r=>["gcc","clang","make","cmake","autotools","ninja","meson"].includes(r.name))}determineApplicationFrameworks(e){return e.libraries.filter(r=>["libc","libuv","openssl","zlib","libevent","libcurl"].includes(r.name))}determineCoreLibraries(e){return e.libraries.filter(r=>["libpng","libjpeg","libxml2","sqlite","postgres","mysql"].includes(r.name))}determineTestingFrameworks(e){return e.libraries.filter(r=>["unity","criterion","cmocka","check","ctest","minunit"].includes(r.name))}determineTestingLibraries(e){return e.libraries.filter(r=>["cmock","fff","trompeloeil","fakeit"].includes(r.name))}};function De(t,e,r,n){let o=t.libraries.find(s=>s.name.toLowerCase().indexOf(r.toLowerCase())>-1);o&&e.push({name:n,version:o.version})}a(De,"addFromLibraries");var aKe=class{constructor(e,r){this.languageId=e;this.delegates=r}static{a(this,"CompositeProjectMetadataLookup")}determineBuildTools(e){return this.delegates.map(r=>r.determineBuildTools(e)).flat()}determineApplicationFrameworks(e){return this.delegates.map(r=>r.determineApplicationFrameworks(e)).flat()}determineCoreLibraries(e){return this.delegates.map(r=>r.determineCoreLibraries(e)).flat()}determineTestingFrameworks(e){return this.delegates.map(r=>r.determineTestingFrameworks(e)).flat()}determineTestingLibraries(e){return this.delegates.map(r=>r.determineTestingLibraries(e)).flat()}};function q_n(t){return t.language.version?t.language.name+" "+t.language.version:t.language.name}a(q_n,"determineProgrammingLanguage");var Q_n=[new JYe,new ZYe,new XYe,new eKe,new tKe,new rKe,new nKe,new iKe,new oKe,new sKe];function j_n(t){let e=Q_n.find(r=>typeof r.languageId=="string"?r.languageId===t:Array.isArray(r.languageId)?r.languageId.includes(t):!1)??new aKe(t,Q_n);return new eqt(e)}a(j_n,"getMetadataLookup");var eqt=class{constructor(e){this.delegate=e;this.languageId=e.languageId}static{a(this,"DistinctProjectMetadataLookup")}determineBuildTools(e){return this.deduplicateDependencies(this.delegate.determineBuildTools(e))}determineApplicationFrameworks(e){return this.deduplicateDependencies(this.delegate.determineApplicationFrameworks(e))}determineCoreLibraries(e){return this.deduplicateDependencies(this.delegate.determineCoreLibraries(e))}determineTestingFrameworks(e){return this.deduplicateDependencies(this.delegate.determineTestingFrameworks(e))}determineTestingLibraries(e){return this.deduplicateDependencies(this.delegate.determineTestingLibraries(e))}deduplicateDependencies(e){let r=[];return e.forEach(n=>{r.find(o=>o.name===n.name)||r.push(n)}),r}};var H_n=S.Object({name:S.String(),version:S.Optional(S.String())}),G_n=S.Object({language:S.Object({id:S.String(),name:S.String(),version:S.Optional(S.String())}),libraries:S.Array(H_n),buildTools:S.Array(H_n)}),tqt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectMetadataSkillProcessor")}value(){return 1}processSkill(e){let r=[];r.push([new yr([`The user is working on a project with the following characteristics: +`]),1]);let n=j_n(e.language.id);return this.addProgrammingLanguage(e,r),this.addBuildTools(e,r,n),this.addApplicationFramework(e,r,n),this.addCoreLibraries(e,r,n),this.addTestingFrameworks(e,r,n),this.addTestingLibraries(e,r,n),new yr(r)}addProgrammingLanguage(e,r){let n=q_n(e);this.turnContext.collectLabel(ZM,n),r.push([new yr([`- programming language: ${n}`]),1])}addBuildTools(e,r,n){this.addToPrompt(r,"- build tools:",n.determineBuildTools(e))}addApplicationFramework(e,r,n){this.addToPrompt(r,"- application frameworks:",n.determineApplicationFrameworks(e))}addCoreLibraries(e,r,n){this.addToPrompt(r,"- core libraries:",n.determineCoreLibraries(e))}addTestingFrameworks(e,r,n){this.addToPrompt(r,"- testing frameworks:",n.determineTestingFrameworks(e))}addTestingLibraries(e,r,n){this.addToPrompt(r,"- testing libraries:",n.determineTestingLibraries(e))}addToPrompt(e,r,n){if(n.length>0){n.forEach(s=>{this.turnContext.collectLabel(ZM,`${s.name}${s.version?" "+s.version:""}`)});let o=n.map(s=>` - ${s.name}${s.version?" "+s.version:""}`).join(` +`);e.push([new yr([`${r} +${o}`]),1])}}},ZM="project-metadata",cKe=class{constructor(e){this._resolver=e;this.id=ZM;this.type="explicit"}static{a(this,"ProjectMetadataSkill")}description(){return"The characteristics of the project the developer is working on (languages, frameworks)"}resolver(){return this._resolver}processor(e){return new tqt(e)}};p();var $_n=fe(require("path"));var rqt=class{constructor(e){this.turnContext=e}static{a(this,"ReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ri),n=[],o=this.filterIncludedFiles(e),s=(await this.toFileChunks(o,r)).filter(c=>c!==void 0).flat();if(s.length>0)return n.push([new yr(["The user wants you to consider the following referenced files when computing your answer."]),1]),n.push(...s),new yr(n)}filterIncludedFiles(e){return e.filter(r=>r.type==="file"&&!this.turnContext.isFileIncluded(r.uri))}async toFileChunks(e,r){return await Promise.all(e.map(async n=>{if(n.type==="file"&&n.uri)return await this.elideReferencedFiles(r,n)}))}async elideReferencedFiles(e,r){let n=await e.getOrReadTextDocument(r),o=Ku(n);if(await this.turnContext.collectFile(uKe,r.uri,o),n.status==="valid"){let s=e.getRelativePath(n.document);if(o==="included"){let c=new JM(n.document,r.selection,r.visibleRange);return[[`Code excerpt from referenced file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),1]]}else if(o==="empty")return[[new yr([`The referenced file \`${s}\` is empty.`]),1]]}else if(n.status==="invalid")return[[new yr([`The referenced file \`${$_n.basename(r.uri)}\` is content excluded.`]),1]]}},nqt=class{static{a(this,"ReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},uKe="references",lKe=class{constructor(){this.id=uKe;this.type="implicit"}static{a(this,"ReferencesSkill")}description(){return"The code from the user's referenced files"}resolver(){return new nqt}processor(e){return new rqt(e)}};var aK=a(()=>[ZM,Ck,uKe,zy],"mandatorySkills"),yle=class{constructor(e,r){this.chatFetcher=r;this.metaPromptFetcher=new $Ye(e,this.chatFetcher)}static{a(this,"ConversationContextCollector")}async collectContext(e,r,n,o,s,c){let l=[];if(s){let u=s.requiredSkills?await s.requiredSkills(e.ctx):[];l.push(...u.filter(d=>!aK().includes(d)))}else(await this.metaPromptFetcher.fetchPromptContext(e,await this.selectableSkillDescriptors(e.ctx,e.conversation,e.turn),r,n,o)).skillIds.reverse().forEach(d=>{!l.includes(d)&&!aK().includes(d)&&l.push(d)});if(c){let u=await c.additionalSkills(e.ctx);l.push(...u.filter(d=>!aK().includes(d)))}return l.push(...aK()),l=l.filter(u=>!this.isIgnoredSkill(u,e.turn)),{skillIds:e.ctx.get(Go).filterSupportedSkills(e.conversation.id,l)}}async selectableSkillDescriptors(e,r,n){let o=await this.getNonSelectableSkills(e),s=e.get(Go).getSupportedSkills(r.id),c=e.get(Hh).getDescriptors(),l=[];for(let u of c){if(o.includes(u.id)||!s.includes(u.id))continue;(!u.isAvailable||await u.isAvailable(e))&&!this.isIgnoredSkill(u.id,n)&&l.push(u)}return l}async getNonSelectableSkills(e){let r=await Nx(e),n=(await Promise.all(r.map(o=>o.additionalSkills(e)))).flat();return[...aK(),...n]}isIgnoredSkill(e,r){return r.ignoredSkills?.some(n=>n.skillId===e)}};async function fKe(t,e){let[r,n,o]=await eHo(t,e);return o.push(...nHo(t)),r.length>0||n.length>0?[new yr([[new yr(["Consider the additional context:"]),1],[VQ(r,"inverseLinear"),.9],...n]),o]:[null,o]}a(fKe,"fromSkills");async function eHo(t,e){let r=[],n=[],o=[],s=[...t.turn.skills].reverse();for(let c of s){if(!await iHo(t,c.skillId,e?.languageId??""))continue;let[l,u]=await tHo(t,c.skillId);l&&(aK().indexOf(c.skillId)===-1?n.push(l):o.push(l)),r.push(u)}return n.reverse(),o.reverse(),r.reverse(),[n,o,r]}a(eHo,"handleSkillsInReverse");async function tHo(t,e){let n=t.ctx.get(Hh).getSkill(e);try{let o=Date.now(),s=await t.skillResolver.resolve(e),c=Date.now()-o;if(s){let l=n?.processor(t),u=Date.now(),d=await l?.processSkill(s,t),f=Date.now()-u;return d?await rHo(t,n,l,d,c,f):[void 0,await dKe(t,n,"unprocessable",void 0,c,f)]}else return[void 0,await dKe(t,n,"unresolvable",void 0,c)]}catch(o){if(ot.exception(t.ctx,o,`Error while resolving skill ${e}`),o instanceof vIe)throw o;return[void 0,await dKe(t,n,"failed")]}}a(tHo,"safelyProcessSkill");async function rHo(t,e,r,n,o,s){let c;return typeof n=="string"?c=new yr([[n,1]]):c=n,[[c,r?.value()||0],await dKe(t,e,"resolved",c,o,s)]}a(rHo,"handleProcessedSkill");async function dKe(t,e,r,n,o,s){let l=t.collector.collectiblesForCollector(e?.id??"unknown").filter(d=>d.type==="file"),u={skillId:e?.id??"unknown",resolution:r,files:l,resolutionTimeMs:o,processingTimeMs:s};if(n){let d=await jQ(t.ctx),f=await t.ctx.get(Yc).getBestChatModelConfig(aS("user",d)),h=n.elide(f.maxRequestTokens).getText();u.tokensPreEliding=Cs(f.tokenizer).tokenLength(h)}return t.ctx.get(ng).addResolution(t.turn.id,u),u}a(dKe,"determineResolution");function nHo(t){return t.turn.ignoredSkills.map(e=>({skillId:e.skillId,resolution:"ignored"}))}a(nHo,"handleIgnoredSkills");async function iHo(t,e,r){if(e!==ZM&&e!==Ck)return!0;let n=t.ctx.get(Jt),o=await n.fetchTokenAndUpdateExPValuesAndAssignments({languageId:r});return n.ideChatEnableProjectMetadata(o)?e===ZM:e===Ck}a(iHo,"includeSkill");var cK=class{static{a(this,"AbstractUserPromptStrategy")}async elidableContent(e,r){let n=[],o=gle(e.conversation.turns.slice(0,-1));o!==null&&n.push([o,.6]);let[s,c]=await this.elidableSkills(e,r);return s!==null&&(o!==null&&n.push(["",.1]),n.push([s,.8])),[new yr(n),c]}async elidableSkills(e,r){return await fKe(e,r)}async promptContent(e,r,n){let o,s={includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ht(e.ctx,Je.UseAgentsMd),includeNestedAgentsMdInstructions:Ht(e.ctx,Je.UseNestedAgentsMd),includeClaudeMdInstructions:Ht(e.ctx,Je.UseClaudeMd),includeNestedClaudeMdInstructions:Ht(e.ctx,Je.UseNestedClaudeMd)},c=e.turn.extractContextFilesUri();e.turn.workspaceFolders&&e.turn.workspaceFolders.length>0?o=await e.ctx.get(ff).getInstructions(e.ctx,e.turn.workspaceFolders,s,c):e.turn.workspaceFolder&&(o=await e.ctx.get(ff).getInstructions(e.ctx,[e.turn.workspaceFolder],s,c));let l=xS(e.conversation.getLastTurn().request.message),u;o?typeof l=="string"?u=o+` -`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},EYe=class extends oK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return Ws` +`+l:u=[{type:"text",text:o},...l]:u=l;let[d,f]=await this.elidableContent(e,n);return[[{role:"system",content:r},{role:"user",content:d},{role:"system",content:this.suffix(e)},{role:"user",content:u}],f]}},pKe=class extends cK{static{a(this,"PanelUserPromptStrategy")}suffix(e){return sa` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. When generating code, think step-by-step. Briefly explain the code and then output it in a single code block. @@ -2601,7 +2632,7 @@ ${o}`]),1])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;t Do not start your answer with a programming language name. Do not include follow up questions or suggestions for next turns. Respond in the following locale: ${e.conversation.userLanguage}. - `.trim()}};var _Ye=class extends oK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return Ws` + `.trim()}};var hKe=class extends cK{static{a(this,"InlineUserPromptStrategy")}suffix(e){return sa` Use the above information, including the additional context and conversation history (if available) to answer the user's question below. Prioritize the context given in the user's question. Keep your answers short and impersonal. @@ -2656,7 +2687,7 @@ ${o}`]),1])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;t - The first row of a codeblock must never be indented. - Code in codeblocks must not contain line numbers. - You must not return a codeblock containing the final code, but only individual codeblocks for each change. - `.trim()}};p();var CYe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=ale(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return Ws` + `.trim()}};p();var mKe=class{static{a(this,"MetaPromptStrategy")}elidableContent(e){let r=gle(e.turns.slice(0,-1)),n=[];return r!==null&&n.push([r,.6]),new yr(n)}suffix(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");if(!e.supportedSkillDescriptors)throw new Error("Supported skills must be provided for meta prompts");return this.buildMetaPrompt(e.supportedSkillDescriptors)}buildMetaPrompt(e){return sa` Your task is to provide a helpful answer to the user's question. To help you create that answer, you can resolve skills that give you more context. Each skill has a description and some example user questions to help you understand when the skill may be useful. @@ -2665,14 +2696,14 @@ ${o}`]),1])}}},XM="project-metadata",hYe=class{constructor(e){this._resolver=e;t ${e.map(r=>`${this.skillToPrompt(r)} `).join(` `)} - `.trim()}createFunctionArgumentSchema(e){let r=Mmn(e.map(n=>n.id));return S.Object({skillIds:S.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:r3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} + `.trim()}createFunctionArgumentSchema(e){let r=tEn(e.map(n=>n.id));return S.Object({skillIds:S.Array(r,{description:"The skill ids to resolve ranked from most to least useful"})})}toolConfig(e){if(e.promptType!=="meta")throw new Error("Invalid prompt options for strategy");return{tool_choice:{type:"function",function:{name:"resolveSkills"}},tools:[{type:"function",function:{name:"resolveSkills",description:"Resolves the skills by id to help answer the user question.",parameters:this.createFunctionArgumentSchema(e.supportedSkillDescriptors)}}],extractArguments(r){return{skillIds:d3(r).skillIds}}}}skillToPrompt(e){let r=e.description?e.description():e.id,n=`Skill Id: ${e.id} Skill Description: ${r}`,o=e.examples?e.examples():[];return o.length>0&&(n+=` Skill Examples: ${o.map(s=>` - ${s}`).join(` -`)}`),n}promptContent(e,r,n){let o=e.conversation.getLastTurn().request.message,s=this.elidableContent(e.conversation);return[[{role:"system",content:r},{role:"user",content:s},{role:"system",content:this.suffix(n)},{role:"user",content:Ws` +`)}`),n}promptContent(e,r,n){let o=e.conversation.getLastTurn().request.message,s=this.elidableContent(e.conversation);return[[{role:"system",content:r},{role:"user",content:s},{role:"system",content:this.suffix(n)},{role:"user",content:sa` This is the user's question: - ${In(o).trim()} - `.trim()}],[]]}};p();var vYe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=r3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return Ws` + ${Rn(o).trim()} + `.trim()}],[]]}};p();var gKe=class{static{a(this,"SuggestionsPromptStrategy")}toolConfig(){return{tool_choice:{type:"function",function:{name:"showSuggestions"}},tools:[{type:"function",function:{name:"showSuggestions",description:"Show the computed suggestions to the user",parameters:S.Object({suggestedTitle:S.String({description:"The suggested title for the conversation"}),followUp:S.String({description:"The suggested follow-up question for the conversation"})})}}],extractArguments(e){let r=d3(e);return{suggestedTitle:r.suggestedTitle,followUp:r.followUp}}}}suffix(e){return sa` Your task is to come up with two suggestions: 1) Suggest a title for the current conversation based on the history of the conversation so far. @@ -2688,7 +2719,7 @@ ${o.map(s=>` - ${s}`).join(` - The question must not appear in the conversation history. - The question must not have already been answered. - The question must be in the following locale: ${e.conversation.userLanguage}. - `.trim()}elidableContent(e){let r=ale(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new Ar(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var RUo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:S.Object({keywords:S.Array(S.Object({keyword:S.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],bYe=class extends oK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` + `.trim()}elidableContent(e){let r=gle(e.turns.slice()),n=[];return r!==null&&n.push([r,.6]),new yr(n)}promptContent(e,r,n){return[[{role:"system",content:r},{role:"user",content:this.elidableContent(e.conversation)},{role:"system",content:this.suffix(e)}],[]]}};p();var oHo=[{type:"function",function:{name:"queryWithKeywords",description:"Searches the workspace for synonyms and relevant keywords related to the original user query. These keywords could be used as file names, symbol names, abbreviations, or comments in the relevant code.",parameters:S.Object({keywords:S.Array(S.Object({keyword:S.String({description:"A keyword or phrase relevant to the original user query that a user could search to answer their question. Keywords are not generic and do not repeat."}),variations:S.Array(S.String(),{description:"An array of relevant variations of the keyword. Variations include synonyms and plural forms. Variations are not generic and do not repeat."})}))})}}],AKe=class extends cK{static{a(this,"UserQuerySynonymsPromptStrategy")}suffix(){return` You are a coding assistant that helps developers find relevant code in their workspace by providing a list of relevant keywords they can search for. The user will provide you with potentially relevant information from the workspace. This information may be incomplete. @@ -2711,39 +2742,39 @@ queryWithKeywords([ { "keyword": "base64", "variations": ["base 64"] }, { "keyword": "encode", "variations": ["encoding", "encoded", "encoder", "encoders"] } ]); -`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=RS(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:RUo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=r3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!UWe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!UWe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var $Ut=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function hIe(t,e,r){return new $Ut(t,e,r)}a(hIe,"descriptor");var qyn=[hIe("user",hS("user"),()=>new EYe),hIe("inline",hS("inline"),()=>new _Ye),hIe("meta",hS("meta"),()=>new CYe),hIe("suggestions",hS("suggestions"),()=>new vYe),hIe("synonyms",hS("synonyms"),()=>new bYe)],SYe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await FQ(e),s=hS(r,o),c=qyn.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return qyn}};var Hyn=require("console");var dA=class{constructor(e,r=new SYe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Ur).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(Uh).inspectPrompt({type:r.promptType,prompt:jyn(l),tokens:u}),this.ctx.get(eg).addPrompt(e.turn.id,jyn(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,Hyn.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:kUo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,lUt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),lUt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Lr).getEditorInfo().readableName??this.ctx.get(Lr).getEditorInfo().name,o=PUo(process.platform);return FAn(this.ctx,n,r?.login,o,e)}};function kUo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(kUo,"processResultOfElidableText");function jyn(t){return t.map(e=>In(e.content)).join(` +`.trim()}promptContent(e,r,n){if(n.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");let o=xS(e.conversation.getLastTurn().request.message),s=[{role:"system",content:r},{role:"system",content:this.suffix()},{role:"user",content:o}];return Promise.resolve([s,[]])}toolConfig(e){if(e.promptType!=="synonyms")throw new Error("Invalid prompt options for user query strategy");return{tools:oHo,tool_choice:{type:"function",function:{name:"queryWithKeywords"}},extractArguments(r){let n=d3(r).keywords;if(!n||!Array.isArray(n))return{keywords:[]};let o=new Set;for(let s of n)if(!(!lYe(s,"keyword")||!s.keyword||typeof s.keyword!="string")&&(o.add(s.keyword.toLowerCase()),!(!lYe(s,"variations")||!s.variations||!Array.isArray(s.variations))))for(let c of s.variations)typeof c=="string"&&o.add(c.toLowerCase());return{keywords:Array.from(o)??[]}}}}};var iqt=class{constructor(e,r,n){this.promptType=e;this.strategy=n;this.modelFamilies=Array.isArray(r)?r:[r]}static{a(this,"PromptStrategyDescriptor")}};function CIe(t,e,r){return new iqt(t,e,r)}a(CIe,"descriptor");var V_n=[CIe("user",aS("user"),()=>new pKe),CIe("inline",aS("inline"),()=>new hKe),CIe("meta",aS("meta"),()=>new mKe),CIe("suggestions",aS("suggestions"),()=>new gKe),CIe("synonyms",aS("synonyms"),()=>new AKe)],yKe=class{static{a(this,"DefaultPromptStrategyFactory")}async createPromptStrategy(e,r,n){let o=await jQ(e),s=aS(r,o),c=V_n.find(l=>l.promptType===r&&s.includes(n));if(!c)throw new Error(`No prompt strategy found for promptType: ${r} and modelFamily: ${n}`);return c.strategy(e)}get descriptors(){return V_n}};var z_n=require("console");var gA=class{constructor(e,r=new yKe){this.ctx=e;this.promptStrategyFactory=r}static{a(this,"ConversationPromptEngine")}async toPrompt(e,r){let n=await this.promptStrategyFactory.createPromptStrategy(this.ctx,r.promptType,r.modelConfiguration.modelFamily),o=await this.ctx.get(Fr).resolveSession(),[s,c]=await n.promptContent(e,this.safetyPrompt(r.userSelectedModelName??r.modelConfiguration.uiName,o),r),[l,u]=this.elideChatMessages(s,r.modelConfiguration);return await this.ctx.get(jh).inspectPrompt({type:r.promptType,prompt:W_n(l),tokens:u}),this.ctx.get(ng).addPrompt(e.turn.id,W_n(l),r.promptType),{messages:l,tokens:u,skillResolutions:c,toolConfig:n.toolConfig?.(r)}}elideChatMessages(e,r){let n=e.filter(l=>!(typeof l.content=="string"||Array.isArray(l.content)));(0,z_n.assert)(n.length==1,"Only one elidable message is supported right now.");let o=this.computeNonElidableTokens(e,r),s=r.maxRequestTokens-o,c=e.map(l=>typeof l.content=="string"||Array.isArray(l.content)?l:{role:l.role,content:sHo(l.content.elide(s).getText())}).filter(l=>l.content.length>0);return[c,CQt(c,r)]}computeNonElidableTokens(e,r){let n=e.filter(o=>typeof o.content=="string");return n.push({role:"user",content:""}),CQt(n,r)}safetyPrompt(e,r){let n=this.ctx.get(Nr).getEditorInfo().readableName??this.ctx.get(Nr).getEditorInfo().name,o=aHo(process.platform);return HEn(this.ctx,n,r?.login,o,e)}};function sHo(t){return t.trimStart().replace(/^\[\.\.\.\]\n?/,"")}a(sHo,"processResultOfElidableText");function W_n(t){return t.map(e=>Rn(e.content)).join(` -`)}a(jyn,"debugChatMessages");function PUo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(PUo,"mapPlatformToOs");var HQ=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Uo.getModelConfiguration(e.ctx,"suggestions",void 0,{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(dA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(Ye.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){Ye.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){Ye.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){Ye.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){Ye.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{Ye.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var VUt="v1",_P=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},Dx=class extends _P{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},z0=class extends _P{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},Yf=class extends _P{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},mIe=class extends _P{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var dle=new ge("codingAgentUtils"),ule=29950;function Gyn(t,e,r){if(e.length>=ule)return dle.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${ule}`),e=e.slice(-ule),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=ule){let o=ule-e.length-2;dle.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${ule}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` +`)}a(W_n,"debugChatMessages");function aHo(t){switch(t){case"darwin":return"macOS";case"win32":return"Windows";case"linux":return"Linux";case"freebsd":return"FreeBSD";case"openbsd":return"OpenBSD";case"sunos":return"SunOS";case"aix":return"AIX";default:return}}a(aHo,"mapPlatformToOs");var WQ=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"TurnSuggestions")}async fetchRawSuggestions(e,r,n,o){let s=await Ro.getModelConfiguration(e.ctx,"suggestions",{tool_calls:!0}),c={promptType:"suggestions",modelConfiguration:s},l=await this.ctx.get(gA).toPrompt(e,c),u=o.extendedBy({messageSource:"chat.suggestions"},{promptTokenLen:l.tokens}),d={modelConfiguration:s,messages:l.messages,uiKind:n,llmInteraction:e.toLlmInteraction()};if(l.toolConfig===void 0)throw new Error("No tool call configuration found in suggestions prompt.");d.tool_choice=l.toolConfig.tool_choice,d.tools=l.toolConfig.tools;let f=await this.chatFetcher.fetchResponse(d,r,u);if(f.type!=="success"&&(ot.error(this.ctx,"Failed to fetch suggestions, trying again..."),f=await this.chatFetcher.fetchResponse(d,r,u)),f.type==="success"){if(!f.toolCalls||f.toolCalls.length===0){ot.error(this.ctx,"Missing tool call in suggestions response");return}let h=f.toolCalls[0],{followUp:m,suggestedTitle:g}=l.toolConfig.extractArguments(h);if(!m||!g){ot.error(this.ctx,"Missing follow-up or suggested title in suggestions response");return}return{followUp:m.trim(),suggestedTitle:g.trim(),promptTokenLen:l.tokens,numTokens:f.numTokens+h.approxNumTokens}}else if(f.type==="successMultiple"){ot.error(this.ctx,"successMultiple response is unexpected for suggestions");return}else if(f.type==="tool_calls"){ot.error(this.ctx,"tool_calls response is unexpected for suggestions");return}else{ot.error(this.ctx,`Failed to fetch suggestions due to reason: ${f.reason}`);return}}};p();p();var oqt="v1",bk=class extends Error{static{a(this,"CodingAgentError")}constructor(e){super(e),this.name=this.constructor.name}},Mx=class extends bk{static{a(this,"CodingAgentAuthenticationError")}constructor(e){super(e)}},J0=class extends bk{static{a(this,"CodingAgentApiError")}constructor(e){super(e)}},ep=class extends bk{static{a(this,"CodingAgentValidationError")}constructor(e){super(e)}},bIe=class extends bk{static{a(this,"CodingAgentInternalError")}constructor(e){super(e)}};p();var _le=new Ae("codingAgentUtils"),Ele=29950;function Y_n(t,e,r){if(e.length>=Ele)return _le.warn(t,`Truncation: Prompt length ${e.length} exceeds max of ${Ele}`),e=e.slice(-Ele),{problemStatement:e,isTruncated:!0};let n=!1;if(r&&e.length+r.length>=Ele){let o=Ele-e.length-2;_le.warn(t,`Truncation: Combined prompt and context length ${e.length+r.length} exceeds max of ${Ele}`),r=o>0?r.slice(-o):"",n=!0}return{problemStatement:e+(r?` -${r}`:""),isTruncated:n}}a(Gyn,"truncatePrompt");function TYe(t){return t.length<=20?t:t.substring(0,20)+"..."}a(TYe,"generateTitleFromUserPrompt");function $yn(t){return`Coding agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a($yn,"formatBodyPlaceholder");function Vyn(t,e,r){let n=t.get(Jn),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),dle.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;dle.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),dle.debug(t,`Added active editor: ${c}`))}catch(c){dle.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(Vyn,"extractContextPaths");function Wyn(t){return t.length===0?"":`The user has attached the following files from their workspace: +${r}`:""),isTruncated:n}}a(Y_n,"truncatePrompt");function EKe(t){return t.length<=20?t:t.substring(0,20)+"..."}a(EKe,"generateTitleFromUserPrompt");function K_n(t){return`Cloud agent has begun work on **${t||"your request"}** and will update this pull request as work progresses.`}a(K_n,"formatBodyPlaceholder");function J_n(t,e,r){let n=t.get(ri),o=[],s=new Set;if(e)for(let c of e)try{if(c.type==="file"||c.type==="directory"){let l=n.getRelativePath({uri:c.uri});l&&!s.has(l)&&(o.push(l),s.add(l),_le.debug(t,`Added ${c.type} context: ${l}`))}}catch(l){let u=c.type==="file"||c.type==="directory"||c.type==="tool"?c.uri:`${c.type} reference`;_le.warn(t,`Error extracting relative path for ${u}`,l)}if(r?.uri)try{let c=n.getRelativePath({uri:r.uri});c&&!s.has(c)&&(o.push(c),s.add(c),_le.debug(t,`Added active editor: ${c}`))}catch(c){_le.warn(t,`Error extracting relative path for active editor ${r.uri}`,c)}return o}a(J_n,"extractContextPaths");function Z_n(t){return t.length===0?"":`The user has attached the following files from their workspace: ${t.map(r=>`- ${r}`).join(` -`)}`}a(Wyn,"formatContextFiles");p();p();var IYe=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},Wy=class extends IYe{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Pd=class extends IYe{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var WUt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(WUt||{});p();p();p();function GQ(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(GQ,"getUserAgent");p();p();function xYe(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>xYe.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a(xYe,"register");p();function zyn(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(zyn,"addHook");p();function Yyn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(Yyn,"removeHook");var Kyn=Function.bind,Jyn=Kyn.bind(Kyn);function Zyn(t,e,r){let n=Jyn(Yyn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=Jyn(zyn,null).apply(null,s)})}a(Zyn,"bindApi");function DUo(){let t=Symbol("Singular"),e={registry:{}},r=xYe.bind(null,e,t);return Zyn(r,e,t),r}a(DUo,"Singular");function NUo(){let t={registry:{}},e=xYe.bind(null,t);return Zyn(e,t),e}a(NUo,"Collection");var Xyn={Singular:DUo,Collection:NUo};p();p();var MUo="0.0.0-development",OUo=`octokit-endpoint.js/${MUo} ${GQ()}`,BUo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":OUo},mediaType:{format:""}};function LUo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(LUo,"lowercaseKeys");function FUo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(FUo,"isPlainObject");function rEn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{FUo(e[n])?n in t?r[n]=rEn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(rEn,"mergeDeep");function eEn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(eEn,"removeUndefinedProperties");function YUt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=LUo(r.headers),eEn(r),eEn(r.headers);let n=rEn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(YUt,"merge");function UUo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(UUo,"addQueryParameters");var QUo=/\{[^{}}]+\}/g;function qUo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(jUo,"extractUrlVariableNames");function tEn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(tEn,"omit");function nEn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(nEn,"encodeReserved");function ple(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(ple,"encodeUnreserved");function gIe(t,e,r){return e=t==="+"||t==="#"?nEn(e):ple(e),r?ple(r)+"="+e:e}a(gIe,"encodeValue");function fle(t){return t!=null}a(fle,"isDefined");function zUt(t){return t===";"||t==="&"||t==="?"}a(zUt,"isKeyOperator");function HUo(t,e,r,n){var o=t[r],s=[];if(fle(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(gIe(e,o,zUt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(fle).forEach(function(c){s.push(gIe(e,c,zUt(e)?r:""))}):Object.keys(o).forEach(function(c){fle(o[c])&&s.push(gIe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(fle).forEach(function(l){c.push(gIe(e,l))}):Object.keys(o).forEach(function(l){fle(o[l])&&(c.push(ple(l)),c.push(gIe(e,o[l].toString())))}),zUt(e)?s.push(ple(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?fle(o)&&s.push(ple(r)):o===""&&(e==="&"||e==="?")?s.push(ple(r)+"="):o===""&&s.push("");return s}a(HUo,"getValues");function GUo(t){return{expand:$Uo.bind(null,t)}}a(GUo,"parseUrl");function $Uo(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(HUo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return nEn(s)}),t==="/"?t:t.replace(/\/$/,"")}a($Uo,"expand");function iEn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=tEn(t,["method","baseUrl","url","headers","request","mediaType"]),c=jUo(r);r=GUo(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=tEn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=UUo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(iEn,"parse");function VUo(t,e,r){return iEn(YUt(t,e,r))}a(VUo,"endpointWithDefaults");function oEn(t,e){let r=YUt(t,e),n=VUo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:oEn.bind(null,r),merge:YUt.bind(null,r),parse:iEn})}a(oEn,"withDefaults");var sEn=oEn(null,BUo);var EEn=ce(uEn(),1);p();var WUo=/^-?\d+$/,pEn=/^-?\d+n+$/,KUt=JSON.stringify,dEn=JSON.parse,zUo=/^-?\d+n$/,YUo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,KUo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,hEn=a((t,e,r)=>"rawJSON"in JSON?KUt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?KUt(t,(c,l)=>typeof l=="string"&&pEn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(YUo,"$1$2$3").replace(KUo,"$1$2$3"):KUt(t,e,r),"JSONStringify"),PYe=new Map,JUo=a(()=>{let t=JSON.parse.toString();if(PYe.has(t))return PYe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return PYe.set(t,e),e}catch{return PYe.set(t,!1),!1}},"isContextSourceSupported"),ZUo=a((t,e,r,n)=>typeof e=="string"&&zUo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&pEn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),XUo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return dEn(t,e);if(JUo())return XUo(t,e);let r=t.replace(e7o,(n,o,s,c)=>{let l=n[0]==='"';if(l&&t7o.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthZUo(n,o,s,e))},"JSONParse");p();var aK=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function yEn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=i7o(t.body)||Array.isArray(t.body)?hEn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new aK(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new aK(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await JUt(c),new aK("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await JUt(c),new aK(s7o(f.data),l,{response:f,request:t});return f.data=n?await JUt(c):c.body,f}a(yEn,"fetchWrapper");async function JUt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(AEn);let r=(0,EEn.safeParse)(e);if(o7o(r)){let n="";try{return n=await t.text(),gEn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(AEn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(JUt,"getResponseData");function o7o(t){return t.type==="application/json"||t.type==="application/scim+json"}a(o7o,"isJSONResponse");function s7o(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(s7o,"toErrorMessage");function ZUt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return yEn(r.parse(c));let l=a((u,d)=>yEn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:ZUt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:ZUt.bind(null,r)})}a(ZUt,"withDefaults");var yIe=ZUt(sEn,n7o);p();var a7o="0.0.0-development";function c7o(t){return`Request failed due to following response errors: +`)}`}a(Z_n,"formatContextFiles");p();p();var _Ke=class extends Error{static{a(this,"GitHubClientError")}constructor(e){super(e)}},Yy=class extends _Ke{static{a(this,"GitHubClientAuthenticationError")}constructor(e="No authenticated GitHub session available"){super(e)}},Pd=class extends _Ke{constructor(r,n,o){super(o||`GitHub API request failed: ${r} ${n}`);this.status=r;this.statusText=n}static{a(this,"GitHubClientApiError")}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500&&this.status<600}};p();var sqt=(h=>(h.Actions="actions",h.Composer="composer",h.Erlang="erlang",h.Go="go",h.Maven="maven",h.Npm="npm",h.Nuget="nuget",h.Pip="pip",h.Pub="pub",h.RubyGems="rubygems",h.Rust="rust",h))(sqt||{});p();p();p();function zQ(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:""}a(zQ,"getUserAgent");p();p();function vKe(t,e,r,n){if(typeof r!="function")throw new Error("method for before hook must be a function");return n||(n={}),Array.isArray(e)?e.reverse().reduce((o,s)=>vKe.bind(null,t,s,o,n),r)():Promise.resolve().then(()=>t.registry[e]?t.registry[e].reduce((o,s)=>s.hook.bind(null,o,n),r)():r(n))}a(vKe,"register");p();function X_n(t,e,r,n){let o=n;t.registry[r]||(t.registry[r]=[]),e==="before"&&(n=a((s,c)=>Promise.resolve().then(o.bind(null,c)).then(s.bind(null,c)),"hook")),e==="after"&&(n=a((s,c)=>{let l;return Promise.resolve().then(s.bind(null,c)).then(u=>(l=u,o(l,c))).then(()=>l)},"hook")),e==="error"&&(n=a((s,c)=>Promise.resolve().then(s.bind(null,c)).catch(l=>o(l,c)),"hook")),t.registry[r].push({hook:n,orig:o})}a(X_n,"addHook");p();function evn(t,e,r){if(!t.registry[e])return;let n=t.registry[e].map(o=>o.orig).indexOf(r);n!==-1&&t.registry[e].splice(n,1)}a(evn,"removeHook");var tvn=Function.bind,rvn=tvn.bind(tvn);function nvn(t,e,r){let n=rvn(evn,null).apply(null,r?[e,r]:[e]);t.api={remove:n},t.remove=n,["before","error","after","wrap"].forEach(o=>{let s=r?[e,o,r]:[e,o];t[o]=t.api[o]=rvn(X_n,null).apply(null,s)})}a(nvn,"bindApi");function cHo(){let t=Symbol("Singular"),e={registry:{}},r=vKe.bind(null,e,t);return nvn(r,e,t),r}a(cHo,"Singular");function lHo(){let t={registry:{}},e=vKe.bind(null,t);return nvn(e,t),e}a(lHo,"Collection");var ivn={Singular:cHo,Collection:lHo};p();p();var uHo="0.0.0-development",dHo=`octokit-endpoint.js/${uHo} ${zQ()}`,fHo={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":dHo},mediaType:{format:""}};function pHo(t){return t?Object.keys(t).reduce((e,r)=>(e[r.toLowerCase()]=t[r],e),{}):{}}a(pHo,"lowercaseKeys");function hHo(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);if(e===null)return!0;let r=Object.prototype.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Function.prototype.call(r)===Function.prototype.call(t)}a(hHo,"isPlainObject");function avn(t,e){let r=Object.assign({},t);return Object.keys(e).forEach(n=>{hHo(e[n])?n in t?r[n]=avn(t[n],e[n]):Object.assign(r,{[n]:e[n]}):Object.assign(r,{[n]:e[n]})}),r}a(avn,"mergeDeep");function ovn(t){for(let e in t)t[e]===void 0&&delete t[e];return t}a(ovn,"removeUndefinedProperties");function cqt(t,e,r){if(typeof e=="string"){let[o,s]=e.split(" ");r=Object.assign(s?{method:o,url:s}:{url:o},r)}else r=Object.assign({},e);r.headers=pHo(r.headers),ovn(r),ovn(r.headers);let n=avn(t||{},r);return r.url==="/graphql"&&(t&&t.mediaType.previews?.length&&(n.mediaType.previews=t.mediaType.previews.filter(o=>!n.mediaType.previews.includes(o)).concat(n.mediaType.previews)),n.mediaType.previews=(n.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),n}a(cqt,"merge");function mHo(t,e){let r=/\?/.test(t)?"&":"?",n=Object.keys(e);return n.length===0?t:t+r+n.map(o=>o==="q"?"q="+e.q.split("+").map(encodeURIComponent).join("+"):`${o}=${encodeURIComponent(e[o])}`).join("&")}a(mHo,"addQueryParameters");var gHo=/\{[^{}}]+\}/g;function AHo(t){return t.replace(/(?:^\W+)|(?:(?r.concat(n),[]):[]}a(yHo,"extractUrlVariableNames");function svn(t,e){let r={__proto__:null};for(let n of Object.keys(t))e.indexOf(n)===-1&&(r[n]=t[n]);return r}a(svn,"omit");function cvn(t){return t.split(/(%[0-9A-Fa-f]{2})/g).map(function(e){return/%[0-9A-Fa-f]/.test(e)||(e=encodeURI(e).replace(/%5B/g,"[").replace(/%5D/g,"]")),e}).join("")}a(cvn,"encodeReserved");function Cle(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}a(Cle,"encodeUnreserved");function SIe(t,e,r){return e=t==="+"||t==="#"?cvn(e):Cle(e),r?Cle(r)+"="+e:e}a(SIe,"encodeValue");function vle(t){return t!=null}a(vle,"isDefined");function aqt(t){return t===";"||t==="&"||t==="?"}a(aqt,"isKeyOperator");function EHo(t,e,r,n){var o=t[r],s=[];if(vle(o)&&o!=="")if(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||typeof o=="boolean")o=o.toString(),n&&n!=="*"&&(o=o.substring(0,parseInt(n,10))),s.push(SIe(e,o,aqt(e)?r:""));else if(n==="*")Array.isArray(o)?o.filter(vle).forEach(function(c){s.push(SIe(e,c,aqt(e)?r:""))}):Object.keys(o).forEach(function(c){vle(o[c])&&s.push(SIe(e,o[c],c))});else{let c=[];Array.isArray(o)?o.filter(vle).forEach(function(l){c.push(SIe(e,l))}):Object.keys(o).forEach(function(l){vle(o[l])&&(c.push(Cle(l)),c.push(SIe(e,o[l].toString())))}),aqt(e)?s.push(Cle(r)+"="+c.join(",")):c.length!==0&&s.push(c.join(","))}else e===";"?vle(o)&&s.push(Cle(r)):o===""&&(e==="&"||e==="?")?s.push(Cle(r)+"="):o===""&&s.push("");return s}a(EHo,"getValues");function _Ho(t){return{expand:vHo.bind(null,t)}}a(_Ho,"parseUrl");function vHo(t,e){var r=["+","#",".","/",";","?","&"];return t=t.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(n,o,s){if(o){let l="",u=[];if(r.indexOf(o.charAt(0))!==-1&&(l=o.charAt(0),o=o.substr(1)),o.split(/,/g).forEach(function(d){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(d);u.push(EHo(e,l,f[1],f[2]||f[3]))}),l&&l!=="+"){var c=",";return l==="?"?c="&":l!=="#"&&(c=l),(u.length!==0?l:"")+u.join(c)}else return u.join(",")}else return cvn(s)}),t==="/"?t:t.replace(/\/$/,"")}a(vHo,"expand");function lvn(t){let e=t.method.toUpperCase(),r=(t.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),n=Object.assign({},t.headers),o,s=svn(t,["method","baseUrl","url","headers","request","mediaType"]),c=yHo(r);r=_Ho(r).expand(s),/^http/.test(r)||(r=t.baseUrl+r);let l=Object.keys(t).filter(f=>c.includes(f)).concat("baseUrl"),u=svn(s,l);if(!/application\/octet-stream/i.test(n.accept)&&(t.mediaType.format&&(n.accept=n.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${t.mediaType.format}`)).join(",")),r.endsWith("/graphql")&&t.mediaType.previews?.length)){let f=n.accept.match(/(?{let m=t.mediaType.format?`.${t.mediaType.format}`:"+json";return`application/vnd.github.${h}-preview${m}`}).join(",")}return["GET","HEAD"].includes(e)?r=mHo(r,u):"data"in u?o=u.data:Object.keys(u).length&&(o=u),!n["content-type"]&&typeof o<"u"&&(n["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(e)&&typeof o>"u"&&(o=""),Object.assign({method:e,url:r,headers:n},typeof o<"u"?{body:o}:null,t.request?{request:t.request}:null)}a(lvn,"parse");function CHo(t,e,r){return lvn(cqt(t,e,r))}a(CHo,"endpointWithDefaults");function uvn(t,e){let r=cqt(t,e),n=CHo.bind(null,r);return Object.assign(n,{DEFAULTS:r,defaults:uvn.bind(null,r),merge:cqt.bind(null,r),parse:lvn})}a(uvn,"withDefaults");var dvn=uvn(null,fHo);var Svn=fe(mvn(),1);p();var bHo=/^-?\d+$/,yvn=/^-?\d+n+$/,lqt=JSON.stringify,gvn=JSON.parse,SHo=/^-?\d+n$/,THo=/([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,IHo=/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g,Evn=a((t,e,r)=>"rawJSON"in JSON?lqt(t,(c,l)=>typeof l=="bigint"?JSON.rawJSON(l.toString()):typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r):t?lqt(t,(c,l)=>typeof l=="string"&&yvn.test(l)||typeof l=="bigint"?l.toString()+"n":typeof e=="function"?e(c,l):(Array.isArray(e)&&e.includes(c),l),r).replace(THo,"$1$2$3").replace(IHo,"$1$2$3"):lqt(t,e,r),"JSONStringify"),TKe=new Map,xHo=a(()=>{let t=JSON.parse.toString();if(TKe.has(t))return TKe.get(t);try{let e=JSON.parse("1",(r,n,o)=>!!o?.source&&o.source==="1");return TKe.set(t,e),e}catch{return TKe.set(t,!1),!1}},"isContextSourceSupported"),wHo=a((t,e,r,n)=>typeof e=="string"&&SHo.test(e)?BigInt(e.slice(0,-1)):typeof e=="string"&&yvn.test(e)?e.slice(0,-1):typeof n!="function"?e:n(t,e,r),"convertMarkedBigIntsReviver"),RHo=a((t,e)=>JSON.parse(t,(r,n,o)=>{let s=typeof n=="number"&&(n>Number.MAX_SAFE_INTEGER||n{if(!t)return gvn(t,e);if(xHo())return RHo(t,e);let r=t.replace(PHo,(n,o,s,c)=>{let l=n[0]==='"';if(l&&kHo.test(n))return n.substring(0,n.length-1)+'n"';let d=s||c,f=o&&(o.lengthwHo(n,o,s,e))},"JSONParse");p();var uK=class extends Error{static{a(this,"RequestError")}name;status;request;response;constructor(e,r,n){super(e,{cause:n.cause}),this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0);"response"in n&&(this.response=n.response);let o=Object.assign({},n.request);n.request.headers.authorization&&(o.headers=Object.assign({},n.request.headers,{authorization:n.request.headers.authorization.replace(/(?"","noop");async function bvn(t){let e=t.request?.fetch||globalThis.fetch;if(!e)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let r=t.request?.log||console,n=t.request?.parseSuccessResponseBody!==!1,o=MHo(t.body)||Array.isArray(t.body)?Evn(t.body):t.body,s=Object.fromEntries(Object.entries(t.headers).map(([h,m])=>[h,String(m)])),c;try{c=await e(t.url,{method:t.method,body:o,redirect:t.request?.redirect,headers:s,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(h){let m="Unknown Error";if(h instanceof Error){if(h.name==="AbortError")throw h.status=500,h;m=h.message,h.name==="TypeError"&&"cause"in h&&(h.cause instanceof Error?m=h.cause.message:typeof h.cause=="string"&&(m=h.cause))}let g=new uK(m,500,{request:t});throw g.cause=h,g}let l=c.status,u=c.url,d={};for(let[h,m]of c.headers)d[h]=m;let f={url:u,status:l,headers:d,data:""};if("deprecation"in d){let h=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/),m=h&&h.pop();r.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${m?`. See ${m}`:""}`)}if(l===204||l===205)return f;if(t.method==="HEAD"){if(l<400)return f;throw new uK(c.statusText,l,{response:f,request:t})}if(l===304)throw f.data=await uqt(c),new uK("Not modified",l,{response:f,request:t});if(l>=400)throw f.data=await uqt(c),new uK(BHo(f.data),l,{response:f,request:t});return f.data=n?await uqt(c):c.body,f}a(bvn,"fetchWrapper");async function uqt(t){let e=t.headers.get("content-type");if(!e)return t.text().catch(Cvn);let r=(0,Svn.safeParse)(e);if(OHo(r)){let n="";try{return n=await t.text(),vvn(n)}catch{return n}}else return r.type.startsWith("text/")||r.parameters.charset?.toLowerCase()==="utf-8"?t.text().catch(Cvn):t.arrayBuffer().catch(()=>new ArrayBuffer(0))}a(uqt,"getResponseData");function OHo(t){return t.type==="application/json"||t.type==="application/scim+json"}a(OHo,"isJSONResponse");function BHo(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return"Unknown error";if("message"in t){let e="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map(r=>JSON.stringify(r)).join(", ")}${e}`:`${t.message}${e}`}return`Unknown error: ${JSON.stringify(t)}`}a(BHo,"toErrorMessage");function dqt(t,e){let r=t.defaults(e);return Object.assign(a(function(o,s){let c=r.merge(o,s);if(!c.request||!c.request.hook)return bvn(r.parse(c));let l=a((u,d)=>bvn(r.parse(r.merge(u,d))),"request2");return Object.assign(l,{endpoint:r,defaults:dqt.bind(null,r)}),c.request.hook(l,c)},"newApi"),{endpoint:r,defaults:dqt.bind(null,r)})}a(dqt,"withDefaults");var IIe=dqt(dvn,NHo);p();var LHo="0.0.0-development";function FHo(t){return`Request failed due to following response errors: `+t.errors.map(e=>` - ${e.message}`).join(` -`)}a(c7o,"_buildMessageForResponseErrors");var l7o=class extends Error{static{a(this,"GraphqlResponseError")}constructor(t,e,r){super(c7o(r)),this.request=t,this.headers=e,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}name="GraphqlResponseError";errors;data},u7o=["method","baseUrl","url","headers","request","query","mediaType","operationName"],d7o=["query","method","url"],_En=/\/api\/v3\/?$/;function f7o(t,e,r){if(r){if(typeof e=="string"&&"query"in r)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(let c in r)if(d7o.includes(c))return Promise.reject(new Error(`[@octokit/graphql] "${c}" cannot be used as variable name`))}let n=typeof e=="string"?Object.assign({query:e},r):e,o=Object.keys(n).reduce((c,l)=>u7o.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return _En.test(s)&&(o.url=s.replace(_En,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new l7o(o,l,c.data)}return c.data.data})}a(f7o,"graphql");function XUt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>f7o(r,o,s),"newApi"),{defaults:XUt.bind(null,r),endpoint:r.endpoint})}a(XUt,"withDefaults");var CEn=XUt(yIe,{headers:{"user-agent":`octokit-graphql.js/${a7o} ${GQ()}`},method:"POST",url:"/graphql"});function vEn(t){return XUt(t,{method:"POST",url:"/graphql"})}a(vEn,"withCustomRequest");p();var e7t="(?:[a-zA-Z0-9_-]+)",bEn="\\.",SEn=new RegExp(`^${e7t}${bEn}${e7t}${bEn}${e7t}$`),p7o=SEn.test.bind(SEn);async function h7o(t){let e=p7o(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(h7o,"auth");function m7o(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a(m7o,"withAuthorizationPrefix");async function g7o(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=m7o(t),e(o)}a(g7o,"hook");var TEn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(h7o.bind(null,e),{hook:g7o.bind(null,e)})},"createTokenAuth2");p();var t7t="7.0.6";var IEn=a(()=>{},"noop"),A7o=console.warn.bind(console),y7o=console.error.bind(console);function E7o(t={}){return typeof t.debug!="function"&&(t.debug=IEn),typeof t.info!="function"&&(t.info=IEn),typeof t.warn!="function"&&(t.warn=A7o),typeof t.error!="function"&&(t.error=y7o),t}a(E7o,"createLogger");var xEn=`octokit-core.js/${t7t} ${GQ()}`,DYe=class{static{a(this,"Octokit")}static VERSION=t7t;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new Xyn.Collection,n={baseUrl:yIe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${xEn}`:xEn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=yIe.defaults(n),this.graphql=vEn(this.request).defaults(n),this.log=E7o(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=TEn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(r7t,"requestLog");r7t.VERSION=wEn;p();var _7o="0.0.0-development";function C7o(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(C7o,"normalizePaginatedListResponse");function n7t(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=C7o(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:kEn(t,e,r,n)})}a(kEn,"gather");var yZu=Object.assign(REn,{iterator:n7t});function i7t(t){return{paginate:Object.assign(REn.bind(null,t),{iterator:n7t.bind(null,t)})}}a(i7t,"paginateRest");i7t.VERSION=_7o;p();p();var o7t="17.0.0";p();p();var v7o={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},PEn=v7o;var cK=new Map;for(let[t,e]of Object.entries(PEn))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);cK.has(t)||cK.set(t,new Map),cK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var b7o={has({scope:t},e){return cK.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...cK.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=cK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=S7o(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function s7t(t){let e={};for(let r of cK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},b7o);return e}a(s7t,"endpointsToMethods");function S7o(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(S7o,"decorate");function T7o(t){return{rest:s7t(t)}}a(T7o,"restEndpointMethods");T7o.VERSION=o7t;function a7t(t){let e=s7t(t);return{...e,rest:e}}a(a7t,"legacyRestEndpointMethods");a7t.VERSION=o7t;p();var DEn="22.0.1";var NEn=DYe.plugin(r7t,a7t,i7t).defaults({userAgent:`octokit-rest.js/${DEn}`});var x7o=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),pc=new ge("GitHubClient"),zy=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(ar);return this.octokit=new NEn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!x7o.has(o))return pc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];pc.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){pc.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return pc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(pc.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new Pd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){pc.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return pc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return pc.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){pc.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),pc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(pc.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Pd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){pc.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){pc.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return pc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(pc.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Pd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){pc.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return pc.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){pc.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return pc.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){pc.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return pc.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw pc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Pd(l.status,l.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){pc.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){pc.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return pc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(pc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Zc=new ge("CodingAgentClient"),Nx=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){Zc.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${VUt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:$yn(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...Gm(this.ctx)};if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new w_;let g=await this.ctx.get(ar).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new w_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new w_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Zc.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new w_;let E=y.pull_request?.number;if(typeof E!="number")throw new z0("No valid pull request number returned from job");let v=await new zy(this.ctx).getPullRequest(n,o,E);return Zc.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw Zc.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new Yf("Title is required and cannot be empty");if(!r?.trim())throw Zc.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new Yf("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Zc.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new Yf("Owner is required and cannot be empty");if(!o?.trim())throw Zc.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new Yf("Repository name is required and cannot be empty");Zc.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Ur).resolveSession();if(!r?.accessToken)throw Zc.debug(this.ctx,"Failed to get access token"),new Dx("Failed to call coding agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(ar).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Zc.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new w_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...Gm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new w_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get coding agent sessions: HTTP ${l.status} - ${d}`;throw Zc.error(this.ctx,f),new z0(f)}let u=await l.json();return Zc.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof _P)throw s;let c=`Failed to get coding agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Zc.error(this.ctx,c),new mIe(c)}}async getSessionLogs(e,r){if(Zc.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new Yf("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new w_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...Gm(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Zc.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new w_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get coding agent session logs: HTTP ${l.status} - ${u}`;throw Zc.error(this.ctx,d),new z0(d)}return await l.text()}catch(s){if(s instanceof _P)throw s;let c=`Failed to get coding agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Zc.error(this.ctx,c),new mIe(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw Zc.error(this.ctx,`Coding agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new z0("Coding agent is not enabled or you do not have access. Learn more about coding agent at https://docs.github.com/copilot/concepts/agents/coding-agent/about-coding-agent"):new z0(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw Zc.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new z0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Zc.error(this.ctx,"API response missing job_id or session_id",r),new z0("Invalid response from coding agent");return r}};p();p();var eO=class{static{a(this,"LSPRequestSender")}};var MEn=ce(ti());var NYe=class{constructor(){this.codingAgentMessageRequestType=new MEn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{Ye.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(eO).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return Ye.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return Ye.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var kv=ce(wo());function c7t(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(c7t,"adaptCancellationToken");function OEn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(OEn,"adaptProgressCallback");function BEn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(BEn,"createEndpointInfo");function LEn(t){let e={role:w7o(t.role),content:R7o(t.content)};if(t.role===kv.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===kv.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===kv.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=bze(n);o&&(e.thinking=o);let s=vze(n);s&&(e.phase=s)}n.type===kv.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(LEn,"convertToCopilotChatMessage");function w7o(t){switch(t){case kv.Raw.ChatRole.System:return"system";case kv.Raw.ChatRole.User:return"user";case kv.Raw.ChatRole.Assistant:return"assistant";case kv.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(w7o,"convertRole");function R7o(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===kv.Raw.ChatCompletionContentPartKind.Text||r.type===kv.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===kv.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===kv.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===kv.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(R7o,"convertContent");p();var u3=ce(wo());var MYe=class extends u3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c}static{a(this,"InternalPromptRenderer")}async renderWithOptions(r,n,o){let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===u3.Raw.ChatRole.System&&o?.role===u3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===u3.Raw.ChatCompletionContentPartKind.Text&&l.type===u3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` -`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:u3.Raw.ChatCompletionContentPartKind.Text,text:` -`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===u3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function FEn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(M7o(e)){case"image/png":return k7o(e);case"image/gif":return P7o(e);case"image/jpeg":case"image/jpg":return D7o(e);case"image/webp":return N7o(e);default:throw new Error("Unsupported image format")}}a(FEn,"getImageDimensions");function k7o(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(k7o,"getPngDimensions");function P7o(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(P7o,"getGifDimensions");function D7o(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(D7o,"getJpegDimensions");function N7o(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function OYe(t){let e=Ss(t.tokenizer);return new l7t(e,t)}a(OYe,"createPromptTsxTokenizer");function L7o(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(L7o,"estimateDocumentTokenCost");var Kf=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=BEn(n),c=OYe(n);this._internalRenderer=new MYe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?OEn(e):void 0,s=r?c7t(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?rAn(c.messages):nAn(c.messages),{messages:c.messages.map(LEn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?c7t(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function u7t(t,e,r,n,o,s){return await Kf.create(t,e,r,s).renderPrompt(n,o,s)}a(u7t,"renderTsxPrompt");p();p();p();var UEn=new ge("toolCallRoundsBuilder");function tO(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(tO,"buildAssistantRounds");p();var k_=ce(wo());var EIe=new ge("toolCalling"),Mx=class extends sr{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,k_.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return EIe.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(nle,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(Cze,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,E=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,v)))}return _}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;EIe.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(k_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,k_.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(k_.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;EIe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(k_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` -`):JSON.stringify(e.content)}truncateContent(e,r){let n=this.props.modelConfiguration;if(!n||e.lengthQHo.includes(l)?(c[l]=n[l],c):(c.variables||(c.variables={}),c.variables[l]=n[l],c),{}),s=n.baseUrl||t.endpoint.DEFAULTS.baseUrl;return Tvn.test(s)&&(o.url=s.replace(Tvn,"/api/graphql")),t(o).then(c=>{if(c.data.errors){let l={};for(let u of Object.keys(c.headers))l[u]=c.headers[u];throw new UHo(o,l,c.data)}return c.data.data})}a(jHo,"graphql");function fqt(t,e){let r=t.defaults(e);return Object.assign(a((o,s)=>jHo(r,o,s),"newApi"),{defaults:fqt.bind(null,r),endpoint:r.endpoint})}a(fqt,"withDefaults");var Ivn=fqt(IIe,{headers:{"user-agent":`octokit-graphql.js/${LHo} ${zQ()}`},method:"POST",url:"/graphql"});function xvn(t){return fqt(t,{method:"POST",url:"/graphql"})}a(xvn,"withCustomRequest");p();var pqt="(?:[a-zA-Z0-9_-]+)",wvn="\\.",Rvn=new RegExp(`^${pqt}${wvn}${pqt}${wvn}${pqt}$`),HHo=Rvn.test.bind(Rvn);async function GHo(t){let e=HHo(t),r=t.startsWith("v1.")||t.startsWith("ghs_"),n=t.startsWith("ghu_");return{type:"token",token:t,tokenType:e?"app":r?"installation":n?"user-to-server":"oauth"}}a(GHo,"auth");function $Ho(t){return t.split(/\./).length===3?`bearer ${t}`:`token ${t}`}a($Ho,"withAuthorizationPrefix");async function VHo(t,e,r,n){let o=e.endpoint.merge(r,n);return o.headers.authorization=$Ho(t),e(o)}a(VHo,"hook");var Pvn=a(function(e){if(!e)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof e!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return e=e.replace(/^(token|bearer) +/i,""),Object.assign(GHo.bind(null,e),{hook:VHo.bind(null,e)})},"createTokenAuth2");p();var hqt="7.0.6";var kvn=a(()=>{},"noop"),WHo=console.warn.bind(console),zHo=console.error.bind(console);function YHo(t={}){return typeof t.debug!="function"&&(t.debug=kvn),typeof t.info!="function"&&(t.info=kvn),typeof t.warn!="function"&&(t.warn=WHo),typeof t.error!="function"&&(t.error=zHo),t}a(YHo,"createLogger");var Dvn=`octokit-core.js/${hqt} ${zQ()}`,IKe=class{static{a(this,"Octokit")}static VERSION=hqt;static defaults(e){return class extends this{static{a(this,"OctokitWithDefaults")}constructor(...n){let o=n[0]||{};if(typeof e=="function"){super(e(o));return}super(Object.assign({},e,o,o.userAgent&&e.userAgent?{userAgent:`${o.userAgent} ${e.userAgent}`}:null))}}}static plugins=[];static plugin(...e){let r=this.plugins;return class extends this{static{a(this,"NewOctokit")}static plugins=r.concat(e.filter(o=>!r.includes(o)))}}constructor(e={}){let r=new ivn.Collection,n={baseUrl:IIe.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},e.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};if(n.headers["user-agent"]=e.userAgent?`${e.userAgent} ${Dvn}`:Dvn,e.baseUrl&&(n.baseUrl=e.baseUrl),e.previews&&(n.mediaType.previews=e.previews),e.timeZone&&(n.headers["time-zone"]=e.timeZone),this.request=IIe.defaults(n),this.graphql=xvn(this.request).defaults(n),this.log=YHo(e.log),this.hook=r,e.authStrategy){let{authStrategy:s,...c}=e,l=s(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:c},e.auth));r.wrap("request",l.hook),this.auth=l}else if(!e.auth)this.auth=async()=>({type:"unauthenticated"});else{let s=Pvn(e.auth);r.wrap("request",s.hook),this.auth=s}let o=this.constructor;for(let s=0;s{t.log.debug("request",r);let n=Date.now(),o=t.request.endpoint.parse(r),s=o.url.replace(r.baseUrl,"");return e(r).then(c=>{let l=c.headers["x-github-request-id"];return t.log.info(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c}).catch(c=>{let l=c.response?.headers["x-github-request-id"]||"UNKNOWN";throw t.log.error(`${o.method} ${s} - ${c.status} with id ${l} in ${Date.now()-n}ms`),c})})}a(mqt,"requestLog");mqt.VERSION=Nvn;p();var KHo="0.0.0-development";function JHo(t){if(!t.data)return{...t,data:[]};if(!(("total_count"in t.data||"total_commits"in t.data)&&!("url"in t.data)))return t;let r=t.data.incomplete_results,n=t.data.repository_selection,o=t.data.total_count,s=t.data.total_commits;delete t.data.incomplete_results,delete t.data.repository_selection,delete t.data.total_count,delete t.data.total_commits;let c=Object.keys(t.data)[0],l=t.data[c];return t.data=l,typeof r<"u"&&(t.data.incomplete_results=r),typeof n<"u"&&(t.data.repository_selection=n),t.data.total_count=o,t.data.total_commits=s,t}a(JHo,"normalizePaginatedListResponse");function gqt(t,e,r){let n=typeof e=="function"?e.endpoint(r):t.request.endpoint(e,r),o=typeof e=="function"?e:t.request,s=n.method,c=n.headers,l=n.url;return{[Symbol.asyncIterator]:()=>({async next(){if(!l)return{done:!0};try{let u=await o({method:s,url:l,headers:c}),d=JHo(u);if(l=((d.headers.link||"").match(/<([^<>]+)>;\s*rel="next"/)||[])[1],!l&&"total_commits"in d.data){let f=new URL(d.url),h=f.searchParams,m=parseInt(h.get("page")||"1",10),g=parseInt(h.get("per_page")||"250",10);m*g{if(o.done)return e;let s=!1;function c(){s=!0}return a(c,"done"),e=e.concat(n?n(o.value,c):o.value.data),s?e:Ovn(t,e,r,n)})}a(Ovn,"gather");var med=Object.assign(Mvn,{iterator:gqt});function Aqt(t){return{paginate:Object.assign(Mvn.bind(null,t),{iterator:gqt.bind(null,t)})}}a(Aqt,"paginateRest");Aqt.VERSION=KHo;p();p();var yqt="17.0.0";p();p();var ZHo={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],approveWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve"],cancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel"],createEnvironmentVariable:["POST /repos/{owner}/{repo}/environments/{environment_name}/variables"],createHostedRunnerForOrg:["POST /orgs/{org}/actions/hosted-runners"],createOrUpdateEnvironmentSecret:["PUT /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}"],createOrgVariable:["POST /orgs/{org}/actions/variables"],createRegistrationTokenForOrg:["POST /orgs/{org}/actions/runners/registration-token"],createRegistrationTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/registration-token"],createRemoveTokenForOrg:["POST /orgs/{org}/actions/runners/remove-token"],createRemoveTokenForRepo:["POST /repos/{owner}/{repo}/actions/runners/remove-token"],createRepoVariable:["POST /repos/{owner}/{repo}/actions/variables"],createWorkflowDispatch:["POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches"],deleteActionsCacheById:["DELETE /repos/{owner}/{repo}/actions/caches/{cache_id}"],deleteActionsCacheByKey:["DELETE /repos/{owner}/{repo}/actions/caches{?key,ref}"],deleteArtifact:["DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],deleteCustomImageFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],deleteCustomImageVersionFromOrg:["DELETE /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],deleteEnvironmentSecret:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],deleteEnvironmentVariable:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],deleteHostedRunnerForOrg:["DELETE /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],deleteOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}"],deleteOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}"],deleteRepoVariable:["DELETE /repos/{owner}/{repo}/actions/variables/{name}"],deleteSelfHostedRunnerFromOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}"],deleteSelfHostedRunnerFromRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}"],deleteWorkflowRun:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}"],deleteWorkflowRunLogs:["DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],disableSelectedRepositoryGithubActionsOrganization:["DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}"],disableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable"],downloadArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}"],downloadJobLogsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"],downloadWorkflowRunAttemptLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"],downloadWorkflowRunLogs:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"],enableSelectedRepositoryGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories/{repository_id}"],enableWorkflow:["PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable"],forceCancelWorkflowRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel"],generateRunnerJitconfigForOrg:["POST /orgs/{org}/actions/runners/generate-jitconfig"],generateRunnerJitconfigForRepo:["POST /repos/{owner}/{repo}/actions/runners/generate-jitconfig"],getActionsCacheList:["GET /repos/{owner}/{repo}/actions/caches"],getActionsCacheUsage:["GET /repos/{owner}/{repo}/actions/cache/usage"],getActionsCacheUsageByRepoForOrg:["GET /orgs/{org}/actions/cache/usage-by-repository"],getActionsCacheUsageForOrg:["GET /orgs/{org}/actions/cache/usage"],getAllowedActionsOrganization:["GET /orgs/{org}/actions/permissions/selected-actions"],getAllowedActionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/selected-actions"],getArtifact:["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"],getCustomImageForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}"],getCustomImageVersionForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions/{version}"],getCustomOidcSubClaimForRepo:["GET /repos/{owner}/{repo}/actions/oidc/customization/sub"],getEnvironmentPublicKey:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key"],getEnvironmentSecret:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}"],getEnvironmentVariable:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],getGithubActionsDefaultWorkflowPermissionsOrganization:["GET /orgs/{org}/actions/permissions/workflow"],getGithubActionsDefaultWorkflowPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions/workflow"],getGithubActionsPermissionsOrganization:["GET /orgs/{org}/actions/permissions"],getGithubActionsPermissionsRepository:["GET /repos/{owner}/{repo}/actions/permissions"],getHostedRunnerForOrg:["GET /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],getHostedRunnersGithubOwnedImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/github-owned"],getHostedRunnersLimitsForOrg:["GET /orgs/{org}/actions/hosted-runners/limits"],getHostedRunnersMachineSpecsForOrg:["GET /orgs/{org}/actions/hosted-runners/machine-sizes"],getHostedRunnersPartnerImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/partner"],getHostedRunnersPlatformsForOrg:["GET /orgs/{org}/actions/hosted-runners/platforms"],getJobForWorkflowRun:["GET /repos/{owner}/{repo}/actions/jobs/{job_id}"],getOrgPublicKey:["GET /orgs/{org}/actions/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}"],getOrgVariable:["GET /orgs/{org}/actions/variables/{name}"],getPendingDeploymentsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],getRepoPermissions:["GET /repos/{owner}/{repo}/actions/permissions",{},{renamed:["actions","getGithubActionsPermissionsRepository"]}],getRepoPublicKey:["GET /repos/{owner}/{repo}/actions/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/actions/secrets/{secret_name}"],getRepoVariable:["GET /repos/{owner}/{repo}/actions/variables/{name}"],getReviewsForRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals"],getSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}"],getSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}"],getWorkflow:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],getWorkflowAccessToRepository:["GET /repos/{owner}/{repo}/actions/permissions/access"],getWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],getWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"],getWorkflowRunUsage:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"],getWorkflowUsage:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing"],listArtifactsForRepo:["GET /repos/{owner}/{repo}/actions/artifacts"],listCustomImageVersionsForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom/{image_definition_id}/versions"],listCustomImagesForOrg:["GET /orgs/{org}/actions/hosted-runners/images/custom"],listEnvironmentSecrets:["GET /repos/{owner}/{repo}/environments/{environment_name}/secrets"],listEnvironmentVariables:["GET /repos/{owner}/{repo}/environments/{environment_name}/variables"],listGithubHostedRunnersInGroupForOrg:["GET /orgs/{org}/actions/runner-groups/{runner_group_id}/hosted-runners"],listHostedRunnersForOrg:["GET /orgs/{org}/actions/hosted-runners"],listJobsForWorkflowRun:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"],listJobsForWorkflowRunAttempt:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"],listLabelsForSelfHostedRunnerForOrg:["GET /orgs/{org}/actions/runners/{runner_id}/labels"],listLabelsForSelfHostedRunnerForRepo:["GET /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],listOrgSecrets:["GET /orgs/{org}/actions/secrets"],listOrgVariables:["GET /orgs/{org}/actions/variables"],listRepoOrganizationSecrets:["GET /repos/{owner}/{repo}/actions/organization-secrets"],listRepoOrganizationVariables:["GET /repos/{owner}/{repo}/actions/organization-variables"],listRepoSecrets:["GET /repos/{owner}/{repo}/actions/secrets"],listRepoVariables:["GET /repos/{owner}/{repo}/actions/variables"],listRepoWorkflows:["GET /repos/{owner}/{repo}/actions/workflows"],listRunnerApplicationsForOrg:["GET /orgs/{org}/actions/runners/downloads"],listRunnerApplicationsForRepo:["GET /repos/{owner}/{repo}/actions/runners/downloads"],listSelectedReposForOrgSecret:["GET /orgs/{org}/actions/secrets/{secret_name}/repositories"],listSelectedReposForOrgVariable:["GET /orgs/{org}/actions/variables/{name}/repositories"],listSelectedRepositoriesEnabledGithubActionsOrganization:["GET /orgs/{org}/actions/permissions/repositories"],listSelfHostedRunnersForOrg:["GET /orgs/{org}/actions/runners"],listSelfHostedRunnersForRepo:["GET /repos/{owner}/{repo}/actions/runners"],listWorkflowRunArtifacts:["GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts"],listWorkflowRuns:["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs"],listWorkflowRunsForRepo:["GET /repos/{owner}/{repo}/actions/runs"],reRunJobForWorkflowRun:["POST /repos/{owner}/{repo}/actions/jobs/{job_id}/rerun"],reRunWorkflow:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun"],reRunWorkflowFailedJobs:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs"],removeAllCustomLabelsFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels"],removeAllCustomLabelsFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],removeCustomLabelFromSelfHostedRunnerForOrg:["DELETE /orgs/{org}/actions/runners/{runner_id}/labels/{name}"],removeCustomLabelFromSelfHostedRunnerForRepo:["DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgVariable:["DELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}"],reviewCustomGatesForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule"],reviewPendingDeploymentsForRun:["POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"],setAllowedActionsOrganization:["PUT /orgs/{org}/actions/permissions/selected-actions"],setAllowedActionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/selected-actions"],setCustomLabelsForSelfHostedRunnerForOrg:["PUT /orgs/{org}/actions/runners/{runner_id}/labels"],setCustomLabelsForSelfHostedRunnerForRepo:["PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],setCustomOidcSubClaimForRepo:["PUT /repos/{owner}/{repo}/actions/oidc/customization/sub"],setGithubActionsDefaultWorkflowPermissionsOrganization:["PUT /orgs/{org}/actions/permissions/workflow"],setGithubActionsDefaultWorkflowPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions/workflow"],setGithubActionsPermissionsOrganization:["PUT /orgs/{org}/actions/permissions"],setGithubActionsPermissionsRepository:["PUT /repos/{owner}/{repo}/actions/permissions"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories"],setSelectedReposForOrgVariable:["PUT /orgs/{org}/actions/variables/{name}/repositories"],setSelectedRepositoriesEnabledGithubActionsOrganization:["PUT /orgs/{org}/actions/permissions/repositories"],setWorkflowAccessToRepository:["PUT /repos/{owner}/{repo}/actions/permissions/access"],updateEnvironmentVariable:["PATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}"],updateHostedRunnerForOrg:["PATCH /orgs/{org}/actions/hosted-runners/{hosted_runner_id}"],updateOrgVariable:["PATCH /orgs/{org}/actions/variables/{name}"],updateRepoVariable:["PATCH /repos/{owner}/{repo}/actions/variables/{name}"]},activity:{checkRepoIsStarredByAuthenticatedUser:["GET /user/starred/{owner}/{repo}"],deleteRepoSubscription:["DELETE /repos/{owner}/{repo}/subscription"],deleteThreadSubscription:["DELETE /notifications/threads/{thread_id}/subscription"],getFeeds:["GET /feeds"],getRepoSubscription:["GET /repos/{owner}/{repo}/subscription"],getThread:["GET /notifications/threads/{thread_id}"],getThreadSubscriptionForAuthenticatedUser:["GET /notifications/threads/{thread_id}/subscription"],listEventsForAuthenticatedUser:["GET /users/{username}/events"],listNotificationsForAuthenticatedUser:["GET /notifications"],listOrgEventsForAuthenticatedUser:["GET /users/{username}/events/orgs/{org}"],listPublicEvents:["GET /events"],listPublicEventsForRepoNetwork:["GET /networks/{owner}/{repo}/events"],listPublicEventsForUser:["GET /users/{username}/events/public"],listPublicOrgEvents:["GET /orgs/{org}/events"],listReceivedEventsForUser:["GET /users/{username}/received_events"],listReceivedPublicEventsForUser:["GET /users/{username}/received_events/public"],listRepoEvents:["GET /repos/{owner}/{repo}/events"],listRepoNotificationsForAuthenticatedUser:["GET /repos/{owner}/{repo}/notifications"],listReposStarredByAuthenticatedUser:["GET /user/starred"],listReposStarredByUser:["GET /users/{username}/starred"],listReposWatchedByUser:["GET /users/{username}/subscriptions"],listStargazersForRepo:["GET /repos/{owner}/{repo}/stargazers"],listWatchedReposForAuthenticatedUser:["GET /user/subscriptions"],listWatchersForRepo:["GET /repos/{owner}/{repo}/subscribers"],markNotificationsAsRead:["PUT /notifications"],markRepoNotificationsAsRead:["PUT /repos/{owner}/{repo}/notifications"],markThreadAsDone:["DELETE /notifications/threads/{thread_id}"],markThreadAsRead:["PATCH /notifications/threads/{thread_id}"],setRepoSubscription:["PUT /repos/{owner}/{repo}/subscription"],setThreadSubscription:["PUT /notifications/threads/{thread_id}/subscription"],starRepoForAuthenticatedUser:["PUT /user/starred/{owner}/{repo}"],unstarRepoForAuthenticatedUser:["DELETE /user/starred/{owner}/{repo}"]},apps:{addRepoToInstallation:["PUT /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","addRepoToInstallationForAuthenticatedUser"]}],addRepoToInstallationForAuthenticatedUser:["PUT /user/installations/{installation_id}/repositories/{repository_id}"],checkToken:["POST /applications/{client_id}/token"],createFromManifest:["POST /app-manifests/{code}/conversions"],createInstallationAccessToken:["POST /app/installations/{installation_id}/access_tokens"],deleteAuthorization:["DELETE /applications/{client_id}/grant"],deleteInstallation:["DELETE /app/installations/{installation_id}"],deleteToken:["DELETE /applications/{client_id}/token"],getAuthenticated:["GET /app"],getBySlug:["GET /apps/{app_slug}"],getInstallation:["GET /app/installations/{installation_id}"],getOrgInstallation:["GET /orgs/{org}/installation"],getRepoInstallation:["GET /repos/{owner}/{repo}/installation"],getSubscriptionPlanForAccount:["GET /marketplace_listing/accounts/{account_id}"],getSubscriptionPlanForAccountStubbed:["GET /marketplace_listing/stubbed/accounts/{account_id}"],getUserInstallation:["GET /users/{username}/installation"],getWebhookConfigForApp:["GET /app/hook/config"],getWebhookDelivery:["GET /app/hook/deliveries/{delivery_id}"],listAccountsForPlan:["GET /marketplace_listing/plans/{plan_id}/accounts"],listAccountsForPlanStubbed:["GET /marketplace_listing/stubbed/plans/{plan_id}/accounts"],listInstallationReposForAuthenticatedUser:["GET /user/installations/{installation_id}/repositories"],listInstallationRequestsForAuthenticatedApp:["GET /app/installation-requests"],listInstallations:["GET /app/installations"],listInstallationsForAuthenticatedUser:["GET /user/installations"],listPlans:["GET /marketplace_listing/plans"],listPlansStubbed:["GET /marketplace_listing/stubbed/plans"],listReposAccessibleToInstallation:["GET /installation/repositories"],listSubscriptionsForAuthenticatedUser:["GET /user/marketplace_purchases"],listSubscriptionsForAuthenticatedUserStubbed:["GET /user/marketplace_purchases/stubbed"],listWebhookDeliveries:["GET /app/hook/deliveries"],redeliverWebhookDelivery:["POST /app/hook/deliveries/{delivery_id}/attempts"],removeRepoFromInstallation:["DELETE /user/installations/{installation_id}/repositories/{repository_id}",{},{renamed:["apps","removeRepoFromInstallationForAuthenticatedUser"]}],removeRepoFromInstallationForAuthenticatedUser:["DELETE /user/installations/{installation_id}/repositories/{repository_id}"],resetToken:["PATCH /applications/{client_id}/token"],revokeInstallationAccessToken:["DELETE /installation/token"],scopeToken:["POST /applications/{client_id}/token/scoped"],suspendInstallation:["PUT /app/installations/{installation_id}/suspended"],unsuspendInstallation:["DELETE /app/installations/{installation_id}/suspended"],updateWebhookConfigForApp:["PATCH /app/hook/config"]},billing:{getGithubActionsBillingOrg:["GET /orgs/{org}/settings/billing/actions"],getGithubActionsBillingUser:["GET /users/{username}/settings/billing/actions"],getGithubBillingPremiumRequestUsageReportOrg:["GET /organizations/{org}/settings/billing/premium_request/usage"],getGithubBillingPremiumRequestUsageReportUser:["GET /users/{username}/settings/billing/premium_request/usage"],getGithubBillingUsageReportOrg:["GET /organizations/{org}/settings/billing/usage"],getGithubBillingUsageReportUser:["GET /users/{username}/settings/billing/usage"],getGithubPackagesBillingOrg:["GET /orgs/{org}/settings/billing/packages"],getGithubPackagesBillingUser:["GET /users/{username}/settings/billing/packages"],getSharedStorageBillingOrg:["GET /orgs/{org}/settings/billing/shared-storage"],getSharedStorageBillingUser:["GET /users/{username}/settings/billing/shared-storage"]},campaigns:{createCampaign:["POST /orgs/{org}/campaigns"],deleteCampaign:["DELETE /orgs/{org}/campaigns/{campaign_number}"],getCampaignSummary:["GET /orgs/{org}/campaigns/{campaign_number}"],listOrgCampaigns:["GET /orgs/{org}/campaigns"],updateCampaign:["PATCH /orgs/{org}/campaigns/{campaign_number}"]},checks:{create:["POST /repos/{owner}/{repo}/check-runs"],createSuite:["POST /repos/{owner}/{repo}/check-suites"],get:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}"],getSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}"],listAnnotations:["GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations"],listForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-runs"],listForSuite:["GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"],listSuitesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],rerequestRun:["POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"],rerequestSuite:["POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"],setSuitesPreferences:["PATCH /repos/{owner}/{repo}/check-suites/preferences"],update:["PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}"]},codeScanning:{commitAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits"],createAutofix:["POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],createVariantAnalysis:["POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses"],deleteAnalysis:["DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}"],deleteCodeqlDatabase:["DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getAlert:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}",{},{renamedParameters:{alert_id:"alert_number"}}],getAnalysis:["GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}"],getAutofix:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix"],getCodeqlDatabase:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"],getDefaultSetup:["GET /repos/{owner}/{repo}/code-scanning/default-setup"],getSarif:["GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}"],getVariantAnalysis:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}"],getVariantAnalysisRepoTask:["GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}"],listAlertInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances"],listAlertsForOrg:["GET /orgs/{org}/code-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/code-scanning/alerts"],listAlertsInstances:["GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances",{},{renamed:["codeScanning","listAlertInstances"]}],listCodeqlDatabases:["GET /repos/{owner}/{repo}/code-scanning/codeql/databases"],listRecentAnalyses:["GET /repos/{owner}/{repo}/code-scanning/analyses"],updateAlert:["PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}"],updateDefaultSetup:["PATCH /repos/{owner}/{repo}/code-scanning/default-setup"],uploadSarif:["POST /repos/{owner}/{repo}/code-scanning/sarifs"]},codeSecurity:{attachConfiguration:["POST /orgs/{org}/code-security/configurations/{configuration_id}/attach"],attachEnterpriseConfiguration:["POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"],createConfiguration:["POST /orgs/{org}/code-security/configurations"],createConfigurationForEnterprise:["POST /enterprises/{enterprise}/code-security/configurations"],deleteConfiguration:["DELETE /orgs/{org}/code-security/configurations/{configuration_id}"],deleteConfigurationForEnterprise:["DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],detachConfiguration:["DELETE /orgs/{org}/code-security/configurations/detach"],getConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}"],getConfigurationForRepository:["GET /repos/{owner}/{repo}/code-security-configuration"],getConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations"],getConfigurationsForOrg:["GET /orgs/{org}/code-security/configurations"],getDefaultConfigurations:["GET /orgs/{org}/code-security/configurations/defaults"],getDefaultConfigurationsForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/defaults"],getRepositoriesForConfiguration:["GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories"],getRepositoriesForEnterpriseConfiguration:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories"],getSingleConfigurationForEnterprise:["GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}"],setConfigurationAsDefault:["PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults"],setConfigurationAsDefaultForEnterprise:["PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults"],updateConfiguration:["PATCH /orgs/{org}/code-security/configurations/{configuration_id}"],updateEnterpriseConfiguration:["PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}"]},codesOfConduct:{getAllCodesOfConduct:["GET /codes_of_conduct"],getConductCode:["GET /codes_of_conduct/{key}"]},codespaces:{addRepositoryForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],checkPermissionsForDevcontainer:["GET /repos/{owner}/{repo}/codespaces/permissions_check"],codespaceMachinesForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/machines"],createForAuthenticatedUser:["POST /user/codespaces"],createOrUpdateOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],createOrUpdateSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}"],createWithPrForAuthenticatedUser:["POST /repos/{owner}/{repo}/pulls/{pull_number}/codespaces"],createWithRepoForAuthenticatedUser:["POST /repos/{owner}/{repo}/codespaces"],deleteForAuthenticatedUser:["DELETE /user/codespaces/{codespace_name}"],deleteFromOrganization:["DELETE /orgs/{org}/members/{username}/codespaces/{codespace_name}"],deleteOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],deleteSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}"],exportForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/exports"],getCodespacesForUserInOrg:["GET /orgs/{org}/members/{username}/codespaces"],getExportDetailsForAuthenticatedUser:["GET /user/codespaces/{codespace_name}/exports/{export_id}"],getForAuthenticatedUser:["GET /user/codespaces/{codespace_name}"],getOrgPublicKey:["GET /orgs/{org}/codespaces/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}"],getPublicKeyForAuthenticatedUser:["GET /user/codespaces/secrets/public-key"],getRepoPublicKey:["GET /repos/{owner}/{repo}/codespaces/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/codespaces/secrets/{secret_name}"],getSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}"],listDevcontainersInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/devcontainers"],listForAuthenticatedUser:["GET /user/codespaces"],listInOrganization:["GET /orgs/{org}/codespaces",{},{renamedParameters:{org_id:"org"}}],listInRepositoryForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces"],listOrgSecrets:["GET /orgs/{org}/codespaces/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/codespaces/secrets"],listRepositoriesForSecretForAuthenticatedUser:["GET /user/codespaces/secrets/{secret_name}/repositories"],listSecretsForAuthenticatedUser:["GET /user/codespaces/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],preFlightWithRepoForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/new"],publishForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/publish"],removeRepositoryForSecretForAuthenticatedUser:["DELETE /user/codespaces/secrets/{secret_name}/repositories/{repository_id}"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}"],repoMachinesForAuthenticatedUser:["GET /repos/{owner}/{repo}/codespaces/machines"],setRepositoriesForSecretForAuthenticatedUser:["PUT /user/codespaces/secrets/{secret_name}/repositories"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/codespaces/secrets/{secret_name}/repositories"],startForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/start"],stopForAuthenticatedUser:["POST /user/codespaces/{codespace_name}/stop"],stopInOrganization:["POST /orgs/{org}/members/{username}/codespaces/{codespace_name}/stop"],updateForAuthenticatedUser:["PATCH /user/codespaces/{codespace_name}"]},copilot:{addCopilotSeatsForTeams:["POST /orgs/{org}/copilot/billing/selected_teams"],addCopilotSeatsForUsers:["POST /orgs/{org}/copilot/billing/selected_users"],cancelCopilotSeatAssignmentForTeams:["DELETE /orgs/{org}/copilot/billing/selected_teams"],cancelCopilotSeatAssignmentForUsers:["DELETE /orgs/{org}/copilot/billing/selected_users"],copilotMetricsForOrganization:["GET /orgs/{org}/copilot/metrics"],copilotMetricsForTeam:["GET /orgs/{org}/team/{team_slug}/copilot/metrics"],getCopilotOrganizationDetails:["GET /orgs/{org}/copilot/billing"],getCopilotSeatDetailsForUser:["GET /orgs/{org}/members/{username}/copilot"],listCopilotSeats:["GET /orgs/{org}/copilot/billing/seats"]},credentials:{revoke:["POST /credentials/revoke"]},dependabot:{addSelectedRepoToOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],createOrUpdateOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}"],createOrUpdateRepoSecret:["PUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],deleteOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}"],deleteRepoSecret:["DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],getAlert:["GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],getOrgPublicKey:["GET /orgs/{org}/dependabot/secrets/public-key"],getOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}"],getRepoPublicKey:["GET /repos/{owner}/{repo}/dependabot/secrets/public-key"],getRepoSecret:["GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}"],listAlertsForEnterprise:["GET /enterprises/{enterprise}/dependabot/alerts"],listAlertsForOrg:["GET /orgs/{org}/dependabot/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/dependabot/alerts"],listOrgSecrets:["GET /orgs/{org}/dependabot/secrets"],listRepoSecrets:["GET /repos/{owner}/{repo}/dependabot/secrets"],listSelectedReposForOrgSecret:["GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],removeSelectedRepoFromOrgSecret:["DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}"],repositoryAccessForOrg:["GET /organizations/{org}/dependabot/repository-access"],setRepositoryAccessDefaultLevel:["PUT /organizations/{org}/dependabot/repository-access/default-level"],setSelectedReposForOrgSecret:["PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories"],updateAlert:["PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number}"],updateRepositoryAccessForOrg:["PATCH /organizations/{org}/dependabot/repository-access"]},dependencyGraph:{createRepositorySnapshot:["POST /repos/{owner}/{repo}/dependency-graph/snapshots"],diffRange:["GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}"],exportSbom:["GET /repos/{owner}/{repo}/dependency-graph/sbom"]},emojis:{get:["GET /emojis"]},enterpriseTeamMemberships:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/memberships/remove"],get:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"],list:["GET /enterprises/{enterprise}/teams/{enterprise-team}/memberships"],remove:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/memberships/{username}"]},enterpriseTeamOrganizations:{add:["PUT /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],bulkAdd:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/add"],bulkRemove:["POST /enterprises/{enterprise}/teams/{enterprise-team}/organizations/remove"],delete:["DELETE /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignment:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations/{org}"],getAssignments:["GET /enterprises/{enterprise}/teams/{enterprise-team}/organizations"]},enterpriseTeams:{create:["POST /enterprises/{enterprise}/teams"],delete:["DELETE /enterprises/{enterprise}/teams/{team_slug}"],get:["GET /enterprises/{enterprise}/teams/{team_slug}"],list:["GET /enterprises/{enterprise}/teams"],update:["PATCH /enterprises/{enterprise}/teams/{team_slug}"]},gists:{checkIsStarred:["GET /gists/{gist_id}/star"],create:["POST /gists"],createComment:["POST /gists/{gist_id}/comments"],delete:["DELETE /gists/{gist_id}"],deleteComment:["DELETE /gists/{gist_id}/comments/{comment_id}"],fork:["POST /gists/{gist_id}/forks"],get:["GET /gists/{gist_id}"],getComment:["GET /gists/{gist_id}/comments/{comment_id}"],getRevision:["GET /gists/{gist_id}/{sha}"],list:["GET /gists"],listComments:["GET /gists/{gist_id}/comments"],listCommits:["GET /gists/{gist_id}/commits"],listForUser:["GET /users/{username}/gists"],listForks:["GET /gists/{gist_id}/forks"],listPublic:["GET /gists/public"],listStarred:["GET /gists/starred"],star:["PUT /gists/{gist_id}/star"],unstar:["DELETE /gists/{gist_id}/star"],update:["PATCH /gists/{gist_id}"],updateComment:["PATCH /gists/{gist_id}/comments/{comment_id}"]},git:{createBlob:["POST /repos/{owner}/{repo}/git/blobs"],createCommit:["POST /repos/{owner}/{repo}/git/commits"],createRef:["POST /repos/{owner}/{repo}/git/refs"],createTag:["POST /repos/{owner}/{repo}/git/tags"],createTree:["POST /repos/{owner}/{repo}/git/trees"],deleteRef:["DELETE /repos/{owner}/{repo}/git/refs/{ref}"],getBlob:["GET /repos/{owner}/{repo}/git/blobs/{file_sha}"],getCommit:["GET /repos/{owner}/{repo}/git/commits/{commit_sha}"],getRef:["GET /repos/{owner}/{repo}/git/ref/{ref}"],getTag:["GET /repos/{owner}/{repo}/git/tags/{tag_sha}"],getTree:["GET /repos/{owner}/{repo}/git/trees/{tree_sha}"],listMatchingRefs:["GET /repos/{owner}/{repo}/git/matching-refs/{ref}"],updateRef:["PATCH /repos/{owner}/{repo}/git/refs/{ref}"]},gitignore:{getAllTemplates:["GET /gitignore/templates"],getTemplate:["GET /gitignore/templates/{name}"]},hostedCompute:{createNetworkConfigurationForOrg:["POST /orgs/{org}/settings/network-configurations"],deleteNetworkConfigurationFromOrg:["DELETE /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkConfigurationForOrg:["GET /orgs/{org}/settings/network-configurations/{network_configuration_id}"],getNetworkSettingsForOrg:["GET /orgs/{org}/settings/network-settings/{network_settings_id}"],listNetworkConfigurationsForOrg:["GET /orgs/{org}/settings/network-configurations"],updateNetworkConfigurationForOrg:["PATCH /orgs/{org}/settings/network-configurations/{network_configuration_id}"]},interactions:{getRestrictionsForAuthenticatedUser:["GET /user/interaction-limits"],getRestrictionsForOrg:["GET /orgs/{org}/interaction-limits"],getRestrictionsForRepo:["GET /repos/{owner}/{repo}/interaction-limits"],getRestrictionsForYourPublicRepos:["GET /user/interaction-limits",{},{renamed:["interactions","getRestrictionsForAuthenticatedUser"]}],removeRestrictionsForAuthenticatedUser:["DELETE /user/interaction-limits"],removeRestrictionsForOrg:["DELETE /orgs/{org}/interaction-limits"],removeRestrictionsForRepo:["DELETE /repos/{owner}/{repo}/interaction-limits"],removeRestrictionsForYourPublicRepos:["DELETE /user/interaction-limits",{},{renamed:["interactions","removeRestrictionsForAuthenticatedUser"]}],setRestrictionsForAuthenticatedUser:["PUT /user/interaction-limits"],setRestrictionsForOrg:["PUT /orgs/{org}/interaction-limits"],setRestrictionsForRepo:["PUT /repos/{owner}/{repo}/interaction-limits"],setRestrictionsForYourPublicRepos:["PUT /user/interaction-limits",{},{renamed:["interactions","setRestrictionsForAuthenticatedUser"]}]},issues:{addAssignees:["POST /repos/{owner}/{repo}/issues/{issue_number}/assignees"],addBlockedByDependency:["POST /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],addLabels:["POST /repos/{owner}/{repo}/issues/{issue_number}/labels"],addSubIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],checkUserCanBeAssigned:["GET /repos/{owner}/{repo}/assignees/{assignee}"],checkUserCanBeAssignedToIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/assignees/{assignee}"],create:["POST /repos/{owner}/{repo}/issues"],createComment:["POST /repos/{owner}/{repo}/issues/{issue_number}/comments"],createLabel:["POST /repos/{owner}/{repo}/labels"],createMilestone:["POST /repos/{owner}/{repo}/milestones"],deleteComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}"],deleteLabel:["DELETE /repos/{owner}/{repo}/labels/{name}"],deleteMilestone:["DELETE /repos/{owner}/{repo}/milestones/{milestone_number}"],get:["GET /repos/{owner}/{repo}/issues/{issue_number}"],getComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}"],getEvent:["GET /repos/{owner}/{repo}/issues/events/{event_id}"],getLabel:["GET /repos/{owner}/{repo}/labels/{name}"],getMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}"],getParent:["GET /repos/{owner}/{repo}/issues/{issue_number}/parent"],list:["GET /issues"],listAssignees:["GET /repos/{owner}/{repo}/assignees"],listComments:["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"],listCommentsForRepo:["GET /repos/{owner}/{repo}/issues/comments"],listDependenciesBlockedBy:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by"],listDependenciesBlocking:["GET /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocking"],listEvents:["GET /repos/{owner}/{repo}/issues/{issue_number}/events"],listEventsForRepo:["GET /repos/{owner}/{repo}/issues/events"],listEventsForTimeline:["GET /repos/{owner}/{repo}/issues/{issue_number}/timeline"],listForAuthenticatedUser:["GET /user/issues"],listForOrg:["GET /orgs/{org}/issues"],listForRepo:["GET /repos/{owner}/{repo}/issues"],listLabelsForMilestone:["GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels"],listLabelsForRepo:["GET /repos/{owner}/{repo}/labels"],listLabelsOnIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/labels"],listMilestones:["GET /repos/{owner}/{repo}/milestones"],listSubIssues:["GET /repos/{owner}/{repo}/issues/{issue_number}/sub_issues"],lock:["PUT /repos/{owner}/{repo}/issues/{issue_number}/lock"],removeAllLabels:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels"],removeAssignees:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees"],removeDependencyBlockedBy:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by/{issue_id}"],removeLabel:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}"],removeSubIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/sub_issue"],reprioritizeSubIssue:["PATCH /repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority"],setLabels:["PUT /repos/{owner}/{repo}/issues/{issue_number}/labels"],unlock:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock"],update:["PATCH /repos/{owner}/{repo}/issues/{issue_number}"],updateComment:["PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}"],updateLabel:["PATCH /repos/{owner}/{repo}/labels/{name}"],updateMilestone:["PATCH /repos/{owner}/{repo}/milestones/{milestone_number}"]},licenses:{get:["GET /licenses/{license}"],getAllCommonlyUsed:["GET /licenses"],getForRepo:["GET /repos/{owner}/{repo}/license"]},markdown:{render:["POST /markdown"],renderRaw:["POST /markdown/raw",{headers:{"content-type":"text/plain; charset=utf-8"}}]},meta:{get:["GET /meta"],getAllVersions:["GET /versions"],getOctocat:["GET /octocat"],getZen:["GET /zen"],root:["GET /"]},migrations:{deleteArchiveForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/archive"],deleteArchiveForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/archive"],downloadArchiveForOrg:["GET /orgs/{org}/migrations/{migration_id}/archive"],getArchiveForAuthenticatedUser:["GET /user/migrations/{migration_id}/archive"],getStatusForAuthenticatedUser:["GET /user/migrations/{migration_id}"],getStatusForOrg:["GET /orgs/{org}/migrations/{migration_id}"],listForAuthenticatedUser:["GET /user/migrations"],listForOrg:["GET /orgs/{org}/migrations"],listReposForAuthenticatedUser:["GET /user/migrations/{migration_id}/repositories"],listReposForOrg:["GET /orgs/{org}/migrations/{migration_id}/repositories"],listReposForUser:["GET /user/migrations/{migration_id}/repositories",{},{renamed:["migrations","listReposForAuthenticatedUser"]}],startForAuthenticatedUser:["POST /user/migrations"],startForOrg:["POST /orgs/{org}/migrations"],unlockRepoForAuthenticatedUser:["DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock"],unlockRepoForOrg:["DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock"]},oidc:{getOidcCustomSubTemplateForOrg:["GET /orgs/{org}/actions/oidc/customization/sub"],updateOidcCustomSubTemplateForOrg:["PUT /orgs/{org}/actions/oidc/customization/sub"]},orgs:{addSecurityManagerTeam:["PUT /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.addSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#add-a-security-manager-team"}],assignTeamToOrgRole:["PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],assignUserToOrgRole:["PUT /orgs/{org}/organization-roles/users/{username}/{role_id}"],blockUser:["PUT /orgs/{org}/blocks/{username}"],cancelInvitation:["DELETE /orgs/{org}/invitations/{invitation_id}"],checkBlockedUser:["GET /orgs/{org}/blocks/{username}"],checkMembershipForUser:["GET /orgs/{org}/members/{username}"],checkPublicMembershipForUser:["GET /orgs/{org}/public_members/{username}"],convertMemberToOutsideCollaborator:["PUT /orgs/{org}/outside_collaborators/{username}"],createArtifactStorageRecord:["POST /orgs/{org}/artifacts/metadata/storage-record"],createInvitation:["POST /orgs/{org}/invitations"],createIssueType:["POST /orgs/{org}/issue-types"],createWebhook:["POST /orgs/{org}/hooks"],customPropertiesForOrgsCreateOrUpdateOrganizationValues:["PATCH /organizations/{org}/org-properties/values"],customPropertiesForOrgsGetOrganizationValues:["GET /organizations/{org}/org-properties/values"],customPropertiesForReposCreateOrUpdateOrganizationDefinition:["PUT /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposCreateOrUpdateOrganizationDefinitions:["PATCH /orgs/{org}/properties/schema"],customPropertiesForReposCreateOrUpdateOrganizationValues:["PATCH /orgs/{org}/properties/values"],customPropertiesForReposDeleteOrganizationDefinition:["DELETE /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinition:["GET /orgs/{org}/properties/schema/{custom_property_name}"],customPropertiesForReposGetOrganizationDefinitions:["GET /orgs/{org}/properties/schema"],customPropertiesForReposGetOrganizationValues:["GET /orgs/{org}/properties/values"],delete:["DELETE /orgs/{org}"],deleteAttestationsBulk:["POST /orgs/{org}/attestations/delete-request"],deleteAttestationsById:["DELETE /orgs/{org}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /orgs/{org}/attestations/digest/{subject_digest}"],deleteIssueType:["DELETE /orgs/{org}/issue-types/{issue_type_id}"],deleteWebhook:["DELETE /orgs/{org}/hooks/{hook_id}"],disableSelectedRepositoryImmutableReleasesOrganization:["DELETE /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],enableSelectedRepositoryImmutableReleasesOrganization:["PUT /orgs/{org}/settings/immutable-releases/repositories/{repository_id}"],get:["GET /orgs/{org}"],getImmutableReleasesSettings:["GET /orgs/{org}/settings/immutable-releases"],getImmutableReleasesSettingsRepositories:["GET /orgs/{org}/settings/immutable-releases/repositories"],getMembershipForAuthenticatedUser:["GET /user/memberships/orgs/{org}"],getMembershipForUser:["GET /orgs/{org}/memberships/{username}"],getOrgRole:["GET /orgs/{org}/organization-roles/{role_id}"],getOrgRulesetHistory:["GET /orgs/{org}/rulesets/{ruleset_id}/history"],getOrgRulesetVersion:["GET /orgs/{org}/rulesets/{ruleset_id}/history/{version_id}"],getWebhook:["GET /orgs/{org}/hooks/{hook_id}"],getWebhookConfigForOrg:["GET /orgs/{org}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}"],list:["GET /organizations"],listAppInstallations:["GET /orgs/{org}/installations"],listArtifactStorageRecords:["GET /orgs/{org}/artifacts/{subject_digest}/metadata/storage-records"],listAttestationRepositories:["GET /orgs/{org}/attestations/repositories"],listAttestations:["GET /orgs/{org}/attestations/{subject_digest}"],listAttestationsBulk:["POST /orgs/{org}/attestations/bulk-list{?per_page,before,after}"],listBlockedUsers:["GET /orgs/{org}/blocks"],listFailedInvitations:["GET /orgs/{org}/failed_invitations"],listForAuthenticatedUser:["GET /user/orgs"],listForUser:["GET /users/{username}/orgs"],listInvitationTeams:["GET /orgs/{org}/invitations/{invitation_id}/teams"],listIssueTypes:["GET /orgs/{org}/issue-types"],listMembers:["GET /orgs/{org}/members"],listMembershipsForAuthenticatedUser:["GET /user/memberships/orgs"],listOrgRoleTeams:["GET /orgs/{org}/organization-roles/{role_id}/teams"],listOrgRoleUsers:["GET /orgs/{org}/organization-roles/{role_id}/users"],listOrgRoles:["GET /orgs/{org}/organization-roles"],listOrganizationFineGrainedPermissions:["GET /orgs/{org}/organization-fine-grained-permissions"],listOutsideCollaborators:["GET /orgs/{org}/outside_collaborators"],listPatGrantRepositories:["GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories"],listPatGrantRequestRepositories:["GET /orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories"],listPatGrantRequests:["GET /orgs/{org}/personal-access-token-requests"],listPatGrants:["GET /orgs/{org}/personal-access-tokens"],listPendingInvitations:["GET /orgs/{org}/invitations"],listPublicMembers:["GET /orgs/{org}/public_members"],listSecurityManagerTeams:["GET /orgs/{org}/security-managers",{},{deprecated:"octokit.rest.orgs.listSecurityManagerTeams() is deprecated, see https://docs.github.com/rest/orgs/security-managers#list-security-manager-teams"}],listWebhookDeliveries:["GET /orgs/{org}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /orgs/{org}/hooks"],pingWebhook:["POST /orgs/{org}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeMember:["DELETE /orgs/{org}/members/{username}"],removeMembershipForUser:["DELETE /orgs/{org}/memberships/{username}"],removeOutsideCollaborator:["DELETE /orgs/{org}/outside_collaborators/{username}"],removePublicMembershipForAuthenticatedUser:["DELETE /orgs/{org}/public_members/{username}"],removeSecurityManagerTeam:["DELETE /orgs/{org}/security-managers/teams/{team_slug}",{},{deprecated:"octokit.rest.orgs.removeSecurityManagerTeam() is deprecated, see https://docs.github.com/rest/orgs/security-managers#remove-a-security-manager-team"}],reviewPatGrantRequest:["POST /orgs/{org}/personal-access-token-requests/{pat_request_id}"],reviewPatGrantRequestsInBulk:["POST /orgs/{org}/personal-access-token-requests"],revokeAllOrgRolesTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}"],revokeAllOrgRolesUser:["DELETE /orgs/{org}/organization-roles/users/{username}"],revokeOrgRoleTeam:["DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}"],revokeOrgRoleUser:["DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}"],setImmutableReleasesSettings:["PUT /orgs/{org}/settings/immutable-releases"],setImmutableReleasesSettingsRepositories:["PUT /orgs/{org}/settings/immutable-releases/repositories"],setMembershipForUser:["PUT /orgs/{org}/memberships/{username}"],setPublicMembershipForAuthenticatedUser:["PUT /orgs/{org}/public_members/{username}"],unblockUser:["DELETE /orgs/{org}/blocks/{username}"],update:["PATCH /orgs/{org}"],updateIssueType:["PUT /orgs/{org}/issue-types/{issue_type_id}"],updateMembershipForAuthenticatedUser:["PATCH /user/memberships/orgs/{org}"],updatePatAccess:["POST /orgs/{org}/personal-access-tokens/{pat_id}"],updatePatAccesses:["POST /orgs/{org}/personal-access-tokens"],updateWebhook:["PATCH /orgs/{org}/hooks/{hook_id}"],updateWebhookConfigForOrg:["PATCH /orgs/{org}/hooks/{hook_id}/config"]},packages:{deletePackageForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}"],deletePackageForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}"],deletePackageForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}"],deletePackageVersionForAuthenticatedUser:["DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForOrg:["DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],deletePackageVersionForUser:["DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getAllPackageVersionsForAPackageOwnedByAnOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByOrg"]}],getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions",{},{renamed:["packages","getAllPackageVersionsForPackageOwnedByAuthenticatedUser"]}],getAllPackageVersionsForPackageOwnedByAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByOrg:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions"],getAllPackageVersionsForPackageOwnedByUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions"],getPackageForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}"],getPackageForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}"],getPackageForUser:["GET /users/{username}/packages/{package_type}/{package_name}"],getPackageVersionForAuthenticatedUser:["GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForOrganization:["GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}"],getPackageVersionForUser:["GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}"],listDockerMigrationConflictingPackagesForAuthenticatedUser:["GET /user/docker/conflicts"],listDockerMigrationConflictingPackagesForOrganization:["GET /orgs/{org}/docker/conflicts"],listDockerMigrationConflictingPackagesForUser:["GET /users/{username}/docker/conflicts"],listPackagesForAuthenticatedUser:["GET /user/packages"],listPackagesForOrganization:["GET /orgs/{org}/packages"],listPackagesForUser:["GET /users/{username}/packages"],restorePackageForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageForUser:["POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}"],restorePackageVersionForAuthenticatedUser:["POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForOrg:["POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"],restorePackageVersionForUser:["POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore"]},privateRegistries:{createOrgPrivateRegistry:["POST /orgs/{org}/private-registries"],deleteOrgPrivateRegistry:["DELETE /orgs/{org}/private-registries/{secret_name}"],getOrgPrivateRegistry:["GET /orgs/{org}/private-registries/{secret_name}"],getOrgPublicKey:["GET /orgs/{org}/private-registries/public-key"],listOrgPrivateRegistries:["GET /orgs/{org}/private-registries"],updateOrgPrivateRegistry:["PATCH /orgs/{org}/private-registries/{secret_name}"]},projects:{addItemForOrg:["POST /orgs/{org}/projectsV2/{project_number}/items"],addItemForUser:["POST /users/{username}/projectsV2/{project_number}/items"],deleteItemForOrg:["DELETE /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],deleteItemForUser:["DELETE /users/{username}/projectsV2/{project_number}/items/{item_id}"],getFieldForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}"],getFieldForUser:["GET /users/{username}/projectsV2/{project_number}/fields/{field_id}"],getForOrg:["GET /orgs/{org}/projectsV2/{project_number}"],getForUser:["GET /users/{username}/projectsV2/{project_number}"],getOrgItem:["GET /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],getUserItem:["GET /users/{username}/projectsV2/{project_number}/items/{item_id}"],listFieldsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/fields"],listFieldsForUser:["GET /users/{username}/projectsV2/{project_number}/fields"],listForOrg:["GET /orgs/{org}/projectsV2"],listForUser:["GET /users/{username}/projectsV2"],listItemsForOrg:["GET /orgs/{org}/projectsV2/{project_number}/items"],listItemsForUser:["GET /users/{username}/projectsV2/{project_number}/items"],updateItemForOrg:["PATCH /orgs/{org}/projectsV2/{project_number}/items/{item_id}"],updateItemForUser:["PATCH /users/{username}/projectsV2/{project_number}/items/{item_id}"]},pulls:{checkIfMerged:["GET /repos/{owner}/{repo}/pulls/{pull_number}/merge"],create:["POST /repos/{owner}/{repo}/pulls"],createReplyForReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies"],createReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],createReviewComment:["POST /repos/{owner}/{repo}/pulls/{pull_number}/comments"],deletePendingReview:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],deleteReviewComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}"],dismissReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals"],get:["GET /repos/{owner}/{repo}/pulls/{pull_number}"],getReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],getReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}"],list:["GET /repos/{owner}/{repo}/pulls"],listCommentsForReview:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments"],listCommits:["GET /repos/{owner}/{repo}/pulls/{pull_number}/commits"],listFiles:["GET /repos/{owner}/{repo}/pulls/{pull_number}/files"],listRequestedReviewers:["GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],listReviewComments:["GET /repos/{owner}/{repo}/pulls/{pull_number}/comments"],listReviewCommentsForRepo:["GET /repos/{owner}/{repo}/pulls/comments"],listReviews:["GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews"],merge:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge"],removeRequestedReviewers:["DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],requestReviewers:["POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers"],submitReview:["POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events"],update:["PATCH /repos/{owner}/{repo}/pulls/{pull_number}"],updateBranch:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch"],updateReview:["PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}"],updateReviewComment:["PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}"]},rateLimit:{get:["GET /rate_limit"]},reactions:{createForCommitComment:["POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"],createForIssue:["POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"],createForIssueComment:["POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],createForPullRequestReviewComment:["POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],createForRelease:["POST /repos/{owner}/{repo}/releases/{release_id}/reactions"],createForTeamDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],createForTeamDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"],deleteForCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"],deleteForIssue:["DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"],deleteForIssueComment:["DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"],deleteForPullRequestComment:["DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"],deleteForRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}/reactions/{reaction_id}"],deleteForTeamDiscussion:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"],deleteForTeamDiscussionComment:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"],listForCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"],listForIssue:["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],listForIssueComment:["GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"],listForPullRequestReviewComment:["GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"],listForRelease:["GET /repos/{owner}/{repo}/releases/{release_id}/reactions"],listForTeamDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"],listForTeamDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"]},repos:{acceptInvitation:["PATCH /user/repository_invitations/{invitation_id}",{},{renamed:["repos","acceptInvitationForAuthenticatedUser"]}],acceptInvitationForAuthenticatedUser:["PATCH /user/repository_invitations/{invitation_id}"],addAppAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],addCollaborator:["PUT /repos/{owner}/{repo}/collaborators/{username}"],addStatusCheckContexts:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],addTeamAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],addUserAccessRestrictions:["POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],cancelPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel"],checkAutomatedSecurityFixes:["GET /repos/{owner}/{repo}/automated-security-fixes"],checkCollaborator:["GET /repos/{owner}/{repo}/collaborators/{username}"],checkImmutableReleases:["GET /repos/{owner}/{repo}/immutable-releases"],checkPrivateVulnerabilityReporting:["GET /repos/{owner}/{repo}/private-vulnerability-reporting"],checkVulnerabilityAlerts:["GET /repos/{owner}/{repo}/vulnerability-alerts"],codeownersErrors:["GET /repos/{owner}/{repo}/codeowners/errors"],compareCommits:["GET /repos/{owner}/{repo}/compare/{base}...{head}"],compareCommitsWithBasehead:["GET /repos/{owner}/{repo}/compare/{basehead}"],createAttestation:["POST /repos/{owner}/{repo}/attestations"],createAutolink:["POST /repos/{owner}/{repo}/autolinks"],createCommitComment:["POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"],createCommitSignatureProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],createCommitStatus:["POST /repos/{owner}/{repo}/statuses/{sha}"],createDeployKey:["POST /repos/{owner}/{repo}/keys"],createDeployment:["POST /repos/{owner}/{repo}/deployments"],createDeploymentBranchPolicy:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],createDeploymentProtectionRule:["POST /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],createDeploymentStatus:["POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],createDispatchEvent:["POST /repos/{owner}/{repo}/dispatches"],createForAuthenticatedUser:["POST /user/repos"],createFork:["POST /repos/{owner}/{repo}/forks"],createInOrg:["POST /orgs/{org}/repos"],createOrUpdateEnvironment:["PUT /repos/{owner}/{repo}/environments/{environment_name}"],createOrUpdateFileContents:["PUT /repos/{owner}/{repo}/contents/{path}"],createOrgRuleset:["POST /orgs/{org}/rulesets"],createPagesDeployment:["POST /repos/{owner}/{repo}/pages/deployments"],createPagesSite:["POST /repos/{owner}/{repo}/pages"],createRelease:["POST /repos/{owner}/{repo}/releases"],createRepoRuleset:["POST /repos/{owner}/{repo}/rulesets"],createUsingTemplate:["POST /repos/{template_owner}/{template_repo}/generate"],createWebhook:["POST /repos/{owner}/{repo}/hooks"],customPropertiesForReposCreateOrUpdateRepositoryValues:["PATCH /repos/{owner}/{repo}/properties/values"],customPropertiesForReposGetRepositoryValues:["GET /repos/{owner}/{repo}/properties/values"],declineInvitation:["DELETE /user/repository_invitations/{invitation_id}",{},{renamed:["repos","declineInvitationForAuthenticatedUser"]}],declineInvitationForAuthenticatedUser:["DELETE /user/repository_invitations/{invitation_id}"],delete:["DELETE /repos/{owner}/{repo}"],deleteAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],deleteAdminBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],deleteAnEnvironment:["DELETE /repos/{owner}/{repo}/environments/{environment_name}"],deleteAutolink:["DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}"],deleteBranchProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection"],deleteCommitComment:["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],deleteCommitSignatureProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],deleteDeployKey:["DELETE /repos/{owner}/{repo}/keys/{key_id}"],deleteDeployment:["DELETE /repos/{owner}/{repo}/deployments/{deployment_id}"],deleteDeploymentBranchPolicy:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],deleteFile:["DELETE /repos/{owner}/{repo}/contents/{path}"],deleteInvitation:["DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"],deleteOrgRuleset:["DELETE /orgs/{org}/rulesets/{ruleset_id}"],deletePagesSite:["DELETE /repos/{owner}/{repo}/pages"],deletePullRequestReviewProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],deleteRelease:["DELETE /repos/{owner}/{repo}/releases/{release_id}"],deleteReleaseAsset:["DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}"],deleteRepoRuleset:["DELETE /repos/{owner}/{repo}/rulesets/{ruleset_id}"],deleteWebhook:["DELETE /repos/{owner}/{repo}/hooks/{hook_id}"],disableAutomatedSecurityFixes:["DELETE /repos/{owner}/{repo}/automated-security-fixes"],disableDeploymentProtectionRule:["DELETE /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],disableImmutableReleases:["DELETE /repos/{owner}/{repo}/immutable-releases"],disablePrivateVulnerabilityReporting:["DELETE /repos/{owner}/{repo}/private-vulnerability-reporting"],disableVulnerabilityAlerts:["DELETE /repos/{owner}/{repo}/vulnerability-alerts"],downloadArchive:["GET /repos/{owner}/{repo}/zipball/{ref}",{},{renamed:["repos","downloadZipballArchive"]}],downloadTarballArchive:["GET /repos/{owner}/{repo}/tarball/{ref}"],downloadZipballArchive:["GET /repos/{owner}/{repo}/zipball/{ref}"],enableAutomatedSecurityFixes:["PUT /repos/{owner}/{repo}/automated-security-fixes"],enableImmutableReleases:["PUT /repos/{owner}/{repo}/immutable-releases"],enablePrivateVulnerabilityReporting:["PUT /repos/{owner}/{repo}/private-vulnerability-reporting"],enableVulnerabilityAlerts:["PUT /repos/{owner}/{repo}/vulnerability-alerts"],generateReleaseNotes:["POST /repos/{owner}/{repo}/releases/generate-notes"],get:["GET /repos/{owner}/{repo}"],getAccessRestrictions:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"],getAdminBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],getAllDeploymentProtectionRules:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules"],getAllEnvironments:["GET /repos/{owner}/{repo}/environments"],getAllStatusCheckContexts:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts"],getAllTopics:["GET /repos/{owner}/{repo}/topics"],getAppsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps"],getAutolink:["GET /repos/{owner}/{repo}/autolinks/{autolink_id}"],getBranch:["GET /repos/{owner}/{repo}/branches/{branch}"],getBranchProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection"],getBranchRules:["GET /repos/{owner}/{repo}/rules/branches/{branch}"],getClones:["GET /repos/{owner}/{repo}/traffic/clones"],getCodeFrequencyStats:["GET /repos/{owner}/{repo}/stats/code_frequency"],getCollaboratorPermissionLevel:["GET /repos/{owner}/{repo}/collaborators/{username}/permission"],getCombinedStatusForRef:["GET /repos/{owner}/{repo}/commits/{ref}/status"],getCommit:["GET /repos/{owner}/{repo}/commits/{ref}"],getCommitActivityStats:["GET /repos/{owner}/{repo}/stats/commit_activity"],getCommitComment:["GET /repos/{owner}/{repo}/comments/{comment_id}"],getCommitSignatureProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"],getCommunityProfileMetrics:["GET /repos/{owner}/{repo}/community/profile"],getContent:["GET /repos/{owner}/{repo}/contents/{path}"],getContributorsStats:["GET /repos/{owner}/{repo}/stats/contributors"],getCustomDeploymentProtectionRule:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}"],getDeployKey:["GET /repos/{owner}/{repo}/keys/{key_id}"],getDeployment:["GET /repos/{owner}/{repo}/deployments/{deployment_id}"],getDeploymentBranchPolicy:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],getDeploymentStatus:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}"],getEnvironment:["GET /repos/{owner}/{repo}/environments/{environment_name}"],getLatestPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/latest"],getLatestRelease:["GET /repos/{owner}/{repo}/releases/latest"],getOrgRuleSuite:["GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}"],getOrgRuleSuites:["GET /orgs/{org}/rulesets/rule-suites"],getOrgRuleset:["GET /orgs/{org}/rulesets/{ruleset_id}"],getOrgRulesets:["GET /orgs/{org}/rulesets"],getPages:["GET /repos/{owner}/{repo}/pages"],getPagesBuild:["GET /repos/{owner}/{repo}/pages/builds/{build_id}"],getPagesDeployment:["GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}"],getPagesHealthCheck:["GET /repos/{owner}/{repo}/pages/health"],getParticipationStats:["GET /repos/{owner}/{repo}/stats/participation"],getPullRequestReviewProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],getPunchCardStats:["GET /repos/{owner}/{repo}/stats/punch_card"],getReadme:["GET /repos/{owner}/{repo}/readme"],getReadmeInDirectory:["GET /repos/{owner}/{repo}/readme/{dir}"],getRelease:["GET /repos/{owner}/{repo}/releases/{release_id}"],getReleaseAsset:["GET /repos/{owner}/{repo}/releases/assets/{asset_id}"],getReleaseByTag:["GET /repos/{owner}/{repo}/releases/tags/{tag}"],getRepoRuleSuite:["GET /repos/{owner}/{repo}/rulesets/rule-suites/{rule_suite_id}"],getRepoRuleSuites:["GET /repos/{owner}/{repo}/rulesets/rule-suites"],getRepoRuleset:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}"],getRepoRulesetHistory:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history"],getRepoRulesetVersion:["GET /repos/{owner}/{repo}/rulesets/{ruleset_id}/history/{version_id}"],getRepoRulesets:["GET /repos/{owner}/{repo}/rulesets"],getStatusChecksProtection:["GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],getTeamsWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams"],getTopPaths:["GET /repos/{owner}/{repo}/traffic/popular/paths"],getTopReferrers:["GET /repos/{owner}/{repo}/traffic/popular/referrers"],getUsersWithAccessToProtectedBranch:["GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users"],getViews:["GET /repos/{owner}/{repo}/traffic/views"],getWebhook:["GET /repos/{owner}/{repo}/hooks/{hook_id}"],getWebhookConfigForRepo:["GET /repos/{owner}/{repo}/hooks/{hook_id}/config"],getWebhookDelivery:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}"],listActivities:["GET /repos/{owner}/{repo}/activity"],listAttestations:["GET /repos/{owner}/{repo}/attestations/{subject_digest}"],listAutolinks:["GET /repos/{owner}/{repo}/autolinks"],listBranches:["GET /repos/{owner}/{repo}/branches"],listBranchesForHeadCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head"],listCollaborators:["GET /repos/{owner}/{repo}/collaborators"],listCommentsForCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/comments"],listCommitCommentsForRepo:["GET /repos/{owner}/{repo}/comments"],listCommitStatusesForRef:["GET /repos/{owner}/{repo}/commits/{ref}/statuses"],listCommits:["GET /repos/{owner}/{repo}/commits"],listContributors:["GET /repos/{owner}/{repo}/contributors"],listCustomDeploymentRuleIntegrations:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment_protection_rules/apps"],listDeployKeys:["GET /repos/{owner}/{repo}/keys"],listDeploymentBranchPolicies:["GET /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies"],listDeploymentStatuses:["GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses"],listDeployments:["GET /repos/{owner}/{repo}/deployments"],listForAuthenticatedUser:["GET /user/repos"],listForOrg:["GET /orgs/{org}/repos"],listForUser:["GET /users/{username}/repos"],listForks:["GET /repos/{owner}/{repo}/forks"],listInvitations:["GET /repos/{owner}/{repo}/invitations"],listInvitationsForAuthenticatedUser:["GET /user/repository_invitations"],listLanguages:["GET /repos/{owner}/{repo}/languages"],listPagesBuilds:["GET /repos/{owner}/{repo}/pages/builds"],listPublic:["GET /repositories"],listPullRequestsAssociatedWithCommit:["GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls"],listReleaseAssets:["GET /repos/{owner}/{repo}/releases/{release_id}/assets"],listReleases:["GET /repos/{owner}/{repo}/releases"],listTags:["GET /repos/{owner}/{repo}/tags"],listTeams:["GET /repos/{owner}/{repo}/teams"],listWebhookDeliveries:["GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries"],listWebhooks:["GET /repos/{owner}/{repo}/hooks"],merge:["POST /repos/{owner}/{repo}/merges"],mergeUpstream:["POST /repos/{owner}/{repo}/merge-upstream"],pingWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/pings"],redeliverWebhookDelivery:["POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts"],removeAppAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],removeCollaborator:["DELETE /repos/{owner}/{repo}/collaborators/{username}"],removeStatusCheckContexts:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],removeStatusCheckProtection:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],removeTeamAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],removeUserAccessRestrictions:["DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],renameBranch:["POST /repos/{owner}/{repo}/branches/{branch}/rename"],replaceAllTopics:["PUT /repos/{owner}/{repo}/topics"],requestPagesBuild:["POST /repos/{owner}/{repo}/pages/builds"],setAdminBranchProtection:["POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins"],setAppAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",{},{mapToData:"apps"}],setStatusCheckContexts:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts",{},{mapToData:"contexts"}],setTeamAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams",{},{mapToData:"teams"}],setUserAccessRestrictions:["PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users",{},{mapToData:"users"}],testPushWebhook:["POST /repos/{owner}/{repo}/hooks/{hook_id}/tests"],transfer:["POST /repos/{owner}/{repo}/transfer"],update:["PATCH /repos/{owner}/{repo}"],updateBranchProtection:["PUT /repos/{owner}/{repo}/branches/{branch}/protection"],updateCommitComment:["PATCH /repos/{owner}/{repo}/comments/{comment_id}"],updateDeploymentBranchPolicy:["PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}"],updateInformationAboutPagesSite:["PUT /repos/{owner}/{repo}/pages"],updateInvitation:["PATCH /repos/{owner}/{repo}/invitations/{invitation_id}"],updateOrgRuleset:["PUT /orgs/{org}/rulesets/{ruleset_id}"],updatePullRequestReviewProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"],updateRelease:["PATCH /repos/{owner}/{repo}/releases/{release_id}"],updateReleaseAsset:["PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}"],updateRepoRuleset:["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"],updateStatusCheckPotection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks",{},{renamed:["repos","updateStatusCheckProtection"]}],updateStatusCheckProtection:["PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks"],updateWebhook:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"],updateWebhookConfigForRepo:["PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config"],uploadReleaseAsset:["POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}",{baseUrl:"https://uploads.github.com"}]},search:{code:["GET /search/code"],commits:["GET /search/commits"],issuesAndPullRequests:["GET /search/issues"],labels:["GET /search/labels"],repos:["GET /search/repositories"],topics:["GET /search/topics"],users:["GET /search/users"]},secretScanning:{createPushProtectionBypass:["POST /repos/{owner}/{repo}/secret-scanning/push-protection-bypasses"],getAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],getScanHistory:["GET /repos/{owner}/{repo}/secret-scanning/scan-history"],listAlertsForOrg:["GET /orgs/{org}/secret-scanning/alerts"],listAlertsForRepo:["GET /repos/{owner}/{repo}/secret-scanning/alerts"],listLocationsForAlert:["GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}/locations"],listOrgPatternConfigs:["GET /orgs/{org}/secret-scanning/pattern-configurations"],updateAlert:["PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}"],updateOrgPatternConfigs:["PATCH /orgs/{org}/secret-scanning/pattern-configurations"]},securityAdvisories:{createFork:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks"],createPrivateVulnerabilityReport:["POST /repos/{owner}/{repo}/security-advisories/reports"],createRepositoryAdvisory:["POST /repos/{owner}/{repo}/security-advisories"],createRepositoryAdvisoryCveRequest:["POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve"],getGlobalAdvisory:["GET /advisories/{ghsa_id}"],getRepositoryAdvisory:["GET /repos/{owner}/{repo}/security-advisories/{ghsa_id}"],listGlobalAdvisories:["GET /advisories"],listOrgRepositoryAdvisories:["GET /orgs/{org}/security-advisories"],listRepositoryAdvisories:["GET /repos/{owner}/{repo}/security-advisories"],updateRepositoryAdvisory:["PATCH /repos/{owner}/{repo}/security-advisories/{ghsa_id}"]},teams:{addOrUpdateMembershipForUserInOrg:["PUT /orgs/{org}/teams/{team_slug}/memberships/{username}"],addOrUpdateRepoPermissionsInOrg:["PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],checkPermissionsForRepoInOrg:["GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],create:["POST /orgs/{org}/teams"],createDiscussionCommentInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],createDiscussionInOrg:["POST /orgs/{org}/teams/{team_slug}/discussions"],deleteDiscussionCommentInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],deleteDiscussionInOrg:["DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],deleteInOrg:["DELETE /orgs/{org}/teams/{team_slug}"],getByName:["GET /orgs/{org}/teams/{team_slug}"],getDiscussionCommentInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],getDiscussionInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],getMembershipForUserInOrg:["GET /orgs/{org}/teams/{team_slug}/memberships/{username}"],list:["GET /orgs/{org}/teams"],listChildInOrg:["GET /orgs/{org}/teams/{team_slug}/teams"],listDiscussionCommentsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments"],listDiscussionsInOrg:["GET /orgs/{org}/teams/{team_slug}/discussions"],listForAuthenticatedUser:["GET /user/teams"],listMembersInOrg:["GET /orgs/{org}/teams/{team_slug}/members"],listPendingInvitationsInOrg:["GET /orgs/{org}/teams/{team_slug}/invitations"],listReposInOrg:["GET /orgs/{org}/teams/{team_slug}/repos"],removeMembershipForUserInOrg:["DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}"],removeRepoInOrg:["DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}"],updateDiscussionCommentInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}"],updateDiscussionInOrg:["PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}"],updateInOrg:["PATCH /orgs/{org}/teams/{team_slug}"]},users:{addEmailForAuthenticated:["POST /user/emails",{},{renamed:["users","addEmailForAuthenticatedUser"]}],addEmailForAuthenticatedUser:["POST /user/emails"],addSocialAccountForAuthenticatedUser:["POST /user/social_accounts"],block:["PUT /user/blocks/{username}"],checkBlocked:["GET /user/blocks/{username}"],checkFollowingForUser:["GET /users/{username}/following/{target_user}"],checkPersonIsFollowedByAuthenticated:["GET /user/following/{username}"],createGpgKeyForAuthenticated:["POST /user/gpg_keys",{},{renamed:["users","createGpgKeyForAuthenticatedUser"]}],createGpgKeyForAuthenticatedUser:["POST /user/gpg_keys"],createPublicSshKeyForAuthenticated:["POST /user/keys",{},{renamed:["users","createPublicSshKeyForAuthenticatedUser"]}],createPublicSshKeyForAuthenticatedUser:["POST /user/keys"],createSshSigningKeyForAuthenticatedUser:["POST /user/ssh_signing_keys"],deleteAttestationsBulk:["POST /users/{username}/attestations/delete-request"],deleteAttestationsById:["DELETE /users/{username}/attestations/{attestation_id}"],deleteAttestationsBySubjectDigest:["DELETE /users/{username}/attestations/digest/{subject_digest}"],deleteEmailForAuthenticated:["DELETE /user/emails",{},{renamed:["users","deleteEmailForAuthenticatedUser"]}],deleteEmailForAuthenticatedUser:["DELETE /user/emails"],deleteGpgKeyForAuthenticated:["DELETE /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","deleteGpgKeyForAuthenticatedUser"]}],deleteGpgKeyForAuthenticatedUser:["DELETE /user/gpg_keys/{gpg_key_id}"],deletePublicSshKeyForAuthenticated:["DELETE /user/keys/{key_id}",{},{renamed:["users","deletePublicSshKeyForAuthenticatedUser"]}],deletePublicSshKeyForAuthenticatedUser:["DELETE /user/keys/{key_id}"],deleteSocialAccountForAuthenticatedUser:["DELETE /user/social_accounts"],deleteSshSigningKeyForAuthenticatedUser:["DELETE /user/ssh_signing_keys/{ssh_signing_key_id}"],follow:["PUT /user/following/{username}"],getAuthenticated:["GET /user"],getById:["GET /user/{account_id}"],getByUsername:["GET /users/{username}"],getContextForUser:["GET /users/{username}/hovercard"],getGpgKeyForAuthenticated:["GET /user/gpg_keys/{gpg_key_id}",{},{renamed:["users","getGpgKeyForAuthenticatedUser"]}],getGpgKeyForAuthenticatedUser:["GET /user/gpg_keys/{gpg_key_id}"],getPublicSshKeyForAuthenticated:["GET /user/keys/{key_id}",{},{renamed:["users","getPublicSshKeyForAuthenticatedUser"]}],getPublicSshKeyForAuthenticatedUser:["GET /user/keys/{key_id}"],getSshSigningKeyForAuthenticatedUser:["GET /user/ssh_signing_keys/{ssh_signing_key_id}"],list:["GET /users"],listAttestations:["GET /users/{username}/attestations/{subject_digest}"],listAttestationsBulk:["POST /users/{username}/attestations/bulk-list{?per_page,before,after}"],listBlockedByAuthenticated:["GET /user/blocks",{},{renamed:["users","listBlockedByAuthenticatedUser"]}],listBlockedByAuthenticatedUser:["GET /user/blocks"],listEmailsForAuthenticated:["GET /user/emails",{},{renamed:["users","listEmailsForAuthenticatedUser"]}],listEmailsForAuthenticatedUser:["GET /user/emails"],listFollowedByAuthenticated:["GET /user/following",{},{renamed:["users","listFollowedByAuthenticatedUser"]}],listFollowedByAuthenticatedUser:["GET /user/following"],listFollowersForAuthenticatedUser:["GET /user/followers"],listFollowersForUser:["GET /users/{username}/followers"],listFollowingForUser:["GET /users/{username}/following"],listGpgKeysForAuthenticated:["GET /user/gpg_keys",{},{renamed:["users","listGpgKeysForAuthenticatedUser"]}],listGpgKeysForAuthenticatedUser:["GET /user/gpg_keys"],listGpgKeysForUser:["GET /users/{username}/gpg_keys"],listPublicEmailsForAuthenticated:["GET /user/public_emails",{},{renamed:["users","listPublicEmailsForAuthenticatedUser"]}],listPublicEmailsForAuthenticatedUser:["GET /user/public_emails"],listPublicKeysForUser:["GET /users/{username}/keys"],listPublicSshKeysForAuthenticated:["GET /user/keys",{},{renamed:["users","listPublicSshKeysForAuthenticatedUser"]}],listPublicSshKeysForAuthenticatedUser:["GET /user/keys"],listSocialAccountsForAuthenticatedUser:["GET /user/social_accounts"],listSocialAccountsForUser:["GET /users/{username}/social_accounts"],listSshSigningKeysForAuthenticatedUser:["GET /user/ssh_signing_keys"],listSshSigningKeysForUser:["GET /users/{username}/ssh_signing_keys"],setPrimaryEmailVisibilityForAuthenticated:["PATCH /user/email/visibility",{},{renamed:["users","setPrimaryEmailVisibilityForAuthenticatedUser"]}],setPrimaryEmailVisibilityForAuthenticatedUser:["PATCH /user/email/visibility"],unblock:["DELETE /user/blocks/{username}"],unfollow:["DELETE /user/following/{username}"],updateAuthenticated:["PATCH /user"]}},Bvn=ZHo;var dK=new Map;for(let[t,e]of Object.entries(Bvn))for(let[r,n]of Object.entries(e)){let[o,s,c]=n,[l,u]=o.split(/ /),d=Object.assign({method:l,url:u},s);dK.has(t)||dK.set(t,new Map),dK.get(t).set(r,{scope:t,methodName:r,endpointDefaults:d,decorations:c})}var XHo={has({scope:t},e){return dK.get(t).has(e)},getOwnPropertyDescriptor(t,e){return{value:this.get(t,e),configurable:!0,writable:!0,enumerable:!0}},defineProperty(t,e,r){return Object.defineProperty(t.cache,e,r),!0},deleteProperty(t,e){return delete t.cache[e],!0},ownKeys({scope:t}){return[...dK.get(t).keys()]},set(t,e,r){return t.cache[e]=r},get({octokit:t,scope:e,cache:r},n){if(r[n])return r[n];let o=dK.get(e).get(n);if(!o)return;let{endpointDefaults:s,decorations:c}=o;return c?r[n]=eGo(t,e,n,s,c):r[n]=t.request.defaults(s),r[n]}};function Eqt(t){let e={};for(let r of dK.keys())e[r]=new Proxy({octokit:t,scope:r,cache:{}},XHo);return e}a(Eqt,"endpointsToMethods");function eGo(t,e,r,n,o){let s=t.request.defaults(n);function c(...l){let u=s.endpoint.merge(...l);if(o.mapToData)return u=Object.assign({},u,{data:u[o.mapToData],[o.mapToData]:void 0}),s(u);if(o.renamed){let[d,f]=o.renamed;t.log.warn(`octokit.${e}.${r}() has been renamed to octokit.${d}.${f}()`)}if(o.deprecated&&t.log.warn(o.deprecated),o.renamedParameters){let d=s.endpoint.merge(...l);for(let[f,h]of Object.entries(o.renamedParameters))f in d&&(t.log.warn(`"${f}" parameter is deprecated for "octokit.${e}.${r}()". Use "${h}" instead`),h in d||(d[h]=d[f]),delete d[f]);return s(d)}return s(...l)}return a(c,"withDecorations"),Object.assign(c,s)}a(eGo,"decorate");function tGo(t){return{rest:Eqt(t)}}a(tGo,"restEndpointMethods");tGo.VERSION=yqt;function _qt(t){let e=Eqt(t);return{...e,rest:e}}a(_qt,"legacyRestEndpointMethods");_qt.VERSION=yqt;p();var Lvn="22.0.1";var Fvn=IKe.plugin(mqt,_qt,Aqt).defaults({userAgent:`octokit-rest.js/${Lvn}`});var nGo=new Set(["copilot-pull-request-reviewer","copilot-swe-agent","Copilot"]),pc=new Ae("GitHubClient"),Ky=class{constructor(e){this.ctx=e;this.octokit=null}static{a(this,"GitHubClient")}async getOctokit(){if(this.octokit)return this.octokit;let e=await this.getApiSession(),r=this.ctx.get(cr);return this.octokit=new Fvn({auth:e.accessToken,baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.octokit}async getCopilotTimelineEvents(e,r,n,o){if(!o||!nGo.has(o))return pc.debug(this.ctx,`Skipping timeline events for ${e}/${r}#${n}: author '${o}' is not a Copilot account`),[];pc.debug(this.ctx,`Fetching Copilot timeline events for ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=[],l=1,u=!0;for(;u;){pc.debug(this.ctx,`Fetching timeline events page ${l} for ${e}/${r}#${n}`);let d=await s.rest.issues.listEventsForTimeline({owner:e,repo:r,issue_number:n,per_page:100,page:l});for(let h of d.data){let m=h;m.created_at&&m.node_id&&(h.event==="copilot_work_started"?c.push({id:m.node_id,eventType:"in_progress",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished"?c.push({id:m.node_id,eventType:"done",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}):h.event==="copilot_work_finished_failure"&&c.push({id:m.node_id,eventType:"error",createdAt:m.created_at,onBehalfOf:{login:m.actor?.login||"",avatarUrl:m.actor?.avatar_url}}))}let f=d.headers.link;u=f?f.includes('rel="next"'):!1,l++}return pc.debug(this.ctx,`Found ${c.length} Copilot timeline events for ${e}/${r}#${n}`),c}catch(c){if(pc.error(this.ctx,`Failed to fetch Copilot timeline events for ${e}/${r}#${n}:`,c),c&&typeof c=="object"&&"status"in c){let l=c;throw new Pd(l.status,l.message||"GitHub API error")}throw c}}async getCopilotWorkingStatus(e,r,n,o){pc.debug(this.ctx,`Getting Copilot working status for ${e}/${r}#${n}`);try{let s=await this.getCopilotTimelineEvents(e,r,n,o),c;if(s.length>0){let l=s[s.length-1];l.eventType==="done"?c="done":l.eventType==="in_progress"?c="in_progress":l.eventType==="error"?c="error":c="not_copilot_issue"}else c="not_copilot_issue";return pc.debug(this.ctx,`Copilot working status for ${e}/${r}#${n}: ${c}`),c}catch(s){return pc.error(this.ctx,`Error getting Copilot working status for ${e}/${r}#${n}, treating as not Copilot issue:`,s),"not_copilot_issue"}}async cancelWorkflow(e,r,n){pc.debug(this.ctx,`Cancelling workflow run ${n} for ${e}/${r}`);let o=await this.getOctokit();try{return await o.rest.actions.cancelWorkflowRun({owner:e,repo:r,run_id:n}),pc.debug(this.ctx,`Successfully cancelled workflow run ${n} for ${e}/${r}`),!0}catch(s){if(pc.error(this.ctx,`Failed to cancel workflow run ${n} for ${e}/${r}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Pd(c.status,c.message||"GitHub API error")}throw s}}async listPullRequestFiles(e,r,n){pc.debug(this.ctx,`Listing files for pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){pc.debug(this.ctx,`Fetching pull request files page ${c} for ${e}/${r}#${n}`);let u=await o.rest.pulls.listFiles({owner:e,repo:r,pull_number:n,per_page:100,page:c});for(let f of u.data)s.push({fileName:f.filename});let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return pc.debug(this.ctx,`Found ${s.length} files in pull request ${e}/${r}#${n}`),s}catch(s){if(pc.error(this.ctx,`Failed to list files for pull request ${e}/${r}#${n}:`,s),s&&typeof s=="object"&&"status"in s){let c=s;throw new Pd(c.status,c.message||"GitHub API error")}throw s}}async getBranch(e,r,n){pc.debug(this.ctx,`Getting branch ${n} from ${e}/${r}`);let o=await this.getOctokit();try{let s=await o.rest.repos.getBranch({owner:e,repo:r,branch:n});return pc.debug(this.ctx,`Successfully retrieved branch ${n} from ${e}/${r}`),s.data}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error getting branch ${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting branch ${n} for ${e}/${r}:`,s),s}}async getPullRequest(e,r,n){pc.debug(this.ctx,`Getting pull request ${e}/${r}#${n}`);let o=await this.getOctokit();try{let s=await o.rest.pulls.get({owner:e,repo:r,pull_number:n});return pc.debug(this.ctx,`Successfully retrieved pull request ${e}/${r}#${n}`),{id:s.data.id,html_url:s.data.html_url,number:s.data.number,title:s.data.title,user:s.data.user?{login:s.data.user.login}:void 0,draft:s.data.draft,body:s.data.body||void 0,repository:{owner:{login:s.data.base.repo.owner.login},name:s.data.base.repo.name},updated_at:s.data.updated_at}}catch(s){if(s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error getting pull request #${n}: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error getting pull request ${e}/${r}#${n}:`,s),s}}async addPullRequestComment(e,r,n,o){pc.debug(this.ctx,`Adding comment to pull request ${e}/${r}#${n}`);let s=await this.getOctokit();try{let c=await s.rest.issues.createComment({owner:e,repo:r,issue_number:n,body:o});return pc.debug(this.ctx,`Successfully added comment to ${e}/${r}#${n}`),{html_url:c.data.html_url}}catch(c){if(c&&typeof c=="object"&&"status"in c){let l=c;throw pc.debug(this.ctx,`GitHub API error adding comment to #${n}: HTTP ${l.status} - ${l.message}`),new Pd(l.status,l.message||"GitHub API error")}throw pc.error(this.ctx,`Unexpected error adding comment to pull request ${e}/${r}#${n}:`,c),c}}async listSecurityAdvisories(e,r,n=100){pc.debug(this.ctx,`Listing security advisories for ${r.length} ${e} packages`);let o=await this.getOctokit();try{let s=[],c=1,l=!0;for(;l;){pc.debug(this.ctx,`Fetching security advisories page ${c} for ${r.length} ${e} packages`);let u=await o.securityAdvisories.listGlobalAdvisories({ecosystem:e,affects:r,direction:"asc",sort:"published",per_page:n,page:c});s.push(...u.data);let d=u.headers.link;l=d?d.includes('rel="next"'):!1,c++}return pc.debug(this.ctx,`Found ${s.length} security advisories for ${r.length} ${e} packages`),s}catch(s){if(pc.error(this.ctx,"Failed to list security advisories:",s),s&&typeof s=="object"&&"status"in s){let c=s;throw pc.debug(this.ctx,`GitHub API error listing security advisories for ${r.length} ${e} packages: HTTP ${c.status} - ${c.message}`),new Pd(c.status,c.message||"GitHub API error")}throw s}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new Yy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Jc=new Ae("CodingAgentClient"),Ox=class{constructor(e,r){this.ctx=e;this.timeout=r??3e4}static{a(this,"CodingAgentClient")}getBaseUrl(){return"https://api.githubcopilot.com"}async createCodingTask(e,r,n,o,s,c){Jc.debug(this.ctx,`Creating coding agent task for ${n}/${o} with title: ${e}`),this.validateCreateTaskParams(e,r,n,o);let l=await this.getAccessToken(),d=`${this.getBaseUrl()}/agents/swe/${oqt}/jobs/${n}/${o}`,f={problem_statement:r,event_type:"jetbrains",pull_request:{title:e,body_placeholder:K_n(e),...s&&{base_ref:s}}},h={Authorization:`Bearer ${l}`,"Content-Type":"application/json",Accept:"application/json",...lA(this.ctx)};if(c?.isCancellationRequested)throw Jc.debug(this.ctx,`Create coding task was cancelled before sending API request for ${n}/${o} with title: ${e}`),new x_;let g=await this.ctx.get(cr).fetch(d,{method:"POST",headers:h,body:JSON.stringify(f),timeout:this.timeout});if(c?.isCancellationRequested)throw Jc.debug(this.ctx,`Create coding task was cancelled after sending API request for ${n}/${o} with title: ${e}`),new x_;let A=await this.handleCreateJobResponse(g);if(c?.isCancellationRequested)throw Jc.debug(this.ctx,`Create coding task was cancelled after receiving job response for ${n}/${o} with title: ${e}`),new x_;let y=await this.waitForJobPullRequest(n,o,A.job_id,l,c);if(c?.isCancellationRequested)throw Jc.debug(this.ctx,`Create coding task was cancelled after polling job ${A.job_id} for ${n}/${o}`),new x_;let E=y.pull_request?.number;if(typeof E!="number")throw new J0("No valid pull request number returned from job");let v=await new Ky(this.ctx).getPullRequest(n,o,E);return Jc.debug(this.ctx,`Coding task created successfully for ${n}/${o}: job ${A.job_id}, session ${A.session_id}, PR #${v.number}`),{pullRequest:v,sessionId:A.session_id}}validateCreateTaskParams(e,r,n,o){if(!e?.trim())throw Jc.debug(this.ctx,"Validation failed: Title is required and cannot be empty"),new ep("Title is required and cannot be empty");if(!r?.trim())throw Jc.debug(this.ctx,"Validation failed: ProblemStatement is required and cannot be empty"),new ep("ProblemStatement is required and cannot be empty");if(!n?.trim())throw Jc.debug(this.ctx,"Validation failed: Owner is required and cannot be empty"),new ep("Owner is required and cannot be empty");if(!o?.trim())throw Jc.debug(this.ctx,"Validation failed: Repository name is required and cannot be empty"),new ep("Repository name is required and cannot be empty");Jc.debug(this.ctx,`Validation passed for ${n}/${o}`)}async getAccessToken(){let r=await this.ctx.get(Fr).resolveSession();if(!r?.accessToken)throw Jc.debug(this.ctx,"Failed to get access token"),new Mx("Failed to call cloud agent API: Not authenticated with GitHub");return r.accessToken}async fetchWithCancellation(e,r,n){let o=new AbortController,s=n?.onCancellationRequested(()=>o.abort());try{return await this.ctx.get(cr).fetch(e,{timeout:this.timeout,signal:o.signal,...r})}finally{s?.dispose()}}async getAllSessions(e,r){Jc.debug(this.ctx,`Getting all coding agent sessions for pull request ID: ${e}`);let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Jc.debug(this.ctx,`Get all sessions operation was cancelled before sending API request for pull request ID: ${e}`),new x_;try{let s=`${o}/agents/sessions/resource/pull/${e}`,c={Authorization:`Bearer ${n}`,Accept:"application/json",...lA(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Jc.debug(this.ctx,`Get all sessions operation was cancelled after sending API request for pull request ID: ${e}`),new x_;if(!l.ok){let d=await l.text().catch(()=>l.statusText),f=`Failed to get cloud agent sessions: HTTP ${l.status} - ${d}`;throw Jc.error(this.ctx,f),new J0(f)}let u=await l.json();return Jc.debug(this.ctx,`Found ${u.sessions?.length||0} coding agent sessions for pull request ID: ${e}`),u.sessions||null}catch(s){if(s instanceof bk)throw s;let c=`Failed to get cloud agent sessions: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Jc.error(this.ctx,c),new bIe(c)}}async getSessionLogs(e,r){if(Jc.debug(this.ctx,`Getting coding agent session logs for session ID: ${e}`),!e?.trim())throw new ep("Session ID is required and cannot be empty");let n=await this.getAccessToken(),o=this.getBaseUrl();if(r?.isCancellationRequested)throw Jc.debug(this.ctx,`Get session logs operation was cancelled before sending API request for session ID: ${e}`),new x_;try{let s=`${o}/agents/sessions/${e}/logs`,c={Authorization:`Bearer ${n}`,...lA(this.ctx)},l=await this.fetchWithCancellation(s,{method:"GET",headers:c},r);if(r?.isCancellationRequested)throw Jc.debug(this.ctx,`Get session logs operation was cancelled after sending API request for session ID: ${e}`),new x_;if(!l.ok){let u=await l.text().catch(()=>l.statusText),d=`Failed to get cloud agent session logs: HTTP ${l.status} - ${u}`;throw Jc.error(this.ctx,d),new J0(d)}return await l.text()}catch(s){if(s instanceof bk)throw s;let c=`Failed to get cloud agent session logs: ${s instanceof Error?s.message:JSON.stringify(s)}`;throw Jc.error(this.ctx,c),new bIe(c)}}async waitForJobPullRequest(e,r,n,o,s){let c=Date.now(),l=3e4,u=2e3;for(;Date.now()-csetTimeout(r,e))}async handleCreateJobResponse(e){if(!e.ok){let n=await e.text().catch(()=>e.statusText);throw Jc.error(this.ctx,`Cloud agent API request failed with status ${e.status}: ${n}`),e.status===403||e.status===401?new J0("Cloud agent is not enabled or you do not have access. Learn more about cloud agent at https://docs.github.com/copilot/concepts/agents/cloud-agent/about-cloud-agent"):new J0(`API request failed: HTTP ${e.status} - ${n}`)}let r;try{r=await e.json()}catch(n){let o=n instanceof Error?n.message:JSON.stringify(n);throw Jc.error(this.ctx,`Failed to parse create coding task API response as JSON: ${o}`),new J0(`Failed to parse API response as JSON: ${o}`)}if(!r.job_id||!r.session_id)throw Jc.error(this.ctx,"API response missing job_id or session_id",r),new J0("Invalid response from cloud agent");return r}};p();p();var XM=class{static{a(this,"LSPRequestSender")}};var Uvn=fe(ei());var xKe=class{constructor(){this.codingAgentMessageRequestType=new Uvn.ProtocolRequestType("copilot/codingAgentMessage")}static{a(this,"CodingAgentMessageHandler")}async sendCodingAgentMessage(e,r,n,o){try{ot.debug(e.ctx,`Sending coding agent message to client: ${r} - ${o}`);let c=await e.ctx.get(XM).sendRequest(this.codingAgentMessageRequestType,{title:r,description:n,prLink:o,conversationId:e.conversation.id.toString(),turnId:e.turn.id.toString()});return ot.debug(e.ctx,"Successfully sent coding agent message to client"),c}catch(s){let c=`Failed to send coding agent message: ${s instanceof Error?s.message:JSON.stringify(s)}`;return ot.error(e.ctx,c,s),{success:!1,error:c}}}};p();p();p();p();var PC=fe(xo());function vqt(t){return{isCancellationRequested:t.isCancellationRequested,onCancellationRequested:a(e=>{let r=t.onCancellationRequested(e);return{dispose:a(()=>r.dispose(),"dispose")}},"onCancellationRequested")}}a(vqt,"adaptCancellationToken");function Qvn(t){return{report:a(e=>{"value"in e&&typeof e.value=="string"?t({text:e.value}):t({})},"report")}}a(Qvn,"adaptProgressCallback");function qvn(t){return{modelMaxPromptTokens:t.maxRequestTokens}}a(qvn,"createEndpointInfo");function jvn(t){let e={role:iGo(t.role),content:oGo(t.content)};if(t.role===PC.Raw.ChatRole.Assistant&&"toolCalls"in t&&t.toolCalls&&(e.tool_calls=t.toolCalls.map(r=>({id:r.id,type:r.type,function:r.function,approxNumTokens:0}))),t.role===PC.Raw.ChatRole.Tool&&"toolCallId"in t&&t.toolCallId&&(e.tool_call_id=t.toolCallId),Array.isArray(t.content)){let r=!1;for(let n of t.content){if(n.type===PC.Raw.ChatCompletionContentPartKind.Opaque&&n.value){let o=AYe(n);o&&(e.thinking=o);let s=gYe(n);s&&(e.phase=s)}n.type===PC.Raw.ChatCompletionContentPartKind.CacheBreakpoint&&(r=!0)}r&&(e.copilot_cache_control={type:"ephemeral"})}return Object.entries(t).forEach(([r,n])=>{["role","content","toolCalls","toolCallId"].includes(r)||(e[r]=n)}),e}a(jvn,"convertToCopilotChatMessage");function iGo(t){switch(t){case PC.Raw.ChatRole.System:return"system";case PC.Raw.ChatRole.User:return"user";case PC.Raw.ChatRole.Assistant:return"assistant";case PC.Raw.ChatRole.Tool:return"tool";default:return"user"}}a(iGo,"convertRole");function oGo(t){if(typeof t=="string")return t;if(Array.isArray(t)){let e=t.filter(r=>r.type===PC.Raw.ChatCompletionContentPartKind.Text||r.type===PC.Raw.ChatCompletionContentPartKind.Image);return e.length===1&&e[0].type===PC.Raw.ChatCompletionContentPartKind.Text?e[0].text:e.length===0?"":e.map(r=>r.type===PC.Raw.ChatCompletionContentPartKind.Text?{type:"text",text:r.text}:r.type===PC.Raw.ChatCompletionContentPartKind.Image?{type:"image_url",image_url:r.imageUrl}:{type:"text",text:""})}return String(t)}a(oGo,"convertContent");p();var h3=fe(xo());var wKe=class extends h3.PromptRenderer{constructor(r,n,o,s,c){super(o,r,n,s);this.options=c}static{a(this,"InternalPromptRenderer")}async renderWithOptions(r,n,o){let s=await super.render(r,n);return{...this.options,...o}.collapseSystemMessages&&this.collapseConsecutiveSystemMessages(s.messages),s}collapseConsecutiveSystemMessages(r){let n=[],o=null;for(let s of r)if(s.role===h3.Raw.ChatRole.System&&o?.role===h3.Raw.ChatRole.System){let c=o.content.at(-1),l=s.content.at(0);c&&l&&c.type===h3.Raw.ChatCompletionContentPartKind.Text&&l.type===h3.Raw.ChatCompletionContentPartKind.Text?(c.text=c.text.trimEnd()+` +`+l.text,o.content=o.content.concat(s.content.slice(1))):(o.content.push({type:h3.Raw.ChatCompletionContentPartKind.Text,text:` +`}),o.content=o.content.concat(s.content))}else n.push(s),o=s.role===h3.Raw.ChatRole.System?s:null;r.length=0,r.push(...n)}};p();p();function Hvn(t){if(!t.startsWith("data:image/"))throw new Error("Could not read image: invalid base64 image string");let e=t.split(",")[1];switch(uGo(e)){case"image/png":return sGo(e);case"image/gif":return aGo(e);case"image/jpeg":case"image/jpg":return cGo(e);case"image/webp":return lGo(e);default:throw new Error("Unsupported image format")}}a(Hvn,"getImageDimensions");function sGo(t){let e=atob(t.slice(0,50)).slice(16,24),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint32(0,!1),height:n.getUint32(4,!1)}}a(sGo,"getPngDimensions");function aGo(t){let e=atob(t.slice(0,50)),r=Uint8Array.from(e,o=>o.charCodeAt(0)),n=new DataView(r.buffer);return{width:n.getUint16(6,!0),height:n.getUint16(8,!0)}}a(aGo,"getGifDimensions");function cGo(t){let e=atob(t),r=Uint8Array.from(e,s=>s.charCodeAt(0)),n=r.length,o=2;for(;o=65472&&s<=65474){let l=new DataView(r.buffer,o+5,4);return{height:l.getUint16(0,!1),width:l.getUint16(2,!1)}}o+=2+c}throw new Error("JPEG dimensions not found")}a(cGo,"getJpegDimensions");function lGo(t){let e=atob(t),r=new Uint8Array(e.length);for(let o=0;o2048||o>2048){let l=2048/Math.max(n,o);n=Math.round(n*l),o=Math.round(o*l)}let s=768/Math.min(n,o);return n=Math.round(n*s),o=Math.round(o*s),Math.ceil(n/512)*Math.ceil(o/512)*170+85}};function RKe(t){let e=Cs(t.tokenizer);return new Cqt(e,t)}a(RKe,"createPromptTsxTokenizer");function pGo(t){if(!t)return 0;let e=t.length,r=Math.floor(e*3/4);return Math.ceil(r/8)}a(pGo,"estimateDocumentTokenCost");var tp=class t{static{a(this,"TsxPromptRenderer")}constructor(e,r,n,o={}){this._options=o;let s=qvn(n),c=RKe(n);this._internalRenderer=new wKe(e,r,s,c,o)}static create(e,r,n,o={}){return new t(e,r,n,o)}async renderPrompt(e,r,n){let o=e?Qvn(e):void 0,s=r?vqt(r):void 0,c=await this._internalRenderer.renderWithOptions(o,s,n);return{...this._options,...n}.enableCacheBreakpoints?aEn(c.messages):cEn(c.messages),{messages:c.messages.map(jvn),tokenCount:c.tokenCount,hasIgnoredFiles:c.hasIgnoredFiles}}async countTokens(e){let r=e?vqt(e):void 0;return(await this._internalRenderer.renderWithOptions(void 0,r)).tokenCount}};async function bqt(t,e,r,n,o,s){return await tp.create(t,e,r,s).renderPrompt(n,o,s)}a(bqt,"renderTsxPrompt");p();p();p();var Gvn=new Ae("toolCallRoundsBuilder");function eO(t,e={}){let r=[],{ctx:n,identifier:o,enableWarnings:s=!1}=e,c=0;for(;c0){let u=new Set(l.tool_calls.map(m=>m.id)),d=[],f=c+1,h=!1;for(;f0){let u=r[r.length-1];u.followUpUserMessage||(u.followUpUserMessage=l)}c++}}return r}a(eO,"buildAssistantRounds");p();var k_=fe(xo());var xIe=new Ae("toolCalling"),Bx=class extends ar{static{a(this,"ChatAssistantRounds")}renderCopilot(){if(!this.props.assistantRounds||this.props.assistantRounds.length===0)return vscpp(vscppf,null);let e=this.props.assistantRounds.length,r=this.props.assistantRounds.flatMap((o,s)=>this.renderOneAssistantRound(o,s,e));if(r.length===0)return vscpp(vscppf,null);let n=(0,k_.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},r))}renderOneAssistantRound(e,r,n){let o=e.assistantMessage;if(o.role!=="assistant")return xIe.warn(this.props.ctx,`Tool call round ${r} does not have a valid assistant message`),[];let s=o.modelId!==void 0&&this.props.modelConfiguration?.modelId===o.modelId,c=s&&o.thinking?vscpp(fle,{thinking:o.thinking}):vscpp(vscppf,null),l=o.phase&&s?vscpp(mYe,{phase:o.phase}):vscpp(vscppf,null);if(!o.tool_calls||o.tool_calls.length===0){let A=this.getMessageContent(o),y=s&&!!o.thinking,E=!!e.followUpUserMessage,_=[];if((A&&A.trim().length>0||y||E)&&_.push(vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,A),c,l)),e.followUpUserMessage){let v=this.getMessageContent(e.followUpUserMessage);v&&_.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,v)))}return _}let u=new Set;for(let A of e.toolResults)A.role==="tool"&&A.tool_call_id&&u.add(A.tool_call_id);let d=o.tool_calls.filter(A=>A.id&&u.has(A.id));if(d.length===0){let A=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;xIe.warn(this.props.ctx,`Tool call round ${r} has ${o.tool_calls.length} tool call(s) but none have corresponding results in ${A}. Rendering assistant message content only.`);let y=this.getMessageContent(o);if(!y||y.trim().length===0){if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);if(_)return[vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,""),c,l),vscpp(k_.UserMessage,null,vscpp(vscppf,null,_))]}return[]}let E=[vscpp(k_.AssistantMessage,null,vscpp(vscppf,null,y),c,l)];if(e.followUpUserMessage){let _=this.getMessageContent(e.followUpUserMessage);_&&E.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,_)))}return E}if(d.length{let y=(0,k_.useKeepWith)();return f.set(A.id,y),{type:"function",function:{name:A.function.name,arguments:typeof A.function.arguments=="string"?A.function.arguments:JSON.stringify(A.function.arguments)},id:A.id,keepWith:y}}),m=[];m.push(vscpp(k_.AssistantMessage,{toolCalls:h},vscpp(vscppf,null,this.getMessageContent(o)),c,l));let g=1/(n*4)/d.length;for(let A=0;AT.tool_call_id===y.id);if(!_){let T=this.props.isHistorical?"conversation history":`turn ${this.props.identifier||"unknown"}`;xIe.warn(this.props.ctx,`No tool result found for tool call ID ${y.id} in ${T}`);continue}let v=this.getMessageContent(_);this.props.truncateAt&&(v=this.truncateContent(v,this.props.truncateAt));let b=E;m.push(vscpp(b,{priority:r,flexGrow:r+1,flexReserve:`/${1/g}`},vscpp(k_.ToolMessage,{toolCallId:y.id},vscpp(vscppf,null,v))))}if(e.followUpUserMessage){let A=this.getMessageContent(e.followUpUserMessage);A&&m.push(vscpp(k_.UserMessage,null,vscpp(vscppf,null,A)))}return m}getMessageContent(e){return typeof e.content=="string"?e.content:Array.isArray(e.content)?e.content.map(r=>r.type==="text"?r.text:"").filter(r=>r.length>0).join(` +`):JSON.stringify(e.content)}truncateContent(e,r){let n=this.props.modelConfiguration;if(!n||e.lengthn.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(F7o,"separateTextAndImages");function U7o(t){return t.map(e=>vscpp(Hh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(U7o,"createImageElements");function BYe(t){let{imageUrls:e,textContent:r}=F7o(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Hh.TextChunk,null,vscpp(vscppf,null,r)),...U7o(e)]}a(BYe,"renderMixedContent");function d7t(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(d7t,"convertToPromptTsxToolCall");function LYe(t){switch(t.role){case"assistant":return Q7o(t);case"tool":return q7o(t);case"user":return j7o(t);case"system":return H7o(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(LYe,"convertChatMessageToPromptTsx");function Q7o(t){let e=t.thinking?vscpp(nle,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,BYe(t.content)),e):vscpp(Hh.AssistantMessage,{toolCalls:d7t(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(Q7o,"renderAssistantMessage");function q7o(t){return typeof t.content=="string"?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},BYe(t.content)):vscpp(Hh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(q7o,"renderToolMessage");function j7o(t){return typeof t.content=="string"?vscpp(Hh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.UserMessage,null,BYe(t.content)):vscpp(Hh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(j7o,"renderUserMessage");function H7o(t){return typeof t.content=="string"?vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Hh.SystemMessage,null,BYe(t.content)):vscpp(Hh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(H7o,"renderSystemMessage");var G7o=new ge("conversationHistoryPrompt"),hle=class extends sr{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):G7o.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=tO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Mx,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var UYe=ce(wo());var FYe=class extends sr{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(UYe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(hle,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(UYe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function QEn(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a(QEn,"parseStructuredSummary");var QYe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return Ye.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModel?await QM(this.ctx,n.modelProviderName,n.userRequestedModel):await Uo.getModelConfiguration(this.ctx,void 0,n.userRequestedModel,void 0,e.id.toString(),SQ(c));Uo.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await Kf.create(FYe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return Ye.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),Ye.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return Ye.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return Ye.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var _Ie=new ge("repository"),d3=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},Ox=class{static{a(this,"GitBranchLoader")}},$Q=class extends Ox{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var qEn=require("child_process");var VQ=class extends Ox{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,qEn.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){_Ie.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=ho(r);if(n===void 0)return;let o;try{o=(await rQ()).path}catch(c){_Ie.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?d3.branch(c):d3.detachedHead()}}extraArgs(){return[]}};p();var WQ=class extends Ox{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(Fo),o=xa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;_Ie.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return d3.branch(r)}else return this.isCommitSha(e)?d3.detachedHead():d3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var zQ=new ge("codingAgentTurnProcessor"),qYe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new HQ(e.ctx,this.chatFetcher),this.codingAgentClient=new Nx(e.ctx),this.gitHubClient=new zy(e.ctx),this.codingAgentMessageHandler=new NYe,this.conversationSummarizer=new QYe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s,c,l){try{let u=await Jc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,u,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u),_s(this.turnContext.ctx,u,"codingAgent");let d=u instanceof Error?u.message:JSON.stringify(u);this.turn.status="error",this.updateTurnResponseWithError(d),await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}finally{kWe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l,u,d){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{zQ.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let f;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?f=this.turnContext.turn.workspaceFolders[0]:f=this.turnContext.turn.workspaceFolder,!f)throw new Yf("No workspace folder available for git repository detection");let m=await new W0(this.turnContext.ctx).getRepo(f);if(!m||!m.isGitHub())throw new Yf("No GitHub repository found in the workspace folder");if(!m.owner||!m.name)throw new Yf("Could not determine repository owner and name");let g={owner:m.owner,name:m.name},y=await new $Q([new VQ,new WQ]).getBranchInfo(this.turnContext.ctx,f),E;if(y?.currentBranch&&!y.isDetachedHead){E=y.currentBranch,zQ.debug(this.turnContext.ctx,`Found current branch: ${E}`);try{await this.gitHubClient.getBranch(g.owner,g.name,E),zQ.debug(this.turnContext.ctx,`Branch ${E} exists remotely`)}catch(B){if(B instanceof Pd&&B.status===404){let Q=`Base branch "${E}" does not exist remotely in ${g.owner}/${g.name}. Please push the branch to the remote repository before creating a coding agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${Q} +`,u=Math.round(c*(r-Math.floor(l.length/c))),d=Math.round(u*.4),f=u-d;return e.slice(0,d)+l+e.slice(-f)}};p();var Vh=fe(xo());function hGo(t){let e=t.filter(n=>n.type==="image_url"),r=t.filter(n=>n.type==="text").map(n=>n.text).join("");return{imageUrls:e,textContent:r}}a(hGo,"separateTextAndImages");function mGo(t){return t.map(e=>vscpp(Vh.Image,{src:e.image_url.url,detail:e.image_url.detail}))}a(mGo,"createImageElements");function PKe(t){let{imageUrls:e,textContent:r}=hGo(t);return e.length===0?[vscpp(vscppf,null,r)]:[vscpp(Vh.TextChunk,null,vscpp(vscppf,null,r)),...mGo(e)]}a(PKe,"renderMixedContent");function Sqt(t){return t==null?[]:t.map(r=>({id:r.id||"",type:"function",function:{name:r.function.name,arguments:typeof r.function.arguments=="string"?r.function.arguments:JSON.stringify(r.function.arguments)},approxNumTokens:r.approxNumTokens}))}a(Sqt,"convertToPromptTsxToolCall");function kKe(t){switch(t.role){case"assistant":return gGo(t);case"tool":return AGo(t);case"user":return yGo(t);case"system":return EGo(t);case"function":throw new Error("ChatRole.Function is not supported in prompt-tsx conversion. Use ChatRole.Tool instead.");default:throw new Error(`Unsupported chat role: ${String(t.role)}`)}}a(kKe,"convertChatMessageToPromptTsx");function gGo(t){let e=t.thinking?vscpp(fle,{thinking:t.thinking}):vscpp(vscppf,null);return typeof t.content=="string"?vscpp(Vh.AssistantMessage,{toolCalls:Sqt(t.tool_calls)},vscpp(vscppf,null,t.content),e):Array.isArray(t.content)?vscpp(Vh.AssistantMessage,{toolCalls:Sqt(t.tool_calls)},vscpp(vscppf,null,PKe(t.content)),e):vscpp(Vh.AssistantMessage,{toolCalls:Sqt(t.tool_calls)},vscpp(vscppf,null,JSON.stringify(t.content)),e)}a(gGo,"renderAssistantMessage");function AGo(t){return typeof t.content=="string"?vscpp(Vh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Vh.ToolMessage,{toolCallId:t.tool_call_id||""},PKe(t.content)):vscpp(Vh.ToolMessage,{toolCallId:t.tool_call_id||""},vscpp(vscppf,null,JSON.stringify(t.content)))}a(AGo,"renderToolMessage");function yGo(t){return typeof t.content=="string"?vscpp(Vh.UserMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Vh.UserMessage,null,PKe(t.content)):vscpp(Vh.UserMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(yGo,"renderUserMessage");function EGo(t){return typeof t.content=="string"?vscpp(Vh.SystemMessage,null,vscpp(vscppf,null,t.content)):Array.isArray(t.content)?vscpp(Vh.SystemMessage,null,PKe(t.content)):vscpp(Vh.SystemMessage,null,vscpp(vscppf,null,JSON.stringify(t.content)))}a(EGo,"renderSystemMessage");var _Go=new Ae("conversationHistoryPrompt"),ble=class extends ar{static{a(this,"ConversationHistoryPrompt")}fixToolCallsInResponse(e,r){if(e.tool_calls&&e.tool_calls.length){let n=e.tool_calls,o=[];for(let s of n)r.some(l=>l.role==="tool"&&l.tool_call_id===s.id)?o.push(s):_Go.warn(this.props.ctx,`Tool call ${s.id} does not have a result in the response. Removing it from the tool calls history.`);return{...e,tool_calls:o}}return e}renderCopilot(){return vscpp(vscppf,null,this.renderHistory())}renderHistory(){let e=[];for(let r=0;rthis.fixToolCallsInResponse(l,o)),c=eO(s,{ctx:this.props.ctx,identifier:"conversation history",enableWarnings:!0});c.length>0&&e.push(vscpp(Bx,{assistantRounds:c,ctx:this.props.ctx,isHistorical:!0,identifier:"conversation-history",modelConfiguration:this.props.modelConfiguration}))}}return e}};var NKe=fe(xo());var DKe=class extends ar{static{a(this,"SummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(NKe.SystemMessage,null,"You are an expert at summarizing chat conversations.",vscpp("br",null),vscpp("br",null),"You will be provided:",vscpp("br",null),vscpp("br",null),"- A series of user/assistant message pairs in chronological order",vscpp("br",null),"- A final user message indicating the user's intent.",vscpp("br",null),vscpp("br",null),"Your task is to:",vscpp("br",null),vscpp("br",null),"- Create a detailed summary of the conversation that captures the user's intent and key information.",vscpp("br",null),vscpp("br",null),"Keep in mind:",vscpp("br",null),vscpp("br",null),"- The user is iterating on a feature specification, bug fix, or other common programming task.",vscpp("br",null),"- There may be relevant code snippets or files referenced in the conversation.",vscpp("br",null),"- The user is collaborating with the assistant to refine their ideas and solutions, course-correcting the assistant as needed.",vscpp("br",null),"- The user will provide feedback on the assistant's suggestions and may request changes or improvements.",vscpp("br",null),"- Disregard messages that the user has indicated are incorrect, irrelevant, or unhelpful.",vscpp("br",null),"- Preserve relevant and actionable context and key information.",vscpp("br",null),"- If the conversation is long or discusses several tasks, keep the summary focused on the task indicated by the user's intent.",vscpp("br",null),"- Always prefer decisions in later messages over earlier ones.",vscpp("br",null),vscpp("br",null),"Structure your summary using the following format:",vscpp("br",null),vscpp("br",null),"TITLE: A brief title for the summary",vscpp("br",null),"USER INTENT: The user's goal or intent for the conversation",vscpp("br",null),"TASK DESCRIPTION: Main technical goals and user requirements",vscpp("br",null),"EXISTING: What has already been accomplished. Include file paths and other direct references.",vscpp("br",null),"PENDING: What still needs to be done. Include file paths and other direct references.",vscpp("br",null),"CODE STATE: A list of all files discussed or modified. Provide code snippets or diffs that illustrate important context.",vscpp("br",null),"RELEVANT CODE/DOCUMENTATION SNIPPETS: Key code or documentation snippets from referenced files or discussions.",vscpp("br",null),"OTHER NOTES: Any additional context or information that may be relevant."),vscpp(ble,{priority:1,ctx:this.props.ctx,historyTurns:this.props.conversationTurns}),vscpp(NKe.UserMessage,null,vscpp(vscppf,null,"Here is the conversation to summarize above. Please provide a detailed summary following the specified format.")))}};function $vn(t){let e={title:"",userIntent:""},r=t.match(/\*{0,2}TITLE:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);r&&(e.title=r[1].trim());let n=t.match(/\*{0,2}USER INTENT:\*{0,2}\s*(.+?)(?=\*{2}[A-Z]|\n|$)/);return n&&(e.userIntent=n[1].trim()),e}a($vn,"parseStructuredSummary");var MKe=class{constructor(e,r){this.ctx=e;this.chatFetcher=r}static{a(this,"ChatMLConversationSummarizer")}async provideSummary(e,r,n){try{let o=e.turns.filter(m=>m.status==="success"&&m.request?.message&&m.response?.message),s=e.turns.length>0?e.turns[e.turns.length-1]:null,c=s&&s.request?.message?[...o,s]:o;if(c.length===0)return ot.debug(this.ctx,"No turns to summarize"),"";let l=n.modelProviderName&&n.userRequestedModelIdOrEmpty?await HM(this.ctx,n.modelProviderName,n.userRequestedModelIdOrEmpty):await Ro.getModelConfigurationById(this.ctx,n.userRequestedModelIdOrEmpty,e.id.toString(),UQ(c));Ro.applyModelConfigurationOverrides(this.ctx,l,n.modelInfo);let f={messages:(await tp.create(DKe,{ctx:this.ctx,conversationTurns:c},l).renderPrompt(void 0,r)).messages,uiKind:n.uiKind,llmInteraction:n.llmInteraction,modelConfiguration:l,turnId:n.turnId},h=await this.chatFetcher.fetchResponse(f,r,n.telemetryWithExp,void 0);if(r.isCancellationRequested)return ot.debug(this.ctx,"Summarization cancelled"),"";if(h.type==="success"){let m=h.value.trim();return m.match(/^".*"$/)&&(m=m.slice(1,-1)),ot.debug(this.ctx,`Successfully generated conversation summary of length ${m.length}`),m}else{let m="reason"in h?h.reason:"unknown";return ot.error(this.ctx,`Failed to fetch conversation summary because of response type (${h.type}) and reason (${m})`),""}}catch(o){return ot.exception(this.ctx,o,"Error generating conversation summary"),""}}};p();var wIe=new Ae("repository"),m3=class t{static{a(this,"GitBranchData")}constructor(e,r=!1){this.currentBranch=e,this.isDetachedHead=r}static detachedHead(){return new t(void 0,!0)}static branch(e){return new t(e,!1)}},Lx=class{static{a(this,"GitBranchLoader")}},YQ=class extends Lx{constructor(r){super();this.loaders=r}static{a(this,"GitFallbackBranchLoader")}async getBranchInfo(r,n){for(let o of this.loaders){let s=await o.getBranchInfo(r,n);if(s)return s}}};p();var Vvn=require("child_process");var KQ=class extends Lx{static{a(this,"GitCLIBranchLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,Vvn.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){wIe.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getBranchInfo(e,r){let n=Ko(r);if(n===void 0)return;let o;try{o=(await _Q()).path}catch(c){wIe.info(e,`Skipping git branch lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","branch","--show-current",...this.extraArgs()]);if(s!==void 0){let c=s.trim();return c?m3.branch(c):m3.detachedHead()}}extraArgs(){return[]}};p();var JQ=class extends Lx{static{a(this,"GitParsingBranchLoader")}async getBranchInfo(e,r){try{let n=e.get(jo),o=Sa(r,".git","HEAD"),s=await n.readFileString(o);return this.parseHeadContent(s.trim())}catch(n){let o=typeof r=="string"?r:r.uri;wIe.info(e,`Failed to parse git HEAD file in ${o}:`,n);return}}parseHeadContent(e){if(e.startsWith("ref: refs/heads/")){let r=e.substring(16);return m3.branch(r)}else return this.isCommitSha(e)?m3.detachedHead():m3.detachedHead()}isCommitSha(e){return/^[a-f0-9]{40}$/i.test(e)}};var ZQ=new Ae("codingAgentTurnProcessor"),OKe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new WQ(e.ctx,this.chatFetcher),this.codingAgentClient=new Ox(e.ctx),this.gitHubClient=new Ky(e.ctx),this.codingAgentMessageHandler=new xKe,this.conversationSummarizer=new MKe(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn}static{a(this,"CodingAgentTurnProcessor")}async process(e,r,n,o,s){try{let c=await Kc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});await this.processWithCodingAgent(e,r,this.turnContext,c,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c),La(this.turnContext.ctx,c,"codingAgent");let l=c instanceof Error?c.message:JSON.stringify(c);this.turn.status="error",this.updateTurnResponseWithError(l),await this.endProgress({error:{message:l,code:kQ.Unknown,responseIsIncomplete:!0}})}finally{eYe(this.turnContext.ctx).catch(()=>{})}}async processWithCodingAgent(e,r,n,o,s,c,l){await this.conversationProgress.begin(this.conversation,this.turn,e),r.onCancellationRequested(async()=>{ZQ.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});try{let u;if(this.turnContext.turn.workspaceFolders&&this.turnContext.turn.workspaceFolders.length>0?u=this.turnContext.turn.workspaceFolders[0]:u=this.turnContext.turn.workspaceFolder,!u)throw new ep("No workspace folder available for git repository detection");let f=await new z0(this.turnContext.ctx).getRepo(u);if(!f||!f.isGitHub())throw new ep("No GitHub repository found in the workspace folder");if(!f.owner||!f.name)throw new ep("Could not determine repository owner and name");let h={owner:f.owner,name:f.name},g=await new YQ([new KQ,new JQ]).getBranchInfo(this.turnContext.ctx,u),A;if(g?.currentBranch&&!g.isDetachedHead){A=g.currentBranch,ZQ.debug(this.turnContext.ctx,`Found current branch: ${A}`);try{await this.gitHubClient.getBranch(h.owner,h.name,A),ZQ.debug(this.turnContext.ctx,`Branch ${A} exists remotely`)}catch(N){if(N instanceof Pd&&N.status===404){let B=`Base branch "${A}" does not exist remotely in ${h.owner}/${h.name}. Please push the branch to the remote repository before creating a cloud agent job.`;throw await this.conversationProgress.report(this.conversation,this.turn,{reply:`${B} -`}),zQ.error(this.turnContext.ctx,Q),new Yf(Q)}throw B}}else throw new Yf("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let _=In(this.turn.request.message),v=Vyn(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),b=Wyn(v);zQ.debug(this.turnContext.ctx,`Extracted ${v.length} context file paths (${b.length} characters formatted)`);let T="",w=TYe(_);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... +`}),ZQ.error(this.turnContext.ctx,B),new ep(B)}throw N}}else throw new ep("No current branch found or detached HEAD state");if(r.isCancellationRequested)return;let y=Rn(this.turn.request.message),E=J_n(this.turnContext.ctx,this.turn.request.references,this.turn.request.activeEditor),_=Z_n(E);ZQ.debug(this.turnContext.ctx,`Extracted ${E.length} context file paths (${_.length} characters formatted)`);let v="",b=EKe(y);if(this.conversation.turns.length>1){await this.conversationProgress.report(this.conversation,this.turn,{reply:`Analyzing chat history... -`});let{structuredSummary:B,rawSummary:Q}=await this.summarizeConversation(r,o,l,u);if(r.isCancellationRequested)return;B&&B.title&&(w=B.title),T=Q||""}let R=b;T&&(R=b+(b?` +`});let{structuredSummary:N,rawSummary:B}=await this.summarizeConversation(r,o,l);if(r.isCancellationRequested)return;N&&N.title&&(b=N.title),v=B||""}let T=_;v&&(T=_+(_?` -`:"")+T);let{problemStatement:x}=Gyn(this.turnContext.ctx,_,R||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to coding agent... +`:"")+v);let{problemStatement:w}=Y_n(this.turnContext.ctx,y,T||void 0);await this.conversationProgress.report(this.conversation,this.turn,{reply:`Delegating to cloud agent... -`});let k=await this.codingAgentClient.createCodingTask(w,x,g.owner,g.name,E,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,k.pullRequest.title,k.pullRequest.body||"",k.pullRequest.html_url)}catch(B){zQ.warn(this.turnContext.ctx,"Failed to send coding agent message to client",B)}let D="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:D}),this.turn.response={message:D,type:"model"},this.turn.status="success";let N={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let B=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof B=="string"&&B!==""&&(N.suggestedTitle=B)}let L=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ht(this.turnContext.ctx,"codingAgent",L),MI(this.turnContext.ctx,"codingAgent",L),await this.endProgress(N)}catch(f){if(T9e(this.turnContext.ctx,"codingAgent",f,o),f instanceof Mc)zQ.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,f),_s(this.turnContext.ctx,f,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(f instanceof _P)_s(this.turnContext.ctx,f,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(f.message),await this.endProgress({error:{message:f.message,code:mQ.Default,responseIsIncomplete:!0}});else throw zQ.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,f),f}}async summarizeConversation(e,r,n,o,s){let c=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModel:n||"",modelProviderName:o||"",modelInfo:s||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!c)return{structuredSummary:null,rawSummary:null};let l=QEn(c);return Ye.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${l.title}, Intent: ${l.userIntent}`),{structuredSummary:l,rawSummary:c}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return Ye.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=TQ(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var jEn="```",CIe=String.raw``,$7o=String.raw`${jEn}[\w]*?\n(?[\s\S]*?)\n${jEn}`,V7o=new RegExp(CIe+` -`+$7o,"gs"),f7t=["replace","delete"];function p7t(t,e){let r=t.matchAll(V7o),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!f7t.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` +`});let R=await this.codingAgentClient.createCodingTask(b,w,h.owner,h.name,A,r);if(r.isCancellationRequested)return;try{await this.codingAgentMessageHandler.sendCodingAgentMessage(this.turnContext,R.pullRequest.title,R.pullRequest.body||"",R.pullRequest.html_url)}catch(N){ZQ.warn(this.turnContext.ctx,"Failed to send coding agent message to client",N)}let x="Your work will be continued in this pull request:";await this.conversationProgress.report(this.conversation,this.turn,{reply:x}),this.turn.response={message:x,type:"model"},this.turn.status="success";let P={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let N=await this.fetchSuggestedTitle(r,o.extendedBy({messageSource:"chat.user"},{}));typeof N=="string"&&N!==""&&(P.suggestedTitle=N)}let D=o.extendedBy({modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});yt(this.turnContext.ctx,"codingAgent",D),PI(this.turnContext.ctx,"codingAgent",D),await this.endProgress(P)}catch(u){if(f9e(this.turnContext.ctx,"codingAgent",u,o),u instanceof Dc)ZQ.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,u),La(this.turnContext.ctx,u,"codingAgent"),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(u instanceof bk)La(this.turnContext.ctx,u,"codingAgent"),this.turn.status="error",this.updateTurnResponseWithError(u.message),await this.endProgress({error:{message:u.message,code:kQ.Default,responseIsIncomplete:!0}});else throw ZQ.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,u),u}}async summarizeConversation(e,r,n){let o=await this.conversationSummarizer.provideSummary(this.conversation,e,{userRequestedModelIdOrEmpty:n?.id||"",modelProviderName:n?.providerName||"",modelInfo:n||void 0,llmInteraction:this.turnContext.toLlmInteraction(),uiKind:this.strategy.uiKind,telemetryWithExp:r,turnId:String(this.turn.id)});if(!o)return{structuredSummary:null,rawSummary:null};let s=$vn(o);return ot.debug(this.turnContext.ctx,`Generated conversation summary - Title: ${s.title}, Intent: ${s.userIntent}`),{structuredSummary:s,rawSummary:o}}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=QQ(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};p();p();var Wvn="```",RIe=String.raw``,vGo=String.raw`${Wvn}[\w]*?\n(?[\s\S]*?)\n${Wvn}`,CGo=new RegExp(RIe+` +`+vGo,"gs"),Tqt=["replace","delete"];function Iqt(t,e){let r=t.matchAll(CGo),n=Array.from(r),o=[];for(let s of n){let c=s.groups;if(!c||!Tqt.includes(c.mode))continue;let l=c.start?parseInt(c.start)-1:-1,u=c.end?parseInt(c.end)-1:l,f=c.codeblock.split(` `),h=f[0].match(/^\s*/)?.[0]??"";f.forEach((y,E)=>{f[E]=y.slice(h.length)});let m={mode:c.mode,codeblock:f.join(` -`),start:l,end:u},g=h7t([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(p7t,"extractEditsFromTaggedCodeblocks");function h7t(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` +`),start:l,end:u},g=xqt([m],e);if(!g)continue;let A={text:g,uri:e.uri};o.push({...m,updatedDocument:A})}return o}a(Iqt,"extractEditsFromTaggedCodeblocks");function xqt(t,e){if(t.length===0)return;t.sort((n,o)=>n.start!==o.start?o.start-n.start:o.end-n.end);let r=e.getText().split(` `);for(let n of t){let o=n.start,s=n.end,c=n.mode,l=n.codeblock.split(` `);if(!(o<0||s<0||s=r.length||s>=r.length)){if(c==="delete")r.splice(o,s-o+1);else if(c==="replace"){let u=r[o].match(/^\s*/)?.[0]??"";l.forEach((d,f)=>{l[f]=u+d}),r.splice(o,s-o+1,...l)}}}return r.join(` -`)}a(h7t,"applyEditsToDocument");var mle=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await Uo.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(dA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},jYe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await FQ(e.ctx),u=await e.ctx.get(Bc).getBestChatModelConfig(hS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(dA).toPrompt(e,d)}async processResponse(e){let r=[],n=In(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(Vy);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(Jn).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=p7t(e,r).filter(c=>f7t.includes(c.mode)),s=h7t(o,r);if(s)return await this.ctx.get(Uh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return p7t(e,r)}};var HYe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new mle(e.ctx);return new qYe(e,r)}};p();p();p();p();function HEn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(HEn,"filterUnsupportedReferences");function GEn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(GEn,"convertToCopilotReferences");var $En=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var YQ=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,HEn(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var rO=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Ur).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(MN).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(ar).fetch(l,{method:"GET",headers:c})}};p();p();var VEn=S.Object({name:S.String(),url:S.String()}),WEn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(VEn)})),remotes:S.Optional(S.Array(VEn))}),m7t=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(nO,"git repository information");let r=[];return r.push([new Ar(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new Ar([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new Ar([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new Ar(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new Ar([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new Ar(r)}},nO="git-metadata",GYe=class extends Xm{static{a(this,"GitMetadataSkill")}constructor(e){super(nO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new m7t(r))}};async function zEn(t){let e=await t.skillResolver.resolve(Vy);if(e){let c=e.uri,l=R7(t.ctx,c);if(Ecn(l))return{repoInfo:l,skillUsed:Vy}}let r=await t.skillResolver.resolve(nO);if(!r||!r.remotes||r.remotes.length===0){Ye.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=t3t(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:nO}}a(zEn,"extractRepoInfo");async function YEn(t){let e=[];return await W7o(t,e),await z7o(t,e),await Y7o(t,e),e}a(YEn,"skillsToReference");async function W7o(t,e){let r=await K7o(t);r&&e.push(r)}a(W7o,"addRepositoryReference");async function z7o(t,e){let r=await J7o(t);r&&e.push(r)}a(z7o,"addSelectionReference");async function Y7o(t,e){let r=[],n=await X7o(t);n&&r.push(n),r.push(...await eQo(t)),r.length>0&&e.push(...r)}a(Y7o,"addFileReferences");async function K7o(t){let e=await zEn(t);if(e){let r=t.ctx.get(rO),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(K7o,"gitMetadataToReference");async function J7o(t){let e=await t.skillResolver.resolve(Vy);if(e&&e.selection){let n=await t.ctx.get(Jn).getOrReadTextDocument(e),o=zu(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return Z7o(e,n.document)}}a(J7o,"currentEditorToSelectionReference");function Z7o(t,e){if(t.selection&&!cle(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(Z7o,"extractSelection");async function X7o(t){let e=await t.skillResolver.resolve(Vy);if(e){let n=await t.ctx.get(Jn).getOrReadTextDocument(e),o=zu(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(X7o,"currentEditorToFileReference");async function eQo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(Jn);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=zu(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(eQo,"fileReferenceToPlatformFileReference");p();p();var ng="https://aka.ms/github-copilot-rate-limit-error";function tQo(t){if(t<90)return`${t} ${t===1?"second":"seconds"}`;let e=Math.floor(t/60);if(t<=5400)return`${e} ${e===1?"minute":"minutes"}`;let r=Math.floor(e/60),n=e%60,o=`${r} ${r===1?"hour":"hours"}`;return n>0&&(o+=` ${n} ${n===1?"minute":"minutes"}`),o}a(tQo,"secondsToHumanReadableTime");var KQ=class t{static{a(this,"CapiErrorTranslator")}static formatRequestId(e,r){let n=[];return e&&n.push(`Request ID: ${e}`),r&&n.push(`GitHub Request ID: ${r}`),n.length>0?` ${n.join(" | ")}`:""}static appendRequestId(e,r,n){return`${e}${t.formatRequestId(r,n)}`}static translateErrorMessage(e,r,n,o,s,c){let l;switch(e){case 466:l="Oops, your plugin is out of date. Please update it.";break;case 401:l="Oops, you are not authorized. Please sign in. If you are using a custom model, please check if the API key is still valid.";break;case 402:l=r||"Oops, you need to upgrade your plan.";break;case 413:l="Oops, your request is too large. Please try again with a smaller input.";break;case 429:l=t.getRateLimitMessage(o,c);break;case 503:l=r||"Oops, the service is currently unavailable. Please try again later.";break;default:if(r&&r.trim().length>0){let u=360,d=t.formatRequestId(n,s),f="Sorry, an error occurred while generating a response. Details: ",h=u-f.length-d.length;if(r.length<=h)return`${f}${r}${d}`;{let m=r.substring(0,h);return`${f}${m}... Read more from logs.${d}`}}l="Sorry, an error occurred while generating a response.";break}return t.appendRequestId(l,n,s)}static getRateLimitMessage(e,r){let n=e===void 0?"a moment":tQo(e),o=r?.capiErrorCode,s=r?.isAuto;if(o?.startsWith("agent_mode_limit_exceeded"))return`Sorry, you have exceeded the agent mode rate limit. Please switch to ask mode and try again in ${n}. [Learn More](${ng})`;if(o?.startsWith("model_overloaded")||o?.startsWith("upstream_provider_rate_limit"))return s?`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n}. [Learn More](${ng})`:`Sorry, the upstream model provider is currently experiencing high demand. Please try again in ${n} or consider switching to Auto. [Learn More](${ng})`;if(o?.startsWith("user_global_rate_limited"))return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?`You've hit your session rate limit. Please upgrade your plan or wait ${n} for your limit to reset. [Learn More](${ng})`:`You've hit your session rate limit. Please wait ${n} for your limit to reset. [Learn More](${ng})`;if(o?.startsWith("user_weekly_rate_limited")){if(e!==void 0){let l=new Date(Date.now()+e*1e3).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"});return r?.copilotPlan==="free"||r?.copilotPlan==="individual"||r?.copilotPlan==="individual_pro"?s?`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l}. [Learn More](${ng})`:`You've reached your weekly rate limit. Please upgrade your plan or wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${ng})`:s?`You've reached your weekly rate limit. Please wait for your limit to reset on ${l}. [Learn More](${ng})`:`You've reached your weekly rate limit. Please wait for your limit to reset on ${l} or consider switching to Auto. [Learn More](${ng})`}return s?`You've reached your weekly rate limit. Please wait ${n} for your limit to reset. [Learn More](${ng})`:`You've reached your weekly rate limit. Please wait ${n} for your limit to reset or consider switching to Auto. [Learn More](${ng})`}return o?.startsWith("user_model_rate_limited")?s?`You've hit the rate limit for this model. Please try again in ${n}. [Learn More](${ng})`:`You've hit the rate limit for this model. Please try switching to Auto or try again in ${n}. [Learn More](${ng})`:o?.startsWith("integration_rate_limited")?`Sorry, GitHub Copilot Chat is currently experiencing high demand. Please try again in ${n}. [Learn More](${ng})`:o?s?`Sorry, you have been rate-limited. Please wait ${n} before trying again. [Learn More](${ng})`:`Sorry, you have been rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${ng})`:s?`Sorry, your request was rate-limited. Please wait ${n} before trying again. [Learn More](${ng})`:`Sorry, your request was rate-limited. Please wait ${n} before trying again or consider switching to Auto. [Learn More](${ng})`}};p();p();p();var n_n=ce(WYe()),E7t=ce(require("path"));var i_n=500,dQo=Math.floor(.25*i_n),zYe=class{static{a(this,"FixedSizeChunking")}async chunk(e,r){let n=[],o=E7t.default.extname(__filename)===".ts"?E7t.default.resolve(__dirname,"../../../../../../dist/main.js"):__filename;return n=await n_n.job(async({text:s,uri:c,tokenizerName:l,directory:u,chunkSize:d,overlap:f})=>{let m=await require(u).getTokenizerAsync(l),g=m.tokenize(s),A=g.length,y=[],E=0;for(;E=A,v=_?A:E+d,b=g.slice(E,v),T=m.detokenize(b),w=s.indexOf(T);y.push({id:`${c.toString()}#${E}`,chunk:T,tokenCount:b.length,range:{start:w,end:w+T.length}}),E=_?v:v-f}return y},{data:{text:e.getText(),uri:e.uri.toString(),tokenizerName:r.tokenizer,directory:o,chunkSize:i_n,overlap:dQo}}),n}};var fQo="fixedSize",pQo=new Map([["fixedSize",zYe]]);function o_n(t){let e=t==="default"?fQo:t,r=pQo.get(e);if(!r)throw new Error(`Chunking constructor for type ${t} not found`);return r}a(o_n,"getChunkingAlgorithm");p();p();var YYe=ce(IB()),iO=ce(require("fs")),s_n=require("os"),Bx=ce(require("path")),gle=require("process");var _7t=5e4,hQo=new ge("workspaceChunks"),KYe=class t{constructor(e,r){this.ctx=e;this.pathHashLength=8;this.chunksCountCache=new Map;let n=ji(r.uri),o=(0,YYe.SHA256)(r.uri).toString().substring(0,this.pathHashLength);this.cacheRootPath=Bx.join(C7t(),"project-context",`${n}.${o}`)}static{a(this,"WorkspaceChunks")}static{this.CACHE_VERSION="1.0.0"}getChunksCacheFile(e){let r=(0,YYe.SHA256)(e).toString().substring(0,this.pathHashLength),n=Bx.basename(e);return Bx.join(this.cacheRootPath,`${n}.${r}.json`)}async getChunksCacheFromCacheFile(e){let r=await iO.promises.readFile(e,{encoding:"utf8"}).catch(()=>{});if(r)try{return JSON.parse(r)}catch{}}async getChunksCache(e){let r=this.getChunksCacheFile(e);return await this.getChunksCacheFromCacheFile(r)}async setChunksCache(e,r){let n=this.getChunksCacheFile(e);try{await iO.promises.mkdir(Bx.dirname(n),{recursive:!0}),await iO.promises.writeFile(n,JSON.stringify(r),{encoding:"utf8"})}catch(o){hQo.debug(this.ctx,"Failed to set chunks cache:",o)}}async removeChunksCache(e){let r=this.getChunksCacheFile(e);await iO.promises.rm(r).catch(()=>{})}async enumerateChunksCacheFileNames(){return await iO.promises.readdir(this.cacheRootPath).catch(()=>[])}async getFilesCount(){return(await this.enumerateChunksCacheFileNames()).length}async getChunksCount(){let e=0;for(let r of await this.enumerateChunksCacheFileNames()){let n=Bx.join(this.cacheRootPath,r);if(!this.chunksCountCache.has(n)){let o=await this.getChunksCacheFromCacheFile(n);this.chunksCountCache.set(n,o?.documentChunks?.length??0)}e+=this.chunksCountCache.get(n)||0}return e}async*getChunksForFile({uri:e}){let r=await this.getChunksCache(e);r!==void 0&&(yield*r.documentChunks)}async*getChunksFromCacheFile(e){let r=await this.getChunksCacheFromCacheFile(e);yield*r?r.documentChunks:[]}async*getChunks(e){if(e!==void 0)yield*this.getChunksForFile(e);else{let r=await this.enumerateChunksCacheFileNames();for(let n of r)yield*this.getChunksFromCacheFile(Bx.join(this.cacheRootPath,n))}}async getFileHash(e){let r=ho(e),n="";return r&&(n=await iO.promises.readFile(r,{encoding:"utf8"}).catch(()=>"")),(0,YYe.SHA256)(n).toString()}async addChunks({uri:e},r){let n=Array.isArray(r)?()=>Promise.resolve(r):r,o=ho(e);if(!o)return;async function s(h){try{return(await iO.promises.stat(h)).mtimeMs}catch{return}}a(s,"getLastModified");let c=await s(o),l=await this.getChunksCache(e);if(l!==void 0&&l.version===t.CACHE_VERSION&&c!==void 0&&l.lastModified===c){this.chunksCountCache.set(o,l.documentChunks.length);return}let u=await this.getFileHash(e),d=await n();this.chunksCountCache.set(o,d.length);let f={version:t.CACHE_VERSION,filePath:e,hash:u,lastModified:c,documentChunks:d};await this.setChunksCache(e,f)}async deleteChunksForSource(e){let r=Ia(e),n=await this.getChunksCache(r);return n===void 0?[]:(await this.removeChunksCache(r),n.documentChunks)}async deleteChunks({uri:e}){let r=ho(e);if(!r)return[];let n;try{n=await iO.promises.readdir(r)}catch{return await this.deleteChunksForSource(r)}let o=[];for(let s of n){let c=Ia(Bx.join(r,s));o.push(...await this.deleteChunks({uri:c}))}return o}async clear(){await iO.promises.rm(this.cacheRootPath,{recursive:!0}).catch(()=>{})}};function C7t(){return gle.env.XDG_CACHE_HOME&&Bx.isAbsolute(gle.env.XDG_CACHE_HOME)?gle.env.XDG_CACHE_HOME+"/github-copilot":(0,s_n.platform)()==="win32"?gle.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":gle.env.HOME+"/.cache/github-copilot"}a(C7t,"getXdgCachePath");var v7t=1e4;var JYe=class{constructor(e,r,n){this.workspaceFolder=r;this.implementation=n;this._chunkLimiter=new S7t;this.status="notStarted",this.workspaceChunks=new KYe(e,r),this.cancellationToken=new b7t,this._chunkingTimeMs=0,this._fileCountExceeded=!1,this._chunkCountExceeded=!1,this._totalFileCount=0,this._filesUpdated=new Set}static{a(this,"ChunkingHandler")}async chunk(e,r){return r?await this.chunkFiles(e,r):await this.chunkWorkspace(e)}async chunkWorkspace(e){let r=performance.now();if(this.status="started",this.cancellationToken.isCancelled())return this.status="cancelled",this.updateChunkingTime(r,performance.now()),this.workspaceChunks.getChunks();await this.updateModelConfig(e);let n=await e.get(qy).getWatchedFiles(this.workspaceFolder);this._totalFileCount=n.length,n.length>v7t&&(this._fileCountExceeded=!0,n=n.slice(0,v7t));let o=n.map(async s=>{this.cancellationToken.isCancelled()||await this._chunkLimiter.queue(()=>this._chunk(e,s))});try{await Promise.all(o)}catch(s){_s(e,s,"ChunkingProvider.chunk"),this.terminateChunking()}return this.status=this.cancellationToken.isCancelled()?"cancelled":"completed",this.updateChunkingTime(r,performance.now()),await this.workspaceChunks.getChunksCount()>_7t&&(this._chunkCountExceeded=!0),this.workspaceChunks.getChunks()}async chunkFiles(e,r){await this.updateModelConfig(e);let n=r.map(async o=>{this.cancellationToken.isCancelled()||(this._filesUpdated.add(o.uri),await this._chunkLimiter.queue(()=>this._chunk(e,o)))});try{await Promise.all(n)}catch(o){_s(e,o,"ChunkingProvider.chunkFiles"),this.terminateChunking()}return await this.workspaceChunks.getChunksCount()>_7t&&(this._chunkCountExceeded=!0),await this.workspaceChunks.getFilesCount()>v7t&&(this._fileCountExceeded=!0),pmn(...r.map(o=>this.workspaceChunks.getChunks(o)))}async _chunk(e,r){this.cancellationToken.isCancelled()||await this.workspaceChunks.addChunks(r,()=>this.implementation.chunk(r,this.modelConfig))}async updateModelConfig(e){this.modelConfig||(this.modelConfig=await Uo.getModelConfiguration(e,"user"))}terminateChunking(){this.cancellationToken.cancel()}async clearChunks(){await this.workspaceChunks.clear()}updateChunkingTime(e,r){this._chunkingTimeMs=r-e}get chunkingTimeMs(){return Math.floor(this._chunkingTimeMs)}get fileCountExceeded(){return this._fileCountExceeded}get totalFileCount(){return this._totalFileCount}get chunkCountExceeded(){return this._chunkCountExceeded}get filesUpdatedCount(){return this._filesUpdated.size}async getFilesCount(){return this.workspaceChunks.getFilesCount()}getChunks(){return this.workspaceChunks.getChunks()}async getChunksCount(){return this.workspaceChunks.getChunksCount()}deleteSubfolderChunks(e){return this.workspaceChunks.deleteChunks({uri:e})}deleteFileChunks(e){return this._filesUpdated.add(e),this.workspaceChunks.deleteChunks({uri:e})}},b7t=class{constructor(){this.cancelled=!1}static{a(this,"ChunkingCancellationToken")}cancel(){this.cancelled=!0}isCancelled(){return this.cancelled}},S7t=class{constructor(e=20){this.maxCount=e;this.tasks=[];this.runningTasks=0}static{a(this,"Limiter")}async queue(e){return new Promise((r,n)=>{this.tasks.push({factory:e,resolve:r,reject:n}),this.consume()})}consume(){for(;this.tasks.length>0&&this.runningTasksthis.consumed(),()=>this.consumed())}}consumed(){this.runningTasks--,this.consume()}};var Y0=class{constructor(e){this.ctx=e;this.workspaceChunkingProviders=new Map}static{a(this,"ChunkingProvider")}get workspaceCount(){return this.workspaceChunkingProviders.size}createImplementation(e,r){let n=o_n(r),o=new n;return new JYe(this.ctx,e,o)}getImplementation(e,r="default"){let n=this.getParentFolder(e);if(n)return this.workspaceChunkingProviders.get(n.uri);let o=this.workspaceChunkingProviders.get(e.uri);return o||(o=this.createImplementation(e,r),this.workspaceChunkingProviders.set(e.uri,o)),o}getParentFolder(e){let r=[];for(let n of this.workspaceChunkingProviders.values())r.push(n.workspaceFolder);return r.find(n=>{let o=n.uri.replace(/[#?].*/,"").replace(/\/?$/,"/");return e.uri!==n.uri&&e.uri.startsWith(o)})}status(e){return this.getImplementation(e).status}checkLimits(e){let r=this.getImplementation(e);return{fileCountExceeded:r.fileCountExceeded,chunkCountExceeded:r.chunkCountExceeded}}fileCount(e){return this.getImplementation(e).getFilesCount()}chunkCount(e){return this.getImplementation(e).getChunksCount()}chunkingTimeMs(e){return this.getImplementation(e).chunkingTimeMs}getChunks(e){return this.getImplementation(e).getChunks()}terminateChunking(e,r){let n=this.getImplementation(r);n.terminateChunking();let s=jt.createAndMarkAsIssued().extendedBy(void 0,{fileCount:n.filesUpdatedCount});ht(e,"index.terminate",s),this.workspaceChunkingProviders.delete(r.uri)}async clearChunks(e,r){this.terminateChunking(e,r),await this.getImplementation(r).clearChunks()}async deleteSubfolderChunks(e,r){return await this.getImplementation(e).deleteSubfolderChunks(r.uri)}async deleteFileChunks(e,r){let n=this.getImplementation(e),o=[];Array.isArray(r)||(r=[r]);for(let s of r)o.push(...await n.deleteFileChunks(s));return o}async chunk(e,r,n,o){let s;return n&&(Array.isArray(n)?s=n:o=n),o||(o="default"),s?await this.chunkFiles(e,r,s,o):await this.chunkFolder(e,r,o)}async chunkFolder(e,r,n="default"){let o=this.getImplementation(r,n),s=await o.chunk(e),l=jt.createAndMarkAsIssued().extendedBy(void 0,{fileCount:o.totalFileCount,chunkCount:await o.getChunksCount(),timeTakenMs:o.chunkingTimeMs,workspaceCount:this.workspaceCount});return ht(e,"index.chunk",l),s}async chunkFiles(e,r,n,o="default"){return await this.getImplementation(r,o).chunk(e,n)}};Ns();var mQo=new ge("ChatFetchResultPostProcessor"),Ale=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(bmn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s.extendedBy({},{fileCount:this.turnContext.ctx.get(Y0).workspaceCount})),await this.turnContext.ctx.get(Uh).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:In(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},mQo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:KQ.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===MS,copilotPlan:FI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=Uo.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},Smn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:In(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new HQ(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return Ye.debug(this.turnContext.ctx,"Computed followup",l),Ye.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:gr(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return wmn(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",Tmn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var ZYe=S.Union([S.String(),S.Number()]),uK=S.Union([S.String(),S.Number()]),gQo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),XYe=S.Object({uri:S.String(),position:S.Optional(rg)}),AQo=S.Object({type:S.Literal("file"),uri:S.String(),visibleRange:S.Optional(hf),selection:S.Optional(hf),status:S.Optional(gQo),range:S.Optional(hf)}),yQo=S.Object({type:S.Literal("directory"),uri:S.String()}),EQo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),oO=S.Union([AQo,yQo,$En,EQo]),sO=S.Union([S.Literal("panel"),S.Literal("inline")]),_Qo=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),T7t=S.Union([S.String(),S.Array(_Qo)]),a_n=S.Object({request:T7t,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(uK),model:S.Optional(S.String())});function eKe(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a(eKe,"convertToMessageContent");function tKe(t,e){if(t=RS(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(tKe,"appendToMessage");var rKe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),CQo=S.Object({type:S.String(),description:S.String()}),c_n=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),CQo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Lc=S.Object({uri:S.String(),name:S.String()}),vQo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),nKe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:vQo});Ns();var I7t="generate-response",iKe=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},bIe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(r.ctx),this.postProcessor=new Ale(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof iKe?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await Jc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(Uh).inspectPrompt(l),await n.steps.start(I7t,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:RS(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return gr()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return SUt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:RS(r.request.message)}),r.response&&r.response.type==="model"){let o=GEn(r.response.references);n.push({role:"assistant",content:RS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await YEn(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new YQ((h,m,g,A,y,E)=>{let _=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:_,thinking:E}),this.turn.response?(this.turn.response.message=tKe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),_&&(this.turn.confirmationRequest=_)}),u=await this.turnContext.ctx.get(Qt).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:In(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),In(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new iKe("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return QTe(this.conversation,"conversationPanel",In(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(I7t,e.error.message):await r.steps.finish(I7t)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var SIe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new bIe(this,e)}},oKe=class extends SIe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new bIe(this,e)}};p();var bQo="github",vP=class{static{a(this,"RemoteAgentRegistry")}},sKe=class extends vP{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await zz(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Dr.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Dr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Dr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==bQo).map(o=>new SIe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var l_n=ce(require("fs")),P_=ce(require("path"));var x7t=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],w7t="test_",TIe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},IIe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=ji(e),n=P_.extname(r).replace(".",""),o=TIe[n]??{location:"sameFolder",prefix:w7t,suffix:x7t},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=ho(tf(e)),l===void 0)return}else{let d=ho(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=P_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=Ia(l);if(await this.fileExists(u))return xa(u,s[0])}parseTestFilePath(e){try{return Ia(e)}catch(r){Dr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=ji(e),n=P_.extname(r).replace(".",""),o=TIe[n]??{location:"sameFolder",prefix:w7t,suffix:x7t},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=tf(e):l=this.determineImplFolder(e);for(let u of s){let d=xa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=ho(e);if(r===void 0)return;let n=P_.extname(ji(e)).replace(".",""),o,s=TIe[n]?.location??"sameFolder";s==="sameFolder"?o=P_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,TIe[n]);if(c.length>0)return Ia(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${P_.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return l_n.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&ho(this.baseUri))??"",o=P_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(P_.sep)}getRelativeTestFolder(e,r,n,o){let s=P_.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=P_.extname(ji(e)).replace(".",""),n=tf(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function xIe(t){let e=ji(t),r=P_.extname(e),n=TIe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(x7t.some(s=>e.endsWith(s+r))||e.startsWith(w7t))}a(xIe,"isTestFile");p();var JQ=class{constructor(){this._cache=new nn(100)}static{a(this,"BlackbirdIndexingStatus")}async queryIndexingStatus(e,r,n){let o=e.ctx;if(!n)return!1;let s=`repos/${r}/copilot_internal/embeddings_index`,c=await Td(o,n,s);return c.ok?(await c.json()).semantic_code_search_ok:!1}isValid(e){return e!==void 0&&Date.now()-e.timestamp<1800*1e3}async isRepoIndexed(e,r,n,o=!1){let s=qL(r);if(!s)return!1;let c=this._cache.get(s);if(!o&&this.isValid(c))return c.status;let l=await this.queryIndexingStatus(e,s,n);return this._cache.set(s,{status:l,timestamp:Date.now()}),l}get cache(){return this._cache}};p();p();p();p();p();var aKe=class{static{a(this,"CosineSimilarityScoring")}score(e,r){let n=Math.sqrt(e.reduce((c,l)=>c+l*l,0)),o=Math.sqrt(r.reduce((c,l)=>c+l*l,0));return e.reduce((c,l,u)=>c+l*r[u],0)/(n*o)}terminateScoring(){}};var SQo="cosine",TQo=new Map([["cosine",aKe]]);function u_n(t){let e=t==="default"?SQo:t,r=TQo.get(e);if(!r)throw new Error(`Scoring constructor for type ${t} not found`);return r}a(u_n,"getScoringAlgorithm");p();var Lx=class{constructor(){this.workspaceScoringProviders=new nn(25)}static{a(this,"ScoringProvider")}createImplementation(e,r){let n=u_n(r);return new n}getImplementation(e,r,n="default"){let o=this.workspaceScoringProviders.get(r.uri);return o||(o=this.createImplementation(e,n),this.workspaceScoringProviders.set(r.uri,o)),o}score(e,r,n,o,s){return this.getImplementation(e,r,s).score(n,o)}terminateScoring(e,r,n){this.getImplementation(e,r,n).terminateScoring(),this.workspaceScoringProviders.delete(r.uri)}};var usd={modelFamily:ZHe.textEmbedding3Small,scoringType:"default",dimensions:null};p();p();p();var k7t=ce(WYe());var xQo=.75,wQo=1.2,cKe=class{constructor(e,r){this.ctx=e;this.workspaceFolder=r;this.chunksCount=0;this.sumTokenCount=0;this.status="notStarted"}static{a(this,"BM25Ranking")}get avgTokenCount(){return this.sumTokenCount/this.chunksCount}async initialize(e){this.sumTokenCount=0,this.chunksCount=0;for await(let r of e)this.sumTokenCount+=r.tokenCount,this.chunksCount++;this.status="completed"}async addChunks(e){for await(let r of e)this.sumTokenCount+=r.tokenCount,this.chunksCount++}async query(e){let r=await RIe();try{return await this.doQuery(e)}finally{await r.stopWorkerPool()}}async doQuery(e){let r=e.map(l=>l.toLowerCase()),n=await this.calculateIDFValues(r),o=Math.min(10*e.length,P7t),s=Math.min(o,this.chunksCount);return await this.calculateBM25Scores(r,this.avgTokenCount,n,s)}async calculateIDFValues(e){let r=this.ctx.get(Y0).getChunks(this.workspaceFolder),n=_Q(r,s=>({...s,chunk:s.chunk.toLowerCase()})),o=_Q(n,s=>s.chunk);return await RQo(e,o)}async calculateBM25Scores(e,r,n,o){let s=this.ctx.get(Y0).getChunks(this.workspaceFolder),c=new R7t(o);for await(let l of s){let u=await kQo({...l,chunk:l.chunk.toLowerCase()},e,r,n);c.add({...u,chunk:l.chunk})}return c.toArray(.75)}deleteEmbeddings(e){this.chunksCount-=e.length,this.sumTokenCount-=e.reduce((r,n)=>r+n.tokenCount,0)}terminateRanking(){}};async function RQo(t,e){let r=new SharedArrayBuffer(t.length*Int32Array.BYTES_PER_ELEMENT),n=new Int32Array(r),o=[],s=0;for await(let u of e){s++;let d=k7t.job(({snippet:f,keywords:h})=>h.map(g=>f.includes(g)?1:0),{data:{snippet:u,keywords:t}}).then(f=>{for(let h=0;h{let m=0;for(let g of s){let A=d[g],y=(c.match(new RegExp(g,"g"))||[]).length,E=A*(y*(f+1)),_=y+f*(1-h+h*l/u);m+=E/_}return m},{data:{document:t.chunk,docLength:t.tokenCount,keywords:e,avgTokenCount:r,idfValues:n,k1:wQo,b:xQo}}),...t}}a(kQo,"calculateBM25Score");var R7t=class{constructor(e,r=-1/0){this.maxSize=e;this.minScore=r;this.store=[]}static{a(this,"SimpleHeap")}toArray(e){if(this.store.length&&typeof e=="number"){let r=this.store.at(0).score*(1-e);return this.store.filter(n=>n.score>=r)}return this.store}add(e){if(e.score<=this.minScore)return;let r=this.store.findIndex(n=>n.score=0?r:this.store.length,0,e);this.store.length>this.maxSize;)this.store.pop();this.store.length===this.maxSize&&(this.minScore=this.store.at(-1)?.score??this.minScore)}};var DQo="bm25",NQo=new Map([["bm25",cKe]]);function d_n(t){let e=t==="default"?DQo:t,r=NQo.get(e);if(!r)throw new Error(`Ranking constructor for type ${t} not found`);return r}a(d_n,"getRankingAlgorithm");var D_=class{constructor(){this.workspaceRankingProviders=new nn(25)}static{a(this,"RankingProvider")}createImplementation(e,r,n){let o=d_n(n);return new o(e,r)}getImplementation(e,r,n="default"){let o=this.workspaceRankingProviders.get(r.uri);return o||(o=this.createImplementation(e,r,n),this.workspaceRankingProviders.set(r.uri,o)),o}status(e,r,n){return this.getImplementation(e,r,n).status}async initialize(e,r,n,o="default"){await this.getImplementation(e,r,o).initialize(n)}async addChunks(e,r,n,o="default"){await this.getImplementation(e,r,o).addChunks(n)}async query(e,r,n,o){return this.getImplementation(e,r,o).query(n)}async terminateRanking(e,r,n){await this.getImplementation(e,r,n).terminateRanking(),this.workspaceRankingProviders.delete(r.uri)}deleteEmbeddings(e,r,n,o){return this.getImplementation(e,r,o).deleteEmbeddings(n)}};p();async function D7t(t,e){let r=t.ctx,n=await Uo.getModelConfiguration(r,"synonyms",void 0,{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(dA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new rc(r),u=await Jc(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(Ye.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";_s(r,new wIe(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"LocalSnippetProvider.parseUserQuery")}}a(D7t,"parseUserQuery");var wIe=class extends Error{static{a(this,"LocalSnippetProviderError")}constructor(e){super(String(e),{cause:e}),this.name="LocalSnippetProviderError"}};p();p();p();p();var Wo=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new Wo(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new Wo(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var f_n=250;function fA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/f_n)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(fA,"getMaxChunks");var p_n=32e3,h_n=2e4,kIe=.75;p();p();function pA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(pA,"getFenceForCodeBlock");p();var JCn=ce(El()),ZCn=ce(qp());p();var Pv=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var $qo=Object.freeze({[Pv.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[Pv.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function W7t(t){return $qo[t.id]}a(W7t,"getWellKnownEmbeddingTypeInfo");function Vqo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:PIe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(I_n,"rankEmbeddings");p();p();var b3=ce(Xc()),KCn=ce(qp());var dO=new ge("GitHubCodeSearch"),L$o=300*1e3,ZKe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new b3.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},L$o)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Qt).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),dO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){dO.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(dO.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),dO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){dO.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,b3.raceTimeout)((async()=>{if(!await(0,b3.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,b3.raceCancellationError)((0,b3.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw dO.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await Td(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return dO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return dO.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=Rle(this._ctx),c=n.owner+"/"+n.name,l=await Td(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(dO.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=Rle(this._ctx),u=await Td(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:U$o(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return F$o(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Rle(t){let e=t.get(Lr);return{"X-Client-Application":`${C1(e.getEditorInfo())}`,"X-Client-Source":C1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Rle,"editorVersionHeaders");async function F$o(t,e,r){let o=[],s=new Pv(e.embedding_model),c=ca(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=xa(c,l.location.path)}catch(d){dO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:XKe(l.chunk.text),rawText:void 0,range:new KCn.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(F$o,"parseGithubCodeSearchResponse");function U$o(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a(U$o,"truncateToMaxUtf8Length");function XKe(t){let e=Q$o(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` -`):t}a(XKe,"stripChunkTextMetadata");function Q$o(t){return t.split(/\r\n|\r|\n/)}a(Q$o,"splitLines");var wP=ce(Xc()),XCn=ce(Ele()),evn=ce(Gh());var KIe=new ge("ChunkingEndpointClient"),Sqt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new XCn.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new wP.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,wP.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,wP.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,wP.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){KIe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{KIe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{KIe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},eJe=class{constructor(e){this.ctx=e;this._requestLimiter=new Sqt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,wP.raceCancellationError)(n.getText(),l);if((0,evn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Rle(this.ctx);return await Td(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:ho(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,wP.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){KIe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,JCn.coalesce)(h.chunks.map(m=>{let g=new ZCn.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:XKe(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let E=new Pv(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:XKe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){KIe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var Ky={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},J0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=jt.createAndMarkAsIssued(s,o);ht(e,r,c),gt(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};_s(e,n,r,o),gi(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,Ky.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,Ky.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,Ky.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,Ky.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,Ky.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,Ky.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,Ky.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=jt.createAndMarkAsIssued(o,{});ht(e,r,s),gt(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Ky.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,Ky.Aggregate,r)}};var tvn=ce(El()),rvn=ce(Xc()),Tqt=ce(cO());var S3=new ge("Remote Search"),tJe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(W0),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new Tqt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(S3.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(k=>`${k.owner}/${k.name}`),maxResults:fA(r)}),s.length===0)throw S3.error(this.ctx,"No GitHub repositories found"),J0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Qt).getGitHubSession();if(!c)throw S3.error(this.ctx,"No GitHub session found"),J0.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw S3.error(this.ctx,"Remote index not ready for any repositories"),J0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=fA(r),d=Promise.all(l.map(async k=>{Nh(n);let D=await e.resolveQuery(n),N=new Tqt.StopWatch,L=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,k,D,u,n);return S3.info(this.ctx,`Search completed for ${k.owner}/${k.name}`,{searchTime:N.elapsed(),chunkCount:L.chunks.length}),L})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);S3.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,rvn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{S3.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(k=>{S3.error(this.ctx,"Local diff search failed",k)})??Promise.resolve(void 0)]),E=(0,tvn.coalesce)(A).flatMap(k=>k.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(k=>!h.has(k.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(k=>k.chunk.file)).size,R=o.elapsed();S3.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return J0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var Z1n=require("node:url"),X1n=require("path");p();var AJe=ce(ivn(),1);p();var Iqt=new WeakMap;function Ple(...t){let e=new String(t);return Iqt.set(e,t),e}a(Ple,"c");function Ux(t){return t instanceof String&&Iqt.has(t)}a(Ux,"r");function Dle(t){return Iqt.get(t)??[]}a(Dle,"o");var mJe=ce(dvn(),1),qbn=require("child_process");var T1n=ce(kqt(),1),B1n=require("node:path");p();function*fvn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(fvn,"U");var pVo=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),hVo=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),mVo=new Set(["edit","remove-section","rename-section","set","unset"]),gVo=new Set(["get","get-color","get-colorbool","list"]);function AVo(t,e){for(let{name:n}of fvn(t,"task")){if(pVo.has(n))return Ble(!0,e);if(hVo.has(n))return Ble(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:mVo.has(r)?Ble(!0,e.slice(1)):gVo.has(r)?Ble(!1,e.slice(1)):e.length===1?Ble(!1,e):Ble(!0,e)}a(AVo,"F");function Ble(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Ble,"p");function yVo(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(yVo,"A");function EVo(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(EVo,"M");function _Vo(t){for(let{name:e}of fvn(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(_Vo,"N");function CVo({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(CVo,"G");function*vVo(t){for(let e of t){let r=CVo(e),n=r&&EVo(e.value);n&&(yield{...n,scope:r})}}a(vVo,"O");function bVo(t,e,r){let n={read:[],write:[...vVo(e)]};return t==="config"&&SVo(n,_Vo(e),AVo(e,r)),n}a(bVo,"L");function SVo(t,e,r){if(r===null)return;let n=yVo(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(SVo,"$");var pvn={short:new Map([["c",!0]])},TVo={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...pvn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},IVo={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},xVo={short:new Map,long:new Set};function wVo(t){let e=IVo[t??""]??xVo;return{short:new Map([...pvn.short.entries(),...e.short.entries()]),long:e.long}}a(wVo,"I");function hvn(t,e=TVo){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return RVo(t,e.short)}a(hvn,"b");function RVo(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(RVo,"W");function kVo(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[Xqt(t)[0]])(t=0)),e},"__init"),"__esm"),$Vo=a((t,e)=>a(function(){return e||(0,t[Xqt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),$h=a((t,e)=>{for(var r in e)Zqt(t,r,{get:e[r],enumerable:!0})},"__export"),VVo=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Xqt(e))!GVo.call(t,o)&&o!==r&&Zqt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=HVo(e,o))||n.enumerable});return t},"__copyProps"),Gp=a(t=>VVo(Zqt({},"__esModule",{value:!0}),t),"__toCommonJS"),T3,aq=Jr({"src/lib/errors/git-error.ts"(){"use strict";T3=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),txe,Qle=Jr({"src/lib/errors/git-response-error.ts"(){"use strict";aq(),txe=class extends T3{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),Kvn,Jvn=Jr({"src/lib/errors/task-configuration-error.ts"(){"use strict";aq(),Kvn=class extends T3{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function Zvn(t){return typeof t!="function"?bK:t}a(Zvn,"asFunction");function Xvn(t){return typeof t=="function"&&t!==bK}a(Xvn,"isUserFunction");function ebn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(ebn,"splitOn");function tbn(t,e=0){return rbn(t)&&t.length>e?t[e]:void 0}a(tbn,"first");function vK(t,e=0){if(rbn(t)&&t.length>e)return t[t.length-1-e]}a(vK,"last");function rbn(t){return CJe(t)}a(rbn,"isArrayLike");function rxe(t="",e=!0,r=` -`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(rxe,"toLinesWithContent");function ejt(t,e){return rxe(t,!0).map(r=>e(r))}a(ejt,"forEachLineWithContent");function tjt(t){return(0,AJe.exists)(t,AJe.FOLDER)}a(tjt,"folderExists");function jx(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(jx,"append");function nbn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(nbn,"including");function yJe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(yJe,"remove");function fO(t){return Array.isArray(t)?t:[t]}a(fO,"asArray");function ibn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(ibn,"asCamelCase");function qle(t){return fO(t).map(e=>e instanceof String?e:String(e))}a(qle,"asStringArray");function fu(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(fu,"asNumber");function XIe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(obn,"pick");function Lqt(t=0){return new Promise(e=>setTimeout(e,t))}a(Lqt,"delay");function Fqt(t){if(t!==!1)return t}a(Fqt,"orVoid");var Fle,bK,nxe,EJe=Jr({"src/lib/utils/util.ts"(){"use strict";rjt(),Fle="\0",bK=a(()=>{},"NOOP"),nxe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Jy(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(Jy,"filterType");function Uqt(t,e){let r=Ux(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(Uqt,"filterPrimitives");function _Je(t){return!!t&&nxe(t)==="[object Object]"}a(_Je,"filterPlainObject");function sbn(t){return typeof t=="function"}a(sbn,"filterFunction");var ixe,abn,Zf,pJe,CJe,rjt=Jr({"src/lib/utils/argument-filters.ts"(){"use strict";EJe(),ixe=a(t=>Array.isArray(t),"filterArray"),abn=a(t=>typeof t=="number","filterNumber"),Zf=a(t=>typeof t=="string"||Ux(t),"filterString"),pJe=a(t=>Zf(t)||Array.isArray(t)&&t.every(Zf),"filterStringOrStringArray"),CJe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),Qqt,WVo=Jr({"src/lib/utils/exit-codes.ts"(){"use strict";Qqt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(Qqt||{})}}),hJe,zVo=Jr({"src/lib/utils/git-output-streams.ts"(){"use strict";hJe=class cbn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new cbn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function YVo(){throw new Error("LineParser:useMatches not implemented")}a(YVo,"useMatchesDefault");var Po,sq,KVo=Jr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=YVo,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},sq=class extends Po{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function lbn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...ubn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(lbn,"createInstanceConfig");var ubn,JVo=Jr({"src/lib/utils/simple-git-options.ts"(){"use strict";ubn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function njt(t,e=[]){return _Je(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Ux(o))r.push(o);else if(Uqt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)Uqt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(njt,"appendTaskOptions");function O_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=rxe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(Fv,"parseStringResponse");var eWo=Jr({"src/lib/utils/task-parser.ts"(){"use strict";EJe()}}),dbn={};$h(dbn,{ExitCodes:a(()=>Qqt,"ExitCodes"),GitOutputStreams:a(()=>hJe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>bK,"NOOP"),NULL:a(()=>Fle,"NULL"),RemoteLineParser:a(()=>sq,"RemoteLineParser"),append:a(()=>jx,"append"),appendTaskOptions:a(()=>njt,"appendTaskOptions"),asArray:a(()=>fO,"asArray"),asCamelCase:a(()=>ibn,"asCamelCase"),asFunction:a(()=>Zvn,"asFunction"),asNumber:a(()=>fu,"asNumber"),asStringArray:a(()=>qle,"asStringArray"),bufferToString:a(()=>exe,"bufferToString"),callTaskParser:a(()=>qqt,"callTaskParser"),createInstanceConfig:a(()=>lbn,"createInstanceConfig"),delay:a(()=>Lqt,"delay"),filterArray:a(()=>ixe,"filterArray"),filterFunction:a(()=>sbn,"filterFunction"),filterHasLength:a(()=>CJe,"filterHasLength"),filterNumber:a(()=>abn,"filterNumber"),filterPlainObject:a(()=>_Je,"filterPlainObject"),filterPrimitives:a(()=>Uqt,"filterPrimitives"),filterString:a(()=>Zf,"filterString"),filterStringOrStringArray:a(()=>pJe,"filterStringOrStringArray"),filterType:a(()=>Jy,"filterType"),first:a(()=>tbn,"first"),folderExists:a(()=>tjt,"folderExists"),forEachLineWithContent:a(()=>ejt,"forEachLineWithContent"),getTrailingOptions:a(()=>O_,"getTrailingOptions"),including:a(()=>nbn,"including"),isUserFunction:a(()=>Xvn,"isUserFunction"),last:a(()=>vK,"last"),objectToString:a(()=>nxe,"objectToString"),orVoid:a(()=>Fqt,"orVoid"),parseStringResponse:a(()=>Fv,"parseStringResponse"),pick:a(()=>obn,"pick"),prefixedArray:a(()=>XIe,"prefixedArray"),remove:a(()=>yJe,"remove"),splitOn:a(()=>ebn,"splitOn"),toLinesWithContent:a(()=>rxe,"toLinesWithContent"),trailingFunctionArgument:a(()=>Nd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>ijt,"trailingOptionsArgument")});var oo=Jr({"src/lib/utils/index.ts"(){"use strict";rjt(),WVo(),zVo(),KVo(),JVo(),XVo(),eWo(),EJe()}}),fbn={};$h(fbn,{CheckRepoActions:a(()=>jqt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>hbn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>pbn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>tWo,"checkIsRepoTask")});function tWo(t){switch(t){case"bare":return hbn();case"root":return pbn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:vJe,parser:ojt}}a(tWo,"checkIsRepoTask");function pbn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:vJe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(pbn,"checkIsRepoRootTask");function hbn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:vJe,parser:ojt}}a(hbn,"checkIsBareRepoTask");function rWo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(rWo,"isNotRepoMessage");var jqt,vJe,ojt,mbn=Jr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),jqt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(jqt||{}),vJe=a(({exitCode:t},e,r,n)=>{if(t===128&&rWo(e))return r(Buffer.from("false"));n(e)},"onError"),ojt=a(t=>t.trim()==="true","parser")}});function nWo(t,e){let r=new gbn(t),n=t?ybn:Abn;return rxe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(Ebn.test(s)?r.folders:r.files).push(s)}),r}a(nWo,"cleanSummaryParser");var gbn,Abn,ybn,Ebn,iWo=Jr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),gbn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Abn=/^[a-z]+\s*/i,ybn=/^[a-z]+\s+[a-z]+\s*/i,Ebn=/\/$/}}),Hqt={};$h(Hqt,{EMPTY_COMMANDS:a(()=>bJe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>_bn,"adhocExecTask"),configurationErrorTask:a(()=>Lv,"configurationErrorTask"),isBufferTask:a(()=>vbn,"isBufferTask"),isEmptyTask:a(()=>bbn,"isEmptyTask"),straightThroughBufferTask:a(()=>Cbn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>B_,"straightThroughStringTask")});function _bn(t){return{commands:bJe,format:"empty",parser:t}}a(_bn,"adhocExecTask");function Lv(t){return{commands:bJe,format:"empty",parser(){throw typeof t=="string"?new Kvn(t):t}}}a(Lv,"configurationErrorTask");function B_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(B_,"straightThroughStringTask");function Cbn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Cbn,"straightThroughBufferTask");function vbn(t){return t.format==="buffer"}a(vbn,"isBufferTask");function bbn(t){return t.format==="empty"||!t.commands.length}a(bbn,"isEmptyTask");var bJe,$p=Jr({"src/lib/tasks/task.ts"(){"use strict";Jvn(),bJe=[]}}),Sbn={};$h(Sbn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>sjt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>ajt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>cjt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>lJe,"CleanOptions"),cleanTask:a(()=>Tbn,"cleanTask"),cleanWithOptionsTask:a(()=>oWo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>sWo,"isCleanOptionsArray")});function oWo(t,e){let{cleanMode:r,options:n,valid:o}=aWo(t);return r?o.options?(n.push(...e),n.some(uWo)?Lv(sjt):Tbn(r,n)):Lv(cjt+JSON.stringify(t)):Lv(ajt)}a(oWo,"cleanWithOptionsTask");function Tbn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return nWo(t==="n",n)}}}a(Tbn,"cleanTask");function sWo(t){return Array.isArray(t)&&t.every(e=>ljt.has(e))}a(sWo,"isCleanOptionsArray");function aWo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{cWo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&lWo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(aWo,"getCleanOptions");function cWo(t){return t==="f"||t==="n"}a(cWo,"isCleanMode");function lWo(t){return/^-[a-z]$/i.test(t)&&ljt.has(t.charAt(1))}a(lWo,"isKnownOption");function uWo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(uWo,"isInteractiveMode");var sjt,ajt,cjt,lJe,ljt,Ibn=Jr({"src/lib/tasks/clean.ts"(){"use strict";iWo(),oo(),$p(),sjt="Git clean interactive mode is not supported",ajt='Git clean mode parameter ("n" or "f") is required',cjt="Git clean unknown option found in: ",lJe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(lJe||{}),ljt=new Set(["i",...qle(Object.values(lJe))])}});function dWo(t){let e=new wbn;for(let r of xbn(t))e.addValue(r.file,String(r.key),r.value);return e}a(dWo,"configListParser");function fWo(t,e){let r=null,n=[],o=new Map;for(let s of xbn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(fWo,"configGetParser");function pWo(t){return t.replace(/^(file):/,"")}a(pWo,"configFilePath");function*xbn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=vK(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function Pqt(t,e){return typeof t=="string"&&Object.hasOwn(Gqt,t)?t:e}a(Pqt,"asConfigScope");function mWo(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(mWo,"addConfigTask");function gWo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return fWo(n,t)}}}a(gWo,"getConfigTask");function AWo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return dWo(r)}}}a(AWo,"listConfigTask");function yWo(){return{addConfig(t,e,...r){return this._runTask(mWo(t,e,r[0]===!0,Pqt(r[1],"local")),Nd(arguments))},getConfig(t,e){return this._runTask(gWo(t,Pqt(e,void 0)),Nd(arguments))},listConfig(...t){return this._runTask(AWo(Pqt(t[0],void 0)),Nd(arguments))}}}a(yWo,"config_default");var Gqt,Rbn=Jr({"src/lib/tasks/config.ts"(){"use strict";hWo(),oo(),Gqt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Gqt||{})}});function EWo(t){return kbn.has(t)}a(EWo,"isDiffNameStatus");var Dqt,kbn,Pbn=Jr({"src/lib/tasks/diff-name-status.ts"(){"use strict";Dqt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Dqt||{}),kbn=new Set(Object.values(Dqt))}});function _Wo(...t){return new Nbn().param(...t)}a(_Wo,"grepQueryBuilder");function CWo(t){let e=new Set,r={};return ejt(t,n=>{let[o,s,c]=n.split(Fle);e.add(o),(r[o]=r[o]||[]).push({line:fu(s),path:o,preview:c})}),{paths:e,results:r}}a(CWo,"parseGrep");function vWo(){return{grep(t){let e=Nd(arguments),r=O_(arguments);for(let o of Dbn)if(r.includes(o))return this._runTask(Lv(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=_Wo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return CWo(o)}},e)}}}a(vWo,"grep_default");var Dbn,ZIe,Evn,Nbn,Mbn=Jr({"src/lib/tasks/grep.ts"(){"use strict";oo(),$p(),Dbn=["-h"],ZIe=Symbol("grepQuery"),Nbn=class{static{a(this,"GrepQuery")}constructor(){this[Evn]=[]}*[(Evn=ZIe,Symbol.iterator)](){for(let t of this[ZIe])yield t}and(...t){return t.length&&this[ZIe].push("--and","(",...XIe(t,"-e"),")"),this}param(...t){return this[ZIe].push(...XIe(t,"-e")),this}}}}),Obn={};$h(Obn,{ResetMode:a(()=>uJe,"ResetMode"),getResetMode:a(()=>SWo,"getResetMode"),resetTask:a(()=>bWo,"resetTask")});function bWo(t,e){let r=["reset"];return Bbn(t)&&r.push(`--${t}`),r.push(...e),B_(r)}a(bWo,"resetTask");function SWo(t){if(Bbn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(SWo,"getResetMode");function Bbn(t){return typeof t=="string"&&Lbn.includes(t)}a(Bbn,"isValidResetMode");var uJe,Lbn,Fbn=Jr({"src/lib/tasks/reset.ts"(){"use strict";oo(),$p(),uJe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(uJe||{}),Lbn=qle(Object.values(uJe))}});function TWo(){return(0,mJe.default)("simple-git")}a(TWo,"createLog");function _vn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(_vn,"prefixedLogger");function IWo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(IWo,"childLoggerName");function ujt(t,e,r,n=TWo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=IWo(Jy(e,Zf),c,n);return d(r);function u(f,h){return jx(s,ujt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&_vn(c,h)||bK,g=_vn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(ujt,"createLogger");var Ubn=Jr({"src/lib/git-logger.ts"(){"use strict";oo(),mJe.default.formatters.L=t=>String(CJe(t)?t.length:"-"),mJe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):nxe(t)}}),Qbn,xWo=Jr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";aq(),Ubn(),Qbn=class $qt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=$qt.getName(e.commands[0]),n=ujt(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new T3(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++$qt.counter}`}static{this.counter=0}}}});function CK(t,e){return{method:tbn(t.commands)||"",commands:e}}a(CK,"pluginContext");function wWo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(wWo,"onErrorReceived");function Cvn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(Cvn,"onDataReceived");var Vqt,RWo=Jr({"src/lib/runners/git-executor-chain.ts"(){"use strict";aq(),$p(),oo(),xWo(),Vqt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Qbn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await(bbn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof T3?Object.assign(e,{task:t}):new T3(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",CK(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...CK(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),vbn(t)?qqt(t.parser,s):qqt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...CK(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",nxe(h)),u(new hJe(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new hJe(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},CK(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...CK(t,r),kill(m){f=m||f}});let h=(0,qbn.spawn)(e,r,c);h.stdout.on("data",Cvn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",Cvn(d,"stdErr",o,s.step("stdErr"))),h.on("error",wWo(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...CK(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...CK(t,e),kill(n){r=n||r}}),r}}}}),jbn={};$h(jbn,{GitExecutor:a(()=>Hbn,"GitExecutor")});var Hbn,kWo=Jr({"src/lib/runners/git-executor.ts"(){"use strict";RWo(),Hbn=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new Vqt(this,this._scheduler,this._plugins)}chain(){return new Vqt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function PWo(t,e,r=bK){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof txe?DWo(s):s,void 0)},"onError2");e.then(n,o)}a(PWo,"taskCallback");function DWo(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=bK},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(DWo,"addDeprecationNoticeToError");var NWo=Jr({"src/lib/task-callback.ts"(){"use strict";Qle(),oo()}});function vvn(t,e){return _bn(r=>{if(!tjt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(vvn,"changeWorkingDirectoryTask");var MWo=Jr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),$p()}});function Nqt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=yJe(e,"-B")),B_(e)}a(Nqt,"checkoutTask");function OWo(){return{checkout(){return this._runTask(Nqt(O_(arguments,1)),Nd(arguments))},checkoutBranch(t,e){return this._runTask(Nqt(["-b",t,e,...O_(arguments)]),Nd(arguments))},checkoutLocalBranch(t){return this._runTask(Nqt(["-b",t,...O_(arguments)]),Nd(arguments))}}}a(OWo,"checkout_default");var BWo=Jr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),$p()}});function LWo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(LWo,"countObjectsResponse");function FWo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Fv(LWo(),[Gbn],t)}})}}}a(FWo,"count_objects_default");var Gbn,UWo=Jr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),Gbn=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=ibn(e);Object.hasOwn(t,n)&&(t[n]=fu(r))})}});function QWo(t){return Fv({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},$bn,t)}a(QWo,"parseCommitResult");var $bn,qWo=Jr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),$bn=[new Po(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Po(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new Po(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new Po(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function jWo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...XIe(t,"-m"),...e,...r],format:"utf-8",parser:QWo}}a(jWo,"commitTask");function HWo(){return{commit(e,...r){let n=Nd(arguments),o=t(e)||jWo(fO(e),fO(Jy(r[0],pJe,[])),[...qle(Jy(r[1],ixe,[])),...O_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!pJe(e)&&Lv("git.commit: requires the commit message to be supplied as a string/string[]")}}a(HWo,"commit_default");var GWo=Jr({"src/lib/tasks/commit.ts"(){"use strict";qWo(),oo(),$p()}});function $Wo(){return{firstCommit(){return this._runTask(B_(["rev-list","--max-parents=0","HEAD"],!0),Nd(arguments))}}}a($Wo,"first_commit_default");var VWo=Jr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),$p()}});function WWo(t,e){let r=["hash-object",t];return e&&r.push("-w"),B_(r,!0)}a(WWo,"hashObjectTask");var zWo=Jr({"src/lib/tasks/hash-object.ts"(){"use strict";$p()}});function YWo(t,e,r){let n=String(r).trim(),o;if(o=Vbn.exec(n))return new dJe(t,e,!1,o[1]);if(o=Wbn.exec(n))return new dJe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new dJe(t,e,/^re/i.test(n),s)}a(YWo,"parseInit");var dJe,Vbn,Wbn,KWo=Jr({"src/lib/responses/InitSummary.ts"(){"use strict";dJe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},Vbn=/^Init.+ repository in (.+)$/,Wbn=/^Rein.+ in (.+)$/}});function JWo(t){return t.includes(djt)}a(JWo,"hasBareCommand");function ZWo(t=!1,e,r){let n=["init",...r];return t&&!JWo(n)&&n.splice(1,0,djt),{commands:n,format:"utf-8",parser(o){return YWo(n.includes("--bare"),e,o)}}}a(ZWo,"initTask");var djt,XWo=Jr({"src/lib/tasks/init.ts"(){"use strict";KWo(),djt="--bare"}});function fjt(t){for(let e=0;eFv(new zbn,e,r,!1)}a(Ybn,"getDiffParser");var Mqt,bvn,Svn,Tvn,Kbn,Jbn=Jr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";oxe(),tzo(),Pbn(),oo(),Mqt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:fu(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Po(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:fu(r),after:fu(n),binary:!0})}),new Po(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=fu(e),t.insertions=fu(n?.[1]),t.deletions=fu(o?.[1])})],bvn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=fu(e),s=fu(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Po(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],Svn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],Tvn=[new Po(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:Fqt(EWo(e)&&e),from:Fqt(!!s&&n!==s&&n),similarity:fu(r)})})],Kbn={"":Mqt,"--stat":Mqt,"--numstat":bvn,"--name-status":Tvn,"--name-only":Svn}}});function rzo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(rzo,"lineBuilder");function Zbn(t=gjt,e=Xbn,r=""){let n=Ybn(r);return function(o){let s=rxe(o.trim(),!1,hjt).map(function(c){let l=c.split(mjt),u=rzo(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(Zbn,"createListLogSummaryParser");var hjt,mjt,gjt,Xbn,e1n=Jr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),Jbn(),oxe(),hjt="\xF2\xF2\xF2\xF2\xF2\xF2 ",mjt=" \xF2\xF2",gjt=" \xF2 ",Xbn=["hash","date","message","refs","author_name","author_email"]}}),t1n={};$h(t1n,{diffSummaryTask:a(()=>nzo,"diffSummaryTask"),validateLogFormatConfig:a(()=>SJe,"validateLogFormatConfig")});function nzo(t){let e=fjt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),SJe(r)||{commands:r,format:"utf-8",parser:Ybn(e)}}a(nzo,"diffSummaryTask");function SJe(t){let e=t.filter(ezo);if(e.length>1)return Lv(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Lv(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(SJe,"validateLogFormatConfig");var Ajt=Jr({"src/lib/tasks/diff.ts"(){"use strict";oxe(),Jbn(),$p()}});function izo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(izo,"prettyFormat");function ozo(t){return Object.keys(t).reduce((e,r)=>(r in Wqt||(e[r]=t[r]),e),{})}a(ozo,"userOptions");function r1n(t={},e=[]){let r=Jy(t.splitter,Zf,gjt),n=_Je(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=izo(n,r),c=[],l=[`--pretty=format:${hjt}${s}${mjt}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return Zf(t.file)&&l.push("--follow",Ple(t.file)),njt(ozo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(r1n,"parseLogOptions");function szo(t,e,r){let n=Zbn(t,e,fjt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(szo,"logTask");function azo(){return{log(...r){let n=Nd(arguments),o=r1n(ijt(arguments),qle(Jy(arguments[0],ixe,[]))),s=e(...r)||SJe(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return szo(r.splitter,r.fields,r.commands)}function e(r,n){return Zf(r)&&Zf(n)&&Lv("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(azo,"log_default");var Wqt,n1n=Jr({"src/lib/tasks/log.ts"(){"use strict";oxe(),e1n(),oo(),$p(),Ajt(),Wqt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(Wqt||{})}}),fJe,i1n,czo=Jr({"src/lib/responses/MergeSummary.ts"(){"use strict";fJe=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},i1n=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),zqt,o1n,lzo=Jr({"src/lib/responses/PullSummary.ts"(){"use strict";zqt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},o1n=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Oqt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(Oqt,"objectEnumerationResult");function Ivn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:fu(e&&e[1]||"0"),delta:fu(r&&r[1]||"0")}}a(Ivn,"asObjectCount");var s1n,uzo=Jr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),s1n=[new sq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Oqt(t.remoteMessages);Object.assign(o,{[n]:fu(r)})}),new sq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Oqt(t.remoteMessages);Object.assign(o,{[n]:fu(r)})}),new sq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=Oqt(t.remoteMessages);o.total=Ivn(e),o.reused=Ivn(r),o.packReused=fu(n)})]}});function a1n(t,e){return Fv({remoteMessages:new l1n},c1n,e)}a(a1n,"parseRemoteMessages");var c1n,l1n,u1n=Jr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),uzo(),c1n=[new sq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...s1n,new sq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new sq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:fu(e),summary:r,url:n}})],l1n=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function dzo(t,e){let r=Fv(new o1n,d1n,[t,e]);return r.message&&r}a(dzo,"parsePullErrorResult");var xvn,wvn,Rvn,kvn,d1n,Pvn,yjt,f1n=Jr({"src/lib/parsers/parse-pull.ts"(){"use strict";lzo(),oo(),u1n(),xvn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,wvn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Rvn=/^(create|delete) mode \d+ (.+)/,kvn=[new Po(xvn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(wvn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new Po(Rvn,(t,[e,r])=>{jx(t.files,r),jx(e==="create"?t.created:t.deleted,r)})],d1n=[new Po(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Po(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Po(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],Pvn=a((t,e)=>Fv(new zqt,kvn,[t,e]),"parsePullDetail"),yjt=a((t,e)=>Object.assign(new zqt,Pvn(t,e),a1n(t,e)),"parsePullResult")}}),Dvn,p1n,Nvn,fzo=Jr({"src/lib/parsers/parse-merge.ts"(){"use strict";czo(),oo(),f1n(),Dvn=[new Po(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Po(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new fJe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new fJe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new fJe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],p1n=a((t,e)=>Object.assign(Nvn(t,e),yjt(t,e)),"parseMergeResult"),Nvn=a(t=>Fv(new i1n,Dvn,t),"parseMergeDetail")}});function Mvn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=p1n(e,r);if(n.failed)throw new txe(n);return n}}:Lv("Git.merge requires at least one option")}a(Mvn,"mergeTask");var pzo=Jr({"src/lib/tasks/merge.ts"(){"use strict";Qle(),fzo(),$p()}});function hzo(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(hzo,"pushResultPushedItem");var Ovn,h1n,Bvn,mzo=Jr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),u1n(),Ovn=[new Po(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Po(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Po(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(hzo(e,r,n))}),new Po(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Po(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],h1n=a((t,e)=>{let r=Bvn(t,e),n=a1n(t,e);return{...r,...n}},"parsePushResult"),Bvn=a((t,e)=>Fv({pushed:[]},Ovn,[t,e]),"parsePushDetail")}}),m1n={};$h(m1n,{pushTagsTask:a(()=>gzo,"pushTagsTask"),pushTask:a(()=>Ejt,"pushTask")});function gzo(t={},e){return jx(e,"--tags"),Ejt(t,e)}a(gzo,"pushTagsTask");function Ejt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),yJe(r,"-v"),jx(r,"--verbose"),jx(r,"--porcelain"),{commands:r,format:"utf-8",parser:h1n}}a(Ejt,"pushTask");var g1n=Jr({"src/lib/tasks/push.ts"(){"use strict";mzo(),oo()}});function Azo(){return{showBuffer(){let t=["show",...O_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Cbn(t),Nd(arguments))},show(){let t=["show",...O_(arguments,1)];return this._runTask(B_(t),Nd(arguments))}}}a(Azo,"show_default");var yzo=Jr({"src/lib/tasks/show.ts"(){"use strict";oo(),$p()}}),Lvn,A1n,Ezo=Jr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Lvn=/^(.+)\0(.+)$/,A1n=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=Lvn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function Fvn(t){let[e,r]=t.split(Fle);return{from:r||e,to:e}}a(Fvn,"renamedFile");function US(t,e,r){return[`${t}${e}`,r]}a(US,"parser3");function Bqt(t,...e){return e.map(r=>US(t,r,(n,o)=>n.conflicted.push(o)))}a(Bqt,"conflicts");function _zo(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=y1n.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new A1n(c,o,s))}a(n,"data")}a(_zo,"splitLine");var Uvn,y1n,E1n,Czo=Jr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),Ezo(),Uvn=class{static{a(this,"StatusSummary")}constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},y1n=new Map([US(" ","A",(t,e)=>t.created.push(e)),US(" ","D",(t,e)=>t.deleted.push(e)),US(" ","M",(t,e)=>t.modified.push(e)),US("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),US("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),US("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),US("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),US("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),US("R"," ",(t,e)=>{t.renamed.push(Fvn(e))}),US("R","M",(t,e)=>{let r=Fvn(e);t.renamed.push(r),t.modified.push(r.to)}),US("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),US("?","?",(t,e)=>t.not_added.push(e)),...Bqt("A","A","U"),...Bqt("D","D","U"),...Bqt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=Jy(l?.[1],Zf,null),l=s.exec(e),t.tracking=Jy(l?.[1],Zf,null),l=c.exec(e),l&&(t.current=Jy(l?.[1],Zf,t.current)),t.detached=/\(no branch\)/.test(e)}]]),E1n=a(function(t){let e=t.split(Fle),r=new Uvn;for(let n=0,o=e.length;n!_1n.includes(r))],parser(r){return E1n(r)}}}a(vzo,"statusTask");var _1n,bzo=Jr({"src/lib/tasks/status.ts"(){"use strict";Czo(),_1n=["--null","-z"]}});function gJe(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(gJe,"versionResponse");function Szo(){return gJe(0,0,0,"",!1)}a(Szo,"notInstalledResponse");function Tzo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:Izo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(_jt));n(e)}})}}}a(Tzo,"version_default");function Izo(t){return t===_jt?Szo():Fv(gJe(0,0,0,t),C1n,t)}a(Izo,"versionParser");var _jt,C1n,xzo=Jr({"src/lib/tasks/version.ts"(){"use strict";oo(),_jt="installed=false",C1n=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,gJe(fu(e),fu(r),fu(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,gJe(fu(e),fu(r),n,o))})]}});function Qvn(t,e,r,...n){return Zf(r)?e(r,Jy(n[0],Zf),O_(arguments)):Lv(`git.${t}() requires a string 'repoPath'`)}a(Qvn,"createCloneTask");function wzo(){return{clone(t,...e){return this._runTask(Qvn("clone",Yqt,Jy(t,Zf),...e),Nd(arguments))},mirror(t,...e){return this._runTask(Qvn("mirror",v1n,Jy(t,Zf),...e),Nd(arguments))}}}a(wzo,"clone_default");var Yqt,v1n,Rzo=Jr({"src/lib/tasks/clone.ts"(){"use strict";$p(),oo(),Yqt=a((t,e,r)=>{let n=["clone",...r];return Zf(t)&&n.push(Ple(t)),Zf(e)&&n.push(Ple(e)),B_(n)},"cloneTask"),v1n=a((t,e,r)=>(jx(r,"--mirror"),Yqt(t,e,r)),"cloneMirrorTask")}}),b1n={};$h(b1n,{SimpleGitApi:a(()=>Kqt,"SimpleGitApi")});var Kqt,kzo=Jr({"src/lib/simple-git-api.ts"(){"use strict";NWo(),MWo(),BWo(),UWo(),GWo(),Rbn(),VWo(),Mbn(),zWo(),XWo(),n1n(),pzo(),g1n(),yzo(),bzo(),$p(),xzo(),oo(),Rzo(),Kqt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&PWo(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(B_(["add",...fO(t)]),Nd(arguments))}cwd(t){let e=Nd(arguments);return typeof t=="string"?this._runTask(vvn(t,this._executor),e):typeof t?.path=="string"?this._runTask(vvn(t.path,t.root&&this._executor||void 0),e):this._runTask(Lv("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(WWo(t,e===!0),Nd(arguments))}init(t){return this._runTask(ZWo(t===!0,this._executor.cwd,O_(arguments)),Nd(arguments))}merge(){return this._runTask(Mvn(O_(arguments)),Nd(arguments))}mergeFromTo(t,e){return Zf(t)&&Zf(e)?this._runTask(Mvn([t,e,...O_(arguments)]),Nd(arguments,!1)):this._runTask(Lv("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Ejt({remote:Jy(arguments[0],Zf),branch:Jy(arguments[1],Zf)},O_(arguments));return this._runTask(t,Nd(arguments))}stash(){return this._runTask(B_(["stash",...O_(arguments)]),Nd(arguments))}status(){return this._runTask(vzo(O_(arguments)),Nd(arguments))}},Object.assign(Kqt.prototype,OWo(),wzo(),HWo(),yWo(),FWo(),$Wo(),vWo(),azo(),Azo(),Tzo())}}),S1n={};$h(S1n,{Scheduler:a(()=>I1n,"Scheduler")});var qvn,I1n,Pzo=Jr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),Ubn(),qvn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,T1n.createDeferred)();return{promise:e,done:r,id:t}}})(),I1n=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=ujt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=jx(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),yJe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=jx(this.pending,qvn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),x1n={};$h(x1n,{applyPatchTask:a(()=>Dzo,"applyPatchTask")});function Dzo(t,e){return B_(["apply",...e,...t])}a(Dzo,"applyPatchTask");var Nzo=Jr({"src/lib/tasks/apply-patch.ts"(){"use strict";$p()}});function Mzo(t,e){return{branch:t,hash:e,success:!0}}a(Mzo,"branchDeletionSuccess");function Ozo(t){return{branch:t,hash:null,success:!1}}a(Ozo,"branchDeletionFailure");var w1n,Bzo=Jr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";w1n=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function R1n(t,e){return e===1&&Jqt.test(t)}a(R1n,"hasBranchDeletionError");var jvn,Jqt,Hvn,TJe,Lzo=Jr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";Bzo(),oo(),jvn=/(\S+)\s+\(\S+\s([^)]+)\)/,Jqt=/^error[^']+'([^']+)'/m,Hvn=[new Po(jvn,(t,[e,r])=>{let n=Mzo(e,r);t.all.push(n),t.branches[e]=n}),new Po(Jqt,(t,[e])=>{let r=Ozo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],TJe=a((t,e)=>Fv(new w1n,Hvn,[t,e]),"parseBranchDeletions")}}),k1n,Fzo=Jr({"src/lib/responses/BranchSummary.ts"(){"use strict";k1n=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function Gvn(t){return t?t.charAt(0):""}a(Gvn,"branchStatus");function P1n(t,e=!1){return Fv(new k1n,e?[N1n]:D1n,t)}a(P1n,"parseBranchSummary");var D1n,N1n,Uzo=Jr({"src/lib/parsers/parse-branch.ts"(){"use strict";Fzo(),oo(),D1n=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(Gvn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(Gvn(e),!1,r,n,o)})],N1n=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),M1n={};$h(M1n,{branchLocalTask:a(()=>qzo,"branchLocalTask"),branchTask:a(()=>Qzo,"branchTask"),containsDeleteBranchCommand:a(()=>O1n,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>Hzo,"deleteBranchTask"),deleteBranchesTask:a(()=>jzo,"deleteBranchesTask")});function O1n(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(O1n,"containsDeleteBranchCommand");function Qzo(t){let e=O1n(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?TJe(o,s).all[0]:P1n(o,r)}}}a(Qzo,"branchTask");function qzo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return P1n(t)}}}a(qzo,"branchLocalTask");function jzo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return TJe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!R1n(String(o),r))return c(o);s(n)}}}a(jzo,"deleteBranchesTask");function Hzo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return TJe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!R1n(String(c),n))return u(c);throw new txe(r.parser(exe(s),exe(o)),String(c))}};return r}a(Hzo,"deleteBranchTask");var Gzo=Jr({"src/lib/tasks/branch.ts"(){"use strict";Qle(),Lzo(),Uzo(),oo()}});function $zo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,B1n.normalize)(e)}a($zo,"toPath");var L1n,Vzo=Jr({"src/lib/responses/CheckIgnore.ts"(){"use strict";L1n=a(t=>t.split(/\n/g).map($zo).filter(Boolean),"parseCheckIgnore")}}),F1n={};$h(F1n,{checkIgnoreTask:a(()=>Wzo,"checkIgnoreTask")});function Wzo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:L1n}}a(Wzo,"checkIgnoreTask");var zzo=Jr({"src/lib/tasks/check-ignore.ts"(){"use strict";Vzo()}});function Yzo(t,e){return Fv({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},U1n,[t,e])}a(Yzo,"parseFetchResult");var U1n,Kzo=Jr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),U1n=[new Po(/From (.+)$/,(t,[e])=>{t.remote=e}),new Po(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Po(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Po(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Po(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),Q1n={};$h(Q1n,{fetchTask:a(()=>Zzo,"fetchTask")});function Jzo(t){return/^--upload-pack(=|$)/.test(t)}a(Jzo,"disallowedCommand");function Zzo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(Jzo)?Lv("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:Yzo}}a(Zzo,"fetchTask");var Xzo=Jr({"src/lib/tasks/fetch.ts"(){"use strict";Kzo(),$p()}});function eYo(t){return Fv({moves:[]},q1n,t)}a(eYo,"parseMoveResult");var q1n,tYo=Jr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),q1n=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),j1n={};$h(j1n,{moveTask:a(()=>rYo,"moveTask")});function rYo(t,e){return{commands:["mv","-v",...fO(t),e],format:"utf-8",parser:eYo}}a(rYo,"moveTask");var nYo=Jr({"src/lib/tasks/move.ts"(){"use strict";tYo(),oo()}}),H1n={};$h(H1n,{pullTask:a(()=>iYo,"pullTask")});function iYo(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return yjt(o,s)},onError(o,s,c,l){let u=dzo(exe(o.stdOut),exe(o.stdErr));if(u)return l(new txe(u));l(s)}}}a(iYo,"pullTask");var oYo=Jr({"src/lib/tasks/pull.ts"(){"use strict";Qle(),f1n(),oo()}});function sYo(t){let e={};return G1n(t,([r])=>e[r]={name:r}),Object.values(e)}a(sYo,"parseGetRemotes");function aYo(t){let e={};return G1n(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(aYo,"parseGetRemotesVerbose");function G1n(t,e){ejt(t,r=>e(r.split(/\s+/)))}a(G1n,"forEach");var cYo=Jr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),$1n={};$h($1n,{addRemoteTask:a(()=>lYo,"addRemoteTask"),getRemotesTask:a(()=>uYo,"getRemotesTask"),listRemotesTask:a(()=>dYo,"listRemotesTask"),remoteTask:a(()=>fYo,"remoteTask"),removeRemoteTask:a(()=>pYo,"removeRemoteTask")});function lYo(t,e,r){return B_(["remote","add",...r,t,e])}a(lYo,"addRemoteTask");function uYo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?aYo:sYo}}a(uYo,"getRemotesTask");function dYo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),B_(e)}a(dYo,"listRemotesTask");function fYo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),B_(e)}a(fYo,"remoteTask");function pYo(t){return B_(["remote","remove",t])}a(pYo,"removeRemoteTask");var hYo=Jr({"src/lib/tasks/remote.ts"(){"use strict";cYo(),$p()}}),V1n={};$h(V1n,{stashListTask:a(()=>mYo,"stashListTask")});function mYo(t={},e){let r=r1n(t),n=["stash","list",...r.commands,...e],o=Zbn(r.splitter,r.fields,fjt(n));return SJe(n)||{commands:n,format:"utf-8",parser:o}}a(mYo,"stashListTask");var gYo=Jr({"src/lib/tasks/stash-list.ts"(){"use strict";oxe(),e1n(),Ajt(),n1n()}}),W1n={};$h(W1n,{addSubModuleTask:a(()=>AYo,"addSubModuleTask"),initSubModuleTask:a(()=>yYo,"initSubModuleTask"),subModuleTask:a(()=>IJe,"subModuleTask"),updateSubModuleTask:a(()=>EYo,"updateSubModuleTask")});function AYo(t,e){return IJe(["add",t,e])}a(AYo,"addSubModuleTask");function yYo(t){return IJe(["init",...t])}a(yYo,"initSubModuleTask");function IJe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),B_(e)}a(IJe,"subModuleTask");function EYo(t){return IJe(["update",...t])}a(EYo,"updateSubModuleTask");var _Yo=Jr({"src/lib/tasks/sub-module.ts"(){"use strict";$p()}});function CYo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?z1n(t,e):0}a(CYo,"singleSorted");function z1n(t,e){return t===e?0:t>e?1:-1}a(z1n,"sorted");function vYo(t){return t.trim()}a(vYo,"trimmed");function cJe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(cJe,"toNumber");var $vn,Y1n,bYo=Jr({"src/lib/responses/TagList.ts"(){"use strict";$vn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},Y1n=a(function(t,e=!1){let r=t.split(` -`).map(vYo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return CYo(cJe(c[0]),cJe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new $vn(r,n)},"parseTagList")}}),K1n={};$h(K1n,{addAnnotatedTagTask:a(()=>IYo,"addAnnotatedTagTask"),addTagTask:a(()=>TYo,"addTagTask"),tagListTask:a(()=>SYo,"tagListTask")});function SYo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return Y1n(r,e)}}}a(SYo,"tagListTask");function TYo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(TYo,"addTagTask");function IYo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(IYo,"addAnnotatedTagTask");var xYo=Jr({"src/lib/tasks/tag.ts"(){"use strict";bYo()}}),wYo=$Vo({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(kWo(),Gp(jbn)),{SimpleGitApi:n}=(kzo(),Gp(b1n)),{Scheduler:o}=(Pzo(),Gp(S1n)),{adhocExecTask:s,configurationErrorTask:c}=($p(),Gp(Hqt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),Gp(dbn)),{applyPatchTask:E}=(Nzo(),Gp(x1n)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(Gzo(),Gp(M1n)),{checkIgnoreTask:w}=(zzo(),Gp(F1n)),{checkIsRepoTask:R}=(mbn(),Gp(fbn)),{cleanWithOptionsTask:x,isCleanOptionsArray:k}=(Ibn(),Gp(Sbn)),{diffSummaryTask:D}=(Ajt(),Gp(t1n)),{fetchTask:N}=(Xzo(),Gp(Q1n)),{moveTask:L}=(nYo(),Gp(j1n)),{pullTask:B}=(oYo(),Gp(H1n)),{pushTagsTask:Q}=(g1n(),Gp(m1n)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:q,remoteTask:F,removeRemoteTask:U}=(hYo(),Gp($1n)),{getResetMode:W,resetTask:V}=(Fbn(),Gp(Obn)),{stashListTask:G}=(gYo(),Gp(V1n)),{addSubModuleTask:Y,initSubModuleTask:re,subModuleTask:j,updateSubModuleTask:X}=(_Yo(),Gp(W1n)),{addAnnotatedTagTask:ie,addTagTask:we,tagListTask:Ae}=(xYo(),Gp(K1n)),{straightThroughBufferTask:De,straightThroughStringTask:Te}=($p(),Gp(Hqt));function Z(J,z){this._plugins=z,this._executor=new r(J.baseDir,new o(J.maxConcurrentProcesses),z),this._trimmed=J.trimmed}a(Z,"Git2"),(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(J){return this._plugins.reconfigure("binary",J),this},Z.prototype.env=function(J,z){return arguments.length===1&&typeof J=="object"?this._executor.env=J:(this._executor.env=this._executor.env||{})[J]=z,this},Z.prototype.stashList=function(J){return this._runTask(G(y(arguments)||{},u(J)&&J||[]),A(arguments))},Z.prototype.mv=function(J,z){return this._runTask(L(J,z),A(arguments))},Z.prototype.checkoutLatestTag=function(J){var z=this;return this.pull(function(){z.tags(function(le,K){z.checkout(K.latest,J)})})},Z.prototype.pull=function(J,z,le,K){return this._runTask(B(m(J,f),m(z,f),g(arguments)),A(arguments))},Z.prototype.fetch=function(J,z){return this._runTask(N(m(J,f),m(z,f),g(arguments)),A(arguments))},Z.prototype.silent=function(J){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Z.prototype.tags=function(J,z){return this._runTask(Ae(g(arguments)),A(arguments))},Z.prototype.rebase=function(){return this._runTask(Te(["rebase",...g(arguments)]),A(arguments))},Z.prototype.reset=function(J){return this._runTask(V(W(J),g(arguments)),A(arguments))},Z.prototype.revert=function(J){let z=A(arguments);return typeof J!="string"?this._runTask(c("Commit must be a string"),z):this._runTask(Te(["revert",...g(arguments,0,!0),J]),z)},Z.prototype.addTag=function(J){let z=typeof J=="string"?we(J):c("Git.addTag requires a tag name");return this._runTask(z,A(arguments))},Z.prototype.addAnnotatedTag=function(J,z){return this._runTask(ie(J,z),A(arguments))},Z.prototype.deleteLocalBranch=function(J,z,le){return this._runTask(T(J,typeof z=="boolean"?z:!1),A(arguments))},Z.prototype.deleteLocalBranches=function(J,z,le){return this._runTask(b(J,typeof z=="boolean"?z:!1),A(arguments))},Z.prototype.branch=function(J,z){return this._runTask(_(g(arguments)),A(arguments))},Z.prototype.branchLocal=function(J){return this._runTask(v(),A(arguments))},Z.prototype.raw=function(J){let z=!Array.isArray(J),le=[].slice.call(z?arguments:J,0);for(let ae=0;aeconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},Z.prototype.checkIgnore=function(J,z){return this._runTask(w(l(m(J,h,[]))),A(arguments))},Z.prototype.checkIsRepo=function(J,z){return this._runTask(R(m(J,f)),A(arguments))},e.exports=Z}});aq();var RYo=class extends T3{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};aq();aq();var Ule=class extends T3{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Qle();Jvn();mbn();Ibn();Rbn();Pbn();Mbn();Fbn();function kYo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Ule(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Ule(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(kYo,"abortPlugin");function PYo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of yvn(e,r))if(t[n.category]!==!0)throw new Ule(void 0,"unsafe",n.message);return e}}}a(PYo,"blockUnsafeOperationsPlugin");oo();function DYo(t){let e=XIe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(DYo,"commandConfigPrefixingPlugin");oo();var Vvn=(0,Lle.deferred)().promise;function NYo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Lle.deferred)(),closeTimeout:(0,Lle.deferred)(),exit:(0,Lle.deferred)(),exitTimeout:(0,Lle.deferred)()},c=Promise.race([t===!1?Vvn:s.closeTimeout.promise,e===!1?Vvn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>Lqt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await Lqt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(NYo,"completionDetectionPlugin");oo();var MYo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Wvn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function OYo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(OYo,"isBadArgument");function zvn(t,e){if(t.length<1||t.length>2)throw new Ule(void 0,"binary",MYo);if(t.some(OYo))if(e)console.warn(Wvn);else throw new Ule(void 0,"binary",Wvn);let[n,o]=t;return{binary:n,prefix:o}}a(zvn,"toBinaryConfig");function BYo(t,e=["git"],r=!1){let n=zvn(fO(e),r);t.on("binary",o=>{n=zvn(fO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(BYo,"customBinaryPlugin");aq();function LYo(t){return!!(t.exitCode&&t.stdErr.length)}a(LYo,"isTaskError");function FYo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(FYo,"getErrorMessage");function UYo(t=!1,e=LYo,r=FYo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(UYo,"errorDetectionHandler");function Yvn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new T3(void 0,n.toString("utf-8"))}:{error:n}}}}a(Yvn,"errorDetectionPlugin");oo();var QYo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new J1n.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=jx(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return fO(t).forEach(r=>r&&this.plugins.add(jx(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};oo();function qYo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?nbn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:jYo(u[1]),progress:fu(u[2]),processed:fu(u[3]),total:fu(u[4])})})}}]}a(qYo,"progressMonitorPlugin");function jYo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(jYo,"progressEventStage");oo();function HYo(t){let e=obn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(HYo,"spawnOptionsPlugin");function GYo({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new Ule(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(GYo,"timeoutPlugin");function $Yo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oUx(c)&&Dle(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a($Yo,"suffixPathsPlugin");oo();var VYo=wYo();function WYo(t,e){let r=new QYo,n=lbn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!tjt(n.baseDir))throw new RYo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(DYo(n.config)),r.add(PYo(n.unsafe)),r.add(NYo(n.completion)),n.abort&&r.add(kYo(n.abort)),n.progress&&r.add(qYo(n.progress)),n.timeout&&r.add(GYo(n.timeout)),n.spawnOptions&&r.add(HYo(n.spawnOptions)),r.add($Yo()),r.add(Yvn(UYo(!0))),n.errors&&r.add(Yvn(n.errors)),BYo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new VYo(n,r)}a(WYo,"gitInstanceFactory");Qle();var xJe=WYo;var Hx=new ge("Git Service");var wJe=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await rQ()).path;n=xJe({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,X1n.join)(n,r);return Ia(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){Hx.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){Hx.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){Hx.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){Hx.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){Hx.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return Hx.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};Hx.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){Hx.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){Hx.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,Z1n.fileURLToPath)(e)}catch(r){Hx.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return Hx.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var eSn=ce(Xc());var RP=new ge("Local Diff Tracker");var RJe=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._gitService=new wJe(e),this._repositoryManager=e.get(W0),this._diffRefreshTimer=new eSn.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{RP.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):RP.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){RP.error(this.ctx,"Initialization failed",e)}}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){RP.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&RP.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?RP.warn(this.ctx,n,o):RP.warn(this.ctx,n):o!==void 0?RP.debug(this.ctx,n,o):RP.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var cq;(n=>{function t(o){return new Cjt(o)}n.ok=t,a(t,"ok");function e(o){return new vjt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(cq||={});var Cjt=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},vjt=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var bjt=new ge("GithubAvailableEmbeddingTypes"),kJe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Qt).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):cq.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Qt).getGitHubSession();return e?await this.doGetAvailableTypes(e):cq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Rle(this._ctx);r=await Td(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return bjt.error(this._ctx,"Error fetching available embedding types",c),cq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?cq.error({type:"unauthorized",status:r.status}):cq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new Pv(c.id);c.active===!1?s.push(l):o.push(l)}return cq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){bjt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return bjt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var zYo=new ge("GithubEmbeddingComputer"),jle=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Qt).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){zYo.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await Td(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new Pv(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var sxe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var tSn=ce(hA()),rSn=ce(IB()),nSn=ce(require("path"));function PJe(t){let e=Wn(t.workspaceFolder.uri),r=(0,tSn.basename)(e),o=(0,rSn.SHA256)(e).toString().substring(0,8);return nSn.default.join(C7t(),"project-index",`${r}.${o}`)}a(PJe,"getWorkspaceCachePath");p();p();function iSn(t){if(W7t(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(Sjt,"unpackEmbedding");var oSn=ce(Xc()),sSn=ce(bP()),Ijt=ce(qp()),aSn=ce(require("fs")),xjt=ce(require("node:sqlite")),wjt=ce(require("path"));var Tjt=new ge("WorkspaceChunkAndEmbeddingCache");async function cSn(t,e,r,n){return await Rjt.create(t,e,r??":memory:",n)}a(cSn,"createWorkspaceChunkAndEmbeddingCache");var Rjt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new sSn.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let d=wjt.default.join(n,"workspace-chunks.db");try{await aSn.default.promises.mkdir(wjt.default.dirname(d),{recursive:!0}),c=new xjt.default.DatabaseSync(d,s),Tjt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){Tjt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new xjt.default.DatabaseSync(":memory:",s),Tjt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` +`)}a(xqt,"applyEditsToDocument");var Sle=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Oops, an error has occurred. Please try again";this.uiKind="conversationPanel";this.computeSuggestions=!0}static{a(this,"PanelTurnProcessorStrategy")}processResponse(){return[]}async buildConversationPrompt(e,r,n,o){let s="user",c=await Ro.getModelConfiguration(e.ctx,s),l={promptType:s,modelConfiguration:c,languageId:r,userSelectedModelName:o};return await this.ctx.get(gA).toPrompt(e,l)}extractEditsFromResponse(e,r){return[]}},BKe=class{constructor(e){this.ctx=e;this.earlyReturnResponse="Please open a file and select code for the inline chat to be available";this.uiKind="conversationInline";this.computeSuggestions=!1}static{a(this,"InlineTurnProcessorStrategy")}async buildConversationPrompt(e,r,n){let o=await this.getCurrentEditorSkill(e);if(!o)return;let s=await this.getDocumentIfValid(o.uri);if(!s)return;let c=n?.producesCodeEdits===!1?"user":"inline",l=await jQ(e.ctx),u=await e.ctx.get(Yc).getBestChatModelConfig(aS(c,l)),d={promptType:c,modelConfiguration:u,languageId:r};return d.promptType==="inline"&&(this.currentDocument=s),await this.ctx.get(gA).toPrompt(e,d)}async processResponse(e){let r=[],n=Rn(e.response?.message??"");if(n&&e.status==="success"&&this.currentDocument){let o=await this.processInlineResponse(n,this.currentDocument);o&&r.push(o)}return r}async getCurrentEditorSkill(e){let r=await e.skillResolver.resolve(zy);if(r)return r}async getDocumentIfValid(e){let r=await this.ctx.get(ri).getOrReadTextDocument({uri:e});if(r.status==="valid")return r.document}async processInlineResponse(e,r){let o=Iqt(e,r).filter(c=>Tqt.includes(c.mode)),s=xqt(o,r);if(s)return await this.ctx.get(jh).documentDiff({original:r.getText(),updated:s}),{uri:r.uri,text:s}}extractEditsFromResponse(e,r){return Iqt(e,r)}};var LKe=class{constructor(){this.slug="github-copilot-coding-agent";this.name="GitHub Copilot Coding Agent";this.description="Create coding tasks that are executed by GitHub Copilot Coding Agent";this.avatarUrl=void 0}static{a(this,"BackendCodingAgent")}additionalSkills(e){return[]}turnProcessor(e){let r=new Sle(e.ctx);return new OKe(e,r)}};p();p();p();p();function zvn(t){return t?t.filter(e=>e.type==="github.web-search").map(e=>e):[]}a(zvn,"filterUnsupportedReferences");function Yvn(t){return t?t.filter(e=>e.type==="github.web-search"):[]}a(Yvn,"convertToCopilotReferences");var Kvn=S.Object({type:S.Literal("github.web-search"),id:S.String(),data:S.Object({query:S.String(),type:S.String(),results:S.Optional(S.Array(S.Object({title:S.String(),excerpt:S.String(),url:S.String()})))}),metadata:S.Optional(S.Object({display_name:S.Optional(S.String()),display_icon:S.Optional(S.String())}))});var XQ=class{constructor(e){this.deltaApplier=e;this.appliedLength=0;this.appliedText="";this.appliedAnnotations=[]}static{a(this,"ConversationFinishCallback")}isFinishedAfter(e,r){let n=e.substring(this.appliedLength,e.length),s=this.mapAnnotations(r.annotations).filter(c=>!this.appliedAnnotations.includes(c.id));this.append(n,s,zvn(r.copilotReferences),r.copilotErrors??[],r.copilotConfirmation,r.thinking)}append(e,r,n,o,s,c){this.deltaApplier(e,r,n,o,s,c),this.appliedLength+=e.length,this.appliedText+=e,this.appliedAnnotations.push(...r.map(l=>l.id))}mapAnnotations(e){if(!e)return[];let r=[],n=e.for("CodeVulnerability").map(s=>({...s,type:"code_vulnerability"})),o=e.for("IPCodeCitations").map(s=>({...s,type:"ip_code_citations"}));return r.push(...n),r.push(...o),r}};p();p();var tO=class{constructor(e){this.ctx=e;this.githubRepositoryInfoCache=new Map}static{a(this,"GitHubRepositoryApi")}async getRepositoryInfo(e){let r=`${e.hostname}/${e.owner}/${e.repo}`,n=this.githubRepositoryInfoCache.get(r);if(n)return n;let o=await this._doGetRepositoryInfo(e);if(o?.ok){let s=await o.json();return this.githubRepositoryInfoCache.set(r,s),s}}async _doGetRepositoryInfo({owner:e,repo:r,hostname:n}){let o=await this.ctx.get(Fr).resolveSession(),s;if(o&&new URL(o.serverUrl).hostname===n)s=o;else{let u=await this.ctx.get(OI).findTokenByAuthority(n);u&&(s={accessToken:u.record.accessToken,apiUrl:`https://api.${n}/`})}if(!s&&!(n==="github.com"||n.endsWith(".ghe.com")))return;let c={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};s&&(c.Authorization=`Bearer ${s.accessToken}`);let l=new URL(`repos/${e}/${r}`,s?.apiUrl||`https://api.${n}`).href;return this.ctx.get(cr).fetch(l,{method:"GET",headers:c})}};p();p();var Jvn=S.Object({name:S.String(),url:S.String()}),Zvn=S.Object({path:S.String(),head:S.Optional(S.Object({name:S.String(),upstream:S.Optional(Jvn)})),remotes:S.Optional(S.Array(Jvn))}),wqt=class{constructor(e){this.turnContext=e}static{a(this,"GitMetadataSkillProcessor")}value(){return .8}processSkill(e){this.turnContext.collectLabel(rO,"git repository information");let r=[];return r.push([new yr(["Metadata about the current git repository:"]),1]),e.head&&e.head.name?(r.push([new yr([`- Current branch name: ${e.head.name}`]),1]),e.head.upstream&&r.push([new yr([`- Upstream name and url: ${e.head.upstream.name} - ${e.head.upstream.url}`]),1])):r.push([new yr(["- Detached HEAD: yes"]),1]),e.remotes&&e.remotes.length>0&&r.push([new yr([`- Remotes: ${e.remotes.map(n=>n.name).join(", ")}`]),1]),new yr(r)}},rO="git-metadata",FKe=class extends rg{static{a(this,"GitMetadataSkill")}constructor(e){super(rO,"Metadata about the current git repository, useful for questions about branch management and git related commands","Reading git information",()=>e,r=>new wqt(r))}};async function Xvn(t){let e=await t.skillResolver.resolve(zy);if(e){let c=e.uri,l=T7(t.ctx,c);if(tcn(l))return{repoInfo:l,skillUsed:zy}}let r=await t.skillResolver.resolve(rO);if(!r||!r.remotes||r.remotes.length===0){ot.debug(t.ctx,"Git metadata skill is not available or no remotes available.");return}let o=r.remotes.find(c=>c.name==="origin")??r.remotes[0],s=GLt(o.url);if(s)return{repoInfo:{baseFolder:{uri:r.path},url:o.url,...s},skillUsed:rO}}a(Xvn,"extractRepoInfo");async function eCn(t){let e=[];return await bGo(t,e),await SGo(t,e),await TGo(t,e),e}a(eCn,"skillsToReference");async function bGo(t,e){let r=await IGo(t);r&&e.push(r)}a(bGo,"addRepositoryReference");async function SGo(t,e){let r=await xGo(t);r&&e.push(r)}a(SGo,"addSelectionReference");async function TGo(t,e){let r=[],n=await RGo(t);n&&r.push(n),r.push(...await PGo(t)),r.length>0&&e.push(...r)}a(TGo,"addFileReferences");async function IGo(t){let e=await Xvn(t);if(e){let r=t.ctx.get(tO),n=e.repoInfo.owner,o=e.repoInfo.repo,s=await r.getRepositoryInfo(e.repoInfo);if(s)return{type:"github.repository",id:`${n}/${o}`,data:{type:"repository",name:o,ownerLogin:n,id:s.id}}}}a(IGo,"gitMetadataToReference");async function xGo(t){let e=await t.skillResolver.resolve(zy);if(e&&e.selection){let n=await t.ctx.get(ri).getOrReadTextDocument(e),o=Ku(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o,e.selection),n.status==="valid")return wGo(e,n.document)}}a(xGo,"currentEditorToSelectionReference");function wGo(t,e){if(t.selection&&!Ale(t.selection)){let r=e.getText(t.selection);return{type:"client.selection",id:t.uri,data:{start:{line:t.selection.start.line,col:t.selection.start.character},end:{line:t.selection.end.line,col:t.selection.end.character},content:r}}}}a(wGo,"extractSelection");async function RGo(t){let e=await t.skillResolver.resolve(zy);if(e){let n=await t.ctx.get(ri).getOrReadTextDocument(e),o=Ku(n);if(await t.collectFile(t.turn.agent.agentSlug,e.uri,o),n.status==="valid")return{type:"client.file",id:n.document.uri,data:{content:n.document.getText(),language:n.document.detectedLanguageId}}}}a(RGo,"currentEditorToFileReference");async function PGo(t){let e=[],r=t.turn.request.references;if(r&&r.length>0){let n=t.ctx.get(ri);for(let o of r)if(o.type==="file"){let s=await n.getOrReadTextDocument(o),c=Ku(s);if(await t.collectFile(t.turn.agent.agentSlug,o.uri,c,o.selection),s.status==="valid"){let l=s.document.getText();e.push({type:"client.file",id:o.uri,data:{content:l,language:s.document.detectedLanguageId}})}}}return e}a(PGo,"fileReferenceToPlatformFileReference");p();As();var kGo=new Ae("ChatFetchResultPostProcessor"),Tle=class{constructor(e,r,n){this.turnContext=e;this.chatFetcher=r;this.computeSuggestions=n}static{a(this,"ChatFetchResultPostProcessor")}async postProcess(e,r,n,o,s,c,l,u){switch(Gyn(this.turnContext.ctx,l,c,e.type=="offTopic",e.requestId,u,s),await this.turnContext.ctx.get(jh).inspectFetchResult(e),e.type){case"success":return await this.processSuccessfulFetchResult(n,e.numTokens,e.requestId,r,l,o,s,u);case"offTopic":return this.processOffTopicFetchResult(s,l,u);case"canceled":return this.turnContext.turn.status="cancelled",this.turnContext.turn.response={message:"Cancelled",type:"user"},{error:{message:Rn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}};case"failed":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:e.reason,type:"server"},kGo.error(this.turnContext.ctx,"Fetch failed:",e),{error:{message:R_.translateErrorMessage(e.code,e.reason,e.requestId,e.retryAfter,e.ghRequestId,{capiErrorCode:e.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===P_,copilotPlan:MI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:e.code}};case"filtered":return this.turnContext.turn.status="filtered",{error:{message:"Oops, your response got filtered. Vote down if you think this shouldn't have happened.",responseIsFiltered:!0}};case"length":return this.turnContext.turn.status="error",{error:{message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0}};case"agentAuthRequired":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},{error:{message:"Authorization required",responseIsFiltered:!1}};case"no_choices":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"No choices returned",type:"server"},{error:{message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"no_finish_reason":return this.turnContext.turn.status="error",n&&n.length>0?this.turnContext.turn.response={message:n,type:"model",references:this.turnContext.turn.response?.references}:this.turnContext.turn.response={message:"No finish reason",type:"server"},{error:{message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0}};case"model_not_supported":{this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model not supported",type:"server"};let{modelName:d,modelProviderName:f}=Ro.parseModelNotSupportedReason(e.reason);return{error:{message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:d,modelProviderName:f}}}case"model_max_prompt_tokens_exceeded":return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Model max prompt tokens exceeded",type:"server"},{error:{message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",code:400,reason:"model_max_prompt_tokens_exceeded",responseIsFiltered:!1}};case"successMultiple":case"tool_calls":case"unknown":return this.turnContext.turn.status="error",{error:{message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1}}}}async processSuccessfulFetchResult(e,r,n,o,s,c,l,u){if(e&&e.length>0){c.markAsDisplayed(),l.markAsDisplayed(),this.turnContext.turn.status="success",this.turnContext.turn.response={message:e,type:"model",references:this.turnContext.turn.response?.references},$yn(this.turnContext,s,e,r,n,u,l);let d=this.computeSuggestions?await this.fetchSuggestions(o,s,c,u):void 0;if(d){let{followUp:f,suggestedTitle:h}=d;return{followup:f.message!==""?f:void 0,suggestedTitle:h!==""?h:void 0}}return{}}return this.turnContext.turn.status="error",this.turnContext.turn.response={message:"The model returned successful but did not contain any response text.",type:"meta"},{error:{message:Rn(this.turnContext.turn.response?.message??""),type:this.turnContext.turn.response?.type}}}async fetchSuggestions(e,r,n,o){let c=await new WQ(this.turnContext.ctx,this.chatFetcher).fetchRawSuggestions(this.turnContext,e,r,n);if(c===void 0)return;let l=this.enrichFollowup(c,r,n,o);return ot.debug(this.turnContext.ctx,"Computed followup",l),ot.debug(this.turnContext.ctx,"Computed suggested title",c.suggestedTitle),{followUp:l,suggestedTitle:c.suggestedTitle}}enrichFollowup(e,r,n,o){let s=n.extendedBy({messageSource:"chat.suggestions",suggestionId:ir(),suggestion:"Follow-up from model"},{promptTokenLen:e.promptTokenLen,numTokens:e.numTokens});return Yyn(this.turnContext.ctx,r,s,o),{message:e.followUp,id:s.properties.suggestionId,type:s.properties.suggestion}}processOffTopicFetchResult(e,r,n){let o="Sorry, but I can only assist with programming related questions.";return this.turnContext.turn.response={message:o,type:"offtopic-detection"},this.turnContext.turn.status="off-topic",Vyn(this.turnContext.ctx,this.turnContext.conversation,r,o,e.properties.messageId,n,e),{error:{message:o,responseIsFiltered:!0}}}};p();var UKe=S.Union([S.String(),S.Number()]),fK=S.Union([S.String(),S.Number()]),DGo=S.Union([S.Literal("included"),S.Literal("blocked"),S.Literal("notfound"),S.Literal("empty")]),QKe=S.Object({uri:S.String(),position:S.Optional(K0)}),NGo=S.Object({type:S.Literal("file"),uri:S.String(),position:S.Optional(K0),visibleRange:S.Optional(pf),selection:S.Optional(pf),status:S.Optional(DGo),range:S.Optional(pf)}),MGo=S.Object({type:S.Literal("directory"),uri:S.String()}),OGo=S.Object({type:S.Literal("tool"),uri:S.String(),name:S.Optional(S.String()),server:S.Optional(S.String()),description:S.Optional(S.String())}),nO=S.Union([NGo,MGo,Kvn,OGo]),iO=S.Union([S.Literal("panel"),S.Literal("inline")]),BGo=S.Union([S.Object({type:S.Literal("text"),text:S.String()}),S.Object({type:S.Literal("image_url"),imageUrl:S.Object({url:S.String(),detail:S.Optional(S.Union([S.Literal("low"),S.Literal("high")]))})})]),Rqt=S.Union([S.String(),S.Array(BGo)]),tCn=S.Object({request:Rqt,response:S.Optional(S.String()),agentSlug:S.Optional(S.String()),turnId:S.Optional(fK),model:S.Optional(S.String())});function qKe(t){return typeof t=="string"?t:t.map(e=>e.type==="image_url"?{type:"image_url",image_url:{url:e.imageUrl.url,detail:e.imageUrl.detail}}:{type:"text",text:e.text})}a(qKe,"convertToMessageContent");function jKe(t,e){if(t=xS(t),typeof t=="string")return t+e;let r=t.map(n=>n.type==="text").lastIndexOf(!0);if(r>=0){let n=[...t],o=n[r];return n[r]={type:"text",text:o.text+e},n}return[...t,{type:"text",text:e}]}a(jKe,"appendToMessage");var HKe=S.Union([S.Literal("Ask"),S.Literal("Agent"),S.Literal("InlineAgent")]),LGo=S.Object({type:S.String(),description:S.String()}),rCn=S.Object({name:S.String(),description:S.String(),inputSchema:S.Optional(S.Object({type:S.String(),properties:S.Record(S.String(),LGo),required:S.Array(S.String())})),confirmationMessages:S.Optional(S.Object({title:S.String(),message:S.String()}))}),Mc=S.Object({uri:S.String(),name:S.String()}),FGo=S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")]),GKe=S.Object({id:S.Number(),title:S.String(),description:S.Optional(S.String()),status:FGo});As();var Pqt="generate-response",$Ke=class extends Error{constructor(r,n,o,s){super(r);this.authorizationUri=n;this.agentSlug=o;this.agentName=s}static{a(this,"RemoteAgentAuthorizationError")}},PIe=class{constructor(e,r,n){this.agent=e;this.turnContext=r;this.chatFetcher=n;this.conversationProgress=r.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(r.ctx),this.postProcessor=new Tle(r,this.chatFetcher,!1),this.conversation=r.conversation,this.turn=r.turn}static{a(this,"RemoteAgentTurnProcessor")}async process(e,r,n,o){try{await this.processWithAgent(e,r,this.turnContext,o)}catch(s){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,s);let c=s instanceof Error?s.message:String(s);this.turn.status="error",this.turn.response={message:c,type:"meta"},s instanceof $Ke?await this.endProgress({unauthorized:{authorizationUri:s.authorizationUri,agentSlug:s.agentSlug,agentName:s.agentName}}):await this.endProgress({error:{message:c,responseIsIncomplete:!0}})}}async processWithAgent(e,r,n,o){await this.conversationProgress.begin(this.conversation,this.turn,e);let s=await Kc(this.turnContext.ctx,this.turnContext,{languageId:o?.detectedLanguageId??""});if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let c=await this.buildAgentPrompt(n);if(!c)await this.endTurnWithResponse(`No prompt created for agent ${this.agent.id}`,"error");else{let l={type:"user",prompt:JSON.stringify(c.messages,null,2),tokens:c.tokens};await n.ctx.get(jh).inspectPrompt(l),await n.steps.start(Pqt,"Generating response");let u=this.augmentTelemetry(c,s,this.turn.template,o);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let d=await this.fetchConversationResponse(n,c.messages,r,s.extendedBy({messageSource:"chat.user"},{promptTokenLen:c.tokens}),u,o);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(d,n),await this.endProgress({error:d.error,followUp:d.followup,suggestedTitle:d.suggestedTitle,skillResolutions:c.skillResolutions}))}}async buildAgentPrompt(e){let r=this.createMessagesFromHistory(e),n=await this.computeCopilotReferences(e),o=this.getOrCreateAgentSessionId(e);return this.turn.agent&&(this.turn.agent.sessionId=o),this.turn.confirmationResponse?this.addConfirmationResponse(this.turn.confirmationResponse,r):r.push({role:"user",content:xS(e.turn.request.message),copilot_references:n.length>0?n:void 0}),{messages:r,tokens:-1,skillResolutions:[]}}getOrCreateAgentSessionId(e){let r=this.turn.agent?.agentSlug;if(r){for(let n of e.conversation.turns)if(n.agent?.agentSlug===r&&n.agent.sessionId)return n.agent.sessionId}return ir()}addConfirmationResponse(e,r){r.push({role:"user",content:"",copilot_confirmations:[e]})}createMessagesFromHistory(e){return LQt(e.conversation.turns.slice(0,-1),this.agent.slug).flatMap(r=>{let n=[];if(r.request&&n.push({role:"user",content:xS(r.request.message)}),r.response&&r.response.type==="model"){let o=Yvn(r.response.references);n.push({role:"assistant",content:xS(r.response.message),copilot_references:o.length>0?o:void 0})}return n})}async computeCopilotReferences(e){return await eCn(e)}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async fetchConversationResponse(e,r,n,o,s,c){n.onCancellationRequested(async()=>{await this.cancelProgress()});let l=new XQ((h,m,g,A,y,E)=>{let _=y?{...y,agentSlug:this.agent.slug}:void 0;this.conversationProgress.report(this.conversation,this.turn,{reply:h,annotations:m,references:g,notifications:A.map(v=>({message:v.message,severity:"warning"})),confirmationRequest:_,thinking:E}),this.turn.response?(this.turn.response.message=jKe(this.turn.response.message,h),this.turn.response.references.push(...g)):this.turn.response={message:h,type:"model",references:g},this.turn.annotations.push(...m??[]),_&&(this.turn.confirmationRequest=_)}),u=await this.turnContext.ctx.get(Ut).getGitHubSession(),d={engineName:"agents",endpoint:this.agent.endpoint??this.agent.slug,messages:r,uiKind:"conversationPanel",intentParams:{intent:!0,intent_threshold:.7,intent_content:Rn(this.turn.request.message)},authToken:u?.accessToken,copilot_thread_id:this.turn.agent?.sessionId,llmInteraction:e.toLlmInteraction(),turnId:String(this.turn.id)},f=await this.chatFetcher.fetchResponse(d,n,o,(h,m)=>l.isFinishedAfter(h,m));return this.ensureAgentIsAuthorized(f),await this.postProcessor.postProcess(f,n,l.appliedText,o,s.extendedBy(this.addExtensibilityInfoTelemetry()),Rn(this.turn.request.message),"conversationPanel",c)}ensureAgentIsAuthorized(e){if(e.type==="agentAuthRequired")throw this.turnContext.turn.status="error",this.turnContext.turn.response={message:"Authorization required",type:"server"},new $Ke("Authorization required",e.authUrl,this.agent.slug,this.agent.name)}augmentTelemetry(e,r,n,o){return aIe(this.conversation,"conversationPanel",Rn(this.turn.request.message).length,e.tokens,n?.templateId,void 0,r,e.skillResolutions)}addExtensibilityInfoTelemetry(){return{extensibilityInfoJson:JSON.stringify({agent:this.agent.slug,outgoingReferences:this.turn.request.references?.map(e=>e.type)??[],incomingReferences:this.turn.response?.references?.map(e=>e.type)??[]})}}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(Pqt,e.error.message):await r.steps.finish(Pqt)}async endProgress(e){await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}};var kIe=class{constructor(e,r,n,o,s,c){this.id=e;this.slug=r;this.name=n;this.description=o;this.avatarUrl=s;this.endpoint=c}static{a(this,"RemoteAgent")}additionalSkills(){return[]}turnProcessor(e){return new PIe(this,e)}},VKe=class extends kIe{static{a(this,"ExtensibilityPlatformAgent")}constructor(){super(0,"github","GitHub","Get answers grounded in web search, code search, and your enterprise's knowledge bases.","https://avatars.githubusercontent.com/u/9919?s=200&v=4","chat")}turnProcessor(e){return new PIe(this,e)}};p();var UGo="github",Tk=class{static{a(this,"RemoteAgentRegistry")}},WKe=class extends Tk{constructor(r){super();this.ctx=r;this._agents=void 0;this._lastFetchTime=0}static{a(this,"CapiRemoteAgentRegistry")}async agents(){return this.shouldRefreshAgents()&&(this._agents=await this.fetchAgents()),this._agents!=null?this._agents.slice():[]}shouldRefreshAgents(){return!this._agents||!this._lastFetchTime?!0:this.isLastFetchOlderOneHour()}isLastFetchOlderOneHour(){return Date.now()-this._lastFetchTime>36e5}async fetchAgents(){let r=await Uz(this.ctx,"/agents");return r.ok?(this._lastFetchTime=Date.now(),this.parseAgents(await r.text())):(Dr.error(this.ctx,"Failed to fetch agents from CAPI",{status:r.status,statusText:r.statusText}),[])}parseAgents(r){let n;try{n=JSON.parse(r).agents,Array.isArray(n)||Dr.error(this.ctx,"Expected 'agents' to be an array")}catch(o){return r.includes("access denied")||Dr.warn(this.ctx,"Invalid remote agent response:",r,o),[]}return n.filter(o=>o.slug!==UGo).map(o=>new kIe(o.id,o.slug,o.name,o.description,o.avatar_url))}};p();p();var nCn=fe(require("fs")),D_=fe(require("path"));var kqt=[".test",".spec","_test","Test","_spec","_test","Tests",".Tests","Spec"],Dqt="test_",DIe={js:{suffix:[".test",".spec"],location:"sameFolder"},ts:{suffix:[".test",".spec"],location:"sameFolder"},go:{suffix:["_test"],location:"sameFolder"},java:{suffix:["Test"],location:"testFolder"},php:{suffix:["Test"],location:"testFolder"},dart:{suffix:["_test"],location:"testFolder"},cs:{suffix:["Test"],location:"testFolder"},rb:{suffix:["_test","_spec"],location:"testFolder"},py:{prefix:"test_",location:"testFolder"},ps1:{suffix:[".Tests"],location:"testFolder"},kt:{suffix:["Test"],location:"testFolder"}},NIe=class{constructor(e,r,n=void 0){this.ctx=e;this.fileExists=r;this.baseUri=n}static{a(this,"TestFileFinder")}async findTestFileForSourceFile(e){let r=Ki(e),n=D_.extname(r).replace(".",""),o=DIe[n]??{location:"sameFolder",prefix:Dqt,suffix:kqt},s=[];if(o.prefix&&s.push(o.prefix+r),o.suffix)for(let d of o.suffix??[]){let f=r.replace(`.${n}`,d+"."+n);s.push(f)}let c=o.location??"sameFolder",l;if(c==="sameFolder"){if(l=Ko(Xd(e)),l===void 0)return}else{let d=Ko(e);if(d===void 0)return;l=this.determineTestFolder(d,c)}for(let d of s){let f=D_.join(l,d),h=this.parseTestFilePath(f);if(h&&await this.fileExists(h))return h}let u=ba(l);if(await this.fileExists(u))return Sa(u,s[0])}parseTestFilePath(e){try{return ba(e)}catch(r){Dr.error(this.ctx,`Failed to parse test file path: ${e}`,r);return}}async findImplFileForTestFile(e){let r=Ki(e),n=D_.extname(r).replace(".",""),o=DIe[n]??{location:"sameFolder",prefix:Dqt,suffix:kqt},s=[];if(o.prefix&&s.push(r.substring(o.prefix.length)),o.suffix)for(let u of o.suffix??[]){let f=r.substring(0,r.length-u.length-1-n.length)+"."+n;s.push(f)}let c=o.location??"sameFolder",l;c==="sameFolder"?l=Xd(e):l=this.determineImplFolder(e);for(let u of s){let d=Sa(l,u);if(await this.fileExists(d))return d}}findExampleTestFile(e){let r=Ko(e);if(r===void 0)return;let n=D_.extname(Ki(e)).replace(".",""),o,s=DIe[n]?.location??"sameFolder";s==="sameFolder"?o=D_.dirname(r):o=this.determineTestFolder(r,s);let c=this.findFiles(o,`.${n}`,DIe[n]);if(c.length>0)return ba(c[0])}findFiles(e,r,n){let o=this._readdir(e),s=[];for(let c of o){let l=`${e}${D_.sep}${c}`;n?.prefix&&c.startsWith(n.prefix)&&s.push(l),n?.suffix&&n?.suffix.some(u=>c.endsWith(u+r))&&s.push(l)}return s}_readdir(e){return nCn.readdirSync(e,{withFileTypes:!0}).filter(r=>r.isFile()).map(r=>r.name)}determineTestFolder(e,r){let n=(this.baseUri&&Ko(this.baseUri))??"",o=D_.extname(e).replace(".",""),s=this.getRelativeTestFolder(e,n,o,r);return[n,...s].filter(c=>c).join(D_.sep)}getRelativeTestFolder(e,r,n,o){let s=D_.dirname(e).replace(r,"");switch(n){case"php":case"dart":case"py":return["tests"];case"ps1":return["Tests"];case"rb":return["test",s];case"cs":return[s.replace("src","src/tests")];case"java":case"scala":case"kt":return[s.replace(/src[\\/]main/,"src/test")];default:return o==="testFolder"?[s.replace("src","test")]:[s]}}determineImplFolder(e){let r=D_.extname(Ki(e)).replace(".",""),n=Xd(e);switch(r){case"php":case"dart":case"py":return n.replace("tests","src");case"ps1":return n.replace("Tests","src");case"rb":return n.replace("/test","");case"cs":return n.replace("src/tests","src");case"java":case"scala":case"kt":return n.replace("src/test","src/main");default:return n.replace("test/","src/")}}};function MIe(t){let e=Ki(t),r=D_.extname(e),n=DIe[r.replace(".","")];return n?!(n.suffix&&!n.suffix.some(s=>e.endsWith(s+r))||n.prefix&&!e.startsWith(n.prefix)):!!(kqt.some(s=>e.endsWith(s+r))||e.startsWith(Dqt))}a(MIe,"isTestFile");p();var Nqt=class extends Error{static{a(this,"UserQueryParserError")}constructor(e){super(String(e),{cause:e}),this.name="UserQueryParserError"}};async function iCn(t,e){let r=t.ctx,n=await Ro.getModelConfiguration(r,"synonyms",{tool_calls:!0}),o={promptType:"synonyms",modelConfiguration:n},s=await r.get(gA).toPrompt(t,o);if(!s.toolConfig)return;let c={modelConfiguration:n,uiKind:"conversationPanel",messages:s.messages,tools:s.toolConfig?.tools,tool_choice:s.toolConfig?.tool_choice,llmInteraction:t.toLlmInteraction()},l=new rc(r),u=await Kc(r,t),d=await l.fetchResponse(c,e,u.extendedBy({messageSource:"chat.synonyms"}));if(d.type==="success"&&d.toolCalls&&d.toolCalls.length>0){let f=d.toolCalls[0],h=s.toolConfig?.extractArguments(f).keywords;return!h||!Array.isArray(h)?void 0:(ot.debug(r,`UserQueryParser: Parsed ${h.length} keywords from the original user query: ${h.join(", ")}`),h.length?h:void 0)}else{let f="reason"in d?d.reason:"";La(r,new Nqt(`Failed to request user query synonyms, result type: ${d.type}, reason: ${f}`),"UserQueryParser.parseUserQuery")}}a(iCn,"parseUserQuery");p();p();p();p();var $o=class t{static{a(this,"Position")}constructor(e,r){this.lineNumber=e,this.column=r}with(e=this.lineNumber,r=this.column){return e===this.lineNumber&&r===this.column?this:new t(e,r)}delta(e=0,r=0){return this.with(this.lineNumber+e,this.column+r)}equals(e){return t.equals(this,e)}static equals(e,r){return!e&&!r?!0:!!e&&!!r&&e.lineNumber===r.lineNumber&&e.column===r.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,r){return e.lineNumbern||e===n&&r>o?(this.startLineNumber=n,this.startColumn=o,this.endLineNumber=e,this.endColumn=r):(this.startLineNumber=e,this.startColumn=r,this.endLineNumber=n,this.endColumn=o)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.columne.endColumn)}static strictContainsPosition(e,r){return!(r.lineNumbere.endLineNumber||r.lineNumber===e.startLineNumber&&r.column<=e.startColumn||r.lineNumber===e.endLineNumber&&r.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,r){return!(r.startLineNumbere.endLineNumber||r.endLineNumber>e.endLineNumber||r.startLineNumber===e.startLineNumber&&r.startColumn<=e.startColumn||r.endLineNumber===e.endLineNumber&&r.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,r){let n,o,s,c;return r.startLineNumbere.endLineNumber?(s=r.endLineNumber,c=r.endColumn):r.endLineNumber===e.endLineNumber?(s=r.endLineNumber,c=Math.max(r.endColumn,e.endColumn)):(s=e.endLineNumber,c=e.endColumn),new t(n,o,s,c)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,r){let n=e.startLineNumber,o=e.startColumn,s=e.endLineNumber,c=e.endColumn,l=r.startLineNumber,u=r.startColumn,d=r.endLineNumber,f=r.endColumn;return nd?(s=d,c=f):s===d&&(c=Math.min(c,f)),n>s||n===s&&o>c?null:new t(n,o,s,c)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,r){return!e&&!r?!0:!!e&&!!r&&e.startLineNumber===r.startLineNumber&&e.startColumn===r.startColumn&&e.endLineNumber===r.endLineNumber&&e.endColumn===r.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new $o(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new $o(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,r){return new t(this.startLineNumber,this.startColumn,e,r)}setStartPosition(e,r){return new t(e,r,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,r=e){return new t(e.lineNumber,e.column,r.lineNumber,r.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,r){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var oCn=250;function AA(t){let e;if(typeof t.tokenBudget=="number"&&(e=Math.floor(t.tokenBudget/oCn)),typeof t.maxResults=="number"&&(e=typeof e=="number"?Math.min(t.maxResults,e):t.maxResults),typeof e!="number")throw new Error("Either maxResults or tokenBudget must be provided");return e}a(AA,"getMaxChunks");var sCn=32e3,aCn=2e4,OIe=.75;p();p();function yA(t){let e=t.matchAll(/^\s*(```+)/gm),r=Math.max(3,...Array.from(e,n=>n[1].length+1));return"`".repeat(r)}a(yA,"getFenceForCodeBlock");p();var uCn=fe(ml()),dCn=fe(Gp());p();var kC=class t{constructor(e){this.id=e}static{a(this,"EmbeddingType")}static{this.text3small_512=new t("text-embedding-3-small-512")}static{this.metis_1024_I16_Binary=new t("metis-1024-I16-Binary")}toString(){return this.id}equals(e){return this.id===e.id}};var QGo=Object.freeze({[kC.text3small_512.id]:{model:"text-embedding-3-small",dimensions:512,quantization:{query:"float32",document:"float32"}},[kC.metis_1024_I16_Binary.id]:{model:"metis-I16-Binary",dimensions:1024,quantization:{query:"float16",document:"binary"}}});function Mqt(t){return QGo[t.id]}a(Mqt,"getWellKnownEmbeddingTypeInfo");function qGo(t,e){let r=0,n=Math.min(t.length,e.length);for(let o=0;o({distance:BIe(l,t),value:c})).filter(c=>c.distance.value>o).sort((c,l)=>l.distance.value-c.distance.value).slice(0,r).map(c=>({distance:c.distance,value:c.value}));if(s.length&&typeof n?.maxSpread=="number"){let c=s.at(0).distance.value*(1-n.maxSpread);return s.filter(u=>u.distance.value>=c)}return s}a(cCn,"rankEmbeddings");p();p();var g3=fe(zc()),lCn=fe(Gp());var oO=new Ae("GitHubCodeSearch"),jGo=300*1e3,zKe=class{constructor(e){this._indexedCommits=new Map;this._indexedRepos=new Map;this._ctx=e,this._refreshTimer=new g3.IntervalTimer,this.startPeriodicRefresh()}static{a(this,"GithubCodeSearchService")}getIndexedCommit(e){return this._indexedCommits.get(e)}setIndexedCommit(e,r){this._indexedCommits.get(e)!==r&&this._indexedCommits.set(e,r)}startPeriodicRefresh(){this._refreshTimer.cancelAndSet(()=>{this.updateIndexedRepoCommit()},jGo)}updateIndexedRepoCommit(){if(this._indexedRepos.size!==0)for(let[e,r]of this._indexedRepos.entries())this._indexedCommits.get(e)&&(async()=>{try{let o=await this._ctx.get(Ut).getGitHubSession();if(!o)return;let{currentStatus:s,indexedCommit:c}=await this.getRemoteIndexState(o,r,{isCancellationRequested:!1});if(s==="ready"&&c){let l=this._indexedCommits.get(e);l!==c&&(this._indexedCommits.set(e,c),oO.info(this._ctx,`Updated indexed commit for ${r.owner}/${r.name}`,{oldCommit:l,newCommit:c}))}}catch(o){oO.warn(this._ctx,`Failed to update indexed commit for ${e}`,o)}})()}async ensureReposIndexed(e,r,n){return await Promise.all(r.map(async o=>{let s=o?.baseFolder.uri;if(!s||n.isCancellationRequested||this._indexedRepos.has(s))return;let{currentStatus:c,indexedCommit:l}=await this.getRemoteIndexState(e,o,n);if(oO.info(this._ctx,`Index status check for ${o.owner}/${o.name}`,{status:c,indexedCommit:l}),c==="ready")this._indexedRepos.set(s,o),l&&this.setIndexedCommit(s,l);else if(c==="not-yet-indexed")try{await this.tryToInstantIndexRepo(e,o,n),oO.info(this._ctx,`Instant indexing completed for ${o.owner}/${o.name}`)}catch(u){oO.warn(this._ctx,`Instant indexing failed for ${o.owner}/${o.name}`,u)}})),r.filter(o=>this._indexedRepos.has(o.baseFolder.uri))}async tryToInstantIndexRepo(e,r,n){await(0,g3.raceTimeout)((async()=>{if(!await(0,g3.raceCancellationError)(this.triggerIndexing(e,"auto",r,n),n))return!1;let c=5,l=1e3;for(;c-- >0;){await(0,g3.raceCancellationError)((0,g3.timeout)(l),n);let{currentStatus:u,indexedCommit:d}=await this.getRemoteIndexState(e,r,n);if(u==="ready"){this._indexedRepos.set(r.baseFolder.uri,r),d&&this.setIndexedCommit(r.baseFolder.uri,d);break}else if(u!=="building-index"){let f=`Instant indexing for '${r.owner}/${r.name}' failed. Found unexpected status: '${u}'`;throw oO.error(this._ctx,f),new Error(f)}}return!0})(),8e3)}async getRemoteIndexState(e,r,n){if(!r.owner||!r.name)return{currentStatus:"not-indexable"};let o=r.owner+"/"+r.name,s=await Lf(this._ctx,e,`repos/${o}/copilot_internal/embeddings_index`,{method:"GET"});if(!s.ok)return oO.error(this._ctx,`Failed to fetch indexing status. Response: ${s.status}.`),{currentStatus:"not-yet-indexed"};let c=await s.json();return oO.debug(this._ctx,`${o} - semantic_code_search_ok: ${c.semantic_code_search_ok}`),c.semantic_code_search_ok?{currentStatus:"ready",indexedCommit:c.semantic_commit_sha}:c.semantic_indexing_enabled?{currentStatus:"building-index"}:{currentStatus:"not-yet-indexed"}}async triggerIndexing(e,r,n,o){let s=Ile(this._ctx),c=n.owner+"/"+n.name,l=await Lf(this._ctx,e,`repos/${c}/copilot_internal/embeddings_index`,{headers:s,method:"POST",json:{auto:r==="auto"}});return l.ok?!0:(oO.error(this._ctx,`Failed to request indexing for '${c}'. Response: ${l.status}. ${await l.text()}`),!1)}async searchRepo(e,r,n,o,s,c){let l=Ile(this._ctx),u=await Lf(this._ctx,e,"embeddings/code/search",{headers:l,method:"POST",json:{scoping_query:`repo:${n.owner}/${n.name}`,prompt:GGo(o,7800),include_embeddings:!1,limit:s,embedding_model:r.id}});if(!u.ok)throw new Error(`Code search semantic search failed with status: ${u.status}`);let d=await u.json();if(!Array.isArray(d.results))throw new Error("Code search semantic search unexpected response json shape");return HGo(this._ctx,d,n)}dispose(){this._refreshTimer.dispose(),this._indexedCommits.clear(),this._indexedRepos.clear()}};function Ile(t){let e=t.get(Nr);return{"X-Client-Application":`${h1(e.getEditorInfo())}`,"X-Client-Source":h1(e.getEditorPluginInfo()),"X-Client-Feature":"Agent <- codebaseTool"}}a(Ile,"editorVersionHeaders");async function HGo(t,e,r){let o=[],s=new kC(e.embedding_model),c=ia(r.baseFolder.uri);return await Promise.all(e.results.map(l=>{let u;try{u=Sa(c,l.location.path)}catch(d){oO.error(t,`Error joining path for ${l.location.path}:`,d);return}o.push({chunk:{file:u,text:YKe(l.chunk.text),rawText:void 0,range:new lCn.Range(l.chunk.line_range.start+1,1,l.chunk.line_range.end+1,1),isFullFile:!1},distance:{embeddingType:s,value:l.distance}})})),{chunks:o,outOfSync:!1}}a(HGo,"parseGithubCodeSearchResponse");function GGo(t,e){if(t.length*4<=e)return t;let o=new TextEncoder().encode(t);if(o.length<=e)return t;let s=o.slice(0,e);return new TextDecoder().decode(s,{stream:!0})}a(GGo,"truncateToMaxUtf8Length");function YKe(t){let e=$Go(t);return e.length>=3&&e[0].startsWith("File: ")&&e[1].startsWith("```")&&e.at(-1)?.startsWith("```")?e.slice(2,-1).join(` +`):t}a(YKe,"stripChunkTextMetadata");function $Go(t){return t.split(/\r\n|\r|\n/)}a($Go,"splitLines");var Ik=fe(zc()),fCn=fe(dce()),pCn=fe(Oh());var LIe=new Ae("ChunkingEndpointClient"),Oqt=class t{constructor(e){this.ctx=e;this._maxParallelChunksRequests=8;this._maxAttempts=3;this.targetQuota=80;this.requestQueue=new fCn.LinkedList;this._numberInFlightRequests=0;this._lastSendTime=Date.now();this._isPumping=!1}static{a(this,"RequestRateLimiter")}static{this._abuseLimit=1e3/40}async enqueue(e,r){let n=new Ik.DeferredPromise;return r.onCancellationRequested(()=>n.cancel()),this.requestQueue.push({task:e,attempt:0,deferred:n,token:r}),await this.pump(),n.p}async pump(){if(!this._isPumping)try{for(this._isPumping=!0;!this.requestQueue.isEmpty();){this._rateLimitTimeout&&(await this._rateLimitTimeout,this._rateLimitTimeout=void 0);let e=Date.now()-this._lastSendTime;if(e=this._maxParallelChunksRequests){await(0,Ik.timeout)(10);continue}if(this._latestRateLimitHint){let o=Date.now();if(othis.targetQuota){let o=Date.now(),s=this._latestQuotaUsed.quota-this.targetQuota,c=o-this._latestQuotaUsed.timestamp,l=2500,u=1e3,d=s/(100-this.targetQuota);d*=Math.max(1-c/l,0);let f=d*u;f>0&&await(0,Ik.timeout)(Math.min(f,u))}let r=this.requestQueue.shift();if(r.token.isCancellationRequested){await r.deferred.cancel();continue}this._numberInFlightRequests++,this._lastSendTime=Date.now(),r.task(r.attempt).then(async o=>{if(this.updateQuotasFromResponse(o),r.token.isCancellationRequested){await r.deferred.cancel();return}if(o.ok){await r.deferred.complete(o);return}if(r.attempt0&&(this._rateLimitTimeout=(0,Ik.timeout)(s*1e3)),this.requestQueue.unshift({task:r.task,attempt:r.attempt+1,deferred:r.deferred,token:r.token}),await this.pump();return}await r.deferred.complete(o)}).catch(async o=>{await r.deferred.error(o)}).finally(()=>{this._numberInFlightRequests--})}}finally{this._isPumping=!1}}updateQuotasFromResponse(e){let r=Date.now();try{let n=e.headers.get("x-ratelimit-remaining"),o=e.headers.get("x-ratelimit-reset");n&&o&&(this._latestRateLimitHint={timestamp:r,remaining:parseFloat(n),resetAt:parseFloat(o)*1e3});let s=e.headers.get("x-github-total-quota-used");s&&(this._latestQuotaUsed?this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)}:this._latestQuotaUsed={timestamp:r,quota:parseFloat(s)})}catch(n){LIe.error(this.ctx,"Error parsing rate limit/quota headers",n)}}getRequestRetryDelay(e){try{let r=e.headers.get("retry-after");if(r){let n=parseFloat(r);if(!isNaN(n))return n}}catch{LIe.error(this.ctx,"Error parsing retry-after header")}try{let r=e.headers.get("x-ratelimit-reset");if(r){let n=parseFloat(r);if(!isNaN(n)){let o=Math.floor(Date.now()/1e3);return n-o}}}catch{LIe.error(this.ctx,"Error parsing x-ratelimit-reset header")}return e.status===408?.25:2}},KKe=class{constructor(e){this.ctx=e;this._requestLimiter=new Oqt(e)}static{a(this,"ChunkingEndpointClientImpl")}computeChunks(e,r,n,o,s,c,l){return this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!1},c,l)}async computeChunksAndEmbeddings(e,r,n,o,s,c,l){return await this.doComputeChunksAndEmbeddings(e,r,n,o,{qos:s,computeEmbeddings:!0},c,l)}async doComputeChunksAndEmbeddings(e,r,n,o,s,c,l){let u=await(0,Ik.raceCancellationError)(n.getText(),l);if((0,pCn.isFalsyOrWhitespace)(u))return[];try{let d=a(async m=>{let g=Ile(this.ctx);return await Lf(this.ctx,e,"chunks",{headers:g,method:"POST",json:{embed:s.computeEmbeddings,qos:s.qos,content:u,path:Ko(n.uri),local_hashes:c?Array.from(c.keys()):[],embedding_model:r.id}})},"makeRequest");o.recomputedFileCount++,o.sentContentTextLength+=u.length;let f=await(0,Ik.raceCancellationError)(this._requestLimiter.enqueue(d,l),l);if(!f.ok){LIe.error(this.ctx,`Error chunking '${n.uri.toString()}'. Status: ${f.status}.`);return}let h=await f.json();return h.chunks.length?(0,uCn.coalesce)(h.chunks.map(m=>{let g=new dCn.Range(m.line_range.start+1,1,m.line_range.end+1,1),A=c?.get(m.hash);if(A)return{chunk:{file:n.uri.toString(),text:YKe(A.chunk.text),rawText:void 0,range:g,isFullFile:A.chunk.isFullFile},chunkHash:m.hash,embedding:A.embedding};if(typeof m.text!="string")return;let y;if(m.embedding?.embedding){let E=new kC(h.embedding_model);if(!E.equals(r))throw new Error(`Unexpected embedding model. Got: ${E.id}. Expected: ${r.id}`);y={type:E,value:new Float32Array(m.embedding.embedding)}}if(!(s.computeEmbeddings&&!y))return{chunk:{file:n.uri.toString(),text:YKe(m.text),rawText:void 0,range:g,isFullFile:!1},chunkHash:m.hash,embedding:y}})):[]}catch(d){LIe.error(this.ctx,`Error chunking '${n.uri.toString()}'`,d);return}}};p();p();var Jy={Tfidf:"semantic.search.tfidf",Embeddings:"semantic.search.embeddings",Remote:"semantic.search.remote",Aggregate:"semantic.search.aggregate"},Z0=class t{static{a(this,"WorkspaceChunkSearchTelemetry")}static sendSuccess(e,r,n,o){let s={status_text:"success",...n},c=Vt.createAndMarkAsIssued(s,o);yt(e,r,c),_t(e,r,c.properties,c.measurements)}static sendFailure(e,r,n){let o={status_text:"failure"};La(e,n,r,o),si(e,r,n,o)}static sendTfidfSuccess(e,r,n,o,s,c,l,u,d){t.sendSuccess(e,Jy.Tfidf,{source:d},{timeTakenMs:r,rankingTimeMs:n,rerankingTimeMs:o,localSnippetCount:l,chunkCount:s,fileCount:c,totalFileCount:u})}static sendTfidfFailure(e,r){t.sendSearchFailure(e,Jy.Tfidf,r)}static sendEmbeddingsSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Jy.Embeddings,{source:l},{timeTakenMs:r,embeddingsTimeMs:n,chunkCount:o,fileCount:s,totalFileCount:c})}static sendEmbeddingsFailure(e,r){t.sendSearchFailure(e,Jy.Embeddings,r)}static sendEmbeddingsSkipped(e,r){t.sendSkipped(e,Jy.Embeddings,r)}static sendRemoteSuccess(e,r,n,o,s){t.sendSuccess(e,Jy.Remote,{provider:s},{timeTakenMs:r,chunkCount:n,fileCount:o})}static sendRemoteFailure(e,r){t.sendSearchFailure(e,Jy.Remote,r)}static sendRemoteSkipped(e,r){t.sendSkipped(e,Jy.Remote,r)}static sendSearchFailure(e,r,n){t.sendFailure(e,r,n)}static sendSkipped(e,r,n){let o={status_text:"skipped",reason:n},s=Vt.createAndMarkAsIssued(o,{});yt(e,r,s),_t(e,r,s.properties,s.measurements)}static sendAggregateSuccess(e,r,n,o,s,c,l){t.sendSuccess(e,Jy.Aggregate,{provider:r,source:l},{timeTakenMs:n,chunkCount:o,fileCount:s,workspaceCount:c})}static sendAggregateFailure(e,r){t.sendFailure(e,Jy.Aggregate,r)}};var hCn=fe(ml()),mCn=fe(zc()),Bqt=fe(NM());var A3=new Ae("Remote Search"),JKe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._localDiffSearch=n;this._githubCodeSearchService=o;this.id="codesearch";this.localDiffSearchTimeout=15e3}static{a(this,"CodeSearchChunkSearch")}async isAvailable(e){return(await this.getRepos(e)).length>0}async getRepos(e){if(!e?.length)return[];let r=this.ctx.get(z0),o=(await Promise.all(e.map(async c=>await r.getRepo({uri:c})))).filter(c=>c!==void 0).filter(c=>c.isGitHub()&&c.owner&&c.name),s=new Map;for(let c of o){let l=`${c.owner}/${c.name}`;s.has(l)||s.set(l,c)}return Array.from(s.values())}async searchWorkspace(e,r,n){let o=new Bqt.StopWatch,s=await this.getRepos(r.workspaceFolders);if(A3.info(this.ctx,"Starting workspace search",{rawQuery:e.rawQuery,repoCount:s.length,repos:s.map(P=>`${P.owner}/${P.name}`),maxResults:AA(r)}),s.length===0)throw A3.error(this.ctx,"No GitHub repositories found"),Z0.sendRemoteSkipped(this.ctx,"no_github_repos"),new Error("No GitHub repositories found in CodeSearchChunkSearch");let c=await this.ctx.get(Ut).getGitHubSession();if(!c)throw A3.error(this.ctx,"No GitHub session found"),Z0.sendRemoteSkipped(this.ctx,"no_github_session"),new Error("No GitHub session found in CodeSearchChunkSearch");let l=await this._githubCodeSearchService.ensureReposIndexed(c,s,n);if(l.length===0)throw A3.error(this.ctx,"Remote index not ready for any repositories"),Z0.sendRemoteSkipped(this.ctx,"remote_index_not_ready"),new Error("Remote index not ready");let u=AA(r),d=Promise.all(l.map(async P=>{Lh(n);let D=await e.resolveQuery(n),N=new Bqt.StopWatch,B=await this._githubCodeSearchService.searchRepo(c,this._embeddingType,P,D,u,n);return A3.info(this.ctx,`Search completed for ${P.owner}/${P.name}`,{searchTime:N.elapsed(),chunkCount:B.chunks.length}),B})),f=await this._localDiffSearch.getLocalDiff(r.workspaceFolders),h=new Set(f),m=this._localDiffSearch.shouldDoLocalDiffSearch(f,r.workspaceFolders);A3.info(this.ctx,"Local diff files detected",{diffFileCount:f.length,allowLocalDiffSearch:m});let g;m&&(g=(0,mCn.raceTimeout)(this._localDiffSearch.searchLocalDiff(f,e,r,n),this.localDiffSearchTimeout,()=>{A3.warn(this.ctx,"Local diff search timed out",{timeout:this.localDiffSearchTimeout})}));let[A,y]=await Promise.all([d,g?.catch(P=>{A3.error(this.ctx,"Local diff search failed",P)})??Promise.resolve(void 0)]),E=(0,hCn.coalesce)(A).flatMap(P=>P.chunks),_=y?.isOk()?y.val.result.chunks:[],v=_.length>0?[...E.filter(P=>!h.has(P.chunk.file)),..._]:E,b=v.length,w=new Set(v.map(P=>P.chunk.file)).size,R=o.elapsed();A3.info(this.ctx,`Search completed successfully in ${R}ms`,{totalTime:R,totalChunkCount:b,uniqueFileCount:w,indexedRepoCount:l.length,localDiffChunkCount:_.length,localDiffStrategy:y?.isOk()?y.val.strategy:"none"});let x=y?.isOk()?"mixed":"codesearch";return Z0.sendRemoteSuccess(this.ctx,R,b,w,x),{chunks:v}}};p();p();var dSn=require("node:url"),fSn=require("path");p();var pJe=fe(ACn(),1);p();var Lqt=new WeakMap;function wle(...t){let e=new String(t);return Lqt.set(e,t),e}a(wle,"c");function Fx(t){return t instanceof String&&Lqt.has(t)}a(Fx,"r");function Rle(t){return Lqt.get(t)??[]}a(Rle,"o");var dJe=fe(SCn(),1),e1n=require("child_process");var F1n=fe(qqt(),1),Y1n=require("node:path");p();function*TCn(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}a(TCn,"U");var y$o=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),E$o=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),_$o=new Set(["edit","remove-section","rename-section","set","unset"]),v$o=new Set(["get","get-color","get-colorbool","list"]);function C$o(t,e){for(let{name:n}of TCn(t,"task")){if(y$o.has(n))return Nle(!0,e);if(E$o.has(n))return Nle(!1,e)}let r=e.at(0)?.toLowerCase();return r===void 0?null:_$o.has(r)?Nle(!0,e.slice(1)):v$o.has(r)?Nle(!1,e.slice(1)):e.length===1?Nle(!1,e):Nle(!0,e)}a(C$o,"F");function Nle(t=!1,e=[]){let r=e.at(0)?.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}a(Nle,"p");function b$o(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}a(b$o,"A");function S$o(t){let e=t?.indexOf("=")||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}a(S$o,"M");function T$o(t){for(let{name:e}of TCn(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}a(T$o,"N");function I$o({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}a(I$o,"G");function*x$o(t){for(let e of t){let r=I$o(e),n=r&&S$o(e.value);n&&(yield{...n,scope:r})}}a(x$o,"O");function w$o(t,e,r){let n={read:[],write:[...x$o(e)]};return t==="config"&&R$o(n,T$o(e),C$o(e,r)),n}a(w$o,"L");function R$o(t,e,r){if(r===null)return;let n=b$o(e,r);r.isWrite?t.write.push(n):t.read.push(n)}a(R$o,"$");var ICn={short:new Map([["c",!0]])},P$o={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...ICn.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},k$o={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},D$o={short:new Map,long:new Set};function N$o(t){let e=k$o[t??""]??D$o;return{short:new Map([...ICn.short.entries(),...e.short.entries()]),long:e.long}}a(N$o,"I");function xCn(t,e=P$o){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let n=t.slice(2);return[{name:t,needsNext:e.long.has(n)}]}if(t.length===2){let r=t.charAt(1),n=e.short.get(r);return[{name:t,needsNext:n===!0}]}return M$o(t,e.short)}a(xCn,"b");function M$o(t,e){let r=t.slice(1).split(""),n=[];for(let o=0;oe.has(u)))return n.push({name:`-${s}`,value:l,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:c})}return n}a(M$o,"W");function O$o(t,e=[]){let r=0;for(;ra(function(){return t&&(e=(0,t[ujt(t)[0]])(t=0)),e},"__init"),"__esm"),K$o=a((t,e)=>a(function(){return e||(0,t[ujt(t)[0]])((e={exports:{}}).exports,e),e.exports},"__require"),"__commonJS"),Wh=a((t,e)=>{for(var r in e)ljt(t,r,{get:e[r],enumerable:!0})},"__export"),J$o=a((t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ujt(e))!Y$o.call(t,o)&&o!==r&&ljt(t,o,{get:a(()=>e[o],"get"),enumerable:!(n=z$o(e,o))||n.enumerable});return t},"__copyProps"),Wp=a(t=>J$o(ljt({},"__esModule",{value:!0}),t),"__toCommonJS"),y3,tq=Jr({"src/lib/errors/git-error.ts"(){"use strict";y3=class extends Error{static{a(this,"GitError")}constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),jIe,Lle=Jr({"src/lib/errors/git-response-error.ts"(){"use strict";tq(),jIe=class extends y3{static{a(this,"GitResponseError")}constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),lbn,ubn=Jr({"src/lib/errors/task-configuration-error.ts"(){"use strict";tq(),lbn=class extends y3{static{a(this,"TaskConfigurationError")}constructor(t){super(void 0,t)}}}});function dbn(t){return typeof t!="function"?AK:t}a(dbn,"asFunction");function fbn(t){return typeof t=="function"&&t!==AK}a(fbn,"isUserFunction");function pbn(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}a(pbn,"splitOn");function hbn(t,e=0){return mbn(t)&&t.length>e?t[e]:void 0}a(hbn,"first");function gK(t,e=0){if(mbn(t)&&t.length>e)return t[t.length-1-e]}a(gK,"last");function mbn(t){return AJe(t)}a(mbn,"isArrayLike");function HIe(t="",e=!0,r=` +`){return t.split(r).reduce((n,o)=>{let s=e?o.trim():o;return s&&n.push(s),n},[])}a(HIe,"toLinesWithContent");function djt(t,e){return HIe(t,!0).map(r=>e(r))}a(djt,"forEachLineWithContent");function fjt(t){return(0,pJe.exists)(t,pJe.FOLDER)}a(fjt,"folderExists");function qx(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}a(qx,"append");function gbn(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}a(gbn,"including");function hJe(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}a(hJe,"remove");function sO(t){return Array.isArray(t)?t:[t]}a(sO,"asArray");function Abn(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}a(Abn,"asCamelCase");function Fle(t){return sO(t).map(e=>e instanceof String?e:String(e))}a(Fle,"asStringArray");function du(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}a(du,"asNumber");function QIe(t,e){let r=[];for(let n=0,o=t.length;n{t[n]!==void 0&&(r[n]=t[n])}),r}a(ybn,"pick");function zqt(t=0){return new Promise(e=>setTimeout(e,t))}a(zqt,"delay");function Yqt(t){if(t!==!1)return t}a(Yqt,"orVoid");var Ole,AK,GIe,mJe=Jr({"src/lib/utils/util.ts"(){"use strict";pjt(),Ole="\0",AK=a(()=>{},"NOOP"),GIe=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Zy(t,e,r){return e(t)?t:arguments.length>2?r:void 0}a(Zy,"filterType");function Kqt(t,e){let r=Fx(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}a(Kqt,"filterPrimitives");function gJe(t){return!!t&&GIe(t)==="[object Object]"}a(gJe,"filterPlainObject");function Ebn(t){return typeof t=="function"}a(Ebn,"filterFunction");var $Ie,_bn,rp,lJe,AJe,pjt=Jr({"src/lib/utils/argument-filters.ts"(){"use strict";mJe(),$Ie=a(t=>Array.isArray(t),"filterArray"),_bn=a(t=>typeof t=="number","filterNumber"),rp=a(t=>typeof t=="string"||Fx(t),"filterString"),lJe=a(t=>rp(t)||Array.isArray(t)&&t.every(rp),"filterStringOrStringArray"),AJe=a(t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number","filterHasLength")}}),Jqt,Z$o=Jr({"src/lib/utils/exit-codes.ts"(){"use strict";Jqt=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(Jqt||{})}}),uJe,X$o=Jr({"src/lib/utils/git-output-streams.ts"(){"use strict";uJe=class vbn{static{a(this,"_GitOutputStreams")}constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new vbn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function eVo(){throw new Error("LineParser:useMatches not implemented")}a(eVo,"useMatchesDefault");var Po,eq,tVo=Jr({"src/lib/utils/line-parser.ts"(){"use strict";Po=class{static{a(this,"LineParser")}constructor(t,e){this.matches=[],this.useMatches=eVo,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((o,s)=>this.addMatch(o,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},eq=class extends Po{static{a(this,"RemoteLineParser")}addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function Cbn(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...bbn},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}a(Cbn,"createInstanceConfig");var bbn,rVo=Jr({"src/lib/utils/simple-git-options.ts"(){"use strict";bbn={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function hjt(t,e=[]){return gJe(t)?Object.keys(t).reduce((r,n)=>{let o=t[n];if(Fx(o))r.push(o);else if(Kqt(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o))for(let s of o)Kqt(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}a(hjt,"appendTaskOptions");function N_(t,e=0,r=!1){let n=[];for(let o=0,s=e<0?t.length:e;o{for(let s=HIe(o,n),c=0,l=s.length;c{if(!(c+d>=l))return s[c+d]},"line");e.some(({parse:d})=>d(u,t))}}),t}a(NC,"parseStringResponse");var oVo=Jr({"src/lib/utils/task-parser.ts"(){"use strict";mJe()}}),Sbn={};Wh(Sbn,{ExitCodes:a(()=>Jqt,"ExitCodes"),GitOutputStreams:a(()=>uJe,"GitOutputStreams"),LineParser:a(()=>Po,"LineParser"),NOOP:a(()=>AK,"NOOP"),NULL:a(()=>Ole,"NULL"),RemoteLineParser:a(()=>eq,"RemoteLineParser"),append:a(()=>qx,"append"),appendTaskOptions:a(()=>hjt,"appendTaskOptions"),asArray:a(()=>sO,"asArray"),asCamelCase:a(()=>Abn,"asCamelCase"),asFunction:a(()=>dbn,"asFunction"),asNumber:a(()=>du,"asNumber"),asStringArray:a(()=>Fle,"asStringArray"),bufferToString:a(()=>qIe,"bufferToString"),callTaskParser:a(()=>Zqt,"callTaskParser"),createInstanceConfig:a(()=>Cbn,"createInstanceConfig"),delay:a(()=>zqt,"delay"),filterArray:a(()=>$Ie,"filterArray"),filterFunction:a(()=>Ebn,"filterFunction"),filterHasLength:a(()=>AJe,"filterHasLength"),filterNumber:a(()=>_bn,"filterNumber"),filterPlainObject:a(()=>gJe,"filterPlainObject"),filterPrimitives:a(()=>Kqt,"filterPrimitives"),filterString:a(()=>rp,"filterString"),filterStringOrStringArray:a(()=>lJe,"filterStringOrStringArray"),filterType:a(()=>Zy,"filterType"),first:a(()=>hbn,"first"),folderExists:a(()=>fjt,"folderExists"),forEachLineWithContent:a(()=>djt,"forEachLineWithContent"),getTrailingOptions:a(()=>N_,"getTrailingOptions"),including:a(()=>gbn,"including"),isUserFunction:a(()=>fbn,"isUserFunction"),last:a(()=>gK,"last"),objectToString:a(()=>GIe,"objectToString"),orVoid:a(()=>Yqt,"orVoid"),parseStringResponse:a(()=>NC,"parseStringResponse"),pick:a(()=>ybn,"pick"),prefixedArray:a(()=>QIe,"prefixedArray"),remove:a(()=>hJe,"remove"),splitOn:a(()=>pbn,"splitOn"),toLinesWithContent:a(()=>HIe,"toLinesWithContent"),trailingFunctionArgument:a(()=>kd,"trailingFunctionArgument"),trailingOptionsArgument:a(()=>mjt,"trailingOptionsArgument")});var oo=Jr({"src/lib/utils/index.ts"(){"use strict";pjt(),Z$o(),X$o(),tVo(),rVo(),iVo(),oVo(),mJe()}}),Tbn={};Wh(Tbn,{CheckRepoActions:a(()=>Xqt,"CheckRepoActions"),checkIsBareRepoTask:a(()=>xbn,"checkIsBareRepoTask"),checkIsRepoRootTask:a(()=>Ibn,"checkIsRepoRootTask"),checkIsRepoTask:a(()=>sVo,"checkIsRepoTask")});function sVo(t){switch(t){case"bare":return xbn();case"root":return Ibn()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:yJe,parser:gjt}}a(sVo,"checkIsRepoTask");function Ibn(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:yJe,parser(e){return/^\.(git)?$/.test(e.trim())}}}a(Ibn,"checkIsRepoRootTask");function xbn(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:yJe,parser:gjt}}a(xbn,"checkIsBareRepoTask");function aVo(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}a(aVo,"isNotRepoMessage");var Xqt,yJe,gjt,wbn=Jr({"src/lib/tasks/check-is-repo.ts"(){"use strict";oo(),Xqt=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(Xqt||{}),yJe=a(({exitCode:t},e,r,n)=>{if(t===128&&aVo(e))return r(Buffer.from("false"));n(e)},"onError"),gjt=a(t=>t.trim()==="true","parser")}});function cVo(t,e){let r=new Rbn(t),n=t?kbn:Pbn;return HIe(e).forEach(o=>{let s=o.replace(n,"");r.paths.push(s),(Dbn.test(s)?r.folders:r.files).push(s)}),r}a(cVo,"cleanSummaryParser");var Rbn,Pbn,kbn,Dbn,lVo=Jr({"src/lib/responses/CleanSummary.ts"(){"use strict";oo(),Rbn=class{static{a(this,"CleanResponse")}constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},Pbn=/^[a-z]+\s*/i,kbn=/^[a-z]+\s+[a-z]+\s*/i,Dbn=/\/$/}}),ejt={};Wh(ejt,{EMPTY_COMMANDS:a(()=>EJe,"EMPTY_COMMANDS"),adhocExecTask:a(()=>Nbn,"adhocExecTask"),configurationErrorTask:a(()=>DC,"configurationErrorTask"),isBufferTask:a(()=>Obn,"isBufferTask"),isEmptyTask:a(()=>Bbn,"isEmptyTask"),straightThroughBufferTask:a(()=>Mbn,"straightThroughBufferTask"),straightThroughStringTask:a(()=>M_,"straightThroughStringTask")});function Nbn(t){return{commands:EJe,format:"empty",parser:t}}a(Nbn,"adhocExecTask");function DC(t){return{commands:EJe,format:"empty",parser(){throw typeof t=="string"?new lbn(t):t}}}a(DC,"configurationErrorTask");function M_(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}a(M_,"straightThroughStringTask");function Mbn(t){return{commands:t,format:"buffer",parser(e){return e}}}a(Mbn,"straightThroughBufferTask");function Obn(t){return t.format==="buffer"}a(Obn,"isBufferTask");function Bbn(t){return t.format==="empty"||!t.commands.length}a(Bbn,"isEmptyTask");var EJe,zp=Jr({"src/lib/tasks/task.ts"(){"use strict";ubn(),EJe=[]}}),Lbn={};Wh(Lbn,{CONFIG_ERROR_INTERACTIVE_MODE:a(()=>Ajt,"CONFIG_ERROR_INTERACTIVE_MODE"),CONFIG_ERROR_MODE_REQUIRED:a(()=>yjt,"CONFIG_ERROR_MODE_REQUIRED"),CONFIG_ERROR_UNKNOWN_OPTION:a(()=>Ejt,"CONFIG_ERROR_UNKNOWN_OPTION"),CleanOptions:a(()=>oJe,"CleanOptions"),cleanTask:a(()=>Fbn,"cleanTask"),cleanWithOptionsTask:a(()=>uVo,"cleanWithOptionsTask"),isCleanOptionsArray:a(()=>dVo,"isCleanOptionsArray")});function uVo(t,e){let{cleanMode:r,options:n,valid:o}=fVo(t);return r?o.options?(n.push(...e),n.some(mVo)?DC(Ajt):Fbn(r,n)):DC(Ejt+JSON.stringify(t)):DC(yjt)}a(uVo,"cleanWithOptionsTask");function Fbn(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(n){return cVo(t==="n",n)}}}a(Fbn,"cleanTask");function dVo(t){return Array.isArray(t)&&t.every(e=>_jt.has(e))}a(dVo,"isCleanOptionsArray");function fVo(t){let e,r=[],n={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(o=>{pVo(o)?(e=o,n.cleanMode=!0):n.options=n.options&&hVo(r[r.length]=`-${o}`)}),{cleanMode:e,options:r,valid:n}}a(fVo,"getCleanOptions");function pVo(t){return t==="f"||t==="n"}a(pVo,"isCleanMode");function hVo(t){return/^-[a-z]$/i.test(t)&&_jt.has(t.charAt(1))}a(hVo,"isKnownOption");function mVo(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}a(mVo,"isInteractiveMode");var Ajt,yjt,Ejt,oJe,_jt,Ubn=Jr({"src/lib/tasks/clean.ts"(){"use strict";lVo(),oo(),zp(),Ajt="Git clean interactive mode is not supported",yjt='Git clean mode parameter ("n" or "f") is required',Ejt="Git clean unknown option found in: ",oJe=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(oJe||{}),_jt=new Set(["i",...Fle(Object.values(oJe))])}});function gVo(t){let e=new qbn;for(let r of Qbn(t))e.addValue(r.file,String(r.key),r.value);return e}a(gVo,"configListParser");function AVo(t,e){let r=null,n=[],o=new Map;for(let s of Qbn(t,e))s.key===e&&(n.push(r=s.value),o.has(s.file)||o.set(s.file,[]),o.get(s.file).push(r));return{key:e,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}a(AVo,"configGetParser");function yVo(t){return t.replace(/^(file):/,"")}a(yVo,"configFilePath");function*Qbn(t,e=null){let r=t.split("\0");for(let n=0,o=r.length-1;nObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=gK(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function jqt(t,e){return typeof t=="string"&&Object.hasOwn(tjt,t)?t:e}a(jqt,"asConfigScope");function _Vo(t,e,r,n){let o=["config",`--${n}`];return r&&o.push("--add"),o.push(t,e),{commands:o,format:"utf-8",parser(s){return s}}}a(_Vo,"addConfigTask");function vVo(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return AVo(n,t)}}}a(vVo,"getConfigTask");function CVo(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return gVo(r)}}}a(CVo,"listConfigTask");function bVo(){return{addConfig(t,e,...r){return this._runTask(_Vo(t,e,r[0]===!0,jqt(r[1],"local")),kd(arguments))},getConfig(t,e){return this._runTask(vVo(t,jqt(e,void 0)),kd(arguments))},listConfig(...t){return this._runTask(CVo(jqt(t[0],void 0)),kd(arguments))}}}a(bVo,"config_default");var tjt,jbn=Jr({"src/lib/tasks/config.ts"(){"use strict";EVo(),oo(),tjt=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(tjt||{})}});function SVo(t){return Hbn.has(t)}a(SVo,"isDiffNameStatus");var Hqt,Hbn,Gbn=Jr({"src/lib/tasks/diff-name-status.ts"(){"use strict";Hqt=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Hqt||{}),Hbn=new Set(Object.values(Hqt))}});function TVo(...t){return new Vbn().param(...t)}a(TVo,"grepQueryBuilder");function IVo(t){let e=new Set,r={};return djt(t,n=>{let[o,s,c]=n.split(Ole);e.add(o),(r[o]=r[o]||[]).push({line:du(s),path:o,preview:c})}),{paths:e,results:r}}a(IVo,"parseGrep");function xVo(){return{grep(t){let e=kd(arguments),r=N_(arguments);for(let o of $bn)if(r.includes(o))return this._runTask(DC(`git.grep: use of "${o}" is not supported.`),e);typeof t=="string"&&(t=TVo().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(o){return IVo(o)}},e)}}}a(xVo,"grep_default");var $bn,UIe,DCn,Vbn,Wbn=Jr({"src/lib/tasks/grep.ts"(){"use strict";oo(),zp(),$bn=["-h"],UIe=Symbol("grepQuery"),Vbn=class{static{a(this,"GrepQuery")}constructor(){this[DCn]=[]}*[(DCn=UIe,Symbol.iterator)](){for(let t of this[UIe])yield t}and(...t){return t.length&&this[UIe].push("--and","(",...QIe(t,"-e"),")"),this}param(...t){return this[UIe].push(...QIe(t,"-e")),this}}}}),zbn={};Wh(zbn,{ResetMode:a(()=>sJe,"ResetMode"),getResetMode:a(()=>RVo,"getResetMode"),resetTask:a(()=>wVo,"resetTask")});function wVo(t,e){let r=["reset"];return Ybn(t)&&r.push(`--${t}`),r.push(...e),M_(r)}a(wVo,"resetTask");function RVo(t){if(Ybn(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}a(RVo,"getResetMode");function Ybn(t){return typeof t=="string"&&Kbn.includes(t)}a(Ybn,"isValidResetMode");var sJe,Kbn,Jbn=Jr({"src/lib/tasks/reset.ts"(){"use strict";oo(),zp(),sJe=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(sJe||{}),Kbn=Fle(Object.values(sJe))}});function PVo(){return(0,dJe.default)("simple-git")}a(PVo,"createLog");function NCn(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...o)=>{t(n,...o),r(n,...o)}:t:(n,...o)=>{t(`%s ${n}`,e,...o),r&&r(n,...o)}}a(NCn,"prefixedLogger");function kVo(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}a(kVo,"childLoggerName");function vjt(t,e,r,n=PVo()){let o=t&&`[${t}]`||"",s=[],c=typeof e=="string"?n.extend(e):e,l=kVo(Zy(e,rp),c,n);return d(r);function u(f,h){return qx(s,vjt(t,l.replace(/^[^:]+/,f),h,n))}function d(f){let h=f&&`[${f}]`||"",m=c&&NCn(c,h)||AK,g=NCn(n,`${o} ${h}`,m);return Object.assign(c?m:g,{label:t,sibling:u,info:g,step:d})}}a(vjt,"createLogger");var Zbn=Jr({"src/lib/git-logger.ts"(){"use strict";oo(),dJe.default.formatters.L=t=>String(AJe(t)?t.length:"-"),dJe.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):GIe(t)}}),Xbn,DVo=Jr({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";tq(),Zbn(),Xbn=class rjt{static{a(this,"_TasksPendingQueue")}constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let r=rjt.getName(e.commands[0]),n=vjt(this.logLabel,r);return{task:e,logger:n,name:r}}push(e){let r=this.createProgress(e);return r.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,r),r}fatal(e){for(let[r,{logger:n}]of Array.from(this._queue.entries()))r===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(r);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let r=this.withProgress(e);if(!r)throw new y3(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(e="empty"){return`task:${e}:${++rjt.counter}`}static{this.counter=0}}}});function mK(t,e){return{method:hbn(t.commands)||"",commands:e}}a(mK,"pluginContext");function NVo(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}a(NVo,"onErrorReceived");function MCn(t,e,r,n){return o=>{r("%s received %L bytes",e,o),n("%B",o),t.push(o)}}a(MCn,"onDataReceived");var njt,MVo=Jr({"src/lib/runners/git-executor-chain.ts"(){"use strict";tq(),zp(),oo(),DVo(),njt=class{static{a(this,"GitExecutorChain")}constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Xbn}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=a(()=>this._queue.complete(t),"onQueueComplete");try{let{logger:n}=this._queue.attempt(t);return await(Bbn(t)?this.attemptEmptyTask(t,n):this.attemptRemoteTask(t,n))}catch(n){throw this.onFatalException(t,n)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof y3?Object.assign(e,{task:t}):new y3(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",mK(t,t.commands)),n=this._plugins.exec("spawn.args",[...t.commands],{...mK(t,t.commands),env:{...this.env}}),o=await this.gitResponse(t,r,n,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,n,o,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),Obn(t)?Zqt(t.parser,s):Zqt(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,n){let{exitCode:o,rejection:s,stdOut:c,stdErr:l}=r;return new Promise((u,d)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:f}=this._plugins.exec("task.error",{error:s},{...mK(t,e),...r});if(f&&t.onError)return n.info("exitCode=%s handling with custom error handler"),t.onError(r,f,h=>{n.info("custom error handler treated as success"),n("custom error returned a %s",GIe(h)),u(new uJe(Array.isArray(h)?Buffer.concat(h):h,Buffer.concat(l)))},d);if(f)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,l.length,s),d(f);n.info("retrieving task output complete"),u(new uJe(Buffer.concat(c),Buffer.concat(l)))})}async gitResponse(t,e,r,n,o){let s=o.sibling("output"),c=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},mK(t,t.commands));return new Promise(l=>{let u=[],d=[];o.info("%s %o",e,r),o("%O",c);let f=this._beforeSpawn(t,r);if(f)return l({stdOut:u,stdErr:d,exitCode:9901,rejection:f});this._plugins.exec("spawn.before",void 0,{...mK(t,r),kill(m){f=m||f}});let h=(0,e1n.spawn)(e,r,c);h.stdout.on("data",MCn(u,"stdOut",o,s.step("stdOut"))),h.stderr.on("data",MCn(d,"stdErr",o,s.step("stdErr"))),h.on("error",NVo(d,o)),n&&(o("Passing child process stdOut/stdErr to custom outputHandler"),n(e,h.stdout,h.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...mK(t,r),spawned:h,close(m,g){l({stdOut:u,stdErr:d,exitCode:m,rejection:f||g})},kill(m){h.killed||(f=m,h.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...mK(t,e),kill(n){r=n||r}}),r}}}}),t1n={};Wh(t1n,{GitExecutor:a(()=>r1n,"GitExecutor")});var r1n,OVo=Jr({"src/lib/runners/git-executor.ts"(){"use strict";MVo(),r1n=class{static{a(this,"GitExecutor")}constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new njt(this,this._scheduler,this._plugins)}chain(){return new njt(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function BVo(t,e,r=AK){let n=a(s=>{r(null,s)},"onSuccess"),o=a(s=>{s?.task===t&&r(s instanceof jIe?LVo(s):s,void 0)},"onError2");e.then(n,o)}a(BVo,"taskCallback");function LVo(t){let e=a(n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),e=AK},"log");return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(n,o){return o in t||(n[o]={enumerable:!1,configurable:!1,get(){return e(o),t.git[o]}}),n}}a(LVo,"addDeprecationNoticeToError");var FVo=Jr({"src/lib/task-callback.ts"(){"use strict";Lle(),oo()}});function OCn(t,e){return Nbn(r=>{if(!fjt(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}a(OCn,"changeWorkingDirectoryTask");var UVo=Jr({"src/lib/tasks/change-working-directory.ts"(){"use strict";oo(),zp()}});function Gqt(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=hJe(e,"-B")),M_(e)}a(Gqt,"checkoutTask");function QVo(){return{checkout(){return this._runTask(Gqt(N_(arguments,1)),kd(arguments))},checkoutBranch(t,e){return this._runTask(Gqt(["-b",t,e,...N_(arguments)]),kd(arguments))},checkoutLocalBranch(t){return this._runTask(Gqt(["-b",t,...N_(arguments)]),kd(arguments))}}}a(QVo,"checkout_default");var qVo=Jr({"src/lib/tasks/checkout.ts"(){"use strict";oo(),zp()}});function jVo(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}a(jVo,"countObjectsResponse");function HVo(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return NC(jVo(),[n1n],t)}})}}}a(HVo,"count_objects_default");var n1n,GVo=Jr({"src/lib/tasks/count-objects.ts"(){"use strict";oo(),n1n=new Po(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let n=Abn(e);Object.hasOwn(t,n)&&(t[n]=du(r))})}});function $Vo(t){return NC({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},i1n,t)}a($Vo,"parseCommitResult");var i1n,VVo=Jr({"src/lib/parsers/parse-commit.ts"(){"use strict";oo(),i1n=[new Po(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,n])=>{t.branch=e,t.commit=n,t.root=!!r}),new Po(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),n=r.pop();!n||!n.includes("@")||(t.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new Po(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(n,10)||0}),new Po(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,n])=>{t.summary.changes=parseInt(e,10)||0;let o=parseInt(r,10)||0;n==="-"?t.summary.deletions=o:n==="+"&&(t.summary.insertions=o)})]}});function WVo(t,e,r){return{commands:["-c","core.abbrev=40","commit",...QIe(t,"-m"),...e,...r],format:"utf-8",parser:$Vo}}a(WVo,"commitTask");function zVo(){return{commit(e,...r){let n=kd(arguments),o=t(e)||WVo(sO(e),sO(Zy(r[0],lJe,[])),[...Fle(Zy(r[1],$Ie,[])),...N_(arguments,0,!0)]);return this._runTask(o,n)}};function t(e){return!lJe(e)&&DC("git.commit: requires the commit message to be supplied as a string/string[]")}}a(zVo,"commit_default");var YVo=Jr({"src/lib/tasks/commit.ts"(){"use strict";VVo(),oo(),zp()}});function KVo(){return{firstCommit(){return this._runTask(M_(["rev-list","--max-parents=0","HEAD"],!0),kd(arguments))}}}a(KVo,"first_commit_default");var JVo=Jr({"src/lib/tasks/first-commit.ts"(){"use strict";oo(),zp()}});function ZVo(t,e){let r=["hash-object",t];return e&&r.push("-w"),M_(r,!0)}a(ZVo,"hashObjectTask");var XVo=Jr({"src/lib/tasks/hash-object.ts"(){"use strict";zp()}});function eWo(t,e,r){let n=String(r).trim(),o;if(o=o1n.exec(n))return new aJe(t,e,!1,o[1]);if(o=s1n.exec(n))return new aJe(t,e,!0,o[1]);let s="",c=n.split(" ");for(;c.length;)if(c.shift()==="in"){s=c.join(" ");break}return new aJe(t,e,/^re/i.test(n),s)}a(eWo,"parseInit");var aJe,o1n,s1n,tWo=Jr({"src/lib/responses/InitSummary.ts"(){"use strict";aJe=class{static{a(this,"InitSummary")}constructor(t,e,r,n){this.bare=t,this.path=e,this.existing=r,this.gitDir=n}},o1n=/^Init.+ repository in (.+)$/,s1n=/^Rein.+ in (.+)$/}});function rWo(t){return t.includes(Cjt)}a(rWo,"hasBareCommand");function nWo(t=!1,e,r){let n=["init",...r];return t&&!rWo(n)&&n.splice(1,0,Cjt),{commands:n,format:"utf-8",parser(o){return eWo(n.includes("--bare"),e,o)}}}a(nWo,"initTask");var Cjt,iWo=Jr({"src/lib/tasks/init.ts"(){"use strict";tWo(),Cjt="--bare"}});function bjt(t){for(let e=0;eNC(new a1n,e,r,!1)}a(c1n,"getDiffParser");var $qt,BCn,LCn,FCn,l1n,u1n=Jr({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";VIe(),sWo(),Gbn(),oo(),$qt=[new Po(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,n=""])=>{t.files.push({file:e.trim(),changes:du(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new Po(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,n])=>{t.files.push({file:e.trim(),before:du(r),after:du(n),binary:!0})}),new Po(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);t.changed=du(e),t.insertions=du(n?.[1]),t.deletions=du(o?.[1])})],BCn=[new Po(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,n])=>{let o=du(e),s=du(r);t.changed++,t.insertions+=o,t.deletions+=s,t.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new Po(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],LCn=[new Po(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],FCn=[new Po(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,n,o,s])=>{t.changed++,t.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:Yqt(SVo(e)&&e),from:Yqt(!!s&&n!==s&&n),similarity:du(r)})})],l1n={"":$qt,"--stat":$qt,"--numstat":BCn,"--name-status":FCn,"--name-only":LCn}}});function aWo(t,e){return e.reduce((r,n,o)=>(r[n]=t[o]||"",r),Object.create({diff:null}))}a(aWo,"lineBuilder");function d1n(t=xjt,e=f1n,r=""){let n=c1n(r);return function(o){let s=HIe(o.trim(),!1,Tjt).map(function(c){let l=c.split(Ijt),u=aWo(l[0].split(t),e);return l.length>1&&l[1].trim()&&(u.diff=n(l[1])),u});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}a(d1n,"createListLogSummaryParser");var Tjt,Ijt,xjt,f1n,p1n=Jr({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oo(),u1n(),VIe(),Tjt="\xF2\xF2\xF2\xF2\xF2\xF2 ",Ijt=" \xF2\xF2",xjt=" \xF2 ",f1n=["hash","date","message","refs","author_name","author_email"]}}),h1n={};Wh(h1n,{diffSummaryTask:a(()=>cWo,"diffSummaryTask"),validateLogFormatConfig:a(()=>_Je,"validateLogFormatConfig")});function cWo(t){let e=bjt(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),_Je(r)||{commands:r,format:"utf-8",parser:c1n(e)}}a(cWo,"diffSummaryTask");function _Je(t){let e=t.filter(oWo);if(e.length>1)return DC(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return DC(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}a(_Je,"validateLogFormatConfig");var wjt=Jr({"src/lib/tasks/diff.ts"(){"use strict";VIe(),u1n(),zp()}});function lWo(t,e){let r=[],n=[];return Object.keys(t).forEach(o=>{r.push(o),n.push(String(t[o]))}),[r,n.join(e)]}a(lWo,"prettyFormat");function uWo(t){return Object.keys(t).reduce((e,r)=>(r in ijt||(e[r]=t[r]),e),{})}a(uWo,"userOptions");function m1n(t={},e=[]){let r=Zy(t.splitter,rp,xjt),n=gJe(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[o,s]=lWo(n,r),c=[],l=[`--pretty=format:${Tjt}${s}${Ijt}`,...e],u=t.n||t["max-count"]||t.maxCount;if(u&&l.push(`--max-count=${u}`),t.from||t.to){let d=t.symmetric!==!1?"...":"..";c.push(`${t.from||""}${d}${t.to||""}`)}return rp(t.file)&&l.push("--follow",wle(t.file)),hjt(uWo(t),l),{fields:o,splitter:r,commands:[...l,...c]}}a(m1n,"parseLogOptions");function dWo(t,e,r){let n=d1n(t,e,bjt(r));return{commands:["log",...r],format:"utf-8",parser:n}}a(dWo,"logTask");function fWo(){return{log(...r){let n=kd(arguments),o=m1n(mjt(arguments),Fle(Zy(arguments[0],$Ie,[]))),s=e(...r)||_Je(o.commands)||t(o);return this._runTask(s,n)}};function t(r){return dWo(r.splitter,r.fields,r.commands)}function e(r,n){return rp(r)&&rp(n)&&DC("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}a(fWo,"log_default");var ijt,g1n=Jr({"src/lib/tasks/log.ts"(){"use strict";VIe(),p1n(),oo(),zp(),wjt(),ijt=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(ijt||{})}}),cJe,A1n,pWo=Jr({"src/lib/responses/MergeSummary.ts"(){"use strict";cJe=class{static{a(this,"MergeSummaryConflict")}constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},A1n=class{static{a(this,"MergeSummaryDetail")}constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),ojt,y1n,hWo=Jr({"src/lib/responses/PullSummary.ts"(){"use strict";ojt=class{static{a(this,"PullSummary")}constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},y1n=class{static{a(this,"PullFailedSummary")}constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Vqt(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}a(Vqt,"objectEnumerationResult");function UCn(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:du(e&&e[1]||"0"),delta:du(r&&r[1]||"0")}}a(UCn,"asObjectCount");var E1n,mWo=Jr({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oo(),E1n=[new eq(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Vqt(t.remoteMessages);Object.assign(o,{[n]:du(r)})}),new eq(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let n=e.toLowerCase(),o=Vqt(t.remoteMessages);Object.assign(o,{[n]:du(r)})}),new eq(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,n])=>{let o=Vqt(t.remoteMessages);o.total=UCn(e),o.reused=UCn(r),o.packReused=du(n)})]}});function _1n(t,e){return NC({remoteMessages:new C1n},v1n,e)}a(_1n,"parseRemoteMessages");var v1n,C1n,b1n=Jr({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oo(),mWo(),v1n=[new eq(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...E1n,new eq([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new eq([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,n])=>{t.remoteMessages.vulnerabilities={count:du(e),summary:r,url:n}})],C1n=class{static{a(this,"RemoteMessageSummary")}constructor(){this.all=[]}}}});function gWo(t,e){let r=NC(new y1n,S1n,[t,e]);return r.message&&r}a(gWo,"parsePullErrorResult");var QCn,qCn,jCn,HCn,S1n,GCn,Rjt,T1n=Jr({"src/lib/parsers/parse-pull.ts"(){"use strict";hWo(),oo(),b1n(),QCn=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,qCn=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,jCn=/^(create|delete) mode \d+ (.+)/,HCn=[new Po(QCn,(t,[e,r,n])=>{t.files.push(e),r&&(t.insertions[e]=r.length),n&&(t.deletions[e]=n.length)}),new Po(qCn,(t,[e,,r,,n])=>r!==void 0||n!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+n||0,!0):!1),new Po(jCn,(t,[e,r])=>{qx(t.files,r),qx(e==="create"?t.created:t.deleted,r)})],S1n=[new Po(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new Po(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new Po(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,n,o])=>{t.branch.local=n,t.hash.local=e,t.branch.remote=o,t.hash.remote=r})],GCn=a((t,e)=>NC(new ojt,HCn,[t,e]),"parsePullDetail"),Rjt=a((t,e)=>Object.assign(new ojt,GCn(t,e),_1n(t,e)),"parsePullResult")}}),$Cn,I1n,VCn,AWo=Jr({"src/lib/parsers/parse-merge.ts"(){"use strict";pWo(),oo(),T1n(),$Cn=[new Po(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new Po(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new cJe(e,r))}),new Po(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,n])=>{t.conflicts.push(new cJe(e,r,{deleteRef:n}))}),new Po(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new cJe(e,null))}),new Po(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],I1n=a((t,e)=>Object.assign(VCn(t,e),Rjt(t,e)),"parseMergeResult"),VCn=a(t=>NC(new A1n,$Cn,t),"parseMergeDetail")}});function WCn(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let n=I1n(e,r);if(n.failed)throw new jIe(n);return n}}:DC("Git.merge requires at least one option")}a(WCn,"mergeTask");var yWo=Jr({"src/lib/tasks/merge.ts"(){"use strict";Lle(),AWo(),zp()}});function EWo(t,e,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:t,remote:e}}a(EWo,"pushResultPushedItem");var zCn,x1n,YCn,_Wo=Jr({"src/lib/parsers/parse-push.ts"(){"use strict";oo(),b1n(),zCn=[new Po(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new Po(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new Po(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,n])=>{t.pushed.push(EWo(e,r,n))}),new Po(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,n])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:n}}),new Po(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,n,o])=>{t.update={head:{local:e,remote:r},hash:{from:n,to:o}}})],x1n=a((t,e)=>{let r=YCn(t,e),n=_1n(t,e);return{...r,...n}},"parsePushResult"),YCn=a((t,e)=>NC({pushed:[]},zCn,[t,e]),"parsePushDetail")}}),w1n={};Wh(w1n,{pushTagsTask:a(()=>vWo,"pushTagsTask"),pushTask:a(()=>Pjt,"pushTask")});function vWo(t={},e){return qx(e,"--tags"),Pjt(t,e)}a(vWo,"pushTagsTask");function Pjt(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),hJe(r,"-v"),qx(r,"--verbose"),qx(r,"--porcelain"),{commands:r,format:"utf-8",parser:x1n}}a(Pjt,"pushTask");var R1n=Jr({"src/lib/tasks/push.ts"(){"use strict";_Wo(),oo()}});function CWo(){return{showBuffer(){let t=["show",...N_(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(Mbn(t),kd(arguments))},show(){let t=["show",...N_(arguments,1)];return this._runTask(M_(t),kd(arguments))}}}a(CWo,"show_default");var bWo=Jr({"src/lib/tasks/show.ts"(){"use strict";oo(),zp()}}),KCn,P1n,SWo=Jr({"src/lib/responses/FileStatusSummary.ts"(){"use strict";KCn=/^(.+)\0(.+)$/,P1n=class{static{a(this,"FileStatusSummary")}constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let n=KCn.exec(t)||[null,t,t];this.from=n[2]||"",this.path=n[1]||""}}}}});function JCn(t){let[e,r]=t.split(Ole);return{from:r||e,to:e}}a(JCn,"renamedFile");function NS(t,e,r){return[`${t}${e}`,r]}a(NS,"parser3");function Wqt(t,...e){return e.map(r=>NS(t,r,(n,o)=>n.conflicted.push(o)))}a(Wqt,"conflicts");function TWo(t,e){let r=e.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,c){let l=`${o}${s}`,u=k1n.get(l);u&&u(t,c),l!=="##"&&l!=="!!"&&t.files.push(new P1n(c,o,s))}a(n,"data")}a(TWo,"splitLine");var ZCn,k1n,D1n,IWo=Jr({"src/lib/responses/StatusSummary.ts"(){"use strict";oo(),SWo(),ZCn=class{static{a(this,"StatusSummary")}constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},k1n=new Map([NS(" ","A",(t,e)=>t.created.push(e)),NS(" ","D",(t,e)=>t.deleted.push(e)),NS(" ","M",(t,e)=>t.modified.push(e)),NS("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),NS("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),NS("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),NS("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),NS("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),NS("R"," ",(t,e)=>{t.renamed.push(JCn(e))}),NS("R","M",(t,e)=>{let r=JCn(e);t.renamed.push(r),t.modified.push(r.to)}),NS("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),NS("?","?",(t,e)=>t.not_added.push(e)),...Wqt("A","A","U"),...Wqt("D","D","U"),...Wqt("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,c=/\son\s(\S+?)(?=\.{3}|$)/,l=r.exec(e);t.ahead=l&&+l[1]||0,l=n.exec(e),t.behind=l&&+l[1]||0,l=o.exec(e),t.current=Zy(l?.[1],rp,null),l=s.exec(e),t.tracking=Zy(l?.[1],rp,null),l=c.exec(e),l&&(t.current=Zy(l?.[1],rp,t.current)),t.detached=/\(no branch\)/.test(e)}]]),D1n=a(function(t){let e=t.split(Ole),r=new ZCn;for(let n=0,o=e.length;n!N1n.includes(r))],parser(r){return D1n(r)}}}a(xWo,"statusTask");var N1n,wWo=Jr({"src/lib/tasks/status.ts"(){"use strict";IWo(),N1n=["--null","-z"]}});function fJe(t=0,e=0,r=0,n="",o=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}a(fJe,"versionResponse");function RWo(){return fJe(0,0,0,"",!1)}a(RWo,"notInstalledResponse");function PWo(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:kWo,onError(t,e,r,n){if(t.exitCode===-2)return r(Buffer.from(kjt));n(e)}})}}}a(PWo,"version_default");function kWo(t){return t===kjt?RWo():NC(fJe(0,0,0,t),M1n,t)}a(kWo,"versionParser");var kjt,M1n,DWo=Jr({"src/lib/tasks/version.ts"(){"use strict";oo(),kjt="installed=false",M1n=[new Po(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,n,o=""])=>{Object.assign(t,fJe(du(e),du(r),du(n),o))}),new Po(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,n,o=""])=>{Object.assign(t,fJe(du(e),du(r),n,o))})]}});function XCn(t,e,r,...n){return rp(r)?e(r,Zy(n[0],rp),N_(arguments)):DC(`git.${t}() requires a string 'repoPath'`)}a(XCn,"createCloneTask");function NWo(){return{clone(t,...e){return this._runTask(XCn("clone",sjt,Zy(t,rp),...e),kd(arguments))},mirror(t,...e){return this._runTask(XCn("mirror",O1n,Zy(t,rp),...e),kd(arguments))}}}a(NWo,"clone_default");var sjt,O1n,MWo=Jr({"src/lib/tasks/clone.ts"(){"use strict";zp(),oo(),sjt=a((t,e,r)=>{let n=["clone",...r];return rp(t)&&n.push(wle(t)),rp(e)&&n.push(wle(e)),M_(n)},"cloneTask"),O1n=a((t,e,r)=>(qx(r,"--mirror"),sjt(t,e,r)),"cloneMirrorTask")}}),B1n={};Wh(B1n,{SimpleGitApi:a(()=>ajt,"SimpleGitApi")});var ajt,OWo=Jr({"src/lib/simple-git-api.ts"(){"use strict";FVo(),UVo(),qVo(),GVo(),YVo(),jbn(),JVo(),Wbn(),XVo(),iWo(),g1n(),yWo(),R1n(),bWo(),wWo(),zp(),DWo(),oo(),MWo(),ajt=class{static{a(this,"SimpleGitApi")}constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),n=r.push(t);return e&&BVo(t,n,e),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(t){return this._runTask(M_(["add",...sO(t)]),kd(arguments))}cwd(t){let e=kd(arguments);return typeof t=="string"?this._runTask(OCn(t,this._executor),e):typeof t?.path=="string"?this._runTask(OCn(t.path,t.root&&this._executor||void 0),e):this._runTask(DC("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(ZVo(t,e===!0),kd(arguments))}init(t){return this._runTask(nWo(t===!0,this._executor.cwd,N_(arguments)),kd(arguments))}merge(){return this._runTask(WCn(N_(arguments)),kd(arguments))}mergeFromTo(t,e){return rp(t)&&rp(e)?this._runTask(WCn([t,e,...N_(arguments)]),kd(arguments,!1)):this._runTask(DC("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Pjt({remote:Zy(arguments[0],rp),branch:Zy(arguments[1],rp)},N_(arguments));return this._runTask(t,kd(arguments))}stash(){return this._runTask(M_(["stash",...N_(arguments)]),kd(arguments))}status(){return this._runTask(xWo(N_(arguments)),kd(arguments))}},Object.assign(ajt.prototype,QVo(),NWo(),zVo(),bVo(),HVo(),KVo(),xVo(),fWo(),CWo(),PWo())}}),L1n={};Wh(L1n,{Scheduler:a(()=>U1n,"Scheduler")});var ebn,U1n,BWo=Jr({"src/lib/runners/scheduler.ts"(){"use strict";oo(),Zbn(),ebn=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,F1n.createDeferred)();return{promise:e,done:r,id:t}}})(),U1n=class{static{a(this,"Scheduler")}constructor(t=2){this.concurrency=t,this.logger=vjt("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=qx(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),hJe(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=qx(this.pending,ebn());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),Q1n={};Wh(Q1n,{applyPatchTask:a(()=>LWo,"applyPatchTask")});function LWo(t,e){return M_(["apply",...e,...t])}a(LWo,"applyPatchTask");var FWo=Jr({"src/lib/tasks/apply-patch.ts"(){"use strict";zp()}});function UWo(t,e){return{branch:t,hash:e,success:!0}}a(UWo,"branchDeletionSuccess");function QWo(t){return{branch:t,hash:null,success:!1}}a(QWo,"branchDeletionFailure");var q1n,qWo=Jr({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";q1n=class{static{a(this,"BranchDeletionBatch")}constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function j1n(t,e){return e===1&&cjt.test(t)}a(j1n,"hasBranchDeletionError");var tbn,cjt,rbn,vJe,jWo=Jr({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";qWo(),oo(),tbn=/(\S+)\s+\(\S+\s([^)]+)\)/,cjt=/^error[^']+'([^']+)'/m,rbn=[new Po(tbn,(t,[e,r])=>{let n=UWo(e,r);t.all.push(n),t.branches[e]=n}),new Po(cjt,(t,[e])=>{let r=QWo(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],vJe=a((t,e)=>NC(new q1n,rbn,[t,e]),"parseBranchDeletions")}}),H1n,HWo=Jr({"src/lib/responses/BranchSummary.ts"(){"use strict";H1n=class{static{a(this,"BranchSummaryResult")}constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,n,o){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:n,label:o}}}}});function nbn(t){return t?t.charAt(0):""}a(nbn,"branchStatus");function G1n(t,e=!1){return NC(new H1n,e?[V1n]:$1n,t)}a(G1n,"parseBranchSummary");var $1n,V1n,GWo=Jr({"src/lib/parsers/parse-branch.ts"(){"use strict";HWo(),oo(),$1n=[new Po(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,n,o])=>{t.push(nbn(e),!0,r,n,o)}),new Po(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,n,o])=>{t.push(nbn(e),!1,r,n,o)})],V1n=new Po(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),W1n={};Wh(W1n,{branchLocalTask:a(()=>VWo,"branchLocalTask"),branchTask:a(()=>$Wo,"branchTask"),containsDeleteBranchCommand:a(()=>z1n,"containsDeleteBranchCommand"),deleteBranchTask:a(()=>zWo,"deleteBranchTask"),deleteBranchesTask:a(()=>WWo,"deleteBranchesTask")});function z1n(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}a(z1n,"containsDeleteBranchCommand");function $Wo(t){let e=z1n(t),r=t.includes("--show-current"),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(o,s){return e?vJe(o,s).all[0]:G1n(o,r)}}}a($Wo,"branchTask");function VWo(){return{format:"utf-8",commands:["branch","-v"],parser(t){return G1n(t)}}}a(VWo,"branchLocalTask");function WWo(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,n){return vJe(r,n)},onError({exitCode:r,stdOut:n},o,s,c){if(!j1n(String(o),r))return c(o);s(n)}}}a(WWo,"deleteBranchesTask");function zWo(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(n,o){return vJe(n,o).branches[t]},onError({exitCode:n,stdErr:o,stdOut:s},c,l,u){if(!j1n(String(c),n))return u(c);throw new jIe(r.parser(qIe(s),qIe(o)),String(c))}};return r}a(zWo,"deleteBranchTask");var YWo=Jr({"src/lib/tasks/branch.ts"(){"use strict";Lle(),jWo(),GWo(),oo()}});function KWo(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,Y1n.normalize)(e)}a(KWo,"toPath");var K1n,JWo=Jr({"src/lib/responses/CheckIgnore.ts"(){"use strict";K1n=a(t=>t.split(/\n/g).map(KWo).filter(Boolean),"parseCheckIgnore")}}),J1n={};Wh(J1n,{checkIgnoreTask:a(()=>ZWo,"checkIgnoreTask")});function ZWo(t){return{commands:["check-ignore",...t],format:"utf-8",parser:K1n}}a(ZWo,"checkIgnoreTask");var XWo=Jr({"src/lib/tasks/check-ignore.ts"(){"use strict";JWo()}});function ezo(t,e){return NC({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},Z1n,[t,e])}a(ezo,"parseFetchResult");var Z1n,tzo=Jr({"src/lib/parsers/parse-fetch.ts"(){"use strict";oo(),Z1n=[new Po(/From (.+)$/,(t,[e])=>{t.remote=e}),new Po(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new Po(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new Po(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new Po(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,n,o])=>{t.updated.push({name:n,tracking:o,to:r,from:e})})]}}),X1n={};Wh(X1n,{fetchTask:a(()=>nzo,"fetchTask")});function rzo(t){return/^--upload-pack(=|$)/.test(t)}a(rzo,"disallowedCommand");function nzo(t,e,r){let n=["fetch",...r];return t&&e&&n.push(t,e),n.find(rzo)?DC("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:ezo}}a(nzo,"fetchTask");var izo=Jr({"src/lib/tasks/fetch.ts"(){"use strict";tzo(),zp()}});function ozo(t){return NC({moves:[]},eSn,t)}a(ozo,"parseMoveResult");var eSn,szo=Jr({"src/lib/parsers/parse-move.ts"(){"use strict";oo(),eSn=[new Po(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),tSn={};Wh(tSn,{moveTask:a(()=>azo,"moveTask")});function azo(t,e){return{commands:["mv","-v",...sO(t),e],format:"utf-8",parser:ozo}}a(azo,"moveTask");var czo=Jr({"src/lib/tasks/move.ts"(){"use strict";szo(),oo()}}),rSn={};Wh(rSn,{pullTask:a(()=>lzo,"pullTask")});function lzo(t,e,r){let n=["pull",...r];return t&&e&&n.splice(1,0,t,e),{commands:n,format:"utf-8",parser(o,s){return Rjt(o,s)},onError(o,s,c,l){let u=gWo(qIe(o.stdOut),qIe(o.stdErr));if(u)return l(new jIe(u));l(s)}}}a(lzo,"pullTask");var uzo=Jr({"src/lib/tasks/pull.ts"(){"use strict";Lle(),T1n(),oo()}});function dzo(t){let e={};return nSn(t,([r])=>e[r]={name:r}),Object.values(e)}a(dzo,"parseGetRemotes");function fzo(t){let e={};return nSn(t,([r,n,o])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),o&&n&&(e[r].refs[o.replace(/[^a-z]/g,"")]=n)}),Object.values(e)}a(fzo,"parseGetRemotesVerbose");function nSn(t,e){djt(t,r=>e(r.split(/\s+/)))}a(nSn,"forEach");var pzo=Jr({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oo()}}),iSn={};Wh(iSn,{addRemoteTask:a(()=>hzo,"addRemoteTask"),getRemotesTask:a(()=>mzo,"getRemotesTask"),listRemotesTask:a(()=>gzo,"listRemotesTask"),remoteTask:a(()=>Azo,"remoteTask"),removeRemoteTask:a(()=>yzo,"removeRemoteTask")});function hzo(t,e,r){return M_(["remote","add",...r,t,e])}a(hzo,"addRemoteTask");function mzo(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?fzo:dzo}}a(mzo,"getRemotesTask");function gzo(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),M_(e)}a(gzo,"listRemotesTask");function Azo(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),M_(e)}a(Azo,"remoteTask");function yzo(t){return M_(["remote","remove",t])}a(yzo,"removeRemoteTask");var Ezo=Jr({"src/lib/tasks/remote.ts"(){"use strict";pzo(),zp()}}),oSn={};Wh(oSn,{stashListTask:a(()=>_zo,"stashListTask")});function _zo(t={},e){let r=m1n(t),n=["stash","list",...r.commands,...e],o=d1n(r.splitter,r.fields,bjt(n));return _Je(n)||{commands:n,format:"utf-8",parser:o}}a(_zo,"stashListTask");var vzo=Jr({"src/lib/tasks/stash-list.ts"(){"use strict";VIe(),p1n(),wjt(),g1n()}}),sSn={};Wh(sSn,{addSubModuleTask:a(()=>Czo,"addSubModuleTask"),initSubModuleTask:a(()=>bzo,"initSubModuleTask"),subModuleTask:a(()=>CJe,"subModuleTask"),updateSubModuleTask:a(()=>Szo,"updateSubModuleTask")});function Czo(t,e){return CJe(["add",t,e])}a(Czo,"addSubModuleTask");function bzo(t){return CJe(["init",...t])}a(bzo,"initSubModuleTask");function CJe(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),M_(e)}a(CJe,"subModuleTask");function Szo(t){return CJe(["update",...t])}a(Szo,"updateSubModuleTask");var Tzo=Jr({"src/lib/tasks/sub-module.ts"(){"use strict";zp()}});function Izo(t,e){let r=Number.isNaN(t),n=Number.isNaN(e);return r!==n?r?1:-1:r?aSn(t,e):0}a(Izo,"singleSorted");function aSn(t,e){return t===e?0:t>e?1:-1}a(aSn,"sorted");function xzo(t){return t.trim()}a(xzo,"trimmed");function iJe(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}a(iJe,"toNumber");var ibn,cSn,wzo=Jr({"src/lib/responses/TagList.ts"(){"use strict";ibn=class{static{a(this,"TagList")}constructor(t,e){this.all=t,this.latest=e}},cSn=a(function(t,e=!1){let r=t.split(` +`).map(xzo).filter(Boolean);e||r.sort(function(o,s){let c=o.split("."),l=s.split(".");if(c.length===1||l.length===1)return Izo(iJe(c[0]),iJe(l[0]));for(let u=0,d=Math.max(c.length,l.length);uo.indexOf(".")>=0);return new ibn(r,n)},"parseTagList")}}),lSn={};Wh(lSn,{addAnnotatedTagTask:a(()=>kzo,"addAnnotatedTagTask"),addTagTask:a(()=>Pzo,"addTagTask"),tagListTask:a(()=>Rzo,"tagListTask")});function Rzo(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return cSn(r,e)}}}a(Rzo,"tagListTask");function Pzo(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}a(Pzo,"addTagTask");function kzo(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}a(kzo,"addAnnotatedTagTask");var Dzo=Jr({"src/lib/tasks/tag.ts"(){"use strict";wzo()}}),Nzo=K$o({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(OVo(),Wp(t1n)),{SimpleGitApi:n}=(OWo(),Wp(B1n)),{Scheduler:o}=(BWo(),Wp(L1n)),{adhocExecTask:s,configurationErrorTask:c}=(zp(),Wp(ejt)),{asArray:l,filterArray:u,filterPrimitives:d,filterString:f,filterStringOrStringArray:h,filterType:m,getTrailingOptions:g,trailingFunctionArgument:A,trailingOptionsArgument:y}=(oo(),Wp(Sbn)),{applyPatchTask:E}=(FWo(),Wp(Q1n)),{branchTask:_,branchLocalTask:v,deleteBranchesTask:b,deleteBranchTask:T}=(YWo(),Wp(W1n)),{checkIgnoreTask:w}=(XWo(),Wp(J1n)),{checkIsRepoTask:R}=(wbn(),Wp(Tbn)),{cleanWithOptionsTask:x,isCleanOptionsArray:P}=(Ubn(),Wp(Lbn)),{diffSummaryTask:D}=(wjt(),Wp(h1n)),{fetchTask:N}=(izo(),Wp(X1n)),{moveTask:B}=(czo(),Wp(tSn)),{pullTask:L}=(uzo(),Wp(rSn)),{pushTagsTask:j}=(R1n(),Wp(w1n)),{addRemoteTask:M,getRemotesTask:O,listRemotesTask:q,remoteTask:Q,removeRemoteTask:U}=(Ezo(),Wp(iSn)),{getResetMode:z,resetTask:W}=(Jbn(),Wp(zbn)),{stashListTask:$}=(vzo(),Wp(oSn)),{addSubModuleTask:J,initSubModuleTask:ne,subModuleTask:H,updateSubModuleTask:re}=(Tzo(),Wp(sSn)),{addAnnotatedTagTask:ae,addTagTask:Oe,tagListTask:ve}=(Dzo(),Wp(lSn)),{straightThroughBufferTask:Fe,straightThroughStringTask:Pe}=(zp(),Wp(ejt));function Z(ee,K){this._plugins=K,this._executor=new r(ee.baseDir,new o(ee.maxConcurrentProcesses),K),this._trimmed=ee.trimmed}a(Z,"Git2"),(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(ee){return this._plugins.reconfigure("binary",ee),this},Z.prototype.env=function(ee,K){return arguments.length===1&&typeof ee=="object"?this._executor.env=ee:(this._executor.env=this._executor.env||{})[ee]=K,this},Z.prototype.stashList=function(ee){return this._runTask($(y(arguments)||{},u(ee)&&ee||[]),A(arguments))},Z.prototype.mv=function(ee,K){return this._runTask(B(ee,K),A(arguments))},Z.prototype.checkoutLatestTag=function(ee){var K=this;return this.pull(function(){K.tags(function(pe,X){K.checkout(X.latest,ee)})})},Z.prototype.pull=function(ee,K,pe,X){return this._runTask(L(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.prototype.fetch=function(ee,K){return this._runTask(N(m(ee,f),m(K,f),g(arguments)),A(arguments))},Z.prototype.silent=function(ee){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Z.prototype.tags=function(ee,K){return this._runTask(ve(g(arguments)),A(arguments))},Z.prototype.rebase=function(){return this._runTask(Pe(["rebase",...g(arguments)]),A(arguments))},Z.prototype.reset=function(ee){return this._runTask(W(z(ee),g(arguments)),A(arguments))},Z.prototype.revert=function(ee){let K=A(arguments);return typeof ee!="string"?this._runTask(c("Commit must be a string"),K):this._runTask(Pe(["revert",...g(arguments,0,!0),ee]),K)},Z.prototype.addTag=function(ee){let K=typeof ee=="string"?Oe(ee):c("Git.addTag requires a tag name");return this._runTask(K,A(arguments))},Z.prototype.addAnnotatedTag=function(ee,K){return this._runTask(ae(ee,K),A(arguments))},Z.prototype.deleteLocalBranch=function(ee,K,pe){return this._runTask(T(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.deleteLocalBranches=function(ee,K,pe){return this._runTask(b(ee,typeof K=="boolean"?K:!1),A(arguments))},Z.prototype.branch=function(ee,K){return this._runTask(_(g(arguments)),A(arguments))},Z.prototype.branchLocal=function(ee){return this._runTask(v(),A(arguments))},Z.prototype.raw=function(ee){let K=!Array.isArray(ee),pe=[].slice.call(K?arguments:ee,0);for(let ue=0;ueconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},Z.prototype.checkIgnore=function(ee,K){return this._runTask(w(l(m(ee,h,[]))),A(arguments))},Z.prototype.checkIsRepo=function(ee,K){return this._runTask(R(m(ee,f)),A(arguments))},e.exports=Z}});tq();var Mzo=class extends y3{static{a(this,"GitConstructError")}constructor(t,e){super(void 0,e),this.config=t}};tq();tq();var Ble=class extends y3{static{a(this,"GitPluginError")}constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};Lle();ubn();wbn();Ubn();jbn();Gbn();Wbn();Jbn();function Ozo(t){return t?[{type:"spawn.before",action(n,o){t.aborted&&o.kill(new Ble(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Ble(void 0,"abort","Abort signal received"))}a(s,"kill"),t.addEventListener("abort",s),o.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}a(Ozo,"abortPlugin");function Bzo(t={}){return{type:"spawn.args",action(e,{env:r}){for(let n of kCn(e,r))if(t[n.category]!==!0)throw new Ble(void 0,"unsafe",n.message);return e}}}a(Bzo,"blockUnsafeOperationsPlugin");oo();function Lzo(t){let e=QIe(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}a(Lzo,"commandConfigPrefixingPlugin");oo();var obn=(0,Mle.deferred)().promise;function Fzo({onClose:t=!0,onExit:e=50}={}){function r(){let o=-1,s={close:(0,Mle.deferred)(),closeTimeout:(0,Mle.deferred)(),exit:(0,Mle.deferred)(),exitTimeout:(0,Mle.deferred)()},c=Promise.race([t===!1?obn:s.closeTimeout.promise,e===!1?obn:s.exitTimeout.promise]);return n(t,s.close,s.closeTimeout),n(e,s.exit,s.exitTimeout),{close(l){o=l,s.close.done()},exit(l){o=l,s.exit.done()},get exitCode(){return o},result:c}}a(r,"createEvents");function n(o,s,c){o!==!1&&(o===!0?s.promise:s.promise.then(()=>zqt(o))).then(c.done)}return a(n,"configureTimeout"),{type:"spawn.after",async action(o,{spawned:s,close:c}){let l=r(),u=!0,d=a(()=>{u=!1},"quickClose");s.stdout?.on("data",d),s.stderr?.on("data",d),s.on("error",d),s.on("close",f=>l.close(f)),s.on("exit",f=>l.exit(f));try{await l.result,u&&await zqt(50),c(l.exitCode)}catch(f){c(l.exitCode,f)}}}}a(Fzo,"completionDetectionPlugin");oo();var Uzo="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",sbn="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function Qzo(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}a(Qzo,"isBadArgument");function abn(t,e){if(t.length<1||t.length>2)throw new Ble(void 0,"binary",Uzo);if(t.some(Qzo))if(e)console.warn(sbn);else throw new Ble(void 0,"binary",sbn);let[n,o]=t;return{binary:n,prefix:o}}a(abn,"toBinaryConfig");function qzo(t,e=["git"],r=!1){let n=abn(sO(e),r);t.on("binary",o=>{n=abn(sO(o),r)}),t.append("spawn.binary",()=>n.binary),t.append("spawn.args",o=>n.prefix?[n.prefix,...o]:o)}a(qzo,"customBinaryPlugin");tq();function jzo(t){return!!(t.exitCode&&t.stdErr.length)}a(jzo,"isTaskError");function Hzo(t){return Buffer.concat([...t.stdOut,...t.stdErr])}a(Hzo,"getErrorMessage");function Gzo(t=!1,e=jzo,r=Hzo){return(n,o)=>!t&&n||!e(o)?n:r(o)}a(Gzo,"errorDetectionHandler");function cbn(t){return{type:"task.error",action(e,r){let n=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new y3(void 0,n.toString("utf-8"))}:{error:n}}}}a(cbn,"errorDetectionPlugin");oo();var $zo=class{static{a(this,"PluginStore")}constructor(){this.plugins=new Set,this.events=new uSn.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=qx(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return sO(t).forEach(r=>r&&this.plugins.add(qx(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let n=e,o=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(n=s.action(n,o));return n}};oo();function Vzo(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,c){return r.includes(c.method)?gbn(s,e):s}},{type:"spawn.after",action(s,c){c.commands.includes(e)&&c.spawned.stderr?.on("data",l=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));u&&t({method:c.method,stage:Wzo(u[1]),progress:du(u[2]),processed:du(u[3]),total:du(u[4])})})}}]}a(Vzo,"progressMonitorPlugin");function Wzo(t){return String(t.toLowerCase().split(" ",1))||"unknown"}a(Wzo,"progressEventStage");oo();function zzo(t){let e=ybn(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}a(zzo,"spawnOptionsPlugin");function Yzo({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(n,o){let s;function c(){s&&clearTimeout(s),s=setTimeout(u,t)}a(c,"wait");function l(){o.spawned.stdout?.off("data",c),o.spawned.stderr?.off("data",c),o.spawned.off("exit",l),o.spawned.off("close",l),s&&clearTimeout(s)}a(l,"stop");function u(){l(),o.kill(new Ble(void 0,"timeout","block timeout reached"))}a(u,"kill"),r&&o.spawned.stdout?.on("data",c),e&&o.spawned.stderr?.on("data",c),o.spawned.on("exit",l),o.spawned.on("close",l),c()}}}a(Yzo,"timeoutPlugin");function Kzo(){return{type:"spawn.args",action(t){let e=[],r;function n(o){(r=r||[]).push(...o)}a(n,"append2");for(let o=0;oFx(c)&&Rle(c)||c));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}a(Kzo,"suffixPathsPlugin");oo();var Jzo=Nzo();function Zzo(t,e){let r=new $zo,n=Cbn(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!fjt(n.baseDir))throw new Mzo(n,"Cannot use simple-git on a directory that does not exist");return Array.isArray(n.config)&&r.add(Lzo(n.config)),r.add(Bzo(n.unsafe)),r.add(Fzo(n.completion)),n.abort&&r.add(Ozo(n.abort)),n.progress&&r.add(Vzo(n.progress)),n.timeout&&r.add(Yzo(n.timeout)),n.spawnOptions&&r.add(zzo(n.spawnOptions)),r.add(Kzo()),r.add(cbn(Gzo(!0))),n.errors&&r.add(cbn(n.errors)),qzo(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new Jzo(n,r)}a(Zzo,"gitInstanceFactory");Lle();var bJe=Zzo;var jx=new Ae("Git Service");var SJe=class t{constructor(e){this.ctx=e;this.gitInstances=new Map;this._upstreamCache=new Map}static{a(this,"GitService")}static{this._upstreamCacheTtlMs=300*1e3}async getGitInstance(e){let r=this.normalizeRepoPath(e),n=this.gitInstances.get(r);if(!n){let o=(await _Q()).path;n=bJe({baseDir:r,binary:o,unsafe:{allowUnsafeCustomBinary:!0}}),this.gitInstances.set(r,n)}return n}constructFileUri(e,r){let n=this.normalizeRepoPath(e),o=(0,fSn.join)(n,r);return ba(o)}parseStatus(e){switch(e){case"M":return 2;case"A":return 0;case"D":return 3;case"R":return 1;default:return 2}}parseDiffOutput(e,r){let n=[],o=r.split("\0").filter(s=>s.length>0);for(let s=0;s=o.length){jx.warn(this.ctx,`Malformed git diff output: rename status without both paths at position ${s}. Output: ${r}`);continue}let f=o[s+1],h=o[s+2];if(!f||!h){jx.warn(this.ctx,`Malformed git diff output: empty path(s) for rename at position ${s}. Paths: [${f}, ${h}]. Output: ${r}`);continue}let m=this.constructFileUri(e,f),g=this.constructFileUri(e,h);n.push({uri:g,originalUri:m,renameUri:g,status:1}),s+=2}else{if(s+1>=o.length){jx.warn(this.ctx,`Malformed git diff output: status without path at position ${s}. Status: ${u}. Output: ${r}`);continue}let f=o[s+1];if(!f){jx.warn(this.ctx,`Malformed git diff output: empty file path at position ${s}. Status: ${u}. Output: ${r}`);continue}let h=this.constructFileUri(e,f);n.push({uri:h,originalUri:h,renameUri:void 0,status:d}),s+=1}}return n}async diffWith(e,r){try{let o=await(await this.getGitInstance(e)).raw(["diff","--name-status","-z","--diff-filter=ADMR",r,"--"]);return!o||o.trim().length===0?[]:this.parseDiffOutput(e,o)}catch(n){jx.warn(this.ctx,`Failed to diff with ${r} for ${e}`,n);return}}async hasUpstream(e){let r=this.normalizeRepoPath(e),n=this._upstreamCache.get(r),o=Date.now();if(n&&o-n.checkedAt0}catch(o){return jx.warn(this.ctx,`Failed to query upstream config for ${e}`,o),!1}}clearUpstreamCache(e){e?this._upstreamCache.delete(this.normalizeRepoPath(e)):this._upstreamCache.clear()}async diffWithIndexedCommit(e,r){try{if(r){let o=await this.diffWith(e,r);if(o)return{changes:o,mayBeOutdated:!1};jx.warn(this.ctx,`Failed to diff with indexed commit ${r}, falling back to upstream`)}if(!await this.hasUpstream(e)){jx.debug(this.ctx,`No upstream branch configured for ${e}, cannot determine changes`);return}let n=await this.diffWith(e,"@{upstream}");return n?{changes:n,mayBeOutdated:!0}:void 0}catch(n){jx.warn(this.ctx,`Failed to diff with indexed commit for ${e}`,n);return}}normalizeRepoPath(e){if(e.startsWith("file://"))try{return(0,dSn.fileURLToPath)(e)}catch(r){jx.warn(this.ctx,`Failed to convert URI to path: ${e}, attempting fallback`,r);try{let n=new URL(e),o=decodeURIComponent(n.pathname);return process.platform==="win32"&&/^\/[a-zA-Z]:/.test(o)&&(o=o.slice(1).replace(/\//g,"\\")),o}catch(n){return jx.error(this.ctx,`Failed to parse URI with fallback: ${e}`,n),e}}return e}dispose(){this.gitInstances.clear(),this._upstreamCache.clear()}};var pSn=fe(zc());var xk=new Ae("Local Diff Tracker");var TJe=class t{constructor(e,r,n){this.ctx=e;this._workspaceFileIndex=r;this._githubCodeSearchService=n;this._repos=new Map;this._locallyChangedFiles=new Set;this._fileWatcherDisposables=[];this._gitService=new SJe(e),this._repositoryManager=e.get(z0),this._diffRefreshTimer=new pSn.IntervalTimer}static{a(this,"CodeSearchWorkspaceDiffTracker")}static{this._diffRefreshInterval=1e3*60*2}static{this._diffRefreshMaxInterval=1e3*60*30}static{this._maxDiffFiles=1e4}async initialize(){return this._initializePromise??=this.doInitialize(),this._initializePromise}async doInitialize(){try{xk.info(this.ctx,"Initializing Local Diff Tracker"),await this._workspaceFileIndex.initialize();let e=a(n=>{for(let o of n)this._locallyChangedFiles.add(o)},"addFiles");this._fileWatcherDisposables.push(this._workspaceFileIndex.onDidCreateFiles(e),this._workspaceFileIndex.onDidChangeFiles(e),this._workspaceFileIndex.onDidDeleteFiles(n=>{for(let o of n)this._locallyChangedFiles.delete(o)}));let r=await this._repositoryManager.getRepo({uri:this._workspaceFileIndex.workspaceFolder.uri});r||(r=await this.tryInferRepoFromFiles()),r&&r.isGitHub()&&r.owner&&r.name?await this.openRepo(r):xk.info(this.ctx,`Workspace folder ${this._workspaceFileIndex.workspaceFolder.uri} is not a GitHub repository`)}catch(e){xk.error(this.ctx,"Initialization failed",e)}}async tryInferRepoFromFiles(){try{let e=Array.from(this._workspaceFileIndex.values());if(e.length===0)return;for(let r=0;r{this.refreshRepoDiffs()},t._diffRefreshInterval),await this.refreshRepoDiff(n)}async tryGetDiffedIndexedFiles(e,r){let n=await this.tryGetDiff(e,r);if(!n)return;let o=new Set,s=n.changes.slice(0,t._maxDiffFiles);for(let c of s){let l=c.uri;this._workspaceFileIndex.get(l)&&o.add(l)}return o}async tryGetDiff(e,r){try{let n=e.baseFolder.uri,o=await this._gitService.diffWithIndexedCommit(n,r);return o?{changes:o.changes,mayBeOutdated:o.mayBeOutdated}:void 0}catch(n){xk.error(this.ctx,`Failed to get diff for ${e.baseFolder.uri}`,n);return}}async refreshRepoDiffs(){let e=Date.now(),r=Array.from(this._repos.values(),n=>n).filter(n=>n.nextRefreshAt<=e);await Promise.all(r.map(n=>this.refreshRepoDiff(n)))}getNextRefreshDelay(e){if(e<=0)return t._diffRefreshInterval;let r=Math.min(e,5),n=t._diffRefreshInterval*Math.pow(2,r);return Math.min(n,t._diffRefreshMaxInterval)}async refreshRepoDiff(e){try{let r=this._githubCodeSearchService.getIndexedCommit(e.repo.baseFolder.uri),n=await this.tryGetDiffedIndexedFiles(e.repo,r);if(n){e.initialChanges.clear();for(let c of n)e.initialChanges.add(c);let o=e.repo.baseFolder.uri,s=[];for(let c of this._locallyChangedFiles)if(c.startsWith(o)){let l=this._workspaceFileIndex.get(c);(!l||!l.isDirty())&&s.push(c)}for(let c of s)this._locallyChangedFiles.delete(c);(e.state===1||e.consecutiveFailures>0)&&xk.info(this.ctx,`Diff refresh recovered for ${e.repo.baseFolder.uri}`),e.state=2,e.consecutiveFailures=0,e.lastErrorKey=void 0}else this.handleDiffFailure(e,"no-diff",`Failed to get new diff for ${e.repo.baseFolder.uri}.`)}catch(r){this.handleDiffFailure(e,"exception",`Failed to refresh diff for ${e.repo.baseFolder.uri}.`,r)}finally{e.nextRefreshAt=Date.now()+this.getNextRefreshDelay(e.consecutiveFailures)}}handleDiffFailure(e,r,n,o){e.state=1,e.consecutiveFailures++;let s=e.lastErrorKey!==r;e.lastErrorKey=r,s?o!==void 0?xk.warn(this.ctx,n,o):xk.warn(this.ctx,n):o!==void 0?xk.debug(this.ctx,n,o):xk.debug(this.ctx,n)}dispose(){this._diffRefreshTimer.dispose(),this._gitService.dispose(),this._fileWatcherDisposables.forEach(e=>e.dispose())}};p();p();var rq;(n=>{function t(o){return new Djt(o)}n.ok=t,a(t,"ok");function e(o){return new Njt(o)}n.error=e,a(e,"error");function r(o){return n.error(new Error(o))}n.fromString=r,a(r,"fromString")})(rq||={});var Djt=class t{constructor(e){this.val=e}static{a(this,"ResultOk")}map(e){return new t(e(this.val))}flatMap(e){return e(this.val)}isOk(){return!0}isError(){return!1}},Njt=class{constructor(e){this.err=e}static{a(this,"ResultError")}map(e){return this}flatMap(e){return this}isOk(){return!1}isError(){return!0}};var Mjt=new Ae("GithubAvailableEmbeddingTypes"),IJe=class{constructor(e){this._ctx=e;this._cached=this._ctx.get(Ut).getGitHubSession().then(r=>r?this.doGetAvailableTypes(r):rq.error({type:"noSession"}))}static{a(this,"GithubAvailableEmbeddingTypesManager")}async getAllAvailableTypes(){if(this._cached){let e=this._cached;try{let r=await this._cached;if(r.isOk())return r}catch{}this._cached===e&&(this._cached=void 0)}return this._cached??=(async()=>{let e=await this._ctx.get(Ut).getGitHubSession();return e?await this.doGetAvailableTypes(e):rq.error({type:"noSession"})})(),this._cached}async doGetAvailableTypes(e){let r;try{let c=Ile(this._ctx);r=await Lf(this._ctx,e,"embeddings/models",{headers:c,method:"GET"})}catch(c){return Mjt.error(this._ctx,"Error fetching available embedding types",c),rq.error({type:"requestFailed",error:c})}if(!r.ok)return r.status===401||r.status===404?rq.error({type:"unauthorized",status:r.status}):rq.error({type:"badResponse",status:r.status});let n=await r.json(),o=[],s=[];for(let c of n.models){let l=new kC(c.id);c.active===!1?s.push(l):o.push(l)}return rq.ok({primary:o,deprecated:s})}async getPreferredType(){let e=await this.getAllAvailableTypes();if(!e.isOk()){Mjt.info(this._ctx,`Could not find any available embedding types. Error: ${e.err.type}`);return}let r=e.val;return Mjt.info(this._ctx,`Got embeddings. Primary: ${r.primary.join(",")}. Deprecated: ${r.deprecated.join(",")}`),r.primary.at(0)??r.deprecated.at(0)}};p();var Xzo=new Ae("GithubEmbeddingComputer"),Ule=class{constructor(e){this.ctx=e;this.batchSize=100}static{a(this,"GithubEmbeddingComputer")}async computeEmbeddings(e,r,n,o){try{let s=await this.ctx.get(Ut).getGitHubSession();if(!s)throw new Error("No GitHub session available");let c=[],l;for(let u=0;u0&&(l=f[0].type),c.push(...f)}if(!l)throw new Error("No embedding type resolved from API response");return{type:l,values:c}}catch(s){Xzo.error(this.ctx,"Error computing embeddings:",s);return}}async fetchBatchEmbeddings(e,r,n,o,s){try{let c={inputs:n};if(r&&(c.embedding_model=r.id),o?.inputType&&(c.input_type=o.inputType),s?.isCancellationRequested)return;let l=await Lf(this.ctx,e,"embeddings",{method:"POST",json:c});if(!l.ok)throw new Error(`Error fetching embeddings: ${l.status}. ${await l.text()}`);let u=await l.json(),d=new kC(u.embedding_model);if(r&&!d.equals(r))throw new Error(`Unexpected embedding model. Got: ${d.id}. Expected: ${r.id}`);if(n.length!==u.embeddings.length)throw new Error(`Mismatched embedding result count. Expected: ${n.length}. Got: ${u.embeddings.length}`);return u.embeddings.map(f=>({type:d,value:new Float32Array(f.embedding)}))}catch(c){throw new Error("Error fetching batch embeddings: "+(c instanceof Error?c.message:String(c)))}}};p();p();p();var WIe=class{constructor(){this.recomputedFileCount=0;this.sentContentTextLength=0}static{a(this,"ComputeBatchInfo")}};p();var hSn=fe(fA()),mSn=fe(v9()),gSn=require("os"),Ojt=fe(require("path")),Qle=require("process");function xJe(t){let e=kn(t.workspaceFolder.uri),r=(0,hSn.basename)(e),o=(0,mSn.SHA256)(e).toString().substring(0,8);return Ojt.default.join(eYo(),"project-index",`${r}.${o}`)}a(xJe,"getWorkspaceCachePath");function eYo(){return Qle.env.XDG_CACHE_HOME&&Ojt.default.isAbsolute(Qle.env.XDG_CACHE_HOME)?Qle.env.XDG_CACHE_HOME+"/github-copilot":(0,gSn.platform)()==="win32"?Qle.env.USERPROFILE+"\\AppData\\Local\\Temp\\github-copilot":Qle.env.HOME+"/.cache/github-copilot"}a(eYo,"getXdgCachePath");p();p();function ASn(t){if(Mqt(t.type)?.quantization.document==="binary"){if(t.value.length%8!==0)throw new Error(`Embedding value length must be a multiple of 8 for ${t.type.id}, got ${t.value.length}`);let n=new Uint8Array(t.value.length/8);for(let o=0;o=0?1:0)<=1024)){let o=new Float32Array(e.length*8);for(let s=0;s0?.03125:-.03125}return{type:t,value:o}}let n=new Float32Array(e.byteLength/4);return new Uint8Array(n.buffer).set(e),{type:t,value:n}}a(Bjt,"unpackEmbedding");var ySn=fe(zc()),ESn=fe(XP()),Fjt=fe(Gp()),_Sn=fe(require("fs")),Ujt=fe(require("node:sqlite")),Qjt=fe(require("path"));var Ljt=new Ae("WorkspaceChunkAndEmbeddingCache");async function vSn(t,e,r,n){return await qjt.create(t,e,r??":memory:",n)}a(vSn,"createWorkspaceChunkAndEmbeddingCache");var qjt=class t{constructor(e,r){this.embeddingType=e;this.db=r;this._inMemory=new ESn.ResourceMap}static{a(this,"DbCache")}static{this.version="1.0.0"}static async create(e,r,n,o){let s={open:!0},c;if(n!==":memory:"){let d=Qjt.default.join(n,"workspace-chunks.db");try{await _Sn.default.promises.mkdir(Qjt.default.dirname(d),{recursive:!0}),c=new Ujt.default.DatabaseSync(d,s),Ljt.debug(e,`DbWorkspaceChunkAndEmbeddingCache: Opened SQLite database on disk at ${d}`)}catch(f){Ljt.error(e,"DbWorkspaceChunkAndEmbeddingCache: Failed to open SQLite database on disk, falling back to in-memory",f)}}c||(c=new Ujt.default.DatabaseSync(":memory:",s),Ljt.debug(e,"DbWorkspaceChunkAndEmbeddingCache: Using in-memory database")),c.exec(` PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; PRAGMA cache_size = ${-128*1024}; @@ -2776,22 +2807,20 @@ ${t.map(r=>`- ${r}`).join(` CREATE INDEX IF NOT EXISTS idx_files_uri ON Files(uri); CREATE INDEX IF NOT EXISTS idx_filechunks_fileId ON FileChunks(fileId); - `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=To(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=Sjt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new Ijt.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=To(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new Ijt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:Sjt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=To(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,oSn.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,iSn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var lSn=ce(El()),axe=ce(Xc()),uSn=ce(_3());var DJe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new uSn.Lazy(async()=>(this._cacheRoot=PJe(this._workspaceFileIndex),await cSn(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new sxe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,axe.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,axe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return I_n(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new sxe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,lSn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,axe.raceCancellationError)(this._cache.value,s),l=await(0,axe.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var dSn=ce(Xc()),fSn=ce(bP()),Hle=ce(cO());var mA=new ge("Embeddings Search"),NJe=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new qn.CancellationTokenSource;this._reindexRequests=new fSn.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(mA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){mA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new Hle.StopWatch;mA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:fA(r),indexStatus:this._state});let s=await this._ctx.get(Qt).getGitHubSession();if(!s)throw mA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Nh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new Hle.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,fA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return mA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),J0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,Ky.Aggregate),{chunks:d}}else{mA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),J0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return mA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new Hle.StopWatch;mA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:fA(r),fileCount:n.length});let c=await this._ctx.get(Qt).getGitHubSession();if(!c)throw mA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){mA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Nh(o);let d=new Hle.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,fA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return mA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),J0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,Ky.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){mA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(mA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new DJe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),mA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new Hle.StopWatch;mA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Qt).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new qn.CancellationTokenSource().token),this.setState("ready"),mA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){mA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=To(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=To(o),c=this._reindexRequests.get(s);c||(c=new dSn.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Qt).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var lxe=ce(Gx());async function LJe(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return lxe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&tP(r.reason)))return lxe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!tP(r.reason))return lxe.Result.error({errorDiagMessage:r.reason+""});return lxe.Result.error({errorDiagMessage:"unknown error"})}a(LJe,"raceSearchOperations");var uxe=ce(Gx()),dxe=ce(Xc());var iKo=2e3,oKo=.7,ySn=8e3,sKo=300,FJe=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>iKo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>oKo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return uxe.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return uxe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,dxe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return uxe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>sKo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return uxe.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,dxe.raceTimeout)(u,ySn),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await LJe([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,dxe.raceTimeout)(u,ySn);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:PIe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var ESn=ce(require("path")),_Sn=require("worker_threads");var Ojt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function aKo(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(aKo,"createRpcProxy");var QJe=class{constructor(e,r,n){this.responseHandler=new Ojt;this.worker=new _Sn.Worker(e,r),eTe(this.worker,ESn.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=aKo((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var HJe=ce(Xc()),CSn=ce(_3()),vSn=ce(ko()),Gle=ce(cO()),bSn=require("fs"),qJe=ce(require("path"));var Vh=new ge("Tfidf Search"),cKo=100,jJe=class extends vSn.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new UJe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new CSn.Lazy(()=>{let s=this.firstExistingPath([qJe.join(__dirname,"tfidfWorker.js"),qJe.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(Jn).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(Vh.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(Vh.error(r,u,...d),Promise.resolve()),"logError")};return new QJe(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){Vh.info(this.ctx,"Starting initialization...");let r=new Gle.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return Vh.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new Gle.StopWatch;Vh.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:fA(n)});try{if(await this.initialize(),this._isDisposed)throw J0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:fA(n),maxSpread:kIe},l=await r.resolveQuery(o),u=new Gle.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();Vh.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Nh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,fA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return Vh.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),J0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,Ky.Aggregate),{chunks:h.chunks}}catch(c){throw Vh.error(this.ctx,"TF-IDF search failed",c),J0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new Gle.StopWatch;if(Vh.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return Vh.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:fA(n),maxSpread:kIe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));Vh.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,fA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return Vh.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),J0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,Ky.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new Gle.StopWatch,l=[];if(Vh.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new qn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,HJe.raceTimeout)(h,f,()=>{Vh.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,Vh.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(Vh.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){Vh.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else Vh.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),Vh.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),Vh.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new HJe.Limiter(cKo),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(Fo).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=PJe(this._workspaceFileIndex);return qJe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,bSn.existsSync)(n))return n}};p();p();p();var Bjt=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new Fjt(e,r))}static forPaths(e=!1){return new t(new GJe(void 0,!e))}static forStrings(){return new t(new Bjt)}static forConfigKeys(){return new t(new Ljt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);b6t(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);b6t(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new $le,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new $le,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new $le,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new $le,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=I3.unwrap(o.value);o.value=I3.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return I3.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:tK(!1);case 1:tK(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=I3.unwrap(n.value)||o,n=n.mid;else break}return n&&I3.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?I3.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,I3.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var SSn=ce(Xc()),TSn=ce(require("fs")),ISn=ce(ti());var uKo=1.5*1024*1024,Ujt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new ISn.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},VJe=class extends Ujt{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(Fo).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(Cc).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=Wn(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,SSn.raceCancellationError)(dKo(r,uKo),this._disposedCts.token)}))}catch{return}}};async function dKo(t,e){return new Promise((r,n)=>{let o=TSn.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(dKo,"readLocalTextFileUsingReadStream");var WJe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new Qjt;this._onDidCreateFiles=new no;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new no;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new no;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=ho(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new VJe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(qy).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(Cc);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=ho(o.uri);s&&this._fsFileTree.addFile(s,new VJe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if((await this.ctx.get(Fo).stat(n.uri)).type!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if((await this.ctx.get(Fo).stat(n.uri)).type!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}},Qjt=class{constructor(){this._tree=$Je.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var xSn=ce(Xc());var zJe=class extends FM{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new no;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new no;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(S_).addListener(this),this._fileReadLimiter=new xSn.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new WJe(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var fxe=ce(Gx()),wSn=ce(El()),$x=ce(Xc()),uq=ce(cO());var el=new ge("Semantic Search"),kP=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new kJe(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new qjt(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},qjt=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new zJe(this._ctx),o=new eJe(this._ctx);this._localDiffSearch=new FJe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new ZKe(this._ctx),this._codeSearchChunkSearch=new tJe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new NJe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new jJe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new RJe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!jL(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new uq.StopWatch,s=await this.resolveQueryText(e,n);el.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:fA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw el.error(this._ctx,"Semantic search failed",l.err),J0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);el.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,$x.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);el.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,fA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return el.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),J0.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){Nh(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(tP(n))throw n;return el.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new jle(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){el.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,$x.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new uq.StopWatch;el.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,$x.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,$x.raceCancellationError)((0,$x.raceTimeout)(u,n),c);if(d?.isOk())return el.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;el.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new uq.StopWatch,m=await LJe([u,f]);return el.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){el.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){el.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new uq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,$x.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),el.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){el.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new uq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),el.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){el.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new uq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),el.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else el.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return el.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),fxe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new uq.StopWatch;el.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,$x.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(el.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),fxe.Result.ok({strategy:e.id,result:c})):(el.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),fxe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(tP(c))throw el.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return el.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),fxe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,wSn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(Cc).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){el.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,$x.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*kIe,d=s.filter(f=>f.distance.value>=u);return el.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return tP(s)||el.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,$x.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:PIe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,ho(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=pA(e.text);return`File: \`${r}\` + `);let l=c.prepare("SELECT version, embeddingModel FROM CacheMeta LIMIT 1").get();(!l||l.version!==this.version||l.embeddingModel!==r.id)&&c.exec("DELETE FROM CacheMeta; DELETE FROM Files; DELETE FROM FileChunks;"),c.exec("DELETE FROM CacheMeta;"),c.prepare("INSERT INTO CacheMeta (version, embeddingModel) VALUES (?, ?)").run(this.version,r.id),await o.initialize();let u=c.prepare("SELECT id, uri FROM Files");try{c.exec("BEGIN TRANSACTION");for(let d of u.all()){let f=d;try{if(o.get(f.uri))continue}catch{}c.prepare("DELETE FROM Files WHERE id = ?").run(f.id)}}finally{c.exec("COMMIT")}return new t(r,c)}dispose(){this.db.close()}async isIndexed(e){return(await this.getEntry(e))?.state==="resolved"}async get(e){return(await this.getEntry(e))?.value}getCurrentChunksForUri(e){let r=to(e),n=this._inMemory.get(r);if(n?.state==="pending"||n?.state==="rejected")return;let o=this.db.prepare("SELECT fc.text, fc.range_startLineNumber, fc.range_startColumn, fc.range_endLineNumber, fc.range_endColumn, fc.embedding, fc.chunkHash FROM Files f JOIN FileChunks fc ON f.id = fc.fileId WHERE f.uri = ?").all(e.toString());if(o.length>0){let s=new Map;for(let c of o){let l=Bjt(this.embeddingType,c.embedding),u={chunk:{file:e.toString(),text:c.text,rawText:void 0,range:new Fjt.Range(c.range_startLineNumber,c.range_startColumn,c.range_endLineNumber,c.range_endColumn)},embedding:l,chunkHash:c.chunkHash};u.chunkHash&&s.set(u.chunkHash,u)}return s}}async getEntry(e){let r=to(e.uri),n=this._inMemory.get(r),o=await e.getFastContentVersionId();if(n?.contentVersionId===o)return n;let s=this.db.prepare("SELECT id, contentVersionId FROM Files WHERE uri = ?").get(e.uri.toString());if(!s||s.contentVersionId!==o)return;let c=this.db.prepare("SELECT text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash FROM FileChunks WHERE fileId = ?").all(s.id);return{state:"resolved",contentVersionId:s.contentVersionId,fileHash:void 0,value:c.map(l=>({chunk:{file:e.uri.toString(),text:l.text,rawText:void 0,range:new Fjt.Range(l.range_startLineNumber,l.range_startColumn,l.range_endLineNumber,l.range_endColumn)},embedding:Bjt(this.embeddingType,l.embedding),chunkHash:l.chunkHash}))}}async update(e,r){let n=to(e.uri),o=this._inMemory.get(n),s=await e.getFastContentVersionId();if(o?.contentVersionId===s)return o.value;let c=await this.getEntry(e);if(c?.contentVersionId===s)return c.value;o?.state==="pending"&&o.value.cancel();let l=(0,ySn.createCancelablePromise)(r),u={contentVersionId:s,fileHash:void 0,state:"pending",value:l};return this._inMemory.set(n,u),await l.then(d=>({contentVersionId:s,fileHash:void 0,state:Array.isArray(d)?"resolved":"rejected",value:d}),()=>({contentVersionId:s,fileHash:void 0,state:"rejected",value:void 0})).then(d=>{let f=this._inMemory.get(n);if(u===f)if(d.state==="rejected")this._inMemory.set(n,d),this.db.prepare("DELETE FROM Files WHERE uri = ?").run(n.toString());else{this._inMemory.delete(n);let h=this.db.prepare("INSERT OR REPLACE INTO Files (uri, contentVersionId) VALUES (?, ?)").run(e.uri.toString(),s);try{let m=this.db.prepare("INSERT INTO FileChunks (fileId, text, range_startLineNumber, range_startColumn, range_endLineNumber, range_endColumn, embedding, chunkHash) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");this.db.exec("BEGIN TRANSACTION");for(let g of d.value??[])m.run(h.lastInsertRowid,g.chunk.text,g.chunk.range.startLineNumber,g.chunk.range.startColumn,g.chunk.range.endLineNumber,g.chunk.range.endColumn,ASn(g.embedding),g.chunkHash??"")}finally{this.db.exec("COMMIT")}}}),l}};var CSn=fe(ml()),zIe=fe(zc()),bSn=fe(BL());var wJe=class{constructor(e,r,n,o){this.ctx=e;this._embeddingType=r;this._workspaceFileIndex=n;this._chunkingEndpointClient=o;this._cache=new bSn.Lazy(async()=>(this._cacheRoot=xJe(this._workspaceFileIndex),await vSn(this.ctx,this._embeddingType,this._cacheRoot,this._workspaceFileIndex)))}static{a(this,"WorkspaceChunkEmbeddingsIndex")}dispose(){this._cache.hasValue&&this._cache.value.then(e=>e.dispose())}async getIndexState(){if(!this._cache.hasValue)return;let e=await this._cache.value,r=Array.from(this._workspaceFileIndex.values()),n=0;return await Promise.all(r.map(async o=>{await e.isIndexed(o)&&n++})),{totalFileCount:r.length,indexedFileCount:n}}get fileCount(){return this._workspaceFileIndex.fileCount}async triggerIndexingOfWorkspace(e,r){let n=Array.from(this._workspaceFileIndex.values());await Promise.all(n.map(o=>this.triggerIndexingOfFile(o.uri,e,r)))}async triggerIndexingOfFile(e,r,n){let o=this._workspaceFileIndex.get(e);o&&await this.getChunksAndEmbeddings(r,o,new WIe,"Batch",n)}async searchWorkspace(e,r,n,o){let[s,c]=await(0,zIe.raceCancellationError)(Promise.all([r,this.getAllWorkspaceEmbeddings(e,o)]),o);return this.rankEmbeddings(s,c,n)}async searchSubsetOfFiles(e,r,n,o,s){if(!r.length)return[];let[c,l]=await(0,zIe.raceCancellationError)(Promise.all([n,this.getEmbeddingsForFiles(e,r,s)]),s);return this.rankEmbeddings(c,l,o)}rankEmbeddings(e,r,n){return cCn(e,r.map(o=>[o.chunk,o.embedding]),n).map(o=>({chunk:o.value,distance:o.distance}))}async getAllWorkspaceEmbeddings(e,r){let o=Array.from(this._workspaceFileIndex.values()).map(s=>s.uri);return this.getEmbeddingsForFiles(e,o,r)}async getEmbeddingsForFiles(e,r,n){let o=new WIe,s=await Promise.all(r.map(async c=>{let l=this._workspaceFileIndex.get(c);if(l)return await this.getChunksAndEmbeddings(e,l,o,"Batch",n)}));return(0,CSn.coalesce)(s).flat()}async getChunksAndEmbeddings(e,r,n,o,s){let c=await(0,zIe.raceCancellationError)(this._cache.value,s),l=await(0,zIe.raceCancellationError)(c.get(r),s);if(l)return l;let u=c.getCurrentChunksForUri(r.uri);return await c.update(r,async f=>this._chunkingEndpointClient.computeChunksAndEmbeddings(e,this._embeddingType,r,n,o,u,f))}};var SSn=fe(zc()),TSn=fe(XP()),qle=fe(NM());var EA=new Ae("Embeddings Search"),RJe=class t{constructor(e,r,n,o){this._ctx=e;this._workspaceFileIndex=r;this.embeddingType=n;this.chunkingEndpointClient=o;this.id="embeddings";this._state="unknown";this._disposeCts=new jn.CancellationTokenSource;this._reindexRequests=new TSn.ResourceMap}static{a(this,"EmbeddingsChunkSearch")}static{this.defaultAutomaticIndexingFileCap=750}dispose(){this._disposeCts.cancel(),this._disposeCts.dispose();for(let[,e]of this._reindexRequests)e.dispose();this._reindexRequests.clear(),this._embeddingsIndex?.dispose()}async triggerLocalIndexing(){if(EA.info(this._ctx,"Triggering local indexing..."),await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAutomaticIndexing"){EA.info(this._ctx,"Skipping automatic indexing: too many files",{fileCount:this._workspaceFileIndex.fileCount});return}await this.triggerIndexingOfWorkspace()}async searchWorkspace(e,r,n){let o=new qle.StopWatch;EA.info(this._ctx,"Starting workspace embedding search",{rawQuery:e.rawQuery,maxResults:AA(r),indexStatus:this._state});let s=await this._ctx.get(Ut).getGitHubSession();if(!s)throw EA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let c=e.resolveQueryEmbeddings(n);if(await this.doInitialIndexing(),Lh(n),(this._state==="updatingIndex"||this._state==="ready")&&this._embeddingsIndex!==void 0){let u=new qle.StopWatch,d=await this._embeddingsIndex.searchWorkspace(s,c,AA(r),n),f=u.elapsed(),h=o.elapsed(),m=d.length,A=new Set(d.map(E=>E.chunk.file)).size,y=this._workspaceFileIndex.fileCount;return EA.info(this._ctx,`Workspace search completed successfully in ${h}ms`,{totalTime:h,searchTime:f,chunkCount:m,uniqueFileCount:A,indexStatus:this._state}),Z0.sendEmbeddingsSuccess(this._ctx,h,f,m,A,y,Jy.Aggregate),{chunks:d}}else{EA.info(this._ctx,"Embeddings index is not ready for workspace search, skip searching.",{indexStatus:this._state}),Z0.sendEmbeddingsSkipped(this._ctx,"index_not_ready");return}}async searchFiles(e,r,n,o){if(!n.length)return EA.info(this._ctx,"No files to search, returning empty results"),{chunks:[]};let s=new qle.StopWatch;EA.info(this._ctx,"Starting file subset embedding search",{rawQuery:e.rawQuery,maxResults:AA(r),fileCount:n.length});let c=await this._ctx.get(Ut).getGitHubSession();if(!c)throw EA.error(this._ctx,"No GitHub session found"),new Error("No GitHub session found in EmbeddingsChunkSearch");let l=e.resolveQueryEmbeddings(o),u=await this.initializeForFileSubset(n.length);if(!u){EA.info(this._ctx,"Too many files for subset search",{fileCount:n.length});return}Lh(o);let d=new qle.StopWatch,f=await u.searchSubsetOfFiles(c,n,l,AA(r),o),h=d.elapsed(),m=s.elapsed(),g=f.length,y=new Set(f.map(_=>_.chunk.file)).size,E=this._workspaceFileIndex.fileCount;return EA.info(this._ctx,`File subset search completed successfully in ${m}ms`,{totalTime:m,searchTime:h,chunkCount:g,uniqueFileCount:y}),Z0.sendEmbeddingsSuccess(this._ctx,m,h,g,y,E,Jy.Remote),{chunks:f}}async initializeForFileSubset(e){await this._workspaceFileIndex.initialize();let r=this.getAutoIndexFileCap();if(e>r){EA.info(this._ctx,`EmbeddingsChunkSearch: skipping subset search due to too many files. Found ${e} files. Max: ${r}`);return}return this.getOrCreateEmbeddingsIndex()}async initializeWorkspaceIndex(){return this._init??=(async()=>{await this._workspaceFileIndex.initialize();let e=this.checkWorkspaceIndexSizeLimits();return e?(EA.info(this._ctx,`EmbeddingsChunkSearch: skipping automatic indexing due to too many files. Found ${this._workspaceFileIndex.fileCount} files. Max: ${this.getAutoIndexFileCap()}`),this.setState(e),!0):(this.getOrCreateEmbeddingsIndex(),this.setState("ready"),!0)})(),this._init}getOrCreateEmbeddingsIndex(){return this._embeddingsIndex||(this._embeddingsIndex=new wJe(this._ctx,this.embeddingType,this._workspaceFileIndex,this.chunkingEndpointClient),EA.info(this._ctx,`EmbeddingsChunkSearch: initializing embeddings index for ${this._workspaceFileIndex.fileCount} files.`)),this._embeddingsIndex}checkWorkspaceIndexSizeLimits(){let e=this.getAutoIndexFileCap();if(this._workspaceFileIndex.fileCount>e)return"tooManyFilesForAutomaticIndexing"}async doInitialIndexing(){return this._initialIndexing??=(async()=>{if(await this.initializeWorkspaceIndex(),!(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing"))return this.triggerIndexingOfWorkspace(),this.registerAutomaticReindexListeners(),!0})(),this._initialIndexing}async triggerIndexingOfWorkspace(){let e=new qle.StopWatch;EA.info(this._ctx,"Starting workspace indexing...",{fileCount:this._workspaceFileIndex.fileCount}),this.setState("updatingIndex");try{let r=await this._ctx.get(Ut).getGitHubSession();if(!r)throw new Error("No GitHub session found");await this._embeddingsIndex?.triggerIndexingOfWorkspace(r,new jn.CancellationTokenSource().token),this.setState("ready"),EA.info(this._ctx,`Workspace indexing completed in ${e.elapsed()}ms`,{status:"ready",indexingTime:e.elapsed()})}catch(r){EA.error(this._ctx,"Workspace indexing failed",r),this.setState("unknown")}}registerAutomaticReindexListeners(){this._reindexRequests.clear(),this._workspaceFileIndex.onDidCreateFiles(e=>{this.tryTriggerReindexing(e,!0)}),this._workspaceFileIndex.onDidChangeFiles(e=>this.tryTriggerReindexing(e,!0)),this._workspaceFileIndex.onDidDeleteFiles(e=>{for(let r of e){let n=to(r);this._reindexRequests.get(n)?.dispose(),this._reindexRequests.delete(n)}})}getAutoIndexFileCap(){return t.defaultAutomaticIndexingFileCap}setState(e){this._state!==e&&(this._state=e)}tryTriggerReindexing(e,r=!1){if(this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let n=6e4;for(let o of e){let s=to(o),c=this._reindexRequests.get(s);c||(c=new SSn.Delayer(n),this._reindexRequests.set(s,c)),c.trigger(async()=>{if(await this.initializeWorkspaceIndex(),this._state==="tooManyFilesForAnyIndexing"||this._state==="tooManyFilesForAutomaticIndexing")return;let l=await this._ctx.get(Ut).getGitHubSession();this._embeddingsIndex?.triggerIndexingOfFile(o,l,this._disposeCts.token)},r?0:n)}}};p();p();var KIe=fe(Hx());async function NJe(t){for(let r of t)r.then(n=>{n.isOk()&&t.forEach(o=>{o!==r&&o.cancel()})},()=>{});let e=await Promise.allSettled(t);for(let r of e)if(r.status==="fulfilled"&&r.value.isOk())return r.value;{let r=[];for(let n of e)n.status==="fulfilled"&&n.value.isError()&&r.push(n.value.err.errorDiagMessage);if(r.length)return KIe.Result.error({errorDiagMessage:r.join(", ")})}if(e.every(r=>r.status==="rejected"&&ck(r.reason)))return KIe.Result.error({errorDiagMessage:"cancelled"});for(let r of e)if(r.status==="rejected"&&!ck(r.reason))return KIe.Result.error({errorDiagMessage:r.reason+""});return KIe.Result.error({errorDiagMessage:"unknown error"})}a(NJe,"raceSearchOperations");var JIe=fe(Hx()),ZIe=fe(zc());var uYo=2e3,dYo=.7,kSn=8e3,fYo=300,MJe=class{constructor(e,r,n,o){this._embeddingsByWorkspace=e;this._tfidfByWorkspace=r;this._workspaceFileIndexes=n;this._diffTrackers=o}static{a(this,"LocalDiffSearch")}getTotalFileCount(e){let r=0;for(let n of e){let o=this._workspaceFileIndexes.get(n);o&&(r+=o.fileCount)}return r}async getLocalDiff(e){let r=new Set;for(let n of e){let o=this._diffTrackers.get(n);if(o){let s=await o.getDiffFiles();if(s)for(let c of s)r.add(c)}}return Array.from(r)}shouldDoLocalDiffSearch(e,r){if(e.length===0||e.length>uYo)return!1;let n=this.getTotalFileCount(r);return!(n>0&&e.length/n>dYo)}async searchLocalDiff(e,r,n,o){if(e.length===0)return JIe.Result.ok({strategy:"none",result:{chunks:[]}});let s=[],c=[];for(let u of n.workspaceFolders){let d=this._embeddingsByWorkspace.get(u),f=this._tfidfByWorkspace.get(u);d&&s.push(d),f&&c.push(f)}if(s.length===0&&c.length===0)return JIe.Result.error({errorDiagMessage:"No search instances available"});let l=a((u,d)=>(0,ZIe.createCancelablePromise)(async f=>{let h=await Promise.all(u.map(g=>g.searchFiles(r,n,[...e],f))),m=this.mergeSearchResults(h);return JIe.Result.ok({strategy:d,result:m})}),"createSearchOp");if(e.length>fYo){if(c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}return JIe.Result.error({errorDiagMessage:"Diff size too large for embeddings and no TF-IDF available"})}if(s.length>0&&c.length>0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ZIe.raceTimeout)(u,kSn),f=d===void 0;if(d?.isOk()&&d.val.result.chunks.length>0)return d;let h=l(c,"tfidf");return o.onCancellationRequested(()=>h.cancel()),f?(h.then(()=>u.cancel(),()=>u.cancel()),await NJe([u,h])):(u.cancel(),await h)}else if(s.length>0&&c.length===0){let u=l(s,"embeddings");o.onCancellationRequested(()=>u.cancel());let d=await(0,ZIe.raceTimeout)(u,kSn);if(d?.isOk()&&d.val.result.chunks.length>0)return d;u.cancel();return}else if(s.length===0&&c.length>0){let u=l(c,"tfidf");return o.onCancellationRequested(()=>u.cancel()),await u}}mergeSearchResults(e){let r=e.filter(o=>!!o);if(r.length===0)return{chunks:[]};if(r.length===1)return{chunks:[...r[0].chunks]};let n=new Map;for(let o of r)for(let s of o.chunks){let c=s.chunk.file,l=n.get(c),u=s.distance?.value??Number.MAX_VALUE,d=l?.distance?.value??Number.MAX_VALUE;(!l||ug.text.toLowerCase()),e.toLowerCase()],u=await s.computeEmbeddings(c,l,{inputType:"document"},o);if(!u||u.values.length===0)return[];if(o.isCancellationRequested)return[];let d=u.values[u.values.length-1],f=u.values.slice(0,-1);if(!r.length||f.length!==r.length)return[];let h=f[0].type,m=f.map((g,A)=>({chunk:r[A],score:BIe(d,g).value}));return m.sort((g,A)=>A.score-g.score),m.slice(0,n).map(g=>({chunk:g.chunk,distance:{embeddingType:h,value:g.score}}))}};p();var DSn=fe(require("path")),NSn=require("worker_threads");var Wjt=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function pYo(t){let e={get:a((r,n)=>{if(typeof n=="string")return r[n]||(r[n]=(...o)=>t(n,o)),r[n]},"get")};return new Proxy(Object.create(null),e)}a(pYo,"createRpcProxy");var BJe=class{constructor(e,r,n){this.responseHandler=new Wjt;this.worker=new NSn.Worker(e,r),bTe(this.worker,DSn.basename(e,".js")),this.worker.on("message",o=>{"fn"in o?(async()=>{try{let s=n?.[o.fn];if(!s)throw new Error(`Unknown method: ${o.fn}`);let c=await s.apply(n,o.args);this.worker.postMessage({id:o.id,res:c})}catch(s){this.worker.postMessage({id:o.id,err:s instanceof Error?s:new Error(String(s))})}})():this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=pYo((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}terminate(){this.worker.removeAllListeners(),this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};var UJe=fe(zc()),MSn=fe(BL()),OSn=fe(Io()),jle=fe(NM()),BSn=require("fs"),LJe=fe(require("path"));var zh=new Ae("Tfidf Search"),hYo=100,FJe=class extends OSn.Disposable{constructor(r,n,o){super();this.id="tfidf";this._maxFileCount=25e3;this._isDisposed=!1;this._tokenizerName="o200k_base";this._workspaceFileIndex=n,this.ctx=r,this._embeddingReranker=new OJe(r,o?.embeddingType),this._customDbPath=o?.dbPath,this._tfIdfWorker=new MSn.Lazy(()=>{let s=this.firstExistingPath([LJe.join(__dirname,"tfidfWorker.js"),LJe.join(__dirname,"../../../../dist/tfidfWorker.js")]);if(s===void 0)throw new Error("tfidfWorker file not found");let c={tokenizer:this._tokenizerName,dbPath:this.getDbPath()},l={readFile:a(async u=>{let f=await r.get(ri).getOrReadTextDocument({uri:u});if(f.status!=="valid")throw new Error(`Could not read file ${u}: ${f.status}`);return f.document.getText()},"readFile"),getContentVersionId:a(async u=>{try{return await this.getFastContentVersionId(u)}catch(d){throw new Error(`Could not find file ${u}, error: ${String(d)}`)}},"getContentVersionId"),logWarn:a((u,...d)=>(zh.warn(r,u,...d),Promise.resolve()),"logWarn"),logError:a((u,...d)=>(zh.error(r,u,...d),Promise.resolve()),"logError")};return new BJe(s,{workerData:c},l)}),this._register(this.registerFileWatchers())}static{a(this,"TfidfChunkSearch")}dispose(){this._isDisposed=!0,super.dispose(),this._tfIdfWorker.hasValue&&this._tfIdfWorker.value.terminate()}async initialize(){zh.info(this.ctx,"Starting initialization...");let r=new jle.StopWatch;this._initializePromise??=this.initializeWorkspace();let n=await this._initializePromise;return zh.info(this.ctx,`Initialization completed in ${r.elapsed()}ms`,{outOfSyncFileCount:n.outOfSyncFileCount,newFileCount:n.newFileCount,deletedFileCount:n.deletedFileCount,initTime:n.initTime,dbPath:this.getDbPath()}),n}async searchWorkspace(r,n,o){let s=new jle.StopWatch;zh.info(this.ctx,"Starting workspace search",{rawQuery:r.rawQuery,maxResults:AA(n)});try{if(await this.initialize(),this._isDisposed)throw Z0.sendTfidfFailure(this.ctx,"disposed"),new Error("TfidfChunkSearch has been disposed");let c={maxResults:AA(n),maxSpread:OIe},l=await r.resolveQuery(o),u=new jle.StopWatch,d=await this._tfIdfWorker.value.proxy.search(l,c),f=u.elapsed();zh.info(this.ctx,`TF-IDF search completed in ${f}ms`,{chunksFound:d.chunks.length,searchTelemetry:d.telemetry}),Lh(o);let h=await this.applyEmbeddingReranking(l,d.chunks,AA(n),o),m=h.chunks.length,A=new Set(h.chunks.map(_=>_.chunk.file)).size,y=this._workspaceFileIndex.fileCount,E=s.elapsed();return zh.info(this.ctx,`Search with reranking completed successfully in ${E}ms`,{totalTime:E,finalChunkCount:m,uniqueFileCount:A,rerankTime:h.telemetry.rerankTime}),Z0.sendTfidfSuccess(this.ctx,E,f,h.telemetry.rerankTime,m,A,d.chunks.length,y,Jy.Aggregate),{chunks:h.chunks}}catch(c){throw zh.error(this.ctx,"TF-IDF search failed",c),Z0.sendTfidfFailure(this.ctx,c),c}}async searchFiles(r,n,o,s){let c=new jle.StopWatch;if(zh.info(this.ctx,"Starting file-scoped search",{query:r.rawQuery,fileCount:o.length,files:o}),!o.length)return zh.info(this.ctx,"No files to search, returning empty results"),{chunks:[]};if(await this.initializeFiles(o),this._isDisposed)throw new Error("TfidfChunkSearch has been disposed");let l={maxResults:AA(n),maxSpread:OIe},u=await r.resolveQuery(s),d=await this._tfIdfWorker.value.proxy.search(u,l),f=new Set(o),h=d.chunks.filter(v=>f.has(v.file));zh.info(this.ctx,"Chunks filtered by file scope",{beforeFilter:d.chunks.length,afterFilter:h.length});let m=c.elapsed(),g=await this.applyEmbeddingReranking(u,h,AA(n),s),A=g.chunks.length,E=new Set(g.chunks.map(v=>v.chunk.file)).size,_=c.elapsed();return zh.info(this.ctx,`File-scoped search completed in ${_}ms`,{finalChunkCount:A,searchTelemetry:d.telemetry,rerankTime:g.telemetry.rerankTime}),Z0.sendTfidfSuccess(this.ctx,_,m,g.telemetry.rerankTime,A,E,h.length,o.length,Jy.Remote),{chunks:g.chunks}}async applyEmbeddingReranking(r,n,o,s){let c=new jle.StopWatch,l=[];if(zh.info(this.ctx,"Starting embedding reranking",{chunkCount:n.length,maxResults:o}),n.length>0){let u=s?void 0:new jn.CancellationTokenSource,d=s??u.token,f=5e3;try{let h=this._embeddingReranker.rerankChunks(r,n,o,d),m=await(0,UJe.raceTimeout)(h,f,()=>{zh.warn(this.ctx,"Embedding reranking timed out, falling back to TF-IDF results"),u?.cancel()});m&&m.length>0?(l=m,zh.info(this.ctx,`Reranking completed in ${c.elapsed()}ms`,{rerankedCount:m.length})):(zh.warn(this.ctx,"Reranking returned no results, falling back to TF-IDF results"),l=n.slice(0,o).map(g=>({chunk:g,distance:void 0})))}catch(h){zh.error(this.ctx,"Error during embedding reranking, falling back to TF-IDF results:",h),l=n.slice(0,o).map(m=>({chunk:m,distance:void 0}))}}else zh.info(this.ctx,"No chunks to rerank");return{chunks:l,telemetry:{rerankTime:c.elapsed()}}}async initializeWorkspace(){if(await this._workspaceFileIndex.initialize(),this._isDisposed)throw new Error("TfidfChunkSearch disposed during initialization");let r=Array.from(this._workspaceFileIndex.values()),n=r;r.length>this._maxFileCount&&(n=r.slice(0,this._maxFileCount),zh.warn(this.ctx,`Workspace has too many files, limiting indexing from ${r.length} to ${this._maxFileCount}`)),zh.info(this.ctx,"Preparing files for indexing",{totalFiles:r.length,filesToIndex:n.length,maxFileCount:this._maxFileCount});let o=new UJe.Limiter(hYo),s=await Promise.all(n.map(c=>o.queue(async()=>({uri:c.uri,contentId:await c.getFastContentVersionId()}))));return await this._tfIdfWorker.value.proxy.initialize(s)}async getFastContentVersionId(r){let n=await this.ctx.get(jo).stat(r);return`${n.size}-${n.mtime}`}async initializeFiles(r){let n=new Set(r),o=Array.from(this._workspaceFileIndex.values()).filter(s=>n.has(s.uri)).map(s=>s.uri);o.length&&await this._tfIdfWorker.value.proxy.addOrUpdate(o)}registerFileWatchers(){let r=[],n=this._workspaceFileIndex.onDidCreateFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file create event:",l)})});r.push(n);let o=this._workspaceFileIndex.onDidChangeFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.addOrUpdate(c).catch(l=>{console.error("Error handling file change event:",l)})});r.push(o);let s=this._workspaceFileIndex.onDidDeleteFiles(c=>{this._isDisposed||!this._tfIdfWorker.hasValue||this._tfIdfWorker.value.proxy.delete(c).catch(l=>{console.error("Error handling file delete event:",l)})});return r.push(s),{dispose:a(()=>{r.forEach(c=>c.dispose())},"dispose")}}getDbPath(){if(this._customDbPath)return this._customDbPath;let r=xJe(this._workspaceFileIndex);return LJe.join(r,"local-index.db")}firstExistingPath(r){for(let n of r)if((0,BSn.existsSync)(n))return n}};p();p();p();var zjt=class{constructor(){this._value="";this._pos=0}static{a(this,"StringIterator")}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;r--,this._valueLen--){let n=this._value.charCodeAt(r);if(!(n===47||this._splitOnBackslash&&n===92))break}return this.next()}hasNext(){return this._to!1,r=()=>!1){return new t(new Kjt(e,r))}static forPaths(e=!1){return new t(new QJe(void 0,!e))}static forStrings(){return new t(new zjt)}static forConfigKeys(){return new t(new Yjt)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,r){if(r){let n=r.slice(0);x7t(n);for(let o of n)this.set(o,e)}else{let n=e.slice(0);x7t(n);for(let o of n)this.set(o[0],o[1])}}set(e,r){let n=this._iter.reset(e),o;this._root||(this._root=new Hle,this._root.segment=n.value());let s=[];for(o=this._root;;){let l=n.cmp(o.segment);if(l>0)o.left||(o.left=new Hle,o.left.segment=n.value()),s.push([-1,o]),o=o.left;else if(l<0)o.right||(o.right=new Hle,o.right.segment=n.value()),s.push([1,o]),o=o.right;else if(n.hasNext())n.next(),o.mid||(o.mid=new Hle,o.mid.segment=n.value()),s.push([0,o]),o=o.mid;else break}let c=E3.unwrap(o.value);o.value=E3.wrap(r),o.key=e;for(let l=s.length-1;l>=0;l--){let u=s[l][1];u.updateHeight();let d=u.balanceFactor();if(d<-1||d>1){let f=s[l][0],h=s[l+1][0];if(f===1&&h===1)s[l][1]=u.rotateLeft();else if(f===-1&&h===-1)s[l][1]=u.rotateRight();else if(f===1&&h===-1)u.right=s[l+1][1]=s[l+1][1].rotateRight(),s[l][1]=u.rotateLeft();else if(f===-1&&h===1)u.left=s[l+1][1]=s[l+1][1].rotateLeft(),s[l][1]=u.rotateRight();else throw new Error;if(l>0)switch(s[l-1][0]){case-1:s[l-1][1].left=s[l][1];break;case 1:s[l-1][1].right=s[l][1];break;case 0:s[l-1][1].mid=s[l][1];break}else this._root=s[0][1]}}return c}get(e){return E3.unwrap(this._getNode(e)?.value)}_getNode(e){let r=this._iter.reset(e),n=this._root;for(;n;){let o=r.cmp(n.segment);if(o>0)n=n.left;else if(o<0)n=n.right;else if(r.hasNext())r.next(),n=n.mid;else break}return n}has(e){let r=this._getNode(e);return!(r?.value===void 0&&r?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,r){let n=this._iter.reset(e),o=[],s=this._root;for(;s;){let c=n.cmp(s.segment);if(c>0)o.push([-1,s]),s=s.left;else if(c<0)o.push([1,s]),s=s.right;else if(n.hasNext())n.next(),o.push([0,s]),s=s.mid;else break}if(s){if(r?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){let c=[[1,s]],l=this._min(s.right,c);if(l.key){s.key=l.key,s.value=l.value,s.segment=l.segment;let u=l.right;if(c.length>1){let[f,h]=c[c.length-1];switch(f){case-1:h.left=u;break;case 0:iK(!1);case 1:iK(!1)}}else s.right=u;let d=this._balanceByStack(c);if(o.length>0){let[f,h]=o[o.length-1];switch(f){case-1:h.left=d;break;case 0:h.mid=d;break;case 1:h.right=d;break}}else this._root=d}}else{let c=s.left??s.right;if(o.length>0){let[l,u]=o[o.length-1];switch(l){case-1:u.left=c;break;case 0:u.mid=c;break;case 1:u.right=c;break}}else this._root=c}this._root=this._balanceByStack(o)??this._root}}_min(e,r){for(;e.left;)r.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let r=e.length-1;r>=0;r--){let n=e[r][1];n.updateHeight();let o=n.balanceFactor();if(o>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[r][1]=n.rotateLeft()):o<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[r][1]=n.rotateRight()),r>0)switch(e[r-1][0]){case-1:e[r-1][1].left=e[r][1];break;case 1:e[r-1][1].right=e[r][1];break;case 0:e[r-1][1].mid=e[r][1];break}else return e[0][1]}}findSubstr(e){let r=this._iter.reset(e),n=this._root,o;for(;n;){let s=r.cmp(n.segment);if(s>0)n=n.left;else if(s<0)n=n.right;else if(r.hasNext())r.next(),o=E3.unwrap(n.value)||o,n=n.mid;else break}return n&&E3.unwrap(n.value)||o}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,r){let n=this._iter.reset(e),o=this._root;for(;o;){let s=n.cmp(o.segment);if(s>0)o=o.left;else if(s<0)o=o.right;else if(n.hasNext())n.next(),o=o.mid;else return o.mid?this._entries(o.mid):r?E3.unwrap(o.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[r,n]of this)e(n,r)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let r=[];return this._dfsEntries(e,r),r[Symbol.iterator]()}_dfsEntries(e,r){e&&(e.left&&this._dfsEntries(e.left,r),e.value!==void 0&&r.push([e.key,E3.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,r),e.right&&this._dfsEntries(e.right,r))}_isBalanced(){let e=a(r=>{if(!r)return!0;let n=r.balanceFactor();return n<-1||n>1?!1:e(r.left)&&e(r.right)},"nodeIsBalanced");return e(this._root)}};var LSn=fe(zc()),FSn=fe(require("fs")),USn=fe(ei());var mYo=1.5*1024*1024,Jjt=class{constructor(e){this._uri=e;this._isDisposed=!1;this._disposedCts=new USn.CancellationTokenSource}static{a(this,"FileRepresentation")}dispose(){this._isDisposed=!0,this._disposedCts.cancel(),this._disposedCts.dispose()}get uri(){return this._uri}async getFastContentVersionId(){let e=await this.getStats();return`${e.size}-${e.mtime}`}},jJe=class extends Jjt{constructor(r,n,o){super(r);this._ctx=o;this._fileReadLimiter=n}static{a(this,"FsFileRepresentation")}isDirty(){return!1}async getStats(){let r=await this._ctx.get(jo).stat(this.uri.toString());return{size:r.size,mtime:r.mtime}}async getText(){try{let r=await this._readFile();if(!r||this._isDisposed)return"";let o=new TextDecoder().decode(r.data);return(await this._ctx.get(ec).evaluate(this.uri,o)).isBlocked?"":o}catch{return""}}async _readFile(){try{let r=kn(this.uri);return await this._fileReadLimiter.queue(async()=>({data:await(0,LSn.raceCancellationError)(gYo(r,mYo),this._disposedCts.token)}))}catch{return}}};async function gYo(t,e){return new Promise((r,n)=>{let o=FSn.createReadStream(t,{start:0,end:e-1}),s=[],c=0;o.on("data",l=>(c+=l.length,s.push(l))),o.on("end",()=>r(Buffer.concat(s))),o.on("error",n)})}a(gYo,"readLocalTextFileUsingReadStream");var HJe=class{constructor(e,r,n){this.ctx=e;this.workspaceFolder=r;this.limiter=n;this._fsFileTree=new Zjt;this._onDidCreateFiles=new no;this.onDidCreateFiles=this._onDidCreateFiles.event;this._onDidChangeFiles=new no;this.onDidChangeFiles=this._onDidChangeFiles.event;this._onDidDeleteFiles=new no;this.onDidDeleteFiles=this._onDidDeleteFiles.event}static{a(this,"WorkspaceFileIndex")}get fileCount(){return this._fsFileTree.fileCount}*values(){yield*this._fsFileTree.values()}get(e){let r=Ko(e);return r?this._fsFileTree.get(r):void 0}tryLoad(e){throw new Error("Method not implemented.")}tryRead(e){throw new Error("Method not implemented.")}createOrUpdateFsEntry(e){let r=this._fsFileTree.get(e);r&&r.dispose();let n=new jJe(e,this.limiter,this.ctx);return this._fsFileTree.addFile(e,n),n}async initialize(){return this._initializePromise??=(async()=>{let e=await this.ctx.get(xx).getWatchedFileUris(this.workspaceFolder),r=this.ctx.get(ec);(r.enabled?(await Promise.all(e.map(async o=>(await r.evaluate(o.uri,"")).isBlocked?void 0:o))).filter(o=>o!==void 0):e).forEach(o=>{let s=Ko(o.uri);s&&this._fsFileTree.addFile(s,new jJe(o.uri,this.limiter,this.ctx))})})(),this._initializePromise}async didChangeFiles(e){if(e.type==="create"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this._fsFileTree.get(s)||(this.createOrUpdateFsEntry(s),r.push(s))}r.length&&this._onDidCreateFiles.fire(r)}else if(e.type==="update"){let r=[];for(let n of e.documents){if(await this.statFileType(n.uri)!==1)continue;let s=n.uri;this.createOrUpdateFsEntry(s),r.push(s)}r.length&&this._onDidChangeFiles.fire(r)}else if(e.type==="delete"){let r=[];for(let n of e.documents){let o=n.uri,s=this._fsFileTree.get(o);if(s)s.dispose(),this._fsFileTree.delete(o),r.push(o);else{let c=this._fsFileTree.deleteFolder(o);c.length&&r.push(...c)}}r.length&&this._onDidDeleteFiles.fire(r)}}async statFileType(e){try{return(await this.ctx.get(jo).stat(e)).type}catch{return}}},Zjt=class{constructor(){this._tree=qJe.forPaths();this._fileCount=0}static{a(this,"SimpleFsTree")}get fileCount(){return this._fileCount}get(e){return this._tree.get(e)}addFile(e,r){this._tree.get(e)||this._fileCount++,this._tree.set(e,r)}clear(){this._tree.clear()}delete(e){let r=!!this.get(e);return this._tree.delete(e),r&&(this._fileCount=Math.max(0,this._fileCount-1)),r}deleteFolder(e){let r=[];for(let[n]of this._tree.findSuperstr(e)??[])r.push(n);for(let n of r)this._tree.delete(n);return this._fileCount=Math.max(0,this._fileCount-r.length),r}*values(){for(let[,e]of this.entries())yield e}entries(){return this._tree}};var QSn=fe(zc());var GJe=class extends CQ{constructor(r){super();this.ctx=r;this.workspaceFileIndexes=new Map;this._onDidWorkspaceAdded=new no;this.onDidWorkspaceAdded=this._onDidWorkspaceAdded.event;this._onDidWorkspaceRemoved=new no;this.onDidWorkspaceRemoved=this._onDidWorkspaceRemoved.event;this.ctx.get(CS).addListener(this),this._fileReadLimiter=new QSn.Limiter(20)}static{a(this,"WorkspaceFileWatcher")}isEnabled(){return Promise.resolve(!0)}isStarted(){return!0}async didAddWorkspace(r){if(!await this.isEnabled())return;let n=new HJe(this.ctx,r,this._fileReadLimiter);this.workspaceFileIndexes.set(r.uri,n),this._onDidWorkspaceAdded.fire(n)}async didRemoveWorkspace(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.uri);if(n){for(let o of n.values())o.dispose();this._onDidWorkspaceRemoved.fire(n),this.workspaceFileIndexes.delete(r.uri)}}async didChangeFiles(r){if(!await this.isEnabled())return;let n=this.workspaceFileIndexes.get(r.workspaceFolder.uri);n&&await n.didChangeFiles(r)}};var XIe=fe(Hx()),qSn=fe(ml()),Gx=fe(zc()),iq=fe(NM());var Zc=new Ae("Semantic Search"),wk=class{constructor(e){this._ctx=e;this._availableEmbeddingTypes=new IJe(e),this.tryInit()}static{a(this,"WorkspaceChunkSearchService")}dispose(){this._impl?.dispose()}async tryInit(){if(this._impl)return this._impl;let e=await this._availableEmbeddingTypes.getPreferredType();if(e)return this._impl=new Xjt(this._ctx,e),this._impl}async searchWorkspace(e,r,n){let o=await this.tryInit();if(!o)throw new Error("Workspace chunk search service not available");return await o.searchWorkspace(e,r,n)}},Xjt=class{constructor(e,r){this._ctx=e;this._embeddingType=r;this._localEmbeddingsByWorkspace=new Map;this._localTfidfByWorkspace=new Map;this._diffTrackersByWorkspace=new Map;this._workspaceFileIndexes=new Map;let n=new GJe(this._ctx),o=new KKe(this._ctx);this._localDiffSearch=new MJe(this._localEmbeddingsByWorkspace,this._localTfidfByWorkspace,this._workspaceFileIndexes,this._diffTrackersByWorkspace),this._githubCodeSearchService=new zKe(this._ctx),this._codeSearchChunkSearch=new JKe(this._ctx,this._embeddingType,this._localDiffSearch,this._githubCodeSearchService),n.onDidWorkspaceAdded(s=>{this._workspaceFileIndexes.set(s.workspaceFolder.uri,s);let c=new RJe(this._ctx,s,this._embeddingType,o);this._localEmbeddingsByWorkspace.set(s.workspaceFolder.uri,c);let l=new FJe(this._ctx,s,{embeddingType:this._embeddingType});this._localTfidfByWorkspace.set(s.workspaceFolder.uri,l);let u=new TJe(this._ctx,s,this._githubCodeSearchService);this._diffTrackersByWorkspace.set(s.workspaceFolder.uri,u),process.env.GITHUB_COPILOT_SIMULATION!=="1"&&!ZP(this._ctx)&&(u.initialize(),c.triggerLocalIndexing(),l.initialize())}),n.onDidWorkspaceRemoved(s=>{let c=s.workspaceFolder.uri,l=this._diffTrackersByWorkspace.get(c);l&&(l.dispose(),this._diffTrackersByWorkspace.delete(c));let u=this._localTfidfByWorkspace.get(c);u&&(u.dispose(),this._localTfidfByWorkspace.delete(c));let d=this._localEmbeddingsByWorkspace.get(c);d&&(d.dispose(),this._localEmbeddingsByWorkspace.delete(c))})}static{a(this,"WorkspaceChunkSearchServiceImpl")}dispose(){this._githubCodeSearchService.dispose();for(let e of this._localTfidfByWorkspace.values())e.dispose();this._localTfidfByWorkspace.clear();for(let e of this._localEmbeddingsByWorkspace.values())e.dispose();this._localEmbeddingsByWorkspace.clear();for(let e of this._diffTrackersByWorkspace.values())e.dispose();this._diffTrackersByWorkspace.clear(),this._workspaceFileIndexes.clear()}async searchWorkspace(e,r,n){let o=new iq.StopWatch,s=await this.resolveQueryText(e,n);Zc.info(this._ctx,"Starting semantic search",{resolvedQuery:s,maxResults:AA(r),tokenBudget:r.tokenBudget,workspaceFolders:r.workspaceFolders});let c=this.toQueryWithEmbeddings(e,s),l=await this.doSearchFileChunks(c,r,n);if(l.isError())throw Zc.error(this._ctx,"Semantic search failed",l.err),Z0.sendAggregateFailure(this._ctx,l.err),new Error(`Workspace chunk search failed: ${l.err.errorDiagMessage}`);Zc.info(this._ctx,`Search strategy '${l.val.strategy}' returned results`,{strategy:l.val.strategy,chunkCount:l.val.result.chunks.length});let u=await(0,Gx.raceCancellationError)(this.filterIgnoredChunks(l.val.result.chunks),n);Zc.info(this._ctx,"Chunks filtered",{beforeFilter:l.val.result.chunks.length,afterFilter:u.length});let d=await this.rerankChunks(c,u,AA(r),n),f=d.length,m=new Set(d.map(A=>A.chunk.file)).size,g=o.elapsed();return Zc.info(this._ctx,`Search completed successfully in ${o.elapsed()}ms`,{totalTime:o.elapsed(),strategy:l.val.strategy,finalChunkCount:f,uniqueFileCount:m}),Z0.sendAggregateSuccess(this._ctx,l.val.strategy,g,f,m,r.workspaceFolders.length,r.source),{chunks:d}}toQueryWithEmbeddings(e,r){let n;return{...e,resolveQueryEmbeddings:a(o=>(n??=this.computeQueryEmbedding(e,o,r),n),"resolveQueryEmbeddings")}}async computeQueryEmbedding(e,r,n){Lh(r);let o=n??await this.resolveQueryText(e,r),s=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,[o],{inputType:"query"},r);if(!s?.values.length)throw new Error("Failed to compute query embeddings");return s.values[0]}async resolveQueryText(e,r){try{return await e.resolveQuery(r)}catch(n){if(ck(n))throw n;return Zc.debug(this._ctx,"Falling back to raw query text",n),e.rawQuery}}getEmbeddingComputer(){return this._embeddingComputer||(this._embeddingComputer=new Ule(this._ctx)),this._embeddingComputer}async doSearchFileChunks(e,r,n){Zc.info(this._ctx,"Starting semantic search with fallback strategy");let o=process.env.GITHUB_COPILOT_SIMULATION==="1"?1e6:12500;return this.runSearchStrategyWithFallback(this._codeSearchChunkSearch,()=>(0,Gx.createCancelablePromise)(s=>this.doSearchFileChunksLocally(e,r,s)),o,e,r,n)}async runSearchStrategyWithFallback(e,r,n,o,s,c){let l=new iq.StopWatch;Zc.info(this._ctx,`Attempting primary strategy '${e.id}'`,{timeout:n});let u=(0,Gx.createCancelablePromise)(g=>this.runSearchStrategy(e,o,s,g));c.onCancellationRequested(()=>u.cancel());let d=await(0,Gx.raceCancellationError)((0,Gx.raceTimeout)(u,n),c);if(d?.isOk())return Zc.info(this._ctx,`Primary strategy '${e.id}' succeeded in ${l.elapsed()}ms`,{strategy:e.id,elapsedTime:l.elapsed()}),d;Zc.warn(this._ctx,`Primary strategy '${e.id}' failed or timed out, falling back to local search`,{elapsedTime:l.elapsed(),isTimeout:d===void 0,error:d?.isError()?d.err:void 0});let f=r();c.onCancellationRequested(()=>f.cancel()),f.then(()=>u.cancel(),()=>u.cancel());let h=new iq.StopWatch,m=await NJe([u,f]);return Zc.info(this._ctx,`Search operation completed in ${l.elapsed()}ms (fallback took ${h.elapsed()}ms)`,{totalTime:l.elapsed(),fallbackTime:h.elapsed(),success:m.isOk()}),m}async doSearchFileChunksLocally(e,r,n){Zc.info(this._ctx,"Starting local file chunk search",{folderCount:r.workspaceFolders.length});let o=[],s=new Set;for(let l of r.workspaceFolders){let u=this._localEmbeddingsByWorkspace.get(l),d=this._localTfidfByWorkspace.get(l);if(u&&d){Zc.info(this._ctx,`Both strategies available for folder: ${l}, using embeddings with TF-IDF fallback`);let f=8e3,h=new iq.StopWatch,m=await this.runSearchStrategyWithFallback(u,()=>(0,Gx.createCancelablePromise)(g=>this.runSearchStrategy(d,e,r,g)),f,e,r,n);m.isOk()&&(o.push(...m.val.result.chunks),s.add(m.val.strategy),Zc.info(this._ctx,`Folder search completed in ${h.elapsed()}ms`,{folder:l,strategy:m.val.strategy,chunkCount:m.val.result.chunks.length,elapsedTime:h.elapsed()}))}else if(u){Zc.info(this._ctx,`Using embeddings search for folder: ${l}`);let f=new iq.StopWatch,h=await this.runSearchStrategy(u,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(u.id),Zc.info(this._ctx,`Embeddings search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else if(d){Zc.info(this._ctx,`Using TF-IDF search for folder: ${l}`);let f=new iq.StopWatch,h=await this.runSearchStrategy(d,e,r,n);o.push(...h.isOk()?h.val.result.chunks:[]),s.add(d.id),Zc.info(this._ctx,`TF-IDF search completed in ${f.elapsed()}ms`,{folder:l,chunkCount:h.isOk()?h.val.result.chunks.length:0,elapsedTime:f.elapsed()})}else Zc.warn(this._ctx,`No local search strategy available for folder: ${l}`)}let c=s.size===1?s.values().next().value:"mixed";return Zc.info(this._ctx,"Local search completed",{strategy:c,totalChunkCount:o.length,strategiesUsed:Array.from(s)}),XIe.Result.ok({strategy:c,result:{chunks:o}})}async runSearchStrategy(e,r,n,o){let s=new iq.StopWatch;Zc.info(this._ctx,`Running search strategy '${e.id}'`);try{let c=await(0,Gx.raceCancellationError)(e.searchWorkspace(r,n,o),o);return c?(Zc.info(this._ctx,`Strategy '${e.id}' completed successfully in ${s.elapsed()}ms`,{strategy:e.id,chunkCount:c.chunks.length,elapsedTime:s.elapsed()}),XIe.Result.ok({strategy:e.id,result:c})):(Zc.warn(this._ctx,`Strategy '${e.id}' returned no result`,{strategy:e.id,elapsedTime:s.elapsed()}),XIe.Result.error({errorDiagMessage:`${e.id}: no result`}))}catch(c){if(ck(c))throw Zc.info(this._ctx,`Strategy '${e.id}' was cancelled`,{elapsedTime:s.elapsed()}),c;return Zc.error(this._ctx,c,`Error during '${e.id}' search, elapsed: ${s.elapsed()}ms`),XIe.Result.error({errorDiagMessage:`${e.id} error: ${String(c)}`})}}async filterIgnoredChunks(e){return(0,qSn.coalesce)(await Promise.all(e.map(async r=>(await this._ctx.get(ec).evaluate(r.chunk.file,r.chunk.text)).isBlocked?null:r)))}async rerankChunks(e,r,n,o){if(!r.length)return[];try{let s,c=r.at(0)?.distance?.embeddingType;if(c&&r.every(f=>typeof f.distance<"u"&&f.distance.embeddingType.equals(c)))s=[...r].sort((f,h)=>h.distance.value-f.distance.value);else{let h=r.map((A,y)=>({...A.chunk,distance:A.distance,index:y})).filter(A=>typeof A.distance>"u"||!A.distance.embeddingType.equals(this._embeddingType)),m;if(h.length){Zc.debug(this._ctx,`WorkspaceChunkSearch.rerankChunks. Scoring ${h.length} new chunks`);let A=this.scoreChunks(e,h,o);m=await(0,Gx.raceCancellationError)(A,o)}let g=[];for(let A=0;AA?.distance?.embeddingType.equals(this._embeddingType)).sort((A,y)=>y.distance.value-A.distance.value)}if(!s.length)return s;s=s.slice(0,n);let u=s[0].distance.value*OIe,d=s.filter(f=>f.distance.value>=u);return Zc.debug(this._ctx,`Eagerly filtered out ${s.length-d.length} chunks due to low quality`),d}catch(s){return ck(s)||Zc.error(this._ctx,"Failed to search chunk embeddings index"),r.slice(0,n)}}async scoreChunks(e,r,n){if(!r.length)return[];let o=r.map(l=>this.chunkToIndexString(l)),[s,c]=await(0,Gx.raceCancellationError)(Promise.all([e.resolveQueryEmbeddings(n),this.computeEmbeddings("document",o,n)]),n);return c.values.map((l,u)=>({chunk:r[u],distance:BIe(s,l)}))}async computeEmbeddings(e,r,n){let o=await this.getEmbeddingComputer().computeEmbeddings(this._embeddingType,r,{inputType:e},n);if(!o)throw new Error("Failed to compute embeddings");return o}chunkToIndexString(e){return this.toStringForEmbeddingsComputer(e,Ko(e.file)??e.file)}toStringForEmbeddingsComputer(e,r){let n=yA(e.text);return`File: \`${r}\` ${n} ${e.text} -${n}`}};var JJe=ce(WYe()),kSn=ce(require("os"));var fKo=Math.min(Math.max(Math.ceil(kSn.cpus().length/2),1),10),jjt=class{constructor(){this._acquired=!1;this._waiters=[]}static{a(this,"AsyncLock")}async acquireAsync(){if(!this._acquired){this._acquired=!0;return}await new Promise(e=>this._waiters.push(e))}release(){let e=this._waiters.shift();e?e():this._acquired=!1}},RSn=new ge("ProjectContextSkill"),Vle=class t{constructor(){this.isActive=!0}static{a(this,"WorkerPoolToken")}static{this.workerPoolStarted=!1}static{this.activeProcessCount=0}static{this.allTokens=[]}static{this.lock=new jjt}static async startWorkerPool(){await t.lock.acquireAsync();try{t.workerPoolStarted||(t.workerPoolStarted=!0,await JJe.start({maxWorkers:fKo})),t.activeProcessCount++;let e=new t;return t.allTokens.push(e),e}finally{t.lock.release()}}async stopWorkerPool(){if(this.isActive){await t.lock.acquireAsync();try{this.isActive&&(this.isActive=!1,t.activeProcessCount--,t.activeProcessCount==0&&(await JJe.stop(),t.workerPoolStarted=!1),t.allTokens.includes(this)&&t.allTokens.splice(t.allTokens.indexOf(this),1))}finally{t.lock.release()}}}static async forceStopWorkerPool(){let e=t.allTokens[Symbol.iterator]();for(let r of e)await r.stopWorkerPool();t.workerPoolStarted=!1,t.activeProcessCount=0}},RIe=Vle.startWorkerPool.bind(Vle);var m0d=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),P7t=47,Hjt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(x3);return}let r=[],n=this.turnContext.ctx.get(Jn),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new ZM(d.document,u,u),h=new Ar([l]),g=xIe(c)?.5:.8;r.push([`Code excerpt from file \`${ho(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Wle,c,zu(d),u)}}if(r.length>0)return r.unshift([new Ar(["The user wants you to consider the following snippets when computing your answer."]),1]),new Ar(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},x3="collect-project-context",YJe=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(RSn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(x3,"Collecting relevant project context"),jL(e.ctx)){await e.steps.error(x3,"Workspace indexing is disabled by configuration");return}await e.info(Ws`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(kP);if(!r){await e.steps.error(x3,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(x3,"No workspace folders available for search");return}let o=In(e.turn.request.message),c=await(this.dependencies.parseUserQuery??D7t)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(x3,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:p_n,maxResults:Math.min(10*c.length,P7t),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??xmn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(x3,"No project context found");return}return await e.steps.finish(x3),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(x3,"Project context search failed"),RSn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}};var Wle="project-context",KJe=class extends Xm{static{a(this,"ProjectContextSkill")}constructor(e){super(Wle,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new Hjt(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>!jL(r))}};var Gjt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Wle]}};async function Px(t){let e=[];return e.push(new oKe),e.push(...await t.get(vP).agents()),e.push(new Gjt),e.push(new HYe),e}a(Px,"getAgents");p();p();var Vx=require("fs"),SK=ce(require("path"));Ns();var Z0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return qt(this.ctx,je.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=SK.dirname(o);await Vx.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` -`;await Vx.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){Ye.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:gr(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return SK.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return SK.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await Vx.promises.readFile(n,"utf8")).trim().split(` -`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(Ye.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await Vx.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(Ye.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await Vx.promises.unlink(n),Ye.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&Ye.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=SK.dirname(o);await Vx.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` +${n}`}};var jSn=new Ae("ProjectContextSkill"),Epd=S.Object({uri:S.String(),snippet:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})})}),AYo=47,eHt=class{constructor(e){this.turnContext=e}static{a(this,"ProjectContextSkillProcessor")}value(){return 1}async processSkill(e){if(this.turnContext.cancelationToken.isCancellationRequested){await this.turnContext.steps.cancel(_3);return}let r=[],n=this.turnContext.ctx.get(ri),o=this.removeDuplicateSnippets(e);for(let s of o){let{uri:c,snippet:l,range:u}=s,d=await n.getOrReadTextDocument(s);if(d.status==="valid"){let f=new JM(d.document,u,u),h=new yr([l]),g=MIe(c)?.5:.8;r.push([`Code excerpt from file \`${Ko(c)}\`:`,1],[f.wrapInTicks(h,g),1]),await this.turnContext.collectFile(Gle,c,Ku(d),u)}}if(r.length>0)return r.unshift([new yr(["The user wants you to consider the following snippets when computing your answer."]),1]),new yr(r)}removeDuplicateSnippets(e){let r={};return e.forEach(n=>{let o=`${n.uri}#[${n.range.start.line},${n.range.start.character}]-[${n.range.end.line},${n.range.end.character}]`;r[o]||(r[o]=n)}),Object.values(r)}},_3="collect-project-context",$Je=class{constructor(e={}){this.dependencies=e}static{a(this,"SemanticSearchSkillResolver")}async resolveSkill(e){if(jSn.debug(e.ctx,"Resolving project context via semantic search skill resolver"),await e.steps.start(_3,"Collecting relevant project context"),ZP(e.ctx)){await e.steps.error(_3,"Workspace indexing is disabled by configuration");return}await e.info(sa`Project context is applied to this response, which may lead to slightly longer load times. For faster and more general Copilot responses, remove the project context option from your prompt.`);let r=e.ctx.get(wk);if(!r){await e.steps.error(_3,"Code search service for project context is unavailable");return}let n=[];if(e.turn.workspaceFolder&&n.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let u of e.turn.workspaceFolders)n.includes(u.uri)||n.push(u.uri);if(!n.length){await e.steps.error(_3,"No workspace folders available for search");return}let o=Rn(e.turn.request.message),c=await(this.dependencies.parseUserQuery??iCn)(e,e.cancelationToken);if(!c||c.length===0){await e.steps.error(_3,"No keywords parsed from user query");return}let l=c.join(" ");try{let u=await r.searchWorkspace({rawQuery:o,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:l,keywords:c.map(f=>({keyword:f,variations:[]}))}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(l),"resolveQuery")},{tokenBudget:sCn,maxResults:Math.min(10*c.length,AYo),workspaceFolders:n,source:"projectContext"},e.cancelationToken);if(await(this.dependencies.telemetryIndexCodesearch??zyn)(e,"semantic_search",{localSnippetCount:u.chunks.length}),u.chunks.length===0){await e.steps.error(_3,"No project context found");return}return await e.steps.finish(_3),u.chunks.map(f=>({uri:f.chunk.file,snippet:f.chunk.text,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}))}catch(u){await e.steps.error(_3,"Project context search failed"),jSn.error(e.ctx,"Error during workspace chunk search for project context:",u);return}}},Gle="project-context",VJe=class extends rg{static{a(this,"ProjectContextSkill")}constructor(e){super(Gle,"Code snippets and documentation from the open project. This skill is useful when the user question is specific to the open project and its context. Do not include this skill for general programming questions.","Performing code search",()=>e,r=>new eHt(r),"implicit",["Relevant: How do I add a custom server route?","Relevant: Where is the code that processes the response from CopyableThreadElement?","Relevant: Where do I add tests for the InputValidation class?","Relevant: How to implement a shared buffer component","Not relevant: What does numpy do?"],r=>!ZP(r))}};var tHt=class{constructor(){this.slug="project";this.name="Project";this.description="Ask about your project"}static{a(this,"ProjectAgent")}additionalSkills(){return[Gle]}};async function Nx(t){let e=[];return e.push(new VKe),e.push(...await t.get(Tk).agents()),e.push(new tHt),e.push(new LKe),e}a(Nx,"getAgents");p();p();var $x=require("fs"),yK=fe(require("path"));As();var X0=class{constructor(e){this.ctx=e}static{a(this,"ConversationTranscriptPersistence")}isEnabled(){return!!this.getTranscriptDirectory()}getTranscriptDirectory(){return Ht(this.ctx,Je.TranscriptDirectory)}async appendEvent(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=yK.dirname(o);await $x.promises.mkdir(s,{recursive:!0,mode:448});let c=JSON.stringify(n)+` +`;await $x.promises.appendFile(o,c,{encoding:"utf8",mode:384})}catch(o){ot.error(this.ctx,`Failed to append transcript event: ${o instanceof Error?o.message:String(o)}`)}}async initializePartition(e,r,n){if(!this.isEnabled())return;let o={type:"partition.created",data:{conversationId:String(e),partitionId:r,...n},id:ir(),timestamp:new Date().toISOString(),parentId:null};await this.appendEvent(e,r,o)}getTranscriptPath(e,r){return`${e}/partition-${r}.jsonl`}getTranscriptFilePath(e,r){let n=this.getTranscriptDirectory();if(!n)throw new Error("Transcript directory not configured");return yK.join(n,String(e),`partition-${r}.jsonl`)}getConversationDirectory(e){let r=this.getTranscriptDirectory();if(!r)throw new Error("Transcript directory not configured");return yK.join(r,String(e))}async readTranscriptFile(e,r){if(!this.isEnabled())return[];try{let n=this.getTranscriptFilePath(e,r);return(await $x.promises.readFile(n,"utf8")).trim().split(` +`).filter(c=>c.length>0).map(c=>JSON.parse(c))}catch(n){return n.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read transcript file: ${n instanceof Error?n.message:String(n)}`),[])}}async listPartitionTranscripts(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e);return(await $x.promises.readdir(r)).filter(o=>o.startsWith("partition-")&&o.endsWith(".jsonl")&&!o.includes(".v")).map(o=>{let s=o.match(/^partition-(\d+)\.jsonl$/);return s?parseInt(s[1],10):NaN}).filter(o=>!isNaN(o)).sort((o,s)=>o-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list partition transcripts: ${r instanceof Error?r.message:String(r)}`),[])}}async deleteTranscript(e,r){if(this.isEnabled())try{let n=this.getTranscriptFilePath(e,r);await $x.promises.unlink(n),ot.debug(this.ctx,`Deleted transcript: ${n}`)}catch(n){n.code!=="ENOENT"&&ot.error(this.ctx,`Failed to delete transcript: ${n instanceof Error?n.message:String(n)}`)}}async writeTranscriptFile(e,r,n){if(this.isEnabled())try{let o=this.getTranscriptFilePath(e,r),s=yK.dirname(o);await $x.promises.mkdir(s,{recursive:!0,mode:448});let c=n.map(l=>JSON.stringify(l)).join(` `)+` -`;await Vx.promises.writeFile(o,c,{encoding:"utf8",mode:384}),Ye.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){Ye.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return SK.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await Vx.promises.readFile(o,"utf8")).trim().split(` -`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(Ye.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new Gf({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=PSn(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new Gf({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await Vx.promises.access(s)}catch{continue}await Vx.promises.copyFile(s,c),Ye.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){Ye.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new Gf({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=PSn(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new Gf({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),Ye.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){Ye.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){Ye.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return Ye.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await Vx.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(Ye.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function DSn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(DSn,"createUserMessageEvent");function NSn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(NSn,"createUserMessageRenderedEvent");function ZJe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(ZJe,"createAssistantMessageEvent");function MSn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:gr(),timestamp:new Date().toISOString(),parentId:n}}a(MSn,"createToolExecutionStartEvent");function OSn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:gr(),timestamp:new Date().toISOString(),parentId:n}}a(OSn,"createToolExecutionCompleteEvent");function XJe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:gr(),timestamp:new Date().toISOString(),parentId:e}}a(XJe,"createAssistantTurnStartEvent");function zle(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:gr(),timestamp:new Date().toISOString(),parentId:r}}a(zle,"createAssistantTurnEndEvent");function PSn(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(PSn,"parseAssistantMessageContent");var w3=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},pO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new Z0(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){Ye.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return Ye.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;Ye.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){Ye.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new w3(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw Ye.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new w3(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw Ye.error(this.ctx,o.message),o}return Ye.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){Ye.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new w3(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw Ye.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new w3("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw Ye.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new w3(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return Ye.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return Ye.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return Ye.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;Ye.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),Ye.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){Ye.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;Ye.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new w3(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw Ye.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){Ye.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(Ye.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,Ye.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return Ye.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof w3||(Ye.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof Gf)return e;let r=e,n=new Gf(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){Ye.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){Ye.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){Ye.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});ht(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});ht(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});ht(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();var BSn=ce(require("path"));var $jt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??ji(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},ag=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new uQ}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(Wn(o.uri));else if(o.type==="location")r.add(BSn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${dQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${dQ}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}getPromptTemplate(e){let r=this.promptTemplatesCache?.get(e);return r?Promise.resolve(r):Promise.resolve(this.collectBufferedPrompts().find(n=>n.name===e))}async listCustomPrompts(e){let o=(await this.ctx.get(zm).collect(this.ctx,"prompt",e)).map(l=>new $jt(l));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let s=[...o],c=new Set(o.map(l=>l.name));for(let l of this.collectBufferedPrompts())c.has(l.name)||(c.add(l.name),s.push(l));for(let l of s)this.promptTemplatesCache.set(l.name,l);return s}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r){return(await this.listCustomPrompts(e)).find(o=>o.name===r)}async applyPromptTemplateToRequest(e,r){let n=e.message.trim();if(!n.startsWith("/"))return!1;let[o,...s]=n.split(" "),c=o.replace("/",""),l=s.join(" ");if(!c)return!1;let u=r?.length?await this.getCustomPromptByName(r,c):await this.getPromptTemplate(c);if(!u)return!1;if(u.uri.startsWith(dQ))return e.message=`Follow instructions: ${u.content} - -${l}`,!0;e.message=`Follow instructions in [${u.name}](${u.uri}). ${l}`;let d=e.references??[];return d.some(f=>f.type==="file"&&f.uri===u.uri)||d.push({type:"file",uri:u.uri}),e.references=d,!0}};p();p();p();var LSn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> +`;await $x.promises.writeFile(o,c,{encoding:"utf8",mode:384}),ot.debug(this.ctx,`Wrote ${n.length} events to transcript: ${o}`)}catch(o){ot.error(this.ctx,`Failed to write transcript file: ${o instanceof Error?o.message:String(o)}`)}}getVersionedTranscriptFilePath(e,r,n){let o=this.getTranscriptDirectory();if(!o)throw new Error("Transcript directory not configured");return yK.join(o,String(e),`partition-${r}.v${n}.jsonl`)}async readVersionedTranscriptFile(e,r,n){if(!this.isEnabled())return[];try{let o=this.getVersionedTranscriptFilePath(e,r,n);return(await $x.promises.readFile(o,"utf8")).trim().split(` +`).filter(l=>l.length>0).map(l=>JSON.parse(l))}catch(o){return o.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to read versioned transcript file: ${o instanceof Error?o.message:String(o)}`),[])}}async buildPartitionFromVersionedTranscript(e,r,n){let o=await this.readVersionedTranscriptFile(e,r,n);if(o.length===0)return;let s=[];for(let l of o)switch(l.type){case"user.message":{let u=l.data.content,d=l.data.turnId,f=new Yf({message:u,type:"user"},d);f.timestamp=new Date(l.timestamp).getTime(),s.push(f);break}case"assistant.message":{if(s.length>0){let u=s[s.length-1],d=l.data.content,f=HSn(d);u.response={message:f,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let u=s[s.length-1];u.status==="in-progress"&&(u.status="success")}break}case"partition.created":{let u=l.data.summary;if(u&&l.data.compressedFrom){let d=new Yf({message:u,type:"meta"},l.data.turnId);d.timestamp=new Date(l.timestamp).getTime(),d.response={message:"",type:"model"},d.status="success",s.push(d)}break}case"user.message_rendered":{let u=l.data.turnId,d=l.data.renderedMessage;if(u&&d){for(let f=s.length-1;f>=0;f--)if(String(s[f].id)===u){s[f].renderedUserMessage=d;break}}break}case"tool.execution_start":case"tool.execution_complete":case"session.start":case"assistant.turn_start":break}let c=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:s,status:"archived",createdAt:s[0]?.timestamp??Date.now(),startTurnNumber:c,endTurnNumber:c+s.length-1,turnCount:s.length}}async archiveTranscriptsAsVersion(e,r,n){if(this.isEnabled())for(let o of r)try{let s=this.getTranscriptFilePath(e,o),c=this.getVersionedTranscriptFilePath(e,o,n);try{await $x.promises.access(s)}catch{continue}await $x.promises.copyFile(s,c),ot.debug(this.ctx,`Archived transcript: ${s} -> ${c}`)}catch(s){ot.error(this.ctx,`Failed to archive transcript for partition ${o}: ${s instanceof Error?s.message:String(s)}`)}}async replayTranscriptToTurns(e,r,n){let o=await this.readTranscriptFile(e,r);if(o.length===0)return[];let s=[],c=!1,l=new Map,u=new Map;for(let d of o){if(c)break;switch(d.type){case"user.message":{let f=d.data.content,h=d.data.turnId,m=new Yf({message:f,type:"user"},h);m.timestamp=new Date(d.timestamp).getTime(),s.push(m),n!==void 0&&m.id===n&&(c=!0);break}case"assistant.message":{if(s.length>0){let f=s[s.length-1],h=d.data.content,m=HSn(h);f.response={message:m,type:"model"}}break}case"assistant.turn_end":{if(s.length>0){let f=s[s.length-1];f.status==="in-progress"&&(f.status="success"),n!==void 0&&f.id===n&&(c=!0)}break}case"partition.created":{let f=d.data.summary;if(f&&d.data.compressedFrom){let h=new Yf({message:f,type:"meta"},d.data.turnId);h.timestamp=new Date(d.timestamp).getTime(),h.response={message:"",type:"model"},h.status="success",s.push(h)}break}case"tool.execution_start":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.start=d,l.set(f,h),s.length>0&&u.set(f,s.length-1)}break}case"tool.execution_complete":{let f=d.data.toolCallId;if(f){let h=l.get(f)||{};h.complete=d,l.set(f,h)}break}case"user.message_rendered":{let f=d.data.turnId,h=d.data.renderedMessage;if(f&&h){for(let m=s.length-1;m>=0;m--)if(String(s[m].id)===f){s[m].renderedUserMessage=h;break}}break}case"session.start":case"assistant.turn_start":break}}return this.reconstructToolCallsForTurns(s,l,u),ot.debug(this.ctx,`Replayed transcript: partitionId=${r}, events=${o.length}, turns=${s.length}`),s}reconstructToolCallsForTurns(e,r,n){let o=new Map;for(let[s,c]of r){let l=n.get(s);if(l===void 0){ot.debug(this.ctx,`Tool call ${s} has no associated turn`);continue}let u=this.reconstructToolCallFromEvents(s,c);if(u){let d=o.get(l)||[];d.push(u),o.set(l,d)}}for(let[s,c]of o)if(s0){let l=e[s],u=[{roundId:1,toolCalls:c}];l.restoredToolCalls=u}}reconstructToolCallFromEvents(e,r){let{start:n,complete:o}=r;if(!n){ot.debug(this.ctx,`Tool call ${e} has no start event`);return}let s=n.data.toolName||"unknown",c=n.data.arguments,l="running",u,d,f,h,m;if(o){let A=o.data.success;o.data.status==="Cancelled"?l="cancelled":A?l="completed":l="error";let E=o.data.result;E&&(u=E.result,d=E.error,f=E.resultDetails,h=E.toolSpecificData,m=E.progressMessage)}let g={id:e,name:s,toolType:"default",status:l,input:c};return u&&(g.result=u),d&&(g.error=d),f&&(g.resultDetails=f),h&&(g.toolSpecificData=h),m&&(g.progressMessage=m),g}async buildPartitionFromTranscript(e,r){let n=await this.replayTranscriptToTurns(e,r);if(n.length===0&&(await this.readTranscriptFile(e,r)).length===0)return;let o=(r-1)*10+1;return{conversationId:e,partitionId:r,turns:n,status:"active",createdAt:n[0]?.timestamp??Date.now(),startTurnNumber:o,endTurnNumber:o+n.length-1,turnCount:n.length}}async findTurnInTranscripts(e,r){let n=await this.listPartitionTranscripts(e);if(n.length===0)return;let o=String(r);for(let s=n.length-1;s>=0;s--){let c=n[s];if(!(await this.readTranscriptFile(e,c)).some(h=>(h.type==="user.message"||h.type==="assistant.turn_end")&&h.data&&String(h.data.turnId)===o))continue;let d=await this.replayTranscriptToTurns(e,c),f=d.findIndex(h=>String(h.id)===o);if(f!==-1)return{partitionId:c,turnIndex:f};if(d.length>0){let h=d[d.length-1];return ot.info(this.ctx,`Turn ${o} referenced in partition ${c} events but not in replayed turns (split-turn from compression). Resolving to turn ${h.id}.`),{partitionId:c,turnIndex:d.length-1,resolvedTurnId:h.id}}}}async deriveMetadata(e){let r=await this.listPartitionTranscripts(e);if(r.length===0)return;let n=Math.max(...r),o=r.length,s=Date.now(),c=Math.min(...r),l=await this.readTranscriptFile(e,c);l.length>0&&(s=new Date(l[0].timestamp).getTime());let u=Date.now(),d=await this.readTranscriptFile(e,n);if(d.length>0){let h=d[d.length-1];u=new Date(h.timestamp).getTime()}let f=await this.listArchivedVersions(e);return{conversationId:e,currentPartitionId:n,totalPartitions:o,createdAt:s,lastActivity:u,archivedVersions:f.length>0?f:void 0}}async listArchivedVersions(e){if(!this.isEnabled())return[];try{let r=this.getConversationDirectory(e),n=await $x.promises.readdir(r),o=new Set;for(let s of n){let c=s.match(/partition-\d+\.v(\d+)\.jsonl$/);c&&o.add(parseInt(c[1],10))}return Array.from(o).sort((s,c)=>c-s)}catch(r){return r.code==="ENOENT"?[]:(ot.error(this.ctx,`Failed to list archived versions: ${r instanceof Error?r.message:String(r)}`),[])}}};function GSn(t,e,r=null,n){return{type:"user.message",data:{content:t,turnId:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(GSn,"createUserMessageEvent");function $Sn(t,e,r=null){return{type:"user.message_rendered",data:{turnId:t,renderedMessage:e},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a($Sn,"createUserMessageRenderedEvent");function WJe(t,e,r=null,n){return{type:"assistant.message",data:{content:t,messageId:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a(WJe,"createAssistantMessageEvent");function VSn(t,e,r,n=null){return{type:"tool.execution_start",data:{toolCallId:t,toolName:e,arguments:r},id:ir(),timestamp:new Date().toISOString(),parentId:n}}a(VSn,"createToolExecutionStartEvent");function WSn(t,e,r,n=null,o){return{type:"tool.execution_complete",data:{toolCallId:t,success:e,result:r,...o},id:ir(),timestamp:new Date().toISOString(),parentId:n}}a(WSn,"createToolExecutionCompleteEvent");function zJe(t,e=null,r){return{type:"assistant.turn_start",data:{turnId:t,...r},id:ir(),timestamp:new Date().toISOString(),parentId:e}}a(zJe,"createAssistantTurnStartEvent");function $le(t,e,r=null,n){return{type:"assistant.turn_end",data:{turnId:t,status:e,...n},id:ir(),timestamp:new Date().toISOString(),parentId:r}}a($le,"createAssistantTurnEndEvent");function HSn(t){try{let e=JSON.parse(t);if(Array.isArray(e)&&e.length>0&&typeof e[0]=="object"&&e[0]&&"role"in e[0])return e}catch{}return t}a(HSn,"parseAssistantMessageContent");var v3=class extends Error{constructor(r,n){super(r);this.code=n;this.name="RestorationError"}static{a(this,"RestorationError")}},aO=class{constructor(e){this.ctx=e;this.transcriptPersistence=new X0(e)}static{a(this,"ConversationRestoration")}async findTurnInPartitions(e,r){ot.debug(this.ctx,`Finding turn in partitions: conversationId=${e}, turnId=${r}`);let n=await this.transcriptPersistence.findTurnInTranscripts(e,r);if(n)return ot.debug(this.ctx,`Turn found in transcript: conversationId=${e}, turnId=${r}, partitionId=${n.partitionId}, turnIndex=${n.turnIndex}`),n;ot.debug(this.ctx,`Turn not found: conversationId=${e}, turnId=${r}`)}async loadPartitionForRestoration(e,r){ot.debug(this.ctx,`Loading partition for restoration: conversationId=${e}, partitionId=${r}`);let n=await this.transcriptPersistence.buildPartitionFromTranscript(e,r);if(!n){let o=new v3(`Partition not found: conversationId=${e}, partitionId=${r}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,o.message),o}if(!Array.isArray(n.turns)){let o=new v3(`Invalid partition data: turns is not an array: conversationId=${e}, partitionId=${r}`,"INVALID_PARTITION_DATA");throw ot.error(this.ctx,o.message),o}return ot.debug(this.ctx,`Partition built from transcript: conversationId=${e}, partitionId=${r}, turnCount=${n.turns.length}`),n}async loadVersionedPartition(e,r,n){ot.debug(this.ctx,`Loading versioned partition: conversationId=${e}, partitionId=${r}, version=${n}`);let o=await this.transcriptPersistence.buildPartitionFromVersionedTranscript(e,r,n);if(!o){let s=new v3(`Versioned partition not found: conversationId=${e}, partitionId=${r}, version=${n}`,"PARTITION_NOT_FOUND");throw ot.error(this.ctx,s.message),s}if(!Array.isArray(o.turns)){let s=new v3("Invalid versioned partition data: turns is not an array","INVALID_PARTITION_DATA");throw ot.error(this.ctx,s.message),s}return o}reconstructTurns(e,r){let n=e.turns.findIndex(s=>s.id===r);if(n===-1)throw new v3(`Turn not found in partition: turnId=${r}, partitionId=${e.partitionId}`,"TURN_NOT_FOUND");let o=e.turns.slice(0,n+1);return ot.debug(this.ctx,`Reconstructed turns: partitionId=${e.partitionId}, targetTurnIndex=${n}, turnCount=${o.length}`),o.map(s=>this.ensureTurnInstance(s))}async isLatestTurn(e,r,n,o){if(n.partitionId!==o.currentPartitionId)return ot.debug(this.ctx,`Turn ${r} is not in current partition (in P${n.partitionId}, current is P${o.currentPartitionId})`),!1;let s=await this.transcriptPersistence.replayTranscriptToTurns(e,o.currentPartitionId);if(s.length===0)return!1;let c=s[s.length-1],l=c.id===r;return ot.debug(this.ctx,`Turn ${r} isLatest=${l} (last turn is ${c.id})`),l}async createVersionArchive(e,r,n,o){if(o.length===0)return r;ot.info(this.ctx,`Creating version archive: conversationId=${e}, versionTimestamp=${n}, partitions=${o.join(",")}`),await this.archiveTranscriptsAsVersion(e,o,n),ot.debug(this.ctx,`Archived ${o.length} transcript partitions with version ${n}`);for(let c of o)await this.transcriptPersistence.deleteTranscript(e,c);return{...r,archivedVersions:[...r.archivedVersions??[],n],lastActivity:Date.now()}}async archiveTranscriptsAsVersion(e,r,n){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.archiveTranscriptsAsVersion(e,r,n)}catch(o){ot.error(this.ctx,`Failed to archive transcripts: ${o instanceof Error?o.message:String(o)}`)}}async restoreConversation(e,r){let n=Date.now(),o=r;ot.debug(this.ctx,`Starting conversation restoration: conversationId=${e}, targetTurnId=${o}`),this.sendStartedTelemetry(e,o);try{let s=await this.transcriptPersistence.deriveMetadata(e);if(!s){let m=new v3(`No transcripts found for conversation: conversationId=${e}`,"CONVERSATION_NOT_FOUND");throw ot.error(this.ctx,m.message),this.sendFailedTelemetry(e,o,m.code,Date.now()-n),m}let c=await this.findTurnInPartitions(e,o);if(!c){ot.debug(this.ctx,`Turn not found for restoration: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"TURN_NOT_FOUND",Date.now()-n);return}c.resolvedTurnId&&(ot.info(this.ctx,`Turn ${o} resolved to ${c.resolvedTurnId} in partition ${c.partitionId} (split-turn from compression)`),o=c.resolvedTurnId);let l=await this.isLatestTurn(e,o,c,s),u;if(!l){let m=Date.now(),A=(await this.transcriptPersistence.listPartitionTranscripts(e)).filter(y=>y>=c.partitionId);s=await this.createVersionArchive(e,s,m,A),u=m,ot.info(this.ctx,`Version created: conversationId=${e}, version=${m}`)}let d;u?d=await this.loadVersionedPartition(e,c.partitionId,u):d=await this.loadPartitionForRestoration(e,c.partitionId);let f=this.reconstructTurns(d,o);u&&(await this.rewritePartitionTranscriptFromVersion(e,c.partitionId,o,u),s={...s,currentPartitionId:c.partitionId,totalPartitions:c.partitionId,lastActivity:Date.now()});let h=Date.now()-n;return ot.info(this.ctx,`Conversation restored: conversationId=${e}, partitionId=${c.partitionId}, turnCount=${f.length}, versionCreated=${u??"none"}, duration=${h}ms`),this.sendCompletedTelemetry(e,o,c.partitionId,f.length,h),{partitionId:c.partitionId,turns:f,metadata:s,partition:d,versionCreated:u}}catch(s){throw s instanceof v3||(ot.exception(this.ctx,s,`Restoration failed: conversationId=${e}, targetTurnId=${o}`),this.sendFailedTelemetry(e,o,"UNKNOWN",Date.now()-n)),s}}ensureTurnInstance(e){if(e instanceof Yf)return e;let r=e,n=new Yf(r.request,r.id);return n.timestamp=r.timestamp??Date.now(),n.response=r.response,n.status=r.status??"success",n.skills=r.skills??[],n.ignoredSkills=r.ignoredSkills??[],n.annotations=r.annotations??[],n.workspaceFolder=r.workspaceFolder,n.workspaceFolders=r.workspaceFolders,n.agent=r.agent,n.template=r.template,n.confirmationRequest=r.confirmationRequest,n.confirmationResponse=r.confirmationResponse,n.chatMode=r.chatMode,n.needToolCallConfirmation=r.needToolCallConfirmation,n.userRequestedModel=r.userRequestedModel,n.resolvedModelConfiguration=r.resolvedModelConfiguration,n}async initializeRestoredTranscript(e,r){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,r,{source:"restoration"})}catch(n){ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)}}sliceTranscriptEventsToTurn(e,r){let n=String(r),o=[],s=!1;for(let c of e){if(s&&c.type==="user.message"){let l=c.data.turnId;if(l!==void 0&&String(l)!==n)break}if(o.push(c),!s){if(c.type==="user.message"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}else if(c.type==="partition.created"){let l=c.data.turnId;l!==void 0&&String(l)===n&&(s=!0)}}}return o}async rewritePartitionTranscriptFromVersion(e,r,n,o){if(this.transcriptPersistence.isEnabled())try{let s=await this.transcriptPersistence.readVersionedTranscriptFile(e,r,o);if(s.length===0){ot.warn(this.ctx,`No versioned transcript events found when rewriting: conversationId=${e}, partitionId=${r}, version=${o}`);return}let c=this.sliceTranscriptEventsToTurn(s,n);await this.transcriptPersistence.writeTranscriptFile(e,r,c)}catch(s){ot.error(this.ctx,`Failed to rewrite transcript from version: conversationId=${e}, partitionId=${r}, version=${o}, error=${s instanceof Error?s.message:String(s)}`)}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r)},{});yt(this.ctx,"conversationPartition.restoration.started",n,0)}sendCompletedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),partitionId:String(n)},{turnCount:o,restorationTimeMs:s});yt(this.ctx,"conversationPartition.restoration.completed",c,0)}sendFailedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),targetTurnId:String(r),errorCode:n},{restorationTimeMs:o});yt(this.ctx,"conversationPartition.restoration.failed",s,0)}};p();p();p();p();var zSn={id:0,start_offset:0,stop_offset:0,type:"ip_code_citations",details:{},citations:{snippet:`html lang="en"> Canvas Example -<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},FSn="Alright, This response contains a code citation.";p();var USn=` +<`,url:"https://github.com/duonghle285/gnoud9x.github.io/tree/c95127bc5b7a491d9223f21ac3b8c5100996e754/26062020-vehinhchunhat%2Findex.html",ip_type:"LICENSE",license:"NOASSERTION"}},YSn="Alright, This response contains a code citation.";p();var KSn=` # Should render ## Links @@ -3001,16 +3030,16 @@ Only img src/alt and a href attributes should make it to the dom. The following paragraph should not render the \`id\` attribute in the dom.

This is a paragraph with an id

-`;p();var QSn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",pKo=95,hKo={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function qSn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(qSn,"parseFirstNumber");function mKo(t){return Math.min(100,Math.max(0,t))}a(mKo,"clampPercentage");function gKo(t){return t.includes("session")?"session":"weekly"}a(gKo,"getRateLimitNotificationKind");function AKo(t,e,r){let n=$ce(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(AKo,"getRateLimitNotificationMessage");function yKo(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(yKo,"getRateLimitErrorVariant");var Vjt=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new Vp(QSn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},Yjt=new Vjt,Wjt=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=gKo(n),s=mKo(qSn(n)??pKo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=AKo(o,s,c);return await e.ctx.get(IS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new Vp("Alright, I'm producing a rate limit notification")}},Kjt=new Wjt,zjt=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=yKo(n),s=qSn(n),c=KQ.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:hKo[o],isAuto:n.includes("auto")});return new Vp(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},Jjt=new zjt;p();function EKo(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(EKo,"createVulnerability");var HSn=sIe` +`;p();var JSn="You've reached your monthly chat messages limit. Upgrade to Copilot Pro (30-day free trial) or wait for your limit to reset.",yYo=95,EYo={agent:"agent_mode_limit_exceeded",overloaded:"model_overloaded",upstream:"upstream_provider_rate_limit",global:"user_global_rate_limited",model:"user_model_rate_limited",integration:"integration_rate_limited",unknown:"some_new_code"};function ZSn(t){let e=t.match(/\b\d+\b/);return e?Number.parseInt(e[0],10):void 0}a(ZSn,"parseFirstNumber");function _Yo(t){return Math.min(100,Math.max(0,t))}a(_Yo,"clampPercentage");function vYo(t){return t.includes("session")?"session":"weekly"}a(vYo,"getRateLimitNotificationKind");function CYo(t,e,r){let n=ile(r);return t==="session"?`You've used ${e}% of your session rate limit. Your session rate limit will reset on ${n}.`:`You've used ${e}% of your weekly rate limit. Your weekly rate limit will reset on ${n}.`}a(CYo,"getRateLimitNotificationMessage");function bYo(t){return t.includes("agent")?"agent":t.includes("overloaded")?"overloaded":t.includes("upstream")?"upstream":t.includes("global")?"global":t.includes("model")?"model":t.includes("integration")?"integration":t.includes("unknown")?"unknown":"default"}a(bYo,"getRateLimitErrorVariant");var rHt=class{constructor(){this.id="debug.upgrade";this.description="upgrade for debugging purposes";this.shortDescription="upgrade";this.scopes=["chat-panel"]}static{a(this,"DebugUpgradePromptTemplate")}response(e){return new Yp(JSn,{message:"",code:402,responseIsIncomplete:!0,responseIsFiltered:!1})}},oHt=new rHt,nHt=class{constructor(){this.id="debug.ratelimit.notify";this.description="Generate weekly or session rate limit notifications";this.shortDescription="RateLimit Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugRateLimitNotificationPromptTemplate")}async response(e,r){let n=r.toLowerCase(),o=vYo(n),s=_Yo(ZSn(n)??yYo),c=new Date(Date.now()+(o==="session"?3600*1e3:10080*60*1e3)).toISOString(),l=CYo(o,s,c);return await e.ctx.get(SS).notifyRateLimitWarning({type:o,rateLimit:{entitlement:100,percentRemaining:100-s,resetDate:c},message:l}),new Yp("Alright, I'm producing a rate limit notification")}},sHt=new nHt,iHt=class{constructor(){this.id="debug.ratelimit.error";this.description="Generate 429 rate limit errors for agent, model, global, integration, or default cases";this.shortDescription="RateLimit Error";this.scopes=["chat-panel"]}static{a(this,"DebugRateLimitErrorPromptTemplate")}response(e,r){let n=r.toLowerCase(),o=bYo(n),s=ZSn(n),c=R_.translateErrorMessage(429,void 0,void 0,s,void 0,{capiErrorCode:o==="default"?void 0:EYo[o],isAuto:n.includes("auto")});return new Yp(c,{message:"",code:429,reason:"rate limit exceeded",retryAfter:s,responseIsIncomplete:!0,responseIsFiltered:!1})}},aHt=new iHt;p();function SYo(t,e,r){return{id:t,start_offset:e,stop_offset:r,type:"code_vulnerability",details:{type:"server-side-unvalidated-url-redirection",description:"Allows a URL to be redirected to a different URL that is specified by an external user.",ui_type:"test",ui_description:"test"}}}a(SYo,"createVulnerability");var eTn=hIe` Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. -`,eZe=sIe` +`,YJe=hIe` \`\`\`kotlin fun main() { println("Hello, World!") } \`\`\` -`,_Ko=sIe` +`,TYo=hIe` ### Inputs \`p\` - paragraph message @@ -3026,20 +3055,20 @@ The following paragraph should not render the \`id\` attribute in the dom. \`/debug.vulnerability pcc2\` - 1 paragraph followed by 2 code blocks with 2 vulnerabilities each \`/debug.vulnerability cpc3\` - 1 code block followed by 1 paragraph followed by 1 code block--each code block has 3 vulnerabilities -`,Zjt=` +`,cHt=` -`,jSn=HSn+Zjt+eZe;function GSn(t){let e=1,r="",n=[];if(t.length===0)r=jSn;else if(t==="0")r=jSn,e=0;else{if(t==="help")return{reply:_Ko,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=HSn+Zjt:s==="c"&&(r+=eZe+Zjt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(eZe,o);if(c===-1)break;let l=c+eZe.length;for(let u=0;u0?r:"Debug Fail")}},vKo=new Xjt,eHt=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new Vp("Alright, I'm producing a notification",void 0,[],s)}},bKo=new eHt,tHt=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new Vp(CKo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},SKo=new tHt,rHt=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new Vp(await BAn(e))}},TKo=new rHt,nHt=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[EP,Vy]}instructions(e,r){return"Create a function that prints a christmas tree"}},IKo=new nHt,iHt=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new Vp(In(e.turn.request.message))}},xKo=new iHt,oHt=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(eg).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=Ws` +`,XSn=eTn+cHt+YJe;function tTn(t){let e=1,r="",n=[];if(t.length===0)r=XSn;else if(t==="0")r=XSn,e=0;else{if(t==="help")return{reply:TYo,vulnerabilities:[]};{let o=t.slice(-1);isNaN(Number(o))||(e=Number(o),t=t.slice(0,-1));for(let s of t)s==="p"?r+=eTn+cHt:s==="c"&&(r+=YJe+cHt);r=r.trimEnd()}}if(e>0){let o=0,s=0;for(;;){let c=r.indexOf(YJe,o);if(c===-1)break;let l=c+YJe.length;for(let u=0;u0?r:"Debug Fail")}},xYo=new lHt,uHt=class{constructor(){this.id="debug.notify";this.description="Notify for debugging purposes";this.shortDescription="Notify";this.scopes=["chat-panel","inline"]}static{a(this,"DebugNotificationPromptTemplate")}response(e,r){let n="warning";r.includes("info")&&(n="info");let o=r.replace("info","").replace("warning","").trim(),s=[{severity:n,message:o.length>0?o:"Debug Notification"}];return new Yp("Alright, I'm producing a notification",void 0,[],s)}},wYo=new uHt,dHt=class{constructor(){this.id="debug.filter";this.description="Make the RAI filter kick in";this.shortDescription="RAI Filter";this.scopes=["chat-panel"]}static{a(this,"DebugFilterPromptTemplate")}response(e){return e.turn.status="filtered",new Yp(IYo,{message:"",responseIsFiltered:!0,responseIsIncomplete:!1})}},RYo=new dHt,fHt=class{constructor(){this.id="debug.dump";this.description="Dump the conversation";this.shortDescription="Dump";this.scopes=["chat-panel"]}static{a(this,"DebugDumpPromptTemplate")}async response(e){return new Yp(await qEn(e))}},PYo=new fHt,pHt=class{constructor(){this.id="debug.tree";this.description="Jingle bells, jingle bells, jingle all the way";this.shortDescription="Christmas Tree";this.scopes=["chat-panel"]}static{a(this,"DebugChristmasTreePromptTemplate")}requiredSkills(){return[Ck,zy]}instructions(e,r){return"Create a function that prints a christmas tree"}},kYo=new pHt,hHt=class{constructor(){this.id="debug.echo";this.description="Echo the user message back to the user";this.shortDescription="Echo";this.scopes=["chat-panel"]}static{a(this,"DebugEchoPromptTemplate")}response(e){return new Yp(Rn(e.turn.request.message))}},DYo=new hHt,mHt=class{constructor(){this.id="debug.prompt";this.description="Show the prompt for the last response or generate a new one";this.shortDescription="Prompt";this.scopes=["chat-panel"]}static{a(this,"DebugPromptPromptTemplate")}response(e,r){let n=e.ctx.get(ng).getLastTurnPrompts();if(n!==void 0&&n.size>0){let o="Here are the prompts used in the last turn:";return n.forEach((s,c)=>{o+=sa` ### ${c} prompt \`\`\`\` ${s} \`\`\`\` - `}),new Vp(o)}return new Vp("No prompt available")}},wKo=new oHt,sHt=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new Vp(await LAn(e,n,o))}},RKo=new sHt,aHt=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=GSn(r);return e.turn.annotations.push(...o),new Vp(n,void 0,e.turn.annotations)}},kKo=new aHt,cHt=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(LSn),new Vp(FSn,void 0,e.turn.annotations)}},PKo=new cHt,lHt=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new Vp(USn)}},DKo=new lHt,uHt=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},NKo=new uHt,dHt=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[Wle]}},MKo=new dHt,fHt=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new Vp("Alright, I'm producing a notification",void 0,[],[],[],e)}},OKo=new fHt;function $Sn(){return[vKo,Yjt,Kjt,Jjt,bKo,SKo,IKo,TKo,xKo,wKo,RKo,kKo,PKo,OKo,DKo,NKo,MKo]}a($Sn,"getDebugTemplates");p();var VSn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:hf}))}),pHt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(dq,e.uri,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(dq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(dq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new Ar([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),jQ(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new Ar([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new Ar([["```"+l,1],[yS(c),.8],["```",1]]))}return new Ar(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await Uo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},dq="problems-in-active-document",tZe=class extends Xm{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(dq,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new pHt(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var rZe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get(cn).getWorkspaceFolder(e),n=this.fileExistFn(),o=new IIe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=xIe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!xIe(e))return;let n=this.turnContext.ctx.get(cn).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new IIe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${BKo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${LKo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new Ar([[`${FKo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new Ar([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(Jn),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(PP,e,zu(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[yS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(Fo).stat(e),!0}catch{return!1}}}},BKo="Code excerpt from the implementation source file",LKo="Code excerpt from the test file",FKo="Code excerpt from an example test file";var WSn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),hHt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(Jn),n=new rZe(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(PP,e.testFileUri,zu(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(PP,e.sourceFileUri,zu(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(PP,e.sourceFileUri,zu(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(PP,e.testFileUri,zu(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},PP="test-context",nZe=class extends Xm{static{a(this,"TestContextSkill")}constructor(e){super(PP,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new hHt(r))}};p();var zSn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:hf}))}),mHt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(TK,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new Ar(["The latest test run produced the following failures and errors:"]);return new Ar([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(Jn),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(TK,s,zu(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new Ar(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` -`)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new Ar([Ws`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new Ar(n)}appendCode(e,r,n){let o=[new Ar([` + `}),new Yp(o)}return new Yp("No prompt available")}},NYo=new mHt,gHt=class{constructor(){this.id="debug.skills";this.description="Resolves and displays all available skills or a single skill (id) if provided";this.shortDescription="Skills";this.scopes=["chat-panel"]}static{a(this,"DebugSkillsPromptTemplate")}async response(e,r,n){let o,s;if(r.length>0){let c=r.split(" ");o=c[0],s=c.slice(1).join(" ")}return e.turn.request.message=s??"",new Yp(await jEn(e,n,o))}},MYo=new gHt,AHt=class{constructor(){this.id="debug.vulnerability";this.description="Create a message with a vulnerability annotation";this.shortDescription="Vulnerability";this.scopes=["chat-panel"]}static{a(this,"DebugVulnerabilityPromptTemplate")}response(e,r){let{reply:n,vulnerabilities:o}=tTn(r);return e.turn.annotations.push(...o),new Yp(n,void 0,e.turn.annotations)}},OYo=new AHt,yHt=class{constructor(){this.id="debug.citation";this.description="Create a message with a code citation annotation";this.shortDescription="CodeCitation";this.scopes=["chat-panel"]}static{a(this,"DebugCodeCitationPromptTemplate")}response(e){return e.turn.annotations.push(zSn),new Yp(YSn,void 0,e.turn.annotations)}},BYo=new yHt,EHt=class{constructor(){this.id="debug.markdown";this.description="Markdown rendering specification by example";this.shortDescription="Markdown";this.scopes=["chat-panel","inline"]}static{a(this,"DebugMarkdownRenderingPromptTemplate")}response(){return new Yp(KSn)}},LYo=new EHt,_Ht=class{constructor(){this.id="debug.long";this.description="Generate a long response";this.shortDescription="Long";this.scopes=["chat-panel"]}static{a(this,"DebugLongPromptTemplate")}instructions(e,r){return"Write out the OWASP top 10 with code examples in java"}},FYo=new _Ht,vHt=class{constructor(){this.id="debug.project";this.description="Generate a response using the project context skill";this.shortDescription="Project";this.scopes=["chat-panel","inline"]}static{a(this,"DebugProjectContextPromptTemplate")}requiredSkills(){return[Gle]}},UYo=new vHt,CHt=class{constructor(){this.id="debug.confirmation";this.description="Generate a response with a confirmation";this.shortDescription="Confirmation";this.scopes=["chat-panel","inline"]}static{a(this,"DebugConfirmationPromptTemplate")}response(){let e={type:"action",title:"Confirmation that you want to proceed",message:"Do you want to proceed?",agentSlug:"debug.confirmation",confirmation:{answer:"yes"}};return new Yp("Alright, I'm producing a notification",void 0,[],[],[],e)}},QYo=new CHt;function rTn(){return[xYo,oHt,sHt,aHt,wYo,RYo,kYo,PYo,DYo,NYo,MYo,OYo,BYo,QYo,LYo,FYo,UYo]}a(rTn,"getDebugTemplates");p();var nTn=S.Object({uri:S.String(),problems:S.Array(S.Object({message:S.String(),range:pf}))}),bHt=class{constructor(e){this.turnContext=e}static{a(this,"ProblemsInActiveDocumentSkillProcessor")}value(){return 1}async processSkill(e){let r=this.turnContext.ctx.get(ri),n=await r.getOrReadTextDocument(e);if(await this.turnContext.collectFile(oq,e.uri,Ku(n)),n.status==="valid"){let o=r.getRelativePath(n.document);this.turnContext.collectLabel(oq,`problems in ${o}`);let s=this.getElidableProblems(e,n,o);return await this.preElideDocuments(s)}else this.turnContext.collectLabel(oq,"problem markers")}getElidableProblems(e,r,n){let o=[];return o.push(new yr([`Problems and errors in the active document (\`${n}\`):`])),o.push(...this.createElidableProblems(e,r)),VQ(o,"linear")}createElidableProblems(e,r){return e.problems.map(n=>{let o=[];o.push(new yr([`- "${n.message}" at line ${n.range.start.line}.`+(r.document?" Excerpt from the code:":"")]));let s=n.range,c;if(s&&(this.isEmpty(s)?c=r.document.lineAt(s.start).text:c=r.document.getText(s),c)){let l=r.document.detectedLanguageId;o.push(new yr([["```"+l,1],[hS(c),.8],["```",1]]))}return new yr(o)})}isEmpty(e){return e.start.line===e.end.line&&e.start.character===e.end.character}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new yr([n])}},oq="problems-in-active-document",KJe=class extends rg{static{a(this,"ProblemsInActiveDocumentSkill")}constructor(e){super(oq,"List of problems and errors in the active document, useful when the user question is about finding and fixing errors, non-functioning code, compilation issues, etc.","Analyzing problems and errors",()=>e,r=>new bHt(r),"explicit",["How can I fix the errors?","Why is my app not working?","Why am I getting compilation errors?","Raw error messages or stack traces"])}};p();p();var JJe=class{constructor(e){this.turnContext=e}static{a(this,"PromptForTestGeneration")}async fromImplementationFile(e){let r=this.turnContext.ctx.get(an).getWorkspaceFolder(e),n=this.fileExistFn(),o=new NIe(this.turnContext.ctx,n,r?.uri),s=await o.findTestFileForSourceFile(e.uri),c=MIe(e.uri);if(s&&!c){let l=e.detectedLanguageId;if(await n(s))return await this.asTestFilePrompt(l,s);{let u=o.findExampleTestFile(e.uri);if(u)return await this.asExampleFilePrompt(l,u)}}}async fromTestFile(e){if(!MIe(e))return;let n=this.turnContext.ctx.get(an).getWorkspaceFolder(e),o=this.fileExistFn(),c=await new NIe(this.turnContext.ctx,o,n?.uri).findImplFileForTestFile(e.uri);if(c){let l=e.detectedLanguageId;if(await o(c))return await this.asImplFilePrompt(l,c)}}async asImplFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${qYo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}async asTestFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${jYo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}async asExampleFilePrompt(e,r){let n=await this.fileInfoForPrompt(r);if(n){let[o,s]=n;return new yr([[`${HYo} \`${s}\`:`,1],["```"+e,1],[o,.9],["```",1]])}return new yr([])}async fileInfoForPrompt(e){if(!this.turnContext.isFileIncluded(e)){let r=this.turnContext.ctx.get(ri),n=await r.getOrReadTextDocument({uri:e});if(await this.turnContext.collectFile(Rk,e,Ku(n)),n.status==="valid"){let o=r.getRelativePath(n.document);return[hS(n.document.getText()),o]}}}fileExistFn(){return async e=>{try{return await this.turnContext.ctx.get(jo).stat(e),!0}catch{return!1}}}},qYo="Code excerpt from the implementation source file",jYo="Code excerpt from the test file",HYo="Code excerpt from an example test file";var iTn=S.Object({currentFileUri:S.String(),sourceFileUri:S.Optional(S.String()),testFileUri:S.Optional(S.String())}),SHt=class{constructor(e){this.turnContext=e}static{a(this,"TestContextSkillProcessor")}value(){return .9}async processSkill(e){let r=this.turnContext.ctx.get(ri),n=new JJe(this.turnContext);if(e.sourceFileUri&&e.testFileUri){if(e.sourceFileUri!==e.currentFileUri&&e.testFileUri!==e.currentFileUri)return;if(e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(Rk,e.testFileUri,Ku(o)),o.status==="valid")return await n.asImplFilePrompt(o.document.detectedLanguageId,e.sourceFileUri)}else if(e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(Rk,e.sourceFileUri,Ku(o)),o.status==="valid")return await n.asTestFilePrompt(o.document.detectedLanguageId,e.testFileUri)}}else if(e.sourceFileUri&&e.sourceFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.sourceFileUri});if(await this.turnContext.collectFile(Rk,e.sourceFileUri,Ku(o)),o.status==="valid")return await n.fromImplementationFile(o.document)}else if(e.testFileUri&&e.testFileUri===e.currentFileUri){let o=await r.getOrReadTextDocument({uri:e.testFileUri});if(await this.turnContext.collectFile(Rk,e.testFileUri,Ku(o)),o.status==="valid")return await n.fromTestFile(o.document)}}},Rk="test-context",ZJe=class extends rg{static{a(this,"TestContextSkill")}constructor(e){super(Rk,"Example tests useful for creating, adding and fixing tests, to detect available test frameworks as well as finding the corresponding implementation to existing tests","Searching test examples",()=>e,r=>new SHt(r))}};p();var oTn=S.Object({failures:S.Array(S.Object({testName:S.String(),testSuite:S.Optional(S.String()),testFileUri:S.String(),failureReason:S.Optional(S.String()),testLocation:pf}))}),THt=class{constructor(e){this.turnContext=e}static{a(this,"TestFailuresSkillProcessor")}value(){return .9}async processSkill(e){if(e.failures.length>0){this.turnContext.collectLabel(EK,"test failures");let r=await this.createElidableFailures(e.failures);if(r){let n=new yr(["The latest test run produced the following failures and errors:"]);return new yr([[n,1],[r,1]])}}}async createElidableFailures(e){let r=this.turnContext.ctx.get(ri),n=[],o=this.groupFailuresByFile(e);for(let[s,c]of o.entries()){let l=await r.getOrReadTextDocument({uri:s});if(await this.turnContext.collectFile(EK,s,Ku(l)),l.status==="valid"){let u=r.getRelativePath(l.document),d=this.createElidableFailuresOfDoc(c,u),f=this.appendCode(d,u,l.document);n.push([f,1])}}if(n.length>0)return new yr(n)}groupFailuresByFile(e){let r=new Map;for(let n of e){let o=r.get(n.testFileUri)||[];o.push(n),r.set(n.testFileUri,o)}return r}createElidableFailuresOfDoc(e,r){let n=e.map(o=>{let s=`\`${o.testName}\``,c=`${o.testSuite?` in suite \`${o.testSuite}\``:""}`,l=` in file \`${r}\` `,u=". ";o.failureReason&&(u=" with the following error:",o.failureReason.includes(` +`)?u+="\n```\n"+o.failureReason+"\n```\n":u+=` \`${o.failureReason}\`. `);let d=`${o.testLocation.start.line==o.testLocation.end.line?"on line "+o.testLocation.start.line:"between lines "+o.testLocation.start.line+" and "+o.testLocation.end.line}`;return[new yr([sa`\n\n- Test ${s}${c}${l}failed${u}The failed test is ${d}.\n`]),1]});return new yr(n)}appendCode(e,r,n){let o=[new yr([` The code of file \`${r}\` is: -`]),.6],s=[new Ar([["```"+n.detectedLanguageId,1],[yS(n.getText()),.9],["```",1]]),.7];return new Ar([[e,1],o,s])}},TK="test-failures",iZe=class extends Xm{static{a(this,"TestFailuresSkill")}constructor(e){super(TK,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new mHt(r))}};var Vp=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},IK=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` -`+r}requiredSkills(){return this.skills}},UKo=new IK("tests","Generate unit tests","Generate Tests",Ws` +`]),.6],s=[new yr([["```"+n.detectedLanguageId,1],[hS(n.getText()),.9],["```",1]]),.7];return new yr([[e,1],o,s])}},EK="test-failures",XJe=class extends rg{static{a(this,"TestFailuresSkill")}constructor(e){super(EK,"Test failures and errors of the latest test run","Collecting test failures",()=>e,r=>new THt(r))}};var Yp=class{constructor(e,r,n=[],o=[],s=[],c){this.message=e;this.error=r;this.annotations=n;this.notifications=o;this.references=s;this.confirmationRequest=c}static{a(this,"PromptTemplateResponse")}},_K=class{constructor(e,r,n,o,s=[],c=[],l,u=!1){this.id=e;this.description=r;this.shortDescription=n;this.prompt=o;this.skills=s;this.scopes=c;this.inlinePrompt=l;this.producesCodeEdits=u}static{a(this,"StaticPromptTemplate")}instructions(e,r,n="panel"){let o;return n==="inline"?o=this.inlinePrompt??this.prompt:o=this.prompt,o+` +`+r}requiredSkills(){return this.skills}},GYo=new _K("tests","Generate unit tests","Generate Tests",sa` Write a set of unit tests for the code above, or for the selected code if provided. Provide tests for the functionality of the code and not the implementation details. The tests should test the happy path as well as the edge cases. @@ -3050,18 +3079,18 @@ The code of file \`${r}\` is: Follow the same test style as in existing tests if they exist. You must not create inline comments like "Arrange, Act, Assert", unless existing tests use inline comments as well. If existing tests use any mocking or stubbing libraries, use the same libraries before writing your own test doubles. - `,[PP,TK],["chat-panel","agent-panel","editor"]),QKo=new IK("simplify","Simplify the code","Simplify This",Ws` + `,[Rk,EK],["chat-panel","agent-panel","editor"]),$Yo=new _K("simplify","Simplify the code","Simplify This",sa` Provide a simplified version of the selected code above. Do not change the behavior of the code. The code should still be readable and easy to understand. Do not reply with the original code but only a simplified version. - Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],Ws` + Do only reply with one code snippet that contains the complete simplified code and explain what you have simplified after.`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],sa` Provide a simplified version of the selected code. Modify the selected code to make it simpler and easier to understand. Do not change the behavior of the code. Removing empty lines is not a simplification. You must not omit any code that is necessary for the code to compile and run, for example by replacing lines with ... or similar. - Do not reply with the original code but only a simplified version.`,!0),qKo=new IK("fix","Fix problems and compile errors","Fix This",Ws` + Do not reply with the original code but only a simplified version.`,!0),VYo=new _K("fix","Fix problems and compile errors","Fix This",sa` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. @@ -3072,36 +3101,36 @@ The code of file \`${r}\` is: Show how the error can be fixed by providing a code snippet that displays the code before and after it has been fixed after each group. Shorten fully qualified class names to the simple class name and full file paths to the file names only. When enumerating the groups, start with the word "Problem" followed by the number and a quick summary of the problem. Format this headline bold. - At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[dq],["editor","chat-panel","agent-panel","inline","inline-agent"],Ws` + At last provide a completely fixed version of the code if the fixes required multiple code changes.`,[oq],["editor","chat-panel","agent-panel","inline","inline-agent"],sa` Fix the provided errors and problems. Do not invent new problems. The fixed code should still be readable and easy to understand. If there are no problems provided do reply that you can't detect any problems and the user should describe more precisely what they want to be fixed. Do not attempt to fix problems that are not provided, like unbalanced brackets or parentheses that are not causing errors. - Briefly explain the problems without repeating the detailed error message.`,!0),jKo=new IK("explain","Explain how the code works","Explain This",Ws` + Briefly explain the problems without repeating the detailed error message.`,!0),WYo=new _K("explain","Explain how the code works","Explain This",sa` Write an explanation for the selected code above as paragraphs of text. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. - The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],Ws` + The explanation should be easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,[],["editor","chat-panel","agent-panel","inline"],sa` Write an explanation for the code the user is selecting. Include excerpts of code snippets to underline your explanation. Do not repeat the complete code. - Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),HKo=new IK("doc","Document the current selection or file","Generate Docs",Ws` + Keep the explanation brief and easy to understand for a developer who is familiar with the programming language used but not familiar with the code.`,!1),zYo=new _K("doc","Document the current selection or file","Generate Docs",sa` Write documentation for the selected code. If no code is explicitly selected, document the provided code in its entirety. The reply should be a codeblock containing the code with the documentation added as comments. - Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],Ws` + Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.)`,[],["editor","chat-panel","agent-panel","inline","inline-agent"],sa` Add documentation to the provided code. If a specific selection is given, only document the selected code. Otherwise, document all the code provided. Modify the code by adding documentation as comments. Use the most appropriate documentation style for the programming language used (e.g. JSDoc for JavaScript, docstrings for Python etc.). - Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),gHt=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=cUt(e.conversation),n=Ws` + Place the comments before functions and methods, unless the language has a different convention (for example Python's docstring).`,!0),IHt=class{constructor(){this.id="feedback";this.description="Steps to provide feedback";this.shortDescription="Feedback";this.scopes=["chat-panel","agent-panel"]}static{a(this,"FeedbackPromptTemplate")}response(e){let r=vQt(e.conversation),n=sa` You can provide direct feedback by pressing the thumbs up/down buttons on a single message. In case you want to share more details, please click [here](https://aka.ms/copilot-jetbrains-feedback) to share your feedback. - `;return r?new Vp(n+` + `;return r?new Yp(n+` In order to help us understand your feedback better, you can include the following identifier in your feedback: by doing so, you are granting us permission to access the telemetry data associated with your feedback. \`\`\`yaml ${e.conversation.id}/${r} -\`\`\``):new Vp(n)}},GKo=new gHt,AHt=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=yHt(e.ctx).filter(o=>o!=this),n=Ws` +\`\`\``):new Yp(n)}},YYo=new IHt,xHt=class{constructor(){this.id="help";this.description="Get help on how to use Copilot chat";this.shortDescription="Help";this.scopes=["chat-panel","agent-panel"]}static{a(this,"HelpPromptTemplate")}response(e){let r=wHt(e.ctx).filter(o=>o!=this),n=sa` You can ask me general programming questions, or use one of the following commands to get help with a specific task: ${r.map(o=>`- \`/${o.id}\` - ${o.description}`).join(` @@ -3113,37 +3142,39 @@ ${e.conversation.id}/${r} - On top of files, **I take different parts of your IDE into consideration** when answering questions. This includes, but is not limited to, test results and failures, build and runtime logs, active Git repository as well as details of the open project. - **Make refinements** by asking me follow-up questions, adding clarifications, providing errors, etc. - **Review my suggested code** and tell me about issues or improvements, so I can iterate on it. - `;return new Vp(n)}},$Ko=new AHt;function xK(){return[UKo,QKo,qKo,jKo,HKo,GKo,$Ko,...$Sn()]}a(xK,"getPromptTemplates");function yHt(t){let e=xK();return!lCe(t)&&!v1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(yHt,"getUserFacingPromptTemplates");var oZe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Vo=class{constructor(e){this.ctx=e;this.conversations=new nn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new SY([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Qh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new oZe(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;Ye.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(pO).restoreConversation(r,n);if(!u){Ye.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new SY(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Qh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new oZe(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),Ye.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){Ye.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return Ye.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),gt(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new Z0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{Ye.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!sW.has(To(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!sW.has(To(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){Ye.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){Ye.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new Z0(this.ctx);if(!n.isEnabled())return;let o=DSn(In(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new Z0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=In(r.response.message),s=String(r.id),c=ZJe(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=zle(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&In(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(In(r.request.message),"@");(await Px(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(In(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(In(r.request.message),"/"),s=xK().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(In(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(In(n.request.message),"/"),l=await e.get(ag).getPromptTemplate(o);l&&(l.uri.startsWith(dQ)?n.request.message=`Follow instructions: ${l.content} + `;return new Yp(n)}},KYo=new xHt;function C3(){return[GYo,$Yo,VYo,WYo,zYo,YYo,KYo,...rTn()]}a(C3,"getPromptTemplates");function wHt(t){let e=C3();return!J_e(t)&&!m1(t)&&(e=e.filter(r=>!r.id.startsWith("debug."))),e}a(wHt,"getUserFacingPromptTemplates");var sTn=fe(require("path"));var RHt=class{constructor(e){this.promptFileEntry=e;let{promptPath:r,parsedPromptFile:n}=e;this._name=r.name??n.header?.name??Ki(n.uri).replace(".prompt.md","")}static{a(this,"CustomPrompt")}get parsedPromptFile(){return this.promptFileEntry.parsedPromptFile}get uri(){return this.parsedPromptFile.uri}get name(){return this._name}get description(){return this.promptFileEntry.promptPath.description??this.parsedPromptFile.header?.description}get mode(){return this.parsedPromptFile.header?.agent}get model(){return this.parsedPromptFile.header?.model}get content(){return this.parsedPromptFile.body?.content??""}get isReadonly(){let e=this.promptFileEntry.promptPath.storage;return this.isBuiltIn||e==="extension"}get isBuiltIn(){return this.promptFileEntry.promptPath.storage==="clsAssets"}},sg=class t{constructor(e,r){this.ctx=e;this.promptFileLocationRegistry=r;this.promptTemplatesCache=null;this.promptBuffers=new Map;this.patternsByKey=new Map;this.syncRegistry()}static{a(this,"CustomPromptService")}static{this.DEFAULT_PROMPT_REGISTRATION=".github/prompts/**/*.prompt.md"}static{this.PROMPT_GLOB_SUFFIX="**/*.prompt.md"}syncRegistry(){let e=new Set([t.DEFAULT_PROMPT_REGISTRATION]);for(let r of this.patternsByKey.values())for(let n of r)e.add(n);this.registryPromptPatterns=this.promptFileLocationRegistry.replace(this.registryPromptPatterns,"prompt",Array.from(e),{watchable:!0})}static{this.parser=new IQ}partitionSettings(e){let r=new Set,n=[];for(let o of e)if(o.type==="file")r.add(kn(o.uri));else if(o.type==="location")r.add(sTn.default.posix.join(o.path,t.PROMPT_GLOB_SUFFIX));else if(o.type==="content"){let s=this.resolvePrompt(o);s&&n.push(s)}return{patterns:Array.from(r),prompts:n}}setGlobalPromptFiles(e){this.setPromptSettingsForKey(e||[],"global-prompt-files")}collectBufferedPrompts(){return Array.from(this.promptBuffers.values()).flat()}resolvePrompt(e){if(!e.content?.trim())return;let r=t.parser.parse(`${xQ}global-prompt`,e.content);if(!r.body?.content?.trim())return;let n=r.header?.name??"global-prompt";return{uri:`${xQ}${n}`,name:n,description:r.header?.description,mode:r.header?.agent,model:r.header?.model,content:r.body.content,isReadonly:!0,isBuiltIn:!1}}setPromptFileLocations(e,r="workspace"){this.setPromptSettingsForKey(e,r)}setPromptSettingsForKey(e,r){let{patterns:n,prompts:o}=this.partitionSettings(e);this.promptBuffers.set(r,o),this.patternsByKey.set(r,n),this.promptTemplatesCache=null,this.syncRegistry()}getPromptTemplate(e){let r=this.promptTemplatesCache?.get(e);return r?Promise.resolve(r):Promise.resolve(this.collectBufferedPrompts().find(n=>n.name===e))}async listCustomPrompts(e){let o=(await this.ctx.get(Zm).collect(this.ctx,"prompt",e)).map(l=>new RHt(l));this.promptTemplatesCache?this.promptTemplatesCache.clear():this.promptTemplatesCache=new Map;let s=[...o],c=new Set(o.map(l=>l.name));for(let l of this.collectBufferedPrompts())c.has(l.name)||(c.add(l.name),s.push(l));for(let l of s)this.promptTemplatesCache.set(l.name,l);return s}async getCustomPromptById(e,r){return(await this.listCustomPrompts(e)).find(o=>o.uri===r)}async getCustomPromptByName(e,r){return(await this.listCustomPrompts(e)).find(o=>o.name===r)}async applyPromptTemplateToRequest(e,r,n){let o=e.message.trim();if(!o.startsWith("/"))return!1;let[s,...c]=o.split(" "),l=s.replace("/",""),u=c.join(" ");if(!l)return!1;let d=r?.length?await this.getCustomPromptByName(r,l):await this.getPromptTemplate(l);if(d){if(d.uri.startsWith(xQ))return e.message=`Follow instructions: ${d.content} -${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(Qh).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new Z0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{Ye.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var sZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))Ye.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):Ye.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var aZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):Ye.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var VKo="X-Initiator",WKo="X-Interaction-ID",zKo="X-Interaction-Type";var cZe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},EHt=class extends cZe{static{a(this,"User")}static id(){return"user"}},_Ht=class extends cZe{static{a(this,"Agent")}static id(){return"agent"}},CHt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[VKo]:this.initiator,[WKo]:this.interactionId,[zKo]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return gA.agent(e??this.interactionType,this.interactionId)}},gA=class t extends CHt{static{a(this,"LlmInteraction")}static user(e,r){return new t(EHt,e,r)}static agent(e,r){return new t(_Ht,e,r)}};function YSn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(YSn,"interactionTypeForChatMode");var Wx=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new vHt(this),this.steps=new aZe(e,r,n,e.get(vc)),this.collector=new bHt(r,n,e.get(vc)),this.agentToolCalls=new sZe(e,r,n,e.get(vc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return gA.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?gA.agent(e,this.turn.telemetryId):gA.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(vc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},lZe=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},pIe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},vHt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Vo).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(eg).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new lZe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Qh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(eg).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof lZe||o instanceof pIe)throw o;Ye.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},bHt=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var YKo={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function KSn(t){let e=qt(t,je.AutoCompress);return{...YKo,enabled:e}}a(KSn,"getAutomaticCompressionConfig");p();var fq=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(us).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let E=In(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=In(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),qY(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var Uv=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new fq}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=KSn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(Ye.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(E){Ye.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return Ye.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return Ye.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});ht(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=jt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});ht(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=jt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});ht(this.ctx,"automaticCompression.triggered",l,0)}};p();var AA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Md=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var uZe=ce(ice());var JSn=new Map;function Zy(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(Zy,"createNumberRange");function SHt(t){return[...t].sort((e,r)=>r.length-e.length)}a(SHt,"sortByStringLengthDesc");async function KKo(t){let e=JSn.get(t);if(e)return e;let r=(async()=>{try{let n=await tce(`tree-sitter-${t}.wasm`);return await uZe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return JSn.set(t,r),r}a(KKo,"loadShellLanguage");function ZSn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(ZSn,"isPowerShell");var JKo=new Map([["sh",SHt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",SHt([...Zy(1,9).concat("").map(t=>`${t}<<<`),...Zy(1,9).concat("").flatMap(t=>Zy(1,9).map(e=>`${t}>&${e}`)),...Zy(1,9).concat("").map(t=>`${t}<>`),...Zy(1,9).concat("&","").map(t=>`${t}>>`),...Zy(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",SHt([...Zy(1,6).concat("*","").flatMap(t=>Zy(1,6).map(e=>`${t}>&${e}`)),...Zy(1,6).concat("*","").map(t=>`${t}>>`),...Zy(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function ZKo(t,e){let r,n=e.replace(/\.exe$/,"");ZSn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=JKo.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(ZKo,"splitCommandLineIntoSubCommands");async function dZe(t,e){try{let r;ZSn(e)?r="powershell":r="bash",await uZe.default.init();let n,o;try{n=new uZe.default;let s=await KKo(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return ZKo(t,e)}}a(dZe,"extractSubCommandsWithTreeSitter");var XKo=new Set(["sudo","env"]),eJo=/^[A-Za-z_][A-Za-z0-9_]*=/;function THt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(eJo.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||XKo.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(THt,"extractCommandNameFromSubCommand");var Yle=new ge("CommandLineAutoApprover"),XSn=/(?!.*)/,tJo=/^[A-Z_][A-Z0-9_]*=/i,qS=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(tJo.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await dZe(e,r);Yle.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return Yle.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return Yle.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Yle.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await dZe(e,r),o=[...new Set(n.map(THt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await dZe(e,r),o=n.map(s=>THt(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),Yle.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Yle.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?XSn:c}catch{return XSn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var fZe=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var pZe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(Jn).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var hZe=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=rJo(this.stdout)}static{a(this,"CommandHookResult")}};function rJo(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(rJo,"parseOutput");var RHt=require("child_process");var IHt=new ge("HookExecutor"),mZe=class{constructor(){this.handlers=[new xHt,new wHt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){IHt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}IHt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},gZe=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&IHt.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new hZe(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},xHt=class extends gZe{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,RHt.spawn)(e.bash,[],n)}},wHt=class extends gZe{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,RHt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var nJo=new mZe,Qv=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await nJo.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var wK=class extends Qv{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var R3=class extends Qv{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var AZe={allow:"allow",deny:"deny",ask:"ask"},k3=class extends Qv{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var hxe=class extends Qv{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var mxe=class extends Qv{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var P3=class extends Qv{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var RK=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();var iJo=".github/hooks/**/*.json",oJo="agentHook.execution",sJo={sessionStart:mxe,sessionEnd:hxe,userPromptSubmitted:P3,preToolUse:k3,postToolUse:R3,errorOccurred:wK},Xy=class{constructor(e){this.logger=new ge("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(T_).register("hook",[iJo]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&>(e,oJo,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()});let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?this.ctx.get(zm).collect(this.ctx,"hook",e):[]}areHooksEnabled(){return qt(this.ctx,je.EnableHooks)?this.ctx.get(uu).getPolicyValue("customHook.enabled")===!1?(this.logger.debug(this.ctx,"Hooks are disabled due to customHook.enabled policy."),!1):!0:(this.logger.debug(this.ctx,"Hooks are disabled by configuration."),!1)}subscribeToGateChanges(){try{let e=this.ctx.get(Zo);this.lastEnableHooks=qt(this.ctx,je.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=qt(this.ctx,je.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(uu);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(lA).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(sJo).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(zm).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function yA(t){return`[${ji(t)}](${t})`}a(yA,"formatUriForFileWidget");function Ju(t,e){let r=aJo(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(Ju,"resolvePathInput");function aJo(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return sW.has(s)||aa.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(aa.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||eTn()&&lJo(t)||eTn()&&t.startsWith("\\\\"))return Ia(t)}a(aJo,"resolveFsUri");function eTn(){return process.platform==="win32"}a(eTn,"isWindows");function cJo(t){return t>=65&&t<=90||t>=97&&t<=122}a(cJo,"isWindowsDriveLetter");function lJo(t){return cJo(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(lJo,"hasDriveLetter");function hO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof wr?r.value:r instanceof LY?"":r instanceof pQ?JSON.stringify(r.value):"").join(` -`)),e===""?"(empty)":e}a(hO,"parseToolResultToString");function yZe(t){let{content:e}=t;return{message:hO(e)}}a(yZe,"formatToolErrorResult");function tTn(t){let{content:e}=t,r={data:e.map(n=>n instanceof wr?{type:"text",value:n.value}:n instanceof LY?{type:"text",value:""}:n instanceof pQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof hQ&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(tTn,"formatToolSuccessResult");function kK(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(kK,"extractShellFromToolDescription");var EZe=new ge("HookTrigger"),Kle=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(Xy),c=o?new RK(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,k3,{timestamp:Date.now(),cwd:Wn(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return EZe.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(Xy),l=s?new RK(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,R3,{timestamp:Date.now(),cwd:Wn(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:hO(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){EZe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(Xy),o=this.extractPromptFromMessage(e),s=r?new RK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,P3,{timestamp:Date.now(),cwd:Wn(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){EZe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(Xy),o=qt(this.ctx,je.HookErrorOccurredStackTrace),s=r?new RK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,wK,{timestamp:Date.now(),cwd:Wn(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){EZe.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===AZe.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var kHt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},gxe=class extends kHt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var PK=ce(wo());var jn=class t extends PK.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(PK.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,PK.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> -`)),vscpp(PHt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},PHt=class extends PK.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function rTn(){return vscpp(jn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(jn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(jn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(jn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(rTn,"renderAskModeInstructionBody");p();p();var pq=class extends sr{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var _Ze=class extends sr{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var nTn=require("path");var CZe=class extends sr{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,nTn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(us).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=kK(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var hq=class extends sr{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=To(c.uri);return` - ${aa.isRegisteredScheme(l.scheme)?c.uri:ho(c.uri)}`}).join(` -`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function iTn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(iTn,"partsLength");async function sTn(t,e=1/0,r){let n=oTn(0,t,e),o=e-iTn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return uJo();let d=oTn(l.level+1,u,o-1);d.length&&(s=!0,o-=iTn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` -`)}}a(sTn,"visualFileTree");function oTn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(oTn,"toParts");var uJo=a(()=>({tree:"",files:[]}),"emptyTree");p();async function vZe(t,e){let r=To(e);return aa.isRegisteredScheme(r.scheme)?(await t.get(aa).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(Fo).readDirectory(e)}a(vZe,"readDirectory");var dJo=new ge("fileReferencesPrompt");async function aTn(t,e,r,n){let o=await cTn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=To(u),h=aa.isRegisteredScheme(f.scheme)?u:Wn(u);s+=`${l} (Absolute Path: ${h})/ +${u}`,!0;e.message=`Follow instructions in [${d.name}](${d.uri}). ${u}`;let m=e.references??[];return m.some(g=>g.type==="file"&&g.uri===d.uri)||m.push({type:"file",uri:d.uri}),e.references=m,!0}if(!n)return!1;let f="inline",h=C3().find(m=>m.id===l&&m.scopes.includes(f));return h?.instructions?(e.message=h.instructions(this.ctx,u,"inline"),!0):!1}};var eZe=class{constructor(e,r){this.conversation=e;this.capabilities=r}static{a(this,"ConversationHolder")}},Go=class{constructor(e){this.ctx=e;this.conversations=new yn(100)}static{a(this,"Conversations")}create({capabilities:e,source:r,userLanguage:n,conversationId:o}={}){let s=new FY([],r??"panel",n,o),c=e?.skills??[];return e?.allSkills&&(c=this.ctx.get(Hh).getDescriptors().map(l=>l.id)),this.conversations.set(s.id,new eZe(s,{skills:c})),this.initializePartitionTranscript(s),s}destroy(e){this.conversations.delete(e)}async restore(e){let{conversationId:r,targetTurnId:n,capabilities:o,source:s,userLanguage:c}=e;ot.debug(this.ctx,`Restoring conversation: conversationId=${r}, targetTurnId=${n}`);let u=await this.ctx.get(aO).restoreConversation(r,n);if(!u){ot.debug(this.ctx,`Restoration returned undefined: conversationId=${r}, targetTurnId=${n}`);return}let d=new FY(u.turns,s??"panel",c,r);d.currentPartitionId=u.partitionId;let f=o?.skills??[];return o?.allSkills&&(f=this.ctx.get(Hh).getDescriptors().map(h=>h.id)),this.conversations.set(d.id,new eZe(d,{skills:f})),this.initializeRestoredPartitionTranscript(d),ot.info(this.ctx,`Conversation restored: conversationId=${r}, partitionId=${u.partitionId}, turnCount=${u.turns.length}`),{conversation:d,partitionId:u.partitionId,turnCount:u.turns.length}}async createOrRestore(e={}){let{restoreToTurnId:r,conversationId:n,...o}=e;if(r&&n){try{let s=await this.restore({conversationId:n,targetTurnId:r,capabilities:o.capabilities,source:o.source,userLanguage:o.userLanguage});if(s)return s.conversation}catch(s){ot.warn(this.ctx,`Failed to restore conversation: conversationId=${n}, turnId=${r}, error=${s instanceof Error?s.message:String(s)}`)}return ot.info(this.ctx,`Creating new conversation after failed restoration: originalConversationId=${n}`),_t(this.ctx,"conversationPartition.restoration.fallbackToNew",{conversationId:String(n),targetTurnId:String(r)}),this.create(o)}return this.create(e)}initializeRestoredPartitionTranscript(e){try{let r=new X0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:"restoration"}).catch(n=>{ot.error(this.ctx,`Failed to initialize restored partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence for restoration: ${r instanceof Error?r.message:String(r)}`)}}async addTurn(e,r,n,o,s,c,l,u){let d=this.get(e);r.request.references=n&&n.length>0?n:[],o&&(r.request.activeEditor=o),s&&(r.workspaceFolder=s),c&&c.length>0&&(r.workspaceFolders=c),l&&l.length>0&&(r.ignoredSkills=l.map(g=>({skillId:g}))),u&&(r.agent={agentSlug:u.agentSlug},r.confirmationResponse=u);let f=n?.filter(g=>g.type==="file"&&!JV.has(to(g.uri).scheme)).map(g=>g.uri)??[],h=o?.uri,m=c?.map(g=>g.uri).filter(g=>!!g&&!JV.has(to(g).scheme))??[];d.uriSchemeCache.addUris([...f,h,...m]),await this.determineAndApplyAgent(d,r),await this.determineAndApplyTemplate(d,r),await this.determineAndApplyPromptTemplate(this.ctx,d,r),d.addTurn(r);try{await this.writeUserMessageTranscriptEvent(d,r)}catch(g){ot.error(this.ctx,`Failed to write user message transcript event: ${g instanceof Error?g.message:String(g)}`)}if(r.response)try{await this.writeAssistantResponseTranscriptEvents(d,r)}catch(g){ot.error(this.ctx,`Failed to write assistant response transcript events: ${g instanceof Error?g.message:String(g)}`)}return r}async writeUserMessageTranscriptEvent(e,r){let n=new X0(this.ctx);if(!n.isEnabled())return;let o=GSn(Rn(r.request.message),String(r.id));await n.appendEvent(e.id,e.currentPartitionId,o)}async writeAssistantResponseTranscriptEvents(e,r){let n=new X0(this.ctx);if(!n.isEnabled()||!r.response)return;let o=Rn(r.response.message),s=String(r.id),c=WJe(o,s,null,{text:o,iterationNumber:1});await n.appendEvent(e.id,e.currentPartitionId,c);let l=r.status==="error"?"error":r.status==="cancelled"?"cancelled":"success",u=$le(s,l);await n.appendEvent(e.id,e.currentPartitionId,u)}async determineAndApplyAgent(e,r){if(e.source==="panel"&&Rn(r.request.message).trim().startsWith("@")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Rn(r.request.message),"@");(await Nx(this.ctx)).find(l=>l.slug===n)&&(r.request.message=o,r.request.type="user",r.agent={agentSlug:n})}}async determineAndApplyTemplate(e,r){if(Rn(r.request.message).trim().startsWith("/")){let[n,o]=this.extractKeywordAndQuestionFromRequest(Rn(r.request.message),"/"),s=C3().find(c=>c.id===n);if(s){r.request.message=o,r.request.type="user",await this.determineAndApplyAgent(e,r);let c=s.instructions?s.instructions(this.ctx,r.request.message,e.source):o;r.template={templateId:n,userQuestion:r.request.message},r.request.message=c,r.request.type="template"}}}async determineAndApplyPromptTemplate(e,r,n){if(Rn(n.request.message).trim().startsWith("/")){let[o,s]=this.extractKeywordAndQuestionFromRequest(Rn(n.request.message),"/"),l=await e.get(sg).getPromptTemplate(o);l&&(l.uri.startsWith(xQ)?n.request.message=`Follow instructions: ${l.content} + +${s}`:(n.request.message=`Follow instructions in [${l.name}](${l.uri}). ${s}`,n.request.references=[...n.request.references||[],{type:"file",uri:l.uri}]))}}extractKeywordAndQuestionFromRequest(e,r){let[n,...o]=e.trim().split(" "),s=o.join(" ");return[n.replace(r,""),s]}deleteTurn(e,r){this.get(e).deleteTurn(r)}get(e){return this.getHolder(e).conversation}getCapabilities(e){return this.getHolder(e).capabilities}getSupportedSkills(e){let r=this.ctx.get(Hh).getDescriptors().filter(o=>o.type==="implicit").map(o=>o.id),n=this.getCapabilities(e).skills;return[...r,...n]}filterSupportedSkills(e,r){let n=this.getSupportedSkills(e);return r.filter(o=>n.includes(o))}getHolder(e){let r=this.conversations.get(e);if(!r)throw new Error(`Conversation with id ${e} does not exist`);return r}getAll(){let e=this.conversations.values();return Array.from(e).map(r=>r.conversation)}findByTurnId(e){for(let r of this.getAll()){let n=r.findTurn(e);if(n)return{conversation:r,turn:n}}}initializePartitionTranscript(e){try{let r=new X0(this.ctx);if(!r.isEnabled())return;r.initializePartition(e.id,e.currentPartitionId,{source:e.source,createdAt:e.timestamp}).catch(n=>{ot.error(this.ctx,`Failed to initialize partition transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.ctx,`Failed to create transcript persistence: ${r instanceof Error?r.message:String(r)}`)}}};p();var tZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.rounds=[]}static{a(this,"AgentToolCalls")}getRound(e){return this.rounds.find(r=>r.roundId===e)}getToolCallById(e){for(let r of this.rounds){let n=r.toolCalls?.find(o=>o.id===e);if(n)return n}}init(e,r,n,o,s,c){let l=this.getRound(e);if(l||(l={roundId:e,reply:""},this.rounds.push(l)),l.toolCalls?.find(d=>d.id===r))ot.error(this.ctx,`Tool call ${r} already exists for the round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`);else{let d={id:r,name:n,toolType:o,status:"not started",input:s,inputMessage:c};l.toolCalls=[d]}}async running(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.progressMessage=n,o.status="running"})}async finish(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="completed"})}async result(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="completed",o.result=n.data,n.toolResultMessage&&(o.progressMessage=n.toolResultMessage),o.resultDetails=n.toolResultDetails,o.toolSpecificData=n.toolSpecificData})}async cancel(e,r){await this.update({roundId:e,toolCallId:r},n=>{n.status="cancelled"})}async finishAll(e="completed"){let r=this.rounds.filter(n=>{let o=n.toolCalls?.filter(s=>s.status==="running").map(s=>(s.status=e,s));if(o&&o.length>0)return n.toolCalls=o,!0});r.length>0&&await this.progress.report(this.conversation,this.turn,{editAgentRounds:r})}async error(e,r,n){await this.update({roundId:e,toolCallId:r},o=>{o.status="error",o.error=n||"Unknown error"})}async updateProgressMessage(e,r,n){await this.update({roundId:e,toolCallId:r,silent:!0},o=>{o.progressMessage=n})}async update({roundId:e,toolCallId:r,silent:n=!1},o){let s=this.rounds.find(l=>l.roundId===e);s||(s={roundId:e,reply:""},this.rounds.push(s));let c=s.toolCalls?.find(l=>l.id===r);c?(o(c),n||await this.progress.report(this.conversation,this.turn,{editAgentRounds:[s]})):ot.error(this.ctx,`Tool call ${r} not found for the agent round ${e} in conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var rZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.progress=o;this.steps=[]}static{a(this,"Steps")}async start(e,r,n){let o=this.steps.find(s=>s.id===e);if(!o)o={id:e,title:r,description:n,status:"running"},this.steps.push(o),await this.progress.report(this.conversation,this.turn,{steps:[o]});else throw new Error(`Step with id "${e}" already started`)}async finish(e){await this.updateStep(e,r=>{r.status="completed"})}async cancel(e){await this.updateStep(e,r=>{r.status="cancelled"})}async finishAll(e="completed"){let r=this.steps.filter(n=>n.status==="running").map(n=>(n.status=e,n));r.length>0&&await this.progress.report(this.conversation,this.turn,{steps:r})}async error(e,r){return this.updateStep(e,n=>{n.status="failed",n.error={message:r||"Unknown error"}})}async updateStep(e,r){let n=this.steps.find(o=>o.id===e);n?(r(n),await this.progress.report(this.conversation,this.turn,{steps:[n]})):ot.error(this.ctx,`Step ${e} not found for conversation ${this.conversation.id} and turn ${this.turn.id}`)}};p();var JYo="X-Initiator",ZYo="X-Interaction-ID",XYo="X-Interaction-Type";var nZe=class{static{a(this,"LlmInteractionInitiator")}static id(){throw new Error("Must be implemented by subclass")}},PHt=class extends nZe{static{a(this,"User")}static id(){return"user"}},kHt=class extends nZe{static{a(this,"Agent")}static id(){return"agent"}},DHt=class{static{a(this,"GenericLlmInteraction")}constructor(e,r,n){this.initiator=e.id(),this.interactionType=r,this.interactionId=n}toCapiHeaders(){return{[JYo]:this.initiator,[ZYo]:this.interactionId,[XYo]:this.interactionType.toString()}}cloneAsAgentInteraction(e){return _A.agent(e??this.interactionType,this.interactionId)}},_A=class t extends DHt{static{a(this,"LlmInteraction")}static user(e,r){return new t(PHt,e,r)}static agent(e,r){return new t(kHt,e,r)}};function aTn(t){switch(t){case"Ask":return"conversation-panel";case"Agent":case"InlineAgent":return"conversation-agent";default:return"conversation-other"}}a(aTn,"interactionTypeForChatMode");var Vx=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.cancelationToken=o;this.skillResolver=new NHt(this),this.steps=new rZe(e,r,n,e.get(vc)),this.collector=new MHt(r,n,e.get(vc)),this.agentToolCalls=new tZe(e,r,n,e.get(vc))}static{a(this,"TurnContext")}get uriSchemeCache(){return this.conversation.uriSchemeCache}setResolvedModelConfiguration(e){this.turn.resolvedModelConfiguration=e}toLlmInteraction(){if(this.turn.isSubagent()&&this.turn.parentLlmInteraction)return this.turn.parentLlmInteraction.cloneAsAgentInteraction("conversation-subagent");if(this.conversation.source==="inline")return _A.user("conversation-inline",this.turn.telemetryId);{let e=this.turn.chatMode?.kind==="Agent"?"conversation-agent":"conversation-panel";return this.agentToolCalls.rounds.length?_A.agent(e,this.turn.telemetryId):_A.user(e,this.turn.telemetryId)}}async collectFile(e,r,n,o){let s={type:"file",collector:e,uri:r,status:n};o&&(s.range=o),await this.collector.collect(s)}collectLabel(e,r){this.collector.collect({type:"label",collector:e,label:r})}isFileIncluded(e){return this.collector.collectibles.some(r=>r.type==="file"&&r.status==="included"&&r.uri===e)}async info(e){await this.sendChatNotification(e,"info")}async warn(e){await this.sendChatNotification(e,"warning")}async sendChatNotification(e,r){await this.ctx.get(vc).report(this.conversation,this.turn,{notifications:[{severity:r,message:e}]})}clearCopilotEditsSessionHeader(){this.copilotEditsSessionHeader=void 0}setCopilotEditsSessionHeader(e){this.copilotEditsSessionHeader=e}},iZe=class extends Error{constructor(r,n){super(`Cycle detected while resolving skills: ${n.join(" -> ")} -> ${r}`);this.skillId=r;this.skillStack=n}static{a(this,"CycleError")}},vIe=class extends Error{static{a(this,"ConversationAbortError")}constructor(e){super(e)}},NHt=class{constructor(e){this.turnContext=e;this.resolveStack=[]}static{a(this,"SkillResolver")}async resolve(e){if(this.turnContext.ctx.get(Go).getSupportedSkills(this.turnContext.conversation.id).includes(e)){this.ensureNoCycle(e);let n=this.turnContext.ctx.get(ng).getResolvedSkill(this.turnContext.turn.id,e);if(n)return this.resolveStack.pop(),n;let o=await this.newlyResolve(e);return this.resolveStack.pop(),o}}ensureNoCycle(e){if(this.resolveStack.includes(e))throw new iZe(e,this.resolveStack);this.resolveStack.push(e)}async newlyResolve(e){let n=this.turnContext.ctx.get(Hh).getSkill(e);try{let o=await n?.resolver(this.turnContext).resolveSkill(this.turnContext);if(o)return this.turnContext.ctx.get(ng).addResolvedSkill(this.turnContext.turn.id,e,o),o}catch(o){if(o instanceof iZe||o instanceof vIe)throw o;ot.exception(this.turnContext.ctx,o,`Error while resolving skill ${e}`)}}},MHt=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n;this.collectibles=[]}static{a(this,"Collector")}async collect(e){this.collectibles.push(e),await this.reportCollectedFile(e)}async reportCollectedFile(e){e.type==="file"&&await this.conversationProgress.report(this.conversation,this.turn,{references:[{type:"file",uri:e.uri,status:e.status,range:e.range}]})}collectiblesForCollector(e){return this.collectibles.filter(r=>r.collector===e)}};p();p();p();var eKo={preTurnThreshold:.85,postToolCallThreshold:.9,enabled:!1};function cTn(t){let e=Ht(t,Je.AutoCompress);return{...eKo,enabled:e}}a(cTn,"getAutomaticCompressionConfig");p();var sq=class t{static{a(this,"TokenBudgetEstimator")}static{this.CHARS_PER_TOKEN=4}static{this.MESSAGE_OVERHEAD_MULTIPLIER=1.15}constructor(){}estimateToolDefinitionTokens(e,r){try{let o=e.get(ls).getToolsForModel(r),s=0;for(let c of o){let l={type:"function",function:{name:c.nameForModel,description:c.description,parameters:c.inputSchema}},u=JSON.stringify(l);s+=Math.ceil(u.length/t.CHARS_PER_TOKEN)}return s}catch{return(r?.customTools?.length??0)*100}}estimateTokensFromText(e){return e?Math.ceil(e.length/t.CHARS_PER_TOKEN):0}estimateSystemMessageTokens(e){return 1500+e.baseTokensPerMessage}shouldCompressWithContextSize(e,r){let{totalTokenLimit:n,totalUsedTokens:o}=e;return!Number.isFinite(n)||n<=0?!1:o/n>=r}calculateContextSize(e,r,n){let o=this.estimateSystemMessageTokens(n),s=r.turns[r.turns.length-1],c=s?this.estimateToolDefinitionTokens(e,s.chatMode):0,l=0,u=0,d=0,f=0;for(let y of r.turns){let E=Rn(y.request.message),_=this.estimateTokensFromText(E)+n.baseTokensPerMessage;if(l+=Math.ceil(_*t.MESSAGE_OVERHEAD_MULTIPLIER),y.request.references?.length&&(d+=Math.ceil(y.request.references.length*50*t.MESSAGE_OVERHEAD_MULTIPLIER)),y.response){let v=Rn(y.response.message),b=this.estimateTokensFromText(v)+n.baseTokensPerMessage;if(u+=Math.ceil(b*t.MESSAGE_OVERHEAD_MULTIPLIER),XY(y.response.message))for(let T of y.response.message){if(T.role==="tool"&&T.content){let w=typeof T.content=="string"?T.content:JSON.stringify(T.content),R=this.estimateTokensFromText(w)+n.baseTokensPerMessage;f+=Math.ceil(R*t.MESSAGE_OVERHEAD_MULTIPLIER)}if(T.thinking){let w=T.thinking;if(typeof w.tokens=="number"&&w.tokens>0)u+=w.tokens;else if(w.text!==void 0){let R=0;if(typeof w.text=="string")R=w.text.length;else if(Array.isArray(w.text))for(let x of w.text)R+=x.length;if(R>0){let x=Math.ceil(R/t.CHARS_PER_TOKEN);u+=Math.ceil(x*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}if(y.restoredToolCalls?.length){for(let v of y.restoredToolCalls)if(v.toolCalls?.length){for(let b of v.toolCalls)if(b.result&&Array.isArray(b.result)){let T="";for(let w of b.result)w.type==="text"?T+=w.value:w.type==="data"&&(T+=JSON.stringify(w.value));if(T){let w=this.estimateTokensFromText(T)+n.baseTokensPerMessage;f+=Math.ceil(w*t.MESSAGE_OVERHEAD_MULTIPLIER)}}}}}let h=o+c+l+u+d+f,m=n.maxRequestTokens,g=n.maxResponseTokens,A=m>0?h/m*100:0;return{totalTokenLimit:m,reservedOutputTokens:g,systemPromptTokens:o,toolDefinitionTokens:c,userMessagesTokens:l,assistantMessagesTokens:u,attachedFilesTokens:d,toolResultsTokens:f,totalUsedTokens:h,utilizationPercentage:Math.min(100,Math.round(A*100)/100)}}};var MC=class{constructor(e,r,n){this.compressor=e;this.notifier=r;this.ctx=n;this.tokenEstimator=new sq}static{a(this,"AutomaticCompressionManager")}async checkAndCompress(e,r,n,o,s){let c=this.tokenEstimator.calculateContextSize(this.ctx,e,r),l={estimatedTokens:c.totalUsedTokens,maxTokens:c.totalTokenLimit,utilizationRatio:c.utilizationPercentage/100,turnCount:e.turns.length},u=cTn(this.ctx);if(!u.enabled)return this.sendSkippedTelemetry(e,n,"disabled",l,r),{triggered:!1,tokenEstimate:l,skipReason:"disabled"};let d=n==="pre-turn"?u.preTurnThreshold:u.postToolCallThreshold;return this.tokenEstimator.shouldCompressWithContextSize(c,d)?(ot.info(this.ctx,`Automatic compression triggered: conversationId=${e.id}, trigger=${n}, tokens=${l.estimatedTokens}/${l.maxTokens} (${(l.utilizationRatio*100).toFixed(1)}%)`),await this.performCompression(e,r,n,o,l,s)):(this.sendSkippedTelemetry(e,n,"below_threshold",l,r),{triggered:!1,tokenEstimate:l,skipReason:"below_threshold"})}async performCompression(e,r,n,o,s,c){let l=Date.now(),u=String(e.id),d=e.currentPartitionId,f=e.turns.length;try{await this.notifier.notifyCompressionStarted({conversationId:u,partitionId:d,reason:n});let h=await this.compressor.compressCurrentPartition(e,r,o,c),m=Date.now()-l;if(h.success){let g=e.turns[0],A=typeof g?.request?.message=="string"?g.request.message.length:0,y;try{y=this.tokenEstimator.calculateContextSize(this.ctx,e,r)}catch(E){ot.warn(this.ctx,`Failed to calculate context size after compression: ${E instanceof Error?E.message:String(E)}`)}return await this.notifier.notifyCompressionCompleted({conversationId:u,archivedPartitionId:h.archivedPartitionId,newPartitionId:h.newPartitionId,summaryLength:A,turnCount:f,durationMs:m,contextInfo:y}),this.sendTriggeredTelemetry(e,n,"success",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s}}else return ot.error(this.ctx,`Automatic compression failed: conversationId=${u}, error=${h.error}`),this.sendTriggeredTelemetry(e,n,"failed",s,h,m,r),{triggered:!0,compressionResult:h,tokenEstimate:s,skipReason:"compression_failed"}}catch(h){let m=Date.now()-l,g=h instanceof Error?h.message:String(h);return ot.exception(this.ctx,h,`Automatic compression exception: conversationId=${u}`),this.sendExceptionTelemetry(e,n,g,s,m,r),{triggered:!0,tokenEstimate:s,skipReason:"compression_failed"}}}sendSkippedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,reason:n,...s?{modelId:s.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount});yt(this.ctx,"automaticCompression.skipped",c,0)}sendTriggeredTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:n,archivedPartitionId:String(s.archivedPartitionId),newPartitionId:String(s.newPartitionId),...s.error&&{error:s.error},...l?{modelId:l.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:c});yt(this.ctx,"automaticCompression.triggered",u,0)}sendExceptionTelemetry(e,r,n,o,s,c){let l=Vt.createAndMarkAsIssued({conversationId:String(e.id),trigger:r,outcome:"exception",error:n,...c?{modelId:c.modelId}:{}},{estimatedTokens:o.estimatedTokens,maxTokens:o.maxTokens,utilizationRatio:o.utilizationRatio,turnCount:o.turnCount,durationMs:s});yt(this.ctx,"automaticCompression.triggered",l,0)}};p();var vA=class extends Error{constructor(r){super(r.message);this.conversationError=r;this.name="AgentConversationError"}static{a(this,"AgentConversationError")}};p();var Dd=class{constructor(e){this.ctx=e}static{a(this,"AbstractClientToolConfirmationInvoker")}};p();p();var oZe=fe(Yae());var lTn=new Map;function Xy(t,e){return Array.from({length:e-t+1},(r,n)=>(t+n).toString())}a(Xy,"createNumberRange");function OHt(t){return[...t].sort((e,r)=>r.length-e.length)}a(OHt,"sortByStringLengthDesc");async function tKo(t){let e=lTn.get(t);if(e)return e;let r=(async()=>{try{let n=await Vae(`tree-sitter-${t}.wasm`);return await oZe.default.Language.load(n)}catch(n){throw new Error(`Could not load tree-sitter-${t}.wasm: ${n instanceof Error?n.message:String(n)}`)}})();return lTn.set(t,r),r}a(tKo,"loadShellLanguage");function uTn(t){let r=t.replace(/\.exe$/i,"").toLowerCase().split(/[/\\]/).pop()||"";return/^(?:powershell|pwsh)(?:-preview)?$/.test(r)}a(uTn,"isPowerShell");var rKo=new Map([["sh",OHt([...Xy(1,9).concat("").map(t=>`${t}<<<`),...Xy(1,9).concat("").flatMap(t=>Xy(1,9).map(e=>`${t}>&${e}`)),...Xy(1,9).concat("").map(t=>`${t}<>`),...Xy(1,9).concat("&","").map(t=>`${t}>>`),...Xy(1,9).concat("&","").map(t=>`${t}>`),"0<","||","&&","|&","<<","&",";","{",">","<","|","%"])],["zsh",OHt([...Xy(1,9).concat("").map(t=>`${t}<<<`),...Xy(1,9).concat("").flatMap(t=>Xy(1,9).map(e=>`${t}>&${e}`)),...Xy(1,9).concat("").map(t=>`${t}<>`),...Xy(1,9).concat("&","").map(t=>`${t}>>`),...Xy(1,9).concat("&","").map(t=>`${t}>`),"<(","||",">|",">!","&&","|&","&",";","{","<","|","%"])],["pwsh",OHt([...Xy(1,6).concat("*","").flatMap(t=>Xy(1,6).map(e=>`${t}>&${e}`)),...Xy(1,6).concat("*","").map(t=>`${t}>>`),...Xy(1,6).concat("*","").map(t=>`${t}>`),"&&","<","|",";","!","&","%"])]]);function nKo(t,e){let r,n=e.replace(/\.exe$/,"");uTn(e)?r="pwsh":r=(n.split(/[/\\]/).pop()||"")==="zsh"?"zsh":"sh";let o=[t],s=rKo.get(r);if(s)for(let c of s)for(let l=0;ld.trim())),l--)}return o.filter(c=>c.trim().length>0)}a(nKo,"splitCommandLineIntoSubCommands");async function sZe(t,e){try{let r;uTn(e)?r="powershell":r="bash",await oZe.default.init();let n,o;try{n=new oZe.default;let s=await tKo(r);return n.setLanguage(s),o=n.parse(t),s.query("(command) @command").captures(o.rootNode).map(u=>u.node.text.trim()).filter(u=>u.length>0)}finally{o?.delete(),n?.delete()}}catch{return nKo(t,e)}}a(sZe,"extractSubCommandsWithTreeSitter");var iKo=new Set(["sudo","env"]),oKo=/^[A-Za-z_][A-Za-z0-9_]*=/;function BHt(t){let e=t.trim().split(/\s+/).filter(r=>r.length>0);for(let r of e){if(oKo.test(r)&&!r.startsWith("/")&&!r.startsWith(".")||iKo.has(r.toLowerCase()))continue;let n=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),o=n>=0?r.substring(n+1):r;return o.length>0?o:void 0}}a(BHt,"extractCommandNameFromSubCommand");var Vle=new Ae("CommandLineAutoApprover"),dTn=/(?!.*)/,sKo=/^[A-Z_][A-Z0-9_]*=/i,OS=class{constructor(e){this.ctx=e;this._denyListRules=[];this._allowListRules=[]}static{a(this,"CommandLineAutoApprover")}updateConfiguration(e){let{denyListRules:r,allowListRules:n}=this._mapAutoApproveConfigToRules(e);this._allowListRules=n,this._denyListRules=r}isCommandAutoApproved(e){if(sKo.test(e))return{result:"denied",reason:`Command '${e}' is denied because it contains transient environment variables`};for(let r of this._denyListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"denied",reason:`Command '${e}' is denied by deny list rule: ${r.sourceText}`};for(let r of this._allowListRules)if(this._commandMatchesRegex(r.regex,e))return{result:"approved",reason:`Command '${e}' is approved by allow list rule: ${r.sourceText}`};return{result:"noMatch",reason:`Command '${e}' has no matching auto approve entries`}}async isTerminalCommandApprovalRequired(e,r){let n=await sZe(e,r);Vle.info(this.ctx,`Command '${e}' is split into sub-commands: ${JSON.stringify(n)}`);let o=n.map(l=>this.isCommandAutoApproved(l)),s=o.find(l=>l.result==="denied");if(s)return Vle.info(this.ctx,`Command '${e}' is denied, reason:'${s.reason}'`),s;if(o.every(l=>l.result==="approved")){let l=`Command '${e}' is approved, reason:'${o.map(u=>u.reason).join("; ")}'`;return Vle.info(this.ctx,l),{result:"approved",reason:l}}let c=`Command '${e}' has no matching auto approve entries`;return Vle.info(this.ctx,c),{result:"noMatch",reason:c}}async parseTerminalCommand(e,r){let n=await sZe(e,r),o=[...new Set(n.map(BHt).filter(s=>s!==void 0))];return{subCommands:n,commandNames:o}}async parseTerminalCommandDetailed(e,r){let n=await sZe(e,r),o=n.map(s=>BHt(s)??"");return{subCommands:n,commandNames:o}}_commandMatchesRegex(e,r){return!!e.test(r)}_mapAutoApproveConfigToRules(e){if(!e||typeof e!="object")return{denyListRules:[],allowListRules:[]};let r=[],n=[];return Object.entries(e).forEach(([o,s])=>{if(typeof s=="boolean"){let c=this._convertAutoApproveEntryToRegex(o);s===!0?n.push({regex:c,sourceText:o}):s===!1&&r.push({regex:c,sourceText:o})}else if(typeof s=="object"&&s!==null){let c=s;if(typeof c.approve=="boolean"){let l=this._convertAutoApproveEntryToRegex(o);c.approve===!0?n.push({regex:l,sourceText:o}):c.approve===!1&&r.push({regex:l,sourceText:o})}}}),Vle.debug(this.ctx,"Update CommandLineAutoApprover denyListRules",r),Vle.debug(this.ctx,"Update CommandLineAutoApprover allowListRules",n),{denyListRules:r,allowListRules:n}}_convertAutoApproveEntryToRegex(e){let r=e.match(/^\/(?.+)\/(?[dgimsuvy]*)$/),n=r?.groups?.pattern;if(n){let s=r.groups?.flags;s&&(s=s.replaceAll("g",""));try{let c=new RegExp(n,s||void 0);return this._regExpLeadsToEndlessLoop(c)?dTn:c}catch{return dTn}}let o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");return new RegExp(`^${o}\\b`)}_regExpLeadsToEndlessLoop(e){return e.source==="^"||e.source==="^$"||e.source==="$"||e.source==="^\\s*$"?!1:!!(e.exec("")&&e.lastIndex===0)}};p();var aZe=class{constructor(e){this.cache=new Map;this.inner=e}static{a(this,"SnapshotTextDocumentProvider")}getByUri(e){let r=this.cache.get(e);return r||(r=this.inner.getByUri(e),this.cache.set(e,r)),r}};p();var cZe=class{constructor(e){this.ctx=e}static{a(this,"DefaultTextDocumentProvider")}async getByUri(e){return await this.ctx.get(ri).getOrReadTextDocument({uri:e})}};p();p();p();p();p();p();var lZe=class{constructor(e,r,n,o,s){this.event=e;this.hook=r;this.exitCode=n;this.stdout=o;this.stderr=s;this.type="command";this.output=aKo(this.stdout)}static{a(this,"CommandHookResult")}};function aKo(t){try{return t.trim().length===0?void 0:JSON.parse(t)}catch{return}}a(aKo,"parseOutput");var QHt=require("child_process");var LHt=new Ae("HookExecutor"),uZe=class{constructor(){this.handlers=[new FHt,new UHt]}static{a(this,"HookExecutor")}async execute(e,r,n,o){for(let s of this.handlers)if(s.isAcceptable(n))try{return await s.handle(e,r,n,o)}catch(c){LHt.error(e,`Hook execution failed: ${c instanceof Error?c.message:String(c)}`);return}LHt.warn(e,`Unsupported hook type or platform for hook: ${JSON.stringify(n)}`)}},dZe=class{static{a(this,"CommandHookHandler")}async handle(e,r,n,o){o.cwd=n.cwd??o.cwd??process.cwd();let s=this.spawnProcess(n,o);if(!s.stdout||!s.stderr||!s.stdin)throw new Error("Failed to create child process with stdio pipes");let{stdout:c,stderr:l,stdin:u}=s,d="",f="",h=10*1024*1024;c.on("data",g=>{if(d+=g.toString(),d.length>h)throw s.kill(),new Error("Command output exceeded maximum size")}),l.on("data",g=>{if(f+=g.toString(),f.length>h)throw s.kill(),new Error("Command error output exceeded maximum size")}),u.on("error",g=>{g.code!=="EPIPE"&&LHt.warn(e,`stdin error: ${g instanceof Error?g.message:String(g)}`)});let m=JSON.stringify(o);return u.write(m),u.end(),new Promise((g,A)=>{let y=n.timeoutSec??30,E=setTimeout(()=>{s.kill("SIGTERM"),A(new Error(`Command timed out after ${y} seconds`))},y*1e3),_=a(()=>{clearTimeout(E)},"cleanup");s.on("error",v=>{_(),A(new Error(`Failed to execute command: ${v.message}`))}),s.on("close",v=>{_(),g(new lZe(r,n,v??0,d,f))})})}buildSpawnOptions(e,r){return{cwd:r.cwd,env:e.env?{...process.env,...e.env}:process.env,stdio:["pipe","pipe","pipe"]}}},FHt=class extends dZe{static{a(this,"BashCommandHookHandler")}isAcceptable(e){return process.platform!=="win32"&&e.type==="command"&&e.bash!==void 0}spawnProcess(e,r){let n={...this.buildSpawnOptions(e,r),shell:!0};return(0,QHt.spawn)(e.bash,[],n)}},UHt=class extends dZe{static{a(this,"PowerShellCommandHookHandler")}isAcceptable(e){return process.platform==="win32"&&e.type==="command"&&e.powershell!==void 0}spawnProcess(e,r){let n=this.buildSpawnOptions(e,r);return(0,QHt.spawn)("powershell.exe",["-NoProfile","-NonInteractive","-Command",e.powershell],n)}};var cKo=new uZe,OC=class{constructor(e,r,n=[]){this.source=e;this.eventType=r;this.hooks=n}static{a(this,"HookEvent")}async fire(e,r){let n=this.hooks.map(async o=>await cKo.execute(e,this,o,r));return(await Promise.all(n)).filter(o=>o!==void 0)}};var vK=class extends OC{static{a(this,"ErrorOccurredEvent")}constructor(e,r=[]){super(e,"errorOccurred",r)}};p();var b3=class extends OC{static{a(this,"PostToolUseEvent")}constructor(e,r=[]){super(e,"postToolUse",r)}};p();var fZe={allow:"allow",deny:"deny",ask:"ask"},S3=class extends OC{static{a(this,"PreToolUseEvent")}constructor(e,r=[]){super(e,"preToolUse",r)}};p();var txe=class extends OC{static{a(this,"SessionEndEvent")}constructor(e,r=[]){super(e,"sessionEnd",r)}};p();var rxe=class extends OC{static{a(this,"SessionStartEvent")}constructor(e,r=[]){super(e,"sessionStart",r)}};p();var T3=class extends OC{static{a(this,"UserPromptSubmittedEvent")}constructor(e,r=[]){super(e,"userPromptSubmitted",r)}};p();var CK=class{constructor(e,r,n){this.conversation=e;this.turn=r;this.conversationProgress=n}static{a(this,"HookProgress")}async reportPlanned(e){let r=[];for(let n of e)for(let o of n.hooks)r.push({eventType:n.eventType,source:n.source,status:"planned"});r.length>0&&await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}async reportResults(e){if(e.length===0)return;let r=e.map(n=>n.type!=="command"?{eventType:n.event.eventType,source:n.event.source,status:"failure"}:{eventType:n.event.eventType,source:n.event.source,status:n.exitCode===0?"success":"failure",result:{exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr}});await this.conversationProgress.report(this.conversation,this.turn,{hookExecutions:r})}};p();var lKo=".github/hooks/**/*.json",uKo="agentHook.execution",dKo={sessionStart:rxe,sessionEnd:txe,userPromptSubmitted:T3,preToolUse:S3,postToolUse:b3,errorOccurred:vK},eE=class{constructor(e){this.logger=new Ae("HookService");this.gateSubscriptions=[];this.ctx=e,this.registration=this.ctx.get(S_).register("hook",[lKo]),this.subscribeToGateChanges()}static{a(this,"HookService")}dispose(){this.registration.dispose();for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0}async hook(e,r,n,o,s){if(!this.areHooksEnabled())return[];let c=await this.collect(e,r,o);s&&await s(c),c.length>0&&_t(e,uKo,{eventType:c[0].eventType,eventCount:c.length.toString(),hookCount:c.reduce((u,d)=>u+d.hooks.length,0).toString()});let l=c.map(async u=>await u.fire(e,n));return(await Promise.all(l)).flat()}async listHooks(e){return this.areHooksEnabled()?this.ctx.get(Zm).collect(this.ctx,"hook",e):[]}areHooksEnabled(){return Ht(this.ctx,Je.EnableHooks)?this.ctx.get(lu).getPolicyValue("customHook.enabled")===!1?(this.logger.debug(this.ctx,"Hooks are disabled due to customHook.enabled policy."),!1):!0:(this.logger.debug(this.ctx,"Hooks are disabled by configuration."),!1)}subscribeToGateChanges(){try{let e=this.ctx.get(Yo);this.lastEnableHooks=Ht(this.ctx,Je.EnableHooks),this.gateSubscriptions.push(e.onDidChangeCopilotSettings(()=>{let r=Ht(this.ctx,Je.EnableHooks);r!==this.lastEnableHooks&&(this.lastEnableHooks=r,this.notifyHookListChanged())}))}catch{}try{let e=this.ctx.get(lu);this.lastCustomHookPolicyEnabled=e.getPolicyValue("customHook.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customHook.enabled");r!==this.lastCustomHookPolicyEnabled&&(this.lastCustomHookPolicyEnabled=r,this.notifyHookListChanged())}))}catch{}}notifyHookListChanged(){try{this.ctx.get(mA).notify("hook").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(hook) failed:",e)}}async collect(e,r,n){let o=Object.entries(dKo).find(([,l])=>l===r)?.[0];if(!o)return this.logger.warn(this.ctx,`Unknown hook event constructor: ${r.name}`),[];let s=await this.ctx.get(Zm).collect(e,"hook",[n]),c=[];for(let l of s){let u=l.parsedPromptFile,d=u.hooks[o];d!==void 0&&c.push(new r(u.uri,[...d]))}return c}};p();function CA(t){return`[${Ki(t)}](${t})`}a(CA,"formatUriForFileWidget");function Ju(t,e){let r=fKo(t,e);if(!r)throw new Error(`Invalid input path: ${t}. Be sure to use an absolute path.`);return r}a(Ju,"resolvePathInput");function fKo(t,e){let r=e?.resolveFromCache(t);if(r)return r;let n=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):\/\//);if(n){let s=n[1].toLowerCase();return JV.has(s)||na.isRegisteredScheme(s)?t:void 0}let o=t.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(o){let s=o[1].toLowerCase();if(na.isRegisteredScheme(s))return t.replace(/\\/g,"/")}if(t.startsWith("/")||fTn()&&hKo(t)||fTn()&&t.startsWith("\\\\"))return ba(t)}a(fKo,"resolveFsUri");function fTn(){return process.platform==="win32"}a(fTn,"isWindows");function pKo(t){return t>=65&&t<=90||t>=97&&t<=122}a(pKo,"isWindowsDriveLetter");function hKo(t){return pKo(t.charCodeAt(0))&&t.charCodeAt(1)===58}a(hKo,"hasDriveLetter");function cO(t){let e="";return t.length>0&&(e=t.map(r=>r instanceof Rr?r.value:r instanceof YY?"":r instanceof RQ?JSON.stringify(r.value):"").join(` +`)),e===""?"(empty)":e}a(cO,"parseToolResultToString");function pZe(t){let{content:e}=t;return{message:cO(e)}}a(pZe,"formatToolErrorResult");function pTn(t){let{content:e}=t,r={data:e.map(n=>n instanceof Rr?{type:"text",value:n.value}:n instanceof YY?{type:"text",value:""}:n instanceof RQ?{type:"data",value:{mimeType:n.value.mimeType,data:n.value.data}}:{type:"text",value:""})};return t instanceof PQ&&(t.toolResultMessage!==void 0&&(r.toolResultMessage=t.toolResultMessage),t.toolResultDetails!==void 0&&(r.toolResultDetails=t.toolResultDetails),t.toolSpecificData!==void 0&&(r.toolSpecificData=t.toolSpecificData)),r}a(pTn,"formatToolSuccessResult");function bK(t){let e=t.match(/(?:Shell:\s*)([a-zA-Z0-9._/-]+)/i);return e?e[1].replace(/[.,;!?]+$/,"").trim():null}a(bK,"extractShellFromToolDescription");var hZe=new Ae("HookTrigger"),Wle=class{constructor(e,r,n){this.ctx=e;this.conversation=r;this.workspaceFolders=n}static{a(this,"HookTrigger")}async firePreToolUseHook(e,r,n,o){try{let s=this.ctx.get(eE),c=o?new CK(this.conversation,o.turn,o.conversationProgress):void 0,l=[];for(let u of this.workspaceFolders){let d=await s.hook(this.ctx,S3,{timestamp:Date.now(),cwd:kn(u.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r)},u,c?async f=>{u===this.workspaceFolders[0]&&await c.reportPlanned(f)}:void 0);l.push(...d)}return c&&await c.reportResults(l),this.checkPreToolUseHookResults(l)}catch(s){return hZe.error(this.ctx,`Failed to execute PreToolUse hook for tool ${e.name}`,s),{denied:!1}}}async firePostToolUseHook(e,r,n,o,s){try{let c=this.ctx.get(eE),l=s?new CK(this.conversation,s.turn,s.conversationProgress):void 0,u=[];for(let d of this.workspaceFolders){let f=await c.hook(this.ctx,b3,{timestamp:Date.now(),cwd:kn(d.uri),toolName:e.configurationKey,toolArgs:JSON.stringify(r),toolResult:{resultType:this.toToolResultType(n.status),textResultForLlm:cO(n.content)}},d,l?async h=>{d===this.workspaceFolders[0]&&await l.reportPlanned(h)}:void 0);u.push(...f)}l&&await l.reportResults(u)}catch(c){hZe.error(this.ctx,`Failed to execute PostToolUse hook for tool ${e.name}`,c)}}async fireUserPromptSubmittedHook(e,r){try{let n=this.ctx.get(eE),o=this.extractPromptFromMessage(e),s=r?new CK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,T3,{timestamp:Date.now(),cwd:kn(l.uri),prompt:o},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){hZe.error(this.ctx,"Failed to execute UserPromptSubmitted hook",n)}}async fireErrorOccurredHook(e,r){try{let n=this.ctx.get(eE),o=Ht(this.ctx,Je.HookErrorOccurredStackTrace),s=r?new CK(this.conversation,r.turn,r.conversationProgress):void 0,c=[];for(let l of this.workspaceFolders){let u=await n.hook(this.ctx,vK,{timestamp:Date.now(),cwd:kn(l.uri),error:{message:e.message,name:e.name,stack:o?e.stack:void 0}},l,s?async d=>{l===this.workspaceFolders[0]&&await s.reportPlanned(d)}:void 0);c.push(...u)}s&&await s.reportResults(c)}catch(n){hZe.error(this.ctx,"Failed to execute ErrorOccurred hook",n)}}extractPromptFromMessage(e){return typeof e=="string"?e:Array.isArray(e)?e.map(r=>typeof r=="string"?r:typeof r=="object"&&r!==null&&"content"in r&&typeof r.content=="string"?r.content:typeof r=="object"&&r!==null&&"text"in r&&typeof r.text=="string"?r.text:"").filter(Boolean).join(" "):""}checkPreToolUseHookResults(e){for(let r of e){let n=r.output;if(n&&n.permissionDecision===fZe.deny)return{denied:!0,reason:n.permissionDecisionReason||"Tool execution denied by hook"}}return{denied:!1}}toToolResultType(e){switch(e){case"success":return"success";case"error":return"failure";case"cancelled":return"denied";default:return"failure"}}};p();p();var qHt=class{static{a(this,"TurnMetadata")}toString(){return this.constructor.name}},nxe=class extends qHt{constructor(r){super();this.renderedGlobalContext=r}static{a(this,"GlobalContextMessageMetadata")}};p();p();var SK=fe(xo());var Hn=class t extends SK.PromptElement{static{a(this,"Tag")}static{this._regex=/^[a-zA-Z_][\w.-]*$/}render(){let{name:e,children:r,attrs:n={}}=this.props;if(!t._regex.test(e))throw new Error(`Invalid tag name: ${this.props.name}. Tag names must start with a letter or underscore, and can contain letters, digits, underscores, hyphens, or periods.`);let o="";for(let[c,l]of Object.entries(n))l!==void 0&&(o+=` ${c}=${JSON.stringify(l)}`);if(r?.length===0)return o?vscpp(SK.TextChunk,null,vscpp(vscppf,null,`<${e}${o} />`)):void 0;let s=(0,SK.useKeepWith)();return vscpp(vscppf,null,vscpp(s,null,vscpp(vscppf,null,`<${e}${o}> +`)),vscpp(jHt,{priority:1,flexGrow:1},r,vscpp("br",null)),vscpp(s,null,vscpp(vscppf,null,``)),vscpp("br",null))}},jHt=class extends SK.PromptElement{static{a(this,"TagInner")}render(){return vscpp(vscppf,null,this.props.children)}};function hTn(){return vscpp(Hn,{name:"modeInstructions"},'You are currently running in "Ask" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),"You are an ASK AGENT \u2014 a knowledgeable assistant that answers questions, explains code, and provides information.",vscpp("br",null),vscpp("br",null),"You are strictly read-only: NEVER modify files or run commands that change state.",vscpp("br",null),vscpp("br",null),vscpp(Hn,{name:"rules"},"- NEVER use file editing tools, terminal commands that modify state, or any write operations",vscpp("br",null),"- Focus on answering questions, explaining concepts, and providing information",vscpp("br",null),"- Use search and read tools to gather context from the codebase when needed",vscpp("br",null),"- Provide code examples in your responses when helpful, but do NOT apply them",vscpp("br",null),"- When the user's question is about code, reference specific files and symbols",vscpp("br",null),"- If a question would require making changes, explain what changes would be needed but do NOT make them",vscpp("br",null),"- SKIP a plan when: The task is simple and direct. Breaking it down would only produce literal or trivial steps.",vscpp("br",null),"- Keep your response focused and proportional to the question. Don't over-explain simple concepts unless the user asks for more detail."),vscpp("br",null),vscpp(Hn,{name:"capabilities"},"You can help with:",vscpp("br",null),"- **Code explanation**: How does this code work? What does this function do?",vscpp("br",null),"- **Architecture questions**: How is the project structured? How do components interact?",vscpp("br",null),"- **Debugging guidance**: Why might this error occur? What could cause this behavior?",vscpp("br",null),"- **Best practices**: What's the recommended approach for X? How should I structure Y?",vscpp("br",null),"- **API and library questions**: How do I use this API? What does this method expect?",vscpp("br",null),"- **Codebase navigation**: Where is X defined? Where is Y used?",vscpp("br",null),"- **General programming**: Language features, algorithms, design patterns, etc."),vscpp("br",null),vscpp(Hn,{name:"workflow"},"1. **Understand** the question \u2014 identify what the user needs to know",vscpp("br",null),"2. **Research** the codebase if needed \u2014 use search and read tools to find relevant code",vscpp("br",null),"3. **Answer** clearly \u2014 provide a well-structured response with references to relevant code"))}a(hTn,"renderAskModeInstructionBody");p();p();var aq=class extends ar{static{a(this,"UserOSPrompt")}renderCopilot(e,r,n,o){let s=process.platform;return vscpp(vscppf,null,"The user's current OS is: ",s==="win32"?"Windows":s==="darwin"?"macOS":s==="linux"?"Linux":"Unknown")}};p();var mZe=class extends ar{static{a(this,"UserPreferences")}renderCopilot(e,r,n,o){return vscpp(vscppf,null)}};p();var mTn=require("path");var gZe=class extends ar{static{a(this,"UserShellPrompt")}renderCopilot(e,r,n,o){let s=this.getUserShell(),c=(0,mTn.basename)(s),l=c==="powershell.exe"?" (Windows PowerShell v5.1)":"",u="";return c==="powershell.exe"&&(u=" Use the `;` character if joining commands on a single line is needed."),vscpp(vscppf,null,`The user's default shell is: "`,c,'"',l,". When you generate terminal commands, please generate them correctly for this shell.",u)}getUserShell(){let n=this.props.ctx.get(ls).getToolsForModel().find(o=>o.name==="run_in_terminal"||o.nameForModel==="run_in_terminal");if(n){let o=bK(n.description);if(o)return o}if(process.env.SHELL)return process.env.SHELL;switch(process.platform){case"win32":return process.env.ComSpec||"cmd.exe";case"darwin":case"linux":return"/bin/bash";default:return"sh"}}};p();var cq=class extends ar{static{a(this,"WorkspaceFoldersHint")}renderCopilot(e,r,n,o){if(this.props.workspaceFolders&&this.props.workspaceFolders.length>0){let s=this.props.workspaceFolders.map(c=>{let l=to(c.uri);return` - ${na.isRegisteredScheme(l.scheme)?c.uri:Ko(c.uri)}`}).join(` +`);return vscpp(vscppf,null,"I am working in a workspace with the following folders:",vscpp("br",null),s)}else return vscpp(vscppf,null,"There is no workspace currently open.")}};p();p();p();function gTn(t){return t.reduce((r,n)=>r+n.value.length,0)+Math.max(0,t.length-1)}a(gTn,"partsLength");async function yTn(t,e=1/0,r){let n=ATn(0,t,e),o=e-gTn(n);for(;;){let s=!1,c=[];for(let l of n)if(l.type==="text")c.push(l);else if(l.type==="dir"){c.push({type:"text",uri:l.uri,value:l.value});let u=await l.getChildren();if(r?.isCancellationRequested)return mKo();let d=ATn(l.level+1,u,o-1);d.length&&(s=!0,o-=gTn(d)+1,c.push(...d))}if(n=c,!s)break}return{files:n.map(s=>s.uri).filter(s=>s!==void 0),tree:n.map(s=>s.value).join(` +`)}}a(yTn,"visualFileTree");function ATn(t,e,r){let n=" ".repeat(t),o=[],s=r;for(let c=0;cs){let d=n+"...";for(;d.length>s&&o.length>0;)s+=o.pop().value.length+1;d.length<=s&&o.push({type:"text",uri:void 0,value:d});break}l.type===2?o.push({type:"dir",uri:l.uri,level:t,value:u,getChildren:l.getChildren}):o.push({type:"text",uri:l.uri,value:u}),s-=u.length,c!==e.length-1&&(s-=1)}return o}a(ATn,"toParts");var mKo=a(()=>({tree:"",files:[]}),"emptyTree");p();async function AZe(t,e){let r=to(e);return na.isRegisteredScheme(r.scheme)?(await t.get(na).readDirectory(e)).entries.map(s=>[s.name,s.type]):t.get(jo).readDirectory(e)}a(AZe,"readDirectory");var gKo=new Ae("fileReferencesPrompt");async function ETn(t,e,r,n){let o=await _Tn(t,e,r,n);if(!o.length)return"";let s="";for(let{label:l,uri:u,tree:d}of o){let f=to(u),h=na.isRegisteredScheme(f.scheme)?u:kn(u);s+=`${l} (Absolute Path: ${h})/ `;for(let m of d.tree.split(` `))s+=` ${m} -`}let c=pA(s);return["I am working in a workspace that has the following structure:",c,s,c,"This view of the workspace structure may be truncated. You can use tools to collect more context if needed."].join(` -`)}a(aTn,"generateWorkspaceStructurePrompt");async function cTn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await sTn(await lTn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(cTn,"generateWorkspaceStructure");async function lTn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await vZe(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=xa(e,s);return!aa.isRegisteredScheme(To(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||hJo(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>lTn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(lTn,"buildFileList");var fJo=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],pJo=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function hJo(t){return!!(pJo.includes(ji(t).toLowerCase())||ho(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>fJo.includes(r)))}a(hJo,"shouldAlwaysIgnoreFile");async function bZe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:ji(c.uri)})),o=await cTn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${Wn(l)})`),s.push(u.tree),s.push("");return s}catch(n){return dJo.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(bZe,"processDirectoryReferences");var Jle=class extends sr{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await aTn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||qn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var uTn=ce(wo());var Axe=class extends sr{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(uTn.UserMessage,null,vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:this.props.ctx}),vscpp(CZe,{ctx:this.props.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(Jle,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(_Ze,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var SZe=ce(require("path"));var DHt=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||ji(tf(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}},EA=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.skillFileLocationsPatterns=[];this.logger=new ge("CustomSkillService");this._onDidChangeSkillsEnabled=new Wm;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.DEFAULT_SKILL_REGISTRATIONS=[".agents/skills/**/SKILL.md",".github/skills/**/SKILL.md",".claude/skills/**/SKILL.md","~/.agents/skills/**/SKILL.md","~/.copilot/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(uu);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(lA).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this._onDidChangeSkillsEnabled.dispose()}skipIfSkillsEnabledUnchanged(e){let r=qt(this.ctx,je.EnableSkills);return()=>{let n=qt(this.ctx,je.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){let e=qt(this.ctx,je.EnableSkills),r=this.ctx.get(uu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}syncRegistry(){let e=qt(this.ctx,je.EnableSkills),r=new Set;if(e){for(let n of t.DEFAULT_SKILL_REGISTRATIONS)r.add(n);for(let n of this.skillFileLocationsPatterns)r.add(n)}this.registrySkillPatterns=this.promptFileLocationRegistry.replace(this.registrySkillPatterns,"skill",Array.from(r))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(Wn(n.uri)):n.type==="location"&&r.add(SZe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e){return this.isSkillsEnabled()?(await this.ctx.get(zm).collect(this.ctx,"skill",e)).map(o=>new DHt(o)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=SZe.default.dirname(r)),!!r)return SZe.default.normalize(r)}};var TZe=class extends sr{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(EA).listSkills(e);if(gt(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` +`}let c=yA(s);return["I am working in a workspace that has the following structure:",c,s,c,"This view of the workspace structure may be truncated. You can use tools to collect more context if needed."].join(` +`)}a(ETn,"generateWorkspaceStructurePrompt");async function _Tn(t,e,r,n){return e.length?Promise.all(e.map(async o=>{let s=o.name,c=o.uri,l=await yTn(await vTn(t,o.uri,r,n),r.maxLength/e.length,n);return{label:s,uri:c,tree:l}})):[]}a(_Tn,"generateWorkspaceStructure");async function vTn(t,e,r,n){if(n.isCancellationRequested)return[];let o;try{o=await AZe(t,e)}catch{return[]}return n.isCancellationRequested?[]:(o.sort((s,c)=>s[1]===c[1]?s[0].localeCompare(c[0]):s[1]&2?1:-1),Promise.all(o.map(([s,c])=>{let l=Sa(e,s);return!na.isRegisteredScheme(to(e).scheme)&&r.excludeDotFiles&&s.startsWith(".")||EKo(l)?null:c&2?{type:2,uri:l,name:s,getChildren:a(()=>vTn(t,l,r,n),"getChildren")}:{type:1,uri:l,name:s}})).then(s=>s.filter(c=>c!=null)))}a(vTn,"buildFileList");var AKo=["node_modules","venv","out","dist",".git",".yarn",".npm",".venv","foo.asar",".vscode-test"],yKo=[".ds_store","thumbs.db","package-lock.json","yarn.lock",".cache"];function EKo(t){return!!(yKo.includes(Ki(t).toLowerCase())||Ko(t)?.toLowerCase()?.split(/[/\\]/g)?.some(r=>AKo.includes(r)))}a(EKo,"shouldAlwaysIgnoreFile");async function yZe(t,e,r){if(r.length===0)return[];try{let n=r.map(c=>({uri:c.uri,name:Ki(c.uri)})),o=await _Tn(t,n,{maxLength:2e3,excludeDotFiles:!0},e),s=[];for(let{label:c,uri:l,tree:u}of o)s.push(""),s.push(`Directory: ${c} (${kn(l)})`),s.push(u.tree),s.push("");return s}catch(n){return gKo.warn(t,`Failed to generate directory structure: ${String(n)}`),[]}}a(yZe,"processDirectoryReferences");var zle=class extends ar{static{a(this,"WorkspaceStructure")}async renderCopilot(e,r,n,o){if(!this.props.workspaceFolders)return vscpp(vscppf,null);let s=await ETn(this.props.ctx,this.props.workspaceFolders,{maxLength:this.props.maxSize||2e3,excludeDotFiles:this.props.excludeDotFiles??!0},o||jn.CancellationToken.None);return s?vscpp(vscppf,null,s):vscpp(vscppf,null)}};var CTn=fe(xo());var ixe=class extends ar{static{a(this,"GlobalAgentContext")}renderCopilot(e,r,n,o){return vscpp(CTn.UserMessage,null,vscpp(Hn,{name:"environment_info"},vscpp(aq,{ctx:this.props.ctx}),vscpp(gZe,{ctx:this.props.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(cq,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders}),vscpp(zle,{ctx:this.props.ctx,workspaceFolders:this.props.workspaceFolders,maxSize:2e3,excludeDotFiles:!0})),vscpp(mZe,{ctx:this.props.ctx,flexGrow:7,priority:800}))}};p();p();var EZe=fe(require("path"));var HHt=class{constructor(e){this.promptFileEntry=e}static{a(this,"CustomSkill")}get id(){return this.promptFileEntry.promptPath.uri}get uri(){return this.promptFileEntry.promptPath.uri}get name(){return this.promptFileEntry.parsedPromptFile.header?.name||Ki(Xd(this.uri))}get description(){return this.promptFileEntry.parsedPromptFile.header?.description}get storage(){return this.promptFileEntry.promptPath.storage}},em=class t{constructor(e,r,n){this.ctx=e;this.configProvider=r;this.promptFileLocationRegistry=n;this.skillFileLocationsPatterns=[];this.logger=new Ae("CustomSkillService");this._onDidChangeSkillsEnabled=new Kf;this.onDidChangeSkillsEnabled=this._onDidChangeSkillsEnabled.event;this.gateSubscriptions=[];this.lastSkillsEnabled=!1;this.syncRegistry(),this.configProvider.onDidChangeCopilotSettings(this.skipIfSkillsEnabledUnchanged(()=>{this.syncRegistry(),this.fireSkillsEnabledIfChanged()})),this.subscribeToGateChanges(),this.lastSkillsEnabled=this.isSkillsEnabled()}static{a(this,"CustomSkillService")}static{this.DEFAULT_SKILL_REGISTRATIONS=[".agents/skills/**/SKILL.md",".github/skills/**/SKILL.md",".claude/skills/**/SKILL.md","~/.agents/skills/**/SKILL.md","~/.copilot/skills/**/SKILL.md","~/.claude/skills/**/SKILL.md"]}static{this.SKILL_GLOB_SUFFIX="**/SKILL.md"}fireSkillsEnabledIfChanged(){let e=this.isSkillsEnabled();e!==this.lastSkillsEnabled&&(this.lastSkillsEnabled=e,this._onDidChangeSkillsEnabled.fire(e))}subscribeToGateChanges(){try{let e=this.ctx.get(lu);this.lastCustomSkillPolicyEnabled=e.getPolicyValue("customSkill.enabled"),this.gateSubscriptions.push(e.onDidChangePolicy(()=>{let r=e.getPolicyValue("customSkill.enabled");r!==this.lastCustomSkillPolicyEnabled&&(this.lastCustomSkillPolicyEnabled=r,this.notifySkillListChanged(),this.fireSkillsEnabledIfChanged())}))}catch{}}notifySkillListChanged(){try{this.ctx.get(mA).notify("skill").catch(e=>{this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)})}catch(e){this.logger.warn(this.ctx,"PromptChangeNotifier.notify(skill) failed:",e)}}dispose(){for(let e of this.gateSubscriptions)try{e.dispose()}catch{}this.gateSubscriptions.length=0,this._onDidChangeSkillsEnabled.dispose()}skipIfSkillsEnabledUnchanged(e){let r=Ht(this.ctx,Je.EnableSkills);return()=>{let n=Ht(this.ctx,Je.EnableSkills);r!==n&&(r=n,e())}}isSkillsEnabled(){let e=Ht(this.ctx,Je.EnableSkills),r=this.ctx.get(lu).getPolicyValue("customSkill.enabled")!==!1;return e&&r}syncRegistry(){let e=Ht(this.ctx,Je.EnableSkills),r=new Set;if(e){for(let n of t.DEFAULT_SKILL_REGISTRATIONS)r.add(n);for(let n of this.skillFileLocationsPatterns)r.add(n)}this.registrySkillPatterns=this.promptFileLocationRegistry.replace(this.registrySkillPatterns,"skill",Array.from(r))}setSkillFileLocations(e){let r=new Set;for(let n of e)n.type==="file"?r.add(kn(n.uri)):n.type==="location"&&r.add(EZe.default.posix.join(n.path,t.SKILL_GLOB_SUFFIX));this.skillFileLocationsPatterns=Array.from(r),this.syncRegistry()}async listSkills(e){return this.isSkillsEnabled()?(await this.ctx.get(Zm).collect(this.ctx,"skill",e)).map(o=>new HHt(o)):[]}getSkillDirectories(e){if(!this.isSkillsEnabled())return[];let r=this.promptFileLocationRegistry.resolvePatterns("skill",[e]),n=new Set;for(let{pattern:o}of r){let s=t.extractDirectoryFromResolvedPattern(o);s&&n.add(s)}return Array.from(n)}static extractDirectoryFromResolvedPattern(e){let r=e;if(r.endsWith(t.SKILL_GLOB_SUFFIX)?(r=r.slice(0,-t.SKILL_GLOB_SUFFIX.length),r.endsWith("/")&&(r=r.slice(0,-1))):r.endsWith("SKILL.md")&&(r=EZe.default.dirname(r)),!!r)return EZe.default.normalize(r)}};var _Ze=class extends ar{static{a(this,"SkillListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSkillListPrompt!==void 0)return this.props.turnContext.cachedSkillListPrompt??vscpp(vscppf,null);let e=this.props.workspaceFolders?this.props.workspaceFolders.map(c=>({uri:c.uri})):[];if(e.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let n=await this.props.turnContext.ctx.get(em).listSkills(e);if(_t(this.props.turnContext.ctx,"skills.list_in_prompt",void 0,{count:n.length}),n.length===0)return this.props.turnContext.cachedSkillListPrompt=null,vscpp(vscppf,null);let o=n.map(c=>` ${c.name} ${c.description??""} ${c.uri} - `).join(""),s=vscpp(vscppf,null,vscpp(jn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var dTn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},Zle=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await TGe(e.ctx)&&r.set(dTn.name,dTn);let o=await e.ctx.get(jp).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&>(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var mJo=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["semantic_search","safe_tool"],["list_dir","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function fTn(t){return mJo.get(t)??"unknown"}a(fTn,"getToolFunctionalType");var gJo=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),AJo=new Map;for(let[t,e]of gJo)AJo.set(e,t);var pTn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),hTn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var IZe=class extends sr{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new Zle().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` -`),o=vscpp(vscppf,null,vscpp(jn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var Xle=class extends sr{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var yJo=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],mO=class extends sr{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&yJo.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var mTn=ce(wo());var xZe=class extends sr{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(mTn.SystemMessage,null,vscpp(jn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(Xle,null)),vscpp(jn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(jn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(jn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(jn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(jn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(mO,{languageOverride:this.props.languageOverride}))}};p();var gTn=ce(wo());var wZe=class extends sr{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(gTn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(mO,{languageOverride:this.props.languageOverride}))}};p();p();var ATn="filepath:",_A="...existing code...";p();var RZe=class extends sr{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var mq=class extends sr{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!OWe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Tn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function yTn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(yTn,"modelSupportsReplaceString");function ETn(t){return t?t.startsWith("gpt-5"):!1}a(ETn,"isGpt5PlusFamily");function EJo(t){return t?t==="gpt-5.2-codex":!1}a(EJo,"isGpt52CodexFamily");function _Jo(t){return t?t==="gpt-5.2":!1}a(_Jo,"isGpt52Family");function _Tn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||EJo(e)||_Jo(e))}a(_Tn,"modelSupportsApplyPatch");var CTn=ce(wo());var kZe=class extends sr{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=ETn(this.props.modelConfiguration.modelFamily);return vscpp(CTn.SystemMessage,null,vscpp(jn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(mq,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(jn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(jn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(jn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(RZe,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",_A,vscpp("br",null),"changed code",vscpp("br",null),"// ",_A,vscpp("br",null),"changed code",vscpp("br",null),"// ",_A,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${_A}`," age: number;",` // ${_A}`," getAge() {"," return this.age;"," }","}"].join(` -`))),vscpp(jn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(jn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(mO,{languageOverride:this.props.languageOverride}))}};p();var PZe=class extends sr{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},DZe=class extends sr{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var eue=class extends sr{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},NZe=class extends sr{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},MZe=class extends sr{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var vTn=ce(wo());var OZe=class extends sr{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(vTn.SystemMessage,{priority:1e3},vscpp(jn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(mq,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(jn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",_A,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(mO,{languageOverride:this.props.languageOverride}))}},BZe=class extends sr{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var LZe=ce(wo());var FZe=class extends sr{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=qt(this.props.turnContext.ctx,je.UseAgentsMd);return OWe(n.modelFamily)?vscpp(wZe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(xZe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(OZe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(kZe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Lr).getEditorInfo().name,n=e.get(Mn).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(LZe.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)?vscpp(vscppf,null,vscpp(DZe,null),vscpp(NZe,null)):vscpp(vscppf,null,vscpp(PZe,null),vscpp(eue,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(LZe.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(LZe.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var bTn=ce(wo());var UZe=class extends sr{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=GM(this.props.currentTurn.response?.message,!0),r=tO(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,bTn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Mx,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var QZe=class extends sr{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var qZe=class extends sr{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(jn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&CJo(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",Wn(e.uri),". ",n)}};function CJo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(CJo,"notEmptySelection");p();var jZe=class extends sr{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",_A,"` to represent regions of unchanged code.")}};p();var HZe=class extends sr{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(jn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var gO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=pA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${ATn} ${Wn(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` + `).join(""),s=vscpp(vscppf,null,vscpp(Hn,{name:"skills"},"Here is a list of skills that contain domain specific knowledge on a variety of topics. Each skill comes with a description of the topic and a file path that contains the detailed instructions. When a user asks you to perform a task that falls within the domain of a skill, use the 'read_file' tool to acquire the full instructions from the file URI.",o));return this.props.turnContext.cachedSkillListPrompt=s,s}};p();p();var bTn={id:"builtin:search",name:"Search",description:"Launch an autonomous search agent to find relevant code in the workspace. The search agent can use grep search, file search, and read files to locate code. Use this when you need to find code but aren't sure exactly where to look.",invokePolicy:["model"],isReadonly:!0,isBuiltIn:!0},Yle=class{static{a(this,"CustomAgentRegistry")}async getAgents(e){let r=new Map;await dGe(e.ctx)&&r.set(bTn.name,bTn);let o=await e.ctx.get($p).listCustomAgents(e.turn.workspaceFolders);for(let s of o)!s.isBuiltIn&&r.get(s.name)?.isBuiltIn&&_t(e.ctx,"customAgent.shadowsBuiltIn",{builtInAgentName:s.name}),r.set(s.name,s);return r}async getAgentsForModelDispatch(e){let r=await this.getAgents(e),n=new Map;for(let[o,s]of r)s.invokePolicy.includes("model")&&n.set(o,s);return n}async getAgent(e,r){return(await this.getAgents(e)).get(r)}};p();var _Ko=new Map([["run_in_terminal","terminal"],["insert_edit_into_file","file_write"],["create_file","file_write"],["replace_string_in_file","file_write"],["apply_patch","file_write"],["read_file","file_read"],["semantic_search","safe_tool"],["list_dir","safe_tool"],["get_errors","safe_tool"],["file_search","safe_tool"],["grep_search","safe_tool"],["update_user_preferences","safe_tool"],["run_subagent","safe_tool"],["validate_cves","safe_tool"],["manage_todo_list","safe_tool"]]);function STn(t){return _Ko.get(t)??"unknown"}a(STn,"getToolFunctionalType");var vKo=new Map([["copilot_semanticSearch","semantic_search"],["copilot_readFile","read_file"],["copilot_listDir","list_dir"],["copilot_getErrors","get_errors"],["copilot_runInTerminal","run_in_terminal"],["copilot_insertEdit","insert_edit_into_file"],["copilot_createFile","create_file"],["copilot_replaceString","replace_string_in_file"],["copilot_applyPatch","apply_patch"],["copilot_updateUserPreferences","update_user_preferences"],["copilot_fileSearch","file_search"],["copilot_findTextInFiles","grep_search"],["copilot_runSubagent","run_subagent"],["copilot_validateCves","validate_cves"],["copilot_manageTodoList","manage_todo_list"]]),CKo=new Map;for(let[t,e]of vKo)CKo.set(e,t);var TTn=new Set(["semantic_search","read_file","list_dir","get_errors","file_search","grep_search"]),ITn=new Set(["get_errors","insert_edit_into_file","replace_string_in_file","apply_patch"]);var vZe=class extends ar{static{a(this,"SubagentListPrompt")}async renderCopilot(){if(this.props.turnContext.cachedSubagentListPrompt!==void 0)return this.props.turnContext.cachedSubagentListPrompt??vscpp(vscppf,null);let r=await new Yle().getAgentsForModelDispatch(this.props.turnContext);if(r.size===0)return this.props.turnContext.cachedSubagentListPrompt=null,vscpp(vscppf,null);let n=Array.from(r.entries()).map(([s,c])=>`- **${c.name}**: ${c.description}`).join(` +`),o=vscpp(vscppf,null,vscpp(Hn,{name:"subagent-instructions"},"You should ALWAYS use the `","run_subagent","` tool to delegate tasks to specialized agents when the task you are working on matches the agent's description.",vscpp("br",null),"Available Agents:",vscpp("br",null),n,vscpp("br",null),"IMPORTANT: The `agentName` parameter MUST be one of the exact agent names listed above. Do NOT use any other name."));return this.props.turnContext.cachedSubagentListPrompt=o,o}};p();p();p();var Kle=class extends ar{static{a(this,"AskModeKeepGoingReminder")}renderCopilot(){return vscpp(vscppf,null,"You are an agent \u2014 keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.",vscpp("br",null),"Avoid repetition across turns: don't restate unchanged context or plans verbatim; provide only what changed.",vscpp("br",null))}};p();var bKo=["en","fr","it","de","es","ru","zh-CN","zh-TW","ja","ko","cs","pt-br","tr","pl"],lO=class extends ar{static{a(this,"ResponseTranslationRules")}renderCopilot(){if(this.props.languageOverride&&bKo.find(e=>this.props.languageOverride===e)&&this.props.languageOverride!=="en")return vscpp(vscppf,null,"Respond in the following locale: ",this.props.languageOverride)}};var xTn=fe(xo());var CZe=class extends ar{static{a(this,"AskAgentPrompt")}renderCopilot(){let e=a(s=>this.props.tools.some(c=>c.name===s),"hasTool"),r=e("semantic_search"),n=e("read_file"),o=e("run_in_terminal");return vscpp(xTn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when answering questions.",vscpp("br",null),vscpp(Kle,null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","read_file",` tool, say "I'll read the file".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",r&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"but do not parallelize dependent steps.",vscpp("br",null),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),!o&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},r&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then answer the question. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"Unless it is clear that the user's question relates to the current workspace, you should avoid using search tools and instead prefer to answer the user's question directly.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"codesearchModeInstructions"},"These instructions apply when answering questions about the user's codebase.",vscpp("br",null),"First, analyze the user's request to determine how complicated their task is. Leverage any of the tools available to you to gather the context needed to provide a complete and accurate response. Keep your search focused on the user's request, and don't run extra tools if the user's request clearly can be satisfied by just one.",vscpp("br",null),"Think step by step:",vscpp("br",null),"1. Read the provided relevant workspace information (code excerpts, file names, and symbols) to understand the user's workspace.",vscpp("br",null),"2. Consider how to answer the user's prompt based on the provided information and your specialized coding knowledge. Always assume that the user is asking about the code in their workspace instead of asking a general programming question.",vscpp("br",null),"3. Generate a response that clearly and accurately answers the user's question. In your response, add fully qualified links for referenced symbols and links for files so that the user can open them.",vscpp("br",null),"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can print a codeblock with the suggested changes."),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),e("manage_todo_list")&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex research into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple questions or conversational requests."),vscpp(lO,{languageOverride:this.props.languageOverride}))}};p();var wTn=fe(xo());var bZe=class extends ar{static{a(this,"CodexStyleGPT5CodexPrompt")}renderCopilot(){return vscpp(wTn.SystemMessage,null,"You are a coding agent based on GPT-5-Codex.",vscpp("br",null),vscpp("br",null),"## Editing constraints",vscpp("br",null),vscpp("br",null),"- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.",vscpp("br",null),'- Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.',vscpp("br",null),"- You may be in a dirty git worktree.",vscpp("br",null),"* NEVER revert existing changes you did not make unless explicitly requested, since these changes were made by the user.",vscpp("br",null),"* If asked to make a commit or code edits and there are unrelated changes to your work or changes that you didn't make in those files, don't revert those changes.",vscpp("br",null),"* If the changes are in files you've touched recently, you should read carefully and understand how you can work with the changes rather than reverting them.",vscpp("br",null),"* If the changes are in unrelated files, just ignore them and don't revert them.",vscpp("br",null),"- While you are working, you might notice unexpected changes that you didn't make. If this happens, STOP IMMEDIATELY and ask the user how they would like to proceed.",vscpp("br",null),vscpp("br",null),"## Tool use",vscpp("br",null),"- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.",vscpp("br",null),this.props.hasSearchSubagent&&vscpp(vscppf,null,"- For broader codebase exploration that would require more than 3 search tool calls, use"," ","run_subagent",' with the "Search" agent. The search agent runs in an isolated context, keeping verbose search results out of your main context window. For simple, directed searches (e.g. a specific file or class), use ',"semantic_search",", ","file_search",", or"," ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),"- When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),vscpp("br",null),"## Special user requests",vscpp("br",null),vscpp("br",null),"- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.",vscpp("br",null),'- If the user asks for a "review", default to a code review mindset: prioritise identifying bugs, risks, behavioural regressions, and missing tests. Findings must be the primary focus of the response - keep summaries or overviews brief and only after enumerating the issues. Present findings first (ordered by severity with file/line references), follow with open questions or assumptions, and offer a change-summary only as a secondary detail. If no findings are discovered, state that explicitly and mention any residual risks or testing gaps.',vscpp("br",null),vscpp("br",null),"## Presenting your work and final message",vscpp("br",null),vscpp("br",null),"You are producing text that will be rendered as markdown by the VS Code UI. Follow these rules exactly. Formatting should make results easy to scan, but not feel mechanical. Use judgment to decide how much structure adds value.",vscpp("br",null),vscpp("br",null),"- Default: be very concise; friendly coding teammate tone.",vscpp("br",null),"- Ask only when needed; suggest ideas; mirror the user's style.",vscpp("br",null),"- For substantial work, summarize clearly; follow final-answer formatting.",vscpp("br",null),"- Skip heavy formatting for simple confirmations.",vscpp("br",null),"- Don't dump large files you've written; reference paths only.",vscpp("br",null),'- No "save/copy this file" - User is on the same machine.',vscpp("br",null),"- Offer logical next steps (tests, commits, build) briefly; add verify steps if you couldn't do something.",vscpp("br",null),"- For code changes:",vscpp("br",null),'* Lead with a quick explanation of the change, and then give more details on the context covering where and why a change was made. Do not start this explanation with "summary", just jump right in.',vscpp("br",null),"* If there are natural next steps the user may want to take, suggest them at the end of your response. Do not make suggestions if there are no natural next steps.",vscpp("br",null),"* When suggesting multiple options, use numeric lists for the suggestions so the user can quickly respond with a single number.",vscpp("br",null),"- The user does not command execution outputs. When asked to show the output of a command (e.g. `git show`), relay the important details in your answer or summarize the key lines so the user understands the result.",vscpp("br",null),"- Use proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null),vscpp("br",null),"### Final answer structure and style guidelines",vscpp("br",null),vscpp("br",null),"- Markdown text. Use structure only when it helps scannability.",vscpp("br",null),"- Headers: optional; short Title Case (1-3 words) wrapped in **\u2026**; no blank line before the first bullet; add only if they truly help.",vscpp("br",null),"- Bullets: use - ; merge related points; keep to one line when possible; 4-6 per list ordered by importance; keep phrasing consistent.",vscpp("br",null),"- Monospace: backticks for commands/paths/env vars/code ids and inline examples; use for literal keyword bullets; never combine with **.",vscpp("br",null),"- Code samples or multi-line snippets should be wrapped in fenced code blocks; add a language hint whenever obvious.",vscpp("br",null),"- Structure: group related bullets; order sections general \u2192 specific \u2192 supporting; for subsections, start with a bolded keyword bullet, then items; match complexity to the task.",vscpp("br",null),'- Tone: collaborative, concise, factual; present tense, active voice; self-contained; no "above/below"; parallel wording.',vscpp("br",null),"- Don'ts: no nested bullets/hierarchies; no ANSI codes; don't cram unrelated keywords; keep keyword lists short\u2014wrap/reformat if long; avoid naming formatting styles in answers.",vscpp("br",null),"- Adaptation: code explanations \u2192 precise, structured with code refs; simple tasks \u2192 lead with outcome; big changes \u2192 logical walkthrough + rationale + next actions; casual one-offs \u2192 plain sentences, no headers/bullets.",vscpp("br",null),"- File References: When referencing files in your response, always follow the below rules:",vscpp("br",null),"* Use inline code to make file paths clickable.",vscpp("br",null),"* Each reference should have a stand alone path. Even if it's the same file.",vscpp("br",null),"* Accepted: absolute, workspace-relative, a/ or b/ diff prefixes, or bare filename/suffix.",vscpp("br",null),"* Do not use URIs like file://, vscode://, or https://.",vscpp("br",null),"* Examples: src/app.ts, C:\\repo\\project\\main.rs",vscpp("br",null),vscpp(lO,{languageOverride:this.props.languageOverride}))}};p();p();var RTn="filepath:",bA="...existing code...";p();var SZe=class extends ar{static{a(this,"ApplyPatchFormatInstructions")}renderCopilot(){return vscpp(vscppf,null,"*** Update File: [file_path]",vscpp("br",null),"[context_before] -> See below for further instructions on context.",vscpp("br",null),"-[old_code] -> Precede each line in the old code with a minus sign.",vscpp("br",null),"+[new_code] -> Precede each line in the new, replacement code with a plus sign.",vscpp("br",null),"[context_after] -> See below for further instructions on context.",vscpp("br",null),vscpp("br",null),"For instructions on [context_before] and [context_after]:",vscpp("br",null),"- By default, show 3 lines of code immediately above and 3 lines immediately below each change. If a change is within 3 lines of a previous change, do NOT duplicate the first change's [context_after] lines in the second change's [context_before] lines.",vscpp("br",null),"- If 3 lines of context is insufficient to uniquely identify the snippet of code within the file, use the @@ operator to indicate the class or function to which the snippet belongs.",vscpp("br",null),"- If a code block is repeated so many times in a class or function such that even a single @@ statement and 3 lines of context cannot uniquely identify the snippet of code, you can use multiple `@@` statements to jump to the right context.",vscpp("br",null),vscpp("br",null),"You must use the same indentation style as the original code. If the original code uses tabs, you must use tabs. If the original code uses spaces, you must use spaces. Be sure to use a proper UNESCAPED tab character.",vscpp("br",null),vscpp("br",null),"See below for an example of the patch format. If you propose changes to multiple regions in the same file, you should repeat the *** Update File header for each snippet of code to change:",vscpp("br",null),vscpp("br",null),"*** Begin Patch",vscpp("br",null),"*** Update File: /Users/someone/pygorithm/searching/binary_search.py",vscpp("br",null),"@@ class BaseClass",vscpp("br",null),"@@"," ","def method():",vscpp("br",null),"[3 lines of pre-context]",vscpp("br",null),"-[old_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"+[new_code]",vscpp("br",null),"[3 lines of post-context]",vscpp("br",null),"*** End Patch",vscpp("br",null))}};p();var lq=class extends ar{static{a(this,"KeepGoingReminder")}renderCopilot(){if(!oYe(this.props.modelConfiguration.modelFamily))return this.props.modelConfiguration.modelFamily===Tn.Gpt41||this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)?vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user.",vscpp("br",null),"Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.",vscpp("br",null),"You MUST iterate and keep going until the problem is solved.",vscpp("br",null),"You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.",vscpp("br",null),"Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.",vscpp("br",null),"Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.",vscpp("br",null),"You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.",vscpp("br",null),"You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.",vscpp("br",null)):vscpp(vscppf,null,"You are an agent - you must keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. ONLY terminate your turn when you are sure that the problem is solved, or you absolutely cannot continue.",vscpp("br",null),"You take action when possible- the user is expecting YOU to take action and go to work for them. Don't ask unnecessary questions about the details if you can simply DO something useful instead.",vscpp("br",null))}};p();function PTn(t){let e=t.modelFamily.toLowerCase();return e.startsWith("claude")||e.startsWith("anthropic")||e.includes("gemini")}a(PTn,"modelSupportsReplaceString");function kTn(t){return t?t.startsWith("gpt-5"):!1}a(kTn,"isGpt5PlusFamily");function SKo(t){return t?t==="gpt-5.2-codex":!1}a(SKo,"isGpt52CodexFamily");function TKo(t){return t?t==="gpt-5.2":!1}a(TKo,"isGpt52Family");function DTn(t){let e=t.modelFamily.toLowerCase();return!!(e.startsWith("gpt")&&!e.includes("gpt-4o")||e==="o4-mini"||SKo(e)||TKo(e))}a(DTn,"modelSupportsApplyPatch");var NTn=fe(xo());var TZe=class extends ar{static{a(this,"DefaultAgentPrompt")}renderCopilot(){let e=a(g=>this.props.tools.some(A=>A.name===g),"hasTool"),r=e("get_errors"),n=e("run_in_terminal"),o=e("read_file"),s=e("replace_string_in_file"),c=e("semantic_search"),l=e("apply_patch"),u=e("insert_edit_into_file"),d=l||s||u,f=e("manage_todo_list"),h=e("run_subagent"),m=kTn(this.props.modelConfiguration.modelFamily);return vscpp(NTn.SystemMessage,null,vscpp(Hn,{name:"instructions"},"You are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.",vscpp("br",null),"The user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.",vscpp("br",null),vscpp(lq,{modelConfiguration:this.props.modelConfiguration}),"If you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.",vscpp("br",null),"If the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept."),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If a tool exists to do a task, use the tool instead of asking the user to manually take an action.",vscpp("br",null),"If you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission. If you make a plan, immediately follow it - do not wait for the user to confirm.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.",vscpp("br",null),"If you are not sure about file content or codebase structure, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"Never say the name of a tool to a user."," ",n&&vscpp(vscppf,null,"For example, instead of saying that you'll use the ","run_in_terminal",` tool, say "I'll run the command in a terminal".`),vscpp("br",null),"Prefer calling multiple tools in parallel when possible,"," ",c&&vscpp(vscppf,null,"but do not call ","semantic_search"," in parallel, "),"and do not parallelize edits or dependent steps.",vscpp("br",null),n&&vscpp(vscppf,null,"Don't call the ","run_in_terminal"," tool multiple times in parallel. Instead, run one command and wait for the output before running the next command.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null),"When invoking a tool that takes a file path, always use the absolute file path.",vscpp("br",null),h&&vscpp(vscppf,null,"Use the ","run_subagent"," tool with specialized agents when the task at hand matches the agent's description. Subagents are valuable for parallelizing independent queries or for protecting the main context window from excessive results, but they should not be used excessively when not needed. Importantly, avoid duplicating work that subagents are already doing - if you delegate research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)),!d&&vscpp(vscppf,null,"You don't currently have any tools available for editing files. If the user asks you to edit a file, you can ask the user to enable editing tools or print a codeblock with the suggested changes.",vscpp("br",null)),!n&&vscpp(vscppf,null,"You don't currently have any tools available for running terminal commands. If the user asks you to run a terminal command, you can ask the user to enable terminal tools or print a codeblock with the suggested command.",vscpp("br",null)),"Tools can be disabled by the user. You may see tools used previously in the conversation that are not currently available. Be careful to only use the tools that are currently available to you."),vscpp(Hn,{name:"contextGathering"},"Be THOROUGH when gathering information - make sure you have the FULL picture before making any changes. TRACE every symbol back to its definitions and usages so you fully understand it. Look past the first seemingly relevant result and EXPLORE alternative implementations and edge cases.",vscpp("br",null),this.props.hasSearchSubagent?vscpp(vscppf,null,"For broader or complex codebase exploration that would require more than 3 search tool calls, use the ","run_subagent",' tool with the "Search" agent instead. The search agent runs in an isolated context, keeping verbose search results out of your main context window.',vscpp("br",null),"Only skip for simple, directed codebase searches, use ","semantic_search",","," ","file_search",", or ","grep_search"," directly.",vscpp("br",null),"When delegating research to a subagent, do not also perform the same searches yourself.",vscpp("br",null)):c&&vscpp(vscppf,null,"Prefer using the ","semantic_search"," tool to search for context unless you know the exact string or filename pattern you're searching for. It is your MAIN exploration tool for unfamiliar codebases:",vscpp("br",null),"- Start with broad queries, then narrow down",vscpp("br",null),"- Consider running multiple searches with different wording if first-pass results seem incomplete",vscpp("br",null)),"Don't make assumptions - gather context first, then perform the task. Bias towards finding answers yourself rather than asking the user.",vscpp("br",null),"You don't need to read a file if it's already provided in context."),vscpp(Hn,{name:"makingCodeChanges"},"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),"NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the user and are very expensive.",vscpp("br",null),"Add all necessary import statements, dependencies, and endpoints required to run the code.",vscpp("br",null),"Think creatively and explore the workspace in order to make a complete fix.",vscpp("br",null),"Before editing an existing file, make sure you have it in context",o&&vscpp(vscppf,null," or read it with ","read_file")," first. If you fail to edit a file, read it again before retrying - the user may have edited it.",vscpp("br",null),l?vscpp(vscppf,null,"To edit files in the workspace, use the ","apply_patch"," tool. If you have issues with it, you should first try to fix your patch and continue using ","apply_patch","."," ",u&&vscpp(vscppf,null,"If you are stuck, you can fall back on the ","insert_edit_into_file"," tool, but"," ","apply_patch"," is much faster and is the preferred tool."),vscpp("br",null),"IMPORTANT: Each ","apply_patch"," call can only operate on ONE file. If you need to modify multiple files, use separate ","apply_patch"," tool calls for each file. Delete file operation is NOT supported - use other methods if you need to delete files.",vscpp("br",null),m&&vscpp(vscppf,null,"Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.",vscpp("br",null)),"The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:",vscpp("br",null),vscpp(SZe,null),vscpp("br",null),"NEVER print the patch out to the user, instead call the tool and the edits will be applied and shown to the user.",vscpp("br",null)):s?vscpp(vscppf,null,"Use ","replace_string_in_file"," to edit files, paying attention to context to ensure your replacement is unique. Group related edits into batches instead of making many separate calls. Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed.",vscpp("br",null)):u?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing files, group your changes by file.",vscpp("br",null)):vscpp(vscppf,null),"For each file, give a short description of what needs to be changed, then use the tool. You can use tools multiple times in a response and keep writing text after using a tool.",vscpp("br",null),"Follow best practices when editing files. If a popular external library exists to solve a problem, use it and properly install the package e.g. ",n?'with "npm install" or ':"",'creating a "requirements.txt".',vscpp("br",null),r&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited (not a wide scope). Fix relevant errors, but don't loop more than 3 times on the same file - ask the user if still failing.",vscpp("br",null)),!l&&u&&vscpp(vscppf,null,"The ","insert_edit_into_file"," tool is very smart and can understand how to apply your edits to the user's files, you just need to provide minimal hints.",vscpp("br",null),"When you use the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use comments to represent regions of unchanged code. The tool prefers that you are as concise as possible. For example:",vscpp("br",null),"// ",bA,vscpp("br",null),"changed code",vscpp("br",null),"// ",bA,vscpp("br",null),"changed code",vscpp("br",null),"// ",bA,vscpp("br",null),vscpp("br",null),"Here is an example of how you should format an edit to an existing Person class:",vscpp("br",null),["class Person {",` // ${bA}`," age: number;",` // ${bA}`," getAge() {"," return this.age;"," }","}"].join(` +`))),vscpp(Hn,{name:"inlineLineNumbers"},vscpp(vscppf,null,"Code chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER | LINE_CONTENT. Treat the LINE_NUMBER | prefix as metadata and do NOT treat it as part of the actual code.")),f&&vscpp(Hn,{name:"taskTracking"},"Use ","manage_todo_list"," frequently to plan and track tasks, giving the user visibility into your progress. This is helpful for breaking down complex tasks into smaller steps.",vscpp("br",null),"Mark tasks as in-progress when starting and completed immediately after finishing - do not batch completions. Skip task tracking for simple tasks or conversational requests."),vscpp(lO,{languageOverride:this.props.languageOverride}))}};p();var IZe=class extends ar{static{a(this,"CopilotIdentityRules")}renderCopilot(){return vscpp(vscppf,null,'When asked for your name, you must respond with "GitHub Copilot".',vscpp("br",null),"Follow the user's requirements carefully & to the letter.")}},xZe=class extends ar{static{a(this,"GPT5CopilotIdentityRule")}renderCopilot(){return vscpp(vscppf,null,"Your name is GitHub Copilot.",vscpp("br",null))}};p();var Jle=class extends ar{static{a(this,"SafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}},wZe=class extends ar{static{a(this,"Gpt5SafetyRule")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, or violent, only respond with "Sorry, I can't assist with that."`,vscpp("br",null))}},RZe=class extends ar{static{a(this,"LegacySafetyRules")}renderCopilot(){return vscpp(vscppf,null,"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null))}};p();var MTn=fe(xo());var PZe=class extends ar{static{a(this,"InlineCodeEditPrompt")}renderCopilot(){let e=a(c=>this.props.tools.some(l=>l.name===c),"hasTool"),r=e("apply_patch"),n=e("replace_string_in_file"),o=e("insert_edit_into_file"),s=e("get_errors");return vscpp(MTn.SystemMessage,{priority:1e3},vscpp(Hn,{name:"instructions"},"You are an AI coding assistant that is used for quick, inline code changes. Changes are scoped to the selected code in a single file. You can ONLY edit that file and MUST use a tool to make these edits.",vscpp("br",null),vscpp(lq,{modelConfiguration:this.props.modelConfiguration}),"The user is interested in code changes grounded in the user's prompt. Focus on coding, no wordy explanations, and do not ask back for clarifications.",vscpp("br",null),"Do NOT make code changes that are not directly and logically related to the user's prompt.",vscpp("br",null),"ONLY change the current file. Focus on the selection and try to make changes to the selected code and its immediate context. Do NOT modify code outside the user's selection unless absolutely necessary for correctness.",vscpp("br",null),"Keep changes minimal and focused on exactly what the user asked for.",vscpp("br",null)),vscpp(Hn,{name:"toolUseInstructions"},"When using a tool, follow the json schema very carefully and make sure to include ALL required properties.",vscpp("br",null),"If you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully.",vscpp("br",null),"Never use multi_tool_use.parallel or any tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.",vscpp("br",null),"NEVER output code to the user unless requested. Use the appropriate tool to implement changes directly.",vscpp("br",null),r?vscpp(vscppf,null,"Use ","apply_patch"," to make targeted edits to the selected code. If you have issues, first try to fix your patch and continue using ","apply_patch",".",o&&vscpp(vscppf,null," ","If you are stuck, you can fall back on ","insert_edit_into_file",", but"," ","apply_patch"," is the preferred tool."),vscpp("br",null)):n?vscpp(vscppf,null,"Use ","replace_string_in_file"," to make targeted edits to the selected code, paying attention to context to ensure your replacement is unique.",o&&vscpp(vscppf,null," ","Use ","insert_edit_into_file"," only if ","replace_string_in_file"," has failed."),vscpp("br",null)):o?vscpp(vscppf,null,"Use ","insert_edit_into_file"," to edit files. When editing, avoid repeating existing code, instead use a line comment with `",bA,"` to represent regions of unchanged code.",vscpp("br",null)):vscpp(vscppf,null,"You do not have edit tools available. Describe the code changes to the user instead.",vscpp("br",null)),s&&vscpp(vscppf,null,"After editing a file, call ","get_errors"," to validate your change. Only call it on files you've edited. Fix relevant errors, but don't loop more than 3 times on the same file.",vscpp("br",null)),"Don't repeat yourself after a tool call, pick up where you left off.",vscpp("br",null)),vscpp(lO,{languageOverride:this.props.languageOverride}))}},kZe=class extends ar{static{a(this,"InlineEditingReminder")}renderCopilot(){return vscpp(vscppf,null,"Focus on the selection and try to make changes to the selected code and its context. Do NOT edit code outside the selection unless absolutely necessary for correctness. ONLY change the current file, and change NO other file.")}};var DZe=fe(xo());var NZe=class extends ar{static{a(this,"SystemInstructionsPrompt")}getAgentPrompt(){let e=this.props.turnContext.conversation.userLanguage,{tools:r,modelConfiguration:n,turnContext:o,hasSearchSubagent:s}=this.props,c=o.turn.chatMode?.kind==="Ask",l=o.turn.chatMode?.kind==="InlineAgent",u=Ht(this.props.turnContext.ctx,Je.UseAgentsMd);return oYe(n.modelFamily)?vscpp(bZe,{tools:r,modelConfiguration:n,languageOverride:e,hasSearchSubagent:s}):c?vscpp(CZe,{tools:r,modelConfiguration:n,languageOverride:e}):l?vscpp(PZe,{tools:r,modelConfiguration:n,languageOverride:e}):vscpp(TZe,{tools:r,modelConfiguration:n,languageOverride:e,enableAgentsMdUpdate:u,hasSearchSubagent:s})}renderCopilot(){let e=this.props.turnContext.ctx,r=e.get(Nr).getEditorInfo().name,n=e.get(On).getCapabilities(),o=this.props.tools.some(s=>s.name==="run_subagent");return vscpp(vscppf,null,vscpp(DZe.SystemMessage,null,"You are an expert AI programming assistant, working with a user in the ",r," editor.",vscpp("br",null),this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)?vscpp(vscppf,null,vscpp(xZe,null),vscpp(wZe,null)):vscpp(vscppf,null,vscpp(IZe,null),vscpp(Jle,null))),this.getAgentPrompt(),this.props.turnContext.turn.isSubagent()&&vscpp(DZe.SystemMessage,null,vscpp(vscppf,null,"When you complete your task, provide a clear, concise summary of what you accomplished.")),n.subAgent&&o&&!this.props.turnContext.turn.isSubagent()&&this.props.turnContext.turn.chatMode?.id==="Agent"&&vscpp(DZe.SystemMessage,null,vscpp(vscppf,null,"You should ALWAYS check available agent descriptions first to see if any agent can be used with the `","run_subagent","` tool. DO NOT attempt to implement tasks yourself when a relevant agent exists. Delegating to specialized agents produces better results.")))}};p();var OTn=fe(xo());var MZe=class extends ar{static{a(this,"ToolCallHistoryPrompt")}renderCopilot(){let e=WM(this.props.currentTurn.response?.message,!0),r=eO(e,{ctx:this.props.turnContext.ctx,identifier:`Turn ID: ${this.props.currentTurn.id}`,enableWarnings:!0});if(r.length===0)return vscpp(vscppf,null);let n=(0,OTn.useKeepWith)();return vscpp(vscppf,null,vscpp(n,{priority:1,flexGrow:1},vscpp(Bx,{assistantRounds:r,ctx:this.props.turnContext.ctx,truncateAt:this.props.truncateAt,modelConfiguration:this.props.modelConfiguration,isHistorical:!1,identifier:String(this.props.currentTurn.id)})))}};p();p();var OZe=class extends ar{static{a(this,"CurrentDatePrompt")}renderCopilot(){let e=this.props.date?.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})||new Date().toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"});return vscpp(vscppf,null,"The current date is ",e,".")}};p();var BZe=class extends ar{static{a(this,"CurrentEditorContext")}renderCopilot(){let e,r=this.props.turnContext.turn.request.activeEditor;return r&&(e=this.renderActiveTextEditor(r)),e===void 0?vscpp(vscppf,null):vscpp(Hn,{name:"editorContext"},vscpp(vscppf,null,e))}renderActiveTextEditor(e){let r=e.selection,n=r&&IKo(r)?vscpp(vscppf,null,"The current selection is from line ",r.start.line+1," to line ",r.end.line+1,"."):void 0;return vscpp(vscppf,null,"The user's current file is ",kn(e.uri),". ",n)}};function IKo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(IKo,"notEmptySelection");p();var LZe=class extends ar{static{a(this,"EditingReminder")}renderCopilot(){if(!(this.props.tools&&!this.props.tools.some(e=>e.name==="insert_edit_into_file")))return vscpp(vscppf,null,"When using the ","insert_edit_into_file"," tool, avoid repeating existing code, instead use a line comment with `",bA,"` to represent regions of unchanged code.")}};p();var FZe=class extends ar{static{a(this,"ExplanationReminder")}renderCopilot(){if(this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5)){let e=this.props.modelConfiguration.modelFamily.startsWith(Tn.Gpt5Mini);return vscpp(vscppf,null,`Skip filler acknowledgements like "Sounds good" or "Okay, I will\u2026". Open with a purposeful one-liner about what you're doing next.`,vscpp("br",null),"When sharing setup or run steps, present terminal commands in fenced code blocks with the correct language tag. Keep commands copyable and on separate lines.",vscpp("br",null),"Avoid definitive claims about the build or runtime setup unless verified from the provided context (or quick tool checks). If uncertain, state what's known from attachments and proceed with minimal steps you can adapt later.",vscpp("br",null),"When you create or edit runnable code, run a test yourself to confirm it works; then share optional fenced commands for more advanced runs.",vscpp("br",null),'For non-trivial code generation, produce a complete, runnable solution: necessary source files, a tiny runner or test/benchmark harness, a minimal `README.md`, and updated dependency manifests (e.g., `package.json`, `requirements.txt`, `pyproject.toml`). Offer quick "try it" commands and optional platform-specific speed-ups when relevant.',vscpp("br",null),"Your goal is to act like a pair programmer: be friendly and helpful. If you can do more, do more. Be proactive with your solutions, think about what the user needs and what they want, and implement it proactively.",vscpp("br",null),vscpp(Hn,{name:"importantReminders"},!e&&vscpp(vscppf,null,"Start your response with a brief acknowledgement, followed by a concise high-level plan outlining your approach.",vscpp("br",null)),"DO NOT state your identity or model name unless the user explicitly asks you to. ",vscpp("br",null),this.props.hasTodoTool&&vscpp(vscppf,null,"You MUST use the todo list tool to plan and track your progress. NEVER skip this step, and START with this step whenever the task is multi-step. This is essential for maintaining visibility and proper execution of large tasks. Follow the todoListToolInstructions strictly.",vscpp("br",null)),!this.props.hasTodoTool&&vscpp(vscppf,null,"Break down the request into clear, actionable steps and present them as a checklist at the beginning of your response before proceeding with implementation. This helps maintain visibility and ensures all requirements are addressed systematically. Skip this for simple questions or single-step tasks.",vscpp("br",null)),"When referring to a filename or symbol in the user's workspace, wrap it in backticks.",vscpp("br",null)))}}};p();p();p();p();p();var uO=class{constructor(e){this.params=e;this.params.noFilePath===void 0&&(this.params.noFilePath=!1)}static{a(this,"CodeBlock")}renderAsArray(){let e=yA(this.params.code),r=[`${e}${this.params.languageId}`];!this.params.noFilePath&&this.params.uri&&r.push(`// ${RTn} ${kn(this.params.uri)}`);let n=this.params.shouldTrim?this.params.code.trim():this.params.code;if(this.params.lineNumberStart!==void 0){let o=n.split(` `),s=String(this.params.lineNumberStart+o.length-1).length,c=o.map((l,u)=>{let d=this.params.lineNumberStart+u;return`${String(d).padStart(s," ")} | ${l}`});r.push(c.join(` `))}else r.push(n);return r.push(e),r}renderAsString(e=` -`){return this.renderAsArray().join(e)}};var DP=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new gO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=ho(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push("
"),c}};var vJo=new ge("activeEditorPrompt");async function STn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Mc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&bJo(n.selection)){let s=new DP(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${ji(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new DP(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new DP(o,n.visibleRange,["User's current visible code:",`Excerpt from ${ji(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new DP(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else vJo.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(STn,"processActiveEditor");function bJo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(bJo,"notEmptySelection");p();var SJo=["png","jpg","jpeg","bmp","gif","webp"];function TJo(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!SJo.some(n=>r.endsWith(`.${n}`))})}a(TJo,"filterOutImageFiles");function GZe(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:TJo(e)}}a(GZe,"getFileAndDirectoryReferences");var IJo=new ge("fileReferencesPrompt");async function TTn(t,e){let{validFileReferences:r,directoryReferences:n}=GZe(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([xJo({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),STn(t,e),bZe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(TTn,"processFileReferences");async function xJo(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=ji(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new Mc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new DP(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new DP(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new DP(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else IJo.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(xJo,"processValidFileReferences");var ITn=ce(wo());var wJo=new ge("fileReferences"),$Ze=class extends sr{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new qn.CancellationTokenSource().token,c=[];try{c=await TTn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){wJo.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(NHt,{fileReferencesParts:c})}},NHt=class extends sr{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(ITn.TextChunk,null,[this.props.fileReferencesParts.join(` -`)])}};p();var xTn=ce(wo());var VZe=class extends sr{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=GZe(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(Jn);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` -`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(xTn.TextChunk,null,[n.join(` -`)])}};p();var wTn=new ge("SkillContextPrompt"),RJo=5e4,WZe=class extends sr{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await yYe(s);if(!c)return;wTn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(RJo).getText();return!d||d.trim().length===0?void 0:vscpp(jn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");wTn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var hu=class extends fQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:Ym,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Mc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(Md).invokeClientToolConfirmation(e,o)}};p();var X0=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function kJo(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:S.Optional(S.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return S.Object(e)}a(kJo,"createManageTodoListInputSchema");var AO=class t extends hu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:kJo()}),this.ctx=e}get service(){return this.ctx.get(X0)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Or([new wr("Error: Unknown operation")],"error")):Promise.resolve(new Or([new wr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Or([new wr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Or([new wr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Or([new wr(`# Todo List +`){return this.renderAsArray().join(e)}};var Pk=class{constructor(e,r,n=[],o={}){this.textDocumentResult=e;this.range=r;this.descriptions=n;this.options=o}static{a(this,"FileAttachment")}render(){if(this.textDocumentResult.status!=="valid")return[];let e=this.textDocumentResult.document,r=new uO({code:e.getText(this.range),languageId:e.detectedLanguageId,noFilePath:!0}),n=Ko(e.uri),o=this.options.useFilePath??!0,s="";this.options.id&&(s+=` id="${this.options.id}"`),o&&n&&(s+=` filePath="${n}"`);let c=[``];return c.push(...this.descriptions),c.push(...r.renderAsArray()),c.push(""),c}};var xKo=new Ae("activeEditorPrompt");async function BTn(t,e){let r=[],n=t.turnContext.turn.request.activeEditor;if(n){if(e.isCancellationRequested)throw new Dc;let o=await t.snapshotTextDocumentProvider.getByUri(n.uri);if(o.status==="valid")if(n.selection&&wKo(n.selection)){let s=new Pk(o,n.selection,["User's active selection, this should be the main focus:",`Excerpt from ${Ki(n.uri)}, line range (1-based) ${n.selection.start.line+1} to ${n.selection.end.line+1}:`]);r.push(...s.render());let c=new Pk(o,void 0,["User's active file for additional context:"]);r.push(...c.render())}else if(n.visibleRange){let s=new Pk(o,n.visibleRange,["User's current visible code:",`Excerpt from ${Ki(n.uri)}, line range (1-based) ${n.visibleRange.start.line+1} to ${n.visibleRange.end.line+1}:`]);r.push(...s.render())}else{let s=new Pk(o,void 0,["User's active file for additional context:"]);r.push(...s.render())}else xKo.warn(t.context,`Failed to read file in active editor ${n.uri} with status ${o.status} and reason ${o.status==="notfound"?o.message:o.reason}`)}return r}a(BTn,"processActiveEditor");function wKo(t){return t.start.line!==t.end.line||t.start.character!==t.end.character}a(wKo,"notEmptySelection");p();var RKo=["png","jpg","jpeg","bmp","gif","webp"];function PKo(t){return t.filter(e=>{let r=e.uri.toLowerCase();return!RKo.some(n=>r.endsWith(`.${n}`))})}a(PKo,"filterOutImageFiles");function UZe(t){let e=t.turn.request.references?.filter(n=>n.type==="file")??[],r=t.turn.request.references?.filter(n=>n.type==="directory")??[];return{fileReferences:e,directoryReferences:r,validFileReferences:PKo(e)}}a(UZe,"getFileAndDirectoryReferences");var kKo=new Ae("fileReferencesPrompt");async function LTn(t,e){let{validFileReferences:r,directoryReferences:n}=UZe(t.turnContext);if(r.length===0&&n.length===0&&!t.turnContext.turn.request.activeEditor)return[];let[o,s,c]=await Promise.all([DKo({validFileReferences:r,snapshotTextDocumentProvider:t.snapshotTextDocumentProvider,context:t.context},e),BTn(t,e),yZe(t.context,e,n)]),l=c||[];return o.length>0||s.length>0||l.length>0?["",...o,...s,...l,""]:[]}a(LTn,"processFileReferences");async function DKo(t,e){let r=new Map,n=t.validFileReferences.map(s=>{let c=Ki(s.uri),l=r.get(c)||0;r.set(c,l+1);let u=l===0?c:`${c}-${l}`;return{fileRef:s,id:u,fileName:c}});return(await Promise.all(n.map(async({fileRef:s,id:c,fileName:l})=>{if(e.isCancellationRequested)throw new Dc;let u=[],d=await t.snapshotTextDocumentProvider.getByUri(s.uri);if(d.status==="valid"){let f=s.selection??s.visibleRange;if(f){let h=new Pk(d,f,[`Excerpt from ${l}, lines ${f.start.line+1} to ${f.end.line+1}:`],{id:c,useFilePath:!1});u.push(...h.render());let m=new Pk(d,void 0,["User's active file for additional context:"],{useFilePath:!0});u.push(...m.render())}else{let h=new Pk(d,void 0,[],{id:c,useFilePath:!0});u.push(...h.render())}}else kKo.warn(t.context,`Failed to read file ${s.uri} with status ${d.status} and reason ${d.status==="notfound"?d.message:d.reason}`);return u}))).flat()}a(DKo,"processValidFileReferences");var FTn=fe(xo());var NKo=new Ae("fileReferences"),QZe=class extends ar{static{a(this,"FileReferences")}async renderCopilot(e,r,n,o){let s=o??new jn.CancellationTokenSource().token,c=[];try{c=await LTn({turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,context:this.props.ctx},s)}catch(l){NKo.debug(this.props.ctx,"Failed to process file references",l)}return c.length===0?vscpp(vscppf,null):vscpp(GHt,{fileReferencesParts:c})}},GHt=class extends ar{static{a(this,"FileReferencesSection")}renderCopilot(){return vscpp(FTn.TextChunk,null,[this.props.fileReferencesParts.join(` +`)])}};p();var UTn=fe(xo());var qZe=class extends ar{static{a(this,"FileReferencesFallback")}async renderCopilot(){let{validFileReferences:e,directoryReferences:r}=UZe(this.props.turnContext);if(e.length===0&&r.length===0)return vscpp(vscppf,null);let n=["User have attached following context reference, if you did not seen them, they might got omitted due to contents are too large:",""];if(e.length>0){n.push("Files:");let o=0,s=0,c=this.props.ctx.get(ri);for(let l of e)try{let u=await c.getOrReadTextDocument({uri:l.uri});if(u.status==="valid"){let d=u.document.getText(),f=d.split(` +`).length,h=d.length;o+=f,s+=h,n.push(`- ${l.uri} (${f} lines, ${h} characters)`)}else n.push(`- ${l.uri}`)}catch{n.push(`- ${l.uri}`)}n.push(`Total: ${e.length} file(s), ${o} lines, ${s} characters`)}return r.length>0&&(n.push("Directories:"),r.forEach(o=>{n.push(`- ${o.uri}`)})),n.push(""),vscpp(UTn.TextChunk,null,[n.join(` +`)])}};p();var QTn=new Ae("SkillContextPrompt"),MKo=5e4,jZe=class extends ar{static{a(this,"SkillContextPrompt")}async renderCopilot(e,r,n,o){let s=this.props.turnContext;if(!(!s.turn.skills||s.turn.skills.length===0))try{let[c,l]=await fKe(s);if(!c)return;QTn.debug(this.props.ctx,"Skill resolutions:",l.map(f=>`${f.skillId}: ${f.resolution}`));let d=c.elide(MKo).getText();return!d||d.trim().length===0?void 0:vscpp(Hn,{name:"skillContext"},vscpp(vscppf,null,d))}catch(c){let l=s.turn.skills.map(u=>u.skillId).join(", ");QTn.warn(this.props.ctx,`Failed to render skill context for skills [${l}]`,c);return}}};p();p();p();var pu=class extends wQ{static{a(this,"ClsLanguageModelTool")}constructor(e){super({...e,toolProvider:Xm,type:"shared"})}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Dc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};return e.ctx.get(Dd).invokeClientToolConfirmation(e,o)}};p();var tm=class{constructor(){this.todoMap=new Map}static{a(this,"TodoListService")}getTodos(e){return this.todoMap.get(e.id)?.todos??[]}setTodos(e,r){r.length===0?this.todoMap.delete(e.id):this.todoMap.set(e.id,{todos:r})}hasTodos(e){let r=this.todoMap.get(e.id);return r!==void 0&&r.todos.length>0}};function OKo(){let t=S.Object({id:S.Number({description:"Unique identifier for the todo. Use sequential numbers starting from 1."}),title:S.String({description:"Concise action-oriented todo label (3-7 words). Displayed in UI."}),description:S.Optional(S.String({description:"Detailed context, requirements, or implementation notes. Include file paths, specific methods, or acceptance criteria."})),status:S.Union([S.Literal("not-started"),S.Literal("in-progress"),S.Literal("completed")],{description:"not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers"})}),e={operation:S.String({description:"write: Replace entire todo list with new content. read: Retrieve current todo list. ALWAYS provide complete list when writing - partial updates not supported.",enum:["write","read"]}),todoList:S.Optional(S.Array(t,{description:"Complete array of all todo items (required for write operation, ignored for read). Must include ALL items - both existing and new."}))};return S.Object(e)}a(OKo,"createManageTodoListInputSchema");var dO=class t extends pu{static{a(this,"ManageTodoListTool")}constructor(e){super({name:"manage_todo_list",displayName:"Manage and track todo items for task planning",description:t.getToolDescription(void 0),displayDescription:"Manage and track todo items for task planning",inputSchema:OKo()}),this.ctx=e}get service(){return this.ctx.get(tm)}invoke(e,r,n){let{todoList:o,operation:s}=r.input;try{return s?s==="read"?Promise.resolve(this.handleReadOperation(e)):s==="write"?Promise.resolve(this.handleWriteOperation(e,o)):Promise.resolve(new Br([new Rr("Error: Unknown operation")],"error")):Promise.resolve(new Br([new Rr("Error: operation parameter is required")],"error"))}catch(c){let l=`Error: ${c instanceof Error?c.message:"Unknown error"}`;return Promise.resolve(new Br([new Rr(l)],"error"))}}handleReadOperation(e){let r=this.getTodos(e);if(r.length===0)return new Br([new Rr("No todo list found.")],"success");let n=t.formatTodoListAsMarkdown(r);return new Br([new Rr(`# Todo List -${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Or([new wr("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` +${n}`)],"success")}handleWriteOperation(e,r){if(!r)return new Br([new Rr("Error: todoList is required for write operation")],"error");let n=r.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status})),o=this.getTodos(e),s=this.calculateTodoChanges(o,n),c=this.generatePastTenseMessage(o,n);this.storeTodos(e,n);let l=[];n.length<3?l.push("Warning: Small todo list (<3 items). This task might not need a todo list."):n.length>10&&l.push("Warning: Large todo list (>10 items). Consider keeping the list focused and actionable."),o.length>0&&s>3&&l.push("Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.");let u=`Successfully wrote todo list${l.length?` `+l.join(` -`):""}`,d=new hQ([new wr(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` +`):""}`,d=new PQ([new Rr(u)],"success");return d.toolResultMessage=c,d.toolSpecificData={kind:"todoList",data:n.map(f=>({id:f.id,title:f.title,description:f.description||"",status:f.status}))},d}generatePastTenseMessage(e,r){if(e.length===0)return r.length===1?"Created 1 todo":`Created ${r.length} todos`;let n=new Map(e.map(l=>[l.id,l])),o=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="in-progress"&&l.status==="in-progress"});if(o.length>0){let l=o[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Starting: *${l.title}* (${d}/${u})`}let s=r.filter(l=>{let u=n.get(l.id);return u&&u.status!=="completed"&&l.status==="completed"});if(s.length>0){let l=s[0],u=r.length,d=r.findIndex(f=>f.id===l.id)+1;return`Completed: *${l.title}* (${d}/${u})`}let c=r.filter(l=>!n.has(l.id));return c.length>0?c.length===1?"Added 1 todo":`Added ${c.length} todos`:"Updated todo list"}static formatTodoListAsMarkdown(e){return e.length===0?"":e.map(r=>{let n;switch(r.status){case"completed":n="[x]";break;case"in-progress":n="[-]";break;default:n="[ ]";break}let o=[`- ${n} ${r.title}`];return r.description&&r.description.trim()&&o.push(` - ${r.description.trim()}`),o.join(` `)}).join(` -`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(X0).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return mmn(e)?`Updates the task plan. +`)}calculateTodoChanges(e,r){let n=new Map(e.map(u=>[u.id,u])),o=new Map(r.map(u=>[u.id,u])),s=0;for(let u of o.keys())n.has(u)||s++;let c=0;for(let u of n.keys())o.has(u)||c++;let l=0;for(let[u,d]of o){let f=n.get(u);f&&(f.title!==d.title||(f.description??"")!==(d.description??"")||f.status!==d.status)&&l++}return s+c+l}prepareInvocation(e,r){let{operation:n}=e.input;if(n==="read")return{progressMessage:"Reading todo list"};let o=e.input.todoList?.length??0;return{progressMessage:o===0?"Clearing todo list":`Updating ${o} todo(s)`}}prepareCompletion(e,r){let{operation:n}=e.input;return n==="read"?{completionMessage:"Read todo list"}:{completionMessage:"Updated todo list"}}storeTodos(e,r){this.service.setTodos(e.conversation,r)}getTodos(e){return this.service.getTodos(e.conversation)}static getTodoList(e){return e.ctx.get(tm).getTodos(e.conversation)}static getCurrentTask(e){return this.getTodoList(e).find(n=>n.status==="in-progress")??null}static getToolDescription(e){return Byn(e)?`Updates the task plan. Provide an optional explanation and a list of plan items, each with a step and status. At most one step can be in-progress at a time.`:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning. @@ -3173,73 +3204,73 @@ Todo states: - in-progress: Currently working (limit ONE at a time) - completed: Finished successfully -IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var zZe=class extends sr{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(Mn).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??AO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=AO.formatTodoListAsMarkdown(r);return vscpp(jn,{name:"todoList"},[n])}};p();p();var PJo=new ge("fileReferencesPrompt");function RTn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return PJo.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(RTn,"processMcpToolsReferences");var DJo=new ge("ToolContext"),YZe=class extends sr{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new Mc;let n=RTn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(jn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` -`)))}catch(r){DJo.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var tue=ce(wo());var KZe=class extends sr{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=In(this.props.userRawMessage),c=Jce(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(tue.UserMessage,null,vscpp(tue.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp($Ze,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(tue.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(VZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(YZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(WZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(jn,{name:"context"},vscpp(QZe,null),vscpp(zZe,{turnContext:this.props.turnContext})),vscpp(qZe,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(jn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(Xle,null):vscpp(mq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(jZe,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(BZe,null),vscpp(HZe,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(jn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var DK=ce(wo());var MHt=new ge("agentPrompt"),JZe=class extends sr{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(Mn).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(FZe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(DK.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(DK.UserMessage,null,vscpp(IZe,{turnContext:this.turnContext})),vscpp(DK.UserMessage,null,vscpp(TZe,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(hle,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp(KZe,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(UZe,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?NJo(e):[vscpp(Axe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(gxe);if(s?.renderedGlobalContext)return MHt.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}MHt.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await u7t(Axe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new gxe(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(pf).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:qt(this.ctx,je.UseAgentsMd),includeNestedAgentsMdInstructions:qt(this.ctx,je.UseNestedAgentsMd),includeClaudeMdInstructions:qt(this.ctx,je.UseClaudeMd),includeNestedClaudeMdInstructions:qt(this.ctx,je.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(rTn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(jn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(DK.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){MHt.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function NJo(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(DK.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(NJo,"renderedMessageToTsxChildren");p();var ZZe="uncategorized_tools",kTn="Tools that could not be automatically categorized into existing groups.";p();var gq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var D3=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var rue=new ge("roundMetricsTracker"),XZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=MJo(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:OHt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:OHt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:OHt(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;rue.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){rue.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else rue.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;rue.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(rue.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),qt(this.ctx,je.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else rue.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` +IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`}};var HZe=class extends ar{static{a(this,"TodoListContextPrompt")}renderCopilot(){if(!this.props.turnContext.ctx.get(On).getCapabilities().manageTodoListTool)return;let r=this.props.turnContext.todoListSnapshot??dO.getTodoList(this.props.turnContext);if(r.length===0)return;let n=dO.formatTodoListAsMarkdown(r);return vscpp(Hn,{name:"todoList"},[n])}};p();p();var BKo=new Ae("fileReferencesPrompt");function qTn(t,e,r){if(!r.length)return[];try{let n=[];for(let o of r){if(e.isCancellationRequested)break;let s=o.server??"default",c=o.name??o.uri;n.push(`MCP Tool Reference: ${s}/${c}`),o.description&&n.push(`Description: ${o.description}`),n.push("---"),n.push("Invoke the tool with user prompt.")}return n}catch(n){return BKo.warn(t,`Failed to render MCP tool references: ${String(n)}`),[]}}a(qTn,"processMcpToolsReferences");var LKo=new Ae("ToolContext"),GZe=class extends ar{static{a(this,"ToolContext")}renderCopilot(){let e=this.props.token;try{let r=(this.props.turnContext.turn.request.references?.filter(s=>s.type==="tool")||[]).map(s=>({type:"tool",uri:s.uri,server:s.server,name:s.name,description:s.description}));if(r.length===0)return;if(e?.isCancellationRequested)throw new Dc;let n=qTn(this.props.ctx,e,r)||[];return n.length===0?void 0:vscpp(Hn,{name:"McpToolContext"},vscpp(vscppf,null,n.join(` +`)))}catch(r){LKo.warn(this.props.ctx,"Failed to render MCP tool context",r);return}}};var Zle=fe(xo());var $Ze=class extends ar{static{a(this,"UserRequestPrompt")}renderCopilot(e,r,n,o){let s=Rn(this.props.userRawMessage),c=ule(this.props.userRawMessage)?this.props.userRawMessage.filter(l=>l.type==="image_url"):[];return vscpp(Zle.UserMessage,null,vscpp(Zle.TokenLimit,{max:r.tokenBudget/6,flexGrow:3,priority:898},vscpp(QZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider}),c.map(l=>vscpp(Zle.Image,{src:l.image_url.url,detail:l.image_url.detail}))),vscpp(qZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:898}),vscpp(GZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,token:o,priority:899}),vscpp(jZe,{ctx:this.props.ctx,turnContext:this.props.turnContext,priority:897}),vscpp(Hn,{name:"context"},vscpp(OZe,null),vscpp(HZe,{turnContext:this.props.turnContext})),vscpp(BZe,{turnContext:this.props.turnContext,context:this.props.ctx}),vscpp(Hn,{name:"reminderInstructions"},this.props.codesearchMode?vscpp(Kle,null):vscpp(lq,{modelConfiguration:this.props.modelConfiguration}),!this.props.codesearchMode&&vscpp(LZe,{tools:this.props.tools}),this.props.turnContext.turn.chatMode?.kind==="InlineAgent"&&vscpp(kZe,null),vscpp(FZe,{modelConfiguration:this.props.modelConfiguration,hasTodoTool:!1})),vscpp(Hn,{name:"userRequest",priority:900,flexGrow:7},vscpp(vscppf,null,s)))}};var TK=fe(xo());var $Ht=new Ae("agentPrompt"),VZe=class extends ar{static{a(this,"AgentPrompt")}constructor(e){super(e),this.ctx=e.turnContext.ctx,this.turnContext=e.turnContext,this.currentTurn=e.turnContext.turn}async renderCopilot(e,r,n,o){let s=this.ctx.get(On).getCapabilities(),c=this.props.tools.some(d=>d.name==="run_subagent"),l=vscpp(vscppf,null,vscpp(NZe,{turnContext:this.turnContext,modelConfiguration:this.props.modelConfiguration,tools:this.props.tools,hasSearchSubagent:this.props.hasSearchSubagent??!1}),await this.getAgentCustomInstructions(),vscpp(TK.UserMessage,null,await this.getOrCreateGlobalAgentContext()),s.subAgent&&c&&!this.currentTurn.isSubagent()&&this.currentTurn.chatMode?.id==="Agent"&&vscpp(TK.UserMessage,null,vscpp(vZe,{turnContext:this.turnContext})),vscpp(TK.UserMessage,null,vscpp(_Ze,{turnContext:this.turnContext,workspaceFolders:this.props.workspaceFolders}))),u=this.turnContext.conversation.turns.slice(0,-1);return vscpp(vscppf,null,l,vscpp(ble,{flexGrow:1,priority:700,historyTurns:u,ctx:this.ctx,modelConfiguration:this.props.modelConfiguration}),vscpp($Ze,{flexGrow:2,priority:900,ctx:this.ctx,turnContext:this.turnContext,userRawMessage:this.props.userRawMessage,snapshotTextDocumentProvider:this.props.snapshotTextDocumentProvider,modelConfiguration:this.props.modelConfiguration,codesearchMode:this.props.codesearchMode,tools:this.props.tools}),vscpp(MZe,{flexGrow:2,priority:899,turnContext:this.turnContext,currentTurn:this.currentTurn,truncateAt:Math.floor(this.props.modelConfiguration.maxRequestTokens/2),modelConfiguration:this.props.modelConfiguration}))}async getOrCreateGlobalAgentContext(){let e=await this.getOrCreateGlobalAgentContextContent();return e?FKo(e):[vscpp(ixe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders})]}async getOrCreateGlobalAgentContextContent(){let e=`${this.turnContext.conversation.id}/${this.turnContext.turn.id}`,r=this.turnContext.conversation.turns.at(0);if(r){let s=r.getMetadata(nxe);if(s?.renderedGlobalContext)return $Ht.info(this.ctx,`Reusing cached global context from first turn for conversation/turn ${e}`),s.renderedGlobalContext}$Ht.info(this.ctx,`Rendering fresh global context for conversation/turn ${e}`);let o=(await bqt(ixe,{ctx:this.ctx,workspaceFolders:this.props.workspaceFolders},this.props.modelConfiguration)).messages.at(0)?.content;if(o)return r?.setMetadata(new nxe(o)),o}async getAgentCustomInstructions(){if(this.turnContext.cachedCustomInstructions!==void 0)return this.turnContext.cachedCustomInstructions??vscpp(vscppf,null);try{if(!this.props.workspaceFolders||this.props.workspaceFolders.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let e=[],r=this.props.workspaceFolders.map(l=>({uri:l.uri,name:l.name})),n=this.turnContext.turn.extractContextFilesUri(),o=await this.ctx.get(ff).getInstructions(this.ctx,r,{includeCopilotInstructions:!0,includeGitCommitInstructions:!1,includeAgentsMdInstructions:Ht(this.ctx,Je.UseAgentsMd),includeNestedAgentsMdInstructions:Ht(this.ctx,Je.UseNestedAgentsMd),includeClaudeMdInstructions:Ht(this.ctx,Je.UseClaudeMd),includeNestedClaudeMdInstructions:Ht(this.ctx,Je.UseNestedClaudeMd)},n);o&&e.push(vscpp(vscppf,null,o));let s=this.props.turnContext.turn.chatMode;if(s?.id==="Ask")e.push(hTn());else if(s&&s.instruction&&s.instruction.trim().length>0){let{name:l,instruction:u}=s;e.push(vscpp(Hn,{name:"modeInstructions"},'You are currently running in "',l,'" mode. Below are your instructions for this mode, they must take precedence over any instructions above.',vscpp("br",null),vscpp("br",null),u))}if(e.length===0)return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null);let c=vscpp(TK.UserMessage,null,e);return this.turnContext.cachedCustomInstructions=c,c}catch(e){$Ht.warn(this.ctx,"Failed to get custom instructions",e)}return this.turnContext.cachedCustomInstructions=null,vscpp(vscppf,null)}};function FKo(t){return typeof t=="string"?[t]:t.map(e=>{if(e.type==="text")return e.text;if(e.type==="image_url")return vscpp(TK.Image,{src:e.image_url.url,detail:e.image_url.detail})}).filter(e=>e!==void 0)}a(FKo,"renderedMessageToTsxChildren");p();var WZe="uncategorized_tools",jTn="Tools that could not be automatically categorized into existing groups.";p();var uq=class extends Error{static{a(this,"ToolCallCanceledError")}constructor(e){super(e),this.name="Canceled"}};p();var I3=class extends Error{static{a(this,"ToolRoundExceedError")}constructor(){super('Oops, maximum tool attempts reached. You can type "continue" to proceed or rephrase your request.'),this.name="ToolRoundExceedError"}};p();var Xle=new Ae("roundMetricsTracker"),zZe=class{constructor(e,r,n,o){this.ctx=e;this.conversation=r;this.turn=n;this.conversationProgress=o;this.cumulativeTokenUsage={promptTokens:0,completionTokens:0,cachedTokens:0};this.tokenUsageReported=!1;this.roundUsageHistory=[]}static{a(this,"RoundMetricsTracker")}getTimeSinceLastLLMCall(){return this.lastLlmCallEndTimeMs!==void 0?performance.now()-this.lastLlmCallEndTimeMs:void 0}recordLlmFetchComplete(){this.lastLlmCallEndTimeMs=performance.now()}computePromptPrefixMetrics(e,r){let n=UKo(e),o=JSON.stringify(n),s=JSON.stringify(r),c=n.filter(d=>d.role==="system"),l=c.length>0?JSON.stringify(c):"",u={previousPromptCharLen:this.previousPromptSerialized?.length??0,currentPromptCharLen:o.length,commonPromptPrefixCharLen:VHt(this.previousPromptSerialized,o),previousToolsCharLen:this.previousToolsSerialized?.length??0,currentToolsCharLen:s.length,commonToolsPrefixCharLen:VHt(this.previousToolsSerialized,s),previousSystemCharLen:this.previousSystemSerialized?.length??0,currentSystemCharLen:l.length,commonSystemPrefixCharLen:VHt(this.previousSystemSerialized,l),previousRoundCachedTokens:this.previousRoundSnapshot?.cachedTokens,previousRoundPromptTokens:this.previousRoundSnapshot?.promptTokens,previousRoundCommonPromptPrefixCharLen:this.previousRoundSnapshot?.commonPromptPrefixCharLen};return this.previousPromptSerialized=o,this.previousToolsSerialized=s,this.previousSystemSerialized=l,this.pendingRoundCommonPromptPrefixCharLen=u.commonPromptPrefixCharLen,u}extractRoundUsage(e){if("usage"in e&&e.usage)return{promptTokens:e.usage.prompt_tokens,completionTokens:e.usage.completion_tokens,cachedTokens:e.usage.prompt_tokens_details?.cached_tokens??0};let r="usage"in e;Xle.debug(this.ctx,`extractRoundUsage: no usage data in fetch result (type=${e.type}, hasUsageField=${r}, usageValue=${r?JSON.stringify(e.usage):"field absent"}) \u2014 token usage will not be accumulated for this round`)}accumulateTokenUsage(e,r){if(r){if(this.cumulativeTokenUsage.promptTokens+=r.promptTokens,this.cumulativeTokenUsage.completionTokens+=r.completionTokens,this.cumulativeTokenUsage.cachedTokens+=r.cachedTokens,this.roundUsageHistory.push({roundId:e,usage:{...r}}),this.pendingRoundCommonPromptPrefixCharLen===void 0){Xle.debug(this.ctx,`accumulateTokenUsage: no pending prefix charlen for round ${e} (computePromptPrefixMetrics has not run this round) \u2014 preserving prior previousRoundSnapshot`);return}let n=this.pendingRoundCommonPromptPrefixCharLen;this.previousRoundSnapshot={commonPromptPrefixCharLen:n,cachedTokens:r.cachedTokens,promptTokens:r.promptTokens}}else Xle.debug(this.ctx,`accumulateTokenUsage: roundUsage is undefined for round ${e} \u2014 cumulative totals unchanged (prompt=${this.cumulativeTokenUsage.promptTokens}, completion=${this.cumulativeTokenUsage.completionTokens})`)}logRoundDebugMetrics(e,r,n,o,s,c){let l=c;Xle.debug(this.ctx,`Round metrics for iteration ${e} for turn ${r}: prompt=[prev=${l.previousPromptCharLen}, cur=${l.currentPromptCharLen}, prefix=${l.commonPromptPrefixCharLen}`+(l.currentPromptCharLen>0?` (${(l.commonPromptPrefixCharLen/l.currentPromptCharLen*100).toFixed(1)}%)`:"")+`] tools=[prev=${l.previousToolsCharLen}, cur=${l.currentToolsCharLen}, prefix=${l.commonToolsPrefixCharLen}`+(l.currentToolsCharLen>0?` (${(l.commonToolsPrefixCharLen/l.currentToolsCharLen*100).toFixed(1)}%)`:"")+`] tokens=[prompt=${n?.promptTokens??"n/a"}, completion=${n?.completionTokens??"n/a"}, cached=${n?.cachedTokens??"n/a"}] timing=[llmFetch=${o.toFixed(0)}ms`+(s!==void 0?`, sinceLastLLM=${s.toFixed(0)}ms`:"")+"]")}async reportCumulativeTokenUsage(e){if(this.tokenUsageReported)return;this.tokenUsageReported=!0;let r=this.cumulativeTokenUsage;if(r.promptTokens>0||r.completionTokens>0){if(Xle.info(this.ctx,`Turn token usage: ${r.promptTokens} prompt, ${r.completionTokens} completion, ${r.cachedTokens} cached`+(r.promptTokens>0?` (cache rate: ${(r.cachedTokens/r.promptTokens*100).toFixed(1)}%)`:"")),await this.conversationProgress.report(this.conversation,this.turn,{tokenUsage:{...r}}),Ht(this.ctx,Je.AppendPromptTokenCache)==="true"){let n=this.formatTokenStats(r);await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:e,reply:n}]})}}else Xle.debug(this.ctx,`Turn token usage: cumulative totals are zero (promptTokens=${r.promptTokens}, completionTokens=${r.completionTokens}, cachedTokens=${r.cachedTokens}, rounds=${this.roundUsageHistory.length}) \u2014 skipping $progress.report(tokenUsage). This means either no LLM rounds completed or all rounds returned no usage data.`)}formatTokenStats(e){let r=a(c=>c>=1e6?`${(c/1e6).toFixed(1)}M`:c>=1e3?`${(c/1e3).toFixed(1)}k`:c.toString(),"fmt"),n=e.promptTokens>0?` (${(e.cachedTokens/e.promptTokens*100).toFixed(1)}% cached)`:"",o=this.roundUsageHistory.length,s=` \`\`\` --- Prompt token stats: ${r(e.promptTokens)} in, ${r(e.completionTokens)} out, ${r(e.cachedTokens)} cached${n} with ${o} HTTP request${o!==1?"s":""} `;if(this.roundUsageHistory.length>1){s+=` Per-round breakdown: `;for(let c of this.roundUsageHistory){let l=c.usage,u=l.promptTokens>0?` (${(l.cachedTokens/l.promptTokens*100).toFixed(1)}%)`:"";s+=` #${c.roundId}: ${r(l.promptTokens)} in, ${r(l.completionTokens)} out, ${r(l.cachedTokens)} cached${u} -`}}return s+="```\n",s}};function OHt(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(MJo,"stripDriftingFields");p();p();var eXe=new ge("agentModePolicy");function PTn(t){try{let e=FI(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(eXe.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(uu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(eXe.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(eXe.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return eXe.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(PTn,"isAutoApprovalEnabled");p();var tXe=new ge("McpAutoApproveService"),N3=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){tXe.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return tXe.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||tXe.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),tXe.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var NK=ce(require("path"));var zx=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new ge("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&aa.isRegisteredScheme(s[1].toLowerCase()))return;let c=Ia(e);if(!this.isPathInCurrentWorkspace(c,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let u=o?this.defaultRules:this.rules;for(let d of u)if(this.matchesPattern(e,d.pattern))return{rule:d,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=Wn(e);return r.some(o=>{try{let s=Wn(o),c=NK.normalize(s),l=NK.normalize(n),u=NK.relative(c,l);return!u.startsWith("..")&&!NK.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return df(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var MTn=`*** Begin Patch -`,nue=` -*** End Patch`,iue="*** Add File: ",Aq="*** Delete File: ",oue="*** Update File: ",OJo="*** Move to: ",BHt="*** End of File";var BJo=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var Wh=class extends Error{static{a(this,"DiffError")}},sue=class extends Wh{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},yO=class extends Wh{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function DTn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(DTn,"guessIndentation");function NTn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a(NTn,"computeIndentLevel");function LJo(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(LJo,"getIndentationChar");function FJo(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a(FJo,"transformIndentation");function UJo(t){return!t||!t.trim()}a(UJo,"isFalsyOrWhitespace");function QJo(t,e){let r=0;for(let n of t)n===e&&r++;return r}a(QJo,"countOccurrences");function qJo(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(qJo,"computeLevenshteinDistance");function yxe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(yxe,"replaceExplicitTabs");function rXe(t){return yxe(t.replaceAll("\\n",` -`))}a(rXe,"replaceExplicitNl");var LHt=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=DTn(s.split(` -`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new Wh(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([nue]);){let e=this.readStr(oue);if(e){if(this.patch.actions[e])throw new Wh(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(OJo);if(!(e in this.currentFiles))throw new Wh(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(Aq),e){if(this.patch.actions[e])throw new Wh(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new Wh(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(iue),e){if(this.patch.actions[e])throw new Wh(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new Wh(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new Wh(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(nue.trim()))throw new yO("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` -`),c=!BJo.test(e.trimEnd()),l=0;for(;!this.isDone([nue,oue,Aq,iue,BHt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new Wh(`Invalid line. Consider splitting each change into individual apply_patch tool calls: +`}}return s+="```\n",s}};function VHt(t,e){if(!t)return 0;let r=Math.min(t.length,e.length),n=0;for(;ne.copilot_cache_control!==void 0)?t.map(e=>{if(e.copilot_cache_control===void 0)return e;let{copilot_cache_control:r,...n}=e;return n}):t}a(UKo,"stripDriftingFields");p();p();var YZe=new Ae("agentModePolicy");function HTn(t){try{let e=MI(t);return e&&e.getTokenValue("agent_mode_auto_approval")==="0"?(YZe.info(t,"Auto-approval disabled by token envelope: agent_mode_auto_approval=0"),!1):t.get(lu).getPolicyValue("agentMode.autoApproval.enabled")===!1?(YZe.info(t,"Auto-approval disabled by group policy: agentMode.autoApproval.enabled=false"),!1):(YZe.info(t,"Auto-approval is enabled (not disabled by token envelope or group policy)"),!0)}catch(e){return YZe.warn(t,"Failed to check auto-approval policy, defaulting to enabled",e),!0}}a(HTn,"isAutoApprovalEnabled");p();var KZe=new Ae("McpAutoApproveService"),x3=class{constructor(e){this.ctx=e;this._config=[]}static{a(this,"McpAutoApproveService")}updateConfiguration(e){if(!Array.isArray(e)){KZe.warn(this.ctx,"Invalid McpAutoApproveService config, resetting to empty",e),this._config=[];return}this._config=e.filter(r=>{if(!r||typeof r!="object")return KZe.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored because it is not an object",r),!1;let n=r,o=typeof n.serverName=="string"&&typeof n.isServerAllowed=="boolean"&&Array.isArray(n.allowedTools)&&n.allowedTools.every(s=>typeof s=="string");return o||KZe.warn(this.ctx,"Invalid McpAutoApproveService config item: ignored due to schema validation failure",r),o}).map(r=>({serverName:r.serverName,isServerAllowed:r.isServerAllowed,allowedTools:r.allowedTools})),KZe.debug(this.ctx,"Updated McpAutoApproveService config",this._config)}isApproved(e,r){let n=this._config.find(o=>o.serverName===e);return n?n.isServerAllowed?!0:n.allowedTools.includes(r):!1}};p();p();var IK=fe(require("path"));var Wx=class t{constructor(e){this.ctx=e;this.rules=void 0;this.defaultRules=[{pattern:"**/github-copilot/**/*",requiresConfirmation:!0,description:"Github Copilot settings and token files"},{pattern:"**/.github/instructions/*",requiresConfirmation:!0,description:"Github instructions files"}]}static{a(this,"FileSafetyRulesService")}static{this.logger=new Ae("FileSafetyRulesService")}ensureInitialized(){this.rules===void 0&&(this.rules=[...this.defaultRules])}getMatchingRule(e,r,n=!0,o=!1){let s=e.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):[\\/]/);if(s&&na.isRegisteredScheme(s[1].toLowerCase()))return;let c=ba(e);if(!this.isPathInCurrentWorkspace(c,r))return{rule:{pattern:"outside-workspace",requiresConfirmation:!0,description:"files outside workspace"},isOutsideWorkspace:!0};if(!n)return;o||this.ensureInitialized();let u=o?this.defaultRules:this.rules;for(let d of u)if(this.matchesPattern(e,d.pattern))return{rule:d,isOutsideWorkspace:!1}}isPathInCurrentWorkspace(e,r){if(!r||r.length===0)return!1;try{let n=kn(e);return r.some(o=>{try{let s=kn(o),c=IK.normalize(s),l=IK.normalize(n),u=IK.relative(c,l);return!u.startsWith("..")&&!IK.isAbsolute(u)}catch{return!1}})}catch{return!1}}matchesPattern(e,r){return uf(e,r,{nocase:!0,matchBase:!1,nobrace:!0,noext:!0,nonegate:!0,windowsPathsNoEscape:!0})}getDefaultRules(){return[...this.defaultRules]}extractFileSafetyRules(e){try{let r=e?.autoApprove;return Array.isArray(r)?r.filter(n=>n&&typeof n.pattern=="string"&&typeof n.autoApprove=="boolean").map(n=>({pattern:n.pattern,requiresConfirmation:!n.autoApprove,description:n.description})):Array.isArray(e)?e.filter(o=>o&&typeof o.pattern=="string"&&typeof o.autoApprove=="boolean").map(o=>({pattern:o.pattern,requiresConfirmation:!o.autoApprove,description:o.description})):void 0}catch(r){t.logger.error(this.ctx,"Error extracting configuration:",r);return}}updateRulesFromConfiguration(e){let r=this.extractFileSafetyRules(e);if(!(!r||r.length===0))try{this.ensureInitialized();let n=new Map;for(let o of this.defaultRules)n.set(o.pattern,o);for(let o of r)n.set(o.pattern,o);this.rules=Array.from(n.values())}catch(n){t.logger.error(this.ctx,"FileSafetyRulesService.updateRulesFromConfiguration: Failed to parse configuration, using defaults only",n),this.rules===void 0&&(this.rules=[...this.defaultRules])}}};p();var VTn=`*** Begin Patch +`,eue=` +*** End Patch`,tue="*** Add File: ",dq="*** Delete File: ",rue="*** Update File: ",QKo="*** Move to: ",WHt="*** End of File";var qKo=/\.(tex|latex|sty|cls|bib|bst|ins)$/i;var Yh=class extends Error{static{a(this,"DiffError")}},nue=class extends Yh{static{a(this,"InvalidContextError")}constructor(e,r,n){super(e),this.file=r,this.kindForTelemetry=n}},fO=class extends Yh{static{a(this,"InvalidPatchFormatError")}constructor(e,r){super(e),this.kindForTelemetry=r}};function GTn(t,e,r){let n=0,o=0;for(let s of t)s.startsWith(" ")?o++:(s.startsWith(" ")||s.startsWith(" "))&&n++;if(o>n)return{tabSize:e,insertSpaces:!1};if(n>o){let s=0,c=0;for(let u of t){let d=u.match(/^( +)/);if(d){let f=d[1].length;f%4===0&&c++,f%2===0&&s++}}return{tabSize:c>s?4:2,insertSpaces:!0}}return{tabSize:e,insertSpaces:r}}a(GTn,"guessIndentation");function $Tn(t,e){let r=0;for(let n of t)if(n===" ")r++;else if(n===" ")r+=e;else break;return r}a($Tn,"computeIndentLevel");function jKo(t){return t.insertSpaces?" ".repeat(t.tabSize):" "}a(jKo,"getIndentationChar");function HKo(t,e,r){if(e.insertSpaces===r.insertSpaces&&e.tabSize===r.tabSize)return t;let n=t.match(/^(\s*)/);if(!n)return t;let o=n[1],s=t.slice(o.length),c=0;for(let u of o)u===" "?c+=e.tabSize:u===" "&&c++;return(r.insertSpaces?" ".repeat(c):" ".repeat(Math.floor(c/r.tabSize))+" ".repeat(c%r.tabSize))+s}a(HKo,"transformIndentation");function GKo(t){return!t||!t.trim()}a(GKo,"isFalsyOrWhitespace");function $Ko(t,e){let r=0;for(let n of t)n===e&&r++;return r}a($Ko,"countOccurrences");function VKo(t,e){let r=t.length,n=e.length,o=Array.from({length:r+1},()=>Array(n+1).fill(0));for(let s=0;s<=r;s++)o[s][0]=s;for(let s=0;s<=n;s++)o[0][s]=s;for(let s=1;s<=r;s++)for(let c=1;c<=n;c++)t[s-1]===e[c-1]?o[s][c]=o[s-1][c-1]:o[s][c]=Math.min(o[s-1][c]+1,o[s][c-1]+1,o[s-1][c-1]+1);return o[r][n]}a(VKo,"computeLevenshteinDistance");function oxe(t){return t.replace(/^(?:\s|\\t|\/|#)*/gm,e=>e.replaceAll("\\t"," "))}a(oxe,"replaceExplicitTabs");function JZe(t){return oxe(t.replaceAll("\\n",` +`))}a(JZe,"replaceExplicitNl");var zHt=class{constructor(e,r){this.indentStyles={};this.index=0;this.patch={actions:{}};this.fuzz=0;this.currentFiles=e,this.lines=r;for(let[n,o]of Object.entries(e)){let s=o.getText();this.indentStyles[n]=GTn(s.split(` +`),4,!1)}}static{a(this,"Parser")}isDone(e){if(this.index>=this.lines.length)return!0;let r=this.lines[this.index];return!!(e&&r&&e.some(n=>r.startsWith(n.trim())))}startswith(e){let r=Array.isArray(e)?e:[e],n=this.lines[this.index];return n!==void 0&&r.some(o=>n.startsWith(o))}readStr(e="",r=!1){if(this.index>=this.lines.length)throw new Yh(`Index: ${this.index} >= ${this.lines.length}`);let n=this.lines[this.index];if(n!==void 0&&n.startsWith(e)){let o=r?n:n.slice(e.length);return this.index+=1,o??""}return""}parse(){for(;!this.isDone([eue]);){let e=this.readStr(rue);if(e){if(this.patch.actions[e])throw new Yh(`Update File Error: Duplicate Path: ${e}`);let r=this.readStr(QKo);if(!(e in this.currentFiles))throw new Yh(`Update File Error: Missing File: ${e}`);let n=this.currentFiles[e],o=this.indentStyles[e],s=n.getText(),c=this.getFilepathComment(n.languageId,e),l=this.parseUpdateFile(c,s??"",o);l.movePath=r||void 0,this.patch.actions[e]=l;continue}if(e=this.readStr(dq),e){if(this.patch.actions[e])throw new Yh(`Delete File Error: Duplicate Path: ${e}`);if(!(e in this.currentFiles))throw new Yh(`Delete File Error: Missing File: ${e}`);this.patch.actions[e]={type:"delete",chunks:[]};continue}if(e=this.readStr(tue),e){if(this.patch.actions[e])throw new Yh(`Add File Error: Duplicate Path: ${e}`);if(e in this.currentFiles)throw new Yh(`Add File Error: File already exists: ${e}`);this.patch.actions[e]=this.parseAddFile();continue}throw new Yh(`Unknown Line: ${this.lines[this.index]}`)}if(!this.startswith(eue.trim()))throw new fO("Missing End Patch","missingEndPatch");this.index+=1}getFilepathComment(e,r){let n=r.split(".").pop()?.toLowerCase()??"",o=["sh","bash","zsh","py","rb","pl","yaml","yml"].includes(n),s=["html","htm","xml","svg"].includes(n);return o?`# ${r}`:s?``:`// ${r}`}parseUpdateFile(e,r,n){let o={type:"update",chunks:[]},s=r.split(` +`),c=!qKo.test(e.trimEnd()),l=0;for(;!this.isDone([eue,rue,dq,tue,WHt]);){let u=this.readStr("@@",!0),d=u.slice(2).trim();if(!(u||l===0))throw new Yh(`Invalid line. Consider splitting each change into individual apply_patch tool calls: ${this.lines[this.index]}`);if(d){let _=!1,v=a(b=>this.canonicalize(b),"canonLocal");if(!s.slice(0,l).some(b=>v(b)===v(d)))for(let b=l;bv(b.trim())===v(d)))for(let b=l;b0&&(f=this.peekNextSection(this.lines,this.index,_)),h=this.findContext(e,s,f.nextChunkContext,l,f.eof),h||(h=this.findContext(e,s,f.nextChunkContext,0,f.eof)),_>0&&h&&(h.fuzz|=64);if(!h){let _=f.nextChunkContext.join(` -`);if(f.eof)throw new sue(`Invalid EOF context at character ${l}: -${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new sue(`Invalid context at character ${l}: -${_}`,r,v)}}this.fuzz+=h.fuzz;let m=DTn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=NTn(s[h.line]??"",n.tabSize),A=h.fuzz&4?yxe(f.nextChunkContext[0]??""):h.fuzz&128?rXe(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?NTn(A,m.tabSize):0,E=LJo(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(rXe),_.delLines=_.delLines.map(rXe)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(yxe)),_.insLines=_.insLines.map(v=>UJo(v)?v:E+FJo(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(yxe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([nue,oue,Aq,iue]);){let r=this.readStr();if(!r.startsWith("+"))throw new yO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` +`);if(f.eof)throw new nue(`Invalid EOF context at character ${l}: +${_}`,r,"invalidContext-eof");{let v=_.match(/^\\t/)?"invalidContext-maybeInvalidTab":_.match(/^\\\t/)?"invalidContext-maybeEscapedTab":"invalidContext";throw new nue(`Invalid context at character ${l}: +${_}`,r,v)}}this.fuzz+=h.fuzz;let m=GTn(f.chunks.flatMap(_=>_.insLines).concat(f.nextChunkContext),n.tabSize,n.insertSpaces),g=$Tn(s[h.line]??"",n.tabSize),A=h.fuzz&4?oxe(f.nextChunkContext[0]??""):h.fuzz&128?JZe(f.nextChunkContext[0]??""):f.nextChunkContext[0]??"",y=f.nextChunkContext&&f.nextChunkContext.length>0?$Tn(A,m.tabSize):0,E=jKo(n).repeat(Math.max(0,g-y));for(let _ of f.chunks)_.origIndex+=h.line,h.fuzz&128&&(_.insLines=_.insLines.map(JZe),_.delLines=_.delLines.map(JZe)),(c||h.fuzz&4)&&(_.insLines=_.insLines.map(oxe)),_.insLines=_.insLines.map(v=>GKo(v)?v:E+HKo(v,m,n)),h.fuzz&4&&(_.delLines=_.delLines.map(oxe)),o.chunks.push(_);l=h.line+f.nextChunkContext.length,this.index=f.endPatchIndex}return o}parseAddFile(){let e=[];for(;!this.isDone([eue,rue,dq,tue]);){let r=this.readStr();if(!r.startsWith("+"))throw new fO(`Invalid Add File Line: ${r}`,"invalidAddFileLine");e.push(r.slice(1))}return{type:"add",newFile:e.join(` `),chunks:[]}}canonicalize(e){let r={"-":"-","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2212":"-",'"':'"',"\u201C":'"',"\u201D":'"',"\u201E":'"',"\xAB":'"',"\xBB":'"',"'":"'","\u2018":"'","\u2019":"'","\u201B":"'","\xA0":" ","\u202F":" "};return e.normalize("NFC").replace(/./gu,n=>r[n]??n)}findContextCore(e,r,n){if(r.length===0)return{line:n,fuzz:0};let o=a(m=>this.canonicalize(m),"canon"),s=o(r.join(` `)),c=e.map(o);for(let m=n;mm.trimEnd()).join(` `),u=2;for(let m=n;mm.trim()).join(` `);u|=8;for(let m=n;m0){let m=f.split(` -`);for(let g=n;g(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new yO(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),sn.length)throw new Wh(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new Wh(`${r}: origIndex ${s} > chunk.origIndex ${c.origIndex}`);o.push(...n.slice(s,c.origIndex));let l=c.origIndex-s;if(s+=l,c.insLines.length)for(let u of c.insLines)o.push(u);s+=c.delLines.length}return o.push(...n.slice(s)),o.join(` -`)}a(HJo,"getUpdatedFile");function GJo(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=HJo(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(GJo,"patchToCommit");async function $Jo(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new Wh(`File not found: ${n}`)}return r}a($Jo,"loadFiles");async function BTn(t,e){if(!t.startsWith(MTn))throw new yO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=MK(t),n=await $Jo(r,e),[o]=jJo(t,n);return GJo(o,n)}a(BTn,"processPatch");var EO=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=MK(s),l=aue(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(zx),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(zx),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. +`);for(let g=n;g(y[y.Add=0]="Add",y[y.Delete=1]="Delete",y[y.Keep=2]="Keep"))(o||={});let s=r,c=[],l=[],u=[],d=[],f=2,h=0;for(;sm.startsWith(y.trim()))){f===2&&c.length&&!/\S/.test(c[c.length-1]??"")&&c.pop();break}if(m==="***")break;if(m.startsWith("***"))throw new fO(`Invalid Line: ${m}`,"invalidLine");s+=1;let g=f,A=m;if(A[0]==="+")f=0;else if(A[0]==="-")f=1;else if(A[0]===" ")f=2;else{let y=e[s],E=y?.[0]==="+"?0:y?.[0]==="-"?1:2,_=f!==2&&E===f;f=2,A=" "+A,_&&(h++,n===h&&(f=E))}A=A.slice(1),f===2&&g!==f&&((u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),l=[],u=[]),f===1?(l.push(A),c.push(A)):f===0?u.push(A):c.push(A)}return(u.length||l.length)&&d.push({origIndex:c.length-l.length,delLines:l,insLines:u}),sn.length)throw new Yh(`${r}: chunk.origIndex ${c.origIndex} > len(lines) ${n.length}`);if(s>c.origIndex)throw new Yh(`${r}: origIndex ${s} > chunk.origIndex ${c.origIndex}`);o.push(...n.slice(s,c.origIndex));let l=c.origIndex-s;if(s+=l,c.insLines.length)for(let u of c.insLines)o.push(u);s+=c.delLines.length}return o.push(...n.slice(s)),o.join(` +`)}a(zKo,"getUpdatedFile");function YKo(t,e){let r={changes:{}};for(let[n,o]of Object.entries(t.actions))if(o.type==="delete")r.changes[n]={type:"delete",oldContent:e[n].getText()};else if(o.type==="add")r.changes[n]={type:"add",newContent:o.newFile??""};else if(o.type==="update"){let s=e[n]?.getText(),c=zKo(s??"",o,n);r.changes[n]={type:"update",oldContent:s,newContent:c,movePath:o.movePath??void 0}}return r}a(YKo,"patchToCommit");async function KKo(t,e){let r={};for(let n of t)try{r[n]=await e(n)}catch{throw new Yh(`File not found: ${n}`)}return r}a(KKo,"loadFiles");async function zTn(t,e){if(!t.startsWith(VTn))throw new fO("Patch must start with *** Begin Patch\\n","patchMustStartWithBeginPatch");let r=xK(t),n=await KKo(r,e),[o]=WKo(t,n);return YKo(o,n)}a(zTn,"processPatch");var pO=class{static{a(this,"SensitiveToolsService")}static{this.SENSITIVE_TOOL_TEXT={create_file:{title:"Allow creating sensitive files?",operation:"create"},read_file:{title:"Allow reading sensitive files?",operation:"read"},replace_string_in_file:{title:"Allow replacing strings in sensitive files?",operation:"replace strings in"},insert_edit_into_file:{title:"Allow editing sensitive files?",operation:"edit"},apply_patch:{title:"Allow editing sensitive files?",operation:"edit"}}}static{this.POTENTIALLY_SENSITIVE_TOOLS=new Set(["insert_edit_into_file","create_file","read_file","replace_string_in_file","apply_patch"])}static isPotentiallySensitiveTool(e){let r=typeof e=="string"?e:e.name;return this.POTENTIALLY_SENSITIVE_TOOLS.has(r)}static getPotentiallySensitiveTools(){return this.POTENTIALLY_SENSITIVE_TOOLS}static generateSensitiveConfirmationTitle(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.title??"Allow operating on sensitive files?"}static generateSensitiveOperation(e){return this.SENSITIVE_TOOL_TEXT[e.name]?.operation??"operate on"}static extractFilePath(e,r){if(e.name==="apply_patch"){let s=r.input;if(!s)return;let c=xK(s),l=iue(s);return c.length>0?{filePath:c[0],isNewFile:!1}:l.length>0?{filePath:l[0],isNewFile:!0}:void 0}let n=r.filePath;if(!n)return;let o=e.name==="create_file";return{filePath:n,isNewFile:o}}static extractFilePathForMetadata(e,r){return this.extractFilePath(e,r)}static{this.sensitiveInfoCache=new WeakMap}static generateSensitiveConfirmationMessage(e,r,n){if(this.sensitiveInfoCache.has(r))return this.sensitiveInfoCache.get(r)??void 0;let o=this.computeSensitiveConfirmationMessage(e,r,n);return this.sensitiveInfoCache.set(r,o??null),o}static getMatchingRuleForToolCall(e,r,n,o=!1){let s=this.extractFilePath(e,r);if(!s)return;let{filePath:c,isNewFile:l}=s,u=n.turn.workspaceFolders?.map(h=>h.uri),d=n.ctx.get(Wx),f=!l;return d.getMatchingRule(c,u,f,o)}static computeSensitiveConfirmationMessage(e,r,n){if(!this.isPotentiallySensitiveTool(e))return;let o=this.extractFilePath(e,r);if(!o)return;let{filePath:s,isNewFile:c}=o,l=n.turn.workspaceFolders?.map(g=>g.uri),u=n.ctx.get(Wx),d=!c,f=u.getMatchingRule(s,l,d);if(f&&!f.rule.requiresConfirmation)return;let h=this.generateSensitiveConfirmationTitle(e),m=this.generateSensitiveOperation(e);if(f){let g=f.rule.description||"Sensitive files";return{title:h,message:`${g} needs confirmation. The model wants to ${m} sensitive files (${s})${f.rule.pattern?` matching pattern \`${f.rule.pattern}\``:""}. -Do you want to allow this?`,matchingRuleInfo:f}}return{title:h,message:`The model wants to ${m} file (${s}). Do you want to allow this?`,matchingRuleInfo:void 0}}};var cue=new ge("AutoApproveService"),OK=class{constructor(e){this.ctx=e}static{a(this,"AutoApproveService")}async checkApproval(e,r,n){if(NN()&&process.env.HMAC_SECRET)return{needConfirm:!1};if(qt(e.ctx,je.EditorHandlesAllConfirmation)===!0)return{needConfirm:!0};let o=this.classifyTool(r);if(o==="other")return cue.debug(this.ctx,"Auto approve check for build-in safe tool decided: approve (always auto-approved)"),{needConfirm:!1};if(!PTn(this.ctx)){if(o==="file-operation"){let u=this.checkSensitiveFileApproval(r,n,e,!0),d=u.action==="confirm";return cue.debug(this.ctx,`Auto approve check (policy disabled, file-operation, default rules only) decided: ${u.action}`),{needConfirm:d}}return cue.info(this.ctx,"Tool confirmation required: auto-approval disabled by policy"),{needConfirm:!0}}if(qt(e.ctx,je.AutoApproveYoloMode)===!0)return cue.info(this.ctx,`Auto approve yolo mode: auto-approving ${o} tool call`),{needConfirm:!1};let s=qt(e.ctx,je.ToolConfirmAutoApprove)===!0,c;switch(o){case"mcp":c=this.checkMcpApproval(r),c.action==="continue"&&(c=s?{action:"approve"}:{action:"confirm"});break;case"terminal":{if(c=await this.checkTerminalApproval(r,n),c.action==="continue"){let u=qt(e.ctx,je.AutoApproveUnmatchedTerminal);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c=s?{action:"approve"}:{action:"confirm"}}break}case"file-operation":{if(c=this.checkSensitiveFileApproval(r,n,e),c.action==="continue"){let u=qt(e.ctx,je.AutoApproveUnmatchedFileOp);u!==void 0?c=u?{action:"approve"}:{action:"confirm"}:c={action:"approve"}}break}}let l=c.action==="confirm";return cue.debug(this.ctx,`Auto approve check (${o}) decided: ${c.action}`),{needConfirm:l}}classifyTool(e){return e.type==="mcp"?"mcp":e.id.includes("run_in_terminal")?"terminal":EO.isPotentiallySensitiveTool(e)?"file-operation":"other"}checkMcpApproval(e){if(this.ctx.get(N3).isApproved(e.toolProvider.id,e.name))return{action:"approve"};if(qt(this.ctx,je.TrustToolAnnotations)){let o=this.ctx.get(us).getToolById(e.id);if(o?.annotations?.readOnlyHint&&!o.annotations.openWorldHint)return{action:"approve"}}return{action:"continue"}}async checkTerminalApproval(e,r){let n=r.command,o=this.ctx.get(qS),c=kK(e.description)||"sh";cue.info(this.ctx,`Extracted shell '${c}' from run_in_terminal tool description.`);let l=await o.isTerminalCommandApprovalRequired(n,c);return l.result==="approved"?{action:"approve"}:l.result==="denied"?{action:"confirm"}:{action:"continue"}}checkSensitiveFileApproval(e,r,n,o=!1){let s=EO.getMatchingRuleForToolCall(e,r,n,o);return s?s.rule.requiresConfirmation?{action:"confirm"}:{action:"approve"}:{action:"continue"}}};p();p();p();function Exe(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(WJo,"isUndefined");function FHt(t){return Buffer.from(t,"base64").toString("utf-8")}a(FHt,"decodeBase64");function UTn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(UTn,"isObject");p();var yq="activate_",F_=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(yq))throw new Error(`Virtual tool name must start with '${yq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(yq+e+this.name.slice(yq.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},UHt=class extends sr{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` -`),"",vscpp("br",null))}},nXe=class extends sr{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(Eq.UserMessage,null,this.props.tools.map(e=>vscpp(_xe,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},iXe=class extends sr{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(Eq.UserMessage,null,this.props.tools.map(e=>vscpp(_xe,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},oXe=class extends sr{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Eq.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(Eq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(UHt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(_xe,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var zHt={};wi(zHt,{arrayReplaceAt:()=>WHt,asciiTrim:()=>QK,assign:()=>fue,escapeHtml:()=>O3,escapeRE:()=>RZo,fromCodePoint:()=>pue,has:()=>yZo,isMdAsciiPunct:()=>FK,isPunctChar:()=>sIn,isPunctCharCode:()=>LK,isSpace:()=>zs,isString:()=>AXe,isValidEntityCode:()=>yXe,isWhiteSpace:()=>BK,lib:()=>kZo,normalizeReference:()=>UK,unescapeAll:()=>M3,unescapeMd:()=>bZo});p();var uXe={};wi(uXe,{decode:()=>Cxe,encode:()=>cXe,format:()=>lue,parse:()=>vxe});p();p();var QTn={};function zJo(t){let e=QTn[t];if(e)return e;e=QTn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(sXe,"decode");sXe.defaultChars=";/?:@&=+$,#";sXe.componentChars="";var Cxe=sXe;p();var qTn={};function YJo(t){let e=qTn[t];if(e)return e;e=qTn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=YJo(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(aXe,"encode");aXe.defaultChars=";/?:@&=+$,-_.!~*'()#";aXe.componentChars="-_.!~*'()";var cXe=aXe;p();function lue(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(lue,"format");p();function lXe(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(lXe,"Url");var KJo=/^([a-z0-9.+-]+:)/i,JJo=/:[0-9]*$/,ZJo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,XJo=["<",">",'"',"`"," ","\r",` -`," "],eZo=["{","}","|","\\","^","`"].concat(XJo),tZo=["'"].concat(eZo),jTn=["%","/","?",";","#"].concat(tZo),HTn=["/","?","#"],rZo=255,GTn=/^[+a-z0-9A-Z_-]{0,63}$/,nZo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,$Tn={javascript:!0,"javascript:":!0},VTn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function iZo(t,e){if(t&&t instanceof lXe)return t;let r=new lXe;return r.parse(t,e),r}a(iZo,"urlParse");lXe.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=ZJo.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=KJo.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&$Tn[c])&&(s=s.substr(2),this.slashes=!0)),!$Tn[c]&&(o||c&&!VTn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(GTn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(nZo);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>rZo&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),VTn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};lXe.prototype.parseHost=function(t){let e=JJo.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var vxe=iZo;var QHt={};wi(QHt,{Any:()=>dXe,Cc:()=>fXe,Cf:()=>WTn,P:()=>uue,S:()=>pXe,Z:()=>hXe});p();p();var dXe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var fXe=/[\0-\x1F\x7F-\x9F]/;p();var WTn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var uue=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var pXe=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var hXe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var zTn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var YTn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var qHt,oZo=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),jHt=(qHt=String.fromCodePoint)!==null&&qHt!==void 0?qHt:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function HHt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=oZo.get(t))!==null&&e!==void 0?e:t}a(HHt,"replaceCodePoint");var ug;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(ug||(ug={}));var sZo=32,_q;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(_q||(_q={}));function GHt(t){return t>=ug.ZERO&&t<=ug.NINE}a(GHt,"isNumber");function aZo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_F||t>=ug.LOWER_A&&t<=ug.LOWER_F}a(aZo,"isHexadecimalCharacter");function cZo(t){return t>=ug.UPPER_A&&t<=ug.UPPER_Z||t>=ug.LOWER_A&&t<=ug.LOWER_Z||GHt(t)}a(cZo,"isAsciiAlphaNumeric");function lZo(t){return t===ug.EQUALS||cZo(t)}a(lZo,"isEntityInAttributeInvalidEnd");var lg;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(lg||(lg={}));var NP;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(NP||(NP={}));var mXe=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=lg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=NP.Strict}startEntity(e){this.decodeMode=e,this.state=lg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case lg.EntityStart:return e.charCodeAt(r)===ug.NUM?(this.state=lg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=lg.NamedEntity,this.stateNamedEntity(e,r));case lg.NumericStart:return this.stateNumericStart(e,r);case lg.NumericDecimal:return this.stateNumericDecimal(e,r);case lg.NumericHex:return this.stateNumericHex(e,r);case lg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|sZo)===ug.LOWER_X?(this.state=lg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=lg.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===ug.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==NP.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&_q.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~_q.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case lg.NamedEntity:return this.result!==0&&(this.decodeMode!==NP.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case lg.NumericDecimal:return this.emitNumericEntity(0,2);case lg.NumericHex:return this.emitNumericEntity(0,3);case lg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case lg.EntityStart:return 0}}};function KTn(t){let e="",r=new mXe(t,n=>e+=jHt(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(KTn,"getDecoder");function uZo(t,e,r,n){let o=(e&_q.BRANCH_LENGTH)>>7,s=e&_q.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(uZo,"determineBranch");var JTn=KTn(zTn),Fwd=KTn(YTn);function due(t,e=NP.Legacy){return JTn(t,e)}a(due,"decodeHTML");function bxe(t){return JTn(t,NP.Strict)}a(bxe,"decodeHTMLStrict");p();p();function gXe(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function $Ht(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a($Ht,"getEscaper");var ZTn=$Ht(/[&<>'"]/g,fZo),XTn=$Ht(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),eIn=$Ht(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var tIn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(tIn||(tIn={}));var rIn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(rIn||(rIn={}));function gZo(t){return Object.prototype.toString.call(t)}a(gZo,"_class");function AXe(t){return gZo(t)==="[object String]"}a(AXe,"isString");var AZo=Object.prototype.hasOwnProperty;function yZo(t,e){return AZo.call(t,e)}a(yZo,"has");function fue(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(fue,"assign");function WHt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(WHt,"arrayReplaceAt");function yXe(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(yXe,"isValidEntityCode");function pue(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(pue,"fromCodePoint");var oIn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,EZo=/&([a-z#][a-z0-9]{1,31});/gi,_Zo=new RegExp(oIn.source+"|"+EZo.source,"gi"),CZo=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function vZo(t,e){if(e.charCodeAt(0)===35&&CZo.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return yXe(n)?pue(n):t}let r=due(t);return r!==t?r:t}a(vZo,"replaceEntityPattern");function bZo(t){return t.indexOf("\\")<0?t:t.replace(oIn,"$1")}a(bZo,"unescapeMd");function M3(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(_Zo,function(e,r,n){return r||vZo(e,n)})}a(M3,"unescapeAll");var SZo=/[&<>"]/,TZo=/[&<>"]/g,IZo={"&":"&","<":"<",">":">",'"':"""};function xZo(t){return IZo[t]}a(xZo,"replaceUnsafeChar");function O3(t){return SZo.test(t)?t.replace(TZo,xZo):t}a(O3,"escapeHtml");var wZo=/[.?*+^$[\]\\(){}|-]/g;function RZo(t){return t.replace(wZo,"\\$&")}a(RZo,"escapeRE");function zs(t){switch(t){case 9:case 32:return!0}return!1}a(zs,"isSpace");function BK(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(BK,"isWhiteSpace");function sIn(t){return uue.test(t)||pXe.test(t)}a(sIn,"isPunctChar");function LK(t){return sIn(pue(t))}a(LK,"isPunctCharCode");function FK(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(FK,"isMdAsciiPunct");function UK(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(UK,"normalizeReference");function iIn(t){return t===32||t===9||t===10||t===13}a(iIn,"isAsciiTrimmable");function QK(t){let e=0;for(;e=e&&iIn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(QK,"asciiTrim");var kZo={mdurl:uXe,ucmicro:QHt};var ZHt={};wi(ZHt,{parseLinkDestination:()=>KHt,parseLinkLabel:()=>YHt,parseLinkTitle:()=>JHt});p();p();function YHt(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=M3(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(KHt,"parseLinkDestination");p();function JHt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+O3(s.content)+""};_O.code_block=function(t,e,r,n,o){let s=t[e];return""+O3(t[e].content)+` -`};_O.fence=function(t,e,r,n,o){let s=t[e],c=s.info?M3(s.info).trim():"",l="",u="";if(c){let f=c.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(r.highlight?d=r.highlight(s.content,l,u)||O3(s.content):d=O3(s.content),d.indexOf("n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n"u"}a(ZKo,"isUndefined");function YHt(t){return Buffer.from(t,"base64").toString("utf-8")}a(YHt,"decodeBase64");function JTn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}a(JTn,"isObject");p();var fq="activate_",B_=class t{constructor(e,r,n,o,s=[]){this.name=e;this.description=r;this.lastUsedOnTurn=n;this.metadata=o;this.contents=s;this.isExpanded=!1;if(!e.startsWith(fq))throw new Error(`Virtual tool name must start with '${fq}'`);this.name=e,this.description=r,this.lastUsedOnTurn=n,this.metadata=o,this.contents=s}static{a(this,"VirtualTool")}cloneWithPrefix(e){return new t(fq+e+this.name.slice(fq.length),this.description,this.lastUsedOnTurn,{...this.metadata,possiblePrefix:void 0},this.contents)}find(e){if(this.name===e)return{tool:this,path:[]};for(let r of this.contents)if(r instanceof t){let n=r.find(e);if(n)return n.path.unshift(this),n}else if(r.nameForModel===e)return{tool:r,path:[this]}}getLowestExpandedTool(){let e;for(let r of this.all())r instanceof t&&r.isExpanded&&(!e||r.lastUsedOnTurn${e.description}`,vscpp("br",null))}},KHt=class extends ar{static{a(this,"ExistingGroupInformation")}renderCopilot(){let{group:e}=this.props;return vscpp(vscppf,null,``,vscpp("br",null),`${e.summary}`,vscpp("br",null),e.tools.map(r=>` +`),"",vscpp("br",null))}},ZZe=class extends ar{static{a(this,"GeneralSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(pq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create a summary of them that accurately reflects the capabilities they provide.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must create a summary of the tools that is accurate and comprehensive. The summary should include the capabilities of the tools and when they should be used.",vscpp("br",null)),vscpp(pq.UserMessage,null,this.props.tools.map(e=>vscpp(axe,{tool:e})),vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"object",required:["name","summary"],properties:{summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'},name:{type:"string",description:"A short name for the group. It may only contain the characters a-z, A-Z, 0-9, and underscores.",example:"foo_language_tools"}}},null,2)))}},XZe=class extends ar{static{a(this,"CategorizerSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(pq.SystemMessage,null,"Context: There are many tools available for a user. However, the number of tools can be large, and it is not always practical to present all of them at once. We need to create logical groups for the user to pick from at a glance.",vscpp("br",null),vscpp("br",null),"The user present you with the tools available to them, and you must group them into logical categories and provide a summary of each one. The summary should include the capabilities of the tools and when they should be used. Every tool MUST be a part of EXACTLY one category. Category names in your response MUST be unique\u2014do not reuse the same name for different categories. If two categories would share a base name, append a short, descriptive suffix to disambiguate (e.g., python_tools_testing vs python_tools_packaging).",vscpp("br",null)),vscpp(pq.UserMessage,null,this.props.tools.map(e=>vscpp(axe,{tool:e})),vscpp("br",null),vscpp("br",null),"You MUST make sure every tool is part of a category. Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. If a potential collision exists, add a short suffix to keep names unique (e.g., _testing, _packaging).",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}},eXe=class extends ar{static{a(this,"ExistingGroupCategorizerPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(pq.SystemMessage,null,"Context: There are existing tool categories that have been previously established. New tools have become available and need to be categorized. You must decide whether each new tool fits into an existing category or requires a new category to be created.",vscpp("br",null),vscpp("br",null),"The user will provide you with the existing categories and their current tools, as well as the new tools that need to be categorized. You must assign each new tool to either an existing category (if it fits well) or create new categories as needed. You should also return all existing tools in their current categories unless there's a compelling reason to reorganize them.",vscpp("br",null),vscpp("br",null),"Every tool (both existing and new) MUST be part of EXACTLY one category in your response. Category names MUST be unique within the response. If a new category would conflict with an existing category name, choose a distinct, disambiguating name.",vscpp("br",null)),vscpp(pq.UserMessage,null,"**Existing Categories:**",vscpp("br",null),this.props.existingGroups.map(e=>vscpp(KHt,{group:e})),vscpp("br",null),"**New Tools to Categorize:**",vscpp("br",null),this.props.newTools.map(e=>vscpp(axe,{tool:e})),vscpp("br",null),vscpp("br",null),"Instructions:",vscpp("br",null),"1. For each new tool, determine if it fits well into an existing category or if it needs a new category",vscpp("br",null),"2. Keep existing tools in their current categories unless there's a strong reason to move them",vscpp("br",null),"3. Create new categories only when new tools don't fit well into existing ones",vscpp("br",null),"4. Every tool (existing + new) MUST appear in exactly one category",vscpp("br",null),vscpp("br",null),"Your response must follow the JSON schema:",vscpp("br",null),vscpp("br",null),"```",vscpp("br",null),JSON.stringify({type:"array",items:{type:"object",required:["name","tools","summary"],properties:{name:{type:"string",description:"A short, unique name for the category across this response. It may only contain the characters a-z, A-Z, 0-9, and underscores. Do not reuse names; add a short suffix if needed to avoid collisions.",example:"foo_language_tools"},tools:{type:"array",description:"The tool names that are part of this category.",items:{type:"string"}},summary:{type:"string",description:"A summary of the tool capabilities, including their capabilities and how they can be used together. This may be up to five paragraphs long, be careful not to leave out important details.",example:'These tools assist with authoring the "foo" language. They can provide diagnostics, run tests, and provide refactoring actions for the foo language.'}}}},null,2)))}};p();p();p();var oGt={};xi(oGt,{arrayReplaceAt:()=>iGt,asciiTrim:()=>NK,assign:()=>lue,escapeHtml:()=>R3,escapeRE:()=>MJo,fromCodePoint:()=>uue,has:()=>bJo,isMdAsciiPunct:()=>kK,isPunctChar:()=>yIn,isPunctCharCode:()=>PK,isSpace:()=>$s,isString:()=>fXe,isValidEntityCode:()=>pXe,isWhiteSpace:()=>RK,lib:()=>OJo,normalizeReference:()=>DK,unescapeAll:()=>w3,unescapeMd:()=>wJo});p();var oXe={};xi(oXe,{decode:()=>cxe,encode:()=>nXe,format:()=>sue,parse:()=>lxe});p();p();var ZTn={};function XKo(t){let e=ZTn[t];if(e)return e;e=ZTn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);e.push(n)}for(let r=0;r=55296&&f<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(h-=65536,o+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}o+="\uFFFD"}return o})}a(tXe,"decode");tXe.defaultChars=";/?:@&=+$,#";tXe.componentChars="";var cxe=tXe;p();var XTn={};function eJo(t){let e=XTn[t];if(e)return e;e=XTn[t]=[];for(let r=0;r<128;r++){let n=String.fromCharCode(r);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r"u"&&(r=!0);let n=eJo(e),o="";for(let s=0,c=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}a(rXe,"encode");rXe.defaultChars=";/?:@&=+$,-_.!~*'()#";rXe.componentChars="-_.!~*'()";var nXe=rXe;p();function sue(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}a(sue,"format");p();function iXe(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}a(iXe,"Url");var tJo=/^([a-z0-9.+-]+:)/i,rJo=/:[0-9]*$/,nJo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,iJo=["<",">",'"',"`"," ","\r",` +`," "],oJo=["{","}","|","\\","^","`"].concat(iJo),sJo=["'"].concat(oJo),eIn=["%","/","?",";","#"].concat(sJo),tIn=["/","?","#"],aJo=255,rIn=/^[+a-z0-9A-Z_-]{0,63}$/,cJo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,nIn={javascript:!0,"javascript:":!0},iIn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lJo(t,e){if(t&&t instanceof iXe)return t;let r=new iXe;return r.parse(t,e),r}a(lJo,"urlParse");iXe.prototype.parse=function(t,e){let r,n,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){let d=nJo.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let c=tJo.exec(s);if(c&&(c=c[0],r=c.toLowerCase(),this.protocol=c,s=s.substr(c.length)),(e||c||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(c&&nIn[c])&&(s=s.substr(2),this.slashes=!0)),!nIn[c]&&(o||c&&!iIn[c])){let d=-1;for(let A=0;A127?v+="x":v+=_[b];if(!v.match(rIn)){let b=A.slice(0,y),T=A.slice(y+1),w=_.match(cJo);w&&(b.push(w[1]),T.unshift(w[2])),T.length&&(s=T.join(".")+s),this.hostname=b.join(".");break}}}}this.hostname.length>aJo&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));let u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),iIn[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};iXe.prototype.parseHost=function(t){let e=rJo.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var lxe=lJo;var JHt={};xi(JHt,{Any:()=>sXe,Cc:()=>aXe,Cf:()=>oIn,P:()=>aue,S:()=>cXe,Z:()=>lXe});p();p();var sXe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;p();var aXe=/[\0-\x1F\x7F-\x9F]/;p();var oIn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;p();var aue=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;p();var cXe=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;p();var lXe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;p();p();p();var sIn=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(t=>t.charCodeAt(0)));p();var aIn=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(t=>t.charCodeAt(0)));p();var ZHt,uJo=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),XHt=(ZHt=String.fromCodePoint)!==null&&ZHt!==void 0?ZHt:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function eGt(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=uJo.get(t))!==null&&e!==void 0?e:t}a(eGt,"replaceCodePoint");var lg;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(lg||(lg={}));var dJo=32,hq;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(hq||(hq={}));function tGt(t){return t>=lg.ZERO&&t<=lg.NINE}a(tGt,"isNumber");function fJo(t){return t>=lg.UPPER_A&&t<=lg.UPPER_F||t>=lg.LOWER_A&&t<=lg.LOWER_F}a(fJo,"isHexadecimalCharacter");function pJo(t){return t>=lg.UPPER_A&&t<=lg.UPPER_Z||t>=lg.LOWER_A&&t<=lg.LOWER_Z||tGt(t)}a(pJo,"isAsciiAlphaNumeric");function hJo(t){return t===lg.EQUALS||pJo(t)}a(hJo,"isEntityInAttributeInvalidEnd");var cg;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(cg||(cg={}));var kk;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(kk||(kk={}));var uXe=class{static{a(this,"EntityDecoder")}constructor(e,r,n){this.decodeTree=e,this.emitCodePoint=r,this.errors=n,this.state=cg.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=kk.Strict}startEntity(e){this.decodeMode=e,this.state=cg.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,r){switch(this.state){case cg.EntityStart:return e.charCodeAt(r)===lg.NUM?(this.state=cg.NumericStart,this.consumed+=1,this.stateNumericStart(e,r+1)):(this.state=cg.NamedEntity,this.stateNamedEntity(e,r));case cg.NumericStart:return this.stateNumericStart(e,r);case cg.NumericDecimal:return this.stateNumericDecimal(e,r);case cg.NumericHex:return this.stateNumericHex(e,r);case cg.NamedEntity:return this.stateNamedEntity(e,r)}}stateNumericStart(e,r){return r>=e.length?-1:(e.charCodeAt(r)|dJo)===lg.LOWER_X?(this.state=cg.NumericHex,this.consumed+=1,this.stateNumericHex(e,r+1)):(this.state=cg.NumericDecimal,this.stateNumericDecimal(e,r))}addToNumericResult(e,r,n,o){if(r!==n){let s=n-r;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(r,s),o),this.consumed+=s}}stateNumericHex(e,r){let n=r;for(;r>14;for(;r>14,s!==0){if(c===lg.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==kk.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:r,decodeTree:n}=this,o=(n[r]&hq.VALUE_LENGTH)>>14;return this.emitNamedEntityData(r,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,r,n){let{decodeTree:o}=this;return this.emitCodePoint(r===1?o[e]&~hq.VALUE_LENGTH:o[e+1],n),r===3&&this.emitCodePoint(o[e+2],n),n}end(){var e;switch(this.state){case cg.NamedEntity:return this.result!==0&&(this.decodeMode!==kk.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case cg.NumericDecimal:return this.emitNumericEntity(0,2);case cg.NumericHex:return this.emitNumericEntity(0,3);case cg.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case cg.EntityStart:return 0}}};function cIn(t){let e="",r=new uXe(t,n=>e+=XHt(n));return a(function(o,s){let c=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(c,l),r.startEntity(s);let d=r.write(o,l+1);if(d<0){c=l+r.end();break}c=l+d,l=d===0?c+1:c}let u=e+o.slice(c);return e="",u},"decodeWithTrie")}a(cIn,"getDecoder");function mJo(t,e,r,n){let o=(e&hq.BRANCH_LENGTH)>>7,s=e&hq.JUMP_TABLE;if(o===0)return s!==0&&n===s?r:-1;if(s){let u=n-s;return u<0||u>=o?-1:t[r+u]-1}let c=r,l=c+o-1;for(;c<=l;){let u=c+l>>>1,d=t[u];if(dn)l=u-1;else return t[u+o]}return-1}a(mJo,"determineBranch");var lIn=cIn(sIn),HId=cIn(aIn);function cue(t,e=kk.Legacy){return lIn(t,e)}a(cue,"decodeHTML");function uxe(t){return lIn(t,kk.Strict)}a(uxe,"decodeHTMLStrict");p();p();function dXe(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e);function rGt(t,e){return a(function(n){let o,s=0,c="";for(;o=t.exec(n);)s!==o.index&&(c+=n.substring(s,o.index)),c+=e.get(o[0].charCodeAt(0)),s=o.index+1;return c+n.substring(s)},"escape")}a(rGt,"getEscaper");var uIn=rGt(/[&<>'"]/g,AJo),dIn=rGt(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),fIn=rGt(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var pIn;(function(t){t[t.XML=0]="XML",t[t.HTML=1]="HTML"})(pIn||(pIn={}));var hIn;(function(t){t[t.UTF8=0]="UTF8",t[t.ASCII=1]="ASCII",t[t.Extensive=2]="Extensive",t[t.Attribute=3]="Attribute",t[t.Text=4]="Text"})(hIn||(hIn={}));function vJo(t){return Object.prototype.toString.call(t)}a(vJo,"_class");function fXe(t){return vJo(t)==="[object String]"}a(fXe,"isString");var CJo=Object.prototype.hasOwnProperty;function bJo(t,e){return CJo.call(t,e)}a(bJo,"has");function lue(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(n){t[n]=r[n]})}}),t}a(lue,"assign");function iGt(t,e,r){return[].concat(t.slice(0,e),r,t.slice(e+1))}a(iGt,"arrayReplaceAt");function pXe(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}a(pXe,"isValidEntityCode");function uue(t){if(t>65535){t-=65536;let e=55296+(t>>10),r=56320+(t&1023);return String.fromCharCode(e,r)}return String.fromCharCode(t)}a(uue,"fromCodePoint");var AIn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,SJo=/&([a-z#][a-z0-9]{1,31});/gi,TJo=new RegExp(AIn.source+"|"+SJo.source,"gi"),IJo=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function xJo(t,e){if(e.charCodeAt(0)===35&&IJo.test(e)){let n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return pXe(n)?uue(n):t}let r=cue(t);return r!==t?r:t}a(xJo,"replaceEntityPattern");function wJo(t){return t.indexOf("\\")<0?t:t.replace(AIn,"$1")}a(wJo,"unescapeMd");function w3(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(TJo,function(e,r,n){return r||xJo(e,n)})}a(w3,"unescapeAll");var RJo=/[&<>"]/,PJo=/[&<>"]/g,kJo={"&":"&","<":"<",">":">",'"':"""};function DJo(t){return kJo[t]}a(DJo,"replaceUnsafeChar");function R3(t){return RJo.test(t)?t.replace(PJo,DJo):t}a(R3,"escapeHtml");var NJo=/[.?*+^$[\]\\(){}|-]/g;function MJo(t){return t.replace(NJo,"\\$&")}a(MJo,"escapeRE");function $s(t){switch(t){case 9:case 32:return!0}return!1}a($s,"isSpace");function RK(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}a(RK,"isWhiteSpace");function yIn(t){return aue.test(t)||cXe.test(t)}a(yIn,"isPunctChar");function PK(t){return yIn(uue(t))}a(PK,"isPunctCharCode");function kK(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}a(kK,"isMdAsciiPunct");function DK(t){return t=t.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(t=t.replace(/ẞ/g,"\xDF")),t.toLowerCase().toUpperCase()}a(DK,"normalizeReference");function gIn(t){return t===32||t===9||t===10||t===13}a(gIn,"isAsciiTrimmable");function NK(t){let e=0;for(;e=e&&gIn(t.charCodeAt(r));r--);return t.slice(e,r+1)}a(NK,"asciiTrim");var OJo={mdurl:oXe,ucmicro:JHt};var lGt={};xi(lGt,{parseLinkDestination:()=>aGt,parseLinkLabel:()=>sGt,parseLinkTitle:()=>cGt});p();p();function sGt(t,e,r){let n,o,s,c,l=t.posMax,u=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(c===0)break;c--}o++}return e===o||c!==0||(s.str=w3(t.slice(e,o)),s.pos=o,s.ok=!0),s}a(aGt,"parseLinkDestination");p();function cGt(t,e,r,n){let o,s=e,c={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)c.str=n.str,c.marker=n.marker;else{if(s>=r)return c;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return c;e++,s++,l===40&&(l=41),c.marker=l}for(;s"+R3(s.content)+""};hO.code_block=function(t,e,r,n,o){let s=t[e];return""+R3(t[e].content)+` +`};hO.fence=function(t,e,r,n,o){let s=t[e],c=s.info?w3(s.info).trim():"",l="",u="";if(c){let f=c.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(r.highlight?d=r.highlight(s.content,l,u)||R3(s.content):d=R3(s.content),d.indexOf("${d} `}return`
${d}
-`};_O.image=function(t,e,r,n,o){let s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,r,n),o.renderToken(t,e,r)};_O.hardbreak=function(t,e,r){return r.xhtmlOut?`
+`};hO.image=function(t,e,r,n,o){let s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,r,n),o.renderToken(t,e,r)};hO.hardbreak=function(t,e,r){return r.xhtmlOut?`
`:`
-`};_O.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
+`};hO.softbreak=function(t,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` -`};_O.text=function(t,e){return O3(t[e].content)};_O.html_block=function(t,e){return t[e].content};_O.html_inline=function(t,e){return t[e].content};function hue(){this.rules=fue({},_O)}a(hue,"Renderer");hue.prototype.renderAttrs=a(function(e){let r,n,o;if(!e.attrs)return"";for(o="",r=0,n=e.attrs.length;r -`:">",s},"renderToken");hue.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");mue.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var B3=mue;function cIn(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(cIn,"StateCore");cIn.prototype.Token=B3;var lIn=cIn;p();var PZo=/\r\n?|\n/g,DZo=/\0/g;function XHt(t){let e;e=t.src.replace(PZo,` -`),e=e.replace(DZo,"\uFFFD"),t.src=e}a(XHt,"normalize");p();function eGt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(eGt,"block");p();function tGt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(NZo,"isLinkOpen");function MZo(t){return/^<\/a\s*>/i.test(t)}a(MZo,"isLinkClose");function rGt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&(NZo(l.content)&&s>0&&s--,MZo(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,_),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(BZo,FZo)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(UZo,"replace_scoped");function QZo(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&uIn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(QZo,"replace_rare");function nGt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(OZo.test(t.tokens[e].content)&&UZo(t.tokens[e].children),uIn.test(t.tokens[e].content)&&QZo(t.tokens[e].children))}a(nGt,"replace");p();var qZo=/['"]/,dIn=/['"]/g,fIn="\u2019";function EXe(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(EXe,"addReplacement");function jZo(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&EXe(o,s,h.index,fIn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!qZo.test(t.tokens[e].content)||HZo(t.tokens[e].children,t)}a(iGt,"smartquotes");p();function oGt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};CO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");CO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!zs(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");CO.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");CO.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");CO.prototype.Token=B3;var hIn=CO;p();var GZo=65536;function cGt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(cGt,"getLine");function mIn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!zs(l)||c===45&&zs(l))return!1;for(;s=4)return!1;d=mIn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=mIn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>GZo))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` -`,s.map=[e,t.line],!0}a(uGt,"code");p();function dGt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!b){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let k=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=k-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let _=[e,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=AIn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=gIn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let k=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,L=t.tShift[u],B=t.sCount[u],Q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=k,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=Q,t.tShift[u]=L,t.sCount[u]=B,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let O=0,q=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),k=t.parentType;t.parentType="reference";let D=!1;for(let N=0,L=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(mGt,"reference");p();p();var yIn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var VZo="[a-zA-Z_:][a-zA-Z0-9:._-]*",WZo="[^\"'=<>`\\x00-\\x20]+",zZo="'[^']*'",YZo='"[^"]*"',KZo="(?:"+WZo+"|"+zZo+"|"+YZo+")",JZo="(?:\\s+"+VZo+"(?:\\s*=\\s*"+KZo+")?)",EIn="<[A-Za-z][A-Za-z0-9\\-]*"+JZo+"*\\s*\\/?>",_In="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ZZo="",XZo="<[?][\\s\\S]*?[?]>",eXo="]*>",tXo="",CIn=new RegExp("^(?:"+EIn+"|"+_In+"|"+ZZo+"|"+XZo+"|"+eXo+"|"+tXo+")"),vIn=new RegExp("^(?:"+EIn+"|"+_In+")");var jK=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(vIn.source+"\\s*$"),/^$/,!1]];function gGt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&zs(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=QK(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(AGt,"heading");p();function yGt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};Sxe.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(nXo);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(CGt,"linkify");p();function vGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){bGt[t.charCodeAt(0)]=1});function SGt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&bGt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(SGt,"escape");p();function TGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(IIn,"postProcess");function aXo(t){let e=t.tokens_meta,r=t.tokens_meta.length;IIn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[UK(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),E=[["href",c]];y.attrs=E,l&&E.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(wGt,"link");p();function RGt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[UK(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(RGt,"image");p();var cXo=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,lXo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(lXo.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(cXo.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(kGt,"autolink");p();function uXo(t){return/^\s]/i.test(t)}a(uXo,"isLinkOpen");function dXo(t){return/^<\/a\s*>/i.test(t)}a(dXo,"isLinkClose");function fXo(t){let e=t|32;return e>=97&&e<=122}a(fXo,"isLetter");function PGt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!fXo(o))return!1;let s=t.src.slice(n).match(CIn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],uXo(c.content)&&t.linkLevel++,dXo(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(PGt,"html_inline");p();var pXo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,hXo=/^&([a-z][a-z0-9]{1,31});/i;function DGt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match(pXo);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=yXe(c)?pue(c):pue(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(hXo);if(s){let c=bxe(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a(DGt,"entity");p();function xIn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(xIn,"processDelimiters");function NGt(t){let e=t.tokens_meta,r=t.tokens_meta.length;xIn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};Txe.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Txe.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))",e.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}a(LGt,"default");function FGt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(FGt,"assign");function bXe(t){return Object.prototype.toString.call(t)}a(bXe,"_class");function mXo(t){return bXe(t)==="[object String]"}a(mXo,"isString");function gXo(t){return bXe(t)==="[object Object]"}a(gXo,"isObject");function AXo(t){return bXe(t)==="[object RegExp]"}a(AXo,"isRegExp");function RIn(t){return bXe(t)==="[object Function]"}a(RIn,"isFunction");function yXo(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(yXo,"escapeRE");var PIn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function EXo(t){return Object.keys(t||{}).reduce(function(e,r){return e||PIn.hasOwnProperty(r)},!1)}a(EXo,"isOptionsObj");var _Xo={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},CXo="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",vXo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function bXo(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(bXo,"createValidator");function kIn(){return function(t,e){e.normalize(t)}}a(kIn,"createNormalizer");function vXe(t){let e=t.re=LGt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(CXo),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+u)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,gXo(u)){AXo(u.validate)?d.validate=bXo(u.validate):RIn(u.validate)?d.validate=u.validate:s(l,u),RIn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=kIn();return}if(mXo(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:kIn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(yXo).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i")}a(vXe,"compile");function DIn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(DIn,"Match");function jS(t,e){if(!(this instanceof jS))return new jS(t,e);e||EXo(t)&&(e=t,t={}),this.__opts__=FGt({},PIn,e),this.__schemas__=FGt({},_Xo,t),this.__compiled__={},this.__tlds__=vXo,this.__tlds_replaced__=!1,this.re={},vXe(this)}a(jS,"LinkifyIt");jS.prototype.add=a(function(e,r){return this.__schemas__[e]=r,vXe(this),this},"add");jS.prototype.set=a(function(e){return this.__opts__=FGt(this.__opts__,e),this},"set");jS.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");jS.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");jS.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");jS.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},UGt=35,vO=Math.floor,QGt=String.fromCharCode;function Cq(t){throw new RangeError(xXo[t])}a(Cq,"error");function wXo(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(wXo,"map");function OIn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(IXo,".");let o=t.split("."),s=wXo(o,e).join(".");return n+s}a(OIn,"mapDomain");function BIn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),kXo=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),MIn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),LIn=a(function(t,e,r){let n=0;for(t=r?vO(t/700):t>>1,t+=vO(t/e);t>UGt*26>>1;n+=36)t=vO(t/UGt);return vO(n+(UGt+1)*t/(t+38))},"adapt"),FIn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&Cq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&Cq("invalid-input");let m=kXo(t.charCodeAt(l++));m>=36&&Cq("invalid-input"),m>vO((2147483647-n)/f)&&Cq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mvO(2147483647/A)&&Cq("overflow"),f*=A}let d=e.length+1;s=LIn(n-u,d,u==0),vO(n/d)>2147483647-o&&Cq("overflow"),o+=vO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),UIn=a(function(t){let e=[];t=BIn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(QGt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fvO((2147483647-o)/d)&&Cq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&Cq("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=qGt.toASCII(e.hostname)}catch{}return cXe(lue(e))}a(FXo,"normalizeLink");function UXo(t){let e=vxe(t,!0);if(e.hostname&&(!e.protocol||HIn.indexOf(e.protocol)>=0))try{e.hostname=qGt.toUnicode(e.hostname)}catch{}return Cxe(lue(e),Cxe.defaultChars+"%")}a(UXo,"normalizeLinkText");function Yx(t,e){if(!(this instanceof Yx))return new Yx(t,e);e||AXe(t)||(e=t||{},t="default"),this.inline=new wIn,this.block=new bIn,this.core=new pIn,this.renderer=new aIn,this.linkify=new NIn,this.validateLink=LXo,this.normalizeLink=FXo,this.normalizeLinkText=UXo,this.utils=zHt,this.helpers=fue({},ZHt),this.options={},this.configure(t),e&&this.set(e)}a(Yx,"MarkdownIt");Yx.prototype.set=function(t){return fue(this.options,t),this};Yx.prototype.configure=function(t){let e=this;if(AXe(t)){let r=t;if(t=MXo[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};Yx.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};Yx.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};Yx.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Yx.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};Yx.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Yx.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};Yx.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var jGt=Yx;function HGt(t){return Array.isArray(t)}a(HGt,"isArray");function QXo(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||HGt(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a(QXo,"isFenceToken");function*GIn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;HGt(r.children)&&(yield*GIn(r.children))}}a(GIn,"flattenTokensLists");function qXo(){return new jGt}a(qXo,"createMarkdownIt");function $In(t){let e=[],n=qXo().parse(t,{});if(!HGt(n))return e;for(let o of GIn(n)){if(!o||typeof o!="object")continue;let s=o;if(QXo(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a($In,"extractCodeBlocks");function GGt(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(GGt,"escapeProblematicHtmlTags");var VGt=Tn.Gpt4oMini,VIn=new ge("virtualToolSummarizer"),Ixe=class extends Error{static{a(this,"SummarizerError")}};function WIn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(WIn,"isValidCategoryItem");function zIn(t,e){if(!Array.isArray(t))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(WIn))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(zIn,"validateCategoriesWithoutToolsResponse");function jXo(t){return WIn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(jXo,"isValidCategorizationItem");function YIn(t,e){if(zIn(t,e),!t.every(jXo))throw new Ixe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(YIn,"validateCategorizationResponse");function KIn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(KIn,"deduplicateTools");function HXo(t){let e=new Map;for(let r of t){let n=ZIn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} +`:">",s},"renderToken");due.prototype.renderInline=function(t,e,r){let n="",o=this.rules;for(let s=0,c=t.length;s=0&&(n=this.attrs[r][1]),n},"attrGet");fue.prototype.attrJoin=a(function(e,r){let n=this.attrIndex(e);n<0?this.attrPush([e,r]):this.attrs[n][1]=this.attrs[n][1]+" "+r},"attrJoin");var P3=fue;function _In(t,e,r){this.src=t,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}a(_In,"StateCore");_In.prototype.Token=P3;var vIn=_In;p();var BJo=/\r\n?|\n/g,LJo=/\0/g;function uGt(t){let e;e=t.src.replace(BJo,` +`),e=e.replace(LJo,"\uFFFD"),t.src=e}a(uGt,"normalize");p();function dGt(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}a(dGt,"block");p();function fGt(t){let e=t.tokens;for(let r=0,n=e.length;r\s]/i.test(t)}a(FJo,"isLinkOpen");function UJo(t){return/^<\/a\s*>/i.test(t)}a(UJo,"isLinkClose");function pGt(t){let e=t.tokens;if(t.md.options.linkify)for(let r=0,n=e.length;r=0;c--){let l=o[c];if(l.type==="link_close"){for(c--;o[c].level!==l.level&&o[c].type!=="link_open";)c--;continue}if(l.type==="html_inline"&&(FJo(l.content)&&s>0&&s--,UJo(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){let u=l.content,d=t.md.linkify.match(u),f=[],h=l.level,m=0;d.length>0&&d[0].index===0&&c>0&&o[c-1].type==="text_special"&&(d=d.slice(1));for(let g=0;gm){let w=new t.Token("text","",0);w.content=u.slice(m,_),w.level=h,f.push(w)}let v=new t.Token("link_open","a",1);v.attrs=[["href",y]],v.level=h++,v.markup="linkify",v.info="auto",f.push(v);let b=new t.Token("text","",0);b.content=E,b.level=h,f.push(b);let T=new t.Token("link_close","a",-1);T.level=--h,T.markup="linkify",T.info="auto",f.push(T),m=d[g].lastIndex}if(m=0;r--){let n=t[r];n.type==="text"&&!e&&(n.content=n.content.replace(qJo,HJo)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a(GJo,"replace_scoped");function $Jo(t){let e=0;for(let r=t.length-1;r>=0;r--){let n=t[r];n.type==="text"&&!e&&CIn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}a($Jo,"replace_rare");function hGt(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(QJo.test(t.tokens[e].content)&&GJo(t.tokens[e].children),CIn.test(t.tokens[e].content)&&$Jo(t.tokens[e].children))}a(hGt,"replace");p();var VJo=/['"]/,bIn=/['"]/g,SIn="\u2019";function hXe(t,e,r,n){t[e]||(t[e]=[]),t[e].push({pos:r,ch:n})}a(hXe,"addReplacement");function WJo(t,e){let r="",n=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o=0&&!(n[r].level<=l);r--);if(n.length=r+1,c.type!=="text")continue;let u=c.content,d=0,f=u.length;e:for(;d=0)y=u.charCodeAt(h.index-1);else for(r=s-1;r>=0&&!(t[r].type==="softbreak"||t[r].type==="hardbreak");r--)if(t[r].content){y=t[r].content.charCodeAt(t[r].content.length-1);break}let E=32;if(d=48&&y<=57&&(g=m=!1),m&&g&&(m=_,g=v),!m&&!g){A&&hXe(o,s,h.index,SIn);continue}if(g)for(r=n.length-1;r>=0;r--){let w=n[r];if(n[r].level=0;e--)t.tokens[e].type!=="inline"||!VJo.test(t.tokens[e].content)||zJo(t.tokens[e].children,t)}a(mGt,"smartquotes");p();function gGt(t){let e,r,n=t.tokens,o=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};mO.prototype.isEmpty=a(function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},"isEmpty");mO.prototype.skipEmptyLines=a(function(e){for(let r=this.lineMax;er;)if(!$s(this.src.charCodeAt(--e)))return e+1;return e},"skipSpacesBack");mO.prototype.skipChars=a(function(e,r){for(let n=this.src.length;en;)if(r!==this.src.charCodeAt(--e))return e+1;return e},"skipCharsBack");mO.prototype.getLines=a(function(e,r,n,o){if(e>=r)return"";let s=new Array(r-e);for(let c=0,l=e;ln?s[c]=new Array(u-n+1).join(" ")+this.src.slice(f,h):s[c]=this.src.slice(f,h)}return s.join("")},"getLines");mO.prototype.Token=P3;var IIn=mO;p();var YJo=65536;function EGt(t,e){let r=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(r,n)}a(EGt,"getLine");function xIn(t){let e=[],r=t.length,n=0,o=t.charCodeAt(n),s=!1,c=0,l="";for(;nr)return!1;let o=e+1;if(t.sCount[o]=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;let c=t.src.charCodeAt(s++);if(c!==124&&c!==45&&c!==58||s>=t.eMarks[o])return!1;let l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!$s(l)||c===45&&$s(l))return!1;for(;s=4)return!1;d=xIn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();let h=d.length;if(h===0||h!==f.length)return!1;if(n)return!0;let m=t.parentType;t.parentType="table";let g=t.md.block.ruler.getRules("blockquote"),A=t.push("table_open","table",1),y=[e,0];A.map=y;let E=t.push("thead_open","thead",1);E.map=[e,e+1];let _=t.push("tr_open","tr",1);_.map=[e,e+1];for(let T=0;T=4||(d=xIn(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),b+=h-d.length,b>YJo))break;if(o===e+2){let R=t.push("tbody_open","tbody",1);R.map=v=[e+2,0]}let w=t.push("tr_open","tr",1);w.map=[o,o+1];for(let R=0;R=4){n++,o=n;continue}break}t.line=o;let s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+` +`,s.map=[e,t.line],!0}a(vGt,"code");p();function CGt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;let c=t.src.charCodeAt(o);if(c!==126&&c!==96)return!1;let l=o;o=t.skipChars(o,c);let u=o-l;if(u<3)return!1;let d=t.src.slice(l,o),f=t.src.slice(o,s);if(c===96&&f.indexOf(String.fromCharCode(c))>=0)return!1;if(n)return!0;let h=e,m=!1;for(;h++,!(h>=r||(o=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],o=4)&&(o=t.skipChars(o,c),!(o-l=4||t.src.charCodeAt(o)!==62)return!1;if(n)return!0;let l=[],u=[],d=[],f=[],h=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let g=!1,A;for(A=e;A=s)break;if(t.src.charCodeAt(o++)===62&&!b){let w=t.sCount[A]+1,R,x;t.src.charCodeAt(o)===32?(o++,w++,x=!1,R=!0):t.src.charCodeAt(o)===9?(R=!0,(t.bsCount[A]+w)%4===3?(o++,w++,x=!1):x=!0):R=!1;let P=w;for(l.push(t.bMarks[A]),t.bMarks[A]=o;o=s,u.push(t.bsCount[A]),t.bsCount[A]=t.sCount[A]+1+(R?1:0),d.push(t.sCount[A]),t.sCount[A]=P-w,f.push(t.tShift[A]),t.tShift[A]=o-t.bMarks[A];continue}if(g)break;let T=!1;for(let w=0,R=h.length;w";let _=[e,0];E.map=_,t.md.block.tokenize(t,e,A);let v=t.push("blockquote_close","blockquote",-1);v.markup=">",t.lineMax=c,t.parentType=m,_[1]=t.line;for(let b=0;b=4)return!1;let s=t.bMarks[e]+t.tShift[e],c=t.src.charCodeAt(s++);if(c!==42&&c!==45&&c!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=n)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-r>=10)return-1;continue}if(s===41||s===46)break;return-1}return o=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]=t.blkIndent&&(f=!0);let h,m,g;if((g=RIn(t,u))>=0){if(h=!0,c=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(c,g-1)),f&&m!==1)return!1}else if((g=wIn(t,u))>=0)h=!1;else return!1;if(f&&t.skipSpaces(g)>=t.eMarks[u])return!1;if(n)return!0;let A=t.src.charCodeAt(g-1),y=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);let E=[u,0];l.map=E,l.markup=String.fromCharCode(A);let _=!1,v=t.md.block.ruler.getRules("list"),b=t.parentType;for(t.parentType="list";u=o?x=1:x=w-T,x>4&&(x=1);let P=T+x;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(A);let D=[u,0];l.map=D,h&&(l.info=t.src.slice(c,g-1));let N=t.tight,B=t.tShift[u],L=t.sCount[u],j=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=R-t.bMarks[u],t.sCount[u]=w,R>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,u,r,!0),(!t.tight||_)&&(d=!1),_=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=j,t.tShift[u]=B,t.sCount[u]=L,t.tight=N,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(A),u=t.line,D[1]=u,u>=r||t.sCount[u]=4)break;let M=!1;for(let O=0,q=v.length;O=4||t.src.charCodeAt(o)!==91)return!1;function l(v){let b=t.lineMax;if(v>=b||t.isEmpty(v))return null;let T=!1;if(t.sCount[v]-t.blkIndent>3&&(T=!0),t.sCount[v]<0&&(T=!0),!T){let x=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let D=!1;for(let N=0,B=x.length;N"u"&&(t.env.references={}),typeof t.env.references[_]>"u"&&(t.env.references[_]={title:E,href:h}),t.line=c),!0):!1}a(IGt,"reference");p();p();var PIn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];p();var JJo="[a-zA-Z_:][a-zA-Z0-9:._-]*",ZJo="[^\"'=<>`\\x00-\\x20]+",XJo="'[^']*'",eZo='"[^"]*"',tZo="(?:"+ZJo+"|"+XJo+"|"+eZo+")",rZo="(?:\\s+"+JJo+"(?:\\s*=\\s*"+tZo+")?)",kIn="<[A-Za-z][A-Za-z0-9\\-]*"+rZo+"*\\s*\\/?>",DIn="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",nZo="",iZo="<[?][\\s\\S]*?[?]>",oZo="]*>",sZo="",NIn=new RegExp("^(?:"+kIn+"|"+DIn+"|"+nZo+"|"+iZo+"|"+oZo+"|"+sZo+")"),MIn=new RegExp("^(?:"+kIn+"|"+DIn+")");var OK=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(MIn.source+"\\s*$"),/^$/,!1]];function xGt(t,e,r,n){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let c=t.src.slice(o,s),l=0;for(;l=4)return!1;let c=t.src.charCodeAt(o);if(c!==35||o>=s)return!1;let l=1;for(c=t.src.charCodeAt(++o);c===35&&o6||oo&&$s(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;let d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];let f=t.push("inline","",0);f.content=NK(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];let h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}a(wGt,"heading");p();function RGt(t,e,r){let n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;let o=t.parentType;t.parentType="paragraph";let s=0,c,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let g=t.bMarks[l]+t.tShift[l],A=t.eMarks[l];if(g=A))){s=c===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let g=0,A=n.length;g3||t.sCount[s]<0)continue;let d=!1;for(let f=0,h=n.length;f=r||t.sCount[c]=s){t.line=r;break}let u=t.line,d=!1;for(let f=0;f=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),c=t.line,c0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(o),n};dxe.prototype.scanDelims=function(t,e){let r=this.posMax,n=this.src.charCodeAt(t),o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){let E=this.src.charCodeAt(t-2);o=(E&64512)===55296?65536+(E-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s0)return!1;let r=t.pos,n=t.posMax;if(r+3>n||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47)return!1;let o=t.pending.match(cZo);if(!o)return!1;let s=o[1],c=t.md.linkify.matchAtStart(t.src.slice(r-s.length));if(!c)return!1;let l=c.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);let f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";let h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);let m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}a(DGt,"linkify");p();function NGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==10)return!1;let n=t.pending.length-1,o=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(r++;r?@[]^_`{|}~-".split("").forEach(function(t){MGt[t.charCodeAt(0)]=1});function OGt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==92||(r++,r>=n))return!1;let o=t.src.charCodeAt(r);if(o===10){for(e||t.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s+=t.src[r+1],r++)}let c="\\"+s;if(!e){let l=t.push("text_special","",0);o<256&&MGt[o]!==0?l.content=s:l.content=c,l.markup=c,l.info="escape"}return t.pos=r+1,!0}a(OGt,"escape");p();function BGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==96)return!1;let o=r;r++;let s=t.posMax;for(;r=0;n--){let o=e[n];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;let s=e[o.end],c=n>0&&e[n-1].end===o.end+1&&e[n-1].marker===o.marker&&e[n-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=c?"strong_open":"em_open",u.tag=c?"strong":"em",u.nesting=1,u.markup=c?l+l:l,u.content="";let d=t.tokens[s.token];d.type=c?"strong_close":"em_close",d.tag=c?"strong":"em",d.nesting=-1,d.markup=c?l+l:l,d.content="",c&&(t.tokens[e[n-1].token].content="",t.tokens[e[o.end+1].token].content="",n--)}}a(FIn,"postProcess");function fZo(t){let e=t.tokens_meta,r=t.tokens_meta.length;FIn(t,t.delimiters);for(let n=0;n=h)return!1;if(u=A,o=t.md.helpers.parseLinkDestination(t.src,A,t.posMax),o.ok){for(c=t.md.normalizeLink(o.str),t.md.validateLink(c)?A=o.pos:c="",u=A;A=h||t.src.charCodeAt(A)!==41)&&(d=!0),A++}if(d){if(typeof t.env.references>"u")return!1;if(A=0?n=t.src.slice(u,A++):A=g+1):A=g+1,n||(n=t.src.slice(m,g)),s=t.env.references[DK(n)],!s)return t.pos=f,!1;c=s.href,l=s.title}if(!e){t.pos=m,t.posMax=g;let y=t.push("link_open","a",1),E=[["href",c]];y.attrs=E,l&&E.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=A,t.posMax=h,!0}a(UGt,"link");p();function QGt(t,e){let r,n,o,s,c,l,u,d,f="",h=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;let g=t.pos+2,A=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(A<0)return!1;if(s=A+1,s=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s=m||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?o=t.src.slice(d,s++):s=A+1):s=A+1,o||(o=t.src.slice(g,A)),c=t.env.references[DK(o)],!c)return t.pos=h,!1;f=c.href,u=c.title}if(!e){n=t.src.slice(g,A);let y=[];t.md.inline.parse(n,t.md,t.env,y);let E=t.push("image","img",0),_=[["src",f],["alt",""]];E.attrs=_,E.children=y,E.content=n,u&&_.push(["title",u])}return t.pos=s,t.posMax=m,!0}a(QGt,"image");p();var pZo=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,hZo=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function qGt(t,e){let r=t.pos;if(t.src.charCodeAt(r)!==60)return!1;let n=t.pos,o=t.posMax;for(;;){if(++r>=o)return!1;let c=t.src.charCodeAt(r);if(c===60)return!1;if(c===62)break}let s=t.src.slice(n+1,r);if(hZo.test(s)){let c=t.md.normalizeLink(s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(pZo.test(s)){let c=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(c))return!1;if(!e){let l=t.push("link_open","a",1);l.attrs=[["href",c]],l.markup="autolink",l.info="auto";let u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);let d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}a(qGt,"autolink");p();function mZo(t){return/^\s]/i.test(t)}a(mZo,"isLinkOpen");function gZo(t){return/^<\/a\s*>/i.test(t)}a(gZo,"isLinkClose");function AZo(t){let e=t|32;return e>=97&&e<=122}a(AZo,"isLetter");function jGt(t,e){if(!t.md.options.html)return!1;let r=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=r)return!1;let o=t.src.charCodeAt(n+1);if(o!==33&&o!==63&&o!==47&&!AZo(o))return!1;let s=t.src.slice(n).match(NIn);if(!s)return!1;if(!e){let c=t.push("html_inline","",0);c.content=s[0],mZo(c.content)&&t.linkLevel++,gZo(c.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}a(jGt,"html_inline");p();var yZo=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,EZo=/^&([a-z][a-z0-9]{1,31});/i;function HGt(t,e){let r=t.pos,n=t.posMax;if(t.src.charCodeAt(r)!==38||r+1>=n)return!1;if(t.src.charCodeAt(r+1)===35){let s=t.src.slice(r).match(yZo);if(s){if(!e){let c=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=pXe(c)?uue(c):uue(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{let s=t.src.slice(r).match(EZo);if(s){let c=uxe(s[0]);if(c!==s[0]){if(!e){let l=t.push("text_special","",0);l.content=c,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}a(HGt,"entity");p();function UIn(t){let e={},r=t.length;if(!r)return;let n=0,o=-2,s=[];for(let c=0;cu;d-=s[d]+1){let h=t[d];if(h.marker===l.marker&&h.open&&h.end<0){let m=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(m=!0),!m){let g=d>0&&!t[d-1].open?s[d-1]+1:0;s[c]=c-d+g,s[d]=g,l.open=!1,h.end=c,h.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}a(UIn,"processDelimiters");function GGt(t){let e=t.tokens_meta,r=t.tokens_meta.length;UIn(t.delimiters);for(let n=0;n0&&n++,o[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;c||t.pos++,s[e]=t.pos};fxe.prototype.tokenize=function(t){let e=this.ruler.getRules(""),r=e.length,n=t.posMax,o=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(c){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};fxe.prototype.parse=function(t,e,r,n){let o=new this.State(t,e,r,n);this.tokenize(o);let s=this.ruler2.getRules(""),c=s.length;for(let l=0;l|$))",e.tpl_email_fuzzy="(^|"+r+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+e.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}a(zGt,"default");function YGt(t){return Array.prototype.slice.call(arguments,1).forEach(function(r){r&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t}a(YGt,"assign");function yXe(t){return Object.prototype.toString.call(t)}a(yXe,"_class");function _Zo(t){return yXe(t)==="[object String]"}a(_Zo,"isString");function vZo(t){return yXe(t)==="[object Object]"}a(vZo,"isObject");function CZo(t){return yXe(t)==="[object RegExp]"}a(CZo,"isRegExp");function qIn(t){return yXe(t)==="[object Function]"}a(qIn,"isFunction");function bZo(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}a(bZo,"escapeRE");var HIn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function SZo(t){return Object.keys(t||{}).reduce(function(e,r){return e||HIn.hasOwnProperty(r)},!1)}a(SZo,"isOptionsObj");var TZo={"http:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.http||(r.re.http=new RegExp("^\\/\\/"+r.re.src_auth+r.re.src_host_port_strict+r.re.src_path,"i")),r.re.http.test(n)?n.match(r.re.http)[0].length:0},"validate")},"https:":"http:","ftp:":"http:","//":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.no_http||(r.re.no_http=new RegExp("^"+r.re.src_auth+"(?:localhost|(?:(?:"+r.re.src_domain+")\\.)+"+r.re.src_domain_root+")"+r.re.src_port+r.re.src_host_terminator+r.re.src_path,"i")),r.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(r.re.no_http)[0].length:0},"validate")},"mailto:":{validate:a(function(t,e,r){let n=t.slice(e);return r.re.mailto||(r.re.mailto=new RegExp("^"+r.re.src_email_name+"@"+r.re.src_host_strict,"i")),r.re.mailto.test(n)?n.match(r.re.mailto)[0].length:0},"validate")}},IZo="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",xZo="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function wZo(t){return function(e,r){let n=e.slice(r);return t.test(n)?n.match(t)[0].length:0}}a(wZo,"createValidator");function jIn(){return function(t,e){e.normalize(t)}}a(jIn,"createNormalizer");function AXe(t){let e=t.re=zGt(t.__opts__),r=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||r.push(IZo),r.push(e.src_xn),e.src_tlds=r.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}a(n,"untpl"),e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");let o=[];t.__compiled__={};function s(l,u){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+u)}a(s,"schemaError"),Object.keys(t.__schemas__).forEach(function(l){let u=t.__schemas__[l];if(u===null)return;let d={validate:null,link:null};if(t.__compiled__[l]=d,vZo(u)){CZo(u.validate)?d.validate=wZo(u.validate):qIn(u.validate)?d.validate=u.validate:s(l,u),qIn(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=jIn();return}if(_Zo(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:jIn()};let c=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(bZo).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+e.src_ZPCc+"))("+c+")","ig"),t.re.schema_at_start=RegExp("^"+t.re.schema_search.source,"i"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i")}a(AXe,"compile");function GIn(t,e,r,n){let o=t.slice(r,n);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=n,this.raw=o,this.text=o,this.url=o}a(GIn,"Match");function BS(t,e){if(!(this instanceof BS))return new BS(t,e);e||SZo(t)&&(e=t,t={}),this.__opts__=YGt({},HIn,e),this.__schemas__=YGt({},TZo,t),this.__compiled__={},this.__tlds__=xZo,this.__tlds_replaced__=!1,this.re={},AXe(this)}a(BS,"LinkifyIt");BS.prototype.add=a(function(e,r){return this.__schemas__[e]=r,AXe(this),this},"add");BS.prototype.set=a(function(e){return this.__opts__=YGt(this.__opts__,e),this},"set");BS.prototype.test=a(function(e){if(!e.length)return!1;let r,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(r=n.exec(e))!==null;)if(this.testSchemaAt(e,r[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)},"test");BS.prototype.pretest=a(function(e){return this.re.pretest.test(e)},"pretest");BS.prototype.testSchemaAt=a(function(e,r,n){return this.__compiled__[r.toLowerCase()]?this.__compiled__[r.toLowerCase()].validate(e,n,this):0},"testSchemaAt");BS.prototype.match=a(function(e){let r=[],n=[],o=[],s=[],c,l,u;function d(m,g){return m?g?m.index!==g.index?m.index=g.lastIndex?m:g:m:g}if(a(d,"choose"),!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(c=u.exec(e))!==null;)l=this.testSchemaAt(e,c[2],u.lastIndex),l&&n.push({schema:c[2],index:c.index+c[1].length,lastIndex:c.index+c[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)o.push({schema:"",index:c.index+c[1].length,lastIndex:c.index+c[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(c=u.exec(e))!==null;)s.push({schema:"mailto:",index:c.index+c[1].length,lastIndex:c.index+c[0].length});let f=[0,0,0],h=0;for(;;){let m=[n[f[0]],s[f[1]],o[f[2]]],g=d(d(m[0],m[1]),m[2]);if(!g)break;if(g===m[0]?f[0]++:g===m[1]?f[1]++:f[2]++,g.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},KGt=35,gO=Math.floor,JGt=String.fromCharCode;function mq(t){throw new RangeError(DZo[t])}a(mq,"error");function NZo(t,e){let r=[],n=t.length;for(;n--;)r[n]=e(t[n]);return r}a(NZo,"map");function WIn(t,e){let r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(kZo,".");let o=t.split("."),s=NZo(o,e).join(".");return n+s}a(WIn,"mapDomain");function zIn(t){let e=[],r=0,n=t.length;for(;r=55296&&o<=56319&&rString.fromCodePoint(...t),"ucs2encode"),OZo=a(function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:36},"basicToDigit"),VIn=a(function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},"digitToBasic"),YIn=a(function(t,e,r){let n=0;for(t=r?gO(t/700):t>>1,t+=gO(t/e);t>KGt*26>>1;n+=36)t=gO(t/KGt);return gO(n+(KGt+1)*t/(t+38))},"adapt"),KIn=a(function(t){let e=[],r=t.length,n=0,o=128,s=72,c=t.lastIndexOf("-");c<0&&(c=0);for(let l=0;l=128&&mq("not-basic"),e.push(t.charCodeAt(l));for(let l=c>0?c+1:0;l=r&&mq("invalid-input");let m=OZo(t.charCodeAt(l++));m>=36&&mq("invalid-input"),m>gO((2147483647-n)/f)&&mq("overflow"),n+=m*f;let g=h<=s?1:h>=s+26?26:h-s;if(mgO(2147483647/A)&&mq("overflow"),f*=A}let d=e.length+1;s=YIn(n-u,d,u==0),gO(n/d)>2147483647-o&&mq("overflow"),o+=gO(n/d),n%=d,e.splice(n++,0,o)}return String.fromCodePoint(...e)},"decode"),JIn=a(function(t){let e=[];t=zIn(t);let r=t.length,n=128,o=0,s=72;for(let u of t)u<128&&e.push(JGt(u));let c=e.length,l=c;for(c&&e.push("-");l=n&&fgO((2147483647-o)/d)&&mq("overflow"),o+=(u-n)*d,n=u;for(let f of t)if(f2147483647&&mq("overflow"),f===n){let h=o;for(let m=36;;m+=36){let g=m<=s?1:m>=s+26?26:m-s;if(h=0))try{e.hostname=ZGt.toASCII(e.hostname)}catch{}return nXe(sue(e))}a(HZo,"normalizeLink");function GZo(t){let e=lxe(t,!0);if(e.hostname&&(!e.protocol||txn.indexOf(e.protocol)>=0))try{e.hostname=ZGt.toUnicode(e.hostname)}catch{}return cxe(sue(e),cxe.defaultChars+"%")}a(GZo,"normalizeLinkText");function zx(t,e){if(!(this instanceof zx))return new zx(t,e);e||fXe(t)||(e=t||{},t="default"),this.inline=new QIn,this.block=new OIn,this.core=new TIn,this.renderer=new EIn,this.linkify=new $In,this.validateLink=jZo,this.normalizeLink=HZo,this.normalizeLinkText=GZo,this.utils=oGt,this.helpers=lue({},lGt),this.options={},this.configure(t),e&&this.set(e)}a(zx,"MarkdownIt");zx.prototype.set=function(t){return lue(this.options,t),this};zx.prototype.configure=function(t){let e=this;if(fXe(t)){let r=t;if(t=UZo[r],!t)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(r){t.components[r].rules&&e[r].ruler.enableOnly(t.components[r].rules),t.components[r].rules2&&e[r].ruler2.enableOnly(t.components[r].rules2)}),this};zx.prototype.enable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(t,!0))},this),r=r.concat(this.inline.ruler2.enable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};zx.prototype.disable=function(t,e){let r=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(t,!0))},this),r=r.concat(this.inline.ruler2.disable(t,!0));let n=t.filter(function(o){return r.indexOf(o)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};zx.prototype.use=function(t){let e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};zx.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");let r=new this.core.State(t,this,e);return this.core.process(r),r.tokens};zx.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};zx.prototype.parseInline=function(t,e){let r=new this.core.State(t,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};zx.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};var XGt=zx;function e$t(t){return Array.isArray(t)}a(e$t,"isArray");function $Zo(t){if(t.type!=="fence")return!1;let{map:e,markup:r,content:n,info:o}=t;return(e===null||e$t(e)&&e.length===2&&e.every(c=>typeof c=="number"))&&typeof r=="string"&&typeof n=="string"&&typeof o=="string"}a($Zo,"isFenceToken");function*rxn(t){for(let e of t)if(yield e,e&&typeof e=="object"&&"children"in e){let r=e;e$t(r.children)&&(yield*rxn(r.children))}}a(rxn,"flattenTokensLists");function VZo(){return new XGt}a(VZo,"createMarkdownIt");function nxn(t){let e=[],n=VZo().parse(t,{});if(!e$t(n))return e;for(let o of rxn(n)){if(!o||typeof o!="object")continue;let s=o;if($Zo(s)&&s.map){let c=s.map;e.push({startMarkup:s.markup,code:s.content.replace(/\n$/,""),language:s.info.trim(),startLine:c[0],endLine:c[1]})}}return e}a(nxn,"extractCodeBlocks");function t$t(t){let e=["script","style","iframe","object","embed","form","base","meta","link"],r=/(```[\s\S]*?```|`[^`\n]+?`)/g;return t.split(r).map((o,s)=>{if(s%2===1)return o;let l=new RegExp(`]*)?/?>`,"gi");return o.replace(l,u=>u.replace(//g,">"))}).join("")}a(t$t,"escapeProblematicHtmlTags");var n$t=Tn.Gpt4oMini,ixn=new Ae("virtualToolSummarizer"),pxe=class extends Error{static{a(this,"SummarizerError")}};function oxn(t){return typeof t=="object"&&t!==null&&"name"in t&&"summary"in t&&typeof t.name=="string"&&typeof t.summary=="string"}a(oxn,"isValidCategoryItem");function sxn(t,e){if(!Array.isArray(t))throw new pxe(`Invalid response from ${e}: ${JSON.stringify(t)}`);if(!t.every(oxn))throw new pxe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(sxn,"validateCategoriesWithoutToolsResponse");function WZo(t){return oxn(t)&&"tools"in t&&Array.isArray(t.tools)&&t.tools.every(e=>typeof e=="string")}a(WZo,"isValidCategorizationItem");function axn(t,e){if(sxn(t,e),!t.every(WZo))throw new pxe(`Invalid response from ${e}: ${JSON.stringify(t)}`)}a(axn,"validateCategorizationResponse");function cxn(t,e=new Set){return t.filter(r=>{let n=e.has(r.name);return e.add(r.name),!n})}a(cxn,"deduplicateTools");function zZo(t){let e=new Map;for(let r of t){let n=uxn(r.name),o=e.get(n);o?(r.summary&&r.summary!==o.summary&&(o.summary=`${o.summary} -${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=KIn(r.tools);return[...e.values()]}a(HXo,"validateAndCleanupCategories");function JIn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(FTn)}));return HXo(r)}a(JIn,"processCategorizationResponse");function ZIn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(ZIn,"normalizeGroupName");function $Gt(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:ZZe,summary:kTn,tools:[...r.values()]}),t}a($Gt,"addUncategorizedToolsIfNeeded");async function WGt(t,e,r,n){if(n.isCancellationRequested)return VIn.debug(t.ctx,"Summarization cancelled"),null;let o=gA.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await Jc(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new rc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return VIn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of $In(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(WGt,"getResponse");async function XIn(t,e,r){let n=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),s=await Kf.create(nXe,{tools:e},n).renderPrompt(void 0,r),c=await WGt(t,s,n,r);if(!c)return;let l=[c];return zIn(l,"categorizer"),{...l[0],tools:KIn(e),name:ZIn(l[0].name)}}a(XIn,"summarizeToolGroup");async function exn(t,e,r){let n=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),s=await Kf.create(iXe,{tools:e},n).renderPrompt(void 0,r),c=await WGt(t,s,n,r);if(!c)return;YIn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=JIn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await zGt(t,u,f,r);h&&(u=h),u=$Gt(u,l)}return u}a(exn,"divideToolsIntoGroups");async function zGt(t,e,r,n){let o=await t.ctx.get(Bc).getBestChatModelConfig([VGt]),c=await Kf.create(oXe,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await WGt(t,c,o,n);if(!l)return;YIn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=JIn(l,d);return $Gt(f,d)}a(zGt,"divideToolsIntoExistingGroups");var nxn=ce(require("crypto"));var YGt=new ge("virtualToolGrouper"),rxn="builtin",WXo=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: +${r.summary}`),o.tools=o.tools.concat(r.tools)):e.set(r.name,{tools:r.tools,name:n,summary:r.summary})}for(let r of e.values())r.tools=cxn(r.tools);return[...e.values()]}a(zZo,"validateAndCleanupCategories");function lxn(t,e){let r=t.map(n=>({name:n.name,summary:n.summary,tools:n.tools.map(o=>e.get(o)).filter(KTn)}));return zZo(r)}a(lxn,"processCategorizationResponse");function uxn(t){return t.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase()}a(uxn,"normalizeGroupName");function r$t(t,e){let r=new Map(e);for(let n of t)for(let o of n.tools)r.delete(o.name);return r.size>0&&t.push({name:WZe,summary:jTn,tools:[...r.values()]}),t}a(r$t,"addUncategorizedToolsIfNeeded");async function i$t(t,e,r,n){if(n.isCancellationRequested)return ixn.debug(t.ctx,"Summarization cancelled"),null;let o=_A.agent("conversation-other",t.turn.telemetryId),s={messages:e.messages,uiKind:"agentPanel",llmInteraction:o,modelConfiguration:r},c=await Kc(t.ctx,t,{languageId:""});c=c.extendedBy({messageSource:"virtualTools.generate",modelId:r.modelId});let u=await new rc(t.ctx).fetchResponse(s,n,c,void 0);if(n.isCancellationRequested)return ixn.debug(t.ctx,"Summarization cancelled"),null;if(u.type!=="success")return null;for(let f of nxn(u.value))try{return JSON.parse(f.code)}catch{}let d=u.value.indexOf("{");return JSON.parse(u.value.slice(d))||null}a(i$t,"getResponse");async function dxn(t,e,r){let n=await t.ctx.get(Yc).getBestChatModelConfig([n$t]),s=await tp.create(ZZe,{tools:e},n).renderPrompt(void 0,r),c=await i$t(t,s,n,r);if(!c)return;let l=[c];return sxn(l,"categorizer"),{...l[0],tools:cxn(e),name:uxn(l[0].name)}}a(dxn,"summarizeToolGroup");async function fxn(t,e,r){let n=await t.ctx.get(Yc).getBestChatModelConfig([n$t]),s=await tp.create(XZe,{tools:e},n).renderPrompt(void 0,r),c=await i$t(t,s,n,r);if(!c)return;axn(c,"categorizer");let l=new Map(e.map(h=>[h.name,h])),u=lxn(c,l),d=new Set(u.flatMap(h=>h.tools.map(m=>m.name))),f=e.filter(h=>!d.has(h.name));if(f.length>0){let h=await o$t(t,u,f,r);h&&(u=h),u=r$t(u,l)}return u}a(fxn,"divideToolsIntoGroups");async function o$t(t,e,r,n){let o=await t.ctx.get(Yc).getBestChatModelConfig([n$t]),c=await tp.create(eXe,{existingGroups:e,newTools:r},o).renderPrompt(void 0,n),l=await i$t(t,c,o,n);if(!l)return;axn(l,"existing group categorizer");let u=[...e.flatMap(h=>h.tools),...r],d=new Map(u.map(h=>[h.name,h])),f=lxn(l,d);return r$t(f,d)}a(o$t,"divideToolsIntoExistingGroups");var mxn=fe(require("crypto"));var s$t=new Ae("virtualToolGrouper"),hxn="builtin",ZZo=`Call this tool when you need access to a new category of tools. The category of tools is described as follows: -`,zXo=` +`,XZo=` -Be sure to call this tool if you need a capability related to the above.`,SXe=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.lengthu.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?rxn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof F_&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===rxn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof BY);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof F_){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){YGt.error(this.turnContext.ctx,`Failed to categorize tools: ${Vu(d)}`)}}YGt.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===ZZe);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new F_(yq+d.name,WXo+d.summary+zXo,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof F_&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await XIn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await zGt(this.turnContext,r,e,n):await exn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof F_&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof F_&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return nxn.createHash("sha256").update(r).digest("hex")}};var TXe=class{constructor(e){this._root=new F_(yq,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){Exe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new SXe(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof F_)return o.isExpanded=!0,new Or([new wr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var bO=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===yl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new TXe(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function ixn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(ixn,"calculateReducedMaxRequestTokens");Ns();var ZXo=500,IXe=3,dg=new ge("toolCallingLoop"),XXo="internal.tool_calling_loop_continue_confirmation",gue=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(vc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(us),this.transcriptPersistence=new Z0(e.ctx),this.llmRequestPersistence=zse(()=>{if(!Rze(e.ctx))return;let d=e.subagentInfo;return new wze(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new Kle(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new XZe(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=ixn(c),u=c-l;dg.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=gr(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(ZXo,qt(e.ctx,je.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new fZe(new pZe(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(X0).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=MWe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await TGe(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(kmn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed +Be sure to call this tool if you need a capability related to the above.`,EXe=class{static{a(this,"VirtualToolGrouper")}constructor(e){this.turnContext=e}async addGroups(e,r,n){if(r.lengthu.type==="mcp"?"mcp_"+u.toolProvider.id:u.type==="client"||u.type==="shared"?hxn:"unexpected_"+u.toolProvider.id),s=new Map,c=new Map;for(let u of e.all())u instanceof B_&&(s.set(u.name,u),u.metadata.toolsetKey&&c.set(u.metadata.toolsetKey,u.metadata.groups));if(n.isCancellationRequested)return;let l=await Promise.all(Object.entries(o).map(([u,d])=>{if(u===hxn)return d;{let f=s.get(u);if(f){let h=f.all().filter(m=>m instanceof zY);if(this.getKey(h)===this.getKey(d))return f}return this._generateGroupsFromToolset(u,d,c.get(u),n)}}));e.contents=this._deduplicateGroups(l.flat());for(let u of e.all())if(u instanceof B_){let d=s.get(u.name);d&&(u.isExpanded=d.isExpanded,u.metadata.preExpanded=d.metadata.preExpanded,u.lastUsedOnTurn=d.lastUsedOnTurn)}this._reExpandToolsToHitBudget(e)}async _generateGroupsFromToolset(e,r,n,o){if(r.length<=2)return r;let s=0,c;for(;!c&&s<3;s++){if(o.isCancellationRequested)return[];try{c=await(r.length<=16?this._summarizeToolGroup(r,o):this._divideToolsIntoGroups(r,n,o))}catch(d){s$t.error(this.turnContext.ctx,`Failed to categorize tools: ${Yu(d)}`)}}s$t.info(this.turnContext.ctx,`Tool categorization completed after ${s} attempt(s).`);let l=[];if(!c)l=r;else{let d=c.findIndex(f=>f.name===WZe);d>=0&&(l=c[d].tools,c.splice(d,1))}return(c?.map(d=>{let f=r[0].toolProvider,h=f.displayNamePrefix??f.id;return new B_(fq+d.name,ZZo+d.summary+XZo,0,{toolsetKey:e,groups:c,possiblePrefix:h?.replaceAll(/[^a-zA-Z0-9]/g,"_").slice(0,10)+"_"},d.tools)})||[]).concat(l)}_reExpandToolsToHitBudget(e){let r=e.tools().length;if(r>64)return;let n=e.contents.filter(o=>o instanceof B_&&!o.isExpanded).sort((o,s)=>o.contents.length-s.contents.length);for(let o of n){let s=r-1+o.contents.length;if(s>128||(o.isExpanded=!0,o.metadata.preExpanded=!0,r=s,r>64))break}}async _summarizeToolGroup(e,r){let n=await dxn(this.turnContext,e,r);return n&&[n]}async _divideToolsIntoGroups(e,r,n){if(r){let s=new Set(e.map(c=>c.name));r=r.map(c=>({...c,tools:c.tools.filter(l=>s.has(l.name))})).filter(c=>c.tools.length>0)}let o=r?.length?await o$t(this.turnContext,r,e,n):await fxn(this.turnContext,e,n);if(o)return o}_deduplicateGroups(e){let r=new Map;for(let n of e){let o=r.get(n.name);if(!o){r.set(n.name,n);continue}if(o instanceof B_&&o.metadata.possiblePrefix){r.delete(o.name);let s=o.cloneWithPrefix(o.metadata.possiblePrefix);r.set(s.name,s),r.set(n.name,n)}else if(n instanceof B_&&n.metadata.possiblePrefix){let s=n.cloneWithPrefix(n.metadata.possiblePrefix);r.set(s.name,s)}}return[...r.values()]}getKey(e){let r=e.map(n=>n.name+"\0"+n.description).sort().join(",");return mxn.createHash("sha256").update(r).digest("hex")}};var _Xe=class{constructor(e){this._root=new B_(fq,"",1/0,{groups:[],toolsetKey:"",preExpanded:!0});this._didToolsChange=!0;this._turnNo=0;this._trimOnNextCompute=!1;this._tools=e,this._root.isExpanded=!0}static{a(this,"ToolGrouping")}get tools(){return this._tools}get isEnabled(){return this._tools.length>128}get root(){return this._root}set tools(e){sxe(this._tools,e,(r,n)=>r.name===n.name)||(this._tools=[...e],this._didToolsChange=!0)}async compute(e,r){if(this._didToolsChange&&(await new EXe(e).addGroups(this._root,this._tools.slice(),r),this._didToolsChange=!1),this._expandOnNext){for(let o of this._expandOnNext)this._root.find(o)?.path.forEach(s=>{s.isExpanded=!0,s.lastUsedOnTurn=this._turnNo});this._expandOnNext=void 0}let n=128;for(this._trimOnNextCompute&&(n=96,this._trimOnNextCompute=!1),this._root.lastUsedOnTurn=1/0;this._root.tools().length>n;){let o=this._root.getLowestExpandedTool();if(!o||o===this._root)break;o.isExpanded=!1,o.metadata.preExpanded=!1}return this._trimOnNextCompute=!1,[...this._root.tools()]}ensureExpanded(e){this._expandOnNext??=new Set,this._expandOnNext.add(e)}didInvalidateCache(){this._trimOnNextCompute=!0}didTakeTurn(){this._turnNo++}didCall(e){let r=this._root.find(e);if(!r)return;let{path:n,tool:o}=r;for(let s of n)s.lastUsedOnTurn=this._turnNo;if(o instanceof B_)return o.isExpanded=!0,new Br([new Rr(`Tools activated: ${[...o.tools()].map(s=>s.name).join(", ")}`)],"success")}};var AO=class{constructor(){this._groups=new Map}static{a(this,"ToolGroupingService")}get groups(){return[...this._groups.values()]}getGroupKey(e){let r=e.turn.chatMode;return r===void 0||r===yl.Agent?"_global_":r.id}getGroup(e){let r=this.getGroupKey(e);return this._groups.get(r)}create(e,r){let n=this.getGroupKey(e),o=this._groups.get(n);return o?o.tools=r:(o=new _Xe(r),this._groups.set(n,o)),o}didTakeTurn(e){this.getGroup(e)?.didTakeTurn()}didCall(e,r){return this.getGroup(e)?.didCall(r)}isEnabled(e){return this.getGroup(e)?.isEnabled??!1}compute(e,r){return this.getGroup(e)?.compute(e,r)}findTool(e,r){return this.getGroup(e)?.root.find(r)?.tool??null}};p();function gxn(t){let e=t*.05,r=Math.min(Math.max(e,1e3),3e3);return t-r}a(gxn,"calculateReducedMaxRequestTokens");As();var nXo=500,vXe=3,ug=new Ae("toolCallingLoop"),iXo="internal.tool_calling_loop_continue_confirmation",pue=class t{constructor(e,r,n,o,s){this.turnContext=e;this.chatFetcher=r;this.modelConfiguration=n;this.baseTelemetryWithExp=o;this.subagentConfig=s;this.nextTrajectoryOrder=0;this.toolCallRounds=[];this.maxOutputTokenRecoveryCount=0;this.conversationProgress=e.ctx.get(vc),this.conversation=e.conversation,this.turn=e.turn,this.toolsService=e.ctx.get(ls),this.transcriptPersistence=new X0(e.ctx),this.llmRequestPersistence=Use(()=>{if(!bYe(e.ctx))return;let d=e.subagentInfo;return new CYe(e.ctx,void 0,"ToolCallingLoop",e.conversation.id.toString(),e.turn.id.toString(),void 0,e.turn.parentTurnId?.toString(),d?.name)},void 0),this.hookTrigger=new Wle(e.ctx,e.conversation,e.turn.workspaceFolders||[]),this.metricsTracker=new zZe(e.ctx,this.conversation,this.turn,this.conversationProgress);let c=this.modelConfiguration.maxRequestTokens,l=gxn(c),u=c-l;ug.debug(this.turnContext.ctx,`Token reduction applied: original=${c}, reduced=${l}, reduction=${u} tokens`),this.modelConfiguration={...this.modelConfiguration,maxRequestTokens:l},this.requestId=ir(),this.baseTelemetryWithExp=this.baseTelemetryWithExp.extendedBy({requestId:this.requestId}),this.maxToolCallingLoop=s?.getMaxRounds?.()??Math.min(nXo,Ht(e.ctx,Je.MaxToolCallingLoop)),this.requestLimitIncrement=this.maxToolCallingLoop,this.snapshotTextDocumentProvider=new aZe(new cZe(e.ctx))}static{a(this,"ToolCallingLoop")}static{this.NextToolCallId=Date.now()}async run(e){this.abortIfCanceled(e);let r=0,n;this.turnContext.todoListSnapshot=this.turnContext.ctx.get(tm).getTodos(this.conversation),await this.llmRequestPersistence?.ensureInitialized(),this.cachedUseMessagesEndpoint=iYe(this.turnContext.ctx,this.modelConfiguration);let o=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode).some(s=>s.name==="run_subagent");for(this.cachedHasSearchSubagent=o&&await dGe(this.turnContext.ctx);;)try{r++,this.abortIfCanceled(e),await this.validateIteration(r,n,e),this.turnContext.clearCopilotEditsSessionHeader();let s=performance.now(),c=await this.runOne(r,e),l=this.metricsTracker.extractRoundUsage(c.response);if(Jyn(this.turnContext.ctx,this.turnContext,r,performance.now()-s,this.baseTelemetryWithExp,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics,c.routeForTelemetry),this.metricsTracker.logRoundDebugMetrics(r,this.turn.id,l,c.llmFetchTimeMs,c.timeSinceLastLLMCallMs,c.promptPrefixMetrics),this.metricsTracker.accumulateTokenUsage(r,l),n={...c},this.toolCallRounds.push(c.round),await this.checkCompressionAfterToolCall(e),!c.round.toolCalls.length||c.response.type!=="success"&&c.response.type!=="tool_calls"){this.turn.status==="in-progress"&&(this.turn.status="success"),this.turnContext.subagentInfo&&(r++,await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** completed -`}]}));try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}return}}catch(s){try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}if(this.turnContext.subagentInfo){r++;let c="";s instanceof D3?c="maximum tool attempts reached":c=s instanceof Error?s.message:String(s),await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** stopped due to ${c} +`}]}));try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}return}}catch(s){try{await this.metricsTracker.reportCumulativeTokenUsage(r)}catch{}if(this.turnContext.subagentInfo){r++;let c="";s instanceof I3?c="maximum tool attempts reached":c=s instanceof Error?s.message:String(s),await this.conversationProgress.report(this.conversation,this.turn,{editAgentRounds:[{roundId:r,reply:`\u2726\uFE0E **${this.turnContext.subagentInfo.name}** stopped due to ${c} -`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let R=this.subagentConfig.filterTools?.(o);R!==void 0&&(o=R),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let R=this.createAgentPromptProps(o);s=Kf.create(JZe,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=NWe(this.modelConfiguration,c),u=(await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c})).messages;if(e===1&&!this.turn.renderedUserMessage)for(let R=u.length-1;R>=0;R--){let x=u[R];if(x.role==="user"&&x.content){this.turn.renderedUserMessage=x.content,this.recordRenderedUserMessageTranscript(x.content);break}}let d="",f=new YQ((R,x,k,D,N,L)=>{let B=R.trim(),M=B.match(CIe)!==null&&B.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:k,hideText:M,notifications:D.map(O=>({severity:"warning",message:O.message})),thinking:L,editAgentRounds:[{roundId:e,reply:M?"":R}]}),this.turn.annotations.push(...x??[]),d+=R});this.abortIfCanceled(r);let h=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let m=this.metricsTracker.computePromptPrefixMetrics(u,h),g={messages:u,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:h,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(g),dg.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(g,null,2)}`);let A,y=this.metricsTracker.getTimeSinceLastLLMCall(),E=performance.now(),_=30,v={shouldRetry:a(R=>R.type==="failed"&&R.code===429&&R.retryAfter!==void 0&&R.retryAfter>=0&&R.retryAfter<=_,"shouldRetry"),onRetry:a(async R=>{let x=R.type==="failed"?R.retryAfter:void 0;x!==void 0&&(dg.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${x}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},b=await this.chatFetcher.fetchResponse(g,r,this.baseTelemetryWithExp,(R,x)=>(x.phase&&(A=x.phase),f.isFinishedAfter(R,x)),this.llmRequestPersistence,v),T=performance.now()-E;if(this.metricsTracker.recordLlmFetchComplete(),b.type==="length"){if(this.addToolCallModelResponseToTurn(d,[],b.thinking,A),this.recordAssistantRoundTranscript(d,e,b.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new AA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Mc;case"failed":throw this.turn.status="error",dg.error(this.turnContext.ctx,"Fetch failed:",r),new AA({message:KQ.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===MS,copilotPlan:FI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new AA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new AA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new AA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new AA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new AA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=Uo.parseModelNotSupportedReason(r.reason);throw new AA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new AA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new AA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return u});this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof F_)this.handleVirtualToolCall(c,e,n);else if(c instanceof BY)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;dg.error(this.turnContext.ctx,l);let u=new Or([new wr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=yZe(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(bO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Or([new wr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;$6t(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=r3(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){dg.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Or([new wr(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=tTn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=yZe(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof gq||u instanceof Mc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Or([new wr("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{dg.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Vu(u)}`,u),l="error";let d=new Or([new wr(Vu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=yZe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),$6t(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=r3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){dg.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Vu(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(bO);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return dg.error(this.turnContext.ctx,`Error while computing tool grouping: ${Vu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof F_?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?yTn(this.modelConfiguration):e.name==="apply_patch"?_Tn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?AO.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=TQ(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+hO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(qY(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){dg.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=TQ(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(bO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(OK).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(qS),c=kK(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!EO.isPotentiallySensitiveTool(e))return;let n=EO.getMatchingRuleForToolCall(e,r,this.turnContext),o=EO.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new Mc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){dg.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=EO.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=fTn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?kK(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(E.result){case"dismiss":throw this.turn.status="cancelled",new gq("Cancelled by user");case"accept":return Promise.resolve();default:throw new gq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(dg.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,dg.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new D3}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Md)}catch(s){return dg.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Vu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:XXo,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return dg.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Vu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new AA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new AA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(Uv).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){dg.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Vu(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=ZJe(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{Ye.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){Ye.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=NSn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{Ye.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){Ye.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=MSn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{Ye.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){Ye.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=OSn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{Ye.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){Ye.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));Wse(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>Ye.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||Wse(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>Ye.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=hO(n.content),c=Math.round(performance.now()-o);Wse(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>Ye.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var KGt=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},JGt=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function Y9t(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(Y9t,"parseModelString");var xXe=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new Gf({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new DTe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new SY([c],e.conversation.source,e.conversation.userLanguage),f=new Wx(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=Y9t(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let k=(await f.ctx.get(dc).getMetadata()).find(D=>D.name.toLowerCase()===T);if(k){let D;k.is_chat_fallback?D=k.id:D=k.capabilities.family,h=await Uo.getModelConfiguration(e.ctx,void 0,D)}else if(T===Mze.toLowerCase())m=!0,h=await Uo.getModelConfiguration(e.ctx,void 0,MS,void 0,d.id.toString(),SQ(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let k=(await new bc(f.ctx.get(Si)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(k)h=await QM(f.ctx,k.provider,k.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily?h=await ees(e,b=>this.subagentConfig.resolveModelFamily(b)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new rc(e.ctx),A=await Jc(e.ctx,f,{languageId:""}),y=n||new KGt,E=new JGt(y,e.turn.id);await e.ctx.get(vc).begin(d,c,E),await new gue(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(Rd).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?In(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function ees(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await Uo.getModelConfiguration(t.ctx,"user",s);if(o!==void 0&&c.originalBillingMultiplier!==void 0&&c.originalBillingMultiplier>o)continue;return c}catch{continue}return r}a(ees,"resolvePreferredSubagentModel");p();p();p();var vq=ce(wo());var wXe=class extends sr{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=In(r.request.message),c=GM(r.response?.message,!0),l=tO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,vq.useKeepWith)();return vscpp(vscppf,null,vscpp(vq.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(vq.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(Jle,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(vq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Mx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(vq.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var ZGt=10,tes=new Set(["file_search","grep_search","read_file"]),RXe=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Tn.ClaudeHaiku45,Tn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:ZGt,isLastTurn:o.oneBasedIterationNum>ZGt};return Kf.create(wXe,s,n)}filterTools(e){return e.filter(r=>tes.has(r.name))}getMaxRounds(){return ZGt+1}};p();var GK=ce(wo());var kXe=class extends sr{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=GM(r.response?.message,!0),l=tO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,GK.useKeepWith)(),d=In(r.request.message);return vscpp(vscppf,null,vscpp(GK.SystemMessage,{priority:1e3},vscpp(eue,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(GK.UserMessage,{priority:950},vscpp(jn,{name:"environment_info"},vscpp(pq,{ctx:e.ctx})),vscpp(jn,{name:"workspace_info"},vscpp(hq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(GK.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Mx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var XGt=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return Kf.create(kXe,s,n)}};function oxn(t){return t.isBuiltIn&&t.name==="Search"?new RXe:new XGt(t)}a(oxn,"resolveSubagentConfig");var Aue=class extends hu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. +`}]})}throw s}}async runOne(e,r){this.abortIfCanceled(r);let n=this.toolsService.getToolsForModel(this.turnContext.turn.chatMode),o=this.getAvailableLanguageModelTools(n),s;if(this.subagentConfig){let R=this.subagentConfig.filterTools?.(o);R!==void 0&&(o=R),s=this.subagentConfig.createPromptRenderer(this.turnContext,o,this.modelConfiguration,{oneBasedIterationNum:e,maxRounds:this.maxToolCallingLoop})}else{let R=this.createAgentPromptProps(o);s=tp.create(VZe,R,this.modelConfiguration)}let c=this.cachedUseMessagesEndpoint,l=nYe(this.modelConfiguration,c),u=(await s.renderPrompt(void 0,r,{collapseSystemMessages:!0,enableCacheBreakpoints:c})).messages;if(e===1&&!this.turn.renderedUserMessage)for(let R=u.length-1;R>=0;R--){let x=u[R];if(x.role==="user"&&x.content){this.turn.renderedUserMessage=x.content,this.recordRenderedUserMessageTranscript(x.content);break}}let d="",f=new XQ((R,x,P,D,N,B)=>{let L=R.trim(),M=L.match(RIe)!==null&&L.endsWith("-->")||!!this.subagentConfig?.hideReplyText;this.conversationProgress.report(this.conversation,this.turn,{annotations:x,references:P,hideText:M,notifications:D.map(O=>({severity:"warning",message:O.message})),thinking:B,editAgentRounds:[{roundId:e,reply:M?"":R}]}),this.turn.annotations.push(...x??[]),d+=R});this.abortIfCanceled(r);let h=await this.getAvailableChatTools(o,r);this.abortIfCanceled(r);let m=this.metricsTracker.computePromptPrefixMetrics(u,h),g={messages:u,modelConfiguration:this.modelConfiguration,uiKind:"agentPanel",chatModeKind:this.turnContext.turn.chatMode?.kind,tools:h,intentParams:{intent:!0},llmInteraction:this.turnContext.toLlmInteraction(),endpoint:l,turnId:String(this.turn.id)};this.checkChatPayload(g),ug.debug(this.turnContext.ctx,`Send request for iteration ${e} for turn ${this.turn.id} with: ${JSON.stringify(g,null,2)}`);let A,y=this.metricsTracker.getTimeSinceLastLLMCall(),E=performance.now(),_=30,v={shouldRetry:a(R=>R.type==="failed"&&R.code===429&&R.retryAfter!==void 0&&R.retryAfter>=0&&R.retryAfter<=_,"shouldRetry"),onRetry:a(async R=>{let x=R.type==="failed"?R.retryAfter:void 0;x!==void 0&&(ug.info(this.turnContext.ctx,`Rate limited in iteration ${e} for turn ${this.turn.id}, retrying in ${x}s`),await this.turnContext.warn("Service is busy. Retrying shortly \u2014 you can cancel anytime."))},"onRetry"),maxRetryAttempts:3},b=await this.chatFetcher.fetchResponse(g,r,this.baseTelemetryWithExp,(R,x)=>(x.phase&&(A=x.phase),f.isFinishedAfter(R,x)),this.llmRequestPersistence,v),T=performance.now()-E;if(this.metricsTracker.recordLlmFetchComplete(),b.type==="length"){if(this.addToolCallModelResponseToTurn(d,[],b.thinking,A),this.recordAssistantRoundTranscript(d,e,b.thinking),this.maxOutputTokenRecoveryCount0?await this.handleToolCalls({type:"tool_calls",requestId:r.requestId,toolCalls:r.toolCalls,copilotEditsSessionHeader:r.copilotEditsSessionHeader,thinking:r.thinking,usage:r.usage},n,o,e,s,c):(this.turn.status="success",this.addToolCallModelResponseToTurn(n,[],r.thinking,c),this.recordAssistantRoundTranscript(n,e,r.thinking),{response:r,round:{response:r.value,toolInputRetry:0,toolCalls:[],phase:c}});case"offTopic":throw this.turn.status="off-topic",new vA({message:"Sorry, but I can only assist with programming related questions.",responseIsFiltered:!0});case"canceled":throw new Dc;case"failed":throw this.turn.status="error",ug.error(this.turnContext.ctx,"Fetch failed:",r),new vA({message:R_.translateErrorMessage(r.code,r.reason,r.requestId,r.retryAfter,r.ghRequestId,{capiErrorCode:r.capiErrorCode,isAuto:this.turnContext.turn.userRequestedModel?.toLowerCase()===P_,copilotPlan:MI(this.turnContext.ctx)?.userInfo?.copilotPlan}),code:r.code,retryAfter:r.retryAfter});case"filtered":throw this.turn.status="filtered",new vA({message:"Oops, your response got filtered.",responseIsFiltered:!0});case"length":throw this.turn.status="error",new vA({message:"Oops, the response got too long. Try to reformulate your question.",responseIsIncomplete:!0});case"agentAuthRequired":throw this.turn.status="error",new vA({message:"Authorization required",responseIsFiltered:!1});case"no_choices":throw this.turn.status="error",new vA({message:"Oops, no choices received from the server. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"no_finish_reason":throw this.turn.status="error",new vA({message:"Oops, unexpected end of stream. Please try again.",responseIsFiltered:!1,responseIsIncomplete:!0});case"model_not_supported":{this.turn.status="error";let{modelName:l,modelProviderName:u}=Ro.parseModelNotSupportedReason(r.reason);throw new vA({message:"Oops, the model is not supported. Please try again.",code:400,reason:"model_not_supported",responseIsFiltered:!1,modelName:l,modelProviderName:u})}case"model_max_prompt_tokens_exceeded":throw this.turn.status="error",new vA({message:"Oops, the token limit exceeded. Try to shorten your prompt or start a new conversation.",responseIsFiltered:!1});case"tool_calls":return await this.handleToolCalls(r,n,o,e,s,c);default:throw this.turn.status="error",new vA({message:"Unknown server side error occurred. Please try again.",responseIsFiltered:!1})}}async handleToolCalls(e,r,n,o,s,c){if(e.type!=="tool_calls")throw new Error(`Expected tool_calls type but got ${e.type}`);if(!e.toolCalls)throw new Error("Tool calls are required but were not provided");this.turnContext.setCopilotEditsSessionHeader(e.copilotEditsSessionHeader);let l=e.toolCalls.map(u=>{if(!u.id){let d=`cls_${t.NextToolCallId++}`;u.id=d}return u});this.addToolCallModelResponseToTurn(r,l,e.thinking,c),this.recordAssistantRoundTranscript(r,o,e.thinking),this.recordTrajectorySteps(e);for(let u of l)await this.handleSingleToolCall(u,n,o,s,e.usage);return{response:e,round:{response:r,toolInputRetry:0,toolCalls:l.map(u=>({id:u.id,name:u.function.name,arguments:JSON.stringify(u.function.arguments)})),phase:c}}}async handleSingleToolCall(e,r,n,o,s){if(!e.id)throw new Error(`Tool call id is required but was not provided for function ${e.function.name}`);let c=this.findToolByName(r,e.function.name);if(c instanceof B_)this.handleVirtualToolCall(c,e,n);else if(c instanceof zY)await this.handleLanguageModelToolCall(c,e,n,o,s);else{let l=`Tool with name ${e.function.name} not found in registered tools`;ug.error(this.turnContext.ctx,l);let u=new Br([new Rr(l)],"error");this.addToolCallResultToTurn(u,e.id);let d=pZe(u);await this.turnContext.agentToolCalls.error(n,e.id,d.message)}}handleVirtualToolCall(e,r,n){if(!r.id)throw new Error(`Tool call id is required but was not provided for function ${r.function.name}`);let o=performance.now(),s=this.turnContext.ctx.get(AO).didCall(this.turnContext,e.name),c,l;s?(l=s,c=s.status):(c="error",l=new Br([new Rr(`Failed to activate virtual tool group ${e.name}`)],"error")),this.addToolCallResultToTurn(l,r.id);let u=performance.now()-o;Y7t(this.turnContext.ctx,this.turnContext,{name:e.name,type:"virtual",toolProvider:{id:e.metadata.toolsetKey||"virtual"}},r.id,n,u,c,this.baseTelemetryWithExp)}async handleLanguageModelToolCall(e,r,n,o,s){let c=performance.now(),l="success";try{let u=d3(r);this.turnContext.agentToolCalls.init(n,r.id,e.name,e.type,u,this.formatInputForDisplay(u));let d=this.toolsService.prepareInvocation(e.id,{input:u,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o),{needConfirm:f}=await this.prepareToolConfirmation(e,u);await this.requestToolInvocationApproval(d,f,e,u,n,r.id,o),this.abortIfCanceled(o);let h=await this.hookTrigger.firePreToolUseHook(e,u,o,{turn:this.turn,conversationProgress:this.conversationProgress});if(h.denied){ug.info(this.turnContext.ctx,`Tool execution denied by hook: ${h.reason||"No reason provided"}`),l="cancelled";let A=new Br([new Rr(h.reason||"Tool execution denied by hook")],"cancelled");this.addToolCallResultToTurn(A,r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);return}let m=d.progressMessage||`Running ${e.displayName} tool`;await this.turnContext.agentToolCalls.running(n,r.id,m),this.recordToolExecutionStartTranscript(r.id,e.name,u);let g=await this.toolsService.invokeTool(this.turnContext,e.id,{toolInvocationToken:r.id,input:u,roundId:n,toolCallId:r.id},o);if(this.abortIfCanceled(o),await this.updateCompletionMessage(e,r,n,o),g.status==="success"){let A=pTn(g);await this.turnContext.agentToolCalls.result(n,r.id,A)}else if(g.status==="error"){let A=pZe(g);await this.turnContext.agentToolCalls.error(n,r.id,A.message)}else await this.turnContext.agentToolCalls.cancel(n,r.id);await this.hookTrigger.firePostToolUseHook(e,u,g,o,{turn:this.turn,conversationProgress:this.conversationProgress}),this.addToolCallResultToTurn(g,r.id),this.recordSubagentTrajectoryLink(e,g,r.id),this.recordToolInOut(r,u,g,c)}catch(u){if(await this.updateCompletionMessage(e,r,n,o),u instanceof uq||u instanceof Dc)this.turn.status="cancelled",l="cancelled",this.addToolCallResultToTurn(new Br([new Rr("The user chose to skip the tool call, they want to proceed without running it")],"cancelled"),r.id),await this.turnContext.agentToolCalls.cancel(n,r.id);else{ug.error(this.turnContext.ctx,`Error while invoking tool ${r.id}: ${Yu(u)}`,u),l="error";let d=new Br([new Rr(Yu(u).substring(0,300))],"error");this.addToolCallResultToTurn(d,r.id);let f=pZe(d);await this.turnContext.agentToolCalls.error(n,r.id,f.message)}}finally{let u=performance.now()-c;this.recordToolExecutionCompleteTranscript(r.id,l==="success",l),Y7t(this.turnContext.ctx,this.turnContext,e,r.id,n,u,l,this.baseTelemetryWithExp)}}async updateCompletionMessage(e,r,n,o){let s=`Ran ${e.displayName} tool`;try{let c=d3(r);s=this.toolsService.prepareCompletion(e.id,{input:c,annotation:e.annotations,uriSchemeCache:this.turnContext.uriSchemeCache},o).completionMessage||s}catch(c){ug.debug(this.turnContext.ctx,`Failed to prepare completion message for tool ${e.id}: ${Yu(c)}, using default message`)}await this.turnContext.agentToolCalls.updateProgressMessage(n,r.id,s)}async getAvailableChatTools(e,r){let n=(await Promise.all(e.map(async c=>this.shouldIncludeTool(c)&&await c.isEnabled(this.turnContext)?c:null))).filter(c=>c!==null),o=this.turnContext.ctx.get(AO);if(o.create(this.turnContext,n),!o.isEnabled(this.turnContext))return n.map(c=>({type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}}));let s=n;try{s=await o.compute(this.turnContext,r)||[]}catch(c){return ug.error(this.turnContext.ctx,`Error while computing tool grouping: ${Yu(c)}`),this.abortIfCanceled(r),[]}return s.map(c=>c instanceof B_?{type:"function",function:{name:c.name,description:c.description}}:{type:"function",function:{name:c.nameForModel,description:this.getToolDescription(c),parameters:c.inputSchema}})}getAvailableLanguageModelTools(e){return e.filter(r=>this.shouldIncludeTool(r))}shouldIncludeTool(e){return e.name==="replace_string_in_file"?PTn(this.modelConfiguration):e.name==="apply_patch"?DTn(this.modelConfiguration):!0}getToolDescription(e){return e.name==="manage_todo_list"?dO.getToolDescription(this.modelConfiguration.modelFamily):e.description}createAgentPromptProps(e){return{turnContext:this.turnContext,userRawMessage:this.turnContext.turn.request.message,workspaceFolders:this.turnContext.turn.workspaceFolders,snapshotTextDocumentProvider:this.snapshotTextDocumentProvider,tools:e,modelConfiguration:this.modelConfiguration,codesearchMode:this.turnContext.turn.chatMode?.kind==="Ask",hasSearchSubagent:this.cachedHasSearchSubagent??!1}}addToolCallModelResponseToTurn(e,r,n,o){let s={role:"assistant",content:e,tool_calls:r.length?r:void 0,thinking:n,phase:o,modelId:this.modelConfiguration.modelId};this.turn.response?this.turn.response.message=QQ(this.turn.response.message,s):this.turn.response={message:[s],type:"model"}}addToolCallResultToTurn(e,r){let n="";switch(e.status){case"error":n="Tool call failed with error: ";break;case"cancelled":n="Tool call is cancelled with result: ";break;default:case"success":n=""}let o=n+cO(e.content),s={role:"tool",content:o,tool_call_id:r};if(!this.turn.response)this.turn.response={message:[s],type:"model"};else{if(XY(this.turn.response.message)&&this.turn.response.message.find(l=>l.role==="tool"&&l.tool_call_id===r)){ug.info(this.turnContext.ctx,`Tool call result for ${r} already exists in the turn response. Ignoring the new one.`);return}this.turn.response.message=QQ(this.turn.response.message,s)}}findToolByName(e,r){return this.turnContext.ctx.get(AO).findTool(this.turnContext,r)??e.find(n=>n.nameForModel===r)}async prepareToolConfirmation(e,r){return this.turnContext.ctx.get(wK).checkApproval(this.turnContext,e,r)}async buildTerminalCommandData(e,r){if(!e.id.includes("run_in_terminal"))return;let n=r.command,o=this.turnContext.ctx.get(OS),c=bK(e.description)||"sh",{subCommands:l,commandNames:u}=await o.parseTerminalCommand(n,c);return{subCommands:l,commandNames:u}}buildSensitiveFileData(e,r){if(!pO.isPotentiallySensitiveTool(e))return;let n=pO.getMatchingRuleForToolCall(e,r,this.turnContext),o=pO.extractFilePathForMetadata(e,r);if(o)return{filePath:o.filePath,matchingRule:n?.rule.pattern,ruleDescription:n?.rule.description,isGlobal:n?n.isOutsideWorkspace:void 0}}abortIfCanceled(e){if(e.isCancellationRequested)throw this.turn.status="cancelled",new Dc}async requestToolInvocationApproval(e,r,n,o,s,c,l){if(!r){ug.debug(this.turnContext.ctx,`Tool call confirmation not required for ${n.id}`);return}let u=pO.generateSensitiveConfirmationMessage(n,o,this.turnContext);u&&(e.confirmationMessages={title:u.title,message:u.message});let d=e.confirmationMessages??{title:`Run ${n.id}`,message:`Do you want to allow "${n.id}" to run?`},f=await this.buildTerminalCommandData(n,o),h=this.buildSensitiveFileData(n,o),m=f||h?{terminalCommandData:f,sensitiveFileData:h}:void 0,g=STn(n.name),A=n.type==="mcp"?"mcp_tool":g!=="unknown"?g:n.type==="client"?"safe_tool":"unknown",y=A==="terminal"?bK(n.description)||"sh":void 0,E=await this.toolsService.invokeToolConfirmation(this.turnContext,n.id,{title:d.title,message:d.message,input:{...o,toolType:A,...y?{commandLineType:y}:{},...n.type==="mcp"?{mcpServerName:n.toolProvider.id,mcpToolName:n.name,mcpType:"tool"}:{}},roundId:s,toolCallId:c,annotations:n.annotations,toolMetadata:m},l);switch(E.result){case"dismiss":throw this.turn.status="cancelled",new uq("Cancelled by user");case"accept":return Promise.resolve();default:throw new uq(`Invalid confirmation result ${E.result}`)}}async validateIteration(e,r,n){if(!(!r||e<=this.maxToolCallingLoop)){if(ug.debug(this.turnContext.ctx,`Tool calling loop exceeds configured max iterations ${this.maxToolCallingLoop} for turn ${this.turn.id}`),this.turn.isSubagent()&&this.subagentConfig?.allowIterationExtension!==!1&&await this.requestAdditionalToolIterations(e,n)){let s=this.maxToolCallingLoop;this.maxToolCallingLoop=this.maxToolCallingLoop+this.requestLimitIncrement,ug.debug(this.turnContext.ctx,`Tool calling loop limit increased from ${s} to ${this.maxToolCallingLoop} for turn ${this.turn.id}`);return}throw new I3}}async requestAdditionalToolIterations(e,r){this.abortIfCanceled(r);let n;try{n=this.turnContext.ctx.get(Dd)}catch(s){return ug.error(this.turnContext.ctx,`Tool confirmation invoker unavailable: ${Yu(s)}, stopping tool calling loop.`),!1}let o=`cls_${t.NextToolCallId++}`;try{let s=await n.invokeClientToolConfirmation(this.turnContext,{name:iXo,title:"Continue to iterate?",message:"Copilot has been working on this problem for a while. Do you want it to continue to iterate? You can also set the maximum request limit in settings.",input:void 0,conversationId:this.conversation.id,turnId:this.turn.id,roundId:e,toolCallId:o});return this.abortIfCanceled(r),s.result==="accept"}catch(s){return ug.error(this.turnContext.ctx,`Failed to request continuation confirmation: ${Yu(s)}`),!1}}checkChatPayload(e){if(e.messages.length===0)throw new vA({message:"No messages provided",responseIsFiltered:!1});if(e.tools&&e.tools.length>128)throw new vA({message:`You may not include more than ${128} tools in your request.`,responseIsFiltered:!1})}formatInputForDisplay(e){try{return JSON.stringify(e,null,2)}catch{return}}async checkCompressionAfterToolCall(e){try{await this.turnContext.ctx.get(MC).checkAndCompress(this.conversation,this.modelConfiguration,"post-tool-call",e,String(this.turn.id))}catch(r){ug.error(this.turnContext.ctx,`Post-tool-call compression check failed: ${Yu(r)}`)}}recordAssistantRoundTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o={text:e,iterationNumber:r};n&&(o.thinking={id:n.id,text:Array.isArray(n.text)?n.text.join(""):n.text});let s=WJe(e,String(this.turn.id),null,o);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,s).catch(c=>{ot.error(this.turnContext.ctx,`Failed to record assistant round transcript: ${c instanceof Error?c.message:String(c)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create assistant round transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordRenderedUserMessageTranscript(e){if(this.transcriptPersistence.isEnabled())try{let r=$Sn(String(this.turn.id),e);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r).catch(n=>{ot.error(this.turnContext.ctx,`Failed to record rendered user message transcript: ${n instanceof Error?n.message:String(n)}`)})}catch(r){ot.error(this.turnContext.ctx,`Failed to create rendered user message transcript event: ${r instanceof Error?r.message:String(r)}`)}}recordToolExecutionStartTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=VSn(e,r,n);this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,o).catch(s=>{ot.error(this.turnContext.ctx,`Failed to record tool execution start transcript: ${s instanceof Error?s.message:String(s)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution start transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordToolExecutionCompleteTranscript(e,r,n){if(this.transcriptPersistence.isEnabled())try{let o=this.turnContext.agentToolCalls.getToolCallById(e),s=o?{result:o.result,error:o.error,resultDetails:o.resultDetails,toolSpecificData:o.toolSpecificData,progressMessage:o.progressMessage}:void 0,c=WSn(e,r,s,null,{status:n.toString()});this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,c).catch(l=>{ot.error(this.turnContext.ctx,`Failed to record tool execution complete transcript: ${l instanceof Error?l.message:String(l)}`)})}catch(o){ot.error(this.turnContext.ctx,`Failed to create tool execution complete transcript event: ${o instanceof Error?o.message:String(o)}`)}}recordTrajectorySteps(e){if(!this.llmRequestPersistence?.isEnabled()||e.type!=="tool_calls"||!e.toolCalls)return;let r=this.turnContext.subagentInfo,n=e.toolCalls.map(o=>({tool:o.function.name,tool_call_id:o.id}));Fse(()=>this.llmRequestPersistence?.appendTrajectoryStep({tool_calls:n,input_tokens:e.usage?.prompt_tokens,output_tokens:e.usage?.completion_tokens,cached_input_tokens:e.usage?.prompt_tokens_details?.cached_tokens,loop_type:r?"subagent":"parent",subagent_name:r?.name,loop_order:this.nextTrajectoryOrder++,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),o=>ot.debug(this.turnContext.ctx,"Failed to record trajectory step",o))}recordSubagentTrajectoryLink(e,r,n){if(e.name!=="run_subagent"||!this.llmRequestPersistence?.isEnabled()||!n)return;let o=r.subagentConversationId,s=r.subagentTurnId;!o||!s||Fse(()=>this.llmRequestPersistence?.appendSubagentLink({type:"subagent_link",tool_call_id:n,subagent_conversationId:o,subagent_turnId:s,conversationId:this.conversation.id.toString(),turnId:this.turn.id.toString()}),c=>ot.debug(this.turnContext.ctx,"Failed to record subagent link",c))}recordToolInOut(e,r,n,o){if(!this.llmRequestPersistence?.isEnabled()||!e.id)return;let s=cO(n.content),c=Math.round(performance.now()-o);Fse(()=>this.llmRequestPersistence?.appendToolInOut({tool_call_id:e.id,tool:e.function.name,input:r,output:s,status:n.status,timestamp:new Date().toISOString(),duration_ms:c}),l=>ot.debug(this.turnContext.ctx,"Failed to record tool-in-out entry",l))}};var a$t=class{static{a(this,"DummyProgressHandler")}async begin(){}async report(){}async end(){}async cancel(){}},c$t=class{constructor(e,r){this.handler=e;this.parentTurnId=r}static{a(this,"SubagentProgressHandler")}async begin(e,r,n,o){await this.handler.begin(e,r,n,{...o,parentTurnId:this.parentTurnId})}async report(e,r,n,o){await this.handler.report(e,r,n,{...o,parentTurnId:this.parentTurnId})}async end(e,r,n,o){await this.handler.end(e,r,n,o)}async cancel(e,r,n,o){await this.handler.cancel(e,r,n,o)}};function cQt(t){let e=t.match(/^(.+?)\s*\(([^)]+)\)$/);return e?{modelName:e[1].trim(),provider:e[2].trim()}:{modelName:t.trim(),provider:""}}a(cQt,"parseModelString");var CXe=class{static{a(this,"CustomAgentExecutor")}constructor(e,r){this.config=e,this.subagentConfig=r}async invoke(e,r,n,o){let s=r.task,c=new Yf({message:s,type:"user"}),l=this.config.model||e.turn.userRequestedModel;c.userRequestedModel=l,c.needToolCallConfirmation=r.needToolCallConfirmation,c.workspaceFolder=e.turn.workspaceFolder,c.workspaceFolders=e.turn.workspaceFolders,c.parentTurnId=e.turn.id,c.chatMode=new ZTe(this.config);let u=e.toLlmInteraction();c.parentLlmInteraction=u;let d=new FY([c],e.conversation.source,e.conversation.userLanguage),f=new Vx(e.ctx,d,c,o||e.cancelationToken),h,m=!1;if(this.config.model){let b=cQt(this.config.model),T=b.modelName.toLowerCase(),w=b.provider.toLowerCase()||"copilot";if(w==="copilot"){let P=(await f.ctx.get(Fa).getMetadata()).find(D=>D.name.toLowerCase()===T);if(P)h=await Ro.getModelConfigurationById(e.ctx,P.id);else if(T===wYe.toLowerCase())m=!0,h=await Ro.getModelConfigurationById(e.ctx,P_,d.id.toString(),UQ(d.turns));else throw new Error(`Model "${b.modelName}" not found in available models`)}else{let P=(await new Cc(f.ctx.get(yi)).getAllModels(f.ctx)).find(D=>D.provider.toLowerCase()===w&&D.capabilities?.name.toLowerCase()===T);if(P)h=await HM(f.ctx,P.provider,P.name);else throw new Error(`BYOK model "${b.modelName}" with provider "${b.provider}" not found`)}}else this.subagentConfig.resolveModelFamily&&e.turn.resolvedModelConfiguration?.providerName===void 0?h=await oXo(e,b=>this.subagentConfig.resolveModelFamily(b)):h=e.turn.resolvedModelConfiguration;f.setResolvedModelConfiguration(h),f.subagentInfo={name:this.config.name,model:m?h.uiName:h.uiName||l,isAutoModel:m};let g=new rc(e.ctx),A=await Kc(e.ctx,f,{languageId:""}),y=n||new a$t,E=new c$t(y,e.turn.id);await e.ctx.get(vc).begin(d,c,E),await new pue(f,g,h,A,this.subagentConfig).run(o||e.cancelationToken),e.ctx.get(uu).transferTurnCredits(String(c.id),String(e.turn.id));let v=c.response?Rn(c.response.message):"";return this.subagentConfig.postProcess&&(v=await this.subagentConfig.postProcess(f,v)),{response:v,conversationId:d.id.toString(),turnId:c.id.toString()}}};async function oXo(t,e){let r=t.turn.resolvedModelConfiguration,n=e(r.modelFamily);if(!n||n.length===0)return r;let o=r.originalBillingMultiplier;for(let s of n)try{let c=await Ro.resolveModelIdFromFamily(t.ctx,s);if(!c)continue;let l=await Ro.getModelConfigurationById(t.ctx,c);if(o!==void 0&&l.originalBillingMultiplier!==void 0&&l.originalBillingMultiplier>o)continue;return l}catch{continue}return r}a(oXo,"resolvePreferredSubagentModel");p();p();p();var gq=fe(xo());var bXe=class extends ar{static{a(this,"SearchSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,isLastTurn:o}=this.props,s=Rn(r.request.message),c=WM(r.response?.message,!0),l=eO(c,{ctx:e.ctx,identifier:`SearchSubagent Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,gq.useKeepWith)();return vscpp(vscppf,null,vscpp(gq.SystemMessage,{priority:1e3},"You are a codebase exploration specialist focused exclusively on searching and analyzing existing code. Your main goal is to explore the codebase based on a query provided by the user.",vscpp("br",null),vscpp("br",null),"Your strengths:",vscpp("br",null),"- Rapidly finding files using file search patterns",vscpp("br",null),"- Searching code and text with powerful text search",vscpp("br",null),"- Reading and analyzing file contents",vscpp("br",null),vscpp("br",null),"## Guidelines",vscpp("br",null),vscpp("br",null),"- For file searches: search broadly when you don't know where something lives. Use read file when you know the specific file path.",vscpp("br",null),"- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.",vscpp("br",null),"- Be thorough: Check multiple locations, consider different naming conventions, look for related files.",vscpp("br",null),vscpp("br",null),"IMPORTANT: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:",vscpp("br",null),"- Make efficient use of the tools at your disposal: be smart about how you search for files and implementations.",vscpp("br",null),"- Wherever possible you should try to spawn multiple parallel tool calls for searching and reading files.",vscpp("br",null),"- Maximum of ",this.props.maxSearchTurns," tool-calling rounds is allowed to complete the task.",vscpp("br",null),vscpp("br",null),"## Required Output",vscpp("br",null),vscpp("br",null),"End your response with an optional brief explanation of your findings (3 sentences max), followed by a tag containing absolute file paths and line ranges of relevant code snippets.",vscpp("br",null),vscpp("br",null),"Output Example:",vscpp("br",null),"The core routing logic lives in two files.",vscpp("br",null),vscpp("br",null),"",vscpp("br",null),"/absolute/path/to/file.py:10-20 (Optional Brief Reason)",vscpp("br",null),"/absolute/path/to/another/file.cc:100-120",vscpp("br",null),""),vscpp(gq.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(aq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(cq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}),vscpp(zle,{ctx:e.ctx,workspaceFolders:r.workspaceFolders,maxSize:2e3,excludeDotFiles:!0}))),vscpp(gq.UserMessage,{priority:900},vscpp(vscppf,null,s)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Bx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`SearchSubagent-${r.id}`})),o&&vscpp(gq.UserMessage,{priority:900},vscpp(vscppf,null,"CRITICAL: Your allotted iterations are finished. Do NOT make any more tool calls. You MUST immediately output your final results using the format described above. If you call any tool instead of responding, your results will be lost and the caller will receive an error. If you are not confident in your results, state what was unclear or incomplete so the caller can narrow down the search or continue from where you left off.")))}};var l$t=10,sXo=new Set(["file_search","grep_search","read_file"]),SXe=class{constructor(){this.allowIterationExtension=!1;this.hideReplyText=!0}static{a(this,"SearchSubagentConfig")}resolveModelFamily(e){return[Tn.ClaudeHaiku45,Tn.Gemini3Flash]}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,maxSearchTurns:l$t,isLastTurn:o.oneBasedIterationNum>l$t};return tp.create(bXe,s,n)}filterTools(e){return e.filter(r=>sXo.has(r.name))}getMaxRounds(){return l$t+1}};p();var LK=fe(xo());var TXe=class extends ar{static{a(this,"RunSubagentPrompt")}renderCopilot(){let{turnContext:e,currentTurn:r,modelConfiguration:n,agentName:o,agentInstruction:s}=this.props,c=WM(r.response?.message,!0),l=eO(c,{ctx:e.ctx,identifier:`Subagent "${o}" Turn ID: ${r.id}`,enableWarnings:!0}),u=(0,LK.useKeepWith)(),d=Rn(r.request.message);return vscpp(vscppf,null,vscpp(LK.SystemMessage,{priority:1e3},vscpp(Jle,null),vscpp("br",null),vscpp("br",null),'You are "',o,'", a specialized agent. Follow your instructions carefully and complete the assigned task.',s&&vscpp(vscppf,null,vscpp("br",null),vscpp("br",null),s),vscpp("br",null),vscpp("br",null),"When you complete your task, provide a clear, concise summary of what you accomplished. Do not include unnecessary preamble."),vscpp(LK.UserMessage,{priority:950},vscpp(Hn,{name:"environment_info"},vscpp(aq,{ctx:e.ctx})),vscpp(Hn,{name:"workspace_info"},vscpp(cq,{ctx:e.ctx,workspaceFolders:r.workspaceFolders}))),vscpp(LK.UserMessage,{priority:900},vscpp(vscppf,null,d)),l.length>0&&vscpp(u,{priority:899,flexGrow:2},vscpp(Bx,{assistantRounds:l,ctx:e.ctx,truncateAt:Math.floor(n.maxRequestTokens/2),modelConfiguration:n,isHistorical:!1,identifier:`Subagent-${o}-${r.id}`})))}};var u$t=class{constructor(e){this.agentConfig=e}static{a(this,"DefaultSubagentConfig")}createPromptRenderer(e,r,n,o){let s={turnContext:e,currentTurn:e.turn,modelConfiguration:n,agentName:this.agentConfig.name,agentInstruction:this.agentConfig.instruction};return tp.create(TXe,s,n)}};function Axn(t){return t.isBuiltIn&&t.name==="Search"?new SXe:new u$t(t)}a(Axn,"resolveSubagentConfig");var hue=class extends pu{constructor(){super({name:"run_subagent",displayName:"Run Sub Agent",description:`Launch a new agent to handle complex, multi-step tasks autonomously. The run_subagent tool launches specialized agents that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it. @@ -3256,9 +3287,9 @@ Usage notes: - Always include a short description (3-5 words) summarizing what the agent will do. - Provide clear, detailed prompts so the agent can work autonomously and return exactly the information you need. - Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, etc.), since it is not aware of the user's intent. -- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:S.Object({task:S.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:S.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:S.Optional(S.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new Zle}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await Jc(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",Bm(r.ctx,"runSubagentTool.error",l),MI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",Bm(r.ctx,"runSubagentTool.error",l),MI(r.ctx,"runSubagentTool.error",l),new Or([new wr(`Agent '${c}' is not available for model invocation`)],"error");u=oxn(d);let f=new xXe(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(vc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});ht(r.ctx,"runSubagentTool.success",y),MI(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": +- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.`,displayDescription:"Delegate work to a specialized agent.",inputSchema:S.Object({task:S.String({description:"A detailed description of the task for the agent to perform. Should be clear and specific about what the agent should accomplish."}),agentName:S.String({description:"The name of the agent to invoke. Must be one of the exact agent names from the available agents list. Do not make up agent names."}),description:S.Optional(S.String({description:"A short (3-5 word) summary of what the agent will do, shown to the user as a progress message."}))})});this.registry=new Yle}static{a(this,"RunSubagentTool")}async invoke(r,n,o){let{task:s,agentName:c}=n.input,l=await Kc(r.ctx,r),u;try{let d=await this.registry.getAgent(r,c);if(d?.isBuiltIn?l.properties.mode=d.name:l.properties.mode="custom",!d)return l.properties.message="Custom agent not found",Fm(r.ctx,"runSubagentTool.error",l),PI(r.ctx,"runSubagentTool.error",l),new Br([new Rr(`Custom agent '${c}' not found`)],"error");if(!d.invokePolicy.includes("model"))return l.properties.message="Agent model invocation disabled",Fm(r.ctx,"runSubagentTool.error",l),PI(r.ctx,"runSubagentTool.error",l),new Br([new Rr(`Agent '${c}' is not available for model invocation`)],"error");u=Axn(d);let f=new CXe(d,u),h={task:s,needToolCallConfirmation:r.turn.needToolCallConfirmation},g=r.ctx.get(vc).getCurrentHandler(r.conversation),A=await f.invoke(r,h,g,o),y=l.extendedBy({modelId:r.turn.getResolvedModelId()??"unknown",modelFamily:r.turn.getResolvedModelFamily()??"unknown"});yt(r.ctx,"runSubagentTool.success",y),PI(r.ctx,"runSubagentTool.success",y);let E=`This is what has been accomplished by Custom Agent "${c}": -${A.response}`,_=new Or([new wr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof D3?(l.properties.message="Tool call round exceed",Bm(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",T9e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Or([new wr(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var $K=new ge("applyPatchTool"),res=`Use the \`apply_patch\` tool to edit files. +${A.response}`,_=new Br([new Rr(E)],"success");return _.subagentConversationId=A.conversationId,_.subagentTurnId=A.turnId,_}catch(d){let f="";return d instanceof I3?(l.properties.message="Tool call round exceed",Fm(r.ctx,"runSubagentTool.error",l),u?.allowIterationExtension===!1?f=`Agent "${c}" reached its iteration limit and may have returned partial results. Use whatever information was gathered and continue the task yourself.`:f=`Custom Agent "${c}" reached the maximum number of tool calls. The agent may have made partial progress. Break down the task into smaller steps or rephrase your request and try again before you finish the task by yourself. Explain this error and suggest the user to increase the tool request limit in settings before continue.`):f=d instanceof Error?`Error invoking custom agent: ${d.message}`:"An unknown error occurred while invoking the custom agent",f9e(r.ctx,"runSubagentTool.error",d,l.extendedBy({message:f})),new Br([new Rr(f)],"error")}}prepareInvocation(r,n){let{agentName:o,task:s,description:c}=r.input,l=c||`${s.substring(0,50)}${s.length>50?"...":""}`;return{progressMessage:`${o}: ${l}`}}prepareCompletion(r,n){let{agentName:o}=r.input;return{completionMessage:`Custom agent "${o}" finished execution`}}};p();var FK=new Ae("applyPatchTool"),aXo=`Use the \`apply_patch\` tool to edit files. Your patch language is a stripped-down, file-oriented diff format designed to be easy to parse and safe to apply. You can think of it as a high-level envelope: *** Begin Patch @@ -3327,7 +3358,7 @@ It is important to remember: - Delete File is NOT supported. - You must include a header with your intended action (Add/Update) - You must prefix new lines with \`+\` even when creating a new file -- File references must be ABSOLUTE, NEVER RELATIVE.`,PXe=class extends hu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:res,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Or([new wr("Missing patch text")],"error");let c=OTn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return $K.warn(e.ctx,h),new Or([new wr(h)],"error")}let l=MK(o),u=aue(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return $K.warn(e.ctx,h),new Or([new wr(h)],"error")}let f={};try{$K.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof sue)return $K.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof yO)return $K.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Or([new wr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof Wh)return $K.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Or([new wr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return $K.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Or([new wr(m)],"error")}}async buildCommit(e,r,n,o){return BTn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=Ju(c,n.uriSchemeCache),d=await n.ctx.get(Jn).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new Wh(`File not found: ${c}`);if(d.status==="invalid")throw new Wh(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: +- File references must be ABSOLUTE, NEVER RELATIVE.`,IXe=class extends pu{static{a(this,"ApplyPatchTool")}constructor(){super({name:"apply_patch",displayName:"Apply Patch",description:aXo,displayDescription:"Apply a patch to edit a single file in the workspace.",inputSchema:S.Object({input:S.String({description:"The patch content following the apply_patch format specification."}),explanation:S.String({description:"A brief explanation of what the patch accomplishes."}),filePath:S.String({description:"The absolute path of the file for apply_patch tool to edit."})})})}async invoke(e,r,n){let{input:o,explanation:s}=r.input;if(!o)return new Br([new Rr("Missing patch text")],"error");let c=WTn(o);if(c.length>0){let h=`Delete file operation is not supported. Files attempted to delete: ${c.join(", ")}. Please use other methods to delete files.`;return FK.warn(e.ctx,h),new Br([new Rr(h)],"error")}let l=xK(o),u=iue(o),d=[...new Set([...l,...u])];if(d.length>1){let h=`Each apply_patch call can only operate on one file. Found ${d.length} files: ${d.join(", ")}. Please use separate apply_patch tool calls for each file.`;return FK.warn(e.ctx,h),new Br([new Rr(h)],"error")}let f={};try{FK.debug(e.ctx,`Start to process apply_patch with explanation: ${s}`);let h=await this.buildCommit(o,f,e,n);return await this.applyCommit(e,r,h,n)}catch(h){if(h instanceof nue)return FK.warn(e.ctx,`Apply patch failed with InvalidContextError: ${h.message}, kind: ${h.kindForTelemetry}`),new Br([new Rr(`Applying patch failed: ${h.message}`)],"error");if(h instanceof fO)return FK.warn(e.ctx,`Apply patch failed with InvalidPatchFormatError: ${h.message}, kind: ${h.kindForTelemetry}`),new Br([new Rr(`Invalid patch format: ${h.message}`)],"error");if(h instanceof Yh)return FK.warn(e.ctx,`Apply patch failed with DiffError: ${h.message}`),new Br([new Rr(`Applying patch failed: ${h.message}`)],"error");let m=h instanceof Error?h.message:"An unknown error occurred";return FK.error(e.ctx,`Apply patch failed with unexpected error: ${m}`),new Br([new Rr(m)],"error")}}async buildCommit(e,r,n,o){return zTn(e,a(async c=>{if(o.isCancellationRequested)throw new Error("Operation cancelled");let l=Ju(c,n.uriSchemeCache),d=await n.ctx.get(ri).getOrReadTextDocument({uri:l});if(d.status==="notfound")throw new Yh(`File not found: ${c}`);if(d.status==="invalid")throw new Yh(`Invalid file: ${c}. Reason: ${d.reason}`);let f=d.document.getText();return r[c]={text:f},{getText:a(()=>f,"getText"),languageId:d.document.detectedLanguageId}},"openFn"))}async applyCommit(e,r,n,o){let s=[],c=[],l=[];for(let[f,h]of Object.entries(n.changes)){if(o.isCancellationRequested)throw new Error("Operation cancelled");switch(h.type){case"add":{let m=await this.invokeClientCreateFileTool(e,r,f,h.newContent??"",o);if(m.status!=="success")return m;c.push(f);break}case"delete":{l.push(f);break}case"update":{let m=h.movePath??f,g=await this.invokeClientEditFileTool(e,r,m,h.newContent??"",r.input.explanation,o);if(g.status!=="success")return g;s.push(m);break}}}let u=[];s.length>0&&u.push(`Edited files: ${s.map(f=>` - ${f}`).join(` `)}`),c.length>0&&u.push(`Created files: ${c.map(f=>` - ${f}`).join(` @@ -3335,7 +3366,7 @@ ${c.map(f=>` - ${f}`).join(` ${l.map(f=>` - ${f}`).join(` `)}`);let d=u.length>0?u.join(` -`):"No changes were applied.";return new Or([new wr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(us).getToolByNameAndProvider("create_file",$f);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(us).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=MK(n.input),s=aue(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return yA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=MK(n.input),s=aue(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return yA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var sxn=require("path");var nes=16,xxe=class extends hu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. +`):"No changes were applied.";return new Br([new Rr(d)],"success")}async invokeClientEditFileTool(e,r,n,o,s,c){let l=e.ctx.get(ls).getToolByNameAndProvider("insert_edit_into_file",Jf);if(!l)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ls).invokeTool(e,l.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,code:o,explanation:s},roundId:r.roundId,toolCallId:r.toolCallId},c)}async invokeClientCreateFileTool(e,r,n,o,s){let c=e.ctx.get(ls).getToolByNameAndProvider("create_file",Jf);if(!c)throw new Error("Client tool create_file is not registered");return e.ctx.get(ls).invokeTool(e,c.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:n,content:o},roundId:r.roundId,toolCallId:r.toolCallId},s)}prepareInvocation(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{progressMessage:"Running apply_patch tool"};let o=xK(n.input),s=iue(n.input),c=[...o,...s];return c.length>0?{progressMessage:`Editing ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return CA(d)}).join(", ")} with apply_patch tool`}:{progressMessage:"Running apply_patch tool"}}prepareCompletion(e,r){let{input:n}=e;if(!n.input||!n.input.length)return{completionMessage:"Ran apply_patch tool"};let o=xK(n.input),s=iue(n.input),c=[...o,...s];return c.length>0?{completionMessage:`Edited ${c.map(u=>{let d=Ju(u,e.uriSchemeCache);return CA(d)}).join(", ")} with apply_patch tool`}:{completionMessage:"Ran apply_patch tool"}}static toApplyPatchParams(e){if(typeof e.input!="string")throw new Error("input must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");if(typeof e.filePath!="string")throw new Error("filePath must be a string");return{input:e.input,explanation:e.explanation,filePath:e.filePath}}};p();var yxn=require("path");var cXo=16,hxe=class extends pu{static{a(this,"CodebaseTool")}constructor(){super({name:"semantic_search",displayName:"Codebase",description:`Semantic search that finds code by meaning, not exact text. Returns relevant code snippets from the user's workspace. When to Use: - Explore unfamiliar codebases @@ -3354,37 +3385,37 @@ Search Strategy: Query Guidelines: - Use keywords that likely appear in code: function names, class names, variable names, error types, package names -- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:S.Object({query:S.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:S.Optional(S.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(kP),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:h_n,maxResults:r.input.maxResults??nes,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Or([new wr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=Wn(f.chunk.file),m=pA(f.chunk.text);return new wr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: +- AVOID generic words like "return", "code", "function", "method"`,displayDescription:"Find relevant file chunks, symbols, and other information in your codebase",inputSchema:S.Object({query:S.String({description:'The query keywords to search the codebase for, each keyword separated with space, like: "email message DNS_NAME". IMPORTANT: Use keywords that likely appear in code, such as: exact function names, class names, variable names, error types, package names, or domain-specific technical terms. AVOID generic words like "return", "code", "function", "method" and so on. The more specific your keywords, the better the search results.'}),maxResults:S.Optional(S.Number({description:"Maximum number of code chunks to return. Default is 16. Usually no need to change. Only increase when initial results are insufficient and broader context is required.",minimum:1,maximum:128}))})})}async invoke(e,r,n){if(!r.input.query)throw new Error("Invalid input");let o=e.ctx.get(wk),s=[];if(e.turn.workspaceFolder&&s.push(e.turn.workspaceFolder.uri),e.turn.workspaceFolders)for(let f of e.turn.workspaceFolders)s.includes(f.uri)||s.push(f.uri);let c=r.input.query,l=await o.searchWorkspace({rawQuery:c,resolveQueryAndKeywords:a(async()=>Promise.resolve({rephrasedQuery:c,keywords:this.getKeywordsForContent(c)}),"resolveQueryAndKeywords"),resolveQuery:a(async()=>Promise.resolve(c),"resolveQuery")},{tokenBudget:aCn,maxResults:r.input.maxResults??cXo,workspaceFolders:s,source:"codebaseTool"},n);if(l.chunks.length===0)return new Br([new Rr("No relevant code found")],"success");let u=l.chunks.map(f=>{let h=kn(f.chunk.file),m=yA(f.chunk.text);return new Rr(`Here is a potentially relevant text excerpt in \`${h}\` starting at line ${f.chunk.range.startLineNumber-1}: ${m} ${f.chunk.text} -${m}`)}),d=new hQ(u,"success");return d.toolResultMessage=u.length===0?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", no results`:u.length===1?`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", 1 result`:`Searched ${this.getDisplaySearchTarget(r.input)} for "${r.input.query}", ${u.length} results`,d.toolResultDetails=l.chunks.map(f=>({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,sxn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(jL(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(Mn).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var DXe=class extends hu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(us).getToolByNameAndProvider("create_file",$f);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(us).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=DM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=hO(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new gO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Or([new wr(c.join(` -`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${yA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${yA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();Ns();function VK(){return gr()}a(VK,"uuidV4");p();var Wp={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function lxn(t){let e=[],r=[],n=[],o,s;for(let c of ies(t))switch(c.marker){case void 0:r=c.content;break;case Wp.FILEPATH:o=c.content.join(` -`).trim();break;case Wp.FIND:s=axn(c.content);break;case Wp.REPLACE:if(o&&s){let l=axn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case Wp.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(lxn,"parsePatchResponse");function axn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(axn,"extractCodeBlock");function*ies(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(Wp.FILEPATH)?s=Wp.FILEPATH:o.startsWith(Wp.FIND)?s=Wp.FIND:o.startsWith(Wp.REPLACE)?s=Wp.REPLACE:o.startsWith(Wp.COMPLETE)?s=Wp.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(ies,"iterateSections");function oes(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=ses(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=wxe(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=wxe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=ces(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` -`)}a(oes,"applyPatch");function ses(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&uxn(t.charCodeAt(n));)n--;return n<0}a(cxn,"endsWith");function aes(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=dxn(u,n),h=f;if(hs&&NXe(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(ces,"adjustIndentation");function fxn(t,e){let r=t;for(let n of e){let o=oes(r,n);o!==void 0&&(r=o)}return r}a(fxn,"applyPatches");p();var les="InstantApplyChat";function ues(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(ues,"isProxyModel");function des(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(ues):[]}a(des,"parseProxyModels");var bq=class{constructor(e){this.ctx=e;this.logger=new ge("ProxyModelService");this.models=[];Es(e,n=>{this.fetchModels(n)});let r=e.get(Qt).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===les)}async fetchModels(e){try{let r=LI(this.ctx,e,"proxy","models"),n=await this.ctx.get(ar).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...by(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=des(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var MXe=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var eE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var WK=ce(wo());var yue=class extends sr{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=pA(d),g=pA(o);return vscpp(vscppf,null,vscpp(WK.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",_A," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(WK.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(jn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(jn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(WK.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(WK.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var BXe=ce(wo());var e$t=class extends sr{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",Wp.FILEPATH,"`, `",Wp.FIND,"` and `",Wp.REPLACE,"`.",vscpp("br",null),"After ",Wp.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",Wp.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",Wp.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",Wp.COMPLETE,".",vscpp("br",null))}},OXe=class extends sr{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=pA(u),h=pA(o),m=ho(this.props.uri);return vscpp(vscppf,null,vscpp(BXe.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",_A,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(e$t,null),vscpp("br",null),vscpp(MZe,null),vscpp(jn,{name:"example"},vscpp(jn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(jn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(BXe.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${Wp.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(jn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(jn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var hc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Oc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Oc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Oc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,Hce)}static subtract(e,r){return r?e.startLineNumberr)throw new Oc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=FY(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=A6t(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=A6t(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Ql(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=SWe(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=FY(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Ql(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var SO=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` -`?(r++,n=0):n++;return new t(r,n)}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Fi(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Fi(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Fi(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Ql.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new Wo(e.lineNumber,e.column+this.columnCount):new Wo(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Fi.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var Rxe=class{constructor(e){this.text=e;this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let r=0;r0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new hc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=FY(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new Wo(n,o)}getRange(e){return Fi.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return SO.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new SO(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var t$t=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new Wo(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Fi(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new Rxe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Fi(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return Uze(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var L3=class extends t$t{constructor(r){super();this.value=r;this._t=new Rxe(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var kxe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Oc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(hc.emptyAt(h),new hc(0,m));s.push(E)}if(!f)throw new Oc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(hc.ofStartAndLength(f.replaceRange.endExclusive,0),new hc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new hc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new hc(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new hc(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(hc.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return MTe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new hc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},pxn=class t extends kxe{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var UXe=class extends kxe{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(CA.replace(hc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new U_(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new U_(r)}normalizeEOL(e){return new U_(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=CA.replace(hc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?U_.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new L3(this.apply(e.value))}mapData(e){return new r$t(this.replacements.map(r=>new Eue(r.replaceRange,r.newText,e(r))))}},QXe=class extends FXe{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=sle(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,oIe(n,this.newText)),c=new hc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new CA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new CA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=sle(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new hc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=oIe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new hc(0,this.newText.length-o))}toEdit(){return new U_([this])}},U_=class t extends UXe{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new CA(e,r)])}static insert(e,r){return new t([new CA(hc.emptyAt(e),r)])}static delete(e){return new t([new CA(e,"")])}static fromJson(e){return new t(e.map(CA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew CA(e.replaceRange,e.newText)))}},Eue=class t extends QXe{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(hc.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var Pxe=class t{constructor(e){this.replacements=e;hUt(()=>lIe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>tE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new tE(e,r)])}static insert(e,r){return new t([new tE(Fi.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new tE(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=SO.ofText(s.text);if(e.isBefore(l)){let d=new Wo(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return qXe(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new Wo(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof Wo?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof Wo?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return qXe(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new Wo(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=qXe(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=qXe(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new L3(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new tE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=SO.ofText(s.text),l=Wo.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Oc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` -`):typeof e=="string"?this.toString(new L3(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Fi.fromPositions(new Wo(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Fi.fromPositions(r.range.getEndPosition(),new Wo(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` -`)}},tE=class t{constructor(e,r){this.range=e;this.text=r}static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Oc;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;c({type:"fileLocation",value:{uri:f.chunk.file,range:{start:{line:f.chunk.range.startLineNumber,character:f.chunk.range.startColumn},end:{line:f.chunk.range.endLineNumber,character:f.chunk.range.endColumn}}}})),d}prepareInvocation(e,r){return{progressMessage:`Searching ${this.getDisplaySearchTarget(e.input)} for "${e.input.query}"`}}getDisplaySearchTarget(e){let r;return e.scopedDirectories&&e.scopedDirectories.length===1?r=`${(0,yxn.basename)(e.scopedDirectories[0])}`:e.scopedDirectories&&e.scopedDirectories.length>1?r=`${e.scopedDirectories.length} directories`:r="codebase",r}isEnabled(e){if(ZP(e.ctx))return Promise.resolve(!1);let r=e.ctx.get(On).getCapabilities();return Promise.resolve(!!r.watchedFiles)}getKeywordsForContent(e){let r=new Set;for(let n of e.matchAll(/(-?\d*\.\d\w*)|([^`~!@#%^&*()\-=+[{\]}\\|;:'",.<>/?\s]+)/g))r.add(n[0]);return Array.from(r.values(),n=>({keyword:n,variations:[]}))}};p();var xXe=class extends pu{static{a(this,"CreateFileTool")}constructor(){super({name:"create_file",displayName:"Create File",description:"Create a new file in the workspace with the specified content. Use this tool to create new files.",displayDescription:"Create a new file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})}async invoke(e,r,n){try{let o=await this.invokeClientCreateFileTool(e,r,n);return this.getFinalCreateFileResult(e,r,o)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Rr(s)],"error")}}async invokeClientCreateFileTool(e,r,n){let o=e.ctx.get(ls).getToolByNameAndProvider("create_file",Jf);if(!o)throw new Error("Client tool create_file is not registered");return e.ctx.get(ls).invokeTool(e,o.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,content:r.input.content},roundId:r.roundId,toolCallId:r.toolCallId},n)}getFinalCreateFileResult(e,r,n){if(n.status!=="success")return n;let o=BM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"}),s=cO(n.content),c=[];c.push(``),c.push("This is the new file that was created. You can reference this file in future operations.");let l=new uO({code:s,languageId:o,noFilePath:!0});return c.push(...l.renderAsArray()),c.push(""),new Br([new Rr(c.join(` +`))],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Creating ${CA(o)}`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran create_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Created ${CA(o)}`}}static toCreateFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.content!="string")throw new Error("content must be a string");return{filePath:e.filePath,content:e.content}}};p();p();p();As();function UK(){return ir()}a(UK,"uuidV4");p();var Kp={FILEPATH:"---FILEPATH",FIND:"---FIND",REPLACE:"---REPLACE",COMPLETE:"---COMPLETE"};function vxn(t){let e=[],r=[],n=[],o,s;for(let c of lXo(t))switch(c.marker){case void 0:r=c.content;break;case Kp.FILEPATH:o=c.content.join(` +`).trim();break;case Kp.FIND:s=Exn(c.content);break;case Kp.REPLACE:if(o&&s){let l=Exn(c.content);e.push({filePath:o,find:s,replace:l})}o=void 0,s=void 0;break;case Kp.COMPLETE:n=c.content;break}return{patches:e,contentBefore:r,contentAfter:n}}a(vxn,"parsePatchResponse");function Exn(t){if(t.length===0)return[""];let e=[],r=!1,n=0,o=!1,s=/^(`{3,})/;for(let c of t){let l=c.match(s);if(l&&!r)n=l[1].length,r=!0;else if(r){let u=c.match(s);if(u&&u[1].length>=n){o=!0;break}e.push(c)}}return o?e:t}a(Exn,"extractCodeBlock");function*lXo(t){let e=t.split(/\r?\n/),r,n=[];for(let o of e){let s;if(o.startsWith("---")){o.startsWith(Kp.FILEPATH)?s=Kp.FILEPATH:o.startsWith(Kp.FIND)?s=Kp.FIND:o.startsWith(Kp.REPLACE)?s=Kp.REPLACE:o.startsWith(Kp.COMPLETE)?s=Kp.COMPLETE:s=o,yield{marker:r,content:n},n=[o.substring(s.length)],r=s;continue}n.push(o)}yield{marker:r,content:n}}a(lXo,"iterateSections");function uXo(t,e){let r=t.split(/\r?\n/),{find:n,replace:o}=e;if(n.length===0)return;let s=dXo(r,n);if(s===void 0)return;let{startIndex:c,endIndex:l,indentLevel:u,indentCharCount:d}=s,f="";if(d>0)for(let E=c;E<=l;E++){let _=r[E],v=mxe(_);if(v===d&&v<_.length){f=_.substring(0,d);break}}let h=!1;for(let E=c;E<=l&&!h;E++){let _=r[E];if(/^\s*\/\*|^\s*\*/.test(_))continue;let v=mxe(_);if(v>0&&v<_.length){h=_.substring(0,v).indexOf(" ")!==-1;break}}let m=pXo(o,u,f,h),g=r.slice(0,c),A=r.slice(l+1);return[...g,...m,...A].join(` +`)}a(uXo,"applyPatch");function dXo(t,e,r=4){if(e.length===0)return;let n=0;for(;n=0&&o>=r&&t.charCodeAt(n)===e.charCodeAt(o);)n--,o--;if(o>=r)return!1;for(;n>=0&&Cxn(t.charCodeAt(n));)n--;return n<0}a(_xn,"endsWith");function fXo(t,e,r,n=4){let o=Number.MAX_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER,c=0;for(let l=e;l<=r;l++){let u=t[l],{level:d,length:f}=bxn(u,n),h=f;if(hs&&wXe(t[c-1]);)c--;if(s===c)return[];let l=Number.MAX_SAFE_INTEGER,u=[];for(let f=s;f0)if(m===l)y=r;else{let E=m-l;n?y=r+" ".repeat(E):y=r+" ".repeat(o*E)}else n?y=" ".repeat(A):y=" ".repeat(o*A);d.push(y+h.substring(g))}}return d}a(pXo,"adjustIndentation");function Sxn(t,e){let r=t;for(let n of e){let o=uXo(r,n);o!==void 0&&(r=o)}return r}a(Sxn,"applyPatches");p();var hXo="InstantApplyChat";function mXo(t){return typeof t=="object"&&t!==null&&typeof t.serviceType=="string"&&typeof t.name=="string"&&typeof t.provider=="string"&&typeof t.capabilities=="object"&&t.capabilities!==null&&typeof t.capabilities.promptStrategy=="string"}a(mXo,"isProxyModel");function gXo(t){if(typeof t!="object"||t===null)return[];let e=t;return Array.isArray(e.models)?e.models.filter(mXo):[]}a(gXo,"parseProxyModels");var Aq=class{constructor(e){this.ctx=e;this.logger=new Ae("ProxyModelService");this.models=[];ys(e,n=>{this.fetchModels(n)});let r=e.get(Ut).getLastToken();r&&this.fetchModels(r)}static{a(this,"ProxyModelService")}get instantApplyModels(){return this.models.filter(e=>e.serviceType===hXo)}async fetchModels(e){try{let r=NI(this.ctx,e,"proxy","models"),n=await this.ctx.get(cr).fetch(r,{method:"GET",headers:{Authorization:`Bearer ${e.token}`,...xy(this.ctx)}});if(!n.ok){this.logger.error(this.ctx,`Failed to fetch proxy models: ${n.status} ${n.statusText}`);return}let o=await n.json();this.logger.debug(this.ctx,`Proxy models response body: ${JSON.stringify(o)}`);let s=gXo(o);this.models=s,this.logger.debug(this.ctx,`Fetched ${s.length} proxy models, ${this.instantApplyModels.length} instant-apply`)}catch(r){this.logger.exception(this.ctx,r,"Failed to fetch proxy models")}}};p();var RXe=class extends Error{static{a(this,"CopilotEditsCancelledByUserException")}constructor(){super("Operation cancelled by user"),this.name="CopilotEditsCancelledByUserException"}};p();var tE=class extends Error{static{a(this,"CopilotEditsProcessCodeBlockException")}constructor(e){super(e),this.name="CopilotEditsProcessCodeBlockException"}};p();var QK=fe(xo());var mue=class extends ar{static{a(this,"CodeMapperFullRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s,inProgressRewriteContent:c}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let l=n.document,u=l.detectedLanguageId,d=l.getText(),f=l.lineCount,h=d.trim().length>0,m=yA(d),g=yA(o);return vscpp(vscppf,null,vscpp(QK.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"Follow Microsoft content policies.",vscpp("br",null),"Avoid content that violates copyrights.",vscpp("br",null),`If you are asked to generate content that is harmful, hateful, racist, sexist, lewd, violent, or completely irrelevant to software engineering, only respond with "Sorry, I can't assist with that."`,vscpp("br",null),"Keep your answers short and impersonal.",vscpp("br",null),"The user has a code block that represents a suggestion for a code change and a ",u," file opened in a code editor.",vscpp("br",null),"Rewrite the existing document to fully incorporate the code changes in the provided code block.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block and the existing document to decide if the code block should replace existing code or should be inserted.",vscpp("br",null),"2. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"3. Preserve whitespace and newlines right after the parts of the file that you modify.",vscpp("br",null),"4. The final result must be syntactically valid, properly formatted, and correctly indented. It should not contain any ",bA," comments.",vscpp("br",null),"5. Finally, provide the fully rewritten file. You must output the complete file.",vscpp("br",null)),vscpp(QK.UserMessage,{priority:700},h?vscpp(vscppf,null,"I have the following code open in the editor, starting from line 1 to line ",f,".",vscpp("br",null),vscpp(vscppf,null,m,u,vscpp("br",null),d,vscpp("br",null),m),vscpp("br",null)):vscpp(vscppf,null,"I am in an empty editor.",vscpp("br",null)),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,g,u,vscpp("br",null),o,vscpp("br",null),g),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Provide the fully rewritten file, incorporating the suggested code change. You must produce the complete file."))),c&&vscpp(vscppf,null,vscpp(QK.AssistantMessage,{priority:800},vscpp(vscppf,null,c)),vscpp(QK.UserMessage,{priority:900},vscpp(vscppf,null,"Please continue providing the next part of the response."))))}};p();var kXe=fe(xo());var d$t=class extends ar{static{a(this,"PatchEditRules")}renderCopilot(){return vscpp(vscppf,null,"When proposing a code change, provide one or more modifications in the following format:",vscpp("br",null),"Each modification consist of three sections headed by `",Kp.FILEPATH,"`, `",Kp.FIND,"` and `",Kp.REPLACE,"`.",vscpp("br",null),"After ",Kp.FILEPATH," add the path to the file that needs to be changed.",vscpp("br",null),"After ",Kp.FIND," add a code block containing a section of the program that will be replaced.",vscpp("br",null),"Add multiple lines so that a find tool can find and identify a section of the program. Start and end with a line that will not be modified. ",vscpp("br",null),"Include all comments and empty lines exactly as they appear in the original source code. Do not abbreviate any line or summarize the code with `...`. ",vscpp("br",null),"After ",Kp.REPLACE," add a code block with the updated version of the original code in the find section. Maintain the same indentation and code style as in the original code.",vscpp("br",null),"After all modifications, add ",Kp.COMPLETE,".",vscpp("br",null))}},PXe=class extends ar{static{a(this,"CodeMapperPatchRewritePrompt")}renderCopilot(e,r){let{existingDocument:n,codeBlock:o,markdownBeforeBlock:s}=this.props;if(n.status!=="valid")return vscpp(vscppf,null);let c=n.document,l=c.detectedLanguageId,u=c.getText(),d=c.lineCount,f=yA(u),h=yA(o),m=Ko(this.props.uri);return vscpp(vscppf,null,vscpp(kXe.SystemMessage,{priority:1e3},"You are an AI programming assistant that is specialized in applying code changes to an existing document.",vscpp("br",null),"I have a code block that represents a suggestion for a code change and I have a ",l," ","file opened in a code editor.",vscpp("br",null),"I expect you to come up with code changes that apply the code block to the editor.",vscpp("br",null),"I want the changes to be applied in a way that is safe and does not break the existing code, is correctly indented and matching the code style.",vscpp("br",null),"For the response, always follow these instructions:",vscpp("br",null),"1. Analyze the code block, the content of the editor and the current selection to decide if the code block should replace existing code or is to be inserted.",vscpp("br",null),"2. A line comment with `",bA,"` indicates a section of code that has not changed.",vscpp("br",null),"3. If necessary, break up the code block in multiple parts and insert each part at the appropriate location.",vscpp("br",null),"4. If necessary, make changes to other parts in the editor so that the final result is valid, properly formatted and indented.",vscpp("br",null),"5. Finally, provide the code modifications",vscpp("br",null),vscpp(d$t,null),vscpp("br",null),vscpp(RZe,null),vscpp(Hn,{name:"example"},vscpp(Hn,{name:"user"},vscpp(vscppf,null,"I have the following code open in the editor.",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"```typescript",vscpp("br",null),"import ","{ readFileSync }"," from 'fs';",vscpp("br",null),vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"This is the code block that represents a suggestion for a code change:",vscpp("br",null),"```typescript",vscpp("br",null),"private _stream: Stream;",vscpp("br",null),"```",vscpp("br",null),"Please find out how the code block can be applied to the editor.")),vscpp(Hn,{name:"assistant"},vscpp(vscppf,null,"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),"import { readFileSync } from 'fs';",vscpp("br",null),"import { Stream } from 'stream';",vscpp("br",null),"```",vscpp("br",null),"---FILEPATH \\someFolder\\myFile.ts",vscpp("br",null),"---FIND",vscpp("br",null),"```",vscpp("br",null),"class C ","{ }",vscpp("br",null),"```",vscpp("br",null),"---REPLACE",vscpp("br",null),"```",vscpp("br",null),'class C {"{"}',vscpp("br",null)," private _stream: Stream;",vscpp("br",null),"}",vscpp("br",null),"```",vscpp("br",null),"---COMPLETE"))),vscpp("br",null)),vscpp(kXe.UserMessage,{priority:700},"I have the following code open in the editor, starting from line 1 to line ",d,".",vscpp("br",null),m?`${Kp.FILEPATH} ${m}`:"",vscpp("br",null),vscpp(vscppf,null,f,l,vscpp("br",null),u,vscpp("br",null),f),vscpp("br",null),s&&vscpp(vscppf,null,"This is the description of what the code block changes:",vscpp("br",null),vscpp(Hn,{name:"changeDescription"},vscpp(vscppf,null,s)),vscpp("br",null)),"This is the code block that represents the suggested code change:",vscpp("br",null),vscpp(vscppf,null,h,l,vscpp("br",null),o,vscpp("br",null),h),vscpp("br",null),vscpp(Hn,{name:"userPrompt"},vscpp(vscppf,null,"Please find out how the code block can be applied to the editor. Provide the code changes in the format as described above."))))}};p();p();p();p();p();p();var hc=class t{constructor(e,r){this.start=e;this.endExclusive=r;if(e>r)throw new Nc(`Invalid range: ${this.toString()}`)}static{a(this,"OffsetRange")}static fromTo(e,r){return new t(e,r)}static addRange(e,r){let n=0;for(;nr))return new t(e,r)}static ofLength(e){return new t(0,e)}static ofStartAndLength(e,r){return new t(e,e+r)}static emptyAt(e){return new t(e,e)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new t(this.start+e,this.endExclusive+e)}deltaStart(e){return new t(this.start+e,this.endExclusive)}deltaEnd(e){return new t(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Nc(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Nc(`Invalid clipping range: ${this.toString()}`);return e=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){let r=[];for(let n=this.start;ne.startLineNumber,rle)}static subtract(e,r){return r?e.startLineNumberr)throw new Nc(`startLineNumber ${e} cannot be after endLineNumberExclusive ${r}`);this.startLineNumber=e,this.endLineNumberExclusive=r}contains(e){return this.startLineNumber<=e&&eo.endLineNumberExclusive>=e.startLineNumber),n=KY(this._normalizedRanges,o=>o.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)this._normalizedRanges.splice(r,0,e);else if(r===n-1){let o=this._normalizedRanges[r];this._normalizedRanges[r]=o.join(e)}else{let o=this._normalizedRanges[r].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(r,n-r,o)}}contains(e){let r=v7t(this._normalizedRanges,n=>n.startLineNumber<=e);return!!r&&r.endLineNumberExclusive>e}intersects(e){let r=v7t(this._normalizedRanges,n=>n.startLineNumbere.startLineNumber}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;let r=[],n=0,o=0,s=null;for(;n=c.startLineNumber?s=new Ll(s.startLineNumber,Math.max(s.endLineNumberExclusive,c.endLineNumberExclusive)):(r.push(s),s=c)}return s!==null&&r.push(s),new t(r)}subtractFrom(e){let r=zze(this._normalizedRanges,c=>c.endLineNumberExclusive>=e.startLineNumber),n=KY(this._normalizedRanges,c=>c.startLineNumber<=e.endLineNumberExclusive)+1;if(r===n)return new t([e]);let o=[],s=e.startLineNumber;for(let c=r;cs&&o.push(new Ll(s,l.startLineNumber)),s=l.endLineNumberExclusive}return se.toString()).join(", ")}getIntersection(e){let r=[],n=0,o=0;for(;nr.delta(e)))}};var yO=class t{constructor(e,r){this.lineCount=e;this.columnCount=r}static{a(this,"TextLength")}static{this.zero=new t(0,0)}static lengthDiffNonNegative(e,r){return r.isLessThan(e)?t.zero:e.lineCount===r.lineCount?new t(0,r.columnCount-e.columnCount):new t(r.lineCount-e.lineCount,r.columnCount)}static betweenPositions(e,r){return e.lineNumber===r.lineNumber?new t(0,r.column-e.column):new t(r.lineNumber-e.lineNumber,r.column-1)}static fromPosition(e){return new t(e.lineNumber-1,e.column-1)}static ofRange(e){return t.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let r=0,n=0;for(let o of e)o===` +`?(r++,n=0):n++;return new t(r,n)}isZero(){return this.lineCount===0&&this.columnCount===0}isLessThan(e){return this.lineCount!==e.lineCount?this.lineCounte.lineCount:this.columnCount>e.columnCount}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}equals(e){return this.lineCount===e.lineCount&&this.columnCount===e.columnCount}compare(e){return this.lineCount!==e.lineCount?this.lineCount-e.lineCount:this.columnCount-e.columnCount}add(e){return e.lineCount===0?new t(this.lineCount,this.columnCount+e.columnCount):new t(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return this.lineCount===0?new Li(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new Li(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new Li(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return Ll.ofLength(1,this.lineCount)}addToPosition(e){return this.lineCount===0?new $o(e.lineNumber,e.column+this.columnCount):new $o(e.lineNumber+this.lineCount,this.columnCount+1)}addToRange(e){return Li.fromPositions(this.addToPosition(e.getStartPosition()),this.addToPosition(e.getEndPosition()))}toString(){return`${this.lineCount},${this.columnCount}`}};var gxe=class{constructor(e){this.text=e;this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let r=0;r0&&e.charAt(r-1)==="\r"?this.lineEndOffsetByLineIdx.push(r-1):this.lineEndOffsetByLineIdx.push(r));this.lineEndOffsetByLineIdx.push(e.length)}static{a(this,"PositionOffsetTransformer")}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}getOffsetRange(e){return new hc(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getPosition(e){let r=KY(this.lineStartOffsetByLineIdx,s=>s<=e),n=r+1,o=e-this.lineStartOffsetByLineIdx[r]+1;return new $o(n,o)}getRange(e){return Li.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getTextLength(e){return yO.ofRange(this.getRange(e))}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new yO(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}};var f$t=class{constructor(){this._transformer=void 0}static{a(this,"AbstractText")}get endPositionExclusive(){return this.length.addToPosition(new $o(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getLineLength(e){return this.getValueOfRange(new Li(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new gxe(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new Li(e,1,e,Number.MAX_SAFE_INTEGER))}getLines(){let e=this.getValue();return NYe(e)}equals(e){return this===e?!0:this.getValue()===e.getValue()}};var k3=class extends f$t{constructor(r){super();this.value=r;this._t=new gxe(this.value)}static{a(this,"StringText")}getValueOfRange(r){return this._t.getOffsetRange(r).substring(this.value)}get length(){return this._t.textLength}};p();p();p();var Axe=class{constructor(e){this.replacements=e;let r=-1;for(let n of e){if(!(n.replaceRange.start>=r))throw new Nc(`Edits must be disjoint and sorted. Found ${n} after ${r}`);r=n.replaceRange.endExclusive}}static{a(this,"BaseEdit")}equals(e){if(this.replacements.length!==e.replacements.length)return!1;for(let r=0;rr.toString()).join(", ")}]`}normalize(){let e=[],r;for(let n of this.replacements)if(!(n.getNewLength()===0&&n.replaceRange.length===0)){if(r&&r.replaceRange.endExclusive===n.replaceRange.start){let o=r.tryJoinTouching(n);if(o){r=o;continue}}r&&e.push(r),r=n}return r&&e.push(r),this._createNew(e)}compose(e){let r=this.normalize(),n=e.normalize();if(r.isEmpty())return n;if(n.isEmpty())return r;let o=[...r.replacements],s=[],c=0;for(let l of n.replacements){for(;;){let h=o[0];if(!h||h.replaceRange.start+c+h.getNewLength()>=l.replaceRange.start)break;o.shift(),s.push(h),c+=h.getNewLength()-h.replaceRange.length}let u=c,d,f;for(;;){let h=o[0];if(!h||h.replaceRange.start+c>l.replaceRange.endExclusive)break;d||(d=h),f=h,o.shift(),c+=h.getNewLength()-h.replaceRange.length}if(!d)s.push(l.delta(-c));else{let h=Math.min(d.replaceRange.start,l.replaceRange.start-u),m=l.replaceRange.start-(d.replaceRange.start+u);if(m>0){let E=d.slice(hc.emptyAt(h),new hc(0,m));s.push(E)}if(!f)throw new Nc("Invariant violation: lastIntersecting is undefined");let g=f.replaceRange.endExclusive+c-l.replaceRange.endExclusive;if(g>0){let E=f.slice(hc.ofStartAndLength(f.replaceRange.endExclusive,0),new hc(f.getNewLength()-g,f.getNewLength()));o.unshift(E),c-=E.getNewLength()-E.replaceRange.length}let A=new hc(h,l.replaceRange.endExclusive-c),y=l.slice(A,new hc(0,l.getNewLength()));s.push(y)}}for(;;){let l=o.shift();if(!l)break;s.push(l)}return this._createNew(s).normalize()}decomposeSplit(e){let r=[],n=[],o=0;for(let s of this.replacements)e(s)?(r.push(s),o+=s.getNewLength()-s.replaceRange.length):n.push(s.slice(s.replaceRange.delta(o),new hc(0,s.getNewLength())));return{e1:this._createNew(r),e2:this._createNew(n)}}getNewRanges(){let e=[],r=0;for(let n of this.replacements)e.push(hc.ofStartAndLength(n.replaceRange.start+r,n.getNewLength())),r+=n.getLengthDelta();return e}getJoinedReplaceRange(){if(this.replacements.length!==0)return this.replacements[0].replaceRange.join(this.replacements.at(-1).replaceRange)}isEmpty(){return this.replacements.length===0}getLengthDelta(){return eIe(this.replacements,e=>e.getLengthDelta())}getNewDataLength(e){return e+this.getLengthDelta()}applyToOffset(e){let r=0;for(let n of this.replacements)if(n.replaceRange.start<=e){if(e ${this.getNewLength()} }`}get isEmpty(){return this.getNewLength()===0&&this.replaceRange.length===0}getRangeAfterReplace(){return new hc(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}},Txn=class t extends Axe{static{a(this,"Edit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}_createNew(e){return new t(e)}};var MXe=class extends Axe{static{a(this,"BaseStringEdit")}get TReplacement(){throw new Error("TReplacement is not defined for BaseStringEdit")}static composeOrUndefined(e){if(e.length===0)return;let r=e[0];for(let n=1;n" ".repeat(l-c)),o=r.tryRebase(n);if(!o)return;let s=e.tryRebase(o);if(s)return{e1:o,e2:s}}apply(e){let r=[],n=0;for(let o of this.replacements)r.push(e.substring(n,o.replaceRange.start)),r.push(o.newText),n=o.replaceRange.endExclusive;return r.push(e.substring(n)),r.join("")}inverseOnSlice(e){let r=[],n=0;for(let o of this.replacements)r.push(SA.replace(hc.ofStartAndLength(o.replaceRange.start+n,o.newText.length),e(o.replaceRange.start,o.replaceRange.endExclusive))),n+=o.newText.length-o.replaceRange.length;return new L_(r)}inverse(e){return this.inverseOnSlice((r,n)=>e.substring(r,n))}tryRebase(e,r=!0){let n=[],o=0,s=0,c=0;for(;s({txt:e.newText,pos:e.replaceRange.start,len:e.replaceRange.length}))}isNeutralOn(e){return this.replacements.every(r=>r.isNeutralOn(e))}removeCommonSuffixPrefix(e){let r=[];for(let n of this.replacements){let o=n.removeCommonSuffixPrefix(e);o.isEmpty||r.push(o)}return new L_(r)}normalizeEOL(e){return new L_(this.replacements.map(r=>r.normalizeEOL(e)))}normalizeOnSource(e){let r=this.apply(e),o=SA.replace(hc.ofLength(e.length),r).removeCommonSuffixAndPrefix(e);return o.isEmpty?L_.empty:o.toEdit()}removeCommonSuffixAndPrefix(e){return this._createNew(this.replacements.map(r=>r.removeCommonSuffixAndPrefix(e))).normalize()}applyOnText(e){return new k3(this.apply(e.value))}mapData(e){return new p$t(this.replacements.map(r=>new gue(r.replaceRange,r.newText,e(r))))}},OXe=class extends NXe{constructor(r,n){super(r);this.newText=n}static{a(this,"BaseStringReplacement")}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(r){return r.substring(0,this.replaceRange.start)+this.newText+r.substring(this.replaceRange.endExclusive)}isNeutralOn(r){return this.newText===r.substring(this.replaceRange.start,this.replaceRange.endExclusive)}removeCommonSuffixPrefix(r){let n=r.substring(this.replaceRange.start,this.replaceRange.endExclusive),o=mle(n,this.newText),s=Math.min(n.length-o,this.newText.length-o,pIe(n,this.newText)),c=new hc(this.replaceRange.start+o,this.replaceRange.endExclusive-s),l=this.newText.substring(o,this.newText.length-s);return new SA(c,l)}normalizeEOL(r){let n=this.newText.replace(/\r\n|\n/g,r);return new SA(this.replaceRange,n)}removeCommonSuffixAndPrefix(r){return this.removeCommonSuffix(r).removeCommonPrefix(r)}removeCommonPrefix(r){let n=this.replaceRange.substring(r),o=mle(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaStart(o),new hc(o,this.newText.length))}removeCommonSuffix(r){let n=this.replaceRange.substring(r),o=pIe(n,this.newText);return o===0?this:this.slice(this.replaceRange.deltaEnd(-o),new hc(0,this.newText.length-o))}toEdit(){return new L_([this])}},L_=class t extends MXe{static{a(this,"StringEdit")}static{this.empty=new t([])}static create(e){return new t(e)}static single(e){return new t([e])}static replace(e,r){return new t([new SA(e,r)])}static insert(e,r){return new t([new SA(hc.emptyAt(e),r)])}static delete(e){return new t([new SA(e,"")])}static fromJson(e){return new t(e.map(SA.fromJson))}static compose(e){if(e.length===0)return t.empty;let r=e[0];for(let n=1;nnew SA(e.replaceRange,e.newText)))}},gue=class t extends OXe{constructor(r,n,o){super(r,n);this.data=o}static{a(this,"AnnotatedStringReplacement")}static insert(r,n,o){return new t(hc.emptyAt(r),n,o)}static replace(r,n,o){return new t(r,n,o)}static delete(r,n){return new t(r,"",n)}equals(r){return this.replaceRange.equals(r.replaceRange)&&this.newText===r.newText&&this.data===r.data}tryJoinTouching(r){let n=this.data.join(r.data);if(n!==void 0)return new t(this.replaceRange.joinRightTouching(r.replaceRange),this.newText+r.newText,n)}slice(r,n){return new t(r,n?n.substring(this.newText):this.newText,this.data)}};p();var yxe=class t{constructor(e){this.replacements=e;xQt(()=>AIe(e,(r,n)=>r.range.getEndPosition().isBeforeOrEqual(n.range.getStartPosition())))}static{a(this,"TextEdit")}static fromStringEdit(e,r){let n=e.replacements.map(o=>rE.fromStringReplacement(o,r));return new t(n)}static replace(e,r){return new t([new rE(e,r)])}static insert(e,r){return new t([new rE(Li.fromPositions(e,e),r)])}normalize(){let e=[];for(let r of this.replacements)if(e.length>0&&e[e.length-1].range.getEndPosition().equals(r.range.getStartPosition())){let n=e[e.length-1];e[e.length-1]=new rE(n.range.plusRange(r.range),n.text+r.text)}else r.isEmpty||e.push(r);return new t(e)}mapPosition(e){let r=0,n=0,o=0;for(let s of this.replacements){let c=s.range.getStartPosition();if(e.isBeforeOrEqual(c))break;let l=s.range.getEndPosition(),u=yO.ofText(s.text);if(e.isBefore(l)){let d=new $o(c.lineNumber+r,c.column+(c.lineNumber+r===n?o:0)),f=u.addToPosition(d);return BXe(d,f)}c.lineNumber+r!==n&&(o=0),r+=u.lineCount-(s.range.endLineNumber-s.range.startLineNumber),u.lineCount===0?l.lineNumber!==c.lineNumber?o+=u.columnCount-(l.column-1):o+=u.columnCount-(l.column-c.column):o=u.columnCount,n=l.lineNumber+r}return new $o(e.lineNumber+r,e.column+(e.lineNumber+r===n?o:0))}mapRange(e){function r(c){return c instanceof $o?c:c.getStartPosition()}a(r,"getStart");function n(c){return c instanceof $o?c:c.getEndPosition()}a(n,"getEnd");let o=r(this.mapPosition(e.getStartPosition())),s=n(this.mapPosition(e.getEndPosition()));return BXe(o,s)}inverseMapPosition(e,r){return this.inverse(r).mapPosition(e)}inverseMapRange(e,r){return this.inverse(r).mapRange(e)}apply(e){let r="",n=new $o(1,1);for(let s of this.replacements){let c=s.range,l=c.getStartPosition(),u=c.getEndPosition(),d=BXe(n,l);d.isEmpty()||(r+=e.getValueOfRange(d)),r+=s.text,n=u}let o=BXe(n,e.endPositionExclusive);return o.isEmpty()||(r+=e.getValueOfRange(o)),r}applyToString(e){let r=new k3(e);return this.apply(r)}inverse(e){let r=this.getNewRanges();return new t(this.replacements.map((n,o)=>new rE(r[o],e.getValueOfRange(n.range))))}getNewRanges(){let e=[],r=0,n=0,o=0;for(let s of this.replacements){let c=yO.ofText(s.text),l=$o.lift({lineNumber:s.range.startLineNumber+n,column:s.range.startColumn+(s.range.startLineNumber===r?o:0)}),u=c.createRange(l);e.push(u),n=u.endLineNumber-s.range.endLineNumber,o=u.endColumn-s.range.endColumn,r=s.range.endLineNumber}return e}toReplacement(e){if(this.replacements.length===0)throw new Nc;if(this.replacements.length===1)return this.replacements[0];let r=this.replacements[0].range.getStartPosition(),n=this.replacements[this.replacements.length-1].range.getEndPosition(),o="";for(let s=0;sr.equals(n))}toString(e){return e===void 0?this.replacements.map(r=>r.toString()).join(` +`):typeof e=="string"?this.toString(new k3(e)):this.replacements.length===0?"":this.replacements.map(r=>{let o=e.getValueOfRange(r.range),s=Li.fromPositions(new $o(Math.max(1,r.range.startLineNumber-1),1),r.range.getStartPosition()),c=e.getValueOfRange(s);c.length>10&&(c="..."+c.substring(c.length-10));let l=Li.fromPositions(r.range.getEndPosition(),new $o(r.range.endLineNumber+1,1)),u=e.getValueOfRange(l);u.length>10&&(u=u.substring(0,10)+"...");let d=o;if(d.length>10){let h=Math.floor(5);d=d.substring(0,h)+"..."+d.substring(d.length-h)}let f=r.text;if(f.length>10){let h=Math.floor(5);f=f.substring(0,h)+"..."+f.substring(f.length-h)}return d.length===0?`${c}\u2770${f}\u2771${u}`:`${c}\u2770${d}\u21A6${f}\u2771${u}`}).join(` +`)}},rE=class t{constructor(e,r){this.range=e;this.text=r}static{a(this,"TextReplacement")}static joinReplacements(e,r){if(e.length===0)throw new Nc;if(e.length===1)return e[0];let n=e[0].range.getStartPosition(),o=e[e.length-1].range.getEndPosition(),s="";for(let c=0;cr.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>_ue.deserialize(r)))}static fromEdit(e,r){let n=Pxe.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,Hce)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new U_(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Ql.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new Ql(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new _ue(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of v6t(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew _ue(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},_ue=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Ql.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=Uze(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Fi.fromPositions(new Wo(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Fi.fromPositions(e.range.getEndPosition(),new Wo(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new Wo(s,c)}else n=new Wo(1,1);let o=r.addToPosition(new Wo(1,1));return new tE(Fi.fromPositions(n,o),"")}else return new tE(new Fi(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` +`),o=mle(r,n);r=r.substring(o),n=n.substring(o);let s=pIe(r,n);return r=r.substring(0,r.length-s),n=n.substring(0,n.length-s),r===""}};function BXe(t,e){if(t.lineNumber===e.lineNumber&&t.column===Number.MAX_SAFE_INTEGER)return Li.fromPositions(e,e);if(!t.isBeforeOrEqual(e))throw new Nc("start must be before end");return new Li(t.lineNumber,t.column,e.lineNumber,e.column)}a(BXe,"rangeFromPositions");var Exe=class t{constructor(e){this.replacements=e;iK(AIe(e,(r,n)=>r.lineRange.endLineNumberExclusive<=n.lineRange.startLineNumber))}static{a(this,"LineEdit")}static{this.empty=new t([])}static deserialize(e){return new t(e.map(r=>Aue.deserialize(r)))}static fromEdit(e,r){let n=yxe.fromStringEdit(e,r);return t.fromTextEdit(n,r)}static fromTextEdit(e,r){let n=e.replacements,o=[],s=[];for(let c=0;cn.lineRange.startLineNumber,rle)),new t(r)}isEmpty(){return this.replacements.length===0}toEdit(e){let r=[];for(let n of this.replacements){let o=n.toSingleEdit(e);r.push(o)}return new L_(r)}toString(){return this.replacements.map(e=>e.toString()).join(",")}serialize(){return this.replacements.map(e=>e.serialize())}getNewLineRanges(){let e=[],r=0;for(let n of this.replacements)e.push(Ll.ofLength(n.lineRange.startLineNumber+r,n.newLines.length)),r+=n.newLines.length-n.lineRange.length;return e}mapLineNumber(e){let r=0;for(let n of this.replacements){if(n.lineRange.endLineNumberExclusive>e)break;r+=n.newLines.length-n.lineRange.length}return e+r}mapLineRange(e){return new Ll(this.mapLineNumber(e.startLineNumber),this.mapLineNumber(e.endLineNumberExclusive))}mapBackLineRange(e,r){return this.inverse(r).mapLineRange(e)}touches(e){return this.replacements.some(r=>e.replacements.some(n=>r.lineRange.intersect(n.lineRange)))}rebase(e){return new t(this.replacements.map(r=>new Aue(e.mapLineRange(r.lineRange),r.newLines)))}humanReadablePatch(e){let r=[];function n(l,u,d,f){let h=d==="unmodified"?" ":d==="deleted"?"-":"+";f===void 0&&(f="[[[[[ WARNING: LINE DOES NOT EXIST ]]]]]");let m=l===-1?" ":l.toString().padStart(3," "),g=u===-1?" ":u.toString().padStart(3," ");r.push(`${h} ${m} ${g} ${f}`)}a(n,"pushLine");function o(){r.push("---")}a(o,"pushSeperator");let s=0,c=!0;for(let l of I7t(this.replacements,(u,d)=>u.lineRange.distanceToRange(d.lineRange)<=5)){c?c=!1:o();let u=l[0].lineRange.startLineNumber-2;for(let d of l){for(let m=Math.max(1,u);mg)){let g=e[m-1];n(m,-1,"deleted",g)}for(let m=0;mnew Aue(r[o],e.slice(n.lineRange.startLineNumber-1,n.lineRange.endLineNumberExclusive-1))))}},Aue=class t{constructor(e,r){this.lineRange=e;this.newLines=r}static{a(this,"LineReplacement")}static deserialize(e){return new t(Ll.ofLength(e[0],e[1]-e[0]),e[2])}static fromSingleTextEdit(e,r){let n=NYe(e.text),o=e.range.startLineNumber,s=r.getValueOfRange(Li.fromPositions(new $o(e.range.startLineNumber,1),e.range.getStartPosition()));n[0]=s+n[0];let c=e.range.endLineNumber+1,l=r.getTransformer().getLineLength(e.range.endLineNumber)+1,u=r.getValueOfRange(Li.fromPositions(e.range.getEndPosition(),new $o(e.range.endLineNumber,l)));n[n.length-1]=n[n.length-1]+u;let d=e.range.startColumn===r.getTransformer().getLineLength(e.range.startLineNumber)+1,f=e.range.endColumn===1;return d&&n[0].length===s.length&&(o++,n.shift()),n.length>0&&o1){let s=this.lineRange.startLineNumber-1,c=e.getTransformer().getLineLength(s)+1;n=new $o(s,c)}else n=new $o(1,1);let o=r.addToPosition(new $o(1,1));return new rE(Li.fromPositions(n,o),"")}else return new rE(new Li(this.lineRange.startLineNumber,1,this.lineRange.endLineNumberExclusive,1),"")}else if(this.lineRange.isEmpty){let r,n,o,s=this.lineRange.startLineNumber;return s===e.getTransformer().textLength.lineCount+2?(r=s-1,n=e.getTransformer().getLineLength(r)+1,o=this.newLines.map(c=>` `+c).join("")):(r=s,n=1,o=this.newLines.map(c=>c+` -`).join("")),new tE(Fi.fromPositions(new Wo(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Fi(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` -`);return new tE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new CA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(fes||={});var Cue=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new jXe(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new jXe(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return hxn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return hxn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Dxe.fromEdit(e,new L3(this.originalText)),n=MTe(r.replacements,s=>s.lineRange.length),o=MTe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},jXe=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function hxn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(hxn,"sum");p();var vue=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=U_.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` -`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=pes(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function n$t(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(n$t,"compute4GramTextSimilarity");function pes(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(pes,"applyEditsToRanges");p();p();var Nxe=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new Wo(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function HXe(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new Nxe(t),c=new Nxe(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new hc(g,A);l.push(new CA(y,m))}return new U_(l)}a(HXe,"stringEditFromDiff");p();p();var mxn=ce(require("path")),gxn=require("worker_threads");var i$t=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function hes(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(hes,"createRpcProxy");var GXe=class{constructor(e,r,n){this.responseHandler=new i$t;this.worker=new gxn.Worker(e,r),eTe(this.worker,mxn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=hes((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var $Xe=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var Mxe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new Ql(s,u.original.startLineNumber),new Ql(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Ql(s,r+1),new Ql(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new TO(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Oc("not a valid diff");return new TO(new Fi(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Fi(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new TO(new Fi(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Fi(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(Axn(this.original.endLineNumberExclusive,e)&&Axn(this.modified.endLineNumberExclusive,r))return new TO(new Fi(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Fi(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new TO(Fi.fromPositions(new Wo(this.original.startLineNumber,1),bue(new Wo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(new Wo(this.modified.startLineNumber,1),bue(new Wo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new TO(Fi.fromPositions(bue(new Wo(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),bue(new Wo(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Fi.fromPositions(bue(new Wo(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),bue(new Wo(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Oc}};function bue(t,e){if(t.lineNumber<1)return new Wo(1,1);if(t.lineNumber>e.length)return new Wo(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new Wo(t.lineNumber,r.length+1):t}a(bue,"normalizePosition");function Axn(t,e){return t>=1&&t<=e.length}a(Axn,"isValidLineNumber");var VXe=class t extends Mxe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Ql.join(e.map(o=>Ql.fromRangeInclusive(o.originalRange))),n=Ql.join(e.map(o=>Ql.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},TO=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Oc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new tE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var Exn=require("fs");var Kx=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new LQ(()=>{let e=mes([Wze(__dirname,"diffWorker.js"),Wze(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new GXe(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:yxn(o.changes),moves:o.moves.map(c=>new $Xe(new Mxe(new Ql(c[0],c[1]),new Ql(c[2],c[3])),yxn(c[4])))}}};function yxn(t){return t.map(e=>new VXe(new Ql(e[0],e[1]),new Ql(e[2],e[3]),e[4]?.map(r=>new TO(new Fi(r[0],r[1],r[2],r[3]),new Fi(r[4],r[5],r[6],r[7])))))}a(yxn,"toLineRangeMappings");function mes(t){for(let e of t)if((0,Exn.existsSync)(e))return e}a(mes,"firstExistingPath");var WXe=new ge("editSurvivalReporter"),o$t=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new yQ;this._editSurvivalTracker=new vue(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=tf(this._document.uri),r=this.ctx.get(Ox);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){WXe.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=tf(this._document.uri),n=await this.ctx.get(Ox).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return WXe.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(Jn).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Oc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await HXe(r,n,e.get(Kx)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var zXe=class extends o$t{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new qze(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{WXe.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new vue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new vue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new Cue(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw WXe.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var _xn=new ge("editSurvivalTrackerService"),OP=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n){_xn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let o;return{startReporter:a(s=>{(async()=>{try{let c=await HXe(r,n,this.ctx.get(Kx));o=new zXe(this.ctx,e,r,n,c,s,[0,30*1e3,120*1e3,300*1e3,600*1e3])}catch(c){_xn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Vu(c)}`,c)}})()},"startReporter"),cancel:a(()=>{o?.cancel()},"cancel")}}};var ges=1e3,Cxn=256e3,vxn=64e3;function Aes(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(Aes,"makeProxyInstantApplyModelConfiguration");var yes=8e3,bxn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},Ees={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},YXe=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new ge("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new eE("No uri found in code block");if(o.isCancellationRequested)throw new MXe;e.code.includes(_A)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(Jn).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new eE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(_A))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ji(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Qt).getToken(),h=await this.ctx.get(Jt).updateExPValuesAndAssignments(f),m=this.ctx.get(Jt).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${Vu(g)}`),gi(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(bq).instantApplyModels[0]?.name??"unknown":"default"}),qt(this.ctx,je.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=Ss("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new eE("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(OP),E=VK(),_=[],v=0,b=0,T=f.length+e.code.length+ges;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(rc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new eE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await Kf.create(yue,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let k=_.join("");if(k){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:ji(e.resource),partialText:k,languageId:r.document.detectedLanguageId,markdownCodeFence:pA(k)});let D=y.initialize(r.document,f,k);return{code:k,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new eE(D)}}else{if(x.type==="canceled")throw new Mc;{let k=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,k,x),new eE(k)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",yue,e,r,n,o,s,c,l,u,d=>_es(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",OXe,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=lxn(d);if(h.patches.length===0)throw new eE(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=fxn(f,h.patches);if(m===void 0)throw new eE(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new eE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Uo.getModelConfiguration(this.ctx,void 0,Tn.Gpt41,void 0,void 0);this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},_=(await Kf.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(OP),b=await this.ctx.get(Qt).getToken(),T=await this.ctx.get(Jt).updateExPValuesAndAssignments(b),w=VK(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let k=await this.ctx.get(rc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(k,null,2)}`),k.type==="success"){let D=k.value;if(!D)throw new eE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:ji(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:pA(N)});let L=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:L,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:k.requestId}}}else{if(k.type==="canceled")throw new Mc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${k.type}`;throw this.logger.error(this.ctx,D,k),new eE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>Cxn)throw new eE(`Document too large: ${l} characters (limit: ${Cxn})`);let u=this.ctx.get(bq).instantApplyModels[0],d=u?Aes(u.name):void 0,h=await Kf.create(yue,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??bxn).renderPrompt(void 0,n),m=h.tokenCount;if(m>vxn)throw new eE(`Prompt too large: ${m} tokens (limit: ${vxn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` -`),A=this.ctx.get(Jt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=In(n.content);return n.role==="system"?`${r} +`).join("")),new rE(Li.fromPositions(new $o(r,n)),o)}else{let r=this.lineRange.endLineNumberExclusive-1,n=e.getTransformer().getLineLength(r)+1,o=new Li(this.lineRange.startLineNumber,1,r,n),s=this.newLines.join(` +`);return new rE(o,s)}}toSingleEdit(e){let r=this.toSingleTextEdit(e),n=e.getTransformer().getOffsetRange(r.range);return new SA(n,r.text)}toString(){return`${this.lineRange}->${JSON.stringify(this.newLines)}`}serialize(){return[this.lineRange.startLineNumber,this.lineRange.endLineNumberExclusive,this.newLines]}removeCommonSuffixPrefixLines(e){let r=this.lineRange.startLineNumber,n=this.lineRange.endLineNumberExclusive,o=0;for(;r{function t(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="number"&&typeof r[1]=="number"&&Array.isArray(r[2])&&r[2].every(n=>typeof n=="string")}e.is=t,a(t,"is")})(AXo||={});var yue=class{constructor(e,r){this.originalText=e;this._trackedEdit=r;let n=r.removeCommonSuffixPrefix(e);this._updatedTrackedEdit=n.mapData(()=>new LXe(!0))}static{a(this,"ArcTracker")}handleEdits(e){let r=e.mapData(s=>new LXe(!1)),o=this._updatedTrackedEdit.compose(r).decomposeSplit(s=>!s.data.isTrackedEdit).e2;this._updatedTrackedEdit=o}getTrackedEdit(){return this._updatedTrackedEdit.toStringEdit()}getAcceptedRetainedCharactersCount(){return Ixn(this._updatedTrackedEdit.replacements,r=>r.getNewLength())}getOriginalCharacterCount(){return Ixn(this._trackedEdit.replacements,e=>e.getNewLength())}getTrackedEditLineMetrics(){let e=this.getTrackedEdit();if(!e)return{deletedLineCounts:0,insertedLineCounts:0};let r=Exe.fromEdit(e,new k3(this.originalText)),n=eIe(r.replacements,s=>s.lineRange.length),o=eIe(r.getNewLineRanges(),s=>s.length);return{deletedLineCounts:n,insertedLineCounts:o}}getDebugState(){return{edits:this._updatedTrackedEdit.replacements.map(e=>({range:e.replaceRange.toString(),newText:e.newText,isTrackedEdit:e.data.isTrackedEdit}))}}},LXe=class{constructor(e){this.isTrackedEdit=e}static{a(this,"IsTrackedEditData")}join(e){if(this.isTrackedEdit===e.isTrackedEdit)return this}};function Ixn(t,e){let r=0;for(let n of t)r+=e(n);return r}a(Ixn,"sum");p();var Eue=class{constructor(e,r){this.originalText=e;this._combinedEditsSinceStart=L_.empty;this._debugLog=[];this._text=r.apply(this.originalText),this._textAfterTrackedEdits=this._text,this._originalEdits=r,this._debugLog.push(`[INIT] Original: "${this.originalText}"`),this._debugLog.push(`[INIT] TrackedEdits(${r.replacements.length}): ${this._formatEditsCompact(r,this.originalText)}`),this._debugLog.push(`[INIT] Result: "${this._text}"`),this._debugLog.push("")}static{a(this,"EditSurvivalTracker")}_formatEditsCompact(e,r){return e.replacements.length===0?"[]":e.replacements.map(n=>{let o=r.substring(n.replaceRange.start,n.replaceRange.endExclusive);return`[${n.replaceRange.start}:${n.replaceRange.endExclusive}]"${o}"->"${n.newText}"`}).join(", ")}handleEdits(e){let r=this._text,n=e.apply(this._text),o=this._combinedEditsSinceStart.compose(e);o=o.removeCommonSuffixPrefix(this._textAfterTrackedEdits),this._combinedEditsSinceStart=o,this._text=n,this._debugLog.push(`[EDIT] Input(${e.replacements.length}): ${this._formatEditsCompact(e,r)} -> "${n}"`),this._debugLog.push(`[EDIT] Accumulated(${this._combinedEditsSinceStart.replacements.length}): ${this._formatEditsCompact(this._combinedEditsSinceStart,this._textAfterTrackedEdits)}`)}getCurrentText(){return this._text}getTextAfterMarkedEdits(){return this._textAfterTrackedEdits}getOriginalText(){return this.originalText}getDebugLog(){return this._debugLog.join(` +`)}computeTrackedEditsSurvivalScore(){this._debugLog.push(`[CALC] Current: "${this._text}" | Original: "${this.originalText}"`);let e=0,r=0,n=0,o=0,s=this._originalEdits.getNewRanges(),c=yXo(s,this._combinedEditsSinceStart);this._debugLog.push(`[CALC] Processing ${s.length} edits:`);for(let d=0;d"${m}"->"${A}" | 4gram:${y.toFixed(2)} noRevert:(${E.toFixed(2)},${_.toFixed(2)})`),E!==1){let v=1-Math.max(_-E,0)/(1-E);n+=f.replaceRange.length*v,o+=f.replaceRange.length}e+=f.newText.length*y,r+=f.newText.length}let l=r===0?1:e/r,u=o===0?1:n/o;return this._debugLog.push(`[RESULT] fourGram: ${l.toFixed(3)} (${e.toFixed(1)}/${r.toFixed(1)}) | noRevert: ${u.toFixed(3)} (${n.toFixed(1)}/${o.toFixed(1)})`),{fourGram:l,noRevert:u}}};function h$t(t,e){if(t.length<4||e.length<4)return t===e?1:0;let n=new Map;for(let l=0;l<=t.length-4;l++){let u=t.substring(l,l+4),d=n.get(u)||0;n.set(u,d+1)}for(let l=0;l<=e.length-4;l++){let u=e.substring(l,l+4),d=n.get(u)||0;n.set(u,d-1)}let o=t.length-4+1+e.length-4+1,s=0;for(let l of n.values())s+=Math.abs(l);return(o-s)/o}a(h$t,"compute4GramTextSimilarity");function yXo(t,e){t=t.slice();let r=[],n=0;for(let o of e.replacements){for(;;){let c=t[0];if(!c||c.endExclusive>=o.replaceRange.start)break;t.shift(),r.push(c.delta(n))}let s=[];for(;;){let c=t[0];if(!c||!c.intersectsOrTouches(o.replaceRange))break;t.shift(),s.push(c)}for(let c=s.length-1;c>=0;c--){let l=s[c],u=l.intersect(o.replaceRange).length;l=l.deltaEnd(-u+(c===0?o.newText.length:0));let d=l.start-o.replaceRange.start;d>0&&(l=l.delta(-d)),c!==0&&(l=l.delta(o.newText.length)),l=l.delta(-(o.newText.length-o.replaceRange.length)),t.unshift(l)}n+=o.newText.length-o.replaceRange.length}for(;;){let o=t[0];if(!o)break;t.shift(),r.push(o.delta(n))}return r}a(yXo,"applyEditsToRanges");p();p();var _xe=class{static{a(this,"OffsetLineColumnConverter")}get lines(){return this._lineStartOffsets.length}constructor(e){this._lineStartOffsets=[0];let r=0;for(;re);r++);let n=e-this._lineStartOffsets[r-1];return new $o(r,n+1)}startOffsetOfLineContaining(e){let r=1;for(;re);r++);return this._lineStartOffsets[r-1]}positionToOffset(e){return e.lineNumber>=this._lineStartOffsets.length?this._lineStartOffsets[this._lineStartOffsets.length-1]+e.column-1:this._lineStartOffsets[e.lineNumber-1]+e.column-1}};async function FXe(t,e,r,n=5e3){let o=await r.computeDiff(t,e,{maxComputationTimeMs:n,computeMoves:!1,ignoreTrimWhitespace:!1}),s=new _xe(t),c=new _xe(e),l=[];for(let u of o.changes)for(let d of u.innerChanges??[]){let f=c.positionToOffset(d.modifiedRange.getStartPosition()),h=c.positionToOffset(d.modifiedRange.getEndPosition()),m=e.substring(f,h),g=s.positionToOffset(d.originalRange.getStartPosition()),A=s.positionToOffset(d.originalRange.getEndPosition()),y=new hc(g,A);l.push(new SA(y,m))}return new L_(l)}a(FXe,"stringEditFromDiff");p();p();var xxn=fe(require("path")),wxn=require("worker_threads");var m$t=class{constructor(){this.nextId=1;this.handlers=new Map}static{a(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,r,n,o=new Promise((s,c)=>{r=s,n=c});return this.handlers.set(e,{resolve:r,reject:n}),{id:e,result:o}}handleResponse(e){let r=this.handlers.get(e.id);r&&(this.handlers.delete(e.id),e.err?r.reject(e.err):r.resolve(e.res))}handleError(e){for(let r of this.handlers.values())r.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function EXo(t){let e={get:a((r,n)=>(typeof n=="string"&&!r[n]&&(r[n]=(...o)=>t(n,o)),r[n]),"get")};return new Proxy(Object.create(null),e)}a(EXo,"createRpcProxy");var UXe=class{constructor(e,r,n){this.responseHandler=new m$t;this.worker=new wxn.Worker(e,r),bTe(this.worker,xxn.basename(e,".js")),this.worker.on("message",async o=>{if("fn"in o)try{let s=await n?.[o.fn].apply(n,o.args);this.worker.postMessage({id:o.id,res:s})}catch(s){let c=s instanceof Error?s:new Error(String(s));this.worker.postMessage({id:o.id,err:c})}else this.responseHandler.handleResponse(o)}),this.worker.on("error",o=>this.handleError(o)),this.worker.on("exit",o=>{o!==0&&this.handleError(new Error(`Worker thread exited with code ${o}.`))}),this.proxy=EXo((o,s)=>{if(!this.worker)throw new Error("Worker was terminated!");let{id:c,result:l}=this.responseHandler.createHandler();return this.worker.postMessage({id:c,fn:o,args:s}),l})}static{a(this,"WorkerWithRpcProxy")}async terminate(){this.worker.removeAllListeners(),await this.worker.terminate(),this.responseHandler.clear()}handleError(e){this.responseHandler.handleError(e)}};p();var QXe=class t{static{a(this,"MovedText")}constructor(e,r){this.lineRangeMapping=e,this.changes=r}flip(){return new t(this.lineRangeMapping.flip(),this.changes.map(e=>e.flip()))}};p();var vxe=class t{static{a(this,"LineRangeMapping")}static inverse(e,r,n){let o=[],s=1,c=1;for(let u of e){let d=new t(new Ll(s,u.original.startLineNumber),new Ll(c,u.modified.startLineNumber));d.modified.isEmpty||o.push(d),s=u.original.endLineNumberExclusive,c=u.modified.endLineNumberExclusive}let l=new t(new Ll(s,r+1),new Ll(c,n+1));return l.modified.isEmpty||o.push(l),o}static clip(e,r,n){let o=[];for(let s of e){let c=s.original.intersect(r),l=s.modified.intersect(n);c&&!c.isEmpty&&l&&!l.isEmpty&&o.push(new t(c,l))}return o}constructor(e,r){this.original=e,this.modified=r}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new t(this.modified,this.original)}join(e){return new t(this.original.join(e.original),this.modified.join(e.modified))}get changedLineCount(){return Math.max(this.original.length,this.modified.length)}toRangeMapping(){let e=this.original.toInclusiveRange(),r=this.modified.toInclusiveRange();if(e&&r)return new EO(e,r);if(this.original.startLineNumber===1||this.modified.startLineNumber===1){if(!(this.modified.startLineNumber===1&&this.original.startLineNumber===1))throw new Nc("not a valid diff");return new EO(new Li(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Li(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}else return new EO(new Li(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new Li(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))}toRangeMapping2(e,r){if(Rxn(this.original.endLineNumberExclusive,e)&&Rxn(this.modified.endLineNumberExclusive,r))return new EO(new Li(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new Li(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new EO(Li.fromPositions(new $o(this.original.startLineNumber,1),_ue(new $o(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Li.fromPositions(new $o(this.modified.startLineNumber,1),_ue(new $o(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new EO(Li.fromPositions(_ue(new $o(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),_ue(new $o(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),Li.fromPositions(_ue(new $o(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),r),_ue(new $o(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),r)));throw new Nc}};function _ue(t,e){if(t.lineNumber<1)return new $o(1,1);if(t.lineNumber>e.length)return new $o(e.length,e[e.length-1].length+1);let r=e[t.lineNumber-1];return t.column>r.length+1?new $o(t.lineNumber,r.length+1):t}a(_ue,"normalizePosition");function Rxn(t,e){return t>=1&&t<=e.length}a(Rxn,"isValidLineNumber");var qXe=class t extends vxe{static{a(this,"DetailedLineRangeMapping")}static fromRangeMappings(e){let r=Ll.join(e.map(o=>Ll.fromRangeInclusive(o.originalRange))),n=Ll.join(e.map(o=>Ll.fromRangeInclusive(o.modifiedRange)));return new t(r,n,e)}constructor(e,r,n){super(e,r),this.innerChanges=n}flip(){return new t(this.modified,this.original,this.innerChanges?.map(e=>e.flip()))}withInnerChangesFromLineRanges(){return new t(this.original,this.modified,[this.toRangeMapping()])}},EO=class t{static{a(this,"RangeMapping")}static fromEdit(e){let r=e.getNewRanges();return e.replacements.map((o,s)=>new t(o.range,r[s]))}static fromEditJoin(e){let r=e.getNewRanges(),n=e.replacements.map((o,s)=>new t(o.range,r[s]));return t.join(n)}static join(e){if(e.length===0)throw new Nc("Cannot join an empty list of range mappings");let r=e[0];for(let n=1;n${this.modifiedRange.toString()}}`}flip(){return new t(this.modifiedRange,this.originalRange)}toTextEdit(e){let r=e.getValueOfRange(this.modifiedRange);return new rE(this.originalRange,r)}join(e){return new t(this.originalRange.plusRange(e.originalRange),this.modifiedRange.plusRange(e.modifiedRange))}};var kxn=require("fs");var Yx=class{static{a(this,"DiffServiceImpl")}constructor(){this._worker=new qQ(()=>{let e=_Xo([qYe(__dirname,"diffWorker.js"),qYe(__dirname,"../../../../../../../../dist/diffWorker.js")]);if(e===void 0)throw new Error("DiffServiceImpl: worker file not found");return new UXe(e,{name:"Diff worker"})})}dispose(){this._worker.rawValue?.terminate()}async computeDiff(e,r,n){let o=await this._worker.value.proxy.computeDiff(e,r,n);return{identical:o.identical,quitEarly:o.quitEarly,changes:Pxn(o.changes),moves:o.moves.map(c=>new QXe(new vxe(new Ll(c[0],c[1]),new Ll(c[2],c[3])),Pxn(c[4])))}}};function Pxn(t){return t.map(e=>new qXe(new Ll(e[0],e[1]),new Ll(e[2],e[3]),e[4]?.map(r=>new EO(new Li(r[0],r[1],r[2],r[3]),new Li(r[4],r[5],r[6],r[7])))))}a(Pxn,"toLineRangeMappings");function _Xo(t){for(let e of t)if((0,kxn.existsSync)(e))return e}a(_Xo,"firstExistingPath");var jXe=new Ae("editSurvivalReporter"),g$t=class{constructor(e,r,n,o,s,c,l){this.ctx=e;this._document=r;this._documentTextBeforeMarkedEdits=n;this._documentTextAfterMarkedEdits=o;this._markedEdits=s;this._sendTelemetryEvent=c;this._customTimeouts=l;this._store=new MQ;this._editSurvivalTracker=new Eue(this._documentTextBeforeMarkedEdits,this._markedEdits),this.captureInitialBranchInfo().then(()=>{this.setupTimeouts()}).catch(()=>{this.setupTimeouts()})}static{a(this,"BaseEditSurvivalReporter")}setupTimeouts(){if(this._store.isDisposed)return;let e=this._customTimeouts||[30*1e3,120*1e3,300*1e3,600*1e3];for(let r=0;rthis._store.dispose():void 0,r===0)}}async report(e){let r=await this.createEditSurvivalResult(this._editSurvivalTracker,e,this._readDocumentTimeMs,this._diffComputationTimeMs,this._arcTracker);this._sendTelemetryEvent(r)}_getLineCountInfo(){if(this._arcTracker)return this._arcTracker.getTrackedEditLineMetrics()}async triggerReport(e){await this.report(e)}get editSurvivalTracker(){return this._editSurvivalTracker}getInitializationTimings(){return{readDocumentTimeMs:this._readDocumentTimeMs,diffComputationTimeMs:this._diffComputationTimeMs}}async readCurrentDocument(){let e=await this.readCurrentDocumentWithTiming(this.ctx,this._document);return this._readDocumentTimeMs=e.readDocumentTimeMs,e.text}async captureInitialBranchInfo(){try{let e=Xd(this._document.uri),r=this.ctx.get(Lx);this._initialBranchInfo=await r.getBranchInfo(this.ctx,e)}catch(e){jXe.warn(this.ctx,"Failed to capture initial branch info",e),this._initialBranchInfo=void 0}}async checkBranchChange(){try{let e=Xd(this._document.uri),n=await this.ctx.get(Lx).getBranchInfo(this.ctx,e);if(!this._initialBranchInfo||!n)return 0;let o=this._initialBranchInfo.currentBranch,s=n.currentBranch,c=this._initialBranchInfo.isDetachedHead,l=n.isDetachedHead;return o!==s||c!==l?1:0}catch(e){return jXe.warn(this.ctx,"Failed to check branch change",e),0}}async createEditSurvivalResult(e,r,n,o,s){let c=e.computeTrackedEditsSurvivalScore(),l=await this.checkBranchChange(),u=this._getLineCountInfo(),d={fourGram:c.fourGram,noRevert:c.noRevert,timeDelayMs:r,didBranchChange:l,arc:s?.getAcceptedRetainedCharactersCount(),originalCharCount:s?.getOriginalCharacterCount(),currentLineCount:u?.insertedLineCounts,currentDeletedLineCount:u?.deletedLineCounts,originalLineCount:this._initialLineCounts?.insertedLineCounts,originalDeletedLineCount:this._initialLineCounts?.deletedLineCounts,currentFileContent:e.getCurrentText(),originalFileText:e.getOriginalText(),textAfterMarkedEdits:e.getTextAfterMarkedEdits(),debugLog:e.getDebugLog(),readDocumentTimeMs:n,diffComputationTimeMs:o};return{...d,currentLineCount:d.currentLineCount&&d.originalLineCount&&d.currentLineCount>d.originalLineCount?d.originalLineCount:d.currentLineCount,currentDeletedLineCount:d.currentDeletedLineCount&&d.originalDeletedLineCount&&d.currentDeletedLineCount>d.originalDeletedLineCount?d.originalDeletedLineCount:d.currentDeletedLineCount}}async readCurrentDocumentWithTiming(e,r){let n=performance.now(),o=await e.get(ri).getOrReadTextDocument({uri:r.uri}),s=performance.now()-n;if(o.status!=="valid")throw new Nc(`Document ${r.uri} is not valid, details ${JSON.stringify(o)}`);return{text:o.document.getText(),readDocumentTimeMs:s}}async computeDiffWithTiming(e,r,n){let o=performance.now(),s=await FXe(r,n,e.get(Yx)),c=performance.now()-o;return{edits:s,diffComputationTimeMs:c}}};var HXe=class extends g$t{static{a(this,"DiffBasedEditSurvivalReporter")}constructor(e,r,n,o,s,c,l){super(e,r,n,o,s,c,l),this._arcTracker=new yue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._initialLineCounts=this._getLineCountInfo()}scheduleReport(e,r){let n=new OYe(()=>{this.updateAndReport(e).then(()=>{n.dispose(),r&&r()}).catch(o=>{jXe.error(this.ctx,`DiffBasedEditSurvivalReporter: Failed to update and report at ${e}ms`,o),n.dispose(),r&&r()})},e);this._store.add(n)}cancel(){this._store.dispose()}async updateAndReport(e){try{let r=await this.readCurrentDocument();if(r!==this._documentTextAfterMarkedEdits){let n=await this.computeDiffWithTiming(this.ctx,this._documentTextAfterMarkedEdits,r);this._diffComputationTimeMs=n.diffComputationTimeMs,this._editSurvivalTracker=new Eue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._editSurvivalTracker.handleEdits(n.edits),this._arcTracker=new yue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker.handleEdits(n.edits)}else this._diffComputationTimeMs=void 0,this._editSurvivalTracker=new Eue(this._documentTextBeforeMarkedEdits,this._markedEdits),this._arcTracker=new yue(this._documentTextBeforeMarkedEdits,this._markedEdits);await this.report(e)}catch(r){throw jXe.error(this.ctx,`Failed to update and report at ${e}ms for document ${this._document.uri}`,r),r}}};var Dxn=new Ae("editSurvivalTrackerService"),Nk=class{constructor(e){this.ctx=e}static{a(this,"EditSurvivalTrackerService")}initialize(e,r,n){Dxn.debug(this.ctx,`Initializing edit survival tracking for document uri: ${e.uri}`);let o;return{startReporter:a(s=>{(async()=>{try{let c=await FXe(r,n,this.ctx.get(Yx));o=new HXe(this.ctx,e,r,n,c,s,[0,30*1e3,120*1e3,300*1e3,600*1e3])}catch(c){Dxn.error(this.ctx,`Failed to initialize EditSurvivalReporter: ${Yu(c)}`,c)}})()},"startReporter"),cancel:a(()=>{o?.cancel()},"cancel")}}};var vXo=1e3,Nxn=256e3,Mxn=64e3;function CXo(t){return{modelId:t,uiName:t,modelFamily:t,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1}}a(CXo,"makeProxyInstantApplyModelConfiguration");var bXo=8e3,Oxn={modelId:"gpt-4o-instant-apply-full-ft-v66",uiName:"gpt-4o-instant-apply-full-ft-v66",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},SXo={modelId:"gpt-4o-instant-apply-full-ft-v66-short",uiName:"gpt-4o-instant-apply-full-ft-v66-short",modelFamily:Tn.Gpt4oMini,maxRequestTokens:128e3,maxResponseTokens:16e3,baseTokensPerCompletion:3,baseTokensPerMessage:3,baseTokensPerName:1,tokenizer:"o200k_base",isExperimental:!1,stream:!0,toolCalls:!1},GXe=class{static{a(this,"CodeMapper")}constructor(e){this.ctx=e,this.logger=new Ae("codeMapper")}async mapCode(e,r,n,o,s,c=!1,l){if(!e.resource)throw new tE("No uri found in code block");if(o.isCancellationRequested)throw new RXe;e.code.includes(bA)||this.logger.debug(this.ctx,`Code block for uri ${e.resource} does not contain existing code marker`);let u=await this.ctx.get(ri).getOrReadTextDocument({uri:e.resource});if(u.status==="notfound")return s&&await this.reportCodeBlock(e,s),{code:e.code};if(u.status==="invalid"){let g=`Failed to find file ${e.resource} with status ${u.status} and reason ${u.reason}`,A=new tE(g);throw this.logger.error(this.ctx,g,A),A}let d=u.document.getText();if(d.length===0&&!e.code.includes(bA))return s&&await this.reportCodeBlock(e,s),{code:e.code};s&&await s({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ki(e.resource),editDescription:e.markdownBeforeBlock});let f=await this.ctx.get(Ut).getToken(),h=await this.ctx.get(Jt).updateExPValuesAndAssignments(f),m=this.ctx.get(Jt).instantApplyModelMigration(h);try{return await this.mapCodeUsingFastEdit(e,u,r,n,o,h,s,c,l)}catch(g){if(this.logger.exception(this.ctx,g,`Fast Edit failed for ${e.resource}. Error: ${Yu(g)}`),si(this.ctx,"codeMapper.fastEditFailed",g,{modelId:m?this.ctx.get(Aq).instantApplyModels[0]?.name??"unknown":"default"}),Ht(this.ctx,Je.EnableMapCodeFallback)==="enabled")return await this.codeMapperUsingSlowEdit(e,u,d,r,n,o,s,c,l);throw g}}async codeMapperUsingSlowEdit(e,r,n,o,s,c,l,u,d){let h=Cs("o200k_base").tokenLength(n),g=h<3072;return this.logger.info(this.ctx,`Document has ${h} tokens. Falling back to ${g?"Full Rewrite":"Patch mode"} for ${e.resource}`),g?await this.mapCodeUsingFullRewrite(e,r,o,s,c,l,u,d):await this.mapCodeUsingPatch(e,r,o,s,c,l,u,d)}async mapCodeUsingFastEdit(e,r,n,o,s,c,l,u=!1,d){if(r.status!=="valid")throw new tE("Invalid document result in mapCodeUsingFastEdit");let f=r.document.getText(),h=await this.buildPromptAndSelectEndpoint(e,r,s,c),m=h.messages,g=h.modelConfiguration,A=h.tokenCount;this.logger.info(this.ctx,`Selected model: ${g.modelId}, Token count: ${A} for ${e.resource}`);let y=this.ctx.get(Nk),E=UK(),_=[],v=0,b=0,T=f.length+e.code.length+vXo;for(;;){let w={copilotApiProvider:"proxy",modelConfiguration:g,messages:m,uiKind:"agentPanel",temperature:0,llmInteraction:n.cloneAsAgentInteraction(),prediction:{type:"content",content:f},copilotEditsSessionHeader:d};this.logger.debug(this.ctx,`Send map code request ${E} in iteration ${b} with params: ${JSON.stringify(w,null,2)}`);let x=await this.ctx.get(rc).fetchResponse(w,s,c);if(this.logger.debug(this.ctx,`Received map code response ${E} in iteration ${b} with result: ${JSON.stringify(x,null,2)}`),v=this.calculateResponseLength(x,_,v),x.type==="length"){if(v>T)throw new tE(`Code mapper might be in a loop: Rewritten length: ${v}, Document length: ${f.length}, Code block length ${e.code.length}`);m=(await tp.create(mue,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:x.truncatedValue},g).renderPrompt(void 0,s)).messages}else if(x.type==="success"){let P=_.join("");if(P){l&&await l({fileGenerationStatus:"updated-code-generated",uri:e.resource,basename:Ki(e.resource),partialText:P,languageId:r.document.detectedLanguageId,markdownCodeFence:yA(P)});let D=y.initialize(r.document,f,P);return{code:P,editSurvivalTrackingSession:D,telemetry:{requestSource:o.chatRequestSource,chatRequestModel:o.chatRequestModel,mapper:g.modelId,headerRequestId:x.requestId}}}else{let D=`No valid completion found for uri ${e.resource}`;throw new tE(D)}}else{if(x.type==="canceled")throw new Dc;{let P=`Failed to map code for uri ${e.resource} with result type ${x.type}`;throw this.logger.error(this.ctx,P,x),new tE(P)}}b+=1}}async mapCodeUsingFullRewrite(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("full-rewrite",mue,e,r,n,o,s,c,l,u,d=>TXo(d))}async mapCodeUsingPatch(e,r,n,o,s,c,l=!1,u){return this.mapCodeUsingCAPI("patch",PXe,e,r,n,o,s,c,l,u,(d,f)=>{this.logger.info(this.ctx,`Patch response for uri ${e.resource}: ${d.substring(0,500)}...`);let h=vxn(d);if(h.patches.length===0)throw new tE(`Patch mode failed: no valid patches found in response for uri ${e.resource}`);this.logger.info(this.ctx,`Parsed ${h.patches.length} patch(es) for uri ${e.resource}`);let m=Sxn(f,h.patches);if(m===void 0)throw new tE(`Patch mode failed: could not apply patches to document for uri ${e.resource}`);return this.logger.info(this.ctx,`Patch mode succeeded for uri ${e.resource}`),m})}async mapCodeUsingCAPI(e,r,n,o,s,c,l,u,d,f,h){if(o.status!=="valid")throw new tE(`Invalid document result in mapCodeUsing${e==="full-rewrite"?"FullRewrite":"Patch"}`);let m=o.document.getText(),g=await Ro.getModelConfiguration(this.ctx,"codeMapper");this.logger.info(this.ctx,`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} fallback using model: ${g.modelId} for ${n.resource}`);let A={codeBlock:n.code,uri:n.resource,existingDocument:o,markdownBeforeBlock:n.markdownBeforeBlock,...e==="full-rewrite"?{inProgressRewriteContent:void 0}:{}},_=(await tp.create(r,A,g).renderPrompt(void 0,l)).messages,v=this.ctx.get(Nk),b=await this.ctx.get(Ut).getToken(),T=await this.ctx.get(Jt).updateExPValuesAndAssignments(b),w=UK(),R={copilotApiProvider:"api",modelConfiguration:g,messages:_,uiKind:"agentPanel",temperature:0,llmInteraction:s.cloneAsAgentInteraction(),copilotEditsSessionHeader:f};this.logger.debug(this.ctx,`Send ${e} request ${w} with params: ${JSON.stringify(R,null,2)}`);let P=await this.ctx.get(rc).fetchResponse(R,l,T);if(this.logger.debug(this.ctx,`Received ${e} response ${w} with result: ${JSON.stringify(P,null,2)}`),P.type==="success"){let D=P.value;if(!D)throw new tE(`No valid completion found for uri ${n.resource}`);let N=h(D,m);u&&await u({fileGenerationStatus:"updated-code-generated",uri:n.resource,basename:Ki(n.resource),partialText:N,languageId:o.document.detectedLanguageId,markdownCodeFence:yA(N)});let B=v.initialize(o.document,m,N);return{code:N,editSurvivalTrackingSession:B,telemetry:{requestSource:c.chatRequestSource,chatRequestModel:c.chatRequestModel,mapper:`${g.modelId}-${e}`,headerRequestId:P.requestId}}}else{if(P.type==="canceled")throw new Dc;{let D=`${e==="full-rewrite"?"Full Rewrite":"Patch mode"} failed for uri ${n.resource} with result type ${P.type}`;throw this.logger.error(this.ctx,D,P),new tE(D)}}}async buildPromptAndSelectEndpoint(e,r,n,o,s){let l=(r.status==="valid"?r.document.getText():"").length+e.code.length;if(l>Nxn)throw new tE(`Document too large: ${l} characters (limit: ${Nxn})`);let u=this.ctx.get(Aq).instantApplyModels[0],d=u?CXo(u.name):void 0,h=await tp.create(mue,{codeBlock:e.code,uri:e.resource,existingDocument:r,markdownBeforeBlock:e.markdownBeforeBlock,inProgressRewriteContent:s},d??Oxn).renderPrompt(void 0,n),m=h.tokenCount;if(m>Mxn)throw new tE(`Prompt too large: ${m} tokens (limit: ${Mxn})`);let g=h.messages.map(_=>typeof _.content=="string"?_.content:JSON.stringify(_.content)).join(` +`),A=this.ctx.get(Jt).instantApplyModelMigration(o),y;return A&&d?y=d:y=g.length{let o=Rn(n.content);return n.role==="system"?`${r} ${o} -`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:ji(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:ji(e.resource)})}};function _es(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` -`):t}a(_es,"extractCodeBlock");var KXe=class extends hu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. +`:r+o},"")}]}calculateResponseLength(e,r,n){return e.type==="success"?(r.push(e.value),n+=e.value.length):e.type==="length"&&(r.push(e.truncatedValue),n+=e.truncatedValue.length),n}async reportCodeBlock(e,r){await r({fileGenerationStatus:"edit-plan-generated",uri:e.resource,basename:Ki(e.resource),editDescription:e.markdownBeforeBlock}),await r({fileGenerationStatus:"updated-code-generated",partialText:e.code,uri:e.resource,basename:Ki(e.resource)})}};function TXo(t){let e=t.split(/\r?\n/),r=/^(`{3,})/,n=!1,o=0,s=!1,c=[];for(let l of e){let u=l.match(r);if(u&&!n)o=u[1].length,n=!0;else if(n){let d=l.match(r);if(d&&d[1].length>=o){s=!0;break}c.push(l)}}return s?c.join(` +`):t}a(TXo,"extractCodeBlock");var $Xe=class extends pu{static{a(this,"EditFileTool")}constructor(){super({name:"insert_edit_into_file",displayName:"Edit File",description:`Edit a file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first. The system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints. Avoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example: // ...existing code... @@ -3418,9 +3449,9 @@ class Person { getAge() { return this.age; } -}`}),explanation:S.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=Ju(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new YXe(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=DM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await Jc(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=hO(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new gO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Or([new wr(u.join(` -`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Dmn(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${yA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${yA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var Sxn=require("crypto"),xO=ce(require("fs/promises")),Txn=require("os"),IO=ce(require("path"));var F3=class{constructor(e){this.ctx=e;this.logger=new ge("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=IO.extname(__filename)===".ts"?IO.resolve(__dirname,"../../../packages/ripgrep/bin"):IO.resolve(__dirname,"./bin"),c=IO.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await xO.readFile(c),u=(0,Sxn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||IO.join((0,Txn.homedir)(),".cache"),f=IO.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await xO.mkdir(f,{recursive:!0});let h=ji(Ia(c)),m=IO.join(f,h);try{await xO.stat(m)}catch{await xO.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await xO.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var Ixn=require("child_process"),s$t=require("perf_hooks");var U3=new ge("ripgrepProcessManager"),Q3=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,U3.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){U3.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){U3.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){U3.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){U3.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}U3.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:VK(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` -`);U3.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=s$t.performance.now();U3.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Ixn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=s$t.performance.now()-r;U3.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function JXe(t){return t.some(e=>!aa.isRegisteredScheme(To(e.uri).scheme))}a(JXe,"hasRipgrepWorkspaceFolder");async function ZXe(t,e){try{return{rgPath:await t.ctx.get(F3).resolvePath(),ripgrepManager:t.ctx.get(Q3)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(ZXe,"resolveRipgrepResources");var xxn=new ge("findFilesTool"),XXe=class t extends hu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. +}`}),explanation:S.String({description:"A short explanation of the edit being made."})})})}async invoke(e,r,n){try{let o=await this.mapCode(r.input,e,n),s=o.code,c=await this.invokeClientEditFileTool(e,r,s,n);return await this.getFinalEditFileResult(e,r,c,o.editSurvivalTrackingSession,o.telemetry)}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Rr(s)],"error")}}async mapCode(e,r,n){let{filePath:o}=e,s=Ju(o,r.uriSchemeCache);if(!s)throw new Error(`Invalid file path: ${o}`);return await new GXe(r.ctx).mapCode({code:e.code,resource:s,markdownBeforeBlock:e.explanation},r.toLlmInteraction(),{chatRequestSource:r.conversation.source,chatRequestModel:r.turn.resolvedModelConfiguration?.modelFamily??r.turn.userRequestedModel},n,void 0,!0,r.copilotEditsSessionHeader)}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(ls).getToolByNameAndProvider("insert_edit_into_file",Jf);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ls).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation},roundId:r.roundId,toolCallId:r.toolCallId},o)}async getFinalEditFileResult(e,r,n,o,s){if(n.status!=="success")return n;let c=BM({uri:Ju(r.input.filePath,e.uriSchemeCache),languageId:"UNKNOWN"});if(o){let f=await Kc(e.ctx,e,void 0);o.startReporter(h=>{this.handleEditSurvivalTelemetry(e,h,f,c,s)})}let l=cO(n.content),u=[];u.push(``),u.push("This is the new state of the file after the edit. Base future edits off of this file, no need to read it again, unless a terminal command may have changed it.");let d=new uO({code:l,languageId:c,noFilePath:!0});return u.push(...d.renderAsArray()),u.push(""),new Br([new Rr(u.join(` +`))],"success")}handleEditSurvivalTelemetry(e,r,n,o,s){Xyn(e.ctx,"agentPanel",{requestSource:s?.requestSource??"",chatRequestModel:s?.chatRequestModel??"",mapper:s?.mapper??"",headerRequestId:s?.headerRequestId??"",mode:e.turn.getChatModeForTelemetry(),modelId:e.turn.getResolvedModelId()??"unknown",languageId:o},{survivalRateFourGram:r.fourGram,survivalRateNoRevert:r.noRevert,timeDelayMs:r.timeDelayMs,didBranchChange:r.didBranchChange,readDocumentTimeMs:r.readDocumentTimeMs??-1,diffComputationTimeMs:r.diffComputationTimeMs??-1,arc:r.arc??-1,originalCharCount:r.originalCharCount??-1,currentLineCount:r.currentLineCount??-1,currentDeletedLineCount:r.currentDeletedLineCount??-1,originalLineCount:r.originalLineCount??-1,originalDeletedLineCount:r.originalDeletedLineCount??-1},{currentFileContent:r.currentFileContent},n,"codeMapper.trackEditSurvival")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running insert_edit_into_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${CA(o)} with insert_edit_into_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran insert_edit_into_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${CA(o)} with insert_edit_into_file tool`}}static toEditFileParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.code!="string")throw new Error("code must be a string");if(typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,code:e.code,explanation:e.explanation}}};p();p();p();var Bxn=require("crypto"),vO=fe(require("fs/promises")),Lxn=require("os"),_O=fe(require("path"));var D3=class{constructor(e){this.ctx=e;this.logger=new Ae("ripgrep");this.resolvePath()}static{a(this,"RipgrepPathResolver")}async resolvePath(){if(this.rgPath)return this.rgPath;let e=process.platform,r=process.arch;return this.rgPath=await this.resolvePathByOs(e,r),process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE?this.logger.info(this.ctx,`GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE already set to: ${process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE}`):(process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=this.rgPath,this.logger.info(this.ctx,`Set GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE=${this.rgPath}`)),this.rgPath}async resolvePathByOs(e,r){this.logger.debug(this.ctx,`Start resolving ripgrep path for platform: ${e} and architecture: ${r}`);let n=process.env.GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE;if(n)return this.logger.info(this.ctx,`Using ripgrep from GITHUB_COPILOT_RIPGREP_PATH_OVERRIDE: ${n}`),n;if(r!=="arm64"&&r!=="x64")throw new Error(`Unsupported architecture: ${r}`);let o=e==="win32"?"rg.exe":"rg";this.logger.debug(this.ctx,`__filename is ${__filename}, __dirname is ${__dirname}`);let s=_O.extname(__filename)===".ts"?_O.resolve(__dirname,"../../../packages/ripgrep/bin"):_O.resolve(__dirname,"./bin"),c=_O.resolve(s,e,r,o);if("pkg"in process){this.logger.debug(this.ctx,"Running inside pkg binary, start to copy ripgrep to a temporary location");let l=await vO.readFile(c),u=(0,Bxn.createHash)("sha256").update(l).digest("hex"),d=process.env.PKG_NATIVE_CACHE_PATH||_O.join((0,Lxn.homedir)(),".cache"),f=_O.join(d,"pkg",u);this.logger.info(this.ctx,`Using tmpFolder for ripgrep: ${f}`),await vO.mkdir(f,{recursive:!0});let h=Ki(ba(c)),m=_O.join(f,h);try{await vO.stat(m)}catch{await vO.copyFile(c,m),this.logger.debug(this.ctx,`Copied ripgrep to ${m}`)}c=m,e!=="win32"&&await vO.chmod(c,493).catch(g=>{this.logger.error(this.ctx,`Failed to set executable permission for ${c}: ${g}`)})}return this.logger.info(this.ctx,`Resolved ripgrep path: ${c}`),c}};p();var Fxn=require("child_process"),A$t=require("perf_hooks");var N3=new Ae("ripgrepProcessManager"),M3=class{constructor(e,r,n){this.ctx=e;this.defaultTimeoutInMs=30*1e3;this.maxProcesses=4;this.maxPendingTasks=20;this.taskQueue=[];this.activeProcesses=new Set;this.maxProcesses=r??this.maxProcesses,this.maxPendingTasks=n??this.maxPendingTasks,N3.debug(this.ctx,`initialized with maxProcesses: ${this.maxProcesses} and maxPendingTasks: ${this.maxPendingTasks}`)}static{a(this,"RipgrepProcessManager")}dispose(){N3.debug(this.ctx,`Disposing ripgrep process manager with ${this.activeProcesses.size} active processes`),this.activeProcesses.forEach(e=>{if(!e.killed)try{e.kill()}catch(r){N3.error(this.ctx,"Failed to kill process. ",r)}}),this.activeProcesses.clear()}execute(e,r,n,o,s){return new Promise((c,l)=>{if(this.taskQueue.length>=this.maxPendingTasks){N3.error(this.ctx,`Task queue limit reached: ${this.maxPendingTasks}`),l(new Error(`Task queue limit of ${this.maxPendingTasks} reached`));return}if(s!==void 0&&s<=0){N3.error(this.ctx,`Invalid timeout value: ${s}`),l(new Error(`Invalid timeout value: ${s}`));return}N3.debug(this.ctx,`Adding task to queue: ${e} ${r.join(" ")}`),this.taskQueue.push({id:UK(),command:e,args:r,options:o,resolve:c,reject:l,timeoutInMs:s??this.defaultTimeoutInMs,token:n});let u=this.taskQueue.map(d=>this.getTaskSimpleInfo(d)).join(` +`);N3.debug(this.ctx,`Current task queue length: ${this.taskQueue.length}, task list: ${u}`),this.runNextTask()})}runNextTask(){if(this.taskQueue.length===0||this.activeProcesses.size>=this.maxProcesses)return;let e=this.taskQueue.shift(),r=A$t.performance.now();N3.debug(this.ctx,`Starting task: ${this.getTaskSimpleInfo(e)}`);try{let n=(0,Fxn.spawn)(e.command,e.args,e.options);this.activeProcesses.add(n);let o="",s="",c,l=a(()=>{c&&clearTimeout(c),this.activeProcesses.delete(n),n.stdout?.removeAllListeners(),n.stderr?.removeAllListeners(),n.removeAllListeners()},"cleanup");e.timeoutInMs&&(c=setTimeout(()=>{n.killed||(n.kill(),e.reject(new Error(`Process timed out after ${e.timeoutInMs} ms. Partial output: ${o}`))),l(),this.runNextTask()},e.timeoutInMs)),e.token&&e.token.onCancellationRequested(()=>{n.killed||(n.kill(),e.reject(new Error("Process was cancelled. Partial output: "+o))),l(),this.runNextTask()}),n.stdout?.on("data",u=>{o+=u.toString()}),n.stderr?.on("data",u=>{s+=u.toString()}),n.on("close",u=>{let f=A$t.performance.now()-r;N3.debug(this.ctx,`Task ${e.id} completed in ${f} ms`),l(),u===0?e.resolve(o):u===1?e.resolve(""):e.reject(new Error(`Process exited with code ${u}: ${s}`)),this.runNextTask()}),n.on("error",u=>{l(),e.reject(new Error(`Failed to start process: ${u.message}`)),this.runNextTask()})}catch(n){e.reject(new Error(`Error spawning process: ${n.message}`)),this.runNextTask()}}getTaskSimpleInfo(e){return`${e.id} - ${e.command} ${e.args.join(" ")}`}};function VXe(t){return t.some(e=>!na.isRegisteredScheme(to(e.uri).scheme))}a(VXe,"hasRipgrepWorkspaceFolder");async function WXe(t,e){try{return{rgPath:await t.ctx.get(D3).resolvePath(),ripgrepManager:t.ctx.get(M3)}}catch(r){throw new Error(`Failed to run ${e} since failed to get ripgrep path: ${String(r)}`)}}a(WXe,"resolveRipgrepResources");var Uxn=new Ae("findFilesTool"),zXe=class t extends pu{static{a(this,"FindFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"file_search",displayName:"Find Files",description:`Search for files in the workspace by glob pattern. Returns matching file paths sorted by modification time. When to Use: - Find files by name or extension pattern @@ -3436,12 +3467,12 @@ Usage: Glob pattern examples: - **/*.{js,ts} to match all js/ts files in the workspace - src/** to match all files under the top-level src folder -- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Or([new wr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(JXe(c)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await ZXe(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{xxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),aa.isRegisteredScheme(To(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),xxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` -`)}`)}catch(E){if(E instanceof $y){d[y]=[];return}let _=E instanceof Error?E.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${_}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Or([new wr(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} +- **/foo/**/*.js to match all js files under any foo folder`,displayDescription:"Search for files in the workspace by glob pattern.",inputSchema:S.Object({query:S.String({description:"Search for files with names or paths matching this glob pattern."}),maxResults:S.Optional(S.Number({description:"The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults."}))})})}async invoke(e,r,n){try{let{query:o,maxResults:s=20}=r.input,c=e.turn.workspaceFolders;if(!c?.length)return new Br([new Rr("Failed to invoke tool file_search since no workspace folders found")],"error");let l,u;if(VXe(c)){if(n.isCancellationRequested)return new Br([new Rr("Cancelled")],"cancelled");({rgPath:l,ripgrepManager:u}=await WXe(e,"file_search"))}let d={},f=c.map(async A=>{if(n.isCancellationRequested)throw new Error("Canceled");let y=A.uri.toString();try{Uxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${y}`),na.isRegisteredScheme(to(A.uri).scheme)?d[y]=await this.searchViaContentProvider(e,A,o,s):d[y]=await this.searchViaRipgrep(u,l,A,o,n),Uxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${y} with results: ${d[y].join(` +`)}`)}catch(E){if(E instanceof Y0){d[y]=[];return}let _=E instanceof Error?E.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${y}: ${_}`)}});try{await Promise.all(f)}catch(A){let y=A instanceof Error?A.message:"An unknown error occurred";return new Br([new Rr(y)],"error")}let h=[],m=s;for(;m>0;){let A=!1;for(let y in d)d[y].length>0&&m>0&&(h.push(d[y].shift()),m--,A=!0);if(!A)break}let g=h.length===0?`No files found matching query: ${o}`:h.length===1?`Found 1 file matching query: ${o} ${h[0]}`:`Found ${h.length} files matching query: ${o} ${h.join(` -`)}`;return new Or([new wr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(aa).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:Wn(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${Wn(xa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var wxn=new ge("findTextInFilesTool"),eet=class t extends hu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. +`)}`;return new Br([new Rr(g)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o){return(await e.ctx.get(na).findFiles({baseUri:r.uri.toString(),pattern:n,maxResults:o})).uris.slice()}async searchViaRipgrep(e,r,n,o,s){return(await e.execute(r,["--files","-g",o],s,{cwd:kn(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(l=>l.trim()).filter(l=>l.length>0).map(l=>`${kn(Sa(n.uri,l))}`)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for files matching query: ${n.query}`}:{progressMessage:"Running file_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for files matching query: ${n.query}`}:{completionMessage:"Ran file_search tool"}}static toFindFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.maxResults!=null&&(typeof e.maxResults!="number"||e.maxResults<0))throw new Error("maxResults must be a positive number or undefined");return{query:e.query,maxResults:typeof e.maxResults=="number"?e.maxResults:void 0}}};p();var Qxn=new Ae("findTextInFilesTool"),YXe=class t extends pu{static{a(this,"FindTextInFilesTool")}static{this.timeOutInSeconds=15}constructor(){super({name:"grep_search",displayName:"Find Text In Files",description:`A text search tool for finding exact text or regex patterns in files. When to Use: - Exact text or symbol searches (function names, variable names, imports) @@ -3454,13 +3485,13 @@ When NOT to Use: Usage: - Supports regex syntax when isRegexp is true (e.g., "log.*Error", "function\\s+\\w+") -- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Or([new wr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(JXe(u)){if(n.isCancellationRequested)return new Or([new wr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await ZXe(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{wxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),aa.isRegisteredScheme(To(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),wxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` -`)}`)}catch(v){if(v instanceof $y){h[_]=[];return}let b=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${_}: ${b}`)}});try{await Promise.all(m)}catch(E){let _=E instanceof Error?E.message:"An unknown error occurred";return new Or([new wr(_)],"error")}let g=[],A=l;for(;A>0;){let E=!1;for(let _ in h)h[_].length>0&&A>0&&(g.push(h[_].shift()),A--,E=!0);if(!E)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result +- Use includePattern to filter by file type (e.g., "*.js", "*.{ts,tsx}")`,displayDescription:"Do a text search in the workspace.",inputSchema:S.Object({query:S.String({description:"The pattern to search for in files in the workspace. Can be a regex or plain text pattern"}),isRegexp:S.Optional(S.Boolean({description:"Whether the pattern is a regex. False by default."})),includePattern:S.Optional(S.String({description:"Search files matching this glob pattern. Will be applied to the relative path of files within the workspace."}))})})}async invoke(e,r,n){try{let{query:o,isRegexp:s=!1,includePattern:c}=r.input,l=20,u=e.turn.workspaceFolders;if(!u?.length)return new Br([new Rr("Failed to invoke tool grep_search since no workspace folders found")],"error");let d,f;if(VXe(u)){if(n.isCancellationRequested)return new Br([new Rr("Cancelled")],"cancelled");({rgPath:d,ripgrepManager:f}=await WXe(e,"grep_search"))}let h={},m=u.map(async E=>{if(n.isCancellationRequested)throw new Error("Canceled");let _=E.uri.toString();try{Qxn.debug(e.ctx,`Start searching for query ${o} in workspace folder: ${_}`),na.isRegisteredScheme(to(E.uri).scheme)?h[_]=await this.searchViaContentProvider(e,E,o,s,c,l):h[_]=await this.searchViaRipgrep(f,d,E,o,s,c,n),Qxn.debug(e.ctx,`Finished searching for query ${o} in workspace folder: ${_} with results: ${h[_].join(` +`)}`)}catch(v){if(v instanceof Y0){h[_]=[];return}let b=v instanceof Error?v.message:"An unknown error occurred";throw new Error(`Error processing workspace folder ${_}: ${b}`)}});try{await Promise.all(m)}catch(E){let _=E instanceof Error?E.message:"An unknown error occurred";return new Br([new Rr(_)],"error")}let g=[],A=l;for(;A>0;){let E=!1;for(let _ in h)h[_].length>0&&A>0&&(g.push(h[_].shift()),A--,E=!0);if(!E)break}let y=g.length===0?`Searched text for ${o}, no results`:g.length===1?`Searched text for: ${o}, 1 result ${g[0]}`:`Searched text for: ${o}, ${g.length} results ${g.join(` -`)}`;return new Or([new wr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Or([new wr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(aa).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",Wn(n.uri)];return(await e.execute(r,u,l,{cwd:Wn(n.uri)},t.timeOutInSeconds*1e3)).split(` -`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var ret=ce(require("path"));var tet=class extends hu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=e.turn.workspaceFolders,c=e.turn.workspaceFolder,l=Ju(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Or([new wr("Error: Path is outside of workspace folders")],"error");let u=await vZe(e.ctx,l.toString());return u.length===0?new Or([new wr("Folder is empty")],"success"):new Or([new wr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` -`))],"success")}prepareInvocation(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${yA(n)}`}}prepareCompletion(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${yA(n)}`}}isPathWithinWorkspace(e,r,n){return!r&&!n?!0:r&&r.length>0?r.some(o=>this.isUriWithinDirectory(e,o.uri)):n?this.isUriWithinDirectory(e,n.uri):!1}isUriWithinDirectory(e,r){let n=ho(e),o=ho(r);if(!n||!o)return!1;let s=ret.relative(o,n);return s===""?!0:!s.startsWith("..")&&!ret.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var net=2e3,iet=class t extends hu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. +`)}`;return new Br([new Rr(y)],"success")}catch(o){let s=o instanceof Error?o.message:"An unknown error occurred";return new Br([new Rr(s)],"error")}}async searchViaContentProvider(e,r,n,o,s,c){return(await e.ctx.get(na).findTextInFiles({baseUri:r.uri.toString(),query:n,isRegexp:o,includePattern:s,maxResults:c})).matches.map(d=>`${d.uri}:${d.lineNumber}:${d.lineText}`)}async searchViaRipgrep(e,r,n,o,s,c,l){let u=[s?"--regexp":"--fixed-strings",o,...c?["-g",c]:[],"--no-heading","--line-number","--color","never",kn(n.uri)];return(await e.execute(r,u,l,{cwd:kn(n.uri)},t.timeOutInSeconds*1e3)).split(` +`).map(f=>f.trim()).filter(f=>f.length>0)}prepareInvocation(e,r){let{input:n}=e;return n.query.length?{progressMessage:`Searching for text in files matching query: ${n.query}`}:{progressMessage:"Running grep_search tool"}}prepareCompletion(e,r){let{input:n}=e;return n.query.length?{completionMessage:`Searched for text in files matching query: ${n.query}`}:{completionMessage:"Ran grep_search tool"}}static toFindTextInFilesParams(e){if(typeof e.query!="string")throw new Error("query must be a string");if(e.isRegexp!==void 0&&typeof e.isRegexp!="boolean")throw new Error("isRegexp must be a boolean");if(e.includePattern!==void 0&&typeof e.includePattern!="string")throw new Error("includePattern must be a string");return{query:e.query,isRegexp:e.isRegexp??!1,includePattern:e.includePattern}}};p();var JXe=fe(require("path"));var KXe=class extends pu{static{a(this,"ListDirTool")}constructor(){super({name:"list_dir",displayName:"List Directory",description:"List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file",displayDescription:"List the contents of a directory",inputSchema:S.Object({path:S.String({description:"The absolute path to the directory to list."})})})}async invoke(e,r,n){let{path:o}=r.input,s=e.turn.workspaceFolders,c=e.turn.workspaceFolder,l=Ju(o,e.uriSchemeCache);if(!this.isPathWithinWorkspace(l,s,c))return new Br([new Rr("Error: Path is outside of workspace folders")],"error");let u=await AZe(e.ctx,l.toString());return u.length===0?new Br([new Rr("Folder is empty")],"success"):new Br([new Rr(u.map(([d,f])=>`${d}${f&2?"/":""}`).join(` +`))],"success")}prepareInvocation(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{progressMessage:`Reading directory ${CA(n)}`}}prepareCompletion(e,r){let n=Ju(e.input.path,e.uriSchemeCache);return{completionMessage:`Read directory ${CA(n)}`}}isPathWithinWorkspace(e,r,n){return!r&&!n?!0:r&&r.length>0?r.some(o=>this.isUriWithinDirectory(e,o.uri)):n?this.isUriWithinDirectory(e,n.uri):!1}isUriWithinDirectory(e,r){let n=Ko(e),o=Ko(r);if(!n||!o)return!1;let s=JXe.relative(o,n);return s===""?!0:!s.startsWith("..")&&!JXe.isAbsolute(s)}static toListDirParams(e){if(typeof e.path!="string")throw new Error("path must be a string");return{path:e.path}}};p();var ZXe=2e3,XXe=class t extends pu{static{a(this,"ReadFileTool")}constructor(){super({name:"read_file",displayName:"Read File",description:`Read the contents of a file from the local filesystem. When to Use: - Reading known files you've already located @@ -3471,33 +3502,33 @@ Usage: - Prefer reading larger meaningful chunks over doing many small reads - You can call this tool again if initial contents are insufficient - It is always better to speculatively read multiple files as a batch that are potentially useful -- You don't need to read a file if it's already provided in context`,displayDescription:"Read a file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to read."}),offset:S.Optional(S.Number({description:"Optional: the 1-based line number to start reading from. Only use this if the file is too large to read at once. If not specified, the file will be read from the beginning."})),limit:S.Optional(S.Number({description:"Optional: the maximum number of lines to read. Only use this together with `offset` if the file is too large to read at once."}))})})}async invoke(e,r,n){try{let{filePath:o,offset:s,limit:c}=t.toReadFileParams(r.input),l=Math.min(Math.max(1,c??net),net),u=Math.max(1,s??1),d=u+l-1,f=Ju(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(Jn).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Or([new wr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Or([new wr(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),E=l!==c&&y= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var Oxe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},oet=class extends Oxe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},set=class extends Oxe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},aet=class extends Oxe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function Ces(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(Ces,"escapeRegex");function ves(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(ves,"calculateSimilarity");function a$t(t,e,r,n){let o=r.replace(/\r\n/g,` -`).replace(/\n/g,n),s=bes(t,e,o);if(s.type!=="none")return s;let c=Ses(t,e,o,n);if(c.type!=="none")return c;let l=Tes(t,e,o,n);if(l.type!=="none")return l;let u=Ies(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(a$t,"findAndReplaceOne");function bes(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(bes,"tryExactMatch");function Ses(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(Ses,"tryWhitespaceFlexibleMatch");function Tes(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` +- You don't need to read a file if it's already provided in context`,displayDescription:"Read a file in the workspace.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to read."}),offset:S.Optional(S.Number({description:"Optional: the 1-based line number to start reading from. Only use this if the file is too large to read at once. If not specified, the file will be read from the beginning."})),limit:S.Optional(S.Number({description:"Optional: the maximum number of lines to read. Only use this together with `offset` if the file is too large to read at once."}))})})}async invoke(e,r,n){try{let{filePath:o,offset:s,limit:c}=t.toReadFileParams(r.input),l=Math.min(Math.max(1,c??ZXe),ZXe),u=Math.max(1,s??1),d=u+l-1,f=Ju(o,e.uriSchemeCache);if(!f)throw new Error(`Invalid file path: ${o}`);let m=await e.ctx.get(ri).getOrReadTextDocument({uri:f});if(m.status==="valid"){let g=m.document.getText();if(g.length===0)return new Br([new Rr(`The file \`${o}\` exists, but is empty.`)],"success");if(g.trim().length===0)return new Br([new Rr(`The file \`${o}\` exists, but contains only whitespace.`)],"success");let A=m.document.lineCount,y=Math.min(d,A),E=l!==c&&y= 1), received: ${n}`)}if(o!==void 0){if(typeof o!="number")throw new Error(`limit must be a number, received: ${typeof o}`);if(o<1)throw new Error(`limit must be positive (>= 1), received: ${o}`)}return{filePath:r,offset:n,limit:o}}};p();p();var Cxe=class extends Error{static{a(this,"EditError")}constructor(e,r){super(e),this.kindForTelemetry=r}},eet=class extends Cxe{static{a(this,"NoMatchError")}constructor(e,r){super(e,"noMatchFound"),this.file=r}},tet=class extends Cxe{static{a(this,"MultipleMatchesError")}constructor(e,r){super(e,"multipleMatchesFound"),this.file=r}},ret=class extends Cxe{static{a(this,"NoChangeError")}constructor(e,r){super(e,"noChange"),this.file=r}};function IXo(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(IXo,"escapeRegex");function xXo(t,e){if(t===e)return 1;if(t.length===0||e.length===0)return 0;let r=[];for(let s=0;s<=t.length;s++)r[s]=[s];for(let s=0;s<=e.length;s++)r[0][s]=s;for(let s=1;s<=t.length;s++)for(let c=1;c<=e.length;c++){let l=t[s-1]===e[c-1]?0:1;r[s][c]=Math.min(r[s-1][c]+1,r[s][c-1]+1,r[s-1][c-1]+l)}let n=r[t.length][e.length],o=Math.max(t.length,e.length);return 1-n/o}a(xXo,"calculateSimilarity");function y$t(t,e,r,n){let o=r.replace(/\r\n/g,` +`).replace(/\n/g,n),s=wXo(t,e,o);if(s.type!=="none")return s;let c=RXo(t,e,o,n);if(c.type!=="none")return c;let l=PXo(t,e,o,n);if(l.type!=="none")return l;let u=kXo(t,e,o,n,.8);return u.type!=="none"?u:{text:t,type:"none",editPosition:[],suggestion:"Try making your search string more specific or checking for whitespace/formatting differences."}}a(y$t,"findAndReplaceOne");function wXo(t,e,r){if(e.length===0)return{text:t,editPosition:[],type:"none"};let n=[];for(let c=0;;){let l=t.indexOf(e,c);if(l===-1)break;n.push(l),c=l+e.length}if(n.length===0)return{text:t,editPosition:[],type:"none"};if(n.length>1)return{text:t,type:"multiple",editPosition:n.map(c=>[c,c+e.length]),strategy:"exact",matchPositions:n,suggestion:"Multiple exact matches found. Make your search string more specific."};let o=n[0];return{text:t.slice(0,o)+r+t.slice(o+e.length),type:"exact",editPosition:[[o,o+e.length]]}}a(wXo,"tryExactMatch");function RXo(t,e,r,n){let o=t.split(n),s=e.split(n),c=o.map(m=>m.trim()),l=s.map(m=>m.trim()),u=[];for(let m=0;m<=c.length-l.length;m++){let g=!0;for(let A=0;A1)return{text:t,type:"multiple",editPosition:[],matchPositions:u,suggestion:"Multiple matches found with flexible whitespace. Make your search string more unique.",strategy:"whitespace"};let d=u[0],f=d+l.length;return{text:[...o.slice(0,d),r,...o.slice(f)].join(n),editPosition:[[d,f]],type:"whitespace"}}a(RXo,"tryWhitespaceFlexibleMatch");function PXo(t,e,r,n){if(!e.trim())return{text:t,editPosition:[],type:"none",suggestion:"Cannot perform fuzzy match with empty search string."};let o=t.replace(/\r\n/g,` `).replace(/\r/g,` `),s=e.replace(/\r\n/g,` `).replace(/\r/g,` `);if(o.includes(s)){let E=o.indexOf(s),_=0,v=0;for(let x=0;x0;x++)t[x]==="\r"&&t[x+1]===` -`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((E,_)=>{let v=Ces(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(Tes,"tryFuzzyMatch");function Ies(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(Ies,"trySimilarityMatch");var Rxn=new ge("replaceStringTool"),cet=class extends hu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{Rxn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=Ju(o,e.uriSchemeCache);if(s===c)throw new aet("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r +`?(x++,T--,b=x+1):(T--,b=x+1);let w=t.substring(0,_),R=t.substring(b);return{text:w+r+R,editPosition:[[_,b]],type:"fuzzy"}}let c=e.endsWith(n),l=e;c&&(l=e.slice(0,-n.length));let u=l.split(n),d=u.map((E,_)=>{let v=IXo(E);return _1)return{text:t,type:"multiple",editPosition:[],suggestion:"Multiple fuzzy matches found. Try including more context in your search string.",strategy:"fuzzy",matchPositions:h.map(E=>E.index||0)};let m=h[0],g=m.index||0,A=g+m[0].length;return{text:t.slice(0,g)+r+t.slice(A),type:"fuzzy",editPosition:[[g,A]]}}a(PXo,"tryFuzzyMatch");function kXo(t,e,r,n,o=.95){if(e.length>1e3||e.split(n).length>20)return{text:t,editPosition:[],type:"none"};let s=t.split(n),c=e.split(n);if(s.length>1e3)return{text:t,editPosition:[],type:"none"};let l={index:-1,similarity:0,length:0};for(let u=0;u<=s.length-c.length;u++){let d=0;for(let h=0;ho&&f>l.similarity&&(l={index:u,similarity:f,length:c.length})}if(l.index!==-1){let u=l.index,d=[...s];return d.splice(u,l.length,...r.split(n)),{text:d.join(n),type:"similarity",editPosition:[[u,u+l.length]],similarity:l.similarity,suggestion:`Used similarity matching (${(l.similarity*100).toFixed(1)}% similar). Verify the replacement.`}}return{text:t,editPosition:[],type:"none"}}a(kXo,"trySimilarityMatch");var qxn=new Ae("replaceStringTool"),net=class extends pu{static{a(this,"ReplaceStringTool")}constructor(){super({name:"replace_string_in_file",displayName:"Replace String",description:"Replace a specific string in a file with new content. Use this tool when you need to make precise text replacements. For best results, include sufficient context (3-5 lines before and after) to make the old string unique. The system will try multiple matching strategies if exact matching fails.",displayDescription:"Replace a specific string in a file.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The exact literal text to replace. Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely."}),newString:S.String({description:"The exact literal text to replace oldString with."}),explanation:S.Optional(S.String({description:"A short explanation of the string replacement being made."}))})})}async invoke(e,r,n){let{filePath:o,oldString:s,newString:c}=r.input;try{qxn.debug(e.ctx,`Start to replace string in file: ${o}`);let l=Ju(o,e.uriSchemeCache);if(s===c)throw new ret("Input and output are identical",o);let u=await this.readFileContent(e,l,n),d=u.includes(`\r `)?`\r `:` -`,f=a$t(u,s,c,d);if(f.type==="none"&&s.endsWith(` +`,f=y$t(u,s,c,d);if(f.type==="none"&&s.endsWith(` `)){let m=s.endsWith(`\r `)?`\r `:` -`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(Rxn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=a$t(u,g,c,d))}if(f.type==="none")throw new oet(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new set(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Or([new wr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(Jn).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(us).getToolByNameAndProvider("insert_edit_into_file",$f);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(us).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: -${e}`;return new Or([new wr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${yA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Md),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${yA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var det=ce(DL());var Xf=new ge("validateCvesTool"),uet=class t extends hu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:S.Object({dependencies:S.Array(S.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:S.Enum(WUt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return Xf.debug(e.ctx,"CVE validation cancelled at start"),new Or([new wr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return Xf.debug(e.ctx,"No dependencies provided to validate"),new Or([new wr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(Xf.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return Xf.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Or([new wr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(Xf.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");Xf.debug(e.ctx,`CVE summary: ${u}`)}return new Or([new wr(l)],"success")}catch(c){if(tP(c))return Xf.debug(e.ctx,"CVE validation cancelled"),new Or([new wr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return Xf.exception(e.ctx,c,".invoke"),new Or([new wr(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){Xf.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return Xf.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw Xf.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){Xf.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),Xf.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=det.coerce(m);if(!g){f.push(h.id),Xf.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}Xf.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||det.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return Xf.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: -${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${GGt(f.summary)} +`,g=s.substring(0,s.length-m.length);u.endsWith(g)&&(qxn.info(e.ctx,`Adjusting oldString by removing trailing EOL: ${JSON.stringify(m)} for file ${o}`),f=y$t(u,g,c,d))}if(f.type==="none")throw new eet(`Could not find the specified text in the file. ${f.suggestion||""}`,o);if(f.type==="multiple")throw new tet(`Found multiple matches for the specified text. ${f.suggestion||""}`,o);if(n.isCancellationRequested)throw new Error(`Cancellation token triggered when replace string for file ${o}`);let h=await this.invokeClientEditFileTool(e,r,f.text,n);return this.getFinalReplaceStringResult(o,h)}catch(l){let u=l instanceof Error?l.message:`An unknown error occurred when updating file ${o} with oldString '${s}' to newString '${c}'`;return new Br([new Rr(u)],"error")}}async readFileContent(e,r,n){let s=await e.ctx.get(ri).getOrReadTextDocument({uri:r});if(s.status==="notfound")throw new Error(`File not found: ${r}. Details: ${s.message}`);if(s.status==="invalid")throw new Error(`Invalid file: ${r}. Reason: ${s.reason}`);return s.document.getText()}async invokeClientEditFileTool(e,r,n,o){let s=e.ctx.get(ls).getToolByNameAndProvider("insert_edit_into_file",Jf);if(!s)throw new Error("Client tool insert_edit_into_file is not registered");return e.ctx.get(ls).invokeTool(e,s.id,{toolInvocationToken:r.toolInvocationToken,input:{filePath:r.input.filePath,code:n,explanation:r.input.explanation??""},roundId:r.roundId,toolCallId:r.toolCallId},o)}getFinalReplaceStringResult(e,r){if(r.status!=="success")return r;let n=`The following files were successfully edited: +${e}`;return new Br([new Rr(n)],"success")}prepareInvocation(e,r){let{input:n}=e;if(!n.filePath.length)return{progressMessage:"Running replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{progressMessage:`Editing ${CA(o)} with replace_string_in_file tool`}}async invokeConfirmation(e,r,n){let o=e.ctx.get(Dd),s={name:this.id,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,toolCallId:r.toolCallId,roundId:r.roundId,toolMetadata:r.toolMetadata};try{return await o.invokeClientToolConfirmation(e,s)}catch{return{result:"dismiss"}}}prepareCompletion(e,r){let{input:n}=e;if(!n.filePath.length)return{completionMessage:"Ran replace_string_in_file tool"};let o=Ju(n.filePath,e.uriSchemeCache);return{completionMessage:`Edited ${CA(o)} with replace_string_in_file tool`}}static toReplaceStringParams(e){if(typeof e.filePath!="string")throw new Error("filePath must be a string");if(typeof e.oldString!="string")throw new Error("oldString must be a string");if(typeof e.newString!="string")throw new Error("newString must be a string");if(e.explanation!==void 0&&typeof e.explanation!="string")throw new Error("explanation must be a string");return{filePath:e.filePath,oldString:e.oldString,newString:e.newString,explanation:e.explanation}}};p();var oet=fe(TL());var np=new Ae("validateCvesTool"),iet=class t extends pu{static{a(this,"ValidateCvesTool")}static{this.COORDINATE_BATCH_SIZE=30}static{this.ADVISORY_PAGE_SIZE=100}constructor(){super({name:"validate_cves",displayName:"Validate CVEs",description:"Validates dependencies for known security vulnerabilities (CVEs). Returns CVE details for each affected dependency and the minimum version that resolves all known vulnerabilities.",displayDescription:"Check dependencies for CVEs",inputSchema:S.Object({dependencies:S.Array(S.String({description:'Dependencies to check for CVEs. Format: package@version (Maven uses groupId:artifactId@version, e.g., "org.springframework:spring-core@5.3.20"; others use package@version, e.g., "django@3.2.0")'})),ecosystem:S.Enum(sqt,{description:"Package ecosystem (actions, composer, erlang, go, maven, npm, nuget, pip, pub, rubygems, rust)"})})})}async invoke(e,r,n){if(n.isCancellationRequested)return np.debug(e.ctx,"CVE validation cancelled at start"),new Br([new Rr("CVE validation cancelled")],"cancelled");let{dependencies:o,ecosystem:s}=r.input;try{if(!o?.length)return np.debug(e.ctx,"No dependencies provided to validate"),new Br([new Rr("validate_cves: No dependencies to validate. Please provide a list of dependencies to check for CVEs.")],"success");if(np.info(e.ctx,`Validating ${o.length} ${s} dependencies for CVEs`,o),n.isCancellationRequested)return np.debug(e.ctx,"CVE validation cancelled before GitHub API calls"),new Br([new Rr("CVE validation cancelled")],"cancelled");let c=await this.batchGetCVEs(e,o,s,n),l=this.formatCVEResults(c);if(np.info(e.ctx,`Found ${c.length} dependencies with CVEs`),c.length>0){let u=c.map(d=>`${d.dep}: ${d.cves.length} CVEs`).join(", ");np.debug(e.ctx,`CVE summary: ${u}`)}return new Br([new Rr(l)],"success")}catch(c){if(ck(c))return np.debug(e.ctx,"CVE validation cancelled"),new Br([new Rr("CVE validation cancelled")],"cancelled");let l=c instanceof Error?c.message:String(c);return np.exception(e.ctx,c,".invoke"),new Br([new Rr(`validate_cves: Error validating CVEs: ${l}`)],"error")}}prepareInvocation(e,r){let{dependencies:n,ecosystem:o}=e.input;return{progressMessage:`validate_cves: Validating ${n.length} ${o} dependencies for CVEs...`}}prepareCompletion(e,r){let{dependencies:n,ecosystem:o}=e.input;return{completionMessage:`validate_cves: Validated ${n.length} ${o} dependencies for CVEs`}}async batchGetCVEs(e,r,n,o){np.debug(e.ctx,`Fetching CVEs for ${r.length} dependencies in batches`);let s=[];for(let c=0;c!u.withdrawn_at?.trim()).map(u=>({id:u.cve_id||u.ghsa_id,ghsa_id:u.ghsa_id,severity:u.severity,summary:u.summary,description:u.description||u.summary,html_url:u.html_url,affectedDeps:(u.vulnerabilities??[]).map(d=>({name:d.package?.name,vulVersions:d.vulnerable_version_range,patchedVersion:d.first_patched_version}))})),l=s.length-c.length;return np.debug(e.ctx,`Filtered to ${c.length} active CVEs (${l} withdrawn advisories excluded)`),this.groupCVEsByDependency(e,c,r)}catch(o){throw np.exception(e.ctx,o,".getCVEs"),o}}groupCVEsByDependency(e,r,n){np.debug(e.ctx,`Grouping CVEs by dependency for ${n.length} dependencies`);let o=[];for(let s of n){let c=s.lastIndexOf("@"),l=c>0?s.substring(0,c):s,u=r.filter(h=>h.affectedDeps.some(m=>m.name===l));if(u.length<1)continue;let d=null,f=[];for(let h of u){let m=h.affectedDeps.find(A=>A.name===l)?.patchedVersion;if(!m){f.push(h.id),np.debug(e.ctx,`CVE ${h.id} for ${s}: no patched version available (unfixable)`);continue}let g=oet.coerce(m);if(!g){f.push(h.id),np.warn(e.ctx,`CVE ${h.id} for ${s}: invalid version string "${m}" (treating as unfixable)`);continue}np.debug(e.ctx,`CVE ${h.id} for ${s}: patched version ${m}, current max ${d||"none"}`),(d===null||oet.gt(g,d))&&(d=g.version)}o.push({dep:s,cves:u,minVersion:d,unfixableCves:f})}return np.debug(e.ctx,`Grouped into ${o.length} dependencies with CVEs`),o}formatCVEResults(e){return e.length===0?"No known CVEs are found for the given dependencies.":`The following dependencies have known CVEs: +${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${t$t(f.summary)} `;return h+=` - **Severity**: **${f.severity.toUpperCase()}** -`,h+=` - **Details**: ${GGt(f.description)}`,h}).join(` +`,h+=` - **Details**: ${t$t(f.description)}`,h}).join(` - `),s=`- Dependency \`${n.dep}\` has **${n.cves.length}** known CVEs`,c=n.cves.filter(f=>!n.unfixableCves.includes(f.id)),l=c.map(f=>f.id).join(", "),u=n.unfixableCves.join(", "),d;return n.unfixableCves.length===0?d=`Upgrade to **${n.minVersion}** or higher to fix all CVEs: [${l}]`:c.length===0?d=`[${u}] cannot be fixed yet because patched versions are not available`:d=`Upgrade to **${n.minVersion}** or higher to fix [${l}]; however, [${u}] cannot be fixed yet because patched versions are not available`,`${s}: ${d} - ${o}`}).join(` -`)}`}};function xes(t){return[new tet,new iet,new KXe,new cet,new PXe,new DXe,new XXe,new eet,new uet]}a(xes,"getAllClsTools");function kxn(t,e){xes(t).forEach(e.registerTool.bind(e)),t.get(Mn).onDidSetCapabilities(r=>{t.get(uu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new Aue):r.subAgent?e.registerTool(new Aue):e.unregisterTool(new Aue),r.manageTodoListTool?e.registerTool(new AO(t)):e.unregisterTool(new AO(t)),r.watchedFiles?e.registerTool(new xxe):e.unregisterTool(new xxe)})}a(kxn,"registerAllClsTools");var us=class{constructor(e){this.ctx=e;this._toolRegistry=new CWe;kxn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new Mc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Or([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Mc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>pTn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>hTn.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(Ym.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(Ym.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(Ym.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(Ym.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get($f.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get($f.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(Ym.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(Ym.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get($f.id)?.find(m=>m.name==="create_file");if(c){let m=e.get($f.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(Ym.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(Ym.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get($f.id)??[],f=e.get(Ym.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==Ym.id&&m!==$f.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get(jp);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!NTe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Ym.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===$f.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===Ym.id||o.toolProvider.id===$f.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===Ym.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===$f.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(NTe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===$f.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Ym.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Ym.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var Sq=class extends fQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:$f,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(v_).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Mc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(Md).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var P={};wi(P,{$brand:()=>c$t,$input:()=>izt,$output:()=>nzt,NEVER:()=>Lxe,TimePrecision:()=>azt,ZodAny:()=>cwn,ZodArray:()=>fwn,ZodBase64:()=>AYt,ZodBase64URL:()=>yYt,ZodBigInt:()=>bwe,ZodBigIntFormat:()=>CYt,ZodBoolean:()=>vwe,ZodCIDRv4:()=>mYt,ZodCIDRv6:()=>gYt,ZodCUID:()=>cYt,ZodCUID2:()=>lYt,ZodCatch:()=>xwn,ZodCustom:()=>att,ZodCustomStringFormat:()=>iwn,ZodDate:()=>itt,ZodDefault:()=>Cwn,ZodDiscriminatedUnion:()=>pwn,ZodE164:()=>EYt,ZodEmail:()=>nYt,ZodEmoji:()=>sYt,ZodEnum:()=>Ewe,ZodError:()=>frs,ZodFile:()=>Ewn,ZodGUID:()=>Xet,ZodIPv4:()=>pYt,ZodIPv6:()=>hYt,ZodISODate:()=>Ket,ZodISODateTime:()=>Yet,ZodISODuration:()=>Zet,ZodISOTime:()=>Jet,ZodIntersection:()=>hwn,ZodIssueCode:()=>PYt,ZodJWT:()=>_Yt,ZodKSUID:()=>fYt,ZodLazy:()=>Nwn,ZodLiteral:()=>ywn,ZodMap:()=>gwn,ZodNaN:()=>Rwn,ZodNanoID:()=>aYt,ZodNever:()=>uwn,ZodNonOptional:()=>wYt,ZodNull:()=>awn,ZodNullable:()=>_wn,ZodNumber:()=>Cwe,ZodNumberFormat:()=>Lue,ZodObject:()=>ott,ZodOptional:()=>xYt,ZodPipe:()=>RYt,ZodPrefault:()=>bwn,ZodPromise:()=>Own,ZodReadonly:()=>kwn,ZodRealError:()=>Bue,ZodRecord:()=>SYt,ZodSet:()=>Awn,ZodString:()=>_we,ZodStringFormat:()=>mu,ZodSuccess:()=>Iwn,ZodSymbol:()=>own,ZodTemplateLiteral:()=>Dwn,ZodTransform:()=>TYt,ZodTuple:()=>mwn,ZodType:()=>Is,ZodULID:()=>uYt,ZodURL:()=>iYt,ZodUUID:()=>V3,ZodUndefined:()=>swn,ZodUnion:()=>bYt,ZodUnknown:()=>lwn,ZodVoid:()=>dwn,ZodXID:()=>dYt,_ZodString:()=>rYt,_default:()=>vwn,any:()=>vYt,array:()=>Fr,base64:()=>Prs,base64url:()=>Drs,bigint:()=>Qrs,boolean:()=>tl,catch:()=>wwn,check:()=>Bwn,cidrv4:()=>Rrs,cidrv6:()=>krs,clone:()=>HS,coerce:()=>Twe,config:()=>zh,core:()=>$3,cuid:()=>vrs,cuid2:()=>brs,custom:()=>kYt,date:()=>Vrs,discriminatedUnion:()=>stt,e164:()=>Nrs,email:()=>hrs,emoji:()=>_rs,endsWith:()=>dwe,enum:()=>Q_,file:()=>ens,flattenError:()=>Vxe,float32:()=>Brs,float64:()=>Lrs,formatError:()=>Wxe,function:()=>$zt,getErrorMap:()=>uns,globalRegistry:()=>RO,gt:()=>H3,gte:()=>jv,guid:()=>mrs,includes:()=>lwe,instanceof:()=>sns,int:()=>tYt,int32:()=>Frs,int64:()=>qrs,intersection:()=>Swe,ipv4:()=>xrs,ipv6:()=>wrs,iso:()=>Oue,json:()=>cns,jwt:()=>Mrs,keyof:()=>Wrs,ksuid:()=>Irs,lazy:()=>Mwn,length:()=>Mue,literal:()=>Hn,locales:()=>nwe,looseObject:()=>Yh,lowercase:()=>awe,lt:()=>j3,lte:()=>Jx,map:()=>Jrs,maxLength:()=>Nue,maxSize:()=>Due,mime:()=>fwe,minLength:()=>Iq,minSize:()=>tJ,multipleOf:()=>eJ,nan:()=>nns,nanoid:()=>Crs,nativeEnum:()=>Xrs,negative:()=>Ozt,never:()=>ntt,nonnegative:()=>Lzt,nonoptional:()=>Twn,nonpositive:()=>Bzt,normalize:()=>pwe,null:()=>rtt,nullable:()=>ett,nullish:()=>tns,number:()=>Ra,object:()=>Wr,optional:()=>gu,overwrite:()=>G3,parse:()=>Jzt,parseAsync:()=>Zzt,partialRecord:()=>Krs,pipe:()=>ttt,positive:()=>Mzt,prefault:()=>Swn,preprocess:()=>ctt,prettifyError:()=>C$t,promise:()=>ons,property:()=>Fzt,readonly:()=>Pwn,record:()=>vl,refine:()=>Lwn,regex:()=>swe,regexes:()=>JK,registry:()=>Iet,safeParse:()=>Xzt,safeParseAsync:()=>eYt,set:()=>Zrs,setErrorMap:()=>lns,size:()=>owe,startsWith:()=>uwe,strictObject:()=>zrs,string:()=>qe,stringFormat:()=>Ors,stringbool:()=>ans,success:()=>rns,superRefine:()=>Fwn,symbol:()=>Hrs,templateLiteral:()=>ins,toJSONSchema:()=>Vzt,toLowerCase:()=>mwe,toUpperCase:()=>gwe,transform:()=>IYt,treeifyError:()=>_$t,trim:()=>hwe,tuple:()=>Yrs,uint32:()=>Urs,uint64:()=>jrs,ulid:()=>Srs,undefined:()=>Grs,union:()=>Cl,unknown:()=>Zu,uppercase:()=>cwe,url:()=>oYt,uuid:()=>grs,uuidv4:()=>Ars,uuidv6:()=>yrs,uuidv7:()=>Ers,void:()=>$rs,xid:()=>Trs});p();var $3={};wi($3,{$ZodAny:()=>WVt,$ZodArray:()=>Xxe,$ZodAsyncError:()=>wO,$ZodBase64:()=>LVt,$ZodBase64URL:()=>FVt,$ZodBigInt:()=>bet,$ZodBigIntFormat:()=>HVt,$ZodBoolean:()=>Zxe,$ZodCIDRv4:()=>MVt,$ZodCIDRv6:()=>OVt,$ZodCUID:()=>bVt,$ZodCUID2:()=>SVt,$ZodCatch:()=>fWt,$ZodCheck:()=>mf,$ZodCheckBigIntFormat:()=>X$t,$ZodCheckEndsWith:()=>dVt,$ZodCheckGreaterThan:()=>Eet,$ZodCheckIncludes:()=>lVt,$ZodCheckLengthEquals:()=>oVt,$ZodCheckLessThan:()=>yet,$ZodCheckLowerCase:()=>aVt,$ZodCheckMaxLength:()=>nVt,$ZodCheckMaxSize:()=>eVt,$ZodCheckMimeType:()=>pVt,$ZodCheckMinLength:()=>iVt,$ZodCheckMinSize:()=>tVt,$ZodCheckMultipleOf:()=>J$t,$ZodCheckNumberFormat:()=>Z$t,$ZodCheckOverwrite:()=>hVt,$ZodCheckProperty:()=>fVt,$ZodCheckRegex:()=>sVt,$ZodCheckSizeEquals:()=>rVt,$ZodCheckStartsWith:()=>uVt,$ZodCheckStringFormat:()=>wue,$ZodCheckUpperCase:()=>cVt,$ZodCustom:()=>yWt,$ZodCustomStringFormat:()=>qVt,$ZodDate:()=>KVt,$ZodDefault:()=>cWt,$ZodDiscriminatedUnion:()=>ZVt,$ZodE164:()=>UVt,$ZodEmail:()=>EVt,$ZodEmoji:()=>CVt,$ZodEnum:()=>nWt,$ZodError:()=>$xe,$ZodFile:()=>oWt,$ZodFunction:()=>zet,$ZodGUID:()=>AVt,$ZodIPv4:()=>DVt,$ZodIPv6:()=>NVt,$ZodISODate:()=>RVt,$ZodISODateTime:()=>wVt,$ZodISODuration:()=>PVt,$ZodISOTime:()=>kVt,$ZodIntersection:()=>XVt,$ZodJWT:()=>QVt,$ZodKSUID:()=>xVt,$ZodLazy:()=>AWt,$ZodLiteral:()=>iWt,$ZodMap:()=>tWt,$ZodNaN:()=>pWt,$ZodNanoID:()=>vVt,$ZodNever:()=>zVt,$ZodNonOptional:()=>uWt,$ZodNull:()=>VVt,$ZodNullable:()=>aWt,$ZodNumber:()=>vet,$ZodNumberFormat:()=>jVt,$ZodObject:()=>JVt,$ZodOptional:()=>sWt,$ZodPipe:()=>twe,$ZodPrefault:()=>lWt,$ZodPromise:()=>gWt,$ZodReadonly:()=>hWt,$ZodRealError:()=>Iue,$ZodRecord:()=>eWt,$ZodRegistry:()=>kue,$ZodSet:()=>rWt,$ZodString:()=>ZK,$ZodStringFormat:()=>ql,$ZodSuccess:()=>dWt,$ZodSymbol:()=>GVt,$ZodTemplateLiteral:()=>mWt,$ZodTransform:()=>ewe,$ZodTuple:()=>XK,$ZodType:()=>uo,$ZodULID:()=>TVt,$ZodURL:()=>_Vt,$ZodUUID:()=>yVt,$ZodUndefined:()=>$Vt,$ZodUnion:()=>Tet,$ZodUnknown:()=>Rue,$ZodVoid:()=>YVt,$ZodXID:()=>IVt,$brand:()=>c$t,$constructor:()=>it,$input:()=>izt,$output:()=>nzt,Doc:()=>Jxe,JSONSchema:()=>twn,JSONSchemaGenerator:()=>ywe,NEVER:()=>Lxe,TimePrecision:()=>azt,_any:()=>wzt,_array:()=>Awe,_base64:()=>Get,_base64url:()=>$et,_bigint:()=>Czt,_boolean:()=>Ezt,_catch:()=>ors,_cidrv4:()=>jet,_cidrv6:()=>Het,_coercedBigint:()=>vzt,_coercedBoolean:()=>_zt,_coercedDate:()=>Dzt,_coercedNumber:()=>pzt,_coercedString:()=>szt,_cuid:()=>Oet,_cuid2:()=>Bet,_custom:()=>qzt,_date:()=>Pzt,_default:()=>rrs,_discriminatedUnion:()=>$ts,_e164:()=>Vet,_email:()=>xet,_emoji:()=>Net,_endsWith:()=>dwe,_enum:()=>Kts,_file:()=>Qzt,_float32:()=>mzt,_float64:()=>gzt,_gt:()=>H3,_gte:()=>jv,_guid:()=>iwe,_includes:()=>lwe,_int:()=>hzt,_int32:()=>Azt,_int64:()=>bzt,_intersection:()=>Vts,_ipv4:()=>Qet,_ipv6:()=>qet,_isoDate:()=>lzt,_isoDateTime:()=>czt,_isoDuration:()=>dzt,_isoTime:()=>uzt,_jwt:()=>Wet,_ksuid:()=>Uet,_lazy:()=>lrs,_length:()=>Mue,_literal:()=>Zts,_lowercase:()=>awe,_lt:()=>j3,_lte:()=>Jx,_map:()=>zts,_max:()=>Jx,_maxLength:()=>Nue,_maxSize:()=>Due,_mime:()=>fwe,_min:()=>jv,_minLength:()=>Iq,_minSize:()=>tJ,_multipleOf:()=>eJ,_nan:()=>Nzt,_nanoid:()=>Met,_nativeEnum:()=>Jts,_negative:()=>Ozt,_never:()=>Rzt,_nonnegative:()=>Lzt,_nonoptional:()=>nrs,_nonpositive:()=>Bzt,_normalize:()=>pwe,_null:()=>xzt,_nullable:()=>trs,_number:()=>fzt,_optional:()=>ers,_overwrite:()=>G3,_parse:()=>pet,_parseAsync:()=>het,_pipe:()=>srs,_positive:()=>Mzt,_promise:()=>urs,_property:()=>Fzt,_readonly:()=>ars,_record:()=>Wts,_refine:()=>jzt,_regex:()=>swe,_safeParse:()=>met,_safeParseAsync:()=>get,_set:()=>Yts,_size:()=>owe,_startsWith:()=>uwe,_string:()=>ozt,_stringFormat:()=>Gzt,_stringbool:()=>Hzt,_success:()=>irs,_symbol:()=>Tzt,_templateLiteral:()=>crs,_toLowerCase:()=>mwe,_toUpperCase:()=>gwe,_transform:()=>Xts,_trim:()=>hwe,_tuple:()=>Uzt,_uint32:()=>yzt,_uint64:()=>Szt,_ulid:()=>Let,_undefined:()=>Izt,_union:()=>Gts,_unknown:()=>Pue,_uppercase:()=>cwe,_url:()=>Det,_uuid:()=>wet,_uuidv4:()=>Ret,_uuidv6:()=>ket,_uuidv7:()=>Pet,_void:()=>kzt,_xid:()=>Fet,clone:()=>HS,config:()=>zh,flattenError:()=>Vxe,formatError:()=>Wxe,function:()=>$zt,globalConfig:()=>Bxe,globalRegistry:()=>RO,isValidBase64:()=>BVt,isValidBase64URL:()=>Kxn,isValidJWT:()=>Jxn,locales:()=>nwe,parse:()=>zxe,parseAsync:()=>Yxe,prettifyError:()=>C$t,regexes:()=>JK,registry:()=>Iet,safeParse:()=>xue,safeParseAsync:()=>Kxe,toDotPath:()=>Dxn,toJSONSchema:()=>Vzt,treeifyError:()=>_$t,util:()=>qr,version:()=>mVt});p();p();var Lxe=Object.freeze({status:"aborted"});function it(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(it,"$constructor");var c$t=Symbol("zod_brand"),wO=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Bxe={};function zh(t){return t&&Object.assign(Bxe,t),Bxe}a(zh,"config");p();p();var qr={};wi(qr,{BIGINT_FORMAT_RANGES:()=>y$t,Class:()=>u$t,NUMBER_FORMAT_RANGES:()=>A$t,aborted:()=>YK,allowsEval:()=>h$t,assert:()=>Des,assertEqual:()=>wes,assertIs:()=>kes,assertNever:()=>Pes,assertNotEqual:()=>Res,assignProp:()=>p$t,cached:()=>Qxe,captureStackTrace:()=>fet,cleanEnum:()=>$es,cleanRegex:()=>qxe,clone:()=>HS,createTransparentProxy:()=>Fes,defineLazy:()=>Tc,esc:()=>zK,escapeRegex:()=>q3,extend:()=>qes,finalizeIssue:()=>GS,floatSafeRemainder:()=>f$t,getElementAtPath:()=>Nes,getEnumValues:()=>Uxe,getLengthableOrigin:()=>Gxe,getParsedType:()=>Les,getSizableOrigin:()=>Hxe,isObject:()=>Sue,isPlainObject:()=>Tue,issue:()=>E$t,joinValues:()=>Ft,jsonStringifyReplacer:()=>d$t,merge:()=>jes,normalizeParams:()=>Tr,nullish:()=>Tq,numKeys:()=>Bes,omit:()=>Qes,optionalKeys:()=>g$t,partial:()=>Hes,pick:()=>Ues,prefixIssues:()=>qv,primitiveTypes:()=>m$t,promiseAllObject:()=>Mes,propertyKeyTypes:()=>jxe,randomString:()=>Oes,required:()=>Ges,stringifyPrimitive:()=>Qr,unwrapMessage:()=>Fxe});p();function wes(t){return t}a(wes,"assertEqual");function Res(t){return t}a(Res,"assertNotEqual");function kes(t){}a(kes,"assertIs");function Pes(t){throw new Error}a(Pes,"assertNever");function Des(t){}a(Des,"assert");function Uxe(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(Uxe,"getEnumValues");function Ft(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(Ft,"joinValues");function d$t(t,e){return typeof e=="bigint"?e.toString():e}a(d$t,"jsonStringifyReplacer");function Qxe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(Qxe,"cached");function Tq(t){return t==null}a(Tq,"nullish");function qxe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(qxe,"cleanRegex");function f$t(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}a(f$t,"floatSafeRemainder");function Tc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(Tc,"defineLazy");function p$t(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(p$t,"assignProp");function Nes(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(Nes,"getElementAtPath");function Mes(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function Sue(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(Sue,"isObject");var h$t=Qxe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Tue(t){if(Sue(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(Sue(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Tue,"isPlainObject");function Bes(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(Bes,"numKeys");var Les=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),jxe=new Set(["string","number","symbol"]),m$t=new Set(["string","number","bigint","boolean","symbol","undefined"]);function q3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(q3,"escapeRegex");function HS(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(HS,"clone");function Tr(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(Tr,"normalizeParams");function Fes(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(Fes,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function g$t(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(g$t,"optionalKeys");var A$t={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},y$t={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ues(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return HS(t,{...t._zod.def,shape:r,checks:[]})}a(Ues,"pick");function Qes(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return HS(t,{...t._zod.def,shape:r,checks:[]})}a(Qes,"omit");function qes(t,e){if(!Tue(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return p$t(this,"shape",n),n},checks:[]};return HS(t,r)}a(qes,"extend");function jes(t,e){return HS(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return p$t(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(jes,"merge");function Hes(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return HS(e,{...e._zod.def,shape:o,checks:[]})}a(Hes,"partial");function Ges(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return HS(e,{...e._zod.def,shape:o,checks:[]})}a(Ges,"required");function YK(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(qv,"prefixIssues");function Fxe(t){return typeof t=="string"?t:t?.message}a(Fxe,"unwrapMessage");function GS(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Fxe(t.inst?._zod.def?.error?.(t))??Fxe(e?.error?.(t))??Fxe(r.customError?.(t))??Fxe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(GS,"finalizeIssue");function Hxe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Hxe,"getSizableOrigin");function Gxe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(Gxe,"getLengthableOrigin");function E$t(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(E$t,"issue");function $es(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a($es,"cleanEnum");var u$t=class{static{a(this,"Class")}constructor(...e){}};var Pxn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,d$t,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),$xe=it("$ZodError",Pxn),Iue=it("$ZodError",Pxn,{Parent:Error});function Vxe(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(Vxe,"flattenError");function Wxe(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Dxn(n.path)}`);return e.join(` -`)}a(C$t,"prettifyError");var pet=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new wO;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>GS(u,s,zh())));throw fet(l,o?.callee),l}return c.value},"_parse"),zxe=pet(Iue),het=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>GS(u,s,zh())));throw fet(l,o?.callee),l}return c.value},"_parseAsync"),Yxe=het(Iue),met=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new wO;return s.issues.length?{success:!1,error:new(t??$xe)(s.issues.map(c=>GS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParse"),xue=met(Iue),get=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>GS(c,o,zh())))}:{success:!0,data:s.value}},"_safeParseAsync"),Kxe=get(Iue);p();p();var JK={};wi(JK,{_emoji:()=>Nxn,base64:()=>B$t,base64url:()=>Aet,bigint:()=>H$t,boolean:()=>V$t,browserEmail:()=>ets,cidrv4:()=>M$t,cidrv6:()=>O$t,cuid:()=>v$t,cuid2:()=>b$t,date:()=>U$t,datetime:()=>q$t,domain:()=>tts,duration:()=>w$t,e164:()=>F$t,email:()=>k$t,emoji:()=>P$t,extendedDuration:()=>Wes,guid:()=>R$t,hostname:()=>L$t,html5Email:()=>Jes,integer:()=>G$t,ipv4:()=>D$t,ipv6:()=>N$t,ksuid:()=>I$t,lowercase:()=>Y$t,nanoid:()=>x$t,null:()=>W$t,number:()=>$$t,rfc5322Email:()=>Zes,string:()=>j$t,time:()=>Q$t,ulid:()=>S$t,undefined:()=>z$t,unicodeEmail:()=>Xes,uppercase:()=>K$t,uuid:()=>KK,uuid4:()=>zes,uuid6:()=>Yes,uuid7:()=>Kes,xid:()=>T$t});p();var v$t=/^[cC][^\s-]{8,}$/,b$t=/^[0-9a-z]+$/,S$t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,T$t=/^[0-9a-vA-V]{20}$/,I$t=/^[A-Za-z0-9]{27}$/,x$t=/^[a-zA-Z0-9_-]{21}$/,w$t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Wes=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,R$t=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,KK=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"uuid"),zes=KK(4),Yes=KK(6),Kes=KK(7),k$t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Jes=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Zes=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Xes=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ets=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Nxn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function P$t(){return new RegExp(Nxn,"u")}a(P$t,"emoji");var D$t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,N$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,M$t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,O$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,B$t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Aet=/^[A-Za-z0-9_-]*$/,L$t=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,tts=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,F$t=/^\+(?:[0-9]){6,14}[0-9]$/,Mxn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",U$t=new RegExp(`^${Mxn}$`);function Oxn(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Oxn,"timeSource");function Q$t(t){return new RegExp(`^${Oxn(t)}$`)}a(Q$t,"time");function q$t(t){let e=Oxn({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Mxn}T(?:${n})$`)}a(q$t,"datetime");var j$t=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),H$t=/^\d+n?$/,G$t=/^\d+$/,$$t=/^-?\d+(?:\.\d+)?/i,V$t=/true|false/i,W$t=/null/i;var z$t=/undefined/i;var Y$t=/^[^A-Z]*$/,K$t=/^[^a-z]*$/;var mf=it("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Lxn={number:"number",bigint:"bigint",object:"date"},yet=it("$ZodCheckLessThan",(t,e)=>{mf.init(t,e);let r=Lxn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{mf.init(t,e);let r=Lxn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),J$t=it("$ZodCheckMultipleOf",(t,e)=>{mf.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):f$t(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Z$t=it("$ZodCheckNumberFormat",(t,e)=>{mf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=A$t[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=G$t)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),X$t=it("$ZodCheckBigIntFormat",(t,e)=>{mf.init(t,e);let[r,n]=y$t[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),eVt=it("$ZodCheckMaxSize",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:Hxe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),tVt=it("$ZodCheckMinSize",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:Hxe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),rVt=it("$ZodCheckSizeEquals",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:Hxe(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),nVt=it("$ZodCheckMaxLength",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=Gxe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),iVt=it("$ZodCheckMinLength",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=Gxe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),oVt=it("$ZodCheckLengthEquals",(t,e)=>{var r;mf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Tq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=Gxe(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),wue=it("$ZodCheckStringFormat",(t,e)=>{var r,n;mf.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),sVt=it("$ZodCheckRegex",(t,e)=>{wue.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),aVt=it("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Y$t),wue.init(t,e)}),cVt=it("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=K$t),wue.init(t,e)}),lVt=it("$ZodCheckIncludes",(t,e)=>{mf.init(t,e);let r=q3(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),uVt=it("$ZodCheckStartsWith",(t,e)=>{mf.init(t,e);let r=new RegExp(`^${q3(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),dVt=it("$ZodCheckEndsWith",(t,e)=>{mf.init(t,e);let r=new RegExp(`.*${q3(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function Bxn(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues))}a(Bxn,"handleCheckPropertyResult");var fVt=it("$ZodCheckProperty",(t,e)=>{mf.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>Bxn(o,r,e.property));Bxn(n,r,e.property)}}),pVt=it("$ZodCheckMimeType",(t,e)=>{mf.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),hVt=it("$ZodCheckOverwrite",(t,e)=>{mf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var Jxe=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` +`)}`}};function DXo(t){return[new KXe,new XXe,new $Xe,new net,new IXe,new xXe,new zXe,new YXe,new iet]}a(DXo,"getAllClsTools");function jxn(t,e){DXo(t).forEach(e.registerTool.bind(e)),t.get(On).onDidSetCapabilities(r=>{t.get(lu).getPolicyValue("subagent.enabled")===!1?e.unregisterTool(new hue):r.subAgent?e.registerTool(new hue):e.unregisterTool(new hue),r.manageTodoListTool?e.registerTool(new dO(t)):e.unregisterTool(new dO(t)),r.watchedFiles?e.registerTool(new hxe):e.unregisterTool(new hxe)})}a(jxn,"registerAllClsTools");var ls=class{constructor(e){this.ctx=e;this._toolRegistry=new $ze;jxn(e,this)}static{a(this,"ToolsService")}registerTool(e){this._toolRegistry.registerTool(e)}unregisterTool(e){return typeof e=="string"?this._toolRegistry.unregisterTool(e):this._toolRegistry.unregisterTool(e.id)}prepareInvocation(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareInvocation?.(r,n)??{}}prepareCompletion(e,r,n){let o=this._toolRegistry.getTool(e);if(!o)throw new Error(`Tool with id '${e}' is undefined`);return o.prepareCompletion?.(r,n)??{}}async invokeTool(e,r,n,o){if(o.isCancellationRequested)throw new Dc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invoke?.(e,n,o)??new Br([],"success")}async invokeToolConfirmation(e,r,n,o){if(o.isCancellationRequested)throw new Dc;let s=this._toolRegistry.getTool(r);if(!s)throw new Error(`Tool with id '${r}' is undefined`);return await s.invokeConfirmation?.(e,n,o)??{result:"dismiss"}}getToolById(e){return this._toolRegistry.getTool(e)}getToolByNameAndProvider(e,r){return this._toolRegistry.listTools().find(n=>n.name===e&&n.toolProvider.id===r.id)}getToolsForModel(e){if(e&&e.customTools!==void 0){if(e.customTools.length===0)return[];let r=new Set(e.customTools);return Array.from(this.getToolMapForModel().values()).filter(n=>r.has(n.configurationKey))}return e?.kind==="Ask"?Array.from(this.getToolMapForModel().values()).filter(r=>TTn.has(r.name)):e?.kind==="InlineAgent"?Array.from(this.getToolMapForModel().values()).filter(r=>ITn.has(r.name)):Array.from(this.getToolMapForModel().values()).filter(r=>r.status==="enabled")}getToolMapForModel(){let e=new Map;for(let m of this._toolRegistry.listTools())e.has(m.toolProvider.id)||e.set(m.toolProvider.id,[]),e.get(m.toolProvider.id)?.push(m);let r=e.get(Xm.id)?.find(m=>m.name==="insert_edit_into_file");if(r){let m=e.get(Xm.id),g=m?.indexOf(r)??-1;g>=0&&m?.splice(g,1)}let n=e.get(Xm.id)?.find(m=>m.name==="replace_string_in_file");if(n){let m=e.get(Xm.id),g=m?.indexOf(n)??-1;g>=0&&m?.splice(g,1)}let o=e.get(Jf.id)?.find(m=>m.name==="insert_edit_into_file");if(o){let m=e.get(Jf.id),g=m?.indexOf(o)??-1;g>=0&&m?.splice(g,1)}let s=e.get(Xm.id)?.find(m=>m.name==="create_file");if(s){let m=e.get(Xm.id),g=m?.indexOf(s)??-1;g>=0&&m?.splice(g,1)}let c=e.get(Jf.id)?.find(m=>m.name==="create_file");if(c){let m=e.get(Jf.id),g=m?.indexOf(c)??-1;g>=0&&m?.splice(g,1)}let l=e.get(Xm.id)?.find(m=>m.name==="apply_patch");if(l){let m=e.get(Xm.id),g=m?.indexOf(l)??-1;g>=0&&m?.splice(g,1)}let u=new Map;r&&o&&u.set(r.nameForModel,r),n&&o&&u.set(n.nameForModel,n),s&&c&&u.set(s.nameForModel,s),l&&o&&c&&u.set(l.nameForModel,l);let d=e.get(Jf.id)??[],f=e.get(Xm.id)??[],h=Array.from(e.entries()).filter(([m])=>m!==Xm.id&&m!==Jf.id).flatMap(([,m])=>m);return d.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),f.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),h.forEach(m=>{u.has(m.nameForModel)||u.set(m.nameForModel,m)}),u}async updateToolStatusByName(e,r,n){let o=this.guessTool(e,r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async updateToolStatus(e,r,n){let o=this.getToolsToUpdate(r);o.length!==0&&await this.doUpdateToolStatus(e,o,n)}async doUpdateToolStatus(e,r,n){let o;Array.isArray(r)?o=r:o=[r],await this.doUpdateToolsStatus(e,o.map(s=>({tool:s,status:n})))}async updateToolsStatusByName(e,r){let n=r.flatMap(({toolName:o,status:s})=>this.guessTool(e,o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async updateToolsStatus(e,r){let n=r.flatMap(({toolId:o,status:s})=>this.getToolsToUpdate(o).map(l=>({tool:l,status:s})));await this.doUpdateToolsStatus(e,n)}async doUpdateToolsStatus(e,r){let n=r.map(({tool:c,status:l})=>this.prepareUpdateToolStatus(e,c,l)).flat();function o(c){return c.shouldUpdate?c.shouldUpdate():!0}a(o,"shouldUpdate");let s=new Map;for(let c of n)!c||!o(c)||(c.type==="memory"?c.tool.status=c.status:c.type==="customAgent"&&(s.has(c.customAgent.id)||s.set(c.customAgent.id,{agent:c.customAgent,options:[]}),s.get(c.customAgent.id).options.push({toolConfigurationKey:c.tool.configurationKey,status:c.status})));if(s.size>0){let c=this.ctx.get($p);for(let[l,{agent:u,options:d}]of s)await c.updateCustomAgent(u,{updateToolOptions:d})}}guessTool(e,r){let n=this._toolRegistry.listTools().filter(o=>o.name===r);if(!XTe(e)){let o=new Set,s=[];for(let c of n)o.has(c.configurationKey)||(o.add(c.configurationKey),s.push(c));return s}if(r==="insert_edit_into_file"||r==="replace_string_in_file"){let o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Xm.id&&c.name===r),s=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Jf.id&&c.name==="insert_edit_into_file");return o&&s?[o,s]:[]}return n.length===0?[]:n.length===1||n.length===2&&n.every(o=>o.toolProvider.id===Xm.id||o.toolProvider.id===Jf.id)?n:[]}getToolsToUpdate(e){let r=this._toolRegistry.getTool(e);if(!r)return[];if((r.name==="insert_edit_into_file"||r.name==="replace_string_in_file")&&r.toolProvider.id===Xm.id){let n=this._toolRegistry.listTools().find(o=>o.toolProvider.id===Jf.id&&o.name==="insert_edit_into_file");if(n)return[r,n]}return[r]}prepareUpdateToolStatus(e,r,n){if(XTe(e))return r.name==="insert_edit_into_file"&&r.toolProvider.id===Jf.id?[this.prepareUpdateEditorEditFileToolStatus(r,n)]:[{type:"memory",tool:r,status:n}];if(e.source&&!e.source.isReadonly){let o=e.source;return!o.tools||(o.tools.some(c=>c==r?.configurationKey)?"enabled":"disabled")===n?void 0:[{type:"customAgent",customAgent:o,tool:r,status:n}]}}prepareUpdateEditorEditFileToolStatus(e,r){if(r==="enabled")return{type:"memory",tool:e,status:"enabled"};let n=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Xm.id&&c.name==="insert_edit_into_file"),o=this._toolRegistry.listTools().find(c=>c.toolProvider.id===Xm.id&&c.name==="replace_string_in_file");function s(c){return!c||c.status==="disabled"}return a(s,"isToolDisabled"),{type:"memory",tool:e,status:"disabled",shouldUpdate:a(()=>s(n)&&s(o),"shouldUpdate")}}};p();var yq=class extends wQ{static{a(this,"ClientLanguageModelTool")}constructor(e){super({...e,toolProvider:Jf,type:"client"}),this.confirmationMessages=e.confirmationMessages}prepareInvocation(e,r){return{progressMessage:`Running ${this.name} tool`,confirmationMessages:this.confirmationMessages}}prepareCompletion(e,r){return{completionMessage:`Ran ${this.name} tool`}}async invoke(e,r,n){let o={name:this.name,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId};try{return await e.ctx.get(v_).invokeClientTool(e,o)}catch(s){throw new Error(`Failed to invoke client tool ${this.name}: ${String(s)}`)}}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Dc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations,toolMetadata:r.toolMetadata};try{return await e.ctx.get(Dd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};p();p();var k={};xi(k,{$brand:()=>E$t,$input:()=>mzt,$output:()=>hzt,NEVER:()=>Sxe,TimePrecision:()=>yzt,ZodAny:()=>_wn,ZodArray:()=>Swn,ZodBase64:()=>wYt,ZodBase64URL:()=>RYt,ZodBigInt:()=>uwe,ZodBigIntFormat:()=>DYt,ZodBoolean:()=>lwe,ZodCIDRv4:()=>IYt,ZodCIDRv6:()=>xYt,ZodCUID:()=>EYt,ZodCUID2:()=>_Yt,ZodCatch:()=>Uwn,ZodCustom:()=>rtt,ZodCustomStringFormat:()=>gwn,ZodDate:()=>Xet,ZodDefault:()=>Nwn,ZodDiscriminatedUnion:()=>Twn,ZodE164:()=>PYt,ZodEmail:()=>hYt,ZodEmoji:()=>AYt,ZodEnum:()=>swe,ZodError:()=>Ats,ZodFile:()=>kwn,ZodGUID:()=>zet,ZodIPv4:()=>SYt,ZodIPv6:()=>TYt,ZodISODate:()=>$et,ZodISODateTime:()=>Get,ZodISODuration:()=>Wet,ZodISOTime:()=>Vet,ZodIntersection:()=>Iwn,ZodIssueCode:()=>jYt,ZodJWT:()=>kYt,ZodKSUID:()=>bYt,ZodLazy:()=>$wn,ZodLiteral:()=>Pwn,ZodMap:()=>wwn,ZodNaN:()=>qwn,ZodNanoID:()=>yYt,ZodNever:()=>Cwn,ZodNonOptional:()=>UYt,ZodNull:()=>Ewn,ZodNullable:()=>Dwn,ZodNumber:()=>cwe,ZodNumberFormat:()=>Mue,ZodObject:()=>ett,ZodOptional:()=>FYt,ZodPipe:()=>QYt,ZodPrefault:()=>Own,ZodPromise:()=>Wwn,ZodReadonly:()=>jwn,ZodRealError:()=>Nue,ZodRecord:()=>OYt,ZodSet:()=>Rwn,ZodString:()=>awe,ZodStringFormat:()=>hu,ZodSuccess:()=>Fwn,ZodSymbol:()=>Awn,ZodTemplateLiteral:()=>Gwn,ZodTransform:()=>BYt,ZodTuple:()=>xwn,ZodType:()=>Ss,ZodULID:()=>vYt,ZodURL:()=>mYt,ZodUUID:()=>Q3,ZodUndefined:()=>ywn,ZodUnion:()=>MYt,ZodUnknown:()=>vwn,ZodVoid:()=>bwn,ZodXID:()=>CYt,_ZodString:()=>pYt,_default:()=>Mwn,any:()=>NYt,array:()=>Ur,base64:()=>Bts,base64url:()=>Lts,bigint:()=>$ts,boolean:()=>Xc,catch:()=>Qwn,check:()=>zwn,cidrv4:()=>Mts,cidrv6:()=>Ots,clone:()=>LS,coerce:()=>fwe,config:()=>Kh,core:()=>U3,cuid:()=>xts,cuid2:()=>wts,custom:()=>qYt,date:()=>Jts,discriminatedUnion:()=>ttt,e164:()=>Fts,email:()=>Ets,emoji:()=>Tts,endsWith:()=>Zxe,enum:()=>F_,file:()=>ors,flattenError:()=>Nxe,float32:()=>qts,float64:()=>jts,formatError:()=>Mxe,function:()=>rYt,getErrorMap:()=>mrs,globalRegistry:()=>bO,gt:()=>L3,gte:()=>LC,guid:()=>_ts,includes:()=>Kxe,instanceof:()=>drs,int:()=>fYt,int32:()=>Hts,int64:()=>Vts,intersection:()=>dwe,ipv4:()=>Dts,ipv6:()=>Nts,iso:()=>Due,json:()=>prs,jwt:()=>Uts,keyof:()=>Zts,ksuid:()=>kts,lazy:()=>Vwn,length:()=>kue,literal:()=>Gn,locales:()=>Gxe,looseObject:()=>Jh,lowercase:()=>zxe,lt:()=>B3,lte:()=>Kx,map:()=>rrs,maxLength:()=>Pue,maxSize:()=>Rue,mime:()=>Xxe,minLength:()=>_q,minSize:()=>zK,multipleOf:()=>WK,nan:()=>crs,nanoid:()=>Its,nativeEnum:()=>irs,negative:()=>Vzt,never:()=>Zet,nonnegative:()=>zzt,nonoptional:()=>Lwn,nonpositive:()=>Wzt,normalize:()=>ewe,null:()=>Jet,nullable:()=>Yet,nullish:()=>srs,number:()=>Ia,object:()=>Wr,optional:()=>mu,overwrite:()=>F3,parse:()=>cYt,parseAsync:()=>lYt,partialRecord:()=>trs,pipe:()=>Ket,positive:()=>$zt,prefault:()=>Bwn,preprocess:()=>ntt,prettifyError:()=>D$t,promise:()=>urs,property:()=>Yzt,readonly:()=>Hwn,record:()=>_l,refine:()=>Ywn,regex:()=>Wxe,regexes:()=>GK,registry:()=>_et,safeParse:()=>uYt,safeParseAsync:()=>dYt,set:()=>nrs,setErrorMap:()=>hrs,size:()=>Vxe,startsWith:()=>Jxe,strictObject:()=>Xts,string:()=>Ke,stringFormat:()=>Qts,stringbool:()=>frs,success:()=>ars,superRefine:()=>Kwn,symbol:()=>zts,templateLiteral:()=>lrs,toJSONSchema:()=>nYt,toLowerCase:()=>rwe,toUpperCase:()=>nwe,transform:()=>LYt,treeifyError:()=>k$t,trim:()=>twe,tuple:()=>ers,uint32:()=>Gts,uint64:()=>Wts,ulid:()=>Rts,undefined:()=>Yts,union:()=>El,unknown:()=>Zu,uppercase:()=>Yxe,url:()=>gYt,uuid:()=>vts,uuidv4:()=>Cts,uuidv6:()=>bts,uuidv7:()=>Sts,void:()=>Kts,xid:()=>Pts});p();var U3={};xi(U3,{$ZodAny:()=>iWt,$ZodArray:()=>Qxe,$ZodAsyncError:()=>CO,$ZodBase64:()=>zVt,$ZodBase64URL:()=>YVt,$ZodBigInt:()=>yet,$ZodBigIntFormat:()=>eWt,$ZodBoolean:()=>Uxe,$ZodCIDRv4:()=>$Vt,$ZodCIDRv6:()=>VVt,$ZodCUID:()=>MVt,$ZodCUID2:()=>OVt,$ZodCatch:()=>bWt,$ZodCheck:()=>hf,$ZodCheckBigIntFormat:()=>uVt,$ZodCheckEndsWith:()=>CVt,$ZodCheckGreaterThan:()=>het,$ZodCheckIncludes:()=>_Vt,$ZodCheckLengthEquals:()=>gVt,$ZodCheckLessThan:()=>pet,$ZodCheckLowerCase:()=>yVt,$ZodCheckMaxLength:()=>hVt,$ZodCheckMaxSize:()=>dVt,$ZodCheckMimeType:()=>SVt,$ZodCheckMinLength:()=>mVt,$ZodCheckMinSize:()=>fVt,$ZodCheckMultipleOf:()=>cVt,$ZodCheckNumberFormat:()=>lVt,$ZodCheckOverwrite:()=>TVt,$ZodCheckProperty:()=>bVt,$ZodCheckRegex:()=>AVt,$ZodCheckSizeEquals:()=>pVt,$ZodCheckStartsWith:()=>vVt,$ZodCheckStringFormat:()=>Tue,$ZodCheckUpperCase:()=>EVt,$ZodCustom:()=>RWt,$ZodCustomStringFormat:()=>ZVt,$ZodDate:()=>aWt,$ZodDefault:()=>EWt,$ZodDiscriminatedUnion:()=>lWt,$ZodE164:()=>KVt,$ZodEmail:()=>PVt,$ZodEmoji:()=>DVt,$ZodEnum:()=>hWt,$ZodError:()=>Dxe,$ZodFile:()=>gWt,$ZodFunction:()=>Het,$ZodGUID:()=>wVt,$ZodIPv4:()=>HVt,$ZodIPv6:()=>GVt,$ZodISODate:()=>QVt,$ZodISODateTime:()=>UVt,$ZodISODuration:()=>jVt,$ZodISOTime:()=>qVt,$ZodIntersection:()=>uWt,$ZodJWT:()=>JVt,$ZodKSUID:()=>FVt,$ZodLazy:()=>wWt,$ZodLiteral:()=>mWt,$ZodMap:()=>fWt,$ZodNaN:()=>SWt,$ZodNanoID:()=>NVt,$ZodNever:()=>oWt,$ZodNonOptional:()=>vWt,$ZodNull:()=>nWt,$ZodNullable:()=>yWt,$ZodNumber:()=>Aet,$ZodNumberFormat:()=>XVt,$ZodObject:()=>cWt,$ZodOptional:()=>AWt,$ZodPipe:()=>jxe,$ZodPrefault:()=>_Wt,$ZodPromise:()=>xWt,$ZodReadonly:()=>TWt,$ZodRealError:()=>bue,$ZodRecord:()=>dWt,$ZodRegistry:()=>xue,$ZodSet:()=>pWt,$ZodString:()=>$K,$ZodStringFormat:()=>Fl,$ZodSuccess:()=>CWt,$ZodSymbol:()=>tWt,$ZodTemplateLiteral:()=>IWt,$ZodTransform:()=>qxe,$ZodTuple:()=>VK,$ZodType:()=>uo,$ZodULID:()=>BVt,$ZodURL:()=>kVt,$ZodUUID:()=>RVt,$ZodUndefined:()=>rWt,$ZodUnion:()=>Eet,$ZodUnknown:()=>Iue,$ZodVoid:()=>sWt,$ZodXID:()=>LVt,$brand:()=>E$t,$constructor:()=>ut,$input:()=>mzt,$output:()=>hzt,Doc:()=>Fxe,JSONSchema:()=>pwn,JSONSchemaGenerator:()=>owe,NEVER:()=>Sxe,TimePrecision:()=>yzt,_any:()=>Uzt,_array:()=>iwe,_base64:()=>Uet,_base64url:()=>Qet,_bigint:()=>Dzt,_boolean:()=>Pzt,_catch:()=>uts,_cidrv4:()=>Let,_cidrv6:()=>Fet,_coercedBigint:()=>Nzt,_coercedBoolean:()=>kzt,_coercedDate:()=>Hzt,_coercedNumber:()=>Szt,_coercedString:()=>Azt,_cuid:()=>Pet,_cuid2:()=>ket,_custom:()=>Zzt,_date:()=>jzt,_default:()=>ats,_discriminatedUnion:()=>Kes,_e164:()=>qet,_email:()=>vet,_emoji:()=>wet,_endsWith:()=>Zxe,_enum:()=>tts,_file:()=>Jzt,_float32:()=>Izt,_float64:()=>xzt,_gt:()=>L3,_gte:()=>LC,_guid:()=>$xe,_includes:()=>Kxe,_int:()=>Tzt,_int32:()=>wzt,_int64:()=>Mzt,_intersection:()=>Jes,_ipv4:()=>Oet,_ipv6:()=>Bet,_isoDate:()=>_zt,_isoDateTime:()=>Ezt,_isoDuration:()=>Czt,_isoTime:()=>vzt,_jwt:()=>jet,_ksuid:()=>Met,_lazy:()=>hts,_length:()=>kue,_literal:()=>nts,_lowercase:()=>zxe,_lt:()=>B3,_lte:()=>Kx,_map:()=>Xes,_max:()=>Kx,_maxLength:()=>Pue,_maxSize:()=>Rue,_mime:()=>Xxe,_min:()=>LC,_minLength:()=>_q,_minSize:()=>zK,_multipleOf:()=>WK,_nan:()=>Gzt,_nanoid:()=>Ret,_nativeEnum:()=>rts,_negative:()=>Vzt,_never:()=>Qzt,_nonnegative:()=>zzt,_nonoptional:()=>cts,_nonpositive:()=>Wzt,_normalize:()=>ewe,_null:()=>Fzt,_nullable:()=>sts,_number:()=>bzt,_optional:()=>ots,_overwrite:()=>F3,_parse:()=>aet,_parseAsync:()=>cet,_pipe:()=>dts,_positive:()=>$zt,_promise:()=>mts,_property:()=>Yzt,_readonly:()=>fts,_record:()=>Zes,_refine:()=>Xzt,_regex:()=>Wxe,_safeParse:()=>uet,_safeParseAsync:()=>det,_set:()=>ets,_size:()=>Vxe,_startsWith:()=>Jxe,_string:()=>gzt,_stringFormat:()=>tYt,_stringbool:()=>eYt,_success:()=>lts,_symbol:()=>Bzt,_templateLiteral:()=>pts,_toLowerCase:()=>rwe,_toUpperCase:()=>nwe,_transform:()=>its,_trim:()=>twe,_tuple:()=>Kzt,_uint32:()=>Rzt,_uint64:()=>Ozt,_ulid:()=>Det,_undefined:()=>Lzt,_union:()=>Yes,_unknown:()=>wue,_uppercase:()=>Yxe,_url:()=>xet,_uuid:()=>Cet,_uuidv4:()=>bet,_uuidv6:()=>Tet,_uuidv7:()=>Iet,_void:()=>qzt,_xid:()=>Net,clone:()=>LS,config:()=>Kh,flattenError:()=>Nxe,formatError:()=>Mxe,function:()=>rYt,globalConfig:()=>bxe,globalRegistry:()=>bO,isValidBase64:()=>WVt,isValidBase64URL:()=>cwn,isValidJWT:()=>lwn,locales:()=>Gxe,parse:()=>Oxe,parseAsync:()=>Bxe,prettifyError:()=>D$t,regexes:()=>GK,registry:()=>_et,safeParse:()=>Sue,safeParseAsync:()=>Lxe,toDotPath:()=>Gxn,toJSONSchema:()=>nYt,treeifyError:()=>k$t,util:()=>qr,version:()=>IVt});p();p();var Sxe=Object.freeze({status:"aborted"});function ut(t,e,r){function n(l,u){var d;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(d=l._zod).traits??(d.traits=new Set),l._zod.traits.add(t),e(l,u);for(let f in c.prototype)f in l||Object.defineProperty(l,f,{value:c.prototype[f].bind(l)});l._zod.constr=c,l._zod.def=u}a(n,"init");let o=r?.Parent??Object;class s extends o{static{a(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(l){var u;let d=r?.Parent?new s:this;n(d,l),(u=d._zod).deferred??(u.deferred=[]);for(let f of d._zod.deferred)f();return d}return a(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:a(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}a(ut,"$constructor");var E$t=Symbol("zod_brand"),CO=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bxe={};function Kh(t){return t&&Object.assign(bxe,t),bxe}a(Kh,"config");p();p();var qr={};xi(qr,{BIGINT_FORMAT_RANGES:()=>R$t,Class:()=>v$t,NUMBER_FORMAT_RANGES:()=>w$t,aborted:()=>jK,allowsEval:()=>T$t,assert:()=>LXo,assertEqual:()=>NXo,assertIs:()=>OXo,assertNever:()=>BXo,assertNotEqual:()=>MXo,assignProp:()=>S$t,cached:()=>xxe,captureStackTrace:()=>set,cleanEnum:()=>KXo,cleanRegex:()=>wxe,clone:()=>LS,createTransparentProxy:()=>HXo,defineLazy:()=>bc,esc:()=>qK,escapeRegex:()=>O3,extend:()=>VXo,finalizeIssue:()=>FS,floatSafeRemainder:()=>b$t,getElementAtPath:()=>FXo,getEnumValues:()=>Ixe,getLengthableOrigin:()=>kxe,getParsedType:()=>jXo,getSizableOrigin:()=>Pxe,isObject:()=>vue,isPlainObject:()=>Cue,issue:()=>P$t,joinValues:()=>Qt,jsonStringifyReplacer:()=>C$t,merge:()=>WXo,normalizeParams:()=>Tr,nullish:()=>Eq,numKeys:()=>qXo,omit:()=>$Xo,optionalKeys:()=>x$t,partial:()=>zXo,pick:()=>GXo,prefixIssues:()=>BC,primitiveTypes:()=>I$t,promiseAllObject:()=>UXo,propertyKeyTypes:()=>Rxe,randomString:()=>QXo,required:()=>YXo,stringifyPrimitive:()=>Qr,unwrapMessage:()=>Txe});p();function NXo(t){return t}a(NXo,"assertEqual");function MXo(t){return t}a(MXo,"assertNotEqual");function OXo(t){}a(OXo,"assertIs");function BXo(t){throw new Error}a(BXo,"assertNever");function LXo(t){}a(LXo,"assert");function Ixe(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}a(Ixe,"getEnumValues");function Qt(t,e="|"){return t.map(r=>Qr(r)).join(e)}a(Qt,"joinValues");function C$t(t,e){return typeof e=="bigint"?e.toString():e}a(C$t,"jsonStringifyReplacer");function xxe(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}a(xxe,"cached");function Eq(t){return t==null}a(Eq,"nullish");function wxe(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}a(wxe,"cleanRegex");function b$t(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),c=Number.parseInt(e.toFixed(o).replace(".",""));return s%c/10**o}a(b$t,"floatSafeRemainder");function bc(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}a(bc,"defineLazy");function S$t(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}a(S$t,"assignProp");function FXo(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}a(FXo,"getElementAtPath");function UXo(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s{};function vue(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}a(vue,"isObject");var T$t=xxe(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Cue(t){if(vue(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(vue(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}a(Cue,"isPlainObject");function qXo(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}a(qXo,"numKeys");var jXo=a(t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},"getParsedType"),Rxe=new Set(["string","number","symbol"]),I$t=new Set(["string","number","bigint","boolean","symbol","undefined"]);function O3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(O3,"escapeRegex");function LS(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}a(LS,"clone");function Tr(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:a(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:a(()=>e.error,"error")}:e}a(Tr,"normalizeParams");function HXo(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}a(HXo,"createTransparentProxy");function Qr(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}a(Qr,"stringifyPrimitive");function x$t(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}a(x$t,"optionalKeys");var w$t={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},R$t={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function GXo(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return LS(t,{...t._zod.def,shape:r,checks:[]})}a(GXo,"pick");function $Xo(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return LS(t,{...t._zod.def,shape:r,checks:[]})}a($Xo,"omit");function VXo(t,e){if(!Cue(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return S$t(this,"shape",n),n},checks:[]};return LS(t,r)}a(VXo,"extend");function WXo(t,e){return LS(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return S$t(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}a(WXo,"merge");function zXo(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=t?new t({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=t?new t({type:"optional",innerType:n[s]}):n[s];return LS(e,{...e._zod.def,shape:o,checks:[]})}a(zXo,"partial");function YXo(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return LS(e,{...e._zod.def,shape:o,checks:[]})}a(YXo,"required");function jK(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}a(BC,"prefixIssues");function Txe(t){return typeof t=="string"?t:t?.message}a(Txe,"unwrapMessage");function FS(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=Txe(t.inst?._zod.def?.error?.(t))??Txe(e?.error?.(t))??Txe(r.customError?.(t))??Txe(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}a(FS,"finalizeIssue");function Pxe(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}a(Pxe,"getSizableOrigin");function kxe(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}a(kxe,"getLengthableOrigin");function P$t(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}a(P$t,"issue");function KXo(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}a(KXo,"cleanEnum");var v$t=class{static{a(this,"Class")}constructor(...e){}};var Hxn=a((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,C$t,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:a(()=>t.message,"value"),enumerable:!1})},"initializer"),Dxe=ut("$ZodError",Hxn),bue=ut("$ZodError",Hxn,{Parent:Error});function Nxe(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}a(Nxe,"flattenError");function Mxe(t,e){let r=e||function(s){return s.message},n={_errors:[]},o=a(s=>{for(let c of s.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>o({issues:l}));else if(c.code==="invalid_key")o({issues:c.issues});else if(c.code==="invalid_element")o({issues:c.issues});else if(c.path.length===0)n._errors.push(r(c));else{let l=n,u=0;for(;u{var l,u;for(let d of s.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>o({issues:f},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let f=[...c,...d.path];if(f.length===0){n.errors.push(r(d));continue}let h=n,m=0;for(;mn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${Gxn(n.path)}`);return e.join(` +`)}a(D$t,"prettifyError");var aet=a(t=>(e,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new CO;if(c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>FS(u,s,Kh())));throw set(l,o?.callee),l}return c.value},"_parse"),Oxe=aet(bue),cet=a(t=>async(e,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??t)(c.issues.map(u=>FS(u,s,Kh())));throw set(l,o?.callee),l}return c.value},"_parseAsync"),Bxe=cet(bue),uet=a(t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new CO;return s.issues.length?{success:!1,error:new(t??Dxe)(s.issues.map(c=>FS(c,o,Kh())))}:{success:!0,data:s.value}},"_safeParse"),Sue=uet(bue),det=a(t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>FS(c,o,Kh())))}:{success:!0,data:s.value}},"_safeParseAsync"),Lxe=det(bue);p();p();var GK={};xi(GK,{_emoji:()=>$xn,base64:()=>W$t,base64url:()=>fet,bigint:()=>eVt,boolean:()=>nVt,browserEmail:()=>oes,cidrv4:()=>$$t,cidrv6:()=>V$t,cuid:()=>N$t,cuid2:()=>M$t,date:()=>K$t,datetime:()=>Z$t,domain:()=>ses,duration:()=>U$t,e164:()=>Y$t,email:()=>q$t,emoji:()=>j$t,extendedDuration:()=>ZXo,guid:()=>Q$t,hostname:()=>z$t,html5Email:()=>res,integer:()=>tVt,ipv4:()=>H$t,ipv6:()=>G$t,ksuid:()=>L$t,lowercase:()=>sVt,nanoid:()=>F$t,null:()=>iVt,number:()=>rVt,rfc5322Email:()=>nes,string:()=>X$t,time:()=>J$t,ulid:()=>O$t,undefined:()=>oVt,unicodeEmail:()=>ies,uppercase:()=>aVt,uuid:()=>HK,uuid4:()=>XXo,uuid6:()=>ees,uuid7:()=>tes,xid:()=>B$t});p();var N$t=/^[cC][^\s-]{8,}$/,M$t=/^[0-9a-z]+$/,O$t=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,B$t=/^[0-9a-vA-V]{20}$/,L$t=/^[A-Za-z0-9]{27}$/,F$t=/^[a-zA-Z0-9_-]{21}$/,U$t=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ZXo=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Q$t=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,HK=a(t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,"uuid"),XXo=HK(4),ees=HK(6),tes=HK(7),q$t=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,res=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,nes=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ies=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,oes=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$xn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j$t(){return new RegExp($xn,"u")}a(j$t,"emoji");var H$t=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,G$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,$$t=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,V$t=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,W$t=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fet=/^[A-Za-z0-9_-]*$/,z$t=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,ses=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Y$t=/^\+(?:[0-9]){6,14}[0-9]$/,Vxn="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",K$t=new RegExp(`^${Vxn}$`);function Wxn(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(Wxn,"timeSource");function J$t(t){return new RegExp(`^${Wxn(t)}$`)}a(J$t,"time");function Z$t(t){let e=Wxn({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Vxn}T(?:${n})$`)}a(Z$t,"datetime");var X$t=a(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),eVt=/^\d+n?$/,tVt=/^\d+$/,rVt=/^-?\d+(?:\.\d+)?/i,nVt=/true|false/i,iVt=/null/i;var oVt=/undefined/i;var sVt=/^[^A-Z]*$/,aVt=/^[^a-z]*$/;var hf=ut("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Yxn={number:"number",bigint:"bigint",object:"date"},pet=ut("$ZodCheckLessThan",(t,e)=>{hf.init(t,e);let r=Yxn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{hf.init(t,e);let r=Yxn[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),cVt=ut("$ZodCheckMultipleOf",(t,e)=>{hf.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):b$t(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),lVt=ut("$ZodCheckNumberFormat",(t,e)=>{hf.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=w$t[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=o,l.maximum=s,r&&(l.pattern=tVt)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}ls&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:t})}}),uVt=ut("$ZodCheckBigIntFormat",(t,e)=>{hf.init(t,e);let[r,n]=R$t[e.format];t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,s.minimum=r,s.maximum=n}),t._zod.check=o=>{let s=o.value;sn&&o.issues.push({origin:"bigint",input:s,code:"too_big",maximum:n,inst:t})}}),dVt=ut("$ZodCheckMaxSize",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:Pxe(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),fVt=ut("$ZodCheckMinSize",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:Pxe(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),pVt=ut("$ZodCheckSizeEquals",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,s=o.size;if(s===e.size)return;let c=s>e.size;n.issues.push({origin:Pxe(o),...c?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),hVt=ut("$ZodCheckMaxLength",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let c=kxe(o);n.issues.push({origin:c,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),mVt=ut("$ZodCheckMinLength",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let c=kxe(o);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),gVt=ut("$ZodCheckLengthEquals",(t,e)=>{var r;hf.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!Eq(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let c=kxe(o),l=s>e.length;n.issues.push({origin:c,...l?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Tue=ut("$ZodCheckStringFormat",(t,e)=>{var r,n;hf.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),AVt=ut("$ZodCheckRegex",(t,e)=>{Tue.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),yVt=ut("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=sVt),Tue.init(t,e)}),EVt=ut("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=aVt),Tue.init(t,e)}),_Vt=ut("$ZodCheckIncludes",(t,e)=>{hf.init(t,e);let r=O3(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),vVt=ut("$ZodCheckStartsWith",(t,e)=>{hf.init(t,e);let r=new RegExp(`^${O3(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),CVt=ut("$ZodCheckEndsWith",(t,e)=>{hf.init(t,e);let r=new RegExp(`.*${O3(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function zxn(t,e,r){t.issues.length&&e.issues.push(...BC(r,t.issues))}a(zxn,"handleCheckPropertyResult");var bVt=ut("$ZodCheckProperty",(t,e)=>{hf.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>zxn(o,r,e.property));zxn(n,r,e.property)}}),SVt=ut("$ZodCheckMimeType",(t,e)=>{hf.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),TVt=ut("$ZodCheckOverwrite",(t,e)=>{hf.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});p();var Fxe=class{static{a(this,"Doc")}constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` `).filter(c=>c),o=Math.min(...n.map(c=>c.length-c.trimStart().length)),s=n.map(c=>c.slice(o)).map(c=>" ".repeat(this.indent*2)+c);for(let c of s)this.content.push(c)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(` -`))}};p();var mVt={major:4,minor:0,patch:0};var uo=it("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=mVt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=YK(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new wO;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=YK(s,h)))});else{if(s.issues.length===h)continue;u||(u=YK(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new wO;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=xue(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Kxe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),ZK=it("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??j$t(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ql=it("$ZodStringFormat",(t,e)=>{wue.init(t,e),ZK.init(t,e)}),AVt=it("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=R$t),ql.init(t,e)}),yVt=it("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=KK(n))}else e.pattern??(e.pattern=KK());ql.init(t,e)}),EVt=it("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=k$t),ql.init(t,e)}),_Vt=it("$ZodURL",(t,e)=>{ql.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:L$t.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),CVt=it("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=P$t()),ql.init(t,e)}),vVt=it("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=x$t),ql.init(t,e)}),bVt=it("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=v$t),ql.init(t,e)}),SVt=it("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=b$t),ql.init(t,e)}),TVt=it("$ZodULID",(t,e)=>{e.pattern??(e.pattern=S$t),ql.init(t,e)}),IVt=it("$ZodXID",(t,e)=>{e.pattern??(e.pattern=T$t),ql.init(t,e)}),xVt=it("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=I$t),ql.init(t,e)}),wVt=it("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=q$t(e)),ql.init(t,e)}),RVt=it("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=U$t),ql.init(t,e)}),kVt=it("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Q$t(e)),ql.init(t,e)}),PVt=it("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=w$t),ql.init(t,e)}),DVt=it("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=D$t),ql.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),NVt=it("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=N$t),ql.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),MVt=it("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=M$t),ql.init(t,e)}),OVt=it("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=O$t),ql.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function BVt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(BVt,"isValidBase64");var LVt=it("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=B$t),ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{BVt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function Kxn(t){if(!Aet.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return BVt(r)}a(Kxn,"isValidBase64URL");var FVt=it("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Aet),ql.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{Kxn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),UVt=it("$ZodE164",(t,e)=>{e.pattern??(e.pattern=F$t),ql.init(t,e)});function Jxn(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(Jxn,"isValidJWT");var QVt=it("$ZodJWT",(t,e)=>{ql.init(t,e),t._zod.check=r=>{Jxn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),qVt=it("$ZodCustomStringFormat",(t,e)=>{ql.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),vet=it("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??$$t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),jVt=it("$ZodNumber",(t,e)=>{Z$t.init(t,e),vet.init(t,e)}),Zxe=it("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=V$t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),bet=it("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=H$t,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),HVt=it("$ZodBigInt",(t,e)=>{X$t.init(t,e),bet.init(t,e)}),GVt=it("$ZodSymbol",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),$Vt=it("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=z$t,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),VVt=it("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=W$t,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),WVt=it("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Rue=it("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),zVt=it("$ZodNever",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),YVt=it("$ZodVoid",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),KVt=it("$ZodDate",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Uxn(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(Uxn,"handleArrayResult");var Xxe=it("$ZodArray",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cUxn(d,r,c))):Uxn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function _et(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(_et,"handleObjectResult");function Qxn(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...qv(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Qxn,"handleOptionalObjectResult");var JVt=it("$ZodObject",(t,e)=>{uo.init(t,e);let r=Qxe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof uo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=g$t(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});Tc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new Jxe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=zK(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=zK(v);m.write(` +`))}};p();var IVt={major:4,minor:0,patch:0};var uo=ut("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=IVt;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=a((s,c,l)=>{let u=jK(s),d;for(let f of c){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,m=f._zod.check(s);if(m instanceof Promise&&l?.async===!1)throw new CO;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==h&&(u||(u=jK(s,h)))});else{if(s.issues.length===h)continue;u||(u=jK(s,h))}}return d?d.then(()=>s):s},"runChecks");t._zod.run=(s,c)=>{let l=t._zod.parse(s,c);if(l instanceof Promise){if(c.async===!1)throw new CO;return l.then(u=>o(u,n,c))}return o(l,n,c)}}t["~standard"]={validate:a(o=>{try{let s=Sue(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Lxe(t,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}}),$K=ut("$ZodString",(t,e)=>{uo.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??X$t(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Fl=ut("$ZodStringFormat",(t,e)=>{Tue.init(t,e),$K.init(t,e)}),wVt=ut("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Q$t),Fl.init(t,e)}),RVt=ut("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=HK(n))}else e.pattern??(e.pattern=HK());Fl.init(t,e)}),PVt=ut("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=q$t),Fl.init(t,e)}),kVt=ut("$ZodURL",(t,e)=>{Fl.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:z$t.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),DVt=ut("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=j$t()),Fl.init(t,e)}),NVt=ut("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=F$t),Fl.init(t,e)}),MVt=ut("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=N$t),Fl.init(t,e)}),OVt=ut("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=M$t),Fl.init(t,e)}),BVt=ut("$ZodULID",(t,e)=>{e.pattern??(e.pattern=O$t),Fl.init(t,e)}),LVt=ut("$ZodXID",(t,e)=>{e.pattern??(e.pattern=B$t),Fl.init(t,e)}),FVt=ut("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=L$t),Fl.init(t,e)}),UVt=ut("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Z$t(e)),Fl.init(t,e)}),QVt=ut("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=K$t),Fl.init(t,e)}),qVt=ut("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=J$t(e)),Fl.init(t,e)}),jVt=ut("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=U$t),Fl.init(t,e)}),HVt=ut("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=H$t),Fl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),GVt=ut("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=G$t),Fl.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),$Vt=ut("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=$$t),Fl.init(t,e)}),VVt=ut("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=V$t),Fl.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function WVt(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}a(WVt,"isValidBase64");var zVt=ut("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=W$t),Fl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{WVt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function cwn(t){if(!fet.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return WVt(r)}a(cwn,"isValidBase64URL");var YVt=ut("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=fet),Fl.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{cwn(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),KVt=ut("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Y$t),Fl.init(t,e)});function lwn(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}a(lwn,"isValidJWT");var JVt=ut("$ZodJWT",(t,e)=>{Fl.init(t,e),t._zod.check=r=>{lwn(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),ZVt=ut("$ZodCustomStringFormat",(t,e)=>{Fl.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),Aet=ut("$ZodNumber",(t,e)=>{uo.init(t,e),t._zod.pattern=t._zod.bag.pattern??rVt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),XVt=ut("$ZodNumber",(t,e)=>{lVt.init(t,e),Aet.init(t,e)}),Uxe=ut("$ZodBoolean",(t,e)=>{uo.init(t,e),t._zod.pattern=nVt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),yet=ut("$ZodBigInt",(t,e)=>{uo.init(t,e),t._zod.pattern=eVt,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),eWt=ut("$ZodBigInt",(t,e)=>{uVt.init(t,e),yet.init(t,e)}),tWt=ut("$ZodSymbol",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),rWt=ut("$ZodUndefined",(t,e)=>{uo.init(t,e),t._zod.pattern=oVt,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),nWt=ut("$ZodNull",(t,e)=>{uo.init(t,e),t._zod.pattern=iVt,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),iWt=ut("$ZodAny",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),Iue=ut("$ZodUnknown",(t,e)=>{uo.init(t,e),t._zod.parse=r=>r}),oWt=ut("$ZodNever",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),sWt=ut("$ZodVoid",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),aWt=ut("$ZodDate",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Jxn(t,e,r){t.issues.length&&e.issues.push(...BC(r,t.issues)),e.value[r]=t.value}a(Jxn,"handleArrayResult");var Qxe=ut("$ZodArray",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let c=0;cJxn(d,r,c))):Jxn(u,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function met(t,e,r){t.issues.length&&e.issues.push(...BC(r,t.issues)),e.value[r]=t.value}a(met,"handleObjectResult");function Zxn(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...BC(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}a(Zxn,"handleOptionalObjectResult");var cWt=ut("$ZodObject",(t,e)=>{uo.init(t,e);let r=xxe(()=>{let h=Object.keys(e.shape);for(let g of h)if(!(e.shape[g]instanceof uo))throw new Error(`Invalid element at key "${g}": expected a Zod schema`);let m=x$t(e.shape);return{shape:e.shape,keys:h,keySet:new Set(h),numKeys:h.length,optionalKeys:new Set(m)}});bc(t._zod,"propValues",()=>{let h=e.shape,m={};for(let g in h){let A=h[g]._zod;if(A.values){m[g]??(m[g]=new Set);for(let y of A.values)m[g].add(y)}}return m});let n=a(h=>{let m=new Fxe(["shape","payload","ctx"]),g=r.value,A=a(v=>{let b=qK(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`},"parseStr");m.write("const input = payload.value;");let y=Object.create(null),E=0;for(let v of g.keys)y[v]=`key_${E++}`;m.write("const newResult = {}");for(let v of g.keys)if(g.optionalKeys.has(v)){let b=y[v];m.write(`const ${b} = ${A(v)};`);let T=qK(v);m.write(` if (${b}.issues.length) { if (input[${T}] === undefined) { if (${T} in input) { @@ -3519,117 +3550,151 @@ ${e.map(n=>{let o=n.cves.map(f=>{let h=`[${f.id}](${f.html_url}): ${GGt(f.summar `)}else{let b=y[v];m.write(`const ${b} = ${A(v)};`),m.write(` if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({ ...iss, - path: iss.path ? [${zK(v)}, ...iss.path] : [${zK(v)}] - })));`),m.write(`newResult[${zK(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=Sue,c=!Bxe.jitless,u=c&&h$t.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(k=>x?Qxn(k,h,T,g):_et(k,h,T))):x?Qxn(R,h,T,g):_et(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>_et(w,h,b))):_et(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function qxn(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>GS(s,n,zh())))}),e}a(qxn,"handleUnionResults");var Tet=it("$ZodUnion",(t,e)=>{uo.init(t,e),Tc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Tc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Tc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Tc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>qxe(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>qxn(c,r,t,n)):qxn(s,r,t,n)}}),ZVt=it("$ZodDiscriminatedUnion",(t,e)=>{Tet.init(t,e);let r=t._zod.parse;Tc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=Qxe(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!Sue(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),XVt=it("$ZodIntersection",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>jxn(r,u,d)):jxn(r,s,c)}});function gVt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Tue(t)&&Tue(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=gVt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n{uo.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>Cet(h,o,u))):Cet(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>Cet(m,o,u))):Cet(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function Cet(t,e,r){t.issues.length&&e.issues.push(...qv(r,t.issues)),e.value[r]=t.value}a(Cet,"handleTupleResult");var eWt=it("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Tue(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...qv(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...qv(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>GS(d,n,zh())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...qv(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...qv(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),tWt=it("$ZodMap",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{Hxn(f,h,r,c,o,t,n)})):Hxn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function Hxn(t,e,r,n,o,s,c){t.issues.length&&(jxe.has(typeof n)?r.issues.push(...qv(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>GS(l,c,zh()))})),e.issues.length&&(jxe.has(typeof n)?r.issues.push(...qv(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>GS(l,c,zh()))})),r.value.set(t.value,e.value)}a(Hxn,"handleMapResult");var rWt=it("$ZodSet",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>Gxn(u,r))):Gxn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function Gxn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(Gxn,"handleSetResult");var nWt=it("$ZodEnum",(t,e)=>{uo.init(t,e);let r=Uxe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>jxe.has(typeof n)).map(n=>typeof n=="string"?q3(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),iWt=it("$ZodLiteral",(t,e)=>{uo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?q3(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),oWt=it("$ZodFile",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),ewe=it("$ZodTransform",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new wO;return r.value=o,r}}),sWt=it("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Tc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${qxe(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),aWt=it("$ZodNullable",(t,e)=>{uo.init(t,e),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${qxe(r.source)}|null)$`):void 0}),Tc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),cWt=it("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>$xn(s,e)):$xn(o,e)}});function $xn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a($xn,"handleDefaultResult");var lWt=it("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),uWt=it("$ZodNonOptional",(t,e)=>{uo.init(t,e),Tc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Vxn(s,t)):Vxn(o,t)}});function Vxn(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(Vxn,"handleNonOptionalResult");var dWt=it("$ZodSuccess",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),fWt=it("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",Tc(t._zod,"optout",()=>e.innerType._zod.optout),Tc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>GS(c,n,zh()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>GS(s,n,zh()))},input:r.value}),r.issues=[]),r)}}),pWt=it("$ZodNaN",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),twe=it("$ZodPipe",(t,e)=>{uo.init(t,e),Tc(t._zod,"values",()=>e.in._zod.values),Tc(t._zod,"optin",()=>e.in._zod.optin),Tc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Wxn(s,e,n)):Wxn(o,e,n)}});function Wxn(t,e,r){return YK(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(Wxn,"handlePipeResult");var hWt=it("$ZodReadonly",(t,e)=>{uo.init(t,e),Tc(t._zod,"propValues",()=>e.innerType._zod.propValues),Tc(t._zod,"values",()=>e.innerType._zod.values),Tc(t._zod,"optin",()=>e.innerType._zod.optin),Tc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(zxn):zxn(o)}});function zxn(t){return t.value=Object.freeze(t.value),t}a(zxn,"handleReadonlyResult");var mWt=it("$ZodTemplateLiteral",(t,e)=>{uo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof uo){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||m$t.has(typeof n))r.push(q3(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),gWt=it("$ZodPromise",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),AWt=it("$ZodLazy",(t,e)=>{uo.init(t,e),Tc(t._zod,"innerType",()=>e.getter()),Tc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Tc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Tc(t._zod,"optin",()=>t._zod.innerType._zod.optin),Tc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),yWt=it("$ZodCustom",(t,e)=>{mf.init(t,e),uo.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>Yxn(s,r,n,t));Yxn(o,r,n,t)}});function Yxn(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(E$t(o))}}a(Yxn,"handleRefineResult");var nwe={};wi(nwe,{ar:()=>EWt,az:()=>_Wt,be:()=>CWt,ca:()=>vWt,cs:()=>bWt,de:()=>SWt,en:()=>rwe,eo:()=>TWt,es:()=>IWt,fa:()=>xWt,fi:()=>wWt,fr:()=>RWt,frCA:()=>kWt,he:()=>PWt,hu:()=>DWt,id:()=>NWt,it:()=>MWt,ja:()=>OWt,kh:()=>BWt,ko:()=>LWt,mk:()=>FWt,ms:()=>UWt,nl:()=>QWt,no:()=>qWt,ota:()=>jWt,pl:()=>GWt,ps:()=>HWt,pt:()=>$Wt,ru:()=>VWt,sl:()=>WWt,sv:()=>zWt,ta:()=>YWt,th:()=>KWt,tr:()=>JWt,ua:()=>ZWt,ur:()=>XWt,vi:()=>ezt,zhCN:()=>tzt,zhTW:()=>rzt});p();p();var rts=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Qr(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Ft(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function EWt(){return{localeError:rts()}}a(EWt,"default");p();var nts=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function _Wt(){return{localeError:nts()}}a(_Wt,"default");p();function Xxn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(Xxn,"getBelarusianPlural");var its=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=Xxn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=Xxn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function CWt(){return{localeError:its()}}a(CWt,"default");p();var ots=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Ft(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function vWt(){return{localeError:ots()}}a(vWt,"default");p();var sts=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Ft(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function bWt(){return{localeError:sts()}}a(bWt,"default");p();var ats=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function SWt(){return{localeError:ats()}}a(SWt,"default");p();var cts=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),lts=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${cts(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${Ft(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Ft(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function rwe(){return{localeError:lts()}}a(rwe,"default");p();var uts=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),dts=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${uts(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Ft(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Ft(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function TWt(){return{localeError:dts()}}a(TWt,"default");p();var fts=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function IWt(){return{localeError:fts()}}a(IWt,"default");p();var pts=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Qr(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Ft(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function xWt(){return{localeError:pts()}}a(xWt,"default");p();var hts=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Ft(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function wWt(){return{localeError:hts()}}a(wWt,"default");p();var mts=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Ft(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Ft(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function RWt(){return{localeError:mts()}}a(RWt,"default");p();var gts=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Ft(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function kWt(){return{localeError:gts()}}a(kWt,"default");p();var Ats=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Qr(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function PWt(){return{localeError:Ats()}}a(PWt,"default");p();var yts=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function DWt(){return{localeError:yts()}}a(DWt,"default");p();var Ets=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function NWt(){return{localeError:Ets()}}a(NWt,"default");p();var _ts=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function MWt(){return{localeError:_ts()}}a(MWt,"default");p();var Cts=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Ft(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Ft(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function OWt(){return{localeError:Cts()}}a(OWt,"default");p();var vts=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Qr(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Ft(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function BWt(){return{localeError:vts()}}a(BWt,"default");p();var bts=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Ft(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Ft(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function LWt(){return{localeError:bts()}}a(LWt,"default");p();var Sts=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Qr(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function FWt(){return{localeError:Sts()}}a(FWt,"default");p();var Tts=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Ft(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function UWt(){return{localeError:Tts()}}a(UWt,"default");p();var Its=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function QWt(){return{localeError:Its()}}a(QWt,"default");p();var xts=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function qWt(){return{localeError:xts()}}a(qWt,"default");p();var wts=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function jWt(){return{localeError:wts()}}a(jWt,"default");p();var Rts=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Ft(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function HWt(){return{localeError:Rts()}}a(HWt,"default");p();var kts=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function GWt(){return{localeError:kts()}}a(GWt,"default");p();var Pts=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function $Wt(){return{localeError:Pts()}}a($Wt,"default");p();function ewn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(ewn,"getRussianPlural");var Dts=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Qr(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=ewn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=ewn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function VWt(){return{localeError:Dts()}}a(VWt,"default");p();var Nts=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function WWt(){return{localeError:Nts()}}a(WWt,"default");p();var Mts=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Ft(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function zWt(){return{localeError:Mts()}}a(zWt,"default");p();var Ots=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qr(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Ft(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function YWt(){return{localeError:Ots()}}a(YWt,"default");p();var Bts=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Qr(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function KWt(){return{localeError:Bts()}}a(KWt,"default");p();var Lts=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Fts=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Lts(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Ft(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Ft(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function JWt(){return{localeError:Fts()}}a(JWt,"default");p();var Uts=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Ft(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function ZWt(){return{localeError:Uts()}}a(ZWt,"default");p();var Qts=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Ft(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Ft(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function XWt(){return{localeError:Qts()}}a(XWt,"default");p();var qts=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Qr(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Ft(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function ezt(){return{localeError:qts()}}a(ezt,"default");p();var jts=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Ft(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function tzt(){return{localeError:jts()}}a(tzt,"default");p();var Hts=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Ft(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Ft(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function rzt(){return{localeError:Hts()}}a(rzt,"default");p();var nzt=Symbol("ZodOutput"),izt=Symbol("ZodInput"),kue=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function Iet(){return new kue}a(Iet,"registry");var RO=Iet();p();p();function ozt(t,e){return new t({type:"string",...Tr(e)})}a(ozt,"_string");function szt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(szt,"_coercedString");function xet(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(xet,"_email");function iwe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a(iwe,"_guid");function wet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(wet,"_uuid");function Ret(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(Ret,"_uuidv4");function ket(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(ket,"_uuidv6");function Pet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Pet,"_uuidv7");function Det(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(Det,"_url");function Net(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(Net,"_emoji");function Met(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Met,"_nanoid");function Oet(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(Oet,"_cuid");function Bet(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(Bet,"_cuid2");function Let(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Let,"_ulid");function Fet(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Fet,"_xid");function Uet(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Uet,"_ksuid");function Qet(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Qet,"_ipv4");function qet(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(qet,"_ipv6");function jet(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(jet,"_cidrv4");function Het(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(Het,"_cidrv6");function Get(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(Get,"_base64");function $et(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a($et,"_base64url");function Vet(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(Vet,"_e164");function Wet(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(Wet,"_jwt");var azt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function czt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(czt,"_isoDateTime");function lzt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(lzt,"_isoDate");function uzt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(uzt,"_isoTime");function dzt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(dzt,"_isoDuration");function fzt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(fzt,"_number");function pzt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(pzt,"_coercedNumber");function hzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(hzt,"_int");function mzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(mzt,"_float32");function gzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(gzt,"_float64");function Azt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(Azt,"_int32");function yzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(yzt,"_uint32");function Ezt(t,e){return new t({type:"boolean",...Tr(e)})}a(Ezt,"_boolean");function _zt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(_zt,"_coercedBoolean");function Czt(t,e){return new t({type:"bigint",...Tr(e)})}a(Czt,"_bigint");function vzt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(vzt,"_coercedBigint");function bzt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(bzt,"_int64");function Szt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(Szt,"_uint64");function Tzt(t,e){return new t({type:"symbol",...Tr(e)})}a(Tzt,"_symbol");function Izt(t,e){return new t({type:"undefined",...Tr(e)})}a(Izt,"_undefined");function xzt(t,e){return new t({type:"null",...Tr(e)})}a(xzt,"_null");function wzt(t){return new t({type:"any"})}a(wzt,"_any");function Pue(t){return new t({type:"unknown"})}a(Pue,"_unknown");function Rzt(t,e){return new t({type:"never",...Tr(e)})}a(Rzt,"_never");function kzt(t,e){return new t({type:"void",...Tr(e)})}a(kzt,"_void");function Pzt(t,e){return new t({type:"date",...Tr(e)})}a(Pzt,"_date");function Dzt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(Dzt,"_coercedDate");function Nzt(t,e){return new t({type:"nan",...Tr(e)})}a(Nzt,"_nan");function j3(t,e){return new yet({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(j3,"_lt");function Jx(t,e){return new yet({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Jx,"_lte");function H3(t,e){return new Eet({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(H3,"_gt");function jv(t,e){return new Eet({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(jv,"_gte");function Mzt(t){return H3(0,t)}a(Mzt,"_positive");function Ozt(t){return j3(0,t)}a(Ozt,"_negative");function Bzt(t){return Jx(0,t)}a(Bzt,"_nonpositive");function Lzt(t){return jv(0,t)}a(Lzt,"_nonnegative");function eJ(t,e){return new J$t({check:"multiple_of",...Tr(e),value:t})}a(eJ,"_multipleOf");function Due(t,e){return new eVt({check:"max_size",...Tr(e),maximum:t})}a(Due,"_maxSize");function tJ(t,e){return new tVt({check:"min_size",...Tr(e),minimum:t})}a(tJ,"_minSize");function owe(t,e){return new rVt({check:"size_equals",...Tr(e),size:t})}a(owe,"_size");function Nue(t,e){return new nVt({check:"max_length",...Tr(e),maximum:t})}a(Nue,"_maxLength");function Iq(t,e){return new iVt({check:"min_length",...Tr(e),minimum:t})}a(Iq,"_minLength");function Mue(t,e){return new oVt({check:"length_equals",...Tr(e),length:t})}a(Mue,"_length");function swe(t,e){return new sVt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(swe,"_regex");function awe(t){return new aVt({check:"string_format",format:"lowercase",...Tr(t)})}a(awe,"_lowercase");function cwe(t){return new cVt({check:"string_format",format:"uppercase",...Tr(t)})}a(cwe,"_uppercase");function lwe(t,e){return new lVt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(lwe,"_includes");function uwe(t,e){return new uVt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(uwe,"_startsWith");function dwe(t,e){return new dVt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(dwe,"_endsWith");function Fzt(t,e,r){return new fVt({check:"property",property:t,schema:e,...Tr(r)})}a(Fzt,"_property");function fwe(t,e){return new pVt({check:"mime_type",mime:t,...Tr(e)})}a(fwe,"_mime");function G3(t){return new hVt({check:"overwrite",tx:t})}a(G3,"_overwrite");function pwe(t){return G3(e=>e.normalize(t))}a(pwe,"_normalize");function hwe(){return G3(t=>t.trim())}a(hwe,"_trim");function mwe(){return G3(t=>t.toLowerCase())}a(mwe,"_toLowerCase");function gwe(){return G3(t=>t.toUpperCase())}a(gwe,"_toUpperCase");function Awe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(Awe,"_array");function Gts(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Gts,"_union");function $ts(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a($ts,"_discriminatedUnion");function Vts(t,e,r){return new t({type:"intersection",left:e,right:r})}a(Vts,"_intersection");function Uzt(t,e,r,n){let o=r instanceof uo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(Uzt,"_tuple");function Wts(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(Wts,"_record");function zts(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(zts,"_map");function Yts(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(Yts,"_set");function Kts(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(Kts,"_enum");function Jts(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(Jts,"_nativeEnum");function Zts(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(Zts,"_literal");function Qzt(t,e){return new t({type:"file",...Tr(e)})}a(Qzt,"_file");function Xts(t,e){return new t({type:"transform",transform:e})}a(Xts,"_transform");function ers(t,e){return new t({type:"optional",innerType:e})}a(ers,"_optional");function trs(t,e){return new t({type:"nullable",innerType:e})}a(trs,"_nullable");function rrs(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(rrs,"_default");function nrs(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(nrs,"_nonoptional");function irs(t,e){return new t({type:"success",innerType:e})}a(irs,"_success");function ors(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(ors,"_catch");function srs(t,e,r){return new t({type:"pipe",in:e,out:r})}a(srs,"_pipe");function ars(t,e){return new t({type:"readonly",innerType:e})}a(ars,"_readonly");function crs(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(crs,"_templateLiteral");function lrs(t,e){return new t({type:"lazy",getter:e})}a(lrs,"_lazy");function urs(t,e){return new t({type:"promise",innerType:e})}a(urs,"_promise");function qzt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(qzt,"_custom");function jzt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(jzt,"_refine");function Hzt(t,e){let r=Tr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??twe,u=t.Boolean??Zxe,d=t.String??ZK,f=t.Transform??ewe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(Hzt,"_stringbool");function Gzt(t,e,r,n={}){let o=Tr(n),s={...Tr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(Gzt,"_stringFormat");var zet=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?zxe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?zxe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await Yxe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?Yxe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new XK({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function $zt(t){return new zet({type:"function",input:Array.isArray(t?.input)?Uzt(XK,t?.input):t?.input??Awe(Xxe,Pue(Rue)),output:t?.output??Pue(Rue)})}a($zt,"_function");p();var ywe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??RO,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=Uxe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&em(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ + path: iss.path ? [${qK(v)}, ...iss.path] : [${qK(v)}] + })));`),m.write(`newResult[${qK(v)}] = ${b}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");let _=m.compile();return(v,b)=>_(h,v,b)},"generateFastpass"),o,s=vue,c=!bxe.jitless,u=c&&T$t.value,d=e.catchall,f;t._zod.parse=(h,m)=>{f??(f=r.value);let g=h.value;if(!s(g))return h.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),h;let A=[];if(c&&u&&m?.async===!1&&m.jitless!==!0)o||(o=n(e.shape)),h=o(h,m);else{h.value={};let b=f.shape;for(let T of f.keys){let w=b[T],R=w._zod.run({value:g[T],issues:[]},m),x=w._zod.optin==="optional"&&w._zod.optout==="optional";R instanceof Promise?A.push(R.then(P=>x?Zxn(P,h,T,g):met(P,h,T))):x?Zxn(R,h,T,g):met(R,h,T)}}if(!d)return A.length?Promise.all(A).then(()=>h):h;let y=[],E=f.keySet,_=d._zod,v=_.def.type;for(let b of Object.keys(g)){if(E.has(b))continue;if(v==="never"){y.push(b);continue}let T=_.run({value:g[b],issues:[]},m);T instanceof Promise?A.push(T.then(w=>met(w,h,b))):met(T,h,b)}return y.length&&h.issues.push({code:"unrecognized_keys",keys:y,input:g,inst:t}),A.length?Promise.all(A).then(()=>h):h}});function Xxn(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>FS(s,n,Kh())))}),e}a(Xxn,"handleUnionResults");var Eet=ut("$ZodUnion",(t,e)=>{uo.init(t,e),bc(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),bc(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),bc(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),bc(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>wxe(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,s=[];for(let c of e.options){let l=c._zod.run({value:r.value,issues:[]},n);if(l instanceof Promise)s.push(l),o=!0;else{if(l.issues.length===0)return l;s.push(l)}}return o?Promise.all(s).then(c=>Xxn(c,r,t,n)):Xxn(s,r,t,n)}}),lWt=ut("$ZodDiscriminatedUnion",(t,e)=>{Eet.init(t,e);let r=t._zod.parse;bc(t._zod,"propValues",()=>{let o={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[l,u]of Object.entries(c)){o[l]||(o[l]=new Set);for(let d of u)o[l].add(d)}}return o});let n=xxe(()=>{let o=e.options,s=new Map;for(let c of o){let l=c._zod.propValues[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let u of l){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,c)}}return s});t._zod.parse=(o,s)=>{let c=o.value;if(!vue(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),o;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(o,s):e.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:c,path:[e.discriminator],inst:t}),o)}}),uWt=ut("$ZodIntersection",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),c=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||c instanceof Promise?Promise.all([s,c]).then(([u,d])=>ewn(r,u,d)):ewn(r,s,c)}});function xVt(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Cue(t)&&Cue(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let c=xVt(t[s],e[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};o[s]=c.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n{uo.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,s)=>{let c=o.value;if(!Array.isArray(c))return o.issues.push({input:c,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let l=[];if(!e.rest){let d=c.length>r.length,f=c.length=c.length&&u>=n)continue;let f=d._zod.run({value:c[u],issues:[]},s);f instanceof Promise?l.push(f.then(h=>get(h,o,u))):get(f,o,u)}if(e.rest){let d=c.slice(r.length);for(let f of d){u++;let h=e.rest._zod.run({value:f,issues:[]},s);h instanceof Promise?l.push(h.then(m=>get(m,o,u))):get(h,o,u)}}return l.length?Promise.all(l).then(()=>o):o}});function get(t,e,r){t.issues.length&&e.issues.push(...BC(r,t.issues)),e.value[r]=t.value}a(get,"handleTupleResult");var dWt=ut("$ZodRecord",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Cue(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[];if(e.keyType._zod.values){let c=e.keyType._zod.values;r.value={};for(let u of c)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let d=e.valueType._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>{f.issues.length&&r.issues.push(...BC(u,f.issues)),r.value[u]=f.value})):(d.issues.length&&r.issues.push(...BC(u,d.issues)),r.value[u]=d.value)}let l;for(let u in o)c.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:l})}else{r.value={};for(let c of Reflect.ownKeys(o)){if(c==="__proto__")continue;let l=e.keyType._zod.run({value:c,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(d=>FS(d,n,Kh())),input:c,path:[c],inst:t}),r.value[l.value]=l.value;continue}let u=e.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...BC(c,d.issues)),r.value[l.value]=d.value})):(u.issues.length&&r.issues.push(...BC(c,u.issues)),r.value[l.value]=u.value)}}return s.length?Promise.all(s).then(()=>r):r}}),fWt=ut("$ZodMap",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let s=[];r.value=new Map;for(let[c,l]of o){let u=e.keyType._zod.run({value:c,issues:[]},n),d=e.valueType._zod.run({value:l,issues:[]},n);u instanceof Promise||d instanceof Promise?s.push(Promise.all([u,d]).then(([f,h])=>{twn(f,h,r,c,o,t,n)})):twn(u,d,r,c,o,t,n)}return s.length?Promise.all(s).then(()=>r):r}});function twn(t,e,r,n,o,s,c){t.issues.length&&(Rxe.has(typeof n)?r.issues.push(...BC(n,t.issues)):r.issues.push({origin:"map",code:"invalid_key",input:o,inst:s,issues:t.issues.map(l=>FS(l,c,Kh()))})),e.issues.length&&(Rxe.has(typeof n)?r.issues.push(...BC(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:s,key:n,issues:e.issues.map(l=>FS(l,c,Kh()))})),r.value.set(t.value,e.value)}a(twn,"handleMapResult");var pWt=ut("$ZodSet",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let c of o){let l=e.valueType._zod.run({value:c,issues:[]},n);l instanceof Promise?s.push(l.then(u=>rwn(u,r))):rwn(l,r)}return s.length?Promise.all(s).then(()=>r):r}});function rwn(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}a(rwn,"handleSetResult");var hWt=ut("$ZodEnum",(t,e)=>{uo.init(t,e);let r=Ixe(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>Rxe.has(typeof n)).map(n=>typeof n=="string"?O3(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return t._zod.values.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),mWt=ut("$ZodLiteral",(t,e)=>{uo.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?O3(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),gWt=ut("$ZodFile",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),qxe=ut("$ZodTransform",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new CO;return r.value=o,r}}),AWt=ut("$ZodOptional",(t,e)=>{uo.init(t,e),t._zod.optin="optional",t._zod.optout="optional",bc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),bc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${wxe(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),yWt=ut("$ZodNullable",(t,e)=>{uo.init(t,e),bc(t._zod,"optin",()=>e.innerType._zod.optin),bc(t._zod,"optout",()=>e.innerType._zod.optout),bc(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${wxe(r.source)}|null)$`):void 0}),bc(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),EWt=ut("$ZodDefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",bc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>nwn(s,e)):nwn(o,e)}});function nwn(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}a(nwn,"handleDefaultResult");var _Wt=ut("$ZodPrefault",(t,e)=>{uo.init(t,e),t._zod.optin="optional",bc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),vWt=ut("$ZodNonOptional",(t,e)=>{uo.init(t,e),bc(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>iwn(s,t)):iwn(o,t)}});function iwn(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}a(iwn,"handleNonOptionalResult");var CWt=ut("$ZodSuccess",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),bWt=ut("$ZodCatch",(t,e)=>{uo.init(t,e),t._zod.optin="optional",bc(t._zod,"optout",()=>e.innerType._zod.optout),bc(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(c=>FS(c,n,Kh()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>FS(s,n,Kh()))},input:r.value}),r.issues=[]),r)}}),SWt=ut("$ZodNaN",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),jxe=ut("$ZodPipe",(t,e)=>{uo.init(t,e),bc(t._zod,"values",()=>e.in._zod.values),bc(t._zod,"optin",()=>e.in._zod.optin),bc(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>own(s,e,n)):own(o,e,n)}});function own(t,e,r){return jK(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}a(own,"handlePipeResult");var TWt=ut("$ZodReadonly",(t,e)=>{uo.init(t,e),bc(t._zod,"propValues",()=>e.innerType._zod.propValues),bc(t._zod,"values",()=>e.innerType._zod.values),bc(t._zod,"optin",()=>e.innerType._zod.optin),bc(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(swn):swn(o)}});function swn(t){return t.value=Object.freeze(t.value),t}a(swn,"handleReadonlyResult");var IWt=ut("$ZodTemplateLiteral",(t,e)=>{uo.init(t,e);let r=[];for(let n of e.parts)if(n instanceof uo){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let s=o.startsWith("^")?1:0,c=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(s,c))}else if(n===null||I$t.has(typeof n))r.push(O3(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),xWt=ut("$ZodPromise",(t,e)=>{uo.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),wWt=ut("$ZodLazy",(t,e)=>{uo.init(t,e),bc(t._zod,"innerType",()=>e.getter()),bc(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),bc(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),bc(t._zod,"optin",()=>t._zod.innerType._zod.optin),bc(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),RWt=ut("$ZodCustom",(t,e)=>{hf.init(t,e),uo.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>awn(s,r,n,t));awn(o,r,n,t)}});function awn(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(P$t(o))}}a(awn,"handleRefineResult");var Gxe={};xi(Gxe,{ar:()=>PWt,az:()=>kWt,be:()=>DWt,ca:()=>NWt,cs:()=>MWt,de:()=>OWt,en:()=>Hxe,eo:()=>BWt,es:()=>LWt,fa:()=>FWt,fi:()=>UWt,fr:()=>QWt,frCA:()=>qWt,he:()=>jWt,hu:()=>HWt,id:()=>GWt,it:()=>$Wt,ja:()=>VWt,kh:()=>WWt,ko:()=>zWt,mk:()=>YWt,ms:()=>KWt,nl:()=>JWt,no:()=>ZWt,ota:()=>XWt,pl:()=>tzt,ps:()=>ezt,pt:()=>rzt,ru:()=>nzt,sl:()=>izt,sv:()=>ozt,ta:()=>szt,th:()=>azt,tr:()=>czt,ua:()=>lzt,ur:()=>uzt,vi:()=>dzt,zhCN:()=>fzt,zhTW:()=>pzt});p();p();var aes=a(()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Qr(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()} ${c.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${n[s.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Qt(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function PWt(){return{localeError:aes()}}a(PWt,"default");p();var ces=a(()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Qr(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()} ${c.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[s.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function kWt(){return{localeError:ces()}}a(kWt,"default");p();function dwn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(dwn,"getBelarusianPlural");var les=a(()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=dwn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=dwn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${c.verb} ${s}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function DWt(){return{localeError:les()}}a(DWt,"default");p();var ues=a(()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Qr(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Qt(o.values," o ")}`;case"too_big":{let s=o.inclusive?"com a m\xE0xim":"menys de",c=e(o.origin);return c?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${s} ${o.maximum.toString()} ${c.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"com a m\xEDnim":"m\xE9s de",c=e(o.origin);return c?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${s} ${o.minimum.toString()} ${c.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function NWt(){return{localeError:ues()}}a(NWt,"default");p();var des=a(()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Qr(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.maximum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${s}${o.minimum.toString()} ${c.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${n[s.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Qt(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function MWt(){return{localeError:des()}}a(MWt,"default");p();var fes=a(()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Qr(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ${c.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${s}${o.maximum.toString()} ist`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ${c.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${s}${o.minimum.toString()} ist`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function OWt(){return{localeError:fes()}}a(OWt,"default");p();var pes=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),hes=a(()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${pes(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Qr(n.values[0])}`:`Invalid option: expected one of ${Qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Qt(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}},"error");function Hxe(){return{localeError:hes()}}a(Hxe,"default");p();var mes=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),ges=a(()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${mes(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Qr(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Qt(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}},"error");function BWt(){return{localeError:ges()}}a(BWt,"default");p();var Aes=a(()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return s},"parsedType"),n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Qr(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${s}${o.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${n[s.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function LWt(){return{localeError:Aes()}}a(LWt,"default");p();var yes=a(()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Qr(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Qt(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[s.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function FWt(){return{localeError:yes()}}a(FWt,"default");p();var Ees=a(()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Qr(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Liian suuri: ${c.subject} t\xE4ytyy olla ${s}${o.maximum.toString()} ${c.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Liian pieni: ${c.subject} t\xE4ytyy olla ${s}${o.minimum.toString()} ${c.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${n[s.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Qt(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function UWt(){return{localeError:Ees()}}a(UWt,"default");p();var _es=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Qr(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Qt(o.values,"|")} attendue`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Trop grand : ${o.origin??"valeur"} doit ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Trop petit : ${o.origin} doit ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function QWt(){return{localeError:_es()}}a(QWt,"default");p();var ves=a(()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Qr(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u2264":"<",c=e(o.origin);return c?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${s}${o.maximum.toString()} ${c.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u2265":">",c=e(o.origin);return c?`Trop petit : attendu que ${o.origin} ait ${s}${o.minimum.toString()} ${c.unit}`:`Trop petit : attendu que ${o.origin} soit ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${n[s.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Qt(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}},"error");function qWt(){return{localeError:ves()}}a(qWt,"default");p();var Ces=a(()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Qr(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()} ${c.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()} ${c.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${s.prefix}"`:s.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${s.suffix}"`:s.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${s.includes}"`:s.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${s.pattern}`:`${n[s.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function jWt(){return{localeError:Ces()}}a(jWt,"default");p();var bes=a(()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Qr(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${o.maximum.toString()} ${c.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${s}${o.minimum.toString()} ${c.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[s.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function HWt(){return{localeError:bes()}}a(HWt,"default");p();var Ses=a(()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Qr(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: diharapkan ${o.origin} memiliki ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${n[s.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}},"error");function GWt(){return{localeError:Ses()}}a(GWt,"default");p();var Tes=a(()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Qr(o.values[0])}`:`Opzione non valida: atteso uno tra ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Troppo grande: ${o.origin??"valore"} deve avere ${s}${o.maximum.toString()} ${c.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Troppo piccolo: ${o.origin} deve avere ${s}${o.minimum.toString()} ${c.unit}`:`Troppo piccolo: ${o.origin} deve essere ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}},"error");function $Wt(){return{localeError:Tes()}}a($Wt,"default");p();var Ies=a(()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Qr(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Qt(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let s=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",c=e(o.origin);return c?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${c.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let s=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",c=e(o.origin);return c?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${c.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function VWt(){return{localeError:Ies()}}a(VWt,"default");p();var xes=a(()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Qr(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()} ${c.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()} ${c.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Qt(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function WWt(){return{localeError:xes()}}a(WWt,"default");p();var wes=a(()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Qr(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Qt(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let s=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",c=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${s}${c}`}case"too_small":{let s=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",c=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",l=e(o.origin),u=l?.unit??"\uC694\uC18C";return l?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${s}${c}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${s}${c}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[s.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Qt(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function zWt(){return{localeError:wes()}}a(zWt,"default");p();var Res=a(()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Qr(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${o.minimum.toString()} ${c.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function YWt(){return{localeError:Res()}}a(YWt,"default");p();var Pes=a(()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Qr(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Terlalu besar: dijangka ${o.origin??"nilai"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Terlalu kecil: dijangka ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${n[s.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Qt(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}},"error");function KWt(){return{localeError:Pes()}}a(KWt,"default");p();var kes=a(()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Qr(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} ${c.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${s}${o.maximum.toString()} is`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} ${c.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${s}${o.minimum.toString()} is`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${n[s.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}},"error");function JWt(){return{localeError:kes()}}a(JWt,"default");p();var Des=a(()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Qr(o.values[0])}`:`Ugyldig valg: forventet en av ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()} ${c.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()} ${c.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${n[s.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}},"error");function ZWt(){return{localeError:Des()}}a(ZWt,"default");p();var Nes=a(()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Qr(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} ${c.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${s}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} ${c.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${s}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let s=o;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[s.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function XWt(){return{localeError:Nes()}}a(XWt,"default");p();var Mes=a(()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Qr(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Qt(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} ${c.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${s}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[s.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function ezt(){return{localeError:Mes()}}a(ezt,"default");p();var Oes=a(()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Qr(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.maximum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${o.minimum.toString()} ${c.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[s.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function tzt(){return{localeError:Oes()}}a(tzt,"default");p();var Bes=a(()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Qr(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${s}${o.maximum.toString()} ${c.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Muito pequeno: esperado que ${o.origin} tivesse ${s}${o.minimum.toString()} ${c.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${n[s.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}},"error");function rzt(){return{localeError:Bes()}}a(rzt,"default");p();function fwn(t,e,r,n){let o=Math.abs(t),s=o%10,c=o%100;return c>=11&&c<=19?n:s===1?e:s>=2&&s<=4?r:n}a(fwn,"getRussianPlural");var Les=a(()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Qr(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);if(c){let l=Number(o.maximum),u=fwn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);if(c){let l=Number(o.minimum),u=fwn(l,c.unit.one,c.unit.few,c.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function nzt(){return{localeError:Les()}}a(nzt,"default");p();var Fes=a(()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Qr(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${s}${o.maximum.toString()} ${c.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${s}${o.minimum.toString()} ${c.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${n[s.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}},"error");function izt(){return{localeError:Fes()}}a(izt,"default");p();var Ues=a(()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Qr(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()} ${c.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()} ${c.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${n[s.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Qt(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function ozt(){return{localeError:Ues()}}a(ozt,"default");p();var Qes=a(()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qr(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Qt(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} ${c.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} ${c.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${s}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function szt(){return{localeError:Qes()}}a(szt,"default");p();var qes=a(()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Qr(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()} ${c.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",c=e(o.origin);return c?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()} ${c.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[s.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function azt(){return{localeError:qes()}}a(azt,"default");p();var jes=a(t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},"parsedType"),Hes=a(()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}a(e,"getSizing");let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${jes(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Qr(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Qt(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Qt(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function czt(){return{localeError:Hes()}}a(czt,"default");p();var Ges=a(()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Qr(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Qt(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function lzt(){return{localeError:Ges()}}a(lzt,"default");p();var $es=a(()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Qr(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Qt(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${o.maximum.toString()} ${c.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${s}${o.minimum.toString()} ${c.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${s}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Qt(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function uzt(){return{localeError:$es()}}a(uzt,"default");p();var Ves=a(()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Qr(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${c.verb} ${s}${o.maximum.toString()} ${c.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${c.verb} ${s}${o.minimum.toString()} ${c.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${n[s.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Qt(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function dzt(){return{localeError:Ves()}}a(dzt,"default");p();var Wes=a(()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Qr(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()} ${c.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()} ${c.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${n[s.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Qt(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function fzt(){return{localeError:Wes()}}a(fzt,"default");p();var zes=a(()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}a(e,"getSizing");let r=a(o=>{let s=typeof o;switch(s){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return s},"parsedType"),n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Qr(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Qt(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",c=e(o.origin);return c?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()} ${c.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",c=e(o.origin);return c?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()} ${c.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${n[s.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Qt(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function pzt(){return{localeError:zes()}}a(pzt,"default");p();var hzt=Symbol("ZodOutput"),mzt=Symbol("ZodInput"),xue=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function _et(){return new xue}a(_et,"registry");var bO=_et();p();p();function gzt(t,e){return new t({type:"string",...Tr(e)})}a(gzt,"_string");function Azt(t,e){return new t({type:"string",coerce:!0,...Tr(e)})}a(Azt,"_coercedString");function vet(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Tr(e)})}a(vet,"_email");function $xe(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Tr(e)})}a($xe,"_guid");function Cet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Tr(e)})}a(Cet,"_uuid");function bet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Tr(e)})}a(bet,"_uuidv4");function Tet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Tr(e)})}a(Tet,"_uuidv6");function Iet(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Tr(e)})}a(Iet,"_uuidv7");function xet(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Tr(e)})}a(xet,"_url");function wet(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Tr(e)})}a(wet,"_emoji");function Ret(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Tr(e)})}a(Ret,"_nanoid");function Pet(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Tr(e)})}a(Pet,"_cuid");function ket(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Tr(e)})}a(ket,"_cuid2");function Det(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Tr(e)})}a(Det,"_ulid");function Net(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Tr(e)})}a(Net,"_xid");function Met(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Tr(e)})}a(Met,"_ksuid");function Oet(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Tr(e)})}a(Oet,"_ipv4");function Bet(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Tr(e)})}a(Bet,"_ipv6");function Let(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Tr(e)})}a(Let,"_cidrv4");function Fet(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Tr(e)})}a(Fet,"_cidrv6");function Uet(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Tr(e)})}a(Uet,"_base64");function Qet(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Tr(e)})}a(Qet,"_base64url");function qet(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Tr(e)})}a(qet,"_e164");function jet(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Tr(e)})}a(jet,"_jwt");var yzt={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Ezt(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Tr(e)})}a(Ezt,"_isoDateTime");function _zt(t,e){return new t({type:"string",format:"date",check:"string_format",...Tr(e)})}a(_zt,"_isoDate");function vzt(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Tr(e)})}a(vzt,"_isoTime");function Czt(t,e){return new t({type:"string",format:"duration",check:"string_format",...Tr(e)})}a(Czt,"_isoDuration");function bzt(t,e){return new t({type:"number",checks:[],...Tr(e)})}a(bzt,"_number");function Szt(t,e){return new t({type:"number",coerce:!0,checks:[],...Tr(e)})}a(Szt,"_coercedNumber");function Tzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Tr(e)})}a(Tzt,"_int");function Izt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Tr(e)})}a(Izt,"_float32");function xzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Tr(e)})}a(xzt,"_float64");function wzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Tr(e)})}a(wzt,"_int32");function Rzt(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Tr(e)})}a(Rzt,"_uint32");function Pzt(t,e){return new t({type:"boolean",...Tr(e)})}a(Pzt,"_boolean");function kzt(t,e){return new t({type:"boolean",coerce:!0,...Tr(e)})}a(kzt,"_coercedBoolean");function Dzt(t,e){return new t({type:"bigint",...Tr(e)})}a(Dzt,"_bigint");function Nzt(t,e){return new t({type:"bigint",coerce:!0,...Tr(e)})}a(Nzt,"_coercedBigint");function Mzt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Tr(e)})}a(Mzt,"_int64");function Ozt(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Tr(e)})}a(Ozt,"_uint64");function Bzt(t,e){return new t({type:"symbol",...Tr(e)})}a(Bzt,"_symbol");function Lzt(t,e){return new t({type:"undefined",...Tr(e)})}a(Lzt,"_undefined");function Fzt(t,e){return new t({type:"null",...Tr(e)})}a(Fzt,"_null");function Uzt(t){return new t({type:"any"})}a(Uzt,"_any");function wue(t){return new t({type:"unknown"})}a(wue,"_unknown");function Qzt(t,e){return new t({type:"never",...Tr(e)})}a(Qzt,"_never");function qzt(t,e){return new t({type:"void",...Tr(e)})}a(qzt,"_void");function jzt(t,e){return new t({type:"date",...Tr(e)})}a(jzt,"_date");function Hzt(t,e){return new t({type:"date",coerce:!0,...Tr(e)})}a(Hzt,"_coercedDate");function Gzt(t,e){return new t({type:"nan",...Tr(e)})}a(Gzt,"_nan");function B3(t,e){return new pet({check:"less_than",...Tr(e),value:t,inclusive:!1})}a(B3,"_lt");function Kx(t,e){return new pet({check:"less_than",...Tr(e),value:t,inclusive:!0})}a(Kx,"_lte");function L3(t,e){return new het({check:"greater_than",...Tr(e),value:t,inclusive:!1})}a(L3,"_gt");function LC(t,e){return new het({check:"greater_than",...Tr(e),value:t,inclusive:!0})}a(LC,"_gte");function $zt(t){return L3(0,t)}a($zt,"_positive");function Vzt(t){return B3(0,t)}a(Vzt,"_negative");function Wzt(t){return Kx(0,t)}a(Wzt,"_nonpositive");function zzt(t){return LC(0,t)}a(zzt,"_nonnegative");function WK(t,e){return new cVt({check:"multiple_of",...Tr(e),value:t})}a(WK,"_multipleOf");function Rue(t,e){return new dVt({check:"max_size",...Tr(e),maximum:t})}a(Rue,"_maxSize");function zK(t,e){return new fVt({check:"min_size",...Tr(e),minimum:t})}a(zK,"_minSize");function Vxe(t,e){return new pVt({check:"size_equals",...Tr(e),size:t})}a(Vxe,"_size");function Pue(t,e){return new hVt({check:"max_length",...Tr(e),maximum:t})}a(Pue,"_maxLength");function _q(t,e){return new mVt({check:"min_length",...Tr(e),minimum:t})}a(_q,"_minLength");function kue(t,e){return new gVt({check:"length_equals",...Tr(e),length:t})}a(kue,"_length");function Wxe(t,e){return new AVt({check:"string_format",format:"regex",...Tr(e),pattern:t})}a(Wxe,"_regex");function zxe(t){return new yVt({check:"string_format",format:"lowercase",...Tr(t)})}a(zxe,"_lowercase");function Yxe(t){return new EVt({check:"string_format",format:"uppercase",...Tr(t)})}a(Yxe,"_uppercase");function Kxe(t,e){return new _Vt({check:"string_format",format:"includes",...Tr(e),includes:t})}a(Kxe,"_includes");function Jxe(t,e){return new vVt({check:"string_format",format:"starts_with",...Tr(e),prefix:t})}a(Jxe,"_startsWith");function Zxe(t,e){return new CVt({check:"string_format",format:"ends_with",...Tr(e),suffix:t})}a(Zxe,"_endsWith");function Yzt(t,e,r){return new bVt({check:"property",property:t,schema:e,...Tr(r)})}a(Yzt,"_property");function Xxe(t,e){return new SVt({check:"mime_type",mime:t,...Tr(e)})}a(Xxe,"_mime");function F3(t){return new TVt({check:"overwrite",tx:t})}a(F3,"_overwrite");function ewe(t){return F3(e=>e.normalize(t))}a(ewe,"_normalize");function twe(){return F3(t=>t.trim())}a(twe,"_trim");function rwe(){return F3(t=>t.toLowerCase())}a(rwe,"_toLowerCase");function nwe(){return F3(t=>t.toUpperCase())}a(nwe,"_toUpperCase");function iwe(t,e,r){return new t({type:"array",element:e,...Tr(r)})}a(iwe,"_array");function Yes(t,e,r){return new t({type:"union",options:e,...Tr(r)})}a(Yes,"_union");function Kes(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...Tr(n)})}a(Kes,"_discriminatedUnion");function Jes(t,e,r){return new t({type:"intersection",left:e,right:r})}a(Jes,"_intersection");function Kzt(t,e,r,n){let o=r instanceof uo,s=o?n:r,c=o?r:null;return new t({type:"tuple",items:e,rest:c,...Tr(s)})}a(Kzt,"_tuple");function Zes(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...Tr(n)})}a(Zes,"_record");function Xes(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...Tr(n)})}a(Xes,"_map");function ets(t,e,r){return new t({type:"set",valueType:e,...Tr(r)})}a(ets,"_set");function tts(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...Tr(r)})}a(tts,"_enum");function rts(t,e,r){return new t({type:"enum",entries:e,...Tr(r)})}a(rts,"_nativeEnum");function nts(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Tr(r)})}a(nts,"_literal");function Jzt(t,e){return new t({type:"file",...Tr(e)})}a(Jzt,"_file");function its(t,e){return new t({type:"transform",transform:e})}a(its,"_transform");function ots(t,e){return new t({type:"optional",innerType:e})}a(ots,"_optional");function sts(t,e){return new t({type:"nullable",innerType:e})}a(sts,"_nullable");function ats(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}a(ats,"_default");function cts(t,e,r){return new t({type:"nonoptional",innerType:e,...Tr(r)})}a(cts,"_nonoptional");function lts(t,e){return new t({type:"success",innerType:e})}a(lts,"_success");function uts(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}a(uts,"_catch");function dts(t,e,r){return new t({type:"pipe",in:e,out:r})}a(dts,"_pipe");function fts(t,e){return new t({type:"readonly",innerType:e})}a(fts,"_readonly");function pts(t,e,r){return new t({type:"template_literal",parts:e,...Tr(r)})}a(pts,"_templateLiteral");function hts(t,e){return new t({type:"lazy",getter:e})}a(hts,"_lazy");function mts(t,e){return new t({type:"promise",innerType:e})}a(mts,"_promise");function Zzt(t,e,r){let n=Tr(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}a(Zzt,"_custom");function Xzt(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Tr(r)})}a(Xzt,"_refine");function eYt(t,e){let r=Tr(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(A=>typeof A=="string"?A.toLowerCase():A),o=o.map(A=>typeof A=="string"?A.toLowerCase():A));let s=new Set(n),c=new Set(o),l=t.Pipe??jxe,u=t.Boolean??Uxe,d=t.String??$K,f=t.Transform??qxe,h=new f({type:"transform",transform:a((A,y)=>{let E=A;return r.case!=="sensitive"&&(E=E.toLowerCase()),s.has(E)?!0:c.has(E)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...c],input:y.value,inst:h}),{})},"transform"),error:r.error}),m=new l({type:"pipe",in:new d({type:"string",error:r.error}),out:h,error:r.error});return new l({type:"pipe",in:m,out:new u({type:"boolean",error:r.error}),error:r.error})}a(eYt,"_stringbool");function tYt(t,e,r,n={}){let o=Tr(n),s={...Tr(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:l=>r.test(l),...o};return r instanceof RegExp&&(s.pattern=r),new t(s)}a(tYt,"_stringFormat");var Het=class{static{a(this,"$ZodFunction")}constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a(((...n)=>{let o=this._def.input?Oxe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=e(...o);return this._def.output?Oxe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=a((async(...n)=>{let o=this._def.input?await Bxe(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let s=await e(...o);return this._def.output?Bxe(this._def.output,s,void 0,{callee:r}):s}),"impl");return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new VK({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function rYt(t){return new Het({type:"function",input:Array.isArray(t?.input)?Kzt(VK,t?.input):t?.input??iwe(Qxe,wue(Iue)),output:t?.output??wue(Iue)})}a(rYt,"_function");p();var owe=class{static{a(this,"JSONSchemaGenerator")}constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??bO,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},c=this.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;let l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,l);let u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{let h={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)l.ref=m,this.process(m,h),this.seen.get(m).isParent=!0;else{let g=l.schema;switch(o.type){case"string":{let A=g;A.type="string";let{minimum:y,maximum:E,format:_,patterns:v,contentEncoding:b}=e._zod.bag;if(typeof y=="number"&&(A.minLength=y),typeof E=="number"&&(A.maxLength=E),_&&(A.format=s[_]??_,A.format===""&&delete A.format),b&&(A.contentEncoding=b),v&&v.size>0){let T=[...v];T.length===1?A.pattern=T[0].source:T.length>1&&(l.schema.allOf=[...T.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let A=g,{minimum:y,maximum:E,format:_,multipleOf:v,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof _=="string"&&_.includes("int")?A.type="integer":A.type="number",typeof T=="number"&&(A.exclusiveMinimum=T),typeof y=="number"&&(A.minimum=y,typeof T=="number"&&(T>=y?delete A.minimum:delete A.exclusiveMinimum)),typeof b=="number"&&(A.exclusiveMaximum=b),typeof E=="number"&&(A.maximum=E,typeof b=="number"&&(b<=E?delete A.maximum:delete A.exclusiveMaximum)),typeof v=="number"&&(A.multipleOf=v);break}case"boolean":{let A=g;A.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{g.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{g.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let A=g,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(A.minItems=y),typeof E=="number"&&(A.maxItems=E),A.type="array",A.items=this.process(o.element,{...h,path:[...h.path,"items"]});break}case"object":{let A=g;A.type="object",A.properties={};let y=o.shape;for(let v in y)A.properties[v]=this.process(y[v],{...h,path:[...h.path,"properties",v]});let E=new Set(Object.keys(y)),_=new Set([...E].filter(v=>{let b=o.shape[v]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));_.size>0&&(A.required=Array.from(_)),o.catchall?._zod.def.type==="never"?A.additionalProperties=!1:o.catchall?o.catchall&&(A.additionalProperties=this.process(o.catchall,{...h,path:[...h.path,"additionalProperties"]})):this.io==="output"&&(A.additionalProperties=!1);break}case"union":{let A=g;A.anyOf=o.options.map((y,E)=>this.process(y,{...h,path:[...h.path,"anyOf",E]}));break}case"intersection":{let A=g,y=this.process(o.left,{...h,path:[...h.path,"allOf",0]}),E=this.process(o.right,{...h,path:[...h.path,"allOf",1]}),_=a(b=>"allOf"in b&&Object.keys(b).length===1,"isSimpleIntersection"),v=[..._(y)?y.allOf:[y],..._(E)?E.allOf:[E]];A.allOf=v;break}case"tuple":{let A=g;A.type="array";let y=o.items.map((v,b)=>this.process(v,{...h,path:[...h.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?A.prefixItems=y:A.items=y,o.rest){let v=this.process(o.rest,{...h,path:[...h.path,"items"]});this.target==="draft-2020-12"?A.items=v:A.additionalItems=v}o.rest&&(A.items=this.process(o.rest,{...h,path:[...h.path,"items"]}));let{minimum:E,maximum:_}=e._zod.bag;typeof E=="number"&&(A.minItems=E),typeof _=="number"&&(A.maxItems=_);break}case"record":{let A=g;A.type="object",A.propertyNames=this.process(o.keyType,{...h,path:[...h.path,"propertyNames"]}),A.additionalProperties=this.process(o.valueType,{...h,path:[...h.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let A=g,y=Ixe(o.entries);y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),A.enum=y;break}case"literal":{let A=g,y=[];for(let E of o.values)if(E===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(E))}else y.push(E);if(y.length!==0)if(y.length===1){let E=y[0];A.type=E===null?"null":typeof E,A.const=E}else y.every(E=>typeof E=="number")&&(A.type="number"),y.every(E=>typeof E=="string")&&(A.type="string"),y.every(E=>typeof E=="boolean")&&(A.type="string"),y.every(E=>E===null)&&(A.type="null"),A.enum=y;break}case"file":{let A=g,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:_,mime:v}=e._zod.bag;E!==void 0&&(y.minLength=E),_!==void 0&&(y.maxLength=_),v?v.length===1?(y.contentMediaType=v[0],Object.assign(A,y)):A.anyOf=v.map(b=>({...y,contentMediaType:b})):Object.assign(A,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let A=this.process(o.innerType,h);g.anyOf=[A,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"success":{let A=g;A.type="boolean";break}case"default":{this.process(o.innerType,h),l.ref=o.innerType,g.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,h),l.ref=o.innerType,this.io==="input"&&(g._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,h),l.ref=o.innerType;let A;try{A=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}g.default=A;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let A=g,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");A.type="string",A.pattern=y.source;break}case"pipe":{let A=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(A,h),l.ref=A;break}case"readonly":{this.process(o.innerType,h),l.ref=o.innerType,g.readOnly=!0;break}case"promise":{this.process(o.innerType,h),l.ref=o.innerType;break}case"optional":{this.process(o.innerType,h),l.ref=o.innerType;break}case"lazy":{let A=e._zod.innerType;this.process(A,h),l.ref=A;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let d=this.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),this.io==="input"&&rm(e)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((n=l.schema).default??(n.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let s=a(f=>{let h=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(f[0])?.id,E=n.external.uri??(v=>v);if(y)return{ref:E(y)};let _=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=_,{defId:_,ref:`${E("__shared")}#/${h}/${_}`}}if(f[1]===o)return{ref:"#"};let g=`#/${h}/`,A=f[1].schema.id??`__schema${this.counter++}`;return{defId:A,ref:g+A}},"makeURI"),c=a(f=>{if(f[1].schema.$ref)return;let h=f[1],{ref:m,defId:g}=s(f);h.def={...h.schema},g&&(h.defId=g);let A=h.schema;for(let y in A)delete A[y];A.$ref=m},"extractToDef");if(n.cycles==="throw")for(let f of this.seen.entries()){let h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}n.external||Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function Vzt(t,e){if(t instanceof kue){let n=new ywe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new ywe(e);return r.process(t),r.emit(t,e)}a(Vzt,"toJSONSchema");function em(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return em(o.element,r);case"object":{for(let s in o.shape)if(em(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(em(s,r))return!0;return!1}case"intersection":return em(o.left,r)||em(o.right,r);case"tuple":{for(let s of o.items)if(em(s,r))return!0;return!!(o.rest&&em(o.rest,r))}case"record":return em(o.keyType,r)||em(o.valueType,r);case"map":return em(o.keyType,r)||em(o.valueType,r);case"set":return em(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return em(o.innerType,r);case"lazy":return em(o.getter(),r);case"default":return em(o.innerType,r);case"prefault":return em(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return em(o.in,r)||em(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(em,"isTransforming");var twn={};p();p();p();var Oue={};wi(Oue,{ZodISODate:()=>Ket,ZodISODateTime:()=>Yet,ZodISODuration:()=>Zet,ZodISOTime:()=>Jet,date:()=>zzt,datetime:()=>Wzt,duration:()=>Kzt,time:()=>Yzt});p();var Yet=it("ZodISODateTime",(t,e)=>{wVt.init(t,e),mu.init(t,e)});function Wzt(t){return czt(Yet,t)}a(Wzt,"datetime");var Ket=it("ZodISODate",(t,e)=>{RVt.init(t,e),mu.init(t,e)});function zzt(t){return lzt(Ket,t)}a(zzt,"date");var Jet=it("ZodISOTime",(t,e)=>{kVt.init(t,e),mu.init(t,e)});function Yzt(t){return uzt(Jet,t)}a(Yzt,"time");var Zet=it("ZodISODuration",(t,e)=>{PVt.init(t,e),mu.init(t,e)});function Kzt(t){return dzt(Zet,t)}a(Kzt,"duration");p();p();var nwn=a((t,e)=>{$xe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Wxe(t,r),"value")},flatten:{value:a(r=>Vxe(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),frs=it("ZodError",nwn),Bue=it("ZodError",nwn,{Parent:Error});var Jzt=pet(Bue),Zzt=het(Bue),Xzt=met(Bue),eYt=get(Bue);var Is=it("ZodType",(t,e)=>(uo.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>HS(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>Jzt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Xzt(t,r,n),t.parseAsync=async(r,n)=>Zzt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>eYt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Lwn(r,n)),t.superRefine=r=>t.check(Fwn(r)),t.overwrite=r=>t.check(G3(r)),t.optional=()=>gu(t),t.nullable=()=>ett(t),t.nullish=()=>gu(ett(t)),t.nonoptional=r=>Twn(t,r),t.array=()=>Fr(t),t.or=r=>Cl([t,r]),t.and=r=>Swe(t,r),t.transform=r=>ttt(t,IYt(r)),t.default=r=>vwn(t,r),t.prefault=r=>Swn(t,r),t.catch=r=>wwn(t,r),t.pipe=r=>ttt(t,r),t.readonly=()=>Pwn(t),t.describe=r=>{let n=t.clone();return RO.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return RO.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return RO.get(t);let n=t.clone();return RO.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),rYt=it("_ZodString",(t,e)=>{ZK.init(t,e),Is.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(swe(...n)),t.includes=(...n)=>t.check(lwe(...n)),t.startsWith=(...n)=>t.check(uwe(...n)),t.endsWith=(...n)=>t.check(dwe(...n)),t.min=(...n)=>t.check(Iq(...n)),t.max=(...n)=>t.check(Nue(...n)),t.length=(...n)=>t.check(Mue(...n)),t.nonempty=(...n)=>t.check(Iq(1,...n)),t.lowercase=n=>t.check(awe(n)),t.uppercase=n=>t.check(cwe(n)),t.trim=()=>t.check(hwe()),t.normalize=(...n)=>t.check(pwe(...n)),t.toLowerCase=()=>t.check(mwe()),t.toUpperCase=()=>t.check(gwe())}),_we=it("ZodString",(t,e)=>{ZK.init(t,e),rYt.init(t,e),t.email=r=>t.check(xet(nYt,r)),t.url=r=>t.check(Det(iYt,r)),t.jwt=r=>t.check(Wet(_Yt,r)),t.emoji=r=>t.check(Net(sYt,r)),t.guid=r=>t.check(iwe(Xet,r)),t.uuid=r=>t.check(wet(V3,r)),t.uuidv4=r=>t.check(Ret(V3,r)),t.uuidv6=r=>t.check(ket(V3,r)),t.uuidv7=r=>t.check(Pet(V3,r)),t.nanoid=r=>t.check(Met(aYt,r)),t.guid=r=>t.check(iwe(Xet,r)),t.cuid=r=>t.check(Oet(cYt,r)),t.cuid2=r=>t.check(Bet(lYt,r)),t.ulid=r=>t.check(Let(uYt,r)),t.base64=r=>t.check(Get(AYt,r)),t.base64url=r=>t.check($et(yYt,r)),t.xid=r=>t.check(Fet(dYt,r)),t.ksuid=r=>t.check(Uet(fYt,r)),t.ipv4=r=>t.check(Qet(pYt,r)),t.ipv6=r=>t.check(qet(hYt,r)),t.cidrv4=r=>t.check(jet(mYt,r)),t.cidrv6=r=>t.check(Het(gYt,r)),t.e164=r=>t.check(Vet(EYt,r)),t.datetime=r=>t.check(Wzt(r)),t.date=r=>t.check(zzt(r)),t.time=r=>t.check(Yzt(r)),t.duration=r=>t.check(Kzt(r))});function qe(t){return ozt(_we,t)}a(qe,"string");var mu=it("ZodStringFormat",(t,e)=>{ql.init(t,e),rYt.init(t,e)}),nYt=it("ZodEmail",(t,e)=>{EVt.init(t,e),mu.init(t,e)});function hrs(t){return xet(nYt,t)}a(hrs,"email");var Xet=it("ZodGUID",(t,e)=>{AVt.init(t,e),mu.init(t,e)});function mrs(t){return iwe(Xet,t)}a(mrs,"guid");var V3=it("ZodUUID",(t,e)=>{yVt.init(t,e),mu.init(t,e)});function grs(t){return wet(V3,t)}a(grs,"uuid");function Ars(t){return Ret(V3,t)}a(Ars,"uuidv4");function yrs(t){return ket(V3,t)}a(yrs,"uuidv6");function Ers(t){return Pet(V3,t)}a(Ers,"uuidv7");var iYt=it("ZodURL",(t,e)=>{_Vt.init(t,e),mu.init(t,e)});function oYt(t){return Det(iYt,t)}a(oYt,"url");var sYt=it("ZodEmoji",(t,e)=>{CVt.init(t,e),mu.init(t,e)});function _rs(t){return Net(sYt,t)}a(_rs,"emoji");var aYt=it("ZodNanoID",(t,e)=>{vVt.init(t,e),mu.init(t,e)});function Crs(t){return Met(aYt,t)}a(Crs,"nanoid");var cYt=it("ZodCUID",(t,e)=>{bVt.init(t,e),mu.init(t,e)});function vrs(t){return Oet(cYt,t)}a(vrs,"cuid");var lYt=it("ZodCUID2",(t,e)=>{SVt.init(t,e),mu.init(t,e)});function brs(t){return Bet(lYt,t)}a(brs,"cuid2");var uYt=it("ZodULID",(t,e)=>{TVt.init(t,e),mu.init(t,e)});function Srs(t){return Let(uYt,t)}a(Srs,"ulid");var dYt=it("ZodXID",(t,e)=>{IVt.init(t,e),mu.init(t,e)});function Trs(t){return Fet(dYt,t)}a(Trs,"xid");var fYt=it("ZodKSUID",(t,e)=>{xVt.init(t,e),mu.init(t,e)});function Irs(t){return Uet(fYt,t)}a(Irs,"ksuid");var pYt=it("ZodIPv4",(t,e)=>{DVt.init(t,e),mu.init(t,e)});function xrs(t){return Qet(pYt,t)}a(xrs,"ipv4");var hYt=it("ZodIPv6",(t,e)=>{NVt.init(t,e),mu.init(t,e)});function wrs(t){return qet(hYt,t)}a(wrs,"ipv6");var mYt=it("ZodCIDRv4",(t,e)=>{MVt.init(t,e),mu.init(t,e)});function Rrs(t){return jet(mYt,t)}a(Rrs,"cidrv4");var gYt=it("ZodCIDRv6",(t,e)=>{OVt.init(t,e),mu.init(t,e)});function krs(t){return Het(gYt,t)}a(krs,"cidrv6");var AYt=it("ZodBase64",(t,e)=>{LVt.init(t,e),mu.init(t,e)});function Prs(t){return Get(AYt,t)}a(Prs,"base64");var yYt=it("ZodBase64URL",(t,e)=>{FVt.init(t,e),mu.init(t,e)});function Drs(t){return $et(yYt,t)}a(Drs,"base64url");var EYt=it("ZodE164",(t,e)=>{UVt.init(t,e),mu.init(t,e)});function Nrs(t){return Vet(EYt,t)}a(Nrs,"e164");var _Yt=it("ZodJWT",(t,e)=>{QVt.init(t,e),mu.init(t,e)});function Mrs(t){return Wet(_Yt,t)}a(Mrs,"jwt");var iwn=it("ZodCustomStringFormat",(t,e)=>{qVt.init(t,e),mu.init(t,e)});function Ors(t,e,r={}){return Gzt(iwn,t,e,r)}a(Ors,"stringFormat");var Cwe=it("ZodNumber",(t,e)=>{vet.init(t,e),Is.init(t,e),t.gt=(n,o)=>t.check(H3(n,o)),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.lt=(n,o)=>t.check(j3(n,o)),t.lte=(n,o)=>t.check(Jx(n,o)),t.max=(n,o)=>t.check(Jx(n,o)),t.int=n=>t.check(tYt(n)),t.safe=n=>t.check(tYt(n)),t.positive=n=>t.check(H3(0,n)),t.nonnegative=n=>t.check(jv(0,n)),t.negative=n=>t.check(j3(0,n)),t.nonpositive=n=>t.check(Jx(0,n)),t.multipleOf=(n,o)=>t.check(eJ(n,o)),t.step=(n,o)=>t.check(eJ(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Ra(t){return fzt(Cwe,t)}a(Ra,"number");var Lue=it("ZodNumberFormat",(t,e)=>{jVt.init(t,e),Cwe.init(t,e)});function tYt(t){return hzt(Lue,t)}a(tYt,"int");function Brs(t){return mzt(Lue,t)}a(Brs,"float32");function Lrs(t){return gzt(Lue,t)}a(Lrs,"float64");function Frs(t){return Azt(Lue,t)}a(Frs,"int32");function Urs(t){return yzt(Lue,t)}a(Urs,"uint32");var vwe=it("ZodBoolean",(t,e)=>{Zxe.init(t,e),Is.init(t,e)});function tl(t){return Ezt(vwe,t)}a(tl,"boolean");var bwe=it("ZodBigInt",(t,e)=>{bet.init(t,e),Is.init(t,e),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.gt=(n,o)=>t.check(H3(n,o)),t.gte=(n,o)=>t.check(jv(n,o)),t.min=(n,o)=>t.check(jv(n,o)),t.lt=(n,o)=>t.check(j3(n,o)),t.lte=(n,o)=>t.check(Jx(n,o)),t.max=(n,o)=>t.check(Jx(n,o)),t.positive=n=>t.check(H3(BigInt(0),n)),t.negative=n=>t.check(j3(BigInt(0),n)),t.nonpositive=n=>t.check(Jx(BigInt(0),n)),t.nonnegative=n=>t.check(jv(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(eJ(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function Qrs(t){return Czt(bwe,t)}a(Qrs,"bigint");var CYt=it("ZodBigIntFormat",(t,e)=>{HVt.init(t,e),bwe.init(t,e)});function qrs(t){return bzt(CYt,t)}a(qrs,"int64");function jrs(t){return Szt(CYt,t)}a(jrs,"uint64");var own=it("ZodSymbol",(t,e)=>{GVt.init(t,e),Is.init(t,e)});function Hrs(t){return Tzt(own,t)}a(Hrs,"symbol");var swn=it("ZodUndefined",(t,e)=>{$Vt.init(t,e),Is.init(t,e)});function Grs(t){return Izt(swn,t)}a(Grs,"_undefined");var awn=it("ZodNull",(t,e)=>{VVt.init(t,e),Is.init(t,e)});function rtt(t){return xzt(awn,t)}a(rtt,"_null");var cwn=it("ZodAny",(t,e)=>{WVt.init(t,e),Is.init(t,e)});function vYt(){return wzt(cwn)}a(vYt,"any");var lwn=it("ZodUnknown",(t,e)=>{Rue.init(t,e),Is.init(t,e)});function Zu(){return Pue(lwn)}a(Zu,"unknown");var uwn=it("ZodNever",(t,e)=>{zVt.init(t,e),Is.init(t,e)});function ntt(t){return Rzt(uwn,t)}a(ntt,"never");var dwn=it("ZodVoid",(t,e)=>{YVt.init(t,e),Is.init(t,e)});function $rs(t){return kzt(dwn,t)}a($rs,"_void");var itt=it("ZodDate",(t,e)=>{KVt.init(t,e),Is.init(t,e),t.min=(n,o)=>t.check(jv(n,o)),t.max=(n,o)=>t.check(Jx(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Vrs(t){return Pzt(itt,t)}a(Vrs,"date");var fwn=it("ZodArray",(t,e)=>{Xxe.init(t,e),Is.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(Iq(r,n)),t.nonempty=r=>t.check(Iq(1,r)),t.max=(r,n)=>t.check(Nue(r,n)),t.length=(r,n)=>t.check(Mue(r,n)),t.unwrap=()=>t.element});function Fr(t,e){return Awe(fwn,t,e)}a(Fr,"array");function Wrs(t){let e=t._zod.def.shape;return Hn(Object.keys(e))}a(Wrs,"keyof");var ott=it("ZodObject",(t,e)=>{JVt.init(t,e),Is.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>Q_(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zu()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zu()}),t.strict=()=>t.clone({...t._zod.def,catchall:ntt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(xYt,t,r[0]),t.required=(...r)=>qr.required(wYt,t,r[0])});function Wr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new ott(r)}a(Wr,"object");function zrs(t,e){return new ott({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:ntt(),...qr.normalizeParams(e)})}a(zrs,"strictObject");function Yh(t,e){return new ott({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Zu(),...qr.normalizeParams(e)})}a(Yh,"looseObject");var bYt=it("ZodUnion",(t,e)=>{Tet.init(t,e),Is.init(t,e),t.options=e.options});function Cl(t,e){return new bYt({type:"union",options:t,...qr.normalizeParams(e)})}a(Cl,"union");var pwn=it("ZodDiscriminatedUnion",(t,e)=>{bYt.init(t,e),ZVt.init(t,e)});function stt(t,e,r){return new pwn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(stt,"discriminatedUnion");var hwn=it("ZodIntersection",(t,e)=>{XVt.init(t,e),Is.init(t,e)});function Swe(t,e){return new hwn({type:"intersection",left:t,right:e})}a(Swe,"intersection");var mwn=it("ZodTuple",(t,e)=>{XK.init(t,e),Is.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function Yrs(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new mwn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(Yrs,"tuple");var SYt=it("ZodRecord",(t,e)=>{eWt.init(t,e),Is.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function vl(t,e,r){return new SYt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(vl,"record");function Krs(t,e,r){return new SYt({type:"record",keyType:Cl([t,ntt()]),valueType:e,...qr.normalizeParams(r)})}a(Krs,"partialRecord");var gwn=it("ZodMap",(t,e)=>{tWt.init(t,e),Is.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Jrs(t,e,r){return new gwn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(Jrs,"map");var Awn=it("ZodSet",(t,e)=>{rWt.init(t,e),Is.init(t,e),t.min=(...r)=>t.check(tJ(...r)),t.nonempty=r=>t.check(tJ(1,r)),t.max=(...r)=>t.check(Due(...r)),t.size=(...r)=>t.check(owe(...r))});function Zrs(t,e){return new Awn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(Zrs,"set");var Ewe=it("ZodEnum",(t,e)=>{nWt.init(t,e),Is.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Ewe({...e,checks:[],...qr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new Ewe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function Q_(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Ewe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(Q_,"_enum");function Xrs(t,e){return new Ewe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(Xrs,"nativeEnum");var ywn=it("ZodLiteral",(t,e)=>{iWt.init(t,e),Is.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Hn(t,e){return new ywn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Hn,"literal");var Ewn=it("ZodFile",(t,e)=>{oWt.init(t,e),Is.init(t,e),t.min=(r,n)=>t.check(tJ(r,n)),t.max=(r,n)=>t.check(Due(r,n)),t.mime=(r,n)=>t.check(fwe(Array.isArray(r)?r:[r],n))});function ens(t){return Qzt(Ewn,t)}a(ens,"file");var TYt=it("ZodTransform",(t,e)=>{ewe.init(t,e),Is.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function IYt(t){return new TYt({type:"transform",transform:t})}a(IYt,"transform");var xYt=it("ZodOptional",(t,e)=>{sWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function gu(t){return new xYt({type:"optional",innerType:t})}a(gu,"optional");var _wn=it("ZodNullable",(t,e)=>{aWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ett(t){return new _wn({type:"nullable",innerType:t})}a(ett,"nullable");function tns(t){return gu(ett(t))}a(tns,"nullish");var Cwn=it("ZodDefault",(t,e)=>{cWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function vwn(t,e){return new Cwn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(vwn,"_default");var bwn=it("ZodPrefault",(t,e)=>{lWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Swn(t,e){return new bwn({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Swn,"prefault");var wYt=it("ZodNonOptional",(t,e)=>{uWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Twn(t,e){return new wYt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(Twn,"nonoptional");var Iwn=it("ZodSuccess",(t,e)=>{dWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function rns(t){return new Iwn({type:"success",innerType:t})}a(rns,"success");var xwn=it("ZodCatch",(t,e)=>{fWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function wwn(t,e){return new xwn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(wwn,"_catch");var Rwn=it("ZodNaN",(t,e)=>{pWt.init(t,e),Is.init(t,e)});function nns(t){return Nzt(Rwn,t)}a(nns,"nan");var RYt=it("ZodPipe",(t,e)=>{twe.init(t,e),Is.init(t,e),t.in=e.in,t.out=e.out});function ttt(t,e){return new RYt({type:"pipe",in:t,out:e})}a(ttt,"pipe");var kwn=it("ZodReadonly",(t,e)=>{hWt.init(t,e),Is.init(t,e)});function Pwn(t){return new kwn({type:"readonly",innerType:t})}a(Pwn,"readonly");var Dwn=it("ZodTemplateLiteral",(t,e)=>{mWt.init(t,e),Is.init(t,e)});function ins(t,e){return new Dwn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(ins,"templateLiteral");var Nwn=it("ZodLazy",(t,e)=>{AWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Mwn(t){return new Nwn({type:"lazy",getter:t})}a(Mwn,"lazy");var Own=it("ZodPromise",(t,e)=>{gWt.init(t,e),Is.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ons(t){return new Own({type:"promise",innerType:t})}a(ons,"promise");var att=it("ZodCustom",(t,e)=>{yWt.init(t,e),Is.init(t,e)});function Bwn(t){let e=new mf({check:"custom"});return e._zod.check=t,e}a(Bwn,"check");function kYt(t,e){return qzt(att,t??(()=>!0),e)}a(kYt,"custom");function Lwn(t,e={}){return jzt(att,t,e)}a(Lwn,"refine");function Fwn(t){let e=Bwn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(Fwn,"superRefine");function sns(t,e={error:`Input not instance of ${t.name}`}){let r=new att({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(sns,"_instanceof");var ans=a((...t)=>Hzt({Pipe:RYt,Boolean:vwe,String:_we,Transform:TYt},...t),"stringbool");function cns(t){let e=Mwn(()=>Cl([qe(t),Ra(),tl(),rtt(),Fr(e),vl(qe(),e)]));return e}a(cns,"json");function ctt(t,e){return ttt(IYt(t),e)}a(ctt,"preprocess");p();var PYt={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function lns(t){zh({customError:t})}a(lns,"setErrorMap");function uns(){return zh().customError}a(uns,"getErrorMap");var Twe={};wi(Twe,{bigint:()=>hns,boolean:()=>pns,date:()=>mns,number:()=>fns,string:()=>dns});p();function dns(t){return szt(_we,t)}a(dns,"string");function fns(t){return pzt(Cwe,t)}a(fns,"number");function pns(t){return _zt(vwe,t)}a(pns,"boolean");function hns(t){return vzt(bwe,t)}a(hns,"bigint");function mns(t){return Dzt(itt,t)}a(mns,"date");zh(rwe());p();var si={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},gf={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},ltt=1;p();var Ans=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminal:P.boolean().optional().default(!1)}),yns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),label:P.string().nullish(),name:P.string(),optional:P.boolean().optional().default(!1),secret:P.boolean().optional().default(!0)}),Ens=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),name:P.string()}),_ns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:P.string(),link:P.string().nullish(),name:P.string(),vars:P.array(yns)}),Cns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),description:P.string().nullish(),env:P.record(P.string(),P.string()).optional(),id:P.string(),name:P.string()}),vns=P.union([_ns.and(P.object({type:P.literal("env_var")})),Cns.and(P.object({type:P.literal("terminal")})),Ens]),NYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),methodId:P.string()}),bns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Sns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),blob:P.string(),mimeType:P.string().nullish(),uri:P.string()}),Tns=P.object({default:P.boolean().nullish(),description:P.string().nullish(),title:P.string().nullish()}),Ins=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),xns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),wns=P.object({amount:P.number(),currency:P.string()}),Rns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),kns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Pns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),newText:P.string(),oldText:P.string().nullish(),path:P.string()}),MYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string()}),Dns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Nns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Mns=P.union([P.string(),P.number(),P.number(),P.boolean(),P.array(P.string())]),Ons=P.object({content:P.record(P.string(),Mns).nullish()}),Bns=P.intersection(P.union([Ons.and(P.object({action:P.literal("accept")})),P.object({action:P.literal("decline")}),P.object({action:P.literal("cancel")})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish()})),Lns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Uwn=P.string(),OYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),elicitationId:Uwn}),Fns=P.literal("object"),Uns=P.literal("string"),Qns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),qns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),form:Lns.nullish(),url:Qns.nullish()}),Qwn=P.object({const:P.string(),title:P.string()}),qwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),jns=P.union([P.literal(-32700),P.literal(-32600),P.literal(-32601),P.literal(-32602),P.literal(-32603),P.literal(-32800),P.literal(-32e3),P.literal(-32002),P.literal(-32042),P.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),jwn=P.object({code:jns,data:P.unknown().optional(),message:P.string()}),Hwn=P.unknown(),Gwn=P.unknown(),$wn=P.unknown(),Hns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),readTextFile:P.boolean().optional().default(!1),writeTextFile:P.boolean().optional().default(!1)}),Vwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),value:P.string()}),Wwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),name:P.string(),title:P.string().nullish(),version:P.string()}),Gns=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),$ns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),BYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),LYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cursor:P.string().nullish(),cwd:P.string().nullish()}),FYt=P.union([P.literal("anthropic"),P.literal("openai"),P.literal("azure"),P.literal("vertex"),P.literal("bedrock"),P.string()]),Vns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Wns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),logout:Vns.nullish()}),UYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),zns=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Yns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acp:P.boolean().optional().default(!1),http:P.boolean().optional().default(!1),sse:P.boolean().optional().default(!1)}),utt=P.string(),Kns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt}),Jns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt}),zwn=P.string(),Zns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),acpId:zwn}),Xns=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:zwn,name:P.string()}),eis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(Vwn),name:P.string(),url:P.string()}),tis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),headers:P.array(Vwn),name:P.string(),url:P.string()}),ris=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()),command:P.string(),env:P.array(qwn),name:P.string()}),dtt=P.union([eis.and(P.object({type:P.literal("http")})),tis.and(P.object({type:P.literal("sse")})),Xns.and(P.object({type:P.literal("acp")})),ris]),Ywn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),Kwn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),connectionId:utt,method:P.string(),params:P.record(P.string(),P.unknown()).nullish()}),Jwn=P.unknown(),QYt=P.string(),nis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),modelId:QYt,name:P.string()}),iis=P.union([P.literal("error"),P.literal("warning"),P.literal("information"),P.literal("hint")]),ois=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),sis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ais=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),cis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),lis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),uis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),dis=P.object({diff:P.string(),uri:P.string()}),fis=P.object({endLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:P.string()}),pis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),his=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),mis=P.object({languageId:P.string(),text:P.string(),uri:P.string()}),gis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Ais=P.union([P.literal("rejected"),P.literal("ignored"),P.literal("replaced"),P.literal("cancelled")]),yis=P.object({excerpts:P.array(fis),uri:P.string()}),Eis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),_is=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Cis=P.object({name:P.string(),owner:P.string(),remoteUrl:P.string()}),vis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),bis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),jump:pis.nullish(),rename:_is.nullish(),searchAndReplace:vis.nullish()}),Sis=P.object({id:P.string(),isRegex:P.boolean().nullish(),replace:P.string(),search:P.string(),uri:P.string()}),Tis=P.union([P.literal("automatic"),P.literal("diagnostic"),P.literal("manual")]),Iis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),maxCount:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),xis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:ois.nullish(),editHistory:uis.nullish(),openFiles:his.nullish(),recentFiles:gis.nullish(),relatedSnippets:Eis.nullish(),userActions:Iis.nullish()}),qYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt)}),wis=P.object({default:P.number().nullish(),description:P.string().nullish(),maximum:P.number().nullish(),minimum:P.number().nullish(),title:P.string().nullish()}),Zwn=P.string(),Ris=P.union([P.literal("allow_once"),P.literal("allow_always"),P.literal("reject_once"),P.literal("reject_always")]),kis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),kind:Ris,name:P.string(),optionId:Zwn}),Pis=P.union([P.literal("high"),P.literal("medium"),P.literal("low")]),Dis=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed")]),Nis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),priority:Pis,status:Dis}),Mis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),entries:P.array(Nis)}),xq=P.object({character:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),Ois=P.object({id:P.string(),position:xq,uri:P.string()}),Bis=P.object({id:P.string(),newName:P.string(),position:xq,uri:P.string()}),Lis=P.object({action:P.string(),position:xq,timestampMs:P.number(),uri:P.string()}),Xwn=P.union([P.literal("utf-16"),P.literal("utf-32"),P.literal("utf-8")]),Fis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:Ans.optional().default({terminal:!1}),elicitation:qns.nullish(),fs:Hns.optional().default({readTextFile:!1,writeTextFile:!1}),nes:bis.nullish(),positionEncodings:P.array(Xwn).optional(),terminal:P.boolean().optional().default(!1)}),Uis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audio:P.boolean().optional().default(!1),embeddedContext:P.boolean().optional().default(!1),image:P.boolean().optional().default(!1)}),eRn=P.number().int().gte(0).lte(65535),jYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),clientCapabilities:Fis.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Wwn.nullish(),protocolVersion:eRn}),Qis=P.object({apiType:FYt,baseUrl:P.string()}),qis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),current:Qis.nullish(),id:P.string(),required:P.boolean(),supported:P.array(FYt)}),jis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),providers:P.array(qis)}),His=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Fue=P.object({end:xq,start:xq}),Gis=P.object({message:P.string(),range:Fue,severity:iis,uri:P.string()}),$is=P.object({languageId:P.string(),lastFocusedMs:P.number().nullish(),uri:P.string(),visibleRange:Fue.nullish()}),Vis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),diagnostics:P.array(Gis).nullish(),editHistory:P.array(dis).nullish(),openFiles:P.array($is).nullish(),recentFiles:P.array(mis).nullish(),relatedSnippets:P.array(yis).nullish(),userActions:P.array(Lis).nullish()}),Wis=P.object({newText:P.string(),range:Fue}),zis=P.object({cursorPosition:xq.nullish(),edits:P.array(Wis),id:P.string(),uri:P.string()}),Yis=P.union([zis.and(P.object({kind:P.literal("edit")})),Ois.and(P.object({kind:P.literal("jump")})),Bis.and(P.object({kind:P.literal("rename")})),Sis.and(P.object({kind:P.literal("searchAndReplace")}))]),Kis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string()}),Jis=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),wq=P.union([P.number(),P.string()]).nullable(),dHd=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),requestId:wq}),tRn=P.object({requestId:wq}),Zis=P.enum(["assistant","user"]),Iwe=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),audience:P.array(Zis).nullish(),lastModified:P.string().nullish(),priority:P.number().nullish()}),Xis=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),data:P.string(),mimeType:P.string()}),eos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),data:P.string(),mimeType:P.string(),uri:P.string().nullish()}),tos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),description:P.string().nullish(),mimeType:P.string().nullish(),name:P.string(),size:P.number().nullish(),title:P.string().nullish(),uri:P.string()}),ros=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),optionId:Zwn}),nos=P.union([P.object({outcome:P.literal("cancelled")}),ros.and(P.object({outcome:P.literal("selected")}))]),ios=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),outcome:nos}),oos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),sos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),aos=P.object({currentValue:P.boolean()}),cos=P.string(),rRn=P.string(),los=P.union([P.literal("mode"),P.literal("model"),P.literal("thought_level"),P.string()]),HYt=P.string(),nRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),name:P.string(),value:HYt}),uos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),group:cos,name:P.string(),options:P.array(nRn)}),dos=P.union([P.array(nRn),P.array(uos)]),fos=P.object({currentValue:HYt,options:dos}),Uue=P.intersection(P.union([fos.and(P.object({type:P.literal("select")})),aos.and(P.object({type:P.literal("boolean")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),category:los.nullish(),description:P.string().nullish(),id:rRn,name:P.string()})),pos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue)}),hos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),mos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),nc=P.string(),GYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),sessionId:nc}),$Yt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),VYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),WYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),zYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),args:P.array(P.string()).optional(),command:P.string(),cwd:P.string().nullish(),env:P.array(qwn).optional(),outputByteLimit:P.number().nullish(),sessionId:nc}),YYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),KYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,uri:P.string()}),JYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),position:xq,sessionId:nc,uri:P.string(),version:P.number(),visibleRange:Fue}),ZYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),languageId:P.string(),sessionId:nc,text:P.string(),uri:P.string(),version:P.number()}),XYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,uri:P.string()}),eKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt).optional(),sessionId:nc}),tKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),rKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt),sessionId:nc}),nKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),limit:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string(),sessionId:nc}),iKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),id:P.string(),reason:Ais.nullish(),sessionId:nc}),oKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),sKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),mcpServers:P.array(dtt).optional(),sessionId:nc}),gos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:P.array(P.string()).optional(),cwd:P.string(),sessionId:nc,title:P.string().nullish(),updatedAt:P.string().nullish()}),Aos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),nextCursor:P.string().nullish(),sessions:P.array(gos)}),yos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),title:P.string().nullish(),updatedAt:P.string().nullish()}),Eos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),ftt=P.string(),_os=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),currentModeId:ftt}),Cos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string().nullish(),id:ftt,name:P.string()}),ptt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModes:P.array(Cos),currentModeId:ftt}),htt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableModels:P.array(nis),currentModelId:QYt}),vos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish(),sessionId:nc}),bos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish()}),Sos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish(),sessionId:nc}),Tos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue).nullish(),models:htt.nullish(),modes:ptt.nullish()}),Ios=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),xos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),additionalDirectories:oos.nullish(),close:sos.nullish(),delete:hos.nullish(),fork:mos.nullish(),list:Eos.nullish(),resume:Ios.nullish()}),aKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),apiType:FYt,baseUrl:P.string(),headers:P.record(P.string(),P.string()).optional(),id:P.string()}),wos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),cKt=P.intersection(P.union([P.object({type:P.literal("boolean"),value:P.boolean()}),P.object({value:HYt})]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configId:rRn,sessionId:nc})),Ros=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),configOptions:P.array(Uue)}),lKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modeId:ftt,sessionId:nc}),kos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),uKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),modelId:QYt,sessionId:nc}),Pos=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),Dos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc}),Nos=P.union([P.literal("end_turn"),P.literal("max_tokens"),P.literal("max_turn_requests"),P.literal("refusal"),P.literal("cancelled")]),Mos=P.union([P.literal("email"),P.literal("uri"),P.literal("date"),P.literal("date-time")]),Oos=P.object({default:P.string().nullish(),description:P.string().nullish(),enum:P.array(P.string()).nullish(),format:Mos.nullish(),maxLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:P.array(Qwn).nullish(),pattern:P.string().nullish(),title:P.string().nullish()}),dKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:Vis.nullish(),position:xq,selection:Fue.nullish(),sessionId:nc,triggerKind:Tis,uri:P.string(),version:P.number()}),Bos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),suggestions:P.array(Yis)}),Los=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),terminalId:P.string()}),Fos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),fKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),Uos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitStatus:Fos.nullish(),output:P.string(),truncated:P.boolean()}),Qos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),text:P.string()}),qos=P.object({range:Fue.nullish(),text:P.string()}),pKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),contentChanges:P.array(qos),sessionId:nc,uri:P.string(),version:P.number()}),fHd=P.object({method:P.string(),params:P.union([$Yt,ZYt,pKt,KYt,XYt,JYt,GYt,iKt,Ywn,Hwn]).nullish()}),jos=P.union([P.literal("full"),P.literal("incremental")]),Hos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),syncKind:jos}),Gos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),didChange:Hos.nullish(),didClose:sis.nullish(),didFocus:ais.nullish(),didOpen:cis.nullish(),didSave:lis.nullish()}),$os=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),document:Gos.nullish()}),Vos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),context:xis.nullish(),events:$os.nullish()}),Wos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),auth:Wns.optional().default({}),loadSession:P.boolean().optional().default(!1),mcpCapabilities:Yns.optional().default({acp:!1,http:!1,sse:!1}),nes:Vos.nullish(),positionEncoding:Xwn.nullish(),promptCapabilities:Uis.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:His.nullish(),sessionCapabilities:xos.optional().default({})}),zos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),agentCapabilities:Wos.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Wwn.nullish(),authMethods:P.array(vns).optional().default([]),protocolVersion:eRn}),Yos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),mimeType:P.string().nullish(),text:P.string(),uri:P.string()}),Kos=P.union([Yos,Sns]),Jos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),annotations:Iwe.nullish(),resource:Kos}),hKt=P.union([Qos.and(P.object({type:P.literal("text")})),eos.and(P.object({type:P.literal("image")})),Xis.and(P.object({type:P.literal("audio")})),tos.and(P.object({type:P.literal("resource_link")})),Jos.and(P.object({type:P.literal("resource")}))]),Zos=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:hKt}),DYt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:hKt,messageId:P.string().nullish()}),mKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),messageId:P.string().nullish(),prompt:P.array(hKt),sessionId:nc}),Xos=P.object({anyOf:P.array(Qwn)}),iRn=P.union([Zos.and(P.object({type:P.literal("content")})),Pns.and(P.object({type:P.literal("diff")})),Los.and(P.object({type:P.literal("terminal")}))]),gKt=P.string(),oRn=P.object({sessionId:nc,toolCallId:gKt.nullish()}),ess=P.intersection(P.union([oRn,tRn]),P.object({elicitationId:Uwn,url:P.string().url()})),sRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),line:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:P.string()}),aRn=P.union([P.literal("pending"),P.literal("in_progress"),P.literal("completed"),P.literal("failed")]),cRn=P.union([P.literal("read"),P.literal("edit"),P.literal("delete"),P.literal("move"),P.literal("search"),P.literal("execute"),P.literal("think"),P.literal("fetch"),P.literal("switch_mode"),P.literal("other")]),tss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(iRn).optional(),kind:cRn.optional(),locations:P.array(sRn).optional(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:aRn.optional(),title:P.string(),toolCallId:gKt}),lRn=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.array(iRn).nullish(),kind:cRn.nullish(),locations:P.array(sRn).nullish(),rawInput:P.unknown().optional(),rawOutput:P.unknown().optional(),status:aRn.nullish(),title:P.string().nullish(),toolCallId:gKt}),AKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),options:P.array(kis),sessionId:nc,toolCall:lRn}),rss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),hint:P.string()}),nss=rss,iss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),description:P.string(),input:nss.nullish(),name:P.string()}),oss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),availableCommands:P.array(iss)}),sss=P.object({enum:P.array(P.string()),type:Uns}),ass=P.union([sss,Xos]),css=P.object({default:P.array(P.string()).nullish(),description:P.string().nullish(),items:ass,maxItems:P.number().nullish(),minItems:P.number().nullish(),title:P.string().nullish()}),lss=P.union([Oos.and(P.object({type:P.literal("string")})),wis.and(P.object({type:P.literal("number")})),Gns.and(P.object({type:P.literal("integer")})),Tns.and(P.object({type:P.literal("boolean")})),css.and(P.object({type:P.literal("array")}))]),uss=P.object({description:P.string().nullish(),properties:P.record(P.string(),lss).optional().default({}),required:P.array(P.string()).nullish(),title:P.string().nullish(),type:Fns.optional().default("object")}),dss=P.intersection(P.union([oRn,tRn]),P.object({requestedSchema:uss})),yKt=P.intersection(P.union([dss.and(P.object({mode:P.literal("form")})),ess.and(P.object({mode:P.literal("url")}))]),P.object({_meta:P.record(P.string(),P.unknown()).nullish(),message:P.string()})),fss=P.object({cachedReadTokens:P.number().nullish(),cachedWriteTokens:P.number().nullish(),inputTokens:P.number(),outputTokens:P.number(),thoughtTokens:P.number().nullish(),totalTokens:P.number()}),pss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),stopReason:Nos,usage:fss.nullish(),userMessageId:P.string().nullish()}),pHd=P.union([P.object({id:wq,result:P.union([zos,bns,jis,wos,Dns,zns,Sos,bos,Aos,kns,vos,Tos,xns,kos,Ros,pss,Pos,Dos,Bos,Ins,$wn,Jwn])}),P.object({error:jwn,id:wq})]),hss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),cost:wns.nullish(),size:P.number(),used:P.number()}),mss=P.union([DYt.and(P.object({sessionUpdate:P.literal("user_message_chunk")})),DYt.and(P.object({sessionUpdate:P.literal("agent_message_chunk")})),DYt.and(P.object({sessionUpdate:P.literal("agent_thought_chunk")})),tss.and(P.object({sessionUpdate:P.literal("tool_call")})),lRn.and(P.object({sessionUpdate:P.literal("tool_call_update")})),Mis.and(P.object({sessionUpdate:P.literal("plan")})),oss.and(P.object({sessionUpdate:P.literal("available_commands_update")})),_os.and(P.object({sessionUpdate:P.literal("current_mode_update")})),pos.and(P.object({sessionUpdate:P.literal("config_option_update")})),yos.and(P.object({sessionUpdate:P.literal("session_info_update")})),hss.and(P.object({sessionUpdate:P.literal("usage_update")}))]),EKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,update:mss}),hHd=P.object({method:P.string(),params:P.union([EKt,OYt,Ywn,Hwn]).nullish()}),_Kt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),sessionId:nc,terminalId:P.string()}),gss=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),exitCode:P.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:P.string().nullish()}),Ass=P.object({name:P.string(),uri:P.string()}),CKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),repository:Cis.nullish(),workspaceFolders:P.array(Ass).nullish(),workspaceUri:P.string().nullish()}),mHd=P.object({id:wq,method:P.string(),params:P.union([jYt,NYt,BYt,aKt,MYt,UYt,qYt,rKt,LYt,YYt,eKt,sKt,WYt,lKt,cKt,mKt,uKt,CKt,dKt,VYt,Kwn,Gwn]).nullish()}),vKt=P.object({_meta:P.record(P.string(),P.unknown()).nullish(),content:P.string(),path:P.string(),sessionId:nc}),gHd=P.object({id:wq,method:P.string(),params:P.union([vKt,nKt,AKt,zYt,fKt,oKt,_Kt,tKt,yKt,Zns,Kwn,Jns,Gwn]).nullish()}),yss=P.object({_meta:P.record(P.string(),P.unknown()).nullish()}),AHd=P.union([P.object({id:wq,result:P.union([yss,Kis,ios,Rns,Uos,Jis,gss,$ns,Bns,Kns,Nns,$wn,Jwn])}),P.object({error:jwn,id:wq})]);p();function xwe(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let f of this.seen.entries()){let h=f[1];if(e===f[0]){c(f);continue}if(n.external){let g=n.external.registry.get(f[0])?.id;if(e!==f[0]&&g){c(f);continue}}if(this.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){c(f);continue}if(h.count>1&&n.reused==="ref"){c(f);continue}}let l=a((f,h)=>{let m=this.seen.get(f),g=m.def??m.schema,A={...g};if(m.ref===null)return;let y=m.ref;if(m.ref=null,y){l(y,h);let E=this.seen.get(y).schema;E.$ref&&h.target==="draft-7"?(g.allOf=g.allOf??[],g.allOf.push(E)):(Object.assign(g,E),Object.assign(g,A))}m.isParent||this.override({zodSchema:f,jsonSchema:g,path:m.path??[]})},"flattenRef");for(let f of[...this.seen.entries()].reverse())l(f[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let f=n.external.registry.get(e)?.id;if(!f)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(f)}Object.assign(u,o.def);let d=n.external?.defs??{};for(let f of this.seen.entries()){let h=f[1];h.def&&h.defId&&(d[h.defId]=h.def)}n.external||Object.keys(d).length>0&&(this.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function nYt(t,e){if(t instanceof xue){let n=new owe(e),o={};for(let l of t._idmap.entries()){let[u,d]=l;n.process(d)}let s={},c={registry:t,uri:e?.uri,defs:o};for(let l of t._idmap.entries()){let[u,d]=l;s[u]=n.emit(d,{...e,external:c})}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let r=new owe(e);return r.process(t),r.emit(t,e)}a(nYt,"toJSONSchema");function rm(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return rm(o.element,r);case"object":{for(let s in o.shape)if(rm(o.shape[s],r))return!0;return!1}case"union":{for(let s of o.options)if(rm(s,r))return!0;return!1}case"intersection":return rm(o.left,r)||rm(o.right,r);case"tuple":{for(let s of o.items)if(rm(s,r))return!0;return!!(o.rest&&rm(o.rest,r))}case"record":return rm(o.keyType,r)||rm(o.valueType,r);case"map":return rm(o.keyType,r)||rm(o.valueType,r);case"set":return rm(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return rm(o.innerType,r);case"lazy":return rm(o.getter(),r);case"default":return rm(o.innerType,r);case"prefault":return rm(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return rm(o.in,r)||rm(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}a(rm,"isTransforming");var pwn={};p();p();p();var Due={};xi(Due,{ZodISODate:()=>$et,ZodISODateTime:()=>Get,ZodISODuration:()=>Wet,ZodISOTime:()=>Vet,date:()=>oYt,datetime:()=>iYt,duration:()=>aYt,time:()=>sYt});p();var Get=ut("ZodISODateTime",(t,e)=>{UVt.init(t,e),hu.init(t,e)});function iYt(t){return Ezt(Get,t)}a(iYt,"datetime");var $et=ut("ZodISODate",(t,e)=>{QVt.init(t,e),hu.init(t,e)});function oYt(t){return _zt($et,t)}a(oYt,"date");var Vet=ut("ZodISOTime",(t,e)=>{qVt.init(t,e),hu.init(t,e)});function sYt(t){return vzt(Vet,t)}a(sYt,"time");var Wet=ut("ZodISODuration",(t,e)=>{jVt.init(t,e),hu.init(t,e)});function aYt(t){return Czt(Wet,t)}a(aYt,"duration");p();p();var mwn=a((t,e)=>{Dxe.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:a(r=>Mxe(t,r),"value")},flatten:{value:a(r=>Nxe(t,r),"value")},addIssue:{value:a(r=>t.issues.push(r),"value")},addIssues:{value:a(r=>t.issues.push(...r),"value")},isEmpty:{get(){return t.issues.length===0}}})},"initializer"),Ats=ut("ZodError",mwn),Nue=ut("ZodError",mwn,{Parent:Error});var cYt=aet(Nue),lYt=cet(Nue),uYt=uet(Nue),dYt=det(Nue);var Ss=ut("ZodType",(t,e)=>(uo.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>LS(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.parse=(r,n)=>cYt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>uYt(t,r,n),t.parseAsync=async(r,n)=>lYt(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>dYt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Ywn(r,n)),t.superRefine=r=>t.check(Kwn(r)),t.overwrite=r=>t.check(F3(r)),t.optional=()=>mu(t),t.nullable=()=>Yet(t),t.nullish=()=>mu(Yet(t)),t.nonoptional=r=>Lwn(t,r),t.array=()=>Ur(t),t.or=r=>El([t,r]),t.and=r=>dwe(t,r),t.transform=r=>Ket(t,LYt(r)),t.default=r=>Mwn(t,r),t.prefault=r=>Bwn(t,r),t.catch=r=>Qwn(t,r),t.pipe=r=>Ket(t,r),t.readonly=()=>Hwn(t),t.describe=r=>{let n=t.clone();return bO.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return bO.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return bO.get(t);let n=t.clone();return bO.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),pYt=ut("_ZodString",(t,e)=>{$K.init(t,e),Ss.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(Wxe(...n)),t.includes=(...n)=>t.check(Kxe(...n)),t.startsWith=(...n)=>t.check(Jxe(...n)),t.endsWith=(...n)=>t.check(Zxe(...n)),t.min=(...n)=>t.check(_q(...n)),t.max=(...n)=>t.check(Pue(...n)),t.length=(...n)=>t.check(kue(...n)),t.nonempty=(...n)=>t.check(_q(1,...n)),t.lowercase=n=>t.check(zxe(n)),t.uppercase=n=>t.check(Yxe(n)),t.trim=()=>t.check(twe()),t.normalize=(...n)=>t.check(ewe(...n)),t.toLowerCase=()=>t.check(rwe()),t.toUpperCase=()=>t.check(nwe())}),awe=ut("ZodString",(t,e)=>{$K.init(t,e),pYt.init(t,e),t.email=r=>t.check(vet(hYt,r)),t.url=r=>t.check(xet(mYt,r)),t.jwt=r=>t.check(jet(kYt,r)),t.emoji=r=>t.check(wet(AYt,r)),t.guid=r=>t.check($xe(zet,r)),t.uuid=r=>t.check(Cet(Q3,r)),t.uuidv4=r=>t.check(bet(Q3,r)),t.uuidv6=r=>t.check(Tet(Q3,r)),t.uuidv7=r=>t.check(Iet(Q3,r)),t.nanoid=r=>t.check(Ret(yYt,r)),t.guid=r=>t.check($xe(zet,r)),t.cuid=r=>t.check(Pet(EYt,r)),t.cuid2=r=>t.check(ket(_Yt,r)),t.ulid=r=>t.check(Det(vYt,r)),t.base64=r=>t.check(Uet(wYt,r)),t.base64url=r=>t.check(Qet(RYt,r)),t.xid=r=>t.check(Net(CYt,r)),t.ksuid=r=>t.check(Met(bYt,r)),t.ipv4=r=>t.check(Oet(SYt,r)),t.ipv6=r=>t.check(Bet(TYt,r)),t.cidrv4=r=>t.check(Let(IYt,r)),t.cidrv6=r=>t.check(Fet(xYt,r)),t.e164=r=>t.check(qet(PYt,r)),t.datetime=r=>t.check(iYt(r)),t.date=r=>t.check(oYt(r)),t.time=r=>t.check(sYt(r)),t.duration=r=>t.check(aYt(r))});function Ke(t){return gzt(awe,t)}a(Ke,"string");var hu=ut("ZodStringFormat",(t,e)=>{Fl.init(t,e),pYt.init(t,e)}),hYt=ut("ZodEmail",(t,e)=>{PVt.init(t,e),hu.init(t,e)});function Ets(t){return vet(hYt,t)}a(Ets,"email");var zet=ut("ZodGUID",(t,e)=>{wVt.init(t,e),hu.init(t,e)});function _ts(t){return $xe(zet,t)}a(_ts,"guid");var Q3=ut("ZodUUID",(t,e)=>{RVt.init(t,e),hu.init(t,e)});function vts(t){return Cet(Q3,t)}a(vts,"uuid");function Cts(t){return bet(Q3,t)}a(Cts,"uuidv4");function bts(t){return Tet(Q3,t)}a(bts,"uuidv6");function Sts(t){return Iet(Q3,t)}a(Sts,"uuidv7");var mYt=ut("ZodURL",(t,e)=>{kVt.init(t,e),hu.init(t,e)});function gYt(t){return xet(mYt,t)}a(gYt,"url");var AYt=ut("ZodEmoji",(t,e)=>{DVt.init(t,e),hu.init(t,e)});function Tts(t){return wet(AYt,t)}a(Tts,"emoji");var yYt=ut("ZodNanoID",(t,e)=>{NVt.init(t,e),hu.init(t,e)});function Its(t){return Ret(yYt,t)}a(Its,"nanoid");var EYt=ut("ZodCUID",(t,e)=>{MVt.init(t,e),hu.init(t,e)});function xts(t){return Pet(EYt,t)}a(xts,"cuid");var _Yt=ut("ZodCUID2",(t,e)=>{OVt.init(t,e),hu.init(t,e)});function wts(t){return ket(_Yt,t)}a(wts,"cuid2");var vYt=ut("ZodULID",(t,e)=>{BVt.init(t,e),hu.init(t,e)});function Rts(t){return Det(vYt,t)}a(Rts,"ulid");var CYt=ut("ZodXID",(t,e)=>{LVt.init(t,e),hu.init(t,e)});function Pts(t){return Net(CYt,t)}a(Pts,"xid");var bYt=ut("ZodKSUID",(t,e)=>{FVt.init(t,e),hu.init(t,e)});function kts(t){return Met(bYt,t)}a(kts,"ksuid");var SYt=ut("ZodIPv4",(t,e)=>{HVt.init(t,e),hu.init(t,e)});function Dts(t){return Oet(SYt,t)}a(Dts,"ipv4");var TYt=ut("ZodIPv6",(t,e)=>{GVt.init(t,e),hu.init(t,e)});function Nts(t){return Bet(TYt,t)}a(Nts,"ipv6");var IYt=ut("ZodCIDRv4",(t,e)=>{$Vt.init(t,e),hu.init(t,e)});function Mts(t){return Let(IYt,t)}a(Mts,"cidrv4");var xYt=ut("ZodCIDRv6",(t,e)=>{VVt.init(t,e),hu.init(t,e)});function Ots(t){return Fet(xYt,t)}a(Ots,"cidrv6");var wYt=ut("ZodBase64",(t,e)=>{zVt.init(t,e),hu.init(t,e)});function Bts(t){return Uet(wYt,t)}a(Bts,"base64");var RYt=ut("ZodBase64URL",(t,e)=>{YVt.init(t,e),hu.init(t,e)});function Lts(t){return Qet(RYt,t)}a(Lts,"base64url");var PYt=ut("ZodE164",(t,e)=>{KVt.init(t,e),hu.init(t,e)});function Fts(t){return qet(PYt,t)}a(Fts,"e164");var kYt=ut("ZodJWT",(t,e)=>{JVt.init(t,e),hu.init(t,e)});function Uts(t){return jet(kYt,t)}a(Uts,"jwt");var gwn=ut("ZodCustomStringFormat",(t,e)=>{ZVt.init(t,e),hu.init(t,e)});function Qts(t,e,r={}){return tYt(gwn,t,e,r)}a(Qts,"stringFormat");var cwe=ut("ZodNumber",(t,e)=>{Aet.init(t,e),Ss.init(t,e),t.gt=(n,o)=>t.check(L3(n,o)),t.gte=(n,o)=>t.check(LC(n,o)),t.min=(n,o)=>t.check(LC(n,o)),t.lt=(n,o)=>t.check(B3(n,o)),t.lte=(n,o)=>t.check(Kx(n,o)),t.max=(n,o)=>t.check(Kx(n,o)),t.int=n=>t.check(fYt(n)),t.safe=n=>t.check(fYt(n)),t.positive=n=>t.check(L3(0,n)),t.nonnegative=n=>t.check(LC(0,n)),t.negative=n=>t.check(B3(0,n)),t.nonpositive=n=>t.check(Kx(0,n)),t.multipleOf=(n,o)=>t.check(WK(n,o)),t.step=(n,o)=>t.check(WK(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Ia(t){return bzt(cwe,t)}a(Ia,"number");var Mue=ut("ZodNumberFormat",(t,e)=>{XVt.init(t,e),cwe.init(t,e)});function fYt(t){return Tzt(Mue,t)}a(fYt,"int");function qts(t){return Izt(Mue,t)}a(qts,"float32");function jts(t){return xzt(Mue,t)}a(jts,"float64");function Hts(t){return wzt(Mue,t)}a(Hts,"int32");function Gts(t){return Rzt(Mue,t)}a(Gts,"uint32");var lwe=ut("ZodBoolean",(t,e)=>{Uxe.init(t,e),Ss.init(t,e)});function Xc(t){return Pzt(lwe,t)}a(Xc,"boolean");var uwe=ut("ZodBigInt",(t,e)=>{yet.init(t,e),Ss.init(t,e),t.gte=(n,o)=>t.check(LC(n,o)),t.min=(n,o)=>t.check(LC(n,o)),t.gt=(n,o)=>t.check(L3(n,o)),t.gte=(n,o)=>t.check(LC(n,o)),t.min=(n,o)=>t.check(LC(n,o)),t.lt=(n,o)=>t.check(B3(n,o)),t.lte=(n,o)=>t.check(Kx(n,o)),t.max=(n,o)=>t.check(Kx(n,o)),t.positive=n=>t.check(L3(BigInt(0),n)),t.negative=n=>t.check(B3(BigInt(0),n)),t.nonpositive=n=>t.check(Kx(BigInt(0),n)),t.nonnegative=n=>t.check(LC(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(WK(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function $ts(t){return Dzt(uwe,t)}a($ts,"bigint");var DYt=ut("ZodBigIntFormat",(t,e)=>{eWt.init(t,e),uwe.init(t,e)});function Vts(t){return Mzt(DYt,t)}a(Vts,"int64");function Wts(t){return Ozt(DYt,t)}a(Wts,"uint64");var Awn=ut("ZodSymbol",(t,e)=>{tWt.init(t,e),Ss.init(t,e)});function zts(t){return Bzt(Awn,t)}a(zts,"symbol");var ywn=ut("ZodUndefined",(t,e)=>{rWt.init(t,e),Ss.init(t,e)});function Yts(t){return Lzt(ywn,t)}a(Yts,"_undefined");var Ewn=ut("ZodNull",(t,e)=>{nWt.init(t,e),Ss.init(t,e)});function Jet(t){return Fzt(Ewn,t)}a(Jet,"_null");var _wn=ut("ZodAny",(t,e)=>{iWt.init(t,e),Ss.init(t,e)});function NYt(){return Uzt(_wn)}a(NYt,"any");var vwn=ut("ZodUnknown",(t,e)=>{Iue.init(t,e),Ss.init(t,e)});function Zu(){return wue(vwn)}a(Zu,"unknown");var Cwn=ut("ZodNever",(t,e)=>{oWt.init(t,e),Ss.init(t,e)});function Zet(t){return Qzt(Cwn,t)}a(Zet,"never");var bwn=ut("ZodVoid",(t,e)=>{sWt.init(t,e),Ss.init(t,e)});function Kts(t){return qzt(bwn,t)}a(Kts,"_void");var Xet=ut("ZodDate",(t,e)=>{aWt.init(t,e),Ss.init(t,e),t.min=(n,o)=>t.check(LC(n,o)),t.max=(n,o)=>t.check(Kx(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function Jts(t){return jzt(Xet,t)}a(Jts,"date");var Swn=ut("ZodArray",(t,e)=>{Qxe.init(t,e),Ss.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(_q(r,n)),t.nonempty=r=>t.check(_q(1,r)),t.max=(r,n)=>t.check(Pue(r,n)),t.length=(r,n)=>t.check(kue(r,n)),t.unwrap=()=>t.element});function Ur(t,e){return iwe(Swn,t,e)}a(Ur,"array");function Zts(t){let e=t._zod.def.shape;return Gn(Object.keys(e))}a(Zts,"keyof");var ett=ut("ZodObject",(t,e)=>{cWt.init(t,e),Ss.init(t,e),qr.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>F_(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Zu()}),t.loose=()=>t.clone({...t._zod.def,catchall:Zu()}),t.strict=()=>t.clone({...t._zod.def,catchall:Zet()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>qr.extend(t,r),t.merge=r=>qr.merge(t,r),t.pick=r=>qr.pick(t,r),t.omit=r=>qr.omit(t,r),t.partial=(...r)=>qr.partial(FYt,t,r[0]),t.required=(...r)=>qr.required(UYt,t,r[0])});function Wr(t,e){let r={type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},...qr.normalizeParams(e)};return new ett(r)}a(Wr,"object");function Xts(t,e){return new ett({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Zet(),...qr.normalizeParams(e)})}a(Xts,"strictObject");function Jh(t,e){return new ett({type:"object",get shape(){return qr.assignProp(this,"shape",{...t}),this.shape},catchall:Zu(),...qr.normalizeParams(e)})}a(Jh,"looseObject");var MYt=ut("ZodUnion",(t,e)=>{Eet.init(t,e),Ss.init(t,e),t.options=e.options});function El(t,e){return new MYt({type:"union",options:t,...qr.normalizeParams(e)})}a(El,"union");var Twn=ut("ZodDiscriminatedUnion",(t,e)=>{MYt.init(t,e),lWt.init(t,e)});function ttt(t,e,r){return new Twn({type:"union",options:e,discriminator:t,...qr.normalizeParams(r)})}a(ttt,"discriminatedUnion");var Iwn=ut("ZodIntersection",(t,e)=>{uWt.init(t,e),Ss.init(t,e)});function dwe(t,e){return new Iwn({type:"intersection",left:t,right:e})}a(dwe,"intersection");var xwn=ut("ZodTuple",(t,e)=>{VK.init(t,e),Ss.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function ers(t,e,r){let n=e instanceof uo,o=n?r:e,s=n?e:null;return new xwn({type:"tuple",items:t,rest:s,...qr.normalizeParams(o)})}a(ers,"tuple");var OYt=ut("ZodRecord",(t,e)=>{dWt.init(t,e),Ss.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function _l(t,e,r){return new OYt({type:"record",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(_l,"record");function trs(t,e,r){return new OYt({type:"record",keyType:El([t,Zet()]),valueType:e,...qr.normalizeParams(r)})}a(trs,"partialRecord");var wwn=ut("ZodMap",(t,e)=>{fWt.init(t,e),Ss.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function rrs(t,e,r){return new wwn({type:"map",keyType:t,valueType:e,...qr.normalizeParams(r)})}a(rrs,"map");var Rwn=ut("ZodSet",(t,e)=>{pWt.init(t,e),Ss.init(t,e),t.min=(...r)=>t.check(zK(...r)),t.nonempty=r=>t.check(zK(1,r)),t.max=(...r)=>t.check(Rue(...r)),t.size=(...r)=>t.check(Vxe(...r))});function nrs(t,e){return new Rwn({type:"set",valueType:t,...qr.normalizeParams(e)})}a(nrs,"set");var swe=ut("ZodEnum",(t,e)=>{hWt.init(t,e),Ss.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let c of n)if(r.has(c))s[c]=e.entries[c];else throw new Error(`Key ${c} not found in enum`);return new swe({...e,checks:[],...qr.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let c of n)if(r.has(c))delete s[c];else throw new Error(`Key ${c} not found in enum`);return new swe({...e,checks:[],...qr.normalizeParams(o),entries:s})}});function F_(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new swe({type:"enum",entries:r,...qr.normalizeParams(e)})}a(F_,"_enum");function irs(t,e){return new swe({type:"enum",entries:t,...qr.normalizeParams(e)})}a(irs,"nativeEnum");var Pwn=ut("ZodLiteral",(t,e)=>{mWt.init(t,e),Ss.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function Gn(t,e){return new Pwn({type:"literal",values:Array.isArray(t)?t:[t],...qr.normalizeParams(e)})}a(Gn,"literal");var kwn=ut("ZodFile",(t,e)=>{gWt.init(t,e),Ss.init(t,e),t.min=(r,n)=>t.check(zK(r,n)),t.max=(r,n)=>t.check(Rue(r,n)),t.mime=(r,n)=>t.check(Xxe(Array.isArray(r)?r:[r],n))});function ors(t){return Jzt(kwn,t)}a(ors,"file");var BYt=ut("ZodTransform",(t,e)=>{qxe.init(t,e),Ss.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=s=>{if(typeof s=="string")r.issues.push(qr.issue(s,r.value,e));else{let c=s;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=t),c.continue??(c.continue=!0),r.issues.push(qr.issue(c))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function LYt(t){return new BYt({type:"transform",transform:t})}a(LYt,"transform");var FYt=ut("ZodOptional",(t,e)=>{AWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function mu(t){return new FYt({type:"optional",innerType:t})}a(mu,"optional");var Dwn=ut("ZodNullable",(t,e)=>{yWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Yet(t){return new Dwn({type:"nullable",innerType:t})}a(Yet,"nullable");function srs(t){return mu(Yet(t))}a(srs,"nullish");var Nwn=ut("ZodDefault",(t,e)=>{EWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function Mwn(t,e){return new Nwn({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Mwn,"_default");var Own=ut("ZodPrefault",(t,e)=>{_Wt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Bwn(t,e){return new Own({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}a(Bwn,"prefault");var UYt=ut("ZodNonOptional",(t,e)=>{vWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Lwn(t,e){return new UYt({type:"nonoptional",innerType:t,...qr.normalizeParams(e)})}a(Lwn,"nonoptional");var Fwn=ut("ZodSuccess",(t,e)=>{CWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ars(t){return new Fwn({type:"success",innerType:t})}a(ars,"success");var Uwn=ut("ZodCatch",(t,e)=>{bWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function Qwn(t,e){return new Uwn({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}a(Qwn,"_catch");var qwn=ut("ZodNaN",(t,e)=>{SWt.init(t,e),Ss.init(t,e)});function crs(t){return Gzt(qwn,t)}a(crs,"nan");var QYt=ut("ZodPipe",(t,e)=>{jxe.init(t,e),Ss.init(t,e),t.in=e.in,t.out=e.out});function Ket(t,e){return new QYt({type:"pipe",in:t,out:e})}a(Ket,"pipe");var jwn=ut("ZodReadonly",(t,e)=>{TWt.init(t,e),Ss.init(t,e)});function Hwn(t){return new jwn({type:"readonly",innerType:t})}a(Hwn,"readonly");var Gwn=ut("ZodTemplateLiteral",(t,e)=>{IWt.init(t,e),Ss.init(t,e)});function lrs(t,e){return new Gwn({type:"template_literal",parts:t,...qr.normalizeParams(e)})}a(lrs,"templateLiteral");var $wn=ut("ZodLazy",(t,e)=>{wWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.getter()});function Vwn(t){return new $wn({type:"lazy",getter:t})}a(Vwn,"lazy");var Wwn=ut("ZodPromise",(t,e)=>{xWt.init(t,e),Ss.init(t,e),t.unwrap=()=>t._zod.def.innerType});function urs(t){return new Wwn({type:"promise",innerType:t})}a(urs,"promise");var rtt=ut("ZodCustom",(t,e)=>{RWt.init(t,e),Ss.init(t,e)});function zwn(t){let e=new hf({check:"custom"});return e._zod.check=t,e}a(zwn,"check");function qYt(t,e){return Zzt(rtt,t??(()=>!0),e)}a(qYt,"custom");function Ywn(t,e={}){return Xzt(rtt,t,e)}a(Ywn,"refine");function Kwn(t){let e=zwn(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(qr.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(qr.issue(o))}},t(r.value,r)));return e}a(Kwn,"superRefine");function drs(t,e={error:`Input not instance of ${t.name}`}){let r=new rtt({type:"custom",check:"custom",fn:a(n=>n instanceof t,"fn"),abort:!0,...qr.normalizeParams(e)});return r._zod.bag.Class=t,r}a(drs,"_instanceof");var frs=a((...t)=>eYt({Pipe:QYt,Boolean:lwe,String:awe,Transform:BYt},...t),"stringbool");function prs(t){let e=Vwn(()=>El([Ke(t),Ia(),Xc(),Jet(),Ur(e),_l(Ke(),e)]));return e}a(prs,"json");function ntt(t,e){return Ket(LYt(t),e)}a(ntt,"preprocess");p();var jYt={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function hrs(t){Kh({customError:t})}a(hrs,"setErrorMap");function mrs(){return Kh().customError}a(mrs,"getErrorMap");var fwe={};xi(fwe,{bigint:()=>Ers,boolean:()=>yrs,date:()=>_rs,number:()=>Ars,string:()=>grs});p();function grs(t){return Azt(awe,t)}a(grs,"string");function Ars(t){return Szt(cwe,t)}a(Ars,"number");function yrs(t){return kzt(lwe,t)}a(yrs,"boolean");function Ers(t){return Nzt(uwe,t)}a(Ers,"bigint");function _rs(t){return Hzt(Xet,t)}a(_rs,"date");Kh(Hxe());p();var ai={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",mcp_message:"mcp/message",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",providers_disable:"providers/disable",providers_list:"providers/list",providers_set:"providers/set",session_cancel:"session/cancel",session_close:"session/close",session_delete:"session/delete",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},mf={elicitation_complete:"elicitation/complete",elicitation_create:"elicitation/create",fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",mcp_connect:"mcp/connect",mcp_disconnect:"mcp/disconnect",mcp_message:"mcp/message",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},itt=1;p();var Crs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminal:k.boolean().optional().default(!1)}),brs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),label:k.string().nullish(),name:k.string(),optional:k.boolean().optional().default(!1),secret:k.boolean().optional().default(!0)}),Srs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),name:k.string()}),Trs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:k.string(),link:k.string().nullish(),name:k.string(),vars:k.array(brs)}),Irs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),description:k.string().nullish(),env:k.record(k.string(),k.string()).optional(),id:k.string(),name:k.string()}),xrs=k.union([Trs.and(k.object({type:k.literal("env_var")})),Irs.and(k.object({type:k.literal("terminal")})),Srs]),GYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),methodId:k.string()}),wrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Rrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),blob:k.string(),mimeType:k.string().nullish(),uri:k.string()}),Prs=k.object({default:k.boolean().nullish(),description:k.string().nullish(),title:k.string().nullish()}),krs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Drs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Nrs=k.object({amount:k.number(),currency:k.string()}),Mrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),Ors=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Brs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),newText:k.string(),oldText:k.string().nullish(),path:k.string()}),$Yt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string()}),Lrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Frs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Urs=k.union([k.string(),k.number(),k.number(),k.boolean(),k.array(k.string())]),Qrs=k.object({content:k.record(k.string(),Urs).nullish()}),qrs=k.intersection(k.union([Qrs.and(k.object({action:k.literal("accept")})),k.object({action:k.literal("decline")}),k.object({action:k.literal("cancel")})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish()})),jrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Jwn=k.string(),VYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),elicitationId:Jwn}),Hrs=k.literal("object"),Grs=k.literal("string"),$rs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Vrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),form:jrs.nullish(),url:$rs.nullish()}),Zwn=k.object({const:k.string(),title:k.string()}),Xwn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),Wrs=k.union([k.literal(-32700),k.literal(-32600),k.literal(-32601),k.literal(-32602),k.literal(-32603),k.literal(-32800),k.literal(-32e3),k.literal(-32002),k.literal(-32042),k.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),eRn=k.object({code:Wrs,data:k.unknown().optional(),message:k.string()}),tRn=k.unknown(),rRn=k.unknown(),nRn=k.unknown(),zrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),readTextFile:k.boolean().optional().default(!1),writeTextFile:k.boolean().optional().default(!1)}),iRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),value:k.string()}),oRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),name:k.string(),title:k.string().nullish(),version:k.string()}),Yrs=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),Krs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),WYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),zYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cursor:k.string().nullish(),cwd:k.string().nullish()}),YYt=k.union([k.literal("anthropic"),k.literal("openai"),k.literal("azure"),k.literal("vertex"),k.literal("bedrock"),k.string()]),Jrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Zrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),logout:Jrs.nullish()}),KYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Xrs=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),ens=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acp:k.boolean().optional().default(!1),http:k.boolean().optional().default(!1),sse:k.boolean().optional().default(!1)}),ott=k.string(),tns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:ott}),rns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:ott}),sRn=k.string(),nns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),acpId:sRn}),ins=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:sRn,name:k.string()}),ons=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(iRn),name:k.string(),url:k.string()}),sns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),headers:k.array(iRn),name:k.string(),url:k.string()}),ans=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()),command:k.string(),env:k.array(Xwn),name:k.string()}),stt=k.union([ons.and(k.object({type:k.literal("http")})),sns.and(k.object({type:k.literal("sse")})),ins.and(k.object({type:k.literal("acp")})),ans]),aRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:ott,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),cRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),connectionId:ott,method:k.string(),params:k.record(k.string(),k.unknown()).nullish()}),lRn=k.unknown(),JYt=k.string(),cns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),modelId:JYt,name:k.string()}),lns=k.union([k.literal("error"),k.literal("warning"),k.literal("information"),k.literal("hint")]),uns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),dns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),fns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),pns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),hns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),mns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),gns=k.object({diff:k.string(),uri:k.string()}),Ans=k.object({endLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:k.string()}),yns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ens=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_ns=k.object({languageId:k.string(),text:k.string(),uri:k.string()}),vns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Cns=k.union([k.literal("rejected"),k.literal("ignored"),k.literal("replaced"),k.literal("cancelled")]),bns=k.object({excerpts:k.array(Ans),uri:k.string()}),Sns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Tns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Ins=k.object({name:k.string(),owner:k.string(),remoteUrl:k.string()}),xns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),wns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),jump:yns.nullish(),rename:Tns.nullish(),searchAndReplace:xns.nullish()}),Rns=k.object({id:k.string(),isRegex:k.boolean().nullish(),replace:k.string(),search:k.string(),uri:k.string()}),Pns=k.union([k.literal("automatic"),k.literal("diagnostic"),k.literal("manual")]),kns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),maxCount:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),Dns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:uns.nullish(),editHistory:mns.nullish(),openFiles:Ens.nullish(),recentFiles:vns.nullish(),relatedSnippets:Sns.nullish(),userActions:kns.nullish()}),ZYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(stt)}),Nns=k.object({default:k.number().nullish(),description:k.string().nullish(),maximum:k.number().nullish(),minimum:k.number().nullish(),title:k.string().nullish()}),uRn=k.string(),Mns=k.union([k.literal("allow_once"),k.literal("allow_always"),k.literal("reject_once"),k.literal("reject_always")]),Ons=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),kind:Mns,name:k.string(),optionId:uRn}),Bns=k.union([k.literal("high"),k.literal("medium"),k.literal("low")]),Lns=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed")]),Fns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),priority:Bns,status:Lns}),Uns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),entries:k.array(Fns)}),vq=k.object({character:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),Qns=k.object({id:k.string(),position:vq,uri:k.string()}),qns=k.object({id:k.string(),newName:k.string(),position:vq,uri:k.string()}),jns=k.object({action:k.string(),position:vq,timestampMs:k.number(),uri:k.string()}),dRn=k.union([k.literal("utf-16"),k.literal("utf-32"),k.literal("utf-8")]),Hns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Crs.optional().default({terminal:!1}),elicitation:Vrs.nullish(),fs:zrs.optional().default({readTextFile:!1,writeTextFile:!1}),nes:wns.nullish(),positionEncodings:k.array(dRn).optional(),terminal:k.boolean().optional().default(!1)}),Gns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audio:k.boolean().optional().default(!1),embeddedContext:k.boolean().optional().default(!1),image:k.boolean().optional().default(!1)}),fRn=k.number().int().gte(0).lte(65535),XYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),clientCapabilities:Hns.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:oRn.nullish(),protocolVersion:fRn}),$ns=k.object({apiType:YYt,baseUrl:k.string()}),Vns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),current:$ns.nullish(),id:k.string(),required:k.boolean(),supported:k.array(YYt)}),Wns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),providers:k.array(Vns)}),zns=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Oue=k.object({end:vq,start:vq}),Yns=k.object({message:k.string(),range:Oue,severity:lns,uri:k.string()}),Kns=k.object({languageId:k.string(),lastFocusedMs:k.number().nullish(),uri:k.string(),visibleRange:Oue.nullish()}),Jns=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),diagnostics:k.array(Yns).nullish(),editHistory:k.array(gns).nullish(),openFiles:k.array(Kns).nullish(),recentFiles:k.array(_ns).nullish(),relatedSnippets:k.array(bns).nullish(),userActions:k.array(jns).nullish()}),Zns=k.object({newText:k.string(),range:Oue}),Xns=k.object({cursorPosition:vq.nullish(),edits:k.array(Zns),id:k.string(),uri:k.string()}),eis=k.union([Xns.and(k.object({kind:k.literal("edit")})),Qns.and(k.object({kind:k.literal("jump")})),qns.and(k.object({kind:k.literal("rename")})),Rns.and(k.object({kind:k.literal("searchAndReplace")}))]),tis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string()}),ris=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cq=k.union([k.number(),k.string()]).nullable(),gqd=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),requestId:Cq}),pRn=k.object({requestId:Cq}),nis=k.enum(["assistant","user"]),pwe=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),audience:k.array(nis).nullish(),lastModified:k.string().nullish(),priority:k.number().nullish()}),iis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:pwe.nullish(),data:k.string(),mimeType:k.string()}),ois=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:pwe.nullish(),data:k.string(),mimeType:k.string(),uri:k.string().nullish()}),sis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:pwe.nullish(),description:k.string().nullish(),mimeType:k.string().nullish(),name:k.string(),size:k.number().nullish(),title:k.string().nullish(),uri:k.string()}),ais=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),optionId:uRn}),cis=k.union([k.object({outcome:k.literal("cancelled")}),ais.and(k.object({outcome:k.literal("selected")}))]),lis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),outcome:cis}),uis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),dis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),fis=k.object({currentValue:k.boolean()}),pis=k.string(),hRn=k.string(),his=k.union([k.literal("mode"),k.literal("model"),k.literal("thought_level"),k.string()]),eKt=k.string(),mRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),name:k.string(),value:eKt}),mis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),group:pis,name:k.string(),options:k.array(mRn)}),gis=k.union([k.array(mRn),k.array(mis)]),Ais=k.object({currentValue:eKt,options:gis}),Bue=k.intersection(k.union([Ais.and(k.object({type:k.literal("select")})),fis.and(k.object({type:k.literal("boolean")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),category:his.nullish(),description:k.string().nullish(),id:hRn,name:k.string()})),yis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue)}),Eis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),_is=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),nc=k.string(),tKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),sessionId:nc}),rKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc}),nKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc}),iKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc}),oKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),args:k.array(k.string()).optional(),command:k.string(),cwd:k.string().nullish(),env:k.array(Xwn).optional(),outputByteLimit:k.number().nullish(),sessionId:nc}),sKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc}),aKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,uri:k.string()}),cKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),position:vq,sessionId:nc,uri:k.string(),version:k.number(),visibleRange:Oue}),lKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),languageId:k.string(),sessionId:nc,text:k.string(),uri:k.string(),version:k.number()}),uKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,uri:k.string()}),dKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(stt).optional(),sessionId:nc}),fKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,terminalId:k.string()}),pKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(stt),sessionId:nc}),hKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),limit:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string(),sessionId:nc}),mKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),id:k.string(),reason:Cns.nullish(),sessionId:nc}),gKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,terminalId:k.string()}),AKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),mcpServers:k.array(stt).optional(),sessionId:nc}),vis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:k.array(k.string()).optional(),cwd:k.string(),sessionId:nc,title:k.string().nullish(),updatedAt:k.string().nullish()}),Cis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),nextCursor:k.string().nullish(),sessions:k.array(vis)}),bis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),title:k.string().nullish(),updatedAt:k.string().nullish()}),Sis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),att=k.string(),Tis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),currentModeId:att}),Iis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string().nullish(),id:att,name:k.string()}),ctt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModes:k.array(Iis),currentModeId:att}),ltt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableModels:k.array(cns),currentModelId:JYt}),xis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue).nullish(),models:ltt.nullish(),modes:ctt.nullish(),sessionId:nc}),wis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue).nullish(),models:ltt.nullish(),modes:ctt.nullish()}),Ris=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue).nullish(),models:ltt.nullish(),modes:ctt.nullish(),sessionId:nc}),Pis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue).nullish(),models:ltt.nullish(),modes:ctt.nullish()}),kis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Dis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),additionalDirectories:uis.nullish(),close:dis.nullish(),delete:Eis.nullish(),fork:_is.nullish(),list:Sis.nullish(),resume:kis.nullish()}),yKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),apiType:YYt,baseUrl:k.string(),headers:k.record(k.string(),k.string()).optional(),id:k.string()}),Nis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),EKt=k.intersection(k.union([k.object({type:k.literal("boolean"),value:k.boolean()}),k.object({value:eKt})]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configId:hRn,sessionId:nc})),Mis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),configOptions:k.array(Bue)}),_Kt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modeId:att,sessionId:nc}),Ois=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),vKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),modelId:JYt,sessionId:nc}),Bis=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Lis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc}),Fis=k.union([k.literal("end_turn"),k.literal("max_tokens"),k.literal("max_turn_requests"),k.literal("refusal"),k.literal("cancelled")]),Uis=k.union([k.literal("email"),k.literal("uri"),k.literal("date"),k.literal("date-time")]),Qis=k.object({default:k.string().nullish(),description:k.string().nullish(),enum:k.array(k.string()).nullish(),format:Uis.nullish(),maxLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:k.array(Zwn).nullish(),pattern:k.string().nullish(),title:k.string().nullish()}),CKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Jns.nullish(),position:vq,selection:Oue.nullish(),sessionId:nc,triggerKind:Pns,uri:k.string(),version:k.number()}),qis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),suggestions:k.array(eis)}),jis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),terminalId:k.string()}),His=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),bKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,terminalId:k.string()}),Gis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitStatus:His.nullish(),output:k.string(),truncated:k.boolean()}),$is=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:pwe.nullish(),text:k.string()}),Vis=k.object({range:Oue.nullish(),text:k.string()}),SKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),contentChanges:k.array(Vis),sessionId:nc,uri:k.string(),version:k.number()}),Aqd=k.object({method:k.string(),params:k.union([rKt,lKt,SKt,aKt,uKt,cKt,tKt,mKt,aRn,tRn]).nullish()}),Wis=k.union([k.literal("full"),k.literal("incremental")]),zis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),syncKind:Wis}),Yis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),didChange:zis.nullish(),didClose:dns.nullish(),didFocus:fns.nullish(),didOpen:pns.nullish(),didSave:hns.nullish()}),Kis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),document:Yis.nullish()}),Jis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),context:Dns.nullish(),events:Kis.nullish()}),Zis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),auth:Zrs.optional().default({}),loadSession:k.boolean().optional().default(!1),mcpCapabilities:ens.optional().default({acp:!1,http:!1,sse:!1}),nes:Jis.nullish(),positionEncoding:dRn.nullish(),promptCapabilities:Gns.optional().default({audio:!1,embeddedContext:!1,image:!1}),providers:zns.nullish(),sessionCapabilities:Dis.optional().default({})}),Xis=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),agentCapabilities:Zis.optional().default({auth:{},loadSession:!1,mcpCapabilities:{acp:!1,http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:oRn.nullish(),authMethods:k.array(xrs).optional().default([]),protocolVersion:fRn}),eos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),mimeType:k.string().nullish(),text:k.string(),uri:k.string()}),tos=k.union([eos,Rrs]),ros=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),annotations:pwe.nullish(),resource:tos}),TKt=k.union([$is.and(k.object({type:k.literal("text")})),ois.and(k.object({type:k.literal("image")})),iis.and(k.object({type:k.literal("audio")})),sis.and(k.object({type:k.literal("resource_link")})),ros.and(k.object({type:k.literal("resource")}))]),nos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:TKt}),HYt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:TKt,messageId:k.string().nullish()}),IKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),messageId:k.string().nullish(),prompt:k.array(TKt),sessionId:nc}),ios=k.object({anyOf:k.array(Zwn)}),gRn=k.union([nos.and(k.object({type:k.literal("content")})),Brs.and(k.object({type:k.literal("diff")})),jis.and(k.object({type:k.literal("terminal")}))]),xKt=k.string(),ARn=k.object({sessionId:nc,toolCallId:xKt.nullish()}),oos=k.intersection(k.union([ARn,pRn]),k.object({elicitationId:Jwn,url:k.string().url()})),yRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),line:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:k.string()}),ERn=k.union([k.literal("pending"),k.literal("in_progress"),k.literal("completed"),k.literal("failed")]),_Rn=k.union([k.literal("read"),k.literal("edit"),k.literal("delete"),k.literal("move"),k.literal("search"),k.literal("execute"),k.literal("think"),k.literal("fetch"),k.literal("switch_mode"),k.literal("other")]),sos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(gRn).optional(),kind:_Rn.optional(),locations:k.array(yRn).optional(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ERn.optional(),title:k.string(),toolCallId:xKt}),vRn=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.array(gRn).nullish(),kind:_Rn.nullish(),locations:k.array(yRn).nullish(),rawInput:k.unknown().optional(),rawOutput:k.unknown().optional(),status:ERn.nullish(),title:k.string().nullish(),toolCallId:xKt}),wKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),options:k.array(Ons),sessionId:nc,toolCall:vRn}),aos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),hint:k.string()}),cos=aos,los=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),description:k.string(),input:cos.nullish(),name:k.string()}),uos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),availableCommands:k.array(los)}),dos=k.object({enum:k.array(k.string()),type:Grs}),fos=k.union([dos,ios]),pos=k.object({default:k.array(k.string()).nullish(),description:k.string().nullish(),items:fos,maxItems:k.number().nullish(),minItems:k.number().nullish(),title:k.string().nullish()}),hos=k.union([Qis.and(k.object({type:k.literal("string")})),Nns.and(k.object({type:k.literal("number")})),Yrs.and(k.object({type:k.literal("integer")})),Prs.and(k.object({type:k.literal("boolean")})),pos.and(k.object({type:k.literal("array")}))]),mos=k.object({description:k.string().nullish(),properties:k.record(k.string(),hos).optional().default({}),required:k.array(k.string()).nullish(),title:k.string().nullish(),type:Hrs.optional().default("object")}),gos=k.intersection(k.union([ARn,pRn]),k.object({requestedSchema:mos})),RKt=k.intersection(k.union([gos.and(k.object({mode:k.literal("form")})),oos.and(k.object({mode:k.literal("url")}))]),k.object({_meta:k.record(k.string(),k.unknown()).nullish(),message:k.string()})),Aos=k.object({cachedReadTokens:k.number().nullish(),cachedWriteTokens:k.number().nullish(),inputTokens:k.number(),outputTokens:k.number(),thoughtTokens:k.number().nullish(),totalTokens:k.number()}),yos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),stopReason:Fis,usage:Aos.nullish(),userMessageId:k.string().nullish()}),yqd=k.union([k.object({id:Cq,result:k.union([Xis,wrs,Wns,Nis,Lrs,Xrs,Ris,wis,Cis,Ors,xis,Pis,Drs,Ois,Mis,yos,Bis,Lis,qis,krs,nRn,lRn])}),k.object({error:eRn,id:Cq})]),Eos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),cost:Nrs.nullish(),size:k.number(),used:k.number()}),_os=k.union([HYt.and(k.object({sessionUpdate:k.literal("user_message_chunk")})),HYt.and(k.object({sessionUpdate:k.literal("agent_message_chunk")})),HYt.and(k.object({sessionUpdate:k.literal("agent_thought_chunk")})),sos.and(k.object({sessionUpdate:k.literal("tool_call")})),vRn.and(k.object({sessionUpdate:k.literal("tool_call_update")})),Uns.and(k.object({sessionUpdate:k.literal("plan")})),uos.and(k.object({sessionUpdate:k.literal("available_commands_update")})),Tis.and(k.object({sessionUpdate:k.literal("current_mode_update")})),yis.and(k.object({sessionUpdate:k.literal("config_option_update")})),bis.and(k.object({sessionUpdate:k.literal("session_info_update")})),Eos.and(k.object({sessionUpdate:k.literal("usage_update")}))]),PKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,update:_os}),Eqd=k.object({method:k.string(),params:k.union([PKt,VYt,aRn,tRn]).nullish()}),kKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),sessionId:nc,terminalId:k.string()}),vos=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),exitCode:k.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:k.string().nullish()}),Cos=k.object({name:k.string(),uri:k.string()}),DKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),repository:Ins.nullish(),workspaceFolders:k.array(Cos).nullish(),workspaceUri:k.string().nullish()}),_qd=k.object({id:Cq,method:k.string(),params:k.union([XYt,GYt,WYt,yKt,$Yt,KYt,ZYt,pKt,zYt,sKt,dKt,AKt,iKt,_Kt,EKt,IKt,vKt,DKt,CKt,nKt,cRn,rRn]).nullish()}),NKt=k.object({_meta:k.record(k.string(),k.unknown()).nullish(),content:k.string(),path:k.string(),sessionId:nc}),vqd=k.object({id:Cq,method:k.string(),params:k.union([NKt,hKt,wKt,oKt,bKt,gKt,kKt,fKt,RKt,nns,cRn,rns,rRn]).nullish()}),bos=k.object({_meta:k.record(k.string(),k.unknown()).nullish()}),Cqd=k.union([k.object({id:Cq,result:k.union([bos,tis,lis,Mrs,Gis,ris,vos,Krs,qrs,tns,Frs,nRn,lRn])}),k.object({error:eRn,id:Cq})]);p();function hwe(t,e){let r=new TextEncoder,n=new TextDecoder,o=new ReadableStream({async start(c){let l="",u=e.getReader();try{for(;;){let{value:f,done:h}=await u.read();if(h){l+=n.decode();break}if(!f)continue;l+=n.decode(f,{stream:!0});let m=l.split(` `);l=m.pop()||"";for(let g of m){let A=g.trim();if(A)try{let y=JSON.parse(A);c.enqueue(y)}catch(y){console.error("Failed to parse JSON message:",A,y)}}}let d=l.trim();if(d)try{let f=JSON.parse(d);c.enqueue(f)}catch(f){console.error("Failed to parse JSON message:",d,f)}}catch(d){c.error(d);return}finally{u.releaseLock()}c.close()}}),s=new WritableStream({async write(c){let l=JSON.stringify(c)+` -`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(xwe,"ndJsonStream");function Zx(t){return t??{}}a(Zx,"emptyObjectResponse");function uRn(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(uRn,"rejectedPromise");var wwe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case si.initialize:{let u=jYt.parse(l);return n.initialize(u)}case si.session_new:{let u=qYt.parse(l);return n.newSession(u)}case si.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=rKt.parse(l);return n.loadSession(u)}case si.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=LYt.parse(l);return n.listSessions(u)}case si.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=YYt.parse(l);return await n.unstable_deleteSession(u)??{}}case si.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=eKt.parse(l);return n.unstable_forkSession(u)}case si.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=sKt.parse(l);return n.resumeSession(u)}case si.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=WYt.parse(l);return await n.closeSession(u)??{}}case si.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=lKt.parse(l);return await n.setSessionMode(u)??{}}case si.authenticate:{let u=NYt.parse(l);return await n.authenticate(u)??{}}case si.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=BYt.parse(l);return n.unstable_listProviders(u)}case si.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=aKt.parse(l);return await n.unstable_setProvider(u)??{}}case si.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=MYt.parse(l);return await n.unstable_disableProvider(u)??{}}case si.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=UYt.parse(l);return await n.unstable_logout(u)??{}}case si.session_prompt:{let u=mKt.parse(l);return n.prompt(u)}case si.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=uKt.parse(l);return await n.unstable_setSessionModel(u)??{}}case si.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=cKt.parse(l);return n.setSessionConfigOption(u)}case si.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=CKt.parse(l);return n.unstable_startNes(u)}case si.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=dKt.parse(l);return n.unstable_suggestNes(u)}case si.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=VYt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case si.session_cancel:{let u=$Yt.parse(l);return n.cancel(u)}case si.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=ZYt.parse(l);return n.unstable_didOpenDocument(u)}case si.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=pKt.parse(l);return n.unstable_didChangeDocument(u)}case si.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=KYt.parse(l);return n.unstable_didCloseDocument(u)}case si.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=XYt.parse(l);return n.unstable_didSaveDocument(u)}case si.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=JYt.parse(l);return n.unstable_didFocusDocument(u)}case si.nes_accept:{if(!n.unstable_acceptNes)return;let u=GYt.parse(l);return n.unstable_acceptNes(u)}case si.nes_reject:{if(!n.unstable_rejectNes)return;let u=iKt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new gtt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(gf.session_update,e)}requestPermission(e){return this.connection.sendRequest(gf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(gf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(gf.fs_write_text_file,e,Zx)}createTerminal(e){return this.connection.sendRequest(gf.terminal_create,e,r=>new bKt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(gf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(gf.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},bKt=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(gf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(gf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(gf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Zx)}release(){return this.connection.sendRequest(gf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Zx)}async[Symbol.asyncDispose](){await this.release()}},mtt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case gf.fs_write_text_file:{let u=vKt.parse(l);return await n.writeTextFile?.(u)??{}}case gf.fs_read_text_file:{let u=nKt.parse(l);return n.readTextFile?.(u)}case gf.session_request_permission:{let u=AKt.parse(l);return n.requestPermission(u)}case gf.terminal_create:{let u=zYt.parse(l);return n.createTerminal?.(u)}case gf.terminal_output:{let u=fKt.parse(l);return n.terminalOutput?.(u)}case gf.terminal_release:{let u=oKt.parse(l);return await n.releaseTerminal?.(u)??{}}case gf.terminal_wait_for_exit:{let u=_Kt.parse(l);return n.waitForTerminalExit?.(u)}case gf.terminal_kill:{let u=tKt.parse(l);return await n.killTerminal?.(u)??{}}case gf.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=yKt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case gf.session_update:{let u=EKt.parse(l);return n.sessionUpdate(u)}case gf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=OYt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new gtt(o,s,r)}initialize(e){return this.connection.sendRequest(si.initialize,e)}newSession(e){return this.connection.sendRequest(si.session_new,e)}loadSession(e){return this.connection.sendRequest(si.session_load,e,Zx)}unstable_forkSession(e){return this.connection.sendRequest(si.session_fork,e)}listSessions(e){return this.connection.sendRequest(si.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(si.session_delete,e,Zx)}resumeSession(e){return this.connection.sendRequest(si.session_resume,e)}closeSession(e){return this.connection.sendRequest(si.session_close,e)}setSessionMode(e){return this.connection.sendRequest(si.session_set_mode,e,Zx)}unstable_setSessionModel(e){return this.connection.sendRequest(si.session_set_model,e,Zx)}setSessionConfigOption(e){return this.connection.sendRequest(si.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(si.authenticate,e,Zx)}unstable_listProviders(e){return this.connection.sendRequest(si.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(si.providers_set,e,Zx)}unstable_disableProvider(e){return this.connection.sendRequest(si.providers_disable,e,Zx)}unstable_logout(e){return this.connection.sendRequest(si.logout,e,Zx)}prompt(e){return this.connection.sendRequest(si.session_prompt,e)}cancel(e){return this.connection.sendNotification(si.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(si.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(si.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(si.nes_close,e,Zx)}unstable_didOpenDocument(e){return this.connection.sendNotification(si.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(si.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(si.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(si.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(si.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(si.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(si.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},gtt=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof P.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof P.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new fo(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return uRn(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?uRn(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},fo=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var Q_e=require("node:stream");p();Ns();p();var Hv=class extends Jz{constructor(r){super(new lce,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","TransparentTokenRefresh","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${_ss(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(je[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function _ss(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(_ss,"camelCaseToSnakeCaseAllCaps");var Css="unknown-editor",dRn="unknown-editor-plugin",Rq=class extends Lr{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:Css,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:dRn,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}};function fRn(t){return t.getEditorPluginInfo().name!==dRn}a(fRn,"hasValidInfo");p();p();var Att=new ge("agenticTurnProcessor"),kwe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new HQ(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Z0(e.ctx),this.hookTrigger=new Kle(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.updateTurnResponseWithError(d),u instanceof Error?await this.fireErrorOccurredHook(u):await this.fireErrorOccurredHook(new Error(String(u))),await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c,l,u){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let d=await Jc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!K0n(this.turn.chatMode)){let g=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});ht(this.turnContext.ctx,"customAgent.turn",g),MI(this.turnContext.ctx,"customAgent.turn",g)}r.onCancellationRequested(async()=>{Att.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let f=xK().find(g=>g.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let m=(await Px(this.turnContext.ctx)).find(g=>g.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,d,f,m);try{let g=l&&c?await QM(this.turnContext.ctx,l,c):await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),SQ(this.conversation.turns));Uo.applyModelConfigurationOverrides(this.turnContext.ctx,g,u),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(Uv).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){Ye.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new gue(this.turnContext,this.chatFetcher,g,d).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,d.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(g){if(g instanceof gq)Att.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,g),this.turn.status="cancelled",await this.cancelProgress();else if(g instanceof Mc)Att.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,g),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(g instanceof D3)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:{message:g.message,code:mQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(g instanceof AA)this.turn.status="error",this.updateTurnResponseWithError(g.message),await this.fireErrorOccurredHook(g),await this.endProgress({error:g.conversationError});else throw Att.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,g),g}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new lle(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return Ye.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=TQ(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=XJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){Ye.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=zle(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){Ye.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var SKt="collect-context",TKt="generate-response",ytt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.postProcessor=new Ale(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new Z0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s,c,l){try{await this.processWithModel(e,r,this.turnContext,n,o,s,c,l)}catch(u){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,u);let d=u instanceof Error?u.message:String(u);this.turn.status="error",this.turn.response={message:d,type:"meta"},await this.endProgress({error:{message:d,code:mQ.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c,l,u){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let d=await Jc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(d=d.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let f=xK().find(A=>A.id===this.turn.template?.templateId);if(f?.response){await this.handleTemplateResponse(f,this.turn.template.userQuestion,r);return}let h=(await Px(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(h){let A=await this.checkAgentPreconditions(h);if(A){await this.endProgress(A);return}}await n.steps.start(SKt,"Collecting context"),await this.collectContext(n,r,d,this.strategy.uiKind,f,h);let m;l?m="customized":c?m=(await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),SQ(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(SKt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(SKt),await n.steps.start(TKt,"Generating response");let A=this.augmentTelemetry(g,d,f,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,d.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c,l,u),E=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:E}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){Ye.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new lle(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c,l,u){r.onCancellationRequested(async()=>{await this.cancelProgress()});let d="",f=0,h=new YQ((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(CIe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(k=>({severity:"warning",message:k.message})),thinking:w}),this.turn.response?this.turn.response.message=tKe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),d+=E,this.strategy.currentDocument){let k=this.strategy.extractEditsFromResponse(d,this.strategy.currentDocument);k&&k.length>0&&(d="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:k}),f+=k.length)}}),m=l&&c?await QM(this.turnContext.ctx,l,c):await Uo.getModelConfiguration(this.turnContext.ctx,void 0,c,void 0,this.conversation.id.toString(),Nmn(e));Uo.applyModelConfigurationOverrides(this.turnContext.ctx,m,u),e=Uo.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(Uv).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){Ye.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:In(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>h.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:f}),await this.postProcessor.postProcess(y,r,h.appliedText,n,o,In(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Imn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,In(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=QTe(this.conversation,this.strategy.uiKind,In(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=QTe(this.conversation,this.strategy.uiKind,In(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(TKt,e.error.message):await r.steps.finish(TKt)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=XJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){Ye.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=zle(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){Ye.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();Ns();p();var qHi=ce(Al()),jHi=ce(sP());p();p();var Ke={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var vA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(pRn(e))}};function Ne(t,e){let r=Ou.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=pRn(r.Errors(s));return[null,{code:Ke.InvalidParams,message:c}]}return e(n,o,s)}}a(Ne,"addMethodHandlerValidation");function pRn(t){return`Schema validation failed with the following errors: +`,u=t.getWriter();try{await u.write(r.encode(l))}finally{u.releaseLock()}}});return{readable:o,writable:s}}a(hwe,"ndJsonStream");function Jx(t){return t??{}}a(Jx,"emptyObjectResponse");function CRn(t){let e=Promise.reject(t);return e.catch(()=>{}),e}a(CRn,"rejectedPromise");var mwe=class{static{a(this,"AgentSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case ai.initialize:{let u=XYt.parse(l);return n.initialize(u)}case ai.session_new:{let u=ZYt.parse(l);return n.newSession(u)}case ai.session_load:{if(!n.loadSession)throw fo.methodNotFound(c);let u=pKt.parse(l);return n.loadSession(u)}case ai.session_list:{if(!n.listSessions)throw fo.methodNotFound(c);let u=zYt.parse(l);return n.listSessions(u)}case ai.session_delete:{if(!n.unstable_deleteSession)throw fo.methodNotFound(c);let u=sKt.parse(l);return await n.unstable_deleteSession(u)??{}}case ai.session_fork:{if(!n.unstable_forkSession)throw fo.methodNotFound(c);let u=dKt.parse(l);return n.unstable_forkSession(u)}case ai.session_resume:{if(!n.resumeSession)throw fo.methodNotFound(c);let u=AKt.parse(l);return n.resumeSession(u)}case ai.session_close:{if(!n.closeSession)throw fo.methodNotFound(c);let u=iKt.parse(l);return await n.closeSession(u)??{}}case ai.session_set_mode:{if(!n.setSessionMode)throw fo.methodNotFound(c);let u=_Kt.parse(l);return await n.setSessionMode(u)??{}}case ai.authenticate:{let u=GYt.parse(l);return await n.authenticate(u)??{}}case ai.providers_list:{if(!n.unstable_listProviders)throw fo.methodNotFound(c);let u=WYt.parse(l);return n.unstable_listProviders(u)}case ai.providers_set:{if(!n.unstable_setProvider)throw fo.methodNotFound(c);let u=yKt.parse(l);return await n.unstable_setProvider(u)??{}}case ai.providers_disable:{if(!n.unstable_disableProvider)throw fo.methodNotFound(c);let u=$Yt.parse(l);return await n.unstable_disableProvider(u)??{}}case ai.logout:{if(!n.unstable_logout)throw fo.methodNotFound(c);let u=KYt.parse(l);return await n.unstable_logout(u)??{}}case ai.session_prompt:{let u=IKt.parse(l);return n.prompt(u)}case ai.session_set_model:{if(!n.unstable_setSessionModel)throw fo.methodNotFound(c);let u=vKt.parse(l);return await n.unstable_setSessionModel(u)??{}}case ai.session_set_config_option:{if(!n.setSessionConfigOption)throw fo.methodNotFound(c);let u=EKt.parse(l);return n.setSessionConfigOption(u)}case ai.nes_start:{if(!n.unstable_startNes)throw fo.methodNotFound(c);let u=DKt.parse(l);return n.unstable_startNes(u)}case ai.nes_suggest:{if(!n.unstable_suggestNes)throw fo.methodNotFound(c);let u=CKt.parse(l);return n.unstable_suggestNes(u)}case ai.nes_close:{if(!n.unstable_closeNes)throw fo.methodNotFound(c);let u=nKt.parse(l);return await n.unstable_closeNes(u)??{}}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case ai.session_cancel:{let u=rKt.parse(l);return n.cancel(u)}case ai.document_did_open:{if(!n.unstable_didOpenDocument)return;let u=lKt.parse(l);return n.unstable_didOpenDocument(u)}case ai.document_did_change:{if(!n.unstable_didChangeDocument)return;let u=SKt.parse(l);return n.unstable_didChangeDocument(u)}case ai.document_did_close:{if(!n.unstable_didCloseDocument)return;let u=aKt.parse(l);return n.unstable_didCloseDocument(u)}case ai.document_did_save:{if(!n.unstable_didSaveDocument)return;let u=uKt.parse(l);return n.unstable_didSaveDocument(u)}case ai.document_did_focus:{if(!n.unstable_didFocusDocument)return;let u=cKt.parse(l);return n.unstable_didFocusDocument(u)}case ai.nes_accept:{if(!n.unstable_acceptNes)return;let u=tKt.parse(l);return n.unstable_acceptNes(u)}case ai.nes_reject:{if(!n.unstable_rejectNes)return;let u=mKt.parse(l);return n.unstable_rejectNes(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new dtt(o,s,r)}sessionUpdate(e){return this.connection.sendNotification(mf.session_update,e)}requestPermission(e){return this.connection.sendRequest(mf.session_request_permission,e)}readTextFile(e){return this.connection.sendRequest(mf.fs_read_text_file,e)}writeTextFile(e){return this.connection.sendRequest(mf.fs_write_text_file,e,Jx)}createTerminal(e){return this.connection.sendRequest(mf.terminal_create,e,r=>new MKt(r.terminalId,e.sessionId,this.connection))}unstable_createElicitation(e){return this.connection.sendRequest(mf.elicitation_create,e)}unstable_completeElicitation(e){return this.connection.sendNotification(mf.elicitation_complete,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},MKt=class{static{a(this,"TerminalHandle")}id;sessionId;connection;constructor(e,r,n){this.id=e,this.sessionId=r,this.connection=n}currentOutput(){return this.connection.sendRequest(mf.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}waitForExit(){return this.connection.sendRequest(mf.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}kill(){return this.connection.sendRequest(mf.terminal_kill,{sessionId:this.sessionId,terminalId:this.id},Jx)}release(){return this.connection.sendRequest(mf.terminal_release,{sessionId:this.sessionId,terminalId:this.id},Jx)}async[Symbol.asyncDispose](){await this.release()}},utt=class{static{a(this,"ClientSideConnection")}connection;constructor(e,r){let n=e(this),o=a(async(c,l)=>{switch(c){case mf.fs_write_text_file:{let u=NKt.parse(l);return await n.writeTextFile?.(u)??{}}case mf.fs_read_text_file:{let u=hKt.parse(l);return n.readTextFile?.(u)}case mf.session_request_permission:{let u=wKt.parse(l);return n.requestPermission(u)}case mf.terminal_create:{let u=oKt.parse(l);return n.createTerminal?.(u)}case mf.terminal_output:{let u=bKt.parse(l);return n.terminalOutput?.(u)}case mf.terminal_release:{let u=gKt.parse(l);return await n.releaseTerminal?.(u)??{}}case mf.terminal_wait_for_exit:{let u=kKt.parse(l);return n.waitForTerminalExit?.(u)}case mf.terminal_kill:{let u=fKt.parse(l);return await n.killTerminal?.(u)??{}}case mf.elicitation_create:{if(!n.unstable_createElicitation)throw fo.methodNotFound(c);let u=RKt.parse(l);return n.unstable_createElicitation(u)}default:if(n.extMethod)return n.extMethod(c,l);throw fo.methodNotFound(c)}},"requestHandler"),s=a(async(c,l)=>{switch(c){case mf.session_update:{let u=PKt.parse(l);return n.sessionUpdate(u)}case mf.elicitation_complete:{if(!n.unstable_completeElicitation)return;let u=VYt.parse(l);return n.unstable_completeElicitation(u)}default:if(n.extNotification)return n.extNotification(c,l);throw fo.methodNotFound(c)}},"notificationHandler");this.connection=new dtt(o,s,r)}initialize(e){return this.connection.sendRequest(ai.initialize,e)}newSession(e){return this.connection.sendRequest(ai.session_new,e)}loadSession(e){return this.connection.sendRequest(ai.session_load,e,Jx)}unstable_forkSession(e){return this.connection.sendRequest(ai.session_fork,e)}listSessions(e){return this.connection.sendRequest(ai.session_list,e)}unstable_deleteSession(e){return this.connection.sendRequest(ai.session_delete,e,Jx)}resumeSession(e){return this.connection.sendRequest(ai.session_resume,e)}closeSession(e){return this.connection.sendRequest(ai.session_close,e)}setSessionMode(e){return this.connection.sendRequest(ai.session_set_mode,e,Jx)}unstable_setSessionModel(e){return this.connection.sendRequest(ai.session_set_model,e,Jx)}setSessionConfigOption(e){return this.connection.sendRequest(ai.session_set_config_option,e)}authenticate(e){return this.connection.sendRequest(ai.authenticate,e,Jx)}unstable_listProviders(e){return this.connection.sendRequest(ai.providers_list,e)}unstable_setProvider(e){return this.connection.sendRequest(ai.providers_set,e,Jx)}unstable_disableProvider(e){return this.connection.sendRequest(ai.providers_disable,e,Jx)}unstable_logout(e){return this.connection.sendRequest(ai.logout,e,Jx)}prompt(e){return this.connection.sendRequest(ai.session_prompt,e)}cancel(e){return this.connection.sendNotification(ai.session_cancel,e)}unstable_startNes(e){return this.connection.sendRequest(ai.nes_start,e)}unstable_suggestNes(e){return this.connection.sendRequest(ai.nes_suggest,e)}unstable_closeNes(e){return this.connection.sendRequest(ai.nes_close,e,Jx)}unstable_didOpenDocument(e){return this.connection.sendNotification(ai.document_did_open,e)}unstable_didChangeDocument(e){return this.connection.sendNotification(ai.document_did_change,e)}unstable_didCloseDocument(e){return this.connection.sendNotification(ai.document_did_close,e)}unstable_didSaveDocument(e){return this.connection.sendNotification(ai.document_did_save,e)}unstable_didFocusDocument(e){return this.connection.sendNotification(ai.document_did_focus,e)}unstable_acceptNes(e){return this.connection.sendNotification(ai.nes_accept,e)}unstable_rejectNes(e){return this.connection.sendNotification(ai.nes_reject,e)}extMethod(e,r){return this.connection.sendRequest(e,r)}extNotification(e,r){return this.connection.sendNotification(e,r)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}},dtt=class{static{a(this,"Connection")}pendingResponses=new Map;nextRequestId=0;requestHandler;notificationHandler;stream;writeQueue=Promise.resolve();abortController=new AbortController;closedPromise;constructor(e,r,n){this.requestHandler=e,this.notificationHandler=r,this.stream=n,this.closedPromise=new Promise(o=>{this.abortController.signal.addEventListener("abort",()=>o())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let r=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:n,done:o}=await r.read();if(o)break;if(n)try{this.processMessage(n)}catch(s){console.error("Unexpected error during message processing:",n,s),"id"in n&&n.id!==void 0&&this.sendMessage({jsonrpc:"2.0",id:n.id,error:{code:-32700,message:"Parse error"}})}}}finally{r.releaseLock()}}catch(r){e=r}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let r=e??new Error("ACP connection closed");for(let n of this.pendingResponses.values())n.reject(r);this.pendingResponses.clear(),this.abortController.abort(r)}async processMessage(e){if("method"in e&&"id"in e){let r=await this.tryCallRequestHandler(e.method,e.params);"error"in r&&console.error("Error handling request",e,r.error),await this.sendMessage({jsonrpc:"2.0",id:e.id,...r})}else if("method"in e){let r=await this.tryCallNotificationHandler(e.method,e.params);"error"in r&&console.error("Error handling notification",e,r.error)}else"id"in e?this.handleResponse(e):console.error("Invalid message",{message:e})}async tryCallRequestHandler(e,r){try{return{result:await this.requestHandler(e,r)??null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}async tryCallNotificationHandler(e,r){try{return await this.notificationHandler(e,r),{result:null}}catch(n){if(n instanceof fo)return n.toResult();if(n instanceof k.ZodError)return fo.invalidParams(n.format()).toResult();let o;(n instanceof Error||typeof n=="object"&&n!=null&&"message"in n&&typeof n.message=="string")&&(o=n.message);try{return fo.internalError(o?JSON.parse(o):{}).toResult()}catch{return fo.internalError({details:o}).toResult()}}}handleResponse(e){let r=this.pendingResponses.get(e.id);if(r){if("result"in e)r.resolve(e.result);else if("error"in e){let{code:n,message:o,data:s}=e.error;r.reject(new fo(n,o,s))}this.pendingResponses.delete(e.id)}else console.error("Got response to unknown request",e.id)}sendRequest(e,r,n){if(this.abortController.signal.aborted)return CRn(this.closedReason());let o=this.nextRequestId++,s=new Promise((c,l)=>{this.pendingResponses.set(o,{resolve:a(u=>{try{c(n?n(u):u)}catch(d){l(d)}},"resolve"),reject:l})});return s.catch(()=>{}),this.sendMessage({jsonrpc:"2.0",id:o,method:e,params:r}),s}sendNotification(e,r){return this.abortController.signal.aborted?CRn(this.closedReason()):this.sendMessage({jsonrpc:"2.0",method:e,params:r})}closedReason(){return this.abortController.signal.reason??new Error("ACP connection closed")}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let r=this.stream.writable.getWriter();try{await r.write(e)}finally{r.releaseLock()}}).catch(r=>{this.close(r)}),this.writeQueue}},fo=class t extends Error{static{a(this,"RequestError")}code;data;constructor(e,r,n){super(r),this.code=e,this.name="RequestError",this.data=n}static parseError(e,r){return new t(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new t(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new t(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new t(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new t(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new t(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new t(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};var w_e=require("node:stream");p();As();p();var FC=class extends Hz{constructor(r){super(new ece,new Map);this.envSettings=new Map;this.env={...r};let n;this.#e=new Promise(s=>{n=s}),this.markReady=n,["DebugOverrideEngine","DebugOverrideProxyUrl","DebugOverrideCapiUrl","DebugUseEditorFetcher","UseSubsetMatching","UseChatLibCompletions","AppendPromptTokenCache","PromptPersistBasePath","AnthropicMessagesEndpoint","EnableCopilotNesNonFree","EnableMapCodeFallback","SearchAgent","UseHelixFetcher","PerfEnabled","TransparentTokenRefresh","AuthTokenEncryption","DisableWorkspaceIndex"].forEach(s=>{for(let c of["AGENT_DEBUG_","GITHUB_COPILOT_","GH_COPILOT_"]){let l=`${c}${Tos(s.replace(/^Debug/,""))}`;l in this.env&&this.envSettings.set(Je[s],this.env[l])}})}static{a(this,"AgentConfigProvider")}#e;async requireReady(){await this.#e}getOptionalOverride(r){return super.getOptionalOverride(r)??this.envSettings.get(r)}};function Tos(t){return t.replace(/([a-z])([A-Z]+)/g,"$1_$2").toUpperCase()}a(Tos,"camelCaseToSnakeCaseAllCaps");var Ios="unknown-editor",bRn="unknown-editor-plugin",bq=class extends Nr{static{a(this,"AgentEditorInfo")}setEditorAndPluginInfo(e,r,n=[]){this._editorInfo=r,this._editorPluginInfo=e,this._relatedPluginInfo=n}setCopilotIntegrationId(e){this._copilotIntegrationId=e}getEditorInfo(){return this._editorInfo?this._editorInfo:{name:Ios,version:"0"}}getEditorPluginInfo(){return this._editorPluginInfo?this._editorPluginInfo:{name:bRn,version:"0"}}getRelatedPluginInfo(){return this._relatedPluginInfo??[]}getCopilotIntegrationId(){return this._copilotIntegrationId}isEditorPluginInfoKnown(){return this._editorPluginInfo!==void 0&&this._editorPluginInfo.name!==bRn}};p();p();var ftt=new Ae("agenticTurnProcessor"),Awe=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.turnSuggestions=new WQ(e.ctx,this.chatFetcher),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new X0(e.ctx),this.hookTrigger=new Wle(e.ctx,e.conversation,e.turn.workspaceFolders||[])}static{a(this,"AgenticTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModelAndToolCall(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.updateTurnResponseWithError(l),c instanceof Error?await this.fireErrorOccurredHook(c):await this.fireErrorOccurredHook(new Error(String(c))),await this.endProgress({error:{message:l,code:kQ.Unknown,responseIsIncomplete:!0}})}}async processWithModelAndToolCall(e,r,n,o,s,c){if(r.isCancellationRequested)return;await this.conversationProgress.begin(this.conversation,this.turn,e),await this.fireUserPromptSubmittedHook(this.turn.request.message),await this.recordAssistantTurnStart();let l=await Kc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(this.turn.chatMode!==void 0&&!gyn(this.turn.chatMode)){let h=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),modelId:this.turn.getResolvedModelId()??"unknown",modelFamily:this.turn.getResolvedModelFamily()??"unknown"});yt(this.turnContext.ctx,"customAgent.turn",h),PI(this.turnContext.ctx,"customAgent.turn",h)}r.onCancellationRequested(async()=>{ftt.info(this.turnContext.ctx,`Cancellation requested for turn ${this.turn.id}`),this.turn.status="cancelled",await this.cancelProgress()});let u=C3().find(h=>h.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let f=(await Nx(this.turnContext.ctx)).find(h=>h.slug===this.turn.agent?.agentSlug);await this.collectContext(n,r,l,u,f);try{let h=c?.id,m=c?.providerName,g=m&&h?await HM(this.turnContext.ctx,m,h):await Ro.getModelConfigurationById(this.turnContext.ctx,h,this.conversation.id.toString(),UQ(this.conversation.turns));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,g,c),this.turnContext.setResolvedModelConfiguration(g);try{await this.turnContext.ctx.get(MC).checkAndCompress(this.conversation,g,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}await new pue(this.turnContext,this.chatFetcher,g,l).run(r);let y={suggestedTitle:void 0};if(this.strategy.computeSuggestions){let E=await this.fetchSuggestedTitle(r,l.extendedBy({messageSource:"chat.user"},{}));typeof E=="string"&&E!==""&&(y.suggestedTitle=E)}await this.endProgress(y)}catch(h){if(h instanceof uq)ftt.info(this.turnContext.ctx,`Tool call canceled for turn ${this.turn.id}`,h),this.turn.status="cancelled",await this.cancelProgress();else if(h instanceof Dc)ftt.info(this.turnContext.ctx,`Turn ${this.turn.id} was cancelled`,h),this.turn.status="cancelled",this.updateTurnResponseWithError("Cancelled by user"),await this.cancelProgress();else if(h instanceof I3)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:{message:h.message,code:kQ.ToolRoundExceedError,responseIsIncomplete:!0}});else if(h instanceof vA)this.turn.status="error",this.updateTurnResponseWithError(h.message),await this.fireErrorOccurredHook(h),await this.endProgress({error:h.conversationError});else throw ftt.error(this.turnContext.ctx,`Error in processing turn ${this.turn.id}`,h),h}}async collectContext(e,r,n,o,s){let c=!!s&&typeof s.additionalSkills=="function",l=!!o&&typeof o.requiredSkills=="function";if(!c&&!l)return;let d=await new yle(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,this.strategy.uiKind,o,s);this.turn.skills=d.skillIds.map(f=>({skillId:f}))}async fetchSuggestedTitle(e,r){let n=await this.turnSuggestions.fetchRawSuggestions(this.turnContext,e,this.strategy.uiKind,r);if(n)return ot.debug(this.turnContext.ctx,"Computed suggested title",n.suggestedTitle),n.suggestedTitle}updateTurnResponseWithError(e){this.turn.response?.message?this.turn.response.message=QQ(this.turn.response?.message,{role:"assistant",content:e}):this.turn.response={message:e,type:"meta"}}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.agentToolCalls.finishAll("cancelled"),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=zJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=$le(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}async fireUserPromptSubmittedHook(e){let r=e??this.turn.request.message;await this.hookTrigger.fireUserPromptSubmittedHook(r,{turn:this.turn,conversationProgress:this.conversationProgress})}async fireErrorOccurredHook(e){await this.hookTrigger.fireErrorOccurredHook(e,{turn:this.turn,conversationProgress:this.conversationProgress})}};p();var OKt="collect-context",BKt="generate-response",ptt=class{constructor(e,r,n){this.turnContext=e;this.strategy=r;this.chatFetcher=n;this.conversationProgress=e.ctx.get(vc),this.chatFetcher=this.chatFetcher??new rc(e.ctx),this.postProcessor=new Tle(e,this.chatFetcher,r.computeSuggestions),this.conversation=e.conversation,this.turn=e.turn,this.transcriptPersistence=new X0(e.ctx)}static{a(this,"ModelTurnProcessor")}async process(e,r,n,o,s){try{await this.processWithModel(e,r,this.turnContext,n,o,s)}catch(c){ot.error(this.turnContext.ctx,`Error processing turn ${this.turn.id}`,c);let l=c instanceof Error?c.message:String(c);this.turn.status="error",this.turn.response={message:l,type:"meta"},await this.endProgress({error:{message:l,code:kQ.Unknown,responseIsIncomplete:!0}})}}async processWithModel(e,r,n,o,s,c){await this.conversationProgress.begin(this.conversation,this.turn,e),await this.recordAssistantTurnStart();let l=await Kc(this.turnContext.ctx,this.turnContext,{languageId:s?.detectedLanguageId??""});if(l=l.extendedBy({mode:this.turn.getChatModeForTelemetry(),...this.turn.userRequestedModel&&{modelId:this.turn.userRequestedModel}}),r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let u=C3().find(A=>A.id===this.turn.template?.templateId);if(u?.response){await this.handleTemplateResponse(u,this.turn.template.userQuestion,r);return}let d=(await Nx(this.turnContext.ctx)).find(A=>A.slug===this.turn.agent?.agentSlug);if(d){let A=await this.checkAgentPreconditions(d);if(A){await this.endProgress(A);return}}await n.steps.start(OKt,"Collecting context"),await this.collectContext(n,r,l,this.strategy.uiKind,u,d);let f=c?.id,h=c?.providerName,m;h?m="customized":f?m=(await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),UQ(this.conversation.turns))).uiName:m=void 0;let g=await this.strategy.buildConversationPrompt(n,s?.detectedLanguageId??"",void 0,m);if(!g)await n.steps.error(OKt,"Failed to collect context"),await this.endTurnWithResponse(this.strategy.earlyReturnResponse,"error");else{await n.steps.finish(OKt),await n.steps.start(BKt,"Generating response");let A=this.augmentTelemetry(g,l,u,o,s);if(r.isCancellationRequested){this.turn.status="cancelled",await this.cancelProgress();return}let y=await this.fetchConversationResponse(g.messages,r,l.extendedBy({messageSource:"chat.user"},{promptTokenLen:g.tokens}),A,s,c),E=await this.strategy.processResponse(this.turn);this.turn.status==="cancelled"&&this.turn.response?.type==="user"?await this.cancelProgress():(await this.finishGenerateResponseStep(y,n),await this.endProgress({error:y.error,followUp:y.followup,suggestedTitle:y.suggestedTitle,skillResolutions:g.skillResolutions,updatedDocuments:E}))}}async checkAgentPreconditions(e){try{let r=e.checkPreconditions?await e.checkPreconditions(this.turnContext.ctx,this.turn):void 0;if(r&&r.type==="authorizationRequired")return{unauthorized:{...r,agentName:e.name,agentSlug:e.slug}}}catch(r){ot.error(this.turnContext.ctx,`Error checking preconditions for agent ${e.slug}`,r);let n=r instanceof Error?r.message:String(r);return this.turn.status="error",this.turn.response={message:n,type:"meta"},{error:{message:n,responseIsIncomplete:!0}}}}async endTurnWithResponse(e,r){this.turn.response={type:"meta",message:e},this.turn.status=r,await this.conversationProgress.report(this.conversation,this.turn,{reply:e}),await this.endProgress()}async handleTemplateResponse(e,r,n){if(!e.response)return;let o=await e.response(this.turnContext,r,n);this.turn.response={type:"meta",message:o.message},this.turn.status=o.error?.responseIsFiltered?"filtered":o.error?.responseIsIncomplete?"error":"success",o.error?.responseIsFiltered||o.error?.responseIsIncomplete?(await this.conversationProgress.report(this.conversation,this.turn,{reply:"Sure, I can definitely do that!",annotations:o.annotations,notifications:o.notifications,references:o.references}),await this.turnContext.steps.finishAll(),await this.endProgress({error:{message:o.message,code:o.error?.code||0,responseIsIncomplete:o.error?.responseIsIncomplete,responseIsFiltered:o.error?.responseIsFiltered}})):(await this.conversationProgress.report(this.conversation,this.turn,{reply:o.message,annotations:o.annotations,notifications:o.notifications,references:o.references,confirmationRequest:o.confirmationRequest}),await this.endProgress())}async collectContext(e,r,n,o,s,c){let u=await new yle(this.turnContext.ctx,this.chatFetcher).collectContext(e,r,n,o,s,c);return this.turn.skills=u.skillIds.map(d=>({skillId:d})),u}async fetchConversationResponse(e,r,n,o,s,c){r.onCancellationRequested(async()=>{await this.cancelProgress()});let l="",u=0,d=new XQ((E,_,v,b,T,w)=>{let R=E.trim(),x=R.match(RIe)!==null&&R.endsWith("-->");if(this.conversationProgress.report(this.conversation,this.turn,{reply:E,annotations:_,references:v,hideText:x,notifications:b.map(P=>({severity:"warning",message:P.message})),thinking:w}),this.turn.response?this.turn.response.message=jKe(this.turn.response.message,E):this.turn.response={message:E,type:"model"},this.turn.annotations.push(..._??[]),l+=E,this.strategy.currentDocument){let P=this.strategy.extractEditsFromResponse(l,this.strategy.currentDocument);P&&P.length>0&&(l="",this.conversationProgress.report(this.conversation,this.turn,{codeEdits:P}),u+=P.length)}}),f=c?.id,h=c?.providerName,m=h&&f?await HM(this.turnContext.ctx,h,f):await Ro.getModelConfigurationById(this.turnContext.ctx,f,this.conversation.id.toString(),eEn(e));Ro.applyModelConfigurationOverrides(this.turnContext.ctx,m,c),e=Ro.transformMessages(e,m.modelFamily),this.turnContext.setResolvedModelConfiguration(m);try{await this.turnContext.ctx.get(MC).checkAndCompress(this.conversation,m,"pre-turn",r,String(this.turn.id))}catch(E){ot.exception(this.turnContext.ctx,E,"Pre-turn automatic compression check failed")}let g=this.turn.getResolvedModelId();g&&(o=o.extendedBy({modelId:g}));let A={modelConfiguration:m,messages:e,uiKind:this.strategy.uiKind,intentParams:{intent:!0,intent_threshold:.7,intent_content:Rn(this.turn.request.message)},llmInteraction:this.turnContext.toLlmInteraction(),turnId:String(this.turn.id)},y=await this.chatFetcher.fetchResponse(A,r,n,(E,_)=>d.isFinishedAfter(E,_));return o=o.extendedBy(void 0,{numCodeEdits:u}),await this.postProcessor.postProcess(y,r,d.appliedText,n,o,Rn(this.turn.request.message),this.strategy.uiKind,s)}augmentTelemetry(e,r,n,o,s){let c;return o?(this.turn.request.type="follow-up",Wyn(this.turnContext.ctx,this.conversation,this.strategy.uiKind,Rn(this.turn.request.message),e.tokens,o.type,o.id,s,r),c=aIe(this.conversation,this.strategy.uiKind,Rn(this.turn.request.message).length,e.tokens,o.type,o.id,r,e.skillResolutions)):c=aIe(this.conversation,this.strategy.uiKind,Rn(this.turn.request.message).length,e.tokens,n?.id,void 0,r,e.skillResolutions),c}async finishGenerateResponseStep(e,r){e.error?await r.steps.error(BKt,e.error.message):await r.steps.finish(BKt)}async endProgress(e){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll(),await this.conversationProgress.end(this.conversation,this.turn,e)}async cancelProgress(){await this.recordAssistantTurnEnd(),await this.turnContext.steps.finishAll("cancelled"),await this.conversationProgress.cancel(this.conversation,this.turn)}async recordAssistantTurnStart(){if(this.transcriptPersistence.isEnabled())try{let e=zJe(String(this.turn.id),null);await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,e)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn start transcript: ${e instanceof Error?e.message:String(e)}`)}}async recordAssistantTurnEnd(){if(this.transcriptPersistence.isEnabled())try{let e=this.turn.status==="error"?"error":this.turn.status==="cancelled"?"cancelled":"success",r=$le(String(this.turn.id),e,null,{turnStatus:this.turn.status});await this.transcriptPersistence.appendEvent(this.conversation.id,this.conversation.currentPartitionId,r)}catch(e){ot.error(this.turnContext.ctx,`Failed to record assistant turn end transcript: ${e instanceof Error?e.message:String(e)}`)}}};p();As();p();var BHi=fe(Al()),LHi=fe(fk());p();p();var it={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,ServerNotInitialized:-32002,RequestCancelled:-32800,ContentModified:-32801,ServerCancelled:-32802,NoCopilotToken:1e3,DeviceFlowFailed:1001,CopilotNotAvailable:1002,NoGitHubToken:1003,CodeFlowFailed:1004,NoBrowserAvailable:1005,AuthEnvVarConflict:1006,NoGitHubRepository:1007};var TA=class extends Error{static{a(this,"SchemaValidationError")}constructor(e){super(SRn(e))}};function je(t,e){let r=Mu.Compile(t);return async(n,o,s)=>{if(!r.Check(s)){let c=SRn(r.Errors(s));return[null,{code:it.InvalidParams,message:c}]}return e(n,o,s)}}a(je,"addMethodHandlerValidation");function SRn(t){return`Schema validation failed with the following errors: ${Array.from(t).map(r=>`- ${r.path}: ${r.message}`).join(` -`)}`}a(pRn,"createErrorMessage");p();p();p();p();var vss=new ge("BackgroundAgent.Attachments");function hRn(t,e){let r=[];for(let n of t){let o=bss(n);o?r.push(o):vss.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(hRn,"convertReferencesToAttachments");function bss(t){switch(t.type){case"file":{let e=To(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=To(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(bss,"convertReferenceToAttachment");p();var IKt=new ge("BackgroundAgent.CustomAgents");async function xKt(t,e){try{if(qt(t,je.EnableCustomAgents)===!1)return IKt.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get(jp).listCustomAgents([e]);return o.length>0&&IKt.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>Sss(s))}catch(r){return IKt.warn(t,"Failed to load custom agents:",r),[]}}a(xKt,"loadCustomAgents");function Sss(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:t.tools??null,prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(Sss,"toSweCustomAgent");p();var wKt=new ge("BackgroundAgent.Hooks");function mRn(t,e){return{preToolUse:[Tss(t,e)],postToolUse:[Iss(t,e)],userPromptSubmitted:[xss(t,e)]}}a(mRn,"buildSessionHooks");function Tss(t,e){return async r=>{try{let o=await t.get(Xy).hook(t,k3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:gRn(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===AZe.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wKt.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}}}a(Tss,"createPreToolUseHandler");function Iss(t,e){return async r=>{try{await t.get(Xy).hook(t,R3,{timestamp:r.timestamp,cwd:Wn(e.uri),toolName:r.toolName,toolArgs:gRn(r.toolArgs),toolResult:{resultType:wss(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wKt.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}}}a(Iss,"createPostToolUseHandler");function xss(t,e){return async r=>{try{await t.get(Xy).hook(t,P3,{timestamp:r.timestamp,cwd:Wn(e.uri),prompt:r.prompt},e);return}catch(n){wKt.error(t,"Failed to execute UserPromptSubmitted hook",n);return}}}a(xss,"createUserPromptSubmittedHandler");function gRn(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(gRn,"safeStringifyToolArgs");function wss(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(wss,"toClsToolResultType");p();var Rss=["model-agents-md","cwd-model-agents-md"],kss=["model-claude-md","cwd-model-claude-md"],Pss="nested-agents";function yRn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of Rss)e.add(r);if(t.useClaudeMdFile===!1)for(let r of kss)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(Pss),e}a(yRn,"computeDisabledInstructionSources");var Dss=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),Nss=2,ARn="CLAUDE.md";function Mss(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(Mss,"joinPath");async function Oss(t,e){let r=[],n=a(async(o,s)=>{let c;try{c=await t(Mss(e,o))}catch{return}for(let[l,u]of c){let d=(u&1)!==0,f=(u&2)!==0;d&&l===ARn&&o.length>0?r.push([...o,ARn].join("/")):f&&s{let n=r.lastIndexOf("/"),o=n===-1?".":r.slice(0,n);return`| ${o}/ | '${r}' | Agent instructions for ${o}/**/* |`})].join(` -`)}a(Bss,"buildNestedClaudeInstructionsSection");async function ERn(t,e){let r=await Oss(t,e);return Bss(r)}a(ERn,"scanNestedClaudeInstructions");function _Rn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` +`)}`}a(SRn,"createErrorMessage");p();p();p();p();var TRn=new Ae("BackgroundAgent.AuthBinding"),htt=class{constructor(e){this.ctx=e}static{a(this,"AuthBinding")}async buildAuthInfo(){let r=await this.ctx.get(Fr).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Ut).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){TRn.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async detectIdentityChange(){let e;try{e=(await this.ctx.get(Fr).resolveSession())?.accessToken}catch(o){return TRn.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:o instanceof Error?o.message:String(o)}),{changed:!1,hadPrevious:this.lastAccessToken!==void 0,hasCurrent:!1}}let r=this.lastAccessToken!==void 0,n=e!==void 0;return this.lastAccessToken===e?{changed:!1,hadPrevious:r,hasCurrent:n}:(this.lastAccessToken=e,{changed:!0,hadPrevious:r,hasCurrent:n})}setObservedAccessTokenForTesting(e){this.lastAccessToken=e}getLastAccessTokenForTesting(){return this.lastAccessToken}};p();var xos=new Ae("BackgroundAgent.Attachments");function IRn(t,e){let r=[];for(let n of t){let o=wos(n);o?r.push(o):xos.debug(e,`Skipping unsupported reference type for SDK attachment: ${n.type}`)}return r}a(IRn,"convertReferencesToAttachments");function wos(t){switch(t.type){case"file":{let e=to(t.uri).fsPath;return t.selection?{type:"selection",filePath:e,displayName:e,text:"",selection:{start:{line:t.selection.start.line,character:t.selection.start.character},end:{line:t.selection.end.line,character:t.selection.end.character}}}:{type:"file",path:e,displayName:e}}case"directory":{let e=to(t.uri).fsPath;return{type:"directory",path:e,displayName:e}}default:return null}}a(wos,"convertReferenceToAttachment");p();function xRn(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(xRn,"routeInteraction");p();var wRn=new Ae("BackgroundAgent.OTelEnv"),LKt=new Map,FKt=new Set;function mtt(t,e){process.env[t]||(LKt.has(t)||LKt.set(t,process.env[t]),process.env[t]=e,FKt.add(t))}a(mtt,"setEnvIfAbsent");function RRn(){for(let t of FKt){let e=LKt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}FKt.clear()}a(RRn,"restoreOTelEnvironment");function PRn(t){if(!t.get(On).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&wRn.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),mtt("COPILOT_OTEL_ENABLED","true");let e=!!process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!process.env.OTEL_EXPORTER_OTLP_ENDPOINT,r=process.env.COPILOT_OTEL_EXPORTER_TYPE==="file";!e&&!r&&(mtt("COPILOT_OTEL_EXPORTER_TYPE","file"),mtt("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),mtt("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),wRn.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(PRn,"applyOTelEnvironment");p();p();var TLn=fe(require("crypto")),ILn=fe(require("fs")),$nt=fe(bLn()),xLn=require("tls"),wLn=fe(SLn());var Wde=new Ae("certificates"),sp=class{static{a(this,"RootCertificateReader")}};function Vnt(t,e=process.platform){return new utr(t,[new dtr,new ftr,xvs(t,e)])}a(Vnt,"getRootCertificateReader");function xvs(t,e){switch(e){case"linux":return new ptr(t);case"darwin":return new htr(t);case"win32":return new mtr(t);default:return new gtr}}a(xvs,"createPlatformReader");var ltr=class extends sp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return Wde.warn(this.ctx,"Failed to read root certificates:",r),[]}}},utr=class extends sp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new ltr(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new TLn.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return Wde.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&Wde.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},dtr=class extends sp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return xLn.rootCertificates}},ftr=class extends sp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await RLn(e):[]}},ptr=class extends sp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await RLn(n);Wde.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},htr=class extends sp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=$nt.get({excludeBundled:!1,format:$nt.Format.pem});return Wde.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},mtr=class extends sp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=wLn.all();return Wde.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},gtr=class extends sp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function RLn(t){let e;try{e=await ILn.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(RLn,"readCertsFromFile");var Tj=fe(Gor());var Vor=new Ae("BackgroundAgent.ProxyEnv"),Wor=new Map,zor=new Set,qPe;function Yor(){for(let t of zor){let e=Wor.get(t);e===void 0?delete process.env[t]:process.env[t]=e}zor.clear(),qPe&&((0,Tj.setGlobalDispatcher)(qPe),qPe=void 0)}a(Yor,"restoreProxyEnvironment");function $or(t,e,r){process.env[t]||process.env[e]||(Wor.has(t)||Wor.set(t,process.env[t]),process.env[t]=r,zor.add(t))}a($or,"setEnvIfAbsent");function UOs(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(UOs,"buildProxyUrl");async function QOs(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(sp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Vor.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(QOs,"buildTlsOptions");async function Got(t){try{Yor();let e=t.get(Yo).getHttpSettings();if(!e.proxy)return;let r=UOs(e.proxy,e.proxyAuthorization);$or("HTTPS_PROXY","https_proxy",r),$or("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&$or("NO_PROXY","no_proxy",n),qPe||(qPe=(0,Tj.getGlobalDispatcher)());let o=await QOs(t,e.proxyStrictSSL);(0,Tj.setGlobalDispatcher)(new Tj.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Vor.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,Tj.getGlobalDispatcher)().constructor.name})}catch(e){Vor.warn(t,"Failed to apply proxy settings to environment:",e)}}a(Got,"applyProxyToEnvironment");p();var qOs=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"],$ot=["get_errors"],Kor=[...$ot,"edit","str_replace_editor","apply_patch"],jOs=["ask","inline-ask","inline"];function Vot(t){return t!==void 0&&jOs.includes(t)}a(Vot,"isClampedChatMode");var HOs={ask:qOs,inline:Kor,"inline-ask":$ot};async function ejn(t,e,r){let n,o,s,c;e==="agent"?(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers()):(n=[...HOs[e]],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={});let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(ejn,"applyChatMode");p();var lT=fe(require("node:path"));var GOs=["file","path","filePath","file_path"],$Os=new Set(["edit","create","str_replace_editor","write"]),VOs=new Set(["git_apply_patch"]),tjn=/^\*\*\* (?:Add File|Delete File|Update File|Move to): (.+)$/gm;function WOs(t){let e=lT.dirname(t);return{confinedFsPath:t,confinedName:lT.basename(t),baseDir:e,confinedComparable:Jor(t,e)}}a(WOs,"buildContext");function zOs(t){if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}return t&&typeof t=="object"?t:{}}a(zOs,"parseToolArgs");function YOs(t){if(typeof t=="string")return t;if(t&&typeof t=="object"){let e=t;if(typeof e.input=="string")return e.input;if(typeof e.patch=="string")return e.patch}}a(YOs,"extractApplyPatchBody");function KOs(t){if(!t.includes("*** Begin Patch"))return;let e=[];tjn.lastIndex=0;for(let r of t.matchAll(tjn)){let n=r[1].trim();n.length>0&&e.push(n)}return e}a(KOs,"extractApplyPatchPaths");function JOs(t){for(let e of GOs){let r=t[e];if(typeof r=="string"&&r.trim().length>0)return r}}a(JOs,"extractTargetPath");function Jor(t,e){let r=t.startsWith("file:")?kn(t):t,n=lT.isAbsolute(r)?lT.normalize(r):lT.resolve(e,r);return process.platform==="win32"||process.platform==="darwin"?n.toLowerCase():n}a(Jor,"toComparablePath");function rjn(t,e){return lT.isAbsolute(t)?lT.normalize(t):lT.resolve(e,t)}a(rjn,"resolveTargetPath");function ZOs(t,e,r){if(VOs.has(t))return{allowed:!1,reason:`Inline chat may only edit ${r.confinedName}. The ${t} tool cannot be confined to a single file and is not available in inline chat.`};if(t==="apply_patch"){let o=YOs(e);if(o===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no readable patch body. Only ${r.confinedName} may be edited.`};let s=KOs(o);if(s===void 0)return{allowed:!1,reason:`Inline chat denied an apply_patch call whose body could not be parsed. Only ${r.confinedName} may be edited.`};if(s.length===0)return{allowed:!1,reason:`Inline chat denied an apply_patch call with no file headers. Only ${r.confinedName} may be edited.`};for(let c of s)if(Jor(c,r.baseDir)!==r.confinedComparable)return{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${rjn(c,r.baseDir)} (apply_patch header: ${c}).`};return{allowed:!0}}if(!$Os.has(t))return{allowed:!0};let n=JOs(zOs(e));return n?Jor(n,r.baseDir)!==r.confinedComparable?{allowed:!1,reason:`Inline chat may only edit ${r.confinedFsPath}, not ${rjn(n,r.baseDir)} (${t} arg: ${n}).`}:{allowed:!0}:{allowed:!1,reason:`Inline chat denied a ${t} call with no resolvable file path. Only ${r.confinedName} may be edited.`}}a(ZOs,"evaluateWithContext");function njn(t){let e=0;return{hook:a(()=>e>t?Promise.resolve({permissionDecision:"deny",permissionDecisionReason:`Inline chat is limited to ${t} tool-calling turns. No further tool calls are allowed.`}):Promise.resolve(),"hook"),onTurnStart(){e++},reset(){e=0}}}a(njn,"createInlineTurnLimitHook");function ijn(t){let e=t.startsWith("file:")?kn(t):t,r=WOs(e);return n=>{let o=ZOs(n.toolName,n.toolArgs,r);return o.allowed?Promise.resolve():Promise.resolve({permissionDecision:"deny",permissionDecisionReason:o.reason??"Edit denied: inline chat is confined to the active file."})}}a(ijn,"createInlineEditConfinementHook");p();var Zor=fe(require("fs"));var Ofe=new Ae("BackgroundAgent.InlineFileContext"),XOs=50*1024,Wot=100,e5s=.4,ojn=25;async function sjn(t,e,r){let n;try{n=to(t).fsPath}catch{return Ofe.debug(r,`buildInlineFileContext: failed to parse URI ${t}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let o;try{o=await Zor.promises.stat(n)}catch{return Ofe.debug(r,`buildInlineFileContext: failed to stat ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!1}}let s=o.size>XOs,c;try{c=await Zor.promises.readFile(n,"utf-8")}catch{return Ofe.debug(r,`buildInlineFileContext: failed to read ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:s}}let l=e?.selection,u=e?.position,d="",f=!1;if(!s)d=` + +Here is the current content of \`${n}\`: +\`\`\` +${c} +\`\`\``,f=!0;else if(l)d=r5s(c,n,l),Ofe.debug(r,`buildInlineFileContext: cropped large file around selection: ${n}`);else if(u)d=n5s(c,n,u),Ofe.debug(r,`buildInlineFileContext: cropped large file around cursor: ${n}`);else return Ofe.debug(r,`buildInlineFileContext: large file (${o.size} bytes), no cursor or selection: ${n}`),{promptFragment:"",isFullContent:!1,isLargeFile:!0};if(l)d+=t5s(c,n,l);else if(u){let h=Math.min(u.line,c.split(` +`).length-1);d+=` + +The cursor is at 1-based line ${h+1}.`}return{promptFragment:d,isFullContent:f,isLargeFile:s}}a(sjn,"buildInlineFileContext");function t5s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),u=n.slice(s,c+1).map((d,f)=>`${s+f+1} | ${d}`).join(` +`);return` + +Here is the selected code in \`${e}\` (1-based lines ${s+1}-${c+1} of ${o}): +\`\`\` +${u} +\`\`\``}a(t5s,"buildSelectionFragment");function r5s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.max(0,r.start.line),c=Math.min(o-1,r.end.line),l=Math.max(0,s-ojn),u=Math.min(o-1,c+ojn),f=n.slice(l,u+1).map((h,m)=>`${l+m+1} | ${h}`).join(` +`);return` + +Here is a portion of \`${e}\` (1-based lines ${l+1}-${u+1} of ${o}): +\`\`\` +${f} +\`\`\``}a(r5s,"buildCropAroundSelectionFragment");function n5s(t,e,r){let n=t.split(` +`),o=n.length,s=Math.min(r.line,o-1),c=Math.floor(Wot*e5s),l=Wot-c,u=Math.max(0,s-c),d=Math.min(o,s+l);u===0?d=Math.min(o,Wot):d>=o&&(u=Math.max(0,o-Wot));let h=n.slice(u,d).map((m,g)=>`${u+g+1} | ${m}`).join(` +`);return` -`)}a(_Rn,"composeBackgroundAgentSystemMessage");p();function CRn(t,e){switch(e.type){case"permission":t.respondToPermission(e.requestId,e.result);break;case"user_input":t.respondToUserInput(e.requestId,e.response);break;case"elicitation":t.respondToElicitation(e.requestId,e.response);break;case"exit_plan_mode":t.respondToExitPlanMode(e.requestId,e.response);break;case"queued_command":t.respondToQueuedCommand(e.requestId,e.result);break;case"external_tool":t.respondToExternalTool(e.requestId,e.result);break;default:throw new Error(`Unknown interaction type: ${e.type}`)}return{success:!0}}a(CRn,"routeInteraction");p();var vRn=new ge("BackgroundAgent.OTelEnv"),RKt=new Map,kKt=new Set;function Ett(t,e){process.env[t]||(RKt.has(t)||RKt.set(t,process.env[t]),process.env[t]=e,kKt.add(t))}a(Ett,"setEnvIfAbsent");function bRn(){for(let t of kKt){let e=RKt.get(t);e===void 0?delete process.env[t]:process.env[t]=e}kKt.clear()}a(bRn,"restoreOTelEnvironment");function SRn(t){if(!t.get(Mn).getCapabilities().agentDebugLog)return;process.env.COPILOT_OTEL_ENABLED&&process.env.COPILOT_OTEL_ENABLED!=="true"&&vRn.info(t,"COPILOT_OTEL_ENABLED already set by user, skipping OTel env setup",{value:process.env.COPILOT_OTEL_ENABLED}),Ett("COPILOT_OTEL_ENABLED","true");let e=!!process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||!!process.env.OTEL_EXPORTER_OTLP_ENDPOINT,r=process.env.COPILOT_OTEL_EXPORTER_TYPE==="file";!e&&!r&&(Ett("COPILOT_OTEL_EXPORTER_TYPE","file"),Ett("COPILOT_OTEL_FILE_EXPORTER_PATH",process.platform==="win32"?"NUL":"/dev/null"),Ett("OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT","true")),vRn.info(t,"Applied OTel environment for SDK bridge",{userConfiguredOtlpEndpoint:e,userConfiguredFileExporter:r})}a(SRn,"applyOTelEnvironment");p();var PKt=require("node:fs"),rJ=ce(require("node:path"));function TRn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(TRn,"sanitizePathSegment");function Ctt(t){return typeof t=="string"?t:void 0}a(Ctt,"asString");function _tt(t){return typeof t=="number"?t:void 0}a(_tt,"asNumber");function Lss(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Ctt(r.toolCallId),tool:Ctt(r.name)}}):[]}a(Lss,"asToolCallArray");function Fss(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(Fss,"toToolResultText");function Uss(t){try{return JSON.stringify(t)}catch{return}}a(Uss,"safeStringify");var DKt=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=V9t(new Date),s=TRn(r);this.sessionDir=rJ.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?rJ.join(this.sessionDir,"runSubAgent",TRn(e)):this.sessionDir}appendJsonl(e,r){let n=Uss(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await PKt.promises.mkdir(rJ.dirname(e),{recursive:!0}),await PKt.promises.appendFile(e,`${n} -`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:_tt(e.data.inputTokens),outputTokens:_tt(e.data.outputTokens),cacheReadTokens:_tt(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=Lss(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(rJ.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:_tt(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Ctt(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=Ctt(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(rJ.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:Fss(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function IRn(t,e,r){let n=qt(t,je.PromptPersistBasePath)?.trim()||void 0;if(n)return new DKt(n,e,r)}a(IRn,"createBackgroundAgentPersistence");p();var Que=new ge("BackgroundAgent.ProviderConfig");async function xRn(t,e,r){if(!e)return;let n=await vWe(t,e,r);if(!n){Que.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new bc(t.get(Si)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){Que.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:u instanceof Error?u.message:String(u)})}let l={...s!==void 0&&{maxPromptTokens:s},...c!==void 0&&{maxOutputTokens:c}};if(e===Ao.Anthropic)return{type:"anthropic",baseUrl:o??Vce[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===Ao.Azure){if(!o){Que.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return Qss(t,o,n,r,l)}if(Qce(e))return{type:"openai",baseUrl:o??Vce[e],apiKey:n,modelId:r,wireModel:r,...l};Que.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(xRn,"buildProviderConfig");function Qss(t,e,r,n,o){let s;try{s=new URL(e)}catch{Que.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};Que.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(Qss,"buildAzureProviderConfig");p();p();var vLn=ce(require("crypto")),bLn=ce(require("fs")),Jnt=ce(_Ln()),SLn=require("tls"),TLn=ce(CLn());var Jde=new ge("certificates"),rp=class{static{a(this,"RootCertificateReader")}};function Znt(t,e=process.platform){return new itr(t,[new otr,new str,Uvs(t,e)])}a(Znt,"getRootCertificateReader");function Uvs(t,e){switch(e){case"linux":return new atr(t);case"darwin":return new ctr(t);case"win32":return new ltr(t);default:return new utr}}a(Uvs,"createPlatformReader");var ntr=class extends rp{constructor(r,n){super();this.ctx=r;this.delegate=n}static{a(this,"ErrorHandlingCertificateReader")}async getAllRootCAs(){try{return await this.delegate.getAllRootCAs()}catch(r){return Jde.warn(this.ctx,"Failed to read root certificates:",r),[]}}},itr=class extends rp{constructor(r,n){super();this.ctx=r;this.delegates=n.map(o=>new ntr(r,o))}static{a(this,"CachingRootCertificateReader")}async getAllRootCAs(){return this.certificates||(this.certificates=this.removeExpiredCertificates((await Promise.all(this.delegates.map(r=>r.getAllRootCAs()))).flat())),this.certificates}removeExpiredCertificates(r){let n=Date.now(),o=r.filter(s=>{try{let c=new vLn.X509Certificate(s),l=Date.parse(c.validTo);return isNaN(l)||l>n}catch(c){return Jde.warn(this.ctx,"Failed to parse certificate",s,c),!1}});return r.length!==o.length&&Jde.info(this.ctx,`Removed ${r.length-o.length} expired certificates`),o}},otr=class extends rp{static{a(this,"NodeTlsRootCertificateReader")}getAllRootCAs(){return SLn.rootCertificates}},str=class extends rp{static{a(this,"EnvironmentVariableRootCertificateReader")}async getAllRootCAs(){let e=process.env.NODE_EXTRA_CA_CERTS;return e?await ILn(e):[]}},atr=class extends rp{constructor(r){super();this.ctx=r}static{a(this,"LinuxRootCertificateReader")}async getAllRootCAs(){let r=[];for(let n of["/etc/ssl/certs/ca-certificates.crt","/etc/ssl/certs/ca-bundle.crt"]){let o=await ILn(n);Jde.debug(this.ctx,`Read ${o.length} certificates from ${n}`),r=r.concat(o)}return r}},ctr=class extends rp{constructor(r){super();this.ctx=r}static{a(this,"MacRootCertificateReader")}getAllRootCAs(){let r=Jnt.get({excludeBundled:!1,format:Jnt.Format.pem});return Jde.debug(this.ctx,`Read ${r.length} certificates from Mac keychain`),r}},ltr=class extends rp{constructor(r){super();this.ctx=r}static{a(this,"WindowsRootCertificateReader")}getAllRootCAs(){let r=TLn.all();return Jde.debug(this.ctx,`Read ${r.length} certificates from Windows store`),r}},utr=class extends rp{static{a(this,"UnsupportedPlatformRootCertificateReader")}getAllRootCAs(){return Promise.reject(new Error("No certificate reader available for unsupported platform"))}};async function ILn(t){let e;try{e=await bLn.promises.readFile(t,{encoding:"utf8"})}catch{return[]}let r=e.match(/-----BEGIN CERTIFICATE-----[\s\S]*?-----END CERTIFICATE-----/g);if(!r)return[];let n=r.filter(s=>s.length>0),o=new Set(n);return Array.from(o)}a(ILn,"readCertsFromFile");var Pj=ce(For());var Qor=new ge("BackgroundAgent.ProxyEnv"),qor=new Map,jor=new Set,ePe;function Hor(){for(let t of jor){let e=qor.get(t);e===void 0?delete process.env[t]:process.env[t]=e}jor.clear(),ePe&&((0,Pj.setGlobalDispatcher)(ePe),ePe=void 0)}a(Hor,"restoreProxyEnvironment");function Uor(t,e,r){process.env[t]||process.env[e]||(qor.has(t)||qor.set(t,process.env[t]),process.env[t]=r,jor.add(t))}a(Uor,"setEnvIfAbsent");function J5s(t,e){if(!e)return t;try{let r=new URL(t),n=e.indexOf(":"),o=n===-1?e:e.slice(0,n),s=n===-1?"":e.slice(n+1);return o&&(r.username=encodeURIComponent(o),s&&(r.password=encodeURIComponent(s))),r.toString()}catch{return t}}a(J5s,"buildProxyUrl");async function Z5s(t,e){if(e===!1){let r={rejectUnauthorized:!1};return{requestTls:r,proxyTls:r}}try{let r=await t.get(rp).getAllRootCAs();if(r.length>0){let n={ca:r};return{requestTls:n,proxyTls:n}}}catch{Qor.warn(t,"Failed to load system CA certificates for SDK proxy dispatcher")}return{}}a(Z5s,"buildTlsOptions");async function Gor(t){try{Hor();let e=t.get(Zo).getHttpSettings();if(!e.proxy)return;let r=J5s(e.proxy,e.proxyAuthorization);Uor("HTTPS_PROXY","https_proxy",r),Uor("HTTP_PROXY","http_proxy",r);let n=e.noProxy?.length?e.noProxy.join(","):void 0;n&&Uor("NO_PROXY","no_proxy",n),ePe||(ePe=(0,Pj.getGlobalDispatcher)());let o=await Z5s(t,e.proxyStrictSSL);(0,Pj.setGlobalDispatcher)(new Pj.EnvHttpProxyAgent({allowH2:!0,httpProxy:r,httpsProxy:r,noProxy:n,...o})),Qor.info(t,"Applied proxy settings to environment for SDK",{hasProxy:!0,hasAuth:!!e.proxyAuthorization,hasNoProxy:!!n,proxyStrictSSL:e.proxyStrictSSL!==!1,hasTlsCa:!!o.requestTls,dispatcherType:(0,Pj.getGlobalDispatcher)().constructor.name})}catch(e){Qor.warn(t,"Failed to apply proxy settings to environment:",e)}}a(Gor,"applyProxyToEnvironment");p();var Ufe=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}},Kot=class extends Ufe{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},Jot=class extends Ufe{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();var Zot=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};p();var X5s=["read_file","view","grep_search","file_search","semantic_search","grep","rg","glob","tool_search_tool_regex","fetch_copilot_cli_documentation","think"];async function Jqn(t,e,r){let n,o,s,c;e==="ask"?(n=[...X5s],o=[],s=new Set(await r.getAllLoadedSkillNames()),c={}):(n=null,o=await r.loadCustomAgents(),s=new Set(await r.getPolicyDisabledSkillNames()),c=await r.getMcpServers());let l={availableTools:n,customAgents:o,disabledSkills:s,mcpServers:c};t.updateOptions(l,{emitToolDefinitionsChanged:!0})}a(Jqn,"applyChatMode");p();var Xot="/agents/sessions",est=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl(Xot),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await Zqn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${Xot}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await Zqn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${Xot}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${Xot}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function Zqn(t){try{return await t.text()}catch{return""}}a(Zqn,"safeReadText");p();p();var tst=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var e4s=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function Xqn(t){return!(!t.type||e4s.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(Xqn,"shouldForwardMissionControlEvent");function $or(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a($or,"getMissionControlEventData");function ejn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(ejn,"maybeAcknowledgeMissionControlCommandFromEvent");p();function tjn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a(tjn,"setPermissionsRequired");function rjn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(rjn,"setRemoteDelegate");function Vor(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(Vor,"emitSessionEvent");function Wor(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(Wor,"getRemoteHandle");function njn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(njn,"createAutoModeSessionManager");function ijn(t){if(t)try{t.clear()}catch{}}a(ijn,"clearAutoModeManager");var ajn=require("node:crypto");var t4s=500,r4s=3e3,n4s=1e4,i4s=500,tPe=2e3,o4s=256,ojn=80,rst=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new tst({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await Ipn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await xpn(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=a4s(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${mZ(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${mZ(A)}`)}try{Vor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${mZ(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},t4s),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},r4s),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{Vor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${mZ(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,ajn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!Xqn(r))return;ejn(e,r),this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:$or(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",$or(r))),e.eventBuffer.length>tPe&&e.eventBuffer.splice(0,e.eventBuffer.length-tPe)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=s4s(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=o4s){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>tPe&&e.eventBuffer.splice(0,e.eventBuffer.length-tPe);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=n4s;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,i4s);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=tPe&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${mZ(c)}`)}o.type!==void 0&&o.type!==""&&o.type!=="user_message"&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=sjn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${mZ(c)}`)}return}case"ask_user_response":{let n=sjn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${mZ(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content,`command-${r.id}`);return}}}};function sjn(t){try{return JSON.parse(t)}catch{return}}a(sjn,"safeJsonParse");function mZ(t){return t instanceof Error?t.message:String(t)}a(mZ,"errMsg");function s4s(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>ojn?e.slice(0,ojn-1).trimEnd()+"\u2026":e:""}a(s4s,"deriveTitleFromMessage");function a4s(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(a4s,"toVscodeUriShape");p();Ns();var c4s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function zor(t,e){return t.get(pf).getInstructions(t,e,c4s)}a(zor,"getGitCommitInstructions");var gZ=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` +Here is a portion of \`${e}\` (1-based lines ${u+1}-${d} of ${o}, cursor at line ${s+1}): +\`\`\` +${h} +\`\`\``}a(n5s,"buildCursorCropFragment");p();p();function ajn(t,e){let r=t,n=r.permissions?.setRequired;if(typeof n=="function"){Promise.resolve(n.call(r.permissions,{required:e}));return}typeof r.setPermissionsRequired=="function"&&r.setPermissionsRequired(e)}a(ajn,"setPermissionsRequired");function cjn(t,e){let r=t;return typeof r.setRemoteDelegate!="function"?!1:(r.setRemoteDelegate(e),!0)}a(cjn,"setRemoteDelegate");function Xor(t,e,r){let n=t;return typeof n.emit!="function"?!1:(n.emit(e,r),!0)}a(Xor,"emitSessionEvent");function esr(t){let r=t.remote;if(!(!r||typeof r.enable!="function"||typeof r.disable!="function"))return r}a(esr,"getRemoteHandle");function ljn(t){let e=t.AutoModeSessionManager;if(typeof e=="function")try{return new e}catch{return}}a(ljn,"createAutoModeSessionManager");function ujn(t){if(t)try{t.clear()}catch{}}a(ujn,"clearAutoModeManager");p();p();p();var zot=require("fs"),Yot=fe(require("path"));var tsr=new Ae("OtelSpanFilePersistence"),i5s="debug.jsonl",EF=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=Ht(this.ctx,Je.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=o5s(n);if(!o){tsr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await zot.promises.mkdir(Yot.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` +`)+` +`;await zot.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){tsr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await zot.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` +`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(tsr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return Yot.join(r,s5s(e),i5s)}};function o5s(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(o5s,"conversationIdOf");function s5s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(s5s,"sanitizeForPath");p();var a5s={0:1,1:2,2:3,3:4,4:5};function rsr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(rsr,"hrTimeToNano");function fjn(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>fjn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(fjn,"encodeAnyValue");function djn(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=fjn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(djn,"encodeAttributes");function pjn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:a5s[t.kind]??1,startTimeUnixNano:rsr(t.startTime),endTimeUnixNano:rsr(t.endTime),attributes:djn(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:rsr(n.time),attributes:djn(n.attributes)})),status:t.status.message?{code:t.status.code??0,message:t.status.message}:{code:t.status.code??0}};return t.parentSpanContext?.spanId&&(r.parentSpanId=t.parentSpanContext.spanId),r}a(pjn,"encodeSpan");var JPe=new Ae("OtelBridge"),X5s=1e3,ZPe=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(EF)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),ya(u5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return JPe.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),JPe.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return JPe.warn(e,`Failed to install bridge SpanProcessor: ${String(r)}`),{installed:!1}}}onStart(e,r){}onEnd(e){this.disposed||(this.pending.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},X5s)))}async forceFlush(){await this.flush()}async shutdown(){this.disposed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush()}async flush(){if(this.flushTimer=null,this.pending.length===0)return;let e=this.pending;this.pending=[];let r;try{r=e.map(pjn)}catch(n){JPe.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){JPe.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var vHn=require("node:module");var _Hn=new Ae("BackgroundAgent.ManagerLifecycle");async function e4s(){return"pkg"in process?(0,vHn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(e4s,"importSdk");var lst=class{constructor(e){this.ctx=e}static{a(this,"ManagerLifecycle")}async ensureManager(){if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitPromise=this.initManager());try{await this.managerInitPromise}catch(e){throw this.managerInitPromise=void 0,e}if(!this.manager)throw new Error("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}getSdk(){return this.sdk}getAutoModeManager(){return this.autoModeManager}ensureBridgeInstalled(){if(this.installedBridge!==void 0||!this.ctx.get(On).getCapabilities().agentDebugLog)return;let e=ZPe.installInto(this.ctx);this.installedBridge=e.processor}clearAutoMode(){ujn(this.autoModeManager)}async dispose(){this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}setStubManagerForTesting(e){this.manager=e}setStubSdkForTesting(e){this.sdk=e}setAutoModeManagerForTesting(e){this.autoModeManager=e}async initManager(){_Hn.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),PRn(this.ctx);let e=performance.now();try{this.sdk=await e4s(),_t(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw si(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await Got(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService,featureFlagService:this.sdk.createLocalFeatureFlagService()},n=ljn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),_Hn.info(this.ctx,"LocalSessionManager initialized.")}};p();p();p();p();p();function ust(t){if(typeof t!="object"||t===null||t.jsonrpc!=="2.0"||typeof t.method!="string"||!("id"in t))return!1;let e=t.id;return typeof e=="string"||typeof e=="number"}a(ust,"isJsonRpcRequest");function CHn(t){return typeof t=="object"&&t!==null&&t.jsonrpc==="2.0"&&typeof t.method=="string"&&!("id"in t)}a(CHn,"isJsonRpcNotification");var Cw={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603},vw=class extends Error{constructor(r,n,o){super(n);this.code=r;this.data=o;this.name="JsonRpcError"}static{a(this,"JsonRpcError")}};p();p();var Ql={ToolsListChanged:"tools/listChanged",ResourcesListChanged:"resources/listChanged",PromptsListChanged:"prompts/listChanged",LoggingMessage:"logging/message"};p();var bw="2025-11-25";var fst=[bw,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],wj="io.modelcontextprotocol/related-task",pst="2.0",im=qYt(t=>t!==null&&(typeof t=="object"||typeof t=="function")),bHn=El([Ke(),Ia().int()]),SHn=Ke(),Faf=Jh({ttl:Ia().optional(),pollInterval:Ia().optional()}),r4s=Wr({ttl:Ia().optional()}),n4s=Wr({taskId:Ke()}),Isr=Jh({progressToken:bHn.optional(),[wj]:n4s.optional()}),fT=Wr({_meta:Isr.optional()}),XPe=fT.extend({task:r4s.optional()}),THn=a(t=>XPe.safeParse(t).success,"isTaskAugmentedRequestParams"),DA=Wr({method:Ke(),params:fT.loose().optional()}),Sw=Wr({_meta:Isr.optional()}),Tw=Wr({method:Ke(),params:Sw.loose().optional()}),NA=Jh({_meta:Isr.optional()}),hst=El([Ke(),Ia().int()]),IHn=Wr({jsonrpc:Gn(pst),id:hst,...DA.shape}).strict(),eke=a(t=>IHn.safeParse(t).success,"isJSONRPCRequest"),xHn=Wr({jsonrpc:Gn(pst),...Tw.shape}).strict(),wHn=a(t=>xHn.safeParse(t).success,"isJSONRPCNotification"),xsr=Wr({jsonrpc:Gn(pst),id:hst,result:NA}).strict(),fZ=a(t=>xsr.safeParse(t).success,"isJSONRPCResultResponse");var Zn;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Zn||(Zn={}));var wsr=Wr({jsonrpc:Gn(pst),id:hst.optional(),error:Wr({code:Ia().int(),message:Ke(),data:Zu().optional()})}).strict();var RHn=a(t=>wsr.safeParse(t).success,"isJSONRPCErrorResponse");var Rj=El([IHn,xHn,xsr,wsr]),Uaf=El([xsr,wsr]),pZ=NA.strict(),i4s=Sw.extend({requestId:hst.optional(),reason:Ke().optional()}),mst=Tw.extend({method:Gn("notifications/cancelled"),params:i4s}),o4s=Wr({src:Ke(),mimeType:Ke().optional(),sizes:Ur(Ke()).optional(),theme:F_(["light","dark"]).optional()}),tke=Wr({icons:Ur(o4s).optional()}),Qfe=Wr({name:Ke(),title:Ke().optional()}),PHn=Qfe.extend({...Qfe.shape,...tke.shape,version:Ke(),websiteUrl:Ke().optional(),description:Ke().optional()}),s4s=dwe(Wr({applyDefaults:Xc().optional()}),_l(Ke(),Zu())),a4s=ntt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,dwe(Wr({form:s4s.optional(),url:im.optional()}),_l(Ke(),Zu()).optional())),c4s=Jh({list:im.optional(),cancel:im.optional(),requests:Jh({sampling:Jh({createMessage:im.optional()}).optional(),elicitation:Jh({create:im.optional()}).optional()}).optional()}),l4s=Jh({list:im.optional(),cancel:im.optional(),requests:Jh({tools:Jh({call:im.optional()}).optional()}).optional()}),u4s=Wr({experimental:_l(Ke(),im).optional(),sampling:Wr({context:im.optional(),tools:im.optional()}).optional(),elicitation:a4s.optional(),roots:Wr({listChanged:Xc().optional()}).optional(),tasks:c4s.optional(),extensions:_l(Ke(),im).optional()}),d4s=fT.extend({protocolVersion:Ke(),capabilities:u4s,clientInfo:PHn}),f4s=DA.extend({method:Gn("initialize"),params:d4s});var p4s=Wr({experimental:_l(Ke(),im).optional(),logging:im.optional(),completions:im.optional(),prompts:Wr({listChanged:Xc().optional()}).optional(),resources:Wr({subscribe:Xc().optional(),listChanged:Xc().optional()}).optional(),tools:Wr({listChanged:Xc().optional()}).optional(),tasks:l4s.optional(),extensions:_l(Ke(),im).optional()}),Rsr=NA.extend({protocolVersion:Ke(),capabilities:p4s,serverInfo:PHn,instructions:Ke().optional()}),kHn=Tw.extend({method:Gn("notifications/initialized"),params:Sw.optional()}),DHn=a(t=>kHn.safeParse(t).success,"isInitializedNotification"),gst=DA.extend({method:Gn("ping"),params:fT.optional()}),h4s=Wr({progress:Ia(),total:mu(Ia()),message:mu(Ke())}),m4s=Wr({...Sw.shape,...h4s.shape,progressToken:bHn}),Ast=Tw.extend({method:Gn("notifications/progress"),params:m4s}),g4s=fT.extend({cursor:SHn.optional()}),rke=DA.extend({params:g4s.optional()}),nke=NA.extend({nextCursor:SHn.optional()}),A4s=F_(["working","input_required","completed","failed","cancelled"]),ike=Wr({taskId:Ke(),status:A4s,ttl:El([Ia(),Jet()]),createdAt:Ke(),lastUpdatedAt:Ke(),pollInterval:mu(Ia()),statusMessage:mu(Ke())}),hZ=NA.extend({task:ike}),y4s=Sw.merge(ike),oke=Tw.extend({method:Gn("notifications/tasks/status"),params:y4s}),yst=DA.extend({method:Gn("tasks/get"),params:fT.extend({taskId:Ke()})}),Est=NA.merge(ike),_st=DA.extend({method:Gn("tasks/result"),params:fT.extend({taskId:Ke()})}),Qaf=NA.loose(),vst=rke.extend({method:Gn("tasks/list")}),Cst=nke.extend({tasks:Ur(ike)}),bst=DA.extend({method:Gn("tasks/cancel"),params:fT.extend({taskId:Ke()})}),NHn=NA.merge(ike),MHn=Wr({uri:Ke(),mimeType:mu(Ke()),_meta:_l(Ke(),Zu()).optional()}),OHn=MHn.extend({text:Ke()}),Psr=Ke().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),BHn=MHn.extend({blob:Psr}),ske=F_(["user","assistant"]),qfe=Wr({audience:Ur(ske).optional(),priority:Ia().min(0).max(1).optional(),lastModified:Due.datetime({offset:!0}).optional()}),LHn=Wr({...Qfe.shape,...tke.shape,uri:Ke(),description:mu(Ke()),mimeType:mu(Ke()),size:mu(Ia()),annotations:qfe.optional(),_meta:mu(Jh({}))}),E4s=Wr({...Qfe.shape,...tke.shape,uriTemplate:Ke(),description:mu(Ke()),mimeType:mu(Ke()),annotations:qfe.optional(),_meta:mu(Jh({}))}),_4s=rke.extend({method:Gn("resources/list")}),ksr=nke.extend({resources:Ur(LHn)}),v4s=rke.extend({method:Gn("resources/templates/list")}),Dsr=nke.extend({resourceTemplates:Ur(E4s)}),Nsr=fT.extend({uri:Ke()}),C4s=Nsr,b4s=DA.extend({method:Gn("resources/read"),params:C4s}),Msr=NA.extend({contents:Ur(El([OHn,BHn]))}),vF=Tw.extend({method:Gn("notifications/resources/list_changed"),params:Sw.optional()}),S4s=Nsr,T4s=DA.extend({method:Gn("resources/subscribe"),params:S4s}),I4s=Nsr,x4s=DA.extend({method:Gn("resources/unsubscribe"),params:I4s}),w4s=Sw.extend({uri:Ke()}),Osr=Tw.extend({method:Gn("notifications/resources/updated"),params:w4s}),R4s=Wr({name:Ke(),description:mu(Ke()),required:mu(Xc())}),P4s=Wr({...Qfe.shape,...tke.shape,description:mu(Ke()),arguments:mu(Ur(R4s)),_meta:mu(Jh({}))}),k4s=rke.extend({method:Gn("prompts/list")}),Bsr=nke.extend({prompts:Ur(P4s)}),D4s=fT.extend({name:Ke(),arguments:_l(Ke(),Ke()).optional()}),N4s=DA.extend({method:Gn("prompts/get"),params:D4s}),Lsr=Wr({type:Gn("text"),text:Ke(),annotations:qfe.optional(),_meta:_l(Ke(),Zu()).optional()}),Fsr=Wr({type:Gn("image"),data:Psr,mimeType:Ke(),annotations:qfe.optional(),_meta:_l(Ke(),Zu()).optional()}),Usr=Wr({type:Gn("audio"),data:Psr,mimeType:Ke(),annotations:qfe.optional(),_meta:_l(Ke(),Zu()).optional()}),M4s=Wr({type:Gn("tool_use"),name:Ke(),id:Ke(),input:_l(Ke(),Zu()),_meta:_l(Ke(),Zu()).optional()}),O4s=Wr({type:Gn("resource"),resource:El([OHn,BHn]),annotations:qfe.optional(),_meta:_l(Ke(),Zu()).optional()}),B4s=LHn.extend({type:Gn("resource_link")}),Qsr=El([Lsr,Fsr,Usr,B4s,O4s]),L4s=Wr({role:ske,content:Qsr}),qsr=NA.extend({description:Ke().optional(),messages:Ur(L4s)}),CF=Tw.extend({method:Gn("notifications/prompts/list_changed"),params:Sw.optional()}),F4s=Wr({title:Ke().optional(),readOnlyHint:Xc().optional(),destructiveHint:Xc().optional(),idempotentHint:Xc().optional(),openWorldHint:Xc().optional()}),U4s=Wr({taskSupport:F_(["required","optional","forbidden"]).optional()}),FHn=Wr({...Qfe.shape,...tke.shape,description:Ke().optional(),inputSchema:Wr({type:Gn("object"),properties:_l(Ke(),im).optional(),required:Ur(Ke()).optional()}).catchall(Zu()),outputSchema:Wr({type:Gn("object"),properties:_l(Ke(),im).optional(),required:Ur(Ke()).optional()}).catchall(Zu()).optional(),annotations:F4s.optional(),execution:U4s.optional(),_meta:_l(Ke(),Zu()).optional()}),Q4s=rke.extend({method:Gn("tools/list")}),jsr=nke.extend({tools:Ur(FHn)}),Pj=NA.extend({content:Ur(Qsr).default([]),structuredContent:_l(Ke(),Zu()).optional(),isError:Xc().optional()}),qaf=Pj.or(NA.extend({toolResult:Zu()})),q4s=XPe.extend({name:Ke(),arguments:_l(Ke(),Zu()).optional()}),j4s=DA.extend({method:Gn("tools/call"),params:q4s}),bF=Tw.extend({method:Gn("notifications/tools/list_changed"),params:Sw.optional()}),UHn=Wr({autoRefresh:Xc().default(!0),debounceMs:Ia().int().nonnegative().default(300)}),QHn=F_(["debug","info","notice","warning","error","critical","alert","emergency"]),H4s=fT.extend({level:QHn}),G4s=DA.extend({method:Gn("logging/setLevel"),params:H4s}),$4s=Sw.extend({level:QHn,logger:Ke().optional(),data:Zu()}),mZ=Tw.extend({method:Gn("notifications/message"),params:$4s}),V4s=Wr({name:Ke().optional()}),W4s=Wr({hints:Ur(V4s).optional(),costPriority:Ia().min(0).max(1).optional(),speedPriority:Ia().min(0).max(1).optional(),intelligencePriority:Ia().min(0).max(1).optional()}),z4s=Wr({mode:F_(["auto","required","none"]).optional()}),Y4s=Wr({type:Gn("tool_result"),toolUseId:Ke().describe("The unique identifier for the corresponding tool call."),content:Ur(Qsr).default([]),structuredContent:Wr({}).loose().optional(),isError:Xc().optional(),_meta:_l(Ke(),Zu()).optional()}),K4s=ttt("type",[Lsr,Fsr,Usr]),dst=ttt("type",[Lsr,Fsr,Usr,M4s,Y4s]),J4s=Wr({role:ske,content:El([dst,Ur(dst)]),_meta:_l(Ke(),Zu()).optional()}),Z4s=XPe.extend({messages:Ur(J4s),modelPreferences:W4s.optional(),systemPrompt:Ke().optional(),includeContext:F_(["none","thisServer","allServers"]).optional(),temperature:Ia().optional(),maxTokens:Ia().int(),stopSequences:Ur(Ke()).optional(),metadata:im.optional(),tools:Ur(FHn).optional(),toolChoice:z4s.optional()}),ake=DA.extend({method:Gn("sampling/createMessage"),params:Z4s}),Hsr=NA.extend({model:Ke(),stopReason:mu(F_(["endTurn","stopSequence","maxTokens"]).or(Ke())),role:ske,content:K4s}),Gsr=NA.extend({model:Ke(),stopReason:mu(F_(["endTurn","stopSequence","maxTokens","toolUse"]).or(Ke())),role:ske,content:El([dst,Ur(dst)])}),X4s=Wr({type:Gn("boolean"),title:Ke().optional(),description:Ke().optional(),default:Xc().optional()}),eBs=Wr({type:Gn("string"),title:Ke().optional(),description:Ke().optional(),minLength:Ia().optional(),maxLength:Ia().optional(),format:F_(["email","uri","date","date-time"]).optional(),default:Ke().optional()}),tBs=Wr({type:F_(["number","integer"]),title:Ke().optional(),description:Ke().optional(),minimum:Ia().optional(),maximum:Ia().optional(),default:Ia().optional()}),rBs=Wr({type:Gn("string"),title:Ke().optional(),description:Ke().optional(),enum:Ur(Ke()),default:Ke().optional()}),nBs=Wr({type:Gn("string"),title:Ke().optional(),description:Ke().optional(),oneOf:Ur(Wr({const:Ke(),title:Ke()})),default:Ke().optional()}),iBs=Wr({type:Gn("string"),title:Ke().optional(),description:Ke().optional(),enum:Ur(Ke()),enumNames:Ur(Ke()).optional(),default:Ke().optional()}),oBs=El([rBs,nBs]),sBs=Wr({type:Gn("array"),title:Ke().optional(),description:Ke().optional(),minItems:Ia().optional(),maxItems:Ia().optional(),items:Wr({type:Gn("string"),enum:Ur(Ke())}),default:Ur(Ke()).optional()}),aBs=Wr({type:Gn("array"),title:Ke().optional(),description:Ke().optional(),minItems:Ia().optional(),maxItems:Ia().optional(),items:Wr({anyOf:Ur(Wr({const:Ke(),title:Ke()}))}),default:Ur(Ke()).optional()}),cBs=El([sBs,aBs]),lBs=El([iBs,oBs,cBs]),uBs=El([lBs,X4s,eBs,tBs]),dBs=XPe.extend({mode:Gn("form").optional(),message:Ke(),requestedSchema:Wr({type:Gn("object"),properties:_l(Ke(),uBs),required:Ur(Ke()).optional()})}),fBs=XPe.extend({mode:Gn("url"),message:Ke(),elicitationId:Ke(),url:Ke().url()}),pBs=El([dBs,fBs]),cke=DA.extend({method:Gn("elicitation/create"),params:pBs}),hBs=Sw.extend({elicitationId:Ke()}),mBs=Tw.extend({method:Gn("notifications/elicitation/complete"),params:hBs}),$sr=NA.extend({action:F_(["accept","decline","cancel"]),content:ntt(t=>t===null?void 0:t,_l(Ke(),El([Ke(),Ia(),Xc(),Ur(Ke())])).optional())}),gBs=Wr({type:Gn("ref/resource"),uri:Ke()});var ABs=Wr({type:Gn("ref/prompt"),name:Ke()}),yBs=fT.extend({ref:El([ABs,gBs]),argument:Wr({name:Ke(),value:Ke()}),context:Wr({arguments:_l(Ke(),Ke()).optional()}).optional()}),EBs=DA.extend({method:Gn("completion/complete"),params:yBs});var Vsr=NA.extend({completion:Jh({values:Ur(Ke()).max(100),total:mu(Ia().int()),hasMore:mu(Xc())})}),_Bs=Wr({uri:Ke().startsWith("file://"),name:Ke().optional(),_meta:_l(Ke(),Zu()).optional()}),Wsr=DA.extend({method:Gn("roots/list"),params:fT.optional()}),vBs=NA.extend({roots:Ur(_Bs)}),CBs=Tw.extend({method:Gn("notifications/roots/list_changed"),params:Sw.optional()}),jaf=El([gst,f4s,EBs,G4s,N4s,k4s,_4s,v4s,b4s,T4s,x4s,j4s,Q4s,yst,_st,vst,bst]),Haf=El([mst,Ast,kHn,CBs,oke]),Gaf=El([pZ,Hsr,Gsr,$sr,vBs,Est,Cst,hZ]),$af=El([gst,ake,cke,Wsr,yst,_st,vst,bst]),Vaf=El([mst,Ast,mZ,Osr,vF,bF,CF,oke,mBs]),Waf=El([pZ,Rsr,Vsr,qsr,Bsr,ksr,Dsr,Msr,Pj,jsr,Est,Cst,hZ]),Fn=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Zn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Tsr(o.elicitations,r)}return new t(e,r,n)}},Tsr=class extends Fn{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Zn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var e2=new Ae("mcpGateway"),uke="Copilot MCP Gateway",dke="0.1.0",lke=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(Ql.ToolsListChanged,this._onToolsListChanged),this._invoker.on(Ql.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(Ql.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(Ql.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected + +`),this._sseClients.add(e),e2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),e2.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)ust(o)?n.push(await this._dispatchRequest(o)):CHn(o)?this._dispatchNotification(o):e2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,e2.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(Ql.ToolsListChanged,this._onToolsListChanged),this._invoker.off(Ql.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(Ql.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(Ql.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){e2.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof vw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(e2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:Cw.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new vw(Cw.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new vw(Cw.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&fst.includes(n)?n:bw;return e2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&e2.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:uke,version:dke}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(Cw.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.callTool(r.name,n)}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new vw(Cw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(Cw.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new vw(Cw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new vw(Cw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){e2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,e2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){e2.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` +`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function qHn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(qHn,"isInitializeMessage");var zsr=require("crypto"),jHn=require("events"),HHn=fe(require("http"));var kj=new Ae("mcpGateway"),bBs="mcp-session-id",SBs=1024*1024,TBs=5e3,Sst={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},gZ={MountsChanged:"mountsChanged"},Dj=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new jHn.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,kj.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),_t(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(gZ.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Sst.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,zsr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return kj.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),_t(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(gZ.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),kj.info(this._ctx,`unregistered mount '${n.label}' (${e})`),_t(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(gZ.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=HHn.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),TBs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),kj.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){kj.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:Cw.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){kj.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!qHn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,zsr.randomUUID)(),c=new lke(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&kj.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),kj.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(ust)}_getSessionId(e){let r=e.headers[bBs];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>SBs)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`http://${this._host}:${this._port}/${n}/mcp`,status:o}}};var pT=class{static{a(this,"McpGatewayHost")}constructor(e,r){this._service=r}get service(){return this._service}buildMcpServers(){let e={};for(let r of this._service.listMounts())r.status===Sst.Ready&&(e[r.id]={type:"http",url:r.url,tools:["*"]});return e}async dispose(){}};p();p();p();var Ysr;Ysr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function IBs(t){return(await Ysr).getRandomValues(new Uint8Array(t))}a(IBs,"getRandomValues");async function xBs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await IBs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await wBs(t),r=await RBs(e);return{code_verifier:e,code_challenge:r}}a(Ksr,"pkceChallenge");p();var MA=gYt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:jYt.custom,message:"URL must be parseable",fatal:!0}),Sxe}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),$Hn=Jh({resource:Ke().url(),authorization_servers:Ur(MA).optional(),jwks_uri:Ke().url().optional(),scopes_supported:Ur(Ke()).optional(),bearer_methods_supported:Ur(Ke()).optional(),resource_signing_alg_values_supported:Ur(Ke()).optional(),resource_name:Ke().optional(),resource_documentation:Ke().optional(),resource_policy_uri:Ke().url().optional(),resource_tos_uri:Ke().url().optional(),tls_client_certificate_bound_access_tokens:Xc().optional(),authorization_details_types_supported:Ur(Ke()).optional(),dpop_signing_alg_values_supported:Ur(Ke()).optional(),dpop_bound_access_tokens_required:Xc().optional()}),Jsr=Jh({issuer:Ke(),authorization_endpoint:MA,token_endpoint:MA,registration_endpoint:MA.optional(),scopes_supported:Ur(Ke()).optional(),response_types_supported:Ur(Ke()),response_modes_supported:Ur(Ke()).optional(),grant_types_supported:Ur(Ke()).optional(),token_endpoint_auth_methods_supported:Ur(Ke()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),service_documentation:MA.optional(),revocation_endpoint:MA.optional(),revocation_endpoint_auth_methods_supported:Ur(Ke()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),introspection_endpoint:Ke().optional(),introspection_endpoint_auth_methods_supported:Ur(Ke()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),code_challenge_methods_supported:Ur(Ke()).optional(),client_id_metadata_document_supported:Xc().optional()}),PBs=Jh({issuer:Ke(),authorization_endpoint:MA,token_endpoint:MA,userinfo_endpoint:MA.optional(),jwks_uri:MA,registration_endpoint:MA.optional(),scopes_supported:Ur(Ke()).optional(),response_types_supported:Ur(Ke()),response_modes_supported:Ur(Ke()).optional(),grant_types_supported:Ur(Ke()).optional(),acr_values_supported:Ur(Ke()).optional(),subject_types_supported:Ur(Ke()),id_token_signing_alg_values_supported:Ur(Ke()),id_token_encryption_alg_values_supported:Ur(Ke()).optional(),id_token_encryption_enc_values_supported:Ur(Ke()).optional(),userinfo_signing_alg_values_supported:Ur(Ke()).optional(),userinfo_encryption_alg_values_supported:Ur(Ke()).optional(),userinfo_encryption_enc_values_supported:Ur(Ke()).optional(),request_object_signing_alg_values_supported:Ur(Ke()).optional(),request_object_encryption_alg_values_supported:Ur(Ke()).optional(),request_object_encryption_enc_values_supported:Ur(Ke()).optional(),token_endpoint_auth_methods_supported:Ur(Ke()).optional(),token_endpoint_auth_signing_alg_values_supported:Ur(Ke()).optional(),display_values_supported:Ur(Ke()).optional(),claim_types_supported:Ur(Ke()).optional(),claims_supported:Ur(Ke()).optional(),service_documentation:Ke().optional(),claims_locales_supported:Ur(Ke()).optional(),ui_locales_supported:Ur(Ke()).optional(),claims_parameter_supported:Xc().optional(),request_parameter_supported:Xc().optional(),request_uri_parameter_supported:Xc().optional(),require_request_uri_registration:Xc().optional(),op_policy_uri:MA.optional(),op_tos_uri:MA.optional(),client_id_metadata_document_supported:Xc().optional()}),VHn=Wr({...PBs.shape,...Jsr.pick({code_challenge_methods_supported:!0}).shape}),WHn=Wr({access_token:Ke(),id_token:Ke().optional(),token_type:Ke(),expires_in:fwe.number().optional(),scope:Ke().optional(),refresh_token:Ke().optional()}).strip(),zHn=Wr({error:Ke(),error_description:Ke().optional(),error_uri:Ke().optional()}),GHn=MA.optional().or(Gn("").transform(()=>{})),kBs=Wr({redirect_uris:Ur(MA),token_endpoint_auth_method:Ke().optional(),grant_types:Ur(Ke()).optional(),response_types:Ur(Ke()).optional(),client_name:Ke().optional(),client_uri:MA.optional(),logo_uri:GHn,scope:Ke().optional(),contacts:Ur(Ke()).optional(),tos_uri:GHn,policy_uri:Ke().optional(),jwks_uri:MA.optional(),jwks:NYt().optional(),software_id:Ke().optional(),software_version:Ke().optional(),software_statement:Ke().optional()}).strip(),DBs=Wr({client_id:Ke(),client_secret:Ke().optional(),client_id_issued_at:Ia().optional(),client_secret_expires_at:Ia().optional()}).strip(),YHn=kBs.merge(DBs),Rcf=Wr({error:Ke(),error_description:Ke().optional()}).strip(),Pcf=Wr({token:Ke(),token_type_hint:Ke().optional()}).strip();p();function KHn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(KHn,"resourceUrlFromServerUrl");function JHn({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(jBs,"shouldAttemptFallback");async function HBs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??bw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=qBs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await XHn(c,s,r);if(!n?.metadataUrl&&jBs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await XHn(u,s,r)}return l}a(HBs,"discoverMetadataWithFallback");function GBs(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a(GBs,"buildDiscoveryUrls");async function rGn(t,{fetchFn:e=fetch,protocolVersion:r=bw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=GBs(t);for(let{url:s,type:c}of o){let l=await rar(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?Jsr.parse(await l.json()):VHn.parse(await l.json())}}}a(rGn,"discoverAuthorizationServerMetadata");async function $Bs(t,e){let r,n;try{r=await tGn(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await rGn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a($Bs,"discoverOAuthServerInfo");async function VBs(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(Zsr))throw new Error(`Incompatible auth server: does not support response type ${Zsr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(Xsr))throw new Error(`Incompatible auth server: does not support code challenge method ${Xsr}`)}else l=new URL("/authorize",t);let u=await Ksr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",Zsr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",Xsr),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(VBs,"startAuthorization");function WBs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(WBs,"prepareAuthorizationCodeRequest");async function nGn(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=MBs(n,f);OBs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await eGn(d);return WHn.parse(await d.json())}a(nGn,"executeTokenRequest");async function zBs(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await nGn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(zBs,"refreshAuthorization");async function YBs(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=WBs(o,d,t.redirectUrl)}let u=await t.clientInformation();return nGn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(YBs,"fetchToken");async function KBs(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await eGn(c);return YHn.parse(await c.json())}a(KBs,"registerClient");p();p();p();p();function Hfe(t){return!!t._zod}a(Hfe,"isZ4Schema");function t2(t,e){return Hfe(t)?Sue(t,e):t.safeParse(e)}a(t2,"safeParse");function Tst(t){if(!t)return;let e;if(Hfe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(Tst,"getObjectShape");function iGn(t){if(Hfe(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(iGn,"getLiteralValue");p();function Nj(t){return t==="completed"||t==="failed"||t==="cancelled"}a(Nj,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var puf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function nar(t){let r=Tst(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=iGn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(nar,"getMethodLiteral");function iar(t,e){let r=t2(t,e);if(!r.success)throw r.error;return r.data}a(iar,"parseWithCompat");var rLs=6e4,Ist=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(mst,r=>{this._oncancel(r)}),this.setNotificationHandler(Ast,r=>{this._onprogress(r)}),this.setRequestHandler(gst,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(yst,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Fn(Zn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(_st,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Fn(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Fn(Zn.InvalidParams,`Task not found: ${s}`);if(!Nj(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Nj(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[wj]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(vst,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Fn(Zn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(bst,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Fn(Zn.InvalidParams,`Task not found: ${r.params.taskId}`);if(Nj(o.status))throw new Fn(Zn.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Fn(Zn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Fn?o:new Fn(Zn.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Fn.fromError(Zn.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),fZ(s)||RHn(s)?this._onresponse(s):eke(s)?this._onrequest(s,c):wHn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Fn.fromError(Zn.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[wj]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Zn.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=THn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Fn(Zn.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Zn.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),fZ(e))n(e);else{let c=new Fn(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(fZ(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),fZ(e))o(e);else{let c=Fn.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Fn?c:new Fn(Zn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,hZ,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Fn(Zn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Nj(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Fn(Zn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Fn(Zn.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Fn?c:new Fn(Zn.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[wj]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let b=v instanceof Fn?v:new Fn(Zn.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=t2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??rLs,E=a(()=>A(Fn.fromError(Zn.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Est,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Cst,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},NHn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[wj]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[wj]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[wj]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=nar(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=iar(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=nar(e);this._notificationHandlers.set(n,o=>{let s=iar(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&eke(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Fn(Zn.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Fn(Zn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Fn(Zn.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Fn(Zn.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=oke.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Nj(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Fn(Zn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Nj(l.status))throw new Fn(Zn.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=oke.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Nj(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function oGn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a(oGn,"isPlainObject");function sGn(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];oGn(c)&&oGn(s)?r[o]={...c,...s}:r[o]=s}return r}a(sGn,"mergeCapabilities");p();var JVn=fe($cr(),1),ZVn=fe(KVn(),1);function oUs(){let t=new JVn.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ZVn.default)(t),t}a(oUs,"createDefaultAjvInstance");var aat=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??oUs()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var cat=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=Pj,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Fn(Zn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Fn(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Fn){yield{type:"error",error:f};return}yield{type:"error",error:new Fn(Zn.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function XVn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(XVn,"assertToolsCallTaskCapability");function eWn(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(eWn,"assertClientRequestTaskCapability");function lat(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&lat(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&lat(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&lat(r,e)}}a(lat,"applyElicitationDefaults");function sUs(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(sUs,"getSupportedElicitationModes");var jj=class extends Ist{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new aat,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",bF,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",CF,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",vF,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new cat(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=sGn(this._capabilities,e)}setRequestHandler(e,r){let o=Tst(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Hfe(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=t2(cke,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Fn(Zn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=sUs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Fn(Zn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Fn(Zn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=t2(hZ,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Fn(Zn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=t2($sr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Fn(Zn.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{lat(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=t2(ake,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Fn(Zn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=t2(hZ,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Fn(Zn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?Gsr:Hsr,y=t2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Fn(Zn.InvalidParams,`Invalid sampling result: ${E}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:bw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Rsr,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!fst.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){XVn(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&eWn(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},pZ,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},Vsr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},pZ,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},qsr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Bsr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},ksr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},Dsr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Msr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},pZ,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},pZ,r)}async callTool(e,r=Pj,n){if(this.isToolTaskRequired(e.name))throw new Fn(Zn.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Fn(Zn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Fn(Zn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Fn?c:new Fn(Zn.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},jsr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=UHn.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var uat=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function Xcr(t){}a(Xcr,"noop");function dat(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=Xcr,onError:r=Xcr,onRetry:n=Xcr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=aUs(`${s}${E}`);for(let b of _)h(b);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} +`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new uat(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new uat(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));break}}a(m,"processField");function g(){u.length>0&&e({id:l,event:d||void 0,data:u.endsWith(` +`)?u.slice(0,-1):u}),l=void 0,u="",d=""}a(g,"dispatchEvent");function A(y={}){s&&y.consume&&h(s),c=!0,l=void 0,u="",d="",s=""}return a(A,"reset"),{feed:f,reset:A}}a(dat,"createParser");function aUs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),clr=a((t,e,r)=>e.has(t)||nWn("Cannot "+r),"__accessCheck"),Ks=a((t,e,r)=>(clr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),om=a((t,e,r)=>e.has(t)?nWn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Ld=a((t,e,r,n)=>(clr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),kF=a((t,e,r)=>(clr(t,e,"access private method"),r),"__privateMethod"),lb,DZ,cpe,fat,hat,r2e,dpe,n2e,Hj,lpe,fpe,upe,e2e,a2,tlr,rlr,nlr,rWn,ilr,olr,t2e,slr,alr,NZ=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),om(this,a2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,om(this,lb),om(this,DZ),om(this,cpe),om(this,fat),om(this,hat),om(this,r2e),om(this,dpe),om(this,n2e,null),om(this,Hj),om(this,lpe),om(this,fpe,null),om(this,upe,null),om(this,e2e,null),om(this,rlr,async s=>{var c;Ks(this,lpe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){kF(this,a2,t2e).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Ld(this,cpe,new URL(s.url)):Ld(this,cpe,void 0),d!==200){kF(this,a2,t2e).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){kF(this,a2,t2e).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(Ks(this,lb)===this.CLOSED)return;Ld(this,lb,this.OPEN);let h=new Event("open");if((c=Ks(this,e2e))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){kF(this,a2,t2e).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:E}=await g.read();E&&Ks(this,lpe).feed(m.decode(E,{stream:!y})),y&&(A=!1,Ks(this,lpe).reset(),kF(this,a2,slr).call(this))}while(A)}),om(this,nlr,s=>{Ld(this,Hj,void 0),!(s.name==="AbortError"||s.type==="aborted")&&kF(this,a2,slr).call(this,elr(s))}),om(this,ilr,s=>{typeof s.id=="string"&&Ld(this,n2e,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:Ks(this,cpe)?Ks(this,cpe).origin:Ks(this,DZ).origin,lastEventId:s.id||""});Ks(this,upe)&&(!s.event||s.event==="message")&&Ks(this,upe).call(this,c),this.dispatchEvent(c)}),om(this,olr,s=>{Ld(this,r2e,s)}),om(this,alr,()=>{Ld(this,dpe,void 0),Ks(this,lb)===this.CONNECTING&&kF(this,a2,tlr).call(this)});try{if(e instanceof URL)Ld(this,DZ,e);else if(typeof e=="string")Ld(this,DZ,new URL(e,lUs()));else throw new Error("Invalid URL")}catch{throw cUs("An invalid or illegal string was specified")}Ld(this,lpe,dat({onEvent:Ks(this,ilr),onRetry:Ks(this,olr)})),Ld(this,lb,this.CONNECTING),Ld(this,r2e,3e3),Ld(this,hat,(n=r?.fetch)!=null?n:globalThis.fetch),Ld(this,fat,(o=r?.withCredentials)!=null?o:!1),kF(this,a2,tlr).call(this)}get readyState(){return Ks(this,lb)}get url(){return Ks(this,DZ).href}get withCredentials(){return Ks(this,fat)}get onerror(){return Ks(this,fpe)}set onerror(e){Ld(this,fpe,e)}get onmessage(){return Ks(this,upe)}set onmessage(e){Ld(this,upe,e)}get onopen(){return Ks(this,e2e)}set onopen(e){Ld(this,e2e,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){Ks(this,dpe)&&clearTimeout(Ks(this,dpe)),Ks(this,lb)!==this.CLOSED&&(Ks(this,Hj)&&Ks(this,Hj).abort(),Ld(this,lb,this.CLOSED),Ld(this,Hj,void 0))}};lb=new WeakMap,DZ=new WeakMap,cpe=new WeakMap,fat=new WeakMap,hat=new WeakMap,r2e=new WeakMap,dpe=new WeakMap,n2e=new WeakMap,Hj=new WeakMap,lpe=new WeakMap,fpe=new WeakMap,upe=new WeakMap,e2e=new WeakMap,a2=new WeakSet,tlr=a(function(){Ld(this,lb,this.CONNECTING),Ld(this,Hj,new AbortController),Ks(this,hat)(Ks(this,DZ),kF(this,a2,rWn).call(this)).then(Ks(this,rlr)).catch(Ks(this,nlr))},"connect_fn"),rlr=new WeakMap,nlr=new WeakMap,rWn=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ks(this,n2e)?{"Last-Event-ID":Ks(this,n2e)}:void 0},cache:"no-store",signal:(t=Ks(this,Hj))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),ilr=new WeakMap,olr=new WeakMap,t2e=a(function(t,e){var r;Ks(this,lb)!==this.CLOSED&&Ld(this,lb,this.CLOSED);let n=new pat("error",{code:e,message:t});(r=Ks(this,fpe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),slr=a(function(t,e){var r;if(Ks(this,lb)===this.CLOSED)return;Ld(this,lb,this.CONNECTING);let n=new pat("error",{code:e,message:t});(r=Ks(this,fpe))==null||r.call(this,n),this.dispatchEvent(n),Ld(this,dpe,setTimeout(Ks(this,alr),Ks(this,r2e)))},"scheduleReconnect_fn"),alr=new WeakMap,NZ.CONNECTING=0,NZ.OPEN=1,NZ.CLOSED=2;function lUs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(lUs,"getBaseURL");p();function ppe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(ppe,"normalizeHeaders");function mat(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...ppe(e.headers),...ppe(n.headers)}:e.headers};return t(r,o)}:t}a(mat,"createFetchWithInit");var i2e=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},hpe=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=mat(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new OA("No auth provider");let e;try{e=await TF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new OA;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=ppe(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new NZ(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=jfe(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new i2e(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=Rj.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new OA("No auth provider");if(await TF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new OA("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=jfe(o);if(this._resourceMetadataUrl=c,this._scope=l,await TF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new OA;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var gat=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=dat({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var uUs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Pw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},mpe=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=mat(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??uUs}async _authThenStart(){if(!this._authProvider)throw new OA("No auth provider");let e;try{e=await TF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new OA;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=ppe(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new Pw(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new gat({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=Rj.parse(JSON.parse(g.data));fZ(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new OA("No auth provider");if(await TF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new OA("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:eke(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Pw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=jfe(l);if(this._resourceMetadataUrl=g,this._scope=A,await TF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new OA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=jfe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Pw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await TF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new OA;return this.send(e)}}throw new Pw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),DHn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>Rj.parse(A)):[Rj.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Pw(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Pw(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var sWn=require("events");var gpe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},o2e=class{constructor(e){this._transport=null;this._emitter=new sWn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new jj({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=dUs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!iWn(l))throw l}}throw iWn(n)?new gpe:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new hpe(r,oWn(this._options.sseOptions,e)):new mpe(r,oWn(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(bF,()=>{this._emitter.emit(Ql.ToolsListChanged)}),this._client.setNotificationHandler(vF,()=>{this._emitter.emit(Ql.ResourcesListChanged)}),this._client.setNotificationHandler(CF,()=>{this._emitter.emit(Ql.PromptsListChanged)}),this._client.setNotificationHandler(mZ,o=>{this._emitter.emit(Ql.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function iWn(t){if(t instanceof OA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(iWn,"isUnauthorized");function dUs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Pw||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(dUs,"httpFallbackCode");function oWn(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a(oWn,"withBearer");p();p();p();p();p();var c2=class{static{a(this,"McpRuntimeNotifier")}},Aat=class extends c2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var or=new Ae("CopilotMCP");async function llr(t,e){await t.get(c2).notifyLog(e)}a(llr,"notifyMCPRuntimeLog");async function sm(t,e){await llr(t,{...e,level:"error"})}a(sm,"notifyMCPRuntimeError");async function MZ(t,e){await llr(t,{...e,level:"warning"})}a(MZ,"notifyMCPRuntimeWarning");async function sc(t,e){await llr(t,{...e,level:"info"})}a(sc,"notifyMCPRuntimeInfo");p();async function OZ(t,e,r,n,o){return await t.get(cr).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(OZ,"fetchOauthServer");async function ulr(t){try{return await t.text()}catch{return t.statusText}}a(ulr,"getErrText");p();var aWn="/.well-known",dlr=`${aWn}/oauth-protected-resource`,cWn=`${aWn}/oauth-authorization-server`,lWn=" ";function uWn(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(uWn,"isAuthorizationProtectedResourceMetadata");function dWn(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(dWn,"isAuthorizationServerMetadata");function yat(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(yat,"parseWWWAuthenticateHeader");function fWn(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(fWn,"getMetadataWithDefaultValues");function pWn(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(pWn,"getDefaultMetadataForUrl");function hWn(t){let e=new URL(t);if(!e.pathname.startsWith(dlr))throw new Error(`Invalid discovery URL: expected path to start with ${dlr}`);let r=e.pathname.substring(dlr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(hWn,"getResourceServerBaseUrlFromDiscoveryUrl");function mWn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(mWn,"isAuthorizationDynamicClientRegistrationResponse");function Eat(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(Eat,"isAuthorizationTokenResponse");function flr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(YHt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(YHt(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(flr,"getClaimsFromJWT");var plr=class{static{a(this,"AuthMetadata")}},Ape=class extends plr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=fWn(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},or.info(this.ctx,"authMetadata",f),f}catch(m){or.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=pWn(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await OZ(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=yat(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await OZ(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":bw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await ulr(c)}`);let l=await c.json();if(uWn(l)){let u=hWn(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(cWn,e).toString()+o,c=await OZ(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":bw});if(c.status!==200&&(c=await OZ(this.ctx,Sa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":bw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await ulr(c)}`);let l=await c.json();if(dWn(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var ub=class{static{a(this,"McpAuthService")}};var g5=new Ae("mcpGateway");async function gWn(t,e,r){g5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new Ape(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return g5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),_t(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){g5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),si(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(gWn,"discoverAuthMetadata");async function _at(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=yWn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return _t(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return _t(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(_at,"acquireSilent");async function AWn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=fUs(t),d=yWn(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){g5.warn(t,`mount '${o}': user cancelled the account selection`),_t(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){g5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),_t(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}_t(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){g5.error(t,`mount '${o}': failed during account selection`,h),si(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){g5.warn(t,`mount '${o}': user declined OAuth confirmation`),_t(t,"mcpGateway.oauth.interactive",{result:"declined"});return}_t(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){g5.error(t,`mount '${o}': failed to show auth confirmation`,f),si(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||g5.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),_t(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){g5.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),si(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(AWn,"acquireInteractive");function fUs(t){try{return t.get(Hs)}catch{return}}a(fUs,"tryGetNotificationSender");function yWn(t){try{return t.get(ub)}catch{return}}a(yWn,"tryGetMcpAuthService");p();p();var czn=fe(szn(),1),bat=fe(require("node:process"),1),lzn=require("node:stream");p();var Cat=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` +`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),UUs(r)}clear(){this._buffer=void 0}};function UUs(t){return Rj.parse(JSON.parse(t))}a(UUs,"deserializeMessage");function azn(t){return JSON.stringify(t)+` +`}a(azn,"serializeMessage");var QUs=bat.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function qUs(){let t={};for(let e of QUs){let r=bat.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(qUs,"getDefaultEnvironment");var _pe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new Cat,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new lzn.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,czn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...qUs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:bat.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=azn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var uzn=require("child_process"),dzn=require("events"),fzn=require("util");var blr=1e4,jUs=(0,fzn.promisify)(uzn.exec),s2e=class{constructor(e){this._transport=null;this._emitter=new dzn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new jj({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new _pe(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(bF,()=>{this._emitter.emit(Ql.ToolsListChanged)}),this._client.setNotificationHandler(vF,()=>{this._emitter.emit(Ql.ResourcesListChanged)}),this._client.setNotificationHandler(CF,()=>{this._emitter.emit(Ql.PromptsListChanged)}),this._client.setNotificationHandler(mZ,n=>{this._emitter.emit(Ql.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),blr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await jUs(`taskkill /pid ${o} /t /f`,{timeout:blr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,blr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var r0=class{static{a(this,"AuthenticationService")}};var hT=new Ae("mcpGateway.manager"),Gj=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},HUs={tools:[],resources:[],resourceTemplates:[],prompts:[]},db=class{constructor(e,r,n){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n}static{a(this,"McpServerManager")}listServers(){let e=[];for(let r of this._entries.values())e.push({name:r.key.name,source:r.key.source,status:r.status,error:r.error,authInfo:r.authInfo,registryInfo:r.registryInfo});return e}getServerDetails(e){let r=this._entries.get(BZ(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async _applyConfigLocked(e){let r={kind:"user"},n=new Map,o=[];for(let[l,u]of Object.entries(e)){let d=$Us(l,u);if(!d){o.push(l);continue}n.set(BZ({source:r,name:l}),{classified:d,hash:GUs(u)})}o.length>0&&hT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)u.key.source.kind==="user"&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:r,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged()}serverAction(e,r){let n=BZ(e),o=this._entries.get(n);if(!o)throw new Gj("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new Gj("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new Gj("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged();return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...HUs},listeners:null};return this._entries.set(BZ(e),o),o}async _removeEntry(e){let r=this._entries.get(e);r&&(await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged())}async _beginStart(e){let r=this._entries.get(e);if(!r)return;r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged());let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}try{await this._service.registerMount(n,r.key.name)}catch(o){throw hT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(BZ(r.key)),await n.stop().catch(()=>{});return}if(r.status="running",r.error=void 0,await this._refreshContents(r).catch(o=>{hT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof gpe?(r.status="unauthorized",r.error=void 0,hT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),hT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged()}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(BZ(e.key)),this._sender.serversChanged(),n&&await n.stop().catch(o=>{hT.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)})}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged")};r.on(Ql.ToolsListChanged,n.toolsChanged),r.on(Ql.ResourcesListChanged,n.resourcesChanged),r.on(Ql.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(Ql.ToolsListChanged,n.toolsChanged),r.off(Ql.ResourcesListChanged,n.resourcesChanged),r.off(Ql.PromptsListChanged,n.promptsChanged)),e.listeners=null}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){hT.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=BZ(e.key),o=e.key.name;return r.kind==="stdio"?new s2e({id:n,label:o,params:r.params,clientInfo:{name:uke,version:dke}}):new o2e({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,clientInfo:{name:uke,version:dke},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{hT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),_t(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(r0)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await gWn(this._ctx,r,n);if(!s){hT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await _at(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){hT.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await _at(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await _at(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await AWn(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged())}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>hT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){hT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){hT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged()}};function BZ(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(BZ,"serializeKey");function GUs(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(GUs,"canonicalEntryHash");function $Us(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a($Us,"classifyEntry");var Slr=new Ae("BackgroundAgent.McpSync"),Sat=class{constructor(e,r){this.ctx=e;this.registry=r;this.syncScheduled=!1;try{let n=e.get(pT);this.host=n,this.mountsChangedListener=()=>this.schedule(),n.service.on(gZ.MountsChanged,this.mountsChangedListener)}catch(n){if(!(n instanceof Y0))throw n}}static{a(this,"McpSync")}dispose(){this.host&&this.mountsChangedListener&&(this.host.service.off(gZ.MountsChanged,this.mountsChangedListener),this.mountsChangedListener=void 0,this.host=void 0)}schedule(){this.syncScheduled||(this.syncScheduled=!0,queueMicrotask(()=>{this.syncScheduled=!1,this.syncToActiveSessions()}))}async syncToActiveSessions(){let e;try{e=this.ctx.get(pT).buildMcpServers()}catch(r){r instanceof Y0||Slr.warn(this.ctx,"Failed to read MCP gateway servers for active-session sync",{error:r instanceof Error?r.message:String(r)});return}this.registry.size()!==0&&(Slr.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.registry.size(),mcpServerCount:Object.keys(e).length}),await Promise.all([...this.registry.entries()].map(async([r,n])=>{try{await n.reloadMcpServers({mcpServers:e})}catch(o){Slr.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:o instanceof Error?o.message:String(o)})}})))}};p();p();var Tat="/agents/sessions",Iat=class{constructor(e,r,n){this.ctx=e;this.logger=r;this.opts=n;this.fetchImpl=n.fetch??fetch}static{a(this,"MissionControlApiClient")}async createSession(e,r,n){let o=await this.buildUrl(Tat),s=await this.buildHeaders();s["Content-Type"]="application/json";let c=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{ownerId:e,repoId:r,agentTaskId:n,integrationId:this.opts.integrationId});let l=await this.fetchWithTimeout(o,{method:"POST",headers:s,body:JSON.stringify({owner_id:e,repo_id:r,agent_task_id:n})});if(!l.ok){let f=await pzn(l);throw this.logger.warn(this.ctx,`MissionControl createSession \u2190 ${l.status} ${l.statusText}`,{durationMs:Date.now()-c,body:f.slice(0,500)}),new Error(`MissionControl createSession failed: ${l.status} ${l.statusText} ${f}`)}let u=await l.json();if(typeof u.id!="string")throw new Error("MissionControl createSession: response missing id");let d=typeof u.task_id=="string"?u.task_id:u.id;return this.logger.info(this.ctx,"MissionControl createSession \u2190 200",{durationMs:Date.now()-c,mcSessionId:u.id,mcTaskId:d}),{id:u.id,taskId:d}}async submitEvents(e,r,n){let o=await this.buildUrl(`${Tat}/${encodeURIComponent(e)}/events`),s=Date.now();this.logger.info(this.ctx,`MissionControl POST ${o}`,{eventCount:r.length,ackCount:n.length,eventTypes:r.slice(0,10).map(c=>c.type)});try{let c=await this.buildHeaders();c["Content-Type"]="application/json";let l={events:r};n.length>0&&(l.completed_command_ids=n);let u=await this.fetchWithTimeout(o,{method:"POST",headers:c,body:JSON.stringify(l)});if(!u.ok){let d=await pzn(u);return this.logger.warn(this.ctx,`MissionControl submitEvents \u2190 ${u.status} ${u.statusText}`,{durationMs:Date.now()-s,body:d.slice(0,500)}),!1}return this.logger.info(this.ctx,"MissionControl submitEvents \u2190 200",{durationMs:Date.now()-s,eventCount:r.length,ackCount:n.length}),!0}catch(c){return this.logger.warn(this.ctx,`MissionControl submitEvents error: ${c instanceof Error?c.message:String(c)}`,{durationMs:Date.now()-s}),!1}}async getPendingCommands(e){let r=await this.buildUrl(`${Tat}/${encodeURIComponent(e)}/commands`),n=Date.now();try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"GET",headers:o});if(!s.ok)return this.logger.warn(this.ctx,`MissionControl GET ${r} \u2190 ${s.status} ${s.statusText}`,{durationMs:Date.now()-n}),[];let c=await s.json(),l=Array.isArray(c.commands)?c.commands:[];return l.length>0?this.logger.info(this.ctx,`MissionControl GET ${r} \u2190 200`,{durationMs:Date.now()-n,commandCount:l.length,commandIds:l.map(u=>u.id)}):this.logger.debug(this.ctx,`MissionControl GET ${r} \u2190 200 (no commands)`,{durationMs:Date.now()-n}),l}catch(o){return this.logger.warn(this.ctx,`MissionControl getPendingCommands error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n}),[]}}async deleteSession(e){let r=await this.buildUrl(`${Tat}/${encodeURIComponent(e)}/`),n=Date.now();this.logger.info(this.ctx,`MissionControl DELETE ${r}`);try{let o=await this.buildHeaders(),s=await this.fetchWithTimeout(r,{method:"DELETE",headers:o});this.logger.info(this.ctx,`MissionControl DELETE ${r} \u2190 ${s.status}`,{durationMs:Date.now()-n})}catch(o){this.logger.warn(this.ctx,`MissionControl deleteSession error: ${o instanceof Error?o.message:String(o)}`,{durationMs:Date.now()-n})}}async buildUrl(e){return`${(await this.opts.getApiBase()).replace(/\/+$/,"")}${e.startsWith("/")?e:`/${e}`}`}async buildHeaders(){return{Authorization:`Bearer ${await this.opts.getAuthToken()}`,"Copilot-Integration-Id":this.opts.integrationId,Accept:"application/json","User-Agent":"GitHubCopilotChat/0.0.0"}}async fetchWithTimeout(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),1e4);try{return await this.fetchImpl(e,{...r,signal:n.signal})}finally{clearTimeout(o)}}};async function pzn(t){try{return await t.text()}catch{return""}}a(pzn,"safeReadText");p();p();var xat=class{constructor(e){this.opts=e;this.failureCount=0;this.state=0;this.nextRetryAt=0;this.currentTimeoutMs=e.resetTimeoutMs}static{a(this,"CircuitBreaker")}canRequest(){return this.state===0?!0:this.state===1&&Date.now()>=this.nextRetryAt?(this.state=2,!0):this.state===2}recordSuccess(){this.failureCount=0,this.state=0,this.currentTimeoutMs=this.opts.resetTimeoutMs}recordFailure(){this.failureCount++,(this.state===2||this.failureCount>=this.opts.failureThreshold)&&(this.state=1,this.nextRetryAt=Date.now()+this.currentTimeoutMs,this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.opts.maxResetTimeoutMs))}getState(){return this.state}getFailureCount(){return this.failureCount}get name(){return this.opts.name}};p();var VUs=new Set(["assistant.message_delta","assistant.streaming_delta","session.shutdown","session.error","session.usage_info","assistant.usage","pending_messages.modified","session.mcp_server_status_changed","session.mcp_servers_loaded","session.skills_loaded","session.tools_updated"]);function hzn(t){return!(!t.type||VUs.has(t.type)||t.type.startsWith("tool.execution_")&&t.data?.toolName==="report_intent")}a(hzn,"shouldForwardMissionControlEvent");function Tlr(t){let e=t.data;return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}a(Tlr,"getMissionControlEventData");function mzn(t,e){if(e.type!=="user.message")return;let r=e.data?.source;if(typeof r!="string"||!r.startsWith("command-"))return;let n=r.slice(8);n&&t.completedCommandIds.push(n)}a(mzn,"maybeAcknowledgeMissionControlCommandFromEvent");var yzn=require("node:crypto");var WUs=500,zUs=3e3,YUs=1e4,KUs=500,a2e=2e3,JUs=256,gzn=80,wat=class{constructor(e,r,n){this.sessionId=e;this.sdkSession=r;this.remoteCtx=n;this.circuitBreaker=new xat({failureThreshold:5,resetTimeoutMs:1e3,maxResetTimeoutMs:3e4,name:"mc-events"})}static{a(this,"MissionControlRemoteDelegate")}async enable(){if(this.state&&!this.state.disposed)return{url:this.state.frontendUrl,remoteSteerable:!0};let{workingDir:e,getGithubToken:r,client:n,logger:o,ctx:s}=this.remoteCtx,c=await hgn(e);if(!c)throw new Error("Mission Control: not_a_github_repo");let l=await r(),u=await mgn(c,l);if(!u)throw new Error("Mission Control: repo_id_resolution_failed");let d=`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,f=await n.createSession(u.ownerId,u.repoId,d),h={mcSessionId:f.id,mcTaskId:f.taskId,nwo:c,frontendUrl:`https://github.com/${c.owner}/${c.repo}/tasks/${f.taskId}`,eventBuffer:[],completedCommandIds:[],toolCallIdToRequestId:new Map,lastEventId:null,lastSubmitAttemptTimeMs:Date.now(),processedCommandIds:new Set,disposed:!1,titleSent:!!this.remoteCtx.sessionTitle,flushInFlight:!1,pollInFlight:!1};this.state=h;let m=XUs(e);h.eventBuffer.push(this.createEvent(h,"session.start",{sessionId:h.mcSessionId,version:1,producer:"copilot-developer-cli",copilotVersion:"1.0.0",startTime:new Date().toISOString(),remoteSteerable:!0,context:{cwd:m,gitRoot:m,repository:`${c.owner}/${c.repo}`}}));let g=new Set(["user.message","assistant.message","assistant.turn_start","assistant.turn_complete","tool.execution_start","tool.execution_complete"]);try{let A=Array.from(this.sdkSession.getEvents()),y=0;for(let E of A)E.type&&g.has(E.type)&&(this.bufferEvent(h,E),y++);o.info(s,`Mission Control replayed ${y}/${A.length} historical events`)}catch(A){o.warn(s,`Mission Control history replay failed: ${LZ(A)}`)}try{let A=this.sdkSession.on("*",y=>{!this.state||this.state.disposed||this.bufferEvent(this.state,y)});h.eventListenerDispose=typeof A=="function"?A:void 0,o.info(s,"Mission Control listener attached")}catch(A){o.warn(s,`Mission Control session.on('*') failed: ${LZ(A)}`)}try{Xor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!0})}catch(A){o.warn(s,`sdk.emit(remote_steerable_changed=true) failed: ${LZ(A)}`)}return this.remoteCtx.sessionTitle&&h.eventBuffer.push(this.createEvent(h,"session.title_changed",{title:this.remoteCtx.sessionTitle},!0)),await this.flush(),h.flushInterval=setInterval(()=>{this.flush().catch(A=>o.warn(s,`mc flush err: ${A}`))},WUs),h.pollInterval=setInterval(()=>{this.poll().catch(A=>o.warn(s,`mc poll err: ${A}`))},zUs),o.info(s,`Mission Control enabled for session ${this.sessionId}`,{mcSessionId:f.id,mcTaskId:f.taskId,url:h.frontendUrl}),{url:h.frontendUrl,remoteSteerable:!0}}async disable(){let e=this.state;if(!(!e||e.disposed)){e.pollInterval&&clearInterval(e.pollInterval),e.flushInterval&&clearInterval(e.flushInterval),e.eventListenerDispose?.(),e.eventListenerDispose=void 0,e.toolCallIdToRequestId.clear();try{Xor(this.sdkSession,"session.remote_steerable_changed",{remoteSteerable:!1})}catch(r){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`sdk.emit(remote_steerable_changed=false) failed: ${LZ(r)}`)}e.eventBuffer.push(this.createEvent(e,"session.remote_steerable_changed",{remoteSteerable:!1})),e.eventBuffer.push(this.createEvent(e,"session.idle",{})),await this.flush(),e.disposed=!0,this.remoteCtx.logger.info(this.remoteCtx.ctx,`Mission Control disabled for session ${this.sessionId}`)}}getMcSessionId(){return this.state?.mcSessionId}async deleteRemote(){let e=this.state?.mcSessionId;e&&await this.remoteCtx.client.deleteSession(e)}getStatus(){let e=this.state;return!e||e.disposed?{remoteSteerable:!1}:{url:e.frontendUrl,remoteSteerable:!0}}createEvent(e,r,n,o){let s=(0,yzn.randomUUID)(),c={id:s,timestamp:new Date().toISOString(),parentId:e.lastEventId??null,type:r,data:n,...o!==void 0?{ephemeral:o}:{}};return e.lastEventId=s,c}bufferEvent(e,r){if(!hzn(r))return;mzn(e,r),this.trackInteractionRequestId(e,r),this.maybeAutoDeriveTitle(e,r);let n=r.id,o=r.timestamp,s=r.parentId,c=r.ephemeral;typeof n=="string"&&typeof o=="string"?(e.eventBuffer.push({id:n,timestamp:o,parentId:typeof s=="string"?s:e.lastEventId??null,...typeof c=="boolean"?{ephemeral:c}:{},type:r.type??"unknown",data:Tlr(r)}),e.lastEventId=n):e.eventBuffer.push(this.createEvent(e,r.type??"unknown",Tlr(r))),e.eventBuffer.length>a2e&&e.eventBuffer.splice(0,e.eventBuffer.length-a2e)}maybeAutoDeriveTitle(e,r){if(e.titleSent)return;if(r.type==="session.title_changed"){e.titleSent=!0;return}if(r.type!=="user.message")return;let n=r.data?.content,o=ZUs(typeof n=="string"?n:"");o&&(e.eventBuffer.push(this.createEvent(e,"session.title_changed",{title:o},!0)),e.titleSent=!0)}trackInteractionRequestId(e,r){let n=r.data;if(n)switch(r.type){case"permission.requested":{let o=n.requestId,s=n.permissionRequest?.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"user_input.requested":{let o=n.requestId,s=n.toolCallId;typeof o=="string"&&typeof s=="string"&&this.registerInteractionMapping(e,s,o);return}case"permission.completed":{let o=n.toolCallId;typeof o=="string"&&e.toolCallIdToRequestId.delete(o);return}case"user_input.completed":{let o=n.requestId;if(typeof o=="string"){for(let[s,c]of e.toolCallIdToRequestId)if(c===o){e.toolCallIdToRequestId.delete(s);break}}return}}}registerInteractionMapping(e,r,n){if(e.toolCallIdToRequestId.size>=JUs){let o=e.toolCallIdToRequestId.keys().next().value;o!==void 0&&e.toolCallIdToRequestId.delete(o)}e.toolCallIdToRequestId.set(r,n)}async flush(){let e=this.state;if(!e||e.disposed||e.flushInFlight)return;if(!this.circuitBreaker.canRequest()){e.eventBuffer.length>a2e&&e.eventBuffer.splice(0,e.eventBuffer.length-a2e);return}let r=e.eventBuffer.length>0,n=e.completedCommandIds.length>0,o=!r&&!n&&Date.now()-e.lastSubmitAttemptTimeMs>=YUs;if(!r&&!n&&!o)return;e.flushInFlight=!0;let s=e.completedCommandIds.splice(0),c=e.eventBuffer.splice(0,KUs);e.lastSubmitAttemptTimeMs=Date.now();try{await this.remoteCtx.client.submitEvents(e.mcSessionId,c,s)?this.circuitBreaker.recordSuccess():(this.circuitBreaker.recordFailure(),e.eventBuffer.length+c.length<=a2e&&e.eventBuffer.unshift(...c),e.completedCommandIds.unshift(...s))}finally{e.flushInFlight=!1}}async poll(){let e=this.state;if(!(!e||e.disposed)&&!e.pollInFlight){e.pollInFlight=!0;try{let r=await this.remoteCtx.client.getPendingCommands(e.mcSessionId),n=new Set(r.map(o=>o.id));for(let o of e.processedCommandIds)n.has(o)||e.processedCommandIds.delete(o);for(let o of r){if(o.state!=="in_progress"||e.processedCommandIds.has(o.id))continue;e.processedCommandIds.add(o.id);let s=typeof o.content=="string"?o.content.length>120?o.content.slice(0,120)+"\u2026":o.content:"";this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch start: id=${o.id} type=${o.type??""} preview=${JSON.stringify(s)}`);try{await this.dispatchCommand(e,o),this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc dispatch ok: id=${o.id} type=${o.type??""}`)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc dispatch ${o.type??"user_message"} failed: ${LZ(c)}`)}o.type!==void 0&&o.type!==""&&o.type!=="user_message"&&e.completedCommandIds.push(o.id)}}finally{e.pollInFlight=!1}}}async dispatchCommand(e,r){switch(r.type){case"abort":{await this.sdkSession.abort?.();return}case"permission_response":{let n=Azn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s=n.approved?{kind:n.scope==="session"?"approve-session":"approve-once"}:{kind:"denied-interactively-by-user",...n.feedback?{feedback:n.feedback}:{}};try{this.sdkSession.respondToPermission(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc permission_response forward failed (promptId=${n.promptId}, requestId=${o}): ${LZ(c)}`)}return}case"ask_user_response":{let n=Azn(r.content);if(!n?.promptId)return;let o=e.toolCallIdToRequestId.get(n.promptId)??n.promptId,s={answer:typeof n.answer=="string"?n.answer:"",wasFreeform:n.wasFreeform===!0};try{this.sdkSession.respondToUserInput(o,s)}catch(c){this.remoteCtx.logger.warn(this.remoteCtx.ctx,`mc ask_user_response forward failed (promptId=${n.promptId}, requestId=${o}): ${LZ(c)}`)}return}case"mode_switch":{this.remoteCtx.logger.info(this.remoteCtx.ctx,`mc mode_switch ignored (cmd ${r.id})`);return}default:{await this.remoteCtx.injectUserMessage(this.sessionId,r.content,`command-${r.id}`);return}}}};function Azn(t){try{return JSON.parse(t)}catch{return}}a(Azn,"safeJsonParse");function LZ(t){return t instanceof Error?t.message:String(t)}a(LZ,"errMsg");function ZUs(t){if(!t)return"";let e=t.split(/\r?\n/).map(r=>r.trim()).find(r=>r.length>0);return e?e.length>gzn?e.slice(0,gzn-1).trimEnd()+"\u2026":e:""}a(ZUs,"deriveTitleFromMessage");function XUs(t){if(/^[a-zA-Z]:[\\/]/.test(t)){let r=t[0],n=t.slice(2).replace(/\\/g,"/").replace(/^\/+/,""),o=`/${r.toLowerCase()}:/${n}`,s=`file:///${r.toLowerCase()}%3A/${encodeURI(n).replace(/%2F/g,"/")}`;return{$mid:1,fsPath:t,_sep:1,external:s,path:o,scheme:"file"}}return{$mid:1,fsPath:t,external:`file://${encodeURI(t).replace(/%2F/g,"/")}`,path:t,scheme:"file"}}a(XUs,"toVscodeUriShape");var Ilr=new Ae("BackgroundAgent.RemoteController"),Rat=class{constructor(e,r){this.ctx=e;this.deps=r;this.delegates=new Map}static{a(this,"RemoteController")}attachLazy(e,r){let n=this.delegates.get(e);if(n)return n;let o=this.deps.registry.getWorkingDir(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new Iat(this.ctx,Ilr,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new wat(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:Ilr,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.deps.injectUserMessage(l,u,d),"injectUserMessage")});if(!cjn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.delegates.set(e,c),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")}),c}async enableForSession(e,r){this.attachLazy(e,r);let n=esr(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableForSession(e){let r=esr(e);r&&await r.disable()}getStatus(e){let r=this.delegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}delegateCount(){return this.delegates.size}fireAndForgetTearDown(e){let r=this.delegates.get(e);r&&(this.delegates.delete(e),r.disable().catch(()=>{}))}async tearDownForDestroy(e){let r=this.delegates.get(e);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(n){Ilr.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e,error:n instanceof Error?n.message:String(n)})}this.delegates.delete(e)}}async getMissionControlApiBase(){let n=(await this.ctx.get(Ut).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Fr).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}addDelegateForTesting(e,r){this.delegates.set(e,r),this.deps.registry.registerChild(e,{dispose:a(()=>this.fireAndForgetTearDown(e),"dispose")})}delegatesForTesting(){return this.delegates}};p();p();var xlr=new Ae("BackgroundAgent.CustomAgents");async function Pat(t,e){try{if(Ht(t,Je.EnableCustomAgents)===!1)return xlr.info(t,"Custom agents are disabled by configuration"),[];let o=await t.get($p).listCustomAgents([e]);return o.length>0&&xlr.info(t,`Loaded ${o.length} custom agent(s) for session`),o.map(s=>e7s(s))}catch(r){return xlr.warn(t,"Failed to load custom agents:",r),[]}}a(Pat,"loadCustomAgents");function e7s(t){let e=t.instruction??"";return{name:t.name,displayName:t.name,description:t.description??"",tools:t.tools??null,prompt:a(()=>Promise.resolve(e),"prompt"),disableModelInvocation:!1,model:t.model}}a(e7s,"toSweCustomAgent");p();var wlr=new Ae("BackgroundAgent.Hooks");function Ezn(t,e){return{preToolUse:[t7s(t,e)],postToolUse:[r7s(t,e)],userPromptSubmitted:[n7s(t,e)]}}a(Ezn,"buildSessionHooks");function t7s(t,e){return async r=>{try{let o=await t.get(eE).hook(t,S3,{timestamp:r.timestamp,cwd:kn(e.uri),toolName:r.toolName,toolArgs:_zn(r.toolArgs)},e);for(let s of o){let c=s.output;if(c&&c.permissionDecision===fZe.deny)return{permissionDecision:"deny",permissionDecisionReason:c.permissionDecisionReason||"Tool execution denied by hook"}}return}catch(n){wlr.error(t,`Failed to execute PreToolUse hook for tool ${r.toolName}`,n);return}}}a(t7s,"createPreToolUseHandler");function r7s(t,e){return async r=>{try{await t.get(eE).hook(t,b3,{timestamp:r.timestamp,cwd:kn(e.uri),toolName:r.toolName,toolArgs:_zn(r.toolArgs),toolResult:{resultType:i7s(r.toolResult.resultType),textResultForLlm:r.toolResult.textResultForLlm}},e);return}catch(n){wlr.error(t,`Failed to execute PostToolUse hook for tool ${r.toolName}`,n);return}}}a(r7s,"createPostToolUseHandler");function n7s(t,e){return async r=>{try{await t.get(eE).hook(t,T3,{timestamp:r.timestamp,cwd:kn(e.uri),prompt:r.prompt},e);return}catch(n){wlr.error(t,"Failed to execute UserPromptSubmitted hook",n);return}}}a(n7s,"createUserPromptSubmittedHandler");function _zn(t){if(typeof t=="string")return t;try{return JSON.stringify(t)??""}catch{return""}}a(_zn,"safeStringifyToolArgs");function i7s(t){switch(t){case"success":case"failure":case"denied":return t;case"rejected":return"denied";case"timeout":return"failure";default:return"failure"}}a(i7s,"toClsToolResultType");p();var o7s=["model-agents-md","cwd-model-agents-md"],s7s=["model-claude-md","cwd-model-claude-md"],a7s="nested-agents";function Czn(t){let e=new Set;if(t.useAgentsMdFile===!1)for(let r of o7s)e.add(r);if(t.useClaudeMdFile===!1)for(let r of s7s)e.add(r);return t.useNestedAgentsMdFiles===!1&&e.add(a7s),e}a(Czn,"computeDisabledInstructionSources");var c7s=new Set(["node_modules",".git","vendor","dist","build",".next",".nuxt","out","coverage"]),l7s=2,vzn="CLAUDE.md";function u7s(t,e){if(e.length===0)return t;let r=t.includes("\\")&&!t.includes("/")?"\\":"/";return[t.endsWith("/")||t.endsWith("\\")?t.slice(0,-1):t,...e].join(r)}a(u7s,"joinPath");async function d7s(t,e){let r=[],n=a(async(o,s)=>{let c;try{c=await t(u7s(e,o))}catch{return}for(let[l,u]of c){let d=(u&1)!==0,f=(u&2)!==0;d&&l===vzn&&o.length>0?r.push([...o,vzn].join("/")):f&&s{let n=r.lastIndexOf("/"),o=n===-1?".":r.slice(0,n);return`| ${o}/ | '${r}' | Agent instructions for ${o}/**/* |`})].join(` +`)}a(f7s,"buildNestedClaudeInstructionsSection");async function bzn(t,e){let r=await d7s(t,e);return f7s(r)}a(bzn,"scanNestedClaudeInstructions");function Szn(t){let e=[];if(t.gitCommitInstructions&&e.push(t.gitCommitInstructions),t.globalAgentsMdInstructions&&e.push(t.globalAgentsMdInstructions),t.globalClaudeMdInstructions&&e.push(t.globalClaudeMdInstructions),t.nestedClaudeInstructions&&e.push(t.nestedClaudeInstructions),e.length!==0)return e.join(` + +`)}a(Szn,"composeBackgroundAgentSystemMessage");p();var Tzn=fe(require("node:path"));function Izn(t){let e="";for(let r of t){let n=r.codePointAt(0)??0;n>=32&&n!==127&&(e+=r)}return e.trim()}a(Izn,"sanitizeForPrompt");function p7s(t){let e=t.startsWith("file:")?kn(t):t;return Izn(Tzn.basename(e))}a(p7s,"confinedBasename");function h7s(t){let e=t.startsWith("file:")?kn(t):t;return Izn(e)}a(h7s,"confinedAbsolutePath");function xzn(t){let e=p7s(t),r=h7s(t);return[`You are operating in inline mode for quick, focused code changes. Regardless of any other instructions, you are confined to a single file \u2014 \`${e}\` (absolute path: \`${r}\`) \u2014 and MUST NOT read, create, or modify any other file.`,"Focus on the user's selected code and its immediate context. Make changes grounded directly in the user's prompt: do NOT make changes that are not directly and logically related to it, and do NOT modify code outside the selection unless absolutely necessary for correctness. Keep changes minimal and focused on exactly what was asked.","Be concise: NO wordy explanations, NO progress messages about what you are doing or about to do. Do not ask the user for clarification \u2014 make your best effort.","Note that you may be in inline-ask mode and do not have any edit tools available \u2014 show the code snippet that needs to be changed in a code block. Do not claim to have made edits.",`For edit turns, make all changes in a single invocation of the edit tool \u2014 there is no tool calling loop. Use whichever edit tool you have available (\`edit\`, \`str_replace_editor\`, or \`apply_patch\`) to apply changes to \`${e}\`; follow its schema carefully, include all required properties, and match the existing code exactly. Always use the ABSOLUTE PATH \`${r}\` when supplying a file path or patch header \u2014 never a relative path or bare basename, because the working directory may differ from the project root and a relative path will be denied. If you use \`apply_patch\`, every \`*** Add File\`, \`*** Delete File\`, \`*** Update File\`, and \`*** Move to\` header must spell out the full \`${r}\` \u2014 any patch touching another path will be denied. Never output code to the user instead of editing. Don't repeat yourself after a tool call \u2014 pick up where you left off.`,`You have at most 2 tool-calling turns total. If you need to read the file or check diagnostics, do so in the first turn (e.g. call \`view\` or \`get_errors\` on \`${r}\`). Use the second turn to apply your edit. Do NOT spend additional turns validating or re-reading after editing \u2014 make your best effort in one shot. If you already have the file content and diagnostics in the conversation, skip the first turn and edit immediately. Any tool call beyond the 2-turn limit will be rejected with an error.`,"When the file content is provided in the conversation (in full or as a portion around the cursor), use it directly for your edit \u2014 do NOT re-read it with `view`. If only a portion is shown, line numbers indicate exact positions in the file; use them for your edits. If the user's request targets code outside the shown portion, use `view` to read that part first."].join(` + +`)}a(xzn,"buildInlineSystemPrompt");p();As();var m7s={includeCopilotInstructions:!1,includeGitCommitInstructions:!0,includeAgentsMdInstructions:!1,includeNestedAgentsMdInstructions:!1,includeClaudeMdInstructions:!1,includeNestedClaudeMdInstructions:!1,includeCustomInstructionFiles:!1,customIntroduction:"When generating the commit message, please use the following custom instructions provided by the user."};async function Rlr(t,e){return t.get(ff).getInstructions(t,e,m7s)}a(Rlr,"getGitCommitInstructions");var FZ=class{constructor(){this.lastChanges=[];this.attemptCount=0;this.DEFAULT_TEMPERATURE=.1}static{a(this,"GitCommitGenerateService")}buildSystemMessage(e,r){let n=["You are an AI programming assistant, helping a software developer to come up with the best git commit message for their code changes.","You excel in interpreting the purpose behind code changes to craft succinct, clear commit messages that adhere to the repository's guidelines.","","# First, think step-by-step:","1. Analyze the CODE CHANGES thoroughly to understand what's been modified.","2. Identify the purpose of the changes to answer the *why* for the commit messages, also considering the optionally provided RECENT USER COMMITS.","3. Review the provided RECENT REPOSITORY COMMITS to identify established commit message conventions. Focus on the format and style, ignoring commit-specific details like refs, tags, and authors.","4. Generate a thoughtful and succinct commit message for the given CODE CHANGES. It MUST follow the established writing conventions.","5. Remove any meta information like issue references, tags, or author names from the commit message. The developer will add them.","6. Now only show your message, wrapped with a single markdown ```text codeblock! Do not provide any explanations or details"];return r&&n.push(` Current git branch name: ${r}`),e&&n.push(` Respond in the following locale: ${e}`),n.join(` `)}buildUserMessage(e,r){let n=[];return e.userCommits.length>0&&n.push("# RECENT USER COMMITS (For reference only, do not copy!):",e.userCommits.map(o=>`- ${o}`).join(` `),""),e.recentCommits.length>0&&n.push("# RECENT REPOSITORY COMMITS (For reference only, do not copy!):",e.recentCommits.map(o=>`- ${o}`).join(` `),""),n.push("# CODE CHANGES:",e.changes.join(` `),"","","Now generate a commit message that describes the CODE CHANGES.","DO NOT COPY commits from RECENT COMMITS, but use them as reference for the commit style.","ONLY return a single markdown code block, NO OTHER PROSE!","```text","commit message goes here","```",""),r&&n.push("",r,""),n.join(` -`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;rt!==null&&(typeof t=="object"||typeof t=="function")),ljn=Cl([qe(),Ra().int()]),ujn=qe(),Csf=Yh({ttl:Ra().optional(),pollInterval:Ra().optional()}),u4s=Wr({ttl:Ra().optional()}),d4s=Wr({taskId:qe()}),Kor=Yh({progressToken:ljn.optional(),[Dj]:d4s.optional()}),mT=Wr({_meta:Kor.optional()}),rPe=mT.extend({task:u4s.optional()}),djn=a(t=>rPe.safeParse(t).success,"isTaskAugmentedRequestParams"),RA=Wr({method:qe(),params:mT.loose().optional()}),Tw=Wr({_meta:Kor.optional()}),Iw=Wr({method:qe(),params:Tw.loose().optional()}),kA=Yh({_meta:Kor.optional()}),ast=Cl([qe(),Ra().int()]),fjn=Wr({jsonrpc:Hn(sst),id:ast,...RA.shape}).strict(),nPe=a(t=>fjn.safeParse(t).success,"isJSONRPCRequest"),pjn=Wr({jsonrpc:Hn(sst),...Iw.shape}).strict(),hjn=a(t=>pjn.safeParse(t).success,"isJSONRPCNotification"),Jor=Wr({jsonrpc:Hn(sst),id:ast,result:kA}).strict(),AZ=a(t=>Jor.safeParse(t).success,"isJSONRPCResultResponse");var Xn;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Xn||(Xn={}));var Zor=Wr({jsonrpc:Hn(sst),id:ast.optional(),error:Wr({code:Ra().int(),message:qe(),data:Zu().optional()})}).strict();var mjn=a(t=>Zor.safeParse(t).success,"isJSONRPCErrorResponse");var Nj=Cl([fjn,pjn,Jor,Zor]),vsf=Cl([Jor,Zor]),yZ=kA.strict(),f4s=Tw.extend({requestId:ast.optional(),reason:qe().optional()}),cst=Iw.extend({method:Hn("notifications/cancelled"),params:f4s}),p4s=Wr({src:qe(),mimeType:qe().optional(),sizes:Fr(qe()).optional(),theme:Q_(["light","dark"]).optional()}),iPe=Wr({icons:Fr(p4s).optional()}),Qfe=Wr({name:qe(),title:qe().optional()}),gjn=Qfe.extend({...Qfe.shape,...iPe.shape,version:qe(),websiteUrl:qe().optional(),description:qe().optional()}),h4s=Swe(Wr({applyDefaults:tl().optional()}),vl(qe(),Zu())),m4s=ctt(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Swe(Wr({form:h4s.optional(),url:rm.optional()}),vl(qe(),Zu()).optional())),g4s=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({sampling:Yh({createMessage:rm.optional()}).optional(),elicitation:Yh({create:rm.optional()}).optional()}).optional()}),A4s=Yh({list:rm.optional(),cancel:rm.optional(),requests:Yh({tools:Yh({call:rm.optional()}).optional()}).optional()}),y4s=Wr({experimental:vl(qe(),rm).optional(),sampling:Wr({context:rm.optional(),tools:rm.optional()}).optional(),elicitation:m4s.optional(),roots:Wr({listChanged:tl().optional()}).optional(),tasks:g4s.optional(),extensions:vl(qe(),rm).optional()}),E4s=mT.extend({protocolVersion:qe(),capabilities:y4s,clientInfo:gjn}),_4s=RA.extend({method:Hn("initialize"),params:E4s});var C4s=Wr({experimental:vl(qe(),rm).optional(),logging:rm.optional(),completions:rm.optional(),prompts:Wr({listChanged:tl().optional()}).optional(),resources:Wr({subscribe:tl().optional(),listChanged:tl().optional()}).optional(),tools:Wr({listChanged:tl().optional()}).optional(),tasks:A4s.optional(),extensions:vl(qe(),rm).optional()}),Xor=kA.extend({protocolVersion:qe(),capabilities:C4s,serverInfo:gjn,instructions:qe().optional()}),Ajn=Iw.extend({method:Hn("notifications/initialized"),params:Tw.optional()}),yjn=a(t=>Ajn.safeParse(t).success,"isInitializedNotification"),lst=RA.extend({method:Hn("ping"),params:mT.optional()}),v4s=Wr({progress:Ra(),total:gu(Ra()),message:gu(qe())}),b4s=Wr({...Tw.shape,...v4s.shape,progressToken:ljn}),ust=Iw.extend({method:Hn("notifications/progress"),params:b4s}),S4s=mT.extend({cursor:ujn.optional()}),oPe=RA.extend({params:S4s.optional()}),sPe=kA.extend({nextCursor:ujn.optional()}),T4s=Q_(["working","input_required","completed","failed","cancelled"]),aPe=Wr({taskId:qe(),status:T4s,ttl:Cl([Ra(),rtt()]),createdAt:qe(),lastUpdatedAt:qe(),pollInterval:gu(Ra()),statusMessage:gu(qe())}),EZ=kA.extend({task:aPe}),I4s=Tw.merge(aPe),cPe=Iw.extend({method:Hn("notifications/tasks/status"),params:I4s}),dst=RA.extend({method:Hn("tasks/get"),params:mT.extend({taskId:qe()})}),fst=kA.merge(aPe),pst=RA.extend({method:Hn("tasks/result"),params:mT.extend({taskId:qe()})}),bsf=kA.loose(),hst=oPe.extend({method:Hn("tasks/list")}),mst=sPe.extend({tasks:Fr(aPe)}),gst=RA.extend({method:Hn("tasks/cancel"),params:mT.extend({taskId:qe()})}),Ejn=kA.merge(aPe),_jn=Wr({uri:qe(),mimeType:gu(qe()),_meta:vl(qe(),Zu()).optional()}),Cjn=_jn.extend({text:qe()}),esr=qe().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),vjn=_jn.extend({blob:esr}),lPe=Q_(["user","assistant"]),qfe=Wr({audience:Fr(lPe).optional(),priority:Ra().min(0).max(1).optional(),lastModified:Oue.datetime({offset:!0}).optional()}),bjn=Wr({...Qfe.shape,...iPe.shape,uri:qe(),description:gu(qe()),mimeType:gu(qe()),size:gu(Ra()),annotations:qfe.optional(),_meta:gu(Yh({}))}),x4s=Wr({...Qfe.shape,...iPe.shape,uriTemplate:qe(),description:gu(qe()),mimeType:gu(qe()),annotations:qfe.optional(),_meta:gu(Yh({}))}),w4s=oPe.extend({method:Hn("resources/list")}),tsr=sPe.extend({resources:Fr(bjn)}),R4s=oPe.extend({method:Hn("resources/templates/list")}),rsr=sPe.extend({resourceTemplates:Fr(x4s)}),nsr=mT.extend({uri:qe()}),k4s=nsr,P4s=RA.extend({method:Hn("resources/read"),params:k4s}),isr=kA.extend({contents:Fr(Cl([Cjn,vjn]))}),TF=Iw.extend({method:Hn("notifications/resources/list_changed"),params:Tw.optional()}),D4s=nsr,N4s=RA.extend({method:Hn("resources/subscribe"),params:D4s}),M4s=nsr,O4s=RA.extend({method:Hn("resources/unsubscribe"),params:M4s}),B4s=Tw.extend({uri:qe()}),osr=Iw.extend({method:Hn("notifications/resources/updated"),params:B4s}),L4s=Wr({name:qe(),description:gu(qe()),required:gu(tl())}),F4s=Wr({...Qfe.shape,...iPe.shape,description:gu(qe()),arguments:gu(Fr(L4s)),_meta:gu(Yh({}))}),U4s=oPe.extend({method:Hn("prompts/list")}),ssr=sPe.extend({prompts:Fr(F4s)}),Q4s=mT.extend({name:qe(),arguments:vl(qe(),qe()).optional()}),q4s=RA.extend({method:Hn("prompts/get"),params:Q4s}),asr=Wr({type:Hn("text"),text:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),csr=Wr({type:Hn("image"),data:esr,mimeType:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),lsr=Wr({type:Hn("audio"),data:esr,mimeType:qe(),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),j4s=Wr({type:Hn("tool_use"),name:qe(),id:qe(),input:vl(qe(),Zu()),_meta:vl(qe(),Zu()).optional()}),H4s=Wr({type:Hn("resource"),resource:Cl([Cjn,vjn]),annotations:qfe.optional(),_meta:vl(qe(),Zu()).optional()}),G4s=bjn.extend({type:Hn("resource_link")}),usr=Cl([asr,csr,lsr,G4s,H4s]),$4s=Wr({role:lPe,content:usr}),dsr=kA.extend({description:qe().optional(),messages:Fr($4s)}),IF=Iw.extend({method:Hn("notifications/prompts/list_changed"),params:Tw.optional()}),V4s=Wr({title:qe().optional(),readOnlyHint:tl().optional(),destructiveHint:tl().optional(),idempotentHint:tl().optional(),openWorldHint:tl().optional()}),W4s=Wr({taskSupport:Q_(["required","optional","forbidden"]).optional()}),Sjn=Wr({...Qfe.shape,...iPe.shape,description:qe().optional(),inputSchema:Wr({type:Hn("object"),properties:vl(qe(),rm).optional(),required:Fr(qe()).optional()}).catchall(Zu()),outputSchema:Wr({type:Hn("object"),properties:vl(qe(),rm).optional(),required:Fr(qe()).optional()}).catchall(Zu()).optional(),annotations:V4s.optional(),execution:W4s.optional(),_meta:vl(qe(),Zu()).optional()}),z4s=oPe.extend({method:Hn("tools/list")}),fsr=sPe.extend({tools:Fr(Sjn)}),Mj=kA.extend({content:Fr(usr).default([]),structuredContent:vl(qe(),Zu()).optional(),isError:tl().optional()}),Ssf=Mj.or(kA.extend({toolResult:Zu()})),Y4s=rPe.extend({name:qe(),arguments:vl(qe(),Zu()).optional()}),K4s=RA.extend({method:Hn("tools/call"),params:Y4s}),xF=Iw.extend({method:Hn("notifications/tools/list_changed"),params:Tw.optional()}),Tjn=Wr({autoRefresh:tl().default(!0),debounceMs:Ra().int().nonnegative().default(300)}),Ijn=Q_(["debug","info","notice","warning","error","critical","alert","emergency"]),J4s=mT.extend({level:Ijn}),Z4s=RA.extend({method:Hn("logging/setLevel"),params:J4s}),X4s=Tw.extend({level:Ijn,logger:qe().optional(),data:Zu()}),_Z=Iw.extend({method:Hn("notifications/message"),params:X4s}),eBs=Wr({name:qe().optional()}),tBs=Wr({hints:Fr(eBs).optional(),costPriority:Ra().min(0).max(1).optional(),speedPriority:Ra().min(0).max(1).optional(),intelligencePriority:Ra().min(0).max(1).optional()}),rBs=Wr({mode:Q_(["auto","required","none"]).optional()}),nBs=Wr({type:Hn("tool_result"),toolUseId:qe().describe("The unique identifier for the corresponding tool call."),content:Fr(usr).default([]),structuredContent:Wr({}).loose().optional(),isError:tl().optional(),_meta:vl(qe(),Zu()).optional()}),iBs=stt("type",[asr,csr,lsr]),ist=stt("type",[asr,csr,lsr,j4s,nBs]),oBs=Wr({role:lPe,content:Cl([ist,Fr(ist)]),_meta:vl(qe(),Zu()).optional()}),sBs=rPe.extend({messages:Fr(oBs),modelPreferences:tBs.optional(),systemPrompt:qe().optional(),includeContext:Q_(["none","thisServer","allServers"]).optional(),temperature:Ra().optional(),maxTokens:Ra().int(),stopSequences:Fr(qe()).optional(),metadata:rm.optional(),tools:Fr(Sjn).optional(),toolChoice:rBs.optional()}),uPe=RA.extend({method:Hn("sampling/createMessage"),params:sBs}),psr=kA.extend({model:qe(),stopReason:gu(Q_(["endTurn","stopSequence","maxTokens"]).or(qe())),role:lPe,content:iBs}),hsr=kA.extend({model:qe(),stopReason:gu(Q_(["endTurn","stopSequence","maxTokens","toolUse"]).or(qe())),role:lPe,content:Cl([ist,Fr(ist)])}),aBs=Wr({type:Hn("boolean"),title:qe().optional(),description:qe().optional(),default:tl().optional()}),cBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),minLength:Ra().optional(),maxLength:Ra().optional(),format:Q_(["email","uri","date","date-time"]).optional(),default:qe().optional()}),lBs=Wr({type:Q_(["number","integer"]),title:qe().optional(),description:qe().optional(),minimum:Ra().optional(),maximum:Ra().optional(),default:Ra().optional()}),uBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),enum:Fr(qe()),default:qe().optional()}),dBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),oneOf:Fr(Wr({const:qe(),title:qe()})),default:qe().optional()}),fBs=Wr({type:Hn("string"),title:qe().optional(),description:qe().optional(),enum:Fr(qe()),enumNames:Fr(qe()).optional(),default:qe().optional()}),pBs=Cl([uBs,dBs]),hBs=Wr({type:Hn("array"),title:qe().optional(),description:qe().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:Wr({type:Hn("string"),enum:Fr(qe())}),default:Fr(qe()).optional()}),mBs=Wr({type:Hn("array"),title:qe().optional(),description:qe().optional(),minItems:Ra().optional(),maxItems:Ra().optional(),items:Wr({anyOf:Fr(Wr({const:qe(),title:qe()}))}),default:Fr(qe()).optional()}),gBs=Cl([hBs,mBs]),ABs=Cl([fBs,pBs,gBs]),yBs=Cl([ABs,aBs,cBs,lBs]),EBs=rPe.extend({mode:Hn("form").optional(),message:qe(),requestedSchema:Wr({type:Hn("object"),properties:vl(qe(),yBs),required:Fr(qe()).optional()})}),_Bs=rPe.extend({mode:Hn("url"),message:qe(),elicitationId:qe(),url:qe().url()}),CBs=Cl([EBs,_Bs]),dPe=RA.extend({method:Hn("elicitation/create"),params:CBs}),vBs=Tw.extend({elicitationId:qe()}),bBs=Iw.extend({method:Hn("notifications/elicitation/complete"),params:vBs}),msr=kA.extend({action:Q_(["accept","decline","cancel"]),content:ctt(t=>t===null?void 0:t,vl(qe(),Cl([qe(),Ra(),tl(),Fr(qe())])).optional())}),SBs=Wr({type:Hn("ref/resource"),uri:qe()});var TBs=Wr({type:Hn("ref/prompt"),name:qe()}),IBs=mT.extend({ref:Cl([TBs,SBs]),argument:Wr({name:qe(),value:qe()}),context:Wr({arguments:vl(qe(),qe()).optional()}).optional()}),xBs=RA.extend({method:Hn("completion/complete"),params:IBs});var gsr=kA.extend({completion:Yh({values:Fr(qe()).max(100),total:gu(Ra().int()),hasMore:gu(tl())})}),wBs=Wr({uri:qe().startsWith("file://"),name:qe().optional(),_meta:vl(qe(),Zu()).optional()}),Asr=RA.extend({method:Hn("roots/list"),params:mT.optional()}),RBs=kA.extend({roots:Fr(wBs)}),kBs=Iw.extend({method:Hn("notifications/roots/list_changed"),params:Tw.optional()}),Tsf=Cl([lst,_4s,xBs,Z4s,q4s,U4s,w4s,R4s,P4s,N4s,O4s,K4s,z4s,dst,pst,hst,gst]),Isf=Cl([cst,ust,Ajn,kBs,cPe]),xsf=Cl([yZ,psr,hsr,msr,RBs,fst,mst,EZ]),wsf=Cl([lst,uPe,dPe,Asr,dst,pst,hst,gst]),Rsf=Cl([cst,ust,_Z,osr,TF,xF,IF,cPe,bBs]),ksf=Cl([yZ,Xor,gsr,dsr,ssr,tsr,rsr,isr,Mj,fsr,fst,mst,EZ]),Ln=class t extends Error{static{a(this,"McpError")}constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Xn.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Yor(o.elicitations,r)}return new t(e,r,n)}},Yor=class extends Ln{static{a(this,"UrlElicitationRequiredError")}constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Xn.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var r2=new ge("mcpGateway"),pPe="Copilot MCP Gateway",hPe="0.1.0",fPe=class{constructor(e,r,n,o){this.id=e;this._ctx=r;this._invoker=n;this._onDidDispose=o;this._sseClients=new Set;this._lastEventId=0;this._isInitialized=!1;this._disposed=!1;this._onToolsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/tools/list_changed"}),this._onResourcesListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/resources/list_changed"}),this._onPromptsListChanged=()=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/prompts/list_changed"}),this._onLoggingMessage=s=>this._broadcastIfReady({jsonrpc:"2.0",method:"notifications/message",params:s.params}),this._invoker.on(Hl.ToolsListChanged,this._onToolsListChanged),this._invoker.on(Hl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.on(Hl.PromptsListChanged,this._onPromptsListChanged),this._invoker.on(Hl.LoggingMessage,this._onLoggingMessage)}static{a(this,"McpGatewaySession")}attachSseClient(e){if(this._disposed){e.writeHead(410),e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive"}),e.write(`: connected - -`),this._sseClients.add(e),r2.debug(this._ctx,`[session ${this.id}] SSE client attached (total: ${this._sseClients.size})`),e.on("close",()=>{this._sseClients.delete(e),r2.debug(this._ctx,`[session ${this.id}] SSE client detached (total: ${this._sseClients.size})`)})}async handleIncoming(e){let r=Array.isArray(e)?e:[e],n=[];for(let o of r)nst(o)?n.push(await this._dispatchRequest(o)):cjn(o)?this._dispatchNotification(o):r2.warn(this._ctx,`[session ${this.id}] ignored unsupported inbound frame`);return n}dispose(){if(!this._disposed){this._disposed=!0,r2.info(this._ctx,`[session ${this.id}] disposing (SSE clients: ${this._sseClients.size})`);for(let e of this._sseClients)e.destroyed||e.end();this._sseClients.clear(),this._invoker.off(Hl.ToolsListChanged,this._onToolsListChanged),this._invoker.off(Hl.ResourcesListChanged,this._onResourcesListChanged),this._invoker.off(Hl.PromptsListChanged,this._onPromptsListChanged),this._invoker.off(Hl.LoggingMessage,this._onLoggingMessage),this._onDidDispose()}}async _dispatchRequest(e){r2.debug(this._ctx,`[session ${this.id}] <-- request: ${e.method} (id=${String(e.id)})`);try{let r=await this._handleRequest(e);return{jsonrpc:"2.0",id:e.id,result:r}}catch(r){return r instanceof vw?{jsonrpc:"2.0",id:e.id,error:{code:r.code,message:r.message,data:r.data}}:(r2.error(this._ctx,`[session ${this.id}] request '${e.method}' failed`,r),{jsonrpc:"2.0",id:e.id,error:{code:bw.InternalError,message:r instanceof Error?r.message:String(r)}})}}async _handleRequest(e){if(e.method==="initialize")return this._handleInitialize(e);if(!this._isInitialized)throw new vw(bw.InvalidRequest,"Session is not initialized");switch(e.method){case"ping":return{};case"tools/list":return this._invoker.listTools();case"tools/call":return this._handleCallTool(e);case"resources/list":return this._invoker.listResources();case"resources/read":return this._handleReadResource(e);case"resources/templates/list":return this._invoker.listResourceTemplates();case"prompts/list":return this._invoker.listPrompts();case"prompts/get":return this._handleGetPrompt(e);case"logging/setLevel":return this._handleSetLoggingLevel(e);default:throw new vw(bw.MethodNotFound,`Method not found: ${e.method}`)}}_handleInitialize(e){let r=e.params&&typeof e.params=="object"?e.params:void 0,n=typeof r?.protocolVersion=="string"?r.protocolVersion:void 0,o=r?.clientInfo,s=n&&ost.includes(n)?n:Sw;return r2.info(this._ctx,`[session ${this.id}] initialize: client=${o?.name??"unknown"}/${o?.version??"?"}, clientProtocol=${n??"(none)"}, negotiated=${s}`),n&&n!==s&&r2.warn(this._ctx,`[session ${this.id}] unsupported client protocol version '${n}', falling back to '${s}'`),{protocolVersion:s,capabilities:{tools:{listChanged:!0},resources:{listChanged:!0},prompts:{listChanged:!0},logging:{}},serverInfo:{name:pPe,version:hPe}}}_handleCallTool(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(bw.InvalidParams,"Missing tool name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.callTool(r.name,n)}_handleReadResource(e){let r=this._requireObjectParams(e);if(typeof r.uri!="string")throw new vw(bw.InvalidParams,"Missing resource uri");return this._invoker.readResource(r.uri)}_handleGetPrompt(e){let r=this._requireObjectParams(e);if(typeof r.name!="string")throw new vw(bw.InvalidParams,"Missing prompt name");let n=r.arguments&&typeof r.arguments=="object"?r.arguments:{};return this._invoker.getPrompt(r.name,n)}async _handleSetLoggingLevel(e){let r=this._requireObjectParams(e);if(typeof r.level!="string")throw new vw(bw.InvalidParams,"Missing logging level");return await this._invoker.setLoggingLevel({level:r.level}),{}}_requireObjectParams(e){if(!e.params||typeof e.params!="object")throw new vw(bw.InvalidParams,"Missing params");return e.params}_dispatchNotification(e){r2.debug(this._ctx,`[session ${this.id}] <-- notification: ${e.method}`),e.method==="notifications/initialized"&&(this._isInitialized=!0,r2.info(this._ctx,`[session ${this.id}] initialized`))}_broadcastIfReady(e){!this._isInitialized||this._disposed||this._broadcast(e)}_broadcast(e){if(this._sseClients.size===0){r2.debug(this._ctx,`[session ${this.id}] no SSE clients, dropping ${e.method}`);return}let r=JSON.stringify(e),n=String(++this._lastEventId),o=r.split(/\r?\n/g),s=[`id: ${n}`,"event: message",...o.map(c=>`data: ${c}`),"",""].join(` -`);for(let c of[...this._sseClients]){if(c.destroyed||c.writableEnded){this._sseClients.delete(c);continue}c.write(s)}}};function xjn(t){let e=Array.isArray(t)?t[0]:t;return!!e&&typeof e.method=="string"&&e.method==="initialize"}a(xjn,"isInitializeMessage");var ysr=require("crypto"),wjn=require("events"),Rjn=ce(require("http"));var Oj=new ge("mcpGateway"),PBs="mcp-session-id",DBs=1024*1024,NBs=5e3,Ast={Ready:"ready",Unauthorized:"unauthorized",Error:"error"},CZ={MountsChanged:"mountsChanged"},Bj=class{constructor(e,r={}){this._routes=new Map;this._idToRouteId=new Map;this._emitter=new wjn.EventEmitter;this._connections=new Set;this._ctx=e,this._host=r.host??"127.0.0.1"}static{a(this,"McpGatewayService")}get port(){return this._port}listMounts(){let e=[];for(let[r,n]of this._routes)e.push(this._buildMountInfo(n.invoker.id,n.label,r,n.status));return e}setMountStatus(e,r){let n=this._idToRouteId.get(e);if(!n)return;let o=this._routes.get(n);if(!o||o.status===r)return;let s=o.status;o.status=r,Oj.info(this._ctx,`mount '${o.label}' (${e}) status -> ${r}`),gt(this._ctx,"mcpGateway.mount.statusChanged",{from:s,to:r}),this._emitter.emit(CZ.MountsChanged,this.listMounts())}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}async registerMount(e,r,n=Ast.Ready){if(await this._ensureServer(),this._port===void 0)throw new Error("Gateway server failed to start");if(this._idToRouteId.get(e.id))throw new Error(`Mount already registered for id '${e.id}'`);let s=(0,ysr.randomUUID)(),c=r??e.label;this._routes.set(s,{invoker:e,label:c,sessions:new Map,status:n}),this._idToRouteId.set(e.id,s);let l=this._buildMountInfo(e.id,c,s,n);return Oj.info(this._ctx,`registered mount '${c}' (${e.id}) at ${l.url} [${n}]`),gt(this._ctx,"mcpGateway.mount.registered",{status:n}),this._emitter.emit(CZ.MountsChanged,this.listMounts()),l}unregisterMount(e){let r=this._idToRouteId.get(e);if(!r)return;let n=this._routes.get(r);if(n){for(let o of n.sessions.values())o.dispose();n.sessions.clear(),this._routes.delete(r),this._idToRouteId.delete(e),Oj.info(this._ctx,`unregistered mount '${n.label}' (${e})`),gt(this._ctx,"mcpGateway.mount.unregistered",{finalStatus:n.status}),this._emitter.emit(CZ.MountsChanged,this.listMounts())}}dispose(){for(let e of this._routes.values()){for(let r of e.sessions.values())r.dispose();e.sessions.clear()}this._routes.clear(),this._idToRouteId.clear(),this._stopServer()}async _ensureServer(){if(!this._server?.listening){if(this._startPromise)return this._startPromise;this._startPromise=this._startServer();try{await this._startPromise}finally{this._startPromise=void 0}}}_startServer(){return new Promise((e,r)=>{let n=Rjn.createServer((s,c)=>this._handleRequest(s,c));n.requestTimeout=0,this._server=n,n.on("connection",s=>{this._connections.add(s),s.on("close",()=>this._connections.delete(s))});let o=setTimeout(()=>r(new Error("Gateway listen timeout")),NBs);n.once("listening",()=>{let s=n.address();s&&typeof s=="object"&&(this._port=s.port),clearTimeout(o),Oj.info(this._ctx,`listening on http://${this._host}:${this._port}`),e()}),n.on("error",s=>{if(s.code==="EADDRINUSE"){n.listen(0,this._host);return}clearTimeout(o),r(s)}),n.listen(0,this._host)})}_stopServer(){if(this._server){Oj.info(this._ctx,"stopping HTTP server");for(let e of this._connections)e.destroy();this._connections.clear(),this._server.close(),this._server=void 0,this._port=void 0}}_handleRequest(e,r){let o=new URL(e.url??"/",`http://${e.headers.host??"127.0.0.1"}`).pathname.split("/").filter(Boolean);if(o.length<2||o[1]!=="mcp"){this._respondHttpError(r,404,"Not found");return}let s=o[0],c=this._routes.get(s);if(!c){this._respondHttpError(r,404,"Mount not found");return}if(e.method==="POST"){this._handlePost(c,e,r);return}if(e.method==="GET"){this._handleGet(c,e,r);return}if(e.method==="DELETE"){this._handleDelete(c,e,r);return}this._respondHttpError(r,405,"Method not allowed")}async _handlePost(e,r,n){let o=await this._readBody(r);if(o===void 0){this._respondHttpError(n,413,"Payload too large");return}let s;try{s=JSON.parse(o)}catch(u){let d={jsonrpc:"2.0",id:null,error:{code:bw.ParseError,message:u instanceof Error?u.message:String(u)}};n.writeHead(400,{"Content-Type":"application/json"}),n.end(JSON.stringify(d));return}let c=this._getSessionId(r),l=this._resolveSession(e,c,s,n);if(l)try{let u=await l.handleIncoming(s),d={"Content-Type":"application/json","Mcp-Session-Id":l.id};if(u.length===0||!this._hasRequest(s)){n.writeHead(202,d),n.end();return}let f=JSON.stringify(Array.isArray(s)?u:u[0]);n.writeHead(200,d),n.end(f)}catch(u){Oj.error(this._ctx,"POST handler failed",u),this._respondHttpError(n,500,"Internal server error")}}_handleGet(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.attachSseClient(n)}_handleDelete(e,r,n){let o=this._getSessionId(r);if(!o){this._respondHttpError(n,400,"Missing Mcp-Session-Id header");return}let s=e.sessions.get(o);if(!s){this._respondHttpError(n,404,"Session not found");return}s.dispose(),n.writeHead(204),n.end()}_resolveSession(e,r,n,o){if(r){let l=e.sessions.get(r);if(!l){this._respondHttpError(o,404,"Session not found");return}return l}if(!xjn(n)){this._respondHttpError(o,400,"Missing Mcp-Session-Id header");return}let s=(0,ysr.randomUUID)(),c=new fPe(s,this._ctx,e.invoker,()=>{e.sessions.delete(s)&&Oj.info(this._ctx,`mount '${e.label}' session detached (sid=${s}, active sessions: ${e.sessions.size})`)});return e.sessions.set(s,c),Oj.info(this._ctx,`mount '${e.label}' session attached (sid=${s}, active sessions: ${e.sessions.size})`),c}_hasRequest(e){return(Array.isArray(e)?e:[e]).some(nst)}_getSessionId(e){let r=e.headers[PBs];return Array.isArray(r)?r[0]:r}async _readBody(e){let r=[],n=0;for await(let o of e){let s=Buffer.isBuffer(o)?o:Buffer.from(o);if(n+=s.byteLength,n>DBs)return;r.push(s)}return Buffer.concat(r).toString("utf8")}_respondHttpError(e,r,n){e.writeHead(r,{"Content-Type":"application/json"});let o={jsonrpc:"2.0",id:null,error:{code:r,message:n}};e.end(JSON.stringify(o))}_buildMountInfo(e,r,n,o){return{id:e,label:r,routeId:n,url:`http://${this._host}:${this._port}/${n}/mcp`,status:o}}};var n2=class{static{a(this,"McpGatewayHost")}constructor(e,r){this._service=r}get service(){return this._service}buildMcpServers(){let e={};for(let r of this._service.listMounts())r.status===Ast.Ready&&(e[r.id]={type:"http",url:r.url,tools:["*"]});return e}async dispose(){}};p();p();p();var Esr;Esr=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto);async function MBs(t){return(await Esr).getRandomValues(new Uint8Array(t))}a(MBs,"getRandomValues");async function OBs(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await MBs(t);for(let o=0;o128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await BBs(t),r=await LBs(e);return{code_verifier:e,code_challenge:r}}a(_sr,"pkceChallenge");p();var PA=oYt().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:PYt.custom,message:"URL must be parseable",fatal:!0}),Lxe}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Pjn=Yh({resource:qe().url(),authorization_servers:Fr(PA).optional(),jwks_uri:qe().url().optional(),scopes_supported:Fr(qe()).optional(),bearer_methods_supported:Fr(qe()).optional(),resource_signing_alg_values_supported:Fr(qe()).optional(),resource_name:qe().optional(),resource_documentation:qe().optional(),resource_policy_uri:qe().url().optional(),resource_tos_uri:qe().url().optional(),tls_client_certificate_bound_access_tokens:tl().optional(),authorization_details_types_supported:Fr(qe()).optional(),dpop_signing_alg_values_supported:Fr(qe()).optional(),dpop_bound_access_tokens_required:tl().optional()}),Csr=Yh({issuer:qe(),authorization_endpoint:PA,token_endpoint:PA,registration_endpoint:PA.optional(),scopes_supported:Fr(qe()).optional(),response_types_supported:Fr(qe()),response_modes_supported:Fr(qe()).optional(),grant_types_supported:Fr(qe()).optional(),token_endpoint_auth_methods_supported:Fr(qe()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),service_documentation:PA.optional(),revocation_endpoint:PA.optional(),revocation_endpoint_auth_methods_supported:Fr(qe()).optional(),revocation_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),introspection_endpoint:qe().optional(),introspection_endpoint_auth_methods_supported:Fr(qe()).optional(),introspection_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),code_challenge_methods_supported:Fr(qe()).optional(),client_id_metadata_document_supported:tl().optional()}),FBs=Yh({issuer:qe(),authorization_endpoint:PA,token_endpoint:PA,userinfo_endpoint:PA.optional(),jwks_uri:PA,registration_endpoint:PA.optional(),scopes_supported:Fr(qe()).optional(),response_types_supported:Fr(qe()),response_modes_supported:Fr(qe()).optional(),grant_types_supported:Fr(qe()).optional(),acr_values_supported:Fr(qe()).optional(),subject_types_supported:Fr(qe()),id_token_signing_alg_values_supported:Fr(qe()),id_token_encryption_alg_values_supported:Fr(qe()).optional(),id_token_encryption_enc_values_supported:Fr(qe()).optional(),userinfo_signing_alg_values_supported:Fr(qe()).optional(),userinfo_encryption_alg_values_supported:Fr(qe()).optional(),userinfo_encryption_enc_values_supported:Fr(qe()).optional(),request_object_signing_alg_values_supported:Fr(qe()).optional(),request_object_encryption_alg_values_supported:Fr(qe()).optional(),request_object_encryption_enc_values_supported:Fr(qe()).optional(),token_endpoint_auth_methods_supported:Fr(qe()).optional(),token_endpoint_auth_signing_alg_values_supported:Fr(qe()).optional(),display_values_supported:Fr(qe()).optional(),claim_types_supported:Fr(qe()).optional(),claims_supported:Fr(qe()).optional(),service_documentation:qe().optional(),claims_locales_supported:Fr(qe()).optional(),ui_locales_supported:Fr(qe()).optional(),claims_parameter_supported:tl().optional(),request_parameter_supported:tl().optional(),request_uri_parameter_supported:tl().optional(),require_request_uri_registration:tl().optional(),op_policy_uri:PA.optional(),op_tos_uri:PA.optional(),client_id_metadata_document_supported:tl().optional()}),Djn=Wr({...FBs.shape,...Csr.pick({code_challenge_methods_supported:!0}).shape}),Njn=Wr({access_token:qe(),id_token:qe().optional(),token_type:qe(),expires_in:Twe.number().optional(),scope:qe().optional(),refresh_token:qe().optional()}).strip(),Mjn=Wr({error:qe(),error_description:qe().optional(),error_uri:qe().optional()}),kjn=PA.optional().or(Hn("").transform(()=>{})),UBs=Wr({redirect_uris:Fr(PA),token_endpoint_auth_method:qe().optional(),grant_types:Fr(qe()).optional(),response_types:Fr(qe()).optional(),client_name:qe().optional(),client_uri:PA.optional(),logo_uri:kjn,scope:qe().optional(),contacts:Fr(qe()).optional(),tos_uri:kjn,policy_uri:qe().optional(),jwks_uri:PA.optional(),jwks:vYt().optional(),software_id:qe().optional(),software_version:qe().optional(),software_statement:qe().optional()}).strip(),QBs=Wr({client_id:qe(),client_secret:qe().optional(),client_id_issued_at:Ra().optional(),client_secret_expires_at:Ra().optional()}).strip(),Ojn=UBs.merge(QBs),faf=Wr({error:qe(),error_description:qe().optional()}).strip(),paf=Wr({token:qe(),token_type_hint:qe().optional()}).strip();p();function Bjn(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}a(Bjn,"resourceUrlFromServerUrl");function Ljn({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length=400&&t.status<500&&e!=="/"}a(KBs,"shouldAttemptFallback");async function JBs(t,e,r,n){let o=new URL(t),s=n?.protocolVersion??Sw,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let u=YBs(e,o.pathname);c=new URL(u,n?.metadataServerUrl??o),c.search=o.search}let l=await Ujn(c,s,r);if(!n?.metadataUrl&&KBs(l,o.pathname)){let u=new URL(`/.well-known/${e}`,o);l=await Ujn(u,s,r)}return l}a(JBs,"discoverMetadataWithFallback");function ZBs(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let o=e.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${o}`,e.origin),type:"oidc"}),n.push({url:new URL(`${o}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}a(ZBs,"buildDiscoveryUrls");async function jjn(t,{fetchFn:e=fetch,protocolVersion:r=Sw}={}){let n={"MCP-Protocol-Version":r,Accept:"application/json"},o=ZBs(t);for(let{url:s,type:c}of o){let l=await Isr(s,n,e);if(l){if(!l.ok){if(await l.body?.cancel(),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${c==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}return c==="oauth"?Csr.parse(await l.json()):Djn.parse(await l.json())}}}a(jjn,"discoverAuthorizationServerMetadata");async function XBs(t,e){let r,n;try{r=await qjn(t,{resourceMetadataUrl:e?.resourceMetadataUrl},e?.fetchFn),r.authorization_servers&&r.authorization_servers.length>0&&(n=r.authorization_servers[0])}catch{}n||(n=String(new URL("/",t)));let o=await jjn(n,{fetchFn:e?.fetchFn});return{authorizationServerUrl:n,authorizationServerMetadata:o,resourceMetadata:r}}a(XBs,"discoverOAuthServerInfo");async function eLs(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:o,state:s,resource:c}){let l;if(e){if(l=new URL(e.authorization_endpoint),!e.response_types_supported.includes(vsr))throw new Error(`Incompatible auth server: does not support response type ${vsr}`);if(e.code_challenge_methods_supported&&!e.code_challenge_methods_supported.includes(bsr))throw new Error(`Incompatible auth server: does not support code challenge method ${bsr}`)}else l=new URL("/authorize",t);let u=await _sr(),d=u.code_verifier,f=u.code_challenge;return l.searchParams.set("response_type",vsr),l.searchParams.set("client_id",r.client_id),l.searchParams.set("code_challenge",f),l.searchParams.set("code_challenge_method",bsr),l.searchParams.set("redirect_uri",String(n)),s&&l.searchParams.set("state",s),o&&l.searchParams.set("scope",o),o?.includes("offline_access")&&l.searchParams.append("prompt","consent"),c&&l.searchParams.set("resource",c.href),{authorizationUrl:l,codeVerifier:d}}a(eLs,"startAuthorization");function tLs(t,e,r){return new URLSearchParams({grant_type:"authorization_code",code:t,code_verifier:e,redirect_uri:String(r)})}a(tLs,"prepareAuthorizationCodeRequest");async function Hjn(t,{metadata:e,tokenRequestParams:r,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c}){let l=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t),u=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&r.set("resource",s.href),o)await o(u,r,l,e);else if(n){let f=e?.token_endpoint_auth_methods_supported??[],h=jBs(n,f);HBs(h,n,u,r)}let d=await(c??fetch)(l,{method:"POST",headers:u,body:r});if(!d.ok)throw await Qjn(d);return Njn.parse(await d.json())}a(Hjn,"executeTokenRequest");async function rLs(t,{metadata:e,clientInformation:r,refreshToken:n,resource:o,addClientAuthentication:s,fetchFn:c}){let l=new URLSearchParams({grant_type:"refresh_token",refresh_token:n}),u=await Hjn(t,{metadata:e,tokenRequestParams:l,clientInformation:r,addClientAuthentication:s,resource:o,fetchFn:c});return{refresh_token:n,...u}}a(rLs,"refreshAuthorization");async function nLs(t,e,{metadata:r,resource:n,authorizationCode:o,fetchFn:s}={}){let c=t.clientMetadata.scope,l;if(t.prepareTokenRequest&&(l=await t.prepareTokenRequest(c)),!l){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!t.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");let d=await t.codeVerifier();l=tLs(o,d,t.redirectUrl)}let u=await t.clientInformation();return Hjn(e,{metadata:r,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:t.addClientAuthentication,resource:n,fetchFn:s})}a(nLs,"fetchToken");async function iLs(t,{metadata:e,clientMetadata:r,scope:n,fetchFn:o}){let s;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(e.registration_endpoint)}else s=new URL("/register",t);let c=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...r,...n!==void 0?{scope:n}:{}})});if(!c.ok)throw await Qjn(c);return Ojn.parse(await c.json())}a(iLs,"registerClient");p();p();p();p();function Hfe(t){return!!t._zod}a(Hfe,"isZ4Schema");function i2(t,e){return Hfe(t)?xue(t,e):t.safeParse(e)}a(i2,"safeParse");function yst(t){if(!t)return;let e;if(Hfe(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}a(yst,"getObjectShape");function Gjn(t){if(Hfe(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}a(Gjn,"getLiteralValue");p();function Lj(t){return t==="completed"||t==="failed"||t==="cancelled"}a(Lj,"isTerminal");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();var Kcf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();p();function xsr(t){let r=yst(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=Gjn(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}a(xsr,"getMethodLiteral");function wsr(t,e){let r=i2(t,e);if(!r.success)throw r.error;return r.data}a(wsr,"parseWithCompat");var uLs=6e4,Est=class{static{a(this,"Protocol")}constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(cst,r=>{this._oncancel(r)}),this.setNotificationHandler(ust,r=>{this._onprogress(r)}),this.setRequestHandler(lst,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(dst,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(pst,async(r,n)=>{let o=a(async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(l.type==="response"||l.type==="error"){let u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{let h=u,m=new Ln(h.error.code,h.error.message,h.error.data);f(m)}else{let h=l.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${d}`))}continue}await this._transport?.send(l.message,{relatedRequestId:n.requestId})}}let c=await this._taskStore.getTask(s,n.sessionId);if(!c)throw new Ln(Xn.InvalidParams,`Task not found: ${s}`);if(!Lj(c.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(Lj(c.status)){let l=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Dj]:{taskId:s}}}}return await o()},"handleTaskResult");return await o()}),this.setRequestHandler(hst,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new Ln(Xn.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(gst,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Ln(Xn.InvalidParams,`Task not found: ${r.params.taskId}`);if(Lj(o.status))throw new Ln(Xn.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Ln(Xn.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Ln?o:new Ln(Xn.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),Ln.fromError(Xn.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,c)=>{o?.(s,c),AZ(s)||mjn(s)?this._onresponse(s):nPe(s)?this._onrequest(s,c):hjn(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Ln.fromError(Xn.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[Dj]?.taskId;if(n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:Xn.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(e.id,c);let l=djn(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,d={signal:c.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:a(async f=>{if(c.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},"sendNotification"),sendRequest:a(async(f,h,m)=>{if(c.signal.aborted)throw new Ln(Xn.ConnectionClosed,"Request was cancelled");let g={...m,relatedRequestId:e.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});let A=g.relatedTask?.taskId??s;return A&&u&&await u.updateTaskStatus(A,"input_required"),await this.request(f,h,g)},"sendRequest"),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:u,taskRequestedTtl:l?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{l&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,d)).then(async f=>{if(c.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(c.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:Xn.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===c&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let c=this._responseHandlers.get(o),l=this._timeoutInfo.get(o);if(l&&c&&l.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(u){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),c(u);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),AZ(e))n(e);else{let c=new Ln(e.error.code,e.error.message,e.error.data);n(c)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(AZ(e)&&e.result&&typeof e.result=="object"){let c=e.result;if(c.task&&typeof c.task=="object"){let l=c.task;typeof l.taskId=="string"&&(s=!0,this._taskProgressTokens.set(l.taskId,r))}}if(s||this._progressHandlers.delete(r),AZ(e))o(e);else{let c=Ln.fromError(e.error.code,e.error.message,e.error.data);o(c)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(c){yield{type:"error",error:c instanceof Ln?c:new Ln(Xn.InternalError,String(c))}}return}let s;try{let c=await this.request(e,EZ,n);if(c.task)s=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new Ln(Xn.InternalError,"Task creation did not return a task");for(;;){let l=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:l},Lj(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:l.status==="failed"?yield{type:"error",error:new Ln(Xn.InternalError,`Task ${s} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new Ln(Xn.InternalError,`Task ${s} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let u=l.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(d=>setTimeout(d,u)),n?.signal?.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof Ln?c:new Ln(Xn.InternalError,String(c))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c,task:l,relatedTask:u}=n??{};return new Promise((d,f)=>{let h=a(v=>{f(v)},"earlyReject");if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),l&&this.assertTaskCapability(e.method)}catch(v){h(v);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),l&&(g.params={...g.params,task:l}),u&&(g.params={...g.params,_meta:{...g.params?._meta||{},[Dj]:u}});let A=a(v=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(T=>this._onerror(new Error(`Failed to send cancellation: ${T}`)));let b=v instanceof Ln?v:new Ln(Xn.RequestTimeout,String(v));f(b)},"cancel");this._responseHandlers.set(m,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return f(v);try{let b=i2(r,v.result);b.success?d(b.data):f(b.error)}catch(b){f(b)}}}),n?.signal?.addEventListener("abort",()=>{A(n?.signal?.reason)});let y=n?.timeout??uLs,E=a(()=>A(Ln.fromError(Xn.RequestTimeout,"Request timed out",{timeout:y})),"timeoutHandler");this._setupTimeout(m,y,n?.maxTotalTimeout,E,n?.resetTimeoutOnProgress??!1);let _=u?.taskId;if(_){let v=a(b=>{let T=this._responseHandlers.get(m);T?T(b):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))},"responseResolver");this._requestResolvers.set(m,v),this._enqueueTaskMessage(_,{type:"request",message:g,timestamp:Date.now()}).catch(b=>{this._cleanupTimeout(m),f(b)})}else this._transport.send(g,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:c}).catch(v=>{this._cleanupTimeout(m),f(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},fst,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},mst,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Ejn,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let l={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Dj]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:l,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let l={...e,jsonrpc:"2.0"};r?.relatedTask&&(l={...l,params:{...l.params,_meta:{...l.params?._meta||{},[Dj]:r.relatedTask}}}),this._transport?.send(l,r).catch(u=>this._onerror(u))});return}let c={...e,jsonrpc:"2.0"};r?.relatedTask&&(c={...c,params:{...c.params,_meta:{...c.params?._meta||{},[Dj]:r.relatedTask}}}),await this._transport.send(c,r)}setRequestHandler(e,r){let n=xsr(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let c=wsr(e,o);return Promise.resolve(r(c,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=xsr(e);this._notificationHandlers.set(n,o=>{let s=wsr(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&nPe(o.message)){let s=o.message.id,c=this._requestResolvers.get(s);c?(c(new Ln(Xn.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new Ln(Xn.InvalidRequest,"Request cancelled"));return}let c=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(c),s(new Ln(Xn.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:a(async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},"createTask"),getTask:a(async o=>{let s=await n.getTask(o,r);if(!s)throw new Ln(Xn.InvalidParams,"Failed to retrieve task: Task not found");return s},"getTask"),storeTaskResult:a(async(o,s,c)=>{await n.storeTaskResult(o,s,c,r);let l=await n.getTask(o,r);if(l){let u=cPe.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Lj(l.status)&&this._cleanupTaskProgressHandler(o)}},"storeTaskResult"),getTaskResult:a(o=>n.getTaskResult(o,r),"getTaskResult"),updateTaskStatus:a(async(o,s,c)=>{let l=await n.getTask(o,r);if(!l)throw new Ln(Xn.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Lj(l.status))throw new Ln(Xn.InvalidParams,`Cannot update task "${o}" from terminal status "${l.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,c,r);let u=await n.getTask(o,r);if(u){let d=cPe.parse({method:"notifications/tasks/status",params:u});await this.notification(d),Lj(u.status)&&this._cleanupTaskProgressHandler(o)}},"updateTaskStatus"),listTasks:a(o=>n.listTasks(o,r),"listTasks")}}};function $jn(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}a($jn,"isPlainObject");function Vjn(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let c=r[o];$jn(c)&&$jn(s)?r[o]={...c,...s}:r[o]=s}return r}a(Vjn,"mergeCapabilities");p();var L$n=ce(mcr(),1),F$n=ce(B$n(),1);function pUs(){let t=new L$n.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,F$n.default)(t),t}a(pUs,"createDefaultAjvInstance");var eat=class{static{a(this,"AjvJsonSchemaValidator")}constructor(e){this._ajv=e??pUs()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};p();var tat=class{static{a(this,"ExperimentalClientTasks")}constructor(e){this._client=e}async*callToolStream(e,r=Mj,n){let o=this._client,s={...n,task:n?.task??(o.isToolTask(e.name)?{}:void 0)},c=o.requestStream({method:"tools/call",params:e},r,s),l=o.getToolOutputValidator(e.name);for await(let u of c){if(u.type==="result"&&l){let d=u.result;if(!d.structuredContent&&!d.isError){yield{type:"error",error:new Ln(Xn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(d.structuredContent)try{let f=l(d.structuredContent);if(!f.valid){yield{type:"error",error:new Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${f.errorMessage}`)};return}}catch(f){if(f instanceof Ln){yield{type:"error",error:f};return}yield{type:"error",error:new Ln(Xn.InvalidParams,`Failed to validate structured content: ${f instanceof Error?f.message:String(f)}`)};return}}yield u}}async getTask(e,r){return this._client.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._client.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._client.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._client.cancelTask({taskId:e},r)}requestStream(e,r,n){return this._client.requestStream(e,r,n)}};p();function U$n(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}a(U$n,"assertToolsCallTaskCapability");function Q$n(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}a(Q$n,"assertClientRequestTaskCapability");function rat(t,e){if(!(!t||e===null||typeof e!="object")){if(t.type==="object"&&t.properties&&typeof t.properties=="object"){let r=e,n=t.properties;for(let o of Object.keys(n)){let s=n[o];r[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(r[o]=s.default),r[o]!==void 0&&rat(s,r[o])}}if(Array.isArray(t.anyOf))for(let r of t.anyOf)typeof r!="boolean"&&rat(r,e);if(Array.isArray(t.oneOf))for(let r of t.oneOf)typeof r!="boolean"&&rat(r,e)}}a(rat,"applyElicitationDefaults");function hUs(t){if(!t)return{supportsFormMode:!1,supportsUrlMode:!1};let e=t.form!==void 0,r=t.url!==void 0;return{supportsFormMode:e||!e&&!r,supportsUrlMode:r}}a(hUs,"getSupportedElicitationModes");var Vj=class extends Est{static{a(this,"Client")}constructor(e,r){super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=r?.capabilities??{},this._jsonSchemaValidator=r?.jsonSchemaValidator??new eat,r?.listChanged&&(this._pendingListChangedConfig=r.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",xF,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",IF,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",TF,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new tat(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Vjn(this._capabilities,e)}setRequestHandler(e,r){let o=yst(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(Hfe(o)){let l=o;s=l._zod?.def?.value??l.value}else{let l=o;s=l._def?.value??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");let c=s;if(c==="elicitation/create"){let l=a(async(u,d)=>{let f=i2(dPe,u);if(!f.success){let v=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid elicitation request: ${v}`)}let{params:h}=f.data;h.mode=h.mode??"form";let{supportsFormMode:m,supportsUrlMode:g}=hUs(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new Ln(Xn.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new Ln(Xn.InvalidParams,"Client does not support URL-mode elicitation requests");let A=await Promise.resolve(r(u,d));if(h.task){let v=i2(EZ,A);if(!v.success){let b=v.error instanceof Error?v.error.message:String(v.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${b}`)}return v.data}let y=i2(msr,A);if(!y.success){let v=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.InvalidParams,`Invalid elicitation result: ${v}`)}let E=y.data,_=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&E.action==="accept"&&E.content&&_&&this._capabilities.elicitation?.form?.applyDefaults)try{rat(_,E.content)}catch{}return E},"wrappedHandler");return super.setRequestHandler(e,l)}if(c==="sampling/createMessage"){let l=a(async(u,d)=>{let f=i2(uPe,u);if(!f.success){let E=f.error instanceof Error?f.error.message:String(f.error);throw new Ln(Xn.InvalidParams,`Invalid sampling request: ${E}`)}let{params:h}=f.data,m=await Promise.resolve(r(u,d));if(h.task){let E=i2(EZ,m);if(!E.success){let _=E.error instanceof Error?E.error.message:String(E.error);throw new Ln(Xn.InvalidParams,`Invalid task creation result: ${_}`)}return E.data}let A=h.tools||h.toolChoice?hsr:psr,y=i2(A,m);if(!y.success){let E=y.error instanceof Error?y.error.message:String(y.error);throw new Ln(Xn.InvalidParams,`Invalid sampling result: ${E}`)}return y.data},"wrappedHandler");return super.setRequestHandler(e,l)}return super.setRequestHandler(e,r)}assertCapability(e,r){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:Sw,capabilities:this._capabilities,clientInfo:this._clientInfo}},Xor,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!ost.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break;case"ping":break}}assertTaskCapability(e){U$n(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&Q$n(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},yZ,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},gsr,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},yZ,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},dsr,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},ssr,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},tsr,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},rsr,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},isr,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},yZ,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},yZ,r)}async callTool(e,r=Mj,n){if(this.isToolTaskRequired(e.name))throw new Ln(Xn.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let o=await this.request({method:"tools/call",params:e},r,n),s=this.getToolOutputValidator(e.name);if(s){if(!o.structuredContent&&!o.isError)throw new Ln(Xn.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{let c=s(o.structuredContent);if(!c.valid)throw new Ln(Xn.InvalidParams,`Structured content does not match the tool's output schema: ${c.errorMessage}`)}catch(c){throw c instanceof Ln?c:new Ln(Xn.InvalidParams,`Failed to validate structured content: ${c instanceof Error?c.message:String(c)}`)}}return o}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let r of e){if(r.outputSchema){let o=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,o)}let n=r.execution?.taskSupport;(n==="required"||n==="optional")&&this._cachedKnownTaskTools.add(r.name),n==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},fsr,r);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,r,n,o){let s=Tjn.safeParse(n);if(!s.success)throw new Error(`Invalid ${e} listChanged options: ${s.error.message}`);if(typeof n.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:c,debounceMs:l}=s.data,{onChanged:u}=n,d=a(async()=>{if(!c){u(null,null);return}try{let h=await o();u(null,h)}catch(h){let m=h instanceof Error?h:new Error(String(h));u(m,null)}},"refresh"),f=a(()=>{if(l){let h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);let m=setTimeout(d,l);this._listChangedDebounceTimers.set(e,m)}else d()},"handler");this.setNotificationHandler(r,f)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};p();p();p();var nat=class extends Error{static{a(this,"ParseError")}constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}};function bcr(t){}a(bcr,"noop");function iat(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=bcr,onError:r=bcr,onRetry:n=bcr,onComment:o}=t,s="",c=!0,l,u="",d="";function f(y){let E=c?y.replace(/^\xEF\xBB\xBF/,""):y,[_,v]=mUs(`${s}${E}`);for(let b of _)h(b);s=v,c=!1}a(f,"feed");function h(y){if(y===""){g();return}if(y.startsWith(":")){o&&o(y.slice(y.startsWith(": ")?2:1));return}let E=y.indexOf(":");if(E!==-1){let _=y.slice(0,E),v=y[E+1]===" "?2:1,b=y.slice(E+v);m(_,b,y);return}m(y,"",y)}a(h,"parseLine");function m(y,E,_){switch(y){case"event":d=E;break;case"data":u=`${u}${E} -`;break;case"id":l=E.includes("\0")?void 0:E;break;case"retry":/^\d+$/.test(E)?n(parseInt(E,10)):r(new nat(`Invalid \`retry\` value: "${E}"`,{type:"invalid-retry",value:E,line:_}));break;default:r(new nat(`Unknown field "${y.length>20?`${y.slice(0,20)}\u2026`:y}"`,{type:"unknown-field",field:y,value:E,line:_}));break}}a(m,"processField");function g(){u.length>0&&e({id:l,event:d||void 0,data:u.endsWith(` -`)?u.slice(0,-1):u}),l=void 0,u="",d=""}a(g,"dispatchEvent");function A(y={}){s&&y.consume&&h(s),c=!0,l=void 0,u="",d="",s=""}return a(A,"reset"),{feed:f,reset:A}}a(iat,"createParser");function mUs(t){let e=[],r="",n=0;for(;n{throw TypeError(t)},"__typeError"),Dcr=a((t,e,r)=>e.has(t)||H$n("Cannot "+r),"__accessCheck"),Xs=a((t,e,r)=>(Dcr(t,e,"read from private field"),r?r.call(t):e.get(t)),"__privateGet"),nm=a((t,e,r)=>e.has(t)?H$n("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),"__privateAdd"),Ud=a((t,e,r,n)=>(Dcr(t,e,"write to private field"),e.set(t,r),r),"__privateSet"),OF=a((t,e,r)=>(Dcr(t,e,"access private method"),r),"__privateMethod"),db,LZ,cpe,oat,aat,o2e,dpe,s2e,Wj,lpe,fpe,upe,n2e,u2,Tcr,Icr,xcr,j$n,wcr,Rcr,i2e,kcr,Pcr,FZ=class extends EventTarget{static{a(this,"EventSource")}constructor(e,r){var n,o;super(),nm(this,u2),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,nm(this,db),nm(this,LZ),nm(this,cpe),nm(this,oat),nm(this,aat),nm(this,o2e),nm(this,dpe),nm(this,s2e,null),nm(this,Wj),nm(this,lpe),nm(this,fpe,null),nm(this,upe,null),nm(this,n2e,null),nm(this,Icr,async s=>{var c;Xs(this,lpe).reset();let{body:l,redirected:u,status:d,headers:f}=s;if(d===204){OF(this,u2,i2e).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(u?Ud(this,cpe,new URL(s.url)):Ud(this,cpe,void 0),d!==200){OF(this,u2,i2e).call(this,`Non-200 status code (${d})`,d);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){OF(this,u2,i2e).call(this,'Invalid content type, expected "text/event-stream"',d);return}if(Xs(this,db)===this.CLOSED)return;Ud(this,db,this.OPEN);let h=new Event("open");if((c=Xs(this,n2e))==null||c.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){OF(this,u2,i2e).call(this,"Invalid response body, expected a web ReadableStream",d),this.close();return}let m=new TextDecoder,g=l.getReader(),A=!0;do{let{done:y,value:E}=await g.read();E&&Xs(this,lpe).feed(m.decode(E,{stream:!y})),y&&(A=!1,Xs(this,lpe).reset(),OF(this,u2,kcr).call(this))}while(A)}),nm(this,xcr,s=>{Ud(this,Wj,void 0),!(s.name==="AbortError"||s.type==="aborted")&&OF(this,u2,kcr).call(this,Scr(s))}),nm(this,wcr,s=>{typeof s.id=="string"&&Ud(this,s2e,s.id);let c=new MessageEvent(s.event||"message",{data:s.data,origin:Xs(this,cpe)?Xs(this,cpe).origin:Xs(this,LZ).origin,lastEventId:s.id||""});Xs(this,upe)&&(!s.event||s.event==="message")&&Xs(this,upe).call(this,c),this.dispatchEvent(c)}),nm(this,Rcr,s=>{Ud(this,o2e,s)}),nm(this,Pcr,()=>{Ud(this,dpe,void 0),Xs(this,db)===this.CONNECTING&&OF(this,u2,Tcr).call(this)});try{if(e instanceof URL)Ud(this,LZ,e);else if(typeof e=="string")Ud(this,LZ,new URL(e,AUs()));else throw new Error("Invalid URL")}catch{throw gUs("An invalid or illegal string was specified")}Ud(this,lpe,iat({onEvent:Xs(this,wcr),onRetry:Xs(this,Rcr)})),Ud(this,db,this.CONNECTING),Ud(this,o2e,3e3),Ud(this,aat,(n=r?.fetch)!=null?n:globalThis.fetch),Ud(this,oat,(o=r?.withCredentials)!=null?o:!1),OF(this,u2,Tcr).call(this)}get readyState(){return Xs(this,db)}get url(){return Xs(this,LZ).href}get withCredentials(){return Xs(this,oat)}get onerror(){return Xs(this,fpe)}set onerror(e){Ud(this,fpe,e)}get onmessage(){return Xs(this,upe)}set onmessage(e){Ud(this,upe,e)}get onopen(){return Xs(this,n2e)}set onopen(e){Ud(this,n2e,e)}addEventListener(e,r,n){let o=r;super.addEventListener(e,o,n)}removeEventListener(e,r,n){let o=r;super.removeEventListener(e,o,n)}close(){Xs(this,dpe)&&clearTimeout(Xs(this,dpe)),Xs(this,db)!==this.CLOSED&&(Xs(this,Wj)&&Xs(this,Wj).abort(),Ud(this,db,this.CLOSED),Ud(this,Wj,void 0))}};db=new WeakMap,LZ=new WeakMap,cpe=new WeakMap,oat=new WeakMap,aat=new WeakMap,o2e=new WeakMap,dpe=new WeakMap,s2e=new WeakMap,Wj=new WeakMap,lpe=new WeakMap,fpe=new WeakMap,upe=new WeakMap,n2e=new WeakMap,u2=new WeakSet,Tcr=a(function(){Ud(this,db,this.CONNECTING),Ud(this,Wj,new AbortController),Xs(this,aat)(Xs(this,LZ),OF(this,u2,j$n).call(this)).then(Xs(this,Icr)).catch(Xs(this,xcr))},"connect_fn"),Icr=new WeakMap,xcr=new WeakMap,j$n=a(function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Xs(this,s2e)?{"Last-Event-ID":Xs(this,s2e)}:void 0},cache:"no-store",signal:(t=Xs(this,Wj))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},"getRequestOptions_fn"),wcr=new WeakMap,Rcr=new WeakMap,i2e=a(function(t,e){var r;Xs(this,db)!==this.CLOSED&&Ud(this,db,this.CLOSED);let n=new sat("error",{code:e,message:t});(r=Xs(this,fpe))==null||r.call(this,n),this.dispatchEvent(n)},"failConnection_fn"),kcr=a(function(t,e){var r;if(Xs(this,db)===this.CLOSED)return;Ud(this,db,this.CONNECTING);let n=new sat("error",{code:e,message:t});(r=Xs(this,fpe))==null||r.call(this,n),this.dispatchEvent(n),Ud(this,dpe,setTimeout(Xs(this,Pcr),Xs(this,o2e)))},"scheduleReconnect_fn"),Pcr=new WeakMap,FZ.CONNECTING=0,FZ.OPEN=1,FZ.CLOSED=2;function AUs(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}a(AUs,"getBaseURL");p();function ppe(t){return t?t instanceof Headers?Object.fromEntries(t.entries()):Array.isArray(t)?Object.fromEntries(t):{...t}:{}}a(ppe,"normalizeHeaders");function cat(t=fetch,e){return e?async(r,n)=>{let o={...e,...n,headers:n?.headers?{...ppe(e.headers),...ppe(n.headers)}:e.headers};return t(r,o)}:t}a(cat,"createFetchWithInit");var a2e=class extends Error{static{a(this,"SseError")}constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},hpe=class{static{a(this,"SSEClientTransport")}constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=cat(r?.fetch,r?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new DA("No auth provider");let e;try{e=await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new DA;return await this._startOrAuth()}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=ppe(this._requestInit?.headers);return new Headers({...e,...r})}_startOrAuth(){let e=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((r,n)=>{this._eventSource=new FZ(this._url.href,{...this._eventSourceInit,fetch:a(async(o,s)=>{let c=await this._commonHeaders();c.set("Accept","text/event-stream");let l=await e(o,{...s,headers:c});if(l.status===401&&l.headers.has("www-authenticate")){let{resourceMetadataUrl:u,scope:d}=jfe(l);this._resourceMetadataUrl=u,this._scope=d}return l},"fetch")}),this._abortController=new AbortController,this._eventSource.onerror=o=>{if(o.code===401&&this._authProvider){this._authThenStart().then(r,n);return}let s=new a2e(o.code,o.message,o);n(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",o=>{let s=o;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(c){n(c),this.onerror?.(c),this.close();return}r()}),this._eventSource.onmessage=o=>{let s=o,c;try{c=Nj.parse(JSON.parse(s.data))}catch(l){this.onerror?.(l);return}this.onmessage?.(c)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new DA("No auth provider");if(await RF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(e){if(!this._endpoint)throw new Error("Not connected");try{let r=await this._commonHeaders();r.set("content-type","application/json");let n={...this._requestInit,method:"POST",headers:r,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._endpoint,n);if(!o.ok){let s=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){let{resourceMetadataUrl:c,scope:l}=jfe(o);if(this._resourceMetadataUrl=c,this._scope=l,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA;return this.send(e)}throw new Error(`Error POSTing to endpoint (HTTP ${o.status}): ${s}`)}await o.body?.cancel()}catch(r){throw this.onerror?.(r),r}}setProtocolVersion(e){this._protocolVersion=e}};p();p();var lat=class extends TransformStream{static{a(this,"EventSourceParserStream")}constructor({onError:e,onRetry:r,onComment:n}={}){let o;super({start(s){o=iat({onEvent:a(c=>{s.enqueue(c)},"onEvent"),onError(c){e==="terminate"?s.error(c):typeof e=="function"&&e(c)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}};var yUs={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Pw=class extends Error{static{a(this,"StreamableHTTPError")}constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},mpe=class{static{a(this,"StreamableHTTPClientTransport")}constructor(e,r){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._fetchWithInit=cat(r?.fetch,r?.requestInit),this._sessionId=r?.sessionId,this._reconnectionOptions=r?.reconnectionOptions??yUs}async _authThenStart(){if(!this._authProvider)throw new DA("No auth provider");let e;try{e=await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw this.onerror?.(r),r}if(e!=="AUTHORIZED")throw new DA;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(e.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(e["mcp-session-id"]=this._sessionId),this._protocolVersion&&(e["mcp-protocol-version"]=this._protocolVersion);let r=ppe(this._requestInit?.headers);return new Headers({...e,...r})}async _startOrAuthSse(e){let{resumptionToken:r}=e;try{let n=await this._commonHeaders();n.set("Accept","text/event-stream"),r&&n.set("last-event-id",r);let o=await(this._fetch??fetch)(this._url,{method:"GET",headers:n,signal:this._abortController?.signal});if(!o.ok){if(await o.body?.cancel(),o.status===401&&this._authProvider)return await this._authThenStart();if(o.status===405)return;throw new Pw(o.status,`Failed to open SSE stream: ${o.statusText}`)}this._handleSseStream(o.body,e,!0)}catch(n){throw this.onerror?.(n),n}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),o)}_scheduleReconnection(e,r=0){let n=this._reconnectionOptions.maxRetries;if(r>=n){this.onerror?.(new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:o,replayMessageId:s}=r,c,l=!1,u=!1;a(async()=>{try{let f=e.pipeThrough(new TextDecoderStream).pipeThrough(new lat({onRetry:a(g=>{this._serverRetryMs=g},"onRetry")})).getReader();for(;;){let{value:g,done:A}=await f.read();if(A)break;if(g.id&&(c=g.id,l=!0,o?.(g.id)),!!g.data&&(!g.event||g.event==="message"))try{let y=Nj.parse(JSON.parse(g.data));AZ(y)&&(u=!0,s!==void 0&&(y.id=s)),this.onmessage?.(y)}catch(y){this.onerror?.(y)}}(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(f){if(this.onerror?.(new Error(`SSE stream disconnected: ${f}`)),(n||l)&&!u&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:o,replayMessageId:s},0)}catch(g){this.onerror?.(new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}},"processStream")()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new DA("No auth provider");if(await RF(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(e,r){try{let{resumptionToken:n,onresumptiontoken:o}=r||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:nPe(e)?e.id:void 0}).catch(m=>this.onerror?.(m));return}let s=await this._commonHeaders();s.set("content-type","application/json"),s.set("accept","application/json, text/event-stream");let c={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(e),signal:this._abortController?.signal},l=await(this._fetch??fetch)(this._url,c),u=l.headers.get("mcp-session-id");if(u&&(this._sessionId=u),!l.ok){let m=await l.text().catch(()=>null);if(l.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Pw(401,"Server returned 401 after successful authentication");let{resourceMetadataUrl:g,scope:A}=jfe(l);if(this._resourceMetadataUrl=g,this._scope=A,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new DA;return this._hasCompletedAuthFlow=!0,this.send(e)}if(l.status===403&&this._authProvider){let{resourceMetadataUrl:g,scope:A,error:y}=jfe(l);if(y==="insufficient_scope"){let E=l.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Pw(403,"Server returned 403 after trying upscoping");if(A&&(this._scope=A),g&&(this._resourceMetadataUrl=g),this._lastUpscopingHeader=E??void 0,await RF(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new DA;return this.send(e)}}throw new Pw(l.status,`Error POSTing to endpoint: ${m}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,l.status===202){await l.body?.cancel(),yjn(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>this.onerror?.(m));return}let f=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,h=l.headers.get("content-type");if(f)if(h?.includes("text/event-stream"))this._handleSseStream(l.body,{onresumptiontoken:o},!1);else if(h?.includes("application/json")){let m=await l.json(),g=Array.isArray(m)?m.map(A=>Nj.parse(A)):[Nj.parse(m)];for(let A of g)this.onmessage?.(A)}else throw await l.body?.cancel(),new Pw(-1,`Unexpected content type: ${h}`);else await l.body?.cancel()}catch(n){throw this.onerror?.(n),n}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),r={...this._requestInit,method:"DELETE",headers:e,signal:this._abortController?.signal},n=await(this._fetch??fetch)(this._url,r);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Pw(n.status,`Failed to terminate session: ${n.statusText}`);this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,r){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:r?.onresumptiontoken})}};var V$n=require("events");var gpe=class extends Error{static{a(this,"HttpInvokerUnauthorizedError")}constructor(e="Upstream MCP server requires authorization"){super(e),this.name="HttpInvokerUnauthorizedError"}},c2e=class{constructor(e){this._transport=null;this._emitter=new V$n.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._effectiveType=e.type,this._emitter.setMaxListeners(0),this._client=new Vj({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"HttpInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;this._effectiveType=this._options.type;let e=!1,r=this._options.authProvider?["none","silent","interactive"]:["none"],n;for(let o=0;o{}),this._transport=null,!e&&s==="none"&&this._effectiveType==="http"){let u=EUs(l);if(u!==void 0){e=!0,this._effectiveType="sse",this._options.onFallback?.({fromCode:u}),o--;continue}}if(!G$n(l))throw l}}throw G$n(n)?new gpe:n instanceof Error?n:new Error("HttpInvoker.start exhausted retries without a recoverable error")}async _connectOnce(e){let r=new URL(this._options.url),n=this._effectiveType==="sse"?new hpe(r,$$n(this._options.sseOptions,e)):new mpe(r,$$n(this._options.httpOptions,e));this._transport=n,this._client.onerror=o=>this._options.onError?.(o),this._client.onclose=()=>{this._connected=!1},this._client.setNotificationHandler(xF,()=>{this._emitter.emit(Hl.ToolsListChanged)}),this._client.setNotificationHandler(TF,()=>{this._emitter.emit(Hl.ResourcesListChanged)}),this._client.setNotificationHandler(IF,()=>{this._emitter.emit(Hl.PromptsListChanged)}),this._client.setNotificationHandler(_Z,o=>{this._emitter.emit(Hl.LoggingMessage,o)}),await this._client.connect(n)}async stop(){if(!this._transport){this._connected=!1;return}this._transport=null,await this._client.close().catch(()=>{}),this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};function G$n(t){if(t instanceof DA)return!0;if(!t||typeof t!="object")return!1;let e=t;return e.name==="UnauthorizedError"||e.status===401||e.code===401}a(G$n,"isUnauthorized");function EUs(t){if(!t||typeof t!="object")return;let e=t;if(!(t instanceof Pw||e.name==="StreamableHTTPError"))return;let n=typeof e.code=="number"?e.code:typeof e.status=="number"?e.status:void 0;if(!(n===void 0||n===401||n<400||n>=500))return n}a(EUs,"httpFallbackCode");function $$n(t,e){if(!e)return t;let r={...t?.requestInit??{}},n=new Headers(r.headers);return n.set("Authorization",`Bearer ${e}`),r.headers=Object.fromEntries(n.entries()),{...t,requestInit:r}}a($$n,"withBearer");p();p();p();p();p();var d2=class{static{a(this,"McpRuntimeNotifier")}},uat=class extends d2{static{a(this,"NoOpMcpRuntimeNotifier")}async notifyLog(e){}};var ir=new ge("CopilotMCP");async function Ncr(t,e){await t.get(d2).notifyLog(e)}a(Ncr,"notifyMCPRuntimeLog");async function im(t,e){await Ncr(t,{...e,level:"error"})}a(im,"notifyMCPRuntimeError");async function UZ(t,e){await Ncr(t,{...e,level:"warning"})}a(UZ,"notifyMCPRuntimeWarning");async function sc(t,e){await Ncr(t,{...e,level:"info"})}a(sc,"notifyMCPRuntimeInfo");p();async function QZ(t,e,r,n,o){return await t.get(ar).fetch(new URL(e).href,{method:r,headers:n,body:o})}a(QZ,"fetchOauthServer");async function Mcr(t){try{return await t.text()}catch{return t.statusText}}a(Mcr,"getErrText");p();var W$n="/.well-known",Ocr=`${W$n}/oauth-protected-resource`,z$n=`${W$n}/oauth-authorization-server`,Y$n=" ";function K$n(t){return typeof t!="object"||t===null?!1:t.resource!==void 0}a(K$n,"isAuthorizationProtectedResourceMetadata");function J$n(t){return typeof t!="object"||t===null?!1:t.issuer!==void 0}a(J$n,"isAuthorizationServerMetadata");function dat(t){let e=t.split(" "),r=e[0],n={};return e.length>1&&e.slice(1).join(" ").split(",").forEach(s=>{let[c,l]=s.split("=").map(u=>u.trim().replace(/"/g,""));n[c]=l}),{scheme:r,params:n}}a(dat,"parseWWWAuthenticateHeader");function Z$n(t){let e=new URL(t.issuer);return{...t,authorization_endpoint:t.authorization_endpoint??new URL("/authorize",e).toString(),token_endpoint:t.token_endpoint??new URL("/token",e).toString(),registration_endpoint:t.registration_endpoint??new URL("/register",e).toString()}}a(Z$n,"getMetadataWithDefaultValues");function X$n(t){return{issuer:t.toString(),authorization_endpoint:new URL("/authorize",t).toString(),token_endpoint:new URL("/token",t).toString(),registration_endpoint:new URL("/register",t).toString(),response_types_supported:["code","id_token","id_token token"]}}a(X$n,"getDefaultMetadataForUrl");function eVn(t){let e=new URL(t);if(!e.pathname.startsWith(Ocr))throw new Error(`Invalid discovery URL: expected path to start with ${Ocr}`);let r=e.pathname.substring(Ocr.length),n=new URL(e.origin);return n.pathname=r||"/",n.toString()}a(eVn,"getResourceServerBaseUrlFromDiscoveryUrl");function tVn(t){return typeof t!="object"||t===null?!1:t.client_id!==void 0}a(tVn,"isAuthorizationDynamicClientRegistrationResponse");function fat(t){if(typeof t!="object"||t===null)return!1;let e=t;return e.access_token!==void 0&&e.token_type!==void 0}a(fat,"isAuthorizationTokenResponse");function Bcr(t){let e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT token format: token must have three parts separated by dots");let[r,n,o]=e;try{if(typeof JSON.parse(FHt(r))!="object")throw new Error("Invalid JWT token format: header is not a JSON object");let c=JSON.parse(FHt(n));if(typeof c!="object")throw new Error("Invalid JWT token format: payload is not a JSON object");return c}catch(s){throw s instanceof Error?new Error(`Failed to parse JWT token: ${s.message}`):new Error("Failed to parse JWT token")}}a(Bcr,"getClaimsFromJWT");var Lcr=class{static{a(this,"AuthMetadata")}},Ape=class extends Lcr{static{a(this,"MCPAuthMetadata")}constructor(e){super(),this.ctx=e}async getMetadataFromOriginalUrl(e,r){let n=await this.getResourceMetadataChallenge(e),o,s,c,l=await this.getResourceMetadata(n,{url:e,headers:r??{}});l.resource&&(o=l.authorization_servers?.[0],s=l.scopes_supported,c=l);let u=new URL(e).origin,d={};o||(o=u,d=r??{});let f;try{let m=await this.getAuthorizationServerMetadata(o,d),g=Z$n(m);return f={authorizationServer:o,serverMetadata:g,resourceMetadata:c},ir.info(this.ctx,"authMetadata",f),f}catch(m){ir.warn(this.ctx,`Error populating auth metadata: ${String(m)}`)}let h=X$n(new URL(u));return h.scopes_supported=s??h.scopes_supported??[],f={authorizationServer:o,serverMetadata:h,resourceMetadata:c},f}async getResourceMetadataChallenge(e){let r=await QZ(this.ctx,e,"POST"),n;if(r.status===401&&r.headers.has("WWW-Authenticate")){let o=r.headers.get("WWW-Authenticate"),{scheme:s,params:c}=dat(o);s==="Bearer"&&c.resource_metadata&&(n=c.resource_metadata)}return n}async getResourceMetadata(e,r){if(!e)return{resource:""};let n=new URL(e),o=new URL(r.url),s={};n.origin===o.origin&&(s=r.headers);let c=await QZ(this.ctx,e,"GET",{...s,Accept:"application/json","MCP-Protocol-Version":Sw});if(c.status!==200)throw new Error(`Failed to fetch resource metadata: ${c.status} ${await Mcr(c)}`);let l=await c.json();if(K$n(l)){let u=eVn(e),d=new URL(l.resource).toString(),f=new URL(u).toString();if(d!==f)throw new Error(`Protected Resource Metadata resource "${d}" does not match MCP server resolved resource "${f}". The MCP server must follow OAuth spec https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return l}else throw new Error(`Invalid resource metadata: ${JSON.stringify(l)}`)}async getAuthorizationServerMetadata(e,r){let n=new URL(e),o=n.pathname==="/"?"":n.pathname,s=new URL(z$n,e).toString()+o,c=await QZ(this.ctx,s,"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Sw});if(c.status!==200&&(c=await QZ(this.ctx,xa(e,".well-known","openid-configuration"),"GET",{...r,Accept:"application/json","MCP-Protocol-Version":Sw}),c.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${c.status} ${await Mcr(c)}`);let l=await c.json();if(J$n(l))return l;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(l)}`)}};p();var fb=class{static{a(this,"McpAuthService")}};var E5=new ge("mcpGateway");async function rVn(t,e,r){E5.info(t,`OAuth discovery: probing ${e}`);try{let n=await new Ape(t).getMetadataFromOriginalUrl(e,r),o=n.resourceMetadata?.scopes_supported||n.serverMetadata.scopes_supported||[];return E5.info(t,`OAuth discovery: authServer=${n.authorizationServer}, scopes=[${o.join(", ")}], hasPRM=${!!n.resourceMetadata}`),gt(t,"mcpGateway.oauth.discovery",{result:"success",hasPRM:n.resourceMetadata?"true":"false"}),{authorizationServer:n.authorizationServer,serverMetadata:n.serverMetadata,resourceMetadata:n.resourceMetadata,scopes:o}}catch(n){E5.warn(t,`OAuth discovery failed for ${e}: ${String(n)}`),gi(t,"mcpGateway.oauth.discovery",n,{result:"failure"});return}}a(rVn,"discoverAuthMetadata");async function pat(t,e,r,n){let o=e.getOrActivateProviderIdForServer(r.authorizationServer);if(!o){let l=e.createAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata);if(l||(l=await e.createDynamicAuthenticationProvider(r.authorizationServer,r.serverMetadata,r.resourceMetadata)),!l)throw new Error(`Failed to create auth provider for ${r.authorizationServer}`);o=l.id}let s=await e.getSessions(o,r.scopes,{authorizationServer:r.authorizationServer},!0),c=iVn(t)?.getAccountPreference(n,o);if(c){let l=s.find(u=>u.account.label===c);if(l)return gt(t,"mcpGateway.oauth.silent",{result:"hit",via:"preference"}),{token:l.accessToken,providerId:o,sessions:s}}return gt(t,"mcpGateway.oauth.silent",{result:"miss",sessions:String(s.length)}),{token:void 0,providerId:o,sessions:s}}a(pat,"acquireSilent");async function nVn(t,e,r,n,o,s,c=[]){let l=e.getProvider(n),u=_Us(t),d=iVn(t);if(c.length>0&&u){let f="Sign in to another account";try{let h=c.map(g=>({title:g.account.label}));h.push({title:f}),h.push({title:"Cancel"});let m=await u.showInformationModal(`The MCP server ${o} wants to access a ${l.label} account. Select an account for ${o} to use.`,...h);if(!m||m.title==="Cancel"){E5.warn(t,`mount '${o}': user cancelled the account selection`),gt(t,"mcpGateway.oauth.picker",{result:"cancelled"});return}if(m.title!==f){let g=c.find(A=>A.account.label===m.title);if(!g){E5.warn(t,`mount '${o}': picked account not found in sessions`);return}return d?.updateAccountPreference(o,n,g.account),gt(t,"mcpGateway.oauth.picker",{result:"picked"}),g.accessToken}gt(t,"mcpGateway.oauth.picker",{result:"add_account"})}catch(h){E5.error(t,`mount '${o}': failed during account selection`,h),gi(t,"mcpGateway.oauth.picker",h,{result:"failed"});return}}else if(c.length===0&&u)try{if((await u.showInformationModal(`The MCP Server Definition '${s}' wants to authenticate to ${l.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){E5.warn(t,`mount '${o}': user declined OAuth confirmation`),gt(t,"mcpGateway.oauth.interactive",{result:"declined"});return}gt(t,"mcpGateway.oauth.interactive",{result:"confirmed"})}catch(f){E5.error(t,`mount '${o}': failed to show auth confirmation`,f),gi(t,"mcpGateway.oauth.interactive",f,{result:"confirm_failed"});return}else u||E5.debug(t,`mount '${o}': no NotificationSender, skipping UI gates`);try{let f=await l.createSession(r.scopes,{});return d?.updateAccountPreference(o,n,f.account),u&&u.showInformationMessageOnlyOnce(`mcpGateway:auth-success:${n}`,`You have authenticated with ${l.label}.`),gt(t,"mcpGateway.oauth.flow",{result:"success"}),f.accessToken}catch(f){E5.error(t,`Interactive OAuth failed for ${r.authorizationServer}`,f),u&&u.showWarningMessageOnlyOnce(`mcpGateway:auth-fail:${n}`,`Authentication failed. You need to restart the IDE to authenticate the MCP server again. ${f instanceof Error?f.message:String(f)}`),gi(t,"mcpGateway.oauth.flow",f,{result:"failure"});return}}a(nVn,"acquireInteractive");function _Us(t){try{return t.get(sa)}catch{return}}a(_Us,"tryGetNotificationSender");function iVn(t){try{return t.get(fb)}catch{return}}a(iVn,"tryGetMcpAuthService");p();p();var zVn=ce(VVn(),1),gat=ce(require("node:process"),1),YVn=require("node:stream");p();var mat=class{static{a(this,"ReadBuffer")}append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(` -`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),WUs(r)}clear(){this._buffer=void 0}};function WUs(t){return Nj.parse(JSON.parse(t))}a(WUs,"deserializeMessage");function WVn(t){return JSON.stringify(t)+` -`}a(WVn,"serializeMessage");var zUs=gat.default.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function YUs(){let t={};for(let e of zUs){let r=gat.default.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(YUs,"getDefaultEnvironment");var _pe=class{static{a(this,"StdioClientTransport")}constructor(e){this._readBuffer=new mat,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new YVn.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{this._process=(0,zVn.default)(this._serverParams.command,this._serverParams.args??[],{env:{...YUs(),...this._serverParams.env},stdio:["pipe","pipe",this._serverParams.stderr??"inherit"],shell:!1,windowsHide:gat.default.platform==="win32",cwd:this._serverParams.cwd}),this._process.on("error",n=>{r(n),this.onerror?.(n)}),this._process.on("spawn",()=>{e()}),this._process.on("close",n=>{this._process=void 0,this.onclose?.()}),this._process.stdin?.on("error",n=>{this.onerror?.(n)}),this._process.stdout?.on("data",n=>{this._readBuffer.append(n),this.processReadBuffer()}),this._process.stdout?.on("error",n=>{this.onerror?.(n)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stderr??null}get pid(){return this._process?.pid??null}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){if(this._process){let e=this._process;this._process=void 0;let r=new Promise(n=>{e.once("close",()=>{n()})});try{e.stdin?.end()}catch{}if(await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())]),e.exitCode===null){try{e.kill("SIGTERM")}catch{}await Promise.race([r,new Promise(n=>setTimeout(n,2e3).unref())])}if(e.exitCode===null)try{e.kill("SIGKILL")}catch{}}this._readBuffer.clear()}send(e){return new Promise(r=>{if(!this._process?.stdin)throw new Error("Not connected");let n=WVn(e);this._process.stdin.write(n)?r():this._process.stdin.once("drain",r)})}};var KVn=require("child_process"),JVn=require("events"),ZVn=require("util");var Wcr=1e4,KUs=(0,ZVn.promisify)(KVn.exec),l2e=class{constructor(e){this._transport=null;this._emitter=new JVn.EventEmitter;this._connected=!1;this.id=e.id,this.label=e.label,this._options=e,this._emitter.setMaxListeners(0),this._client=new Vj({name:e.clientInfo.name,version:e.clientInfo.version},{capabilities:{}})}static{a(this,"StdioInvoker")}get isConnected(){return this._connected}async start(){if(this._connected)return;let e={...this._options.params,stderr:"pipe"},r=new _pe(e);this._transport=r,this._client.onerror=n=>this._options.onError?.(n),this._client.onclose=()=>{this._connected=!1},r.stderr&&r.stderr.on("data",n=>{this._options.onStderr?.(n.toString())}),this._client.setNotificationHandler(xF,()=>{this._emitter.emit(Hl.ToolsListChanged)}),this._client.setNotificationHandler(TF,()=>{this._emitter.emit(Hl.ResourcesListChanged)}),this._client.setNotificationHandler(IF,()=>{this._emitter.emit(Hl.PromptsListChanged)}),this._client.setNotificationHandler(_Z,n=>{this._emitter.emit(Hl.LoggingMessage,n)}),await this._client.connect(r),this._connected=!0}async stop(){if(!this._transport){this._connected=!1;return}let e=this._transport;this._transport=null;let r=this._client.close().catch(()=>{}),n=await Promise.race([r.then(()=>!0),new Promise(s=>setTimeout(()=>s(!1),Wcr))]),o;if("pid"in e&&typeof e.pid=="number"&&(o=e.pid),!n&&o===void 0&&this._options.onError?.(new Error(`stdio transport exposed no pid; cannot force-kill '${this.id}'`)),!n&&o!==void 0&&process.platform==="win32")try{await KUs(`taskkill /pid ${o} /t /f`,{timeout:Wcr})}catch{}else if(!n&&o!==void 0){try{process.kill(o,"SIGTERM")}catch{}await new Promise(s=>setTimeout(s,Wcr));try{process.kill(o,"SIGKILL")}catch{}}this._connected=!1}listTools(){return this._client.listTools()}callTool(e,r){return this._client.callTool({name:e,arguments:r})}listResources(){return this._client.listResources()}readResource(e){return this._client.readResource({uri:e})}listResourceTemplates(){return this._client.listResourceTemplates()}listPrompts(){return this._client.listPrompts()}getPrompt(e,r){return this._client.getPrompt({name:e,arguments:r})}async setLoggingLevel(e){await this._client.setLoggingLevel(e.level)}on(e,r){this._emitter.on(e,r)}off(e,r){this._emitter.off(e,r)}};p();var e0=class{static{a(this,"AuthenticationService")}};var gT=new ge("mcpGateway.manager"),zj=class extends Error{constructor(r,n){super(n);this.code=r}static{a(this,"ServerActionError")}},JUs={tools:[],resources:[],resourceTemplates:[],prompts:[]},pb=class{constructor(e,r,n){this._entries=new Map;this._disposed=!1;this._applyChain=Promise.resolve();this._oauthChain=Promise.resolve();this._actionChains=new Map;this._ctx=e,this._service=r,this._sender=n,this._unregister=n}static{a(this,"McpServerManager")}listServers(){let e=[];for(let r of this._entries.values())e.push({name:r.key.name,source:r.key.source,status:r.status,error:r.error,authInfo:r.authInfo,registryInfo:r.registryInfo});return e}getServerDetails(e){let r=this._entries.get(qZ(e));return r?{tools:r.contents.tools,resources:r.contents.resources,resourceTemplates:r.contents.resourceTemplates,prompts:r.contents.prompts}:null}async applyConfig(e){if(this._disposed)throw new Error("McpServerManager is disposed");let r=this._applyChain.then(()=>this._applyConfigLocked(e));return this._applyChain=r.catch(()=>{}),r}async _applyConfigLocked(e){let r={kind:"user"},n=new Map,o=[];for(let[l,u]of Object.entries(e)){let d=XUs(l,u);if(!d){o.push(l);continue}n.set(qZ({source:r,name:l}),{classified:d,hash:ZUs(u)})}o.length>0&&gT.warn(this._ctx,`applyConfig: skipped ${o.length} unrecognised entries: [${o.join(", ")}]`);let s=[];for(let[l,u]of this._entries)u.key.source.kind==="user"&&!n.has(l)&&s.push(l);for(let l of s)await this._removeEntry(l);let c=!1;for(let[l,{classified:u,hash:d}]of n){let f=this._entries.get(l);f?f.entryHash!==d&&(await this._stopInvoker(f,"starting"),f.classified=u,f.entryHash=d,f.error=void 0,c=!0,this._beginStart(l)):(this._createEntry({source:r,name:u.name},u,d),c=!0,this._beginStart(l))}c&&this._sender.serversChanged()}serverAction(e,r){let n=qZ(e),o=this._entries.get(n);if(!o)throw new zj("unknownServer",`Unknown MCP server: ${e.name}`);switch(r){case"start":case"restart":if(o.status==="blocked")throw new zj("startBlocked",`Server '${e.name}' is blocked by policy and cannot be started`);break;case"logout":case"clearOAuth":if(!o.authInfo&&!o.authDiscovery)throw new zj("noAuth",`Server '${e.name}' has no auth state to clear`);break}let c=(this._actionChains.get(n)??Promise.resolve()).then(()=>this._runAction(n,r));return this._actionChains.set(n,c.catch(()=>{})),Promise.resolve()}async _runAction(e,r){let n=this._entries.get(e);if(n)switch(r){case"start":if(n.status==="running"||n.status==="starting")return;await this._beginStart(e);return;case"stop":if(n.status==="stopped")return;await this._stopInvoker(n,"stopped"),this._sender.serversChanged();return;case"restart":await this._stopInvoker(n,"starting"),this._sender.serversChanged(),await this._beginStart(e);return;case"logout":await this._performLogout(n,!1);return;case"clearOAuth":await this._performLogout(n,!0),await this._beginStart(e);return}}async dispose(){if(this._disposed)return;this._disposed=!0;let e=[...this._entries.values()].map(r=>this._stopInvoker(r,"stopped").catch(()=>{}));this._entries.clear(),await Promise.all(e)}_createEntry(e,r,n){let o={key:e,classified:r,entryHash:n,invoker:null,status:"stopped",contents:{...JUs},listeners:null};return this._entries.set(qZ(e),o),o}async _removeEntry(e){let r=this._entries.get(e);r&&(await this._stopInvoker(r,"stopped").catch(()=>{}),this._entries.delete(e),this._sender.serversChanged())}async _beginStart(e){let r=this._entries.get(e);if(!r)return;r.invoker?await this._stopInvoker(r,"starting"):(r.status="starting",r.error=void 0,this._sender.serversChanged());let n=this._buildInvoker(r);r.invoker=n,this._wireInvokerEvents(r);try{if(await n.start(),r.invoker!==n){await n.stop().catch(()=>{});return}try{await this._service.registerMount(n,r.key.name)}catch(o){throw gT.error(this._ctx,`failed to register mount for '${r.key.name}'`,o),o}if(r.invoker!==n){this._service.unregisterMount(qZ(r.key)),await n.stop().catch(()=>{});return}if(r.status="running",r.error=void 0,await this._refreshContents(r).catch(o=>{gT.warn(this._ctx,`failed to refresh contents for '${r.key.name}': ${String(o)}`)}),r.invoker!==n)return;this._sender.serversChanged(),this._sender.serverDetailsChanged(r.key)}catch(o){if(r.invoker!==n){await n.stop().catch(()=>{});return}o instanceof gpe?(r.status="unauthorized",r.error=void 0,gT.warn(this._ctx,`server '${r.key.name}' requires authorization`)):(r.status="error",r.error=o instanceof Error?o.message:String(o),gT.error(this._ctx,`server '${r.key.name}' failed to start`,o)),await n.stop().catch(()=>{}),this._unwireInvokerEvents(r),r.invoker=null,this._sender.serversChanged()}}async _stopInvoker(e,r){let n=e.invoker;this._unwireInvokerEvents(e),e.invoker=null,e.status=r,r!=="error"&&r!=="blocked"&&(e.error=void 0),this._service.unregisterMount(qZ(e.key)),this._sender.serversChanged(),n&&await n.stop().catch(o=>{gT.warn(this._ctx,`failed to stop invoker '${e.key.name}': ${String(o)}`)})}_wireInvokerEvents(e){let r=e.invoker;if(!r)return;let n={toolsChanged:a(()=>{this._onUpstreamListChanged(e,"tools")},"toolsChanged"),resourcesChanged:a(()=>{this._onUpstreamListChanged(e,"resources")},"resourcesChanged"),promptsChanged:a(()=>{this._onUpstreamListChanged(e,"prompts")},"promptsChanged")};r.on(Hl.ToolsListChanged,n.toolsChanged),r.on(Hl.ResourcesListChanged,n.resourcesChanged),r.on(Hl.PromptsListChanged,n.promptsChanged),e.listeners=n}_unwireInvokerEvents(e){let r=e.invoker,n=e.listeners;r&&n&&(r.off(Hl.ToolsListChanged,n.toolsChanged),r.off(Hl.ResourcesListChanged,n.resourcesChanged),r.off(Hl.PromptsListChanged,n.promptsChanged)),e.listeners=null}async _onUpstreamListChanged(e,r){if(e.invoker)try{if(r==="tools"){let n=await e.invoker.listTools();e.contents.tools=n.tools}else if(r==="resources"){let[n,o]=await Promise.all([e.invoker.listResources(),e.invoker.listResourceTemplates()]);e.contents.resources=n.resources,e.contents.resourceTemplates=o.resourceTemplates}else{let n=await e.invoker.listPrompts();e.contents.prompts=n.prompts}this._sender.serverDetailsChanged(e.key)}catch(n){gT.warn(this._ctx,`failed to refresh ${r} for '${e.key.name}': ${String(n)}`)}}async _refreshContents(e){if(!e.invoker)return;let r=await Promise.allSettled([e.invoker.listTools(),e.invoker.listResources(),e.invoker.listResourceTemplates(),e.invoker.listPrompts()]);e.contents={tools:r[0].status==="fulfilled"?r[0].value.tools:[],resources:r[1].status==="fulfilled"?r[1].value.resources:[],resourceTemplates:r[2].status==="fulfilled"?r[2].value.resourceTemplates:[],prompts:r[3].status==="fulfilled"?r[3].value.prompts:[]}}_buildInvoker(e){let r=e.classified,n=qZ(e.key),o=e.key.name;return r.kind==="stdio"?new l2e({id:n,label:o,params:r.params,clientInfo:{name:pPe,version:hPe}}):new c2e({id:n,label:o,url:r.url,type:r.type,httpOptions:r.type==="http"?r.httpOptions:void 0,sseOptions:r.type==="sse"?r.sseOptions:void 0,clientInfo:{name:pPe,version:hPe},authProvider:this._tryGetAuthSvc()?this._buildAuthProvider(e,r.url,r.httpOptions?.requestInit?.headers):void 0,onFallback:a(({fromCode:s})=>{gT.info(this._ctx,`'${e.key.name}': Streamable HTTP returned ${s}, falling back to legacy SSE`),gt(this._ctx,"mcpGateway.transport.fallbackToSse",{fromCode:String(s)})},"onFallback")})}_tryGetAuthSvc(){try{return this._ctx.get(e0)}catch{return}}_buildAuthProvider(e,r,n){let o=a(async()=>{if(e.authDiscovery)return e.authDiscovery;let s=await rVn(this._ctx,r,n);if(!s){gT.warn(this._ctx,`'${e.key.name}': OAuth discovery failed`);return}try{let c=this._tryGetAuthSvc(),l=await pat(this._ctx,c,s,e.key.name);if(e.authDiscovery={discovery:s,providerId:l.providerId},l.token){let u=l.sessions.find(d=>d.accessToken===l.token);u&&this._setAuthInfo(e,{providerId:l.providerId,accountName:u.account.label})}return e.authDiscovery}catch(c){gT.error(this._ctx,`'${e.key.name}': dynamic provider setup failed`,c);return}},"ensureDiscovery");return async s=>{let c=this._tryGetAuthSvc();if(!c)return;let l=await o();if(!l)return;if(s==="silent"){let f=await pat(this._ctx,c,l.discovery,e.key.name);if(f.token){let h=f.sessions.find(m=>m.accessToken===f.token);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label})}return f.token}let u,d=this._oauthChain.then(async()=>{let f=await pat(this._ctx,c,l.discovery,e.key.name);if(f.token){u=f.token;let h=f.sessions.find(m=>m.accessToken===u);h&&this._setAuthInfo(e,{providerId:l.providerId,accountName:h.account.label});return}if(u=await nVn(this._ctx,c,l.discovery,l.providerId,e.key.name,r,f.sessions),u){let m=(await c.getSessions(l.providerId,l.discovery.scopes,{authorizationServer:l.discovery.authorizationServer},!0)).find(g=>g.accessToken===u);m&&this._setAuthInfo(e,{providerId:l.providerId,accountName:m.account.label})}});return this._oauthChain=d.catch(()=>{}),await d,u}}_setAuthInfo(e,r){e.authInfo?.providerId===r.providerId&&e.authInfo?.accountName===r.accountName||(e.authInfo=r,this._sender.serversChanged())}async _performLogout(e,r){await this._stopInvoker(e,"stopped").catch(()=>{});let n=this._tryGetAuthSvc(),o=e.authInfo?.providerId??e.authDiscovery?.providerId;if(n&&o)try{let s=n.getProvider(o),c=await n.getSessions(o,e.authDiscovery?.discovery.scopes??[],e.authDiscovery?{authorizationServer:e.authDiscovery.discovery.authorizationServer}:void 0,!0);for(let l of c)await s.removeSession(l.id).catch(u=>gT.warn(this._ctx,`removeSession failed for '${e.key.name}': ${String(u)}`))}catch(s){gT.warn(this._ctx,`logout enumeration failed for '${e.key.name}': ${String(s)}`)}if(r&&o){try{await this._unregister.unregisterProvider(o)}catch(s){gT.warn(this._ctx,`unregisterProvider failed for '${e.key.name}': ${String(s)}`)}e.authDiscovery=void 0}e.authInfo=void 0,this._sender.serversChanged()}};function qZ(t){switch(t.source.kind){case"user":return`user::${t.name}`;case"project":return`project::${t.source.workspaceFolder}::${t.name}`;case"plugin":return`plugin::${t.source.pluginId}::${t.name}`}}a(qZ,"serializeKey");function ZUs(t){if(!t||typeof t!="object")return JSON.stringify(t);let e=t,r=Object.keys(e).sort(),n={};for(let o of r)n[o]=e[o];return JSON.stringify(n)}a(ZUs,"canonicalEntryHash");function XUs(t,e){if(!e||typeof e!="object")return;let r=e;if(typeof r.command=="string")return{kind:"stdio",name:t,params:e};if(typeof r.url=="string"){let o=(typeof r.type=="string"?r.type:void 0)==="sse"?"sse":"http";return{kind:"http",name:t,url:r.url,type:o,httpOptions:o==="http"?e:void 0,sseOptions:o==="sse"?e:void 0}}}a(XUs,"classifyEntry");p();p();p();var Aat=require("fs"),yat=ce(require("path"));var zcr=new ge("OtelSpanFilePersistence"),e7s="debug.jsonl",BF=class{constructor(e){this.ctx=e}static{a(this,"OTelSpanFilePersistence")}isEnabled(){return!!this.getDirectory()}getDirectory(){let e=qt(this.ctx,je.AgentDebugLogsDirectory);return typeof e=="string"&&e.length>0?e:void 0}async appendSpans(e){if(!this.isEnabled()||e.length===0)return;let r=new Map;for(let n of e){let o=t7s(n);if(!o){zcr.warn(this.ctx,`Dropping span without gen_ai.conversation.id (traceId=${n.traceId})`);continue}let s=r.get(o);s?s.push(n):r.set(o,[n])}for(let[n,o]of r)try{let s=this.getFilePath(n);await Aat.promises.mkdir(yat.dirname(s),{recursive:!0,mode:448});let c=o.map(l=>JSON.stringify(l)).join(` -`)+` -`;await Aat.promises.appendFile(s,c,{encoding:"utf8",mode:384})}catch(s){zcr.warn(this.ctx,`Failed to persist spans for conversation=${n}: ${s instanceof Error?s.message:String(s)}`)}}async readSpans(e){if(!this.isEnabled())return[];try{let r=await Aat.promises.readFile(this.getFilePath(e),"utf8"),n=[];for(let o of r.split(` -`))if(o.trim())try{n.push(JSON.parse(o))}catch{}return n}catch(r){return r.code==="ENOENT"?[]:(zcr.warn(this.ctx,`Failed to read spans for conversation=${e}: ${r instanceof Error?r.message:String(r)}`),[])}}getFilePath(e){let r=this.getDirectory();if(!r)throw new Error("Agent debug logs directory not configured");return yat.join(r,r7s(e),e7s)}};function t7s(t){for(let e of t.attributes??[])if(e.key==="gen_ai.conversation.id"){let r=e.value.stringValue;if(r&&r.length>0)return r}}a(t7s,"conversationIdOf");function r7s(t){let e=t.replace(/[^A-Za-z0-9._-]/g,"_").slice(0,120);return e.length>0?e:"unknown"}a(r7s,"sanitizeForPath");p();var n7s={0:1,1:2,2:3,3:4,4:5};function Ycr(t){return String(BigInt(t[0])*BigInt(1e9)+BigInt(t[1]))}a(Ycr,"hrTimeToNano");function eWn(t){if(t!=null)return typeof t=="string"?{stringValue:t}:typeof t=="boolean"?{boolValue:t}:typeof t=="number"?Number.isInteger(t)?{intValue:String(t)}:{doubleValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(r=>eWn(r)).filter(r=>r!==void 0)}}:{stringValue:JSON.stringify(t)}}a(eWn,"encodeAnyValue");function XVn(t){if(!t)return[];let e=[];for(let[r,n]of Object.entries(t)){let o=eWn(n);o!==void 0&&e.push({key:r,value:o})}return e}a(XVn,"encodeAttributes");function tWn(t){let e=t.spanContext(),r={traceId:e.traceId,spanId:e.spanId,name:t.name,kind:n7s[t.kind]??1,startTimeUnixNano:Ycr(t.startTime),endTimeUnixNano:Ycr(t.endTime),attributes:XVn(t.attributes),events:t.events.map(n=>({name:n.name,timeUnixNano:Ycr(n.time),attributes:XVn(n.attributes)})),status:t.status.message?{code:t.status.code??0,message:t.status.message}:{code:t.status.code??0}};return t.parentSpanContext?.spanId&&(r.parentSpanId=t.parentSpanContext.spanId),r}a(tWn,"encodeSpan");var E2e=new ge("OtelBridge"),Y7s=1e3,_2e=class t{constructor(e){this.pending=[];this.flushTimer=null;this.disposed=!1;this.ctx=e,this.persistence=e.get(BF)}static{a(this,"BridgeSpanProcessor")}static installInto(e){try{let n=(co(),Ca(v5)).trace.getTracerProvider(),o=n._delegate??n,c=o._activeSpanProcessor?._spanProcessors;if(!Array.isArray(c)){let u=o?Object.keys(o).join(", "):"null";return E2e.warn(e,`Could not access SDK TracerProvider internals. delegate keys: [${u}]`),{installed:!1}}let l=new t(e);return c.push(l),E2e.info(e,`Bridge SpanProcessor installed (total processors=${c.length}).`),{installed:!0,processor:l}}catch(r){return E2e.warn(e,`Failed to install bridge SpanProcessor: ${String(r)}`),{installed:!1}}}onStart(e,r){}onEnd(e){this.disposed||(this.pending.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},Y7s)))}async forceFlush(){await this.flush()}async shutdown(){this.disposed=!0,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush()}async flush(){if(this.flushTimer=null,this.pending.length===0)return;let e=this.pending;this.pending=[];let r;try{r=e.map(tWn)}catch(n){E2e.warn(this.ctx,`Failed to encode spans: ${String(n)}`);return}try{await this.persistence.appendSpans(r)}catch(n){E2e.warn(this.ctx,`Failed to persist otel spans: ${String(n)}`)}}};var czn=require("node:module");Ns();var qo=new ge("BackgroundAgent"),K7s=20,FF="backgroundAgent",J7s="backgroundAgent.remote",Z7s=new Set(["system.message","hook.start","hook.end"]);async function X7s(){return"pkg"in process?(0,czn.createRequire)(__filename)("./node_modules/@github/copilot/sdk/index.cjs"):import("@github/copilot/sdk")}a(X7s,"importSdk");var Us=class{constructor(e){this.ctx=e;this.activeSessions=new Map;this.currentChatMode=new Map;this.remoteDelegates=new Map;this.sessionWorkingDirs=new Map;this.lastBoundProviderModel=new Map;this.processedEventIds=new Map;this.pendingExternalToolDefs=new Map;this.turnIndexes=new Map;this._mcpSyncScheduled=!1;this.notificationSender=e.get(sa),e.get(Zo).onDidChangeHttpSettings(()=>{Gor(this.ctx)}),Es(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(EA).onDidChangeSkillsEnabled(()=>{this.currentChatMode.clear()})}catch(n){if(!(n instanceof $y))throw n}try{let n=e.get(n2);this._mcpGatewayHost=n,this._mountsChangedListener=()=>this.scheduleMcpServersSync(),n.service.on(CZ.MountsChanged,this._mountsChangedListener)}catch(n){if(!(n instanceof $y))throw n}}static{a(this,"BackgroundAgentService")}scheduleMcpServersSync(){this._mcpSyncScheduled||(this._mcpSyncScheduled=!0,queueMicrotask(()=>{this._mcpSyncScheduled=!1,this.syncMcpServersToActiveSessions()}))}async syncMcpServersToActiveSessions(){let e;try{e=this.ctx.get(n2).buildMcpServers()}catch(r){r instanceof $y||qo.warn(this.ctx,"Failed to read MCP gateway servers for active-session sync",{error:r instanceof Error?r.message:String(r)});return}this.activeSessions.size!==0&&(qo.info(this.ctx,"Syncing MCP servers to active sessions",{sessionCount:this.activeSessions.size,mcpServerCount:Object.keys(e).length}),await Promise.all([...this.activeSessions].map(async([r,n])=>{try{await n.reloadMcpServers({mcpServers:e})}catch(o){qo.warn(this.ctx,"Failed to push MCP servers to session",{sessionId:r,error:o instanceof Error?o.message:String(o)})}})))}async handleAuthStateChange(){let e;try{e=(await this.ctx.get(Ur).resolveSession())?.accessToken}catch(r){qo.warn(this.ctx,"Failed to read GitHub session on auth change; skipping cache invalidation",{error:r instanceof Error?r.message:String(r)});return}this.lastAccessToken!==e&&(qo.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:this.lastAccessToken!==void 0,hasCurrent:e!==void 0,cachedSessionCount:this.activeSessions.size,remoteDelegateCount:this.remoteDelegates.size}),this.lastAccessToken=e,this.clearUserScopedState())}clearUserScopedState(){for(let e of this.remoteDelegates.values())e.disable().catch(()=>{});this.remoteDelegates.clear(),this.sessionWorkingDirs.clear(),this.activeSessions.clear(),this.pendingExternalToolDefs.clear(),this.processedEventIds.clear(),this.turnIndexes.clear(),this.lastBoundProviderModel.clear(),this.currentChatMode.clear(),ijn(this.autoModeManager)}async ensureManager(){if(this.manager)return this.manager;this.managerInitPromise||(this.managerInitPromise=this.initManager());try{await this.managerInitPromise}catch(e){throw this.managerInitPromise=void 0,e}if(!this.manager)throw new Error("LocalSessionManager initialization succeeded but manager is undefined");return this.manager}async initManager(){qo.info(this.ctx,"Initializing LocalSessionManager (in-process SDK)..."),SRn(this.ctx);let e=performance.now();try{this.sdk=await X7s(),gt(this.ctx,"backgroundAgent.importSdk",{status_text:"success"},{duration_ms:performance.now()-e})}catch(o){throw gi(this.ctx,"backgroundAgent.importSdk",o,{status_text:"failure"},{duration_ms:performance.now()-e}),o}await Gor(this.ctx);let r={telemetryService:new this.sdk.internal.NoopTelemetryService,featureFlagService:this.sdk.createLocalFeatureFlagService()},n=njn(this.sdk);n!==void 0&&(r.autoModeManager=n),this.autoModeManager=n,this.manager=new this.sdk.internal.LocalSessionManager(r),qo.info(this.ctx,"LocalSessionManager initialized.")}installBridgeSpanProcessor(){if(this.installedBridge!==void 0||!this.ctx.get(Mn).getCapabilities().agentDebugLog)return;let e=_2e.installInto(this.ctx);this.installedBridge=e.processor}cacheSession(e,r){if(this.activeSessions.has(e)&&this.activeSessions.delete(e),this.activeSessions.set(e,r),this.activeSessions.size>K7s){let n=this.activeSessions.keys().next().value;n!==void 0&&(qo.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.activeSessions.delete(n))}}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=CRn(n,e);return gt(this.ctx,"backgroundAgent.interaction",{requestSource:FF,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}async buildAuthInfo(){let r=await this.ctx.get(Ur).resolveSession();if(!r)throw new Error("Not authenticated. Please sign in first.");let n=r.serverUrl.replace(/\/+$/,"")||"https://github.com",o;try{let l=(await this.ctx.get(Qt).getToken()).endpoints.api;l&&(o={endpoints:{api:l}})}catch(s){qo.warn(this.ctx,"Could not retrieve CopilotToken endpoints for SDK authInfo",{error:s instanceof Error?s.message:String(s)})}return{type:"token",token:r.accessToken,host:n,...o&&{copilotUser:o}}}async applyTurnOverrides(e,r){let n=r.providerName?r.providerName:void 0;if(n!==void 0&&!AQ(await this.ctx.get(Qt).getToken()))throw new Jot(`BYOK is disabled for this account. Provider '${n}' cannot be used for model '${r.model??""}'.`,n,r.model);let o=await xRn(this.ctx,n,r.model);if(n!==void 0&&o===void 0)throw new Kot(`BYOK provider '${n}' is misconfigured for model '${r.model??""}'. Verify the API key`+(n===Ao.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",n,r.model);let s=this.lastBoundProviderModel.get(r.sessionId),c=r.model,l=c!==void 0&&s?.model!==c,u=s!==void 0&&s.provider!==n,d=s!==void 0&&(u||l),f=e,h=!1;if(d){qo.info(this.ctx,`Provider/model changed for session ${r.sessionId} (${s?.provider??"(built-in)"}/${s?.model??"(unchanged)"} \u2192 ${n??"(built-in)"}/${c??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let m=await this.ensureManager();this.activeSessions.delete(r.sessionId),this.currentChatMode.delete(r.sessionId);try{await m.closeSession(r.sessionId),h=!0,f=await this.getOrResumeSession(r.sessionId)}catch(g){if(h)throw this.lastBoundProviderModel.delete(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(g instanceof Error?g.message:String(g)));qo.warn(this.ctx,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(g instanceof Error?g.message:String(g))),f=e}}try{f.updateOptions({provider:o??null,...c?{model:c}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(m){throw new Error(`Failed to bind BYOK provider '${n??"(built-in)"}' to session ${r.sessionId}: ${m instanceof Error?m.message:String(m)}`)}return this.lastBoundProviderModel.set(r.sessionId,{provider:n,model:c??s?.model}),qo.info(this.ctx,`Rebound session ${r.sessionId} for this turn: provider=${n??"(built-in)"}, model=${c??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),f}async applyChatModeSelection(e,r){if(r.chatMode===void 0||r.chatMode==="ask")return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),qo.info(this.ctx,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),qo.info(this.ctx,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}async buildSessionOptions(e,r){let n=await this.buildAuthInfo(),o=To(r.workspaceFolder.uri).fsPath,s;try{s=this.ctx.get(EA).getSkillDirectories(o),s.length===0&&(s=void 0)}catch{}let c={clientName:this.ctx.get(Lr).getEditorPluginInfo().name,sessionId:e,authInfo:n,model:r.model,reasoningEffort:r.reasoningEffort,enableStreaming:r.enableStreaming??!0,excludedTools:r.excludedTools,skillDirectories:s,disabledSkills:r.disabledSkills?new Set(r.disabledSkills):void 0,workingDirectory:o};try{await this.ctx.get(YL)._handleWorkspaceAdded({uri:r.workspaceFolder.uri,name:r.workspaceFolder.name??""})}catch{}let l=await xKt(this.ctx,r.workspaceFolder);l.length>0&&(c.customAgents=l);try{let m=this.ctx.get(n2).buildMcpServers();qo.info(this.ctx,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:m}),Object.keys(m).length>0&&(c.mcpServers=m)}catch(m){if(!(m instanceof $y))throw m}c.hooks=mRn(this.ctx,r.workspaceFolder);let u=await zor(this.ctx,[r.workspaceFolder]).catch(m=>{qo.warn(this.ctx,"Failed to load git commit instructions for systemMessage",m)}),d=r.useNestedClaudeMdFiles===!0?await this.scanNestedClaudeSection(o):void 0,f=_Rn({gitCommitInstructions:u,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:d});f!==void 0&&(c.systemMessage={mode:"append",content:f}),r.externalToolDefinitions?.length&&(c.externalToolDefinitions=r.externalToolDefinitions);let h=yRn(r);return h.size>0&&(c.disabledInstructionSources=h),c}async scanNestedClaudeSection(e){let r;try{r=this.ctx.get(Fo)}catch{return}try{return await ERn(async n=>r.readDirectory(Ia(n)),e)}catch(n){qo.warn(this.ctx,"Failed to scan nested CLAUDE.md files",n);return}}async createSession(e){let r=performance.now();qo.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??gr(),s=await this.buildSessionOptions(o,e),c=await n.createSession(s);return qo.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),gt(this.ctx,"backgroundAgent.create",{requestSource:FF,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.cacheSession(o,c),this.sessionWorkingDirs.set(o,To(e.workspaceFolder.uri).fsPath),{sessionId:o,workspacePath:c.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),qo.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.activeSessions.get(e);if(n){let f=this.pendingExternalToolDefs.get(e);return f&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:f}),qo.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:f.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let f=await o.getSessionMetadata({sessionId:e});if(!f)throw new Error(`Session not found: ${e}`);let h=f.context?.cwd;if(!h)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:Ia(h)},qo.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);if(this.cacheSession(e,u),!this.turnIndexes.has(e)){let f=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;f>0&&this.turnIndexes.set(e,f-1)}this.currentChatMode.delete(e),this.installBridgeSpanProcessor();let d=s?.uri?To(s.uri).fsPath:void 0;return d&&this.sessionWorkingDirs.set(e,d),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),await this.expandPromptTemplate(e.sessionId,e),await this.applyChatModeSelection(o,e);let s={prompt:e.message,...e.sendMode?{mode:e.sendMode}:{}};if(this.applyAgentModeOverride(o,e,s),e.references?.length){let f=hRn(e.references,this.ctx);f.length>0&&(s.attachments=f)}let c=performance.now(),l=this.nextTurnIndex(e.sessionId);this.wireTurnAndSend(e.sessionId,o,s,l,r);let u={requestSource:FF,chatMode:this.currentChatMode.get(e.sessionId)??"agent",sessionId:e.sessionId,modelId:e.model??"",providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(l)},d={totalTimeMs:performance.now()-c,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return gt(this.ctx,"backgroundAgent.send",u,d),ht(this.ctx,"backgroundAgent.send",jt.createAndMarkAsIssued(u,d)),{}}async applyChatModeOverride(e,r,n){let s=(n.chatMode??"agent")==="ask"?"ask":"agent";if(this.currentChatMode.get(e)===s)return;let l=this.sessionWorkingDirs.get(e);if(!l)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let u={uri:Ia(l)};this.currentChatMode.delete(e),await Jqn(r,s,{loadCustomAgents:a(()=>xKt(this.ctx,u),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(d=>d.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let d;try{d=this.ctx.get(EA)}catch{return[]}return d.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{try{return Promise.resolve(this.ctx.get(n2).buildMcpServers())}catch(d){if(d instanceof $y)return Promise.resolve({});throw d}},"getMcpServers")}),this.currentChatMode.set(e,s)}applyAgentModeOverride(e,r,n){r.agentMode&&(e.currentMode=r.agentMode,n.agentMode=r.agentMode)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,source:n},l=performance.now(),u=this.nextTurnIndex(e);this.wireTurnAndSend(e,o,c,u),gt(this.ctx,"backgroundAgent.send",{requestSource:J7s,sessionId:e,modelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}getWorkspaceFolderForSession(e){let r=this.sessionWorkingDirs.get(e);return r?{uri:Ia(r)}:void 0}nextTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}async expandPromptTemplate(e,r){let n=this.getWorkspaceFolderForSession(e);await this.ctx.get(ag).applyPromptTemplateToRequest(r,n?[n]:[])}wireTurnAndSend(e,r,n,o,s){let c=performance.now(),l=IRn(this.ctx,e,`bg-turn-${gr()}`);this.processedEventIds.set(e,new Set);let u=a(()=>{},"noop"),d=r.on("user_input.requested",u),f=r.on("permission.requested",u),h=r.on("exit_plan_mode.requested",u);tjn(r,!0);let m=new Zot,g=r.on("*",b=>{if(l)try{l.persistEvent(b)}catch(T){qo.warn(this.ctx,"Failed to persist background-agent event",{eventType:b.type,error:T instanceof Error?T.message:String(T)})}m.trackEvent(b),this.handleSessionEvent(e,b,o)}),A=!1,y=a(()=>{A||(A=!0,this.emitTurnCompleteTelemetry(e,c,m.data,o),this.emitSessionMetricsTelemetry(e,r,o)),v?.dispose(),d(),f(),h(),g(),E(),_(),this.processedEventIds.delete(e)},"cleanup"),E=r.on("session.idle",()=>{y()}),_=r.on("session.error",()=>{y()}),v;s&&(v=s.onCancellationRequested(()=>{qo.info(this.ctx,"Cancellation requested, aborting session:",e),r.abort()})),r.send(n).catch(b=>{y();let T={type:"session.error",id:gr(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:b instanceof Error?b.message:String(b)}};this.sendSessionUpdateNotification(e,T,o)})}async destroySession(e){try{let r=this.remoteDelegates.get(e.sessionId);if(r){try{await r.disable()}catch{}try{await r.deleteRemote()}catch(o){qo.warn(this.ctx,"Mission Control deleteSession failed during destroySession",{sessionId:e.sessionId,error:o instanceof Error?o.message:String(o)})}this.remoteDelegates.delete(e.sessionId)}return this.sessionWorkingDirs.delete(e.sessionId),this.activeSessions.delete(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),this.currentChatMode.delete(e.sessionId),this.lastBoundProviderModel.delete(e.sessionId),this.turnIndexes.delete(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return qo.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);qo.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&qo.info(this.ctx,"Aborted in-progress manual compaction:",e),await n.abort(),gt(this.ctx,"backgroundAgent.stop",{requestSource:FF,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);qo.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return gt(this.ctx,"backgroundAgent.compactHistory",{requestSource:FF,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);qo.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return gt(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:FF,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();qo.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());gt(this.ctx,"backgroundAgent.resume",{requestSource:FF,modelId:e.model??"",reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!Z7s.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&s.context?.cwd!==e.cwd||e.gitRoot&&s.context?.gitRoot!==e.gitRoot||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){qo.info(this.ctx,"listModels called",{forceRefresh:e}),await this.ensureManager();let r=await this.buildAuthInfo();qo.info(this.ctx,"listModels proxy diagnostics",{HTTPS_PROXY:process.env.HTTPS_PROXY?"(set)":"(not set)",HTTP_PROXY:process.env.HTTP_PROXY?"(set)":"(not set)",NO_PROXY:process.env.NO_PROXY??"(not set)",NODE_TLS_REJECT_UNAUTHORIZED:process.env.NODE_TLS_REJECT_UNAUTHORIZED??"(not set)",NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS??"(not set)"});try{let n=await this.sdk.getAvailableModels(r);n.length===0?qo.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):qo.info(this.ctx,`Successfully retrieved ${n.length} models`);let o=[];this.ctx.get(uu).getPolicyValue("autoModel.enabled")!==!1&&o.push(this.buildAutoModelEntry());let s=[...o,...n];return qo.debug(this.ctx,"Models retrieved:",s.map(c=>c.id)),{models:s}}catch(n){let o=n instanceof Error?n.message:String(n);throw qo.error(this.ctx,"getAvailableModels failed",{error:o,stack:n instanceof Error?n.stack:void 0}),new Error(`Failed to retrieve models: ${o}`)}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){qo.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){qo.error(this.ctx,"Failed to send session update notification:",o)}}emitTurnCompleteTelemetry(e,r,n,o){try{let s=performance.now()-r,c=this.currentChatMode.get(e)??"agent";gt(this.ctx,"backgroundAgent.turn.complete",{requestSource:FF,sessionId:e,chatMode:c,agentProvider:"BACKGROUND",turnIndex:o!=null?String(o):""},{totalDurationMs:s,totalUserWaitMs:n?n.permission.totalMs+n.user_input.totalMs+n.exit_plan_mode.totalMs:0,permissionWaitMs:n?.permission.totalMs??0,permissionWaitCount:n?.permission.count??0,userInputWaitMs:n?.user_input.totalMs??0,userInputWaitCount:n?.user_input.count??0,exitPlanModeWaitMs:n?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:n?.exit_plan_mode.count??0})}catch(s){qo.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}async emitSessionMetricsTelemetry(e,r,n){try{let o=await r.usage.getMetrics(),s=0,c=0,l=0,u=0,d=0,f=0,h=[];for(let[m,g]of Object.entries(o.modelMetrics))s+=g.usage.inputTokens,c+=g.usage.outputTokens,l+=g.usage.cacheReadTokens,u+=g.usage.cacheWriteTokens,d+=g.usage.reasoningTokens??0,f+=g.requests.count,h.push(m);gt(this.ctx,"backgroundAgent.session.metrics",{requestSource:FF,sessionId:e,agentProvider:"BACKGROUND",modelNames:h.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:o.totalApiDurationMs,totalInputTokens:s,totalOutputTokens:c,totalCacheReadTokens:l,totalCacheWriteTokens:u,totalReasoningTokens:d,llmCallCount:f,totalPremiumRequestCost:o.totalPremiumRequestCost})}catch(o){qo.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:o instanceof Error?o.message:String(o)})}}attachRemoteDelegateLazy(e,r){let n=this.remoteDelegates.get(e);if(n)return n;let o=this.sessionWorkingDirs.get(e);if(!o)throw new Error(`Mission Control: working directory unknown for session ${e}; cannot attach delegate.`);let s=new est(this.ctx,qo,{getApiBase:a(()=>this.getMissionControlApiBase(),"getApiBase"),getAuthToken:a(()=>this.getGithubAccessToken(),"getAuthToken"),integrationId:this.getCopilotIntegrationId()}),c=new rst(e,r,{workingDir:o,getGithubToken:a(()=>this.getGithubAccessToken(),"getGithubToken"),client:s,logger:qo,ctx:this.ctx,injectUserMessage:a((l,u,d)=>this.injectRemoteUserMessage(l,u,d),"injectUserMessage")});if(!rjn(r,c))throw new Error("SDK capability missing: LocalSession.setRemoteDelegate");return this.remoteDelegates.set(e,c),c}async enableRemote(e){let r=await this.getOrResumeSession(e);this.attachRemoteDelegateLazy(e,r);let n=Wor(r);if(!n)throw new Error("Remote steering not supported by this SDK version");return n.enable()}async disableRemote(e){let r=await this.getOrResumeSession(e),n=Wor(r);n&&await n.disable()}getRemoteStatus(e){let r=this.remoteDelegates.get(e);return r?r.getStatus():{remoteSteerable:!1}}async getMissionControlApiBase(){let n=(await this.ctx.get(Qt).getToken()).endpoints.api;if(!n)throw new Error("Copilot API endpoint not available");return n}async getGithubAccessToken(){let e=await this.ctx.get(Ur).resolveSession();if(!e?.accessToken)throw new Error("Not authenticated");return e.accessToken}getCopilotIntegrationId(){return"vscode-chat"}async shutdown(){this._mcpGatewayHost&&this._mountsChangedListener&&(this._mcpGatewayHost.service.off(CZ.MountsChanged,this._mountsChangedListener),this._mountsChangedListener=void 0,this._mcpGatewayHost=void 0),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,this.clearUserScopedState(),Hor(),bRn(),this.manager&&(await this.manager.dispose(),this.manager=void 0),this.sdk=void 0,this.autoModeManager=void 0,this.managerInitPromise=void 0}};p();p();var t0=(r=>(r.Background="BACKGROUND",r.Claude="CLAUDE",r))(t0||{});p();var lzn=ce(require("path"));function WZ(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(WZ,"assertClaudeProvider");function Tpe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(Tpe,"assertNonEmptyString");function eQs(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{To(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(eQs,"assertFsUri");function tQs(t,e,r){if(!lzn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(tQs,"assertAbsolutePath");async function C2e(t,e){if(e===void 0)return;let n=(await t.get(dc).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!JHe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(C2e,"validateClaudeModel");async function uzn(t,e){WZ("createSession",e.agentProvider),eQs("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await C2e(t,e.model)}a(uzn,"validateAgentCreate");async function dzn(t,e){WZ("resumeSession",e.agentProvider),Tpe("resumeSession","sessionId",e.sessionId),await C2e(t,e.model)}a(dzn,"validateAgentResume");async function fzn(t,e){WZ("sendMessage",e.agentProvider),Tpe("sendMessage","sessionId",e.sessionId),Tpe("sendMessage","message",e.message),await C2e(t,e.model)}a(fzn,"validateAgentSend");function pzn(t,e){WZ("stopSession",e.agentProvider),Tpe("stopSession","sessionId",e.sessionId)}a(pzn,"validateAgentStop");function hzn(t,e){WZ("destroySession",e.agentProvider),Tpe("destroySession","sessionId",e.sessionId)}a(hzn,"validateAgentDestroy");function mzn(t,e){WZ("listSessions",e.agentProvider),Tpe("listSessions","cwd",e.cwd),tQs("listSessions","cwd",e.cwd)}a(mzn,"validateAgentListSessions");function gzn(t,e){WZ("listModels",e.agentProvider)}a(gzn,"validateAgentListModels");p();p();var yzn=require("child_process"),Ipe=ce(require("path")),v2e=ce(DL()),Ezn=require("util");var _zn=5e3,Azn=200,ylr=class{constructor(){this.execFile=(0,Ezn.promisify)(yzn.execFile);this.cache=new Map}static{a(this,"ClaudeCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable."});let r=Ipe.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(Ipe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=rQs(),n=v2e.coerce(r);if(!n)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${r}" from packaged metadata. This is an internal error; please report it.`};let o=nQs(e);if(o)return{severity:"error",message:o};let s;try{s=(await this.execFile(e,["--version"],{timeout:_zn,windowsHide:!0})).stdout}catch(l){return{severity:"error",message:iQs(e,l)}}let c=v2e.coerce(s);return c?v2e.satisfies(c,`~${n.major}.${n.minor}.0`)?{severity:"ok"}:{severity:"warning",message:`Claude Code CLI at "${e}" reports version ${c.version}, but this language server was built against ${n.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${n.version}\` to align versions.`}:{severity:"error",message:`Could not parse Claude Code CLI version from "${e}" --version output: "${Czn(s)}".`}}},xpe=new ylr;function rQs(){let t=FSe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(rQs,"getExpectedVersionRaw");function nQs(t){let e=Ipe.basename(t).toLowerCase(),r=process.platform==="win32"?"claude.exe":"claude";if(e!==r)return`Claude Code CLI path "${t}" must point at the "${r}" executable, but the basename is "${Ipe.basename(t)}". Open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the binary itself (typically under \`/node_modules/@anthropic-ai/claude-code/bin/\`).`}a(nQs,"validateBasename");function iQs(t,e){let r=e;if(r?.code==="ENOENT")return`Claude Code CLI not found at "${t}". Check that the file exists and is executable.`;if(r?.killed&&r?.signal==="SIGTERM")return`Claude Code CLI at "${t}" did not respond to --version within ${_zn/1e3}s.`;let n=typeof r?.stderr=="string"?Czn(r.stderr):"",o=r?.code!==void 0?` (exit code ${String(r.code)})`:"",s=n?` stderr: "${n}"`:"",c=r?.message?`: ${r.message}`:"";return`Failed to run "${t} --version"${o}${c}${s}`}a(iQs,"formatSpawnError");function Czn(t){let e=t.trim();return e.length<=Azn?e:`${e.slice(0,Azn)}\u2026`}a(Czn,"truncate");p();var Elr=require("fs"),bzn=ce(require("path"));var b2e=new ge("ClaudeCode.ReferenceFormatter"),oQs={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},vzn=5*1024*1024;async function Szn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=ho(s.uri);if(!c){b2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=aQs(c);if(l){let u=await sQs(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=ho(s.uri);if(!c){b2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:b2e.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:cQs(n)}),o}a(Szn,"buildReferences");async function sQs(t,e,r){try{let n=await Elr.promises.stat(t);if(n.size>vzn){b2e.debug(r,`Skipping oversize image reference (${n.size} > ${vzn} bytes): ${t}`);return}let o=(await Elr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){b2e.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(sQs,"tryReadImageBlock");function aQs(t){return oQs[bzn.extname(t).toLowerCase()]}a(aQs,"imageMediaTypeForPath");function cQs(t){return` +`)}updateAttemptCount(e){if(e.length!==this.lastChanges.length){this.attemptCount=0;return}for(let r=0;r0&&(l.customAgents=u);try{let f=t.get(pT).buildMcpServers();Plr.info(t,"Built MCP gateway servers for SDK options",{sessionId:e,gatewayServers:f}),Object.keys(f).length>0&&(l.mcpServers=f)}catch(f){if(!(f instanceof Y0))throw f}if(l.hooks=Ezn(t,r.workspaceFolder),r.inlineConfinedFile){let f=[...l.hooks.preToolUse??[]];r.inlineConfinementHook&&f.unshift(r.inlineConfinementHook),r.inlineTurnLimiter&&f.unshift(r.inlineTurnLimiter.hook),l.hooks={...l.hooks,preToolUse:f},l.systemMessage={mode:"append",content:xzn(r.inlineConfinedFile)}}else{let f=await Rlr(t,[r.workspaceFolder]).catch(g=>{Plr.warn(t,"Failed to load git commit instructions for systemMessage",g)}),h=r.useNestedClaudeMdFiles===!0?await g7s(t,s):void 0,m=Szn({gitCommitInstructions:f,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,nestedClaudeInstructions:h});m!==void 0&&(l.systemMessage={mode:"append",content:m})}r.externalToolDefinitions?.length&&(l.externalToolDefinitions=r.externalToolDefinitions);let d=Czn(r);return d.size>0&&(l.disabledInstructionSources=d),l}a(wzn,"buildSessionOptions");async function g7s(t,e){let r;try{r=t.get(jo)}catch{return}try{return await bzn(async n=>r.readDirectory(ba(n)),e)}catch(n){Plr.warn(t,"Failed to scan nested CLAUDE.md files",n);return}}a(g7s,"scanNestedClaudeSection");p();var A7s=20,kat=new Ae("BackgroundAgent.SessionRegistry"),Dat=class{constructor(e){this.ctx=e;this.sessions=new Map;this.workingDirs=new Map;this.turnIndexes=new Map;this.chatModes=new Map;this.providerModels=new Map;this.confinedFiles=new Map;this.turnLimiters=new Map;this.children=new Map}static{a(this,"SessionRegistry")}set(e,r){if(this.sessions.has(e)&&this.sessions.delete(e),this.sessions.set(e,r),this.sessions.size>A7s){let n=this.sessions.keys().next().value;n!==void 0&&n!==e&&(kat.debug(this.ctx,`Evicting oldest cached session: ${n}`),this.remove(n).catch(o=>kat.warn(this.ctx,`Failed to evict session ${n}`,{error:o instanceof Error?o.message:String(o)})))}}get(e){return this.sessions.get(e)}has(e){return this.sessions.has(e)}size(){return this.sessions.size}entries(){return this.sessions.entries()}forgetSession(e){this.sessions.delete(e)}setWorkingDir(e,r){this.workingDirs.set(e,r)}getWorkingDir(e){return this.workingDirs.get(e)}workingDirEntries(){return this.workingDirs}incrementTurnIndex(e){let r=(this.turnIndexes.get(e)??-1)+1;return this.turnIndexes.set(e,r),r}seedTurnIndexIfAbsent(e,r){this.turnIndexes.has(e)||this.turnIndexes.set(e,r)}setChatMode(e,r){this.chatModes.set(e,r)}getChatMode(e){return this.chatModes.get(e)}deleteChatMode(e){this.chatModes.delete(e)}clearChatMode(){this.chatModes.clear()}chatModeEntries(){return this.chatModes}setProviderModel(e,r){this.providerModels.set(e,r)}getProviderModel(e){return this.providerModels.get(e)}deleteProviderModel(e){this.providerModels.delete(e)}setConfinedFile(e,r){this.confinedFiles.set(e,r)}getConfinedFile(e){return this.confinedFiles.get(e)}hasConfinedFile(e){return this.confinedFiles.has(e)}setTurnLimiter(e,r){this.turnLimiters.set(e,r)}getTurnLimiter(e){return this.turnLimiters.get(e)}registerChild(e,r){let n=this.children.get(e);n||(n=[],this.children.set(e,n)),n.push(r)}async remove(e){let r=this.sessions.get(e),n=this.children.get(e);this.children.delete(e),n&&await Promise.all(n.map(async s=>{try{await Promise.resolve(s.dispose())}catch(c){kat.warn(this.ctx,"Child Disposable failed during session removal",{sessionId:e,error:c instanceof Error?c.message:String(c)})}}));let o=this.sessions.get(e);if(r!==void 0&&o!==r){kat.debug(this.ctx,`Skipping map clear for session ${e}: re-cached during removal`);return}this.sessions.delete(e),this.workingDirs.delete(e),this.turnIndexes.delete(e),this.chatModes.delete(e),this.providerModels.delete(e),this.confinedFiles.delete(e),this.turnLimiters.delete(e)}async removeAll(){let e=[...this.sessions.keys(),...this.children.keys()],r=Array.from(new Set(e));await Promise.all(r.map(n=>this.remove(n))),this.sessions.clear(),this.workingDirs.clear(),this.turnIndexes.clear(),this.chatModes.clear(),this.providerModels.clear(),this.confinedFiles.clear(),this.turnLimiters.clear(),this.children.clear()}};p();p();var klr=require("node:fs"),UZ=fe(require("node:path"));function Rzn(t){return t.replace(/[/\\:]/g,"_").split("\0").join("_")}a(Rzn,"sanitizePathSegment");function Mat(t){return typeof t=="string"?t:void 0}a(Mat,"asString");function Nat(t){return typeof t=="number"?t:void 0}a(Nat,"asNumber");function y7s(t){return Array.isArray(t)?t.map(e=>{if(!e||typeof e!="object")return{};let r=e;return{tool_call_id:Mat(r.toolCallId),tool:Mat(r.name)}}):[]}a(y7s,"asToolCallArray");function E7s(t){if(!t||typeof t!="object")return"";let e=t;return typeof e.detailedContent=="string"?e.detailedContent:typeof e.content=="string"?e.content:""}a(E7s,"toToolResultText");function _7s(t){try{return JSON.stringify(t)}catch{return}}a(_7s,"safeStringify");var Dlr=class{constructor(e,r,n){this.sessionId=r;this.usageByKey=new Map;this.pendingTools=new Map;this.appendQueues=new Map;this.activeTurnId=n;let o=oQt(new Date),s=Rzn(r);this.sessionDir=UZ.join(e,`pid-${process.pid}_${o}_bgagent`,"sessions",s)}static{a(this,"BackgroundAgentPersistence")}persistEvent(e){if(e.type==="assistant.turn_start"){this.activeTurnId=e.data.turnId;return}switch(e.type){case"assistant.usage":this.handleUsage(e);break;case"assistant.message":this.handleMessage(e);break;case"tool.execution_start":this.handleToolStart(e);break;case"tool.execution_complete":this.handleToolComplete(e);break;default:break}}outputDir(e){return e?UZ.join(this.sessionDir,"runSubAgent",Rzn(e)):this.sessionDir}appendJsonl(e,r){let n=_7s(r);if(n===void 0)return;let s=(this.appendQueues.get(e)??Promise.resolve()).then(async()=>{await klr.promises.mkdir(UZ.dirname(e),{recursive:!0}),await klr.promises.appendFile(e,`${n} +`,"utf8")});this.appendQueues.set(e,s.catch(()=>{}))}handleUsage(e){let r=e.data.parentToolCallId??"main";this.usageByKey.set(r,{inputTokens:Nat(e.data.inputTokens),outputTokens:Nat(e.data.outputTokens),cacheReadTokens:Nat(e.data.cacheReadTokens)})}handleMessage(e){let r=e.data.parentToolCallId,n=r??"main",o=this.usageByKey.get(n),s=y7s(e.data.toolRequests),c=this.outputDir(r);s.length>0&&this.appendJsonl(UZ.join(c,"trajectory.jsonl"),{tool_calls:s,input_tokens:o?.inputTokens,output_tokens:Nat(e.data.outputTokens)??o?.outputTokens,cached_input_tokens:o?.cacheReadTokens,conversationId:this.sessionId,turnId:this.activeTurnId})}handleToolStart(e){let r=Mat(e.data.toolCallId);r&&this.pendingTools.set(r,{toolCallId:r,toolName:e.data.toolName,arguments:e.data.arguments,parentToolCallId:e.data.parentToolCallId,startTimestamp:e.timestamp})}handleToolComplete(e){let r=Mat(e.data.toolCallId);if(!r)return;let n=this.pendingTools.get(r);this.pendingTools.delete(r);let o=this.outputDir(n?.parentToolCallId),s=n?.startTimestamp?new Date(n.startTimestamp).getTime():void 0,c=new Date(e.timestamp).getTime(),l=s?c-s:void 0;this.appendJsonl(UZ.join(o,"tool-in-out.jsonl"),{tool_call_id:r,tool:n?.toolName??"",input:typeof n?.arguments=="object"&&n.arguments!==null?n.arguments:{},output:E7s(e.data.result),status:e.data.success?"success":"error",timestamp:e.timestamp,duration_ms:l})}};function Pzn(t,e,r){let n=Ht(t,Je.PromptPersistBasePath)?.trim()||void 0;if(n)return new Dlr(n,e,r)}a(Pzn,"createBackgroundAgentPersistence");p();var Oat=class{constructor(){this.pendingWaits=new Map;this.data={permission:{totalMs:0,count:0},user_input:{totalMs:0,count:0},exit_plan_mode:{totalMs:0,count:0}}}static{a(this,"UserWaitTracker")}trackEvent(e){let r=e.type,n=e.data;if(r==="permission.requested"||r==="user_input.requested"||r==="exit_plan_mode.requested"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=r.replace(".requested","");this.pendingWaits.set(o,{waitType:s,startTimeMs:performance.now()})}else if(r==="permission.completed"||r==="user_input.completed"||r==="exit_plan_mode.completed"){let o=typeof n?.requestId=="string"?n.requestId:void 0;if(!o)return;let s=this.pendingWaits.get(o);if(s){let c=performance.now()-s.startTimeMs;this.pendingWaits.delete(o);let l=this.data[s.waitType];l.totalMs+=c,l.count+=1}}}};As();var vpe=new Ae("BackgroundAgent.TurnDriver"),kzn="backgroundAgent",Bat=class{constructor(e,r,n){this.ctx=e;this.registry=r;this.notificationSender=n;this.processedEventIds=new Map;this.registeredBackstops=new Set}static{a(this,"TurnDriver")}wireAndSend(e,r,n,o,s,c){let l=performance.now(),u=Pzn(this.ctx,e,`bg-turn-${ir()}`);this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.forget(e)},"dispose")}));let d=a(()=>{},"noop"),f=r.on("user_input.requested",d),h=r.on("permission.requested",d),m=r.on("exit_plan_mode.requested",d);ajn(r,!0);let g=new Oat,A=r.on("*",T=>{if(T.type==="assistant.turn_start"&&this.registry.getTurnLimiter(e)?.onTurnStart(),u)try{u.persistEvent(T)}catch(w){vpe.warn(this.ctx,"Failed to persist background-agent event",{eventType:T.type,error:w instanceof Error?w.message:String(w)})}g.trackEvent(T),this.handleSessionEvent(e,T,o)}),y=!1,E=a(()=>{y||(y=!0,this.emitTurnCompleteTelemetry(e,l,g.data,o),this.emitSessionMetricsTelemetry(e,r,o,c)),b?.dispose(),f(),h(),m(),A(),_(),v(),this.forget(e)},"cleanup"),_=r.on("session.idle",()=>{E()}),v=r.on("session.error",()=>{E()}),b;s&&(b=s.onCancellationRequested(()=>{vpe.info(this.ctx,"Cancellation requested, aborting session:",e),r.clearPendingItems(),r.abort()})),r.send(n).catch(T=>{E();let w={type:"session.error",id:ir(),timestamp:new Date().toISOString(),parentId:null,data:{errorType:"SendMessageError",message:T instanceof Error?T.message:String(T)}};this.sendSessionUpdateNotification(e,w,o)})}forget(e){this.processedEventIds.delete(e)}processedEventIdsForTesting(){return this.processedEventIds}seedProcessedEventIdsForTesting(e){this.processedEventIds.set(e,new Set),this.registeredBackstops.has(e)||(this.registeredBackstops.add(e),this.registry.registerChild(e,{dispose:a(()=>{this.registeredBackstops.delete(e),this.forget(e)},"dispose")}))}async handleSessionEvent(e,r,n){let o=r.id,s=this.processedEventIds.get(e);if(s?.has(o)){vpe.debug(this.ctx,`Skipping duplicate SDK event: ${r.type} (id=${o})`);return}s?.add(o),await this.sendSessionUpdateNotification(e,r,n)}async sendSessionUpdateNotification(e,r,n){try{await this.notificationSender.sendBackgroundAgentSessionUpdate(e,r,void 0,n)}catch(o){vpe.error(this.ctx,"Failed to send session update notification:",o)}}emitTurnCompleteTelemetry(e,r,n,o){try{let s=performance.now()-r,c=this.registry.getChatMode(e)??"agent";_t(this.ctx,"backgroundAgent.turn.complete",{requestSource:kzn,sessionId:e,chatMode:c,agentProvider:"BACKGROUND",turnIndex:o!=null?String(o):""},{totalDurationMs:s,totalUserWaitMs:n?n.permission.totalMs+n.user_input.totalMs+n.exit_plan_mode.totalMs:0,permissionWaitMs:n?.permission.totalMs??0,permissionWaitCount:n?.permission.count??0,userInputWaitMs:n?.user_input.totalMs??0,userInputWaitCount:n?.user_input.count??0,exitPlanModeWaitMs:n?.exit_plan_mode.totalMs??0,exitPlanModeWaitCount:n?.exit_plan_mode.count??0})}catch(s){vpe.warn(this.ctx,"Failed to emit turn.complete telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}async emitSessionMetricsTelemetry(e,r,n,o){try{let s=await r.usage.getMetrics(),c=0,l=0,u=0,d=0,f=0,h=0,m=[];for(let[g,A]of Object.entries(s.modelMetrics))c+=A.usage.inputTokens,l+=A.usage.outputTokens,u+=A.usage.cacheReadTokens,d+=A.usage.cacheWriteTokens,f+=A.usage.reasoningTokens??0,h+=A.requests.count,m.push(o?"byok models":g);_t(this.ctx,"backgroundAgent.session.metrics",{requestSource:kzn,sessionId:e,agentProvider:"BACKGROUND",modelNames:m.join(","),turnIndex:n!=null?String(n):""},{totalApiDurationMs:s.totalApiDurationMs,totalInputTokens:c,totalOutputTokens:l,totalCacheReadTokens:u,totalCacheWriteTokens:d,totalReasoningTokens:f,llmCallCount:h,totalPremiumRequestCost:s.totalPremiumRequestCost})}catch(s){vpe.warn(this.ctx,"Failed to emit session.metrics telemetry",{sessionId:e,error:s instanceof Error?s.message:String(s)})}}};p();function Dzn(t,e,r){e.agentMode&&(t.currentMode=e.agentMode,r.agentMode=e.agentMode)}a(Dzn,"applyAgentModeOverride");p();async function Nzn(t,e,r,n,o){let s=n.chatMode??"agent",c=Vot(s)?s:"agent";if((c==="inline"||c==="inline-ask")&&!o.hasConfinedFile(e))throw new Error(`Cannot apply chatMode '${c}' for session ${e}: no confined file registered (session was not created with inlineConfinedFile)`);if(o.getChatMode(e)===c)return;let u=o.getWorkingDir(e);if(!u)throw new Error(`Cannot apply chatMode for session ${e}: working directory is not cached`);let d={uri:ba(u)};o.deleteChatMode(e),await ejn(r,c,{loadCustomAgents:a(()=>Pat(t,d),"loadCustomAgents"),getAllLoadedSkillNames:a(async()=>(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(f=>f.name)),"getAllLoadedSkillNames"),getPolicyDisabledSkillNames:a(async()=>{let f;try{f=t.get(em)}catch{return[]}return f.isSkillsEnabled()?[]:(await r.ensureSkillsLoaded(),r.getLoadedSkills().map(h=>h.name))},"getPolicyDisabledSkillNames"),getMcpServers:a(()=>{try{return Promise.resolve(t.get(pT).buildMcpServers())}catch(f){if(f instanceof Y0)return Promise.resolve({});throw f}},"getMcpServers")}),o.setChatMode(e,c)}a(Nzn,"applyChatModeOverride");p();var Mzn=new Ae("BackgroundAgent.applyChatModeSelection");async function Ozn(t,e,r){if(r.chatMode===void 0||Vot(r.chatMode))return;let n=r.chatMode==="agent";try{n?(await e.agent.deselect(),Mzn.info(t,`Cleared custom agent selection for session ${r.sessionId}`)):(await e.agent.select({name:r.chatMode}),Mzn.info(t,`Applied custom agent '${r.chatMode}' for session ${r.sessionId}`))}catch(o){let s=o instanceof Error?o.message:String(o);throw n?new Error(`Failed to clear custom agent selection on session ${r.sessionId}: ${s}`):new Error(`Failed to select custom agent '${r.chatMode}' on session ${r.sessionId}: ${s}. Verify the agent is registered via a workspace .agent.md file.`)}}a(Ozn,"applyChatModeSelection");p();p();var QZ=class extends Error{constructor(r,n){super(r);this.data=n;this.name="StructuredServiceError"}static{a(this,"StructuredServiceError")}},c2e=class extends QZ{static{a(this,"BYOKMisconfiguredError")}constructor(e,r,n){let o={kind:"byokMisconfigured",providerName:r,modelId:n};super(e,o),this.name="BYOKMisconfiguredError"}},l2e=class extends QZ{static{a(this,"BYOKDisabledError")}constructor(e,r,n){let o={kind:"byokDisabled",providerName:r,modelId:n};super(e,o),this.name="BYOKDisabledError"}};p();var Cpe=new Ae("BackgroundAgent.ProviderConfig");async function Bzn(t,e,r){if(!e)return;let n=await Vze(t,e,r);if(!n){Cpe.warn(t,`BYOK provider '${e}' selected but no API key found for model '${r??""}'.`);return}let o,s,c;try{let d=await new Cc(t.get(yi)).getStoredModelConfigs(e),f=r?d[r]:void 0;o=f?.deploymentUrl,s=f?.modelCapabilities?.maxInputTokens,c=f?.modelCapabilities?.maxOutputTokens}catch(u){Cpe.warn(t,"Failed to load BYOK model config; using defaults",{providerName:e,modelId:r,error:u instanceof Error?u.message:String(u)})}let l={...s!==void 0&&{maxPromptTokens:s},...c!==void 0&&{maxOutputTokens:c}};if(e===go.Anthropic)return{type:"anthropic",baseUrl:o??ole[e],apiKey:n,modelId:r,wireModel:r,...l};if(e===go.Azure){if(!o){Cpe.warn(t,`Azure provider requires a per-model deployment URL but none configured for '${r??""}'.`);return}return v7s(t,o,n,r,l)}if(Xce(e))return{type:"openai",baseUrl:o??ole[e],apiKey:n,modelId:r,wireModel:r,...l};Cpe.warn(t,`Unknown BYOK provider '${e}', skipping provider config.`)}a(Bzn,"buildProviderConfig");function v7s(t,e,r,n,o){let s;try{s=new URL(e)}catch{Cpe.warn(t,`Invalid Azure deployment URL: ${e}`);return}let c=`${s.protocol}//${s.hostname}`;if(s.hostname.endsWith(".openai.azure.com"))return{type:"azure",baseUrl:c,apiKey:r,modelId:n,wireModel:n,azure:{apiVersion:"2025-01-01-preview"},...o};if(s.hostname.endsWith(".models.ai.azure.com")||s.hostname.endsWith(".inference.ml.azure.com"))return{type:"openai",baseUrl:`${c}/v1`,apiKey:r,modelId:n,wireModel:n,...o};Cpe.warn(t,`Unrecognized Azure deployment URL host '${s.hostname}' for model '${n??""}'.`)}a(v7s,"buildAzureProviderConfig");var Nlr=new Ae("BackgroundAgent.applyTurnOverrides");async function Lzn(t,e,r,n){let o=r.providerName?r.providerName:void 0;if(o!==void 0&&!NQ(await t.get(Ut).getToken()))throw new l2e(`BYOK is disabled for this account. Provider '${o}' cannot be used for model '${r.model??""}'.`,o,r.model);let s=await Bzn(t,o,r.model);if(o!==void 0&&s===void 0)throw new c2e(`BYOK provider '${o}' is misconfigured for model '${r.model??""}'. Verify the API key`+(o===go.Azure?" and per-model deployment URL":"")+" is configured for this provider/model.",o,r.model);let c=n.registry.getProviderModel(r.sessionId),l=r.model,u=l!==void 0&&c?.model!==l,d=c!==void 0&&c.provider!==o,f=c!==void 0&&(d||u),h=e,m=!1;if(f){Nlr.info(t,`Provider/model changed for session ${r.sessionId} (${c?.provider??"(built-in)"}/${c?.model??"(unchanged)"} \u2192 ${o??"(built-in)"}/${l??"(unchanged)"}); forcing close+resume cycle to strip provider-bound reasoning state.`);let g=await n.managerLifecycle.ensureManager();n.registry.forgetSession(r.sessionId),n.registry.deleteChatMode(r.sessionId);try{await g.closeSession(r.sessionId),m=!0,h=await n.getOrResumeSession(r.sessionId)}catch(A){if(m)throw n.registry.deleteProviderModel(r.sessionId),new Error(`Failed to resume session ${r.sessionId} after provider/model change: `+(A instanceof Error?A.message:String(A)));Nlr.warn(t,`Failed to close session ${r.sessionId} for provider/model change; continuing with existing session: `+(A instanceof Error?A.message:String(A))),h=e}}try{h.updateOptions({provider:s??null,...l?{model:l}:{},...r.reasoningEffort?{reasoningEffort:r.reasoningEffort}:{},...r.contextTier?{contextTier:r.contextTier}:{}})}catch(g){throw new Error(`Failed to bind BYOK provider '${o??"(built-in)"}' to session ${r.sessionId}: ${g instanceof Error?g.message:String(g)}`)}return n.registry.setProviderModel(r.sessionId,{provider:o,model:l??c?.model}),Nlr.info(t,`Rebound session ${r.sessionId} for this turn: provider=${o??"(built-in)"}, model=${l??"(unchanged)"}, reasoningEffort=${r.reasoningEffort??"(unchanged)"}`),h}a(Lzn,"applyTurnOverrides");p();async function Fzn(t,e,r,n,o){let s=C7s(e,n),c=o==="inline"||o==="inline-ask";await t.get(sg).applyPromptTemplateToRequest(r,s?[s]:[],c)}a(Fzn,"expandPromptTemplate");function C7s(t,e){let r=e.getWorkingDir(t);return r?{uri:ba(r)}:void 0}a(C7s,"getWorkspaceFolderForSession");As();var _g=new Ae("BackgroundAgent"),qZ="backgroundAgent",b7s="backgroundAgent.remote",S7s=new Set(["system.message","hook.start","hook.end"]),Ls=class{constructor(e){this.ctx=e;this.pendingExternalToolDefs=new Map;this.notificationSender=e.get(Hs),this.managerLifecycle=new lst(e),this.authBinding=new htt(e),this.registry=new Dat(e),this.mcpSync=new Sat(e,this.registry),this.remoteController=new Rat(e,{registry:this.registry,injectUserMessage:a((n,o,s)=>this.injectRemoteUserMessage(n,o,s),"injectUserMessage")}),this.turnDriver=new Bat(e,this.registry,this.notificationSender),e.get(Yo).onDidChangeHttpSettings(()=>{Got(this.ctx)}),ys(e,()=>{this.handleAuthStateChange()});try{this._skillsEnabledListener=this.ctx.get(em).onDidChangeSkillsEnabled(()=>{this.registry.clearChatMode()})}catch(n){if(!(n instanceof Y0))throw n}}static{a(this,"BackgroundAgentService")}async handleAuthStateChange(){let{changed:e,hadPrevious:r,hasCurrent:n}=await this.authBinding.detectIdentityChange();e&&(_g.info(this.ctx,"GitHub identity changed, clearing cached sessions",{hadPrevious:r,hasCurrent:n,cachedSessionCount:this.registry.size(),remoteDelegateCount:this.remoteController.delegateCount()}),await this.clearUserScopedState())}async clearUserScopedState(){this.pendingExternalToolDefs.clear(),await this.registry.removeAll(),this.managerLifecycle.clearAutoMode()}ensureManager(){return this.managerLifecycle.ensureManager()}get sdk(){return this.managerLifecycle.getSdk()}get autoModeManager(){return this.managerLifecycle.getAutoModeManager()}installBridgeSpanProcessor(){this.managerLifecycle.ensureBridgeInstalled()}async handleInteraction(e){let r=performance.now(),n=await this.getOrResumeSession(e.sessionId),o=xRn(n,e);return _t(this.ctx,"backgroundAgent.interaction",{requestSource:qZ,sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type,resultKind:e.type==="permission"?e.result.kind:""},{totalTimeMs:performance.now()-r}),o}buildAuthInfo(){return this.authBinding.buildAuthInfo()}applyTurnOverrides(e,r){return Lzn(this.ctx,e,r,{registry:this.registry,managerLifecycle:this.managerLifecycle,getOrResumeSession:a(n=>this.getOrResumeSession(n),"getOrResumeSession")})}applyChatModeSelection(e,r){return Ozn(this.ctx,e,r)}buildSessionOptions(e,r){return wzn(this.ctx,e,r,{buildAuthInfo:a(()=>this.buildAuthInfo(),"buildAuthInfo")})}async createSession(e){let r=performance.now();_g.info(this.ctx,"createSession called:",{model:e.model,workspaceFolder:e.workspaceFolder});let n=await this.ensureManager(),o=e.sessionId??ir(),s=e.inlineConfinedFile?njn(2):void 0,c=e.inlineConfinedFile?ijn(e.inlineConfinedFile):void 0,l=await this.buildSessionOptions(o,{...e,inlineTurnLimiter:s,inlineConfinementHook:c}),u=await n.createSession(l);return s&&this.registry.setTurnLimiter(o,s),_g.info(this.ctx,"Session created:",o),this.installBridgeSpanProcessor(),_t(this.ctx,"backgroundAgent.create",{requestSource:qZ,reasoningEffort:e.reasoningEffort??"",sessionId:o},{totalTimeMs:performance.now()-r}),this.registry.set(o,u),this.registry.setWorkingDir(o,to(e.workspaceFolder.uri).fsPath),e.inlineConfinedFile&&this.registry.setConfinedFile(o,e.inlineConfinedFile),{sessionId:o,workspacePath:u.workspacePath}}registerExternalTools(e,r){r?.length&&(this.pendingExternalToolDefs.set(e,r),_g.info(this.ctx,"Stored pending external tool definitions",{sessionId:e,toolCount:r.length}))}async getOrResumeSession(e,r={}){let n=this.registry.get(e);if(n){let h=this.pendingExternalToolDefs.get(e);return h&&(this.pendingExternalToolDefs.delete(e),n.updateOptions({externalToolDefinitions:h}),_g.info(this.ctx,"Applied pending external tool definitions to cached session",{sessionId:e,toolCount:h.length})),n}let o=await this.ensureManager(),s=r.workspaceFolder;if(!s){let h=await o.getSessionMetadata({sessionId:e});if(!h)throw new Error(`Session not found: ${e}`);let m=h.context?.cwd;if(!m)throw new Error(`Cannot resume session ${e} from disk: persisted metadata is missing working-directory context`);s={uri:ba(m)},_g.info(this.ctx,"Resuming session from disk via metadata fallback",{sessionId:e})}let c=this.pendingExternalToolDefs.get(e);c&&this.pendingExternalToolDefs.delete(e);let l=await this.buildSessionOptions(e,{...r,externalToolDefinitions:r.externalToolDefinitions??c,workspaceFolder:s}),u=await o.getSession(l,!0);if(!u)throw new Error(`Session not found: ${e}`);this.registry.set(e,u);let d=Array.from(u.getEvents()).filter(h=>h.type==="user.message").length;d>0&&this.registry.seedTurnIndexIfAbsent(e,d-1),this.registry.deleteChatMode(e),this.installBridgeSpanProcessor();let f=s?.uri?to(s.uri).fsPath:void 0;return f&&this.registry.setWorkingDir(e,f),u}async sendMessage(e,r){let n=await this.getOrResumeSession(e.sessionId),o=await this.applyTurnOverrides(n,e);await this.applyChatModeOverride(e.sessionId,o,e),await this.expandPromptTemplate(e.sessionId,e,e.chatMode),await this.applyChatModeSelection(o,e);let s={prompt:e.message,...e.sendMode?{mode:e.sendMode}:{}};this.applyAgentModeOverride(o,e,s);let c=e.chatMode==="inline-ask"||e.chatMode==="inline";if(e.references?.length&&!c){let h=IRn(e.references,this.ctx);h.length>0&&(s.attachments=h)}if(c){let h=this.registry.getConfinedFile(e.sessionId);if(h){let m=e.references?.find(A=>A.type==="file"&&A.uri===h),g=await sjn(h,m,this.ctx);if(g.promptFragment&&(s.prompt=`${s.prompt}${g.promptFragment}`),g.isLargeFile){let A=e.chatMode==="inline-ask"?$ot:Kor;o.updateOptions({availableTools:[...A,"view"]},{emitToolDefinitionsChanged:!0})}}}this.registry.getTurnLimiter(e.sessionId)?.reset();let l=performance.now(),u=this.registry.incrementTurnIndex(e.sessionId);this.turnDriver.wireAndSend(e.sessionId,o,s,u,r,!!e.providerName);let d={requestSource:qZ,chatMode:this.registry.getChatMode(e.sessionId)??"agent",sessionId:e.sessionId,safeModelId:T7s(e.model,e.providerName),providerName:e.providerName??"",reasoningEffort:e.reasoningEffort??"",contextTier:e.contextTier??"",hasReferences:String((e.references?.length??0)>0),turnIndex:String(u)},f={totalTimeMs:performance.now()-l,messageCharLen:e.message.length,referenceCount:e.references?.length??0};return _t(this.ctx,"backgroundAgent.send",d,f),yt(this.ctx,"backgroundAgent.send",Vt.createAndMarkAsIssued(d,f)),{}}applyChatModeOverride(e,r,n){return Nzn(this.ctx,e,r,n,this.registry)}applyAgentModeOverride(e,r,n){Dzn(e,r,n)}async injectRemoteUserMessage(e,r,n){let o=await this.getOrResumeSession(e),s={message:r};await this.expandPromptTemplate(e,s);let c={prompt:s.message,source:n},l=performance.now(),u=this.registry.incrementTurnIndex(e);this.turnDriver.wireAndSend(e,o,c,u),_t(this.ctx,"backgroundAgent.send",{requestSource:b7s,sessionId:e,safeModelId:"",providerName:"",reasoningEffort:"",contextTier:"",hasReferences:"false",turnIndex:String(u)},{totalTimeMs:performance.now()-l,messageCharLen:s.message.length,referenceCount:0})}expandPromptTemplate(e,r,n){return Fzn(this.ctx,e,r,this.registry,n)}async destroySession(e){try{return await this.remoteController.tearDownForDestroy(e.sessionId),this.pendingExternalToolDefs.delete(e.sessionId),await this.registry.remove(e.sessionId),await(await this.ensureManager()).deleteSession(e.sessionId),{success:!0}}catch(r){return _g.error(this.ctx,`Failed to destroy session ${e.sessionId}:`,r),{success:!1}}}async stopSession(e){let r=performance.now(),n=await this.getOrResumeSession(e);_g.info(this.ctx,"Stopping session via abort:",e),n.abortManualCompaction()&&_g.info(this.ctx,"Aborted in-progress manual compaction:",e),n.clearPendingItems(),await n.abort(),_t(this.ctx,"backgroundAgent.stop",{requestSource:qZ,sessionId:e},{totalTimeMs:performance.now()-r})}async compactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);_g.info(this.ctx,"Compacting history for session:",e);let o=await n.compactHistory();return _t(this.ctx,"backgroundAgent.compactHistory",{requestSource:qZ,sessionId:e},{totalTimeMs:performance.now()-r,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved}),{success:o.success,tokensRemoved:o.tokensRemoved,messagesRemoved:o.messagesRemoved,summaryContent:o.summaryContent,contextWindow:o.contextWindow}}async stopCompactHistory(e){let r=performance.now(),n=await this.getOrResumeSession(e);_g.info(this.ctx,"Aborting manual compaction for session:",e);let o=n.abortManualCompaction();return _t(this.ctx,"backgroundAgent.stopCompactHistory",{requestSource:qZ,sessionId:e,aborted:String(o)},{totalTimeMs:performance.now()-r}),{aborted:o}}async getPlanPath(e){return(await this.getOrResumeSession(e)).getPlanPath()}async resumeSession(e){let r=performance.now();_g.info(this.ctx,"resumeSession called:",e.sessionId);let n=await this.getOrResumeSession(e.sessionId,e),o=Array.from(n.getEvents());_t(this.ctx,"backgroundAgent.resume",{requestSource:qZ,reasoningEffort:e.reasoningEffort??"",sessionId:e.sessionId},{totalTimeMs:performance.now()-r});let s=o.filter(c=>!S7s.has(c.type));return{sessionId:e.sessionId,workspacePath:n.workspacePath,events:s}}async listSessions(e){let n=await(await this.ensureManager()).listSessions(),o=n;return e&&(o=n.filter(s=>!(e.cwd&&s.context?.cwd!==e.cwd||e.gitRoot&&s.context?.gitRoot!==e.gitRoot||e.repository&&s.context?.repository!==e.repository||e.branch&&s.context?.branch!==e.branch))),{sessions:o.map(s=>({sessionId:s.sessionId,startTime:s.startTime instanceof Date?s.startTime.toISOString():String(s.startTime),modifiedTime:s.modifiedTime instanceof Date?s.modifiedTime.toISOString():String(s.modifiedTime),summary:s.summary,isRemote:s.isRemote,context:s.context}))}}async listModels(e){_g.info(this.ctx,"listModels called",{forceRefresh:e}),await this.ensureManager();let r=await this.buildAuthInfo();_g.info(this.ctx,"listModels proxy diagnostics",{HTTPS_PROXY:process.env.HTTPS_PROXY?"(set)":"(not set)",HTTP_PROXY:process.env.HTTP_PROXY?"(set)":"(not set)",NO_PROXY:process.env.NO_PROXY??"(not set)",NODE_TLS_REJECT_UNAUTHORIZED:process.env.NODE_TLS_REJECT_UNAUTHORIZED??"(not set)",NODE_EXTRA_CA_CERTS:process.env.NODE_EXTRA_CA_CERTS??"(not set)"});try{let n=await this.sdk.getAvailableModels(r);n.length===0?_g.warn(this.ctx,"No models available. Check authentication and Copilot subscription status."):_g.info(this.ctx,`Successfully retrieved ${n.length} models`);let o=[];this.ctx.get(lu).getPolicyValue("autoModel.enabled")!==!1&&o.push(this.buildAutoModelEntry());let s=[...o,...n];return _g.debug(this.ctx,"Models retrieved:",s.map(c=>c.id)),{models:s}}catch(n){let o=n instanceof Error?n.message:String(n);throw _g.error(this.ctx,"getAvailableModels failed",{error:o,stack:n instanceof Error?n.stack:void 0}),new Error(`Failed to retrieve models: ${o}`)}}buildAutoModelEntry(){return{id:this.sdk.AUTO_MODEL_ID,name:"Auto",preview:!1,capabilities:{family:this.sdk.AUTO_MODEL_ID,supports:{vision:!0},limits:{max_context_window_tokens:0}}}}async enableRemote(e){let r=await this.getOrResumeSession(e);return this.remoteController.enableForSession(e,r)}async disableRemote(e){let r=await this.getOrResumeSession(e);await this.remoteController.disableForSession(r)}getRemoteStatus(e){return this.remoteController.getStatus(e)}async shutdown(){this.mcpSync.dispose(),this._skillsEnabledListener?.dispose(),this._skillsEnabledListener=void 0,await this.clearUserScopedState(),Yor(),RRn(),await this.managerLifecycle.dispose()}};function T7s(t,e){return e?"byok models":t??""}a(T7s,"safeModelId");p();p();var n0=(r=>(r.Background="BACKGROUND",r.Claude="CLAUDE",r))(n0||{});p();var Uzn=fe(require("path"));function jZ(t,e){if(e!=="CLAUDE")throw new Error(`ClaudeCodeAgentService.${t}: expected agentProvider='CLAUDE', got '${String(e)}'`)}a(jZ,"assertClaudeProvider");function bpe(t,e,r){if(typeof r!="string"||r.length===0)throw new Error(`${t}: ${e} is required`)}a(bpe,"assertNonEmptyString");function I7s(t,e,r){if(r===void 0)throw new Error(`${t}: ${e} is required`);try{to(r)}catch(n){throw new Error(`${t}: ${e} is not a valid URI: ${r}`,{cause:n})}}a(I7s,"assertFsUri");function x7s(t,e,r){if(!Uzn.isAbsolute(r))throw new Error(`${t}: ${e} must be an absolute path, got '${r}'`)}a(x7s,"assertAbsolutePath");async function u2e(t,e){if(e===void 0)return;let n=(await t.get(Fa).getMetadata()).find(o=>o.id===e);if(!n)throw new Error(`Unknown model id: ${e}`);if(!UHe(n.capabilities.family))throw new Error(`Model ${e} is not a Claude model (family: ${n.capabilities.family})`)}a(u2e,"validateClaudeModel");async function Qzn(t,e){jZ("createSession",e.agentProvider),I7s("createSession","workspaceFolder.uri",e.workspaceFolder?.uri),await u2e(t,e.model)}a(Qzn,"validateAgentCreate");async function qzn(t,e){jZ("resumeSession",e.agentProvider),bpe("resumeSession","sessionId",e.sessionId),await u2e(t,e.model)}a(qzn,"validateAgentResume");async function jzn(t,e){jZ("sendMessage",e.agentProvider),bpe("sendMessage","sessionId",e.sessionId),bpe("sendMessage","message",e.message),await u2e(t,e.model)}a(jzn,"validateAgentSend");function Hzn(t,e){jZ("stopSession",e.agentProvider),bpe("stopSession","sessionId",e.sessionId)}a(Hzn,"validateAgentStop");function Gzn(t,e){jZ("destroySession",e.agentProvider),bpe("destroySession","sessionId",e.sessionId)}a(Gzn,"validateAgentDestroy");function $zn(t,e){jZ("listSessions",e.agentProvider),bpe("listSessions","cwd",e.cwd),x7s("listSessions","cwd",e.cwd)}a($zn,"validateAgentListSessions");function Vzn(t,e){jZ("listModels",e.agentProvider)}a(Vzn,"validateAgentListModels");p();p();var zzn=require("child_process"),Spe=fe(require("path")),d2e=fe(TL()),Yzn=require("util");var Kzn=5e3,Wzn=200,Mlr=class{constructor(){this.execFile=(0,Yzn.promisify)(zzn.execFile);this.cache=new Map}static{a(this,"ClaudeCliVersionChecker")}check(e){if(!e)return Promise.resolve({severity:"error",message:"Claude Code CLI path is not configured. Install @anthropic-ai/claude-code (e.g. `npm install -g @anthropic-ai/claude-code`), then open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the `claude` executable."});let r=Spe.resolve(e),n=this.cache.get(r);if(n)return n;let o=this.computeStatus(r).then(s=>(s.severity==="error"&&this.cache.delete(r),s));return this.cache.set(r,o),o}clearCache(e){if(e){this.cache.delete(Spe.resolve(e));return}this.cache.clear()}async computeStatus(e){let r=w7s(),n=d2e.coerce(r);if(!n)return{severity:"error",message:`Could not parse expected Claude Code CLI version "${r}" from packaged metadata. This is an internal error; please report it.`};let o=R7s(e);if(o)return{severity:"error",message:o};let s;try{s=(await this.execFile(e,["--version"],{timeout:Kzn,windowsHide:!0})).stdout}catch(l){return{severity:"error",message:P7s(e,l)}}let c=d2e.coerce(s);return c?d2e.satisfies(c,`~${n.major}.${n.minor}.0`)?{severity:"ok"}:{severity:"warning",message:`Claude Code CLI at "${e}" reports version ${c.version}, but this language server was built against ${n.version}. The session will still start, but SDK behavior may be unstable on protocol drift. Run \`npm install -g @anthropic-ai/claude-code@${n.version}\` to align versions.`}:{severity:"error",message:`Could not parse Claude Code CLI version from "${e}" --version output: "${Jzn(s)}".`}}},Tpe=new Mlr;function w7s(){let t=TSe.anthropicClaude?.cliPackageVersion;return typeof t=="string"?t:""}a(w7s,"getExpectedVersionRaw");function R7s(t){let e=Spe.basename(t).toLowerCase(),r=process.platform==="win32"?"claude.exe":"claude";if(e!==r)return`Claude Code CLI path "${t}" must point at the "${r}" executable, but the basename is "${Spe.basename(t)}". Open your editor's Copilot settings and set the Claude Code CLI Path field to the absolute path of the binary itself (typically under \`/node_modules/@anthropic-ai/claude-code/bin/\`).`}a(R7s,"validateBasename");function P7s(t,e){let r=e;if(r?.code==="ENOENT")return`Claude Code CLI not found at "${t}". Check that the file exists and is executable.`;if(r?.killed&&r?.signal==="SIGTERM")return`Claude Code CLI at "${t}" did not respond to --version within ${Kzn/1e3}s.`;let n=typeof r?.stderr=="string"?Jzn(r.stderr):"",o=r?.code!==void 0?` (exit code ${String(r.code)})`:"",s=n?` stderr: "${n}"`:"",c=r?.message?`: ${r.message}`:"";return`Failed to run "${t} --version"${o}${c}${s}`}a(P7s,"formatSpawnError");function Jzn(t){let e=t.trim();return e.length<=Wzn?e:`${e.slice(0,Wzn)}\u2026`}a(Jzn,"truncate");p();var f2e=class{constructor(){this._entries=new Map}static{a(this,"PendingRequestRegistry")}register(e){if(this._entries.has(e))throw new Error(`PendingRequestRegistry: duplicate key ${e}`);return{promise:new Promise((n,o)=>{this._entries.set(e,{resolve:n,reject:o})}),isSettled:a(()=>!this._entries.has(e),"isSettled")}}respond(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.resolve(r),!0):!1}rejectOne(e,r){let n=this._entries.get(e);return n?(this._entries.delete(e),n.reject(r),!0):!1}has(e){return this._entries.has(e)}respondAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.resolve(e)}rejectAll(e){let r=[...this._entries.values()];this._entries.clear();for(let n of r)n.reject(e)}};p();function Zzn(t,e,r){let n=r.toolUseID,s={intention:r.title??`${t} tool call`,...n!==void 0&&{toolCallId:n}},c=a(l=>typeof l=="string"?l:void 0,"str");switch(t){case"Bash":return{...s,kind:"shell",fullCommandText:c(e.command)??""};case"Write":case"Edit":case"MultiEdit":case"NotebookEdit":return{...s,kind:"write",fileName:c(r.blockedPath)??c(e.file_path)??c(e.notebook_path)??""};case"Read":return{...s,kind:"read",path:c(r.blockedPath)??c(e.file_path)??""};case"WebFetch":return{...s,kind:"url",url:c(e.url)??""};default:{if(t.startsWith("mcp__")){let l=t.split("__");return{...s,kind:"mcp",serverName:l[1]??"",toolName:l.slice(2).join("__"),args:e}}return{...s,kind:"custom-tool",toolName:t,args:e}}}}a(Zzn,"buildPermissionRequest");function Xzn(t,e){return t.kind==="approve-once"?{behavior:"allow",updatedInput:e}:{behavior:"deny",message:k7s(t)}}a(Xzn,"translatePermissionResult");function k7s(t){switch(t.kind){case"denied-by-rules":return"Permission denied by approval rules";case"denied-no-approval-rule-and-could-not-request-from-user":return"Permission denied: no approval rule and user prompt unavailable";case"denied-interactively-by-user":return t.feedback?`Permission denied by user: ${t.feedback}`:"Permission denied by user";case"denied-by-content-exclusion-policy":return`Permission denied by content-exclusion policy: ${t.message}`;default:return`Permission denied: ${t.kind}`}}a(k7s,"formatDenyMessage");function eYn(t){let e=t;if(!Array.isArray(e.questions))return null;let r=[];for(let n of e.questions){if(typeof n?.question!="string"||n.question.length===0)return null;r.push({questionText:n.question,header:typeof n.header=="string"&&n.header.length>0?n.header:void 0,choices:Array.isArray(n.options)?n.options.map(o=>o?.label).filter(o=>typeof o=="string"):void 0})}return r}a(eYn,"buildPreparedQuestions");function tYn(t,e){return{question:t.header?`${t.header} +${t.questionText}`:t.questionText,...t.choices!==void 0&&{choices:t.choices},allowFreeform:!0,...e!==void 0&&{toolCallId:e}}}a(tYn,"buildUserInputRequest");p();var Olr=require("fs"),nYn=fe(require("path"));var p2e=new Ae("ClaudeCode.ReferenceFormatter"),D7s={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp"},rYn=5*1024*1024;async function iYn(t,e){if(!t?.length)return[];let r=[],n=[];for(let s of t)switch(s.type){case"file":{let c=Ko(s.uri);if(!c){p2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}let l=M7s(c);if(l){let u=await N7s(c,l,e);u&&r.push(u)}else{let u=s.selection?`:L${s.selection.start.line+1}-L${s.selection.end.line+1}`:"";n.push(`- ${c}${u}`)}break}case"directory":{let c=Ko(s.uri);if(!c){p2e.debug(e,`Skipping reference with non-fs URI: ${s.uri}`);break}n.push(`- ${c}/`);break}default:p2e.debug(e,`Skipping unsupported reference type: ${s.type}`);break}let o=[...r];return n.length>0&&o.push({type:"text",text:O7s(n)}),o}a(iYn,"buildReferences");async function N7s(t,e,r){try{let n=await Olr.promises.stat(t);if(n.size>rYn){p2e.debug(r,`Skipping oversize image reference (${n.size} > ${rYn} bytes): ${t}`);return}let o=(await Olr.promises.readFile(t)).toString("base64");return{type:"image",source:{type:"base64",media_type:e,data:o}}}catch(n){p2e.debug(r,`Failed to read image reference ${t}: ${n instanceof Error?n.message:String(n)}`);return}}a(N7s,"tryReadImageBlock");function M7s(t){return D7s[nYn.extname(t).toLowerCase()]}a(M7s,"imageMediaTypeForPath");function O7s(t){return` The user provided the following references: `+t.join(` `)+` IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task. -`}a(cQs,"wrapInSystemReminder");p();var xzn=require("crypto");function _lr(t,e={}){let r=new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[kzn(r,"synthetic",t.error)];switch(t.type){case"system":return lQs(t,r);case"assistant":return uQs(t,r,e.streamingEnabled===!0,e.blockCursor);case"user":return e.includeUserText===!0?fQs(t,r):dQs(t,r);case"result":return mQs(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(_lr,"translate");function wzn(t,e){if(t.parent_tool_use_id!==null)return[];let r=t.event,n=new Date().toISOString();switch(r.type){case"message_start":return[{id:e,timestamp:n,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:e}}];case"content_block_delta":{let o=r.delta;switch(o.type){case"text_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${r.index}`,deltaContent:o.text}}];case"thinking_delta":return[{id:dE(),timestamp:n,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${r.index}`,deltaContent:o.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(wzn,"translatePartial");function lQs(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:dE(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:dE(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:dE(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(lQs,"translateSystem");function uQs(t,e,r,n){let o=t.message?.id??dE(),s=[];r||s.push({id:o,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:o,interactionId:o}});let c=t.message?.content??[],l=n??new Map,u=l.get(o)??0;return c.forEach(d=>{let f=u++;switch(d.type){case"text":{let h=d.text;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${o}:${f}`,content:h,model:t.message?.model}});break}case"thinking":{let h=d.thinking;typeof h=="string"&&h.length>0&&s.push({id:dE(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${o}:${f}`,content:h}});break}case"tool_use":{let h=d;s.push({id:dE(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof h.id=="string"?h.id:dE(),toolName:typeof h.name=="string"?h.name:"unknown",arguments:h.input}});break}default:break}}),l.set(o,u),s}a(uQs,"translateAssistant");function dQs(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(Rzn(o,e));return n}a(dQs,"translateUserLive");function fQs(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=Izn(n);return o.length>0&&r.push(Tzn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(Rzn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=Izn(s);c.length>0&&r.push(Tzn(e,c))}}}return r}a(fQs,"translateUserHistory");function Rzn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=gQs(t.content);return{id:dE(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:dE(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(Rzn,"buildToolExecutionComplete");function Tzn(t,e){return{id:dE(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(Tzn,"buildUserMessage");function pQs(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(pQs,"stripSystemReminders");var hQs=/^\[Request interrupted by user[^\]]*\]$/;function Izn(t){let e=pQs(t);return hQs.test(e)?"":e}a(Izn,"sanitizeUserText");function mQs(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:dE(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.result;o.push(kzn(e,typeof l=="string"?l:"error",typeof u=="string"?u:"Claude turn ended with error"))}return o.push({id:dE(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(mQs,"translateResult");function kzn(t,e,r){return{id:dE(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(kzn,"buildSessionError");function gQs(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` -`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(gQs,"flattenToolResultContent");function dE(){return(0,xzn.randomUUID)()}a(dE,"newId");function Pzn(t){let e=[],r=new Map;for(let n of t){let o=AQs(n);if(o)try{e.push(..._lr(o,{streamingEnabled:!1,includeUserText:!0,blockCursor:r}))}catch{}}return e}a(Pzn,"translateHistory");function AQs(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&yQs(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a(AQs,"adaptHistoryMessage");function yQs(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a(yQs,"isSyntheticReplayUserMessage");p();var om=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsageNanoAiuBySession=new Map}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._copilotUsageNanoAiuBySession.get(e)??0;this._copilotUsageNanoAiuBySession.set(e,n+r)}takeCopilotUsageNanoAiuForSession(e){let r=this._copilotUsageNanoAiuBySession.get(e);return this._copilotUsageNanoAiuBySession.delete(e),r}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsageNanoAiuBySession.delete(e)}};var Dat=ce(require("path"));Ns();var Ab=new ge("ClaudeCodeAgent.session"),yb="ClaudeCodeSession",S2e=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(om);s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode)}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(om).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){Ab.warn(this.ctx,`${yb}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0)return;let r=e??"default";if(r!==this._permissionMode&&(this._permissionMode=r,this.ctx.get(om).setPermissionModeForSession(this.sessionId,r),this._query))try{await this._query.setPermissionMode(r)}catch(n){Ab.warn(this.ctx,`${yb}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){Ab.warn(this.ctx,`${yb}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._abortController.abort(),this.ctx.get(om).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{Ab.warn(this.ctx,`${yb}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&e.permissionMode!==this._permissionMode&&await this.setPermissionMode(e.permissionMode),this.ctx.get(om).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new rA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1;let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{Ab.info(this.ctx,`${yb}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),Ab.info(this.ctx,`${yb}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await Szn(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??gr()};this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=qt(this.ctx,je.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await xpe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(Ab.warn(this.ctx,`${yb}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep()}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],disallowedTools:["WebSearch"],thinking:{type:"adaptive"},includePartialMessages:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},c=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:s});this._query=c,this._isResumed=!0,Ab.info(this.ctx,`${yb}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{Ab.error(this.ctx,`${yb}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(F3).resolvePath();return`${Dat.dirname(e)}${Dat.delimiter}${process.env.PATH??""}`}catch(e){return Ab.warn(this.ctx,`${yb}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new rA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){this._assistantBlockCursor.clear();let o=this._currentInvokeDone;this._currentInvokeDone=void 0,o?.resolve()}}this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){Ab.error(this.ctx,`${yb}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0),this._assistantBlockCursor.clear();let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&Ab.error(this.ctx,`${yb}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{let n=e?.type==="result"?this.ctx.get(om).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=_lr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){Ab.error(this.ctx,`${yb}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=wzn(e,r);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){Ab.error(this.ctx,`${yb}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}};p();var Nzn=ce(require("http")),Mzn=require("node:stream"),vlr=require("node:stream/promises"),Ozn=require("node:string_decoder");Ns();var fE=new ge("ClaudeMessagesProxyServer"),EQs=["interleaved-thinking","context-management","advanced-tool-use"],Clr="cls_claude_agent",X_={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},_Qs=new Map([[400,X_.InvalidRequest],[401,X_.Authentication],[403,X_.Permission],[404,X_.NotFound],[413,X_.RequestTooLarge],[429,X_.RateLimit],[529,X_.Overloaded]]),Dzn=1024,CQs=32e3,zZ=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${gr()}`,r=Nzn.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},fE.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(fE.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,X_.NotFound,"Not found")}catch(o){fE.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,X_.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=vQs(e.headers,n);if(!o.valid){fE.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,X_.Authentication,"Invalid authentication");return}o.sessionId&&fE.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await PQs(e),c;try{c=JSON.parse(s)}catch(l){fE.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,X_.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Qt),l=this.ctx.get(ar),u;try{u=await c.getToken()}catch(_){fE.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,X_.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=vSe(this.ctx,u,"v1/messages"),g=SQs(this.ctx,n,d),A;try{({headers:A}=await VHe(this.ctx,g,u.token))}catch(_){fE.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,X_.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(fE.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(WHe(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";fE.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,DQs(_.status),MQs(w)??`Upstream error ${_.status}`);return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(om),R=NQs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,vlr.pipeline)(b,R,o)}else await(0,vlr.pipeline)(b,o)}catch(_){if(y.signal.aborted){fE.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(fE.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,X_.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(dc).getMetadata()).find(s=>s.id===r)}catch(n){fE.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return r;let s=o?this.ctx.get(om).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&fE.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return xQs(e,n,s)?(fE.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return IQs(e)?(fE.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function vQs(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(vQs,"extractSessionId");function bQs(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&EQs.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(bQs,"filterSupportedBetas");function SQs(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...Gm(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?bQs(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=TQs(u,d?PWe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Clr}/${h}`:`${Clr}${h.substring(m)}`}else s["User-Agent"]=Clr;return s}a(SQs,"buildUpstreamHeaders");function TQs(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(TQs,"mergeBetas");function IQs(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(IQs,"sanitizeCacheControl");function xQs(t,e,r){if(!e)return!1;let n=t.thinking;if(!n||typeof n!="object")return!1;let o=n.type;return o!=="adaptive"&&o!=="enabled"?!1:e.capabilities?.supports?.adaptive_thinking?wQs(t,n,e,r):kQs(t,n)}a(xQs,"normalizeThinkingForModel");function wQs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=RQs(n,o),l={effort:CQ(o,s)??"medium"},u=e.type==="adaptive"&&Object.keys(e).length===1,d=t.output_config,f=typeof d?.effort=="string"&&d.effort===l.effort;return u&&f?!1:(t.thinking={type:"adaptive"},t.output_config=l,!0)}a(wQs,"_writeAdaptiveShape");function RQs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(RQs,"_normaliseUserEffortForCapi");function kQs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:Dzn,o=Math.min(CQs,Math.max(Dzn,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(kQs,"_writeLegacyShape");function PQs(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(PQs,"readRequestBody");function DQs(t){return _Qs.get(t)??X_.Api}a(DQs,"mapStatusToAnthropicErrorType");function NQs(t){let e=new Ozn.StringDecoder("utf8"),r="",n=0,o=a(s=>{if(!s.startsWith("data:"))return;let c=s.slice(5).trimStart();if(!(!c||c==="[DONE]")&&c.includes("copilot_usage"))try{let u=JSON.parse(c).copilot_usage?.total_nano_aiu;typeof u=="number"&&Number.isFinite(u)&&u>0&&(n=u)}catch{}},"inspectLine");return new Mzn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` +`}a(O7s,"wrapInSystemReminder");p();var aYn=require("crypto");function Blr(t,e={}){let r=new Date().toISOString();if(t.type==="error"&&typeof t.error=="string")return[uYn(r,"synthetic",t.error)];switch(t.type){case"system":return B7s(t,r);case"assistant":return L7s(t,r,e.streamingEnabled===!0,e.blockCursor);case"user":return e.includeUserText===!0?U7s(t,r):F7s(t,r);case"result":return j7s(t,r,e.sessionModel,e.copilotUsageNanoAiu);default:return[]}}a(Blr,"translate");function cYn(t,e){if(t.parent_tool_use_id!==null)return[];let r=t.event,n=new Date().toISOString();switch(r.type){case"message_start":return[{id:e,timestamp:n,parentId:null,type:"assistant.turn_start",data:{turnId:e,interactionId:e}}];case"content_block_delta":{let o=r.delta;switch(o.type){case"text_delta":return[{id:fE(),timestamp:n,parentId:null,type:"assistant.message_delta",ephemeral:!0,data:{messageId:`${e}:${r.index}`,deltaContent:o.text}}];case"thinking_delta":return[{id:fE(),timestamp:n,parentId:null,type:"assistant.reasoning_delta",ephemeral:!0,data:{reasoningId:`${e}:${r.index}`,deltaContent:o.thinking}}];default:return[]}}case"content_block_start":case"content_block_stop":case"message_delta":case"message_stop":return[];default:return[]}}a(cYn,"translatePartial");function B7s(t,e){let r=t.subtype;if(r==="init"){let n=t;return[{id:fE(),timestamp:e,parentId:null,type:"session.start",data:{sessionId:n.session_id,version:1,producer:"claude-code-sdk",copilotVersion:"",startTime:e,selectedModel:n.model,context:n.cwd?{cwd:n.cwd}:void 0}}]}return r==="compact_boundary"?[{id:fE(),timestamp:e,parentId:null,type:"session.compaction_start",data:{}},{id:fE(),timestamp:e,parentId:null,type:"session.compaction_complete",data:{success:!0}}]:[]}a(B7s,"translateSystem");function L7s(t,e,r,n){let o=t.message?.id??fE(),s=[];r||s.push({id:o,timestamp:e,parentId:null,type:"assistant.turn_start",data:{turnId:o,interactionId:o}});let c=t.message?.content??[],l=n??new Map,u=l.get(o)??0;return c.forEach(d=>{let f=u++;switch(d.type){case"text":{let h=d.text;typeof h=="string"&&h.length>0&&s.push({id:fE(),timestamp:e,parentId:null,type:"assistant.message",data:{messageId:`${o}:${f}`,content:h,model:t.message?.model}});break}case"thinking":{let h=d.thinking;typeof h=="string"&&h.length>0&&s.push({id:fE(),timestamp:e,parentId:null,type:"assistant.reasoning",data:{reasoningId:`${o}:${f}`,content:h}});break}case"tool_use":{let h=d;s.push({id:fE(),timestamp:e,parentId:null,type:"tool.execution_start",data:{toolCallId:typeof h.id=="string"?h.id:fE(),toolName:typeof h.name=="string"?h.name:"unknown",arguments:h.input}});break}default:break}}),l.set(o,u),s}a(L7s,"translateAssistant");function F7s(t,e){let r=t.message?.content;if(!Array.isArray(r))return[];let n=[];for(let o of r)o.type==="tool_result"&&n.push(lYn(o,e));return n}a(F7s,"translateUserLive");function U7s(t,e){let r=[],n=t.message?.content;if(typeof n=="string"){let o=sYn(n);return o.length>0&&r.push(oYn(e,o)),r}if(!Array.isArray(n))return r;for(let o of n){if(o.type==="tool_result"){r.push(lYn(o,e));continue}if(o.type==="text"){let s=o.text;if(typeof s=="string"){let c=sYn(s);c.length>0&&r.push(oYn(e,c))}}}return r}a(U7s,"translateUserHistory");function lYn(t,e){let r=t.tool_use_id,n=t.is_error===!0,o=H7s(t.content);return{id:fE(),timestamp:e,parentId:null,type:"tool.execution_complete",data:{toolCallId:typeof r=="string"?r:fE(),success:!n,result:n?void 0:{content:o??""},error:n?{message:o??"Tool execution failed"}:void 0}}}a(lYn,"buildToolExecutionComplete");function oYn(t,e){return{id:fE(),timestamp:t,parentId:null,type:"user.message",data:{content:e}}}a(oYn,"buildUserMessage");function Q7s(t){return t.replace(/[\s\S]*?<\/system-reminder>\s*/g,"").trim()}a(Q7s,"stripSystemReminders");var q7s=/^\[Request interrupted by user[^\]]*\]$/;function sYn(t){let e=Q7s(t);return q7s.test(e)?"":e}a(sYn,"sanitizeUserText");function j7s(t,e,r,n){let o=[],s=t.usage;if(s&&o.push({id:fE(),timestamp:e,parentId:null,type:"assistant.usage",ephemeral:!0,data:{model:r??"unknown",inputTokens:s.input_tokens,outputTokens:s.output_tokens,cacheWriteTokens:s.cache_creation_input_tokens,cacheReadTokens:s.cache_read_input_tokens,...n!==void 0&&n>0?{copilotUsage:{totalNanoAiu:n}}:{}}}),t.is_error===!0){let l=t.subtype,u=t.errors,d=t.result,f=Array.isArray(u)&&u.find(h=>typeof h=="string"&&h.length>0)||(typeof d=="string"&&d.length>0?d:void 0)||"Claude turn ended with error";o.push(uYn(e,typeof l=="string"?l:"error",f))}return o.push({id:fE(),timestamp:e,parentId:null,type:"session.idle",ephemeral:!0,data:{}}),o}a(j7s,"translateResult");function uYn(t,e,r){return{id:fE(),timestamp:t,parentId:null,type:"session.error",data:{errorType:e,message:r}}}a(uYn,"buildSessionError");function H7s(t){if(t!=null){if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(n&&typeof n=="object"){let o=n.text;typeof o=="string"&&e.push(o)}let r=e.join(` +`);return r.length>0?r:void 0}try{return JSON.stringify(t)}catch{return}}}a(H7s,"flattenToolResultContent");function fE(){return(0,aYn.randomUUID)()}a(fE,"newId");function dYn(t){let e=[],r=new Map;for(let n of t){let o=G7s(n);if(o)try{e.push(...Blr(o,{streamingEnabled:!1,includeUserText:!0,blockCursor:r}))}catch{}}return e}a(dYn,"translateHistory");function G7s(t){if(!(!t||typeof t!="object"||!t.message||typeof t.message!="object")&&(t.type==="user"||t.type==="assistant"))return t.type==="user"&&$7s(t)?void 0:{type:t.type,message:t.message,parent_tool_use_id:t.parent_tool_use_id,uuid:t.uuid,session_id:t.session_id}}a(G7s,"adaptHistoryMessage");function $7s(t){let e=t;return e.isMeta===!0||e.isCompactSummary===!0||e.isVisibleInTranscriptOnly===!0||e.isSynthetic===!0}a($7s,"isSyntheticReplayUserMessage");p();var am=class{constructor(){this._modelBySession=new Map;this._permissionModeBySession=new Map;this._reasoningEffortBySession=new Map;this._copilotUsageNanoAiuBySession=new Map}static{a(this,"ClaudeSessionStateService")}setModelForSession(e,r){if(r===void 0){this._modelBySession.delete(e);return}this._modelBySession.set(e,r)}getModelForSession(e){return this._modelBySession.get(e)}setPermissionModeForSession(e,r){if(r===void 0){this._permissionModeBySession.delete(e);return}this._permissionModeBySession.set(e,r)}getPermissionModeForSession(e){return this._permissionModeBySession.get(e)}setReasoningEffortForSession(e,r){if(r===void 0){this._reasoningEffortBySession.delete(e);return}this._reasoningEffortBySession.set(e,r)}getReasoningEffortForSession(e){return this._reasoningEffortBySession.get(e)}addCopilotUsageNanoAiuForSession(e,r){if(!Number.isFinite(r)||r<=0)return;let n=this._copilotUsageNanoAiuBySession.get(e)??0;this._copilotUsageNanoAiuBySession.set(e,n+r)}takeCopilotUsageNanoAiuForSession(e){let r=this._copilotUsageNanoAiuBySession.get(e);return this._copilotUsageNanoAiuBySession.delete(e),r}clear(e){this._modelBySession.delete(e),this._permissionModeBySession.delete(e),this._reasoningEffortBySession.delete(e),this._copilotUsageNanoAiuBySession.delete(e)}};var Lat=fe(require("path"));As();var yf=new Ae("ClaudeCodeAgent.session"),Ef="ClaudeCodeSession",h2e=class{constructor(e,r,n,o){this.ctx=e;this.sdkWrapper=r;this.notificationSender=n;this._terminalErrorEmittedForTurn=!1;this._assistantBlockCursor=new Map;this._abortController=new AbortController;this._isResumed=!1;this._isProcessing=!1;this._disposed=!1;this._permissionRegistry=new f2e;this._userInputRegistry=new f2e;this._handleCanUseTool=a((e,r,n)=>this._disposed?Promise.resolve({behavior:"deny",message:`Session ${this.sessionId} disposed`}):e==="AskUserQuestion"?this._handleAskUserQuestion(r,n):e==="ToolSearch"||e==="ExitPlanMode"?Promise.resolve({behavior:"allow",updatedInput:r}):this._handlePermissionRequest(e,r,n),"_handleCanUseTool");this.sessionId=o.sessionId,this._cwd=o.cwd,this._model=o.model,this._permissionMode=o.permissionMode,this._isResumed=!(o.isNewSession??!0),this._proxyConfig=o.proxyConfig;let s=this.ctx.get(am);s.setModelForSession(this.sessionId,this._model),s.setPermissionModeForSession(this.sessionId,this._permissionMode)}static{a(this,"ClaudeCodeSession")}get cwd(){return this._cwd}async invoke(e){if(this._disposed){let r=`Session ${this.sessionId} has been disposed`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}if(this._isProcessing){let r=`Session ${this.sessionId} is busy: a previous invoke is still streaming. Wait for the terminal sessionUpdate before sending another prompt.`;throw await this._sendSessionUpdate({type:"error",error:r}),new Error(r)}this._isProcessing=!0;try{await this._runInvoke(e)}finally{this._isProcessing=!1}}async setModel(e){if(e!==this._model&&(this._model=e,this.ctx.get(am).setModelForSession(this.sessionId,e),this._query))try{await this._query.setModel(e)}catch(r){yf.warn(this.ctx,`${Ef}: setModel on active query failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async setPermissionMode(e){if(e===void 0&&this._permissionMode!==void 0)return;let r=e??"default";if(r!==this._permissionMode&&(this._permissionMode=r,this.ctx.get(am).setPermissionModeForSession(this.sessionId,r),this._query))try{await this._query.setPermissionMode(r)}catch(n){yf.warn(this.ctx,`${Ef}: setPermissionMode on active query failed`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async interrupt(){let e=this._query;if(e)try{await e.interrupt()}catch(r){yf.warn(this.ctx,`${Ef}: interrupt() failed`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}dispose(){if(this._disposed)return;this._disposed=!0,this._dropAllPending("disposed"),this._abortController.abort(),this.ctx.get(am).clear(this.sessionId);let e=this._promptWaiter;this._promptWaiter=void 0,e?.resolve();let r=this._currentInvokeDone;this._currentInvokeDone=void 0,r?.reject(new Error(`Session ${this.sessionId} disposed`));let n=this._query;n&&n.interrupt().catch(o=>{yf.warn(this.ctx,`${Ef}: interrupt during dispose failed`,{sessionId:this.sessionId,error:o instanceof Error?o.message:String(o)})})}async _runInvoke(e){e.model!==void 0&&e.model!==this._model&&await this.setModel(e.model),e.permissionMode!==void 0&&e.permissionMode!==this._permissionMode&&await this.setPermissionMode(e.permissionMode),this.ctx.get(am).setReasoningEffortForSession(this.sessionId,e.reasoningEffort),this.ctx.get(am).takeCopilotUsageNanoAiuForSession(this.sessionId);let r=new nA;this._currentInvokeDone=r,this._terminalErrorEmittedForTurn=!1;let n;try{this._query||await this._startQuery();let o=this._query;n=e.token?.onCancellationRequested(()=>{yf.info(this.ctx,`${Ef}: cancellation requested`,{sessionId:this.sessionId}),o.interrupt()}),yf.info(this.ctx,`${Ef}.invoke`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,messageCharLen:e.message.length,referenceCount:e.references?.length??0});let s=await iYn(e.references,this.ctx),l={type:"user",message:{role:"user",content:[{type:"text",text:e.message},...s]},parent_tool_use_id:null,session_id:this.sessionId,uuid:e.messageId??ir()};this._pendingPromptInput=l;let u=this._promptWaiter;this._promptWaiter=void 0,u?.resolve(),await r.promise}catch(o){throw await this._emitTerminalError(o),o}finally{n?.dispose(),this._currentInvokeDone===r&&(this._currentInvokeDone=void 0)}}async _startQuery(){let e=this._proxyConfig,r=this._isResumed,n=Ht(this.ctx,Je.ClaudeCliPath)||process.env.CLAUDE_CLI_PATH,o=await Tpe.check(n);if(o.severity==="error")throw new Error(o.message);o.severity==="warning"&&(yf.warn(this.ctx,`${Ef}: ${o.message}`,{sessionId:this.sessionId}),this.notificationSender.showWarningMessageOnlyOnce("claude.cliVersionMismatch",o.message));let s={cwd:this._cwd,executable:process.execPath,pathToClaudeCodeExecutable:n,abortController:this._abortController,settings:{env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${e.port}`,ANTHROPIC_AUTH_TOKEN:`${e.nonce}.${this.sessionId}`,CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",USE_BUILTIN_RIPGREP:"0",PATH:await this._buildPathWithBundledRipgrep()}},systemPrompt:{type:"preset",preset:"claude_code"},settingSources:["user","project","local"],disallowedTools:["WebSearch"],canUseTool:this._handleCanUseTool,thinking:{type:"adaptive"},includePartialMessages:!0,...this._model&&{model:this._model},...this._permissionMode&&{permissionMode:this._permissionMode},...r?{resume:this.sessionId}:{sessionId:this.sessionId}},c=await this.sdkWrapper.query({prompt:this._createPromptIterable(),options:s});this._query=c,this._isResumed=!0,yf.info(this.ctx,`${Ef}: started long-lived Query`,{sessionId:this.sessionId,cwd:this._cwd,model:this._model,permissionMode:this._permissionMode,isResumed:r}),this._processMessages(c).catch(l=>{yf.error(this.ctx,`${Ef}: consume loop crashed`,{sessionId:this.sessionId,error:l instanceof Error?l.message:String(l)})})}async _buildPathWithBundledRipgrep(){try{let e=await this.ctx.get(D3).resolvePath();return`${Lat.dirname(e)}${Lat.delimiter}${process.env.PATH??""}`}catch(e){return yf.warn(this.ctx,`${Ef}: bundled ripgrep unavailable, falling back to process PATH`,{sessionId:this.sessionId,error:e instanceof Error?e.message:String(e)}),process.env.PATH??""}}async*_createPromptIterable(){for(;!this._disposed;){if(this._pendingPromptInput){let r=this._pendingPromptInput;this._pendingPromptInput=void 0,yield r;continue}let e=new nA;this._promptWaiter=e,await e.promise}}async _processMessages(e){let r;try{for await(let n of e){if(this._checkSessionIdConsistency(n),this._isPartialAssistantMessage(n)){let o=n.event;o.type==="message_start"&&(r=o.message.id),r!==void 0&&await this._sendPartialUpdate(n,r),o.type==="message_stop"&&(r=void 0)}else await this._sendSessionUpdate(n);if(this._isTerminalTurnMessage(n)){this._assistantBlockCursor.clear();let o=this._currentInvokeDone;this._currentInvokeDone=void 0,o?.resolve()}}this._currentInvokeDone&&await this._emitTerminalError(new Error("SDK Query ended unexpectedly")),this._cleanupLiveQuery(e,new Error("SDK Query ended unexpectedly"))}catch(n){yf.error(this.ctx,`${Ef}: query error`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)}),await this._emitTerminalError(n),this._cleanupLiveQuery(e,n instanceof Error?n:new Error(String(n)))}}_isPartialAssistantMessage(e){return typeof e=="object"&&e!==null&&e.type==="stream_event"}_isTerminalTurnMessage(e){if(typeof e!="object"||e===null)return!1;let r=e.type;return r==="result"||r==="error"}_cleanupLiveQuery(e,r){this._query===e&&(this._query=void 0),this._dropAllPending("query ended",r.message),this._assistantBlockCursor.clear();let n=this._currentInvokeDone;this._currentInvokeDone=void 0,n?.reject(r)}_checkSessionIdConsistency(e){if(typeof e!="object"||e===null)return;let r=e.session_id;typeof r=="string"&&r!==this.sessionId&&yf.error(this.ctx,`${Ef}: SDK reported session_id mismatch`,{expected:this.sessionId,reported:r})}async _sendSessionUpdate(e){try{let n=e?.type==="result"?this.ctx.get(am).takeCopilotUsageNanoAiuForSession(this.sessionId):void 0,o=Blr(e,{streamingEnabled:!0,sessionModel:this._model,copilotUsageNanoAiu:n,blockCursor:this._assistantBlockCursor});for(let s of o)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,s,"CLAUDE")}catch(r){yf.error(this.ctx,`${Ef}: failed to send agent/sessionUpdate`,{sessionId:this.sessionId,error:r instanceof Error?r.message:String(r)})}}async _sendPartialUpdate(e,r){try{let n=cYn(e,r);for(let o of n)await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}catch(n){yf.error(this.ctx,`${Ef}: failed to send partial agent/sessionUpdate`,{sessionId:this.sessionId,error:n instanceof Error?n.message:String(n)})}}async _emitTerminalError(e){if(this._terminalErrorEmittedForTurn)return;this._terminalErrorEmittedForTurn=!0;let r=e instanceof Error?e.message:String(e);await this._sendSessionUpdate({type:"error",error:r})}respondToInteraction(e){if(e.sessionId!==this.sessionId)return yf.warn(this.ctx,`${Ef}: respondToInteraction sessionId mismatch`,{ownSessionId:this.sessionId,paramSessionId:e.sessionId,requestId:e.requestId}),!1;if(e.type==="permission"){let r=this._permissionRegistry.respond(e.requestId,e.result);return r||yf.warn(this.ctx,`${Ef}: respondToInteraction for unknown permission requestId`,{sessionId:this.sessionId,requestId:e.requestId}),r}if(e.type==="user_input"){let r=this._userInputRegistry.respond(e.requestId,e.response);return r||yf.warn(this.ctx,`${Ef}: respondToInteraction for unknown user_input requestId`,{sessionId:this.sessionId,requestId:e.requestId}),r}return yf.warn(this.ctx,`${Ef}: unsupported interaction type`,{sessionId:this.sessionId,requestId:e.requestId,interactionType:e.type}),!1}_dropAllPending(e,r){let n=r?`: ${r}`:"";this._permissionRegistry.respondAll({kind:"denied-interactively-by-user",feedback:`Session ${this.sessionId} ${e} before permission resolved${n}`}),this._userInputRegistry.rejectAll(new Error(`Session ${this.sessionId} ${e} before user_input resolved${n}`))}_handlePermissionRequest(e,r,n){let o=n.toolUseID??ir();if(n.signal.aborted)return Promise.resolve({behavior:"deny",message:"Permission request aborted"});let s=Zzn(e,r,n);return this._requestPermissionFromIde(o,e,r,s,n)}async _handleAskUserQuestion(e,r){if(r.signal.aborted)return{behavior:"deny",message:"AskUserQuestion aborted"};let n=eYn(e);if(!n)return{behavior:"deny",message:"AskUserQuestion: invalid input"};try{let o=await Promise.all(n.map(async c=>{let l=ir(),u=await this._requestUserInputFromIde(l,tYn(c,r.toolUseID),r.signal);return{questionText:c.questionText,answer:u.answer}})),s={};for(let{questionText:c,answer:l}of o)s[c]=l;return{behavior:"allow",updatedInput:{...e,answers:s}}}catch(o){return{behavior:"deny",message:o instanceof Error?o.message:`AskUserQuestion failed: ${String(o)}`}}}async _requestPermissionFromIde(e,r,n,o,s){let{promise:c,isSettled:l}=this._permissionRegistry.register(e),u=a(()=>{this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Permission request aborted"})},"onAbort"),d=a(()=>s.signal.removeEventListener("abort",u),"cleanupAbort");s.signal.addEventListener("abort",u,{once:!0});let f=this._emitPermissionRequested(e,o);f.catch(A=>{l()||(yf.error(this.ctx,`${Ef}: failed to emit permission.requested, denying`,{sessionId:this.sessionId,requestId:e,toolName:r,error:A instanceof Error?A.message:String(A)}),d(),this._permissionRegistry.respond(e,{kind:"denied-interactively-by-user",feedback:"Failed to deliver permission request to client"}))});let h;try{h=await c}finally{d()}let m=Xzn(h,n);yf.info(this.ctx,`${Ef}: permission resolved`,{sessionId:this.sessionId,requestId:e,toolName:r,behavior:m.behavior});let g=m.behavior==="allow"?"approved":"denied";return f.catch(()=>{}).then(()=>this._emitPermissionCompleted(e,g,s.toolUseID)).catch(A=>{yf.warn(this.ctx,`${Ef}: failed to emit permission.completed`,{sessionId:this.sessionId,requestId:e,error:A instanceof Error?A.message:String(A)})}),m}async _requestUserInputFromIde(e,r,n){let{promise:o,isSettled:s}=this._userInputRegistry.register(e),c=a(()=>{this._userInputRegistry.rejectOne(e,new Error("AskUserQuestion aborted"))},"onAbort"),l=a(()=>n.removeEventListener("abort",c),"cleanupAbort");n.addEventListener("abort",c,{once:!0});let u=this._emitUserInputRequested(e,r);u.catch(m=>{s()||(yf.error(this.ctx,`${Ef}: failed to emit user_input.requested, rejecting`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)}),l(),this._userInputRegistry.rejectOne(e,m instanceof Error?m:new Error(String(m))))});let d,f;try{d=await o}catch(m){f=m instanceof Error?m:new Error(String(m))}finally{l()}let h=d??{answer:"",wasFreeform:!1};if(u.catch(()=>{}).then(()=>this._emitUserInputCompleted(e,h)).catch(m=>{yf.warn(this.ctx,`${Ef}: failed to emit user_input.completed`,{sessionId:this.sessionId,requestId:e,error:m instanceof Error?m.message:String(m)})}),f!==void 0)throw f;return d}async _emitPermissionRequested(e,r){let n={id:ir(),timestamp:new Date().toISOString(),parentId:null,type:"permission.requested",data:{requestId:e,permissionRequest:r}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitPermissionCompleted(e,r,n){let o={id:ir(),timestamp:new Date().toISOString(),parentId:null,type:"permission.completed",data:{requestId:e,result:{kind:r},...n!==void 0?{toolCallId:n}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,o,"CLAUDE")}async _emitUserInputRequested(e,r){let n={id:ir(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.requested",data:{requestId:e,question:r.question,...r.choices!==void 0?{choices:r.choices}:{},...r.allowFreeform!==void 0?{allowFreeform:r.allowFreeform}:{},...r.toolCallId!==void 0?{toolCallId:r.toolCallId}:{}}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}async _emitUserInputCompleted(e,r){let n={id:ir(),timestamp:new Date().toISOString(),parentId:null,type:"user_input.completed",data:{requestId:e,answer:r.answer,wasFreeform:r.wasFreeform}};await this.notificationSender.sendBackgroundAgentSessionUpdate(this.sessionId,n,"CLAUDE")}};p();var hYn=fe(require("http")),mYn=require("node:stream"),Flr=require("node:stream/promises"),gYn=require("node:string_decoder");As();var UA=new Ae("ClaudeMessagesProxyServer"),V7s=["interleaved-thinking","context-management","advanced-tool-use"],Llr="cls_claude_agent",vg={InvalidRequest:"invalid_request_error",Authentication:"authentication_error",Permission:"permission_error",NotFound:"not_found_error",RequestTooLarge:"request_too_large",RateLimit:"rate_limit_error",Api:"api_error",Overloaded:"overloaded_error"},W7s=new Map([[400,vg.InvalidRequest],[401,vg.Authentication],[402,vg.Permission],[403,vg.Permission],[404,vg.NotFound],[413,vg.RequestTooLarge],[424,vg.InvalidRequest],[429,vg.RateLimit],[466,vg.InvalidRequest],[529,vg.Overloaded]]),fYn=1024,z7s=32e3,HZ=class{constructor(e){this.ctx=e}static{a(this,"ClaudeMessagesProxyServer")}async start(){if(this._startPromise)return this._startPromise;let e=this._startInternal().catch(r=>{throw this._startPromise===e&&(this._startPromise=void 0),r});return this._startPromise=e,e}async stop(){let e=this._server;e&&(e.closeAllConnections(),await new Promise(r=>e.close(()=>r())),this._server=void 0,this._startPromise=void 0,this._config=void 0)}getConfig(){if(!this._config)throw new Error("ClaudeMessagesProxyServer: start() has not completed yet");return this._config}async _startInternal(){let e=`cls-claude-${ir()}`,r=hYn.createServer((n,o)=>{this._handleRequest(n,o,e)});return new Promise((n,o)=>{r.once("error",o),r.listen(0,"127.0.0.1",()=>{let s=r.address();if(!s||typeof s!="object"){o(new Error("ClaudeMessagesProxyServer: failed to obtain bound address"));return}this._server=r,this._config={port:s.port,nonce:e},UA.info(this.ctx,`proxy listening on http://127.0.0.1:${s.port}`),r.removeListener("error",o),n(this._config)})})}async _handleRequest(e,r,n){try{if(UA.debug(this.ctx,`incoming request: ${e.method} ${e.url}`),e.method==="OPTIONS"){r.writeHead(200),r.end();return}if(e.method==="GET"&&e.url==="/"){r.writeHead(200,{"Content-Type":"text/plain"}),r.end("Hello from ClaudeMessagesProxyServer");return}if(e.method==="POST"&&this._isMessagesPath(e.url)){await this._handleMessagesRequest(e,r,n);return}this._sendErrorResponse(r,404,vg.NotFound,"Not found")}catch(o){UA.exception(this.ctx,o,"._handleRequest"),this._sendErrorResponse(r,500,vg.Api,"Internal proxy error")}}_isMessagesPath(e){if(!e)return!1;let r=e.startsWith("//")?e.slice(1):e,n;try{n=new URL(r,"http://127.0.0.1").pathname}catch{return!1}return n==="/v1/messages"||n==="/messages"}async _handleMessagesRequest(e,r,n){let o=Y7s(e.headers,n);if(!o.valid){UA.error(this.ctx,"rejected request with invalid Authorization header"),this._sendErrorResponse(r,401,vg.Authentication,"Invalid authentication");return}o.sessionId&&UA.debug(this.ctx,`authorized request for session ${o.sessionId}`);let s=await iQs(e),c;try{c=JSON.parse(s)}catch(l){UA.error(this.ctx,`invalid JSON in request body: ${l instanceof Error?l.message:String(l)}`),this._sendErrorResponse(r,400,vg.InvalidRequest,"Request body is not valid JSON");return}await this._forwardToCAPI(c,s,e.headers,r,o.sessionId)}async _forwardToCAPI(e,r,n,o,s){let c=this.ctx.get(Ut),l=this.ctx.get(cr),u;try{u=await c.getToken()}catch(_){UA.exception(this.ctx,_,"._forwardToCAPI/getToken"),this._sendErrorResponse(o,401,vg.Authentication,"Failed to acquire Copilot token");return}let d=await this._lookupModelMetadata(e),f=this._maybeStripCacheControl(e,r),h=this._maybeRewriteThinking(e,f,d,s),m=MHe(this.ctx,u,"v1/messages"),g=J7s(this.ctx,n,d),A;try{({headers:A}=await NHe(this.ctx,g,u.token))}catch(_){UA.exception(this.ctx,_,"._forwardToCAPI/applyMsBenchAuth"),this._sendErrorResponse(o,401,vg.Authentication,"Failed to acquire MSBench credentials");return}let y=new AbortController,E=a(()=>{y.signal.aborted||(UA.debug(this.ctx,"client disconnected \u2014 aborting upstream request"),y.abort())},"onClose");o.on("close",E);try{let _=await l.fetch(m,{method:"POST",headers:A,body:h,signal:y.signal});if(OHe(this.ctx,_,"v1/messages"),!_.ok){let w=await _.text(),R=w.length<=360?w:w.slice(0,360)+"\u2026";UA.error(this.ctx,`upstream CAPI returned ${_.status} ${_.statusText}: ${R}`),this._sendErrorResponse(o,_.status,oQs(_.status),this._buildTranslatedErrorMessage(_,w,u));return}let v=_.headers.get("content-type")??"text/event-stream";o.writeHead(_.status,{"Content-Type":v,"Cache-Control":"no-cache",Connection:"keep-alive"});let b=_.body();if(!b){o.end();return}let T=v.toLowerCase().includes("text/event-stream");if(s&&T){let w=this.ctx.get(am),R=sQs(x=>{w.addCopilotUsageNanoAiuForSession(s,x)});await(0,Flr.pipeline)(b,R,o)}else await(0,Flr.pipeline)(b,o)}catch(_){if(y.signal.aborted){UA.debug(this.ctx,"upstream fetch aborted by client disconnect"),o.writableEnded||o.end();return}if(UA.exception(this.ctx,_,"._forwardToCAPI"),o.headersSent||o.writableEnded){o.destroy();return}this._sendErrorResponse(o,500,vg.Api,"Upstream request failed")}finally{o.removeListener("close",E)}}async _lookupModelMetadata(e){let r=typeof e.model=="string"?e.model:void 0;if(r)try{return(await this.ctx.get(Fa).getMetadata()).find(s=>s.id===r)}catch(n){UA.debug(this.ctx,`model metadata lookup failed for "${r}": ${n instanceof Error?n.message:String(n)}`);return}}_maybeRewriteThinking(e,r,n,o){if(!n)return r;let s=o?this.ctx.get(am).getReasoningEffortForSession(o):void 0;if(s&&n.capabilities?.supports?.adaptive_thinking){let l=n.capabilities?.supports?.reasoning_effort;(!l||!l.includes(s))&&UA.warn(this.ctx,`dropping unsupported reasoning_effort "${s}" for model ${n.id}; advertised=[${l?.join(",")??""}]`)}return eQs(e,n,s)?(UA.debug(this.ctx,`normalized thinking field for model ${n.id} to ${n.capabilities?.supports?.adaptive_thinking?"adaptive":"legacy"} shape`),JSON.stringify(e)):r}_maybeStripCacheControl(e,r){return X7s(e)?(UA.debug(this.ctx,"stripped unknown sub-fields from cache_control.ephemeral before forwarding to CAPI"),JSON.stringify(e)):r}_buildTranslatedErrorMessage(e,r,n){let o=e.status,s=this._buildReasonForStatus(e,r,n),c=o===429?{capiErrorCode:aQs(r),copilotPlan:n.userInfo?.copilotPlan,suggestSwitchToAuto:!1}:void 0;return R_.translateErrorMessage(o,s,void 0,$9(e),void 0,c)}_buildReasonForStatus(e,r,n){let o=e.status;if(o===402)try{let s=this.ctx.get(uu).overageEnabled;return R_.translate402Reason(r,{retryAfterHeader:e.headers.get("retry-after")??void 0,retryAfterSeconds:$9(e),copilotPlan:n.userInfo?.copilotPlan,isTBBEnabled:n.userInfo?.isTBBEnabled,canUpgradePlan:n.userInfo?.canUpgradePlan,overageEnabled:s})}catch(s){return UA.exception(this.ctx,s,"._buildReasonForStatus/402"),pYn(r)??"Quota Exceeded."}if(o===400){let s=R_.translate400Reason(r);if(s!==void 0)return s}return pYn(r)}_sendErrorResponse(e,r,n,o){let s={type:"error",error:{type:n,message:o}};e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify(s))}};function Y7s(t,e){let r=t.authorization;if(typeof r!="string"||!r.startsWith("Bearer "))return{valid:!1,sessionId:void 0};let n=r.slice(7),o=n.indexOf(".");if(o===-1)return{valid:n===e,sessionId:void 0};let s=n.slice(0,o),c=n.slice(o+1).trim();return s===e?{valid:!0,sessionId:c.length>0?c:void 0}:{valid:!1,sessionId:void 0}}a(Y7s,"extractSessionId");function K7s(t){let e=t.split(",").map(r=>r.trim()).filter(r=>r&&V7s.some(n=>r===n||r.startsWith(n+"-")));return e.length>0?e.join(","):void 0}a(K7s,"filterSupportedBetas");function J7s(t,e,r){let n=e.accept,o=typeof n=="string"&&n.length>0?n:"text/event-stream",s={...lA(t),"Content-Type":"application/json",Accept:o},c=e["anthropic-beta"],l=Array.isArray(c)?c.join(","):c,u=l?K7s(l):void 0,d=r!==void 0&&!r.capabilities?.supports?.adaptive_thinking,f=Z7s(u,d?tYe:void 0);f&&(s["anthropic-beta"]=f);let h=e["user-agent"];if(h){let m=h.indexOf("/");s["User-Agent"]=m===-1?`${Llr}/${h}`:`${Llr}${h.substring(m)}`}else s["User-Agent"]=Llr;return s}a(J7s,"buildUpstreamHeaders");function Z7s(t,e){let r=new Set;for(let n of[t,e])if(n)for(let o of n.split(",")){let s=o.trim();s&&r.add(s)}return r.size>0?[...r].join(","):void 0}a(Z7s,"mergeBetas");function X7s(t){let e=!1,r=a(c=>!!c&&typeof c=="object","isObject"),n=a(c=>{if(!r(c))return;let l=c.cache_control;if(r(l)&&l.type==="ephemeral")for(let u of Object.keys(l))u!=="type"&&(delete l[u],e=!0)},"stripBlock"),o=a(c=>{if(Array.isArray(c))for(let l of c)n(l)},"stripBlocks");o(t.system);let s=t.messages;if(Array.isArray(s))for(let c of s){if(!r(c))continue;let l=c.content;if(Array.isArray(l))for(let u of l)n(u),r(u)&&o(u.content)}return o(t.tools),e}a(X7s,"sanitizeCacheControl");function eQs(t,e,r){if(!e)return!1;let n=t.thinking;if(!n||typeof n!="object")return!1;let o=n.type;return o!=="adaptive"&&o!=="enabled"?!1:e.capabilities?.supports?.adaptive_thinking?tQs(t,n,e,r):nQs(t,n)}a(eQs,"normalizeThinkingForModel");function tQs(t,e,r,n){let o=r.capabilities?.supports?.reasoning_effort,s=rQs(n,o),l={effort:BQ(o,s)??"medium"},u=e.type==="adaptive"&&Object.keys(e).length===1,d=t.output_config,f=typeof d?.effort=="string"&&d.effort===l.effort;return u&&f?!1:(t.thinking={type:"adaptive"},t.output_config=l,!0)}a(tQs,"_writeAdaptiveShape");function rQs(t,e){if(t&&!(!e||!e.includes(t)))return t}a(rQs,"_normaliseUserEffortForCapi");function nQs(t,e){let r=e.budget_tokens,n=typeof r=="number"&&Number.isFinite(r)&&r>0?r:fYn,o=Math.min(z7s,Math.max(fYn,n)),s=e.type==="enabled"&&e.budget_tokens===o,c=t.output_config!==void 0;return s&&!c?!1:(t.thinking={type:"enabled",budget_tokens:o},c&&delete t.output_config,!0)}a(nQs,"_writeLegacyShape");function iQs(t){return new Promise((e,r)=>{let n=[];t.on("data",o=>{n.push(typeof o=="string"?Buffer.from(o,"utf8"):o)}),t.on("end",()=>e(Buffer.concat(n).toString("utf8"))),t.on("error",r)})}a(iQs,"readRequestBody");function oQs(t){return W7s.get(t)??vg.Api}a(oQs,"mapStatusToAnthropicErrorType");function sQs(t){let e=new gYn.StringDecoder("utf8"),r="",n=0,o=a(s=>{if(!s.startsWith("data:"))return;let c=s.slice(5).trimStart();if(!(!c||c==="[DONE]")&&c.includes("copilot_usage"))try{let u=JSON.parse(c).copilot_usage?.total_nano_aiu;typeof u=="number"&&Number.isFinite(u)&&u>0&&(n=u)}catch{}},"inspectLine");return new mYn.Transform({transform(s,c,l){try{r+=e.write(s);let u=r.indexOf(` `);for(;u!==-1;){let d=r.slice(0,u).replace(/\r$/,"");r=r.slice(u+1),o(d),u=r.indexOf(` -`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(NQs,"createCopilotUsageSniffer");function MQs(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(MQs,"extractErrorMessage");Ns();var pE=new ge("ClaudeCodeAgent"),hE="ClaudeCodeAgentService",UF=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(sa)}static{a(this,"ClaudeCodeAgentService")}async createSession(e){return this.runWithTelemetry("claudeCodeAgent.createSession",async r=>{await uzn(this.ctx,e);let n=e.sessionId??gr(),o=this._sessions.get(n);if(o)return pE.info(this.ctx,`${hE}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=Wn(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new S2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,permissionMode:"bypassPermissions",isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),pE.info(this.ctx,`${hE}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return this.runWithTelemetry("claudeCodeAgent.resumeSession",async r=>{await dzn(this.ctx,e);let{sessionId:n}=e,o=this._sessions.get(n);if(o)return pE.info(this.ctx,`${hE}.resumeSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="memory",r.properties.modelId=e.model??"",r.measurements.eventCount=0,{sessionId:n,workspacePath:o.cwd};let s=await this.sdkWrapper.getSessionInfo(n);if(!s?.cwd)throw new Error(`Session not found: ${n}`);let c=s.cwd,l=await this._ensureProxyConfig(),u=new S2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:c,model:e.model,permissionMode:"bypassPermissions",isNewSession:!1,proxyConfig:l});this._sessions.set(n,u),pE.info(this.ctx,`${hE}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:c});let d;try{let f=await this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0});d=Pzn(f),r.properties.transcriptOk="true"}catch(f){pE.warn(this.ctx,`${hE}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:f instanceof Error?f.message:String(f)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=f instanceof Error?f.name:"Unknown",d=void 0}return r.properties.reason="disk",r.properties.modelId=e.model??"",r.measurements.eventCount=d?.length??0,{sessionId:n,workspacePath:c,events:d}})}async sendMessage(e,r){return this.runWithTelemetry("claudeCodeAgent.sendMessage",async n=>{await fzn(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:Ia(s.cwd)};await this.ctx.get(ag).applyPromptTemplateToRequest(e,[c]);let l=gr(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,permissionMode:"bypassPermissions",reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{pE.warn(this.ctx,`${hE}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),this.emit("claudeCodeAgent.sendMessage.failure",u,!1,{reason:"invoke"},void 0,d)}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}async listSessions(e){return this.runWithTelemetry("claudeCodeAgent.listSessions",async r=>{mzn(this.ctx,e),pE.info(this.ctx,`${hE}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return pE.info(this.ctx,`${hE}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return this.runWithTelemetry("claudeCodeAgent.listModels",async r=>{gzn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),pE.info(this.ctx,`${hE}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(dc).getMetadata()).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>JHe(c.capabilities.family)).map(c=>{let l=c.capabilities.supports?.reasoning_effort,u=!!l&&l.length>0;return{id:c.id,name:c.name,preview:c.preview,capabilities:{family:c.capabilities.family,supports:{tool_calls:c.capabilities.supports?.tool_calls,vision:c.capabilities.supports?.vision,streaming:c.capabilities.supports?.streaming,reasoningEffort:u,reasoning_effort:l},limits:{max_prompt_tokens:c.capabilities.limits?.max_prompt_tokens,max_output_tokens:c.capabilities.limits?.max_output_tokens,max_context_window_tokens:c.capabilities.limits?.max_context_window_tokens??0}},supportedReasoningEfforts:l,defaultReasoningEffort:u?CQ(l):void 0}});return pE.info(this.ctx,`${hE}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await this.runWithTelemetry("claudeCodeAgent.stopSession",async r=>{pzn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){pE.info(this.ctx,`${hE}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return this.runWithTelemetry("claudeCodeAgent.destroySession",r=>{hzn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),pE.info(this.ctx,`${hE}.destroySession`,{sessionId:n}),{success:!0}):(pE.info(this.ctx,`${hE}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return pE.error(this.ctx,`${hE}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await this.runWithTelemetry("claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){pE.info(this.ctx,`${hE}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await C2e(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await this.runWithTelemetry("claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){pE.info(this.ctx,`${hE}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}emit(e,r,n,o,s,c){let l={success:n?"true":"false",...o},u={totalTimeMs:performance.now()-r,...s};c!==void 0?gi(this.ctx,e,c,l,u):gt(this.ctx,e,l,u)}async runWithTelemetry(e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return this.flush(e,n,o),s}catch(s){throw o.error??=s,this.flush(e,n,o),s}}flush(e,r,n){n.error!==void 0?this.emit(`${e}.failure`,r,!1,n.properties,n.measurements,n.error):this.emit(e,r,n.ok??!0,n.properties,n.measurements)}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(){return Promise.reject(this.unsupported("handleInteraction"))}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(zZ).start()}};p();var blr=new nn;function Bzn(t){return[...t].sort((e,r)=>{let n=blr.get(e.uri)??0;return(blr.get(r.uri)??0)-n})}a(Bzn,"sortByAccessTimes");var Lzn=a(t=>t.get(cn).onDidFocusTextDocument(e=>{e.document&&blr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var Fzn=ce(require("events"));var Nat="CompletionRequested",b5=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new Fzn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Nat,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=Pm(this.ctx,e,`event.${Nat}`);return this.#e.on(Nat,r),qn.Disposable.create(()=>this.#e.off(Nat,r))}};p();p();var Slr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},Mat=class extends Slr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var Eb=class{constructor(e){this.ctx=e;this.#e=new ge("AsyncCompletionManager");this.requests=new nn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(Tlr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` -`)+1));let c=new Mat;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(Jt).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new rA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(Tlr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)Tlr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function Tlr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(Tlr,"isCandidate");p();p();var I2e=class{constructor(e){this.maxSize=e;this.root=new T2e;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new T2e;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new T2e;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new I2e(100)}};p();var _b=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&Uzn(this.choices[0].completionText,n))return OQs(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function OQs(t,e){return t.filter(r=>Uzn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(OQs,"adjustChoicesStart");function Uzn(t,e){return t.startsWith(e)&&t.length>e.length}a(Uzn,"startsWithAndExceeds");p();p();var QF={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function Qzn(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let k;t[306]>1e-35?t[149]>1e-35?k=-.1389218965136736:k=-.032218642644416894:t[13]>1e-35?k=.006465035217331847:t[50]>1e-35?k=-.1381687930130022:t[179]>1e-35?k=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?k=-.03262719498763048:k=.023342916702125613:t[191]>1e-35?k=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?k=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?k=-.09989343595668776:k=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?k=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?k=-.09165257825246746:t[9]>32.50000000000001?k=.02484870392366004:k=-.008499493096971395:t[8]>24.500000000000004?k=.02459679192828244:k=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?k=.0015644546318714849:k=-.06579524865022705:k=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?k=.03331853632960164:k=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?k=-.019091477207111116:k=.037878468575478504:t[94]>1e-35?k=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?k=.16919658785098224:t[243]>1e-35?k=-.06580584936754524:k=.01567555159935563:t[129]>1e-35?k=.06721746994993226:t[10]>32.50000000000001?k=-.046394462507797975:k=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let L;t[308]>1e-35?L=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?L=.023223358334607133:L=-.04383410185346742:L=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?L=.023406489302867494:L=-.085521220804058:L=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?L=.028120059780969632:L=-.04211009474298743:t[294]>1e-35?L=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?L=-.0993035220737934:L=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?L=.029770210551187937:L=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?L=.06421359317599738:L=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?L=.024368404612215164:L=-.04045232374803373:t[131]>1e-35?L=.017372701982485795:t[120]>1e-35?L=.08812710275150198:t[18]>1e-35?t[90]>1e-35?L=.18451364351180236:t[7]>33.50000000000001?L=-.03850813130183531:t[195]>1e-35?L=.06966114053446336:t[3]>16.500000000000004?L=-.0012869181693341211:t[0]>4242.500000000001?L=-.054625548611291035:L=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?L=.006302103427145562:L=.13967622319898698:t[121]>1e-35?L=-.038798585213145644:t[5]>4544.500000000001?L=-.08050498033009466:L=-.002986974112681435;let B;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?B=-.03461119351456781:B=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?B=-.12404435523286539:B=-.0034376913880382956:B=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?B=.0037507103585310234:B=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?B=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?B=-.04832024079663151:t[37]>1e-35?B=-.037103393468366934:B=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?B=.032539071163832034:t[5]>1643.5000000000002?B=.036408625378035665:t[0]>1500.5000000000002?B=-.1346358322854993:B=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?B=-.1133991164577881:t[9]>52.50000000000001?B=-.024478640359723122:B=.03673777861098756:B=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?B=.002583438691776944:B=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?B=-.02141222346712401:B=.06392462314316179:t[4]>12.500000000000002?B=.08700122294434816:t[8]>267.50000000000006?B=.056923170082743224:B=-.07716309825583327:t[32]>1e-35?B=-.03961343943752142:B=.002674914122888783:t[1]>42.50000000000001?B=-.05217539654421676:t[145]>1e-35?B=.09553630282946368:B=-.009424791262477729;let Q;t[183]>1e-35?Q=-.05753337139158443:t[308]>1e-35?Q=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?Q=-.10477869875380448:Q=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?Q=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?Q=-.04442302951713574:Q=.00012409888451734224:Q=-.092199119633697:t[225]>1e-35?Q=.13773072450201831:t[0]>2882.5000000000005?Q=.0028540012229920533:t[298]>1e-35?Q=.07134486044361629:Q=.014297412329837425:t[145]>1e-35?Q=.05608385321902638:t[92]>1e-35?Q=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?Q=-.0039957800609801315:Q=.0776927564241081:t[203]>1e-35?Q=-.05502900859432093:t[105]>1e-35?Q=.06062892720841595:Q=-.009574839629252128:t[31]>1e-35?Q=.009488858841144216:t[23]>1e-35?t[20]>1e-35?Q=.08818126313644752:t[8]>161.50000000000003?Q=.014353968957885408:Q=-.022240738532827903:t[210]>1e-35?Q=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?Q=-.043902062079383485:Q=-.014741559220396223:Q=-.00934935734853194:t[6]>32.50000000000001?Q=.1514593126307404:Q=.010771222510801532:t[10]>22.500000000000004?Q=.01412495209334078:Q=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let F;t[294]>1e-35?F=-.0384794324818203:t[266]>1e-35?F=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?F=.07432960094940501:F=-.035248735855751855:t[134]>1e-35?F=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?F=-.01706896375068821:F=.08212247914968074:t[2]>59.50000000000001?F=-.09546478958824225:t[6]>53.50000000000001?F=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?F=.02816463285971267:F=.15449139016588445:F=-.10199787406123524:F=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?F=-.13924786681478077:F=-.0072772442570213335:t[39]>1e-35?F=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?F=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?F=-.11174465335620831:F=.00013144040097180107:F=-.08493919336681105:t[42]>1e-35?F=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?F=-.015540659878839153:F=-.14442609417300142:t[21]>1e-35?F=-.025251979447574083:F=.0023698372645272847:t[18]>1e-35?F=.07269739695712212:t[8]>2592.5000000000005?F=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?F=-.01835130329646532:t[9]>45.50000000000001?F=.02023047454629885:F=.16469378262221102:F=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let W;t[183]>1e-35?t[17]>1e-35?W=.030100940443356424:t[10]>1.5000000000000002?W=-.10861112216742408:W=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?W=-.032062878390325456:W=-.10808232631806887:t[8]>1641.5000000000002?W=-.06147013392655731:t[4]>12.500000000000002?W=.03324767551088266:t[145]>1e-35?W=.028851633810612017:W=-.054871239091792784:t[134]>1e-35?W=-.023813968121342108:t[266]>1e-35?W=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?W=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?W=-.025350325484720576:W=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?W=.056817276537534815:W=-.07674158463557636:W=-.06335553143454145:t[1]>56.50000000000001?W=.16390494217299284:W=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?W=.041717597065890205:W=-.10357913492269129:t[10]>29.500000000000004?W=.1365512866715726:W=.020600048310575665:W=.09708785634773187:W=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?W=-.03146213719547347:W=.11784024316238083:W=-.050940520532045355:W=-.047988344143075616:t[191]>1e-35?W=.028764654731460032:W=.0011911575567860023;let V;t[294]>1e-35?t[10]>50.50000000000001?V=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?V=-.05103908560370243:V=.05002066201169583:V=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?V=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?V=.127983140816313:V=-.05436534163636867:V=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?V=-.009504203657088933:t[8]>819.5000000000001?V=.18689664822602375:V=.03635576744011826:V=-.029862411809998525:t[223]>1e-35?V=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?V=-.09405026597863717:t[0]>4153.500000000001?V=.053577663326799765:V=-.05062127873995668:V=.06512222894425874:t[39]>1e-35?V=-.04985311717827547:t[51]>1e-35?V=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?V=-.02860634573675884:V=.08863753005590103:V=.11158892111063744:t[0]>655.5000000000001?V=-.031005736641654926:V=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?V=-.00843386136334982:V=-.05273594615999777:V=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?V=-.015774115523598486:V=.10147367091236065:V=-.048307000563071016:V=.002118376117677254;let G;t[8]>1014.5000000000001?t[9]>137.50000000000003?G=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?G=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?G=.07211107542565391:G=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?G=-.0751486415451188:t[1]>59.50000000000001?G=.13459005084554104:G=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?G=.06715575425741895:G=-.005895690393702183:t[8]>2915.5000000000005?G=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?G=-.00029068886245881074:G=.0613467393188786:t[148]>1e-35?G=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?G=.003887223773199377:G=-.08553893131979015:G=.025654192706396767:G=-.05651733979610658:G=-.02039913645229667:t[2]>7.500000000000001?G=-.1058450646728524:G=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?G=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?G=.1283258201586378:G=-.01718135372229775:G=-.07702452408491414:t[125]>1e-35?G=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?G=.04273051857848212:G=-.04533122948101463:t[2]>196.50000000000003?G=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?G=.0231032972703664:G=-.04807386814498683:G=.002729435991332102;let Y;t[179]>1e-35?Y=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?Y=.026484626664041125:t[10]>1.5000000000000002?Y=-.10187000872941615:Y=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?Y=.09574540795390041:Y=-.06454986703691233:Y=-.11411849349353141:t[266]>1e-35?Y=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?Y=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?Y=-.04403391373512386:Y=.1132928075412222:t[2]>47.50000000000001?Y=-.09700191391838056:Y=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?Y=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?Y=-.001668912999010927:Y=-.02363511102970245:t[8]>58.50000000000001?Y=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?Y=.0911011436534449:t[1]>28.500000000000004?Y=-.07192390493729035:Y=.06913818091291246:Y=-.012312625373699222:Y=.06784496312307986:Y=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?Y=.0026564453057705273:Y=-.025425772389361445:t[122]>1e-35?Y=-.12046786388602149:t[0]>3183.5000000000005?Y=.01162092842804907:t[91]>1e-35?Y=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?Y=-.0001647792543020228:Y=-.023664538532907665:Y=.01609078206180752;let re;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?re=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?re=-.017696526862422682:re=.1450050954613223:re=-.05406930069823832:re=-.08308700260259043:t[120]>1e-35?re=.058316269489189415:t[297]>1e-35?t[94]>1e-35?re=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?re=.038431826961746934:re=-.05937462906539856:t[9]>65.50000000000001?re=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?re=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?re=-.09579030954062734:re=.025064711572811746:re=.02579440518821548:re=.1044440128091862:re=-.058348633139536844:re=.07766788227934436:re=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?re=.07463684068207214:re=.18244269035484484:t[6]>39.50000000000001?re=-.06050050067471004:re=.05787759066913493:re=.010783225857972171:re=.1674891243602606:t[4]>9.500000000000002?re=-.004814132027475892:re=-.14543299413454813:re=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?re=-.07634466313617769:re=.0287825335169114:re=-.06894721943300268:re=-.00023988459059521937;let j;t[131]>1e-35?t[1]>93.50000000000001?j=-.05706887458825395:t[2]>1.5000000000000002?j=.011446637886629108:j=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?j=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?j=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?j=.026278724448495064:j=.17053138400480508:t[0]>4463.500000000001?j=-.06482289890096041:j=.03026516489536295:j=-.031785170717683144:j=.1312690622980455:t[13]>1e-35?j=.14336922540461444:j=.03523850945454039:j=-.015407465968975714:t[39]>1e-35?j=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?j=-.0659975068798723:j=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?j=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?j=.057409156184759516:j=.2024322059866388:j=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?j=.010648654146284154:t[308]>1e-35?j=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?j=.12364025998551711:j=-.02247495081065243:t[1]>22.500000000000004?j=-.0726295464624251:j=.03481895086048152:t[0]>4331.500000000001?j=-.04775443357020673:j=.07172377425057568:t[2]>89.50000000000001?j=-.11782645274716962:j=.00010092665257989378;let X;t[147]>1e-35?X=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?X=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?X=-.016101990375700172:t[0]>2579.5000000000005?X=-.13045089661551845:X=-.02874367814784938:X=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?X=.17084176915326055:X=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?X=.10591712319944074:X=-.024082167264285:X=.16497698867036126:X=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?X=-.021012910475524206:X=-.13058422554298485:t[0]>1102.5000000000002?X=.10955864175201457:X=-.03566689354348996:t[1]>11.500000000000002?X=-.02093884208606101:X=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?X=-.013861861436128482:X=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?X=.10163873449625677:X=-.02779270277623805:t[1]>26.500000000000004?X=-.08035058228527389:X=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?X=-.007028075523033826:X=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?X=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?X=-.0032075580718124892:X=-.04442829143298883:X=-.06597073245775804:X=.0015594090939337751;let ie;t[223]>1e-35?t[8]>668.5000000000001?ie=-.12803889879260094:ie=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ie=.08967966612917375:t[1]>39.50000000000001?ie=-.059791671514498074:ie=.05648934961902822:t[2]>59.50000000000001?ie=-.08633234097449628:t[6]>53.50000000000001?ie=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ie=.025606129643140924:ie=.13835395886271978:ie=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ie=-.09975506556937946:t[10]>36.50000000000001?ie=-.09427724661655643:t[10]>24.500000000000004?ie=.07329330653410447:ie=-.02271182965807972:ie=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ie=-.05082091374050816:ie=.1687114435254966:t[0]>2314.5000000000005?ie=-.06422664016383926:ie=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ie=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ie=-.1274167728754332:ie=.01308079126447365:t[4]>73.50000000000001?ie=.13854015371106546:t[4]>48.50000000000001?ie=-.03684255740123261:t[6]>45.50000000000001?ie=.10329912215813097:t[10]>77.50000000000001?ie=-.08630788656925215:ie=.031022006843800853:t[1]>25.500000000000004?ie=-.08278381528048026:ie=.06664374548141594:t[84]>1e-35?ie=-.05624227409079396:ie=.00012184182357340415;let we;t[179]>1e-35?we=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?we=-.07595415373151816:we=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?we=.022822510448266862:we=.17491569312933697:we=-.058362287133533565:t[2]>2.5000000000000004?we=-.03633895806364428:we=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?we=-.07294848747514579:we=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?we=-.07009535282685533:t[8]>2640.0000000000005?we=-.051761240111316276:t[131]>1e-35?we=-.06245774419231631:we=.03495606662854905:we=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?we=.0015036626973581122:we=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?we=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?we=.022343994371919224:we=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?we=.07724450228328664:t[0]>3853.5000000000005?we=-.15671707454435677:t[10]>28.500000000000004?we=-.10179090671841723:we=.014878216919760927:we=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?we=.14054154485273487:we=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?we=-.08632985141410315:we=.005524157938954954:we=-.08802502622523681:we=-.0004649168897260341;let Ae;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?Ae=-.007458687464321174:Ae=-.09444966249102484:t[1]>23.500000000000004?Ae=.08564129697360716:Ae=-.07105002902845851:Ae=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?Ae=-.10326216566705966:t[1]>26.500000000000004?Ae=.0050539832484585365:Ae=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?Ae=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?Ae=.05783632021087773:t[10]>17.500000000000004?Ae=-.06720598671764105:t[1]>47.50000000000001?Ae=.097495825172558:Ae=-.013372242800584872:Ae=-.06463226787713715:t[42]>1e-35?Ae=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?Ae=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?Ae=.11051270080118503:Ae=.027719462817590454:t[8]>597.5000000000001?Ae=-.08441503592016869:Ae=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?Ae=-.12190088985091102:Ae=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?Ae=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?Ae=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?Ae=.016585157185448045:Ae=-.11032043771149425:Ae=.01586986028570486:t[8]>388.50000000000006?Ae=-.10592413013261853:Ae=.04930703248769364:t[13]>1e-35?Ae=.003621937787920821:Ae=-.0013786331198611841;let De;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?De=.009769895322846493:De=-.10620052926943656:t[9]>19.500000000000004?De=.03781202525403449:t[9]>14.500000000000002?De=-.11485785321365344:t[9]>6.500000000000001?De=.07677177833073881:t[0]>4342.500000000001?De=-.07079285609687631:t[49]>1e-35?De=.06156814809246001:De=-.014788509042554625:De=-.032659201618470655:t[5]>5207.500000000001?De=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?De=-.03094160322187924:t[1]>29.500000000000004?De=.09474646043921069:De=.023445783928231618:De=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?De=-.07164443768784848:t[1]>29.500000000000004?De=.089473622509272:t[8]>597.5000000000001?De=-.08155349903101317:De=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?De=-.004003900679358653:t[190]>1e-35?De=-.09236113461485262:t[8]>3198.5000000000005?De=-.0124130160451179:De=.018453070064009328:t[15]>1e-35?De=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?De=-.0009580759587680961:De=-.03227283036698222:De=.01369287669536875:t[1]>50.50000000000001?De=-.04213060332500437:t[35]>1e-35?De=-.11508095777767471:t[190]>1e-35?De=-.08611884672400155:t[297]>1e-35?De=.05723551879433584:De=-.004829340082311461;let Te;t[183]>1e-35?Te=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Te=-.11753465135886734:Te=-.007515490299047085:Te=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Te=-.12371142493530439:t[1]>36.50000000000001?Te=.032189417575190435:Te=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Te=-.0784518658439288:t[2]>54.50000000000001?Te=.12477882322370665:Te=.000313468482399738:Te=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Te=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Te=.0353146070135579:Te=-.06327619611098285:Te=.02813577701641991:Te=-.12354390728506215:t[34]>1e-35?Te=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Te=-.01245803535276381:Te=-.07169472553475001:t[1]>11.500000000000002?Te=.12989984824561698:Te=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Te=.010390226893521422:t[10]>14.500000000000002?Te=.16790888126487719:Te=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Te=-.043398307129729134:Te=.09963544907820426:t[9]>30.500000000000004?Te=-.13540713124984502:t[9]>17.500000000000004?Te=.0509435850590757:Te=-.04761897852404613:t[4]>78.50000000000001?Te=.09197086656470652:Te=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let J;t[3]>7.500000000000001?J=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?J=.03642374718166293:J=.16379973756366603:J=-.03946685266127979:t[186]>1e-35?J=.07618896623420895:t[96]>1e-35?J=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?J=-.022822371600847505:J=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?J=.044416424920571296:J=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?J=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?J=.1061937286809567:t[7]>54.50000000000001?J=.11487507743121311:t[8]>819.5000000000001?J=-.07181278009001418:t[10]>25.500000000000004?J=.13499019430369633:t[1]>31.500000000000004?J=.09032979489780704:J=-.12754166393372374:t[9]>37.50000000000001?J=-.05093963635361407:J=-.005026651151683848:t[9]>2.5000000000000004?J=.07619735785573735:J=.012363301341532136:t[26]>1e-35?J=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?J=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?J=-.10764172927882483:J=.01890760098464703:J=.06573095405846417:t[8]>634.5000000000001?J=-.00783575973273707:J=-.050612689680229306:t[1]>22.500000000000004?J=-.0016842490401359626:J=.0738227088444087:J=-.02663970950432175;let z;t[31]>1e-35?t[8]>17.500000000000004?z=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?z=.007191286124908192:z=-.09347881647636902:t[10]>1.5000000000000002?z=.07938758708008091:z=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?z=.12321804057595996:z=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?z=-.04644244754790671:z=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?z=.0706108609273337:t[2]>40.50000000000001?z=-.028046629962303716:z=-.06497613993109329:z=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?z=-.03056331974267756:z=-.11886389712497057:z=.053364962175658184:t[8]>2233.5000000000005?z=-.0448152521157682:z=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?z=.03818796510453344:z=.23673992112982362:z=.02858814226507374:t[10]>44.50000000000001?z=-.1125863771551199:z=.009129996952394916:t[1]>7.500000000000001?z=-.004374525302461639:z=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?z=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?z=-.13677189943034931:t[10]>2.5000000000000004?z=.039591891437078086:z=-.09312596849507347:z=-.02423172142089822:z=.0009836986075266283;let le;t[189]>1e-35?t[0]>5269.500000000001?le=-.103183298350443:t[2]>51.50000000000001?le=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?le=-.05186168947388339:le=.0496996365539082:t[10]>23.500000000000004?le=.1404445738719:t[93]>1e-35?le=.0027146310074558505:t[5]>3821.5000000000005?le=.002153033152069652:t[4]>2.5000000000000004?le=.007663539551317215:le=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?le=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?le=-.021479467709980358:le=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?le=.021660293256233334:le=-.0927396152303864:le=.0665074081601698:t[0]>1550.5000000000002?le=.08972407105958534:le=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?le=.06761927942466854:le=-.015762168112653286:t[17]>1e-35?le=.10311304131145381:le=-.017672785252336027:le=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?le=-.10638321435298535:le=.0007073011744385905:t[18]>1e-35?le=-.027056185501334325:t[145]>1e-35?le=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?le=.09762140519655171:t[9]>110.50000000000001?le=-.06581942957595835:t[6]>54.50000000000001?le=.04959634035251596:le=.0022616298654554207:le=-.007437620924990854;let K;t[179]>1e-35?K=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?K=.1470294450403005:K=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?K=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?K=.07965955447707423:t[10]>10.500000000000002?K=-.09236156404262426:K=.03396273196231458:K=-.13246465021467432:K=.07092822261735353:K=-.08753829085942:K=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?K=.004705878789890202:K=.13775378964952867:K=-.04770928980587811:t[10]>29.500000000000004?K=.011221519891071544:t[0]>3853.5000000000005?K=.06365381191628273:K=.15506252245336827:t[1]>37.50000000000001?K=-.07254777021042061:K=.026514587757252385:t[308]>1e-35?K=.04115804816617256:t[10]>26.500000000000004?K=.02077721353011946:t[5]>3548.5000000000005?K=-.1280907116663952:K=-.021974774274438:t[306]>1e-35?K=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?K=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?K=-.005710865560475598:t[94]>1e-35?K=-.06751507982853555:K=.027250040757588703:t[9]>52.50000000000001?K=.07060357924595577:K=-.030297760713011795:K=-.0006005400085266517;let ae;t[113]>1e-35?ae=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ae=-.06996356565314456:ae=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ae=-.08317707559926495:t[21]>1e-35?ae=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ae=-.010538203005984922:ae=.08454819465349446:t[9]>124.50000000000001?ae=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ae=-.08542251249346582:t[9]>50.50000000000001?ae=-.023428882537657472:ae=.010042500833979073:ae=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ae=.03006025206979096:t[9]>108.50000000000001?ae=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ae=.04222035773042132:ae=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ae=-.07209095448054853:ae=.028065954981903313:ae=.08714651929917122:ae=-.006678820669279169:t[10]>40.50000000000001?ae=.006982396294941626:ae=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ae=-.09351114982645548:t[4]>3.5000000000000004?ae=-.004837550129223451:ae=-.08324141237464677:t[303]>1e-35?ae=.10703037493990825:t[9]>156.50000000000003?ae=-.10803018621648303:t[116]>1e-35?ae=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ae=.10261721665006701:ae=.018994509090668264:ae=.0011244262442038839;let Me;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?Me=-.08404263465005328:t[0]>3682.5000000000005?Me=.041259223920298876:t[1]>29.500000000000004?Me=-.09541257493441671:Me=.001482192721625409:Me=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?Me=-.08268996098437432:t[230]>1e-35?Me=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?Me=-913218977737457e-19:t[4]>10.500000000000002?Me=-.056334165674005156:t[127]>1e-35?Me=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?Me=-.04231200150318989:t[10]>42.50000000000001?Me=.10182973257894812:Me=.015934763950068445:Me=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?Me=-.041117068322885315:Me=.1167767830037126:Me=.13611206992387337:t[10]>41.50000000000001?Me=-.07120286010564107:Me=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?Me=-.07702290997669524:t[198]>1e-35?Me=.08776558554437136:Me=-.008290740324975692:t[2]>32.50000000000001?Me=.07198457624219955:Me=.005463113714361629:Me=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Me=.03295785445437507:Me=.15140250150674536:Me=-.035613213948910254:t[186]>1e-35?Me=.06849425535860769:t[96]>1e-35?Me=.06028225812727254:Me=-.007582543288662308;let ne;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ne=.08396556264106572:ne=-.0562516995099192:ne=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ne=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ne=.0052017514017035915:ne=-.11194119432743639:ne=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ne=-.025692451287403446:ne=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ne=-.11892250746801664:t[10]>22.500000000000004?ne=.07548493166973796:ne=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ne=.13750699058082427:t[18]>1e-35?ne=.06535408879552801:ne=-.054118179035040674:ne=.1344282838979622:t[0]>3982.5000000000005?ne=-.10409582202467015:t[19]>1e-35?ne=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ne=.012705935670766466:ne=.14149359442527545:ne=-.047977876173706004:t[20]>1e-35?ne=.057945228080337946:t[0]>3642.5000000000005?ne=-.008726535792122467:ne=-.08424769891378858:t[34]>1e-35?ne=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ne=.01196849566739346:ne=.1614642278429876:ne=-.043022338150701625:t[3]>5.500000000000001?ne=-.03907848255033881:ne=.018280601026175593:ne=.0006654540402589085;let se;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?se=-.01386103677247845:se=.11386694333005128:t[4]>27.500000000000004?se=-.021862617610091336:t[2]>31.500000000000004?se=.0828858469030438:se=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?se=.11303635767048735:se=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?se=-.04238798044549342:se=.022091190130494303:t[5]>5082.500000000001?se=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?se=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?se=-.04291104140431434:t[17]>1e-35?se=.11256797532342613:se=-.017206916368289193:se=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?se=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?se=.03581712466863222:se=.14770264307668884:t[8]>73.50000000000001?se=-.13093289429740068:se=.042461737442702936:t[52]>1e-35?se=.0501831919044939:se=-.010450249720465756:se=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?se=.0005381332165438493:se=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?se=.04849637311285226:se=-.036671377119808564:t[0]>421.50000000000006?se=.00020968499911058945:se=.11636422423182405:se=-.12687837788222575:se=.0012774367867215346;let Ie;t[120]>1e-35?Ie=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ie=-.042799574885345304:Ie=.07412430171193245:Ie=-.11248270469336048:t[193]>1e-35?Ie=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ie=.028911612178122104:Ie=.12326369727728437:t[0]>4091.5000000000005?Ie=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ie=.1159839898100149:Ie=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ie=-.0216343737351583:Ie=-.1220272260878369:t[2]>18.500000000000004?Ie=.09152924475072398:t[8]>55.50000000000001?Ie=.039508716651005665:Ie=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ie=.06793009902674053:Ie=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ie=-.04391068849624096:Ie=.04009967593394672:t[8]>1085.5000000000002?Ie=-.024773826356034825:Ie=-.13919707884246582:Ie=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ie=-.11567917501901476:Ie=-.006813640337684114:t[3]>7.500000000000001?Ie=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ie=-.001754586408351048:Ie=-.055422422450722056:Ie=-.06090032532532226:t[0]>5269.500000000001?Ie=.11787981735983527:Ie=-.00198119768540783:Ie=.00210412924303036;let _e;t[294]>1e-35?t[10]>50.50000000000001?_e=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?_e=-.06063239096209816:_e=.03317022411417386:_e=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?_e=-.013608609329298802:_e=.09078000157330264:t[99]>1e-35?_e=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?_e=-.07536137260189814:_e=.006253266595455118:t[10]>28.500000000000004?_e=-.006106041147592768:t[9]>156.50000000000003?_e=-.11828932797811101:t[94]>1e-35?_e=-.02566078479505714:t[303]>1e-35?_e=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?_e=-.08401252789168523:t[5]>4244.500000000001?_e=.026372887658499107:t[1]>16.500000000000004?_e=-.027836756345634026:_e=.09205362097909099:_e=.00934612788718244:t[203]>1e-35?_e=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?_e=-.09580979052540028:t[1]>50.50000000000001?_e=-.06402211827281554:_e=.08342858760095972:t[2]>36.50000000000001?_e=.008114897658204584:t[92]>1e-35?_e=.09541587072672864:_e=-.022342147210555434:_e=-.01660492519175128:_e=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?_e=.15846731118501817:_e=.039498507912023195:t[245]>1e-35?_e=.07008718676813333:_e=.0019806389728814727;let Re;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Re=-.01192072916082109:Re=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Re=.06874032717466054:t[4]>40.50000000000001?Re=-.07752510020707537:t[1]>76.50000000000001?Re=-.09944032260703917:t[8]>1381.5000000000002?Re=-.054466635810800745:t[1]>32.50000000000001?Re=.05974084520839573:Re=-.0384718740755954:Re=-.11374190719134032:t[0]>2151.5000000000005?Re=-.13703645155803298:Re=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Re=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Re=.013539805885738608:Re=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Re=.09941880179344399:Re=-.01608127391210995:Re=.08025226531247417:t[9]>67.50000000000001?Re=.13525448212444113:t[6]>61.50000000000001?Re=-.05511099182158894:t[94]>1e-35?Re=-.06821509831783572:t[128]>1e-35?Re=.11361314817714643:Re=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Re=-.09954181329804547:t[197]>1e-35?Re=.10102833149755386:t[188]>1e-35?Re=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Re=-.03781554214742005:Re=.09927933385592314:Re=-.020006000056720083:Re=-.10520473615957895:Re=-.12006990846253787:Re=-.00026111570975317574;let Je;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?Je=-.019188245509744628:Je=-.13354864350075848:t[0]>2461.5000000000005?Je=.051885477468354396:Je=-.0833581968852119:Je=.08233441701532287:Je=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?Je=.09926337893072812:Je=-.027753610497327715:t[0]>1972.5000000000002?Je=-.09780045823152517:Je=.032380915168504935:Je=.11502632261226381:t[17]>1e-35?Je=-.06094965899579662:t[10]>40.50000000000001?Je=-.07500475582440802:Je=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?Je=-.09584538995220808:Je=-.00908705814304442:Je=.03203281520813893:t[10]>49.50000000000001?Je=-.03146271513986384:t[2]>63.50000000000001?Je=.13172001315536286:t[224]>1e-35?Je=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?Je=.09521549382082259:Je=-.04414925613522197:t[0]>1847.5000000000002?Je=-.09118580379557353:Je=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?Je=.03525144509943896:Je=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?Je=-.04766112322938157:t[2]>10.500000000000002?Je=.0728516504357201:Je=-.05049625965272536:Je=-.10868663055825774:Je=.0005382613419948969;let Xe;t[147]>1e-35?t[1]>53.50000000000001?Xe=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Xe=-.030504020655417463:Xe=.07102458639110094:Xe=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?Xe=.055304563442710876:t[1]>53.50000000000001?Xe=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?Xe=-.1568835288372895:Xe=-.0279829124400056:Xe=.04493843959601833:Xe=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?Xe=-.054133834303687026:t[9]>48.50000000000001?Xe=.11263810289007213:t[9]>9.500000000000002?Xe=-.02202034562838259:t[4]>45.50000000000001?Xe=-.03410927569045158:Xe=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?Xe=-.029687297407295893:Xe=.10673602850001934:t[4]>42.50000000000001?Xe=.0036275562945108117:Xe=-.0760789221330622:Xe=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Xe=.08274426793676076:Xe=-.07076234425516396:Xe=.13890177606150175:Xe=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?Xe=-.09250637750836187:Xe=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?Xe=-.01897867921812603:Xe=.04890781705365262:Xe=-.11569892307597907:t[2]>106.50000000000001?Xe=.09032697440623969:Xe=.00047935919155035045;let Ct;t[115]>1e-35?Ct=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Ct=-.10131179514695865:t[8]>938.5000000000001?Ct=.10203729808015481:Ct=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Ct=.03574015165562999:Ct=-.07763042506449493:Ct=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Ct=.0665706259130275:Ct=-.06586817559309924:Ct=.11925564412287476:Ct=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Ct=.046017146627455346:Ct=-.08623321630086885:t[8]>1765.5000000000002?Ct=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Ct=.11143827902215087:Ct=-.01817808730473413:Ct=.16980985030210127:Ct=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Ct=.010168994879727824:Ct=-.09099594488792513:t[9]>1.5000000000000002?Ct=.0533459678147928:Ct=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Ct=-.062346959148773695:t[1]>47.50000000000001?Ct=-.0021578343835599316:t[2]>27.500000000000004?Ct=.19567373210166172:Ct=.07851555379116423:t[18]>1e-35?Ct=.03711549097804649:t[8]>359.50000000000006?Ct=.012492346746905587:t[4]>20.500000000000004?Ct=.047511695735697544:Ct=-.07999269063948773:Ct=6802045404471004e-20;let Ot;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?Ot=.0011484728213539738:Ot=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?Ot=-.09828874964938798:t[8]>1586.5000000000002?Ot=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?Ot=.011938269926919522:Ot=.17541983715953954:t[19]>1e-35?Ot=.023002786011088672:Ot=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?Ot=.06508934844183291:Ot=-.10168553534835639:Ot=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?Ot=.021140806225203937:Ot=-.1167833342453639:t[2]>33.50000000000001?Ot=.13163585734056618:Ot=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?Ot=.06314479201263888:Ot=-.09639088327091713:t[10]>29.500000000000004?Ot=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?Ot=40577156464836036e-21:Ot=.12322387121810757:Ot=-.03697224045046014:t[1]>22.500000000000004?Ot=.016474835887320276:Ot=.16919298733903063:Ot=.07633203630214054:Ot=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ot=.14150493354700563:Ot=-.01831155354975749:t[1]>28.500000000000004?Ot=-.07952557178685365:t[10]>28.500000000000004?Ot=.0665695554984927:Ot=-.053640139319277094:Ot=.0004754840665898665;let $t;t[76]>1e-35?$t=-.06814884255939921:t[179]>1e-35?$t=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?$t=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?$t=.004193658608848433:$t=-.1066968975983452:t[8]>302.50000000000006?$t=.05476730110440451:$t=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?$t=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?$t=.013555772109446666:$t=-.09856116699770784:$t=.0284329611813383:t[2]>52.50000000000001?$t=.04008708444763762:t[9]>29.500000000000004?$t=-.1289599546008197:$t=-.018566534248335896:t[8]>747.5000000000001?$t=.02236484980076122:$t=.1148871655157582:t[8]>3084.0000000000005?$t=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?$t=.03164751204281298:$t=.11752140436184891:t[9]>42.50000000000001?$t=-.07180559595410106:t[22]>1e-35?$t=.09325040416256854:$t=-.016041122807939914:$t=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?$t=-.010718250133458515:$t=.09818827994853763:$t=.010180038981174032:$t=-.039472162599295535:t[9]>170.50000000000003?$t=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?$t=-.08674788057474031:$t=.02077653508548371:$t=-.0003536561382007414;let Gt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?Gt=.018337297491457794:Gt=-.05926206443180149:Gt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?Gt=.10747078482128616:t[126]>1e-35?Gt=-.10550625192391357:t[7]>71.50000000000001?Gt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?Gt=.1317396472229434:Gt=-.025035791351328947:Gt=-.0728334305864372:t[8]>963.5000000000001?Gt=.023642201723096064:Gt=.183010326734258:t[128]>1e-35?Gt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?Gt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?Gt=-.1088876900335281:Gt=.02758317023002635:Gt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?Gt=-.01928020117446408:Gt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?Gt=.07893723375925096:Gt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?Gt=-.10301657587280551:Gt=.005787463140224318:Gt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?Gt=-.019296977889522397:Gt=-.07274529751752634:t[1]>30.500000000000004?Gt=-.050368901143148286:Gt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?Gt=.0015332402792773946:Gt=.09930153676749967:Gt=-.06370844564357069:Gt=.00042272155209927616;let Ee;t[71]>1e-35?t[4]>17.500000000000004?Ee=.12586844370423247:Ee=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ee=-.08474891624263797:t[8]>125.50000000000001?Ee=.08125086980439704:Ee=-.04082085238068532:t[0]>3863.5000000000005?Ee=.020481535807469208:Ee=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ee=-.019110200161573936:Ee=-.12387719685855114:t[0]>1102.5000000000002?Ee=.08376595701957407:Ee=-.031821919580524834:t[9]>4.500000000000001?Ee=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ee=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ee=.1349841206807871:Ee=.011864053595560297:t[1]>41.50000000000001?Ee=-.08203662486612544:t[2]>18.500000000000004?Ee=-.009541865642346947:Ee=.08345043168501759:t[2]>10.500000000000002?Ee=-.09585031818030947:Ee=.019432330487099865:Ee=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ee=.11951517733981365:Ee=-.016651014735738538:t[1]>28.500000000000004?Ee=-.07410922545030711:t[10]>28.500000000000004?Ee=.05886430683844788:Ee=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ee=.04802269879144705:Ee=-.026208212831796737:t[4]>45.50000000000001?Ee=-.03227476944664786:Ee=.05124575625622705:Ee=.00020506696916003137;let Qe;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?Qe=-.03042091758483443:t[10]>14.500000000000002?Qe=.09816619204768777:Qe=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?Qe=-.02381165060401718:Qe=-.10950361804974783:Qe=.03538211665111128:t[212]>1e-35?t[19]>1e-35?Qe=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?Qe=-.06371052144380579:Qe=.0835500621252692:Qe=-.10408255929333915:t[1]>74.50000000000001?Qe=.13208968122712403:t[1]>64.50000000000001?Qe=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?Qe=.09922816902423433:Qe=.016366955328796718:Qe=.1592412560903584:t[1]>39.50000000000001?Qe=.05409467990258923:Qe=-.08260633210459611:Qe=-.06307205775247567:t[9]>36.50000000000001?Qe=.040253940015648144:Qe=.14202568969471283:Qe=-.028761848341594044:Qe=.08994073058773508:t[0]>807.5000000000001?Qe=-.043427848826323195:Qe=.04573516446846493:t[20]>1e-35?t[188]>1e-35?Qe=-.0758877731600639:t[23]>1e-35?Qe=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?Qe=.08124700978741987:Qe=.013296063087086852:t[7]>5.500000000000001?Qe=-.01640196088612987:Qe=-.12685498840146067:Qe=-.0004940792382459551;let nt;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?nt=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?nt=.08513773825688947:nt=-.1184664832315282:nt=.05676963535893477:nt=.14263843210340613:nt=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?nt=-.10669720555606924:nt=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?nt=.0664744575868955:nt=-.08469256188890871:nt=-.026746678040592144:t[281]>1e-35?nt=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?nt=.012131807587207655:nt=-.12776015795398743:nt=.04320472481083551:nt=.08390980661550446:t[10]>227.50000000000003?nt=-.09771783809101153:t[10]>130.50000000000003?nt=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?nt=-.07610698254064358:t[8]>902.5000000000001?nt=-.03136381213599649:t[131]>1e-35?nt=.0704821739127936:t[224]>1e-35?nt=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?nt=.10431473040024908:t[8]>841.5000000000001?nt=.07304745320500514:nt=-.038011541882439825:nt=-.01679746695007364:t[0]>3129.5000000000005?nt=.05589952587431965:t[210]>1e-35?nt=.06227198085800842:nt=-.0011341890997947812:t[8]>740.5000000000001?nt=.04817300084412584:nt=-.000577001010789238;let mt;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?mt=-.10504730480402079:t[5]>3341.5000000000005?mt=.11087894671081754:mt=-.0406668834674614:mt=.03308382165616109:t[8]>104.50000000000001?mt=-.10431436764549162:mt=.0073928337244891455:t[4]>34.50000000000001?mt=-.10571751512748416:mt=-.006081128814142983:t[13]>1e-35?mt=.1299673566095023:t[4]>60.50000000000001?mt=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?mt=.04857126072645073:mt=-.03431365358104773:t[4]>16.500000000000004?mt=.04101865986596709:mt=.16480274980378218:t[10]>26.500000000000004?mt=.03673978504199255:t[10]>9.500000000000002?mt=-.10996402743800027:t[308]>1e-35?mt=.0553693735082498:mt=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?mt=.010902983761213922:mt=.1325118659895645:mt=-.064362945508595:t[1]>66.50000000000001?mt=.033416767779331176:mt=-.054080316225040496:t[42]>1e-35?mt=-.07762364337810815:t[10]>1089.5000000000002?mt=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?mt=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?mt=.0220102041325908:mt=-.06516708740003069:mt=.012833498905748267:t[224]>1e-35?mt=-.007038418272997865:mt=.00037666304316290967;let xe;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?xe=.07554189644995735:xe=-.052089349455904946:xe=-.10148206848169845:t[113]>1e-35?xe=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?xe=.07172653627995676:xe=-.07602959317610998:xe=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?xe=-.0399322883690891:xe=.06523495517476098:xe=-.10358715295743802:t[193]>1e-35?xe=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?xe=.015928764772252406:xe=.1341513061552287:xe=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?xe=-.033592997607280156:xe=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?xe=-.08402551858097379:xe=.017401984506038796:t[1]>25.500000000000004?xe=.13337205393591278:xe=-.01160208350090984:xe=.06708317942315471:t[8]>227.50000000000003?xe=-.08486943882418681:xe=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?xe=-.10496268177586783:xe=-.020921489532370493:xe=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?xe=.11639296062157028:xe=-.004275784356569115:t[32]>1e-35?xe=-.07297384970166025:xe=.006026841626381599:xe=.002034611134960428;let He;t[248]>1e-35?He=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?He=-.06455513326540585:t[1]>29.500000000000004?He=.07718474591552532:t[4]>7.500000000000001?He=.040139336931404826:He=-.09685734690563386:He=.00015327283570347363:t[9]>88.50000000000001?He=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?He=-.04077257804338707:He=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?He=.03778141591008941:He=-.06459919920634845:He=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?He=.14063930759326346:t[0]>179.50000000000003?He=.07287482250668585:t[8]>1180.5000000000002?He=-.14419393112726253:t[10]>28.500000000000004?He=-.07993142770099469:t[17]>1e-35?He=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?He=.05527969663610186:He=-.10824385941441346:t[3]>11.500000000000002?He=.12358502961047915:He=-.017509147119622873:t[0]>74.50000000000001?He=-.014907705458730486:t[8]>95.50000000000001?He=-.02225118168342062:He=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?He=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?He=.04962819555610421:He=-.07213577821855309:He=.09139529824708481:t[19]>1e-35?He=.013439401088345224:He=-.049274647207292056:He=.10531673719686951;let Ze;t[40]>1e-35?t[0]>1937.5000000000002?Ze=-.06421671152073961:Ze=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Ze=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Ze=-.03520420769287065:t[8]>1085.5000000000002?Ze=-.019817352506127633:Ze=.11444439424520964:Ze=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Ze=-.010490117519863269:Ze=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Ze=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Ze=.06619344145920268:t[0]>4091.5000000000005?Ze=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ze=.10016091391222309:Ze=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Ze=-.019511460451434884:Ze=-.11643672465055221:t[2]>18.500000000000004?Ze=.07848228087333317:t[8]>55.50000000000001?Ze=.032583027899956235:Ze=-.11209832692153521:t[11]>1e-35?Ze=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Ze=-.09996887746328006:t[9]>2.5000000000000004?Ze=.02157682011863397:Ze=-.05247727848991843:Ze=.07409150201483244:t[1]>38.50000000000001?Ze=-.11378466075449625:t[224]>1e-35?Ze=-.10741749127732923:t[1]>26.500000000000004?Ze=.07343136534146562:Ze=-.07013573628594773:t[25]>1e-35?Ze=-.04626669734164317:Ze=.05518333197956482:Ze=.00032434010867555516;let at;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?at=.026313251010808853:at=-.08997339150292381:at=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?at=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?at=.0905155504503746:t[8]>1049.5000000000002?at=-.062312558183394054:t[8]>719.5000000000001?at=.09583836191410239:t[0]>3719.5000000000005?at=-.0778097309430818:at=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?at=-.12920865648544927:t[0]>2699.5000000000005?at=-.07086587879041864:at=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?at=-.11377786322600797:at=-.009486325820117998:t[1]>55.50000000000001?at=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?at=-.07938291201004219:t[2]>36.50000000000001?at=.01520046732530246:at=.13649854049662832:at=-.07145015938528873:t[8]>407.50000000000006?at=-.00350257360822279:at=.11332047082193297:at=-.10060624458629897:at=.05429496612497562:t[8]>1446.5000000000002?at=.006073419197482838:at=-.08718676350883998:at=-.11532497988252638:at=.10766270463068293:t[34]>1e-35?at=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?at=-.0004109812623829506:at=.021601073497455662:at=-7343540098965853e-20;let ct;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ct=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?ct=.05995640200798119:t[0]>3443.5000000000005?ct=-.14698883458733583:ct=-.030039164579240187:t[189]>1e-35?ct=-.06086763220538141:t[1]>86.50000000000001?ct=-.05096727866142538:t[4]>64.50000000000001?ct=.11240554253834577:t[4]>45.50000000000001?ct=-.030279760168394117:t[6]>45.50000000000001?ct=.10161088917815142:t[10]>77.50000000000001?ct=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?ct=-.06672020005240323:ct=.08831457502630258:t[8]>2592.5000000000005?ct=-.052617701047376654:t[10]>29.500000000000004?ct=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?ct=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?ct=-.064099222705728:ct=.044332487521538365:t[0]>2882.5000000000005?ct=.031099546885005065:ct=.12938467051623853:t[0]>4221.500000000001?ct=-.0928676413498701:t[9]>30.500000000000004?ct=-.05781824812803708:ct=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?ct=-.06648105454098469:ct=.05985487552383097:ct=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?ct=.05282385499619401:t[1]>66.50000000000001?ct=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?ct=.027885690791379255:ct=-.08407126408362446:ct=.014432924125571093:ct=-9903435845205118e-20;let ut;t[76]>1e-35?ut=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?ut=.013633653464240465:ut=-.10164319411983509:ut=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?ut=.00632864847804078:ut=-.08393000368134668:ut=.07870508617440916:t[284]>1e-35?ut=.1092302727710421:ut=-.0025505047582483234:t[248]>1e-35?ut=.07101822393621864:t[274]>1e-35?ut=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?ut=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?ut=.025081789181021243:ut=-.014813325803582618:t[9]>33.50000000000001?ut=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?ut=.11926990418060353:ut=.01852125513565268:ut=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?ut=-.1178464984373743:t[283]>1e-35?ut=.043370859226927405:t[5]>4320.500000000001?ut=-.01103141226366587:t[8]>1104.5000000000002?ut=-.023053423988095886:ut=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?ut=.000579145585864887:ut=.03389152834202143:t[128]>1e-35?ut=-.14527722052568462:t[210]>1e-35?ut=-.08915971541902741:t[7]>9.500000000000002?ut=-.03307314577076116:t[18]>1e-35?ut=-.05521712302023565:ut=.009315605032770029:ut=.0036332551852289933;let ee;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?ee=-.07583539600416284:t[188]>1e-35?ee=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?ee=-.011038193049597113:ee=.08154028164397753:t[1]>85.50000000000001?ee=.10259361975201933:ee=.011640408330521594:ee=-.00023319159023748508:t[92]>1e-35?ee=.13771692859530546:ee=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?ee=.09967230141007705:t[30]>1e-35?ee=-.08888529037551285:ee=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?ee=.08284665960761373:ee=-.029292565021289504:t[7]>7.500000000000001?ee=-.09945093355204493:ee=-.008381393701708593:t[20]>1e-35?ee=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?ee=.07585582641438211:t[8]>284.50000000000006?ee=-.029387993239886723:ee=.07716738177321587:t[1]>18.500000000000004?ee=.026745348497993746:ee=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?ee=.02337306890530338:ee=-.10390355904767366:ee=.07390521199638532:ee=-.06788247515155237:ee=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?ee=-.06360325615644084:ee=.04342192339836601:ee=-.10598779152030145:ee=.05253384605768211;let pe;t[3]>7.500000000000001?t[157]>1e-35?pe=-.07514182877923786:pe=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?pe=.028692053800951845:pe=.14081686716133598:pe=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?pe=.0037139292567243084:pe=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?pe=.01202688580305612:pe=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?pe=.043935495082738626:pe=-.05639305759669704:t[247]>1e-35?pe=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?pe=.10331836202616368:pe=.0006926658459781341:t[96]>1e-35?pe=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?pe=-.0741403257305367:pe=.022900127535540854:t[7]>3.5000000000000004?pe=.038110741403836294:pe=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?pe=-.09552842289807008:t[1]>27.500000000000004?pe=.012505935885798007:pe=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?pe=-.1046104767723845:pe=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?pe=.023466328488582572:pe=.11730925774586994:pe=-.04771965631104874:pe=.17059689880751394:pe=-.08181850955999449:t[26]>1e-35?pe=-.12727482696678769:pe=-.014343123272734182;let ke;t[147]>1e-35?t[1]>53.50000000000001?ke=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?ke=-.02763546051134888:ke=.06423344777499343:ke=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?ke=.049825139823021586:t[7]>22.500000000000004?ke=-.01131680751379858:t[0]>2579.5000000000005?ke=-.10673674485369694:ke=-.015387212937189957:ke=.04347325151148724:t[179]>1e-35?ke=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ke=.0650355590939066:ke=-.0473332870892226:ke=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?ke=.11139543329789044:t[126]>1e-35?ke=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?ke=.06370903833231022:t[10]>29.500000000000004?ke=.03415223859607161:t[10]>3.5000000000000004?ke=-.07415518117873297:ke=-.0014119203473324082:ke=.12617652343819508:t[9]>41.50000000000001?ke=-.10311145857176976:t[8]>2757.5000000000005?ke=-.08106484219011428:t[7]>71.50000000000001?ke=-.09783384432091176:t[1]>88.50000000000001?ke=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?ke=-.008884084501608536:ke=.061339437777743616:ke=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?ke=.01526664064166223:ke=.13534828515415498:ke=-.06985484465894776:ke=.0005758961943178744;let Le;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Le=-.029152732370514342:Le=.07173628916139178:t[1]>36.50000000000001?Le=-.08859111297255318:Le=.0018030071815630785:Le=.13652461563759322:Le=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Le=-.07145140450454163:t[21]>1e-35?Le=-.07422841663493233:Le=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Le=.11864240653986852:t[3]>33.50000000000001?Le=-.08821209591953476:Le=.05706392280054726:Le=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Le=.01953613016837112:Le=-.059781039130025006:t[148]>1e-35?Le=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Le=.07207826841738371:t[202]>1e-35?Le=.08163917539410503:Le=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Le=-.06858280496900336:Le=-.1781828899516648:Le=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Le=.018232649414147116:Le=-.04419781124222661:Le=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Le=.11452368095776105:Le=-.036496437259924026:Le=-.040445338739465486:Le=.0816572651001145:Le=-.08968914517368663:Le=.0002826343082585516;let Ve;t[189]>1e-35?t[0]>5269.500000000001?Ve=-.08839493050459957:t[10]>85.50000000000001?Ve=.10046908365702462:t[8]>2592.5000000000005?Ve=-.09632233975926387:t[8]>2000.5000000000002?Ve=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?Ve=.035504970430426296:t[1]>31.500000000000004?Ve=-.1133764813142531:Ve=-.01138280942244812:t[8]>1125.5000000000002?Ve=.09800530246229806:Ve=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?Ve=.07316772160107896:Ve=-.059095014819051765:Ve=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?Ve=-.09150209066166894:t[8]>3084.0000000000005?Ve=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?Ve=-.04449234460408263:Ve=.05568837973347338:Ve=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?Ve=.12741077850267066:Ve=.007372371864985329:t[2]>39.50000000000001?Ve=.02295917234617787:Ve=.14966532083907075:t[1]>39.50000000000001?Ve=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?Ve=-.02511861881285652:t[1]>27.500000000000004?Ve=.08683660011672288:Ve=.02956214835267301:t[9]>15.500000000000002?Ve=-.016538805462996232:Ve=.04352738094981517:Ve=-.05561856645643868:t[9]>170.50000000000003?Ve=-.07996752635874248:t[179]>1e-35?Ve=-.09065975936933919:Ve=-.00042817975060427177;let tt;t[39]>1e-35?t[4]>25.500000000000004?tt=.03443173196222934:tt=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?tt=-.0013415395759330318:tt=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?tt=.002297618040307216:tt=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?tt=-.015297257305397608:tt=.09651828834062742:tt=-.06636003334371929:t[10]>11.500000000000002?tt=.17631616138309397:t[0]>1639.5000000000002?tt=3804386478092585e-20:tt=-.09099296398683193:tt=-.06874415876172972:t[0]>2151.5000000000005?tt=-.1311264883406766:tt=.00809052010141122:t[253]>1e-35?tt=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?tt=.045038497754638605:tt=-.07770167665661752:tt=-.08596294280650517:tt=.08538655727027213:tt=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?tt=.054627956617973275:t[1]>61.50000000000001?tt=-.11994465088415499:t[4]>8.500000000000002?tt=.06676200239406452:tt=-.027503148069376867:t[8]>676.5000000000001?tt=-.10363964928357075:t[4]>8.500000000000002?tt=-.07589816227175682:tt=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?tt=.009093153189012338:tt=-.06119765876605404:tt=.0004668642103528348;let vt;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?vt=-.10100794502567233:vt=.08000205636470442:vt=-.11945419826856896:t[113]>1e-35?vt=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?vt=.1224302423880318:vt=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?vt=.0019277012166729114:t[1]>28.500000000000004?vt=-.054445821715687494:vt=.045645722976713245:t[30]>1e-35?vt=.13402660155331655:vt=.008921176001777645:vt=-.058547426505451076:vt=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?vt=-.13526418192218206:vt=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?vt=.0007263224246135398:vt=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?vt=-.11575657261278308:vt=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?vt=-.01995960178292952:vt=.11216586049153021:vt=-.10050961087149474:vt=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?vt=.10303451081526649:vt=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?vt=-.043799548968209395:vt=-.12451444314954115:t[4]>12.500000000000002?vt=-.03838117361958468:vt=.06504990789767144:t[57]>1e-35?vt=.06890006938293915:vt=.0003914274695562949;let Nt;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?Nt=.004271749009686975:Nt=-.10523878297127605:Nt=.04633982158107851:Nt=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?Nt=-.08655730561951676:t[8]>919.5000000000001?Nt=-.0676453705610183:t[7]>18.500000000000004?Nt=-.027787974193650575:Nt=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?Nt=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?Nt=-.03473877164537313:t[8]>719.5000000000001?Nt=.10471053866934404:Nt=.008236107678382981:t[4]>57.50000000000001?Nt=.09412219478825269:t[10]>66.50000000000001?Nt=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?Nt=-.040681323751002293:Nt=.06374650297561021:Nt=.12884615227401788:t[10]>5.500000000000001?Nt=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?Nt=-.05474068967150784:Nt=.03744700650806603:Nt=-.07846396348680855:t[1]>42.50000000000001?Nt=.018972315810821302:Nt=.10953621007604744:t[5]>4439.500000000001?Nt=.010999776705494586:t[1]>40.50000000000001?Nt=-.12394200059775967:t[10]>2.5000000000000004?Nt=.013528093962849453:Nt=-.09222088417048682:Nt=-.12662967149701485:Nt=.09327296405849603:t[3]>99.50000000000001?Nt=-.013581954439986752:Nt=.0005526498251862075;let Vt;t[187]>1e-35?t[243]>1e-35?Vt=-.08392792551692502:t[10]>68.50000000000001?Vt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?Vt=-.0825306209711224:Vt=.049559996084532945:Vt=-.1064938580886302:Vt=.03353240732240275:Vt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?Vt=.16966001471529374:t[1]>57.50000000000001?Vt=-.005772777673676247:Vt=.09383677041525058:t[8]>747.5000000000001?Vt=.054068175469351235:Vt=-.049968216310277036:t[8]>753.5000000000001?Vt=-.0679383555784074:t[4]>8.500000000000002?Vt=-.059757341189735386:Vt=.05701083682780414:Vt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?Vt=.05820296128730006:Vt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?Vt=.15340611616954566:Vt=.04385036188666874:t[0]>4449.500000000001?Vt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?Vt=.004840354641006495:Vt=.09967827580276283:Vt=.11605363537391578:t[9]>19.500000000000004?Vt=-.0735831692725717:Vt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?Vt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?Vt=-.02442182361342386:Vt=.10334853004243093:Vt=-.030431948680167104:Vt=-956078595250818e-19;let It;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?It=-.040232505718244854:t[0]>3030.5000000000005?It=.0634109586813073:It=-.04043617034245621:It=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?It=-.007859096946435131:It=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?It=.05515771679628051:It=-.04214471312668263:It=-.09589322222261765:t[193]>1e-35?It=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?It=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?It=-.08152604001147906:t[11]>1e-35?It=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?It=.13100930780107503:t[10]>25.500000000000004?It=.05921074710011526:It=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?It=.0009447118243153454:It=-.09820565036865991:It=.057146909749745546:t[0]>2115.5000000000005?It=-.12331216726611678:It=.007281983677694285:t[2]>56.50000000000001?It=.012310154675612615:It=-.08873665774670461:t[6]>25.500000000000004?It=.134708740821879:t[9]>5.500000000000001?It=-.0805901581148979:t[224]>1e-35?It=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?It=.10842593386554122:t[2]>13.500000000000002?It=.06466798320378395:It=-.08578130788886655:It=-.03590892078300114:It=.0003499894043880708;let Be;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?Be=.10839808814624702:Be=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?Be=-.007478368069393829:Be=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?Be=.04035247751736232:t[0]>4255.500000000001?Be=-.1310865624507367:t[0]>4004.5000000000005?Be=.06647367311982634:Be=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?Be=-.011618902907510411:Be=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?Be=.09356028223727986:Be=-.03811765057032162:Be=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?Be=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?Be=.1146142460964847:t[1]>62.50000000000001?Be=-.09679869865322362:t[9]>71.50000000000001?Be=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?Be=-.039046426387852974:Be=.04558778688367152:Be=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?Be=.03261697816211156:t[15]>1e-35?Be=.02586252542264368:t[2]>14.500000000000002?Be=-.016420452667484604:Be=-.1011799626006976:Be=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?Be=.010193588102560583:Be=.11748729525930773:Be=-.04468162226743652:Be=-.028365274393617957:t[71]>1e-35?Be=.05115139346588793:Be=-.0001510425316936658;let oe;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?oe=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?oe=.020637047900190317:oe=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?oe=-.04632587527094407:oe=.08603684785510396:oe=-.05101401015448496:oe=.025466432054358498:oe=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?oe=.020385355430046367:oe=.12032592051335252:oe=-.012387370292173013:t[2]>23.500000000000004?oe=-.12568545484492677:oe=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?oe=.043528764484784536:oe=.14352071657196003:oe=-.009332833816977268:oe=.11186782227735846:oe=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?oe=-.05649104643152564:oe=.03884200719305747:t[42]>1e-35?oe=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?oe=-.04103416502526736:oe=.04881823954656287:t[4]>15.500000000000002?oe=.009342724662897898:t[0]>3969.5000000000005?oe=-.025637309961309498:oe=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?oe=-.08185697075265091:t[0]>2215.5000000000005?oe=.030063975892297354:t[0]>807.5000000000001?oe=-.03924325550733229:oe=.0415330999189793:oe=-.00024374664461674863;let ve;t[3]>7.500000000000001?ve=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ve=.025798416259686565:ve=.13251610353146012:ve=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?ve=-.11098564237775424:ve=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?ve=.15347826616466054:t[3]>4.500000000000001?ve=.10379320730958941:ve=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?ve=.03159791088468647:ve=-.10612873364104258:ve=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?ve=-.02335760775001469:ve=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?ve=-.011164334474672973:ve=-.06594044410501655:t[207]>1e-35?ve=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?ve=-.01725821503981916:ve=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?ve=-.04226531631656534:ve=-.14409800530171432:ve=-.03245576341206398:t[8]>4214.500000000001?ve=.0895409165534886:t[247]>1e-35?ve=-.06506383629143335:t[118]>1e-35?ve=-.07214270121257443:t[8]>546.5000000000001?ve=-.004385020865473831:ve=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?ve=.046278501133958524:ve=-.030835570926968044:t[0]>493.50000000000006?ve=-.12794504651610425:ve=.009415039807550776;let Se;t[304]>1e-35?Se=-.04717777269217453:t[76]>1e-35?Se=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Se=-.09648224457374217:t[132]>1e-35?Se=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Se=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Se=.10838431695638147:t[230]>1e-35?Se=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Se=.050071316251979:Se=-.006356941111525215:t[6]>8.500000000000002?Se=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Se=.10217402850540398:Se=-.048840949025349197:Se=-.03668313197909846:t[7]>39.50000000000001?Se=-.0562642841496003:t[10]>2.5000000000000004?Se=.09749777369987417:Se=-.04848223121417616:t[0]>5453.500000000001?Se=.08316648226133942:Se=-.0261979698267618:t[212]>1e-35?Se=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Se=.04837009746506856:Se=-.09184360565631328:Se=.0032411047845613606:t[0]>4733.500000000001?Se=.0977378556864798:Se=.010776545559325588:Se=-.012483310473120218:Se=-.049284121449103935:Se=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Se=-.08380361910948711:Se=.07375088778585813:Se=-.1084864186071348:Se=.0007819503469605476;let de;t[7]>17.500000000000004?t[115]>1e-35?de=.08741852531696623:t[167]>1e-35?de=.10078975495600809:de=-.0018324767784017562:t[290]>1e-35?de=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?de=.1379733311640402:de=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?de=-.09360083033774169:de=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?de=-.015599362579530679:t[0]>4593.500000000001?de=-.12029549262691491:de=-.018917032256501397:de=.04632831686576592:de=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?de=-.05894883236412263:de=.05213944998315824:de=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?de=.07577412405680808:de=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?de=-.0277076900736147:t[1]>65.50000000000001?de=-.023587471585763506:de=.10184896592433082:de=-.057699270527916825:de=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?de=.06566902102799584:t[10]>25.500000000000004?de=-.07033633753181047:de=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?de=-.08108035861059537:de=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?de=-.12431182772561139:de=.01886235886984271:de=.0025579594894418116;let te;t[8]>2915.5000000000005?t[101]>1e-35?te=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?te=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?te=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?te=.0687641681341721:t[10]>102.50000000000001?te=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?te=-.06762578396473291:t[10]>65.50000000000001?te=-.05226727783610509:t[282]>1e-35?te=.09911438410640917:t[19]>1e-35?te=.06915156336429933:te=-.006565637886508241:te=-.08344300251849307:te=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?te=.19428463865406298:te=.016073883020956765:t[13]>1e-35?te=.06864077097923665:te=-.01388867527034731:t[0]>1847.5000000000002?te=.004655280608161356:t[1]>40.50000000000001?te=.031406054057765996:te=.12798062439212832:te=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?te=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?te=-.0706095614785733:te=.04227164041372561:te=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?te=-.07139533369873902:te=.008952586782921625:te=.06086212582180936:te=-.0816938490403437:te=-.051224901945956025:te=-.10525399124186095:te=.000270924147208224;let Fe;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?Fe=.029186512383291244:t[7]>1.5000000000000002?Fe=-.14984127276725573:t[1]>40.50000000000001?Fe=.032757060730648144:Fe=-.07675575422749602:t[6]>8.500000000000002?Fe=.10599766037117893:Fe=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?Fe=-.051394622947855385:Fe=.03237141302699347:Fe=.12526173027943244:Fe=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Fe=-.07383912482657777:t[0]>5147.500000000001?Fe=.07008813937042091:t[10]>38.50000000000001?Fe=-.06779203808365307:Fe=-.013782769999524498:Fe=.0880038869117715:Fe=-.12846294176070952:t[281]>1e-35?Fe=-.06810806903850834:t[10]>227.50000000000003?Fe=-.08937977001661111:t[10]>130.50000000000003?Fe=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?Fe=.011036530162093841:Fe=-.11500797478569702:Fe=.03702229366129399:Fe=.07242026683784307:t[189]>1e-35?Fe=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?Fe=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?Fe=-.02608892716555304:Fe=.09609599320761308:t[9]>105.50000000000001?Fe=-.06848127135991534:Fe=.0023675721254089715:t[86]>1e-35?Fe=-.11049635625500497:Fe=-.004847764219432233;let et;t[125]>1e-35?t[0]>3969.5000000000005?et=-.09462233499115416:et=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?et=-.030700661288166148:et=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?et=.03149547314036763:et=-.08166208257451366:t[0]>5850.500000000001?et=-.10228136324773157:t[102]>1e-35?et=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?et=.01782894842128785:t[13]>1e-35?et=.002680190260979968:et=.1773965720476949:t[2]>72.50000000000001?et=.09090831938627947:t[1]>59.50000000000001?et=-.12297206702816128:t[0]>4977.500000000001?et=.09899015653118268:et=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?et=-.0675900954187773:et=.012336403425364092:et=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?et=-.02671721777458802:et=-.09242452991958029:t[284]>1e-35?et=-.08585691288582491:et=.013332890564324447:t[4]>14.500000000000002?et=-.005245022074799553:t[23]>1e-35?et=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?et=-.09289852307936758:t[116]>1e-35?et=-.09686573010015055:t[8]>804.5000000000001?et=.03812547148215318:et=.005162744968176633:t[9]>43.50000000000001?et=-.059246106396159376:et=.050370113808135275:et=.000794041852811028;let Ht;t[3]>7.500000000000001?Ht=.0004981426543104341:t[9]>114.50000000000001?Ht=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?Ht=-.019061766497948867:Ht=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?Ht=-.006044199577160493:Ht=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?Ht=.11486607015912494:t[9]>16.500000000000004?Ht=-.08686820858087294:Ht=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?Ht=-.022230207980026437:Ht=.1056683690528792:Ht=-.05859530800943035:Ht=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?Ht=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?Ht=-.05177544573528314:Ht=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?Ht=.15159657923771555:Ht=-.0060542654587671055:t[9]>5.500000000000001?Ht=-.042808028205051786:t[1]>48.50000000000001?Ht=-.010449538258110742:Ht=.10026907521968294:Ht=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?Ht=-.02272452389409874:Ht=-.11202691218244319:t[5]>1809.5000000000002?Ht=-.04460413584255906:Ht=.08196329474205256:t[10]>69.50000000000001?Ht=.10221481166238167:Ht=.0004063052701699382:t[243]>1e-35?Ht=-.07563941678849846:t[18]>1e-35?Ht=.02563513231103432:Ht=-.004740081147303786;let mr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?mr=.057446442918106:mr=-.04404018270156349:mr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?mr=-.05930486238817954:t[1]>29.500000000000004?mr=.06955866121256543:t[8]>597.5000000000001?mr=-.06538593556505168:mr=.06212512595497445:mr=.00021102929959182257:t[9]>90.50000000000001?mr=.0958061289119631:t[102]>1e-35?mr=.07172059675638813:t[1]>47.50000000000001?mr=-.03879798603977766:t[297]>1e-35?mr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?mr=.003805910996312012:mr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?mr=.11252376801858695:t[288]>1e-35?mr=-.10293901912180432:mr=.014669268837893872:t[1]>42.50000000000001?mr=-.05988274123836837:t[145]>1e-35?mr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?mr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?mr=-.03366718308159971:mr=.11936550608549797:t[1]>31.500000000000004?mr=-.07454716789539667:mr=.027859650621164217:t[10]>10.500000000000002?mr=-.11806374092321247:mr=-.03506042229223101:mr=-.0007080765837654515:t[10]>6.500000000000001?mr=-.028077713664996503:t[2]>7.500000000000001?mr=.15803724124216814:mr=.0351381284833169:mr=-.07877953381054767;let or;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?or=.14144941521975005:or=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?or=.10514088112381886:t[7]>18.500000000000004?or=-.10370643555956745:or=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?or=-.0508129468802936:t[224]>1e-35?or=-.037816066368733595:t[10]>43.50000000000001?or=.07793408602607932:or=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?or=.036972453794202324:or=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?or=.09475302525132188:or=-.03580104945898193:or=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?or=-.1282448778804823:or=-.014395808269207212:or=-.008940927190750592:or=-.1459118815453748:t[0]>4897.500000000001?or=-.09733068457286576:t[1]>57.50000000000001?or=.06575271409540207:or=-.019556422817450115:or=-.10623959222984136:t[18]>1e-35?or=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?or=.008125645893104896:or=-.11084368630465868:or=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?or=-.05854904579626861:t[4]>5.500000000000001?or=.02985784951394175:or=-.03247600140149334:or=-.11152899295304973:or=-.00035424577714215764;let Nr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Nr=-.06563670567578264:Nr=.067656954313663:Nr=-.10388217548685377:t[8]>2302.5000000000005?Nr=.07190621943790435:t[4]>67.50000000000001?Nr=.060020507643618604:t[4]>38.50000000000001?Nr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Nr=-.06568134366461277:t[8]>1075.5000000000002?Nr=-.004768057709758692:Nr=.11785959165999467:Nr=-.05080221682879267:Nr=.14814206127494542:Nr=-.07241946332311736:t[253]>1e-35?Nr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Nr=-.02471195342450034:Nr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Nr=-.10741850739482771:Nr=.010051635824944:Nr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Nr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Nr=-.08992396138178163:Nr=.010944365997007212:Nr=.06221307021813793:Nr=.1286024087559141:t[127]>1e-35?Nr=.06568148624531012:t[10]>40.50000000000001?Nr=-.07567979134643352:t[5]>5647.500000000001?Nr=.07594672895572069:Nr=-.018158016446439187:t[6]>55.50000000000001?Nr=.009293422430111872:t[4]>45.50000000000001?Nr=-.017749818406964022:t[2]>46.50000000000001?Nr=.01714136511113982:Nr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let wm=BQs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+k+D+N+L+B+Q+M+O+q+F+U+W+V+G+Y+re+j+X+ie+we+Ae+De+Te+Z+J+z+le+K+ae+Me+ne+se+Ie+_e+Re+Je+Xe+Ct+Ot+$t+Gt+Ee+Qe+nt+mt+xe+He+Ze+at+ct+ut+ee+pe+ke+Le+Ve+tt+vt+Nt+Vt+It+Be+oe+ve+Se+de+te+Fe+et+Ht+mr+or+Nr+Hr+Gr+zt+_r);return[1-wm,wm]}a(Qzn,"multilineModelPredict");function BQs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(BQs,"sigmoid");var LQs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},qzn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function jzn(t,e,r,n=!0){let o=t.split(` -`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(LQs[r]??[]).some(l=>s.includes(l))}a(jzn,"hasComment");var Oat=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=jzn(e,-2,r),this.rstripSecondToLastLineHasComment=jzn(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` +`)}}catch{}l(null,s)},flush(s){try{r+=e.end(),r&&o(r.replace(/\r$/,"")),n>0&&t(n)}catch{}s()}})}a(sQs,"createCopilotUsageSniffer");function pYn(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"message"in r){let n=r.message;if(typeof n=="string")return n}if(typeof e.message=="string")return e.message}catch{}}a(pYn,"extractErrorMessage");function aQs(t){if(t)try{let e=JSON.parse(t),r=e.error;if(r&&typeof r=="object"&&"code"in r){let n=r.code;if(typeof n=="string")return n}if(typeof e.code=="string")return e.code}catch{}}a(aQs,"extractErrorCode");As();var QA=new Ae("ClaudeCodeAgent"),qA="ClaudeCodeAgentService";function cQs(t){let e=t.capabilities.supports?.reasoning_effort,r=!!e&&e.length>0,n=t.capabilities.supports,o=t.capabilities.limits,s=t.billing,c=s&&{...s.multiplier!==void 0?{multiplier:s.multiplier}:{},...s.token_prices!==void 0?{token_prices:s.token_prices}:{}},l=!!c&&Object.keys(c).length>0;return{id:t.id,name:t.name,...t.preview!==void 0?{preview:t.preview}:{},...t.vendor!==void 0?{vendor:t.vendor}:{},...t.model_picker_category!==void 0?{model_picker_category:t.model_picker_category}:{},...t.model_picker_price_category!==void 0?{model_picker_price_category:t.model_picker_price_category}:{},...t.supported_endpoints!==void 0?{supported_endpoints:t.supported_endpoints}:{},...t.policy!==void 0?{policy:t.policy}:{},...l?{billing:c}:{},...t.warning_messages!==void 0?{warning_messages:t.warning_messages}:{},capabilities:{family:t.capabilities.family,supports:{...n?.streaming!==void 0?{streaming:n.streaming}:{},...n?.tool_calls!==void 0?{tool_calls:n.tool_calls}:{},...n?.vision!==void 0?{vision:n.vision}:{},...e!==void 0?{reasoning_effort:e}:{},reasoningEffort:r},limits:{...o?.max_prompt_tokens!==void 0?{max_prompt_tokens:o.max_prompt_tokens}:{},...o?.max_output_tokens!==void 0?{max_output_tokens:o.max_output_tokens}:{},max_context_window_tokens:o?.max_context_window_tokens??0}},...e!==void 0?{supportedReasoningEfforts:e}:{},...r?{defaultReasoningEffort:BQ(e)}:{}}}a(cQs,"toAgentModelInfo");var DF=class{constructor(e,r){this.ctx=e;this.sdkWrapper=r;this._sessions=new Map;this.notificationSender=e.get(Hs)}static{a(this,"ClaudeCodeAgentService")}async createSession(e){return this.runWithTelemetry("claudeCodeAgent.createSession",async r=>{await Qzn(this.ctx,e);let n=e.sessionId??ir(),o=this._sessions.get(n);if(o)return QA.info(this.ctx,`${qA}.createSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="idempotentHit",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:o.cwd};let s=kn(e.workspaceFolder.uri),c=await this._ensureProxyConfig(),l=new h2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:s,model:e.model,isNewSession:!0,proxyConfig:c});return this._sessions.set(n,l),QA.info(this.ctx,`${qA}.createSession`,{sessionId:n,cwd:s}),r.properties.reason="created",r.properties.modelId=e.model??"",{sessionId:n,workspacePath:s}})}async resumeSession(e){return this.runWithTelemetry("claudeCodeAgent.resumeSession",async r=>{await qzn(this.ctx,e);let{sessionId:n}=e,o=this._sessions.get(n);if(o)return QA.info(this.ctx,`${qA}.resumeSession: returning existing in-memory session`,{sessionId:n}),r.properties.reason="memory",r.properties.modelId=e.model??"",r.measurements.eventCount=0,{sessionId:n,workspacePath:o.cwd};let s=await this.sdkWrapper.getSessionInfo(n);if(!s?.cwd)throw new Error(`Session not found: ${n}`);let c=s.cwd,l=await this._ensureProxyConfig(),u=new h2e(this.ctx,this.sdkWrapper,this.notificationSender,{sessionId:n,cwd:c,model:e.model,isNewSession:!1,proxyConfig:l});this._sessions.set(n,u),QA.info(this.ctx,`${qA}.resumeSession: resumed from SDK transcript`,{sessionId:n,cwd:c});let d;try{let f=await this.sdkWrapper.getSessionMessages(n,{includeSystemMessages:!0});d=dYn(f),r.properties.transcriptOk="true"}catch(f){QA.warn(this.ctx,`${qA}.resumeSession: failed to translate on-disk transcript`,{sessionId:n,error:f instanceof Error?f.message:String(f)}),r.properties.transcriptOk="false",r.properties.transcriptErrorName=f instanceof Error?f.name:"Unknown",d=void 0}return r.properties.reason="disk",r.properties.modelId=e.model??"",r.measurements.eventCount=d?.length??0,{sessionId:n,workspacePath:c,events:d}})}async sendMessage(e,r){return this.runWithTelemetry("claudeCodeAgent.sendMessage",async n=>{await jzn(this.ctx,e);let o=e.sessionId,s=this._sessions.get(o);if(!s)throw new Error(`Session not found: ${o} \u2014 call createSession or resumeSession before sendMessage`);let c={uri:ba(s.cwd)};await this.ctx.get(sg).applyPromptTemplateToRequest(e,[c]);let l=ir(),u=performance.now();return s.invoke({message:e.message,references:e.references,model:e.model,reasoningEffort:e.reasoningEffort,messageId:l,token:r}).catch(d=>{QA.warn(this.ctx,`${qA}.sendMessage: invoke rejected`,{sessionId:o,error:d instanceof Error?d.message:String(d)}),this.emit("claudeCodeAgent.sendMessage.failure",u,!1,{reason:"invoke"},void 0,d)}),n.properties.reason="dispatched",n.properties.modelId=e.model??"",n.properties.hasReferences=String((e.references?.length??0)>0),n.measurements.messageCharLen=e.message.length,n.measurements.referenceCount=e.references?.length??0,{messageId:l}})}async listSessions(e){return this.runWithTelemetry("claudeCodeAgent.listSessions",async r=>{$zn(this.ctx,e),QA.info(this.ctx,`${qA}.listSessions`,e);let o=(await this.sdkWrapper.listSessions({dir:e.cwd})).map(s=>({sessionId:s.sessionId,summary:s.summary,startTime:new Date(s.createdAt??s.lastModified).toISOString(),modifiedTime:new Date(s.lastModified).toISOString(),isRemote:!1,context:s.cwd!==void 0?{cwd:s.cwd,branch:s.gitBranch}:void 0}));return QA.info(this.ctx,`${qA}.listSessions returned`,{count:o.length}),r.measurements.count=o.length,{sessions:o}})}async listModels(e){return this.runWithTelemetry("claudeCodeAgent.listModels",async r=>{Vzn(this.ctx,{agentProvider:"CLAUDE",forceRefresh:e}),QA.info(this.ctx,`${qA}.listModels`,{forceRefresh:e});let s=(await this.ctx.get(Fa).getMetadata()).filter(c=>c.model_picker_enabled===!0).filter(c=>c.capabilities.type==="chat").filter(c=>UHe(c.capabilities.family)).map(cQs);return QA.info(this.ctx,`${qA}.listModels returned`,{count:s.length}),r.properties.forceRefresh=String(e??!1),r.measurements.count=s.length,{models:s}})}async stopSession(e){await this.runWithTelemetry("claudeCodeAgent.stopSession",async r=>{Hzn(this.ctx,{agentProvider:"CLAUDE",sessionId:e});let n=this._sessions.get(e);if(!n){QA.info(this.ctx,`${qA}.stopSession: unknown session`,{sessionId:e}),r.properties.reason="unknownSession";return}await n.interrupt()})}destroySession(e){return this.runWithTelemetry("claudeCodeAgent.destroySession",r=>{Gzn(this.ctx,e);let{sessionId:n}=e;try{let o=this._sessions.get(n);return o?(o.dispose(),this._sessions.delete(n),QA.info(this.ctx,`${qA}.destroySession`,{sessionId:n}),{success:!0}):(QA.info(this.ctx,`${qA}.destroySession: unknown session`,{sessionId:n}),r.properties.reason="unknownSession",{success:!0})}catch(o){return QA.error(this.ctx,`${qA}.destroySession: failed`,{sessionId:n,error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",{success:!1}}})}async setModel(e,r){await this.runWithTelemetry("claudeCodeAgent.setModel",async n=>{let o=this._sessions.get(e);if(!o){QA.info(this.ctx,`${qA}.setModel: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await u2e(this.ctx,r),await o.setModel(r),n.properties.modelId=r??""})}async setPermissionMode(e,r){await this.runWithTelemetry("claudeCodeAgent.setPermissionMode",async n=>{let o=this._sessions.get(e);if(!o){QA.info(this.ctx,`${qA}.setPermissionMode: unknown session`,{sessionId:e}),n.ok=!1,n.properties.reason="unknownSession";return}await o.setPermissionMode(r),n.properties.permissionMode=r??""})}get sessionCount(){return this._sessions.size}emit(e,r,n,o,s,c){let l={success:n?"true":"false",...o},u={totalTimeMs:performance.now()-r,...s};c!==void 0?si(this.ctx,e,c,l,u):_t(this.ctx,e,l,u)}async runWithTelemetry(e,r){let n=performance.now(),o={properties:{},measurements:{}};try{let s=await r(o);return this.flush(e,n,o),s}catch(s){throw o.error??=s,this.flush(e,n,o),s}}flush(e,r,n){n.error!==void 0?this.emit(`${e}.failure`,r,!1,n.properties,n.measurements,n.error):this.emit(e,r,n.ok??!0,n.properties,n.measurements)}unsupported(e){return new Error(`${e} is not supported by ClaudeCodeAgentService`)}handleInteraction(e){let r=this._sessions.get(e.sessionId);if(!r)return QA.warn(this.ctx,`${qA}.handleInteraction: unknown session`,{sessionId:e.sessionId,requestId:e.requestId,interactionType:e.type}),Promise.resolve({success:!1});let n=r.respondToInteraction(e);return Promise.resolve({success:n})}getPlanPath(){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(){throw this.unsupported("getRemoteStatus")}compactHistory(){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(){return Promise.reject(this.unsupported("stopCompactHistory"))}dispose(){for(let e of this._sessions.values())e.dispose();this._sessions.clear()}async _ensureProxyConfig(){return this.ctx.get(HZ).start()}};p();var Ulr=new yn;function AYn(t){return[...t].sort((e,r)=>{let n=Ulr.get(e.uri)??0;return(Ulr.get(r.uri)??0)-n})}a(AYn,"sortByAccessTimes");var yYn=a(t=>t.get(an).onDidFocusTextDocument(e=>{e.document&&Ulr.set(e.document.uri.toString(),Date.now())}),"registerDocumentTracker");p();p();p();var EYn=fe(require("events"));var Fat="CompletionRequested",A5=class{constructor(e){this.ctx=e}static{a(this,"CompletionNotifier")}#e=new EYn.default;notifyRequest(e,r,n,o,s){return this.#e.emit(Fat,{completionId:r,completionState:e,telemetryData:n,cancellationToken:o,options:s})}onRequest(e){let r=Nm(this.ctx,e,`event.${Fat}`);return this.#e.on(Fat,r),jn.Disposable.create(()=>this.#e.off(Fat,r))}};p();p();var Qlr=class{constructor(){this.observers=new Set}static{a(this,"Subject")}subscribe(e){return this.observers.add(e),()=>this.observers.delete(e)}next(e){for(let r of this.observers)r.next(e)}error(e){for(let r of this.observers)r.error?.(e)}complete(){for(let e of this.observers)e.complete?.()}},Uat=class extends Qlr{static{a(this,"ReplaySubject")}subscribe(e){let r=super.subscribe(e);return this._value!==void 0&&e.next(this._value),r}next(e){this._value=e,super.next(e)}};var fb=class{constructor(e){this.ctx=e;this.#e=new Ae("AsyncCompletionManager");this.requests=new yn(100);this.mostRecentRequestId=""}static{a(this,"AsyncCompletionManager")}#e;clear(){this.requests.clear()}shouldWaitForAsyncCompletions(e,r){for(let[n,o]of this.requests)if(qlr(e,r,o))return!0;return!1}updateCompletion(e,r){let n=this.requests.get(e);n!==void 0&&(n.partialCompletionText=r,n.subject.next(n))}queueCompletionRequest(e,r,n,o,s){this.#e.debug(this.ctx,`[${e}] Queueing async completion request:`,r.substring(r.lastIndexOf(` +`)+1));let c=new Uat;return this.requests.set(e,{state:2,cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c}),s.then(l=>{if(this.requests.delete(e),l.type!=="success"){this.#e.debug(this.ctx,`[${e}] Request failed with`,l.reason),c.error(l.reason);return}let u={cancellationTokenSource:o,headerRequestId:e,prefix:r,prompt:n,subject:c,choice:l.value[0],result:l,state:0,allChoicesPromise:l.value[1]};this.requests.set(e,u),c.next(u),c.complete()}).catch(l=>{this.#e.error(this.ctx,`[${e}] Request errored with`,l),this.requests.delete(e),c.error(l)})}getFirstMatchingRequestWithTimeout(e,r,n,o,s){let c=this.ctx.get(Jt).asyncCompletionsTimeout(s);return c<0?(this.#e.debug(this.ctx,`[${e}] Waiting for completions without timeout`),this.getFirstMatchingRequest(e,r,n,o)):(this.#e.debug(this.ctx,`[${e}] Waiting for completions with timeout of ${c}ms`),Promise.race([this.getFirstMatchingRequest(e,r,n,o),new Promise(l=>setTimeout(()=>l(null),c))]).then(l=>{if(l===null){this.#e.debug(this.ctx,`[${e}] Timed out waiting for completion`);return}return l}))}async getFirstMatchingRequest(e,r,n,o){o||(this.mostRecentRequestId=e);let s=!1,c=new nA,l=new Map,u=a(f=>()=>{let h=l.get(f);h!==void 0&&(h(),l.delete(f),!s&&l.size===0&&(s=!0,this.#e.debug(this.ctx,`[${e}] No matching completions found`),c.resolve(void 0)))},"finishRequest"),d=a(f=>{if(qlr(r,n,f)){if(f.state===0){let h=r.substring(f.prefix.length),{completionText:m}=f.choice;if(!m.startsWith(h)||m.length<=h.length){u(f.headerRequestId)();return}m=m.substring(h.length),f.choice.telemetryData.measurements.foundOffset=h.length,this.#e.debug(this.ctx,`[${e}] Found completion at offset ${h.length}: ${JSON.stringify(m)}`),c.resolve([{...f.choice,completionText:m},f.allChoicesPromise]),s=!0}}else this.cancelRequest(e,f),u(f.headerRequestId)()},"next");for(let[f,h]of this.requests)qlr(r,n,h)?l.set(f,h.subject.subscribe({next:d,error:u(f),complete:u(f)})):this.cancelRequest(e,h);return c.promise.finally(()=>{for(let f of l.values())f()})}cancelRequest(e,r){e===this.mostRecentRequestId&&r.state!==0&&(this.#e.debug(this.ctx,`[${e}] Cancelling request: ${r.headerRequestId}`),r.cancellationTokenSource.cancel(),this.requests.delete(r.headerRequestId))}};function qlr(t,e,r){if(r.prompt.suffix!==e.suffix||!t.startsWith(r.prefix))return!1;let n=t.substring(r.prefix.length);return r.state===0?r.choice.completionText.startsWith(n)&&r.choice.completionText.trimEnd().length>n.length:r.partialCompletionText===void 0?!0:r.partialCompletionText.startsWith(n)}a(qlr,"isCandidate");p();p();var g2e=class{constructor(e){this.maxSize=e;this.root=new m2e;this.leafNodes=new Set}static{a(this,"LRURadixTrie")}set(e,r){let{node:n,remainingKey:o}=this.findClosestNode(e);if(o.length>0){for(let[s,c]of n.children)if(s.startsWith(o)){let l=s.slice(0,o.length),u=new m2e;n.removeChild(s),n.addChild(l,u),u.addChild(s.slice(l.length),c),n=u,o=o.slice(l.length);break}if(o.length>0){let s=new m2e;n.addChild(o,s),n=s}}n.value=r,this.leafNodes.add(n),this.leafNodes.size>this.maxSize&&this.evictLeastRecentlyUsed()}findAll(e){return this.findClosestNode(e).stack.map(({node:r,remainingKey:n})=>r.value!==void 0?{remainingKey:n,value:r.value}:void 0).filter(r=>r!==void 0)}delete(e){let{node:r,remainingKey:n}=this.findClosestNode(e);n.length>0||this.deleteNode(r)}findClosestNode(e){let r=!0,n=this.root,o=[{node:n,remainingKey:e}];for(;e.length>0&&r;){r=!1;for(let[s,c]of n.children)if(e.startsWith(s)){e=e.slice(s.length),o.unshift({node:c,remainingKey:e}),n=c,r=!0;break}}return{node:n,remainingKey:e,stack:o}}deleteNode(e){if(e.value=void 0,this.leafNodes.delete(e),e.parent===void 0||e.childCount>1)return;let{node:r,edge:n}=e.parent;if(e.childCount===1){let[s,c]=Array.from(e.children)[0];e.removeChild(s),r.removeChild(n),r.addChild(n+s,c);return}if(r.removeChild(n),r.parent===void 0)return;let o=r.parent;if(r.value===void 0&&r.childCount===1){let[s,c]=Array.from(r.children)[0],l=o.edge+s;r.removeChild(s),o.node.removeChild(o.edge),o.node.addChild(l,c)}}evictLeastRecentlyUsed(){let e=this.findLeastRecentlyUsed();e&&this.deleteNode(e)}findLeastRecentlyUsed(){let e;for(let r of this.leafNodes)(e===void 0||r.touchedo.content.filter(s=>s.suffix===r&&s.choice.completionText.startsWith(n)&&s.choice.completionText.length>n.length).map(s=>({...s.choice,completionText:s.choice.completionText.slice(n.length),telemetryData:s.choice.telemetryData.extendedBy({},{foundOffset:n.length})})))}append(e,r,n){let o=this.cache.findAll(e);if(o.length>0&&o[0].remainingKey===""){let s=o[0].value.content;this.cache.set(e,{content:[...s,{suffix:r,choice:n}]})}else this.cache.set(e,{content:[{suffix:r,choice:n}]})}clear(){this.cache=new g2e(100)}};p();var pb=class{constructor(){this.choices=[]}static{a(this,"CurrentGhostText")}get clientCompletionId(){return this.choices[0]?.clientCompletionId}setGhostText(e,r,n,o){o!==2&&(this.prefix=e,this.suffix=r,this.choices=n)}getCompletionsForUserTyping(e,r){let n=this.getRemainingPrefix(e,r);if(n!==void 0&&_Yn(this.choices[0].completionText,n))return lQs(this.choices,n)}hasAcceptedCurrentCompletion(e,r){let n=this.getRemainingPrefix(e,r);if(n===void 0)return!1;let o=n===this.choices?.[0].completionText,s=this.choices?.[0].finishReason;return o&&s==="stop"}getRemainingPrefix(e,r){if(!(this.prefix===void 0||this.suffix===void 0||this.choices.length===0)&&this.suffix===r&&e.startsWith(this.prefix))return e.substring(this.prefix.length)}};function lQs(t,e){return t.filter(r=>_Yn(r.completionText,e)).map(r=>({...r,completionText:r.completionText.substring(e.length)}))}a(lQs,"adjustChoicesStart");function _Yn(t,e){return t.startsWith(e)&&t.length>e.length}a(_Yn,"startsWithAndExceeds");p();p();var NF={" ":1,"!":2,'"':3,"#":4,$:5,"%":6,"&":7,"'":8,"(":9,")":10,"*":11,"+":12,",":13,"-":14,".":15,"/":16,0:17,1:18,2:19,3:20,4:21,5:22,6:23,7:24,8:25,9:26,":":27,";":28,"<":29,"=":30,">":31,"?":32,"@":33,A:34,B:35,C:36,D:37,E:38,F:39,G:40,H:41,I:42,J:43,K:44,L:45,M:46,N:47,O:48,P:49,Q:50,R:51,S:52,T:53,U:54,V:55,W:56,X:57,Y:58,Z:59,"[":60,"\\":61,"]":62,"^":63,_:64,"`":65,a:66,b:67,c:68,d:69,e:70,f:71,g:72,h:73,i:74,j:75,k:76,l:77,m:78,n:79,o:80,p:81,q:82,r:83,s:84,t:85,u:86,v:87,w:88,x:89,y:90,z:91,"{":92,"|":93,"}":94,"~":95};p();function vYn(t){let e;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>427.50000000000006?t[9]>13.500000000000002?t[121]>1e-35?e=-.3793786744885956:t[149]>1e-35?e=-.34717430705356905:e=-.26126834451035963:e=-.2431318366096852:t[5]>888.5000000000001?e=-.20600463586387135:e=-.2568037008471491:t[308]>1e-35?e=-.2363064824497454:t[8]>370.50000000000006?e=-.37470755210284723:e=-.321978453730494:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?e=-.26259136509758885:e=-.3096719634039438:t[4]>30.500000000000004?t[9]>18.500000000000004?e=-.34254903852890883:t[2]>98.50000000000001?e=-.41585250791146294:e=-.3673574858887241:t[9]>6.500000000000001?e=-.31688079287876225:t[31]>1e-35?e=-.29110977864003823:t[308]>1e-35?e=-.3201411739040839:e=-.36874023066055506:t[8]>691.5000000000001?t[82]>1e-35?e=-.41318393149040566:t[133]>1e-35?e=-.3741272613525161:t[32]>1e-35?e=-.4112378041027121:t[227]>1e-35?e=-.37726615155719356:t[10]>3.5000000000000004?e=-.3164502293560397:e=-.2930071546509045:t[9]>13.500000000000002?e=-.277366858539218:t[308]>1e-35?t[4]>10.500000000000002?e=-.30975610686807187:t[4]>1.5000000000000002?e=-.2549142136728043:e=-.3271325650785176:t[127]>1e-35?t[0]>1937.5000000000002?e=-.2533046188098832:e=-.325520883579:e=-.331628896481776;let r;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?t[9]>13.500000000000002?r=.031231253521808708:r=.05380836288014532:t[5]>423.00000000000006?t[8]>114.50000000000001?r=.06751619128429062:r=.09625089153176467:r=.027268163053989804:t[308]>1e-35?r=.060174483556283756:r=-.049062854038919135:t[3]>24.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?r=-.03969241799174589:r=.01086816842550381:t[31]>1e-35?r=-.003284694817583201:t[9]>6.500000000000001?t[4]>30.500000000000004?r=-.04224490699947552:r=-.011834162944360616:t[308]>1e-35?t[32]>1e-35?r=-.13448447971850278:r=-.019569456707046823:t[19]>1e-35?t[9]>1.5000000000000002?r=-.07256260662659254:t[4]>60.50000000000001?r=-.08227503453609311:r=-.020596416747563847:r=-.07396549241564149:t[8]>691.5000000000001?t[82]>1e-35?r=-.10046536995362734:t[133]>1e-35?r=-.06407649822752297:t[225]>1e-35?r=.08035785003303324:t[92]>1e-35?r=.018901360933204676:t[20]>1e-35?r=.05252546973665552:t[8]>2592.5000000000005?r=-.040543705016462955:r=-.011236043818320725:t[9]>17.500000000000004?r=.025560632674895334:t[308]>1e-35?t[0]>1847.5000000000002?r=.03527165701669741:r=-.0071847350825815035:t[127]>1e-35?r=.024373016379595405:t[9]>2.5000000000000004?r=-.0035090719709448288:r=-.03514829488063766;let n;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?n=.03848674861536988:t[5]>423.00000000000006?t[8]>114.50000000000001?t[9]>56.50000000000001?n=-.003764520033319488:n=.06570817919969299:t[4]>61.50000000000001?n=.028346156293069538:n=.0908154644362606:n=.02445594243234816:t[308]>1e-35?t[8]>65.50000000000001?n=.0019305229020073053:n=.09279357295883772:n=-.04458984161917124:t[3]>24.500000000000004?t[23]>1e-35?n=.0027405390271277013:t[4]>29.500000000000004?t[52]>1e-35?n=.044727478132905285:t[115]>1e-35?n=.10245804828855934:t[9]>17.500000000000004?n=-.03353173647469207:t[2]>98.50000000000001?n=-.10048106638102179:n=-.05484231104348874:t[31]>1e-35?n=.016807537467116516:t[9]>6.500000000000001?n=-.012113620535295137:t[4]>8.500000000000002?t[308]>1e-35?n=-.01882594250504289:n=-.05585658862796076:n=.04279591277938338:t[8]>691.5000000000001?t[82]>1e-35?n=-.09262278043707878:t[133]>1e-35?n=-.058454257768893625:t[32]>1e-35?n=-.09769348447126434:t[25]>1e-35?n=-.0725430043727677:t[122]>1e-35?n=-.10047841601578077:n=-.00580671054458958:t[9]>13.500000000000002?n=.021399199032818294:t[308]>1e-35?t[4]>10.500000000000002?n=-.0076376731757173515:n=.03394923033036848:t[127]>1e-35?n=.02070489091204209:n=-.02290162726126496;let o;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?o=.010230295672324606:o=.038540509248742805:t[8]>125.50000000000001?t[1]>49.50000000000001?o=.03086356292895467:o=.057128750867458604:t[5]>888.5000000000001?o=.07861602941396924:o=.030523262699070908:t[308]>1e-35?o=.048236117667577356:t[8]>370.50000000000006?o=-.05642125069212264:o=-.007232836777168195:t[3]>24.500000000000004?t[23]>1e-35?t[131]>1e-35?o=.03640661467213915:o=-.005889820723907028:t[31]>1e-35?o=-.0009007166998276938:t[9]>6.500000000000001?o=-.022590340093882378:t[308]>1e-35?t[32]>1e-35?o=-.1215445089091064:o=-.01435612266219722:t[19]>1e-35?t[9]>1.5000000000000002?o=-.061555513040777825:t[4]>60.50000000000001?o=-.07053475504569347:o=-.013733369453963092:o=-.06302097189114152:t[227]>1e-35?o=-.05820440333190048:t[8]>683.5000000000001?t[82]>1e-35?o=-.08466979526809346:t[10]>24.500000000000004?o=-.017092159721119944:t[92]>1e-35?o=.03592901452463749:o=-.00359310519524756:t[5]>1809.5000000000002?t[243]>1e-35?o=-.03963116207386097:t[118]>1e-35?o=-.09483996283536394:t[217]>1e-35?o=-.03394542089519989:t[242]>1e-35?o=-.07985899422287938:o=.019706602160656964:t[9]>12.500000000000002?o=.014072998937735146:o=-.021156294523894684;let s;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[9]>21.500000000000004?s=.009197756540516563:s=.03458896869535166:t[5]>5082.500000000001?s=.08265545468131008:t[131]>1e-35?s=.0740738432473315:s=.045159136632942756:t[8]>319.50000000000006?s=-.04653401534465376:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?s=-.011400839766681709:s=.11149800187510031:s=-.08683250977599462:s=.08355310136724753:t[4]>23.500000000000004?t[23]>1e-35?t[131]>1e-35?s=.040389083779932555:s=-.009887614274108602:t[52]>1e-35?s=.03705353499757327:t[9]>6.500000000000001?s=-.025401260429257562:t[2]>98.50000000000001?s=-.09237673187534504:s=-.04298556869281803:t[222]>1e-35?s=-.045221965895986184:t[8]>691.5000000000001?t[133]>1e-35?s=-.05435318330148897:t[128]>1e-35?s=-.08672907303184191:t[227]>1e-35?s=-.05568304584186561:t[122]>1e-35?s=-.09623059693538563:t[225]>1e-35?s=.07558331642202279:t[82]>1e-35?s=-.07360566227233566:s=-.005646164647395919:t[242]>1e-35?s=-.08203758341228108:t[9]>13.500000000000002?s=.018726123829696042:t[308]>1e-35?t[4]>10.500000000000002?s=-.011153942154062704:s=.03132858912391067:t[127]>1e-35?s=.021455228822345174:t[23]>1e-35?s=.01959966745346997:s=-.021764790177579325;let c;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>284.50000000000006?t[121]>1e-35?t[18]>1e-35?c=.07547602514276922:c=-.08529678832140396:c=.030314822344598043:t[5]>888.5000000000001?t[4]>61.50000000000001?c=.011143589009415464:c=.0654700456802118:c=.021794712646632755:t[308]>1e-35?c=.04231872551095028:c=-.034381999950549455:t[4]>23.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?c=-.03678981254332261:c=.010518160384496255:t[8]>825.5000000000001?c=-.04506534842082387:t[9]>38.50000000000001?c=.01004983052203438:c=-.030580958620701027:t[39]>1e-35?c=-.12802435021505382:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>6.500000000000001?c=.030426957004611704:c=-.0726407693060581:c=.017395521646964375:t[4]>7.500000000000001?t[0]>93.50000000000001?t[9]>7.500000000000001?c=-.008024349629981291:t[31]>1e-35?c=.01296539930850471:t[308]>1e-35?c=-.012855016509024084:c=-.04564527976851505:c=-.15681420504058596:t[10]>4.500000000000001?t[243]>1e-35?c=-.1012064426380198:c=-.0062808850924854194:c=.030706323726162416:t[9]>13.500000000000002?c=.017081636133736405:t[308]>1e-35?t[4]>10.500000000000002?c=-.009306613091760644:t[4]>1.5000000000000002?c=.03655523200850989:c=-.02671654212893341:t[127]>1e-35?c=.019261510468604387:c=-.017627818570628936;let l;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>892.5000000000001?t[308]>1e-35?l=.036100405995889276:l=.011709313297015793:t[0]>119.50000000000001?t[8]>125.50000000000001?l=.03622542297472574:l=.05595579157301536:l=-.02234751038146796:t[8]>319.50000000000006?l=-.040132029478400735:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?l=-.009306153573847916:l=.10058509567064988:l=-.0785668890966017:t[9]>28.500000000000004?l=-.04781977604130416:l=.09753292614937459:t[4]>23.500000000000004?t[131]>1e-35?l=.02372493254975127:t[148]>1e-35?l=.028103095989516644:t[4]>58.50000000000001?t[10]>1e-35?l=-.05000852203469597:l=.02922366846119705:t[23]>1e-35?l=-.0026335076988151292:l=-.03073993752935585:t[222]>1e-35?l=-.03867374428185713:t[32]>1e-35?l=-.07220729365053084:t[39]>1e-35?l=-.11624524614351733:t[8]>691.5000000000001?t[133]>1e-35?l=-.04836360271198036:t[8]>4968.500000000001?l=-.10873681915578029:t[149]>1e-35?l=-.11847484033769298:t[122]>1e-35?l=-.08916172460307559:t[82]>1e-35?l=-.06774726602152634:l=-.0033469147714351327:t[126]>1e-35?l=-.09474445392080015:t[8]>131.50000000000003?t[118]>1e-35?l=-.09002547031023511:l=.015475385187009489:t[25]>1e-35?l=-.08175501232759151:l=-.000429679055394914;let u;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>546.5000000000001?u=.021942996005324917:u=.042349138084484074:t[308]>1e-35?u=.036507270845732874:u=-.028981850556764995:t[3]>24.500000000000004?t[23]>1e-35?u=.00210930790963475:t[31]>1e-35?u=.006825358293027163:t[9]>6.500000000000001?u=-.013772084269062394:t[308]>1e-35?u=-.008307929099892574:t[19]>1e-35?u=-.027706313312904487:u=-.04891108984170914:t[134]>1e-35?u=-.0605730733844732:t[25]>1e-35?u=-.05347926493253117:t[227]>1e-35?u=-.049415829249003666:t[32]>1e-35?u=-.06807799662179595:t[308]>1e-35?t[4]>10.500000000000002?t[2]>13.500000000000002?u=-.00016302718260794637:u=-.10247095758122947:t[210]>1e-35?u=-.022149002072787024:t[95]>1e-35?u=.15222631630626304:u=.027393884520465712:t[9]>7.500000000000001?t[225]>1e-35?u=.13483346577752245:t[3]>9.500000000000002?t[243]>1e-35?u=-.045352728133789516:t[8]>683.5000000000001?u=.00474372227519902:u=.02635476098707525:t[92]>1e-35?u=.05659380819933452:t[105]>1e-35?u=.07431443210341222:t[186]>1e-35?u=.0915821133384904:u=-.016414750130401053:t[127]>1e-35?u=.011824693641866162:t[23]>1e-35?u=.0228468674288774:t[284]>1e-35?u=.06606936863302432:u=-.02872463273902358;let d;t[13]>1e-35?t[3]>1.5000000000000002?t[8]>125.50000000000001?t[288]>1e-35?d=-.019844363904157558:t[1]>50.50000000000001?t[131]>1e-35?d=.044961338592245194:d=.003659599513761676:t[121]>1e-35?d=-.04057103630479994:d=.03158560697078578:t[0]>421.50000000000006?t[4]>61.50000000000001?d=-.0003708603406529278:d=.05331312264472391:d=.0006575958601218936:t[8]>319.50000000000006?d=-.034654694051901545:t[7]>3.5000000000000004?t[0]>1230.5000000000002?t[0]>2579.5000000000005?d=-.0076053515916517005:d=.09116695486305336:d=-.07137458699162028:d=.06633130654035282:t[4]>29.500000000000004?t[23]>1e-35?t[4]>63.50000000000001?d=-.0308520802187302:d=.013156423968295541:t[115]>1e-35?d=.11581171687488252:t[52]>1e-35?t[10]>22.500000000000004?d=.12264179915175587:d=-.021905727233873535:t[8]>799.5000000000001?d=-.04181869575935412:d=-.023695901673350575:t[222]>1e-35?d=-.034612899265371776:t[8]>691.5000000000001?t[9]>98.50000000000001?d=-.06892116536821917:t[149]>1e-35?d=-.11194586444154514:t[133]>1e-35?d=-.04269583234000504:t[128]>1e-35?d=-.0644631966969502:t[8]>4968.500000000001?d=-.09650726096330133:d=-.004219129180139438:t[126]>1e-35?d=-.08038306745347751:t[5]>1809.5000000000002?d=.009265335288169993:t[9]>2.5000000000000004?d=.006447645462117438:d=-.021047132609551503;let f;t[13]>1e-35?t[3]>1.5000000000000002?t[9]>21.500000000000004?t[121]>1e-35?f=-.08436540015142402:t[8]>1861.5000000000002?f=-.01621425699342421:f=.01878613821895428:f=.031052879158242532:t[8]>319.50000000000006?f=-.031536619360997865:t[7]>3.5000000000000004?f=-.004510586962343298:f=.0596524941011746:t[4]>18.500000000000004?t[23]>1e-35?f=.004757490541310808:t[9]>6.500000000000001?f=-.008842393772207996:t[31]>1e-35?f=.0010536183837006993:t[308]>1e-35?f=-.008145882815435419:t[2]>98.50000000000001?f=-.08404937622173021:t[276]>1e-35?f=.0020072791321856663:t[19]>1e-35?f=-.023031820639490178:f=-.04553314326377875:t[8]>2134.5000000000005?f=-.02244583113572251:t[134]>1e-35?f=-.05592137394753121:t[308]>1e-35?t[49]>1e-35?f=.09989109704064947:t[4]>10.500000000000002?t[2]>13.500000000000002?f=-.00447733056482096:f=-.10191061664873849:f=.021765308380331864:t[9]>7.500000000000001?t[118]>1e-35?f=-.07570059131536411:t[243]>1e-35?f=-.040983393346598646:t[3]>9.500000000000002?f=.014763759061483812:t[92]>1e-35?f=.05136368898963024:f=-.008162398981149495:t[127]>1e-35?f=.013999119696708346:t[23]>1e-35?t[20]>1e-35?f=.14138985500120907:f=.008668274102844162:t[284]>1e-35?f=.06356484011042893:f=-.024781304572706303;let h;t[13]>1e-35?t[3]>8.500000000000002?t[8]>892.5000000000001?t[0]>384.50000000000006?h=.014387526569215037:t[8]>2266.5000000000005?h=-.1397298649743087:h=.007953931014097788:t[0]>119.50000000000001?t[4]>61.50000000000001?h=.0029819092211896296:t[218]>1e-35?h=.08450459375645737:h=.031646488019280654:h=-.03544960151460596:t[9]>9.500000000000002?h=-.026002317735915183:t[7]>1.5000000000000002?h=.005074258810794793:h=.0745247650477651:t[4]>29.500000000000004?t[131]>1e-35?h=.023269218675640847:t[148]>1e-35?h=.03812942399144545:t[115]>1e-35?h=.10512283476967227:h=-.02607307479736138:t[227]>1e-35?h=-.036576708299046294:t[101]>1e-35?h=.027948683650881864:t[149]>1e-35?h=-.08195628451594297:t[50]>1e-35?h=-.16997544922278504:t[8]>691.5000000000001?t[9]>101.50000000000001?h=-.06860333850762075:t[225]>1e-35?h=.06066641950951723:t[10]>22.500000000000004?t[1]>29.500000000000004?t[127]>1e-35?h=.028599705845427533:h=-.010746719511640914:t[0]>4877.500000000001?h=-.07251187886096228:h=-.021299712241446785:t[118]>1e-35?h=-.11902023760964736:h=15874469526809387e-21:t[8]>267.50000000000006?h=.01317292185402293:t[148]>1e-35?t[9]>20.500000000000004?h=.09614842415142123:h=.006049073167176467:t[189]>1e-35?h=.05562696451900713:h=-.006257541923837303;let m;t[13]>1e-35?t[9]>14.500000000000002?t[2]>11.500000000000002?t[1]>71.50000000000001?t[8]>1252.5000000000002?m=-.10069846585436666:m=-.010577995535809317:t[146]>1e-35?m=-.008877238274428668:t[280]>1e-35?m=.10076055897012692:t[6]>70.50000000000001?m=-.020603523042565547:t[7]>1.5000000000000002?m=.02819095420813202:m=-.1223354167911277:m=-.025073583348334844:t[8]>416.50000000000006?m=.01718560189149466:t[230]>1e-35?m=.12281803224342265:m=.03281276971308565:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?m=-.13070568109867683:t[4]>63.50000000000001?m=-.027221825262496814:m=.01530862490082352:t[9]>6.500000000000001?t[5]>4320.500000000001?t[2]>31.500000000000004?m=-.00605574271293711:m=.04739407327741249:m=-.012537528620315956:t[31]>1e-35?t[20]>1e-35?m=.1252215087035768:m=.003905888677601057:t[52]>1e-35?m=.045466299731038815:t[2]>100.50000000000001?m=-.07815624550168065:t[308]>1e-35?m=-.007715815250508057:t[276]>1e-35?t[9]>1.5000000000000002?m=-.03538265083203445:t[18]>1e-35?m=.1591211669800727:m=.015151475408241136:t[8]>557.5000000000001?m=-.04225569725456342:m=-.022455546324243267:t[308]>1e-35?m=.01325441736085826:t[197]>1e-35?m=.03752194600682512:t[225]>1e-35?m=.06583712394533976:m=-.005205289866839043;let g;t[13]>1e-35?t[9]>21.500000000000004?t[2]>12.500000000000002?g=.010264022580774884:g=-.02335958814489217:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?g=-.0936747137352166:t[0]>384.50000000000006?g=.019846244507320695:g=-.0751102554077272:g=-.026885329334203723:t[0]>966.5000000000001?t[10]>48.50000000000001?g=.11654906890054273:g=.0346250587613322:t[4]>39.50000000000001?g=-.08568002378645614:t[9]>16.500000000000004?g=-.12010535752923689:g=.021321923389033808:t[4]>14.500000000000002?t[23]>1e-35?t[21]>1e-35?g=-.12056431231412057:t[131]>1e-35?g=.03652965550568472:g=.002563006128791669:t[9]>6.500000000000001?t[30]>1e-35?g=-.10141481732178981:g=-.003936457893178248:t[31]>1e-35?g=.008215898756249477:t[52]>1e-35?t[0]>4188.500000000001?g=.12972828769588213:g=-.003137412232297087:t[2]>100.50000000000001?g=-.0730872929087944:t[308]>1e-35?g=-.006958622747243333:t[35]>1e-35?t[0]>3707.5000000000005?g=.07934620723812878:g=-.018598568353702116:g=-.030635505446410763:t[128]>1e-35?g=-.06962290453843294:t[84]>1e-35?g=-.15290337844960322:t[308]>1e-35?t[8]>2543.5000000000005?g=-.034938657503885584:g=.016339322898966915:t[197]>1e-35?g=.03358907965870046:t[18]>1e-35?g=-.01754013791515288:g=-.0004944586067698557;let A;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?A=.005888790687820524:A=.0429676533834978:t[2]>7.500000000000001?t[0]>119.50000000000001?t[6]>79.50000000000001?A=-.0224319889201976:t[212]>1e-35?A=.06249587051783863:t[8]>963.5000000000001?t[8]>1156.5000000000002?A=.010357273289123324:A=-.029749145161304082:t[218]>1e-35?A=.06449336340743606:A=.018047654539345502:A=-.07350502390293116:A=-.019594829995832414:t[4]>39.50000000000001?A=-.019338083179859314:t[39]>1e-35?A=-.10427066919173111:t[222]>1e-35?t[0]>612.5000000000001?A=-.019197415255018464:A=-.0836562507048181:t[149]>1e-35?A=-.07679624472577429:t[32]>1e-35?A=-.05097506748590604:t[191]>1e-35?A=.04670476485250936:t[30]>1e-35?A=-.05313073892148652:t[8]>691.5000000000001?t[23]>1e-35?t[203]>1e-35?t[4]>8.500000000000002?A=.03930363008271334:A=-.06029171685615689:A=.016203086182431294:t[4]>7.500000000000001?A=-.013824248237085224:t[10]>4.500000000000001?t[94]>1e-35?A=-.09817668643367765:t[10]>40.50000000000001?A=-.023558078753593125:A=.0065113494780482326:t[8]>809.5000000000001?t[297]>1e-35?A=-.1352063548573715:A=.058203900441270634:A=-.035243959159285736:t[10]>59.50000000000001?t[1]>43.50000000000001?A=-.012552876807800442:A=.05991247777734298:A=.0035893102109330177;let y;t[13]>1e-35?t[9]>21.500000000000004?t[145]>1e-35?y=.03507251990078782:t[2]>14.500000000000002?y=.004905698363309292:t[8]>2421.5000000000005?y=-.10306119951984316:y=-.018951037816654928:t[8]>416.50000000000006?t[3]>4.500000000000001?t[295]>1e-35?y=-.08503171085833393:y=.015130974593044409:y=-.024425267075198206:y=.02624054905103126:t[4]>19.500000000000004?t[131]>1e-35?y=.02100191580704534:t[32]>1e-35?t[8]>2302.5000000000005?y=.09908783187786288:y=-.06920877329925636:t[8]>241.50000000000003?y=-.016756131804203496:t[9]>33.50000000000001?y=.04903179955263626:t[217]>1e-35?y=-.047416847619291644:y=-.0017200891991431119:t[39]>1e-35?y=-.10389927604977028:t[134]>1e-35?y=-.050480365434872866:t[178]>1e-35?y=-.05167855791556937:t[8]>2134.5000000000005?y=-.01663197335585307:t[242]>1e-35?y=-.05361323756615453:t[118]>1e-35?y=-.05299780866211368:t[10]>24.500000000000004?t[10]>55.50000000000001?t[8]>764.5000000000001?y=-.0016544848369620534:y=.04494144460483587:y=-.009283616456736156:t[121]>1e-35?t[0]>4463.500000000001?y=.051166688553608355:y=-.06623908820705383:t[84]>1e-35?y=-.12990936092409747:t[306]>1e-35?y=-.07020596855118943:t[49]>1e-35?y=.06272964802556856:t[192]>1e-35?y=.06540204627162581:y=.008277910531592885;let E;t[13]>1e-35?t[308]>1e-35?t[210]>1e-35?E=.003325460510319164:E=.037153108286272905:t[2]>12.500000000000002?t[1]>124.50000000000001?E=-.09880713344892134:t[7]>60.50000000000001?t[10]>71.50000000000001?E=.0697359767152808:t[230]>1e-35?E=.06513506845651572:E=-.02826625276613455:t[5]>246.50000000000003?t[8]>95.50000000000001?E=.013616385013146277:E=.04171540100223404:E=-.04360396575094823:t[212]>1e-35?E=.025945477945627522:E=-.019793208261535442:t[4]>39.50000000000001?t[25]>1e-35?E=-.07856453318384411:E=-.014803893522351739:t[39]>1e-35?E=-.09185452630751932:t[149]>1e-35?E=-.07122426086157027:t[134]>1e-35?E=-.04231052091434186:t[227]>1e-35?E=-.029815824273994197:t[50]>1e-35?E=-.15736496271211153:t[222]>1e-35?E=-.02360285356956629:t[128]>1e-35?E=-.03922080193836443:t[136]>1e-35?E=-.07219685327698587:t[10]>24.500000000000004?t[1]>8.500000000000002?E=-.0029736170756835783:E=-.06482902102259112:t[84]>1e-35?E=-.11340924635708383:t[94]>1e-35?E=-.03635703457792193:t[118]>1e-35?E=-.058181913914186034:t[126]>1e-35?E=-.062030576241517366:t[116]>1e-35?E=-.045086301850604006:t[25]>1e-35?E=-.031665223656767286:t[203]>1e-35?E=-.009444685731407691:E=.0112265153772187;let _;t[13]>1e-35?t[1]>64.50000000000001?t[9]>14.500000000000002?t[9]>54.50000000000001?_=.022717227245241684:_=-.049700413274686266:_=.007175776918589741:t[5]>50.50000000000001?t[8]>61.50000000000001?t[21]>1e-35?_=-.07927556792063156:t[3]>8.500000000000002?t[4]>23.500000000000004?t[281]>1e-35?_=-.12263724050601095:_=.0070743478891288035:t[288]>1e-35?_=-.050439138582109:_=.0255701593657891:_=-.005812703740580558:t[6]>49.50000000000001?_=-.008542694147899113:_=.035147383686665:_=-.0960461939274094:t[32]>1e-35?_=-.04555453745517765:t[222]>1e-35?t[0]>612.5000000000001?_=-.01800870272656664:_=-.07817304234604389:t[30]>1e-35?_=-.05227061750368981:t[25]>1e-35?t[0]>4449.500000000001?t[217]>1e-35?_=.08778416018479411:_=-.026563982720830256:_=-.05296139548112329:t[50]>1e-35?_=-.14926464875852247:t[8]>779.5000000000001?t[133]>1e-35?_=-.036572140520852024:t[183]>1e-35?_=-.10766853736801459:_=-.003966794968701808:t[217]>1e-35?t[5]>5237.500000000001?_=.09513215942486053:_=-.03641865277445567:t[10]>59.50000000000001?_=.03177172388687933:t[39]>1e-35?_=-.10234241303898953:t[243]>1e-35?_=-.02966738115984321:t[190]>1e-35?_=-.04312785336449181:t[118]>1e-35?_=-.05808521194081524:_=.006720381600740378;let v;t[308]>1e-35?t[5]>423.00000000000006?t[133]>1e-35?v=-.046284053681928526:t[210]>1e-35?v=49778070699847876e-21:t[13]>1e-35?v=.03328070054739309:t[128]>1e-35?v=-.054790214922938896:t[126]>1e-35?v=-.08524792218532945:v=.014414055975542446:t[1]>38.50000000000001?v=-.07287851335872973:v=.005263371501687163:t[9]>7.500000000000001?t[21]>1e-35?t[10]>4.500000000000001?v=-.12459748864088374:v=-.004626323021331593:t[298]>1e-35?t[4]>64.50000000000001?v=.13044981041138526:t[9]>71.50000000000001?v=-.056068402282406865:t[9]>12.500000000000002?v=.038957722962512764:v=-.04598815982492169:t[8]>691.5000000000001?t[126]>1e-35?v=-.0852126122372075:t[225]>1e-35?v=.10082066771689505:t[1]>161.50000000000003?v=-.11609832500613824:t[3]>8.500000000000002?t[8]>1685.5000000000002?v=-.010835400874777133:v=.004607419973807752:v=-.016989075258564062:v=.009205417251698097:t[23]>1e-35?t[20]>1e-35?v=.10184317139657878:t[0]>5724.500000000001?v=-.1163666496650542:t[1]>106.50000000000001?v=.1303850608190687:t[129]>1e-35?v=.10745031509534769:v=.006166901738036226:t[31]>1e-35?v=.010177092833155127:t[13]>1e-35?t[0]>213.50000000000003?v=.005004582564506611:v=-.10481581731668346:t[19]>1e-35?v=-.009850706427306281:v=-.02608226348051303;let b;t[13]>1e-35?t[1]>64.50000000000001?t[2]>4.500000000000001?b=-.0024117174588695603:b=-.058339700513831916:t[212]>1e-35?t[0]>2215.5000000000005?t[8]>847.5000000000001?t[10]>21.500000000000004?t[1]>39.50000000000001?b=.04575380761203418:b=-.10025595041353463:t[15]>1e-35?b=.17705790384964004:b=.0073813837628615014:b=.07676373681392407:b=-.027167992693885996:t[3]>11.500000000000002?t[280]>1e-35?b=.07078572910026419:t[4]>23.500000000000004?b=.005513918674164821:b=.0206586476926392:t[0]>5269.500000000001?b=.07706773525822633:b=-.010233826953776122:t[148]>1e-35?t[8]>1622.5000000000002?b=-.03204783603215824:b=.027405418223981973:t[4]>14.500000000000002?t[131]>1e-35?t[9]>1.5000000000000002?t[0]>5026.500000000001?b=-.0930246911392012:b=.011173087289703683:t[3]>24.500000000000004?b=.03281421918878597:b=.12449335091369843:t[204]>1e-35?b=.06634531187326123:b=-.011522999669353388:t[92]>1e-35?t[10]>42.50000000000001?b=-.041196758517013515:t[4]>7.500000000000001?b=-2942718111029724e-20:t[4]>6.500000000000001?b=.11953909558532852:b=.03188615019450534:t[122]>1e-35?b=-.0616037324662157:t[101]>1e-35?b=.027230889593349412:t[8]>4968.500000000001?b=-.1113986516540856:t[3]>2.5000000000000004?b=-.002045140426885727:t[129]>1e-35?b=.12641163374304432:b=.014909826232873194;let T;t[308]>1e-35?t[0]>7277.500000000001?T=-.09337446795435:t[5]>423.00000000000006?t[133]>1e-35?T=-.040884836258675006:t[210]>1e-35?T=-.0003719413278428804:t[13]>1e-35?T=.030287610160818174:T=.011174130013595384:t[1]>38.50000000000001?T=-.0662442170185784:T=.004332185707008564:t[9]>7.500000000000001?t[145]>1e-35?t[285]>1e-35?T=-.08092286307197555:T=.029866363328584986:t[21]>1e-35?t[10]>4.500000000000001?T=-.1155211149523894:T=-.0032903546638958538:t[149]>1e-35?T=-.03632198993199768:t[3]>9.500000000000002?t[8]>999.5000000000001?T=-.003507023626534306:t[128]>1e-35?t[4]>13.500000000000002?t[0]>3459.5000000000005?T=-.025416927789760076:T=.02777568919793122:T=-.10310351509769732:T=.013549608903688785:t[186]>1e-35?T=.08513865847420551:T=-.009306721292510369:t[31]>1e-35?T=.009780833952582307:t[23]>1e-35?T=.011143773934157629:t[210]>1e-35?T=.025354797285173356:t[17]>1e-35?t[10]>3.5000000000000004?T=-.04846287537743046:T=-.014647271080376757:t[2]>5.500000000000001?t[7]>57.50000000000001?T=-.034224938681445764:t[8]>1641.5000000000002?T=-.027298372075800673:t[191]>1e-35?t[10]>18.500000000000004?T=-.027950103994861836:T=.14575930827829034:T=-.007124740389354946:t[10]>22.500000000000004?T=.013173304107866726:T=-.11119620042551365;let w;t[131]>1e-35?w=.01892225243240137:t[308]>1e-35?t[5]>691.5000000000001?t[133]>1e-35?w=-.037118314390013646:t[1]>51.50000000000001?t[5]>3749.5000000000005?t[8]>58.50000000000001?w=-.022305242912035072:w=.024792895826340516:w=.013666137278072166:t[88]>1e-35?t[10]>27.500000000000004?w=.2080083584805785:w=.04247197078083379:t[10]>40.50000000000001?t[18]>1e-35?t[1]>27.500000000000004?w=.060783227455868206:w=-.056904865557409035:w=-.03278952553107572:t[192]>1e-35?w=.13117402617043625:w=.01647119888257836:w=-.01825870445636398:t[9]>6.500000000000001?t[298]>1e-35?w=.026536210945939682:t[8]>691.5000000000001?t[126]>1e-35?w=-.07927319604548912:t[10]>3.5000000000000004?t[21]>1e-35?w=-.11083976837572328:t[146]>1e-35?w=-.03359294484446772:w=-.0042815953591236475:t[190]>1e-35?w=-.09264239592903775:t[10]>1e-35?w=.022282638485105657:w=-.0205994057928458:t[5]>4918.500000000001?w=.03430715695199153:t[243]>1e-35?t[2]>57.50000000000001?w=.08935072241972036:w=-.03781647876237494:w=.0062655753179671515:t[31]>1e-35?w=.008603500300349887:t[230]>1e-35?w=.03350056932774173:t[23]>1e-35?t[241]>1e-35?w=.10277555508503314:w=.0017901817172993888:t[2]>98.50000000000001?w=-.05920081229672715:w=-.015722173275739208;let R;t[13]>1e-35?t[118]>1e-35?R=.07957905150112207:t[1]>125.50000000000001?R=-.0662620579858685:t[145]>1e-35?R=.029682040828779843:t[19]>1e-35?t[6]>15.500000000000002?R=-.0009597832580977798:R=-.081474760755753:t[212]>1e-35?R=.03637001492325179:R=.006912305498963309:t[32]>1e-35?R=-.03919900630910754:t[134]>1e-35?R=-.036225295529777886:t[4]>4.500000000000001?t[5]>384.50000000000006?t[204]>1e-35?R=.06671440854602108:t[136]>1e-35?R=-.07577364230133474:t[148]>1e-35?t[4]>7.500000000000001?R=.026430947016830915:R=-.04075501264495112:t[9]>93.50000000000001?R=-.04353169430417609:t[50]>1e-35?R=-.1411224537622882:t[17]>1e-35?t[49]>1e-35?R=.068392679163672:t[10]>1.5000000000000002?R=-.0209659792007492:R=-.0004393235559249831:t[133]>1e-35?t[9]>64.50000000000001?R=.07254524592323175:R=-.0319087835282534:R=.00037444813327793425:R=-.025138768151370408:t[243]>1e-35?R=-.050010891710502096:t[94]>1e-35?R=-.0817513550778599:t[122]>1e-35?R=-.061038875809822285:t[19]>1e-35?t[8]>1085.5000000000002?R=-.008408408775061623:t[2]>5.500000000000001?t[218]>1e-35?R=.1454877641381946:R=.053787998331240316:t[9]>33.50000000000001?R=.08602629796680285:R=-.03895127455803038:R=.008830878042315722;let x;t[131]>1e-35?x=.01687979707990516:t[8]>2915.5000000000005?t[297]>1e-35?x=.07473600489975568:t[0]>93.50000000000001?x=-.021596848506011502:x=-.13840802327735696:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?x=.10264284346448256:x=.031042487183181262:x=-.016653982936827776:t[4]>60.50000000000001?t[10]>75.50000000000001?x=.04226403420647408:t[10]>1e-35?t[0]>4733.500000000001?x=.006271403149804702:x=-.030013637555715046:t[0]>4449.500000000001?x=-.06556876058654929:x=.06437994816903034:t[32]>1e-35?x=-.043814577251655815:t[308]>1e-35?t[0]>7277.500000000001?x=-.09349726304052086:t[210]>1e-35?x=-.0035960132209098003:t[5]>691.5000000000001?t[133]>1e-35?x=-.029188394315052574:x=.017219308333820193:x=-.017378928852189585:t[9]>6.500000000000001?t[0]>2653.5000000000005?t[149]>1e-35?x=-.04428555753857688:x=.0001456106867817353:t[5]>213.50000000000003?x=.01740292726636365:x=-.011361718115556464:t[7]>4.500000000000001?t[0]>316.50000000000006?t[19]>1e-35?t[10]>54.50000000000001?x=.03410288911259329:t[121]>1e-35?x=-.06056527462120627:t[8]>2592.5000000000005?x=.12166808844363577:t[191]>1e-35?x=.11669879218998758:x=-.001664858391716235:x=-.01262927450503166:x=-.04506589951879664:t[227]>1e-35?x=-.08548904959752329:x=.02156080776537726;let P;t[306]>1e-35?t[149]>1e-35?P=-.1389218965136736:P=-.032218642644416894:t[13]>1e-35?P=.006465035217331847:t[50]>1e-35?P=-.1381687930130022:t[179]>1e-35?P=-.13112784985951215:t[148]>1e-35?t[8]>1726.5000000000002?P=-.03262719498763048:P=.023342916702125613:t[191]>1e-35?P=.030005484947580197:t[4]>4.500000000000001?t[204]>1e-35?P=.047767773119269434:t[136]>1e-35?t[0]>1937.5000000000002?P=-.09989343595668776:P=.06533942033334243:t[15]>1e-35?t[9]>86.50000000000001?P=-.10577989354150097:t[8]>668.5000000000001?t[126]>1e-35?P=-.09165257825246746:t[9]>32.50000000000001?P=.02484870392366004:P=-.008499493096971395:t[8]>24.500000000000004?P=.02459679192828244:P=-.010527978013140512:t[25]>1e-35?t[217]>1e-35?P=.0015644546318714849:P=-.06579524865022705:P=-.0060233890975120614:t[122]>1e-35?t[1]>36.50000000000001?P=.03331853632960164:P=-.09482264761126993:t[19]>1e-35?t[8]>1430.5000000000002?P=-.019091477207111116:P=.037878468575478504:t[94]>1e-35?P=-.08013082284576584:t[4]>2.5000000000000004?t[186]>1e-35?P=.16919658785098224:t[243]>1e-35?P=-.06580584936754524:P=.01567555159935563:t[129]>1e-35?P=.06721746994993226:t[10]>32.50000000000001?P=-.046394462507797975:P=-.006436180519584767;let D;t[131]>1e-35?D=.015039096856208693:t[8]>779.5000000000001?t[145]>1e-35?D=.019122095523977856:t[298]>1e-35?D=.023828936462317443:t[1]>23.500000000000004?t[5]>384.50000000000006?t[7]>59.50000000000001?D=-.026094309429557913:t[204]>1e-35?D=.09163404305658318:t[1]>27.500000000000004?t[149]>1e-35?t[6]>34.50000000000001?D=.012643810980689466:D=-.07884161741497837:D=-.0025267379810891104:t[2]>43.50000000000001?t[0]>2860.5000000000005?D=.04493082949897325:D=.18046359750455776:t[7]>18.500000000000004?D=-.018667348656891496:D=.02584325784698236:D=-.045696524897545915:t[0]>3321.5000000000005?t[201]>1e-35?D=.04749240016989375:D=-.0333334578246718:t[5]>3276.5000000000005?D=.11330554740098908:t[7]>94.50000000000001?D=.1296600395033268:D=-.003576436308940934:t[15]>1e-35?t[183]>1e-35?D=-.13787130789142835:t[0]>1847.5000000000002?D=.017915229729920556:t[10]>23.500000000000004?t[10]>31.500000000000004?t[6]>7.500000000000001?D=.028856848462727104:D=-.11197632885851168:D=.08169801342016791:t[1]>22.500000000000004?D=-.021052888644970163:D=.019048604298876753:t[7]>4.500000000000001?D=-.002603328695276418:t[7]>1.5000000000000002?t[2]>5.500000000000001?D=.03432638833359197:D=-.0036767863082454973:t[1]>48.50000000000001?D=.03087375270128195:t[2]>3.5000000000000004?D=-.04219917149740248:D=.018818493993207935;let N;t[306]>1e-35?N=-.04076858123502297:t[13]>1e-35?t[1]>67.50000000000001?t[9]>14.500000000000002?t[9]>53.50000000000001?t[8]>1971.5000000000002?N=-.09091897542577475:N=.04042943082645558:t[218]>1e-35?N=.056254985867151:N=-.053848117950183044:N=.003881630017086845:t[5]>5152.500000000001?t[8]>857.5000000000001?t[6]>28.500000000000004?N=.021581808008986944:N=-.05639286496176611:N=.052838875036198954:t[5]>50.50000000000001?t[5]>4082.5000000000005?t[17]>1e-35?N=.023061479860228728:t[145]>1e-35?t[9]>10.500000000000002?N=.023885302967553288:N=.1617794086125622:t[212]>1e-35?N=.04504545345658806:t[3]>17.500000000000004?t[4]>45.50000000000001?N=-.03948072448245435:t[1]>47.50000000000001?t[9]>18.500000000000004?N=.01894935813286188:N=-.06449356357429188:N=.012297239104320094:t[1]>26.500000000000004?t[8]>33.50000000000001?N=-.034718828212885515:N=.0898976288814321:t[1]>17.500000000000004?N=-.15440137451988326:N=-.03864183216821465:N=.009988507307006308:N=-.08540311947043305:t[50]>1e-35?N=-.13323659732101975:t[134]>1e-35?N=-.031820386486894385:t[32]>1e-35?t[8]>2302.5000000000005?N=.08082476177379844:N=-.041665761903645876:t[179]>1e-35?N=-.12405023987936657:t[39]>1e-35?N=-.06247416524997478:t[138]>1e-35?N=-.10724031753676487:N=-.0005423122305122404;let B;t[308]>1e-35?B=.006160742906729798:t[190]>1e-35?t[0]>2461.5000000000005?t[10]>22.500000000000004?B=.023223358334607133:B=-.04383410185346742:B=-.08542395045055405:t[297]>1e-35?t[8]>51.50000000000001?t[1]>13.500000000000002?B=.023406489302867494:B=-.085521220804058:B=-.02921899554854833:t[298]>1e-35?t[9]>12.500000000000002?B=.028120059780969632:B=-.04211009474298743:t[294]>1e-35?B=-.05040415676618239:t[86]>1e-35?t[1]>36.50000000000001?B=-.0993035220737934:B=-.0005384930611060366:t[230]>1e-35?t[4]>6.500000000000001?B=.029770210551187937:B=-.016272917551655715:t[4]>60.50000000000001?t[280]>1e-35?B=.06421359317599738:B=-.01963732469244167:t[218]>1e-35?t[3]>3.5000000000000004?B=.024368404612215164:B=-.04045232374803373:t[131]>1e-35?B=.017372701982485795:t[120]>1e-35?B=.08812710275150198:t[18]>1e-35?t[90]>1e-35?B=.18451364351180236:t[7]>33.50000000000001?B=-.03850813130183531:t[195]>1e-35?B=.06966114053446336:t[3]>16.500000000000004?B=-.0012869181693341211:t[0]>4242.500000000001?B=-.054625548611291035:B=-.014431095117473881:t[5]>4558.500000000001?t[8]>1.5000000000000002?B=.006302103427145562:B=.13967622319898698:t[121]>1e-35?B=-.038798585213145644:t[5]>4544.500000000001?B=-.08050498033009466:B=-.002986974112681435;let L;t[0]>384.50000000000006?t[2]>101.50000000000001?t[1]>16.500000000000004?L=-.03461119351456781:L=.05659026566680352:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?L=-.12404435523286539:L=-.0034376913880382956:L=-.09821622245095822:t[131]>1e-35?t[9]>1.5000000000000002?L=.0037507103585310234:L=.03610387965829944:t[8]>999.5000000000001?t[9]>137.50000000000003?L=-.11985021663179699:t[0]>1847.5000000000002?t[126]>1e-35?L=-.04832024079663151:t[37]>1e-35?L=-.037103393468366934:L=-.004248086592531705:t[8]>3084.0000000000005?t[9]>43.50000000000001?L=.032539071163832034:t[5]>1643.5000000000002?L=.036408625378035665:t[0]>1500.5000000000002?L=-.1346358322854993:L=-.027586559522081014:t[3]>1e-35?t[190]>1e-35?L=-.1133991164577881:t[9]>52.50000000000001?L=-.024478640359723122:L=.03673777861098756:L=-.1037451237591819:t[230]>1e-35?t[9]>48.50000000000001?t[10]>20.500000000000004?L=.002583438691776944:L=.10773520810108106:t[9]>12.500000000000002?t[1]>16.500000000000004?L=-.02141222346712401:L=.06392462314316179:t[4]>12.500000000000002?L=.08700122294434816:t[8]>267.50000000000006?L=.056923170082743224:L=-.07716309825583327:t[32]>1e-35?L=-.03961343943752142:L=.002674914122888783:t[1]>42.50000000000001?L=-.05217539654421676:t[145]>1e-35?L=.09553630282946368:L=-.009424791262477729;let j;t[183]>1e-35?j=-.05753337139158443:t[308]>1e-35?j=.00562436671450989:t[9]>7.500000000000001?t[21]>1e-35?t[10]>8.500000000000002?j=-.10477869875380448:j=-.0070301869937306055:t[3]>9.500000000000002?t[8]>1765.5000000000002?t[0]>4571.500000000001?j=-.12526505173232894:t[10]>1e-35?t[9]>71.50000000000001?j=-.04442302951713574:j=.00012409888451734224:j=-.092199119633697:t[225]>1e-35?j=.13773072450201831:t[0]>2882.5000000000005?j=.0028540012229920533:t[298]>1e-35?j=.07134486044361629:j=.014297412329837425:t[145]>1e-35?j=.05608385321902638:t[92]>1e-35?j=.038298413603926135:t[107]>1e-35?t[2]>6.500000000000001?j=-.0039957800609801315:j=.0776927564241081:t[203]>1e-35?j=-.05502900859432093:t[105]>1e-35?j=.06062892720841595:j=-.009574839629252128:t[31]>1e-35?j=.009488858841144216:t[23]>1e-35?t[20]>1e-35?j=.08818126313644752:t[8]>161.50000000000003?j=.014353968957885408:j=-.022240738532827903:t[210]>1e-35?j=.024648862719806694:t[2]>5.500000000000001?t[4]>4.500000000000001?t[17]>1e-35?t[10]>16.500000000000004?j=-.043902062079383485:j=-.014741559220396223:j=-.00934935734853194:t[6]>32.50000000000001?j=.1514593126307404:j=.010771222510801532:t[10]>22.500000000000004?j=.01412495209334078:j=-.08576940379502533;let M;t[0]>384.50000000000006?t[84]>1e-35?M=-.06647690967306838:t[2]>101.50000000000001?M=-.024451334501552457:t[306]>1e-35?M=-.034517188927733505:t[131]>1e-35?t[9]>1.5000000000000002?M=.0031858381443673127:M=.032574927024450646:t[204]>1e-35?t[1]>62.50000000000001?M=-.08601340441214533:t[1]>29.500000000000004?M=.10487598629539963:t[8]>597.5000000000001?M=-.0786529133673238:M=.08689436600511559:t[8]>779.5000000000001?t[10]>2.5000000000000004?t[9]>100.50000000000001?M=-.04883600353740688:t[126]>1e-35?M=-.03794042763348827:M=-.003358871967539988:t[210]>1e-35?M=.054991356498447566:t[6]>19.500000000000004?M=-.007418396981635549:M=.018032606049498613:t[18]>1e-35?t[7]>35.50000000000001?t[2]>44.50000000000001?M=-.02143003429501711:M=-.09016000554055564:t[1]>19.500000000000004?t[1]>42.50000000000001?t[8]>17.500000000000004?M=-.006636355416244082:M=-.06483095743431454:t[4]>21.500000000000004?M=-.028975965946833545:M=.022012264796522657:M=-.06653648243193663:t[5]>4593.500000000001?M=.01753551428088607:t[217]>1e-35?M=-.028864824937700297:t[94]>1e-35?M=-.04885192273020658:t[279]>1e-35?M=.08105715462329498:t[121]>1e-35?M=-.04576676034750651:M=.004795141324949362:t[1]>42.50000000000001?M=-.047446619702809195:t[145]>1e-35?M=.08400495571952321:M=-.00854528836489364;let O;t[294]>1e-35?O=-.042529778074638265:t[266]>1e-35?O=-.1180276669679798:t[134]>1e-35?O=-.026818144353279623:t[183]>1e-35?O=-.05120747503479363:t[227]>1e-35?t[8]>1641.5000000000002?O=-.07265906898294434:t[4]>12.500000000000002?t[17]>1e-35?O=-.027516137530797014:t[0]>4331.500000000001?t[1]>64.50000000000001?O=-.03049646619610203:t[1]>50.50000000000001?O=.20634590755061122:O=.06956378103625731:t[0]>3770.5000000000005?O=-.07946414366134913:t[19]>1e-35?O=.17083312065604694:t[2]>21.500000000000004?O=-.02327981978127724:O=.129717297518715:t[145]>1e-35?O=.006891245076133524:O=-.0789123467863741:t[3]>99.50000000000001?O=-.02022281202803071:t[302]>1e-35?t[10]>47.50000000000001?O=.06447639919732716:O=-.05457561977645972:t[306]>1e-35?O=-.029995903305383882:t[191]>1e-35?O=.030596508110850414:t[242]>1e-35?O=-.024085578702020216:t[8]>3198.5000000000005?t[297]>1e-35?O=.09518584795377832:O=-.018197744600833596:t[13]>1e-35?O=.006751790086127549:t[148]>1e-35?O=.01904174573618417:t[99]>1e-35?O=.025287735102561926:t[4]>14.500000000000002?O=-.004364337681643273:t[1]>15.500000000000002?t[35]>1e-35?O=-.09467943982430241:t[243]>1e-35?O=-.02521824751996268:O=.005437570718352172:O=-.022476214821960674;let q;t[0]>384.50000000000006?t[84]>1e-35?q=-.06088131453064195:t[147]>1e-35?q=-.05332792965930566:t[135]>1e-35?t[9]>32.50000000000001?q=.04219361472548491:q=-.07227529211725771:t[10]>4.500000000000001?t[21]>1e-35?q=-.0787279848043689:t[17]>1e-35?t[3]>18.500000000000004?t[188]>1e-35?q=-.054347604504400286:t[0]>3544.5000000000005?t[0]>5850.500000000001?q=-.11431764534511478:q=.013549717238356157:q=-.020987333767091276:t[6]>2.5000000000000004?q=-.02914877855133127:q=.08483464900160231:t[8]>58.50000000000001?t[183]>1e-35?q=-.10087072787978416:t[37]>1e-35?q=-.030467397753331196:t[229]>1e-35?q=-.1017559811057469:t[4]>20.500000000000004?q=-.00413177742240167:t[20]>1e-35?q=.05213315982685969:q=.0037921635866823133:t[8]>51.50000000000001?q=.07327913092421544:t[6]>49.50000000000001?q=-.03457694284156811:t[6]>18.500000000000004?t[7]>17.500000000000004?q=.02744420891894289:q=.11288946357194463:q=.003482908820966248:t[18]>1e-35?t[1]>20.500000000000004?t[7]>4.500000000000001?q=-.012329314369909049:q=.026816658655600168:q=-.0872405354618811:q=.007872673500247845:t[1]>42.50000000000001?q=-.04309044198258254:t[145]>1e-35?q=.07572529147860785:t[7]>5.500000000000001?q=-.013837187093264945:t[1]>17.500000000000004?q=.04208698439539668:q=-.06284346769019863;let Q;t[294]>1e-35?Q=-.0384794324818203:t[266]>1e-35?Q=-.1087205883821061:t[32]>1e-35?t[8]>2302.5000000000005?Q=.07432960094940501:Q=-.035248735855751855:t[134]>1e-35?Q=-.02456191365284949:t[121]>1e-35?t[0]>4720.500000000001?t[1]>39.50000000000001?Q=-.01706896375068821:Q=.08212247914968074:t[2]>59.50000000000001?Q=-.09546478958824225:t[6]>53.50000000000001?Q=.12317082897575611:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?Q=.02816463285971267:Q=.15449139016588445:Q=-.10199787406123524:Q=-.038068684323297096:t[223]>1e-35?t[8]>668.5000000000001?Q=-.13924786681478077:Q=-.0072772442570213335:t[39]>1e-35?Q=-.05392786531177836:t[0]>93.50000000000001?t[40]>1e-35?Q=-.054059371343144036:t[306]>1e-35?t[2]>14.500000000000002?t[149]>1e-35?Q=-.11174465335620831:Q=.00013144040097180107:Q=-.08493919336681105:t[42]>1e-35?Q=-.11078582572836196:t[84]>1e-35?t[4]>17.500000000000004?Q=-.015540659878839153:Q=-.14442609417300142:t[21]>1e-35?Q=-.025251979447574083:Q=.0023698372645272847:t[18]>1e-35?Q=.07269739695712212:t[8]>2592.5000000000005?Q=-.1460388776448558:t[9]>30.500000000000004?t[1]>23.500000000000004?Q=-.01835130329646532:t[9]>45.50000000000001?Q=.02023047454629885:Q=.16469378262221102:Q=-.042975030085836426;let U;t[8]>2915.5000000000005?t[297]>1e-35?U=.06257393915394144:t[0]>93.50000000000001?t[4]>1.5000000000000002?U=-.01034964686484714:U=-.07357437440667927:U=-.11987794734779106:t[298]>1e-35?t[8]>81.50000000000001?t[0]>3370.5000000000005?t[8]>155.50000000000003?t[8]>660.5000000000001?t[8]>2134.5000000000005?U=-.09476398869062203:t[9]>72.50000000000001?U=-.0757383854264379:U=.02806542779508718:U=-.05147742568418084:U=.10212721564444344:U=.0518263760642861:U=-.08743405377022222:t[189]>1e-35?t[0]>5269.500000000001?U=-.10669213185972036:U=.027050434286384796:t[302]>1e-35?U=-.0407832394672723:t[116]>1e-35?t[10]>38.50000000000001?U=.06354599160071946:t[1]>67.50000000000001?U=.05317447949011187:U=-.059138165935307165:t[212]>1e-35?t[19]>1e-35?U=-.09369289448773599:t[0]>2215.5000000000005?U=.04077965380363924:t[0]>807.5000000000001?U=-.0591771776458298:U=.057315736906679376:t[308]>1e-35?t[1]>52.50000000000001?t[5]>3749.5000000000005?U=-.016323380219241672:U=.007291062979527741:t[210]>1e-35?t[8]>1641.5000000000002?U=.03720704290087811:U=-.008730548158766654:t[4]>80.50000000000001?U=-.05346644687473197:U=.014596824736762107:t[218]>1e-35?t[3]>3.5000000000000004?U=.019984510398089086:U=-.03917825025861855:t[9]>170.50000000000003?U=-.09759719821334525:U=-.0023586682752856298;let z;t[183]>1e-35?t[17]>1e-35?z=.030100940443356424:t[10]>1.5000000000000002?z=-.10861112216742408:z=.017680668976453255:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?z=-.032062878390325456:z=-.10808232631806887:t[8]>1641.5000000000002?z=-.06147013392655731:t[4]>12.500000000000002?z=.03324767551088266:t[145]>1e-35?z=.028851633810612017:z=-.054871239091792784:t[134]>1e-35?z=-.023813968121342108:t[266]>1e-35?z=-.10037039667146351:t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>1939.5000000000002?z=-.055566877553100726:t[2]>24.500000000000004?t[8]>182.50000000000003?t[10]>43.50000000000001?t[10]>55.50000000000001?z=-.025350325484720576:z=.1579024598549572:t[9]>2.5000000000000004?t[0]>3746.5000000000005?z=.056817276537534815:z=-.07674158463557636:z=-.06335553143454145:t[1]>56.50000000000001?z=.16390494217299284:z=-.0027330160430847177:t[10]>36.50000000000001?t[8]>1067.5000000000002?z=.041717597065890205:z=-.10357913492269129:t[10]>29.500000000000004?z=.1365512866715726:z=.020600048310575665:z=.09708785634773187:z=-.060427658852305666:t[126]>1e-35?t[10]>32.50000000000001?t[6]>24.500000000000004?t[8]>1146.5000000000002?z=-.03146213719547347:z=.11784024316238083:z=-.050940520532045355:z=-.047988344143075616:t[191]>1e-35?z=.028764654731460032:z=.0011911575567860023;let W;t[294]>1e-35?t[10]>50.50000000000001?W=-.11630092297244568:t[0]>2432.5000000000005?t[0]>4199.500000000001?W=-.05103908560370243:W=.05002066201169583:W=-.09976646725732496:t[32]>1e-35?t[0]>4242.500000000001?W=-.0648838712201258:t[5]>3721.5000000000005?t[9]>4.500000000000001?W=.127983140816313:W=-.05436534163636867:W=-.024514536544596455:t[121]>1e-35?t[0]>4449.500000000001?t[4]>9.500000000000002?W=-.009504203657088933:t[8]>819.5000000000001?W=.18689664822602375:W=.03635576744011826:W=-.029862411809998525:t[223]>1e-35?W=-.06474496692999487:t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?W=-.09405026597863717:t[0]>4153.500000000001?W=.053577663326799765:W=-.05062127873995668:W=.06512222894425874:t[39]>1e-35?W=-.04985311717827547:t[51]>1e-35?W=-.04541229517934797:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?W=-.02860634573675884:W=.08863753005590103:W=.11158892111063744:t[0]>655.5000000000001?W=-.031005736641654926:W=-.1439827004505974:t[222]>1e-35?t[1]>11.500000000000002?t[0]>612.5000000000001?W=-.00843386136334982:W=-.05273594615999777:W=.1060183822015004:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?W=-.015774115523598486:W=.10147367091236065:W=-.048307000563071016:W=.002118376117677254;let $;t[8]>1014.5000000000001?t[9]>137.50000000000003?$=-.10279096288817871:t[0]>93.50000000000001?t[8]>1067.5000000000002?t[227]>1e-35?$=-.03544332389470493:t[285]>1e-35?t[9]>64.50000000000001?$=.07211107542565391:$=-.041556776020476104:t[145]>1e-35?t[1]>66.50000000000001?$=-.0751486415451188:t[1]>59.50000000000001?$=.13459005084554104:$=.024184371850147466:t[0]>3072.5000000000005?t[95]>1e-35?$=.06715575425741895:$=-.005895690393702183:t[8]>2915.5000000000005?$=-.010205039411753762:t[9]>33.50000000000001?t[9]>47.50000000000001?$=-.00029068886245881074:$=.0613467393188786:t[148]>1e-35?$=-.06074463294936236:t[3]>1.5000000000000002?t[5]>1849.5000000000002?t[1]>15.500000000000002?$=.003887223773199377:$=-.08553893131979015:$=.025654192706396767:$=-.05651733979610658:$=-.02039913645229667:t[2]>7.500000000000001?$=-.1058450646728524:$=.02267192191610376:t[1]>120.50000000000001?t[2]>60.50000000000001?$=-.12304707569000428:t[1]>132.50000000000003?t[6]>41.50000000000001?$=.1283258201586378:$=-.01718135372229775:$=-.07702452408491414:t[125]>1e-35?$=-.0804612900572707:t[178]>1e-35?t[0]>4533.500000000001?$=.04273051857848212:$=-.04533122948101463:t[2]>196.50000000000003?$=-.10543331044088727:t[94]>1e-35?t[5]>4532.500000000001?$=.0231032972703664:$=-.04807386814498683:$=.002729435991332102;let J;t[179]>1e-35?J=-.08065315471211375:t[183]>1e-35?t[17]>1e-35?J=.026484626664041125:t[10]>1.5000000000000002?J=-.10187000872941615:J=.015274190652133752:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?J=.09574540795390041:J=-.06454986703691233:J=-.11411849349353141:t[266]>1e-35?J=-.09281838517322076:t[32]>1e-35?t[8]>2302.5000000000005?J=.06685250330182936:t[4]>67.50000000000001?t[2]>97.50000000000001?J=-.04403391373512386:J=.1132928075412222:t[2]>47.50000000000001?J=-.09700191391838056:J=-.02147184357182825:t[10]>4.500000000000001?t[21]>1e-35?J=-.0735617817957859:t[17]>1e-35?t[3]>18.500000000000004?J=-.001668912999010927:J=-.02363511102970245:t[8]>58.50000000000001?J=-.00035213368294640616:t[3]>17.500000000000004?t[2]>28.500000000000004?t[10]>23.500000000000004?t[1]>38.50000000000001?J=.0911011436534449:t[1]>28.500000000000004?J=-.07192390493729035:J=.06913818091291246:J=-.012312625373699222:J=.06784496312307986:J=-167756936027735e-19:t[18]>1e-35?t[8]>302.50000000000006?J=.0026564453057705273:J=-.025425772389361445:t[122]>1e-35?J=-.12046786388602149:t[0]>3183.5000000000005?J=.01162092842804907:t[91]>1e-35?J=.07000265526928563:t[1]>22.500000000000004?t[0]>576.5000000000001?J=-.0001647792543020228:J=-.023664538532907665:J=.01609078206180752;let ne;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4141.500000000001?ne=-.051473645433684705:t[0]>3030.5000000000005?t[1]>51.50000000000001?ne=-.017696526862422682:ne=.1450050954613223:ne=-.05406930069823832:ne=-.08308700260259043:t[120]>1e-35?ne=.058316269489189415:t[297]>1e-35?t[94]>1e-35?ne=-.07425512495167255:t[8]>51.50000000000001?t[1]>13.500000000000002?t[1]>33.50000000000001?t[19]>1e-35?t[0]>4498.500000000001?ne=.038431826961746934:ne=-.05937462906539856:t[9]>65.50000000000001?ne=.10814845712507865:t[4]>9.500000000000002?t[2]>22.500000000000004?t[1]>39.50000000000001?t[1]>44.50000000000001?t[10]>44.50000000000001?ne=.12297945639231944:t[0]>3796.5000000000005?t[4]>26.500000000000004?ne=-.09579030954062734:ne=.025064711572811746:ne=.02579440518821548:ne=.1044440128091862:ne=-.058348633139536844:ne=.07766788227934436:ne=-.01021229539092708:t[2]>2.5000000000000004?t[10]>29.500000000000004?t[0]>3770.5000000000005?t[0]>4438.500000000001?ne=.07463684068207214:ne=.18244269035484484:t[6]>39.50000000000001?ne=-.06050050067471004:ne=.05787759066913493:ne=.010783225857972171:ne=.1674891243602606:t[4]>9.500000000000002?ne=-.004814132027475892:ne=-.14543299413454813:ne=-.02935093398687923:t[116]>1e-35?t[9]>2.5000000000000004?t[8]>1218.5000000000002?ne=-.07634466313617769:ne=.0287825335169114:ne=-.06894721943300268:ne=-.00023988459059521937;let H;t[131]>1e-35?t[1]>93.50000000000001?H=-.05706887458825395:t[2]>1.5000000000000002?H=.011446637886629108:H=-.10616119878749211:t[230]>1e-35?t[4]>6.500000000000001?t[0]>4977.500000000001?H=.08424281276381033:t[3]>17.500000000000004?t[20]>1e-35?H=.11146885439601915:t[8]>61.50000000000001?t[0]>3530.5000000000005?t[9]>48.50000000000001?t[9]>61.50000000000001?H=.026278724448495064:H=.17053138400480508:t[0]>4463.500000000001?H=-.06482289890096041:H=.03026516489536295:H=-.031785170717683144:H=.1312690622980455:t[13]>1e-35?H=.14336922540461444:H=.03523850945454039:H=-.015407465968975714:t[39]>1e-35?H=-.054809635385158186:t[32]>1e-35?t[0]>4242.500000000001?H=-.0659975068798723:H=-.008386582621403979:t[4]>60.50000000000001?t[10]>75.50000000000001?t[3]>107.50000000000001?H=-.04225314193574262:t[3]>70.50000000000001?t[1]>29.500000000000004?H=.057409156184759516:H=.2024322059866388:H=-.030670938454461245:t[10]>1e-35?t[0]>4733.500000000001?H=.010648654146284154:t[308]>1e-35?H=.008728141696325391:t[4]>64.50000000000001?t[298]>1e-35?H=.12364025998551711:H=-.02247495081065243:t[1]>22.500000000000004?H=-.0726295464624251:H=.03481895086048152:t[0]>4331.500000000001?H=-.04775443357020673:H=.07172377425057568:t[2]>89.50000000000001?H=-.11782645274716962:H=.00010092665257989378;let re;t[147]>1e-35?re=-.041560228567115574:t[302]>1e-35?t[10]>47.50000000000001?re=.062292114082780084:t[10]>5.500000000000001?t[7]>22.500000000000004?re=-.016101990375700172:t[0]>2579.5000000000005?re=-.13045089661551845:re=-.02874367814784938:re=.025835149631944995:t[167]>1e-35?t[0]>3928.5000000000005?re=.17084176915326055:re=-.019195947948312853:t[222]>1e-35?t[30]>1e-35?t[1]>36.50000000000001?t[8]>45.50000000000001?t[8]>578.5000000000001?t[1]>67.50000000000001?re=.10591712319944074:re=-.024082167264285:re=.16497698867036126:re=-.04985066326861431:t[0]>1937.5000000000002?t[2]>16.500000000000004?re=-.021012910475524206:re=-.13058422554298485:t[0]>1102.5000000000002?re=.10955864175201457:re=-.03566689354348996:t[1]>11.500000000000002?re=-.02093884208606101:re=.09107244766183857:t[126]>1e-35?t[10]>32.50000000000001?t[8]>719.5000000000001?re=-.013861861436128482:re=.09756849802202777:t[224]>1e-35?t[1]>51.50000000000001?re=.10163873449625677:re=-.02779270277623805:t[1]>26.500000000000004?re=-.08035058228527389:re=.0005719695099064484:t[191]>1e-35?t[9]>9.500000000000002?re=-.007028075523033826:re=.0489470913925288:t[1]>61.50000000000001?t[132]>1e-35?re=.11230846723576784:t[0]>350.50000000000006?t[2]>1.5000000000000002?re=-.0032075580718124892:re=-.04442829143298883:re=-.06597073245775804:re=.0015594090939337751;let ae;t[223]>1e-35?t[8]>668.5000000000001?ae=-.12803889879260094:ae=.002171373740016862:t[121]>1e-35?t[0]>4720.500000000001?t[217]>1e-35?ae=.08967966612917375:t[1]>39.50000000000001?ae=-.059791671514498074:ae=.05648934961902822:t[2]>59.50000000000001?ae=-.08633234097449628:t[6]>53.50000000000001?ae=.11140345067444689:t[1]>56.50000000000001?t[4]>7.500000000000001?t[0]>3560.5000000000005?ae=.025606129643140924:ae=.13835395886271978:ae=-.09361630641448024:t[4]>7.500000000000001?t[1]>26.500000000000004?t[1]>49.50000000000001?ae=-.09975506556937946:t[10]>36.50000000000001?ae=-.09427724661655643:t[10]>24.500000000000004?ae=.07329330653410447:ae=-.02271182965807972:ae=-.09767874967639482:t[6]>13.500000000000002?t[10]>23.500000000000004?ae=-.05082091374050816:ae=.1687114435254966:t[0]>2314.5000000000005?ae=-.06422664016383926:ae=.0636688376664789:t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?ae=-.06857762517406195:t[9]>71.50000000000001?t[0]>4188.500000000001?ae=-.1274167728754332:ae=.01308079126447365:t[4]>73.50000000000001?ae=.13854015371106546:t[4]>48.50000000000001?ae=-.03684255740123261:t[6]>45.50000000000001?ae=.10329912215813097:t[10]>77.50000000000001?ae=-.08630788656925215:ae=.031022006843800853:t[1]>25.500000000000004?ae=-.08278381528048026:ae=.06664374548141594:t[84]>1e-35?ae=-.05624227409079396:ae=.00012184182357340415;let Oe;t[179]>1e-35?Oe=-.07443348719246982:t[40]>1e-35?t[0]>1937.5000000000002?Oe=-.07595415373151816:Oe=.054065040429292326:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[0]>1187.5000000000002?Oe=.022822510448266862:Oe=.17491569312933697:Oe=-.058362287133533565:t[2]>2.5000000000000004?Oe=-.03633895806364428:Oe=.06397808186120692:t[8]>4968.500000000001?t[1]>31.500000000000004?Oe=-.07294848747514579:Oe=.025053613105805606:t[230]>1e-35?t[4]>6.500000000000001?t[107]>1e-35?Oe=-.07009535282685533:t[8]>2640.0000000000005?Oe=-.051761240111316276:t[131]>1e-35?Oe=-.06245774419231631:Oe=.03495606662854905:Oe=-.013863522184803188:t[131]>1e-35?t[1]>93.50000000000001?t[1]>105.50000000000001?Oe=.0015036626973581122:Oe=-.12505706794835883:t[1]>48.50000000000001?t[276]>1e-35?Oe=.10435171369790015:t[0]>5026.500000000001?t[0]>5308.500000000001?Oe=.022343994371919224:Oe=-.14087991797693533:t[8]>1323.5000000000002?t[10]>49.50000000000001?Oe=.07724450228328664:t[0]>3853.5000000000005?Oe=-.15671707454435677:t[10]>28.500000000000004?Oe=-.10179090671841723:Oe=.014878216919760927:Oe=.03967665658164865:t[8]>2696.5000000000005?t[15]>1e-35?Oe=.14054154485273487:Oe=.01821247272493051:t[2]>5.500000000000001?t[2]>100.50000000000001?Oe=-.08632985141410315:Oe=.005524157938954954:Oe=-.08802502622523681:Oe=-.0004649168897260341;let ve;t[86]>1e-35?t[8]>65.50000000000001?t[1]>32.50000000000001?t[4]>16.500000000000004?ve=-.007458687464321174:ve=-.09444966249102484:t[1]>23.500000000000004?ve=.08564129697360716:ve=-.07105002902845851:ve=.05688756955238231:t[294]>1e-35?t[10]>50.50000000000001?ve=-.10326216566705966:t[1]>26.500000000000004?ve=.0050539832484585365:ve=-.07080395606126953:t[306]>1e-35?t[149]>1e-35?ve=-.10399433201474328:t[2]>14.500000000000002?t[9]>6.500000000000001?ve=.05783632021087773:t[10]>17.500000000000004?ve=-.06720598671764105:t[1]>47.50000000000001?ve=.097495825172558:ve=-.013372242800584872:ve=-.06463226787713715:t[42]>1e-35?ve=-.0885725817597767:t[204]>1e-35?t[1]>62.50000000000001?ve=-.07496598696848249:t[1]>29.500000000000004?t[8]>446.50000000000006?ve=.11051270080118503:ve=.027719462817590454:t[8]>597.5000000000001?ve=-.08441503592016869:ve=.05534229430302502:t[223]>1e-35?t[8]>668.5000000000001?ve=-.12190088985091102:ve=-.0067442838156576345:t[148]>1e-35?t[9]>79.50000000000001?ve=.09225972475904022:t[2]>10.500000000000002?t[1]>102.50000000000001?ve=.11805676536334647:t[8]>1726.5000000000002?t[9]>10.500000000000002?ve=.016585157185448045:ve=-.11032043771149425:ve=.01586986028570486:t[8]>388.50000000000006?ve=-.10592413013261853:ve=.04930703248769364:t[13]>1e-35?ve=.003621937787920821:ve=-.0013786331198611841;let Fe;t[145]>1e-35?t[1]>32.50000000000001?t[1]>38.50000000000001?t[10]>55.50000000000001?t[1]>54.50000000000001?Fe=.009769895322846493:Fe=-.10620052926943656:t[9]>19.500000000000004?Fe=.03781202525403449:t[9]>14.500000000000002?Fe=-.11485785321365344:t[9]>6.500000000000001?Fe=.07677177833073881:t[0]>4342.500000000001?Fe=-.07079285609687631:t[49]>1e-35?Fe=.06156814809246001:Fe=-.014788509042554625:Fe=-.032659201618470655:t[5]>5207.500000000001?Fe=-.09013500825185713:t[3]>10.500000000000002?t[8]>1787.5000000000002?Fe=-.03094160322187924:t[1]>29.500000000000004?Fe=.09474646043921069:Fe=.023445783928231618:Fe=.09342846694174194:t[0]>533.5000000000001?t[204]>1e-35?t[1]>62.50000000000001?Fe=-.07164443768784848:t[1]>29.500000000000004?Fe=.089473622509272:t[8]>597.5000000000001?Fe=-.08155349903101317:Fe=.07098423265024251:t[8]>691.5000000000001?t[5]>2252.5000000000005?Fe=-.004003900679358653:t[190]>1e-35?Fe=-.09236113461485262:t[8]>3198.5000000000005?Fe=-.0124130160451179:Fe=.018453070064009328:t[15]>1e-35?Fe=.012013209112857824:t[7]>4.500000000000001?t[7]>5.500000000000001?Fe=-.0009580759587680961:Fe=-.03227283036698222:Fe=.01369287669536875:t[1]>50.50000000000001?Fe=-.04213060332500437:t[35]>1e-35?Fe=-.11508095777767471:t[190]>1e-35?Fe=-.08611884672400155:t[297]>1e-35?Fe=.05723551879433584:Fe=-.004829340082311461;let Pe;t[183]>1e-35?Pe=-.037994150023203555:t[227]>1e-35?t[17]>1e-35?t[3]>20.500000000000004?t[10]>36.50000000000001?Pe=-.11753465135886734:Pe=-.007515490299047085:Pe=-.08576941990777916:t[8]>1641.5000000000002?t[10]>37.50000000000001?Pe=-.12371142493530439:t[1]>36.50000000000001?Pe=.032189417575190435:Pe=-.10339125953022954:t[3]>32.50000000000001?t[4]>27.500000000000004?t[1]>59.50000000000001?Pe=-.0784518658439288:t[2]>54.50000000000001?Pe=.12477882322370665:Pe=.000313468482399738:Pe=.12261955132611434:t[8]>81.50000000000001?t[23]>1e-35?Pe=.04969252946760318:t[8]>511.50000000000006?t[8]>1146.5000000000002?Pe=.0353146070135579:Pe=-.06327619611098285:Pe=.02813577701641991:Pe=-.12354390728506215:t[34]>1e-35?Pe=-.07664408516055397:t[3]>99.50000000000001?t[1]>16.500000000000004?t[1]>26.500000000000004?Pe=-.01245803535276381:Pe=-.07169472553475001:t[1]>11.500000000000002?Pe=.12989984824561698:Pe=-.01201544398886606:t[6]>91.50000000000001?t[1]>22.500000000000004?Pe=.010390226893521422:t[10]>14.500000000000002?Pe=.16790888126487719:Pe=.010614982228955577:t[4]>79.50000000000001?t[9]>44.50000000000001?t[0]>3853.5000000000005?Pe=-.043398307129729134:Pe=.09963544907820426:t[9]>30.500000000000004?Pe=-.13540713124984502:t[9]>17.500000000000004?Pe=.0509435850590757:Pe=-.04761897852404613:t[4]>78.50000000000001?Pe=.09197086656470652:Pe=.0006771050176682337;let Z;t[122]>1e-35?t[6]>36.50000000000001?Z=.05686884451670743:Z=-.05334759543084309:t[266]>1e-35?Z=-.08603579519816038:t[157]>1e-35?Z=-.06736746113382097:t[302]>1e-35?t[0]>2579.5000000000005?Z=-.0499592651503952:t[0]>725.5000000000001?Z=.11780353905132664:Z=-.05232097173108943:t[147]>1e-35?t[1]>53.50000000000001?Z=-.11398297342629615:t[0]>2604.5000000000005?t[0]>3629.5000000000005?Z=-.03190157229022304:Z=.07985197845805492:Z=-.0763078988943886:t[4]>41.50000000000001?t[280]>1e-35?Z=.05162933940904835:t[11]>1e-35?t[0]>460.50000000000006?Z=-.027174047777029083:Z=.057117284879796476:t[3]>43.50000000000001?Z=-.0016147040913107311:Z=-.05856597304613519:t[2]>45.50000000000001?t[0]>4663.500000000001?t[18]>1e-35?Z=-.04779247091640426:t[10]>25.500000000000004?t[9]>22.500000000000004?t[22]>1e-35?Z=-.01466076988151239:Z=.13375695925484857:Z=-.04885873081899647:t[0]>5566.500000000001?Z=.11086813028591343:t[8]>992.5000000000001?Z=-.07622304217072383:Z=.04316019272026325:t[10]>12.500000000000002?t[9]>36.50000000000001?t[9]>45.50000000000001?Z=.03285858361708423:Z=-.12354858211764992:Z=.0672788301823281:t[15]>1e-35?Z=.08658836986585006:Z=-.02741484278509758:t[290]>1e-35?Z=-.08161310335133287:t[135]>1e-35?Z=-.04824156054814152:Z=.0009156904299554183;let ee;t[3]>7.500000000000001?ee=.0006791852818377787:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?ee=.03642374718166293:ee=.16379973756366603:ee=-.03946685266127979:t[186]>1e-35?ee=.07618896623420895:t[96]>1e-35?ee=.0680272261319657:t[107]>1e-35?t[1]>48.50000000000001?ee=-.022822371600847505:ee=.0501405836324949:t[203]>1e-35?t[1]>77.50000000000001?ee=.044416424920571296:ee=-.0648450593196238:t[5]>3921.5000000000005?t[1]>110.50000000000001?ee=-.11110466767595227:t[9]>5.500000000000001?t[9]>52.50000000000001?t[1]>50.50000000000001?ee=.1061937286809567:t[7]>54.50000000000001?ee=.11487507743121311:t[8]>819.5000000000001?ee=-.07181278009001418:t[10]>25.500000000000004?ee=.13499019430369633:t[1]>31.500000000000004?ee=.09032979489780704:ee=-.12754166393372374:t[9]>37.50000000000001?ee=-.05093963635361407:ee=-.005026651151683848:t[9]>2.5000000000000004?ee=.07619735785573735:ee=.012363301341532136:t[26]>1e-35?ee=-.10685800454968203:t[8]>125.50000000000001?t[8]>446.50000000000006?t[0]>3842.5000000000005?ee=-.08783796894105043:t[282]>1e-35?t[1]>47.50000000000001?t[9]>40.50000000000001?ee=-.10764172927882483:ee=.01890760098464703:ee=.06573095405846417:t[8]>634.5000000000001?ee=-.00783575973273707:ee=-.050612689680229306:t[1]>22.500000000000004?ee=-.0016842490401359626:ee=.0738227088444087:ee=-.02663970950432175;let K;t[31]>1e-35?t[8]>17.500000000000004?K=.013678038624884814:t[1]>35.50000000000001?t[1]>51.50000000000001?K=.007191286124908192:K=-.09347881647636902:t[10]>1.5000000000000002?K=.07938758708008091:K=-.008702935600305113:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?K=.12321804057595996:K=-.018281109320672437:t[23]>1e-35?t[4]>62.50000000000001?K=-.04644244754790671:K=.024546310702263208:t[8]>862.5000000000001?t[0]>3429.5000000000005?t[4]>9.500000000000002?t[52]>1e-35?K=.0706108609273337:t[2]>40.50000000000001?K=-.028046629962303716:K=-.06497613993109329:K=.01076489668586676:t[1]>33.50000000000001?t[0]>966.5000000000001?t[2]>14.500000000000002?t[1]>38.50000000000001?K=-.03056331974267756:K=-.11886389712497057:K=.053364962175658184:t[8]>2233.5000000000005?K=-.0448152521157682:K=.1508651602190868:t[2]>33.50000000000001?t[0]>2882.5000000000005?t[0]>3183.5000000000005?K=.03818796510453344:K=.23673992112982362:K=.02858814226507374:t[10]>44.50000000000001?K=-.1125863771551199:K=.009129996952394916:t[1]>7.500000000000001?K=-.004374525302461639:K=-.07858519434925451:t[149]>1e-35?t[6]>23.500000000000004?K=.0005231594491642136:t[0]>4053.5000000000005?t[8]>660.5000000000001?K=-.13677189943034931:t[10]>2.5000000000000004?K=.039591891437078086:K=-.09312596849507347:K=-.02423172142089822:K=.0009836986075266283;let pe;t[189]>1e-35?t[0]>5269.500000000001?pe=-.103183298350443:t[2]>51.50000000000001?pe=.09784373530929913:t[10]>26.500000000000004?t[8]>764.5000000000001?pe=-.05186168947388339:pe=.0496996365539082:t[10]>23.500000000000004?pe=.1404445738719:t[93]>1e-35?pe=.0027146310074558505:t[5]>3821.5000000000005?pe=.002153033152069652:t[4]>2.5000000000000004?pe=.007663539551317215:pe=.13902616832015402:t[298]>1e-35?t[8]>81.50000000000001?t[4]>64.50000000000001?pe=.11498405722487515:t[2]>23.500000000000004?t[0]>2815.5000000000005?t[2]>44.50000000000001?t[4]>42.50000000000001?pe=-.021479467709980358:pe=.09336868994327292:t[1]>22.500000000000004?t[15]>1e-35?pe=.021660293256233334:pe=-.0927396152303864:pe=.0665074081601698:t[0]>1550.5000000000002?pe=.08972407105958534:pe=-.0380796411182682:t[6]>13.500000000000002?t[10]>2.5000000000000004?pe=.06761927942466854:pe=-.015762168112653286:t[17]>1e-35?pe=.10311304131145381:pe=-.017672785252336027:pe=-.08629805732772755:t[1]>24.500000000000004?t[138]>1e-35?pe=-.10638321435298535:pe=.0007073011744385905:t[18]>1e-35?pe=-.027056185501334325:t[145]>1e-35?pe=.023191199677450886:t[9]>33.50000000000001?t[201]>1e-35?pe=.09762140519655171:t[9]>110.50000000000001?pe=-.06581942957595835:t[6]>54.50000000000001?pe=.04959634035251596:pe=.0022616298654554207:pe=-.007437620924990854;let X;t[179]>1e-35?X=-.06961998209988884:t[167]>1e-35?t[0]>3928.5000000000005?X=.1470294450403005:X=-.01671476793947083:t[187]>1e-35?t[6]>13.500000000000002?t[4]>30.500000000000004?t[13]>1e-35?X=.07448480853603114:t[0]>1012.5000000000001?t[5]>2883.5000000000005?t[0]>3682.5000000000005?t[5]>4031.5000000000005?t[23]>1e-35?X=.07965955447707423:t[10]>10.500000000000002?X=-.09236156404262426:X=.03396273196231458:X=-.13246465021467432:X=.07092822261735353:X=-.08753829085942:X=.09409024840640956:t[1]>40.50000000000001?t[8]>984.5000000000001?t[8]>1514.5000000000002?t[8]>2134.5000000000005?X=.004705878789890202:X=.13775378964952867:X=-.04770928980587811:t[10]>29.500000000000004?X=.011221519891071544:t[0]>3853.5000000000005?X=.06365381191628273:X=.15506252245336827:t[1]>37.50000000000001?X=-.07254777021042061:X=.026514587757252385:t[308]>1e-35?X=.04115804816617256:t[10]>26.500000000000004?X=.02077721353011946:t[5]>3548.5000000000005?X=-.1280907116663952:X=-.021974774274438:t[306]>1e-35?X=-.02700446558079895:t[297]>1e-35?t[212]>1e-35?X=.07794139136748461:t[7]>5.500000000000001?t[19]>1e-35?X=-.005710865560475598:t[94]>1e-35?X=-.06751507982853555:X=.027250040757588703:t[9]>52.50000000000001?X=.07060357924595577:X=-.030297760713011795:X=-.0006005400085266517;let ue;t[113]>1e-35?ue=-.07311041707507712:t[40]>1e-35?t[0]>1937.5000000000002?ue=-.06996356565314456:ue=.04780211300352931:t[10]>52.50000000000001?t[49]>1e-35?ue=-.08317707559926495:t[21]>1e-35?ue=-.0817284654645976:t[15]>1e-35?t[2]>3.5000000000000004?ue=-.010538203005984922:ue=.08454819465349446:t[9]>124.50000000000001?ue=.09015659250299132:t[7]>15.500000000000002?t[5]>5732.500000000001?ue=-.08542251249346582:t[9]>50.50000000000001?ue=-.023428882537657472:ue=.010042500833979073:ue=.020697210754240154:t[10]>28.500000000000004?t[5]>423.00000000000006?t[148]>1e-35?ue=.03006025206979096:t[9]>108.50000000000001?ue=-.09153851322499747:t[145]>1e-35?t[5]>4814.500000000001?t[2]>38.50000000000001?ue=.04222035773042132:ue=-.09078149053947535:t[8]>568.5000000000001?t[1]>64.50000000000001?ue=-.07209095448054853:ue=.028065954981903313:ue=.08714651929917122:ue=-.006678820669279169:t[10]>40.50000000000001?ue=.006982396294941626:ue=-.07889649792011418:t[94]>1e-35?t[4]>30.500000000000004?ue=-.09351114982645548:t[4]>3.5000000000000004?ue=-.004837550129223451:ue=-.08324141237464677:t[303]>1e-35?ue=.10703037493990825:t[9]>156.50000000000003?ue=-.10803018621648303:t[116]>1e-35?ue=-.03208302566598311:t[212]>1e-35?t[243]>1e-35?ue=.10261721665006701:ue=.018994509090668264:ue=.0011244262442038839;let qe;t[86]>1e-35?t[8]>65.50000000000001?t[1]>46.50000000000001?qe=-.08404263465005328:t[0]>3682.5000000000005?qe=.041259223920298876:t[1]>29.500000000000004?qe=-.09541257493441671:qe=.001482192721625409:qe=.051541427372951004:t[3]>7.500000000000001?t[157]>1e-35?qe=-.08268996098437432:t[230]>1e-35?qe=.015749498159959817:t[4]>7.500000000000001?t[3]>11.500000000000002?qe=-913218977737457e-19:t[4]>10.500000000000002?qe=-.056334165674005156:t[127]>1e-35?qe=-.0784634021824036:t[2]>9.500000000000002?t[1]>62.50000000000001?qe=-.04231200150318989:t[10]>42.50000000000001?qe=.10182973257894812:qe=.015934763950068445:qe=-.03130938805859397:t[92]>1e-35?t[4]>6.500000000000001?t[1]>51.50000000000001?t[9]>19.500000000000004?qe=-.041117068322885315:qe=.1167767830037126:qe=.13611206992387337:t[10]>41.50000000000001?qe=-.07120286010564107:qe=.022032788063345417:t[8]>1.5000000000000002?t[1]>51.50000000000001?t[9]>72.50000000000001?qe=-.07702290997669524:t[198]>1e-35?qe=.08776558554437136:qe=-.008290740324975692:t[2]>32.50000000000001?qe=.07198457624219955:qe=.005463113714361629:qe=.09414099512900526:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?qe=.03295785445437507:qe=.15140250150674536:qe=-.035613213948910254:t[186]>1e-35?qe=.06849425535860769:t[96]>1e-35?qe=.06028225812727254:qe=-.007582543288662308;let ie;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?ie=.08396556264106572:ie=-.0562516995099192:ie=-.10593011018789432:t[183]>1e-35?t[15]>1e-35?ie=-.09705176473553752:t[7]>18.500000000000004?t[2]>37.50000000000001?ie=.0052017514017035915:ie=-.11194119432743639:ie=.03724337696163019:t[227]>1e-35?t[17]>1e-35?t[2]>16.500000000000004?ie=-.025692451287403446:ie=-.09511862672123193:t[8]>1661.5000000000002?t[10]>37.50000000000001?ie=-.11892250746801664:t[10]>22.500000000000004?ie=.07548493166973796:ie=-.05973048107712209:t[4]>12.500000000000002?t[0]>4319.500000000001?t[10]>4.500000000000001?t[10]>37.50000000000001?ie=.13750699058082427:t[18]>1e-35?ie=.06535408879552801:ie=-.054118179035040674:ie=.1344282838979622:t[0]>3982.5000000000005?ie=-.10409582202467015:t[19]>1e-35?ie=.12672850705810795:t[8]>587.5000000000001?t[1]>35.50000000000001?ie=.012705935670766466:ie=.14149359442527545:ie=-.047977876173706004:t[20]>1e-35?ie=.057945228080337946:t[0]>3642.5000000000005?ie=-.008726535792122467:ie=-.08424769891378858:t[34]>1e-35?ie=-.0699329538228602:t[134]>1e-35?t[11]>1e-35?t[4]>15.500000000000002?t[0]>1187.5000000000002?ie=.01196849566739346:ie=.1614642278429876:ie=-.043022338150701625:t[3]>5.500000000000001?ie=-.03907848255033881:ie=.018280601026175593:ie=.0006654540402589085;let le;t[31]>1e-35?t[2]>58.50000000000001?t[9]>1.5000000000000002?le=-.01386103677247845:le=.11386694333005128:t[4]>27.500000000000004?le=-.021862617610091336:t[2]>31.500000000000004?le=.0828858469030438:le=.006483353475830127:t[224]>1e-35?t[149]>1e-35?t[13]>1e-35?le=.11303635767048735:le=-.01645525128352694:t[23]>1e-35?t[4]>62.50000000000001?le=-.04238798044549342:le=.022091190130494303:t[5]>5082.500000000001?le=-.04287166152163786:t[8]>862.5000000000001?t[19]>1e-35?le=.000660344696244351:t[4]>9.500000000000002?t[0]>1277.5000000000002?le=-.04291104140431434:t[17]>1e-35?le=.11256797532342613:le=-.017206916368289193:le=.026482035265709743:t[1]>8.500000000000002?t[11]>1e-35?le=.04060606971664621:t[0]>4733.500000000001?t[8]>214.50000000000003?t[5]>4814.500000000001?le=.03581712466863222:le=.14770264307668884:t[8]>73.50000000000001?le=-.13093289429740068:le=.042461737442702936:t[52]>1e-35?le=.0501831919044939:le=-.010450249720465756:le=-.0753365425372656:t[149]>1e-35?t[6]>23.500000000000004?le=.0005381332165438493:le=-.04549431717503909:t[133]>1e-35?t[2]>5.500000000000001?t[8]>698.5000000000001?t[282]>1e-35?le=.04849637311285226:le=-.036671377119808564:t[0]>421.50000000000006?le=.00020968499911058945:le=.11636422423182405:le=-.12687837788222575:le=.0012774367867215346;let Ne;t[120]>1e-35?Ne=.04776057572434719:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?Ne=-.042799574885345304:Ne=.07412430171193245:Ne=-.11248270469336048:t[193]>1e-35?Ne=-.060694220820603384:t[121]>1e-35?t[217]>1e-35?t[0]>4449.500000000001?t[4]>8.500000000000002?Ne=.028911612178122104:Ne=.12326369727728437:t[0]>4091.5000000000005?Ne=-.09370267064141052:t[0]>3519.5000000000005?t[8]>668.5000000000001?Ne=.1159839898100149:Ne=-.01924880886585737:t[8]>501.50000000000006?t[10]>16.500000000000004?Ne=-.0216343737351583:Ne=-.1220272260878369:t[2]>18.500000000000004?Ne=.09152924475072398:t[8]>55.50000000000001?Ne=.039508716651005665:Ne=-.11714436880423203:t[18]>1e-35?t[9]>2.5000000000000004?Ne=.06793009902674053:Ne=-.024060578029812988:t[4]>2.5000000000000004?t[2]>16.500000000000004?t[4]>11.500000000000002?Ne=-.04391068849624096:Ne=.04009967593394672:t[8]>1085.5000000000002?Ne=-.024773826356034825:Ne=-.13919707884246582:Ne=.06659278075192335:t[223]>1e-35?t[8]>668.5000000000001?Ne=-.11567917501901476:Ne=-.006813640337684114:t[3]>7.500000000000001?Ne=.0010671269682548076:t[7]>3.5000000000000004?t[1]>33.50000000000001?t[0]>1597.5000000000002?t[10]>1.5000000000000002?Ne=-.001754586408351048:Ne=-.055422422450722056:Ne=-.06090032532532226:t[0]>5269.500000000001?Ne=.11787981735983527:Ne=-.00198119768540783:Ne=.00210412924303036;let we;t[294]>1e-35?t[10]>50.50000000000001?we=-.09738558653332406:t[0]>2432.5000000000005?t[0]>4533.500000000001?we=-.06063239096209816:we=.03317022411417386:we=-.08607562321324262:t[120]>1e-35?t[4]>18.500000000000004?we=-.013608609329298802:we=.09078000157330264:t[99]>1e-35?we=.014828708581964632:t[10]>52.50000000000001?t[49]>1e-35?we=-.07536137260189814:we=.006253266595455118:t[10]>28.500000000000004?we=-.006106041147592768:t[9]>156.50000000000003?we=-.11828932797811101:t[94]>1e-35?we=-.02566078479505714:t[303]>1e-35?we=.09544850289775349:t[15]>1e-35?t[224]>1e-35?t[4]>56.50000000000001?we=-.08401252789168523:t[5]>4244.500000000001?we=.026372887658499107:t[1]>16.500000000000004?we=-.027836756345634026:we=.09205362097909099:we=.00934612788718244:t[203]>1e-35?we=-.016371658366767253:t[7]>26.500000000000004?t[0]>966.5000000000001?t[1]>38.50000000000001?t[146]>1e-35?t[9]>21.500000000000004?we=-.09580979052540028:t[1]>50.50000000000001?we=-.06402211827281554:we=.08342858760095972:t[2]>36.50000000000001?we=.008114897658204584:t[92]>1e-35?we=.09541587072672864:we=-.022342147210555434:we=-.01660492519175128:we=.014721622240945446:t[4]>25.500000000000004?t[11]>1e-35?we=.15846731118501817:we=.039498507912023195:t[245]>1e-35?we=.07008718676813333:we=.0019806389728814727;let Be;t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[0]>4188.500000000001?Be=-.01192072916082109:Be=.13888590840802637:t[1]>16.500000000000004?t[8]>2302.5000000000005?Be=.06874032717466054:t[4]>40.50000000000001?Be=-.07752510020707537:t[1]>76.50000000000001?Be=-.09944032260703917:t[8]>1381.5000000000002?Be=-.054466635810800745:t[1]>32.50000000000001?Be=.05974084520839573:Be=-.0384718740755954:Be=-.11374190719134032:t[0]>2151.5000000000005?Be=-.13703645155803298:Be=.004833344758654556:t[297]>1e-35?t[212]>1e-35?Be=.06954747264544993:t[7]>9.500000000000002?t[19]>1e-35?t[1]>30.500000000000004?t[0]>4242.500000000001?Be=.013539805885738608:Be=-.0692740641801559:t[0]>2653.5000000000005?t[10]>57.50000000000001?Be=.09941880179344399:Be=-.01608127391210995:Be=.08025226531247417:t[9]>67.50000000000001?Be=.13525448212444113:t[6]>61.50000000000001?Be=-.05511099182158894:t[94]>1e-35?Be=-.06821509831783572:t[128]>1e-35?Be=.11361314817714643:Be=.030160785008575566:t[1]>13.500000000000002?t[8]>17.500000000000004?t[16]>1e-35?Be=-.09954181329804547:t[197]>1e-35?Be=.10102833149755386:t[188]>1e-35?Be=.05584490988313965:t[9]>49.50000000000001?t[4]>5.500000000000001?Be=-.03781554214742005:Be=.09927933385592314:Be=-.020006000056720083:Be=-.10520473615957895:Be=-.12006990846253787:Be=-.00026111570975317574;let tt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[0]>1725.5000000000002?t[7]>14.500000000000002?t[2]>38.50000000000001?tt=-.019188245509744628:tt=-.13354864350075848:t[0]>2461.5000000000005?tt=.051885477468354396:tt=-.0833581968852119:tt=.08233441701532287:tt=-.10865584951212362:t[8]>2992.5000000000005?t[10]>49.50000000000001?t[10]>56.50000000000001?t[1]>45.50000000000001?t[0]>2041.5000000000002?tt=.09926337893072812:tt=-.027753610497327715:t[0]>1972.5000000000002?tt=-.09780045823152517:tt=.032380915168504935:tt=.11502632261226381:t[17]>1e-35?tt=-.06094965899579662:t[10]>40.50000000000001?tt=-.07500475582440802:tt=.006499832113084677:t[10]>4.500000000000001?t[4]>10.500000000000002?tt=-.09584538995220808:tt=-.00908705814304442:tt=.03203281520813893:t[10]>49.50000000000001?tt=-.03146271513986384:t[2]>63.50000000000001?tt=.13172001315536286:t[224]>1e-35?tt=.08945777550527927:t[0]>2282.5000000000005?t[4]>4.500000000000001?tt=.09521549382082259:tt=-.04414925613522197:t[0]>1847.5000000000002?tt=-.09118580379557353:tt=.009206744918282364:t[178]>1e-35?t[2]>25.500000000000004?t[1]>31.500000000000004?tt=.03525144509943896:tt=-.053340750721609057:t[0]>1057.5000000000002?t[10]>2.5000000000000004?tt=-.04766112322938157:t[2]>10.500000000000002?tt=.0728516504357201:tt=-.05049625965272536:tt=-.10868663055825774:tt=.0005382613419948969;let st;t[147]>1e-35?t[1]>53.50000000000001?st=-.10615739288764095:t[0]>2604.5000000000005?t[0]>3629.5000000000005?st=-.030504020655417463:st=.07102458639110094:st=-.07058131985243714:t[302]>1e-35?t[10]>47.50000000000001?st=.055304563442710876:t[1]>53.50000000000001?st=.033723409577443623:t[8]>175.50000000000003?t[0]>2628.5000000000005?t[9]>40.50000000000001?st=-.1568835288372895:st=-.0279829124400056:st=.04493843959601833:st=-.11637042729644327:t[191]>1e-35?t[282]>1e-35?st=-.054133834303687026:t[9]>48.50000000000001?st=.11263810289007213:t[9]>9.500000000000002?st=-.02202034562838259:t[4]>45.50000000000001?st=-.03410927569045158:st=.04381615166534081:t[242]>1e-35?t[0]>3615.5000000000005?t[3]>19.500000000000004?t[1]>56.50000000000001?t[4]>28.500000000000004?st=-.029687297407295893:st=.10673602850001934:t[4]>42.50000000000001?st=.0036275562945108117:st=-.0760789221330622:st=-.10385623431741903:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?st=.08274426793676076:st=-.07076234425516396:st=.13890177606150175:st=-.019863286503635686:t[53]>1e-35?t[18]>1e-35?st=-.09250637750836187:st=-.0031531727902009026:t[2]>107.50000000000001?t[4]>91.50000000000001?t[1]>16.500000000000004?st=-.01897867921812603:st=.04890781705365262:st=-.11569892307597907:t[2]>106.50000000000001?st=.09032697440623969:st=.00047935919155035045;let Et;t[115]>1e-35?Et=.05338335681275557:t[242]>1e-35?t[0]>3615.5000000000005?t[4]>42.50000000000001?t[4]>75.50000000000001?Et=-.10131179514695865:t[8]>938.5000000000001?Et=.10203729808015481:Et=-.015357944186835289:t[1]>56.50000000000001?t[2]>22.500000000000004?Et=.03574015165562999:Et=-.07763042506449493:Et=-.0813323116215548:t[2]>34.50000000000001?t[2]>44.50000000000001?t[4]>51.50000000000001?Et=.0665706259130275:Et=-.06586817559309924:Et=.11925564412287476:Et=-.014170019267143326:t[1]>124.50000000000001?t[2]>30.500000000000004?t[8]>533.5000000000001?t[4]>41.50000000000001?t[8]>977.5000000000001?Et=.046017146627455346:Et=-.08623321630086885:t[8]>1765.5000000000002?Et=-.017990564319859934:t[10]>25.500000000000004?t[10]>48.50000000000001?Et=.11143827902215087:Et=-.01817808730473413:Et=.16980985030210127:Et=-.09357806298740017:t[10]>7.500000000000001?t[10]>54.50000000000001?Et=.010168994879727824:Et=-.09099594488792513:t[9]>1.5000000000000002?Et=.0533459678147928:Et=-.06886854808370108:t[99]>1e-35?t[17]>1e-35?t[9]>22.500000000000004?Et=-.062346959148773695:t[1]>47.50000000000001?Et=-.0021578343835599316:t[2]>27.500000000000004?Et=.19567373210166172:Et=.07851555379116423:t[18]>1e-35?Et=.03711549097804649:t[8]>359.50000000000006?Et=.012492346746905587:t[4]>20.500000000000004?Et=.047511695735697544:Et=-.07999269063948773:Et=6802045404471004e-20;let kt;t[222]>1e-35?t[0]>612.5000000000001?t[10]>1e-35?t[8]>2167.5000000000005?t[4]>25.500000000000004?kt=.0011484728213539738:kt=-.0936582904650763:t[2]>25.500000000000004?t[8]>182.50000000000003?t[10]>22.500000000000004?t[0]>5026.500000000001?kt=-.09828874964938798:t[8]>1586.5000000000002?kt=.13726397438080162:t[4]>48.50000000000001?t[2]>63.50000000000001?kt=.011938269926919522:kt=.17541983715953954:t[19]>1e-35?kt=.023002786011088672:kt=-.06221461272461431:t[9]>2.5000000000000004?t[0]>3818.5000000000005?kt=.06508934844183291:kt=-.10168553534835639:kt=-.07755626499024171:t[2]>51.50000000000001?t[4]>65.50000000000001?kt=.021140806225203937:kt=-.1167833342453639:t[2]>33.50000000000001?kt=.13163585734056618:kt=-.00203273890889717:t[10]>36.50000000000001?t[8]>1067.5000000000002?kt=.06314479201263888:kt=-.09639088327091713:t[10]>29.500000000000004?kt=.09225469303582386:t[0]>3129.5000000000005?t[0]>4091.5000000000005?t[0]>4354.500000000001?kt=40577156464836036e-21:kt=.12322387121810757:kt=-.03697224045046014:t[1]>22.500000000000004?kt=.016474835887320276:kt=.16919298733903063:kt=.07633203630214054:kt=-.047438037934250644:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?kt=.14150493354700563:kt=-.01831155354975749:t[1]>28.500000000000004?kt=-.07952557178685365:t[10]>28.500000000000004?kt=.0665695554984927:kt=-.053640139319277094:kt=.0004754840665898665;let Gt;t[76]>1e-35?Gt=-.06814884255939921:t[179]>1e-35?Gt=-.06325743795510681:t[122]>1e-35?t[6]>36.50000000000001?Gt=.05052338063261613:t[8]>626.5000000000001?t[1]>38.50000000000001?Gt=.004193658608848433:Gt=-.1066968975983452:t[8]>302.50000000000006?Gt=.05476730110440451:Gt=-.06382970920394895:t[218]>1e-35?t[2]>3.5000000000000004?t[6]>13.500000000000002?t[2]>19.500000000000004?t[0]>3200.5000000000005?t[4]>91.50000000000001?Gt=-.12156071809840739:t[9]>21.500000000000004?t[5]>3883.5000000000005?t[8]>919.5000000000001?t[8]>1085.5000000000002?Gt=.013555772109446666:Gt=-.09856116699770784:Gt=.0284329611813383:t[2]>52.50000000000001?Gt=.04008708444763762:t[9]>29.500000000000004?Gt=-.1289599546008197:Gt=-.018566534248335896:t[8]>747.5000000000001?Gt=.02236484980076122:Gt=.1148871655157582:t[8]>3084.0000000000005?Gt=-.05573875952902531:t[10]>17.500000000000004?t[2]>51.50000000000001?Gt=.03164751204281298:Gt=.11752140436184891:t[9]>42.50000000000001?Gt=-.07180559595410106:t[22]>1e-35?Gt=.09325040416256854:Gt=-.016041122807939914:Gt=-.02765708954618808:t[1]>30.500000000000004?t[1]>66.50000000000001?Gt=-.010718250133458515:Gt=.09818827994853763:Gt=.010180038981174032:Gt=-.039472162599295535:t[9]>170.50000000000003?Gt=-.08536729235976731:t[189]>1e-35?t[0]>5269.500000000001?Gt=-.08674788057474031:Gt=.02077653508548371:Gt=-.0003536561382007414;let jt;t[86]>1e-35?t[10]>6.500000000000001?t[0]>4376.500000000001?jt=.018337297491457794:jt=-.05926206443180149:jt=.024026520855881126:t[288]>1e-35?t[184]>1e-35?jt=.10747078482128616:t[126]>1e-35?jt=-.10550625192391357:t[7]>71.50000000000001?jt=-.07698346027863572:t[8]>302.50000000000006?t[6]>49.50000000000001?t[4]>47.50000000000001?t[1]>38.50000000000001?t[15]>1e-35?jt=.1317396472229434:jt=-.025035791351328947:jt=-.0728334305864372:t[8]>963.5000000000001?jt=.023642201723096064:jt=.183010326734258:t[128]>1e-35?jt=.04228920135648387:t[2]>34.50000000000001?t[15]>1e-35?jt=.002801782941492993:t[3]>40.50000000000001?t[4]>39.50000000000001?jt=-.1088876900335281:jt=.02758317023002635:jt=-.11886771300807207:t[9]>59.50000000000001?t[1]>33.50000000000001?jt=-.01928020117446408:jt=.10193718474139135:t[1]>48.50000000000001?t[4]>9.500000000000002?t[8]>932.5000000000001?jt=.07893723375925096:jt=-.009878929627026153:t[10]>2.5000000000000004?t[9]>20.500000000000004?jt=-.10301657587280551:jt=.005787463140224318:jt=.07421364314695046:t[0]>2840.5000000000005?t[10]>29.500000000000004?jt=-.019296977889522397:jt=-.07274529751752634:t[1]>30.500000000000004?jt=-.050368901143148286:jt=.029630869489466655:t[2]>6.500000000000001?t[4]>9.500000000000002?jt=.0015332402792773946:jt=.09930153676749967:jt=-.06370844564357069:jt=.00042272155209927616;let Ie;t[71]>1e-35?t[4]>17.500000000000004?Ie=.12586844370423247:Ie=-.006791999603126354:t[222]>1e-35?t[1]>10.500000000000002?t[30]>1e-35?t[1]>36.50000000000001?t[9]>1.5000000000000002?t[10]>25.500000000000004?Ie=-.08474891624263797:t[8]>125.50000000000001?Ie=.08125086980439704:Ie=-.04082085238068532:t[0]>3863.5000000000005?Ie=.020481535807469208:Ie=.14810819386202126:t[0]>1937.5000000000002?t[2]>16.500000000000004?Ie=-.019110200161573936:Ie=-.12387719685855114:t[0]>1102.5000000000002?Ie=.08376595701957407:Ie=-.031821919580524834:t[9]>4.500000000000001?Ie=-.08116383486497568:t[7]>8.500000000000002?t[2]>24.500000000000004?Ie=-.02154820850475448:t[0]>3863.5000000000005?t[8]>902.5000000000001?Ie=.1349841206807871:Ie=.011864053595560297:t[1]>41.50000000000001?Ie=-.08203662486612544:t[2]>18.500000000000004?Ie=-.009541865642346947:Ie=.08345043168501759:t[2]>10.500000000000002?Ie=-.09585031818030947:Ie=.019432330487099865:Ie=.08399259524715129:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Ie=.11951517733981365:Ie=-.016651014735738538:t[1]>28.500000000000004?Ie=-.07410922545030711:t[10]>28.500000000000004?Ie=.05886430683844788:Ie=-.04929626605117184:t[191]>1e-35?t[9]>9.500000000000002?t[9]>48.50000000000001?Ie=.04802269879144705:Ie=-.026208212831796737:t[4]>45.50000000000001?Ie=-.03227476944664786:Ie=.05124575625622705:Ie=.00020506696916003137;let F;t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?F=-.03042091758483443:t[10]>14.500000000000002?F=.09816619204768777:F=.01332124067720947:t[8]>8.500000000000002?t[4]>15.500000000000002?F=-.02381165060401718:F=-.10950361804974783:F=.03538211665111128:t[212]>1e-35?t[19]>1e-35?F=-.09940014650006174:t[0]>2215.5000000000005?t[5]>5056.500000000001?t[3]>5.500000000000001?t[10]>25.500000000000004?F=-.06371052144380579:F=.0835500621252692:F=-.10408255929333915:t[1]>74.50000000000001?F=.13208968122712403:t[1]>64.50000000000001?F=-.04778844603644965:t[8]>51.50000000000001?t[8]>201.50000000000003?t[8]>660.5000000000001?t[6]>4.500000000000001?t[9]>5.500000000000001?t[1]>29.500000000000004?t[0]>3830.5000000000005?F=.09922816902423433:F=.016366955328796718:F=.1592412560903584:t[1]>39.50000000000001?F=.05409467990258923:F=-.08260633210459611:F=-.06307205775247567:t[9]>36.50000000000001?F=.040253940015648144:F=.14202568969471283:F=-.028761848341594044:F=.08994073058773508:t[0]>807.5000000000001?F=-.043427848826323195:F=.04573516446846493:t[20]>1e-35?t[188]>1e-35?F=-.0758877731600639:t[23]>1e-35?F=.05913923322043199:t[8]>155.50000000000003?t[128]>1e-35?F=.08124700978741987:F=.013296063087086852:t[7]>5.500000000000001?F=-.01640196088612987:F=-.12685498840146067:F=-.0004940792382459551;let be;t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?be=-.05584993681929434:t[9]>27.500000000000004?t[0]>3916.5000000000005?be=.08513773825688947:be=-.1184664832315282:be=.05676963535893477:be=.14263843210340613:be=.0005795003292924202:t[18]>1e-35?t[0]>5453.500000000001?t[1]>11.500000000000002?be=-.10669720555606924:be=.029016613003137307:t[2]>46.50000000000001?t[10]>9.500000000000002?be=.0664744575868955:be=-.08469256188890871:be=-.026746678040592144:t[281]>1e-35?be=-.07408427239006925:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?be=.012131807587207655:be=-.12776015795398743:be=.04320472481083551:be=.08390980661550446:t[10]>227.50000000000003?be=-.09771783809101153:t[10]>130.50000000000003?be=.11175201938704937:t[8]>779.5000000000001?t[5]>3325.5000000000005?t[128]>1e-35?be=-.07610698254064358:t[8]>902.5000000000001?be=-.03136381213599649:t[131]>1e-35?be=.0704821739127936:t[224]>1e-35?be=-.056961477774953785:t[10]>30.500000000000004?t[9]>43.50000000000001?be=.10431473040024908:t[8]>841.5000000000001?be=.07304745320500514:be=-.038011541882439825:be=-.01679746695007364:t[0]>3129.5000000000005?be=.05589952587431965:t[210]>1e-35?be=.06227198085800842:be=-.0011341890997947812:t[8]>740.5000000000001?be=.04817300084412584:be=-.000577001010789238;let Ue;t[187]>1e-35?t[6]>12.500000000000002?t[10]>8.500000000000002?t[10]>16.500000000000004?t[8]>234.50000000000003?t[4]>43.50000000000001?t[0]>4476.500000000001?Ue=-.10504730480402079:t[5]>3341.5000000000005?Ue=.11087894671081754:Ue=-.0406668834674614:Ue=.03308382165616109:t[8]>104.50000000000001?Ue=-.10431436764549162:Ue=.0073928337244891455:t[4]>34.50000000000001?Ue=-.10571751512748416:Ue=-.006081128814142983:t[13]>1e-35?Ue=.1299673566095023:t[4]>60.50000000000001?Ue=-.06587492443829139:t[0]>2604.5000000000005?t[3]>19.500000000000004?Ue=.04857126072645073:Ue=-.03431365358104773:t[4]>16.500000000000004?Ue=.04101865986596709:Ue=.16480274980378218:t[10]>26.500000000000004?Ue=.03673978504199255:t[10]>9.500000000000002?Ue=-.10996402743800027:t[308]>1e-35?Ue=.0553693735082498:Ue=-.041600136235644125:t[306]>1e-35?t[8]>1156.5000000000002?t[4]>14.500000000000002?t[10]>21.500000000000004?Ue=.010902983761213922:Ue=.1325118659895645:Ue=-.064362945508595:t[1]>66.50000000000001?Ue=.033416767779331176:Ue=-.054080316225040496:t[42]>1e-35?Ue=-.07762364337810815:t[10]>1089.5000000000002?Ue=-.08465599849125216:t[31]>1e-35?t[8]>30.500000000000004?Ue=.012788520036013586:t[1]>32.50000000000001?t[1]>51.50000000000001?Ue=.0220102041325908:Ue=-.06516708740003069:Ue=.012833498905748267:t[224]>1e-35?Ue=-.007038418272997865:Ue=.00037666304316290967;let de;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?de=.07554189644995735:de=-.052089349455904946:de=-.10148206848169845:t[113]>1e-35?de=-.06666678653225779:t[39]>1e-35?t[9]>3.5000000000000004?t[0]>3670.5000000000005?de=.07172653627995676:de=-.07602959317610998:de=-.08790686271287523:t[229]>1e-35?t[0]>2952.5000000000005?t[0]>3904.5000000000005?de=-.0399322883690891:de=.06523495517476098:de=-.10358715295743802:t[193]>1e-35?de=-.05551414334329124:t[134]>1e-35?t[11]>1e-35?t[2]>13.500000000000002?t[10]>1.5000000000000002?de=.015928764772252406:de=.1341513061552287:de=-.04975001987586173:t[10]>2.5000000000000004?t[3]>5.500000000000001?t[9]>2.5000000000000004?t[8]>310.50000000000006?de=-.033592997607280156:de=-.12432458028446665:t[1]>32.50000000000001?t[217]>1e-35?de=-.08402551858097379:de=.017401984506038796:t[1]>25.500000000000004?de=.13337205393591278:de=-.01160208350090984:de=.06708317942315471:t[8]>227.50000000000003?de=-.08486943882418681:de=-.013970104864235007:t[8]>4968.500000000001?t[1]>31.500000000000004?t[9]>4.500000000000001?de=-.10496268177586783:de=-.020921489532370493:de=.02629915927247642:t[7]>20.500000000000004?t[8]>251.50000000000003?t[115]>1e-35?de=.11639296062157028:de=-.004275784356569115:t[32]>1e-35?de=-.07297384970166025:de=.006026841626381599:de=.002034611134960428;let Se;t[248]>1e-35?Se=.06091438745093315:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?Se=-.06455513326540585:t[1]>29.500000000000004?Se=.07718474591552532:t[4]>7.500000000000001?Se=.040139336931404826:Se=-.09685734690563386:Se=.00015327283570347363:t[9]>88.50000000000001?Se=.10079017954199324:t[1]>47.50000000000001?t[2]>20.500000000000004?t[2]>27.500000000000004?Se=-.04077257804338707:Se=.0739963982640615:t[9]>1.5000000000000002?t[17]>1e-35?Se=.03778141591008941:Se=-.06459919920634845:Se=-.11193190957880604:t[7]>6.500000000000001?t[11]>1e-35?t[18]>1e-35?Se=.14063930759326346:t[0]>179.50000000000003?Se=.07287482250668585:t[8]>1180.5000000000002?Se=-.14419393112726253:t[10]>28.500000000000004?Se=-.07993142770099469:t[17]>1e-35?Se=-.04702595410391655:t[7]>21.500000000000004?t[2]>26.500000000000004?Se=.05527969663610186:Se=-.10824385941441346:t[3]>11.500000000000002?Se=.12358502961047915:Se=-.017509147119622873:t[0]>74.50000000000001?Se=-.014907705458730486:t[8]>95.50000000000001?Se=-.02225118168342062:Se=-.1222374623708485:t[8]>1.5000000000000002?t[8]>950.5000000000001?Se=.06946188930925638:t[3]>6.500000000000001?t[10]>2.5000000000000004?t[19]>1e-35?Se=.04962819555610421:Se=-.07213577821855309:Se=.09139529824708481:t[19]>1e-35?Se=.013439401088345224:Se=-.049274647207292056:Se=.10531673719686951;let Le;t[40]>1e-35?t[0]>1937.5000000000002?Le=-.06421671152073961:Le=.04235421241226177:t[294]>1e-35?t[10]>50.50000000000001?Le=-.09100102290316286:t[0]>3030.5000000000005?t[0]>4177.500000000001?Le=-.03520420769287065:t[8]>1085.5000000000002?Le=-.019817352506127633:Le=.11444439424520964:Le=-.06854631664538167:t[120]>1e-35?t[4]>18.500000000000004?Le=-.010490117519863269:Le=.08104430117757461:t[121]>1e-35?t[243]>1e-35?Le=.16408304891242204:t[217]>1e-35?t[0]>4449.500000000001?Le=.06619344145920268:t[0]>4091.5000000000005?Le=-.08813353450871053:t[0]>3519.5000000000005?t[8]>668.5000000000001?Le=.10016091391222309:Le=-.017407607199427293:t[8]>501.50000000000006?t[10]>16.500000000000004?Le=-.019511460451434884:Le=-.11643672465055221:t[2]>18.500000000000004?Le=.07848228087333317:t[8]>55.50000000000001?Le=.032583027899956235:Le=-.11209832692153521:t[11]>1e-35?Le=.027482174104412567:t[10]>1.5000000000000002?t[6]>26.500000000000004?t[4]>19.500000000000004?t[9]>31.500000000000004?Le=-.09996887746328006:t[9]>2.5000000000000004?Le=.02157682011863397:Le=-.05247727848991843:Le=.07409150201483244:t[1]>38.50000000000001?Le=-.11378466075449625:t[224]>1e-35?Le=-.10741749127732923:t[1]>26.500000000000004?Le=.07343136534146562:Le=-.07013573628594773:t[25]>1e-35?Le=-.04626669734164317:Le=.05518333197956482:Le=.00032434010867555516;let te;t[183]>1e-35?t[10]>1.5000000000000002?t[17]>1e-35?te=.026313251010808853:te=-.08997339150292381:te=.025062509535227952:t[227]>1e-35?t[1]>6.500000000000001?t[2]>9.500000000000002?t[210]>1e-35?te=.08071107515789745:t[23]>1e-35?t[1]>75.50000000000001?te=.0905155504503746:t[8]>1049.5000000000002?te=-.062312558183394054:t[8]>719.5000000000001?te=.09583836191410239:t[0]>3719.5000000000005?te=-.0778097309430818:te=.04012012419054895:t[4]>12.500000000000002?t[8]>1496.5000000000002?t[10]>42.50000000000001?te=-.12920865648544927:t[0]>2699.5000000000005?te=-.07086587879041864:te=.022614182502461846:t[4]>15.500000000000002?t[8]>55.50000000000001?t[1]>60.50000000000001?t[8]>652.5000000000001?te=-.11377786322600797:te=-.009486325820117998:t[1]>55.50000000000001?te=.12430248795958142:t[0]>2952.5000000000005?t[0]>4331.500000000001?t[1]>38.50000000000001?te=-.07938291201004219:t[2]>36.50000000000001?te=.01520046732530246:te=.13649854049662832:te=-.07145015938528873:t[8]>407.50000000000006?te=-.00350257360822279:te=.11332047082193297:te=-.10060624458629897:te=.05429496612497562:t[8]>1446.5000000000002?te=.006073419197482838:te=-.08718676350883998:te=-.11532497988252638:te=.10766270463068293:t[34]>1e-35?te=-.06345912440611544:t[131]>1e-35?t[9]>1.5000000000000002?te=-.0004109812623829506:te=.021601073497455662:te=-7343540098965853e-20;let Te;t[298]>1e-35?t[9]>12.500000000000002?t[133]>1e-35?Te=-.06107663265515864:t[9]>70.50000000000001?t[10]>37.50000000000001?Te=.05995640200798119:t[0]>3443.5000000000005?Te=-.14698883458733583:Te=-.030039164579240187:t[189]>1e-35?Te=-.06086763220538141:t[1]>86.50000000000001?Te=-.05096727866142538:t[4]>64.50000000000001?Te=.11240554253834577:t[4]>45.50000000000001?Te=-.030279760168394117:t[6]>45.50000000000001?Te=.10161088917815142:t[10]>77.50000000000001?Te=-.0792333078055653:t[7]>23.500000000000004?t[0]>2882.5000000000005?Te=-.06672020005240323:Te=.08831457502630258:t[8]>2592.5000000000005?Te=-.052617701047376654:t[10]>29.500000000000004?Te=.08499327690298047:t[2]>12.500000000000002?t[9]>41.50000000000001?Te=.12880460816709416:t[9]>25.500000000000004?t[4]>11.500000000000002?Te=-.064099222705728:Te=.044332487521538365:t[0]>2882.5000000000005?Te=.031099546885005065:Te=.12938467051623853:t[0]>4221.500000000001?Te=-.0928676413498701:t[9]>30.500000000000004?Te=-.05781824812803708:Te=.07561268901778094:t[8]>711.5000000000001?t[2]>22.500000000000004?Te=-.06648105454098469:Te=.05985487552383097:Te=-.13070190291919334:t[116]>1e-35?t[10]>38.50000000000001?Te=.05282385499619401:t[1]>66.50000000000001?Te=.048802929108006314:t[2]>4.500000000000001?t[0]>4593.500000000001?Te=.027885690791379255:Te=-.08407126408362446:Te=.014432924125571093:Te=-9903435845205118e-20;let Ge;t[76]>1e-35?Ge=-.06307875292162934:t[21]>1e-35?t[7]>10.500000000000002?t[10]>4.500000000000001?t[8]>944.5000000000001?t[0]>3655.5000000000005?Ge=.013633653464240465:Ge=-.10164319411983509:Ge=-.1228424374328996:t[1]>26.500000000000004?t[2]>28.500000000000004?Ge=.00632864847804078:Ge=-.08393000368134668:Ge=.07870508617440916:t[284]>1e-35?Ge=.1092302727710421:Ge=-.0025505047582483234:t[248]>1e-35?Ge=.07101822393621864:t[274]>1e-35?Ge=-.06621099406425579:t[1]>26.500000000000004?t[1]>28.500000000000004?Ge=.0003077044909372931:t[10]>2.5000000000000004?t[0]>3770.5000000000005?Ge=.025081789181021243:Ge=-.014813325803582618:t[9]>33.50000000000001?Ge=-.033466921233840194:t[3]>12.500000000000002?t[23]>1e-35?Ge=.11926990418060353:Ge=.01852125513565268:Ge=.0975367595927343:t[5]>3325.5000000000005?t[8]>892.5000000000001?t[133]>1e-35?Ge=-.1178464984373743:t[283]>1e-35?Ge=.043370859226927405:t[5]>4320.500000000001?Ge=-.01103141226366587:t[8]>1104.5000000000002?Ge=-.023053423988095886:Ge=-.0734238953804657:t[6]>18.500000000000004?t[8]>85.50000000000001?Ge=.000579145585864887:Ge=.03389152834202143:t[128]>1e-35?Ge=-.14527722052568462:t[210]>1e-35?Ge=-.08915971541902741:t[7]>9.500000000000002?Ge=-.03307314577076116:t[18]>1e-35?Ge=-.05521712302023565:Ge=.009315605032770029:Ge=.0036332551852289933;let Y;t[0]>689.5000000000001?t[5]>768.5000000000001?t[20]>1e-35?t[5]>4368.500000000001?Y=-.07583539600416284:t[188]>1e-35?Y=-.07042659515500142:t[23]>1e-35?t[0]>3807.5000000000005?Y=-.011038193049597113:Y=.08154028164397753:t[1]>85.50000000000001?Y=.10259361975201933:Y=.011640408330521594:Y=-.00023319159023748508:t[92]>1e-35?Y=.13771692859530546:Y=.022860029819654806:t[1]>22.500000000000004?t[1]>24.500000000000004?t[2]>96.50000000000001?Y=.09967230141007705:t[30]>1e-35?Y=-.08888529037551285:Y=-.008615931385397808:t[10]>5.500000000000001?t[4]>36.50000000000001?Y=.08284665960761373:Y=-.029292565021289504:t[7]>7.500000000000001?Y=-.09945093355204493:Y=-.008381393701708593:t[20]>1e-35?Y=-.04218678460370465:t[10]>6.500000000000001?t[9]>2.5000000000000004?t[1]>13.500000000000002?t[8]>143.50000000000003?t[4]>7.500000000000001?t[2]>36.50000000000001?Y=.07585582641438211:t[8]>284.50000000000006?Y=-.029387993239886723:Y=.07716738177321587:t[1]>18.500000000000004?Y=.026745348497993746:Y=.1427429617069753:t[9]>16.500000000000004?t[9]>33.50000000000001?Y=.02337306890530338:Y=-.10390355904767366:Y=.07390521199638532:Y=-.06788247515155237:Y=-.04201446383470994:t[2]>25.500000000000004?t[2]>29.500000000000004?t[8]>227.50000000000003?Y=-.06360325615644084:Y=.04342192339836601:Y=-.10598779152030145:Y=.05253384605768211;let se;t[3]>7.500000000000001?t[157]>1e-35?se=-.07514182877923786:se=.000636205502279271:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?se=.028692053800951845:se=.14081686716133598:se=-.03316566526940354:t[186]>1e-35?t[0]>2653.5000000000005?se=.0037139292567243084:se=.12662311031652707:t[107]>1e-35?t[0]>612.5000000000001?se=.01202688580305612:se=.0993509141454483:t[203]>1e-35?t[1]>77.50000000000001?se=.043935495082738626:se=-.05639305759669704:t[247]>1e-35?se=-.06770766046891649:t[105]>1e-35?t[19]>1e-35?se=.10331836202616368:se=.0006926658459781341:t[96]>1e-35?se=.05361846065599475:t[127]>1e-35?t[0]>2723.5000000000005?t[1]>54.50000000000001?se=-.0741403257305367:se=.022900127535540854:t[7]>3.5000000000000004?se=.038110741403836294:se=.14618649985842758:t[5]>3921.5000000000005?t[1]>110.50000000000001?se=-.09552842289807008:t[1]>27.500000000000004?se=.012505935885798007:se=-.020509603428689526:t[282]>1e-35?t[9]>45.50000000000001?t[6]>5.500000000000001?se=-.1046104767723845:se=.031388606992301074:t[8]>114.50000000000001?t[9]>17.500000000000004?t[9]>22.500000000000004?t[1]>32.50000000000001?se=.023466328488582572:se=.11730925774586994:se=-.04771965631104874:se=.17059689880751394:se=-.08181850955999449:t[26]>1e-35?se=-.12727482696678769:se=-.014343123272734182;let he;t[147]>1e-35?t[1]>53.50000000000001?he=-.0993064321015924:t[0]>2604.5000000000005?t[0]>3629.5000000000005?he=-.02763546051134888:he=.06423344777499343:he=-.064606430904295:t[302]>1e-35?t[10]>2.5000000000000004?t[10]>47.50000000000001?he=.049825139823021586:t[7]>22.500000000000004?he=-.01131680751379858:t[0]>2579.5000000000005?he=-.10673674485369694:he=-.015387212937189957:he=.04347325151148724:t[179]>1e-35?he=-.05788885608624092:t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?he=.0650355590939066:he=-.0473332870892226:he=-.09699315983340703:t[288]>1e-35?t[88]>1e-35?he=.11139543329789044:t[126]>1e-35?he=-.09726928633696198:t[8]>149.50000000000003?t[9]>46.50000000000001?t[4]>1.5000000000000002?t[8]>1861.5000000000002?he=.06370903833231022:t[10]>29.500000000000004?he=.03415223859607161:t[10]>3.5000000000000004?he=-.07415518117873297:he=-.0014119203473324082:he=.12617652343819508:t[9]>41.50000000000001?he=-.10311145857176976:t[8]>2757.5000000000005?he=-.08106484219011428:t[7]>71.50000000000001?he=-.09783384432091176:t[1]>88.50000000000001?he=.06249739709782831:t[3]>9.500000000000002?t[5]>1601.5000000000002?he=-.008884084501608536:he=.061339437777743616:he=-.042490992675121846:t[2]>6.500000000000001?t[3]>10.500000000000002?he=.01526664064166223:he=.13534828515415498:he=-.06985484465894776:he=.0005758961943178744;let Ce;t[86]>1e-35?t[1]>23.500000000000004?t[1]>29.500000000000004?t[4]>16.500000000000004?t[2]>31.500000000000004?Ce=-.029152732370514342:Ce=.07173628916139178:t[1]>36.50000000000001?Ce=-.08859111297255318:Ce=.0018030071815630785:Ce=.13652461563759322:Ce=-.07550137680349367:t[10]>52.50000000000001?t[49]>1e-35?Ce=-.07145140450454163:t[21]>1e-35?Ce=-.07422841663493233:Ce=.006289319702780104:t[10]>40.50000000000001?t[9]>59.50000000000001?t[19]>1e-35?t[13]>1e-35?Ce=.11864240653986852:t[3]>33.50000000000001?Ce=-.08821209591953476:Ce=.05706392280054726:Ce=-.03600088051578915:t[18]>1e-35?t[1]>24.500000000000004?Ce=.01953613016837112:Ce=-.059781039130025006:t[148]>1e-35?Ce=.052668447861325476:t[3]>30.500000000000004?t[9]>49.50000000000001?Ce=.07207826841738371:t[202]>1e-35?Ce=.08163917539410503:Ce=-.01319846363832958:t[9]>35.50000000000001?t[5]>4134.500000000001?t[10]>44.50000000000001?Ce=-.06858280496900336:Ce=-.1781828899516648:Ce=-.04024620133969553:t[9]>10.500000000000002?t[1]>22.500000000000004?t[1]>37.50000000000001?Ce=.018232649414147116:Ce=-.04419781124222661:Ce=.05145485182416554:t[1]>23.500000000000004?t[0]>655.5000000000001?t[5]>4901.500000000001?t[10]>45.50000000000001?Ce=.11452368095776105:Ce=-.036496437259924026:Ce=-.040445338739465486:Ce=.0816572651001145:Ce=-.08968914517368663:Ce=.0002826343082585516;let He;t[189]>1e-35?t[0]>5269.500000000001?He=-.08839493050459957:t[10]>85.50000000000001?He=.10046908365702462:t[8]>2592.5000000000005?He=-.09632233975926387:t[8]>2000.5000000000002?He=.10282992953871627:t[8]>1266.5000000000002?t[9]>34.50000000000001?He=.035504970430426296:t[1]>31.500000000000004?He=-.1133764813142531:He=-.01138280942244812:t[8]>1125.5000000000002?He=.09800530246229806:He=.016170419267589393:t[218]>1e-35?t[9]>99.50000000000001?t[9]>101.50000000000001?t[9]>124.50000000000001?He=.07316772160107896:He=-.059095014819051765:He=.17859437315769733:t[2]>1.5000000000000002?t[9]>86.50000000000001?He=-.09150209066166894:t[8]>3084.0000000000005?He=-.05443972593168094:t[1]>65.50000000000001?t[10]>11.500000000000002?t[9]>33.50000000000001?He=-.04449234460408263:He=.05568837973347338:He=-.12362324875024472:t[1]>41.50000000000001?t[10]>12.500000000000002?t[8]>1336.5000000000002?He=.12741077850267066:He=.007372371864985329:t[2]>39.50000000000001?He=.02295917234617787:He=.14966532083907075:t[1]>39.50000000000001?He=-.06685557815340279:t[10]>22.500000000000004?t[2]>52.50000000000001?He=-.02511861881285652:t[1]>27.500000000000004?He=.08683660011672288:He=.02956214835267301:t[9]>15.500000000000002?He=-.016538805462996232:He=.04352738094981517:He=-.05561856645643868:t[9]>170.50000000000003?He=-.07996752635874248:t[179]>1e-35?He=-.09065975936933919:He=-.00042817975060427177;let $e;t[39]>1e-35?t[4]>25.500000000000004?$e=.03443173196222934:$e=-.06554248341270724:t[32]>1e-35?t[8]>90.50000000000001?t[4]>67.50000000000001?t[4]>86.50000000000001?$e=-.0013415395759330318:$e=.12950978489563347:t[1]>22.500000000000004?t[10]>19.500000000000004?t[4]>30.500000000000004?t[9]>41.50000000000001?$e=.002297618040307216:$e=-.12522800128774994:t[4]>8.500000000000002?t[8]>1075.5000000000002?$e=-.015297257305397608:$e=.09651828834062742:$e=-.06636003334371929:t[10]>11.500000000000002?$e=.17631616138309397:t[0]>1639.5000000000002?$e=3804386478092585e-20:$e=-.09099296398683193:$e=-.06874415876172972:t[0]>2151.5000000000005?$e=-.1311264883406766:$e=.00809052010141122:t[253]>1e-35?$e=-.06338558211939296:t[178]>1e-35?t[2]>25.500000000000004?t[2]>30.500000000000004?t[0]>2151.5000000000005?t[10]>10.500000000000002?t[0]>3615.5000000000005?$e=.045038497754638605:$e=-.07770167665661752:$e=-.08596294280650517:$e=.08538655727027213:$e=.09829076418590559:t[1]>39.50000000000001?t[9]>1.5000000000000002?$e=.054627956617973275:t[1]>61.50000000000001?$e=-.11994465088415499:t[4]>8.500000000000002?$e=.06676200239406452:$e=-.027503148069376867:t[8]>676.5000000000001?$e=-.10363964928357075:t[4]>8.500000000000002?$e=-.07589816227175682:$e=.034664436544646814:t[1]>159.50000000000003?t[6]>25.500000000000004?$e=.009093153189012338:$e=-.06119765876605404:$e=.0004668642103528348;let Xe;t[223]>1e-35?t[1]>31.500000000000004?t[8]>711.5000000000001?Xe=-.10100794502567233:Xe=.08000205636470442:Xe=-.11945419826856896:t[113]>1e-35?Xe=-.06105445938688056:t[167]>1e-35?t[0]>3928.5000000000005?Xe=.1224302423880318:Xe=-.01875566982911468:t[222]>1e-35?t[1]>8.500000000000002?t[1]>24.500000000000004?t[4]>3.5000000000000004?t[0]>725.5000000000001?t[0]>1682.5000000000002?t[0]>2860.5000000000005?Xe=.0019277012166729114:t[1]>28.500000000000004?Xe=-.054445821715687494:Xe=.045645722976713245:t[30]>1e-35?Xe=.13402660155331655:Xe=.008921176001777645:Xe=-.058547426505451076:Xe=.08841202222426625:t[1]>22.500000000000004?t[10]>9.500000000000002?Xe=-.13526418192218206:Xe=-.03266013432583145:t[1]>20.500000000000004?t[4]>27.500000000000004?Xe=.0007263224246135398:Xe=.12450043268647056:t[1]>17.500000000000004?t[9]>1.5000000000000002?Xe=-.11575657261278308:Xe=-.01530376565862095:t[4]>13.500000000000002?t[4]>22.500000000000004?Xe=-.01995960178292952:Xe=.11216586049153021:Xe=-.10050961087149474:Xe=.08848063368485726:t[30]>1e-35?t[224]>1e-35?t[1]>52.50000000000001?Xe=.10303451081526649:Xe=-.01375730267020699:t[1]>28.500000000000004?t[2]>20.500000000000004?Xe=-.043799548968209395:Xe=-.12451444314954115:t[4]>12.500000000000002?Xe=-.03838117361958468:Xe=.06504990789767144:t[57]>1e-35?Xe=.06890006938293915:Xe=.0003914274695562949;let ct;t[53]>1e-35?t[4]>11.500000000000002?t[8]>617.5000000000001?t[2]>41.50000000000001?ct=.004271749009686975:ct=-.10523878297127605:ct=.04633982158107851:ct=-.10349713975483057:t[183]>1e-35?t[15]>1e-35?ct=-.08655730561951676:t[8]>919.5000000000001?ct=-.0676453705610183:t[7]>18.500000000000004?ct=-.027787974193650575:ct=.08012784576991301:t[227]>1e-35?t[1]>6.500000000000001?t[3]>8.500000000000002?t[210]>1e-35?ct=.07185850683316512:t[8]>201.50000000000003?t[8]>348.50000000000006?t[23]>1e-35?t[8]>1049.5000000000002?ct=-.03473877164537313:t[8]>719.5000000000001?ct=.10471053866934404:ct=.008236107678382981:t[4]>57.50000000000001?ct=.09412219478825269:t[10]>66.50000000000001?ct=-.13884338641811986:t[10]>19.500000000000004?t[10]>22.500000000000004?t[0]>2490.5000000000005?ct=-.040681323751002293:ct=.06374650297561021:ct=.12884615227401788:t[10]>5.500000000000001?ct=-.0887517295786972:t[8]>597.5000000000001?t[18]>1e-35?ct=-.05474068967150784:ct=.03744700650806603:ct=-.07846396348680855:t[1]>42.50000000000001?ct=.018972315810821302:ct=.10953621007604744:t[5]>4439.500000000001?ct=.010999776705494586:t[1]>40.50000000000001?ct=-.12394200059775967:t[10]>2.5000000000000004?ct=.013528093962849453:ct=-.09222088417048682:ct=-.12662967149701485:ct=.09327296405849603:t[3]>99.50000000000001?ct=-.013581954439986752:ct=.0005526498251862075;let bt;t[187]>1e-35?t[243]>1e-35?bt=-.08392792551692502:t[10]>68.50000000000001?bt=.07871769409454053:t[10]>8.500000000000002?t[10]>16.500000000000004?t[2]>17.500000000000004?t[3]>31.500000000000004?t[91]>1e-35?t[10]>21.500000000000004?t[10]>33.50000000000001?t[10]>48.50000000000001?bt=-.0825306209711224:bt=.049559996084532945:bt=-.1064938580886302:bt=.03353240732240275:bt=.045985370399163464:t[1]>42.50000000000001?t[4]>20.500000000000004?bt=.16966001471529374:t[1]>57.50000000000001?bt=-.005772777673676247:bt=.09383677041525058:t[8]>747.5000000000001?bt=.054068175469351235:bt=-.049968216310277036:t[8]>753.5000000000001?bt=-.0679383555784074:t[4]>8.500000000000002?bt=-.059757341189735386:bt=.05701083682780414:bt=-.052497281448921164:t[6]>12.500000000000002?t[8]>969.5000000000001?t[4]>23.500000000000004?bt=.05820296128730006:bt=-.1063042385102475:t[1]>49.50000000000001?t[8]>302.50000000000006?bt=.15340611616954566:bt=.04385036188666874:t[0]>4449.500000000001?bt=-.02110897605541555:t[1]>24.500000000000004?t[2]>17.500000000000004?bt=.004840354641006495:bt=.09967827580276283:bt=.11605363537391578:t[9]>19.500000000000004?bt=-.0735831692725717:bt=.019973331823355176:t[306]>1e-35?t[149]>1e-35?bt=-.08968948874343531:t[8]>1094.5000000000002?t[10]>15.500000000000002?bt=-.02442182361342386:bt=.10334853004243093:bt=-.030431948680167104:bt=-956078595250818e-19;let ht;t[294]>1e-35?t[1]>26.500000000000004?t[0]>4078.5000000000005?ht=-.040232505718244854:t[0]>3030.5000000000005?ht=.0634109586813073:ht=-.04043617034245621:ht=-.06385323610738443:t[120]>1e-35?t[4]>18.500000000000004?ht=-.007859096946435131:ht=.07282728486115758:t[229]>1e-35?t[0]>2952.5000000000005?t[17]>1e-35?ht=.05515771679628051:ht=-.04214471312668263:ht=-.09589322222261765:t[193]>1e-35?ht=-.05056345906812831:t[121]>1e-35?t[243]>1e-35?ht=.14857706653119385:t[4]>9.500000000000002?t[1]>26.500000000000004?t[2]>59.50000000000001?ht=-.08152604001147906:t[11]>1e-35?ht=.09132936522356462:t[15]>1e-35?t[4]>23.500000000000004?ht=.13100930780107503:t[10]>25.500000000000004?ht=.05921074710011526:ht=-.07226005736695183:t[0]>3304.5000000000005?t[0]>3707.5000000000005?t[0]>4053.5000000000005?ht=.0009447118243153454:ht=-.09820565036865991:ht=.057146909749745546:t[0]>2115.5000000000005?ht=-.12331216726611678:ht=.007281983677694285:t[2]>56.50000000000001?ht=.012310154675612615:ht=-.08873665774670461:t[6]>25.500000000000004?ht=.134708740821879:t[9]>5.500000000000001?ht=-.0805901581148979:t[224]>1e-35?ht=-.063684477784257:t[7]>2.5000000000000004?t[19]>1e-35?ht=.10842593386554122:t[2]>13.500000000000002?ht=.06466798320378395:ht=-.08578130788886655:ht=-.03590892078300114:ht=.0003499894043880708;let We;t[134]>1e-35?t[6]>50.50000000000001?t[0]>3601.5000000000005?We=.10839808814624702:We=-.028043875308180352:t[7]>30.500000000000004?t[8]>932.5000000000001?We=-.007478368069393829:We=-.09066751344326617:t[0]>3588.5000000000005?t[5]>4748.500000000001?We=.04035247751736232:t[0]>4255.500000000001?We=-.1310865624507367:t[0]>4004.5000000000005?We=.06647367311982634:We=-.08339693352955757:t[4]>10.500000000000002?t[1]>34.50000000000001?We=-.011618902907510411:We=.1114646660406691:t[10]>2.5000000000000004?t[0]>3072.5000000000005?We=.09356028223727986:We=-.03811765057032162:We=-.09456215497345526:t[280]>1e-35?t[7]>70.50000000000001?We=.10322956436499003:t[2]>22.500000000000004?t[1]>83.50000000000001?We=.1146142460964847:t[1]>62.50000000000001?We=-.09679869865322362:t[9]>71.50000000000001?We=-.07377580769927583:t[4]>19.500000000000004?t[0]>4571.500000000001?We=-.039046426387852974:We=.04558778688367152:We=.11220830937352602:t[7]>5.500000000000001?t[9]>17.500000000000004?t[8]>1067.5000000000002?We=.03261697816211156:t[15]>1e-35?We=.02586252542264368:t[2]>14.500000000000002?We=-.016420452667484604:We=-.1011799626006976:We=-.13787471318963773:t[6]>4.500000000000001?t[8]>427.50000000000006?t[10]>36.50000000000001?We=.010193588102560583:We=.11748729525930773:We=-.04468162226743652:We=-.028365274393617957:t[71]>1e-35?We=.05115139346588793:We=-.0001510425316936658;let ce;t[298]>1e-35?t[8]>81.50000000000001?t[8]>119.50000000000001?t[4]>64.50000000000001?ce=.09072192054181037:t[9]>72.50000000000001?t[8]>1094.5000000000002?ce=.020637047900190317:ce=-.1017300802134141:t[1]>23.500000000000004?t[9]>12.500000000000002?t[0]>2815.5000000000005?t[0]>3183.5000000000005?t[3]>23.500000000000004?t[3]>45.50000000000001?t[4]>48.50000000000001?ce=-.04632587527094407:ce=.08603684785510396:ce=-.05101401015448496:ce=.025466432054358498:ce=-.07897811963329214:t[6]>13.500000000000002?t[10]>26.500000000000004?ce=.020385355430046367:ce=.12032592051335252:ce=-.012387370292173013:t[2]>23.500000000000004?ce=-.12568545484492677:ce=-.022261190943521976:t[8]>634.5000000000001?t[8]>857.5000000000001?ce=.043528764484784536:ce=.14352071657196003:ce=-.009332833816977268:ce=.11186782227735846:ce=-.0737365712425554:t[136]>1e-35?t[0]>1937.5000000000002?ce=-.05649104643152564:ce=.03884200719305747:t[42]>1e-35?ce=-.07191700385792335:t[116]>1e-35?t[9]>2.5000000000000004?t[9]>17.500000000000004?ce=-.04103416502526736:ce=.04881823954656287:t[4]>15.500000000000002?ce=.009342724662897898:t[0]>3969.5000000000005?ce=-.025637309961309498:ce=-.12574492012987865:t[212]>1e-35?t[19]>1e-35?ce=-.08185697075265091:t[0]>2215.5000000000005?ce=.030063975892297354:t[0]>807.5000000000001?ce=-.03924325550733229:ce=.0415330999189793:ce=-.00024374664461674863;let Re;t[3]>7.500000000000001?Re=.0005117490419655908:t[129]>1e-35?t[0]>2904.5000000000005?t[0]>4004.5000000000005?Re=.025798416259686565:Re=.13251610353146012:Re=-.029900559552677654:t[1]>81.50000000000001?t[1]>110.50000000000001?t[0]>4242.500000000001?Re=-.11098564237775424:Re=25960925309712775e-21:t[0]>4177.500000000001?t[9]>35.50000000000001?Re=.15347826616466054:t[3]>4.500000000000001?Re=.10379320730958941:Re=-.008896303020010654:t[0]>3415.5000000000005?t[0]>3830.5000000000005?Re=.03159791088468647:Re=-.10612873364104258:Re=.05059856107348746:t[133]>1e-35?t[2]>5.500000000000001?Re=-.02335760775001469:Re=-.1379386577903324:t[1]>62.50000000000001?t[3]>2.5000000000000004?Re=-.011164334474672973:Re=-.06594044410501655:t[207]>1e-35?Re=-.1014214372326535:t[8]>3.5000000000000004?t[107]>1e-35?t[2]>6.500000000000001?Re=-.01725821503981916:Re=.05594086838700241:t[203]>1e-35?t[1]>44.50000000000001?t[1]>51.50000000000001?Re=-.04226531631656534:Re=-.14409800530171432:Re=-.03245576341206398:t[8]>4214.500000000001?Re=.0895409165534886:t[247]>1e-35?Re=-.06506383629143335:t[118]>1e-35?Re=-.07214270121257443:t[8]>546.5000000000001?Re=-.004385020865473831:Re=.009321812545248529:t[0]>1639.5000000000002?t[13]>1e-35?Re=.046278501133958524:Re=-.030835570926968044:t[0]>493.50000000000006?Re=-.12794504651610425:Re=.009415039807550776;let Me;t[304]>1e-35?Me=-.04717777269217453:t[76]>1e-35?Me=-.05813439142128324:t[1]>59.50000000000001?t[0]>350.50000000000006?t[53]>1e-35?Me=-.09648224457374217:t[132]>1e-35?Me=.07089308107910267:t[0]>2248.5000000000005?t[5]>2525.5000000000005?t[9]>1.5000000000000002?t[114]>1e-35?Me=-.08595213071749083:t[9]>14.500000000000002?t[9]>33.50000000000001?t[285]>1e-35?Me=.10838431695638147:t[230]>1e-35?Me=.06458713915750626:t[0]>3219.5000000000005?t[3]>23.500000000000004?t[9]>69.50000000000001?Me=.050071316251979:Me=-.006356941111525215:t[6]>8.500000000000002?Me=-.0384814076434817:t[1]>73.50000000000001?t[0]>3746.5000000000005?Me=.10217402850540398:Me=-.048840949025349197:Me=-.03668313197909846:t[7]>39.50000000000001?Me=-.0562642841496003:t[10]>2.5000000000000004?Me=.09749777369987417:Me=-.04848223121417616:t[0]>5453.500000000001?Me=.08316648226133942:Me=-.0261979698267618:t[212]>1e-35?Me=.09565573198318654:t[5]>4814.500000000001?t[8]>963.5000000000001?t[8]>1514.5000000000002?Me=.04837009746506856:Me=-.09184360565631328:Me=.0032411047845613606:t[0]>4733.500000000001?Me=.0977378556864798:Me=.010776545559325588:Me=-.012483310473120218:Me=-.049284121449103935:Me=.011962641341789565:t[1]>67.50000000000001?t[1]>77.50000000000001?Me=-.08380361910948711:Me=.07375088778585813:Me=-.1084864186071348:Me=.0007819503469605476;let ge;t[7]>17.500000000000004?t[115]>1e-35?ge=.08741852531696623:t[167]>1e-35?ge=.10078975495600809:ge=-.0018324767784017562:t[290]>1e-35?ge=-.0850089851255888:t[74]>1e-35?t[10]>16.500000000000004?ge=.1379733311640402:ge=-.0038500648529631075:t[6]>29.500000000000004?t[8]>876.5000000000001?t[0]>3129.5000000000005?t[9]>5.500000000000001?t[8]>1765.5000000000002?ge=-.09360083033774169:ge=.061471353193188374:t[10]>11.500000000000002?t[10]>31.500000000000004?ge=-.015599362579530679:t[0]>4593.500000000001?ge=-.12029549262691491:ge=-.018917032256501397:ge=.04632831686576592:ge=.06892347785444271:t[4]>8.500000000000002?t[10]>33.50000000000001?ge=-.05894883236412263:ge=.05213944998315824:ge=.12621779223564986:t[243]>1e-35?t[6]>16.500000000000004?t[0]>4141.500000000001?t[0]>5850.500000000001?ge=.07577412405680808:ge=-.053144737214742235:t[1]>29.500000000000004?t[9]>16.500000000000004?ge=-.0277076900736147:t[1]>65.50000000000001?ge=-.023587471585763506:ge=.10184896592433082:ge=-.057699270527916825:ge=-.041191811945739454:t[114]>1e-35?t[2]>23.500000000000004?ge=.06566902102799584:t[10]>25.500000000000004?ge=-.07033633753181047:ge=-.01599120398351932:t[242]>1e-35?t[0]>2402.5000000000005?ge=-.08108035861059537:ge=.04184690010531078:t[35]>1e-35?t[0]>2904.5000000000005?ge=-.12431182772561139:ge=.01886235886984271:ge=.0025579594894418116;let oe;t[8]>2915.5000000000005?t[101]>1e-35?oe=.08648323956719083:t[0]>93.50000000000001?t[196]>1e-35?oe=-.09509320772734361:t[4]>1.5000000000000002?t[5]>1106.5000000000002?t[5]>1191.5000000000002?t[283]>1e-35?oe=-.11268313808648661:t[10]>12.500000000000002?t[131]>1e-35?oe=.0687641681341721:t[10]>102.50000000000001?oe=-.09667920080214842:t[4]>15.500000000000002?t[8]>2992.5000000000005?t[1]>24.500000000000004?t[1]>71.50000000000001?oe=-.06762578396473291:t[10]>65.50000000000001?oe=-.05226727783610509:t[282]>1e-35?oe=.09911438410640917:t[19]>1e-35?oe=.06915156336429933:oe=-.006565637886508241:oe=-.08344300251849307:oe=-.0928863907927501:t[1]>60.50000000000001?t[2]>17.500000000000004?oe=.19428463865406298:oe=.016073883020956765:t[13]>1e-35?oe=.06864077097923665:oe=-.01388867527034731:t[0]>1847.5000000000002?oe=.004655280608161356:t[1]>40.50000000000001?oe=.031406054057765996:oe=.12798062439212832:oe=.09859670536264255:t[10]>2.5000000000000004?t[9]>68.50000000000001?oe=.08821759640665892:t[9]>32.50000000000001?t[8]>3960.0000000000005?t[1]>31.500000000000004?oe=-.0706095614785733:oe=.04227164041372561:oe=-.1056906923176064:t[2]>8.500000000000002?t[19]>1e-35?oe=-.07139533369873902:oe=.008952586782921625:oe=.06086212582180936:oe=-.0816938490403437:oe=-.051224901945956025:oe=-.10525399124186095:oe=.000270924147208224;let ze;t[122]>1e-35?t[0]>2461.5000000000005?t[2]>36.50000000000001?ze=.029186512383291244:t[7]>1.5000000000000002?ze=-.14984127276725573:t[1]>40.50000000000001?ze=.032757060730648144:ze=-.07675575422749602:t[6]>8.500000000000002?ze=.10599766037117893:ze=-.0541423394552156:t[1]>24.500000000000004?t[103]>1e-35?t[8]>61.50000000000001?t[17]>1e-35?ze=-.051394622947855385:ze=.03237141302699347:ze=.12526173027943244:ze=.000579473126472788:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?ze=-.07383912482657777:t[0]>5147.500000000001?ze=.07008813937042091:t[10]>38.50000000000001?ze=-.06779203808365307:ze=-.013782769999524498:ze=.0880038869117715:ze=-.12846294176070952:t[281]>1e-35?ze=-.06810806903850834:t[10]>227.50000000000003?ze=-.08937977001661111:t[10]>130.50000000000003?ze=.10538920632708033:t[145]>1e-35?t[4]>6.500000000000001?t[9]>16.500000000000004?t[4]>18.500000000000004?ze=.011036530162093841:ze=-.11500797478569702:ze=.03702229366129399:ze=.07242026683784307:t[189]>1e-35?ze=.03331407112090286:t[9]>33.50000000000001?t[201]>1e-35?ze=.08979610115743614:t[7]>57.50000000000001?t[1]>20.500000000000004?ze=-.02608892716555304:ze=.09609599320761308:t[9]>105.50000000000001?ze=-.06848127135991534:ze=.0023675721254089715:t[86]>1e-35?ze=-.11049635625500497:ze=-.004847764219432233;let at;t[125]>1e-35?t[0]>3969.5000000000005?at=-.09462233499115416:at=.05235324508465096:t[17]>1e-35?t[49]>1e-35?t[10]>19.500000000000004?at=-.030700661288166148:at=.0870883677166864:t[10]>3.5000000000000004?t[3]>18.500000000000004?t[0]>3544.5000000000005?t[188]>1e-35?t[9]>7.500000000000001?at=.03149547314036763:at=-.08166208257451366:t[0]>5850.500000000001?at=-.10228136324773157:t[102]>1e-35?at=-.10572585290676295:t[8]>726.5000000000001?t[5]>3657.5000000000005?at=.01782894842128785:t[13]>1e-35?at=.002680190260979968:at=.1773965720476949:t[2]>72.50000000000001?at=.09090831938627947:t[1]>59.50000000000001?at=-.12297206702816128:t[0]>4977.500000000001?at=.09899015653118268:at=-.022207141540838887:t[4]>32.50000000000001?t[1]>34.50000000000001?at=-.0675900954187773:at=.012336403425364092:at=-.0017002325391924573:t[6]>7.500000000000001?t[1]>17.500000000000004?at=-.02671721777458802:at=-.09242452991958029:t[284]>1e-35?at=-.08585691288582491:at=.013332890564324447:t[4]>14.500000000000002?at=-.005245022074799553:t[23]>1e-35?at=-.020036720167235768:t[1]>29.500000000000004?t[114]>1e-35?at=-.09289852307936758:t[116]>1e-35?at=-.09686573010015055:t[8]>804.5000000000001?at=.03812547148215318:at=.005162744968176633:t[9]>43.50000000000001?at=-.059246106396159376:at=.050370113808135275:at=.000794041852811028;let $t;t[3]>7.500000000000001?$t=.0004981426543104341:t[9]>114.50000000000001?$t=.05666010099424601:t[129]>1e-35?t[6]>3.5000000000000004?$t=-.019061766497948867:$t=.07193491146561211:t[186]>1e-35?t[0]>2653.5000000000005?$t=-.006044199577160493:$t=.1147136801028133:t[6]>85.50000000000001?t[8]>847.5000000000001?$t=.11486607015912494:t[9]>16.500000000000004?$t=-.08686820858087294:$t=.06119632492911875:t[127]>1e-35?t[0]>2723.5000000000005?t[0]>3682.5000000000005?t[1]>38.50000000000001?$t=-.022230207980026437:$t=.1056683690528792:$t=-.05859530800943035:$t=.06970608927597141:t[7]>3.5000000000000004?t[105]>1e-35?$t=.08073568184886762:t[107]>1e-35?t[2]>6.500000000000001?$t=-.05177544573528314:$t=.05370469772149028:t[1]>35.50000000000001?t[0]>4106.500000000001?t[9]>46.50000000000001?t[0]>4633.500000000001?$t=.15159657923771555:$t=-.0060542654587671055:t[9]>5.500000000000001?$t=-.042808028205051786:t[1]>48.50000000000001?$t=-.010449538258110742:$t=.10026907521968294:$t=-.04249349329714756:t[9]>42.50000000000001?t[1]>19.500000000000004?t[8]>852.5000000000001?$t=-.02272452389409874:$t=-.11202691218244319:t[5]>1809.5000000000002?$t=-.04460413584255906:$t=.08196329474205256:t[10]>69.50000000000001?$t=.10221481166238167:$t=.0004063052701699382:t[243]>1e-35?$t=-.07563941678849846:t[18]>1e-35?$t=.02563513231103432:$t=-.004740081147303786;let gr;t[84]>1e-35?t[9]>6.500000000000001?t[2]>43.50000000000001?gr=.057446442918106:gr=-.04404018270156349:gr=-.09282976714550464:t[0]>384.50000000000006?t[204]>1e-35?t[1]>62.50000000000001?gr=-.05930486238817954:t[1]>29.500000000000004?gr=.06955866121256543:t[8]>597.5000000000001?gr=-.06538593556505168:gr=.06212512595497445:gr=.00021102929959182257:t[9]>90.50000000000001?gr=.0958061289119631:t[102]>1e-35?gr=.07172059675638813:t[1]>47.50000000000001?gr=-.03879798603977766:t[297]>1e-35?gr=.054948234271956144:t[282]>1e-35?t[2]>6.500000000000001?gr=.003805910996312012:gr=.09304295674749524:t[11]>1e-35?t[18]>1e-35?gr=.11252376801858695:t[288]>1e-35?gr=-.10293901912180432:gr=.014669268837893872:t[1]>42.50000000000001?gr=-.05988274123836837:t[145]>1e-35?gr=.06142784665288495:t[3]>1.5000000000000002?t[4]>4.500000000000001?t[1]>21.500000000000004?t[1]>27.500000000000004?t[9]>24.500000000000004?gr=.038791154988529926:t[10]>22.500000000000004?t[2]>19.500000000000004?gr=-.03366718308159971:gr=.11936550608549797:t[1]>31.500000000000004?gr=-.07454716789539667:gr=.027859650621164217:t[10]>10.500000000000002?gr=-.11806374092321247:gr=-.03506042229223101:gr=-.0007080765837654515:t[10]>6.500000000000001?gr=-.028077713664996503:t[2]>7.500000000000001?gr=.15803724124216814:gr=.0351381284833169:gr=-.07877953381054767;let sr;t[131]>1e-35?t[282]>1e-35?t[4]>23.500000000000004?sr=.14144941521975005:sr=.0007727806714190652:t[9]>1.5000000000000002?t[8]>2134.5000000000005?t[2]>34.50000000000001?sr=.10514088112381886:t[7]>18.500000000000004?sr=-.10370643555956745:sr=.04093594315421388:t[6]>15.500000000000002?t[4]>9.500000000000002?t[10]>27.500000000000004?t[10]>71.50000000000001?sr=-.0508129468802936:t[224]>1e-35?sr=-.037816066368733595:t[10]>43.50000000000001?sr=.07793408602607932:sr=.017646166646099453:t[9]>3.5000000000000004?t[9]>29.500000000000004?t[17]>1e-35?sr=.036972453794202324:sr=-.08727431092411866:t[8]>427.50000000000006?t[8]>1278.5000000000002?sr=.09475302525132188:sr=-.03580104945898193:sr=.08349488283861875:t[10]>3.5000000000000004?t[0]>1847.5000000000002?t[0]>4280.500000000001?t[2]>27.500000000000004?sr=-.1282448778804823:sr=-.014395808269207212:sr=-.008940927190750592:sr=-.1459118815453748:t[0]>4897.500000000001?sr=-.09733068457286576:t[1]>57.50000000000001?sr=.06575271409540207:sr=-.019556422817450115:sr=-.10623959222984136:t[18]>1e-35?sr=.11280940901275241:t[8]>319.50000000000006?t[2]>6.500000000000001?sr=.008125645893104896:sr=-.11084368630465868:sr=.0584398731508786:t[0]>350.50000000000006?t[3]>83.50000000000001?sr=-.05854904579626861:t[4]>5.500000000000001?sr=.02985784951394175:sr=-.03247600140149334:sr=-.11152899295304973:sr=-.00035424577714215764;let Mr;t[32]>1e-35?t[17]>1e-35?t[8]>359.50000000000006?t[8]>804.5000000000001?Mr=-.06563670567578264:Mr=.067656954313663:Mr=-.10388217548685377:t[8]>2302.5000000000005?Mr=.07190621943790435:t[4]>67.50000000000001?Mr=.060020507643618604:t[4]>38.50000000000001?Mr=-.08707253184321638:t[2]>11.500000000000002?t[2]>16.500000000000004?t[1]>31.500000000000004?t[1]>59.50000000000001?Mr=-.06568134366461277:t[8]>1075.5000000000002?Mr=-.004768057709758692:Mr=.11785959165999467:Mr=-.05080221682879267:Mr=.14814206127494542:Mr=-.07241946332311736:t[253]>1e-35?Mr=-.058893562861261274:t[4]>61.50000000000001?t[283]>1e-35?t[10]>23.500000000000004?Mr=-.02471195342450034:Mr=.11866056464409412:t[10]>44.50000000000001?t[1]>16.500000000000004?t[8]>2640.0000000000005?Mr=-.10741850739482771:Mr=.010051635824944:Mr=.12502069436017124:t[8]>1971.5000000000002?t[1]>23.500000000000004?t[308]>1e-35?Mr=.10511236013756364:t[10]>10.500000000000002?t[1]>53.50000000000001?Mr=-.08992396138178163:Mr=.010944365997007212:Mr=.06221307021813793:Mr=.1286024087559141:t[127]>1e-35?Mr=.06568148624531012:t[10]>40.50000000000001?Mr=-.07567979134643352:t[5]>5647.500000000001?Mr=.07594672895572069:Mr=-.018158016446439187:t[6]>55.50000000000001?Mr=.009293422430111872:t[4]>45.50000000000001?Mr=-.017749818406964022:t[2]>46.50000000000001?Mr=.01714136511113982:Mr=-724762291423549e-19;let Hr;t[1]>24.500000000000004?t[103]>1e-35?t[8]>48.50000000000001?t[17]>1e-35?Hr=-.048689215588703864:t[9]>27.500000000000004?t[0]>3916.5000000000005?Hr=.07084726276890757:Hr=-.11232323677722932:Hr=.04812773089510436:Hr=.11757502216780046:t[5]>1464.5000000000002?t[5]>1505.5000000000002?t[167]>1e-35?Hr=.07470606002425358:t[1]>53.50000000000001?t[132]>1e-35?Hr=.0879462816013881:Hr=-.002966662093626573:t[306]>1e-35?Hr=-.04588085188342676:Hr=.0031910005157084823:t[3]>10.500000000000002?t[10]>20.500000000000004?Hr=-.006600332774461143:Hr=.1272481351557754:Hr=-.09030973597154808:t[284]>1e-35?t[1]>38.50000000000001?t[10]>2.5000000000000004?Hr=.011884312066620044:Hr=.11678751052403374:t[4]>8.500000000000002?Hr=.03627129613273813:Hr=-.12132783497902287:Hr=-.006784372643244717:t[18]>1e-35?t[3]>4.500000000000001?t[3]>6.500000000000001?t[0]>5453.500000000001?Hr=-.06830131718398992:t[0]>5147.500000000001?Hr=.062360406249609306:t[4]>4.500000000000001?Hr=-.013162203864592055:Hr=-.07153029184927609:Hr=.07628618062271557:Hr=-.12085065687320373:t[190]>1e-35?Hr=-.045816889524231186:t[137]>1e-35?Hr=-.07956001795911584:t[199]>1e-35?t[0]>3853.5000000000005?Hr=.025895337822752502:Hr=-.06503949350616421:t[10]>227.50000000000003?Hr=-.09989456525790491:t[10]>130.50000000000003?Hr=.08616651057030683:Hr=.0001234981796706021;let Gr;t[8]>1014.5000000000001?t[9]>137.50000000000003?Gr=-.08778879924617534:t[8]>1022.5000000000001?t[285]>1e-35?t[9]>64.50000000000001?Gr=.04955806187281689:t[0]>3670.5000000000005?t[10]>32.50000000000001?Gr=-.141732381961068:Gr=-.0317152307496497:Gr=-.02074638849097191:t[0]>93.50000000000001?t[0]>3072.5000000000005?t[10]>100.50000000000001?t[4]>24.500000000000004?t[8]>1336.5000000000002?Gr=.12191801556691254:Gr=-.0003444689085397977:Gr=.005739668504631604:t[146]>1e-35?t[308]>1e-35?Gr=.015237524791728777:t[6]>61.50000000000001?t[4]>63.50000000000001?Gr=-.05676033995381961:Gr=.10933961076803381:t[4]>26.500000000000004?Gr=-.11667582544549814:t[8]>1765.5000000000002?Gr=.032174455312047705:Gr=-.0755016390126608:t[293]>1e-35?Gr=-.08234885407658332:t[9]>41.50000000000001?t[0]>3830.5000000000005?Gr=.026571311956824436:t[15]>1e-35?Gr=.06175459479851121:Gr=-.018778084411148754:t[9]>40.50000000000001?Gr=-.09420232889965811:Gr=-.004578248021263184:t[2]>1.5000000000000002?Gr=.005453714644971445:Gr=-.03907138175699279:Gr=-.055296364182154736:t[23]>1e-35?Gr=.036555134842143476:t[0]>4188.500000000001?t[6]>29.500000000000004?Gr=-.09358146510580179:Gr=.060524657996178094:Gr=-.11245101144669545:t[125]>1e-35?t[9]>1.5000000000000002?Gr=-.12698331085931538:Gr=.006059605604079918:t[2]>196.50000000000003?Gr=-.09451315810804783:Gr=.0011390147031687425;let zt;t[8]>2830.5000000000005?t[1]>31.500000000000004?t[9]>32.50000000000001?t[5]>1234.5000000000002?t[8]>3794.5000000000005?zt=.05517359070460923:zt=-.04758751221404857:zt=-.09482078194138792:t[8]>2992.5000000000005?t[1]>101.50000000000001?zt=.1040436595565776:t[9]>21.500000000000004?zt=.04032250517675179:t[107]>1e-35?zt=.05978752253058374:t[210]>1e-35?t[4]>37.50000000000001?zt=.1192453009230486:t[1]>51.50000000000001?zt=.0443376336292195:zt=-.07967674833321865:t[5]>2117.5000000000005?t[9]>10.500000000000002?zt=-.10025078607591283:t[0]>2882.5000000000005?t[18]>1e-35?zt=-.08999822408398037:zt=.017533219253893447:t[9]>1.5000000000000002?t[4]>12.500000000000002?zt=-.061850439226075:zt=.08849196353361093:zt=.10536348167793089:t[92]>1e-35?zt=.04894947712119185:t[9]>16.500000000000004?zt=.05900227903883853:t[9]>5.500000000000001?zt=-.11946594348916476:zt=-.03652096348071964:t[1]>41.50000000000001?zt=-.07411603110840567:zt=-.00021033247574340914:t[10]>22.500000000000004?t[9]>68.50000000000001?zt=.08493634342741495:t[11]>1e-35?zt=-.10899097825564363:zt=-.006156708838964173:t[8]>3198.5000000000005?t[2]>41.50000000000001?zt=.08356655906359918:t[7]>25.500000000000004?zt=-.09475076526194888:t[10]>5.500000000000001?zt=-.01999406228763778:zt=.06696212545889428:t[6]>20.500000000000004?zt=.14713592661393468:zt=.0459917279002218:zt=.00027445928493734093;let _r;t[223]>1e-35?t[1]>31.500000000000004?t[8]>634.5000000000001?_r=-.06904501553217077:_r=.05696231672035904:_r=-.1124703178077813:t[99]>1e-35?t[1]>89.50000000000001?_r=-.05074261170009721:t[1]>57.50000000000001?t[8]>969.5000000000001?_r=-.011419256378538392:t[0]>3830.5000000000005?_r=.140315841503076:_r=.02403434913963024:t[1]>31.500000000000004?t[8]>65.50000000000001?t[2]>10.500000000000002?_r=-.04027822909411164:_r=.03176085103667189:_r=.06779515865838849:t[4]>15.500000000000002?_r=.0762878389015175:t[8]>175.50000000000003?t[0]>3030.5000000000005?t[8]>1041.5000000000002?_r=.06124039747298539:_r=-.04312732764434027:_r=.09161522761808062:_r=-.09663512235460074:t[280]>1e-35?t[6]>45.50000000000001?t[1]>46.50000000000001?_r=.11211681010488772:t[13]>1e-35?_r=.06725735814960367:_r=-.046744031455827846:t[10]>44.50000000000001?t[0]>3400.5000000000005?t[0]>4004.5000000000005?t[2]>22.500000000000004?_r=.11743605068905603:_r=-.011309033539148687:_r=-.07896094707523052:_r=.12862714793172117:t[10]>1.5000000000000002?t[8]>455.50000000000006?t[0]>4706.500000000001?_r=-.09218756798869711:t[10]>19.500000000000004?t[0]>1894.5000000000002?t[0]>3719.5000000000005?_r=.02836295848998302:_r=.12210680366745175:_r=-.058302317470509096:t[5]>4144.500000000001?_r=.06123341960495106:_r=-.03840046906926525:_r=-.05221474543453495:_r=.03988215485860711:_r=-.00033074684693083496;let Pm=uQs(e+r+n+o+s+c+l+u+d+f+h+m+g+A+y+E+_+v+b+T+w+R+x+P+D+N+B+L+j+M+O+q+Q+U+z+W+$+J+ne+H+re+ae+Oe+ve+Fe+Pe+Z+ee+K+pe+X+ue+qe+ie+le+Ne+we+Be+tt+st+Et+kt+Gt+jt+Ie+F+be+Ue+de+Se+Le+te+Te+Ge+Y+se+he+Ce+He+$e+Xe+ct+bt+ht+We+ce+Re+Me+ge+oe+ze+at+$t+gr+sr+Mr+Hr+Gr+zt+_r);return[1-Pm,Pm]}a(vYn,"multilineModelPredict");function uQs(t){if(t<0){let e=Math.exp(t);return e/(1+e)}return 1/(1+Math.exp(-t))}a(uQs,"sigmoid");var dQs={javascript:["//"],typescript:["//"],typescriptreact:["//"],javascriptreact:["//"],vue:["//","-->"],php:["//","#"],dart:["//"],go:["//"],cpp:["//"],scss:["//"],csharp:["//"],java:["//"],c:["//"],rust:["//"],python:["#"],markdown:["#","-->"],css:["*/"]},CYn={javascript:1,javascriptreact:2,typescript:3,typescriptreact:4,python:5,go:6,ruby:7};function bYn(t,e,r,n=!0){let o=t.split(` +`);if(n&&(o=o.filter(l=>l.trim().length>0)),Math.abs(e)>o.length||e>=o.length)return!1;e<0&&(e=o.length+e);let s=o[e];return(dQs[r]??[]).some(l=>s.includes(l))}a(bYn,"hasComment");var Qat=class{static{a(this,"PromptFeatures")}constructor(e,r){let[n,o]=this.firstAndLast(e),s=this.firstAndLast(e.trimEnd());this.language=r,this.length=e.length,this.firstLineLength=n.length,this.lastLineLength=o.length,this.lastLineRstripLength=o.trimEnd().length,this.lastLineStripLength=o.trim().length,this.rstripLength=e.trimEnd().length,this.stripLength=e.trim().length,this.rstripLastLineLength=s[1].length,this.rstripLastLineStripLength=s[1].trim().length,this.secondToLastLineHasComment=bYn(e,-2,r),this.rstripSecondToLastLineHasComment=bYn(e.trimEnd(),-2,r),this.prefixEndsWithNewline=e.endsWith(` `),this.lastChar=e.slice(-1),this.rstripLastChar=e.trimEnd().slice(-1),this.firstChar=e[0],this.lstripFirstChar=e.trimStart().slice(0,1)}firstAndLast(e){let r=e.split(` -`),n=r.length,o=r[0],s=r[n-1];return s==""&&n>1&&(s=r[n-2]),[o,s]}},Ilr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Oat(e,n),this.suffixFeatures=new Oat(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(qzn).length+1).fill(0);r[qzn[this.language]??0]=1;let n=new Array(Object.keys(QF).length+1).fill(0);n[QF[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(QF).length+1).fill(0);o[QF[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(QF).length+1).fill(0);s[QF[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(QF).length+1).fill(0);return c[QF[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function FQs(t,e){return new Ilr(t.prefix,t.suffix,e)}a(FQs,"constructMultilineFeatures");function Hzn(t,e){let r=FQs(t,e).constructFeatures();return Qzn(r)[1]}a(Hzn,"requestMultilineScore");p();var xlr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},Bat=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new xlr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new RGe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=LWe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var BA=class{static{a(this,"InlineCompletionManager")}};var Lat=new ge("getCompletions"),x2e="legacy",w2e=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function Fat(t,e,r){t.get(BA).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=Rpe(r.resultType),n.properties.completionsImplementation??=x2e,ht(t,o,n),gt(t,o,R9(n.properties,w2e),n.measurements)}a(Fat,"telemetryShown");function Gzn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=x2e,ht(t,n,r),gt(t,n,R9(r.properties,w2e),r.measurements)}a(Gzn,"telemetryAccepted");function $zn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=x2e,ht(t,n,r),gt(t,n,R9(r.properties,w2e),r.measurements)}a($zn,"telemetryRejected");function Jj(t,e={}){return t.properties.completionsImplementation??=x2e,{...e,telemetryBlob:t}}a(Jj,"mkCanceledResultTelemetry");function ap(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??x2e};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(ik).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(ap,"mkBasicResultTelemetry");function Vzn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=pl()-e.telemetryBlob.issuedTime,n=Rpe(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` -${d.toFixed(2)} ${u}`).join("")??"";return Lat.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),goe(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(Lat.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){ht(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}goe(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(Vzn,"handleGhostTextResultTelemetry");function Rpe(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(Rpe,"resultTypeToString");p();p();p();var UQs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},QQs="ms-vscode.cpptools",qQs="CppCompletionContextProvider";function Wzn(t,e,r,n){(e.includes(qQs)||e.length===1&&e[0]==="*")&&Yzn(t,r,n)}a(Wzn,"fillInCppVSActiveExperiments");function zzn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(QQs))&&Yzn(t,r,n)}a(zzn,"fillInCppVSCodeActiveExperiments");function Yzn(t,e,r){try{let n=UQs,o=t.get(Jt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Dr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Dr.exception(t,n,"fillInCppActiveExperiments")}}a(Yzn,"addActiveExperiments");p();function Uat(t,e,r){try{let n=t.get(Jt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Dr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(Uat,"fillInCSharpActiveExperiments");p();var wlr="fallbackContextProvider",Rlr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function Kzn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(wlr))&&jQs(t,r,n)}a(Kzn,"fillInMultiLanguageActiveExperiments");function jQs(t,e,r){try{let n=HQs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Dr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(jQs,"addActiveExperiments");function HQs(t,e){let r=Rlr,n=t.get(Jt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Dr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(HQs,"getMultiLanguageContextProviderParamsFromExp");p();var GQs="typescript-ai-context-provider";function Jzn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(GQs)))return!1;try{let o=t.get(Jt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Dr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(Jzn,"fillInTsActiveExperiments");p();Ns();var Zzn=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),Xzn=S.Intersect([S.Object({name:S.String(),value:S.String()}),Zzn]),eYn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),Zzn]),$Qs=[Xzn,eYn],VQs=S.Union($Qs),WQs=new Map([["Trait",Ou.Compile(Xzn)],["CodeSnippet",Ou.Compile(eYn)]]),zQs=a(t=>t,"ensureTypesAreEqual");zQs(!0);var YQs=S.Object({contextItems:S.Array(VQs)}),KQs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),klr=S.Object({id:S.String()}),JQs=S.Intersect([klr,KQs]),ZQs=S.Intersect([klr,YQs]),tYn=S.Object({providers:S.Array(JQs)}),rYn=S.Object({providers:S.Array(klr)}),Plr=S.Object({providers:S.Array(ZQs),updating:S.Optional(S.Array(S.String()))}),nYn=S.Intersect([vyn,S.Object({contextItems:S.Optional(Plr)})]);function Qat(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a(Qat,"filterContextItemsByType");function iYn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of WQs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(iYn,"filterSupportedContextItems");function XQs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(XQs,"validateContextItemId");function oYn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??gr();if(!XQs(s)){let c=gr();Dr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=gr();Dr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(oYn,"addOrValidateContextItemsIDs");p();var r0=class{constructor(e=()=>new Dlr){this.createStatistics=e;this.statistics=new nn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},Dlr=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function qat(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(qat,"componentStatisticsToPromptMatcher");var sYn=ce(ti());var n0=class{static{a(this,"ContextProviderRegistry")}},S5=class{static{a(this,"DefaultContextProviders")}},kpe=class extends S5{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Nlr=class extends n0{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Dr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;Uat(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Dr.debug(this.ctx,"Resolving context providers cancelled"),[];zzn(this.ctx,h.map(T=>T[0].id),u,s),Kzn(this.ctx,h.map(T=>T[0].id),u,s),Jzn(this.ctx,h.map(T=>T[0].id),u,s);let g=new sYn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=lCe(this.ctx)&&!a6e(this.ctx)?0:eqs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(r0).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await sln(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")tP(R.reason)||Dr.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Dr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let B=T.resolver.resolveOnTimeout(v);L3t(B)?x.push(...B):B&&x.push(B),x.length>0&&(R.status="partial")}catch(B){Dr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,B)}let[k,D]=iYn(x);D&&Dr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=oYn(this.ctx,k),L={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(L)}this.ctx.get(r0).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Dr.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=aYn(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},Mlr=class extends n0{constructor(r){super();this.delegate=r;this._cachedContextItems=new nn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function jat(t,e){return new Mlr(new Nlr(t,e))}a(jat,"getContextProviderRegistry");function Hat(t,e,r){let n=t.get(r0).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(Hat,"telemetrizeContextItems");function Gat(t){return t.matchScore>0&&t.resolution!=="error"}a(Gat,"matchContextItems");function aYn(t,e){let r=Olr(t,e),n=qt(t,je.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(S5).getIds();return Array.from(new Set([...o,...r,...n]))}a(aYn,"getActiveContextProviders");function Olr(t,e){return lCe(t)?["*"]:t.get(Jt).contextProviders(e)}a(Olr,"getExpContextProviders");function Ppe(t,e){return aYn(t,e).length>0}a(Ppe,"useContextProviderAPI");function eqs(t,e){let r=qt(t,je.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Jt).contextProviderTimeBudget(e)}a(eqs,"getContextProviderTimeBudget");var Cb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new nn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(n0),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var $at=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await k7(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Vat=class extends $at{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex1&&(s=r[n-2]),[o,s]}},jlr=class{static{a(this,"MultilineModelFeatures")}constructor(e,r,n){this.language=n,this.prefixFeatures=new Qat(e,n),this.suffixFeatures=new Qat(r,n)}constructFeatures(){let e=new Array(14).fill(0);e[0]=this.prefixFeatures.length,e[1]=this.prefixFeatures.firstLineLength,e[2]=this.prefixFeatures.lastLineLength,e[3]=this.prefixFeatures.lastLineRstripLength,e[4]=this.prefixFeatures.lastLineStripLength,e[5]=this.prefixFeatures.rstripLength,e[6]=this.prefixFeatures.rstripLastLineLength,e[7]=this.prefixFeatures.rstripLastLineStripLength,e[8]=this.suffixFeatures.length,e[9]=this.suffixFeatures.firstLineLength,e[10]=this.suffixFeatures.lastLineLength,e[11]=this.prefixFeatures.secondToLastLineHasComment?1:0,e[12]=this.prefixFeatures.rstripSecondToLastLineHasComment?1:0,e[13]=this.prefixFeatures.prefixEndsWithNewline?1:0;let r=new Array(Object.keys(CYn).length+1).fill(0);r[CYn[this.language]??0]=1;let n=new Array(Object.keys(NF).length+1).fill(0);n[NF[this.prefixFeatures.lastChar]??0]=1;let o=new Array(Object.keys(NF).length+1).fill(0);o[NF[this.prefixFeatures.rstripLastChar]??0]=1;let s=new Array(Object.keys(NF).length+1).fill(0);s[NF[this.suffixFeatures.firstChar]??0]=1;let c=new Array(Object.keys(NF).length+1).fill(0);return c[NF[this.suffixFeatures.lstripFirstChar]??0]=1,e.concat(r,n,o,s,c)}};function fQs(t,e){return new jlr(t.prefix,t.suffix,e)}a(fQs,"constructMultilineFeatures");function SYn(t,e){let r=fQs(t,e).constructFeatures();return vYn(r)[1]}a(SYn,"requestMultilineScore");p();var Hlr=class t{constructor(e,r){this.index=e;this.documentPrefix=r;this.startOffset=0;this.text="";this.trimCount=0}static{a(this,"StreamingCompletion")}updateText(e){this.text=e}get addedToPrefix(){return this.text.substring(0,this.startOffset)}get effectivePrefix(){return this.documentPrefix+this.addedToPrefix}get effectiveText(){return this.text.substring(this.startOffset)}get isFirstCompletion(){return this.trimCount===0}get firstNewlineOffset(){let e=[...this.text.matchAll(/\r?\n/g)];return e.length>0&&e[0].index===0&&e.shift(),e.length>0?e[0].index:-1}trimAt(e){let r=new t(this.index,this.documentPrefix);return r.startOffset=this.startOffset,r.text=this.text.substring(0,this.startOffset+e),r.trimCount=this.trimCount,this.startOffset+=e,this.trimCount++,r}},qat=class{constructor(e,r,n,o,s,c){this.ctx=e;this.prefix=r;this.languageId=n;this.initialSingleLine=o;this.trimmerLookahead=s;this.cacheFunction=c;this.lineLimit=3;this.completions=new Map}static{a(this,"StreamedCompletionSplitter")}getFinishedCallback(){return async(e,r)=>{let n=r.index??0,o=this.getCompletion(n,e);if(o.isFirstCompletion&&this.initialSingleLine&&o.firstNewlineOffset>=0){let s={yieldSolution:!0,continueStreaming:!0,finishOffset:o.firstNewlineOffset};return o.trimAt(s.finishOffset),r.finished&&await this.trimAll(r,o),s}return r.finished?await this.trimAll(r,o):await this.trimOnce(r,o)}}getCompletion(e,r){let n=this.completions.get(e);return n||(n=new Hlr(e,this.prefix),this.completions.set(e,n)),n.updateText(r),n}async trimOnce(e,r){let n=await this.trim(r);return n===void 0?{yieldSolution:!1,continueStreaming:!0}:r.isFirstCompletion?(r.trimAt(n),{yieldSolution:!0,continueStreaming:!0,finishOffset:n}):(this.cacheCompletion(e,r,n),{yieldSolution:!1,continueStreaming:!0})}async trimAll(e,r){let n,o;do n=await this.trim(r),r.isFirstCompletion?(o=n,r.trimAt(n??r.effectiveText.length)):this.cacheCompletion(e,r,n);while(n!==void 0);return o!==void 0?{yieldSolution:!0,continueStreaming:!0,finishOffset:o}:{yieldSolution:!1,continueStreaming:!0}}async trim(e){return await new mGe(this.languageId,e.effectivePrefix,e.effectiveText,this.lineLimit,this.trimmerLookahead).getCompletionTrimOffset()}cacheCompletion(e,r,n){let o=r.trimAt(n??r.effectiveText.length);if(o.effectiveText.trim()==="")return;let s=aYe(this.ctx,o.effectiveText.trimEnd(),e.getAPIJsonData(),o.index,e.requestId,n!==void 0,e.telemetryData);s.copilotAnnotations=this.adjustedAnnotations(s,r,o),s.generatedChoiceIndex=o.trimCount,this.cacheFunction(o.addedToPrefix,s)}adjustedAnnotations(e,r,n){if(e.copilotAnnotations===void 0)return;let o=n.addedToPrefix.length,c=o+e.completionText.length>=r.text.length,l={};for(let[u,d]of Object.entries(e.copilotAnnotations)){let f=d.filter(h=>h.start_offset-o0).map(h=>{let m={...h};return m.start_offset-=o,m.stop_offset-=o,c||(m.stop_offset=Math.min(m.stop_offset,e.completionText.length)),m});f.length>0&&(l[u]=f)}return Object.keys(l).length>0?l:void 0}};p();p();var jA=class{static{a(this,"InlineCompletionManager")}};var jat=new Ae("getCompletions"),A2e="legacy",y2e=["activeDocumentLanguageId","afterAccept","afterCursorWhitespace","beforeCursorWhitespace","blockMode","cancelledNetworkRequest","choiceIndex","clientCompletionId","completionsImplementation","contextProviders","disposalReason","endpoint","engineChoiceSource","engineName","headerRequestId","isCycling","isMultiline","isSpeculative","languageId","modelName","n","neighborSource","performanceMetrics","promptMetadata","reason","request_option_code_annotations","request_option_extra","request_option_max_tokens","request_option_n","request_option_stream","request_option_temperature","request_option_top_p","status","temperature","uiKind","acceptance"];function Hat(t,e,r){t.get(jA).triggerSpeculativeRequests(r);let n=r.telemetry,o=`${e}.shown`;n.markAsDisplayed(),n.properties.reason=xpe(r.resultType),n.properties.completionsImplementation??=A2e,yt(t,o,n),_t(t,o,C9(n.properties,y2e),n.measurements)}a(Hat,"telemetryShown");function TYn(t,e,r){let n=`${e}.accepted`;r.properties.completionsImplementation??=A2e,yt(t,n,r),_t(t,n,C9(r.properties,y2e),r.measurements)}a(TYn,"telemetryAccepted");function IYn(t,e,r){let n=`${e}.rejected`;r.properties.completionsImplementation??=A2e,yt(t,n,r),_t(t,n,C9(r.properties,y2e),r.measurements)}a(IYn,"telemetryRejected");function $j(t,e={}){return t.properties.completionsImplementation??=A2e,{...e,telemetryBlob:t}}a($j,"mkCanceledResultTelemetry");function dp(t,e){let r={headerRequestId:t.properties.headerRequestId,copilot_trackingId:t.properties.copilot_trackingId,completionsImplementation:t.properties.completionsImplementation??A2e};t.properties.sku!==void 0&&(r.sku=t.properties.sku),t.properties.opportunityId!==void 0&&(r.opportunityId=t.properties.opportunityId),t.properties.organizations_list!==void 0&&(r.organizations_list=t.properties.organizations_list),t.properties.enterprise_list!==void 0&&(r.enterprise_list=t.properties.enterprise_list),t.properties.clientCompletionId!==void 0&&(r.clientCompletionId=t.properties.clientCompletionId);let n=t.filtersAndExp.exp.assignmentContext;if(e){let s=e.get(rP).inlineCompletionsUnificationState.expAssignments.filter(c=>!n.includes(c));n=[n,...s].filter(Boolean).join(";")}return r["abexp.assignmentcontext"]=n,r}a(dp,"mkBasicResultTelemetry");function xYn(t,e){if(e.type!=="promptOnly"){if(e.type==="success"){let r=dl()-e.telemetryBlob.issuedTime,n=xpe(e.resultType),o=JSON.stringify(e.performanceMetrics),s={...e.telemetryData,reason:n,performanceMetrics:o},{foundOffset:c}=e.telemetryBlob.measurements,l=e.performanceMetrics?.map(([u,d])=>` +${d.toFixed(2)} ${u}`).join("")??"";return jat.debug(t,`ghostText produced from ${n} in ${Math.round(r)}ms with foundOffset ${c}${l}`),loe(t,"ghostText.produced",s,{timeToProduceMs:r,foundOffset:c}),e.value}if(jat.debug(t,"No ghostText produced -- "+e.type+": "+e.reason),e.type==="canceled"){yt(t,"ghostText.canceled",e.telemetryData.telemetryBlob.extendedBy({reason:e.reason,cancelledNetworkRequest:e.telemetryData.cancelledNetworkRequest?"true":"false"}));return}loe(t,`ghostText.${e.type}`,{...e.telemetryData,reason:e.reason},{})}}a(xYn,"handleGhostTextResultTelemetry");function xpe(t){switch(t){case 0:return"network";case 1:return"cache";case 3:return"cycling";case 2:return"typingAsSuggested";case 4:return"async"}}a(xpe,"resultTypeToString");p();p();p();var pQs={maxSnippetLength:3e3,maxSnippetCount:7,enabledFeatures:"Deferred",timeBudgetMs:7,doAggregateSnippets:!0},hQs="ms-vscode.cpptools",mQs="CppCompletionContextProvider";function wYn(t,e,r,n){(e.includes(mQs)||e.length===1&&e[0]==="*")&&PYn(t,r,n)}a(wYn,"fillInCppVSActiveExperiments");function RYn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(hQs))&&PYn(t,r,n)}a(RYn,"fillInCppVSCodeActiveExperiments");function PYn(t,e,r){try{let n=pQs,o=t.get(Jt).cppContextProviderParams(r);if(o)try{n=JSON.parse(o)}catch(s){Dr.error(t,"Failed to parse cppContextProviderParams",s)}for(let[s,c]of Object.entries(n))e.set(s,c)}catch(n){Dr.exception(t,n,"fillInCppActiveExperiments")}}a(PYn,"addActiveExperiments");p();function Gat(t,e,r){try{let n=t.get(Jt).csharpContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Dr.debug(t,"Failed to get the active C# experiments for the Context Provider API",n),!1}return!0}a(Gat,"fillInCSharpActiveExperiments");p();var Glr="fallbackContextProvider",$lr={mlcpMaxContextItems:20,mlcpMaxSymbolMatches:20,mlcpEnableImports:!1};function kYn(t,e,r,n){(e.length===1&&e[0]==="*"||e.includes(Glr))&&gQs(t,r,n)}a(kYn,"fillInMultiLanguageActiveExperiments");function gQs(t,e,r){try{let n=AQs(t,r);for(let[o,s]of Object.entries(n))e.set(o,s)}catch(n){Dr.exception(t,n,"fillInMultiLanguageActiveExperiments")}}a(gQs,"addActiveExperiments");function AQs(t,e){let r=$lr,n=t.get(Jt).multiLanguageContextProviderParams(e);if(n)try{r=JSON.parse(n)}catch(o){Dr.error(t,"Failed to parse multiLanguageContextProviderParams",o)}return r}a(AQs,"getMultiLanguageContextProviderParamsFromExp");p();var yQs="typescript-ai-context-provider";function DYn(t,e,r,n){if(!(e.length===1&&e[0]==="*"||e.includes(yQs)))return!1;try{let o=t.get(Jt).tsContextProviderParams(n);if(o){let s=JSON.parse(o);for(let[c,l]of Object.entries(s))r.set(c,l)}}catch(o){return Dr.debug(t,"Failed to get the active TypeScript experiments for the Context Provider API",o),!1}return!0}a(DYn,"fillInTsActiveExperiments");p();As();var NYn=S.Object({importance:S.Optional(S.Integer({minimum:0,maximum:100})),id:S.Optional(S.String()),origin:S.Optional(S.Union([S.Literal("request"),S.Literal("update")]))}),MYn=S.Intersect([S.Object({name:S.String(),value:S.String()}),NYn]),OYn=S.Intersect([S.Object({uri:S.String(),value:S.String(),additionalUris:S.Optional(S.Array(S.String()))}),NYn]),EQs=[MYn,OYn],_Qs=S.Union(EQs),vQs=new Map([["Trait",Mu.Compile(MYn)],["CodeSnippet",Mu.Compile(OYn)]]),CQs=a(t=>t,"ensureTypesAreEqual");CQs(!0);var bQs=S.Object({contextItems:S.Array(_Qs)}),SQs=S.Object({selector:S.Array(S.Union([S.String(),S.Object({language:S.Optional(S.String()),scheme:S.Optional(S.String()),pattern:S.Optional(S.String())})]))}),Vlr=S.Object({id:S.String()}),TQs=S.Intersect([Vlr,SQs]),IQs=S.Intersect([Vlr,bQs]),BYn=S.Object({providers:S.Array(TQs)}),LYn=S.Object({providers:S.Array(Vlr)}),Wlr=S.Object({providers:S.Array(IQs),updating:S.Optional(S.Array(S.String()))}),FYn=S.Intersect([x_n,S.Object({contextItems:S.Optional(Wlr)})]);function $at(t,e){return t.map(r=>{let n=r.data.filter(o=>o.type===e);return n.length>0?{...r,data:n}:void 0}).filter(r=>r!==void 0)}a($at,"filterContextItemsByType");function UYn(t){let e=[],r=0;return t.forEach(n=>{let o=!1;for(let[s,c]of vQs.entries())if(c.Check(n)){e.push({...n,type:s}),o=!0;break}o||r++}),[e,r]}a(UYn,"filterSupportedContextItems");function xQs(t){return t.length>0&&t.replaceAll(/[^a-zA-Z0-9-]/g,"").length===t.length}a(xQs,"validateContextItemId");function QYn(t,e){let r=new Set,n=[];for(let o of e){let s=o.id??ir();if(!xQs(s)){let c=ir();Dr.error(t,`Invalid context item ID ${s}, replacing with ${c}`),s=c}if(r.has(s)){let c=ir();Dr.error(t,`Duplicate context item ID ${s}, replacing with ${c}`),s=c}r.add(s),n.push({...o,id:s})}return n}a(QYn,"addOrValidateContextItemsIDs");p();var i0=class{constructor(e=()=>new zlr){this.createStatistics=e;this.statistics=new yn(25)}static{a(this,"ContextProviderStatistics")}getStatisticsForCompletion(e){let r=this.statistics.get(e);if(r)return r;let n=this.createStatistics();return this.statistics.set(e,n),n}getPreviousStatisticsForCompletion(e){let r=Array.from(this.statistics.keys());for(let n=r.length-1;n>=0;n--){let o=r[n];if(o!==e)return this.statistics.peek(o)}}},zlr=class{constructor(){this._expectations=new Map;this._lastResolution=new Map;this._statistics=new Map}static{a(this,"PerCompletionContextProviderStatistics")}addExpectations(e,r){let n=this._expectations.get(e)??[];this._expectations.set(e,[...n,...r])}clearExpectations(){this._expectations.clear()}setLastResolution(e,r){this._lastResolution.set(e,r)}get(e){return this._statistics.get(e)}computeMatch(e){try{for(let[r,n]of this._expectations){if(n.length===0)continue;let o=this._lastResolution.get(r)??"none";if(o==="none"||o==="error"){this._statistics.set(r,{usage:"none",resolution:o});continue}let s=[];for(let[d,f]of n){let h={id:d.id,type:d.type};if(d.origin&&(h.origin=d.origin),f==="content_excluded"){s.push({...h,usage:"none_content_excluded"});continue}let m=e.find(g=>g.source===d);m===void 0?s.push({...h,usage:"error"}):s.push({...h,usage:m.expectedTokens>0&&m.expectedTokens===m.actualTokens?"full":m.actualTokens>0?"partial":"none",expectedTokens:m.expectedTokens,actualTokens:m.actualTokens})}let l=s.reduce((d,f)=>f.usage==="full"?d+1:f.usage==="partial"?d+.5:d,0)/n.length,u=l===1?"full":l===0?"none":"partial";this._statistics.set(r,{resolution:o,usage:u,usageDetails:s})}}finally{this.clearExpectations(),this._lastResolution.clear()}}};function Vat(t){return t.map(e=>{if(!(e.source===void 0||e.expectedTokens===void 0||e.actualTokens===void 0))return{source:e.source,expectedTokens:e.expectedTokens,actualTokens:e.actualTokens}}).filter(e=>e!==void 0)}a(Vat,"componentStatisticsToPromptMatcher");var qYn=fe(ei());var o0=class{static{a(this,"ContextProviderRegistry")}},y5=class{static{a(this,"DefaultContextProviders")}},wpe=class extends y5{constructor(){super();this.ids=[]}static{a(this,"DefaultContextProvidersContainer")}add(r){this.ids.push(r)}getIds(){return this.ids}},Ylr=class extends o0{constructor(r,n){super();this.ctx=r;this.match=n;this._providers=[]}static{a(this,"CoreContextProviderRegistry")}registerContextProvider(r){if(r.id.includes(",")||r.id.includes("*"))throw new Error(`A context provider id cannot contain a comma or an asterisk. The id ${r.id} is invalid.`);if(this._providers.find(n=>n.id===r.id))throw new Error(`A context provider with id ${r.id} has already been registered`);this._providers.push(r)}unregisterContextProvider(r){this._providers=this._providers.filter(n=>n.id!==r)}get providers(){return this._providers.slice()}async resolveAllProviders(r,n,o,s,c,l){if(c?.isCancellationRequested)return Dr.debug(this.ctx,"Resolving context providers cancelled"),[];let u=new Map;Gat(this.ctx,u,s);let d=[];if(this._providers.length===0)return d;let f=await this.matchProviders(o,s),h=f.filter(T=>T[1]>0);if(f.filter(T=>T[1]<=0).forEach(([T,w])=>{let R={providerId:T.id,matchScore:w,resolution:"none",resolutionTimeMs:0,data:[]};d.push(R)}),h.length===0)return d;if(c?.isCancellationRequested)return Dr.debug(this.ctx,"Resolving context providers cancelled"),[];RYn(this.ctx,h.map(T=>T[0].id),u,s),kYn(this.ctx,h.map(T=>T[0].id),u,s),DYn(this.ctx,h.map(T=>T[0].id),u,s);let g=new qYn.CancellationTokenSource;if(c){let T=c.onCancellationRequested(w=>{g.cancel(),T.dispose()})}let A=J_e(this.ctx)&&!z8e(this.ctx)?0:wQs(this.ctx,s),y=A>0?Date.now()+A:Number.MAX_SAFE_INTEGER,E;A>0&&(E=setTimeout(()=>{g.cancel(),g.dispose()},A));let _=new Map,v={completionId:r,opportunityId:n,documentContext:o,activeExperiments:u,timeBudget:A,timeoutEnd:y,data:l};for(let[T]of h){let w=this.ctx.get(i0).getPreviousStatisticsForCompletion(r)?.get(T.id);w&&(v.previousUsageStatistics=w);let R=T.resolver.resolve(v,g.token);_.set(T.id,R)}let b=await Kfn(_,g.token);E&&clearTimeout(E);for(let[T,w]of h){let R=b.get(T.id);if(R){if(R.status==="error")ck(R.reason)||Dr.error(this.ctx,`Error resolving context from ${T.id}: `,R.reason),d.push({providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:[]});else{let x=[...R.value??[]];if((R.status==="none"||R.status==="partial")&&(Dr.info(this.ctx,`Context provider ${T.id} exceeded time budget of ${A}ms`),T.resolver.resolveOnTimeout))try{let L=T.resolver.resolveOnTimeout(v);X6t(L)?x.push(...L):L&&x.push(L),x.length>0&&(R.status="partial")}catch(L){Dr.error(this.ctx,`Error in fallback logic for context provider ${T.id}: `,L)}let[P,D]=UYn(x);D&&Dr.error(this.ctx,`Dropped ${D} context items from ${T.id} due to invalid schema`);let N=QYn(this.ctx,P),B={providerId:T.id,matchScore:w,resolution:R.status,resolutionTimeMs:R.resolutionTime,data:N};d.push(B)}this.ctx.get(i0).getStatisticsForCompletion(r).setLastResolution(T.id,R.status)}else Dr.error(this.ctx,`Context provider ${T.id} not found in results`)}return d.sort((T,w)=>w.matchScore-T.matchScore)}async matchProviders(r,n){let o=jYn(this.ctx,n),s=o.length===1&&o[0]==="*";return await Promise.all(this._providers.map(async l=>{if(!s&&!o.includes(l.id))return[l,0];let u=await this.match(this.ctx,l.selector,r);return[l,u]}))}get matchFunction(){return this.match}},Klr=class extends o0{constructor(r){super();this.delegate=r;this._cachedContextItems=new yn(5)}static{a(this,"CachedContextProviderRegistry")}registerContextProvider(r){this.delegate.registerContextProvider(r)}unregisterContextProvider(r){this.delegate.unregisterContextProvider(r)}get providers(){return this.delegate.providers}async resolveAllProviders(r,n,o,s,c,l){let u=this._cachedContextItems.get(r);if(r&&u&&u.length>0)return u;let d=await this.delegate.resolveAllProviders(r,n,o,s,c,l);return d.length>0&&r&&this._cachedContextItems.set(r,d),d}get matchFunction(){return this.delegate.matchFunction}};function Wat(t,e){return new Klr(new Ylr(t,e))}a(Wat,"getContextProviderRegistry");function zat(t,e,r){let n=t.get(i0).getStatisticsForCompletion(e);return r.map(s=>{let{providerId:c,resolution:l,resolutionTimeMs:u,matchScore:d,data:f}=s,h=n.get(c),m=h?.usage??"none";(d<=0||l==="none"||l==="error")&&(m="none");let g={providerId:c,resolution:l,resolutionTimeMs:u,usage:m,usageDetails:h?.usageDetails,matched:d>0,numResolvedItems:f.length},A=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="full"||E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0,y=h?.usageDetails!==void 0?h?.usageDetails.filter(E=>E.usage==="partial"||E.usage==="partial_content_excluded").length:void 0;return A!==void 0&&(g.numUsedItems=A),y!==void 0&&(g.numPartiallyUsedItems=y),g})}a(zat,"telemetrizeContextItems");function Yat(t){return t.matchScore>0&&t.resolution!=="error"}a(Yat,"matchContextItems");function jYn(t,e){let r=Jlr(t,e),n=Ht(t,Je.ContextProviders)??[];if(r.length===1&&r[0]==="*"||n.length===1&&n[0]==="*")return["*"];let o=t.get(y5).getIds();return Array.from(new Set([...o,...r,...n]))}a(jYn,"getActiveContextProviders");function Jlr(t,e){return J_e(t)?["*"]:t.get(Jt).contextProviders(e)}a(Jlr,"getExpContextProviders");function Rpe(t,e){return jYn(t,e).length>0}a(Rpe,"useContextProviderAPI");function wQs(t,e){let r=Ht(t,Je.ContextProviderTimeBudget);return r!==void 0&&typeof r=="number"?r:t.get(Jt).contextProviderTimeBudget(e)}a(wQs,"getContextProviderTimeBudget");var hb=class{constructor(e){this.ctx=e;this.scheduledResolutions=new yn(25)}static{a(this,"ContextProviderBridge")}schedule(e,r,n,o,s,c){let l=this.ctx.get(o0),{textDocument:u,originalPosition:d,originalOffset:f,originalVersion:h,editsWithPosition:m}=e,g=l.resolveAllProviders(r,n,{uri:u.uri,languageId:u.detectedLanguageId,version:h,offset:f,position:d,proposedEdits:m.length>0?m:void 0},o,s,c?.data);this.scheduledResolutions.set(r,g)}async resolution(e){let r=this.scheduledResolutions.get(e);return r?await r:[]}};p();p();var Kat=class{constructor(e,r,n){this.languageId=e;this.nodeMatch=r;this.nodeTypesWithBlockOrStmtChild=n}static{a(this,"BaseBlockParser")}async getNodeMatchAtPosition(e,r,n){let o=await I7(this.languageId,e);try{let c=o.rootNode.descendantForIndex(r);for(;c;){let l=this.nodeMatch[c.type];if(l){if(!this.nodeTypesWithBlockOrStmtChild.has(c.type))break;let u=this.nodeTypesWithBlockOrStmtChild.get(c.type);if((u==""?c.namedChildren[0]:c.childForFieldName(u))?.type==l)break}c=c.parent}return c?n(c):void 0}finally{o.delete()}}getNextBlockAtPosition(e,r,n){return this.getNodeMatchAtPosition(e,r,o=>{let s=o.children.reverse().find(c=>c.type==this.nodeMatch[o.type]);if(s){if(this.languageId=="python"&&s.parent){let c=s.parent.type==":"?s.parent.parent:s.parent,l=c?.nextSibling;for(;l&&l.type=="comment";){let u=l.startPosition.row==s.endPosition.row&&l.startPosition.column>=s.endPosition.column,d=l.startPosition.row>c.endPosition.row&&l.startPosition.column>c.startPosition.column;if(u||d)s=l,l=l.nextSibling;else break}}if(!(s.endIndex>=s.tree.rootNode.endIndex-1&&(s.hasError||s.parent.hasError)))return n(s)}})}async isBlockBodyFinished(e,r,n){let o=(e+r).trimEnd(),s=await this.getNextBlockAtPosition(o,n,c=>c.endIndex);if(s!==void 0&&s0?c:void 0}}getNodeStart(e,r){let n=e.trimEnd();return this.getNodeMatchAtPosition(n,r,o=>o.startIndex)}},Jat=class extends Kat{constructor(r,n,o,s,c){super(r,s,c);this.blockEmptyMatch=n;this.lineMatch=o}static{a(this,"RegexBasedBlockParser")}isBlockStart(r){return this.lineMatch.test(r.trimStart())}async isBlockBodyEmpty(r,n){let o=await this.getNextBlockAtPosition(r,n,s=>{s.startIndex0&&/\s/.test(t.charAt(r-1));)r--;return r}a(lYn,"rewindToNearestNonWs");function cYn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(cYn,"indent");function rqs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=cYn(t,r),o=cYn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(rqs,"outdented");var T5=class extends $at{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&Icn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},nqs={python:new T5("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new T5("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new T5("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new T5("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Vat("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Vat("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new T5("csharp",{},new Map([]),[],"block",null,!0),java:new T5("java",{},new Map([]),[],"block",null,!0),php:new T5("php",{},new Map([]),[],"block",null,!0),cpp:new T5("cpp",{},new Map([]),[],"block",null,!0)};function Blr(t){if(!AS(t))throw new Error(`Language ${t} is not supported`);return nqs[xGe(t)]}a(Blr,"getBlockParser");async function uYn(t,e,r){return AS(t)?Blr(t).isEmptyBlockStart(e,r):!1}a(uYn,"isEmptyBlockStart");async function dYn(t,e,r,n){if(AS(t))return Blr(t).isBlockBodyFinished(e,r,n)}a(dYn,"isBlockBodyFinished");async function fYn(t,e,r){if(AS(t))return Blr(t).getNodeStart(e,r)}a(fYn,"getNodeStart");var rxf=new ge("parseBlock");function R2e(t,e,r){let n=e.getText(Ll.range(Ll.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>dYn(s,n,c,o)}a(R2e,"parsingBlockFinished");function zat(t,e){return uYn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(zat,"isEmptyBlockStartUtil");async function pYn(t,e,r,n){let s=e.getText(Ll.range(Ll.position(0,0),r))+n,c=await fYn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(pYn,"getNodeStartUtil");var iqs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),oqs=new RegExp(`^(${iqs.join("|")})`);function sqs(t){return oqs.test(t.trimLeft().toLowerCase())}a(sqs,"isContinuationLine");function Wat(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Wat,"indentationOfLine");function Yat(t,e){let r=t.getText(),n=t.offsetAt(e);return Llr(r,n,t.detectedLanguageId)}a(Yat,"contextIndentation");function Llr(t,e,r){let n=t.slice(0,e).split(` +`,e);return n<0&&(n=t.length),t.slice(r+1,n)}a(RQs,"getLineAtOffset");function GYn(t,e){let r=e;for(;r>0&&/\s/.test(t.charAt(r-1));)r--;return r}a(GYn,"rewindToNearestNonWs");function HYn(t,e){let r=t.startIndex,n=t.startIndex-t.startPosition.column,o=e.substring(n,r);if(/^\s*$/.test(o))return o}a(HYn,"indent");function PQs(t,e,r){if(e.startPosition.row<=t.startPosition.row)return!1;let n=HYn(t,r),o=HYn(e,r);return n!==void 0&&o!==void 0&&n.startsWith(o)}a(PQs,"outdented");var E5=class extends Kat{constructor(r,n,o,s,c,l,u){super(r,n,o);this.startKeywords=s;this.blockNodeType=c;this.emptyStatementType=l;this.curlyBraceLanguage=u}static{a(this,"TreeSitterBasedBlockParser")}isBlockEmpty(r,n){let o=r.text.trim();return this.curlyBraceLanguage&&(o.startsWith("{")&&(o=o.slice(1)),o.endsWith("}")&&(o=o.slice(0,-1)),o=o.trim()),!!(o.length==0||this.languageId=="python"&&(r.parent?.type=="class_definition"||r.parent?.type=="function_definition")&&r.children.length==1&&lcn(r.parent))}async isEmptyBlockStart(r,n){if(n>r.length)throw new RangeError("Invalid offset");for(let c=n;cA.type==";")&&h.endIndex<=n}h=h.parent}}let l=null,u=null,d=null,f=c;for(;f!=null;){if(f.type==this.blockNodeType){u=f;break}if(this.nodeMatch[f.type]){d=f;break}if(f.type=="ERROR"){l=f;break}f=f.parent}if(u!=null){if(!u.parent||!this.nodeMatch[u.parent.type])return!1;if(this.languageId=="python"){let h=u.previousSibling;if(h!=null&&h.hasError&&(h.text.startsWith('"""')||h.text.startsWith("'''")))return!0}return this.isBlockEmpty(u,n)}if(l!=null){if(l.previousSibling?.type=="module"||l.previousSibling?.type=="internal_module"||l.previousSibling?.type=="def")return!0;if(this.languageId==="python"&&s>=14&&l.hasError&&(l.text.startsWith('"')||l.text.startsWith("'"))){let A=l.parent?.type;if(A==="function_definition"||A==="class_definition"||A==="module")return!0}let h=[...l.children].reverse(),m=h.find(A=>this.startKeywords.includes(A.type)),g=h.find(A=>A.type==this.blockNodeType);if(m){switch(this.languageId){case"python":{m.type=="try"&&c.type=="identifier"&&c.text.length>4&&(g=h.find(E=>E.hasError)?.children.find(E=>E.type=="block"));let A,y=0;for(let E of l.children){if(E.type==":"&&y==0){A=E;break}E.type=="("&&(y+=1),E.type==")"&&(y-=1)}if(A&&m.endIndex<=A.startIndex&&A.nextSibling){if(m.type=="def"){let E=A.nextSibling;if(E.type=='"'||E.type=="'"||E.type=="ERROR"&&(E.text=='"""'||E.text=="'''"))return!0}return!1}break}case"javascript":{if(m.type==="class")if(s<=13){if(h.find(_=>_.type==="formal_parameters"))return!0}else{let E=l.children;for(let _=0;_E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}case"typescript":{let A=h.find(E=>E.type=="{");if(A&&A.startIndex>m.endIndex&&A.nextSibling!=null||h.find(E=>E.type=="do")&&m.type=="while"||m.type=="=>"&&m.nextSibling&&m.nextSibling.type!="{")return!1;break}}return g&&g.startIndex>m.endIndex?this.isBlockEmpty(g,n):!0}}if(d!=null){let h=this.nodeMatch[d.type],m=d.children.slice().reverse().find(g=>g.type==h);if(m)return this.isBlockEmpty(m,n);if(this.nodeTypesWithBlockOrStmtChild.has(d.type)){let g=this.nodeTypesWithBlockOrStmtChild.get(d.type),A=g==""?d.children[0]:d.childForFieldName(g);if(A&&A.type!=this.blockNodeType&&A.type!=this.emptyStatementType)return!1}return!0}return!1}finally{o.delete()}}},kQs={python:new E5("python",{class_definition:"block",elif_clause:"block",else_clause:"block",except_clause:"block",finally_clause:"block",for_statement:"block",function_definition:"block",if_statement:"block",try_statement:"block",while_statement:"block",with_statement:"block"},new Map,["def","class","if","elif","else","for","while","try","except","finally","with"],"block",null,!1),javascript:new E5("javascript",{arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",method_definition:"statement_block",try_statement:"statement_block",while_statement:"statement_block",with_statement:"statement_block",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),typescript:new E5("typescript",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),tsx:new E5("typescriptreact",{ambient_declaration:"statement_block",arrow_function:"statement_block",catch_clause:"statement_block",do_statement:"statement_block",else_clause:"statement_block",finally_clause:"statement_block",for_in_statement:"statement_block",for_statement:"statement_block",function:"statement_block",function_expression:"statement_block",function_declaration:"statement_block",generator_function:"statement_block",generator_function_declaration:"statement_block",if_statement:"statement_block",internal_module:"statement_block",method_definition:"statement_block",module:"statement_block",try_statement:"statement_block",while_statement:"statement_block",abstract_class_declaration:"class_body",class:"class_body",class_declaration:"class_body"},new Map([["arrow_function","body"],["do_statement","body"],["else_clause",""],["for_in_statement","body"],["for_statement","body"],["if_statement","consequence"],["while_statement","body"],["with_statement","body"]]),["declare","=>","try","catch","finally","do","for","if","else","while","with","function","function*","class"],"statement_block","empty_statement",!0),go:new Jat("go","{}",/\b(func|if|else|for)\b/,{communication_case:"block",default_case:"block",expression_case:"block",for_statement:"block",func_literal:"block",function_declaration:"block",if_statement:"block",labeled_statement:"block",method_declaration:"block",type_case:"block"},new Map),ruby:new Jat("ruby","end",/\b(BEGIN|END|case|class|def|do|else|elsif|for|if|module|unless|until|while)\b|->/,{begin_block:"}",block:"}",end_block:"}",lambda:"block",for:"do",until:"do",while:"do",case:"end",do:"end",if:"end",method:"end",module:"end",unless:"end",do_block:"end"},new Map),"c-sharp":new E5("csharp",{},new Map([]),[],"block",null,!0),java:new E5("java",{},new Map([]),[],"block",null,!0),php:new E5("php",{},new Map([]),[],"block",null,!0),cpp:new E5("cpp",{},new Map([]),[],"block",null,!0)};function Zlr(t){if(!uS(t))throw new Error(`Language ${t} is not supported`);return kQs[pGe(t)]}a(Zlr,"getBlockParser");async function $Yn(t,e,r){return uS(t)?Zlr(t).isEmptyBlockStart(e,r):!1}a($Yn,"isEmptyBlockStart");async function VYn(t,e,r,n){if(uS(t))return Zlr(t).isBlockBodyFinished(e,r,n)}a(VYn,"isBlockBodyFinished");async function WYn(t,e,r){if(uS(t))return Zlr(t).getNodeStart(e,r)}a(WYn,"getNodeStart");var $If=new Ae("parseBlock");function E2e(t,e,r){let n=e.getText(cu.range(cu.position(0,0),r)),o=e.offsetAt(r),s=e.detectedLanguageId;return c=>VYn(s,n,c,o)}a(E2e,"parsingBlockFinished");function Xat(t,e){return $Yn(t.detectedLanguageId,t.getText(),t.offsetAt(e))}a(Xat,"isEmptyBlockStartUtil");async function zYn(t,e,r,n){let s=e.getText(cu.range(cu.position(0,0),r))+n,c=await WYn(e.detectedLanguageId,s,e.offsetAt(r));if(c)return e.positionAt(c)}a(zYn,"getNodeStartUtil");var DQs=["\\{","\\}","\\[","\\]","\\(","\\)"].concat(["then","else","elseif","elif","catch","finally","fi","done","end","loop","until","where","when"].map(t=>t+"\\b")),NQs=new RegExp(`^(${DQs.join("|")})`);function MQs(t){return NQs.test(t.trimLeft().toLowerCase())}a(MQs,"isContinuationLine");function Zat(t){let e=/^(\s*)([^]*)$/.exec(t);if(e&&e[2]&&e[2].length>0)return e[1].length}a(Zat,"indentationOfLine");function ect(t,e){let r=t.getText(),n=t.offsetAt(e);return Xlr(r,n,t.detectedLanguageId)}a(ect,"contextIndentation");function Xlr(t,e,r){let n=t.slice(0,e).split(` `),o=t.slice(e).split(` -`);function s(f,h,m){let g=h,A,y;for(;A===void 0&&g>=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Wat(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Wat(n[f]);if(h!==void 0&&h=0&&g=0&&!f[g].trim().startsWith('"""');)g--;if(g>=0)for(A=void 0,g--;A===void 0&&g>=0;)A=Zat(f[g]),y=g,g--}}return[A,y]}a(s,"seekNonBlank");let[c,l]=s(n,n.length-1,-1),u=(()=>{if(!(c===void 0||l===void 0))for(let f=l-1;f>=0;f--){let h=Zat(n[f]);if(h!==void 0&&h{let n=cqs(r,t,e);return n==="continue"?void 0:n}}a(hYn,"indentationBlockFinished");p();p();p();p();p();p();var lqs={tokenizerName:"o200k_base"};function uqs(t){return{...lqs,...t}}a(uqs,"cursorContextOptions");function k2e(t,e={}){let r=uqs(e),n=Ss(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` +`).pop(),c=0;if(o&&s?.trim()!=""&&n[0].trim()!==""&&c++,!o&&OQs&&n[0].trim()===""&&c++,o||c++,n.length===c)return"continue";let l=Math.max(e.current,e.next??0);for(let u=c;u{let n=BQs(r,t,e);return n==="continue"?void 0:n}}a(YYn,"indentationBlockFinished");p();p();p();p();p();p();var LQs={tokenizerName:"o200k_base"};function FQs(t){return{...LQs,...t}}a(FQs,"cursorContextOptions");function _2e(t,e={}){let r=FQs(e),n=Cs(r.tokenizerName);if(r.maxLineCount!==void 0&&r.maxLineCount<0)throw new Error("maxLineCount must be non-negative if defined");if(r.maxTokenLength!==void 0&&r.maxTokenLength<0)throw new Error("maxTokenLength must be non-negative if defined");if(r.maxLineCount===0||r.maxTokenLength===0)return{context:"",lineCount:0,tokenLength:0,tokenizerName:r.tokenizerName};let o=t.source.slice(0,t.offset);return r.maxLineCount!==void 0&&(o=o.split(` `).slice(-r.maxLineCount).join(` `)),r.maxTokenLength!==void 0&&(o=n.takeLastLinesTokens(o,r.maxTokenLength)),{context:o,lineCount:o.split(` -`).length,tokenLength:n.tokenLength(o),tokenizerName:r.tokenizerName}}a(k2e,"getCursorContext");p();p();var dqs={function:"function",snippet:"snippet",snippets:"snippets",variable:"variable",parameter:"parameter",method:"method",class:"class",module:"module",alias:"alias","enum member":"enum member",interface:"interface"};function mYn(t){let e=dqs[t.semantics],r=["snippets"].includes(t.semantics)?"these":"this";return{headline:t.relativePath?`Compare ${r} ${e} from ${t.relativePath}:`:`Compare ${r} ${e}:`,snippet:t.snippet}}a(mYn,"announceSnippet");var Flr=class{constructor(e){this.keys=[];this.cache={};this.size=e}static{a(this,"FifoCache")}put(e,r){if(this.cache[e]=r,this.keys.length>this.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var Ulr=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=mqs.get(e.languageId)??hqs}tokenize(e){return new Set(fqs(e).filter(r=>!this.stopsForLanguage.has(r)))}},gYn=new Flr(20),Dpe=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new Ulr(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` -`),s=this.id()+":"+e.source,c=gYn.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scorethis.size){this.keys.push(e);let n=this.keys.shift()??"";delete this.cache[n]}}get(e){return this.cache[e]}};var tur=class{static{a(this,"Tokenizer")}constructor(e){this.stopsForLanguage=HQs.get(e.languageId)??jQs}tokenize(e){return new Set(QQs(e).filter(r=>!this.stopsForLanguage.has(r)))}},JYn=new eur(20),Ppe=class{static{a(this,"WindowedMatcher")}constructor(e){this.referenceDoc=e,this.tokenizer=new tur(e)}get referenceTokens(){return Promise.resolve(this.createReferenceTokens())}createReferenceTokens(){return this.referenceTokensCache??=this.tokenizer.tokenize(this._getCursorContextInfo(this.referenceDoc).context)}sortScoredSnippets(e,r="descending"){return r=="ascending"?e.sort((n,o)=>n.score>o.score?1:-1):r=="descending"?e.sort((n,o)=>n.score>o.score?-1:1):e}async retrieveAllSnippets(e,r="descending"){let n=[];if(e.source.length===0||(await this.referenceTokens).size===0)return n;let o=e.source.split(` +`),s=this.id()+":"+e.source,c=JYn.get(s)??[],l=c.length==0,u=l?o.map(d=>this.tokenizer.tokenize(d),this.tokenizer):[];for(let[d,[f,h]]of this.getWindowsDelineations(o).entries()){if(l){let A=new Set;u.slice(f,h).forEach(y=>y.forEach(E=>A.add(E),A)),c.push(A)}let m=c[d],g=this.similarityScore(m,await this.referenceTokens);if(n.length&&f>0&&n[n.length-1].endLine>f){n[n.length-1].scoree.length>0)}a(fqs,"splitIntoWords");var pqs=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),hqs=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...pqs]),mqs=new Map([]);p();function Kat(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Kat(this.windowLength,e)}_getCursorContextInfo(e){return k2e(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return gqs(e,r)}};function gqs(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(gqs,"computeScore");p();var Zat=class t extends Dpe{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return Kat(this.windowLength,e)}_getCursorContextInfo(e){return k2e(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):k2e(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return Aqs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await k7(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function Aqs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a(Aqs,"computeScore");var yqs=0,Eqs=60,_qs=4,Cqs=1,vqs=20,bqs=1e4,AYn={snippetLength:Eqs,threshold:yqs,maxTopSnippets:_qs,maxCharPerFile:bqs,maxNumberOfFiles:vqs,maxSnippetsPerFile:Cqs,useSubsetMatching:!1};var Qlr={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function Sqs(t,e){return(e.useSubsetMatching?Zat.FACTORY(e.snippetLength):Jat.FACTORY(e.snippetLength)).to(t)}a(Sqs,"getMatcher");async function yYn(t,e,r){let n=Sqs(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(yYn,"getSimilarSnippets");function EYn(t,e){return{...Qlr,useSubsetMatching:qlr(t,e)}}a(EYn,"getCppSimilarFilesOptions");function _Yn(t){return Qlr.maxTopSnippets}a(_Yn,"getCppNumberOfSnippets");var Tqs=new Map([["cpp",EYn]]);function Xat(t,e,r){let n=Tqs.get(r);return n?n(t,e):{...AYn,useSubsetMatching:qlr(t,e)}}a(Xat,"getSimilarFilesOptions");var Iqs=new Map([["cpp",_Yn]]);function CYn(t,e){let r=Iqs.get(e);return r?r(t):vcn}a(CYn,"getNumberOfSnippets");function qlr(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||qt(t,je.UseSubsetMatching))??!1}a(qlr,"useSubsetMatching");p();p();p();p();var xqs="content_excluded";async function ect(t,e,r,n){let o=Qat(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get(cn),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(r0).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,xqs]]),m}).map(f=>f.data)}a(ect,"getCodeSnippetsFromContextItems");function vYn(t,e){let r=t.get(cn);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(vYn,"addRelativePathToCodeSnippets");p();function cp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(cp,"Text");function Zj(t){return t.children}a(Zj,"Chunk");p();function zn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(zn,"functionComponentFunction");function p2(t){return{type:"f",children:t}}a(p2,"fragmentFunction");p2.isFragmentFunction=!0;var tct=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(vb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=vYn(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(zn(cp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(zn(cp,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=$lr(c);return zn(p2,{children:[zn(YZ,{document:r,position:o,maxCharacters:m}),zn(ict,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(D2e,"CurrentFile");function YZ(t){if(t.document===void 0||t.position===void 0)return zn(cp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),zn(cp,{children:e})}a(YZ,"BeforeCursor");function ict(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return zn(cp,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return zn(cp,{});if(r===s)return zn(cp,{children:r});let c=s;if(r!==""){let l=Ss(t.tokenizer),u=l.takeFirstTokens(s,P2e);u.tokens.length>0&&100*nct(u.tokens,l.takeFirstTokens(r,P2e).tokens)?.score<(t.suffixMatchThreshold??bGe)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(cp,{children:c})}a(ict,"AfterCursor");function bYn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(vb,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=$lr(c);return zn(YZ,{document:r,position:o,maxCharacters:u})}a(bYn,"DocumentPrefix");function SYn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(vb,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=$lr(c);return zn(ict,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(SYn,"DocumentSuffix");p();var oct=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function TYn(t){return t.map(e=>e.elidedValue).join("")}a(TYn,"makePrompt");function IYn(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(IYn,"makePrefixPrompt");function xYn(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` -`).trim();n.push(c)}else n.push("")}return n}a(xYn,"makeContextPrompt");p();var Npe=class{constructor(e,r=Vlr()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function Vlr(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===Zj.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(Vlr,"defaultTransformers");p();var Wlr={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},wYn={};for(let[t,e]of Object.entries(Wlr))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)wYn[r]=t;else wYn[t]=t;var wqs={start:"//",end:""},Rqs=["php","plaintext"],zlr={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function RYn(t){return Object.values(zlr).includes(t.trim())}a(RYn,"isShebangLine");function kqs({source:t}){return t.startsWith("#!")||t.startsWith("e.length>0)}a(QQs,"splitIntoWords");var qQs=new Set(["we","our","you","it","its","they","them","their","this","that","these","those","is","are","was","were","be","been","being","have","has","had","having","do","does","did","doing","can","don","t","s","will","would","should","what","which","who","when","where","why","how","a","an","the","and","or","not","no","but","because","as","until","again","further","then","once","here","there","all","any","both","each","few","more","most","other","some","such","above","below","to","during","before","after","of","at","by","about","between","into","through","from","up","down","in","out","on","off","over","under","only","own","same","so","than","too","very","just","now"]),jQs=new Set(["if","then","else","for","while","with","def","function","return","TODO","import","try","catch","raise","finally","repeat","switch","case","match","assert","continue","break","const","class","enum","struct","static","new","super","this","var",...qQs]),HQs=new Map([]);p();function tct(t,e){let r=[],n=e.length;if(n==0)return[];if(n({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return tct(this.windowLength,e)}_getCursorContextInfo(e){return _2e(e,{maxLineCount:this.windowLength})}similarityScore(e,r){return GQs(e,r)}};function GQs(t,e){let r=new Set;return t.forEach(n=>{e.has(n)&&r.add(n)}),r.size/(t.size+e.size-r.size)}a(GQs,"computeScore");p();var nct=class t extends Ppe{static{a(this,"BlockTokenSubsetMatcher")}constructor(e,r){super(e),this.windowLength=r}static{this.FACTORY=a(e=>({to:a(r=>new t(r,e),"to")}),"FACTORY")}id(){return"fixed:"+this.windowLength}getWindowsDelineations(e){return tct(this.windowLength,e)}_getCursorContextInfo(e){return _2e(e,{maxLineCount:this.windowLength})}get referenceTokens(){return this.createReferenceTokensForLanguage()}async createReferenceTokensForLanguage(){return this.referenceTokensCache?this.referenceTokensCache:(this.referenceTokensCache=t.syntaxAwareSupportsLanguage(this.referenceDoc.languageId)?await this.syntaxAwareReferenceTokens():await super.referenceTokens,this.referenceTokensCache)}async syntaxAwareReferenceTokens(){let e=(await this.getEnclosingMemberStart(this.referenceDoc.source,this.referenceDoc.offset))?.startIndex,r=this.referenceDoc.offset,n=e?this.referenceDoc.source.slice(e,r):_2e(this.referenceDoc,{maxLineCount:this.windowLength}).context;return this.tokenizer.tokenize(n)}static syntaxAwareSupportsLanguage(e){return e==="csharp"}similarityScore(e,r){return $Qs(e,r)}async getEnclosingMemberStart(e,r){let n;try{n=await I7(this.referenceDoc.languageId,e);let o=n.rootNode.namedDescendantForIndex(r);for(;o&&!(t.isMember(o)||t.isBlock(o));)o=o.parent??void 0;return o}finally{n?.delete()}}static isMember(e){switch(e?.type){case"method_declaration":case"property_declaration":case"field_declaration":case"constructor_declaration":return!0;default:return!1}}static isBlock(e){switch(e?.type){case"class_declaration":case"struct_declaration":case"record_declaration":case"enum_declaration":case"interface_declaration":return!0;default:return!1}}};function $Qs(t,e){let r=new Set;return e.forEach(n=>{t.has(n)&&r.add(n)}),r.size}a($Qs,"computeScore");var VQs=0,WQs=60,zQs=4,YQs=1,KQs=20,JQs=1e4,ZYn={snippetLength:WQs,threshold:VQs,maxTopSnippets:zQs,maxCharPerFile:JQs,maxNumberOfFiles:KQs,maxSnippetsPerFile:YQs,useSubsetMatching:!1};var rur={snippetLength:60,threshold:0,maxTopSnippets:16,maxCharPerFile:1e5,maxNumberOfFiles:200,maxSnippetsPerFile:4};function ZQs(t,e){return(e.useSubsetMatching?nct.FACTORY(e.snippetLength):rct.FACTORY(e.snippetLength)).to(t)}a(ZQs,"getMatcher");async function XYn(t,e,r){let n=ZQs(t,r);return r.maxTopSnippets===0?[]:(await e.filter(s=>s.source.length0).slice(0,r.maxNumberOfFiles).reduce(async(s,c)=>(await s).concat((await n.findMatches(c,r.maxSnippetsPerFile)).map(l=>({relativePath:c.relativePath,...l}))),Promise.resolve([]))).filter(s=>s.score&&s.snippet&&s.score>r.threshold).sort((s,c)=>s.score-c.score).slice(-r.maxTopSnippets)}a(XYn,"getSimilarSnippets");function eKn(t,e){return{...rur,useSubsetMatching:nur(t,e)}}a(eKn,"getCppSimilarFilesOptions");function tKn(t){return rur.maxTopSnippets}a(tKn,"getCppNumberOfSnippets");var XQs=new Map([["cpp",eKn]]);function ict(t,e,r){let n=XQs.get(r);return n?n(t,e):{...ZYn,useSubsetMatching:nur(t,e)}}a(ict,"getSimilarFilesOptions");var eqs=new Map([["cpp",tKn]]);function rKn(t,e){let r=eqs.get(e);return r?r(t):icn}a(rKn,"getNumberOfSnippets");function nur(t,e){return(e.filtersAndExp.exp.variables.copilotsubsetmatching||Ht(t,Je.UseSubsetMatching))??!1}a(nur,"useSubsetMatching");p();p();p();p();var tqs="content_excluded";async function oct(t,e,r,n){let o=$at(r,"CodeSnippet");if(o.length===0)return[];let s=new Set,c=o.flatMap(f=>f.data.map(h=>(s.add(h.uri),h.additionalUris?.forEach(m=>s.add(m)),{providerId:f.providerId,data:h}))),l=t.get(an),u=new Map;await Promise.all(Array.from(s).map(async f=>{u.set(f,await l.getTextDocumentValidation({uri:f}))}));let d=t.get(i0).getStatisticsForCompletion(e);return c.filter(f=>{let m=[f.data.uri,...f.data.additionalUris??[]].every(g=>u.get(g)?.status==="valid");return m?d.addExpectations(f.providerId,[[f.data,"included"]]):d.addExpectations(f.providerId,[[f.data,tqs]]),m}).map(f=>f.data)}a(oct,"getCodeSnippetsFromContextItems");function nKn(t,e){let r=t.get(an);return e.map(n=>({snippet:n,relativePath:r.getRelativePath(n)}))}a(nKn,"addRelativePathToCodeSnippets");p();function fp(t){if(t.children)return Array.isArray(t.children)?t.children.join(""):t.children}a(fp,"Text");function Vj(t){return t.children}a(Vj,"Chunk");p();function zn(t,e,r){let n=[];Array.isArray(e.children)?n=e.children:e.children&&(n=[e.children]);let o={...e,children:n};return r&&(o.key=r),{type:t,props:o}}a(zn,"functionComponentFunction");function u2(t){return{type:"f",children:t}}a(u2,"fragmentFunction");u2.isFragmentFunction=!0;var sct=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(mb,d=>{d.codeSnippets!==r&&n(d.codeSnippets),d.document.uri!==o?.uri&&s(d.document)}),!r||r.length===0||!o)return;let c=nKn(t.ctx,r),l=new Map;for(let d of c){let f=d.relativePath??d.snippet.uri,h=l.get(f);h===void 0&&(h=[],l.set(f,h)),h.push(d)}let u=[];for(let[d,f]of l.entries()){let h=f.filter(m=>m.snippet.value.length>0);h.length>0&&u.push({chunkElements:h.map(m=>m.snippet),importance:Math.max(...h.map(m=>m.snippet.importance??0)),uri:d})}if(u.length!==0)return u.sort((d,f)=>f.importance-d.importance),u.reverse(),u.map(d=>{let f=[];return f.push(zn(fp,{children:`Compare ${d.chunkElements.length>1?"these snippets":"this snippet"} from ${d.uri}:`})),d.chunkElements.forEach((h,m)=>{f.push(zn(fp,{source:h,children:h.value},h.id)),d.chunkElements.length>1&&mArray.from({length:e.length}).map(()=>0));for(let n=0;n{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=aur(c);return zn(u2,{children:[zn(GZ,{document:r,position:o,maxCharacters:m}),zn(lct,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})]})}a(C2e,"CurrentFile");function GZ(t){if(t.document===void 0||t.position===void 0)return zn(fp,{});let e=t.document.getText({start:{line:0,character:0},end:t.position});return e.length>t.maxCharacters&&(e=e.slice(-t.maxCharacters)),zn(fp,{children:e})}a(GZ,"BeforeCursor");function lct(t,e){let[r,n]=e.useState("");if(t.document===void 0||t.position===void 0)return zn(fp,{});let o=t.document.getText({start:t.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}});o.length>t.maxCharacters&&(o=o.slice(0,t.maxCharacters));let s=o.replace(/^.*/,"").trimStart();if(s==="")return zn(fp,{});if(r===s)return zn(fp,{children:r});let c=s;if(r!==""){let l=Cs(t.tokenizer),u=l.takeFirstTokens(s,v2e);u.tokens.length>0&&100*cct(u.tokens,l.takeFirstTokens(r,v2e).tokens)?.score<(t.suffixMatchThreshold??lGe)*u.tokens.length&&(c=r)}return c!==r&&n(c),zn(fp,{children:c})}a(lct,"AfterCursor");function iKn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0);e.useData(mb,d=>{let f=d.document;(d.document.uri!==r?.uri||f.getText()!==r?.getText())&&n(f),d.position!==o&&s(d.position),d.maxPromptTokens!==c&&l(d.maxPromptTokens)});let u=aur(c);return zn(GZ,{document:r,position:o,maxCharacters:u})}a(iKn,"DocumentPrefix");function oKn(t,e){let[r,n]=e.useState(),[o,s]=e.useState(),[c,l]=e.useState(0),[u,d]=e.useState(),[f,h]=e.useState();e.useData(mb,g=>{let A=g.document;(g.document.uri!==r?.uri||A.getText()!==r?.getText())&&n(A),g.position!==o&&s(g.position),g.suffixMatchThreshold!==u&&d(g.suffixMatchThreshold),g.maxPromptTokens!==c&&l(g.maxPromptTokens),g.tokenizer!==f&&h(g.tokenizer)});let m=aur(c);return zn(lct,{document:r,position:o,suffixMatchThreshold:u,maxCharacters:m,tokenizer:f})}a(oKn,"DocumentSuffix");p();var uct=class{static{a(this,"WishlistElision")}elide(e,r,n,o,s){if(r<=0)throw new Error("Prefix limit must be greater than 0");let[c,l]=this.preparePrefixBlocks(e,s),{elidedSuffix:u,adjustedPrefixTokenLimit:d}=this.elideSuffix(n,o,r,l,s),f=this.elidePrefix(c,d,l,s);return{blocks:[u,...f],cycles:1}}preparePrefixBlocks(e,r){let n=0,o=new Set;return[e.map((c,l)=>{let u=0,f=c.value.split(/([^\n]*\n+)/).filter(m=>m!=="").map(m=>{let g=r.tokenLength(m);return u+=g,n+=g,{line:m,componentPath:c.componentPath,tokens:g}}),h=c.componentPath;if(o.has(h))throw new Error(`Duplicate component path in prefix blocks: ${h}`);return o.add(h),{...c,tokens:u,markedForRemoval:!1,originalIndex:l,lines:f}}),n]}elideSuffix(e,r,n,o,s){let c=e.value;if(c.length===0||r<=0)return{elidedSuffix:{...e,tokens:0,elidedValue:"",elidedTokens:0},adjustedPrefixTokenLimit:n+Math.max(0,r)};o!f.markedForRemoval).flatMap(f=>f.lines);if(c.length===0)return[];let[l,u]=this.trimPrefixLinesToFit(c,r,o),d=u;return s.map(f=>{if(f.markedForRemoval)return d+f.tokens<=r&&!f.chunks?(d+=f.tokens,{...f,elidedValue:f.value,elidedTokens:f.tokens}):{...f,elidedValue:"",elidedTokens:0};let h=l.filter(g=>g.componentPath===f.componentPath&&g.line!=="").map(g=>g.line).join(""),m=f.tokens;return h!==f.value&&(m=h!==""?o.tokenLength(h):0),{...f,elidedValue:h,elidedTokens:m}})}removeLowWeightPrefixBlocks(e,r,n){let o=n;e.sort((s,c)=>s.weight-c.weight);for(let s of e){if(o<=r)break;if(s.weight!==1&&!(s.chunks&&s.markedForRemoval))if(s.chunks&&s.chunks.size>0)for(let c of e)!c.markedForRemoval&&c.chunks&&[...s.chunks].every(l=>c.chunks?.has(l))&&(c.markedForRemoval=!0,o-=c.tokens);else s.markedForRemoval=!0,o-=s.tokens}return e.sort((s,c)=>s.originalIndex-c.originalIndex)}trimPrefixLinesToFit(e,r,n){let o=0,s=[];for(let c=e.length-1;c>=0;c--){let l=e[c],u=l.tokens;if(o+u<=r)s.unshift(l),o+=u;else break}if(s.length===0){let c=e[e.length-1];if(c&&c.line.length>0){let u=n.takeLastTokens(c.line,r);return s.push({line:u.text,componentPath:c.componentPath,tokens:u.tokens.length}),[s,u.tokens.length]}let l=`Cannot fit prefix within limit of ${r} tokens`;throw new Error(l)}return[s,o]}};function sKn(t){return t.map(e=>e.elidedValue).join("")}a(sKn,"makePrompt");function aKn(t){return t.filter(e=>e.type==="prefix").map(e=>e.elidedValue).join("")}a(aKn,"makePrefixPrompt");function cKn(t){if(t.length===0)return[];let e=new Map;for(let o of t)if(o.type==="context"&&o.index!==void 0){e.has(o.index)||e.set(o.index,[]);let s=o.elidedValue.trim();s.length>0&&e.get(o.index).push(s)}let r=Math.max(...Array.from(e.keys()),-1),n=[];for(let o=0;o<=r;o++){let s=e.get(o);if(s&&s.length>0){let c=s.join(` +`).trim();n.push(c)}else n.push("")}return n}a(cKn,"makeContextPrompt");p();var kpe=class{constructor(e,r=cur()){this.snapshot=e;this.transformers=r}static{a(this,"SnapshotWalker")}walkSnapshot(e){this.walkSnapshotNode(this.snapshot,void 0,e,{})}walkSnapshotNode(e,r,n,o){let s=this.transformers.reduce((l,u)=>u(e,r,l),{...o});if(n(e,r,s))for(let l of e.children??[])this.walkSnapshotNode(l,e,n,s)}};function cur(){return[(t,e,r)=>{r.weight===void 0&&(r.weight=1);let n=t.props?.weight??1,o=typeof n=="number"?Math.max(0,Math.min(1,n)):1;return{...r,weight:o*r.weight}},(t,e,r)=>{if(t.name===Vj.name){let n=r.chunks?new Set(r.chunks):new Set;return n.add(t.path),{...r,chunks:n}}return r},(t,e,r)=>t.props?.source!==void 0?{...r,source:t.props.source}:r]}a(cur,"defaultTransformers");p();var lur={abap:{lineComment:{start:'"',end:""},markdownLanguageIds:["abap","sap-abap"]},aspdotnet:{lineComment:{start:"<%--",end:"--%>"}},bat:{lineComment:{start:"REM",end:""}},bibtex:{lineComment:{start:"%",end:""},markdownLanguageIds:["bibtex"]},blade:{lineComment:{start:"#",end:""}},BluespecSystemVerilog:{lineComment:{start:"//",end:""}},c:{lineComment:{start:"//",end:""},markdownLanguageIds:["c","h"]},clojure:{lineComment:{start:";",end:""},markdownLanguageIds:["clojure","clj"]},coffeescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["coffeescript","coffee","cson","iced"]},cpp:{lineComment:{start:"//",end:""},markdownLanguageIds:["cpp","hpp","cc","hh","c++","h++","cxx","hxx"]},csharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["csharp","cs"]},css:{lineComment:{start:"/*",end:"*/"}},cuda:{lineComment:{start:"//",end:""}},dart:{lineComment:{start:"//",end:""}},dockerfile:{lineComment:{start:"#",end:""},markdownLanguageIds:["dockerfile","docker"]},dotenv:{lineComment:{start:"#",end:""}},elixir:{lineComment:{start:"#",end:""}},erb:{lineComment:{start:"<%#",end:"%>"}},erlang:{lineComment:{start:"%",end:""},markdownLanguageIds:["erlang","erl"]},fsharp:{lineComment:{start:"//",end:""},markdownLanguageIds:["fsharp","fs","fsx","fsi","fsscript"]},go:{lineComment:{start:"//",end:""},markdownLanguageIds:["go","golang"]},graphql:{lineComment:{start:"#",end:""}},groovy:{lineComment:{start:"//",end:""}},haml:{lineComment:{start:"-#",end:""}},handlebars:{lineComment:{start:"{{!",end:"}}"},markdownLanguageIds:["handlebars","hbs","html.hbs","html.handlebars"]},haskell:{lineComment:{start:"--",end:""},markdownLanguageIds:["haskell","hs"]},hlsl:{lineComment:{start:"//",end:""}},html:{lineComment:{start:""},markdownLanguageIds:["html","xhtml"]},ini:{lineComment:{start:";",end:""}},java:{lineComment:{start:"//",end:""},markdownLanguageIds:["java","jsp"]},javascript:{lineComment:{start:"//",end:""},markdownLanguageIds:["javascript","js"]},javascriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},jsonc:{lineComment:{start:"//",end:""}},jsx:{lineComment:{start:"//",end:""},markdownLanguageIds:["jsx"]},julia:{lineComment:{start:"#",end:""},markdownLanguageIds:["julia","jl"]},kotlin:{lineComment:{start:"//",end:""},markdownLanguageIds:["kotlin","kt"]},latex:{lineComment:{start:"%",end:""},markdownLanguageIds:["tex"]},legend:{lineComment:{start:"//",end:""}},less:{lineComment:{start:"//",end:""}},lua:{lineComment:{start:"--",end:""},markdownLanguageIds:["lua","pluto"]},makefile:{lineComment:{start:"#",end:""},markdownLanguageIds:["makefile","mk","mak","make"]},markdown:{lineComment:{start:"[]: #",end:""},markdownLanguageIds:["markdown","md","mkdown","mkd"]},"objective-c":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec","mm","objc","obj-c"]},"objective-cpp":{lineComment:{start:"//",end:""},markdownLanguageIds:["objectivec++","objc+"]},perl:{lineComment:{start:"#",end:""},markdownLanguageIds:["perl","pl","pm"]},php:{lineComment:{start:"//",end:""}},powershell:{lineComment:{start:"#",end:""},markdownLanguageIds:["powershell","ps","ps1"]},pug:{lineComment:{start:"//",end:""}},python:{lineComment:{start:"#",end:""},markdownLanguageIds:["python","py","gyp"]},ql:{lineComment:{start:"//",end:""}},r:{lineComment:{start:"#",end:""}},razor:{lineComment:{start:""},markdownLanguageIds:["cshtml","razor","razor-cshtml"]},ruby:{lineComment:{start:"#",end:""},markdownLanguageIds:["ruby","rb","gemspec","podspec","thor","irb"]},rust:{lineComment:{start:"//",end:""},markdownLanguageIds:["rust","rs"]},sass:{lineComment:{start:"//",end:""}},scala:{lineComment:{start:"//",end:""}},scss:{lineComment:{start:"//",end:""}},shellscript:{lineComment:{start:"#",end:""},markdownLanguageIds:["bash","sh","zsh"]},slang:{lineComment:{start:"//",end:""}},slim:{lineComment:{start:"/",end:""}},solidity:{lineComment:{start:"//",end:""},markdownLanguageIds:["solidity","sol"]},sql:{lineComment:{start:"--",end:""}},stylus:{lineComment:{start:"//",end:""}},svelte:{lineComment:{start:""}},swift:{lineComment:{start:"//",end:""}},systemverilog:{lineComment:{start:"//",end:""}},terraform:{lineComment:{start:"#",end:""}},tex:{lineComment:{start:"%",end:""}},typescript:{lineComment:{start:"//",end:""},markdownLanguageIds:["typescript","ts"]},typescriptreact:{lineComment:{start:"//",end:""},markdownLanguageIds:["tsx"]},vb:{lineComment:{start:"'",end:""},markdownLanguageIds:["vb","vbscript"]},verilog:{lineComment:{start:"//",end:""}},"vue-html":{lineComment:{start:""}},vue:{lineComment:{start:"//",end:""}},xml:{lineComment:{start:""}},xsl:{lineComment:{start:""}},yaml:{lineComment:{start:"#",end:""},markdownLanguageIds:["yaml","yml"]}},lKn={};for(let[t,e]of Object.entries(lur))if(e.markdownLanguageIds)for(let r of e.markdownLanguageIds)lKn[r]=t;else lKn[t]=t;var rqs={start:"//",end:""},nqs=["php","plaintext"],uur={html:"",python:"#!/usr/bin/env python3",ruby:"#!/usr/bin/env ruby",shellscript:"#!/bin/sh",yaml:"# YAML data"};function uKn(t){return Object.values(uur).includes(t.trim())}a(uKn,"isShebangLine");function iqs({source:t}){return t.startsWith("#!")||t.startsWith("Pqs(s,e)).join(` +`).map(s=>oqs(s,e)).join(` `);return r?o+` -`:o}a(I5,"commentBlockAsSingles");function sct(t){let{languageId:e}=t;return Rqs.indexOf(e)===-1&&!kqs(t)?e in zlr?zlr[e]:`Language: ${e}`:""}a(sct,"getLanguageMarker");function act(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(act,"getPathMarker");function N2e(t){return t===""||t.endsWith(` +`:o}a(_5,"commentBlockAsSingles");function dct(t){let{languageId:e}=t;return nqs.indexOf(e)===-1&&!iqs(t)?e in uur?uur[e]:`Language: ${e}`:""}a(dct,"getLanguageMarker");function fct(t){return t.relativePath?`Path: ${t.relativePath}`:""}a(fct,"getPathMarker");function b2e(t){return t===""||t.endsWith(` `)?t:t+` -`}a(N2e,"newLineEnded");var Dqs=5,Mpe=class{constructor(){this.renderId=0;this.formatPrefix=TYn}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new oct,{blocks:[y,...E]}=A.elide(u,h,d,m,Ss(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...Nqs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-Dqs:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new Npe(e,Ylr).walkSnapshot((f,h,m)=>{if(f===e||(f.name===D2e.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:M2e(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:RYn(f.value)?y=A:y=I5(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:M2e(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${D2e.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},Ylr=[...Vlr(),(t,e,r)=>rct(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===YZ.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===ict.name?{...r,type:"suffix"}:r];function Nqs(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(Nqs,"computeComponentStatistics");function M2e(t){return t.replace(/\r\n?/g,` -`)}a(M2e,"normalizeLineEndings");p();var cct=a((t,e)=>{let[r,n]=e.useState();if(e.useData(vb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get(cn),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?zn(Mqs,{docInfo:c}):zn(Oqs,{docInfo:c})}},"DocumentMarker"),Mqs=a(t=>zn(cp,{children:act(t.docInfo)}),"PathMarker"),Oqs=a(t=>zn(cp,{children:sct(t.docInfo)}),"LanguageMarker");p();p();p();var OGs=ce(cX()),BGs=ce(B5()),_Jn=ce(ko()),LGs=ce(Rct());var L5=class extends _Jn.Disposable{static{a(this,"RecentEditsProvider")}};function FGs(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(FGs,"editIsTooCloseToCursor");var rlt=a((t,e)=>{let[r,n]=e.useState();return e.useData(vb,async o=>{if(!o.document)return;let s=t.ctx.get(L5);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get(cn),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(FGs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(N2e(`File: ${T}`)+N2e(b))}}if(f.length===0){n(void 0);return}let h=N2e("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+N2e("End of recent edits");n(h)}),r?zn(Zj,{children:zn(cp,{children:r})}):void 0},"RecentEdits");p();p();p();var nlt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>uX.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&ilt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs(Bzn(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function CJn(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(CJn,"shortCircuit");p();function QGs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(QGs,"defaultHash");function Zur(t,e={}){let{hash:r=QGs,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(Zur,"memoize");var vJn={entries:[],traits:[]},olt={entries:new Map,traits:[]},Xur=class extends nn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=jGs?c=olt:c=void 0);let l=performance.now()-s;if(sm.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new slt;return c}a(SJn,"getRelatedFiles");var edr=Zur(SJn,{cache:bJn,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});edr=CJn(edr,200,olt);async function alt(t,e,r,n,o,s=!1){let c=t.get(dX),l=olt;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await SJn(t,u,r,n,c):await edr(t,u,r,n,c)}catch(u){l=olt,u instanceof slt&&ht(t,"getRelatedFilesList",r)}return sm.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(alt,"getRelatedFilesAndTraits");function ilt(t,e){return kSe(t)===kSe(e)}a(ilt,"considerNeighborFile");var uX=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(cn);t.instance===void 0&&(t.instance=new nlt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(HGs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return sm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return sm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await alt(e,f,o,s,c,l);return m.entries.size===0?(sm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((E,_)=>{let v=t.getRelativePath(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function HGs(t,e){return t.get(Jt).excludeRelatedFiles(e)||qt(t,je.ExcludeRelatedFiles)}a(HGs,"isExcludeRelatedFilesActive");function TJn(t,e){return t.get(Jt).includeNeighboringFiles(e)||qt(t,je.IncludeNeighboringFiles)}a(TJn,"isIncludeNeighborFilesActive");var clt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(vb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=uX.defaultEmptyResult();u.turnOffSimilarFiles||(d=await uX.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=ehe(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...mYn(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||Xat(t.ctx,d,f.detectedLanguageId),y=t.ctx.get(cn).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await yYn(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn(p2,{children:[...o.map((u,d)=>zn(GGs,{snippet:u}))]})},"SimilarFiles"),GGs=a((t,e)=>zn(Zj,{children:[zn(cp,{children:t.snippet.headline}),zn(cp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var llt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(vb,c=>{c.traits!==r&&n(c.traits);let l=kSe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn(p2,{children:[zn(cp,{children:`Consider this related information: -`}),...r.map(c=>zn(cp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function IJn(t,e){return qt(t,je.UseSplitContextPrompt)??t.get(Jt).enablePromptContextProxyField(e)}a(IJn,"shouldUseSplitContextPrompt");function xJn(t){return zn(p2,{children:[zn(Hlr,{children:[zn(cct,{ctx:t,weight:.7}),zn(llt,{weight:.6}),zn(tct,{ctx:t,weight:.9}),zn(clt,{ctx:t,weight:.8})]}),zn(SYn,{weight:1}),zn(Glr,{children:zn(rlt,{ctx:t,weight:.99})}),zn(bYn,{weight:1})]})}a(xJn,"splitContextCompletionsPrompt");p();var wJn=0;function $Gs(){wJn=0}a($Gs,"resetContextIndex");function VGs(){return wJn++}a(VGs,"getNextContextIndex");var ult=class extends Mpe{constructor(){super(...arguments);this.formatPrefix=IYn;this.formatContext=xYn}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if($Gs(),new Npe(r,WGs).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===YZ.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:M2e(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:M2e(E),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${YZ.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},WGs=[...Ylr,(t,e,r)=>rct(t)?{...r,index:VGs()}:r];p();function dlt(t,e,r){let n=Qat(r,"Trait");for(let s of n)zGs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(dlt,"getTraitsFromContextItems");function zGs(t,e,r,n){let o=t.get(r0).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(zGs,"setupExpectationsForTraits");var YGs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function flt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=YGs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return ht(e,t,l)}}a(flt,"ReportTraitsTelemetry");p();p();p();var plt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},hlt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var mlt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(KGs(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new rdr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new tdr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},tdr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},rdr=class{constructor(e){this.lifecycleData=e;this.stateHook=new plt(e.state),this.dataHook=new hlt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function KGs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(KGs,"isFragmentFunction");var X2e=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new mlt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function vb(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(vb,"isCompletionRequestData");var ndr={default:{promptFunction:RJn,renderer:Mpe},splitContext:{promptFunction:xJn,renderer:ult}};function RJn(t){return zn(p2,{children:[zn(jlr,{children:[zn(cct,{ctx:t,weight:.7}),zn(llt,{weight:.6}),zn(tct,{ctx:t,weight:.9}),zn(clt,{ctx:t,weight:.8}),zn(rlt,{ctx:t,weight:.99})]}),zn(D2e,{weight:1})]})}a(RJn,"defaultCompletionsPrompt");var glt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new X2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=ehe(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return $F;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return $F;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` -`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return $F;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=oH(v.prefix),w={...v,prefix:b},R;if(Ppe(this.ctx,n)){let k=qat(v.metadata.componentStatistics);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(k),R=Hat(this.ctx,e,y),Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(Ppe(this.ctx,n)){c=await this.ctx.get(Cb).resolution(e);let{textDocument:f}=r,h=c.filter(Gat);ZGs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=dlt(this.ctx,e,h),flt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await ect(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return $F;if((await this.ctx.get(Cc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Elt;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return _s(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),the}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new X2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(ndr[this.promptOrdering]?.promptFunction??RJn)(this.ctx)}getRenderer(){let e=ndr[this.promptOrdering]??ndr.default;return new e.renderer}};function ZGs(t,e,r,n){let o=["cpp","c"];return TJn(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(ZGs,"similarFilesEnabled");p();p();p();var NJn=2e4,kJn=0,PJn=new nn;function MJn(t,e,r,n){kJn++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=PJn?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=Ss(o);m=uln(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),PJn.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:kJn,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(MJn,"renderWithMetadata");function OJn(t,e){return r=>{let n=r.text.join("")+` -`;return G0(e,n,()=>t.tokenLength(n)+1)}}a(OJn,"cachedLineCostFunction");function BJn(t,e,r){let o=t.split(` -`).map(f=>({id:uf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` -`),"");let c={id:uf(),text:s,children:o,canMerge:!0},u=JSe(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a(BJn,"getLinewiseNode");var _lt=class{constructor(){this.name="basicPrefix";this.costCache=new nn(NJn)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=Ss(n?.tokenizer),c=OJn(s,this.costCache);return{root:BJn(o,c,!1)}}},DJn={root:Q7,text:"",cost:0},Clt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new nn(5);this.costCache=new nn(NJn)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return DJn;let l=this.cache.get(r.textDocument.uri)||DJn;if(l.text===c)return l;let u=this.ctx.get(Jt).suffixMatchThreshold(n);if(l.text!==""){let g=new rce,A=g.takeFirstTokens(c,P2e);if(A.tokens.length>0&&100*nct(A.tokens,g.takeFirstTokens(l.text,P2e).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},vlt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ss(n?.tokenizer);if(!r||r.traits.length===0)return{root:Q7};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=uf(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: +`}a(b2e,"newLineEnded");var sqs=5,Dpe=class{constructor(){this.renderId=0;this.formatPrefix=sKn}static{a(this,"CompletionsPromptRenderer")}render(e,r,n){let o=this.renderId++,s=performance.now();try{if(n?.isCancellationRequested)return{status:"cancelled"};let c=r.delimiter??"",l=r.tokenizer??"o200k_base",{prefixBlocks:u,suffixBlock:d,componentStatistics:f}=this.processSnapshot(e,c,r.languageId),{prefixTokenLimit:h,suffixTokenLimit:m}=this.getPromptLimits(d,r),g=performance.now(),A=new uct,{blocks:[y,...E]}=A.elide(u,h,d,m,Cs(l)),_=performance.now(),v=this.formatPrefix(E),b=this.formatContext?this.formatContext(E):void 0,T=y.elidedValue,w=E.reduce((R,x)=>R+x.elidedTokens,0);return f.push(...aqs([...E,y])),{prefix:v,prefixTokens:w,suffix:T,suffixTokens:y.elidedTokens,context:b,status:"ok",metadata:{renderId:o,rendererName:"c",tokenizer:l,elisionTimeMs:_-g,renderTimeMs:performance.now()-s,componentStatistics:f,updateDataTimeMs:f.reduce((R,x)=>R+(x.updateDataTimeMs??0),0)}}}catch(c){return{status:"error",error:c}}}getPromptLimits(e,r){let n=e?.value??"",o=r.promptTokenLimit,s=r.suffixPercent;if(n.length==0||s==0)return{prefixTokenLimit:o,suffixTokenLimit:0};o=n.length>0?o-sqs:o;let c=Math.ceil(o*(s/100));return{prefixTokenLimit:o-c,suffixTokenLimit:c}}processSnapshot(e,r,n){let o=[],s=[],c=[],l=!1;if(new kpe(e,dur).walkSnapshot((f,h,m)=>{if(f===e||(f.name===C2e.name&&(l=!0),f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.value===void 0||f.value===""))return!0;let g=m.chunks;if(m.type==="suffix")s.push({value:S2e(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let A=f.value.endsWith(r)?f.value:f.value+r,y=A;m.type==="prefix"?y=f.value:uKn(f.value)?y=A:y=_5(A,n),o.push({type:m.type==="prefix"?"prefix":"context",value:S2e(y),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source})}return!0}),!l)throw new Error(`Node of type ${C2e.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},dur=[...cur(),(t,e,r)=>act(t)?{...r,type:"context"}:r,(t,e,r)=>t.name===GZ.name?{...r,type:"prefix"}:r,(t,e,r)=>t.name===lct.name?{...r,type:"suffix"}:r];function aqs(t){return t.map(e=>{let r={componentPath:e.componentPath};return e.tokens!==0&&(r.expectedTokens=e.tokens,r.actualTokens=e.elidedTokens),e.nodeStatistics.updateDataTimeMs!==void 0&&(r.updateDataTimeMs=e.nodeStatistics.updateDataTimeMs),e.source&&(r.source=e.source),r})}a(aqs,"computeComponentStatistics");function S2e(t){return t.replace(/\r\n?/g,` +`)}a(S2e,"normalizeLineEndings");p();var pct=a((t,e)=>{let[r,n]=e.useState();if(e.useData(mb,o=>{o.document.uri!==r?.uri&&n(o.document)}),r){let o=t.ctx.get(an),s=o.getRelativePath(r),c={uri:r.uri,source:r.getText(),relativePath:s,languageId:r.detectedLanguageId},l=o.findNotebook(r);return c.relativePath&&!l?zn(cqs,{docInfo:c}):zn(lqs,{docInfo:c})}},"DocumentMarker"),cqs=a(t=>zn(fp,{children:fct(t.docInfo)}),"PathMarker"),lqs=a(t=>zn(fp,{children:dct(t.docInfo)}),"LanguageMarker");p();p();p();var lGs=fe(nX()),uGs=fe(P5()),tZn=fe(Io()),dGs=fe(Mct());var k5=class extends tZn.Disposable{static{a(this,"RecentEditsProvider")}};function fGs(t,e=!1,r=void 0,n){if(e&&(r===void 0||n===void 0))throw new Error("cursorLine and activeDocDistanceLimitFromCursor are required when filterByCursorLine is true");let o=t.startLine-1,s=t.endLine-1;return!!(e&&(Math.abs(o-r)<=n||Math.abs(s-r)<=n))}a(fGs,"editIsTooCloseToCursor");var alt=a((t,e)=>{let[r,n]=e.useState();return e.useData(mb,async o=>{if(!o.document)return;let s=t.ctx.get(k5);if(s.isEnabled())s.start();else return;let c=s.config,l=s.getRecentEdits(),u=new Set,d=t.ctx.get(an),f=[];for(let m=l.length-1;m>=0&&!(f.length>=c.maxEdits);m--){let g=l[m];if(!await d.getTextDocument({uri:g.file}))continue;let A=!u.has(g.file);if(u.size+(A?1:0)>c.maxFiles)break;let E=g.file===o.document?.uri,_=E?o.position.line:void 0;if(fGs(g,E,_,c.activeDocDistanceLimitFromCursor))continue;let b=s.getEditSummary(g);if(b){u.add(g.file);let T=d.getRelativePath({uri:g.file});f.unshift(b2e(`File: ${T}`)+b2e(b))}}if(f.length===0){n(void 0);return}let h=b2e("These are recently edited files. Do not suggest code that has been deleted.")+f.join("")+b2e("End of recent edits");n(h)}),r?zn(Vj,{children:zn(fp,{children:r})}):void 0},"RecentEdits");p();p();p();var clt=class{constructor(e){this.docManager=e}static{a(this,"OpenTabFiles")}truncateDocs(e,r,n,o){let s=new Map,c=0;for(let l of e)if(!(c+l.getText().length>oX.MAX_NEIGHBOR_AGGREGATE_LENGTH)&&(l.uri.startsWith("file:")&&r.startsWith("file:")&&l.uri!==r&&llt(n,l.detectedLanguageId)&&(s.set(l.uri.toString(),{uri:l.uri.toString(),relativePath:this.docManager.getRelativePath(l),source:l.getText()}),c+=l.getText().length),s.size>=o))break;return s}async getNeighborFiles(e,r,n){let o=new Map,s=new Map;return o=this.truncateDocs(AYn(await this.docManager.textDocuments()),e,r,n),s.set("opentabs",Array.from(o.keys()).map(c=>c.toString())),{docs:o,neighborSource:s}}};p();p();function rZn(t,e,r){return async function(...n){return await Promise.race([t.apply(this,n),new Promise(o=>{setTimeout(o,e,r)})])}}a(rZn,"shortCircuit");p();function hGs(...t){return JSON.stringify(t,(e,r)=>typeof r=="object"?r:String(r))}a(hGs,"defaultHash");function hdr(t,e={}){let{hash:r=hGs,cache:n=new Map}=e;return function(...o){let s=r.apply(this,o);if(n.has(s))return n.get(s);let c=t.apply(this,o);return c instanceof Promise&&(c=c.catch(l=>{throw n.delete(s),l})),n.set(s,c),c}}a(hdr,"memoize");var nZn={entries:[],traits:[]},ult={entries:new Map,traits:[]},mdr=class extends yn{constructor(r,n=120*1e3){super(r);this.defaultEvictionTimeMs=n;this._cacheTimestamps=new Map}static{a(this,"PromiseExpirationCacheMap")}bumpRetryCount(r){let n=this._cacheTimestamps.get(r);return n?++n.retryCount:(this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),0)}has(r){return this.isValid(r)?super.has(r):(this.deleteExpiredEntry(r),!1)}get(r){let n=super.get(r);if(this.isValid(r))return n;this.deleteExpiredEntry(r)}set(r,n){let o=super.set(r,n);return this.isValid(r)||this._cacheTimestamps.set(r,{timestamp:Date.now(),retryCount:0}),o}clear(){super.clear(),this._cacheTimestamps.clear()}isValid(r){let n=this._cacheTimestamps.get(r);return n!==void 0&&Date.now()-n.timestamp=gGs?c=ult:c=void 0);let l=performance.now()-s;if(cm.debug(t,c!==void 0?`Fetched ${[...c.entries.values()].map(u=>u.size).reduce((u,d)=>u+d,0)} related files for '${e.uri}' in ${l}ms.`:`Failing fetching files for '${e.uri}' in ${l}ms.`),c===void 0)throw new dlt;return c}a(oZn,"getRelatedFiles");var gdr=hdr(oZn,{cache:iZn,hash:a((t,e,r,n,o)=>`${e.uri}`,"hash")});gdr=rZn(gdr,200,ult);async function flt(t,e,r,n,o,s=!1){let c=t.get(sX),l=ult;try{let u={uri:e.uri,clientLanguageId:e.clientLanguageId,data:o};l=s?await oZn(t,u,r,n,c):await gdr(t,u,r,n,c)}catch(u){l=ult,u instanceof dlt&&yt(t,"getRelatedFilesList",r)}return cm.debug(t,l!=null?`Fetched following traits ${l.traits.map(u=>`{${u.name} : ${u.value}}`).join("")} for '${e.uri}'`:`Failing fecthing traits for '${e.uri}'.`),l}a(flt,"getRelatedFilesAndTraits");function llt(t,e){return ASe(t)===ASe(e)}a(llt,"considerNeighborFile");var oX=class t{static{a(this,"NeighborSource")}static{this.MAX_NEIGHBOR_AGGREGATE_LENGTH=2e5}static{this.MAX_NEIGHBOR_FILES=20}static{this.EXCLUDED_NEIGHBORS=["node_modules","dist","site-packages"]}static defaultEmptyResult(){return{docs:new Map,neighborSource:new Map,traits:[]}}static reset(){t.instance=void 0}static async getNeighborFilesAndTraits(e,r,n,o,s,c,l){let u=e.get(an);t.instance===void 0&&(t.instance=new clt(u));let d={...await t.instance.getNeighborFiles(r,n,t.MAX_NEIGHBOR_FILES),traits:[]};if(AGs(e,o))return d;let f=await u.getTextDocument({uri:r});if(!f)return cm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: failed to get the document ${r}`),d;let h=u.getWorkspaceFolder(f);if(!h)return cm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`Failed to get the related files: ${r} is not under the workspace folder`),d;let m=await flt(e,f,o,s,c,l);return m.entries.size===0?(cm.debug(e,"neighborFiles.getNeighborFilesAndTraits",`0 related files found for ${r}`),d.traits.push(...m.traits),d):(m.entries.forEach((g,A)=>{let y=[];g.forEach((E,_)=>{let v=t.getRelativePath(_,h.uri);if(!v||d.docs.has(_))return;let b={relativePath:v,uri:_,source:E};y.unshift(b),d.docs.set(_,b)}),y.length>0&&d.neighborSource.set(A,y.map(E=>E.uri.toString()))}),d.traits.push(...m.traits),d)}static basename(e){return decodeURIComponent(e.replace(/[#?].*$/,"").replace(/^.*[/:]/,""))}static getRelativePath(e,r){let n=r.toString().replace(/[#?].*/,"").replace(/\/?$/,"/");return e.toString().startsWith(n)?e.toString().slice(n.length):t.basename(e)}};function AGs(t,e){return t.get(Jt).excludeRelatedFiles(e)||Ht(t,Je.ExcludeRelatedFiles)}a(AGs,"isExcludeRelatedFilesActive");function sZn(t,e){return t.get(Jt).includeNeighboringFiles(e)||Ht(t,Je.IncludeNeighboringFiles)}a(sZn,"isIncludeNeighborFilesActive");var plt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState([]);e.useData(mb,async u=>{u.document.uri!==r?.uri&&s([]),n(u.document);let d=oX.defaultEmptyResult();u.turnOffSimilarFiles||(d=await oX.getNeighborFilesAndTraits(t.ctx,u.document.uri,u.document.detectedLanguageId,u.telemetryData,u.cancellationToken,u.data));let f=await c(u.telemetryData,u.document,u,d);s(f)});async function c(u,d,f,h){let m=Zpe(t.ctx,u,d.detectedLanguageId);return(await l(m,u,d,f,h)).filter(A=>A.snippet.length>0).sort((A,y)=>A.score-y.score).map(A=>({...KYn(A),score:A.score}))}a(c,"produceSimilarFiles");async function l(u,d,f,h,m){let g=u.similarFilesOptions||ict(t.ctx,d,f.detectedLanguageId),y=t.ctx.get(an).getRelativePath(f),E={uri:f.uri,source:f.getText(),offset:f.offsetAt(h.position),relativePath:y,languageId:f.detectedLanguageId};return await XYn(E,Array.from(m.docs.values()),g)}return a(l,"findSimilarSnippets"),zn(u2,{children:[...o.map((u,d)=>zn(yGs,{snippet:u}))]})},"SimilarFiles"),yGs=a((t,e)=>zn(Vj,{children:[zn(fp,{children:t.snippet.headline}),zn(fp,{children:t.snippet.snippet})]}),"SimilarFile");p();p();var hlt=a((t,e)=>{let[r,n]=e.useState(),[o,s]=e.useState();if(e.useData(mb,c=>{c.traits!==r&&n(c.traits);let l=ASe(c.document.detectedLanguageId);l!==o&&s(l)}),!(!r||r.length===0||!o))return zn(u2,{children:[zn(fp,{children:`Consider this related information: +`}),...r.map(c=>zn(fp,{source:c,children:`${c.name}: ${c.value}`},c.id))]})},"Traits");function aZn(t,e){return Ht(t,Je.UseSplitContextPrompt)??t.get(Jt).enablePromptContextProxyField(e)}a(aZn,"shouldUseSplitContextPrompt");function cZn(t){return zn(u2,{children:[zn(our,{children:[zn(pct,{ctx:t,weight:.7}),zn(hlt,{weight:.6}),zn(sct,{ctx:t,weight:.9}),zn(plt,{ctx:t,weight:.8})]}),zn(oKn,{weight:1}),zn(sur,{children:zn(alt,{ctx:t,weight:.99})}),zn(iKn,{weight:1})]})}a(cZn,"splitContextCompletionsPrompt");p();var lZn=0;function EGs(){lZn=0}a(EGs,"resetContextIndex");function _Gs(){return lZn++}a(_Gs,"getNextContextIndex");var mlt=class extends Dpe{constructor(){super(...arguments);this.formatPrefix=aKn;this.formatContext=cKn}static{a(this,"SplitContextPromptRenderer")}processSnapshot(r,n){let o=[],s=[],c=[],l=!1;if(EGs(),new kpe(r,vGs).walkSnapshot((f,h,m)=>{if(f===r||(f.statistics.updateDataTimeMs&&f.statistics.updateDataTimeMs>0&&c.push({componentPath:f.path,updateDataTimeMs:f.statistics.updateDataTimeMs}),f.name===GZ.name&&(l=!0),f.value===void 0||f.value===""))return!0;let g=m.chunks,A=m.type;if(A==="suffix")s.push({value:S2e(f.value),type:"suffix",weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source});else{let y=A==="prefix",E=y||f.value.endsWith(n)?f.value:f.value+n;o.push({type:y?"prefix":"context",value:S2e(E),weight:m.weight,componentPath:f.path,nodeStatistics:f.statistics,chunks:g,source:m.source,index:y?void 0:m.index})}return!0}),!l)throw new Error(`Node of type ${GZ.name} not found`);if(s.length>1)throw new Error("Only one suffix is allowed");let d=s.length===1?s[0]:{componentPath:"",value:"",weight:1,nodeStatistics:{},type:"suffix"};return{prefixBlocks:o,suffixBlock:d,componentStatistics:c}}},vGs=[...dur,(t,e,r)=>act(t)?{...r,index:_Gs()}:r];p();function glt(t,e,r){let n=$at(r,"Trait");for(let s of n)CGs(t,e,s.data,s.providerId);return n.flatMap(s=>s.data).sort((s,c)=>(s.importance??0)-(c.importance??0))}a(glt,"getTraitsFromContextItems");function CGs(t,e,r,n){let o=t.get(i0).getStatisticsForCompletion(e);r.forEach(s=>{o.addExpectations(n,[[s,"included"]])})}a(CGs,"setupExpectationsForTraits");var bGs=new Map([["TargetFrameworks","targetFrameworks"],["LanguageVersion","languageVersion"]]);function Alt(t,e,r,n,o,s){if(r.length>0){let c={};c.detectedLanguageId=n,c.languageId=o;for(let u of r){let d=bGs.get(u.name);d&&(c[d]=u.value)}let l=s.extendedBy(c,{});return yt(e,t,l)}}a(Alt,"ReportTraitsTelemetry");p();p();p();var ylt=class{constructor(e){this.states=e;this.currentIndex=0;this.stateChanged=!1}static{a(this,"UseState")}useState(e){let r=this.currentIndex;if(this.states[r]===void 0){let o=typeof e=="function"?e():e;this.states[r]=o}let n=a(o=>{let s=typeof o=="function"?o(this.states[r]):o;this.states[r]=s,this.stateChanged=!0},"setState");return this.currentIndex++,[this.states[r],n]}hasChanged(){return this.stateChanged}},Elt=class{constructor(e){this.measureUpdateTime=e;this.consumers=[]}static{a(this,"UseData")}useData(e,r){this.consumers.push(n=>{if(e(n))return r(n)})}async updateData(e){if(this.consumers.length>0){let r=performance.now();for(let n of this.consumers)await n(e);this.measureUpdateTime(performance.now()-r)}}};var _lt=class{constructor(e){this.lifecycleData=new Map;this.vTree=this.virtualizeElement(e,"$",0)}static{a(this,"VirtualPromptReconciler")}reconcile(e){if(!this.vTree)throw new Error("No tree to reconcile, make sure to pass a valid prompt");return e?.isCancellationRequested?this.vTree:(this.vTree=this.reconcileNode(this.vTree,"$",0,e),this.vTree)}reconcileNode(e,r,n,o){if(!e.children&&!e.lifecycle)return e;let s=e;if(e.lifecycle?.isRemountRequired()){let l=this.collectChildPaths(e);s=this.virtualizeElement(e.component,r,n);let u=this.collectChildPaths(s);this.cleanupState(l,u)}else if(e.children){let l=[];for(let u=0;u"u")){if(typeof e=="string"||typeof e=="number")return{name:typeof e,path:`${r}[${n}]`,props:{value:e},component:e};if(SGs(e.type)){let o=e.type(e.props.children),s=r!=="$"?`[${n}]`:"",c=`${r}${s}.${o.type}`,l=o.children.map((u,d)=>this.virtualizeElement(u,c,d));return this.ensureUniqueKeys(l),{name:o.type,path:c,children:l.flat().filter(u=>u!==void 0),component:e}}return this.virtualizeFunctionComponent(r,n,e,e.type)}}virtualizeFunctionComponent(e,r,n,o){let s=n.props.key?`["${n.props.key}"]`:`[${r}]`,c=`${e}${s}.${o.name}`,l=new ydr(this.getOrCreateLifecycleData(c)),u=o(n.props,l),h=(Array.isArray(u)?u:[u]).map((m,g)=>this.virtualizeElement(m,c,g)).flat().filter(m=>m!==void 0);return this.ensureUniqueKeys(h),{name:o.name,path:c,props:n.props,children:h,component:n,lifecycle:l}}ensureUniqueKeys(e){let r=new Map;for(let o of e){if(!o)continue;let s=o.props?.key;s&&r.set(s,(r.get(s)||0)+1)}let n=Array.from(r.entries()).filter(([o,s])=>s>1).map(([o])=>o);if(n.length>0)throw new Error(`Duplicate keys found: ${n.join(", ")}`)}collectChildPaths(e){let r=[];if(e?.children)for(let n of e.children)n&&(r.push(n.path),r.push(...this.collectChildPaths(n)));return r}cleanupState(e,r){for(let n of e)r.includes(n)||this.lifecycleData.delete(n)}getOrCreateLifecycleData(e){return this.lifecycleData.has(e)||this.lifecycleData.set(e,new Adr([])),this.lifecycleData.get(e)}createPipe(){return{pump:a(async e=>{await this.pumpData(e)},"pump")}}async pumpData(e){if(!this.vTree)throw new Error("No tree to pump data into. Pumping data before initializing?");await this.recursivelyPumpData(e,this.vTree)}async recursivelyPumpData(e,r){if(!r)throw new Error("Can't pump data into undefined node.");await r.lifecycle?.dataHook.updateData(e);for(let n of r.children||[])await this.recursivelyPumpData(e,n)}},Adr=class{static{a(this,"PromptElementLifecycleData")}constructor(e){this.state=e,this._updateTimeMs=0}getUpdateTimeMsAndReset(){let e=this._updateTimeMs;return this._updateTimeMs=0,e}},ydr=class{constructor(e){this.lifecycleData=e;this.stateHook=new ylt(e.state),this.dataHook=new Elt(r=>{e._updateTimeMs=r})}static{a(this,"PromptElementLifecycle")}useState(e){return this.stateHook.useState(e)}useData(e,r){this.dataHook.useData(e,r)}isRemountRequired(){return this.stateHook.hasChanged()}};function SGs(t){return typeof t=="function"&&"isFragmentFunction"in t}a(SGs,"isFragmentFunction");var H2e=class{static{a(this,"VirtualPrompt")}constructor(e){this.reconciler=new _lt(e)}snapshotNode(e,r){if(!e)return;if(r?.isCancellationRequested)return"cancelled";let n=[];for(let o of e.children??[]){let s=this.snapshotNode(o,r);if(s==="cancelled")return"cancelled";s!==void 0&&n.push(s)}return{value:e.props?.value?.toString(),name:e.name,path:e.path,props:e.props,children:n,statistics:{updateDataTimeMs:e.lifecycle?.lifecycleData.getUpdateTimeMsAndReset()}}}snapshot(e){try{let r=this.reconciler.reconcile(e);if(e?.isCancellationRequested)return{snapshot:void 0,status:"cancelled"};if(!r)throw new Error("Invalid virtual prompt tree");let n=this.snapshotNode(r,e);return n==="cancelled"||e?.isCancellationRequested?{snapshot:void 0,status:"cancelled"}:{snapshot:n,status:"ok"}}catch(r){return{snapshot:void 0,status:"error",error:r}}}createPipe(){return this.reconciler.createPipe()}};function mb(t){if(!t||typeof t!="object")return!1;let e=t;return!(!e.document||!e.position||e.position.line===void 0||e.position.character===void 0||!e.telemetryData)}a(mb,"isCompletionRequestData");var Edr={default:{promptFunction:uZn,renderer:Dpe},splitContext:{promptFunction:cZn,renderer:mlt}};function uZn(t){return zn(u2,{children:[zn(iur,{children:[zn(pct,{ctx:t,weight:.7}),zn(hlt,{weight:.6}),zn(sct,{ctx:t,weight:.9}),zn(plt,{ctx:t,weight:.8}),zn(alt,{ctx:t,weight:.99})]}),zn(C2e,{weight:1})]})}a(uZn,"defaultCompletionsPrompt");var vlt=class{constructor(e,r,n){this.ctx=e;this.promptOrdering=n??"default",this.virtualPrompt=r??new H2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe(),this.renderer=this.getRenderer()}static{a(this,"ComponentsCompletionsPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}async createPromptUnsafe({completionId:e,completionState:r,telemetryData:n,promptOpts:o},s){let{maxPromptLength:c,suffixPercent:l,suffixMatchThreshold:u}=Zpe(this.ctx,n,r.textDocument.detectedLanguageId),d=await this.failFastPrompt(r.textDocument,r.position,l,s);if(d)return d;let f=o?.separateContext?"splitContext":"default";this.setPromptOrdering(f);let h=performance.now(),{traits:m,codeSnippets:g,turnOffSimilarFiles:A,resolvedContextItems:y}=await this.resolveContext(e,r,n,s,o);if(await this.updateComponentData(r.textDocument,r.position,m,g,n,A,c,s,o,u,o?.tokenizer),s?.isCancellationRequested)return FF;let E=this.virtualPrompt.snapshot(s),_=E.status;if(_==="cancelled")return FF;if(_==="error")return this.errorPrompt(E.error);let v=this.renderer.render(E.snapshot,{delimiter:` +`,tokenizer:o?.tokenizer,promptTokenLimit:c,suffixPercent:l,languageId:r.textDocument.detectedLanguageId},s);if(v.status==="cancelled")return FF;if(v.status==="error")return this.errorPrompt(v.error);let[b,T]=Xj(v.prefix),w={...v,prefix:b},R;if(Rpe(this.ctx,n)){let P=Vat(v.metadata.componentStatistics);this.ctx.get(i0).getStatisticsForCompletion(e).computeMatch(P),R=zat(this.ctx,e,y),Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(R)}'`)}let x=performance.now();return this.resetIfEmpty(v),this.successPrompt(w,x,h,T,R)}async updateComponentData(e,r,n,o,s,c,l,u,d={},f,h){let m=this.createRequestData(e,r,s,u,d,l,n,o,c,f,h);await this.pipe.pump(m)}async resolveContext(e,r,n,o,s={}){let c=[],l,u,d=!1;if(Rpe(this.ctx,n)){c=await this.ctx.get(hb).resolution(e);let{textDocument:f}=r,h=c.filter(Yat);IGs(this.ctx,f.detectedLanguageId,h,n)||(d=!0),l=glt(this.ctx,e,h),Alt("contextProvider.traits",this.ctx,l,f.detectedLanguageId,f.detectedLanguageId,n),u=await oct(this.ctx,e,h,f.detectedLanguageId)}return{traits:l,codeSnippets:u,turnOffSimilarFiles:d,resolvedContextItems:c}}async failFastPrompt(e,r,n,o){if(o?.isCancellationRequested)return FF;if((await this.ctx.get(ec).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Slt;if((n>0?e.getText().length:e.offsetAt(r))0},computeTimeMs:r-n,trailingWs:o,neighborSource:new Map,metadata:e.metadata,contextProvidersTelemetry:s}}errorPrompt(e){return La(this.ctx,e,"PromptComponents.CompletionsPromptFactory"),this.reset(),Xpe}reset(){this.renderer=this.getRenderer(),this.virtualPrompt=new H2e(this.completionsPrompt()),this.pipe=this.virtualPrompt.createPipe()}setPromptOrdering(e){this.promptOrdering!==e&&(this.promptOrdering=e,this.reset())}completionsPrompt(){return(Edr[this.promptOrdering]?.promptFunction??uZn)(this.ctx)}getRenderer(){let e=Edr[this.promptOrdering]??Edr.default;return new e.renderer}};function IGs(t,e,r,n){let o=["cpp","c"];return sZn(t,n)||o.includes(e)||!r.some(c=>c.data.some(l=>l.type==="CodeSnippet"))}a(IGs,"similarFilesEnabled");p();p();p();var hZn=2e4,dZn=0,fZn=new yn;function mZn(t,e,r,n){dZn++;let o=r.promptOpts?.tokenizer??"o200k_base",s=performance.now(),{root:c,mask:l,statistics:u}=t.snapshot(r,n),d=performance.now(),f=new Set(l),h=fZn?.get(c.id),m;if(h&&h.budget>=e&&h.render.cost<=e&&h.tokenizer===o&&f.size===h.mask.size&&[...f].every(v=>h.mask.has(v)))m=h.render;else{let v=Cs(o);m=epn(c,{budget:e,mask:l,costFunction:a(T=>v.tokenLength(T),"costFunction")}),fZn.set(c.id,{budget:e,mask:f,tokenizer:o,render:m})}let{text:g,cost:A,renderedNodes:y}=m,E=performance.now();for(let[v,b]of u?.entries()??[])b.actualTokens=y.get(v)?.cost??0;let _={renderId:dZn,rendererName:"renderNode",tokenizer:o,elisionTimeMs:E-d,renderTimeMs:d-s,updateDataTimeMs:0,componentStatistics:[{componentPath:t.name,actualTokens:A}]};return{root:c,renderedNodes:y,text:g,cost:A,metadata:_}}a(mZn,"renderWithMetadata");function gZn(t,e){return r=>{let n=r.text.join("")+` +`;return V0(e,n,()=>t.tokenLength(n)+1)}}a(gZn,"cachedLineCostFunction");function AZn(t,e,r){let o=t.split(` +`).map(f=>({id:lf(),text:[f],children:[],canMerge:!0})),s=[""];o.length>=1&&s.push(...Array(o.length-1).fill(` +`),"");let c={id:lf(),text:s,children:o,canMerge:!0},u=_Te(c,a(f=>f.id===c.id?0:e(f),"nodeCostFunction")),d=r?o.length:1;for(let f of u.children)f.weight=d*Math.max(1,f.cost),d+=r?-1:1;return u}a(AZn,"getLinewiseNode");var Tlt=class{constructor(){this.name="basicPrefix";this.costCache=new yn(hZn)}static{a(this,"BasicPrefixComponent")}snapshot(e){let{completionState:r,promptOpts:n}=e,o=r.textDocument.getText({start:{line:0,character:0},end:r.position}),s=Cs(n?.tokenizer),c=gZn(s,this.costCache);return{root:AZn(o,c,!1)}}},pZn={root:oQ,text:"",cost:0},Ilt=class{constructor(e){this.ctx=e;this.name="cachedSuffix";this.cache=new yn(5);this.costCache=new yn(hZn)}static{a(this,"CachedSuffixComponent")}snapshot(e){return{root:this.getCachedSuffix(e).root}}estimatedCost(e,r){return this.getCachedSuffix(e).cost}getCachedSuffix(e){let{completionState:r,telemetryData:n,promptOpts:o}=e,c=r.textDocument.getText({start:r.position,end:{line:Number.MAX_VALUE,character:Number.MAX_VALUE}}).replace(/^.*/,"").trimStart();if(c==="")return pZn;let l=this.cache.get(r.textDocument.uri)||pZn;if(l.text===c)return l;let u=this.ctx.get(Jt).suffixMatchThreshold(n);if(l.text!==""){let g=new Wae,A=g.takeFirstTokens(c,v2e);if(A.tokens.length>0&&100*cct(A.tokens,g.takeFirstTokens(l.text,v2e).tokens)?.scoreg+A.cost+1,0);return{root:h,cost:m,text:c}}},xlt=class{constructor(){this.name="traitProvider"}static{a(this,"TraitComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Cs(n?.tokenizer);if(!r||r.traits.length===0)return{root:oQ};let s=new Map,c=0,l=[],u=new Map;for(let m of r.traits){let g=lf(),A=`${m.name}: ${m.value}`,y={id:g,text:[A],children:[],cost:o.tokenLength(A),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};l.push(y),u.set(g,{componentPath:m.id,source:m,expectedTokens:y.cost}),s.set(g,m.importance??0),c+=m.importance??0}c=Math.max(c,1);let f=[`Related context: `,...new Array(l.length).fill(` -`)],h={id:uf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return KSe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},blt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Ss(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:Q7};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;G0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get(cn);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: +`)],h={id:lf(),text:f,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return ETe(h,m=>(s.get(m.id)??0)/c),{root:h,statistics:u}}},wlt=class{constructor(e){this.ctx=e;this.name="contextProvider"}static{a(this,"CodeSnippetComponent")}snapshot(e,r){let{promptOpts:n}=e,o=Cs(n?.tokenizer);if(!r||r.codeSnippets.length===0)return{root:oQ};let s=new Map;for(let g of r.codeSnippets){let A=g.uri;V0(s,A,()=>[]).push(g)}let c=new Map,l=[],u=new Map,d=0,f=this.ctx.get(an);for(let[g,A]of s.entries()){let y=f.getRelativePath({uri:g})??g,_=[`Compare ${A.length>1?"these snippets":"this snippet"} from ${y}: `,...new Array(A.length).fill(` -`)],v=[];for(let b of A){let T=uf();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:uf(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:uf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return KSe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Slt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==Q7.id);if(o.length===0)return{root:Q7};let s=["",...Array(o.length-1).fill(` -`),""],c={id:uf(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var XGs=.8,Tlt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(Jt).suffixPercent(e),n=this.ctx.get(Jt).stableContextPercent(e),o=this.ctx.get(Jt).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;Ppe(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=ehe(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>XGs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let L=b+A*y[N],B=MJn(this.components[N],L,e,d);b=L-B.cost,h[N]=B,e$s(m,B.metadata)}let[T,w]=oH(h.prefix.text),R=performance.now(),x=Ppe(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],k=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:I5(k.join(` +`)],v=[];for(let b of A){let T=lf();u.set(T,b.importance??0);let w={id:T,text:[b.value],children:[],cost:o.tokenLength(b.value),weight:b.importance??0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1};v.push(w),d+=b.importance??0,c.set(T,{componentPath:b.id,source:b,expectedTokens:w.cost})}l.push({id:lf(),text:_,children:v,cost:o.tokenLength(_.join("")),weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0})}d=Math.max(d,1);let h=new Array(l.length+1).fill(""),m={id:lf(),text:h,children:l,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0};return ETe(m,g=>(u.get(g.id)??0)/d),{root:m,statistics:c}}},Rlt=class{constructor(e,r){this.name=e;this.components=r}static{a(this,"ConcatenatedContextComponent")}snapshot(e,r){let n=this.components.map(d=>d.snapshot(e,r)),o=n.map(d=>d.root).filter(d=>d.id!==oQ.id);if(o.length===0)return{root:oQ};let s=["",...Array(o.length-1).fill(` +`),""],c={id:lf(),text:s,children:o,cost:0,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!1},l=[],u=new Map;for(let d of n){for(let[f,h]of d.statistics?.entries()??[])u.set(f,h);d.mask&&l.push(...d.mask)}return{root:c,mask:l,statistics:u}}};var xGs=.8,Plt=class{constructor(e,r){this.ctx=e;this.components=r;this.renderId=0}static{a(this,"CascadingPromptFactory")}async prompt(e,r){try{return await this.createPromptUnsafe(e,r)}catch(n){return this.errorPrompt(n)}}getComponentAllocation(e){let r=this.ctx.get(Jt).suffixPercent(e),n=this.ctx.get(Jt).stableContextPercent(e),o=this.ctx.get(Jt).volatileContextPercent(e);if(r<0||r>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${r}`);if(n<0||n>100)throw new Error(`stableContextPercent must be between 0 and 100, but was ${n}`);if(o<0||o>100)throw new Error(`volatileContextPercent must be between 0 and 100, but was ${o}`);let s=100-r-n-o;if(s<=1||s>100)throw new Error(`prefixPercent must be between 1 and 100, but was ${s}`);return{prefix:s/100,suffix:r/100,stableContext:n/100,volatileContext:o/100}}async createPromptUnsafe(e,r){this.renderId++;let{completionId:n,completionState:o,telemetryData:s,promptOpts:c}=e,l=await this.failFastPrompt(o.textDocument,r);if(l)return l;let u=performance.now(),d;Rpe(this.ctx,s)&&(d=await this.resolveContext(n,o,s,r));let f=performance.now()-u,h={},m={renderId:this.renderId,rendererName:"w",tokenizer:c?.tokenizer??"o200k_base",elisionTimeMs:0,renderTimeMs:0,updateDataTimeMs:f,componentStatistics:[]},g=o.textDocument.detectedLanguageId,{maxPromptLength:A}=Zpe(this.ctx,s,g),y=this.getComponentAllocation(s),E=y.suffix*A,_=this.components.suffix.estimatedCost?.(e,d),v=["stableContext","volatileContext","prefix","suffix"];E>xGs*(_??0)&&(v=["stableContext","volatileContext","suffix","prefix"]);let b=0;for(let N of v){let B=b+A*y[N],L=mZn(this.components[N],B,e,d);b=B-L.cost,h[N]=L,wGs(m,L.metadata)}let[T,w]=Xj(h.prefix.text),R=performance.now(),x=Rpe(this.ctx,s)?this.telemetrizeContext(n,m.componentStatistics,d?.resolvedContextItems??[]):[],P=[h.stableContext.text.trim(),h.volatileContext.text.trim()];return{type:"prompt",prompt:{prefix:c?.separateContext?T:_5(P.join(` `),g)+` -`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?k:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(Cb).resolution(e),{textDocument:c}=r,l=s.filter(Gat),u=dlt(this.ctx,e,l);flt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await ect(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=qat(r);this.ctx.get(r0).getStatisticsForCompletion(e).computeMatch(o);let s=Hat(this.ctx,e,n);return Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return $F;if((await this.ctx.get(Cc).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Elt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),qn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),qn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if(D7(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=r$s){this.dispose();break}}await rx(this.config.UpdateInterval)}}};function FJn(t,e){let r=Pm(t,e,"event.WorkspaceContextUpdate");return t.get(E2).onUpdate(r)}a(FJn,"onWorkspaceContextUpdate");p();var Ilt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=Q7;this.disposables=[];this.rootWithPathCache=new nn;this.disposables.push(FJn(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(Jt).workspaceContextCacheTime(n):performance.now();let o=G0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:uf(),text:[`${c} -`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get(cn),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?I5(act(s),s.languageId):I5(sct(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:uf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=DM({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:uf(),text:[o,` +`+T,prefixTokens:h.prefix.cost+h.stableContext.cost+h.volatileContext.cost,suffix:h.suffix.text,suffixTokens:h.suffix.cost,context:c?.separateContext?P:void 0,isFimEnabled:h.suffix.text.length>0},computeTimeMs:R-u,trailingWs:w,neighborSource:new Map,metadata:m,contextProvidersTelemetry:x}}async resolveContext(e,r,n,o){let s=await this.ctx.get(hb).resolution(e),{textDocument:c}=r,l=s.filter(Yat),u=glt(this.ctx,e,l);Alt("contextProvider.traits",this.ctx,u,c.detectedLanguageId,c.detectedLanguageId,n);let d=await oct(this.ctx,e,l,c.detectedLanguageId);return{traits:u,codeSnippets:d,resolvedContextItems:s}}telemetrizeContext(e,r,n){let o=Vat(r);this.ctx.get(i0).getStatisticsForCompletion(e).computeMatch(o);let s=zat(this.ctx,e,n);return Dr.debug(this.ctx,`Context providers telemetry: '${JSON.stringify(s)}'`),s}async failFastPrompt(e,r){if(r?.isCancellationRequested)return FF;if((await this.ctx.get(ec).evaluate(e.uri,e.getText(),"UPDATE")).isBlocked)return Slt;if(e.getText().length{this.nextRequest.changedFiles===void 0&&(this.nextRequest.changedFiles=[]),this.nextRequest.changedFiles.push(r.document.uri)}),this.deferredStart.resolve(),this.loop())}dispose(){this.isActive()&&(this.didDispose=!0,this.emitter.emit(t.DisposeEventName),this.fileChangeDisposable?.dispose(),this.client?.exit())}pushWorkspaceContext(e,r){this.nextRequest.sources={...this.nextRequest.sources,[e]:r}}recordWorkspaceContextActivity(e,r,n){this.nextRequest.recentActivity===void 0&&(this.nextRequest.recentActivity=[]),this.nextRequest.recentActivity.push({sourceId:e,locations:r,timestamp:n})}getLastEvent(){return this.lastEvent}onUpdate(e){return this.emitter.on(t.UpdateEventName,e),jn.Disposable.create(()=>this.emitter.off(t.UpdateEventName,e))}onDisposal(e){return this.emitter.on(t.DisposeEventName,e),jn.Disposable.create(()=>this.emitter.off(t.DisposeEventName,e))}setContextLanguages(e){this.nextRequest.languages=e}async loop(){let e=0;for(;this.isActive();){try{let r=this.nextRequest;this.nextRequest={},this.lastEvent=await this.client.updateContext(r),this.emitter.emit(t.UpdateEventName,this.lastEvent),e=0}catch(r){if($z(this.ctx,r,"WorkspaceContextFeature.loop"),e++,e>=PGs){this.dispose();break}}await XI(this.config.UpdateInterval)}}};function EZn(t,e){let r=Nm(t,e,"event.WorkspaceContextUpdate");return t.get(g2).onUpdate(r)}a(EZn,"onWorkspaceContextUpdate");p();var klt=class{constructor(e){this.ctx=e;this.name="workspaceContext";this.documents=new Map;this.root=oQ;this.disposables=[];this.rootWithPathCache=new yn;this.disposables.push(EZn(e,r=>{(this.nextUpdateTime===void 0||performance.now()>=this.nextUpdateTime)&&setTimeout(()=>{this.update(r)},0)}))}static{a(this,"WorkspaceContextPromptComponent")}snapshot(e){let{completionState:r,telemetryData:n}=e;this.nextUpdateTime=this.lastUpdateTime!==void 0?this.lastUpdateTime+this.ctx.get(Jt).workspaceContextCacheTime(n):performance.now();let o=V0(this.rootWithPathCache,r.textDocument.uri,()=>{let c=this.getPathMarker(r);return{id:lf(),text:[`${c} +`,""],children:[this.root],cost:1,weight:1,elisionMarker:"",canMerge:!0,requireRenderedChild:!1}}),s=this.getMask(r.textDocument.uri);return{root:o,mask:s}}getRoot(){return this.root}getMask(e){let r=this.documents.get(e);return r===void 0?[]:[r.id]}getPathMarker(e){let r=e.textDocument,n=this.ctx.get(an),o=n.getRelativePath(e.textDocument),s={uri:r.uri,source:"",relativePath:o,languageId:r.detectedLanguageId},c=n.findNotebook(r);return s.relativePath&&!c?_5(fct(s),s.languageId):_5(dct(s),s.languageId)}update(e){this.rootWithPathCache.clear(),this.documents.clear();for(let[r,n]of Object.entries(e.documents)){let o=this.createAnnotatedDocumentRoot(r,n);n.requireRenderedChild=n.children.length>0,this.documents.set(r,o)}this.root=this.createRootNode(),this.lastUpdateTime=performance.now()}createRootNode(){let e=new Array(this.documents.size+1).fill(""),r=[...this.documents.values()];return{id:lf(),text:e,children:r,cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}createAnnotatedDocumentRoot(e,r){let n=BM({uri:e,languageId:"UNKNOWN"}),o=this.getDocumentAnnotation(e,n);return{id:lf(),text:[o,` -`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get(cn).getRelativePath({uri:e});return I5(`Related portions of ${o??e}: -`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var xlt=class extends Tlt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new Ilt(e),prefix:new _lt,suffix:new Clt(e),volatileContext:new Slt("volatileContext",[new vlt,new blt(e)])};super(e,r)}};var UJn=ce(ti());var VF=class{static{a(this,"CompletionsPromptFactory")}};function wlt(t,e,r){return new idr(new odr(new sdr(t,new glt(t,e,r),new xlt(t),i$s)))}a(wlt,"createCompletionsPromptFactory");var idr=class extends VF{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return $F;try{return await this.delegate.prompt(r,n)}catch{return the}}},n$s=1200,odr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new UJn.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(QJn)},n$s)})])}},sdr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function i$s(t,e){let r=t.get(E2);return r.isEnabled(e)&&r.isActive()}a(i$s,"workspaceContextEnabledAndActive");var Alt=10,ylt={type:"contextTooShort"},Elt={type:"copilotContentExclusion"},the={type:"promptError"},$F={type:"promptCancelled"},QJn={type:"promptTimeout"};function oH(t){let e=t.split(` -`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(oH,"trimLastLine");function rhe(t,e,r,n,o,s={}){let l=t.get(cn).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=s$s(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=IJn(t,n);return t.get(VF).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(rhe,"extractPrompt");function o$s(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:I5(n,e)}a(o$s,"addNeighboringCellsToPrompt");function s$s(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>o$s(l,r.document.detectedLanguageId)).join(` +`],children:[r],cost:1,weight:0,elisionMarker:"",canMerge:!0,requireRenderedChild:!0}}getDocumentAnnotation(e,r){let o=this.ctx.get(an).getRelativePath({uri:e});return _5(`Related portions of ${o??e}: +`,r)}dispose(){for(let e of this.disposables)e.dispose();this.disposables=[]}};p();var Dlt=class extends Plt{static{a(this,"WorkspaceContextPromptFactory")}constructor(e){let r={stableContext:new klt(e),prefix:new Tlt,suffix:new Ilt(e),volatileContext:new Rlt("volatileContext",[new xlt,new wlt(e)])};super(e,r)}};var _Zn=fe(ei());var UF=class{static{a(this,"CompletionsPromptFactory")}};function Nlt(t,e,r){return new _dr(new vdr(new Cdr(t,new vlt(t,e,r),new Dlt(t),DGs)))}a(Nlt,"createCompletionsPromptFactory");var _dr=class extends UF{constructor(r){super();this.delegate=r}static{a(this,"SequentialCompletionsPromptFactory")}async prompt(r,n){return this.lastPromise=this.promptAsync(r,n),this.lastPromise}async promptAsync(r,n){if(await this.lastPromise,n?.isCancellationRequested)return FF;try{return await this.delegate.prompt(r,n)}catch{return Xpe}}},kGs=1200,vdr=class{constructor(e){this.delegate=e}static{a(this,"TimeoutHandlingCompletionsPromptFactory")}async prompt(e,r){let n=new _Zn.CancellationTokenSource,o=n.token;return r?.onCancellationRequested(()=>{n.cancel()}),await Promise.race([this.delegate.prompt(e,o),new Promise(s=>{setTimeout(()=>{n.cancel(),s(vZn)},kGs)})])}},Cdr=class{constructor(e,r,n,o){this.ctx=e;this.defaultDelegate=r;this.experimentalDelegate=n;this.fn=o}static{a(this,"ExperimentalCompletionsPromptFactory")}async prompt(e,r){return this.fn(this.ctx,e.telemetryData)?this.experimentalDelegate.prompt(e,r):this.defaultDelegate.prompt(e,r)}};function DGs(t,e){let r=t.get(g2);return r.isEnabled(e)&&r.isActive()}a(DGs,"workspaceContextEnabledAndActive");var Clt=10,blt={type:"contextTooShort"},Slt={type:"copilotContentExclusion"},Xpe={type:"promptError"},FF={type:"promptCancelled"},vZn={type:"promptTimeout"};function Xj(t){let e=t.split(` +`),r=e[e.length-1],n=r.length-r.trimEnd().length,o=t.slice(0,t.length-n),s=t.slice(o.length);return[r.length==n?o:t,s]}a(Xj,"trimLastLine");function ehe(t,e,r,n,o,s={}){let l=t.get(an).findNotebook(r.textDocument),u=l?.getCellFor(r.textDocument);l&&u&&(r=MGs(r,l,u)),n.extendWithConfigProperties(t),n.sanitizeKeys();let d=aZn(t,n);return t.get(UF).prompt({completionId:e,completionState:r,telemetryData:n,promptOpts:{...s,separateContext:d}},o)}a(ehe,"extractPrompt");function NGs(t,e){let r=t.document.detectedLanguageId,n=t.document.getText();return r===e?n:_5(n,e)}a(NGs,"addNeighboringCellsToPrompt");function MGs(t,e,r){let o=e.getCells().filter(l=>l.index0?o.map(l=>NGs(l,r.document.detectedLanguageId)).join(` `)+` -`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(s$s,"applyEditsForNotebook");function ehe(t,e,r){let o=t.get(Jt).maxPromptCompletionTokens(e)-FWe(t),s=CYn(e,r),c=Xat(t,e,r),l=t.get(Jt).suffixPercent(e),u=t.get(Jt).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(ehe,"getPromptOptions");p();p();var qJn=2.98410452738298,jJn=-.838732736843507,HJn=1.50314646255716,GJn=-.237798634012662,Rlt={python:.314368072478742},$Jn={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var a$s={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function c$s(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},adr=class{constructor(e,r,n){this.link=a$s;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return c$s(n,this.logitsToQuantiles)}},VJn=new adr(qJn,[new nhe("compCharLen",jJn,t=>Math.log(1+t)),new nhe("meanLogProb",HJn),new nhe("meanAlternativeLogProb",GJn)].concat(Object.entries(Rlt).map(t=>new nhe(t[0],t[1]))),$Jn);function WJn(t,e){let r={...e.measurements};return Object.keys(Rlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),VJn.predict(t,r)}a(WJn,"ghostTextScoreConfidence");function zJn(t,e){let r={...e.measurements};return Object.keys(Rlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),VJn.quantile(t,r)}a(zJn,"ghostTextScoreQuantile");p();function l$s(t,e,r,n){let o="}";try{o=Tcn(e.detectedLanguageId)??"}"}catch{}return u$s({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(l$s,"maybeSnipCompletion");function u$s(t,e,r,n){let o=d$s(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(u$s,"maybeSnipCompletionImpl");function d$s(t){let e=t.includes(`\r +`:"",c={line:0,character:0};return t.applyEdits([{newText:s,range:{start:c,end:c}}])}a(MGs,"applyEditsForNotebook");function Zpe(t,e,r){let o=t.get(Jt).maxPromptCompletionTokens(e)-cYe(t),s=rKn(e,r),c=ict(t,e,r),l=t.get(Jt).suffixPercent(e),u=t.get(Jt).suffixMatchThreshold(e);if(l<0||l>100)throw new Error(`suffixPercent must be between 0 and 100, but was ${l}`);if(u<0||u>100)throw new Error(`suffixMatchThreshold must be between 0 and 100, but was ${u}`);return{maxPromptLength:o,similarFilesOptions:c,numberOfSnippets:s,suffixPercent:l,suffixMatchThreshold:u}}a(Zpe,"getPromptOptions");p();p();var CZn=2.98410452738298,bZn=-.838732736843507,SZn=1.50314646255716,TZn=-.237798634012662,Mlt={python:.314368072478742},IZn={"0.01":.225800751784931,"0.02":.290204307767402,"0.03":.333153496466045,"0.05":.404516749849559,"0.1":.513216040545626,"0.2":.626904979128674,"0.3":.694880719658273,"0.4":.743100684947291,"0.5":.782524520571946,"0.6":.816856186092243,"0.7":.84922977716585,"0.8":.883694877241999,"0.9":.921859050950077,"0.95":.944571268106974,"0.99":.969535563141733};var OGs={link:a(t=>Math.exp(t)/(1+Math.exp(t)),"link"),unlink:a(t=>Math.log(t/(1-t)),"unlink")};function BGs(t,e){let r=Math.min(...Array.from(e.keys()).filter(c=>c>=t)),n=Math.max(...Array.from(e.keys()).filter(c=>co)}contribution(e){return this.coefficient*this.transformation(e)}},bdr=class{constructor(e,r,n){this.link=OGs;if(this.intercept=e,this.coefficients=r,this.logitsToQuantiles=new Map,this.logitsToQuantiles.set(0,0),this.logitsToQuantiles.set(1,1),n)for(let o in n)this.logitsToQuantiles.set(n[o],Number(o))}static{a(this,"LogisticRegression")}predict(e,r){let n=this.intercept;for(let o of this.coefficients){let s=r[o.name];if(s===void 0)return NaN;n+=o.contribution(s)}return this.link.link(n)}quantile(e,r){let n=this.predict(e,r);return BGs(n,this.logitsToQuantiles)}},xZn=new bdr(CZn,[new the("compCharLen",bZn,t=>Math.log(1+t)),new the("meanLogProb",SZn),new the("meanAlternativeLogProb",TZn)].concat(Object.entries(Mlt).map(t=>new the(t[0],t[1]))),IZn);function wZn(t,e){let r={...e.measurements};return Object.keys(Mlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),xZn.predict(t,r)}a(wZn,"ghostTextScoreConfidence");function RZn(t,e){let r={...e.measurements};return Object.keys(Mlt).forEach(n=>{r[n]=e.properties["customDimensions.languageId"]==n?1:0}),xZn.quantile(t,r)}a(RZn,"ghostTextScoreQuantile");p();function LGs(t,e,r,n){let o="}";try{o=ccn(e.detectedLanguageId)??"}"}catch{}return FGs({getLineText:a(s=>e.lineAt(s).text,"getLineText"),getLineCount:a(()=>e.lineCount,"getLineCount")},r,n,o)}a(LGs,"maybeSnipCompletion");function FGs(t,e,r,n){let o=UGs(r),s=o.lines;if(s.length===1)return r;for(let c=1;c=t.getLineCount()?void 0:t.getLineText(y),h!==void 0&&h.trim()==="")u++;else break}let m,g;for(;m=c+f+d,g=m>=s.length?void 0:s[m],g!==void 0&&g.trim()==="";)d++;let A=m===s.length-1;if(!g||!(h&&(A?h.startsWith(g)||g.startsWith(h):h===g&&g.trim()===n))){l=!1;break}}if(l)return s.slice(0,c).join(o.newLineCharacter)}return r}a(FGs,"maybeSnipCompletionImpl");function UGs(t){let e=t.includes(`\r `)?`\r `:` -`;return{lines:t.split(e),newLineCharacter:e}}a(d$s,"splitByNewLine");function f$s(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(YJn,"checkSuffix");var XJn=ce(IB());Ns();var sl=new ge("ghostText");var KJn=20;async function eZn(t,e,r,n,o,s,c){sl.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=Wce(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:kcn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=qt(t,je.ModelAlwaysTerminatesSingleline)??t.get(Jt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&PM.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` -`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},E=await t.get(HM).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:ap(r,t)}:E.type==="canceled"?(sl.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:Jj(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(P0(y))return{type:"canceled",reason:"network request aborted",telemetryData:Jj(r,{cancelledNetworkRequest:!0})};if(sl.exception(t,y,"Error on ghost text request"),t.get(lv).notifyUser(t,y),Eie(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:ap(r,t)}}}a(eZn,"genericGetCompletionsFromNetwork");function cdr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(cdr,"postProcessChoices");async function h$s(t,e,r,n,o){return eZn(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return sl.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:ap(r,t)};if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:Jj(r)};let f=d.value;if(f===void 0)return sl.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:ap(r,t)};rZn(t,"performance",f,s,c),sl.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=cdr(f,e);h&&(klt(t,e,h),sl.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;sl.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=cdr(A,e,g);y&&(g.push(y),klt(t,e,y))}})();return v1(t)&&await m,h?{type:"success",value:[ldr(h,{forceSingleLine:!1}),m],telemetryData:ap(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:ap(r,t)}})}a(h$s,"getCompletionsFromNetwork");async function m$s(t,e,r,n,o){return eZn(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return sl.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:Jj(r)};let f=cdr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)klt(t,e,d);rZn(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:ap(r,t),telemetryBlob:r,resultType:3}})}a(m$s,"getAllCompletionsFromNetwork");function ldr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` +`;return{lines:t.split(e),newLineCharacter:e}}a(UGs,"splitByNewLine");function QGs(t,e,r,n){let o="",s=e.line+1,c=n?r.trim():r;for(;o===""&&s0){if(r.completionText.indexOf(o)!==-1)return o.length;{let s=-1,c=0;for(let l of o){let u=r.completionText.indexOf(l,s+1);if(u>s)c++,s=u;else break}return c}}return 0}a(PZn,"checkSuffix");var MZn=fe(v9());As();var il=new Ae("ghostText");var kZn=20;async function OZn(t,e,r,n,o,s,c){il.debug(t,`Getting ${s} from network`),r=r.extendedBy();let l=e.isCycling?3:1,u=sle(t,l),d={language:e.languageId,next_indent:e.indentation.next??0,trim_by_indentation:pcn(e.blockMode),prompt_tokens:e.prompt.prefixTokens??0,suffix_tokens:e.prompt.suffixTokens??0},f={n:l,temperature:u,code_annotations:!1},h=Ht(t,Je.ModelAlwaysTerminatesSingleline)??t.get(Jt).modelAlwaysTerminatesSingleline(r),m=e.blockMode==="moremultiline"&&TM.isSupported(e.languageId)&&!h;!e.multiline&&!m?f.stop=[` +`]:e.stop&&(f.stop=e.stop),e.maxTokens!==void 0&&(f.max_tokens=e.maxTokens);let g=Date.now(),A={endpoint:"completions",uiKind:"ghostText",temperature:JSON.stringify(u),n:JSON.stringify(l),stop:JSON.stringify(f.stop)??"unset",logit_bias:JSON.stringify(null)};Object.assign(r.properties,A);try{let y={prompt:e.prompt,languageId:e.languageId,repoInfo:e.repoInfo,ourRequestId:e.ourRequestId,engineModelId:e.engineModelId,count:l,uiKind:"ghostText",postOptions:f,headers:e.headers,extra:d},E=await t.get(VM).fetchAndStreamCompletions(t,y,r,o,n);return E.type==="failed"?{type:"failed",reason:E.reason,telemetryData:dp(r,t)}:E.type==="canceled"?(il.debug(t,"Cancelled after awaiting fetchCompletions"),{type:"canceled",reason:E.reason,telemetryData:$j(r)}):c(g,E.getProcessingTime(),E.choices)}catch(y){if(D0(y))return{type:"canceled",reason:"network request aborted",telemetryData:$j(r,{cancelledNetworkRequest:!0})};if(il.exception(t,y,"Error on ghost text request"),t.get(sC).notifyUser(t,y),fie(t))throw y;return{type:"failed",reason:"non-abort error on ghost text request",telemetryData:dp(r,t)}}}a(OZn,"genericGetCompletionsFromNetwork");function Sdr(t,e,r){if(r||(r=[]),t.completionText=t.completionText.trimEnd(),!!t.completionText&&r.findIndex(n=>n.completionText.trim()===t.completionText.trim())===-1)return t}a(Sdr,"postProcessChoices");async function jGs(t,e,r,n,o){return OZn(t,e,r,n,o,"completions",async(s,c,l)=>{let d=await l[Symbol.asyncIterator]().next();if(d.done)return il.debug(t,"All choices redacted"),{type:"empty",reason:"all choices redacted",telemetryData:dp(r,t)};if(n?.isCancellationRequested)return il.debug(t,"Cancelled after awaiting redactedChoices iterator"),{type:"canceled",reason:"after awaiting redactedChoices iterator",telemetryData:$j(r)};let f=d.value;if(f===void 0)return il.debug(t,"Got undefined choice from redactedChoices iterator"),{type:"empty",reason:"got undefined choice from redactedChoices iterator",telemetryData:dp(r,t)};LZn(t,"performance",f,s,c),il.debug(t,`Awaited first result, id: ${f.choiceIndex}`);let h=Sdr(f,e);h&&(Olt(t,e,h),il.debug(t,`GhostText first completion (index ${h?.choiceIndex}): ${JSON.stringify(h?.completionText)}`));let m=(async()=>{let g=h!==void 0?[h]:[];for await(let A of l){if(A===void 0)continue;il.debug(t,`GhostText later completion (index ${A?.choiceIndex}): ${JSON.stringify(A.completionText)}`);let y=Sdr(A,e,g);y&&(g.push(y),Olt(t,e,y))}})();return m1(t)&&await m,h?{type:"success",value:[Tdr(h,{forceSingleLine:!1}),m],telemetryData:dp(r,t),telemetryBlob:r,resultType:0}:{type:"empty",reason:"got undefined processedFirstChoice",telemetryData:dp(r,t)}})}a(jGs,"getCompletionsFromNetwork");async function HGs(t,e,r,n,o){return OZn(t,e,r,n,o,"all completions",async(s,c,l)=>{let u=[];for await(let d of l){if(n?.isCancellationRequested)return il.debug(t,"Cancelled after awaiting choices iterator"),{type:"canceled",reason:"after awaiting choices iterator",telemetryData:$j(r)};let f=Sdr(d,e,u);f&&u.push(f)}if(u.length>0){for(let d of u)Olt(t,e,d);LZn(t,"cyclingPerformance",u[0],s,c)}return{type:"success",value:[u,Promise.resolve()],telemetryData:dp(r,t),telemetryBlob:r,resultType:3}})}a(HGs,"getAllCompletionsFromNetwork");function Tdr(t,e){let r={...t};if(e.forceSingleLine){let{completionText:n}=r,o=n.match(/^\r?\n/);o?r.completionText=o[0]+n.split(` `)[1]:r.completionText=n.split(` -`)[0]}return r}a(ldr,"makeGhostAPIChoice");function JJn(t){return e=>{let r=e?.split(` +`)[0]}return r}a(Tdr,"makeGhostAPIChoice");function DZn(t){return e=>{let r=e?.split(` `)??[];if(r.length>t+1)return r.slice(0,t+1).join(` -`).length}}a(JJn,"takeNLines");async function g$s(t,e,r,n,o,s,c,l){let u=t.get(Jt).multilineAfterAcceptLines(l),d=t.get(eP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:JJn(u),stop:[` +`).length}}a(DZn,"takeNLines");async function GGs(t,e,r,n,o,s,c,l){let u=t.get(Jt).multilineAfterAcceptLines(l),d=t.get(JP).forLanguage(t,e.textDocument.detectedLanguageId,l);switch(d){case"server":return c?{blockMode:"parsing",requestMultiline:!0,finishedCb:DZn(u),stop:[` -`],maxTokens:KJn*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await T$s(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Jt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=Ll.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...ZJn(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:JJn(u),stop:[` +`],maxTokens:kZn*u}:{blockMode:"server",requestMultiline:!0,finishedCb:a(f=>{},"finishedCb")};case"parsing":case"parsingandserver":case"moremultiline":default:{let f;try{f=await XGs(t,d,e.textDocument,e.position,s,c,n)}catch{f={requestMultiline:!1}}if(!c&&f.requestMultiline&&t.get(Jt).singleLineUnlessAccepted(l)&&(f.requestMultiline=!1),f.requestMultiline){let h;return n.trailingWs.length>0&&!n.prompt.prefix.endsWith(n.trailingWs)?h=cu.position(e.position.line,Math.max(e.position.character-n.trailingWs.length,0)):h=e.position,{blockMode:d,requestMultiline:!0,...NZn(t,d,e.textDocument,h,f.blockPosition,r,!0,n.prompt,l)}}if(c){let h={blockMode:"parsing",requestMultiline:!0,finishedCb:DZn(u),stop:[` -`],maxTokens:KJn*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...ZJn(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(g$s,"getGhostTextStrategy");function ZJn(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&PM.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Jt).longLookaheadSize(u):t.get(Jt).shortLookaheadSize(u);return{finishedCb:new Bat(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};klt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Jt).maxMultilineTokens(u)}}return{finishedCb:c?R2e(t,r,n):d=>{}}}a(ZJn,"buildFinishedCallback");var A$s={isCycling:!1,promptOnly:!1,isSpeculative:!1};function y$s(t,e,r){let n=qt(t,je.CompletionsDebounce)??t.get(Jt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=pl()-r.issuedTime;return Math.max(0,n-o)}a(y$s,"getRemainingDebounceMs");function tDe(t,e,r){return r?.isCancellationRequested||e!==t.get(_b).currentRequestId}a(tDe,"inlineCompletionRequestCancelled");async function E$s(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=pl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Jt);if(tDe(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:ap(n,t)};let f=C$s(e.textDocument,e.position);if(f===void 0)return sl.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:ap(n,t)};let h=w7(t,n),m={...A$s,...s,tokenizer:h.tokenizer},g=await rhe(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return sl.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:ap(n,t)};if(g.type==="contextTooShort")return sl.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:ap(n,t)};if(g.type==="promptError")return sl.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:ap(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return sl.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:ap(n,t)};if(g.type==="promptTimeout")return sl.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:ap(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return sl.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:ap(n,t)};let A=y$s(t,m,n);return A>0&&(sl.debug(t,`Debouncing ghost text request for ${A}ms`),await rx(A),tDe(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:ap(n,t)}:t.get(as).trackCompletionJob(async()=>{let[E]=oH(e.textDocument.getText(Ll.range(Ll.position(0,0),e.position))),_=t.get(_b).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await g$s(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=_$s(t,E,v,b.requestMultiline);u("cache");let w=R7(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:Yat(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=k$s(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(Eb).shouldWaitForAsyncCompletions(E,g.prompt)){let q=await t.get(Eb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),q){let F=!b.requestMultiline;T=[[ldr(q[0],{forceSingleLine:F})],4]}if(tDe(t,r,o))return sl.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:ap(x,t)}}let k=b.blockMode==="moremultiline"&&PM.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(q=>eDe(t,e.textDocument,e.position,q,k,sl)).filter(q=>q!==void 0)),T!==void 0&&T[0].length===0)return sl.debug(t,`Found empty inline suggestions locally via ${Rpe(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:ap(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))sl.debug(t,`Found inline suggestions locally via ${Rpe(T[1])}`);else{if(m.isCycling){let q=await m$s(t,R,x,o,b.finishedCb);if(q.type==="success"){let F=T?.[0]??[];q.value[0].forEach(U=>{F.findIndex(W=>W.completionText.trim()===U.completionText.trim())===-1&&F.push(U)}),T=[F,3]}else if(T===void 0)return q}else{let q=a((V,G)=>(t.get(Eb).updateCompletion(r,V),b.finishedCb(V,G)),"finishedCb"),F=new qn.CancellationTokenSource,U=h$s(t,R,x,F.token,q);t.get(Eb).queueCompletionRequest(r,E,g.prompt,F,U);let W=await t.get(Eb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(W===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:ap(x,t)};T=[[W[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:ap(x,t)};let[D,N]=T,L=D.map(q=>eDe(t,e.textDocument,e.position,q,k,sl)).filter(q=>q!==void 0),B=qt(t,je.CompletionsDelay)??d.completionsDelay(n),Q=pl()-n.issuedTime,M=Math.max(B-Q,0);if(N!==2&&!m.isCycling&&M>0&&(sl.debug(t,`Waiting ${M}ms before returning completion`),await rx(M),tDe(t,r,o)))return sl.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:Jj(x)};let O=[];for(let q of L){let F=R$s(t,e.textDocument,R,q,x),U=f?YJn(e.textDocument,e.position,q):0,V={completion:I$s(q.choiceIndex,q.completionText,g.trailingWs),telemetry:F,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:q.copilotAnnotations,clientCompletionId:q.clientCompletionId};O.push(V)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,sl.debug(t,`Produced ${O.length} results from ${Rpe(N)} at ${x.measurements.foundOffset} offset`),tDe(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:Jj(x)}:(m.isSpeculative||t.get(_b).setGhostText(E,g.prompt.suffix,L,N),u("complete"),{type:"success",value:[O,N],telemetryData:ap(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(E$s,"getGhostTextWithoutAbortHandling");async function udr(t,e,r,n){let o=gr();t.get(_b).currentRequestId=o;let s=await w$s(t,e.textDocument,o,n);await SSe.catch(()=>{});try{return t.get(Cb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(b5).notifyRequest(e,o,s,r,n),await E$s(t,e,o,s,r,n)}catch(c){if(P0(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:Jj(s,{cancelledNetworkRequest:!0})};throw c}}a(udr,"getGhostText");function _$s(t,e,r,n){let o=t.get(_b).getCompletionsForUserTyping(e,r.suffix),s=x$s(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(_$s,"getLocalInlineSuggestion");function C$s(t,e){let r=v$s(e,t),n=b$s(e,t);return r&&!n?void 0:r&&n}a(C$s,"isInlineSuggestion");function v$s(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(v$s,"isMiddleOfTheLine");function b$s(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(b$s,"isValidMiddleOfTheLinePosition");function S$s(t,e){return e.lineAt(t).text.trim().length===0}a(S$s,"isNewLine");var WF=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function T$s(t,e,r,n,o,s,c){if(t.get(WF).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)ht(t,"ghostText.longFileMultilineSkip",jt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&PM.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await xcn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&S$s(n,r))return{requestMultiline:!0};let u=!1;return!o&&AS(r.detectedLanguageId)?u=await zat(r,n):o&&AS(r.detectedLanguageId)&&(u=await zat(r,n)||await zat(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=Hzn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(T$s,"shouldRequestMultiline");function klt(t,e,r){t.get(f2).append(e.prefix,e.prompt.suffix,r)}a(klt,"appendToCache");function I$s(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(I$s,"adjustLeadingWhitespace");function x$s(t,e,r,n){let o=t.get(f2).findAll(e,r);return o.length===0?(sl.debug(t,"Found no completions in cache"),[]):(sl.debug(t,`Found ${o.length} completions in cache`),o.map(s=>ldr(s,{forceSingleLine:!n})))}a(x$s,"getCompletionsFromCache");async function w$s(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=jt.createAndMarkAsIssued(o);return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(w$s,"createTelemetryWithExp");function R$s(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` -`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,tZn(u,e),u.extendWithRequestId(s),u.measurements.confidence=WJn(t,u),u.measurements.quantile=zJn(t,u),sl.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(R$s,"telemetryWithAddData");function k$s(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);tZn(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(Ll.range(h.range.start,n)),g=e.getText(Ll.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,XJn.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...hoe(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return ht(t,"ghostText.issued",_),d}a(k$s,"telemetryIssued");function tZn(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(tZn,"addDocumentTelemetry");function rZn(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),ht(t,`ghostText.${e}`,l)}a(rZn,"telemetryPerformance");p();p();var fX=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get(cn);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var vT=class{static{a(this,"CitationManager")}},Plt=class extends vT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var ddr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??qn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=Nlt.indexOf(_);v!==-1&&Nlt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Nlt)_()}a(e,"afterUpdateConnection");function r(_){_2.connection!==_&&(_2.connection=_,e())}a(r,"updateConnection");function n(){return _2.connection==="connected"}a(n,"isConnected");function o(){return _2.connection==="disconnected"}a(o,"isDisconnected");function s(){return _2.connection==="retry"}a(s,"isRetrying");function c(){return _2.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){_2.initialWait!==_&&(_2.initialWait=_)}a(h,"setInitialWait");function m(_,v=P$s){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return _2.initialWait}a(g,"isInitialWait");async function A(_,v){bb.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(ar);function T(w,R){if(w>iZn){bb.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{_2.retryAttempts=Math.min(_2.retryAttempts+1,oZn);try{bb.info(R,`Pinging service after ${w} second(s)`);let k=await b.fetch(new URL("_ping",HB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(k.status!==200||!k.ok)T(w**2,R);else{bb.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),bb.info(_,"Attempting to reconnect."),T(fdr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Dlt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Dlt}a(D$s,"registerConnectionState");var hX=D$s();p();var Cg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},rDe={[Cg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Cg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Cg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function pdr(t){return t===401?Cg.Unauthorized:t===400?Cg.BadArguments:t===404?Cg.NotFound:t===429?Cg.RateLimit:t>=500&&t<600?Cg.InternalError:t>=600?Cg.ConnectionError:Cg.Unknown}a(pdr,"getErrorType");function F5(t,e,r={}){return{kind:"failure",reason:pdr(Number(t)),code:Number(t),msg:e,meta:r}}a(F5,"createErrorResponse");p();var N$s=/^[1-6][0-9][0-9]$/,M$s=/([A-Z][a-z]+)/,O$s="code_referencing",nDe=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[O$s,this.baseKey,...e].join(".")}},hdr=class extends nDe{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=jt.createAndMarkAsIssued();ht(e,r,n)}handleFocus({context:e}){let r=jt.createAndMarkAsIssued(),n=this.buildKey("focus","count");ht(e,n,r)}handleWrite({context:e}){let r=jt.createAndMarkAsIssued(),n=this.buildKey("write","count");ht(e,n,r)}},Z4f=new hdr,mdr=class extends nDe{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=jt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");ht(e,o,n)}handleDismiss({context:e,actor:r}){let n=jt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");ht(e,o,n)}},X4f=new mdr,gdr=class extends nDe{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=jt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=jt.createAndMarkAsIssued({origin:r,reason:n});Bm(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(N$s)){bb.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(M$s).filter(l=>!!l).join("_").toLowerCase(),c=jt.createAndMarkAsIssued({message:o});Bm(e,this.buildKey(s,r),c)}},Mlt=new gdr;var B$s="twirp/github.snippy.v1.SnippyAPI";async function Adr(t,e,r,n){let o;try{o=await t.get(Qt).getToken()}catch{return hX.setDisconnected(),F5(401,rDe[Cg.Unauthorized])}if(bb.info(t,`Calling ${e}`),hX.isRetrying())return F5(600,"Attempting to reconnect to the public code matching service.");if(hX.isDisconnected())return F5(601,"The public code matching service is offline.");let s;try{s=await t.get(ar).fetch(LI(t,o,"origin-tracker",`${B$s}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...by(t)},signal:n})}catch{return hX.enableRetry(t),F5(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Qt).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Mlt.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=pdr(h),g=d||"unknown error";switch(m){case Cg.Unauthorized:return F5(u,rDe[Cg.Unauthorized],f);case Cg.BadArguments:return F5(u,g,f);case Cg.RateLimit:return hX.enableRetry(t,60*1e3),F5(u,rDe.RateLimitError,f);case Cg.InternalError:return hX.enableRetry(t),F5(u,rDe[Cg.InternalError],f);default:return F5(u,g,f)}}a(Adr,"call");p();var Olt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),F$s=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),sZn=S.Object({source:S.String()}),U$s=S.Object({snippets:S.Array(F$s)}),aZn=S.Union([U$s,Olt]),cZn=S.Object({cursor:S.String()}),Q$s=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),q$s=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),j$s=S.Object({count:S.Record(S.String(),S.String())}),H$s=S.Object({file_matches:S.Array(Q$s),page_info:q$s,license_stats:j$s}),lZn=S.Union([H$s,Olt]);async function uZn(t,e,r){let n=await Adr(t,"Match",{method:"POST",body:PY(sZn,{source:e})},r);return PY(aZn,n)}a(uZn,"Match");async function dZn(t,{cursor:e},r){let n=await Adr(t,"FilesForMatch",{method:"POST",body:PY(cZn,{cursor:e})},r);return PY(lZn,n)}a(dZn,"FilesForMatch");p();var iDe=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),Blt=65;function V$s(t){let e=0,r;iDe.lastIndex=0;do if(r=iDe.exec(t),r&&(e+=1),e>=Blt)break;while(r);return e}a(V$s,"lexemeLength");function W$s(t,e){let r=0,n;iDe.lastIndex=0;do if(n=iDe.exec(t),n&&(r+=1,r>=e))return iDe.lastIndex;while(n);return t.length}a(W$s,"offsetFirstLexemes");function fZn(t,e){let r=t.split("").reverse().join(""),n=W$s(r,e);return r.length-n}a(fZn,"offsetLastLexemes");function oDe(t){return V$s(t)>=Blt}a(oDe,"hasMinLexemeLength");function Y$s(t){return RM.Check(Olt,t)}a(Y$s,"isError");async function pZn(t,e){let r=await e();if(Y$s(r)){Mlt.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(pZn,"snippyRequest");function hZn(t){return"kind"in t&&t.kind==="failure"}a(hZn,"isMatchError");async function mZn(t,e,r,n){let s=await t.get(cn).getTextDocument({uri:e});if(!s){bb.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!oDe(c)||!oDe(c))return;let l=r;if(!oDe(r)){let g=c.slice(0,n),A=fZn(g,Blt);l=c.slice(A,n+r.length)}if(!oDe(l))return;let u=await pZn(t,()=>uZn(t,l));if(!u||hZn(u)||!u.snippets.length){bb.info(t,"No match found");return}bb.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await pZn(t,()=>dZn(t,{cursor:g.cursor}));if(!A||hZn(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(vT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(mZn,"fetchCitations");p();function ydr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(Z$s,"lexGeneratorWords");function gZn(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(gZn,"lexicalAnalyzer");function AZn(t){return t!==" "}a(AZn,"notSingleSpace");function yZn(t,e,r=Z$s){let[n,o]=gZn(t,K$s(),r,AZn),[s,c]=gZn(e,o,r,AZn);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=J$s(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=ydr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(yZn,"lexEditDistance");p();function sH(t){return t.length===0?0:t.split(` -`).length}a(sH,"countLines");function EZn(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(EZn,"computeCompletionText");var aH=new ge("postInsertion"),_Zn=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],CZn=50,X$s=1500,eVs=.5,tVs=500,Edr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function vZn(t,e,r,n,o){let s=await t.get(Jn).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return aH.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await rhe(t,r.properties.headerRequestId,pX(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=Llr(u,n,c.detectedLanguageId),y=hYn(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:tVs)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(vZn,"captureCode");function Llt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{aH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),$zn(t,e,d)});let s=new fX(t,n,r-1),c=new fX(t,n,r),l=a(async u=>{aH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await vZn(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});aH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),ht(t,e+".capturedAfterRejected",A,1)},"checkInCode");_Zn.filter(u=>u.captureRejection).map(u=>s.push(Pm(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(Llt,"postRejectionTasks");function sDe(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});aH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),Gzn(t,e,u);let d=r;r=EZn(r,c);let f=r.trim(),h=new fX(t,o,n),m=new fX(t,o,n+r.length),g=a(async A=>{await oVs(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Edr.triggerPostInsertionSynchroneously&&v1(t)){let A=g({seconds:0,captureCode:Edr.captureCode,captureRejection:Edr.captureRejection});t.get(_d).register(A)}else _Zn.map(A=>h.push(Pm(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));Pm(t,rVs,"post insertion citation check")(t,o,d,r,n,l)}a(sDe,"postInsertionTasks");async function rVs(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(FI(t)?.getTokenValue("sn")==="1")return;await mZn(t,e,n,o);return}let c=await t.get(cn).getTextDocument({uri:e});if(c){let l=_dr(c.getText(),n,CZn,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=nVs(r.length,n.length,l.start_offset);if(u===void 0){aH.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+iVs(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(vT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(rVs,"citationCheck");function nVs(t,e,r){if(!(ee))return r}a(nVs,"computeCitationStart");function iVs(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(cVs,"computeRejectedCompletions");function Cdr(t,e){let r=t.get(FA);if(!r.position||!r.uri)return;let n=cVs(r);n.length>0&&Llt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Cdr,"rejectLastShown");function bZn(t,e,r,n){let o=t.get(FA);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Cdr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(bZn,"setLastShown");function SZn(t,e){let r=t.get(FA);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;aVs.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Fat(t,"ghostText",e)}}a(SZn,"handleGhostTextShown");function lVs(t,e,r){let n=t.get(FA);n.linesLeft===void 0&&(n.linesAccepted=sH(e.insertText.substring(0,r)),n.linesLeft=sH(e.displayText));let o=sH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(lVs,"handleLineAcceptance");function ihe(t,e,r="ghostText"){let n=t.get(FA),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:sH(e.displayText)},n.resetState(),sDe(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(ihe,"handleGhostTextPostInsert");function Flt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(FA),l;return s==="cumulative"?(uVs(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(lVs(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),sDe(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(Flt,"handlePartialGhostTextPostInsert");function uVs(t,e,r){let n=t.get(FA);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=sH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(uVs,"handleCumulativeAcceptance");p();var U5=new Map;U5.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});U5.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});U5.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});U5.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});U5.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});U5.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var dVs=new ge("sdk");function Ult(t,e){U5.has(t.get(Lr).getEditorPluginInfo().name)||dVs.warn(t,...e)}a(Ult,"deprecationWarning");var QHi=ce(DL()),aI=ce(sP());p();p();p();p();var Qlt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function ohe(t,e){let r=jt.createAndMarkAsIssued({authType:e});ht(t,Qlt.NewGitHubLogin,r),gt(t,Qlt.NewGitHubLogin,{authType:e})}a(ohe,"telemetryNewGitHubLogin");function C2(t,e,r,n,o){gi(t,Qlt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(C2,"telemetryGitHubLoginResult");function aDe(t,e,r){gi(t,Qlt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(aDe,"telemetryCodeFlowError");var TZn=["repo","workflow"],vdr=class extends Ai{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function fVs(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:e,scope:TZn.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(ar).fetch(s,n)}catch(c){throw c instanceof Error&&OI(c)?new Ai(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(fVs,"requestDeviceFlowStage1");async function pVs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(ar).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new vdr(c):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(pVs,"requestDeviceFlowStage2");async function hVs(t,e){let n=await(await Td(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(hVs,"requestUserInfo");var bT=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Ur)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(Bp).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(Bp).githubAppId=n;let d=await this.save(u);return C2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{C2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw C2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(lv).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;ohe(n,"deviceFlow");let o=await fVs(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await pVs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await hVs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):TZn;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new Ai(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var bdr=ce(ti());p();var Uw=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var qlt="github.copilot.finishDeviceFlow",Sdr=class extends Uw{constructor(){super(...arguments);this.name=qlt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(bT),s=o.pendingSignIn;if(!s)throw new bdr.ResponseError(Ke.InvalidRequest,"No pending sign in");try{await this.ctx.get(N0).open(s.verificationUri)}catch(c){Jg.warn(this.ctx,"Failed to open",s.verificationUri),Jg.exception(this.ctx,c,qlt)}try{return await s.status}catch(c){throw new bdr.ResponseError(Ke.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},IZn=[Sdr];p();p();var vu=class extends nn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var cDe="github.copilot.didAcceptCompletionItem",Tdr=class extends Uw{constructor(){super(...arguments);this.name=cDe;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(vu).get(n);return s?(ihe(this.ctx,s),!0):!1}},xZn=[Tdr];p();p();p();p();p();p();function wZn(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` +`],maxTokens:kZn*u};return d==="moremultiline"&&(h.blockMode="moremultiline"),h}return{blockMode:d,requestMultiline:!1,...NZn(t,d,e.textDocument,e.position,f.blockPosition,r,!1,n.prompt,l)}}}}a(GGs,"getGhostTextStrategy");function NZn(t,e,r,n,o,s,c,l,u){if(c&&e==="moremultiline"&&TM.isSupported(r.detectedLanguageId)){let d=o==="empty-block"||o==="block-end"?t.get(Jt).longLookaheadSize(u):t.get(Jt).shortLookaheadSize(u);return{finishedCb:new qat(t,s,r.detectedLanguageId,!1,d,(h,m)=>{let g={prefix:s+h,prompt:{...l,prefix:l.prefix+h}};Olt(t,g,m)}).getFinishedCallback(),maxTokens:t.get(Jt).maxMultilineTokens(u)}}return{finishedCb:c?E2e(t,r,n):d=>{}}}a(NZn,"buildFinishedCallback");var $Gs={isCycling:!1,promptOnly:!1,isSpeculative:!1};function VGs(t,e,r){let n=Ht(t,Je.CompletionsDebounce)??t.get(Jt).completionsDebounce(r)??e.debounceMs;if(n===void 0)return 0;let o=dl()-r.issuedTime;return Math.max(0,n-o)}a(VGs,"getRemainingDebounceMs");function $2e(t,e,r){return r?.isCancellationRequested||e!==t.get(pb).currentRequestId}a($2e,"inlineCompletionRequestCancelled");async function WGs(t,e,r,n,o,s){let c=n.issuedTime,l=[];function u(E){let _=dl();l.push([E,_-c]),c=_}a(u,"recordPerformance"),u("telemetry");let d=t.get(Jt);if($2e(t,r,o))return{type:"abortedBeforeIssued",reason:"cancelled before extractPrompt",telemetryData:dp(n,t)};let f=YGs(e.textDocument,e.position);if(f===void 0)return il.debug(t,"Breaking, invalid middle of the line"),{type:"abortedBeforeIssued",reason:"Invalid middle of the line",telemetryData:dp(n,t)};let h=S7(t,n),m={...$Gs,...s,tokenizer:h.tokenizer},g=await ehe(t,r,e,n,void 0,m);if(u("prompt"),g.type==="copilotContentExclusion")return il.debug(t,"Copilot not available, due to content exclusion"),{type:"abortedBeforeIssued",reason:"Copilot not available due to content exclusion",telemetryData:dp(n,t)};if(g.type==="contextTooShort")return il.debug(t,"Breaking, not enough context"),{type:"abortedBeforeIssued",reason:"Not enough context",telemetryData:dp(n,t)};if(g.type==="promptError")return il.debug(t,"Error while building the prompt"),{type:"abortedBeforeIssued",reason:"Error while building the prompt",telemetryData:dp(n,t)};if(m.promptOnly)return{type:"promptOnly",reason:"Breaking, promptOnly set to true",prompt:g};if(g.type==="promptCancelled")return il.debug(t,"Cancelled during extractPrompt"),{type:"abortedBeforeIssued",reason:"Cancelled during extractPrompt",telemetryData:dp(n,t)};if(g.type==="promptTimeout")return il.debug(t,"Timeout during extractPrompt"),{type:"abortedBeforeIssued",reason:"Timeout",telemetryData:dp(n,t)};if(g.prompt.prefix.length===0&&g.prompt.suffix.length===0)return il.debug(t,"Error empty prompt"),{type:"abortedBeforeIssued",reason:"Empty prompt",telemetryData:dp(n,t)};let A=VGs(t,m,n);return A>0&&(il.debug(t,`Debouncing ghost text request for ${A}ms`),await XI(A),$2e(t,r,o))?{type:"abortedBeforeIssued",reason:"cancelled after debounce",telemetryData:dp(n,t)}:t.get(ss).trackCompletionJob(async()=>{let[E]=Xj(e.textDocument.getText(cu.range(cu.position(0,0),e.position))),_=t.get(pb).hasAcceptedCurrentCompletion(E,g.prompt.suffix),v=g.prompt,b=await GGs(t,e,E,g,m.isCycling,f,_,n);u("strategy");let T=zGs(t,E,v,b.requestMultiline);u("cache");let w=T7(t,e.textDocument.uri),R={blockMode:b.blockMode,languageId:e.textDocument.detectedLanguageId,repoInfo:w,engineModelId:h.modelId,ourRequestId:r,prefix:E,prompt:g.prompt,multiline:b.requestMultiline,indentation:ect(e.textDocument,e.position),isCycling:m.isCycling,headers:h.headers,stop:b.stop,maxTokens:b.maxTokens,afterAccept:_};R.headers={...R.headers,"X-Copilot-Async":"true","X-Copilot-Speculative":m.isSpeculative?"true":"false"};let x=i$s(t,e.textDocument,R,e.position,g,n,h,m);if(T===void 0&&!m.isCycling&&t.get(fb).shouldWaitForAsyncCompletions(E,g.prompt)){let q=await t.get(fb).getFirstMatchingRequestWithTimeout(r,E,g.prompt,m.isSpeculative,x);if(u("asyncWait"),q){let Q=!b.requestMultiline;T=[[Tdr(q[0],{forceSingleLine:Q})],4]}if($2e(t,r,o))return il.debug(t,"Cancelled before requesting a new completion"),{type:"abortedBeforeIssued",reason:"Cancelled after waiting for async completion",telemetryData:dp(x,t)}}let P=b.blockMode==="moremultiline"&&TM.isSupported(e.textDocument.detectedLanguageId);if(T!==void 0&&(T[0]=T[0].map(q=>G2e(t,e.textDocument,e.position,q,P,il)).filter(q=>q!==void 0)),T!==void 0&&T[0].length===0)return il.debug(t,`Found empty inline suggestions locally via ${xpe(T[1])}`),{type:"empty",reason:"cached results empty after post-processing",telemetryData:dp(x,t)};if(T!==void 0&&T[0].length>0&&(!m.isCycling||T[0].length>1))il.debug(t,`Found inline suggestions locally via ${xpe(T[1])}`);else{if(m.isCycling){let q=await HGs(t,R,x,o,b.finishedCb);if(q.type==="success"){let Q=T?.[0]??[];q.value[0].forEach(U=>{Q.findIndex(z=>z.completionText.trim()===U.completionText.trim())===-1&&Q.push(U)}),T=[Q,3]}else if(T===void 0)return q}else{let q=a((W,$)=>(t.get(fb).updateCompletion(r,W),b.finishedCb(W,$)),"finishedCb"),Q=new jn.CancellationTokenSource,U=jGs(t,R,x,Q.token,q);t.get(fb).queueCompletionRequest(r,E,g.prompt,Q,U);let z=await t.get(fb).getFirstMatchingRequest(r,E,g.prompt,m.isSpeculative);if(z===void 0)return{type:"empty",reason:"received no results from async completions",telemetryData:dp(x,t)};T=[[z[0]],4]}u("network")}if(T===void 0)return{type:"failed",reason:"internal error: choices should be defined after network call",telemetryData:dp(x,t)};let[D,N]=T,B=D.map(q=>G2e(t,e.textDocument,e.position,q,P,il)).filter(q=>q!==void 0),L=Ht(t,Je.CompletionsDelay)??d.completionsDelay(n),j=dl()-n.issuedTime,M=Math.max(L-j,0);if(N!==2&&!m.isCycling&&M>0&&(il.debug(t,`Waiting ${M}ms before returning completion`),await XI(M),$2e(t,r,o)))return il.debug(t,"Cancelled after completions delay"),{type:"canceled",reason:"after completions delay",telemetryData:$j(x)};let O=[];for(let q of B){let Q=n$s(t,e.textDocument,R,q,x),U=f?PZn(e.textDocument,e.position,q):0,W={completion:e$s(q.choiceIndex,q.completionText,g.trailingWs),telemetry:Q,isMiddleOfTheLine:f,suffixCoverage:U,copilotAnnotations:q.copilotAnnotations,clientCompletionId:q.clientCompletionId};O.push(W)}return x.properties.clientCompletionId=O[0]?.clientCompletionId,x.measurements.foundOffset=O?.[0]?.telemetry?.measurements?.foundOffset??-1,il.debug(t,`Produced ${O.length} results from ${xpe(N)} at ${x.measurements.foundOffset} offset`),$2e(t,r,o)?{type:"canceled",reason:"after post processing completions",telemetryData:$j(x)}:(m.isSpeculative||t.get(pb).setGhostText(E,g.prompt.suffix,B,N),u("complete"),{type:"success",value:[O,N],telemetryData:dp(x,t),telemetryBlob:x,resultType:N,performanceMetrics:l})})}a(WGs,"getGhostTextWithoutAbortHandling");async function Idr(t,e,r,n){let o=ir();t.get(pb).currentRequestId=o;let s=await r$s(t,e.textDocument,o,n);await b7().catch(()=>{});try{return t.get(hb).schedule(e,o,n?.opportunityId??"",s,r,n),t.get(A5).notifyRequest(e,o,s,r,n),await WGs(t,e,o,s,r,n)}catch(c){if(D0(c))return{type:"canceled",reason:"aborted at unknown location",telemetryData:$j(s,{cancelledNetworkRequest:!0})};throw c}}a(Idr,"getGhostText");function zGs(t,e,r,n){let o=t.get(pb).getCompletionsForUserTyping(e,r.suffix),s=t$s(t,e,r.suffix,n);if(o&&o.length>0){let c=(s??[]).filter(l=>!o.some(u=>u.completionText===l.completionText));return[o.concat(c),2]}if(s&&s.length>0)return[s,1]}a(zGs,"getLocalInlineSuggestion");function YGs(t,e){let r=KGs(e,t),n=JGs(e,t);return r&&!n?void 0:r&&n}a(YGs,"isInlineSuggestion");function KGs(t,e){return e.lineAt(t).text.substr(t.character).trim().length!=0}a(KGs,"isMiddleOfTheLine");function JGs(t,e){let n=e.lineAt(t).text.substr(t.character).trim();return/^\s*[)>}\]"'`]*\s*[:{;,]?\s*$/.test(n)}a(JGs,"isValidMiddleOfTheLinePosition");function ZGs(t,e){return e.lineAt(t).text.trim().length===0}a(ZGs,"isNewLine");var QF=class t{constructor(e=!1){this.requestMultilineOverride=e}static{a(this,"ForceMultiLine")}static{this.default=new t}};async function XGs(t,e,r,n,o,s,c){if(t.get(QF).requestMultilineOverride)return{requestMultiline:!0};if(r.lineCount>=8e3)yt(t,"ghostText.longFileMultilineSkip",Vt.createAndMarkAsIssued({languageId:r.detectedLanguageId,lineCount:String(r.lineCount),currentLine:String(n.line)}));else{if(e=="moremultiline"&&TM.isSupported(r.detectedLanguageId))return s?{requestMultiline:!0,blockPosition:await ucn(r,n)}:{requestMultiline:!1};if(["typescript","typescriptreact"].includes(r.detectedLanguageId)&&ZGs(n,r))return{requestMultiline:!0};let u=!1;return!o&&uS(r.detectedLanguageId)?u=await Xat(r,n):o&&uS(r.detectedLanguageId)&&(u=await Xat(r,n)||await Xat(r,r.lineAt(n).range.end)),u||["javascript","javascriptreact","python"].includes(r.detectedLanguageId)&&(u=SYn(c.prompt,r.detectedLanguageId)>.5),{requestMultiline:u}}return{requestMultiline:!1}}a(XGs,"shouldRequestMultiline");function Olt(t,e,r){t.get(l2).append(e.prefix,e.prompt.suffix,r)}a(Olt,"appendToCache");function e$s(t,e,r){if(r.length>0){if(e.startsWith(r))return{completionIndex:t,completionText:e,displayText:e.substring(r.length),displayNeedsWsOffset:!1};{let n=e.substring(0,e.length-e.trimStart().length);return r.startsWith(n)?{completionIndex:t,completionText:e,displayText:e.trimStart(),displayNeedsWsOffset:!0}:{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}}else return{completionIndex:t,completionText:e,displayText:e,displayNeedsWsOffset:!1}}a(e$s,"adjustLeadingWhitespace");function t$s(t,e,r,n){let o=t.get(l2).findAll(e,r);return o.length===0?(il.debug(t,"Found no completions in cache"),[]):(il.debug(t,`Found ${o.length} completions in cache`),o.map(s=>Tdr(s,{forceSingleLine:!n})))}a(t$s,"getCompletionsFromCache");async function r$s(t,e,r,n){let o={headerRequestId:r};n?.opportunityId&&(o.opportunityId=n.opportunityId),n?.selectedCompletionInfo?.text&&(o.completionsActive="true"),n?.isSpeculative&&(o.reason="speculative");let s=Vt.createAndMarkAsIssued(o);return await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e.uri,languageId:e.detectedLanguageId},s)}a(r$s,"createTelemetryWithExp");function n$s(t,e,r,n,o){let s=n.requestId,c={choiceIndex:n.choiceIndex.toString(),clientCompletionId:n.clientCompletionId};n.generatedChoiceIndex!==void 0&&(c.originalChoiceIndex=c.choiceIndex,c.choiceIndex=(1e4*(n.generatedChoiceIndex+1)+n.choiceIndex).toString());let l={compCharLen:n.completionText.length,numLines:n.completionText.trim().split(` +`).length};n.meanLogProb&&(l.meanLogProb=n.meanLogProb),n.meanAlternativeLogProb&&(l.meanAlternativeLogProb=n.meanAlternativeLogProb);let u=n.telemetryData.extendedBy(c,l);return u.issuedTime=o.issuedTime,u.measurements.timeToProduceMs=performance.now()-o.issuedTime,BZn(u,e),u.extendWithRequestId(s),u.measurements.confidence=wZn(t,u),u.measurements.quantile=RZn(t,u),il.debug(t,`Extended telemetry for ${n.telemetryData.properties.headerRequestId} with retention confidence ${u.measurements.confidence} (expected as good or better than about ${u.measurements.quantile} of all suggestions)`),u}a(n$s,"telemetryWithAddData");function i$s(t,e,r,n,o,s,c,l){let u={languageId:e.detectedLanguageId};u.afterAccept=r.afterAccept.toString(),u.isSpeculative=l.isSpeculative.toString();let d=s.extendedBy(u);BZn(d,e);let f=r.repoInfo;d.properties.gitRepoInformation=f===void 0?"unavailable":f===0?"pending":"available",f!==void 0&&f!==0&&(d.properties.gitRepoUrl=f.url,d.properties.gitRepoHost=f.hostname,d.properties.gitRepoOwner=f.owner,d.properties.gitRepoName=f.repo,d.properties.gitRepoPath=f.pathname),d.properties.engineName=c.modelId,d.properties.engineChoiceSource=c.engineChoiceSource,d.properties.isMultiline=JSON.stringify(r.multiline),d.properties.isCycling=JSON.stringify(r.isCycling);let h=e.lineAt(n.line),m=e.getText(cu.range(h.range.start,n)),g=e.getText(cu.range(n,h.range.end)),A=Array.from(o.neighborSource.entries()).map(v=>[v[0],v[1].map(b=>(0,MZn.SHA256)(b).toString())]),y={beforeCursorWhitespace:JSON.stringify(m.trim()===""),afterCursorWhitespace:JSON.stringify(g.trim()===""),neighborSource:JSON.stringify(A),blockMode:r.blockMode},E={...aoe(o.prompt),promptEndPos:e.offsetAt(n),promptComputeTimeMs:o.computeTimeMs};o.metadata&&(y.promptMetadata=JSON.stringify(o.metadata)),o.contextProvidersTelemetry&&(y.contextProviders=JSON.stringify(o.contextProvidersTelemetry));let _=d.extendedBy(y,E);return yt(t,"ghostText.issued",_),d}a(i$s,"telemetryIssued");function BZn(t,e){t.measurements.documentLength=e.getText().length,t.measurements.documentLineCount=e.lineCount}a(BZn,"addDocumentTelemetry");function LZn(t,e,r,n,o){let s=Date.now()-n,c=s-o,l=r.telemetryData.extendedBy({},{completionCharLen:r.completionText.length,requestTimeMs:s,processingTimeMs:o,deltaMs:c,meanLogProb:r.meanLogProb||NaN,meanAlternativeLogProb:r.meanAlternativeLogProb||NaN});l.extendWithRequestId(r.requestId),yt(t,`ghostText.${e}`,l)}a(LZn,"telemetryPerformance");p();p();var aX=class{constructor(e,r,n){this._referenceCount=0;this._isDisposed=!1;this._offset=n;let o=e.get(an);this._tracker=o.onDidChangeTextDocument(s=>{if(s.document.uri===r){for(let c of s.contentChanges)if(c.rangeOffset+c.rangeLength<=this.offset){let l=c.text.length-c.rangeLength;this._offset=this._offset+l}}})}static{a(this,"ChangeTracker")}get offset(){return this._offset}push(e,r){if(this._isDisposed)throw new Error("Unable to push new actions to a disposed ChangeTracker");this._referenceCount++,setTimeout(()=>{e(),this._referenceCount--,this._referenceCount===0&&(this._tracker.dispose(),this._isDisposed=!0)},r)}};p();var yT=class{static{a(this,"CitationManager")}},Blt=class extends yT{static{a(this,"NoOpCitationManager")}async handleIPCodeCitation(e,r){}};p();var xdr=class t{constructor(e,r,n=[],o,s,c){this._textDocument=e;this._position=r;this.originalPosition=o??jn.Position.create(r.line,r.character),this.originalVersion=s??e.version,this.originalOffset=c??e.offsetAt(this.originalPosition),this._editsWithPosition=[...n]}static{a(this,"CompletionState")}get textDocument(){return this._textDocument}get position(){return this._position}get editsWithPosition(){return[...this._editsWithPosition]}updateState(e,r,n){return new t(e,r,n??this.editsWithPosition,this.originalPosition,this.originalVersion,this.originalOffset)}updatePosition(e){return this.updateState(this._textDocument,e)}addSelectedCompletionInfo(e){if(this.editsWithPosition.find(n=>n.source==="selectedCompletionInfo"))throw new Error("Selected completion info already applied");let r={range:e.range,newText:e.text};return this.applyEdits([r],!0)}applyEdits(e,r=!1){if(r&&e.length>1)throw new Error("Selected completion info should be a single edit");let n=this._textDocument,o=this._position,s=n.offsetAt(o),c=this.editsWithPosition;for(let{range:l,newText:u}of e){let d=n.getText(l),f=n.offsetAt(l.end);if(n=n.applyEdits([{range:l,newText:u}]),s{let v=Flt.indexOf(_);v!==-1&&Flt.splice(v,1)}}a(t,"subscribe");function e(){for(let _ of Flt)_()}a(e,"afterUpdateConnection");function r(_){A2.connection!==_&&(A2.connection=_,e())}a(r,"updateConnection");function n(){return A2.connection==="connected"}a(n,"isConnected");function o(){return A2.connection==="disconnected"}a(o,"isDisconnected");function s(){return A2.connection==="retry"}a(s,"isRetrying");function c(){return A2.connection==="disabled"}a(c,"isDisabled");function l(){r("connected"),h(!1)}a(l,"setConnected");function u(){r("disconnected")}a(u,"setDisconnected");function d(){r("retry")}a(d,"setRetrying");function f(){r("disabled")}a(f,"setDisabled");function h(_){A2.initialWait!==_&&(A2.initialWait=_)}a(h,"setInitialWait");function m(_,v=o$s){s()||(d(),h(!0),A(_,v))}a(m,"enableRetry");function g(){return A2.initialWait}a(g,"isInitialWait");async function A(_,v){gb.info(_,`Attempting to reconnect in ${v}ms.`),await y(v),h(!1);let b=_.get(cr);function T(w,R){if(w>UZn){gb.info(R,"Max retry time reached, disabling."),f();return}let x=a(async()=>{A2.retryAttempts=Math.min(A2.retryAttempts+1,QZn);try{gb.info(R,`Pinging service after ${w} second(s)`);let P=await b.fetch(new URL("_ping",BB(R)["origin-tracker"]).href,{method:"GET",headers:{"content-type":"application/json"}});if(P.status!==200||!P.ok)T(w**2,R);else{gb.info(R,"Successfully reconnected."),l();return}}catch{T(w**2,R)}},"tryAgain");setTimeout(()=>{x()},w*1e3)}a(T,"succeedOrRetry"),gb.info(_,"Attempting to reconnect."),T(wdr,_)}a(A,"attemptToPing");let y=a(_=>new Promise(v=>setTimeout(v,_)),"timeout");function E(_){return{dispose:t(_)}}return a(E,"listen"),Llt={setConnected:l,setDisconnected:u,setRetrying:d,setDisabled:f,enableRetry:m,listen:E,isConnected:n,isDisconnected:o,isRetrying:s,isDisabled:c,isInitialWait:g},Llt}a(s$s,"registerConnectionState");var lX=s$s();p();var Cg={BadArguments:"BadArgumentsError",Unauthorized:"NotAuthorized",NotFound:"NotFoundError",RateLimit:"RateLimitError",InternalError:"InternalError",ConnectionError:"ConnectionError",Unknown:"UnknownError"},V2e={[Cg.Unauthorized]:"Invalid GitHub token. Please sign out from your GitHub account using VSCode UI and try again",[Cg.InternalError]:"Internal error: matches to public code will not be detected. It is advised to disable Copilot completions until the service is reconnected.",[Cg.RateLimit]:"You've reached your quota and limit, code matching will be unavailable until the limit resets"};function Rdr(t){return t===401?Cg.Unauthorized:t===400?Cg.BadArguments:t===404?Cg.NotFound:t===429?Cg.RateLimit:t>=500&&t<600?Cg.InternalError:t>=600?Cg.ConnectionError:Cg.Unknown}a(Rdr,"getErrorType");function D5(t,e,r={}){return{kind:"failure",reason:Rdr(Number(t)),code:Number(t),msg:e,meta:r}}a(D5,"createErrorResponse");p();var a$s=/^[1-6][0-9][0-9]$/,c$s=/([A-Z][a-z]+)/,l$s="code_referencing",W2e=class{constructor(e){this.baseKey=e}static{a(this,"CodeQuoteTelemetry")}buildKey(...e){return[l$s,this.baseKey,...e].join(".")}},Pdr=class extends W2e{static{a(this,"CopilotOutputLogTelemetry")}constructor(){super("github_copilot_log")}handleOpen({context:e}){let r=this.buildKey("open","count"),n=Vt.createAndMarkAsIssued();yt(e,r,n)}handleFocus({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("focus","count");yt(e,n,r)}handleWrite({context:e}){let r=Vt.createAndMarkAsIssued(),n=this.buildKey("write","count");yt(e,n,r)}},q4f=new Pdr,kdr=class extends W2e{static{a(this,"MatchNotificationTelemetry")}constructor(){super("match_notification")}handleDoAction({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("acknowledge","count");yt(e,o,n)}handleDismiss({context:e,actor:r}){let n=Vt.createAndMarkAsIssued({actor:r}),o=this.buildKey("ignore","count");yt(e,o,n)}},j4f=new kdr,Ddr=class extends W2e{static{a(this,"SnippyTelemetry")}constructor(){super("snippy")}handleUnexpectedError({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});Fm(e,this.buildKey("unexpectedError"),o)}handleCompletionMissing({context:e,origin:r,reason:n}){let o=Vt.createAndMarkAsIssued({origin:r,reason:n});Fm(e,this.buildKey("completionMissing"),o)}handleSnippyNetworkError({context:e,origin:r,reason:n,message:o}){if(!r.match(a$s)){gb.debug(e,"Invalid status code, not sending telemetry",{origin:r});return}let s=n.split(c$s).filter(l=>!!l).join("_").toLowerCase(),c=Vt.createAndMarkAsIssued({message:o});Fm(e,this.buildKey(s,r),c)}},Ult=new Ddr;var u$s="twirp/github.snippy.v1.SnippyAPI";async function Ndr(t,e,r,n){let o;try{o=await t.get(Ut).getToken()}catch{return lX.setDisconnected(),D5(401,V2e[Cg.Unauthorized])}if(gb.info(t,`Calling ${e}`),lX.isRetrying())return D5(600,"Attempting to reconnect to the public code matching service.");if(lX.isDisconnected())return D5(601,"The public code matching service is offline.");let s;try{s=await t.get(cr).fetch(NI(t,o,"origin-tracker",`${u$s}/${e}`),{method:r.method,body:r.method==="POST"?JSON.stringify(r.body):void 0,headers:{"content-type":"application/json",authorization:`Bearer ${o.token}`,...xy(t)},signal:n})}catch{return lX.enableRetry(t),D5(602,"Network error detected. Check your internet connection.")}!s.ok&&(s.status===401||s.status===403)&&t.get(Ut).resetToken("snippy",s.status);let c;try{c=await s.json()}catch(A){let y=A.message;throw Ult.handleUnexpectedError({context:t,origin:"snippyNetwork",reason:y}),A}if(s.ok)return{kind:"success",...c};let l={...c,code:Number(s.status)},{code:u,msg:d,meta:f}=l,h=Number(u),m=Rdr(h),g=d||"unknown error";switch(m){case Cg.Unauthorized:return D5(u,V2e[Cg.Unauthorized],f);case Cg.BadArguments:return D5(u,g,f);case Cg.RateLimit:return lX.enableRetry(t,60*1e3),D5(u,V2e.RateLimitError,f);case Cg.InternalError:return lX.enableRetry(t),D5(u,V2e[Cg.InternalError],f);default:return D5(u,g,f)}}a(Ndr,"call");p();var Qlt=S.Object({kind:S.Literal("failure"),reason:S.String(),code:S.Number(),msg:S.String(),meta:S.Optional(S.Any())}),f$s=S.Object({matched_source:S.String(),occurrences:S.String(),capped:S.Boolean(),cursor:S.String(),github_url:S.String()}),qZn=S.Object({source:S.String()}),p$s=S.Object({snippets:S.Array(f$s)}),jZn=S.Union([p$s,Qlt]),HZn=S.Object({cursor:S.String()}),h$s=S.Object({commit_id:S.String(),license:S.String(),nwo:S.String(),path:S.String(),url:S.String()}),m$s=S.Object({has_next_page:S.Boolean(),cursor:S.String()}),g$s=S.Object({count:S.Record(S.String(),S.String())}),A$s=S.Object({file_matches:S.Array(h$s),page_info:m$s,license_stats:g$s}),GZn=S.Union([A$s,Qlt]);async function $Zn(t,e,r){let n=await Ndr(t,"Match",{method:"POST",body:HY(qZn,{source:e})},r);return HY(jZn,n)}a($Zn,"Match");async function VZn(t,{cursor:e},r){let n=await Ndr(t,"FilesForMatch",{method:"POST",body:HY(HZn,{cursor:e})},r);return HY(GZn,n)}a(VZn,"FilesForMatch");p();var z2e=new RegExp("[_\\p{L}\\p{Nd}]+|====+|----+|####+|////+|\\*\\*\\*\\*+|[\\p{P}\\p{S}]","gu"),qlt=65;function _$s(t){let e=0,r;z2e.lastIndex=0;do if(r=z2e.exec(t),r&&(e+=1),e>=qlt)break;while(r);return e}a(_$s,"lexemeLength");function v$s(t,e){let r=0,n;z2e.lastIndex=0;do if(n=z2e.exec(t),n&&(r+=1,r>=e))return z2e.lastIndex;while(n);return t.length}a(v$s,"offsetFirstLexemes");function WZn(t,e){let r=t.split("").reverse().join(""),n=v$s(r,e);return r.length-n}a(WZn,"offsetLastLexemes");function Y2e(t){return _$s(t)>=qlt}a(Y2e,"hasMinLexemeLength");function b$s(t){return bM.Check(Qlt,t)}a(b$s,"isError");async function zZn(t,e){let r=await e();if(b$s(r)){Ult.handleSnippyNetworkError({context:t,origin:String(r.code),reason:r.reason,message:r.msg});return}return r}a(zZn,"snippyRequest");function YZn(t){return"kind"in t&&t.kind==="failure"}a(YZn,"isMatchError");async function KZn(t,e,r,n){let s=await t.get(an).getTextDocument({uri:e});if(!s){gb.debug(t,`Expected document matching ${e}, got nothing.`);return}let c=s.getText();if(!Y2e(c)||!Y2e(c))return;let l=r;if(!Y2e(r)){let g=c.slice(0,n),A=WZn(g,qlt);l=c.slice(A,n+r.length)}if(!Y2e(l))return;let u=await zZn(t,()=>$Zn(t,l));if(!u||YZn(u)||!u.snippets.length){gb.info(t,"No match found");return}gb.info(t,"Match found");let{snippets:d}=u,f=d.map(async g=>{let A=await zZn(t,()=>VZn(t,{cursor:g.cursor}));if(!A||YZn(A))return;let y=A.file_matches,E=A.license_stats;return{match:g,files:y,licenseStats:E}}),m=(await Promise.all(f)).filter(g=>g!==void 0);if(m.length)for(let g of m){let A=new Set(Object.keys(g.licenseStats?.count??{}));A.has("NOASSERTION")&&(A.delete("NOASSERTION"),A.add("unknown"));let y=Array.from(A).sort(),E=n,_=n+g.match.matched_source.length,v=s.positionAt(E),b=s.positionAt(_);await t.get(yT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:E,offsetEnd:_,version:s.version,location:{start:v,end:b},matchingText:l,details:y.map(T=>({license:T,url:g.match.github_url}))})}}a(KZn,"fetchCitations");p();function Mdr(t,e,r=(n,o)=>n===o?0:1){if(e.length===0||t.length===0)return{distance:e.length,startOffset:0,endOffset:0};let n=new Array(e.length+1).fill(0),o=new Array(e.length+1).fill(0),s=new Array(t.length+1).fill(0),c=new Array(t.length+1).fill(0),l=e[0];for(let d=0;d0?d-1:0;for(let d=1;d(l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other"))(r||={});let n=0;for(let o of t){let s;new RegExp("(\\p{L}|\\p{Nd}|_)","u").test(o)?s=0:o===" "?s=1:s=2,s===n&&s!==2?e+=o:(e.length>0&&(yield e),e=o,n=s)}e.length>0&&(yield e)}a(I$s,"lexGeneratorWords");function JZn(t,e,r,n){let o=[],s=0;for(let c of r(t))n(c)&&(e.has(c)||e.set(c,e.size),o.push([e.get(c),s])),s+=c.length;return[o,e]}a(JZn,"lexicalAnalyzer");function ZZn(t){return t!==" "}a(ZZn,"notSingleSpace");function XZn(t,e,r=I$s){let[n,o]=JZn(t,S$s(),r,ZZn),[s,c]=JZn(e,o,r,ZZn);if(s.length===0||n.length===0)return{lexDistance:s.length,startOffset:0,endOffset:0,haystackLexLength:n.length,needleLexLength:s.length};let l=T$s(c),u=s.length,d=l[s[0][0]],f=l[s[u-1][0]];function h(y,E,_,v){if(v===0||v===u-1){let b=l[n[_][0]];return v==0&&b.endsWith(d)||v==u-1&&b.startsWith(f)?0:1}else return y===E?0:1}a(h,"compare");let m=Mdr(n.map(y=>y[0]),s.map(y=>y[0]),h),g=n[m.startOffset][1],A=m.endOffset0&&t[A-1]===" "&&--A,{lexDistance:m.distance,startOffset:g,endOffset:A,haystackLexLength:n.length,needleLexLength:s.length}}a(XZn,"lexEditDistance");p();function eH(t){return t.length===0?0:t.split(` +`).length}a(eH,"countLines");function eXn(t,e){return e.compType==="partial"?t.substring(0,e.acceptedLength):t}a(eXn,"computeCompletionText");var tH=new Ae("postInsertion"),tXn=[{seconds:15,captureCode:!1,captureRejection:!1},{seconds:30,captureCode:!0,captureRejection:!0},{seconds:120,captureCode:!1,captureRejection:!1},{seconds:300,captureCode:!1,captureRejection:!1},{seconds:600,captureCode:!1,captureRejection:!1}],rXn=50,x$s=1500,w$s=.5,R$s=500,Odr={triggerPostInsertionSynchroneously:!1,captureCode:!1,captureRejection:!1};async function nXn(t,e,r,n,o){let s=await t.get(ri).getOrReadTextDocumentWithFakeClientProperties({uri:e});if(s.status!=="valid")return tH.info(t,`Could not get document for ${e}. Maybe it was closed by the editor.`),{prompt:{prefix:"",suffix:"",isFimEnabled:!1},capturedCode:"",terminationOffset:0};let c=s.document,l=c.getText(),u=l.substring(0,n),d=c.positionAt(n),f=await ehe(t,r.properties.headerRequestId,cX(c,d),r),h=f.type==="prompt"?f.prompt:{prefix:u,suffix:"",isFimEnabled:!1};if(h.isFimEnabled&&o!==void 0){let m=l.substring(n,o);return h.suffix=l.substring(o),{prompt:h,capturedCode:m,terminationOffset:0}}else{let m=l.substring(n),g=Xlr(u,n,c.detectedLanguageId),y=YYn(g,void 0)(m),E=Math.min(l.length,n+(y?y*2:R$s)),_=l.substring(n,E);return{prompt:h,capturedCode:_,terminationOffset:y??-1}}}a(nXn,"captureCode");function jlt(t,e,r,n,o){o.forEach(({completionText:u,completionTelemetryData:d})=>{tH.debug(t,`${e}.rejected choiceIndex: ${d.properties.choiceIndex}`),IYn(t,e,d)});let s=new aX(t,n,r-1),c=new aX(t,n,r),l=a(async u=>{tH.debug(t,`Original offset: ${r}, Tracked offset: ${s.offset}`);let{completionTelemetryData:d}=o[0],{prompt:f,capturedCode:h,terminationOffset:m}=await nXn(t,n,d,s.offset+1,c.offset),g={hypotheticalPromptJson:JSON.stringify({prefix:f.prefix,context:f.context}),hypotheticalPromptSuffixJson:JSON.stringify(f.suffix)},A=d.extendedBy({...g,capturedCodeJson:JSON.stringify(h)},{timeout:u.seconds,insertionOffset:r,trackedOffset:s.offset,terminationOffsetInCapturedCode:m});tH.debug(t,`${e}.capturedAfterRejected choiceIndex: ${d.properties.choiceIndex}`,A),yt(t,e+".capturedAfterRejected",A,1)},"checkInCode");tXn.filter(u=>u.captureRejection).map(u=>s.push(Nm(t,()=>l(u),"postRejectionTasks"),u.seconds*1e3))}a(jlt,"postRejectionTasks");function K2e(t,e,r,n,o,s,c,l){let u=s.extendedBy({compType:c.compType},{compCharLen:c.acceptedLength,numLines:c.acceptedLines});tH.debug(t,`${e}.accepted choiceIndex: ${u.properties.choiceIndex}`),TYn(t,e,u);let d=r;r=eXn(r,c);let f=r.trim(),h=new aX(t,o,n),m=new aX(t,o,n+r.length),g=a(async A=>{await N$s(t,e,f,n,o,A,u,h,m)},"stillInCodeCheck");if(Odr.triggerPostInsertionSynchroneously&&m1(t)){let A=g({seconds:0,captureCode:Odr.captureCode,captureRejection:Odr.captureRejection});t.get(_d).register(A)}else tXn.map(A=>h.push(Nm(t,()=>g(A),"postInsertionTasks"),A.seconds*1e3));Nm(t,P$s,"post insertion citation check")(t,o,d,r,n,l)}a(K2e,"postInsertionTasks");async function P$s(t,e,r,n,o,s){if(!s||(s.ip_code_citations?.length??0)<1){if(MI(t)?.getTokenValue("sn")==="1")return;await KZn(t,e,n,o);return}let c=await t.get(an).getTextDocument({uri:e});if(c){let l=Bdr(c.getText(),n,rXn,o);l.stillInCodeHeuristic&&(o=l.foundOffset)}for(let l of s.ip_code_citations){let u=k$s(r.length,n.length,l.start_offset);if(u===void 0){tH.info(t,`Full completion for ${e} contains a reference matching public code, but the partially inserted text did not include the match.`);continue}let d=o+u,f=c?.positionAt(d),h=o+D$s(r.length,n.length,l.stop_offset),m=c?.positionAt(h),g=f&&m?c?.getText({start:f,end:m}):"";await t.get(yT).handleIPCodeCitation(t,{inDocumentUri:e,offsetStart:d,offsetEnd:h,version:c?.version,location:f&&m?{start:f,end:m}:void 0,matchingText:g,details:l.details.citations})}}a(P$s,"citationCheck");function k$s(t,e,r){if(!(ee))return r}a(k$s,"computeCitationStart");function D$s(t,e,r){return e{if(r.displayText&&r.telemetry){let n,o;t.partiallyAcceptedLength?(n=r.displayText.substring(t.partiallyAcceptedLength-1),o=r.telemetry.extendedBy({compType:"partial"},{compCharLen:n.length})):(n=r.displayText,o=r.telemetry);let s={completionText:n,completionTelemetryData:o,offset:r.offset};e.push(s)}}),e}a(B$s,"computeRejectedCompletions");function Ldr(t,e){let r=t.get(GA);if(!r.position||!r.uri)return;let n=B$s(r);n.length>0&&jlt(t,"ghostText",e??n[0].offset,r.uri,n),r.resetState(),r.resetPartialAcceptanceState()}a(Ldr,"rejectLastShown");function iXn(t,e,r,n){let o=t.get(GA);return o.position&&o.uri&&!(o.position.line===r.line&&o.position.character===r.character&&o.uri.toString()===e.uri.toString())&&n!==2&&Ldr(t,e.offsetAt(o.position)),o.setState(e,r),o.index}a(iXn,"setLastShown");function oXn(t,e){let r=t.get(GA);if(r.index=e.index,!r.shownCompletions.find(n=>n.index===e.index)&&(e.uri===r.uri&&r.position?.line===e.position.line&&r.position?.character==e.position.character&&r.shownCompletions.push(e),e.displayText)){let n=e.resultType!==0;O$s.debug(t,`[${e.telemetry.properties.headerRequestId}] shown choiceIndex: ${e.telemetry.properties.choiceIndex}, fromCache ${n}`),e.telemetry.measurements.compCharLen=e.displayText.length,Hat(t,"ghostText",e)}}a(oXn,"handleGhostTextShown");function L$s(t,e,r){let n=t.get(GA);n.linesLeft===void 0&&(n.linesAccepted=eH(e.insertText.substring(0,r)),n.linesLeft=eH(e.displayText));let o=eH(e.displayText);n.linesLeft>o&&(n.linesAccepted+=n.linesLeft-o,n.lastLineAcceptedLength=n.partiallyAcceptedLength,n.linesLeft=o),n.partiallyAcceptedLength=(n.lastLineAcceptedLength||0)+r}a(L$s,"handleLineAcceptance");function rhe(t,e,r="ghostText"){let n=t.get(GA),o;return n.partiallyAcceptedLength?o={compType:"full",acceptedLength:(n.partiallyAcceptedLength||0)+e.displayText.length,acceptedLines:n.linesAccepted+(n.linesLeft??0)}:o={compType:"full",acceptedLength:e.displayText.length,acceptedLines:eH(e.displayText)},n.resetState(),K2e(t,r,e.displayText,e.offset,e.uri,e.telemetry,o,e.copilotAnnotations)}a(rhe,"handleGhostTextPostInsert");function Hlt(t,e,r,n=0,o="ghostText",s="line"){let c=t.get(GA),l;return s==="cumulative"?(F$s(t,e,r),l={compType:c.totalLength!=null?"full":"partial",acceptedLength:c.totalLength??(c.partiallyAcceptedLength||0),acceptedLines:c.linesAccepted},l.compType==="full"&&c.resetState()):(L$s(t,e,r),l={compType:"partial",acceptedLength:c.partiallyAcceptedLength||0,acceptedLines:c.linesAccepted}),K2e(t,o,e.displayText,e.offset,e.uri,e.telemetry,l,e.copilotAnnotations)}a(Hlt,"handlePartialGhostTextPostInsert");function F$s(t,e,r){let n=t.get(GA);n.partiallyAcceptedLength=(n.partiallyAcceptedLength||0)+r,n.linesAccepted=eH(e.insertText.substring(0,n.partiallyAcceptedLength)),n.partiallyAcceptedLength>=e.insertText.length&&(n.totalLength=n.partiallyAcceptedLength)}a(F$s,"handleCumulativeAcceptance");p();p();var sXn=require("fs"),Fdr=fe(require("path"));var U$s=new Set(["installed.json","enablement.json"]),Glt=class{constructor(e,r,n,o=50){this.ctx=e;this.dir=r;this.debounceMs=o;this.logger=new Ae("PluginFileWatcher");this._onDidChange=new Kf;this.onDidChange=this._onDidChange.event;this._disposed=!1;this._dirKey=Ak(r),this._watcher=n??Lze(e),this._ownsWatcher=n===void 0}static{a(this,"PluginFileWatcher")}async start(){if(!this._disposed)try{if(await sXn.promises.mkdir(this.dir,{recursive:!0,mode:448}),this._disposed)return;this._changeSubscription=this._watcher.onDidChange(e=>this.onEvents(e)),this._watchHandle=this._watcher.watch({path:this.dir,recursive:!1})}catch(e){this.logger.warn(this.ctx,"failed to start watching plugin manifests",{dir:this.dir,err:String(e)})}}onEvents(e){if(this._disposed)return;e.some(n=>{let o=Ak(n.path);return Fdr.posix.dirname(o)===this._dirKey&&U$s.has(Fdr.posix.basename(o))})&&this.scheduleFire()}scheduleFire(){this._debounceTimer===void 0&&(this._debounceTimer=setTimeout(()=>{this._debounceTimer=void 0,this._disposed||this._onDidChange.fire()},this.debounceMs))}dispose(){this._disposed||(this._disposed=!0,this._debounceTimer!==void 0&&(clearTimeout(this._debounceTimer),this._debounceTimer=void 0),this._watchHandle?.dispose(),this._changeSubscription?.dispose(),this._ownsWatcher&&this._watcher.dispose(),this._onDidChange.dispose())}};p();p();function aXn(t){if(typeof t!="object"||t===null)return!1;let e=t;return typeof e.pluginUri=="string"&&typeof e.name=="string"&&typeof e.marketplace=="string"}a(aXn,"isInstalledEntry");var y2=require("fs"),N5=fe(require("path"));var j$s="plugins",H$s="plugins",G$s="installed.json",$$s="enablement.json",V$s=".lock",W$s=1e4,z$s=3e4,Y$s=25,K$s=0,J$s=a(t=>typeof t=="string","isString"),J2e=class t{constructor(e){this.rootDir=e}static{a(this,"PluginStore")}editorPluginsDir(e){return N5.join(this.rootDir,this.safeEditorSegment(e),H$s)}installedJsonPath(e){return N5.join(this.editorPluginsDir(e),G$s)}enablementJsonPath(e){return N5.join(this.editorPluginsDir(e),$$s)}async readInstalled(e){let{version:r,items:n}=await this.readManifest(this.installedJsonPath(e),"installed",1,aXn);return{version:r,installed:n}}async readEnablement(e){let{version:r,items:n}=await this.readManifest(this.enablementJsonPath(e),"disabled",1,J$s);return{version:r,disabled:n}}async readManifest(e,r,n,o){let s=await this.readJson(e),c=s?.[r];return Array.isArray(c)?{version:typeof s?.version=="number"?s.version:n,items:c.filter(o)}:{version:n,items:[]}}async writeInstalled(e,r){await this.writeJsonAtomic(this.installedJsonPath(e),r)}async writeEnablement(e,r){await this.writeJsonAtomic(this.enablementJsonPath(e),r)}async withLock(e,r){let n=N5.join(this.editorPluginsDir(e),V$s);await y2.promises.mkdir(N5.dirname(n),{recursive:!0,mode:448});let o=Date.now()+z$s;for(;;)try{await y2.promises.writeFile(n,`${process.pid} +`,{flag:"wx",mode:384});break}catch(s){if(s.code!=="EEXIST")throw s;if(Date.now()>o)throw new Error(`PluginStore: timed out acquiring lock for editor ${JSON.stringify(e)}`);await this.lockAgeMs(n)>W$s&&await y2.promises.rm(n,{force:!0}).catch(()=>{}),await new Promise(c=>setTimeout(c,Y$s))}try{return await r()}finally{await y2.promises.rm(n,{force:!0}).catch(()=>{})}}async lockAgeMs(e){try{let r=await y2.promises.stat(e);return Date.now()-r.mtimeMs}catch{return 1/0}}static isSafeEditorId(e){return!(!e||e==="."||e===".."||e.toLowerCase()===j$s||e!==N5.basename(e)||/[/\\]/.test(e)||process.platform==="win32"&&/[<>:"|?*]/.test(e))}safeEditorSegment(e){if(!t.isSafeEditorId(e))throw new Error(`PluginStore: unsafe editorId ${JSON.stringify(e)}`);return e}async readJson(e){try{let r=await y2.promises.readFile(e,{encoding:"utf8"});return JSON.parse(r)}catch{return}}async writeJsonAtomic(e,r){let n=N5.dirname(e);await y2.promises.mkdir(n,{recursive:!0,mode:448});let o=`${e}.${process.pid}.${K$s++}.tmp`,s=JSON.stringify(r,null,2)+` +`;try{await y2.promises.writeFile(o,s,{encoding:"utf8",mode:384}),await y2.promises.rename(o,e)}catch(c){throw await y2.promises.rm(o,{force:!0}).catch(()=>{}),c}}};var Udr=require("fs"),$lt=fe(require("path"));var uX=class{constructor(e,r,n=50){this.ctx=e;this.watchDebounceMs=n;this.logger=new Ae("AgentPluginService");this._onDidChangePlugins=new Kf;this.onDidChangePlugins=a((e,r,n)=>(this.ensureWatching(),this._onDidChangePlugins.event(e,r,n)),"onDidChangePlugins");this.mutationSequencer=new qM;this._watchStarted=!1;this._disposed=!1;this._injectedWatcher=r,this.ensureWatching()}static{a(this,"AgentPluginService")}get store(){return this._store||(this._store=new J2e(this.ctx.get(yi).directory)),this._store}get editorId(){return this.ctx.get(Nr).getEditorIdentity().editorId}guardEditorId(e){let r=this.editorId;if(J2e.isSafeEditorId(r))return r;this.logger.warn(this.ctx,`${e} skipped: unsafe editorId`,{editorId:r})}async listPlugins(){this.ensureWatching();let e=this.guardEditorId("listPlugins");if(e===void 0)return[];let[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]),o=new Set(n);return r.map(s=>({uri:s.pluginUri,label:s.name,enabled:!o.has(s.pluginUri)}))}async enablePlugin(e){await this.setPluginEnabled(e,!0)}async disablePlugin(e){await this.setPluginEnabled(e,!1)}async setPluginEnabled(e,r){this.ensureWatching(),await this.mutate(async n=>{let o=await this.store.readEnablement(n),s=o.disabled.includes(e);if(r===!s)return!1;let c=r?o.disabled.filter(l=>l!==e):[...o.disabled,e];return await this.store.writeEnablement(n,{...o,disabled:c}),this.logger.info(this.ctx,`${r?"enabled":"disabled"} plugin`,{pluginUri:e}),!0})}async mutate(e){let r=this.guardEditorId("mutation");if(r===void 0)return;await this.mutationSequencer.queue(r,()=>this.store.withLock(r,()=>e(r)))&&await this.refreshAndMaybeFire()}async reconcile(){this.ensureWatching();let e=this.guardEditorId("reconcile");if(e===void 0)return;let r=await this.store.readInstalled(e),n=await Promise.all(r.installed.map(s=>this.shouldDrop(s))),o=new Set(r.installed.filter((s,c)=>n[c]).map(s=>s.pluginUri));o.size!==0&&await this.mutate(async s=>{let c=await this.store.readInstalled(s),l=await Promise.all(c.installed.map(f=>o.has(f.pluginUri)?this.shouldDrop(f):Promise.resolve(!1))),u=c.installed.filter((f,h)=>!l[h]),d=c.installed.filter((f,h)=>l[h]);for(let f of d)this.logger.info(this.ctx,"reconcile dropped missing plugin",{name:f.name,pluginUri:f.pluginUri});return d.length===0?!1:(await this.store.writeInstalled(s,{...c,installed:u}),await this.pruneEnablement(s,d.map(f=>f.pluginUri)),!0)})}async pruneEnablement(e,r){let n=new Set(r),o=await this.store.readEnablement(e),s=o.disabled.filter(c=>!n.has(c));s.length!==o.disabled.length&&await this.store.writeEnablement(e,{...o,disabled:s})}async shouldDrop(e){if(!$lt.isAbsolute(e.pluginUri))return!1;try{return await Udr.promises.stat(e.pluginUri),!1}catch(r){if(r.code==="ENOENT")try{if((await Udr.promises.stat($lt.dirname(e.pluginUri))).isDirectory())return!0}catch{}return this.logger.warn(this.ctx,"reconcile: stat failed, keeping plugin",{pluginUri:e.pluginUri,code:r.code}),!1}}ensureWatching(){if(this._watchStarted||this._disposed||!this.ctx.get(Nr).isEditorPluginInfoKnown())return;this._watchStarted=!0;let e=this.guardEditorId("plugin watch");if(e===void 0)return;let r=this.store.editorPluginsDir(e);this._fileWatcher=new Glt(this.ctx,r,this._injectedWatcher,this.watchDebounceMs),this._watchSubscription=this._fileWatcher.onDidChange(()=>{this.refreshAndMaybeFire()}),this.seedAndStart()}async seedAndStart(){await this.mutationSequencer.queue(this.editorId,async()=>{if(this._lastStateKey===void 0)try{this._lastStateKey=await this.stateKey()}catch{}}),!this._disposed&&await this._fileWatcher?.start()}refreshAndMaybeFire(){return this.mutationSequencer.queue(this.editorId,async()=>{if(this._disposed)return;let e;try{e=await this.stateKey()}catch(r){this.logger.warn(this.ctx,"plugin refresh failed",{err:String(r)});return}e!==this._lastStateKey&&(this._lastStateKey=e,this._onDidChangePlugins.fire())})}async stateKey(){let e=this.editorId,[{installed:r},{disabled:n}]=await Promise.all([this.store.readInstalled(e),this.store.readEnablement(e)]);return JSON.stringify({installed:r.map(o=>[o.pluginUri,o.name]).sort((o,s)=>o[0].localeCompare(s[0])||o[1].localeCompare(s[1])),disabled:[...n].sort()})}dispose(){this._disposed||(this._disposed=!0,this._watchSubscription?.dispose(),this._fileWatcher?.dispose(),this._onDidChangePlugins.dispose())}};p();var M5=new Map;M5.set("copilot",{app:"copilot-client",catalog_service:"CopilotCompletionsVSCode"});M5.set("copilot-intellij",{app:"copilot-intellij",catalog_service:"CopilotIntelliJ"});M5.set("copilot-xcode",{app:"copilot-xcode",catalog_service:"CopilotXcode"});M5.set("copilot-eclipse",{app:"copilot-eclipse",catalog_service:"CopilotEclipse"});M5.set("copilot.vim",{app:"copilot-vim",catalog_service:"CopilotVim"});M5.set("copilot-vs",{app:"copilot-vs",catalog_service:"CopilotVS"});var Z$s=new Ae("sdk");function Vlt(t,e){M5.has(t.get(Nr).getEditorPluginInfo().name)||Z$s.warn(t,...e)}a(Vlt,"deprecationWarning");var OHi=fe(TL()),nI=fe(fk());p();p();p();p();var Wlt={NewGitHubLogin:"auth.new_github_login",GitHubLoginResult:"auth.github_login_result",CodeFlowInnerError:"auth.code_flow_inner_error"};function nhe(t,e){let r=Vt.createAndMarkAsIssued({authType:e});yt(t,Wlt.NewGitHubLogin,r),_t(t,Wlt.NewGitHubLogin,{authType:e})}a(nhe,"telemetryNewGitHubLogin");function E2(t,e,r,n,o){si(t,Wlt.GitHubLoginResult,o,{authType:e,authStatus:r},{totalTimeMs:n})}a(E2,"telemetryGitHubLoginResult");function Z2e(t,e,r){si(t,Wlt.CodeFlowInnerError,e,{loopbackServerPath:r??""})}a(Z2e,"telemetryCodeFlowError");var cXn=["repo","workflow"],Qdr=class extends gi{static{a(this,"DeviceFlowError")}constructor(e){super(e.error_description),this.code=e.error,this.uri=e.error_uri,this.name="DeviceFlowError"}};async function X$s(t,e,{serverUrl:r}){let n={method:"POST",headers:{Accept:"application/json",...xy(t)},json:{client_id:e,scope:cXn.join(" ")},timeout:3e4},o,s=new URL("login/device/code",r).href;try{o=await t.get(cr).fetch(s,n)}catch(c){throw c instanceof Error&&kI(c)?new gi(`Could not log in with device flow on ${r}: ${c.message}`):c}if(!o.ok)throw new gi(`Could not log in with device flow on ${r}: HTTP ${o.status}`);return await o.json()}a(X$s,"requestDeviceFlowStage1");async function eVs(t,e,r,{serverUrl:n}){let o={method:"POST",headers:{Accept:"application/json",...xy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s=await t.get(cr).fetch(new URL("login/oauth/access_token",n).href,o),c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Qdr(c):new gi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(eVs,"requestDeviceFlowStage2");async function tVs(t,e){let n=await(await Lf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new gi(`Error retrieving user information: ${String(n.errors)}`);return n}a(tVs,"requestUserInfo");var ET=class{constructor(e){this.ctx=e;this.pendingSignIn=void 0}static{a(this,"GitHubDeviceFlow")}get authManager(){return this.ctx.get(Fr)}async save(e){let r=new URL(e.serverUrl).hostname;return await this.authManager.signInEditor({accessToken:e.accessToken,user:e.login,githubAppId:e.githubAppId,authAuthority:r,scopes:e.scopes})}async initiate(e,r){let n=e?.githubAppId??this.ctx.get(Up).findAppIdToAuthenticate();r??=this.authManager.getConfiguredUrls();let o=performance.now(),s=a(()=>performance.now()-o,"getElapsedTimeMs");try{let c=await this.getTokenUnguarded(n,r),l=c.waitForAuth.then(async u=>{this.ctx.get(Up).githubAppId=n;let d=await this.save(u);return E2(this.ctx,"deviceFlow",d.status,s()),d});return l.catch(u=>{E2(this.ctx,"deviceFlow","NotSignedIn",s(),u)}),this.pendingSignIn={verificationUri:c.verification_uri,status:l},c}catch(c){throw E2(this.ctx,"deviceFlow","NotSignedIn",s(),c),this.ctx.get(sC).notifyUser(this.ctx,c),c}}async getTokenUnguarded(e,r){let n=this.ctx;nhe(n,"deviceFlow");let o=await X$s(n,e,r),s=(async()=>{let c=o.expires_in,l=o.interval,u;do{await new Promise(f=>setTimeout(f,1e3*l)),u=await eVs(n,o.device_code,e,r),c-=l;let d=u.access_token;if(d){let f=await tVs(n,{...r,accessToken:d}),h=u.scope?u.scope.split(" ").filter(m=>m.length>0):cXn;return{...r,githubAppId:e,login:f.login,accessToken:d,scopes:h}}l=u.interval??l}while(c>0);throw new gi(`Timed out polling for access token. Last response was ${JSON.stringify(u)}`)})();return{...o,waitForAuth:s}}};var qdr=fe(ei());p();var Fw=class{constructor(e){this.ctx=e}static{a(this,"AbstractCommand")}};var zlt="github.copilot.finishDeviceFlow",jdr=class extends Fw{constructor(){super(...arguments);this.name=zlt;this.arguments=S.Tuple([])}static{a(this,"FinishDeviceFlowCommand")}async handle(r,n){let o=this.ctx.get(ET),s=o.pendingSignIn;if(!s)throw new qdr.ResponseError(it.InvalidRequest,"No pending sign in");try{await this.ctx.get(M0).open(s.verificationUri)}catch(c){Zg.warn(this.ctx,"Failed to open",s.verificationUri),Zg.exception(this.ctx,c,zlt)}try{return await s.status}catch(c){throw new qdr.ResponseError(it.DeviceFlowFailed,String(c))}finally{o.pendingSignIn=void 0}}},lXn=[jdr];p();p();var vu=class extends yn{static{a(this,"CopilotCompletionCache")}constructor(e=100){super(e)}};var X2e="github.copilot.didAcceptCompletionItem",Hdr=class extends Fw{constructor(){super(...arguments);this.name=X2e;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}handle(r,[n]){let s=this.ctx.get(vu).get(n);return s?(rhe(this.ctx,s),!0):!1}},uXn=[Hdr];p();p();p();p();p();p();function dXn(t,e,r){function n(s,c,l){let u=new RegExp(`^(${c})+`,"g");return s.split(` `).map(d=>{let f=d.replace(u,""),h=d.length-f.length;return l(h)+f}).join(` `)}a(n,"replace");let o;if(t.tabSize===void 0||typeof t.tabSize=="string"?o=4:o=t.tabSize,t.insertSpaces===!1){let s=a(c=>n(c," ",l=>" ".repeat(Math.floor(l/o))+" ".repeat(l%o)),"r");e.displayText=s(e.displayText),e.completionText=s(e.completionText)}else if(t.insertSpaces===!0){let s=a(c=>n(c," ",l=>" ".repeat(l*o)),"r");if(e.displayText=s(e.displayText),e.completionText=s(e.completionText),r){let c=a(l=>{if(l==="")return l;let u=l.split(` -`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(wZn,"normalizeIndentCharacter");Ns();function RZn(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=Ll.range(Ll.position(o.line,0),Ll.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=wZn(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=Ll.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:gr(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(RZn,"completionsFromGhostTextResults");p();var v2=class{constructor(){this.cache=new nn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var she=class extends BA{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await udr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=bZn(s,r.textDocument,r.position,d),h=RZn(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>udr(s,r,void 0,g),"fn");s.get(v2).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=qn.Range.create(A,qn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(pX(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(pX(r,n),o,s);return Vzn(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});Lat.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(v2).request(r.clientCompletionId)}};var b8i=ce(uMr()),S8i=ce(c0t()),T8i=ce(cX()),TBe=ce(Sc()),gMr=ce(ko());var dMr=class extends gMr.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new TBe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new TBe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new TBe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(Es(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Ur).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Qt).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),evt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Qt);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Ur).resolveSession();return evt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Qt).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function evt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new S8i.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(Ih).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(evt,"asChatLibCopilotToken");var fMr=class extends gMr.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new TBe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(Es(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(mx),o=await this.ctx.get(Qt).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){_s(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},pMr=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(Cc).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get(cn).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},hMr=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},mMr=class extends BA{constructor(r){super();this.ctx=r;this._telemetrySender=new IBe(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(n0).matchFunction,o=new wBe(this.ctx.get(ar)),s=uce(r),c={fetcher:o,authService:new dMr(r),telemetrySender:this._telemetrySender,logTarget:new xBe(r),isRunningInTest:v1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new hMr(r.get(as)),documentManager:r.get(cn),workspace:r.get(T8i.ObservableWorkspace),urlOpener:r.get(N0),editorInfo:r.get(Lr).getEditorInfo(),editorPluginInfo:r.get(Lr).getEditorPluginInfo(),relatedPluginInfo:r.get(Lr).getRelatedPluginInfo(),editorSession:r.get(Fa),notificationSender:r.get(sa),ignoreService:new pMr(r),waitForTreatmentVariables:!1,endpointProvider:new fMr(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s},l=(0,b8i.createInlineCompletionsProvider)(c);return this.ctx.get(Zo).onDidChangeCopilotSettings(()=>{let u=uce(this.ctx);l.setConfigs(u).catch(d=>{_s(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(c.filtersAndExp.exp),this.completionProvider.updateTreatmentVariables(c.filtersAndExp.exp.variables),this.asLocalResult(await this.completionProvider.getInlineCompletions(r,n,o,s),c)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new NI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new SB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new XC(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},tvt=class extends BA{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new she(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new mMr(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return qt(this.ctx,je.UseChatLibCompletions)??this.ctx.get(Jt).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},IBe=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),goe(this.ctx,e,o.properties,o.measurements,0),gt(this.ctx,e,R9(o.properties,w2e),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),goe(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",jt.createAndMarkAsIssued(n,o)}};p();var I8i=ce($G()),x8i=ce(Sc()),RBe=ce(T1r()),w8i=ce(S4());var Jbc=16,B6=class extends I8i.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new nn(Jbc);this._onDidChangeDiagnostics=new x8i.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(Zbc);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function Zbc(t){let e=new w8i.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?RBe.DiagnosticSeverity.Error:RBe.DiagnosticSeverity.Warning,n=new RBe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(Zbc,"toVscodeDiagnostic");p();var VAe=ce(Hre()),R8i=ce(kD()),AMr=ce(Xct()),ivt=ce(cX()),k8i=ce(Ts()),P8i=ce(y2()),kBe=ce(gE()),nvt=ce(I_()),yMr=ce(sd()),D8i=ce(CT()),N8i=ce(ti());p();var rvt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new no;this._onDidChangeTextDocument=new no;this._onDidCloseTextDocument=new no;this._onDidSelectTextDocument=new no;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get(cn)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var WAe=class extends ivt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,P8i.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new rvt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get(cn);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=VAe.DocumentId.create(ca(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=VAe.DocumentId.create(ca(ca(r)));return this.addDocument({id:s,initialValue:o,languageId:AMr.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=VAe.DocumentId.create(ca(ca(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=VAe.DocumentId.create(ca(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=VAe.DocumentId.create(ca(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new EMr(r.id,new D8i.StringText(r.initialValue??""),[],r.languageId??AMr.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},EMr=class extends ivt.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new nvt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new yMr.OffsetRange(r,r)])}editFromLspContentChanges(e){return new R8i.Edits(kBe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(N8i.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new nvt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new nvt.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new k8i.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return kBe.StringEdit.single(new kBe.StringReplacement(new yMr.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var L6=ce(uMr()),O8i=ce(Hre()),_Mr=ce(cX()),B8i=ce(ey()),L8i=ce(K_t()),F8i=ce(Sc()),CMr=require("node:stream");Ns();var M8i=10,Xbc={[L6.LogLevel.Off]:4,[L6.LogLevel.Trace]:4,[L6.LogLevel.Debug]:4,[L6.LogLevel.Info]:3,[L6.LogLevel.Warning]:2,[L6.LogLevel.Error]:1},xBe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Df).logIt(this.ctx,Xbc[e],r,...n)}},DC=class{constructor(e){this.lastResultsById=new nn(M8i);this.lastResultsByUri=new nn(M8i);this.ctx=e,this.telemetrySender=new IBe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(_Mr.ObservableWorkspace);if(s instanceof WAe&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let y=this.lastResultsByUri.get(e);y&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(y.resultId),y.isShown&&o.handleRejection(y.nextEditResult))}let c=O8i.DocumentId.create(ca(e)),l=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(l.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(l.filtersAndExp.exp);let u=await o.getNextEdit(c.toUri(),n);if(u.result==null)return;let d=await this.ctx.get(cn).getTextDocument({uri:e});if(!d)return;let f=d.positionAt(u.result.range.start),h=d.positionAt(u.result.range.endExclusive),m=gr(),g={resultId:m,nextEditResult:u,documentId:c,isShown:!1};return this.lastResultsById.set(m,g),this.lastResultsByUri.set(e,g),[{edit:{text:u.result.newText,range:{start:f,end:h},textDocument:{uri:e,version:r}},id:m}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),await r.handleAcceptance(n.nextEditResult))}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&e1c(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(_Mr.ObservableWorkspace),r=new wBe(this.ctx.get(ar)),n=new vMr(this.ctx),o=uce(this.ctx),s=await(0,L6.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:L8i.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new xBe(this.ctx),languageDiagnosticsService:this.ctx.get(B6)});return this.ctx.get(Zo).onDidChangeCopilotSettings(()=>{let c=uce(this.ctx);s.setConfigs(c).catch(l=>{_s(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return qt(this.ctx,je.NESUseExplicitRejection)}};function e1c(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){_s(t,o,"nesProvider.setDisposalReason")}}a(e1c,"trySetChatLibDisposalReason");var vMr=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new F8i.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Qt).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Qt);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Ur).resolveSession();return evt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Qt).resetToken("nes",e)}},wBe=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof CMr.Readable?c=CMr.Readable.toWeb(s):c=s),new B8i.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},gr(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return OI(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var t1c="github.copilot.didAcceptNextEditSuggestionItem",bMr=class extends Uw{constructor(){super(...arguments);this.name=t1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleAcceptance(n),!0}},r1c="github.copilot.didRejectNextEditSuggestionItem",SMr=class extends Uw{constructor(){super(...arguments);this.name=r1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleRejection(n),!0}},n1c="github.copilot.didIgnoreNextEditSuggestionItem",TMr=class extends Uw{constructor(){super(...arguments);this.name=n1c;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(DC).handleIgnored(n),!0}},U8i=[bMr,SMr,TMr];p();var xMr="github.copilot.didAcceptPanelCompletionItem",IMr=class extends Uw{constructor(){super(...arguments);this.name=xMr;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(vu).get(o);return c?(sDe(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:sH(c.displayText)},c.copilotAnnotations),!0):!1}},Q8i=[IMr];var i1c=[...IZn,...xZn,...U8i,...Q8i];function q8i(t,e){let r=new Map;for(let n of i1c){let o=new n(t),s=Ou.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=F6(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Lr).getEditorPluginInfo();await e.get(Si).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Lr).getEditorPluginInfo(),n=await e.get(Si).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,PBe.gt)((0,PBe.coerce)(r.version),(0,PBe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Lr).getEditorPluginInfo();await e.get(Si).delete("versions",r.name),(await e.get(Si).listKeys("versions")).length===0&&await e.get(Si).deleteSetting("versions")}};p();var V8i=ce(Xc()),W8i=require("crypto"),lvt=ce(require("path")),YAe=ce(Al());var a1c={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},c1c=new YAe.ProgressType,zD=class t{constructor(e){this.ctx=e;this.#e=new no;this._changeHandlerLimiter=new V8i.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new YAe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(ur).connection}init(){this.ctx.get(Mn).getCapabilities().watchedFiles&&this.connection.onNotification(YAe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(Mn).getCapabilities().watchedFiles)return a1c;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(Mn).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=lvt.extname(l).toLowerCase();N7.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=lvt.extname(s.uri).toLowerCase();if(!N7.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.getValidDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async getValidDocument(e){let n=await this.ctx.get(Jn).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,W8i.randomUUID)(),n=[],o=this.connection.onProgress(c1c,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=lvt.extname(l).toLowerCase();if(!N7.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();p();p();var z8i=new ge("AgentRouter"),Y8i="AgentRouter";function XT(t){return t.agentProvider??"BACKGROUND"}a(XT,"resolveProvider");var kc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Us);case"CLAUDE":return this.ctx.get(UF)}}logDispatch(e,r){z8i.debug(this.ctx,`${Y8i}.${e}`,r)}create(e){this.logDispatch("create",e);let r=XT(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=XT(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=XT(e);return this.serviceFor(n).sendMessage(e,r)}stop(e){this.logDispatch("stop",e);let r=XT(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=XT(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=XT(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=XT(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=XT(e);return this.serviceFor(r).handleInteraction(e)}getPlanPath(e){this.logDispatch("getPlanPath",e);let r=XT(e);return this.serviceFor(r).getPlanPath(e.sessionId)}enableRemote(e){this.logDispatch("enableRemote",e);let r=XT(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=XT(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=XT(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=XT(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{z8i.info(this.ctx,`${Y8i}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var l1c=S.Union([S.String(),S.Number()]),Ui=S.String(),KAe=S.Optional(S.Union([S.Literal("none"),S.Literal("low"),S.Literal("medium"),S.Literal("high"),S.Literal("xhigh")])),u1c=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),wMr=S.Array(u1c),DBe=S.Union([S.Literal("default"),S.Literal("long_context")]),JAe=S.Object({model:S.Optional(S.String()),reasoningEffort:KAe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(wMr),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean())});async function Ii(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof Ufe?e.data:void 0;return[null,{code:Ke.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Ii,"withServiceErrorHandling");var K8i=new ge("BackgroundAgent.compactHistory"),d1c=S.Object({sessionId:Ui});async function RMr(t,e,r){K8i.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Us),o=e.onCancellationRequested(()=>{K8i.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await Ii(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(RMr,"handleBackgroundAgentCompactHistoryChecked");var d7p=Ne(d1c,RMr);p();var f1c=S.Union(Object.values(t0).map(t=>S.Literal(t))),Nl=S.Optional(f1c),uvt=S.Intersect([JAe,S.Object({agentProvider:Nl})]);var J8i=new ge("BackgroundAgent.compactHistory"),p1c=S.Object({sessionId:Ui,agentProvider:Nl});async function h1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return RMr(t,e,r);J8i.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.compactHistory(s,e);return J8i.info(t,"compactHistory succeeded"),c})}a(h1c,"handleAgentCompactHistoryChecked");var Z8i=Ne(p1c,h1c);p();p();var X8i=new ge("BackgroundAgent.create"),m1c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),JAe]);async function kMr(t,e,r){X8i.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Us),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles};return Ii(async()=>{let s=await n.createSession(o);return X8i.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(kMr,"handleBackgroundAgentCreateChecked");var U7p=Ne(m1c,kMr);var e6i=new ge("BackgroundAgent.create"),g1c=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),uvt]);async function A1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return kMr(t,e,r);e6i.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.create(s);return e6i.info(t,"create succeeded:",c.sessionId),c})}a(A1c,"handleAgentCreateChecked");var t6i=Ne(g1c,A1c);p();p();var y1c=S.Object({sessionId:Ui});async function PMr(t,e,r){let n=t.get(Us);return Ii(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(PMr,"handleBackgroundAgentDestroyChecked");var oQp=Ne(y1c,PMr);var E1c=new ge("BackgroundAgent.destroy"),_1c=S.Object({sessionId:Ui,agentProvider:Nl});async function C1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return PMr(t,e,r);E1c.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.destroy(s))}a(C1c,"handleAgentDestroyChecked");var r6i=Ne(_1c,C1c);p();p();var v1c=new ge("BackgroundAgent.disableRemote"),b1c=S.Object({sessionId:Ui});async function DMr(t,e,r){v1c.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(DMr,"handleBackgroundAgentDisableRemoteChecked");var IQp=Ne(b1c,DMr);var n6i=new ge("BackgroundAgent.disableRemote"),S1c=S.Object({sessionId:Ui,agentProvider:Nl});async function T1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return DMr(t,e,r);n6i.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.disableRemote(s);return n6i.info(t,"disableRemote succeeded"),c})}a(T1c,"handleAgentDisableRemoteChecked");var i6i=Ne(S1c,T1c);p();p();var I1c=new ge("BackgroundAgent.enableRemote"),x1c=S.Object({sessionId:Ui});async function NMr(t,e,r){I1c.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>n.enableRemote(r.sessionId))}a(NMr,"handleBackgroundAgentEnableRemoteChecked");var WQp=Ne(x1c,NMr);var o6i=new ge("BackgroundAgent.enableRemote"),w1c=S.Object({sessionId:Ui,agentProvider:Nl});async function R1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return NMr(t,e,r);o6i.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.enableRemote(s);return o6i.info(t,"enableRemote succeeded"),c})}a(R1c,"handleAgentEnableRemoteChecked");var s6i=Ne(w1c,R1c);p();p();var k1c=S.Object({sessionId:Ui});async function MMr(t,e,r){let n=t.get(Us);return Ii(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(MMr,"handleBackgroundAgentGetPlanPathChecked");var pqp=Ne(k1c,MMr);var P1c=new ge("BackgroundAgent.getPlanPath"),D1c=S.Object({sessionId:Ui,agentProvider:Nl});async function N1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[c,l]=await MMr(t,e,r);return l?[null,l]:[c.path,null]}P1c.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.getPlanPath(s))}a(N1c,"handleAgentGetPlanPathChecked");var a6i=Ne(D1c,N1c);p();p();var M1c=new ge("BackgroundAgent.getRemoteStatus"),O1c=S.Object({sessionId:Ui});async function OMr(t,e,r){M1c.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(OMr,"handleBackgroundAgentGetRemoteStatusChecked");var Mqp=Ne(O1c,OMr);var B1c=new ge("BackgroundAgent.getRemoteStatus"),L1c=S.Object({sessionId:Ui,agentProvider:Nl});async function F1c(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return OMr(t,e,r);B1c.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.getRemoteStatus(s))}a(F1c,"handleAgentGetRemoteStatusChecked");var c6i=Ne(L1c,F1c);p();p();var U1c=new ge("BackgroundAgent.interaction"),Q1c=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),q1c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),j1c=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),H1c=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),G1c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),$1c=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),V1c=S.Union([S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("permission"),result:Q1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("user_input"),response:q1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("elicitation"),response:j1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:H1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("queued_command"),result:G1c}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("external_tool"),result:$1c})]);async function BMr(t,e,r){U1c.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Us);return Ii(async()=>await n.handleInteraction(r))}a(BMr,"handleBackgroundAgentInteractionChecked");var tjp=Ne(V1c,BMr);var l6i=new ge("BackgroundAgent.interaction"),W1c=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),z1c=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),Y1c=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),K1c=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),J1c=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),Z1c=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),X1c=S.Union([S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("permission"),result:W1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("user_input"),response:z1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("elicitation"),response:Y1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:K1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("queued_command"),result:J1c,agentProvider:Nl}),S.Object({sessionId:Ui,requestId:S.String(),type:S.Literal("external_tool"),result:Z1c,agentProvider:Nl})]);async function eSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return BMr(t,e,r);l6i.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.interaction(s);return l6i.info(t,"interaction succeeded"),c})}a(eSc,"handleAgentInteractionChecked");var u6i=Ne(X1c,eSc);p();p();var d6i=new ge("BackgroundAgent.listSessions"),tSc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function LMr(t,e,r){d6i.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Us);return Ii(async()=>{let o=await n.listSessions(r);return d6i.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(LMr,"handleBackgroundAgentSessionsListChecked");var bjp=Ne(tSc,LMr);var f6i=new ge("BackgroundAgent.listSessions"),rSc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:Nl});async function nSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return LMr(t,e,r);f6i.info(t,"handleAgentSessionsList called",r);let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.listSessions(s);return f6i.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(nSc,"handleAgentSessionsListChecked");var p6i=Ne(rSc,nSc);p();p();var h6i=new ge("BackgroundAgent.listModels"),iSc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function FMr(t,e,r){h6i.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Us);return Ii(async()=>{let o=await n.listModels(r.forceRefresh);return h6i.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(FMr,"handleBackgroundAgentListModelsChecked");var $jp=Ne(iSc,FMr);var m6i=new ge("BackgroundAgent.listModels"),oSc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:Nl});async function sSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return FMr(t,e,r);m6i.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.listModels(s);return m6i.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(sSc,"handleAgentListModelsChecked");var g6i=Ne(oSc,sSc);p();p();var A6i=new ge("BackgroundAgent.resume"),aSc=S.Intersect([S.Object({sessionId:Ui}),JAe]);async function UMr(t,e,r){A6i.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Us),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles};return Ii(async()=>{let s=await n.resumeSession(o);return A6i.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(UMr,"handleBackgroundAgentResumeChecked");var fHp=Ne(aSc,UMr);var y6i=new ge("BackgroundAgent.resume"),cSc=S.Intersect([S.Object({sessionId:Ui}),uvt]);async function lSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return UMr(t,e,r);y6i.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.resume(s);return y6i.info(t,"resume succeeded:",c.sessionId),c})}a(lSc,"handleAgentResumeChecked");var E6i=Ne(cSc,lSc);p();p();var uSc=S.Union([S.Literal(""),...Object.values(Ao).map(t=>S.Literal(t))]),dSc=["interactive","plan","autopilot"],fSc=S.Union(dSc.map(t=>S.Literal(t))),pSc=S.String({minLength:1}),hSc=S.Object({sessionId:Ui,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(uSc),reasoningEffort:KAe,references:S.Optional(S.Array(oO)),agentMode:S.Optional(fSc),chatMode:S.Optional(pSc),contextTier:S.Optional(DBe),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function QMr(t,e,r){let n=t.get(Us),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return Ii(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(QMr,"handleBackgroundAgentSendChecked");var OHp=Ne(hSc,QMr);var _6i=new ge("BackgroundAgent.send"),mSc=S.Union([S.Literal(""),...Object.values(Ao).map(t=>S.Literal(t))]),gSc=["interactive","plan","autopilot"],ASc=S.Union(gSc.map(t=>S.Literal(t))),ySc=S.String({minLength:1}),ESc=S.Object({sessionId:Ui,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(mSc),reasoningEffort:KAe,references:S.Optional(S.Array(oO)),agentMode:S.Optional(ASc),chatMode:S.Optional(ySc),contextTier:S.Optional(DBe),agentProvider:Nl});async function _Sc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return QMr(t,e,r);_6i.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(kc),s=r;return Ii(async()=>{let c=await o.send(s,e);return _6i.info(t,"resume succeeded:",c.messageId),c})}a(_Sc,"handleAgentSendChecked");var C6i=Ne(ESc,_Sc);p();p();var CSc=new ge("BackgroundAgent.stop"),vSc=S.Object({sessionId:Ui});async function qMr(t,e,r){CSc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Us);return Ii(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(qMr,"handleBackgroundAgentStopChecked");var iGp=Ne(vSc,qMr);var bSc=new ge("BackgroundAgent.stop"),SSc=S.Object({sessionId:Ui,agentProvider:Nl});async function TSc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await qMr(t,e,r);return c?[null,c]:[void 0,null]}bSc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(kc),s=r;return Ii(async()=>o.stop(s))}a(TSc,"handleAgentStopChecked");var v6i=Ne(SSc,TSc);p();var ISc=S.Object({});async function xSc(t,e,r){return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Ur).listAvailableTokens()},null]}a(xSc,"handleListAvailableTokensChecked");var b6i=Ne(ISc,xSc);p();var wSc=S.Object({tokenId:S.Number()});async function RSc(t,e,r){return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Ur).useExistingToken(r.tokenId),null]}a(RSc,"handleUseExistingTokenChecked");var S6i=Ne(wSc,RSc);p();var kSc=S.Object({providerName:S.String()});async function PSc(t,e,r){try{let{providerName:n}=r,o=gQ(n);if(o!==0)return[null,{code:Ke.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new bc(t.get(Si));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(PSc,"handleBYOKDeleteApiKeyChecked");var T6i=Ne(kSc,PSc);p();var DSc=S.Object({providerName:S.String(),modelId:S.String()});async function NSc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,modelId:s}=r,c=gQ(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(NSc,"handleBYOKDeleteModelChecked");var I6i=Ne(DSc,NSc);p();var MSc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())});async function OSc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,modelId:s}=r;if(!o){let l=t.get(Si),u=await l.listKeys("byok"),d=[];for(let f of u)if(f.endsWith("-api-key")){let h=await l.read("byok",f);if(h){let g=f.replace("-api-key","").split("-");if(g.length===1)d.push({providerName:g[0],apiKey:h});else if(g.length>=2){let A=g[0],y=g.slice(1).join("-");d.push({providerName:A,modelId:y,apiKey:h})}}}return[{apiKeys:d},null]}return[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(OSc,"handleBYOKListApiKeysChecked");var x6i=Ne(MSc,OSc);p();p();p();POr();var ybt=class extends Rx{static{a(this,"AnthropicProvider")}constructor(e){super(Ao.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new bc(this.ctx.get(Si)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new nB({apiKey:e,fetch:FIc(this.ctx.get(ar))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function FIc(t){return async(e,r)=>{let n=UIc(e,r),o=qIc(r),s=await t.fetch(n,o);return HIc(s)}}a(FIc,"createAnthropicFetchAdapter");function UIc(t,e){return t instanceof Request?(QIc(t,e),t.url):t instanceof URL?t.toString():t}a(UIc,"convertInputToString");function QIc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(QIc,"mergeRequestInit");function qIc(t){let e;return t?.headers&&(e=jIc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(qIc,"convertToFetchOptions");function jIc(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(jIc,"convertHeaders");async function HIc(t){let e=t.body(),r=null;if(e)r=GIc(e);else{let n=await t.text();r=VIc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(HIc,"convertToWebResponse");function GIc(t){return new ReadableStream({start(e){let r=$Ic(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(GIc,"createReadableStreamFromNodeStream");function $Ic(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a($Ic,"setupStreamHandlers");function VIc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(VIc,"createReadableStreamFromText");p();var Ebt=class extends Rx{static{a(this,"GeminiProvider")}constructor(e){super(Ao.Gemini,e)}};p();var _bt=class extends Rx{static{a(this,"GroqProvider")}constructor(e){super(Ao.Groq,e)}};p();var Cbt=class extends Rx{static{a(this,"OpenAIProvider")}constructor(e){super(Ao.OpenAI,e)}};p();var YUi=16e3,vbt=class extends Rx{static{a(this,"OpenRouterProvider")}constructor(e){super(Ao.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new bc(this.ctx.get(Si)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(ar).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data)c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:{name:l.name,maxInputTokens:Math.max(0,l.top_provider.context_length-YUi),maxOutputTokens:YUi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw OTe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var bne=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[Ao.OpenAI,new Cbt(e)],[Ao.Gemini,new Ebt(e)],[Ao.Groq,new _bt(e)],[Ao.OpenRouter,new vbt(e)],[Ao.Anthropic,new ybt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var WIc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function zIc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new bc(t.get(Si)),c=[];if(n)if(o){if(!Qce(n))return[null,{code:Ke.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:Ke.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(bne).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:A.modelCapabilities})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:d.modelCapabilities})})}else{let l=Object.values(Ao);for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:h.modelCapabilities})})}}return[{models:c},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(zIc,"handleBYOKListModelsChecked");var KUi=Ne(WIc,zIc);p();var YIc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function KIc(t,e,r){try{let n=new bc(t.get(Si)),{providerName:o,apiKey:s,modelId:c}=r,l=gQ(o);if(l===1&&!c)return[null,{code:Ke.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(KIc,"handleBYOKSaveApiKeyChecked");var JUi=Ne(YIc,KIc);p();var JIc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function ZIc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new bc(t.get(Si)),h=gQ(n);if(h===1&&!l)return[null,{code:Ke.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:Ke.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(ZIc,"handleBYOKSaveModelChecked");var ZUi=Ne(JIc,ZIc);p();var XIc=S.Object({cliPath:S.String()});async function exc(t,e,r){return[await xpe.check(r.cliPath),null]}a(exc,"handleCheckClaudeCliCompatibilityChecked");var XUi=Ne(XIc,exc);p();var txc=S.Object({uri:S.String({minLength:1})});async function rxc(t,e,r){let n=await t.get(Jn).getOrReadTextDocument(r);return[{status:zu(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(rxc,"handleCheckFileStatusChecked");var e7i=Ne(txc,rxc);p();var nxc=S.Object({});function t7i(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(t7i,"calculatePercentRemaining");function M5r(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(M5r,"buildQuotaSnapshot");async function ixc(t,e,r){let n=await t.get(Ur).resolveSession();if(!n)return[null,{code:Ke.InternalError,message:"Not signed in"}];let o=await QCe(t,n);if(o.ok){let s=await o.json();return t.get(Rd).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:M5r(s.quota_snapshots?.chat),completions:M5r(s.quota_snapshots?.completions),premiumInteractions:M5r(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:t7i(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:t7i(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:Ke.InternalError,message:"Failed to fetch quota info"}]}a(ixc,"handleCheckQuotaChecked");var r7i=Ne(nxc,ixc);p();var oxc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function sxc(t,e,r){return[await t.get(Ur).checkAndUpdateStatus(r.options),null]}a(sxc,"handleCheckStatusChecked");var n7i=Ne(oxc,sxc);p();var axc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function cxc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let o=await new zy(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return gt(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(gi(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(cxc,"handleCloudAgentAddPullRequestCommentChecked");var i7i=Ne(axc,cxc);p();var lxc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function uxc(t,e,r){try{let o=await new Nx(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:Ke.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(ht(t,"githubApi.cancelCodingAgent",jt.createAndMarkAsIssued()),gt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new zy(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),ht(t,"githubApi.cancelCodingAgent",jt.createAndMarkAsIssued()),gt(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:Ke.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(_s(t,n,"githubApi.cancelCodingAgent"),gi(t,"githubApi.cancelCodingAgent",n),n instanceof Dx)return[null,{code:Ke.NoCopilotToken,message:n.message}];if(n instanceof Yf)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(uxc,"handleCancelCodingAgentChecked");var o7i=Ne(lxc,uxc);p();var dxc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Lc))});function fxc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(fxc,"pickWorkspaceFolder");async function pxc(t,e,r){try{let n=fxc(r);if(!n)return[null,{code:Ke.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a Coding Agent job."}];let s=await new W0(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:Ke.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:Ke.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new $Q([new VQ,new WQ]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:Ke.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a Coding Agent job."}];let u=l.currentBranch,d=TYe(r.problemStatement);if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let h=await new Nx(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return gt(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(gi(t,"cloudAgent.createJob",n,{result:"error"}),_6t(n))return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];if(n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(pxc,"handleCloudAgentCreateJobChecked");var s7i=Ne(dxc,pxc);p();var hxc=S.Object({sessionId:S.String({minLength:1})});async function mxc(t,e,r){try{let o=await new Nx(t).getSessionLogs(r.sessionId,e);return gt(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(gi(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf||n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(mxc,"handleCloudAgentGetSessionLogsChecked");var a7i=Ne(hxc,mxc);p();var gxc=S.Object({pullRequestId:S.Integer()});async function Axc(t,e,r){try{let o=await new Nx(t).getAllSessions(r.pullRequestId,e);return gt(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(gi(t,"cloudAgent.listSessions",n),n instanceof Dx)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Yf||n instanceof z0)return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(Axc,"handleCloudAgentListSessionsChecked");var c7i=Ne(gxc,Axc);p();var yxc=S.Object({});async function Exc(t,e,r){return[(await Px(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(Exc,"handleConversationAgentsChecked");var l7i=Ne(yxc,Exc);p();p();var yLe=ce(Al());function _xc(t,e,r){let n=jt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return ht(t,"getCompletions.docVersionMismatch",n)}a(_xc,"telemetryVersionMismatch");async function K6(t,e,r){let o=t.get(cn).getTextDocumentUnsafe(e);if(!o)throw new yLe.ResponseError(Ke.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Bce(t,e,o.getText());if(s.status==="invalid")throw t.get(as).setClsInactive(s.reason),new yLe.ResponseError(Ke.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(_xc(t,o,e.version),ys.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new yLe.ResponseError(Ke.ContentModified,"Document Version Mismatch");return o}a(K6,"getTextDocument");async function iB(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await K6(t,n,r)}catch(o){if(o instanceof yLe.ResponseError){if(o.code===Ke.CopilotNotAvailable)return;if(o.code===Ke.InvalidParams){ys.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(iB,"getTextDocumentIfAvailable");var Cxc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),vxc=S.Object({turnId:uK,codeBlockIndex:S.Number(),source:Cxc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(XYe),textDocument:S.Optional(Rv),position:S.Optional(rg),conversationSource:S.Optional(sO)});async function bxc(t,e,r){let n=await iB(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=bQ(r.conversationSource),l=t.get(Vo).findByTurnId(r.turnId),u=await Jc(t,l,{languageId:n?.detectedLanguageId??""});return wS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${Hy(c)}.acceptedCopy`,u),["OK",null]}a(bxc,"handleConversationCodeCopyChecked");var u7i=Ne(vxc,bxc);p();var Sxc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),Txc=S.Object({turnId:uK,source:Sxc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(XYe),textDocument:S.Optional(Rv),position:S.Optional(rg),conversationSource:S.Optional(sO)});async function Ixc(t,e,r){let n=await iB(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=bQ(r.conversationSource),l=t.get(Vo).findByTurnId(r.turnId),u=await Jc(t,l,{languageId:n?.detectedLanguageId??""});return wS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` +`)[0],d=u.length-u.trimStart().length,f=d%o;if(f!==0&&d>0){let h=" ".repeat(f);return n(l,h,m=>" ".repeat((Math.floor(m/o)+1)*o))}else return l},"re");e.displayText=c(e.displayText),e.completionText=c(e.completionText)}}return e}a(dXn,"normalizeIndentCharacter");As();function fXn(t,e,r,n,o,s,c){let l=n.lineAt(o),u=e.map(d=>{let f=cu.range(cu.position(o.line,0),cu.position(o.line,o.character+d.suffixCoverage)),h="";if(s&&(d.completion=dXn(s,d.completion,l.isEmptyOrWhitespace)),l.isEmptyOrWhitespace&&(d.completion.displayNeedsWsOffset||d.completion.completionText.startsWith(l.text)))h=d.completion.completionText;else{let g=cu.range(f.start,o);h=n.getText(g)+d.completion.displayText}return{uuid:ir(),insertText:h,range:f,uri:n.uri,index:d.completion.completionIndex,telemetry:d.telemetry,displayText:d.completion.displayText,position:o,offset:n.offsetAt(o),resultType:r,copilotAnnotations:d.copilotAnnotations,clientCompletionId:d.clientCompletionId}});if(r===2&&c!==void 0){let d=u.find(f=>f.index===c);if(d){let f=u.filter(h=>h.index!==c);u=[d,...f]}}return u}a(fXn,"completionsFromGhostTextResults");p();var _2=class{constructor(){this.cache=new yn(100)}static{a(this,"SpeculativeRequestCache")}set(e,r){this.cache.set(e,r)}async request(e){let r=this.cache.get(e);r!==void 0&&(this.cache.delete(e),await r())}};var ihe=class extends jA{constructor(r){super();this.ctx=r}static{a(this,"GhostTextInlineCompletionManager")}async getInlineCompletionsResult(r,n,o={}){let s=this.ctx,c=0;o.selectedCompletionInfo?.text&&!o.selectedCompletionInfo.text.includes(")")&&(r=r.addSelectedCompletionInfo(o.selectedCompletionInfo),c=r.position.character-o.selectedCompletionInfo.range.end.character);let l=await Idr(s,r,n,o);if(l.type!=="success")return l;let[u,d]=l.value;if(n?.isCancellationRequested)return{type:"canceled",reason:"after getGhostText",telemetryData:{telemetryBlob:l.telemetryBlob}};let f=iXn(s,r.textDocument,r.position,d),h=fXn(s,u,d,r.textDocument,r.position,o.formattingOptions,f);if(h.length===0)return{type:"empty",reason:"no completions in final result",telemetryData:l.telemetryData};if(d!==2){r=r.applyEdits([{newText:h[0].insertText,range:h[0].range}]);let g={isSpeculative:!0,opportunityId:o.opportunityId},A=a(()=>Idr(s,r,void 0,g),"fn");s.get(_2).set(h[0].clientCompletionId,A)}let m=h.map(g=>{let{start:A,end:y}=g.range,E=jn.Range.create(A,jn.Position.create(y.line,y.character-c));return{...g,range:E}});return{...l,value:m}}async getPrompt(r,n,o,s={}){let c=await this.getInlineCompletionsResult(cX(r,n),o,{...s,promptOnly:!0});if(c.type!=="promptOnly")throw new Error(`Unexpected result type ${c.type}`);return c.prompt}async getCompletions(r,n,o,s={}){this.logCompletionLocation(r,n);let c=await this.getInlineCompletionsResult(cX(r,n),o,s);return xYn(this.ctx,c)}logCompletionLocation(r,n){let o=r.getText({start:{line:Math.max(n.line-1,0),character:0},end:n}),s=r.getText({start:n,end:{line:Math.min(n.line+2,r.lineCount-1),character:r.lineCount-1>n.line?0:n.character}});jat.debug(this.ctx,`Requesting for ${r.uri} at ${n.line}:${n.character}`,`between ${JSON.stringify(o)} and ${JSON.stringify(s)}.`)}triggerSpeculativeRequests(r){return this.ctx.get(_2).request(r.clientCompletionId)}};var A8i=fe(VNr()),y8i=fe(u0t()),E8i=fe(nX()),fBe=fe(_c()),ZNr=fe(Io());var WNr=class extends ZNr.Disposable{constructor(r){super();this.ctx=r;this.isMinimalMode=!0;this.permissiveGitHubSession=void 0;this.hasCopilotTokenSource=!0;this._tokenChangedEverFired=!1;this._onDidAuthenticationChange=this._register(new fBe.Emitter);this.onDidAuthenticationChange=this._onDidAuthenticationChange.event;this._onDidAccessTokenChange=this._register(new fBe.Emitter);this.onDidAccessTokenChange=this._onDidAccessTokenChange.event;this._onDidAdoAuthenticationChange=this._register(new fBe.Emitter);this.onDidAdoAuthenticationChange=this._onDidAdoAuthenticationChange.event;this.anyGitHubSession=void 0;this._register(ys(r,()=>{this.fireTokenChanged()}))}static{a(this,"AuthServiceAdapter")}fireTokenChanged(){this._tokenChangedEverFired=!0,this._onDidAccessTokenChange.fire(),this._onDidAuthenticationChange.fire()}ensureTokenChangedFired(){this._tokenChangedEverFired||this.fireTokenChanged()}async getAnyGitHubSession(r){let n=await this.ctx.get(Fr).resolveSession();if(n!==void 0)return{id:n.login,accessToken:n.accessToken,account:{id:n.login,label:n.serverUrl},scopes:[]}}async getGitHubSession(r,n){if(r!=="permissive")return this.getAnyGitHubSession(n)}getPermissiveGitHubSession(r){return Promise.resolve(void 0)}get copilotToken(){let r=this.ctx.get(Ut).getLastToken();if(r!==void 0)return this.ensureTokenChangedFired(),Qvt(r,this.ctx)}async getCopilotToken(r){let n=this.ctx.get(Ut);r&&n.resetToken("inline_completion_force_refresh");let o=await n.getToken();this.ensureTokenChangedFired();let s=await this.ctx.get(Fr).resolveSession();return Qvt(o,this.ctx,s?.login)}resetCopilotToken(r){this.ctx.get(Ut).resetToken("inline_completion",r)}getAdoAccessTokenBase64(r){return Promise.resolve(void 0)}};function Qvt(t,e,r){let n=t.envelope.refresh_in??Math.max(0,t.expiresAt-Math.floor(Date.now()/1e3));return new y8i.CopilotToken({token:t.envelope.token,expires_at:t.envelope.expires_at,refresh_in:n,organization_list:t.envelope.organization_list,code_quote_enabled:t.envelope.code_quote_enabled??!1,copilotignore_enabled:t.envelope.copilotignore_enabled??!1,endpoints:t.envelope.endpoints,limited_user_quotas:t.envelope.limited_user_quotas,enterprise_list:t.envelope.enterprise_list?t.envelope.enterprise_list.map(Number):void 0,sku:t.getTokenValue("sku")??"",individual:t.userInfo.isIndividualUser,blackbird_clientside_indexing:!1,code_review_enabled:t.isCopilotCodeReviewEnabled,codesearch:t.envelope.codesearch??!1,public_suggestions:"unconfigured",telemetry:e.get(Hf).isEnabled?"enabled":"disabled",username:r??"",isVscodeTeamMember:!1,copilot_plan:t.userInfo.copilotPlan,organization_login_list:t.userInfo.raw?.organization_login_list??[]})}a(Qvt,"asChatLibCopilotToken");var zNr=class extends ZNr.Disposable{constructor(r){super();this.ctx=r;this._onDidModelsRefresh=this._register(new fBe.Emitter);this.onDidModelsRefresh=this._onDidModelsRefresh.event;this._register(ys(r,()=>{this.models=void 0}))}static{a(this,"EndpointProviderAdapter")}async getAllModels(r=!1){if(this.models===void 0||r)try{let n=this.ctx.get(fx),o=await this.ctx.get(Ut).getToken();this.models=await n.fetchModels(o)??[],this._onDidModelsRefresh.fire()}catch(n){La(this.ctx,n,"AvailableModelsManager.fetchModels"),this.models=[]}return this.models}async getAllCompletionModels(r){return(await this.getAllModels(r)).filter(o=>o.capabilities.type==="completion")}getAllChatEndpoints(){throw new Error("getAllChatEndpoints is not supported.")}getChatEndpoint(r){throw new Error("getChatEndpoint is not supported.")}getEmbeddingsEndpoint(r){throw new Error("getEmbeddingsEndpoint is not supported.")}},YNr=class{constructor(e){this.ctx=e}static{a(this,"IgnoreServiceAdapter")}get isEnabled(){return this.ctx.get(ec).enabled}get isRegexExclusionsEnabled(){return!0}dispose(){}init(){return Promise.resolve()}async isCopilotIgnored(e,r){let n=e.toString();return(await this.ctx.get(an).getTextDocumentValidation({uri:n})).status==="invalid"}asMinimatchPattern(){return Promise.resolve(void 0)}},KNr=class{constructor(e){this.statusReporter=e}static{a(this,"StatusHandlerAdapter")}didChange(e){switch(this.statusReporter.didChangeV1(e),e.kind){case"Inactive":{this.statusReporter.forceNormalV2("cls",{message:e.message??"",inactive:!0});break}case"Error":{this.statusReporter.setErrorV2("cls",{message:e.message??""});break}case"Warning":{this.statusReporter.setWarningV2("cls",{message:e.message??""});break}case"Normal":{this.statusReporter.forceNormalV2("cls",{inactive:!1});break}}}},JNr=class extends jA{constructor(r){super();this.ctx=r;this._telemetrySender=new pBe(this.ctx)}static{a(this,"ChatLibInlineCompletionManager")}get completionProvider(){return this._completionProvider||(this._completionProvider=this.createCompletionProvider()),this._completionProvider}createCompletionProvider(){let r=this.ctx,n=r.get(o0).matchFunction,o=new mBe(this.ctx.get(cr)),s=tce(r),c={fetcher:o,authService:new WNr(r),telemetrySender:this._telemetrySender,logTarget:new hBe(r),isRunningInTest:m1(r),contextProviderMatch:a(async(u,d)=>await n(r,u,d),"contextProviderMatch"),languageContextProvider:void 0,statusHandler:new KNr(r.get(ss)),documentManager:r.get(an),workspace:r.get(E8i.ObservableWorkspace),urlOpener:r.get(M0),editorInfo:r.get(Nr).getEditorInfo(),editorPluginInfo:r.get(Nr).getEditorPluginInfo(),relatedPluginInfo:r.get(Nr).getRelatedPluginInfo(),editorSession:r.get(Oa),notificationSender:r.get(Hs),ignoreService:new YNr(r),waitForTreatmentVariables:!1,endpointProvider:new zNr(r),capiClientService:void 0,citationHandler:void 0,configOverrides:s},l=(0,A8i.createInlineCompletionsProvider)(c);return this.ctx.get(Yo).onDidChangeCopilotSettings(()=>{let u=tce(this.ctx);l.setConfigs(u).catch(d=>{La(this.ctx,d,"inlineCompletionsProvider.setConfigs")})}),l}async getCompletions(r,n,o,s={}){let c=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return this._telemetrySender.updateExpConfig(c.filtersAndExp.exp),this.completionProvider.updateTreatmentVariables(c.filtersAndExp.exp.variables),this.asLocalResult(await this.completionProvider.getInlineCompletions(r,n,o,s),c)}asLocalResult(r,n){if(r!==void 0)return r.map(o=>({uuid:o.uuid,insertText:o.insertText,range:o.range,uri:o.uri,telemetry:new RI({"abexp.assignmentcontext":n.filtersAndExp.exp.assignmentContext,...o.telemetry.properties},o.telemetry.measurements,o.telemetry.issuedTime,{filters:new AB(o.telemetry.filtersAndExp.filters.toHeaders()),exp:new qv(o.telemetry.filtersAndExp.exp.variables,n.filtersAndExp.exp.assignmentContext,o.telemetry.filtersAndExp.exp.features)}),displayText:o.displayText,position:o.position,offset:o.offset,index:o.index,resultType:o.resultType,copilotAnnotations:o.copilotAnnotations,clientCompletionId:o.clientCompletionId}))}triggerSpeculativeRequests(r){return this.completionProvider.inlineCompletionShown(r.clientCompletionId)}},qvt=class extends jA{constructor(r){super();this.ctx=r}static{a(this,"ConfigurableInlineCompletionManager")}get ghostTextImpl(){return this._ghostTextImpl||(this._ghostTextImpl=new ihe(this.ctx)),this._ghostTextImpl}get chatLibImpl(){return this._chatLibImpl||(this._chatLibImpl=new JNr(this.ctx)),this._chatLibImpl}async isChatLibEnabled(){let r=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();return Ht(this.ctx,Je.UseChatLibCompletions)??this.ctx.get(Jt).useChatLibCompletions(r)}async getCompletions(r,n,o,s={}){return await this.isChatLibEnabled()?this.chatLibImpl.getCompletions(r,n,o,s):this.ghostTextImpl.getCompletions(r,n,o,s)}async triggerSpeculativeRequests(r){return await this.isChatLibEnabled()?this.chatLibImpl.triggerSpeculativeRequests(r):this.ghostTextImpl.triggerSpeculativeRequests(r)}},pBe=class{constructor(e){this.ctx=e;this.ctx=e}static{a(this,"TelemetrySender")}updateExpConfig(e){this._expConfig=e}sendTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),loe(this.ctx,e,o.properties,o.measurements,0),_t(this.ctx,e,C9(o.properties,y2e),o.measurements)}sendEnhancedTelemetryEvent(e,r,n){let o=this.asTelemetryData(r,n);o.extendWithCoreEditorAgnosticFields(this.ctx),loe(this.ctx,e,o.properties,o.measurements,1)}asTelemetryData(e,r){let n=Object.fromEntries(Object.entries(e??{}).filter(([s,c])=>c!==void 0)),o=Object.fromEntries(Object.entries(r??{}).filter(([s,c])=>c!==void 0));return n["abexp.assignmentcontext"]===void 0&&this._expConfig?.assignmentContext!==void 0&&(n["abexp.assignmentcontext"]=this._expConfig.assignmentContext),n.completionsImplementation="chat-lib",Vt.createAndMarkAsIssued(n,o)}};p();var _8i=fe(OG()),v8i=fe(_c()),gBe=fe(C1r()),C8i=fe(y4());var iCc=16,w6=class extends _8i.AbstractLanguageDiagnosticsService{constructor(){super(...arguments);this._map=new yn(iCc);this._onDidChangeDiagnostics=new v8i.Emitter;this.onDidChangeDiagnostics=this._onDidChangeDiagnostics.event}static{a(this,"LspLanguageDiagnosticsService")}getDiagnostics(r){return this._map.get(r.toString())?.diagnostics??[]}getAllDiagnostics(){return Array.from(this._map.values()).map(r=>[r.uri,r.diagnostics])}setForRequest(r,n){let o=n.map(oCc);this._map.set(r.toString(),{uri:r,diagnostics:o}),this._onDidChangeDiagnostics.fire({uris:[r]})}clear(r){this._map.delete(r.toString())&&this._onDidChangeDiagnostics.fire({uris:[r]})}clearAll(){let r=Array.from(this._map.values()).map(n=>n.uri);this._map.clear(),r.length>0&&this._onDidChangeDiagnostics.fire({uris:r})}};function oCc(t){let e=new C8i.Range(t.range.start.line,t.range.start.character,t.range.end.line,t.range.end.character),r=t.severity==="error"?gBe.DiagnosticSeverity.Error:gBe.DiagnosticSeverity.Warning,n=new gBe.Diagnostic(e,t.message,r);return t.code!==void 0&&(n.code=t.code),t.source!==void 0&&(n.source=t.source),n}a(oCc,"toVscodeDiagnostic");p();var BAe=fe(Bre()),b8i=fe(xD()),XNr=fe(ilt()),Gvt=fe(nX()),S8i=fe(bs()),T8i=fe(m2()),ABe=fe(hE()),Hvt=fe(T_()),eMr=fe(sd()),I8i=fe(AT()),x8i=fe(ei());p();var jvt=class{constructor(e){this.ctx=e;this._onDidOpenTextDocument=new no;this._onDidChangeTextDocument=new no;this._onDidCloseTextDocument=new no;this._onDidSelectTextDocument=new no;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidChangeTextDocument=this._onDidChangeTextDocument.event;this.onDidCloseTextDocument=this._onDidCloseTextDocument.event;this.onDidSelectTextDocument=this._onDidSelectTextDocument.event;this.bufferedEvents=[];this.forwardedAsOpen=new Set;this.started=!1;this.documentManager=this.ctx.get(an)}static{a(this,"DocumentChangeFilter")}start(){if(!this.started){this.started=!0;for(let e of this.documentManager.getTextDocumentsUnsafe())this.bufferedEvents.push({type:"addition",event:{document:{uri:e.uri,languageId:e.clientLanguageId,version:e.version,text:e.getText()}}});this.documentManager.onDidOpenTextDocument(e=>{this.bufferedEvents.push({type:"addition",event:e})}),this.documentManager.onDidChangeTextDocument(e=>{this.bufferedEvents.push({type:"change",event:e})}),this.documentManager.onDidCloseTextDocument(e=>{this.bufferedEvents.push({type:"removal",event:e})})}}addSelectionEvent(e){this.bufferedEvents.push({type:"selection",event:e})}async syncSafeDocuments(){let e=[...this.bufferedEvents];this.bufferedEvents.length=0;for(let r of e){let n=r.type==="selection"?r.event.uri:r.event.document.uri;if(r.type==="removal"){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire(r.event));continue}let o=await this.documentManager.getTextDocument({uri:n});if(o===void 0){this.forwardedAsOpen.has(n)&&(this.forwardedAsOpen.delete(n),this._onDidCloseTextDocument.fire({document:{uri:n}}));continue}r.type==="addition"?(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire(r.event)):r.type==="change"?this.forwardedAsOpen.has(n)?this._onDidChangeTextDocument.fire(r.event):(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})):r.type==="selection"&&(this.forwardedAsOpen.has(n)||(this.forwardedAsOpen.add(n),this._onDidOpenTextDocument.fire({document:{uri:o.clientUri,languageId:o.clientLanguageId,version:o.version,text:o.getText()}})),this._onDidSelectTextDocument.fire(r.event))}}};var LAe=class extends Gvt.ObservableWorkspace{constructor(r,n,o){super();this._openDocuments=(0,T8i.observableValue)(this,[]);this.openDocuments=this._openDocuments;this._documents=new Map;this.ctx=r,n&&(this.documentChangeFilter=new jvt(r)),this._started=!1,o||this.start()}static{a(this,"ObservableLspWorkspace")}start(){if(this._started)return;this._started=!0;let r=this.ctx.get(an);if(this.documentChangeFilter)this.documentChangeFilter.start();else for(let o of r.getTextDocumentsUnsafe())this.addLspDocument(o.uri,o.clientLanguageId,o.getText());let n=this.documentChangeFilter??r;n.onDidOpenTextDocument(o=>{this.addLspDocument(o.document.uri,o.document.languageId,o.document.text)}),n.onDidCloseTextDocument(o=>{this.removeClosedLspDocument(o.document.uri)}),n.onDidChangeTextDocument(o=>{this.onDidChangeLspDocument(o.document.uri,o.contentChanges)}),this.documentChangeFilter?.onDidSelectTextDocument(o=>{let s=BAe.DocumentId.create(ia(o.uri)),c=this._documents.get(s);c&&c.updateSelectionFromLspPosition(o.position)})}addLspDocument(r,n,o){let s=BAe.DocumentId.create(ia(ia(r)));return this.addDocument({id:s,initialValue:o,languageId:XNr.LanguageId.create(n)},void 0)}onDidChangeLspDocument(r,n){let o=BAe.DocumentId.create(ia(ia(r))),s=this._documents.get(o);s&&s.applyLspContentChanges(n)}onUserPositionChange(r,n){if(this.documentChangeFilter)this.documentChangeFilter.addSelectionEvent({uri:r,position:n});else{let o=BAe.DocumentId.create(ia(r)),s=this._documents.get(o);s&&s.updateSelectionFromLspPosition(n)}}removeClosedLspDocument(r){let n=BAe.DocumentId.create(ia(r));this._documents.get(n)?.dispose()}addDocument(r,n=void 0){let o=this._documents.get(r.id);if(o)return o;let s=new tMr(r.id,new I8i.StringText(r.initialValue??""),[],r.languageId??XNr.LanguageId.PlainText,()=>{this._documents.delete(r.id);let c=this._openDocuments.get(),l=c.filter(u=>u.id!==s.id);l.length!==c.length&&this._openDocuments.set(l,n,{added:[],removed:[s]})},r.workspaceRoot);return this._documents.set(r.id,s),this._openDocuments.set([...this._openDocuments.get(),s],n,{added:[s],removed:[]}),s}getDocument(r){return this._documents.get(r)}clear(){this._openDocuments.set([],void 0,{added:[],removed:this._openDocuments.get()});for(let r of this._documents.values())r.dispose();this._documents.clear()}getWorkspaceRoot(r){return this._documents.get(r)?.workspaceRoot}async syncSafeDocuments(){this.start(),await this.documentChangeFilter?.syncSafeDocuments()}},tMr=class extends Gvt.MutableObservableDocument{static{a(this,"MutableObservableLspDocument")}constructor(e,r,n,o,s,c){super(e,r,n,o,s,0,c)}applyLspContentChanges(e){let r=this.editFromLspContentChanges(e);this.applyEdit(r.compose(),void 0)}updateSelectionFromLspPosition(e){let r=this.value.get().getTransformer().getOffset(new Hvt.Position(e.lineNumber+1,e.column+1));this.updateSelection([new eMr.OffsetRange(r,r)])}editFromLspContentChanges(e){return new b8i.Edits(ABe.StringEdit,e.map((n,o)=>this.editFromLspContentChange(n,o)))}editFromLspContentChange(e,r){if(x8i.TextDocumentContentChangeEvent.isIncremental(e)){let n=this.value.get().getTransformer(),o=n.getOffset(new Hvt.Position(e.range.start.line+1,e.range.start.character+1)),s=n.getOffset(new Hvt.Position(e.range.end.line+1,e.range.end.character+1));if(o>s){let c=this.value.get().value,l=c.split(/\r\n|\n/).length,u=c.split(/\r\n|\r|\n/).length,d=new S8i.BugIndicatingError(`Invalid range: [${o}, ${s}) from ${JSON.stringify(e.range)}. Line counts: nes=${l}, lsp=${u}`);throw lu?d.code="ObservableWorkspace_TooManyLines":d.code="ObservableWorkspace_InvalidRange",d.code+=r>0?"_SubsequentChange":"_FirstChange",d}return ABe.StringEdit.single(new ABe.StringReplacement(new eMr.OffsetRange(o,s),e.text))}throw new Error("Full replacement edits are not supported")}};var R6=fe(VNr()),R8i=fe(Bre()),rMr=fe(nX()),P8i=fe(iy()),k8i=fe(B_t()),D8i=fe(_c()),nMr=require("node:stream");As();var w8i=10,sCc={[R6.LogLevel.Off]:4,[R6.LogLevel.Trace]:4,[R6.LogLevel.Debug]:4,[R6.LogLevel.Info]:3,[R6.LogLevel.Warning]:2,[R6.LogLevel.Error]:1},hBe=class{constructor(e){this.ctx=e}static{a(this,"ForwardingLogTarget")}logIt(e,r,...n){this.ctx.get(Nf).logIt(this.ctx,sCc[e],r,...n)}},Rv=class{constructor(e){this.lastResultsById=new yn(w8i);this.lastResultsByUri=new yn(w8i);this.ctx=e,this.telemetrySender=new pBe(this.ctx)}static{a(this,"NextEditSuggestionsManager")}async handleNextEditRequest(e,r,n){let o=await(this.nextEditProvider??=this.createNextEditProvider()),s=this.ctx.get(rMr.ObservableWorkspace);if(s instanceof LAe&&await s.syncSafeDocuments(),!this.shouldUseExplicitRejection()){let y=this.lastResultsByUri.get(e);y&&(this.lastResultsByUri.delete(e),this.lastResultsById.delete(y.resultId),y.isShown&&o.handleRejection(y.nextEditResult))}let c=R8i.DocumentId.create(ia(e)),l=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments();o.updateTreatmentVariables(l.filtersAndExp.exp.variables),this.telemetrySender.updateExpConfig(l.filtersAndExp.exp);let u=await o.getNextEdit(c.toUri(),n);if(u.result==null)return;let d=await this.ctx.get(an).getTextDocument({uri:e});if(!d)return;let f=d.positionAt(u.result.range.start),h=d.positionAt(u.result.range.endExclusive),m=ir(),g={resultId:m,nextEditResult:u,documentId:c,isShown:!1};return this.lastResultsById.set(m,g),this.lastResultsByUri.set(e,g),[{edit:{text:u.result.newText,range:{start:f,end:h},textDocument:{uri:e,version:r}},id:m}]}async handleAcceptance(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(this.lastResultsByUri.delete(n.documentId.uri),this.lastResultsById.delete(n.resultId),await r.handleAcceptance(n.nextEditResult))}async handleRejection(e,r){await this.doHandleDismiss(e,!0,r)}async handleIgnored(e){await this.doHandleDismiss(e,!1)}async doHandleDismiss(e,r,n){let o=await this.nextEditProvider,s=this.lastResultsById.get(e);!o||!s||(this.lastResultsByUri.delete(s.documentId.uri),this.lastResultsById.delete(s.resultId),s.isShown&&(r?(n&&aCc(this.ctx,s.nextEditResult,n),o.handleRejection(s.nextEditResult)):o.handleIgnored(s.nextEditResult,void 0)))}async handleShown(e){let r=await this.nextEditProvider,n=this.lastResultsById.get(e);!r||!n||(n.isShown=!0,r.handleShown(n.nextEditResult))}async createNextEditProvider(){let e=this.ctx.get(rMr.ObservableWorkspace),r=new mBe(this.ctx.get(cr)),n=new iMr(this.ctx),o=tce(this.ctx),s=await(0,R6.createNESProvider)({configOverrides:o,workspace:e,fetcher:r,copilotTokenManager:n,terminalService:k8i.NullTerminalService.Instance,telemetrySender:this.telemetrySender,logTarget:new hBe(this.ctx),languageDiagnosticsService:this.ctx.get(w6)});return this.ctx.get(Yo).onDidChangeCopilotSettings(()=>{let c=tce(this.ctx);s.setConfigs(c).catch(l=>{La(this.ctx,l,"nesProvider.setConfigs")})}),s}shouldUseExplicitRejection(){return Ht(this.ctx,Je.NESUseExplicitRejection)}};function aCc(t,e,r){let n=e;try{n.telemetryBuilder?.setDisposalReason?.(r)}catch(o){La(t,o,"nesProvider.setDisposalReason")}}a(aCc,"trySetChatLibDisposalReason");var iMr=class{constructor(e){this._ctx=e;this.didChangeTokenResult=new D8i.Emitter;this.onDidCopilotTokenRefresh=this.didChangeTokenResult.event;this._ctx.get(Ut).onDidChangeTokenResult(()=>{this.didChangeTokenResult.fire()})}static{a(this,"CopilotTokenManagerAdapter")}async getCopilotToken(e){let r=this._ctx.get(Ut);e&&r.resetToken("nes_force_refresh");let n=await r.getToken(),o=await this._ctx.get(Fr).resolveSession();return Qvt(n,this._ctx,o?.login)}resetCopilotToken(e){this._ctx.get(Ut).resetToken("nes",e)}},mBe=class{constructor(e){this._delegate=e}static{a(this,"FetcherAdapter")}getUserAgentLibrary(){return this._delegate.name}async fetch(e,r){let n={headers:r.headers,body:r.body,timeout:r.timeout,json:r.json,method:r.method,signal:r.signal},o=await this._delegate.fetch(e,n),s=o.body(),c=null;return s&&(s instanceof nMr.Readable?c=nMr.Readable.toWeb(s):c=s),new P8i.Response(o.status,o.statusText,o.headers,c,this.fetcherId(),()=>{},ir(),new URL(e).hostname)}fetcherId(){switch(this._delegate.name){case"EditorFetcher":case"ElectronFetcher":return"electron-fetch";case"FetchFetcher":case"NodeFetchFetcher":return"node-fetch";case"FakeFetcher":return"test-stub";default:return"helix-fetch"}}async disconnectAll(){return this._delegate.disconnectAll()}makeAbortController(){return new AbortController}isAbortError(e){return e&&e.name==="AbortError"}isInternetDisconnectedError(e){return!1}isFetcherError(e){return kI(e)}isNetworkProcessCrashedError(e){return!1}getUserMessageForFetcherError(e){return`Fetcher error: ${e.message}`}async fetchWithPagination(e,r){let n=[],o=r.pageSize??20,s=r.startPage??1,c=!1;do{let l=r.buildUrl(e,o,s),u=await this.fetch(l,r);if(!u.ok)return n;let d=await u.json(),f=r.getItemsFromResponse(d);n.push(...f),c=f.length===o,s++}while(c);return n}};var cCc="github.copilot.didAcceptNextEditSuggestionItem",oMr=class extends Fw{constructor(){super(...arguments);this.name=cCc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptCommand")}async handle(r,[n]){return await this.ctx.get(Rv).handleAcceptance(n),!0}},lCc="github.copilot.didRejectNextEditSuggestionItem",sMr=class extends Fw{constructor(){super(...arguments);this.name=lCc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidRejectCommand")}async handle(r,[n]){return await this.ctx.get(Rv).handleRejection(n),!0}},uCc="github.copilot.didIgnoreNextEditSuggestionItem",aMr=class extends Fw{constructor(){super(...arguments);this.name=uCc;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidIgnoreCommand")}async handle(r,[n]){return await this.ctx.get(Rv).handleIgnored(n),!0}},N8i=[oMr,sMr,aMr];p();var lMr="github.copilot.didAcceptPanelCompletionItem",cMr=class extends Fw{constructor(){super(...arguments);this.name=lMr;this.arguments=S.Tuple([S.String({minLength:1})])}static{a(this,"DidAcceptPanelCompletionItemCommand")}handle(r,n){let[o]=n,c=this.ctx.get(vu).get(o);return c?(K2e(this.ctx,c.triggerCategory,c.displayText,c.offset,c.uri,c.telemetry,{compType:"full",acceptedLength:c.displayText.length,acceptedLines:eH(c.displayText)},c.copilotAnnotations),!0):!1}},M8i=[cMr];var dCc=[...lXn,...uXn,...N8i,...M8i];function O8i(t,e){let r=new Map;for(let n of dCc){let o=new n(t),s=Mu.Compile(o.arguments);r.set(o.name,{typeCheck:s,command:o})}return e.onExecuteCommand((n,o)=>{let s=r.get(n.command);if(!s)throw new Error(`Unknown command: ${n.command}`);let c=P6(n.arguments??[]);if(c.length0}async markInstalled(e){let r=e.get(Nr).getEditorPluginInfo();await e.get(yi).update("versions",r.name,r.version)}wasPreviouslyInstalled(e){return Promise.resolve(!1)}async isNewUpgrade(e){try{let r=e.get(Nr).getEditorPluginInfo(),n=await e.get(yi).read("versions",r.name);return n===void 0&&await this.hasPersistedSettings(e)?!0:(0,yBe.gt)((0,yBe.coerce)(r.version),(0,yBe.coerce)(n))}catch{return!1}}async markUpgraded(e){await this.markInstalled(e)}async uninstall(e){await super.uninstall(e);let r=e.get(Nr).getEditorPluginInfo();await e.get(yi).delete("versions",r.name),(await e.get(yi).listKeys("versions")).length===0&&await e.get(yi).deleteSetting("versions")}};p();var Q8i=fe(zc()),q8i=require("crypto"),Yvt=fe(require("path")),UAe=fe(Al());var hCc={watchedFiles:[],contentRestrictedFiles:[],unknownFileExtensions:[]},mCc=new UAe.ProgressType,$D=class t{constructor(e){this.ctx=e;this.#e=new no;this._changeHandlerLimiter=new Q8i.Limiter(1);this.onDidChangeWatchedFiles=this.#e.event}static{a(this,"LspFileWatcher")}#e;static{this.requestType=new UAe.ProtocolRequestType("copilot/watchedFiles")}get connection(){return this.ctx.get(dr).connection}init(){this.ctx.get(On).getCapabilities().watchedFiles&&this.connection.onNotification(UAe.DidChangeWatchedFilesNotification.type,r=>{if("workspaceUri"in r&&typeof r.workspaceUri=="string"){let n=r;this._changeHandlerLimiter.queue(()=>this.didChangeWatchedFilesHandler(n))}})}async getWatchedFiles(e){if(!this.ctx.get(On).getCapabilities().watchedFiles)return hCc;let n=await this.fetchWatchedFileEntries(e);return this.buildWatchedFilesResponse(n)}async getWatchedFileUris(e){if(!this.ctx.get(On).getCapabilities().watchedFiles)return[];let n=await this.fetchWatchedFileEntries(e),o=[],s=new Set;for(let c of n){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=Yvt.extname(l).toLowerCase();Z7.includes(u)&&o.push({uri:l})}return o}async didChangeWatchedFilesHandler(e){let r=[],n=[],o=[];for(let s of e.changes){let c=s.uri,l={uri:c,isRestricted:!1,isUnknownFileExtension:!1},u=Yvt.extname(s.uri).toLowerCase();if(!Z7.includes(u))l.isUnknownFileExtension=!0;else{let d=await this.resolveWatchedDocument(c);d===void 0?l.isRestricted=!0:l.document=d}switch(s.type){case 1:n.push(l);break;case 2:r.push(l);break;case 3:o.push(l);break}}this.#e.fire({workspaceFolder:{uri:e.workspaceUri},created:n,changed:r,deleted:o})}async resolveWatchedDocument(e){return this.ctx.get(ec).enabled?this.getValidDocument(e):gS.create(e,"UNKNOWN",-1,"")}async getValidDocument(e){let n=await this.ctx.get(ri).getOrReadTextDocument({uri:e});return n.status==="valid"?n.document:void 0}async fetchWatchedFileEntries(e){let r=e.partialResultToken??(0,q8i.randomUUID)(),n=[],o=this.connection.onProgress(mCc,r,s=>{s?.files?.length&&n.push(...s.files)});try{let s=await this.connection.sendRequest(t.requestType,{...e,partialResultToken:r});Array.isArray(s.files)&&n.push(...s.files)}finally{o.dispose()}return n}async buildWatchedFilesResponse(e){let r=[],n=[],o=[],s=new Set;for(let c of e){let l=typeof c=="string"?c:c?.uri;if(!l||s.has(l))continue;s.add(l);let u=Yvt.extname(l).toLowerCase();if(!Z7.includes(u)){o.push({uri:l});continue}let d=await this.getValidDocument(l);if(d===void 0){n.push({uri:l});continue}r.push(d)}return{watchedFiles:r,contentRestrictedFiles:n,unknownFileExtensions:o}}};p();p();p();var j8i=new Ae("AgentRouter"),H8i="AgentRouter";function YT(t){return t.agentProvider??"BACKGROUND"}a(YT,"resolveProvider");var wc=class{constructor(e){this.ctx=e}static{a(this,"AgentRouter")}serviceFor(e){switch(e){case"BACKGROUND":return this.ctx.get(Ls);case"CLAUDE":return this.ctx.get(DF)}}logDispatch(e,r){j8i.debug(this.ctx,`${H8i}.${e}`,r)}create(e){this.logDispatch("create",e);let r=YT(e);return this.serviceFor(r).createSession(e)}resume(e){this.logDispatch("resume",e);let r=YT(e);return this.serviceFor(r).resumeSession(e)}send(e,r){this.logDispatch("send",e);let n=YT(e);return this.serviceFor(n).sendMessage(e,r)}stop(e){this.logDispatch("stop",e);let r=YT(e);return this.serviceFor(r).stopSession(e.sessionId)}destroy(e){this.logDispatch("destroy",e);let r=YT(e);return this.serviceFor(r).destroySession(e)}listSessions(e){this.logDispatch("listSessions",e);let r=YT(e);return this.serviceFor(r).listSessions(e)}listModels(e){this.logDispatch("listModels",e);let r=YT(e);return this.serviceFor(r).listModels(e.forceRefresh)}interaction(e){this.logDispatch("interaction",e);let r=YT(e);return this.serviceFor(r).handleInteraction(e)}getPlanPath(e){this.logDispatch("getPlanPath",e);let r=YT(e);return this.serviceFor(r).getPlanPath(e.sessionId)}enableRemote(e){this.logDispatch("enableRemote",e);let r=YT(e);return this.serviceFor(r).enableRemote(e.sessionId)}async disableRemote(e){this.logDispatch("disableRemote",e);let r=YT(e);return await this.serviceFor(r).disableRemote(e.sessionId),{success:!0}}getRemoteStatus(e){this.logDispatch("getRemoteStatus",e);let r=YT(e);try{return Promise.resolve(this.serviceFor(r).getRemoteStatus(e.sessionId))}catch(n){return Promise.reject(n instanceof Error?n:new Error(String(n)))}}async compactHistory(e,r){this.logDispatch("compactHistory",e);let n=YT(e),o=this.serviceFor(n),s=r?.onCancellationRequested(()=>{j8i.info(this.ctx,`${H8i}.compactHistory: cancellation requested, aborting compaction`,{sessionId:e.sessionId}),o.stopCompactHistory(e.sessionId)});try{return await o.compactHistory(e.sessionId)}finally{s?.dispose()}}};p();p();var gCc=S.Union([S.String(),S.Number()]),Fi=S.String(),QAe=S.Optional(S.String()),ACc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),parameters:S.Optional(S.Record(S.String(),S.Unknown())),overridesBuiltInTool:S.Optional(S.Boolean()),skipPermission:S.Optional(S.Boolean())}),uMr=S.Array(ACc),EBe=S.Union([S.Literal("default"),S.Literal("long_context")]),qAe=S.Object({model:S.Optional(S.String()),reasoningEffort:QAe,workspaceFolder:S.Object({uri:S.String(),name:S.Optional(S.String())}),globalAgentsMdInstructions:S.Optional(S.String()),globalClaudeMdInstructions:S.Optional(S.String()),externalToolDefinitions:S.Optional(uMr),useAgentsMdFile:S.Optional(S.Boolean()),useNestedAgentsMdFiles:S.Optional(S.Boolean()),useClaudeMdFile:S.Optional(S.Boolean()),useNestedClaudeMdFiles:S.Optional(S.Boolean()),inlineConfinedFile:S.Optional(S.String())});async function Ti(t){try{return[await t(),null]}catch(e){let r=e instanceof Error?e.message:String(e),n=e instanceof QZ?e.data:void 0;return[null,{code:it.InternalError,message:r,...n!==void 0?{data:n}:{}}]}}a(Ti,"withServiceErrorHandling");var G8i=new Ae("BackgroundAgent.compactHistory"),yCc=S.Object({sessionId:Fi});async function dMr(t,e,r){G8i.info(t,"handleBackgroundAgentCompactHistory called",{sessionId:r.sessionId});let n=t.get(Ls),o=e.onCancellationRequested(()=>{G8i.info(t,"handleBackgroundAgentCompactHistory: cancellation requested, aborting compaction",{sessionId:r.sessionId}),n.stopCompactHistory(r.sessionId)});try{return await Ti(async()=>n.compactHistory(r.sessionId))}finally{o.dispose()}}a(dMr,"handleBackgroundAgentCompactHistoryChecked");var EUp=je(yCc,dMr);p();var ECc=S.Union(Object.values(n0).map(t=>S.Literal(t))),kl=S.Optional(ECc),Kvt=S.Intersect([qAe,S.Object({agentProvider:kl})]);var $8i=new Ae("BackgroundAgent.compactHistory"),_Cc=S.Object({sessionId:Fi,agentProvider:kl});async function vCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return dMr(t,e,r);$8i.info(t,"handleAgentCompactHistory called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.compactHistory(s,e);return $8i.info(t,"compactHistory succeeded"),c})}a(vCc,"handleAgentCompactHistoryChecked");var V8i=je(_Cc,vCc);p();p();var W8i=new Ae("BackgroundAgent.create"),CCc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),qAe]);async function fMr(t,e,r){W8i.info(t,"handleBackgroundAgentCreate called",{model:r.model,workspaceFolder:r.workspaceFolder});let n=t.get(Ls),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles,inlineConfinedFile:r.inlineConfinedFile};return Ti(async()=>{let s=await n.createSession(o);return W8i.info(t,"createSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath}})}a(fMr,"handleBackgroundAgentCreateChecked");var WUp=je(CCc,fMr);var z8i=new Ae("BackgroundAgent.create"),bCc=S.Intersect([S.Object({sessionId:S.Optional(S.String())}),Kvt]);async function SCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return fMr(t,e,r);z8i.info(t,"handleAgentCreate called",{agentProvider:r.agentProvider,model:r.model,workspaceFolder:r.workspaceFolder});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.create(s);return z8i.info(t,"create succeeded:",c.sessionId),c})}a(SCc,"handleAgentCreateChecked");var Y8i=je(bCc,SCc);p();p();var TCc=S.Object({sessionId:Fi});async function pMr(t,e,r){let n=t.get(Ls);return Ti(async()=>({success:(await n.destroySession({sessionId:r.sessionId})).success}))}a(pMr,"handleBackgroundAgentDestroyChecked");var p7p=je(TCc,pMr);var ICc=new Ae("BackgroundAgent.destroy"),xCc=S.Object({sessionId:Fi,agentProvider:kl});async function wCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return pMr(t,e,r);ICc.info(t,"handleAgentDestroy called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.destroy(s))}a(wCc,"handleAgentDestroyChecked");var K8i=je(xCc,wCc);p();p();var RCc=new Ae("BackgroundAgent.disableRemote"),PCc=S.Object({sessionId:Fi});async function hMr(t,e,r){RCc.info(t,"handleBackgroundAgentDisableRemote called",{sessionId:r.sessionId});let n=t.get(Ls);return Ti(async()=>(await n.disableRemote(r.sessionId),{success:!0}))}a(hMr,"handleBackgroundAgentDisableRemoteChecked");var M7p=je(PCc,hMr);var J8i=new Ae("BackgroundAgent.disableRemote"),kCc=S.Object({sessionId:Fi,agentProvider:kl});async function DCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return hMr(t,e,r);J8i.info(t,"handleAgentDisableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.disableRemote(s);return J8i.info(t,"disableRemote succeeded"),c})}a(DCc,"handleAgentDisableRemoteChecked");var Z8i=je(kCc,DCc);p();p();var NCc=new Ae("BackgroundAgent.enableRemote"),MCc=S.Object({sessionId:Fi});async function mMr(t,e,r){NCc.info(t,"handleBackgroundAgentEnableRemote called",{sessionId:r.sessionId});let n=t.get(Ls);return Ti(async()=>n.enableRemote(r.sessionId))}a(mMr,"handleBackgroundAgentEnableRemoteChecked");var tQp=je(MCc,mMr);var X8i=new Ae("BackgroundAgent.enableRemote"),OCc=S.Object({sessionId:Fi,agentProvider:kl});async function BCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return mMr(t,e,r);X8i.info(t,"handleAgentEnableRemote called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.enableRemote(s);return X8i.info(t,"enableRemote succeeded"),c})}a(BCc,"handleAgentEnableRemoteChecked");var e6i=je(OCc,BCc);p();p();var LCc=S.Object({sessionId:Fi});async function gMr(t,e,r){let n=t.get(Ls);return Ti(async()=>({path:await n.getPlanPath(r.sessionId)}))}a(gMr,"handleBackgroundAgentGetPlanPathChecked");var vQp=je(LCc,gMr);var FCc=new Ae("BackgroundAgent.getPlanPath"),UCc=S.Object({sessionId:Fi,agentProvider:kl});async function QCc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[c,l]=await gMr(t,e,r);return l?[null,l]:[c.path,null]}FCc.info(t,"handleAgentGetPlanPath called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.getPlanPath(s))}a(QCc,"handleAgentGetPlanPathChecked");var t6i=je(UCc,QCc);p();p();var qCc=new Ae("BackgroundAgent.getRemoteStatus"),jCc=S.Object({sessionId:Fi});async function AMr(t,e,r){qCc.info(t,"handleBackgroundAgentGetRemoteStatus called",{sessionId:r.sessionId});let n=t.get(Ls);return Ti(()=>Promise.resolve(n.getRemoteStatus(r.sessionId)))}a(AMr,"handleBackgroundAgentGetRemoteStatusChecked");var jQp=je(jCc,AMr);var HCc=new Ae("BackgroundAgent.getRemoteStatus"),GCc=S.Object({sessionId:Fi,agentProvider:kl});async function $Cc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return AMr(t,e,r);HCc.info(t,"handleAgentGetRemoteStatus called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.getRemoteStatus(s))}a($Cc,"handleAgentGetRemoteStatusChecked");var r6i=je(GCc,$Cc);p();p();var VCc=new Ae("BackgroundAgent.interaction"),WCc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),zCc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),YCc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),KCc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),JCc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),ZCc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),XCc=S.Union([S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("permission"),result:WCc}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("user_input"),response:zCc}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("elicitation"),response:YCc}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:KCc}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("queued_command"),result:JCc}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("external_tool"),result:ZCc})]);async function yMr(t,e,r){VCc.info(t,"handleBackgroundAgentInteraction called",{sessionId:r.sessionId,type:r.type,requestId:r.requestId});let n=t.get(Ls);return Ti(async()=>await n.handleInteraction(r))}a(yMr,"handleBackgroundAgentInteractionChecked");var lqp=je(XCc,yMr);var n6i=new Ae("BackgroundAgent.interaction"),ebc=S.Union([S.Object({kind:S.Literal("approve-once")}),S.Object({kind:S.Literal("denied-by-rules"),rules:S.Array(S.Unknown())}),S.Object({kind:S.Literal("denied-no-approval-rule-and-could-not-request-from-user")}),S.Object({kind:S.Literal("denied-interactively-by-user"),feedback:S.Optional(S.String())}),S.Object({kind:S.Literal("denied-by-content-exclusion-policy"),path:S.String(),message:S.String()})]),tbc=S.Object({answer:S.String(),wasFreeform:S.Boolean()}),rbc=S.Object({action:S.Union([S.Literal("accept"),S.Literal("decline"),S.Literal("cancel")]),content:S.Optional(S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean(),S.Array(S.String())])))}),nbc=S.Object({approved:S.Boolean(),selectedAction:S.Optional(S.Union([S.Literal("exit_only"),S.Literal("interactive"),S.Literal("autopilot"),S.Literal("autopilot_fleet")])),autoApproveEdits:S.Optional(S.Boolean()),feedback:S.Optional(S.String())}),ibc=S.Union([S.Object({handled:S.Literal(!0),stopProcessingQueue:S.Optional(S.Boolean())}),S.Object({handled:S.Literal(!1)})]),obc=S.Union([S.String(),S.Object({textResultForLlm:S.String(),binaryResultsForLlm:S.Optional(S.Array(S.Object({data:S.String(),mimeType:S.String(),type:S.Union([S.Literal("resource"),S.Literal("image")]),description:S.Optional(S.String())}))),resultType:S.Union([S.Literal("success"),S.Literal("failure"),S.Literal("rejected"),S.Literal("denied")]),error:S.Optional(S.String())})]),sbc=S.Union([S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("permission"),result:ebc,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("user_input"),response:tbc,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("elicitation"),response:rbc,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("exit_plan_mode"),response:nbc,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("queued_command"),result:ibc,agentProvider:kl}),S.Object({sessionId:Fi,requestId:S.String(),type:S.Literal("external_tool"),result:obc,agentProvider:kl})]);async function abc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return yMr(t,e,r);n6i.info(t,"handleAgentInteraction called",{agentProvider:r.agentProvider,sessionId:r.sessionId,type:r.type,requestId:r.requestId});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.interaction(s);return n6i.info(t,"interaction succeeded"),c})}a(abc,"handleAgentInteractionChecked");var i6i=je(sbc,abc);p();p();var o6i=new Ae("BackgroundAgent.listSessions"),cbc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String())});async function EMr(t,e,r){o6i.info(t,"handleBackgroundAgentSessionsList called",r);let n=t.get(Ls);return Ti(async()=>{let o=await n.listSessions(r);return o6i.info(t,"listSessions succeeded, returning",o.sessions.length,"sessions"),o})}a(EMr,"handleBackgroundAgentSessionsListChecked");var kqp=je(cbc,EMr);var s6i=new Ae("BackgroundAgent.listSessions"),lbc=S.Object({cwd:S.Optional(S.String()),gitRoot:S.Optional(S.String()),repository:S.Optional(S.String()),branch:S.Optional(S.String()),agentProvider:kl});async function ubc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return EMr(t,e,r);s6i.info(t,"handleAgentSessionsList called",r);let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.listSessions(s);return s6i.info(t,"listSessions succeeded, returning",c.sessions.length,"sessions"),c})}a(ubc,"handleAgentSessionsListChecked");var a6i=je(lbc,ubc);p();p();var c6i=new Ae("BackgroundAgent.listModels"),dbc=S.Object({forceRefresh:S.Optional(S.Boolean())});async function _Mr(t,e,r){c6i.info(t,"handleBackgroundAgentListModels called",{forceRefresh:r.forceRefresh});let n=t.get(Ls);return Ti(async()=>{let o=await n.listModels(r.forceRefresh);return c6i.info(t,"listModels succeeded, returning",o.models.length,"models"),o})}a(_Mr,"handleBackgroundAgentListModelsChecked");var Xqp=je(dbc,_Mr);var l6i=new Ae("BackgroundAgent.listModels"),fbc=S.Object({forceRefresh:S.Optional(S.Boolean()),agentProvider:kl});async function pbc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return _Mr(t,e,r);l6i.info(t,"handleAgentListModels called",{agentProvider:r.agentProvider,forceRefresh:r.forceRefresh});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.listModels(s);return l6i.info(t,"listModels succeeded, returning",c.models.length,"models"),c})}a(pbc,"handleAgentListModelsChecked");var u6i=je(fbc,pbc);p();p();var d6i=new Ae("BackgroundAgent.resume"),hbc=S.Intersect([S.Object({sessionId:Fi}),qAe]);async function vMr(t,e,r){d6i.info(t,"handleBackgroundAgentResume called",{sessionId:r.sessionId,model:r.model});let n=t.get(Ls),o={sessionId:r.sessionId,model:r.model,reasoningEffort:r.reasoningEffort,workspaceFolder:r.workspaceFolder,globalAgentsMdInstructions:r.globalAgentsMdInstructions,globalClaudeMdInstructions:r.globalClaudeMdInstructions,externalToolDefinitions:r.externalToolDefinitions,useAgentsMdFile:r.useAgentsMdFile,useNestedAgentsMdFiles:r.useNestedAgentsMdFiles,useClaudeMdFile:r.useClaudeMdFile,useNestedClaudeMdFiles:r.useNestedClaudeMdFiles};return Ti(async()=>{let s=await n.resumeSession(o);return d6i.info(t,"resumeSession succeeded:",s.sessionId),{sessionId:s.sessionId,workspacePath:s.workspacePath,events:s.events}})}a(vMr,"handleBackgroundAgentResumeChecked");var _jp=je(hbc,vMr);var f6i=new Ae("BackgroundAgent.resume"),mbc=S.Intersect([S.Object({sessionId:Fi}),Kvt]);async function gbc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return vMr(t,e,r);f6i.info(t,"handleAgentResume called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.resume(s);return f6i.info(t,"resume succeeded:",c.sessionId),c})}a(gbc,"handleAgentResumeChecked");var p6i=je(mbc,gbc);p();p();var Abc=S.Union([S.Literal(""),...Object.values(go).map(t=>S.Literal(t))]),ybc=["interactive","plan","autopilot"],Ebc=S.Union(ybc.map(t=>S.Literal(t))),_bc=S.String({minLength:1}),vbc=S.Object({sessionId:Fi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(Abc),reasoningEffort:QAe,references:S.Optional(S.Array(nO)),agentMode:S.Optional(Ebc),chatMode:S.Optional(_bc),contextTier:S.Optional(EBe),sendMode:S.Optional(S.Union([S.Literal("enqueue"),S.Literal("immediate")]))});async function CMr(t,e,r){let n=t.get(Ls),o={sessionId:r.sessionId,message:r.message,model:r.model,providerName:r.providerName,reasoningEffort:r.reasoningEffort,references:r.references,agentMode:r.agentMode,chatMode:r.chatMode,contextTier:r.contextTier,sendMode:r.sendMode};return Ti(async()=>({messageId:(await n.sendMessage(o,e)).messageId}))}a(CMr,"handleBackgroundAgentSendChecked");var Hjp=je(vbc,CMr);var h6i=new Ae("BackgroundAgent.send"),Cbc=S.Union([S.Literal(""),...Object.values(go).map(t=>S.Literal(t))]),bbc=["interactive","plan","autopilot"],Sbc=S.Union(bbc.map(t=>S.Literal(t))),Tbc=S.String({minLength:1}),Ibc=S.Object({sessionId:Fi,message:S.String(),model:S.Optional(S.String()),providerName:S.Optional(Cbc),reasoningEffort:QAe,references:S.Optional(S.Array(nO)),agentMode:S.Optional(Sbc),chatMode:S.Optional(Tbc),contextTier:S.Optional(EBe),agentProvider:kl});async function xbc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND")return CMr(t,e,r);h6i.info(t,"handleAgentSend called",{agentProvider:r.agentProvider,sessionId:r.sessionId,model:r.model});let o=t.get(wc),s=r;return Ti(async()=>{let c=await o.send(s,e);return h6i.info(t,"resume succeeded:",c.messageId),c})}a(xbc,"handleAgentSendChecked");var m6i=je(Ibc,xbc);p();p();var wbc=new Ae("BackgroundAgent.stop"),Rbc=S.Object({sessionId:Fi});async function bMr(t,e,r){wbc.info(t,"handleBackgroundAgentStop called",{sessionId:r.sessionId});let n=t.get(Ls);return Ti(async()=>(await n.stopSession(r.sessionId),{success:!0}))}a(bMr,"handleBackgroundAgentStopChecked");var fHp=je(Rbc,bMr);var Pbc=new Ae("BackgroundAgent.stop"),kbc=S.Object({sessionId:Fi,agentProvider:kl});async function Dbc(t,e,r){if((r.agentProvider??"BACKGROUND")==="BACKGROUND"){let[,c]=await bMr(t,e,r);return c?[null,c]:[void 0,null]}Pbc.info(t,"handleAgentStop called",{agentProvider:r.agentProvider,sessionId:r.sessionId});let o=t.get(wc),s=r;return Ti(async()=>o.stop(s))}a(Dbc,"handleAgentStopChecked");var g6i=je(kbc,Dbc);p();var Nbc=S.Object({});async function Mbc(t,e,r){return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:[{tokens:await t.get(Fr).listAvailableTokens()},null]}a(Mbc,"handleListAvailableTokensChecked");var A6i=je(Nbc,Mbc);p();var Obc=S.Object({tokenId:S.Number()});async function Bbc(t,e,r){return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:[await t.get(Fr).useExistingToken(r.tokenId),null]}a(Bbc,"handleUseExistingTokenChecked");var y6i=je(Obc,Bbc);p();var Lbc=S.Object({providerName:S.String()});async function Fbc(t,e,r){try{let{providerName:n}=r,o=DQ(n);if(o!==0)return[null,{code:it.InvalidParams,message:`deleteApiKey is only supported for providers with GlobalApiKey auth type. Provider ${n} has auth type: ${o}`}];let s=new Cc(t.get(yi));return await s.removeAllModelConfigs(n),await s.deleteAPIKey(n,o),[{success:!0,message:`API key and all model configurations deleted successfully for provider ${n}`},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to delete API key: ${n instanceof Error?n.message:String(n)}`}]}}a(Fbc,"handleBYOKDeleteApiKeyChecked");var E6i=je(Lbc,Fbc);p();var Ubc=S.Object({providerName:S.String(),modelId:S.String()});async function Qbc(t,e,r){try{let n=new Cc(t.get(yi)),{providerName:o,modelId:s}=r,c=DQ(o);return await n.removeModelConfig(o,s),c===1&&await n.deleteAPIKey(o,c,s),[{success:!0,message:`Model ${s} deleted successfully for provider ${o}`},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to delete model: ${n instanceof Error?n.message:String(n)}`}]}}a(Qbc,"handleBYOKDeleteModelChecked");var _6i=je(Ubc,Qbc);p();var qbc=S.Object({providerName:S.Optional(S.String()),modelId:S.Optional(S.String())});async function jbc(t,e,r){try{let n=new Cc(t.get(yi)),{providerName:o,modelId:s}=r;if(!o){let l=t.get(yi),u=await l.listKeys("byok"),d=[];for(let f of u)if(f.endsWith("-api-key")){let h=await l.read("byok",f);if(h){let g=f.replace("-api-key","").split("-");if(g.length===1)d.push({providerName:g[0],apiKey:h});else if(g.length>=2){let A=g[0],y=g.slice(1).join("-");d.push({providerName:A,modelId:y,apiKey:h})}}}return[{apiKeys:d},null]}return[{apiKeys:[{apiKey:await n.getAPIKey(o,s)||void 0,providerName:o,modelId:s}]},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to get API key: ${n instanceof Error?n.message:String(n)}`}]}}a(jbc,"handleBYOKListApiKeysChecked");var v6i=je(qbc,jbc);p();p();p();pOr();var ibt=class extends kx{static{a(this,"AnthropicProvider")}constructor(e){super(go.Anthropic,e)}async getAllModels(){await this.ensureKnownModelsCache();let e=await new Cc(this.ctx.get(yi)).getAPIKey(this.providerName);if(!e)throw new Error(`API key not found for provider: ${this.providerName}`);let r=new K4({apiKey:e,fetch:$Sc(this.ctx.get(cr))});try{let n=await r.models.list(),o=[];for(let s of n.data){let c=this._knownModels?.[s.id];c&&o.push({providerName:this.providerName,modelId:s.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:c})}return o}catch(n){throw tIe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,n),n}}};function $Sc(t){return async(e,r)=>{let n=VSc(e,r),o=zSc(r),s=await t.fetch(n,o);return KSc(s)}}a($Sc,"createAnthropicFetchAdapter");function VSc(t,e){return t instanceof Request?(WSc(t,e),t.url):t instanceof URL?t.toString():t}a(VSc,"convertInputToString");function WSc(t,e){e&&(e.headers??=t.headers,e.method??=t.method,!e.body&&!t.bodyUsed&&(e.body=t.body))}a(WSc,"mergeRequestInit");function zSc(t){let e;return t?.headers&&(e=YSc(t.headers)),{method:t?.method||"GET",headers:e,body:t?.body,signal:t?.signal||void 0}}a(zSc,"convertToFetchOptions");function YSc(t){let e={};if(t instanceof Headers)for(let[r,n]of t.entries())e[r]=n;else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else return t;return e}a(YSc,"convertHeaders");async function KSc(t){let e=t.body(),r=null;if(e)r=JSc(e);else{let n=await t.text();r=XSc(n)}return new globalThis.Response(r,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)})}a(KSc,"convertToWebResponse");function JSc(t){return new ReadableStream({start(e){let r=ZSc(t,e);return()=>r()},cancel(){"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}})}a(JSc,"createReadableStreamFromNodeStream");function ZSc(t,e){let r=a(c=>{e.enqueue(new Uint8Array(c))},"onData"),n=a(()=>{e.close(),s()},"onEnd"),o=a(c=>{e.error(c),s()},"onError"),s=a(()=>{t.off("data",r),t.off("end",n),t.off("error",o)},"cleanup");return t.on("data",r),t.on("end",n),t.on("error",o),s}a(ZSc,"setupStreamHandlers");function XSc(t){return new ReadableStream({start(e){e.enqueue(new TextEncoder().encode(t)),e.close()}})}a(XSc,"createReadableStreamFromText");p();var obt=class extends kx{static{a(this,"GeminiProvider")}constructor(e){super(go.Gemini,e)}};p();var sbt=class extends kx{static{a(this,"GroqProvider")}constructor(e){super(go.Groq,e)}};p();var abt=class extends kx{static{a(this,"OpenAIProvider")}constructor(e){super(go.OpenAI,e)}};p();var HUi=16e3,cbt=class extends kx{static{a(this,"OpenRouterProvider")}constructor(e){super(go.OpenRouter,e)}async getAllModels(){try{let e=this.getFetchModelUrl(),r={"Content-Type":"application/json"},n=await new Cc(this.ctx.get(yi)).getAPIKey(this.providerName);n&&(r.Authorization=`Bearer ${n}`);let o=await this.ctx.get(cr).fetch(e,{method:"GET",headers:r});if(!o.ok)throw new Error(`Failed to fetch models: ${o.status} ${o.statusText}`);let s=await o.json();if(s.error)throw new Error(`API Error: ${JSON.stringify(s.error)}`);let c=[];for(let l of s.data)c.push({providerName:this.providerName,modelId:l.id,isRegistered:!1,isCustomModel:!1,modelCapabilities:{name:l.name,maxInputTokens:Math.max(0,l.top_provider.context_length-HUi),maxOutputTokens:HUi,toolCalling:l.supported_parameters?.includes("tools")??!1,vision:l.architecture?.input_modalities?.includes("image")??!1}});return c}catch(e){throw tIe.error(this.ctx,`Error fetching models from ${this.providerName} provider:`,e),e}}getFetchModelUrl(){return`${this.getBaseUrl()}/models?supported_parameters=tools`}};var gne=class{static{a(this,"BYOKProviderFactory")}constructor(e){this.providers=new Map([[go.OpenAI,new abt(e)],[go.Gemini,new obt(e)],[go.Groq,new sbt(e)],[go.OpenRouter,new cbt(e)],[go.Anthropic,new ibt(e)]])}getBYOKProvider(e){return this.providers.get(e)}};var eTc=S.Object({providerName:S.Optional(S.String()),enableFetchUrl:S.Optional(S.Boolean())});async function tTc(t,e,r){try{let{providerName:n,enableFetchUrl:o}=r,s=new Cc(t.get(yi)),c=[];if(n)if(o){if(!Xce(n))return[null,{code:it.InvalidRequest,message:`enableFetchUrl is not supported for the ${n} provider`}];if(!await s.getAPIKey(n))return[null,{code:it.InvalidRequest,message:`API key is required to fetch models from ${n}`}];let u=t.get(gne).getBYOKProvider(n);if(u){let d=await u.getAllModels(),f=new Map;d.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)});let h=await s.getStoredModelConfigs(n),m=[];Object.entries(h).forEach(([g,A])=>{m.push({providerName:n,modelId:g,deploymentUrl:A.deploymentUrl,isRegistered:A.isRegistered,isCustomModel:A.isCustomModel,modelCapabilities:A.modelCapabilities})}),m.forEach(g=>{let A=`${g.providerName}_${g.modelId}`;f.set(A,g)}),c.push(...f.values())}}else{let l=await s.getStoredModelConfigs(n);Object.entries(l).forEach(([u,d])=>{c.push({providerName:n,modelId:u,deploymentUrl:d.deploymentUrl,isRegistered:d.isRegistered,isCustomModel:d.isCustomModel,modelCapabilities:d.modelCapabilities})})}else{let l=Object.values(go);for(let u of l){let d=await s.getStoredModelConfigs(u);Object.entries(d).forEach(([f,h])=>{c.push({providerName:u,modelId:f,deploymentUrl:h.deploymentUrl,isRegistered:h.isRegistered,isCustomModel:h.isCustomModel,modelCapabilities:h.modelCapabilities})})}}return[{models:c},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to get models: ${n instanceof Error?n.message:String(n)}`}]}}a(tTc,"handleBYOKListModelsChecked");var GUi=je(eTc,tTc);p();var rTc=S.Object({providerName:S.String(),apiKey:S.String(),modelId:S.Optional(S.String())});async function nTc(t,e,r){try{let n=new Cc(t.get(yi)),{providerName:o,apiKey:s,modelId:c}=r,l=DQ(o);if(l===1&&!c)return[null,{code:it.InvalidRequest,message:"modelId is required for PerModelDeployment auth type"}];await n.storeAPIKey(o,s,l,c);let u=`API key saved successfully for provider ${o}`;return[{success:!0,message:c?`${u} and model ${c}`:u},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to save API key: ${n instanceof Error?n.message:String(n)}`}]}}a(nTc,"handleBYOKSaveApiKeyChecked");var $Ui=je(rTc,nTc);p();var iTc=S.Object({providerName:S.String(),modelId:S.String(),isRegistered:S.Boolean(),isCustomModel:S.Boolean(),deploymentUrl:S.Optional(S.String()),apiKey:S.Optional(S.String()),modelCapabilities:S.Optional(S.Object({name:S.String(),maxInputTokens:S.Optional(S.Number()),maxOutputTokens:S.Optional(S.Number()),toolCalling:S.Boolean(),vision:S.Boolean(),thinking:S.Optional(S.Boolean())}))});async function oTc(t,e,r){try{let{providerName:n,modelId:o,isRegistered:s,isCustomModel:c,deploymentUrl:l,apiKey:u,modelCapabilities:d}=r,f=new Cc(t.get(yi)),h=DQ(n);if(h===1&&!l)return[null,{code:it.InvalidRequest,message:`deploymentUrl is required for the ${n} provider`}];if(l||d){let m={deploymentUrl:l,isRegistered:s,isCustomModel:c,modelCapabilities:d};await f.saveModelConfig(n,o,m,u,h)}else u!==void 0&&await f.storeAPIKey(n,u,h,o);return[{success:!0,message:`Model ${o} saved successfully for provider ${n}`},null]}catch(n){return[null,{code:it.InternalError,message:`Failed to save model: ${n instanceof Error?n.message:String(n)}`}]}}a(oTc,"handleBYOKSaveModelChecked");var VUi=je(iTc,oTc);p();var sTc=S.Object({cliPath:S.String()});async function aTc(t,e,r){return[await Tpe.check(r.cliPath),null]}a(aTc,"handleCheckClaudeCliCompatibilityChecked");var WUi=je(sTc,aTc);p();var cTc=S.Object({uri:S.String({minLength:1})});async function lTc(t,e,r){let n=await t.get(ri).getOrReadTextDocument(r);return[{status:Ku(n),...n.status==="invalid"&&{reason:n.reason},...n.status==="notfound"&&{reason:n.message}},null]}a(lTc,"handleCheckFileStatusChecked");var zUi=je(cTc,lTc);p();var uTc=S.Object({});function YUi(t,e){return typeof t!="number"||typeof e!="number"||e===0?0:Math.max(0,Math.min(100,t/e*100))}a(YUi,"calculatePercentRemaining");function g5r(t){return{percentRemaining:t?.percent_remaining??100,unlimited:t?.unlimited??!1,overagePermitted:t?.overage_permitted??!1,overageCount:t?.overage_count,entitlement:t?.entitlement,quotaRemaining:t?.quota_remaining,timeStamp:t?.timestamp_utc}}a(g5r,"buildQuotaSnapshot");async function dTc(t,e,r){let n=await t.get(Fr).resolveSession();if(!n)return[null,{code:it.InternalError,message:"Not signed in"}];let o=await wve(t,n);if(o.ok){let s=await o.json();return t.get(uu).processUserInfoQuotaSnapshot(s),s.token_based_billing?[{chat:g5r(s.quota_snapshots?.chat),completions:g5r(s.quota_snapshots?.completions),premiumInteractions:g5r(s.quota_snapshots?.premium_interactions),resetDate:s.quota_reset_date??"",resetDateUtc:s.quota_reset_date_utc,copilotPlan:s.access_type_sku==="free_limited_copilot"?"free":s.copilot_plan,tokenBasedBillingEnabled:!0,canUpgradePlan:s.can_upgrade_plan},null]:s.access_type_sku==="free_limited_copilot"?[{chat:{percentRemaining:YUi(s.limited_user_quotas?.chat,s.monthly_quotas?.chat),unlimited:!1,overagePermitted:!1},completions:{percentRemaining:YUi(s.limited_user_quotas?.completions,s.monthly_quotas?.completions),unlimited:!1,overagePermitted:!1},premiumInteractions:{percentRemaining:0,unlimited:!1,overagePermitted:!1},resetDate:s.limited_user_reset_date??"",copilotPlan:"free",tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]:[{chat:{percentRemaining:s.quota_snapshots?.chat?.percent_remaining??100,unlimited:s.quota_snapshots?.chat?.unlimited??!1,overagePermitted:s.quota_snapshots?.chat?.overage_permitted??!1},completions:{percentRemaining:s.quota_snapshots?.completions?.percent_remaining??100,unlimited:s.quota_snapshots?.completions?.unlimited??!1,overagePermitted:s.quota_snapshots?.completions?.overage_permitted??!1},premiumInteractions:{percentRemaining:s.quota_snapshots?.premium_interactions?.percent_remaining??100,unlimited:s.quota_snapshots?.premium_interactions?.unlimited??!1,overagePermitted:s.quota_snapshots?.premium_interactions?.overage_permitted??!1},resetDate:s.quota_reset_date??"",copilotPlan:s.copilot_plan,tokenBasedBillingEnabled:!1,canUpgradePlan:s.can_upgrade_plan},null]}return[null,{code:it.InternalError,message:"Failed to fetch quota info"}]}a(dTc,"handleCheckQuotaChecked");var KUi=je(uTc,dTc);p();var fTc=S.Object({options:S.Optional(S.Object({localChecksOnly:S.Optional(S.Boolean()),forceRefresh:S.Optional(S.Boolean())}))});async function pTc(t,e,r){return[await t.get(Fr).checkAndUpdateStatus(r.options),null]}a(pTc,"handleCheckStatusChecked");var JUi=je(fTc,pTc);p();var hTc=S.Object({pullRequestNumber:S.Integer({minimum:1}),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),body:S.String({minLength:1})});async function mTc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let o=await new Ky(t).addPullRequestComment(r.repoOwner,r.repoName,r.pullRequestNumber,r.body);return _t(t,"cloudAgent.addPullRequestComment",{result:"success"}),[{html_url:o.html_url},null]}catch(n){if(si(t,"cloudAgent.addPullRequestComment",n,{result:"error"}),n instanceof Yy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(mTc,"handleCloudAgentAddPullRequestCommentChecked");var ZUi=je(hTc,mTc);p();var gTc=S.Object({pullRequestId:S.Number(),repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1})});async function ATc(t,e,r){try{let o=await new Ox(t).getAllSessions(r.pullRequestId,e);if(!o||o.length===0)return[null,{code:it.InvalidRequest,message:"No session found for this pull request"}];let s=o[0];return s.state==="completed"?(yt(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),_t(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):s.workflow_run_id?(await new Ky(t).cancelWorkflow(r.repoOwner,r.repoName,s.workflow_run_id),yt(t,"githubApi.cancelCodingAgent",Vt.createAndMarkAsIssued()),_t(t,"githubApi.cancelCodingAgent"),[{success:!0},null]):[null,{code:it.InternalError,message:"No workflow run ID found in session"}]}catch(n){if(La(t,n,"githubApi.cancelCodingAgent"),si(t,"githubApi.cancelCodingAgent",n),n instanceof Mx)return[null,{code:it.NoCopilotToken,message:n.message}];if(n instanceof ep)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof J0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Yy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(ATc,"handleCancelCodingAgentChecked");var XUi=je(gTc,ATc);p();var yTc=S.Object({problemStatement:S.String({minLength:1}),workspaceFolder:S.Optional(S.String({minLength:1})),workspaceFolders:S.Optional(S.Array(Mc))});function ETc(t){if(t.workspaceFolders&&t.workspaceFolders.length>0)return{uri:t.workspaceFolders[0].uri};if(t.workspaceFolder)return{uri:t.workspaceFolder}}a(ETc,"pickWorkspaceFolder");async function _Tc(t,e,r){try{let n=ETc(r);if(!n)return[null,{code:it.InvalidRequest,message:"No workspace folder provided \u2014 cannot create a cloud agent job."}];let s=await new z0(t).getRepo(n);if(!s||!s.isGitHub())return[null,{code:it.InvalidRequest,message:"No GitHub repository found in the workspace folder."}];if(!s.owner||!s.name)return[null,{code:it.InvalidRequest,message:"Could not determine repository owner and name."}];let l=await new YQ([new KQ,new JQ]).getBranchInfo(t,n);if(!l?.currentBranch||l.isDetachedHead)return[null,{code:it.InvalidRequest,message:"No current branch found or detached HEAD state \u2014 cannot create a cloud agent job."}];let u=l.currentBranch,d=EKe(r.problemStatement);if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let h=await new Ox(t).createCodingTask(d,r.problemStatement,s.owner,s.name,u,e);return _t(t,"cloudAgent.createJob",{result:"success"}),[h,null]}catch(n){if(si(t,"cloudAgent.createJob",n,{result:"error"}),S7t(n))return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];if(n instanceof Mx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof ep)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof J0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Yy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(_Tc,"handleCloudAgentCreateJobChecked");var e7i=je(yTc,_Tc);p();var vTc=S.Object({sessionId:S.String({minLength:1})});async function CTc(t,e,r){try{let o=await new Ox(t).getSessionLogs(r.sessionId,e);return _t(t,"cloudAgent.getSessionLogs",{result:"success"}),[{logs:o},null]}catch(n){if(si(t,"cloudAgent.getSessionLogs",n,{result:"error"}),n instanceof Mx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof ep||n instanceof J0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(CTc,"handleCloudAgentGetSessionLogsChecked");var t7i=je(vTc,CTc);p();var bTc=S.Object({pullRequestId:S.Integer()});async function STc(t,e,r){try{let o=await new Ox(t).getAllSessions(r.pullRequestId,e);return _t(t,"cloudAgent.listSessions",void 0,{totalSessions:o?.length??0}),[{sessions:o??[]},null]}catch(n){if(si(t,"cloudAgent.listSessions",n),n instanceof Mx)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof ep||n instanceof J0)return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(STc,"handleCloudAgentListSessionsChecked");var r7i=je(bTc,STc);p();var TTc=S.Object({});async function ITc(t,e,r){return[(await Nx(t)).map(s=>({slug:s.slug,name:s.name,description:s.description,avatarUrl:s.avatarUrl})),null]}a(ITc,"handleConversationAgentsChecked");var n7i=je(TTc,ITc);p();p();var oLe=fe(Al());function xTc(t,e,r){let n=Vt.createAndMarkAsIssued({languageId:String(e.detectedLanguageId),requestedDocumentVersion:String(r),actualDocumentVersion:String(e.version)});return yt(t,"getCompletions.docVersionMismatch",n)}a(xTc,"telemetryVersionMismatch");async function j6(t,e,r){let o=t.get(an).getTextDocumentUnsafe(e);if(!o)throw new oLe.ResponseError(it.InvalidParams,`Document for URI could not be found: ${e.uri}`);let s=await Yce(t,e,o.getText());if(s.status==="invalid")throw t.get(ss).setClsInactive(s.reason),new oLe.ResponseError(it.CopilotNotAvailable,s.reason);if(e.version!==void 0&&o.version!==e.version)throw r?.isCancellationRequested||(xTc(t,o,e.version),ns.debug(t,`Requested document version was ${e.version} but actual document version was ${o.version}.`)),new oLe.ResponseError(it.ContentModified,"Document Version Mismatch");return o}a(j6,"getTextDocument");async function J4(t,e,r){let n=e.textDocument??e.doc;if(n)try{return await j6(t,n,r)}catch(o){if(o instanceof oLe.ResponseError){if(o.code===it.CopilotNotAvailable)return;if(o.code===it.InvalidParams){ns.warn(t,`Document not found for conversation: ${n.uri}. Continuing without this file.`);return}}throw o}}a(J4,"getTextDocumentIfAvailable");var wTc=S.Union([S.Literal("keyboard"),S.Literal("toolbar")]),RTc=S.Object({turnId:fK,codeBlockIndex:S.Number(),source:wTc,copiedCharacters:S.Number(),totalCharacters:S.Number(),copiedText:S.String(),doc:S.Optional(QKe),textDocument:S.Optional(RC),position:S.Optional(K0),conversationSource:S.Optional(iO)});async function PTc(t,e,r){let n=await J4(t,r,e),o={totalCharacters:r.totalCharacters,copiedCharacters:r.copiedCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,currentLine:s.line});let c=FQ(r.conversationSource),l=t.get(Go).findByTurnId(r.turnId),u=await Kc(t,l,{languageId:n?.detectedLanguageId??""});return IS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,mode:l?.turn.getChatModeForTelemetry()??"unknown",modelId:l?.turn.getResolvedModelId()??"unknown"},o,`${Vy(c)}.acceptedCopy`,u),["OK",null]}a(PTc,"handleConversationCodeCopyChecked");var i7i=je(RTc,PTc);p();var kTc=S.Union([S.Literal("keyboard"),S.Literal("toolbar"),S.Literal("diff")]),DTc=S.Object({turnId:fK,source:kTc,codeBlockIndex:S.Number(),acceptedLength:S.Optional(S.Number()),totalCharacters:S.Number(),newFile:S.Optional(S.Boolean()),doc:S.Optional(QKe),textDocument:S.Optional(RC),position:S.Optional(K0),conversationSource:S.Optional(iO)});async function NTc(t,e,r){let n=await J4(t,r,e),o={totalCharacters:r.totalCharacters,acceptedLength:r.acceptedLength??r.totalCharacters},s=r.position??r.doc?.position;n&&s&&(o={...o,insertionOffset:n.offsetAt(s),currentLine:s.line});let c=FQ(r.conversationSource),l=t.get(Go).findByTurnId(r.turnId),u=await Kc(t,l,{languageId:n?.detectedLanguageId??""});return IS(t,n,{codeBlockIndex:r.codeBlockIndex.toString(),source:r.source,uiKind:c,compType:r.acceptedLength&&r.acceptedLength0&&(e+=` ## Latest Todo List \`\`\`json ${JSON.stringify(o,null,2)} -\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});ht(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});ht(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});ht(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=jt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});ht(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});ht(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=jt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});ht(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){Ye.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var Tbt=ce(wo());var Sbt=class extends sr{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(Tbt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(Tbt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. +\`\`\``),e}sendStartedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:s},{turnCount:n});yt(this.ctx,"conversationPartition.compression.started",c,0)}sendArchivedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{turnCount:n});yt(this.ctx,"conversationPartition.compression.archived",s,0)}sendSummarizedTelemetry(e,r,n,o){let s=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),modelId:o},{summaryLength:n});yt(this.ctx,"conversationPartition.compression.summarized",s,0)}sendCompletedTelemetry(e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:String(e),archivedPartitionId:String(r),newPartitionId:String(n),modelId:l},{archivedTurnCount:o,summaryLength:s,compressionTimeMs:c});yt(this.ctx,"conversationPartition.compression.completed",u,0)}sendFailedTelemetry(e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),error:n,modelId:s},{compressionTimeMs:o});yt(this.ctx,"conversationPartition.compression.failed",c,0)}sendCancelledTelemetry(e,r,n,o){let s=Date.now()-n,c=Vt.createAndMarkAsIssued({conversationId:String(e),partitionId:String(r),modelId:o},{compressionTimeMs:s});yt(this.ctx,"conversationPartition.compression.cancelled",c,0)}async recordPartitionTranscriptEvents(e,r,n,o,s){if(this.transcriptPersistence.isEnabled())try{await this.transcriptPersistence.initializePartition(e,n,{compressedFrom:r,source:"compression",summary:o,turnId:s?String(s):void 0})}catch(c){ot.error(this.ctx,`Failed to initialize new partition transcript: ${c instanceof Error?c.message:String(c)}`)}}};p();p();var dbt=fe(xo());var ubt=class extends ar{static{a(this,"ConversationSummaryPrompt")}renderCopilot(){return vscpp(vscppf,null,vscpp(dbt.SystemMessage,{priority:100},vscpp(vscppf,null,this.renderSummarizationInstructions())),this.renderPartitionTurns(),vscpp(dbt.UserMessage,{priority:90},vscpp(vscppf,null,this.renderFinalInstructions())))}renderSummarizationInstructions(){return`You are an expert at summarizing chat conversations for context compression. You will be provided with a series of user/assistant message pairs from a conversation partition that needs to be compressed. @@ -3738,7 +3803,7 @@ Summary: 1. **Analysis Section** = Chronological story for understanding flow 2. **Summary Section** = Structured lookup reference for key facts 3. **Redundancy is acceptable** - same info can appear in both sections -4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(LYe({role:"user",content:RS(o.request.message)})),o.response){let s=GM(o.response.message,!0),c=tO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Mx,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new Z0(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. +4. **Completeness over brevity** - better to include too much than too little`}renderPartitionTurns(){let{partition:e,ctx:r}=this.props,n=[];if(!e.turns||e.turns.length===0)return n;for(let o of e.turns)if(o.request&&n.push(kKe({role:"user",content:xS(o.request.message)})),o.response){let s=WM(o.response.message,!0),c=eO(s,{ctx:r,identifier:"partition summary",enableWarnings:!1});c.length>0&&n.push(vscpp(Bx,{assistantRounds:c,ctx:r,isHistorical:!0,identifier:"partition-summary"}))}return n}renderFinalInstructions(){let{partition:e,ctx:r,userLanguage:n}=this.props,o=new X0(r),s=o.isEnabled()?this.getTranscriptReferenceMessage(o.getTranscriptPath(e.conversationId,e.partitionId),n):"";return`The conversation above contains ${e.turnCount} turn(s) from partition ${e.partitionId}. Please create a comprehensive summary following the exact format specified in the system instructions. @@ -3756,7 +3821,7 @@ If you need specific details from before compaction (like exact code snippets, e \u5727\u7E2E\u524D\u306E\u5177\u4F53\u7684\u306A\u8A73\u7D30\uFF08\u6B63\u78BA\u306A\u30B3\u30FC\u30C9\u30B9\u30CB\u30DA\u30C3\u30C8\u3001\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u3001\u751F\u6210\u3055\u308C\u305F\u30B3\u30F3\u30C6\u30F3\u30C4\u306A\u3069\uFF09\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001\u5B8C\u5168\u306A\u30C8\u30E9\u30F3\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u304A\u8AAD\u307F\u304F\u3060\u3055\u3044\uFF1A${e}`,es:` -Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};Ns();var JD=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await Kf.create(Sbt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=gA.user(o,gr()),f=NI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(rc)}catch{h=new rc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),Ye.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return Ye.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return Ye.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});ht(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});ht(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});ht(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=jt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});ht(this.ctx,"partition.summary.cancelled",s,0)}};var xxc=S.Object({conversationId:S.String()});async function wxc(t,e,r){let{conversationId:n}=r,o=Date.now();Ye.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(oI);Rxc(t,n,o);try{if(e.isCancellationRequested)return Ye.debug(t,`Manual compression cancelled before start: ${n}`),[ELe(n,"Compression cancelled"),null];let c=t.get(Vo),l;try{l=c.get(n)}catch{return Ye.warn(t,`Conversation not found: ${n}`),_Le(t,n,0,"Conversation not found",Date.now()-o),[ELe(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return Ye.warn(t,`Cannot compress conversation with 0 turns: ${n}`),_Le(t,n,0,"No turns to compress",Date.now()-o),[ELe(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return Ye.warn(t,`Cannot compress - no new turns since last compression: ${n}`),_Le(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[ELe(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(Bc).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(JD),y=new BR(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;Ye.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new fq().calculateContextSize(t,l,m)}catch(R){Ye.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),kxc(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return Ye.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),_Le(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return Ye.exception(t,c,`Manual compression error: conversationId=${n}`),_Le(t,n,0,l,u),[ELe(n,`Compression failed: ${l}`),null]}}a(wxc,"handleConversationCompressChecked");function ELe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(ELe,"createErrorResult");function Rxc(t,e,r,n){let o=jt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});ht(t,"conversationPartition.manualCompression.started",o,0)}a(Rxc,"sendStartedTelemetry");function kxc(t,e,r,n,o,s,c,l){let u=jt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});ht(t,"conversationPartition.manualCompression.completed",u,0)}a(kxc,"sendCompletedTelemetry");function _Le(t,e,r,n,o,s){let c=jt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});ht(t,"conversationPartition.manualCompression.failed",c,0)}a(_Le,"sendFailedTelemetry");var f7i=Ne(xxc,wxc);p();p();var Ibt=S.Array(hf);function xbt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(xbt,"resolveAsActiveEditor");p();var p7i=ce(Al());var wbt=new p7i.ProgressType,O5r=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new fq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(ur).connection.sendProgress(wbt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(ur).connection.sendProgress(wbt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){Ye.error(e,"Failed to calculate context size",o);return}}};function Vye(t){return new O5r(t.workDoneToken)}a(Vye,"createProgressHandler");p();var h7i=ce(Al());var Wye=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new h7i.ResponseError(Ke.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function Rbt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:ji(t.uri)}]}a(Rbt,"resolveAsWorkspaceFolders");p();p();var Pxc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),qE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?Pxc(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var ZD=class{constructor(){this.tokens=new nn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new qn.CancellationTokenSource,o=new qE([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function m7i(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(m7i,"calculateBillingMultiplier");function kbt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.model,modelProviderName:e.modelProviderName,userRequestedModel:e.model,reasoningEffort:e.modelInfo?.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:m7i(r)}}a(kbt,"buildTurnSummary");function Pbt(t,e,r,n,o,s){let c={lspMethod:e,conversationId:String(r.id),turnId:String(n.id)};tV(c,"modelName",o.modelName),tV(c,"modelProviderName",o.modelProviderName),tV(c,"userRequestedModel",o.userRequestedModel),tV(c,"reasoningEffort",o.reasoningEffort),tV(c,"chatMode",o.chatMode),tV(c,"agentSlug",o.agentSlug);let l={};tV(l,"billingMultiplier",o.billingMultiplier),tV(l,"credits",s),gt(t,"conversation.turnCompleted",c,l)}a(Pbt,"sendTurnTelemetry");function Dbt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(Dbt,"formatCredits");function tV(t,e,r){r!==void 0&&(t[e]=r)}a(tV,"assignDefined");var Dxc=S.Object({conversationId:S.Optional(ZYe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(a_n,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(Rv),textDocument:S.Optional(Rv),selection:S.Optional(hf),visibleRanges:S.Optional(Ibt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(oO)),source:S.Optional(sO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(rKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(nKe)),restoreToTurnId:S.Optional(S.String())});async function Nxc(t,e,r){Wye.validate(r.workspaceFolders);let n=await iB(t,r,e),o=await t.get(Vo).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(X0).setTodos(o,r.todoList);let s=o.turns.length>0?r.turns.slice(-1):r.turns;await Mxc(t,o,{...r,turns:s},n);let c=o.turns[o.turns.length-1],l=Vye(r),u=t.get(ZD).add(l.progressToken,e),d=new Wx(t,o,c,u),f=await t.get(XD).createProcessor(d,l.progressToken,r.computeSuggestions),h=t.get(Rd),m=String(c.id);h.resetTurnCredits(m);let g;try{await f.process(l,u,void 0,n,r.model,r.modelProviderName,r.modelInfo),g=h.getCreditsForTurn(m)}finally{h.resetTurnCredits(m)}let A=kbt(c,r);return Pbt(t,"conversation/create",o,c,A,g),[{conversationId:o.id,turnId:c.id,agentSlug:A.agentSlug,modelName:A.modelName,modelProviderName:A.modelProviderName,billingMultiplier:A.billingMultiplier,modelInfo:r.modelInfo,credits:Dbt(g)},null]}a(Nxc,"handleConversationCreateChecked");async function Mxc(t,e,r,n){for(let o of r.turns){let s=eKe(o.request),c=new Gf({message:s,type:"user"},o.turnId);o.response&&(c.response={message:o.response,type:"model"}),o.agentSlug&&(c.agent={agentSlug:o.agentSlug});let l=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,u=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Rbt(l),d=t.get(x_),f=eQ(r.chatMode);c.chatMode=await d.getChatMode(f,r.customChatModeId,u),c.userRequestedModel=o.model??r.model,c.needToolCallConfirmation=r.needToolCallConfirmation;let h=xbt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Vo).addTurn(e.id,c,r.references,h,l,u,r.ignoredSkills,void 0)}}a(Mxc,"addTurns");var g7i=Ne(Dxc,Nxc);p();var Oxc=S.Object({conversationId:S.String()});function Bxc(t,e,r){return t.get(Vo).destroy(r.conversationId),["OK",null]}a(Bxc,"handleConversationDestroyChecked");var A7i=Ne(Oxc,Bxc);p();var Lxc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Fxc(t,e,r){return[(await t.get(x_).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a(Fxc,"handleConversationModesChecked");var y7i=Ne(Lxc,Fxc);p();var Uxc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),Qxc=new ge("conversationNotifyCodeAcceptance");async function qxc(t,e,r){let n=t.get(Vo).findByTurnId(r.turnId);if(!n)return Qxc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await Jc(t,n,{languageId:""});return wS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${Hy("agentPanel")}.codeAcceptance`,o),["OK",null]}a(qxc,"handleConversationNotifyCodeAcceptanceChecked");var E7i=Ne(Uxc,qxc);p();var jxc=S.Object({});function Hxc(t,e,r){return[{path:t.get(Si).directory},null]}a(Hxc,"handleConversationPersistenceChecked");var _7i=Ne(jxc,Hxc);p();p();var B5r=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Ur).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},L5r=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Qt).getToken()).envelope.chat_enabled?"ok":"failed"}}},Gxc=[new B5r,new L5r],LR=class{constructor(e,r=Gxc){this.ctx=e;this.checks=r;this.emitter=new no;this.onChange=this.emitter.event;Es(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var $xc=S.Object({forceCheck:S.Optional(S.Boolean())});async function Vxc(t,e,r){let n=r.forceCheck??!1;return[await t.get(LR).check(n),null]}a(Vxc,"handleConversationPreconditionsChecked");var C7i=Ne($xc,Vxc);p();var Wxc=S.Object({turnId:S.String(),rating:S.Number(),doc:S.Optional(Rv),textDocument:S.Optional(Rv),source:S.Optional(sO)});async function zxc(t,e,r){let n=await iB(t,r,e),o=bQ(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await Jc(t,t.get(Vo).findByTurnId(r.turnId),{languageId:n?.detectedLanguageId??""}),l=`${Hy(o)}.messageRating`,u=wS(t,n,{rating:s,uiKind:o},{},l,c);return MI(t,l,u),["OK",null]}a(zxc,"handleConversationRatingChecked");var v7i=Ne(Wxc,zxc);p();var Yxc=S.Object({tools:S.Array(c_n)});function Kxc(t,e,r){let n=t.get(us);return r.tools.forEach(s=>{n.registerTool(new Sq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(Kxc,"conversationRegisterToolsChecked");var b7i=Ne(Yxc,Kxc);p();var Jxc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Zxc(t,e,r){let n=yHt(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(ag),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).filter(u=>!n.some(d=>d.id===u.name)).map(u=>({id:u.name,description:u.description||"",shortDescription:"",scopes:Xxc(u.mode),source:"prompt",mode:u.mode,model:u.model}));if(n.push(...l),r.workspaceFolders&&r.workspaceFolders.length>0){let f=(await t.get(EA).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${ji(tf(h.uri))}`,description:h.description||"",shortDescription:h.name,scopes:["agent-panel"],source:"skill"})).filter(h=>!n.some(m=>m.id===h.id));n.push(...f)}return[n,null]}a(Zxc,"handleConversationTemplatesChecked");function Xxc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(Xxc,"getCustomPromptScopes");var S7i=Ne(Jxc,Zxc);p();var ewc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:ZYe,turnId:S.Optional(uK),message:T7t,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(Rv),textDocument:S.Optional(Rv),selection:S.Optional(hf),visibleRanges:S.Optional(Ibt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(oO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:Omn,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(rKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(nKe))});async function twc(t,e,r){Wye.validate(r.workspaceFolders);let n=await iB(t,r,e),o=t.get(Vo),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(X0).setTodos(s,r.todoList);let c=eKe(r.message),l=new Gf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:Rbt(u),f=t.get(x_),h=eQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=r.model,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let m=xbt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,m,u,d,r.ignoredSkills,r.confirmationResponse);let g=Vye(r),A=t.get(ZD).add(g.progressToken,e),y=new Wx(t,s,l,A),E=await t.get(XD).createProcessor(y,g.progressToken,r.computeSuggestions),_=t.get(Rd),v=String(l.id);_.resetTurnCredits(v);let b;try{await E.process(g,A,r.followUp,n,r.model,r.modelProviderName,r.modelInfo),b=_.getCreditsForTurn(v)}finally{_.resetTurnCredits(v)}let T=kbt(l,r);return Pbt(t,"conversation/turn",s,l,T,b),[{conversationId:s.id,turnId:l.id,agentSlug:T.agentSlug,modelName:T.modelName,modelProviderName:T.modelProviderName,billingMultiplier:T.billingMultiplier,modelInfo:r.modelInfo,credits:Dbt(b)},null]}a(twc,"handleConversationTurnChecked");var T7i=Ne(ewc,twc);p();var rwc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(sO)});async function nwc(t,e,r){t.get(Vo).deleteTurn(r.conversationId,r.turnId);let o=bQ(r.source),s=await Jc(t,t.get(Vo).findByTurnId(r.turnId),{languageId:""});return wS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${Hy(o)}.messageDelete`,s),["OK",null]}a(nwc,"handleConversationTurnDeleteChecked");var I7i=Ne(rwc,nwc);p();var iwc=S.Object({toolIds:S.Array(S.String())});function owc(t,e,r){let n=t.get(us);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(owc,"conversationUnregisterToolsChecked");var x7i=Ne(iwc,owc);p();var swc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(JL)}))});async function awc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(x_).getChatMode(n?eQ(n):"Agent",o,s),l=t.get(us),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a(awc,"conversationUpdateToolsStatusChecked");var w7i=Ne(swc,awc);p();p();Ns();var cwc=5e3,Sne=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: +Si necesita detalles espec\xEDficos de antes de la compactaci\xF3n (como fragmentos de c\xF3digo exactos, mensajes de error o contenido que gener\xF3), lea la transcripci\xF3n completa en: ${e}`},s=n.split("-")[0];return o[n]||o[s]||o.en}};As();var zD=class{constructor(e){this.ctx=e}static{a(this,"ConversationSummaryManager")}async generateSummary(e,r,n,o="conversation-other",s){let c=Date.now();try{if(this.sendStartedTelemetry(e,r),n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let u=await tp.create(ubt,{ctx:this.ctx,partition:e},r).renderPrompt(void 0,n);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";let d=_A.user(o,ir()),f=RI.createEmptyConfigForTesting(),h;try{h=this.ctx.get(rc)}catch{h=new rc(this.ctx)}let m={messages:u.messages,uiKind:"conversationPanel",llmInteraction:d,modelConfiguration:r,turnId:s},g=await h.fetchResponse(m,n,f,void 0);if(n.isCancellationRequested)return this.sendCancelledTelemetry(e,c,r),"";if(g.type==="success"){let A=g.value.trim();return this.sendSuccessTelemetry(e,c,A,r),ot.debug(this.ctx,`Generated partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, length=${A.length}`),A}else{let A="reason"in g?g.reason:"Unknown error";return ot.error(this.ctx,`Failed to generate partition summary: conversationId=${e.conversationId}, partitionId=${e.partitionId}, type=${g.type}, reason=${A}`),this.sendErrorTelemetry(e,c,g.type,r,A),""}}catch(l){let u=l instanceof Error?l.message:String(l);return ot.exception(this.ctx,l,`Error generating partition summary for conversationId=${e.conversationId}, partitionId=${e.partitionId}`),this.sendErrorTelemetry(e,c,"exception",r,u),""}}sendStartedTelemetry(e,r){let n=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:r.modelId},{turnCount:e.turnCount});yt(this.ctx,"partition.summary.started",n,0)}sendSuccessTelemetry(e,r,n,o){let s=Date.now()-r,c=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:o.modelId},{summaryLength:n.length,generationTimeMs:s,turnCount:e.turnCount});yt(this.ctx,"partition.summary.success",c,0)}sendErrorTelemetry(e,r,n,o,s){let c=Date.now()-r,l=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),errorType:n,errorMessage:s||"Unknown error",modelId:o.modelId},{generationTimeMs:c});yt(this.ctx,"partition.summary.error",l,0)}sendCancelledTelemetry(e,r,n){let o=Date.now()-r,s=Vt.createAndMarkAsIssued({conversationId:String(e.conversationId),partitionId:String(e.partitionId),modelId:n.modelId},{generationTimeMs:o});yt(this.ctx,"partition.summary.cancelled",s,0)}};var MTc=S.Object({conversationId:S.String()});async function OTc(t,e,r){let{conversationId:n}=r,o=Date.now();ot.debug(t,`Manual compression started for conversation: ${n}`);let s=t.get(tI);BTc(t,n,o);try{if(e.isCancellationRequested)return ot.debug(t,`Manual compression cancelled before start: ${n}`),[sLe(n,"Compression cancelled"),null];let c=t.get(Go),l;try{l=c.get(n)}catch{return ot.warn(t,`Conversation not found: ${n}`),aLe(t,n,0,"Conversation not found",Date.now()-o),[sLe(n,`Conversation not found: ${n}`),null]}let u=l.turns.length;if(u===0)return ot.warn(t,`Cannot compress conversation with 0 turns: ${n}`),aLe(t,n,0,"No turns to compress",Date.now()-o),[sLe(n,`Cannot compress conversation with 0 turns: ${n}`),null];let d=l.turns.filter(v=>v.request.type!=="meta").length;if(l.currentPartitionId>1&&d===0)return ot.warn(t,`Cannot compress - no new turns since last compression: ${n}`),aLe(t,n,l.currentPartitionId,"No new turns since last compression",Date.now()-o),[sLe(n,`Cannot compress - no new turns since last compression: ${n}`),null];let h=l.turns[l.turns.length-1],m=h?.resolvedModelConfiguration,g=h?.userRequestedModel;if(!m)if(g)m=await t.get(Yc).getBestChatModelConfig([g]);else throw new Error("No model available for compression");let A=t.get(zD),y=new NR(A,t),E=l.currentPartitionId;await s.notifyCompressionStarted({conversationId:n,partitionId:E,reason:"manual"});let _=await y.compressCurrentPartition(l,m,e);if(_.success){let v=l.turns[0],b=typeof v?.request?.message=="string"?v.request.message:"",T=Date.now()-o;ot.debug(t,`Manual compression completed: conversationId=${n}, archivedPartitionId=${_.archivedPartitionId}, newPartitionId=${_.newPartitionId}, turnCount=${u}, summaryLength=${b.length}, durationMs=${T}`);let w;try{w=new sq().calculateContextSize(t,l,m)}catch(R){ot.warn(t,`Failed to calculate context size after compression: ${R instanceof Error?R.message:String(R)}`)}return await s.notifyCompressionCompleted({conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryLength:b.length,turnCount:u,durationMs:T,contextInfo:w}),LTc(t,n,_.archivedPartitionId,_.newPartitionId,u,b.length,T,m.modelId),[{success:!0,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:b,summaryLength:b.length,turnCount:u,contextInfo:w},null]}else{let v=_.error||"Compression failed",b=Date.now()-o;return ot.warn(t,`Manual compression failed: conversationId=${n}, error=${v}`),aLe(t,n,_.archivedPartitionId,v,b,m.modelId),[{success:!1,conversationId:n,archivedPartitionId:_.archivedPartitionId,newPartitionId:_.newPartitionId,summaryContent:"",summaryLength:0,turnCount:u,error:v},null]}}catch(c){let l=c instanceof Error?c.message:String(c),u=Date.now()-o;return ot.exception(t,c,`Manual compression error: conversationId=${n}`),aLe(t,n,0,l,u),[sLe(n,`Compression failed: ${l}`),null]}}a(OTc,"handleConversationCompressChecked");function sLe(t,e){return{success:!1,conversationId:t,archivedPartitionId:0,newPartitionId:0,summaryContent:"",summaryLength:0,turnCount:0,error:e,contextInfo:void 0}}a(sLe,"createErrorResult");function BTc(t,e,r,n){let o=Vt.createAndMarkAsIssued({conversationId:e,...n?{modelId:n}:{}},{});yt(t,"conversationPartition.manualCompression.started",o,0)}a(BTc,"sendStartedTelemetry");function LTc(t,e,r,n,o,s,c,l){let u=Vt.createAndMarkAsIssued({conversationId:e,archivedPartitionId:String(r),newPartitionId:String(n),success:"true",...l?{modelId:l}:{}},{turnCount:o,summaryLength:s,durationMs:c});yt(t,"conversationPartition.manualCompression.completed",u,0)}a(LTc,"sendCompletedTelemetry");function aLe(t,e,r,n,o,s){let c=Vt.createAndMarkAsIssued({conversationId:e,partitionId:String(r),success:"false",error:n,...s?{modelId:s}:{}},{durationMs:o});yt(t,"conversationPartition.manualCompression.failed",c,0)}a(aLe,"sendFailedTelemetry");var s7i=je(MTc,OTc);p();p();var fbt=S.Array(pf);function pbt(t){if(t.textDocument?.uri)return{uri:t.textDocument.uri,selection:t.selection,visibleRange:t.visibleRanges?.[0]}}a(pbt,"resolveAsActiveEditor");p();var a7i=fe(Al());var hbt=new a7i.ProgressType,A5r=class{constructor(e){this.progressToken=e;this.tokenBudgetEstimator=new sq}static{a(this,"WorkDoneProgressHandler")}async begin(e,r,n,o){await e.get(dr).connection.sendProgress(hbt,this.progressToken,{kind:"begin",title:`Conversation ${r.id} Turn ${n.id}`,conversationId:r.id,turnId:n.id,agentSlug:n.agent?.agentSlug,...o})}async report(e,r,n,o){let s=o.contextSize;s||(s=this.calculateContextSize(e,r,n)),await e.get(dr).connection.sendProgress(hbt,this.progressToken,{kind:"report",conversationId:r.id,turnId:n.id,...o,contextSize:s})}async end(e,r,n,o){await e.get(dr).connection.sendProgress(hbt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,...o})}async cancel(e,r,n,o){await e.get(dr).connection.sendProgress(hbt,this.progressToken,{kind:"end",conversationId:r.id,turnId:n.id,cancellationReason:"CancelledByUser",error:o})}calculateContextSize(e,r,n){try{let o=n.resolvedModelConfiguration;return o?this.tokenBudgetEstimator.calculateContextSize(e,r,o):void 0}catch(o){ot.error(e,"Failed to calculate context size",o);return}}};function Bye(t){return new A5r(t.workDoneToken)}a(Bye,"createProgressHandler");p();var c7i=fe(Al());var Lye=class{static{a(this,"WorkspaceFoldersValidator")}static validate(e){if(!e)return;let r=new Set;for(let n of e){if(r.has(n.uri))throw new c7i.ResponseError(it.InvalidParams,`Duplicate workspace folder uri ${n.uri}`);r.add(n.uri)}}};p();function mbt(t){if(t&&t.uri.length>0)return[{uri:t.uri,name:Ki(t.uri)}]}a(mbt,"resolveAsWorkspaceFolders");p();p();var FTc=Object.freeze(function(t,e){let r=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(r)}}}),FE=class{constructor(e){this.tokens=[];this.handlers=[];this._isCancelled=!1;this.onCancellationRequested=a((e,r)=>this._isCancelled?FTc(e,r):(this.handlers.push(e.bind(r)),{dispose:a(()=>{},"dispose")}),"onCancellationRequested");this.tokens=e,this._isCancelled=e.some(r=>r.isCancellationRequested),e.forEach(r=>{r.onCancellationRequested(n=>this.cancel(n))})}static{a(this,"MergedToken")}cancel(e){this._isCancelled||(this._isCancelled=!0,this.handlers.forEach(r=>r(e)))}get isCancellationRequested(){return this.tokens.some(e=>e.isCancellationRequested)}};var YD=class{constructor(){this.tokens=new yn(250)}static{a(this,"ProgressTokens")}add(e,r){let n=new jn.CancellationTokenSource,o=new FE([r,n.token]);return this.tokens.set(e.toString(),n),o}cancel(e){let r=this.tokens.get(e.toString());r&&(r.cancel(),this.tokens.delete(e.toString()))}};p();p();function l7i(t){if(t?.originalBillingMultiplier===void 0)return;let e=t.autoModeDiscountedCost??0;return Math.round((t.originalBillingMultiplier??0)*(1-e)*100)/100}a(l7i,"calculateBillingMultiplier");async function gbt(t,e){let r=e,n=e.modelInfo?.id;if(!n&&r.model&&(n=r.modelProviderName?r.model:await Ro.resolveModelIdFromFamily(t,r.model)),!n)throw new Error("A model id is required: provide `modelInfo.id` or the deprecated `model` field.");return{...e.modelInfo,id:n,providerName:e.modelInfo?.providerName??r.modelProviderName}}a(gbt,"resolveTurnModelInfo");function Abt(t,e){let r=t.resolvedModelConfiguration;return{modelName:r?.uiName??e.id,modelProviderName:e.providerName,userRequestedModel:e.id,reasoningEffort:e.reasoningEffort,chatMode:t.chatMode?.kind,agentSlug:t.agent?.agentSlug,billingMultiplier:l7i(r)}}a(Abt,"buildTurnSummary");p();function ybt(t,e,r,n,o,s){let c={lspMethod:e,conversationId:String(r.id),turnId:String(n.id)};G$(c,"modelName",o.modelName),G$(c,"modelProviderName",o.modelProviderName),G$(c,"userRequestedModel",o.userRequestedModel),G$(c,"reasoningEffort",o.reasoningEffort),G$(c,"chatMode",o.chatMode),G$(c,"agentSlug",o.agentSlug);let l={};G$(l,"billingMultiplier",o.billingMultiplier),G$(l,"credits",s),_t(t,"conversation.turnCompleted",c,l)}a(ybt,"sendTurnTelemetry");function Ebt(t){if(t!==void 0)return t%1===0?t.toString():t.toFixed(1)}a(Ebt,"formatCredits");function G$(t,e,r){r!==void 0&&(t[e]=r)}a(G$,"assignDefined");var UTc=S.Object({conversationId:S.Optional(UKe),workDoneToken:S.Union([S.String(),S.Number()]),turns:S.Array(tCn,{minItems:1}),capabilities:S.Optional(S.Object({allSkills:S.Optional(S.Boolean()),skills:S.Optional(S.Array(S.String()))})),doc:S.Optional(RC),textDocument:S.Optional(RC),selection:S.Optional(pf),visibleRanges:S.Optional(fbt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(nO)),source:S.Optional(iO),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),ignoredSkills:S.Optional(S.Array(S.String())),userLanguage:S.Optional(S.String()),model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(HKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),todoList:S.Optional(S.Array(GKe)),restoreToTurnId:S.Optional(S.String())});async function QTc(t,e,r){Lye.validate(r.workspaceFolders);let n=await J4(t,r,e),o=await t.get(Go).createOrRestore({...r,restoreToTurnId:r.restoreToTurnId});r.todoList!==void 0&&t.get(tm).setTodos(o,r.todoList);let s=await gbt(t,r),c=o.turns.length>0?r.turns.slice(-1):r.turns;await qTc(t,o,{...r,turns:c},s.id,n);let l=o.turns[o.turns.length-1],u=Bye(r),d=t.get(YD).add(u.progressToken,e),f=new Vx(t,o,l,d),h=await t.get(KD).createProcessor(f,u.progressToken,r.computeSuggestions),m=t.get(uu),g=String(l.id);m.resetTurnCredits(g);let A;try{await h.process(u,d,void 0,n,s),A=m.getCreditsForTurn(g)}finally{m.resetTurnCredits(g)}let y=Abt(l,s);return ybt(t,"conversation/create",o,l,y,A),[{conversationId:o.id,turnId:l.id,agentSlug:y.agentSlug,modelName:y.modelName,modelProviderName:y.modelProviderName,billingMultiplier:y.billingMultiplier,modelInfo:r.modelInfo,credits:Ebt(A)},null]}a(QTc,"handleConversationCreateChecked");async function qTc(t,e,r,n,o){for(let s of r.turns){let c=qKe(s.request),l=new Yf({message:c,type:"user"},s.turnId);s.response&&(l.response={message:s.response,type:"model"}),s.agentSlug&&(l.agent={agentSlug:s.agentSlug});let u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:mbt(u),f=t.get(I_),h=EQ(r.chatMode);l.chatMode=await f.getChatMode(h,r.customChatModeId,d),l.userRequestedModel=s.model??n,l.needToolCallConfirmation=r.needToolCallConfirmation;let m=pbt({textDocument:o,selection:r.selection,visibleRanges:r.visibleRanges});await t.get(Go).addTurn(e.id,l,r.references,m,u,d,r.ignoredSkills,void 0)}}a(qTc,"addTurns");var u7i=je(UTc,QTc);p();var jTc=S.Object({conversationId:S.String()});function HTc(t,e,r){return t.get(Go).destroy(r.conversationId),["OK",null]}a(HTc,"handleConversationDestroyChecked");var d7i=je(jTc,HTc);p();var GTc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function $Tc(t,e,r){return[(await t.get(I_).listChatModes(r.workspaceFolders)).map(c=>({id:c.id,name:c.name,kind:c.kind,isBuiltIn:c.isBuiltIn,uri:c.uri,description:c.description,customTools:c.customTools,model:c.model,handOffs:c.handOffs})),null]}a($Tc,"handleConversationModesChecked");var f7i=je(GTc,$Tc);p();var VTc=S.Object({turnId:S.String(),acceptedFileCount:S.Number({minimum:0}),totalFileCount:S.Number({minimum:1})}),WTc=new Ae("conversationNotifyCodeAcceptance");async function zTc(t,e,r){let n=t.get(Go).findByTurnId(r.turnId);if(!n)return WTc.warn(t,`Turn with id ${r.turnId} not found`),["OK",null];let o=await Kc(t,n,{languageId:""});return IS(t,void 0,{mode:n?.turn.getChatModeForTelemetry()??"unknown",modelId:n?.turn.getResolvedModelId()??"unknown"},{acceptedFileCount:r.acceptedFileCount,totalFileCount:r.totalFileCount},`${Vy("agentPanel")}.codeAcceptance`,o),["OK",null]}a(zTc,"handleConversationNotifyCodeAcceptanceChecked");var p7i=je(VTc,zTc);p();var YTc=S.Object({});function KTc(t,e,r){return[{path:t.get(yi).directory},null]}a(KTc,"handleConversationPersistenceChecked");var h7i=je(YTc,KTc);p();p();var y5r=class{static{a(this,"TokenPreconditionCheck")}async check(e){return await e.get(Fr).resolveSession()?{type:"token",status:"ok"}:{type:"token",status:"failed"}}},E5r=class{static{a(this,"ChatEnabledPreconditionCheck")}async check(e){return{type:"chat_enabled",status:(await e.get(Ut).getToken()).envelope.chat_enabled?"ok":"failed"}}},JTc=[new y5r,new E5r],MR=class{constructor(e,r=JTc){this.ctx=e;this.checks=r;this.emitter=new no;this.onChange=this.emitter.event;ys(e,async()=>{await this.check()})}static{a(this,"PreconditionsCheck")}check(e){return e&&(this.result=void 0),this.result===void 0&&(this.result=this.requestChecks()),this.result}async requestChecks(){let e=[];this.checks.length>0&&(e=await Promise.all(this.checks.map(o=>o.check(this.ctx))));let r=e.every(o=>o.status==="ok")?"ok":"failed",n={results:e,status:r};return this.emitter.fire(n),n}};var ZTc=S.Object({forceCheck:S.Optional(S.Boolean())});async function XTc(t,e,r){let n=r.forceCheck??!1;return[await t.get(MR).check(n),null]}a(XTc,"handleConversationPreconditionsChecked");var m7i=je(ZTc,XTc);p();var eIc=S.Object({turnId:S.String(),rating:S.Number(),doc:S.Optional(RC),textDocument:S.Optional(RC),source:S.Optional(iO)});async function tIc(t,e,r){let n=await J4(t,r,e),o=FQ(r.source),s="unrated";r.rating>0?s="positive":r.rating<0&&(s="negative");let c=await Kc(t,t.get(Go).findByTurnId(r.turnId),{languageId:n?.detectedLanguageId??""}),l=`${Vy(o)}.messageRating`,u=IS(t,n,{rating:s,uiKind:o},{},l,c);return PI(t,l,u),["OK",null]}a(tIc,"handleConversationRatingChecked");var g7i=je(eIc,tIc);p();var rIc=S.Object({tools:S.Array(rCn)});function nIc(t,e,r){let n=t.get(ls);return r.tools.forEach(s=>{n.registerTool(new yq({name:s.name,description:s.description,inputSchema:s.inputSchema,confirmationMessages:s.confirmationMessages}))}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(nIc,"conversationRegisterToolsChecked");var A7i=je(rIc,nIc);p();var iIc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function oIc(t,e,r){let n=wHt(t).map(u=>({id:u.id,description:u.description,shortDescription:u.shortDescription,scopes:u.scopes,source:"builtin"})),o=t.get(sg),s=r.workspaceFolders??[],l=(await o.listCustomPrompts(s)).map(u=>({id:u.uri,name:u.name,description:u.description||"",shortDescription:"",scopes:sIc(u.mode),source:"prompt",mode:u.mode,model:u.model}));if(n.push(...l),r.workspaceFolders&&r.workspaceFolders.length>0){let f=(await t.get(em).listSkills(r.workspaceFolders)).map(h=>({id:`skill:${Ki(Xd(h.uri))}`,description:h.description||"",shortDescription:h.name,scopes:["agent-panel"],source:"skill"})).filter(h=>!n.some(m=>m.id===h.id));n.push(...f)}return[n,null]}a(oIc,"handleConversationTemplatesChecked");function sIc(t){let e=t?.trim().toLowerCase();return e==="agent"?["agent-panel"]:e==="ask"||e==="chat"?["chat-panel"]:["chat-panel","agent-panel"]}a(sIc,"getCustomPromptScopes");var y7i=je(iIc,oIc);p();var aIc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),conversationId:UKe,turnId:S.Optional(fK),message:Rqt,followUp:S.Optional(S.Object({id:S.String(),type:S.String()})),doc:S.Optional(RC),textDocument:S.Optional(RC),selection:S.Optional(pf),visibleRanges:S.Optional(fbt),computeSuggestions:S.Optional(S.Boolean()),references:S.Optional(S.Array(nO)),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),ignoredSkills:S.Optional(S.Array(S.String())),confirmationResponse:rEn,model:S.Optional(S.String()),modelProviderName:S.Optional(S.String()),modelInfo:S.Optional(S.Object({id:S.Optional(S.String()),providerName:S.Optional(S.String()),reasoningEffort:S.Optional(S.String()),contextSize:S.Optional(S.Number())})),chatMode:S.Optional(HKe),customChatModeId:S.Optional(S.String()),needToolCallConfirmation:S.Optional(S.Boolean()),agentSlug:S.Optional(S.String()),todoList:S.Optional(S.Array(GKe))});async function cIc(t,e,r){Lye.validate(r.workspaceFolders);let n=await J4(t,r,e),o=t.get(Go),s=o.get(r.conversationId);r.todoList!==void 0&&t.get(tm).setTodos(s,r.todoList);let c=qKe(r.message),l=new Yf({message:c,type:"user"},r.turnId),u=r.workspaceFolder?{uri:r.workspaceFolder}:void 0,d=r.workspaceFolders&&r.workspaceFolders.length>0?r.workspaceFolders:mbt(u),f=await gbt(t,r),h=t.get(I_),m=EQ(r.chatMode);l.chatMode=await h.getChatMode(m,r.customChatModeId,d),l.userRequestedModel=f.id,l.needToolCallConfirmation=r.needToolCallConfirmation,r.agentSlug&&(l.agent={agentSlug:r.agentSlug});let g=pbt({textDocument:n,selection:r.selection,visibleRanges:r.visibleRanges});l=await o.addTurn(s.id,l,r.references,g,u,d,r.ignoredSkills,r.confirmationResponse);let A=Bye(r),y=t.get(YD).add(A.progressToken,e),E=new Vx(t,s,l,y),_=await t.get(KD).createProcessor(E,A.progressToken,r.computeSuggestions),v=t.get(uu),b=String(l.id);v.resetTurnCredits(b);let T;try{await _.process(A,y,r.followUp,n,f),T=v.getCreditsForTurn(b)}finally{v.resetTurnCredits(b)}let w=Abt(l,f);return ybt(t,"conversation/turn",s,l,w,T),[{conversationId:s.id,turnId:l.id,agentSlug:w.agentSlug,modelName:w.modelName,modelProviderName:w.modelProviderName,billingMultiplier:w.billingMultiplier,modelInfo:r.modelInfo,credits:Ebt(T)},null]}a(cIc,"handleConversationTurnChecked");var E7i=je(aIc,cIc);p();var lIc=S.Object({conversationId:S.String(),turnId:S.String(),source:S.Optional(iO)});async function uIc(t,e,r){t.get(Go).deleteTurn(r.conversationId,r.turnId);let o=FQ(r.source),s=await Kc(t,t.get(Go).findByTurnId(r.turnId),{languageId:""});return IS(t,void 0,{messageId:r.turnId,uiKind:o,conversationId:r.conversationId},{},`${Vy(o)}.messageDelete`,s),["OK",null]}a(uIc,"handleConversationTurnDeleteChecked");var _7i=je(lIc,uIc);p();var dIc=S.Object({toolIds:S.Array(S.String())});function fIc(t,e,r){let n=t.get(ls);return r.toolIds.forEach(s=>{n.unregisterTool(s)}),[n.getToolsForModel().filter(s=>s.type!=="mcp"),null]}a(fIc,"conversationUnregisterToolsChecked");var v7i=je(dIc,fIc);p();var pIc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),tools:S.Array(S.Object({name:S.String(),status:S.Enum(o3)}))});async function hIc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(I_).getChatMode(n?EQ(n):"Agent",o,s),l=t.get(ls),u=r.tools.map(({name:f,status:h})=>({toolName:f,status:h}));return await l.updateToolsStatusByName(c,u),[l.getToolsForModel(c).filter(f=>f.type!=="mcp"),null]}a(hIc,"conversationUpdateToolsStatusChecked");var C7i=je(pIc,hIc);p();p();As();var mIc=5e3,Ane=class{static{a(this,"ThinkingTitleGenerateService")}buildPrompt(e){let r;return e.extractedTitles&&e.extractedTitles.length>0?r=e.extractedTitles.join(", "):r=(e.thinkingContent??"").substring(0,1e3),`Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly: OUTPUT FORMAT: - MUST be a single sentence @@ -3798,16 +3863,16 @@ EXAMPLES WITH RAW THINKING TEXT: - "The error seems to be coming from the database connection..." \u2192 "Investigated database connection issue" - "Looking at the UserService class, I see it handles..." \u2192 "Reviewed UserService implementation" -Content: ${r}`}async generateTitle(e,r,n){let o=new qn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),cwc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new rc(e),u=await Uo.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Qt).getToken(),h=await e.get(Jt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:gA.user("conversation-panel",gr())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);Ye.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),gt(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var lwc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function uwc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:Ke.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Sne).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:Ke.InternalError,message:"Failed to generate thinking title"}]}a(uwc,"handleThinkingTitleGenerateChecked");var R7i=Ne(lwc,uwc);p();p();p();var Nbt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var zye=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(Nbt,"")}static extractSuggestionAndText(e){Nbt.lastIndex=0;let n=Nbt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` +Content: ${r}`}async generateTitle(e,r,n){let o=new jn.CancellationTokenSource,s=setTimeout(()=>o.cancel(),mIc),c=r.onCancellationRequested(()=>o.cancel());try{let l=new rc(e),u=await Ro.getModelConfiguration(e,"suggestions"),d=[{role:"user",content:this.buildPrompt(n)}],f=await e.get(Ut).getToken(),h=await e.get(Jt).updateExPValuesAndAssignments(f),m=await l.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:_A.user("conversation-panel",ir())},o.token,h);if(m.type!=="success"){let A="reason"in m?m.reason:"unknown";this.reportFailure(e,m.type,A);return}let g=m.value.trim();if(g.includes("can't assist with that")){this.reportFailure(e,"refused","model refused to assist");return}return g}catch(l){let u=l instanceof Error?l.message:String(l);this.reportFailure(e,"exception",u);return}finally{clearTimeout(s),c.dispose(),o.dispose()}}reportFailure(e,r,n){let o=n.replace(/\n/g," ").substring(0,360);ot.debug(e,`Failed to generate thinking title: errorType='${r}', reason: ${o}`),_t(e,"thinkingTitle.generateFailed",{errorType:r,errorMessage:o})}};var gIc=S.Object({thinkingContent:S.Optional(S.String()),extractedTitles:S.Optional(S.Array(S.String()))});async function AIc(t,e,r){if(!r.thinkingContent&&(!r.extractedTitles||r.extractedTitles.length===0))return[null,{code:it.InvalidRequest,message:"No thinking content or extracted titles provided"}];if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let o=await t.get(Ane).generateTitle(t,e,{thinkingContent:r.thinkingContent,extractedTitles:r.extractedTitles});return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was cancelled"}]:o?[{title:o},null]:[null,{code:it.InternalError,message:"Failed to generate thinking title"}]}a(AIc,"handleThinkingTitleGenerateChecked");var b7i=je(gIc,AIc);p();p();p();var _bt=/```suggestion(\u0020*(\r\n|\n))((?[\s\S]*?)(\r\n|\n))?```/g;var Fye=class t{static{a(this,"CodeReviewResponseParser")}static findFirstNonWhitespaceCharacterIndex(e){let r=e.match(/\S/);return r?r.index:e.length}static removeSuggestion(e){return e.replaceAll(_bt,"")}static extractSuggestionAndText(e){_bt.lastIndex=0;let n=_bt.exec(e)?.groups?.suggestion||null,o=t.removeSuggestion(e);return{suggestion:n,textWithoutSuggestion:o}}static ghCommentToReviewComment(e,r){let n=r.headContent.split(` `),o=n[e.data.line-1],s=e.data.start_line?e.data.start_line-1:e.data.line-1,c=n[s],l=o.trimEnd().length,u={start:{line:e.data.start_line?e.data.start_line+r.startLineOffset-1:e.data.line+r.startLineOffset-1,character:t.findFirstNonWhitespaceCharacterIndex(c)},end:{line:e.data.line+r.startLineOffset-1,character:l}},d=e.data.body,{suggestion:f,textWithoutSuggestion:h}=t.extractSuggestionAndText(d);return{uri:r.uri,range:u,message:h,kind:e.data.problem_type,severity:"medium",suggestion:f}}static parseLine(e){if(e==="data: [DONE]")return[];if(e==="")return[];let r=JSON.parse(e.replace("data: ",""));return Array.isArray(r.copilot_references)&&r.copilot_references.length>0?r.copilot_references.filter(n=>n.type):[]}static parseReviewResponse(e,r){let n=e.split(` -`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var Mbt=require("path");var Yye=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Qt).getToken(),o=LI(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=Gm(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=pl();try{return await P7(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=XL(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=pl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Qt).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(P0(d))throw d;let f=pl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{kWe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,Mbt.basename)(e,(0,Mbt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(pf).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();Ns();var Kye=class t{constructor(e,r={}){this.ctx=e;this.id=gr(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return jt.createAndMarkAsIssued(r)}telemetrySent(){ht(this.ctx,"request.sent",this.telemetryData),gt(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){ht(this.ctx,"request.response",this.telemetryData),gt(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(Fh(e,"name")??""),this.telemetryData.properties.code=String(Fh(e,"code")??""),this.telemetryData.properties.errno=String(Fh(e,"errno")??""),this.telemetryData.properties.type=String(Fh(e,"type")??""),ht(this.ctx,"request.error",this.telemetryData),gt(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var Obt=class t extends Yye{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new Kye(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(Cc),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var dwc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),fwc=S.Object({changes:S.Array(dwc),workspaceFolders:S.Optional(S.Array(Lc))}),CLe;async function pwc(t,e,r){CLe&&(CLe.cancel(),CLe.dispose()),CLe=new qn.CancellationTokenSource;let n=new qE([e,CLe.token]),o=new Obt(t,r.changes,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ke.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Dr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:Ke.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:zye.parseReviewResponse(u,d)},null]}a(pwc,"handleCopilotCodeReviewReviewChangesChecked");var k7i=Ne(fwc,pwc);p();p();var Bbt=class t extends Yye{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new Kye(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(Cc),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var hwc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),mwc=S.Object({snippets:S.Array(hwc),workspaceFolders:S.Optional(S.Array(Lc))}),vLe;async function gwc(t,e,r){vLe&&(vLe.cancel(),vLe.dispose()),vLe=new qn.CancellationTokenSource;let n=new qE([e,vLe.token]),o=new Bbt(t,r.workspaceFolders);if(!(await t.get(Qt).getToken()).isCopilotCodeReviewEnabled)return[null,{code:Ke.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:Ke.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:zye.parseReviewResponse(u,d)},null]}a(gwc,"handleCopilotCodeReviewReviewSnippetsChecked");var P7i=Ne(mwc,gwc);p();p();var Lbt=Symbol("onMCPToolsListChanged"),Fbt=Symbol("onMCPResourcesListChanged"),Ubt=Symbol("onMCPPromptsListChanged"),D7i=Symbol("onMCPResourceUpdated"),rV=Symbol("onMCPCacheUpdated");function N7i(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(N7i,"normalizeMcpHeaders");var jE=class{static{a(this,"McpManager")}};var Awc=S.Object({}),ywc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(JL)}))}))}),Ewc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),_wc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),Cwc=S.Object({serverName:S.String(),uri:S.String()}),vwc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function bwc(t,e,r){return[t.get(jE).getAllContents(),null]}a(bwc,"handleGetMCPContentsChecked");async function Swc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(x_).getChatMode(n?eQ(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(jE).updateMCPToolsStatus(c,l),[t.get(jE).getAllContents(c),null]}a(Swc,"handleUpdateMCPToolsStatusChecked");async function Twc(t,e,r){return[await t.get(jE).readResource(r.serverName,r.uri),null]}a(Twc,"handleReadResourceChecked");async function Iwc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(jE).getPrompt(n,o,s),null]}a(Iwc,"handleGetPromptChecked");async function xwc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(jE).completePrompt(n,o,s,c,l),null]}a(xwc,"handleCompletePromptChecked");async function wwc(t,e,r){let n=t.get(jE),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(wwc,"handleMCPServerActionChecked");var M7i=Ne(Awc,bwc),O7i=Ne(ywc,Swc),B7i=Ne(Cwc,Twc),L7i=Ne(Ewc,Iwc),F7i=Ne(_wc,xwc),U7i=Ne(vwc,wwc);p();var Rwc=S.Object({});async function kwc(t,e,r){let n=await t.get(Qt).getToken();return[Mwc(t,await t.get(dc).getMetadata(),n),null]}a(kwc,"handleCopilotModelsChecked");function Pwc(t){if((t.capabilities.supports?.reasoning_effort?.length??0)<=1)return!1;let r=t.supported_endpoints;return r?.includes(NLt.Responses)?!0:r?.includes(NLt.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!1}a(Pwc,"supportReasoningEffortLevel");function Dwc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Xae.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(Dwc,"getModelScopes");function Nwc(t){return t.capabilities.family===_An?!1:t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(Nwc,"shouldExposeModel");function Mwc(t,e,r){let n=[];return e.forEach(o=>{Nwc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:Dwc(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:Pwc(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0}:void 0,degradationReason:gan(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(uu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:MS,modelName:Mze,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:MS,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(Mwc,"filterModels");var Q7i=Ne(Rwc,kwc);p();var Owc=S.Object({});async function Bwc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(dc).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(Bwc,"handleCopilotModelsGetModelMetadataListChecked");var q7i=Ne(Owc,Bwc);p();var Lwc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function Fwc(t,e,r){return r.model&&r.status==="enabled"?await t.get(dc).acceptModelPolicy(r.model)?["OK",null]:[null,{code:Ke.InternalError,message:"Failed to accept model policy"}]:[null,{code:Ke.InvalidRequest,message:"Invalid model or status"}]}a(Fwc,"handleCopilotModelsPolicyChecked");var j7i=Ne(Lwc,Fwc);p();p();p();p();Ns();function Uwc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(Uwc,"panelPositionForDocument");async function*H7i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(H7i,"trimChoices");var Jye=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=Uwc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function F5r(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await F5r(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(F5r,"reportSolutions");async function U5r(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:U5r(t,e)}}a(U5r,"generateSolutionsStream");function Qbt(t){return t.replace(/\s+/g,"")}a(Qbt,"normalizeCompletionText");async function G7i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=R7(t,l.uri),d=gr(),f=jt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await rhe(t,d,pX(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=Ll.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...hoe(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),ht(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(G7i,"setupPromptAndTelemetry");function $7i(t,e,r,n,o,s){let c=t.get(eP).forLanguage(t,e.detectedLanguageId,s),l=AS(e.detectedLanguageId),u=Yat(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` +`),o=[];for(let s of n){let c=t.parseLine(s);for(let l of c.filter(u=>u.type==="github.generated-pull-request-comment")){if(l.data.side!=="RIGHT")continue;let u=r.find(f=>f.path===l.data.path);if(!u)continue;let d=t.ghCommentToReviewComment(l,u);o.push(d)}}return o}};p();p();var vbt=require("path");var Uye=class t{constructor(e,r){this.ctx=e;this.workspaceFolders=r}static{a(this,"BaseReviewProvider")}static{this.DEFAULT_TIMEOUT=120*1e3}static{this.CODING_GUIDELINES_START_INDEX=2}static{this.CODE_REVIEW_ENDPOINT_SERVICE="api"}static{this.CODE_REVIEW_ENDPOINT_PATH="agents/github-code-review"}static{this.CODE_REVIEW_MODE_HEADER="X-Copilot-Code-Review-Mode"}static{this.CODE_REVIEW_MODE_VALUE="ide"}static{this.COPILOT_INTEGRATION_ID_HEADER="Copilot-Integration-Id"}static{this.GITHUB_CODING_GUIDELINE="github.coding_guideline"}static{this.CODING_GUIDELINE="coding-guideline"}static{this.UI_KIND="codeReview"}async fetchCodeReview(e,r){let n=await this.ctx.get(Ut).getToken(),o=NI(this.ctx,n,t.CODE_REVIEW_ENDPOINT_SERVICE,t.CODE_REVIEW_ENDPOINT_PATH),c=lA(this.ctx)[t.COPILOT_INTEGRATION_ID_HEADER];this.telemetryTracker.telemetrySent();let l=dl();try{return await KV(this.ctx,o,n.token,void 0,this.telemetryTracker.headerRequestId,e,r,{[t.CODE_REVIEW_MODE_HEADER]:t.CODE_REVIEW_MODE_VALUE,[t.COPILOT_INTEGRATION_ID_HEADER]:c},t.DEFAULT_TIMEOUT).then(d=>{let f=c3(d);this.telemetryTracker.telemetryData.extendWithRequestId(f);let h=dl()-l;return this.telemetryTracker.telemetryData.measurements.totalTimeMs=h,this.telemetryTracker.telemetryResponse(),(d.status===401||d.status===403)&&this.ctx.get(Ut).resetToken("code_review_fetch",d.status),d}).catch(d=>{if(D0(d))throw d;let f=dl()-l;throw this.telemetryTracker.telemetryData.measurements.totalTimeMs=f,this.telemetryTracker.telemetryError(d),d})}finally{eYe(this.ctx).catch(()=>{})}}getCodingGuidelineName(e){return(0,vbt.basename)(e,(0,vbt.extname)(e))}async buildCodingGuideline(e){return!this.workspaceFolders||this.workspaceFolders.length===0?[]:(await this.ctx.get(ff).collectAllInstructions(this.ctx,this.workspaceFolders.map(o=>({uri:o.uri})),{includeCopilotInstructions:!0,includeCustomInstructionFiles:!0},e)).map((o,s)=>({type:"github.coding_guideline",id:(s+t.CODING_GUIDELINES_START_INDEX).toString(),data:{id:s+t.CODING_GUIDELINES_START_INDEX,type:"coding-guideline",name:o.description??this.getCodingGuidelineName(o.uri),description:o.content,filePatterns:o.applyTo?[o.applyTo]:[]}}))}};p();As();var Qye=class t{constructor(e,r={}){this.ctx=e;this.id=ir(),this.telemetryData=t.createTelemetryData(this.id).extendedBy(r)}static{a(this,"CopilotCodeReviewTelemetry")}static createTelemetryData(e){let r={headerRequestId:e};return Vt.createAndMarkAsIssued(r)}telemetrySent(){yt(this.ctx,"request.sent",this.telemetryData),_t(this.ctx,"request.sent",this.telemetryData.properties,this.telemetryData.measurements)}telemetryResponse(){yt(this.ctx,"request.response",this.telemetryData),_t(this.ctx,"request.response",this.telemetryData.properties,this.telemetryData.measurements)}telemetryError(e){this.telemetryData.properties.message=String(qh(e,"name")??""),this.telemetryData.properties.code=String(qh(e,"code")??""),this.telemetryData.properties.errno=String(qh(e,"errno")??""),this.telemetryData.properties.type=String(qh(e,"type")??""),yt(this.ctx,"request.error",this.telemetryData),_t(this.ctx,"request.error",this.telemetryData.properties,this.telemetryData.measurements)}get headerRequestId(){return this.id}};var Cbt=class t extends Uye{constructor(r,n,o){super(r,o);this.changes=n;this.name="ReviewChangesProvider";this.telemetryTracker=new Qye(r,{mode:"reviewChanges",uiKind:t.UI_KIND})}static{a(this,"ReviewChangesProvider")}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async changesToReference(){let r=this.ctx.get(ec),n=[],o=await Promise.allSettled(this.changes.map(s=>r.evaluate(s.uri,s.headContent)));for(let s=0;s({path:s.path,content:s.headContent})),baseFileContents:n.map(s=>({path:s.path,content:s.baseContent}))}}}async buildCodingGuideline(){return super.buildCodingGuideline(this.changes.map(r=>r.uri))}async createReviewRequest(){return{messages:[{role:"user",copilot_references:[await this.changesToReference(),...await this.buildCodingGuideline()]}]}}};var yIc=S.Object({uri:S.String(),path:S.String(),baseContent:S.String(),headContent:S.String()}),EIc=S.Object({changes:S.Array(yIc),workspaceFolders:S.Optional(S.Array(Mc))}),cLe;async function _Ic(t,e,r){cLe&&(cLe.cancel(),cLe.dispose()),cLe=new jn.CancellationTokenSource;let n=new FE([e,cLe.token]),o=new Cbt(t,r.changes,r.workspaceFolders);if(!(await t.get(Ut).getToken()).isCopilotCodeReviewEnabled)return[null,{code:it.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(),l=await o.fetchCodeReview(c,n),u=await l.text();if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:(Dr.error(t,`Code review request failed: ${l.status}. Response: ${u}`),[null,{code:it.InternalError,message:"Failed to generate code review."}]);let d=r.changes.map(h=>({uri:h.uri,path:h.path,headContent:h.headContent,startLineOffset:0}));return[{comments:Fye.parseReviewResponse(u,d)},null]}a(_Ic,"handleCopilotCodeReviewReviewChangesChecked");var S7i=je(EIc,_Ic);p();p();var bbt=class t extends Uye{constructor(r,n){super(r,n);this.name="ReviewSnippetsProvider";this.telemetryTracker=new Qye(r,{mode:"reviewSnippets",uiKind:t.UI_KIND})}static{a(this,"ReviewSnippetsProvider")}static{this.SNIPPET_REVIEW_TYPE="snippet"}async fetchCodeReview(r,n){return super.fetchCodeReview(r,n)}async buildCodingGuideline(r){return super.buildCodingGuideline(r)}snippetsToReference(r){return{type:"github.pull_request",id:"1",data:{type:"pull-request",headFileContents:r.map(n=>({path:n.path,content:n.content})),baseFileContents:[]}}}static snippetsToSnippetFile(r){let n=r[0];return n?.startLine!==void 0&&n?.endLine!==void 0?{path:n.path,start_line:n.startLine,end_line:n.endLine}:void 0}async createReviewRequest(r){let n=this.ctx.get(ec),o=await Promise.allSettled(r.map(u=>n.evaluate(u.uri,u.content))),s=[];for(let u=0;uu.uri),l=await this.buildCodingGuideline(c);return{messages:[{role:"user",review_type:t.SNIPPET_REVIEW_TYPE,copilot_references:[this.snippetsToReference(s),...l],snippet_file:t.snippetsToSnippetFile(s)}]}}};var vIc=S.Object({uri:S.String(),path:S.String(),content:S.String(),startLine:S.Number(),endLine:S.Number()}),CIc=S.Object({snippets:S.Array(vIc),workspaceFolders:S.Optional(S.Array(Mc))}),lLe;async function bIc(t,e,r){lLe&&(lLe.cancel(),lLe.dispose()),lLe=new jn.CancellationTokenSource;let n=new FE([e,lLe.token]),o=new bbt(t,r.workspaceFolders);if(!(await t.get(Ut).getToken()).isCopilotCodeReviewEnabled)return[null,{code:it.InternalError,message:"GitHub Copilot Code Review is not enabled."}];let c=await o.createReviewRequest(r.snippets),l=await o.fetchCodeReview(c,n);if(!l.ok)return l.status===402?[null,{code:l.status,message:"You have reached your GitHub Copilot Code Review quota limit."}]:[null,{code:it.InternalError,message:"Failed to generate code review."}];let u=await l.text(),d=r.snippets.map(h=>({uri:h.uri,path:h.path,headContent:h.content,startLineOffset:h.startLine-1}));return[{comments:Fye.parseReviewResponse(u,d)},null]}a(bIc,"handleCopilotCodeReviewReviewSnippetsChecked");var T7i=je(CIc,bIc);p();p();var Sbt=Symbol("onMCPToolsListChanged"),Tbt=Symbol("onMCPResourcesListChanged"),Ibt=Symbol("onMCPPromptsListChanged"),I7i=Symbol("onMCPResourceUpdated"),$$=Symbol("onMCPCacheUpdated");function x7i(t){let e={};for(let[r,n]of Object.entries(t)){if(n===null||typeof n!="object"||!("url"in n)||n.headers===void 0){e[r]=n;continue}let{headers:o,...s}=n;e[r]={...s,requestInit:{...s.requestInit,headers:{...o,...s.requestInit?.headers}}}}return e}a(x7i,"normalizeMcpHeaders");var UE=class{static{a(this,"McpManager")}};var SIc=S.Object({}),TIc=S.Object({chatModeKind:S.Optional(S.Literal("Agent")),customChatModeId:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc)),servers:S.Array(S.Object({name:S.String(),tools:S.Array(S.Object({name:S.String(),status:S.Enum(o3)}))}))}),IIc=S.Object({serverName:S.String(),promptName:S.String(),arguments:S.Optional(S.Record(S.String(),S.String()))}),xIc=S.Object({serverName:S.String(),promptName:S.String(),argumentName:S.String(),prefix:S.String(),alreadyResolved:S.Optional(S.Record(S.String(),S.String()))}),wIc=S.Object({serverName:S.String(),uri:S.String()}),RIc=S.Object({serverName:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});function PIc(t,e,r){return[t.get(UE).getAllContents(),null]}a(PIc,"handleGetMCPContentsChecked");async function kIc(t,e,r){let{chatModeKind:n,customChatModeId:o,workspaceFolders:s}=r,c=await t.get(I_).getChatMode(n?EQ(n):"Agent",o,s),l=r.servers.flatMap(({name:d,tools:f})=>f.map(({name:h,status:m})=>({serverName:d,toolName:h,status:m})));return await t.get(UE).updateMCPToolsStatus(c,l),[t.get(UE).getAllContents(c),null]}a(kIc,"handleUpdateMCPToolsStatusChecked");async function DIc(t,e,r){return[await t.get(UE).readResource(r.serverName,r.uri),null]}a(DIc,"handleReadResourceChecked");async function NIc(t,e,r){let{serverName:n,promptName:o,arguments:s={}}=r;return[await t.get(UE).getPrompt(n,o,s),null]}a(NIc,"handleGetPromptChecked");async function MIc(t,e,r){let{serverName:n,promptName:o,argumentName:s,prefix:c,alreadyResolved:l={}}=r;return[await t.get(UE).completePrompt(n,o,s,c,l),null]}a(MIc,"handleCompletePromptChecked");async function OIc(t,e,r){let n=t.get(UE),{serverName:o,action:s}=r;switch(s){case"start":await n.startMCPServer(o);break;case"stop":await n.stopMCPServer(o);break;case"restart":await n.restartMCPServer(o);break;case"logout":await n.logoutMCPServer(o);break;case"clearOAuth":await n.clearOAuthMCPServer(o);break}return[null,null]}a(OIc,"handleMCPServerActionChecked");var w7i=je(SIc,PIc),R7i=je(TIc,kIc),P7i=je(wIc,DIc),k7i=je(IIc,NIc),D7i=je(xIc,MIc),N7i=je(RIc,OIc);p();var BIc=S.Object({});async function LIc(t,e,r){let n=await t.get(Ut).getToken();return[qIc(t,await t.get(Fa).getMetadata(),n),null]}a(LIc,"handleCopilotModelsChecked");function FIc(t){if((t.capabilities.supports?.reasoning_effort?.length??0)<=1)return!1;let r=t.supported_endpoints;return r?.includes(vLt.Responses)?!0:r?.includes(vLt.Messages)?t.capabilities.supports?.adaptive_thinking===!0:!1}a(FIc,"supportReasoningEffortLevel");function UIc(t){if(t.capabilities.type==="chat"){let e=["chat-panel","inline"];return!Gae.has(t.capabilities.family)&&t.capabilities.supports?.tool_calls&&(t.capabilities.limits?.max_prompt_tokens??0)>4e4&&e.push("agent-panel"),e}else if(t.capabilities.type==="completion")return["completion"];return[]}a(UIc,"getModelScopes");function QIc(t){return t.capabilities.family===TEn?!1:t.capabilities.type==="completion"?!0:t.model_picker_enabled===!0}a(QIc,"shouldExposeModel");function qIc(t,e,r){let n=[];return e.forEach(o=>{QIc(o)&&n.push({modelFamily:o.capabilities.family,modelName:o.name,modelPolicy:o.policy,scopes:UIc(o),id:o.id,vendor:o.vendor,preview:o.preview??!1,isChatDefault:o.is_chat_default??!1,isChatFallback:o.is_chat_fallback??!1,capabilities:{supports:{vision:o.capabilities.supports?.vision??!1,reasoningEfforts:o.capabilities.supports?.reasoning_effort,supportsReasoningEffortLevel:FIc(o)},limits:o.capabilities.limits?{maxContextWindowTokens:o.capabilities.limits.max_context_window_tokens,maxOutputTokens:o.capabilities.limits.max_output_tokens,maxInputTokens:o.capabilities.limits.max_prompt_tokens,maxNonStreamingOutputTokens:o.capabilities.limits.max_non_streaming_output_tokens}:void 0},billing:o.billing?{isPremium:o.billing?.is_premium??!0,multiplier:o.billing?.multiplier??0,tokenBasedBillingEnabled:r.userInfo?.isTBBEnabled,tokenPrices:o.billing?.token_prices?{batchSize:o.billing.token_prices.batch_size,default:o.billing.token_prices.default?{cachePrice:o.billing.token_prices.default.cache_price,inputPrice:o.billing.token_prices.default.input_price,outputPrice:o.billing.token_prices.default.output_price,maxContext:o.billing.token_prices.default.context_max}:void 0,longContext:o.billing.token_prices.long_context?{cachePrice:o.billing.token_prices.long_context.cache_price,inputPrice:o.billing.token_prices.long_context.input_price,outputPrice:o.billing.token_prices.long_context.output_price,maxContext:o.billing.token_prices.long_context.context_max}:void 0}:void 0}:void 0,degradationReason:Ysn(o),modelPickerCategory:o.model_picker_category,modelPickerPriceCategory:o.model_picker_price_category})}),t.get(lu).getPolicyValue("autoModel.enabled")!==!1&&n.push({modelFamily:P_,modelName:wYe,modelPolicy:void 0,scopes:["inline","chat-panel","agent-panel"],id:P_,preview:!1,isChatDefault:!1,isChatFallback:!1,capabilities:{supports:{vision:!0,supportsReasoningEffortLevel:!1}},billing:void 0,degradationReason:void 0}),n}a(qIc,"filterModels");var M7i=je(BIc,LIc);p();var jIc=S.Object({});async function HIc(t,e,r){let{models:n,xGithubRequestId:o}=await t.get(Fa).getModelMetadataList();return[{models:n,xGithubRequestId:o},null]}a(HIc,"handleCopilotModelsGetModelMetadataListChecked");var O7i=je(jIc,HIc);p();var GIc=S.Object({model:S.Optional(S.String()),status:S.Optional(S.String())});async function $Ic(t,e,r){return r.model&&r.status==="enabled"?await t.get(Fa).acceptModelPolicy(r.model)?["OK",null]:[null,{code:it.InternalError,message:"Failed to accept model policy"}]:[null,{code:it.InvalidRequest,message:"Invalid model or status"}]}a($Ic,"handleCopilotModelsPolicyChecked");var B7i=je(GIc,$Ic);p();p();p();p();As();function VIc(t,e){let r=e,n=t.lineAt(e.line);return n.isEmptyOrWhitespace||(r=n.range.end),r}a(VIc,"panelPositionForDocument");async function*L7i(t){for await(let e of t){let r={...e};r.completionText=r.completionText.trimEnd(),yield r}}a(L7i,"trimChoices");var qye=class{constructor(e,r,n,o){this.textDocument=e;this.startPosition=r;this.cancellationToken=n;this.solutionCountTarget=o;this.targetPosition=VIc(this.textDocument,this.startPosition)}static{a(this,"SolutionManager")}get savedTelemetryData(){return this._savedTelemetryData}set savedTelemetryData(e){this._savedTelemetryData=e}};async function _5r(t,e){let r=await t;switch(r.status){case"Solution":await e.onSolution(r.solution),await _5r(r.next,e);break;case"FinishedNormally":await e.onFinishedNormally();break;case"FinishedWithError":await e.onFinishedWithError(r.error);break}}a(_5r,"reportSolutions");async function v5r(t,e){if(t.isCancellationRequested)return{status:"FinishedWithError",error:"Cancelled"};let r=await e.next();return r.done===!0?{status:"FinishedNormally"}:{status:"Solution",solution:r.value,next:v5r(t,e)}}a(v5r,"generateSolutionsStream");function xbt(t){return t.replace(/\s+/g,"")}a(xbt,"normalizeCompletionText");async function F7i(t,e,r,n,o,s){let c=e.targetPosition,l=e.textDocument,u=T7(t,l.uri),d=ir(),f=Vt.createAndMarkAsIssued({headerRequestId:d,languageId:l.detectedLanguageId,source:r},{});e.savedTelemetryData=await t.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:l.uri,languageId:l.detectedLanguageId},f),o&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({engineName:o})),s&&(e.savedTelemetryData=e.savedTelemetryData.extendedBy({comparisonRequestId:s}));let h=await ehe(t,d,cX(l,c),e.savedTelemetryData);if(h.type==="copilotContentExclusion")return{status:"FinishedNormally"};if(h.type==="contextTooShort")return{status:"FinishedWithError",error:"Context too short"};if(h.type==="promptCancelled")return{status:"FinishedWithError",error:"Prompt cancelled"};if(h.type==="promptTimeout")return{status:"FinishedWithError",error:"Prompt timeout"};if(h.type==="promptError")return{status:"FinishedWithError",error:"Prompt error"};let m=h.prompt,g=h.trailingWs;return g.length>0&&(e.startPosition=cu.position(e.startPosition.line,e.startPosition.character-g.length)),e.savedTelemetryData=e.savedTelemetryData.extendedBy({},{...aoe(m),solutionCount:e.solutionCountTarget,promptEndPos:l.offsetAt(c)}),n.debug(t,"prompt:",m),yt(t,"solution.requested",e.savedTelemetryData),{prompt:m,trailingWs:g,telemetryData:e.savedTelemetryData,repoInfo:u,ourRequestId:d}}a(F7i,"setupPromptAndTelemetry");function U7i(t,e,r,n,o,s){let c=t.get(JP).forLanguage(t,e.detectedLanguageId,s),l=uS(e.detectedLanguageId),u=ect(e,r),d={language:e.detectedLanguageId,next_indent:u.next??0,prompt_tokens:n.prefixTokens??0,suffix_tokens:n.suffixTokens??0},f={};c==="parsing"&&!l&&(f.stop=[` `,`\r \r -`]);let h=w7(t,s),m;switch(c){case"server":m=a(()=>{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?R2e(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?R2e(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a($7i,"setupCompletionParams");var Q5r=new ge("solutions");async function Qwc(t,e){let r=e.targetPosition,n=e.textDocument,o=await G7i(t,e,"open copilot",Q5r);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=$7i(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},E=await t.get(HM).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=H7i(_),_=BTe(_,T=>eDe(t,n,r,T,!1,Q5r));let v=BTe(_,async T=>{let w=T.completionText;Q5r.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await pYn(t,n,r,T.completionText)??Ll.position(r.line,0),[x]=oH(n.getText(Ll.range(R,r)));w=x+w;let k=T.completionText;c.length>0&&k.startsWith(c)&&(k=k.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,L=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:k,insertText:w,range:Ll.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:L,copilotAnnotations:T.copilotAnnotations}});return U5r(A,v[Symbol.asyncIterator]())}a(Qwc,"launchSolutions");async function qbt(t,e,r){return t.get(as).trackCompletionJob(async()=>{let o=Qwc(t,e);return await F5r(o,r)})}a(qbt,"runSolutions");var W7i=ce(IB()),SLe=ce(Al());p();Ns();p();function jbt(t,e){let r=t.split(` -`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(jbt,"parseChallengeDoc");var qwc=S.Object({text:S.String(),score:S.Number()}),jwc=S.Object({documents:S.Array(qwc),options:S.Optional(S.Object({}))});async function Hbt(t,e,r){let n=gr();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:NI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(Hbt,"runTestSolutions");var eN=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function Hwc(t,e,r){return t.forceSet(eN,new eN(r.documents)),["OK",null]}a(Hwc,"handleTestingSetPanelCompletionDocumentsChecked");var V7i=Ne(jwc,Hwc);var z7i=eYe.type;function Gwc(t,e,r,n,o){let s=Qbt(n.completionText),c=(0,W7i.SHA256)(s).toString();return t.get(vu).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:xMr,title:`Accept completion ${o}`,arguments:[c]}}}a(Gwc,"makeCompletion");function j5r(t,e){return`${t}/${e}`}a(j5r,"progressMessage");var q5r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(ur)}async onSolution(e){this.count+=1;let r=Gwc(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(SLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:j5r(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return $wc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(SLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function $wc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(SLe.WorkDoneProgress.type,t,{kind:"end",message:j5r(r,10)})}a($wc,"reportDone");var bLe;async function Vwc(t,e,r){let n=await K6(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(ur).connection.sendProgress(SLe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:j5r(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(ur).connection.sendProgress(eYe.partialResult,l,{items:[f]})},"onCompletion"));let u=new q5r(t,r,c),d=t.get(eN);if(d.documents){let f=d.documents;await Hbt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new Jye(n,o,e,10);await qbt(t,f,u)}return u.error!==void 0?[null,{code:Ke.InternalError,message:u.error}]:[{items:s},null]}a(Vwc,"handleChecked");async function Wwc(t,e,r){bLe&&(bLe.cancel(),bLe.dispose()),bLe=new qn.CancellationTokenSource;let n=bLe.token,o=new qE([e,n]);try{return await Vwc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:Ke.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(Wwc,"handleCheckedWithAbort");var Y7i=Ne(kyn,Wwc);p();var Ywc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function Kwc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(jp).listCustomAgents(n)).map(c=>({id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri,storage:c.promptFileEntry?.promptPath?.storage})),null]}a(Kwc,"listCustomAgents");var K7i=Ne(Ywc,Kwc);p();var Jwc=new ge("customAgent/registerExtensionAgents"),Zwc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),Xwc=S.Object({extensionId:S.String(),agents:S.Array(Zwc)});function eRc(t,e,r){try{t.get(jp).registerExtensionAgent(r.extensionId,r.agents)}catch(n){Jwc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(eRc,"registerExtensionAgents");var J7i=Ne(Xwc,eRc);p();var tRc=S.Object({extensionId:S.String()});function rRc(t,e,r){return t.get(jp).unregisterExtensionAgents(r.extensionId),[null,null]}a(rRc,"unregisterExtensionAgents");var Z7i=Ne(tRc,rRc);p();var nRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function iRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(pf).listCustomInstructions(n)).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage})),null]}a(iRc,"listCustomInstructions");var X7i=Ne(nRc,iRc);p();var oRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function sRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(ag).listCustomPrompts(n)).map(c=>({uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:c.promptFileEntry?.promptPath.storage})),null]}a(sRc,"listCustomPrompts");var eQi=Ne(oRc,sRc);p();var aRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function cRc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(EA).listSkills(n)).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage})),null]}a(cRc,"listCustomSkills");var tQi=Ne(aRc,cRc);p();p();p();function lRc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(D0).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a(lRc,"urlsToCheck");async function rQi(t,e,r=HB(t),n,o){let s=lRc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await uRc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(rQi,"checkReachability");async function uRc(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(uRc,"determineReachability");var sI=ce(require("os")),Zye=ce(require("tls"));async function iQi(t,e){let r=await t.get(ar).getImplementation(),n=await t.get(Qt).getGitHubSession(),o=await t.get(Qt).getToken().catch(()=>{});return{sections:[fRc(t),dRc(t,n),pRc(t,r),await hRc(t,r,o?.endpoints,n,e)]}}a(iQi,"collectDiagnostics");function oQi(t){return t.sections.map(mRc).join(sI.EOL+sI.EOL)+sI.EOL}a(oQi,"formatDiagnosticsAsMarkdown");function dRc(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:N1(t),"GitHub Account":n,"Session ID":t.get(Fa).sessionId,"Send Restricted Telemetry":moe(t)?"enabled":"disabled","Content Exclusion":t.get(Cc).enabled?"enabled":"unavailable"}}}a(dRc,"collectCopilotSection");function fRc(t){let e={Plugin:ARc(t),Editor:gRc(t),"Operating System":`${sI.type()} ${sI.release()} (${sI.arch()})`};return oB(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(fRc,"collectEnvironmentSection");function pRc(t,e){let r=t.get(Zo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":Zye.rootCertificates.length,"TLS Default Min Version":Zye.DEFAULT_MIN_VERSION,"TLS Default Max Version":Zye.DEFAULT_MAX_VERSION};return oB(n,"http_proxy"),oB(n,"https_proxy"),oB(n,"no_proxy"),oB(n,"SSL_CERT_FILE"),oB(n,"SSL_CERT_DIR"),oB(n,"OPENSSL_CONF"),oB(n,"NODE_EXTRA_CA_CERTS"),oB(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(pRc,"collectNetworkConfigSection");async function hRc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await rQi(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(hRc,"collectReachabilitySection");function nQi(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(nQi,"quoteCode");function oB(t,e){let r=process.env[e];r&&(t[nQi(e)]=nQi(r)),r!==process.env[e.toUpperCase()]&&oB(t,e.toUpperCase())}a(oB,"addEnvironmentVariable");function mRc(t){return`## ${t.name}`+sI.EOL+sI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(sI.EOL)}a(mRc,"formatSectionAsMarkdown");function gRc(t){let e=t.get(Lr).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(gRc,"getEditorDisplayVersion");function ARc(t){let e=t.get(Lr).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(ARc,"getPluginDisplayVersion");var yRc=S.Object({});async function ERc(t,e){return[{report:oQi(await iQi(t,e))},null]}a(ERc,"handleDiagnosticsChecked");var sQi=Ne(yRc,ERc);p();var _Rc=S.Object({conversationId:S.String()});async function CRc(t,e,r){return[{spans:await t.get(BF).readSpans(r.conversationId)},null]}a(CRc,"handleGetAgentDebugLogChecked");var aQi=Ne(_Rc,CRc);p();Ns();var pQi=ce(Al());p();var cQi=require("crypto");var Xye=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new G5r(e,this.id)}},G5r=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(ur),s=(0,cQi.randomUUID)(),c=o.connection.onProgress(Zze.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(Zze.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function Gbt(t,e,r){try{let n=t.get(n0),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof Xye&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Xye&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Dr.error(t,"Failed to set context items on context providers",n)}}a(Gbt,"setContextItems");var H5r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function lQi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return df(r.uri,o,H5r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=df(r.uri,o.scheme||"",H5r)),"pattern"in o&&(s&&=df(r.uri,o.pattern||"",H5r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(lQi,"match");p();var vRc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),iV=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function bRc(t,e,r){return t.forceSet(iV,new iV(r.documents,r.basename||"")),["OK",null]}a(bRc,"handleTestingSetCompletionDocumentsChecked");var uQi=new ge("setCompletionDocuments"),fQi=Ne(vRc,bRc);function $bt(t,e,r,n){let o=t.get(iV);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){uQi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=SRc(o,r);return c&&c.length>0?dQi(c,s,e):void 0}else return uQi.debug(t,"Returning completions for all pre-set documents"),dQi(o.documents,s,e)}}a($bt,"getTestCompletions");function dQi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=jbt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` -`),range:{start:c,end:l}}})}a(dQi,"sliceAndMapCompletions");function SRc(t,e){return t.basename===ji(e)?t.documents||[]:[]}a(SRc,"getFilteredDocs");var hQi=S.Object({doc:S.Object({position:rg,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:dIe,version:S.Number()}),contextItems:S.Optional(Plr)}),TLe;async function mQi(t,e,r,n){TLe&&(TLe.cancel(),TLe.dispose()),TLe=new qn.CancellationTokenSource;let o=new qE([e,TLe.token]);r.contextItems&&Gbt(t,r.contextItems);let s=$bt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:gr(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await K6(t,r.doc,o)}catch(h){if(!(h instanceof pQi.ResponseError))throw h;switch(h.code){case Ke.CopilotNotAvailable:case Ke.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(BA).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(vu);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(mQi,"handleGetCompletionsHelper");var gQi=Ne(hQi,(t,e,r)=>mQi(t,e,r,!1)),AQi=Ne(hQi,(t,e,r)=>mQi(t,e,r,!0));p();var TRc=S.Object({});function IRc(t,e,r){return[{defaultRules:t.get(zx).getDefaultRules()},null]}a(IRc,"handleGetDefaultFileSafetyRulesChecked");var yQi=Ne(TRc,IRc);p();var EQi=ce(IB()),eEe=ce(Al());var xRc=S.Object({doc:S.Object({position:rg,uri:dIe,version:S.Number()}),panelId:S.String()});function wRc(t,e,r,n,o){let s=Qbt(o.completionText),c=(0,EQi.SHA256)(s).toString();return t.get(vu).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(wRc,"makeSolution");var $5r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(ur)}onSolution(e){return this.service.connection.sendNotification(new eEe.NotificationType("PanelSolution"),wRc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return _Qi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new eEe.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function _Qi(t,e){return e.connection.sendNotification(new eEe.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(_Qi,"reportDone");var ILe;async function RRc(t,e,r){ILe&&(ILe.cancel(),ILe.dispose()),ILe=new qn.CancellationTokenSource;let n=new qE([e,ILe.token]),o=r.doc.position,s=Ll.range(o,o),c=new $5r(t,r,s),l=t.get(eN);if(l.documents){let u=l.documents;Hbt(o,u,c)}else{let u;try{u=await K6(t,r.doc,n)}catch(f){if(!(f instanceof eEe.ResponseError))throw f;switch(f.code){case Ke.CopilotNotAvailable:case Ke.ContentModified:return kRc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new Jye(u,o,n,10);qbt(t,d,c)}return[{solutionCountTarget:10},null]}a(RRc,"handleGetPanelCompletionsChecked");async function kRc(t,e){return await _Qi(e.panelId,t.get(ur)),[{solutionCountTarget:0},null]}a(kRc,"produceEmptySolutions");var CQi=Ne(xRc,RRc);p();var PRc=S.Object({});async function DRc(t,e,r){let o=(await t.get(Qt).getToken()).userInfo,s=o.raw,l=(await t.get(Ur).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(DRc,"handleGetUserInfoChecked");var vQi=Ne(PRc,DRc);p();var NRc=S.Object({});function MRc(t,e,r){return[{version:t.get(ss).getDisplayVersion(),buildType:J9(t),runtimeVersion:`node/${process.versions.node}`},null]}a(MRc,"handleGetVersionChecked");var bQi=Ne(NRc,MRc);p();Ns();var ORc=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function BRc(t,e,r){if(r.changes.length===0)return[null,{code:Ke.InvalidRequest,message:"No changes provided"}];let n=t.get(Vo),o=n.create({capabilities:{skills:[nO]}}),s=new Gf({message:"",type:"user"});await n.addTurn(o.id,s);let c=Vye({workDoneToken:gr()});await t.get(vc).begin(o,s,c);let d=(await new Wx(t,o,s,e).skillResolver.resolve(nO))?.head?.name,h=await t.get(gZ).generateCommitMessage(t,e,r,d);return h==null?[null,{code:Ke.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(BRc,"handleGitCommitGenerateChecked");var SQi=Ne(ORc,BRc);p();var LRc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function FRc(t,e,r){try{let o=await new zy(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return ht(t,"githubApi.listPullRequestChangedFiles",jt.createAndMarkAsIssued()),gt(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(_s(t,n,"githubApi.listPullRequestChangedFiles"),gi(t,"githubApi.listPullRequestChangedFiles",n),n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(FRc,"handleListPullRequestChangedFilesChecked");var TQi=Ne(LRc,FRc);p();p();var Vbt=new ge("GitHubGraphQLClient"),Wbt=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(ar);return this.graphqlClient=CEn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){Vbt.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,Vbt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` +`]);let h=S7(t,s),m;switch(c){case"server":m=a(()=>{},"finishedCb"),d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsingandserver":m=l?E2e(t,e,o.startPosition):()=>{},d.force_indent=u.prev??-1,d.trim_by_indentation=!0;break;case"parsing":default:m=l?E2e(t,e,o.startPosition):()=>{};break}return{extra:d,postOptions:f,finishedCb:m,engineInfo:h}}a(U7i,"setupCompletionParams");var C5r=new Ae("solutions");async function WIc(t,e){let r=e.targetPosition,n=e.textDocument,o=await F7i(t,e,"open copilot",C5r);if("status"in o)return o;let{prompt:s,trailingWs:c,telemetryData:l,repoInfo:u,ourRequestId:d}=o,{extra:f,postOptions:h,finishedCb:m,engineInfo:g}=U7i(t,n,r,s,e,l),A=e.cancellationToken,y={prompt:s,languageId:n.detectedLanguageId,repoInfo:u,ourRequestId:d,engineModelId:g.modelId,count:e.solutionCountTarget,uiKind:"synthesize",postOptions:h,headers:g.headers,extra:f},E=await t.get(VM).fetchAndStreamCompletions(t,y,l.extendedBy(),m,A);if(E.type==="failed"||E.type==="canceled")return{status:"FinishedWithError",error:`${E.type}: ${E.reason}`};let _=E.choices;_=L7i(_),_=nIe(_,T=>G2e(t,n,r,T,!1,C5r));let v=nIe(_,async T=>{let w=T.completionText;C5r.info(t,`Open Copilot completion: [${T.completionText}]`);let R=await zYn(t,n,r,T.completionText)??cu.position(r.line,0),[x]=Xj(n.getText(cu.range(R,r)));w=x+w;let P=T.completionText;c.length>0&&P.startsWith(c)&&(P=P.substring(c.length));let D=T.meanLogProb,N=D!==void 0?Math.exp(D):0,B=l.extendedBy({choiceIndex:T.choiceIndex.toString()});return{completionText:P,insertText:w,range:cu.range(R,r),meanProb:N,meanLogProb:D||0,requestId:T.requestId,choiceIndex:T.choiceIndex,telemetryData:B,copilotAnnotations:T.copilotAnnotations}});return v5r(A,v[Symbol.asyncIterator]())}a(WIc,"launchSolutions");async function wbt(t,e,r){return t.get(ss).trackCompletionJob(async()=>{let o=WIc(t,e);return await _5r(o,r)})}a(wbt,"runSolutions");var q7i=fe(v9()),dLe=fe(Al());p();As();p();function Rbt(t,e){let r=t.split(` +`),n=e,o=e,s=r[e.line],c=s.indexOf("%");c!==-1&&(s=s.substring(0,c)+s.substring(c+1),n={line:e.line,character:c});let l=s.indexOf("^");if(l!==-1){let u=s.indexOf("^",l+1);if(u===-1)throw new Error("Challenge document must contain zero or two ^ characters.");s=s.substring(0,l)+s.substring(l+1,u)+s.substring(u+1),n={line:e.line,character:e.character},o={line:e.line,character:e.character+u-l-1}}return{cursorLine:s,lines:r,start:n,end:o}}a(Rbt,"parseChallengeDoc");var zIc=S.Object({text:S.String(),score:S.Number()}),YIc=S.Object({documents:S.Array(zIc),options:S.Optional(S.Object({}))});async function Pbt(t,e,r){let n=ir();for(let o=0;oh+m.length+1,0)+d.character,await r.onSolution({requestId:{headerRequestId:n,serverExperiments:"",deploymentId:""},completionText:f,insertText:f,range:{start:t,end:t},meanProb:c,meanLogProb:-1,choiceIndex:o,telemetryData:RI.createEmptyConfigForTesting()})}await r.onFinishedNormally()}a(Pbt,"runTestSolutions");var JD=class{constructor(e){this.documents=e}static{a(this,"ExternalTestingPanelCompletionDocuments")}};function KIc(t,e,r){return t.forceSet(JD,new JD(r.documents)),["OK",null]}a(KIc,"handleTestingSetPanelCompletionDocumentsChecked");var Q7i=je(YIc,KIc);var j7i=zYe.type;function JIc(t,e,r,n,o){let s=xbt(n.completionText),c=(0,q7i.SHA256)(s).toString();return t.get(vu).set(c,{displayText:n.completionText,insertText:n.insertText,offset:r,uuid:c,range:n.range,uri:e.textDocument.uri,telemetry:n.telemetryData.extendedBy({},{rank:o-1}),index:n.choiceIndex,position:e.position,resultType:0,triggerCategory:"solution",copilotAnnotations:n.copilotAnnotations,clientCompletionId:c}),{range:n.range,insertText:n.insertText,command:{command:lMr,title:`Accept completion ${o}`,arguments:[c]}}}a(JIc,"makeCompletion");function S5r(t,e){return`${t}/${e}`}a(S5r,"progressMessage");var b5r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.onCompletion=n;this.offset=0;this.count=0;this.items=new Map}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(dr)}async onSolution(e){this.count+=1;let r=JIc(this.ctx,this.params,this.offset,e,this.items.size+1);this.items.has(r.command.arguments[0])||(this.items.set(r.command.arguments[0],r),await this.onCompletion(r)),this.params.workDoneToken!==void 0&&await this.service.connection.sendProgress(dLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"report",message:S5r(this.count,10),percentage:Math.round(100*this.count/10)})}onFinishedNormally(){return ZIc(this.params.workDoneToken,this.service,this.count)}async onFinishedWithError(e){if(this.error=e,this.params.workDoneToken!==void 0)return this.service.connection.sendProgress(dLe.WorkDoneProgress.type,this.params.workDoneToken,{kind:"end",message:`Error: ${e}`})}};async function ZIc(t,e,r=0){t!==void 0&&await e.connection.sendProgress(dLe.WorkDoneProgress.type,t,{kind:"end",message:S5r(r,10)})}a(ZIc,"reportDone");var uLe;async function XIc(t,e,r){let n=await j6(t,r.textDocument,e),o=r.position;r.workDoneToken!==void 0&&await t.get(dr).connection.sendProgress(dLe.WorkDoneProgress.type,r.workDoneToken,{kind:"begin",title:"GitHub Copilot Completions Panel",cancellable:!0,message:S5r(0,10),percentage:0});let s=[],c=a(f=>(s.push(f),Promise.resolve()),"onCompletion"),l=r.partialResultToken;l!==void 0&&(c=a(async f=>{await t.get(dr).connection.sendProgress(zYe.partialResult,l,{items:[f]})},"onCompletion"));let u=new b5r(t,r,c),d=t.get(JD);if(d.documents){let f=d.documents;await Pbt(o,f,u)}else{u.offset=n.offsetAt(o);let f=new qye(n,o,e,10);await wbt(t,f,u)}return u.error!==void 0?[null,{code:it.InternalError,message:u.error}]:[{items:s},null]}a(XIc,"handleChecked");async function exc(t,e,r){uLe&&(uLe.cancel(),uLe.dispose()),uLe=new jn.CancellationTokenSource;let n=uLe.token,o=new FE([e,n]);try{return await XIc(t,o,r)}catch(s){if(n.isCancellationRequested&&!e.isCancellationRequested)return[null,{code:it.ServerCancelled,message:"Request was superseded by a new request"}];throw s}}a(exc,"handleCheckedWithAbort");var H7i=je(O_n,exc);p();var rxc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function nxc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get($p).listCustomAgents(n)).map(c=>({id:c.id,name:c.name,description:c.description,extensionId:c.extensionId,invokePolicy:c.invokePolicy,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,uri:c.promptFileEntry?.promptPath?.uri,storage:c.promptFileEntry?.promptPath?.storage})),null]}a(nxc,"listCustomAgents");var G7i=je(rxc,nxc);p();var ixc=new Ae("customAgent/registerExtensionAgents"),oxc=S.Object({uri:S.String(),name:S.String(),description:S.String()}),sxc=S.Object({extensionId:S.String(),agents:S.Array(oxc)});function axc(t,e,r){try{t.get($p).registerExtensionAgent(r.extensionId,r.agents)}catch(n){ixc.warn(t,`Failed to register extension agents for ${r.extensionId}:`,n);let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:`Failed to register extension agents: ${o}`}]}return[null,null]}a(axc,"registerExtensionAgents");var $7i=je(sxc,axc);p();var cxc=S.Object({extensionId:S.String()});function lxc(t,e,r){return t.get($p).unregisterExtensionAgents(r.extensionId),[null,null]}a(lxc,"unregisterExtensionAgents");var V7i=je(cxc,lxc);p();var uxc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function dxc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(ff).listCustomInstructions(n)).map(c=>({uri:c.uri,name:c.name,applyTo:c.applyTo,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,source:c.source,storage:c.promptFileEntry?.promptPath.storage})),null]}a(dxc,"listCustomInstructions");var W7i=je(uxc,dxc);p();var fxc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function pxc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(sg).listCustomPrompts(n)).map(c=>({uri:c.uri,name:c.name,description:c.description,isReadonly:c.isReadonly,isBuiltIn:c.isBuiltIn,storage:c.promptFileEntry?.promptPath.storage})),null]}a(pxc,"listCustomPrompts");var z7i=je(fxc,pxc);p();var hxc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function mxc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(em).listSkills(n)).map(c=>({id:c.id,name:c.name,description:c.description,uri:c.uri,storage:c.storage})),null]}a(mxc,"listCustomSkills");var Y7i=je(hxc,mxc);p();p();p();function gxc(t,e,r){let{apiUrl:n,serverUrl:o}=r||t.get(N0).getConfiguredUrls(),s=new URL("login/device",o).href,c=new URL("_ping",e.proxy).href,l=new URL("_ping",e.api).href,u=new URL("_ping",e.telemetry).href;function d(f){return new URL(f).host}return a(d,"label"),[{label:d(s),url:s},{label:d(n),url:n,session:r},{label:d(c),url:c},{label:d(l),url:l,session:r},{label:d(u),url:u}]}a(gxc,"urlsToCheck");async function K7i(t,e,r=BB(t),n,o){let s=gxc(t,r,n).map(async({label:c,url:l,session:u})=>{let{message:d,status:f}=await Axc(e,l,u,o);return{label:c,url:l,message:d,status:f}});return await Promise.all(s)}a(K7i,"checkReachability");async function Axc(t,e,r,n){try{let o=new AbortController;n?.onCancellationRequested(()=>o.abort());let s=await t.fetch(e,{headers:r?{Authorization:`Bearer ${r.accessToken}`}:{},signal:o.signal}),c=s.status>=200&&s.status<400?"reachable":"unreachable";return{message:`HTTP ${s.status}`+(s.statusText?` - ${s.statusText}`:""),status:c}}catch(o){return{message:String(o),status:"unreachable"}}}a(Axc,"determineReachability");var rI=fe(require("os")),jye=fe(require("tls"));async function Z7i(t,e){let r=await t.get(cr).getImplementation(),n=await t.get(Ut).getGitHubSession(),o=await t.get(Ut).getToken().catch(()=>{});return{sections:[Exc(t),yxc(t,n),_xc(t,r),await vxc(t,r,o?.endpoints,n,e)]}}a(Z7i,"collectDiagnostics");function X7i(t){return t.sections.map(Cxc).join(rI.EOL+rI.EOL)+rI.EOL}a(X7i,"formatDiagnosticsAsMarkdown");function yxc(t,e){let r=e&&new URL(e.serverUrl).host,n;return e?r==="github.com"?n=e.login:n=`${e.login} (${r})`:n="not signed in",{name:"Copilot",items:{Version:I1(t),"GitHub Account":n,"Session ID":t.get(Oa).sessionId,"Send Restricted Telemetry":coe(t)?"enabled":"disabled","Content Exclusion":t.get(ec).enabled?"enabled":"unavailable"}}}a(yxc,"collectCopilotSection");function Exc(t){let e={Plugin:Sxc(t),Editor:bxc(t),"Operating System":`${rI.type()} ${rI.release()} (${rI.arch()})`};return Z4(e,"NODE_OPTIONS"),{name:"Environment",items:e}}a(Exc,"collectEnvironmentSection");function _xc(t,e){let r=t.get(Yo).getHttpSettings(),n={Proxy:r.proxy||void 0,"Proxy Authorization":r.proxyAuthorization?"present":void 0,"Proxy Kerberos SPN":r.proxyKerberosServicePrincipal,"Proxy Strict SSL":r.proxyStrictSSL===!1?"disabled":"enabled","No Proxy":r.noProxy?.join(",")||void 0,Fetcher:e.name.replace(/Fetcher$/,""),"Number of Root Certificates":jye.rootCertificates.length,"TLS Default Min Version":jye.DEFAULT_MIN_VERSION,"TLS Default Max Version":jye.DEFAULT_MAX_VERSION};return Z4(n,"http_proxy"),Z4(n,"https_proxy"),Z4(n,"no_proxy"),Z4(n,"SSL_CERT_FILE"),Z4(n,"SSL_CERT_DIR"),Z4(n,"OPENSSL_CONF"),Z4(n,"NODE_EXTRA_CA_CERTS"),Z4(n,"NODE_TLS_REJECT_UNAUTHORIZED"),{name:"Network Configuration",items:n}}a(_xc,"collectNetworkConfigSection");async function vxc(t,e,r,n,o){return{name:"Reachability",items:Object.fromEntries((await K7i(t,e,r,n,o)).map(({label:c,message:l})=>[c,l]))}}a(vxc,"collectReachabilitySection");function J7i(t){return t.includes("`")?`\`\` ${t} \`\``:`\`${t}\``}a(J7i,"quoteCode");function Z4(t,e){let r=process.env[e];r&&(t[J7i(e)]=J7i(r)),r!==process.env[e.toUpperCase()]&&Z4(t,e.toUpperCase())}a(Z4,"addEnvironmentVariable");function Cxc(t){return`## ${t.name}`+rI.EOL+rI.EOL+Object.keys(t.items).filter(e=>e!=="name").map(e=>`- ${e}: ${t.items[e]??"N/A"}`).join(rI.EOL)}a(Cxc,"formatSectionAsMarkdown");function bxc(t){let e=t.get(Nr).getEditorInfo();return`${e.readableName||e.name} ${e.version}`}a(bxc,"getEditorDisplayVersion");function Sxc(t){let e=t.get(Nr).getEditorPluginInfo();return`${e.readableName||e.name} ${e.version}`}a(Sxc,"getPluginDisplayVersion");var Txc=S.Object({});async function Ixc(t,e){return[{report:X7i(await Z7i(t,e))},null]}a(Ixc,"handleDiagnosticsChecked");var eQi=je(Txc,Ixc);p();var xxc=S.Object({conversationId:S.String()});async function wxc(t,e,r){return[{spans:await t.get(EF).readSpans(r.conversationId)},null]}a(wxc,"handleGetAgentDebugLogChecked");var tQi=je(xxc,wxc);p();As();var aQi=fe(Al());p();var rQi=require("crypto");var Hye=class{static{a(this,"LspClientContextProvider")}constructor(e,r,n){this.id=r,this.selector=n,this.resolver=new I5r(e,this.id)}},I5r=class{constructor(e,r){this.ctx=e;this.id=r;this.contextItems=[];this.update=!1}static{a(this,"LspClientContextResolver")}async resolve(e,r){let n=[];if(this.contextItems.length>0)n=this.contextItems;else if(this.update){let o=this.ctx.get(dr),s=(0,rQi.randomUUID)(),c=o.connection.onProgress(VYe.type,s,l=>{n.push(...l)});r.onCancellationRequested(()=>{c?.dispose()});try{let l=await o.connection.sendRequest(VYe.type,{providerId:this.id,data:this.data,textDocument:{uri:e.documentContext.uri,languageId:e.documentContext.languageId,version:e.documentContext.version},position:e.documentContext.position,partialResultToken:s},r);n.push(...l)}finally{c?.dispose()}}return this.reset(),Promise.resolve(n)}setContextItems(e){this.contextItems=e}clearContextItems(){this.contextItems=[]}setUpdate(e){this.update=e}clearData(){this.data=void 0}reset(){this.clearContextItems(),this.clearData(),this.setUpdate(!1)}};function kbt(t,e,r){try{let n=t.get(o0),o=new Map;n.providers.forEach(s=>{o.set(s.id,s)}),e.providers.forEach(s=>{let c=o.get(s.id);c&&c instanceof Hye&&c.resolver.setContextItems(s.contextItems)}),e.updating&&e.updating.length>0&&e.updating.forEach(s=>{let c=o.get(s);c&&c instanceof Hye&&(c.resolver.setUpdate(!0),c.resolver.data=r)})}catch(n){Dr.error(t,"Failed to set context items on context providers",n)}}a(kbt,"setContextItems");var T5r={nocase:!0,matchBase:!0,nonegate:!0,dot:!0};function nQi(t,e,r){return e.map(o=>{try{if(typeof o=="string")return uf(r.uri,o,T5r);if(typeof o=="object"){let s=!0;return"language"in o&&(s&&=r.languageId==(o.language||"")),"scheme"in o&&(s&&=uf(r.uri,o.scheme||"",T5r)),"pattern"in o&&(s&&=uf(r.uri,o.pattern||"",T5r)),s}}catch{return!1}return!1}).some(Boolean)?10:0}a(nQi,"match");p();var Rxc=S.Object({documents:S.Array(S.String()),basename:S.Optional(S.String()),options:S.Optional(S.Object({}))}),W$=class{constructor(e,r){this.documents=e;this.basename=r}static{a(this,"ExternalTestingCompletionDocuments")}};function Pxc(t,e,r){return t.forceSet(W$,new W$(r.documents,r.basename||"")),["OK",null]}a(Pxc,"handleTestingSetCompletionDocumentsChecked");var iQi=new Ae("setCompletionDocuments"),sQi=je(Rxc,Pxc);function Dbt(t,e,r,n){let o=t.get(W$);if(o.documents){let s=n?3:1;if(r&&o.basename&&o.basename.trim().length>0){iQi.debug(t,`Returning filtered completions by basename ${o.basename}`);let c=kxc(o,r);return c&&c.length>0?oQi(c,s,e):void 0}else return iQi.debug(t,"Returning completions for all pre-set documents"),oQi(o.documents,s,e)}}a(Dbt,"getTestCompletions");function oQi(t,e,r){return t.slice(0,e).map(n=>{let{cursorLine:o,lines:s,start:c,end:l}=Rbt(n,r);return{insertText:[o.slice(Math.min(c.character,r.character))].concat(s.slice(r.line+1)).join(` +`),range:{start:c,end:l}}})}a(oQi,"sliceAndMapCompletions");function kxc(t,e){return t.basename===Ki(e)?t.documents||[]:[]}a(kxc,"getFilteredDocs");var cQi=S.Object({doc:S.Object({position:K0,insertSpaces:S.Optional(S.Boolean()),tabSize:S.Optional(S.Number()),uri:EIe,version:S.Number()}),contextItems:S.Optional(Wlr)}),fLe;async function lQi(t,e,r,n){fLe&&(fLe.cancel(),fLe.dispose()),fLe=new jn.CancellationTokenSource;let o=new FE([e,fLe.token]);r.contextItems&&kbt(t,r.contextItems);let s=Dbt(t,r.doc.position,r.doc.uri,n);if(s)return[{completions:s.map(m=>({uuid:ir(),text:m.insertText,displayText:m.insertText,position:r.doc.position,range:m.range,docVersion:r.doc.version}))},null];let c;try{c=await j6(t,r.doc,o)}catch(h){if(!(h instanceof aQi.ResponseError))throw h;switch(h.code){case it.CopilotNotAvailable:case it.ContentModified:return[{completions:[]},null]}throw h}let l=r.doc.position,u=await t.get(jA).getCompletions(c,l,o,{isCycling:n,formattingOptions:r.doc});if(!u)return[{completions:[]},null];let d=t.get(vu);for(let h of u)d.set(h.uuid,{...h,triggerCategory:"ghostText"});return[{completions:u.map(h=>({uuid:h.uuid,text:h.insertText,range:h.range,displayText:h.displayText,position:h.position,docVersion:c.version}))},null]}a(lQi,"handleGetCompletionsHelper");var uQi=je(cQi,(t,e,r)=>lQi(t,e,r,!1)),dQi=je(cQi,(t,e,r)=>lQi(t,e,r,!0));p();var Dxc=S.Object({});function Nxc(t,e,r){return[{defaultRules:t.get(Wx).getDefaultRules()},null]}a(Nxc,"handleGetDefaultFileSafetyRulesChecked");var fQi=je(Dxc,Nxc);p();var pQi=fe(v9()),Gye=fe(Al());var Mxc=S.Object({doc:S.Object({position:K0,uri:EIe,version:S.Number()}),panelId:S.String()});function Oxc(t,e,r,n,o){let s=xbt(o.completionText),c=(0,pQi.SHA256)(s).toString();return t.get(vu).set(c,{displayText:o.insertText,insertText:o.completionText,offset:n,uuid:c,range:r,uri:e.doc.uri,telemetry:o.telemetryData,index:o.choiceIndex,position:r.end,resultType:0,triggerCategory:"solution",copilotAnnotations:o.copilotAnnotations,clientCompletionId:c}),{panelId:e.panelId,range:r,completionText:o.completionText,displayText:o.insertText,score:o.meanProb,solutionId:c}}a(Oxc,"makeSolution");var x5r=class{constructor(e,r,n){this.ctx=e;this.params=r;this.range=n;this.offset=0}static{a(this,"SolutionHandler")}get service(){return this.ctx.get(dr)}onSolution(e){return this.service.connection.sendNotification(new Gye.NotificationType("PanelSolution"),Oxc(this.ctx,this.params,this.range,this.offset,e))}onFinishedNormally(){return hQi(this.params.panelId,this.service)}onFinishedWithError(e){return this.service.connection.sendNotification(new Gye.NotificationType("PanelSolutionsDone"),{status:"Error",message:e,panelId:this.params.panelId})}};async function hQi(t,e){return e.connection.sendNotification(new Gye.NotificationType("PanelSolutionsDone"),{status:"OK",panelId:t})}a(hQi,"reportDone");var pLe;async function Bxc(t,e,r){pLe&&(pLe.cancel(),pLe.dispose()),pLe=new jn.CancellationTokenSource;let n=new FE([e,pLe.token]),o=r.doc.position,s=cu.range(o,o),c=new x5r(t,r,s),l=t.get(JD);if(l.documents){let u=l.documents;Pbt(o,u,c)}else{let u;try{u=await j6(t,r.doc,n)}catch(f){if(!(f instanceof Gye.ResponseError))throw f;switch(f.code){case it.CopilotNotAvailable:case it.ContentModified:return Lxc(t,r)}throw f}c.offset=u.offsetAt(o);let d=new qye(u,o,n,10);wbt(t,d,c)}return[{solutionCountTarget:10},null]}a(Bxc,"handleGetPanelCompletionsChecked");async function Lxc(t,e){return await hQi(e.panelId,t.get(dr)),[{solutionCountTarget:0},null]}a(Lxc,"produceEmptySolutions");var mQi=je(Mxc,Bxc);p();var Fxc=S.Object({});async function Uxc(t,e,r){let o=(await t.get(Ut).getToken()).userInfo,s=o.raw,l=(await t.get(Fr).resolveSession())?.login;return!s||!l?[null,null]:[{userName:l,copilotPlan:o.copilotPlan,rawUserInfo:s},null]}a(Uxc,"handleGetUserInfoChecked");var gQi=je(Fxc,Uxc);p();var Qxc=S.Object({});function qxc(t,e,r){return[{version:t.get(os).getDisplayVersion(),buildType:G9(t),runtimeVersion:`node/${process.versions.node}`},null]}a(qxc,"handleGetVersionChecked");var AQi=je(Qxc,qxc);p();As();var jxc=S.Object({changes:S.Array(S.String()),userCommits:S.Array(S.String()),recentCommits:S.Array(S.String()),workspaceFolder:S.Optional(S.String()),userLanguage:S.Optional(S.String())});async function Hxc(t,e,r){if(r.changes.length===0)return[null,{code:it.InvalidRequest,message:"No changes provided"}];let n=t.get(Go),o=n.create({capabilities:{skills:[rO]}}),s=new Yf({message:"",type:"user"});await n.addTurn(o.id,s);let c=Bye({workDoneToken:ir()});await t.get(vc).begin(o,s,c);let d=(await new Vx(t,o,s,e).skillResolver.resolve(rO))?.head?.name,h=await t.get(FZ).generateCommitMessage(t,e,r,d);return h==null?[null,{code:it.InternalError,message:"Failed to generate commit message"}]:[{commitMessage:h},null]}a(Hxc,"handleGitCommitGenerateChecked");var yQi=je(jxc,Hxc);p();var Gxc=S.Object({repoOwner:S.String({minLength:1}),repoName:S.String({minLength:1}),pullRequestNumber:S.Number()});async function $xc(t,e,r){try{let o=await new Ky(t).listPullRequestFiles(r.repoOwner,r.repoName,r.pullRequestNumber);return yt(t,"githubApi.listPullRequestChangedFiles",Vt.createAndMarkAsIssued()),_t(t,"githubApi.listPullRequestChangedFiles"),[{files:o},null]}catch(n){if(La(t,n,"githubApi.listPullRequestChangedFiles"),si(t,"githubApi.listPullRequestChangedFiles",n),n instanceof Yy)return[null,{code:it.NoGitHubToken,message:n.message}];if(n instanceof Pd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a($xc,"handleListPullRequestChangedFilesChecked");var EQi=je(Gxc,$xc);p();p();var Nbt=new Ae("GitHubGraphQLClient"),Mbt=class{constructor(e){this.ctx=e;this.graphqlClient=null}static{a(this,"GitHubGraphQLClient")}async getGraphQLClient(){if(this.graphqlClient)return this.graphqlClient;let e=await this.getApiSession(),r=this.ctx.get(cr);return this.graphqlClient=Ivn.defaults({headers:{authorization:`token ${e.accessToken}`},baseUrl:e.apiUrl,request:{fetch:r.fetch.bind(r)}}),this.graphqlClient}async searchPullRequests(e){Nbt.debug(this.ctx,`Searching pull requests with query: ${e}`);let r=await this.getGraphQLClient();try{let n=[],o=null,s=!0,c=0;for(;s;){c++,Nbt.debug(this.ctx,`Fetching page ${c} of pull requests search results`);let u=await r(` query searchPullRequests($searchQuery: String!, $cursor: String) { search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) { nodes { @@ -3836,7 +3901,7 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new qn.CancellationTokenSource,s } } } - `,{searchQuery:e,cursor:o}),d=u.search.nodes.map(f=>({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return Vbt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(Vbt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Pd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Ur).resolveSession();if(!e)throw new Wy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var URc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Lc))}),IQi=4,tEe=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function QRc(t,e,r){try{let n=new Wbt(t),o=await jRc(t,r),s=await n.searchPullRequests(o);await qRc(t,s);let c=HRc(s);return ht(t,"githubApi.searchPR",jt.createAndMarkAsIssued()),gt(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof tEe)return[null,{code:n.errorCode,message:n.message}];if(n instanceof Wy)return[null,{code:Ke.NoGitHubToken,message:n.message}];if(_s(t,n,"githubApi.searchPR"),gi(t,"githubApi.searchPR",n),n instanceof Pd&&n.isClientError())return[null,{code:Ke.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:Ke.InternalError,message:`Unexpected error happened: ${o}`}]}}a(QRc,"handleSearchPRChecked");async function qRc(t,e){let r=new zy(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(qRc,"appendCopilotWorkStatus");async function jRc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Ur).resolveSession();if(!n)throw new tEe("The user is not logged in.",Ke.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new tEe("No workspace folder provided",Ke.InvalidRequest);let s=await t.get(W0).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new tEe(l,Ke.NoGitHubRepository)}}return r}a(jRc,"replaceTemplateVariables");function HRc(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(HRc,"buildCopilotWorkStatusMeasurements");var xQi=Ne(URc,QRc);p();var GRc=S.Object({workspaceFolders:S.Optional(S.Array(Lc))});async function $Rc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(Xy).listHooks(n)).map(c=>{let l={};for(let[u,d]of Object.entries(c.parsedPromptFile.hooks))d!==void 0&&(l[u]=[...d]);return{uri:c.promptPath.uri,storage:c.promptPath.storage,hooks:l}}),null]}a($Rc,"listHooks");var wQi=Ne(GRc,$Rc);p();Ns();var kQi=PUt.type,xLe;function RQi(t){return{title:"Completion Accepted",command:cDe,arguments:[t]}}a(RQi,"makeCommand");async function VRc(t,e,r){xLe&&(xLe.cancel(),xLe.dispose());let n=r.context.triggerKind===1;xLe=new qn.CancellationTokenSource;let o=xLe.token,s=new qE([e,o]);r.contextItems&&Gbt(t,r.contextItems,r.data);let c=$bt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:RQi(gr()),...g}))},null];let l=await K6(t,r.textDocument,s),u=r.position,d=await t.get(BA).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:Ke.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:Ke.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(vu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:RQi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(VRc,"handleChecked");var PQi=Ne(nYn,(t,e,r)=>VRc(t,e,r));p();p();function V5r(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return rEe(o)}a(V5r,"asReadableCert");function rEe(t){return t.replace(/\s/g,"")}a(rEe,"normalizeNewlines");var zRc=S.Object({});async function YRc(t){return[{certificates:(await t.get(rp).getAllRootCAs()).map(rEe)},null]}a(YRc,"handleListCertificatesChecked");var DQi=Ne(zRc,YRc);p();var NQi="mcpGateway/serversChanged",MQi="mcpGateway/serverDetailsChanged",OQi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),KRc=S.Object({source:OQi,name:S.String()}),JRc=S.Object({});function ZRc(t,e,r){return[{servers:t.get(pb).listServers()},null]}a(ZRc,"handleListServersChecked");var BQi=Ne(JRc,ZRc),XRc=KRc;function ekc(t,e,r){return[{details:t.get(pb).getServerDetails(r)},null]}a(ekc,"handleGetServerDetailsChecked");var LQi=Ne(XRc,ekc),tkc=S.Object({source:OQi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function rkc(t,e,r){try{return await t.get(pb).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof zj)return[null,{code:Ke.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:o}]}}a(rkc,"handleServerActionChecked");var FQi=Ne(tkc,rkc);p();p();p();var UQi=ce(Al());var W5r=class extends UQi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=Ke.InternalError){super(o,e,{errorType:r,...n})}},Tne=class extends W5r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=Ke.InternalError){super(e,r,{status:n},o)}},zbt=class extends Tne{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,Ke.NoCopilotToken)}},Ybt=class extends Tne{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var Kbt=class extends Tne{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function QQi(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(QQi,"getRegistryMetadataFromConfig");function qQi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?nkc(t,r):!1}catch{return!1}}a(qQi,"validateServerConfigurationMatch");function nkc(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(nkc,"validateRemoteURL");var jQi=300*1e3,tN=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new Kbt(u)]:[null,new Tne(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:Ke.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:Ke.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:Ke.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:Ke.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=QQi(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?qQi(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(ar).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:Ke.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:Ke.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:Ke.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var ikc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),HQi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),z5r=S.Intersect([HQi,S.Object({variables:S.Optional(S.Record(S.String(),HQi))})]),okc=S.Intersect([z5r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),skc=S.Intersect([z5r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),GQi=S.Union([okc,skc]),wLe=S.Intersect([z5r,S.Object({name:S.String()})]),akc=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(wLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(wLe))})])),runtimeArguments:S.Optional(S.Array(GQi)),packageArguments:S.Optional(S.Array(GQi)),environmentVariables:S.Optional(S.Array(wLe))}),ckc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(wLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(wLe))})]),lkc=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),ukc=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),dkc=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),fkc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(ukc)},{additionalProperties:!0}),pkc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(ikc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(lkc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(akc)),remotes:S.Optional(S.Array(ckc)),_meta:S.Optional(dkc)}),hkc=S.Object({server:pkc,_meta:fkc}),tyh=S.Object({servers:S.Array(hkc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),$Qi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),VQi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var RLe="mcp.registry.listServers",nEe="mcp.registry.getServer";async function mkc(t,e,r,n){return await t.get(tN).fetchServer(e,r,n)}a(mkc,"fetchServer");async function gkc(t,e,r){if(!r.baseUrl)return[null,{code:Ke.InvalidParams,message:"Base URL is required"}];let n=t.get(ar),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return Bm(t,RLe,jt.createAndMarkAsIssued({message:d})),[null,{code:Ke.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return ht(t,RLe,jt.createAndMarkAsIssued()),gt(t,RLe),[u,null]}catch(c){gi(t,RLe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return Bm(t,RLe,jt.createAndMarkAsIssued({message:l})),[null,{code:Ke.InternalError,message:l}]}}a(gkc,"handleListServersChecked");async function Akc(t,e,r){if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:Ke.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:Ke.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:Ke.InvalidParams,message:"Version is required"}];let[n,o]=await mkc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return Bm(t,nEe,jt.createAndMarkAsIssued(s)),gt(t,nEe,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return Bm(t,nEe,jt.createAndMarkAsIssued(c)),gt(t,nEe,c),[null,{code:Ke.InternalError,message:s}]}return ht(t,nEe,jt.createAndMarkAsIssued()),gt(t,nEe),[n,null]}a(Akc,"handleGetServerChecked");var WQi=Ne($Qi,gkc),zQi=Ne(VQi,Akc);p();p();var YQi=S.Object({}),ykc=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),Ekc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:ykc}),yyh=S.Object({mcp_registries:S.Array(Ekc)});async function _kc(t){return await t.get(tN).fetchMcpRegistryAllowlist()}a(_kc,"fetchMcpRegistryAllowlist");async function Ckc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await _kc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:Ke.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:Ke.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(Ckc,"handleGetMcpRegistryAllowlistChecked");var KQi=Ne(YQi,Ckc);p();var XQi=ce(cX()),eqi=ce(Ku()),tqi=ce(I_());p();Ns();var vkc=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),oV=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},Y5r=new ge("setNextEditDocument");function bkc(t,e,r){return Y5r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(oV,new oV(r.edits)),["OK",null]}a(bkc,"handleTestingSetNextEditDocumentChecked");var JQi=Ne(vkc,bkc);function ZQi(t,e,r,n){let o=t.get(oV);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(Y5r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(Y5r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>Skc(c,r,n)))}}a(ZQi,"getTestNextEditSuggestions");function Skc(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[gr()]}}}a(Skc,"createNextEditSuggestion");async function Tkc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=ca(r.textDocument.uri);t.get(B6).setForRequest(eqi.URI.parse(n),r.diagnostics??[]);let o=ZQi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(DC);t.get(XQi.ObservableWorkspace).onUserPositionChange(n,new tqi.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:cDe,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(Tkc,"handleChecked");var rqi=Ne(wyn,Tkc);p();var xkc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function wkc(t,e,r){let n=t.get(vu),o=n.get(r.uuid);return o&&(Rkc(r,o)==="full"?(n.delete(r.uuid),ihe(t,o,o.triggerCategory)):Flt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(wkc,"notifyAcceptedChecked");function Rkc(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));Llt(t,"ghostText",s.offset,s.uri,c),t.get(FA).resetState()}return["OK",null]}a(Nkc,"notifyRejectedChecked");var oqi=Ne(Dkc,Nkc);p();var Mkc=S.Object({uuid:S.String({minLength:1})});function Okc(t,e,r){let o=t.get(vu).get(r.uuid);return o&&Fat(t,o.triggerCategory,o),["OK",null]}a(Okc,"notifyShownChecked");var sqi=Ne(Mkc,Okc);p();var Bkc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function Lkc(t,e,r){let n=t.get(qS),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(Lkc,"handleParseTerminalCommandChecked");var aqi=Ne(Bkc,Lkc);p();var Fkc=tYn;function Ukc(t,e,r){let n=t.get(n0),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Xye(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(Ukc,"registerContextProviders");var cqi=Ne(Fkc,Ukc);p();p();var Qkc=S.Object({uri:S.Optional(S.String())}),qkc=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),uqi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[a9r]:S.Optional(Qkc),http:S.Optional(wcn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),kLe=Object.keys(uqi.properties).filter(t=>t!=="github"),jkc=S.Intersect([uqi,qkc]),Hkc=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),lqi=Ou.Compile(Hkc),K5r=Ou.Compile(jkc);function sB(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a(sB,"normalizePromptSetting");async function Zbt(t,e){if(!lqi.Check(e))throw Jbt(t),new vA(lqi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&Gkc(t,r),Jbt(t,r),Promise.resolve()}a(Zbt,"notifyChangeConfiguration");function Gkc(t,e){for(let n of K5r.Errors(e)){let o=n.path.split("/")?.[1];ys.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!K5r.Check(e))throw new vA(K5r.Errors(e));e.http&&J5r(t,e.http);let r=e["github-enterprise"];r&&N9e(t,r.uri),e.github?.copilot&&$kc(t,e.github.copilot)}a(Gkc,"applySettingsToConfiguration");function $kc(t,e){let r=t.get(Hv),n={};for(let o of Object.values(je)){let s=Pcn(e,o);n[o]=s}r.setCopilotSettings(n),xpe.clearCache(),typeof e.mcp=="string"&&oPc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(sPc(t,e.agent),aPc(t,e.agent),cPc(t,e.agent)),Vkc(t,e.globalCopilotInstructions),Wkc(t,e.globalGitCommitInstructions),zkc(t,e.globalAgentsMdInstructions),Ykc(t,e.globalClaudeMdInstructions),Kkc(t,e.globalInstructionFiles),Jkc(t,e.globalPromptFiles),tPc(t,e.instructionFileLocations),rPc(t,e.promptFileLocations),nPc(t,e.agentFileLocations),iPc(t,e.skillFileLocations)}a($kc,"applyCopilotConfiguration");function Vkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalCopilotInstructions(n)}catch(r){ys.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(Vkc,"applyGlobalCopilotInstructionsConfiguration");function Wkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalGitCommitInstructions(n)}catch(r){ys.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(Wkc,"applyGlobalGitCommitInstructionsConfiguration");function zkc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalAgentsMdInstructions(n)}catch(r){ys.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(zkc,"applyGlobalAgentsMdInstructionsConfiguration");function Ykc(t,e){try{let r=t.get(pf),n=sB(e);r.setGlobalClaudeMdInstructions(n)}catch(r){ys.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(Ykc,"applyGlobalClaudeMdInstructionsConfiguration");function Kkc(t,e){try{let r=t.get(pf),n=(e||[]).map(sB);r.setGlobalInstructionFiles(n)}catch(r){ys.error(t,"Failed to apply global instruction files configuration",r)}}a(Kkc,"applyGlobalInstructionFilesConfiguration");function Jkc(t,e){try{let r=t.get(ag),n=(e||[]).map(sB);r.setGlobalPromptFiles(n)}catch(r){ys.error(t,"Failed to apply global prompt files configuration",r)}}a(Jkc,"applyGlobalPromptFilesConfiguration");function Zkc(t){return t?Array.isArray(t)?t.map(sB):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(Zkc,"normalizeFileLocations");function Xkc(t){let e=sB(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(Xkc,"normalizeInstructionPromptSetting");function ePc(t){return t?Array.isArray(t)?t.map(Xkc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(ePc,"normalizeInstructionFileLocations");function tPc(t,e){try{let r=t.get(pf);if(e===void 0)return;r.setInstructionFileLocations(ePc(e))}catch(r){ys.error(t,"Failed to apply instruction file locations configuration",r)}}a(tPc,"applyInstructionFileLocationsConfiguration");function rPc(t,e){try{let r=t.get(ag);if(e===void 0)return;r.setPromptFileLocations(Zkc(e))}catch(r){ys.error(t,"Failed to apply prompt file locations configuration",r)}}a(rPc,"applyPromptFileLocationsConfiguration");function nPc(t,e){try{let r=t.get(jp);if(e===void 0)return;let n=e.map(sB);r.setAgentFileLocations(n)}catch(r){ys.error(t,"Failed to apply agent file locations configuration",r)}}a(nPc,"applyAgentFileLocationsConfiguration");function iPc(t,e){try{let r=t.get(EA);if(e===void 0)return;let n=e.map(sB);r.setSkillFileLocations(n)}catch(r){ys.error(t,"Failed to apply skill file locations configuration",r)}}a(iPc,"applySkillFileLocationsConfiguration");function J5r(t,e){let r=t.get(Hv);e.proxy===void 0&&(e=Rcn(r.env));try{r.setHttpSettings(LSe(e))}catch(n){if(!(n instanceof TypeError))throw n;ys.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(J5r,"applyHttpConfiguration");async function oPc(t,e){let r;try{r=N7i(JSON.parse(e||"{}"))}catch(n){ys.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(jE).updateMCPServers(r)}catch(n){ys.error(t,"Failed to apply MCP configuration to McpManager",n)}try{await t.get(pb).applyConfig(r)}catch(n){ys.error(t,"Failed to apply MCP configuration to McpServerManager",n)}}a(oPc,"applyMCPConfiguration");function sPc(t,e){try{let r=e;t.get(qS).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){ys.error(t,"Failed to apply settings configuration",r)}}a(sPc,"applyTerminalAutoApproveConfiguration");function aPc(t,e){try{let r=e;t.get(zx).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){ys.error(t,"Failed to apply edit auto approve configuration",r)}}a(aPc,"applyEditAutoApproveConfiguration");function cPc(t,e){try{let r=e;t.get(N3).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){ys.error(t,"Failed to apply MCP auto approve configuration",r)}}a(cPc,"applyMCPAutoApproveConfiguration");function Jbt(t,e){if(t.get(Hv).markReady(),!t.get(Mn).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(Ih).initialize(r)}}a(Jbt,"initializePostConfigurationDependencies");var dqi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),lPc=S.Object({editorInfo:dqi,editorPluginInfo:dqi,editorConfiguration:S.Optional(S.Object({}))});async function uPc(t,e,r){t.get(Lr).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Ult(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await Zbt(t,{settings:r.editorConfiguration}),ht(t,"setEditorInfo");for(let n of["github",...kLe])r.editorConfiguration&&n in r.editorConfiguration&&ht(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(uPc,"handleSetEditorInfoChecked");var fqi=Ne(lPc,uPc);p();var dPc=S.Object({options:S.Optional(S.Object({}))});async function fPc(t,e,r){let n=t.get(bT),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:Ke.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:Ke.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(fPc,"handleSignInConfirmChecked");var pqi=Ne(dPc,fPc);p();var pPc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function hPc(t,e,r){try{let o=await t.get(Ur).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(bT).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:qlt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof Ai))throw n;return[null,{code:Ke.DeviceFlowFailed,message:n.message}]}}a(hPc,"handleSignInInitiateChecked");var Z5r=Ne(pPc,hPc);p();p();p();var hqi=["google","apple"],Xbt=S.Optional(S.Union(hqi.map(t=>S.Literal(t))));function mqi(t){return typeof t=="string"&&hqi.includes(t)}a(mqi,"isGitHubSocialProvider");function X5r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(X5r,"isGitHubSocialProviderApplicableHostname");function gqi(t,e){if(!e)return t;try{let r=new URL(t);return X5r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(gqi,"addGitHubSocialProviderToVerificationUri");p();function Aqi(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a(Aqi,"isBrowserAvailable");function mPc(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(mPc,"getGitHubOAuthServerMetadata");async function e1t(t,e,r={},n){let o=performance.now();ohe(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!Aqi())throw new eU("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=tU(t,r.authAuthority),u=mPc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=X5r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h}),g=m.scopes||f,A=t.get(Bp).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new Ai("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Ur).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),C2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw C2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(e1t,"performGitHubOAuthCodeFlow");p();p();p();LHe();var iEe=class extends N0{constructor(r,n=new e4r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(ur);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},e4r=class extends N0{static{a(this,"SpawnUrlOpener")}async open(e){await cSe(e)}};p();var yqi=require("crypto"),Eqi=ce(require("http"));p();var t1t=new ge("OAuth Code Flow");function t4r(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n({id:f.fullDatabaseId,number:f.number,title:f.title,user:f.author,html_url:f.url,draft:f.isDraft,body:f.body,updated_at:f.updatedAt,repository:f.repository}));n.push(...d),s=u.search.pageInfo.hasNextPage,o=u.search.pageInfo.endCursor}return Nbt.debug(this.ctx,`Found ${n.length} pull requests`),n}catch(n){if(Nbt.error(this.ctx,`Failed to search pull requests with query '${e}':`,n),n&&typeof n=="object"&&"status"in n){let o=n;throw new Pd(o.status,o.message||"GitHub GraphQL API failed")}throw n}}async getApiSession(){let e=await this.ctx.get(Fr).resolveSession();if(!e)throw new Yy;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var Vxc=S.Object({query:S.String(),workspaceFolder:S.Optional(S.String()),workspaceFolders:S.Optional(S.Array(Mc))}),_Qi=4,$ye=class extends Error{static{a(this,"TemplateVariableSubstituteError")}constructor(e,r){super(e),this.errorCode=r}};async function Wxc(t,e,r){try{let n=new Mbt(t),o=await Yxc(t,r),s=await n.searchPullRequests(o);await zxc(t,s);let c=Kxc(s);return yt(t,"githubApi.searchPR",Vt.createAndMarkAsIssued()),_t(t,"githubApi.searchPR",void 0,c),[{pullRequests:s},null]}catch(n){if(n instanceof $ye)return[null,{code:n.errorCode,message:n.message}];if(n instanceof Yy)return[null,{code:it.NoGitHubToken,message:n.message}];if(La(t,n,"githubApi.searchPR"),si(t,"githubApi.searchPR",n),n instanceof Pd&&n.isClientError())return[null,{code:it.InvalidRequest,message:n.message}];if(n instanceof Error)return[null,{code:it.InternalError,message:`Unexpected error happened: ${n.message}`}];let o=JSON.stringify(n)??String(n);return[null,{code:it.InternalError,message:`Unexpected error happened: ${o}`}]}}a(Wxc,"handleSearchPRChecked");async function zxc(t,e){let r=new Ky(t);for(let n=0;n{try{c.copilotWorkStatus=await r.getCopilotWorkingStatus(c.repository.owner.login,c.repository.name,c.number,c.user?.login)}catch{c.copilotWorkStatus="not_copilot_issue"}});await Promise.all(s)}}a(zxc,"appendCopilotWorkStatus");async function Yxc(t,e){let r=e.query;if(r.includes("${user}")){let n=await t.get(Fr).resolveSession();if(!n)throw new $ye("The user is not logged in.",it.NoGitHubToken);r=r.replace(/\$\{user\}/g,n.login)}if(r.includes("${owner}")||r.includes("${repository}")){let n;if(e.workspaceFolders&&e.workspaceFolders.length>0)n=e.workspaceFolders[0];else if(e.workspaceFolder)n={uri:e.workspaceFolder};else throw new $ye("No workspace folder provided",it.InvalidRequest);let s=await t.get(z0).getRepo(n);if(s&&s.isGitHub()&&s.owner&&s.name)r=r.replace(/\$\{owner\}/g,s.owner),r=r.replace(/\$\{repository\}/g,s.name);else{let c;!s||!s.isGitHub()?c="The workspace folder is not a GitHub repository.":!s.owner&&!s.name?c="Git repository detected but both owner and repository name information are missing. Ensure the repository has a valid remote origin.":s.owner?s.name||(c="Git repository detected but repository name is missing. Ensure the repository has a valid remote origin."):c="Git repository detected but owner information is missing. Ensure the repository has a valid remote origin.";let l=`Cannot obtain GitHub information for workspace folder: ${n.uri}. Template variables \${owner} and \${repository} require a valid Git repository with remote GitHub origin configured: ${c}`;throw new $ye(l,it.NoGitHubRepository)}}return r}a(Yxc,"replaceTemplateVariables");function Kxc(t){let e=0,r=0,n=0,o=0;for(let s of t)switch(s.copilotWorkStatus){case"in_progress":e++;break;case"done":r++;break;case"error":n++;break;case"not_copilot_issue":default:o++;break}return{totalPRs:t.length,inProgressPRs:e,donePRs:r,errorPRs:n,notCopilotPRs:o}}a(Kxc,"buildCopilotWorkStatusMeasurements");var vQi=je(Vxc,Wxc);p();var Jxc=S.Object({workspaceFolders:S.Optional(S.Array(Mc))});async function Zxc(t,e,r){let n=r.workspaceFolders??[];return[(await t.get(eE).listHooks(n)).map(c=>{let l={};for(let[u,d]of Object.entries(c.parsedPromptFile.hooks))d!==void 0&&(l[u]=[...d]);return{uri:c.promptPath.uri,storage:c.promptPath.storage,hooks:l}}),null]}a(Zxc,"listHooks");var CQi=je(Jxc,Zxc);p();As();var SQi=GQt.type,hLe;function bQi(t){return{title:"Completion Accepted",command:X2e,arguments:[t]}}a(bQi,"makeCommand");async function Xxc(t,e,r){hLe&&(hLe.cancel(),hLe.dispose());let n=r.context.triggerKind===1;hLe=new jn.CancellationTokenSource;let o=hLe.token,s=new FE([e,o]);r.contextItems&&kbt(t,r.contextItems,r.data);let c=Dbt(t,r.position,r.textDocument.uri,n);if(c)return[{items:c.map(g=>({command:bQi(ir()),...g}))},null];let l=await j6(t,r.textDocument,s),u=r.position,d=await t.get(jA).getCompletions(l,u,s,{isCycling:n,selectedCompletionInfo:r.context.selectedCompletionInfo,formattingOptions:r.formattingOptions,data:r.data});if(!d)return e.isCancellationRequested?[null,{code:it.RequestCancelled,message:"Request was canceled"}]:o.isCancellationRequested?[null,{code:it.ServerCancelled,message:"Request was superseded by a new request"}]:[{items:[]},null];let f=t.get(vu);for(let m of d)f.set(m.uuid,{...m,triggerCategory:"ghostText"});return[{items:d.map(m=>({command:bQi(m.uuid),insertText:m.insertText,range:m.range}))},null]}a(Xxc,"handleChecked");var TQi=je(FYn,(t,e,r)=>Xxc(t,e,r));p();p();function w5r(t){let e=t.indexOf("-----BEGIN CERTIFICATE-----")+27,r=t.indexOf("-----END CERTIFICATE-----"),n=30,o=t.substring(e,e+n)+"..."+t.substring(r-n,r-1);return Vye(o)}a(w5r,"asReadableCert");function Vye(t){return t.replace(/\s/g,"")}a(Vye,"normalizeNewlines");var twc=S.Object({});async function rwc(t){return[{certificates:(await t.get(sp).getAllRootCAs()).map(Vye)},null]}a(rwc,"handleListCertificatesChecked");var IQi=je(twc,rwc);p();var xQi="mcpGateway/serversChanged",wQi="mcpGateway/serverDetailsChanged",RQi=S.Union([S.Object({kind:S.Literal("user")}),S.Object({kind:S.Literal("project"),workspaceFolder:S.String()}),S.Object({kind:S.Literal("plugin"),pluginId:S.String()})]),nwc=S.Object({source:RQi,name:S.String()}),iwc=S.Object({});function owc(t,e,r){return[{servers:t.get(db).listServers()},null]}a(owc,"handleListServersChecked");var PQi=je(iwc,owc),swc=nwc;function awc(t,e,r){return[{details:t.get(db).getServerDetails(r)},null]}a(awc,"handleGetServerDetailsChecked");var kQi=je(swc,awc),cwc=S.Object({source:RQi,name:S.String(),action:S.Union([S.Literal("start"),S.Literal("stop"),S.Literal("restart"),S.Literal("logout"),S.Literal("clearOAuth")])});async function lwc(t,e,r){try{return await t.get(db).serverAction({source:r.source,name:r.name},r.action),[null,null]}catch(n){if(n instanceof Gj)return[null,{code:it.InvalidRequest,message:n.message,data:{kind:n.code}}];let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:o}]}}a(lwc,"handleServerActionChecked");var DQi=je(cwc,lwc);p();p();p();var NQi=fe(Al());var R5r=class extends NQi.ResponseError{static{a(this,"BaseMcpRegistryError")}constructor(e,r,n,o=it.InternalError){super(o,e,{errorType:r,...n})}},yne=class extends R5r{static{a(this,"HttpStatusError")}constructor(e,r,n,o=it.InternalError){super(e,r,{status:n},o)}},Obt=class extends yne{static{a(this,"AuthError")}constructor(e){super("Missing or invalid authentication token for MCP registry allowlist","authError",e,it.NoCopilotToken)}},Bbt=class extends yne{static{a(this,"PermissionError")}constructor(e){super("MCP is disabled for this user","permissionError",e)}};var Lbt=class extends yne{static{a(this,"TransientError")}constructor(e){let r=`Transient server error when fetching MCP registry allowlist: HTTP ${e}`;super(r,"transientError",e)}};p();function MQi(t){try{if(!("x-metadata"in t))return null;let e=t["x-metadata"];if(typeof e!="object"||e===null)return null;let r=e.registry;if(typeof r!="object"||r===null)return null;let n=r,o=n.api,s=n.mcpServer;if(typeof o!="object"||o===null||typeof s!="object"||s===null)return null;let c=o,l=s;return typeof c.baseUrl=="string"&&c.baseUrl.length>0&&typeof c.version=="string"&&c.version.length>0&&typeof l.name=="string"&&l.name.length>0&&typeof l.version=="string"&&l.version.length>0?{api:{baseUrl:c.baseUrl,version:c.version},mcpServer:{name:l.name,version:l.version},...Object.fromEntries(Object.entries(n).filter(([u])=>!["api","mcpServer"].includes(u)))}:null}catch{return null}}a(MQi,"getRegistryMetadataFromConfig");function OQi(t,e){try{let r=e.server;return"command"in t?!0:"url"in t?uwc(t,r):!1}catch{return!1}}a(OQi,"validateServerConfigurationMatch");function uwc(t,e){if(!e.remotes||e.remotes.length===0)return!1;let r=a(o=>o.replace(/\/+$/,""),"normalizeUrl"),n=r(t.url);return e.remotes.some(o=>r(o.url)===n)}a(uwc,"validateRemoteURL");var BQi=300*1e3,ZD=class{constructor(e){this.allowlistCache=null;this.serverCache=null;this.ctx=e}static{a(this,"McpRegistryService")}isAllowlistCacheValid(e,r){return Date.now()-e=500&&u<600?[null,new Lbt(u)]:[null,new yne(`Failed to fetch MCP registry allowlist: HTTP ${u}`,"httpError",u)]}}try{let u=await s.text();c=JSON.parse(u)}catch(u){return[null,{code:it.InternalError,message:`Failed to parse MCP registry allowlist: ${u instanceof Error?u.message:String(u)}`}]}return!c.mcp_registries||!Array.isArray(c.mcp_registries)?[null,{code:it.InternalError,message:"Invalid allowlist format: expected mcp_registries array"}]:c.mcp_registries.some(u=>!u.url||!u.registry_access)?[null,{code:it.InternalError,message:"Invalid allowlist format: registry entries missing required fields"}]:(this.allowlistCache={timestamp:Date.now(),data:c,userLogin:r},[c,null])}catch(e){return[null,{code:it.InternalError,message:`Failed to fetch MCP registry allowlist: ${e instanceof Error?e.message:String(e)}`}]}}async validateServerConfig(e,r){try{let n=await this.getRegistryInfo();if(n.accessMode==="fallback")return{serverName:e,serverConfig:r,isBlocked:!1};let o=n.registryUrl,s=n.owner,c=await this.checkServerInRegistry(r,o);if(n.accessMode==="allow_all")return{serverName:e,serverConfig:r,isBlocked:!1,registryInfo:c.isFoundInRegistry?s?`Provided by ${s.login} organization`:"Provided by organization":void 0};{let l=!c.isFoundInRegistry;return{serverName:e,serverConfig:r,isBlocked:l,blockReason:l?c.validationError:void 0,registryInfo:l?s?`Blocked by ${s.login} organization registry policy`:"Blocked by organization registry policy":s?`Provided by ${s.login} organization`:"Provided by organization"}}}catch(n){return{serverName:e,serverConfig:r,isBlocked:!0,blockReason:`validation failed: ${n instanceof Error?n.message:String(n)}`,registryInfo:"Blocked by organization registry policy"}}}async checkServerInRegistry(e,r){let n=MQi(e);if(!n)return{isFoundInRegistry:!1,validationError:"does not have valid registry config"};let o=n.mcpServer.name,s=n.mcpServer.version,c=n.api.baseUrl,l=n.api.version,u=a(m=>m.replace(/\/+$/,""),"normalizeUrl");if(u(c)!==u(r))return{isFoundInRegistry:!1,validationError:`does not match allowed registry Url, expected: ${r}, found: ${c}`};let d=`${c.replace(/\/+$/,"")}/${l}/servers`,[f,h]=await this.fetchServer(d,o,s);return f&&!h?OQi(e,f)?{isFoundInRegistry:!0}:{isFoundInRegistry:!1,validationError:"url"in e?"remote server URL does not match any registry remote URL":"local configuration does not match registry server configuration"}:{isFoundInRegistry:!1,validationError:h?`Server validation failed: ${h.message}`:`Server not found in registry ${c}`}}async getRegistryInfo(){let[e,r]=await this.fetchMcpRegistryAllowlist();if(r)return{accessMode:"fallback",errorMessage:`Failed to fetch registry allowlist: ${r.message}`};if(!e?.mcp_registries?.length)return{accessMode:"fallback",errorMessage:"Registry allowlist is empty - allowlist feature is disabled"};let n=e.mcp_registries[0];return{accessMode:n.registry_access,registryUrl:n.url,owner:n.owner}}async fetchServer(e,r,n){let o=encodeURIComponent(r),s=encodeURIComponent(n),c=`${e}/${o}/versions/${s}`;if(this.serverCache&&this.isServerCacheValid(this.serverCache.timestamp)){let l=this.serverCache.data.get(c);if(l)return[l,null]}try{let u=await this.ctx.get(cr).fetch(c,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(u.status===404)return[null,{code:it.InternalError,message:"Server not found"}];if(!u.ok)return[null,{code:it.InternalError,message:`Failed to fetch server from registry: HTTP ${u.status}`}];let d=await u.text(),f=JSON.parse(d);return(!this.serverCache||!this.isServerCacheValid(this.serverCache.timestamp))&&(this.serverCache={timestamp:Date.now(),data:new Map}),this.serverCache.data.set(c,f),[f,null]}catch(l){return[null,{code:it.InternalError,message:`Failed to fetch server from registry: ${l instanceof Error?l.message:String(l)}`}]}}};p();var dwc=S.Object({url:S.String(),source:S.String(),id:S.String(),subfolder:S.Optional(S.String())}),LQi=S.Object({description:S.Optional(S.String()),isRequired:S.Optional(S.Boolean()),format:S.Optional(S.Union([S.Literal("string"),S.Literal("number"),S.Literal("boolean"),S.Literal("filepath")])),value:S.Optional(S.String()),isSecret:S.Optional(S.Boolean()),default:S.Optional(S.String()),placeholder:S.Optional(S.String()),choices:S.Optional(S.Array(S.String()))}),P5r=S.Intersect([LQi,S.Object({variables:S.Optional(S.Record(S.String(),LQi))})]),fwc=S.Intersect([P5r,S.Object({type:S.Literal("positional"),valueHint:S.Optional(S.String()),isRepeated:S.Optional(S.Boolean())})]),pwc=S.Intersect([P5r,S.Object({type:S.Literal("named"),name:S.String(),isRepeated:S.Optional(S.Boolean())})]),FQi=S.Union([fwc,pwc]),mLe=S.Intersect([P5r,S.Object({name:S.String()})]),hwc=S.Object({registryType:S.String(),registryBaseUrl:S.Optional(S.String()),identifier:S.String(),version:S.Optional(S.String()),fileSha256:S.Optional(S.String()),runtimeHint:S.Optional(S.String()),transport:S.Optional(S.Union([S.Object({type:S.Literal("stdio")}),S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(mLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(mLe))})])),runtimeArguments:S.Optional(S.Array(FQi)),packageArguments:S.Optional(S.Array(FQi)),environmentVariables:S.Optional(S.Array(mLe))}),mwc=S.Union([S.Object({type:S.Literal("streamable-http"),url:S.String(),headers:S.Optional(S.Array(mLe))}),S.Object({type:S.Literal("sse"),url:S.String(),headers:S.Optional(S.Array(mLe))})]),gwc=S.Object({src:S.String(),mimeType:S.Optional(S.Union([S.Literal("image/png"),S.Literal("image/jpeg"),S.Literal("image/jpg"),S.Literal("image/svg+xml"),S.Literal("image/webp")])),sizes:S.Optional(S.Array(S.String())),theme:S.Optional(S.Union([S.Literal("light"),S.Literal("dark")]))}),Awc=S.Object({status:S.Optional(S.Union([S.Literal("active"),S.Literal("deprecated"),S.Literal("deleted")])),publishedAt:S.Optional(S.String()),updatedAt:S.Optional(S.String()),isLatest:S.Optional(S.Boolean())},{additionalProperties:!1}),ywc=S.Object({"io.modelcontextprotocol.registry/publisher-provided":S.Optional(S.Object({tool:S.Optional(S.String()),version:S.Optional(S.String()),buildInfo:S.Optional(S.Object({commit:S.Optional(S.String()),timestamp:S.Optional(S.String()),pipelineId:S.Optional(S.String())}))},{additionalProperties:!0}))},{additionalProperties:!0}),Ewc=S.Object({"io.modelcontextprotocol.registry/official":S.Optional(Awc)},{additionalProperties:!0}),_wc=S.Object({name:S.String(),description:S.String(),title:S.Optional(S.String()),repository:S.Optional(dwc),version:S.String(),websiteUrl:S.Optional(S.String()),icons:S.Optional(S.Array(gwc)),$schema:S.Optional(S.String()),packages:S.Optional(S.Array(hwc)),remotes:S.Optional(S.Array(mwc)),_meta:S.Optional(ywc)}),vwc=S.Object({server:_wc,_meta:Ewc}),mAh=S.Object({servers:S.Array(vwc),metadata:S.Optional(S.Object({nextCursor:S.Optional(S.String()),count:S.Optional(S.Number())}))}),UQi=S.Object({baseUrl:S.String(),cursor:S.Optional(S.String()),limit:S.Optional(S.Number({minimum:1})),search:S.Optional(S.String()),updatedSince:S.Optional(S.String()),version:S.Optional(S.String())}),QQi=S.Object({baseUrl:S.String(),serverName:S.String(),version:S.String()});var gLe="mcp.registry.listServers",Wye="mcp.registry.getServer";async function Cwc(t,e,r,n){return await t.get(ZD).fetchServer(e,r,n)}a(Cwc,"fetchServer");async function bwc(t,e,r){if(!r.baseUrl)return[null,{code:it.InvalidParams,message:"Base URL is required"}];let n=t.get(cr),o=new URLSearchParams;r.limit!==void 0&&o.append("limit",r.limit.toString()),r.cursor!==void 0&&o.append("cursor",r.cursor),r.search!==void 0&&o.append("search",r.search),r.updatedSince!==void 0&&o.append("updated_since",r.updatedSince),r.version!==void 0&&o.append("version",r.version);let s=`${r.baseUrl}${o.toString()?`?${o.toString()}`:""}`;try{let c=await n.fetch(s,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}});if(!c.ok){let d=`MCP Registry API error: HTTP ${c.status}`;return Fm(t,gLe,Vt.createAndMarkAsIssued({message:d})),[null,{code:it.InternalError,message:d}]}let l=await c.text(),u=JSON.parse(l);return yt(t,gLe,Vt.createAndMarkAsIssued()),_t(t,gLe),[u,null]}catch(c){si(t,gLe,c);let l=`Failed to fetch servers from MCP Registry: ${c instanceof Error?c.message:String(c)}`;return Fm(t,gLe,Vt.createAndMarkAsIssued({message:l})),[null,{code:it.InternalError,message:l}]}}a(bwc,"handleListServersChecked");async function Swc(t,e,r){if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];if(!r.baseUrl)return[null,{code:it.InvalidParams,message:"Base URL is required"}];if(!r.serverName)return[null,{code:it.InvalidParams,message:"Server name is required"}];if(!r.version)return[null,{code:it.InvalidParams,message:"Version is required"}];let[n,o]=await Cwc(t,r.baseUrl,r.serverName,r.version);if(o){let s={message:o.message};return Fm(t,Wye,Vt.createAndMarkAsIssued(s)),_t(t,Wye,s),[null,o]}if(!n){let s="Failed to retrieve server data",c={message:s};return Fm(t,Wye,Vt.createAndMarkAsIssued(c)),_t(t,Wye,c),[null,{code:it.InternalError,message:s}]}return yt(t,Wye,Vt.createAndMarkAsIssued()),_t(t,Wye),[n,null]}a(Swc,"handleGetServerChecked");var qQi=je(UQi,bwc),jQi=je(QQi,Swc);p();p();var HQi=S.Object({}),Twc=S.Object({login:S.String(),id:S.Number(),type:S.String(),parent_login:S.Union([S.String(),S.Null()]),parent_id:S.Union([S.Number(),S.Null()])}),Iwc=S.Object({url:S.String(),registry_access:S.Union([S.Literal("registry_only"),S.Literal("allow_all")]),owner:Twc}),DAh=S.Object({mcp_registries:S.Array(Iwc)});async function xwc(t){return await t.get(ZD).fetchMcpRegistryAllowlist()}a(xwc,"fetchMcpRegistryAllowlist");async function wwc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Request was cancelled"}];let[n,o]=await xwc(t);return o?[null,o]:n?n.mcp_registries.length===0?[n,null]:[n,null]:[null,{code:it.InternalError,message:"Failed to retrieve MCP registry allowlist data"}]}catch(n){return[null,{code:it.InternalError,message:`Unexpected error in MCP registry allowlist handler: ${n instanceof Error?n.message:String(n)}`}]}}a(wwc,"handleGetMcpRegistryAllowlistChecked");var GQi=je(HQi,wwc);p();var WQi=fe(nX()),zQi=fe(Vu()),YQi=fe(T_());p();As();var Rwc=S.Object({edits:S.Array(S.Object({text:S.String(),range:S.Object({start:S.Object({line:S.Number(),character:S.Number()}),end:S.Object({line:S.Number(),character:S.Number()})}),predictedCursorPosition:S.Object({line:S.Number(),character:S.Number()})}))}),z$=class{constructor(e){this.edits=e}static{a(this,"ExternalTestingNextEditDocuments")}},k5r=new Ae("setNextEditDocument");function Pwc(t,e,r){return k5r.debug(t,`Set Next Edit documents: ${JSON.stringify(r)}`),t.forceSet(z$,new z$(r.edits)),["OK",null]}a(Pwc,"handleTestingSetNextEditDocumentChecked");var $Qi=je(Rwc,Pwc);function VQi(t,e,r,n){let o=t.get(z$);if(o.edits&&o.edits.length>0){let s=o.edits.filter(c=>e.line===c.predictedCursorPosition.line&&e.character===c.predictedCursorPosition.character);return s.length===0?(k5r.debug(t,`No edits match current position ${JSON.stringify(e)}, returning empty results`),[]):(k5r.debug(t,`Returning ${s.length} matching Next Edit documents`),s.map(c=>kwc(c,r,n)))}}a(VQi,"getTestNextEditSuggestions");function kwc(t,e,r){return{text:t.text,textDocument:{uri:e,version:r},range:t.range,command:{title:"Accept inline edit",command:"github.copilot.didAcceptNextEditSuggestionItem",arguments:[ir()]}}}a(kwc,"createNextEditSuggestion");async function Dwc(t,e,r){if(r.textDocument.version===void 0)throw new Error("textDocument.version is undefined");let n=ia(r.textDocument.uri);t.get(w6).setForRequest(zQi.URI.parse(n),r.diagnostics??[]);let o=VQi(t,r.position,n,r.textDocument.version);if(o)return[{edits:o},null];let s=t.get(Rv);t.get(WQi.ObservableWorkspace).onUserPositionChange(n,new YQi.Position(r.position.line,r.position.character));let c=await s.handleNextEditRequest(n,r.textDocument.version,e);return c?[{edits:c.map(u=>({text:u.edit.text,textDocument:u.edit.textDocument,range:u.edit.range,command:{title:"Accept inline edit",command:X2e,arguments:[u.id]}}))},null]:[{edits:[]},null]}a(Dwc,"handleChecked");var KQi=je(N_n,Dwc);p();var Mwc=S.Object({uuid:S.String({minLength:1}),acceptedLength:S.Optional(S.Number({minimum:1}))});function Owc(t,e,r){let n=t.get(vu),o=n.get(r.uuid);return o&&(Bwc(r,o)==="full"?(n.delete(r.uuid),rhe(t,o,o.triggerCategory)):Hlt(t,o,r.acceptedLength,0,o.triggerCategory,"cumulative")),["OK",null]}a(Owc,"notifyAcceptedChecked");function Bwc(t,e){return t.acceptedLength===void 0?"full":t.acceptedLengthn.get(s)??[]);if(o.length>0){let s=o[0];for(let l of r.uuids)n.delete(l);let c=o.map(l=>({completionText:l.displayText,completionTelemetryData:l.telemetry}));jlt(t,"ghostText",s.offset,s.uri,c),t.get(GA).resetState()}return["OK",null]}a(Qwc,"notifyRejectedChecked");var XQi=je(Uwc,Qwc);p();var qwc=S.Object({uuid:S.String({minLength:1})});function jwc(t,e,r){let o=t.get(vu).get(r.uuid);return o&&Hat(t,o.triggerCategory,o),["OK",null]}a(jwc,"notifyShownChecked");var eqi=je(qwc,jwc);p();var Hwc=S.Object({commandLine:S.String(),shell:S.Optional(S.String())});async function Gwc(t,e,r){let n=t.get(OS),o=r.shell||"sh",{subCommands:s,commandNames:c}=await n.parseTerminalCommandDetailed(r.commandLine,o);return[{subCommands:s,commandNames:c},null]}a(Gwc,"handleParseTerminalCommandChecked");var tqi=je(Hwc,Gwc);p();var $wc=BYn;function Vwc(t,e,r){let n=t.get(o0),o={unregistered:[],registered:[]};return r.providers.forEach(s=>{try{let c=new Hye(t,s.id,s.selector);n.registerContextProvider(c),o.registered.push(s.id)}catch{o.unregistered.push(s.id)}}),[o,null]}a(Vwc,"registerContextProviders");var rqi=je($wc,Vwc);p();p();var Wwc=S.Object({uri:S.Optional(S.String())}),zwc=S.Object({showEditorCompletions:S.Optional(S.Boolean()),enableAutoCompletions:S.Optional(S.Boolean()),delayCompletions:S.Optional(S.Boolean()),filterCompletions:S.Optional(S.Boolean())}),iqi=S.Object({github:S.Optional(S.Object({copilot:S.Optional(S.Object({}))})),[Q6r]:S.Optional(Wwc),http:S.Optional(dcn),telemetry:S.Optional(S.Object({telemetryLevel:S.Optional(S.String())}))}),ALe=Object.keys(iqi.properties).filter(t=>t!=="github"),Ywc=S.Intersect([iqi,zwc]),Kwc=S.Object({settings:S.Optional(S.Union([S.Object({}),S.Array(S.Unknown(),{maxItems:0})])),authProvider:S.Optional(S.Never())}),nqi=Mu.Compile(Kwc),D5r=Mu.Compile(Ywc);function X4(t){if(typeof t=="string")return{type:"content",content:t};if(t&&typeof t=="object"){let e=t;if(e.type==="file"&&typeof e.uri=="string")return{type:"file",uri:e.uri};if(e.type==="location"&&typeof e.path=="string")return{type:"location",path:e.path};if(e.type==="content"&&typeof e.content=="string")return{type:"content",content:e.content};if(typeof e.uri=="string")return{type:"file",uri:e.uri};if(typeof e.content=="string")return{type:"content",content:e.content}}return{type:"content",content:""}}a(X4,"normalizePromptSetting");async function Ubt(t,e){if(!nqi.Check(e))throw Fbt(t),new TA(nqi.Errors(e));let r=Array.isArray(e.settings)?{}:e.settings;return r&&Jwc(t,r),Fbt(t,r),Promise.resolve()}a(Ubt,"notifyChangeConfiguration");function Jwc(t,e){for(let n of D5r.Errors(e)){let o=n.path.split("/")?.[1];ns.warn(t,`Invalid ${n.path.slice(1).replace(/\//g,".")} setting:`,n.message),delete e[o]}if(!D5r.Check(e))throw new TA(D5r.Errors(e));e.http&&N5r(t,e.http);let r=e["github-enterprise"];r&&y9e(t,r.uri),e.github?.copilot&&Zwc(t,e.github.copilot)}a(Jwc,"applySettingsToConfiguration");function Zwc(t,e){let r=t.get(FC),n={};for(let o of Object.values(Je)){let s=hcn(e,o);n[o]=s}r.setCopilotSettings(n),Tpe.clearCache(),typeof e.mcp=="string"&&fRc(t,e.mcp),e.agent&&typeof e.agent=="object"&&(pRc(t,e.agent),hRc(t,e.agent),mRc(t,e.agent)),Xwc(t,e.globalCopilotInstructions),eRc(t,e.globalGitCommitInstructions),tRc(t,e.globalAgentsMdInstructions),rRc(t,e.globalClaudeMdInstructions),nRc(t,e.globalInstructionFiles),iRc(t,e.globalPromptFiles),cRc(t,e.instructionFileLocations),lRc(t,e.promptFileLocations),uRc(t,e.agentFileLocations),dRc(t,e.skillFileLocations)}a(Zwc,"applyCopilotConfiguration");function Xwc(t,e){try{let r=t.get(ff),n=X4(e);r.setGlobalCopilotInstructions(n)}catch(r){ns.error(t,"Failed to apply global Copilot instructions configuration",r)}}a(Xwc,"applyGlobalCopilotInstructionsConfiguration");function eRc(t,e){try{let r=t.get(ff),n=X4(e);r.setGlobalGitCommitInstructions(n)}catch(r){ns.error(t,"Failed to apply global Git commit instructions configuration",r)}}a(eRc,"applyGlobalGitCommitInstructionsConfiguration");function tRc(t,e){try{let r=t.get(ff),n=X4(e);r.setGlobalAgentsMdInstructions(n)}catch(r){ns.error(t,"Failed to apply global Agents.md instructions configuration",r)}}a(tRc,"applyGlobalAgentsMdInstructionsConfiguration");function rRc(t,e){try{let r=t.get(ff),n=X4(e);r.setGlobalClaudeMdInstructions(n)}catch(r){ns.error(t,"Failed to apply global Claude.md instructions configuration",r)}}a(rRc,"applyGlobalClaudeMdInstructionsConfiguration");function nRc(t,e){try{let r=t.get(ff),n=(e||[]).map(X4);r.setGlobalInstructionFiles(n)}catch(r){ns.error(t,"Failed to apply global instruction files configuration",r)}}a(nRc,"applyGlobalInstructionFilesConfiguration");function iRc(t,e){try{let r=t.get(sg),n=(e||[]).map(X4);r.setGlobalPromptFiles(n)}catch(r){ns.error(t,"Failed to apply global prompt files configuration",r)}}a(iRc,"applyGlobalPromptFilesConfiguration");function oRc(t){return t?Array.isArray(t)?t.map(X4):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(oRc,"normalizeFileLocations");function sRc(t){let e=X4(t);if(t&&typeof t=="object"){let r=t.source;if(typeof r=="string")return{...e,source:r}}return e}a(sRc,"normalizeInstructionPromptSetting");function aRc(t){return t?Array.isArray(t)?t.map(sRc):Array.isArray(t.locations)?t.locations.map(e=>({type:"location",path:e})):[]:[]}a(aRc,"normalizeInstructionFileLocations");function cRc(t,e){try{let r=t.get(ff);if(e===void 0)return;r.setInstructionFileLocations(aRc(e))}catch(r){ns.error(t,"Failed to apply instruction file locations configuration",r)}}a(cRc,"applyInstructionFileLocationsConfiguration");function lRc(t,e){try{let r=t.get(sg);if(e===void 0)return;r.setPromptFileLocations(oRc(e))}catch(r){ns.error(t,"Failed to apply prompt file locations configuration",r)}}a(lRc,"applyPromptFileLocationsConfiguration");function uRc(t,e){try{let r=t.get($p);if(e===void 0)return;let n=e.map(X4);r.setAgentFileLocations(n)}catch(r){ns.error(t,"Failed to apply agent file locations configuration",r)}}a(uRc,"applyAgentFileLocationsConfiguration");function dRc(t,e){try{let r=t.get(em);if(e===void 0)return;let n=e.map(X4);r.setSkillFileLocations(n)}catch(r){ns.error(t,"Failed to apply skill file locations configuration",r)}}a(dRc,"applySkillFileLocationsConfiguration");function N5r(t,e){let r=t.get(FC);e.proxy===void 0&&(e=fcn(r.env));try{r.setHttpSettings(SSe(e))}catch(n){if(!(n instanceof TypeError))throw n;ns.warn(t,"Invalid proxy URL",e.proxy,n),r.setHttpSettings({proxy:""})}}a(N5r,"applyHttpConfiguration");async function fRc(t,e){let r;try{r=x7i(JSON.parse(e||"{}"))}catch(n){ns.error(t,"Failed to parse MCP configuration JSON",n);return}try{await t.get(UE).updateMCPServers(r)}catch(n){ns.error(t,"Failed to apply MCP configuration to McpManager",n)}try{await t.get(db).applyConfig(r)}catch(n){ns.error(t,"Failed to apply MCP configuration to McpServerManager",n)}}a(fRc,"applyMCPConfiguration");function pRc(t,e){try{let r=e;t.get(OS).updateConfiguration(r.tools?.terminal?.autoApprove)}catch(r){ns.error(t,"Failed to apply settings configuration",r)}}a(pRc,"applyTerminalAutoApproveConfiguration");function hRc(t,e){try{let r=e;t.get(Wx).updateRulesFromConfiguration(r.tools?.edit?.autoApprove)}catch(r){ns.error(t,"Failed to apply edit auto approve configuration",r)}}a(hRc,"applyEditAutoApproveConfiguration");function mRc(t,e){try{let r=e;t.get(x3).updateConfiguration(r.tools?.mcp?.autoApprove)}catch(r){ns.error(t,"Failed to apply MCP auto approve configuration",r)}}a(mRc,"applyMCPAutoApproveConfiguration");function Fbt(t,e){if(t.get(FC).markReady(),!t.get(On).getCapabilities().redirectedTelemetry){let r=(e?.telemetry?.telemetryLevel??"all")==="all";t.get(Hf).initialize(r)}}a(Fbt,"initializePostConfigurationDependencies");var oqi=S.Object({name:S.String(),version:S.String(),readableName:S.Optional(S.String())}),gRc=S.Object({editorInfo:oqi,editorPluginInfo:oqi,editorConfiguration:S.Optional(S.Object({}))});async function ARc(t,e,r){t.get(Nr).setEditorAndPluginInfo(r.editorPluginInfo,r.editorInfo),Vlt(t,["setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo","and workspace/didChangeConfiguration for editorConfiguration."]),await Ubt(t,{settings:r.editorConfiguration}),yt(t,"setEditorInfo");for(let n of["github",...ALe])r.editorConfiguration&&n in r.editorConfiguration&&yt(t,`setEditorInfo.editorConfiguration.${n}`);return["OK",null]}a(ARc,"handleSetEditorInfoChecked");var sqi=je(gRc,ARc);p();var yRc=S.Object({options:S.Optional(S.Object({}))});async function ERc(t,e,r){let n=t.get(ET),o=n.pendingSignIn?.status;if(o===void 0)return[null,{code:it.InvalidRequest,message:"No pending sign in"}];let s;try{return s=await o,[s,null]}catch(c){return[null,{code:it.DeviceFlowFailed,message:String(c)}]}finally{n.pendingSignIn=void 0}}a(ERc,"handleSignInConfirmChecked");var aqi=je(yRc,ERc);p();var _Rc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function vRc(t,e,r){try{let o=await t.get(Fr).checkAndUpdateStatus({githubAppId:r.githubAppId});if(o.status==="OK")return[{status:"AlreadySignedIn",user:o.user},null];let c=await t.get(ET).initiate(r);return[{status:"PromptUserDeviceFlow",userCode:c.user_code,verificationUri:c.verification_uri,expiresIn:c.expires_in,interval:c.interval,command:{command:zlt,title:"Sign in with GitHub",arguments:[]}},null]}catch(n){if(!(n instanceof gi))throw n;return[null,{code:it.DeviceFlowFailed,message:n.message}]}}a(vRc,"handleSignInInitiateChecked");var M5r=je(_Rc,vRc);p();p();p();var cqi=["google","apple"],Qbt=S.Optional(S.Union(cqi.map(t=>S.Literal(t))));function lqi(t){return typeof t=="string"&&cqi.includes(t)}a(lqi,"isGitHubSocialProvider");function O5r(t){let e=t.toLowerCase();return e==="github.com"||e.endsWith(".github.com")}a(O5r,"isGitHubSocialProviderApplicableHostname");function uqi(t,e){if(!e)return t;try{let r=new URL(t);return O5r(r.hostname)?(r.searchParams.set("provider",e),r.toString()):t}catch{return t}}a(uqi,"addGitHubSocialProviderToVerificationUri");p();function dqi(){return!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY||(process.platform==="linux"||process.platform==="freebsd"||process.platform==="openbsd")&&!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)}a(dqi,"isBrowserAvailable");function CRc(t){let e=t.replace(/\/$/,"");return{issuer:e,authorization_endpoint:`${e}/login/oauth/authorize`,token_endpoint:`${e}/login/oauth/access_token`,response_types_supported:["code"],code_challenge_methods_supported:["S256"],grant_types_supported:["authorization_code"],scopes_supported:["repo","workflow","user","read:org"]}}a(CRc,"getGitHubOAuthServerMetadata");async function qbt(t,e,r={},n){let o=performance.now();nhe(t,"codeFlow");let s={status:"NotSignedIn"};try{if(!dqi())throw new z9("Browser not available (SSH session or headless environment). Cannot perform OAuth code flow.");let{serverUrl:c,authAuthority:l}=Y9(t,r.authAuthority),u=CRc(c),d=e(t,u),f=r.scopes??["repo","workflow"],h=O5r(new URL(c).hostname)?r.socialProvider:void 0,m=await d.createSession(f,{cancellationToken:n,provider:h}),g=m.scopes||f,A=t.get(Up).findAppIdToAuthenticate(),y=m.account.label;if(!y)throw new gi("Could not resolve GitHub username during sign-in. Please try again.");return s=await t.get(Fr).signInEditor({accessToken:m.accessToken,user:y,githubAppId:A,authAuthority:l,scopes:g?[...g]:void 0}),E2(t,"codeFlow",s.status,performance.now()-o),s}catch(c){throw E2(t,"codeFlow",s.status,performance.now()-o,c),c}}a(qbt,"performGitHubOAuthCodeFlow");p();p();p();bHe();var zye=class extends M0{constructor(r,n=new B5r){super();this.ctx=r;this.fallback=n}static{a(this,"AgentUrlOpener")}async open(r){let n=this.ctx.get(dr);if(!(n.clientCapabilities?.window?.showDocument?.support&&(await Promise.race([n.connection.window.showDocument({uri:r,external:!0}),new Promise((s,c)=>setTimeout(()=>c(new Error("window/showDocument timed out")),15e3))])).success))return this.fallback.open(r)}},B5r=class extends M0{static{a(this,"SpawnUrlOpener")}async open(e){await J1e(e)}};p();var fqi=require("crypto"),pqi=fe(require("http"));p();var jbt=new Ae("OAuth Code Flow");function L5r(t,e,r=(n,o)=>n===o){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let n=0,o=t.length;n @@ -3910,125 +3975,49 @@ Content: ${r}`}async generateTitle(e,r,n){let o=new qn.CancellationTokenSource,s } -`;var n4r=["authorization_code","refresh_token"],oEe=33428,r1t=class{constructor(e,r){this._logger=new ge("LoopbackAuthServer");this.nonce=(0,yqi.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=Eqi.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new Ai("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),aDe(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new Ai(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),aDe(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new Ai("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),aDe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new Ai("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),aDe(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(r4r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(r4r)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${oEe} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(oEe,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var n1t=require("crypto");var PLe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,n1t.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,n1t.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var gPc="Timed out",_qi="Sign-in request was cancelled",i4r=class{static{a(this,"CodeFlow")}},sEe=class extends i4r{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=PLe.isServerSupported(n.code_challenge_methods_supported),h=f?PLe.createPKCEParameters():void 0;f?Dr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Dr.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new r1t(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Dr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new iEe(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,k)=>{let D=setTimeout(()=>k(new Error(gPc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((k,D)=>{if(x.isCancellationRequested){Dr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(_qi));return}let N=x.onCancellationRequested(()=>{Dr.info(this.ctx,"OAuth flow cancelled"),D(new Error(_qi))});b.push(N)}))}v=(await Promise.race(w)).code,Dr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Dr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Dr.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Dr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await QZ(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Dr.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var rN=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>t4r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(Si).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Bp),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=mqi(r.provider)?r.provider:void 0,d=await new sEe(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,{prompt:"select_account",provider:u},r.cancellationToken),f=await this.tokenToSession(d.access_token,e);this.afterSessionLoad(f);let h=o.findIndex(g=>g.account.id===f.account.id&&t4r([...g.scopes].sort(),n)),m=new Array;return h>-1?m.push(...o.splice(h,1,f)):o.push(f),await this.storeSessions(o),f}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(Si).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(ar).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return t1t.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return t1t.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return t1t.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var APc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:Xbt});async function yPc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:Ke.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Ur),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:Ke.AuthEnvVarConflict,message:O9e(c)}];let l=await e1t(t,(u,d)=>new rN(u,rN.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider},e);if(!["OK","MaybeOK"].includes(l.status))throw new Ai("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof eU)return[null,{code:Ke.NoBrowserAvailable,message:n.message}];if(!(n instanceof Ai))throw n;return[null,{code:Ke.CodeFlowFailed,message:n.message}]}}a(yPc,"handleSignInWithCodeFlowChecked");var Cqi=Ne(APc,yPc);p();p();p();var J6=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},DLe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function vqi(t,e,r){return e.isCancellationRequested?Promise.reject(new J6):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new J6))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new DLe))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(vqi,"raceWithCancellationAndTimeout");var EPc=["repo","workflow"];async function _Pc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(ar).fetch(s,o)}catch(l){throw l instanceof Error&&OI(l)?new Ai(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new Ai(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(_Pc,"requestDeviceCode");async function CPc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...by(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(ar).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&OI(l)?new Ai(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new Ai(c.error_description):new Ai(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(CPc,"requestAccessToken");async function vPc(t,e){let n=await(await Td(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new Ai(`Error retrieving user information: ${String(n.errors)}`);return n}a(vPc,"requestUserInfo");async function bPc(t,e,r){let n=r?.githubAppId??t.get(Bp).findAppIdToAuthenticate(),o=r?.scopes??EPc,{serverUrl:s,apiUrl:c,authAuthority:l}=tU(t,r?.authAuthority),u=await _Pc(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new J6("Sign-in request was cancelled");m=await CPc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await vPc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new J6("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Ur),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:Ke.AuthEnvVarConflict,message:O9e(u)}];ohe(t,"deviceFlow");let d=t.get(Ine),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(ur).connection.sendNotification(IPc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await vqi(f.waitForAuth,e,xPc),m=await d.save(h);return C2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof J6)return[null,{code:Ke.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof DLe)return C2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:Ke.DeviceFlowFailed,message:"Sign-in request timed out"}];if(C2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof Ai))throw s;return[null,{code:Ke.DeviceFlowFailed,message:s.message}]}}a(wPc,"handleSignInWithDeviceFlowChecked");var Sqi=Ne(TPc,wPc);p();var RPc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function kPc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Ur);return[await t.get(bT).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(kPc,"handleSignInWithGithubTokenChecked");var Tqi=Ne(RPc,kPc);p();var PPc=S.Object({options:S.Optional(S.Object({}))});async function DPc(t,e,r){return[await t.get(Ur).signOutEditor(),null]}a(DPc,"handleSignOutChecked");var Iqi=Ne(PPc,DPc);p();var NPc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),o4r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function MPc(t,e,r){let n=t.get(ss),o=t.get(Lr).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&U5.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:Owt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},U5.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new o4r(r.stacktrace??"N/A",o.name);return l.stack=void 0,_s(t,l,r.transaction??"",s,c),["OK",null]}a(MPc,"handleTelemetryExceptionChecked");var xqi=Ne(NPc,MPc);p();p();p();Ns();function s4r(t){let e=Date.now()+((t?.refresh_in??0)+mPt)*1e3;return new lW({token:`test token ${gr()}`,refresh_in:0,expires_at:e,...t},void 0,e)}a(s4r,"createTestCopilotToken");var aEe=class extends gh{constructor(){super(...arguments);this.defaultToken=s4r({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:s4r({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var i1t=class extends gh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:s4r(await this.envelopeFn())}}};var OPc=S.Object({options:S.Optional(S.Object({}))});async function BPc(t,e,r){let n=new aEe;return t.get(Ur).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(gh,n),t.get(as).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(BPc,"handleTestingAlwaysAuthChecked");var a4r=Ne(OPc,BPc);p();Ns();var LPc=S.Object({messages:S.Array(S.Object({role:S.Enum(tc),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Tn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function FPc(t,e,r){let n=new rc(t),s=await FQ(t)?Tn.Gpt35turbo:Tn.CopilotBase,c=await t.get(Bc).getBestChatModelConfig([r.modelFamily??s]),l=await UTe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:gA.user("test",gr())},e,l),null]}a(FPc,"handleChatMLChecked");var wqi=Ne(LPc,FPc);p();p();p();var fEe=ce(Dji(),1),cSh={ALPN_HTTP2:fEe.default.ALPN_HTTP2,ALPN_HTTP2C:fEe.default.ALPN_HTTP2C,ALPN_HTTP1_1:fEe.default.ALPN_HTTP1_1,ALPN_HTTP1_0:fEe.default.ALPN_HTTP1_0},{fetch:lSh,context:Nji,reset:uSh,noCache:dSh,h1:fSh,keepAlive:pSh,h1NoCache:hSh,keepAliveNoCache:mSh,cacheStats:gSh,clearCache:ASh,offPush:ySh,onPush:ESh,createUrl:_Sh,timeoutSignal:CSh,Body:vSh,Headers:Mji,Request:bSh,Response:SSh,AbortController:TSh,AbortError:C1t,AbortSignal:ISh,FetchBaseError:xSh,FetchError:wSh,ALPN_HTTP2:RSh,ALPN_HTTP2C:kSh,ALPN_HTTP1_1:PSh,ALPN_HTTP1_0:DSh}=fEe.default;var Bji=require("crypto"),Lji=require("http"),Fji=require("stream"),Uji=require("util"),hEe=ce(sP());var sNc=6e5,aNc=new hEe.ProtocolRequestType("copilot/fetch"),cNc=new hEe.ProtocolRequestType("copilot/fetchCancel"),lNc=new hEe.ProgressType,uNc=new hEe.ProtocolRequestType("copilot/fetchDisconnectAll"),aB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},pEe=class extends ar{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(ss).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(ur).connection.sendRequest(uNc,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(ur).connection,c=(0,Bji.randomUUID)(),l=new qn.CancellationTokenSource,u=new Fji.PassThrough,d=a(()=>{s.sendRequest(cNc,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new C1t("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new aB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new C1t("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(lNc,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new aB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??sNc,y=setTimeout(()=>{gt(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new aB("Request timed out from lsp server"))},A),E=a(()=>{g(new C1t("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(aNc,fNc(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,Uji.inspect)(_.data)}`),g(new aB(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new aB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new BI(h.status,Lji.STATUS_CODES[h.status]??"",new Mji(h.headers),()=>dNc(u),()=>u)}};function dNc(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(dNc,"consumeStream");function fNc(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(fNc,"convertOptionsToParams");var pNc=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function hNc(t,e,r){let n=new pEe(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof aB?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof aB?y.message:String(y)}`},null]}}a(hNc,"handleTestingFetchChecked");var Qji=Ne(pNc,hNc);p();var mNc=S.Object({});async function gNc(t,e,r){return await t.get(_d).flush(),["OK",null]}a(gNc,"handleTestingFlushPromiseQueueChecked");var qji=Ne(mNc,gNc);p();p();p();var cV=class{static{a(this,"FileSearch")}};p();p();p();var v1t=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var jji=ce(ti());var b1t="main.js",S1t=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=Uun(b1t,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new v1t(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new f$e(this.id++),jji.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new l$e(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new u$e(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new d$e(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new a$e(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new c$e(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new s$e(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(b1t+"'")&&(r=new Error(`Failed to load ${b1t}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${b1t} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var QLe=ce(ti());var r9=new ge(wlr),T1t=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){r9.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,QLe.CancellationToken.None);return}r9.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new S1t(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{r9.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await ANc(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,QLe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{r9.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){r9.debug(this.ctx,`indexing workspace ${e}`);let r=b3t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${b3t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(cV),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,QLe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));r9.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),r9.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{r9.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,QLe.CancellationToken.None)}catch(n){r9.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return Ucn(e)}};async function ANc(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(ANc,"createIndexableWorkspaceFolder");var yNc=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function ENc(t,e,r){try{await t.get(S_).start();let n=t.get(T1t),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,Rlr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(bNc,"handleTestingNeverAuthChecked");var B4r=Ne(vNc,bNc);p();p();p();var L4r=class extends rp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},$ji=a(t=>new L4r(t),"createTestCertificateReader");function U4r(t,e,r){let n=new F4r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new BI(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(U4r,"createFakeResponse");function Vji(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),U4r(t,n,Object.assign({"content-type":"application/json"},r))}a(Vji,"createFakeJsonResponse");var qLe=class extends ar{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var I1t=class extends qLe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var F4r=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var Q4r=class extends qLe{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(Vji(200,this.fullConfig)):Promise.resolve(U4r(404,""))}},x1t=class extends Q4r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var SNc=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function TNc(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(ar,new x1t(n,t.get(ar)))}return["OK",null]}a(TNc,"handleTestingOverrideExpFlagsChecked");var Wji=Ne(SNc,TNc);p();var INc=S.Object({rules:$8t});function xNc(t,e,r){return t.get(Cc).setTestingRules(r.rules),["OK",null]}a(xNc,"handleTestingSetContentExclusionRulesChecked");var zji=Ne(INc,xNc);p();var wNc=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(oO)),options:S.Optional(S.Object({}))});function RNc(t,e,r){return t.get(n9).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(RNc,"handleTestingSetSyntheticTurnsChecked");var Yji=Ne(wNc,RNc);p();var kNc=S.Object({});async function PNc(t,e,r){let n=t.get(sa),o=t.get(Df);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(PNc,"handleTriggerShowMessageChecked");var Kji=Ne(kNc,PNc);p();p();p();p();var Jji=ce(require("tls"));var mEe=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(rp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=Jji.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var lHi=ce(require("http"));var rMc=407,cy=new ge("proxySocketFactory"),UR=class{static{a(this,"ProxySocketFactory")}},Pne=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function w1t(t){return new H4r(t,new G4r(t))}a(w1t,"getProxySocketFactory");var H4r=class extends UR{constructor(r,n,o=new HLe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new nn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(cy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Pne&&o.code===`ProxyStatusCode${rMc}`){cy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return cy.debug(this.ctx,"Proxy authorization successful, caching result"),ht(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(cy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(cy.debug(this.ctx,"Proxy authorization successful, received token"),o)return cy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){cy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);cy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);cy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return cy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return cy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return cy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},G4r=class extends UR{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(ss).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{cy.debug(this.ctx,"Attempting to establish connection to proxy");let l=lHi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{cy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Pne(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Pne(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(cy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{cy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Pne(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{cy.debug(this.ctx,"Proxy socket connection timeout"),c(new Pne(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},HLe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>ce(cHi()))}};var Dne=class extends ar{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new mEe(r),this.proxySocketFactory=r.get(UR),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Zo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Zo).getHttpSettings()),this.updateNoProxy(r.get(Zo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(ss),s=this.proxySocketTimeoutForTesting;return Nji({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new oW(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new BI(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var yEe=class extends D0{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Qt).resetToken("config_urls_changed"),r.get(Ih).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=Sy({serverUrl:D9e(r,n.serverUrl),apiUrl:D9e(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var EEe=class extends yB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){_s(e,r,n)}};p();var _Ee=class extends L5{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var R1t=class extends vP{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var k1t=class extends Uh{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var P1t=class extends cV{constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function nMc(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(nMc,"fakeChatModelConfiguration");function iMc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(iMc,"fakeEmbeddingModelConfiguration");var D1t=class extends Bc{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(nMc(r))}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(iMc(e))}};p();var N1t=class extends N0{constructor(){super(...arguments);this.openedUrls=[];this.opened=new rA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},M1t=class extends sa{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function uHi(t,e,r,n){return iP.create(P9e(t),e,r,n,e)}a(uHi,"createTextDocument");var $4r=class extends cn{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new no;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new no;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new no;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new no;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new no;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??ji(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=uHi(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=uHi(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},O1t=class extends $4r{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var V4r=class extends Df{static{a(this,"NullLog")}logIt(...e){}},W4r=class extends Ur{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function oMc(t){let e=new ile;e.set(Zo,t),e.set(Jz,t);let r=new W4r(e,{accessToken:"",login:"user"});e.set(Ur,r),e.set(ss,new ss),e.set(vI,new vI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(rp,$ji([])),e.set(UR,w1t(e)),e.set(dM,new dM),e.set(Qk,new QQe);let n=new aEe;e.set(gh,n);let o=new Qt(e,!0);e.set(Qt,o);let s=new Nf(e);return s.updateFromToken(n.defaultToken),e.set(Nf,s),e.set(k0,new k0),e.set(bN,new bN),e.set(sa,new M1t),e.set(N0,new N1t),e.set(yB,new EEe),e.set(Df,new V4r),e.set(lv,new lv),e.set(Fa,new Fa("test-session","test-machine","test-device")),e.set(CI,new CI(()=>Promise.resolve("test-device"))),e.set(D0,new yEe(e)),e.set(ik,new fie),e.set(Ih,new Ih(e,"copilot-test")),e.set(Jt,new Jt(e)),e.set(PN,new PN(e,o)),e.set(f2,new f2),e.set(eP,new cce),e.set(as,new LQe),e.set(_d,new _d),e.set(b5,new b5(e)),e.set(cV,new P1t),e.set(E2,new E2(e)),e.set(VF,wlt(e)),e.set(FA,new FA),e.set(_b,new _b),e.set(WF,WF.default),e.set(mx,new mx(e,!1)),e.set(Bp,new Bp),e.set(Jn,new Jn(e)),e.set(vT,new Plt),e.set(r0,new r0),e.set(n0,jat(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(Cb,new Cb(e)),sMc(e),e.set(Eb,new Eb(e)),e.set(Mn,new Mn),e.set(L5,new _Ee),e.set(v2,new v2),e.set(Kx,new Kx),e.set(OP,new OP(e)),e}a(oMc,"_createBaselineContext");function sMc(t){t.set(Vo,new Vo(t)),t.set(vc,new vc(t)),t.set(dA,new dA(t)),t.set(Qh,new Qh),t.set(eg,new eg),t.set(Uh,new k1t),t.set(LR,new LR(t,[])),t.set(Bc,new D1t),t.set(vP,new R1t),t.set(rO,new rO(t)),t.set(JQ,new JQ),t.set(Y0,new Y0(t)),t.set(D_,new D_),t.set(Lx,new Lx);let e=new JD(t);t.set(JD,e),t.set(BR,new BR(e,t)),t.set(pO,new pO(t)),t.set(oI,new bbt),t.set(Uv,new Uv(t.get(BR),t.get(oI),t)),t.set(X0,new X0)}a(sMc,"registerConversation");function dHi(){let t=oMc(new Jz(new lce,new Map));return t.set(ar,new I1t),t.set(Lr,new z4r),t.set(cn,new O1t(t)),t.set(Fo,new L7),t.set(Cc,new Cc(t)),t.set(Rd,new Rd(t)),t.set(IS,new BWe),t.set(jM,new jM(t)),t.set(S5,new kpe),t.set(d2,new uat),t.set(uu,new _We),t.set(T_,new T_(t)),t.set(lA,new oWe),t.set(om,new om),iWe(t),t.set(BA,new she(t)),t}a(dHi,"createLibTestingContext");var z4r=class extends Lr{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var pHi=ce(require("fs"));var fHi=`${process.env.HOME}/.copilot-testing-gh-token`,B1t,L1t;function hHi(t){let e=mHi(),r=new i1t(aMc);return t.forceSet(gh,r),t.get(Ur).setTransientSession(e),r}a(hHi,"setIntegrationTokenManager");var aMc=a(async()=>{if(L1t)return L1t;let t=await mHi(),e=dHi(),r=new Dne(e);return e.forceSet(ar,r),L1t=gPt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new Ai('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),L1t},"getEnvelope");async function mHi(){let{session:t}=iMt(process.env);if(t)return t;try{B1t??=(await pHi.promises.readFile(fHi)).toString().trim()}catch{B1t??=process.env.GITHUB_TOKEN??""}if(!B1t)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${fHi}. Run "npm run get_token" to get one.`);return{...Sy({}),accessToken:B1t,login:"copilot-client tests"}}a(mHi,"getTestingGitHubSession");var cMc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function lMc(t,e,r){return hHi(t),await t.get(Qt).primeToken(),["OK",null]}a(lMc,"handleTestingUseTestingTokenChecked");var gHi=Ne(cMc,lMc);p();var uMc=S.Object({});async function dMc(t,e,r){return await new zAe().uninstall(t),["OK",null]}a(dMc,"handleUninstallChecked");var AHi=Ne(uMc,dMc);p();var fMc=rYn;function pMc(t,e,r){let n=t.get(n0),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a(pMc,"unregisterContextProviders");var yHi=Ne(fMc,pMc);p();var Y4r=ce(require("os"));var hMc=S.Object({expectedCertificate:S.String()});async function mMc(t,e,r){let o=(await Znt(t).getAllRootCAs()).map(rEe),s=rEe(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${V5r(s)}. Only found those installed on the system:${Y4r.EOL}${o.map(c=>"- "+V5r(c)).join(Y4r.EOL)}`},null]}a(mMc,"handleVerifyCertificateChecked");var EHi=Ne(hMc,mMc);p();var gMc=S.Object({});async function AMc(){return[{status:!!await new HLe().load()},null]}a(AMc,"handleVerifyKerberosChecked");var _Hi=Ne(gMc,AMc);p();var yMc=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function EMc(t,e,r){let o=await t.get(cn).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(EMc,"handleVerifyStateChecked");var CHi=Ne(yMc,EMc);p();var _Mc=S.Object({});function CMc(t,e,r){return[t.get(cn).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(CMc,"handleVerifyWorkspaceStateChecked");var vHi=Ne(_Mc,CMc);p();p();var vEe=ce(require("fs/promises")),bHi=ce(require("os")),$d=ce(require("path"));var vp=new ge("GitWorktreeService"),vMc=20,CEe=class{constructor(e){this.ctx=e;this.gitInstances=new nn(vMc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=$d.resolve(e),n=this.gitInstances.get(r);return n||(n=xJe(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=$d.resolve(e);vp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return vp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw vp.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(vp.info(this.ctx,`Skipping checkpoint commit for ${$d.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),vp.info(this.ctx,`Created ${n} commit for ${$d.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){vp.info(this.ctx,`Snapshotting copied changes in ${$d.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return vp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await vEe.mkdtemp($d.join(bHi.tmpdir(),"copilot-worktree-")),o=$d.join(n,"changes.patch");try{vp.info(this.ctx,`Writing temporary patch for ${$d.resolve(e)} to ${o} (${r.length} chars)`),await vEe.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await vEe.rm(n,{recursive:!0,force:!0}),vp.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=$d.basename(r),h=$d.join($d.dirname(r),`${f}.worktrees`),m=$d.join(h,d);return vp.info(this.ctx,`Preparing worktree creation for ${$d.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),vp.info(this.ctx,`Created worktree ${m} from ${$d.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){vp.info(this.ctx,`Preparing to remove worktree ${e} from ${$d.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),vp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return vp.info(this.ctx,`Skipping status lookup for ${$d.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){vp.info(this.ctx,`Applying worktree changes from ${$d.resolve(e)} to ${$d.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");vp.info(this.ctx,o?`Committed pending worktree changes in ${$d.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${$d.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return vp.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return vp.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return vp.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),vp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),vp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),vp.info(this.ctx,`Popped stash in ${e}`)}};p();var SHi=ce(ti());var h1=new ge("WorktreeService");var bMc=new SHi.ProtocolRequestType("worktree/requestUserDecision"),GLe=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return h1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";h1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(ur).connection.sendRequest(bMc,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(h1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(h1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){h1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(h1.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(h1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(h1.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},h1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);h1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw h1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return h1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){h1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return h1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var SMc="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",TMc=["already exists in working directory","patch does not apply","patch failed"];function IMc(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&TMc.some(n=>e.includes(n))?SMc:`Failed to apply worktree changes: ${e}`}a(IMc,"getWorktreeCompleteErrorMessage");var xMc=S.Object({repositoryPath:S.String()});async function wMc(t,e,r){try{let n=new CEe(t),o=new GLe(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:`Failed to create worktree: ${o}`}]}}a(wMc,"handleWorktreeCreateChecked");var THi=Ne(xMc,wMc),RMc=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function kMc(t,e,r){try{let n=new CEe(t);return[{success:!0,baseCommit:(await new GLe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:Ke.InternalError,message:IMc(n)}]}}a(kMc,"handleWorktreeCompleteChecked");var IHi=Ne(RMc,kMc),PMc=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function DMc(t,e,r){try{return await new CEe(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:Ke.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(DMc,"handleWorktreeDeleteChecked");var xHi=Ne(PMc,DMc);var Nne=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function wHi(){let t=new Map;return t.set(kQi.method,PQi),t.set("getCompletions",gQi),t.set("getCompletionsCycling",AQi),t.set("getDefaultFileSafetyRules",yQi),t.set("copilot/parseTerminalCommand",aqi),t.set("getPanelCompletions",CQi),t.set(z7i.method,Y7i),t.set("getVersion",bQi),t.set("getUserInfo",vQi),t.set("setEditorInfo",fqi),t.set("checkStatus",n7i),t.set("checkQuota",r7i),t.set("checkFileStatus",e7i),t.set("claude/checkCliCompatibility",XUi),t.set("signInInitiate",Z5r),t.set("signIn",Z5r),t.set("signInWithCodeFlow",Cqi),t.set("signInWithDeviceFlow",Sqi),t.set("signInConfirm",pqi),t.set("signInWithGithubToken",Tqi),t.set("signOut",Iqi),t.set("auth/listAvailableTokens",b6i),t.set("auth/useExistingToken",S6i),t.set("notifyShown",sqi),t.set("notifyAccepted",nqi),t.set("notifyRejected",oqi),t.set("notifyNextEditRejected",iqi),t.set("telemetry/exception",xqi),t.set("textDocument/copilotInlineEdit",rqi),t.set("testing/overrideExpFlags",Wji),t.set("testing/alwaysAuth",a4r),t.set("testing/setAlwaysAuthed",a4r),t.set("testing/neverAuth",B4r),t.set("testing/setNeverAuthed",B4r),t.set("testing/useTestingToken",gHi),t.set("testing/setCompletionDocuments",fQi),t.set("testing/setPanelCompletionDocuments",V7i),t.set("testing/setNextEditDocument",JQi),t.set("testing/triggerShowMessageRequest",Kji),t.set("testing/flushPromiseQueue",qji),t.set("testing/getDocument",Gji),t.set("testing/chatml",wqi),t.set("testing/setSyntheticTurns",Yji),t.set("testing/fetch",Qji),t.set("testing/setContentExclusionRules",zji),t.set("testing/getContext",Hji),t.set("uninstall",AHi),t.set("debug/diagnostics",sQi),t.set("debug/listCertificates",DQi),t.set("debug/verifyState",CHi),t.set("debug/verifyCertificate",EHi),t.set("debug/verifyKerberos",_Hi),t.set("debug/verifyWorkspaceState",vHi),t.set("debug/getAgentDebugLog",aQi),t.set("context/registerProviders",cqi),t.set("context/unregisterProviders",yHi),t.set("conversation/preconditions",C7i),t.set("conversation/persistence",_7i),t.set("conversation/create",g7i),t.set("conversation/turn",T7i),t.set("conversation/turnDelete",I7i),t.set("conversation/destroy",A7i),t.set("conversation/compress",f7i),t.set("conversation/rating",v7i),t.set("conversation/copyCode",u7i),t.set("conversation/insertCode",d7i),t.set("conversation/templates",S7i),t.set("conversation/modes",y7i),t.set("conversation/agents",l7i),t.set("conversation/registerTools",b7i),t.set("conversation/unregisterTools",x7i),t.set("conversation/updateToolsStatus",w7i),t.set("conversation/notifyCodeAcceptance",E7i),t.set("customAgent/registerExtensionAgents",J7i),t.set("customAgent/unregisterExtensionAgents",Z7i),t.set("copilot/customAgent/list",K7i),t.set("copilot/customSkill/list",tQi),t.set("copilot/customPrompt/list",eQi),t.set("copilot/customInstruction/list",X7i),t.set("copilot/hook/list",wQi),t.set("copilot/models",Q7i),t.set("copilot/models/getModelMetadataList",q7i),t.set("copilot/byok/saveModel",ZUi),t.set("copilot/byok/deleteModel",I6i),t.set("copilot/byok/listModels",KUi),t.set("copilot/byok/saveApiKey",JUi),t.set("copilot/byok/deleteApiKey",T6i),t.set("copilot/byok/listApiKeys",x6i),t.set("copilot/setModelPolicy",j7i),t.set("copilot/codeReview/reviewChanges",k7i),t.set("copilot/codeReview/reviewSnippets",P7i),t.set("git/commitGenerate",SQi),t.set("thinking/generateTitle",R7i),t.set("mcp/getTools",M7i),t.set("mcp/updateToolsStatus",O7i),t.set("mcp/readResource",B7i),t.set("mcp/registry/listServers",WQi),t.set("mcp/registry/getServer",zQi),t.set("mcp/registry/getAllowlist",KQi),t.set("mcp/getPrompt",L7i),t.set("mcp/completePrompt",F7i),t.set("mcp/serverAction",U7i),t.set("mcpGateway/listServers",BQi),t.set("mcpGateway/getServerDetails",LQi),t.set("mcpGateway/serverAction",FQi),t.set("githubApi/searchPR",xQi),t.set("githubApi/cancelCodingAgent",o7i),t.set("cloudAgent/listSessions",c7i),t.set("cloudAgent/getSessionLogs",a7i),t.set("cloudAgent/createJob",s7i),t.set("cloudAgent/addPullRequestComment",i7i),t.set("githubApi/listPullRequestChangedFiles",TQi),t.set("worktree/create",THi),t.set("worktree/complete",IHi),t.set("worktree/delete",xHi),t.set("backgroundAgent/create",t6i),t.set("backgroundAgent/send",C6i),t.set("backgroundAgent/destroy",r6i),t.set("backgroundAgent/listModels",g6i),t.set("backgroundAgent/listSessions",p6i),t.set("backgroundAgent/resume",E6i),t.set("backgroundAgent/stop",v6i),t.set("backgroundAgent/interaction",u6i),t.set("backgroundAgent/enableRemote",s6i),t.set("backgroundAgent/disableRemote",i6i),t.set("backgroundAgent/getRemoteStatus",c6i),t.set("backgroundAgent/getPlanPath",a6i),t.set("backgroundAgent/compactHistory",Z8i),new Nne(t)}a(wHi,"getAllMethods");p();p();p();var RHi=ce(sP());var MC=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new RHi.NotificationType(this.name)}};var NMc=new ge("BackgroundAgent.notifications"),K4r=class extends MC{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},J4r=class extends MC{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:wMr})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){NMc.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Us).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},kHi=[K4r,J4r];p();var Z4r=class extends MC{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Qt).resetToken("did_change_token_notification")}},PHi=[Z4r];p();var MMc=new ge("agentCopilotTokenManager");function eBr(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(eBr,"tokenEndpointToApiUrl");function OMc(t,e){if(!e.tokenEndpoint)return Sy(e);let r=eBr(e.tokenEndpoint);return r||MMc.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),Sy({apiUrl:r})}a(OMc,"getUrlsFromParams");var X4r=class extends MC{constructor(){super(...arguments);this.name=IUt.method;this.params=gyn}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Ur),o=OMc(this.ctx,r);this.ctx.get(D0).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},DHi=[X4r];p();var tBr=class extends MC{constructor(){super(...arguments);this.name=DUt.method;this.params=Syn}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(vu).get(n);s&&SZn(this.ctx,s)}},rBr=class extends MC{constructor(){super(...arguments);this.name=MUt.method;this.params=Ryn}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(DC).handleShown(n)}},nBr=class extends MC{constructor(){super(...arguments);this.name=NUt.method;this.params=Tyn}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(vu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),ihe(this.ctx,c)):Flt(this.ctx,c,o,void 0,void 0,"cumulative"))}},NHi=[tBr,rBr,nBr];p();var F1t=class extends MC{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(ZD).cancel(r.token)}};var BMc=[...kHi,...PHi,...DHi,...NHi,F1t];function MHi(t,e){for(let r of BMc){let n=new r(t),o=Ou.Compile(n.params);e.onNotification(n.type,Pm(t,async s=>{F6(s),o.Check(s)?await n.handle(s):ys.error(t,`Notification ${n.name}:`,new vA(o.Errors(s)))},`Notification ${n.name}`))}}a(MHi,"registerNotifications");p();p();var OHi=ce(require("crypto")),BHi=require("os");Ns();var LMc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function FMc(t){let e=t.replace(/-/g,":").toLowerCase();return!LMc.has(e)}a(FMc,"validateMacAddress");function UMc(){let t=(0,BHi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(FMc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a(UMc,"getMac");var iBr;function QMc(){try{let t=UMc();return OHi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(QMc,"getMacMachineId");function oBr(){return iBr||(iBr=QMc()||gr()),iBr}a(oBr,"getMachineId");Ns();function sBr(t){let e=t??gr()+Date.now();return new Fa(e,oBr(),oBr())}a(sBr,"createEditorSession");var LHi=sBr();p();var U1t=ce(Al());var aBr=new ge("AgentTextDocumentConfiguration"),cBr=class{constructor(e){this.ctx=e;this.#e=new no;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return iP.create(e,r,n,o)}catch(s){throw aBr.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=iP.withChanges(e,r,n);for(let l of r)if(U1t.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;aBr.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=jt.createAndMarkAsIssued({message:`Received ${g}`});ht(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw aBr.exception(this.ctx,o,".update"),o}}},uV=class extends cn{constructor(){super(...arguments);this.#e=new no;this.onDidOpenTextDocument=this.#e.event;this.#t=new no;this.onDidCloseTextDocument=this.#t.event;this.#r=new no;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new cBr(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new U1t.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new no;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(ur).connection}init(r){this.connection.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._textDocumentConfiguration.create(o.uri,o.languageId,o.version,o.text);this._documents.set(ca(o.uri),s),this.#e.fire({document:{...o,uri:s.uri}})}),this.connection.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges,{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=ca(o.uri),u=this._documents.get(l);u!==void 0&&(u=this._textDocumentConfiguration.update(u,s,c),this._documents.set(l,u))}),this.connection.onDidCloseTextDocument(n=>{let o=ca(n.textDocument.uri);this._documents.delete(o),this.#t.fire({document:{uri:o}})}),this.connection.onNotification(RUt.type,n=>{let o=("textDocument"in n?n.textDocument:n)??{};this.#r.fire("uri"in o?{document:o}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0,this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1)}registerWorkspaceFolder(r){this.workspaceFolders.find(n=>n.uri===r.uri)||this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(ca(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var FHi=Ou.Compile(Cyn);function F6(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(UHi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of kLe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(KM).handleConfigurationChange(e.settings)}catch(n){ys.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return Zbt(this.ctx,F6(e))}catch(r){ys.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Df)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),MHi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(ss).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(uV).didChangeWorkspaceFolders(c)}catch(l){ys.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities;let l=c.capabilities.copilot,u=F6(c.initializationOptions);if(u){if(!FHi.Check(u))throw new vA(FHi.Errors(u));let m=u,g=e.get(Lr);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):ys.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(Bp).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Fa,sBr(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(uV).init(c.workspaceFolders??[]),Lzn(this.ctx),l&&(e.get(Mn).setCapabilities(l),l.contentProvider&&aa.registerSchemes(l.contentProvider),"openURL"in l&&Ult(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,ys.info(e,`${n.name} ${n.version} initialized`),e.get(Qt).primeToken().catch(m=>{e.get(as).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(aI.DidChangeConfigurationNotification.type,{section:UHi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(Hv).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||Jbt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(as).sendInitNonAuthStatus(),new zAe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(Pm(e,h,"onInitialized")),e.get(zD).init(),l?.token&&e.get(Ur).setTransientSession({}),l?.redirectedTelemetry&&$8i(e),QHi.lt(process.versions.node,"22.0.0")&&ys.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:aI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:q8i(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new svt;this.ctx.forceSet(Df,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");gi(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Nne).handlers.get(e);if(!o)return new aI.ResponseError(Ke.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new aI.ResponseError(Ke.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new aI.ResponseError(Ke.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!fRn(this.ctx.get(Lr)))throw new aI.ResponseError(Ke.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),F6(r);try{let[s,c]=await o(this.ctx,n,r);return c?new aI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new aI.ResponseError(Ke.RequestCancelled,"Request was canceled");if(s instanceof Ai)return this.telemetryMethodFailure(e,s),new aI.ResponseError(Ke.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof aI.ResponseError||ys.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(oY).stop()}catch(e){ys.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(Q3).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(pb).dispose().catch(e=>{ys.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){ys.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(Bj).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(kP).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(UF).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose Claude Code agent service")}this.ctx.get(Us).shutdown().catch(e=>{ys.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(zm).dispose()}catch(e){ys.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Df,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(Hv).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Cdr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(_d).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(k0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},ys=new ge("lsp");var OC=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new qHi.ProtocolRequestType("conversation/context");this.typeCheck=Ou.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(ur).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new jHi.ResponseError(l.code,l.message,l.data);Ye.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){Ye.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new vA(this.typeCheck.Errors(o));return o}}};var lBr=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},n9=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new lBr(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},Q1t=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(vc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){Ye.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(Vo).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new OC(this.turnContext.ctx,s,S.Object({value:S.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await rx(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:gr()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var XD=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(n9).get(r);if(o)return new Q1t(e,o);let c=(await Px(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new jYe(e.ctx):l=new mle(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new kwe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new kwe(e,l):new ytt(e,l)}};p();var dV=class extends v_{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` -`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Or([new wr(r)],"success")}errorResult(r){return new Or([new wr(r)],"error")}};p();function qMc(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(qMc,"mapToolNameToKind");function jMc(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(jMc,"extractLocationsFromInput");function HMc(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(HMc,"mapToolCallStatus");var q1t=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=HMc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=jMc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,qMc(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` +`;var U5r=["authorization_code","refresh_token"],Yye=33428,Hbt=class{constructor(e,r){this._logger=new Ae("LoopbackAuthServer");this.nonce=(0,fqi.randomBytes)(16).toString("hex");if(!e)throw new Error("startingRedirect must be defined");this._startingRedirect=new URL(e),this._ctx=r;let n;this._resultPromise=new Promise((s,c)=>n={resolve:s,reject:c}),this._responseSentPromise=new Promise(s=>{this._resolveResponseSent=s});let o=`&app_name=${encodeURIComponent("GitHub Copilot")}`;this._server=pqi.createServer((s,c)=>{let l=new URL(s.url,`http://${s.headers.host}`);switch(l.pathname){case"/signin":{let u=(l.searchParams.get("nonce")??"").replace(/ /g,"+");if(u!==this.nonce){let d=new gi("Nonce does not match.");this._logger.warn(this._ctx,"Nonce mismatch in /signin request",{receivedNonce:u,expectedNonce:this.nonce}),Z2e(this._ctx,d,"/signin"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(d);return}this._startingRedirect.searchParams.set("redirect_uri",`http://127.0.0.1:${this.port}/callback`),this._logger.info(this._ctx,"Redirecting to auth server"),c.writeHead(302,{location:this._startingRedirect.toString()}),c.end();break}case"/callback":{let u=l.search||"",d=/[?&]code=([^&]+)/.exec(u),f=/[?&]state=([^&]+)/.exec(u),h=d&&d.length>1?decodeURIComponent(d[1]):void 0,m=f&&f.length>1?decodeURIComponent(f[1]):void 0,g=new URL(m||"").searchParams.get("nonce")??void 0;if(!h||!m||!g){let A="Missing required parameters, at least one from code, state, nonce is needed.",y=new gi(A);this._logger.warn(this._ctx,"OAuth callback missing required parameters",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url}),Z2e(this._ctx,y,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent(A)}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(y);return}if(this.state!==m){let A=new gi("State does not match.");this._logger.warn(this._ctx,"OAuth callback state mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedState:m,expectedState:this.state}),Z2e(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("State does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}if(this.nonce!==g){let A=new gi("Nonce does not match.");this._logger.warn(this._ctx,"OAuth callback nonce mismatch",{originalUrl:this._startingRedirect.toString(),callbackUrl:s.url,receivedNonce:g,expectedNonce:this.nonce}),Z2e(this._ctx,A,"/callback"),c.writeHead(302,{location:`/?error=${encodeURIComponent("Nonce does not match.")}${o}`}),c.end(()=>this._resolveResponseSent()),n.reject(A);return}this._logger.info(this._ctx,"OAuth callback validation successful"),n.resolve({code:h,state:m}),c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(F5r,()=>this._resolveResponseSent());break}default:c.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),c.end(F5r)}})}static{a(this,"LoopbackAuthServer")}get redirectUri(){if(this.port===void 0)throw new Error("Server is not started yet");return`http://127.0.0.1:${this.port}/callback`}set state(e){e?this._startingRedirect.searchParams.set("state",e):this._startingRedirect.searchParams.delete("state")}get state(){return this._startingRedirect.searchParams.get("state")??void 0}start(){return new Promise((e,r)=>{if(this._server.listening)throw new Error("Server is already started");let n=setTimeout(()=>{r(new Error("Timeout waiting for port"))},5e3);this._server.on("listening",()=>{let o=this._server.address();if(typeof o=="string")this.port=parseInt(o);else if(o instanceof Object)this.port=o.port;else throw new Error("Unable to determine port");clearTimeout(n),this.state=`http://127.0.0.1:${this.port}/callback?nonce=${this.nonce}`,this._logger.info(this._ctx,"OAuth server started and state configured",{port:this.port,redirectUri:this.redirectUri}),e(this.port)}),this._server.on("error",o=>{if(o.code==="EADDRINUSE"){console.warn(`Port ${Yye} is in use, retrying with a random port...`),this._server.listen(0,"127.0.0.1");return}clearTimeout(n),r(new Error(`Error listening to server: ${o.message}`))}),this._server.on("close",()=>{clearTimeout(n),r(new Error("Server closed unexpectedly"))}),this._server.listen(Yye,"127.0.0.1")})}stop(){return new Promise((e,r)=>{if(!this._server.listening){e();return}let n,o=a(()=>{n&&(clearTimeout(n),n=void 0)},"cleanup");n=setTimeout(()=>{o(),r(new Error("Timeout waiting for server to close"))},5e3),this._server.close(s=>{o(),s?r(s):e()}),this._server.closeAllConnections()})}waitForOAuthResponse(){return this._resultPromise}waitForResponseSent(){return this._responseSentPromise}};p();var Gbt=require("crypto");var yLe=class{static{a(this,"PKCEUtils")}static generateCodeVerifier(){let e=this.generateRandomBytes(32);return this.base64UrlEncode(e)}static generateCodeChallenge(e){let r=(0,Gbt.createHash)("sha256");r.update(e,"ascii");let n=r.digest();return this.base64UrlEncode(n)}static getCodeChallengeMethod(){return"S256"}static generateRandomBytes(e){return(0,Gbt.randomBytes)(e)}static base64UrlEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static getSupportedMethods(){return[this.getCodeChallengeMethod()]}static isServerSupported(e){if(!e||e.length===0)return!1;let r=this.getSupportedMethods();return e.some(n=>r.includes(n))}static createPKCEParameters(){let e=this.generateCodeVerifier(),r=this.generateCodeChallenge(e),n=this.getCodeChallengeMethod();return{codeVerifier:e,codeChallenge:r,codeChallengeMethod:n}}};var bRc="Timed out",hqi="Sign-in request was cancelled",Q5r=class{static{a(this,"CodeFlow")}},Kye=class extends Q5r{static{a(this,"CLSCodeFlow")}constructor(e){super(),this.ctx=e}async auth(e,r,n,o,s,c){let{clientId:l,clientSecret:u}=e,d=o?.resource,f=yLe.isServerSupported(n.code_challenge_methods_supported),h=f?yLe.createPKCEParameters():void 0;f?Dr.info(this.ctx,`PKCE supported by server with methods: [${n.code_challenge_methods_supported?.join(", ")}], using ${h.codeChallengeMethod}`):Dr.info(this.ctx,"PKCE not supported by server, falling back to standard OAuth flow");let m=this.buildAuthorizationParams({clientId:l,scope:r.join(" "),pkceParams:h,resource:d,...s??{}}),g=new URLSearchParams(m),A=n.authorization_endpoint+"?"+g.toString(),y=new Hbt(A,this.ctx),_=`http://127.0.0.1:${await y.start()}/signin?nonce=${encodeURIComponent(y.nonce)}`;Dr.info(this.ctx,"Auth URL created and opening browser for sign-in"),await new zye(this.ctx).open(_);let v,b=[];try{let w=[y.waitForOAuthResponse(),new Promise((x,P)=>{let D=setTimeout(()=>P(new Error(bRc)),3e5);b.push({dispose:a(()=>clearTimeout(D),"dispose")})})];if(c){let x=c;w.push(new Promise((P,D)=>{if(x.isCancellationRequested){Dr.info(this.ctx,"OAuth flow cancelled (already requested)"),D(new Error(hqi));return}let N=x.onCancellationRequested(()=>{Dr.info(this.ctx,"OAuth flow cancelled"),D(new Error(hqi))});b.push(N)}))}v=(await Promise.race(w)).code,Dr.info(this.ctx,"OAuth response received successfully")}catch(w){throw Dr.error(this.ctx,"OAuth flow error",w),w}finally{for(let x of b)x.dispose();let w,R=new Promise(x=>w=setTimeout(x,5e3));await Promise.race([y.waitForResponseSent().finally(()=>clearTimeout(w)),R]).catch(()=>{}),await y.stop().catch(x=>{Dr.warn(this.ctx,"Failed to stop loopback auth server",x)})}return await this.exchangeCodeForToken({endpointUri:n.token_endpoint,redirectUri:y.redirectUri,code:v,clientId:l,clientSecret:u,codeVerifier:h?.codeVerifier,resource:d})}async exchangeCodeForToken({endpointUri:e,redirectUri:r,code:n,clientId:o,clientSecret:s,codeVerifier:c,resource:l}){let u=[["grant_type","authorization_code"],["code",n],["client_id",o],["redirect_uri",r]];s&&u.push(["client_secret",s]),c&&u.push(["code_verifier",c]),l&&u.push(["resource",l]);let d=new URLSearchParams(u);Dr.info(this.ctx,"Exchanging authorization code for token",{endpointUri:e,clientId:o,redirectUri:r});let f=await OZ(this.ctx,e,"POST",{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},d.toString());if(f.ok){let h=await f.json();return Dr.info(this.ctx,"Token exchange successful"),h}else{let h=await f.text(),m=new Error(h);throw m.name="Token Exchange Error",m}}buildAuthorizationParams({clientId:e,scope:r,pkceParams:n,resource:o,...s}){let c=[["client_id",e],["response_type","code"],["scope",r]];n&&c.push(["code_challenge",n.codeChallenge],["code_challenge_method",n.codeChallengeMethod]),o&&c.push(["resource",o]);for(let[l,u]of Object.entries(s??{}))u!==void 0&&c.push([l,String(u)]);return c}};var XD=class t{constructor(e,r,n,o){this.id=t.providerId;this.label="GitHub";this.supportsMultipleAccounts=!1;this.authorizationServers=[t.providerId];this.ctx=e,this.serverMetadata=n,this.resourceMetadata=o,this._sessionsPromise=this.readSessions().then(s=>(setTimeout(()=>s.forEach(c=>{this.afterSessionLoad(c)}),1e3),s))}static{a(this,"GitHubAuthenticationProvider")}static{this.providerId="https://github.com/login/oauth"}async getSessions(e,r){await this.checkSessionsExpiration();let n=await this._sessionsPromise,o=e?.sort()||[];return o.length?n.filter(c=>L5r([...c.scopes].sort(),o)):n}async afterSessionLoad(e){}async readSessions(){let e=await this.ctx.get(yi).read("oauth",this.id);return e||[]}async createSession(e,r){let n=[...e].sort(),o=await this._sessionsPromise,s=this.ctx.get(Up),c=s.findAppIdToAuthenticate(),l=s.findAppSecretToAuthenticate(),u=lqi(r.provider)?r.provider:void 0,d=await new Kye(this.ctx).auth({clientId:c,clientSecret:l},n,this.serverMetadata,this.resourceMetadata,{prompt:"select_account",provider:u},r.cancellationToken),f=await this.tokenToSession(d.access_token,e);this.afterSessionLoad(f);let h=o.findIndex(g=>g.account.id===f.account.id&&L5r([...g.scopes].sort(),n)),m=new Array;return h>-1?m.push(...o.splice(h,1,f)):o.push(f),await this.storeSessions(o),f}async storeSessions(e){this._sessionsPromise=Promise.resolve(e),await this.ctx.get(yi).update("oauth",this.id,e)}async tokenToSession(e,r){let n=await this.getUserInfo(e);return{id:crypto.getRandomValues(new Uint32Array(2)).reduce((o,s)=>o+=s.toString(16),""),accessToken:e,account:{label:n.accountName,id:n.id},scopes:r}}buildGetUserInfoUrl(){try{let e=new URL(this.serverMetadata?.issuer);return e.hostname.toLowerCase()==="github.com"?"https://api.github.com/user":`${e.origin.replace(/\/+$/,"")}/api/v3/user`}catch{return"https://api.github.com/user"}}async getUserInfo(e){let r=this.buildGetUserInfoUrl(),n;try{n=await this.ctx.get(cr).fetch(new URL(r).href,{method:"GET",headers:{Authorization:`token ${e}`}})}catch(o){return jbt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}if(n.ok)try{let o=await n.json();return{id:`${o.id}`,accountName:o.login}}catch(o){return jbt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}else{let o=n.statusText;try{let s=await n.json();s.message&&(o=s.message)}catch{}return jbt.error(this.ctx,"Failed to fetch user info: ",o),{id:"",accountName:""}}}async removeSession(e){let r=await this._sessionsPromise,n=r.findIndex(o=>o.id===e);if(n>-1)r.splice(n,1),await this.storeSessions(r);else throw new Error(`No session with id '${e}' found.`)}async checkSessionsExpiration(){let e=await this._sessionsPromise;if(e.length!==0)for(let r of e)await this.isSessionExpired(r)&&await this.removeSession(r.id)}async isSessionExpired(e){let{accessToken:r}=e,{id:n,accountName:o}=await this.getUserInfo(r);return!n||!o}};var SRc=S.Object({scopes:S.Optional(S.Array(S.String({minLength:1}),{minItems:1})),authServer:S.Optional(S.String({minLength:1})),socialProvider:Qbt});async function TRc(t,e,r){try{if(e.isCancellationRequested)return[null,{code:it.RequestCancelled,message:"Sign-in request was cancelled"}];let n=t.get(Fr),{status:o,user:s,sourceEnvVar:c}=await n.checkAndUpdateStatus({authAuthority:r.authServer});if(o==="OK")return[{status:o,user:s},null];if(c)return[null,{code:it.AuthEnvVarConflict,message:_9e(c)}];let l=await qbt(t,(u,d)=>new XD(u,XD.providerId,d,void 0),{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider},e);if(!["OK","MaybeOK"].includes(l.status))throw new gi("OAuth authentication failed for unknown reasons. Please try again later.");return[l,null]}catch(n){if(n instanceof z9)return[null,{code:it.NoBrowserAvailable,message:n.message}];if(!(n instanceof gi))throw n;return[null,{code:it.CodeFlowFailed,message:n.message}]}}a(TRc,"handleSignInWithCodeFlowChecked");var mqi=je(SRc,TRc);p();p();p();var H6=class extends Error{static{a(this,"OperationCancelledError")}constructor(e="Operation was cancelled"){super(e),this.name="OperationCancelledError"}},ELe=class extends Error{static{a(this,"OperationTimeoutError")}constructor(e="Operation timed out"){super(e),this.name="OperationTimeoutError"}};function gqi(t,e,r){return e.isCancellationRequested?Promise.reject(new H6):new Promise((n,o)=>{let s=!1,c=e.onCancellationRequested(()=>{s||(s=!0,clearTimeout(l),c.dispose(),o(new H6))}),l=setTimeout(()=>{s||(s=!0,c.dispose(),o(new ELe))},r);t.then(u=>{s||(s=!0,clearTimeout(l),c.dispose(),n(u))},u=>{s||(s=!0,clearTimeout(l),c.dispose(),o(u instanceof Error?u:new Error(String(u))))})})}a(gqi,"raceWithCancellationAndTimeout");var IRc=["repo","workflow"];async function xRc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...xy(t)},json:{client_id:e,scope:n.join(" ")},timeout:3e4},s=new URL("login/device/code",r).href,c;try{c=await t.get(cr).fetch(s,o)}catch(l){throw l instanceof Error&&kI(l)?new gi(`Could not log in with device flow on ${r}: ${l.message}`):l}if(!c.ok)throw new gi(`Could not log in with device flow on ${r}: HTTP ${c.status}`);return await c.json()}a(xRc,"requestDeviceCode");async function wRc(t,e,r,n){let o={method:"POST",headers:{Accept:"application/json",...xy(t)},json:{client_id:r,device_code:e,grant_type:"urn:ietf:params:oauth:grant-type:device_code"},timeout:3e4},s;try{s=await t.get(cr).fetch(new URL("login/oauth/access_token",n).href,o)}catch(l){throw l instanceof Error&&kI(l)?new gi(`Device flow token request failed on ${n}: ${l.message}`):l}let c=await s.json();if(c.access_token||c.error==="authorization_pending"||c.error==="slow_down")return c;throw c.error&&c.error_description?new gi(c.error_description):new gi(`Unexpected ${s.status} response from device flow: ${JSON.stringify(c)}`)}a(wRc,"requestAccessToken");async function RRc(t,e){let n=await(await Lf(t,e,"user",{headers:{Accept:"application/json"}})).json();if("errors"in n)throw new gi(`Error retrieving user information: ${String(n.errors)}`);return n}a(RRc,"requestUserInfo");async function PRc(t,e,r){let n=r?.githubAppId??t.get(Up).findAppIdToAuthenticate(),o=r?.scopes??IRc,{serverUrl:s,apiUrl:c,authAuthority:l}=Y9(t,r?.authAuthority),u=await xRc(t,n,s,o),d=(async()=>{let f=Date.now()+u.expires_in*1e3,h=u.interval,m;do{if(await new Promise(A=>setTimeout(A,1e3*h)),e.isCancellationRequested)throw new H6("Sign-in request was cancelled");m=await wRc(t,u.device_code,n,s);let g=m.access_token;if(g){let A=await RRc(t,{apiUrl:c,accessToken:g});if(e.isCancellationRequested)throw new H6("Sign-in request was cancelled");let y=m.scope?m.scope.split(" ").filter(E=>E.length>0):o;return{authAuthority:l,githubAppId:n,username:A.login,accessToken:g,scopes:y}}h=m.interval??h}while(Date.now()performance.now()-n,"getElapsedTimeMs");try{let s=t.get(Fr),{status:c,user:l,sourceEnvVar:u}=await s.checkAndUpdateStatus({authAuthority:r.authServer});if(c==="OK")return[{status:c,user:l},null];if(u)return[null,{code:it.AuthEnvVarConflict,message:_9e(u)}];nhe(t,"deviceFlow");let d=t.get(Ene),f=await d.initiate(e,{scopes:r.scopes,authAuthority:r.authServer,socialProvider:r.socialProvider});await t.get(dr).connection.sendNotification(NRc,{userCode:f.userCode,verificationUri:f.verificationUri,expiresIn:f.expiresIn});let h=await gqi(f.waitForAuth,e,MRc),m=await d.save(h);return E2(t,"deviceFlow",m.status,o()),[m,null]}catch(s){if(s instanceof H6)return[null,{code:it.RequestCancelled,message:"Sign-in request was cancelled"}];if(s instanceof ELe)return E2(t,"deviceFlow","NotSignedIn",o(),s),[null,{code:it.DeviceFlowFailed,message:"Sign-in request timed out"}];if(E2(t,"deviceFlow","NotSignedIn",o(),s),!(s instanceof gi))throw s;return[null,{code:it.DeviceFlowFailed,message:s.message}]}}a(ORc,"handleSignInWithDeviceFlowChecked");var yqi=je(DRc,ORc);p();var BRc=S.Object({githubToken:S.String({minLength:1}),user:S.String({minLength:1}),githubAppId:S.Optional(S.String({minLength:1}))});async function LRc(t,e,r){let n=r.githubToken,o=r.user,s=r.githubAppId,c=t.get(Fr);return[await t.get(ET).save({...c.getConfiguredUrls(),accessToken:n,login:o,githubAppId:s}),null]}a(LRc,"handleSignInWithGithubTokenChecked");var Eqi=je(BRc,LRc);p();var FRc=S.Object({options:S.Optional(S.Object({}))});async function URc(t,e,r){return[await t.get(Fr).signOutEditor(),null]}a(URc,"handleSignOutChecked");var _qi=je(FRc,URc);p();var QRc=S.Object({transaction:S.Optional(S.String()),stacktrace:S.Optional(S.String()),properties:S.Optional(S.Record(S.String(),S.String())),platform:S.Optional(S.String()),exception_detail:S.Optional(S.Array(S.Object({type:S.Optional(S.String()),value:S.Optional(S.String()),stacktrace:S.Optional(S.Array(S.Object({filename:S.Optional(S.String()),lineno:S.Optional(S.Union([S.String(),S.Integer()])),colno:S.Optional(S.Union([S.String(),S.Integer()])),function:S.Optional(S.String()),in_app:S.Optional(S.Boolean())})))})))}),q5r=class extends Error{constructor(r,n){super(r);this.code=n;this.name="AgentEditorError"}static{a(this,"AgentEditorError")}};function qRc(t,e,r){let n=t.get(os),o=t.get(Nr).getEditorPluginInfo(),s=r.properties||{},c;r.platform&&r.exception_detail&&M5.has(o.name)&&(c=Object.assign({rollup_id:"auto",context:Twt(t),sensitive_context:{},deployed_to:n.getBuildType(),platform:r.platform,exception_detail:r.exception_detail},M5.get(o.name)),r.transaction&&(c.transaction=r.transaction),n.getBuildType()!=="dev"&&(c.release=`${c.app}@${o.version}`));let l=new q5r(r.stacktrace??"N/A",o.name);return l.stack=void 0,La(t,l,r.transaction??"",s,c),["OK",null]}a(qRc,"handleTelemetryExceptionChecked");var vqi=je(QRc,qRc);p();p();p();As();function j5r(t){let e=Date.now()+((t?.refresh_in??0)+nkt)*1e3;return new eW({token:`test token ${ir()}`,refresh_in:0,expires_at:e,...t},void 0,e)}a(j5r,"createTestCopilotToken");var Jye=class extends Eh{constructor(){super(...arguments);this.defaultToken=j5r({token:"tid=test;rt=1"})}static{a(this,"FakeCopilotTokenFetcherFromSession")}fetchTokenResult(r,n){switch(n.accessToken){case"":return{copilotToken:this.defaultToken};case"valid-github-token":return{copilotToken:j5r({token:"tid=valid-copilot-token"})};case void 0:return{failureKind:"NotSignedIn"};case"notauth-github-token":return{failureKind:"NotAuthorized",message:"notauth",canSignUpForLimited:!0};case"bogus-github-token":return{failureKind:"NotAuthorized",message:"bogus",canSignUpForLimited:!1};case"expired-github-token":return{failureKind:"HTTP401",message:"expired"};default:throw new Error("Don't have a valid GitHub token")}}};var $bt=class extends Eh{constructor(r){super();this.envelopeFn=r}static{a(this,"StaticCopilotTokenFetcher")}async fetchTokenResult(){return{copilotToken:j5r(await this.envelopeFn())}}};var jRc=S.Object({options:S.Optional(S.Object({}))});async function HRc(t,e,r){let n=new Jye;return t.get(Fr).setTransientSession({accessToken:"valid-github-token",login:"always auth"}),t.forceSet(Eh,n),t.get(ss).forceNormal("auth",{result:{status:"OK",user:"always auth"}}),await new Promise(o=>setTimeout(o,0)),["OK",null]}a(HRc,"handleTestingAlwaysAuthChecked");var H5r=je(jRc,HRc);p();As();var GRc=S.Object({messages:S.Array(S.Object({role:S.Enum(tc),content:S.String(),name:S.Optional(S.String())})),modelFamily:S.Optional(S.Enum(Tn)),stop:S.Optional(S.Array(S.String())),conversationOptions:S.Optional(S.Object({maxResponseTokens:S.Optional(S.Number()),temperature:S.Optional(S.Number())}))});async function $Rc(t,e,r){let n=new rc(t),s=await jQ(t)?Tn.Gpt35turbo:Tn.CopilotBase,c=await t.get(Yc).getBestChatModelConfig([r.modelFamily??s]),l=await sIe(t,"","");return[await n.fetchResponse({modelConfiguration:c,messages:r.messages,uiKind:"conversationIntegrationTest",stop:r.stop,intentParams:{intent:!0},llmInteraction:_A.user("test",ir())},e,l),null]}a($Rc,"handleChatMLChecked");var Cqi=je(GRc,$Rc);p();p();p();var rEe=fe(Iji(),1),C1h={ALPN_HTTP2:rEe.default.ALPN_HTTP2,ALPN_HTTP2C:rEe.default.ALPN_HTTP2C,ALPN_HTTP1_1:rEe.default.ALPN_HTTP1_1,ALPN_HTTP1_0:rEe.default.ALPN_HTTP1_0},{fetch:b1h,context:xji,reset:S1h,noCache:T1h,h1:I1h,keepAlive:x1h,h1NoCache:w1h,keepAliveNoCache:R1h,cacheStats:P1h,clearCache:k1h,offPush:D1h,onPush:N1h,createUrl:M1h,timeoutSignal:O1h,Body:B1h,Headers:wji,Request:L1h,Response:F1h,AbortController:U1h,AbortError:c1t,AbortSignal:Q1h,FetchBaseError:q1h,FetchError:j1h,ALPN_HTTP2:H1h,ALPN_HTTP2C:G1h,ALPN_HTTP1_1:$1h,ALPN_HTTP1_0:V1h}=rEe.default;var Pji=require("crypto"),kji=require("http"),Dji=require("stream"),Nji=require("util"),iEe=fe(fk());var p2c=6e5,h2c=new iEe.ProtocolRequestType("copilot/fetch"),m2c=new iEe.ProtocolRequestType("copilot/fetchCancel"),g2c=new iEe.ProgressType,A2c=new iEe.ProtocolRequestType("copilot/fetchDisconnectAll"),eB=class extends Error{static{a(this,"EditorFetcherError")}constructor(e){super(e),this.name="EditorFetcherError"}},nEe=class extends cr{constructor(r){super();this.ctx=r;this.name="EditorFetcher";this.userAgent=`GithubCopilot/${r.get(os).getVersion()}`}static{a(this,"EditorFetcher")}disconnectAll(){return this.ctx.get(dr).connection.sendRequest(A2c,{})}async fetch(r,n){n.headers||={},n.headers["user-agent"]=this.userAgent;let{signal:o}=n,s=this.ctx.get(dr).connection,c=(0,Pji.randomUUID)(),l=new jn.CancellationTokenSource,u=new Dji.PassThrough,d=a(()=>{s.sendRequest(m2c,{workDoneToken:c})},"sendCancelRequest"),f=a(()=>{u.emit("error",new c1t("EditorFetch request aborted")),u.end()},"destroyBodyStream");if(o){if(!(o instanceof AbortSignal))throw new eB("EditorFetcher received unexpected abort signal");if(o.aborted)throw new c1t("EditorFetcher signal aborted before fetch");o.addEventListener("abort",d)}s.onProgress(g2c,c,m=>{m.kind==="end"?(o?.removeEventListener("abort",d),o?.removeEventListener("abort",f),m.error&&u.emit("error",new eB(m.error)),u.end()):m.kind==="report"&&u.write(m.chunk)});let h=await new Promise((m,g)=>{let A=n.timeout??p2c,y=setTimeout(()=>{_t(this.ctx,"editorFetcher.requestTimeout",{method:n.method??"GET",timeoutMs:String(A)}),g(new eB("Request timed out from lsp server"))},A),E=a(()=>{g(new c1t("EditorFetcher request aborted"))},"rejectIfAborted");o?.addEventListener("abort",E),s.sendRequest(h2c,E2c(r,c,n),l.token).then(m).catch(_=>{let v="EditorFetcher request failed";_&&typeof _=="object"&&"message"in _&&(v+=`: ${String(_.message)}`),_&&typeof _=="object"&&"data"in _&&(v+=`: ${(0,Nji.inspect)(_.data)}`),g(new eB(v))}).finally(()=>{o?.removeEventListener("abort",E),clearTimeout(y)})});if(!h.status)throw new eB("EditorFetcher received invalid response");return o?.addEventListener("abort",f),new DI(h.status,kji.STATUS_CODES[h.status]??"",new wji(h.headers),()=>y2c(u),()=>u)}};function y2c(t){return new Promise((e,r)=>{let n="";t.on("error",r),t.on("end",()=>e(n)),t.on("data",o=>n+=String(o))})}a(y2c,"consumeStream");function E2c(t,e,r){let{timeout:n,method:o}=r,s=r.headers??{},c=r.json?JSON.stringify(r.json):r.body;return r.json&&(s["content-type"]="application/json"),{url:t,headers:s,body:c,timeout:n,method:o,workDoneToken:e}}a(E2c,"convertOptionsToParams");var _2c=S.Object({url:S.String(),headers:S.Optional(S.Record(S.String(),S.String())),body:S.Optional(S.String()),timeout:S.Optional(S.Number()),method:S.Optional(S.Union([S.Literal("GET"),S.Literal("POST"),S.Literal("DELETE")])),cancelBeforeRequest:S.Optional(S.Boolean()),cancelAfterRequest:S.Optional(S.Boolean()),cancelAfterFirstChunk:S.Optional(S.Boolean())});async function v2c(t,e,r){let n=new nEe(t),o=new AbortController,s=o.signal,{url:c,cancelBeforeRequest:l,cancelAfterRequest:u,cancelAfterFirstChunk:d,...f}=r;l&&o.abort();let h=n.fetch(c,{signal:s,...f});u&&o.abort();let m;try{m=await h}catch(y){return[{error:`Fetch stream error: ${y instanceof eB?y.message:String(y)}`},null]}let{status:g}=m,A=Object.fromEntries(Array.from(m.headers));try{if(d){let E=m.body();for await(let _ of E){let v=_.toString();return o.abort(),[{status:g,headers:A,body:v},null]}}let y=await m.text();return[{status:g,headers:A,body:y},null]}catch(y){return[{error:`Fetch stream error: ${y instanceof eB?y.message:String(y)}`},null]}}a(v2c,"handleTestingFetchChecked");var Mji=je(_2c,v2c);p();var C2c=S.Object({});async function b2c(t,e,r){return await t.get(_d).flush(),["OK",null]}a(b2c,"handleTestingFlushPromiseQueueChecked");var Oji=je(C2c,b2c);p();p();p();var J$=class{static{a(this,"FileSearch")}};p();p();p();var l1t=class{constructor(e){this.maxDegreeOfParalellism=e;this.outstandingPromises=[],this.runningPromises=0}static{a(this,"PriorityLimiter")}queue(e,r=!1){return new Promise((n,o)=>{r?this.outstandingPromises.unshift({factory:e,c:n,e:o}):this.outstandingPromises.push({factory:e,c:n,e:o}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this.runningPromises--,this.outstandingPromises.length>0&&this.consume()}};var Bji=fe(ei());var u1t="main.js",d1t=class{constructor(e,r,n=3){this.promiseResolvers=new Map;this.id=0;try{let o={cwd:process.cwd(),indexWorkspaceRoots:e,params:r};this.worker=xhn(u1t,o),this.worker.on("message",this.handleWorkerMessage.bind(this)),this.worker.on("error",s=>{this.handleUnexpectedError(s)}),this.postMessageQueue=new l1t(n)}catch(o){throw console.error(`Failed to create worker: ${o.message}`),o}}static{a(this,"IndexClient")}dispose(){return this.postMessageInQueue(new qVe(this.id++),Bji.CancellationToken.None,!0)}async indexFile(e,r,n){return await this.postMessageInQueue(new FVe(this.id++,e,r),n)}async getAllFileNames(e,r){return this.postMessageInQueue(new UVe(this.id++,e),r)}getContext(e,r,n,o,s,c){return this.postMessageInQueue(new QVe(this.id++,e,r,n,o,s),c,!0)}tryCreateIndex(e,r,n){return this.postMessageInQueue(new BVe(this.id++,e,r),n)}async postMessageInQueue(e,r,n=!1){return this.postMessageQueue.queue(()=>this.postMessageAndWait(e,r),n)}tryRemoveIndex(e,r){return this.postMessageAndWait(new LVe(this.id++,e),r)}async postMessageAndWait(e,r){if(this.fatalError)return Promise.reject(this.fatalError);let n=new Promise((s,c)=>{this.promiseResolvers.set(e.id,{resolve:s,reject:c})});this.worker.postMessage(e);let o=r.onCancellationRequested(()=>{this.worker.postMessage(new OVe(e.id))});try{return await n}finally{o.dispose()}}handleWorkerMessage(e){if(e.operation!=="response")throw new Error("Unexpected message operation");let r=this.promiseResolvers.get(e.id);if(!r)throw new Error(`Received response for message that isn't in progress: ${e.id}`);this.promiseResolvers.delete(e.id),e.error?(e.error.code=e.code,r.reject(e.error)):r.resolve(e.data)}handleUnexpectedError(e){let r;if(e instanceof Error){r=e,r.code==="MODULE_NOT_FOUND"&&r.message?.endsWith(u1t+"'")&&(r=new Error(`Failed to load ${u1t}`),r.code="CopilotPromptLoadFailure");let n=new Error().stack;r.stack&&n?.match(/^Error\n/)&&(r.stack+=n.replace(/^Error/,""))}else e&&typeof e=="object"&&"name"in e&&"status"in e&&e.name==="ExitStatus"&&typeof e.status=="number"?(r=new Error(`${u1t} exited with status ${e.status}`),r.code=`CopilotPromptWorkerExit${e.status}`):r=new Error(`Non-error thrown: ${JSON.stringify(e)}`);for(let n of this.promiseResolvers.values())n.reject(r);this.promiseResolvers.clear(),this.fatalError=r}};var xLe=fe(ei());var z6=new Ae(Glr),f1t=class{constructor(e,r,n,o,s){this.ctx=e;this.watcher=r;this.workspaceDatabasePersistenceManager=n;this.workspaceInit=new Map;this.watcher.onFileChange(async(c,l)=>{await this.indexFile(l,this.languageId(l)??"plaintext")}),this.watcher.onWorkspaceChange(async(c,l)=>{if(c===1){z6.debug(this.ctx,`workspace removed: ${l}`),await this.indexClient.tryRemoveIndex(l,xLe.CancellationToken.None);return}z6.debug(this.ctx,`workspace added: ${l}`),await this.indexAddedWorkspace(l)}),this.indexClient=new d1t(o,s);for(let c of o){let l=c.rootPath;this.workspaceInit.set(l,this.doWorkspaceIndex(l).then(()=>{z6.debug(this.ctx,`workspace ${l} indexed`),this.workspaceInit.delete(l)}))}}static{a(this,"MultiLanguageContextIndexWatcher")}isInitializing(e){for(let[r]of this.workspaceInit)if(e.startsWith(r))return!0;return!1}dispose(){return this.indexClient.dispose()}async indexAddedWorkspace(e){let r=await S2c(e,this.workspaceDatabasePersistenceManager);await this.indexClient.tryCreateIndex(r.rootPath,r.databaseFilePath,xLe.CancellationToken.None),this.workspaceInit.has(e)&&await this.workspaceInit.get(e);let n=this.doWorkspaceIndex(e).then(()=>{z6.debug(this.ctx,`workspace ${e} indexed`),this.workspaceInit.delete(e)});this.workspaceInit.set(e,n)}async doWorkspaceIndex(e){z6.debug(this.ctx,`indexing workspace ${e}`);let r=U6t.map(f=>`*${f}`);if(r.length===0)return;let o=`**/${U6t.length===1?r[0]:`{${r.join(",")}}`}`,s=this.ctx.get(J$),c=await Promise.all([s.findFiles(o,{uri:e},{excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0,excludeIDESearchIgnoredFiles:!0}),this.indexClient.getAllFileNames(e,xLe.CancellationToken.None)]),l=c[0],u=c[1],d=Array.from(new Set([...l,...u]));z6.debug(this.ctx,`found ${d.length} files to index in ${e}`),await Promise.all(d.map(async f=>{let h=this.languageId(f);h&&await this.indexFile(f.replace(/\/+$/,""),h)})),z6.debug(this.ctx,`finished indexing workspace ${e}`)}async indexFile(e,r){try{z6.debug(this.ctx,`index triggered for ${e}`),await this.indexClient.indexFile(e,r,xLe.CancellationToken.None)}catch(n){z6.debug(this.ctx,`failed to index ${e} with ${n}`)}}languageId(e){return Rfn(e)}};async function S2c(t,e){return{databaseFilePath:await e.getDBFilePath(t),rootPath:t}}a(S2c,"createIndexableWorkspaceFolder");var T2c=S.Object({filePath:S.String(),code:S.String(),offset:S.Number(),languageId:S.String(),timeout:S.Optional(S.Number()),waitForContext:S.Optional(S.Boolean())});async function I2c(t,e,r){try{await t.get(CS).start();let n=t.get(f1t),o=r.timeout??1e3,s=Date.now(),c=[],l=!0;for(;l;)try{c=await n.indexClient.getContext(r.filePath,r.code,r.offset,r.languageId,$lr,e)}catch{}finally{l=(r.waitForContext??!1)&&c.length==0&&Date.now()-ssetTimeout(n,0)),["OK",null]}a(P2c,"handleTestingNeverAuthChecked");var y4r=je(R2c,P2c);p();p();p();var E4r=class extends sp{constructor(r){super();this.certificates=r}static{a(this,"TestCertificateReader")}getAllRootCAs(){return this.certificates}},Uji=a(t=>new E4r(t),"createTestCertificateReader");function v4r(t,e,r){let n=new _4r;n.set("x-github-request-id","1");for(let[o,s]of Object.entries(r||{}))n.set(o,s);return new DI(t,"status text",n,()=>Promise.resolve(e??""),()=>null)}a(v4r,"createFakeResponse");function Qji(t,e,r){let n;return typeof e=="string"?n=e:n=JSON.stringify(e),v4r(t,n,Object.assign({"content-type":"application/json"},r))}a(Qji,"createFakeJsonResponse");var wLe=class extends cr{constructor(){super(...arguments);this.name="FakeFetcher"}static{a(this,"FakeFetcher")}disconnectAll(){throw new Error("Method not implemented.")}};var p1t=class extends wLe{static{a(this,"NoFetchFetcher")}fetch(e,r){throw new Error("NoFetchFetcher does not support fetching")}};var _4r=class{constructor(){this.headers=new Map}static{a(this,"FakeHeaders")}append(e,r){this.headers.set(e.toLowerCase(),r)}delete(e){this.headers.delete(e.toLowerCase())}get(e){return this.headers.get(e.toLowerCase())??null}has(e){return this.headers.has(e.toLowerCase())}set(e,r){this.headers.set(e.toLowerCase(),r)}entries(){return this.headers.entries()}keys(){return this.headers.keys()}values(){return this.headers.values()}[Symbol.iterator](){return this.headers.entries()}};var C4r=class extends wLe{static{a(this,"ExpConfigFetcher")}constructor(e){super(),this.fullConfig={Features:[],Flights:{},Configs:[{Id:"vscode",Parameters:e.Parameters}],ParameterGroups:[],AssignmentContext:e.AssignmentContext}}fetch(e,r){return e.endsWith("telemetry")?Promise.resolve(Qji(200,this.fullConfig)):Promise.resolve(v4r(404,""))}},h1t=class extends C4r{constructor(r,n){super(r);this.delegate=n}static{a(this,"ExpConfigFetcherWithDelegate")}fetch(r,n){return r.endsWith("telemetry")?super.fetch(r,n):this.delegate.fetch(r,n)}};var k2c=S.Object({expFlags:S.Record(S.String(),S.Union([S.String(),S.Number(),S.Boolean()]))});function D2c(t,e,r){if(r.expFlags){let n={AssignmentContext:"assignmentcontext",Parameters:{...r.expFlags}};t.forceSet(cr,new h1t(n,t.get(cr)))}return["OK",null]}a(D2c,"handleTestingOverrideExpFlagsChecked");var qji=je(k2c,D2c);p();var N2c=S.Object({rules:YUt});function M2c(t,e,r){return t.get(ec).setTestingRules(r.rules),["OK",null]}a(M2c,"handleTestingSetContentExclusionRulesChecked");var jji=je(N2c,M2c);p();var O2c=S.Object({workDoneToken:S.Union([S.String(),S.Number()]),chunks:S.Array(S.String()),followUp:S.Optional(S.String()),suggestedTitle:S.Optional(S.String()),skills:S.Optional(S.Array(S.String())),references:S.Optional(S.Array(nO)),options:S.Optional(S.Object({}))});function B2c(t,e,r){return t.get(Y6).add(r.workDoneToken,r.chunks,r.followUp,r.suggestedTitle,r.skills,r.references),["OK",null]}a(B2c,"handleTestingSetSyntheticTurnsChecked");var Hji=je(O2c,B2c);p();var L2c=S.Object({});async function F2c(t,e,r){let n=t.get(Hs),o=t.get(Nf);return await n.showWarningMessage("This is a test message",{title:"Some Action"}).then(c=>s(3,"response from message request",c?.title)).catch(c=>s(1,"error sending show message request",c)),["OK",null];function s(c,l,u){return o.logIt(t,c,"triggerShowMessage",`${l} (${String(u)})`)}a(s,"sendNotification")}a(F2c,"handleTriggerShowMessageChecked");var Gji=je(L2c,F2c);p();p();p();p();var $ji=fe(require("tls"));var oEe=class{static{a(this,"RootCertificateConfigurator")}#e;constructor(e){this._certificateReader=e.get(sp)}async getCertificates(){let e=await this._certificateReader.getAllRootCAs();if(e.length!==0)return e}async createSecureContext(){let e=await this._certificateReader.getAllRootCAs(),n=$ji.createSecureContext({_vscodeAdditionalCaCerts:e}),o=n.context;for(let s of e)o.addCACert(s);return{secureContext:n,certs:e}}async applyToRequestOptions(e){this.#e??=this.createSecureContext();let r=await this.#e;e.secureContext=r.secureContext,e.ca=r.certs,e.cert=r.certs}};p();var nHi=fe(require("http"));var lDc=407,fy=new Ae("proxySocketFactory"),BR=class{static{a(this,"ProxySocketFactory")}},Sne=class extends Error{static{a(this,"ProxySocketError")}constructor(e,r,n){super(e),this.code=r?.code,this.syscall=r?.syscall,this.errno=r?.errno,/^Failed to establish a socket connection to proxies:/.test(r?.message??"")?this.code="ProxyFailedToEstablishSocketConnection":/^InitializeSecurityContext:/.test(r?.message??"")?this.code="ProxyInitializeSecurityContext":r?.message==="Miscellaneous failure (see text): Server not found in Kerberos database"?this.code="ProxyKerberosServerNotFound":/^Unspecified GSS failure. {2}Minor code may provide more information: No Kerberos credentials available/.test(r?.message??"")&&(this.code="ProxyGSSFailureNoKerberosCredentialsAvailable"),n!==void 0&&(this.code=n);let o=/^ProxyStatusCode(\d+)$/.exec(this.code??"");o&&(this.statusCode=Number(o[1]))}};function m1t(t){return new T4r(t,new I4r(t))}a(m1t,"getProxySocketFactory");var T4r=class extends BR{constructor(r,n,o=new PLe,s=process.platform){super();this.ctx=r;this.delegate=n;this.kerberosLoader=o;this.platform=s;this.successfullyAuthorized=new yn(20)}static{a(this,"KerberosProxySocketFactory")}async createSocket(r,n){this.successfullyAuthorized.get(this.getProxyCacheKey(n))&&(fy.debug(this.ctx,"Proxy authorization already successful once, skipping 407 round trip"),await this.reauthorize(r,n));try{return await this.delegate.createSocket(r,n)}catch(o){if(o instanceof Sne&&o.code===`ProxyStatusCode${lDc}`){fy.debug(this.ctx,"Proxy authorization required, trying to authorize first time");let s=await this.authorizeAndCreateSocket(r,n);if(s)return fy.debug(this.ctx,"Proxy authorization successful, caching result"),yt(this.ctx,"proxy.kerberosAuthorized"),this.successfullyAuthorized.set(this.getProxyCacheKey(n),!0),s}throw o}}async reauthorize(r,n){let o=await this.authorize(n);o&&(fy.debug(this.ctx,"Proxy re-authorization successful, received token"),r.headers["Proxy-Authorization"]="Negotiate "+o)}async authorizeAndCreateSocket(r,n){let o=await this.authorize(n);if(fy.debug(this.ctx,"Proxy authorization successful, received token"),o)return fy.debug(this.ctx,"Trying to create socket with proxy authorization"),r.headers["Proxy-Authorization"]="Negotiate "+o,await this.delegate.createSocket(r,n)}async authorize(r){fy.debug(this.ctx,"Loading kerberos module");let n=await this.kerberosLoader.load(),o=this.computeSpn(r);fy.debug(this.ctx,"Initializing kerberos client using spn",o);let s=await n.initializeClient(o);fy.debug(this.ctx,"Perform client side kerberos step");let c=await s.step("");return fy.debug(this.ctx,"Received kerberos server response"),c}computeSpn(r){let n=r.kerberosServicePrincipal;if(n)return fy.debug(this.ctx,"Using configured kerberos spn",n),n;let o=this.platform==="win32"?`HTTP/${r.hostname}`:`HTTP@${r.hostname}`;return fy.debug(this.ctx,"Using default kerberos spn",o),o}getProxyCacheKey(r){return`${r.hostname}:${r.port}`}},I4r=class extends BR{constructor(r){super();this.ctx=r;this.userAgent=`GithubCopilot/${this.ctx.get(os).getVersion()}`}static{a(this,"TunnelingProxySocketFactory")}async createSocket(r,n){let o=this.createConnectRequestOptions(r,n);return new Promise((s,c)=>{fy.debug(this.ctx,"Attempting to establish connection to proxy");let l=nHi.request(o);l.useChunkedEncodingByDefault=!1,l.once("connect",(u,d,f)=>{fy.debug(this.ctx,"Socket Connect returned status code",u.statusCode),l.removeAllListeners(),d.removeAllListeners(),u.statusCode!==200?(d.destroy(),c(new Sne(`tunneling socket could not be established, statusCode=${u.statusCode}`,void 0,`ProxyStatusCode${u.statusCode}`))):f.length>0?(d.destroy(),c(new Sne(`got non-empty response body from proxy, length=${f.length}`,void 0,"ProxyNonEmptyResponseBody"))):(fy.debug(this.ctx,"Successfully established tunneling connection to proxy"),s(d))}),l.once("error",u=>{fy.debug(this.ctx,"Proxy socket connection error",u.message),l.removeAllListeners(),c(new Sne(`tunneling socket could not be established, cause=${u.message}`,u))}),l.on("timeout",()=>{fy.debug(this.ctx,"Proxy socket connection timeout"),c(new Sne(`tunneling socket could not be established, proxy socket connection timeout while connecting to ${o.hostname}:${o.port}`,void 0,"ProxyTimeout"))}),l.end()})}createConnectRequestOptions(r,n){let o=`${r.hostname}:${r.port}`,s={hostname:n.hostname,port:n.port,method:"CONNECT",path:o,agent:!1,headers:{host:o,"Proxy-Connection":"keep-alive","User-Agent":this.userAgent},timeout:r.timeout};return r.localAddress&&(s.localAddress=r.localAddress),this.configureProxyAuthorization(s,r,n.authorization),s}configureProxyAuthorization(r,n,o){r.headers["Proxy-Authorization"]=[],o&&r.headers["Proxy-Authorization"].push("Basic "+Buffer.from(o).toString("base64")),typeof n.headers?.["Proxy-Authorization"]=="string"&&r.headers["Proxy-Authorization"].push(n.headers["Proxy-Authorization"])}},PLe=class{static{a(this,"KerberosLoader")}load(){return Promise.resolve().then(()=>fe(rHi()))}};var Tne=class extends cr{constructor(r,n){super();this.name="HelixFetcher";this.certificateConfigurator=new oEe(r),this.proxySocketFactory=r.get(BR),this.proxySocketTimeoutForTesting=n?.proxySocketTimeoutForTesting,r.get(Yo).onDidChangeHttpSettings(o=>{this.fetchApi=this.createFetchApi(r,o),this.updateNoProxy(o.noProxy)}),this.fetchApi=this.createFetchApi(r,r.get(Yo).getHttpSettings()),this.updateNoProxy(r.get(Yo).getHttpSettings().noProxy),this.fetchApiByPass=this.createFetchApi(r,{proxy:""})}static{a(this,"HelixFetcher")}maybeCreateSocketFactory(r,n){if(!r?.proxy)return;let o=new URL(r.proxy);return async s=>(s.rejectUnauthorized=r.proxyStrictSSL,s.timeout=n,await this.certificateConfigurator.applyToRequestOptions(s),await this.proxySocketFactory.createSocket(s,{hostname:o.hostname,port:o.port,authorization:r.proxyAuthorization,kerberosServicePrincipal:r.proxyKerberosServicePrincipal}))}createFetchApi(r,n){let o=r.get(os),s=this.proxySocketTimeoutForTesting;return xji({userAgent:`GithubCopilot/${o.getVersion()}`,socketFactory:this.maybeCreateSocketFactory(n,s),rejectUnauthorized:n.proxyStrictSSL})}parseNoProxy(r){return r?.map(n=>n.trim()).filter(n=>n.length>0)||[]}updateNoProxy(r){if(this.noProxy=this.parseNoProxy(r),this.proxyExceptionFilters=void 0,!this.noProxy.length)return;if(this.noProxy.includes("*")){this.proxyExceptionFilters=[{regex:/.*/i}];return}let n=a(s=>{if(!s)return;s.startsWith(".")&&(s=`*${s}`);let c=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${c}$`,"i")}catch{return}},"toRegex"),o=[];for(let s of this.noProxy){let c=s,l;if(c.startsWith("[")){let d=c.indexOf("]");if(d!==-1){let f=c.slice(1,d),h=c.slice(d+1);h.startsWith(":")&&(l=h.slice(1)),c=f}}else{let d=c.split(":");d.length===2&&(c=d[0],l=d[1])}let u=n(c);u&&o.push({regex:u,port:l})}o.length&&(this.proxyExceptionFilters=o)}shouldBypassProxy(r){if(!this.proxyExceptionFilters||!this.proxyExceptionFilters.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.proxyExceptionFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}async fetch(r,n){let o=n.signal,s=!1;if(n.timeout){let f=new AbortController;setTimeout(()=>{f.abort(),s=!0},n.timeout),n.signal?.addEventListener("abort",()=>f.abort()),n.signal?.aborted&&f.abort(),o=f.signal}let c={...n,body:n.body?n.body:n.json,signal:o},l=this.shouldBypassProxy(r);if(!l){await this.certificateConfigurator.applyToRequestOptions(c);let f=await this.certificateConfigurator.getCertificates();this.fetchApi.setCA(f)}let d=await(l?this.fetchApiByPass:this.fetchApi).fetch(r,c).catch(f=>{throw s?new YV(`Request to <${r}> timed out after ${n.timeout}ms`,f):f});return new DI(d.status,d.statusText,d.headers,()=>d.text(),()=>d.body)}disconnectAll(){return this.fetchApi.reset()}};p();p();var cEe=class extends N0{constructor(r,n={}){super();this.env=n;this.recalculateUrlDefaults(r,this.getDefaultUrls())}static{a(this,"DefaultNetworkConfiguration")}getAuthAuthority(){return this.baseUrlObject.hostname}getConfiguredUrls(){return{serverUrl:this.baseUrlObject.href,apiUrl:this.apiUrl}}setConfiguredUrls(r,n){let o=this.getConfiguredUrls();this.recalculateUrlDefaults(r,n);let s=this.getConfiguredUrls();(o.apiUrl!==s.apiUrl||o.serverUrl!==s.serverUrl)&&r.get(Ut).resetToken("config_urls_changed"),r.get(Hf).updateSessionConfig(s)}recalculateUrlDefaults(r,n){let{serverUrl:o,apiUrl:s}=wy({serverUrl:A9e(r,n.serverUrl),apiUrl:A9e(r,n.apiUrl)});this.baseUrlObject=new URL(o),this.apiUrl=s}getDefaultUrls(){return this.env.CODESPACES==="true"&&this.env.GITHUB_TOKEN&&this.env.GITHUB_SERVER_URL&&this.env.GITHUB_API_URL&&!this.env.GITHUB_COPILOT_TOKEN&&!this.env.GH_COPILOT_TOKEN?{apiUrl:this.env.GITHUB_API_URL,serverUrl:this.env.GITHUB_SERVER_URL}:{}}};p();var lEe=class extends dB{static{a(this,"TelemetryLogSenderImpl")}sendException(e,r,n){La(e,r,n)}};p();var uEe=class extends k5{static{a(this,"EmptyRecentEditsProvider")}isEnabled(){return!1}start(){}getRecentEdits(){return[]}getEditSummary(e){return null}};p();var g1t=class extends Tk{constructor(r=[]){super();this._agents=r}static{a(this,"TestRemoteAgentRegistry")}agents(){return this._agents}};p();var A1t=class extends jh{constructor(){super(...arguments);this.prompts=[];this.fetchResults=[];this.diffs=[]}static{a(this,"TestConversationInspector")}shouldInspect(){return!0}inspectPrompt(r){this.shouldInspect()&&this.prompts.push(r)}inspectFetchResult(r){this.shouldInspect()&&this.fetchResults.push(r)}documentDiff(r){this.shouldInspect()&&this.diffs.push(r)}};p();var y1t=class extends J${constructor(){super(...arguments);this.allowedFiles=[]}static{a(this,"TestingFileSearch")}addAllowedFiles(r){this.allowedFiles.push(...r)}findFiles(r,{uri:n},o){return Promise.resolve(this.allowedFiles)}};p();function iHi(t,e="cl100k_base"){return{modelId:"gpt-3.5-turbo",modelFamily:t,uiName:"Test GPT",maxRequestTokens:6144,maxResponseTokens:2048,baseTokensPerMessage:3,baseTokensPerName:1,baseTokensPerCompletion:3,tokenizer:e,isExperimental:!1,stream:!0,toolCalls:!0}}a(iHi,"fakeChatModelConfiguration");function uDc(t){return{modelId:"embedding-test",modelFamily:t,maxBatchSize:1,maxTokens:50,tokenizer:"cl100k_base"}}a(uDc,"fakeEmbeddingModelConfiguration");var E1t=class extends Yc{static{a(this,"TestModelConfigurationProvider")}getBestChatModelConfig(e){let r=e[0];return Promise.resolve(iHi(r))}getModelConfigurationById(e){return Promise.resolve({...iHi(e),modelId:e})}getFirstMatchingEmbeddingModelConfiguration(e){return Promise.resolve(uDc(e))}};p();var _1t=class extends M0{constructor(){super(...arguments);this.openedUrls=[];this.opened=new nA}static{a(this,"TestUrlOpener")}open(r){return this.openedUrls.push(r),this.opened.resolve(),Promise.resolve()}},v1t=class extends Hs{constructor(){super();this.sentMessages=[];this.warningPromises=[];this.informationPromises=[]}static{a(this,"TestNotificationSender")}performDismiss(){this.actionToPerform="DISMISS"}performAction(r){this.actionToPerform=r}showWarningMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.warningPromises.push(o),o}showInformationMessage(r,...n){this.sentMessages.push(r);let o;if(this.actionToPerform)if(this.actionToPerform==="DISMISS")o=Promise.resolve(void 0);else{let s=n.find(c=>c.title===this.actionToPerform);o=s?Promise.resolve(s):Promise.resolve(void 0)}else o=n?Promise.resolve(n[0]):Promise.resolve(void 0);return this.informationPromises.push(o),o}showInformationModal(r,...n){return this.showInformationMessage(r,...n)}sendBackgroundAgentSessionUpdate(r,n,o,s){return Promise.resolve()}async waitForMessages(){await Promise.all(this.warningPromises),await Promise.all(this.informationPromises)}};p();function oHi(t,e,r,n){return gS.create(g9e(t),e,r,n,e)}a(oHi,"createTextDocument");var x4r=class extends an{constructor(r,n){super(r,n);this._openTextDocuments=[];this._notebookDocuments=new Map;this._workspaceFolders=[];this.didFocusTextDocumentEmitter=new no;this.onDidFocusTextDocument=this.didFocusTextDocumentEmitter.event;this.didChangeTextDocumentEmitter=new no;this.onDidChangeTextDocument=this.didChangeTextDocumentEmitter.event;this.didOpenTextDocumentEmitter=new no;this.onDidOpenTextDocument=this.didOpenTextDocumentEmitter.event;this.didCloseTextDocumentEmitter=new no;this.onDidCloseTextDocument=this.didCloseTextDocumentEmitter.event;this.didChangeWorkspaceFoldersEmitter=new no;this.onDidChangeWorkspaceFolders=this.didChangeWorkspaceFoldersEmitter.event}static{a(this,"SimpleTestTextDocumentManager")}init(r){this._workspaceFolders=r.map(n=>({uri:n.uri,name:n.name??Ki(n.uri)}))}async readTextDocumentFromDisk(r){return super.readTextDocumentFromDisk(r)}getTextDocumentsUnsafe(){return this._openTextDocuments}setTextDocument(r,n,o){let s=oHi(r,n,0,o);return this._openTextDocuments.push(s),s}updateTextDocument(r,n){let o=this._openTextDocuments.findIndex(c=>c.uri===r.toString());if(o<0)throw new Error("Document not found");let s=this._openTextDocuments[o];this._openTextDocuments[o]=oHi(r,s.clientLanguageId,s.version+1,n)}setNotebookDocument(r,n){this._notebookDocuments.set(r.uri.replace(/#.*/,""),n)}findNotebook({uri:r}){return this._notebookDocuments.get(r.replace(/#.*/,""))}getWorkspaceFolders(){return this._workspaceFolders}},C1t=class extends x4r{constructor(r){super(r);this.contents=new Map}static{a(this,"TestTextDocumentManager")}readTextDocumentFromDisk(r){return Promise.resolve(this.contents.get(r))}setDiskContents(r,n){this.contents.set(r,n)}};var w4r=class extends Nf{static{a(this,"NullLog")}logIt(...e){}},R4r=class extends Fr{static{a(this,"TestAuthManager")}constructor(e,r){super(e,{}),this.transientSession=r&&Promise.resolve(r)}resolvePersistedSession(){return Promise.resolve(void 0)}signInEditor(e){return Promise.resolve({status:"OK",user:"test-user"})}signOutEditor(){return Promise.resolve({status:"NotSignedIn"})}revokeTokenById(){return Promise.resolve({affectedEditors:0})}useExistingToken(e){return Promise.resolve({status:"revoked"})}listAvailableTokens(){return Promise.resolve([])}};function dDc(t){let e=new ple;e.set(Yo,t),e.set(Hz,t);let r=new R4r(e,{accessToken:"",login:"user"});e.set(Fr,r),e.set(os,new os),e.set(yI,new yI({debug:!1,verboseLogging:!1,testMode:!0,simulation:!1})),e.set(sp,Uji([])),e.set(BR,m1t(e)),e.set(oM,new oM),e.set(LP,new IQe);let n=new Jye;e.set(Eh,n);let o=new Ut(e,!0);e.set(Ut,o);let s=new Mf(e);return s.updateFromToken(n.defaultToken),e.set(Mf,s),e.set(k0,new k0),e.set(_N,new _N),e.set(Hs,new v1t),e.set(M0,new _1t),e.set(dB,new lEe),e.set(Nf,new w4r),e.set(sC,new sC),e.set(Oa,new Oa("test-session","test-machine","test-device")),e.set(AI,new AI(()=>Promise.resolve("test-device"))),e.set(N0,new cEe(e)),e.set(rP,new uie),e.set(Hf,new Hf(e,"copilot-test")),e.set(Jt,new Jt(e)),e.set(IM,new IM(e,o)),e.set(l2,new l2),e.set(JP,new Xae),e.set(ss,new CQe),e.set(_d,new _d),e.set(A5,new A5(e)),e.set(J$,new y1t),e.set(g2,new g2(e)),e.set(UF,Nlt(e)),e.set(GA,new GA),e.set(pb,new pb),e.set(QF,QF.default),e.set(fx,new fx(e,!1)),e.set(Up,new Up),e.set(ri,new ri(e)),e.set(yT,new Blt),e.set(i0,new i0),e.set(o0,Wat(e,(c,l,u)=>l.find(d=>d==="*")?1:l.find(d=>typeof d!="string"&&d.language===u.languageId)?10:0)),e.set(hb,new hb(e)),fDc(e),e.set(fb,new fb(e)),e.set(On,new On),e.set(k5,new uEe),e.set(_2,new _2),e.set(Yx,new Yx),e.set(Nk,new Nk(e)),e}a(dDc,"_createBaselineContext");function fDc(t){t.set(Go,new Go(t)),t.set(vc,new vc(t)),t.set(gA,new gA(t)),t.set(Hh,new Hh),t.set(ng,new ng),t.set(jh,new A1t),t.set(MR,new MR(t,[])),t.set(Yc,new E1t),t.set(Tk,new g1t),t.set(tO,new tO(t));let e=new zD(t);t.set(zD,e),t.set(NR,new NR(e,t)),t.set(aO,new aO(t)),t.set(tI,new lbt),t.set(MC,new MC(t.get(NR),t.get(tI),t)),t.set(tm,new tm)}a(fDc,"registerConversation");function sHi(){let t=dDc(new Hz(new ece,new Map));return t.set(cr,new p1t),t.set(Nr,new P4r),t.set(an,new C1t(t)),t.set(jo,new rQ),t.set(ec,new ec(t)),t.set(uu,new uu(t)),t.set(SS,new sYe),t.set($M,new $M(t)),t.set(y5,new wpe),t.set(c2,new Aat),t.set(lu,new Gze),t.set(S_,new S_(t)),t.set(mA,new wze),t.set(am,new am),xze(t),t.set(jA,new ihe(t)),t}a(sHi,"createLibTestingContext");var P4r=class extends Nr{constructor(r={name:"lib-tests-plugin",version:"2"},n={name:"lib-tests-editor",version:"1"},o=[{name:"lib-tests-related-plugin",version:"3"}]){super();this.editorPluginInfo=r;this.editorInfo=n;this.relatedPluginInfo=o}static{a(this,"LibTestsEditorInfo")}getEditorInfo(){return this.editorInfo}getEditorPluginInfo(){return this.editorPluginInfo}getRelatedPluginInfo(){return this.relatedPluginInfo}};var cHi=fe(require("fs"));var aHi=`${process.env.HOME}/.copilot-testing-gh-token`,b1t,S1t;function lHi(t){let e=uHi(),r=new $bt(pDc);return t.forceSet(Eh,r),t.get(Fr).setTransientSession(e),r}a(lHi,"setIntegrationTokenManager");var pDc=a(async()=>{if(S1t)return S1t;let t=await uHi(),e=sHi(),r=new Tne(e);return e.forceSet(cr,r),S1t=ikt(e,t).then(n=>{if(n.copilotToken)return{token:n.copilotToken.token,refresh_in:n.copilotToken.envelope.refresh_in};throw new gi('Could not fetch testing Copilot token. Try running "npm run get_token" again?')}),S1t},"getEnvelope");async function uHi(){let{session:t}=VNt(process.env);if(t)return t;try{b1t??=(await cHi.promises.readFile(aHi)).toString().trim()}catch{b1t??=process.env.GITHUB_TOKEN??""}if(!b1t)throw new Error(`Tests: either GH_COPILOT_TOKEN, GITHUB_COPILOT_TOKEN, or GITHUB_TOKEN must be set, or there must be a GitHub token from an app with access to Copilot in ${aHi}. Run "npm run get_token" to get one.`);return{...wy({}),accessToken:b1t,login:"copilot-client tests"}}a(uHi,"getTestingGitHubSession");var hDc=S.Object({options:S.Optional(S.Object({})),githubAppId:S.Optional(S.String())});async function mDc(t,e,r){return lHi(t),await t.get(Ut).primeToken(),["OK",null]}a(mDc,"handleTestingUseTestingTokenChecked");var dHi=je(hDc,mDc);p();var gDc=S.Object({});async function ADc(t,e,r){return await new FAe().uninstall(t),["OK",null]}a(ADc,"handleUninstallChecked");var fHi=je(gDc,ADc);p();var yDc=LYn;function EDc(t,e,r){let n=t.get(o0),o={unregistered:[],notUnregistered:[]};return r.providers.forEach(s=>{try{n.unregisterContextProvider(s.id),o.unregistered.push(s.id)}catch{o.notUnregistered.push(s.id)}}),[o,null]}a(EDc,"unregisterContextProviders");var pHi=je(yDc,EDc);p();var k4r=fe(require("os"));var _Dc=S.Object({expectedCertificate:S.String()});async function vDc(t,e,r){let o=(await Vnt(t).getAllRootCAs()).map(Vye),s=Vye(r.expectedCertificate);return o.includes(s)?[{status:!0,message:"Certificate verified"},null]:[{status:!1,message:`expected certificate not found - Expected to find certificate ${w5r(s)}. Only found those installed on the system:${k4r.EOL}${o.map(c=>"- "+w5r(c)).join(k4r.EOL)}`},null]}a(vDc,"handleVerifyCertificateChecked");var hHi=je(_Dc,vDc);p();var CDc=S.Object({});async function bDc(){return[{status:!!await new PLe().load()},null]}a(bDc,"handleVerifyKerberosChecked");var mHi=je(CDc,bDc);p();var SDc=S.Object({source:S.String(),version:S.Number(),uri:S.String()});async function TDc(t,e,r){let o=await t.get(an).getTextDocument(r);return o?o.getText()!==r.source?[{status:!1,message:`Source mismatch: [State] ${o.getText()} !== [Request] ${r.source}`},null]:o.version!==r.version?[{status:!1,message:`Version mismatch: [State] ${o.version} !== [Request] ${r.version}`},null]:[{status:!0,message:""},null]:[{status:!1,message:`Document not found: <${r.uri}>`},null]}a(TDc,"handleVerifyStateChecked");var gHi=je(SDc,TDc);p();var IDc=S.Object({});function xDc(t,e,r){return[t.get(an).getWorkspaceFolders().map(o=>{let s=new URL(o.uri),c=decodeURIComponent(s.pathname);return{...o,path:c}}),null]}a(xDc,"handleVerifyWorkspaceStateChecked");var AHi=je(IDc,xDc);p();p();var fEe=fe(require("fs/promises")),yHi=fe(require("os")),Hd=fe(require("path"));var Tp=new Ae("GitWorktreeService"),wDc=20,dEe=class{constructor(e){this.ctx=e;this.gitInstances=new yn(wDc)}static{a(this,"GitWorktreeService")}getGitInstance(e){let r=Hd.resolve(e),n=this.gitInstances.get(r);return n||(n=bJe(r),this.gitInstances.set(r,n)),n}generateTimestamp(){return new Date().toISOString().replace(/[:.]/g,"-").slice(0,19)}async runGitOperation(e,r,n,o){let s=Hd.resolve(e);Tp.info(this.ctx,`[git] ${r} started for ${s}`);try{let c=await n(this.getGitInstance(s)),l=o?.(c);return Tp.info(this.ctx,`[git] ${r} finished for ${s}${l?` (${l})`:""}`),c}catch(c){let l=c instanceof Error?c.message:String(c);throw Tp.error(this.ctx,`[git] ${r} failed for ${s}: ${l}`),c}}async isGitRepository(e){try{return await this.runGitOperation(e,"checkIsRepo",r=>r.checkIsRepo(),r=>`isRepo=${r}`)}catch{return!1}}async getHeadCommit(e){return(await this.runGitOperation(e,"rev-parse HEAD",n=>n.raw(["rev-parse","HEAD"]),n=>`head=${n.trim()}`)).trim()}async commitWorktreeChanges(e,r,n){let o=await this.runGitOperation(e,"status",s=>s.status(),s=>`files=${s.files.length}`);return o.files.length===0?(Tp.info(this.ctx,`Skipping checkpoint commit for ${Hd.resolve(e)} because there are no changes`),!1):(await this.runGitOperation(e,"add -A -- .",s=>s.raw(["add","-A","--","."])),await this.runGitOperation(e,`commit ${r}`,s=>s.commit(r)),Tp.info(this.ctx,`Created ${n} commit for ${Hd.resolve(e)} with ${o.files.length} changed file(s)`),!0)}async snapshotCopiedChanges(e){Tp.info(this.ctx,`Snapshotting copied changes in ${Hd.resolve(e)} to establish the apply baseline`),await this.commitWorktreeChanges(e,"chore: snapshot copied worktree changes","copied worktree changes");let r=await this.getHeadCommit(e);return Tp.info(this.ctx,`Using copied-changes snapshot commit ${r} as the worktree baseCommit`),r}async applyPatchToRepository(e,r){let n=await fEe.mkdtemp(Hd.join(yHi.tmpdir(),"copilot-worktree-")),o=Hd.join(n,"changes.patch");try{Tp.info(this.ctx,`Writing temporary patch for ${Hd.resolve(e)} to ${o} (${r.length} chars)`),await fEe.writeFile(o,r,"utf8"),await this.runGitOperation(e,`apply --check ${o}`,s=>s.raw(["apply","--check",o])),await this.runGitOperation(e,`apply ${o}`,s=>s.raw(["apply",o]))}finally{await fEe.rm(n,{recursive:!0,force:!0}),Tp.info(this.ctx,`Removed temporary patch file ${o}`)}}async createWorktree(e){let{repositoryPath:r}=e;if(!await this.isGitRepository(r))throw new Error(`${r} is not a git repository`);let s=(await this.runGitOperation(r,"branch",g=>g.branch(),g=>`current=${g.current||"HEAD"}`)).current||"HEAD",c=await this.getHeadCommit(r),l=this.generateTimestamp(),u=`copilot/worktree-${l}`,d=`copilot-worktree-${l}`,f=Hd.basename(r),h=Hd.join(Hd.dirname(r),`${f}.worktrees`),m=Hd.join(h,d);return Tp.info(this.ctx,`Preparing worktree creation for ${Hd.resolve(r)} with branch ${u}, baseBranch ${s}, baseCommit ${c}`),await this.runGitOperation(r,`worktree add -b ${u} ${m} ${s}`,g=>g.raw(["worktree","add","-b",u,m,s])),Tp.info(this.ctx,`Created worktree ${m} from ${Hd.resolve(r)}`),{worktreePath:m,worktreeDirName:d,branchName:u,baseBranchName:s,baseCommit:c,repositoryPath:r}}async removeWorktree(e,r){Tp.info(this.ctx,`Preparing to remove worktree ${e} from ${Hd.resolve(r)}`),await this.runGitOperation(r,`worktree remove --force ${e}`,n=>n.raw(["worktree","remove","--force",e])),Tp.info(this.ctx,`Removed worktree ${e}`)}async getUncommittedChanges(e){if(!await this.isGitRepository(e))return Tp.info(this.ctx,`Skipping status lookup for ${Hd.resolve(e)} because it is not a git repository`),[];let r=await this.runGitOperation(e,"status",n=>n.status(),n=>`files=${n.files.length}`);return[...new Set(r.files.map(n=>n.path))]}async applyWorktreeChanges(e,r,n){Tp.info(this.ctx,`Applying worktree changes from ${Hd.resolve(e)} to ${Hd.resolve(r)} using baseCommit ${n}`);let o=await this.commitWorktreeChanges(e,"chore: checkpoint worktree changes","checkpoint worktree changes");Tp.info(this.ctx,o?`Committed pending worktree changes in ${Hd.resolve(e)} before generating patch`:`No pending worktree changes to commit in ${Hd.resolve(e)}`);let s=await this.getHeadCommit(e);if(s===n)return Tp.info(this.ctx,"No new commits to apply from worktree"),{baseCommit:s};let c=await this.runGitOperation(e,`diff --binary --full-index ${n}..${s}`,l=>l.raw(["diff","--binary","--full-index",`${n}..${s}`]),l=>`outputLength=${l.length}`);if(!c.trim())return Tp.info(this.ctx,"No patch content to apply from worktree"),{baseCommit:s};try{await this.applyPatchToRepository(r,c)}catch(l){let u=l instanceof Error?l.message:String(l);throw new Error(`Failed to apply worktree patch: ${u}`)}return Tp.info(this.ctx,`Applied worktree patch from ${n} to ${s}`),{baseCommit:s}}async stash(e){await this.runGitOperation(e,"stash push --include-untracked",r=>r.stash(["push","--include-untracked"])),Tp.info(this.ctx,`Stashed changes in ${e}`)}async stashApply(e){await this.runGitOperation(e,"stash apply",r=>r.stash(["apply"])),Tp.info(this.ctx,`Applied stash in ${e}`)}async stashPop(e){await this.runGitOperation(e,"stash pop",r=>r.stash(["pop"])),Tp.info(this.ctx,`Popped stash in ${e}`)}};p();var EHi=fe(ei());var a1=new Ae("WorktreeService");var RDc=new EHi.ProtocolRequestType("worktree/requestUserDecision"),kLe=class{constructor(e,r){this.ctx=e;this.gitService=r}static{a(this,"WorktreeService")}async requestUserDecision(e){let r=await this.gitService.getUncommittedChanges(e);if(r.length===0)return a1.info(this.ctx,`No uncommitted changes found in ${e}, skipping user decision prompt`),"skip";a1.info(this.ctx,`Found ${r.length} uncommitted changes, requesting user decision`);let o=await this.ctx.get(dr).connection.sendRequest(RDc,{type:"uncommitted-changes",title:"Handle Uncommitted Changes",message:`You have ${r.length} uncommitted changes. How would you like to proceed?`,options:[{id:"copy",label:"Copy changes",description:"Copy uncommitted changes into the new worktree",recommended:!0},{id:"move",label:"Move changes",description:"Move uncommitted changes to the new worktree and clean the original"},{id:"skip",label:"Skip changes",description:"Create worktree from clean state, leave local changes untouched"},{id:"cancel",label:"Cancel",description:"Cancel worktree creation",destructive:!0}],defaultOption:"copy"});return o.cancelled?(a1.info(this.ctx,`User cancelled worktree creation for ${e}`),"cancel"):(a1.info(this.ctx,`User selected worktree migration strategy ${o.selectedOption} for ${e}`),o.selectedOption)}async createWorktree(e,r){a1.info(this.ctx,`Starting worktree creation for ${e} with strategy ${r}`);let n=r==="copy"||r==="move";n&&(a1.info(this.ctx,`Stashing original repository changes before worktree creation for ${e}`),await this.gitService.stash(e));let o;try{o=await this.gitService.createWorktree({repositoryPath:e})}catch(s){throw n&&(a1.warn(this.ctx,`Worktree creation failed for ${e}, restoring original stash`),await this.gitService.stashPop(e).catch(()=>{})),s}if(n)try{if(a1.info(this.ctx,`Migrating changes into worktree ${o.worktreePath} using strategy ${r}`),r==="copy"){await this.gitService.stashApply(o.worktreePath),await this.gitService.stashPop(e);let s=await this.gitService.snapshotCopiedChanges(o.worktreePath);o={...o,baseCommit:s},a1.info(this.ctx,`Updated worktree baseCommit to copied-changes snapshot ${s} for ${o.worktreePath}`)}else await this.gitService.stashPop(o.worktreePath);a1.info(this.ctx,`Finished migrating changes into worktree ${o.worktreePath}`)}catch(s){throw a1.warn(this.ctx,`Failed to migrate changes to worktree: ${s instanceof Error?s.message:String(s)}`),await this.gitService.stashPop(e).catch(()=>{}),s}return a1.info(this.ctx,`Completed worktree creation for ${e}; worktreePath=${o.worktreePath}, baseCommit=${o.baseCommit}`),o}async applyWorktreeChanges(e,r,n){a1.info(this.ctx,`Starting worktree apply from ${r} to ${e} with baseCommit ${n}`);let o=await this.gitService.applyWorktreeChanges(r,e,n);return a1.info(this.ctx,`Completed worktree apply from ${r} to ${e}; nextBaseCommit=${o.baseCommit}`),o}};var PDc="Failed to apply changes to the current workspace. Please stage or commit your changes in the current workspace and try again.",kDc=["already exists in working directory","patch does not apply","patch failed"];function DDc(t){let e=t instanceof Error?t.message:String(t);return e.includes("Failed to apply worktree patch:")&&kDc.some(n=>e.includes(n))?PDc:`Failed to apply worktree changes: ${e}`}a(DDc,"getWorktreeCompleteErrorMessage");var NDc=S.Object({repositoryPath:S.String()});async function MDc(t,e,r){try{let n=new dEe(t),o=new kLe(t,n),s=await o.requestUserDecision(r.repositoryPath);if(s==="cancel")return[{success:!1,error:"Worktree creation cancelled by user"},null];let c=await o.createWorktree(r.repositoryPath,s);return[{success:!0,worktreePath:c.worktreePath,worktreeDirName:c.worktreeDirName,branchName:c.branchName,baseBranchName:c.baseBranchName,baseCommit:c.baseCommit},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:`Failed to create worktree: ${o}`}]}}a(MDc,"handleWorktreeCreateChecked");var _Hi=je(NDc,MDc),ODc=S.Object({repositoryPath:S.String(),worktreePath:S.String(),baseCommit:S.String()});async function BDc(t,e,r){try{let n=new dEe(t);return[{success:!0,baseCommit:(await new kLe(t,n).applyWorktreeChanges(r.repositoryPath,r.worktreePath,r.baseCommit)).baseCommit},null]}catch(n){return[null,{code:it.InternalError,message:DDc(n)}]}}a(BDc,"handleWorktreeCompleteChecked");var vHi=je(ODc,BDc),LDc=S.Object({worktreePath:S.String(),repositoryPath:S.String()});async function FDc(t,e,r){try{return await new dEe(t).removeWorktree(r.worktreePath,r.repositoryPath),[{success:!0},null]}catch(n){let o=n instanceof Error?n.message:String(n);return[null,{code:it.InternalError,message:`Failed to delete worktree: ${o}`}]}}a(FDc,"handleWorktreeDeleteChecked");var CHi=je(LDc,FDc);var Ine=class{constructor(e){this.handlers=e}static{a(this,"MethodHandlers")}};function bHi(){let t=new Map;return t.set(SQi.method,TQi),t.set("getCompletions",uQi),t.set("getCompletionsCycling",dQi),t.set("getDefaultFileSafetyRules",fQi),t.set("copilot/parseTerminalCommand",tqi),t.set("getPanelCompletions",mQi),t.set(j7i.method,H7i),t.set("getVersion",AQi),t.set("getUserInfo",gQi),t.set("setEditorInfo",sqi),t.set("checkStatus",JUi),t.set("checkQuota",KUi),t.set("checkFileStatus",zUi),t.set("claude/checkCliCompatibility",WUi),t.set("signInInitiate",M5r),t.set("signIn",M5r),t.set("signInWithCodeFlow",mqi),t.set("signInWithDeviceFlow",yqi),t.set("signInConfirm",aqi),t.set("signInWithGithubToken",Eqi),t.set("signOut",_qi),t.set("auth/listAvailableTokens",A6i),t.set("auth/useExistingToken",y6i),t.set("notifyShown",eqi),t.set("notifyAccepted",JQi),t.set("notifyRejected",XQi),t.set("notifyNextEditRejected",ZQi),t.set("telemetry/exception",vqi),t.set("textDocument/copilotInlineEdit",KQi),t.set("testing/overrideExpFlags",qji),t.set("testing/alwaysAuth",H5r),t.set("testing/setAlwaysAuthed",H5r),t.set("testing/neverAuth",y4r),t.set("testing/setNeverAuthed",y4r),t.set("testing/useTestingToken",dHi),t.set("testing/setCompletionDocuments",sQi),t.set("testing/setPanelCompletionDocuments",Q7i),t.set("testing/setNextEditDocument",$Qi),t.set("testing/triggerShowMessageRequest",Gji),t.set("testing/flushPromiseQueue",Oji),t.set("testing/getDocument",Fji),t.set("testing/chatml",Cqi),t.set("testing/setSyntheticTurns",Hji),t.set("testing/fetch",Mji),t.set("testing/setContentExclusionRules",jji),t.set("testing/getContext",Lji),t.set("uninstall",fHi),t.set("debug/diagnostics",eQi),t.set("debug/listCertificates",IQi),t.set("debug/verifyState",gHi),t.set("debug/verifyCertificate",hHi),t.set("debug/verifyKerberos",mHi),t.set("debug/verifyWorkspaceState",AHi),t.set("debug/getAgentDebugLog",tQi),t.set("context/registerProviders",rqi),t.set("context/unregisterProviders",pHi),t.set("conversation/preconditions",m7i),t.set("conversation/persistence",h7i),t.set("conversation/create",u7i),t.set("conversation/turn",E7i),t.set("conversation/turnDelete",_7i),t.set("conversation/destroy",d7i),t.set("conversation/compress",s7i),t.set("conversation/rating",g7i),t.set("conversation/copyCode",i7i),t.set("conversation/insertCode",o7i),t.set("conversation/templates",y7i),t.set("conversation/modes",f7i),t.set("conversation/agents",n7i),t.set("conversation/registerTools",A7i),t.set("conversation/unregisterTools",v7i),t.set("conversation/updateToolsStatus",C7i),t.set("conversation/notifyCodeAcceptance",p7i),t.set("customAgent/registerExtensionAgents",$7i),t.set("customAgent/unregisterExtensionAgents",V7i),t.set("copilot/customAgent/list",G7i),t.set("copilot/customSkill/list",Y7i),t.set("copilot/customPrompt/list",z7i),t.set("copilot/customInstruction/list",W7i),t.set("copilot/hook/list",CQi),t.set("copilot/models",M7i),t.set("copilot/models/getModelMetadataList",O7i),t.set("copilot/byok/saveModel",VUi),t.set("copilot/byok/deleteModel",_6i),t.set("copilot/byok/listModels",GUi),t.set("copilot/byok/saveApiKey",$Ui),t.set("copilot/byok/deleteApiKey",E6i),t.set("copilot/byok/listApiKeys",v6i),t.set("copilot/setModelPolicy",B7i),t.set("copilot/codeReview/reviewChanges",S7i),t.set("copilot/codeReview/reviewSnippets",T7i),t.set("git/commitGenerate",yQi),t.set("thinking/generateTitle",b7i),t.set("mcp/getTools",w7i),t.set("mcp/updateToolsStatus",R7i),t.set("mcp/readResource",P7i),t.set("mcp/registry/listServers",qQi),t.set("mcp/registry/getServer",jQi),t.set("mcp/registry/getAllowlist",GQi),t.set("mcp/getPrompt",k7i),t.set("mcp/completePrompt",D7i),t.set("mcp/serverAction",N7i),t.set("mcpGateway/listServers",PQi),t.set("mcpGateway/getServerDetails",kQi),t.set("mcpGateway/serverAction",DQi),t.set("githubApi/searchPR",vQi),t.set("githubApi/cancelCodingAgent",XUi),t.set("cloudAgent/listSessions",r7i),t.set("cloudAgent/getSessionLogs",t7i),t.set("cloudAgent/createJob",e7i),t.set("cloudAgent/addPullRequestComment",ZUi),t.set("githubApi/listPullRequestChangedFiles",EQi),t.set("worktree/create",_Hi),t.set("worktree/complete",vHi),t.set("worktree/delete",CHi),t.set("backgroundAgent/create",Y8i),t.set("backgroundAgent/send",m6i),t.set("backgroundAgent/destroy",K8i),t.set("backgroundAgent/listModels",u6i),t.set("backgroundAgent/listSessions",a6i),t.set("backgroundAgent/resume",p6i),t.set("backgroundAgent/stop",g6i),t.set("backgroundAgent/interaction",i6i),t.set("backgroundAgent/enableRemote",e6i),t.set("backgroundAgent/disableRemote",Z8i),t.set("backgroundAgent/getRemoteStatus",r6i),t.set("backgroundAgent/getPlanPath",t6i),t.set("backgroundAgent/compactHistory",V8i),new Ine(t)}a(bHi,"getAllMethods");p();p();p();var SHi=fe(fk());var kv=class{constructor(e){this.ctx=e}static{a(this,"AbstractNotification")}get type(){return new SHi.NotificationType(this.name)}};var UDc=new Ae("BackgroundAgent.notifications"),D4r=class extends kv{constructor(){super(...arguments);this.name="backgroundAgent/sessionUpdate";this.params=S.Object({sessionId:S.String(),event:S.Unknown()})}static{a(this,"BackgroundAgentSessionUpdateNotification")}handle(){}},N4r=class extends kv{constructor(){super(...arguments);this.name="backgroundAgent/registerExternalTools";this.params=S.Object({sessionId:S.String(),externalToolDefinitions:uMr})}static{a(this,"BackgroundAgentRegisterExternalToolsNotification")}handle(r){UDc.info(this.ctx,"registerExternalTools received",{sessionId:r.sessionId,toolCount:r.externalToolDefinitions.length}),this.ctx.get(Ls).registerExternalTools(r.sessionId,r.externalToolDefinitions)}},THi=[D4r,N4r];p();var M4r=class extends kv{constructor(){super(...arguments);this.name="copilot/didChangeToken";this.params=S.Unknown()}static{a(this,"DidChangeTokenNotificationHandler")}handle(){this.ctx.get(Ut).resetToken("did_change_token_notification")}},IHi=[M4r];p();var QDc=new Ae("agentCopilotTokenManager");function B4r(t){try{let e=new URL(t||"https://api.github.com");if(e.protocol==="https:"&&e.hostname.startsWith("api."))return`${e.origin}/`}catch{}}a(B4r,"tokenEndpointToApiUrl");function qDc(t,e){if(!e.tokenEndpoint)return wy(e);let r=B4r(e.tokenEndpoint);return r||QDc.warn(t,`Invalid token endpoint URL <${e.tokenEndpoint}>`),wy({apiUrl:r})}a(qDc,"getUrlsFromParams");var O4r=class extends kv{constructor(){super(...arguments);this.name=UQt.method;this.params=v_n}static{a(this,"DidChangeAuthNotificationHandler")}handle(r){let n=this.ctx.get(Fr),o=qDc(this.ctx,r);this.ctx.get(N0).setConfiguredUrls(this.ctx,o);let s=r.handle||r.login;s&&r?.accessToken?n.setTransientSession({accessToken:r.accessToken,login:s,githubAppId:r.githubAppId,...o}):n.setTransientSession({githubAppId:r.githubAppId,...o})}},xHi=[O4r];p();var L4r=class extends kv{constructor(){super(...arguments);this.name=$Qt.method;this.params=R_n}static{a(this,"DidShowCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],s=this.ctx.get(vu).get(n);s&&oXn(this.ctx,s)}},F4r=class extends kv{constructor(){super(...arguments);this.name=WQt.method;this.params=M_n}static{a(this,"DidShowInlineEditNotificationHandler")}async handle(r){let n=r.item.command.arguments[0];await this.ctx.get(Rv).handleShown(n)}},U4r=class extends kv{constructor(){super(...arguments);this.name=VQt.method;this.params=P_n}static{a(this,"DidPartiallyAcceptCompletionNotificationHandler")}handle(r){let n=r.item.command.arguments[0],o=r.acceptedLength,s=this.ctx.get(vu),c=s.get(n);c&&(o>=c.insertText.length?(s.delete(n),rhe(this.ctx,c)):Hlt(this.ctx,c,o,void 0,void 0,"cumulative"))}},wHi=[L4r,F4r,U4r];p();var T1t=class extends kv{constructor(){super(...arguments);this.name="window/workDoneProgress/cancel";this.params=S.Object({token:S.Union([S.String(),S.Number()])})}static{a(this,"WorkDoneProgressCancelNotification")}handle(r){this.ctx.get(YD).cancel(r.token)}};var jDc=[...THi,...IHi,...xHi,...wHi,T1t];function RHi(t,e){for(let r of jDc){let n=new r(t),o=Mu.Compile(n.params);e.onNotification(n.type,Nm(t,async s=>{P6(s),o.Check(s)?await n.handle(s):ns.error(t,`Notification ${n.name}:`,new TA(o.Errors(s)))},`Notification ${n.name}`))}}a(RHi,"registerNotifications");p();p();var PHi=fe(require("crypto")),kHi=require("os");As();var HDc=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function GDc(t){let e=t.replace(/-/g,":").toLowerCase();return!HDc.has(e)}a(GDc,"validateMacAddress");function $Dc(){let t=(0,kHi.networkInterfaces)();for(let e in t){let r=t[e];if(r){for(let{mac:n}of r)if(GDc(n))return n}}throw new Error("Unable to retrieve mac address (unexpected format)")}a($Dc,"getMac");var Q4r;function VDc(){try{let t=$Dc();return PHi.createHash("sha256").update(t,"utf8").digest("hex")}catch{return}}a(VDc,"getMacMachineId");function q4r(){return Q4r||(Q4r=VDc()||ir()),Q4r}a(q4r,"getMachineId");As();function j4r(t){let e=t??ir()+Date.now();return new Oa(e,q4r(),q4r())}a(j4r,"createEditorSession");var DHi=j4r();p();var I1t=fe(Al());var H4r=new Ae("AgentTextDocumentConfiguration"),G4r=class{constructor(e){this.ctx=e;this.#e=new no;this.onDidChange=this.#e.event}static{a(this,"AgentTextDocumentsConfiguration")}#e;create(e,r,n,o){try{return gS.create(e,r,n,o)}catch(s){throw H4r.exception(this.ctx,s,".create"),s}}update(e,r,n){try{let o=[],s=gS.withChanges(e,r,n);for(let l of r)if(I1t.TextDocumentContentChangeEvent.isIncremental(l)){let u=e.offsetAt(l.range.start),d=e.offsetAt(l.range.end),f={start:e.positionAt(u),end:e.positionAt(d)};for(let m of["start","end"])if(f[m].line!==l.range[m].line||f[m].character!==l.range[m].character){let g=`invalid range ${m} position ${JSON.stringify(l.range[m])}. Assuming ${JSON.stringify(f[m])}.`;H4r.warn(this.ctx,`textDocument/didChange for ${e.uri} has ${g}`);let A=Vt.createAndMarkAsIssued({message:`Received ${g}`});yt(this.ctx,`invalidRange.${m}`,A)}let h={range:f,rangeOffset:u,rangeLength:d-u,text:l.text};o.push(h),e=e.applyEdits([{range:h.range,newText:h.text}])}let c={document:{uri:e.uri,version:n},contentChanges:o};return this.#e.fire(c),s}catch(o){throw H4r.exception(this.ctx,o,".update"),o}}},X$=class extends an{constructor(){super(...arguments);this.#e=new no;this.onDidOpenTextDocument=this.#e.event;this.#t=new no;this.onDidCloseTextDocument=this.#t.event;this.#r=new no;this.onDidFocusTextDocument=this.#r.event;this._textDocumentConfiguration=new G4r(this.ctx);this.onDidChangeTextDocument=this._textDocumentConfiguration.onDidChange;this._documents=new Map;this._notebookDocuments=new I1t.NotebookDocuments(this._textDocumentConfiguration);this.workspaceFolders=[];this.#n=new no;this.onDidChangeWorkspaceFolders=this.#n.event}static{a(this,"AgentTextDocumentManager")}#e;#t;#r;#n;get connection(){return this.ctx.get(dr).connection}init(r){this.connection.onDidOpenTextDocument(n=>{let o=n.textDocument,s=this._textDocumentConfiguration.create(o.uri,o.languageId,o.version,o.text);this._documents.set(ia(o.uri),s),this.#e.fire({document:{...o,uri:s.uri}})}),this.connection.onDidChangeTextDocument(n=>{let o=n.textDocument,s=n.contentChanges,{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let l=ia(o.uri),u=this._documents.get(l);u!==void 0&&(u=this._textDocumentConfiguration.update(u,s,c),this._documents.set(l,u))}),this.connection.onDidCloseTextDocument(n=>{let o=ia(n.textDocument.uri);this._documents.delete(o),this.#t.fire({document:{uri:o}})}),this.connection.onNotification(jQt.type,n=>{let o=("textDocument"in n?n.textDocument:n)??{};this.#r.fire("uri"in o?{document:o}:{})}),this._notebookDocuments.listen(this.connection),this.workspaceFolders.length=0,this.workspaceFolders.push(...r),r.length>0&&this.#n.fire({workspaceFolders:this.workspaceFolders,added:r,removed:[]})}didChangeWorkspaceFolders(r){r.added.forEach(n=>this.registerWorkspaceFolder(n)),r.removed.forEach(n=>this.unregisterWorkspaceFolder(n)),this.#n.fire({workspaceFolders:this.workspaceFolders,added:r.added,removed:r.removed})}unregisterWorkspaceFolder(r){let n=this.workspaceFolders.findIndex(o=>o.uri===r.uri);n>=0&&this.workspaceFolders.splice(n,1)}registerWorkspaceFolder(r){this.workspaceFolders.find(n=>n.uri===r.uri)||this.workspaceFolders.push(r)}getTextDocumentsUnsafe(){return[...this._documents.values()]}getTextDocumentUnsafe(r){return this._documents.get(ia(r.uri))}getWorkspaceFolders(){return this.workspaceFolders}findNotebook(r){let n=this._notebookDocuments.findNotebookDocumentForCell(r.uri);if(n)return{getCells:a(()=>n.cells.map((o,s)=>this.wrapCell(o,s)).filter(o=>!!o),"getCells"),getCellFor:a(({uri:o})=>{let s=n.cells.findIndex(c=>c.document===o);return s!==-1?this.wrapCell(n.cells[s],s):void 0},"getCellFor")}}wrapCell(r,n){let o=this._notebookDocuments.getCellTextDocument(r);if(o)return{kind:r.kind,metadata:r.metadata??{},index:n,document:o}}};var NHi=Mu.Compile(I_n);function P6(t){if(t!==null){if(Array.isArray(t))for(let e=0;e{try{if(this.#r?.workspace?.configuration&&e&&typeof e=="object"&&!("settings"in e)){let n=await this.connection.workspace.getConfiguration(MHi.map(s=>({section:s}))),o={github:{copilot:n.shift()}};for(let s of ALe)o[s]=n.shift();e.settings=o}if(e&&typeof e=="object"&&"settings"in e)try{this.ctx.get(YM).handleConfigurationChange(e.settings)}catch(n){ns.exception(this.ctx,n,"EncodingConfigurationService.handleConfigurationChange")}return Ubt(this.ctx,P6(e))}catch(r){ns.exception(this.ctx,r,"didChangeConfiguration")}},"handleDidChangeConfiguration");this.#n=this.ctx.get(Nf)}static{a(this,"Service")}#e;#t;#r;#n;get clientCapabilities(){return this.#r}listen(){let e=this.ctx,r=this.connection;r.onRequest(this.messageHandler.bind(this)),RHi(e,r);let n={name:"GitHub Copilot Language Server",version:e.get(os).getDisplayVersion(),nodeVersion:process.versions.node};function o(c){try{e.get(X$).didChangeWorkspaceFolders(c)}catch(l){ns.exception(e,l,"didChangeWorkspaceFolders")}}a(o,"didChangeWorkspaceFolders"),this.connection.onNotification("vs/didAddWorkspaceFolder",({name:c,uri:l})=>o({added:[{uri:l,name:c??l}],removed:[]})),this.connection.onNotification("vs/didRemoveWorkspaceFolder",({name:c,uri:l})=>o({added:[],removed:[{uri:l,name:c??l}]})),r.onInitialize(c=>{if(this.initialized)throw new Error("initialize request sent after initialized notification");this.#r=c.capabilities;let l=c.capabilities.copilot,u=P6(c.initializationOptions);if(u){if(!NHi.Check(u))throw new TA(NHi.Errors(u));let m=u,g=e.get(Nr);m.editorPluginInfo?g.setEditorAndPluginInfo({version:"unknown",...m.editorPluginInfo},m.editorInfo&&{version:"unknown",...m.editorInfo},m.relatedPluginInfo??[]):ns.warn(e,"editorInfo and editorPluginInfo will soon be required in initializationOptions. This will replace setEditorInfo."),m.copilotIntegrationId&&g.setCopilotIntegrationId(m.copilotIntegrationId),m.githubAppId&&(e.get(Up).githubAppId=m.githubAppId),m.copilotCapabilities&&(l=m.copilotCapabilities),m.sessionId&&e.forceSet(Oa,j4r(m.sessionId))}let d=c.capabilities.workspace?.workspaceFolders??!1;e.get(X$).init(c.workspaceFolders??[]),yYn(this.ctx),l&&(e.get(On).setCapabilities(l),l.contentProvider&&na.registerSchemes(l.contentProvider),"openURL"in l&&Vlt(e,["The openURL Copilot capability has been removed in favor of window/showDocument."]));let h=a(async()=>{this.initialized||(this.initialized=!0,ns.info(e,`${n.name} ${n.version} initialized`),e.get(Ut).primeToken().catch(m=>{e.get(ss).setErrorV2("auth",{message:`Failed while initializing: ${m}`,askToReSignin:!1,result:{status:"NotSignedIn"}})}),d&&r.workspace.onDidChangeWorkspaceFolders(o),c.capabilities.workspace?.didChangeConfiguration?.dynamicRegistration&&await r.client.register(nI.DidChangeConfigurationNotification.type,{section:MHi}),c.capabilities.workspace?.configuration?await this.handleDidChangeConfiguration({}):await Promise.race([this.ctx.get(FC).requireReady().then(()=>!0),new Promise(A=>setTimeout(()=>A(!1),200))])||Fbt(e),!this.deactivated&&(this.activationEmitter.fire(),e.get(ss).sendInitNonAuthStatus(),new FAe().startup(e).catch(()=>{})))},"onInitialized");return r.onInitialized(Nm(e,h,"onInitialized")),e.get($D).init(),l?.token&&e.get(Fr).setTransientSession({}),l?.redirectedTelemetry&&U8i(e),OHi.lt(process.versions.node,"22.0.0")&&ns.warn(e,`Node.js ${process.versions.node} support is deprecated. Please upgrade to Node.js 22 or newer.`),{capabilities:{textDocumentSync:{openClose:!0,change:nI.TextDocumentSyncKind.Incremental},notebookDocumentSync:{notebookSelector:[{notebook:"*"}]},workspace:{workspaceFolders:{supported:d,changeNotifications:d}},executeCommandProvider:{commands:O8i(e,r)},inlineCompletionProvider:{}},serverInfo:n}}),r.onShutdown(async()=>{await(this.#e??=this.deactivate())}),r.onExit(()=>{this.onExit()}),r.onDidChangeConfiguration(c=>{this.handleDidChangeConfiguration(c)}),r.listen();let s=new Vvt;this.ctx.forceSet(Nf,s)}telemetryMethodFailure(e,r){let n=e.replaceAll("/",".");si(this.ctx,"lsp.method.failure",r,{method:n})}async messageHandler(e,r,n){let o=this.ctx.get(Ine).handlers.get(e);if(!o)return new nI.ResponseError(it.MethodNotFound,`Method not found: ${e}`);if(!this.initialized)return new nI.ResponseError(it.ServerNotInitialized,"Agent service not initialized.");if(this.#e)return new nI.ResponseError(it.InvalidRequest,"Agent service shut down.");if(e!=="setEditorInfo"&&!this.ctx.get(Nr).isEditorPluginInfoKnown())throw new nI.ResponseError(it.ServerNotInitialized,"editorInfo and editorPluginInfo not set in initializationOptions");Array.isArray(r)&&(r=r[0]),P6(r);try{let[s,c]=await o(this.ctx,n,r);return c?new nI.ResponseError(c.code,c.message,c.data):s}catch(s){if(n.isCancellationRequested)return new nI.ResponseError(it.RequestCancelled,"Request was canceled");if(s instanceof gi)return this.telemetryMethodFailure(e,s),new nI.ResponseError(it.NoCopilotToken,`Not authenticated: ${s.message}`);throw s instanceof nI.ResponseError||ns.exception(this.ctx,s,`Request ${e}`),this.telemetryMethodFailure(e,s),s}}async onExit(){return this.#t??=this.doExit()}async doExit(){try{this.ctx.get(EY).stop()}catch(e){ns.exception(this.ctx,e,"failed to stop perf monitor")}try{this.ctx.get(M3).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose ripgrep process manager")}try{this.ctx.get(db).dispose().catch(e=>{ns.exception(this.ctx,e,"failed to dispose MCP server manager")})}catch(e){ns.exception(this.ctx,e,"failed to dispose MCP server manager")}try{this.ctx.get(Dj).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose MCP gateway service")}try{this.ctx.get(wk).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose workspace chunk search service")}try{this.ctx.get(DF).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose Claude Code agent service")}try{this.ctx.get(uX).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose agent plugin service")}this.ctx.get(Ls).shutdown().catch(e=>{ns.exception(this.ctx,e,"failed to shutdown background agent service")});try{this.ctx.get(Zm).dispose()}catch(e){ns.exception(this.ctx,e,"failed to dispose prompt service")}this.ctx.forceSet(Nf,this.#n),await(this.#e??=this.deactivate())}markDeactivated(){this.deactivated||(this.deactivated=!0,this.deactivationEmitter.fire(),this.ctx.get(FC).markReady())}async deactivate(){let e=this.ctx;this.markDeactivated(),Ldr(e),await Promise.race([new Promise(r=>setTimeout(r,100).unref()),e.get(_d).flush()]),await Promise.race([new Promise(r=>setTimeout(r,1800).unref()),e.get(k0).deactivate()])}dispose(){this.markDeactivated(),this.connection.dispose()}},ns=new Ae("lsp");var Dv=class{constructor(e,r,n){this.ctx=e;this.skillId=r;this.requestType=new BHi.ProtocolRequestType("conversation/context");this.typeCheck=Mu.Compile(n)}static{a(this,"AgentSkillResolver")}async resolveSkill(e){let r=this.ctx.get(dr).connection,n={conversationId:e.conversation.id,turnId:e.turn.id,skillId:this.skillId},o;try{let s=await r.sendRequest(this.requestType,n),[c,l]=s;if(l){let u=new LHi.ResponseError(l.code,l.message,l.data);ot.error(this.ctx,`ResponseError while resolving skill ${this.skillId}`,u);return}o=c}catch(s){ot.error(this.ctx,`Error while resolving skill ${this.skillId}`,s);return}if(o!=null){if(!this.typeCheck.Check(o))throw new TA(this.typeCheck.Errors(o));return o}}};var $4r=class{constructor(e,r,n="",o="",s=[],c=[]){this.progressToken=e;this.chunks=r;this.followUp=n;this.suggestedTitle=o;this.skills=s;this.references=c}static{a(this,"SyntheticTurn")}},Y6=class{constructor(){this.turns=[]}static{a(this,"SyntheticTurns")}add(e,r,n="",o="",s=[],c=[]){let l=new $4r(e,r,n,o,s,c);return this.turns.push(l),l}get(e){return this.turns.find(r=>r.progressToken===e)}},x1t=class{constructor(e,r){this.turnContext=e;this.syntheticTurn=r;this.conversationProgress=e.ctx.get(vc)}static{a(this,"SyntheticTurnProcessor")}async process(e,r){try{await this.processWithSyntheticTurns(this.syntheticTurn,e,r)}catch(n){ot.error(this.turnContext.ctx,`Error processing turn ${this.turnContext.turn.id}`,n);let o=n.message;this.turnContext.turn.status="error",this.turnContext.turn.response={message:o,type:"meta"},await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{error:{message:o,responseIsIncomplete:!0}})}}async processWithSyntheticTurns(e,r,n){await this.conversationProgress.begin(this.turnContext.conversation,this.turnContext.turn,r),await this.resolveSyntheticSkill(e,n),await this.processSyntheticChunks(e,n),await this.endSyntheticProgress(e,n),this.turnContext.turn.response={type:"model",message:e.chunks.join("")},this.turnContext.turn.status=n.isCancellationRequested?"cancelled":"success"}async resolveSyntheticSkill(e,r){let n=this.turnContext.ctx.get(Go).getCapabilities(this.turnContext.conversation.id),o=e.skills.filter(s=>n.skills.includes(s));for(let s of o){let l=await new Dv(this.turnContext.ctx,s,S.Object({value:S.String()})).resolveSkill(this.turnContext);l&&!r.isCancellationRequested&&await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:l.value})}}async processSyntheticChunks(e,r){for(let n of e.chunks)r.isCancellationRequested||(await this.conversationProgress.report(this.turnContext.conversation,this.turnContext.turn,{reply:n}),await XI(1))}async endSyntheticProgress(e,r){r.isCancellationRequested?await this.conversationProgress.cancel(this.turnContext.conversation,this.turnContext.turn):await this.conversationProgress.end(this.turnContext.conversation,this.turnContext.turn,{followUp:{message:e.followUp,type:"followup",id:ir()},suggestedTitle:e.suggestedTitle,updatedDocuments:this.turnContext.conversation.source==="inline"?[{uri:"fakeUpdatedDoc.ts",text:"fake"}]:void 0})}};var KD=class{static{a(this,"TurnProcessorFactory")}async createProcessor(e,r,n){let o=e.ctx.get(Y6).get(r);if(o)return new x1t(e,o);let c=(await Nx(e.ctx)).find(u=>u.slug===e.turn.agent?.agentSlug);if(c?.turnProcessor)return c.turnProcessor(e);let l;return e.conversation.source==="inline"?l=new BKe(e.ctx):l=new Sle(e.ctx),n!==void 0&&(l.computeSuggestions=n),e.turn.chatMode?.kind==="Agent"||e.turn.chatMode?.kind==="InlineAgent"?new Awe(e,l):e.turn.chatMode?.kind==="Ask"&&e.conversation.source!=="inline"?new Awe(e,l):new ptt(e,l)}};p();var eV=class extends v_{constructor(r){super(r);this.connection=null;this.capabilities={readTextFile:!1,writeTextFile:!1};this.currentSessionId=null}static{a(this,"ACPClientToolInvoker")}setACPContext(r,n,o){this.connection=r,this.capabilities=n,this.currentSessionId=o}clearACPContext(){this.currentSessionId=null}async invokeClientTool(r,n){if(!this.connection||!this.currentSessionId)return this.errorResult("ACP connection not available for tool invocation");switch(n.name){case"create_file":return this.handleCreateFile(n.input,n.toolCallId);case"insert_edit_into_file":return this.handleEditFile(n.input,n.toolCallId);default:return this.errorResult(`Tool ${n.name} is not supported in ACP mode`)}}async handleCreateFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.content===void 0)return this.errorResult("create_file requires filePath and content");try{let o=r.content;return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:o}),await this.sendDiffUpdate(n,r.filePath,null,o),this.successResult(`Successfully created file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to create file ${r.filePath}: ${String(o)}`)}}async handleEditFile(r,n){if(!this.capabilities.writeTextFile)return this.errorResult("Client does not support file writing");if(!r?.filePath||r.code===void 0)return this.errorResult("insert_edit_into_file requires filePath and code");try{let o=null;if(this.capabilities.readTextFile)try{o=(await this.connection.readTextFile({sessionId:this.currentSessionId,path:r.filePath})).content}catch{}let s=r.code.replace(/\r\n/g,` +`);return await this.connection.writeTextFile({sessionId:this.currentSessionId,path:r.filePath,content:s}),await this.sendDiffUpdate(n,r.filePath,o,s),this.successResult(`Successfully edited file: ${r.filePath}`)}catch(o){return this.errorResult(`Failed to edit file ${r.filePath}: ${String(o)}`)}}async sendDiffUpdate(r,n,o,s){await this.connection.sessionUpdate({sessionId:this.currentSessionId,update:{sessionUpdate:"tool_call_update",toolCallId:r,content:[{type:"diff",path:n,oldText:o,newText:s}]}})}successResult(r){return new Br([new Rr(r)],"success")}errorResult(r){return new Br([new Rr(r)],"error")}};p();function WDc(t){switch(t){case"read_file":case"list_dir":case"get_errors":return"read";case"insert_edit_into_file":case"create_file":case"replace_string_in_file":return"edit";case"semantic_search":case"file_search":case"grep_search":return"search";case"run_in_terminal":case"run_subagent":return"execute";case"update_user_preferences":case"validate_cves":default:return"other"}}a(WDc,"mapToolNameToKind");function zDc(t,e){if(!e)return;let r=[];switch(t){case"read_file":case"insert_edit_into_file":case"create_file":case"replace_string_in_file":{let n=e.filePath;if(n){let o=e.startLine;r.push({path:n,line:o??void 0})}break}case"list_dir":{let n=e.path;n&&r.push({path:n});break}case"get_errors":{let n=e.filePaths;if(n&&Array.isArray(n))for(let o of n)r.push({path:o});break}}return r.length>0?r:void 0}a(zDc,"extractLocationsFromInput");function YDc(t){switch(t){case"not started":return"pending";case"running":return"in_progress";case"completed":return"completed";case"error":case"cancelled":return"failed";default:return"pending"}}a(YDc,"mapToolCallStatus");var w1t=class{constructor(e,r){this.connection=e;this.sessionId=r;this.activeToolCalls=new Map;this.messageChunkBuffer=""}static{a(this,"ACPProgressReporter")}async begin(e,r,n,o){}async report(e,r,n,o){if(o.reply&&await this.reportTextChunk(o.reply),o.editAgentRounds){for(let s of o.editAgentRounds)if(s.reply&&await this.reportTextChunk(s.reply),s.toolCalls)for(let c of s.toolCalls){let l=YDc(c.status),u=!this.activeToolCalls.has(c.id);if(u&&(c.status==="running"||c.status==="not started")){let d=zDc(c.name,c.input);await this.reportToolCallStart(c.id,c.name,WDc(c.name),l,c.input,d)}else c.status==="completed"?await this.reportToolCallComplete(c.id):c.status==="error"?await this.reportToolCallError(c.id,c.error||"Unknown error"):c.status==="cancelled"?await this.reportToolCallCancelled(c.id):u||await this.reportToolCallProgress(c.id,l)}}}async end(e,r,n,o){if(o?.error&&await this.reportTextChunk(` Error: ${o.error.message}`),this.messageChunkBuffer===""&&n.response?.message){let s=typeof n.response.message=="string"?n.response.message:JSON.stringify(n.response.message);await this.reportTextChunk(s)}await this.complete()}async cancel(e,r,n,o){o&&await this.reportTextChunk(` -Cancelled: ${o.message}`),await this.complete()}async reportTextChunk(e){this.messageChunkBuffer+=e,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"agent_message_chunk",content:{type:"text",text:e}}})}async reportToolCallStart(e,r,n="other",o="pending",s,c){let l={toolCallId:e,title:r,kind:n,status:o};this.activeToolCalls.set(e,l),await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call",toolCallId:e,title:r,kind:n,status:o,rawInput:s,locations:c}})}async reportToolCallProgress(e,r="in_progress",n){let o=this.activeToolCalls.get(e);o&&(o.status=r,await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:r,content:n}}))}async reportToolCallComplete(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="completed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"completed",content:r}}),this.activeToolCalls.delete(e))}async reportToolCallError(e,r){let n=this.activeToolCalls.get(e);n&&(n.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:r}}]}}),this.activeToolCalls.delete(e))}async reportToolCallCancelled(e){let r=this.activeToolCalls.get(e);r&&(r.status="failed",await this.connection.sessionUpdate({sessionId:this.sessionId,update:{sessionUpdate:"tool_call_update",toolCallId:e,status:"failed",content:[{type:"content",content:{type:"text",text:"Cancelled"}}]}}),this.activeToolCalls.delete(e))}async complete(){for(let[e]of this.activeToolCalls)await this.reportToolCallComplete(e)}};p();async function j1t(t){try{if((await t.get(Ur).checkAndUpdateStatus()).status==="OK")return;let n=await e1t(t,(o,s)=>new rN(o,rN.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(Ke.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof eU?new fo(Ke.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof Ai?new fo(Ke.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(j1t,"performACPGitHubOAuth");function H1t(t){if(t!=="github_oauth")throw new fo(Ke.InvalidParams,`Unknown authentication method: ${t}`)}a(H1t,"validateAuthMethodId");async function G1t(t){let r=await t.get(Ur).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(G1t,"requireACPAuthenticated");var HHi=[{id:yl.Ask.id,name:yl.Ask.name,description:yl.Ask.description},{id:yl.Agent.id,name:yl.Agent.name,description:yl.Agent.description}],$1t=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Lr);o instanceof Rq&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}gt(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:ltt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:N1(this.ctx)},authMethods:n})}async newSession(e){gt(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=gr(),n=gr(),s=this.ctx.get(Vo).create({source:"panel",conversationId:n}),c=e.cwd?{uri:Ia(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return gt(this.ctx,"acp.authenticate"),H1t(e.methodId),await j1t(this.ctx),{}}async requireAuthenticated(){await G1t(this.ctx)}async prompt(e){gt(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new qn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=gr(),l=new Gf(s,c),u=r.currentModeId===yl.Ask.id?yl.Ask:yl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Vo),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new q1t(this.connection,e.sessionId),g=new Wx(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(v_);A instanceof dV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(XD).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,n)}finally{A instanceof dV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(v_);if(s instanceof dV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){gt(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){gt(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ke.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(Ke.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){gt(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(Ke.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(Ke.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return FI(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?HHi:HHi.filter(e=>e.id===yl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?yl.Agent.id:yl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(dc).getMetadata(),r=[],n=MS;r.push({modelId:MS,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(Xae.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` -`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var GHi=require("node:child_process"),W1t=require("node:stream");var V1t=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio","--yolo"];if(this.cliProcess=(0,GHi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:A8t}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{gi(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||gt(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=W1t.Writable.toWeb(this.cliProcess.stdin),c=W1t.Readable.toWeb(this.cliProcess.stdout),l=xwe(s,c);return this._cliConnection=new mtt(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var z1t=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Lr);r instanceof Rq&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return gt(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:ltt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:N1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return gt(this.ctx,"acp.cli.authenticate"),H1t(e.methodId),await j1t(this.ctx),{}}async newSession(e){return gt(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return gt(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return gt(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return gt(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return gt(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return gt(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return gt(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return gt(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new fo(Ke.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Qt).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:N1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),gt(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw gi(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new fo(Ke.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await G1t(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var $Hi="auth.db",GMc=["PRAGMA busy_timeout = 5000","PRAGMA synchronous = normal","PRAGMA optimize = 0x10002","PRAGMA foreign_keys = ON"],$Mc=` - CREATE TABLE IF NOT EXISTS oauth_tokens ( - token_id INTEGER PRIMARY KEY AUTOINCREMENT, - auth_authority TEXT NOT NULL, - oauth_client_id TEXT NOT NULL, - user_login TEXT NOT NULL, - scopes TEXT NOT NULL, - token_ciphertext BLOB NOT NULL, - token_schema_version INTEGER NOT NULL, - source_editor_id TEXT NOT NULL, - created_at INTEGER NOT NULL, - updated_at INTEGER NOT NULL, - last_used_at INTEGER NOT NULL, - UNIQUE(auth_authority, oauth_client_id, user_login) - ) -`,VMc=` - CREATE TABLE IF NOT EXISTS active_sessions ( - editor_id TEXT PRIMARY KEY, - token_id INTEGER NOT NULL REFERENCES oauth_tokens(token_id) ON DELETE CASCADE, - activated_at INTEGER NOT NULL - ) -`,WMc=` - CREATE TABLE IF NOT EXISTS editor_signout ( - editor_id TEXT PRIMARY KEY, - signed_out_at INTEGER NOT NULL - ) -`,zMc=` - CREATE TABLE IF NOT EXISTS metadata ( - key TEXT PRIMARY KEY, - value TEXT NOT NULL - ) -`,YMc=[$Mc,VMc,WMc,zMc];function uBr(t){for(let e of GMc)t.exec(e);return KMc(t),t}a(uBr,"applyPragmas");function KMc(t){let r=t.prepare("PRAGMA journal_mode").get()?.journal_mode;(typeof r=="string"?r.toLowerCase():void 0)!=="wal"&&t.exec("PRAGMA journal_mode = WAL")}a(KMc,"ensureWalMode");function dBr(t){for(let e of YMc)t.exec(e);return t}a(dBr,"applySchema");function bEe(t,e){t.exec("BEGIN IMMEDIATE");try{let r=e();return t.exec("COMMIT"),r}catch(r){try{t.exec("ROLLBACK")}catch{}throw r}}a(bEe,"runInWriteTx");p();p();p();function VHi(t){return{upsertToken:t.prepare(` - INSERT INTO oauth_tokens ( - auth_authority, oauth_client_id, user_login, scopes, - token_ciphertext, token_schema_version, source_editor_id, - created_at, updated_at, last_used_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - ON CONFLICT(auth_authority, oauth_client_id, user_login) DO UPDATE SET - scopes = excluded.scopes, - token_ciphertext = excluded.token_ciphertext, - token_schema_version = excluded.token_schema_version, - source_editor_id = excluded.source_editor_id, - updated_at = CASE - WHEN oauth_tokens.created_at = excluded.updated_at - THEN excluded.updated_at + 1 - ELSE excluded.updated_at - END, - last_used_at = excluded.last_used_at - RETURNING token_id, (created_at != updated_at) AS token_rewrite - `),selectTokenById:t.prepare("SELECT * FROM oauth_tokens WHERE token_id = ?"),selectAllTokensByRecency:t.prepare(` - SELECT * FROM oauth_tokens ORDER BY last_used_at DESC, token_id DESC - `),selectTokenByAuthority:t.prepare(` - SELECT * FROM oauth_tokens - WHERE auth_authority = ? - ORDER BY last_used_at DESC, token_id DESC - LIMIT 1 - `),selectActiveSessionByEditor:t.prepare(` - SELECT t.* - FROM active_sessions s - JOIN oauth_tokens t ON t.token_id = s.token_id - WHERE s.editor_id = ? - `),upsertActiveSession:t.prepare(` - INSERT INTO active_sessions (editor_id, token_id, activated_at) - VALUES (?, ?, ?) - ON CONFLICT(editor_id) DO UPDATE SET - token_id = excluded.token_id, - activated_at = excluded.activated_at - `),deleteActiveSession:t.prepare("DELETE FROM active_sessions WHERE editor_id = ?"),deleteActiveSessionsForTokenReturning:t.prepare(` - DELETE FROM active_sessions WHERE token_id = ? RETURNING editor_id - `),insertSignoutTombstone:t.prepare(` - INSERT INTO editor_signout (editor_id, signed_out_at) - VALUES (?, ?) - ON CONFLICT(editor_id) DO UPDATE SET signed_out_at = excluded.signed_out_at - `),deleteSignoutTombstone:t.prepare("DELETE FROM editor_signout WHERE editor_id = ?"),selectSignoutTombstone:t.prepare("SELECT 1 FROM editor_signout WHERE editor_id = ?"),deleteTokenById:t.prepare("DELETE FROM oauth_tokens WHERE token_id = ?"),bumpLastUsed:t.prepare("UPDATE oauth_tokens SET last_used_at = ? WHERE token_id = ?"),getMetadata:t.prepare("SELECT value FROM metadata WHERE key = ?"),setMetadata:t.prepare(` - INSERT INTO metadata (key, value) VALUES (?, ?) - ON CONFLICT(key) DO UPDATE SET value = excluded.value - `)}}a(VHi,"prepareStatements");var $Le=class extends MN{constructor(r){super();this.db=r;this.stmts=VHi(r)}static{a(this,"SqliteAuthRepository")}close(){this.db.close()}async getActiveSession(r){let n=this.stmts.selectActiveSessionByEditor.get(r);return n?Y1t(n):void 0}async getTokenById(r){let n=this.stmts.selectTokenById.get(r);return n?Y1t(n):void 0}async upsertTokenAndAssign(r,n){let o=Date.now();return bEe(this.db,()=>{let s=JMc(n.accessToken),c=this.stmts.upsertToken.get(n.authAuthority,n.oauthClientId,n.user,n.scopes,s,0,r,o,o,o);return this.stmts.upsertActiveSession.run(r,c.token_id,o),this.stmts.deleteSignoutTombstone.run(r),{tokenId:c.token_id,tokenRewrite:c.token_rewrite===1}})}async assignActiveSession(r,n){let o=Date.now();bEe(this.db,()=>{if(!this.stmts.selectTokenById.get(n))throw new Error(`assignActiveSession: tokenId ${n} not found`);this.stmts.upsertActiveSession.run(r,n,o),this.stmts.deleteSignoutTombstone.run(r),this.stmts.bumpLastUsed.run(o,n)})}async markEditorOptedOut(r){let n=Date.now();bEe(this.db,()=>{this.stmts.deleteActiveSession.run(r),this.stmts.insertSignoutTombstone.run(r,n)})}async hasOptOutTombstone(r){return this.stmts.selectSignoutTombstone.get(r)!==void 0}async listTokensByRecency(){return this.stmts.selectAllTokensByRecency.all().map(Y1t)}async findTokenByAuthority(r){let n=this.stmts.selectTokenByAuthority.get(r);return n?Y1t(n):void 0}async listAvailableTokens(){return this.stmts.selectAllTokensByRecency.all().map(n=>({tokenId:n.token_id,authAuthority:n.auth_authority,oauthClientId:n.oauth_client_id,userLogin:n.user_login,sourceEditorId:n.source_editor_id,lastUsedAt:n.last_used_at}))}async deleteTokenCascade(r){let n=Date.now();return{affectedEditors:bEe(this.db,()=>{let s=this.stmts.deleteActiveSessionsForTokenReturning.all(r);this.stmts.deleteTokenById.run(r);for(let{editor_id:c}of s)this.stmts.insertSignoutTombstone.run(c,n);return s.length})}}async touchActiveSession(r){let n=Date.now();bEe(this.db,()=>{let o=this.stmts.selectActiveSessionByEditor.get(r);o&&this.stmts.bumpLastUsed.run(n,o.token_id)})}async getMetadata(r){return this.stmts.getMetadata.get(r)?.value}async setMetadata(r,n){this.stmts.setMetadata.run(r,n)}};function Y1t(t){return{tokenId:t.token_id,sourceEditorId:t.source_editor_id,record:{user:t.user_login,accessToken:ZMc(t.token_ciphertext),authAuthority:t.auth_authority,oauthClientId:t.oauth_client_id,scopes:t.scopes}}}a(Y1t,"toStoredTokenRecord");function JMc(t){return Buffer.from(t,"utf8")}a(JMc,"encodeToken");function ZMc(t){return new TextDecoder().decode(t)}a(ZMc,"decodeToken");var zHi=ce(require("fs")),pBr=ce(require("node:sqlite")),YHi=ce(require("path"));var fBr=new ge("AuthRepoInit");function SEe(){return typeof performance<"u"?performance.now():Date.now()}a(SEe,"nowMs");function WHi(t){try{t.close()}catch{}}a(WHi,"safeClose");function XMc(t){let e=SEe(),r={durationMs:0};try{zHi.mkdirSync(YHi.dirname(t),{recursive:!0,mode:448})}catch(o){return r.durationMs=SEe()-e,r.errorPhase="ensureDir",r.error=o,{db:void 0,diagnostics:r}}let n;try{n=new pBr.default.DatabaseSync(t)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="connectDb",r.error=o,{db:void 0,diagnostics:r}}try{uBr(n)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="applyPragmas",r.error=o,WHi(n),{db:void 0,diagnostics:r}}try{dBr(n)}catch(o){return r.durationMs=SEe()-e,r.errorPhase="applySchema",r.error=o,WHi(n),{db:void 0,diagnostics:r}}return r.durationMs=SEe()-e,{db:n,diagnostics:r}}a(XMc,"tryOpenAuthDb");function eOc(){let t=new pBr.default.DatabaseSync(":memory:");return uBr(t),dBr(t),new $Le(t)}a(eOc,"openInMemoryAuthRepo");function KHi(t){let{db:e,diagnostics:r}=XMc(t);return e?{repo:new $Le(e),diagnostics:{...r,repoKind:"sqlite"}}:{repo:eOc(),diagnostics:{...r,repoKind:"memory"}}}a(KHi,"buildAuthRepository");function JHi(t,e){if(e.repoKind==="memory"){fBr.error(t,`auth.db open failed (phase=${e.errorPhase}); using in-memory fallback. Tokens will not persist across restarts.`,e.error);try{t.get(sa).showWarningMessageOnlyOnce("auth.db.inMemoryFallback","GitHub Copilot could not open its credential store and is using an in-memory fallback. You will need to sign in again after restarting.").catch(r=>{fBr.info(t,"reportAuthRepoFallbackNotice: notification failed",r)})}catch(r){fBr.info(t,"reportAuthRepoFallbackNotice: notification skipped",r)}}}a(JHi,"reportAuthRepoFallbackNotice");function ZHi(t,e){fZr(t,e)}a(ZHi,"reportAuthRepoTelemetry");p();var RIt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(qXi(),QXi)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function jXi(t){let e=new ile;e.set(Zo,t),e.set(dM,new dM),e.set(ss,new ss),e.set(f2,new f2);let r=new Qt(e);return e.set(Qt,r),e.set(Jt,new Jt(e)),e.set(PN,new PN(e,r)),e.set(bN,new bN),e.set(Nf,new Nf(e)),e.set(k0,new k0),e.set(lv,new lv),e.set(HM,new LTe),e.set(eP,new cce),e.set(Qk,new Fbe),e.set(_d,new _d),e.set(b5,new b5(e)),e.set(Jn,new Jn(e)),e.set(E2,new E2(e)),e.set(VF,wlt(e)),e.set(FA,new FA),e.set(_b,new _b),e.set(WF,WF.default),e.set(W0,new W0(e)),e.set(mx,new mx(e)),e.set(Bp,new Bp),e.set(Eb,new Eb(e)),e.set(Mn,new Mn),e.set(Rd,new Rd(e)),e.set(jM,new jM(e)),e.set(v2,new v2),e.set(ZY,new ZY(e)),e}a(jXi,"createCommonContext");p();var kIt=class extends Df{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||ovt(r))&&this.console.warn(`[${o}]`,...s)}};p();var VXi=require("node:os");var Mzc=new ge("repository"),iie="\\\\",WXi="(?:[#;].*)",I_e=`(?:[^"${iie}]|${iie}.)`,Ozc="[0-9A-Za-z-]",HXi=`[A-Za-z]${Ozc}*`,zXi=`\\s*${WXi}?$`,YXi=`(?:[^"${iie};#]|${iie}.)`,Bzc=`(?:"${I_e}*"|"${I_e}*(?${iie})$)`,Lzc=`(?:${YXi}|${Bzc})+`,Fzc=`(?:(?${iie})$)`,KXi=`(?${Lzc})${Fzc}?${zXi}`,GXi=new RegExp(`^${KXi}`),Uzc=new RegExp(`^(?${I_e}*(?:(?${iie})$|(?")))`),Qzc=new RegExp(`^\\s*(?:(?${HXi})\\s*=\\s*${KXi}|(?${HXi})${zXi})`),qzc=new RegExp(`(?${YXi}+)|"(?${I_e}*)"`,"g"),$Xi="[-.0-9A-Za-z]+",jzc=`\\s+"(?${I_e}*)"`,Hzc=`\\s+"(?${I_e}*)"`,Gzc=new RegExp(`^\\s*\\[(?:(?${$Xi})${jzc}|${Hzc}|(?${$Xi}))\\]`),$zc=new RegExp(`^\\s*${WXi}$`),t6r=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(Gzc);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(Qzc);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(Uzc),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(GXi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(GXi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(qzc)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` -`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){$zc.test(this.line)&&(this.line="")}},PIt=class extends cP{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await W0.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new kY)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new t6r(o),c=new kY;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(Fo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&Mzc.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=xa(this.xdgConfigUri(),"git","config"),s=xa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(ji(r).toLowerCase()!=="config.worktree")return;let n=tf(r),o=xa(n,"commondir");try{let s=(await e.get(Fo).readFileString(o)).trimEnd();return xa(aW(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?Ia(process.env.XDG_CONFIG_HOME):xa(this.homeUri(),".config")}homeUri(){return Ia((0,VXi.homedir)())}};p();var JXi=require("child_process");var DIt=class extends cP{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,JXi.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){O8t.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=ho(r);if(n===void 0)return;let o;try{o=(await rQ()).path}catch(c){O8t.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new kY;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` -`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function ZXi(t){let e=jXi(t);return Vzc(e),e.set(rp,Znt(e)),e.set(UR,w1t(e)),e.set(cP,new YVe([new DIt,new PIt])),e}a(ZXi,"createProductionContext");function Vzc(t){t.set(vI,vI.fromEnvironment(!1)),t.set(yB,new EEe),t.set(Df,new kIt(console))}a(Vzc,"setupRudimentaryLogging");var k3h=new ge("context");p();var xeo=require("fs");p();p();var veo=require("node:url");p();p();var x_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,eeo=new Set,r6r=typeof process=="object"&&process?process:{},teo=a((t,e,r,n)=>{typeof r6r.emitWarning=="function"?r6r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),NIt=globalThis.AbortController,XXi=globalThis.AbortSignal;if(typeof NIt>"u"){XXi=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},NIt=class{static{a(this,"AbortController")}constructor(){e()}signal=new XXi;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=r6r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,teo("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var Wzc=a(t=>!eeo.has(t),"shouldWarn");var NV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),reo=a(t=>NV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?w_e:null:null,"getUintArray"),w_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},n6r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=reo(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},_Fe=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#C;#m;#b;#T;#E;#v;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#C,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!NV(r))throw new TypeError("max option must be a nonnegative integer");let x=r?reo(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#C=n6r.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#v=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!NV(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!NV(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=NV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!NV(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let k="LRU_CACHE_UNBOUNDED";Wzc(k)&&(eeo.add(k),teo("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#k(){let e=new w_e(this.#e),r=new w_e(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=x_e.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?x_e.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=x_e.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#B=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new w_e(this.#e);this.#a=0,this.#b=e,this.#P=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!NV(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!NV(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#P=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#L=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(x_e.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=x_e.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=x_e.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#C.length!==0?this.#C.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#v&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#v&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#P(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#k(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#v||this.#y)&&(this.#v&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#P(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#C.push(r)),this.#s===1?(this.#A=this.#h=0,this.#C.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new NIt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof NIt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#P(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#v||this.#y)&&(this.#v&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#C.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#v&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#C.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var P_e=require("node:path"),feo=require("node:url"),gB=require("fs"),nYc=ce(require("node:fs"),1),BV=require("node:fs/promises");p();var QIt=require("node:events"),u6r=ce(require("node:stream"),1),aeo=require("node:string_decoder");var neo=typeof process=="object"&&process?process:{stdout:null,stderr:null},zzc=a(t=>!!t&&typeof t=="object"&&(t instanceof OV||t instanceof u6r.default||Yzc(t)||Kzc(t)),"isStream"),Yzc=a(t=>!!t&&typeof t=="object"&&t instanceof QIt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==u6r.default.Writable.prototype.pipe,"isReadable"),Kzc=a(t=>!!t&&typeof t=="object"&&t instanceof QIt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),g9=Symbol("EOF"),A9=Symbol("maybeEmitEnd"),MV=Symbol("emittedEnd"),MIt=Symbol("emittingEnd"),CFe=Symbol("emittedError"),OIt=Symbol("closed"),ieo=Symbol("read"),BIt=Symbol("flush"),oeo=Symbol("flushChunk"),gN=Symbol("encoding"),R_e=Symbol("decoder"),qg=Symbol("flowing"),vFe=Symbol("paused"),k_e=Symbol("resume"),jg=Symbol("buffer"),qC=Symbol("pipes"),Hg=Symbol("bufferLength"),i6r=Symbol("bufferPush"),LIt=Symbol("bufferShift"),WE=Symbol("objectMode"),fh=Symbol("destroyed"),o6r=Symbol("error"),s6r=Symbol("emitData"),seo=Symbol("emitEnd"),a6r=Symbol("emitEnd2"),hB=Symbol("async"),c6r=Symbol("abort"),FIt=Symbol("aborted"),bFe=Symbol("signal"),oie=Symbol("dataListeners"),AI=Symbol("discarded"),SFe=a(t=>Promise.resolve().then(t),"defer"),Jzc=a(t=>t(),"nodefer"),Zzc=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),Xzc=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),eYc=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),UIt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[k_e](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},l6r=class extends UIt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},tYc=a(t=>!!t.objectMode,"isObjectModeOptions"),rYc=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),OV=class extends QIt.EventEmitter{static{a(this,"Minipass")}[qg]=!1;[vFe]=!1;[qC]=[];[jg]=[];[WE];[gN];[hB];[R_e];[g9]=!1;[MV]=!1;[MIt]=!1;[OIt]=!1;[CFe]=null;[Hg]=0;[fh]=!1;[bFe];[FIt]=!1;[oie]=0;[AI]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");tYc(r)?(this[WE]=!0,this[gN]=null):rYc(r)?(this[gN]=r.encoding,this[WE]=!1):(this[WE]=!1,this[gN]=null),this[hB]=!!r.async,this[R_e]=this[gN]?new aeo.StringDecoder(this[gN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[jg],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[qC],"get")});let{signal:n}=r;n&&(this[bFe]=n,n.aborted?this[c6r]():n.addEventListener("abort",()=>this[c6r]()))}get bufferLength(){return this[Hg]}get encoding(){return this[gN]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[WE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[hB]}set async(e){this[hB]=this[hB]||!!e}[c6r](){this[FIt]=!0,this.emit("abort",this[bFe]?.reason),this.destroy(this[bFe]?.reason)}get aborted(){return this[FIt]}set aborted(e){}write(e,r,n){if(this[FIt])return!1;if(this[g9])throw new Error("write after end");if(this[fh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[hB]?SFe:Jzc;if(!this[WE]&&!Buffer.isBuffer(e)){if(eYc(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Xzc(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[WE]?(this[qg]&&this[Hg]!==0&&this[BIt](!0),this[qg]?this.emit("data",e):this[i6r](e),this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg]):e.length?(typeof e=="string"&&!(r===this[gN]&&!this[R_e]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[gN]&&(e=this[R_e].write(e)),this[qg]&&this[Hg]!==0&&this[BIt](!0),this[qg]?this.emit("data",e):this[i6r](e),this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg]):(this[Hg]!==0&&this.emit("readable"),n&&o(n),this[qg])}read(e){if(this[fh])return null;if(this[AI]=!1,this[Hg]===0||e===0||e&&e>this[Hg])return this[A9](),null;this[WE]&&(e=null),this[jg].length>1&&!this[WE]&&(this[jg]=[this[gN]?this[jg].join(""):Buffer.concat(this[jg],this[Hg])]);let r=this[ieo](e||null,this[jg][0]);return this[A9](),r}[ieo](e,r){if(this[WE])this[LIt]();else{let n=r;e===n.length||e===null?this[LIt]():typeof n=="string"?(this[jg][0]=n.slice(e),r=n.slice(0,e),this[Hg]-=e):(this[jg][0]=n.subarray(e),r=n.subarray(0,e),this[Hg]-=e)}return this.emit("data",r),!this[jg].length&&!this[g9]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[g9]=!0,this.writable=!1,(this[qg]||!this[vFe])&&this[A9](),this}[k_e](){this[fh]||(!this[oie]&&!this[qC].length&&(this[AI]=!0),this[vFe]=!1,this[qg]=!0,this.emit("resume"),this[jg].length?this[BIt]():this[g9]?this[A9]():this.emit("drain"))}resume(){return this[k_e]()}pause(){this[qg]=!1,this[vFe]=!0,this[AI]=!1}get destroyed(){return this[fh]}get flowing(){return this[qg]}get paused(){return this[vFe]}[i6r](e){this[WE]?this[Hg]+=1:this[Hg]+=e.length,this[jg].push(e)}[LIt](){return this[WE]?this[Hg]-=1:this[Hg]-=this[jg][0].length,this[jg].shift()}[BIt](e=!1){do;while(this[oeo](this[LIt]())&&this[jg].length);!e&&!this[jg].length&&!this[g9]&&this.emit("drain")}[oeo](e){return this.emit("data",e),this[qg]}pipe(e,r){if(this[fh])return e;this[AI]=!1;let n=this[MV];return r=r||{},e===neo.stdout||e===neo.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[qC].push(r.proxyErrors?new l6r(this,e,r):new UIt(this,e,r)),this[hB]?SFe(()=>this[k_e]()):this[k_e]()),e}unpipe(e){let r=this[qC].find(n=>n.dest===e);r&&(this[qC].length===1?(this[qg]&&this[oie]===0&&(this[qg]=!1),this[qC]=[]):this[qC].splice(this[qC].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[AI]=!1,this[oie]++,!this[qC].length&&!this[qg]&&this[k_e]();else if(e==="readable"&&this[Hg]!==0)super.emit("readable");else if(Zzc(e)&&this[MV])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[CFe]){let o=r;this[hB]?SFe(()=>o.call(this,this[CFe])):o.call(this,this[CFe])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[oie]=this.listeners("data").length,this[oie]===0&&!this[AI]&&!this[qC].length&&(this[qg]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[oie]=0,!this[AI]&&!this[qC].length&&(this[qg]=!1)),r}get emittedEnd(){return this[MV]}[A9](){!this[MIt]&&!this[MV]&&!this[fh]&&this[jg].length===0&&this[g9]&&(this[MIt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[OIt]&&this.emit("close"),this[MIt]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==fh&&this[fh])return!1;if(e==="data")return!this[WE]&&!n?!1:this[hB]?(SFe(()=>this[s6r](n)),!0):this[s6r](n);if(e==="end")return this[seo]();if(e==="close"){if(this[OIt]=!0,!this[MV]&&!this[fh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[CFe]=n,super.emit(o6r,n);let s=!this[bFe]||this.listeners("error").length?super.emit("error",n):!1;return this[A9](),s}else if(e==="resume"){let s=super.emit("resume");return this[A9](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[A9](),o}[s6r](e){for(let n of this[qC])n.dest.write(e)===!1&&this.pause();let r=this[AI]?!1:super.emit("data",e);return this[A9](),r}[seo](){return this[MV]?!1:(this[MV]=!0,this.readable=!1,this[hB]?(SFe(()=>this[a6r]()),!0):this[a6r]())}[a6r](){if(this[R_e]){let r=this[R_e].end();if(r){for(let n of this[qC])n.dest.write(r);this[AI]||super.emit("data",r)}}for(let r of this[qC])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[WE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[WE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[WE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(fh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[AI]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[g9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(fh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(fh,f),this.pause(),s({value:h,done:!!this[g9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(fh,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(fh,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[AI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(o6r,r),this.off(fh,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(o6r,r),this.once(fh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[fh])return e?this.emit("error",e):this.emit(fh),this;this[fh]=!0,this[AI]=!0,this[jg].length=0,this[Hg]=0;let r=this;return typeof r.close=="function"&&!this[OIt]&&r.close(),e?this.emit("error",e):this.emit(fh),this}static get isStream(){return zzc}};var iYc=gB.realpathSync.native,IFe={lstatSync:gB.lstatSync,readdir:gB.readdir,readdirSync:gB.readdirSync,readlinkSync:gB.readlinkSync,realpathSync:iYc,promises:{lstat:BV.lstat,readdir:BV.readdir,readlink:BV.readlink,realpath:BV.realpath}},peo=a(t=>!t||t===IFe||t===nYc?IFe:{...IFe,...t,promises:{...IFe.promises,...t.promises||{}}},"fsFromOption"),heo=/^\\\\\?\\([a-z]:)\\?$/i,oYc=a(t=>t.replace(/\//g,"\\").replace(heo,"$1\\"),"uncToDrive"),sYc=/[\\\/]/,ek=0,meo=1,geo=2,mB=4,Aeo=6,yeo=8,sie=10,Eeo=12,XR=15,TFe=~XR,d6r=16,ceo=32,xFe=64,AN=128,qIt=256,HIt=512,leo=xFe|AN|HIt,aYc=1023,f6r=a(t=>t.isFile()?yeo:t.isDirectory()?mB:t.isSymbolicLink()?sie:t.isCharacterDevice()?geo:t.isBlockDevice()?Aeo:t.isSocket()?Eeo:t.isFIFO()?meo:ek,"entToType"),ueo=new Map,wFe=a(t=>{let e=ueo.get(t);if(e)return e;let r=t.normalize("NFKD");return ueo.set(t,r),r},"normalize"),deo=new Map,jIt=a(t=>{let e=deo.get(t);if(e)return e;let r=wFe(t.toLowerCase());return deo.set(t,r),r},"normalizeNocase"),GIt=class extends _Fe{static{a(this,"ResolveCache")}constructor(){super({max:256})}},p6r=class extends _Fe{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},_eo=Symbol("PathScurry setAsCwd"),zE=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#C;get atime(){return this.#C}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#v;#S;#y;#k;#R;#d;#B;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=ek,n,o,s,c,l){this.name=e,this.#E=s?jIt(e):wFe(e),this.#d=r&aYc,this.nocase=s,this.roots=o,this.root=n||this,this.#B=c,this.#S=l.fullpath,this.#k=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=peo(l.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(o):this.#P(o)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#B.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#B.set(this,r),this.#d&=~d6r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?jIt(e):wFe(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,ek,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=AN),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let e=this.name,r=this.parent;if(!r)return this.#k=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&XR)===ek}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&XR)===yeo}isDirectory(){return(this.#d&XR)===mB}isCharacterDevice(){return(this.#d&XR)===geo}isBlockDevice(){return(this.#d&XR)===Aeo}isFIFO(){return(this.#d&XR)===meo}isSocket(){return(this.#d&XR)===Eeo}isSymbolicLink(){return(this.#d&sie)===sie}lstatCached(){return this.#d&ceo?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&XR;return!(e!==ek&&e!==sie||this.#d&qIt||this.#d&AN)}calledReaddir(){return!!(this.#d&d6r)}isENOENT(){return!!(this.#d&AN)}isNamed(e){return this.nocase?this.#E===jIt(e):this.#E===wFe(e)}async readlink(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=d6r;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&leo)return!1;let e=XR&this.#d;return e===ek||e===mB||e===sie}shouldWalk(e,r){return(this.#d&mB)===mB&&!(this.#d&leo)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((HIt|qIt|AN)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((HIt|qIt|AN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[_eo](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#k=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#k=void 0,o.#R=void 0,o=o.parent}},$It=class t extends zE{static{a(this,"PathWin32")}sep="\\";splitSep=sYc;constructor(e,r=ek,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=ek,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return P_e.win32.parse(e).root}getRoot(e){if(e=oYc(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new D_e(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(heo,"$1\\"),e===r}},VIt=class t extends zE{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=ek,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=ek,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},WIt=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=IFe}={}){this.#n=peo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,feo.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new GIt,this.#t=new GIt,this.#r=new p6r(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):E()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new OV({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((E,_,v=!1)=>{if(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof zE||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new OV({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[_eo](r)}},D_e=class extends WIt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,P_e.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return P_e.win32.parse(e).root.toUpperCase()}newRoot(e){return new $It(this.rootPath,mB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},N_e=class extends WIt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,P_e.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new VIt(this.rootPath,mB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},RFe=class extends N_e{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},G3h=process.platform==="win32"?$It:VIt,Ceo=process.platform==="win32"?D_e:process.platform==="darwin"?RFe:N_e;p();var cYc=a(t=>t.length>=1,"isPatternList"),lYc=a(t=>t.length>=1,"isGlobList"),M_e=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!cYc(e))throw new TypeError("empty pattern list");if(!lYc(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Up}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var uYc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",O_e=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=uYc}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new b_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},g6r=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},kFe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new m6r;subwalks=new g6r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new h6r}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===Up){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===Up?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var dYc=a((t,e)=>typeof t=="string"?new O_e([t],e):Array.isArray(t)?new O_e(t,e):t,"makeIgnore"),zIt=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=dYc(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new kFe(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new kFe(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},PFe=class extends zIt{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},DFe=class extends zIt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new OV({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var fYc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yN=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,veo.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||fYc,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?D_e:r.platform==="darwin"?RFe:r.platform?N_e:Ceo;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new b_(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new M_e(u,f,0,this.platform)})}async walk(){return[...await new PFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new PFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new DFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new DFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var A6r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new b_(r,e).hasMagic())return!0;return!1},"hasMagic");function KIt(t,e={}){return new yN(t,e).streamSync()}a(KIt,"globStreamSync");function Seo(t,e={}){return new yN(t,e).stream()}a(Seo,"globStream");function Teo(t,e={}){return new yN(t,e).walkSync()}a(Teo,"globSync");async function beo(t,e={}){return new yN(t,e).walk()}a(beo,"glob_");function JIt(t,e={}){return new yN(t,e).iterateSync()}a(JIt,"globIterateSync");function Ieo(t,e={}){return new yN(t,e).iterate()}a(Ieo,"globIterate");var pYc=KIt,hYc=Object.assign(Seo,{sync:KIt}),mYc=JIt,gYc=Object.assign(Ieo,{sync:JIt}),AYc=Object.assign(Teo,{stream:KIt,iterate:JIt}),YIt=Object.assign(beo,{glob:beo,globSync:Teo,sync:AYc,globStream:Seo,stream:hYc,globStreamSync:KIt,streamSync:pYc,globIterate:Ieo,iterate:gYc,globIterateSync:JIt,iterateSync:mYc,Glob:yN,hasMagic:A6r,escape:Oce,unescape:lP});YIt.glob=YIt;var NFe=class t{constructor(){this.logger=new ge("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(T_),s=r.map(d=>Wn(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(Ia(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await YIt(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await xeo.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=Ia(r);try{let o=await e.get(Fo).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var ZFh=new ge("exp");function Reo(t){let e=t.get(Jt);e.registerStaticFilters(_Yc(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>qt(t,je.DebugOverrideEngine)||qt(t,je.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>R9e()?"copilot-web":t.get(Lr).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>weo(t)),e.registerDynamicFilter(yie.CopilotRelatedPluginVersionGithubCopilot,()=>weo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>yYc(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Lr).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>ZIt(t.get(Lr).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>EYc(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(CI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getRelatedPluginInfo()){let o=r_+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(yie).includes(o)){x9e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=ZIt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Lr).getEditorPluginSpecificFilters()){let o=n.isVersion?ZIt(n.value):n.value;r[n.filter]=o}return r})}a(Reo,"setupExperimentationService");function weo(t){return ZIt(!t.get(ss).isProduction()&&t.get(Lr).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Lr).getEditorPluginInfo().version)}a(weo,"getEditorPluginVersion");function yYc(t){let e=t.get(Lr).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(yYc,"getPluginRelease");function EYc(t){let e=t.get(Lr).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(EYc,"getTargetPopulation");function _Yc(t){return CYc(t)}a(_Yc,"createAllFilters");function CYc(t){let e=t.get(Fa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(ss).isProduction()?N1(t):"1.999.0"}}a(CYc,"createDefaultFilters");function ZIt(t){return t.split("-")[0]}a(ZIt,"trimVersionSuffix");p();var LV=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var B_e=class{static{a(this,"AbstractCopilotMessageSender")}};p();var keo=100,Peo=1e3*60*5;function Deo(t){let e=new y6r(t);t.get(n0).registerContextProvider(e),t.get(S5).add(e.id)}a(Deo,"registerRelatedFilesShim");var y6r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new sk(keo,Peo);this.relatedFilesCache=new sk(keo,Peo);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await alt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){D7(this.ctx,s,"relatedFilesShim")}}};var Tto=ce(cX()),Ito=ce(require("path"));p();var MFe=ce(ti());var vYc=new MFe.ProtocolRequestType("workspace/readFile"),bYc=new MFe.ProtocolRequestType("workspace/readDirectory"),SYc=new MFe.ProtocolRequestType("workspace/findFiles"),TYc=new MFe.ProtocolRequestType("workspace/findTextInFiles"),XIt=class extends aa{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(vYc,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(bYc,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(SYc,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(TYc,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(ur).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return gt(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw gi(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var ext=class extends eO{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(ur);try{return await o.connection.sendRequest(r,n)}catch(s){throw gi(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var txt=class t extends dX{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(ur)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),sm.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){sm.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(Mn).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return sm.debug(this.context,"`copilot/related` not supported"),vJn;try{let c=await this.service.connection.sendRequest(OUt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){sm.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,ht(r,"copilotRelated.hasRelatedCapability",n)}catch(s){sm.exception(r,s,"copilotRelated")}}};p();p();var Ueo=ce(ti());p();p();function Neo(t,e){return(e<<5)-e+t|0}a(Neo,"numberHash");function Meo(t,e){e=Neo(149417,e);for(let r=0,n=t.length;rnew XD(o,XD.providerId,s,void 0));if(n.status!=="OK"&&n.status!=="MaybeOK")throw new fo(it.CodeFlowFailed,`Authentication failed: ${n.status}`)}catch(e){throw e instanceof z9?new fo(it.CodeFlowFailed,`OAuth code flow requires a browser but none is available: ${e.message}`):e instanceof gi?new fo(it.CodeFlowFailed,`Authentication failed: ${e.message}`):e}}a(R1t,"performACPGitHubOAuth");function P1t(t){if(t!=="github_oauth")throw new fo(it.InvalidParams,`Unknown authentication method: ${t}`)}a(P1t,"validateAuthMethodId");async function k1t(t){let r=await t.get(Fr).checkAndUpdateStatus({localChecksOnly:!0});if(r.status!=="OK"&&r.status!=="MaybeOK")throw fo.authRequired()}a(k1t,"requireACPAuthenticated");var FHi=[{id:yl.Ask.id,name:yl.Ask.name,description:yl.Ask.description},{id:yl.Agent.id,name:yl.Agent.name,description:yl.Agent.description}],D1t=class{constructor(e,r){this.connection=e;this.ctx=r;this.sessions=new Map;this.clientCapabilities={readTextFile:!1,writeTextFile:!1}}static{a(this,"CopilotACPAgent")}initialize(e){if(e.clientInfo){let o=this.ctx.get(Nr);o instanceof bq&&o.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}_t(this.ctx,"acp.initialize");let r=e.clientCapabilities?.fs;r&&(this.clientCapabilities={readTextFile:r.readTextFile??!1,writeTextFile:r.writeTextFile??!1});let n=[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}];return Promise.resolve({protocolVersion:itt,agentCapabilities:{loadSession:!1,promptCapabilities:{audio:!1,embeddedContext:!0,image:!1}},agentInfo:{name:"GitHub Copilot",version:I1(this.ctx)},authMethods:n})}async newSession(e){_t(this.ctx,"acp.newSession"),await this.requireAuthenticated();let r=ir(),n=ir(),s=this.ctx.get(Go).create({source:"panel",conversationId:n}),c=e.cwd?{uri:ba(e.cwd)}:null,l=this.getAvailableModes(),u=this.getDefaultModeId(),{availableModels:d,defaultModelId:f}=await this.getAvailableModels(),h=f;return this.sessions.set(r,{conversationId:n,conversation:s,pendingPrompt:null,cancellationTokenSource:null,workspaceFolder:c,currentModeId:u,currentModelId:h}),{sessionId:r,modes:{currentModeId:u,availableModes:l},models:{currentModelId:h,availableModels:d}}}async authenticate(e){return _t(this.ctx,"acp.authenticate"),P1t(e.methodId),await R1t(this.ctx),{}}async requireAuthenticated(){await k1t(this.ctx)}async prompt(e){_t(this.ctx,"acp.prompt"),await this.requireAuthenticated();let r=this.sessions.get(e.sessionId);if(!r)throw new Error(`Session ${e.sessionId} not found`);let n=process.env.GITHUB_COPILOT_ACP_MODEL_ID??r.currentModelId;r.pendingPrompt?.abort(),r.cancellationTokenSource?.cancel(),r.pendingPrompt=new AbortController,r.cancellationTokenSource=new jn.CancellationTokenSource,r.pendingPrompt.signal.addEventListener("abort",()=>{r.cancellationTokenSource?.cancel()});try{let s={message:this.extractTextFromPrompt(e.prompt),type:"user"},c=ir(),l=new Yf(s,c),u=r.currentModeId===yl.Ask.id?yl.Ask:yl.Agent;l.chatMode=u,l.userRequestedModel=n;let d=this.extractReferencesFromPrompt(e.prompt),f=this.ctx.get(Go),h=r.workspaceFolder?[{uri:r.workspaceFolder.uri,name:""}]:void 0;await f.addTurn(r.conversation.id,l,d,void 0,r.workspaceFolder??void 0,h);let m=new w1t(this.connection,e.sessionId),g=new Vx(this.ctx,r.conversation,l,r.cancellationTokenSource.token),A=this.ctx.get(v_);A instanceof eV&&A.setACPContext(this.connection,this.clientCapabilities,e.sessionId);let E=await this.ctx.get(KD).createProcessor(g,e.sessionId);try{await E.process(m,r.cancellationTokenSource.token,void 0,void 0,{id:n})}finally{A instanceof eV&&A.clearACPContext()}return r.pendingPrompt=null,r.cancellationTokenSource=null,{stopReason:"end_turn"}}catch(o){let s=this.ctx.get(v_);if(s instanceof eV&&s.clearACPContext(),r.pendingPrompt?.signal.aborted)return{stopReason:"cancelled"};throw o}}cancel(e){_t(this.ctx,"acp.cancel");let r=this.sessions.get(e.sessionId);return r?.pendingPrompt?.abort(),r?.cancellationTokenSource?.cancel(),Promise.resolve()}async setSessionMode(e){_t(this.ctx,"acp.setSessionMode");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(it.InvalidParams,`Session ${e.sessionId} not found`);let n=this.getAvailableModes();if(!n.some(s=>s.id===e.modeId))throw new fo(it.InvalidParams,`Mode '${e.modeId}' is not available. Available modes: ${n.map(s=>s.id).join(", ")}`);return r.currentModeId=e.modeId,Promise.resolve({})}async unstable_setSessionModel(e){_t(this.ctx,"acp.setSessionModel");let r=this.sessions.get(e.sessionId);if(!r)throw new fo(it.InvalidParams,`Session ${e.sessionId} not found`);let{availableModels:n}=await this.getAvailableModels();if(!n.some(s=>s.modelId===e.modelId))throw new fo(it.InvalidParams,`Model '${e.modelId}' is not available. Available models: ${n.map(s=>s.modelId).join(", ")}`);return r.currentModelId=e.modelId,{}}isAgentModeEnabled(){return MI(this.ctx)?.getTokenValue("agent_mode")!=="0"}getAvailableModes(){return this.isAgentModeEnabled()?FHi:FHi.filter(e=>e.id===yl.Ask.id)}getDefaultModeId(){return this.isAgentModeEnabled()?yl.Agent.id:yl.Ask.id}async getAvailableModels(){let e=await this.ctx.get(Fa).getMetadata(),r=[],n=P_;r.push({modelId:P_,name:"Auto",description:"Automatically selects the best model for the task"});for(let o of e)o.model_picker_enabled&&o.capabilities.type==="chat"&&this.isModelCompatibleWithAgentMode(o)&&r.push({modelId:o.id,name:o.name,description:this.getModelDescription(o)});return{availableModels:r,defaultModelId:n}}isModelCompatibleWithAgentMode(e){return!(Gae.has(e.capabilities.family)||!e.capabilities.supports?.tool_calls||(e.capabilities.limits?.max_prompt_tokens??0)<4e4)}getModelDescription(e){let r=e.billing?.multiplier;if(r!==void 0)return`${r}x`}extractTextFromPrompt(e){return e.filter(r=>r.type==="text").map(r=>r.text).join(` +`)}extractReferencesFromPrompt(e){let r=[];for(let n of e)if(n.type==="resource_link"){let o=n;r.push({type:"file",uri:o.uri})}else if(n.type==="resource"){let o=n;o.resource?.uri&&r.push({type:"file",uri:o.resource.uri})}return r}getFileSystemCapabilities(){return this.clientCapabilities}getConnection(){return this.connection}};p();var UHi=require("node:child_process"),M1t=require("node:stream");var N1t=class{constructor(e,r){this.cliInfo=e;this.ctx=r;this.cliProcess=null;this._cliConnection=null;this.disposed=!1}static{a(this,"CLIProcessManager")}start(e,r){if(this.disposed)throw new Error("CLIProcessManager has been disposed");if(this.cliProcess)throw new Error("CLI process is already running");let n={...process.env,COPILOT_AUTO_UPDATE:"false"};r&&(n.GH_TOKEN=r);let o=[...this.cliInfo.args,"--acp","--stdio"];if(this.cliProcess=(0,UHi.spawn)(this.cliInfo.path,o,{stdio:["pipe","pipe","inherit"],env:n,shell:NUt}),!this.cliProcess.stdin||!this.cliProcess.stdout)throw new Error("Failed to start Copilot CLI process with piped stdio");this.cliProcess.on("error",u=>{si(this.ctx,"acp.cli.process.error",u)}),this.cliProcess.on("exit",(u,d)=>{this.disposed||_t(this.ctx,"acp.cli.process.exit",{exitCode:String(u??""),exitSignal:d??""}),this.cliProcess=null});let s=M1t.Writable.toWeb(this.cliProcess.stdin),c=M1t.Readable.toWeb(this.cliProcess.stdout),l=hwe(s,c);return this._cliConnection=new utt(e,l),this._cliConnection}get connection(){return this._cliConnection}get isRunning(){return this.cliProcess!==null&&this.cliProcess.exitCode===null}async kill(){await this.terminateProcess()}async dispose(){this.disposed=!0,await this.terminateProcess()}async terminateProcess(){if(this.cliProcess){try{this.cliProcess.stdin?.end(),this.cliProcess.kill("SIGTERM")}catch{}await new Promise(e=>{if(!this.cliProcess){e();return}let r=setTimeout(()=>{this.cliProcess?.kill("SIGKILL"),e()},3e3);this.cliProcess.once("exit",()=>{clearTimeout(r),e()})}),this.cliProcess=null}this._cliConnection=null}};p();var O1t=class{constructor(e,r,n){this.externalConnection=e;this.ctx=r;this.cliProcessManager=n;this.cliConnection=null;this.initParams=null;this.ensureCLIPromise=null}static{a(this,"CLIProxyAgent")}initialize(e){if(e.clientInfo){let r=this.ctx.get(Nr);r instanceof bq&&r.setEditorAndPluginInfo({name:e.clientInfo.name,version:e.clientInfo.version},{name:e.clientInfo.name,version:e.clientInfo.version})}return _t(this.ctx,"acp.cli.initialize"),this.initParams=e,Promise.resolve({protocolVersion:itt,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{}},mcpCapabilities:{http:!0,sse:!0},promptCapabilities:{audio:!1,embeddedContext:!0,image:!0}},agentInfo:{name:"GitHub Copilot",version:I1(this.ctx)},authMethods:[{id:"github_oauth",name:"Sign in with GitHub",description:"Authenticate using GitHub OAuth (opens browser)"}]})}async authenticate(e){return _t(this.ctx,"acp.cli.authenticate"),P1t(e.methodId),await R1t(this.ctx),{}}async newSession(e){return _t(this.ctx,"acp.cli.newSession"),await this.requireAuthenticated(),(await this.ensureCLI()).newSession(e)}async prompt(e){return _t(this.ctx,"acp.cli.prompt"),await this.requireAuthenticated(),(await this.ensureCLI()).prompt(e)}async cancel(e){return _t(this.ctx,"acp.cli.cancel"),(await this.ensureCLI()).cancel(e)}async setSessionMode(e){return _t(this.ctx,"acp.cli.setSessionMode"),(await this.ensureCLI()).setSessionMode(e)}async unstable_setSessionModel(e){return _t(this.ctx,"acp.cli.setSessionModel"),(await this.ensureCLI()).unstable_setSessionModel(e)}async setSessionConfigOption(e){return _t(this.ctx,"acp.cli.setSessionConfigOption"),(await this.ensureCLI()).setSessionConfigOption(e)}async loadSession(e){return _t(this.ctx,"acp.cli.loadSession"),await this.requireAuthenticated(),(await this.ensureCLI()).loadSession(e)}async listSessions(e){return _t(this.ctx,"acp.cli.listSessions"),await this.requireAuthenticated(),(await this.ensureCLI()).listSessions(e)}async ensureCLI(){if(this.cliConnection)return this.cliConnection;if(!this.initParams)throw new fo(it.InternalError,"CLI connection not initialized. Call initialize() first.");if(this.ensureCLIPromise)return this.ensureCLIPromise;this.ensureCLIPromise=this.spawnAndInitializeCLI();try{return await this.ensureCLIPromise}finally{this.ensureCLIPromise=null}}async spawnAndInitializeCLI(){try{let r=(await this.ctx.get(Ut).getGitHubSession())?.accessToken;this.cliConnection=this.cliProcessManager.start(u=>this.createCLIClientHandler(),r);let n=this.initParams.clientInfo,o={name:"GitHub Copilot Language Server",version:I1(this.ctx)},s=n?{...n,_meta:{...n._meta??{},proxyClientInfo:o}}:o,c=this.cliConnection.initialize({protocolVersion:this.initParams.protocolVersion,clientCapabilities:this.initParams.clientCapabilities,clientInfo:s}),l=this.cliConnection.closed.then(()=>{throw new Error("CLI connection closed before initialize response was received")});l.catch(()=>{}),await Promise.race([c,l]),_t(this.ctx,"acp.cli.handshake",{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source})}catch(e){throw si(this.ctx,"acp.cli.handshake.error",e,{cliVersion:this.cliProcessManager.cliInfo.version,cliSource:this.cliProcessManager.cliInfo.source}),this.cliConnection=null,await this.cliProcessManager.kill(),new fo(it.InternalError,`Failed to initialize Copilot CLI: ${e instanceof Error?e.message:String(e)}`)}return this.cliConnection}async requireAuthenticated(){await k1t(this.ctx)}createCLIClientHandler(){return{sessionUpdate:a(async e=>{await this.externalConnection.sessionUpdate(e)},"sessionUpdate"),requestPermission:a(async e=>this.externalConnection.requestPermission(e),"requestPermission"),readTextFile:a(async e=>this.externalConnection.readTextFile(e),"readTextFile"),writeTextFile:a(async e=>this.externalConnection.writeTextFile(e),"writeTextFile"),createTerminal:a(async e=>({terminalId:(await this.externalConnection.createTerminal(e)).id}),"createTerminal"),extMethod:a(async(e,r)=>this.externalConnection.extMethod(e,r),"extMethod"),extNotification:a(async(e,r)=>this.externalConnection.extNotification(e,r),"extNotification")}}async dispose(){await this.cliProcessManager.dispose()}};p();p();var mIt=class{static{a(this,"ClaudeCodeSdkWrapper")}_loadSdk(){return this._sdkPromise??=Promise.resolve().then(()=>(wXi(),xXi)),this._sdkPromise}async query(e){return(await this._loadSdk()).query(e)}async listSessions(e){return(await this._loadSdk()).listSessions(e)}async getSessionInfo(e,r){return(await this._loadSdk()).getSessionInfo(e,r)}async getSessionMessages(e,r){return(await this._loadSdk()).getSessionMessages(e,r)}async forkSession(e,r){return(await this._loadSdk()).forkSession(e,r)}};p();p();function RXi(t){let e=new ple;e.set(Yo,t),e.set(oM,new oM),e.set(os,new os),e.set(l2,new l2);let r=new Ut(e);return e.set(Ut,r),e.set(Jt,new Jt(e)),e.set(IM,new IM(e,r)),e.set(_N,new _N),e.set(Mf,new Mf(e)),e.set(k0,new k0),e.set(sC,new sC),e.set(VM,new iIe),e.set(JP,new Xae),e.set(LP,new xbe),e.set(_d,new _d),e.set(A5,new A5(e)),e.set(ri,new ri(e)),e.set(g2,new g2(e)),e.set(UF,Nlt(e)),e.set(GA,new GA),e.set(pb,new pb),e.set(QF,QF.default),e.set(z0,new z0(e)),e.set(fx,new fx(e)),e.set(Up,new Up),e.set(fb,new fb(e)),e.set(On,new On),e.set(uu,new uu(e)),e.set($M,new $M(e)),e.set(_2,new _2),e.set(tK,new tK(e)),e}a(RXi,"createCommonContext");p();var gIt=class extends Nf{constructor(r){super();this.console=r}static{a(this,"ConsoleLog")}logIt(r,n,o,...s){n==1?this.console.error(`[${o}]`,...s):(n==2||$vt(r))&&this.console.warn(`[${o}]`,...s)}};p();var NXi=require("node:os");var RVc=new Ae("repository"),Jne="\\\\",MXi="(?:[#;].*)",h_e=`(?:[^"${Jne}]|${Jne}.)`,PVc="[0-9A-Za-z-]",PXi=`[A-Za-z]${PVc}*`,OXi=`\\s*${MXi}?$`,BXi=`(?:[^"${Jne};#]|${Jne}.)`,kVc=`(?:"${h_e}*"|"${h_e}*(?${Jne})$)`,DVc=`(?:${BXi}|${kVc})+`,NVc=`(?:(?${Jne})$)`,LXi=`(?${DVc})${NVc}?${OXi}`,kXi=new RegExp(`^${LXi}`),MVc=new RegExp(`^(?${h_e}*(?:(?${Jne})$|(?")))`),OVc=new RegExp(`^\\s*(?:(?${PXi})\\s*=\\s*${LXi}|(?${PXi})${OXi})`),BVc=new RegExp(`(?${BXi}+)|"(?${h_e}*)"`,"g"),DXi="[-.0-9A-Za-z]+",LVc=`\\s+"(?${h_e}*)"`,FVc=`\\s+"(?${h_e}*)"`,UVc=new RegExp(`^\\s*\\[(?:(?${DXi})${LVc}|${FVc}|(?${DXi}))\\]`),QVc=new RegExp(`^\\s*${MXi}$`),N8r=class{constructor(e){this.content=e;this.stopped=!1;this.section="";this.line="";this.lineNum=0;this.lines=[];this.linesWithErrors=[]}static{a(this,"GitConfigParser")}parse(e){for(this.stopped=!1,this.section="",this.line="",this.linesWithErrors=[],this.configValueHandler=e,this.lines=this.content.split(/\r?\n/),this.lineNum=0;!this.stopped&&this.lineNum0}errorAt(e){this.linesWithErrors.push(e)}parseSectionStart(){let e=this.line.match(UVc);e&&(e.groups?.simple?this.section=e.groups.simple.toLowerCase()+"."+this.unescapeBaseValue(e.groups.ext):e.groups?.extOnly?this.section="."+this.unescapeBaseValue(e.groups.extOnly):this.section=e.groups.simpleOnly.toLowerCase(),this.line=this.line.slice(e[0].length))}unescapeBaseValue(e){return e.replace(/\\(.)/g,"$1")}parseConfigPair(){let e=this.line.match(OVc);if(e){if(e.groups?.key){let r=this.handleContinued(e);this.configValueHandler?.(this.nameWithSection(e.groups.key.toLowerCase()),r)}else e.groups?.soloKey&&this.configValueHandler?.(this.nameWithSection(e.groups.soloKey.toLowerCase()),"");this.line=""}}handleContinued(e){let r=e,n=[this.matchedValue(r)];for(;r?.groups?.cont||r?.groups?.strCont;){if(this.line=this.lines[++this.lineNum],this.lineNum>=this.lines.length){this.errorAt(this.lineNum);break}r.groups.strCont?(r=this.line.match(MVc),r?(n.push(this.matchedValue(r)),r.groups?.quote&&(r=this.line.slice(r[0].length).match(kXi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))):this.errorAt(this.lineNum+1)):(r=this.line.match(kXi),r?n.push(this.matchedValue(r)):this.errorAt(this.lineNum+1))}return this.normalizeValue(n.join(""))}matchedValue(e){return e.groups.strCont?e.groups.value.slice(0,-1):e.groups.value}normalizeValue(e){let r=!1,n=[...e.matchAll(BVc)].map(o=>o.groups?.value?(r=!0,this.unescapeValue(o.groups.value.replace(/\s/g," "))):(r=!1,this.unescapeValue(o.groups.string))).join("");return r?n.trimEnd():n}unescapeValue(e){let r={n:` +`,t:" ",b:"\b"};return e.replace(/\\(.)/g,(n,o)=>r[o]||o)}nameWithSection(e){return this.section?this.section+"."+e:e}parseComment(){QVc.test(this.line)&&(this.line="")}},AIt=class extends hk{static{a(this,"GitParsingConfigLoader")}async getConfig(e,r){let n=await z0.getRepoConfigLocation(e,r);if(!n)return;let o=await this.getParsedConfig(e,n);if(o)return this.mergeConfig(await this.baseConfig(e,n),o)}mergeConfig(...e){return e.filter(r=>r!==void 0).reduce((r,n)=>r.concat(n),new jY)}async getParsedConfig(e,r,n=!0){let o=await this.tryLoadConfig(e,r,n);if(!o)return;let s=new N8r(o),c=new jY;return s.parse((l,u)=>c.add(l,u)),c}async tryLoadConfig(e,r,n){try{return await e.get(jo).readFileString(r)}catch(o){(n||!(o instanceof Error)||o.code!=="ENOENT")&&RVc.warn(e,`Failed to load git config from ${JSON.stringify(r)}:`,o);return}}async baseConfig(e,r){let n=await this.commondirConfigUri(e,r),o=Sa(this.xdgConfigUri(),"git","config"),s=Sa(this.homeUri(),".gitconfig");return this.mergeConfig(await this.getParsedConfig(e,o,!1),await this.getParsedConfig(e,s,!1),n?await this.getParsedConfig(e,n,!1):void 0)}async commondirConfigUri(e,r){if(Ki(r).toLowerCase()!=="config.worktree")return;let n=Xd(r),o=Sa(n,"commondir");try{let s=(await e.get(jo).readFileString(o)).trimEnd();return Sa(ZV(n,s),"config")}catch{return}}xdgConfigUri(){return typeof process<"u"&&process.env.XDG_CONFIG_HOME?ba(process.env.XDG_CONFIG_HOME):Sa(this.homeUri(),".config")}homeUri(){return ba((0,NXi.homedir)())}};p();var FXi=require("child_process");var yIt=class extends hk{static{a(this,"GitCLIConfigLoader")}runCommand(e,r,n){return new Promise((o,s)=>{(0,FXi.execFile)(r,n,{cwd:e},(c,l)=>{c?s(c):o(l)})})}async tryRunCommand(e,r,n,o){try{return await this.runCommand(r,n,o)}catch(s){UUt.info(e,`Failed to run command '${n}' in ${r}:`,s);return}}async getConfig(e,r){let n=Ko(r);if(n===void 0)return;let o;try{o=(await _Q()).path}catch(c){UUt.info(e,`Skipping git config lookup: ${c.message}`);return}let s=await this.tryRunCommand(e,n,o,["-c","safe.directory=*","config","--list","--null",...this.extraArgs()]);return s?this.extractConfig(s):void 0}extractConfig(e){let r=new jY;for(let n of e.split("\0").filter(o=>o)){let o=n.split(` +`,1)[0],s=n.slice(o.length+1);r.add(o,s)}return r}extraArgs(){return[]}};function UXi(t){let e=RXi(t);return qVc(e),e.set(sp,Vnt(e)),e.set(BR,m1t(e)),e.set(hk,new yze([new yIt,new AIt])),e}a(UXi,"createProductionContext");function qVc(t){t.set(yI,yI.fromEnvironment(!1)),t.set(dB,new lEe),t.set(Nf,new gIt(console))}a(qVc,"setupRudimentaryLogging");var mLh=new Ae("context");p();var heo=require("fs");p();p();var leo=require("node:url");p();p();var m_e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,qXi=new Set,M8r=typeof process=="object"&&process?process:{},jXi=a((t,e,r,n)=>{typeof M8r.emitWarning=="function"?M8r.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},"emitWarning"),EIt=globalThis.AbortController,QXi=globalThis.AbortSignal;if(typeof EIt>"u"){QXi=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,o){this._onabort.push(o)}},EIt=class{static{a(this,"AbortController")}constructor(){e()}signal=new QXi;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let o of this.signal._onabort)o(n);this.signal.onabort?.(n)}}};let t=M8r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{t&&(t=!1,jXi("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var jVc=a(t=>!qXi.has(t),"shouldWarn");var CV=a(t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),"isPosInt"),HXi=a(t=>CV(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?g_e:null:null,"getUintArray"),g_e=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},O8r=class t{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let r=HXi(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},sFe=class t{static{a(this,"LRUCache")}#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#c;#u;#l;#p;#g;#A;#h;#v;#m;#b;#T;#E;#C;#S;#y;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#E,sizes:e.#b,keyMap:e.#c,keyList:e.#u,valList:e.#l,next:e.#p,prev:e.#g,get head(){return e.#A},get tail(){return e.#h},free:e.#v,isBackgroundFetch:a(r=>e.#f(r),"isBackgroundFetch"),backgroundFetch:a((r,n,o,s)=>e.#U(r,n,o,s),"backgroundFetch"),moveToTail:a(r=>e.#O(r),"moveToTail"),indexes:a(r=>e.#I(r),"indexes"),rindexes:a(r=>e.#x(r),"rindexes"),isStale:a(r=>e.#_(r),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:n,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:c,updateAgeOnHas:l,allowStale:u,dispose:d,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:m,maxSize:g=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:E,memoMethod:_,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:w,ignoreFetchAbort:R}=e;if(r!==0&&!CV(r))throw new TypeError("max option must be a nonnegative integer");let x=r?HXi(r):Array;if(!x)throw new Error("invalid max value: "+r);if(this.#e=r,this.#t=g,this.maxEntrySize=A||this.#t,this.sizeCalculation=y,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#o=_,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=E,this.#S=!!E,this.#c=new Map,this.#u=new Array(r).fill(void 0),this.#l=new Array(r).fill(void 0),this.#p=new x(r),this.#g=new x(r),this.#A=0,this.#h=0,this.#v=O8r.create(r),this.#s=0,this.#a=0,typeof d=="function"&&(this.#r=d),typeof f=="function"?(this.#n=f,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#C=!!this.#r,this.#y=!!this.#n,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!w,this.ignoreFetchAbort=!!R,this.maxEntrySize!==0){if(this.#t!==0&&!CV(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!CV(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!l,this.ttlResolution=CV(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!CV(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let P="LRU_CACHE_UNBOUNDED";jVc(P)&&(qXi.add(P),jXi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,t))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){let e=new g_e(this.#e),r=new g_e(this.#e);this.#E=e,this.#T=r,this.#B=(s,c,l=m_e.now())=>{if(r[s]=c!==0?l:0,e[s]=c,c!==0&&this.ttlAutopurge){let u=setTimeout(()=>{this.#_(s)&&this.#w(this.#u[s],"expire")},c+1);u.unref&&u.unref()}},this.#R=s=>{r[s]=e[s]!==0?m_e.now():0},this.#d=(s,c)=>{if(e[c]){let l=e[c],u=r[c];if(!l||!u)return;s.ttl=l,s.start=u,s.now=n||o();let d=s.now-u;s.remainingTTL=l-d}};let n=0,o=a(()=>{let s=m_e.now();if(this.ttlResolution>0){n=s;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref()}return s},"getNow");this.getRemainingTTL=s=>{let c=this.#c.get(s);if(c===void 0)return 0;let l=e[c],u=r[c];if(!l||!u)return 1/0;let d=(n||o())-u;return l-d},this.#_=s=>{let c=r[s],l=e[s];return!!l&&!!c&&(n||o())-c>l}}#R=a(()=>{},"#updateItemAge");#d=a(()=>{},"#statusTTL");#B=a(()=>{},"#setItemTTL");#_=a(()=>!1,"#isStale");#D(){let e=new g_e(this.#e);this.#a=0,this.#b=e,this.#k=r=>{this.#a-=e[r],e[r]=0},this.#L=(r,n,o,s)=>{if(this.#f(n))return 0;if(!CV(o))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(o=s(n,r),!CV(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o},this.#N=(r,n,o)=>{if(e[r]=n,this.#t){let s=this.#t-e[r];for(;this.#a>s;)this.#M(!0)}this.#a+=e[r],o&&(o.entrySize=n,o.totalCalculatedSize=this.#a)}}#k=a(e=>{},"#removeItemSize");#N=a((e,r,n)=>{},"#addItemSize");#L=a((e,r,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#I({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#h;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#A));)r=this.#g[r]}*#x({allowStale:e=this.allowStale}={}){if(this.#s)for(let r=this.#A;!(!this.#F(r)||((e||!this.#_(r))&&(yield r),r===this.#h));)r=this.#p[r]}#F(e){return e!==void 0&&this.#c.get(this.#u[e])===e}*entries(){for(let e of this.#I())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*rentries(){for(let e of this.#x())this.#l[e]!==void 0&&this.#u[e]!==void 0&&!this.#f(this.#l[e])&&(yield[this.#u[e],this.#l[e]])}*keys(){for(let e of this.#I()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*rkeys(){for(let e of this.#x()){let r=this.#u[e];r!==void 0&&!this.#f(this.#l[e])&&(yield r)}}*values(){for(let e of this.#I())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}*rvalues(){for(let e of this.#x())this.#l[e]!==void 0&&!this.#f(this.#l[e])&&(yield this.#l[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;if(s!==void 0&&e(s,this.#u[n],this))return this.get(this.#u[n],r)}}forEach(e,r=this){for(let n of this.#I()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}rforEach(e,r=this){for(let n of this.#x()){let o=this.#l[n],s=this.#f(o)?o.__staleWhileFetching:o;s!==void 0&&e.call(r,s,this.#u[n],this)}}purgeStale(){let e=!1;for(let r of this.#x({allowStale:!0}))this.#_(r)&&(this.#w(this.#u[r],"expire"),e=!0);return e}info(e){let r=this.#c.get(e);if(r===void 0)return;let n=this.#l[r],o=this.#f(n)?n.__staleWhileFetching:n;if(o===void 0)return;let s={value:o};if(this.#E&&this.#T){let c=this.#E[r],l=this.#T[r];if(c&&l){let u=c-(m_e.now()-l);s.ttl=u,s.start=Date.now()}}return this.#b&&(s.size=this.#b[r]),s}dump(){let e=[];for(let r of this.#I({allowStale:!0})){let n=this.#u[r],o=this.#l[r],s=this.#f(o)?o.__staleWhileFetching:o;if(s===void 0||n===void 0)continue;let c={value:s};if(this.#E&&this.#T){c.ttl=this.#E[r];let l=m_e.now()-this.#T[r];c.start=Math.floor(Date.now()-l)}this.#b&&(c.size=this.#b[r]),e.unshift([n,c])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let o=Date.now()-n.start;n.start=m_e.now()-o}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:s,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,f=this.#L(e,r,n.size||0,l);if(this.maxEntrySize&&f>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#w(e,"set"),this;let h=this.#s===0?void 0:this.#c.get(e);if(h===void 0)h=this.#s===0?this.#h:this.#v.length!==0?this.#v.pop():this.#s===this.#e?this.#M(!1):this.#s,this.#u[h]=e,this.#l[h]=r,this.#c.set(e,h),this.#p[this.#h]=h,this.#g[h]=this.#h,this.#h=h,this.#s++,this.#N(h,f,u),u&&(u.set="add"),d=!1;else{this.#O(h);let m=this.#l[h];if(r!==m){if(this.#S&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!c&&(this.#C&&this.#r?.(g,e,"set"),this.#y&&this.#m?.push([g,e,"set"]))}else c||(this.#C&&this.#r?.(m,e,"set"),this.#y&&this.#m?.push([m,e,"set"]));if(this.#k(h),this.#N(h,f,u),this.#l[h]=r,u){u.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(u.oldValue=g)}}else u&&(u.set="update")}if(o!==0&&!this.#E&&this.#P(),this.#E&&(d||this.#B(h,o,s),u&&this.#d(u,h)),!c&&this.#y&&this.#m){let m=this.#m,g;for(;g=m?.shift();)this.#n?.(...g)}return this}pop(){try{for(;this.#s;){let e=this.#l[this.#A];if(this.#M(!0),this.#f(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#y&&this.#m){let e=this.#m,r;for(;r=e?.shift();)this.#n?.(...r)}}}#M(e){let r=this.#A,n=this.#u[r],o=this.#l[r];return this.#S&&this.#f(o)?o.__abortController.abort(new Error("evicted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(o,n,"evict"),this.#y&&this.#m?.push([o,n,"evict"])),this.#k(r),e&&(this.#u[r]=void 0,this.#l[r]=void 0,this.#v.push(r)),this.#s===1?(this.#A=this.#h=0,this.#v.length=0):this.#A=this.#p[r],this.#c.delete(n),this.#s--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=r,s=this.#c.get(e);if(s!==void 0){let c=this.#l[s];if(this.#f(c)&&c.__staleWhileFetching===void 0)return!1;if(this.#_(s))o&&(o.has="stale",this.#d(o,s));else return n&&this.#R(s),o&&(o.has="hit",this.#d(o,s)),!0}else o&&(o.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,o=this.#c.get(e);if(o===void 0||!n&&this.#_(o))return;let s=this.#l[o];return this.#f(s)?s.__staleWhileFetching:s}#U(e,r,n,o){let s=r===void 0?void 0:this.#l[r];if(this.#f(s))return s;let c=new EIt,{signal:l}=n;l?.addEventListener("abort",()=>c.abort(l.reason),{signal:c.signal});let u={signal:c.signal,options:n,context:o},d=a((y,E=!1)=>{let{aborted:_}=c.signal,v=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(_&&!E?(n.status.fetchAborted=!0,n.status.fetchError=c.signal.reason,v&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!v&&!E)return h(c.signal.reason);let b=g;return this.#l[r]===g&&(y===void 0?b.__staleWhileFetching?this.#l[r]=b.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,u.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),h(y)),"eb"),h=a(y=>{let{aborted:E}=c.signal,_=E&&n.allowStaleOnFetchAbort,v=_||n.allowStaleOnFetchRejection,b=v||n.noDeleteOnFetchRejection,T=g;if(this.#l[r]===g&&(!b||T.__staleWhileFetching===void 0?this.#w(e,"fetch"):_||(this.#l[r]=T.__staleWhileFetching)),v)return n.status&&T.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw y},"fetchFail"),m=a((y,E)=>{let _=this.#i?.(e,s,u);_&&_ instanceof Promise&&_.then(v=>y(v===void 0?void 0:v),E),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(v=>d(v,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,f),A=Object.assign(g,{__abortController:c,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,A,{...u.options,status:void 0}),r=this.#c.get(e)):this.#l[r]=A,A}#f(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof EIt}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:u=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:y,forceRefresh:E=!1,status:_,signal:v}=r;if(!this.#S)return _&&(_.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,status:_});let b={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:s,ttl:c,noDisposeOnSet:l,size:u,sizeCalculation:d,noUpdateTTL:f,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:A,ignoreFetchAbort:g,status:_,signal:v},T=this.#c.get(e);if(T===void 0){_&&(_.fetch="miss");let w=this.#U(e,T,b,y);return w.__returned=w}else{let w=this.#l[T];if(this.#f(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#_(T);if(!E&&!R)return _&&(_.fetch="hit"),this.#O(T),o&&this.#R(T),_&&this.#d(_,T),w;let x=this.#U(e,T,b,y),D=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",D&&R&&(_.returnedStale=!0)),D?x.__staleWhileFetching:x.__returned=x}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#o;if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:s,...c}=r,l=this.get(e,c);if(!s&&l!==void 0)return l;let u=n(e,l,{options:c,context:o});return this.set(e,u,c),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:c}=r,l=this.#c.get(e);if(l!==void 0){let u=this.#l[l],d=this.#f(u);return c&&this.#d(c,l),this.#_(l)?(c&&(c.get="stale"),d?(c&&n&&u.__staleWhileFetching!==void 0&&(c.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#w(e,"expire"),c&&n&&(c.returnedStale=!0),n?u:void 0)):(c&&(c.get="hit"),d?u.__staleWhileFetching:(this.#O(l),o&&this.#R(l),u))}else c&&(c.get="miss")}#Q(e,r){this.#g[r]=e,this.#p[e]=r}#O(e){e!==this.#h&&(e===this.#A?this.#A=this.#p[e]:this.#Q(this.#g[e],this.#p[e]),this.#Q(this.#h,e),this.#h=e)}delete(e){return this.#w(e,"delete")}#w(e,r){let n=!1;if(this.#s!==0){let o=this.#c.get(e);if(o!==void 0)if(n=!0,this.#s===1)this.#q(r);else{this.#k(o);let s=this.#l[o];if(this.#f(s)?s.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(s,e,r),this.#y&&this.#m?.push([s,e,r])),this.#c.delete(e),this.#u[o]=void 0,this.#l[o]=void 0,o===this.#h)this.#h=this.#g[o];else if(o===this.#A)this.#A=this.#p[o];else{let c=this.#g[o];this.#p[c]=this.#p[o];let l=this.#p[o];this.#g[l]=this.#g[o]}this.#s--,this.#v.push(o)}}if(this.#y&&this.#m?.length){let o=this.#m,s;for(;s=o?.shift();)this.#n?.(...s)}return n}clear(){return this.#q("delete")}#q(e){for(let r of this.#x({allowStale:!0})){let n=this.#l[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let o=this.#u[r];this.#C&&this.#r?.(n,o,e),this.#y&&this.#m?.push([n,o,e])}}if(this.#c.clear(),this.#l.fill(void 0),this.#u.fill(void 0),this.#E&&this.#T&&(this.#E.fill(0),this.#T.fill(0)),this.#b&&this.#b.fill(0),this.#A=0,this.#h=0,this.#v.length=0,this.#a=0,this.#s=0,this.#y&&this.#m){let r=this.#m,n;for(;n=r?.shift();)this.#n?.(...n)}}};var E_e=require("node:path"),XXi=require("node:url"),lB=require("fs"),ZVc=fe(require("node:fs"),1),TV=require("node:fs/promises");p();var IIt=require("node:events"),j8r=fe(require("node:stream"),1),zXi=require("node:string_decoder");var GXi=typeof process=="object"&&process?process:{stdout:null,stderr:null},HVc=a(t=>!!t&&typeof t=="object"&&(t instanceof SV||t instanceof j8r.default||GVc(t)||$Vc(t)),"isStream"),GVc=a(t=>!!t&&typeof t=="object"&&t instanceof IIt.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==j8r.default.Writable.prototype.pipe,"isReadable"),$Vc=a(t=>!!t&&typeof t=="object"&&t instanceof IIt.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function","isWritable"),c9=Symbol("EOF"),l9=Symbol("maybeEmitEnd"),bV=Symbol("emittedEnd"),_It=Symbol("emittingEnd"),aFe=Symbol("emittedError"),vIt=Symbol("closed"),$Xi=Symbol("read"),CIt=Symbol("flush"),VXi=Symbol("flushChunk"),pN=Symbol("encoding"),A_e=Symbol("decoder"),jg=Symbol("flowing"),cFe=Symbol("paused"),y_e=Symbol("resume"),Hg=Symbol("buffer"),Fv=Symbol("pipes"),Gg=Symbol("bufferLength"),B8r=Symbol("bufferPush"),bIt=Symbol("bufferShift"),GE=Symbol("objectMode"),mh=Symbol("destroyed"),L8r=Symbol("error"),F8r=Symbol("emitData"),WXi=Symbol("emitEnd"),U8r=Symbol("emitEnd2"),aB=Symbol("async"),Q8r=Symbol("abort"),SIt=Symbol("aborted"),lFe=Symbol("signal"),Zne=Symbol("dataListeners"),pI=Symbol("discarded"),uFe=a(t=>Promise.resolve().then(t),"defer"),VVc=a(t=>t(),"nodefer"),WVc=a(t=>t==="end"||t==="finish"||t==="prefinish","isEndish"),zVc=a(t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,"isArrayBufferLike"),YVc=a(t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),"isArrayBufferView"),TIt=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[y_e](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},q8r=class extends TIt{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=o=>r.emit("error",o),e.on("error",this.proxyErrors)}},KVc=a(t=>!!t.objectMode,"isObjectModeOptions"),JVc=a(t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer","isEncodingOptions"),SV=class extends IIt.EventEmitter{static{a(this,"Minipass")}[jg]=!1;[cFe]=!1;[Fv]=[];[Hg]=[];[GE];[pN];[aB];[A_e];[c9]=!1;[bV]=!1;[_It]=!1;[vIt]=!1;[aFe]=null;[Gg]=0;[mh]=!1;[lFe];[SIt]=!1;[Zne]=0;[pI]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");KVc(r)?(this[GE]=!0,this[pN]=null):JVc(r)?(this[pN]=r.encoding,this[GE]=!1):(this[GE]=!1,this[pN]=null),this[aB]=!!r.async,this[A_e]=this[pN]?new zXi.StringDecoder(this[pN]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Hg],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[Fv],"get")});let{signal:n}=r;n&&(this[lFe]=n,n.aborted?this[Q8r]():n.addEventListener("abort",()=>this[Q8r]()))}get bufferLength(){return this[Gg]}get encoding(){return this[pN]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[GE]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[aB]}set async(e){this[aB]=this[aB]||!!e}[Q8r](){this[SIt]=!0,this.emit("abort",this[lFe]?.reason),this.destroy(this[lFe]?.reason)}get aborted(){return this[SIt]}set aborted(e){}write(e,r,n){if(this[SIt])return!1;if(this[c9])throw new Error("write after end");if(this[mh])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let o=this[aB]?uFe:VVc;if(!this[GE]&&!Buffer.isBuffer(e)){if(YVc(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(zVc(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[GE]?(this[jg]&&this[Gg]!==0&&this[CIt](!0),this[jg]?this.emit("data",e):this[B8r](e),this[Gg]!==0&&this.emit("readable"),n&&o(n),this[jg]):e.length?(typeof e=="string"&&!(r===this[pN]&&!this[A_e]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[pN]&&(e=this[A_e].write(e)),this[jg]&&this[Gg]!==0&&this[CIt](!0),this[jg]?this.emit("data",e):this[B8r](e),this[Gg]!==0&&this.emit("readable"),n&&o(n),this[jg]):(this[Gg]!==0&&this.emit("readable"),n&&o(n),this[jg])}read(e){if(this[mh])return null;if(this[pI]=!1,this[Gg]===0||e===0||e&&e>this[Gg])return this[l9](),null;this[GE]&&(e=null),this[Hg].length>1&&!this[GE]&&(this[Hg]=[this[pN]?this[Hg].join(""):Buffer.concat(this[Hg],this[Gg])]);let r=this[$Xi](e||null,this[Hg][0]);return this[l9](),r}[$Xi](e,r){if(this[GE])this[bIt]();else{let n=r;e===n.length||e===null?this[bIt]():typeof n=="string"?(this[Hg][0]=n.slice(e),r=n.slice(0,e),this[Gg]-=e):(this[Hg][0]=n.subarray(e),r=n.subarray(0,e),this[Gg]-=e)}return this.emit("data",r),!this[Hg].length&&!this[c9]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[c9]=!0,this.writable=!1,(this[jg]||!this[cFe])&&this[l9](),this}[y_e](){this[mh]||(!this[Zne]&&!this[Fv].length&&(this[pI]=!0),this[cFe]=!1,this[jg]=!0,this.emit("resume"),this[Hg].length?this[CIt]():this[c9]?this[l9]():this.emit("drain"))}resume(){return this[y_e]()}pause(){this[jg]=!1,this[cFe]=!0,this[pI]=!1}get destroyed(){return this[mh]}get flowing(){return this[jg]}get paused(){return this[cFe]}[B8r](e){this[GE]?this[Gg]+=1:this[Gg]+=e.length,this[Hg].push(e)}[bIt](){return this[GE]?this[Gg]-=1:this[Gg]-=this[Hg][0].length,this[Hg].shift()}[CIt](e=!1){do;while(this[VXi](this[bIt]())&&this[Hg].length);!e&&!this[Hg].length&&!this[c9]&&this.emit("drain")}[VXi](e){return this.emit("data",e),this[jg]}pipe(e,r){if(this[mh])return e;this[pI]=!1;let n=this[bV];return r=r||{},e===GXi.stdout||e===GXi.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Fv].push(r.proxyErrors?new q8r(this,e,r):new TIt(this,e,r)),this[aB]?uFe(()=>this[y_e]()):this[y_e]()),e}unpipe(e){let r=this[Fv].find(n=>n.dest===e);r&&(this[Fv].length===1?(this[jg]&&this[Zne]===0&&(this[jg]=!1),this[Fv]=[]):this[Fv].splice(this[Fv].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[pI]=!1,this[Zne]++,!this[Fv].length&&!this[jg]&&this[y_e]();else if(e==="readable"&&this[Gg]!==0)super.emit("readable");else if(WVc(e)&&this[bV])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[aFe]){let o=r;this[aB]?uFe(()=>o.call(this,this[aFe])):o.call(this,this[aFe])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Zne]=this.listeners("data").length,this[Zne]===0&&!this[pI]&&!this[Fv].length&&(this[jg]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Zne]=0,!this[pI]&&!this[Fv].length&&(this[jg]=!1)),r}get emittedEnd(){return this[bV]}[l9](){!this[_It]&&!this[bV]&&!this[mh]&&this[Hg].length===0&&this[c9]&&(this[_It]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[vIt]&&this.emit("close"),this[_It]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==mh&&this[mh])return!1;if(e==="data")return!this[GE]&&!n?!1:this[aB]?(uFe(()=>this[F8r](n)),!0):this[F8r](n);if(e==="end")return this[WXi]();if(e==="close"){if(this[vIt]=!0,!this[bV]&&!this[mh])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[aFe]=n,super.emit(L8r,n);let s=!this[lFe]||this.listeners("error").length?super.emit("error",n):!1;return this[l9](),s}else if(e==="resume"){let s=super.emit("resume");return this[l9](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let o=super.emit(e,...r);return this[l9](),o}[F8r](e){for(let n of this[Fv])n.dest.write(e)===!1&&this.pause();let r=this[pI]?!1:super.emit("data",e);return this[l9](),r}[WXi](){return this[bV]?!1:(this[bV]=!0,this.readable=!1,this[aB]?(uFe(()=>this[U8r]()),!0):this[U8r]())}[U8r](){if(this[A_e]){let r=this[A_e].end();if(r){for(let n of this[Fv])n.dest.write(r);this[pI]||super.emit("data",r)}}for(let r of this[Fv])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[GE]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[GE]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[GE])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[pN]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(mh,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[pI]=!1;let e=!1,r=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return r();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[c9])return r();let s,c,l=a(h=>{this.off("data",u),this.off("end",d),this.off(mh,f),r(),c(h)},"onerr"),u=a(h=>{this.off("error",l),this.off("end",d),this.off(mh,f),this.pause(),s({value:h,done:!!this[c9]})},"ondata"),d=a(()=>{this.off("error",l),this.off("data",u),this.off(mh,f),r(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((h,m)=>{c=m,s=h,this.once(mh,f),this.once("error",l),this.once("end",d),this.once("data",u)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[pI]=!1;let e=!1,r=a(()=>(this.pause(),this.off(L8r,r),this.off(mh,r),this.off("end",r),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return r();let o=this.read();return o===null?r():{done:!1,value:o}},"next");return this.once("end",r),this.once(L8r,r),this.once(mh,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[mh])return e?this.emit("error",e):this.emit(mh),this;this[mh]=!0,this[pI]=!0,this[Hg].length=0,this[Gg]=0;let r=this;return typeof r.close=="function"&&!this[vIt]&&r.close(),e?this.emit("error",e):this.emit(mh),this}static get isStream(){return HVc}};var XVc=lB.realpathSync.native,fFe={lstatSync:lB.lstatSync,readdir:lB.readdir,readdirSync:lB.readdirSync,readlinkSync:lB.readlinkSync,realpathSync:XVc,promises:{lstat:TV.lstat,readdir:TV.readdir,readlink:TV.readlink,realpath:TV.realpath}},eeo=a(t=>!t||t===fFe||t===ZVc?fFe:{...fFe,...t,promises:{...fFe.promises,...t.promises||{}}},"fsFromOption"),teo=/^\\\\\?\\([a-z]:)\\?$/i,eWc=a(t=>t.replace(/\//g,"\\").replace(teo,"$1\\"),"uncToDrive"),tWc=/[\\\/]/,JR=0,reo=1,neo=2,cB=4,ieo=6,oeo=8,Xne=10,seo=12,KR=15,dFe=~KR,H8r=16,YXi=32,pFe=64,hN=128,xIt=256,RIt=512,KXi=pFe|hN|RIt,rWc=1023,G8r=a(t=>t.isFile()?oeo:t.isDirectory()?cB:t.isSymbolicLink()?Xne:t.isCharacterDevice()?neo:t.isBlockDevice()?ieo:t.isSocket()?seo:t.isFIFO()?reo:JR,"entToType"),JXi=new Map,hFe=a(t=>{let e=JXi.get(t);if(e)return e;let r=t.normalize("NFKD");return JXi.set(t,r),r},"normalize"),ZXi=new Map,wIt=a(t=>{let e=ZXi.get(t);if(e)return e;let r=hFe(t.toLowerCase());return ZXi.set(t,r),r},"normalizeNocase"),PIt=class extends sFe{static{a(this,"ResolveCache")}constructor(){super({max:256})}},$8r=class extends sFe{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(r=>r.length+1,"sizeCalculation")})}},aeo=Symbol("PathScurry setAsCwd"),$E=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#o;get gid(){return this.#o}#s;get rdev(){return this.#s}#a;get blksize(){return this.#a}#c;get ino(){return this.#c}#u;get size(){return this.#u}#l;get blocks(){return this.#l}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#A;get ctimeMs(){return this.#A}#h;get birthtimeMs(){return this.#h}#v;get atime(){return this.#v}#m;get mtime(){return this.#m}#b;get ctime(){return this.#b}#T;get birthtime(){return this.#T}#E;#C;#S;#y;#P;#R;#d;#B;#_;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=JR,n,o,s,c,l){this.name=e,this.#E=s?wIt(e):hFe(e),this.#d=r&rWc,this.nocase=s,this.roots=o,this.root=n||this,this.#B=c,this.#S=l.fullpath,this.#P=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=eeo(l.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#B}resolve(e){if(!e)return this;let r=this.getRootString(e),o=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#k(o):this.#k(o)}#k(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#B.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#B.set(this,r),this.#d&=~H8r,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),o=this.nocase?wIt(e):hFe(e);for(let u of n)if(u.#E===o)return u;let s=this.parent?this.sep:"",c=this.#S?this.#S+s+e:void 0,l=this.newChild(e,JR,{...r,parent:this,fullpath:c});return this.canReaddir()||(l.#d|=hN),n.push(l),l}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,r=this.parent;if(!r)return this.#R=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let o=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=o}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let o=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(o)?this.#y=`//?/${o}`:this.#y=o}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#y=n}isUnknown(){return(this.#d&KR)===JR}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#d&KR)===oeo}isDirectory(){return(this.#d&KR)===cB}isCharacterDevice(){return(this.#d&KR)===neo}isBlockDevice(){return(this.#d&KR)===ieo}isFIFO(){return(this.#d&KR)===reo}isSocket(){return(this.#d&KR)===seo}isSymbolicLink(){return(this.#d&Xne)===Xne}lstatCached(){return this.#d&YXi?this:void 0}readlinkCached(){return this.#_}realpathCached(){return this.#D}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#_)return!0;if(!this.parent)return!1;let e=this.#d&KR;return!(e!==JR&&e!==Xne||this.#d&xIt||this.#d&hN)}calledReaddir(){return!!(this.#d&H8r)}isENOENT(){return!!(this.#d&hN)}isNamed(e){return this.nocase?this.#E===wIt(e):this.#E===hFe(e)}async readlink(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}readlinkSync(){let e=this.#_;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#_=n}catch(r){this.#f(r.code);return}}#N(e){this.#d|=H8r;for(let r=e.provisional;rn(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#H.push(e),this.#G)return;this.#G=!0;let o=this.fullpath();this.#e.readdir(o,{withFileTypes:!0},(s,c)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let l of c)this.#Q(l,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#j;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#j)await this.#j;else{let n=a(()=>{},"resolve");this.#j=new Promise(o=>n=o);try{for(let o of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#Q(o,e);this.#N(e)}catch(o){this.#M(o.code),e.provisional=0}this.#j=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#Q(n,e);this.#N(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#d&KXi)return!1;let e=KR&this.#d;return e===JR||e===cB||e===Xne}shouldWalk(e,r){return(this.#d&cB)===cB&&!(this.#d&KXi)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#D)return this.#D;if(!((RIt|xIt|hN)&this.#d))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}realpathSync(){if(this.#D)return this.#D;if(!((RIt|xIt|hN)&this.#d))try{let e=this.#e.realpathSync(this.fullpath());return this.#D=this.resolve(e)}catch{this.#x()}}[aeo](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],o=this;for(;o&&o.parent;)r.add(o),o.#P=n.join(this.sep),o.#R=n.join("/"),o=o.parent,n.push("..");for(o=e;o&&o.parent&&!r.has(o);)o.#P=void 0,o.#R=void 0,o=o.parent}},kIt=class t extends $E{static{a(this,"PathWin32")}sep="\\";splitSep=tWc;constructor(e,r=JR,n,o,s,c,l){super(e,r,n,o,s,c,l)}newChild(e,r=JR,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return E_e.win32.parse(e).root}getRoot(e){if(e=eWc(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new __e(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(teo,"$1\\"),e===r}},DIt=class t extends $E{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,r=JR,n,o,s,c,l){super(e,r,n,o,s,c,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=JR,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},NIt=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:o,childrenCacheSize:s=16*1024,fs:c=fFe}={}){this.#n=eeo(c),(e instanceof URL||e.startsWith("file://"))&&(e=(0,XXi.fileURLToPath)(e));let l=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new PIt,this.#t=new PIt,this.#r=new $8r(s);let u=l.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),o===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=o,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let d=this.root,f=u.length-1,h=r.sep,m=this.rootPath,g=!1;for(let A of u){let y=f--;d=d.child(A,{relative:new Array(y).fill("..").join(h),relativePosix:new Array(y).fill("..").join("/"),fullpath:m+=(g?"":h)+A}),g=!0}this.cwd=d}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#e.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpath();return this.#e.set(r,o),o}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let c=e[s];if(!(!c||c===".")&&(r=r?`${c}/${r}`:c,this.isAbsolute(c)))break}let n=this.#t.get(r);if(n!==void 0)return n;let o=this.cwd.resolve(r).fullpathPosix();return this.#t.set(r,o),o}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let o=await e.readdir();return n?o:o.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(o=>o.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set,d=a((h,m)=>{u.add(h),h.readdirCB((g,A)=>{if(g)return m(g);let y=A.length;if(!y)return m();let E=a(()=>{--y===0&&m()},"next");for(let _ of A)(!s||s(_))&&l.push(n?_:_.fullpath()),o&&_.isSymbolicLink()?_.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(u,c)?d(v,E):E()):_.shouldWalk(u,c)?d(_,E):E()},!0)},"walk"),f=e;return new Promise((h,m)=>{d(f,g=>{if(g)return m(g);h(l)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=[];(!s||s(e))&&l.push(n?e:e.fullpath());let u=new Set([e]);for(let d of u){let f=d.readdirSync();for(let h of f){(!s||s(h))&&l.push(n?h:h.fullpath());let m=h;if(h.isSymbolicLink()){if(!(o&&(m=h.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(u,c)&&u.add(m)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r;(!s||s(e))&&(yield n?e:e.fullpath());let l=new Set([e]);for(let u of l){let d=u.readdirSync();for(let f of d){(!s||s(f))&&(yield n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(o&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,c)&&l.add(h)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new SV({objectMode:!0});(!s||s(e))&&l.write(n?e:e.fullpath());let u=new Set,d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=a((E,_,v=!1)=>{if(E)return l.emit("error",E);if(o&&!v){let b=[];for(let T of _)T.isSymbolicLink()&&b.push(T.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(b.length){Promise.all(b).then(()=>A(null,_,!0));return}}for(let b of _)b&&(!s||s(b))&&(l.write(n?b:b.fullpath())||(m=!0));f--;for(let b of _){let T=b.realpathCached()||b;T.shouldWalk(u,c)&&d.push(T)}m&&!l.flowing?l.once("drain",h):y||h()},"onReaddir"),y=!0;g.readdirCB(A,!0),y=!1}},"process");return h(),l}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof $E||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:o=!1,filter:s,walkFilter:c}=r,l=new SV({objectMode:!0}),u=new Set;(!s||s(e))&&l.write(n?e:e.fullpath());let d=[e],f=0,h=a(()=>{let m=!1;for(;!m;){let g=d.shift();if(!g){f===0&&l.end();return}f++,u.add(g);let A=g.readdirSync();for(let y of A)(!s||s(y))&&(l.write(n?y:y.fullpath())||(m=!0));f--;for(let y of A){let E=y;if(y.isSymbolicLink()){if(!(o&&(E=y.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(u,c)&&d.push(E)}}m&&!l.flowing&&l.once("drain",h)},"process");return h(),l}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[aeo](r)}},__e=class extends NIt{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,E_e.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return E_e.win32.parse(e).root.toUpperCase()}newRoot(e){return new kIt(this.rootPath,cB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},v_e=class extends NIt{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,E_e.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new DIt(this.rootPath,cB,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},mFe=class extends v_e{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},RLh=process.platform==="win32"?kIt:DIt,ceo=process.platform==="win32"?__e:process.platform==="darwin"?mFe:v_e;p();var nWc=a(t=>t.length>=1,"isPatternList"),iWc=a(t=>t.length>=1,"isGlobList"),C_e=class t{static{a(this,"Pattern")}#e;#t;#r;length;#n;#i;#o;#s;#a;#c;#u=!0;constructor(e,r,n,o){if(!nWc(e))throw new TypeError("empty pattern list");if(!iWc(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=r,this.#r=n,this.#n=o,this.#r===0){if(this.isUNC()){let[s,c,l,u,...d]=this.#e,[f,h,m,g,...A]=this.#t;d[0]===""&&(d.shift(),A.shift());let y=[s,c,l,u,""].join("/"),E=[f,h,m,g,""].join("/");this.#e=[y,...d],this.#t=[E,...A],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...c]=this.#e,[l,...u]=this.#t;c[0]===""&&(c.shift(),u.shift());let d=s+"/",f=l+"/";this.#e=[d,...c],this.#t=[f,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===jp}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#o=this.#o||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new t(this.#e,this.#t,this.#r+1,this.#n),this.#i.#c=this.#c,this.#i.#a=this.#a,this.#i.#s=this.#s,this.#i):this.#i=null}isUNC(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#u)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#u?!1:(this.#u=!1,!0)}};p();p();var oWc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",b_e=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:o,noglobstar:s,platform:c=oWc}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=c,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:o,noglobstar:s,optimizationLevel:2,platform:c,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let r=new b_(e,this.mmopts);for(let n=0;n[e,!!(r&2),!!(r&1)])}},z8r=class{static{a(this,"SubWalks")}store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(o=>o.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},gFe=class t{static{a(this,"Processor")}hasWalkedCache;matches=new W8r;subwalks=new z8r;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new V8r}processPatterns(e,r){this.patterns=r;let n=r.map(o=>[e,o]);for(let[o,s]of n){this.hasWalkedCache.storeWalked(o,s);let c=s.root(),l=s.isAbsolute()&&this.opts.absolute!==!1;if(c){o=o.resolve(c==="/"&&this.opts.root!==void 0?this.opts.root:c);let h=s.rest();if(h)s=h;else{this.matches.add(o,!0,!1);continue}}if(o.isENOENT())continue;let u,d,f=!1;for(;typeof(u=s.pattern())=="string"&&(d=s.rest());)o=o.resolve(u),s=d,f=!0;if(u=s.pattern(),d=s.rest(),f){if(this.hasWalkedCache.hasWalked(o,s))continue;this.hasWalkedCache.storeWalked(o,s)}if(typeof u=="string"){let h=u===".."||u===""||u===".";this.matches.add(o.resolve(u),l,h);continue}else if(u===jp){(!o.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(o,s);let h=d?.pattern(),m=d?.rest();if(!d||(h===""||h===".")&&!m)this.matches.add(o,l,h===""||h===".");else if(h===".."){let g=o.parent||o;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,l,!0)}}else u instanceof RegExp&&this.subwalks.add(o,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),o=this.child();for(let s of r)for(let c of n){let l=c.isAbsolute(),u=c.pattern(),d=c.rest();u===jp?o.testGlobstar(s,c,d,l):u instanceof RegExp?o.testRegExp(s,u,d,l):o.testString(s,u,d,l)}return o}testGlobstar(e,r,n,o){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,o,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),o);else if(s===".."){let c=e.parent||e;this.subwalks.add(c,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),o)}}testRegExp(e,r,n,o){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}testString(e,r,n,o){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,o,!1))}};var sWc=a((t,e)=>typeof t=="string"?new b_e([t],e):Array.isArray(t)?new b_e(t,e):t,"makeIgnore"),MIt=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#t=sWc(n.ignore??[],n),!this.includeChildMatches&&typeof this.#t.add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#i(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=await s.realpath();c&&(c.isUnknown()||this.opts.stat)&&await c.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let c=s.realpathSync();c&&(c?.isUnknown()||this.opts.stat)&&c.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#t?.add){let s=`${e.relativePosix()}/**`;this.#t.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let o=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+o)}else{let s=this.opts.posix?e.relativePosix():e.relative(),c=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?c+s+o:"."+o)}}async match(e,r,n){let o=await this.matchCheck(e,n);o&&this.matchFinish(o,r)}matchSync(e,r,n){let o=this.matchCheckSync(e,n);o&&this.matchFinish(o,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new gFe(this.opts),n)}walkCB2(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,n,c):l.readdirCB((d,f)=>this.walkCB3(l,f,n,c),!0)}c()}walkCB3(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||(s++,this.match(l,u,d).then(()=>c()));for(let[l,u]of n.subwalks.entries())s++,this.walkCB2(l,u,n.child(),c);c()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new gFe(this.opts),n)}walkCB2Sync(e,r,n,o){if(this.#i(e))return o();if(this.signal?.aborted&&o(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,o));return}n.processPatterns(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let l of n.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,n,c)}c()}walkCB3Sync(e,r,n,o){n=n.filterEntries(e,r);let s=1,c=a(()=>{--s===0&&o()},"next");for(let[l,u,d]of n.matches.entries())this.#n(l)||this.matchSync(l,u,d);for(let[l,u]of n.subwalks.entries())s++,this.walkCB2Sync(l,u,n.child(),c);c()}},AFe=class extends MIt{static{a(this,"GlobWalker")}matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},yFe=class extends MIt{static{a(this,"GlobStream")}results;constructor(e,r,n){super(e,r,n),this.results=new SV({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var aWc=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",mN=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,leo.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||aWc,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?__e:r.platform==="darwin"?mFe:r.platform?v_e:ceo;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",o={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new b_(u,o)),[c,l]=s.reduce((u,d)=>(u[0].push(...d.set),u[1].push(...d.globParts),u),[[],[]]);this.patterns=c.map((u,d)=>{let f=l[d];if(!f)throw new Error("invalid pattern object");return new C_e(u,f,0,this.platform)})}async walk(){return[...await new AFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new AFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new yFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new yFe(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};p();var Y8r=a((t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new b_(r,e).hasMagic())return!0;return!1},"hasMagic");function BIt(t,e={}){return new mN(t,e).streamSync()}a(BIt,"globStreamSync");function deo(t,e={}){return new mN(t,e).stream()}a(deo,"globStream");function feo(t,e={}){return new mN(t,e).walkSync()}a(feo,"globSync");async function ueo(t,e={}){return new mN(t,e).walk()}a(ueo,"glob_");function LIt(t,e={}){return new mN(t,e).iterateSync()}a(LIt,"globIterateSync");function peo(t,e={}){return new mN(t,e).iterate()}a(peo,"globIterate");var cWc=BIt,lWc=Object.assign(deo,{sync:BIt}),uWc=LIt,dWc=Object.assign(peo,{sync:LIt}),fWc=Object.assign(feo,{stream:BIt,iterate:LIt}),OIt=Object.assign(ueo,{glob:ueo,globSync:feo,sync:fWc,globStream:deo,stream:lWc,globStreamSync:BIt,streamSync:cWc,globIterate:peo,iterate:dWc,globIterateSync:LIt,iterateSync:uWc,Glob:mN,hasMagic:Y8r,escape:zce,unescape:mk});OIt.glob=OIt;var EFe=class t{constructor(){this.logger=new Ae("PromptFileLocator")}static{a(this,"PromptFileLocator")}static{this.STAT_CONCURRENCY=32}async listFiles(e,r,n){let o=e.get(S_),s=r.map(d=>kn(d.uri)),l=o.resolvePatterns(n,s).map(async d=>{let f=d.metadata?[d.metadata]:void 0,h=a((m,g)=>({uri:m,watchable:d.watchable,cacheable:d.cacheable,metadata:f,classification:d.classification,timestamp:g}),"build");if(d.isGlob)return(await this.globFiles(d.pattern,e)).map(g=>h(ba(g.path),g.timestamp));{let m=await this.getExactFile(e,d.pattern);return m?[h(m.uri,m.timestamp)]:[]}}),u=await Promise.all(l);return this.deduplicateFiles(u.flat())}async globFiles(e,r){let n;try{n=await OIt(e,{dot:!0,nodir:!0,absolute:!0})}catch{return[]}return this.statGlobMatches(r,n)}async statGlobMatches(e,r){let n=[];for(let o=0;o{try{let u=await heo.promises.stat(l);return u.isFile()?{path:l,timestamp:u.mtimeMs}:void 0}catch(u){this.logger.warn(e,`Skipping prompt file ${l} because it could not be stat'd:`,u);return}}));n.push(...c.filter(l=>l!==void 0))}return n}async getExactFile(e,r){let n=ba(r);try{let o=await e.get(jo).stat(n);return(o.type&1)!==0?{uri:n,timestamp:o.mtime}:void 0}catch{return}}deduplicateFiles(e){let r=new Map;for(let n of e){let o=r.get(n.uri);if(!o){r.set(n.uri,n);continue}let s=o.watchable||n.watchable,c=o.cacheable||n.cacheable,l=n.metadata?.length?[...o.metadata??[],...n.metadata]:o.metadata,u=Math.max(o.timestamp,n.timestamp);(s!==o.watchable||c!==o.cacheable||l!==o.metadata||u!==o.timestamp)&&r.set(n.uri,{...o,watchable:s,cacheable:c,metadata:l,timestamp:u})}return Array.from(r.values())}};p();var L3h=new Ae("exp");function geo(t){let e=t.get(Jt);e.registerStaticFilters(mWc(t)),e.registerDynamicFilter("X-Copilot-OverrideEngine",()=>Ht(t,Je.DebugOverrideEngine)||Ht(t,Je.DebugOverrideEngineLegacy)),e.registerDynamicFilter("X-VSCode-ExtensionName",()=>h9e()?"copilot-web":t.get(Nr).getEditorPluginInfo().name),e.registerDynamicFilter("X-VSCode-ExtensionVersion",()=>meo(t)),e.registerDynamicFilter(die.CopilotRelatedPluginVersionGithubCopilot,()=>meo(t)),e.registerDynamicFilter("X-VSCode-ExtensionRelease",()=>pWc(t)),e.registerDynamicFilter("X-VSCode-Build",()=>t.get(Nr).getEditorInfo().name),e.registerDynamicFilter("X-VSCode-AppVersion",()=>FIt(t.get(Nr).getEditorInfo().version)),e.registerDynamicFilter("X-VSCode-TargetPopulation",()=>hWc(t)),e.registerDynamicFilter("X-VSCode-DevDeviceId",()=>t.get(AI).getIdSync()),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Nr).getRelatedPluginInfo()){let o=XE+n.name.replace(/[^A-Za-z]/g,"").toLowerCase();if(!Object.values(die).includes(o)){o8e(t,{reason:`A filter could not be registered for the unrecognized related plugin "${n.name}".`});continue}r[o]=FIt(n.version)}return r}),e.registerDynamicFilterGroup(()=>{let r={};for(let n of t.get(Nr).getEditorPluginSpecificFilters()){let o=n.isVersion?FIt(n.value):n.value;r[n.filter]=o}return r})}a(geo,"setupExperimentationService");function meo(t){return FIt(!t.get(os).isProduction()&&t.get(Nr).getEditorPluginInfo().name==="copilot"?"1.999.0":t.get(Nr).getEditorPluginInfo().version)}a(meo,"getEditorPluginVersion");function pWc(t){let e=t.get(Nr).getEditorPluginInfo();return e.name==="copilot-intellij"&&e.version.endsWith("nightly")?"nightly":"stable"}a(pWc,"getPluginRelease");function hWc(t){let e=t.get(Nr).getEditorInfo();return e.name==="vscode"&&e.version.endsWith("-insider")?"insider":"public"}a(hWc,"getTargetPopulation");function mWc(t){return gWc(t)}a(mWc,"createAllFilters");function gWc(t){let e=t.get(Oa);return{"X-MSEdge-ClientId":e.machineId,"X-Copilot-ClientVersion":t.get(os).isProduction()?I1(t):"1.999.0"}}a(gWc,"createDefaultFilters");function FIt(t){return t.split("-")[0]}a(FIt,"trimVersionSuffix");p();var IV=class{static{a(this,"AbstractCopilotMcpSamplingConfigSender")}};p();var S_e=class{static{a(this,"AbstractCopilotMessageSender")}};p();var Aeo=100,yeo=1e3*60*5;function Eeo(t){let e=new K8r(t);t.get(o0).registerContextProvider(e),t.get(y5).add(e.id)}a(Eeo,"registerRelatedFilesShim");var K8r=class{constructor(e){this.ctx=e;this.id="relatedFilesShim";this.selector=["*"];this.traitCache=new nP(Aeo,yeo);this.relatedFilesCache=new nP(Aeo,yeo);this.resolver={resolve:a(async(r,n)=>{let o=r.documentContext.uri,s=r.documentContext.languageId;return await this.getTraits(o,s,n)},"resolve")}}static{a(this,"RelatedFilesShim")}async getTraits(e,r,n){return this.traitCache.has(e)||await this.requestRelatedFilesAndTraits(e,r,r,n),this.traitCache.get(e)??[]}async requestRelatedFilesAndTraits(e,r,n,o){try{let s=await this.ctx.get(Jt).fetchTokenAndUpdateExPValuesAndAssignments({uri:e,languageId:n}),c={uri:e,clientLanguageId:r,detectedLanguageId:n},l=await flt(this.ctx,c,s,o,!0);if(o?.isCancellationRequested)return;let u=l.traits.filter(f=>f.includeInPrompt).map(f=>f.promptTextOverride?{name:"OtherInformation",value:f.promptTextOverride}:f),d=new Set;for(let f of l.entries.values())for(let h of f.keys())d.add(h);this.traitCache.set(e,u),this.relatedFilesCache.set(e,Array.from(d))}catch(s){$z(this.ctx,s,"relatedFilesShim")}}};var fto=fe(nX()),pto=fe(require("path"));p();var _Fe=fe(ei());var AWc=new _Fe.ProtocolRequestType("workspace/readFile"),yWc=new _Fe.ProtocolRequestType("workspace/readDirectory"),EWc=new _Fe.ProtocolRequestType("workspace/findFiles"),_Wc=new _Fe.ProtocolRequestType("workspace/findTextInFiles"),UIt=class extends na{constructor(r){super();this.ctx=r}static{a(this,"AgentContentProvider")}async readFile(r){return this.sendRequestWithTelemetry(AWc,r,"readFile")}async readDirectory(r){return this.sendRequestWithTelemetry(yWc,r,"readDirectory",n=>({entryCount:n.entries.length}))}async findFiles(r){return this.sendRequestWithTelemetry(EWc,r,"findFiles",n=>({fileCount:n.uris.length}))}async findTextInFiles(r){return this.sendRequestWithTelemetry(_Wc,r,"findTextInFiles",n=>({matchCount:n.matches.length}))}get connection(){return this.ctx.get(dr).connection}async sendRequestWithTelemetry(r,n,o,s){let c=performance.now();try{let l=await this.connection.sendRequest(r,n),u=Math.round(performance.now()-c);return _t(this.ctx,`contentProvider.${o}`,{},{durationMs:u,...s?.(l)}),l}catch(l){let u=Math.round(performance.now()-c);throw si(this.ctx,`contentProvider.${o}.failure`,l,{},{durationMs:u}),l}}};p();var QIt=class extends XM{constructor(r){super();this.ctx=r}static{a(this,"AgentLSPRequestSender")}async sendRequest(r,n){let o=this.ctx.get(dr);try{return await o.connection.sendRequest(r,n)}catch(s){throw si(this.ctx,"lsp.requestToClient.failure",s,{method:r.method.replaceAll("/",".")}),s}}};p();var qIt=class t extends sX{constructor(r){super(r);this.reportedUnknownProviders=new Set}static{a(this,"AgentRelatedFilesProvider")}get service(){return this.context.get(dr)}static mapProviderNameToNeighboringFileType(r){let n="CSharpCopilotCompletionContextProvider",o="CSharpRoslynCompletionRelatedContextProvider",s="CppCopilotCompletionContextProvider",c="CppCopilotCompletionSemanticCodeContextProvider";switch(r){case n:return"related/csharp";case o:return"related/csharproslyn";case s:return"related/cpp";case c:return"related/cppsemanticcodecontext";default:return"related/other"}}convert(r){let n={entries:[],traits:r.traits};for(let o of r.entries){let s={type:t.mapProviderNameToNeighboringFileType(o.providerName),uris:o.uris};n.entries.push(s),s.type==="related/other"&&!this.reportedUnknownProviders.has(o.providerName)&&(this.reportedUnknownProviders.add(o.providerName),cm.warn(this.context,`unknown providerName ${o.providerName}`))}return n}async getRelatedFilesResponse(r,n,o){cm.debug(this.context,`Fetching related files for ${r.uri}`);let s=this.context.get(On).getCapabilities().related??!1;if(t.relatedCapabilityTelemetry(this.context,n,s),!s)return cm.debug(this.context,"`copilot/related` not supported"),nZn;try{let c=await this.service.connection.sendRequest(zQt.type,{textDocument:{uri:r.uri},data:r.data,telemetry:{properties:n.properties,measurements:n.measurements}},o);return this.convert(c)}catch(c){cm.exception(this.context,c,".copilotRelated");return}}static{this.telemetrySent=!1}static relatedCapabilityTelemetry(r,n,o){try{if(!o||t.telemetrySent)return;t.telemetrySent=!0,yt(r,"copilotRelated.hasRelatedCapability",n)}catch(s){cm.exception(r,s,"copilotRelated")}}};p();p();var Ieo=fe(ei());p();p();function _eo(t,e){return(e<<5)-e+t|0}a(_eo,"numberHash");function veo(t,e){e=_eo(149417,e);for(let r=0,n=t.length;r{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=UTn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(Mn).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,L_e.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){L_e.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,Feo.setTimeout)(wYc).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new Beo.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` - ${RYc}; - ${kYc}; - ${PYc}; - ${DYc}; - ${NYc}; - `);let n=this.all(r,OYc,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):L_e.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){L_e.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(Si).directory;await Oeo.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Leo.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Lr).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||xYc}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=IYc;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{L_e.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){L_e.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,MYc,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var jC=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},rxt=class extends jC{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&fat(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get(Gg).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get(Gg).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get(Gg).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get(Gg).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get(Gg).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get(Gg).delete(n)}};var YE=new ge("DynamicAuthenticationProvider"),nxt=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new E6r(e,l,{set:a(u=>{this.ctx.get(jC).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(YE.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>Exe([...c.scopes].sort(),n));if(YE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(YE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){YE.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(YE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),YE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){YE.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>Exe([...d.scopes].sort(),n))),YE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new sEe(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(YE.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return YE.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){YE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return YE.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),YE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(YE.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(ar).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(fat(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},E6r=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){YE.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),YE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=Bcr(e.id_token)}catch{}if(!r)try{r=Bcr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:Meo(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var yI=new ge("DynamicAuthProviderService"),EN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Ueo.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new nxt(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){yI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Vu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${oEe}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(ur).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? +`,PWc="SELECT key, value FROM state",T_e=new Ae("state-database"),$g=class{constructor(e){this.cache=new Map;this.changeEmitter=new no;this.pendingInserts=new Map;this.pendingDeletes=new Set;this.writeQueue=Promise.resolve();this.persistenceEnabled=!1;this.initializationFailed=!1;this.state=0;this.ctx=e,e.get(On).onDidSetCapabilities(()=>{this.initialize()})}static{a(this,"StateDatabase")}get isClosed(){return this.state===3}get canPersist(){return this.persistenceEnabled&&!this.initializationFailed&&!this.isClosed}get canPerformDatabaseOperation(){return this.persistenceEnabled&&!this.initializationFailed}get onDidChange(){return this.changeEmitter.event}get initialized(){return this.state===2&&this.persistenceEnabled&&!this.initializationFailed&&this.database!==void 0}get size(){return this.cache.size}has(e){return this.cache.has(e)}clear(){if(this.isClosed)return;let e=this.getAllKeys();for(let r of e)this.delete(r)}getAllKeys(){return[...this.cache.keys()]}get(e){return this.cache.get(e)}set(e,r){if(this.isClosed)return;let n=JTn(r)||Array.isArray(r)?JSON.stringify(r):String(r);this.cache.get(e)!==n&&(this.cache.set(e,n),this.changeEmitter.fire({key:e,value:n}),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this.scheduleFlush())}delete(e){this.isClosed||!this.cache.delete(e)||(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this.changeEmitter.fire({key:e,value:void 0}),this.scheduleFlush())}initialize(){if(this.state!==0)return;let e=this.ctx.get(On).getCapabilities().stateDatabase??!1;if(this.state=1,this.persistenceEnabled=e,!e){this.state=2,this.initializationFailed=!1,this.database=void 0;return}this.initializationTask||(this.initializationTask=this.initializeWithTimeout().catch(r=>{this.handleInitializationError("Failed to initialize state database",r)})),this.state=2}handleInitializationError(e,r){this.initializationFailed=!0,this.state=0,T_e.error(this.ctx,e,r)}async waitForInitialization(){await this.initializationTask?.catch(()=>{})}async dispose(){this.state=3,this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0);try{await this.forceFlush()}catch(e){T_e.error(this.ctx,"Failed to flush data before closing",e)}await this.waitForInitialization(),await this.writeQueue.catch(()=>{}),this.database&&(this.close(this.database),this.database=void 0),this.persistenceEnabled=!1}async forceFlush(){if(!this.canPersist)return;this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=void 0),await this.flushPendingChanges()&&await this.writeQueue}async initializeWithTimeout(){await Promise.race([this.initializeInternal(),(0,Teo.setTimeout)(bWc).then(()=>{throw new Error("State database initialization timed out")})])}async initializeInternal(){let e;try{e=await this.resolveDatabasePath()}catch(o){this.handleInitializationError("State database disabled - unable to resolve storage path",o);return}let r;try{r=new beo.default.DatabaseSync(e,{open:!0})}catch(o){this.handleInitializationError("Failed to open state database file",o);return}this.database=r,r.exec(` + ${SWc}; + ${TWc}; + ${IWc}; + ${xWc}; + ${wWc}; + `);let n=this.all(r,PWc,[]);for(let o of n)try{let s=JSON.parse(o.value);s!==void 0?this.cache.set(o.key,s):T_e.warn(this.ctx,`Skipping corrupted state value for key '${o.key}' - parsed to undefined`)}catch(s){T_e.warn(this.ctx,`Failed to parse state value for key '${o.key}'`,s)}}async resolveDatabasePath(){let r=this.ctx.get(yi).directory;await Ceo.mkdir(r,{recursive:!0,mode:448});let n=this.getSanitizedDatabaseName();return Seo.default.join(r,`${n}.db`)}getSanitizedDatabaseName(){return this.ctx.get(Nr).getEditorPluginInfo().name.replace(/[^a-zA-Z0-9._-]+/g,"_").replace(/_+/g,"_")||CWc}scheduleFlush(){if(this.isClosed||this.flushTimer)return;let e=vWc;this.flushTimer=setTimeout(()=>{this.flushTimer=void 0,this.flushPendingChanges()},e),typeof this.flushTimer.unref=="function"&&this.flushTimer.unref()}enqueue(e){return this.writeQueue=this.writeQueue.then(e).catch(r=>{T_e.error(this.ctx,"State database write failed",r)}),this.writeQueue}async flushPendingChanges(){let e=new Map(this.pendingInserts.entries()),r=new Set(this.pendingDeletes.values());return this.pendingInserts.clear(),this.pendingDeletes.clear(),!e.size&&!r.size?!1:(await this.enqueue(()=>this.persistWrites(e,r)),!0)}async persistWrites(e,r){if(!e.size&&!r.size)return;let n=await this.awaitDatabase();if(!n){for(let[o,s]of e)this.pendingInserts.set(o,s);for(let o of r)this.pendingDeletes.add(o);return}this.run(n,"BEGIN IMMEDIATE",[]);try{for(let o of r)this.run(n,"DELETE FROM state WHERE key = ?",[o]);for(let[o,s]of e){let c;try{c=JSON.stringify(s)}catch(l){T_e.warn(this.ctx,`Failed to serialize state value for key '${o}'`,l);continue}this.run(n,RWc,[o,c,Date.now()])}this.run(n,"COMMIT",[])}catch(o){try{this.run(n,"ROLLBACK",[])}catch{}for(let[s,c]of e)this.pendingInserts.set(s,c);for(let s of r)this.pendingDeletes.add(s);throw this.scheduleFlush(),o}}async awaitDatabase(){if(this.canPerformDatabaseOperation)return await this.waitForInitialization(),this.database}run(e,r,n){let o=n;o.length>0?e.prepare(r).run(...o):e.prepare(r).run()}all(e,r,n){let o=n;return o.length>0?e.prepare(r).all(...o):e.prepare(r).all()}close(e){e.close()}};var Uv=class{static{a(this,"DynamicAuthenticationProviderStorageService")}},jIt=class extends Uv{static{a(this,"CLSDynamicAuthenticationProviderStorageService")}constructor(e){super(),this.ctx=e}getClientRegistration(e){let r=this._getClientRegistration(e);if(r)try{let n=JSON.parse(r);if(n&&(n.clientId||n.clientSecret))return n}catch{this._removeClientRegistration(e)}}storeClientRegistration(e,r,n,o,s){let c={providerId:e,label:s||e,authorizationServer:r,clientId:n,clientSecret:o};this._updateClientRegistration(e,c)}removeDynamicProvider(e){this._removeClientRegistration(e)}getSessionsForDynamicAuthProvider(e,r){let n=this._getSessions(e,r);if(n)try{let o=JSON.parse(n);if(!Array.isArray(o)||!o.every(s=>typeof s.created_at=="number"&&Eat(s))){this._removeSessions(e,r);return}return o}catch{this._removeSessions(e,r)}}setSessionsForDynamicAuthProvider(e,r,n){this._updateSessions(e,r,n)}_generateClientKey(e){return`dynamicAuthProvider:clientRegistration:${e}`}_generateSessionKey(e,r){return`dynamicAuthProvider:sessions:${e}:${r}`}_getClientRegistration(e){let r=this._generateClientKey(e);return this.ctx.get($g).get(r)}_updateClientRegistration(e,r){let n=this._generateClientKey(e);this.ctx.get($g).set(n,r)}_removeClientRegistration(e){let r=this._generateClientKey(e);this.ctx.get($g).delete(r)}_getSessions(e,r){let n=this._generateSessionKey(e,r);return this.ctx.get($g).get(n)}_updateSessions(e,r,n){let o=this._generateSessionKey(e,r);this.ctx.get($g).set(o,n)}_removeSessions(e,r){let n=this._generateSessionKey(e,r);this.ctx.get($g).delete(n)}};var VE=new Ae("DynamicAuthenticationProvider"),HIt=class{static{a(this,"DynamicAuthenticationProvider")}constructor(e,r,n,o,s,c,l){this.ctx=e,this.authorizationServer=r,this.serverMetadata=n,this.resourceMetadata=o,this.clientId=s,this.clientSecret=c,this.initialTokens=l,this.id=o?.resource?r+" "+o?.resource:r,this.label=o?.resource_name??r,this.authorizationServers=[r],this.supportsMultipleAccounts=!0,this._tokenStore=new J8r(e,l,{set:a(u=>{this.ctx.get(Uv).setSessionsForDynamicAuthProvider(this.id,this.clientId,u)},"set")})}async getSessions(e,r){if(VE.info(this.ctx,`Getting sessions for scopes: ${e?.join(" ")??"all"}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),o=e.join(" "),s=this._tokenStore.sessions.filter(c=>sxe([...c.scopes].sort(),n));if(VE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s.length){let c=[],l=[],u=new Map(this._tokenStore.tokens.map(d=>[d.access_token,d]));for(let d of s){let f=u.get(d.accessToken);if(f&&f.expires_in){let h=Date.now(),m=f.expires_in*1e3;if(h>f.created_at+m-300*1e3){if(VE.info(this.ctx,`Token for session ${d.id} is about to expire, refreshing...`),l.push(f),!f.refresh_token){VE.warn(this.ctx,`No refresh token available for scopes ${d.scopes.join(" ")}. Throwing away token.`);continue}try{let g=await this.exchangeRefreshTokenForToken(f.refresh_token);g.scope!==o&&(VE.warn(this.ctx,`Token scopes '${g.scope}' do not match requested scopes '${o}'. Overwriting token with what was requested...`),g.scope=o),VE.info(this.ctx,`Successfully created a new token for scopes ${d.scopes.join(" ")}.`),c.push(g)}catch(g){VE.error(this.ctx,"Failed to refresh token: ",g)}}}}return(c.length||l.length)&&(this._tokenStore.update({added:c,removed:l}),s=this._tokenStore.sessions.filter(d=>sxe([...d.scopes].sort(),n))),VE.info(this.ctx,`Found ${s.length} sessions for scopes: ${o}`),s}return[]}async createSession(e,r){let n=[...e].sort(),o=await new Kye(this.ctx).auth({clientId:this.clientId,clientSecret:this.clientSecret},n,this.serverMetadata,this.resourceMetadata);o.scope!==e.join(" ")&&(VE.warn(this.ctx,`Token scopes '${o.scope}' do not match requested scopes '${e.join(" ")}'. Overwriting token with what was requested...`),o.scope=e.join(" ")),this._tokenStore.update({added:[{...o,created_at:Date.now()}],removed:[]});let s=this._tokenStore.sessions.find(c=>c.accessToken===o.access_token);return VE.info(this.ctx,`Created ${o.refresh_token?"refreshable":"non-refreshable"} session for scopes: ${o.scope}${o.expires_in?` that expires in ${o.expires_in} seconds`:""}`),s}removeSession(e){VE.info(this.ctx,`Removing session with id: ${e}`);let r=this._tokenStore.sessions.find(o=>o.id===e);if(!r)return VE.error(this.ctx,`Session with id ${e} not found`),Promise.resolve();let n=this._tokenStore.tokens.find(o=>o.access_token===r.accessToken);return n?(this._tokenStore.update({added:[],removed:[n]}),VE.info(this.ctx,`Removed token for session: ${r.id} with scopes: ${r.scopes.join(" ")}`),Promise.resolve()):(VE.error(this.ctx,`Failed to retrieve token for removed session: ${r.id}`),Promise.resolve())}async exchangeRefreshTokenForToken(e){if(!this.serverMetadata.token_endpoint)throw new Error("Token endpoint not available in server metadata");let r=new URLSearchParams;r.append("client_id",this.clientId),r.append("grant_type","refresh_token"),r.append("refresh_token",e),this.resourceMetadata?.resource&&r.append("resource",this.resourceMetadata.resource),this.clientSecret&&r.append("client_secret",this.clientSecret);let o=await(await this.ctx.get(cr).fetch(this.serverMetadata.token_endpoint,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()})).json();if(Eat(o))return{...o,created_at:Date.now()};throw new Error(`Invalid authorization token response: ${JSON.stringify(o)}`)}},J8r=class{static{a(this,"TokenStore")}constructor(e,r,n){this.ctx=e,this.tokens=r??[],this._persistence=n}get sessions(){return this.tokens.map(e=>this._getSessionFromToken(e))}update({added:e,removed:r}){VE.info(this.ctx,`Updating tokens: added ${e.length}, removed ${r.length}`);let n=[...this.tokens];for(let o of r){let s=n.findIndex(c=>c.access_token===o.access_token);s!==-1&&n.splice(s,1)}for(let o of e){let s=n.findIndex(c=>c.access_token===o.access_token);s===-1?n.push(o):n[s]=o}(e.length||r.length)&&(this.tokens=n,this._persistence.set(n)),VE.info(this.ctx,`Tokens updated: ${n.length} tokens stored.`)}_getSessionFromToken(e){let r;if(e.id_token)try{r=flr(e.id_token)}catch{}if(!r)try{r=flr(e.access_token)}catch{}let n=e.scope?e.scope.split(" "):r?.scope?r.scope.split(" "):[];return{id:veo(e.access_token,0).toString(),accessToken:e.access_token,account:{id:r?.sub||"unknown",label:r?.preferred_username||r?.name||r?.email||"MCP"},scopes:n,idToken:e.id_token}}};var hI=new Ae("DynamicAuthProviderService"),gN=class t{static{a(this,"DynamicAuthenticationProviderService")}static{this.dynamicOAuthRequestType=new Ieo.ProtocolRequestType("copilot/dynamicOAuth")}constructor(e){this.ctx=e}async registerDynamicAuthProvider(e,r,n,o,s,c){if(!o){let u=await this.getDynamicClientRegistration(e,r,n);o=u.clientId,s=u.clientSecret}let l=new HIt(this.ctx,e,r,n,o,s,c);return this.registerDynamicAuthenticationProvider(l),l}async getDynamicClientRegistration(e,r,n){let o,s;if(r.registration_endpoint)try{let c=await this.fetchDynamicRegistration(r,n?.scopes_supported);o=c.client_id,s=c.client_secret}catch(c){hI.error(this.ctx,`Dynamic registration failed for ${e.toString()}: ${Yu(c)}. Prompting user for client ID and client secret...`)}if(!o){let c=[`http://127.0.0.1:${Yye}/callback`,"http://127.0.0.1/callback"],l;try{l=await this.ctx.get(dr).connection.sendRequest(t.dynamicOAuthRequestType,{title:"Add Client Registration Details",header:`The authorization server '${e.toString()}' does not support automatic client registration.`,detail:`Do you want to proceed by manually providing a client registration (client ID)? Note: When registering your OAuth application, make sure to include these redirect URIs: ${c.join(` -`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){yI.error(this.ctx,`Failed to get client ID and secret from user: ${Vu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,yI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?yI.info(this.ctx,`User provided client secret for ${e.toString()}`):yI.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(ar).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>n4r.includes(s)):n4r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${oEe}/callback`,`http://127.0.0.1:${oEe}/callback`],scope:r?.join(Y$n),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(tVn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(e0).registerAuthenticationProvider(e.id,e),this.ctx.get(jC).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(e0);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);yI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);yI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw yI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(e0);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});yI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);yI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw yI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(e0),n=this.ctx.get(jC);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),yI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw yI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var ixt=class extends e0{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===rN.providerId){let s=new rN(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(jC).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(jC).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(EN).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var qeo=ce(Al());var Qeo=new ge("agentCopilotTokenManager"),BYc={type:new qeo.ProtocolRequestType("copilot/token")},oxt=class extends gh{constructor(){super(...arguments);this.networkFetcher=new M9e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(Mn).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(ur).connection;try{let c=await s.sendRequest(BYc.type,{force:!1,session:n});if(!c?.envelope)throw new Ai("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(Qeo.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(Mn),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(Mn),o=this.ctx.get(Jt),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Lr).getEditorPluginInfo().name==="copilot-intellij"}};p();var LYc=new ge("Public Code References"),sxt=class extends vT{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");LYc.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` - ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(Mn).getCapabilities().ipCodeCitation===!0&&await e.get(ur).connection.sendNotification(xUt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var _6r=ce(Al());var FYc=new _6r.ProtocolNotificationType("$/copilot/compressionStarted"),UYc=new _6r.ProtocolNotificationType("$/copilot/compressionCompleted"),axt=class extends oI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(ur).connection.sendNotification(FYc,r)}async notifyCompressionCompleted(r){await this.ctx.get(ur).connection.sendNotification(UYc,r)}};p();p();function jeo(t){QYc(t)}a(jeo,"activateExtensibilityPlatformFeature");function QYc(t){t.set(vP,new sKe(t)),t.set(rO,new rO(t))}a(QYc,"registerContextDependencies");p();var Heo=S.String(),C6r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(lxt,"build logs"),`The contents of the application build logs: +`)}`,inputs:[{title:"Client ID",value:"clientId",description:`Enter an existing client ID that has been registered with the following redirect URIs: ${c.join(", ")}`,placeholder:"OAuth client ID (azye39d...)",required:!0},{title:"Client Secret",value:"clientSecret",description:"(optional) Enter an existing client secret associated with the previous client id or leave this field blank",placeholder:"OAuth client secret (wer32o50f...) or leave it blank",required:!1}]})}catch(u){hI.error(this.ctx,`Failed to get client ID and secret from user: ${Yu(u)}`)}if(!l)throw new Error("User did not provide client details");o=l.clientId,s=l.clientSecret,hI.info(this.ctx,`User provided client registration for ${e.toString()}`),s?hI.info(this.ctx,`User provided client secret for ${e.toString()}`):hI.info(this.ctx,`User did not provide client secret for ${e.toString()}`)}return{clientId:o,clientSecret:s}}async fetchDynamicRegistration(e,r){if(!e.registration_endpoint)throw new Error("Server does not support dynamic registration");let n=await this.ctx.get(cr).fetch(e.registration_endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_name:"GitHub Copilot",client_uri:"https://github.com/features/copilot",grant_types:e.grant_types_supported?e.grant_types_supported.filter(s=>U5r.includes(s)):U5r,response_types:["code"],redirect_uris:["http://127.0.0.1/callback","http://localhost/callback",`http://localhost:${Yye}/callback`,`http://127.0.0.1:${Yye}/callback`],scope:r?.join(lWn),token_endpoint_auth_method:"none",application_type:"native"})});if(!n.ok)throw new Error(`Dynamic client registration failed: ${n.status} ${n.statusText}`);let o=await n.json();if(mWn(o))return o;throw new Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(o)}`)}registerDynamicAuthenticationProvider(e){this.ctx.get(r0).registerAuthenticationProvider(e.id,e),this.ctx.get(Uv).storeClientRegistration(e.id,e.authorizationServer,e.clientId,e.clientSecret,e.label)}async removeSessionByAccountName(e,r){let n=this.ctx.get(r0);try{let o=n.getProvider(e),c=(await o.getSessions(void 0,{})).filter(l=>l.account.label===r);hI.info(this.ctx,`Removing ${c.length} session(s) for account ${r} in provider ${e}`);for(let l of c)await o.removeSession(l.id);hI.info(this.ctx,`Successfully removed session(s) for account ${r} in provider ${e}`)}catch(o){throw hI.error(this.ctx,`Failed to remove session for account ${r} in provider ${e}:`,o),o}}async removeAllSessions(e){let r=this.ctx.get(r0);try{let n=r.getProvider(e),o=await n.getSessions(void 0,{});hI.info(this.ctx,`Removing ${o.length} sessions for provider ${e}`);for(let s of o)await n.removeSession(s.id);hI.info(this.ctx,`Successfully removed all sessions for provider ${e}`)}catch(n){throw hI.error(this.ctx,`Failed to remove sessions for provider ${e}:`,n),n}}async unregisterProvider(e){let r=this.ctx.get(r0),n=this.ctx.get(Uv);try{await this.removeAllSessions(e),n.removeDynamicProvider(e),r.unregisterAuthenticationProvider(e),hI.info(this.ctx,`Successfully unregistered provider ${e} and removed all associated data`)}catch(o){throw hI.error(this.ctx,`Failed to unregister provider ${e}:`,o),o}}};var GIt=class extends r0{constructor(r){super();this._authenticationProviders=new Map;this.ctx=r}static{a(this,"CLSAuthenticationService")}registerAuthenticationProvider(r,n){this._authenticationProviders.set(r,n)}unregisterAuthenticationProvider(r){this._authenticationProviders.delete(r)}getOrActivateProviderIdForServer(r){for(let n of this._authenticationProviders.values())if(n.authorizationServers?.some(o=>o===r))return n.id}createAuthenticationProvider(r,n,o){if(r===XD.providerId){let s=new XD(this.ctx,r,n,o);return this.registerAuthenticationProvider(s.id,s),s}}async createDynamicAuthenticationProvider(r,n,o){let s=o?`${r.toString()} ${o.resource}`:r.toString(),c=this.ctx.get(Uv).getClientRegistration(s),l=c?.clientId,u=c?.clientSecret,d;return l&&(d=this.ctx.get(Uv).getSessionsForDynamicAuthProvider(s,l)),await this.ctx.get(gN).registerDynamicAuthProvider(r,n,o,l,u,d)}getProvider(r){if(this._authenticationProviders.has(r))return this._authenticationProviders.get(r);throw new Error(`No authentication provider '${r}' is currently registered.`)}async getSessions(r,n,o,s=!1){let c=this._authenticationProviders.get(r);if(c){if(o?.authorizationServer){let l=o.authorizationServer;if(!c.authorizationServers?.some(u=>u===l))throw new Error(`The authorization server '${l}' is not supported by the authentication provider '${r}'.`)}return await c.getSessions(n,{...o})}else throw new Error(`No authentication provider '${r}' is currently registered.`)}};p();var weo=fe(Al());var xeo=new Ae("agentCopilotTokenManager"),kWc={type:new weo.ProtocolRequestType("copilot/token")},$It=class extends Eh{constructor(){super(...arguments);this.networkFetcher=new E9e}static{a(this,"AgentCopilotTokenFetcher")}async fetchTokenResult(r,n,o){if(!r.get(On).getCapabilities().token)return this.networkFetcher.fetchTokenResult(r,n,o);let s=r.get(dr).connection;try{let c=await s.sendRequest(kWc.type,{force:!1,session:n});if(!c?.envelope)throw new gi("Editor did not return a token");let{envelope:l,tokenEndpoint:u}=c;if(xeo.debug(r,"Retrieved envelope from copilot/token"),l.expires_at*1e3this.updateCapabilities(r))}static{a(this,"CapabilitiesUpdater")}async updateCapabilities(e){let r=this.ctx.get(On),n=this.isPreviewFeaturesDisabled(e);n&&!this.isJetBrains()&&r.setCapabilities({mcpAllowlist:!1}),await this.updateCveRemediatorCapability(e,n)}async updateCveRemediatorCapability(e,r){let n=this.ctx.get(On),o=this.ctx.get(Jt),s=n.getCapabilities().cveRemediatorAgent??!1,c=await o.updateExPValuesAndAssignments(e),l=o.cveRemediatorAgentEnabled(c),u=s&&l&&!r;n.setCapabilities({cveRemediatorAgent:u})}isPreviewFeaturesDisabled(e){return e.getTokenValue("editor_preview_features")==="0"}isJetBrains(){return this.ctx.get(Nr).getEditorPluginInfo().name==="copilot-intellij"}};p();var DWc=new Ae("Public Code References"),VIt=class extends yT{static{a(this,"CLSCitationManager")}async handleIPCodeCitation(e,r){let n=r.location?.start.line!==void 0?r.location.start.line+1:"-",o=r.location?.start.character!==void 0?r.location.start.character+1:"-",s=(r.matchingText??"").replace(/[\r\n]/g," ");DWc.info(e,`Text found matching public code in ${r.inDocumentUri} [Ln ${n}, Col ${o}] near ${s}...:`+r.details.map((c,l)=>` + ${l+1}) [${c.license}] ${c.url}`).join("")),!(r.version===void 0||r.location===void 0)&&e.get(On).getCapabilities().ipCodeCitation===!0&&await e.get(dr).connection.sendNotification(QQt.type,{uri:r.inDocumentUri,version:r.version,range:r.location,matchingText:r.matchingText??"",citations:r.details})}};p();var Z8r=fe(Al());var NWc=new Z8r.ProtocolNotificationType("$/copilot/compressionStarted"),MWc=new Z8r.ProtocolNotificationType("$/copilot/compressionCompleted"),WIt=class extends tI{constructor(r){super();this.ctx=r}static{a(this,"CLSCompressionNotifier")}async notifyCompressionStarted(r){await this.ctx.get(dr).connection.sendNotification(NWc,r)}async notifyCompressionCompleted(r){await this.ctx.get(dr).connection.sendNotification(MWc,r)}};p();p();function Reo(t){OWc(t)}a(Reo,"activateExtensibilityPlatformFeature");function OWc(t){t.set(Tk,new WKe(t)),t.set(tO,new tO(t))}a(OWc,"registerContextDependencies");p();var Peo=S.String(),X8r=class{constructor(e){this.turnContext=e}static{a(this,"BuildLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(YIt,"build logs"),`The contents of the application build logs: \`\`\` ${e} -\`\`\``}},lxt="build-logs",cxt=class extends Xm{static{a(this,"BuildLogsSkill")}constructor(e){super(lxt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new C6r(r))}};p();var v6r=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await bZe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new Ar(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new Ar([s]),1]);return new Ar(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},b6r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},qYc="directory-references",uxt=class{constructor(){this.id=qYc;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new b6r}processor(e){return new v6r(e)}};p();var BFe=class extends FM{constructor(r,n){super();this.ctx=r;this.enablementCheck=n;this.ready=!1;this.ctx.get(S_).addListener(this)}static{a(this,"ProjectContextListener")}start(){this.ready=!0}async didAddWorkspace(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx)||!r.uri)return;this.workerPoolToken=await RIe();let n=this.ctx.get(Y0),o=this.ctx.get(qy),s=this.ctx.get(D_),c=await n.chunk(this.ctx,r);n.status(r)!=="completed"&&o.terminateWatching(r),await s.initialize(this.ctx,r,c),await this.workerPoolToken.stopWorkerPool()}async didRemoveWorkspace(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx)||!r)return;let n=this.ctx.get(Y0),o=n.getParentFolder(r);if(o){let l=await n.deleteSubfolderChunks(o,r);await this.ctx.get(D_).deleteEmbeddings(this.ctx,o,l);return}n.terminateChunking(this.ctx,r),await this.ctx.get(D_).terminateRanking(this.ctx,r),this.ctx.get(Lx).terminateScoring(this.ctx,r),n.workspaceCount===0&&await Vle.forceStopWorkerPool()}async didTerminateWorkspaceSubfolders(r,n){if(!await this.enablementCheck(this.ctx))return;let o=this.ctx.get(Y0),s=this.ctx.get(D_),c=this.ctx.get(Lx);for(let l of n)o.terminateChunking(this.ctx,l),await s.terminateRanking(this.ctx,l),c.terminateScoring(this.ctx,r)}async didChangeFiles(r){if(!await this.isEnabled()||!await this.enablementCheck(this.ctx))return;let n=await RIe();try{let o=r.documents.map(u=>u.uri),s=r.workspaceFolder;if(!s)return;let c=this.ctx.get(Y0),l=this.ctx.get(D_);if(r.type==="delete"||r.type==="update"){let u=await c.deleteFileChunks(s,o);await l.deleteEmbeddings(this.ctx,s,u)}if(r.type==="create"||r.type==="update"){let u=await c.chunk(this.ctx,s,r.documents);await l.addChunks(this.ctx,s,u)}}finally{await n.stopWorkerPool()}}isStarted(){return this.ready}isEnabled(){return Promise.resolve(!0)}};p();var jYc=S.Object({uri:S.String(),visibleRange:S.Optional(hf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),Geo=S.Object({files:S.Array(jYc)}),HYc=3,S6r=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=jQ(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(Jn),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=zu(c);if(await this.turnContext.collectFile(fxt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===HYc))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(Jn).getRelativePath(n),c=new ZM(n,void 0,o.visibleRange);return new Ar([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await Uo.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new Ar([n])}},fxt="recent-files",dxt=class extends Xm{static{a(this,"RecentFilesSkill")}constructor(e){super(fxt,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new S6r(r))}};p();var $eo=S.String(),T6r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(hxt,"runtime logs"),`The contents of the application runtime logs: +\`\`\``}},YIt="build-logs",zIt=class extends rg{static{a(this,"BuildLogsSkill")}constructor(e){super(YIt,"The application build logs, which can be used to fix build or compilation errors.","Reading build logs",()=>e,r=>new X8r(r))}};p();var e6r=class{constructor(e){this.turnContext=e}static{a(this,"DirectoryReferencesSkillProcessor")}value(){return 1}async processSkill(e){let r=this.filterDirectoryReferences(e);if(r.length===0)return;let n=await yZe(this.turnContext.ctx,this.turnContext.cancelationToken,r);if(n.length>0){let o=[[new yr(["The user wants you to consider the following directory structures when computing your answer."]),1]];for(let s of n)o.push([new yr([s]),1]);return new yr(o)}}filterDirectoryReferences(e){return e.filter(r=>r.type==="directory")}},t6r=class{static{a(this,"DirectoryReferencesSkillResolver")}resolveSkill(e){if(e.turn.request.references&&e.turn.request.references.length>0)return e.turn.request.references}},BWc="directory-references",KIt=class{constructor(){this.id=BWc;this.type="implicit"}static{a(this,"DirectoryReferencesSkill")}description(){return"The directory structure from the user's referenced directories"}resolver(){return new t6r}processor(e){return new e6r(e)}};p();var LWc=S.Object({uri:S.String(),visibleRange:S.Optional(pf),openedAt:S.Optional(S.String()),activeAt:S.Optional(S.String())}),keo=S.Object({files:S.Array(LWc)}),FWc=3,r6r=class{constructor(e){this.turnContext=e}static{a(this,"RecentFilesSkillProcessor")}value(){return .7}async processSkill(e){let r=await this.getDocuments(e);if(r.length>0){let n=this.toElidableDocs(r),o=VQ(n,"inversePositional");return await this.preElideDocuments(o)}}async getDocuments(e){let r=this.sortFiles(e.files);r=this.filterIncludedDocs(r);let n=this.turnContext.ctx.get(ri),o=[];for(let s of r){let c=await n.getOrReadTextDocument(s),l=Ku(c);if(await this.turnContext.collectFile(ZIt,s.uri,l),c.status==="valid"&&l!=="empty"&&(o.push([c.document,s]),o.length===FWc))break}return o.reverse()}sortFiles(e){return e.sort((r,n)=>r.activeAt&&n.activeAt?new Date(r.activeAt).getTime()-new Date(n.activeAt).getTime():r.activeAt?-1:n.activeAt?1:0).reverse()}filterIncludedDocs(e){return e.filter(r=>!this.turnContext.isFileIncluded(r.uri))}toElidableDocs(e){return e.map(r=>{let[n,o]=r,s=this.turnContext.ctx.get(ri).getRelativePath(n),c=new JM(n,void 0,o.visibleRange);return new yr([[`Code excerpt from file \`${s}\`:`,1],[c.fromAllCode({addLineNumbers:!1}),.9]])})}async preElideDocuments(e){let r=(await Ro.getModelConfiguration(this.turnContext.ctx,"user")).maxRequestTokens,n=e.elide(Math.floor(r*.1)).getText();return new yr([n])}},ZIt="recent-files",JIt=class extends rg{static{a(this,"RecentFilesSkill")}constructor(e){super(ZIt,"Provides code examples helpful for creating, explaining, refactoring, or fixing code. It's based on the files the user has worked on in the editor.","Resolving recent files",()=>e,r=>new r6r(r))}};p();var Deo=S.String(),n6r=class{constructor(e){this.turnContext=e}static{a(this,"RuntimeLogsSkillProcessor")}value(){return .9}processSkill(e){return this.turnContext.collectLabel(ext,"runtime logs"),`The contents of the application runtime logs: \`\`\` ${e} -\`\`\``}},hxt="runtime-logs",pxt=class extends Xm{static{a(this,"RuntimeLogsSkill")}constructor(e){super(hxt,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new T6r(r))}};p();var mxt=ce(sP());var gxt=class extends Uh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return a6e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(ur).connection}async inspectPrompt(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new mxt.NotificationType("conversation/documentDiff"),r)}};p();var Veo=ce(Al());var LFe=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(LR).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(ur).connection.sendNotification(new Veo.NotificationType(this.notificationEndpoint),e)}};function Weo(t){GYc(t),$Yc(t),jeo(t)}a(Weo,"activateConversationFeature");function GYc(t){t.set(Vo,new Vo(t)),t.set(eg,new eg),t.set(dA,new dA(t)),t.set(Bc,new DWe(t)),t.set(n9,new n9),t.set(vc,new vc(t)),t.set(LR,new LR(t)),t.set(LFe,new LFe(t)),t.set(dc,new KHe(t,new YHe(t))),t.set(XD,new XD),t.set(JQ,new JQ),t.set(Uh,new gxt(t)),t.set(Y0,new Y0(t)),t.set(D_,new D_),t.set(Lx,new Lx),t.set(kP,new kP(t)),t.set(BFe,new BFe(t,()=>Promise.resolve(!1)))}a(GYc,"registerContextDependencies");function $Yc(t){let e=new Qh;e.registerSkill(new KJe(new YJe)),e.registerSkill(new hYe(new OC(t,XM,Uyn))),e.registerSkill(new rYe(new OC(t,EP,Myn))),e.registerSkill(new tYe(new OC(t,Vy,Nyn))),e.registerSkill(new mYe),e.registerSkill(new uxt),e.registerSkill(new dxt(new OC(t,fxt,Geo))),e.registerSkill(new GYe(new OC(t,nO,WEn))),e.registerSkill(new tZe(new OC(t,dq,VSn))),e.registerSkill(new pxt(new OC(t,hxt,$eo))),e.registerSkill(new cxt(new OC(t,lxt,Heo))),e.registerSkill(new nZe(new OC(t,PP,WSn))),e.registerSkill(new iZe(new OC(t,TK,zSn))),t.set(Qh,e)}a($Yc,"registerSkills");p();var zeo=ce(Al()),Yeo=ce(sP());var Axt=class extends Md{constructor(){super(...arguments);this.requestType=new zeo.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Ou.Compile($0n)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Yeo.ResponseError(u.code,u.message,u.data);throw Ye.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new vA(this.typeCheck.Errors(s));return s}};p();var Keo=ce(Al()),Jeo=ce(sP());var yxt=class extends v_{constructor(){super(...arguments);this.requestType=new Keo.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Ou.Compile(G0n)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(ur).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Jeo.ResponseError(u.code,u.message,u.data);throw Ye.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new vA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new wr(o.value):new LY(o.value));return new Or(n,r.status??"success")}};p();p();function Zeo(t,e,r){try{let n=t.get(Jt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Dr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Zeo,"fillInJavaActiveExperiments");var I6r=ce(sP());var VYc={type:new I6r.NotificationType("featureFlagsNotification")},WYc={type:new I6r.NotificationType("copilot/didChangeFeatureFlags")},FFe=class{constructor(e){this.ctx=e;Es(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=r.get(Jt),u=await l.updateExPValuesAndAssignments(e);n=l.ideDataMigrationCompleted(u),o=l.appmodContextMenuEnabled(u),s=l.cliAsDefaultAgentProviderEnabled(u),c=Scn(r,u);let d={};r.get(Jt).excludeRelatedFiles(u)&&(d.ExcludeRelatedFiles=!0);let f=Olr(r,u);f.length>0&&(d.ExpContextProviders=f);let h=new Map;Wzn(r,f,h,u),Uat(r,h,u),Zeo(r,h,u);for(let[A,y]of h.entries())d[A]=y;let m=r.get(Mn),g=r.get(ur).connection;if(m.getCapabilities().didChangeFeatureFlags)await g.sendNotification(WYc.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,user_notification:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:d,byok:AQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,copilot_plan:e.userInfo.copilotPlan});else{let A={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:d,byok:AQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c};e.getTokenValue("agent_mode")==="0"&&(A.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(A.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(A.mcp=!1),e.envelope.chat_enabled&&(A.xc=!0),await g.sendNotification(VYc.type,A)}}};p();var Ext=class extends as{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(ur).connection.sendNotification(LUt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(ur).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(ur).connection.sendNotification(FUt.type,r)}};p();var Xeo=new ge("AgentEncodingConfigurationService"),_xt=class extends KM{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(ur)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Xeo.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Xeo.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var eto=new L7;p();var nto=ce(ti());var ito={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"}},zYc=new nto.NotificationType("policy/didChange"),YYc=Object.fromEntries(Object.entries(ito).map(([t,e])=>[t,{type:e.type}])),UFe=class extends uu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries(ito).map(([r,n])=>[r,n.defaultValue]));let o=r.get(ur);o.onActivation(()=>{this.startWatching().catch(s=>{Dr.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>ce(rto()));this.policyWatcher=r("IDEGitHubCopilot",YYc,n=>{this.handlePolicyUpdate(n).catch(o=>{Dr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Dr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Dr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Dr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Dr.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Dr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(Mn).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(Mn).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(zYc,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Dr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Dr.debug(this.ctx,"Policy watcher stopped")}}};p();var Cxt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(){this.ctx.get(ur).connection.sendNotification(NQi,{}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(ur).connection.sendNotification(MQi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(EN).unregisterProvider(e)}};p();var vxt=class extends fb{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get(Gg).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get(Gg).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get(Gg).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var oto=ce(ti());var bxt="mcp.elicitation",Sxt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new oto.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Ln(Xn.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Ln(Xn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;ir.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await sc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(eO).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return ht(e.ctx,bxt,jt.createAndMarkAsIssued()),gt(e.ctx,bxt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw ir.error(e.ctx,l,c),await im(e.ctx,{message:l,server:r}),_s(e.ctx,c,bxt),gi(e.ctx,bxt,c),new Ln(Xn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var tk=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var QFe=class extends tk{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":ir.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":ir.warn(this.ctx,`MCP server ${this.serverName} log:`,r),UZ(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":ir.error(this.ctx,`MCP server ${this.serverName} log:`,r),im(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:ir.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var qFe=class extends tk{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Prompts list changed, refreshing prompts..."),sc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(Ubt)}};p();var jFe=class extends tk{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Resource list changed, refreshing resources..."),sc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(Fbt)}};p();var HFe=class extends tk{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),sc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(D7i)}};p();var Txt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},GFe=class extends Txt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){ir.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get(cn).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),sc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){ir.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),im(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var $Fe=class extends tk{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){ir.info(this.ctx,"Tool list changed, refreshing tools..."),sc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(Lbt)}};p();var sto="mcp.sampling",Ixt=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Ln(Xn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,ir.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await sc(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(LV).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),E=y[y.length-1];if((await e.ctx.get(Md).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{...E,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new Mc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await UTe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new qn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return gt(e.ctx,sto,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw ir.error(e.ctx,u,l),await im(e.ctx,{message:u,server:o}),gt(e.ctx,sto,{success:"false",errorMessage:u}),new Ln(Xn.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){ir.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw ir.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",ir.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?QM(e,u.provider,l):await e.get(Bc).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(dc).getMetadata()).filter(n=>n.capabilities.type&&!Xae.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new bc(e.get(Si)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var F_e=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function ato(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=dat(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(ato,"parseScopeChallenge");p();var w6r=/[^a-z0-9_-]/gi;var KYc=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function cto(){let t={};for(let e of KYc){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(cto,"getDefaultEnvironment");async function lto(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;ir.warn(t,n),await UZ(t,{message:n,server:r,tool:e.name}),e.description=""}if(w6r.lastIndex=0,w6r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;ir.warn(t,n),await UZ(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(w6r,"_")}else e._nameForModel=e.name;return e}a(lto,"normalizeTool");var xxt=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*R6r(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a(R6r,"paginateRequest");async function k6r(t){let e=[];for await(let r of t)e.push(...r);return e}a(k6r,"flattenAsyncIterable");var uto=ce(require("events"));var P6r=6e4,FV=class{constructor(e,r,n){this.transport=null;this.emitter=new uto.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(Mn);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new Ixt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new Sxt);let s=this.ctx.get(Lr).getEditorInfo(),c=this.ctx.get(Lr).getEditorPluginInfo();this.mcp=new Vj({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw ir.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw ir.error(this.ctx,"Connection failed:",r),await im(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit(rV)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await lto(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof F_e){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(ir.info(this.ctx,l),await im(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===Xn.MethodNotFound){if(ir.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(ir.error(this.ctx,c),await im(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=R6r(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await k6r(this.getResourcesIterable(e));return sc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=R6r(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await k6r(this.getResourceTemplatesIterable(e));return sc(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=VK();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Or([],"error");return f.content.push(new wr(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},Mj,{onprogress:a(m=>{ir.info(this.ctx,`${e} calling progress`,m),sc(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return ir.error(this.ctx,m),await im(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return ir.error(this.ctx,h),await im(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{ir.info(this.ctx,`MCP server ${this.name} connection closed.`),sc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{ir.error(this.ctx,`MCP server ${this.name} error:`,e),im(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(_Z,e=>new QFe(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(xF,e=>new $Fe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(IF,e=>new qFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(TF,e=>new jFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(osr,e=>new HFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Asr,e=>(this.initRootsTracker(),new GFe(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(uPe,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw ir.error(this.ctx,o),new Ln(Xn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw ir.error(this.ctx,o),new Ln(Xn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new rc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(dPe,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw ir.error(this.ctx,n),new Ln(Xn.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(Lbt,()=>{this.refreshToolsCache()}),this.emitter.on(Fbt,()=>{this.refreshResourcesCache()}),this.emitter.on(Ubt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(P6r),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),ir.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit(rV)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(P6r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,ir.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit(rV)}catch(r){ir.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(P6r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,ir.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit(rV)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Or([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new wr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new pQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new wr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new pQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new wr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get(cn);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function JYc(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=ato(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new F_e(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(JYc,"createFetchAdapter");function wxt(t,e){let r=t.get(ar),n=JYc(r);return{...e,fetch:n}}a(wxt,"createConfigWithFetch");var Rxt=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=wxt(this.ctx,r),{url:o,...s}=n;return new hpe(new URL(o),s)}};p();var dto=require("child_process"),fto=require("util");var kxt=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...cto(),...r.env||{}},r.stderr="pipe",new _pe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{UZ(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,fto.promisify)(dto.exec);ir.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),sc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),ir.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){ir.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),im(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var VFe=class extends FV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=wxt(this.ctx,r),{url:o,...s}=n;return new mpe(new URL(o),s)}};p();var Pxt=class extends fQ{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Mc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(Md).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var gto=ce(Al());p();var pto="mcp-servers-cache",hto="mcp-first-boot-completed",Dxt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get(Gg),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(hto)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(hto,"true")}parseCache(){let e=this.stateDb.get(pto);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(pto,e)}};p();function mto(t){let e=t.get(Lr).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(mto,"isNightlyOrDevBuild");var Nxt=class t extends jE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new tQ;this.prefixGenerator=new xxt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new Dxt(r),this.registryService=r.get(tN),Es(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(ir.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(ir.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(Mn).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(ir.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new gto.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return ir.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(Mn).getCapabilities().mcpAllowlist)return ir.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=mto(this.ctx);return n||ir.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(ir.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(Mn).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ir.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),ir.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),ir.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);ir.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){ir.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}NTe(r)&&(d._status=c),this.ctx.get(us).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(us).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return ht(this.ctx,"mcp.getPrompt",jt.createAndMarkAsIssued()),gt(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){ir.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){ir.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await sc(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){ir.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await sc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners(rV),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await sc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await sc(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await sc(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){ir.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await sc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),ir.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(EN).unregisterProvider(o)}catch{ir.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;ir.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(fb).removeAccountPreference(r,c);try{let u=this.ctx.get(e0).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),ir.info(this.ctx,`Successfully removed session for account ${l}`)):ir.warn(this.ctx,`No session found for account ${l}`)}catch(u){ir.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw ir.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),ir.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){ir.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on(rV,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await sc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){ir.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Pw||c instanceof a2e,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof VFe&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;ir.info(this.ctx,f),sc(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw ir.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await im(this.ctx,{message:d,server:r}),this.ctx.get(sa).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{ir.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){ir.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new Rxt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new VFe(this.ctx,r.name,r.version||"1.0.0"):new kxt(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(ur).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){ir.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(us).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new Pxt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(ir.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){ir.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(us).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){ir.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){ir.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;ir.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(fb).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new Ape(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw ir.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(e0).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(e0).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(e0).createDynamicAuthenticationProvider(o,s,c),!A)){ir.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(e0).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(fb).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(e0).getProvider(l),g=!!this.ctx.get(jC).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(sa).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){ir.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){ir.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(fb).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){ir.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(sa).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){ir.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){ir.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(sa).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(fb).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){ir.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(sa).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var Ato=ce(Al());var Mxt=class t extends d2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new Ato.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(ur).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var yto=ce(Al());var ZYc=new yto.ProtocolRequestType("copilot/readMcpSamplingConfig"),Oxt=class extends LV{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(ZYc,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Vu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var Lxt=ce(Al());var XYc=new Lxt.ProtocolRequestType("copilot/showPanelMessageRequest"),eKc=new Lxt.ProtocolNotificationType("copilot/showPanelMessage"),Bxt=class extends B_e{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(ur).connection.sendNotification(eKc,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(ur).connection,o;try{o=await n.sendRequest(XYc,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Vu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var _to=require("node:stream"),aie=ce(For());var y9=new ge("UndiciFetcher"),Uxt=class extends ar{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(ss).getVersion()}`,this.certificateConfigurator=new mEe(r),this.proxySocketFactory=r.get(UR),this.settings=r.get(Zo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),y9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Zo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),y9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=nKc(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};y9.debug(this.ctx,"Starting Undici fetch.",{target:Fxt(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,aie.fetch)(r,{...h,dispatcher:m});return y9.debug(this.ctx,"Undici fetch completed.",{target:Fxt(r),status:A.status,isProxy:g}),new BI(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?_to.Readable.fromWeb(A.body):null)}catch(h){throw l?(y9.warn(this.ctx,"Undici fetch timed out.",{target:Fxt(r),timeout:n.timeout}),new oW(`Request to <${r}> timed out after ${n.timeout}ms`,h)):iKc(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(y9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(y9.debug(this.ctx,"Creating direct Undici agent.",{target:Fxt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new aie.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,aie.buildConnector)(r);return y9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:Eto(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new aie.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&y9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=tKc(s),u=rKc(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:Eto(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function tKc(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(tKc,"splitHostPort");function rKc(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(rKc,"compileHostPattern");function Fxt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Fxt,"describeUrl");function Eto(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Eto,"describeProxy");function nKc(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(nKc,"toNativeAbortSignal");function iKc(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(iKc,"withCauseNetworkProperties");p();var WFe=new ge("fetcher"),oKc="https://default.exp-tas.com/",zFe=class extends ar{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(P0(o)||`${r}/`.startsWith(oKc))throw o;WFe.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),WFe.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},Qxt=class extends ar{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new zFe(r,n,o,(s,c)=>{this.current!==o&&(WFe.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,gi(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:aKc(c),...cKc(s),...lKc(r)}),n.disconnectAll().catch(l=>{WFe.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(WFe.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},sKc=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function aKc(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return sKc.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(aKc,"describeHost");function cKc(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(cKc,"buildErrorCauseProperties");function lKc(t){try{let e=t.get(Zo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a(lKc,"describeHttpContext");var Cto=new ge("fetcher");function uKc(t){return qt(t,je.UseHelixFetcher)==="true"}a(uKc,"isHelixFetcherForced");function dKc(t){if(uKc(t))return new Dne(t);let e=new Qxt(t,new Uxt(t),new Dne(t));return t.get(Zo).onDidChangeHttpSettings(()=>e.reset()),e}a(dKc,"createDefaultFetcher");var qxt=class extends ar{constructor(r,n=dKc(r),o=new pEe(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=qt(this.ctx,je.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(Cto.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new zFe(r,n,o,()=>{Cto.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(Mn).onDidSetCapabilities(this.updateFetcher),r.get(Zo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return qt(this.ctx,je.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(Mn).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var Hxt=ce(ti());var jxt=class extends sa{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(ur).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(Hxt.ShowMessageRequest.type,{type:Hxt.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}};p();var U_e=ce(Al());var fKc=new U_e.ProtocolNotificationType("copilot/customAgent/didChange"),pKc=new U_e.ProtocolNotificationType("copilot/customSkill/didChange"),hKc=new U_e.ProtocolNotificationType("copilot/customPrompt/didChange"),mKc=new U_e.ProtocolNotificationType("copilot/customInstruction/didChange"),gKc=new U_e.ProtocolNotificationType("copilot/hook/didChange");function AKc(t){switch(t){case"agent":return fKc;case"skill":return pKc;case"prompt":return hKc;case"instructions":return mKc;case"hook":return gKc;default:return}}a(AKc,"notificationTypeFor");var Gxt=class extends lA{constructor(r){super();this.ctx=r;this.logger=new ge("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=AKc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(ur).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};p();var vto=ce(Al());var $xt=class t extends UY{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new vto.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var bto=ce(Al());var Vxt=class t extends EQ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new bto.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(ur).connection.sendNotification(t.notificationType,r)}};p();var Sto=ce(Al());var yKc=new Sto.ProtocolNotificationType("$/copilot/rateLimitWarning"),Wxt=class extends IS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(ur).connection.sendNotification(yKc,r)}};p();p();var zxt=class extends nWe{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get(zD).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get(zD).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get(zD);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var Yxt=class extends qy{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new zxt(this.ctx,e)}shouldStartWatching(e){return!!this.ctx.get(Mn).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Kxt(t){let e=new Hv(process.env),r=ZXi(e);r.set(Hv,e),r.set(ar,new qxt(r)),r.set(rc,new rc(r)),J5r(r,{});let n=lZr();r.set(Si,n),r.set(Gg,new Gg(r));let o=new oxt;r.set(gh,o);let s=Ito.join(n.directory,$Hi),{repo:c,diagnostics:l}=KHi(s);r.set(MN,c),r.set(Ur,new FQe(r,process.env)),r.set(bT,new bT(r)),r.set(Ine,new Ine(r));let u=new Ih(r,"agent");u.onInitialized(()=>ZHi(r,l)),r.set(Ih,u),r.set(Fa,LHi),r.set(CI,new CI),r.set(Lr,new Rq),r.set(Nne,wHi()),r.set(vu,new vu),r.set(Fo,eto),r.set(aa,new XIt(r)),r.set(dX,new txt(r)),r.set(qy,new Yxt(r)),r.set(zD,new zD(r)),r.set(r0,new r0),r.set(n0,jat(r,lQi)),r.set(Cb,new Cb(r)),r.set(S5,new kpe),Deo(r),iWe(r),Ncn(r),r.set(ur,new ur(r,t)),r.set(eO,new ext(r)),r.set(sa,new jxt(r)),JHi(r,l),r.set(B_e,new Bxt(r)),r.set(LV,new Oxt(r)),r.set(N0,new iEe(r)),r.set(as,new Ext(r));let d=new UFe(r,t);r.set(UFe,d),r.set(uu,d),r.set(FFe,new FFe(r)),r.set(OFe,new OFe(r));let f=new uV(r);r.set(cn,f),r.set(uV,f),r.set(D0,new yEe(r,process.env)),r.set(ik,new fie),r.set(Cc,new Cc(r)),Weo(r),Reo(r),r.set(ZD,new ZD),r.set(iV,new iV),r.set(eN,new eN),r.set(oV,new oV([])),r.set(vT,new sxt),r.set(Tto.ObservableWorkspace,new WAe(r,!0,!0)),r.set(L5,new _Ee),r.set(B6,new B6),r.set(DC,new DC(r)),r.set(BA,new tvt(r)),r.set(v_,new yxt(r)),r.set(Md,new Axt(r)),r.set(zx,new zx(r)),r.set(us,new us(r)),r.set(F3,new F3(r)),r.set(Q3,new Q3(r)),r.set(qS,new qS(r)),r.set(OK,new OK(r)),r.set(bO,new bO),r.set(X0,new X0),r.set(tN,new tN(r)),r.set(jE,new Nxt(r)),r.set(d2,new Mxt(r)),r.set(N3,new N3(r)),r.set(fb,new vxt(r));let h=new Bj(r);r.set(Bj,h),r.set(n2,new n2(r,h)),r.set(pb,new pb(r,h,new Cxt(r))),r.set(IS,new Wxt(r)),r.set(gZ,new gZ),r.set(Sne,new Sne),r.set(e0,new ixt(r)),r.set(jC,new rxt(r)),r.set(EN,new EN(r));let m=new T_(r);r.set(T_,m),r.set(pf,new pf(r,m)),r.set(ag,new ag(r,m)),r.set(jp,new jp(r,m)),r.set(EA,new EA(r,e,m));let g=new YL(r,m,n);r.set(YL,g),r.get(S_).addListener(g.lifecycleListener);let A=new NFe;return r.set(NFe,A),r.set(lA,new Gxt(r)),r.set(zm,new zm(r,A)),r.set(Kx,new Kx),r.set(OP,new OP(r)),r.set(bq,new bq(r)),r.set(Ox,new $Q([new VQ,new WQ])),r.set(bne,new bne(r)),r.set(x_,new x_(r)),r.set(EQ,new Vxt(r)),r.set(UY,new $xt(r)),r.set(BF,new BF(r)),r.set(Us,new Us(r)),r.set(om,new om),r.set(zZ,new zZ(r)),r.set(UF,new UF(r,new RIt)),r.set(kc,new kc(r)),r.set(KM,new _xt(r)),r.set(JD,new JD(r)),r.set(BR,new BR(r.get(JD),r)),r.set(pO,new pO(r)),r.set(oI,new axt(r)),r.set(Uv,new Uv(r.get(BR),r.get(oI),r)),r.set(Xy,new Xy(r)),r}a(Kxt,"createLanguageServerContext");var _N=new ge("ACP");async function xto(t){let e=t.get(ss);_N.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(Hv).markReady(),t.get(Bp).githubAppId=Vse,CKc(t),_Kc(t),t.get(Mn).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Qt).primeToken()?_N.info(t,"Token primed successfully"):_N.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(Ih).initialize(!0),ipn()?await EKc(t):(gt(t,"acp.server.start",{acpPipeline:"internal"}),await wto(t))}a(xto,"startACPServer");async function wto(t){_N.info(t,"Starting ACP server with internal pipeline");let e=Q_e.Writable.toWeb(process.stdout),r=Q_e.Readable.toWeb(process.stdin),n=xwe(e,r),o=new wwe(s=>new $1t(s,t),n);o.signal.addEventListener("abort",()=>{_N.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(wto,"startACPServerInternal");async function EKc(t){_N.info(t,"Starting ACP server with CLI proxy"),gt(t,"acp.cli.discover");let e;try{e=await opn()}catch(u){let d=u instanceof Error?u.message:String(u);_N.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),gi(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await wto(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;_N.info(t,`Found Copilot CLI: ${r} v${e.version}`),gt(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new V1t(e,t),o=Q_e.Writable.toWeb(process.stdout),s=Q_e.Readable.toWeb(process.stdin),c=xwe(o,s),l=new wwe(u=>new z1t(u,t,n),c);l.signal.addEventListener("abort",()=>{_N.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(EKc,"startACPServerWithCLI");function _Kc(t){let e=t.get(us);e.registerTool(new Sq({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new Sq({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new Sq({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),_N.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(_Kc,"registerACPClientTools");function Rto(){let e=Kxt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new dV(e);return e.forceSet(v_,r),{ctx:e,acpToolInvoker:r}}a(Rto,"createACPContext");function CKc(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(_N.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),N9e(t,r))}a(CKc,"configureGitHubEnterpriseUrl");p();var D6r=require("events"),YFe=ce(require("fs"));LHe();var Zxt=ce(Al());p();var Pto=ce(require("fs")),Dto=ce(require("http")),q_e=ce(require("path"));var Jxt=class{constructor(e,r){this.port=e;let n;this.server=Dto.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{kto(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{kto(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;q_e.basename(__dirname)!=="debug"&&(c=q_e.dirname(__dirname)),n??=Pto.readFileSync(q_e.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function kto(t,e){t.write("data: "+e.toString().replace(/\n/g,` +\`\`\``}},ext="runtime-logs",XIt=class extends rg{static{a(this,"RuntimeLogsSkill")}constructor(e){super(ext,"The application runtime or debug logs, which are used to view output logs from the console. This is useful for debugging and troubleshooting runtime issues.","Reading runtime logs",()=>e,r=>new n6r(r))}};p();var txt=fe(fk());var rxt=class extends jh{constructor(r){super();this.ctx=r}static{a(this,"AgentConversationInspector")}shouldInspect(){return z8e(this.ctx)}get connection(){if(this.shouldInspect())return this.ctx.get(dr).connection}async inspectPrompt(r){return this.connection?.sendNotification(new txt.NotificationType("conversation/inspectPrompt"),r)}async inspectFetchResult(r){return this.connection?.sendNotification(new txt.NotificationType("conversation/inspectFetchResult"),r)}async documentDiff(r){return this.connection?.sendNotification(new txt.NotificationType("conversation/documentDiff"),r)}};p();var Neo=fe(Al());var CFe=class{constructor(e){this.ctx=e;this.notificationEndpoint="conversation/preconditionsNotification";e.get(MR).onChange(r=>{this.sendNotification(r)})}static{a(this,"PreconditionsNotifier")}sendNotification(e){return this.ctx.get(dr).connection.sendNotification(new Neo.NotificationType(this.notificationEndpoint),e)}};function Meo(t){UWc(t),QWc(t),Reo(t)}a(Meo,"activateConversationFeature");function UWc(t){t.set(Go,new Go(t)),t.set(ng,new ng),t.set(gA,new gA(t)),t.set(Yc,new rYe(t)),t.set(Y6,new Y6),t.set(vc,new vc(t)),t.set(MR,new MR(t)),t.set(CFe,new CFe(t)),t.set(Fa,new FHe(t,new LHe(t))),t.set(KD,new KD),t.set(jh,new rxt(t)),t.set(wk,new wk(t))}a(UWc,"registerContextDependencies");function QWc(t){let e=new Hh;e.registerSkill(new VJe(new $Je)),e.registerSkill(new cKe(new Dv(t,ZM,G_n))),e.registerSkill(new KYe(new Dv(t,Ck,U_n))),e.registerSkill(new YYe(new Dv(t,zy,F_n))),e.registerSkill(new lKe),e.registerSkill(new KIt),e.registerSkill(new JIt(new Dv(t,ZIt,keo))),e.registerSkill(new FKe(new Dv(t,rO,Zvn))),e.registerSkill(new KJe(new Dv(t,oq,nTn))),e.registerSkill(new XIt(new Dv(t,ext,Deo))),e.registerSkill(new zIt(new Dv(t,YIt,Peo))),e.registerSkill(new ZJe(new Dv(t,Rk,iTn))),e.registerSkill(new XJe(new Dv(t,EK,oTn))),t.set(Hh,e)}a(QWc,"registerSkills");p();var Oeo=fe(Al()),Beo=fe(fk());var nxt=class extends Dd{constructor(){super(...arguments);this.requestType=new Oeo.ProtocolRequestType("conversation/invokeClientToolConfirmation");this.typeCheck=Mu.Compile(dyn)}static{a(this,"AgentClientToolConfirmationInvoker")}async invokeClientToolConfirmation(r,n){let o=this.ctx.get(dr).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Beo.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool confirmation ${n.name}`,d),new Error(`Failed to invoke client tool confirmation ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool confirmation ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool confirmation ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new TA(this.typeCheck.Errors(s));return s}};p();var Leo=fe(Al()),Feo=fe(fk());var ixt=class extends v_{constructor(){super(...arguments);this.requestType=new Leo.ProtocolRequestType("conversation/invokeClientTool");this.typeCheck=Mu.Compile(uyn)}static{a(this,"AgentClientToolInvoker")}async invokeClientTool(r,n){let o=this.ctx.get(dr).connection,s;try{let c=await o.sendRequest(this.requestType,n),[l,u]=c;if(u){let d=new Feo.ResponseError(u.code,u.message,u.data);throw ot.error(this.ctx,`ResponseError while invoking client tool ${n.name}`,d),new Error(`Failed to invoke client tool ${n.name}: ${u.message}`)}s=l}catch(c){throw new Error(`Failed to invoke client tool ${n.name}: ${String(c)}`)}if(s==null)throw new Error(`Failed to invoke client tool ${n.name}: No result returned`);if(!this.typeCheck.Check(s))throw new TA(this.typeCheck.Errors(s));return this.transformToToolResult(s)}transformToToolResult(r){let n=r.content.map(o=>typeof o.value=="string"?new Rr(o.value):new YY(o.value));return new Br(n,r.status??"success")}};p();p();function Ueo(t,e,r){try{let n=t.get(Jt).javaContextProviderParams(r);if(n){let o=JSON.parse(n);for(let[s,c]of Object.entries(o))e.set(s,c)}}catch(n){return Dr.debug(t,"Failed to get the active Java experiments for the Context Provider API",n),!1}return!0}a(Ueo,"fillInJavaActiveExperiments");var i6r=fe(fk());var qWc={type:new i6r.NotificationType("featureFlagsNotification")},jWc={type:new i6r.NotificationType("copilot/didChangeFeatureFlags")},bFe=class{constructor(e){this.ctx=e;ys(e,r=>this.sendNotification(r))}static{a(this,"FeatureFlagsNotifier")}async sendNotification(e){let r=this.ctx,n=!1,o=!1,s=!1,c=!1,l=!1,u=r.get(Jt),d=await u.updateExPValuesAndAssignments(e);n=u.ideDataMigrationCompleted(d),o=u.appmodContextMenuEnabled(d),s=u.cliAsDefaultAgentProviderEnabled(d),c=acn(r,d),l=u.inlineChatUseCliEnabled(d);let f={};r.get(Jt).excludeRelatedFiles(d)&&(f.ExcludeRelatedFiles=!0);let h=Jlr(r,d);h.length>0&&(f.ExpContextProviders=h);let m=new Map;wYn(r,h,m,d),Gat(r,m,d),Ueo(r,m,d);for(let[y,E]of m.entries())f[y]=E;let g=r.get(On),A=r.get(dr).connection;if(g.getCapabilities().didChangeFeatureFlags)await A.sendNotification(jWc.type,{envelope:{...e.envelope,token:void 0,expires_at:void 0,refresh_in:void 0,user_notification:void 0,limited_user_quotas:void 0,limited_user_reset_date:void 0,error_details:void 0,organization_list:void 0,enterprise_list:void 0,endpoints:void 0},token:e.getTokenValues(),activeExps:f,byok:NQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l,copilot_plan:e.userInfo.copilotPlan});else{let y={rt:e.getTokenValue("rt")==="1",sn:e.getTokenValue("sn")==="1",chat:e.envelope.chat_enabled??!1,ic:e.envelope.chat_enabled??!1,pc:!0,ae:f,byok:NQ(e),data_migration_completed:n,appmod_context_menu_enabled:o,cli_as_default_agent_provider_enabled:s,ide_enable_copilot_nes_nonfree_enabled:c,inline_chat_use_cli_enabled:l};e.getTokenValue("agent_mode")==="0"&&(y.agent_mode=!1),e.getTokenValue("agent_mode_auto_approval")==="0"&&(y.agent_mode_auto_approval=!1),e.getTokenValue("mcp")==="0"&&(y.mcp=!1),e.envelope.chat_enabled&&(y.xc=!0),await A.sendNotification(qWc.type,y)}}};p();var oxt=class extends ss{constructor(r){super();this.ctx=r;this.notificationEndpoint="statusNotification"}static{a(this,"NotificationStatusReporter")}didChangeV1(r){let n=r.kind;r.busy&&n!=="Error"&&(n="InProgress"),this.ctx.get(dr).connection.sendNotification(KQt.type,{busy:r.busy,kind:r.kind,status:n,message:r.message??""}),this.ctx.get(dr).connection.sendNotification("didChangeStatus",{busy:r.busy,kind:r.kind,message:r.message,command:r.command})}didChangeV2(r){this.ctx.get(dr).connection.sendNotification(JQt.type,r)}};p();var Qeo=new Ae("AgentEncodingConfigurationService"),sxt=class extends YM{static{a(this,"AgentEncodingConfigurationService")}constructor(e){super(e),this.service=e.get(dr)}async requestEncodingFromClient(e){if(!this.service.clientCapabilities?.workspace?.configuration){Qeo.debug(this.ctx,"Client does not support workspace/configuration, using UTF-8 fallback");return}try{let o=(await this.service.connection.workspace.getConfiguration([{scopeUri:e,section:"copilot.file.encoding"}]))[0];return o&&["utf8","utf-8","utf16le","ucs2","ucs-2","base64","base64url","latin1","binary","hex","ascii"].includes(o)?o:void 0}catch(n){Qeo.debug(this.ctx,`Unable to request encoding for ${e}, using UTF-8 fallback`,n);return}}};p();var qeo=new rQ;p();var Geo=fe(ei());var $eo={"mcp.contributionPoint.enabled":{description:"Whether extension-contributed MCP servers are enabled",defaultValue:!0,type:"boolean"},"customAgent.enabled":{description:"Whether custom agent functionality is enabled",defaultValue:!0,type:"boolean"},"customHook.enabled":{description:"Whether custom hook functionality is enabled",defaultValue:!0,type:"boolean"},"customSkill.enabled":{description:"Whether custom skill functionality is enabled",defaultValue:!0,type:"boolean"},"subagent.enabled":{description:"Whether subagent functionality is enabled",defaultValue:!0,type:"boolean"},"autoModel.enabled":{description:"Whether auto model functionality is enabled",defaultValue:!0,type:"boolean"},"cveRemediatorAgent.enabled":{description:"Whether CVE remediator agent functionality is enabled",defaultValue:!0,type:"boolean"},"agentMode.autoApproval.enabled":{description:"Whether agent mode auto-approval is enabled",defaultValue:!0,type:"boolean"}},HWc=new Geo.NotificationType("policy/didChange"),GWc=Object.fromEntries(Object.entries($eo).map(([t,e])=>[t,{type:e.type}])),SFe=class extends lu{constructor(r,n){super();this.ctx=r;this.connection=n;this.disposed=!1;this.policyValues=new Map(Object.entries($eo).map(([r,n])=>[r,n.defaultValue]));let o=r.get(dr);o.onActivation(()=>{this.startWatching().catch(s=>{Dr.error(this.ctx,"Unexpected error starting policy watcher:",s)})}),o.onDeactivation(()=>{this.dispose()})}static{a(this,"GroupPolicyWatcher")}async startWatching(){try{let{createWatcher:r}=await Promise.resolve().then(()=>fe(Heo()));this.policyWatcher=r("IDEGitHubCopilot",GWc,n=>{this.handlePolicyUpdate(n).catch(o=>{Dr.error(this.ctx,"Error in handlePolicyUpdate:",o)})}),Dr.info(this.ctx,"Policy watcher started for GitHub Copilot Plugin")}catch(r){process.platform==="darwin"||process.platform==="win32"?Dr.exception(this.ctx,r,"Policy watcher failed to load on supported platform"):Dr.warn(this.ctx,"Policy watcher not available - continuing without policy watching:",r instanceof Error?r.message:String(r))}}async handlePolicyUpdate(r){Dr.debug(this.ctx,"GroupPolicyWatcher - policy update triggered",r);let n=!1;for(let[o,s]of Object.entries(r))if(s!==void 0){let c=o;this.policyValues.get(c)!==s&&(n=!0),this.policyValues.set(c,s),Dr.debug(this.ctx,`Policy change: ${o} = ${s}`)}n&&this.policyChangeEmitter.fire(void 0),this.policyValues.get("subagent.enabled")===!1&&this.ctx.get(On).setCapabilities({subAgent:!1}),this.policyValues.get("cveRemediatorAgent.enabled")===!1&&this.ctx.get(On).setCapabilities({cveRemediatorAgent:!1}),await this.sendPolicyChangeNotification()}getAllPolicyValues(){let r={};for(let[n,o]of this.policyValues.entries())r[n]=o;return r}getPolicyValue(r){return this.policyValues.get(r)}sendPolicyChangeNotification(){if(this.disposed)return Promise.resolve();let r=this.getAllPolicyValues();try{return this.connection.sendNotification(HWc,r)}catch{return Promise.resolve()}}dispose(){if(!this.disposed){if(this.disposed=!0,this.policyWatcher){try{this.policyWatcher.dispose()}catch(r){Dr.error(this.ctx,"Error disposing policy watcher:",r)}this.policyWatcher=void 0}Dr.debug(this.ctx,"Policy watcher stopped")}}};p();var axt=class{constructor(e){this.ctx=e}static{a(this,"McpServerManagerAdapter")}serversChanged(){this.ctx.get(dr).connection.sendNotification(xQi,{}).catch(()=>{})}serverDetailsChanged(e){this.ctx.get(dr).connection.sendNotification(wQi,{source:e.source,name:e.name}).catch(()=>{})}unregisterProvider(e){return this.ctx.get(gN).unregisterProvider(e)}};p();var cxt=class extends ub{static{a(this,"CLSMcpAuthServer")}constructor(e){super(),this.ctx=e}getAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);return this.ctx.get($g).get(n)}updateAccountPreference(e,r,n){let o=this._getAccountPreferenceKey(e,r);this.ctx.get($g).set(o,n.label)}removeAccountPreference(e,r){let n=this._getAccountPreferenceKey(e,r);this.ctx.get($g).delete(n)}_getAccountPreferenceKey(e,r){return`mcp-${e}-${r}`}};p();p();p();p();var Veo=fe(ei());var lxt="mcp.elicitation",uxt=class{constructor(){this.ongoingMcpElicitationCalls=!1;this.elicitationRequestType=new Veo.ProtocolRequestType("copilot/mcpElicitation")}static{a(this,"ElicitationHandler")}async handleRequest(e,r,n,o,s){if(this.ongoingMcpElicitationCalls)throw new Fn(Zn.InternalError,"Another MCP elicitation request is already in progress.");this.ongoingMcpElicitationCalls=!0;try{let c=n.params.message;if("url"in n.params)throw new Fn(Zn.InvalidRequest,"URL mode elicitation is not supported");let l=n.params.requestedSchema;or.info(e.ctx,`MCP server ${r} elicitation request received: ${c}`),await sc(e.ctx,{message:`MCP server ${r} elicitation request received: ${c}`,server:r});let d=await e.ctx.get(XM).sendRequest(this.elicitationRequestType,{mcpServer:r,message:c,requestedSchema:l,conversationId:e.conversation.id.toString(),roundId:o??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id.toString(),toolCallId:s??e.agentToolCalls.getRound(0).toolCalls[0].id});return yt(e.ctx,lxt,Vt.createAndMarkAsIssued()),_t(e.ctx,lxt),d}catch(c){let l=`Failed to process elicitation request: ${c instanceof Error?c.message:String(c)}`;throw or.error(e.ctx,l,c),await sm(e.ctx,{message:l,server:r}),La(e.ctx,c,lxt),si(e.ctx,lxt,c),new Fn(Zn.InternalError,l)}finally{this.ongoingMcpElicitationCalls=!1}}};p();p();p();var ZR=class{static{a(this,"MCPNotificationHandler")}constructor(e,r){this.ctx=e,this.serverName=r}};var TFe=class extends ZR{static{a(this,"LoggingMessageNotificationHandler")}constructor(e,r){super(e,r)}handle(e){let r=typeof e.params.data=="string"?e.params.data:JSON.stringify(e.params.data);switch(e.params.logger&&(r=`${e.params.logger}: ${r}`),e.params?.level){case"debug":case"info":case"notice":or.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"warning":or.warn(this.ctx,`MCP server ${this.serverName} log:`,r),MZ(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;case"error":case"critical":case"alert":case"emergency":or.error(this.ctx,`MCP server ${this.serverName} log:`,r),sm(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break;default:or.info(this.ctx,`MCP server ${this.serverName} log:`,r),sc(this.ctx,{message:`Notification message: ${r}`,server:this.serverName});break}}};p();var IFe=class extends ZR{static{a(this,"PromptListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Prompts list changed, refreshing prompts..."),sc(this.ctx,{message:"Prompts list changed, refreshing prompts...",server:this.serverName}),this.emitter.emit(Ibt)}};p();var xFe=class extends ZR{static{a(this,"ResourceListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Resource list changed, refreshing resources..."),sc(this.ctx,{message:"Resource list changed, refreshing resources...",server:this.serverName}),this.emitter.emit(Tbt)}};p();var wFe=class extends ZR{static{a(this,"ResourceUpdatedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,`Resource updated for URI: ${e.params.uri}`),sc(this.ctx,{message:`Resource updated: ${e.params.uri}`,server:this.serverName}),this.emitter.emit(I7i)}};p();var dxt=class{static{a(this,"MCPRequestHandler")}constructor(e,r){this.ctx=e,this.serverName=r}},RFe=class extends dxt{static{a(this,"ListRootsRequestHandler")}constructor(e,r){super(e,r)}handle(e){or.info(this.ctx,`MCP server ${this.serverName} requested roots list`);let r=[];try{(this.ctx.get(an).getWorkspaceFolders()||[]).forEach(o=>{r.push(o)}),sc(this.ctx,{message:`Requested roots list and found ${r.length} root(s).`,server:this.serverName})}catch(n){or.error(this.ctx,`Error getting workspace folders for MCP server ${this.serverName}:`,n),sm(this.ctx,{message:`Error getting workspace folders for MCP server ${this.serverName}: ${n instanceof Error?n.message:String(n)}`,server:this.serverName})}return{roots:r}}};p();var PFe=class extends ZR{static{a(this,"ToolListChangedNotificationHandler")}constructor(e,r,n){super(e,r),this.emitter=n}handle(e){or.info(this.ctx,"Tool list changed, refreshing tools..."),sc(this.ctx,{message:"Tool list changed, refreshing tools...",server:this.serverName}),this.emitter.emit(Sbt)}};p();var Weo="mcp.sampling",fxt=class{constructor(){this.defaultTemperature=.7;this.ongoingMcpSamplingCalls=!1}static{a(this,"McpSamplingService")}async handleSamplingRequest(e,r,n,o,s,c){try{if(this.ongoingMcpSamplingCalls)throw new Fn(Zn.InternalError,"Another MCP sampling request is already in progress.");this.ongoingMcpSamplingCalls=!0,or.info(e.ctx,`MCP server ${o} requested sampling:`,n.params),await sc(e.ctx,{message:`Sampling request received from ${o}: ${JSON.stringify({messageCount:n.params.messages.length,systemPrompt:n.params.systemPrompt?"provided":"none",maxTokens:n.params.maxTokens,temperature:n.params.temperature})}`,server:o});let l=await e.ctx.get(IV).readMcpSamplingConfig({serverName:o});if(l.alwaysDeny)throw new Error("User has chosen to always deny MCP tools with this mcp server.");if(!l.alwaysAllow){let y=n.params.messages.filter(v=>v.role==="user"),E=y[y.length-1];if((await e.ctx.get(Dd).invokeClientToolConfirmation(e,{name:o,title:`Allow MCP tools from "${o}" to make LLM requests?`,message:`The MCP server "${o}" has issued a request to make a language model call. Do you want to allow it to make requests during chat?`,input:{...E,toolType:"mcp_tool",mcpType:"sampling",mcpServerName:o},conversationId:e.conversation.id,roundId:s??e.agentToolCalls.getRound(0).roundId,turnId:e.turn.id,toolCallId:c??e.agentToolCalls.getRound(0).toolCalls[0].id})).result==="dismiss")throw new Dc}let u=await this.getModelConfiguration(e.ctx,n,l),d=this.convertMCPMessagesToChatML(e.ctx,n.params.messages,n.params.systemPrompt),f=(await sIe(e.ctx,e.turn.telemetryId,e.conversation.telemetryId)).extendedBy({messageSource:"mcp.sampling"}),m=new jn.CancellationTokenSource().token,g=await r.fetchResponse({modelConfiguration:u,messages:d,uiKind:"conversationPanel",llmInteraction:e.toLlmInteraction(),temperature:n.params.temperature??this.defaultTemperature,stop:n.params.stopSequences,turnId:String(e.turn.id)},m,f),A=this.processFetchResult(g,u.uiName);return _t(e.ctx,Weo,{userPreference:l.alwaysAllow?"autoApprove":l.alwaysDeny?"autoDeny":"none",selectedModel:u.uiName,success:"true"}),A}catch(l){let u=`Failed to process sampling request: ${l instanceof Error?l.message:String(l)}`;throw or.error(e.ctx,u,l),await sm(e.ctx,{message:u,server:o}),_t(e.ctx,Weo,{success:"false",errorMessage:u}),new Fn(Zn.InternalError,u)}finally{this.ongoingMcpSamplingCalls=!1}}convertMCPMessagesToChatML(e,r,n){let o=[];n&&o.push({role:"system",content:n});for(let s of r){let c,l=Array.isArray(s.content)?s.content[0]:s.content;if(!l){or.warn(e,"Empty content in MCP message, skipping");continue}if(l.type==="text")c=l.text;else if(l.type==="image")c=[{type:"image_url",image_url:{url:atob(l.data)}}];else throw or.warn(e,`Unknown MCP content type: ${l.type}, defaulting to empty array`),new Error(`Unknown MCP content type: ${l.type}`);let u;switch(s.role){case"user":u="user";break;case"assistant":u="assistant";break;default:u="user",or.warn(e,`Unknown MCP role: ${s.role}, defaulting to user`)}o.push({role:u,content:c})}return o}processFetchResult(e,r){if(e.type!=="success"){let n=`Unexpected fetch result type: ${e.type}.`;throw"reason"in e&&(n+=` Reason: ${e.reason}`),new Error(n)}return{model:r,role:"assistant",content:{type:"text",text:e.value}}}async getModelConfiguration(e,r,n){let o=await this.getAvailableBYOKModels(e),s=[...await this.getAvailableModels(e),...o.map(d=>d.name)];if(!s)throw new Error("No available models found");let c=n.allowedModels&&n.allowedModels.length>0?s.filter(d=>n.allowedModels.some(f=>f.toLowerCase()===d.toLowerCase())):s;if(!c||c.length===0)throw new Error("No available models found");let l;r.params.modelPreferences?.hints&&(l=this.mapFindFirst(r.params.modelPreferences.hints,d=>c.find(f=>f.toLowerCase().includes(d.name.toLowerCase())))),l=l??c[0];let u=o.find(d=>d.name===l);return u?HM(e,u.provider,l):await e.get(Yc).getBestChatModelConfig([l])}async getAvailableModels(e){return(await e.get(Fa).getMetadata()).filter(n=>n.capabilities.type&&!Gae.has(n.capabilities.family)&&n.capabilities.supports?.tool_calls&&(n.capabilities.limits?.max_prompt_tokens??!1)).map(n=>n.capabilities.family)}async getAvailableBYOKModels(e){return(await new Cc(e.get(yi)).getAllModels(e)).filter(n=>n.capabilities?.toolCalling)}mapFindFirst(e,r){for(let n of e){let o=r(n);if(o!==void 0)return o}}};p();var I_e=class extends Error{constructor(r,n){super(r);this.challengeInfo=n;this.name="ScopeChallengeError"}static{a(this,"ScopeChallengeError")}};function zeo(t,e){if(t!==403||!e)return null;let{scheme:r,params:n}=yat(e);if(r!=="Bearer"||n.error!=="insufficient_scope")return null;let o=n.scope;if(!o)return null;let s=o.split(" ").filter(c=>c.length>0);return{error:n.error,requiredScopes:s,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}a(zeo,"parseScopeChallenge");p();var s6r=/[^a-z0-9_-]/gi;var $Wc=process.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function Yeo(){let t={};for(let e of $Wc){let r=process.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}a(Yeo,"getDefaultEnvironment");async function Keo(t,e,r){if(!e.description){let n=`Tool ${e.name} does not have a description. Tools must be accurately described to be called.`;or.warn(t,n),await MZ(t,{message:n,server:r,tool:e.name}),e.description=""}if(s6r.lastIndex=0,s6r.test(e.name)){let n=`Tool ${e.name} is invalid. Tools names may only contain [a-zA-Z0-9_-]`;or.warn(t,n),await MZ(t,{message:n,server:r,tool:e.name}),e._nameForModel=e.name.replace(s6r,"_")}else e._nameForModel=e.name;return e}a(Keo,"normalizeTool");var pxt=class{constructor(){this.seenPrefixes=new Set}static{a(this,"McpPrefixGenerator")}generate(e){let r="mcp_"+e.toLowerCase().replace(/[^a-z0-9_.-]+/g,"_").slice(0,13),n=r;for(let o=2;this.seenPrefixes.has(n);o++)n=r+o;return this.seenPrefixes.add(n),n}};p();async function*a6r(t,e,r){let n;do{let o=await t(n),s=e(o);s.length>0&&(yield s),n=r(o)}while(n!==void 0)}a(a6r,"paginateRequest");async function c6r(t){let e=[];for await(let r of t)e.push(...r);return e}a(c6r,"flattenAsyncIterable");var Jeo=fe(require("events"));var l6r=6e4,xV=class{constructor(e,r,n){this.transport=null;this.emitter=new Jeo.default;this.ongoingMcpToolCalls=[];this.isSamplingEnabled=!1;this.isElicitationEnabled=!1;this.cachedTools=[];this.cachedResources=[];this.cachedResourceTemplates=[];this.cachedPrompts=[];this.ctx=e;let o=e.get(On);this.isSamplingEnabled=o.getCapabilities().mcpSampling,this.isSamplingEnabled&&(this.samplingService=new fxt),this.isElicitationEnabled=o.getCapabilities().mcpElicitation,this.isElicitationEnabled&&(this.elicitationHandler=new uxt);let s=this.ctx.get(Nr).getEditorInfo(),c=this.ctx.get(Nr).getEditorPluginInfo();this.mcp=new jj({name:`${s.name}/${c.name}`,version:`${s.version}/${c.version}`},{capabilities:{roots:{listChanged:!0},...this.isSamplingEnabled?{sampling:{}}:{},...this.isElicitationEnabled?{elicitation:{}}:{}}}),this.name=r}static{a(this,"MCPBaseServer")}get isConnected(){return this.transport!==null}async connect(e){if(this.transport=this.initTransport(e),!this.transport){let r=new Error("Failed to initialize transport");throw or.error(this.ctx,"Transport initialization failed:",r),r}this.addListeners();try{await this.mcp.connect(this.transport),this.initializeCache()}catch(r){throw or.error(this.ctx,"Connection failed:",r),await sm(this.ctx,{message:`Failed to connect to MCP server: ${r instanceof Error?r.message:String(r)}`,server:this.name}),this.transport=null,r}}async initializeCache(){await Promise.all([this.refreshToolsCache(!0),this.refreshResourcesCache(!0),this.refreshPromptsCache(!0)]),this.emitter.emit($$)}getCachedTools(){return this.cachedTools}getCachedResources(){return this.cachedResources}getCachedResourceTemplates(){return this.cachedResourceTemplates}getCachedPrompts(){return this.cachedPrompts}restoreCacheFromPersistence(e){this.cachedTools=[...e.tools],this.cachedResources=[...e.resources],this.cachedResourceTemplates=[...e.resourceTemplates],this.cachedPrompts=[...e.prompts]}async createMcpTool(e,r){let n={name:e.name,description:e.description,inputSchema:{...e.inputSchema||{},properties:e.inputSchema?.properties||{},type:e.inputSchema?.type||"object"},_status:r??"enabled",_nameForModel:e.name,annotations:e.annotations};return await Keo(this.ctx,n,this.name),n}async handleMCPOperationError(e,r,n){try{return await e()}catch(o){let s=o;if(s instanceof I_e){let l=`OAuth scope challenge during ${r} from server ${this.name}. Required scopes: ${s.challengeInfo.requiredScopes.join(", ")}`;if(n.scopeChallengeHandler)return n.scopeChallengeHandler(s.challengeInfo.requiredScopes);if(or.info(this.ctx,l),await sm(this.ctx,{message:l,server:this.name}),n.errorHandler)return n.errorHandler(l);if("defaultValue"in n)return n.defaultValue;throw s}if(s.code===Zn.MethodNotFound){if(or.info(this.ctx,`${r} not supported by server ${this.name}:`,s.message),"methodNotFoundValue"in n)return n.methodNotFoundValue;if(n.errorHandler)return n.errorHandler("Method not found");if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}let c=`Failed to ${r} from server ${this.name}: ${s.message||String(s)}`;if(or.error(this.ctx,c),await sm(this.ctx,{message:c,server:this.name}),n.errorHandler)return n.errorHandler(c);if("defaultValue"in n)return n.defaultValue;throw new Error("No default value or error handler provided")}}async*getResourcesIterable(e){if(!this.transport)return;let r=a6r(n=>this.mcp.listResources({cursor:n},{signal:e}),n=>n.resources,n=>n.nextCursor);for await(let n of r)yield n}async getResources(e){return await this.handleMCPOperationError(async()=>{let r=await c6r(this.getResourcesIterable(e));return sc(this.ctx,{message:`Discovered ${r.length} resources`,server:this.name}),r},"get resources",{defaultValue:[]})}async*getResourceTemplatesIterable(e){if(!this.transport)return;let r=a6r(n=>this.mcp.listResourceTemplates({cursor:n},{signal:e}),n=>n.resourceTemplates,n=>n.nextCursor);for await(let n of r)yield n}async getResourceTemplates(e){return await this.handleMCPOperationError(async()=>{let r=await c6r(this.getResourceTemplatesIterable(e));return sc(this.ctx,{message:`Discovered ${r.length} resource templates`,server:this.name}),r},"get resource templates",{defaultValue:[]})}async readResource(e){return this.transport?await this.handleMCPOperationError(async()=>await this.mcp.readResource({uri:e}),`read resource ${e}`,{defaultValue:null,methodNotFoundValue:{contents:[]}}):null}async subscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.subscribeResource({uri:e})},`subscribe resource ${e}`,{defaultValue:void 0})}async unsubscribeResource(e){this.transport&&await this.handleMCPOperationError(async()=>{await this.mcp.unsubscribeResource({uri:e})},`unsubscribe resource ${e}`,{defaultValue:void 0})}async callTool(e,r,n,o,s,c){let l=UK();this.ongoingMcpToolCalls.push({requestId:l,toolName:e,turnContext:o,roundId:s,toolCallId:c});let u=a(d=>{let f=new Br([],"error");return f.content.push(new Rr(d)),f},"createErrorResult");try{return await this.handleMCPOperationError(async()=>{let d=new AbortController;n.onCancellationRequested(()=>{d.abort()});let f=await this.mcp.callTool({name:e,arguments:r,_meta:{progressToken:l}},Pj,{onprogress:a(m=>{or.info(this.ctx,`${e} calling progress`,m),sc(this.ctx,{message:`${e} calling progress:`+JSON.stringify(m),server:this.name})},"onprogress"),resetTimeoutOnProgress:!0,signal:d.signal});if(f&&typeof f=="object"){if(f.content||f.structuredContent)return this.formatToolResult(f);let m=`Error calling tool ${e}: `+JSON.stringify(f);return or.error(this.ctx,m),await sm(this.ctx,{message:m,server:this.name,tool:e}),u(m)}let h=`Error calling tool ${e}: `+JSON.stringify(f);return or.error(this.ctx,h),await sm(this.ctx,{message:h,server:this.name,tool:e}),u(h)},`call tool ${e}`,{errorHandler:u})}finally{this.ongoingMcpToolCalls=this.ongoingMcpToolCalls.filter(d=>d.requestId!==l)}}async getPrompt(e,r){return(await this.mcp.getPrompt({name:e,arguments:r})).messages}async completePrompt(e,r,n,o){return(await this.mcp.complete({ref:{type:"ref/prompt",name:e},argument:{name:r,value:n},context:{arguments:o}})).completion.values}addListeners(){this.mcp.onclose=()=>{or.info(this.ctx,`MCP server ${this.name} connection closed.`),sc(this.ctx,{message:"Connection state: Stopped",server:this.name})},this.mcp.onerror=e=>{or.error(this.ctx,`MCP server ${this.name} error:`,e),sm(this.ctx,{message:`Connection state: Error: ${e.message}`,server:this.name})},this.mcp.setNotificationHandler(mZ,e=>new TFe(this.ctx,this.name).handle(e)),this.mcp.setNotificationHandler(bF,e=>new PFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(CF,e=>new IFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(vF,e=>new xFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setNotificationHandler(Osr,e=>new wFe(this.ctx,this.name,this.emitter).handle(e)),this.mcp.setRequestHandler(Wsr,e=>(this.initRootsTracker(),new RFe(this.ctx,this.name).handle(e))),this.isSamplingEnabled&&this.mcp.setRequestHandler(ake,async(e,r)=>{if(!this.samplingService){let o="Sampling is not enabled.";throw or.error(this.ctx,o),new Fn(Zn.InternalError,o)}if(this.ongoingMcpToolCalls.length===0){let o="No ongoing tool call context found for sampling request.";throw or.error(this.ctx,o),new Fn(Zn.InternalError,o)}let n=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return await this.samplingService.handleSamplingRequest(n.turnContext,new rc(this.ctx),e,this.name,n.roundId,n.toolCallId)}),this.isElicitationEnabled&&this.mcp.setRequestHandler(cke,async e=>{if(this.ongoingMcpToolCalls.length===0){let n="No ongoing tool call context found for elicitation request.";throw or.error(this.ctx,n),new Fn(Zn.InternalError,n)}let r=this.ongoingMcpToolCalls[this.ongoingMcpToolCalls.length-1];return this.elicitationHandler.handleRequest(r.turnContext,this.name,e,r.roundId,r.toolCallId)}),this.setupDataRefreshListeners()}setupDataRefreshListeners(){this.emitter.on(Sbt,()=>{this.refreshToolsCache()}),this.emitter.on(Tbt,()=>{this.refreshResourcesCache()}),this.emitter.on(Ibt,()=>{this.refreshPromptsCache()})}async refreshToolsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(l6r),n=await this.mcp.listTools({},{signal:r}),o=new Map(this.cachedTools.map(s=>[s.name,s._status]));this.cachedTools=await Promise.all(n.tools.map(s=>this.createMcpTool(s,o.get(s.name)))),or.info(this.ctx,`Refreshed ${this.cachedTools.length} tools for server ${this.name}`),e||this.emitter.emit($$)},"refresh tools",{defaultValue:void 0})}async refreshResourcesCache(e=!1){if(this.transport)try{let r=AbortSignal.timeout(l6r),[n,o]=await Promise.all([this.getResources(r),this.getResourceTemplates(r)]);this.cachedResources=n,this.cachedResourceTemplates=o,or.info(this.ctx,`Refreshed ${this.cachedResources.length} resources and ${this.cachedResourceTemplates.length} templates for server ${this.name}`),e||this.emitter.emit($$)}catch(r){or.error(this.ctx,`Failed to refresh resources cache for ${this.name}:`,r)}}async refreshPromptsCache(e=!1){this.transport&&await this.handleMCPOperationError(async()=>{let r=AbortSignal.timeout(l6r),n=await this.mcp.listPrompts({},{signal:r});this.cachedPrompts=n.prompts,or.info(this.ctx,`Refreshed ${this.cachedPrompts.length} prompts for server ${this.name}`),e||this.emitter.emit($$)},"refresh prompts",{defaultValue:void 0})}formatToolResult(e){let r=new Br([],e.isError===!0?"error":"success");for(let n of e.content??[])if(n.type==="text")r.content.push(new Rr(n.text));else if(n.type==="image"||n.type==="audio")r.content.push(new RQ({mimeType:n.mimeType,data:n.data}));else if(n.type==="resource"){let o=n.resource;if("text"in o)r.content.push(new Rr(o.text));else if("blob"in o){let s=o.mimeType||"application/octet-stream";r.content.push(new RQ({mimeType:s,data:o.blob}))}}return e.structuredContent&&r.content.push(new Rr(JSON.stringify(e.structuredContent))),r}initRootsTracker(){let e=this.ctx.get(an);this.rootsTracker=e.onDidChangeWorkspaceFolders(r=>{this.mcp.sendRootsListChanged().then(()=>{this.rootsTracker?.dispose()})})}getEmitter(){return this.emitter}async cleanup(){this.transport&&(await this.mcp.close(),this.mcp.transport&&this.mcp.transport.onclose?.(),this.rootsTracker?.dispose(),this.transport=null)}};p();function VWc(t){return a(async(r,n)=>{let o=r instanceof URL?r.toString():r,s;if(n?.headers)if(n.headers instanceof Headers){s={};for(let[f,h]of n.headers.entries())s[f]=h}else if(Array.isArray(n.headers)){s={};for(let[f,h]of n.headers)s[f]=h}else s=n.headers;let c={method:n?.method||"GET",headers:s,body:n?.body,signal:n?.signal||void 0},l=await t.fetch(o,c);if(l.status===403){let f=l.headers.get("WWW-Authenticate"),h=zeo(l.status,f);if(h){let m=h.errorDescription||"Insufficient scope for this operation";throw new I_e(m,h)}}let u=l.body(),d=null;if(u)d=new ReadableStream({start(f){let h=a(y=>{f.enqueue(new Uint8Array(y))},"onData"),m=a(()=>{f.close(),A()},"onEnd"),g=a(y=>{f.error(y),A()},"onError"),A=a(()=>{u.off("data",h),u.off("end",m),u.off("error",g)},"cleanup");u.on("data",h),u.on("end",m),u.on("error",g)},cancel(){u&&"destroy"in u&&typeof u.destroy=="function"&&u.destroy()}});else{let f=await l.text();d=new ReadableStream({start(h){h.enqueue(new TextEncoder().encode(f)),h.close()}})}return new globalThis.Response(d,{status:l.status,statusText:l.statusText,headers:new Headers(l.headers)})},"fetchLike")}a(VWc,"createFetchAdapter");function hxt(t,e){let r=t.get(cr),n=VWc(r);return{...e,fetch:n}}a(hxt,"createConfigWithFetch");var mxt=class extends xV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPSSEServer")}initTransport(r){let n=hxt(this.ctx,r),{url:o,...s}=n;return new hpe(new URL(o),s)}};p();var Zeo=require("child_process"),Xeo=require("util");var gxt=class extends xV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStdioServer")}initTransport(r){return r.env={...Yeo(),...r.env||{}},r.stderr="pipe",new _pe(r)}addListeners(){super.addListeners(),this.transport&&this.transport.stderr&&this.transport.stderr.on("data",r=>{MZ(this.ctx,{message:`[server stderr] ${r.toString().trimEnd()}`,server:this.name})})}async cleanup(){if(this.transport){if(process.platform==="win32"){let r=null;"pid"in this.transport&&typeof this.transport.pid=="number"&&(r=this.transport.pid),r&&await this.forceKillWindowsProcess(r)}await super.cleanup()}}async forceKillWindowsProcess(r){try{let n=(0,Xeo.promisify)(Zeo.exec);or.info(this.ctx,`Force killing Windows process with PID ${r} for MCP server ${this.name}`),sc(this.ctx,{message:`Force killing Windows process with PID ${r}`,server:this.name}),await n(`taskkill /pid ${r} /t /f`,{timeout:1e4}),or.info(this.ctx,`Successfully force killed process ${r}`)}catch(n){or.debug(this.ctx,`Failed to kill process ${r} (process may not exist):`,n),sm(this.ctx,{message:`Failed to kill process ${r} (process may not exist): ${n instanceof Error?n.message:String(n)}`,server:this.name})}}};p();var kFe=class extends xV{constructor(r,n,o){super(r,n,o);this.transport=null}static{a(this,"MCPStreamableServer")}initTransport(r){let n=hxt(this.ctx,r),{url:o,...s}=n;return new mpe(new URL(o),s)}};p();var Axt=class extends wQ{static{a(this,"McpLanguageModelTool")}constructor(e,r){super({...e,toolProvider:{id:e.serverName,displayNamePrefix:e.serverNamePrefix,displayName:e.serverName,description:e.serverName,isFirstPartyTool:!1},type:"mcp"}),this.invoker=r}prepareInvocation(e,r){let n={title:`Confirm MCP Tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,message:`Do you want to allow the external MCP tool "${this.toolProvider.displayName}/${this.displayName}" to run?`};return{progressMessage:`Running MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`,confirmationMessages:n}}prepareCompletion(e,r){return{completionMessage:`Ran MCP tool: ${this.displayName} - ${this.toolProvider.displayName}(MCP Server)`}}async invoke(e,r,n){return await this.invoker(e,r,r.input,n)}async invokeConfirmation(e,r,n){if(n.isCancellationRequested)throw new Dc;let o={name:this.name,title:r.title,message:r.message,input:r.input,conversationId:e.conversation.id,turnId:e.turn.id,roundId:r.roundId,toolCallId:r.toolCallId,annotations:r.annotations};try{return await e.ctx.get(Dd).invokeClientToolConfirmation(e,o)}catch(s){throw new Error(`Failed to invoke client tool confirmation ${this.name}: ${String(s)}`)}}};var nto=fe(Al());p();var eto="mcp-servers-cache",tto="mcp-first-boot-completed",yxt=class{static{a(this,"McpServerMetadataCache")}constructor(e){this.stateDb=e.get($g),this.initPromise=this.initialize()}async initialize(){await this.stateDb.waitForInitialization()}async isFirstBoot(){return await this.initPromise,this.stateDb.get(tto)!=="true"}async markFirstBootCompleted(){await this.initPromise,this.stateDb.set(tto,"true")}parseCache(){let e=this.stateDb.get(eto);if(!e)return{};try{return JSON.parse(e)}catch{return{}}}async get(e){return await this.initPromise,this.parseCache()[e]}async store(e){await this.initPromise,this.stateDb.set(eto,e)}};p();function rto(t){let e=t.get(Nr).getEditorPluginInfo();if(e.name==="copilot-intellij"){let r=e.version.endsWith("nightly"),n=e.version==="42.0.0.0";return r||n}if(e.name==="copilot-xcode"){let r=e.version.split(".");if(r.length>=3){let[n,o,s]=r;return n==="0"&&o==="0"&&s==="0"||n==="0"&&s!=="0"}}if(e.name==="copilot-eclipse"){let r=e.version.endsWith("nightly"),n=e.version.endsWith("qualifier");return r||n}return!1}a(rto,"isNightlyOrDevBuild");var Ext=class t extends UE{constructor(r){super();this.MCPServersMap=new Map;this.updateServersQueue=Promise.resolve();this.serverOperationSequencer=new qM;this.prefixGenerator=new pxt;this.serverPrefixes=new Map;this.isMcpEnabled=!1;this.previousMcpAllowlist=!1;this.storedMCPServersConfig={};this.ctx=r,this.cache=new yxt(r),this.registryService=r.get(ZD),ys(this.ctx,async n=>{let o=this.isMcpEnabled;this.isMcpEnabled=this.isTokenMcpEnabled(n),o!==this.isMcpEnabled&&(or.info(this.ctx,`MCP state changed from ${o} to ${this.isMcpEnabled}`),this.registryService.clearAllCaches(),this.isMcpEnabled?await this.updateMCPServers(this.storedMCPServersConfig):(or.info(this.ctx,"MCP is disabled, clearing all servers and tools"),this.clearAllServers()))}),this.ctx.get(On).onDidSetCapabilities(n=>{let o=n.mcpAllowlist;o!==this.previousMcpAllowlist&&(this.previousMcpAllowlist=o,this.registryService.clearAllCaches(),this.isMcpEnabled&&(or.info(this.ctx,`mcpAllowlist changed to ${o}, updating MCP servers`),this.updateMCPServers(this.storedMCPServersConfig)))})}static{a(this,"CLSMCPManager")}static{this.contentsNotificationType=new nto.ProtocolNotificationType("copilot/mcpTools")}isTokenMcpEnabled(r){if(!r)return!0;try{return r.getTokenValue("mcp")!=="0"}catch(n){return or.warn(this.ctx,`Error reading MCP value from token: ${n instanceof Error?n.message:String(n)}`),!0}}isAllowlistFeatureEnabled(){if(this.ctx.get(On).getCapabilities().mcpAllowlist)return or.debug(this.ctx,"Allowlist feature enabled via copilotCapabilities.mcpAllowlist"),!0;let n=rto(this.ctx);return n||or.debug(this.ctx,"Allowlist feature disabled for stable version, only enabled for nightly/prerelease/dev (use copilotCapabilities.mcpAllowlist to override)"),n}ensureMcpEnabledOrThrow(r){if(!this.isMcpEnabled)throw new Error(`MCP is disabled, cannot ${r}`)}getActiveServerEntry(r){let n=this.MCPServersMap.get(r);if(!n)throw new Error(`MCP server ${r} does not exist`);if(n.isBlocked)throw new Error(`MCP server ${r} is blocked by registry`);return n}async ensureServerConnection(r,n,o){return n.server.isConnected?n.server:(or.info(this.ctx,`Auto-starting MCP server ${r} for ${o}`),await this.startMCPServer(r),this.getActiveServerEntry(r).server)}async updateMCPServers(r){let n=this.storedMCPServersConfig;if(this.storedMCPServersConfig=r,!this.isMcpEnabled)return;let o=this.ctx.get(On).getCapabilities().mcpServerManagement??!1,s=new Set(Object.keys(r)),c=new Set(this.MCPServersMap.keys()),l=[...c].filter(m=>!s.has(m)),u=new Set([...s].filter(m=>c.has(m)&&!this.areServerConfigsEqual(n[m],r[m]))),d=new Set;for(let m of u){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(g.server.isConnected||g.hasError)&&d.add(m)}let f=[...l,...u];for(let m of f){let g=this.MCPServersMap.get(m);g&&!g.isBlocked&&(this.unregisterServerTools(m),await this.stopMCPServer(m)),u.has(m)||(this.removeServerAccountPreferences(m),this.serverPrefixes.delete(m)),this.MCPServersMap.delete(m)}f.length>0&&await this.persistAllServersCache();for(let m of s)this.MCPServersMap.has(m)||await this.upsertServerDefinition(m,r[m]);if(await this.cache.isFirstBoot()||!o){if(await this.cache.markFirstBootCompleted(),s.size>0){let m=Array.from(s).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),or.warn(this.ctx,`Failed to auto-start MCP server ${g} during first boot:`,A)}});await Promise.allSettled(m)}}else if(d.size>0){let m=Array.from(d).map(async g=>{try{await this.startServer(g);let A=this.MCPServersMap.get(g);A&&!A.isBlocked&&(A.hasError=!1,A.errorMessage=void 0,A.isStarting=!1)}catch(A){let y=this.MCPServersMap.get(g);y&&!y.isBlocked&&(y.hasError=!0,y.errorMessage=A instanceof Error?A.message:String(A),y.isStarting=!1),or.warn(this.ctx,`Failed to restart MCP server ${g} after config update:`,A)}});await Promise.allSettled(m)}await this.updateServersList()}areServerConfigsEqual(r,n){return this.stableStringify(r)===this.stableStringify(n)}stableStringify(r){if(Array.isArray(r))return`[${r.map(n=>this.stableStringify(n)).join(",")}]`;if(r&&typeof r=="object"){let n=r;return`{${Object.keys(n).sort().map(s=>`${JSON.stringify(s)}:${this.stableStringify(n[s])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}async upsertServerDefinition(r,n){let o=this.toManagedServerDefinition(r,n),s=this.MCPServersMap.get(r);if(this.isAllowlistFeatureEnabled()){let c=await this.registryService.validateServerConfig(r,n),{registryInfo:l,isBlocked:u,blockReason:d}=c;u?(this.addBlockedServer(o),or.info(this.ctx,`MCP server ${r} is blocked: ${d}`)):s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o),l&&this.updateRegistryInfo(r,l);return}s&&!s.isBlocked?await this.updateServerDefinition(s,o):await this.addServer(o)}toManagedServerDefinition(r,n){let o=n.type,s="command"in n?"stdio":o??"streamable";return{...n,name:r,type:s}}addBlockedServer(r){this.MCPServersMap.set(r.name,{server:null,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!0,authInfo:void 0})}updateRegistryInfo(r,n){let o=this.MCPServersMap.get(r);o&&(o.registryInfo=n)}getAllContents(r){return this.isMcpEnabled?this.getAllMCPServerCapabilities(r):[]}getAllMCPServerCapabilities(r){let n=[];for(let[o,s]of this.MCPServersMap)try{let c=this.createServerSnapshot(o,s);n.push(c)}catch(c){let l=`Failed to create snapshot for MCP server ${o}.`+(c instanceof Error?` message: ${c.message}`:` ${String(c)}`);or.error(this.ctx,l);let u={name:o,prefix:this.getServerPrefix(o),status:"error",tools:[],resources:[],resourceTemplates:[],prompts:[],error:l};n.push(u)}return r&&!r.isBuiltIn&&r.customTools?n.map(o=>(o.tools=o.tools.map(s=>{let c=this.createMcpLanguageModelTool(o.name,this.getServerPrefix(o.name),s);return s._status=r.customTools.includes(c.configurationKey)?"enabled":"disabled",s}),o)):n}async updateMCPToolsStatus(r,n){this.ensureMcpEnabledOrThrow("batch update tools status");for(let{serverName:o,toolName:s,status:c}of n){let d=this.getActiveServerEntry(o).server.getCachedTools().find(m=>m.name===s),f=this.getServerPrefix(o);if(!d){or.error(this.ctx,`Not found MCP ${o} server ${s} tool`);continue}XTe(r)&&(d._status=c),this.ctx.get(ls).getToolById(`${o}.${s}`)||this.registerTool(o,f,d)}await this.ctx.get(ls).updateToolsStatus(r,n.map(({serverName:o,toolName:s,status:c})=>({toolId:`${o}.${s}`,status:c}))),this.persistAllServersCache()}async callTool(r,n,o,s,c,l,u){this.ensureMcpEnabledOrThrow(`call tool ${r}.${n}`);let d=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,d,"tool call")).callTool(n,o,s,c,l,u)}async getPrompt(r,n,o){this.ensureMcpEnabledOrThrow(`get prompt ${r}.${n}`);let s=this.getActiveServerEntry(r),l=await(await this.ensureServerConnection(r,s,"get prompt")).getPrompt(n,o);return yt(this.ctx,"mcp.getPrompt",Vt.createAndMarkAsIssued()),_t(this.ctx,"mcp.getPrompt"),l}async completePrompt(r,n,o,s,c){this.ensureMcpEnabledOrThrow(`complete prompt ${r}.${n}`);let l=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,l,"complete prompt")).completePrompt(n,o,s,c)}async readResource(r,n){this.ensureMcpEnabledOrThrow(`read resource from ${r}: ${n}`);let o=this.getActiveServerEntry(r);return await(await this.ensureServerConnection(r,o,"read resource")).readResource(n)}async startMCPServer(r){return this.ensureMcpEnabledOrThrow(`start server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await this.startMCPServerInternal(r)})}async startMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.server.isConnected){or.info(this.ctx,`MCP server ${r} is already running`);return}if(n.isStarting){or.info(this.ctx,`MCP server ${r} is already starting, skipping duplicate request`);return}n.isStarting=!0,await sc(this.ctx,{message:`Starting server ${r}`,server:r}),await this.updateServersList(!1),this.unregisterServerTools(r);try{await this.startServer(r);let o=this.MCPServersMap.get(r);o&&(o.hasError=!1,o.errorMessage=void 0,o.isStarting=!1)}catch(o){let s=this.MCPServersMap.get(r);throw s&&(s.hasError=!0,s.errorMessage=o instanceof Error?o.message:String(o),s.isStarting=!1),o}finally{this.registerServerTools(r),await this.updateServersList(!1)}}async stopMCPServer(r){return this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r)})}async stopMCPServerInternal(r){let n=this.getActiveServerEntry(r);if(n.isStarting){or.info(this.ctx,`MCP server ${r} is starting, cannot stop now`);return}await sc(this.ctx,{message:`Stopping server ${r}`,server:r}),n.server.getEmitter().removeAllListeners($$),n.server.isConnected&&await n.server.cleanup(),n.hasError=!1,n.errorMessage=void 0,n.isStarting=!1,await sc(this.ctx,{message:`Server ${r} stopped`,server:r}),await this.updateServersList(!1)}async restartMCPServer(r){return this.ensureMcpEnabledOrThrow(`restart server ${r}`),await sc(this.ctx,{message:`Restarting server ${r}`,server:r}),this.serverOperationSequencer.queue(r,async()=>{await this.stopMCPServerInternal(r),await new Promise(n=>setTimeout(n,100)),await this.startMCPServerInternal(r)})}async logoutMCPServer(r){return this.ensureMcpEnabledOrThrow(`logout server ${r}`),this.serverOperationSequencer.queue(r,async()=>{await sc(this.ctx,{message:`Logging out MCP server ${r}`,server:r}),await this.performLogout(r)})}async clearOAuthMCPServer(r){return this.ensureMcpEnabledOrThrow(`clear OAuth for server ${r}`),this.serverOperationSequencer.queue(r,async()=>{let o=this.getActiveServerEntry(r).authInfo?.providerId;if(!o){or.warn(this.ctx,`No OAuth provider found for server ${r}, nothing to clear`);return}await sc(this.ctx,{message:`Clearing OAuth provider registration for MCP server ${r}`,server:r}),await this.performLogout(r),or.info(this.ctx,`Unregistering provider ${o} for server ${r}`);try{await this.ctx.get(gN).unregisterProvider(o)}catch{or.debug(this.ctx,`Provider ${o} is not a dynamic OAuth provider, skipping unregistration`)}})}async performLogout(r){let n=this.getActiveServerEntry(r);if(n.authInfo){let{providerId:c,accountName:l}=n.authInfo;or.info(this.ctx,`Removing account preference and session for account ${l} on server ${r} with provider ${c}`),this.ctx.get(ub).removeAccountPreference(r,c);try{let u=this.ctx.get(r0).getProvider(c),f=(await u.getSessions(void 0,{})).find(h=>h.account.label===l);f?(await u.removeSession(f.id),or.info(this.ctx,`Successfully removed session for account ${l}`)):or.warn(this.ctx,`No session found for account ${l}`)}catch(u){or.error(this.ctx,`Failed to remove session for account ${l}:`,u)}n.authInfo=void 0}await this.stopMCPServerInternal(r);let o=this.storedMCPServersConfig[r];if(!o){let c=`Original config not found for server ${r}`;throw or.error(this.ctx,c),new Error(c)}let s=this.toManagedServerDefinition(r,o);this.MCPServersMap.delete(r),await this.addServer(s),or.info(this.ctx,`Server ${r} logged out and restored to original configuration`),await this.updateServersList(!1)}async startServer(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;if(n.server.isConnected){or.info(this.ctx,`MCP server ${r} is already running`);return}let{server:o,definition:s}=n;try{o.getEmitter().on($$,()=>{this.unregisterServerTools(r),this.persistAllServersCache(),this.registerServerTools(r),this.notifyClient()}),await o.connect(s),await sc(this.ctx,{message:"Connection state: Running",server:r})}catch(c){or.error(this.ctx,`Error initializing MCP server ${r}:`,c);let l=c instanceof Pw||c instanceof i2e,u=l?c.code:void 0;if(l&&u!==void 0&&"url"in s&&s.type!=="sse"&&o instanceof kFe&&u!==401&&u>=400&&u<500){let f=`${u} status sending message to ${s.url}, will attempt to fall back to legacy SSE`;or.info(this.ctx,f),sc(this.ctx,{message:f,server:r});let h={...s,name:r,type:"sse"};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,h),await this.startServer(r)}else if(l&&"url"in s&&u===401){let f=await this.getAuthMetadata(s),h=await this.getToken(s.name,s.url,f.authorizationServer,f.serverMetadata,f.resourceMetadata);if(!h){let g=`Failed to get token for server: ${r}`;throw or.error(this.ctx,g),new Error(g)}let m={...s,name:r,requestInit:{...s.requestInit??{},headers:{...s.requestInit?.headers??{},Authorization:`Bearer ${h}`}}};return await o.cleanup().catch(()=>{}),await this.updateServerDefinition(n,m),await this.startServer(r)}let d=c instanceof Error?`message: ${c.message} stack: ${c.stack}`:String(c);throw await sm(this.ctx,{message:d,server:r}),this.ctx.get(Hs).showWarningMessageOnlyOnce(`${r}.initialize`,`Failed to initialize MCP server '${r}'. Please check the logs for more details.`),c}}async updateServersList(r=!0){return this.updateServersQueue=this.updateServersQueue.then(async()=>{r&&this.registerTools(),await this.notifyClient()}).catch(n=>{or.error(this.ctx,"updateServersList: Update failed",n)}),this.updateServersQueue}getServerPrefix(r){let n=this.serverPrefixes.get(r);if(n)return n;let o=this.prefixGenerator.generate(r);return this.serverPrefixes.set(r,o),o}async persistAllServersCache(){try{let r={};for(let[n,o]of this.MCPServersMap){let s=o.server?.getCachedTools()??[],c=o.server?.getCachedResources()??[],l=o.server?.getCachedResourceTemplates()??[],u=o.server?.getCachedPrompts()??[];r[n]={tools:s,resources:c,resourceTemplates:l,prompts:u}}await this.cache.store(r)}catch(r){or.error(this.ctx,"Failed to persist MCP servers cache:",r)}}createMCPServer(r){return r.type==="sse"?new mxt(this.ctx,r.name,r.version||"1.0.0"):r.type==="streamable"||"url"in r?new kFe(this.ctx,r.name,r.version||"1.0.0"):new gxt(this.ctx,r.name,r.version||"1.0.0")}async addServer(r){let n=this.createMCPServer(r),o=await this.cache.get(r.name);o&&n.restoreCacheFromPersistence(o),this.MCPServersMap.set(r.name,{server:n,definition:r,hasError:!1,errorMessage:void 0,isStarting:!1,isBlocked:!1})}async updateServerDefinition(r,n){let o=this.createMCPServer(n),s=await this.cache.get(n.name);s&&o.restoreCacheFromPersistence(s),r.server=o,r.definition=n}async notifyClient(){let r=this.getAllContents();await this.ctx.get(dr).connection.sendNotification(t.contentsNotificationType,{servers:r})}registerTools(){for(let[r]of this.MCPServersMap)this.registerServerTools(r)}registerServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=this.getServerPrefix(r),s=n.server?.getCachedTools()??[];for(let c of s)this.registerTool(r,o,c)}unregisterServerTools(r){let n=this.MCPServersMap.get(r);if(!n||n.isBlocked)return;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}registerTool(r,n,o){or.debug(this.ctx,"register MCP Tool:",{...o}),this.ctx.get(ls).registerTool(this.createMcpLanguageModelTool(r,n,o))}createMcpLanguageModelTool(r,n,o){let{name:s,description:c,inputSchema:l,_status:u,_nameForModel:d,annotations:f}=o;return new Axt({serverName:r,serverNamePrefix:n,name:d,displayName:s,description:c||"",displayDescription:c||"",inputSchema:l,annotations:f,status:u},(h,m,g,A)=>(or.info(this.ctx,"copilot MCP Invoker:",r,s,g),this.callTool(r,s,g,A,h,m.roundId,m.toolCallId?.toString())))}unregisterAllTools(){for(let[r,n]of this.MCPServersMap){if(n.isBlocked)continue;let o=n.server?.getCachedTools()??[];for(let s of o)this.unregisterTool(r,s.name)}}unregisterTool(r,n){or.debug(this.ctx,"unregister MCP Tool:",{serverName:r,toolName:n}),this.ctx.get(ls).unregisterTool(`${r}.${n}`)}async clearAllServers(){this.unregisterAllTools();for(let r of this.MCPServersMap.keys())if(!this.MCPServersMap.get(r).isBlocked)try{await this.stopMCPServer(r)}catch(o){or.error(this.ctx,`Error stopping server ${r} during clearAllServers:`,o)}this.MCPServersMap.clear(),this.serverPrefixes.clear()}determineServerStatus(r){return r.isBlocked?"blocked":r.isStarting?"starting":r.server.isConnected?"running":r.hasError?"error":"stopped"}createServerSnapshot(r,n){return{name:r,prefix:this.getServerPrefix(r),status:this.determineServerStatus(n),tools:n.server?.getCachedTools()??[],resources:n.server?.getCachedResources()??[],resourceTemplates:n.server?.getCachedResourceTemplates()??[],prompts:n.server?.getCachedPrompts()??[],error:n.isBlocked?void 0:n.errorMessage,registryInfo:n.registryInfo,authInfo:n.isBlocked?void 0:n.authInfo}}updateAuthInfo(r,n,o,s){let c=this.MCPServersMap.get(r);c&&!c.isBlocked&&(c.authInfo={providerId:n,accountName:o,isDynamic:s})}removeServerAccountPreferences(r){let n=this.MCPServersMap.get(r);if(n?.isBlocked||!n?.authInfo){or.debug(this.ctx,`No auth info found for server ${r}, nothing to remove`);return}let{providerId:o}=n.authInfo;or.info(this.ctx,`Removing account preference for server ${r} with provider ${o}`),this.ctx.get(ub).removeAccountPreference(r,o),n.authInfo=void 0}async getAuthMetadata(r){try{return await new Ape(this.ctx).getMetadataFromOriginalUrl(r.url,r.requestInit?.headers)}catch(n){throw or.error(this.ctx,`Failed to get auth metadata for ${r.url}: ${n instanceof Error?n.message:String(n)}`,n),n}}async getToken(r,n,o,s,c){let l=this.ctx.get(r0).getOrActivateProviderIdForServer(o);if(!l){let A=this.ctx.get(r0).createAuthenticationProvider(o,s,c);if(!A&&(A=await this.ctx.get(r0).createDynamicAuthenticationProvider(o,s,c),!A)){or.warn(this.ctx,`Failed to create authentication provider for server ${r} (authServer: ${o})`);return}l=A.id}let u=c?.scopes_supported||s.scopes_supported||[],d=await this.ctx.get(r0).getSessions(l,u,{authorizationServer:o},!0),f=this.ctx.get(ub).getAccountPreference(r,l),h;f&&(h=d.find(A=>A.account.label===f));let m=this.ctx.get(r0).getProvider(l),g=!!this.ctx.get(Uv).getClientRegistration(l);if(d.length){if(h)return this.updateAuthInfo(r,l,h.account.label,g),h.accessToken;try{let A=m?.label||l,y="Sign in to another account",E=d.map(v=>({title:v.account.label}));E.push({title:y}),E.push({title:"Cancel"});let _=await this.ctx.get(Hs).showInformationModal(`The MCP server ${r} wants to access a ${A} account, Select an account for ${r} to use`,...E);if(!_||_.title==="Cancel"){or.warn(this.ctx,"user cancelled the account selection");return}if(_.title!==y){let v=d.find(b=>b.account.label===_.title);if(!v){or.warn(this.ctx,"selected account not found in sessions");return}return this.ctx.get(ub).updateAccountPreference(r,l,v.account),this.updateAuthInfo(r,l,v.account.label,g),v.accessToken}}catch(A){or.error(this.ctx,"Failed during account selection:",A);return}}else try{if((await this.ctx.get(Hs).showInformationModal(`The MCP Server Definition '${n}' wants to authenticate to ${m.label}.`,{title:"OK"},{title:"Cancel"}))?.title!=="OK"){or.warn(this.ctx,"user cancelled the authentication request");return}}catch(A){or.error(this.ctx,"Failed to show authentication request dialog:",A);return}try{let A=await m.createSession(u,{});return this.ctx.get(Hs).showInformationMessageOnlyOnce("Authentication successful",`You have already authenticated with ${m.label}.`),this.ctx.get(ub).updateAccountPreference(r,l,A.account),this.updateAuthInfo(r,l,A.account.label,g),A.accessToken}catch(A){or.error(this.ctx,`Failed to create authentication session for server ${r}:`,A),this.ctx.get(Hs).showWarningMessageOnlyOnce("Authentication failed",`You need to restart the IDE to authenticate the MCP server again. ${A instanceof Error?A.message:String(A)}`);return}}};p();var ito=fe(Al());var _xt=class t extends c2{static{a(this,"CLSMCPRuntimeNotifier")}static{this.notificationType=new ito.ProtocolNotificationType("copilot/mcpRuntimeLogs")}constructor(e){super(),this.ctx=e}async notifyLog(e){await this.ctx.get(dr).connection.sendNotification(t.notificationType,{...e,time:Date.now()})}};p();var oto=fe(Al());var WWc=new oto.ProtocolRequestType("copilot/readMcpSamplingConfig"),vxt=class extends IV{constructor(r){super();this.ctx=r}static{a(this,"CopilotMcpSamplingConfigSender")}async readMcpSamplingConfig(r){let n=this.ctx.get(dr).connection,o;try{o=await n.sendRequest(WWc,r)}catch(l){throw new Error(`Request copilot/readMcpSamplingConfig failed with message: ${Yu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/readMcpSamplingConfig failed with code: ${c.code}, message: ${c.message}`);return s}};p();var bxt=fe(Al());var zWc=new bxt.ProtocolRequestType("copilot/showPanelMessageRequest"),YWc=new bxt.ProtocolNotificationType("copilot/showPanelMessage"),Cxt=class extends S_e{constructor(r){super();this.ctx=r}static{a(this,"CopilotMessageSender")}async sendPanelMessageNotification(r){return this.ctx.get(dr).connection.sendNotification(YWc,r)}async sendPanelMessageRequest(r){let n=this.ctx.get(dr).connection,o;try{o=await n.sendRequest(zWc,r)}catch(l){throw new Error(`Request copilot/showPanelMessageRequest failed with message: ${Yu(l)}`)}let[s,c]=o;if(c)throw new Error(`Request copilot/showPanelMessageRequest failed with code: ${c.code}, message: ${c.message}`);return s}};p();p();var ato=require("node:stream"),eie=fe(Gor());var u9=new Ae("UndiciFetcher"),Txt=class extends cr{constructor(r){super();this.ctx=r;this.name="UndiciFetcher";this.userAgent=`GithubCopilot/${r.get(os).getVersion()}`,this.certificateConfigurator=new oEe(r),this.proxySocketFactory=r.get(BR),this.settings=r.get(Yo).getHttpSettings(),this.updateNoProxyFilters(this.settings.noProxy),u9.info(this.ctx,"Initialized UndiciFetcher.",this.getSettingsLogProperties()),r.get(Yo).onDidChangeHttpSettings(n=>{this.settings=n,this.updateNoProxyFilters(n.noProxy),u9.info(this.ctx,"HTTP settings changed; resetting Undici dispatchers.",this.getSettingsLogProperties()),this.resetDispatchers()})}static{a(this,"UndiciFetcher")}async fetch(r,n){let o={...n.headers??{}};o["User-Agent"]=this.userAgent;let s=n.body;if(n.json!==void 0){if(n.body!==void 0)throw new Error("Illegal arguments! Cannot pass in both 'body' and 'json'!");o["Content-Type"]="application/json",s=JSON.stringify(n.json)}let c=n.method??"GET";if(c!=="GET"&&c!=="POST"&&c!=="DELETE")throw new Error("Illegal arguments! 'method' must be 'GET', 'POST', or 'DELETE'!");let l=!1,u,d=ZWc(n.signal),f=d.signal;if(n.timeout){let h=new AbortController;u=setTimeout(()=>{l=!0,h.abort()},n.timeout),f=f?AbortSignal.any([f,h.signal]):h.signal}try{let h={method:c,headers:o,body:s,signal:f};u9.debug(this.ctx,"Starting Undici fetch.",{target:Sxt(r),method:c,hasBody:s!==void 0,hasTimeout:n.timeout!==void 0,hasSignal:f!==void 0});let{dispatcher:m,isProxy:g}=await this.getDispatcher(r),A=await(0,eie.fetch)(r,{...h,dispatcher:m});return u9.debug(this.ctx,"Undici fetch completed.",{target:Sxt(r),status:A.status,isProxy:g}),new DI(A.status,A.statusText,A.headers,()=>A.text(),()=>A.body?ato.Readable.fromWeb(A.body):null)}catch(h){throw l?(u9.warn(this.ctx,"Undici fetch timed out.",{target:Sxt(r),timeout:n.timeout}),new YV(`Request to <${r}> timed out after ${n.timeout}ms`,h)):XWc(h)}finally{u&&clearTimeout(u),d.cleanup()}}async disconnectAll(){await this.resetDispatchers()}async getDispatcher(r){let n=await this.certificateConfigurator.getCertificates(),o=n?n.join("\0"):"";this.dispatcherCertsKey!==o&&(u9.info(this.ctx,"Root certificate set changed; resetting Undici dispatchers.",{certificateCount:n?.length??0}),await this.resetDispatchers()),this.dispatcherCertsKey=o;let s={allowH2:!0,ca:n,rejectUnauthorized:this.settings.proxyStrictSSL??!0};return!this.settings.proxy||this.shouldBypassProxy(r)?(this.noProxyAgent||(u9.debug(this.ctx,"Creating direct Undici agent.",{target:Sxt(r),bypassedProxy:!!this.settings.proxy,rejectUnauthorized:s.rejectUnauthorized}),this.noProxyAgent=new eie.Agent({allowH2:!0,connect:s})),{dispatcher:this.noProxyAgent,isProxy:!1}):(this.proxyAgent||(this.proxyAgent=this.buildProxyAgent(s)),{dispatcher:this.proxyAgent,isProxy:!0})}buildProxyAgent(r){let n=this.settings.proxy,o=new URL(n),s=(0,eie.buildConnector)(r);return u9.debug(this.ctx,"Creating proxied Undici agent.",{proxy:sto(n),hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal,rejectUnauthorized:r.rejectUnauthorized}),new eie.Agent({allowH2:!0,connect:a((c,l)=>{let u=c.port!==void 0&&c.port!==""?Number(c.port):c.protocol==="https:"?443:80,d={hostname:c.hostname,port:u,headers:{}};this.proxySocketFactory.createSocket(d,{hostname:o.hostname,port:o.port,authorization:this.settings.proxyAuthorization,kerberosServicePrincipal:this.settings.proxyKerberosServicePrincipal}).then(f=>{if(c.protocol!=="https:"){l(null,f);return}s({...c,httpSocket:f},l)}).catch(f=>{l(f instanceof Error?f:new Error(String(f)),null)})},"connect")})}async resetDispatchers(){let r=this.noProxyAgent,n=this.proxyAgent;this.noProxyAgent=void 0,this.proxyAgent=void 0,this.dispatcherCertsKey=void 0,(r||n)&&u9.debug(this.ctx,"Closing Undici dispatchers.",{hasDirectAgent:!!r,hasProxyAgent:!!n}),await Promise.all([r?.close().catch(()=>{}),n?.close().catch(()=>{})])}updateNoProxyFilters(r){let n=(r??[]).map(s=>s.trim()).filter(s=>s.length>0);if(this.noProxyFilters=void 0,n.length===0)return;if(n.includes("*")){this.noProxyFilters=[{regex:/.*/i}];return}let o=[];for(let s of n){let{host:c,port:l}=KWc(s),u=JWc(c);u&&o.push({regex:u,port:l})}o.length&&(this.noProxyFilters=o)}getSettingsLogProperties(){return{proxy:sto(this.settings.proxy),noProxyCount:this.settings.noProxy?.length??0,proxyStrictSSL:this.settings.proxyStrictSSL,hasProxyAuthorization:!!this.settings.proxyAuthorization,hasProxyKerberosServicePrincipal:!!this.settings.proxyKerberosServicePrincipal}}shouldBypassProxy(r){if(!this.noProxyFilters?.length)return!1;let n;try{n=new URL(r)}catch{return!1}let o=n.hostname;if(!o)return!1;let s=n.port||(n.protocol==="https:"?"443":"80"),c=o.toLowerCase();return this.noProxyFilters.some(l=>l.regex.test(c)&&(!l.port||l.port===s))}};function KWc(t){if(t.startsWith("[")){let r=t.indexOf("]");if(r!==-1){let n=t.slice(1,r),o=t.slice(r+1);return{host:n,port:o.startsWith(":")?o.slice(1):void 0}}}let e=t.split(":");return e.length===2?{host:e[0],port:e[1]}:{host:t}}a(KWc,"splitHostPort");function JWc(t){if(!t)return;t.startsWith(".")&&(t=`*${t}`);let e=t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");try{return new RegExp(`^${e}$`,"i")}catch{return}}a(JWc,"compileHostPattern");function Sxt(t){try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(Sxt,"describeUrl");function sto(t){if(!t)return"none";try{let e=new URL(t);return`${e.protocol}//${e.host}`}catch{return""}}a(sto,"describeProxy");function ZWc(t){if(!t||t instanceof AbortSignal)return{signal:t,cleanup:a(()=>{},"cleanup")};let e=new AbortController,r=a(()=>e.abort(),"abort");return t.addEventListener("abort",r),t.aborted&&e.abort(),{signal:e.signal,cleanup:a(()=>t.removeEventListener("abort",r),"cleanup")}}a(ZWc,"toNativeAbortSignal");function XWc(t){if(!(t instanceof Error)||!("cause"in t)||!t.cause||typeof t.cause!="object")return t;let e=t.cause,r=new Error(t.message,{cause:t.cause});r.stack=t.stack,r.name=t.name,r.code=t.code??e.code,r.syscall=t.syscall??e.syscall,r.errno=t.errno??e.errno;let n=e.statusCode;return typeof n=="number"&&(r.statusCode=n),r}a(XWc,"withCauseNetworkProperties");p();var DFe=new Ae("fetcher"),ezc="https://default.exp-tas.com/",NFe=class extends cr{constructor(r,n,o,s){super();this.ctx=r;this.defaultFetcher=n;this.fallbackFetcher=o;this.onFallbackSuccess=s}static{a(this,"FallbackFetcher")}async fetch(r,n){try{return await this.defaultFetcher.fetch(r,n)}catch(o){if(D0(o)||`${r}/`.startsWith(ezc))throw o;DFe.info(this.ctx,`Request to <${r}> failed, attempting fallback.`,o);let s=await this.fallbackFetcher.fetch(r,n);return this.onFallbackSuccess(o,r),DFe.info(this.ctx,`Fallback fetch for <${r}> succeeded.`),s}}getImplementation(){return this.defaultFetcher.getImplementation()}get name(){return this.defaultFetcher.name}async disconnectAll(){await this.defaultFetcher.disconnectAll()}},Ixt=class extends cr{constructor(r,n,o){super();this.ctx=r;this.primary=n;this.secondary=o;this.default=new NFe(r,n,o,(s,c)=>{this.current!==o&&(DFe.info(r,`${n.name} failed; switching to ${o.name} for subsequent requests.`),this.current=o,si(r,"fetcher.stickyFallback",s,{primary:n.name,secondary:o.name,failingHost:rzc(c),...nzc(s),...izc(r)}),n.disconnectAll().catch(l=>{DFe.info(r,`Failed to disconnect ${n.name} after sticky fallback.`,l)}))}),this.current=this.default}static{a(this,"StickyFallbackFetcher")}reset(){this.current!==this.default&&(DFe.info(this.ctx,`Re-arming sticky fallback; ${this.primary.name} will be retried on the next request.`),this.current=this.default)}get name(){return this.current.name}getImplementation(){return this.current.getImplementation()}fetch(r,n){return this.current.fetch(r,n)}async disconnectAll(){await Promise.all([this.primary.disconnectAll(),this.secondary.disconnectAll()])}},tzc=["githubusercontent.com","githubcopilot.com","github.com","exp-tas.com","vscode-cdn.net"];function rzc(t){let e;try{e=new URL(t).host}catch{return""}let r=e.split(":")[0].toLowerCase();return tzc.some(o=>r===o||r.endsWith(`.${o}`))?e:""}a(rzc,"describeHost");function nzc(t){try{if(!(t instanceof Error)||!t.cause)return{};let e=t.cause;Array.isArray(e.errors)&&e.errors.length>0&&e.errors[0]instanceof Error&&(e=e.errors[0]);let r={};for(let[n,o]of Object.entries({errorCauseName:e.name,errorCauseCode:e.code,errorCauseSyscall:e.syscall}))typeof o=="string"&&o&&(r[n]=o.slice(0,100));return typeof e.statusCode=="number"&&(r.errorCauseStatusCode=String(e.statusCode)),r}catch{return{}}}a(nzc,"buildErrorCauseProperties");function izc(t){try{let e=t.get(Yo).getHttpSettings(),r=!!e.proxy,n="none";return r&&(n=e.proxyKerberosServicePrincipal?"kerberos":e.proxyAuthorization?"basic":"none"),{proxyConfigured:r?"true":"false",proxyAuth:n,proxyStrictSSL:e.proxyStrictSSL!==!1?"true":"false"}}catch{return{}}}a(izc,"describeHttpContext");var cto=new Ae("fetcher");function ozc(t){return Ht(t,Je.UseHelixFetcher)==="true"}a(ozc,"isHelixFetcherForced");function szc(t){if(ozc(t))return new Tne(t);let e=new Ixt(t,new Txt(t),new Tne(t));return t.get(Yo).onDidChangeHttpSettings(()=>e.reset()),e}a(szc,"createDefaultFetcher");var xxt=class extends cr{constructor(r,n=szc(r),o=new nEe(r)){super();this.ctx=r;this.defaultFetcher=n;this.editorFetcher=o;this.updateFetcher=a(()=>{let r,n;if(!this.editorFetcherCapability)n=`Using ${this.defaultFetcher.name}, editor does not have fetch capability.`,r=this.defaultFetcher;else if(this.fetchStrategy==="client")n="Using editor fetcher, fetch strategy set to client.",r=this.editorFetcher;else if(this.fetchStrategy==="native")n=`Using ${this.defaultFetcher.name}, fetch strategy set to native.`,r=this.defaultFetcher;else{let o=Ht(this.ctx,Je.DebugUseEditorFetcher);o?.toString()==="true"?(n="Using editor fetcher, debug flag is enabled.",r=this.editorFetcher):o?.toString()==="false"?(n=`Using ${this.defaultFetcher.name}, debug flag is disabled.`,r=this.defaultFetcher):(n="Editor fetcher capability available, will fallback if needed.",r=this.fallbackFetcher)}this.currentFetcher!=r&&(cto.debug(this.ctx,n),this.currentFetcher=r)},"updateFetcher");this.currentFetcher=this.defaultFetcher,this.fallbackFetcher=new NFe(r,n,o,()=>{cto.info(this.ctx,"Fallback fetch succeeded, switching to editor fetcher."),this.currentFetcher=this.editorFetcher}),r.get(On).onDidSetCapabilities(this.updateFetcher),r.get(Yo).onDidChangeCopilotSettings(this.updateFetcher)}static{a(this,"AgentDelegatingFetcher")}get fetchStrategy(){return Ht(this.ctx,Je.FetchStrategy)}get editorFetcherCapability(){return this.ctx.get(On).getCapabilities().fetch??!1}getImplementation(){return this.currentFetcher.getImplementation()}get name(){return this.currentFetcher.name}fetch(r,n){return this.currentFetcher.fetch(r,n)}async disconnectAll(){await Promise.all([this.defaultFetcher.disconnectAll(),this.editorFetcher.disconnectAll()])}};p();var Rxt=fe(ei());var wxt=class extends Hs{constructor(r){super();this.ctx=r}static{a(this,"ConnectionNotificationSender")}get connection(){return this.ctx.get(dr).connection}showWarningMessage(r,...n){return this.connection.window.showWarningMessage(r,...n)}showInformationMessage(r,...n){return this.connection.window.showInformationMessage(r,...n)}showInformationModal(r,...n){return this.connection.sendRequest(Rxt.ShowMessageRequest.type,{type:Rxt.MessageType.Info,message:r,actions:n,modal:!0}).then(o=>o||void 0)}async sendBackgroundAgentSessionUpdate(r,n,o,s){await this.connection.sendNotification("backgroundAgent/sessionUpdate",{sessionId:r,event:n,agentProvider:o,turnIndex:s})}};p();var x_e=fe(Al());var azc=new x_e.ProtocolNotificationType("copilot/customAgent/didChange"),czc=new x_e.ProtocolNotificationType("copilot/customSkill/didChange"),lzc=new x_e.ProtocolNotificationType("copilot/customPrompt/didChange"),uzc=new x_e.ProtocolNotificationType("copilot/customInstruction/didChange"),dzc=new x_e.ProtocolNotificationType("copilot/hook/didChange");function fzc(t){switch(t){case"agent":return azc;case"skill":return czc;case"prompt":return lzc;case"instructions":return uzc;case"hook":return dzc;default:return}}a(fzc,"notificationTypeFor");var Pxt=class extends mA{constructor(r){super();this.ctx=r;this.logger=new Ae("promptChangeNotifier")}static{a(this,"CLSPromptChangeNotifier")}async notify(r){let n=fzc(r);if(!n){this.logger.debug(this.ctx,`No notification type mapped for PromptsType '${r}'; skipping.`);return}try{await this.ctx.get(dr).connection.sendNotification(n,{})}catch(o){this.logger.debug(this.ctx,`Failed to send ${n.method}:`,o)}}};p();var lto=fe(Al());var kxt=class t extends JY{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaChangeNotifier")}static{this.notificationType=new lto.ProtocolNotificationType("copilot/quotaChange")}async notifyQuotaChange(r){await this.ctx.get(dr).connection.sendNotification(t.notificationType,r)}};p();var uto=fe(Al());var Dxt=class t extends OQ{constructor(r){super();this.ctx=r}static{a(this,"CLSQuotaWarningNotifier")}static{this.notificationType=new uto.ProtocolNotificationType("copilot/quotaWarning")}async notifyQuotaWarning(r){await this.ctx.get(dr).connection.sendNotification(t.notificationType,r)}};p();var dto=fe(Al());var pzc=new dto.ProtocolNotificationType("$/copilot/rateLimitWarning"),Nxt=class extends SS{constructor(r){super();this.ctx=r}static{a(this,"CLSRateLimitNotifier")}async notifyRateLimitWarning(r){await this.ctx.get(dr).connection.sendNotification(pzc,r)}};p();p();var Mxt=class extends Ize{static{a(this,"AgentWorkspaceWatcher")}async getWatchedFiles(){return(await this.ctx.get($D).getWatchedFiles({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})).watchedFiles}async getWatchedFileUris(){return this.ctx.get($D).getWatchedFileUris({workspaceUri:this.workspaceFolder.uri,workspaceFolder:this.workspaceFolder,excludeGitignoredFiles:!0,excludeIDEIgnoredFiles:!0})}startWatching(){if(this.status==="ready")return;let e=this.ctx.get($D);this._watcher=e.onDidChangeWatchedFiles(this.onDidChangeWatchedFilesHandler.bind(this)),this.status="ready"}stopWatching(){this.status="stopped",this._watcher?.dispose(),this._watcher=void 0}onDidChangeWatchedFilesHandler(e){if(e.workspaceFolder.uri!==this.workspaceFolder.uri)return;let n=e.created.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(n.length){let c=n.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesCreated(c)}let o=e.changed.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);if(o.length){let c=o.map(l=>l.document).filter(l=>l!==void 0);this.emitFilesUpdated(c)}let s=e.deleted.filter(c=>!c.isRestricted&&!c.isUnknownFileExtension);s.length&&this.emitFilesDeleted(s.map(c=>({uri:c.uri})))}};var Oxt=class extends xx{static{a(this,"AgentWorkspaceWatcherProvider")}createWatcher(e){return new Mxt(this.ctx,e)}shouldStartWatching(e){return ZP(this.ctx)?!1:!!this.ctx.get(On).getCapabilities().watchedFiles&&(!this.hasWatcher(e)||this.getStatus(e)==="stopped")}};function Bxt(t){let e=new FC(process.env),r=UXi(e);r.set(FC,e),r.set(cr,new xxt(r)),r.set(rc,new rc(r)),N5r(r,{});let n=QJr();r.set(yi,n),r.set($g,new $g(r));let o=new $It;r.set(Eh,o);let s=pto.join(n.directory,U6r),c=ML.plaintextOnly();r.set(ML,c);let{repo:l,diagnostics:u}=kcn(r,s,c);r.set(OI,l),r.set(Fr,new SQe(r,process.env)),r.set(ET,new ET(r)),r.set(Ene,new Ene(r));let d=new Hf(r,"agent");d.onInitialized(()=>Ncn(r,u)),r.set(Hf,d),r.set(Oa,DHi),r.set(AI,new AI),r.set(Nr,new bq),r.set(Ine,bHi()),r.set(vu,new vu),r.set(jo,qeo),r.set(na,new UIt(r)),r.set(sX,new qIt(r)),r.set(xx,new Oxt(r)),r.set($D,new $D(r)),r.set(i0,new i0),r.set(o0,Wat(r,nQi)),r.set(hb,new hb(r)),r.set(y5,new wpe),Eeo(r),xze(r),Mcn(r),r.set(dr,new dr(r,t)),r.set(XM,new QIt(r)),r.set(Hs,new wxt(r)),Dcn(r,u),r.set(S_e,new Cxt(r)),r.set(IV,new vxt(r)),r.set(M0,new zye(r)),r.set(ss,new oxt(r));let f=new SFe(r,t);r.set(SFe,f),r.set(lu,f),r.set(bFe,new bFe(r)),r.set(vFe,new vFe(r));let h=new X$(r);r.set(an,h),r.set(X$,h),r.set(N0,new cEe(r,process.env)),r.set(rP,new uie),r.set(ec,new ec(r)),Meo(r),geo(r),r.set(YD,new YD),r.set(W$,new W$),r.set(JD,new JD),r.set(z$,new z$([])),r.set(yT,new VIt),r.set(fto.ObservableWorkspace,new LAe(r,!0,!0)),r.set(k5,new uEe),r.set(w6,new w6),r.set(Rv,new Rv(r)),r.set(jA,new qvt(r)),r.set(v_,new ixt(r)),r.set(Dd,new nxt(r)),r.set(Wx,new Wx(r)),r.set(ls,new ls(r)),r.set(D3,new D3(r)),r.set(M3,new M3(r)),r.set(OS,new OS(r)),r.set(wK,new wK(r)),r.set(AO,new AO),r.set(tm,new tm),r.set(ZD,new ZD(r)),r.set(UE,new Ext(r)),r.set(c2,new _xt(r)),r.set(x3,new x3(r)),r.set(ub,new cxt(r));let m=new Dj(r);r.set(Dj,m),r.set(pT,new pT(r,m)),r.set(db,new db(r,m,new axt(r))),r.set(SS,new Nxt(r)),r.set(FZ,new FZ),r.set(Ane,new Ane),r.set(r0,new GIt(r)),r.set(Uv,new jIt(r)),r.set(gN,new gN(r));let g=new S_(r);r.set(S_,g),r.set(ff,new ff(r,g)),r.set(sg,new sg(r,g)),r.set($p,new $p(r,g)),r.set(em,new em(r,e,g));let A=new n3(r,g,n);r.set(n3,A),r.get(CS).addListener(A.lifecycleListener);let y=new EFe;return r.set(EFe,y),r.set(mA,new Pxt(r)),r.set(Zm,new Zm(r,y)),r.set(Yx,new Yx),r.set(Nk,new Nk(r)),r.set(Aq,new Aq(r)),r.set(Lx,new YQ([new KQ,new JQ])),r.set(gne,new gne(r)),r.set(I_,new I_(r)),r.set(OQ,new Dxt(r)),r.set(JY,new kxt(r)),r.set(EF,new EF(r)),r.set(Ls,new Ls(r)),r.set(am,new am),r.set(HZ,new HZ(r)),r.set(DF,new DF(r,new mIt)),r.set(wc,new wc(r)),r.set(YM,new sxt(r)),r.set(zD,new zD(r)),r.set(NR,new NR(r.get(zD),r)),r.set(aO,new aO(r)),r.set(tI,new WIt(r)),r.set(MC,new MC(r.get(NR),r.get(tI),r)),r.set(eE,new eE(r)),r.set(uX,new uX(r)),r}a(Bxt,"createLanguageServerContext");var AN=new Ae("ACP");async function hto(t){let e=t.get(os);AN.info(t,`Starting Copilot ACP Agent v${e.getDisplayVersion()}`),t.get(FC).markReady(),t.get(Up).githubAppId=Lse,gzc(t),mzc(t),t.get(On).setCapabilities({subAgent:!0,cveRemediatorAgent:!1}),await t.get(Ut).primeToken()?AN.info(t,"Token primed successfully"):AN.warn(t,"Token priming failed - set GH_COPILOT_TOKEN or GITHUB_COPILOT_TOKEN environment variable"),t.get(Hf).initialize(!0),Vmn()?await hzc(t):(_t(t,"acp.server.start",{acpPipeline:"internal"}),await mto(t))}a(hto,"startACPServer");async function mto(t){AN.info(t,"Starting ACP server with internal pipeline");let e=w_e.Writable.toWeb(process.stdout),r=w_e.Readable.toWeb(process.stdin),n=hwe(e,r),o=new mwe(s=>new D1t(s,t),n);o.signal.addEventListener("abort",()=>{AN.info(t,"ACP connection closed"),process.exit(0)}),await o.closed}a(mto,"startACPServerInternal");async function hzc(t){AN.info(t,"Starting ACP server with CLI proxy"),_t(t,"acp.cli.discover");let e;try{e=await Wmn()}catch(u){let d=u instanceof Error?u.message:String(u);AN.warn(t,`CLI discovery failed, falling back to internal pipeline: ${d}`),si(t,"acp.server.start",u,{acpPipeline:"internal-fallback"}),await mto(t);return}let r=e.args.length>0?`${e.path} ${e.args.join(" ")}`:e.path;AN.info(t,`Found Copilot CLI: ${r} v${e.version}`),_t(t,"acp.server.start",{acpPipeline:"cli",cliVersion:e.version,cliSource:e.source});let n=new N1t(e,t),o=w_e.Writable.toWeb(process.stdout),s=w_e.Readable.toWeb(process.stdin),c=hwe(o,s),l=new mwe(u=>new O1t(u,t,n),c);l.signal.addEventListener("abort",()=>{AN.info(t,"ACP connection closed, disposing CLI process"),n.dispose().then(()=>{process.exit(0)})}),await l.closed}a(hzc,"startACPServerWithCLI");function mzc(t){let e=t.get(ls);e.registerTool(new yq({name:"create_file",description:"Create a new file in the workspace with the specified content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to create."}),content:S.String({description:"The content to write to the new file."})})})),e.registerTool(new yq({name:"insert_edit_into_file",description:"Edit an existing file by inserting, replacing, or deleting content.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),content:S.Optional(S.String({description:"The new content for the file."})),edits:S.Optional(S.Array(S.Object({startLine:S.Number({description:"The starting line number (1-based)."}),endLine:S.Number({description:"The ending line number (1-based)."}),newContent:S.String({description:"The new content to replace the range with."})})))})})),e.registerTool(new yq({name:"replace_string_in_file",description:"Replace a specific string in a file with a new string.",inputSchema:S.Object({filePath:S.String({description:"The absolute path of the file to edit."}),oldString:S.String({description:"The string to find and replace."}),newString:S.String({description:"The string to replace it with."})})})),AN.info(t,"Registered ACP client tools: create_file, insert_edit_into_file, replace_string_in_file")}a(mzc,"registerACPClientTools");function gto(){let e=Bxt({onRequest:a(()=>{},"onRequest"),onNotification:a(()=>{},"onNotification"),listen:a(()=>{},"listen"),sendNotification:a(()=>{},"sendNotification"),sendRequest:a(()=>Promise.resolve({}),"sendRequest"),workspace:{onDidChangeWorkspaceFolders:a(()=>{},"onDidChangeWorkspaceFolders")},client:{register:a(()=>Promise.resolve({}),"register")},console:{log:a(()=>{},"log"),info:a(()=>{},"info"),warn:a(()=>{},"warn"),error:a(()=>{},"error")},window:{showWarningMessage:a(()=>Promise.resolve(void 0),"showWarningMessage"),showInformationMessage:a(()=>Promise.resolve(void 0),"showInformationMessage")}}),r=new eV(e);return e.forceSet(v_,r),{ctx:e,acpToolInvoker:r}}a(gto,"createACPContext");function gzc(t,e=process.env){let r=e.GITHUB_ENTERPRISE_URL;r&&(AN.info(t,"Configuring GitHub Enterprise URL from GITHUB_ENTERPRISE_URL"),y9e(t,r))}a(gzc,"configureGitHubEnterpriseUrl");p();var u6r=require("events"),MFe=fe(require("fs"));bHe();var Fxt=fe(Al());p();var yto=fe(require("fs")),Eto=fe(require("http")),R_e=fe(require("path"));var Lxt=class{constructor(e,r){this.port=e;let n;this.server=Eto.createServer((o,s)=>{if(o.headers.accept&&o.headers.accept=="text/event-stream")switch(s.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),o.url){case"/stdin":r.on("read",l=>{Ato(s,JSON.stringify(l))});return;case"/stdout":r.on("write",l=>{Ato(s,JSON.stringify(l))});return;default:s.writeHead(404),s.end();return}s.writeHead(200,{"Content-Type":"text/html"});let c=__dirname;R_e.basename(__dirname)!=="debug"&&(c=R_e.dirname(__dirname)),n??=yto.readFileSync(R_e.join(c,"dist","debugServer.html")).toString(),s.write(n),s.end()}),this.server.on("error",o=>{console.error(o)})}static{a(this,"DebugServer")}listen(){return this.server.listen(this.port),this}getPort(){return this.server.address().port}};function Ato(t,e){t.write("data: "+e.toString().replace(/\n/g,` data: `)+` -`)}a(kto,"writeData");var N6r=class extends Zxt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},M6r=class extends Zxt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function Nto(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new D6r.EventEmitter;let l=new Jxt(o,n).listen();o===0&&await cSe(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=YFe.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=YFe.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&YFe.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new D6r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} +`)}a(Ato,"writeData");var d6r=class extends Fxt.AbstractMessageWriter{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageWriter")}async write(r){return this.ev.emit("write",r),this.delegate.write(r)}end(){this.ev.emit("end"),this.delegate.end()}},f6r=class extends Fxt.AbstractMessageReader{constructor(r,n){super();this.delegate=r;this.ev=n}static{a(this,"DebugMessageReader")}listen(r){return this.delegate.listen(n=>{this.ev.emit("read",n),r(n)})}};async function _to(t,e,r){let n,o=parseInt(t.GH_COPILOT_DEBUG_UI_PORT??t.GITHUB_COPILOT_DEBUG_UI_PORT);if(!isNaN(o)){n??=new u6r.EventEmitter;let l=new Lxt(o,n).listen();o===0&&await J1e(`http://localhost:${l.getPort()}`)}let s=t.GITHUB_COPILOT_RECORD??"",c;try{let l=Date.now().toString();s==="1"||s==="true"?c=MFe.openSync(`stdio${l}.log`,"w"):s&&s!=="0"&&s!=="false"&&(c=MFe.openSync(s.replaceAll("%s",l),"w"))}catch(l){console.error(l)}if(c){let l=a(u=>{c&&MFe.appendFile(c,u,d=>{d&&(c=void 0,console.error(d))})},"log");n??=new u6r.EventEmitter,n.on("read",u=>l(`<-- ${JSON.stringify(u)} `)),n.on("write",u=>l(`--> ${JSON.stringify(u)} -`))}return n&&(e=new M6r(e,n),r=new N6r(r,n)),[e,r]}a(Nto,"wrapTransports");p();var Xxt=ce(require("fs/promises")),Mto=ce(require("os")),Oto=ce(require("path"));var vKc={tmpdir:a(()=>Mto.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function Bto(t=vKc){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Xxt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Xxt.mkdtemp(Oto.join(e,"github-copilot-"))}}a(Bto,"mitigateTempFolder");function aJc(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(aJc,"shouldEnableSourceMapSupport");aJc()&&Aro();async function Ero(){let t=Xfn(process.argv.slice(2)).version(new ss().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(e.acp){let{ctx:u}=Rto();await xto(u);return}let r,n;e["node-ipc"]?(r=new nk.IPCMessageReader(process),n=new nk.IPCMessageWriter(process)):e.stdio?(r=new nk.StreamMessageReader(process.stdin),n=new nk.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await Bto();let o=(0,nk.createConnection)(nk.ProposedFeatures.all,...await Nto(process.env,r,n)),s=Kxt(o);console=Lun(s);let c=s.get(ur),l=new oY(s);s.set(oY,l),c.onActivation(()=>{l.start()}),cJc(c,r),Mcn(s),c.listen()}a(Ero,"main");function cJc(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a(cJc,"setupExitHandlers");yro.isMainThread?require.main===module&&Ero():(rln()&&nln(),dFt()&&Oun());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); +`))}return n&&(e=new f6r(e,n),r=new d6r(r,n)),[e,r]}a(_to,"wrapTransports");p();var Uxt=fe(require("fs/promises")),vto=fe(require("os")),Cto=fe(require("path"));var Azc={tmpdir:a(()=>vto.default.tmpdir(),"tmpdir"),isPkg:"pkg"in process};async function bto(t=Azc){if(t.isPkg&&process.platform!=="win32"){let e=t.tmpdir();await Uxt.mkdir(e,{recursive:!0}),process.env.TMPDIR=await Uxt.mkdtemp(Cto.join(e,"github-copilot-"))}}a(bto,"mitigateTempFolder");function rYc(){let t=process.env.GH_COPILOT_DEBUG??process.env.GITHUB_COPILOT_DEBUG;return process.argv.includes("--debug")||t!==void 0&&t!=="0"&&t.toLowerCase()!=="false"}a(rYc,"shouldEnableSourceMapSupport");rYc()&&iro();async function sro(){let t=qmn(process.argv.slice(2)).version(new os().getDisplayVersion()).strict().option("debug",{type:"boolean",hidden:!0}).option("clientProcessId",{type:"string",hidden:!0}).option("stdio",{type:"boolean",describe:"Use stdio"}).option("acp",{type:"boolean",describe:"Run as Agent Client Protocol (ACP) agent"});"pkg"in process||t.option("node-ipc",{type:"boolean",describe:"Use node IPC",conflicts:"stdio"});let e=await t.parse();if(bfn(),e.acp){let{ctx:u}=gto();await h3t(u),await hto(u);return}let r,n;e["node-ipc"]?(r=new eP.IPCMessageReader(process),n=new eP.IPCMessageWriter(process)):e.stdio?(r=new eP.StreamMessageReader(process.stdin),n=new eP.StreamMessageWriter(process.stdout)):(console.error("error: required option '--stdio' not specified"),process.exit(1)),await bto();let o=(0,eP.createConnection)(eP.ProposedFeatures.all,...await _to(process.env,r,n)),s=Bxt(o);console=Thn(s),await h3t(s);let c=s.get(dr),l=new EY(s);s.set(EY,l),c.onActivation(()=>{l.start(),Sfn()}),nYc(c,r),c.listen()}a(sro,"main");function nYc(t,e){let r=!1,n=a((o,s)=>{r||(r=!0,console.error(`copilot-language-server: shutting down (${o})`),t.onExit().finally(()=>process.exit(s)).catch(()=>{}),setTimeout(()=>process.kill(process.pid,"SIGKILL"),500))},"shutdown");e.onClose(()=>n("reader closed",0)),process.on("SIGINT",()=>n("SIGINT",130)),process.on("SIGTERM",()=>n("SIGTERM",143))}a(nYc,"setupExitHandlers");oro.isMainThread?require.main===module&&sro():(Vfn()&&Wfn(),x9t()&&Shn());0&&(module.exports={getTokenizer,getTokenizerAsync,main}); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: @@ -4065,39 +4054,25 @@ git-url-parse/lib/index.js: * @return {String} token prefix *) -is-extglob/index.js: - (*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - *) - -is-glob/index.js: - (*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - *) - -@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/position.js: -@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/range.js: -@vscode/prompt-tsx/dist/base/util/vs/nls.js: -@vscode/prompt-tsx/dist/base/util/vs/common/platform.js: -@vscode/prompt-tsx/dist/base/util/vs/common/process.js: -@vscode/prompt-tsx/dist/base/util/vs/common/path.js: -@vscode/prompt-tsx/dist/base/util/vs/common/uri.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/arraysFind.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/lazy.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/errors.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/arraysFind.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/arrays.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/collections.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/functional.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/map.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/functional.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/assert.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/types.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/iterator.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/lifecycle.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/stream.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/buffer.js: +@vscode/prompt-tsx/dist/base/util/vs/nls.js: +@vscode/prompt-tsx/dist/base/util/vs/common/platform.js: +@vscode/prompt-tsx/dist/base/util/vs/common/process.js: +@vscode/prompt-tsx/dist/base/util/vs/common/path.js: +@vscode/prompt-tsx/dist/base/util/vs/common/uri.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiation.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/linkedList.js: @vscode/chat-lib/dist/src/_internal/util/vs/nls.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/platform.js: @@ -4107,7 +4082,6 @@ is-glob/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/cancellation.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/path.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/cache.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/lazy.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/strings.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/extpath.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uri.js: @@ -4115,6 +4089,13 @@ is-glob/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/resources.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/symbols.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/async.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/descriptors.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/graph.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/serviceCollection.js: +@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiationService.js: +@vscode/chat-lib/dist/src/_internal/util/vs/base/common/numbers.js: +@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/position.js: +@vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/range.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/objects.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/observableInternal/debugName.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/equals.js: @@ -4160,11 +4141,6 @@ is-glob/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/edit.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/stringEdit.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/observable.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiation.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/descriptors.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/graph.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/serviceCollection.js: -@vscode/chat-lib/dist/src/_internal/util/vs/platform/instantiation/common/instantiationService.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codiconsUtil.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codiconsLibrary.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/codicons.js: @@ -4172,8 +4148,6 @@ is-glob/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uuid.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/textEdit.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/edits/lineEdit.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/stream.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/buffer.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/position.js: @vscode/chat-lib/dist/src/_internal/util/vs/workbench/api/common/extHostTypes/range.js: @@ -4207,12 +4181,31 @@ is-glob/index.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/glob.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/sseParser.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/hash.js: -@vscode/chat-lib/dist/src/_internal/util/vs/base/common/numbers.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/core/wordHelper.js: @vscode/chat-lib/dist/src/_internal/util/vs/base/common/uint.js: @vscode/chat-lib/dist/src/_internal/util/vs/editor/common/model/prefixSumComputer.js: (*!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' *) +@vscode/chat-lib/dist/src/_internal/extension/completions-core/vscode-node/prompt/src/tokenization/tokenizer.js: + (*! CLS-HOST-INJECTION-VENDORED-v2 delegate (script/chatLibPatch/patchChatLib.ts) *) + (*! CLS-HOST-INJECTION-VENDORED-v2 lazy-init (script/chatLibPatch/patchChatLib.ts) *) + +is-extglob/index.js: + (*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + *) + +is-glob/index.js: + (*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + *) + undici/lib/web/fetch/body.js: undici/lib/web/fetch/body.js: (*! formdata-polyfill. MIT License. Jimmy Wärting *) @@ -4372,7 +4365,7 @@ yargs-parser/build/lib/index.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT *) @octokit/request-error/dist-src/index.js: (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *) diff --git a/copilot/js/tfidfWorker.js b/copilot/js/tfidfWorker.js index 3d12b15e..de6e20f2 100644 --- a/copilot/js/tfidfWorker.js +++ b/copilot/js/tfidfWorker.js @@ -1,21 +1,19 @@ -"use strict";var Oo=Object.create;var Gn=Object.defineProperty;var Do=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Fo=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var s=(n,e)=>Gn(n,"name",{value:e,configurable:!0});var zo=(n,e)=>()=>(n&&(e=n(n=0)),e);var M=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var qo=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Mo(e))!Uo.call(n,i)&&i!==t&&Gn(n,i,{get:()=>e[i],enumerable:!(r=Do(e,i))||r.enumerable});return n};var _e=(n,e,t)=>(t=n!=null?Oo(Fo(n)):{},qo(e||!n||!n.__esModule?Gn(t,"default",{value:n,enumerable:!0}):t,n));var x,d=zo(()=>{"use strict";x=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:x});var ps=M(ve=>{"use strict";d();Object.defineProperty(ve,"__esModule",{value:!0});ve.bytePairEncode=ve.BinaryMap=ve.binaryMapKey=void 0;var Wo=s((n,e,t)=>{let r=t-e,i=16777215>>>Math.max(0,(3-r)*8),o=(n[e+0]|n[e+1]<<8|n[e+2]<<16)&i,u=16777215>>>Math.min(31,Math.max(0,(6-r)*8)),a=(n[e+3]|n[e+4]<<8|n[e+5]<<16)&u;return o+16777216*a},"binaryMapKey");ve.binaryMapKey=Wo;var Kn=class n{static{s(this,"BinaryMap")}constructor(){this.nested=new Map,this.final=new Map}get(e,t=0,r=e.length){let i=r<6+t,o=(0,ve.binaryMapKey)(e,t,r);return i?this.final.get(o):this.nested.get(o)?.get(e,6+t,r)}set(e,t){let r=(0,ve.binaryMapKey)(e,0,e.length);if(e.length<6){this.final.set(r,t);return}let o=this.nested.get(r);if(o instanceof n)o.set(e.subarray(6),t);else{let u=new n;u.set(e.subarray(6),t),this.nested.set(r,u)}}};ve.BinaryMap=Kn;var we=new Int32Array(128),ue=new Int32Array(128);function Bo(n,e,t){if(t===1)return[e.get(n)];let r=2147483647,i=-1;for(;we.length0&&(we[ue[i-1]]=u(i-1,1));for(let l=i+1;l{"use strict";d();Object.defineProperty(Ut,"__esModule",{value:!0});Ut.makeTextEncoder=void 0;var Vn=class{static{s(this,"UniversalTextEncoder")}constructor(){this.length=0,this.encoder=new TextEncoder}encode(e){let t=this.encoder.encode(e);return this.length=t.length,t}},Qn=class{static{s(this,"NodeTextEncoder")}constructor(){this.buffer=Buffer.alloc(256),this.length=0}encode(e){for(;;){if(this.length=this.buffer.write(e,"utf8"),this.lengthtypeof Buffer<"u"?new Qn:new Vn,"makeTextEncoder");Ut.makeTextEncoder=$o});var _s=M(zt=>{"use strict";d();Object.defineProperty(zt,"__esModule",{value:!0});zt.LRUCache=void 0;var Xn=class{static{s(this,"LRUCache")}constructor(e){this.size=e,this.nodes=new Map}get(e){let t=this.nodes.get(e);if(t)return this.moveToHead(t),t.value}set(e,t){let r=this.nodes.get(e);if(r)r.value=t,this.moveToHead(r);else{let i=new Yn(e,t);this.nodes.set(e,i),this.addNode(i),this.nodes.size>this.size&&(this.nodes.delete(this.tail.key),this.removeNode(this.tail))}}moveToHead(e){this.removeNode(e),e.next=void 0,e.prev=void 0,this.addNode(e)}addNode(e){this.head&&(this.head.prev=e,e.next=this.head),this.tail||(this.tail=e),this.head=e}removeNode(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev}};zt.LRUCache=Xn;var Yn=class{static{s(this,"Node")}constructor(e,t){this.key=e,this.value=t}}});var Zn=M(jt=>{"use strict";d();Object.defineProperty(jt,"__esModule",{value:!0});jt.TikTokenizer=void 0;var qt=ps(),Ho=gs(),Go=_s();function Ko(n){let e=new Map;try{let i=require("fs").readFileSync(n,"utf-8");return t(i),e}catch(r){throw new Error(`Failed to load from BPE encoder file stream: ${r}`)}function t(r){for(let i of r.split(/[\r\n]+/)){if(i.trim()==="")continue;let o=i.split(" ");if(o.length!==2)throw new Error("Invalid format in the BPE encoder file stream");let u=new Uint8Array(Buffer.from(o[0],"base64")),a=parseInt(o[1]);if(!isNaN(a))e.set(u,a);else throw new Error(`Can't parse ${o[1]} to integer`)}}s(t,"processBpeRanks")}s(Ko,"loadTikTokenBpe");function Vo(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}s(Vo,"escapeRegExp");var Jn=class{static{s(this,"TikTokenizer")}constructor(e,t,r,i=8192){this.textEncoder=(0,Ho.makeTextEncoder)(),this.textDecoder=new TextDecoder("utf-8"),this.cache=new Go.LRUCache(i);let o=typeof e=="string"?Ko(e):e;this.init(o,t,r)}init(e,t,r){this.encoder=new qt.BinaryMap;for(let[i,o]of e)this.encoder.set(i,o);this.regex=new RegExp(r,"gu"),this.specialTokensRegex=new RegExp(Array.from(t.keys()).map(i=>Vo(i)).join("|")),this.specialTokensEncoder=t,this.decoder=new Map;for(let[i,o]of e)this.decoder.set(o,i);if(e.size!==this.decoder.size)throw new Error("Encoder and decoder sizes do not match");this.specialTokensDecoder=new Map;for(let[i,o]of t)this.specialTokensDecoder.set(o,i)}findNextSpecialToken(e,t,r){let i=t,o=null;if(r&&this.specialTokensRegex)for(;o=e.slice(i).match(this.specialTokensRegex),!(!o||r&&r.includes(o[0]));)i+=o.index+1;let u=o?i+o.index:e.length;return[o,u]}encode(e,t){let r=[],i=0;for(;;){let o,u;if([o,u]=this.findNextSpecialToken(e,i,t),u>i&&this.encodeByIndex(e,r,i,u),o){if(i=i+this.encodeSpecialToken(r,o),i>=e.length)break}else break}return r}encodeSpecialToken(e,t){let r=this.specialTokensEncoder?.get(t[0]);return e.push(r),t.index+t[0].length}encodeByIndex(e,t,r,i){let o,u=e.substring(r,i);for(this.regex.lastIndex=0;o=this.regex.exec(u);){let a=this.cache.get(o[0]);if(a)for(let l of a)t.push(l);else{let l=this.textEncoder.encode(o[0]),c=this.encoder.get(l,0,this.textEncoder.length);if(c!==void 0)t.push(c),this.cache.set(o[0],[c]);else{let h=(0,qt.bytePairEncode)(l,this.encoder,this.textEncoder.length);for(let f of h)t.push(f);this.cache.set(o[0],h)}}}}encodeTrimSuffixByIndex(e,t,r,i,o,u,a){let l,c=e.substring(r,i);for(this.regex.lastIndex=0;l=this.regex.exec(c);){let h=l[0],f=this.cache.get(h);if(f)if(u+f.length<=o)u+=f.length,a+=h.length,t.push(...f);else{let _=o-u;u+=_,a+=h.length,t.push(...f.slice(0,_));break}else{let _=this.textEncoder.encode(h),A=this.encoder.get(_,0,_.length);if(A!==void 0)if(this.cache.set(h,[A]),u+1<=o)u++,a+=h.length,t.push(A);else break;else{let z=(0,qt.bytePairEncode)(_,this.encoder,this.textEncoder.length);if(this.cache.set(h,z),u+z.length<=o){u+=z.length,a+=h.length;for(let j of z)t.push(j)}else{let j=o-u;u+=j,a+=h.length;for(let q=0;q=o)break}return{tokenCount:u,encodeLength:a}}encodeTrimSuffix(e,t,r){let i=[],o=0,u=0,a=0;for(;;){let c,h;if([c,h]=this.findNextSpecialToken(e,o,r),h>o){let{tokenCount:f,encodeLength:_}=this.encodeTrimSuffixByIndex(e,i,o,h,t,u,a);if(u=f,a=_,u>=t)break}if(c!==null){if(u++,u<=t&&(o=o+this.encodeSpecialToken(i,c),a+=c[0].length,o>=e.length)||u>=t)break}else break}let l=a===e.length?e:e.slice(0,a);return{tokenIds:i,text:l}}encodeTrimPrefix(e,t,r){let i=[],o=0,u=0,a=0,l=new Map;for(l.set(u,a);;){let _,A;if([_,A]=this.findNextSpecialToken(e,o,r),A>o){let z,j=e.substring(o,A);for(this.regex.lastIndex=0;z=this.regex.exec(j);){let q=z[0],V=this.cache.get(q);if(V)u+=V.length,a+=q.length,i.push(...V),l.set(u,a);else{let ce=this.textEncoder.encode(q),Y=this.encoder.get(ce);if(Y!==void 0)this.cache.set(q,[Y]),u++,a+=q.length,i.push(Y),l.set(u,a);else{let Ce=(0,qt.bytePairEncode)(ce,this.encoder,this.textEncoder.length);this.cache.set(q,Ce),u+=Ce.length,a+=q.length;for(let ht of Ce)i.push(ht);l.set(u,a)}}}}if(_!==null){if(o=o+this.encodeSpecialToken(i,_),u++,a+=_[0].length,l.set(u,a),o>=e.length)break}else break}if(u<=t)return{tokenIds:i,text:e};let c=u-t,h=0,f=0;for(let[_,A]of l)if(_>=c){h=_,f=A;break}if(h>t){let _=this.encode(e,r),A=_.slice(_.length-t);return{tokenIds:A,text:this.decode(A)}}return{tokenIds:i.slice(h),text:e.slice(f)}}decode(e){let t=[];for(let r of e){let i=[],o=this.decoder?.get(r);if(o!==void 0)i=Array.from(o);else{let u=this.specialTokensDecoder?.get(r);if(u!==void 0){let a=this.textEncoder.encode(u);i=Array.from(a.subarray(0,this.textEncoder.length))}}t.push(...i)}return this.textDecoder.decode(new Uint8Array(t))}};jt.TikTokenizer=Jn});var xs=M(Q=>{"use strict";d();Object.defineProperty(Q,"__esModule",{value:!0});Q.createTokenizer=Q.createByEncoderName=Q.createByModelName=Q.getRegexByModel=Q.getRegexByEncoder=Q.getSpecialTokensByModel=Q.getSpecialTokensByEncoder=Q.MODEL_TO_ENCODING=void 0;var Qo=Zn(),Xo=new Map([["gpt-4o-","o200k_base"],["gpt-4-","cl100k_base"],["gpt-3.5-turbo-","cl100k_base"],["gpt-35-turbo-","cl100k_base"]]);Q.MODEL_TO_ENCODING=new Map([["gpt-4o","o200k_base"],["gpt-4","cl100k_base"],["gpt-3.5-turbo","cl100k_base"],["text-davinci-003","p50k_base"],["text-davinci-002","p50k_base"],["text-davinci-001","r50k_base"],["text-curie-001","r50k_base"],["text-babbage-001","r50k_base"],["text-ada-001","r50k_base"],["davinci","r50k_base"],["curie","r50k_base"],["babbage","r50k_base"],["ada","r50k_base"],["code-davinci-002","p50k_base"],["code-davinci-001","p50k_base"],["code-cushman-002","p50k_base"],["code-cushman-001","p50k_base"],["davinci-codex","p50k_base"],["cushman-codex","p50k_base"],["text-davinci-edit-001","p50k_edit"],["code-davinci-edit-001","p50k_edit"],["text-embedding-ada-002","cl100k_base"],["text-similarity-davinci-001","r50k_base"],["text-similarity-curie-001","r50k_base"],["text-similarity-babbage-001","r50k_base"],["text-similarity-ada-001","r50k_base"],["text-search-davinci-doc-001","r50k_base"],["text-search-curie-doc-001","r50k_base"],["text-search-babbage-doc-001","r50k_base"],["text-search-ada-doc-001","r50k_base"],["code-search-babbage-code-001","r50k_base"],["code-search-ada-code-001","r50k_base"],["gpt2","gpt2"]]);var Wt="<|endoftext|>",bs="<|fim_prefix|>",ys="<|fim_middle|>",Cs="<|fim_suffix|>",ws="<|endofprompt|>",mt="'s|'t|'re|'ve|'m|'ll|'d| ?\\p{L}+| ?\\p{N}+| ?[^\\s\\p{L}\\p{N}]+|\\s+(?!\\S)|\\s+",vs="(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)|[^\\r\\n\\p{L}\\p{N}]?\\p{L}+|\\p{N}{1,3}| ?[^\\s\\p{L}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+",Yo=[`[^\r -\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]*[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]+(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,`[^\r -\\p{L}\\p{N}]?[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}\\p{M}]+[\\p{Ll}\\p{Lm}\\p{Lo}\\p{M}]*(?:'s|'S|'t|'T|'re|'RE|'Re|'eR|'ve|'VE|'vE|'Ve|'m|'M|'ll|'lL|'Ll|'LL|'d|'D)?`,"\\p{N}{1,3}"," ?[^\\s\\p{L}\\p{N}]+[\\r\\n/]*","\\s*[\\r\\n]+","\\s+(?!\\S)","\\s+"],ks=Yo.join("|");function er(n){let e="";if(Q.MODEL_TO_ENCODING.has(n))e=Q.MODEL_TO_ENCODING.get(n);else for(let[t,r]of Xo)if(n.startsWith(t)){e=r;break}return e}s(er,"getEncoderFromModelName");async function Jo(n,e){let t=require("fs"),r=await fetch(n);if(!r.ok)throw new Error(`Failed to fetch file from ${n}. Status code: ${r.status}`);let i=await r.text();t.writeFileSync(e,i)}s(Jo,"fetchAndSaveFile");function tr(n){let e=new Map([[Wt,50256]]);switch(n){case"o200k_base":e=new Map([[Wt,199999],[ws,200018]]);break;case"cl100k_base":e=new Map([[Wt,100257],[bs,100258],[ys,100259],[Cs,100260],[ws,100276]]);break;case"p50k_edit":e=new Map([[Wt,50256],[bs,50281],[ys,50282],[Cs,50283]]);break;default:break}return e}s(tr,"getSpecialTokensByEncoder");Q.getSpecialTokensByEncoder=tr;function Zo(n){let e=er(n);return tr(e)}s(Zo,"getSpecialTokensByModel");Q.getSpecialTokensByModel=Zo;function Es(n){switch(n){case"o200k_base":return ks;case"cl100k_base":return vs;default:break}return mt}s(Es,"getRegexByEncoder");Q.getRegexByEncoder=Es;function eu(n){let e=er(n);return Es(e)}s(eu,"getRegexByModel");Q.getRegexByModel=eu;async function tu(n,e=null){return Ls(er(n),e)}s(tu,"createByModelName");Q.createByModelName=tu;async function Ls(n,e=null){let t,r,i=tr(n);switch(n){case"o200k_base":t=ks,r="https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken";break;case"cl100k_base":t=vs,r="https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken";break;case"p50k_base":t=mt,r="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"p50k_edit":t=mt,r="https://openaipublic.blob.core.windows.net/encodings/p50k_base.tiktoken";break;case"r50k_base":t=mt,r="https://openaipublic.blob.core.windows.net/encodings/r50k_base.tiktoken";break;case"gpt2":t=mt,r="https://raw.githubusercontent.com/microsoft/Tokenizer/main/model/gpt2.tiktoken";break;default:throw new Error(`Doesn't support this encoder [${n}]`)}e!==null&&(i=new Map([...i,...e]));let o=require("fs"),u=require("path"),a=u.basename(r),l=u.resolve(__dirname,"..","model");o.existsSync(l)||o.mkdirSync(l,{recursive:!0});let c=u.resolve(l,a);return o.existsSync(c)||(console.log(`Downloading file from ${r}`),await Jo(r,c),console.log(`Saved file to ${c}`)),Ts(c,i,t)}s(Ls,"createByEncoderName");Q.createByEncoderName=Ls;function Ts(n,e,t,r=8192){return new Qo.TikTokenizer(n,e,t,r)}s(Ts,"createTokenizer");Q.createTokenizer=Ts});var Ns=M(X=>{"use strict";d();Object.defineProperty(X,"__esModule",{value:!0});X.createTokenizer=X.createByEncoderName=X.createByModelName=X.getSpecialTokensByModel=X.getSpecialTokensByEncoder=X.getRegexByModel=X.getRegexByEncoder=X.MODEL_TO_ENCODING=X.TikTokenizer=void 0;var nu=Zn();Object.defineProperty(X,"TikTokenizer",{enumerable:!0,get:s(function(){return nu.TikTokenizer},"get")});var Fe=xs();Object.defineProperty(X,"MODEL_TO_ENCODING",{enumerable:!0,get:s(function(){return Fe.MODEL_TO_ENCODING},"get")});Object.defineProperty(X,"getRegexByEncoder",{enumerable:!0,get:s(function(){return Fe.getRegexByEncoder},"get")});Object.defineProperty(X,"getRegexByModel",{enumerable:!0,get:s(function(){return Fe.getRegexByModel},"get")});Object.defineProperty(X,"getSpecialTokensByEncoder",{enumerable:!0,get:s(function(){return Fe.getSpecialTokensByEncoder},"get")});Object.defineProperty(X,"getSpecialTokensByModel",{enumerable:!0,get:s(function(){return Fe.getSpecialTokensByModel},"get")});Object.defineProperty(X,"createByModelName",{enumerable:!0,get:s(function(){return Fe.createByModelName},"get")});Object.defineProperty(X,"createByEncoderName",{enumerable:!0,get:s(function(){return Fe.createByEncoderName},"get")});Object.defineProperty(X,"createTokenizer",{enumerable:!0,get:s(function(){return Fe.createTokenizer},"get")})});var fr=M(Te=>{"use strict";d();var Is;Object.defineProperty(Te,"__esModule",{value:!0});Te.SetWithKey=void 0;Te.groupBy=hu;Te.groupByMap=du;Te.diffSets=mu;Te.diffMaps=pu;Te.intersection=gu;function hu(n,e){let t=Object.create(null);for(let r of n){let i=e(r),o=t[i];o||(o=t[i]=[]),o.push(r)}return t}s(hu,"groupBy");function du(n,e){let t=new Map;for(let r of n){let i=e(r),o=t.get(i);o||(o=[],t.set(i,o)),o.push(r)}return t}s(du,"groupByMap");function mu(n,e){let t=[],r=[];for(let i of n)e.has(i)||t.push(i);for(let i of e)n.has(i)||r.push(i);return{removed:t,added:r}}s(mu,"diffSets");function pu(n,e){let t=[],r=[];for(let[i,o]of n)e.has(i)||t.push(o);for(let[i,o]of e)n.has(i)||r.push(o);return{removed:t,added:r}}s(pu,"diffMaps");function gu(n,e){let t=new Set;for(let r of e)n.has(r)&&t.add(r);return t}s(gu,"intersection");var cr=class{static{s(this,"SetWithKey")}static{Is=Symbol.toStringTag}constructor(e,t){this.toKey=t,this._map=new Map,this[Is]="SetWithKey";for(let r of e)this.add(r)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(r=>e.call(t,r,r,this))}[Symbol.iterator](){return this.values()}};Te.SetWithKey=cr});var He=M(I=>{"use strict";d();Object.defineProperty(I,"__esModule",{value:!0});I.BugIndicatingError=I.ErrorNoTelemetry=I.ExpectedError=I.NotSupportedError=I.NotImplementedError=I.ReadonlyError=I.PendingMigrationError=I.CancellationError=I.canceledName=I.errorHandler=I.ErrorHandler=void 0;I.setUnexpectedErrorHandler=_u;I.isSigPipeError=bu;I.onBugIndicatingError=yu;I.onUnexpectedError=Cu;I.onUnexpectedExternalError=wu;I.transformErrorForSerialization=Ss;I.transformErrorFromSerialization=Rs;I.isCancellationError=br;I.canceled=vu;I.illegalArgument=ku;I.illegalState=Eu;I.getErrorMessage=Lu;var Kt=class{static{s(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?$e.isErrorNoTelemetry(e)?new $e(e.message+` +"use strict";var z1=Object.create;var Pn=Object.defineProperty;var $1=Object.getOwnPropertyDescriptor;var B1=Object.getOwnPropertyNames;var H1=Object.getPrototypeOf,G1=Object.prototype.hasOwnProperty;var s=(t,e)=>Pn(t,"name",{value:e,configurable:!0});var V1=(t,e)=>()=>(t&&(e=t(t=0)),e);var U=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var K1=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of B1(e))!G1.call(t,i)&&i!==n&&Pn(t,i,{get:()=>e[i],enumerable:!(r=$1(e,i))||r.enumerable});return t};var Pe=(t,e,n)=>(n=t!=null?z1(H1(t)):{},K1(e||!t||!t.__esModule?Pn(n,"default",{value:t,enumerable:!0}):n,t));var I,_=V1(()=>{"use strict";I=typeof document>"u"?require("node:url").pathToFileURL(__filename).href:I});var Un=U(Ce=>{"use strict";_();var Wi;Object.defineProperty(Ce,"__esModule",{value:!0});Ce.SetWithKey=void 0;Ce.groupBy=no;Ce.groupByMap=ro;Ce.diffSets=io;Ce.diffMaps=so;Ce.intersection=oo;function no(t,e){let n=Object.create(null);for(let r of t){let i=e(r),o=n[i];o||(o=n[i]=[]),o.push(r)}return n}s(no,"groupBy");function ro(t,e){let n=new Map;for(let r of t){let i=e(r),o=n.get(i);o||(o=[],n.set(i,o)),o.push(r)}return n}s(ro,"groupByMap");function io(t,e){let n=[],r=[];for(let i of t)e.has(i)||n.push(i);for(let i of e)t.has(i)||r.push(i);return{removed:n,added:r}}s(io,"diffSets");function so(t,e){let n=[],r=[];for(let[i,o]of t)e.has(i)||n.push(o);for(let[i,o]of e)t.has(i)||r.push(o);return{removed:n,added:r}}s(so,"diffMaps");function oo(t,e){let n=new Set;for(let r of e)t.has(r)&&n.add(r);return n}s(oo,"intersection");var Fn=class{static{s(this,"SetWithKey")}static{Wi=Symbol.toStringTag}constructor(e,n){this.toKey=n,this._map=new Map,this[Wi]="SetWithKey";for(let r of e)this.add(r)}get size(){return this._map.size}add(e){let n=this.toKey(e);return this._map.set(n,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,n){this._map.forEach(r=>e.call(n,r,r,this))}[Symbol.iterator](){return this.values()}};Ce.SetWithKey=Fn});var Ue=U(x=>{"use strict";_();Object.defineProperty(x,"__esModule",{value:!0});x.BugIndicatingError=x.ErrorNoTelemetry=x.ExpectedError=x.NotSupportedError=x.NotImplementedError=x.ReadonlyError=x.PendingMigrationError=x.CancellationError=x.canceledName=x.errorHandler=x.ErrorHandler=void 0;x.setUnexpectedErrorHandler=uo;x.isSigPipeError=ao;x.onBugIndicatingError=lo;x.onUnexpectedError=co;x.onUnexpectedExternalError=fo;x.transformErrorForSerialization=ji;x.transformErrorFromSerialization=zi;x.isCancellationError=Hn;x.canceled=ho;x.illegalArgument=mo;x.illegalState=po;x.getErrorMessage=go;var Pt=class{static{s(this,"ErrorHandler")}constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Fe.isErrorNoTelemetry(e)?new Fe(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)}};I.ErrorHandler=Kt;I.errorHandler=new Kt;function _u(n){I.errorHandler.setUnexpectedErrorHandler(n)}s(_u,"setUnexpectedErrorHandler");function bu(n){if(!n||typeof n!="object")return!1;let e=n;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}s(bu,"isSigPipeError");function yu(n){I.errorHandler.onUnexpectedError(n)}s(yu,"onBugIndicatingError");function Cu(n){br(n)||I.errorHandler.onUnexpectedError(n)}s(Cu,"onUnexpectedError");function wu(n){br(n)||I.errorHandler.onUnexpectedExternalError(n)}s(wu,"onUnexpectedExternalError");function Ss(n){if(n instanceof Error){let{name:e,message:t,cause:r}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:$e.isErrorNoTelemetry(n),cause:r?Ss(r):void 0,code:n.code}}return n}s(Ss,"transformErrorForSerialization");function Rs(n){let e;return n.noTelemetry?e=new $e:(e=new Error,e.name=n.name),e.message=n.message,e.stack=n.stack,n.code&&(e.code=n.code),n.cause&&(e.cause=Rs(n.cause)),e}s(Rs,"transformErrorFromSerialization");I.canceledName="Canceled";function br(n){return n instanceof Vt?!0:n instanceof Error&&n.name===I.canceledName&&n.message===I.canceledName}s(br,"isCancellationError");var Vt=class extends Error{static{s(this,"CancellationError")}constructor(){super(I.canceledName),this.name=this.message}};I.CancellationError=Vt;var hr=class n extends Error{static{s(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof n||e instanceof Error&&e.name===n._name}constructor(e){super(e),this.name=n._name}};I.PendingMigrationError=hr;function vu(){let n=new Error(I.canceledName);return n.name=n.message,n}s(vu,"canceled");function ku(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}s(ku,"illegalArgument");function Eu(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}s(Eu,"illegalState");var dr=class extends TypeError{static{s(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};I.ReadonlyError=dr;function Lu(n){return n?n.message?n.message:n.stack?n.stack.split(` -`)[0]:String(n):"Error"}s(Lu,"getErrorMessage");var mr=class extends Error{static{s(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};I.NotImplementedError=mr;var pr=class extends Error{static{s(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};I.NotSupportedError=pr;var gr=class extends Error{static{s(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};I.ExpectedError=gr;var $e=class n extends Error{static{s(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof n)return e;let t=new n;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};I.ErrorNoTelemetry=$e;var _r=class n extends Error{static{s(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,n.prototype)}};I.BugIndicatingError=_r});var Cr=M(yr=>{"use strict";d();Object.defineProperty(yr,"__esModule",{value:!0});yr.createSingleCallFunction=Tu;function Tu(n,e){let t=this,r=!1,i;return function(){if(r)return i;if(r=!0,e)try{i=n.apply(t,arguments)}finally{e()}else i=n.apply(t,arguments);return i}}s(Tu,"createSingleCallFunction")});var Fs=M(Z=>{"use strict";d();Object.defineProperty(Z,"__esModule",{value:!0});Z.MonotonousArray=void 0;Z.findLast=xu;Z.findLastIdx=Os;Z.findFirst=Nu;Z.findFirstIdx=Ds;Z.findLastMonotonous=Au;Z.findLastIdxMonotonous=vr;Z.findFirstMonotonous=Pu;Z.findFirstIdxMonotonousOrArrLen=kr;Z.findFirstIdxMonotonous=Iu;Z.findFirstMax=Ms;Z.findLastMax=Su;Z.findFirstMin=Ru;Z.findMaxIdx=Ou;Z.mapFindFirst=Du;function xu(n,e,t=n.length-1){let r=Os(n,e,t);if(r!==-1)return n[r]}s(xu,"findLast");function Os(n,e,t=n.length-1){for(let r=t;r>=0;r--){let i=n[r];if(e(i,r))return r}return-1}s(Os,"findLastIdx");function Nu(n,e,t=0){let r=Ds(n,e,t);if(r!==-1)return n[r]}s(Nu,"findFirst");function Ds(n,e,t=0){for(let r=t;r0&&(t=i)}return t}s(Ms,"findFirstMax");function Su(n,e){if(n.length===0)return;let t=n[0];for(let r=1;r=0&&(t=i)}return t}s(Su,"findLastMax");function Ru(n,e){return Ms(n,(t,r)=>-e(t,r))}s(Ru,"findFirstMin");function Ou(n,e){if(n.length===0)return-1;let t=0;for(let r=1;r0&&(t=r)}return t}s(Ou,"findMaxIdx");function Du(n,e){for(let t of n){let r=e(t);if(r!==void 0)return r}}s(Du,"mapFindFirst")});var $s=M(L=>{"use strict";d();Object.defineProperty(L,"__esModule",{value:!0});L.Permutation=L.CallbackIterable=L.ArrayQueue=L.booleanComparator=L.numberComparator=L.CompareResult=void 0;L.tail=Uu;L.equals=zu;L.removeFastWithoutKeepingOrder=qu;L.binarySearch=ju;L.binarySearch2=Us;L.quickSelect=Er;L.groupBy=Wu;L.groupAdjacentBy=Bu;L.forEachAdjacent=$u;L.forEachWithNeighbors=Hu;L.concatArrays=Gu;L.sortedDiff=zs;L.delta=Ku;L.top=Vu;L.topAsync=Qu;L.coalesce=Xu;L.coalesceInPlace=Yu;L.move=Ju;L.isFalsyOrEmpty=Zu;L.isNonEmptyArray=ea;L.distinct=ta;L.uniqueFilter=na;L.commonPrefixLength=ra;L.range=ia;L.index=sa;L.insert=oa;L.remove=js;L.arrayInsert=ua;L.shuffle=aa;L.pushToStart=la;L.pushToEnd=ca;L.pushMany=fa;L.mapArrayOrNot=ha;L.mapFilter=da;L.withoutDuplicates=ma;L.asArray=pa;L.getRandomElement=ga;L.insertInto=Ws;L.splice=_a;L.compareBy=ba;L.tieBreakComparators=ya;L.reverseOrder=va;L.compareUndefinedSmallest=ka;L.findAsync=Ea;L.sum=La;L.sumBy=Ta;var Mu=Fs(),Fu=He();function Uu(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}s(Uu,"tail");function zu(n,e,t=(r,i)=>r===i){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let r=0,i=n.length;rt(n[r],e))}s(ju,"binarySearch");function Us(n,e){let t=0,r=n-1;for(;t<=r;){let i=(t+r)/2|0,o=e(i);if(o<0)t=i+1;else if(o>0)r=i-1;else return i}return-(t+1)}s(Us,"binarySearch2");function Er(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");let r=e[Math.floor(e.length*Math.random())],i=[],o=[],u=[];for(let a of e){let l=t(a,r);l<0?i.push(a):l>0?o.push(a):u.push(a)}return n0&&(i(o,0,[l]),u+=1)}return r}s(zs,"sortedDiff");function Ku(n,e,t){let r=zs(n,e,t),i=[],o=[];for(let u of r)i.push(...n.slice(u.start,u.start+u.deleteCount)),o.push(...u.toInsert);return{removed:i,added:o}}s(Ku,"delta");function Vu(n,e,t){if(t===0)return[];let r=n.slice(0,t).sort(e);return qs(n,e,r,t,n.length),r}s(Vu,"top");function Qu(n,e,t,r,i){return t===0?Promise.resolve([]):new Promise((o,u)=>{(async()=>{let a=n.length,l=n.slice(0,t).sort(e);for(let c=t,h=Math.min(t+r,a);ct&&await new Promise(f=>setTimeout(f)),i&&i.isCancellationRequested)throw new Fu.CancellationError;qs(n,e,l,c,h)}return l})().then(o,u)})}s(Qu,"topAsync");function qs(n,e,t,r,i){for(let o=t.length;re(u,l)<0);t.splice(a,0,u)}}}s(qs,"topStep");function Xu(n){return n.filter(e=>!!e)}s(Xu,"coalesce");function Yu(n){let e=0;for(let t=0;t0}s(ea,"isNonEmptyArray");function ta(n,e=t=>t){let t=new Set;return n.filter(r=>{let i=e(r);return t.has(i)?!1:(t.add(i),!0)})}s(ta,"distinct");function na(n){let e=new Set;return t=>{let r=n(t);return e.has(r)?!1:(e.add(r),!0)}}s(na,"uniqueFilter");function ra(n,e,t=(r,i)=>r===i){let r=0;for(let i=0,o=Math.min(n.length,e.length);ie;i--)r.push(i);return r}s(ia,"range");function sa(n,e,t){return n.reduce((r,i)=>(r[e(i)]=t?t(i):i,r),Object.create(null))}s(sa,"index");function oa(n,e){return n.push(e),()=>js(n,e)}s(oa,"insert");function js(n,e){let t=n.indexOf(e);if(t>-1)return n.splice(t,1),e}s(js,"remove");function ua(n,e,t){let r=n.slice(0,e),i=n.slice(e);return r.concat(t,i)}s(ua,"arrayInsert");function aa(n,e){let t;if(typeof e=="number"){let r=e;t=s(()=>{let i=Math.sin(r++)*179426549;return i-Math.floor(i)},"rand")}else t=Math.random;for(let r=n.length-1;r>0;r-=1){let i=Math.floor(t()*(r+1)),o=n[r];n[r]=n[i],n[i]=o}}s(aa,"shuffle");function la(n,e){let t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}s(la,"pushToStart");function ca(n,e){let t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}s(ca,"pushToEnd");function fa(n,e){for(let t of e)n.push(t)}s(fa,"pushMany");function ha(n,e){return Array.isArray(n)?n.map(e):e(n)}s(ha,"mapArrayOrNot");function da(n,e){let t=[];for(let r of n){let i=e(r);i!==void 0&&t.push(i)}return t}s(da,"mapFilter");function ma(n){let e=new Set(n);return Array.from(e)}s(ma,"withoutDuplicates");function pa(n){return Array.isArray(n)?n:[n]}s(pa,"asArray");function ga(n){return n[Math.floor(Math.random()*n.length)]}s(ga,"getRandomElement");function Ws(n,e,t){let r=Bs(n,e),i=n.length,o=t.length;n.length=i+o;for(let u=i-1;u>=r;u--)n[u+o]=n[u];for(let u=0;u0}s(r,"isGreaterThan"),n.isGreaterThan=r;function i(o){return o===0}s(i,"isNeitherLessOrGreaterThan"),n.isNeitherLessOrGreaterThan=i,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Ue||(L.CompareResult=Ue={}));function ba(n,e){return(t,r)=>e(n(t),n(r))}s(ba,"compareBy");function ya(...n){return(e,t)=>{for(let r of n){let i=r(e,t);if(!Ue.isNeitherLessOrGreaterThan(i))return i}return Ue.neitherLessOrGreaterThan}}s(ya,"tieBreakComparators");var Ca=s((n,e)=>n-e,"numberComparator");L.numberComparator=Ca;var wa=s((n,e)=>(0,L.numberComparator)(n?1:0,e?1:0),"booleanComparator");L.booleanComparator=wa;function va(n){return(e,t)=>-n(e,t)}s(va,"reverseOrder");function ka(n){return(e,t)=>e===void 0?t===void 0?Ue.neitherLessOrGreaterThan:Ue.lessThan:t===void 0?Ue.greaterThan:n(e,t)}s(ka,"compareUndefinedSmallest");var Lr=class{static{s(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;let r=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,r}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}};L.ArrayQueue=Lr;var Tr=class n{static{s(this,"CallbackIterable")}static{this.empty=new n(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new n(t=>this.iterate(r=>e(r)?t(r):!0))}map(e){return new n(t=>this.iterate(r=>t(e(r))))}some(e){let t=!1;return this.iterate(r=>(t=e(r),!t)),t}findFirst(e){let t;return this.iterate(r=>e(r)?(t=r,!1):!0),t}findLast(e){let t;return this.iterate(r=>(e(r)&&(t=r),!0)),t}findLastMaxBy(e){let t,r=!0;return this.iterate(i=>((r||Ue.isGreaterThan(e(i,t)))&&(r=!1,t=i),!0)),t}};L.CallbackIterable=Tr;var xr=class n{static{s(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,t){let r=Array.from(e.keys()).sort((i,o)=>t(e[i],e[o]));return new n(r)}apply(e){return e.map((t,r)=>e[this._indexMap[r]])}inverse(){let e=this._indexMap.slice();for(let t=0;t({element:r,ok:await e(r,i)})))).find(r=>r.ok)?.element}s(Ea,"findAsync");function La(n){return n.reduce((e,t)=>e+t,0)}s(La,"sum");function Ta(n,e){return n.reduce((t,r)=>t+e(r),0)}s(Ta,"sumBy")});var Vs=M(G=>{"use strict";d();var Hs,Gs,Ks;Object.defineProperty(G,"__esModule",{value:!0});G.NKeyMap=G.SetMap=G.BidirectionalMap=G.CounterSet=G.MRUCache=G.LRUCache=G.LinkedMap=G.ResourceSet=G.ResourceMap=void 0;G.getOrSet=xa;G.mapToString=Na;G.setToString=Aa;G.mapsStrictEqualIgnoreOrder=Ia;function xa(n,e,t){let r=n.get(e);return r===void 0&&(r=t,n.set(e,r)),r}s(xa,"getOrSet");function Na(n){let e=[];return n.forEach((t,r)=>{e.push(`${r} => ${t}`)}),`Map(${n.size}) {${e.join(", ")}}`}s(Na,"mapToString");function Aa(n){let e=[];return n.forEach(t=>{e.push(t)}),`Set(${n.size}) {${e.join(", ")}}`}s(Aa,"setToString");var Nr=class{static{s(this,"ResourceMapEntry")}constructor(e,t){this.uri=e,this.value=t}};function Pa(n){return Array.isArray(n)}s(Pa,"isEntries");var pt=class n{static{s(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,t){if(this[Hs]="ResourceMap",e instanceof n)this.map=new Map(e.map),this.toKey=t??n.defaultToKey;else if(Pa(e)){this.map=new Map,this.toKey=t??n.defaultToKey;for(let[r,i]of e)this.set(r,i)}else this.map=new Map,this.toKey=e??n.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Nr(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(let[r,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Hs=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};G.ResourceMap=pt;var Ar=class{static{s(this,"ResourceSet")}constructor(e,t){this[Gs]="ResourceSet",!e||typeof e=="function"?this._map=new pt(e):(this._map=new pt(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((r,i)=>e.call(t,i,i,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Gs=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};G.ResourceSet=Ar;var Qt=class{static{s(this,"LinkedMap")}constructor(){this[Ks]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){let r=this._map.get(e);if(r)return t!==0&&this.touch(r,t),r.value}set(e,t,r=0){let i=this._map.get(e);if(i)i.value=t,r!==0&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,t=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}values(){let e=this,t=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}entries(){let e=this,t=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}[(Ks=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.previous,r--;this._tail=t,this._size=r,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};G.LinkedMap=Qt;var Xt=class extends Qt{static{s(this,"Cache")}constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},Pr=class extends Xt{static{s(this,"LRUCache")}constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}};G.LRUCache=Pr;var Ir=class extends Xt{static{s(this,"MRUCache")}constructor(e,t=1){super(e,t)}trim(e){this.trimNew(e)}set(e,t){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,t),this}};G.MRUCache=Ir;var Sr=class{static{s(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let t=this.map.get(e)||0;return t===0?!1:(t--,t===0?this.map.delete(e):this.map.set(e,t),!0)}has(e){return this.map.has(e)}};G.CounterSet=Sr;var Rr=class{static{s(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[t,r]of e)this.set(t,r)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}forEach(e,t){this._m1.forEach((r,i)=>{e.call(t,r,i,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};G.BidirectionalMap=Rr;var Or=class{static{s(this,"SetMap")}constructor(){this.map=new Map}add(e,t){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(t)}delete(e,t){let r=this.map.get(e);r&&(r.delete(t),r.size===0&&this.map.delete(e))}forEach(e,t){let r=this.map.get(e);r&&r.forEach(t)}get(e){let t=this.map.get(e);return t||new Set}};G.SetMap=Or;function Ia(n,e){if(n===e)return!0;if(n.size!==e.size)return!1;for(let[t,r]of n)if(!e.has(t)||e.get(t)!==r)return!1;for(let[t]of e)if(!n.has(t))return!1;return!0}s(Ia,"mapsStrictEqualIgnoreOrder");var Dr=class{static{s(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...t){let r=this._data;for(let i=0;i{let i="";for(let[o,u]of t)i+=`${" ".repeat(r)}${o}: `,u instanceof Map?i+=` +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(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)}};x.ErrorHandler=Pt;x.errorHandler=new Pt;function uo(t){x.errorHandler.setUnexpectedErrorHandler(t)}s(uo,"setUnexpectedErrorHandler");function ao(t){if(!t||typeof t!="object")return!1;let e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}s(ao,"isSigPipeError");function lo(t){x.errorHandler.onUnexpectedError(t)}s(lo,"onBugIndicatingError");function co(t){Hn(t)||x.errorHandler.onUnexpectedError(t)}s(co,"onUnexpectedError");function fo(t){Hn(t)||x.errorHandler.onUnexpectedExternalError(t)}s(fo,"onUnexpectedExternalError");function ji(t){if(t instanceof Error){let{name:e,message:n,cause:r}=t,i=t.stacktrace||t.stack;return{$isError:!0,name:e,message:n,stack:i,noTelemetry:Fe.isErrorNoTelemetry(t),cause:r?ji(r):void 0,code:t.code}}return t}s(ji,"transformErrorForSerialization");function zi(t){let e;return t.noTelemetry?e=new Fe:(e=new Error,e.name=t.name),e.message=t.message,e.stack=t.stack,t.code&&(e.code=t.code),t.cause&&(e.cause=zi(t.cause)),e}s(zi,"transformErrorFromSerialization");x.canceledName="Canceled";function Hn(t){return t instanceof It?!0:t instanceof Error&&t.name===x.canceledName&&t.message===x.canceledName}s(Hn,"isCancellationError");var It=class extends Error{static{s(this,"CancellationError")}constructor(){super(x.canceledName),this.name=this.message}};x.CancellationError=It;var qn=class t extends Error{static{s(this,"PendingMigrationError")}static{this._name="PendingMigrationError"}static is(e){return e instanceof t||e instanceof Error&&e.name===t._name}constructor(e){super(e),this.name=t._name}};x.PendingMigrationError=qn;function ho(){let t=new Error(x.canceledName);return t.name=t.message,t}s(ho,"canceled");function mo(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}s(mo,"illegalArgument");function po(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}s(po,"illegalState");var Wn=class extends TypeError{static{s(this,"ReadonlyError")}constructor(e){super(e?`${e} is read-only and cannot be changed`:"Cannot change read-only property")}};x.ReadonlyError=Wn;function go(t){return t?t.message?t.message:t.stack?t.stack.split(` +`)[0]:String(t):"Error"}s(go,"getErrorMessage");var jn=class extends Error{static{s(this,"NotImplementedError")}constructor(e){super("NotImplemented"),e&&(this.message=e)}};x.NotImplementedError=jn;var zn=class extends Error{static{s(this,"NotSupportedError")}constructor(e){super("NotSupported"),e&&(this.message=e)}};x.NotSupportedError=zn;var $n=class extends Error{static{s(this,"ExpectedError")}constructor(){super(...arguments),this.isExpected=!0}};x.ExpectedError=$n;var Fe=class t extends Error{static{s(this,"ErrorNoTelemetry")}constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof t)return e;let n=new t;return n.message=e.message,n.stack=e.stack,n}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};x.ErrorNoTelemetry=Fe;var Bn=class t extends Error{static{s(this,"BugIndicatingError")}constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,t.prototype)}};x.BugIndicatingError=Bn});var Vn=U(Gn=>{"use strict";_();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.createSingleCallFunction=_o;function _o(t,e){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,e)try{i=t.apply(n,arguments)}finally{e()}else i=t.apply(n,arguments);return i}}s(_o,"createSingleCallFunction")});var Gi=U(Q=>{"use strict";_();Object.defineProperty(Q,"__esModule",{value:!0});Q.MonotonousArray=void 0;Q.findLast=bo;Q.findLastIdx=$i;Q.findFirst=Co;Q.findFirstIdx=Bi;Q.findLastMonotonous=yo;Q.findLastIdxMonotonous=Qn;Q.findFirstMonotonous=vo;Q.findFirstIdxMonotonousOrArrLen=Yn;Q.findFirstIdxMonotonous=wo;Q.findFirstMax=Hi;Q.findLastMax=Eo;Q.findFirstMin=Lo;Q.findMaxIdx=No;Q.mapFindFirst=To;function bo(t,e,n=t.length-1){let r=$i(t,e,n);if(r!==-1)return t[r]}s(bo,"findLast");function $i(t,e,n=t.length-1){for(let r=n;r>=0;r--){let i=t[r];if(e(i,r))return r}return-1}s($i,"findLastIdx");function Co(t,e,n=0){let r=Bi(t,e,n);if(r!==-1)return t[r]}s(Co,"findFirst");function Bi(t,e,n=0){for(let r=n;r0&&(n=i)}return n}s(Hi,"findFirstMax");function Eo(t,e){if(t.length===0)return;let n=t[0];for(let r=1;r=0&&(n=i)}return n}s(Eo,"findLastMax");function Lo(t,e){return Hi(t,(n,r)=>-e(n,r))}s(Lo,"findFirstMin");function No(t,e){if(t.length===0)return-1;let n=0;for(let r=1;r0&&(n=r)}return n}s(No,"findMaxIdx");function To(t,e){for(let n of t){let r=e(n);if(r!==void 0)return r}}s(To,"mapFindFirst")});var Zi=U(N=>{"use strict";_();Object.defineProperty(N,"__esModule",{value:!0});N.Permutation=N.CallbackIterable=N.ArrayQueue=N.booleanComparator=N.numberComparator=N.CompareResult=void 0;N.tail=xo;N.equals=Po;N.removeFastWithoutKeepingOrder=Io;N.binarySearch=So;N.binarySearch2=Vi;N.quickSelect=Xn;N.groupBy=Ro;N.groupAdjacentBy=Oo;N.forEachAdjacent=Do;N.forEachWithNeighbors=Mo;N.concatArrays=Fo;N.sortedDiff=Ki;N.delta=Uo;N.top=qo;N.topAsync=Wo;N.coalesce=jo;N.coalesceInPlace=zo;N.move=$o;N.isFalsyOrEmpty=Bo;N.isNonEmptyArray=Ho;N.distinct=Go;N.uniqueFilter=Vo;N.commonPrefixLength=Ko;N.range=Qo;N.index=Yo;N.insert=Xo;N.remove=Yi;N.arrayInsert=Jo;N.shuffle=Zo;N.pushToStart=eu;N.pushToEnd=tu;N.pushMany=nu;N.mapArrayOrNot=ru;N.mapFilter=iu;N.withoutDuplicates=su;N.asArray=ou;N.getRandomElement=uu;N.insertInto=Xi;N.splice=au;N.compareBy=lu;N.tieBreakComparators=cu;N.reverseOrder=du;N.compareUndefinedSmallest=mu;N.findAsync=pu;N.sum=gu;N.sumBy=_u;var Ao=Gi(),ko=Ue();function xo(t){if(t.length===0)throw new Error("Invalid tail call");return[t.slice(0,t.length-1),t[t.length-1]]}s(xo,"tail");function Po(t,e,n=(r,i)=>r===i){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let r=0,i=t.length;rn(t[r],e))}s(So,"binarySearch");function Vi(t,e){let n=0,r=t-1;for(;n<=r;){let i=(n+r)/2|0,o=e(i);if(o<0)n=i+1;else if(o>0)r=i-1;else return i}return-(n+1)}s(Vi,"binarySearch2");function Xn(t,e,n){if(t=t|0,t>=e.length)throw new TypeError("invalid index");let r=e[Math.floor(e.length*Math.random())],i=[],o=[],u=[];for(let a of e){let l=n(a,r);l<0?i.push(a):l>0?o.push(a):u.push(a)}return t0&&(i(o,0,[l]),u+=1)}return r}s(Ki,"sortedDiff");function Uo(t,e,n){let r=Ki(t,e,n),i=[],o=[];for(let u of r)i.push(...t.slice(u.start,u.start+u.deleteCount)),o.push(...u.toInsert);return{removed:i,added:o}}s(Uo,"delta");function qo(t,e,n){if(n===0)return[];let r=t.slice(0,n).sort(e);return Qi(t,e,r,n,t.length),r}s(qo,"top");function Wo(t,e,n,r,i){return n===0?Promise.resolve([]):new Promise((o,u)=>{(async()=>{let a=t.length,l=t.slice(0,n).sort(e);for(let c=n,d=Math.min(n+r,a);cn&&await new Promise(f=>setTimeout(f)),i&&i.isCancellationRequested)throw new ko.CancellationError;Qi(t,e,l,c,d)}return l})().then(o,u)})}s(Wo,"topAsync");function Qi(t,e,n,r,i){for(let o=n.length;re(u,l)<0);n.splice(a,0,u)}}}s(Qi,"topStep");function jo(t){return t.filter(e=>!!e)}s(jo,"coalesce");function zo(t){let e=0;for(let n=0;n0}s(Ho,"isNonEmptyArray");function Go(t,e=n=>n){let n=new Set;return t.filter(r=>{let i=e(r);return n.has(i)?!1:(n.add(i),!0)})}s(Go,"distinct");function Vo(t){let e=new Set;return n=>{let r=t(n);return e.has(r)?!1:(e.add(r),!0)}}s(Vo,"uniqueFilter");function Ko(t,e,n=(r,i)=>r===i){let r=0;for(let i=0,o=Math.min(t.length,e.length);ie;i--)r.push(i);return r}s(Qo,"range");function Yo(t,e,n){return t.reduce((r,i)=>(r[e(i)]=n?n(i):i,r),Object.create(null))}s(Yo,"index");function Xo(t,e){return t.push(e),()=>Yi(t,e)}s(Xo,"insert");function Yi(t,e){let n=t.indexOf(e);if(n>-1)return t.splice(n,1),e}s(Yi,"remove");function Jo(t,e,n){let r=t.slice(0,e),i=t.slice(e);return r.concat(n,i)}s(Jo,"arrayInsert");function Zo(t,e){let n;if(typeof e=="number"){let r=e;n=s(()=>{let i=Math.sin(r++)*179426549;return i-Math.floor(i)},"rand")}else n=Math.random;for(let r=t.length-1;r>0;r-=1){let i=Math.floor(n()*(r+1)),o=t[r];t[r]=t[i],t[i]=o}}s(Zo,"shuffle");function eu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.unshift(e))}s(eu,"pushToStart");function tu(t,e){let n=t.indexOf(e);n>-1&&(t.splice(n,1),t.push(e))}s(tu,"pushToEnd");function nu(t,e){for(let n of e)t.push(n)}s(nu,"pushMany");function ru(t,e){return Array.isArray(t)?t.map(e):e(t)}s(ru,"mapArrayOrNot");function iu(t,e){let n=[];for(let r of t){let i=e(r);i!==void 0&&n.push(i)}return n}s(iu,"mapFilter");function su(t){let e=new Set(t);return Array.from(e)}s(su,"withoutDuplicates");function ou(t){return Array.isArray(t)?t:[t]}s(ou,"asArray");function uu(t){return t[Math.floor(Math.random()*t.length)]}s(uu,"getRandomElement");function Xi(t,e,n){let r=Ji(t,e),i=t.length,o=n.length;t.length=i+o;for(let u=i-1;u>=r;u--)t[u+o]=t[u];for(let u=0;u0}s(r,"isGreaterThan"),t.isGreaterThan=r;function i(o){return o===0}s(i,"isNeitherLessOrGreaterThan"),t.isNeitherLessOrGreaterThan=i,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Ie||(N.CompareResult=Ie={}));function lu(t,e){return(n,r)=>e(t(n),t(r))}s(lu,"compareBy");function cu(...t){return(e,n)=>{for(let r of t){let i=r(e,n);if(!Ie.isNeitherLessOrGreaterThan(i))return i}return Ie.neitherLessOrGreaterThan}}s(cu,"tieBreakComparators");var fu=s((t,e)=>t-e,"numberComparator");N.numberComparator=fu;var hu=s((t,e)=>(0,N.numberComparator)(t?1:0,e?1:0),"booleanComparator");N.booleanComparator=hu;function du(t){return(e,n)=>-t(e,n)}s(du,"reverseOrder");function mu(t){return(e,n)=>e===void 0?n===void 0?Ie.neitherLessOrGreaterThan:Ie.lessThan:n===void 0?Ie.greaterThan:t(e,n)}s(mu,"compareUndefinedSmallest");var Jn=class{static{s(this,"ArrayQueue")}constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let n=this.firstIdx;for(;n=0&&e(this.items[n]);)n--;let r=n===this.lastIdx?null:this.items.slice(n+1,this.lastIdx+1);return this.lastIdx=n,r}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}removeLast(){let e=this.items[this.lastIdx];return this.lastIdx--,e}takeCount(e){let n=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,n}};N.ArrayQueue=Jn;var Zn=class t{static{s(this,"CallbackIterable")}static{this.empty=new t(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(n=>(e(n),!0))}toArray(){let e=[];return this.iterate(n=>(e.push(n),!0)),e}filter(e){return new t(n=>this.iterate(r=>e(r)?n(r):!0))}map(e){return new t(n=>this.iterate(r=>n(e(r))))}some(e){let n=!1;return this.iterate(r=>(n=e(r),!n)),n}findFirst(e){let n;return this.iterate(r=>e(r)?(n=r,!1):!0),n}findLast(e){let n;return this.iterate(r=>(e(r)&&(n=r),!0)),n}findLastMaxBy(e){let n,r=!0;return this.iterate(i=>((r||Ie.isGreaterThan(e(i,n)))&&(r=!1,n=i),!0)),n}};N.CallbackIterable=Zn;var er=class t{static{s(this,"Permutation")}constructor(e){this._indexMap=e}static createSortPermutation(e,n){let r=Array.from(e.keys()).sort((i,o)=>n(e[i],e[o]));return new t(r)}apply(e){return e.map((n,r)=>e[this._indexMap[r]])}inverse(){let e=this._indexMap.slice();for(let n=0;n({element:r,ok:await e(r,i)})))).find(r=>r.ok)?.element}s(pu,"findAsync");function gu(t){return t.reduce((e,n)=>e+n,0)}s(gu,"sum");function _u(t,e){return t.reduce((n,r)=>n+e(r),0)}s(_u,"sumBy")});var rs=U($=>{"use strict";_();var es,ts,ns;Object.defineProperty($,"__esModule",{value:!0});$.NKeyMap=$.SetMap=$.BidirectionalMap=$.CounterSet=$.MRUCache=$.LRUCache=$.LinkedMap=$.ResourceSet=$.ResourceMap=void 0;$.getOrSet=bu;$.mapToString=Cu;$.setToString=yu;$.mapsStrictEqualIgnoreOrder=wu;function bu(t,e,n){let r=t.get(e);return r===void 0&&(r=n,t.set(e,r)),r}s(bu,"getOrSet");function Cu(t){let e=[];return t.forEach((n,r)=>{e.push(`${r} => ${n}`)}),`Map(${t.size}) {${e.join(", ")}}`}s(Cu,"mapToString");function yu(t){let e=[];return t.forEach(n=>{e.push(n)}),`Set(${t.size}) {${e.join(", ")}}`}s(yu,"setToString");var tr=class{static{s(this,"ResourceMapEntry")}constructor(e,n){this.uri=e,this.value=n}};function vu(t){return Array.isArray(t)}s(vu,"isEntries");var ot=class t{static{s(this,"ResourceMap")}static{this.defaultToKey=e=>e.toString()}constructor(e,n){if(this[es]="ResourceMap",e instanceof t)this.map=new Map(e.map),this.toKey=n??t.defaultToKey;else if(vu(e)){this.map=new Map,this.toKey=n??t.defaultToKey;for(let[r,i]of e)this.set(r,i)}else this.map=new Map,this.toKey=e??t.defaultToKey}set(e,n){return this.map.set(this.toKey(e),new tr(e,n)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,n){typeof n<"u"&&(e=e.bind(n));for(let[r,i]of this.map)e(i.value,i.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(es=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}};$.ResourceMap=ot;var nr=class{static{s(this,"ResourceSet")}constructor(e,n){this[ts]="ResourceSet",!e||typeof e=="function"?this._map=new ot(e):(this._map=new ot(n),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,n){this._map.forEach((r,i)=>e.call(n,i,i,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(ts=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};$.ResourceSet=nr;var St=class{static{s(this,"LinkedMap")}constructor(){this[ns]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=0){let r=this._map.get(e);if(r)return n!==0&&this.touch(r,n),r.value}set(e,n,r=0){let i=this._map.get(e);if(i)i.value=n,r!==0&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case 0:this.addItemLast(i);break;case 1:this.addItemFirst(i);break;case 2:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let n=this._map.get(e);if(n)return this._map.delete(e),this.removeItem(n),this._size--,n.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,n){let r=this._state,i=this._head;for(;i;){if(n?e.bind(n)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.key,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}values(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:r.value,done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}entries(){let e=this,n=this._state,r=this._head,i={[Symbol.iterator](){return i},next(){if(e._state!==n)throw new Error("LinkedMap got modified during iteration.");if(r){let o={value:[r.key,r.value],done:!1};return r=r.next,o}else return{value:void 0,done:!0}}};return i}[(ns=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._head,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.next,r--;this._head=n,this._size=r,n&&(n.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let n=this._tail,r=this.size;for(;n&&r>e;)this._map.delete(n.key),n=n.previous,r--;this._tail=n,this._size=r,n&&(n.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let n=e.next,r=e.previous;if(!n||!r)throw new Error("Invalid list");n.previous=r,r.next=n}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(n!==1&&n!==2)){if(n===1){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===2){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((n,r)=>{e.push([r,n])}),e}fromJSON(e){this.clear();for(let[n,r]of e)this.set(n,r)}};$.LinkedMap=St;var Rt=class extends St{static{s(this,"Cache")}constructor(e,n=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,n),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=2){return super.get(e,n)}peek(e){return super.get(e,0)}set(e,n){return super.set(e,n,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},rr=class extends Rt{static{s(this,"LRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimOld(e)}set(e,n){return super.set(e,n),this.checkTrim(),this}};$.LRUCache=rr;var ir=class extends Rt{static{s(this,"MRUCache")}constructor(e,n=1){super(e,n)}trim(e){this.trimNew(e)}set(e,n){return this._limit<=this.size&&!this.has(e)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(e,n),this}};$.MRUCache=ir;var sr=class{static{s(this,"CounterSet")}constructor(){this.map=new Map}add(e){return this.map.set(e,(this.map.get(e)||0)+1),this}delete(e){let n=this.map.get(e)||0;return n===0?!1:(n--,n===0?this.map.delete(e):this.map.set(e,n),!0)}has(e){return this.map.has(e)}};$.CounterSet=sr;var or=class{static{s(this,"BidirectionalMap")}constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[n,r]of e)this.set(n,r)}clear(){this._m1.clear(),this._m2.clear()}set(e,n){this._m1.set(e,n),this._m2.set(n,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let n=this._m1.get(e);return n===void 0?!1:(this._m1.delete(e),this._m2.delete(n),!0)}forEach(e,n){this._m1.forEach((r,i)=>{e.call(n,r,i,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}};$.BidirectionalMap=or;var ur=class{static{s(this,"SetMap")}constructor(){this.map=new Map}add(e,n){let r=this.map.get(e);r||(r=new Set,this.map.set(e,r)),r.add(n)}delete(e,n){let r=this.map.get(e);r&&(r.delete(n),r.size===0&&this.map.delete(e))}forEach(e,n){let r=this.map.get(e);r&&r.forEach(n)}get(e){let n=this.map.get(e);return n||new Set}};$.SetMap=ur;function wu(t,e){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[n,r]of t)if(!e.has(n)||e.get(n)!==r)return!1;for(let[n]of e)if(!t.has(n))return!1;return!0}s(wu,"mapsStrictEqualIgnoreOrder");var ar=class{static{s(this,"NKeyMap")}constructor(){this._data=new Map}set(e,...n){let r=this._data;for(let i=0;i{let i="";for(let[o,u]of n)i+=`${" ".repeat(r)}${o}: `,u instanceof Map?i+=` `+e(u,r+1):i+=`${u} -`;return i},"printMap");return e(this._data,0)}};G.NKeyMap=Dr});var Qs=M(xe=>{"use strict";d();Object.defineProperty(xe,"__esModule",{value:!0});xe.ok=Sa;xe.assertNever=Ra;xe.softAssertNever=Oa;xe.assert=Da;xe.softAssert=Ma;xe.assertFn=Fa;xe.checkAdjacentItems=Ua;var gt=He();function Sa(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}s(Sa,"ok");function Ra(n,e="Unreachable"){throw new Error(e)}s(Ra,"assertNever");function Oa(n){}s(Oa,"softAssertNever");function Da(n,e="unexpected state"){if(!n)throw typeof e=="string"?new gt.BugIndicatingError(`Assertion Failed: ${e}`):e}s(Da,"assert");function Ma(n,e="Soft Assertion Failed"){n||(0,gt.onUnexpectedError)(new gt.BugIndicatingError(e))}s(Ma,"softAssert");function Fa(n){if(!n()){debugger;n(),(0,gt.onUnexpectedError)(new gt.BugIndicatingError("Assertion Failed"))}}s(Fa,"assertFn");function Ua(n,e){let t=0;for(;t{"use strict";d();Object.defineProperty(W,"__esModule",{value:!0});W.isOneOf=void 0;W.isString=Mr;W.isStringArray=qa;W.isArrayOf=Xs;W.isObject=Ys;W.isTypedArray=ja;W.isNumber=Wa;W.isIterable=Ba;W.isAsyncIterable=$a;W.isBoolean=Ha;W.isUndefined=Js;W.isDefined=Ga;W.isUndefinedOrNull=Yt;W.assertType=Ka;W.assertReturnsDefined=Va;W.assertDefined=Qa;W.assertReturnsAllDefined=Xa;W.typeCheck=Ja;W.isEmptyObject=el;W.isFunction=Fr;W.areFunctions=tl;W.validateConstraints=nl;W.validateConstraint=Zs;W.upcast=rl;W.hasKey=il;var za=Qs();function Mr(n){return typeof n=="string"}s(Mr,"isString");function qa(n){return Xs(n,Mr)}s(qa,"isStringArray");function Xs(n,e){return Array.isArray(n)&&n.every(e)}s(Xs,"isArrayOf");function Ys(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}s(Ys,"isObject");function ja(n){let e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}s(ja,"isTypedArray");function Wa(n){return typeof n=="number"&&!isNaN(n)}s(Wa,"isNumber");function Ba(n){return!!n&&typeof n[Symbol.iterator]=="function"}s(Ba,"isIterable");function $a(n){return!!n&&typeof n[Symbol.asyncIterator]=="function"}s($a,"isAsyncIterable");function Ha(n){return n===!0||n===!1}s(Ha,"isBoolean");function Js(n){return typeof n>"u"}s(Js,"isUndefined");function Ga(n){return!Yt(n)}s(Ga,"isDefined");function Yt(n){return Js(n)||n===null}s(Yt,"isUndefinedOrNull");function Ka(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}s(Ka,"assertType");function Va(n){return(0,za.assert)(n!=null,"Argument is `undefined` or `null`."),n}s(Va,"assertReturnsDefined");function Qa(n,e){if(n==null)throw typeof e=="string"?new Error(e):e}s(Qa,"assertDefined");function Xa(...n){let e=[];for(let t=0;te.includes(n),"isOneOf");W.isOneOf=Ya;function Ja(n){}s(Ja,"typeCheck");var Za=Object.prototype.hasOwnProperty;function el(n){if(!Ys(n))return!1;for(let e in n)if(Za.call(n,e))return!1;return!0}s(el,"isEmptyObject");function Fr(n){return typeof n=="function"}s(Fr,"isFunction");function tl(...n){return n.length>0&&n.every(Fr)}s(tl,"areFunctions");function nl(n,e){let t=Math.min(n.length,e.length);for(let r=0;r{"use strict";d();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.Iterable=void 0;var sl=Ur(),e1;(function(n){function e(T){return!!T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}s(e,"is"),n.is=e;let t=Object.freeze([]);function r(){return t}s(r,"empty"),n.empty=r;function*i(T){yield T}s(i,"single"),n.single=i;function o(T){return e(T)?T:i(T)}s(o,"wrap"),n.wrap=o;function u(T){return T??t}s(u,"from"),n.from=u;function*a(T){for(let P=T.length-1;P>=0;P--)yield T[P]}s(a,"reverse"),n.reverse=a;function l(T){return!T||T[Symbol.iterator]().next().done===!0}s(l,"isEmpty"),n.isEmpty=l;function c(T){return T[Symbol.iterator]().next().value}s(c,"first"),n.first=c;function h(T,P){let U=0;for(let re of T)if(P(re,U++))return!0;return!1}s(h,"some"),n.some=h;function f(T,P){let U=0;for(let re of T)if(!P(re,U++))return!1;return!0}s(f,"every"),n.every=f;function _(T,P){for(let U of T)if(P(U))return U}s(_,"find"),n.find=_;function*A(T,P){for(let U of T)P(U)&&(yield U)}s(A,"filter"),n.filter=A;function*z(T,P){let U=0;for(let re of T)yield P(re,U++)}s(z,"map"),n.map=z;function*j(T,P){let U=0;for(let re of T)yield*P(re,U++)}s(j,"flatMap"),n.flatMap=j;function*q(...T){for(let P of T)(0,sl.isIterable)(P)?yield*P:yield P}s(q,"concat"),n.concat=q;function V(T,P,U){let re=U;for(let Ze of T)re=P(re,Ze);return re}s(V,"reduce"),n.reduce=V;function ce(T){let P=0;for(let U of T)P++;return P}s(ce,"length"),n.length=ce;function*Y(T,P,U=T.length){for(P<-T.length&&(P=0),P<0&&(P+=T.length),U<0?U+=T.length:U>T.length&&(U=T.length);P{"use strict";d();Object.defineProperty(O,"__esModule",{value:!0});O.DisposableResourceMap=O.DisposableSet=O.DisposableMap=O.ImmortalReference=O.AsyncReferenceCollection=O.ReferenceCollection=O.RefCountedDisposable=O.MandatoryMutableDisposable=O.MutableDisposable=O.Disposable=O.DisposableStore=O.DisposableTracker=O.GCBasedDisposableTracker=void 0;O.setDisposableTracker=s1;O.trackDisposable=Ke;O.markAsDisposed=Ve;O.markAsSingleton=fl;O.isDisposable=o1;O.dispose=bt;O.disposeIfDisposable=hl;O.combinedDisposable=dl;O.toDisposable=Qr;O.disposeOnReturn=ml;O.thenIfNotDisposed=pl;O.thenRegisterOrDispose=gl;var n1=$s(),ol=fr(),i1=Vs(),ul=Cr(),al=t1(),r1=He(),ll=!1,Ge=null,zr=class{static{s(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let t=new Error("CREATED via:").stack;this._registry.register(e,t,e)}setParent(e,t){t?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};O.GCBasedDisposableTracker=zr;var qr=class n{static{s(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let t=this.livingDisposables.get(e);return t||(t={parent:null,source:null,isSingleton:!1,value:e,idx:n.idx++},this.livingDisposables.set(e,t)),t}trackDisposable(e){let t=this.getDisposableData(e);t.source||(t.source=new Error().stack)}setParent(e,t){let r=this.getDisposableData(e);r.parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){let r=t.get(e);if(r)return r;let i=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,i),i}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,t){let r;if(t)r=t;else{let l=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,l).isSingleton);if(c.length===0)return;let h=new Set(c.map(f=>f.value));if(r=c.filter(f=>!(f.parent&&h.has(f.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(l){function c(f,_){for(;f.length>0&&_.some(A=>typeof A=="string"?A===f[0]:f[0].match(A));)f.shift()}s(c,"removePrefix");let h=l.source.split(` -`).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}s(i,"getStackTracePath");let o=new i1.SetMap;for(let l of r){let c=i(l);for(let h=0;h<=c.length;h++)o.add(c.slice(0,h).join(` -`),l)}r.sort((0,n1.compareBy)(l=>l.idx,n1.numberComparator));let u="",a=0;for(let l of r.slice(0,e)){a++;let c=i(l),h=[];for(let f=0;fi(q)[f]),q=>q);delete j[c[f]];for(let[q,V]of Object.entries(j))V&&h.unshift(` - stacktraces of ${V.length} other leaks continue with ${q}`);h.unshift(_)}u+=` +`;return i},"printMap");return e(this._data,0)}};$.NKeyMap=ar});var is=U(ye=>{"use strict";_();Object.defineProperty(ye,"__esModule",{value:!0});ye.ok=Eu;ye.assertNever=Lu;ye.softAssertNever=Nu;ye.assert=Tu;ye.softAssert=Au;ye.assertFn=ku;ye.checkAdjacentItems=xu;var ut=Ue();function Eu(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}s(Eu,"ok");function Lu(t,e="Unreachable"){throw new Error(e)}s(Lu,"assertNever");function Nu(t){}s(Nu,"softAssertNever");function Tu(t,e="unexpected state"){if(!t)throw typeof e=="string"?new ut.BugIndicatingError(`Assertion Failed: ${e}`):e}s(Tu,"assert");function Au(t,e="Soft Assertion Failed"){t||(0,ut.onUnexpectedError)(new ut.BugIndicatingError(e))}s(Au,"softAssert");function ku(t){if(!t()){debugger;t(),(0,ut.onUnexpectedError)(new ut.BugIndicatingError("Assertion Failed"))}}s(ku,"assertFn");function xu(t,e){let n=0;for(;n{"use strict";_();Object.defineProperty(q,"__esModule",{value:!0});q.isOneOf=void 0;q.isString=lr;q.isStringArray=Iu;q.isArrayOf=ss;q.isObject=os;q.isTypedArray=Su;q.isNumber=Ru;q.isIterable=Ou;q.isAsyncIterable=Du;q.isBoolean=Mu;q.isUndefined=us;q.isDefined=Fu;q.isUndefinedOrNull=Ot;q.assertType=Uu;q.assertReturnsDefined=qu;q.assertDefined=Wu;q.assertReturnsAllDefined=ju;q.typeCheck=$u;q.isEmptyObject=Hu;q.isFunction=cr;q.areFunctions=Gu;q.validateConstraints=Vu;q.validateConstraint=as;q.upcast=Ku;q.hasKey=Qu;var Pu=is();function lr(t){return typeof t=="string"}s(lr,"isString");function Iu(t){return ss(t,lr)}s(Iu,"isStringArray");function ss(t,e){return Array.isArray(t)&&t.every(e)}s(ss,"isArrayOf");function os(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}s(os,"isObject");function Su(t){let e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}s(Su,"isTypedArray");function Ru(t){return typeof t=="number"&&!isNaN(t)}s(Ru,"isNumber");function Ou(t){return!!t&&typeof t[Symbol.iterator]=="function"}s(Ou,"isIterable");function Du(t){return!!t&&typeof t[Symbol.asyncIterator]=="function"}s(Du,"isAsyncIterable");function Mu(t){return t===!0||t===!1}s(Mu,"isBoolean");function us(t){return typeof t>"u"}s(us,"isUndefined");function Fu(t){return!Ot(t)}s(Fu,"isDefined");function Ot(t){return us(t)||t===null}s(Ot,"isUndefinedOrNull");function Uu(t,e){if(!t)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}s(Uu,"assertType");function qu(t){return(0,Pu.assert)(t!=null,"Argument is `undefined` or `null`."),t}s(qu,"assertReturnsDefined");function Wu(t,e){if(t==null)throw typeof e=="string"?new Error(e):e}s(Wu,"assertDefined");function ju(...t){let e=[];for(let n=0;ne.includes(t),"isOneOf");q.isOneOf=zu;function $u(t){}s($u,"typeCheck");var Bu=Object.prototype.hasOwnProperty;function Hu(t){if(!os(t))return!1;for(let e in t)if(Bu.call(t,e))return!1;return!0}s(Hu,"isEmptyObject");function cr(t){return typeof t=="function"}s(cr,"isFunction");function Gu(...t){return t.length>0&&t.every(cr)}s(Gu,"areFunctions");function Vu(t,e){let n=Math.min(t.length,e.length);for(let r=0;r{"use strict";_();Object.defineProperty(Dt,"__esModule",{value:!0});Dt.Iterable=void 0;var Yu=fr(),ls;(function(t){function e(T){return!!T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}s(e,"is"),t.is=e;let n=Object.freeze([]);function r(){return n}s(r,"empty"),t.empty=r;function*i(T){yield T}s(i,"single"),t.single=i;function o(T){return e(T)?T:i(T)}s(o,"wrap"),t.wrap=o;function u(T){return T??n}s(u,"from"),t.from=u;function*a(T){for(let k=T.length-1;k>=0;k--)yield T[k]}s(a,"reverse"),t.reverse=a;function l(T){return!T||T[Symbol.iterator]().next().done===!0}s(l,"isEmpty"),t.isEmpty=l;function c(T){return T[Symbol.iterator]().next().value}s(c,"first"),t.first=c;function d(T,k){let F=0;for(let ee of T)if(k(ee,F++))return!0;return!1}s(d,"some"),t.some=d;function f(T,k){let F=0;for(let ee of T)if(!k(ee,F++))return!1;return!0}s(f,"every"),t.every=f;function y(T,k){for(let F of T)if(k(F))return F}s(y,"find"),t.find=y;function*D(T,k){for(let F of T)k(F)&&(yield F)}s(D,"filter"),t.filter=D;function*B(T,k){let F=0;for(let ee of T)yield k(ee,F++)}s(B,"map"),t.map=B;function*H(T,k){let F=0;for(let ee of T)yield*k(ee,F++)}s(H,"flatMap"),t.flatMap=H;function*X(...T){for(let k of T)(0,Yu.isIterable)(k)?yield*k:yield k}s(X,"concat"),t.concat=X;function de(T,k,F){let ee=F;for(let Ve of T)ee=k(ee,Ve);return ee}s(de,"reduce"),t.reduce=de;function oe(T){let k=0;for(let F of T)k++;return k}s(oe,"length"),t.length=oe;function*K(T,k,F=T.length){for(k<-T.length&&(k=0),k<0&&(k+=T.length),F<0?F+=T.length:F>T.length&&(F=T.length);k{"use strict";_();Object.defineProperty(R,"__esModule",{value:!0});R.DisposableResourceMap=R.DisposableSet=R.DisposableMap=R.ImmortalReference=R.AsyncReferenceCollection=R.ReferenceCollection=R.RefCountedDisposable=R.MandatoryMutableDisposable=R.MutableDisposable=R.Disposable=R.DisposableStore=R.DisposableTracker=R.GCBasedDisposableTracker=void 0;R.setDisposableTracker=ms;R.trackDisposable=We;R.markAsDisposed=je;R.markAsSingleton=na;R.isDisposable=ps;R.dispose=lt;R.disposeIfDisposable=ra;R.combinedDisposable=ia;R.toDisposable=wr;R.disposeOnReturn=sa;R.thenIfNotDisposed=oa;R.thenRegisterOrDispose=ua;var fs=Zi(),Xu=Un(),ds=rs(),Ju=Vn(),Zu=cs(),hs=Ue(),ea=!1,qe=null,hr=class{static{s(this,"GCBasedDisposableTracker")}constructor(){this._registry=new FinalizationRegistry(e=>{console.warn(`[LEAKED DISPOSABLE] ${e}`)})}trackDisposable(e){let n=new Error("CREATED via:").stack;this._registry.register(e,n,e)}setParent(e,n){n?this._registry.unregister(e):this.trackDisposable(e)}markAsDisposed(e){this._registry.unregister(e)}markAsSingleton(e){this._registry.unregister(e)}};R.GCBasedDisposableTracker=hr;var dr=class t{static{s(this,"DisposableTracker")}constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(e){let n=this.livingDisposables.get(e);return n||(n={parent:null,source:null,isSingleton:!1,value:e,idx:t.idx++},this.livingDisposables.set(e,n)),n}trackDisposable(e){let n=this.getDisposableData(e);n.source||(n.source=new Error().stack)}setParent(e,n){let r=this.getDisposableData(e);r.parent=n}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,n){let r=n.get(e);if(r)return r;let i=e.parent?this.getRootParent(this.getDisposableData(e.parent),n):e;return n.set(e,i),i}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,r])=>r.source!==null&&!this.getRootParent(r,e).isSingleton).flatMap(([r])=>r)}computeLeakingDisposables(e=10,n){let r;if(n)r=n;else{let l=new Map,c=[...this.livingDisposables.values()].filter(f=>f.source!==null&&!this.getRootParent(f,l).isSingleton);if(c.length===0)return;let d=new Set(c.map(f=>f.value));if(r=c.filter(f=>!(f.parent&&d.has(f.parent))),r.length===0)throw new Error("There are cyclic diposable chains!")}if(!r)return;function i(l){function c(f,y){for(;f.length>0&&y.some(D=>typeof D=="string"?D===f[0]:f[0].match(D));)f.shift()}s(c,"removePrefix");let d=l.source.split(` +`).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(d,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),d.reverse()}s(i,"getStackTracePath");let o=new ds.SetMap;for(let l of r){let c=i(l);for(let d=0;d<=c.length;d++)o.add(c.slice(0,d).join(` +`),l)}r.sort((0,fs.compareBy)(l=>l.idx,fs.numberComparator));let u="",a=0;for(let l of r.slice(0,e)){a++;let c=i(l),d=[];for(let f=0;fi(X)[f]),X=>X);delete H[c[f]];for(let[X,de]of Object.entries(H))de&&d.unshift(` - stacktraces of ${de.length} other leaks continue with ${X}`);d.unshift(y)}u+=` ==================== Leaking disposable ${a}/${r.length}: ${l.value.constructor.name} ==================== -${h.join(` +${d.join(` `)} ============================================================ @@ -24,21 +22,15 @@ ${h.join(` ... and ${r.length-e} more leaking disposables -`),{leaks:r,details:u}}};O.DisposableTracker=qr;function s1(n){Ge=n}s(s1,"setDisposableTracker");if(ll){let n="__is_disposable_tracked__";s1(new class{trackDisposable(e){let t=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[n]||console.log(t)},3e3)}setParent(e,t){if(e&&e!==nt.None)try{e[n]=!0}catch{}}markAsDisposed(e){if(e&&e!==nt.None)try{e[n]=!0}catch{}}markAsSingleton(e){}})}function Ke(n){return Ge?.trackDisposable(n),n}s(Ke,"trackDisposable");function Ve(n){Ge?.markAsDisposed(n)}s(Ve,"markAsDisposed");function Ne(n,e){Ge?.setParent(n,e)}s(Ne,"setParentOfDisposable");function cl(n,e){if(Ge)for(let t of n)Ge.setParent(t,e)}s(cl,"setParentOfDisposables");function fl(n){return Ge?.markAsSingleton(n),n}s(fl,"markAsSingleton");function o1(n){return typeof n=="object"&&n!==null&&typeof n.dispose=="function"&&n.dispose.length===0}s(o1,"isDisposable");function bt(n){if(al.Iterable.is(n)){let e=[];for(let t of n)if(t)try{t.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}s(bt,"dispose");function hl(n){for(let e of n)o1(e)&&e.dispose();return[]}s(hl,"disposeIfDisposable");function dl(...n){let e=Qr(()=>bt(n));return cl(n,e),e}s(dl,"combinedDisposable");var jr=class{static{s(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,Ke(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Ve(this),this._fn()}}};function Qr(n){return new jr(n)}s(Qr,"toDisposable");var _t=class n{static{s(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,Ke(this)}dispose(){this._isDisposed||(Ve(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{bt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===nt.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return Ne(e,this),this._isDisposed?n.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&Ne(e,null)}assertNotDisposed(){this._isDisposed&&(0,r1.onUnexpectedError)(new r1.BugIndicatingError("Object disposed"))}};O.DisposableStore=_t;var nt=class{static{s(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new _t,Ke(this),Ne(this._store,this)}dispose(){Ve(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};O.Disposable=nt;var Zt=class{static{s(this,"MutableDisposable")}constructor(){this._isDisposed=!1,Ke(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Ne(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Ve(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Ne(e,null),e}};O.MutableDisposable=Zt;var Wr=class{static{s(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new Zt,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};O.MandatoryMutableDisposable=Wr;var Br=class{static{s(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};O.RefCountedDisposable=Br;var $r=class{static{s(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...t){let r=this.references.get(e);r||(r={counter:0,object:this.createReferencedObject(e,...t)},this.references.set(e,r));let{object:i}=r,o=(0,ul.createSingleCallFunction)(()=>{--r.counter===0&&(this.destroyReferencedObject(e,r.object),this.references.delete(e))});return r.counter++,{object:i,dispose:o}}};O.ReferenceCollection=$r;var Hr=class{static{s(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...t){let r=this.referenceCollection.acquire(e,...t);try{return{object:await r.object,dispose:s(()=>r.dispose(),"dispose")}}catch(i){throw r.dispose(),i}}};O.AsyncReferenceCollection=Hr;var Gr=class{static{s(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};O.ImmortalReference=Gr;function ml(n){let e=new _t;try{n(e)}finally{e.dispose()}}s(ml,"disposeOnReturn");var en=class{static{s(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,Ke(this)}dispose(){Ve(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{bt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,t,r=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),r||this._store.get(e)?.dispose(),this._store.set(e,t),Ne(t,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let t=this._store.get(e);return t&&Ne(t,null),this._store.delete(e),t}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};O.DisposableMap=en;var Kr=class{static{s(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,Ke(this)}dispose(){Ve(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{bt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),Ne(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return Ne(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};O.DisposableSet=Kr;function pl(n,e){let t=!1;return n.then(r=>{t||e(r)}),Qr(()=>{t=!0})}s(pl,"thenIfNotDisposed");function gl(n,e){return n.then(t=>(e.isDisposed?t.dispose():e.add(t),t))}s(gl,"thenRegisterOrDispose");var Vr=class extends en{static{s(this,"DisposableResourceMap")}constructor(){super(new i1.ResourceMap)}};O.DisposableResourceMap=Vr});var u1=M(nn=>{"use strict";d();Object.defineProperty(nn,"__esModule",{value:!0});nn.LinkedList=void 0;var H=class n{static{s(this,"Node")}static{this.Undefined=new n(void 0)}constructor(e){this.element=e,this.next=n.Undefined,this.prev=n.Undefined}},Xr=class{static{s(this,"LinkedList")}constructor(){this._first=H.Undefined,this._last=H.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===H.Undefined}clear(){let e=this._first;for(;e!==H.Undefined;){let t=e.next;e.prev=H.Undefined,e.next=H.Undefined,e=t}this._first=H.Undefined,this._last=H.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new H(e);if(this._first===H.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==H.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==H.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==H.Undefined)return this._last.element}_remove(e){if(e.prev!==H.Undefined&&e.next!==H.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===H.Undefined&&e.next===H.Undefined?(this._first=H.Undefined,this._last=H.Undefined):e.next===H.Undefined?(this._last=this._last.prev,this._last.next=H.Undefined):e.prev===H.Undefined&&(this._first=this._first.next,this._first.prev=H.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==H.Undefined;)yield e.element,e=e.next}};nn.LinkedList=Xr});var f1=M(rt=>{"use strict";d();Object.defineProperty(rt,"__esModule",{value:!0});rt.getNLSMessages=a1;rt.getNLSLanguage=l1;rt.localize=bl;rt.localize2=yl;function a1(){return globalThis._VSCODE_NLS_MESSAGES}s(a1,"getNLSMessages");function l1(){return globalThis._VSCODE_NLS_LANGUAGE}s(l1,"getNLSLanguage");var _l=l1()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function rn(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(r,i)=>{let o=i[0],u=e[o],a=r;return typeof u=="string"?a=u:(typeof u=="number"||typeof u=="boolean"||u===void 0||u===null)&&(a=String(u)),a}),_l&&(t="\uFF3B"+t.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t}s(rn,"_format");function bl(n,e,...t){return rn(typeof n=="number"?c1(n,e):e,t)}s(bl,"localize");function c1(n,e){let t=a1()?.[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}s(c1,"lookupMessage");function yl(n,e,...t){let r;typeof n=="number"?r=c1(n,e):r=e;let i=rn(r,t);return{value:i,original:e===r?i:rn(e,t)}}s(yl,"localize2")});var Qe=M(p=>{"use strict";d();var Cl=p&&p.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),wl=p&&p.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),vl=p&&p.__importStar||(function(){var n=s(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i=0,vt=Ae.indexOf("Macintosh")>=0,Zr=(Ae.indexOf("Macintosh")>=0||Ae.indexOf("iPad")>=0||Ae.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Ct=Ae.indexOf("Linux")>=0,y1=Ae?.indexOf("Mobi")>=0,Jr=!0,sn=kl.getNLSLanguage()||p.LANGUAGE_DEFAULT,yt=navigator.language.toLowerCase(),Yr=yt):console.error("Unable to resolve platform.");function Ll(n){switch(n){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}s(Ll,"PlatformToString");var on=0;vt?on=1:wt?on=3:Ct&&(on=2);p.isWindows=wt;p.isMacintosh=vt;p.isLinux=Ct;p.isLinuxSnap=p1;p.isNative=g1;p.isElectron=_1;p.isWeb=Jr;p.isWebWorker=Jr&&typeof Pe.importScripts=="function";p.webWorkerOrigin=p.isWebWorker?Pe.origin:void 0;p.isIOS=Zr;p.isMobile=y1;p.isCI=b1;p.platform=on;p.userAgent=Ae;p.language=sn;var h1;(function(n){function e(){return p.language}s(e,"value"),n.value=e;function t(){return p.language.length===2?p.language==="en":p.language.length>=3?p.language[0]==="e"&&p.language[1]==="n"&&p.language[2]==="-":!1}s(t,"isDefaultVariant"),n.isDefaultVariant=t;function r(){return p.language==="en"}s(r,"isDefault"),n.isDefault=r})(h1||(p.Language=h1={}));p.locale=yt;p.platformLocale=Yr;p.translationsConfigFile=C1;p.setTimeout0IsFaster=typeof Pe.postMessage=="function"&&!Pe.importScripts;p.setTimeout0=(()=>{if(p.setTimeout0IsFaster){let n=[];Pe.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let r=0,i=n.length;r{let r=++e;n.push({id:r,callback:t}),Pe.postMessage({vscodeScheduleAsyncWork:r},"*")}}return n=>setTimeout(n)})();p.OS=vt||Zr?2:wt?1:3;var d1=!0,m1=!1;function Tl(){if(!m1){m1=!0;let n=new Uint8Array(2);n[0]=1,n[1]=2,d1=new Uint16Array(n.buffer)[0]===513}return d1}s(Tl,"isLittleEndian");p.isChrome=!!(p.userAgent&&p.userAgent.indexOf("Chrome")>=0);p.isFirefox=!!(p.userAgent&&p.userAgent.indexOf("Firefox")>=0);p.isSafari=!!(!p.isChrome&&p.userAgent&&p.userAgent.indexOf("Safari")>=0);p.isEdge=!!(p.userAgent&&p.userAgent.indexOf("Edg/")>=0);p.isAndroid=!!(p.userAgent&&p.userAgent.indexOf("Android")>=0);function xl(n){return parseFloat(n)>=25}s(xl,"isTahoeOrNewer")});var ti=M(ke=>{"use strict";d();Object.defineProperty(ke,"__esModule",{value:!0});ke.arch=ke.platform=ke.env=ke.cwd=void 0;var v1=Qe(),Xe,ei=globalThis.vscode;if(typeof ei<"u"&&typeof ei.process<"u"){let n=ei.process;Xe={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Xe={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Xe={get platform(){return v1.isWindows?"win32":v1.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};ke.cwd=Xe.cwd;ke.env=Xe.env;ke.platform=Xe.platform;ke.arch=Xe.arch});var ri=M(un=>{"use strict";d();Object.defineProperty(un,"__esModule",{value:!0});un.StopWatch=void 0;var Nl=globalThis.performance.now.bind(globalThis.performance),ni=class n{static{s(this,"StopWatch")}static create(e){return new n(e)}constructor(e){this._now=e===!1?Date.now:Nl,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}};un.StopWatch=ni});var mi=M(F=>{"use strict";d();Object.defineProperty(F,"__esModule",{value:!0});F.ValueWithChangeEvent=F.Relay=F.EventBufferer=F.DynamicListEventMultiplexer=F.EventMultiplexer=F.MicrotaskEmitter=F.DebounceEmitter=F.PauseableEmitter=F.AsyncEmitter=F.createEventDeliveryQueue=F.Emitter=F.ListenerRefusalError=F.ListenerLeakError=F.EventProfiling=F.Event=void 0;F.setGlobalLeakWarningThreshold=Dl;F.trackSetChanges=zl;var Al=fr(),kt=He(),Pl=Cr(),he=tn(),x1=u1(),Il=ti(),Sl=ri(),k1=!1,Rl=!1,Ol=100,E1=6e4;function L1(){return!!Il.env.VSCODE_DEV}s(L1,"_isBufferLeakWarningEnabled");var an;(function(n){n.None=()=>he.Disposable.None;function e(k){if(Rl){let{onDidAddListener:y}=k,w=st.create(),v=0;k.onDidAddListener=()=>{++v===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),w.print()),y?.()}}}s(e,"_addLeakageTraceLogic");function t(k,y,w){return A(k,()=>{},0,void 0,y??!0,void 0,w)}s(t,"defer"),n.defer=t;function r(k){return(y,w=null,v)=>{let E=!1,N;return N=k(S=>{if(!E)return N?N.dispose():E=!0,y.call(w,S)},null,v),E&&N.dispose(),N}}s(r,"once"),n.once=r;function i(k,y){return n.once(n.filter(k,y))}s(i,"onceIf"),n.onceIf=i;function o(k,y,w){return f((v,E=null,N)=>k(S=>v.call(E,y(S)),null,N),w)}s(o,"map"),n.map=o;function u(k,y,w){return f((v,E=null,N)=>k(S=>{y(S),v.call(E,S)},null,N),w)}s(u,"forEach"),n.forEach=u;function a(k,y,w){return f((v,E=null,N)=>k(S=>y(S)&&v.call(E,S),null,N),w)}s(a,"filter"),n.filter=a;function l(k){return k}s(l,"signal"),n.signal=l;function c(...k){return(y,w=null,v)=>{let E=(0,he.combinedDisposable)(...k.map(N=>N(S=>y.call(w,S))));return _(E,v)}}s(c,"any"),n.any=c;function h(k,y,w,v){let E=w;return o(k,N=>(E=y(E,N),E),v)}s(h,"reduce"),n.reduce=h;function f(k,y){let w,v={onWillAddFirstListener(){w=k(E.fire,E)},onDidRemoveLastListener(){w?.dispose()}};y||e(v);let E=new se(v);return y?.add(E),E.event}s(f,"snapshot");function _(k,y){return y instanceof Array?y.push(k):y&&y.add(k),k}s(_,"addAndReturnDisposable");function A(k,y,w=100,v=!1,E=!1,N,S){let te,$,ie,ne=0,oe,Me={leakWarningThreshold:N,onWillAddFirstListener(){te=k(So=>{ne++,$=y($,So),v&&!ie&&(et.fire($),$=void 0),oe=s(()=>{let Ro=$;$=void 0,ie=void 0,(!v||ne>1)&&et.fire(Ro),ne=0},"doFire"),typeof w=="number"?(ie&&clearTimeout(ie),ie=setTimeout(oe,w)):ie===void 0&&(ie=null,queueMicrotask(oe))})},onWillRemoveListener(){E&&ne>0&&oe?.()},onDidRemoveLastListener(){oe=void 0,te.dispose()}};S||e(Me);let et=new se(Me);return S?.add(et),et.event}s(A,"debounce"),n.debounce=A;function z(k,y=0,w,v){return n.debounce(k,(E,N)=>E?(E.push(N),E):[N],y,void 0,w??!0,void 0,v)}s(z,"accumulate"),n.accumulate=z;function j(k,y,w=100,v=!0,E=!0,N,S){let te,$,ie,ne=0,oe={leakWarningThreshold:N,onWillAddFirstListener(){te=k(et=>{ne++,$=y($,et),ie===void 0&&(v&&(Me.fire($),$=void 0,ne=0),typeof w=="number"?ie=setTimeout(()=>{E&&ne>0&&Me.fire($),$=void 0,ie=void 0,ne=0},w):(ie=0,queueMicrotask(()=>{E&&ne>0&&Me.fire($),$=void 0,ie=void 0,ne=0})))})},onDidRemoveLastListener(){te.dispose()}};S||e(oe);let Me=new se(oe);return S?.add(Me),Me.event}s(j,"throttle"),n.throttle=j;function q(k,y=(v,E)=>v===E,w){let v=!0,E;return a(k,N=>{let S=v||!y(N,E);return v=!1,E=N,S},w)}s(q,"latch"),n.latch=q;function V(k,y,w){return[n.filter(k,y,w),n.filter(k,v=>!y(v),w)]}s(V,"split"),n.split=V;function ce(k,y,w=!1,v=[],E){let N=v.slice(),S;L1()&&(S={stack:st.create(),timerId:setTimeout(()=>{N&&N.length>0&&S&&!S.warned&&(S.warned=!0,console.warn(`[Event.buffer][${y}] potential LEAK detected: ${N.length} events buffered for ${E1/1e3}s without being consumed. Buffered here:`),S.stack.print())},E1),warned:!1},E&&E.add((0,he.toDisposable)(()=>clearTimeout(S.timerId))));let te=s(()=>{S&&clearTimeout(S.timerId)},"clearLeakWarningTimer"),$=k(oe=>{N?(N.push(oe),L1()&&S&&!S.warned&&N.length>=Ol&&(S.warned=!0,console.warn(`[Event.buffer][${y}] potential LEAK detected: ${N.length} events buffered without being consumed. Buffered here:`),S.stack.print())):ne.fire(oe)});E&&E.add($);let ie=s(()=>{N?.forEach(oe=>ne.fire(oe)),N=null,te()},"flush"),ne=new se({onWillAddFirstListener(){$||($=k(oe=>ne.fire(oe)),E&&E.add($))},onDidAddFirstListener(){N&&(w?setTimeout(ie):ie())},onDidRemoveLastListener(){$&&$.dispose(),$=null,te()}});return E&&E.add(ne),ne.event}s(ce,"buffer"),n.buffer=ce;function Y(k,y){return s((v,E,N)=>{let S=y(new ht);return k(function(te){let $=S.evaluate(te);$!==Ce&&v.call(E,$)},void 0,N)},"fn")}s(Y,"chain"),n.chain=Y;let Ce=Symbol("HaltChainable");class ht{static{s(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(w=>(y(w),w)),this}filter(y){return this.steps.push(w=>y(w)?w:Ce),this}reduce(y,w){let v=w;return this.steps.push(E=>(v=y(v,E),v)),this}latch(y=(w,v)=>w===v){let w=!0,v;return this.steps.push(E=>{let N=w||!y(E,v);return w=!1,v=E,N?E:Ce}),this}evaluate(y){for(let w of this.steps)if(y=w(y),y===Ce)break;return y}}function Hn(k,y,w=v=>v){let v=s((...te)=>S.fire(w(...te)),"fn"),E=s(()=>k.on(y,v),"onFirstListenerAdd"),N=s(()=>k.removeListener(y,v),"onLastListenerRemove"),S=new se({onWillAddFirstListener:E,onDidRemoveLastListener:N});return S.event}s(Hn,"fromNodeEventEmitter"),n.fromNodeEventEmitter=Hn;function T(k,y,w=v=>v){let v=s((...te)=>S.fire(w(...te)),"fn"),E=s(()=>k.addEventListener(y,v),"onFirstListenerAdd"),N=s(()=>k.removeEventListener(y,v),"onLastListenerRemove"),S=new se({onWillAddFirstListener:E,onDidRemoveLastListener:N});return S.event}s(T,"fromDOMEventEmitter"),n.fromDOMEventEmitter=T;function P(k,y){let w,v,E=new Promise(N=>{v=r(k)(N),di(v,y),w=s(()=>{T1(v,y)},"cancelRef")});return E.cancel=w,y&&E.finally(()=>T1(v,y)),E}s(P,"toPromise"),n.toPromise=P;function U(k,y){return k(w=>y.fire(w))}s(U,"forward"),n.forward=U;function re(k,y,w){return y(w),k(v=>y(v))}s(re,"runAndSubscribe"),n.runAndSubscribe=re;class Ze{static{s(this,"EmitterObserver")}constructor(y,w){this._observable=y,this._counter=0,this._hasChanged=!1;let v={onWillAddFirstListener:s(()=>{y.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>{y.removeObserver(this)},"onDidRemoveLastListener")};w||e(v),this.emitter=new se(v),w&&w.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,w){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function Ot(k,y){return new Ze(k,y).emitter.event}s(Ot,"fromObservable"),n.fromObservable=Ot;function Io(k){return(y,w,v)=>{let E=0,N=!1,S={beginUpdate(){E++},endUpdate(){E--,E===0&&(k.reportChanges(),N&&(N=!1,y.call(w)))},handlePossibleChange(){},handleChange(){N=!0}};k.addObserver(S),k.reportChanges();let te={dispose(){k.removeObserver(S)}};return di(te,v),te}}s(Io,"fromObservableLight"),n.fromObservableLight=Io})(an||(F.Event=an={}));var ln=class n{static{s(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${n._idPool++}`,n.all.add(this)}start(e){this._stopWatch=new Sl.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};F.EventProfiling=ln;var Et=-1;function Dl(n){let e=Et;return Et=n,{dispose(){Et=e}}}s(Dl,"setGlobalLeakWarningThreshold");var ii=class n{static{s(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,t,r=(n._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let r=this.threshold;if(r<=0||t.3?"dominated":"popular",h=new Lt(c,l,o,t,a);this._errorHandler(h)}return()=>{let o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[r,i]of this._stacks)(!e||t{e[t]||console.log(n)},3e3)}setParent(e,n){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==Qe.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function We(t){return qe?.trackDisposable(t),t}s(We,"trackDisposable");function je(t){qe?.markAsDisposed(t)}s(je,"markAsDisposed");function ve(t,e){qe?.setParent(t,e)}s(ve,"setParentOfDisposable");function ta(t,e){if(qe)for(let n of t)qe.setParent(n,e)}s(ta,"setParentOfDisposables");function na(t){return qe?.markAsSingleton(t),t}s(na,"markAsSingleton");function ps(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}s(ps,"isDisposable");function lt(t){if(Zu.Iterable.is(t)){let e=[];for(let n of t)if(n)try{n.dispose()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}s(lt,"dispose");function ra(t){for(let e of t)ps(e)&&e.dispose();return[]}s(ra,"disposeIfDisposable");function ia(...t){let e=wr(()=>lt(t));return ta(t,e),e}s(ia,"combinedDisposable");var mr=class{static{s(this,"FunctionDisposable")}constructor(e){this._isDisposed=!1,this._fn=e,We(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,je(this),this._fn()}}};function wr(t){return new mr(t)}s(wr,"toDisposable");var at=class t{static{s(this,"DisposableStore")}static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,We(this)}dispose(){this._isDisposed||(je(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{lt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===Qe.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return ve(e,this),this._isDisposed?t.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(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)&&ve(e,null)}assertNotDisposed(){this._isDisposed&&(0,hs.onUnexpectedError)(new hs.BugIndicatingError("Object disposed"))}};R.DisposableStore=at;var Qe=class{static{s(this,"Disposable")}static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new at,We(this),ve(this._store,this)}dispose(){je(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};R.Disposable=Qe;var Mt=class{static{s(this,"MutableDisposable")}constructor(){this._isDisposed=!1,We(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&ve(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,je(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&ve(e,null),e}};R.MutableDisposable=Mt;var pr=class{static{s(this,"MandatoryMutableDisposable")}constructor(e){this._disposable=new Mt,this._isDisposed=!1,this._disposable.value=e}get value(){return this._disposable.value}set value(e){this._isDisposed||e===this._disposable.value||(this._disposable.value=e)}dispose(){this._isDisposed=!0,this._disposable.dispose()}};R.MandatoryMutableDisposable=pr;var gr=class{static{s(this,"RefCountedDisposable")}constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}};R.RefCountedDisposable=gr;var _r=class{static{s(this,"ReferenceCollection")}constructor(){this.references=new Map}acquire(e,...n){let r=this.references.get(e);r||(r={counter:0,object:this.createReferencedObject(e,...n)},this.references.set(e,r));let{object:i}=r,o=(0,Ju.createSingleCallFunction)(()=>{--r.counter===0&&(this.destroyReferencedObject(e,r.object),this.references.delete(e))});return r.counter++,{object:i,dispose:o}}};R.ReferenceCollection=_r;var br=class{static{s(this,"AsyncReferenceCollection")}constructor(e){this.referenceCollection=e}async acquire(e,...n){let r=this.referenceCollection.acquire(e,...n);try{return{object:await r.object,dispose:s(()=>r.dispose(),"dispose")}}catch(i){throw r.dispose(),i}}};R.AsyncReferenceCollection=br;var Cr=class{static{s(this,"ImmortalReference")}constructor(e){this.object=e}dispose(){}};R.ImmortalReference=Cr;function sa(t){let e=new at;try{t(e)}finally{e.dispose()}}s(sa,"disposeOnReturn");var Ft=class{static{s(this,"DisposableMap")}constructor(e=new Map){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,n,r=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),r||this._store.get(e)?.dispose(),this._store.set(e,n),ve(n,this)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let n=this._store.get(e);return n&&ve(n,null),this._store.delete(e),n}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableMap=Ft;var yr=class{static{s(this,"DisposableSet")}constructor(e=new Set){this._isDisposed=!1,this._store=e,We(this)}dispose(){je(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{lt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}add(e){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableSet that has already been disposed of. The added object will be leaked!").stack),this._store.add(e),ve(e,this)}deleteAndDispose(e){this._store.delete(e)&&e.dispose()}deleteAndLeak(e){if(this._store.delete(e))return ve(e,null),e}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}};R.DisposableSet=yr;function oa(t,e){let n=!1;return t.then(r=>{n||e(r)}),wr(()=>{n=!0})}s(oa,"thenIfNotDisposed");function ua(t,e){return t.then(n=>(e.isDisposed?n.dispose():e.add(n),n))}s(ua,"thenRegisterOrDispose");var vr=class extends Ft{static{s(this,"DisposableResourceMap")}constructor(){super(new ds.ResourceMap)}};R.DisposableResourceMap=vr});var gs=U(qt=>{"use strict";_();Object.defineProperty(qt,"__esModule",{value:!0});qt.LinkedList=void 0;var z=class t{static{s(this,"Node")}static{this.Undefined=new t(void 0)}constructor(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}},Er=class{static{s(this,"LinkedList")}constructor(){this._first=z.Undefined,this._last=z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===z.Undefined}clear(){let e=this._first;for(;e!==z.Undefined;){let n=e.next;e.prev=z.Undefined,e.next=z.Undefined,e=n}this._first=z.Undefined,this._last=z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,n){let r=new z(e);if(this._first===z.Undefined)this._first=r,this._last=r;else if(n){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(r))}}shift(){if(this._first!==z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==z.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==z.Undefined)return this._last.element}_remove(e){if(e.prev!==z.Undefined&&e.next!==z.Undefined){let n=e.prev;n.next=e.next,e.next.prev=n}else e.prev===z.Undefined&&e.next===z.Undefined?(this._first=z.Undefined,this._last=z.Undefined):e.next===z.Undefined?(this._last=this._last.prev,this._last.next=z.Undefined):e.prev===z.Undefined&&(this._first=this._first.next,this._first.prev=z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==z.Undefined;)yield e.element,e=e.next}};qt.LinkedList=Er});var ys=U(Ye=>{"use strict";_();Object.defineProperty(Ye,"__esModule",{value:!0});Ye.getNLSMessages=_s;Ye.getNLSLanguage=bs;Ye.localize=la;Ye.localize2=ca;function _s(){return globalThis._VSCODE_NLS_MESSAGES}s(_s,"getNLSMessages");function bs(){return globalThis._VSCODE_NLS_LANGUAGE}s(bs,"getNLSLanguage");var aa=bs()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function Wt(t,e){let n;return e.length===0?n=t:n=t.replace(/\{(\d+)\}/g,(r,i)=>{let o=i[0],u=e[o],a=r;return typeof u=="string"?a=u:(typeof u=="number"||typeof u=="boolean"||u===void 0||u===null)&&(a=String(u)),a}),aa&&(n="\uFF3B"+n.replace(/[aouei]/g,"$&$&")+"\uFF3D"),n}s(Wt,"_format");function la(t,e,...n){return Wt(typeof t=="number"?Cs(t,e):e,n)}s(la,"localize");function Cs(t,e){let n=_s()?.[t];if(typeof n!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return n}s(Cs,"lookupMessage");function ca(t,e,...n){let r;typeof t=="number"?r=Cs(t,e):r=e;let i=Wt(r,n);return{value:i,original:e===r?i:Wt(e,n)}}s(ca,"localize2")});var ze=U(m=>{"use strict";_();var fa=m&&m.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),ha=m&&m.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),da=m&&m.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=0,dt=we.indexOf("Macintosh")>=0,Tr=(we.indexOf("Macintosh")>=0||we.indexOf("iPad")>=0||we.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ft=we.indexOf("Linux")>=0,ks=we?.indexOf("Mobi")>=0,Nr=!0,jt=ma.getNLSLanguage()||m.LANGUAGE_DEFAULT,ct=navigator.language.toLowerCase(),Lr=ct):console.error("Unable to resolve platform.");function ga(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}s(ga,"PlatformToString");var zt=0;dt?zt=1:ht?zt=3:ft&&(zt=2);m.isWindows=ht;m.isMacintosh=dt;m.isLinux=ft;m.isLinuxSnap=Ls;m.isNative=Ns;m.isElectron=Ts;m.isWeb=Nr;m.isWebWorker=Nr&&typeof Ee.importScripts=="function";m.webWorkerOrigin=m.isWebWorker?Ee.origin:void 0;m.isIOS=Tr;m.isMobile=ks;m.isCI=As;m.platform=zt;m.userAgent=we;m.language=jt;var vs;(function(t){function e(){return m.language}s(e,"value"),t.value=e;function n(){return m.language.length===2?m.language==="en":m.language.length>=3?m.language[0]==="e"&&m.language[1]==="n"&&m.language[2]==="-":!1}s(n,"isDefaultVariant"),t.isDefaultVariant=n;function r(){return m.language==="en"}s(r,"isDefault"),t.isDefault=r})(vs||(m.Language=vs={}));m.locale=ct;m.platformLocale=Lr;m.translationsConfigFile=xs;m.setTimeout0IsFaster=typeof Ee.postMessage=="function"&&!Ee.importScripts;m.setTimeout0=(()=>{if(m.setTimeout0IsFaster){let t=[];Ee.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,i=t.length;r{let r=++e;t.push({id:r,callback:n}),Ee.postMessage({vscodeScheduleAsyncWork:r},"*")}}return t=>setTimeout(t)})();m.OS=dt||Tr?2:ht?1:3;var ws=!0,Es=!1;function _a(){if(!Es){Es=!0;let t=new Uint8Array(2);t[0]=1,t[1]=2,ws=new Uint16Array(t.buffer)[0]===513}return ws}s(_a,"isLittleEndian");m.isChrome=!!(m.userAgent&&m.userAgent.indexOf("Chrome")>=0);m.isFirefox=!!(m.userAgent&&m.userAgent.indexOf("Firefox")>=0);m.isSafari=!!(!m.isChrome&&m.userAgent&&m.userAgent.indexOf("Safari")>=0);m.isEdge=!!(m.userAgent&&m.userAgent.indexOf("Edg/")>=0);m.isAndroid=!!(m.userAgent&&m.userAgent.indexOf("Android")>=0);function ba(t){return parseFloat(t)>=25}s(ba,"isTahoeOrNewer")});var kr=U(ge=>{"use strict";_();Object.defineProperty(ge,"__esModule",{value:!0});ge.arch=ge.platform=ge.env=ge.cwd=void 0;var Is=ze(),$e,Ar=globalThis.vscode;if(typeof Ar<"u"&&typeof Ar.process<"u"){let t=Ar.process;$e={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?$e={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:$e={get platform(){return Is.isWindows?"win32":Is.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};ge.cwd=$e.cwd;ge.env=$e.env;ge.platform=$e.platform;ge.arch=$e.arch});var Pr=U($t=>{"use strict";_();Object.defineProperty($t,"__esModule",{value:!0});$t.StopWatch=void 0;var Ca=globalThis.performance.now.bind(globalThis.performance),xr=class t{static{s(this,"StopWatch")}static create(e){return new t(e)}constructor(e){this._now=e===!1?Date.now:Ca,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}};$t.StopWatch=xr});var jr=U(M=>{"use strict";_();Object.defineProperty(M,"__esModule",{value:!0});M.ValueWithChangeEvent=M.Relay=M.EventBufferer=M.DynamicListEventMultiplexer=M.EventMultiplexer=M.MicrotaskEmitter=M.DebounceEmitter=M.PauseableEmitter=M.AsyncEmitter=M.createEventDeliveryQueue=M.Emitter=M.ListenerRefusalError=M.ListenerLeakError=M.EventProfiling=M.Event=void 0;M.setGlobalLeakWarningThreshold=Ta;M.trackSetChanges=Pa;var ya=Un(),mt=Ue(),va=Vn(),ae=Ut(),Ms=gs(),wa=kr(),Ea=Pr(),Ss=!1,La=!1,Na=100,Rs=6e4;function Os(){return!!wa.env.VSCODE_DEV}s(Os,"_isBufferLeakWarningEnabled");var Bt;(function(t){t.None=()=>ae.Disposable.None;function e(E){if(La){let{onDidAddListener:b}=E,v=Je.create(),w=0;E.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),v.print()),b?.()}}}s(e,"_addLeakageTraceLogic");function n(E,b,v){return D(E,()=>{},0,void 0,b??!0,void 0,v)}s(n,"defer"),t.defer=n;function r(E){return(b,v=null,w)=>{let L=!1,A;return A=E(P=>{if(!L)return A?A.dispose():L=!0,b.call(v,P)},null,w),L&&A.dispose(),A}}s(r,"once"),t.once=r;function i(E,b){return t.once(t.filter(E,b))}s(i,"onceIf"),t.onceIf=i;function o(E,b,v){return f((w,L=null,A)=>E(P=>w.call(L,b(P)),null,A),v)}s(o,"map"),t.map=o;function u(E,b,v){return f((w,L=null,A)=>E(P=>{b(P),w.call(L,P)},null,A),v)}s(u,"forEach"),t.forEach=u;function a(E,b,v){return f((w,L=null,A)=>E(P=>b(P)&&w.call(L,P),null,A),v)}s(a,"filter"),t.filter=a;function l(E){return E}s(l,"signal"),t.signal=l;function c(...E){return(b,v=null,w)=>{let L=(0,ae.combinedDisposable)(...E.map(A=>A(P=>b.call(v,P))));return y(L,w)}}s(c,"any"),t.any=c;function d(E,b,v,w){let L=v;return o(E,A=>(L=b(L,A),L),w)}s(d,"reduce"),t.reduce=d;function f(E,b){let v,w={onWillAddFirstListener(){v=E(L.fire,L)},onDidRemoveLastListener(){v?.dispose()}};b||e(w);let L=new ne(w);return b?.add(L),L.event}s(f,"snapshot");function y(E,b){return b instanceof Array?b.push(E):b&&b.add(E),E}s(y,"addAndReturnDisposable");function D(E,b,v=100,w=!1,L=!1,A,P){let J,j,te,Z=0,re,xe={leakWarningThreshold:A,onWillAddFirstListener(){J=E(W1=>{Z++,j=b(j,W1),w&&!te&&(Ke.fire(j),j=void 0),re=s(()=>{let j1=j;j=void 0,te=void 0,(!w||Z>1)&&Ke.fire(j1),Z=0},"doFire"),typeof v=="number"?(te&&clearTimeout(te),te=setTimeout(re,v)):te===void 0&&(te=null,queueMicrotask(re))})},onWillRemoveListener(){L&&Z>0&&re?.()},onDidRemoveLastListener(){re=void 0,J.dispose()}};P||e(xe);let Ke=new ne(xe);return P?.add(Ke),Ke.event}s(D,"debounce"),t.debounce=D;function B(E,b=0,v,w){return t.debounce(E,(L,A)=>L?(L.push(A),L):[A],b,void 0,v??!0,void 0,w)}s(B,"accumulate"),t.accumulate=B;function H(E,b,v=100,w=!0,L=!0,A,P){let J,j,te,Z=0,re={leakWarningThreshold:A,onWillAddFirstListener(){J=E(Ke=>{Z++,j=b(j,Ke),te===void 0&&(w&&(xe.fire(j),j=void 0,Z=0),typeof v=="number"?te=setTimeout(()=>{L&&Z>0&&xe.fire(j),j=void 0,te=void 0,Z=0},v):(te=0,queueMicrotask(()=>{L&&Z>0&&xe.fire(j),j=void 0,te=void 0,Z=0})))})},onDidRemoveLastListener(){J.dispose()}};P||e(re);let xe=new ne(re);return P?.add(xe),xe.event}s(H,"throttle"),t.throttle=H;function X(E,b=(w,L)=>w===L,v){let w=!0,L;return a(E,A=>{let P=w||!b(A,L);return w=!1,L=A,P},v)}s(X,"latch"),t.latch=X;function de(E,b,v){return[t.filter(E,b,v),t.filter(E,w=>!b(w),v)]}s(de,"split"),t.split=de;function oe(E,b,v=!1,w=[],L){let A=w.slice(),P;Os()&&(P={stack:Je.create(),timerId:setTimeout(()=>{A&&A.length>0&&P&&!P.warned&&(P.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${A.length} events buffered for ${Rs/1e3}s without being consumed. Buffered here:`),P.stack.print())},Rs),warned:!1},L&&L.add((0,ae.toDisposable)(()=>clearTimeout(P.timerId))));let J=s(()=>{P&&clearTimeout(P.timerId)},"clearLeakWarningTimer"),j=E(re=>{A?(A.push(re),Os()&&P&&!P.warned&&A.length>=Na&&(P.warned=!0,console.warn(`[Event.buffer][${b}] potential LEAK detected: ${A.length} events buffered without being consumed. Buffered here:`),P.stack.print())):Z.fire(re)});L&&L.add(j);let te=s(()=>{A?.forEach(re=>Z.fire(re)),A=null,J()},"flush"),Z=new ne({onWillAddFirstListener(){j||(j=E(re=>Z.fire(re)),L&&L.add(j))},onDidAddFirstListener(){A&&(v?setTimeout(te):te())},onDidRemoveLastListener(){j&&j.dispose(),j=null,J()}});return L&&L.add(Z),Z.event}s(oe,"buffer"),t.buffer=oe;function K(E,b){return s((w,L,A)=>{let P=b(new kn);return E(function(J){let j=P.evaluate(J);j!==Ge&&w.call(L,j)},void 0,A)},"fn")}s(K,"chain"),t.chain=K;let Ge=Symbol("HaltChainable");class kn{static{s(this,"ChainableSynthesis")}constructor(){this.steps=[]}map(b){return this.steps.push(b),this}forEach(b){return this.steps.push(v=>(b(v),v)),this}filter(b){return this.steps.push(v=>b(v)?v:Ge),this}reduce(b,v){let w=v;return this.steps.push(L=>(w=b(w,L),w)),this}latch(b=(v,w)=>v===w){let v=!0,w;return this.steps.push(L=>{let A=v||!b(L,w);return v=!1,w=L,A?L:Ge}),this}evaluate(b){for(let v of this.steps)if(b=v(b),b===Ge)break;return b}}function xn(E,b,v=w=>w){let w=s((...J)=>P.fire(v(...J)),"fn"),L=s(()=>E.on(b,w),"onFirstListenerAdd"),A=s(()=>E.removeListener(b,w),"onLastListenerRemove"),P=new ne({onWillAddFirstListener:L,onDidRemoveLastListener:A});return P.event}s(xn,"fromNodeEventEmitter"),t.fromNodeEventEmitter=xn;function T(E,b,v=w=>w){let w=s((...J)=>P.fire(v(...J)),"fn"),L=s(()=>E.addEventListener(b,w),"onFirstListenerAdd"),A=s(()=>E.removeEventListener(b,w),"onLastListenerRemove"),P=new ne({onWillAddFirstListener:L,onDidRemoveLastListener:A});return P.event}s(T,"fromDOMEventEmitter"),t.fromDOMEventEmitter=T;function k(E,b){let v,w,L=new Promise(A=>{w=r(E)(A),Wr(w,b),v=s(()=>{Ds(w,b)},"cancelRef")});return L.cancel=v,b&&L.finally(()=>Ds(w,b)),L}s(k,"toPromise"),t.toPromise=k;function F(E,b){return E(v=>b.fire(v))}s(F,"forward"),t.forward=F;function ee(E,b,v){return b(v),E(w=>b(w))}s(ee,"runAndSubscribe"),t.runAndSubscribe=ee;class Ve{static{s(this,"EmitterObserver")}constructor(b,v){this._observable=b,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:s(()=>{b.addObserver(this),this._observable.reportChanges()},"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>{b.removeObserver(this)},"onDidRemoveLastListener")};v||e(w),this.emitter=new ne(w),v&&v.add(this.emitter)}beginUpdate(b){this._counter++}handlePossibleChange(b){}handleChange(b,v){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 Nt(E,b){return new Ve(E,b).emitter.event}s(Nt,"fromObservable"),t.fromObservable=Nt;function q1(E){return(b,v,w)=>{let L=0,A=!1,P={beginUpdate(){L++},endUpdate(){L--,L===0&&(E.reportChanges(),A&&(A=!1,b.call(v)))},handlePossibleChange(){},handleChange(){A=!0}};E.addObserver(P),E.reportChanges();let J={dispose(){E.removeObserver(P)}};return Wr(J,w),J}}s(q1,"fromObservableLight"),t.fromObservableLight=q1})(Bt||(M.Event=Bt={}));var Ht=class t{static{s(this,"EventProfiling")}static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${t._idPool++}`,t.all.add(this)}start(e){this._stopWatch=new Ea.StopWatch,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};M.EventProfiling=Ht;var pt=-1;function Ta(t){let e=pt;return pt=t,{dispose(){pt=e}}}s(Ta,"setGlobalLeakWarningThreshold");var Ir=class t{static{s(this,"LeakageMonitor")}static{this._idPool=1}constructor(e,n,r=(t._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,n){let r=this.threshold;if(r<=0||n.3?"dominated":"popular",d=new gt(c,l,o,n,a);this._errorHandler(d)}return()=>{let o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,n=0;for(let[r,i]of this._stacks)(!e||n{if(n instanceof it)e(n);else for(let t=0;t0||this._options?.leakWarningThreshold?new ii(e?.onListenerError??kt.onUnexpectedError,this._options?.leakWarningThreshold??Et,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new ln(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(k1){let e=this._listeners;queueMicrotask(()=>{N1(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=c[1]/this._size>.3?"dominated":"popular",f=new cn(h,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||kt.onUnexpectedError)(f),he.Disposable.None}if(this._disposed)return he.Disposable.None;t&&(e=e.bind(t));let i=new it(e),o,u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=st.create(),o=this._leakageMon.check(i.stack,this._size+1)),k1&&(i.stack=u??st.create()),this._listeners?this._listeners instanceof it?(this._deliveryQueue??=new fn,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=(0,he.toDisposable)(()=>{o?.(),this._removeListener(i)});return di(a,r),a},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,r=t.indexOf(e);if(r===-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[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*Fl<=t.length){let o=0;for(let u=0;u0}};F.Emitter=se;var Ul=s(()=>new fn,"createEventDeliveryQueue");F.createEventDeliveryQueue=Ul;var fn=class{static{s(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},si=class extends se{static{s(this,"AsyncEmitter")}async fireAsync(e,t,r){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new x1.LinkedList),N1(this._listeners,i=>this._asyncDeliveryQueue.push([i.value,e]));this._asyncDeliveryQueue.size>0&&!t.isCancellationRequested;){let[i,o]=this._asyncDeliveryQueue.shift(),u=[],a={...o,token:t,waitUntil:s(l=>{if(Object.isFrozen(u))throw new Error("waitUntil can NOT be called asynchronous");r&&(l=r(l,i)),u.push(l)},"waitUntil")};try{i(a)}catch(l){(0,kt.onUnexpectedError)(l);continue}Object.freeze(u),await Promise.allSettled(u).then(l=>{for(let c of l)c.status==="rejected"&&(0,kt.onUnexpectedError)(c.reason)})}}};F.AsyncEmitter=si;var hn=class extends se{static{s(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new x1.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};F.PauseableEmitter=hn;var oi=class extends hn{static{s(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};F.DebounceEmitter=oi;var ui=class extends se{static{s(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}};F.MicrotaskEmitter=ui;var dn=class{static{s(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new se({onWillAddFirstListener:s(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let t={event:e,listener:null};this.events.push(t),this.hasListeners&&this.hook(t);let r=s(()=>{this.hasListeners&&this.unhook(t);let i=this.events.indexOf(t);this.events.splice(i,1)},"dispose");return(0,he.toDisposable)((0,Pl.createSingleCallFunction)(r))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};F.EventMultiplexer=dn;var ai=class{static{s(this,"DynamicListEventMultiplexer")}constructor(e,t,r,i){this._store=new he.DisposableStore;let o=this._store.add(new dn),u=this._store.add(new he.DisposableMap);function a(l){u.set(l,o.add(i(l)))}s(a,"addItem");for(let l of e)a(l);this._store.add(t(l=>{a(l)})),this._store.add(r(l=>{u.deleteAndDispose(l)})),this.event=o.event}dispose(){this._store.dispose()}};F.DynamicListEventMultiplexer=ai;var li=class{static{s(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,t,r){return(i,o,u)=>e(a=>{let l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>i.call(o,a)):i.call(o,a);return}let c=l;if(!c){i.call(o,t(r,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=r?c.items.reduce(t,r):c.items.reduce(t),i.call(o,c.reducedResult)})},void 0,u)}bufferEvents(e){let t={buffers:new Array};this.data.push(t);let r=e();return this.data.pop(),t.buffers.forEach(i=>i()),r}};F.EventBufferer=li;var ci=class{static{s(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=an.None,this.inputEventListener=he.Disposable.None,this.emitter=new se({onDidAddFirstListener:s(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:s(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};F.Relay=ci;var fi=class{static{s(this,"ValueWithChangeEvent")}static const(e){return new hi(e)}constructor(e){this._value=e,this._onDidChange=new se,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};F.ValueWithChangeEvent=fi;var hi=class{static{s(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=an.None}};function zl(n,e,t){let r=new he.DisposableMap,i=new Set(n());for(let u of i)r.set(u,t(u));let o=new he.DisposableStore;return o.add(e(()=>{let u=n(),a=(0,Al.diffSets)(i,u);for(let l of a.removed)r.deleteAndDispose(l);for(let l of a.added)r.set(l,t(l));i=new Set(u)})),o.add(r),o}s(zl,"trackSetChanges");function di(n,e){e instanceof he.DisposableStore?e.add(n):Array.isArray(e)&&e.push(n)}s(di,"addToDisposables");function T1(n,e){if(e instanceof he.DisposableStore)e.delete(n);else if(Array.isArray(e)){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}n.dispose()}s(T1,"disposeAndRemove")});var gi=M(Ie=>{"use strict";d();Object.defineProperty(Ie,"__esModule",{value:!0});Ie.CancellationTokenPool=Ie.CancellationTokenSource=Ie.CancellationToken=void 0;Ie.cancelOnDispose=jl;var A1=mi(),ql=tn(),P1=Object.freeze(function(n,e){let t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}}),mn;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof ot?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}s(e,"isCancellationToken"),n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:A1.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:P1})})(mn||(Ie.CancellationToken=mn={}));var ot=class{static{s(this,"MutableToken")}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?P1:(this._emitter||(this._emitter=new A1.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Tt=class{static{s(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new ot),this._token}cancel(){this._token?this._token instanceof ot&&this._token.cancel():this._token=mn.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof ot&&this._token.dispose():this._token=mn.None}};Ie.CancellationTokenSource=Tt;function jl(n){let e=new Tt;return n.add({dispose(){e.cancel()}}),e.token}s(jl,"cancelOnDispose");var pi=class{static{s(this,"CancellationTokenPool")}constructor(){this._source=new Tt,this._listeners=new ql.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let t=e.onCancellationRequested(()=>{t.dispose(),this._cancelled++,this._check()});this._listeners.add(t)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};Ie.CancellationTokenPool=pi});var xt=M(C=>{"use strict";d();var Wl=C&&C.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Bl=C&&C.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),$l=C&&C.__importStar||(function(){var n=s(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i=Hl&&n<=Kl||n>=Gl&&n<=Vl}s(Re,"isWindowsDeviceRoot");function gn(n,e,t,r){let i="",o=0,u=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){let h=i.lastIndexOf(t);h===-1?(i="",o=0):(i=i.slice(0,h),o=i.length-1-i.lastIndexOf(t)),u=c,a=0;continue}else if(i.length!==0){i="",o=0,u=c,a=0;continue}}e&&(i+=i.length>0?`${t}..`:"..",o=2)}else i.length>0?i+=`${t}${n.slice(u+1,c)}`:i=n.slice(u+1,c),o=c-u-1;u=c,a=0}else l===Ye&&a!==-1?++a:a=-1}return i}s(gn,"normalizeString");function Yl(n){return n?`${n[0]==="."?"":"."}${n}`:""}s(Yl,"formatExt");function I1(n,e){Xl(e,"pathObject");let t=e.dir||e.root,r=e.base||`${e.name||""}${Yl(e.ext)}`;return t?t===e.root?`${t}${r}`:`${t}${n}${r}`:r}s(I1,"_format");C.win32={resolve(...n){let e="",t="",r=!1;for(let i=n.length-1;i>=-1;i--){let o;if(i>=0){if(o=n[i],K(o,`paths[${i}]`),o.length===0)continue}else e.length===0?o=ut.cwd():(o=ut.env[`=${e}`]||ut.cwd(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===de)&&(o=`${e}\\`));let u=o.length,a=0,l="",c=!1,h=o.charCodeAt(0);if(u===1)R(h)&&(a=1,c=!0);else if(R(h))if(c=!0,R(o.charCodeAt(1))){let f=2,_=f;for(;f2&&R(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,r=c,c&&e.length>0)break}return t=gn(t,!r,"\\",R),r?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){K(n,"path");let e=n.length;if(e===0)return".";let t=0,r,i=!1,o=n.charCodeAt(0);if(e===1)return _i(o)?"\\":n;if(R(o))if(i=!0,R(n.charCodeAt(1))){let a=2,l=a;for(;a2&&R(n.charCodeAt(2))&&(i=!0,t=3));let u=t0&&R(n.charCodeAt(e-1))&&(u+="\\"),!i&&r===void 0&&n.includes(":")){if(u.length>=2&&Re(u.charCodeAt(0))&&u.charCodeAt(1)===Se)return`.\\${u}`;let a=n.indexOf(":");do if(a===e-1||R(n.charCodeAt(a+1)))return`.\\${u}`;while((a=n.indexOf(":",a+1))!==-1)}return r===void 0?i?`\\${u}`:u:i?`${r}\\${u}`:`${r}${u}`},isAbsolute(n){K(n,"path");let e=n.length;if(e===0)return!1;let t=n.charCodeAt(0);return R(t)||e>2&&Re(t)&&n.charCodeAt(1)===Se&&R(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=u:e+=`\\${u}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof t=="string"&&R(t.charCodeAt(0))){++i;let o=t.length;o>1&&R(t.charCodeAt(1))&&(++i,o>2&&(R(t.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(e=`\\${e.slice(i)}`)}return C.win32.normalize(e)},relative(n,e){if(K(n,"from"),K(e,"to"),n===e)return"";let t=C.win32.resolve(n),r=C.win32.resolve(e);if(t===r||(n=t.toLowerCase(),e=r.toLowerCase(),n===e))return"";if(t.length!==n.length||r.length!==e.length){let z=t.split("\\"),j=r.split("\\");z[z.length-1]===""&&z.pop(),j[j.length-1]===""&&j.pop();let q=z.length,V=j.length,ce=qce?j.slice(Y).join("\\"):q>ce?"..\\".repeat(q-1-Y)+"..":"":"..\\".repeat(q-Y)+j.slice(Y).join("\\")}let i=0;for(;ii&&n.charCodeAt(o-1)===de;)o--;let u=o-i,a=0;for(;aa&&e.charCodeAt(l-1)===de;)l--;let c=l-a,h=uh){if(e.charCodeAt(a+_)===de)return r.slice(a+_+1);if(_===2)return r.slice(a+_)}u>h&&(n.charCodeAt(i+_)===de?f=_:_===2&&(f=3)),f===-1&&(f=0)}let A="";for(_=i+f+1;_<=o;++_)(_===o||n.charCodeAt(_)===de)&&(A+=A.length===0?"..":"\\..");return a+=f,A.length>0?`${A}${r.slice(a,l)}`:(r.charCodeAt(a)===de&&++a,r.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;let e=C.win32.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===de){if(e.charCodeAt(1)===de){let t=e.charCodeAt(2);if(t!==Ql&&t!==Ye)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Re(e.charCodeAt(0))&&e.charCodeAt(1)===Se&&e.charCodeAt(2)===de)return`\\\\?\\${e}`;return e},dirname(n){K(n,"path");let e=n.length;if(e===0)return".";let t=-1,r=0,i=n.charCodeAt(0);if(e===1)return R(i)?n:".";if(R(i)){if(t=r=1,R(n.charCodeAt(1))){let a=2,l=a;for(;a2&&R(n.charCodeAt(2))?3:2,r=t);let o=-1,u=!0;for(let a=e-1;a>=r;--a)if(R(n.charCodeAt(a))){if(!u){o=a;break}}else u=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&K(e,"suffix"),K(n,"path");let t=0,r=-1,i=!0,o;if(n.length>=2&&Re(n.charCodeAt(0))&&n.charCodeAt(1)===Se&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let u=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){let l=n.charCodeAt(o);if(R(l)){if(!i){t=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return t===r?r=a:r===-1&&(r=n.length),n.slice(t,r)}for(o=n.length-1;o>=t;--o)if(R(n.charCodeAt(o))){if(!i){t=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":n.slice(t,r)},extname(n){K(n,"path");let e=0,t=-1,r=0,i=-1,o=!0,u=0;n.length>=2&&n.charCodeAt(1)===Se&&Re(n.charCodeAt(0))&&(e=r=2);for(let a=n.length-1;a>=e;--a){let l=n.charCodeAt(a);if(R(l)){if(!o){r=a+1;break}continue}i===-1&&(o=!1,i=a+1),l===Ye?t===-1?t=a:u!==1&&(u=1):t!==-1&&(u=-1)}return t===-1||i===-1||u===0||u===1&&t===i-1&&t===r+1?"":n.slice(t,i)},format:I1.bind(null,"\\"),parse(n){K(n,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;let t=n.length,r=0,i=n.charCodeAt(0);if(t===1)return R(i)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(R(i)){if(r=1,R(n.charCodeAt(1))){let f=2,_=f;for(;f0&&(e.root=n.slice(0,r));let o=-1,u=r,a=-1,l=!0,c=n.length-1,h=0;for(;c>=r;--c){if(i=n.charCodeAt(c),R(i)){if(!l){u=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===Ye?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1)}return a!==-1&&(o===-1||h===0||h===1&&o===a-1&&o===u+1?e.base=e.name=n.slice(u,a):(e.name=n.slice(u,o),e.base=n.slice(u,a),e.ext=n.slice(o,a))),u>0&&u!==r?e.dir=n.slice(0,u-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var Jl=(()=>{if(me){let n=/\\/g;return()=>{let e=ut.cwd().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>ut.cwd()})();C.posix={resolve(...n){let e="",t=!1;for(let r=n.length-1;r>=0&&!t;r--){let i=n[r];K(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,t=i.charCodeAt(0)===ee)}if(!t){let r=Jl();e=`${r}/${e}`,t=r.charCodeAt(0)===ee}return e=gn(e,!t,"/",_i),t?`/${e}`:e.length>0?e:"."},normalize(n){if(K(n,"path"),n.length===0)return".";let e=n.charCodeAt(0)===ee,t=n.charCodeAt(n.length-1)===ee;return n=gn(n,!e,"/",_i),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return K(n,"path"),n.length>0&&n.charCodeAt(0)===ee},join(...n){if(n.length===0)return".";let e=[];for(let t=0;t0&&e.push(r)}return e.length===0?".":C.posix.normalize(e.join("/"))},relative(n,e){if(K(n,"from"),K(e,"to"),n===e||(n=C.posix.resolve(n),e=C.posix.resolve(e),n===e))return"";let t=1,r=n.length,i=r-t,o=1,u=e.length-o,a=ia){if(e.charCodeAt(o+c)===ee)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else i>a&&(n.charCodeAt(t+c)===ee?l=c:c===0&&(l=0));let h="";for(c=t+l+1;c<=r;++c)(c===r||n.charCodeAt(c)===ee)&&(h+=h.length===0?"..":"/..");return`${h}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(K(n,"path"),n.length===0)return".";let e=n.charCodeAt(0)===ee,t=-1,r=!0;for(let i=n.length-1;i>=1;--i)if(n.charCodeAt(i)===ee){if(!r){t=i;break}}else r=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&K(e,"suffix"),K(n,"path");let t=0,r=-1,i=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let u=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){let l=n.charCodeAt(o);if(l===ee){if(!i){t=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return t===r?r=a:r===-1&&(r=n.length),n.slice(t,r)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===ee){if(!i){t=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":n.slice(t,r)},extname(n){K(n,"path");let e=-1,t=0,r=-1,i=!0,o=0;for(let u=n.length-1;u>=0;--u){let a=n[u];if(a==="/"){if(!i){t=u+1;break}continue}r===-1&&(i=!1,r=u+1),a==="."?e===-1?e=u:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||r===-1||o===0||o===1&&e===r-1&&e===t+1?"":n.slice(e,r)},format:I1.bind(null,"/"),parse(n){K(n,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;let t=n.charCodeAt(0)===ee,r;t?(e.root="/",r=1):r=0;let i=-1,o=0,u=-1,a=!0,l=n.length-1,c=0;for(;l>=r;--l){let h=n.charCodeAt(l);if(h===ee){if(!a){o=l+1;break}continue}u===-1&&(a=!1,u=l+1),h===Ye?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(u!==-1){let h=o===0&&t?1:o;i===-1||c===0||c===1&&i===u-1&&i===o+1?e.base=e.name=n.slice(h,u):(e.name=n.slice(h,i),e.base=n.slice(h,u),e.ext=n.slice(i,u))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};C.posix.win32=C.win32.win32=C.win32;C.posix.posix=C.win32.posix=C.posix;C.normalize=me?C.win32.normalize:C.posix.normalize;C.isAbsolute=me?C.win32.isAbsolute:C.posix.isAbsolute;C.join=me?C.win32.join:C.posix.join;C.resolve=me?C.win32.resolve:C.posix.resolve;C.relative=me?C.win32.relative:C.posix.relative;C.dirname=me?C.win32.dirname:C.posix.dirname;C.basename=me?C.win32.basename:C.posix.basename;C.extname=me?C.win32.extname:C.posix.extname;C.format=me?C.win32.format:C.posix.format;C.parse=me?C.win32.parse:C.posix.parse;C.toNamespacedPath=me?C.win32.toNamespacedPath:C.posix.toNamespacedPath;C.sep=me?C.win32.sep:C.posix.sep;C.delimiter=me?C.win32.delimiter:C.posix.delimiter});var S1=M(be=>{"use strict";d();Object.defineProperty(be,"__esModule",{value:!0});be.WeakCachedFunction=be.CachedFunction=be.LRUCachedFunction=be.Cache=void 0;be.identity=_n;var Zl=gi(),bi=class{static{s(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new Zl.CancellationTokenSource,t=this.task(e.token);return this.result={promise:t,dispose:s(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};be.Cache=bi;function _n(n){return n}s(_n,"identity");var yi=class{static{s(this,"LRUCachedFunction")}constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=_n):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}};be.LRUCachedFunction=yi;var Ci=class{static{s(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=_n):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);let r=this._fn(e);return this._map.set(e,r),this._map2.set(t,r),r}};be.CachedFunction=Ci;var wi=class{static{s(this,"WeakCachedFunction")}constructor(e,t){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=_n):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);if(this._map.has(t))return this._map.get(t);let r=this._fn(e);return this._map.set(t,r),r}};be.WeakCachedFunction=wi});var yn=M(bn=>{"use strict";d();Object.defineProperty(bn,"__esModule",{value:!0});bn.Lazy=void 0;var ze;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Running=1]="Running",n[n.Completed=2]="Completed"})(ze||(ze={}));var vi=class{static{s(this,"Lazy")}constructor(e){this.executor=e,this._state=ze.Uninitialized}get hasValue(){return this._state===ze.Completed}get value(){if(this._state===ze.Uninitialized){this._state=ze.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=ze.Completed}}else if(this._state===ze.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};bn.Lazy=vi});var wn=M(b=>{"use strict";d();Object.defineProperty(b,"__esModule",{value:!0});b.Ellipsis=b.InvisibleCharacters=b.AmbiguousCharacters=b.noBreakWhitespace=b.UTF8_BOM_CHARACTER=b.UNUSUAL_LINE_TERMINATORS=b.GraphemeIterator=b.CodePointIterator=void 0;b.isFalsyOrWhitespace=tc;b.format=rc;b.format2=sc;b.htmlAttributeEncodeValue=oc;b.escape=uc;b.escapeRegExpCharacters=D1;b.count=ac;b.truncate=lc;b.truncateMiddle=cc;b.trim=fc;b.ltrim=M1;b.rtrim=F1;b.convertSimple2RegExpPattern=hc;b.createRegExp=dc;b.regExpLeadsToEndlessLoop=mc;b.joinStrings=pc;b.splitLines=gc;b.splitLinesIncludeSeparators=_c;b.indexOfPattern=bc;b.firstNonWhitespaceIndex=U1;b.getLeadingWhitespace=yc;b.lastNonWhitespaceIndex=Cc;b.getIndentationLength=wc;b.replaceAsync=vc;b.compare=kc;b.compareSubstring=z1;b.compareIgnoreCase=Ec;b.compareSubstringIgnoreCase=At;b.isAsciiDigit=Lc;b.isLowerAsciiLetter=Ei;b.isUpperAsciiLetter=Tc;b.equalsIgnoreCase=q1;b.equals=xc;b.startsWithIgnoreCase=Nc;b.endsWithIgnoreCase=Ac;b.commonPrefixLength=Pc;b.commonSuffixLength=Ic;b.isHighSurrogate=xi;b.isLowSurrogate=Cn;b.computeCodePoint=Ni;b.getNextCodePoint=j1;b.nextCharLength=W1;b.prevCharLength=B1;b.getCharContainingOffset=Rc;b.charCount=Oc;b.containsRTL=Mc;b.isBasicASCII=Uc;b.containsUnusualLineTerminators=zc;b.isFullWidthCharacter=qc;b.isEmojiImprecise=$1;b.lcut=jc;b.rcut=Wc;b.forAnsiStringParts=Gc;b.removeAnsiEscapeCodes=G1;b.removeAnsiEscapeCodesFromPrompt=Vc;b.startsWithUTF8BOM=K1;b.stripUTF8BOM=Qc;b.fuzzyContains=Xc;b.containsUppercaseCharacter=Yc;b.uppercaseFirstLetter=Jc;b.getNLines=Zc;b.singleLetterHash=e2;b.getGraphemeBreakType=t2;b.getLeftDeleteOffset=r2;b.multibyteAwareBtoa=u2;var ec=S1(),R1=yn();function tc(n){return!n||typeof n!="string"?!0:n.trim().length===0}s(tc,"isFalsyOrWhitespace");var nc=/{(\d+)}/g;function rc(n,...e){return e.length===0?n:n.replace(nc,function(t,r){let i=parseInt(r,10);return isNaN(i)||i<0||i>=e.length?t:e[i]})}s(rc,"format");var ic=/{([^}]+)}/g;function sc(n,e){return Object.keys(e).length===0?n:n.replace(ic,(t,r)=>e[r]??t)}s(sc,"format2");function oc(n){return n.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}s(oc,"htmlAttributeEncodeValue");function uc(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}s(uc,"escape");function D1(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}s(D1,"escapeRegExpCharacters");function ac(n,e){let t=0,r=n.indexOf(e);for(;r!==-1;)t++,r=n.indexOf(e,r+e.length);return t}s(ac,"count");function lc(n,e,t=b.Ellipsis){return n.length<=e?n:`${n.substr(0,e)}${t}`}s(lc,"truncate");function cc(n,e,t=b.Ellipsis){if(n.length<=e)return n;let r=Math.ceil(e/2)-t.length/2,i=Math.floor(e/2)-t.length/2;return`${n.substr(0,r)}${t}${n.substr(n.length-i)}`}s(cc,"truncateMiddle");function fc(n,e=" "){let t=M1(n,e);return F1(t,e)}s(fc,"trim");function M1(n,e){if(!n||!e)return n;let t=e.length,r=0;if(t===1){let i=e.charCodeAt(0);for(;r0&&n.charCodeAt(o-1)===u;)o--;return n.substring(0,o)}let i=r;for(;i>0&&n.endsWith(e,i);)i-=t;return n.substring(0,i)}s(F1,"rtrim");function hc(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}s(hc,"convertSimple2RegExpPattern");function dc(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=D1(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let r="";return t.global&&(r+="g"),t.matchCase||(r+="i"),t.multiline&&(r+="m"),t.unicode&&(r+="u"),new RegExp(n,r)}s(dc,"createRegExp");function mc(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}s(mc,"regExpLeadsToEndlessLoop");function pc(n,e){return n.filter(t=>t!=null&&t!==!1).join(e)}s(pc,"joinStrings");function gc(n){return n.split(/\r\n|\r|\n/)}s(gc,"splitLines");function _c(n){let e=[],t=n.split(/(\r\n|\r|\n)/);for(let r=0;r=0;t--){let r=n.charCodeAt(t);if(r!==32&&r!==9)return t}return-1}s(Cc,"lastNonWhitespaceIndex");function wc(n){let e=U1(n);return e===-1?n.length:e}s(wc,"getIndentationLength");function vc(n,e,t){let r=[],i=0;for(let o of n.matchAll(e)){if(r.push(n.slice(i,o.index)),o.index===void 0)throw new Error("match.index should be defined");i=o.index+o[0].length,r.push(t(o[0],...o.slice(1),o.index,n,o.groups))}return r.push(n.slice(i)),Promise.all(r).then(o=>o.join(""))}s(vc,"replaceAsync");function kc(n,e){return ne?1:0}s(kc,"compare");function z1(n,e,t=0,r=n.length,i=0,o=e.length){for(;tc)return 1}let u=r-t,a=o-i;return ua?1:0}s(z1,"compareSubstring");function Ec(n,e){return At(n,e,0,n.length,0,e.length)}s(Ec,"compareIgnoreCase");function At(n,e,t=0,r=n.length,i=0,o=e.length){for(;t=128||c>=128)return z1(n.toLowerCase(),e.toLowerCase(),t,r,i,o);Ei(l)&&(l-=32),Ei(c)&&(c-=32);let h=l-c;if(h!==0)return h}let u=r-t,a=o-i;return ua?1:0}s(At,"compareSubstringIgnoreCase");function Lc(n){return n>=48&&n<=57}s(Lc,"isAsciiDigit");function Ei(n){return n>=97&&n<=122}s(Ei,"isLowerAsciiLetter");function Tc(n){return n>=65&&n<=90}s(Tc,"isUpperAsciiLetter");function q1(n,e){return n.length===e.length&&At(n,e)===0}s(q1,"equalsIgnoreCase");function xc(n,e,t){return n===e||!!t&&n!==void 0&&e!==void 0&&q1(n,e)}s(xc,"equals");function Nc(n,e){let t=e.length;return t<=n.length&&At(n,e,0,t)===0}s(Nc,"startsWithIgnoreCase");function Ac(n,e){let t=n.length,r=t-e.length;return r>=0&&At(n,e,r,t)===0}s(Ac,"endsWithIgnoreCase");function Pc(n,e){let t=Math.min(n.length,e.length),r;for(r=0;r1){let r=n.charCodeAt(e-2);if(xi(r))return Ni(r,t)}return t}s(Sc,"getPrevCodePoint");var at=class{static{s(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=Sc(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=j1(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};b.CodePointIterator=at;var lt=class{static{s(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new at(e,t)}nextGraphemeLength(){let e=Nt.getInstance(),t=this._iterator,r=t.offset,i=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let o=t.offset,u=e.getGraphemeBreakType(t.nextCodePoint());if(O1(i,u)){t.setOffset(o);break}i=u}return t.offset-r}prevGraphemeLength(){let e=Nt.getInstance(),t=this._iterator,r=t.offset,i=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let o=t.offset,u=e.getGraphemeBreakType(t.prevCodePoint());if(O1(u,i)){t.setOffset(o);break}i=u}return r-t.offset}eol(){return this._iterator.eol()}};b.GraphemeIterator=lt;function W1(n,e){return new lt(n,e).nextGraphemeLength()}s(W1,"nextCharLength");function B1(n,e){return new lt(n,e).prevGraphemeLength()}s(B1,"prevCharLength");function Rc(n,e){e>0&&Cn(n.charCodeAt(e))&&e--;let t=e+W1(n,e);return[t-B1(n,t),t]}s(Rc,"getCharContainingOffset");function Oc(n){let e=new lt(n),t=0;for(;!e.eol();)t++,e.nextGraphemeLength();return t}s(Oc,"charCount");var ki;function Dc(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}s(Dc,"makeContainsRtl");function Mc(n){return ki||(ki=Dc()),ki.test(n)}s(Mc,"containsRTL");var Fc=/^[\t\n\r\x20-\x7E]*$/;function Uc(n){return Fc.test(n)}s(Uc,"isBasicASCII");b.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function zc(n){return b.UNUSUAL_LINE_TERMINATORS.test(n)}s(zc,"containsUnusualLineTerminators");function qc(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374||n>=65504&&n<=65510}s(qc,"isFullWidthCharacter");function $1(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}s($1,"isEmojiImprecise");function jc(n,e,t=""){let r=n.trimStart();if(r.lengthe){u=!0;break}o=i.lastIndex,i.lastIndex+=1}if(!u)return r;if(o===0)return t;let a=r.substring(0,o).trimEnd();return a.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,$c=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,Hc=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,H1=new RegExp("(?:"+[Bc.source,$c.source,Hc.source].join("|")+")","g");function*Gc(n){let e=0;for(let t of n.matchAll(H1))e!==t.index&&(yield{isCode:!1,str:n.substring(e,t.index)}),yield{isCode:!0,str:t[0]},e=t.index+t[0].length;e!==n.length&&(yield{isCode:!1,str:n.substring(e)})}s(Gc,"forAnsiStringParts");function G1(n){return n&&(n=n.replace(H1,"")),n}s(G1,"removeAnsiEscapeCodes");var Kc=/\\\[.*?\\\]/g;function Vc(n){return G1(n).replace(Kc,"")}s(Vc,"removeAnsiEscapeCodesFromPrompt");b.UTF8_BOM_CHARACTER="\uFEFF";function K1(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}s(K1,"startsWithUTF8BOM");function Qc(n){return K1(n)?n.substr(1):n}s(Qc,"stripUTF8BOM");function Xc(n,e){if(!n||!e||n.length0&&t>=0);return t===-1?n:(n[t-1]==="\r"&&t--,n.substr(0,t))}s(Zc,"getNLines");function e2(n){return n=n%52,n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}s(e2,"singleLetterHash");function t2(n){return Nt.getInstance().getGraphemeBreakType(n)}s(t2,"getGraphemeBreakType");function O1(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}s(O1,"breakBetweenGraphemeBreakType");var Nt=class n{static{s(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return n._INSTANCE||(n._INSTANCE=new n),n._INSTANCE}constructor(){this._data=n2()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let t=this._data,r=t.length/3,i=1;for(;i<=r;)if(et[3*i+1])i=2*i+1;else return t[3*i+2];return 0}};function n2(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}s(n2,"getGraphemeBreakRawData");function r2(n,e){if(n===0)return 0;let t=i2(n,e);if(t!==void 0)return t;let r=new at(e,n);return r.prevCodePoint(),r.offset}s(r2,"getLeftDeleteOffset");function i2(n,e){let t=new at(e,n),r=t.prevCodePoint();for(;s2(r)||r===65039||r===8419;){if(t.offset===0)return;r=t.prevCodePoint()}if(!$1(r))return;let i=t.offset;return i>0&&t.prevCodePoint()===8205&&(i=t.offset),i}s(i2,"getOffsetBeforeLastEmojiComponent");function s2(n){return 127995<=n&&n<=127999}s(s2,"isEmojiModifier");b.noBreakWhitespace="\xA0";var Li=class n{static{s(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new R1.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new ec.LRUCachedFunction(e=>{let t=e.split(",");function r(f){let _=new Map;for(let A=0;A!f.startsWith("_")&&Object.hasOwn(u,f));a.length===0&&(a=["_default"]);let l;for(let f of a){let _=r(u[f]);l=o(l,_)}let c=r(u._common),h=i(c,l);return new n(h)})}static getInstance(e){return n.cache.get(Array.from(e).join(","))}static{this._locales=new R1.Lazy(()=>Object.keys(n.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return n._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let t=0;t{"use strict";d();Object.defineProperty(J,"__esModule",{value:!0});J.isPathSeparator=Oe;J.toSlashes=V1;J.toPosixPath=l2;J.getRoot=c2;J.isUNC=f2;J.isValidBasename=p2;J.isEqual=g2;J.isEqualOrParent=_2;J.isWindowsDriveLetter=Ai;J.sanitizeFilePath=b2;J.removeTrailingPathSeparator=Q1;J.isRootOrDriveLetter=y2;J.hasDriveLetter=Pi;J.getDriveLetter=C2;J.indexOfPath=w2;J.parseLineAndColumnAware=v2;J.randomPath=L2;var pe=xt(),qe=Qe(),vn=wn(),a2=Ur();function Oe(n){return n===47||n===92}s(Oe,"isPathSeparator");function V1(n){return n.replace(/[\\/]/g,pe.posix.sep)}s(V1,"toSlashes");function l2(n){return n.indexOf("/")===-1&&(n=V1(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}s(l2,"toPosixPath");function c2(n,e=pe.posix.sep){if(!n)return"";let t=n.length,r=n.charCodeAt(0);if(Oe(r)){if(Oe(n.charCodeAt(1))&&!Oe(n.charCodeAt(2))){let o=3,u=o;for(;o\|]/g,d2=/[/]/g,m2=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function p2(n,e=qe.isWindows){let t=e?h2:d2;return!(!n||n.length===0||/^\s+$/.test(n)||(t.lastIndex=0,t.test(n))||e&&m2.test(n)||n==="."||n===".."||e&&n[n.length-1]==="."||e&&n.length!==n.trim().length||n.length>255)}s(p2,"isValidBasename");function g2(n,e,t){let r=n===e;return!t||r?r:!n||!e?!1:(0,vn.equalsIgnoreCase)(n,e)}s(g2,"isEqual");function _2(n,e,t,r=pe.sep){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!(0,vn.startsWithIgnoreCase)(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===r&&o--,n.charAt(o)===r}return e.charAt(e.length-1)!==r&&(e+=r),n.indexOf(e)===0}s(_2,"isEqualOrParent");function Ai(n){return n>=65&&n<=90||n>=97&&n<=122}s(Ai,"isWindowsDriveLetter");function b2(n,e){return qe.isWindows&&n.endsWith(":")&&(n+=pe.sep),(0,pe.isAbsolute)(n)||(n=(0,pe.join)(e,n)),n=(0,pe.normalize)(n),Q1(n)}s(b2,"sanitizeFilePath");function Q1(n){return qe.isWindows?(n=(0,vn.rtrim)(n,pe.sep),n.endsWith(":")&&(n+=pe.sep)):(n=(0,vn.rtrim)(n,pe.sep),n||(n=pe.sep)),n}s(Q1,"removeTrailingPathSeparator");function y2(n){let e=(0,pe.normalize)(n);return qe.isWindows?n.length>3?!1:Pi(e)&&(n.length===2||e.charCodeAt(2)===92):e===pe.posix.sep}s(y2,"isRootOrDriveLetter");function Pi(n,e=qe.isWindows){return e?Ai(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}s(Pi,"hasDriveLetter");function C2(n,e=qe.isWindows){return Pi(n,e)?n[0]:void 0}s(C2,"getDriveLetter");function w2(n,e,t){return e.length>n.length?-1:n===e?0:(t&&(n=n.toLowerCase(),e=e.toLowerCase()),n.indexOf(e))}s(w2,"indexOfPath");function v2(n){let e=n.split(":"),t,r,i;for(let o of e){let u=Number(o);(0,a2.isNumber)(u)?r===void 0?r=u:i===void 0&&(i=u):t=t?[t,o].join(":"):o}if(!t)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:t,line:r!==void 0?r:void 0,column:i!==void 0?i:r!==void 0?1:void 0}}s(v2,"parseLineAndColumnAware");var k2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",E2="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function L2(n,e,t=8){let r="";for(let o=0;o{"use strict";d();var T2=ge&&ge.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),x2=ge&&ge.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),N2=ge&&ge.__importStar||(function(){var n=s(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i0?` Found '${t[0][0]}' at index ${t[0].index} (${t.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${r} (len:${n.scheme.length})`)}if(n.path){if(n.authority){if(!P2.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(I2.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(S2,"_validateUri");function R2(n,e){return!n&&!e?"file":n}s(R2,"_schemeFix");function O2(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==ye&&(e=ye+e):e=ye;break}return e}s(O2,"_referenceResolution");var B="",ye="/",D2=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,Ln=class n{static{s(this,"URI")}static isUri(e){return e instanceof n?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,t,r,i,o,u=!1){typeof e=="object"?(this.scheme=e.scheme||B,this.authority=e.authority||B,this.path=e.path||B,this.query=e.query||B,this.fragment=e.fragment||B):(this.scheme=R2(e,u),this.authority=t||B,this.path=O2(this.scheme,r||B),this.query=i||B,this.fragment=o||B,S2(this,u))}get fsPath(){return Tn(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:r,path:i,query:o,fragment:u}=e;return t===void 0?t=this.scheme:t===null&&(t=B),r===void 0?r=this.authority:r===null&&(r=B),i===void 0?i=this.path:i===null&&(i=B),o===void 0?o=this.query:o===null&&(o=B),u===void 0?u=this.fragment:u===null&&(u=B),t===this.scheme&&r===this.authority&&i===this.path&&o===this.query&&u===this.fragment?this:new je(t,r,i,o,u)}static parse(e,t=!1){let r=D2.exec(e);return r?new je(r[2]||B,kn(r[4]||B),kn(r[5]||B),kn(r[7]||B),kn(r[9]||B),t):new je(B,B,B,B,B)}static file(e){let t=B;if(En.isWindows&&(e=e.replace(/\\/g,ye)),e[0]===ye&&e[1]===ye){let r=e.indexOf(ye,2);r===-1?(t=e.substring(2),e=ye):(t=e.substring(2,r),e=e.substring(r)||ye)}return new je("file",t,e,B,B)}static from(e,t){return new je(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let r;return En.isWindows&&e.scheme==="file"?r=n.file(Y1.win32.join(Tn(e,!0),...t)).path:r=Y1.posix.join(e.path,...t),e.with({path:r})}toString(e=!1){return Ii(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof n)return e;{let t=new je(e);return t._formatted=e.external??null,t._fsPath=e._sep===eo?e.fsPath??null:null,t}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};ge.URI=Ln;function M2(n){return!n||typeof n!="object"?!1:typeof n.scheme=="string"&&(typeof n.authority=="string"||typeof n.authority>"u")&&(typeof n.path=="string"||typeof n.path>"u")&&(typeof n.query=="string"||typeof n.query>"u")&&(typeof n.fragment=="string"||typeof n.fragment>"u")}s(M2,"isUriComponents");var eo=En.isWindows?1:void 0,je=class extends Ln{static{s(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Tn(this,!1)),this._fsPath}toString(e=!1){return e?Ii(this,!0):(this._formatted||(this._formatted=Ii(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=eo),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},to={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function J1(n,e,t){let r,i=-1;for(let o=0;o=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45||u===46||u===95||u===126||e&&u===47||t&&u===91||t&&u===93||t&&u===58)i!==-1&&(r+=encodeURIComponent(n.substring(i,o)),i=-1),r!==void 0&&(r+=n.charAt(o));else{r===void 0&&(r=n.substr(0,o));let a=to[u];a!==void 0?(i!==-1&&(r+=encodeURIComponent(n.substring(i,o)),i=-1),r+=a):i===-1&&(i=o)}}return i!==-1&&(r+=encodeURIComponent(n.substring(i))),r!==void 0?r:n}s(J1,"encodeURIComponentFast");function F2(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,En.isWindows&&(t=t.replace(/\//g,"\\")),t}s(Tn,"uriToFsPath");function Ii(n,e){let t=e?F2:J1,r="",{scheme:i,authority:o,path:u,query:a,fragment:l}=n;if(i&&(r+=i,r+=":"),(o||i==="file")&&(r+=ye,r+=ye),o){let c=o.indexOf("@");if(c!==-1){let h=o.substr(0,c);o=o.substr(c+1),c=h.lastIndexOf(":"),c===-1?r+=t(h,!1,!1):(r+=t(h.substr(0,c),!1,!1),r+=":",r+=t(h.substr(c+1),!1,!0)),r+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?r+=t(o,!1,!0):(r+=t(o.substr(0,c),!1,!0),r+=o.substr(c))}if(u){if(u.length>=3&&u.charCodeAt(0)===47&&u.charCodeAt(2)===58){let c=u.charCodeAt(1);c>=65&&c<=90&&(u=`/${String.fromCharCode(c+32)}:${u.substr(3)}`)}else if(u.length>=2&&u.charCodeAt(1)===58){let c=u.charCodeAt(0);c>=65&&c<=90&&(u=`${String.fromCharCode(c+32)}:${u.substr(2)}`)}r+=t(u,!0,!1)}return a&&(r+="?",r+=t(a,!1,!1)),l&&(r+="#",r+=e?l:J1(l,!1,!1)),r}s(Ii,"_asFormatted");function no(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+no(n.substr(3)):n}}s(no,"decodeURIComponentGraceful");var Z1=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function kn(n){return n.match(Z1)?n.replace(Z1,e=>no(e)):n}s(kn,"percentDecode")});var uo=M(D=>{"use strict";d();var U2=D&&D.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),z2=D&&D.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),Fi=D&&D.__importStar||(function(){var n=s(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;iso(n,t))}s(j2,"matchesSomeScheme");D.connectionTokenCookieName="vscode-tkn";D.connectionTokenQueryName="tkn";var Di=class{static{s(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=Oi.posix.join(t??"/",oo(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Oi.posix.join(this._serverRootPath,Ee.vscodeRemoteResource)}set(e,t,r){this._hosts[e]=t,this._ports[e]=r}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return q2.onUnexpectedExternalError(a),e}let t=e.authority,r=this._hosts[t];r&&r.indexOf(":")!==-1&&r.indexOf("[")===-1&&(r=`[${r}]`);let i=this._ports[t],o=this._connectionTokens[t],u=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(u+=`&${D.connectionTokenQueryName}=${encodeURIComponent(o)}`),Je.URI.from({scheme:Ri.isWeb?this._preferredWebSchema:Ee.vscodeRemoteResource,authority:`${r}:${i}`,path:this._remoteResourcesPath,query:u})}};D.RemoteAuthorities=new Di;function oo(n){return`${n.quality??"oss"}-${n.commit??"dev"}`}s(oo,"getServerProductSegment");D.builtinExtensionsPath="vs/../../extensions";D.nodeModulesPath="vs/../../node_modules";D.nodeModulesAsarPath="vs/../../node_modules.asar";D.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";D.VSCODE_AUTHORITY="vscode-app";var Mi=class n{static{s(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=D.VSCODE_AUTHORITY}asBrowserUri(e){let t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(e){return e.scheme===Ee.vscodeRemote?D.RemoteAuthorities.rewrite(e):e.scheme===Ee.file&&(Ri.isNative||Ri.webWorkerOrigin===`${Ee.vscodeFileResource}://${n.FALLBACK_AUTHORITY}`)?e.with({scheme:Ee.vscodeFileResource,authority:e.authority||n.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let t=this.toUri(e);return this.uriToFileUri(t)}uriToFileUri(e){return e.scheme===Ee.vscodeFileResource?e.with({scheme:Ee.file,authority:e.authority!==n.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(Je.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let t=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(t))return Je.URI.joinPath(Je.URI.parse(t,!0),e);let r=Oi.join(t,e);return Je.URI.file(r)}throw new Error("Cannot determine URI for module id!")}};D.FileAccess=new Mi;D.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});D.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var io;(function(n){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));let t="vscode-coi";function r(o){let u;typeof o=="string"?u=new URL(o).searchParams:o instanceof URL?u=o.searchParams:Je.URI.isUri(o)&&(u=new URL(o.toString(!0)).searchParams);let a=u?.get(t);if(a)return e.get(a)}s(r,"getHeadersFromQuery"),n.getHeadersFromQuery=r;function i(o,u,a){if(!globalThis.crossOriginIsolated)return;let l=u&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}s(i,"addSearchParam"),n.addSearchParam=i})(io||(D.COI=io={}))});var ho=M(g=>{"use strict";d();var W2=g&&g.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),B2=g&&g.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),co=g&&g.__importStar||(function(){var n=s(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;ict.getRoot(r).length&&r[r.length-1]===t}else{let r=e.path;return r.length>1&&r.charCodeAt(r.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ae.sep){return(0,g.hasTrailingPathSeparator)(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ae.sep){let r=!1;if(e.scheme===We.Schemas.file){let i=Le(e);r=i!==void 0&&i.length===ct.getRoot(i).length&&i[i.length-1]===t}else{t="/";let i=e.path;r=i.length===1&&i.charCodeAt(i.length-1)===47}return!r&&!(0,g.hasTrailingPathSeparator)(e,t)?e.with({path:e.path+"/"}):e}};g.ExtUri=ft;g.extUri=new ft(()=>!1);g.extUriBiasedIgnorePathCase=new ft(n=>n.scheme===We.Schemas.file?!fo.isLinux:!0);g.extUriIgnorePathCase=new ft(n=>!0);g.isEqual=g.extUri.isEqual.bind(g.extUri);g.isEqualOrParent=g.extUri.isEqualOrParent.bind(g.extUri);g.getComparisonKey=g.extUri.getComparisonKey.bind(g.extUri);g.basenameOrAuthority=g.extUri.basenameOrAuthority.bind(g.extUri);g.basename=g.extUri.basename.bind(g.extUri);g.extname=g.extUri.extname.bind(g.extUri);g.dirname=g.extUri.dirname.bind(g.extUri);g.joinPath=g.extUri.joinPath.bind(g.extUri);g.normalizePath=g.extUri.normalizePath.bind(g.extUri);g.relativePath=g.extUri.relativePath.bind(g.extUri);g.resolvePath=g.extUri.resolvePath.bind(g.extUri);g.isAbsolutePath=g.extUri.isAbsolutePath.bind(g.extUri);g.isEqualAuthority=g.extUri.isEqualAuthority.bind(g.extUri);g.hasTrailingPathSeparator=g.extUri.hasTrailingPathSeparator.bind(g.extUri);g.removeTrailingPathSeparator=g.extUri.removeTrailingPathSeparator.bind(g.extUri);g.addTrailingPathSeparator=g.extUri.addTrailingPathSeparator.bind(g.extUri);function $2(n,e){let t=[];for(let r=0;ru===r?!1:(0,g.isEqualOrParent)(i,e(o)))||t.push(n[r])}return t}s($2,"distinctParents");var lo;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){let r=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(u=>{let[a,l]=u.split(":");a&&l&&r.set(a,l)});let o=t.path.substring(0,t.path.indexOf(";"));return o&&r.set(n.META_DATA_MIME,o),r}s(e,"parseMetaData"),n.parseMetaData=e})(lo||(g.DataUri=lo={}));function H2(n,e,t){if(e){let r=n.path;return r&&r[0]!==ae.posix.sep&&(r=ae.posix.sep+r),n.with({scheme:t,authority:e,path:r})}return n.with({scheme:t})}s(H2,"toLocalResource")});var mo=M(xn=>{"use strict";d();Object.defineProperty(xn,"__esModule",{value:!0});xn.MicrotaskDelay=void 0;xn.MicrotaskDelay=Symbol("MicrotaskDelay")});var vo=M(m=>{"use strict";d();Object.defineProperty(m,"__esModule",{value:!0});m.AsyncReader=m.AsyncReaderEndOfStream=m.CancelableAsyncIterableProducer=m.AsyncIterableProducer=m.AsyncIterableSource=m.AsyncIterableObject=m.LazyStatefulPromise=m.StatefulPromise=m.Promises=m.DeferredPromise=m.IntervalCounter=m.TaskSequentializer=m.GlobalIdleValue=m.AbstractIdleValue=m._runWhenIdle=m.runWhenGlobalIdle=m.ThrottledWorker=m.RunOnceWorker=m.ProcessTimeRunOnceScheduler=m.RunOnceScheduler=m.IntervalTimer=m.TimeoutTimer=m.TaskQueue=m.ResourceQueue=m.LimitedQueue=m.Queue=m.Limiter=m.AutoOpenBarrier=m.Barrier=m.ThrottledDelayer=m.Delayer=m.SequencerByKey=m.Sequencer=m.Throttler=void 0;m.isThenable=_o;m.createCancelablePromise=bo;m.raceCancellation=yo;m.raceCancellationError=Q2;m.rejectIfNotCanceled=X2;m.notCancellablePromise=Y2;m.raceCancellablePromises=J2;m.raceTimeout=Co;m.asPromise=Z2;m.promiseWithResolvers=wo;m.timeout=rs;m.disposableTimeout=n0;m.sequence=r0;m.first=i0;m.firstParallel=s0;m.installFakeRunWhenIdle=o0;m.retry=u0;m.createCancelableAsyncIterableProducer=a0;m.cancellableIterable=l0;m.createTimeout=c0;var ns=gi(),le=He(),It=mi(),Be=tn(),po=ho(),G2=Qe(),K2=mo(),V2=yn();function _o(n){return!!n&&typeof n.then=="function"}s(_o,"isThenable");function bo(n){let e=new ns.CancellationTokenSource,t=n(e.token),r=!1,i=new Promise((o,u)=>{let a=e.token.onCancellationRequested(()=>{r=!0,a.dispose(),u(new le.CancellationError)});Promise.resolve(t).then(l=>{a.dispose(),e.dispose(),r?(0,Be.isDisposable)(l)&&l.dispose():o(l)},l=>{a.dispose(),e.dispose(),u(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(o,u){return i.then(o,u)}catch(o){return this.then(void 0,o)}finally(o){return i.finally(o)}}}s(bo,"createCancelablePromise");function yo(n,e,t){return new Promise((r,i)=>{let o=e.onCancellationRequested(()=>{o.dispose(),r(t)});n.then(r,i).finally(()=>o.dispose())})}s(yo,"raceCancellation");function Q2(n,e){return new Promise((t,r)=>{let i=e.onCancellationRequested(()=>{i.dispose(),r(new le.CancellationError)});n.then(t,r).finally(()=>i.dispose())})}s(Q2,"raceCancellationError");function X2(n){if(!(0,le.isCancellationError)(n))return Promise.reject(n)}s(X2,"rejectIfNotCanceled");function Y2(n){return new Promise((e,t)=>{n.then(e,t)})}s(Y2,"notCancellablePromise");function J2(n){let e=-1,t=n.map((i,o)=>i.then(u=>(e=o,u))),r=Promise.race(t);return r.cancel=()=>{n.forEach((i,o)=>{o!==e&&i.cancel&&i.cancel()})},r.finally(()=>{r.cancel()}),r}s(J2,"raceCancellablePromises");function Co(n,e,t){let r,i=setTimeout(()=>{r?.(void 0),t?.()},e);return Promise.race([n.finally(()=>clearTimeout(i)),new Promise(o=>r=o)])}s(Co,"raceTimeout");function Z2(n){return new Promise((e,t)=>{let r=n();_o(r)?r.then(e,t):e(r)})}s(Z2,"asPromise");function wo(){let n,e;return{promise:new Promise((r,i)=>{n=r,e=i}),resolve:n,reject:e}}s(wo,"promiseWithResolvers");var Nn=class{static{s(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new ns.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let t=s(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let r=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,r},"onComplete");this.queuedPromise=new Promise(r=>{this.activePromise.then(t,t).then(r)})}return new Promise((t,r)=>{this.queuedPromise.then(t,r)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((t,r)=>{this.activePromise.then(i=>{this.activePromise=null,t(i)},i=>{this.activePromise=null,r(i)})})}dispose(){this.cancellationTokenSource.cancel()}};m.Throttler=Nn;var Ui=class{static{s(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};m.Sequencer=Ui;var zi=class{static{s(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,t){let i=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===i&&this.promiseMap.delete(e)});return this.promiseMap.set(e,i),i}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};m.SequencerByKey=zi;var e0=s((n,e)=>{let t=!0,r=setTimeout(()=>{t=!1,e()},n);return{isTriggered:s(()=>t,"isTriggered"),dispose:s(()=>{clearTimeout(r),t=!1},"dispose")}},"timeoutDeferred"),t0=s(n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:s(()=>e,"isTriggered"),dispose:s(()=>{e=!1},"dispose")}},"microtaskDeferred"),An=class{static{s(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,o)=>{this.doResolve=i,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let i=this.task;return this.task=null,i()}}));let r=s(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=t===K2.MicrotaskDelay?t0(r):e0(t,r),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new le.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};m.Delayer=An;var qi=class{static{s(this,"ThrottledDelayer")}constructor(e){this.delayer=new An(e),this.throttler=new Nn}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};m.ThrottledDelayer=qi;var Pn=class{static{s(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};m.Barrier=Pn;var ji=class extends Pn{static{s(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};m.AutoOpenBarrier=ji;function rs(n,e){return e?new Promise((t,r)=>{let i=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(i),o.dispose(),r(new le.CancellationError)})}):bo(t=>rs(n,t))}s(rs,"timeout");function n0(n,e=0,t){let r=setTimeout(()=>{n(),t&&i.dispose()},e),i=(0,Be.toDisposable)(()=>{clearTimeout(r),t?.delete(i)});return t?.add(i),i}s(n0,"disposableTimeout");function r0(n){let e=[],t=0,r=n.length;function i(){return t!!r,t=null){let r=0,i=n.length,o=s(()=>{if(r>=i)return Promise.resolve(t);let u=n[r++];return Promise.resolve(u()).then(l=>e(l)?Promise.resolve(l):o())},"loop");return o()}s(i0,"first");function s0(n,e=r=>!!r,t=null){if(n.length===0)return Promise.resolve(t);let r=n.length,i=s(()=>{r=-1;for(let o of n)o.cancel?.()},"finish");return new Promise((o,u)=>{for(let a of n)a.then(l=>{--r>=0&&e(l)?(i(),o(l)):r===0&&o(t)}).catch(l=>{--r>=0&&(i(),u(l))})})}s(s0,"firstParallel");var In=class{static{s(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new It.Emitter}whenIdle(){return this.size>0?It.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((t,r)=>{this.outstandingPromises.push({factory:e,c:t,e:r}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};m.Limiter=In;var Sn=class extends In{static{s(this,"Queue")}constructor(){super(1)}};m.Queue=Sn;var Wi=class{static{s(this,"LimitedQueue")}constructor(){this.sequentializer=new On,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};m.LimitedQueue=Wi;var Bi=class{static{s(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new De;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=po.extUri){let r=t.getComparisonKey(e);return this.queues.get(r)?.size??0}queueFor(e,t,r=po.extUri){let i=r.getComparisonKey(e),o=this.queues.get(i);if(!o){o=new Sn;let u=this.drainListenerCount++,a=It.Event.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(i),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(u),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Be.DisposableMap),this.drainListeners.set(u,a),this.queues.set(i,o)}return o.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};m.ResourceQueue=Bi;var $i=class{static{s(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let t=new De;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}scheduleSkipIfCleared(e){let t=new De;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),t.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new le.BugIndicatingError;this._runningTask=e.task;try{let t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let t of e)t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new le.CancellationError)}};m.TaskQueue=$i;var Hi=class{static{s(this,"TimeoutTimer")}constructor(e,t){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new le.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new le.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}};m.TimeoutTimer=Hi;var Gi=class{static{s(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new le.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},t);this.disposable=(0,Be.toDisposable)(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};m.IntervalTimer=Gi;var St=class{static{s(this,"RunOnceScheduler")}constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};m.RunOnceScheduler=St;var Ki=class{static{s(this,"ProcessTimeRunOnceScheduler")}constructor(e,t){t%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${t}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=t,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};m.ProcessTimeRunOnceScheduler=Ki;var Vi=class extends St{static{s(this,"RunOnceWorker")}constructor(e,t){super(e,t),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};m.RunOnceWorker=Vi;var Qi=class extends Be.Disposable{static{s(this,"ThrottledWorker")}constructor(e,t){super(),this.options=e,this.handler=t,this.pendingWork=[],this.throttler=this._register(new Be.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let r of e)this.pendingWork.push(r);let t=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||t>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-t,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new St(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};m.ThrottledWorker=Qi;(function(){let n=globalThis;typeof n.requestIdleCallback!="function"||typeof n.cancelIdleCallback!="function"?m._runWhenIdle=(e,t,r)=>{(0,G2.setTimeout0)(()=>{if(i)return;let o=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,o-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:m._runWhenIdle=(e,t,r)=>{let i=e.requestIdleCallback(t,typeof r=="number"?{timeout:r}:void 0),o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(i))}}},m.runWhenGlobalIdle=(e,t)=>(0,m._runWhenIdle)(globalThis,e,t)})();function o0(n){let e=m._runWhenIdle,t=m.runWhenGlobalIdle;return m._runWhenIdle=n,m.runWhenGlobalIdle=(r,i)=>n(globalThis,r,i),(0,Be.toDisposable)(()=>{m._runWhenIdle=e,m.runWhenGlobalIdle=t})}s(o0,"installFakeRunWhenIdle");var Rn=class{static{s(this,"AbstractIdleValue")}constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(r){this._error=r}finally{this._didRun=!0}},this._handle=(0,m._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};m.AbstractIdleValue=Rn;var Xi=class extends Rn{static{s(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};m.GlobalIdleValue=Xi;async function u0(n,e,t){let r;for(let i=0;ir?.(),"cancel"),promise:t},t.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),t}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:t,resolve:r,reject:i}=wo();this._queued={run:e,promise:t,promiseResolve:r,promiseReject:i}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};m.TaskSequentializer=On;var Yi=class{static{s(this,"IntervalCounter")}constructor(e,t=()=>Date.now()){this.interval=e,this.nowFn=t,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};m.IntervalCounter=Yi;var De=class n{static{s(this,"DeferredPromise")}static fromPromise(e){let t=new n;return t.settleWith(e),t}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}settleWith(e){return e.then(t=>this.complete(t),t=>this.error(t))}cancel(){return this.error(new le.CancellationError)}};m.DeferredPromise=De;var go;(function(n){async function e(r){let i,o=await Promise.all(r.map(u=>u.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return o}s(e,"settled"),n.settled=e;function t(r){return new Promise(async(i,o)=>{try{await r(i,o)}catch(u){o(u)}})}s(t,"withAsyncBody"),n.withAsyncBody=t})(go||(m.Promises=go={}));var Dn=class{static{s(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(t=>(this._value=t,this._isResolved=!0,t),t=>{throw this._error=t,this._isResolved=!0,t})}requireValue(){if(!this._isResolved)throw new le.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};m.StatefulPromise=Dn;var Ji=class{static{s(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new V2.Lazy(()=>new Dn(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};m.LazyStatefulPromise=Ji;var Mn=class n{static{s(this,"AsyncIterableObject")}static fromArray(e){return new n(t=>{t.emitMany(e)})}static fromPromise(e){return new n(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new n(async t=>{await Promise.all(e.map(async r=>t.emitOne(await r)))})}static merge(e){return new n(async t=>{await Promise.all(e.map(async r=>{for await(let i of r)t.emitOne(i)}))})}static{this.EMPTY=n.fromArray([])}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new It.Emitter,queueMicrotask(async()=>{let r={emitOne:s(i=>this.emitOne(i),"emitOne"),emitMany:s(i=>this.emitMany(i),"emitMany"),reject:s(i=>this.reject(i),"reject")};try{await Promise.resolve(e(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:s(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,t){return new n(async r=>{for await(let i of e)r.emitOne(t(i))})}map(e){return n.map(this,e)}static filter(e,t){return new n(async r=>{for await(let i of e)t(i)&&r.emitOne(i)})}filter(e){return n.filter(this,e)}static coalesce(e){return n.filter(e,t=>!!t)}coalesce(){return n.coalesce(this)}static async toPromise(e){let t=[];for await(let r of e)t.push(r);return t}toPromise(){return n.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};m.AsyncIterableObject=Mn;function a0(n){let e=new ns.CancellationTokenSource,t=n(e.token);return new Un(e,async r=>{let i=e.token.onCancellationRequested(()=>{i.dispose(),e.dispose(),r.reject(new le.CancellationError)});try{for await(let o of t){if(e.token.isCancellationRequested)return;r.emitOne(o)}i.dispose(),e.dispose()}catch(o){i.dispose(),e.dispose(),r.reject(o)}})}s(a0,"createCancelableAsyncIterableProducer");var Zi=class{static{s(this,"AsyncIterableSource")}constructor(e){this._deferred=new De,this._asyncIterable=new Mn(i=>{if(t){i.reject(t);return}return r&&i.emitMany(r),this._errorFn=o=>i.reject(o),this._emitOneFn=o=>i.emitOne(o),this._emitManyFn=o=>i.emitMany(o),this._deferred.p},e);let t,r;this._errorFn=i=>{t||(t=i)},this._emitOneFn=i=>{r||(r=[]),r.push(i)},this._emitManyFn=i=>{r?i.forEach(o=>r.push(o)):r=i.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};m.AsyncIterableSource=Zi;function l0(n,e){let t=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():n;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await yo(t.next(),e)||{done:!0,value:void 0}},throw:t.throw?.bind(t),return:t.return?.bind(t),[Symbol.asyncIterator](){return this}}}s(l0,"cancellableIterable");var es=class{static{s(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new le.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new De;return this._unsatisfiedConsumers.push(e),e.p}}},Fn=class n{static{s(this,"AsyncIterableProducer")}constructor(e,t){this._onReturn=t,this._producerConsumer=new es,this._iterator={next:s(()=>this._producerConsumer.consume(),"next"),return:s(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:s(async r=>(this._finishError(r),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let r=e({emitOne:s(i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),"emitOne"),emitMany:s(i=>{for(let o of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}})},"emitMany"),reject:s(i=>this._finishError(i),"reject")});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new n(t=>{t.emitMany(e)})}static fromPromise(e){return new n(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new n(async t=>{await Promise.all(e.map(async r=>t.emitOne(await r)))})}static merge(e){return new n(async t=>{await Promise.all(e.map(async r=>{for await(let i of r)t.emitOne(i)}))})}static{this.EMPTY=n.fromArray([])}static map(e,t){return new n(async r=>{for await(let i of e)r.emitOne(t(i))})}static tee(e){let t,r,i=new De,o=s(async()=>{if(!(!t||!r))try{for await(let l of e)t.emitOne(l),r.emitOne(l)}catch(l){t.reject(l),r.reject(l)}finally{i.complete()}},"start"),u=new n(async l=>(t=l,o(),i.p)),a=new n(async l=>(r=l,o(),i.p));return[u,a]}map(e){return n.map(this,e)}static coalesce(e){return n.filter(e,t=>!!t)}coalesce(){return n.coalesce(this)}static filter(e,t){return new n(async r=>{for await(let i of e)t(i)&&r.emitOne(i)})}filter(e){return n.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};m.AsyncIterableProducer=Fn;var Un=class extends Fn{static{s(this,"CancelableAsyncIterableProducer")}constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}};m.CancelableAsyncIterableProducer=Un;m.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var ts=class{static{s(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?m.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,t){do{let r=await this.peek();if(r===m.AsyncReaderEndOfStream||!e(r))break;await this.read(),await t(r)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?m.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return m.AsyncReaderEndOfStream;throw new le.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await Co(this._extendBuffer(),e),this._atEnd)return m.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:t}=await this._source.next();this._extendBufferPromise=void 0,t?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};m.AsyncReader=ts;function c0(n,e){let t=setTimeout(e,n);return(0,Be.toDisposable)(()=>clearTimeout(t))}s(c0,"createTimeout")});var ko=M(zn=>{"use strict";d();Object.defineProperty(zn,"__esModule",{value:!0});zn.Position=void 0;var is=class n{static{s(this,"Position")}constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new n(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return n.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return n.isBefore(this,e)}static isBefore(e,t){return e.lineNumber{"use strict";d();Object.defineProperty(qn,"__esModule",{value:!0});qn.Range=void 0;var Eo=ko(),ss=class n{static{s(this,"Range")}constructor(e,t,r,i){e>r||e===r&&t>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return n.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return n.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return n.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return n.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return n.plusRange(this,e)}static plusRange(e,t){let r,i,o,u;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,u=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,u=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new n(r,i,o,u)}intersectRanges(e){return n.intersectRanges(this,e)}static intersectRanges(e,t){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,h=t.endColumn;return rc?(o=c,u=h):o===c&&(u=Math.min(u,h)),r>o||r===o&&i>u?null:new n(r,i,o,u)}equalsRange(e){return n.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return n.getEndPosition(this)}static getEndPosition(e){return new Eo.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return n.getStartPosition(this)}static getStartPosition(e){return new Eo.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new n(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new n(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return n.collapseToStart(this)}static collapseToStart(e){return new n(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return n.collapseToEnd(this)}static collapseToEnd(e){return new n(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new n(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new n(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new n(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};qn.Range=ss});d();d();d();d();d();d();var dt=class n{static{s(this,"Position")}constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new n(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return n.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return n.isBefore(this,e)}static isBefore(e,t){return e.lineNumberr||e===r&&t>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return n.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return n.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return n.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return n.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return n.plusRange(this,e)}static plusRange(e,t){let r,i,o,u;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,u=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,u=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new n(r,i,o,u)}intersectRanges(e){return n.intersectRanges(this,e)}static intersectRanges(e,t){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,h=t.endColumn;return rc?(o=c,u=h):o===c&&(u=Math.min(u,h)),r>o||r===o&&i>u?null:new n(r,i,o,u)}equalsRange(e){return n.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return n.getEndPosition(this)}static getEndPosition(e){return new dt(e.endLineNumber,e.endColumn)}getStartPosition(){return n.getStartPosition(this)}static getStartPosition(e){return new dt(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new n(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new n(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return n.collapseToStart(this)}static collapseToStart(e){return new n(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return n.collapseToEnd(this)}static collapseToEnd(e){return new n(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new n(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new n(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new n(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};d();d();d();var Mt=class extends Error{constructor(t,r){super(t,{cause:r});this.code="CopilotPromptLoadFailure"}static{s(this,"CopilotPromptLoadFailure")}};d();var ds=_e(require("node:fs/promises")),Ft=_e(require("node:path"));async function ms(n){return await ds.readFile(jo(n))}s(ms,"readFile");function jo(n){return Ft.default.resolve(Ft.default.extname(__filename)!==".ts"?__dirname:Ft.default.resolve(__dirname,"../../dist"),n)}s(jo,"locateFile");var tt=_e(Ns());var Bt=new Map;function Ps(n="o200k_base"){let e=Bt.get(n);return e!==void 0||(e=Bt.get("o200k_base"),e!==void 0)?e:new sr}s(Ps,"getTokenizer");async function ru(n){if(!n.endsWith(".tiktoken.noindex"))throw new Error("File does not end with .tiktoken.noindex");let e=await ms(n),t=new Map,r=[];for(let i=0;ithis.detokenize([r]))}takeLastTokens(e,t){if(t<=0)return{text:"",tokens:[]};let r=4,i=1,o=Math.min(e.length,t*r),u=e.slice(-o),a=this.tokenize(u);for(;a.length{let t=0;for(let r=0;rt.toString()).join(" ")}tokenizeStrings(e){return e.split(/\b/)}tokenLength(e){return this.tokenizeStrings(e).length}takeLastTokens(e,t){let r=this.tokenizeStrings(e).slice(-t);return{text:r.join(""),tokens:r.map(this.hash)}}takeFirstTokens(e,t){let r=this.tokenizeStrings(e).slice(0,t);return{text:r.join(""),tokens:r.map(this.hash)}}takeLastLinesTokens(e,t){let{text:r}=this.takeLastTokens(e,t);if(r.length===e.length||e[e.length-r.length-1]===` -`)return r;let i=r.indexOf(` -`);return r.substring(i+1)}},iu={cl100k_base:{python:3.99,typescript:4.54,typescriptreact:4.58,javascript:4.76,csharp:5.13,java:4.86,cpp:3.85,php:4.1,html:4.57,vue:4.22,go:3.93,dart:5.66,javascriptreact:4.81,css:3.37},o200k_base:{python:4.05,typescript:4.12,typescriptreact:5.01,javascript:4.47,csharp:5.47,java:4.86,cpp:3.8,php:4.35,html:4.86,vue:4.3,go:4.21,dart:5.7,javascriptreact:4.83,css:3.33}},nr=4,sr=class{constructor(e="o200k_base",t){this.languageId=t;this.tokenizerName=e}static{s(this,"ApproximateTokenizer")}tokenize(e){return this.tokenizeStrings(e).map(t=>{let r=0;for(let i=0;i{let r=[],i=t.toString();for(;i.length>0;){let o=i.slice(-nr),u=String.fromCharCode(parseInt(o));r.unshift(u),i=i.slice(0,-nr)}return r.join("")}).join("")}tokenizeStrings(e){return e.match(/.{1,4}/g)??[]}getEffectiveTokenLength(){return this.tokenizerName&&this.languageId?iu[this.tokenizerName]?.[this.languageId]??4:4}tokenLength(e){return Math.ceil(e.length/this.getEffectiveTokenLength())}takeLastTokens(e,t){if(t<=0)return{text:"",tokens:[]};let r=e.slice(-Math.floor(t*this.getEffectiveTokenLength()));return{text:r,tokens:Array.from({length:this.tokenLength(r)},(i,o)=>o)}}takeFirstTokens(e,t){if(t<=0)return{text:"",tokens:[]};let r=e.slice(0,Math.floor(t*this.getEffectiveTokenLength()));return{text:r,tokens:Array.from({length:this.tokenLength(r)},(i,o)=>o)}}takeLastLinesTokens(e,t){let{text:r}=this.takeLastTokens(e,t);if(r.length===e.length||e[e.length-r.length-1]===` -`)return r;let i=r.indexOf(` -`);return r.substring(i+1)}};async function As(n){try{let e=await rr.create(n);Bt.set(n,e)}catch{}}s(As,"setTokenizer");var X0=(async()=>{Bt.set("mock",new ir),await Promise.all([As("cl100k_base"),As("o200k_base")])})();var or=250,su=4,ou=/\w{2}/,$t=class{static{s(this,"NaiveChunker")}constructor(e="o200k_base"){this.tokenizer=Ps(e)}getTokenCount(e){return this.tokenizer.tokenLength(e)}chunkFile(e,t,r={},i){let{maxTokenLength:o=or,removeEmptyLines:u=!0}=r,a=[];for(let l of this._processLinesIntoChunks(e,t,o,!0,u,i)){if(i?.isCancellationRequested)return[];(!u||l.text.length>0&&ou.test(l.text))&&a.push(l)}return a}*_processLinesIntoChunks(e,t,r,i,o,u){let a=uu(t),l=[],c=0,h,f=!0;for(let A=0;A0){let V=z.match(/^\s+/),ce=V?V[0]:"";h=h?lu(h,ce):ce}if(c+q>r){let V=this.finalizeChunk(e,l,i,h??"",!1,f);V&&(yield V),l.length=0,c=0,h=void 0,f=!1}l.push({text:j,lineNumber:A}),c+=q}let _=this.finalizeChunk(e,l,i,h??"",!0,f);_&&(yield _)}finalizeChunk(e,t,r,i,o,u){if(!t.length)return;let a=r?t.map(c=>c.text.substring(i.length)).join(` -`):t.map(c=>c.text).join(` -`),l=t[t.length-1];return{file:e,text:a,rawText:a,isFullFile:u&&o,range:new Dt(t[0].lineNumber+1,1,l.lineNumber+1,l.text.length+1)}}};function uu(n){let e=[],t="";for(let r=0;r0&&e.push(t),e}s(uu,"splitLines");function au(n){return n?n.trim().length===0:!0}s(au,"isFalsyOrWhitespace");function lu(n,e){let t=cu(n,e);return n.substring(0,t)}s(lu,"commonLeadingStr");function cu(n,e){let t=Math.min(n.length,e.length),r=0;for(;rc.text)}getNaiveChunker(e){let t=this.naiveChunkers.get(e);if(t)return t;let r=new $t(e);return this.naiveChunkers.set(e,r),r}clearCache(){this.naiveChunkers.clear()}};d();d();var ur=":memory:";d();var Gt=class{constructor(e,t=-1/0){this.maxSize=e;this.minScore=t;this.store=[]}static{s(this,"SimpleHeap")}toArray(e){if(this.store.length&&typeof e=="number"){let t=this.store.at(0).score*(1-e);return this.store.filter(r=>r.score>=t).map(r=>r.value)}return this.store.map(t=>t.value)}add(e,t){if(e<=this.minScore)return;let r=this.store.findIndex(i=>i.score=0?r:this.store.length,0,{score:e,value:t});this.store.length>this.maxSize;)this.store.pop();this.store.length===this.maxSize&&(this.minScore=this.store.at(-1)?.score??this.minScore)}get size(){return this.store.length}get currentMinScore(){return this.minScore}clear(){this.store.length=0,this.minScore=-1/0}};d();function ar(n){let e=Object.create(null);for(let t of n)e[t]=(e[t]??0)+1;return e}s(ar,"countRecordFrom");function lr(n){return ar(fu(n))}s(lr,"termFrequencies");function*fu(n){let e=s(t=>t.toLowerCase(),"normalize");for(let[t]of n.matchAll(/(?1&&i.push(...o);let u=t.split("_");u.length>1&&i.push(...u);let a=t.match(new RegExp("^([\\D]+)\\p{Number}+$","u"));a&&i.push(a[1]);for(let l of i)l.length>2&&/[\p{Alphabetic}_$]{3,}/gu.test(l)&&r.add(e(l));yield*r}}s(fu,"splitTerms");var Lo=_e(vo()),To=_e(os()),xo=_e(require("fs")),us=_e(require("node:sqlite")),No=_e(require("path"));var jn=class{static{s(this,"PersistentTfIdf")}constructor(e,t){this.hostApi=t;let r={open:!0};if(e!==ur)try{xo.default.mkdirSync(No.default.dirname(e),{recursive:!0}),this.db=new us.default.DatabaseSync(e,r)}catch(i){this.hostApi.logWarn("Failed to open SQLite database on disk. Trying memory db",i)}this.db||(this.db=new us.default.DatabaseSync(ur,r)),this.db.exec(` +`))}},gt=class t extends Error{static{s(this,"ListenerLeakError")}constructor(e,n,r,i,o){super(o?`[${o}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name="ListenerLeakError",this.kind=e,this.listenerCount=i,this.details=n,this.stack=r}static is(e){return e instanceof t||e instanceof Error&&typeof e.kind=="string"&&typeof e.listenerCount=="number"}};M.ListenerLeakError=gt;var Gt=class extends gt{static{s(this,"ListenerRefusalError")}constructor(e,n,r,i,o){super(e,n,r,i,o),this.name="ListenerRefusalError"}};M.ListenerRefusalError=Gt;var Aa=0,Xe=class{static{s(this,"UniqueContainer")}constructor(e){this.value=e,this.id=Aa++}},ka=2,Fs=s((t,e)=>{if(t instanceof Xe)e(t);else for(let n=0;n0||this._options?.leakWarningThreshold?new Ir(e?.onListenerError??mt.onUnexpectedError,this._options?.leakWarningThreshold??pt,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new Ht(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Ss){let e=this._listeners;queueMicrotask(()=>{Fs(e,n=>n.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=c[1]/this._size>.3?"dominated":"popular",f=new Gt(d,`${l}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||mt.onUnexpectedError)(f),ae.Disposable.None}if(this._disposed)return ae.Disposable.None;n&&(e=e.bind(n));let i=new Xe(e),o,u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=Je.create(),o=this._leakageMon.check(i.stack,this._size+1)),Ss&&(i.stack=u??Je.create()),this._listeners?this._listeners instanceof Xe?(this._deliveryQueue??=new Vt,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=(0,ae.toDisposable)(()=>{o?.(),this._removeListener(i)});return Wr(a,r),a},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 n=this._listeners,r=n.indexOf(e);if(r===-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--,n[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*ka<=n.length){let o=0;for(let u=0;u0}};M.Emitter=ne;var xa=s(()=>new Vt,"createEventDeliveryQueue");M.createEventDeliveryQueue=xa;var Vt=class{static{s(this,"EventDeliveryQueuePrivate")}constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Sr=class extends ne{static{s(this,"AsyncEmitter")}async fireAsync(e,n,r){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new Ms.LinkedList),Fs(this._listeners,i=>this._asyncDeliveryQueue.push([i.value,e]));this._asyncDeliveryQueue.size>0&&!n.isCancellationRequested;){let[i,o]=this._asyncDeliveryQueue.shift(),u=[],a={...o,token:n,waitUntil:s(l=>{if(Object.isFrozen(u))throw new Error("waitUntil can NOT be called asynchronous");r&&(l=r(l,i)),u.push(l)},"waitUntil")};try{i(a)}catch(l){(0,mt.onUnexpectedError)(l);continue}Object.freeze(u),await Promise.allSettled(u).then(l=>{for(let c of l)c.status==="rejected"&&(0,mt.onUnexpectedError)(c.reason)})}}};M.AsyncEmitter=Sr;var Kt=class extends ne{static{s(this,"PauseableEmitter")}get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ms.LinkedList,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}};M.PauseableEmitter=Kt;var Rr=class extends Kt{static{s(this,"DebounceEmitter")}constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}};M.DebounceEmitter=Rr;var Or=class extends ne{static{s(this,"MicrotaskEmitter")}constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(n=>super.fire(n)),this._queuedEvents=[]}))}};M.MicrotaskEmitter=Or;var Qt=class{static{s(this,"EventMultiplexer")}constructor(){this.hasListeners=!1,this.events=[],this.emitter=new ne({onWillAddFirstListener:s(()=>this.onFirstListenerAdd(),"onWillAddFirstListener"),onDidRemoveLastListener:s(()=>this.onLastListenerRemove(),"onDidRemoveLastListener")})}get event(){return this.emitter.event}add(e){let n={event:e,listener:null};this.events.push(n),this.hasListeners&&this.hook(n);let r=s(()=>{this.hasListeners&&this.unhook(n);let i=this.events.indexOf(n);this.events.splice(i,1)},"dispose");return(0,ae.toDisposable)((0,va.createSingleCallFunction)(r))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(n=>this.emitter.fire(n))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){this.emitter.dispose();for(let e of this.events)e.listener?.dispose();this.events=[]}};M.EventMultiplexer=Qt;var Dr=class{static{s(this,"DynamicListEventMultiplexer")}constructor(e,n,r,i){this._store=new ae.DisposableStore;let o=this._store.add(new Qt),u=this._store.add(new ae.DisposableMap);function a(l){u.set(l,o.add(i(l)))}s(a,"addItem");for(let l of e)a(l);this._store.add(n(l=>{a(l)})),this._store.add(r(l=>{u.deleteAndDispose(l)})),this.event=o.event}dispose(){this._store.dispose()}};M.DynamicListEventMultiplexer=Dr;var Mr=class{static{s(this,"EventBufferer")}constructor(){this.data=[]}wrapEvent(e,n,r){return(i,o,u)=>e(a=>{let l=this.data[this.data.length-1];if(!n){l?l.buffers.push(()=>i.call(o,a)):i.call(o,a);return}let c=l;if(!c){i.call(o,n(r,a));return}c.items??=[],c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??=r?c.items.reduce(n,r):c.items.reduce(n),i.call(o,c.reducedResult)})},void 0,u)}bufferEvents(e){let n={buffers:new Array};this.data.push(n);let r=e();return this.data.pop(),n.buffers.forEach(i=>i()),r}};M.EventBufferer=Mr;var Fr=class{static{s(this,"Relay")}constructor(){this.listening=!1,this.inputEvent=Bt.None,this.inputEventListener=ae.Disposable.None,this.emitter=new ne({onDidAddFirstListener:s(()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},"onDidAddFirstListener"),onDidRemoveLastListener:s(()=>{this.listening=!1,this.inputEventListener.dispose()},"onDidRemoveLastListener")}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}};M.Relay=Fr;var Ur=class{static{s(this,"ValueWithChangeEvent")}static const(e){return new qr(e)}constructor(e){this._value=e,this._onDidChange=new ne,this.onDidChange=this._onDidChange.event}get value(){return this._value}set value(e){e!==this._value&&(this._value=e,this._onDidChange.fire(void 0))}};M.ValueWithChangeEvent=Ur;var qr=class{static{s(this,"ConstValueWithChangeEvent")}constructor(e){this.value=e,this.onDidChange=Bt.None}};function Pa(t,e,n){let r=new ae.DisposableMap,i=new Set(t());for(let u of i)r.set(u,n(u));let o=new ae.DisposableStore;return o.add(e(()=>{let u=t(),a=(0,ya.diffSets)(i,u);for(let l of a.removed)r.deleteAndDispose(l);for(let l of a.added)r.set(l,n(l));i=new Set(u)})),o.add(r),o}s(Pa,"trackSetChanges");function Wr(t,e){e instanceof ae.DisposableStore?e.add(t):Array.isArray(e)&&e.push(t)}s(Wr,"addToDisposables");function Ds(t,e){if(e instanceof ae.DisposableStore)e.delete(t);else if(Array.isArray(e)){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}t.dispose()}s(Ds,"disposeAndRemove")});var $r=U(Le=>{"use strict";_();Object.defineProperty(Le,"__esModule",{value:!0});Le.CancellationTokenPool=Le.CancellationTokenSource=Le.CancellationToken=void 0;Le.cancelOnDispose=Sa;var Us=jr(),Ia=Ut(),qs=Object.freeze(function(t,e){let n=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(n)}}}),Yt;(function(t){function e(n){return n===t.None||n===t.Cancelled||n instanceof Ze?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}s(e,"isCancellationToken"),t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Us.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:qs})})(Yt||(Le.CancellationToken=Yt={}));var Ze=class{static{s(this,"MutableToken")}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?qs:(this._emitter||(this._emitter=new Us.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},_t=class{static{s(this,"CancellationTokenSource")}constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Ze),this._token}cancel(){this._token?this._token instanceof Ze&&this._token.cancel():this._token=Yt.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Ze&&this._token.dispose():this._token=Yt.None}};Le.CancellationTokenSource=_t;function Sa(t){let e=new _t;return t.add({dispose(){e.cancel()}}),e.token}s(Sa,"cancelOnDispose");var zr=class{static{s(this,"CancellationTokenPool")}constructor(){this._source=new _t,this._listeners=new Ia.DisposableStore,this._total=0,this._cancelled=0,this._isDone=!1}get token(){return this._source.token}add(e){if(this._isDone)return;if(this._total++,e.isCancellationRequested){this._cancelled++,this._check();return}let n=e.onCancellationRequested(()=>{n.dispose(),this._cancelled++,this._check()});this._listeners.add(n)}_check(){!this._isDone&&this._total>0&&this._total===this._cancelled&&(this._isDone=!0,this._listeners.dispose(),this._source.cancel())}dispose(){this._listeners.dispose(),this._source.dispose()}};Le.CancellationTokenPool=zr});var bt=U(C=>{"use strict";_();var Ra=C&&C.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Oa=C&&C.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Da=C&&C.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i=Ma&&t<=Ua||t>=Fa&&t<=qa}s(Te,"isWindowsDeviceRoot");function Jt(t,e,n,r){let i="",o=0,u=-1,a=0,l=0;for(let c=0;c<=t.length;++c){if(c2){let d=i.lastIndexOf(n);d===-1?(i="",o=0):(i=i.slice(0,d),o=i.length-1-i.lastIndexOf(n)),u=c,a=0;continue}else if(i.length!==0){i="",o=0,u=c,a=0;continue}}e&&(i+=i.length>0?`${n}..`:"..",o=2)}else i.length>0?i+=`${n}${t.slice(u+1,c)}`:i=t.slice(u+1,c),o=c-u-1;u=c,a=0}else l===Be&&a!==-1?++a:a=-1}return i}s(Jt,"normalizeString");function za(t){return t?`${t[0]==="."?"":"."}${t}`:""}s(za,"formatExt");function Ws(t,e){ja(e,"pathObject");let n=e.dir||e.root,r=e.base||`${e.name||""}${za(e.ext)}`;return n?n===e.root?`${n}${r}`:`${n}${t}${r}`:r}s(Ws,"_format");C.win32={resolve(...t){let e="",n="",r=!1;for(let i=t.length-1;i>=-1;i--){let o;if(i>=0){if(o=t[i],G(o,`paths[${i}]`),o.length===0)continue}else e.length===0?o=et.cwd():(o=et.env[`=${e}`]||et.cwd(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===le)&&(o=`${e}\\`));let u=o.length,a=0,l="",c=!1,d=o.charCodeAt(0);if(u===1)S(d)&&(a=1,c=!0);else if(S(d))if(c=!0,S(o.charCodeAt(1))){let f=2,y=f;for(;f2&&S(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(r){if(e.length>0)break}else if(n=`${o.slice(a)}\\${n}`,r=c,c&&e.length>0)break}return n=Jt(n,!r,"\\",S),r?`${e}\\${n}`:`${e}${n}`||"."},normalize(t){G(t,"path");let e=t.length;if(e===0)return".";let n=0,r,i=!1,o=t.charCodeAt(0);if(e===1)return Br(o)?"\\":t;if(S(o))if(i=!0,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))&&(i=!0,n=3));let u=n0&&S(t.charCodeAt(e-1))&&(u+="\\"),!i&&r===void 0&&t.includes(":")){if(u.length>=2&&Te(u.charCodeAt(0))&&u.charCodeAt(1)===Ne)return`.\\${u}`;let a=t.indexOf(":");do if(a===e-1||S(t.charCodeAt(a+1)))return`.\\${u}`;while((a=t.indexOf(":",a+1))!==-1)}return r===void 0?i?`\\${u}`:u:i?`${r}\\${u}`:`${r}${u}`},isAbsolute(t){G(t,"path");let e=t.length;if(e===0)return!1;let n=t.charCodeAt(0);return S(n)||e>2&&Te(n)&&t.charCodeAt(1)===Ne&&S(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,n;for(let o=0;o0&&(e===void 0?e=n=u:e+=`\\${u}`)}if(e===void 0)return".";let r=!0,i=0;if(typeof n=="string"&&S(n.charCodeAt(0))){++i;let o=n.length;o>1&&S(n.charCodeAt(1))&&(++i,o>2&&(S(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i=2&&(e=`\\${e.slice(i)}`)}return C.win32.normalize(e)},relative(t,e){if(G(t,"from"),G(e,"to"),t===e)return"";let n=C.win32.resolve(t),r=C.win32.resolve(e);if(n===r||(t=n.toLowerCase(),e=r.toLowerCase(),t===e))return"";if(n.length!==t.length||r.length!==e.length){let B=n.split("\\"),H=r.split("\\");B[B.length-1]===""&&B.pop(),H[H.length-1]===""&&H.pop();let X=B.length,de=H.length,oe=Xoe?H.slice(K).join("\\"):X>oe?"..\\".repeat(X-1-K)+"..":"":"..\\".repeat(X-K)+H.slice(K).join("\\")}let i=0;for(;ii&&t.charCodeAt(o-1)===le;)o--;let u=o-i,a=0;for(;aa&&e.charCodeAt(l-1)===le;)l--;let c=l-a,d=ud){if(e.charCodeAt(a+y)===le)return r.slice(a+y+1);if(y===2)return r.slice(a+y)}u>d&&(t.charCodeAt(i+y)===le?f=y:y===2&&(f=3)),f===-1&&(f=0)}let D="";for(y=i+f+1;y<=o;++y)(y===o||t.charCodeAt(y)===le)&&(D+=D.length===0?"..":"\\..");return a+=f,D.length>0?`${D}${r.slice(a,l)}`:(r.charCodeAt(a)===le&&++a,r.slice(a,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;let e=C.win32.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===le){if(e.charCodeAt(1)===le){let n=e.charCodeAt(2);if(n!==Wa&&n!==Be)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Te(e.charCodeAt(0))&&e.charCodeAt(1)===Ne&&e.charCodeAt(2)===le)return`\\\\?\\${e}`;return e},dirname(t){G(t,"path");let e=t.length;if(e===0)return".";let n=-1,r=0,i=t.charCodeAt(0);if(e===1)return S(i)?t:".";if(S(i)){if(n=r=1,S(t.charCodeAt(1))){let a=2,l=a;for(;a2&&S(t.charCodeAt(2))?3:2,r=n);let o=-1,u=!0;for(let a=e-1;a>=r;--a)if(S(t.charCodeAt(a))){if(!u){o=a;break}}else u=!1;if(o===-1){if(n===-1)return".";o=n}return t.slice(0,o)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(t.length>=2&&Te(t.charCodeAt(0))&&t.charCodeAt(1)===Ne&&(n=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=n;--o){let l=t.charCodeAt(o);if(S(l)){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=n;--o)if(S(t.charCodeAt(o))){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=0,n=-1,r=0,i=-1,o=!0,u=0;t.length>=2&&t.charCodeAt(1)===Ne&&Te(t.charCodeAt(0))&&(e=r=2);for(let a=t.length-1;a>=e;--a){let l=t.charCodeAt(a);if(S(l)){if(!o){r=a+1;break}continue}i===-1&&(o=!1,i=a+1),l===Be?n===-1?n=a:u!==1&&(u=1):n!==-1&&(u=-1)}return n===-1||i===-1||u===0||u===1&&n===i-1&&n===r+1?"":t.slice(n,i)},format:Ws.bind(null,"\\"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.length,r=0,i=t.charCodeAt(0);if(n===1)return S(i)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(S(i)){if(r=1,S(t.charCodeAt(1))){let f=2,y=f;for(;f0&&(e.root=t.slice(0,r));let o=-1,u=r,a=-1,l=!0,c=t.length-1,d=0;for(;c>=r;--c){if(i=t.charCodeAt(c),S(i)){if(!l){u=c+1;break}continue}a===-1&&(l=!1,a=c+1),i===Be?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===u+1?e.base=e.name=t.slice(u,a):(e.name=t.slice(u,o),e.base=t.slice(u,a),e.ext=t.slice(o,a))),u>0&&u!==r?e.dir=t.slice(0,u-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null};var $a=(()=>{if(ce){let t=/\\/g;return()=>{let e=et.cwd().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>et.cwd()})();C.posix={resolve(...t){let e="",n=!1;for(let r=t.length-1;r>=0&&!n;r--){let i=t[r];G(i,`paths[${r}]`),i.length!==0&&(e=`${i}/${e}`,n=i.charCodeAt(0)===Y)}if(!n){let r=$a();e=`${r}/${e}`,n=r.charCodeAt(0)===Y}return e=Jt(e,!n,"/",Br),n?`/${e}`:e.length>0?e:"."},normalize(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Y,n=t.charCodeAt(t.length-1)===Y;return t=Jt(t,!e,"/",Br),t.length===0?e?"/":n?"./":".":(n&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return G(t,"path"),t.length>0&&t.charCodeAt(0)===Y},join(...t){if(t.length===0)return".";let e=[];for(let n=0;n0&&e.push(r)}return e.length===0?".":C.posix.normalize(e.join("/"))},relative(t,e){if(G(t,"from"),G(e,"to"),t===e||(t=C.posix.resolve(t),e=C.posix.resolve(e),t===e))return"";let n=1,r=t.length,i=r-n,o=1,u=e.length-o,a=ia){if(e.charCodeAt(o+c)===Y)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else i>a&&(t.charCodeAt(n+c)===Y?l=c:c===0&&(l=0));let d="";for(c=n+l+1;c<=r;++c)(c===r||t.charCodeAt(c)===Y)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(t){return t},dirname(t){if(G(t,"path"),t.length===0)return".";let e=t.charCodeAt(0)===Y,n=-1,r=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===Y){if(!r){n=i;break}}else r=!1;return n===-1?e?"/":".":e&&n===1?"//":t.slice(0,n)},basename(t,e){e!==void 0&&G(e,"suffix"),G(t,"path");let n=0,r=-1,i=!0,o;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let u=e.length-1,a=-1;for(o=t.length-1;o>=0;--o){let l=t.charCodeAt(o);if(l===Y){if(!i){n=o+1;break}}else a===-1&&(i=!1,a=o+1),u>=0&&(l===e.charCodeAt(u)?--u===-1&&(r=o):(u=-1,r=a))}return n===r?r=a:r===-1&&(r=t.length),t.slice(n,r)}for(o=t.length-1;o>=0;--o)if(t.charCodeAt(o)===Y){if(!i){n=o+1;break}}else r===-1&&(i=!1,r=o+1);return r===-1?"":t.slice(n,r)},extname(t){G(t,"path");let e=-1,n=0,r=-1,i=!0,o=0;for(let u=t.length-1;u>=0;--u){let a=t[u];if(a==="/"){if(!i){n=u+1;break}continue}r===-1&&(i=!1,r=u+1),a==="."?e===-1?e=u:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||r===-1||o===0||o===1&&e===r-1&&e===n+1?"":t.slice(e,r)},format:Ws.bind(null,"/"),parse(t){G(t,"path");let e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;let n=t.charCodeAt(0)===Y,r;n?(e.root="/",r=1):r=0;let i=-1,o=0,u=-1,a=!0,l=t.length-1,c=0;for(;l>=r;--l){let d=t.charCodeAt(l);if(d===Y){if(!a){o=l+1;break}continue}u===-1&&(a=!1,u=l+1),d===Be?i===-1?i=l:c!==1&&(c=1):i!==-1&&(c=-1)}if(u!==-1){let d=o===0&&n?1:o;i===-1||c===0||c===1&&i===u-1&&i===o+1?e.base=e.name=t.slice(d,u):(e.name=t.slice(d,i),e.base=t.slice(d,u),e.ext=t.slice(i,u))}return o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};C.posix.win32=C.win32.win32=C.win32;C.posix.posix=C.win32.posix=C.posix;C.normalize=ce?C.win32.normalize:C.posix.normalize;C.isAbsolute=ce?C.win32.isAbsolute:C.posix.isAbsolute;C.join=ce?C.win32.join:C.posix.join;C.resolve=ce?C.win32.resolve:C.posix.resolve;C.relative=ce?C.win32.relative:C.posix.relative;C.dirname=ce?C.win32.dirname:C.posix.dirname;C.basename=ce?C.win32.basename:C.posix.basename;C.extname=ce?C.win32.extname:C.posix.extname;C.format=ce?C.win32.format:C.posix.format;C.parse=ce?C.win32.parse:C.posix.parse;C.toNamespacedPath=ce?C.win32.toNamespacedPath:C.posix.toNamespacedPath;C.sep=ce?C.win32.sep:C.posix.sep;C.delimiter=ce?C.win32.delimiter:C.posix.delimiter});var js=U(me=>{"use strict";_();Object.defineProperty(me,"__esModule",{value:!0});me.WeakCachedFunction=me.CachedFunction=me.LRUCachedFunction=me.Cache=void 0;me.identity=Zt;var Ba=$r(),Hr=class{static{s(this,"Cache")}constructor(e){this.task=e,this.result=null}get(){if(this.result)return this.result;let e=new Ba.CancellationTokenSource,n=this.task(e.token);return this.result={promise:n,dispose:s(()=>{this.result=null,e.cancel(),e.dispose()},"dispose")},this.result}};me.Cache=Hr;function Zt(t){return t}s(Zt,"identity");var Gr=class{static{s(this,"LRUCachedFunction")}constructor(e,n){this.lastCache=void 0,this.lastArgKey=void 0,typeof e=="function"?(this._fn=e,this._computeKey=Zt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);return this.lastArgKey!==n&&(this.lastArgKey=n,this.lastCache=this._fn(e)),this.lastCache}};me.LRUCachedFunction=Gr;var Vr=class{static{s(this,"CachedFunction")}get cachedValues(){return this._map}constructor(e,n){this._map=new Map,this._map2=new Map,typeof e=="function"?(this._fn=e,this._computeKey=Zt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map2.has(n))return this._map2.get(n);let r=this._fn(e);return this._map.set(e,r),this._map2.set(n,r),r}};me.CachedFunction=Vr;var Kr=class{static{s(this,"WeakCachedFunction")}constructor(e,n){this._map=new WeakMap,typeof e=="function"?(this._fn=e,this._computeKey=Zt):(this._fn=n,this._computeKey=e.getCacheKey)}get(e){let n=this._computeKey(e);if(this._map.has(n))return this._map.get(n);let r=this._fn(e);return this._map.set(n,r),r}};me.WeakCachedFunction=Kr});var tn=U(en=>{"use strict";_();Object.defineProperty(en,"__esModule",{value:!0});en.Lazy=void 0;var Se;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Running=1]="Running",t[t.Completed=2]="Completed"})(Se||(Se={}));var Qr=class{static{s(this,"Lazy")}constructor(e){this.executor=e,this._state=Se.Uninitialized}get hasValue(){return this._state===Se.Completed}get value(){if(this._state===Se.Uninitialized){this._state=Se.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=Se.Completed}}else if(this._state===Se.Running)throw new Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};en.Lazy=Qr});var rn=U(g=>{"use strict";_();Object.defineProperty(g,"__esModule",{value:!0});g.Ellipsis=g.InvisibleCharacters=g.AmbiguousCharacters=g.noBreakWhitespace=g.UTF8_BOM_CHARACTER=g.UNUSUAL_LINE_TERMINATORS=g.GraphemeIterator=g.CodePointIterator=void 0;g.isFalsyOrWhitespace=Ga;g.format=Ka;g.format2=Ya;g.htmlAttributeEncodeValue=Xa;g.escape=Ja;g.escapeRegExpCharacters=Bs;g.count=Za;g.truncate=el;g.truncateMiddle=tl;g.trim=nl;g.ltrim=Hs;g.rtrim=Gs;g.convertSimple2RegExpPattern=rl;g.createRegExp=il;g.regExpLeadsToEndlessLoop=sl;g.joinStrings=ol;g.splitLines=ul;g.splitLinesIncludeSeparators=al;g.indexOfPattern=ll;g.firstNonWhitespaceIndex=Vs;g.getLeadingWhitespace=cl;g.lastNonWhitespaceIndex=fl;g.getIndentationLength=hl;g.replaceAsync=dl;g.compare=ml;g.compareSubstring=Ks;g.compareIgnoreCase=pl;g.compareSubstringIgnoreCase=yt;g.isAsciiDigit=gl;g.isLowerAsciiLetter=Xr;g.isUpperAsciiLetter=_l;g.equalsIgnoreCase=Qs;g.equals=bl;g.startsWithIgnoreCase=Cl;g.endsWithIgnoreCase=yl;g.commonPrefixLength=vl;g.commonSuffixLength=wl;g.isHighSurrogate=ei;g.isLowSurrogate=nn;g.computeCodePoint=ti;g.getNextCodePoint=Ys;g.nextCharLength=Xs;g.prevCharLength=Js;g.getCharContainingOffset=Ll;g.charCount=Nl;g.containsRTL=Al;g.isBasicASCII=xl;g.containsUnusualLineTerminators=Pl;g.isFullWidthCharacter=Il;g.isEmojiImprecise=Zs;g.lcut=Sl;g.rcut=Rl;g.forAnsiStringParts=Fl;g.removeAnsiEscapeCodes=t1;g.removeAnsiEscapeCodesFromPrompt=ql;g.startsWithUTF8BOM=n1;g.stripUTF8BOM=Wl;g.fuzzyContains=jl;g.containsUppercaseCharacter=zl;g.uppercaseFirstLetter=$l;g.getNLines=Bl;g.singleLetterHash=Hl;g.getGraphemeBreakType=Gl;g.getLeftDeleteOffset=Kl;g.multibyteAwareBtoa=Jl;var Ha=js(),zs=tn();function Ga(t){return!t||typeof t!="string"?!0:t.trim().length===0}s(Ga,"isFalsyOrWhitespace");var Va=/{(\d+)}/g;function Ka(t,...e){return e.length===0?t:t.replace(Va,function(n,r){let i=parseInt(r,10);return isNaN(i)||i<0||i>=e.length?n:e[i]})}s(Ka,"format");var Qa=/{([^}]+)}/g;function Ya(t,e){return Object.keys(e).length===0?t:t.replace(Qa,(n,r)=>e[r]??n)}s(Ya,"format2");function Xa(t){return t.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}return e})}s(Xa,"htmlAttributeEncodeValue");function Ja(t){return t.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}s(Ja,"escape");function Bs(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}s(Bs,"escapeRegExpCharacters");function Za(t,e){let n=0,r=t.indexOf(e);for(;r!==-1;)n++,r=t.indexOf(e,r+e.length);return n}s(Za,"count");function el(t,e,n=g.Ellipsis){return t.length<=e?t:`${t.substr(0,e)}${n}`}s(el,"truncate");function tl(t,e,n=g.Ellipsis){if(t.length<=e)return t;let r=Math.ceil(e/2)-n.length/2,i=Math.floor(e/2)-n.length/2;return`${t.substr(0,r)}${n}${t.substr(t.length-i)}`}s(tl,"truncateMiddle");function nl(t,e=" "){let n=Hs(t,e);return Gs(n,e)}s(nl,"trim");function Hs(t,e){if(!t||!e)return t;let n=e.length,r=0;if(n===1){let i=e.charCodeAt(0);for(;r0&&t.charCodeAt(o-1)===u;)o--;return t.substring(0,o)}let i=r;for(;i>0&&t.endsWith(e,i);)i-=n;return t.substring(0,i)}s(Gs,"rtrim");function rl(t){return t.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}s(rl,"convertSimple2RegExpPattern");function il(t,e,n={}){if(!t)throw new Error("Cannot create regex from empty string");e||(t=Bs(t)),n.wholeWord&&(/\B/.test(t.charAt(0))||(t="\\b"+t),/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"));let r="";return n.global&&(r+="g"),n.matchCase||(r+="i"),n.multiline&&(r+="m"),n.unicode&&(r+="u"),new RegExp(t,r)}s(il,"createRegExp");function sl(t){return t.source==="^"||t.source==="^$"||t.source==="$"||t.source==="^\\s*$"?!1:!!(t.exec("")&&t.lastIndex===0)}s(sl,"regExpLeadsToEndlessLoop");function ol(t,e){return t.filter(n=>n!=null&&n!==!1).join(e)}s(ol,"joinStrings");function ul(t){return t.split(/\r\n|\r|\n/)}s(ul,"splitLines");function al(t){let e=[],n=t.split(/(\r\n|\r|\n)/);for(let r=0;r=0;n--){let r=t.charCodeAt(n);if(r!==32&&r!==9)return n}return-1}s(fl,"lastNonWhitespaceIndex");function hl(t){let e=Vs(t);return e===-1?t.length:e}s(hl,"getIndentationLength");function dl(t,e,n){let r=[],i=0;for(let o of t.matchAll(e)){if(r.push(t.slice(i,o.index)),o.index===void 0)throw new Error("match.index should be defined");i=o.index+o[0].length,r.push(n(o[0],...o.slice(1),o.index,t,o.groups))}return r.push(t.slice(i)),Promise.all(r).then(o=>o.join(""))}s(dl,"replaceAsync");function ml(t,e){return te?1:0}s(ml,"compare");function Ks(t,e,n=0,r=t.length,i=0,o=e.length){for(;nc)return 1}let u=r-n,a=o-i;return ua?1:0}s(Ks,"compareSubstring");function pl(t,e){return yt(t,e,0,t.length,0,e.length)}s(pl,"compareIgnoreCase");function yt(t,e,n=0,r=t.length,i=0,o=e.length){for(;n=128||c>=128)return Ks(t.toLowerCase(),e.toLowerCase(),n,r,i,o);Xr(l)&&(l-=32),Xr(c)&&(c-=32);let d=l-c;if(d!==0)return d}let u=r-n,a=o-i;return ua?1:0}s(yt,"compareSubstringIgnoreCase");function gl(t){return t>=48&&t<=57}s(gl,"isAsciiDigit");function Xr(t){return t>=97&&t<=122}s(Xr,"isLowerAsciiLetter");function _l(t){return t>=65&&t<=90}s(_l,"isUpperAsciiLetter");function Qs(t,e){return t.length===e.length&&yt(t,e)===0}s(Qs,"equalsIgnoreCase");function bl(t,e,n){return t===e||!!n&&t!==void 0&&e!==void 0&&Qs(t,e)}s(bl,"equals");function Cl(t,e){let n=e.length;return n<=t.length&&yt(t,e,0,n)===0}s(Cl,"startsWithIgnoreCase");function yl(t,e){let n=t.length,r=n-e.length;return r>=0&&yt(t,e,r,n)===0}s(yl,"endsWithIgnoreCase");function vl(t,e){let n=Math.min(t.length,e.length),r;for(r=0;r1){let r=t.charCodeAt(e-2);if(ei(r))return ti(r,n)}return n}s(El,"getPrevCodePoint");var tt=class{static{s(this,"CodePointIterator")}get offset(){return this._offset}constructor(e,n=0){this._str=e,this._len=e.length,this._offset=n}setOffset(e){this._offset=e}prevCodePoint(){let e=El(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=Ys(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}};g.CodePointIterator=tt;var nt=class{static{s(this,"GraphemeIterator")}get offset(){return this._iterator.offset}constructor(e,n=0){this._iterator=new tt(e,n)}nextGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.nextCodePoint());for(;!n.eol();){let o=n.offset,u=e.getGraphemeBreakType(n.nextCodePoint());if($s(i,u)){n.setOffset(o);break}i=u}return n.offset-r}prevGraphemeLength(){let e=Ct.getInstance(),n=this._iterator,r=n.offset,i=e.getGraphemeBreakType(n.prevCodePoint());for(;n.offset>0;){let o=n.offset,u=e.getGraphemeBreakType(n.prevCodePoint());if($s(u,i)){n.setOffset(o);break}i=u}return r-n.offset}eol(){return this._iterator.eol()}};g.GraphemeIterator=nt;function Xs(t,e){return new nt(t,e).nextGraphemeLength()}s(Xs,"nextCharLength");function Js(t,e){return new nt(t,e).prevGraphemeLength()}s(Js,"prevCharLength");function Ll(t,e){e>0&&nn(t.charCodeAt(e))&&e--;let n=e+Xs(t,e);return[n-Js(t,n),n]}s(Ll,"getCharContainingOffset");function Nl(t){let e=new nt(t),n=0;for(;!e.eol();)n++,e.nextGraphemeLength();return n}s(Nl,"charCount");var Yr;function Tl(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}s(Tl,"makeContainsRtl");function Al(t){return Yr||(Yr=Tl()),Yr.test(t)}s(Al,"containsRTL");var kl=/^[\t\n\r\x20-\x7E]*$/;function xl(t){return kl.test(t)}s(xl,"isBasicASCII");g.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function Pl(t){return g.UNUSUAL_LINE_TERMINATORS.test(t)}s(Pl,"containsUnusualLineTerminators");function Il(t){return t>=11904&&t<=55215||t>=63744&&t<=64255||t>=65281&&t<=65374||t>=65504&&t<=65510}s(Il,"isFullWidthCharacter");function Zs(t){return t>=127462&&t<=127487||t===8986||t===8987||t===9200||t===9203||t>=9728&&t<=10175||t===11088||t===11093||t>=127744&&t<=128591||t>=128640&&t<=128764||t>=128992&&t<=129008||t>=129280&&t<=129535||t>=129648&&t<=129782}s(Zs,"isEmojiImprecise");function Sl(t,e,n=""){let r=t.trimStart();if(r.lengthe){u=!0;break}o=i.lastIndex,i.lastIndex+=1}if(!u)return r;if(o===0)return n;let a=r.substring(0,o).trimEnd();return a.length!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,Dl=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,Ml=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,e1=new RegExp("(?:"+[Ol.source,Dl.source,Ml.source].join("|")+")","g");function*Fl(t){let e=0;for(let n of t.matchAll(e1))e!==n.index&&(yield{isCode:!1,str:t.substring(e,n.index)}),yield{isCode:!0,str:n[0]},e=n.index+n[0].length;e!==t.length&&(yield{isCode:!1,str:t.substring(e)})}s(Fl,"forAnsiStringParts");function t1(t){return t&&(t=t.replace(e1,"")),t}s(t1,"removeAnsiEscapeCodes");var Ul=/\\\[.*?\\\]/g;function ql(t){return t1(t).replace(Ul,"")}s(ql,"removeAnsiEscapeCodesFromPrompt");g.UTF8_BOM_CHARACTER="\uFEFF";function n1(t){return!!(t&&t.length>0&&t.charCodeAt(0)===65279)}s(n1,"startsWithUTF8BOM");function Wl(t){return n1(t)?t.substr(1):t}s(Wl,"stripUTF8BOM");function jl(t,e){if(!t||!e||t.length0&&n>=0);return n===-1?t:(t[n-1]==="\r"&&n--,t.substr(0,n))}s(Bl,"getNLines");function Hl(t){return t=t%52,t<26?String.fromCharCode(97+t):String.fromCharCode(65+t-26)}s(Hl,"singleLetterHash");function Gl(t){return Ct.getInstance().getGraphemeBreakType(t)}s(Gl,"getGraphemeBreakType");function $s(t,e){return t===0?e!==5&&e!==7:t===2&&e===3?!1:t===4||t===2||t===3||e===4||e===2||e===3?!0:!(t===8&&(e===8||e===9||e===11||e===12)||(t===11||t===9)&&(e===9||e===10)||(t===12||t===10)&&e===10||e===5||e===13||e===7||t===1||t===13&&e===14||t===6&&e===6)}s($s,"breakBetweenGraphemeBreakType");var Ct=class t{static{s(this,"GraphemeBreakTree")}static{this._INSTANCE=null}static getInstance(){return t._INSTANCE||(t._INSTANCE=new t),t._INSTANCE}constructor(){this._data=Vl()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;let n=this._data,r=n.length/3,i=1;for(;i<=r;)if(en[3*i+1])i=2*i+1;else return n[3*i+2];return 0}};function Vl(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}s(Vl,"getGraphemeBreakRawData");function Kl(t,e){if(t===0)return 0;let n=Ql(t,e);if(n!==void 0)return n;let r=new tt(e,t);return r.prevCodePoint(),r.offset}s(Kl,"getLeftDeleteOffset");function Ql(t,e){let n=new tt(e,t),r=n.prevCodePoint();for(;Yl(r)||r===65039||r===8419;){if(n.offset===0)return;r=n.prevCodePoint()}if(!Zs(r))return;let i=n.offset;return i>0&&n.prevCodePoint()===8205&&(i=n.offset),i}s(Ql,"getOffsetBeforeLastEmojiComponent");function Yl(t){return 127995<=t&&t<=127999}s(Yl,"isEmojiModifier");g.noBreakWhitespace="\xA0";var Jr=class t{static{s(this,"AmbiguousCharacters")}static{this.ambiguousCharacterData=new zs.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new Ha.LRUCachedFunction(e=>{let n=e.split(",");function r(f){let y=new Map;for(let D=0;D!f.startsWith("_")&&Object.hasOwn(u,f));a.length===0&&(a=["_default"]);let l;for(let f of a){let y=r(u[f]);l=o(l,y)}let c=r(u._common),d=i(c,l);return new t(d)})}static getInstance(e){return t.cache.get(Array.from(e).join(","))}static{this._locales=new zs.Lazy(()=>Object.keys(t.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return t._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let n=0;n{"use strict";_();Object.defineProperty(V,"__esModule",{value:!0});V.isPathSeparator=Ae;V.toSlashes=r1;V.toPosixPath=e2;V.getRoot=t2;V.isUNC=n2;V.isValidBasename=o2;V.isEqual=u2;V.isEqualOrParent=a2;V.isWindowsDriveLetter=ni;V.sanitizeFilePath=l2;V.removeTrailingPathSeparator=i1;V.isRootOrDriveLetter=c2;V.hasDriveLetter=ri;V.getDriveLetter=f2;V.indexOfPath=h2;V.parseLineAndColumnAware=d2;V.randomPath=g2;var fe=bt(),Re=ze(),sn=rn(),Zl=fr();function Ae(t){return t===47||t===92}s(Ae,"isPathSeparator");function r1(t){return t.replace(/[\\/]/g,fe.posix.sep)}s(r1,"toSlashes");function e2(t){return t.indexOf("/")===-1&&(t=r1(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}s(e2,"toPosixPath");function t2(t,e=fe.posix.sep){if(!t)return"";let n=t.length,r=t.charCodeAt(0);if(Ae(r)){if(Ae(t.charCodeAt(1))&&!Ae(t.charCodeAt(2))){let o=3,u=o;for(;o\|]/g,i2=/[/]/g,s2=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function o2(t,e=Re.isWindows){let n=e?r2:i2;return!(!t||t.length===0||/^\s+$/.test(t)||(n.lastIndex=0,n.test(t))||e&&s2.test(t)||t==="."||t===".."||e&&t[t.length-1]==="."||e&&t.length!==t.trim().length||t.length>255)}s(o2,"isValidBasename");function u2(t,e,n){let r=t===e;return!n||r?r:!t||!e?!1:(0,sn.equalsIgnoreCase)(t,e)}s(u2,"isEqual");function a2(t,e,n,r=fe.sep){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(n){if(!(0,sn.startsWithIgnoreCase)(t,e))return!1;if(e.length===t.length)return!0;let o=e.length;return e.charAt(e.length-1)===r&&o--,t.charAt(o)===r}return e.charAt(e.length-1)!==r&&(e+=r),t.indexOf(e)===0}s(a2,"isEqualOrParent");function ni(t){return t>=65&&t<=90||t>=97&&t<=122}s(ni,"isWindowsDriveLetter");function l2(t,e){return Re.isWindows&&t.endsWith(":")&&(t+=fe.sep),(0,fe.isAbsolute)(t)||(t=(0,fe.join)(e,t)),t=(0,fe.normalize)(t),i1(t)}s(l2,"sanitizeFilePath");function i1(t){return Re.isWindows?(t=(0,sn.rtrim)(t,fe.sep),t.endsWith(":")&&(t+=fe.sep)):(t=(0,sn.rtrim)(t,fe.sep),t||(t=fe.sep)),t}s(i1,"removeTrailingPathSeparator");function c2(t){let e=(0,fe.normalize)(t);return Re.isWindows?t.length>3?!1:ri(e)&&(t.length===2||e.charCodeAt(2)===92):e===fe.posix.sep}s(c2,"isRootOrDriveLetter");function ri(t,e=Re.isWindows){return e?ni(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}s(ri,"hasDriveLetter");function f2(t,e=Re.isWindows){return ri(t,e)?t[0]:void 0}s(f2,"getDriveLetter");function h2(t,e,n){return e.length>t.length?-1:t===e?0:(n&&(t=t.toLowerCase(),e=e.toLowerCase()),t.indexOf(e))}s(h2,"indexOfPath");function d2(t){let e=t.split(":"),n,r,i;for(let o of e){let u=Number(o);(0,Zl.isNumber)(u)?r===void 0?r=u:i===void 0&&(i=u):n=n?[n,o].join(":"):o}if(!n)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:n,line:r!==void 0?r:void 0,column:i!==void 0?i:r!==void 0?1:void 0}}s(d2,"parseLineAndColumnAware");var m2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",p2="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function g2(t,e,n=8){let r="";for(let o=0;o{"use strict";_();var _2=he&&he.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),b2=he&&he.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C2=he&&he.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;i0?` Found '${n[0][0]}' at index ${n[0].index} (${n.length} total)`:"";throw new Error(`[UriError]: Scheme contains illegal characters.${r} (len:${t.scheme.length})`)}if(t.path){if(t.authority){if(!v2.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(w2.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}s(E2,"_validateUri");function L2(t,e){return!t&&!e?"file":t}s(L2,"_schemeFix");function N2(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==pe&&(e=pe+e):e=pe;break}return e}s(N2,"_referenceResolution");var W="",pe="/",T2=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,an=class t{static{s(this,"URI")}static isUri(e){return e instanceof t?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,n,r,i,o,u=!1){typeof e=="object"?(this.scheme=e.scheme||W,this.authority=e.authority||W,this.path=e.path||W,this.query=e.query||W,this.fragment=e.fragment||W):(this.scheme=L2(e,u),this.authority=n||W,this.path=N2(this.scheme,r||W),this.query=i||W,this.fragment=o||W,E2(this,u))}get fsPath(){return ln(this,!1)}with(e){if(!e)return this;let{scheme:n,authority:r,path:i,query:o,fragment:u}=e;return n===void 0?n=this.scheme:n===null&&(n=W),r===void 0?r=this.authority:r===null&&(r=W),i===void 0?i=this.path:i===null&&(i=W),o===void 0?o=this.query:o===null&&(o=W),u===void 0?u=this.fragment:u===null&&(u=W),n===this.scheme&&r===this.authority&&i===this.path&&o===this.query&&u===this.fragment?this:new Oe(n,r,i,o,u)}static parse(e,n=!1){let r=T2.exec(e);return r?new Oe(r[2]||W,on(r[4]||W),on(r[5]||W),on(r[7]||W),on(r[9]||W),n):new Oe(W,W,W,W,W)}static file(e){let n=W;if(un.isWindows&&(e=e.replace(/\\/g,pe)),e[0]===pe&&e[1]===pe){let r=e.indexOf(pe,2);r===-1?(n=e.substring(2),e=pe):(n=e.substring(2,r),e=e.substring(r)||pe)}return new Oe("file",n,e,W,W)}static from(e,n){return new Oe(e.scheme,e.authority,e.path,e.query,e.fragment,n)}static joinPath(e,...n){if(!e.path)throw new Error(`[UriError]: cannot call joinPath on URI without path: ${e.toString()}`);let r;return un.isWindows&&e.scheme==="file"?r=t.file(o1.win32.join(ln(e,!0),...n)).path:r=o1.posix.join(e.path,...n),e.with({path:r})}toString(e=!1){return ii(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof t)return e;{let n=new Oe(e);return n._formatted=e.external??null,n._fsPath=e._sep===l1?e.fsPath??null:null,n}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}};he.URI=an;function A2(t){return!t||typeof t!="object"?!1:typeof t.scheme=="string"&&(typeof t.authority=="string"||typeof t.authority>"u")&&(typeof t.path=="string"||typeof t.path>"u")&&(typeof t.query=="string"||typeof t.query>"u")&&(typeof t.fragment=="string"||typeof t.fragment>"u")}s(A2,"isUriComponents");var l1=un.isWindows?1:void 0,Oe=class extends an{static{s(this,"Uri")}constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=ln(this,!1)),this._fsPath}toString(e=!1){return e?ii(this,!0):(this._formatted||(this._formatted=ii(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=l1),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}},c1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function u1(t,e,n){let r,i=-1;for(let o=0;o=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45||u===46||u===95||u===126||e&&u===47||n&&u===91||n&&u===93||n&&u===58)i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r!==void 0&&(r+=t.charAt(o));else{r===void 0&&(r=t.substr(0,o));let a=c1[u];a!==void 0?(i!==-1&&(r+=encodeURIComponent(t.substring(i,o)),i=-1),r+=a):i===-1&&(i=o)}}return i!==-1&&(r+=encodeURIComponent(t.substring(i))),r!==void 0?r:t}s(u1,"encodeURIComponentFast");function k2(t){let e;for(let n=0;n1&&t.scheme==="file"?n=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?n=t.path.substr(1):n=t.path[1].toLowerCase()+t.path.substr(2):n=t.path,un.isWindows&&(n=n.replace(/\//g,"\\")),n}s(ln,"uriToFsPath");function ii(t,e){let n=e?k2:u1,r="",{scheme:i,authority:o,path:u,query:a,fragment:l}=t;if(i&&(r+=i,r+=":"),(o||i==="file")&&(r+=pe,r+=pe),o){let c=o.indexOf("@");if(c!==-1){let d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?r+=n(d,!1,!1):(r+=n(d.substr(0,c),!1,!1),r+=":",r+=n(d.substr(c+1),!1,!0)),r+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?r+=n(o,!1,!0):(r+=n(o.substr(0,c),!1,!0),r+=o.substr(c))}if(u){if(u.length>=3&&u.charCodeAt(0)===47&&u.charCodeAt(2)===58){let c=u.charCodeAt(1);c>=65&&c<=90&&(u=`/${String.fromCharCode(c+32)}:${u.substr(3)}`)}else if(u.length>=2&&u.charCodeAt(1)===58){let c=u.charCodeAt(0);c>=65&&c<=90&&(u=`${String.fromCharCode(c+32)}:${u.substr(2)}`)}r+=n(u,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),l&&(r+="#",r+=e?l:u1(l,!1,!1)),r}s(ii,"_asFormatted");function f1(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+f1(t.substr(3)):t}}s(f1,"decodeURIComponentGraceful");var a1=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function on(t){return t.match(a1)?t.replace(a1,e=>f1(e)):t}s(on,"percentDecode")});var g1=U(O=>{"use strict";_();var x2=O&&O.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),P2=O&&O.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ci=O&&O.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;im1(t,n))}s(S2,"matchesSomeScheme");O.connectionTokenCookieName="vscode-tkn";O.connectionTokenQueryName="tkn";var ai=class{static{s(this,"RemoteAuthoritiesImpl")}constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,n){this._serverRootPath=ui.posix.join(n??"/",p1(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return ui.posix.join(this._serverRootPath,_e.vscodeRemoteResource)}set(e,n,r){this._hosts[e]=n,this._ports[e]=r}setConnectionToken(e,n){this._connectionTokens[e]=n}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return I2.onUnexpectedExternalError(a),e}let n=e.authority,r=this._hosts[n];r&&r.indexOf(":")!==-1&&r.indexOf("[")===-1&&(r=`[${r}]`);let i=this._ports[n],o=this._connectionTokens[n],u=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(u+=`&${O.connectionTokenQueryName}=${encodeURIComponent(o)}`),He.URI.from({scheme:oi.isWeb?this._preferredWebSchema:_e.vscodeRemoteResource,authority:`${r}:${i}`,path:this._remoteResourcesPath,query:u})}};O.RemoteAuthorities=new ai;function p1(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}s(p1,"getServerProductSegment");O.builtinExtensionsPath="vs/../../extensions";O.nodeModulesPath="vs/../../node_modules";O.nodeModulesAsarPath="vs/../../node_modules.asar";O.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";O.VSCODE_AUTHORITY="vscode-app";var li=class t{static{s(this,"FileAccessImpl")}static{this.FALLBACK_AUTHORITY=O.VSCODE_AUTHORITY}asBrowserUri(e){let n=this.toUri(e);return this.uriToBrowserUri(n)}uriToBrowserUri(e){return e.scheme===_e.vscodeRemote?O.RemoteAuthorities.rewrite(e):e.scheme===_e.file&&(oi.isNative||oi.webWorkerOrigin===`${_e.vscodeFileResource}://${t.FALLBACK_AUTHORITY}`)?e.with({scheme:_e.vscodeFileResource,authority:e.authority||t.FALLBACK_AUTHORITY,query:null,fragment:null}):e}asFileUri(e){let n=this.toUri(e);return this.uriToFileUri(n)}uriToFileUri(e){return e.scheme===_e.vscodeFileResource?e.with({scheme:_e.file,authority:e.authority!==t.FALLBACK_AUTHORITY?e.authority:null,query:null,fragment:null}):e}toUri(e){if(He.URI.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let n=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(n))return He.URI.joinPath(He.URI.parse(n,!0),e);let r=ui.join(n,e);return He.URI.file(r)}throw new Error("Cannot determine URI for module id!")}};O.FileAccess=new li;O.CacheControlheaders=Object.freeze({"Cache-Control":"no-cache, no-store"});O.DocumentPolicyheaders=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"});var d1;(function(t){let e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));let n="vscode-coi";function r(o){let u;typeof o=="string"?u=new URL(o).searchParams:o instanceof URL?u=o.searchParams:He.URI.isUri(o)&&(u=new URL(o.toString(!0)).searchParams);let a=u?.get(n);if(a)return e.get(a)}s(r,"getHeadersFromQuery"),t.getHeadersFromQuery=r;function i(o,u,a){if(!globalThis.crossOriginIsolated)return;let l=u&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(n,l):o[n]=l}s(i,"addSearchParam"),t.addSearchParam=i})(d1||(O.COI=d1={}))});var v1=U(p=>{"use strict";_();var R2=p&&p.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:s(function(){return e[n]},"get")}),Object.defineProperty(t,r,i)}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),O2=p&&p.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C1=p&&p.__importStar||(function(){var t=s(function(e){return t=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var r=t(e),i=0;irt.getRoot(r).length&&r[r.length-1]===n}else{let r=e.path;return r.length>1&&r.charCodeAt(r.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,n=ie.sep){return(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,n=ie.sep){let r=!1;if(e.scheme===De.Schemas.file){let i=be(e);r=i!==void 0&&i.length===rt.getRoot(i).length&&i[i.length-1]===n}else{n="/";let i=e.path;r=i.length===1&&i.charCodeAt(i.length-1)===47}return!r&&!(0,p.hasTrailingPathSeparator)(e,n)?e.with({path:e.path+"/"}):e}};p.ExtUri=it;p.extUri=new it(()=>!1);p.extUriBiasedIgnorePathCase=new it(t=>t.scheme===De.Schemas.file?!y1.isLinux:!0);p.extUriIgnorePathCase=new it(t=>!0);p.isEqual=p.extUri.isEqual.bind(p.extUri);p.isEqualOrParent=p.extUri.isEqualOrParent.bind(p.extUri);p.getComparisonKey=p.extUri.getComparisonKey.bind(p.extUri);p.basenameOrAuthority=p.extUri.basenameOrAuthority.bind(p.extUri);p.basename=p.extUri.basename.bind(p.extUri);p.extname=p.extUri.extname.bind(p.extUri);p.dirname=p.extUri.dirname.bind(p.extUri);p.joinPath=p.extUri.joinPath.bind(p.extUri);p.normalizePath=p.extUri.normalizePath.bind(p.extUri);p.relativePath=p.extUri.relativePath.bind(p.extUri);p.resolvePath=p.extUri.resolvePath.bind(p.extUri);p.isAbsolutePath=p.extUri.isAbsolutePath.bind(p.extUri);p.isEqualAuthority=p.extUri.isEqualAuthority.bind(p.extUri);p.hasTrailingPathSeparator=p.extUri.hasTrailingPathSeparator.bind(p.extUri);p.removeTrailingPathSeparator=p.extUri.removeTrailingPathSeparator.bind(p.extUri);p.addTrailingPathSeparator=p.extUri.addTrailingPathSeparator.bind(p.extUri);function D2(t,e){let n=[];for(let r=0;ru===r?!1:(0,p.isEqualOrParent)(i,e(o)))||n.push(t[r])}return n}s(D2,"distinctParents");var b1;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(n){let r=new Map;n.path.substring(n.path.indexOf(";")+1,n.path.lastIndexOf(";")).split(";").forEach(u=>{let[a,l]=u.split(":");a&&l&&r.set(a,l)});let o=n.path.substring(0,n.path.indexOf(";"));return o&&r.set(t.META_DATA_MIME,o),r}s(e,"parseMetaData"),t.parseMetaData=e})(b1||(p.DataUri=b1={}));function M2(t,e,n){if(e){let r=t.path;return r&&r[0]!==ie.posix.sep&&(r=ie.posix.sep+r),t.with({scheme:n,authority:e,path:r})}return t.with({scheme:n})}s(M2,"toLocalResource")});var w1=U(cn=>{"use strict";_();Object.defineProperty(cn,"__esModule",{value:!0});cn.MicrotaskDelay=void 0;cn.MicrotaskDelay=Symbol("MicrotaskDelay")});var P1=U(h=>{"use strict";_();Object.defineProperty(h,"__esModule",{value:!0});h.AsyncReader=h.AsyncReaderEndOfStream=h.CancelableAsyncIterableProducer=h.AsyncIterableProducer=h.AsyncIterableSource=h.AsyncIterableObject=h.LazyStatefulPromise=h.StatefulPromise=h.Promises=h.DeferredPromise=h.IntervalCounter=h.TaskSequentializer=h.GlobalIdleValue=h.AbstractIdleValue=h._runWhenIdle=h.runWhenGlobalIdle=h.ThrottledWorker=h.RunOnceWorker=h.ProcessTimeRunOnceScheduler=h.RunOnceScheduler=h.IntervalTimer=h.TimeoutTimer=h.TaskQueue=h.ResourceQueue=h.LimitedQueue=h.Queue=h.Limiter=h.AutoOpenBarrier=h.Barrier=h.ThrottledDelayer=h.Delayer=h.SequencerByKey=h.Sequencer=h.Throttler=void 0;h.isThenable=N1;h.createCancelablePromise=T1;h.raceCancellation=A1;h.raceCancellationError=W2;h.rejectIfNotCanceled=j2;h.notCancellablePromise=z2;h.raceCancellablePromises=$2;h.raceTimeout=k1;h.asPromise=B2;h.promiseWithResolvers=x1;h.timeout=Pi;h.disposableTimeout=V2;h.sequence=K2;h.first=Q2;h.firstParallel=Y2;h.installFakeRunWhenIdle=X2;h.retry=J2;h.createCancelableAsyncIterableProducer=Z2;h.cancellableIterable=ec;h.createTimeout=tc;var xi=$r(),se=Ue(),wt=jr(),Me=Ut(),E1=v1(),F2=ze(),U2=w1(),q2=tn();function N1(t){return!!t&&typeof t.then=="function"}s(N1,"isThenable");function T1(t){let e=new xi.CancellationTokenSource,n=t(e.token),r=!1,i=new Promise((o,u)=>{let a=e.token.onCancellationRequested(()=>{r=!0,a.dispose(),u(new se.CancellationError)});Promise.resolve(n).then(l=>{a.dispose(),e.dispose(),r?(0,Me.isDisposable)(l)&&l.dispose():o(l)},l=>{a.dispose(),e.dispose(),u(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(o,u){return i.then(o,u)}catch(o){return this.then(void 0,o)}finally(o){return i.finally(o)}}}s(T1,"createCancelablePromise");function A1(t,e,n){return new Promise((r,i)=>{let o=e.onCancellationRequested(()=>{o.dispose(),r(n)});t.then(r,i).finally(()=>o.dispose())})}s(A1,"raceCancellation");function W2(t,e){return new Promise((n,r)=>{let i=e.onCancellationRequested(()=>{i.dispose(),r(new se.CancellationError)});t.then(n,r).finally(()=>i.dispose())})}s(W2,"raceCancellationError");function j2(t){if(!(0,se.isCancellationError)(t))return Promise.reject(t)}s(j2,"rejectIfNotCanceled");function z2(t){return new Promise((e,n)=>{t.then(e,n)})}s(z2,"notCancellablePromise");function $2(t){let e=-1,n=t.map((i,o)=>i.then(u=>(e=o,u))),r=Promise.race(n);return r.cancel=()=>{t.forEach((i,o)=>{o!==e&&i.cancel&&i.cancel()})},r.finally(()=>{r.cancel()}),r}s($2,"raceCancellablePromises");function k1(t,e,n){let r,i=setTimeout(()=>{r?.(void 0),n?.()},e);return Promise.race([t.finally(()=>clearTimeout(i)),new Promise(o=>r=o)])}s(k1,"raceTimeout");function B2(t){return new Promise((e,n)=>{let r=t();N1(r)?r.then(e,n):e(r)})}s(B2,"asPromise");function x1(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}s(x1,"promiseWithResolvers");var fn=class{static{s(this,"Throttler")}constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new xi.CancellationTokenSource}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let n=s(()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let r=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,r},"onComplete");this.queuedPromise=new Promise(r=>{this.activePromise.then(n,n).then(r)})}return new Promise((n,r)=>{this.queuedPromise.then(n,r)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((n,r)=>{this.activePromise.then(i=>{this.activePromise=null,n(i)},i=>{this.activePromise=null,r(i)})})}dispose(){this.cancellationTokenSource.cancel()}};h.Throttler=fn;var fi=class{static{s(this,"Sequencer")}constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}};h.Sequencer=fi;var hi=class{static{s(this,"SequencerByKey")}constructor(){this.promiseMap=new Map}queue(e,n){let i=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(n).finally(()=>{this.promiseMap.get(e)===i&&this.promiseMap.delete(e)});return this.promiseMap.set(e,i),i}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};h.SequencerByKey=hi;var H2=s((t,e)=>{let n=!0,r=setTimeout(()=>{n=!1,e()},t);return{isTriggered:s(()=>n,"isTriggered"),dispose:s(()=>{clearTimeout(r),n=!1},"dispose")}},"timeoutDeferred"),G2=s(t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:s(()=>e,"isTriggered"),dispose:s(()=>{e=!1},"dispose")}},"microtaskDeferred"),hn=class{static{s(this,"Delayer")}constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,n=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,o)=>{this.doResolve=i,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let i=this.task;return this.task=null,i()}}));let r=s(()=>{this.deferred=null,this.doResolve?.(null)},"fn");return this.deferred=n===U2.MicrotaskDelay?G2(r):H2(n,r),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new se.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}};h.Delayer=hn;var di=class{static{s(this,"ThrottledDelayer")}constructor(e){this.delayer=new hn(e),this.throttler=new fn}trigger(e,n){return this.delayer.trigger(()=>this.throttler.queue(e),n)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}};h.ThrottledDelayer=di;var dn=class{static{s(this,"Barrier")}constructor(){this._isOpen=!1,this._promise=new Promise((e,n)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};h.Barrier=dn;var mi=class extends dn{static{s(this,"AutoOpenBarrier")}constructor(e){super(),this._timeout=setTimeout(()=>this.open(),e)}open(){clearTimeout(this._timeout),super.open()}};h.AutoOpenBarrier=mi;function Pi(t,e){return e?new Promise((n,r)=>{let i=setTimeout(()=>{o.dispose(),n()},t),o=e.onCancellationRequested(()=>{clearTimeout(i),o.dispose(),r(new se.CancellationError)})}):T1(n=>Pi(t,n))}s(Pi,"timeout");function V2(t,e=0,n){let r=setTimeout(()=>{t(),n&&i.dispose()},e),i=(0,Me.toDisposable)(()=>{clearTimeout(r),n?.delete(i)});return n?.add(i),i}s(V2,"disposableTimeout");function K2(t){let e=[],n=0,r=t.length;function i(){return n!!r,n=null){let r=0,i=t.length,o=s(()=>{if(r>=i)return Promise.resolve(n);let u=t[r++];return Promise.resolve(u()).then(l=>e(l)?Promise.resolve(l):o())},"loop");return o()}s(Q2,"first");function Y2(t,e=r=>!!r,n=null){if(t.length===0)return Promise.resolve(n);let r=t.length,i=s(()=>{r=-1;for(let o of t)o.cancel?.()},"finish");return new Promise((o,u)=>{for(let a of t)a.then(l=>{--r>=0&&e(l)?(i(),o(l)):r===0&&o(n)}).catch(l=>{--r>=0&&(i(),u(l))})})}s(Y2,"firstParallel");var mn=class{static{s(this,"Limiter")}constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new wt.Emitter}whenIdle(){return this.size>0?wt.Event.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw new Error("Object has been disposed");return this._size++,new Promise((n,r)=>{this.outstandingPromises.push({factory:e,c:n,e:r}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromisesthis.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw new Error("Object has been disposed");this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}};h.Limiter=mn;var pn=class extends mn{static{s(this,"Queue")}constructor(){super(1)}};h.Queue=pn;var pi=class{static{s(this,"LimitedQueue")}constructor(){this.sequentializer=new _n,this.tasks=0}queue(e){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,e())):this.sequentializer.run(this.tasks++,e())}};h.LimitedQueue=pi;var gi=class{static{s(this,"ResourceQueue")}constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new ke;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,n=E1.extUri){let r=n.getComparisonKey(e);return this.queues.get(r)?.size??0}queueFor(e,n,r=E1.extUri){let i=r.getComparisonKey(e),o=this.queues.get(i);if(!o){o=new pn;let u=this.drainListenerCount++,a=wt.Event.once(o.onDrained)(()=>{o?.dispose(),this.queues.delete(i),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(u),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||(this.drainListeners=new Me.DisposableMap),this.drainListeners.set(u,a),this.queues.set(i,o)}return o.queue(n)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}};h.ResourceQueue=gi;var _i=class{static{s(this,"TaskQueue")}constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),n.p}scheduleSkipIfCleared(e){let n=new ke;return this._pendingTasks.push({task:e,deferred:n,setUndefinedWhenCleared:!0}),this._runIfNotRunning(),n.p}_runIfNotRunning(){this._runningTask===void 0&&this._processQueue()}async _processQueue(){if(this._pendingTasks.length===0)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new se.BugIndicatingError;this._runningTask=e.task;try{let n=await e.task();e.deferred.complete(n)}catch(n){e.deferred.error(n)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;this._pendingTasks=[];for(let n of e)n.setUndefinedWhenCleared?n.deferred.complete(void 0):n.deferred.error(new se.CancellationError)}};h.TaskQueue=_i;var bi=class{static{s(this,"TimeoutTimer")}constructor(e,n){this._isDisposed=!1,this._token=void 0,typeof e=="function"&&typeof n=="number"&&this.setIfNotSet(e,n)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==void 0&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,n){if(this._isDisposed)throw new se.BugIndicatingError("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},n)}setIfNotSet(e,n){if(this._isDisposed)throw new se.BugIndicatingError("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===void 0&&(this._token=setTimeout(()=>{this._token=void 0,e()},n))}};h.TimeoutTimer=bi;var Ci=class{static{s(this,"IntervalTimer")}constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,n,r=globalThis){if(this.isDisposed)throw new se.BugIndicatingError("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=r.setInterval(()=>{e()},n);this.disposable=(0,Me.toDisposable)(()=>{r.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};h.IntervalTimer=Ci;var Et=class{static{s(this,"RunOnceScheduler")}constructor(e,n){this.timeoutToken=void 0,this.runner=e,this.timeout=n,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};h.RunOnceScheduler=Et;var yi=class{static{s(this,"ProcessTimeRunOnceScheduler")}constructor(e,n){n%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${n}ms is not a multiple of 1000ms.`),this.runner=e,this.timeout=n,this.counter=0,this.intervalToken=void 0,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=void 0)}schedule(e=this.timeout){e%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${e}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(e/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==void 0}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=void 0,this.runner?.())}};h.ProcessTimeRunOnceScheduler=yi;var vi=class extends Et{static{s(this,"RunOnceWorker")}constructor(e,n){super(e,n),this.units=[]}work(e){this.units.push(e),this.isScheduled()||this.schedule()}doRun(){let e=this.units;this.units=[],this.runner?.(e)}dispose(){this.units=[],super.dispose()}};h.RunOnceWorker=vi;var wi=class extends Me.Disposable{static{s(this,"ThrottledWorker")}constructor(e,n){super(),this.options=e,this.handler=n,this.pendingWork=[],this.throttler=this._register(new Me.MutableDisposable),this.disposed=!1,this.lastExecutionTime=0}get pending(){return this.pendingWork.length}work(e){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+e.length>this.options.maxBufferedWork)return!1}else if(this.pending+e.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(let r of e)this.pendingWork.push(r);let n=Date.now()-this.lastExecutionTime;return!this.throttler.value&&(!this.options.waitThrottleDelayBetweenWorkUnits||n>=this.options.throttleDelay)?this.doWork():!this.throttler.value&&this.options.waitThrottleDelayBetweenWorkUnits&&this.scheduleThrottler(Math.max(this.options.throttleDelay-n,0)),!0}doWork(){this.lastExecutionTime=Date.now(),this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&this.scheduleThrottler()}scheduleThrottler(e=this.options.throttleDelay){this.throttler.value=new Et(()=>{this.throttler.clear(),this.doWork()},e),this.throttler.value.schedule()}dispose(){super.dispose(),this.pendingWork.length=0,this.disposed=!0}};h.ThrottledWorker=wi;(function(){let t=globalThis;typeof t.requestIdleCallback!="function"||typeof t.cancelIdleCallback!="function"?h._runWhenIdle=(e,n,r)=>{(0,F2.setTimeout0)(()=>{if(i)return;let o=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,o-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:h._runWhenIdle=(e,n,r)=>{let i=e.requestIdleCallback(n,typeof r=="number"?{timeout:r}:void 0),o=!1;return{dispose(){o||(o=!0,e.cancelIdleCallback(i))}}},h.runWhenGlobalIdle=(e,n)=>(0,h._runWhenIdle)(globalThis,e,n)})();function X2(t){let e=h._runWhenIdle,n=h.runWhenGlobalIdle;return h._runWhenIdle=t,h.runWhenGlobalIdle=(r,i)=>t(globalThis,r,i),(0,Me.toDisposable)(()=>{h._runWhenIdle=e,h.runWhenGlobalIdle=n})}s(X2,"installFakeRunWhenIdle");var gn=class{static{s(this,"AbstractIdleValue")}constructor(e,n){this._didRun=!1,this._executor=()=>{try{this._value=n()}catch(r){this._error=r}finally{this._didRun=!0}},this._handle=(0,h._runWhenIdle)(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}};h.AbstractIdleValue=gn;var Ei=class extends gn{static{s(this,"GlobalIdleValue")}constructor(e){super(globalThis,e)}};h.GlobalIdleValue=Ei;async function J2(t,e,n){let r;for(let i=0;ir?.(),"cancel"),promise:n},n.then(()=>this.doneRunning(e),()=>this.doneRunning(e)),n}doneRunning(e){this._running&&e===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){let e=this._queued;this._queued=void 0,e.run().then(e.promiseResolve,e.promiseReject)}}queue(e){if(this._queued)this._queued.run=e;else{let{promise:n,resolve:r,reject:i}=x1();this._queued={run:e,promise:n,promiseResolve:r,promiseReject:i}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}};h.TaskSequentializer=_n;var Li=class{static{s(this,"IntervalCounter")}constructor(e,n=()=>Date.now()){this.interval=e,this.nowFn=n,this.lastIncrementTime=0,this.value=0}increment(){let e=this.nowFn();return e-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=e,this.value=0),this.value++,this.value}};h.IntervalCounter=Li;var ke=class t{static{s(this,"DeferredPromise")}static fromPromise(e){let n=new t;return n.settleWith(e),n}get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,n)=>{this.completeCallback=e,this.errorCallback=n})}complete(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.completeCallback(e),this.outcome={outcome:0,value:e},n()})}error(e){return this.isSettled?Promise.resolve():new Promise(n=>{this.errorCallback(e),this.outcome={outcome:1,value:e},n()})}settleWith(e){return e.then(n=>this.complete(n),n=>this.error(n))}cancel(){return this.error(new se.CancellationError)}};h.DeferredPromise=ke;var L1;(function(t){async function e(r){let i,o=await Promise.all(r.map(u=>u.then(a=>a,a=>{i||(i=a)})));if(typeof i<"u")throw i;return o}s(e,"settled"),t.settled=e;function n(r){return new Promise(async(i,o)=>{try{await r(i,o)}catch(u){o(u)}})}s(n,"withAsyncBody"),t.withAsyncBody=n})(L1||(h.Promises=L1={}));var bn=class{static{s(this,"StatefulPromise")}get value(){return this._value}get error(){return this._error}get isResolved(){return this._isResolved}constructor(e){this._value=void 0,this._error=void 0,this._isResolved=!1,this.promise=e.then(n=>(this._value=n,this._isResolved=!0,n),n=>{throw this._error=n,this._isResolved=!0,n})}requireValue(){if(!this._isResolved)throw new se.BugIndicatingError("Promise is not resolved yet");if(this._error)throw this._error;return this._value}};h.StatefulPromise=bn;var Ni=class{static{s(this,"LazyStatefulPromise")}constructor(e){this._compute=e,this._promise=new q2.Lazy(()=>new bn(this._compute()))}requireValue(){return this._promise.value.requireValue()}getPromise(){return this._promise.value.promise}get currentValue(){return this._promise.rawValue?.value}};h.LazyStatefulPromise=Ni;var Cn=class t{static{s(this,"AsyncIterableObject")}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}constructor(e,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new wt.Emitter,queueMicrotask(async()=>{let r={emitOne:s(i=>this.emitOne(i),"emitOne"),emitMany:s(i=>this.emitMany(i),"emitMany"),reject:s(i=>this.reject(i),"reject")};try{await Promise.resolve(e(r)),this.resolve()}catch(i){this.reject(i)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:s(async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0}),"return")}}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}map(e){return t.map(this,e)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static async toPromise(e){let n=[];for await(let r of e)n.push(r);return n}toPromise(){return t.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};h.AsyncIterableObject=Cn;function Z2(t){let e=new xi.CancellationTokenSource,n=t(e.token);return new vn(e,async r=>{let i=e.token.onCancellationRequested(()=>{i.dispose(),e.dispose(),r.reject(new se.CancellationError)});try{for await(let o of n){if(e.token.isCancellationRequested)return;r.emitOne(o)}i.dispose(),e.dispose()}catch(o){i.dispose(),e.dispose(),r.reject(o)}})}s(Z2,"createCancelableAsyncIterableProducer");var Ti=class{static{s(this,"AsyncIterableSource")}constructor(e){this._deferred=new ke,this._asyncIterable=new Cn(i=>{if(n){i.reject(n);return}return r&&i.emitMany(r),this._errorFn=o=>i.reject(o),this._emitOneFn=o=>i.emitOne(o),this._emitManyFn=o=>i.emitMany(o),this._deferred.p},e);let n,r;this._errorFn=i=>{n||(n=i)},this._emitOneFn=i=>{r||(r=[]),r.push(i)},this._emitManyFn=i=>{r?i.forEach(o=>r.push(o)):r=i.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}};h.AsyncIterableSource=Ti;function ec(t,e){let n=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t;return{async next(){return e.isCancellationRequested?{done:!0,value:void 0}:await A1(n.next(),e)||{done:!0,value:void 0}},throw:n.throw?.bind(n),return:n.return?.bind(n),[Symbol.asyncIterator](){return this}}}s(ec,"cancellableIterable");var Ai=class{static{s(this,"ProducerConsumer")}constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let n=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(n,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let n of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(n,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new se.BugIndicatingError("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,n){n.ok?e.complete(n.value):e.error(n.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new ke;return this._unsatisfiedConsumers.push(e),e.p}}},yn=class t{static{s(this,"AsyncIterableProducer")}constructor(e,n){this._onReturn=n,this._producerConsumer=new Ai,this._iterator={next:s(()=>this._producerConsumer.consume(),"next"),return:s(()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),"return"),throw:s(async r=>(this._finishError(r),{done:!0,value:void 0}),"throw")},queueMicrotask(async()=>{let r=e({emitOne:s(i=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:i}}),"emitOne"),emitMany:s(i=>{for(let o of i)this._producerConsumer.produce({ok:!0,value:{done:!1,value:o}})},"emitMany"),reject:s(i=>this._finishError(i),"reject")});if(!this._producerConsumer.hasFinalValue)try{await r,this._finishOk()}catch(i){this._finishError(i)}})}static fromArray(e){return new t(n=>{n.emitMany(e)})}static fromPromise(e){return new t(async n=>{n.emitMany(await e)})}static fromPromisesResolveOrder(e){return new t(async n=>{await Promise.all(e.map(async r=>n.emitOne(await r)))})}static merge(e){return new t(async n=>{await Promise.all(e.map(async r=>{for await(let i of r)n.emitOne(i)}))})}static{this.EMPTY=t.fromArray([])}static map(e,n){return new t(async r=>{for await(let i of e)r.emitOne(n(i))})}static tee(e){let n,r,i=new ke,o=s(async()=>{if(!(!n||!r))try{for await(let l of e)n.emitOne(l),r.emitOne(l)}catch(l){n.reject(l),r.reject(l)}finally{i.complete()}},"start"),u=new t(async l=>(n=l,o(),i.p)),a=new t(async l=>(r=l,o(),i.p));return[u,a]}map(e){return t.map(this,e)}static coalesce(e){return t.filter(e,n=>!!n)}coalesce(){return t.coalesce(this)}static filter(e,n){return new t(async r=>{for await(let i of e)n(i)&&r.emitOne(i)})}filter(e){return t.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};h.AsyncIterableProducer=yn;var vn=class extends yn{static{s(this,"CancelableAsyncIterableProducer")}constructor(e,n){super(n),this._source=e}cancel(){this._source.cancel()}};h.CancelableAsyncIterableProducer=vn;h.AsyncReaderEndOfStream=Symbol("AsyncReaderEndOfStream");var ki=class{static{s(this,"AsyncReader")}get endOfStream(){return this._buffer.length===0&&this._atEnd}constructor(e){this._source=e,this._buffer=[],this._atEnd=!1}async read(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer.shift()}async readWhile(e,n){do{let r=await this.peek();if(r===h.AsyncReaderEndOfStream||!e(r))break;await this.read(),await n(r)}while(!0)}readBufferedOrThrow(){let e=this.peekBufferedOrThrow();return this._buffer.shift(),e}async consumeToEnd(){for(;!this.endOfStream;)await this.read()}async peek(){return this._buffer.length===0&&!this._atEnd&&await this._extendBuffer(),this._buffer.length===0?h.AsyncReaderEndOfStream:this._buffer[0]}peekBufferedOrThrow(){if(this._buffer.length===0){if(this._atEnd)return h.AsyncReaderEndOfStream;throw new se.BugIndicatingError("No buffered elements")}return this._buffer[0]}async peekTimeout(e){if(this._buffer.length===0&&!this._atEnd&&await k1(this._extendBuffer(),e),this._atEnd)return h.AsyncReaderEndOfStream;if(this._buffer.length!==0)return this._buffer[0]}_extendBuffer(){return this._atEnd?Promise.resolve():(this._extendBufferPromise||(this._extendBufferPromise=(async()=>{let{value:e,done:n}=await this._source.next();this._extendBufferPromise=void 0,n?this._atEnd=!0:this._buffer.push(e)})()),this._extendBufferPromise)}};h.AsyncReader=ki;function tc(t,e){let n=setTimeout(e,t);return(0,Me.toDisposable)(()=>clearTimeout(n))}s(tc,"createTimeout")});var I1=U(wn=>{"use strict";_();Object.defineProperty(wn,"__esModule",{value:!0});wn.Position=void 0;var Ii=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+n))}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumber{"use strict";_();Object.defineProperty(En,"__esModule",{value:!0});En.Range=void 0;var S1=I1(),Si=class t{static{s(this,"Range")}constructor(e,n,r,i){e>r||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new S1.Position(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new S1.Position(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};En.Range=Si});_();_();_();_();_();_();var st=class t{static{s(this,"Position")}constructor(e,n){this.lineNumber=e,this.column=n}with(e=this.lineNumber,n=this.column){return e===this.lineNumber&&n===this.column?this:new t(e,n)}delta(e=0,n=0){return this.with(this.lineNumber+e,this.column+n)}equals(e){return t.equals(this,e)}static equals(e,n){return!e&&!n?!0:!!e&&!!n&&e.lineNumber===n.lineNumber&&e.column===n.column}isBefore(e){return t.isBefore(this,e)}static isBefore(e,n){return e.lineNumberr||e===r&&n>i?(this.startLineNumber=r,this.startColumn=i,this.endLineNumber=e,this.endColumn=n):(this.startLineNumber=e,this.startColumn=n,this.endLineNumber=r,this.endColumn=i)}isEmpty(){return t.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return t.containsPosition(this,e)}static containsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.columne.endColumn)}static strictContainsPosition(e,n){return!(n.lineNumbere.endLineNumber||n.lineNumber===e.startLineNumber&&n.column<=e.startColumn||n.lineNumber===e.endLineNumber&&n.column>=e.endColumn)}containsRange(e){return t.containsRange(this,e)}static containsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumne.endColumn)}strictContainsRange(e){return t.strictContainsRange(this,e)}static strictContainsRange(e,n){return!(n.startLineNumbere.endLineNumber||n.endLineNumber>e.endLineNumber||n.startLineNumber===e.startLineNumber&&n.startColumn<=e.startColumn||n.endLineNumber===e.endLineNumber&&n.endColumn>=e.endColumn)}plusRange(e){return t.plusRange(this,e)}static plusRange(e,n){let r,i,o,u;return n.startLineNumbere.endLineNumber?(o=n.endLineNumber,u=n.endColumn):n.endLineNumber===e.endLineNumber?(o=n.endLineNumber,u=Math.max(n.endColumn,e.endColumn)):(o=e.endLineNumber,u=e.endColumn),new t(r,i,o,u)}intersectRanges(e){return t.intersectRanges(this,e)}static intersectRanges(e,n){let r=e.startLineNumber,i=e.startColumn,o=e.endLineNumber,u=e.endColumn,a=n.startLineNumber,l=n.startColumn,c=n.endLineNumber,d=n.endColumn;return rc?(o=c,u=d):o===c&&(u=Math.min(u,d)),r>o||r===o&&i>u?null:new t(r,i,o,u)}equalsRange(e){return t.equalsRange(this,e)}static equalsRange(e,n){return!e&&!n?!0:!!e&&!!n&&e.startLineNumber===n.startLineNumber&&e.startColumn===n.startColumn&&e.endLineNumber===n.endLineNumber&&e.endColumn===n.endColumn}getEndPosition(){return t.getEndPosition(this)}static getEndPosition(e){return new st(e.endLineNumber,e.endColumn)}getStartPosition(){return t.getStartPosition(this)}static getStartPosition(e){return new st(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,n){return new t(this.startLineNumber,this.startColumn,e,n)}setStartPosition(e,n){return new t(e,n,this.endLineNumber,this.endColumn)}collapseToStart(){return t.collapseToStart(this)}static collapseToStart(e){return new t(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return t.collapseToEnd(this)}static collapseToEnd(e){return new t(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new t(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,n=e){return new t(e.lineNumber,e.column,n.lineNumber,n.column)}static lift(e){return e?new t(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,n){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}};var Rn=250,In=4,Q1=/\w{2}/,Sn=class{static{s(this,"InlineApproximateTokenizer")}tokenLength(e){return Math.ceil(e.length/In)}},Y1="o200k_base",At=class{static{s(this,"NaiveChunker")}constructor(e=Y1){this.tokenizer=new Sn}getTokenCount(e){return this.tokenizer.tokenLength(e)}chunkFile(e,n,r={},i){let{maxTokenLength:o=Rn,removeEmptyLines:u=!0}=r,a=[];for(let l of this._processLinesIntoChunks(e,n,o,!0,u,i)){if(i?.isCancellationRequested)return[];(!u||l.text.length>0&&Q1.test(l.text))&&a.push(l)}return a}*_processLinesIntoChunks(e,n,r,i,o,u){let a=X1(n),l=[],c=0,d,f=!0;for(let D=0;D0?1:0;if(Math.ceil((c+X+H.length)/In)>r&&l.length>0){let oe=this.finalizeChunk(e,l,i,d??"",!1,f);oe&&(yield oe),l.length=0,c=0,d=void 0,f=!1}if(d===void 0||d.length>0){let oe=B.match(/^\s+/),K=oe?oe[0]:"";d=d?Z1(d,K):K}l.push({text:H,lineNumber:D}),c+=(l.length>1?1:0)+H.length}let y=this.finalizeChunk(e,l,i,d??"",!0,f);y&&(yield y)}finalizeChunk(e,n,r,i,o,u){if(!n.length)return;let a=r?n.map(c=>c.text.substring(i.length)).join(` +`):n.map(c=>c.text).join(` +`),l=n[n.length-1];return{file:e,text:a,rawText:a,isFullFile:u&&o,range:new Tt(n[0].lineNumber+1,1,l.lineNumber+1,l.text.length+1)}}};function X1(t){let e=[],n="";for(let r=0;r0&&e.push(n),e}s(X1,"splitLines");function J1(t){return t?t.trim().length===0:!0}s(J1,"isFalsyOrWhitespace");function Z1(t,e){let n=eo(t,e);return t.substring(0,n)}s(Z1,"commonLeadingStr");function eo(t,e){let n=Math.min(t.length,e.length),r=0;for(;rc.text)}getNaiveChunker(e){let n=this.naiveChunkers.get(e);if(n)return n;let r=new At(e);return this.naiveChunkers.set(e,r),r}clearCache(){this.naiveChunkers.clear()}};_();_();var On=":memory:";_();var xt=class{constructor(e,n=-1/0){this.maxSize=e;this.minScore=n;this.store=[]}static{s(this,"SimpleHeap")}toArray(e){if(this.store.length&&typeof e=="number"){let n=this.store.at(0).score*(1-e);return this.store.filter(r=>r.score>=n).map(r=>r.value)}return this.store.map(n=>n.value)}add(e,n){if(e<=this.minScore)return;let r=this.store.findIndex(i=>i.score=0?r:this.store.length,0,{score:e,value:n});this.store.length>this.maxSize;)this.store.pop();this.store.length===this.maxSize&&(this.minScore=this.store.at(-1)?.score??this.minScore)}get size(){return this.store.length}get currentMinScore(){return this.minScore}clear(){this.store.length=0,this.minScore=-1/0}};_();function Dn(t){let e=Object.create(null);for(let n of t)e[n]=(e[n]??0)+1;return e}s(Dn,"countRecordFrom");function Mn(t){return Dn(to(t))}s(Mn,"termFrequencies");function*to(t){let e=s(n=>n.toLowerCase(),"normalize");for(let[n]of t.matchAll(/(?1&&i.push(...o);let u=n.split("_");u.length>1&&i.push(...u);let a=n.match(new RegExp("^([\\D]+)\\p{Number}+$","u"));a&&i.push(a[1]);for(let l of i)l.length>2&&/[\p{Alphabetic}_$]{3,}/gu.test(l)&&r.add(e(l));yield*r}}s(to,"splitTerms");var R1=Pe(P1()),O1=Pe(Ri()),D1=Pe(require("fs")),Oi=Pe(require("node:sqlite")),M1=Pe(require("path"));var Ln=class{static{s(this,"PersistentTfIdf")}constructor(e,n){this.hostApi=n;let r={open:!0};if(e!==On)try{D1.default.mkdirSync(M1.default.dirname(e),{recursive:!0}),this.db=new Oi.default.DatabaseSync(e,r)}catch(i){this.hostApi.logWarn("Failed to open SQLite database on disk. Trying memory db",i)}this.db||(this.db=new Oi.default.DatabaseSync(On,r)),this.db.exec(` PRAGMA foreign_keys = ON; PRAGMA journal_mode = OFF; PRAGMA synchronous = 0; @@ -72,18 +64,18 @@ ${h.join(` CREATE INDEX IF NOT EXISTS idx_documents_uri ON Documents(uri); CREATE INDEX IF NOT EXISTS idx_chunks_documentId ON Chunks(documentId); - `)}initialize(e){let t=new Map;for(let{uri:l,contentId:c}of e)t.set(l,c);let r=this.db.prepare("SELECT * FROM Documents").all(),i=new Map;for(let l of r)try{let c=l.uri;i.set(c,l.contentVersionId)}catch(c){this.hostApi.logWarn(`Failed to parse URI from database entry, skip processing it: ${l.uri}`,c)}let o=new Set,u=new Set;for(let[l,c]of i){let h=t.get(l);h?h!==c&&u.add(l):o.add(l)}let a=new Set;for(let l of t.keys())i.has(l)||a.add(l);return this.delete(Array.from(o)),{outOfSyncDocs:u,newDocs:a,deletedDocs:o}}async isUpToDate(e){return this.getDocContentVersionId(e.uri)===await e.getContentVersionId()}getDocContentVersionId(e){return this.db.prepare("SELECT contentVersionId FROM Documents WHERE uri = ?").get(e)?.contentVersionId}async addOrUpdate(e){let t=new Lo.Limiter(20);try{let r=await Promise.all(e.map(async i=>{try{return await this.isUpToDate(i)?void 0:{uri:i.uri,getDoc:s(async()=>{let o=[];for(let u of await t.queue(()=>i.getChunks())){let a=lr(u.text);o.push({chunk:u,tf:a})}return{contentVersionId:await i.getContentVersionId(),chunks:o}},"getDoc")}}catch{}}));await this.addOrUpdateDocs(r.filter(i=>!!i))}finally{t.dispose()}}delete(e){this.db.exec("BEGIN TRANSACTION");for(let t of e){let r=this.getDoc(t);if(!r)continue;this.db.prepare("DELETE FROM Documents WHERE uri = ?").run(t),this._cachedChunkCount=void 0;let i=ar(r.chunks.flatMap(o=>Object.keys(o.tf)));for(let[o,u]of Object.entries(i))this.db.prepare(` + `)}initialize(e){let n=new Map;for(let{uri:l,contentId:c}of e)n.set(l,c);let r=this.db.prepare("SELECT * FROM Documents").all(),i=new Map;for(let l of r)try{let c=l.uri;i.set(c,l.contentVersionId)}catch(c){this.hostApi.logWarn(`Failed to parse URI from database entry, skip processing it: ${l.uri}`,c)}let o=new Set,u=new Set;for(let[l,c]of i){let d=n.get(l);d?d!==c&&u.add(l):o.add(l)}let a=new Set;for(let l of n.keys())i.has(l)||a.add(l);return this.delete(Array.from(o)),{outOfSyncDocs:u,newDocs:a,deletedDocs:o}}async isUpToDate(e){return this.getDocContentVersionId(e.uri)===await e.getContentVersionId()}getDocContentVersionId(e){return this.db.prepare("SELECT contentVersionId FROM Documents WHERE uri = ?").get(e)?.contentVersionId}async addOrUpdate(e){let n=new R1.Limiter(20);try{let r=await Promise.all(e.map(async i=>{try{return await this.isUpToDate(i)?void 0:{uri:i.uri,getDoc:s(async()=>{let o=[];for(let u of await n.queue(()=>i.getChunks())){let a=Mn(u.text);o.push({chunk:u,tf:a})}return{contentVersionId:await i.getContentVersionId(),chunks:o}},"getDoc")}}catch{}}));await this.addOrUpdateDocs(r.filter(i=>!!i))}finally{n.dispose()}}delete(e){this.db.exec("BEGIN TRANSACTION");for(let n of e){let r=this.getDoc(n);if(!r)continue;this.db.prepare("DELETE FROM Documents WHERE uri = ?").run(n),this._cachedChunkCount=void 0;let i=Dn(r.chunks.flatMap(o=>Object.keys(o.tf)));for(let[o,u]of Object.entries(i))this.db.prepare(` UPDATE ChunkOccurrences SET chunkCount = chunkCount - ? WHERE term = ?; `).run(u,o)}this.db.exec("COMMIT"),this.db.prepare(` DELETE FROM ChunkOccurrences WHERE chunkCount < 1; - `).run()}get fileCount(){return this.db.prepare("SELECT COUNT(*) as count FROM Documents").get()?.count??0}search(e,t){let r=new Gt(t?.maxResults??1/0,-1/0),i=this.computeEmbeddings(e);if(!i.size)return[];let o=new Map;for(let u of this.getAllChunksWithTerms(Array.from(i.keys()))){let a=this.score(u,i,o);a>0&&r.add(a,u.chunk)}return r.toArray(t?.maxSpread)}computeEmbeddings(e){let t=lr(e);return this.computeTfidf(t)}score(e,t,r){let i=0;for(let[o,u]of t.entries()){let a=e.tf[o];if(!a)continue;let l=r.get(o);typeof l!="number"&&(l=this.idf(o),r.set(o,l));let c=a*l;i+=c*u}return i}idf(e){let t=this.getChunkOccurrences(e)??0;return t>0?Math.log((this.getChunkCount()+1)/t):0}computeTfidf(e){let t=new Map;for(let[r,i]of Object.entries(e)){let o=this.idf(r);o>0&&t.set(r,i*o)}return t}getChunkCount(){return typeof this._cachedChunkCount=="number"?this._cachedChunkCount:this.db.prepare("SELECT COUNT(*) as count FROM Chunks").get()?.count??0}getChunkOccurrences(e){return this.db.prepare("SELECT chunkCount FROM ChunkOccurrences WHERE term = ?").get(e)?.chunkCount??0}async addOrUpdateDocs(e){this._cachedChunkCount=void 0;let t=Object.create(null),r=s(a=>{this.delete(a.map(l=>l.uri)),this.db.exec("BEGIN TRANSACTION");try{for(let{uri:l,doc:c}of a){let h=this.db.prepare("INSERT OR REPLACE INTO Documents (uri, contentVersionId) VALUES (?, ?)").run(l,c.contentVersionId).lastInsertRowid,f=this.db.prepare("INSERT INTO Chunks (documentId, text, startLineNumber, startColumn, endLineNumber, endColumn, isFullFile, termFrequencies) VALUES (?, ?, ?, ?, ?, ?, ?, jsonb(?))");for(let _ of c.chunks){f.run(h,_.chunk.text,_.chunk.range.startLineNumber,_.chunk.range.startColumn,_.chunk.range.endLineNumber,_.chunk.range.endColumn,_.chunk.isFullFile?1:0,JSON.stringify(_.tf));for(let A of Object.keys(_.tf))t[A]=(t[A]??0)+1}}this.db.exec("COMMIT")}catch(l){throw this.db.exec("ROLLBACK"),l}},"processBatch"),i=200,o=[];for(let a of e){try{o.push({uri:a.uri,doc:await a.getDoc()})}catch(l){this.hostApi.logWarn(`Failed to get document data for ${a.uri}, skip processing it:`,l);continue}o.length>=i&&(r(o),o.length=0)}r(o);let u=this.db.prepare(` + `).run()}get fileCount(){return this.db.prepare("SELECT COUNT(*) as count FROM Documents").get()?.count??0}search(e,n){let r=new xt(n?.maxResults??1/0,-1/0),i=this.computeEmbeddings(e);if(!i.size)return[];let o=new Map;for(let u of this.getAllChunksWithTerms(Array.from(i.keys()))){let a=this.score(u,i,o);a>0&&r.add(a,u.chunk)}return r.toArray(n?.maxSpread)}computeEmbeddings(e){let n=Mn(e);return this.computeTfidf(n)}score(e,n,r){let i=0;for(let[o,u]of n.entries()){let a=e.tf[o];if(!a)continue;let l=r.get(o);typeof l!="number"&&(l=this.idf(o),r.set(o,l));let c=a*l;i+=c*u}return i}idf(e){let n=this.getChunkOccurrences(e)??0;return n>0?Math.log((this.getChunkCount()+1)/n):0}computeTfidf(e){let n=new Map;for(let[r,i]of Object.entries(e)){let o=this.idf(r);o>0&&n.set(r,i*o)}return n}getChunkCount(){return typeof this._cachedChunkCount=="number"?this._cachedChunkCount:this.db.prepare("SELECT COUNT(*) as count FROM Chunks").get()?.count??0}getChunkOccurrences(e){return this.db.prepare("SELECT chunkCount FROM ChunkOccurrences WHERE term = ?").get(e)?.chunkCount??0}async addOrUpdateDocs(e){this._cachedChunkCount=void 0;let n=Object.create(null),r=s(a=>{this.delete(a.map(l=>l.uri)),this.db.exec("BEGIN TRANSACTION");try{for(let{uri:l,doc:c}of a){let d=this.db.prepare("INSERT OR REPLACE INTO Documents (uri, contentVersionId) VALUES (?, ?)").run(l,c.contentVersionId).lastInsertRowid,f=this.db.prepare("INSERT INTO Chunks (documentId, text, startLineNumber, startColumn, endLineNumber, endColumn, isFullFile, termFrequencies) VALUES (?, ?, ?, ?, ?, ?, ?, jsonb(?))");for(let y of c.chunks){f.run(d,y.chunk.text,y.chunk.range.startLineNumber,y.chunk.range.startColumn,y.chunk.range.endLineNumber,y.chunk.range.endColumn,y.chunk.isFullFile?1:0,JSON.stringify(y.tf));for(let D of Object.keys(y.tf))n[D]=(n[D]??0)+1}}this.db.exec("COMMIT")}catch(l){throw this.db.exec("ROLLBACK"),l}},"processBatch"),i=200,o=[];for(let a of e){try{o.push({uri:a.uri,doc:await a.getDoc()})}catch(l){this.hostApi.logWarn(`Failed to get document data for ${a.uri}, skip processing it:`,l);continue}o.length>=i&&(r(o),o.length=0)}r(o);let u=this.db.prepare(` INSERT INTO ChunkOccurrences (term, chunkCount) VALUES (?, ?) ON CONFLICT(term) DO UPDATE SET chunkCount = chunkCount + ?; - `);this.db.exec("BEGIN TRANSACTION");for(let[a,l]of Object.entries(t))u.run(a,l,l);this.db.exec("COMMIT")}getDoc(e){let t=this.db.prepare("SELECT id, contentVersionId FROM Documents WHERE uri = ?").get(e);if(!t)return;let r=this.db.prepare("SELECT text, startLineNumber, startColumn, endLineNumber, endColumn, isFullFile, json(termFrequencies) as termFrequencies FROM Chunks WHERE documentId = ?").all(t.id);return{contentVersionId:t.contentVersionId,chunks:r.map(i=>this.reviveDocumentChunkEntry({...i,uri:e}))}}getAllChunksWithTerms(e){return e.length?this.db.prepare(` + `);this.db.exec("BEGIN TRANSACTION");for(let[a,l]of Object.entries(n))u.run(a,l,l);this.db.exec("COMMIT")}getDoc(e){let n=this.db.prepare("SELECT id, contentVersionId FROM Documents WHERE uri = ?").get(e);if(!n)return;let r=this.db.prepare("SELECT text, startLineNumber, startColumn, endLineNumber, endColumn, isFullFile, json(termFrequencies) as termFrequencies FROM Chunks WHERE documentId = ?").all(n.id);return{contentVersionId:n.contentVersionId,chunks:r.map(i=>this.reviveDocumentChunkEntry({...i,uri:e}))}}getAllChunksWithTerms(e){return e.length?this.db.prepare(` SELECT c.id, c.documentId, c.text, c.startLineNumber, c.startColumn, c.endLineNumber, c.endColumn, c.isFullFile, json(c.termFrequencies) as termFrequencies, d.uri FROM Chunks c @@ -92,7 +84,7 @@ ${h.join(` SELECT 1 FROM json_each(c.termFrequencies) WHERE json_each.key IN (${e.map(r=>"?").join(",")}) ) - `).all(...e).map(r=>this.reviveDocumentChunkEntry(r)):[]}reviveDocumentChunkEntry(e){return{tf:JSON.parse(e.termFrequencies),get chunk(){return{file:e.uri,text:e.text,rawText:e.text,range:new To.Range(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),isFullFile:!!e.isFullFile}}}}};d();var as=_e(os());function Wn(n,e){if(!n)return n;if(Array.isArray(n))return n.map(t=>Wn(t,e));if(typeof n=="object"){let t=e(n);if(t)return t;let r={},i=n;for(let o in i){let u=i[o];r[o]=Wn(u,e)}return r}return n}s(Wn,"rewriteObject");function ls(n){return Wn(n,e=>{if(e instanceof as.Range)return{$mid:"range",startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn}})}s(ls,"serialize");function f0(n){return n.$mid==="range"}s(f0,"isSerializedRange");function cs(n){return Wn(n,e=>{let t=e;if(f0(t))return new as.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn)})}s(cs,"revive");d();d();var Bn=class{constructor(){this.nextId=1;this.handlers=new Map}static{s(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,t,r,i=new Promise((o,u)=>{t=o,r=u});return this.handlers.set(e,{resolve:t,reject:r}),{id:e,result:i}}handleResponse(e){let t=this.handlers.get(e.id);t&&(this.handlers.delete(e.id),e.err?t.reject(e.err):t.resolve(e.res))}handleError(e){for(let t of this.handlers.values())t.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function Ao(n){let e={get:s((t,r)=>{if(typeof r=="string")return t[r]||(t[r]=(...i)=>n(r,i)),t[r]},"get")};return new Proxy(Object.create(null),e)}s(Ao,"createRpcProxy");var Po=_e(yn()),fs=_e(ri());var hs=class{constructor(e,t){this.responseHandler=new Bn;this.port=e,this.worker=t,this.port.on("message",r=>{r&&typeof r=="object"&&r.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",r=>{"fn"in r?this.handleRequest(r):this.responseHandler.handleResponse(r)}),this.proxy=Ao((r,i)=>{let{id:o,result:u}=this.responseHandler.createHandler();return this.port.postMessage({id:o,fn:r,args:ls(i)}),u.then(a=>cs(a))})}static{s(this,"Host")}async handleRequest(e){try{let t=cs(e.args),r=this.worker[e.fn];if(typeof r!="function")throw new Error(`Unknown method: ${e.fn}`);let i=await r.apply(this.worker,Array.isArray(t)?t:[t]);this.port.postMessage({id:e.id,res:ls(i)})}catch(t){this.port.postMessage({id:e.id,err:t instanceof Error?t:new Error(String(t))})}}},$n=class{constructor(e,t){this._pendingChanges=new Map;let r=t.dbPath;this._host=new hs(e,this),this._tfIdf=new jn(r,this._host.proxy),this._chunker=new Ht,this._tokenizerName=t.tokenizer}static{s(this,"TfidfWorker")}initialize(e){let t=new fs.StopWatch,{outOfSyncDocs:r,newDocs:i,deletedDocs:o}=this._tfIdf.initialize(e.map(a=>({uri:a.uri,contentId:a.contentId})));for(let a of[...r,...i])this._pendingChanges.set(a,"update");let u=t.elapsed();return{newFileCount:i.size,outOfSyncFileCount:r.size,deletedFileCount:o.size,initTime:u}}addOrUpdate(e){for(let t of e)this._pendingChanges.set(t,"update")}delete(e){for(let t of e)this._pendingChanges.set(t,"delete")}async search(e,t){let r=new fs.StopWatch,i=this._pendingChanges.size;await this._flushPendingChanges();let o=r.elapsed();r.reset();let u=this._tfIdf.search(e,t),a=r.elapsed();return{chunks:u,telemetry:{fileCount:this._tfIdf.fileCount,updatedFileCount:i,updateTime:o,searchTime:a}}}async _flushPendingChanges(){if(!this._pendingChanges.size)return;let e=[];for(let[r,i]of this._pendingChanges.entries())i==="delete"&&e.push(r);e.length&&this._tfIdf.delete(e);let t=[];for(let[r,i]of this._pendingChanges.entries())if(i==="update"){let o=new Po.Lazy(()=>this._host.proxy.getContentVersionId(r));t.push({uri:r,getContentVersionId:s(()=>o.value,"getContentVersionId"),getChunks:s(async()=>{let u=await this._host.proxy.readFile(r);return this.getRawNaiveChunks(r,u)},"getChunks")})}t.length&&await this._tfIdf.addOrUpdate(t),this._pendingChanges.clear()}getRawNaiveChunks(e,t){try{return this._chunker.chunkFile(this._tokenizerName,e,t,{}).map(i=>({file:e,text:i.text,rawText:i.rawText,range:i.range,isFullFile:i.isFullFile}))}catch(r){return this._host.proxy.logError(`Could not chunk: ${e}`,r),[]}}};var Rt=require("worker_threads");function h0(){let n=Rt.parentPort;if(!n)throw new Error("This module should only be used in a worker thread.");if(!Rt.workerData)throw new Error("Expected 'workerData' to be provided to the worker thread.");new $n(n,Rt.workerData)}s(h0,"main");h0(); + `).all(...e).map(r=>this.reviveDocumentChunkEntry(r)):[]}reviveDocumentChunkEntry(e){return{tf:JSON.parse(e.termFrequencies),get chunk(){return{file:e.uri,text:e.text,rawText:e.text,range:new O1.Range(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),isFullFile:!!e.isFullFile}}}}};_();var Di=Pe(Ri());function Nn(t,e){if(!t)return t;if(Array.isArray(t))return t.map(n=>Nn(n,e));if(typeof t=="object"){let n=e(t);if(n)return n;let r={},i=t;for(let o in i){let u=i[o];r[o]=Nn(u,e)}return r}return t}s(Nn,"rewriteObject");function Mi(t){return Nn(t,e=>{if(e instanceof Di.Range)return{$mid:"range",startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn}})}s(Mi,"serialize");function nc(t){return t.$mid==="range"}s(nc,"isSerializedRange");function Fi(t){return Nn(t,e=>{let n=e;if(nc(n))return new Di.Range(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn)})}s(Fi,"revive");_();_();var Tn=class{constructor(){this.nextId=1;this.handlers=new Map}static{s(this,"RpcResponseHandler")}createHandler(){let e=this.nextId++,n,r,i=new Promise((o,u)=>{n=o,r=u});return this.handlers.set(e,{resolve:n,reject:r}),{id:e,result:i}}handleResponse(e){let n=this.handlers.get(e.id);n&&(this.handlers.delete(e.id),e.err?n.reject(e.err):n.resolve(e.res))}handleError(e){for(let n of this.handlers.values())n.reject(e);this.handlers.clear()}clear(){this.handlers.clear()}};function F1(t){let e={get:s((n,r)=>{if(typeof r=="string")return n[r]||(n[r]=(...i)=>t(r,i)),n[r]},"get")};return new Proxy(Object.create(null),e)}s(F1,"createRpcProxy");var U1=Pe(tn()),Ui=Pe(Pr());var qi=class{constructor(e,n){this.responseHandler=new Tn;this.port=e,this.worker=n,this.port.on("message",r=>{r&&typeof r=="object"&&r.__perf__&&this.port.postMessage({__perf__:!0,memoryUsage:process.memoryUsage()})}),this.port.on("message",r=>{"fn"in r?this.handleRequest(r):this.responseHandler.handleResponse(r)}),this.proxy=F1((r,i)=>{let{id:o,result:u}=this.responseHandler.createHandler();return this.port.postMessage({id:o,fn:r,args:Mi(i)}),u.then(a=>Fi(a))})}static{s(this,"Host")}async handleRequest(e){try{let n=Fi(e.args),r=this.worker[e.fn];if(typeof r!="function")throw new Error(`Unknown method: ${e.fn}`);let i=await r.apply(this.worker,Array.isArray(n)?n:[n]);this.port.postMessage({id:e.id,res:Mi(i)})}catch(n){this.port.postMessage({id:e.id,err:n instanceof Error?n:new Error(String(n))})}}},An=class{constructor(e,n){this._pendingChanges=new Map;let r=n.dbPath;this._host=new qi(e,this),this._tfIdf=new Ln(r,this._host.proxy),this._chunker=new kt,this._tokenizerName=n.tokenizer}static{s(this,"TfidfWorker")}initialize(e){let n=new Ui.StopWatch,{outOfSyncDocs:r,newDocs:i,deletedDocs:o}=this._tfIdf.initialize(e.map(a=>({uri:a.uri,contentId:a.contentId})));for(let a of[...r,...i])this._pendingChanges.set(a,"update");let u=n.elapsed();return{newFileCount:i.size,outOfSyncFileCount:r.size,deletedFileCount:o.size,initTime:u}}addOrUpdate(e){for(let n of e)this._pendingChanges.set(n,"update")}delete(e){for(let n of e)this._pendingChanges.set(n,"delete")}async search(e,n){let r=new Ui.StopWatch,i=this._pendingChanges.size;await this._flushPendingChanges();let o=r.elapsed();r.reset();let u=this._tfIdf.search(e,n),a=r.elapsed();return{chunks:u,telemetry:{fileCount:this._tfIdf.fileCount,updatedFileCount:i,updateTime:o,searchTime:a}}}async _flushPendingChanges(){if(!this._pendingChanges.size)return;let e=[];for(let[r,i]of this._pendingChanges.entries())i==="delete"&&e.push(r);e.length&&this._tfIdf.delete(e);let n=[];for(let[r,i]of this._pendingChanges.entries())if(i==="update"){let o=new U1.Lazy(()=>this._host.proxy.getContentVersionId(r));n.push({uri:r,getContentVersionId:s(()=>o.value,"getContentVersionId"),getChunks:s(async()=>{let u=await this._host.proxy.readFile(r);return this.getRawNaiveChunks(r,u)},"getChunks")})}n.length&&await this._tfIdf.addOrUpdate(n),this._pendingChanges.clear()}getRawNaiveChunks(e,n){try{return this._chunker.chunkFile(this._tokenizerName,e,n,{}).map(i=>({file:e,text:i.text,rawText:i.rawText,range:i.range,isFullFile:i.isFullFile}))}catch(r){return this._host.proxy.logError(`Could not chunk: ${e}`,r),[]}}};var Lt=require("worker_threads");function rc(){let t=Lt.parentPort;if(!t)throw new Error("This module should only be used in a worker thread.");if(!Lt.workerData)throw new Error("Expected 'workerData' to be provided to the worker thread.");new An(t,Lt.workerData)}s(rc,"main");rc(); //!!! DO NOT modify, this file was COPIED from 'microsoft/vscode' /*! Bundled license information: diff --git a/doc/copilot.txt b/doc/copilot.txt index 0600ffc3..8b267282 100644 --- a/doc/copilot.txt +++ b/doc/copilot.txt @@ -1,4 +1,5 @@ -*copilot.txt*Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot +*copilot.txt* Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot + For NVIM v0.11.0 Last change: 11 June, 2026 ============================================================================== 1. copilot.lua *copilot-copilot.lua* @@ -97,16 +98,16 @@ To sign in with a different account: :Copilot auth signin < -To view your current authentication token information: +To view your current authentication status: > :Copilot auth info < -Credentials are stored in: - **Linux/macOS:** -`~/.config/github-copilot/apps.json` (or -`$XDG_CONFIG_HOME/github-copilot/apps.json`) - **Windows:** -`~/AppData/Local/github-copilot/apps.json` +Credentials are stored by the Copilot Language Server in: - **Linux/macOS:** +`~/.config/github-copilot/auth.db` (or +`$XDG_CONFIG_HOME/github-copilot/auth.db`) - **Windows:** +`~/AppData/Local/github-copilot/auth.db` AUTHENTICATION WITH ALTERNATE GITHUB INSTANCES diff --git a/lua/copilot/util.lua b/lua/copilot/util.lua index f156a6a5..ec170437 100644 --- a/lua/copilot/util.lua +++ b/lua/copilot/util.lua @@ -21,7 +21,7 @@ function M.get_editor_info() editorPluginInfo = { name = "copilot.lua", -- reflects version of github/copilot-language-server-release - version = "1.503.0", + version = "1.506.0", }, } return info